From xen-devel-bounces@lists.xenproject.org Sat Jul 01 00:31:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 00:31:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557671.871267 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWn-00016a-Bp; Sat, 01 Jul 2023 00:31:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557671.871267; Sat, 01 Jul 2023 00:31:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWn-000161-7S; Sat, 01 Jul 2023 00:31:53 +0000
Received: by outflank-mailman (input) for mailman id 557671;
 Sat, 01 Jul 2023 00:31:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFOWl-0007yB-9M
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 00:31:51 +0000
Received: from mail-oa1-x31.google.com (mail-oa1-x31.google.com
 [2001:4860:4864:20::31])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ab2fcc9f-17a6-11ee-b237-6b7b168915f2;
 Sat, 01 Jul 2023 02:31:50 +0200 (CEST)
Received: by mail-oa1-x31.google.com with SMTP id
 586e51a60fabf-1b0156a1c49so2153119fac.0
 for <xen-devel@lists.xenproject.org>; Fri, 30 Jun 2023 17:31:50 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s68-20020a632c47000000b0055b61cd99a1sm1824296pgs.81.2023.06.30.17.31.47
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Jun 2023 17:31:48 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: ab2fcc9f-17a6-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688171508; x=1690763508;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=0U+LCev7aRUe6kzgwNY1PJd28KyRT3ussnezbfZRMiA=;
        b=WV+aJ1zVjq4nXbKPyve69zH6JoluUFgsXQ5zQkMXcB2gh0mkT3mMnKBgSwybZpyzla
         jz0D5iwm/fIfnp1y0vMlFyN2W64XDxHa8OCwuKwCSNZV9N22ACjvKBfz98txPImUb88z
         JYcqXFqcGCJM5LNpzRMBe1pSvD1kKEXulmDgIjnjCxwRV48RgP7CcQonF5yUB1MhPvZF
         EjQVnESOoVXDThQ9H148u0UULZB6DO37JfHnRgFkgbEbykyvqnnoxp5d9NIv6tuOZLnT
         VVr74xNXIplbDpbObtcZPEk/gCfqoRnuSwHRP5HG7tE8lBwxytN+STeILwOg9+UCeY9G
         WExg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688171508; x=1690763508;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=0U+LCev7aRUe6kzgwNY1PJd28KyRT3ussnezbfZRMiA=;
        b=FpFC3LGawWmZMiPWcWoBen4PLZTgTLVeaMwnU1qnx4ZXJTKn1AvmgJF9wdyQ9GXDg9
         kBVPX5AaiJDFQCfgVKXWFok859htOEe1zvIg2QNLMyEBaTmUTfiqSFlZdYHd/tvPx8sY
         wfcpn6xsozoyDzoaDxiUe5+0pWo5EWV7IWyoyrsKfQTL2fNky8RaghsEpTcNFi0/+jCi
         KRsM3ZYYS9INRL1rSK9vXuqCXwSsObRVRAtrDtXHew/O0AOBqyFpJSL1JdpUMVqmmWG3
         qyWyyxuobhN+GiNWu5dzxYEwag7Y8PwGOI5fJdddc9EbuEM3TLPIgVhf7eSTlmM5aGUZ
         uCmA==
X-Gm-Message-State: ABy/qLatbhEfMEIVUkEWREUZNSvJtzs0+qGhEeobA0vT3V3tztWodjYc
	ox0YsjrAhtVvOE/BwvJdi+SCtwYlvmk=
X-Google-Smtp-Source: APBJJlF3sIquE7SEmuOVCL336/ZZA3DJYpw9wCSH58nhp6htUSRqmBAs9VrAM0wy0VnaimSdTk7oBw==
X-Received: by 2002:a05:6870:ac26:b0:1ad:5634:750b with SMTP id kw38-20020a056870ac2600b001ad5634750bmr4621178oab.13.1688171508647;
        Fri, 30 Jun 2023 17:31:48 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 07/11] x86 boot: define paddr_t and add macros for typedefing struct pointers
Date: Fri, 30 Jun 2023 17:31:28 -0700
Message-Id: <20230701003132.2210306-8-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
References: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Pointer fields within structs need to be defined as fixed size types in
the x86 boot build environment. Using a typedef for the field type
rather than a struct pointer type enables the type definition to
be changed in the 32-bit boot build and the main hypervisor build,
allowing for a single common structure definition and a common header file.

Introduces DEFINE_STRUCT_PTR_TYPE which will generate typedefs with a
_ptr_t suffix for pointers to the specified struct. This is then used
in <xen/bootinfo.h>

The 32-bit behaviour is obtained by inclusion of "defs.h" first with a
check for such an existing definition on the <xen/types.h> version.

paddr_t is used in <xen/bootinfo.h> so a definition is added here to
the x86 boot environment defs.h header.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

New in v2 of series
---
 xen/arch/x86/boot/defs.h            | 5 +++++
 xen/arch/x86/include/asm/bootinfo.h | 2 ++
 xen/include/xen/bootinfo.h          | 7 ++++---
 xen/include/xen/types.h             | 5 +++++
 4 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/boot/defs.h b/xen/arch/x86/boot/defs.h
index f9840044ec..867df6d18d 100644
--- a/xen/arch/x86/boot/defs.h
+++ b/xen/arch/x86/boot/defs.h
@@ -60,4 +60,9 @@ typedef u64 uint64_t;
 #define U16_MAX		((u16)(~0U))
 #define UINT_MAX	(~0U)
 
+typedef unsigned long long paddr_t;
+
+#define DEFINE_STRUCT_PTR_TYPE(struct_name) \
+    typedef uint64_t struct_name ## _ptr_t;
+
 #endif /* __BOOT_DEFS_H__ */
diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index 30c27980e0..8d1261503d 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -6,6 +6,7 @@ struct arch_bootmodule {
     uint32_t flags;
     unsigned headroom;
 };
+DEFINE_STRUCT_PTR_TYPE(arch_bootmodule);
 
 struct arch_boot_info {
     uint32_t flags;
@@ -19,6 +20,7 @@ struct arch_boot_info {
     uint32_t mmap_length;
     paddr_t mmap_addr;
 };
+DEFINE_STRUCT_PTR_TYPE(arch_boot_info);
 
 struct __packed mb_memmap {
     uint32_t size;
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
index 2f4284a91f..8ee3ee36e9 100644
--- a/xen/include/xen/bootinfo.h
+++ b/xen/include/xen/bootinfo.h
@@ -35,17 +35,18 @@ struct boot_module {
     mfn_t mfn;
     size_t size;
 
-    struct arch_bootmodule *arch;
+    arch_bootmodule_ptr_t arch;
     struct boot_string string;
 };
+DEFINE_STRUCT_PTR_TYPE(boot_module);
 
 struct boot_info {
     char *cmdline;
 
     unsigned int nr_mods;
-    struct boot_module *mods;
+    boot_module_ptr_t mods;
 
-    struct arch_boot_info *arch;
+    arch_boot_info_ptr_t arch;
 };
 
 #endif
diff --git a/xen/include/xen/types.h b/xen/include/xen/types.h
index 6aba80500a..78a2079619 100644
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -71,4 +71,9 @@ typedef bool bool_t;
 #define test_and_set_bool(b)   xchg(&(b), true)
 #define test_and_clear_bool(b) xchg(&(b), false)
 
+#ifndef DEFINE_STRUCT_PTR_TYPE
+#define DEFINE_STRUCT_PTR_TYPE(struct_name) \
+    typedef struct struct_name * struct_name ## _ptr_t;
+#endif
+
 #endif /* __TYPES_H__ */
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 00:31:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 00:31:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557667.871228 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWi-0008SK-KP; Sat, 01 Jul 2023 00:31:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557667.871228; Sat, 01 Jul 2023 00:31:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWi-0008SD-HG; Sat, 01 Jul 2023 00:31:48 +0000
Received: by outflank-mailman (input) for mailman id 557667;
 Sat, 01 Jul 2023 00:31:47 +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
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFOWh-0007yM-JQ
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 00:31:47 +0000
Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com
 [2607:f8b0:4864:20::431])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a6965cda-17a6-11ee-8611-37d641c3527e;
 Sat, 01 Jul 2023 02:31:43 +0200 (CEST)
Received: by mail-pf1-x431.google.com with SMTP id
 d2e1a72fcca58-6686708c986so2016989b3a.0
 for <xen-devel@lists.xenproject.org>; Fri, 30 Jun 2023 17:31:43 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s68-20020a632c47000000b0055b61cd99a1sm1824296pgs.81.2023.06.30.17.31.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Jun 2023 17:31:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: a6965cda-17a6-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688171501; x=1690763501;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=e69b5gTZ8xv/z3fBnKcGKtSZdG5ASDalrjgP59JhG/4=;
        b=Uc+bsWyiiVRS6/ak3e7nNWgvDsm07FG9aSfYXLG6IdDkmxgRSFs8uj9+KckytCzS6t
         6cDUUVJnRV2B2uZpOKB8qCmEVxhmGYx0aZjVKSVjY4eRB204KAdIfUnuekcB5E/arvLv
         /R+PwTzfUoF7fsOw2xAR6DYwcPKA5LOxk9TjklR3PEEGvRChPatSxmuxUs5dCzCf5/X0
         qc3MzRPX5q8WSOrLf6e0PkvnwGBP5EC2RADreBhEVPcI9SHFkaCCgXOJE1ievl9VWVY4
         Cei44fivdtBK1Gc03Mm4fxWEIrO5kuUNHy95/FOobl6bJitol09+NoU/pYc6CDwJ8kd+
         0uVA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688171501; x=1690763501;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=e69b5gTZ8xv/z3fBnKcGKtSZdG5ASDalrjgP59JhG/4=;
        b=Fxyh/4e5wzn2e2yLqb31MBsN1AyWcXfbuqDNyM3cKxAqbQQwX/P3u+vZ4l2c0Bzmle
         p34PT//Kf++n0AZnJ+z4LGwQ/bXI8c20qnCm9ImT14qwnXN9oHFYiZJZzwQKSYPAKJyr
         sJOM1B0WF1uaG3qH6nQDgR+ZAc5ec3h0xH6Wi4jhsYNGCCoPKWTZQJsjDdCUau1tGVFz
         XOlbmHjZPKD5qA8Rx3MF8A8ZBF44KChgeRZhJMCxD1rwezGRG+LgLCQAbZOIqYwLhGtr
         a9egVXR1eRn6EQEhflwqhgybAwHHSM+RWVlmhK0m/jOsKy7Kf0PQY6xFsgInAEJ6FpvS
         RxJw==
X-Gm-Message-State: ABy/qLbPXKt5I9R9nydBlAtCaac/OdSa9+gfiEDjy4icqUJJXT6YePsl
	FUn/PDy+LCutjosmYALWB2HlF7fHZOA=
X-Google-Smtp-Source: APBJJlGMtpigqkyzfp5YokZTkCRps/5vTqNDZCZQZ1cAwWcehJ1Acq2dvmwyA19KQ10YdU1J+7JULQ==
X-Received: by 2002:a05:6a00:2488:b0:681:142f:e8e3 with SMTP id c8-20020a056a00248800b00681142fe8e3mr5518207pfv.14.1688171501037;
        Fri, 30 Jun 2023 17:31:41 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 01/11] x86 setup: move x86 boot module counting into a new boot_info struct
Date: Fri, 30 Jun 2023 17:31:22 -0700
Message-Id: <20230701003132.2210306-2-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
References: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

An initial step towards a non-multiboot internal representation of boot
modules for common code, starting with x86 setup and converting the
fields that are accessed for the startup calculations.

Introduce a new header, <xen/bootinfo.h>, and populate it with a new
boot_info structure initially containing a count of the number of boot
modules.

The naming of the header, structure and fields is derived from the boot
structures on Arm -- see arm/include/asm/setup.h -- as part of work
towards aligning common architecture-neutral boot logic and structures.

No functional change intended.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

changes since v1:
- patch is a subset of patches 2 and 3
---
 xen/arch/x86/setup.c       | 58 +++++++++++++++++++++++---------------
 xen/include/xen/bootinfo.h | 20 +++++++++++++
 2 files changed, 55 insertions(+), 23 deletions(-)
 create mode 100644 xen/include/xen/bootinfo.h

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 74e3915a4d..708639b236 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1,3 +1,4 @@
+#include <xen/bootinfo.h>
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/err.h>
@@ -268,7 +269,16 @@ static int __init cf_check parse_acpi_param(const char *s)
 custom_param("acpi", parse_acpi_param);
 
 static const module_t *__initdata initial_images;
-static unsigned int __initdata nr_initial_images;
+static struct boot_info __initdata *boot_info;
+
+static void __init multiboot_to_bootinfo(multiboot_info_t *mbi)
+{
+    static struct boot_info __initdata info;
+
+    info.nr_mods = mbi->mods_count;
+
+    boot_info = &info;
+}
 
 unsigned long __init initial_images_nrpages(nodeid_t node)
 {
@@ -277,7 +287,7 @@ unsigned long __init initial_images_nrpages(nodeid_t node)
     unsigned long nr;
     unsigned int i;
 
-    for ( nr = i = 0; i < nr_initial_images; ++i )
+    for ( nr = i = 0; i < boot_info->nr_mods; ++i )
     {
         unsigned long start = initial_images[i].mod_start;
         unsigned long end = start + PFN_UP(initial_images[i].mod_end);
@@ -293,7 +303,7 @@ void __init discard_initial_images(void)
 {
     unsigned int i;
 
-    for ( i = 0; i < nr_initial_images; ++i )
+    for ( i = 0; i < boot_info->nr_mods; ++i )
     {
         uint64_t start = (uint64_t)initial_images[i].mod_start << PAGE_SHIFT;
 
@@ -301,7 +311,7 @@ void __init discard_initial_images(void)
                            start + PAGE_ALIGN(initial_images[i].mod_end));
     }
 
-    nr_initial_images = 0;
+    boot_info->nr_mods = 0;
     initial_images = NULL;
 }
 
@@ -1020,6 +1030,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         mod = __va(mbi->mods_addr);
     }
 
+    multiboot_to_bootinfo(mbi);
+
     loader = (mbi->flags & MBI_LOADERNAME)
         ? (char *)__va(mbi->boot_loader_name) : "unknown";
 
@@ -1127,18 +1139,18 @@ void __init noreturn __start_xen(unsigned long mbi_p)
            bootsym(boot_edd_info_nr));
 
     /* Check that we have at least one Multiboot module. */
-    if ( !(mbi->flags & MBI_MODULES) || (mbi->mods_count == 0) )
+    if ( !(mbi->flags & MBI_MODULES) || (boot_info->nr_mods == 0) )
         panic("dom0 kernel not specified. Check bootloader configuration\n");
 
     /* Check that we don't have a silly number of modules. */
-    if ( mbi->mods_count > sizeof(module_map) * 8 )
+    if ( boot_info->nr_mods > sizeof(module_map) * 8 )
     {
-        mbi->mods_count = sizeof(module_map) * 8;
+        boot_info->nr_mods = sizeof(module_map) * 8;
         printk("Excessive multiboot modules - using the first %u only\n",
-               mbi->mods_count);
+               boot_info->nr_mods);
     }
 
-    bitmap_fill(module_map, mbi->mods_count);
+    bitmap_fill(module_map, boot_info->nr_mods);
     __clear_bit(0, module_map); /* Dom0 kernel is always first */
 
     if ( pvh_boot )
@@ -1311,9 +1323,9 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     kexec_reserve_area(&boot_e820);
 
     initial_images = mod;
-    nr_initial_images = mbi->mods_count;
+    boot_info->nr_mods = boot_info->nr_mods;
 
-    for ( i = 0; !efi_enabled(EFI_LOADER) && i < mbi->mods_count; i++ )
+    for ( i = 0; !efi_enabled(EFI_LOADER) && i < boot_info->nr_mods; i++ )
     {
         if ( mod[i].mod_start & (PAGE_SIZE - 1) )
             panic("Bootloader didn't honor module alignment request\n");
@@ -1337,8 +1349,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
          * respective reserve_e820_ram() invocation below. No need to
          * query efi_boot_mem_unused() here, though.
          */
-        mod[mbi->mods_count].mod_start = virt_to_mfn(_stext);
-        mod[mbi->mods_count].mod_end = __2M_rwdata_end - _stext;
+        mod[boot_info->nr_mods].mod_start = virt_to_mfn(_stext);
+        mod[boot_info->nr_mods].mod_end = __2M_rwdata_end - _stext;
     }
 
     modules_headroom = bzimage_headroom(bootstrap_map(mod), mod->mod_end);
@@ -1398,7 +1410,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         {
             /* Don't overlap with modules. */
             end = consider_modules(s, e, reloc_size + mask,
-                                   mod, mbi->mods_count, -1);
+                                   mod, boot_info->nr_mods, -1);
             end &= ~mask;
         }
         else
@@ -1419,7 +1431,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         }
 
         /* Is the region suitable for relocating the multiboot modules? */
-        for ( j = mbi->mods_count - 1; j >= 0; j-- )
+        for ( j = boot_info->nr_mods - 1; j >= 0; j-- )
         {
             unsigned long headroom = j ? 0 : modules_headroom;
             unsigned long size = PAGE_ALIGN(headroom + mod[j].mod_end);
@@ -1429,7 +1441,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
             /* Don't overlap with other modules (or Xen itself). */
             end = consider_modules(s, e, size, mod,
-                                   mbi->mods_count + relocated, j);
+                                   boot_info->nr_mods + relocated, j);
 
             if ( highmem_start && end > highmem_start )
                 continue;
@@ -1456,7 +1468,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         {
             /* Don't overlap with modules (or Xen itself). */
             e = consider_modules(s, e, PAGE_ALIGN(kexec_crash_area.size), mod,
-                                 mbi->mods_count + relocated, -1);
+                                 boot_info->nr_mods + relocated, -1);
             if ( s >= e )
                 break;
             if ( e > kexec_crash_area_limit )
@@ -1471,7 +1483,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     if ( modules_headroom && !mod->reserved )
         panic("Not enough memory to relocate the dom0 kernel image\n");
-    for ( i = 0; i < mbi->mods_count; ++i )
+    for ( i = 0; i < boot_info->nr_mods; ++i )
     {
         uint64_t s = (uint64_t)mod[i].mod_start << PAGE_SHIFT;
 
@@ -1540,7 +1552,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
                     ASSERT(j);
                 }
                 map_e = boot_e820.map[j].addr + boot_e820.map[j].size;
-                for ( j = 0; j < mbi->mods_count; ++j )
+                for ( j = 0; j < boot_info->nr_mods; ++j )
                 {
                     uint64_t end = pfn_to_paddr(mod[j].mod_start) +
                                    mod[j].mod_end;
@@ -1616,7 +1628,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         }
     }
 
-    for ( i = 0; i < mbi->mods_count; ++i )
+    for ( i = 0; i < boot_info->nr_mods; ++i )
     {
         set_pdx_range(mod[i].mod_start,
                       mod[i].mod_start + PFN_UP(mod[i].mod_end));
@@ -1999,8 +2011,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
            cpu_has_nx ? XENLOG_INFO : XENLOG_WARNING "Warning: ",
            cpu_has_nx ? "" : "not ");
 
-    initrdidx = find_first_bit(module_map, mbi->mods_count);
-    if ( bitmap_weight(module_map, mbi->mods_count) > 1 )
+    initrdidx = find_first_bit(module_map, boot_info->nr_mods);
+    if ( bitmap_weight(module_map, boot_info->nr_mods) > 1 )
         printk(XENLOG_WARNING
                "Multiple initrd candidates, picking module #%u\n",
                initrdidx);
@@ -2010,7 +2022,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
      * above our heap. The second module, if present, is an initrd ramdisk.
      */
     dom0 = create_dom0(mod, modules_headroom,
-                       initrdidx < mbi->mods_count ? mod + initrdidx : NULL,
+                       initrdidx < boot_info->nr_mods ? mod + initrdidx : NULL,
                        kextra, loader);
     if ( !dom0 )
         panic("Could not set up DOM0 guest OS\n");
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
new file mode 100644
index 0000000000..6a7d55d20e
--- /dev/null
+++ b/xen/include/xen/bootinfo.h
@@ -0,0 +1,20 @@
+#ifndef __XEN_BOOTINFO_H__
+#define __XEN_BOOTINFO_H__
+
+#include <xen/types.h>
+
+struct boot_info {
+    unsigned int nr_mods;
+};
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 00:31:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 00:31:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557669.871248 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWk-0000X7-Dg; Sat, 01 Jul 2023 00:31:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557669.871248; Sat, 01 Jul 2023 00:31:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWk-0000Wj-A8; Sat, 01 Jul 2023 00:31:50 +0000
Received: by outflank-mailman (input) for mailman id 557669;
 Sat, 01 Jul 2023 00:31:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFOWj-0007yB-4e
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 00:31:49 +0000
Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com
 [2607:f8b0:4864:20::436])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a9c2fbe6-17a6-11ee-b237-6b7b168915f2;
 Sat, 01 Jul 2023 02:31:48 +0200 (CEST)
Received: by mail-pf1-x436.google.com with SMTP id
 d2e1a72fcca58-666ecf9a081so1885991b3a.2
 for <xen-devel@lists.xenproject.org>; Fri, 30 Jun 2023 17:31:48 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s68-20020a632c47000000b0055b61cd99a1sm1824296pgs.81.2023.06.30.17.31.45
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Jun 2023 17:31:46 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: a9c2fbe6-17a6-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688171506; x=1690763506;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=/bZBd6eRTKkd5JZ++Hy2rgV0U3swA0RaaPb02+sFNEo=;
        b=MTxzrGAITsLT46i4OhAoywi7PDozDmK8q/T2F09c3zFbuT2Y6eKs24RxEJO8+Kay4q
         jzAoyn0OCFx9AzDmriIAAn1h7oGp8to6nRjh5QqLvOXlA6AxT9iukyh/tuGKczv/pOcB
         RSQpcQguU7OWMAB1w2lNbdBWlPfejpXiFctURmffmSFX1P4XbhBij44g0d9HLgafSgBs
         h1mVKbeQbjXDv8ABL2W7VKqtbspGQabdM+E4yJOCx/QM5RNaKMd8Wqg+Jg/v70fGASUg
         GPXdgxQeS8nud8TZGue1Z66u7qh+el26tdF24UEaRrr8g9yq/UchAr0Ilt7Cz2Nqbf0y
         gcAw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688171506; x=1690763506;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=/bZBd6eRTKkd5JZ++Hy2rgV0U3swA0RaaPb02+sFNEo=;
        b=NYhfJ/Zrx8ez3SXhyFF4S/kE1hf1GZ9GLtlBrKT8PYQqX8q4wL1nVYAqsAPifrfoD8
         lYLTTLeGSDMTxaOCbMpMe6qQuC6Bhd4vHkLCyx9cuqUt2mraiGReZ+Txzy4XoT3uBU7B
         o8us4suwoe3U8hn4aKhnda0qydRdVCRMk1vt2Ms07rqseIc+EjJJjo8S4AZBypXNvTni
         N7HoclEWxojtlLiyyV12oSeNydzSZzEQyyjl4rV4DbDPxXKBb058YDGMi4lUxB6JMnEH
         ndi28fMuivx0gd+414bRzK2IuleSV+QzjvlDE3eTiXJanaDeONoVjDQSbo02HoL3mDT3
         4SmA==
X-Gm-Message-State: ABy/qLbyufxNuorruzQAws8xnK2Aq5qgzW68g53fEh+v+3duuRJnhZAB
	qYuekxw022N2TUD16DI5OXd1UfVjNew=
X-Google-Smtp-Source: APBJJlFBq6b+oL8y3j9HKkjC37NmJlsGa0wteQeagNzkCv7VOsuYvWWt9UFRAHuwAgSrK9WgXeiGbA==
X-Received: by 2002:a05:6a00:18a4:b0:680:40b2:5419 with SMTP id x36-20020a056a0018a400b0068040b25419mr6592110pfh.4.1688171506475;
        Fri, 30 Jun 2023 17:31:46 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 05/11] xsm: switch XSM init to boot info structures
Date: Fri, 30 Jun 2023 17:31:26 -0700
Message-Id: <20230701003132.2210306-6-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
References: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Change the XSM implementation to use the boot info structure instead of
the multiboot module_map.

Drops a dependency on CONFIG_MULTIBOOT, so boot module logic is now
used whenever the DEVICE_TREE specific logic (for Arm) is not, with the
bootinfo header conditionally included to ensure no change on Arm.

Adds a multiboot header inclusion into guest/xen/pvh-boot.c
since it is no longer provided via transitive inclusion and the source
in that file uses multiboot structures.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

Changes since v1:
- derived from patches 2 and 3
- added pvh-boot.c multiboot header inclusion
- conditional inclusion of bootinfo.h to avoid breaking Arm
---
 xen/arch/x86/guest/xen/pvh-boot.c |  1 +
 xen/arch/x86/setup.c              |  2 +-
 xen/include/xsm/xsm.h             | 28 +++++++--------
 xen/xsm/xsm_core.c                | 47 +++++++++++++++---------
 xen/xsm/xsm_policy.c              | 59 ++++++++++++++++---------------
 5 files changed, 77 insertions(+), 60 deletions(-)

diff --git a/xen/arch/x86/guest/xen/pvh-boot.c b/xen/arch/x86/guest/xen/pvh-boot.c
index 9cbe87b61b..1ed04d035c 100644
--- a/xen/arch/x86/guest/xen/pvh-boot.c
+++ b/xen/arch/x86/guest/xen/pvh-boot.c
@@ -9,6 +9,7 @@
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/mm.h>
+#include <xen/multiboot.h>
 
 #include <asm/e820.h>
 #include <asm/guest.h>
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index f9b04daebd..a616ccc0a8 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1835,7 +1835,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     mmio_ro_ranges = rangeset_new(NULL, "r/o mmio ranges",
                                   RANGESETF_prettyprint_hex);
 
-    xsm_multiboot_init(module_map, mbi);
+    xsm_bootmodule_init(boot_info);
 
     /*
      * IOMMU-related ACPI table parsing may require some of the system domains
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 8dad03fd3d..d409c30be6 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -16,8 +16,10 @@
 #define __XSM_H__
 
 #include <xen/alternative-call.h>
+#ifndef CONFIG_HAS_DEVICE_TREE
+# include <xen/bootinfo.h>
+#endif
 #include <xen/sched.h>
-#include <xen/multiboot.h>
 
 /* policy magic number (defined by XSM_MAGIC) */
 typedef uint32_t xsm_magic_t;
@@ -776,15 +778,14 @@ static inline int xsm_argo_send(const struct domain *d, const struct domain *t)
 
 #endif /* XSM_NO_WRAPPERS */
 
-#ifdef CONFIG_MULTIBOOT
-int xsm_multiboot_init(
-    unsigned long *module_map, const multiboot_info_t *mbi);
-int xsm_multiboot_policy_init(
-    unsigned long *module_map, const multiboot_info_t *mbi,
-    void **policy_buffer, size_t *policy_size);
-#endif
+#ifndef CONFIG_HAS_DEVICE_TREE
+int xsm_bootmodule_init(const struct boot_info *info);
+int xsm_bootmodule_policy_init(
+    const struct boot_info *info, const unsigned char **policy_buffer,
+    size_t *policy_size);
+
+#else
 
-#ifdef CONFIG_HAS_DEVICE_TREE
 /*
  * Initialize XSM
  *
@@ -826,15 +827,14 @@ static const inline struct xsm_ops *silo_init(void)
 
 #include <xsm/dummy.h>
 
-#ifdef CONFIG_MULTIBOOT
-static inline int xsm_multiboot_init (
-    unsigned long *module_map, const multiboot_info_t *mbi)
+#ifndef CONFIG_HAS_DEVICE_TREE
+static inline int xsm_bootmodule_init(const struct boot_info *info)
 {
     return 0;
 }
-#endif
 
-#ifdef CONFIG_HAS_DEVICE_TREE
+#else
+
 static inline int xsm_dt_init(void)
 {
     return 0;
diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index eaa028109b..301ae4dc8b 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -10,8 +10,12 @@
  *  as published by the Free Software Foundation.
  */
 
-#include <xen/init.h>
+#ifndef CONFIG_HAS_DEVICE_TREE
+# include <xen/bootinfo.h>
+#endif
 #include <xen/errno.h>
+#include <xen/hypercall.h>
+#include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/param.h>
 
@@ -138,26 +142,35 @@ static int __init xsm_core_init(const void *policy_buffer, size_t policy_size)
     return 0;
 }
 
-#ifdef CONFIG_MULTIBOOT
-int __init xsm_multiboot_init(
-    unsigned long *module_map, const multiboot_info_t *mbi)
+/*
+ * ifdef'ing this against multiboot is no longer valid as the boot module
+ * is agnostic and it will be possible to dropped the ifndef should Arm
+ * adopt boot info
+ */
+#ifndef CONFIG_HAS_DEVICE_TREE
+int __init xsm_bootmodule_init(const struct boot_info *bootinfo)
 {
     int ret = 0;
-    void *policy_buffer = NULL;
+    const unsigned char *policy_buffer = NULL;
     size_t policy_size = 0;
 
     printk("XSM Framework v" XSM_FRAMEWORK_VERSION " initialized\n");
 
     if ( XSM_MAGIC )
     {
-        ret = xsm_multiboot_policy_init(module_map, mbi, &policy_buffer,
-                                        &policy_size);
-        if ( ret )
-        {
-            bootstrap_map(NULL);
-            printk(XENLOG_ERR "Error %d initializing XSM policy\n", ret);
-            return -EINVAL;
-        }
+        int ret = xsm_bootmodule_policy_init(bootinfo, &policy_buffer,
+                                             &policy_size);
+        bootstrap_map(NULL);
+
+        if ( ret == -ENOENT )
+            /*
+             * The XSM module needs a policy file but one was not located.
+             * Report as a warning and continue as the XSM module may late
+             * load a policy file.
+             */
+            printk(XENLOG_WARNING "xsm: starting without a policy loaded!\n");
+        else if ( ret )
+            panic("Error %d initializing XSM policy\n", ret);
     }
 
     ret = xsm_core_init(policy_buffer, policy_size);
@@ -165,9 +178,9 @@ int __init xsm_multiboot_init(
 
     return 0;
 }
-#endif
 
-#ifdef CONFIG_HAS_DEVICE_TREE
+#else
+
 int __init xsm_dt_init(void)
 {
     int ret = 0;
@@ -215,9 +228,9 @@ bool __init has_xsm_magic(paddr_t start)
 
     return false;
 }
-#endif
+#endif /* CONFIG_HAS_DEVICE_TREE */
 
-#endif
+#endif /* CONFIG_XSM */
 
 long do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
diff --git a/xen/xsm/xsm_policy.c b/xen/xsm/xsm_policy.c
index c6df8c6e06..f1970c8964 100644
--- a/xen/xsm/xsm_policy.c
+++ b/xen/xsm/xsm_policy.c
@@ -18,62 +18,65 @@
  *
  */
 
-#include <xsm/xsm.h>
-#ifdef CONFIG_MULTIBOOT
-#include <asm/boot.h>
-#include <xen/multiboot.h>
-#include <asm/setup.h>
-#endif
 #include <xen/bitops.h>
+#ifndef CONFIG_HAS_DEVICE_TREE
+# include <xen/bootinfo.h>
+#endif
+#include <xsm/xsm.h>
 #ifdef CONFIG_HAS_DEVICE_TREE
-# include <asm/setup.h>
 # include <xen/device_tree.h>
+#else
+#include <asm/boot.h>
 #endif
 
-#ifdef CONFIG_MULTIBOOT
-int __init xsm_multiboot_policy_init(
-    unsigned long *module_map, const multiboot_info_t *mbi,
-    void **policy_buffer, size_t *policy_size)
+#include <asm/setup.h>
+
+#ifndef CONFIG_HAS_DEVICE_TREE
+int __init xsm_bootmodule_policy_init(
+    const struct boot_info *bootinfo, const unsigned char **policy_buffer,
+    size_t *policy_size)
 {
-    int i;
-    module_t *mod = (module_t *)__va(mbi->mods_addr);
-    int rc = 0;
+    unsigned long i;
+    int rc = -ENOENT;
     u32 *_policy_start;
     unsigned long _policy_len;
 
-    /*
-     * Try all modules and see whichever could be the binary policy.
-     * Adjust module_map for the module that is the binary policy.
-     */
-    for ( i = mbi->mods_count-1; i >= 1; i-- )
-    {
-        if ( !test_bit(i, module_map) )
-            continue;
+#ifdef CONFIG_XSM_FLASK_POLICY
+    /* Initially set to builtin policy, overriden if boot module is found. */
+    *policy_buffer = xsm_flask_init_policy;
+    *policy_size = xsm_flask_init_policy_size;
+    rc = 0;
+#endif
 
-        _policy_start = bootstrap_map_multiboot(mod + i);
-        _policy_len   = mod[i].mod_end;
+    i = bootmodule_index(bootinfo, BOOTMOD_UNKNOWN, 0);
+    while ( i < bootinfo->nr_mods )
+    {
+        _policy_start = bootstrap_map(&bootinfo->mods[i]);
+        _policy_len   = bootinfo->mods[i].size;
 
         if ( (xsm_magic_t)(*_policy_start) == XSM_MAGIC )
         {
-            *policy_buffer = _policy_start;
+            *policy_buffer = (unsigned char *)_policy_start;
             *policy_size = _policy_len;
 
             printk("Policy len %#lx, start at %p.\n",
                    _policy_len,_policy_start);
 
-            __clear_bit(i, module_map);
+            bootinfo->mods[i].bootmod_type = BOOTMOD_XSM;
+            rc = 0;
             break;
 
         }
 
         bootstrap_map(NULL);
+        i = bootmodule_index(bootinfo, BOOTMOD_UNKNOWN, ++i);
     }
 
     return rc;
 }
-#endif
 
-#ifdef CONFIG_HAS_DEVICE_TREE
+#else
+
 int __init xsm_dt_policy_init(void **policy_buffer, size_t *policy_size)
 {
     struct bootmodule *mod = boot_module_find_by_kind(BOOTMOD_XSM);
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 00:31:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 00:31:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557672.871272 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWn-000193-Nt; Sat, 01 Jul 2023 00:31:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557672.871272; Sat, 01 Jul 2023 00:31:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWn-00017y-Gt; Sat, 01 Jul 2023 00:31:53 +0000
Received: by outflank-mailman (input) for mailman id 557672;
 Sat, 01 Jul 2023 00:31:51 +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
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFOWl-0007yM-CS
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 00:31:51 +0000
Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com
 [2607:f8b0:4864:20::731])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id aa5d7fcc-17a6-11ee-8611-37d641c3527e;
 Sat, 01 Jul 2023 02:31:49 +0200 (CEST)
Received: by mail-qk1-x731.google.com with SMTP id
 af79cd13be357-76728ae3162so224236785a.3
 for <xen-devel@lists.xenproject.org>; Fri, 30 Jun 2023 17:31:49 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s68-20020a632c47000000b0055b61cd99a1sm1824296pgs.81.2023.06.30.17.31.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Jun 2023 17:31:46 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: aa5d7fcc-17a6-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688171507; x=1690763507;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=tNP8VdblK4Rt8e2FoRKT44HjkzeP53PPJ4jpSpNQaUw=;
        b=dZsj6vciSfnMLCMaU0cMPpVzsvTf2cA6H5rK4dqitVEHa7PIl9bqnNbVX3YCmArVSD
         IMEXc7JXp9i0n/PGdZX9qMeKuVaEdqi1JfQcIbGoD4A3Tg/fYHZ5qWS5LnG8xrnN8FH1
         Qri/PoGiBRsUxe8lInpy/Y3tNDsK+N/06FDCG77bszgiEqbDDNt1ISOCF7hrbk0zEJZF
         u3xEDplqMMf5QyYIZXM+igxM68XL6fyrQU/HlA+q/V8iig/rjo8PHvxFVZnmdcg9lZsV
         5KpUfri4831gj2h32ooplKW5XrDdfAHBoQV/NLL9yEaAH4ZJQQM+UxajHNgk+edO/lhN
         CM9A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688171507; x=1690763507;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=tNP8VdblK4Rt8e2FoRKT44HjkzeP53PPJ4jpSpNQaUw=;
        b=OzBtmcktinPgWc4XhtkaIz/SXeaJ6nzCQuxZxTc2JMoAV2ZcCRLdjcX+gt+dJcGZKY
         A6IzBRT5MOmL5RBHqkdqyRD4PR4clvF+tD583EyrF+YdyOfAUuylU1Cg3BQEIi4g1SjI
         OvuG/96KKedmGW08c1W8twytVnn3Z4IZpNGIGldqXFu1T6hQHnrUL8gQZDRU6aAH+w1h
         uDrAevlVcDerI55VGHvTwEQ640xI9B1QjbD8QQoEVSJ/XhKgBFcr4RHmGZRggjQyyNA4
         Y9f0KegaY0Pgq1kn560TCPt0rE2xrEWFotxKeIJf2QUS4dpbS74EmzR33hdzSKUHaHUP
         RpKg==
X-Gm-Message-State: ABy/qLawIMHRzXLb3UaViZv69lx9jqBV9Ddkd89tCgnFNahEBlioCNmd
	uhRiyZjbQweGuNo9EAqK8cFOjEtlfxw=
X-Google-Smtp-Source: APBJJlHXadhO0zI3fny7/VsDSq54jA5+/G/AaPurjt0vF6Vo+E7TEPOAcjmOGo6hXLaSNWVGV0iNyg==
X-Received: by 2002:a05:620a:29d2:b0:767:3999:5277 with SMTP id s18-20020a05620a29d200b0076739995277mr5531547qkp.70.1688171507611;
        Fri, 30 Jun 2023 17:31:47 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 06/11] x86 setup, microcode: switch to the new bootinfo structures
Date: Fri, 30 Jun 2023 17:31:27 -0700
Message-Id: <20230701003132.2210306-7-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
References: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Next step in incremental work towards adding a non-multiboot internal
representation of boot modules, converting the fields being accessed for
the startup calculations.

Move the per-module scan logic into a dedicated function from the
iteration loop and set the BOOTMOD_UCODE module type when microcode is found.

Completes the conversion from the module_map bitmap in x86 setup so it
can be removed, along with the temporary bootstrap_map multiboot wrapper
since the last code that uses it is removed in this change.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

changes since v1:
- an incremental subset of patch 3
- added the drop of the temporary bootstrap map
---
 xen/arch/x86/cpu/microcode/core.c    | 148 +++++++++++++++------------
 xen/arch/x86/include/asm/boot.h      |  13 ---
 xen/arch/x86/include/asm/microcode.h |   7 +-
 xen/arch/x86/setup.c                 |   8 +-
 4 files changed, 89 insertions(+), 87 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index e720a89167..c674ccf88c 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -22,12 +22,12 @@
  */
 
 #include <xen/alternative-call.h>
+#include <xen/bootinfo.h>
 #include <xen/cpu.h>
 #include <xen/earlycpio.h>
 #include <xen/err.h>
 #include <xen/guest_access.h>
 #include <xen/init.h>
-#include <xen/multiboot.h>
 #include <xen/param.h>
 #include <xen/spinlock.h>
 #include <xen/stop_machine.h>
@@ -57,7 +57,6 @@
  */
 #define MICROCODE_UPDATE_TIMEOUT_US 1000000
 
-static module_t __initdata ucode_mod;
 static signed int __initdata ucode_mod_idx;
 static bool_t __initdata ucode_mod_forced;
 static unsigned int nr_cores;
@@ -150,75 +149,109 @@ static int __init cf_check parse_ucode(const char *s)
 }
 custom_param("ucode", parse_ucode);
 
-void __init microcode_scan_module(
-    unsigned long *module_map,
-    const multiboot_info_t *mbi)
+#define MICROCODE_MODULE_MATCH 1
+#define MICROCODE_MODULE_NONMATCH 0
+
+static int __init microcode_check_module(struct boot_module *mod)
 {
-    module_t *mod = (module_t *)__va(mbi->mods_addr);
     uint64_t *_blob_start;
     unsigned long _blob_size;
-    struct cpio_data cd;
+    struct cpio_data cd = { NULL, 0 };
     long offset;
     const char *p = NULL;
-    int i;
-
-    ucode_blob.size = 0;
-    if ( !ucode_scan )
-        return;
 
     if ( boot_cpu_data.x86_vendor == X86_VENDOR_AMD )
         p = "kernel/x86/microcode/AuthenticAMD.bin";
     else if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
         p = "kernel/x86/microcode/GenuineIntel.bin";
     else
+        return -EFAULT;
+
+    _blob_start = bootstrap_map(mod);
+    _blob_size = mod->size;
+    if ( !_blob_start )
+    {
+        printk("Could not map multiboot module (0x%lx) (size: %ld)\n",
+               mod->start, _blob_size);
+        /* Non-fatal error, so just say no match */
+        return MICROCODE_MODULE_NONMATCH;
+    }
+
+    cd = find_cpio_data(p, _blob_start, _blob_size, &offset /* ignore */);
+
+    if ( cd.data )
+    {
+        ucode_blob.size = cd.size;
+        ucode_blob.data = cd.data;
+
+        mod->bootmod_type = BOOTMOD_UCODE;
+        return MICROCODE_MODULE_MATCH;
+    }
+
+    bootstrap_map(NULL);
+
+    return MICROCODE_MODULE_NONMATCH;
+}
+
+void __init microcode_scan_module(struct boot_info *bootinfo)
+{
+    int i;
+
+    if ( !ucode_scan )
         return;
 
-    /*
-     * Try all modules and see whichever could be the microcode blob.
-     */
-    for ( i = 1 /* Ignore dom0 kernel */; i < mbi->mods_count; i++ )
+    i = bootmodule_index(bootinfo, BOOTMOD_UNKNOWN, 0);
+    while ( i < bootinfo->nr_mods )
     {
-        if ( !test_bit(i, module_map) )
-            continue;
+        int ret = microcode_check_module(&bootinfo->mods[i]);
 
-        _blob_start = bootstrap_map_multiboot(&mod[i]);
-        _blob_size = mod[i].mod_end;
-        if ( !_blob_start )
+        switch ( ret )
         {
-            printk("Could not map multiboot module #%d (size: %ld)\n",
-                   i, _blob_size);
+        case MICROCODE_MODULE_MATCH:
+            return;
+        case MICROCODE_MODULE_NONMATCH:
+            i = bootmodule_index(bootinfo, BOOTMOD_UNKNOWN, ++i);
             continue;
+        default:
+            printk("%s: (err: %d) unable to check microcode\n",
+                   __func__, ret);
+            return;
         }
-        cd.data = NULL;
-        cd.size = 0;
-        cd = find_cpio_data(p, _blob_start, _blob_size, &offset /* ignore */);
-        if ( cd.data )
-        {
-            ucode_blob.size = cd.size;
-            ucode_blob.data = cd.data;
-            break;
-        }
-        bootstrap_map(NULL);
     }
 }
 
-static void __init microcode_grab_module(
-    unsigned long *module_map,
-    const multiboot_info_t *mbi)
+static void __init microcode_grab_module(struct boot_info *bootinfo)
 {
-    module_t *mod = (module_t *)__va(mbi->mods_addr);
+    ucode_blob.size = 0;
 
     if ( ucode_mod_idx < 0 )
-        ucode_mod_idx += mbi->mods_count;
-    if ( ucode_mod_idx <= 0 || ucode_mod_idx >= mbi->mods_count ||
-         !__test_and_clear_bit(ucode_mod_idx, module_map) )
-        goto scan;
-    ucode_mod = mod[ucode_mod_idx];
-scan:
+        ucode_mod_idx += bootinfo->nr_mods;
+    if ( ucode_mod_idx >= 0 &&  ucode_mod_idx <= bootinfo->nr_mods &&
+         bootinfo->mods[ucode_mod_idx].bootmod_type == BOOTMOD_UNKNOWN )
+    {
+        int ret = microcode_check_module(&bootinfo->mods[ucode_mod_idx]);
+
+        switch ( ret )
+        {
+        case MICROCODE_MODULE_MATCH:
+            return;
+        case MICROCODE_MODULE_NONMATCH:
+            break;
+        default:
+            printk("%s: (err: %d) unable to check microcode\n",
+                   __func__, ret);
+            return;
+        }
+    }
+
     if ( ucode_scan )
-        microcode_scan_module(module_map, mbi);
+        microcode_scan_module(bootinfo);
 }
 
+/* Undefining as they are not needed anymore */
+#undef MICROCODE_MODULE_MATCH
+#undef MICROCODE_MODULE_NONMATCH
+
 static struct microcode_ops __ro_after_init ucode_ops;
 
 static DEFINE_SPINLOCK(microcode_mutex);
@@ -737,11 +770,6 @@ static int __init cf_check microcode_init(void)
         ucode_blob.size = 0;
         ucode_blob.data = NULL;
     }
-    else if ( ucode_mod.mod_end )
-    {
-        bootstrap_map(NULL);
-        ucode_mod.mod_end = 0;
-    }
 
     return 0;
 }
@@ -785,19 +813,15 @@ static int __init early_update_cache(const void *data, size_t len)
     return rc;
 }
 
-int __init microcode_init_cache(unsigned long *module_map,
-                                const struct multiboot_info *mbi)
+int __init microcode_init_cache(struct boot_info *bootinfo)
 {
     int rc = 0;
 
     if ( ucode_scan )
         /* Need to rescan the modules because they might have been relocated */
-        microcode_scan_module(module_map, mbi);
+        microcode_scan_module(bootinfo);
 
-    if ( ucode_mod.mod_end )
-        rc = early_update_cache(bootstrap_map_multiboot(&ucode_mod),
-                                ucode_mod.mod_end);
-    else if ( ucode_blob.size )
+    if ( ucode_blob.size )
         rc = early_update_cache(ucode_blob.data, ucode_blob.size);
 
     return rc;
@@ -815,11 +839,6 @@ static int __init early_microcode_update_cpu(void)
         len = ucode_blob.size;
         data = ucode_blob.data;
     }
-    else if ( ucode_mod.mod_end )
-    {
-        len = ucode_mod.mod_end;
-        data = bootstrap_map_multiboot(&ucode_mod);
-    }
 
     if ( !data )
         return -ENOMEM;
@@ -838,8 +857,7 @@ static int __init early_microcode_update_cpu(void)
     return microcode_update_cpu(patch);
 }
 
-int __init early_microcode_init(unsigned long *module_map,
-                                const struct multiboot_info *mbi)
+int __init early_microcode_init(struct boot_info *bootinfo)
 {
     const struct cpuinfo_x86 *c = &boot_cpu_data;
     int rc = 0;
@@ -863,11 +881,11 @@ int __init early_microcode_init(unsigned long *module_map,
         return -ENODEV;
     }
 
-    microcode_grab_module(module_map, mbi);
+    microcode_grab_module(bootinfo);
 
     ucode_ops.collect_cpu_info();
 
-    if ( ucode_mod.mod_end || ucode_blob.size )
+    if ( ucode_blob.size )
         rc = early_microcode_update_cpu();
 
     return rc;
diff --git a/xen/arch/x86/include/asm/boot.h b/xen/arch/x86/include/asm/boot.h
index bcf4f2e2e3..e51fd32280 100644
--- a/xen/arch/x86/include/asm/boot.h
+++ b/xen/arch/x86/include/asm/boot.h
@@ -6,19 +6,6 @@
 
 #include <asm/setup.h>
 
-static inline void *bootstrap_map_multiboot(const module_t *mod)
-{
-    struct boot_module bm;
-
-    if ( !mod )
-        return bootstrap_map(NULL);
-
-    bm.start = mod->mod_start << PAGE_SHIFT;
-    bm.size = mod->mod_end;
-
-    return bootstrap_map(&bm);
-}
-
 static inline unsigned long bootmodule_index(
     const struct boot_info *info, bootmod_type_t bootmod_type,
     unsigned long start)
diff --git a/xen/arch/x86/include/asm/microcode.h b/xen/arch/x86/include/asm/microcode.h
index 62ce3418f7..803fbbb270 100644
--- a/xen/arch/x86/include/asm/microcode.h
+++ b/xen/arch/x86/include/asm/microcode.h
@@ -1,6 +1,7 @@
 #ifndef ASM_X86__MICROCODE_H
 #define ASM_X86__MICROCODE_H
 
+#include <xen/bootinfo.h>
 #include <xen/types.h>
 #include <xen/percpu.h>
 
@@ -23,10 +24,8 @@ DECLARE_PER_CPU(struct cpu_signature, cpu_sig);
 
 void microcode_set_module(unsigned int idx);
 int microcode_update(XEN_GUEST_HANDLE(const_void), unsigned long len);
-int early_microcode_init(unsigned long *module_map,
-                         const struct multiboot_info *mbi);
-int microcode_init_cache(unsigned long *module_map,
-                         const struct multiboot_info *mbi);
+int early_microcode_init(struct boot_info *bootinfo);
+int microcode_init_cache(struct boot_info *bootinfo);
 int microcode_update_one(void);
 
 #endif /* ASM_X86__MICROCODE_H */
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index a616ccc0a8..50a1a124b0 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1023,7 +1023,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     unsigned int initrdidx, num_parked = 0;
     multiboot_info_t *mbi;
     module_t *mod;
-    unsigned long nr_pages, raw_max_page, module_map[1];
+    unsigned long nr_pages, raw_max_page;
     int i, j, e820_warn = 0, bytes = 0;
     unsigned long eb_start, eb_end;
     bool acpi_boot_table_init_done = false, relocated = false;
@@ -1190,8 +1190,6 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     }
 
     /* Dom0 kernel is the first boot module */
-    bitmap_fill(module_map, mbi->mods_count);
-    __clear_bit(0, module_map); /* Dom0 kernel is always first */
     boot_info->mods[0].bootmod_type = BOOTMOD_KERNEL;
 
     if ( pvh_boot )
@@ -1371,7 +1369,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
      * TODO: load ucode earlier once multiboot modules become accessible
      * at an earlier stage.
      */
-    early_microcode_init(module_map, mbi);
+    early_microcode_init(boot_info);
 
     if ( xen_phys_start )
     {
@@ -1906,7 +1904,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     timer_init();
 
-    microcode_init_cache(module_map, mbi); /* Needs xmalloc() */
+    microcode_init_cache(boot_info); /* Needs xmalloc() */
 
     tsx_init(); /* Needs microcode.  May change HLE/RTM feature bits. */
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 00:31:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 00:31:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557670.871257 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWl-0000o5-Ow; Sat, 01 Jul 2023 00:31:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557670.871257; Sat, 01 Jul 2023 00:31:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWl-0000mP-L1; Sat, 01 Jul 2023 00:31:51 +0000
Received: by outflank-mailman (input) for mailman id 557670;
 Sat, 01 Jul 2023 00:31:50 +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
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFOWk-0007yM-C9
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 00:31:50 +0000
Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com
 [2607:f8b0:4864:20::22c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a96729e1-17a6-11ee-8611-37d641c3527e;
 Sat, 01 Jul 2023 02:31:47 +0200 (CEST)
Received: by mail-oi1-x22c.google.com with SMTP id
 5614622812f47-3a1a47b33d8so1881850b6e.2
 for <xen-devel@lists.xenproject.org>; Fri, 30 Jun 2023 17:31:47 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s68-20020a632c47000000b0055b61cd99a1sm1824296pgs.81.2023.06.30.17.31.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Jun 2023 17:31:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: a96729e1-17a6-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688171506; x=1690763506;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=y7s+a48s6nJcYJpi0CKsRE8Fk9vJ+e5NEZSgNSxP5/8=;
        b=W/Ori2UF5GdZ2XTZUYb7SeemZMmXHFyT5AmYNUYzZYR8m3DlTjhAIlYMyFrqeTXavn
         ApUJYnarY5VGN5Tu9EM1aQnNSUmAba1kJGAiVzVu3dYiGQFTOj1zZb4QCDP6qkUQsEg3
         /AYkZJiTd10O0+u5oCZzM5XUQCWyDv9QPiVV5l/W1Z/gUunTNlDLSjsGwKU5MQhQLvo4
         lNX1yE37dfgzMaBoCgFG+haXttyy7gTUaQmTx+F9FTcZarjT7WPvQSZQ+sEb1Aoyg+8H
         dYhW5gOEl7FHl4wZWB4IN/T+asWd+xews11MoYsBcLjnSnyg3ev+AM8/pT4J6RxDobpr
         BFRw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688171506; x=1690763506;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=y7s+a48s6nJcYJpi0CKsRE8Fk9vJ+e5NEZSgNSxP5/8=;
        b=jJP5mWtb3jelZ0x3lMPFBTK8MhQK8vUlW1X3/xXhkRaQeAwEuptJ9LdOjc9As/2TxQ
         MvJ8jwe1LGpqR+1UoKM9Bkp1uwnXCO0ykMy0efGQaMSiIwgVmmt/QxMz7nw+Z9cQY9+B
         AU9JM3jJyBUdsjW6OHgrkZU7RjaTJCec6Kde5K8RDVly81bbdtUOITUJz23elL7jZVj6
         Rd/QeUH/S/a6rKE2f19aw5VZmWlZny7KQOOv9ELSEOdVBRCfJPc0YBdMm7HfiqX+Mk4z
         oIsPRBAte+/77TBklb51FfqxeUZIN3baQNMwHue8QhjFYYesRfso6M/OZYcXn8AUHroE
         Y2Wg==
X-Gm-Message-State: AC+VfDyd7EWNkgijy/lTGrHDAtTrE6a673a2r9dMw7tTtl4Co5tbjJcj
	vmITOnGYG8McfZP2Oe7eV2SeneZ2iH4=
X-Google-Smtp-Source: ACHHUZ7Jdwgu9s3VF78UoKENhjUUxgTBZur8e6sBoFcYKPjtIKlqM0Dh2E7ma7w5eCQzKVE4ipK9gg==
X-Received: by 2002:a05:6808:1b0c:b0:3a1:b309:a409 with SMTP id bx12-20020a0568081b0c00b003a1b309a409mr5339601oib.4.1688171505329;
        Fri, 30 Jun 2023 17:31:45 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 04/11] x86 setup: porting dom0 construction logic to boot module structures
Date: Fri, 30 Jun 2023 17:31:25 -0700
Message-Id: <20230701003132.2210306-5-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
References: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adjust the PV and PVH dom0 construction entry points to take boot module
structures as parameters, and add further fields to the boot module
structures to plumb the data needed to support this use. Populate these
from the multiboot module data.

This change removes multiboot from the PV and PVH dom0 construction logic.

Introduce and use new inline accessor functions for navigating the boot
module structures.

The per-boot-module arrays are expanded from singletons to accommodate
all modules, up to a static maximum of 64 modules including Xen that can
be accepted from a bootloader to match the previous value from the
module map check.

The field that identifies the type of a boot module (kernel, ramdisk,
etc) is introduced to the common boot module structure and declared as a
non-enum integer type to allow the field to be of a known-size and so
structure can be packed in a subsequent patch in the series, and it will
then be reconciled with the equivalent Arm boot field type.

The command line provided by multiboot for each boot module is added
directly to the boot_module structure, which is appropriate for this
logic just replacing multiboot.

The maximum number of boot modules that a bootloader can provide in
addition to the Xen hypervisor is preserved from prior logic with the
module_map at 63.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

changes since v1: a subset of patch 3
- retains module_map for now as still used functions outside setup
- move the static inline functions to a separate dedicated header
- include mm-frame.h and compiler.h as simpler dependencies than mm.h
---
 xen/arch/x86/dom0_build.c             |  10 +-
 xen/arch/x86/hvm/dom0_build.c         |  43 +++---
 xen/arch/x86/include/asm/boot.h       |  36 +++++
 xen/arch/x86/include/asm/bootinfo.h   |  24 +++
 xen/arch/x86/include/asm/dom0_build.h |  13 +-
 xen/arch/x86/include/asm/setup.h      |   4 +-
 xen/arch/x86/pv/dom0_build.c          |  32 ++--
 xen/arch/x86/setup.c                  | 206 +++++++++++++++-----------
 xen/include/xen/bootinfo.h            |  27 ++++
 9 files changed, 254 insertions(+), 141 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 79234f18ff..b38cd1550e 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -4,6 +4,7 @@
  * Copyright (c) 2002-2005, K A Fraser
  */
 
+#include <xen/bootinfo.h>
 #include <xen/init.h>
 #include <xen/iocap.h>
 #include <xen/libelf.h>
@@ -574,9 +575,8 @@ int __init dom0_setup_permissions(struct domain *d)
     return rc;
 }
 
-int __init construct_dom0(struct domain *d, const module_t *image,
-                          unsigned long image_headroom, module_t *initrd,
-                          char *cmdline)
+int __init construct_dom0(struct domain *d, const struct boot_module *image,
+    struct boot_module *initrd, char *cmdline)
 {
     int rc;
 
@@ -588,9 +588,9 @@ int __init construct_dom0(struct domain *d, const module_t *image,
     process_pending_softirqs();
 
     if ( is_hvm_domain(d) )
-        rc = dom0_construct_pvh(d, image, image_headroom, initrd, cmdline);
+        rc = dom0_construct_pvh(d, image, initrd, cmdline);
     else if ( is_pv_domain(d) )
-        rc = dom0_construct_pv(d, image, image_headroom, initrd, cmdline);
+        rc = dom0_construct_pv(d, image, initrd, cmdline);
     else
         panic("Cannot construct Dom0. No guest interface available\n");
 
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 56fe89632b..c094863bb8 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -8,9 +8,9 @@
  */
 
 #include <xen/acpi.h>
+#include <xen/bootinfo.h>
 #include <xen/init.h>
 #include <xen/libelf.h>
-#include <xen/multiboot.h>
 #include <xen/pci.h>
 #include <xen/softirq.h>
 
@@ -530,14 +530,13 @@ static paddr_t __init find_memory(
     return INVALID_PADDR;
 }
 
-static int __init pvh_load_kernel(struct domain *d, const module_t *image,
-                                  unsigned long image_headroom,
-                                  module_t *initrd, void *image_base,
-                                  char *cmdline, paddr_t *entry,
-                                  paddr_t *start_info_addr)
+static int __init pvh_load_kernel(
+    struct domain *d, const struct boot_module *image,
+    struct boot_module *initrd, void *image_base, char *cmdline, paddr_t *entry,
+    paddr_t *start_info_addr)
 {
-    void *image_start = image_base + image_headroom;
-    unsigned long image_len = image->mod_end;
+    void *image_start = image_base + image->arch->headroom;
+    unsigned long image_len = image->size;
     struct elf_binary elf;
     struct elf_dom_parms parms;
     paddr_t last_addr;
@@ -546,7 +545,7 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
     struct vcpu *v = d->vcpu[0];
     int rc;
 
-    if ( (rc = bzimage_parse(image_base, &image_start, image_headroom,
+    if ( (rc = bzimage_parse(image_base, &image_start, image->arch->headroom,
                              &image_len)) != 0 )
     {
         printk("Error trying to detect bz compressed kernel\n");
@@ -594,7 +593,7 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
      * simplify it.
      */
     last_addr = find_memory(d, &elf, sizeof(start_info) +
-                            (initrd ? ROUNDUP(initrd->mod_end, PAGE_SIZE) +
+                            (initrd ? ROUNDUP(initrd->size, PAGE_SIZE) +
                                       sizeof(mod)
                                     : 0) +
                             (cmdline ? ROUNDUP(strlen(cmdline) + 1,
@@ -608,8 +607,8 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
 
     if ( initrd != NULL )
     {
-        rc = hvm_copy_to_guest_phys(last_addr, mfn_to_virt(initrd->mod_start),
-                                    initrd->mod_end, v);
+        rc = hvm_copy_to_guest_phys(last_addr, maddr_to_virt(initrd->start),
+                                    initrd->size, v);
         if ( rc )
         {
             printk("Unable to copy initrd to guest\n");
@@ -617,11 +616,11 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
         }
 
         mod.paddr = last_addr;
-        mod.size = initrd->mod_end;
-        last_addr += ROUNDUP(initrd->mod_end, elf_64bit(&elf) ? 8 : 4);
-        if ( initrd->string )
+        mod.size = initrd->size;
+        last_addr += ROUNDUP(initrd->size, elf_64bit(&elf) ? 8 : 4);
+        if ( initrd->string.len )
         {
-            char *str = __va(initrd->string);
+            char *str = initrd->string.bytes;
             size_t len = strlen(str) + 1;
 
             rc = hvm_copy_to_guest_phys(last_addr, str, len, v);
@@ -1176,10 +1175,9 @@ static void __hwdom_init pvh_setup_mmcfg(struct domain *d)
     }
 }
 
-int __init dom0_construct_pvh(struct domain *d, const module_t *image,
-                              unsigned long image_headroom,
-                              module_t *initrd,
-                              char *cmdline)
+int __init dom0_construct_pvh(
+    struct domain *d, const struct boot_module *image,
+    struct boot_module *initrd, char *cmdline)
 {
     paddr_t entry, start_info;
     int rc;
@@ -1209,9 +1207,8 @@ int __init dom0_construct_pvh(struct domain *d, const module_t *image,
         return rc;
     }
 
-    rc = pvh_load_kernel(d, image, image_headroom, initrd,
-                         bootstrap_map_multiboot(image),
-                         cmdline, &entry, &start_info);
+    rc = pvh_load_kernel(d, image, initrd, bootstrap_map(image), cmdline,
+                         &entry, &start_info);
     if ( rc )
     {
         printk("Failed to load Dom0 kernel\n");
diff --git a/xen/arch/x86/include/asm/boot.h b/xen/arch/x86/include/asm/boot.h
index 10b17f12b2..bcf4f2e2e3 100644
--- a/xen/arch/x86/include/asm/boot.h
+++ b/xen/arch/x86/include/asm/boot.h
@@ -19,6 +19,42 @@ static inline void *bootstrap_map_multiboot(const module_t *mod)
     return bootstrap_map(&bm);
 }
 
+static inline unsigned long bootmodule_index(
+    const struct boot_info *info, bootmod_type_t bootmod_type,
+    unsigned long start)
+{
+    for ( ; start < info->nr_mods; start++ )
+        if ( info->mods[start].bootmod_type == bootmod_type )
+            return start;
+
+    return info->nr_mods + 1;
+}
+
+static inline struct boot_module *bootmodule_next(
+    const struct boot_info *info, bootmod_type_t bootmod_type)
+{
+    unsigned long i;
+
+    for ( i = 0; i < info->nr_mods; i++ )
+        if ( info->mods[i].bootmod_type == bootmod_type )
+            return &info->mods[i];
+
+    return NULL;
+}
+
+static inline void bootmodule_update_start(struct boot_module *bm,
+    paddr_t new_start)
+{
+    bm->start = new_start;
+    bm->mfn = maddr_to_mfn(new_start);
+}
+
+static inline void bootmodule_update_mfn(struct boot_module *bm, mfn_t new_mfn)
+{
+    bm->mfn = new_mfn;
+    bm->start = mfn_to_maddr(new_mfn);
+}
+
 #endif
 
 /*
diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index a25054f372..30c27980e0 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -2,9 +2,33 @@
 #define __ARCH_X86_BOOTINFO_H__
 
 struct arch_bootmodule {
+#define BOOTMOD_FLAG_X86_RELOCATED     1U << 0
+    uint32_t flags;
     unsigned headroom;
 };
 
+struct arch_boot_info {
+    uint32_t flags;
+#define BOOTINFO_FLAG_X86_CMDLINE      1U << 2
+#define BOOTINFO_FLAG_X86_MODULES      1U << 3
+#define BOOTINFO_FLAG_X86_MEMMAP       1U << 6
+#define BOOTINFO_FLAG_X86_LOADERNAME   1U << 9
+
+    char *boot_loader_name;
+
+    uint32_t mmap_length;
+    paddr_t mmap_addr;
+};
+
+struct __packed mb_memmap {
+    uint32_t size;
+    uint32_t base_addr_low;
+    uint32_t base_addr_high;
+    uint32_t length_low;
+    uint32_t length_high;
+    uint32_t type;
+};
+
 #endif
 
 /*
diff --git a/xen/arch/x86/include/asm/dom0_build.h b/xen/arch/x86/include/asm/dom0_build.h
index a5f8c9e67f..ca502269f2 100644
--- a/xen/arch/x86/include/asm/dom0_build.h
+++ b/xen/arch/x86/include/asm/dom0_build.h
@@ -1,6 +1,7 @@
 #ifndef _DOM0_BUILD_H_
 #define _DOM0_BUILD_H_
 
+#include <xen/bootinfo.h>
 #include <xen/libelf.h>
 #include <xen/sched.h>
 
@@ -13,15 +14,11 @@ unsigned long dom0_compute_nr_pages(struct domain *d,
                                     unsigned long initrd_len);
 int dom0_setup_permissions(struct domain *d);
 
-int dom0_construct_pv(struct domain *d, const module_t *image,
-                      unsigned long image_headroom,
-                      module_t *initrd,
-                      char *cmdline);
+int dom0_construct_pv(struct domain *d, const struct boot_module *image,
+                      struct boot_module *initrd, char *cmdline);
 
-int dom0_construct_pvh(struct domain *d, const module_t *image,
-                       unsigned long image_headroom,
-                       module_t *initrd,
-                       char *cmdline);
+int dom0_construct_pvh(struct domain *d, const struct boot_module *image,
+                       struct boot_module *initrd, char *cmdline);
 
 unsigned long dom0_paging_pages(const struct domain *d,
                                 unsigned long nr_pages);
diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index 80d0bb2a21..2d620d04c7 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -34,8 +34,8 @@ static inline void vesa_init(void) {};
 
 int construct_dom0(
     struct domain *d,
-    const module_t *kernel, unsigned long kernel_headroom,
-    module_t *initrd,
+    const struct boot_module *kernel,
+    struct boot_module *initrd,
     char *cmdline);
 void setup_io_bitmap(struct domain *d);
 
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index 4fe806b60d..bc0af7cf27 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -4,12 +4,12 @@
  * Copyright (c) 2002-2005, K A Fraser
  */
 
+#include <xen/bootinfo.h>
 #include <xen/console.h>
 #include <xen/domain.h>
 #include <xen/domain_page.h>
 #include <xen/init.h>
 #include <xen/libelf.h>
-#include <xen/multiboot.h>
 #include <xen/pfn.h>
 #include <xen/sched.h>
 #include <xen/softirq.h>
@@ -356,9 +356,8 @@ static struct page_info * __init alloc_chunk(struct domain *d,
 }
 
 int __init dom0_construct_pv(struct domain *d,
-                             const module_t *image,
-                             unsigned long image_headroom,
-                             module_t *initrd,
+                             const struct boot_module *image,
+                             struct boot_module *initrd,
                              char *cmdline)
 {
     int i, rc, order, machine;
@@ -375,10 +374,10 @@ int __init dom0_construct_pv(struct domain *d,
     unsigned int flush_flags = 0;
     start_info_t *si;
     struct vcpu *v = d->vcpu[0];
-    void *image_base = bootstrap_map_multiboot(image);
-    unsigned long image_len = image->mod_end;
-    void *image_start = image_base + image_headroom;
-    unsigned long initrd_len = initrd ? initrd->mod_end : 0;
+    void *image_base = bootstrap_map(image);
+    unsigned long image_len = image->size;
+    void *image_start = image_base + image->arch->headroom;
+    unsigned long initrd_len = initrd ? initrd->size : 0;
     l4_pgentry_t *l4tab = NULL, *l4start = NULL;
     l3_pgentry_t *l3tab = NULL, *l3start = NULL;
     l2_pgentry_t *l2tab = NULL, *l2start = NULL;
@@ -417,7 +416,7 @@ int __init dom0_construct_pv(struct domain *d,
 
     d->max_pages = ~0U;
 
-    if ( (rc = bzimage_parse(image_base, &image_start, image_headroom,
+    if ( (rc = bzimage_parse(image_base, &image_start, image->arch->headroom,
                              &image_len)) != 0 )
         return rc;
 
@@ -612,7 +611,7 @@ int __init dom0_construct_pv(struct domain *d,
         initrd_pfn = vinitrd_start ?
                      (vinitrd_start - v_start) >> PAGE_SHIFT :
                      domain_tot_pages(d);
-        initrd_mfn = mfn = initrd->mod_start;
+        initrd_mfn = mfn = mfn_x(initrd->mfn);
         count = PFN_UP(initrd_len);
         if ( d->arch.physaddr_bitsize &&
              ((mfn + count - 1) >> (d->arch.physaddr_bitsize - PAGE_SHIFT)) )
@@ -627,12 +626,13 @@ int __init dom0_construct_pv(struct domain *d,
                     free_domheap_pages(page, order);
                     page += 1UL << order;
                 }
-            memcpy(page_to_virt(page), mfn_to_virt(initrd->mod_start),
+            memcpy(page_to_virt(page), maddr_to_virt(initrd->start),
                    initrd_len);
-            mpt_alloc = (paddr_t)initrd->mod_start << PAGE_SHIFT;
+            mpt_alloc = (paddr_t)initrd->start;
             init_domheap_pages(mpt_alloc,
                                mpt_alloc + PAGE_ALIGN(initrd_len));
-            initrd->mod_start = initrd_mfn = mfn_x(page_to_mfn(page));
+            bootmodule_update_mfn(initrd, page_to_mfn(page));
+            initrd_mfn = mfn_x(initrd->mfn);
         }
         else
         {
@@ -640,7 +640,7 @@ int __init dom0_construct_pv(struct domain *d,
                 if ( assign_pages(mfn_to_page(_mfn(mfn++)), 1, d, 0) )
                     BUG();
         }
-        initrd->mod_end = 0;
+        initrd->size = 0;
 
         iommu_memory_setup(d, "initrd", mfn_to_page(_mfn(initrd_mfn)),
                            PFN_UP(initrd_len), &flush_flags);
@@ -654,7 +654,7 @@ int __init dom0_construct_pv(struct domain *d,
                nr_pages - domain_tot_pages(d));
     if ( initrd )
     {
-        mpt_alloc = (paddr_t)initrd->mod_start << PAGE_SHIFT;
+        mpt_alloc = initrd->start;
         printk("\n Init. ramdisk: %"PRIpaddr"->%"PRIpaddr,
                mpt_alloc, mpt_alloc + initrd_len);
     }
@@ -880,7 +880,7 @@ int __init dom0_construct_pv(struct domain *d,
         if ( pfn >= initrd_pfn )
         {
             if ( pfn < initrd_pfn + PFN_UP(initrd_len) )
-                mfn = initrd->mod_start + (pfn - initrd_pfn);
+                mfn = mfn_x(initrd->mfn) + (pfn - initrd_pfn);
             else
                 mfn -= PFN_UP(initrd_len);
         }
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 3b623a4149..f9b04daebd 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -37,6 +37,7 @@
 #include <asm/processor.h>
 #include <asm/mpspec.h>
 #include <asm/apic.h>
+#include <asm/boot.h>
 #include <asm/msi.h>
 #include <asm/desc.h>
 #include <asm/paging.h>
@@ -59,6 +60,9 @@
 #include <asm/prot-key.h>
 #include <asm/pv/domain.h>
 
+/* Max number of boot modules a bootloader can provide in addition to Xen */
+#define MAX_NR_BOOTMODS 63
+
 /* opt_nosmp: If true, secondary processors are ignored. */
 static bool __initdata opt_nosmp;
 boolean_param("nosmp", opt_nosmp);
@@ -269,20 +273,44 @@ static int __init cf_check parse_acpi_param(const char *s)
 }
 custom_param("acpi", parse_acpi_param);
 
-static const module_t *__initdata initial_images;
 static struct boot_info __initdata *boot_info;
 
-static void __init multiboot_to_bootinfo(multiboot_info_t *mbi)
+static void __init multiboot_to_bootinfo(multiboot_info_t *mbi, module_t *mods)
 {
     static struct boot_info       __initdata info;
-    static struct boot_module     __initdata boot_mods[1];
-    static struct arch_bootmodule __initdata arch_boot_mods[1];
+    static struct arch_boot_info  __initdata arch_info;
+    static struct boot_module     __initdata boot_mods[MAX_NR_BOOTMODS + 1];
+    static struct arch_bootmodule __initdata arch_boot_mods[
+                                                       MAX_NR_BOOTMODS + 1];
 
+    int i;
+
+    info.arch = &arch_info;
     info.mods = boot_mods;
 
+    info.cmdline = __va(mbi->cmdline);
+
+    /* The BOOTINFO_FLAG_X86_* flags are a 1-1 map to MBI_* */
+    arch_info.flags = mbi->flags;
+    arch_info.mmap_length = mbi->mmap_length;
+    arch_info.mmap_addr = mbi->mmap_addr;
+    arch_info.boot_loader_name = __va(mbi->boot_loader_name);
+
     info.nr_mods = mbi->mods_count;
+    for ( i = 0; i <= MAX_NR_BOOTMODS; i++ )
+    {
+        boot_mods[i].arch = &arch_boot_mods[i];
 
-    boot_mods[0].arch = &arch_boot_mods[0];
+        if ( i < info.nr_mods )
+        {
+            bootmodule_update_start(&boot_mods[i], mods[i].mod_start);
+            boot_mods[i].size = mods[i].mod_end - mods[i].mod_start;
+
+            boot_mods[i].string.len = strlcpy(boot_mods[i].string.bytes,
+                                             __va(mods[i].string),
+                                             BOOTMOD_STRING_MAX_LEN);
+        }
+    }
 
     boot_info = &info;
 }
@@ -296,8 +324,8 @@ unsigned long __init initial_images_nrpages(nodeid_t node)
 
     for ( nr = i = 0; i < boot_info->nr_mods; ++i )
     {
-        unsigned long start = initial_images[i].mod_start;
-        unsigned long end = start + PFN_UP(initial_images[i].mod_end);
+        unsigned long start = mfn_x(boot_info->mods[i].mfn);
+        unsigned long end = start + PFN_UP(boot_info->mods[i].size);
 
         if ( end > node_start && node_end > start )
             nr += min(node_end, end) - max(node_start, start);
@@ -312,14 +340,13 @@ void __init discard_initial_images(void)
 
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
-        uint64_t start = (uint64_t)initial_images[i].mod_start << PAGE_SHIFT;
+        uint64_t start = boot_info->mods[i].start;
 
         init_domheap_pages(start,
-                           start + PAGE_ALIGN(initial_images[i].mod_end));
+                           start + PAGE_ALIGN(boot_info->mods[i].size));
     }
 
     boot_info->nr_mods = 0;
-    initial_images = NULL;
 }
 
 extern unsigned char __init_begin[], __init_end[];
@@ -450,26 +477,26 @@ static void __init move_memory(
 
     while ( size )
     {
-        module_t mod;
+        struct boot_module mod;
         unsigned int soffs = src & mask;
         unsigned int doffs = dst & mask;
         unsigned int sz;
         void *d, *s;
 
-        mod.mod_start = (src - soffs) >> PAGE_SHIFT;
-        mod.mod_end = soffs + size;
-        if ( mod.mod_end > blksz )
-            mod.mod_end = blksz;
-        sz = mod.mod_end - soffs;
-        s = bootstrap_map_multiboot(&mod);
-
-        mod.mod_start = (dst - doffs) >> PAGE_SHIFT;
-        mod.mod_end = doffs + size;
-        if ( mod.mod_end > blksz )
-            mod.mod_end = blksz;
-        if ( sz > mod.mod_end - doffs )
-            sz = mod.mod_end - doffs;
-        d = bootstrap_map_multiboot(&mod);
+        mod.start = src - soffs;
+        mod.size = soffs + size;
+        if ( mod.size > blksz )
+            mod.size = blksz;
+        sz = mod.size - soffs;
+        s = bootstrap_map(&mod);
+
+        mod.start = dst - doffs;
+        mod.size = doffs + size;
+        if ( mod.size > blksz )
+            mod.size = blksz;
+        if ( sz > mod.size - doffs )
+            sz = mod.size - doffs;
+        d = bootstrap_map(&mod);
 
         memmove(d + doffs, s + soffs, sz);
 
@@ -602,7 +629,7 @@ static void __init noinline move_xen(void)
 #undef BOOTSTRAP_MAP_LIMIT
 
 static uint64_t __init consider_modules(
-    uint64_t s, uint64_t e, uint32_t size, const module_t *mod,
+    uint64_t s, uint64_t e, uint32_t size, const struct boot_module *mod,
     unsigned int nr_mods, unsigned int this_mod)
 {
     unsigned int i;
@@ -612,8 +639,8 @@ static uint64_t __init consider_modules(
 
     for ( i = 0; i < nr_mods ; ++i )
     {
-        uint64_t start = (uint64_t)mod[i].mod_start << PAGE_SHIFT;
-        uint64_t end = start + PAGE_ALIGN(mod[i].mod_end);
+        uint64_t start = mod[i].start;
+        uint64_t end = start + PAGE_ALIGN(mod[i].size);
 
         if ( i == this_mod )
             continue;
@@ -883,9 +910,8 @@ static unsigned int __init copy_bios_e820(struct e820entry *map, unsigned int li
     return n;
 }
 
-static struct domain *__init create_dom0(const module_t *image,
-                                         unsigned long headroom,
-                                         module_t *initrd, const char *kextra,
+static struct domain *__init create_dom0(const struct boot_info *bootinfo,
+                                         const char *kextra,
                                          const char *loader)
 {
     struct xen_domctl_createdomain dom0_cfg = {
@@ -899,9 +925,14 @@ static struct domain *__init create_dom0(const module_t *image,
             .misc_flags = opt_dom0_msr_relaxed ? XEN_X86_MSR_RELAXED : 0,
         },
     };
+    struct boot_module *image = bootmodule_next(bootinfo, BOOTMOD_KERNEL);
+    struct boot_module *initrd = bootmodule_next(bootinfo, BOOTMOD_RAMDISK);
     struct domain *d;
     char *cmdline;
-    domid_t domid;
+    domid_t domid = 0;
+
+    if ( image == NULL )
+        panic("Error creating d%uv0\n", domid);
 
     if ( opt_dom0_pvh )
     {
@@ -928,7 +959,7 @@ static struct domain *__init create_dom0(const module_t *image,
         panic("Error creating d%uv0\n", domid);
 
     /* Grab the DOM0 command line. */
-    cmdline = image->string ? __va(image->string) : NULL;
+    cmdline = image->string.len ? image->string.bytes : NULL;
     if ( cmdline || kextra )
     {
         static char __initdata dom0_cmdline[MAX_GUEST_CMDLINE];
@@ -968,8 +999,7 @@ static struct domain *__init create_dom0(const module_t *image,
         write_cr4(read_cr4() & ~X86_CR4_SMAP);
     }
 
-    if ( construct_dom0(d, image, boot_info->mods[0].arch->headroom, initrd,
-                        cmdline) != 0 )
+    if ( construct_dom0(d, image, initrd, cmdline) != 0 )
         panic("Could not construct domain 0\n");
 
     if ( cpu_has_smap )
@@ -1038,14 +1068,14 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         mod = __va(mbi->mods_addr);
     }
 
-    multiboot_to_bootinfo(mbi);
+    multiboot_to_bootinfo(mbi, mod);
 
-    loader = (mbi->flags & MBI_LOADERNAME)
-        ? (char *)__va(mbi->boot_loader_name) : "unknown";
+    loader = (boot_info->arch->flags & BOOTINFO_FLAG_X86_LOADERNAME)
+        ? boot_info->arch->boot_loader_name : "unknown";
 
     /* Parse the command-line options. */
-    cmdline = cmdline_cook((mbi->flags & MBI_CMDLINE) ?
-                           __va(mbi->cmdline) : NULL,
+    cmdline = cmdline_cook((boot_info->arch->flags & BOOTINFO_FLAG_X86_CMDLINE) ?
+                            boot_info->cmdline : NULL,
                            loader);
     if ( (kextra = strstr(cmdline, " -- ")) != NULL )
     {
@@ -1147,19 +1177,22 @@ void __init noreturn __start_xen(unsigned long mbi_p)
            bootsym(boot_edd_info_nr));
 
     /* Check that we have at least one Multiboot module. */
-    if ( !(mbi->flags & MBI_MODULES) || (boot_info->nr_mods == 0) )
+    if ( !(boot_info->arch->flags & BOOTINFO_FLAG_X86_MODULES) ||
+         (boot_info->nr_mods == 0) )
         panic("dom0 kernel not specified. Check bootloader configuration\n");
 
     /* Check that we don't have a silly number of modules. */
-    if ( boot_info->nr_mods > sizeof(module_map) * 8 )
+    if ( boot_info->nr_mods > MAX_NR_BOOTMODS + 1 )
     {
-        boot_info->nr_mods = sizeof(module_map) * 8;
+        boot_info->nr_mods = MAX_NR_BOOTMODS + 1;
         printk("Excessive multiboot modules - using the first %u only\n",
                boot_info->nr_mods);
     }
 
-    bitmap_fill(module_map, boot_info->nr_mods);
+    /* Dom0 kernel is the first boot module */
+    bitmap_fill(module_map, mbi->mods_count);
     __clear_bit(0, module_map); /* Dom0 kernel is always first */
+    boot_info->mods[0].bootmod_type = BOOTMOD_KERNEL;
 
     if ( pvh_boot )
     {
@@ -1189,13 +1222,13 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     {
         memmap_type = "Xen-e820";
     }
-    else if ( mbi->flags & MBI_MEMMAP )
+    else if ( boot_info->arch->flags & BOOTINFO_FLAG_X86_MEMMAP )
     {
         memmap_type = "Multiboot-e820";
-        while ( bytes < mbi->mmap_length &&
+        while ( bytes < boot_info->arch->mmap_length &&
                 e820_raw.nr_map < ARRAY_SIZE(e820_raw.map) )
         {
-            memory_map_t *map = __va(mbi->mmap_addr + bytes);
+            struct mb_memmap *map = __va(boot_info->arch->mmap_addr + bytes);
 
             /*
              * This is a gross workaround for a BIOS bug. Some bootloaders do
@@ -1330,17 +1363,9 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     set_kexec_crash_area_size((u64)nr_pages << PAGE_SHIFT);
     kexec_reserve_area(&boot_e820);
 
-    initial_images = mod;
-    boot_info->nr_mods = boot_info->nr_mods;
-
     for ( i = 0; !efi_enabled(EFI_LOADER) && i < boot_info->nr_mods; i++ )
-    {
-        if ( mod[i].mod_start & (PAGE_SIZE - 1) )
+        if ( boot_info->mods[i].start & (PAGE_SIZE - 1) )
             panic("Bootloader didn't honor module alignment request\n");
-        mod[i].mod_end -= mod[i].mod_start;
-        mod[i].mod_start >>= PAGE_SHIFT;
-        mod[i].reserved = 0;
-    }
 
     /*
      * TODO: load ucode earlier once multiboot modules become accessible
@@ -1357,12 +1382,14 @@ void __init noreturn __start_xen(unsigned long mbi_p)
          * respective reserve_e820_ram() invocation below. No need to
          * query efi_boot_mem_unused() here, though.
          */
-        mod[boot_info->nr_mods].mod_start = virt_to_mfn(_stext);
-        mod[boot_info->nr_mods].mod_end = __2M_rwdata_end - _stext;
+        bootmodule_update_start(&boot_info->mods[boot_info->nr_mods],
+                                virt_to_maddr(_stext));
+        boot_info->mods[boot_info->nr_mods].size = __2M_rwdata_end - _stext;
     }
 
     boot_info->mods[0].arch->headroom =
-        bzimage_headroom(bootstrap_map_multiboot(mod), mod->mod_end);
+        bzimage_headroom(bootstrap_map(&boot_info->mods[0]),
+                         boot_info->mods[0].size);
 
     bootstrap_map(NULL);
 
@@ -1420,7 +1447,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         {
             /* Don't overlap with modules. */
             end = consider_modules(s, e, reloc_size + mask,
-                                   mod, boot_info->nr_mods, -1);
+                                   boot_info->mods, boot_info->nr_mods, -1);
             end &= ~mask;
         }
         else
@@ -1443,15 +1470,15 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         /* Is the region suitable for relocating the multiboot modules? */
         for ( j = boot_info->nr_mods - 1; j >= 0; j-- )
         {
-            struct boot_module *boot_mods = boot_info->mods;
-            unsigned long headroom = j ? 0 : boot_mods[0].arch->headroom;
-            unsigned long size = PAGE_ALIGN(headroom + mod[j].mod_end);
+            struct boot_module *boot_mod = boot_info->mods;
+            unsigned long headroom = j ? 0 : boot_mod[0].arch->headroom;
+            unsigned long size = PAGE_ALIGN(headroom + boot_mod[j].size);
 
-            if ( mod[j].reserved )
+            if ( boot_mod[j].arch->flags & BOOTMOD_FLAG_X86_RELOCATED )
                 continue;
 
             /* Don't overlap with other modules (or Xen itself). */
-            end = consider_modules(s, e, size, mod,
+            end = consider_modules(s, e, size, boot_info->mods,
                                    boot_info->nr_mods + relocated, j);
 
             if ( highmem_start && end > highmem_start )
@@ -1459,14 +1486,14 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
             if ( s < end &&
                  (headroom ||
-                  ((end - size) >> PAGE_SHIFT) > mod[j].mod_start) )
+                  ((end - size) >> PAGE_SHIFT) > mfn_x(boot_mod[j].mfn)) )
             {
                 move_memory(end - size + headroom,
-                            (uint64_t)mod[j].mod_start << PAGE_SHIFT,
-                            mod[j].mod_end);
-                mod[j].mod_start = (end - size) >> PAGE_SHIFT;
-                mod[j].mod_end += headroom;
-                mod[j].reserved = 1;
+                            (uint64_t)boot_mod[j].start,
+                            boot_mod[j].size);
+                bootmodule_update_start(&boot_mod[j], end - size);
+                boot_mod[j].size += headroom;
+                boot_mod[j].arch->flags |= BOOTMOD_FLAG_X86_RELOCATED;
             }
         }
 
@@ -1478,7 +1505,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         while ( !kexec_crash_area.start )
         {
             /* Don't overlap with modules (or Xen itself). */
-            e = consider_modules(s, e, PAGE_ALIGN(kexec_crash_area.size), mod,
+            e = consider_modules(s, e, PAGE_ALIGN(kexec_crash_area.size),
+                                 boot_info->mods,
                                  boot_info->nr_mods + relocated, -1);
             if ( s >= e )
                 break;
@@ -1492,13 +1520,14 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 #endif
     }
 
-    if ( boot_info->mods[0].arch->headroom && !mod->reserved )
+    if ( boot_info->mods[0].arch->headroom &&
+         !(boot_info->mods[0].arch->flags & BOOTMOD_FLAG_X86_RELOCATED) )
         panic("Not enough memory to relocate the dom0 kernel image\n");
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
-        uint64_t s = (uint64_t)mod[i].mod_start << PAGE_SHIFT;
+        uint64_t s = (uint64_t)boot_info->mods[i].start;
 
-        reserve_e820_ram(&boot_e820, s, s + PAGE_ALIGN(mod[i].mod_end));
+        reserve_e820_ram(&boot_e820, s, s + PAGE_ALIGN(boot_info->mods[i].size));
     }
 
     if ( !xen_phys_start )
@@ -1565,8 +1594,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
                 map_e = boot_e820.map[j].addr + boot_e820.map[j].size;
                 for ( j = 0; j < boot_info->nr_mods; ++j )
                 {
-                    uint64_t end = pfn_to_paddr(mod[j].mod_start) +
-                                   mod[j].mod_end;
+                    uint64_t end = mfn_to_maddr(boot_info->mods[j].mfn) +
+                                   boot_info->mods[j].size;
 
                     if ( map_e < end )
                         map_e = end;
@@ -1641,11 +1670,12 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
-        set_pdx_range(mod[i].mod_start,
-                      mod[i].mod_start + PFN_UP(mod[i].mod_end));
-        map_pages_to_xen((unsigned long)mfn_to_virt(mod[i].mod_start),
-                         _mfn(mod[i].mod_start),
-                         PFN_UP(mod[i].mod_end), PAGE_HYPERVISOR);
+        set_pdx_range(mfn_x(boot_info->mods[i].mfn),
+                      mfn_x(boot_info->mods[i].mfn) +
+                      PFN_UP(boot_info->mods[i].size));
+        map_pages_to_xen((unsigned long)maddr_to_virt(boot_info->mods[i].start),
+                         boot_info->mods[i].mfn,
+                         PFN_UP(boot_info->mods[i].size), PAGE_HYPERVISOR);
     }
 
 #ifdef CONFIG_KEXEC
@@ -2022,8 +2052,12 @@ void __init noreturn __start_xen(unsigned long mbi_p)
            cpu_has_nx ? XENLOG_INFO : XENLOG_WARNING "Warning: ",
            cpu_has_nx ? "" : "not ");
 
-    initrdidx = find_first_bit(module_map, boot_info->nr_mods);
-    if ( bitmap_weight(module_map, boot_info->nr_mods) > 1 )
+    initrdidx = bootmodule_index(boot_info, BOOTMOD_UNKNOWN, 0);
+    if ( initrdidx < boot_info->nr_mods )
+        boot_info->mods[initrdidx].bootmod_type = BOOTMOD_RAMDISK;
+
+    if ( bootmodule_index(boot_info, BOOTMOD_UNKNOWN, 0) >
+            boot_info->nr_mods )
         printk(XENLOG_WARNING
                "Multiple initrd candidates, picking module #%u\n",
                initrdidx);
@@ -2032,9 +2066,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
      * We're going to setup domain0 using the module(s) that we stashed safely
      * above our heap. The second module, if present, is an initrd ramdisk.
      */
-    dom0 = create_dom0(mod, boot_info->mods[0].arch->headroom,
-                       initrdidx < boot_info->nr_mods ? mod + initrdidx : NULL,
-                       kextra, loader);
+    dom0 = create_dom0(boot_info, kextra, loader);
     if ( !dom0 )
         panic("Could not set up DOM0 guest OS\n");
 
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
index eb93cc3439..2f4284a91f 100644
--- a/xen/include/xen/bootinfo.h
+++ b/xen/include/xen/bootinfo.h
@@ -2,23 +2,50 @@
 #define __XEN_BOOTINFO_H__
 
 #include <xen/types.h>
+#include <xen/compiler.h>
+#include <xen/mm-frame.h>
 
 #ifdef CONFIG_X86
 #include <asm/bootinfo.h>
 #else
     struct arch_bootmodule { };
+    struct arch_boot_info { };
 #endif
 
+/* Boot module binary type / purpose */
+#define BOOTMOD_UNKNOWN     0
+#define BOOTMOD_XEN         1
+#define BOOTMOD_FDT         2
+#define BOOTMOD_KERNEL      3
+#define BOOTMOD_RAMDISK     4
+#define BOOTMOD_XSM         5
+#define BOOTMOD_UCODE       6
+#define BOOTMOD_GUEST_DTB   7
+typedef unsigned int bootmod_type_t;
+
+#define BOOTMOD_STRING_MAX_LEN 1024
+struct boot_string {
+    char bytes[BOOTMOD_STRING_MAX_LEN];
+    size_t len;
+};
+
 struct boot_module {
+    bootmod_type_t bootmod_type;
     paddr_t start;
+    mfn_t mfn;
     size_t size;
 
     struct arch_bootmodule *arch;
+    struct boot_string string;
 };
 
 struct boot_info {
+    char *cmdline;
+
     unsigned int nr_mods;
     struct boot_module *mods;
+
+    struct arch_boot_info *arch;
 };
 
 #endif
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 00:31:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 00:31:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557668.871234 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWi-0008Vl-VE; Sat, 01 Jul 2023 00:31:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557668.871234; Sat, 01 Jul 2023 00:31:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWi-0008Vc-Pf; Sat, 01 Jul 2023 00:31:48 +0000
Received: by outflank-mailman (input) for mailman id 557668;
 Sat, 01 Jul 2023 00:31:47 +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
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFOWh-0007yM-QK
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 00:31:47 +0000
Received: from mail-yw1-x112a.google.com (mail-yw1-x112a.google.com
 [2607:f8b0:4864:20::112a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a7cb92e4-17a6-11ee-8611-37d641c3527e;
 Sat, 01 Jul 2023 02:31:44 +0200 (CEST)
Received: by mail-yw1-x112a.google.com with SMTP id
 00721157ae682-5701e8f2b79so27334707b3.0
 for <xen-devel@lists.xenproject.org>; Fri, 30 Jun 2023 17:31:44 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s68-20020a632c47000000b0055b61cd99a1sm1824296pgs.81.2023.06.30.17.31.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Jun 2023 17:31:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: a7cb92e4-17a6-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688171503; x=1690763503;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=sqQqqF0IyJ/PuKXVXwFAfGVp5jzTeAtO0YKlHbSfXAU=;
        b=d+tq/rbAfNr5yHLcrKURrSqr0rJdRYKlNsfHaEao/XBIfLlqSHBeZDOh6Co8fB7AdZ
         lUj+VBO5+5quL7CbuIRyuJOG5+akeVBPPcpaF/fItBEAOdlsGJ/j0yvO5SBKTGS/DrwT
         k/ZGa6qjJ1yABSQNwvhpdip4eF2079ZAJ5g5EpA5x3sw4EvMMV7JSxZ5ZhrAw1GPJWeu
         xFH9LrxE8SIjPMBeE4wDYtpzOsDrD1yY5JDc2rqoqcfcHmDhrztTG+cKFyacpwW0NDAT
         rPe2NjV6ePCwpCbYnrfg7Rxh/2EH2dA0G5DJM4YStZR20n7Vu4oVD9XZwPZ3jtH9tc6b
         WarA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688171503; x=1690763503;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=sqQqqF0IyJ/PuKXVXwFAfGVp5jzTeAtO0YKlHbSfXAU=;
        b=BeRPAKMC7NkuJh14+53YHyJRxcftOMh1U67mwx62IeCagdlroJQKwcYRgx5S/ov8Bd
         IbzWJAplB+qGjxz/Lvvq/ECzU4vlzlYjqIrCe/ziOSmWPuPJoeqBQF65lqkh8R4f24qg
         p6Xpd7H7sJkW3J6zRSjgQkV5zX0FY1OrAgOthRk28p05oeEf0fqNzhM2iLXeNc9ftnpE
         vB+dhrH0cbFkuOXxxFtEh7H94qHK9C39Jt1XOUR8Cz1qOrYe/BwI5VsJqHUzGtPd5eUJ
         AXyqn4A+7SGS6e6yTU/6WcwCERc21H/RQJjXVuBqZuV3t/HjVQHYCP4JeavU/FeDObg/
         7awA==
X-Gm-Message-State: ABy/qLbH3/KLIHZw+ttmPzoyQVmgujsAf5ukPLWVqRJJ63koMZGse5/t
	oZuIwIogHBShvJ/jLyr8FJ6WXIq6f/4=
X-Google-Smtp-Source: APBJJlGhQ1CFMj7J8a/Nqrkm+dSxRfTiP6kfcYG7qn5RNbcc78vyoNL6EmmGS4YOue+8pyYX/4D9jw==
X-Received: by 2002:a81:de49:0:b0:56d:2981:e2e2 with SMTP id o9-20020a81de49000000b0056d2981e2e2mr3897669ywl.6.1688171503257;
        Fri, 30 Jun 2023 17:31:43 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 03/11] x86 setup: change bootstrap map to accept new boot module structures
Date: Fri, 30 Jun 2023 17:31:24 -0700
Message-Id: <20230701003132.2210306-4-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
References: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

To convert the x86 boot logic from multiboot to boot module structures,
change the bootstrap map function to accept a boot module parameter.

To allow incremental change from multiboot to boot modules across all
x86 setup logic, provide a temporary inline wrapper that still accepts a
multiboot module parameter and use it where necessary. The wrapper is
placed in a new arch/x86 header <asm/boot.h> to avoid putting a static
inline function into an existing header that has no such functions
already. This new header will be expanded with additional functions in
subsequent patches in this series.

No functional change intended.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

changes since v1:
- new patch so v1 patch 3 can be implemented via incremental series
---
 xen/arch/x86/cpu/microcode/core.c |  7 ++++---
 xen/arch/x86/hvm/dom0_build.c     |  4 +++-
 xen/arch/x86/include/asm/boot.h   | 32 +++++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/setup.h  |  3 ++-
 xen/arch/x86/pv/dom0_build.c      |  3 ++-
 xen/arch/x86/setup.c              | 18 +++++++++--------
 xen/include/xen/bootinfo.h        |  3 +++
 xen/xsm/xsm_policy.c              |  3 ++-
 8 files changed, 58 insertions(+), 15 deletions(-)
 create mode 100644 xen/arch/x86/include/asm/boot.h

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index cd456c476f..e720a89167 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -34,6 +34,7 @@
 #include <xen/watchdog.h>
 
 #include <asm/apic.h>
+#include <asm/boot.h>
 #include <asm/cpu-policy.h>
 #include <asm/delay.h>
 #include <asm/nmi.h>
@@ -180,7 +181,7 @@ void __init microcode_scan_module(
         if ( !test_bit(i, module_map) )
             continue;
 
-        _blob_start = bootstrap_map(&mod[i]);
+        _blob_start = bootstrap_map_multiboot(&mod[i]);
         _blob_size = mod[i].mod_end;
         if ( !_blob_start )
         {
@@ -794,7 +795,7 @@ int __init microcode_init_cache(unsigned long *module_map,
         microcode_scan_module(module_map, mbi);
 
     if ( ucode_mod.mod_end )
-        rc = early_update_cache(bootstrap_map(&ucode_mod),
+        rc = early_update_cache(bootstrap_map_multiboot(&ucode_mod),
                                 ucode_mod.mod_end);
     else if ( ucode_blob.size )
         rc = early_update_cache(ucode_blob.data, ucode_blob.size);
@@ -817,7 +818,7 @@ static int __init early_microcode_update_cpu(void)
     else if ( ucode_mod.mod_end )
     {
         len = ucode_mod.mod_end;
-        data = bootstrap_map(&ucode_mod);
+        data = bootstrap_map_multiboot(&ucode_mod);
     }
 
     if ( !data )
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index bf08998862..56fe89632b 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -16,6 +16,7 @@
 
 #include <acpi/actables.h>
 
+#include <asm/boot.h>
 #include <asm/bzimage.h>
 #include <asm/dom0_build.h>
 #include <asm/hvm/support.h>
@@ -1208,7 +1209,8 @@ int __init dom0_construct_pvh(struct domain *d, const module_t *image,
         return rc;
     }
 
-    rc = pvh_load_kernel(d, image, image_headroom, initrd, bootstrap_map(image),
+    rc = pvh_load_kernel(d, image, image_headroom, initrd,
+                         bootstrap_map_multiboot(image),
                          cmdline, &entry, &start_info);
     if ( rc )
     {
diff --git a/xen/arch/x86/include/asm/boot.h b/xen/arch/x86/include/asm/boot.h
new file mode 100644
index 0000000000..10b17f12b2
--- /dev/null
+++ b/xen/arch/x86/include/asm/boot.h
@@ -0,0 +1,32 @@
+#ifndef __ASM_X86_BOOT_H__
+#define __ASM_X86_BOOT_H__
+
+#include <xen/bootinfo.h>
+#include <xen/multiboot.h>
+
+#include <asm/setup.h>
+
+static inline void *bootstrap_map_multiboot(const module_t *mod)
+{
+    struct boot_module bm;
+
+    if ( !mod )
+        return bootstrap_map(NULL);
+
+    bm.start = mod->mod_start << PAGE_SHIFT;
+    bm.size = mod->mod_end;
+
+    return bootstrap_map(&bm);
+}
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index ae0dd3915a..80d0bb2a21 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -1,6 +1,7 @@
 #ifndef __X86_SETUP_H_
 #define __X86_SETUP_H_
 
+#include <xen/bootinfo.h>
 #include <xen/multiboot.h>
 #include <asm/numa.h>
 
@@ -40,7 +41,7 @@ void setup_io_bitmap(struct domain *d);
 
 unsigned long initial_images_nrpages(nodeid_t node);
 void discard_initial_images(void);
-void *bootstrap_map(const module_t *mod);
+void *bootstrap_map(const struct boot_module *mod);
 
 int xen_in_range(unsigned long mfn);
 
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index 6ed9f8bbed..4fe806b60d 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -14,6 +14,7 @@
 #include <xen/sched.h>
 #include <xen/softirq.h>
 
+#include <asm/boot.h>
 #include <asm/bzimage.h>
 #include <asm/dom0_build.h>
 #include <asm/guest.h>
@@ -374,7 +375,7 @@ int __init dom0_construct_pv(struct domain *d,
     unsigned int flush_flags = 0;
     start_info_t *si;
     struct vcpu *v = d->vcpu[0];
-    void *image_base = bootstrap_map(image);
+    void *image_base = bootstrap_map_multiboot(image);
     unsigned long image_len = image->mod_end;
     void *image_start = image_base + image_headroom;
     unsigned long initrd_len = initrd ? initrd->mod_end : 0;
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index c0e8fc6ab7..3b623a4149 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -32,6 +32,7 @@
 #include <compat/xen.h>
 #endif
 #include <xen/bitops.h>
+#include <asm/boot.h>
 #include <asm/smp.h>
 #include <asm/processor.h>
 #include <asm/mpspec.h>
@@ -405,14 +406,14 @@ static void __init normalise_cpu_order(void)
  * Ensure a given physical memory range is present in the bootstrap mappings.
  * Use superpage mappings to ensure that pagetable memory needn't be allocated.
  */
-void *__init bootstrap_map(const module_t *mod)
+void *__init bootstrap_map(const struct boot_module *mod)
 {
     static unsigned long __initdata map_cur = BOOTSTRAP_MAP_BASE;
     uint64_t start, end, mask = (1L << L2_PAGETABLE_SHIFT) - 1;
     void *ret;
 
     if ( system_state != SYS_STATE_early_boot )
-        return mod ? mfn_to_virt(mod->mod_start) : NULL;
+        return mod ? maddr_to_virt(mod->start) : NULL;
 
     if ( !mod )
     {
@@ -421,8 +422,8 @@ void *__init bootstrap_map(const module_t *mod)
         return NULL;
     }
 
-    start = (uint64_t)mod->mod_start << PAGE_SHIFT;
-    end = start + mod->mod_end;
+    start = (uint64_t)mod->start;
+    end = start + mod->size;
     if ( start >= end )
         return NULL;
 
@@ -460,7 +461,7 @@ static void __init move_memory(
         if ( mod.mod_end > blksz )
             mod.mod_end = blksz;
         sz = mod.mod_end - soffs;
-        s = bootstrap_map(&mod);
+        s = bootstrap_map_multiboot(&mod);
 
         mod.mod_start = (dst - doffs) >> PAGE_SHIFT;
         mod.mod_end = doffs + size;
@@ -468,7 +469,7 @@ static void __init move_memory(
             mod.mod_end = blksz;
         if ( sz > mod.mod_end - doffs )
             sz = mod.mod_end - doffs;
-        d = bootstrap_map(&mod);
+        d = bootstrap_map_multiboot(&mod);
 
         memmove(d + doffs, s + soffs, sz);
 
@@ -1360,8 +1361,9 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         mod[boot_info->nr_mods].mod_end = __2M_rwdata_end - _stext;
     }
 
-    boot_info->mods[0].arch->headroom = bzimage_headroom(bootstrap_map(mod),
-                                                         mod->mod_end);
+    boot_info->mods[0].arch->headroom =
+        bzimage_headroom(bootstrap_map_multiboot(mod), mod->mod_end);
+
     bootstrap_map(NULL);
 
 #ifndef highmem_start
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
index b72ae31a66..eb93cc3439 100644
--- a/xen/include/xen/bootinfo.h
+++ b/xen/include/xen/bootinfo.h
@@ -10,6 +10,9 @@
 #endif
 
 struct boot_module {
+    paddr_t start;
+    size_t size;
+
     struct arch_bootmodule *arch;
 };
 
diff --git a/xen/xsm/xsm_policy.c b/xen/xsm/xsm_policy.c
index 8dafbc9381..c6df8c6e06 100644
--- a/xen/xsm/xsm_policy.c
+++ b/xen/xsm/xsm_policy.c
@@ -20,6 +20,7 @@
 
 #include <xsm/xsm.h>
 #ifdef CONFIG_MULTIBOOT
+#include <asm/boot.h>
 #include <xen/multiboot.h>
 #include <asm/setup.h>
 #endif
@@ -49,7 +50,7 @@ int __init xsm_multiboot_policy_init(
         if ( !test_bit(i, module_map) )
             continue;
 
-        _policy_start = bootstrap_map(mod + i);
+        _policy_start = bootstrap_map_multiboot(mod + i);
         _policy_len   = mod[i].mod_end;
 
         if ( (xsm_magic_t)(*_policy_start) == XSM_MAGIC )
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 00:31:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 00:31:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557666.871213 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWg-00081u-E1; Sat, 01 Jul 2023 00:31:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557666.871213; Sat, 01 Jul 2023 00:31:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWg-000815-8L; Sat, 01 Jul 2023 00:31:46 +0000
Received: by outflank-mailman (input) for mailman id 557666;
 Sat, 01 Jul 2023 00:31:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFOWe-0007yB-Re
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 00:31:44 +0000
Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com
 [2607:f8b0:4864:20::434])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a73357b3-17a6-11ee-b237-6b7b168915f2;
 Sat, 01 Jul 2023 02:31:44 +0200 (CEST)
Received: by mail-pf1-x434.google.com with SMTP id
 d2e1a72fcca58-668709767b1so1546245b3a.2
 for <xen-devel@lists.xenproject.org>; Fri, 30 Jun 2023 17:31:44 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s68-20020a632c47000000b0055b61cd99a1sm1824296pgs.81.2023.06.30.17.31.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Jun 2023 17:31:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: a73357b3-17a6-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688171502; x=1690763502;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=LY4hOPffrE6QJlk2fTfa3K1ABHuOB1gwqTF+/zyLHhg=;
        b=pXHV6ClIgQKCL4P3Ydz6t6ZjxJjBbulbFY65VM8m+LoBbAV8zs1butDeeouPUo3kZd
         yLjXoQ5J7JD6Iys3hs7K/IYhEl3EpOWN/gze9swW/H85U8CB3ExCzs094wHslFX3QblV
         4nUEoJ9h9cbnhDnjLiu6jworYv4Y9iQHAqjImZrI9VC10ChyhPhusYLWRdXw46IAuQXw
         NV8PJH9JSBggK3Y+Uk7g+D4QoEgtMekK8dt4mob37oegIx2bTLIEZ/MwhtKt+rEIFfGo
         CU/rs5rxRl69LxBBIiAMd8LntZ58QWSTM6fwVBbXp+tZGK4C3JPEf2VmFmoksAe5kOky
         dc6Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688171502; x=1690763502;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=LY4hOPffrE6QJlk2fTfa3K1ABHuOB1gwqTF+/zyLHhg=;
        b=E/r2X9avrOz3IlhwhdLmu5ka7Aw2lBOeB3mOVE4VW5fbfATOss52LmvicptQvPlnvu
         xgzeyDeFn1j8e+ZCP8T9OW9mJI7RUKDaz4mJxbzhQR+BvKZ2iNrav48hXser7mEp+G7G
         muNqctHG848ppXzmDC2iYZBcZNZIGbQ32roJgADjTQ346OJDc1A1qSazjSTr9IGpY17b
         1iIyXdypCBKthDZep/TbCuu7+GJqdRyT3jitArmxvardcpcv/924u8uw97kbda+FJbKa
         hX8Dj8QGvJTb/6mmVKo9FHB70VXjSDJc9XUeV0eVtsoWCKSLCdApyHoTmOSJcveQZBeu
         LZ/g==
X-Gm-Message-State: ABy/qLZqc92QOtS8lp4hyRmNHAUrr5Qcb02tyi0G97ZidaCZSiX+tzoY
	vqHYfxrSijHXVqRNhC+mp53RELO+EH8=
X-Google-Smtp-Source: APBJJlHv6bZX31TSR4MJuxlF3DUMJ4bn9ZYjcCQLZ2D5ZS486PyQXKZjkNmbioyxSSKZr5kp5fdsCA==
X-Received: by 2002:a05:6a00:24d3:b0:675:8f71:28f1 with SMTP id d19-20020a056a0024d300b006758f7128f1mr4321858pfv.30.1688171502138;
        Fri, 30 Jun 2023 17:31:42 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 02/11] x86 setup: per-arch bootmodule structure, headroom field
Date: Fri, 30 Jun 2023 17:31:23 -0700
Message-Id: <20230701003132.2210306-3-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
References: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Next step in incremental work towards adding a non-multiboot internal
representation of boot modules, converting the fields being accessed for
the startup calculations.

Add a new array of structs for per-boot-module state, though only
allocate space for a single array entry in this change since that is all
that is required for functionality modified in this patch: moving the
headroom field for the image decompression calculation into a new
per-arch boot module struct and then using it in x86 dom0 construction.

Introduces a per-arch header for x86 for arch-specific boot module
structures, and add a member to the common boot module structure for
access to it.

No functional change intended.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

changes since v1:
- patch is a subset of v1 patches 2 and 3
---
 xen/arch/x86/bzimage.c              | 10 +++++-----
 xen/arch/x86/hvm/dom0_build.c       |  3 ++-
 xen/arch/x86/include/asm/bootinfo.h | 18 ++++++++++++++++++
 xen/arch/x86/include/asm/bzimage.h  |  2 +-
 xen/arch/x86/pv/dom0_build.c        |  3 ++-
 xen/arch/x86/setup.c                | 23 ++++++++++++++++-------
 xen/include/xen/bootinfo.h          | 11 +++++++++++
 7 files changed, 55 insertions(+), 15 deletions(-)
 create mode 100644 xen/arch/x86/include/asm/bootinfo.h

diff --git a/xen/arch/x86/bzimage.c b/xen/arch/x86/bzimage.c
index ac4fd428be..dac2399b89 100644
--- a/xen/arch/x86/bzimage.c
+++ b/xen/arch/x86/bzimage.c
@@ -69,8 +69,6 @@ static __init int bzimage_check(struct setup_header *hdr, unsigned long len)
     return 1;
 }
 
-static unsigned long __initdata orig_image_len;
-
 unsigned long __init bzimage_headroom(void *image_start,
                                       unsigned long image_length)
 {
@@ -91,7 +89,6 @@ unsigned long __init bzimage_headroom(void *image_start,
     if ( elf_is_elfbinary(image_start, image_length) )
         return 0;
 
-    orig_image_len = image_length;
     headroom = output_length(image_start, image_length);
     if (gzip_check(image_start, image_length))
     {
@@ -105,11 +102,14 @@ unsigned long __init bzimage_headroom(void *image_start,
 }
 
 int __init bzimage_parse(void *image_base, void **image_start,
+                         unsigned int headroom,
                          unsigned long *image_len)
 {
     struct setup_header *hdr = (struct setup_header *)(*image_start);
     int err = bzimage_check(hdr, *image_len);
-    unsigned long output_len;
+    unsigned long output_len, orig_image_len;
+
+    orig_image_len = *image_len - headroom;
 
     if ( err < 0 )
         return err;
@@ -125,7 +125,7 @@ int __init bzimage_parse(void *image_base, void **image_start,
 
     BUG_ON(!(image_base < *image_start));
 
-    output_len = output_length(*image_start, orig_image_len);
+    output_len = output_length(*image_start, *image_len);
 
     if ( (err = perform_gunzip(image_base, *image_start, orig_image_len)) > 0 )
         err = decompress(*image_start, orig_image_len, image_base);
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index fd2cbf68bc..bf08998862 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -545,7 +545,8 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
     struct vcpu *v = d->vcpu[0];
     int rc;
 
-    if ( (rc = bzimage_parse(image_base, &image_start, &image_len)) != 0 )
+    if ( (rc = bzimage_parse(image_base, &image_start, image_headroom,
+                             &image_len)) != 0 )
     {
         printk("Error trying to detect bz compressed kernel\n");
         return rc;
diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
new file mode 100644
index 0000000000..a25054f372
--- /dev/null
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -0,0 +1,18 @@
+#ifndef __ARCH_X86_BOOTINFO_H__
+#define __ARCH_X86_BOOTINFO_H__
+
+struct arch_bootmodule {
+    unsigned headroom;
+};
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/include/asm/bzimage.h b/xen/arch/x86/include/asm/bzimage.h
index 7ed69d3910..dd784f32ef 100644
--- a/xen/arch/x86/include/asm/bzimage.h
+++ b/xen/arch/x86/include/asm/bzimage.h
@@ -5,7 +5,7 @@
 
 unsigned long bzimage_headroom(void *image_start, unsigned long image_length);
 
-int bzimage_parse(void *image_base, void **image_start,
+int bzimage_parse(void *image_base, void **image_start, unsigned int headroom,
                   unsigned long *image_len);
 
 #endif /* __X86_BZIMAGE_H__ */
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index c99135a552..6ed9f8bbed 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -416,7 +416,8 @@ int __init dom0_construct_pv(struct domain *d,
 
     d->max_pages = ~0U;
 
-    if ( (rc = bzimage_parse(image_base, &image_start, &image_len)) != 0 )
+    if ( (rc = bzimage_parse(image_base, &image_start, image_headroom,
+                             &image_len)) != 0 )
         return rc;
 
     if ( (rc = elf_init(&elf, image_start, image_len)) != 0 )
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 708639b236..c0e8fc6ab7 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -273,10 +273,16 @@ static struct boot_info __initdata *boot_info;
 
 static void __init multiboot_to_bootinfo(multiboot_info_t *mbi)
 {
-    static struct boot_info __initdata info;
+    static struct boot_info       __initdata info;
+    static struct boot_module     __initdata boot_mods[1];
+    static struct arch_bootmodule __initdata arch_boot_mods[1];
+
+    info.mods = boot_mods;
 
     info.nr_mods = mbi->mods_count;
 
+    boot_mods[0].arch = &arch_boot_mods[0];
+
     boot_info = &info;
 }
 
@@ -961,7 +967,8 @@ static struct domain *__init create_dom0(const module_t *image,
         write_cr4(read_cr4() & ~X86_CR4_SMAP);
     }
 
-    if ( construct_dom0(d, image, headroom, initrd, cmdline) != 0 )
+    if ( construct_dom0(d, image, boot_info->mods[0].arch->headroom, initrd,
+                        cmdline) != 0 )
         panic("Could not construct domain 0\n");
 
     if ( cpu_has_smap )
@@ -985,7 +992,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     unsigned int initrdidx, num_parked = 0;
     multiboot_info_t *mbi;
     module_t *mod;
-    unsigned long nr_pages, raw_max_page, modules_headroom, module_map[1];
+    unsigned long nr_pages, raw_max_page, module_map[1];
     int i, j, e820_warn = 0, bytes = 0;
     unsigned long eb_start, eb_end;
     bool acpi_boot_table_init_done = false, relocated = false;
@@ -1353,7 +1360,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         mod[boot_info->nr_mods].mod_end = __2M_rwdata_end - _stext;
     }
 
-    modules_headroom = bzimage_headroom(bootstrap_map(mod), mod->mod_end);
+    boot_info->mods[0].arch->headroom = bzimage_headroom(bootstrap_map(mod),
+                                                         mod->mod_end);
     bootstrap_map(NULL);
 
 #ifndef highmem_start
@@ -1433,7 +1441,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         /* Is the region suitable for relocating the multiboot modules? */
         for ( j = boot_info->nr_mods - 1; j >= 0; j-- )
         {
-            unsigned long headroom = j ? 0 : modules_headroom;
+            struct boot_module *boot_mods = boot_info->mods;
+            unsigned long headroom = j ? 0 : boot_mods[0].arch->headroom;
             unsigned long size = PAGE_ALIGN(headroom + mod[j].mod_end);
 
             if ( mod[j].reserved )
@@ -1481,7 +1490,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 #endif
     }
 
-    if ( modules_headroom && !mod->reserved )
+    if ( boot_info->mods[0].arch->headroom && !mod->reserved )
         panic("Not enough memory to relocate the dom0 kernel image\n");
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
@@ -2021,7 +2030,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
      * We're going to setup domain0 using the module(s) that we stashed safely
      * above our heap. The second module, if present, is an initrd ramdisk.
      */
-    dom0 = create_dom0(mod, modules_headroom,
+    dom0 = create_dom0(mod, boot_info->mods[0].arch->headroom,
                        initrdidx < boot_info->nr_mods ? mod + initrdidx : NULL,
                        kextra, loader);
     if ( !dom0 )
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
index 6a7d55d20e..b72ae31a66 100644
--- a/xen/include/xen/bootinfo.h
+++ b/xen/include/xen/bootinfo.h
@@ -3,8 +3,19 @@
 
 #include <xen/types.h>
 
+#ifdef CONFIG_X86
+#include <asm/bootinfo.h>
+#else
+    struct arch_bootmodule { };
+#endif
+
+struct boot_module {
+    struct arch_bootmodule *arch;
+};
+
 struct boot_info {
     unsigned int nr_mods;
+    struct boot_module *mods;
 };
 
 #endif
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 00:31:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 00:31:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557674.871288 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWp-0001aT-68; Sat, 01 Jul 2023 00:31:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557674.871288; Sat, 01 Jul 2023 00:31:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWo-0001Yr-RA; Sat, 01 Jul 2023 00:31:54 +0000
Received: by outflank-mailman (input) for mailman id 557674;
 Sat, 01 Jul 2023 00:31:53 +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
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFOWn-0007yM-5t
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 00:31:53 +0000
Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com
 [2607:f8b0:4864:20::b34])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id abc9c57b-17a6-11ee-8611-37d641c3527e;
 Sat, 01 Jul 2023 02:31:51 +0200 (CEST)
Received: by mail-yb1-xb34.google.com with SMTP id
 3f1490d57ef6-c2cf4e61bc6so2479592276.3
 for <xen-devel@lists.xenproject.org>; Fri, 30 Jun 2023 17:31:51 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s68-20020a632c47000000b0055b61cd99a1sm1824296pgs.81.2023.06.30.17.31.48
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Jun 2023 17:31:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: abc9c57b-17a6-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688171510; x=1690763510;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=goxmEkry0U1HLmMVQmvP8Gde9Okz3AzqGSy+FqLUKTI=;
        b=RlFU8aKTsmTkSL803ovUEfnOumnnC/JpNxk55d3A7YSbtFDeqvpjZ6/eL3TunyDqWh
         zaWgXHHrtXf8xX0sgRwwabeQE86Cm9/vsUzKHuqIQ/XbSMJRM2zm/aSRzGCL/Qz54s12
         bkP/KZqdfw8A7X9ZEQyg6pf90WWkKh3x1f89t7X/jio6qN17ae7jXrFtJYnGzvaEgzut
         B9zrWTvWQYTmA8r23TnpcqdP7KjWBrVOAwyjMRDIw0XruQen8xsrU/HRQt2WoN2QN4/P
         zGdzzWbBLixZFiF19BmePZ3k55LeGaLKxtAr3d8EjmWqAPSZSIXnotYHZsgOc/94ocNl
         1igg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688171510; x=1690763510;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=goxmEkry0U1HLmMVQmvP8Gde9Okz3AzqGSy+FqLUKTI=;
        b=VfHNBX/5Ahf/xpFhLFcUItScY4OaFWNI9I1W7tRaF7S9ugIAZvk1L7P36L0PridW9G
         XhOGxNrqwmev6pjJoiQTsrb0c7MvT1QLtprsDZqmbHEPfomevyJkvkObXy4QtZBZ7s6w
         qM7RC+3TDcSkzaTu3SuIDSzEiNxblgDu3Hfzsn7FdN4Dt4fS+ZCMxR4rUUA/hnV6k8Cq
         obRXYSwrlFo1C3CeXNpSnH+vHBQDcoA923KrTFovqr9lwHoxQpeODSkr+zm1jsfzFChG
         L1rMeiJd1+sTxIVnR5psQwu0j3xaMreRRdk+ojGLs8+YnnFvSYHPGO/eqLBplHAFmJ0H
         rNGQ==
X-Gm-Message-State: ABy/qLYRi9b026y8iWCQPKiYlF7HgRoQH9miSGZwQQoEYQIMQRviKgW0
	5VoI+iOWRbhvjW+XN9nthYDMJQuzyr8=
X-Google-Smtp-Source: APBJJlEARNWgLjZpa74rQHLaxgPV1NZ3cvoIaJB/ZTsURcawLd8v/B1Kpv9K2P83VDZePWvxDNRJ0w==
X-Received: by 2002:a25:cb4e:0:b0:c1e:a1b8:1667 with SMTP id b75-20020a25cb4e000000b00c1ea1b81667mr4227415ybg.22.1688171509994;
        Fri, 30 Jun 2023 17:31:49 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 08/11] types, x86 boot: define DEFINE_PTR_TYPE and char_ptr_t
Date: Fri, 30 Jun 2023 17:31:29 -0700
Message-Id: <20230701003132.2210306-9-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
References: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Pointer fields within structs need to be defined as fixed size types in
the x86 boot build environment. Using a typedef for the field type
enables the definition to be changed in the 32-bit boot build and
the main hypervisor build, allowing for a single common structure
definition and a common header file.

Add a macro for defining pointer types for fields and use this macro for
pointers to chars in <xen/bootinfo.h> and <asm/bootinfo.h> as
preparation for using these headers in the x86 boot build.

The 32-bit behaviour is obtained by inclusion of "defs.h" first with a
check for such an existing definition on the <xen/types.h> version.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

New in v2
---
 xen/arch/x86/boot/defs.h            | 4 ++++
 xen/arch/x86/include/asm/bootinfo.h | 2 +-
 xen/include/xen/bootinfo.h          | 2 +-
 xen/include/xen/types.h             | 6 ++++++
 4 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/boot/defs.h b/xen/arch/x86/boot/defs.h
index 867df6d18d..bc0f1b5cf8 100644
--- a/xen/arch/x86/boot/defs.h
+++ b/xen/arch/x86/boot/defs.h
@@ -65,4 +65,8 @@ typedef unsigned long long paddr_t;
 #define DEFINE_STRUCT_PTR_TYPE(struct_name) \
     typedef uint64_t struct_name ## _ptr_t;
 
+#define DEFINE_PTR_TYPE(type) \
+    typedef uint64_t type ## _ptr_t;
+DEFINE_PTR_TYPE(char);
+
 #endif /* __BOOT_DEFS_H__ */
diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index 8d1261503d..989fb7a1da 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -15,7 +15,7 @@ struct arch_boot_info {
 #define BOOTINFO_FLAG_X86_MEMMAP       1U << 6
 #define BOOTINFO_FLAG_X86_LOADERNAME   1U << 9
 
-    char *boot_loader_name;
+    char_ptr_t boot_loader_name;
 
     uint32_t mmap_length;
     paddr_t mmap_addr;
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
index 8ee3ee36e9..8389da4f72 100644
--- a/xen/include/xen/bootinfo.h
+++ b/xen/include/xen/bootinfo.h
@@ -41,7 +41,7 @@ struct boot_module {
 DEFINE_STRUCT_PTR_TYPE(boot_module);
 
 struct boot_info {
-    char *cmdline;
+    char_ptr_t cmdline;
 
     unsigned int nr_mods;
     boot_module_ptr_t mods;
diff --git a/xen/include/xen/types.h b/xen/include/xen/types.h
index 78a2079619..e807ffe255 100644
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -76,4 +76,10 @@ typedef bool bool_t;
     typedef struct struct_name * struct_name ## _ptr_t;
 #endif
 
+#ifndef DEFINE_PTR_TYPE
+#define DEFINE_PTR_TYPE(type) \
+    typedef type * type ## _ptr_t;
+DEFINE_PTR_TYPE(char);
+#endif
+
 #endif /* __TYPES_H__ */
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 00:31:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 00:31:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557665.871207 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWg-0007yU-4S; Sat, 01 Jul 2023 00:31:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557665.871207; Sat, 01 Jul 2023 00:31:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWg-0007yN-1s; Sat, 01 Jul 2023 00:31:46 +0000
Received: by outflank-mailman (input) for mailman id 557665;
 Sat, 01 Jul 2023 00:31:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFOWd-0007yB-Vc
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 00:31:44 +0000
Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com
 [2607:f8b0:4864:20::529])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a5e7dadd-17a6-11ee-b237-6b7b168915f2;
 Sat, 01 Jul 2023 02:31:42 +0200 (CEST)
Received: by mail-pg1-x529.google.com with SMTP id
 41be03b00d2f7-517ab9a4a13so1609285a12.1
 for <xen-devel@lists.xenproject.org>; Fri, 30 Jun 2023 17:31:41 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s68-20020a632c47000000b0055b61cd99a1sm1824296pgs.81.2023.06.30.17.31.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Jun 2023 17:31:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: a5e7dadd-17a6-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688171500; x=1690763500;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:sender:from:to:cc:subject:date:message-id:reply-to;
        bh=0KShfPa2MYNDYvy3QcwTC4m5i40zpzbfd6OhegXALTA=;
        b=SYVViW8Kq3XV7ttdG4YkvMDrD04h3WC6+r/LzrevHdjm7LO/JG32gqJcpagAraFkJf
         MAFA0kBDqNk7ySD9J5b6D+8K5Arg4F+ITABIIG9UTx3GK7/3sigm6NSW3Op8pHvMqGL1
         vGG91YEVhXngmP57SYfov06GZn+BeE0C5aJOs1XuRaa6BWDI7ygOg6QFLBPkgWAH6xFe
         JpmTRkZ4ZkdoVjeMHXr8orfmloLFvMgD/UuoDuS+i/Pbw49mjmhIv2mMLFoY6P8XuIwG
         qzJLTHljPmyFsMRJ5l96K5YSVjUvfNTBszd/WAyds5XTOEcp+Y+kcVx7aid7aS7SQt8V
         dVrw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688171500; x=1690763500;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:sender:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=0KShfPa2MYNDYvy3QcwTC4m5i40zpzbfd6OhegXALTA=;
        b=XTONTon8ZoQFAoP8iUlvmOmPJMWnvjESbdUoW3kH7FNdXtToU1EBqz8B1p5FSmL7Vk
         +q2GLrCa5A0FuA/IgognpW0lMXyxdHEQFVaY2S8bU6f6xjDAoRFCRkeCPYSCOH4g1xxR
         w867jlB4u0KSjYJm4QoBij6OErbqlJn0WgzVF3lsHttLW1QOecVxODQbSa1Wt4Wdv8AR
         4sjxkw2USByEaeGdjtVbNFs4qivHic6fKq8rl3WEoRBWW9oPgC1Gca26hTjENH+kMGBJ
         M7Y8zD705qjWC9geg63taB7fqa6pyL8CiJwHu8vw1rBq7TavI1G5AoYQIRWoMqEGGAyS
         z34g==
X-Gm-Message-State: AC+VfDzJH1Br7CW1fuh4QFuwDCD7jVfqqBP7FZ7BYPRWmYqKM8BapjDv
	yZHuk+8HZesMfy4lY3Ipg8hKDp61JHg=
X-Google-Smtp-Source: ACHHUZ7Li8ezhJYAShh3/ZzQAdyQzMjFylf+La4WOAedx9NLRQbBjdH20CpyW9vn7ElsAgYNwzV3uA==
X-Received: by 2002:a05:6a20:9719:b0:122:7e90:61c2 with SMTP id hr25-20020a056a20971900b001227e9061c2mr4071641pzc.9.1688171499907;
        Fri, 30 Jun 2023 17:31:39 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 00/11] v2: Boot modules for Hyperlaunch
Date: Fri, 30 Jun 2023 17:31:21 -0700
Message-Id: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This is a v2 series of work for Hyperlaunch for the Xen hypervisor,
implementing a subset of the v1 series and functionality, with changes
made to address the community feedback provided on the patches in v1.

The patches in this series are primarily derived from patches 2-4 of the
v1 full series, in a series of smaller patches for ease of review.

Thanks to AMD for supporting this work.

Documentation on Hyperlaunch:
https://wiki.xenproject.org/wiki/Hyperlaunch

v1 Hyperlaunch patch series:
https://lists.xenproject.org/archives/html/xen-devel/2022-07/msg00345.html

thanks

Christopher

Christopher Clark (11):
  x86 setup: move x86 boot module counting into a new boot_info struct
  x86 setup: per-arch bootmodule structure, headroom field
  x86 setup: change bootstrap map to accept new boot module structures
  x86 setup: porting dom0 construction logic to boot module structures
  xsm: switch XSM init to boot info structures
  x86 setup, microcode: switch to the new bootinfo structures
  x86 boot: define paddr_t and add macros for typedefing struct pointers
  types, x86 boot: define DEFINE_PTR_TYPE and char_ptr_t
  x86, arm, riscv: add per-arch bootinfo headers to allow x86 boot
    include
  arm setup: include <xen/bootinfo> for bootmod defns, replacing enum
  x86 setup: refactor entrypoints to new boot info

 xen/arch/arm/efi/efi-boot.h               |   6 +
 xen/arch/arm/include/asm/bootinfo.h       |  20 ++
 xen/arch/arm/include/asm/setup.h          |  11 +-
 xen/arch/riscv/include/asm/bootinfo.h     |  20 ++
 xen/arch/x86/boot/defs.h                  |  10 +
 xen/arch/x86/boot/reloc.c                 | 192 ++++++++++++------
 xen/arch/x86/bzimage.c                    |  10 +-
 xen/arch/x86/cpu/microcode/core.c         | 149 ++++++++------
 xen/arch/x86/dom0_build.c                 |  10 +-
 xen/arch/x86/efi/efi-boot.h               |  95 +++++----
 xen/arch/x86/guest/xen/pvh-boot.c         |  65 ++++--
 xen/arch/x86/hvm/dom0_build.c             |  44 ++--
 xen/arch/x86/include/asm/boot.h           |  55 +++++
 xen/arch/x86/include/asm/bootinfo.h       |  47 +++++
 xen/arch/x86/include/asm/bzimage.h        |   2 +-
 xen/arch/x86/include/asm/dom0_build.h     |  13 +-
 xen/arch/x86/include/asm/guest/pvh-boot.h |   6 +-
 xen/arch/x86/include/asm/microcode.h      |   7 +-
 xen/arch/x86/include/asm/setup.h          |   7 +-
 xen/arch/x86/pv/dom0_build.c              |  32 +--
 xen/arch/x86/setup.c                      | 232 ++++++++++++----------
 xen/common/efi/boot.c                     |   4 +-
 xen/include/xen/bootinfo.h                |  62 ++++++
 xen/include/xen/types.h                   |  11 +
 xen/include/xsm/xsm.h                     |  28 +--
 xen/xsm/xsm_core.c                        |  47 +++--
 xen/xsm/xsm_policy.c                      |  58 +++---
 27 files changed, 821 insertions(+), 422 deletions(-)
 create mode 100644 xen/arch/arm/include/asm/bootinfo.h
 create mode 100644 xen/arch/riscv/include/asm/bootinfo.h
 create mode 100644 xen/arch/x86/include/asm/boot.h
 create mode 100644 xen/arch/x86/include/asm/bootinfo.h
 create mode 100644 xen/include/xen/bootinfo.h

-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 00:31:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 00:31:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557675.871293 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWp-0001jL-QV; Sat, 01 Jul 2023 00:31:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557675.871293; Sat, 01 Jul 2023 00:31:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWp-0001hu-Kk; Sat, 01 Jul 2023 00:31:55 +0000
Received: by outflank-mailman (input) for mailman id 557675;
 Sat, 01 Jul 2023 00:31:54 +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
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFOWo-0007yM-Lf
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 00:31:54 +0000
Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com
 [2607:f8b0:4864:20::1032])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ac76a5b0-17a6-11ee-8611-37d641c3527e;
 Sat, 01 Jul 2023 02:31:53 +0200 (CEST)
Received: by mail-pj1-x1032.google.com with SMTP id
 98e67ed59e1d1-262e3c597b9so1620980a91.0
 for <xen-devel@lists.xenproject.org>; Fri, 30 Jun 2023 17:31:52 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s68-20020a632c47000000b0055b61cd99a1sm1824296pgs.81.2023.06.30.17.31.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Jun 2023 17:31:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: ac76a5b0-17a6-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688171511; x=1690763511;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=CmW5UL4mCfeFM30iYwmo6ORQbNbEDrG26I97OFcvUzw=;
        b=mDKgu0N+J33pO8y0qR4pSU8R7axaOqaVgxvtdIbHJ/u5JctG4BQbpTI1b8p0w6bMxj
         vBWwRDK2eoOR5P9dkryVjt5TX0WBEPhbhga2jxGg5Vb61RbW9ZtEutPIhi/rZtxxBsR0
         4F8CEALSdMAiVUH7yX86MmPiH0ejByPiN5EDvdXMaR1DMEimhq7JT6vRvgTqUsL0cKUA
         vqUeyprCLh7K6Op05ef3VP0rWttXdevLjPaXqhhpPmeeJcaiY+GPx1vML2mt3/G5IcyM
         jtiWQEJFHX+gk4Id3se+AhfCekKQavsgUuRccMqLcTFrqcPs4SUl7LvaQHGFOEZYe+o0
         Xv7Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688171511; x=1690763511;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=CmW5UL4mCfeFM30iYwmo6ORQbNbEDrG26I97OFcvUzw=;
        b=dJYjYyFU1zKU79X4H1VUfv/78iWDGlpP22nyiB51VNVrLFGYb4OfB32ws7wAQpl1hF
         nH30KzAsEiM68Wy1G1O+gLcIBMMz+Pj9A2uVYyaTDZeRNSjvbONzRB0ecba0k24B8CH+
         /94dJhr7QlSDaecJsfUcKlKLEWPno6FwhJC59ySfjahmuOecVUQ2YjtGs02Zbc91A1ti
         Rc2U3zHJITVTkMCe7sS2UqLJawagpqqegaZ9aKrbu3KDKjWyEjRBdAPncCspz+FGjugL
         gWhehBNQy2jK+Zaz31SZIodqxB0RoEuz9PvvQlSVM9S7lfCpo8anJrPxc5Loa1r9+ukN
         pZEA==
X-Gm-Message-State: ABy/qLYG9wtwcn6sUvSNp3RnXiXciJQduXNhKU7nDwn0iXSkuyq4Qlma
	DRZP4zqn9xaV5TJoje/uu1SPpcn+1tg=
X-Google-Smtp-Source: APBJJlGMLddV7br5bz18vAf2YOGfu1jHgiMmcg8DV5OkPbHOCTMCceaaVMmcoUwcBKrRC46JWnECog==
X-Received: by 2002:a17:90a:f00c:b0:262:c9f4:141 with SMTP id bt12-20020a17090af00c00b00262c9f40141mr3264484pjb.42.1688171510911;
        Fri, 30 Jun 2023 17:31:50 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 09/11] x86, arm, riscv: add per-arch bootinfo headers to allow x86 boot include
Date: Fri, 30 Jun 2023 17:31:30 -0700
Message-Id: <20230701003132.2210306-10-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
References: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The <xen/bootinfo.h> header contains structures that will be used in efi
logic prior to the main start of Xen, so will soon be included in Arm
builds. This same header will also used in early x86 boot, where asm/*
headers are not reachable and yet it contains a needed include of
<asm/bootinfo.h>, so...

Add initial per-arch <asm/bootinfo.h> headers to Arm and RISC-V so that
inclusion of <asm/bootinfo.h> succeeds in each main arch build and then
gate that inclusion from <xen/bootinfo.h> on CONFIG variables so that it
does not take effect in the early x86 boot build where CONFIG_X86 is not
defined to prevent build failure there. The early x86 boot logic can
then directly include asm/bootinfo.h via a specified directory path to
bring in the necessary definitions.

Is this fantastic? No. Does it help? Yep.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

New for v2 series.
---
 xen/arch/arm/include/asm/bootinfo.h   | 20 ++++++++++++++++++++
 xen/arch/riscv/include/asm/bootinfo.h | 20 ++++++++++++++++++++
 xen/include/xen/bootinfo.h            |  7 ++-----
 3 files changed, 42 insertions(+), 5 deletions(-)
 create mode 100644 xen/arch/arm/include/asm/bootinfo.h
 create mode 100644 xen/arch/riscv/include/asm/bootinfo.h

diff --git a/xen/arch/arm/include/asm/bootinfo.h b/xen/arch/arm/include/asm/bootinfo.h
new file mode 100644
index 0000000000..5316c87a3d
--- /dev/null
+++ b/xen/arch/arm/include/asm/bootinfo.h
@@ -0,0 +1,20 @@
+#ifndef __ARCH_ARM_BOOTINFO_H__
+#define __ARCH_ARM_BOOTINFO_H__
+
+struct __packed arch_bootmodule { };
+DEFINE_STRUCT_PTR_TYPE(arch_bootmodule);
+
+struct __packed arch_boot_info { };
+DEFINE_STRUCT_PTR_TYPE(arch_boot_info);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/riscv/include/asm/bootinfo.h b/xen/arch/riscv/include/asm/bootinfo.h
new file mode 100644
index 0000000000..5316c87a3d
--- /dev/null
+++ b/xen/arch/riscv/include/asm/bootinfo.h
@@ -0,0 +1,20 @@
+#ifndef __ARCH_ARM_BOOTINFO_H__
+#define __ARCH_ARM_BOOTINFO_H__
+
+struct __packed arch_bootmodule { };
+DEFINE_STRUCT_PTR_TYPE(arch_bootmodule);
+
+struct __packed arch_boot_info { };
+DEFINE_STRUCT_PTR_TYPE(arch_boot_info);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
index 8389da4f72..bf5586a76b 100644
--- a/xen/include/xen/bootinfo.h
+++ b/xen/include/xen/bootinfo.h
@@ -5,11 +5,8 @@
 #include <xen/compiler.h>
 #include <xen/mm-frame.h>
 
-#ifdef CONFIG_X86
-#include <asm/bootinfo.h>
-#else
-    struct arch_bootmodule { };
-    struct arch_boot_info { };
+#if defined CONFIG_X86 || CONFIG_ARM || CONFIG_RISCV
+# include <asm/bootinfo.h>
 #endif
 
 /* Boot module binary type / purpose */
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 00:31:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 00:31:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557676.871305 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWr-00029E-B3; Sat, 01 Jul 2023 00:31:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557676.871305; Sat, 01 Jul 2023 00:31:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWr-000285-2V; Sat, 01 Jul 2023 00:31:57 +0000
Received: by outflank-mailman (input) for mailman id 557676;
 Sat, 01 Jul 2023 00:31:55 +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
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFOWp-0007yM-98
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 00:31:55 +0000
Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com
 [2607:f8b0:4864:20::32f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id acfe17ca-17a6-11ee-8611-37d641c3527e;
 Sat, 01 Jul 2023 02:31:53 +0200 (CEST)
Received: by mail-ot1-x32f.google.com with SMTP id
 46e09a7af769-6b886456f66so1790531a34.0
 for <xen-devel@lists.xenproject.org>; Fri, 30 Jun 2023 17:31:53 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s68-20020a632c47000000b0055b61cd99a1sm1824296pgs.81.2023.06.30.17.31.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Jun 2023 17:31:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: acfe17ca-17a6-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688171512; x=1690763512;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=eobWsLudL6LP1s0XBewioDQ6KL/Td7X9osJXVUd2EmM=;
        b=pf3RZgrNX5scU+U3lhARSed2bh0CIo65idYmRx10QaH4gLLS1AJULsKiycGFXhiGfl
         NR2ogZiVsBDBGt3Al4XEWq65oaE/xBuon/T1vnxmR1vInlsO18XF1426wwxJRTyvC6vt
         wdE3IMbxClp05AKOlX+gLsnb7A713aLkJC9XmSVGbvXPTKXgerTwQunxPbT1rPpQ4uCI
         gf5iY0TjNrztpZ2Z0uATKtn9OOm+nvGbf4bF3r6a5aBLAt/a5plRrriYkQFO/Lyde2aE
         gEdgnFYryrGJuCLoDhzliHOQOeL0lt21t2AgiOHS1B7cc3hcZwsTWCzhTtZCG2RfXYba
         P8Yw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688171512; x=1690763512;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=eobWsLudL6LP1s0XBewioDQ6KL/Td7X9osJXVUd2EmM=;
        b=cnwYgqDUuvFUBdbso+NhkQZ516fNARucsuZOJ0WsjMgo7Vqk7iRpS0cmbM4Uf3pA0i
         mvb9RN/zhVRFk42VRtvaF7MbjigCPBW4gTh1wx2Zx5z2n/AdTLfHfsx/yCPwymWsVTUa
         VfKmHj80saEV7tpnap13Y5XkXHc8Q8sf+fZAdGilCExZdhZ0m3cdBcJHuxn/axxTxecP
         JUQr5ziFy7EazWIdB3t4XSm8jltBv6qWGMBu4QyOnrL9KoRoGkQSYl6pys9WB6GVt0bQ
         Q6/zA7lRCrm6qbOcA4odpWyTDa3DKmNFw1f4Y+lL2vjEXDX5ujSfxNFDMZD3lTy6oa4E
         9Cjg==
X-Gm-Message-State: AC+VfDzYMHzhSPSSU1lM/6yIC8UtTGVGKRhpSwJ5QuJRwgv27aACBusr
	AhG7AgGHresco+B6e/kXXhFchdZA9/c=
X-Google-Smtp-Source: ACHHUZ4Aj8NvkVJllvxkQKfVm9FJZ4c/6HPUItf+wawkjEKnebTGZb1aBVz7wrUVpJI/QgyMqF2BdQ==
X-Received: by 2002:a05:6830:1104:b0:6b8:7db6:9ab5 with SMTP id w4-20020a056830110400b006b87db69ab5mr4305120otq.12.1688171512057;
        Fri, 30 Jun 2023 17:31:52 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 10/11] arm setup: include <xen/bootinfo> for bootmod defns, replacing enum
Date: Fri, 30 Jun 2023 17:31:31 -0700
Message-Id: <20230701003132.2210306-11-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
References: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This change enables and begins introducion of <xen/bootinfo.h> into
Arm builds: it replace the enum definition of bootmodule_kind with
bootmod_type_t which is a fixed size type as needed for packed structs,
to be used in the boot structures in subsequent changes.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

New for v2 series.
---
 xen/arch/arm/include/asm/setup.h | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index 38e2ce255f..ce3882ca67 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -3,6 +3,7 @@
 
 #include <public/version.h>
 #include <asm/p2m.h>
+#include <xen/bootinfo.h>
 #include <xen/device_tree.h>
 
 #define MIN_FDT_ALIGN 8
@@ -12,15 +13,7 @@
 
 #define MAX_MODULES 32 /* Current maximum useful modules */
 
-typedef enum {
-    BOOTMOD_XEN,
-    BOOTMOD_FDT,
-    BOOTMOD_KERNEL,
-    BOOTMOD_RAMDISK,
-    BOOTMOD_XSM,
-    BOOTMOD_GUEST_DTB,
-    BOOTMOD_UNKNOWN
-}  bootmodule_kind;
+typedef bootmod_type_t bootmodule_kind;
 
 enum membank_type {
     /*
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 00:31:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 00:31:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557678.871317 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWs-0002Wh-TI; Sat, 01 Jul 2023 00:31:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557678.871317; Sat, 01 Jul 2023 00:31:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFOWs-0002W6-LQ; Sat, 01 Jul 2023 00:31:58 +0000
Received: by outflank-mailman (input) for mailman id 557678;
 Sat, 01 Jul 2023 00:31:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFOWq-0007yB-PN
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 00:31:57 +0000
Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com
 [2607:f8b0:4864:20::c32])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id adc67b96-17a6-11ee-b237-6b7b168915f2;
 Sat, 01 Jul 2023 02:31:55 +0200 (CEST)
Received: by mail-oo1-xc32.google.com with SMTP id
 006d021491bc7-5634db21a58so1666089eaf.0
 for <xen-devel@lists.xenproject.org>; Fri, 30 Jun 2023 17:31:54 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s68-20020a632c47000000b0055b61cd99a1sm1824296pgs.81.2023.06.30.17.31.52
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Jun 2023 17:31:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: adc67b96-17a6-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688171513; x=1690763513;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Lc4F58lZGArBW0YBbdm+a1mT2bCVXrWRmAPLEIHYE0U=;
        b=RH+jyvfx1XbiemxdH/8VzA6hoZYenfI0d8V09JZi98CP5PRtk4Vj1NX56nlOtabZaT
         ds0grTQkfIB/03q3iC4bW94Qs0s6wmIMtlAMJwi5fM2LXo6an55PnNKhb4DWSwooZ0ZQ
         ofDBUAhUGcW+xOowTswUKS7m88zIaqHBNnUnymOKXKXLxNltVRZ/2ftuGAZYIXseBtDx
         DyErGYzNb2pFb8jf5dwCQEXOsTw2UmyWsHJxA8grvlcXdTefUiNX49sIqiiZvs1OVSv7
         ub6MDDCvnNS1XGFPLukt8UYbIR1bgceZEaf6L9piJyRry+EIY6S5pqoJml1lAXppVZFE
         PvfQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688171513; x=1690763513;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=Lc4F58lZGArBW0YBbdm+a1mT2bCVXrWRmAPLEIHYE0U=;
        b=GYVKRAQcw/kLcRIpcP2jNVeFfrz6XOhVycosOSLU9bI1k6eY2Mgtklj3m4e1KLvJDp
         CTKQN3sVAf5LSGyI5kFWO0pGtwoZUo6WJEsZh8AvIalRDE1vV1GsaJU6pHTbpGU0zAen
         xx84bmvVWy51tYJaR1FBUdVzc8CzkkeQ99oT5lpPo6GOshE9icc0DzAN717yFUny+Fa0
         rNraGbdOQkXaMn+GEZnCY2D1ZY8WqxMm+/5F4p8o1M678IDkpXfNOdi1WYyzbrsV0Z7n
         xc2xjZzmRbpdabORdCb90+4+kRD7vVzIMLubluAp6dESgLi0lPBByn1Lnfk39XpqqMDn
         Yi0Q==
X-Gm-Message-State: AC+VfDyw5nN9f/Z8Crs6ROMcQNnopdglpQJRexYIPD9JjDlD8H137y2v
	XudzlBenZ9/L5tIBxjBZgjvOsadmD04=
X-Google-Smtp-Source: ACHHUZ4OyiOTJ7Y+BDtup3FLBUjhuwwXpv7JZBUCRgYkED6g1b1biZAa7cJMMUNZs36CyoB5weiuWw==
X-Received: by 2002:a05:6808:8c8:b0:3a1:ead3:bf20 with SMTP id k8-20020a05680808c800b003a1ead3bf20mr3981522oij.33.1688171513115;
        Fri, 30 Jun 2023 17:31:53 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 11/11] x86 setup: refactor entrypoints to new boot info
Date: Fri, 30 Jun 2023 17:31:32 -0700
Message-Id: <20230701003132.2210306-12-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
References: <20230701003132.2210306-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Previous commits added a transition point from multiboot v1 structures
to the new boot info structures at the earliest common point for all the
x86 entrypoints. The result is that each of the entrypoints would
construct a multiboot v1 structure from the structures used by each
entrypoint. Â This meant that multiboot2, EFI, and PVH all converted
their structures over to mutliboot v1 to only be converted again upon
entering __start_xen().

This commit drops the translation function and moves the population of
the new boot info structures down into the various entrypoints.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

changes since v1:
- based on v1 series patch 4
- use main bootinfo headers in boot logic instead of adding a 32-bit version
- apply packing to boot structures here rather than in earlier changes
- use a defined maximum rather than Kconfig'd variable
---
 xen/arch/arm/efi/efi-boot.h               |   6 +
 xen/arch/x86/boot/defs.h                  |   1 +
 xen/arch/x86/boot/reloc.c                 | 192 +++++++++++++++-------
 xen/arch/x86/efi/efi-boot.h               |  95 ++++++-----
 xen/arch/x86/guest/xen/pvh-boot.c         |  64 +++++---
 xen/arch/x86/include/asm/bootinfo.h       |   7 +-
 xen/arch/x86/include/asm/guest/pvh-boot.h |   6 +-
 xen/arch/x86/setup.c                      |  73 +++-----
 xen/common/efi/boot.c                     |   4 +-
 xen/include/xen/bootinfo.h                |   9 +-
 10 files changed, 278 insertions(+), 179 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index bb64925d70..d931fe06ed 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -1003,6 +1003,12 @@ static void __init efi_arch_flush_dcache_area(const void *vaddr, UINTN size)
     __flush_dcache_area(vaddr, size);
 }
 
+static struct boot_info __init *efi_arch_bootinfo_init(void)
+{
+    /* boot modules not currently in use on Arm so no init required here */
+    return NULL;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/x86/boot/defs.h b/xen/arch/x86/boot/defs.h
index bc0f1b5cf8..519ca4dae6 100644
--- a/xen/arch/x86/boot/defs.h
+++ b/xen/arch/x86/boot/defs.h
@@ -44,6 +44,7 @@
         _x > _y ? _x : _y; })
 
 #define _p(val)		((void *)(unsigned long)(val))
+#define _addr(val)  ((unsigned long)(void *)(val))
 
 #define tolower(c)	((c) | 0x20)
 
diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c
index e22bb974bf..8a48572d5f 100644
--- a/xen/arch/x86/boot/reloc.c
+++ b/xen/arch/x86/boot/reloc.c
@@ -27,6 +27,8 @@ asm (
     );
 
 #include "defs.h"
+#include "../include/asm/bootinfo.h"
+#include "../../../include/xen/bootinfo.h"
 #include "../../../include/xen/multiboot.h"
 #include "../../../include/xen/multiboot2.h"
 
@@ -138,65 +140,116 @@ static struct hvm_start_info *pvh_info_reloc(u32 in)
     return out;
 }
 
-static multiboot_info_t *mbi_reloc(u32 mbi_in)
+static struct boot_info *mbi_reloc(u32 mbi_in)
 {
+    const multiboot_info_t *mbi = _p(mbi_in);
+    struct boot_info *binfo;
+    struct arch_boot_info *arch_binfo;
     int i;
-    multiboot_info_t *mbi_out;
+    uint32_t ptr;
 
-    mbi_out = _p(copy_mem(mbi_in, sizeof(*mbi_out)));
+    ptr = alloc_mem(sizeof(*binfo));
+    zero_mem(ptr, sizeof(*binfo));
+    binfo = _p(ptr);
 
-    if ( mbi_out->flags & MBI_CMDLINE )
-        mbi_out->cmdline = copy_string(mbi_out->cmdline);
+    ptr = alloc_mem(sizeof(*arch_binfo));
+    zero_mem(ptr, sizeof(*arch_binfo));
+    binfo->arch = ptr;
+    arch_binfo = _p(ptr);
 
-    if ( mbi_out->flags & MBI_MODULES )
+    if ( mbi->flags & MBI_CMDLINE )
+    {
+        ptr = copy_string(mbi->cmdline);
+        binfo->cmdline = ptr;
+        arch_binfo->flags |= BOOTINFO_FLAG_X86_CMDLINE;
+    }
+
+    if ( mbi->flags & MBI_MODULES )
     {
         module_t *mods;
+        struct boot_module *bi_mods;
+        struct arch_bootmodule *arch_bi_mods;
+
+        /*
+         * We have to allocate one more module slot here. At some point
+         * __start_xen() may put Xen image placement into it.
+         */
+        ptr = alloc_mem((mbi->mods_count + 1) * sizeof(*bi_mods));
+        binfo->nr_mods = mbi->mods_count;
+        binfo->mods = ptr;
+        bi_mods = _p(ptr);
 
-        mbi_out->mods_addr = copy_mem(mbi_out->mods_addr,
-                                      mbi_out->mods_count * sizeof(module_t));
+        ptr = alloc_mem((mbi->mods_count + 1) * sizeof(*arch_bi_mods));
+        arch_bi_mods = _p(ptr);
 
-        mods = _p(mbi_out->mods_addr);
+        /* map the +1 allocated for Xen image */
+        bi_mods[mbi->mods_count].arch = _addr(&arch_bi_mods[mbi->mods_count]);
 
-        for ( i = 0; i < mbi_out->mods_count; i++ )
+        arch_binfo->flags |= BOOTINFO_FLAG_X86_MODULES;
+
+        mods = _p(mbi->mods_addr);
+
+        for ( i = 0; i < mbi->mods_count; i++ )
         {
+            bi_mods[i].start = mods[i].mod_start;
+            bi_mods[i].size = mods[i].mod_end - mods[i].mod_start;
+
             if ( mods[i].string )
-                mods[i].string = copy_string(mods[i].string);
+            {
+                int j;
+                char *c = _p(mods[i].string);
+
+                for ( j = 0; *c != '\0'; j++, c++ )
+                    bi_mods[i].string.bytes[j] = *c;
+
+                bi_mods[i].string.len = j + 1;
+            }
+
+            bi_mods[i].arch = _addr(&arch_bi_mods[i]);
         }
     }
 
-    if ( mbi_out->flags & MBI_MEMMAP )
-        mbi_out->mmap_addr = copy_mem(mbi_out->mmap_addr, mbi_out->mmap_length);
-
-    if ( mbi_out->flags & MBI_LOADERNAME )
-        mbi_out->boot_loader_name = copy_string(mbi_out->boot_loader_name);
+    if ( mbi->flags & MBI_MEMMAP )
+    {
+        arch_binfo->mmap_addr = copy_mem(mbi->mmap_addr, mbi->mmap_length);
+        arch_binfo->mmap_length = mbi->mmap_length;
+        arch_binfo->flags |= BOOTINFO_FLAG_X86_MEMMAP;
+    }
 
-    /* Mask features we don't understand or don't relocate. */
-    mbi_out->flags &= (MBI_MEMLIMITS |
-                       MBI_CMDLINE |
-                       MBI_MODULES |
-                       MBI_MEMMAP |
-                       MBI_LOADERNAME);
+    if ( mbi->flags & MBI_LOADERNAME )
+    {
+        ptr = copy_string(mbi->boot_loader_name);
+        arch_binfo->boot_loader_name = ptr;
+        arch_binfo->flags |= BOOTINFO_FLAG_X86_LOADERNAME;
+    }
 
-    return mbi_out;
+    return binfo;
 }
 
-static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, uint32_t video_out)
+static struct boot_info *mbi2_reloc(uint32_t mbi_in, uint32_t video_out)
 {
     const multiboot2_fixed_t *mbi_fix = _p(mbi_in);
     const multiboot2_memory_map_t *mmap_src;
     const multiboot2_tag_t *tag;
-    module_t *mbi_out_mods = NULL;
     memory_map_t *mmap_dst;
-    multiboot_info_t *mbi_out;
+    struct boot_info *binfo;
+    struct arch_boot_info *arch_binfo;
+    struct boot_module *bi_mods;
+    struct arch_bootmodule *arch_bi_mods;
 #ifdef CONFIG_VIDEO
     struct boot_video_info *video = NULL;
 #endif
     u32 ptr;
     unsigned int i, mod_idx = 0;
 
-    ptr = alloc_mem(sizeof(*mbi_out));
-    mbi_out = _p(ptr);
-    zero_mem(ptr, sizeof(*mbi_out));
+    ptr = alloc_mem(sizeof(*binfo));
+    zero_mem(ptr, sizeof(*binfo));
+    binfo = _p(ptr);
+
+    ptr = alloc_mem(sizeof(*arch_binfo));
+    zero_mem(ptr, sizeof(*arch_binfo));
+    binfo->arch = ptr;
+    arch_binfo = _p(ptr);
 
     /* Skip Multiboot2 information fixed part. */
     ptr = ALIGN_UP(mbi_in + sizeof(*mbi_fix), MULTIBOOT2_TAG_ALIGN);
@@ -206,21 +259,28 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, uint32_t video_out)
           tag = _p(ALIGN_UP((u32)tag + tag->size, MULTIBOOT2_TAG_ALIGN)) )
     {
         if ( tag->type == MULTIBOOT2_TAG_TYPE_MODULE )
-            ++mbi_out->mods_count;
+            ++binfo->nr_mods;
         else if ( tag->type == MULTIBOOT2_TAG_TYPE_END )
             break;
     }
 
-    if ( mbi_out->mods_count )
+    if ( binfo->nr_mods )
     {
-        mbi_out->flags |= MBI_MODULES;
         /*
          * We have to allocate one more module slot here. At some point
          * __start_xen() may put Xen image placement into it.
          */
-        mbi_out->mods_addr = alloc_mem((mbi_out->mods_count + 1) *
-                                       sizeof(*mbi_out_mods));
-        mbi_out_mods = _p(mbi_out->mods_addr);
+        ptr = alloc_mem((binfo->nr_mods + 1) * sizeof(*bi_mods));
+        binfo->mods = ptr;
+        bi_mods = _p(ptr);
+
+        ptr = alloc_mem((binfo->nr_mods + 1) * sizeof(*arch_bi_mods));
+        arch_bi_mods = _p(ptr);
+
+        /* map the +1 allocated for Xen image */
+        bi_mods[binfo->nr_mods].arch = _addr(&arch_bi_mods[binfo->nr_mods]);
+
+        arch_binfo->flags |= BOOTINFO_FLAG_X86_MODULES;
     }
 
     /* Skip Multiboot2 information fixed part. */
@@ -232,39 +292,42 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, uint32_t video_out)
         switch ( tag->type )
         {
         case MULTIBOOT2_TAG_TYPE_BOOT_LOADER_NAME:
-            mbi_out->flags |= MBI_LOADERNAME;
             ptr = get_mb2_string(tag, string, string);
-            mbi_out->boot_loader_name = copy_string(ptr);
+            arch_binfo->boot_loader_name = copy_string(ptr);
+            arch_binfo->flags |= BOOTINFO_FLAG_X86_LOADERNAME;
             break;
 
         case MULTIBOOT2_TAG_TYPE_CMDLINE:
-            mbi_out->flags |= MBI_CMDLINE;
             ptr = get_mb2_string(tag, string, string);
-            mbi_out->cmdline = copy_string(ptr);
+            binfo->cmdline = copy_string(ptr);
+            arch_binfo->flags |= BOOTINFO_FLAG_X86_CMDLINE;
             break;
 
         case MULTIBOOT2_TAG_TYPE_BASIC_MEMINFO:
-            mbi_out->flags |= MBI_MEMLIMITS;
-            mbi_out->mem_lower = get_mb2_data(tag, basic_meminfo, mem_lower);
-            mbi_out->mem_upper = get_mb2_data(tag, basic_meminfo, mem_upper);
+            arch_binfo->mem_lower = get_mb2_data(tag, basic_meminfo,
+                                                    mem_lower);
+            arch_binfo->mem_upper = get_mb2_data(tag, basic_meminfo,
+                                                    mem_upper);
             break;
 
         case MULTIBOOT2_TAG_TYPE_MMAP:
             if ( get_mb2_data(tag, mmap, entry_size) < sizeof(*mmap_src) )
                 break;
 
-            mbi_out->flags |= MBI_MEMMAP;
-            mbi_out->mmap_length = get_mb2_data(tag, mmap, size);
-            mbi_out->mmap_length -= sizeof(multiboot2_tag_mmap_t);
-            mbi_out->mmap_length /= get_mb2_data(tag, mmap, entry_size);
-            mbi_out->mmap_length *= sizeof(*mmap_dst);
+            arch_binfo->mmap_length = get_mb2_data(tag, mmap, size);
+            arch_binfo->mmap_length -= sizeof(multiboot2_tag_mmap_t);
+            arch_binfo->mmap_length /= get_mb2_data(tag, mmap, entry_size);
+            arch_binfo->mmap_length *= sizeof(*mmap_dst);
 
-            mbi_out->mmap_addr = alloc_mem(mbi_out->mmap_length);
+            arch_binfo->mmap_addr = alloc_mem(arch_binfo->mmap_length);
+            arch_binfo->flags |= BOOTINFO_FLAG_X86_MEMMAP;
 
             mmap_src = get_mb2_data(tag, mmap, entries);
-            mmap_dst = _p(mbi_out->mmap_addr);
+            mmap_dst = _p(arch_binfo->mmap_addr);
 
-            for ( i = 0; i < mbi_out->mmap_length / sizeof(*mmap_dst); i++ )
+            for ( i = 0;
+                  i < arch_binfo->mmap_length / sizeof(*mmap_dst);
+                  i++ )
             {
                 /* Init size member properly. */
                 mmap_dst[i].size = sizeof(*mmap_dst);
@@ -280,14 +343,27 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, uint32_t video_out)
             break;
 
         case MULTIBOOT2_TAG_TYPE_MODULE:
-            if ( mod_idx >= mbi_out->mods_count )
+            if ( mod_idx >= binfo->nr_mods )
                 break;
 
-            mbi_out_mods[mod_idx].mod_start = get_mb2_data(tag, module, mod_start);
-            mbi_out_mods[mod_idx].mod_end = get_mb2_data(tag, module, mod_end);
+            bi_mods[mod_idx].start = get_mb2_data(tag, module, mod_start);
+            bi_mods[mod_idx].size = get_mb2_data(tag, module, mod_end)
+                                            - bi_mods[mod_idx].start;
+
             ptr = get_mb2_string(tag, module, cmdline);
-            mbi_out_mods[mod_idx].string = copy_string(ptr);
-            mbi_out_mods[mod_idx].reserved = 0;
+            if ( ptr )
+            {
+                int i;
+                char *c = _p(ptr);
+
+                for ( i = 0; *c != '\0'; i++, c++ )
+                    bi_mods[mod_idx].string.bytes[i] = *c;
+
+                bi_mods[mod_idx].string.len = i + 1;
+            }
+
+            bi_mods[mod_idx].arch = _addr(&arch_bi_mods[mod_idx]);
+
             ++mod_idx;
             break;
 
@@ -344,11 +420,11 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, uint32_t video_out)
         video->orig_video_isVGA = 0x23;
 #endif
 
-    return mbi_out;
+    return binfo;
 }
 
-void *__stdcall reloc(uint32_t magic, uint32_t in, uint32_t trampoline,
-                      uint32_t video_info)
+void *__stdcall reloc(
+    uint32_t magic, uint32_t in, uint32_t trampoline, uint32_t video_info)
 {
     alloc = trampoline;
 
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index c94e53d139..5f14065c9c 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -11,14 +11,17 @@
 #include <asm/setup.h>
 
 static struct file __initdata ucode;
-static multiboot_info_t __initdata mbi = {
-    .flags = MBI_MODULES | MBI_LOADERNAME
-};
+
+static struct boot_info __initdata efi_bi;
+static struct arch_boot_info __initdata efi_bi_arch;
 /*
  * The array size needs to be one larger than the number of modules we
  * support - see __start_xen().
  */
-static module_t __initdata mb_modules[5];
+static struct boot_module __initdata efi_mods[MAX_NR_BOOTMODS + 1];
+static struct arch_bootmodule __initdata efi_arch_mods[MAX_NR_BOOTMODS + 1];
+
+static const char *__initdata efi_loader = "PVH Directboot";
 
 static void __init edd_put_string(u8 *dst, size_t n, const char *src)
 {
@@ -271,20 +274,37 @@ static void __init noreturn efi_arch_post_exit_boot(void)
                    : [cr3] "r" (idle_pg_table),
                      [cs] "i" (__HYPERVISOR_CS),
                      [ds] "r" (__HYPERVISOR_DS),
-                     "D" (&mbi)
+                     "D" (&efi_bi)
                    : "memory" );
     unreachable();
 }
 
-static void __init efi_arch_cfg_file_early(const EFI_LOADED_IMAGE *image,
-                                           EFI_FILE_HANDLE dir_handle,
-                                           const char *section)
+static struct boot_info __init *efi_arch_bootinfo_init(void)
 {
+    int i;
+
+    efi_bi.arch = &efi_bi_arch;
+    efi_bi.mods = efi_mods;
+
+    for ( i=0; i <= MAX_NR_BOOTMODS; i++ )
+        efi_bi.mods[i].arch = &efi_arch_mods[i];
+
+    efi_bi_arch.boot_loader_name = _p(efi_loader);
+
+    efi_bi_arch.flags = BOOTINFO_FLAG_X86_MODULES |
+                        BOOTINFO_FLAG_X86_LOADERNAME;
+    return &efi_bi;
 }
 
-static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
-                                          EFI_FILE_HANDLE dir_handle,
-                                          const char *section)
+static void __init efi_arch_cfg_file_early(
+    const EFI_LOADED_IMAGE *image, EFI_FILE_HANDLE dir_handle,
+    const char *section)
+{
+}
+
+static void __init efi_arch_cfg_file_late(
+    const EFI_LOADED_IMAGE *image, EFI_FILE_HANDLE dir_handle,
+    const char *section)
 {
     union string name;
 
@@ -296,16 +316,15 @@ static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
         name.s = get_value(&cfg, "global", "ucode");
     if ( name.s )
     {
-        microcode_set_module(mbi.mods_count);
+        microcode_set_module(efi_bi.nr_mods);
         split_string(name.s);
         read_file(dir_handle, s2w(&name), &ucode, NULL);
         efi_bs->FreePool(name.w);
     }
 }
 
-static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
-                                           CHAR16 *cmdline_options,
-                                           const char *cfgfile_options)
+static void __init efi_arch_handle_cmdline(
+    CHAR16 *image_name, CHAR16 *cmdline_options, const char *cfgfile_options)
 {
     union string name;
 
@@ -313,10 +332,10 @@ static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
     {
         name.w = cmdline_options;
         w2s(&name);
-        place_string(&mbi.cmdline, name.s);
+        place_string((uint32_t *)efi_bi.cmdline, name.s);
     }
     if ( cfgfile_options )
-        place_string(&mbi.cmdline, cfgfile_options);
+        place_string((uint32_t *)efi_bi.cmdline, cfgfile_options);
     /* Insert image name last, as it gets prefixed to the other options. */
     if ( image_name )
     {
@@ -325,16 +344,10 @@ static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
     }
     else
         name.s = "xen";
-    place_string(&mbi.cmdline, name.s);
+    place_string((uint32_t *)efi_bi.cmdline, name.s);
 
-    if ( mbi.cmdline )
-        mbi.flags |= MBI_CMDLINE;
-    /*
-     * These must not be initialized statically, since the value must
-     * not get relocated when processing base relocations later.
-     */
-    mbi.boot_loader_name = (long)"EFI";
-    mbi.mods_addr = (long)mb_modules;
+    if ( efi_bi.cmdline )
+        efi_bi_arch.flags |= BOOTINFO_FLAG_X86_CMDLINE;
 }
 
 static void __init efi_arch_edd(void)
@@ -704,9 +717,8 @@ static void __init efi_arch_memory_setup(void)
 #undef l2_4G_offset
 }
 
-static void __init efi_arch_handle_module(const struct file *file,
-                                          const CHAR16 *name,
-                                          const char *options)
+static void __init efi_arch_handle_module(
+    const struct file *file, const CHAR16 *name, const char *options)
 {
     union string local_name;
     void *ptr;
@@ -724,17 +736,24 @@ static void __init efi_arch_handle_module(const struct file *file,
     w2s(&local_name);
 
     /*
-     * If options are provided, put them in
-     * mb_modules[mbi.mods_count].string after the filename, with a space
-     * separating them.  place_string() prepends strings and adds separating
-     * spaces, so the call order is reversed.
+     * Set module string to filename and if options are provided, put them in
+     * after the filename, with a space separating them.
      */
+    strlcpy(efi_bi.mods[efi_bi.nr_mods].string.bytes, local_name.s,
+                 BOOTMOD_STRING_MAX_LEN);
     if ( options )
-        place_string(&mb_modules[mbi.mods_count].string, options);
-    place_string(&mb_modules[mbi.mods_count].string, local_name.s);
-    mb_modules[mbi.mods_count].mod_start = file->addr >> PAGE_SHIFT;
-    mb_modules[mbi.mods_count].mod_end = file->size;
-    ++mbi.mods_count;
+    {
+        strlcat(efi_bi.mods[efi_bi.nr_mods].string.bytes, " ",
+                BOOTMOD_STRING_MAX_LEN);
+        strlcat(efi_bi.mods[efi_bi.nr_mods].string.bytes, options,
+                BOOTMOD_STRING_MAX_LEN);
+    }
+
+    efi_bi.mods[efi_bi.nr_mods].start = file->addr;
+    efi_bi.mods[efi_bi.nr_mods].mfn = maddr_to_mfn(file->addr);
+    efi_bi.mods[efi_bi.nr_mods].size = file->size;
+
+    ++efi_bi.nr_mods;
     efi_bs->FreePool(ptr);
 }
 
diff --git a/xen/arch/x86/guest/xen/pvh-boot.c b/xen/arch/x86/guest/xen/pvh-boot.c
index 1ed04d035c..dd10a358da 100644
--- a/xen/arch/x86/guest/xen/pvh-boot.c
+++ b/xen/arch/x86/guest/xen/pvh-boot.c
@@ -6,6 +6,7 @@
  *
  * Copyright (c) 2017 Citrix Systems Ltd.
  */
+#include <xen/bootinfo.h>
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/mm.h>
@@ -20,12 +21,28 @@
 bool __initdata pvh_boot;
 uint32_t __initdata pvh_start_info_pa;
 
-static multiboot_info_t __initdata pvh_mbi;
-static module_t __initdata pvh_mbi_mods[8];
-static const char *__initdata pvh_loader = "PVH Directboot";
+static struct boot_info __initdata pvh_bi;
+static struct arch_boot_info __initdata arch_pvh_bi;
+static struct boot_module __initdata pvh_mods[MAX_NR_BOOTMODS + 1];
+static struct arch_bootmodule __initdata arch_pvh_mods[MAX_NR_BOOTMODS + 1];
+static char __initdata *pvh_loader = "PVH Directboot";
 
-static void __init convert_pvh_info(multiboot_info_t **mbi,
-                                    module_t **mod)
+static struct boot_info __init *init_pvh_info(void)
+{
+    int i;
+
+    pvh_bi.arch = &arch_pvh_bi;
+    pvh_bi.mods = pvh_mods;
+
+    for ( i=0; i <= MAX_NR_BOOTMODS; i++ )
+        pvh_bi.mods[i].arch = &arch_pvh_mods[i];
+
+    pvh_bi.arch->boot_loader_name = pvh_loader;
+
+    return &pvh_bi;
+}
+
+static void __init convert_pvh_info(struct boot_info *bi)
 {
     const struct hvm_start_info *pvh_info = __va(pvh_start_info_pa);
     const struct hvm_modlist_entry *entry;
@@ -39,23 +56,22 @@ static void __init convert_pvh_info(multiboot_info_t **mbi,
      * required. The extra element is used to aid relocation. See
      * arch/x86/setup.c:__start_xen().
      */
-    if ( ARRAY_SIZE(pvh_mbi_mods) <= pvh_info->nr_modules )
+    if ( ARRAY_SIZE(pvh_mods) <= pvh_info->nr_modules )
         panic("The module array is too small, size %zu, requested %u\n",
-              ARRAY_SIZE(pvh_mbi_mods), pvh_info->nr_modules);
+              ARRAY_SIZE(pvh_mods), pvh_info->nr_modules);
 
     /*
      * Turn hvm_start_info into mbi. Luckily all modules are placed under 4GB
      * boundary on x86.
      */
-    pvh_mbi.flags = MBI_CMDLINE | MBI_MODULES | MBI_LOADERNAME;
+    bi->arch->flags = BOOTINFO_FLAG_X86_CMDLINE | BOOTINFO_FLAG_X86_MODULES
+                      | BOOTINFO_FLAG_X86_LOADERNAME;
 
     BUG_ON(pvh_info->cmdline_paddr >> 32);
-    pvh_mbi.cmdline = pvh_info->cmdline_paddr;
-    pvh_mbi.boot_loader_name = __pa(pvh_loader);
+    bi->cmdline = _p(__va(pvh_info->cmdline_paddr));
 
-    BUG_ON(pvh_info->nr_modules >= ARRAY_SIZE(pvh_mbi_mods));
-    pvh_mbi.mods_count = pvh_info->nr_modules;
-    pvh_mbi.mods_addr = __pa(pvh_mbi_mods);
+    BUG_ON(pvh_info->nr_modules >= ARRAY_SIZE(pvh_mods));
+    bi->nr_mods = pvh_info->nr_modules;
 
     entry = __va(pvh_info->modlist_paddr);
     for ( i = 0; i < pvh_info->nr_modules; i++ )
@@ -63,15 +79,18 @@ static void __init convert_pvh_info(multiboot_info_t **mbi,
         BUG_ON(entry[i].paddr >> 32);
         BUG_ON(entry[i].cmdline_paddr >> 32);
 
-        pvh_mbi_mods[i].mod_start = entry[i].paddr;
-        pvh_mbi_mods[i].mod_end   = entry[i].paddr + entry[i].size;
-        pvh_mbi_mods[i].string    = entry[i].cmdline_paddr;
+        bi->mods[i].start = entry[i].paddr;
+        bi->mods[i].size  = entry[i].size;
+        if ( entry[i].cmdline_paddr)
+        {
+            char *c = _p(__va(entry[i].cmdline_paddr));
+
+            safe_strcpy(bi->mods[i].string.bytes, c);
+            bi->mods[i].string.kind = BOOTSTR_CMDLINE;
+        }
     }
 
     rsdp_hint = pvh_info->rsdp_paddr;
-
-    *mbi = &pvh_mbi;
-    *mod = pvh_mbi_mods;
 }
 
 static void __init get_memory_map(void)
@@ -88,13 +107,16 @@ static void __init get_memory_map(void)
     sanitize_e820_map(e820_raw.map, &e820_raw.nr_map);
 }
 
-void __init pvh_init(multiboot_info_t **mbi, module_t **mod)
+void __init pvh_init(struct boot_info **bi)
 {
-    convert_pvh_info(mbi, mod);
+    *bi = init_pvh_info();
+    convert_pvh_info(*bi);
 
     hypervisor_probe();
     ASSERT(xen_guest);
 
+    (*bi)->arch->xen_guest = xen_guest;
+
     get_memory_map();
 }
 
diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index 989fb7a1da..c1ed76fd3e 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -1,14 +1,14 @@
 #ifndef __ARCH_X86_BOOTINFO_H__
 #define __ARCH_X86_BOOTINFO_H__
 
-struct arch_bootmodule {
+struct __packed arch_bootmodule {
 #define BOOTMOD_FLAG_X86_RELOCATED     1U << 0
     uint32_t flags;
     unsigned headroom;
 };
 DEFINE_STRUCT_PTR_TYPE(arch_bootmodule);
 
-struct arch_boot_info {
+struct __packed arch_boot_info {
     uint32_t flags;
 #define BOOTINFO_FLAG_X86_CMDLINE      1U << 2
 #define BOOTINFO_FLAG_X86_MODULES      1U << 3
@@ -17,6 +17,9 @@ struct arch_boot_info {
 
     char_ptr_t boot_loader_name;
 
+    uint32_t mem_lower;
+    uint32_t mem_upper;
+
     uint32_t mmap_length;
     paddr_t mmap_addr;
 };
diff --git a/xen/arch/x86/include/asm/guest/pvh-boot.h b/xen/arch/x86/include/asm/guest/pvh-boot.h
index 247ba6899e..c820b0bf88 100644
--- a/xen/arch/x86/include/asm/guest/pvh-boot.h
+++ b/xen/arch/x86/include/asm/guest/pvh-boot.h
@@ -8,13 +8,13 @@
 #ifndef __X86_PVH_BOOT_H__
 #define __X86_PVH_BOOT_H__
 
-#include <xen/multiboot.h>
+#include <xen/bootinfo.h>
 
 #ifdef CONFIG_PVH_GUEST
 
 extern bool pvh_boot;
 
-void pvh_init(multiboot_info_t **mbi, module_t **mod);
+void __init pvh_init(struct boot_info **bi);
 void pvh_print_info(void);
 
 #else
@@ -23,7 +23,7 @@ void pvh_print_info(void);
 
 #define pvh_boot 0
 
-static inline void pvh_init(multiboot_info_t **mbi, module_t **mod)
+static inline void __init pvh_init(struct boot_info **bi)
 {
     ASSERT_UNREACHABLE();
 }
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 50a1a124b0..05a76a5959 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -13,7 +13,6 @@
 #include <xen/console.h>
 #include <xen/serial.h>
 #include <xen/trace.h>
-#include <xen/multiboot.h>
 #include <xen/domain_page.h>
 #include <xen/version.h>
 #include <xen/hypercall.h>
@@ -60,9 +59,6 @@
 #include <asm/prot-key.h>
 #include <asm/pv/domain.h>
 
-/* Max number of boot modules a bootloader can provide in addition to Xen */
-#define MAX_NR_BOOTMODS 63
-
 /* opt_nosmp: If true, secondary processors are ignored. */
 static bool __initdata opt_nosmp;
 boolean_param("nosmp", opt_nosmp);
@@ -275,46 +271,6 @@ custom_param("acpi", parse_acpi_param);
 
 static struct boot_info __initdata *boot_info;
 
-static void __init multiboot_to_bootinfo(multiboot_info_t *mbi, module_t *mods)
-{
-    static struct boot_info       __initdata info;
-    static struct arch_boot_info  __initdata arch_info;
-    static struct boot_module     __initdata boot_mods[MAX_NR_BOOTMODS + 1];
-    static struct arch_bootmodule __initdata arch_boot_mods[
-                                                       MAX_NR_BOOTMODS + 1];
-
-    int i;
-
-    info.arch = &arch_info;
-    info.mods = boot_mods;
-
-    info.cmdline = __va(mbi->cmdline);
-
-    /* The BOOTINFO_FLAG_X86_* flags are a 1-1 map to MBI_* */
-    arch_info.flags = mbi->flags;
-    arch_info.mmap_length = mbi->mmap_length;
-    arch_info.mmap_addr = mbi->mmap_addr;
-    arch_info.boot_loader_name = __va(mbi->boot_loader_name);
-
-    info.nr_mods = mbi->mods_count;
-    for ( i = 0; i <= MAX_NR_BOOTMODS; i++ )
-    {
-        boot_mods[i].arch = &arch_boot_mods[i];
-
-        if ( i < info.nr_mods )
-        {
-            bootmodule_update_start(&boot_mods[i], mods[i].mod_start);
-            boot_mods[i].size = mods[i].mod_end - mods[i].mod_start;
-
-            boot_mods[i].string.len = strlcpy(boot_mods[i].string.bytes,
-                                             __va(mods[i].string),
-                                             BOOTMOD_STRING_MAX_LEN);
-        }
-    }
-
-    boot_info = &info;
-}
-
 unsigned long __init initial_images_nrpages(nodeid_t node)
 {
     unsigned long node_start = node_start_pfn(node);
@@ -1014,15 +970,13 @@ static struct domain *__init create_dom0(const struct boot_info *bootinfo,
 /* How much of the directmap is prebuilt at compile time. */
 #define PREBUILT_MAP_LIMIT (1 << L2_PAGETABLE_SHIFT)
 
-void __init noreturn __start_xen(unsigned long mbi_p)
+void __init noreturn __start_xen(unsigned long bi_p)
 {
     char *memmap_type = NULL;
     char *cmdline, *kextra, *loader;
     void *bsp_stack;
     struct cpu_info *info = get_cpu_info(), *bsp_info;
     unsigned int initrdidx, num_parked = 0;
-    multiboot_info_t *mbi;
-    module_t *mod;
     unsigned long nr_pages, raw_max_page;
     int i, j, e820_warn = 0, bytes = 0;
     unsigned long eb_start, eb_end;
@@ -1059,16 +1013,29 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     if ( pvh_boot )
     {
-        ASSERT(mbi_p == 0);
-        pvh_init(&mbi, &mod);
+        ASSERT(bi_p == 0);
+        pvh_init(&boot_info);
     }
     else
     {
-        mbi = __va(mbi_p);
-        mod = __va(mbi->mods_addr);
-    }
+        /*
+         * Since addresses were setup before virtual addressing was enabled,
+         * fixup pointers to virtual addresses for proper dereferencing.
+         */
+        boot_info = __va(bi_p);
+        boot_info->cmdline = __va(boot_info->cmdline);
+        boot_info->mods = __va(boot_info->mods);
+        boot_info->arch = __va(boot_info->arch);
+
+        boot_info->arch->boot_loader_name =
+            __va(boot_info->arch->boot_loader_name);
 
-    multiboot_to_bootinfo(mbi, mod);
+        for ( i = 0; i <= boot_info->nr_mods; i++ )
+        {
+            boot_info->mods[i].mfn = maddr_to_mfn(boot_info->mods[i].start);
+            boot_info->mods[i].arch = __va(boot_info->mods[i].arch);
+        }
+    }
 
     loader = (boot_info->arch->flags & BOOTINFO_FLAG_X86_LOADERNAME)
         ? boot_info->arch->boot_loader_name : "unknown";
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index c5850c26af..09b38b497c 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -3,6 +3,7 @@
 #include <efi/efipciio.h>
 #include <public/xen.h>
 #include <xen/bitops.h>
+#include <xen/bootinfo.h>
 #include <xen/compile.h>
 #include <xen/ctype.h>
 #include <xen/dmi.h>
@@ -11,7 +12,6 @@
 #include <xen/keyhandler.h>
 #include <xen/lib.h>
 #include <xen/mm.h>
-#include <xen/multiboot.h>
 #include <xen/param.h>
 #include <xen/pci_regs.h>
 #include <xen/pfn.h>
@@ -1359,6 +1359,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     efi_arch_relocate_image(0);
 
+    efi_arch_bootinfo_init();
+
     if ( use_cfg_file )
     {
         EFI_FILE_HANDLE dir_handle;
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
index bf5586a76b..6e09be6899 100644
--- a/xen/include/xen/bootinfo.h
+++ b/xen/include/xen/bootinfo.h
@@ -20,13 +20,16 @@
 #define BOOTMOD_GUEST_DTB   7
 typedef unsigned int bootmod_type_t;
 
+/* Max number of boot modules a bootloader can provide in addition to Xen */
+#define MAX_NR_BOOTMODS 63
+
 #define BOOTMOD_STRING_MAX_LEN 1024
-struct boot_string {
+struct __packed boot_string {
     char bytes[BOOTMOD_STRING_MAX_LEN];
     size_t len;
 };
 
-struct boot_module {
+struct __packed boot_module {
     bootmod_type_t bootmod_type;
     paddr_t start;
     mfn_t mfn;
@@ -37,7 +40,7 @@ struct boot_module {
 };
 DEFINE_STRUCT_PTR_TYPE(boot_module);
 
-struct boot_info {
+struct __packed boot_info {
     char_ptr_t cmdline;
 
     unsigned int nr_mods;
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 01:41:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 01:41:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557721.871328 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFPbX-0003Qn-BL; Sat, 01 Jul 2023 01:40:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557721.871328; Sat, 01 Jul 2023 01:40:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFPbX-0003QY-5y; Sat, 01 Jul 2023 01:40:51 +0000
Received: by outflank-mailman (input) for mailman id 557721;
 Sat, 01 Jul 2023 01:40:49 +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
 <SRS0=FaHD=CT=gmail.com=yshxxsjt715@srs-se1.protection.inumbo.net>)
 id 1qFPbV-0003QN-Nd
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 01:40:49 +0000
Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com
 [2607:f8b0:4864:20::1131])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4ae2aa5c-17b0-11ee-8611-37d641c3527e;
 Sat, 01 Jul 2023 03:40:44 +0200 (CEST)
Received: by mail-yw1-x1131.google.com with SMTP id
 00721157ae682-5774098f16eso16007677b3.0; 
 Fri, 30 Jun 2023 18:40:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4ae2aa5c-17b0-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688175643; x=1690767643;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=SEcfA2Ww7HR2irnIpklXq/A9PNh1FXgpCio5YDgpl0U=;
        b=jmoC5J1PtFdizaR2gL+x54Pc91iCLqZ8hdq5oR6a0BMD4YBcqOaNGA6NpJDERb5ALb
         Rb9Inb1FabtHuAfAHQMZCVS8JbCo5Mbnq6OLVDB2oR470AN+BptAfa3jHkqE50ZDMUBm
         /f+hsTRgyfViphjjlmFOk04ZKWva+RhzsINsZpjXoTJUQSRQJZPbPCuealJJXgekH/Pu
         exiTwvUYAcSl7gVWl86WtSSgI+gbXOZhBocUYeEQ+vJJCDoO9roChlWvC/k4bUpWgIhq
         zIhUmGZutYzVTHFaXWDB6NWRm9CaG73UC8OgTeCpOKtdR6p/6Qq+l+uuXKekgEI7bR0N
         uYew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688175643; x=1690767643;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=SEcfA2Ww7HR2irnIpklXq/A9PNh1FXgpCio5YDgpl0U=;
        b=ieL6Hiy/IeClq+oG2pspXDZGS7ADAhNSa1bxB5wiJbZMeto2olcZX1SlarfrVAyaaX
         lER0qw5CkDg/ZfSQS/l+6nkBGvySYrjrNMrTzuNy5o6mwo4gqqKow9iWkTZ8qC8kD9gv
         XQe2o5Qf8LZjqfHfhEjSMV3VVcsp9F1W0no8uQWILB87w6P7RpuoiXBasblOWCoj3781
         fxiPjZ2I5H1Bx+Ax0x7Li+yOHEPVYZd8lfUW1DqvcYj1w8zMNmii+IQEwnTguCD83vxs
         CXj4pPLq7SPOMRJ6yJv/LThxzbUADOw0vShefBXUY8VYKWpAa8ZG8TWBzAntoxeOuODm
         Upxg==
X-Gm-Message-State: ABy/qLaklvtHl131WEiQyk6LqIP4WypE334KBLVsxDZothD+VIUtYgRr
	LV+3AnsAqdPkwQMdpufvDIycMUBDGz9drYRXonjb1bX7064=
X-Google-Smtp-Source: APBJJlHzZgRATzxdC7kGqhsaCy5jV5epnWTg0LUyCnbY/zCR2Fu7oouXEkzjgP2oVPJ5y25cl/JXVVnsrdtd2ycU4mM=
X-Received: by 2002:a81:6646:0:b0:56d:8241:e067 with SMTP id
 a67-20020a816646000000b0056d8241e067mr3848423ywc.49.1688175642818; Fri, 30
 Jun 2023 18:40:42 -0700 (PDT)
MIME-Version: 1.0
References: <CALqm=ddiMwWvdYMgyCtaKMocUEkEJyTgSQup9wJiXm4PrcDuVw@mail.gmail.com>
 <alpine.DEB.2.22.394.2306081537590.3803068@ubuntu-linux-20-04-desktop>
 <e729d60e-b290-dec3-e35b-65c24ffbfda6@xen.org> <CALqm=ddc3BhqRQmPDjnZ3TeMEXPTMUDfj7JCSj0QEDxnMaKLvw@mail.gmail.com>
 <78899eac-9de8-3626-8f40-98f993984f95@xen.org> <CALqm=dfrudbnsy7RdP9GdSmyO2m9JN=8mKD7wQvz2WBv6afJhQ@mail.gmail.com>
 <CALqm=de+zGitK2ofX=gExMX1mVUbN1S45fMtf5a9iBR-WBZpcw@mail.gmail.com>
 <CALqm=dcn02oe=nrL_SEo+y5aTJX8SD3OB3fccFyEwPch6fLfDg@mail.gmail.com>
 <CALqm=deNDzc83QEAUqTE5iKb7g106V_k_F6AEJc19R=W-0TDsw@mail.gmail.com>
 <e3f54279-db7a-973c-e792-712dc2b19eb7@xen.org> <CALqm=dfE=Ni0gzs8F692DmXzBs-EbqCs7sXenBt0qOGV=iyj0g@mail.gmail.com>
 <ebdfe8a6-7aee-a553-907e-e788c3b3df33@xen.org> <CALqm=ddPaaF8PG=ycb0u0iGHR+=35SV9taSo7Q-0FqH9QeMiEA@mail.gmail.com>
 <1ef5a5a6-01ea-4f3f-c05f-7dfd204a1861@xen.org> <CALqm=dd494P-BWCiemXJYgE4QbZ09MfE_bmae75LqGQcV=PiXA@mail.gmail.com>
 <8bf66b4a-7f3b-22e0-6c09-c003ac972fe5@xen.org>
In-Reply-To: <8bf66b4a-7f3b-22e0-6c09-c003ac972fe5@xen.org>
From: Jiatong Shen <yshxxsjt715@gmail.com>
Date: Sat, 1 Jul 2023 09:40:31 +0800
Message-ID: <CALqm=dfwCiFnCd6ypm3y3FtiiPeQjUE9m+w+J8vwNv6t47f0Yg@mail.gmail.com>
Subject: Re: Asking for help to debug xen efi on Kunpeng machine
To: Julien Grall <julien@xen.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>, xen-users@lists.xenproject.org, 
	xen-devel@lists.xenproject.org, bertrand.marquis@arm.com
Content-Type: multipart/alternative; boundary="000000000000823df005ff6305e9"

--000000000000823df005ff6305e9
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Julien,

   Thank you for your answer. Do you have any advice on how to debug the
issue?
I have very little experience with xen so I think I still need
debugging even if I can
get MBI-gen's tech doc...

Best regards,
Jiatong Shen

On Fri, Jun 30, 2023 at 5:42=E2=80=AFAM Julien Grall <julien@xen.org> wrote=
:

> On 24/06/2023 15:54, Jiatong Shen wrote:
> > Hello Julien,
>
> Hi,
>
> >     Thank you very much for your reply. Can you teach me how to find th=
e
> > relationship between MBI-gen and devices?
> > I am not sure how to find out the mbi-gen backed devices..
>
> I am afraid I don't have any experience with the MBI-gen. I have also
> looked at one Hisilicon Device-Tree but I don't know whether this is the
> one for your board.
>
> My recommendation would be to check if there is any technical
> documentation for your HW.
>
> Cheers,
>
> --
> Julien Grall
>


--=20

Best Regards,

Jiatong Shen

--000000000000823df005ff6305e9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi Julien,</div><div><br></div>=C2=A0 =C2=A0Thank you=
 for your answer. Do you have any advice on how to debug the issue?<br><div=
>I have very little experience=C2=A0with xen so I think I still need debugg=
ing=C2=A0even if I can</div><div>get MBI-gen&#39;s tech doc...</div><div><b=
r></div><div>Best=C2=A0regards,</div><div>Jiatong Shen</div></div><br><div =
class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jun 30,=
 2023 at 5:42=E2=80=AFAM Julien Grall &lt;<a href=3D"mailto:julien@xen.org"=
>julien@xen.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad=
ding-left:1ex">On 24/06/2023 15:54, Jiatong Shen wrote:<br>
&gt; Hello Julien,<br>
<br>
Hi,<br>
<br>
&gt;=C2=A0 =C2=A0 =C2=A0Thank you very much for your reply. Can you teach m=
e how to find the<br>
&gt; relationship between MBI-gen and devices?<br>
&gt; I am not sure how to find out the mbi-gen backed devices..<br>
<br>
I am afraid I don&#39;t have any experience with the MBI-gen. I have also <=
br>
looked at one Hisilicon Device-Tree but I don&#39;t know whether this is th=
e <br>
one for your board.<br>
<br>
My recommendation would be to check if there is any technical <br>
documentation for your HW.<br>
<br>
Cheers,<br>
<br>
-- <br>
Julien Grall<br>
</blockquote></div><br clear=3D"all"><div><br></div><span class=3D"gmail_si=
gnature_prefix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><d=
iv dir=3D"ltr"><br><div>Best Regards,</div><div><br></div><div>Jiatong Shen=
</div></div></div>

--000000000000823df005ff6305e9--


From xen-devel-bounces@lists.xenproject.org Sat Jul 01 03:14:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 03:14:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557751.871355 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFR3g-0005Ni-Gt; Sat, 01 Jul 2023 03:14:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557751.871355; Sat, 01 Jul 2023 03:14:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFR3g-0005Nb-Bw; Sat, 01 Jul 2023 03:14:00 +0000
Received: by outflank-mailman (input) for mailman id 557751;
 Sat, 01 Jul 2023 03:13:59 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFR3f-0005NR-Bl; Sat, 01 Jul 2023 03:13:59 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFR3f-0005Wf-45; Sat, 01 Jul 2023 03:13:59 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFR3e-0000Bf-P9; Sat, 01 Jul 2023 03:13:58 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qFR3e-0004nE-O0; Sat, 01 Jul 2023 03:13:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=vY5qmLZUoyxIZ0Gstgj0u1AJVD/p7pvmZE4OJAUUtPk=; b=ORToBAYgVCK1OF0FYJsGx+04NN
	o+AgzihxlK+arhdUqztB+hUu3b55orEy8aV621I/NGbtOk6lhbVnnHodw8MaorgnNyPVE9tioPaBF
	lKRi9gY5ZnmNI3hRFyWrRUoR/JitsHC4LJuDXfjOrRUKlIdpLlrt76s7zqXu2CwIjXCE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181657-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181657: regressions - FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-xl-xsm:xen-install:fail:regression
    xen-unstable:test-amd64-i386-qemut-rhel6hvm-amd:xen-install:fail:heisenbug
    xen-unstable:test-amd64-i386-libvirt:xen-install:fail:heisenbug
    xen-unstable:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=c81b287e00b1a21beb65637d9cfb812da3a0e5ce
X-Osstest-Versions-That:
    xen=6aa0c18062609cb448d292668a81953a58ce1e95
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 01 Jul 2023 03:13:58 +0000

flight 181657 xen-unstable real [real]
flight 181664 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181657/
http://logs.test-lab.xenproject.org/osstest/logs/181664/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-xl-xsm        7 xen-install              fail REGR. vs. 181646

Tests which are failing intermittently (not blocking):
 test-amd64-i386-qemut-rhel6hvm-amd  7 xen-install   fail pass in 181664-retest
 test-amd64-i386-libvirt       7 xen-install         fail pass in 181664-retest
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail pass in 181664-retest

Tests which did not succeed, but are not blocking:
 test-amd64-i386-libvirt     15 migrate-support-check fail in 181664 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181646
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181646
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181646
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181646
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181646
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181646
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181646
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181646
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181646
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181646
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181646
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181646
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  c81b287e00b1a21beb65637d9cfb812da3a0e5ce
baseline version:
 xen                  6aa0c18062609cb448d292668a81953a58ce1e95

Last test of basis   181646  2023-06-30 02:11:47 Z    1 days
Testing same since   181657  2023-06-30 14:38:36 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Anthony PERARD <anthony.perard@citrix.com>
  George Dunlap <george.dunlap@cloud.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       fail    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      fail    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit c81b287e00b1a21beb65637d9cfb812da3a0e5ce
Author: George Dunlap <george.dunlap@cloud.com>
Date:   Fri Jun 30 11:25:34 2023 +0100

    xenalyze: Basic TRC_HVM_EMUL handling
    
    For now, mainly just do volume analysis and get rid of the warnings.
    
    Signed-off-by: George Dunlap <george.dunlap@cloud.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>

commit aab4b38b5d77e3c65f44bacd56427a85b7392a11
Author: George Dunlap <george.dunlap@cloud.com>
Date:   Fri Jun 30 11:25:33 2023 +0100

    xenalyze: Handle start-of-day ->RUNNING transitions
    
    A recent xentrace highlighted an unhandled corner case in the vcpu
    "start-of-day" logic, if the trace starts after the last running ->
    non-running transition, but before the first non-running -> running
    transition.  Because start-of-day wasn't handled, vcpu_next_update()
    was expecting p->current to be NULL, and tripping out with the
    following error message when it wasn't:
    
    vcpu_next_update: FATAL: p->current not NULL! (d32768dv$p, runstate RUNSTATE_INIT)
    
    where 32768 is the DEFAULT_DOMAIN, and $p is the pcpu number.
    
    Instead of calling vcpu_start() piecemeal throughout
    sched_runstate_process(), call it at the top of the function if the
    vcpu in question is still in RUNSTATE_INIT, so that we can handle all
    the cases in one place.
    
    Sketch out at the top of the function all cases which we need to
    handle, and what to do in those cases.  Some transitions tell us where
    v is running; some transitions tell us about what is (or is not)
    running on p; some transitions tell us neither.
    
    If a transition tells us where v is now running, update its state;
    otherwise leave it in INIT, in order to avoid having to deal with TSC
    skew on start-up.
    
    If a transition tells us what is or is not running on p, update
    p->current (either to v or NULL).  Otherwise leave it alone.
    
    If neither, do nothing.
    
    Reifying those rules:
    
    - If we're continuing to run, set v to RUNNING, and use p->first_tsc
      as the runstate time.
    
    - If we're starting to run, set v to RUNNING, and use ri->tsc as the
      runstate time.
    
    - If v is being deschedled, leave v in the INIT state to avoid dealing
      with TSC skew; but set p->current to NULL so that whatever is
      scheduled next won't trigger the assert in vcpu_next_update().
    
    - If a vcpu is waking up (switching from one non-runnable state to
      another non-runnable state), leave v in INIT, and p in whatever
      state it's in (which may be the default domain, or some other vcpu
      which has already run).
    
    While here, fix the comment above vcpu_start; it's called when the
    vcpu state is INIT, not when current is the default domain.
    
    Signed-off-by: George Dunlap <george.dunlap@cloud.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Sat Jul 01 07:07:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 07:07:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557764.871380 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUh0-0004oO-NE; Sat, 01 Jul 2023 07:06:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557764.871380; Sat, 01 Jul 2023 07:06:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUh0-0004oH-Jq; Sat, 01 Jul 2023 07:06:50 +0000
Received: by outflank-mailman (input) for mailman id 557764;
 Sat, 01 Jul 2023 07:06:50 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFUh0-0004o7-3Y; Sat, 01 Jul 2023 07:06:50 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFUgz-0002yG-V6; Sat, 01 Jul 2023 07:06:49 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFUgz-0001qP-Ew; Sat, 01 Jul 2023 07:06:49 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qFUgz-0007hC-EQ; Sat, 01 Jul 2023 07:06:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=kv/ctAaDMTuN68uWg4eIc19VthvI8/12pft+lfhKVFo=; b=UQZSTNLEUYjUvKIqMRKfd7yRb0
	budEi7xlJ4LG1q3DNRRO0jHWwCC8WcFiMLsfM1zCVb9+cwpXtORk9tyhpQ7pY+llUikPDwzRo+do2
	1GCovQktGcWDALy9o5WCPPiyuRBfsv3pBBH9xHeNmej4g1SItkUIfjgC2emY3GLkmf08=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181663-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181663: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl:debian-install:fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:debian-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pygrub:debian-di-install:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:windows-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:xen-boot:fail:allowable
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=6cdbb0907a3c562723455e351c940037bdec9b7a
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 01 Jul 2023 07:06:49 +0000

flight 181663 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181663/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd  8 xen-boot            fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-libvirt     11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2 11 leak-check/basis(11)   fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd 11 leak-check/basis(11)    fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm      12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl          12 debian-install           fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl 12 debian-install          fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 12 xen-boot/src_host       fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-pygrub      12 debian-di-install        fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 12 windows-install  fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds      8 xen-boot                 fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                6cdbb0907a3c562723455e351c940037bdec9b7a
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   75 days
Failing since        180281  2023-04-17 06:24:36 Z   75 days  144 attempts
Testing same since   181663  2023-06-30 21:43:24 Z    0 days    1 attempts

------------------------------------------------------------
3501 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 559212 lines long.)


From xen-devel-bounces@lists.xenproject.org Sat Jul 01 07:18:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 07:18:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557773.871420 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUsj-00078X-La; Sat, 01 Jul 2023 07:18:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557773.871420; Sat, 01 Jul 2023 07:18:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUsj-00077S-Go; Sat, 01 Jul 2023 07:18:57 +0000
Received: by outflank-mailman (input) for mailman id 557773;
 Sat, 01 Jul 2023 07:18:55 +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
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFUsh-0006No-Hn
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 07:18:55 +0000
Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com
 [2607:f8b0:4864:20::435])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 885db715-17df-11ee-8611-37d641c3527e;
 Sat, 01 Jul 2023 09:18:53 +0200 (CEST)
Received: by mail-pf1-x435.google.com with SMTP id
 d2e1a72fcca58-666e6541c98so2162693b3a.2
 for <xen-devel@lists.xenproject.org>; Sat, 01 Jul 2023 00:18:53 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s19-20020aa78d53000000b00673e652985bsm4108866pfe.118.2023.07.01.00.18.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 01 Jul 2023 00:18:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: 885db715-17df-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688195932; x=1690787932;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=VZN0HVDL3v266tIzCxp1Au3MTDvSJDRQFEKwXgYQOKg=;
        b=YpX7sawsKZYhNUkXDrP6r+4b0ejLipURz01felmUeInxxsFgxrRszTnLYke1My3tUF
         07LH6tcTz2c2CX3LDds0yu7k5LeZO8mi3Xs1B8NEhbf5U8XuO713vF8UKegIVWbRGkPo
         tTagkO4t7k+a8h23i2OXydHe/qLeHvgvYpA+CqIkGzxMbpDy6e8B8DwvEyHV88NA+Nsj
         Q4BA1MovO51sb5uLAa5vKGi6o9qcZtZHNCDpjxPBBWlmzHA3R6NyeKfMwsWrzPEt/TJp
         j0nwnTCn+yOhFyHjujJ70n+JvuUyTED5o59t9ykYnNKsg0CxJZDewB8vVRxgmIuSnxjV
         s1pQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688195932; x=1690787932;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=VZN0HVDL3v266tIzCxp1Au3MTDvSJDRQFEKwXgYQOKg=;
        b=VubMhGoR5sLZvesgzl4NarPaQ/FN3m/9Ro3fsTcfH9VZIOAUaDfpAaTlMyzFdb4bUE
         jHTWLBJ+EglgrN+ywNYnHLZp/I1WUeeHwTaLPPQlE9qLZUBaeR7rPhnMptdQs5J9OP0I
         ctLwZP3wu4mNUj6XoieFG1OFBQKSypjbM1ATxcUMpPVmiqyWjQ0nfxzvH7HB0VHTA5ig
         lpjfJw07/b208Ihl+ooGo0RDN559iDHopA3OceklifHGVmdJN5e/Rn8DdczxfcUHZCrc
         9gY7wQOTQp+4RWiEd66UzWXQ9i4ckRJZ2krAbS8RtiQ0VL0SGvsKvLP3VF5MWgi0gKcH
         V2Cw==
X-Gm-Message-State: AC+VfDy+lc/itCuWmyEOHDFBaXpfU3u0BBxTctuPhW9LchB7LWG+ZGhv
	mHlWjBNg6/X+t4Tth3KTGWq2QnZYTaA=
X-Google-Smtp-Source: ACHHUZ6n2a0BgJsHOuyBxhZoYcbAmTWwBgBp7Scj2tR+LuLllrO5p7qgwk+xteUe1+RZDeaLy+AScQ==
X-Received: by 2002:a05:6a20:448:b0:126:a5e3:3938 with SMTP id b8-20020a056a20044800b00126a5e33938mr4329586pzb.19.1688195931673;
        Sat, 01 Jul 2023 00:18:51 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 03/10] x86 setup: change bootstrap map to accept new boot module structures
Date: Sat,  1 Jul 2023 00:18:28 -0700
Message-Id: <20230701071835.41599-4-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701071835.41599-1-christopher.w.clark@gmail.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

To convert the x86 boot logic from multiboot to boot module structures,
change the bootstrap map function to accept a boot module parameter.

To allow incremental change from multiboot to boot modules across all
x86 setup logic, provide a temporary inline wrapper that still accepts a
multiboot module parameter and use it where necessary. The wrapper is
placed in a new arch/x86 header <asm/boot.h> to avoid putting a static
inline function into an existing header that has no such functions
already. This new header will be expanded with additional functions in
subsequent patches in this series.

No functional change intended.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

---
A new patch so v1 series patch 3 can be implemented incrementally
instead.

 xen/arch/x86/cpu/microcode/core.c |  7 ++++---
 xen/arch/x86/hvm/dom0_build.c     |  4 +++-
 xen/arch/x86/include/asm/boot.h   | 32 +++++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/setup.h  |  3 ++-
 xen/arch/x86/pv/dom0_build.c      |  3 ++-
 xen/arch/x86/setup.c              | 18 +++++++++--------
 xen/include/xen/bootinfo.h        |  3 +++
 xen/xsm/xsm_policy.c              |  3 ++-
 8 files changed, 58 insertions(+), 15 deletions(-)
 create mode 100644 xen/arch/x86/include/asm/boot.h

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index c3fee62906..ce3c8042a2 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -34,6 +34,7 @@
 #include <xen/watchdog.h>
 
 #include <asm/apic.h>
+#include <asm/boot.h>
 #include <asm/cpu-policy.h>
 #include <asm/delay.h>
 #include <asm/nmi.h>
@@ -180,7 +181,7 @@ void __init microcode_scan_module(
         if ( !test_bit(i, module_map) )
             continue;
 
-        _blob_start = bootstrap_map(&mod[i]);
+        _blob_start = bootstrap_map_multiboot(&mod[i]);
         _blob_size = mod[i].mod_end;
         if ( !_blob_start )
         {
@@ -798,7 +799,7 @@ int __init microcode_init_cache(unsigned long *module_map,
         microcode_scan_module(module_map, mbi);
 
     if ( ucode_mod.mod_end )
-        rc = early_update_cache(bootstrap_map(&ucode_mod),
+        rc = early_update_cache(bootstrap_map_multiboot(&ucode_mod),
                                 ucode_mod.mod_end);
     else if ( ucode_blob.size )
         rc = early_update_cache(ucode_blob.data, ucode_blob.size);
@@ -821,7 +822,7 @@ static int __init early_microcode_update_cpu(void)
     else if ( ucode_mod.mod_end )
     {
         len = ucode_mod.mod_end;
-        data = bootstrap_map(&ucode_mod);
+        data = bootstrap_map_multiboot(&ucode_mod);
     }
 
     if ( !data )
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index bf08998862..56fe89632b 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -16,6 +16,7 @@
 
 #include <acpi/actables.h>
 
+#include <asm/boot.h>
 #include <asm/bzimage.h>
 #include <asm/dom0_build.h>
 #include <asm/hvm/support.h>
@@ -1208,7 +1209,8 @@ int __init dom0_construct_pvh(struct domain *d, const module_t *image,
         return rc;
     }
 
-    rc = pvh_load_kernel(d, image, image_headroom, initrd, bootstrap_map(image),
+    rc = pvh_load_kernel(d, image, image_headroom, initrd,
+                         bootstrap_map_multiboot(image),
                          cmdline, &entry, &start_info);
     if ( rc )
     {
diff --git a/xen/arch/x86/include/asm/boot.h b/xen/arch/x86/include/asm/boot.h
new file mode 100644
index 0000000000..10b17f12b2
--- /dev/null
+++ b/xen/arch/x86/include/asm/boot.h
@@ -0,0 +1,32 @@
+#ifndef __ASM_X86_BOOT_H__
+#define __ASM_X86_BOOT_H__
+
+#include <xen/bootinfo.h>
+#include <xen/multiboot.h>
+
+#include <asm/setup.h>
+
+static inline void *bootstrap_map_multiboot(const module_t *mod)
+{
+    struct boot_module bm;
+
+    if ( !mod )
+        return bootstrap_map(NULL);
+
+    bm.start = mod->mod_start << PAGE_SHIFT;
+    bm.size = mod->mod_end;
+
+    return bootstrap_map(&bm);
+}
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index ae0dd3915a..80d0bb2a21 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -1,6 +1,7 @@
 #ifndef __X86_SETUP_H_
 #define __X86_SETUP_H_
 
+#include <xen/bootinfo.h>
 #include <xen/multiboot.h>
 #include <asm/numa.h>
 
@@ -40,7 +41,7 @@ void setup_io_bitmap(struct domain *d);
 
 unsigned long initial_images_nrpages(nodeid_t node);
 void discard_initial_images(void);
-void *bootstrap_map(const module_t *mod);
+void *bootstrap_map(const struct boot_module *mod);
 
 int xen_in_range(unsigned long mfn);
 
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index 6ed9f8bbed..4fe806b60d 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -14,6 +14,7 @@
 #include <xen/sched.h>
 #include <xen/softirq.h>
 
+#include <asm/boot.h>
 #include <asm/bzimage.h>
 #include <asm/dom0_build.h>
 #include <asm/guest.h>
@@ -374,7 +375,7 @@ int __init dom0_construct_pv(struct domain *d,
     unsigned int flush_flags = 0;
     start_info_t *si;
     struct vcpu *v = d->vcpu[0];
-    void *image_base = bootstrap_map(image);
+    void *image_base = bootstrap_map_multiboot(image);
     unsigned long image_len = image->mod_end;
     void *image_start = image_base + image_headroom;
     unsigned long initrd_len = initrd ? initrd->mod_end : 0;
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index c0e8fc6ab7..3b623a4149 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -32,6 +32,7 @@
 #include <compat/xen.h>
 #endif
 #include <xen/bitops.h>
+#include <asm/boot.h>
 #include <asm/smp.h>
 #include <asm/processor.h>
 #include <asm/mpspec.h>
@@ -405,14 +406,14 @@ static void __init normalise_cpu_order(void)
  * Ensure a given physical memory range is present in the bootstrap mappings.
  * Use superpage mappings to ensure that pagetable memory needn't be allocated.
  */
-void *__init bootstrap_map(const module_t *mod)
+void *__init bootstrap_map(const struct boot_module *mod)
 {
     static unsigned long __initdata map_cur = BOOTSTRAP_MAP_BASE;
     uint64_t start, end, mask = (1L << L2_PAGETABLE_SHIFT) - 1;
     void *ret;
 
     if ( system_state != SYS_STATE_early_boot )
-        return mod ? mfn_to_virt(mod->mod_start) : NULL;
+        return mod ? maddr_to_virt(mod->start) : NULL;
 
     if ( !mod )
     {
@@ -421,8 +422,8 @@ void *__init bootstrap_map(const module_t *mod)
         return NULL;
     }
 
-    start = (uint64_t)mod->mod_start << PAGE_SHIFT;
-    end = start + mod->mod_end;
+    start = (uint64_t)mod->start;
+    end = start + mod->size;
     if ( start >= end )
         return NULL;
 
@@ -460,7 +461,7 @@ static void __init move_memory(
         if ( mod.mod_end > blksz )
             mod.mod_end = blksz;
         sz = mod.mod_end - soffs;
-        s = bootstrap_map(&mod);
+        s = bootstrap_map_multiboot(&mod);
 
         mod.mod_start = (dst - doffs) >> PAGE_SHIFT;
         mod.mod_end = doffs + size;
@@ -468,7 +469,7 @@ static void __init move_memory(
             mod.mod_end = blksz;
         if ( sz > mod.mod_end - doffs )
             sz = mod.mod_end - doffs;
-        d = bootstrap_map(&mod);
+        d = bootstrap_map_multiboot(&mod);
 
         memmove(d + doffs, s + soffs, sz);
 
@@ -1360,8 +1361,9 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         mod[boot_info->nr_mods].mod_end = __2M_rwdata_end - _stext;
     }
 
-    boot_info->mods[0].arch->headroom = bzimage_headroom(bootstrap_map(mod),
-                                                         mod->mod_end);
+    boot_info->mods[0].arch->headroom =
+        bzimage_headroom(bootstrap_map_multiboot(mod), mod->mod_end);
+
     bootstrap_map(NULL);
 
 #ifndef highmem_start
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
index b72ae31a66..eb93cc3439 100644
--- a/xen/include/xen/bootinfo.h
+++ b/xen/include/xen/bootinfo.h
@@ -10,6 +10,9 @@
 #endif
 
 struct boot_module {
+    paddr_t start;
+    size_t size;
+
     struct arch_bootmodule *arch;
 };
 
diff --git a/xen/xsm/xsm_policy.c b/xen/xsm/xsm_policy.c
index 8dafbc9381..c6df8c6e06 100644
--- a/xen/xsm/xsm_policy.c
+++ b/xen/xsm/xsm_policy.c
@@ -20,6 +20,7 @@
 
 #include <xsm/xsm.h>
 #ifdef CONFIG_MULTIBOOT
+#include <asm/boot.h>
 #include <xen/multiboot.h>
 #include <asm/setup.h>
 #endif
@@ -49,7 +50,7 @@ int __init xsm_multiboot_policy_init(
         if ( !test_bit(i, module_map) )
             continue;
 
-        _policy_start = bootstrap_map(mod + i);
+        _policy_start = bootstrap_map_multiboot(mod + i);
         _policy_len   = mod[i].mod_end;
 
         if ( (xsm_magic_t)(*_policy_start) == XSM_MAGIC )
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 07:18:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 07:18:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557770.871390 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUsf-0006O8-Of; Sat, 01 Jul 2023 07:18:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557770.871390; Sat, 01 Jul 2023 07:18:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUsf-0006O0-M3; Sat, 01 Jul 2023 07:18:53 +0000
Received: by outflank-mailman (input) for mailman id 557770;
 Sat, 01 Jul 2023 07:18:52 +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
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFUse-0006No-R6
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 07:18:52 +0000
Received: from mail-oo1-xc36.google.com (mail-oo1-xc36.google.com
 [2607:f8b0:4864:20::c36])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8623aaef-17df-11ee-8611-37d641c3527e;
 Sat, 01 Jul 2023 09:18:50 +0200 (CEST)
Received: by mail-oo1-xc36.google.com with SMTP id
 006d021491bc7-563531a3ad2so1819281eaf.3
 for <xen-devel@lists.xenproject.org>; Sat, 01 Jul 2023 00:18:49 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s19-20020aa78d53000000b00673e652985bsm4108866pfe.118.2023.07.01.00.18.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 01 Jul 2023 00:18:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: 8623aaef-17df-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688195928; x=1690787928;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:sender:from:to:cc:subject:date:message-id:reply-to;
        bh=ABSe8iUEZJrWKb2OGgC8wK/SkYDq99binlaKCeSYzIU=;
        b=lzDAWFNXAQOVO2xfQSt/4scS4ox7fLA2WYLopAAQyu/0x9yO3TMIKfYk1isEqBDxG+
         zAZwPl4QnUrB5XT0dYkbbbSz+zED0N4B5iCihUu74p4q/XjU+aoHfhK850G7IB+idx5y
         ycwOGoGsq3FVMH2FD01k8IOjqq98IRDxRL1tHVPAAGPh1NSvERdyzwmbkouvbhA/iRfw
         hnXOITwbA9P9xf7wSZL8K4YRQAC+u+w/xzHF7C6SxOL9a9macuKeUxw94m6oBtkjjUpW
         XQNmpH5CeK7AVckC43dzWerbEmnvvmEUipEw26YuWX2ejnozPG48YDDmJA+Hi/qEpzmJ
         wyyw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688195928; x=1690787928;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:sender:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=ABSe8iUEZJrWKb2OGgC8wK/SkYDq99binlaKCeSYzIU=;
        b=Rpx3z3PMqA3hp2gPh4zERRwV1plJGjSKzTWMKEhQ6iJoTJ0Yvis+7mQoh2Xr2BDx61
         cjJbPIzwPWOKTxXuBkxvf0pyiYZluQ8PYozTBXuRktUZMrE55F3Zi4TL/EHgw9qQ1lNr
         YYwf1y06CUjK8LWbg8CKP+adqBGAQTsIUvDmUtVn5IvNh5KPnJI04xYhtSDxy3Qz/ZZB
         oPrXiu6RB7WFpqbtmCPwpqDku/gWvmKSWjfWv7Uy9HHni0Ol9PijYBJCnEEqwNuqnutr
         hqb0HlKf2wmgpq5P6CT+3yYoITwnpj9Rlb0yya2fgyxGFATMUNkU1y+DMi+yo0LzOIj6
         L94w==
X-Gm-Message-State: AC+VfDzCH0rM4vYNEVtgGXM2mWn+DRDlRqQpFc0nVTZb+ygZYOTU8zVI
	/P/K4/fv68qnc+FyXzp+RLZxWm6/X4s=
X-Google-Smtp-Source: ACHHUZ7uNpUH3+0thdIcpaMcrhVT8/LT4Op1Q5q6vaj1qAHh+k3kW0aBcpmrEciR+eMfvZAes1MNNw==
X-Received: by 2002:a05:6808:114d:b0:3a1:dfa0:7e18 with SMTP id u13-20020a056808114d00b003a1dfa07e18mr6835840oiu.25.1688195928151;
        Sat, 01 Jul 2023 00:18:48 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 00/10] v3: Boot modules for Hyperlaunch
Date: Sat,  1 Jul 2023 00:18:25 -0700
Message-Id: <20230701071835.41599-1-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This is a v3 series of work for Hyperlaunch for the Xen hypervisor,
an update to v2 and implementing a subset of the v1 series and functionality,
with changes made to address the community feedback provided on the patches.
Changes since the earlier versions of the series are described below.

The patches in this series are primarily derived from patches 2-4 of the
v1 full series, in a series of smaller patches for ease of review.

Thanks to AMD for supporting this work.

Documentation on Hyperlaunch:
https://wiki.xenproject.org/wiki/Hyperlaunch

v1 Hyperlaunch patch series:
https://lists.xenproject.org/archives/html/xen-devel/2022-07/msg00345.html

thanks

Christopher

Changes since v2:
- combined v2 patches 7 and 8 for common review
- rebased the v2 series onto the current tip of staging (sorry)
- fixed the placement of the patch changelogs
- provided the changes description in the cover letter

Changes since v1:
- the v2 and v3 series implement functionality from v1 patches 2-4
    - v2 series objective is to enable efficient patch review in support
      of merging the functionality into the hypervisor. It implements a
      subset of the v1 series, incorporating changes from community
      feedback.
- the bootstrap map is made accessible early in the v2 series via both
  multiboot and boot module arguments until later in the series where
  multiboot use is retired. This allows for incremental conversion across
  several patches from multiboot to boot modules.
- the 32-bit x86 boot environment header is removed, and changes are
  made to allow the new common bootinfo headers to be used instead.
- Arm and RISC-V architecture bootinfo headers are added to ensure that
  builds on those architectures can complete correctly.
- The KConfig patch to set the maximum number of boot modules allowed
  is not included in this series, replaced with a static maximum define.

Christopher Clark (10):
  x86 setup: move x86 boot module counting into a new boot_info struct
  x86 setup: per-arch bootmodule structure, headroom field
  x86 setup: change bootstrap map to accept new boot module structures
  x86 setup: porting dom0 construction logic to boot module structures
  xsm: switch XSM init to boot info structures
  x86 setup, microcode: switch to the new bootinfo structures
  x86 boot: define paddr_t and add macros for typedefing struct pointers
  x86, arm, riscv: add per-arch bootinfo headers
  arm setup: use common integer-typed bootmod definition
  x86 setup: refactor efi, pvh and multiboot entrypoints to new boot
    info

 xen/arch/arm/efi/efi-boot.h               |   6 +
 xen/arch/arm/include/asm/bootinfo.h       |  20 ++
 xen/arch/arm/include/asm/setup.h          |  11 +-
 xen/arch/riscv/include/asm/bootinfo.h     |  20 ++
 xen/arch/x86/boot/defs.h                  |  10 +
 xen/arch/x86/boot/reloc.c                 | 192 ++++++++++++------
 xen/arch/x86/bzimage.c                    |  10 +-
 xen/arch/x86/cpu/microcode/core.c         | 149 ++++++++------
 xen/arch/x86/dom0_build.c                 |  10 +-
 xen/arch/x86/efi/efi-boot.h               |  95 +++++----
 xen/arch/x86/guest/xen/pvh-boot.c         |  65 ++++--
 xen/arch/x86/hvm/dom0_build.c             |  44 ++--
 xen/arch/x86/include/asm/boot.h           |  55 +++++
 xen/arch/x86/include/asm/bootinfo.h       |  47 +++++
 xen/arch/x86/include/asm/bzimage.h        |   2 +-
 xen/arch/x86/include/asm/dom0_build.h     |  13 +-
 xen/arch/x86/include/asm/guest/pvh-boot.h |   6 +-
 xen/arch/x86/include/asm/microcode.h      |   7 +-
 xen/arch/x86/include/asm/setup.h          |   7 +-
 xen/arch/x86/pv/dom0_build.c              |  32 +--
 xen/arch/x86/setup.c                      | 232 ++++++++++++----------
 xen/common/efi/boot.c                     |   4 +-
 xen/include/xen/bootinfo.h                |  62 ++++++
 xen/include/xen/types.h                   |  11 +
 xen/include/xsm/xsm.h                     |  28 +--
 xen/xsm/xsm_core.c                        |  47 +++--
 xen/xsm/xsm_policy.c                      |  58 +++---
 27 files changed, 821 insertions(+), 422 deletions(-)
 create mode 100644 xen/arch/arm/include/asm/bootinfo.h
 create mode 100644 xen/arch/riscv/include/asm/bootinfo.h
 create mode 100644 xen/arch/x86/include/asm/boot.h
 create mode 100644 xen/arch/x86/include/asm/bootinfo.h
 create mode 100644 xen/include/xen/bootinfo.h

-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 07:18:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 07:18:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557771.871399 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUsg-0006cx-Va; Sat, 01 Jul 2023 07:18:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557771.871399; Sat, 01 Jul 2023 07:18:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUsg-0006cq-T3; Sat, 01 Jul 2023 07:18:54 +0000
Received: by outflank-mailman (input) for mailman id 557771;
 Sat, 01 Jul 2023 07:18:53 +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
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFUsf-0006No-Gx
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 07:18:53 +0000
Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com
 [2607:f8b0:4864:20::22e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 86e20dce-17df-11ee-8611-37d641c3527e;
 Sat, 01 Jul 2023 09:18:51 +0200 (CEST)
Received: by mail-oi1-x22e.google.com with SMTP id
 5614622812f47-3a1d9b64837so2114109b6e.0
 for <xen-devel@lists.xenproject.org>; Sat, 01 Jul 2023 00:18:51 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s19-20020aa78d53000000b00673e652985bsm4108866pfe.118.2023.07.01.00.18.48
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 01 Jul 2023 00:18:48 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: 86e20dce-17df-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688195929; x=1690787929;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=4c9WAF4kmb19tJcbTDjvohxu3kd3fgp5qdmTKmSCTJE=;
        b=CrY0CL1mRL0QPuwcnmaQkblnBE5P1R9sxQMKRcx7enujbSgBR6HAPycMDb2gS1AY4c
         GSMdg9Ho2X7dHe+o+SmkXoOa4APm8vLJjz8ed+7vxoyBsabHF/6zFJRtNNnBW4mZqgs0
         /Kh9Zwyvg3GVC2GvbUXvWfC+Zl6imp1Dt83c7Gz7W64GM7H2PsLp9Qawd4CWiMdGbfJ+
         4ZpLlj4Ud3KBQNyr/lOBs7ci3hfKCUjakzYDIIoGJTg8cCPtn9eEPJMUhg1WXlHQsVCH
         55FvRh0m8bfNjA2aTWhCErJlfX/ZnGxZaK4J45t8b1wnqNp9Gr9qRZ6PvA6RDY+LPK40
         MFzw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688195929; x=1690787929;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=4c9WAF4kmb19tJcbTDjvohxu3kd3fgp5qdmTKmSCTJE=;
        b=SR70FPibjtK197iqGpuAocUm0X2cDizdg/b5smcuB/qjgWHuBK4bf5+aS2eY0Lylm+
         tiJArrRTZpqAyauRqBFksKgcXP+gaI7OqOvuG5Gc7tqdP+utbVkifE3QwEuDA0ENiT9c
         1sLdARp4psY5vz14g6eXO0L3YFG13DaQHt887/9OqaoFEZqbRQo80OgXw24onADATt7G
         Bx7eZjln+wMmetrJJ0ovP86NDofQ+2C8LG1JBqVthUBx7VPhiW6ZHuF4uS/QkVG9r95F
         qgO5o6RfCW4pNvMc5+iqN1E9zKj0dbGez4k5Upe5hoCB7aMjeyna7+qF1TCknygWHq2n
         pjJw==
X-Gm-Message-State: AC+VfDyiX59a5d3b9UJhgPXVnpUgr2rMyZxbvCcIP9j1ob5yiDOH8HQ5
	HFYikFMPxGKhnj1eONz4J7MPV9m1Cyc=
X-Google-Smtp-Source: ACHHUZ5mpapv9SYTUsV6xBXMbudnVg/NReuMAxR+qtoCnfL+g9iPwcEvsPkpPiGylED5la1TTi9fsw==
X-Received: by 2002:a05:6808:1b0c:b0:3a1:b309:a409 with SMTP id bx12-20020a0568081b0c00b003a1b309a409mr6482050oib.4.1688195929359;
        Sat, 01 Jul 2023 00:18:49 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 01/10] x86 setup: move x86 boot module counting into a new boot_info struct
Date: Sat,  1 Jul 2023 00:18:26 -0700
Message-Id: <20230701071835.41599-2-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701071835.41599-1-christopher.w.clark@gmail.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

An initial step towards a non-multiboot internal representation of boot
modules for common code, starting with x86 setup and converting the
fields that are accessed for the startup calculations.

Introduce a new header, <xen/bootinfo.h>, and populate it with a new
boot_info structure initially containing a count of the number of boot
modules.

The naming of the header, structure and fields is intended to respect
the boot structures on Arm -- see arm/include/asm/setup.h -- as part of
work towards aligning common architecture-neutral boot logic and
structures.

No functional change intended.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

---
Changes since v1: patch is a subset of v1 series patches 2 and 3.

 xen/arch/x86/setup.c       | 58 +++++++++++++++++++++++---------------
 xen/include/xen/bootinfo.h | 20 +++++++++++++
 2 files changed, 55 insertions(+), 23 deletions(-)
 create mode 100644 xen/include/xen/bootinfo.h

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 74e3915a4d..708639b236 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1,3 +1,4 @@
+#include <xen/bootinfo.h>
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/err.h>
@@ -268,7 +269,16 @@ static int __init cf_check parse_acpi_param(const char *s)
 custom_param("acpi", parse_acpi_param);
 
 static const module_t *__initdata initial_images;
-static unsigned int __initdata nr_initial_images;
+static struct boot_info __initdata *boot_info;
+
+static void __init multiboot_to_bootinfo(multiboot_info_t *mbi)
+{
+    static struct boot_info __initdata info;
+
+    info.nr_mods = mbi->mods_count;
+
+    boot_info = &info;
+}
 
 unsigned long __init initial_images_nrpages(nodeid_t node)
 {
@@ -277,7 +287,7 @@ unsigned long __init initial_images_nrpages(nodeid_t node)
     unsigned long nr;
     unsigned int i;
 
-    for ( nr = i = 0; i < nr_initial_images; ++i )
+    for ( nr = i = 0; i < boot_info->nr_mods; ++i )
     {
         unsigned long start = initial_images[i].mod_start;
         unsigned long end = start + PFN_UP(initial_images[i].mod_end);
@@ -293,7 +303,7 @@ void __init discard_initial_images(void)
 {
     unsigned int i;
 
-    for ( i = 0; i < nr_initial_images; ++i )
+    for ( i = 0; i < boot_info->nr_mods; ++i )
     {
         uint64_t start = (uint64_t)initial_images[i].mod_start << PAGE_SHIFT;
 
@@ -301,7 +311,7 @@ void __init discard_initial_images(void)
                            start + PAGE_ALIGN(initial_images[i].mod_end));
     }
 
-    nr_initial_images = 0;
+    boot_info->nr_mods = 0;
     initial_images = NULL;
 }
 
@@ -1020,6 +1030,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         mod = __va(mbi->mods_addr);
     }
 
+    multiboot_to_bootinfo(mbi);
+
     loader = (mbi->flags & MBI_LOADERNAME)
         ? (char *)__va(mbi->boot_loader_name) : "unknown";
 
@@ -1127,18 +1139,18 @@ void __init noreturn __start_xen(unsigned long mbi_p)
            bootsym(boot_edd_info_nr));
 
     /* Check that we have at least one Multiboot module. */
-    if ( !(mbi->flags & MBI_MODULES) || (mbi->mods_count == 0) )
+    if ( !(mbi->flags & MBI_MODULES) || (boot_info->nr_mods == 0) )
         panic("dom0 kernel not specified. Check bootloader configuration\n");
 
     /* Check that we don't have a silly number of modules. */
-    if ( mbi->mods_count > sizeof(module_map) * 8 )
+    if ( boot_info->nr_mods > sizeof(module_map) * 8 )
     {
-        mbi->mods_count = sizeof(module_map) * 8;
+        boot_info->nr_mods = sizeof(module_map) * 8;
         printk("Excessive multiboot modules - using the first %u only\n",
-               mbi->mods_count);
+               boot_info->nr_mods);
     }
 
-    bitmap_fill(module_map, mbi->mods_count);
+    bitmap_fill(module_map, boot_info->nr_mods);
     __clear_bit(0, module_map); /* Dom0 kernel is always first */
 
     if ( pvh_boot )
@@ -1311,9 +1323,9 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     kexec_reserve_area(&boot_e820);
 
     initial_images = mod;
-    nr_initial_images = mbi->mods_count;
+    boot_info->nr_mods = boot_info->nr_mods;
 
-    for ( i = 0; !efi_enabled(EFI_LOADER) && i < mbi->mods_count; i++ )
+    for ( i = 0; !efi_enabled(EFI_LOADER) && i < boot_info->nr_mods; i++ )
     {
         if ( mod[i].mod_start & (PAGE_SIZE - 1) )
             panic("Bootloader didn't honor module alignment request\n");
@@ -1337,8 +1349,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
          * respective reserve_e820_ram() invocation below. No need to
          * query efi_boot_mem_unused() here, though.
          */
-        mod[mbi->mods_count].mod_start = virt_to_mfn(_stext);
-        mod[mbi->mods_count].mod_end = __2M_rwdata_end - _stext;
+        mod[boot_info->nr_mods].mod_start = virt_to_mfn(_stext);
+        mod[boot_info->nr_mods].mod_end = __2M_rwdata_end - _stext;
     }
 
     modules_headroom = bzimage_headroom(bootstrap_map(mod), mod->mod_end);
@@ -1398,7 +1410,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         {
             /* Don't overlap with modules. */
             end = consider_modules(s, e, reloc_size + mask,
-                                   mod, mbi->mods_count, -1);
+                                   mod, boot_info->nr_mods, -1);
             end &= ~mask;
         }
         else
@@ -1419,7 +1431,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         }
 
         /* Is the region suitable for relocating the multiboot modules? */
-        for ( j = mbi->mods_count - 1; j >= 0; j-- )
+        for ( j = boot_info->nr_mods - 1; j >= 0; j-- )
         {
             unsigned long headroom = j ? 0 : modules_headroom;
             unsigned long size = PAGE_ALIGN(headroom + mod[j].mod_end);
@@ -1429,7 +1441,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
             /* Don't overlap with other modules (or Xen itself). */
             end = consider_modules(s, e, size, mod,
-                                   mbi->mods_count + relocated, j);
+                                   boot_info->nr_mods + relocated, j);
 
             if ( highmem_start && end > highmem_start )
                 continue;
@@ -1456,7 +1468,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         {
             /* Don't overlap with modules (or Xen itself). */
             e = consider_modules(s, e, PAGE_ALIGN(kexec_crash_area.size), mod,
-                                 mbi->mods_count + relocated, -1);
+                                 boot_info->nr_mods + relocated, -1);
             if ( s >= e )
                 break;
             if ( e > kexec_crash_area_limit )
@@ -1471,7 +1483,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     if ( modules_headroom && !mod->reserved )
         panic("Not enough memory to relocate the dom0 kernel image\n");
-    for ( i = 0; i < mbi->mods_count; ++i )
+    for ( i = 0; i < boot_info->nr_mods; ++i )
     {
         uint64_t s = (uint64_t)mod[i].mod_start << PAGE_SHIFT;
 
@@ -1540,7 +1552,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
                     ASSERT(j);
                 }
                 map_e = boot_e820.map[j].addr + boot_e820.map[j].size;
-                for ( j = 0; j < mbi->mods_count; ++j )
+                for ( j = 0; j < boot_info->nr_mods; ++j )
                 {
                     uint64_t end = pfn_to_paddr(mod[j].mod_start) +
                                    mod[j].mod_end;
@@ -1616,7 +1628,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         }
     }
 
-    for ( i = 0; i < mbi->mods_count; ++i )
+    for ( i = 0; i < boot_info->nr_mods; ++i )
     {
         set_pdx_range(mod[i].mod_start,
                       mod[i].mod_start + PFN_UP(mod[i].mod_end));
@@ -1999,8 +2011,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
            cpu_has_nx ? XENLOG_INFO : XENLOG_WARNING "Warning: ",
            cpu_has_nx ? "" : "not ");
 
-    initrdidx = find_first_bit(module_map, mbi->mods_count);
-    if ( bitmap_weight(module_map, mbi->mods_count) > 1 )
+    initrdidx = find_first_bit(module_map, boot_info->nr_mods);
+    if ( bitmap_weight(module_map, boot_info->nr_mods) > 1 )
         printk(XENLOG_WARNING
                "Multiple initrd candidates, picking module #%u\n",
                initrdidx);
@@ -2010,7 +2022,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
      * above our heap. The second module, if present, is an initrd ramdisk.
      */
     dom0 = create_dom0(mod, modules_headroom,
-                       initrdidx < mbi->mods_count ? mod + initrdidx : NULL,
+                       initrdidx < boot_info->nr_mods ? mod + initrdidx : NULL,
                        kextra, loader);
     if ( !dom0 )
         panic("Could not set up DOM0 guest OS\n");
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
new file mode 100644
index 0000000000..6a7d55d20e
--- /dev/null
+++ b/xen/include/xen/bootinfo.h
@@ -0,0 +1,20 @@
+#ifndef __XEN_BOOTINFO_H__
+#define __XEN_BOOTINFO_H__
+
+#include <xen/types.h>
+
+struct boot_info {
+    unsigned int nr_mods;
+};
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 07:18:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 07:18:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557772.871410 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUsi-0006sV-Cc; Sat, 01 Jul 2023 07:18:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557772.871410; Sat, 01 Jul 2023 07:18:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUsi-0006sI-9F; Sat, 01 Jul 2023 07:18:56 +0000
Received: by outflank-mailman (input) for mailman id 557772;
 Sat, 01 Jul 2023 07:18:54 +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
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFUsg-0006No-Gx
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 07:18:54 +0000
Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com
 [2607:f8b0:4864:20::434])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 87ad859c-17df-11ee-8611-37d641c3527e;
 Sat, 01 Jul 2023 09:18:52 +0200 (CEST)
Received: by mail-pf1-x434.google.com with SMTP id
 d2e1a72fcca58-6687446eaccso2060682b3a.3
 for <xen-devel@lists.xenproject.org>; Sat, 01 Jul 2023 00:18:52 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s19-20020aa78d53000000b00673e652985bsm4108866pfe.118.2023.07.01.00.18.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 01 Jul 2023 00:18:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: 87ad859c-17df-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688195930; x=1690787930;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Y6HSin/PPuTe3wUBWgklxdNFxDnMlcE+0e39paE0fXc=;
        b=rsJIkClYspba3EEC1R7kK3NAtOk5jq9qbQKs6V3a1+OyaOU9EdE4lyaLRwCxYjjR5y
         waqpW/joeTxkdrxBi10PoK/AZjaG5MFU0TAC4LNcWBKn/PdHFbpAAomjyxPEv6v8d6Wc
         My/L3c/7RcgdXVx8B4gdBlsXxc3Kyv5vQA3JMgm+XixOc9HLxFkHCAmkV/0cvQs3bmfF
         deiblMs2mJRWQ7elSOZskM4iJObW2t7Xd8DwX7/zQtYw3KUtyw9NnAup3AVYAzNlHXKQ
         eX9C1FZmaQKqFUMAAfRY08tDeXn8UUqcTPaQmf6U/vydMK1vxc+SUhlED09efS3rWVsM
         a/eQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688195930; x=1690787930;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=Y6HSin/PPuTe3wUBWgklxdNFxDnMlcE+0e39paE0fXc=;
        b=E/UuqHWhozUqX7eS/KnX0J7d5LjhTtQfG+MHTtD8xQpvICPYsOrN1EjbdotvgZFLyz
         frB2sMfEr5L896R7go33msGrw2Ge4XJuGZ18nC4f98Ft66gDNEEaSzS4+33ziKhRaeQd
         VOFonzS0pHphu3y8JY/LwKX8cOzMtBZnFR59HmVCLUCIZ2fydoGyjtOTkXuYe38K9KHS
         qco0w9MHe5vpG/KckdRI935qgkRXpCj+5IXCw3gGXAeki2SS5By/lSiMMqg/IlDWMFiI
         Rr9tp1YMgWZ4lYA9zQ37X+fChUb0jFWPOhxO9ZSqYUifEkmtyh5gjRxveh+/WvO01/cp
         MSVw==
X-Gm-Message-State: ABy/qLaSAYxV1Qs7XMUcnRwz34tjvR57xcLzRBH1GF7b887T4SWpT/5K
	p6R4uNAq1WxwJi6vi6xuYmZm2seU060=
X-Google-Smtp-Source: APBJJlGazLVsxb16uFiIRgEsb22Vr4uL3fUVX8OBI0LxxvRLHfsnva3PurQ+L5rtOrS/CANPnVhzgw==
X-Received: by 2002:a05:6a00:24c9:b0:682:37be:c9fe with SMTP id d9-20020a056a0024c900b0068237bec9femr6300448pfv.10.1688195930443;
        Sat, 01 Jul 2023 00:18:50 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 02/10] x86 setup: per-arch bootmodule structure, headroom field
Date: Sat,  1 Jul 2023 00:18:27 -0700
Message-Id: <20230701071835.41599-3-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701071835.41599-1-christopher.w.clark@gmail.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Next step in incremental work towards adding a non-multiboot internal
representation of boot modules, converting the fields being accessed for
the startup calculations.

Add a new array of structs for per-boot-module state, though only
allocate space for a single array entry in this change since that is all
that is required for functionality modified in this patch: moving the
headroom field for the image decompression calculation into a new
per-arch boot module struct and then using it in x86 dom0 construction.

Introduces a per-arch header for x86 for arch-specific boot module
structures, and add a member to the common boot module structure for
access to it.

No functional change intended.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

---
Changes since v1: patch is a subset of v1 series patches 2 and 3.

 xen/arch/x86/bzimage.c              | 10 +++++-----
 xen/arch/x86/hvm/dom0_build.c       |  3 ++-
 xen/arch/x86/include/asm/bootinfo.h | 18 ++++++++++++++++++
 xen/arch/x86/include/asm/bzimage.h  |  2 +-
 xen/arch/x86/pv/dom0_build.c        |  3 ++-
 xen/arch/x86/setup.c                | 23 ++++++++++++++++-------
 xen/include/xen/bootinfo.h          | 11 +++++++++++
 7 files changed, 55 insertions(+), 15 deletions(-)
 create mode 100644 xen/arch/x86/include/asm/bootinfo.h

diff --git a/xen/arch/x86/bzimage.c b/xen/arch/x86/bzimage.c
index ac4fd428be..dac2399b89 100644
--- a/xen/arch/x86/bzimage.c
+++ b/xen/arch/x86/bzimage.c
@@ -69,8 +69,6 @@ static __init int bzimage_check(struct setup_header *hdr, unsigned long len)
     return 1;
 }
 
-static unsigned long __initdata orig_image_len;
-
 unsigned long __init bzimage_headroom(void *image_start,
                                       unsigned long image_length)
 {
@@ -91,7 +89,6 @@ unsigned long __init bzimage_headroom(void *image_start,
     if ( elf_is_elfbinary(image_start, image_length) )
         return 0;
 
-    orig_image_len = image_length;
     headroom = output_length(image_start, image_length);
     if (gzip_check(image_start, image_length))
     {
@@ -105,11 +102,14 @@ unsigned long __init bzimage_headroom(void *image_start,
 }
 
 int __init bzimage_parse(void *image_base, void **image_start,
+                         unsigned int headroom,
                          unsigned long *image_len)
 {
     struct setup_header *hdr = (struct setup_header *)(*image_start);
     int err = bzimage_check(hdr, *image_len);
-    unsigned long output_len;
+    unsigned long output_len, orig_image_len;
+
+    orig_image_len = *image_len - headroom;
 
     if ( err < 0 )
         return err;
@@ -125,7 +125,7 @@ int __init bzimage_parse(void *image_base, void **image_start,
 
     BUG_ON(!(image_base < *image_start));
 
-    output_len = output_length(*image_start, orig_image_len);
+    output_len = output_length(*image_start, *image_len);
 
     if ( (err = perform_gunzip(image_base, *image_start, orig_image_len)) > 0 )
         err = decompress(*image_start, orig_image_len, image_base);
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index fd2cbf68bc..bf08998862 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -545,7 +545,8 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
     struct vcpu *v = d->vcpu[0];
     int rc;
 
-    if ( (rc = bzimage_parse(image_base, &image_start, &image_len)) != 0 )
+    if ( (rc = bzimage_parse(image_base, &image_start, image_headroom,
+                             &image_len)) != 0 )
     {
         printk("Error trying to detect bz compressed kernel\n");
         return rc;
diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
new file mode 100644
index 0000000000..a25054f372
--- /dev/null
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -0,0 +1,18 @@
+#ifndef __ARCH_X86_BOOTINFO_H__
+#define __ARCH_X86_BOOTINFO_H__
+
+struct arch_bootmodule {
+    unsigned headroom;
+};
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/include/asm/bzimage.h b/xen/arch/x86/include/asm/bzimage.h
index 7ed69d3910..dd784f32ef 100644
--- a/xen/arch/x86/include/asm/bzimage.h
+++ b/xen/arch/x86/include/asm/bzimage.h
@@ -5,7 +5,7 @@
 
 unsigned long bzimage_headroom(void *image_start, unsigned long image_length);
 
-int bzimage_parse(void *image_base, void **image_start,
+int bzimage_parse(void *image_base, void **image_start, unsigned int headroom,
                   unsigned long *image_len);
 
 #endif /* __X86_BZIMAGE_H__ */
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index c99135a552..6ed9f8bbed 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -416,7 +416,8 @@ int __init dom0_construct_pv(struct domain *d,
 
     d->max_pages = ~0U;
 
-    if ( (rc = bzimage_parse(image_base, &image_start, &image_len)) != 0 )
+    if ( (rc = bzimage_parse(image_base, &image_start, image_headroom,
+                             &image_len)) != 0 )
         return rc;
 
     if ( (rc = elf_init(&elf, image_start, image_len)) != 0 )
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 708639b236..c0e8fc6ab7 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -273,10 +273,16 @@ static struct boot_info __initdata *boot_info;
 
 static void __init multiboot_to_bootinfo(multiboot_info_t *mbi)
 {
-    static struct boot_info __initdata info;
+    static struct boot_info       __initdata info;
+    static struct boot_module     __initdata boot_mods[1];
+    static struct arch_bootmodule __initdata arch_boot_mods[1];
+
+    info.mods = boot_mods;
 
     info.nr_mods = mbi->mods_count;
 
+    boot_mods[0].arch = &arch_boot_mods[0];
+
     boot_info = &info;
 }
 
@@ -961,7 +967,8 @@ static struct domain *__init create_dom0(const module_t *image,
         write_cr4(read_cr4() & ~X86_CR4_SMAP);
     }
 
-    if ( construct_dom0(d, image, headroom, initrd, cmdline) != 0 )
+    if ( construct_dom0(d, image, boot_info->mods[0].arch->headroom, initrd,
+                        cmdline) != 0 )
         panic("Could not construct domain 0\n");
 
     if ( cpu_has_smap )
@@ -985,7 +992,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     unsigned int initrdidx, num_parked = 0;
     multiboot_info_t *mbi;
     module_t *mod;
-    unsigned long nr_pages, raw_max_page, modules_headroom, module_map[1];
+    unsigned long nr_pages, raw_max_page, module_map[1];
     int i, j, e820_warn = 0, bytes = 0;
     unsigned long eb_start, eb_end;
     bool acpi_boot_table_init_done = false, relocated = false;
@@ -1353,7 +1360,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         mod[boot_info->nr_mods].mod_end = __2M_rwdata_end - _stext;
     }
 
-    modules_headroom = bzimage_headroom(bootstrap_map(mod), mod->mod_end);
+    boot_info->mods[0].arch->headroom = bzimage_headroom(bootstrap_map(mod),
+                                                         mod->mod_end);
     bootstrap_map(NULL);
 
 #ifndef highmem_start
@@ -1433,7 +1441,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         /* Is the region suitable for relocating the multiboot modules? */
         for ( j = boot_info->nr_mods - 1; j >= 0; j-- )
         {
-            unsigned long headroom = j ? 0 : modules_headroom;
+            struct boot_module *boot_mods = boot_info->mods;
+            unsigned long headroom = j ? 0 : boot_mods[0].arch->headroom;
             unsigned long size = PAGE_ALIGN(headroom + mod[j].mod_end);
 
             if ( mod[j].reserved )
@@ -1481,7 +1490,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 #endif
     }
 
-    if ( modules_headroom && !mod->reserved )
+    if ( boot_info->mods[0].arch->headroom && !mod->reserved )
         panic("Not enough memory to relocate the dom0 kernel image\n");
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
@@ -2021,7 +2030,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
      * We're going to setup domain0 using the module(s) that we stashed safely
      * above our heap. The second module, if present, is an initrd ramdisk.
      */
-    dom0 = create_dom0(mod, modules_headroom,
+    dom0 = create_dom0(mod, boot_info->mods[0].arch->headroom,
                        initrdidx < boot_info->nr_mods ? mod + initrdidx : NULL,
                        kextra, loader);
     if ( !dom0 )
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
index 6a7d55d20e..b72ae31a66 100644
--- a/xen/include/xen/bootinfo.h
+++ b/xen/include/xen/bootinfo.h
@@ -3,8 +3,19 @@
 
 #include <xen/types.h>
 
+#ifdef CONFIG_X86
+#include <asm/bootinfo.h>
+#else
+    struct arch_bootmodule { };
+#endif
+
+struct boot_module {
+    struct arch_bootmodule *arch;
+};
+
 struct boot_info {
     unsigned int nr_mods;
+    struct boot_module *mods;
 };
 
 #endif
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 07:19:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 07:19:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557774.871430 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUsl-0007Re-Vg; Sat, 01 Jul 2023 07:18:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557774.871430; Sat, 01 Jul 2023 07:18:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUsl-0007RH-Q2; Sat, 01 Jul 2023 07:18:59 +0000
Received: by outflank-mailman (input) for mailman id 557774;
 Sat, 01 Jul 2023 07:18:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFUsj-00074A-Ev
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 07:18:57 +0000
Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com
 [2607:f8b0:4864:20::52e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 895951b8-17df-11ee-b237-6b7b168915f2;
 Sat, 01 Jul 2023 09:18:55 +0200 (CEST)
Received: by mail-pg1-x52e.google.com with SMTP id
 41be03b00d2f7-54290603887so1404339a12.1
 for <xen-devel@lists.xenproject.org>; Sat, 01 Jul 2023 00:18:55 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s19-20020aa78d53000000b00673e652985bsm4108866pfe.118.2023.07.01.00.18.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 01 Jul 2023 00:18:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: 895951b8-17df-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688195933; x=1690787933;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=VdOYeE2v8wd7pgUEWtK6DPA0Re6RRRDIL0/eXfCMrB4=;
        b=M26WsnkTZSOxTGNSkakaGyhkyNClmHwRJrKRp1N75lO7bD5GT6kPQALOP7zlWX7gKm
         I3KG2qmBZpmrOKz8R14XWa+tidHoDNawk/qGcYhzw/FJi3lqHtuZVKeWo47H+jfSHn5E
         XdU1+g2puyG9SktPWFJmJjYeZNpGQ155oZWd3UghsHDEyUDDiankrfReLoBSsfG4D8a7
         hFkpcBSo6jCP/SWCkH28CA4vtBSSpho+IqcadOHA8DkY5zXLdaiZUvOfGKu+ZChE+GIT
         TPcRE9N2VFQ+dq9Ou0ANf/E0ivSit7ow6HZv6spzaxuI/gregJW9UO5G9jpxRU7U1Oae
         IKeg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688195933; x=1690787933;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=VdOYeE2v8wd7pgUEWtK6DPA0Re6RRRDIL0/eXfCMrB4=;
        b=c/pwCAhKi7Nqn+jX5gS/jpyYfZC5hdtDKdZHPBp4jky+IllYOlgspCe7a9ypV8YLLg
         B4Y0A9Hm2bKX6Dz2YdVYl69LRMdAyDDsiKuwpzxU0GGpTTIGRFGHXdImi51dfbzPehpQ
         Wjv7hdrrIPFp3ihax1prkx4SprCvd2GlkTYZBCUKp6RzWBHyL1bXnHfOrVqf86GMaXrF
         aOGV0V/Y9hW5bzMeUlJ52QcZ8pu8Xz4ExMBMKbCp0572/wf9d8cB2K7ux5dh0au7z3ZS
         oTJ1GPuRZxqTuVkqJYI8mWK/tjI5WSevPivopuEOur+fjxCdhVmIiWes6rpgnxZkdf4e
         R1jw==
X-Gm-Message-State: ABy/qLb53kvM6pA0WLqbPI4/8bTijooSvHshTWVDRU9OT4IQEzei2x7f
	IXn6Wr3KyZ6EGeQSEPED9uNfhiKZk1Q=
X-Google-Smtp-Source: APBJJlF7jbiJpd/xcLRqHauN6U7/NRmIJP9XETRlf0zI9EMG4ip+NRTzFW0GrgaAnu8NEOSFJHXePg==
X-Received: by 2002:a05:6a00:190c:b0:682:1319:a169 with SMTP id y12-20020a056a00190c00b006821319a169mr4904419pfi.31.1688195933125;
        Sat, 01 Jul 2023 00:18:53 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 04/10] x86 setup: porting dom0 construction logic to boot module structures
Date: Sat,  1 Jul 2023 00:18:29 -0700
Message-Id: <20230701071835.41599-5-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701071835.41599-1-christopher.w.clark@gmail.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adjust the PV and PVH dom0 construction entry points to take boot module
structures as parameters, and add further fields to the boot module
structures to plumb the data needed to support this use. Populate these
from the multiboot module data.

This change removes multiboot from the PV and PVH dom0 construction logic.

Introduce and use new inline accessor functions for navigating the boot
module structures.

The per-boot-module arrays are expanded from singletons to accommodate
all modules, up to a static maximum of 64 modules including Xen that can
be accepted from a bootloader to match the previous value from the
module map check.

The field that identifies the type of a boot module (kernel, ramdisk,
etc) is introduced to the common boot module structure and declared as a
non-enum integer type to allow the field to be of a known-size and so
structure can be packed in a subsequent patch in the series, and it will
then be reconciled with the equivalent Arm boot field type.

The command line provided by multiboot for each boot module is added
directly to the boot_module structure, which is appropriate for this
logic just replacing multiboot.

The maximum number of boot modules that a bootloader can provide in
addition to the Xen hypervisor is preserved from prior logic with the
module_map at 63.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

---
Changes since v1: patch is a subset of v1 series patches 2 and 3.
- The module_map is kept for now since still in use.
- Move the static inline functions into a separate dedicated header.
- <mm-frame.h> and <compiler.h> replace prior inclusion of <mm.h>
  for simpler dependencies.

 xen/arch/x86/dom0_build.c             |  10 +-
 xen/arch/x86/hvm/dom0_build.c         |  43 +++---
 xen/arch/x86/include/asm/boot.h       |  36 +++++
 xen/arch/x86/include/asm/bootinfo.h   |  24 +++
 xen/arch/x86/include/asm/dom0_build.h |  13 +-
 xen/arch/x86/include/asm/setup.h      |   4 +-
 xen/arch/x86/pv/dom0_build.c          |  32 ++--
 xen/arch/x86/setup.c                  | 206 +++++++++++++++-----------
 xen/include/xen/bootinfo.h            |  27 ++++
 9 files changed, 254 insertions(+), 141 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 9f5300a3ef..42310202a2 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -4,6 +4,7 @@
  * Copyright (c) 2002-2005, K A Fraser
  */
 
+#include <xen/bootinfo.h>
 #include <xen/init.h>
 #include <xen/iocap.h>
 #include <xen/libelf.h>
@@ -562,9 +563,8 @@ int __init dom0_setup_permissions(struct domain *d)
     return rc;
 }
 
-int __init construct_dom0(struct domain *d, const module_t *image,
-                          unsigned long image_headroom, module_t *initrd,
-                          char *cmdline)
+int __init construct_dom0(struct domain *d, const struct boot_module *image,
+    struct boot_module *initrd, char *cmdline)
 {
     int rc;
 
@@ -576,9 +576,9 @@ int __init construct_dom0(struct domain *d, const module_t *image,
     process_pending_softirqs();
 
     if ( is_hvm_domain(d) )
-        rc = dom0_construct_pvh(d, image, image_headroom, initrd, cmdline);
+        rc = dom0_construct_pvh(d, image, initrd, cmdline);
     else if ( is_pv_domain(d) )
-        rc = dom0_construct_pv(d, image, image_headroom, initrd, cmdline);
+        rc = dom0_construct_pv(d, image, initrd, cmdline);
     else
         panic("Cannot construct Dom0. No guest interface available\n");
 
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 56fe89632b..c094863bb8 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -8,9 +8,9 @@
  */
 
 #include <xen/acpi.h>
+#include <xen/bootinfo.h>
 #include <xen/init.h>
 #include <xen/libelf.h>
-#include <xen/multiboot.h>
 #include <xen/pci.h>
 #include <xen/softirq.h>
 
@@ -530,14 +530,13 @@ static paddr_t __init find_memory(
     return INVALID_PADDR;
 }
 
-static int __init pvh_load_kernel(struct domain *d, const module_t *image,
-                                  unsigned long image_headroom,
-                                  module_t *initrd, void *image_base,
-                                  char *cmdline, paddr_t *entry,
-                                  paddr_t *start_info_addr)
+static int __init pvh_load_kernel(
+    struct domain *d, const struct boot_module *image,
+    struct boot_module *initrd, void *image_base, char *cmdline, paddr_t *entry,
+    paddr_t *start_info_addr)
 {
-    void *image_start = image_base + image_headroom;
-    unsigned long image_len = image->mod_end;
+    void *image_start = image_base + image->arch->headroom;
+    unsigned long image_len = image->size;
     struct elf_binary elf;
     struct elf_dom_parms parms;
     paddr_t last_addr;
@@ -546,7 +545,7 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
     struct vcpu *v = d->vcpu[0];
     int rc;
 
-    if ( (rc = bzimage_parse(image_base, &image_start, image_headroom,
+    if ( (rc = bzimage_parse(image_base, &image_start, image->arch->headroom,
                              &image_len)) != 0 )
     {
         printk("Error trying to detect bz compressed kernel\n");
@@ -594,7 +593,7 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
      * simplify it.
      */
     last_addr = find_memory(d, &elf, sizeof(start_info) +
-                            (initrd ? ROUNDUP(initrd->mod_end, PAGE_SIZE) +
+                            (initrd ? ROUNDUP(initrd->size, PAGE_SIZE) +
                                       sizeof(mod)
                                     : 0) +
                             (cmdline ? ROUNDUP(strlen(cmdline) + 1,
@@ -608,8 +607,8 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
 
     if ( initrd != NULL )
     {
-        rc = hvm_copy_to_guest_phys(last_addr, mfn_to_virt(initrd->mod_start),
-                                    initrd->mod_end, v);
+        rc = hvm_copy_to_guest_phys(last_addr, maddr_to_virt(initrd->start),
+                                    initrd->size, v);
         if ( rc )
         {
             printk("Unable to copy initrd to guest\n");
@@ -617,11 +616,11 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
         }
 
         mod.paddr = last_addr;
-        mod.size = initrd->mod_end;
-        last_addr += ROUNDUP(initrd->mod_end, elf_64bit(&elf) ? 8 : 4);
-        if ( initrd->string )
+        mod.size = initrd->size;
+        last_addr += ROUNDUP(initrd->size, elf_64bit(&elf) ? 8 : 4);
+        if ( initrd->string.len )
         {
-            char *str = __va(initrd->string);
+            char *str = initrd->string.bytes;
             size_t len = strlen(str) + 1;
 
             rc = hvm_copy_to_guest_phys(last_addr, str, len, v);
@@ -1176,10 +1175,9 @@ static void __hwdom_init pvh_setup_mmcfg(struct domain *d)
     }
 }
 
-int __init dom0_construct_pvh(struct domain *d, const module_t *image,
-                              unsigned long image_headroom,
-                              module_t *initrd,
-                              char *cmdline)
+int __init dom0_construct_pvh(
+    struct domain *d, const struct boot_module *image,
+    struct boot_module *initrd, char *cmdline)
 {
     paddr_t entry, start_info;
     int rc;
@@ -1209,9 +1207,8 @@ int __init dom0_construct_pvh(struct domain *d, const module_t *image,
         return rc;
     }
 
-    rc = pvh_load_kernel(d, image, image_headroom, initrd,
-                         bootstrap_map_multiboot(image),
-                         cmdline, &entry, &start_info);
+    rc = pvh_load_kernel(d, image, initrd, bootstrap_map(image), cmdline,
+                         &entry, &start_info);
     if ( rc )
     {
         printk("Failed to load Dom0 kernel\n");
diff --git a/xen/arch/x86/include/asm/boot.h b/xen/arch/x86/include/asm/boot.h
index 10b17f12b2..bcf4f2e2e3 100644
--- a/xen/arch/x86/include/asm/boot.h
+++ b/xen/arch/x86/include/asm/boot.h
@@ -19,6 +19,42 @@ static inline void *bootstrap_map_multiboot(const module_t *mod)
     return bootstrap_map(&bm);
 }
 
+static inline unsigned long bootmodule_index(
+    const struct boot_info *info, bootmod_type_t bootmod_type,
+    unsigned long start)
+{
+    for ( ; start < info->nr_mods; start++ )
+        if ( info->mods[start].bootmod_type == bootmod_type )
+            return start;
+
+    return info->nr_mods + 1;
+}
+
+static inline struct boot_module *bootmodule_next(
+    const struct boot_info *info, bootmod_type_t bootmod_type)
+{
+    unsigned long i;
+
+    for ( i = 0; i < info->nr_mods; i++ )
+        if ( info->mods[i].bootmod_type == bootmod_type )
+            return &info->mods[i];
+
+    return NULL;
+}
+
+static inline void bootmodule_update_start(struct boot_module *bm,
+    paddr_t new_start)
+{
+    bm->start = new_start;
+    bm->mfn = maddr_to_mfn(new_start);
+}
+
+static inline void bootmodule_update_mfn(struct boot_module *bm, mfn_t new_mfn)
+{
+    bm->mfn = new_mfn;
+    bm->start = mfn_to_maddr(new_mfn);
+}
+
 #endif
 
 /*
diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index a25054f372..30c27980e0 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -2,9 +2,33 @@
 #define __ARCH_X86_BOOTINFO_H__
 
 struct arch_bootmodule {
+#define BOOTMOD_FLAG_X86_RELOCATED     1U << 0
+    uint32_t flags;
     unsigned headroom;
 };
 
+struct arch_boot_info {
+    uint32_t flags;
+#define BOOTINFO_FLAG_X86_CMDLINE      1U << 2
+#define BOOTINFO_FLAG_X86_MODULES      1U << 3
+#define BOOTINFO_FLAG_X86_MEMMAP       1U << 6
+#define BOOTINFO_FLAG_X86_LOADERNAME   1U << 9
+
+    char *boot_loader_name;
+
+    uint32_t mmap_length;
+    paddr_t mmap_addr;
+};
+
+struct __packed mb_memmap {
+    uint32_t size;
+    uint32_t base_addr_low;
+    uint32_t base_addr_high;
+    uint32_t length_low;
+    uint32_t length_high;
+    uint32_t type;
+};
+
 #endif
 
 /*
diff --git a/xen/arch/x86/include/asm/dom0_build.h b/xen/arch/x86/include/asm/dom0_build.h
index a5f8c9e67f..ca502269f2 100644
--- a/xen/arch/x86/include/asm/dom0_build.h
+++ b/xen/arch/x86/include/asm/dom0_build.h
@@ -1,6 +1,7 @@
 #ifndef _DOM0_BUILD_H_
 #define _DOM0_BUILD_H_
 
+#include <xen/bootinfo.h>
 #include <xen/libelf.h>
 #include <xen/sched.h>
 
@@ -13,15 +14,11 @@ unsigned long dom0_compute_nr_pages(struct domain *d,
                                     unsigned long initrd_len);
 int dom0_setup_permissions(struct domain *d);
 
-int dom0_construct_pv(struct domain *d, const module_t *image,
-                      unsigned long image_headroom,
-                      module_t *initrd,
-                      char *cmdline);
+int dom0_construct_pv(struct domain *d, const struct boot_module *image,
+                      struct boot_module *initrd, char *cmdline);
 
-int dom0_construct_pvh(struct domain *d, const module_t *image,
-                       unsigned long image_headroom,
-                       module_t *initrd,
-                       char *cmdline);
+int dom0_construct_pvh(struct domain *d, const struct boot_module *image,
+                       struct boot_module *initrd, char *cmdline);
 
 unsigned long dom0_paging_pages(const struct domain *d,
                                 unsigned long nr_pages);
diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index 80d0bb2a21..2d620d04c7 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -34,8 +34,8 @@ static inline void vesa_init(void) {};
 
 int construct_dom0(
     struct domain *d,
-    const module_t *kernel, unsigned long kernel_headroom,
-    module_t *initrd,
+    const struct boot_module *kernel,
+    struct boot_module *initrd,
     char *cmdline);
 void setup_io_bitmap(struct domain *d);
 
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index 4fe806b60d..bc0af7cf27 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -4,12 +4,12 @@
  * Copyright (c) 2002-2005, K A Fraser
  */
 
+#include <xen/bootinfo.h>
 #include <xen/console.h>
 #include <xen/domain.h>
 #include <xen/domain_page.h>
 #include <xen/init.h>
 #include <xen/libelf.h>
-#include <xen/multiboot.h>
 #include <xen/pfn.h>
 #include <xen/sched.h>
 #include <xen/softirq.h>
@@ -356,9 +356,8 @@ static struct page_info * __init alloc_chunk(struct domain *d,
 }
 
 int __init dom0_construct_pv(struct domain *d,
-                             const module_t *image,
-                             unsigned long image_headroom,
-                             module_t *initrd,
+                             const struct boot_module *image,
+                             struct boot_module *initrd,
                              char *cmdline)
 {
     int i, rc, order, machine;
@@ -375,10 +374,10 @@ int __init dom0_construct_pv(struct domain *d,
     unsigned int flush_flags = 0;
     start_info_t *si;
     struct vcpu *v = d->vcpu[0];
-    void *image_base = bootstrap_map_multiboot(image);
-    unsigned long image_len = image->mod_end;
-    void *image_start = image_base + image_headroom;
-    unsigned long initrd_len = initrd ? initrd->mod_end : 0;
+    void *image_base = bootstrap_map(image);
+    unsigned long image_len = image->size;
+    void *image_start = image_base + image->arch->headroom;
+    unsigned long initrd_len = initrd ? initrd->size : 0;
     l4_pgentry_t *l4tab = NULL, *l4start = NULL;
     l3_pgentry_t *l3tab = NULL, *l3start = NULL;
     l2_pgentry_t *l2tab = NULL, *l2start = NULL;
@@ -417,7 +416,7 @@ int __init dom0_construct_pv(struct domain *d,
 
     d->max_pages = ~0U;
 
-    if ( (rc = bzimage_parse(image_base, &image_start, image_headroom,
+    if ( (rc = bzimage_parse(image_base, &image_start, image->arch->headroom,
                              &image_len)) != 0 )
         return rc;
 
@@ -612,7 +611,7 @@ int __init dom0_construct_pv(struct domain *d,
         initrd_pfn = vinitrd_start ?
                      (vinitrd_start - v_start) >> PAGE_SHIFT :
                      domain_tot_pages(d);
-        initrd_mfn = mfn = initrd->mod_start;
+        initrd_mfn = mfn = mfn_x(initrd->mfn);
         count = PFN_UP(initrd_len);
         if ( d->arch.physaddr_bitsize &&
              ((mfn + count - 1) >> (d->arch.physaddr_bitsize - PAGE_SHIFT)) )
@@ -627,12 +626,13 @@ int __init dom0_construct_pv(struct domain *d,
                     free_domheap_pages(page, order);
                     page += 1UL << order;
                 }
-            memcpy(page_to_virt(page), mfn_to_virt(initrd->mod_start),
+            memcpy(page_to_virt(page), maddr_to_virt(initrd->start),
                    initrd_len);
-            mpt_alloc = (paddr_t)initrd->mod_start << PAGE_SHIFT;
+            mpt_alloc = (paddr_t)initrd->start;
             init_domheap_pages(mpt_alloc,
                                mpt_alloc + PAGE_ALIGN(initrd_len));
-            initrd->mod_start = initrd_mfn = mfn_x(page_to_mfn(page));
+            bootmodule_update_mfn(initrd, page_to_mfn(page));
+            initrd_mfn = mfn_x(initrd->mfn);
         }
         else
         {
@@ -640,7 +640,7 @@ int __init dom0_construct_pv(struct domain *d,
                 if ( assign_pages(mfn_to_page(_mfn(mfn++)), 1, d, 0) )
                     BUG();
         }
-        initrd->mod_end = 0;
+        initrd->size = 0;
 
         iommu_memory_setup(d, "initrd", mfn_to_page(_mfn(initrd_mfn)),
                            PFN_UP(initrd_len), &flush_flags);
@@ -654,7 +654,7 @@ int __init dom0_construct_pv(struct domain *d,
                nr_pages - domain_tot_pages(d));
     if ( initrd )
     {
-        mpt_alloc = (paddr_t)initrd->mod_start << PAGE_SHIFT;
+        mpt_alloc = initrd->start;
         printk("\n Init. ramdisk: %"PRIpaddr"->%"PRIpaddr,
                mpt_alloc, mpt_alloc + initrd_len);
     }
@@ -880,7 +880,7 @@ int __init dom0_construct_pv(struct domain *d,
         if ( pfn >= initrd_pfn )
         {
             if ( pfn < initrd_pfn + PFN_UP(initrd_len) )
-                mfn = initrd->mod_start + (pfn - initrd_pfn);
+                mfn = mfn_x(initrd->mfn) + (pfn - initrd_pfn);
             else
                 mfn -= PFN_UP(initrd_len);
         }
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 3b623a4149..f9b04daebd 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -37,6 +37,7 @@
 #include <asm/processor.h>
 #include <asm/mpspec.h>
 #include <asm/apic.h>
+#include <asm/boot.h>
 #include <asm/msi.h>
 #include <asm/desc.h>
 #include <asm/paging.h>
@@ -59,6 +60,9 @@
 #include <asm/prot-key.h>
 #include <asm/pv/domain.h>
 
+/* Max number of boot modules a bootloader can provide in addition to Xen */
+#define MAX_NR_BOOTMODS 63
+
 /* opt_nosmp: If true, secondary processors are ignored. */
 static bool __initdata opt_nosmp;
 boolean_param("nosmp", opt_nosmp);
@@ -269,20 +273,44 @@ static int __init cf_check parse_acpi_param(const char *s)
 }
 custom_param("acpi", parse_acpi_param);
 
-static const module_t *__initdata initial_images;
 static struct boot_info __initdata *boot_info;
 
-static void __init multiboot_to_bootinfo(multiboot_info_t *mbi)
+static void __init multiboot_to_bootinfo(multiboot_info_t *mbi, module_t *mods)
 {
     static struct boot_info       __initdata info;
-    static struct boot_module     __initdata boot_mods[1];
-    static struct arch_bootmodule __initdata arch_boot_mods[1];
+    static struct arch_boot_info  __initdata arch_info;
+    static struct boot_module     __initdata boot_mods[MAX_NR_BOOTMODS + 1];
+    static struct arch_bootmodule __initdata arch_boot_mods[
+                                                       MAX_NR_BOOTMODS + 1];
 
+    int i;
+
+    info.arch = &arch_info;
     info.mods = boot_mods;
 
+    info.cmdline = __va(mbi->cmdline);
+
+    /* The BOOTINFO_FLAG_X86_* flags are a 1-1 map to MBI_* */
+    arch_info.flags = mbi->flags;
+    arch_info.mmap_length = mbi->mmap_length;
+    arch_info.mmap_addr = mbi->mmap_addr;
+    arch_info.boot_loader_name = __va(mbi->boot_loader_name);
+
     info.nr_mods = mbi->mods_count;
+    for ( i = 0; i <= MAX_NR_BOOTMODS; i++ )
+    {
+        boot_mods[i].arch = &arch_boot_mods[i];
 
-    boot_mods[0].arch = &arch_boot_mods[0];
+        if ( i < info.nr_mods )
+        {
+            bootmodule_update_start(&boot_mods[i], mods[i].mod_start);
+            boot_mods[i].size = mods[i].mod_end - mods[i].mod_start;
+
+            boot_mods[i].string.len = strlcpy(boot_mods[i].string.bytes,
+                                             __va(mods[i].string),
+                                             BOOTMOD_STRING_MAX_LEN);
+        }
+    }
 
     boot_info = &info;
 }
@@ -296,8 +324,8 @@ unsigned long __init initial_images_nrpages(nodeid_t node)
 
     for ( nr = i = 0; i < boot_info->nr_mods; ++i )
     {
-        unsigned long start = initial_images[i].mod_start;
-        unsigned long end = start + PFN_UP(initial_images[i].mod_end);
+        unsigned long start = mfn_x(boot_info->mods[i].mfn);
+        unsigned long end = start + PFN_UP(boot_info->mods[i].size);
 
         if ( end > node_start && node_end > start )
             nr += min(node_end, end) - max(node_start, start);
@@ -312,14 +340,13 @@ void __init discard_initial_images(void)
 
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
-        uint64_t start = (uint64_t)initial_images[i].mod_start << PAGE_SHIFT;
+        uint64_t start = boot_info->mods[i].start;
 
         init_domheap_pages(start,
-                           start + PAGE_ALIGN(initial_images[i].mod_end));
+                           start + PAGE_ALIGN(boot_info->mods[i].size));
     }
 
     boot_info->nr_mods = 0;
-    initial_images = NULL;
 }
 
 extern unsigned char __init_begin[], __init_end[];
@@ -450,26 +477,26 @@ static void __init move_memory(
 
     while ( size )
     {
-        module_t mod;
+        struct boot_module mod;
         unsigned int soffs = src & mask;
         unsigned int doffs = dst & mask;
         unsigned int sz;
         void *d, *s;
 
-        mod.mod_start = (src - soffs) >> PAGE_SHIFT;
-        mod.mod_end = soffs + size;
-        if ( mod.mod_end > blksz )
-            mod.mod_end = blksz;
-        sz = mod.mod_end - soffs;
-        s = bootstrap_map_multiboot(&mod);
-
-        mod.mod_start = (dst - doffs) >> PAGE_SHIFT;
-        mod.mod_end = doffs + size;
-        if ( mod.mod_end > blksz )
-            mod.mod_end = blksz;
-        if ( sz > mod.mod_end - doffs )
-            sz = mod.mod_end - doffs;
-        d = bootstrap_map_multiboot(&mod);
+        mod.start = src - soffs;
+        mod.size = soffs + size;
+        if ( mod.size > blksz )
+            mod.size = blksz;
+        sz = mod.size - soffs;
+        s = bootstrap_map(&mod);
+
+        mod.start = dst - doffs;
+        mod.size = doffs + size;
+        if ( mod.size > blksz )
+            mod.size = blksz;
+        if ( sz > mod.size - doffs )
+            sz = mod.size - doffs;
+        d = bootstrap_map(&mod);
 
         memmove(d + doffs, s + soffs, sz);
 
@@ -602,7 +629,7 @@ static void __init noinline move_xen(void)
 #undef BOOTSTRAP_MAP_LIMIT
 
 static uint64_t __init consider_modules(
-    uint64_t s, uint64_t e, uint32_t size, const module_t *mod,
+    uint64_t s, uint64_t e, uint32_t size, const struct boot_module *mod,
     unsigned int nr_mods, unsigned int this_mod)
 {
     unsigned int i;
@@ -612,8 +639,8 @@ static uint64_t __init consider_modules(
 
     for ( i = 0; i < nr_mods ; ++i )
     {
-        uint64_t start = (uint64_t)mod[i].mod_start << PAGE_SHIFT;
-        uint64_t end = start + PAGE_ALIGN(mod[i].mod_end);
+        uint64_t start = mod[i].start;
+        uint64_t end = start + PAGE_ALIGN(mod[i].size);
 
         if ( i == this_mod )
             continue;
@@ -883,9 +910,8 @@ static unsigned int __init copy_bios_e820(struct e820entry *map, unsigned int li
     return n;
 }
 
-static struct domain *__init create_dom0(const module_t *image,
-                                         unsigned long headroom,
-                                         module_t *initrd, const char *kextra,
+static struct domain *__init create_dom0(const struct boot_info *bootinfo,
+                                         const char *kextra,
                                          const char *loader)
 {
     struct xen_domctl_createdomain dom0_cfg = {
@@ -899,9 +925,14 @@ static struct domain *__init create_dom0(const module_t *image,
             .misc_flags = opt_dom0_msr_relaxed ? XEN_X86_MSR_RELAXED : 0,
         },
     };
+    struct boot_module *image = bootmodule_next(bootinfo, BOOTMOD_KERNEL);
+    struct boot_module *initrd = bootmodule_next(bootinfo, BOOTMOD_RAMDISK);
     struct domain *d;
     char *cmdline;
-    domid_t domid;
+    domid_t domid = 0;
+
+    if ( image == NULL )
+        panic("Error creating d%uv0\n", domid);
 
     if ( opt_dom0_pvh )
     {
@@ -928,7 +959,7 @@ static struct domain *__init create_dom0(const module_t *image,
         panic("Error creating d%uv0\n", domid);
 
     /* Grab the DOM0 command line. */
-    cmdline = image->string ? __va(image->string) : NULL;
+    cmdline = image->string.len ? image->string.bytes : NULL;
     if ( cmdline || kextra )
     {
         static char __initdata dom0_cmdline[MAX_GUEST_CMDLINE];
@@ -968,8 +999,7 @@ static struct domain *__init create_dom0(const module_t *image,
         write_cr4(read_cr4() & ~X86_CR4_SMAP);
     }
 
-    if ( construct_dom0(d, image, boot_info->mods[0].arch->headroom, initrd,
-                        cmdline) != 0 )
+    if ( construct_dom0(d, image, initrd, cmdline) != 0 )
         panic("Could not construct domain 0\n");
 
     if ( cpu_has_smap )
@@ -1038,14 +1068,14 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         mod = __va(mbi->mods_addr);
     }
 
-    multiboot_to_bootinfo(mbi);
+    multiboot_to_bootinfo(mbi, mod);
 
-    loader = (mbi->flags & MBI_LOADERNAME)
-        ? (char *)__va(mbi->boot_loader_name) : "unknown";
+    loader = (boot_info->arch->flags & BOOTINFO_FLAG_X86_LOADERNAME)
+        ? boot_info->arch->boot_loader_name : "unknown";
 
     /* Parse the command-line options. */
-    cmdline = cmdline_cook((mbi->flags & MBI_CMDLINE) ?
-                           __va(mbi->cmdline) : NULL,
+    cmdline = cmdline_cook((boot_info->arch->flags & BOOTINFO_FLAG_X86_CMDLINE) ?
+                            boot_info->cmdline : NULL,
                            loader);
     if ( (kextra = strstr(cmdline, " -- ")) != NULL )
     {
@@ -1147,19 +1177,22 @@ void __init noreturn __start_xen(unsigned long mbi_p)
            bootsym(boot_edd_info_nr));
 
     /* Check that we have at least one Multiboot module. */
-    if ( !(mbi->flags & MBI_MODULES) || (boot_info->nr_mods == 0) )
+    if ( !(boot_info->arch->flags & BOOTINFO_FLAG_X86_MODULES) ||
+         (boot_info->nr_mods == 0) )
         panic("dom0 kernel not specified. Check bootloader configuration\n");
 
     /* Check that we don't have a silly number of modules. */
-    if ( boot_info->nr_mods > sizeof(module_map) * 8 )
+    if ( boot_info->nr_mods > MAX_NR_BOOTMODS + 1 )
     {
-        boot_info->nr_mods = sizeof(module_map) * 8;
+        boot_info->nr_mods = MAX_NR_BOOTMODS + 1;
         printk("Excessive multiboot modules - using the first %u only\n",
                boot_info->nr_mods);
     }
 
-    bitmap_fill(module_map, boot_info->nr_mods);
+    /* Dom0 kernel is the first boot module */
+    bitmap_fill(module_map, mbi->mods_count);
     __clear_bit(0, module_map); /* Dom0 kernel is always first */
+    boot_info->mods[0].bootmod_type = BOOTMOD_KERNEL;
 
     if ( pvh_boot )
     {
@@ -1189,13 +1222,13 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     {
         memmap_type = "Xen-e820";
     }
-    else if ( mbi->flags & MBI_MEMMAP )
+    else if ( boot_info->arch->flags & BOOTINFO_FLAG_X86_MEMMAP )
     {
         memmap_type = "Multiboot-e820";
-        while ( bytes < mbi->mmap_length &&
+        while ( bytes < boot_info->arch->mmap_length &&
                 e820_raw.nr_map < ARRAY_SIZE(e820_raw.map) )
         {
-            memory_map_t *map = __va(mbi->mmap_addr + bytes);
+            struct mb_memmap *map = __va(boot_info->arch->mmap_addr + bytes);
 
             /*
              * This is a gross workaround for a BIOS bug. Some bootloaders do
@@ -1330,17 +1363,9 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     set_kexec_crash_area_size((u64)nr_pages << PAGE_SHIFT);
     kexec_reserve_area(&boot_e820);
 
-    initial_images = mod;
-    boot_info->nr_mods = boot_info->nr_mods;
-
     for ( i = 0; !efi_enabled(EFI_LOADER) && i < boot_info->nr_mods; i++ )
-    {
-        if ( mod[i].mod_start & (PAGE_SIZE - 1) )
+        if ( boot_info->mods[i].start & (PAGE_SIZE - 1) )
             panic("Bootloader didn't honor module alignment request\n");
-        mod[i].mod_end -= mod[i].mod_start;
-        mod[i].mod_start >>= PAGE_SHIFT;
-        mod[i].reserved = 0;
-    }
 
     /*
      * TODO: load ucode earlier once multiboot modules become accessible
@@ -1357,12 +1382,14 @@ void __init noreturn __start_xen(unsigned long mbi_p)
          * respective reserve_e820_ram() invocation below. No need to
          * query efi_boot_mem_unused() here, though.
          */
-        mod[boot_info->nr_mods].mod_start = virt_to_mfn(_stext);
-        mod[boot_info->nr_mods].mod_end = __2M_rwdata_end - _stext;
+        bootmodule_update_start(&boot_info->mods[boot_info->nr_mods],
+                                virt_to_maddr(_stext));
+        boot_info->mods[boot_info->nr_mods].size = __2M_rwdata_end - _stext;
     }
 
     boot_info->mods[0].arch->headroom =
-        bzimage_headroom(bootstrap_map_multiboot(mod), mod->mod_end);
+        bzimage_headroom(bootstrap_map(&boot_info->mods[0]),
+                         boot_info->mods[0].size);
 
     bootstrap_map(NULL);
 
@@ -1420,7 +1447,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         {
             /* Don't overlap with modules. */
             end = consider_modules(s, e, reloc_size + mask,
-                                   mod, boot_info->nr_mods, -1);
+                                   boot_info->mods, boot_info->nr_mods, -1);
             end &= ~mask;
         }
         else
@@ -1443,15 +1470,15 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         /* Is the region suitable for relocating the multiboot modules? */
         for ( j = boot_info->nr_mods - 1; j >= 0; j-- )
         {
-            struct boot_module *boot_mods = boot_info->mods;
-            unsigned long headroom = j ? 0 : boot_mods[0].arch->headroom;
-            unsigned long size = PAGE_ALIGN(headroom + mod[j].mod_end);
+            struct boot_module *boot_mod = boot_info->mods;
+            unsigned long headroom = j ? 0 : boot_mod[0].arch->headroom;
+            unsigned long size = PAGE_ALIGN(headroom + boot_mod[j].size);
 
-            if ( mod[j].reserved )
+            if ( boot_mod[j].arch->flags & BOOTMOD_FLAG_X86_RELOCATED )
                 continue;
 
             /* Don't overlap with other modules (or Xen itself). */
-            end = consider_modules(s, e, size, mod,
+            end = consider_modules(s, e, size, boot_info->mods,
                                    boot_info->nr_mods + relocated, j);
 
             if ( highmem_start && end > highmem_start )
@@ -1459,14 +1486,14 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
             if ( s < end &&
                  (headroom ||
-                  ((end - size) >> PAGE_SHIFT) > mod[j].mod_start) )
+                  ((end - size) >> PAGE_SHIFT) > mfn_x(boot_mod[j].mfn)) )
             {
                 move_memory(end - size + headroom,
-                            (uint64_t)mod[j].mod_start << PAGE_SHIFT,
-                            mod[j].mod_end);
-                mod[j].mod_start = (end - size) >> PAGE_SHIFT;
-                mod[j].mod_end += headroom;
-                mod[j].reserved = 1;
+                            (uint64_t)boot_mod[j].start,
+                            boot_mod[j].size);
+                bootmodule_update_start(&boot_mod[j], end - size);
+                boot_mod[j].size += headroom;
+                boot_mod[j].arch->flags |= BOOTMOD_FLAG_X86_RELOCATED;
             }
         }
 
@@ -1478,7 +1505,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         while ( !kexec_crash_area.start )
         {
             /* Don't overlap with modules (or Xen itself). */
-            e = consider_modules(s, e, PAGE_ALIGN(kexec_crash_area.size), mod,
+            e = consider_modules(s, e, PAGE_ALIGN(kexec_crash_area.size),
+                                 boot_info->mods,
                                  boot_info->nr_mods + relocated, -1);
             if ( s >= e )
                 break;
@@ -1492,13 +1520,14 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 #endif
     }
 
-    if ( boot_info->mods[0].arch->headroom && !mod->reserved )
+    if ( boot_info->mods[0].arch->headroom &&
+         !(boot_info->mods[0].arch->flags & BOOTMOD_FLAG_X86_RELOCATED) )
         panic("Not enough memory to relocate the dom0 kernel image\n");
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
-        uint64_t s = (uint64_t)mod[i].mod_start << PAGE_SHIFT;
+        uint64_t s = (uint64_t)boot_info->mods[i].start;
 
-        reserve_e820_ram(&boot_e820, s, s + PAGE_ALIGN(mod[i].mod_end));
+        reserve_e820_ram(&boot_e820, s, s + PAGE_ALIGN(boot_info->mods[i].size));
     }
 
     if ( !xen_phys_start )
@@ -1565,8 +1594,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
                 map_e = boot_e820.map[j].addr + boot_e820.map[j].size;
                 for ( j = 0; j < boot_info->nr_mods; ++j )
                 {
-                    uint64_t end = pfn_to_paddr(mod[j].mod_start) +
-                                   mod[j].mod_end;
+                    uint64_t end = mfn_to_maddr(boot_info->mods[j].mfn) +
+                                   boot_info->mods[j].size;
 
                     if ( map_e < end )
                         map_e = end;
@@ -1641,11 +1670,12 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
-        set_pdx_range(mod[i].mod_start,
-                      mod[i].mod_start + PFN_UP(mod[i].mod_end));
-        map_pages_to_xen((unsigned long)mfn_to_virt(mod[i].mod_start),
-                         _mfn(mod[i].mod_start),
-                         PFN_UP(mod[i].mod_end), PAGE_HYPERVISOR);
+        set_pdx_range(mfn_x(boot_info->mods[i].mfn),
+                      mfn_x(boot_info->mods[i].mfn) +
+                      PFN_UP(boot_info->mods[i].size));
+        map_pages_to_xen((unsigned long)maddr_to_virt(boot_info->mods[i].start),
+                         boot_info->mods[i].mfn,
+                         PFN_UP(boot_info->mods[i].size), PAGE_HYPERVISOR);
     }
 
 #ifdef CONFIG_KEXEC
@@ -2022,8 +2052,12 @@ void __init noreturn __start_xen(unsigned long mbi_p)
            cpu_has_nx ? XENLOG_INFO : XENLOG_WARNING "Warning: ",
            cpu_has_nx ? "" : "not ");
 
-    initrdidx = find_first_bit(module_map, boot_info->nr_mods);
-    if ( bitmap_weight(module_map, boot_info->nr_mods) > 1 )
+    initrdidx = bootmodule_index(boot_info, BOOTMOD_UNKNOWN, 0);
+    if ( initrdidx < boot_info->nr_mods )
+        boot_info->mods[initrdidx].bootmod_type = BOOTMOD_RAMDISK;
+
+    if ( bootmodule_index(boot_info, BOOTMOD_UNKNOWN, 0) >
+            boot_info->nr_mods )
         printk(XENLOG_WARNING
                "Multiple initrd candidates, picking module #%u\n",
                initrdidx);
@@ -2032,9 +2066,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
      * We're going to setup domain0 using the module(s) that we stashed safely
      * above our heap. The second module, if present, is an initrd ramdisk.
      */
-    dom0 = create_dom0(mod, boot_info->mods[0].arch->headroom,
-                       initrdidx < boot_info->nr_mods ? mod + initrdidx : NULL,
-                       kextra, loader);
+    dom0 = create_dom0(boot_info, kextra, loader);
     if ( !dom0 )
         panic("Could not set up DOM0 guest OS\n");
 
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
index eb93cc3439..2f4284a91f 100644
--- a/xen/include/xen/bootinfo.h
+++ b/xen/include/xen/bootinfo.h
@@ -2,23 +2,50 @@
 #define __XEN_BOOTINFO_H__
 
 #include <xen/types.h>
+#include <xen/compiler.h>
+#include <xen/mm-frame.h>
 
 #ifdef CONFIG_X86
 #include <asm/bootinfo.h>
 #else
     struct arch_bootmodule { };
+    struct arch_boot_info { };
 #endif
 
+/* Boot module binary type / purpose */
+#define BOOTMOD_UNKNOWN     0
+#define BOOTMOD_XEN         1
+#define BOOTMOD_FDT         2
+#define BOOTMOD_KERNEL      3
+#define BOOTMOD_RAMDISK     4
+#define BOOTMOD_XSM         5
+#define BOOTMOD_UCODE       6
+#define BOOTMOD_GUEST_DTB   7
+typedef unsigned int bootmod_type_t;
+
+#define BOOTMOD_STRING_MAX_LEN 1024
+struct boot_string {
+    char bytes[BOOTMOD_STRING_MAX_LEN];
+    size_t len;
+};
+
 struct boot_module {
+    bootmod_type_t bootmod_type;
     paddr_t start;
+    mfn_t mfn;
     size_t size;
 
     struct arch_bootmodule *arch;
+    struct boot_string string;
 };
 
 struct boot_info {
+    char *cmdline;
+
     unsigned int nr_mods;
     struct boot_module *mods;
+
+    struct arch_boot_info *arch;
 };
 
 #endif
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 07:19:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 07:19:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557775.871435 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUsm-0007VE-Bn; Sat, 01 Jul 2023 07:19:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557775.871435; Sat, 01 Jul 2023 07:19:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUsm-0007Tv-4v; Sat, 01 Jul 2023 07:19:00 +0000
Received: by outflank-mailman (input) for mailman id 557775;
 Sat, 01 Jul 2023 07:18:58 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFUsk-00074A-4S
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 07:18:58 +0000
Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com
 [2607:f8b0:4864:20::436])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8a442a66-17df-11ee-b237-6b7b168915f2;
 Sat, 01 Jul 2023 09:18:56 +0200 (CEST)
Received: by mail-pf1-x436.google.com with SMTP id
 d2e1a72fcca58-666e97fcc60so1887762b3a.3
 for <xen-devel@lists.xenproject.org>; Sat, 01 Jul 2023 00:18:56 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s19-20020aa78d53000000b00673e652985bsm4108866pfe.118.2023.07.01.00.18.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 01 Jul 2023 00:18:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: 8a442a66-17df-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688195934; x=1690787934;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=2CCuYNE2IdEGJiRf9KcQxz9oSopCuIZzH05nVBt98V4=;
        b=L/C1FJaAKKXcrKwwbXfoXKbQbJyRAJdJNLqD8rSSdTsYDwF3QnFSP2qbAA042bSu5Z
         OFZIrW0J+Zhh+BmakoPWDH4ZzFTQsvVUEeVlHYaCl918lGW6Wh1jbVC1a924pKTMIMLT
         ixYBYRX9jRyGqkbarfkYRUMvVl5fs3x8ji0pYYcTxKG4Let565+Wt7m4ReGqVoGYWV/Q
         eZAegTnZa6qvgzw7JfcDFp7OBQWvL2j5oe7Y+LfTbHhysp/YtRNS3at1rUL4Y9/Ctk9C
         0nM3B33hMsgll472cqdFo+kHWDEq4HWIonXRH9BcfTq55X2I9HyYK3UkD8bHLjcEwR6W
         CSSg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688195934; x=1690787934;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=2CCuYNE2IdEGJiRf9KcQxz9oSopCuIZzH05nVBt98V4=;
        b=BLwRZZzEoDJzHnnwu9u+6xKgS38426q7sDor8LUo5G9n1xX+eM9GItEq65nOWeUyZ9
         DnWseHP9hzHpvh7FuwDsMogLViTUOEo5qGByRb6dSMrFMZkC9w93CSbdksJDCh1gSwYO
         QLTiXu8vVjsIgHAgDN4PJFCkC5YHDZmMXT/Cmu4LOISBJ5cp0Zo456YUM9LNnCUBWJfT
         GtvSqeAHVPTdzcH+XyaSR7mDpMT7/+k/nEsw2HsczTs5qNWPJJ98BWM+J8AXDZRuIHzV
         UpNTah1Qq6i+qRSYwepddB277+r+5vaWBy+FSDbhlkp3wbar3bkciF99bo+nfk7CLpZw
         j24g==
X-Gm-Message-State: ABy/qLZ9tzvuTjkna5RzisUUdxkxoNud6/YggGePXYZ+Dz2xXuWoOVWN
	OYoRrxonIbDhan10ZXkD8WW8fWvo7zE=
X-Google-Smtp-Source: APBJJlFwakyPH8XJc7p5VcZt6PmkVcFDYaVMV4ECD1CzygH3D1pud2JwVpwTI/RepQYB4r6d0mLbRQ==
X-Received: by 2002:a05:6a00:1792:b0:64d:1c59:6767 with SMTP id s18-20020a056a00179200b0064d1c596767mr4767504pfg.24.1688195934527;
        Sat, 01 Jul 2023 00:18:54 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 05/10] xsm: switch XSM init to boot info structures
Date: Sat,  1 Jul 2023 00:18:30 -0700
Message-Id: <20230701071835.41599-6-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701071835.41599-1-christopher.w.clark@gmail.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Change the XSM implementation to use the boot info structure instead of
the multiboot module_map.

Drops a dependency on CONFIG_MULTIBOOT, so boot module logic is now
used whenever the DEVICE_TREE specific logic (for Arm) is not, with the
bootinfo header conditionally included to ensure no change on Arm.

Adds a multiboot header inclusion into guest/xen/pvh-boot.c
since it is no longer provided via transitive inclusion and the source
in that file uses multiboot structures.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

---
Changes since v1: patch is a subset of v1 series patches 2 and 3.
- Added the <xen/multiboot.h> inclusion to pvh-boot.c
- Use conditional inclusion for <xen/bootinfo.h>

 xen/arch/x86/guest/xen/pvh-boot.c |  1 +
 xen/arch/x86/setup.c              |  2 +-
 xen/include/xsm/xsm.h             | 28 +++++++--------
 xen/xsm/xsm_core.c                | 47 +++++++++++++++---------
 xen/xsm/xsm_policy.c              | 59 ++++++++++++++++---------------
 5 files changed, 77 insertions(+), 60 deletions(-)

diff --git a/xen/arch/x86/guest/xen/pvh-boot.c b/xen/arch/x86/guest/xen/pvh-boot.c
index 9cbe87b61b..1ed04d035c 100644
--- a/xen/arch/x86/guest/xen/pvh-boot.c
+++ b/xen/arch/x86/guest/xen/pvh-boot.c
@@ -9,6 +9,7 @@
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/mm.h>
+#include <xen/multiboot.h>
 
 #include <asm/e820.h>
 #include <asm/guest.h>
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index f9b04daebd..a616ccc0a8 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1835,7 +1835,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     mmio_ro_ranges = rangeset_new(NULL, "r/o mmio ranges",
                                   RANGESETF_prettyprint_hex);
 
-    xsm_multiboot_init(module_map, mbi);
+    xsm_bootmodule_init(boot_info);
 
     /*
      * IOMMU-related ACPI table parsing may require some of the system domains
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 8dad03fd3d..d409c30be6 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -16,8 +16,10 @@
 #define __XSM_H__
 
 #include <xen/alternative-call.h>
+#ifndef CONFIG_HAS_DEVICE_TREE
+# include <xen/bootinfo.h>
+#endif
 #include <xen/sched.h>
-#include <xen/multiboot.h>
 
 /* policy magic number (defined by XSM_MAGIC) */
 typedef uint32_t xsm_magic_t;
@@ -776,15 +778,14 @@ static inline int xsm_argo_send(const struct domain *d, const struct domain *t)
 
 #endif /* XSM_NO_WRAPPERS */
 
-#ifdef CONFIG_MULTIBOOT
-int xsm_multiboot_init(
-    unsigned long *module_map, const multiboot_info_t *mbi);
-int xsm_multiboot_policy_init(
-    unsigned long *module_map, const multiboot_info_t *mbi,
-    void **policy_buffer, size_t *policy_size);
-#endif
+#ifndef CONFIG_HAS_DEVICE_TREE
+int xsm_bootmodule_init(const struct boot_info *info);
+int xsm_bootmodule_policy_init(
+    const struct boot_info *info, const unsigned char **policy_buffer,
+    size_t *policy_size);
+
+#else
 
-#ifdef CONFIG_HAS_DEVICE_TREE
 /*
  * Initialize XSM
  *
@@ -826,15 +827,14 @@ static const inline struct xsm_ops *silo_init(void)
 
 #include <xsm/dummy.h>
 
-#ifdef CONFIG_MULTIBOOT
-static inline int xsm_multiboot_init (
-    unsigned long *module_map, const multiboot_info_t *mbi)
+#ifndef CONFIG_HAS_DEVICE_TREE
+static inline int xsm_bootmodule_init(const struct boot_info *info)
 {
     return 0;
 }
-#endif
 
-#ifdef CONFIG_HAS_DEVICE_TREE
+#else
+
 static inline int xsm_dt_init(void)
 {
     return 0;
diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index eaa028109b..301ae4dc8b 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -10,8 +10,12 @@
  *  as published by the Free Software Foundation.
  */
 
-#include <xen/init.h>
+#ifndef CONFIG_HAS_DEVICE_TREE
+# include <xen/bootinfo.h>
+#endif
 #include <xen/errno.h>
+#include <xen/hypercall.h>
+#include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/param.h>
 
@@ -138,26 +142,35 @@ static int __init xsm_core_init(const void *policy_buffer, size_t policy_size)
     return 0;
 }
 
-#ifdef CONFIG_MULTIBOOT
-int __init xsm_multiboot_init(
-    unsigned long *module_map, const multiboot_info_t *mbi)
+/*
+ * ifdef'ing this against multiboot is no longer valid as the boot module
+ * is agnostic and it will be possible to dropped the ifndef should Arm
+ * adopt boot info
+ */
+#ifndef CONFIG_HAS_DEVICE_TREE
+int __init xsm_bootmodule_init(const struct boot_info *bootinfo)
 {
     int ret = 0;
-    void *policy_buffer = NULL;
+    const unsigned char *policy_buffer = NULL;
     size_t policy_size = 0;
 
     printk("XSM Framework v" XSM_FRAMEWORK_VERSION " initialized\n");
 
     if ( XSM_MAGIC )
     {
-        ret = xsm_multiboot_policy_init(module_map, mbi, &policy_buffer,
-                                        &policy_size);
-        if ( ret )
-        {
-            bootstrap_map(NULL);
-            printk(XENLOG_ERR "Error %d initializing XSM policy\n", ret);
-            return -EINVAL;
-        }
+        int ret = xsm_bootmodule_policy_init(bootinfo, &policy_buffer,
+                                             &policy_size);
+        bootstrap_map(NULL);
+
+        if ( ret == -ENOENT )
+            /*
+             * The XSM module needs a policy file but one was not located.
+             * Report as a warning and continue as the XSM module may late
+             * load a policy file.
+             */
+            printk(XENLOG_WARNING "xsm: starting without a policy loaded!\n");
+        else if ( ret )
+            panic("Error %d initializing XSM policy\n", ret);
     }
 
     ret = xsm_core_init(policy_buffer, policy_size);
@@ -165,9 +178,9 @@ int __init xsm_multiboot_init(
 
     return 0;
 }
-#endif
 
-#ifdef CONFIG_HAS_DEVICE_TREE
+#else
+
 int __init xsm_dt_init(void)
 {
     int ret = 0;
@@ -215,9 +228,9 @@ bool __init has_xsm_magic(paddr_t start)
 
     return false;
 }
-#endif
+#endif /* CONFIG_HAS_DEVICE_TREE */
 
-#endif
+#endif /* CONFIG_XSM */
 
 long do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
diff --git a/xen/xsm/xsm_policy.c b/xen/xsm/xsm_policy.c
index c6df8c6e06..f1970c8964 100644
--- a/xen/xsm/xsm_policy.c
+++ b/xen/xsm/xsm_policy.c
@@ -18,62 +18,65 @@
  *
  */
 
-#include <xsm/xsm.h>
-#ifdef CONFIG_MULTIBOOT
-#include <asm/boot.h>
-#include <xen/multiboot.h>
-#include <asm/setup.h>
-#endif
 #include <xen/bitops.h>
+#ifndef CONFIG_HAS_DEVICE_TREE
+# include <xen/bootinfo.h>
+#endif
+#include <xsm/xsm.h>
 #ifdef CONFIG_HAS_DEVICE_TREE
-# include <asm/setup.h>
 # include <xen/device_tree.h>
+#else
+#include <asm/boot.h>
 #endif
 
-#ifdef CONFIG_MULTIBOOT
-int __init xsm_multiboot_policy_init(
-    unsigned long *module_map, const multiboot_info_t *mbi,
-    void **policy_buffer, size_t *policy_size)
+#include <asm/setup.h>
+
+#ifndef CONFIG_HAS_DEVICE_TREE
+int __init xsm_bootmodule_policy_init(
+    const struct boot_info *bootinfo, const unsigned char **policy_buffer,
+    size_t *policy_size)
 {
-    int i;
-    module_t *mod = (module_t *)__va(mbi->mods_addr);
-    int rc = 0;
+    unsigned long i;
+    int rc = -ENOENT;
     u32 *_policy_start;
     unsigned long _policy_len;
 
-    /*
-     * Try all modules and see whichever could be the binary policy.
-     * Adjust module_map for the module that is the binary policy.
-     */
-    for ( i = mbi->mods_count-1; i >= 1; i-- )
-    {
-        if ( !test_bit(i, module_map) )
-            continue;
+#ifdef CONFIG_XSM_FLASK_POLICY
+    /* Initially set to builtin policy, overriden if boot module is found. */
+    *policy_buffer = xsm_flask_init_policy;
+    *policy_size = xsm_flask_init_policy_size;
+    rc = 0;
+#endif
 
-        _policy_start = bootstrap_map_multiboot(mod + i);
-        _policy_len   = mod[i].mod_end;
+    i = bootmodule_index(bootinfo, BOOTMOD_UNKNOWN, 0);
+    while ( i < bootinfo->nr_mods )
+    {
+        _policy_start = bootstrap_map(&bootinfo->mods[i]);
+        _policy_len   = bootinfo->mods[i].size;
 
         if ( (xsm_magic_t)(*_policy_start) == XSM_MAGIC )
         {
-            *policy_buffer = _policy_start;
+            *policy_buffer = (unsigned char *)_policy_start;
             *policy_size = _policy_len;
 
             printk("Policy len %#lx, start at %p.\n",
                    _policy_len,_policy_start);
 
-            __clear_bit(i, module_map);
+            bootinfo->mods[i].bootmod_type = BOOTMOD_XSM;
+            rc = 0;
             break;
 
         }
 
         bootstrap_map(NULL);
+        i = bootmodule_index(bootinfo, BOOTMOD_UNKNOWN, ++i);
     }
 
     return rc;
 }
-#endif
 
-#ifdef CONFIG_HAS_DEVICE_TREE
+#else
+
 int __init xsm_dt_policy_init(void **policy_buffer, size_t *policy_size)
 {
     struct bootmodule *mod = boot_module_find_by_kind(BOOTMOD_XSM);
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 07:19:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 07:19:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557776.871444 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUsn-0007hy-BI; Sat, 01 Jul 2023 07:19:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557776.871444; Sat, 01 Jul 2023 07:19:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUsm-0007fn-TN; Sat, 01 Jul 2023 07:19:00 +0000
Received: by outflank-mailman (input) for mailman id 557776;
 Sat, 01 Jul 2023 07:18:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFUsl-00074A-4k
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 07:18:59 +0000
Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com
 [2607:f8b0:4864:20::733])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8ae6847b-17df-11ee-b237-6b7b168915f2;
 Sat, 01 Jul 2023 09:18:57 +0200 (CEST)
Received: by mail-qk1-x733.google.com with SMTP id
 af79cd13be357-765a7768f1dso259805885a.0
 for <xen-devel@lists.xenproject.org>; Sat, 01 Jul 2023 00:18:57 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s19-20020aa78d53000000b00673e652985bsm4108866pfe.118.2023.07.01.00.18.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 01 Jul 2023 00:18:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: 8ae6847b-17df-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688195936; x=1690787936;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=zZcp6XBY1YAC9oeotb5zJ/fGSdzt/Mx/a1Oe4w1mVBI=;
        b=ILmm9e/9lTp9GTg1saAsg7g1OS7yf4jCGZwg0akeM2mI0eRae5so14i3XdhUMh+qaa
         WvicC4epjfhJ1KgZeK/e5xz4jBIFr1AvNW1MB8zRZGTP3UqrTmEKUDwdJ7lYGNrL0kYo
         W7eJJCHmsS1p5VVGOTbmnt9B25qJIGISHnW/KS3zoRc6b0p5zTwjPDP1RlEkxvb9ai26
         Ff3gpgsic09OIQkUbADqfAmHETGZJiy3Lm/8TvvJqr6fuh3R7hBi4Mqs8pY02gL+6K7m
         Q+oAco6AU+2LzNqpPKBAyn2krxQOaAyH+0px9DeXfCeULpV16sLShIA+hMsZgendVEpi
         DGjA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688195936; x=1690787936;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=zZcp6XBY1YAC9oeotb5zJ/fGSdzt/Mx/a1Oe4w1mVBI=;
        b=gMstzg2ZJq6aYPb2GEvCv8vqtB2zsXuRZIvehsreBf9UcaAXI5F3HvfgFGfrU6XGea
         G6+u38UvLdQDOfJecvHaFgDEFnOlXXsnparkLx3XXYQQTFAqzrzWPWf0jBhrJdJx2cYn
         gWbu/JPva7D6/oyTNHuBXbTJOU6/sFR2YWpYh7BYt5YT/VjJmJXcCcG1cY9An5ARexlQ
         xrtLWWcSk1PiTeL1dnZuhUQqnQKiJ8cvMoEO52T9up/psg3VrGvA/ba1E5DIZU2O/m4V
         y3gKZczkTL6bymO536zkmgvLZrnaDTHFnE19GcMuj/mfeat9A7NjxxIe3SeXw5+G+RW+
         4toQ==
X-Gm-Message-State: AC+VfDzsuUMqzIcxBqUcyjhsOotH0TOLONiN8rttpgO2EFu0+vZZV8ez
	OWNB8X/AVzaR9h23vdp3gjxbnZqtBLI=
X-Google-Smtp-Source: ACHHUZ6G4ziS9OlcacmAYXEWytMGOapbZ5lrvuY5UYngxSJMQYFoJYsz5UXL9WWUNXBnxHWZfGdaKA==
X-Received: by 2002:a05:620a:450b:b0:767:2bb9:d187 with SMTP id t11-20020a05620a450b00b007672bb9d187mr6726381qkp.1.1688195936202;
        Sat, 01 Jul 2023 00:18:56 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 06/10] x86 setup, microcode: switch to the new bootinfo structures
Date: Sat,  1 Jul 2023 00:18:31 -0700
Message-Id: <20230701071835.41599-7-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701071835.41599-1-christopher.w.clark@gmail.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Next step in incremental work towards adding a non-multiboot internal
representation of boot modules, converting the fields being accessed for
the startup calculations.

Move the per-module scan logic into a dedicated function from the
iteration loop and set the BOOTMOD_UCODE module type when microcode is found.

Completes the conversion from the module_map bitmap in x86 setup so it
can be removed, along with the temporary bootstrap_map multiboot wrapper
since the last code that uses it is removed in this change.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

---
Changes since v1: patch is a subset of v1 series patches 2 and 3.
- Added the removal of the temporary bootstrap map function

 xen/arch/x86/cpu/microcode/core.c    | 148 +++++++++++++++------------
 xen/arch/x86/include/asm/boot.h      |  13 ---
 xen/arch/x86/include/asm/microcode.h |   7 +-
 xen/arch/x86/setup.c                 |   8 +-
 4 files changed, 89 insertions(+), 87 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index ce3c8042a2..d2cae9b6b4 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -22,12 +22,12 @@
  */
 
 #include <xen/alternative-call.h>
+#include <xen/bootinfo.h>
 #include <xen/cpu.h>
 #include <xen/earlycpio.h>
 #include <xen/err.h>
 #include <xen/guest_access.h>
 #include <xen/init.h>
-#include <xen/multiboot.h>
 #include <xen/param.h>
 #include <xen/spinlock.h>
 #include <xen/stop_machine.h>
@@ -57,7 +57,6 @@
  */
 #define MICROCODE_UPDATE_TIMEOUT_US 1000000
 
-static module_t __initdata ucode_mod;
 static signed int __initdata ucode_mod_idx;
 static bool_t __initdata ucode_mod_forced;
 static unsigned int nr_cores;
@@ -150,75 +149,109 @@ static int __init cf_check parse_ucode(const char *s)
 }
 custom_param("ucode", parse_ucode);
 
-void __init microcode_scan_module(
-    unsigned long *module_map,
-    const multiboot_info_t *mbi)
+#define MICROCODE_MODULE_MATCH 1
+#define MICROCODE_MODULE_NONMATCH 0
+
+static int __init microcode_check_module(struct boot_module *mod)
 {
-    module_t *mod = (module_t *)__va(mbi->mods_addr);
     uint64_t *_blob_start;
     unsigned long _blob_size;
-    struct cpio_data cd;
+    struct cpio_data cd = { NULL, 0 };
     long offset;
     const char *p = NULL;
-    int i;
-
-    ucode_blob.size = 0;
-    if ( !ucode_scan )
-        return;
 
     if ( boot_cpu_data.x86_vendor == X86_VENDOR_AMD )
         p = "kernel/x86/microcode/AuthenticAMD.bin";
     else if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
         p = "kernel/x86/microcode/GenuineIntel.bin";
     else
+        return -EFAULT;
+
+    _blob_start = bootstrap_map(mod);
+    _blob_size = mod->size;
+    if ( !_blob_start )
+    {
+        printk("Could not map multiboot module (0x%lx) (size: %ld)\n",
+               mod->start, _blob_size);
+        /* Non-fatal error, so just say no match */
+        return MICROCODE_MODULE_NONMATCH;
+    }
+
+    cd = find_cpio_data(p, _blob_start, _blob_size, &offset /* ignore */);
+
+    if ( cd.data )
+    {
+        ucode_blob.size = cd.size;
+        ucode_blob.data = cd.data;
+
+        mod->bootmod_type = BOOTMOD_UCODE;
+        return MICROCODE_MODULE_MATCH;
+    }
+
+    bootstrap_map(NULL);
+
+    return MICROCODE_MODULE_NONMATCH;
+}
+
+void __init microcode_scan_module(struct boot_info *bootinfo)
+{
+    int i;
+
+    if ( !ucode_scan )
         return;
 
-    /*
-     * Try all modules and see whichever could be the microcode blob.
-     */
-    for ( i = 1 /* Ignore dom0 kernel */; i < mbi->mods_count; i++ )
+    i = bootmodule_index(bootinfo, BOOTMOD_UNKNOWN, 0);
+    while ( i < bootinfo->nr_mods )
     {
-        if ( !test_bit(i, module_map) )
-            continue;
+        int ret = microcode_check_module(&bootinfo->mods[i]);
 
-        _blob_start = bootstrap_map_multiboot(&mod[i]);
-        _blob_size = mod[i].mod_end;
-        if ( !_blob_start )
+        switch ( ret )
         {
-            printk("Could not map multiboot module #%d (size: %ld)\n",
-                   i, _blob_size);
+        case MICROCODE_MODULE_MATCH:
+            return;
+        case MICROCODE_MODULE_NONMATCH:
+            i = bootmodule_index(bootinfo, BOOTMOD_UNKNOWN, ++i);
             continue;
+        default:
+            printk("%s: (err: %d) unable to check microcode\n",
+                   __func__, ret);
+            return;
         }
-        cd.data = NULL;
-        cd.size = 0;
-        cd = find_cpio_data(p, _blob_start, _blob_size, &offset /* ignore */);
-        if ( cd.data )
-        {
-            ucode_blob.size = cd.size;
-            ucode_blob.data = cd.data;
-            break;
-        }
-        bootstrap_map(NULL);
     }
 }
 
-static void __init microcode_grab_module(
-    unsigned long *module_map,
-    const multiboot_info_t *mbi)
+static void __init microcode_grab_module(struct boot_info *bootinfo)
 {
-    module_t *mod = (module_t *)__va(mbi->mods_addr);
+    ucode_blob.size = 0;
 
     if ( ucode_mod_idx < 0 )
-        ucode_mod_idx += mbi->mods_count;
-    if ( ucode_mod_idx <= 0 || ucode_mod_idx >= mbi->mods_count ||
-         !__test_and_clear_bit(ucode_mod_idx, module_map) )
-        goto scan;
-    ucode_mod = mod[ucode_mod_idx];
-scan:
+        ucode_mod_idx += bootinfo->nr_mods;
+    if ( ucode_mod_idx >= 0 &&  ucode_mod_idx <= bootinfo->nr_mods &&
+         bootinfo->mods[ucode_mod_idx].bootmod_type == BOOTMOD_UNKNOWN )
+    {
+        int ret = microcode_check_module(&bootinfo->mods[ucode_mod_idx]);
+
+        switch ( ret )
+        {
+        case MICROCODE_MODULE_MATCH:
+            return;
+        case MICROCODE_MODULE_NONMATCH:
+            break;
+        default:
+            printk("%s: (err: %d) unable to check microcode\n",
+                   __func__, ret);
+            return;
+        }
+    }
+
     if ( ucode_scan )
-        microcode_scan_module(module_map, mbi);
+        microcode_scan_module(bootinfo);
 }
 
+/* Undefining as they are not needed anymore */
+#undef MICROCODE_MODULE_MATCH
+#undef MICROCODE_MODULE_NONMATCH
+
 static struct microcode_ops __ro_after_init ucode_ops;
 
 static DEFINE_SPINLOCK(microcode_mutex);
@@ -738,11 +771,6 @@ static int __init cf_check microcode_init(void)
         ucode_blob.size = 0;
         ucode_blob.data = NULL;
     }
-    else if ( ucode_mod.mod_end )
-    {
-        bootstrap_map(NULL);
-        ucode_mod.mod_end = 0;
-    }
 
     return 0;
 }
@@ -786,8 +814,7 @@ static int __init early_update_cache(const void *data, size_t len)
     return rc;
 }
 
-int __init microcode_init_cache(unsigned long *module_map,
-                                const struct multiboot_info *mbi)
+int __init microcode_init_cache(struct boot_info *bootinfo)
 {
     int rc = 0;
 
@@ -796,12 +823,9 @@ int __init microcode_init_cache(unsigned long *module_map,
 
     if ( ucode_scan )
         /* Need to rescan the modules because they might have been relocated */
-        microcode_scan_module(module_map, mbi);
+        microcode_scan_module(bootinfo);
 
-    if ( ucode_mod.mod_end )
-        rc = early_update_cache(bootstrap_map_multiboot(&ucode_mod),
-                                ucode_mod.mod_end);
-    else if ( ucode_blob.size )
+    if ( ucode_blob.size )
         rc = early_update_cache(ucode_blob.data, ucode_blob.size);
 
     return rc;
@@ -819,11 +843,6 @@ static int __init early_microcode_update_cpu(void)
         len = ucode_blob.size;
         data = ucode_blob.data;
     }
-    else if ( ucode_mod.mod_end )
-    {
-        len = ucode_mod.mod_end;
-        data = bootstrap_map_multiboot(&ucode_mod);
-    }
 
     if ( !data )
         return -ENOMEM;
@@ -842,8 +861,7 @@ static int __init early_microcode_update_cpu(void)
     return microcode_update_cpu(patch);
 }
 
-int __init early_microcode_init(unsigned long *module_map,
-                                const struct multiboot_info *mbi)
+int __init early_microcode_init(struct boot_info *bootinfo)
 {
     const struct cpuinfo_x86 *c = &boot_cpu_data;
     int rc = 0;
@@ -867,11 +885,11 @@ int __init early_microcode_init(unsigned long *module_map,
         return -ENODEV;
     }
 
-    microcode_grab_module(module_map, mbi);
+    microcode_grab_module(bootinfo);
 
     ucode_ops.collect_cpu_info();
 
-    if ( ucode_mod.mod_end || ucode_blob.size )
+    if ( ucode_blob.size )
         rc = early_microcode_update_cpu();
 
     return rc;
diff --git a/xen/arch/x86/include/asm/boot.h b/xen/arch/x86/include/asm/boot.h
index bcf4f2e2e3..e51fd32280 100644
--- a/xen/arch/x86/include/asm/boot.h
+++ b/xen/arch/x86/include/asm/boot.h
@@ -6,19 +6,6 @@
 
 #include <asm/setup.h>
 
-static inline void *bootstrap_map_multiboot(const module_t *mod)
-{
-    struct boot_module bm;
-
-    if ( !mod )
-        return bootstrap_map(NULL);
-
-    bm.start = mod->mod_start << PAGE_SHIFT;
-    bm.size = mod->mod_end;
-
-    return bootstrap_map(&bm);
-}
-
 static inline unsigned long bootmodule_index(
     const struct boot_info *info, bootmod_type_t bootmod_type,
     unsigned long start)
diff --git a/xen/arch/x86/include/asm/microcode.h b/xen/arch/x86/include/asm/microcode.h
index 62ce3418f7..803fbbb270 100644
--- a/xen/arch/x86/include/asm/microcode.h
+++ b/xen/arch/x86/include/asm/microcode.h
@@ -1,6 +1,7 @@
 #ifndef ASM_X86__MICROCODE_H
 #define ASM_X86__MICROCODE_H
 
+#include <xen/bootinfo.h>
 #include <xen/types.h>
 #include <xen/percpu.h>
 
@@ -23,10 +24,8 @@ DECLARE_PER_CPU(struct cpu_signature, cpu_sig);
 
 void microcode_set_module(unsigned int idx);
 int microcode_update(XEN_GUEST_HANDLE(const_void), unsigned long len);
-int early_microcode_init(unsigned long *module_map,
-                         const struct multiboot_info *mbi);
-int microcode_init_cache(unsigned long *module_map,
-                         const struct multiboot_info *mbi);
+int early_microcode_init(struct boot_info *bootinfo);
+int microcode_init_cache(struct boot_info *bootinfo);
 int microcode_update_one(void);
 
 #endif /* ASM_X86__MICROCODE_H */
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index a616ccc0a8..50a1a124b0 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1023,7 +1023,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     unsigned int initrdidx, num_parked = 0;
     multiboot_info_t *mbi;
     module_t *mod;
-    unsigned long nr_pages, raw_max_page, module_map[1];
+    unsigned long nr_pages, raw_max_page;
     int i, j, e820_warn = 0, bytes = 0;
     unsigned long eb_start, eb_end;
     bool acpi_boot_table_init_done = false, relocated = false;
@@ -1190,8 +1190,6 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     }
 
     /* Dom0 kernel is the first boot module */
-    bitmap_fill(module_map, mbi->mods_count);
-    __clear_bit(0, module_map); /* Dom0 kernel is always first */
     boot_info->mods[0].bootmod_type = BOOTMOD_KERNEL;
 
     if ( pvh_boot )
@@ -1371,7 +1369,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
      * TODO: load ucode earlier once multiboot modules become accessible
      * at an earlier stage.
      */
-    early_microcode_init(module_map, mbi);
+    early_microcode_init(boot_info);
 
     if ( xen_phys_start )
     {
@@ -1906,7 +1904,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     timer_init();
 
-    microcode_init_cache(module_map, mbi); /* Needs xmalloc() */
+    microcode_init_cache(boot_info); /* Needs xmalloc() */
 
     tsx_init(); /* Needs microcode.  May change HLE/RTM feature bits. */
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 07:19:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 07:19:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557778.871457 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUso-00087N-JZ; Sat, 01 Jul 2023 07:19:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557778.871457; Sat, 01 Jul 2023 07:19:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUso-00085r-A4; Sat, 01 Jul 2023 07:19:02 +0000
Received: by outflank-mailman (input) for mailman id 557778;
 Sat, 01 Jul 2023 07:19:00 +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
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFUsm-0006No-Mf
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 07:19:00 +0000
Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com
 [2607:f8b0:4864:20::22c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8b9c26ca-17df-11ee-8611-37d641c3527e;
 Sat, 01 Jul 2023 09:18:59 +0200 (CEST)
Received: by mail-oi1-x22c.google.com with SMTP id
 5614622812f47-3a3373211a1so1922940b6e.0
 for <xen-devel@lists.xenproject.org>; Sat, 01 Jul 2023 00:18:58 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s19-20020aa78d53000000b00673e652985bsm4108866pfe.118.2023.07.01.00.18.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 01 Jul 2023 00:18:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: 8b9c26ca-17df-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688195937; x=1690787937;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=S6Cu78312/uyuTtWf3JY9jjpC+4RgagbuKLSP43QOoI=;
        b=UPbuVkZz1oAK/2LyG2d2Jw8INSlnXa/NlmFvB4kRqCC2gVqMidnQRphhgxR0TSHT+3
         0s32mnwZ5C2MiyRI81PFiG2f3X7YsruBzmry+l2xRuxLJooDABjPUd+qXphVLrAW/B+y
         6xxLai7iGBBcCRX9fk/IIKGyDalggyofNzF//yvHePzXSplMvL5ZaLhzY/JrPkWjxaqX
         D6SRMilMh4UjMDBVz35siAbBdhGqP/ThyZryTLkDquTjEDgVeLyQU2nu+7oabv4Fmg4k
         02BmtpWmfzce0nwrfyeA5AltLslsexA90Qc7lLM01L0VCpHq2WUAfmBo/Jp4+3M2gjMV
         Vmjw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688195937; x=1690787937;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=S6Cu78312/uyuTtWf3JY9jjpC+4RgagbuKLSP43QOoI=;
        b=RdSZPZBDpO2eSdqIUe7ETNoJ3aJ+B7n2f/NGW5SeC3KXHpcE/hC6pq6f92V+ZifejX
         ZiGjER0sfM9QcOuAZjlP0lGTGyGLh+uk3/VDk9o+KB4BL7qDl/mbpWVv+UYHkL23DSpv
         HWPtPmsDf9G9qKmj/CnrOiHUIG6qRBQ2zAEeI43J+DTj/T8J5x/zfGc76aYJYyHnxQpb
         WXqQB5D1Qn604Wf5+o+F0eo9xFaR4WfLtp0pPJvKLwdT5Hyzjfht7rFFjUaVWCTTILAH
         fRwYVSoOMIe3nbqfv4XgpSKkFP0O3gel7hpViWsq+IVfU4EVM1W+e8rRWMFIYupBJ4GY
         BODA==
X-Gm-Message-State: AC+VfDw80XbqQGGoPB5ca8mtmc4/RHNjaWUeNCbB5xMoKJ/ADRIkMSb5
	hJ8Gu2lhOLUkRVrrGiTiw4vtxwV2fqk=
X-Google-Smtp-Source: ACHHUZ5bs2jo7O3BDp2NAaVYCHQcw/ounbIgX+But52KUkZXfA77A5ZAv/5/HHJcZPqmWMwDeEj4RQ==
X-Received: by 2002:a05:6808:1917:b0:3a0:6949:c884 with SMTP id bf23-20020a056808191700b003a06949c884mr6924756oib.34.1688195937374;
        Sat, 01 Jul 2023 00:18:57 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 07/10] x86 boot: define paddr_t and add macros for typedefing struct pointers
Date: Sat,  1 Jul 2023 00:18:32 -0700
Message-Id: <20230701071835.41599-8-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701071835.41599-1-christopher.w.clark@gmail.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Pointer fields within structs need to be defined as fixed size types in
the x86 boot build environment. Using a typedef for the field type
rather than a struct pointer type enables the type definition to
be changed in the 32-bit boot build and the main hypervisor build,
allowing for a single common structure definition and a common header file.

Introduces DEFINE_STRUCT_PTR_TYPE and DEFINE_PTR_TYPE which will
generate typedefs with a _ptr_t suffix for pointers to the specified
type. This is then used in <xen/bootinfo.h> for pointers within structs
as preparation for using these headers in the x86 boot build.

The 32-bit behaviour is obtained by inclusion of "defs.h" first with a
check for such an existing definition on the <xen/types.h> version.

paddr_t is used in <xen/bootinfo.h> so a definition is added here to
the x86 boot environment defs.h header.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

---
Changes since v2: This is two v2 patches merged into one for v3.
Changes since v1: New in v2 of series.

 xen/arch/x86/boot/defs.h            |  9 +++++++++
 xen/arch/x86/include/asm/bootinfo.h |  4 +++-
 xen/include/xen/bootinfo.h          |  9 +++++----
 xen/include/xen/types.h             | 11 +++++++++++
 4 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/boot/defs.h b/xen/arch/x86/boot/defs.h
index f9840044ec..bc0f1b5cf8 100644
--- a/xen/arch/x86/boot/defs.h
+++ b/xen/arch/x86/boot/defs.h
@@ -60,4 +60,13 @@ typedef u64 uint64_t;
 #define U16_MAX		((u16)(~0U))
 #define UINT_MAX	(~0U)
 
+typedef unsigned long long paddr_t;
+
+#define DEFINE_STRUCT_PTR_TYPE(struct_name) \
+    typedef uint64_t struct_name ## _ptr_t;
+
+#define DEFINE_PTR_TYPE(type) \
+    typedef uint64_t type ## _ptr_t;
+DEFINE_PTR_TYPE(char);
+
 #endif /* __BOOT_DEFS_H__ */
diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index 30c27980e0..989fb7a1da 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -6,6 +6,7 @@ struct arch_bootmodule {
     uint32_t flags;
     unsigned headroom;
 };
+DEFINE_STRUCT_PTR_TYPE(arch_bootmodule);
 
 struct arch_boot_info {
     uint32_t flags;
@@ -14,11 +15,12 @@ struct arch_boot_info {
 #define BOOTINFO_FLAG_X86_MEMMAP       1U << 6
 #define BOOTINFO_FLAG_X86_LOADERNAME   1U << 9
 
-    char *boot_loader_name;
+    char_ptr_t boot_loader_name;
 
     uint32_t mmap_length;
     paddr_t mmap_addr;
 };
+DEFINE_STRUCT_PTR_TYPE(arch_boot_info);
 
 struct __packed mb_memmap {
     uint32_t size;
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
index 2f4284a91f..8389da4f72 100644
--- a/xen/include/xen/bootinfo.h
+++ b/xen/include/xen/bootinfo.h
@@ -35,17 +35,18 @@ struct boot_module {
     mfn_t mfn;
     size_t size;
 
-    struct arch_bootmodule *arch;
+    arch_bootmodule_ptr_t arch;
     struct boot_string string;
 };
+DEFINE_STRUCT_PTR_TYPE(boot_module);
 
 struct boot_info {
-    char *cmdline;
+    char_ptr_t cmdline;
 
     unsigned int nr_mods;
-    struct boot_module *mods;
+    boot_module_ptr_t mods;
 
-    struct arch_boot_info *arch;
+    arch_boot_info_ptr_t arch;
 };
 
 #endif
diff --git a/xen/include/xen/types.h b/xen/include/xen/types.h
index 6aba80500a..e807ffe255 100644
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -71,4 +71,15 @@ typedef bool bool_t;
 #define test_and_set_bool(b)   xchg(&(b), true)
 #define test_and_clear_bool(b) xchg(&(b), false)
 
+#ifndef DEFINE_STRUCT_PTR_TYPE
+#define DEFINE_STRUCT_PTR_TYPE(struct_name) \
+    typedef struct struct_name * struct_name ## _ptr_t;
+#endif
+
+#ifndef DEFINE_PTR_TYPE
+#define DEFINE_PTR_TYPE(type) \
+    typedef type * type ## _ptr_t;
+DEFINE_PTR_TYPE(char);
+#endif
+
 #endif /* __TYPES_H__ */
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 07:19:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 07:19:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557779.871463 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUsp-0008F6-6P; Sat, 01 Jul 2023 07:19:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557779.871463; Sat, 01 Jul 2023 07:19:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUso-0008CO-Rw; Sat, 01 Jul 2023 07:19:02 +0000
Received: by outflank-mailman (input) for mailman id 557779;
 Sat, 01 Jul 2023 07:19:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFUsn-00074A-Me
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 07:19:01 +0000
Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com
 [2607:f8b0:4864:20::22d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8cedc5e3-17df-11ee-b237-6b7b168915f2;
 Sat, 01 Jul 2023 09:19:01 +0200 (CEST)
Received: by mail-oi1-x22d.google.com with SMTP id
 5614622812f47-3a37909a64eso1780698b6e.1
 for <xen-devel@lists.xenproject.org>; Sat, 01 Jul 2023 00:19:01 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s19-20020aa78d53000000b00673e652985bsm4108866pfe.118.2023.07.01.00.18.58
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 01 Jul 2023 00:18:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: 8cedc5e3-17df-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688195939; x=1690787939;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=RNpBclJ1QG7nOEKI0nkpyN963wBmUeNZP6vxgwU4hxE=;
        b=kkt/3rzfOezqwdUdfeP22+AXirxs+V7vl98qrWv4iiVvJsilE8IFJzXmBmEaX/PLUX
         lw/OLqRFNRDap66MC+0gdgpB/Ap2zXzSIBFEE0S+1g7Z5yE5mqysVH6CJTGwGKVvXCEv
         pcetQV5sppLEG8Tn/5o/JgQm7GVCRfWToQacCEtPstUhrfKSmOFvUkrebntKu44THLG8
         GKi4rtOS+2hjrykz+X62a0+lZXAHzKPErnP1WmR5Zqpb7YJXCLmeOTih25cPXCfWOUld
         15dFSnZ0YQrnqdx+nDhNAzqzmzceDG1UJXNK8uM7Q1G+2GSsRsRJ0BnjJL3igJL1Bmyt
         JXZQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688195939; x=1690787939;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=RNpBclJ1QG7nOEKI0nkpyN963wBmUeNZP6vxgwU4hxE=;
        b=Vcml0c+Zwcyn1Hi3mZSxVUMiBbYKgXnlUcBF9h/Xj4YKuu4icXyQ9ZYH1VkBgVfANS
         D/xWXb03YoHyxtjEOH5z/1ABssV/LoOjG2nv0OAu41FcNMJmaLpa7EpqkUMUEjb45M6l
         oRqAD0ykz0nLNTCsAA3myN0Xw3IaH048xolTpPEbM27loL/7MUHA8nSGh+aKhxpFm+PR
         2p1ag9q3J3ztQ3A2fpqzracsVipprANFhT7g3YufW7/UeTMWUXo/+kY9ua6ZVvmlw1Sg
         uCAuBJBRIkFl67d1XU+larkq7Zl4Nj2jnTyBWjh1I7Q1OAYMvgz4tmiY41AY4THypHpx
         LdKA==
X-Gm-Message-State: AC+VfDznT4f16VH4NUrHOLSDSuy1UOU+Isd5cxug6CT9p7hw7iqjKnW2
	S/el3BxJ77RRlSDhXmy06bXi+jBQpg0=
X-Google-Smtp-Source: ACHHUZ5bYgzOgosZ6acapmMuq/fA7HvOVTh6FdoBs81Xwt7bcxLG96FryDU7aohNQTBeWJXvKMyaTg==
X-Received: by 2002:a05:6808:140d:b0:3a1:aef1:bbf3 with SMTP id w13-20020a056808140d00b003a1aef1bbf3mr5761717oiv.23.1688195939678;
        Sat, 01 Jul 2023 00:18:59 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 09/10] arm setup: use common integer-typed bootmod definition
Date: Sat,  1 Jul 2023 00:18:34 -0700
Message-Id: <20230701071835.41599-10-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701071835.41599-1-christopher.w.clark@gmail.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This change enables inclusion of <xen/bootinfo.h> in Arm builds,
required for subsequent patches in this series.

It replaces the enum definition of bootmodule_kind with bootmod_type_t
as enums are not fixed size as needed for packed structs which are
needed for boot structures in subsequent changes.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

---
New for v2 series.

 xen/arch/arm/include/asm/setup.h | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index 19dc637d55..7e0598217a 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -3,6 +3,7 @@
 
 #include <public/version.h>
 #include <asm/p2m.h>
+#include <xen/bootinfo.h>
 #include <xen/device_tree.h>
 
 #define MIN_FDT_ALIGN 8
@@ -12,15 +13,7 @@
 
 #define MAX_MODULES 32 /* Current maximum useful modules */
 
-typedef enum {
-    BOOTMOD_XEN,
-    BOOTMOD_FDT,
-    BOOTMOD_KERNEL,
-    BOOTMOD_RAMDISK,
-    BOOTMOD_XSM,
-    BOOTMOD_GUEST_DTB,
-    BOOTMOD_UNKNOWN
-}  bootmodule_kind;
+typedef bootmod_type_t bootmodule_kind;
 
 enum membank_type {
     /*
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 07:19:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 07:19:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557780.871469 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUsp-0008Pl-QP; Sat, 01 Jul 2023 07:19:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557780.871469; Sat, 01 Jul 2023 07:19:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUsp-0008Mf-FC; Sat, 01 Jul 2023 07:19:03 +0000
Received: by outflank-mailman (input) for mailman id 557780;
 Sat, 01 Jul 2023 07:19:01 +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
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFUsn-0006No-Mk
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 07:19:01 +0000
Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com
 [2607:f8b0:4864:20::72d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8c2d35ba-17df-11ee-8611-37d641c3527e;
 Sat, 01 Jul 2023 09:18:59 +0200 (CEST)
Received: by mail-qk1-x72d.google.com with SMTP id
 af79cd13be357-765a1690003so243658785a.0
 for <xen-devel@lists.xenproject.org>; Sat, 01 Jul 2023 00:18:59 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s19-20020aa78d53000000b00673e652985bsm4108866pfe.118.2023.07.01.00.18.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 01 Jul 2023 00:18:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: 8c2d35ba-17df-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688195938; x=1690787938;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=+QhG22aQsFtoXwrbtiP3WpdRgLLL1OgLfVThRSuYPKs=;
        b=Xufe3eFixvp3WBnPziVs80DQh009NwLwQM6EmrmrWavtVCOa8YgwA9pfjao+cAXVas
         Kyh7NFdj2mutOKU6e/K9NmVnVRMHMvvsxAHM2H7s/wdfwNUJqty255GlKJlQCu5vQg96
         yMvmF4cr8adBv12o8hV8+Gb6TT1qKi+BOtZsVa9JgUGb91VptVwDYhxigH7Plvht5kFk
         hQ/2poKjMCSRtoxMxmmCSgVCA1NxfbetFR38XRkeTHBaPjoW/7sJORRNsEHFsi/D9xsE
         bZgAsWrgM4RD3RrSSUWizUz9rFrt4Au3FDfBgUA6zCTlgR7lva9PPIsa/Ji9tGStjP2z
         jB/g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688195938; x=1690787938;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=+QhG22aQsFtoXwrbtiP3WpdRgLLL1OgLfVThRSuYPKs=;
        b=GSxg7PyvpWJqFMZpfXtx4qBks6uNAhGXozvuXZ2cZ1yfOOFu1QKtUHoMcvfqJJUt6r
         4CORg7jPzuI8XbnNnt4uX3n46gBNqm+GtqQvIXgZVwrJsNJ1JFYldpCOVRmgvH9Tc1WL
         7h7vRafMgsXrYxY1LH6GF66MDx+J7vgSADyiYd4qVscK+VT1G1degNTGXEt7nt557F2z
         Z+Qu3S8dGuQuv6lGiaRnHbKksNOSrHPtJEA71jo/tb35V9kWyeMslQw1uhMVHcku6ZOX
         Ij40XVFrHazidwcutEJgyvVDMa7gHCgt6yhU2kuY0JduptZXUEWy4guetiTBkd3mmmf3
         3EYQ==
X-Gm-Message-State: AC+VfDxSRZ4h6HhRklzePlI35OemwAa2XePstlp/6nqR88wmfhsIMGzZ
	LO3NDhPIfC0mEVC7O0ZkdojQ+PlZG2Q=
X-Google-Smtp-Source: ACHHUZ6vQvz5edMFsBO0yDqxfBhGyFJGqYSD7CweucRlegb7fUq3Gfct1s2EEfK8Q/Zr5W+gSLpFLg==
X-Received: by 2002:a05:620a:4010:b0:766:fa1f:4ea4 with SMTP id h16-20020a05620a401000b00766fa1f4ea4mr5546488qko.1.1688195938407;
        Sat, 01 Jul 2023 00:18:58 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 08/10] x86, arm, riscv: add per-arch bootinfo headers
Date: Sat,  1 Jul 2023 00:18:33 -0700
Message-Id: <20230701071835.41599-9-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701071835.41599-1-christopher.w.clark@gmail.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Changes to ensure that inclusion of <xen/bootinfo.h> succeeds in each
of the main archtecture builds and in the 32-bit early x86 boot build.

The <xen/bootinfo.h> header contains structures that will be used in efi
logic prior to the main start of Xen, so it needs to be suitable for
inclusion in Arm source files.

The same header will also be included in early x86 boot logic, where
asm/* headers are not reachable, and so they cannot be transitively
included, so a ifdef condition is needed to prevent an attempt to
include <asm/bootinfo.h> from within <xen/bootinfo.h> in that case.

The early x86 boot logic can then directly include <asm/bootinfo.h> via
a specified directory path where it can be included successfully.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

---
New for v2 series.

 xen/arch/arm/include/asm/bootinfo.h   | 20 ++++++++++++++++++++
 xen/arch/riscv/include/asm/bootinfo.h | 20 ++++++++++++++++++++
 xen/include/xen/bootinfo.h            |  7 ++-----
 3 files changed, 42 insertions(+), 5 deletions(-)
 create mode 100644 xen/arch/arm/include/asm/bootinfo.h
 create mode 100644 xen/arch/riscv/include/asm/bootinfo.h

diff --git a/xen/arch/arm/include/asm/bootinfo.h b/xen/arch/arm/include/asm/bootinfo.h
new file mode 100644
index 0000000000..5316c87a3d
--- /dev/null
+++ b/xen/arch/arm/include/asm/bootinfo.h
@@ -0,0 +1,20 @@
+#ifndef __ARCH_ARM_BOOTINFO_H__
+#define __ARCH_ARM_BOOTINFO_H__
+
+struct __packed arch_bootmodule { };
+DEFINE_STRUCT_PTR_TYPE(arch_bootmodule);
+
+struct __packed arch_boot_info { };
+DEFINE_STRUCT_PTR_TYPE(arch_boot_info);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/riscv/include/asm/bootinfo.h b/xen/arch/riscv/include/asm/bootinfo.h
new file mode 100644
index 0000000000..5316c87a3d
--- /dev/null
+++ b/xen/arch/riscv/include/asm/bootinfo.h
@@ -0,0 +1,20 @@
+#ifndef __ARCH_ARM_BOOTINFO_H__
+#define __ARCH_ARM_BOOTINFO_H__
+
+struct __packed arch_bootmodule { };
+DEFINE_STRUCT_PTR_TYPE(arch_bootmodule);
+
+struct __packed arch_boot_info { };
+DEFINE_STRUCT_PTR_TYPE(arch_boot_info);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
index 8389da4f72..bf5586a76b 100644
--- a/xen/include/xen/bootinfo.h
+++ b/xen/include/xen/bootinfo.h
@@ -5,11 +5,8 @@
 #include <xen/compiler.h>
 #include <xen/mm-frame.h>
 
-#ifdef CONFIG_X86
-#include <asm/bootinfo.h>
-#else
-    struct arch_bootmodule { };
-    struct arch_boot_info { };
+#if defined CONFIG_X86 || CONFIG_ARM || CONFIG_RISCV
+# include <asm/bootinfo.h>
 #endif
 
 /* Boot module binary type / purpose */
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 07:19:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 07:19:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557782.871489 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUss-0000iV-He; Sat, 01 Jul 2023 07:19:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557782.871489; Sat, 01 Jul 2023 07:19:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFUss-0000hD-BG; Sat, 01 Jul 2023 07:19:06 +0000
Received: by outflank-mailman (input) for mailman id 557782;
 Sat, 01 Jul 2023 07:19:05 +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
 <SRS0=ypVN=CT=gmail.com=christopher.w.clark.io@srs-se1.protection.inumbo.net>)
 id 1qFUsr-0006No-4Y
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 07:19:05 +0000
Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com
 [2607:f8b0:4864:20::736])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8dd6c1a5-17df-11ee-8611-37d641c3527e;
 Sat, 01 Jul 2023 09:19:02 +0200 (CEST)
Received: by mail-qk1-x736.google.com with SMTP id
 af79cd13be357-76243a787a7so258385885a.2
 for <xen-devel@lists.xenproject.org>; Sat, 01 Jul 2023 00:19:02 -0700 (PDT)
Received: from cog-dev.home ([70.103.208.83]) by smtp.gmail.com with ESMTPSA id
 s19-20020aa78d53000000b00673e652985bsm4108866pfe.118.2023.07.01.00.18.59
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 01 Jul 2023 00:19:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
X-Inumbo-ID: 8dd6c1a5-17df-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688195941; x=1690787941;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=kNW+AYrQKnLKNbbn3YFHqN8Eo0KMGaoZgm6SWc5V5+U=;
        b=qvF+gtJkoOs75NZJtm/YNXiKKQiLpYV8Y3dP7sx/ZVMfFQucgbJ4JPROG2R+wI/TQi
         a45pGXHMyaE0jPCw7+//2MUPsVP9KgAysnKEicYtp3WZovkZQQPlxCuA719HmyD74HO1
         unyeo+6N4GSUUDY/sgkLbehx0YyLJ2o97ems715x8/oHTNjpivLHonYtCgMz+Q0f7+CG
         zAx4YUuqf3WfpkY1ZSzqlQWmphc6LSVZojpSYHpqBWmmCUsIMxlBuzfmJ2PJgkRqt/l5
         7OJ6GJKmx+qSaaNCfsdhuOKIk2hhC33IzQkm6bAfGj9Zq+7GsSRBTlI48iWkpMGpNVIl
         +8iA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688195941; x=1690787941;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=kNW+AYrQKnLKNbbn3YFHqN8Eo0KMGaoZgm6SWc5V5+U=;
        b=LYMPLgOObjJDJQ9abW1bEqxVRVB0a0sJ6Q1OJ0TBjXzIU883r65zWgAxe0Dgj+9k+y
         ueKpRDY3oSJ3OlQFQKlp+Atnbfi/AJSLlRzFQemnaHpVsMvgaN/zJFJW1LMBC98caJ/3
         pYcRNMlyZvolvTgHNXiVYAF6ZRggXbYC14lVOjQAkvD0J6ErTL7sMpiifq6LjwTfEI1H
         I7iLX/NG45aQpBSWKrV6NHxN14xom1ak/gyiYkCEqgsQCtcrF5NJvWqqWgNDqvRVAlor
         B8EGL/guAC5wEBgFpL7Jm0leR/pMXN8U6Es4q2ZHQcPwyg53ZUk7ixVE9zexQSMvRWqI
         Z3Cg==
X-Gm-Message-State: AC+VfDw2h2rGKn68hsyPwWJY/EFLhzLRW1JQG+DcT7/BTS9HV6QKtL6g
	o94eiNEnQ+G9eAawjSpO7/uHLaFY3w0=
X-Google-Smtp-Source: APBJJlFJOLvrQlTlbqeQdDwnW6s8Hbn/JAaopGLjUO8Ra0690Bt6OVuKd2cSZp766Vnno7X0T+4SJQ==
X-Received: by 2002:a05:620a:2807:b0:767:382d:a203 with SMTP id f7-20020a05620a280700b00767382da203mr4959710qkp.36.1688195940769;
        Sat, 01 Jul 2023 00:19:00 -0700 (PDT)
Sender: Christopher Clark <christopher.w.clark.io@gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
	stefano.stabellini@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rich Persaud <persaur@gmail.com>
Subject: [PATCH 10/10] x86 setup: refactor efi, pvh and multiboot entrypoints to new boot info
Date: Sat,  1 Jul 2023 00:18:35 -0700
Message-Id: <20230701071835.41599-11-christopher.w.clark@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230701071835.41599-1-christopher.w.clark@gmail.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Previous commits added a transition point from multiboot v1 structures
to the new boot info structures at the earliest common point for all the
x86 entrypoints. The result is that each of the entrypoints would
construct a multiboot v1 structure from the structures used by each
entrypoint. Â This meant that multiboot2, EFI, and PVH all converted
their structures over to mutliboot v1 to only be converted again upon
entering __start_xen().

This commit drops the translation function and moves the population of
the new boot info structures down into the various entrypoints.

This change increases the maximum number of boot modules accepted on the
EFI entry path and the PVH entry path to the same fixed maximum number
accepted via multiboot, making it common across all x86 entry points.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

---
Changes since v1: patch is based on v1 series patch 4.
- use main bootinfo headers in boot logic instead of adding a 32-bit version
- apply packing to boot structures here rather than in earlier changes
- use a defined maximum number of boot modules rather than Kconfig'd variable

 xen/arch/arm/efi/efi-boot.h               |   6 +
 xen/arch/x86/boot/defs.h                  |   1 +
 xen/arch/x86/boot/reloc.c                 | 192 +++++++++++++++-------
 xen/arch/x86/efi/efi-boot.h               |  95 ++++++-----
 xen/arch/x86/guest/xen/pvh-boot.c         |  64 +++++---
 xen/arch/x86/include/asm/bootinfo.h       |   7 +-
 xen/arch/x86/include/asm/guest/pvh-boot.h |   6 +-
 xen/arch/x86/setup.c                      |  73 +++-----
 xen/common/efi/boot.c                     |   4 +-
 xen/include/xen/bootinfo.h                |   9 +-
 10 files changed, 278 insertions(+), 179 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index bb64925d70..d931fe06ed 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -1003,6 +1003,12 @@ static void __init efi_arch_flush_dcache_area(const void *vaddr, UINTN size)
     __flush_dcache_area(vaddr, size);
 }
 
+static struct boot_info __init *efi_arch_bootinfo_init(void)
+{
+    /* boot modules not currently in use on Arm so no init required here */
+    return NULL;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/x86/boot/defs.h b/xen/arch/x86/boot/defs.h
index bc0f1b5cf8..519ca4dae6 100644
--- a/xen/arch/x86/boot/defs.h
+++ b/xen/arch/x86/boot/defs.h
@@ -44,6 +44,7 @@
         _x > _y ? _x : _y; })
 
 #define _p(val)		((void *)(unsigned long)(val))
+#define _addr(val)  ((unsigned long)(void *)(val))
 
 #define tolower(c)	((c) | 0x20)
 
diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c
index e22bb974bf..8a48572d5f 100644
--- a/xen/arch/x86/boot/reloc.c
+++ b/xen/arch/x86/boot/reloc.c
@@ -27,6 +27,8 @@ asm (
     );
 
 #include "defs.h"
+#include "../include/asm/bootinfo.h"
+#include "../../../include/xen/bootinfo.h"
 #include "../../../include/xen/multiboot.h"
 #include "../../../include/xen/multiboot2.h"
 
@@ -138,65 +140,116 @@ static struct hvm_start_info *pvh_info_reloc(u32 in)
     return out;
 }
 
-static multiboot_info_t *mbi_reloc(u32 mbi_in)
+static struct boot_info *mbi_reloc(u32 mbi_in)
 {
+    const multiboot_info_t *mbi = _p(mbi_in);
+    struct boot_info *binfo;
+    struct arch_boot_info *arch_binfo;
     int i;
-    multiboot_info_t *mbi_out;
+    uint32_t ptr;
 
-    mbi_out = _p(copy_mem(mbi_in, sizeof(*mbi_out)));
+    ptr = alloc_mem(sizeof(*binfo));
+    zero_mem(ptr, sizeof(*binfo));
+    binfo = _p(ptr);
 
-    if ( mbi_out->flags & MBI_CMDLINE )
-        mbi_out->cmdline = copy_string(mbi_out->cmdline);
+    ptr = alloc_mem(sizeof(*arch_binfo));
+    zero_mem(ptr, sizeof(*arch_binfo));
+    binfo->arch = ptr;
+    arch_binfo = _p(ptr);
 
-    if ( mbi_out->flags & MBI_MODULES )
+    if ( mbi->flags & MBI_CMDLINE )
+    {
+        ptr = copy_string(mbi->cmdline);
+        binfo->cmdline = ptr;
+        arch_binfo->flags |= BOOTINFO_FLAG_X86_CMDLINE;
+    }
+
+    if ( mbi->flags & MBI_MODULES )
     {
         module_t *mods;
+        struct boot_module *bi_mods;
+        struct arch_bootmodule *arch_bi_mods;
+
+        /*
+         * We have to allocate one more module slot here. At some point
+         * __start_xen() may put Xen image placement into it.
+         */
+        ptr = alloc_mem((mbi->mods_count + 1) * sizeof(*bi_mods));
+        binfo->nr_mods = mbi->mods_count;
+        binfo->mods = ptr;
+        bi_mods = _p(ptr);
 
-        mbi_out->mods_addr = copy_mem(mbi_out->mods_addr,
-                                      mbi_out->mods_count * sizeof(module_t));
+        ptr = alloc_mem((mbi->mods_count + 1) * sizeof(*arch_bi_mods));
+        arch_bi_mods = _p(ptr);
 
-        mods = _p(mbi_out->mods_addr);
+        /* map the +1 allocated for Xen image */
+        bi_mods[mbi->mods_count].arch = _addr(&arch_bi_mods[mbi->mods_count]);
 
-        for ( i = 0; i < mbi_out->mods_count; i++ )
+        arch_binfo->flags |= BOOTINFO_FLAG_X86_MODULES;
+
+        mods = _p(mbi->mods_addr);
+
+        for ( i = 0; i < mbi->mods_count; i++ )
         {
+            bi_mods[i].start = mods[i].mod_start;
+            bi_mods[i].size = mods[i].mod_end - mods[i].mod_start;
+
             if ( mods[i].string )
-                mods[i].string = copy_string(mods[i].string);
+            {
+                int j;
+                char *c = _p(mods[i].string);
+
+                for ( j = 0; *c != '\0'; j++, c++ )
+                    bi_mods[i].string.bytes[j] = *c;
+
+                bi_mods[i].string.len = j + 1;
+            }
+
+            bi_mods[i].arch = _addr(&arch_bi_mods[i]);
         }
     }
 
-    if ( mbi_out->flags & MBI_MEMMAP )
-        mbi_out->mmap_addr = copy_mem(mbi_out->mmap_addr, mbi_out->mmap_length);
-
-    if ( mbi_out->flags & MBI_LOADERNAME )
-        mbi_out->boot_loader_name = copy_string(mbi_out->boot_loader_name);
+    if ( mbi->flags & MBI_MEMMAP )
+    {
+        arch_binfo->mmap_addr = copy_mem(mbi->mmap_addr, mbi->mmap_length);
+        arch_binfo->mmap_length = mbi->mmap_length;
+        arch_binfo->flags |= BOOTINFO_FLAG_X86_MEMMAP;
+    }
 
-    /* Mask features we don't understand or don't relocate. */
-    mbi_out->flags &= (MBI_MEMLIMITS |
-                       MBI_CMDLINE |
-                       MBI_MODULES |
-                       MBI_MEMMAP |
-                       MBI_LOADERNAME);
+    if ( mbi->flags & MBI_LOADERNAME )
+    {
+        ptr = copy_string(mbi->boot_loader_name);
+        arch_binfo->boot_loader_name = ptr;
+        arch_binfo->flags |= BOOTINFO_FLAG_X86_LOADERNAME;
+    }
 
-    return mbi_out;
+    return binfo;
 }
 
-static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, uint32_t video_out)
+static struct boot_info *mbi2_reloc(uint32_t mbi_in, uint32_t video_out)
 {
     const multiboot2_fixed_t *mbi_fix = _p(mbi_in);
     const multiboot2_memory_map_t *mmap_src;
     const multiboot2_tag_t *tag;
-    module_t *mbi_out_mods = NULL;
     memory_map_t *mmap_dst;
-    multiboot_info_t *mbi_out;
+    struct boot_info *binfo;
+    struct arch_boot_info *arch_binfo;
+    struct boot_module *bi_mods;
+    struct arch_bootmodule *arch_bi_mods;
 #ifdef CONFIG_VIDEO
     struct boot_video_info *video = NULL;
 #endif
     u32 ptr;
     unsigned int i, mod_idx = 0;
 
-    ptr = alloc_mem(sizeof(*mbi_out));
-    mbi_out = _p(ptr);
-    zero_mem(ptr, sizeof(*mbi_out));
+    ptr = alloc_mem(sizeof(*binfo));
+    zero_mem(ptr, sizeof(*binfo));
+    binfo = _p(ptr);
+
+    ptr = alloc_mem(sizeof(*arch_binfo));
+    zero_mem(ptr, sizeof(*arch_binfo));
+    binfo->arch = ptr;
+    arch_binfo = _p(ptr);
 
     /* Skip Multiboot2 information fixed part. */
     ptr = ALIGN_UP(mbi_in + sizeof(*mbi_fix), MULTIBOOT2_TAG_ALIGN);
@@ -206,21 +259,28 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, uint32_t video_out)
           tag = _p(ALIGN_UP((u32)tag + tag->size, MULTIBOOT2_TAG_ALIGN)) )
     {
         if ( tag->type == MULTIBOOT2_TAG_TYPE_MODULE )
-            ++mbi_out->mods_count;
+            ++binfo->nr_mods;
         else if ( tag->type == MULTIBOOT2_TAG_TYPE_END )
             break;
     }
 
-    if ( mbi_out->mods_count )
+    if ( binfo->nr_mods )
     {
-        mbi_out->flags |= MBI_MODULES;
         /*
          * We have to allocate one more module slot here. At some point
          * __start_xen() may put Xen image placement into it.
          */
-        mbi_out->mods_addr = alloc_mem((mbi_out->mods_count + 1) *
-                                       sizeof(*mbi_out_mods));
-        mbi_out_mods = _p(mbi_out->mods_addr);
+        ptr = alloc_mem((binfo->nr_mods + 1) * sizeof(*bi_mods));
+        binfo->mods = ptr;
+        bi_mods = _p(ptr);
+
+        ptr = alloc_mem((binfo->nr_mods + 1) * sizeof(*arch_bi_mods));
+        arch_bi_mods = _p(ptr);
+
+        /* map the +1 allocated for Xen image */
+        bi_mods[binfo->nr_mods].arch = _addr(&arch_bi_mods[binfo->nr_mods]);
+
+        arch_binfo->flags |= BOOTINFO_FLAG_X86_MODULES;
     }
 
     /* Skip Multiboot2 information fixed part. */
@@ -232,39 +292,42 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, uint32_t video_out)
         switch ( tag->type )
         {
         case MULTIBOOT2_TAG_TYPE_BOOT_LOADER_NAME:
-            mbi_out->flags |= MBI_LOADERNAME;
             ptr = get_mb2_string(tag, string, string);
-            mbi_out->boot_loader_name = copy_string(ptr);
+            arch_binfo->boot_loader_name = copy_string(ptr);
+            arch_binfo->flags |= BOOTINFO_FLAG_X86_LOADERNAME;
             break;
 
         case MULTIBOOT2_TAG_TYPE_CMDLINE:
-            mbi_out->flags |= MBI_CMDLINE;
             ptr = get_mb2_string(tag, string, string);
-            mbi_out->cmdline = copy_string(ptr);
+            binfo->cmdline = copy_string(ptr);
+            arch_binfo->flags |= BOOTINFO_FLAG_X86_CMDLINE;
             break;
 
         case MULTIBOOT2_TAG_TYPE_BASIC_MEMINFO:
-            mbi_out->flags |= MBI_MEMLIMITS;
-            mbi_out->mem_lower = get_mb2_data(tag, basic_meminfo, mem_lower);
-            mbi_out->mem_upper = get_mb2_data(tag, basic_meminfo, mem_upper);
+            arch_binfo->mem_lower = get_mb2_data(tag, basic_meminfo,
+                                                    mem_lower);
+            arch_binfo->mem_upper = get_mb2_data(tag, basic_meminfo,
+                                                    mem_upper);
             break;
 
         case MULTIBOOT2_TAG_TYPE_MMAP:
             if ( get_mb2_data(tag, mmap, entry_size) < sizeof(*mmap_src) )
                 break;
 
-            mbi_out->flags |= MBI_MEMMAP;
-            mbi_out->mmap_length = get_mb2_data(tag, mmap, size);
-            mbi_out->mmap_length -= sizeof(multiboot2_tag_mmap_t);
-            mbi_out->mmap_length /= get_mb2_data(tag, mmap, entry_size);
-            mbi_out->mmap_length *= sizeof(*mmap_dst);
+            arch_binfo->mmap_length = get_mb2_data(tag, mmap, size);
+            arch_binfo->mmap_length -= sizeof(multiboot2_tag_mmap_t);
+            arch_binfo->mmap_length /= get_mb2_data(tag, mmap, entry_size);
+            arch_binfo->mmap_length *= sizeof(*mmap_dst);
 
-            mbi_out->mmap_addr = alloc_mem(mbi_out->mmap_length);
+            arch_binfo->mmap_addr = alloc_mem(arch_binfo->mmap_length);
+            arch_binfo->flags |= BOOTINFO_FLAG_X86_MEMMAP;
 
             mmap_src = get_mb2_data(tag, mmap, entries);
-            mmap_dst = _p(mbi_out->mmap_addr);
+            mmap_dst = _p(arch_binfo->mmap_addr);
 
-            for ( i = 0; i < mbi_out->mmap_length / sizeof(*mmap_dst); i++ )
+            for ( i = 0;
+                  i < arch_binfo->mmap_length / sizeof(*mmap_dst);
+                  i++ )
             {
                 /* Init size member properly. */
                 mmap_dst[i].size = sizeof(*mmap_dst);
@@ -280,14 +343,27 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, uint32_t video_out)
             break;
 
         case MULTIBOOT2_TAG_TYPE_MODULE:
-            if ( mod_idx >= mbi_out->mods_count )
+            if ( mod_idx >= binfo->nr_mods )
                 break;
 
-            mbi_out_mods[mod_idx].mod_start = get_mb2_data(tag, module, mod_start);
-            mbi_out_mods[mod_idx].mod_end = get_mb2_data(tag, module, mod_end);
+            bi_mods[mod_idx].start = get_mb2_data(tag, module, mod_start);
+            bi_mods[mod_idx].size = get_mb2_data(tag, module, mod_end)
+                                            - bi_mods[mod_idx].start;
+
             ptr = get_mb2_string(tag, module, cmdline);
-            mbi_out_mods[mod_idx].string = copy_string(ptr);
-            mbi_out_mods[mod_idx].reserved = 0;
+            if ( ptr )
+            {
+                int i;
+                char *c = _p(ptr);
+
+                for ( i = 0; *c != '\0'; i++, c++ )
+                    bi_mods[mod_idx].string.bytes[i] = *c;
+
+                bi_mods[mod_idx].string.len = i + 1;
+            }
+
+            bi_mods[mod_idx].arch = _addr(&arch_bi_mods[mod_idx]);
+
             ++mod_idx;
             break;
 
@@ -344,11 +420,11 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, uint32_t video_out)
         video->orig_video_isVGA = 0x23;
 #endif
 
-    return mbi_out;
+    return binfo;
 }
 
-void *__stdcall reloc(uint32_t magic, uint32_t in, uint32_t trampoline,
-                      uint32_t video_info)
+void *__stdcall reloc(
+    uint32_t magic, uint32_t in, uint32_t trampoline, uint32_t video_info)
 {
     alloc = trampoline;
 
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 64c1a02cf1..c05759b761 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -11,14 +11,17 @@
 #include <asm/setup.h>
 
 static struct file __initdata ucode;
-static multiboot_info_t __initdata mbi = {
-    .flags = MBI_MODULES | MBI_LOADERNAME
-};
+
+static struct boot_info __initdata efi_bi;
+static struct arch_boot_info __initdata efi_bi_arch;
 /*
  * The array size needs to be one larger than the number of modules we
  * support - see __start_xen().
  */
-static module_t __initdata mb_modules[5];
+static struct boot_module __initdata efi_mods[MAX_NR_BOOTMODS + 1];
+static struct arch_bootmodule __initdata efi_arch_mods[MAX_NR_BOOTMODS + 1];
+
+static const char *__initdata efi_loader = "PVH Directboot";
 
 static void __init edd_put_string(u8 *dst, size_t n, const char *src)
 {
@@ -271,20 +274,37 @@ static void __init noreturn efi_arch_post_exit_boot(void)
                    : [cr3] "r" (idle_pg_table),
                      [cs] "i" (__HYPERVISOR_CS),
                      [ds] "r" (__HYPERVISOR_DS),
-                     "D" (&mbi)
+                     "D" (&efi_bi)
                    : "memory" );
     unreachable();
 }
 
-static void __init efi_arch_cfg_file_early(const EFI_LOADED_IMAGE *image,
-                                           EFI_FILE_HANDLE dir_handle,
-                                           const char *section)
+static struct boot_info __init *efi_arch_bootinfo_init(void)
 {
+    int i;
+
+    efi_bi.arch = &efi_bi_arch;
+    efi_bi.mods = efi_mods;
+
+    for ( i=0; i <= MAX_NR_BOOTMODS; i++ )
+        efi_bi.mods[i].arch = &efi_arch_mods[i];
+
+    efi_bi_arch.boot_loader_name = _p(efi_loader);
+
+    efi_bi_arch.flags = BOOTINFO_FLAG_X86_MODULES |
+                        BOOTINFO_FLAG_X86_LOADERNAME;
+    return &efi_bi;
 }
 
-static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
-                                          EFI_FILE_HANDLE dir_handle,
-                                          const char *section)
+static void __init efi_arch_cfg_file_early(
+    const EFI_LOADED_IMAGE *image, EFI_FILE_HANDLE dir_handle,
+    const char *section)
+{
+}
+
+static void __init efi_arch_cfg_file_late(
+    const EFI_LOADED_IMAGE *image, EFI_FILE_HANDLE dir_handle,
+    const char *section)
 {
     union string name;
 
@@ -296,16 +316,15 @@ static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
         name.s = get_value(&cfg, "global", "ucode");
     if ( name.s )
     {
-        microcode_set_module(mbi.mods_count);
+        microcode_set_module(efi_bi.nr_mods);
         split_string(name.s);
         read_file(dir_handle, s2w(&name), &ucode, NULL);
         efi_bs->FreePool(name.w);
     }
 }
 
-static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
-                                           CHAR16 *cmdline_options,
-                                           const char *cfgfile_options)
+static void __init efi_arch_handle_cmdline(
+    CHAR16 *image_name, CHAR16 *cmdline_options, const char *cfgfile_options)
 {
     union string name;
 
@@ -313,10 +332,10 @@ static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
     {
         name.w = cmdline_options;
         w2s(&name);
-        place_string(&mbi.cmdline, name.s);
+        place_string((uint32_t *)efi_bi.cmdline, name.s);
     }
     if ( cfgfile_options )
-        place_string(&mbi.cmdline, cfgfile_options);
+        place_string((uint32_t *)efi_bi.cmdline, cfgfile_options);
     /* Insert image name last, as it gets prefixed to the other options. */
     if ( image_name )
     {
@@ -325,16 +344,10 @@ static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
     }
     else
         name.s = "xen";
-    place_string(&mbi.cmdline, name.s);
+    place_string((uint32_t *)efi_bi.cmdline, name.s);
 
-    if ( mbi.cmdline )
-        mbi.flags |= MBI_CMDLINE;
-    /*
-     * These must not be initialized statically, since the value must
-     * not get relocated when processing base relocations later.
-     */
-    mbi.boot_loader_name = (long)"EFI";
-    mbi.mods_addr = (long)mb_modules;
+    if ( efi_bi.cmdline )
+        efi_bi_arch.flags |= BOOTINFO_FLAG_X86_CMDLINE;
 }
 
 static void __init efi_arch_edd(void)
@@ -704,9 +717,8 @@ static void __init efi_arch_memory_setup(void)
 #undef l2_4G_offset
 }
 
-static void __init efi_arch_handle_module(const struct file *file,
-                                          const CHAR16 *name,
-                                          const char *options)
+static void __init efi_arch_handle_module(
+    const struct file *file, const CHAR16 *name, const char *options)
 {
     union string local_name;
     void *ptr;
@@ -724,17 +736,24 @@ static void __init efi_arch_handle_module(const struct file *file,
     w2s(&local_name);
 
     /*
-     * If options are provided, put them in
-     * mb_modules[mbi.mods_count].string after the filename, with a space
-     * separating them.  place_string() prepends strings and adds separating
-     * spaces, so the call order is reversed.
+     * Set module string to filename and if options are provided, put them in
+     * after the filename, with a space separating them.
      */
+    strlcpy(efi_bi.mods[efi_bi.nr_mods].string.bytes, local_name.s,
+                 BOOTMOD_STRING_MAX_LEN);
     if ( options )
-        place_string(&mb_modules[mbi.mods_count].string, options);
-    place_string(&mb_modules[mbi.mods_count].string, local_name.s);
-    mb_modules[mbi.mods_count].mod_start = file->addr >> PAGE_SHIFT;
-    mb_modules[mbi.mods_count].mod_end = file->size;
-    ++mbi.mods_count;
+    {
+        strlcat(efi_bi.mods[efi_bi.nr_mods].string.bytes, " ",
+                BOOTMOD_STRING_MAX_LEN);
+        strlcat(efi_bi.mods[efi_bi.nr_mods].string.bytes, options,
+                BOOTMOD_STRING_MAX_LEN);
+    }
+
+    efi_bi.mods[efi_bi.nr_mods].start = file->addr;
+    efi_bi.mods[efi_bi.nr_mods].mfn = maddr_to_mfn(file->addr);
+    efi_bi.mods[efi_bi.nr_mods].size = file->size;
+
+    ++efi_bi.nr_mods;
     efi_bs->FreePool(ptr);
 }
 
diff --git a/xen/arch/x86/guest/xen/pvh-boot.c b/xen/arch/x86/guest/xen/pvh-boot.c
index 1ed04d035c..dd10a358da 100644
--- a/xen/arch/x86/guest/xen/pvh-boot.c
+++ b/xen/arch/x86/guest/xen/pvh-boot.c
@@ -6,6 +6,7 @@
  *
  * Copyright (c) 2017 Citrix Systems Ltd.
  */
+#include <xen/bootinfo.h>
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/mm.h>
@@ -20,12 +21,28 @@
 bool __initdata pvh_boot;
 uint32_t __initdata pvh_start_info_pa;
 
-static multiboot_info_t __initdata pvh_mbi;
-static module_t __initdata pvh_mbi_mods[8];
-static const char *__initdata pvh_loader = "PVH Directboot";
+static struct boot_info __initdata pvh_bi;
+static struct arch_boot_info __initdata arch_pvh_bi;
+static struct boot_module __initdata pvh_mods[MAX_NR_BOOTMODS + 1];
+static struct arch_bootmodule __initdata arch_pvh_mods[MAX_NR_BOOTMODS + 1];
+static char __initdata *pvh_loader = "PVH Directboot";
 
-static void __init convert_pvh_info(multiboot_info_t **mbi,
-                                    module_t **mod)
+static struct boot_info __init *init_pvh_info(void)
+{
+    int i;
+
+    pvh_bi.arch = &arch_pvh_bi;
+    pvh_bi.mods = pvh_mods;
+
+    for ( i=0; i <= MAX_NR_BOOTMODS; i++ )
+        pvh_bi.mods[i].arch = &arch_pvh_mods[i];
+
+    pvh_bi.arch->boot_loader_name = pvh_loader;
+
+    return &pvh_bi;
+}
+
+static void __init convert_pvh_info(struct boot_info *bi)
 {
     const struct hvm_start_info *pvh_info = __va(pvh_start_info_pa);
     const struct hvm_modlist_entry *entry;
@@ -39,23 +56,22 @@ static void __init convert_pvh_info(multiboot_info_t **mbi,
      * required. The extra element is used to aid relocation. See
      * arch/x86/setup.c:__start_xen().
      */
-    if ( ARRAY_SIZE(pvh_mbi_mods) <= pvh_info->nr_modules )
+    if ( ARRAY_SIZE(pvh_mods) <= pvh_info->nr_modules )
         panic("The module array is too small, size %zu, requested %u\n",
-              ARRAY_SIZE(pvh_mbi_mods), pvh_info->nr_modules);
+              ARRAY_SIZE(pvh_mods), pvh_info->nr_modules);
 
     /*
      * Turn hvm_start_info into mbi. Luckily all modules are placed under 4GB
      * boundary on x86.
      */
-    pvh_mbi.flags = MBI_CMDLINE | MBI_MODULES | MBI_LOADERNAME;
+    bi->arch->flags = BOOTINFO_FLAG_X86_CMDLINE | BOOTINFO_FLAG_X86_MODULES
+                      | BOOTINFO_FLAG_X86_LOADERNAME;
 
     BUG_ON(pvh_info->cmdline_paddr >> 32);
-    pvh_mbi.cmdline = pvh_info->cmdline_paddr;
-    pvh_mbi.boot_loader_name = __pa(pvh_loader);
+    bi->cmdline = _p(__va(pvh_info->cmdline_paddr));
 
-    BUG_ON(pvh_info->nr_modules >= ARRAY_SIZE(pvh_mbi_mods));
-    pvh_mbi.mods_count = pvh_info->nr_modules;
-    pvh_mbi.mods_addr = __pa(pvh_mbi_mods);
+    BUG_ON(pvh_info->nr_modules >= ARRAY_SIZE(pvh_mods));
+    bi->nr_mods = pvh_info->nr_modules;
 
     entry = __va(pvh_info->modlist_paddr);
     for ( i = 0; i < pvh_info->nr_modules; i++ )
@@ -63,15 +79,18 @@ static void __init convert_pvh_info(multiboot_info_t **mbi,
         BUG_ON(entry[i].paddr >> 32);
         BUG_ON(entry[i].cmdline_paddr >> 32);
 
-        pvh_mbi_mods[i].mod_start = entry[i].paddr;
-        pvh_mbi_mods[i].mod_end   = entry[i].paddr + entry[i].size;
-        pvh_mbi_mods[i].string    = entry[i].cmdline_paddr;
+        bi->mods[i].start = entry[i].paddr;
+        bi->mods[i].size  = entry[i].size;
+        if ( entry[i].cmdline_paddr)
+        {
+            char *c = _p(__va(entry[i].cmdline_paddr));
+
+            safe_strcpy(bi->mods[i].string.bytes, c);
+            bi->mods[i].string.kind = BOOTSTR_CMDLINE;
+        }
     }
 
     rsdp_hint = pvh_info->rsdp_paddr;
-
-    *mbi = &pvh_mbi;
-    *mod = pvh_mbi_mods;
 }
 
 static void __init get_memory_map(void)
@@ -88,13 +107,16 @@ static void __init get_memory_map(void)
     sanitize_e820_map(e820_raw.map, &e820_raw.nr_map);
 }
 
-void __init pvh_init(multiboot_info_t **mbi, module_t **mod)
+void __init pvh_init(struct boot_info **bi)
 {
-    convert_pvh_info(mbi, mod);
+    *bi = init_pvh_info();
+    convert_pvh_info(*bi);
 
     hypervisor_probe();
     ASSERT(xen_guest);
 
+    (*bi)->arch->xen_guest = xen_guest;
+
     get_memory_map();
 }
 
diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index 989fb7a1da..c1ed76fd3e 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -1,14 +1,14 @@
 #ifndef __ARCH_X86_BOOTINFO_H__
 #define __ARCH_X86_BOOTINFO_H__
 
-struct arch_bootmodule {
+struct __packed arch_bootmodule {
 #define BOOTMOD_FLAG_X86_RELOCATED     1U << 0
     uint32_t flags;
     unsigned headroom;
 };
 DEFINE_STRUCT_PTR_TYPE(arch_bootmodule);
 
-struct arch_boot_info {
+struct __packed arch_boot_info {
     uint32_t flags;
 #define BOOTINFO_FLAG_X86_CMDLINE      1U << 2
 #define BOOTINFO_FLAG_X86_MODULES      1U << 3
@@ -17,6 +17,9 @@ struct arch_boot_info {
 
     char_ptr_t boot_loader_name;
 
+    uint32_t mem_lower;
+    uint32_t mem_upper;
+
     uint32_t mmap_length;
     paddr_t mmap_addr;
 };
diff --git a/xen/arch/x86/include/asm/guest/pvh-boot.h b/xen/arch/x86/include/asm/guest/pvh-boot.h
index 247ba6899e..c820b0bf88 100644
--- a/xen/arch/x86/include/asm/guest/pvh-boot.h
+++ b/xen/arch/x86/include/asm/guest/pvh-boot.h
@@ -8,13 +8,13 @@
 #ifndef __X86_PVH_BOOT_H__
 #define __X86_PVH_BOOT_H__
 
-#include <xen/multiboot.h>
+#include <xen/bootinfo.h>
 
 #ifdef CONFIG_PVH_GUEST
 
 extern bool pvh_boot;
 
-void pvh_init(multiboot_info_t **mbi, module_t **mod);
+void __init pvh_init(struct boot_info **bi);
 void pvh_print_info(void);
 
 #else
@@ -23,7 +23,7 @@ void pvh_print_info(void);
 
 #define pvh_boot 0
 
-static inline void pvh_init(multiboot_info_t **mbi, module_t **mod)
+static inline void __init pvh_init(struct boot_info **bi)
 {
     ASSERT_UNREACHABLE();
 }
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 50a1a124b0..05a76a5959 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -13,7 +13,6 @@
 #include <xen/console.h>
 #include <xen/serial.h>
 #include <xen/trace.h>
-#include <xen/multiboot.h>
 #include <xen/domain_page.h>
 #include <xen/version.h>
 #include <xen/hypercall.h>
@@ -60,9 +59,6 @@
 #include <asm/prot-key.h>
 #include <asm/pv/domain.h>
 
-/* Max number of boot modules a bootloader can provide in addition to Xen */
-#define MAX_NR_BOOTMODS 63
-
 /* opt_nosmp: If true, secondary processors are ignored. */
 static bool __initdata opt_nosmp;
 boolean_param("nosmp", opt_nosmp);
@@ -275,46 +271,6 @@ custom_param("acpi", parse_acpi_param);
 
 static struct boot_info __initdata *boot_info;
 
-static void __init multiboot_to_bootinfo(multiboot_info_t *mbi, module_t *mods)
-{
-    static struct boot_info       __initdata info;
-    static struct arch_boot_info  __initdata arch_info;
-    static struct boot_module     __initdata boot_mods[MAX_NR_BOOTMODS + 1];
-    static struct arch_bootmodule __initdata arch_boot_mods[
-                                                       MAX_NR_BOOTMODS + 1];
-
-    int i;
-
-    info.arch = &arch_info;
-    info.mods = boot_mods;
-
-    info.cmdline = __va(mbi->cmdline);
-
-    /* The BOOTINFO_FLAG_X86_* flags are a 1-1 map to MBI_* */
-    arch_info.flags = mbi->flags;
-    arch_info.mmap_length = mbi->mmap_length;
-    arch_info.mmap_addr = mbi->mmap_addr;
-    arch_info.boot_loader_name = __va(mbi->boot_loader_name);
-
-    info.nr_mods = mbi->mods_count;
-    for ( i = 0; i <= MAX_NR_BOOTMODS; i++ )
-    {
-        boot_mods[i].arch = &arch_boot_mods[i];
-
-        if ( i < info.nr_mods )
-        {
-            bootmodule_update_start(&boot_mods[i], mods[i].mod_start);
-            boot_mods[i].size = mods[i].mod_end - mods[i].mod_start;
-
-            boot_mods[i].string.len = strlcpy(boot_mods[i].string.bytes,
-                                             __va(mods[i].string),
-                                             BOOTMOD_STRING_MAX_LEN);
-        }
-    }
-
-    boot_info = &info;
-}
-
 unsigned long __init initial_images_nrpages(nodeid_t node)
 {
     unsigned long node_start = node_start_pfn(node);
@@ -1014,15 +970,13 @@ static struct domain *__init create_dom0(const struct boot_info *bootinfo,
 /* How much of the directmap is prebuilt at compile time. */
 #define PREBUILT_MAP_LIMIT (1 << L2_PAGETABLE_SHIFT)
 
-void __init noreturn __start_xen(unsigned long mbi_p)
+void __init noreturn __start_xen(unsigned long bi_p)
 {
     char *memmap_type = NULL;
     char *cmdline, *kextra, *loader;
     void *bsp_stack;
     struct cpu_info *info = get_cpu_info(), *bsp_info;
     unsigned int initrdidx, num_parked = 0;
-    multiboot_info_t *mbi;
-    module_t *mod;
     unsigned long nr_pages, raw_max_page;
     int i, j, e820_warn = 0, bytes = 0;
     unsigned long eb_start, eb_end;
@@ -1059,16 +1013,29 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     if ( pvh_boot )
     {
-        ASSERT(mbi_p == 0);
-        pvh_init(&mbi, &mod);
+        ASSERT(bi_p == 0);
+        pvh_init(&boot_info);
     }
     else
     {
-        mbi = __va(mbi_p);
-        mod = __va(mbi->mods_addr);
-    }
+        /*
+         * Since addresses were setup before virtual addressing was enabled,
+         * fixup pointers to virtual addresses for proper dereferencing.
+         */
+        boot_info = __va(bi_p);
+        boot_info->cmdline = __va(boot_info->cmdline);
+        boot_info->mods = __va(boot_info->mods);
+        boot_info->arch = __va(boot_info->arch);
+
+        boot_info->arch->boot_loader_name =
+            __va(boot_info->arch->boot_loader_name);
 
-    multiboot_to_bootinfo(mbi, mod);
+        for ( i = 0; i <= boot_info->nr_mods; i++ )
+        {
+            boot_info->mods[i].mfn = maddr_to_mfn(boot_info->mods[i].start);
+            boot_info->mods[i].arch = __va(boot_info->mods[i].arch);
+        }
+    }
 
     loader = (boot_info->arch->flags & BOOTINFO_FLAG_X86_LOADERNAME)
         ? boot_info->arch->boot_loader_name : "unknown";
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index c5850c26af..09b38b497c 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -3,6 +3,7 @@
 #include <efi/efipciio.h>
 #include <public/xen.h>
 #include <xen/bitops.h>
+#include <xen/bootinfo.h>
 #include <xen/compile.h>
 #include <xen/ctype.h>
 #include <xen/dmi.h>
@@ -11,7 +12,6 @@
 #include <xen/keyhandler.h>
 #include <xen/lib.h>
 #include <xen/mm.h>
-#include <xen/multiboot.h>
 #include <xen/param.h>
 #include <xen/pci_regs.h>
 #include <xen/pfn.h>
@@ -1359,6 +1359,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     efi_arch_relocate_image(0);
 
+    efi_arch_bootinfo_init();
+
     if ( use_cfg_file )
     {
         EFI_FILE_HANDLE dir_handle;
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
index bf5586a76b..6e09be6899 100644
--- a/xen/include/xen/bootinfo.h
+++ b/xen/include/xen/bootinfo.h
@@ -20,13 +20,16 @@
 #define BOOTMOD_GUEST_DTB   7
 typedef unsigned int bootmod_type_t;
 
+/* Max number of boot modules a bootloader can provide in addition to Xen */
+#define MAX_NR_BOOTMODS 63
+
 #define BOOTMOD_STRING_MAX_LEN 1024
-struct boot_string {
+struct __packed boot_string {
     char bytes[BOOTMOD_STRING_MAX_LEN];
     size_t len;
 };
 
-struct boot_module {
+struct __packed boot_module {
     bootmod_type_t bootmod_type;
     paddr_t start;
     mfn_t mfn;
@@ -37,7 +40,7 @@ struct boot_module {
 };
 DEFINE_STRUCT_PTR_TYPE(boot_module);
 
-struct boot_info {
+struct __packed boot_info {
     char_ptr_t cmdline;
 
     unsigned int nr_mods;
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 07:53:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 07:53:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557822.871500 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFVQC-0008Ib-Ou; Sat, 01 Jul 2023 07:53:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557822.871500; Sat, 01 Jul 2023 07:53:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFVQC-0008IU-KP; Sat, 01 Jul 2023 07:53:32 +0000
Received: by outflank-mailman (input) for mailman id 557822;
 Sat, 01 Jul 2023 07:53:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=imK7=CT=citrix.com=prvs=539cab4e8=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qFVQA-0008IO-Kh
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 07:53:30 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5c5acd9a-17e4-11ee-b237-6b7b168915f2;
 Sat, 01 Jul 2023 09:53:28 +0200 (CEST)
Received: from mail-dm6nam12lp2177.outbound.protection.outlook.com (HELO
 NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.177])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 01 Jul 2023 03:53:24 -0400
Received: from BN7PR03MB3618.namprd03.prod.outlook.com (2603:10b6:406:c3::27)
 by BN9PR03MB6025.namprd03.prod.outlook.com (2603:10b6:408:136::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Sat, 1 Jul
 2023 07:53:21 +0000
Received: from BN7PR03MB3618.namprd03.prod.outlook.com
 ([fe80::7ebd:898:4cb0:7514]) by BN7PR03MB3618.namprd03.prod.outlook.com
 ([fe80::7ebd:898:4cb0:7514%5]) with mapi id 15.20.6544.024; Sat, 1 Jul 2023
 07:53:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5c5acd9a-17e4-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688198008;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=4lipXHd/Hd/oIj7zAyXeYQkzzuPBre6U7XzivX0UrBA=;
  b=S7amrrL9g17O4JBKCDiaI+e/VUqc62VJ9EcwNELsEs7GKOCir/XMJCeR
   WRGW+MaKApbt6c6YkdOUk5LiWEiUmCK08VYY6mwqFTSpcFJPbkJyimosC
   kFANABhUVlVYvEslE8245FH4AV274/o1heMLizYogNAyFOcD+lf6F+LNT
   Y=;
X-IronPort-RemoteIP: 104.47.59.177
X-IronPort-MID: 115250894
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:HuesEKijBmDzlOfJHI4gIsV4X161UBAKZh0ujC45NGQN5FlHY01je
 htvWW3SbvmKMzf8eI0kO47goU5SsZ7RydFqQAFr+ys1Hi8b9cadCdqndUqhZCn6wu8v7q5Ex
 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv
 cKai8DEMRqu1iUc3lg8sspvkzsx+qyr0N8klgZmP6sT4gSGzyJ94K83fsldEVOpGuG4IcbiL
 wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ
 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m6zNIcCkvUqdn6m5Ce3Sm+o8dfng5OXL8fq
 DslvauYlCbCAUqh7+Adx04dtmGncTPiJXlJTYeHnccmXCzpALt0qf+Dx+bmjwDUzZDqI1SjF
 TtokjC/6C+tPP+7RfZ2wbonvNrseqk8MJHGMuPzu4KLTn24zzYArhJavm5pTUop+Pq0nYG+e
 O82ysIDoBI8nbMeWPwmxf3xAX69z4r5xbZuCSlqEqmm9X9WDU5T/VMnphYdByx0TtbgO1B
X-Talos-CUID: 9a23:6xRHA20WSzUcprhVvB6p5LxfONoHfETe6CnqcnSnCkZjc7y8eW+I5/Yx
X-Talos-MUID: =?us-ascii?q?9a23=3ARNSUbwxkYxqhMmGhSW6y9pQFsBiaqPvzB3kp1os?=
 =?us-ascii?q?fh5m/ORdgEgeSihO2Y5Byfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,172,1684814400"; 
   d="scan'208";a="115250894"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=FGe8FKiK0qy+2o7MVSi8bseoB30qN/S4Spvr7eFsUep1pgAv0XmXRIHS/9syBxAR9noaCjlayvQa9ENc2f+GpcWbZC9wYbygk4b231mnq80Hb33K/cDlDF2hzB9WHWxObkamfWfg1aZyv4q7tFzrrMKNUDsES3q9CtCTLeycT2Ts5FvrK4JUc3ExFqzH3HmRZspqnv6SirD336anhzA4Bni3Wkd6Xl3mpnoh8NWDbeGhkRr5l5yg+c6yntZt/tj5xZwisoAQs4RMuAFHh4nkJf8fzd+vV/b61Byn4k3OBU8IqnBR2hRqG+uIKf2ihBdsttiPUcBgIPc4/ci9GW2bww==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4lipXHd/Hd/oIj7zAyXeYQkzzuPBre6U7XzivX0UrBA=;
 b=QrxX7X3bBzQeGYcCWpx12i6PEvp/VjhRTQkzz6S5LQxPy8YR+pn516S/xzil6bB5/Ice96YK+SX8f+UccyR3j8ReO2ImS1GjEQtdhJYOK7D0WhCj2OeCPHP4mKmm8l8KYpzZ3rpVlrECN+Fse6Iwj0T6el2auWyqgENpf6y91S7yIKPayBbZ4p9j8OL7xrcBkm2n51ciGn0026MmEeANk4TK/C7/SaM6t45e3JULS0b2OHrxTRExTWEnsAf5C5sLMJa8vPPlzMEj62cxmtRTyFqwbGPcs6mCejK/Xyl0+H8KiuLxmaVm92nzf3g16cUheVl0OrDZkrbkjykigz4KrA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4lipXHd/Hd/oIj7zAyXeYQkzzuPBre6U7XzivX0UrBA=;
 b=d3u1tIZ9kd5EI5Jj+U7YcLzj8dQxyaylPrZjjXTyFrDgkdCR2w42Dcrvv7Ev3Ipi8tyWnZGAKkWwWitIgeLAX/RFsbjlCH1xGxdKvmenSJ65co6XdnkPFScZEICLYLRETtHymTL/XR72E6FXxHDhiBS4hJEaYBS2tO+bnam3I5w=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <6060dd00-5d9c-3804-4b9d-154b9b9dca49@citrix.com>
Date: Sat, 1 Jul 2023 08:53:14 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
To: Luca Fancellu <luca.fancellu@arm.com>, xen-devel@lists.xenproject.org
Cc: wei.chen@arm.com, George Dunlap <george.dunlap@citrix.com>,
 Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Henry Wang <Henry.Wang@arm.com>,
 Community Manager <community.manager@xenproject.org>,
 Doug Goldstein <cardoe@cardoe.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Anthony PERARD <anthony.perard@citrix.com>,
 Daniel Smith <dpsmith@apertussolutions.com>,
 Christopher Clark <christopher.w.clark@gmail.com>
References: <20230630091210.3742121-1-luca.fancellu@arm.com>
Content-Language: en-GB
In-Reply-To: <20230630091210.3742121-1-luca.fancellu@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0677.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:351::20) To BN7PR03MB3618.namprd03.prod.outlook.com
 (2603:10b6:406:c3::27)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN7PR03MB3618:EE_|BN9PR03MB6025:EE_
X-MS-Office365-Filtering-Correlation-Id: 9fc072ac-3163-4443-b9a8-08db7a083d0e
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	BFadWxqV8exolj48bNnpWlAmbiRlZoB5Mquc6B/v0uL2SSAC744O9M6fIUX9xGKlPCVkt7HYhszhe81wOKVVDEy9oEXyUuBWr2xcYf1SlGRGmfvh1jPbYOwZhY1KTQ7Pm3708vhIIZp3QMkdNveOSRbRRyz4dWV249TpdWMrkAjgBu9uLkrRz1E0/UVh0tFPSPojPkeEcEQ0FZnkQgLF+wtZWt0hlnGhHo3cGvt6uqU9uRlg1tGN4XqU/iFEHj0yaXAqkiu/Pxz148f3C1mMweOBP3mp9ehWKDVBoN0vmx9J3I/2W/MSvf3Syfx9KhMs735eqd5aXyoKESdwtKwlc0Kc1E//ZT6P9HNbPkLoPJ+jn46e3zFHgkYCh5M5flErOMEZb4m3x6HEz5xUfRUAoE0f0Ua7e93+xX05n0WLUH5n5cNSz3JP+9GK4Ey1cuW/Z4FQVl8tztp72DF3ApkyNMP9PBzEWrh6+u++Neuu4AmbvdbZxdRUlzsret2vk8CfZYK7Y8DG790wWXSOlZQxRnBJeKUde7omjhCt2nPEkkf++opEmA+Dtlt6m5qx28uFLaOqH45mCR1V2VXmuP3ej0CVLqQdvh4/opap1+amA0OQ82QwYpQ0+z+Bm5j1TiKfdT3UTVMtG1re7drHd3vbhX2rorC2hySYTvoyvHYln5I=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN7PR03MB3618.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(39860400002)(346002)(136003)(366004)(451199021)(6666004)(38100700002)(4744005)(2906002)(6486002)(8936002)(8676002)(54906003)(36756003)(41300700001)(5660300002)(7416002)(478600001)(31696002)(66946007)(66556008)(66476007)(86362001)(186003)(53546011)(26005)(6506007)(6512007)(4326008)(316002)(31686004)(2616005)(83380400001)(82960400001)(32563001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NUhmMjA2bVllWDUzSGcrTCtxMUlScGFrZjh4Z1VvdHRRR2M3Ukp0bFhBaWFP?=
 =?utf-8?B?Qlp5K2p3SkR1ZCtSTzFqWTVRNG5YZkNnV2F2ZEpjODI0TXYzWGx1d3FBenhN?=
 =?utf-8?B?eGxz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R2QzBSbkRPTWpVKzdueVZ3cVV5Wm14MXl6clYra1NNLzlG?=
 =?utf-8?Q?rpVshJCJTTV+LuLwg4cnmnoUa7bebgeU=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9fc072ac-3163-4443-b9a8-08db7a083d0e
X-MS-Exchange-CrossTenant-AuthSource: BN7PR03MB3618.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2023 07:53:20.9067
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: JllmYz8NkX8Mg1OsnIDoW9D+JxIuqfyX3gzioIupfKkOmRhzT1obNHR+DGuxGMtw/H1jhncoefhsQN8izObP5DwvH48bsuqGvffeLlYEF4c=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR03MB6025

On 30/06/2023 10:12 am, Luca Fancellu wrote:
> The "dom0less" feature was intended to be the feature where a domU
> domain could be launched without the control domain (Dom0)
> intervention, however the name seems to suggest that Dom0 cannot
> be part of the configuration, while instead it's a possible use case.
>
> To avoid that, rename the "dom0less" configuration with the name
> "hyperlaunch", that is less misleading.
>
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> ---
> This is an RFC to get the feeling of the community about the name
> change, for now it's everything in one patch just to see how it
> will look like, if there is interest on proceeding into it, I can
> split in more commit.

Have you discussed this with Dan and Chris at all?Â  You haven't even
CC'd them.

While there is a lot of end-goal in common between the dom0less and
hyperlaunch, and that the name dom0less is deeply misleading,
hyperlaunch is specifically not this.

~Andrew


From xen-devel-bounces@lists.xenproject.org Sat Jul 01 09:08:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 09:08:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557834.871515 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFWaE-0008Lv-J8; Sat, 01 Jul 2023 09:07:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557834.871515; Sat, 01 Jul 2023 09:07:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFWaE-0008Lo-GK; Sat, 01 Jul 2023 09:07:58 +0000
Received: by outflank-mailman (input) for mailman id 557834;
 Sat, 01 Jul 2023 09:07:56 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=XVz2=CT=gmail.com=persaur@srs-se1.protection.inumbo.net>)
 id 1qFWaC-0008Lg-TS
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 09:07:56 +0000
Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com
 [2607:f8b0:4864:20::d31])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c35dc7f8-17ee-11ee-b237-6b7b168915f2;
 Sat, 01 Jul 2023 11:07:55 +0200 (CEST)
Received: by mail-io1-xd31.google.com with SMTP id
 ca18e2360f4ac-7835c92c373so66351839f.0
 for <xen-devel@lists.xenproject.org>; Sat, 01 Jul 2023 02:07:54 -0700 (PDT)
Received: from smtpclient.apple ([87.249.134.26])
 by smtp.gmail.com with ESMTPSA id
 eh4-20020a056638298400b00426eea9f398sm3190051jab.134.2023.07.01.02.07.52
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 01 Jul 2023 02:07:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c35dc7f8-17ee-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688202474; x=1690794474;
        h=to:in-reply-to:cc:references:message-id:date:subject:mime-version
         :from:content-transfer-encoding:from:to:cc:subject:date:message-id
         :reply-to;
        bh=2WIn68E2vval0WhdulTmqLoUBV2XXLtEL49qn7WzQQ8=;
        b=JAbxYHYQHSo7S0Eb/Qx26DGEoUP+NBx5aj9kcE2KCoXFHohUwcE93VxSn6lZaz5RRJ
         AyYqBngN59MeMUl625KQ00EmEZa7e4fp6sVUIvUAQnGd283Rw8QViLzZuzZYKG6maTuy
         XOVEJk8Fj+RJa4g1uOvXzCkBvl4CGhQSJk2LuK8DO74QporRbo9kfguBtUSRdtp6vvgW
         MIQsXJEI+kvAKcjgiWxliX8uzF1yYH/nZP2BGiF5gVCTITtri4XqR1nxa9bOwerMCMwO
         y01jMcAGad0jdcGVRcohEmWDNuYnIUU6+0z78xZk11SeuQo1GUy0ciQPahScbKQJt+Dz
         mO2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688202474; x=1690794474;
        h=to:in-reply-to:cc:references:message-id:date:subject:mime-version
         :from:content-transfer-encoding:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=2WIn68E2vval0WhdulTmqLoUBV2XXLtEL49qn7WzQQ8=;
        b=Zn/+gm+/xVlvapzhPgex1Xo/9OW+4qH0sZJqAUnhrl/m7ATdKp8338PBLomKYT1fOZ
         PDBe/qVxbeGOakGMWyVZiGle4BCJRivt05cylxuupgIsAONS2uXK41UGPhThkm7sZQt9
         v5d0eQT3JUFSlOqbGQmo2W/CMPNQ/bnPAVdt9VkRnqCEUbQropQKfoLAQLvvUJUWrEEY
         VGVIMcJKotvvmcs2xmVahYUcNgph1iILXgqAHwtFrMU14ctGv54W6h2hyQpLw1t2ODZX
         0kZ8G7LtxI5NMtF5y1ZbzAOK44QSnOJnf5lT3C8zYEwiW9zpXrMZUMP6dViR79XbDQEA
         nqDw==
X-Gm-Message-State: AC+VfDxKaVTS8YqlH6B74+fP0wGJzk3/DZI7auh6SqtB6/eqLtXZv/My
	vt94X6TX2CfN2Ou55oTe5ZA=
X-Google-Smtp-Source: ACHHUZ6FgkLFVHEymiyx3HTQ1q+w+/eZPl3RiaL5/0E6R1BBXxADuY90PlZRMkDZXt18oLnCh+7eUw==
X-Received: by 2002:a05:6e02:c68:b0:342:558c:d88e with SMTP id f8-20020a056e020c6800b00342558cd88emr6329062ilj.11.1688202473581;
        Sat, 01 Jul 2023 02:07:53 -0700 (PDT)
Content-Type: multipart/alternative; boundary=Apple-Mail-1F9216F4-6F5A-4AFF-85F5-BE841D0E68EE
Content-Transfer-Encoding: 7bit
From: Rich Persaud <persaur@gmail.com>
Mime-Version: 1.0 (1.0)
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
Date: Sat, 1 Jul 2023 05:07:41 -0400
Message-Id: <B954806C-5D31-483C-964B-17F1EFDB20BD@gmail.com>
References: <20230630091210.3742121-1-luca.fancellu@arm.com>
Cc: xen-devel@lists.xenproject.org, Wei.Chen@arm.com,
 Andrew Cooper <Andrew.Cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Wei Liu <wl@xen.org>, Henry Wang <Henry.Wang@arm.com>,
 Community Manager <community.manager@xenproject.org>,
 Doug Goldstein <cardoe@cardoe.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Anthony PERARD <anthony.perard@citrix.com>,
 Christopher Clark <christopher.w.clark@gmail.com>,
 Daniel Smith <dpsmith@apertussolutions.com>,
 Daniel DeGraaf <dgdegra@tycho.nsa.gov>, openxt@googlegroups.com,
 =?utf-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
 =?utf-8?Q?Piotr_Kr=C3=B3l?= <piotr.krol@3mdeb.com>
In-Reply-To: <20230630091210.3742121-1-luca.fancellu@arm.com>
To: Luca Fancellu <luca.fancellu@arm.com>
X-Mailer: iPad Mail (20F75)


--Apple-Mail-1F9216F4-6F5A-4AFF-85F5-BE841D0E68EE
Content-Type: text/plain;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi Luca,

On Jun 30, 2023, at 05:12, Luca Fancellu <luca.fancellu@arm.com> wrote:
>=20
> =EF=BB=BFThe "dom0less" feature was intended to be the feature where a dom=
U
> domain could be launched without the control domain (Dom0)
> intervention, however the name seems to suggest that Dom0 cannot
> be part of the configuration, while instead it's a possible use case.

Thanks for your interest in Xen boot integrity. Please see the 2018 domB RFC=
:
https://lists.xenproject.org/archives/html/xen-devel/2018-06/msg01306.html

At Xen Summit 2018 (Nanjing) and Xen Summit 2019 (Chicago), OpenXT contribut=
ors made a case to Xen-on-Arm contributors for the architectural unification=
 of incumbent dom0less (Arm) and the domB (x86) proposal for improving Xen b=
oot integrity.

> To avoid that, rename the "dom0less" configuration with the name
> "hyperlaunch", that is less misleading.

2018-2022 work on Xen launch integrity, thanks to Apertus and Star Lab:=20
https://wiki.xenproject.org/wiki/Hyperlaunch
https://www.theregister.com/2022/12/16/xen_4_17_hyperlaunch/

2023 Hyperlaunch design session last week, thanks to Apertus and AMD:
https://lists.xenproject.org/archives/html/xen-devel/2023-06/msg01870.html

> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>

If Arm is now ready to invest engineering resources into new Xen launch inte=
grity features for security and safety-critical use cases, that is exciting n=
ews, 5 years into the on-again-off-again bootstrapped Hyperlaunch project! T=
he roadmap would benefit from new funding.

Would you like to attend the next Xen working group call for Hyperlaunch?

Rich=

--Apple-Mail-1F9216F4-6F5A-4AFF-85F5-BE841D0E68EE
Content-Type: text/html;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=3D=
utf-8"></head><body dir=3D"auto"><div dir=3D"ltr"></div><div dir=3D"ltr">Hi L=
uca,</div><div dir=3D"ltr"><br></div><div dir=3D"ltr">On Jun 30, 2023, at 05=
:12, Luca Fancellu &lt;luca.fancellu@arm.com&gt; wrote:</div><div dir=3D"ltr=
"><blockquote type=3D"cite"><br></blockquote></div><blockquote type=3D"cite"=
><div dir=3D"ltr">=EF=BB=BF<span>The "dom0less" feature was intended to be t=
he feature where a domU</span><br><span>domain could be launched without the=
 control domain (Dom0)</span><br><span>intervention, however the name seems t=
o suggest that Dom0 cannot</span><br><span>be part of the configuration, whi=
le instead it's a possible use case.</span><br></div></blockquote><div><br><=
/div><div>Thanks for your interest in Xen boot integrity. Please see the 201=
8 domB RFC:</div><div><a href=3D"https://lists.xenproject.org/archives/html/=
xen-devel/2018-06/msg01306.html">https://lists.xenproject.org/archives/html/=
xen-devel/2018-06/msg01306.html</a></div><div><br></div><div><div>At Xen Sum=
mit 2018 (Nanjing) and Xen Summit 2019 (Chicago), OpenXT contributors made a=
 case to Xen-on-Arm contributors for the architectural unification of incumb=
ent dom0less (Arm) and the domB (x86) proposal for improving Xen boot integr=
ity.</div><div><br></div></div><blockquote type=3D"cite"><div dir=3D"ltr"><s=
pan></span><span>To avoid that, rename the "dom0less" configuration with the=
 name</span><br><span>"hyperlaunch", that is less misleading.</span><br></di=
v></blockquote><div><br></div><div>2018-2022 work on Xen launch integrity, t=
hanks to Apertus and Star Lab:&nbsp;</div><div><a href=3D"https://wiki.xenpr=
oject.org/wiki/Hyperlaunch">https://wiki.xenproject.org/wiki/Hyperlaunch</a>=
</div><div><a href=3D"https://www.theregister.com/2022/12/16/xen_4_17_hyperl=
aunch/">https://www.theregister.com/2022/12/16/xen_4_17_hyperlaunch/</a></di=
v><div><br></div><div>2023 Hyperlaunch design session last week, thanks to A=
pertus and AMD:</div><div><a href=3D"https://lists.xenproject.org/archives/h=
tml/xen-devel/2023-06/msg01870.html">https://lists.xenproject.org/archives/h=
tml/xen-devel/2023-06/msg01870.html</a></div><div><br></div><blockquote type=
=3D"cite"><div dir=3D"ltr"><span></span><span>Signed-off-by: Luca Fancellu &=
lt;luca.fancellu@arm.com&gt;</span><br></div></blockquote><div><br></div>If A=
rm is now ready to invest engineering resources into new Xen launch integrit=
y features for security and safety-critical use cases, that is exciting news=
, 5 years into the on-again-off-again bootstrapped Hyperlaunch project! The r=
oadmap would benefit from new funding.<div><br></div><div>Would you like to a=
ttend the next Xen working group call for Hyperlaunch?<div><br></div><div>Ri=
ch</div></div></body></html>=

--Apple-Mail-1F9216F4-6F5A-4AFF-85F5-BE841D0E68EE--


From xen-devel-bounces@lists.xenproject.org Sat Jul 01 09:53:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 09:53:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557838.871525 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFXIE-0005Xq-Rn; Sat, 01 Jul 2023 09:53:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557838.871525; Sat, 01 Jul 2023 09:53:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFXIE-0005Xj-Ol; Sat, 01 Jul 2023 09:53:26 +0000
Received: by outflank-mailman (input) for mailman id 557838;
 Sat, 01 Jul 2023 09:53:25 +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 <SRS0=idbm=CT=gmail.com=shentey@srs-se1.protection.inumbo.net>)
 id 1qFXID-0005Xd-NI
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 09:53:25 +0000
Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com
 [2a00:1450:4864:20::52c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1df6f974-17f5-11ee-8611-37d641c3527e;
 Sat, 01 Jul 2023 11:53:23 +0200 (CEST)
Received: by mail-ed1-x52c.google.com with SMTP id
 4fb4d7f45d1cf-51d9bf5411aso2849494a12.2
 for <xen-devel@lists.xenproject.org>; Sat, 01 Jul 2023 02:53:23 -0700 (PDT)
Received: from [127.0.0.1] (dynamic-089-012-173-083.89.12.pool.telefonica.de.
 [89.12.173.83]) by smtp.gmail.com with ESMTPSA id
 v9-20020aa7cd49000000b005187a42b44fsm7606875edw.58.2023.07.01.02.53.21
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 01 Jul 2023 02:53:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1df6f974-17f5-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688205203; x=1690797203;
        h=content-transfer-encoding:mime-version:message-id:references
         :in-reply-to:subject:cc:to:from:date:from:to:cc:subject:date
         :message-id:reply-to;
        bh=U6qzh5zT5TRYd5Sip4g9abjelR/5v1OLZh8dWj8GBAE=;
        b=g1lntXpKHUXhdYIGb1g2NFGLAg9i2q1sGxEt/vbVZeLtWuht/fvm9vwV1MLjKUwjkU
         oBauakppnvcoYODDuxCIFDW27tsbkAmV97KExEJ+esKI9lF0NATFWtezMBCCNDDlwLLS
         uxWFI19OAoe8qiLMwJeTqSnkpi8JvTrAXTtN5Wez5YTPfIArk8mIm/F1S4SngQLnG2DU
         HBThsEgZCVfXdPnf00KvUAYFQG2kX0p/T5O+vC1t3jjiSjsDhLEKKZ4hFnwrUOhhaH8b
         O2AZns8c6R5KXJIvqnEfC5tTTupGkpy8hJ1iWkxzQ//Y/RuyaV+JheQxKwn+2WL1126u
         9yoQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688205203; x=1690797203;
        h=content-transfer-encoding:mime-version:message-id:references
         :in-reply-to:subject:cc:to:from:date:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=U6qzh5zT5TRYd5Sip4g9abjelR/5v1OLZh8dWj8GBAE=;
        b=gd1T4CQcl18AHqR10qM0gtZHMrTN3pg1TXc01htETFenTp19OsL2Cc8yi6cT7AE4pX
         DpfUGfkrc//t4L56C32s9773q0MqEEXs1CJtwDcp1MVZjeDRPziY6ZOlsLeNGTnsN1ES
         1d9O49ayIaDedUw2fybvWTE1qXk3S5GB4wap/osBiAl94BoQlgbgs/9LdUbO+xtG5vx0
         kj06ghd+e4NKyXrMlO5sLrRuOzsxSeKH9LlPqohNRtxTqbyKp3XdCH407n8IhgEkB6OY
         poyBR2xPgRMC52fyCAzB4YTafSX22XZGAeCYH/yl2OeE2PDh3wcULXq5NmzSEn7LCg7A
         PKJQ==
X-Gm-Message-State: AC+VfDyRcaHA7egay8FBkI0HmtHj+JY+SDvNY1EDSNjxeYoDn2tjcnaF
	zTRZFra/C3TIyvQ3AWq/FPMvqUBG71k=
X-Google-Smtp-Source: APBJJlHaXRaHawJGh8EcQEbPNbdz3SpEWVXwBe9z3waKnvOCHY7coyJ32yStWcR97XEgIaTVX5NGgQ==
X-Received: by 2002:a17:906:b7c8:b0:984:bd75:6a3 with SMTP id fy8-20020a170906b7c800b00984bd7506a3mr3527933ejb.58.1688205202474;
        Sat, 01 Jul 2023 02:53:22 -0700 (PDT)
Date: Sat, 01 Jul 2023 09:53:12 +0000
From: Bernhard Beschow <shentey@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
CC: Olaf Hering <olaf@aepfle.de>, qemu-devel <qemu-devel@nongnu.org>,
 John Snow <jsnow@redhat.com>,
 "open list:X86" <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v2] piix: fix regression during unplug in Xen HVM domUs
In-Reply-To: <CABgObfamZEHv0W3B6kPXGTiT1f2G__S=Bi1-_PYeSomsiVFaFg@mail.gmail.com>
References: <20210317070046.17860-1-olaf@aepfle.de> <4441d32f-bd52-9408-cabc-146b59f0e4dc@redhat.com> <20210325121219.7b5daf76.olaf@aepfle.de> <dae251e1-f808-708e-902c-05cfcbbea9cf@redhat.com> <20230509225818.GA16290@aepfle.de> <20230626231901.5b5d11c1.olaf@aepfle.de> <c939b695-2b68-085a-0f19-108ecdcc1a05@redhat.com> <5DB37FA5-41DF-4ED6-8C8A-CDDD6F276F42@gmail.com> <20230627140740.2736f6e8.olaf@aepfle.de> <4F5609FD-4A89-4450-89E2-3311CC5A9317@gmail.com> <CABgObfamZEHv0W3B6kPXGTiT1f2G__S=Bi1-_PYeSomsiVFaFg@mail.gmail.com>
Message-ID: <3987B0DB-46F2-49F1-AEA5-B88BC61A633F@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable



Am 30=2E Juni 2023 08:48:02 UTC schrieb Paolo Bonzini <pbonzini@redhat=2Ec=
om>:
>Il mer 28 giu 2023, 13:28 Bernhard Beschow <shentey@gmail=2Ecom> ha scrit=
to:
>
>>
>>
>> Am 27=2E Juni 2023 12:07:40 UTC schrieb Olaf Hering <olaf@aepfle=2Ede>:
>> >Tue, 27 Jun 2023 10:12:50 +0000 Bernhard Beschow <shentey@gmail=2Ecom>=
:
>> >
>> >> The BAR is a 32 bit register whose default value is 0x00000001=2E I =
think
>> what's supposed to happen here is a pci_set_long() rather than a
>> pci_set_byte()=2E
>> >
>> >Indeed, the u32 at that address changes from c121 to c101 with the
>> current code=2E
>>
>> Neat! Would you mind sending a patch fixing the BMIBA register to be re=
set
>> as 32 bit?
>>
>
>I think we should also check why writing the command register is not
>disabling the BAR as well=2E

So IIUC the BMIBA register is managed internally by QEMU's PCI code and we=
 shouldn't have to mess with the register at all=2E We should actually remo=
ve the explicit reset of BMIBA, correct?

I've tried debugging the PCI code when working on the VIA IDE controller t=
o understand it better=2E But despite QEMU being compiled with --enable-deb=
ug it seemd to be compiled with -O2 still, making debugging quite hard=2E I=
'm not sure if any compile flags leak into my build environment though=2E

Best regards,
Bernhard=20
>
>Paolo
>
>
>> Best regards,
>> Bernhard
>> >
>> >Olaf
>>
>>


From xen-devel-bounces@lists.xenproject.org Sat Jul 01 11:59:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 11:59:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557849.871550 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFZFz-0000yk-Qm; Sat, 01 Jul 2023 11:59:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557849.871550; Sat, 01 Jul 2023 11:59:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFZFz-0000yd-O8; Sat, 01 Jul 2023 11:59:15 +0000
Received: by outflank-mailman (input) for mailman id 557849;
 Sat, 01 Jul 2023 11:59:14 +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
 <SRS0=zKT7=CT=ilande.co.uk=mark.cave-ayland@srs-se1.protection.inumbo.net>)
 id 1qFZFy-0000yX-7r
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 11:59:14 +0000
Received: from mail.ilande.co.uk (mail.ilande.co.uk [2001:41c9:1:41f::167])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b09240ed-1806-11ee-8611-37d641c3527e;
 Sat, 01 Jul 2023 13:59:11 +0200 (CEST)
Received: from [2a00:23c4:8bad:df00:f732:dd76:7417:d15b]
 by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.92) (envelope-from <mark.cave-ayland@ilande.co.uk>)
 id 1qFZFc-0005I2-Q0; Sat, 01 Jul 2023 12:58:56 +0100
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b09240ed-1806-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:Content-Type:
	In-Reply-To:From:References:Cc:To:MIME-Version:Date:Message-ID:Sender:
	Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender
	:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
	List-Subscribe:List-Post:List-Owner:List-Archive;
	bh=HUvWWzeC6i10u0AquICUezzYl2yLIB0LMiRxiVfqyBk=; b=IOmQ7yGgID/KuDQlwtrlcQjPDM
	eWMWXQyTr62fuLjJqJQ9UN++wx1Ds4IlurVCjW4mSI6bLcOIb5ZxF7eBJi3Z04pRAlF5Q1cru7UMK
	jxe8qdkDMU1ydCeTJmFOiDWhZLnZcgdjYIZaUsIP0ucHwF4AHqnN+Ll3I86IEcYxjF1gkRjmCYjCC
	5oE9M7qcTlfXwZKdiFLd3gC8WfgwKFtffJ3RaquYsvf6aLETE7RLiWsWbKbCJZ4z2Z+MvR4qz3hy6
	z12ik1OC5MxQorqKWQwc3WselrMPoMM8NCphrUYqXd4HxhpanLriXtBWsbXCqSsFEelDirg5a85BS
	ZTnZZYSJ19/ghWtSTlNIYSe+BXFcFjesy1ob12n1N52j874sk42lkgXq9h+sM8ddANTtCBnqOWZzQ
	3vKjmnU2dj1mB29rCR0MaVqPWdm3eVcgcbXyPSn+oiO+v6BlS9nj1fnXfFkX5QgHuFlWWmO3xBTG3
	XOlclsW1vaXd6LMWbdfj2VER3mqf9cbIjmfOlsU3NfuBPgf+nrJlHgb4mwMO1jPyev8d0KMixbNP9
	u7D80zH1olqYW9AB+04tXhCPDH8jeenM4l7uEh2nweyGdyZTehPMTOG+ZY+VzhOV5Fp/0DJMvbBZg
	dk0YCPgLCNoghK9WLBBck+lRnI8S5T++MrJ7Ngs4M=;
Message-ID: <b562eb6f-c7ad-dec9-d92f-266ca8561170@ilande.co.uk>
Date: Sat, 1 Jul 2023 12:58:57 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.10.0
To: Bernhard Beschow <shentey@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>
Cc: Olaf Hering <olaf@aepfle.de>, qemu-devel <qemu-devel@nongnu.org>,
 John Snow <jsnow@redhat.com>, "open list:X86"
 <xen-devel@lists.xenproject.org>, Stefano Stabellini <sstabellini@kernel.org>
References: <20210317070046.17860-1-olaf@aepfle.de>
 <4441d32f-bd52-9408-cabc-146b59f0e4dc@redhat.com>
 <20210325121219.7b5daf76.olaf@aepfle.de>
 <dae251e1-f808-708e-902c-05cfcbbea9cf@redhat.com>
 <20230509225818.GA16290@aepfle.de> <20230626231901.5b5d11c1.olaf@aepfle.de>
 <c939b695-2b68-085a-0f19-108ecdcc1a05@redhat.com>
 <5DB37FA5-41DF-4ED6-8C8A-CDDD6F276F42@gmail.com>
 <20230627140740.2736f6e8.olaf@aepfle.de>
 <4F5609FD-4A89-4450-89E2-3311CC5A9317@gmail.com>
 <CABgObfamZEHv0W3B6kPXGTiT1f2G__S=Bi1-_PYeSomsiVFaFg@mail.gmail.com>
 <3987B0DB-46F2-49F1-AEA5-B88BC61A633F@gmail.com>
Content-Language: en-US
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
In-Reply-To: <3987B0DB-46F2-49F1-AEA5-B88BC61A633F@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-SA-Exim-Connect-IP: 2a00:23c4:8bad:df00:f732:dd76:7417:d15b
X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
	mail.default.ilande.bv.iomart.io
X-Spam-Level: 
X-Spam-Status: No, score=-2.8 required=5.0 tests=ALL_TRUSTED,BAYES_00,
	URIBL_BLOCKED,URIBL_SBL_A autolearn=no autolearn_force=no version=3.4.2
Subject: Re: [PATCH v2] piix: fix regression during unplug in Xen HVM domUs
X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000)
X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk)

On 01/07/2023 10:53, Bernhard Beschow wrote:

> Am 30. Juni 2023 08:48:02 UTC schrieb Paolo Bonzini <pbonzini@redhat.com>:
>> Il mer 28 giu 2023, 13:28 Bernhard Beschow <shentey@gmail.com> ha scritto:
>>
>>>
>>>
>>> Am 27. Juni 2023 12:07:40 UTC schrieb Olaf Hering <olaf@aepfle.de>:
>>>> Tue, 27 Jun 2023 10:12:50 +0000 Bernhard Beschow <shentey@gmail.com>:
>>>>
>>>>> The BAR is a 32 bit register whose default value is 0x00000001. I think
>>> what's supposed to happen here is a pci_set_long() rather than a
>>> pci_set_byte().
>>>>
>>>> Indeed, the u32 at that address changes from c121 to c101 with the
>>> current code.
>>>
>>> Neat! Would you mind sending a patch fixing the BMIBA register to be reset
>>> as 32 bit?
>>>
>>
>> I think we should also check why writing the command register is not
>> disabling the BAR as well.
> 
> So IIUC the BMIBA register is managed internally by QEMU's PCI code and we shouldn't have to mess with the register at all. We should actually remove the explicit reset of BMIBA, correct?
> 
> I've tried debugging the PCI code when working on the VIA IDE controller to understand it better. But despite QEMU being compiled with --enable-debug it seemd to be compiled with -O2 still, making debugging quite hard. I'm not sure if any compile flags leak into my build environment though.

Certainly --enable-debug normally does the right thing when building QEMU. If you 
want to double-check the compiler flags in use to see if anything from CFLAGS/LDFLAGS 
is getting picked up, use "make V=1" after configure which outputs the full command 
being used during the build rather than just the summary.


ATB,

Mark.



From xen-devel-bounces@lists.xenproject.org Sat Jul 01 14:30:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 14:30:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557869.871572 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFbbZ-00085Y-SW; Sat, 01 Jul 2023 14:29:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557869.871572; Sat, 01 Jul 2023 14:29:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFbbZ-00085R-Pt; Sat, 01 Jul 2023 14:29:41 +0000
Received: by outflank-mailman (input) for mailman id 557869;
 Sat, 01 Jul 2023 14:29:40 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFbbY-00085H-Mm; Sat, 01 Jul 2023 14:29:40 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFbbY-000530-E8; Sat, 01 Jul 2023 14:29:40 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFbbY-00078E-4T; Sat, 01 Jul 2023 14:29:40 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qFbbY-00053I-3y; Sat, 01 Jul 2023 14:29:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=lXWojDKIQPdBByfB+7Y+P3VxJnZ8J+dD/bRfhue01AY=; b=083IYC7KkPdL+5EShtRmmXbdx3
	mA9NmZJvl26C/Rvi6aSlH6EWchJeyckgBOG1x4N9MPSR66TiO0ztMVNTX4Dfc6PXNNhWYqvxbovPV
	+faYNbujuzuCbQdoS3y9rboroI9nZsd+y0AADy8isCKNqc+Wxnn/pE6msLXVhpaS7ep0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181665-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181665: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-libvirt:xen-install:fail:heisenbug
    xen-unstable:test-amd64-i386-xl-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=f51e5d8eae8ece77a949571f39ee49904f3129aa
X-Osstest-Versions-That:
    xen=6aa0c18062609cb448d292668a81953a58ce1e95
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 01 Jul 2023 14:29:40 +0000

flight 181665 xen-unstable real [real]
flight 181676 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181665/
http://logs.test-lab.xenproject.org/osstest/logs/181676/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-libvirt       7 xen-install         fail pass in 181676-retest
 test-amd64-i386-xl-vhd 21 guest-start/debian.repeat fail pass in 181676-retest

Tests which did not succeed, but are not blocking:
 test-amd64-i386-libvirt     15 migrate-support-check fail in 181676 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181646
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181646
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181646
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181646
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181646
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181646
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181646
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181646
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181646
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181646
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181646
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181646
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  f51e5d8eae8ece77a949571f39ee49904f3129aa
baseline version:
 xen                  6aa0c18062609cb448d292668a81953a58ce1e95

Last test of basis   181646  2023-06-30 02:11:47 Z    1 days
Failing since        181657  2023-06-30 14:38:36 Z    0 days    2 attempts
Testing same since   181665  2023-07-01 03:16:15 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alejandro Vallejo <alejandro.vallejo@cloud.com>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Anthony PERARD <anthony.perard@citrix.com>
  Federico Serafini <federico.serafini@bugseng.com>
  George Dunlap <george.dunlap@citrix.com>
  George Dunlap <george.dunlap@cloud.com>
  Julien Grall <jgrall@amazon.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      fail    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   6aa0c18062..f51e5d8eae  f51e5d8eae8ece77a949571f39ee49904f3129aa -> master


From xen-devel-bounces@lists.xenproject.org Sat Jul 01 15:14:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 15:14:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557884.871619 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFcIE-0005Kn-Ba; Sat, 01 Jul 2023 15:13:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557884.871619; Sat, 01 Jul 2023 15:13:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFcIE-0005Kg-8V; Sat, 01 Jul 2023 15:13:46 +0000
Received: by outflank-mailman (input) for mailman id 557884;
 Sat, 01 Jul 2023 15:13:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=iAyS=CT=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qFcIC-0005Ka-6A
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 15:13:44 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on2062b.outbound.protection.outlook.com
 [2a01:111:f400:fe16::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dc24b68b-1821-11ee-b237-6b7b168915f2;
 Sat, 01 Jul 2023 17:13:40 +0200 (CEST)
Received: from DB9PR01CA0021.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:1d8::26) by DB9PR08MB6730.eurprd08.prod.outlook.com
 (2603:10a6:10:2a2::5) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Sat, 1 Jul
 2023 15:13:36 +0000
Received: from DBAEUR03FT010.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:1d8:cafe::7c) by DB9PR01CA0021.outlook.office365.com
 (2603:10a6:10:1d8::26) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.26 via Frontend
 Transport; Sat, 1 Jul 2023 15:13:35 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT010.mail.protection.outlook.com (100.127.142.78) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.13 via Frontend Transport; Sat, 1 Jul 2023 15:13:35 +0000
Received: ("Tessian outbound b11b8bb4dfe8:v142");
 Sat, 01 Jul 2023 15:13:35 +0000
Received: from d111f6208b92.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 19E7EF3F-3875-4E56-87F6-2ACEA8F4D52B.1; 
 Sat, 01 Jul 2023 15:13:24 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d111f6208b92.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Sat, 01 Jul 2023 15:13:24 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by DU0PR08MB10326.eurprd08.prod.outlook.com (2603:10a6:10:472::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.19; Sat, 1 Jul
 2023 15:13:21 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::ed0b:5730:a1f9:577b]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::ed0b:5730:a1f9:577b%5]) with mapi id 15.20.6544.024; Sat, 1 Jul 2023
 15:13:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dc24b68b-1821-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=tHtfN2x/SO7Axo2M+ZNtdVM/tYp6B5Arr7cPdYw8U6E=;
 b=t6TGzUYBlWz8pVe25lmbKA6pXpb3rHZLnWCjBZftkM02O1BvGRwcKSUKw9CrGNVAdlJS3stg7ddl3v/FpSAzwwRjCUsjMb8B7g36Oe/Bsfq7am6gX9o1xxs/9+yhZB7JxbuGg2kyOfb981gLtBLYQVrwN4bK5otf2MohBDWMkSg=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 63308b8bed9dab6f
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=gEh1GXaLM89YLjF5ULBez0uesW3LCFISLSaG2igjfVl995iXzUPpmabOOhtVCAdNV/O3E57wbErwzJOhpBaM5RxIT2VoUB30k+44o5ojr8J5dImkt+i4Runc+bCyx+F83euB8yWh1r8uLQXayBEeUZmNC+bGOX/HSDDbmd3B29jVhhTQlgd6p2fsSPBQM5KCFdjymDvjpiB8gd+O5bCdfdS+m1B5LEr6RYujTQTuFyw4x+AudAdw2kNn8WZX5KhcnoLRzhW+1x8aAXUSpbu0Kvjx9iJ6oNU6tgYz3N9xhzCQahciTbMxlNDoVwhM0ksZecyIi3vUaYEAa6nW8rWs2w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=tHtfN2x/SO7Axo2M+ZNtdVM/tYp6B5Arr7cPdYw8U6E=;
 b=hHvcF4GV4EEPgKrTPvScHu57P7b4Jacz4Lhd4Zd7hntwKOcGj3juBypvkpoIeUGG12smY8/Whdr9gxisl2tssVwXQlm38qCKYA0+NjfndskIn4EWQlT0NhZcNmWCNaLKjaMpuRiFGA4Kii4OMu6SmeEx7OMUsiXXT2yZ71d8jKkP8hb0N0L7oH0E1eLRgb47RUwW0fBZMHGmqHnigXlxAFQig6zdaYclB005Yo+VojD+0tNSIrnzhBFFx5KLTyQAWGwrdcNu3Rof51Hx7MOOSSw68RbX21NQt1D9N87qgWVvSe6X6b2pesnSYQvt125Vum+13zmWuKH5NRnF0O7vDw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=tHtfN2x/SO7Axo2M+ZNtdVM/tYp6B5Arr7cPdYw8U6E=;
 b=t6TGzUYBlWz8pVe25lmbKA6pXpb3rHZLnWCjBZftkM02O1BvGRwcKSUKw9CrGNVAdlJS3stg7ddl3v/FpSAzwwRjCUsjMb8B7g36Oe/Bsfq7am6gX9o1xxs/9+yhZB7JxbuGg2kyOfb981gLtBLYQVrwN4bK5otf2MohBDWMkSg=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>,
	George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>, Henry Wang <Henry.Wang@arm.com>, Community Manager
	<community.manager@xenproject.org>, Doug Goldstein <cardoe@cardoe.com>,
	Bertrand Marquis <Bertrand.Marquis@arm.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Daniel Smith <dpsmith@apertussolutions.com>, Christopher Clark
	<christopher.w.clark@gmail.com>
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
Thread-Topic: [RFC PATCH] xen/arm: Rebranding dom0less feature
Thread-Index: AQHZqzMUKP6yBnvUfEC1egkdxmuozK+ki8cAgAB66AA=
Date: Sat, 1 Jul 2023 15:13:19 +0000
Message-ID: <31FE51E0-0336-4756-8B30-6FE77DE10932@arm.com>
References: <20230630091210.3742121-1-luca.fancellu@arm.com>
 <6060dd00-5d9c-3804-4b9d-154b9b9dca49@citrix.com>
In-Reply-To: <6060dd00-5d9c-3804-4b9d-154b9b9dca49@citrix.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|DU0PR08MB10326:EE_|DBAEUR03FT010:EE_|DB9PR08MB6730:EE_
X-MS-Office365-Filtering-Correlation-Id: 22a799ed-61ba-4f31-0788-08db7a45bd6e
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 eMhK5YSTi7b579QIjsGp+isnpiv2jacfHt9cbh352qfBxzpOBSAGMHTknB32lYMNEzh7pHOxhV/ylLYeSkQfLD6eaehhouZdlOuMTwtcoE87XXV9zqjI8l6YTK5HH3WeS130nvOlyJ+9up2eiZSA3RXuLmHoL19D9T7REkVBpKm1olgoxTiloKnPO1ATZiG3WkGtaonQi8w2kzywbjAwdjsrnNoqklJFFZBg/4G2sGDaIPJWOq+o8XHl2DiBl+XNSPM9cWzh9IBbKyS+X1LW1Lye/MBHkbmDMYlrPYqzsLcL1BCIyHtj9lCiB4XiQ5jDqzsLMhV1s7yAGvtjO8YtPCGAp976oYD36DkSEzGIAvefY+KMl9pZ+5EskGtYkzM4i8pS9IqlKuyzdODSjtrBL+ezlPntaVu0s3WmxMwQLH0iPLd7bCB6vVnYLAzgIH81tcY8Hms8NgaQS6Bgvf8VhlQk0pLjPJSudArOf2MEc5Zs64vpdcULRQoC/6suObV61nevjWUeR9/FYJwk8y5TPzb75XLItkibuEHiAtU2CkwsOZHUXSGMH3vYOatYBmaZRxfeMOjCHJ4VKi334NDBVHUJtc73TMrv6zRe7JqVlL4Al3j2h1H8l8xDFCcVUov/SIjvPnztp+fq64HgObC1n5oF9KFxVpoNQsVDNcKQTmQ=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(346002)(376002)(396003)(136003)(39860400002)(451199021)(6512007)(76116006)(54906003)(91956017)(66946007)(66556008)(66476007)(66446008)(122000001)(2906002)(7416002)(36756003)(478600001)(8936002)(316002)(38100700002)(6916009)(41300700001)(64756008)(4326008)(83380400001)(6486002)(71200400001)(5660300002)(86362001)(38070700005)(8676002)(33656002)(26005)(2616005)(186003)(6506007)(53546011)(32563001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <5CCE60224551D34B82A457B6E65DA1F6@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB10326
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT010.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	d0439fbf-c97a-40ab-cfc5-08db7a45b3e3
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	KVaNP3xk02ENW3X6FfBQDTH89xKYg3goZH5VqIhc3qWioMPgDP4wGDq04tlwej08yD7sgAQn3p0G4TvxO1MqoOHxOFYlab+/7Tpa6QK0+5F2/NqdoIP0O3JyV8oCOFQ0gfshWCdKOV7L8IUrNBdgez7bKheYjtk/izGRJxOPVn/Gl+R8MSl1/NqFesxRfM5can7o4PRC9Jh4INIrwMHMRhvrS9stKgGgKxXwt1lSDBswUuBf/lLFXKEE6heqhJrjicLVPJwsg0W9oRO7huDcvhAD0WBoBSO9m803EhBSyj+H1lOh2JH2LbBOiQmypZRST2zmyMTPJnaBI45bCLHJpEUVBicFTIm7R1xkTp0j6IAWatZfkK45VbejY0wx1pfCvnLexTvzaLzyJZxJP0UWQFgf/dUAtf2dGc5KlKH0gIqsvgvoqpyB8PaNjw++GpApCerLjthe8Yo130NxpTBWg7UEPyJCoGTgqdYCOwk2AshZX5HUaVPduh2Jf6Hyfa5h4F0DjJALqikvp8IdoMElxSPs6qrlKCaKaKogeiCl198YcbnTq0YIqbNpz07rk0+aFYPmGvobGWGZBC6yREo4JAqWlcVIbmpk5+q+oypWAb5HbeGPIt2jW7oUMX0Om69L3e87fwwzq4D7JMlS5lCEV019huDtcDnbAGegakAm0fkYHj112e0OvhREU91+yga14hW3uadcoyFi7yW+uC486M5ZBGauqG61ZHoRwbJLO8bw2jFu7YRqL8JrATlZ2cTO26O6HC6XLLD73vQz2ryhpg==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(136003)(346002)(376002)(451199021)(46966006)(36840700001)(40470700004)(36860700001)(107886003)(316002)(41300700001)(6512007)(6486002)(83380400001)(47076005)(53546011)(336012)(186003)(2616005)(6506007)(26005)(478600001)(40460700003)(54906003)(82740400003)(356005)(81166007)(70206006)(70586007)(4326008)(40480700001)(5660300002)(86362001)(33656002)(82310400005)(8936002)(8676002)(6862004)(2906002)(36756003)(32563001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2023 15:13:35.2337
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 22a799ed-61ba-4f31-0788-08db7a45bd6e
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT010.eop-EUR03.prod.protection.outl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SwgSeKAmW0g
b2sgdG8gZHJvcCBpdCwNCm15IG9ubHkgYWltIHdhcyBqdXN0IHRvIGZpbmQgYSBsZXNzIG1pc2xl
YWRpbmcgbmFtZSBmb3IgdGhlIGZlYXR1cmUuIA0KDQpDaGVlcnMsDQpMdWNhDQoNCj4gDQo+IH5B
bmRyZXcNCg0K


From xen-devel-bounces@lists.xenproject.org Sat Jul 01 15:21:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 15:21:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557892.871630 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFcPs-0006sg-Bm; Sat, 01 Jul 2023 15:21:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557892.871630; Sat, 01 Jul 2023 15:21:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFcPs-0006sZ-78; Sat, 01 Jul 2023 15:21:40 +0000
Received: by outflank-mailman (input) for mailman id 557892;
 Sat, 01 Jul 2023 15:21:39 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFcPr-0006sP-Ji; Sat, 01 Jul 2023 15:21:39 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFcPr-00076y-Av; Sat, 01 Jul 2023 15:21:39 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFcPr-0008I1-1G; Sat, 01 Jul 2023 15:21:39 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qFcPr-0008Hz-0q; Sat, 01 Jul 2023 15:21:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=GoS06dio/3juijAcPylZc04+oIZynAkh3YggLH3eqEg=; b=5ClYksE1RLJUQGtt/RV4xjrKV/
	U21VJ+yCt2un8w0SRUOBEPpOvJH9H3D7WlCdEMf2X7l2n1a563tCCfJj4jUQqPISn5lcy1w/AoO3k
	lI4yoUOZSZRdPAbOT8yJYGAB6JT9lvYSDXhnSAEqe7NeqKHI3jGI8MhKN4yJzpZT8XlQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181667-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 181667: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=7f1562a7397b789f6d540f0010405d089426a5a4
X-Osstest-Versions-That:
    libvirt=d7fb8deb6aa862a8098d8d933dd32a79931cd4dc
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 01 Jul 2023 15:21:39 +0000

flight 181667 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181667/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181635
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181635
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181635
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 libvirt              7f1562a7397b789f6d540f0010405d089426a5a4
baseline version:
 libvirt              d7fb8deb6aa862a8098d8d933dd32a79931cd4dc

Last test of basis   181635  2023-06-29 04:21:51 Z    2 days
Failing since        181649  2023-06-30 04:18:54 Z    1 days    2 attempts
Testing same since   181667  2023-07-01 04:18:48 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Han Han <hhan@redhat.com>
  Michal Privoznik <mprivozn@redhat.com>
  Peter Krempa <pkrempa@redhat.com>
  Yuri Chornoivan <yurchor@ukr.net>
  ê¹€ì¸ìˆ˜ <simmon@nplob.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   d7fb8deb6a..7f1562a739  7f1562a7397b789f6d540f0010405d089426a5a4 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sat Jul 01 15:52:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 15:52:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557898.871639 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFctO-0001rU-L2; Sat, 01 Jul 2023 15:52:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557898.871639; Sat, 01 Jul 2023 15:52:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFctO-0001rN-Gz; Sat, 01 Jul 2023 15:52:10 +0000
Received: by outflank-mailman (input) for mailman id 557898;
 Sat, 01 Jul 2023 15:52:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=JDMf=CT=foxmail.com=zhang_shurong@srs-se1.protection.inumbo.net>)
 id 1qFctN-0001rH-HD
 for xen-devel@lists.xenproject.org; Sat, 01 Jul 2023 15:52:10 +0000
Received: from out203-205-221-202.mail.qq.com (out203-205-221-202.mail.qq.com
 [203.205.221.202]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 37959b9b-1827-11ee-b237-6b7b168915f2;
 Sat, 01 Jul 2023 17:52:03 +0200 (CEST)
Received: from localhost.localdomain ([116.132.239.178])
 by newxmesmtplogicsvrsza12-0.qq.com (NewEsmtp) with SMTP
 id CEC3EC5C; Sat, 01 Jul 2023 23:51:44 +0800
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 37959b9b-1827-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com;
	s=s201512; t=1688226707;
	bh=Ou1vBhUK87QUl5Q7dSsJPlf9T8VgS2NFf1k7CSQDkDY=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References;
	b=InzfP/PjalXsy1+062ZbHDH7LNSpAlZb/OGrkFlT6ZDcVxJ4s6E21Y0Jh5QIZW12E
	 8Q6ikCFwk6a7xFshJF2ClUrLspmGWaAzCwUa7DR26CeBpg0R82CYdvizzsxYzyHwiD
	 EroHbCc8jD++VaWGfM/AMg/i+2aX4+bzXi2cjbQE=
X-QQ-mid: xmsmtpt1688226704te5jbpodh
Message-ID: <tencent_62EE5604188B87B14220EA91C4CD8D4C2D06@qq.com>
X-QQ-XMAILINFO: MBf0q8AysQnB9O7sZj5jgSNUnizJ7WyO6idPxUw5LGBRfADxCatimjS8frcO53
	 OYG4ZoWqWzofoy5ziRmfTupTo+9SoOjDeAa2XX9YKT/v6+RqbSpF9nfPC/dGXC4N5shyi5gUCwOT
	 onoHlWGeP9TLE3B6807xVCxkhTgd3gCIDZMm2wgDX5qq7cBSJjjDTJD+DhgAIWj3ijzYA8OazRjZ
	 hCcsv3ngIQWuWZ0JSLmHwZ0UTSQCQ+9gatNz0ByQexx5wiifL6/U5IQ7aBk3ePXUrbKuGItZ/hth
	 J0HU4mV5UX8OkRfpsjypjuHOye9svDBiMghR4ItEpq2kZmcX/kuf80ic6deCMBP6ElKiIBP9ff1M
	 4lOyjJfPUA9x/gXw+ENR6TGd92i29BwXM/DgZkKAqY8DUCD/yZ3yW2123KA9L3yVAbe94o2uKMzD
	 OMRE+Re8ojaYsncs3JXQn+bYECgh2lMahvq6+QCkbEuT7Xp8xqlQ5jQgmTO2RvZWIJaOSknu1Jnr
	 9zgUDCBhqd0kM0AVy2PG2RsWQYFXmpk/nTTyhbSMz0mcugnZurXaV+Zalva/b+Z1rWGRSlmaHFG5
	 Nt4yPNg2xE5TQM5F0EOzRFkYY3z/EX45mBDeOQOayUqoRYNAr1XMUUeLW/1K4uMQ5vyErjZktHTT
	 W5/dU7km1Hhw9eV1NMOvr6ebUdby4tj5Cre0paw+bqbVT+FxVEZ10nqTEPGgnPFF7CU7dg6ldQ+N
	 BSVtP0u4M1PgcSaSx9O3vGFeCPowRXKZFUVilSO/Kg+reSKEHWpHGSvM931iETynrTcFIgaMb5sV
	 uNWHwK/TtGkrB72YjZYAaZ4s/r91k4vXQb4o3gxi1hfa9DP4mGcVtTTZHXL2ujyaM38vMmB8EbF9
	 Ys7lowKPVSCv27wAE8K5uFPml5MLKQ+1/R2VHsVSEI06yNT6ndWmX2YHu27XEtRV/qRxg7QRs8mF
	 29XvdMS3b9UjAGJ9Pz/mO2TCWkoQvKZvrnJAhicjk1Ja1cW6BfCg==
X-QQ-XMRINFO: M/715EihBoGSf6IYSX1iLFg=
From: Zhang Shurong <zhang_shurong@foxmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: jgross@suse.com, xen-devel@lists.xenproject.org,
 linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject:
 Re: [PATCH] xen: fix potential shift out-of-bounds in xenhcd_hub_control()
Date: Sat, 01 Jul 2023 23:51:43 +0800
X-OQ-MSGID: <4825193.GXAFRqVoOG@localhost.localdomain>
In-Reply-To: <2023062628-shame-ebook-56f2@gregkh>
References:
 <tencent_15DD79B42AD8A0D64A7CDC24D4FE6C85800A@qq.com>
 <1c8ff405-2bfe-37ff-42ba-aa4f81853475@suse.com>
 <2023062628-shame-ebook-56f2@gregkh>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"

=E5=9C=A8 2023=E5=B9=B46=E6=9C=8826=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=80 CST=
 =E4=B8=8B=E5=8D=881:52:02=EF=BC=8C=E6=82=A8=E5=86=99=E9=81=93=EF=BC=9A
> On Mon, Jun 26, 2023 at 07:48:05AM +0200, Jan Beulich wrote:
> > On 25.06.2023 18:42, Zhang Shurong wrote:
> > > --- a/drivers/usb/host/xen-hcd.c
> > > +++ b/drivers/usb/host/xen-hcd.c
> > > @@ -456,6 +456,8 @@ static int xenhcd_hub_control(struct usb_hcd *hcd,
> > > __u16 typeReq, __u16 wValue,> >=20
> > >  			info->ports[wIndex - 1].c_connection =3D=20
false;
> > >  			fallthrough;
> > >  	=09
> > >  		default:
> > > +			if (wValue >=3D 32)
> > > +				goto error;
> > >=20
> > >  			info->ports[wIndex - 1].status &=3D ~(1=20
<< wValue);
> >=20
> > Even 31 is out of bounds (as in: UB) as long as it's 1 here rather
> > than 1u.
>=20
> Why isn't the caller fixed so this type of value could never be passed
> to the hub_control callback?
>=20
> thanks,
>=20
> greg k-h
Although I'm not knowledgeable about the USB subsystem, I've observed that =
not=20
all driver code that implements hub_control callback performs a shift=20
operation on wValue, and not all shift operations among them cause problems=
=2E=20
Therefore, I've decided to fix this issue within each driver itself.

=46or example, in r8a66597_hub_control, it will first check whether wValue =
is=20
valid (always < 31) before the shift operation. In case of an invalid numbe=
r,=20
the code would execute the error branch instead of the shift operation.

switch (wValue) {
case USB_PORT_FEAT_ENABLE:
	rh->port &=3D ~USB_PORT_STAT_POWER;
	break;
case USB_PORT_FEAT_SUSPEND:
	break;
case USB_PORT_FEAT_POWER:
	r8a66597_port_power(r8a66597, port, 0);
	break;
case USB_PORT_FEAT_C_ENABLE:
case USB_PORT_FEAT_C_SUSPEND:
case USB_PORT_FEAT_C_CONNECTION:
case USB_PORT_FEAT_C_OVER_CURRENT:
case USB_PORT_FEAT_C_RESET:
	break;
default:
	goto error;
}
rh->port &=3D ~(1 << wValue);







From xen-devel-bounces@lists.xenproject.org Sat Jul 01 18:48:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 01 Jul 2023 18:48:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557928.871666 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFfdf-0003i1-1G; Sat, 01 Jul 2023 18:48:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557928.871666; Sat, 01 Jul 2023 18:48:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFfde-0003hu-UH; Sat, 01 Jul 2023 18:48:06 +0000
Received: by outflank-mailman (input) for mailman id 557928;
 Sat, 01 Jul 2023 18:48:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFfdd-0003hi-HY; Sat, 01 Jul 2023 18:48:05 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFfdd-0003zu-2i; Sat, 01 Jul 2023 18:48:05 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFfdc-0004XK-LP; Sat, 01 Jul 2023 18:48:04 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qFfdc-0002BG-Kw; Sat, 01 Jul 2023 18:48:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Qj0LN2knW0cGsYNJGeC2CrGgPU68rgVo9dnZX90nU6I=; b=JCqv9JjdK9n+NHYY50MhMBHovm
	FNxp57l9ZFhx4sqyuC2lCF10qWk3IUgCVuKxWpOTK248UZsJYpbRK2qr7+vyucSCd1axVwlhpg+2s
	hDbKFj4BwEzZrI2tIlr7LkPabGsOxd2Yl/yKljnK/mdpgL0bmF8Wx2DJW17cH0YNZL1g=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181670-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181670: regressions - trouble: broken/fail/pass
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-pvshim:<job status>:broken:regression
    linux-linus:test-amd64-amd64-xl-pvshim:host-install(5):broken:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pygrub:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:guest-start:fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:debian-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:debian-di-install:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:xen-boot:fail:allowable
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=a507db1d8fdc39802415e4d2ef6d1aecd67927fa
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 01 Jul 2023 18:48:04 +0000

flight 181670 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181670/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-pvshim      <job status>                 broken
 test-amd64-amd64-xl-pvshim    5 host-install(5)        broken REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-pygrub      11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl          11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd 11 leak-check/basis(11)    fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64  8 xen-boot    fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-libvirt      8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu 14 guest-start             fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl 12 debian-install          fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 12 xen-boot/src_host       fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 13 xen-boot/dst_host       fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2 12 debian-di-install      fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds      8 xen-boot                 fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                a507db1d8fdc39802415e4d2ef6d1aecd67927fa
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   75 days
Failing since        180281  2023-04-17 06:24:36 Z   75 days  145 attempts
Testing same since   181670  2023-07-01 07:09:15 Z    0 days    1 attempts

------------------------------------------------------------
3548 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   broken  
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-amd64-amd64-xl-pvshim broken
broken-step test-amd64-amd64-xl-pvshim host-install(5)

Not pushing.

(No revision log; it would be 568500 lines long.)


From xen-devel-bounces@lists.xenproject.org Sun Jul 02 01:59:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 02 Jul 2023 01:59:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557936.871676 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFmMu-0005GO-JN; Sun, 02 Jul 2023 01:59:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557936.871676; Sun, 02 Jul 2023 01:59:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFmMu-0005GA-DX; Sun, 02 Jul 2023 01:59:16 +0000
Received: by outflank-mailman (input) for mailman id 557936;
 Sun, 02 Jul 2023 01:59:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFmMs-0005G0-Gy; Sun, 02 Jul 2023 01:59:14 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFmMs-0006Sx-AI; Sun, 02 Jul 2023 01:59:14 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFmMr-0005kz-Lc; Sun, 02 Jul 2023 01:59:13 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qFmMr-0002pp-L8; Sun, 02 Jul 2023 01:59:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=dXmQ12fR0auaa3jORWkQc3ETgSbTCupjRuB24YdvBRw=; b=oQ86OhyRZzPIDB9pPcmaKbsE8k
	5gxq7sYkujLNyo8dEn4JMrQDH5W8duzMA37+Yaumewfp66jol+enr2Zym+hcAdLbh4FOgheFwEBMf
	Cm52+0HSp7+YdixL1qvPdBu67MoG7qTl/ESLLvM9595XbS7MkIaZnt6oUAP7omNJkemU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181677-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181677: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-qemuu-nested-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-pygrub:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:debian-install:fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:debian-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:debian-hvm-install:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:leak-check/basis(11):fail:allowable
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=f8566aa4f1766bb0267b7a0ed89c1d2c4a82ee1a
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 02 Jul 2023 01:59:13 +0000

flight 181677 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181677/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-qemuu-nested-amd 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-pygrub      11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2  8 xen-boot               fail REGR. vs. 180278
 test-amd64-amd64-xl           8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd 11 leak-check/basis(11)    fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-libvirt      8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu 12 debian-install          fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2  12 debian-install           fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl 12 debian-install          fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 12 xen-boot/src_host       fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 12 debian-hvm-install fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds     11 leak-check/basis(11)     fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                f8566aa4f1766bb0267b7a0ed89c1d2c4a82ee1a
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   76 days
Failing since        180281  2023-04-17 06:24:36 Z   75 days  146 attempts
Testing same since   181677  2023-07-01 19:13:12 Z    0 days    1 attempts

------------------------------------------------------------
3558 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 572370 lines long.)


From xen-devel-bounces@lists.xenproject.org Sun Jul 02 09:20:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 02 Jul 2023 09:20:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557948.871685 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFtFq-0000JT-33; Sun, 02 Jul 2023 09:20:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557948.871685; Sun, 02 Jul 2023 09:20:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFtFq-0000JM-0D; Sun, 02 Jul 2023 09:20:26 +0000
Received: by outflank-mailman (input) for mailman id 557948;
 Sun, 02 Jul 2023 09:20:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFtFo-0000JC-Jl; Sun, 02 Jul 2023 09:20:24 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFtFo-0000vG-7e; Sun, 02 Jul 2023 09:20:24 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFtFn-0006lS-Q1; Sun, 02 Jul 2023 09:20:23 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qFtFn-0004C6-P7; Sun, 02 Jul 2023 09:20:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=9bPHHh/bR1EQx6IcDXUMgddufuSR2ELKGLKLf9A6844=; b=f5pHkrLQsyxY/OmRINvUglc8EY
	TTOEBq5Uyb3OXcDRBnnLiqu+C1XgQctHx2h+HsqDxB5gm5t+luwkNtOBz7lt6LPWBsPBwXbs6BbFz
	HJgMLF2cIK75tlUi2DI0Rn/x1C3C9aAt3I3pXorK5XLm63JZkvGvA4qkPgfp/zJFbKyM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181678-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181678: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-xl-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-amd64-i386-freebsd10-i386:xen-install:fail:heisenbug
    xen-unstable:test-amd64-i386-livepatch:xen-install:fail:heisenbug
    xen-unstable:test-amd64-i386-libvirt:xen-install:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=f51e5d8eae8ece77a949571f39ee49904f3129aa
X-Osstest-Versions-That:
    xen=f51e5d8eae8ece77a949571f39ee49904f3129aa
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 02 Jul 2023 09:20:23 +0000

flight 181678 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181678/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-xl-vhd 21 guest-start/debian.repeat fail in 181665 pass in 181678
 test-amd64-i386-freebsd10-i386  7 xen-install              fail pass in 181665
 test-amd64-i386-livepatch     7 xen-install                fail pass in 181665

Tests which did not succeed, but are not blocking:
 test-amd64-i386-libvirt       7 xen-install                  fail  like 181665
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181665
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181665
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181665
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181665
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181665
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181665
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181665
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181665
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181665
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181665
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181665
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181665
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  f51e5d8eae8ece77a949571f39ee49904f3129aa
baseline version:
 xen                  f51e5d8eae8ece77a949571f39ee49904f3129aa

Last test of basis   181678  2023-07-02 01:54:30 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      fail    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    fail    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Sun Jul 02 12:12:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 02 Jul 2023 12:12:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557965.871695 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFvwU-0000uZ-KW; Sun, 02 Jul 2023 12:12:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557965.871695; Sun, 02 Jul 2023 12:12:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFvwU-0000uS-Ht; Sun, 02 Jul 2023 12:12:38 +0000
Received: by outflank-mailman (input) for mailman id 557965;
 Sun, 02 Jul 2023 12:12:37 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFvwT-0000tz-Nr; Sun, 02 Jul 2023 12:12:37 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFvwT-0004nC-A2; Sun, 02 Jul 2023 12:12:37 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFvwS-0002JB-OS; Sun, 02 Jul 2023 12:12:36 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qFvwS-0001VC-Nr; Sun, 02 Jul 2023 12:12:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Otod0N0YjCqYJ3E37N56L7RCgwrrZL5LaN8zUQItbVA=; b=hJrKH/sLcdTTI3SVyjHW287sOM
	llZbF70KEqtc64KqSDWxqaWXGIEG4TwdpduvuoyQH+CC7Pwp3REUvn1w3fzjNQKaNZ5csZe5x3rU/
	eKiNrr6uLUyD2uDBVPDrHp7aDADbtlhWmzHKBP7EASUy0erJ/KsEV+YAzwLb2FnDAy5Q=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181679-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181679: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-examine-bios:host-install:broken:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pygrub:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:debian-install:fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:debian-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:debian-di-install:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:guest-localmigrate/x10:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:debian-install:fail:allowable
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=dfab92f27c600fea3cadc6e2cb39f092024e1fef
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 02 Jul 2023 12:12:36 +0000

flight 181679 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181679/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-examine-bios  5 host-install          broken REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-pygrub       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd  8 xen-boot            fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-libvirt     11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl          11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm      11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd 11 leak-check/basis(11)    fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu 12 debian-install          fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  12 debian-install           fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl 12 debian-install          fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 12 xen-boot/src_host       fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2 12 debian-di-install      fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 18 guest-localmigrate/x10 fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds     12 debian-install           fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                dfab92f27c600fea3cadc6e2cb39f092024e1fef
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   76 days
Failing since        180281  2023-04-17 06:24:36 Z   76 days  147 attempts
Testing same since   181679  2023-07-02 02:02:57 Z    0 days    1 attempts

------------------------------------------------------------
3559 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-step test-amd64-amd64-examine-bios host-install

Not pushing.

(No revision log; it would be 572989 lines long.)


From xen-devel-bounces@lists.xenproject.org Sun Jul 02 12:35:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 02 Jul 2023 12:35:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557971.871706 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFwI6-0003OI-Ex; Sun, 02 Jul 2023 12:34:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557971.871706; Sun, 02 Jul 2023 12:34:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qFwI6-0003OB-B3; Sun, 02 Jul 2023 12:34:58 +0000
Received: by outflank-mailman (input) for mailman id 557971;
 Sun, 02 Jul 2023 12:34:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFwI4-0003O1-OM; Sun, 02 Jul 2023 12:34:56 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFwI4-0005CK-E1; Sun, 02 Jul 2023 12:34:56 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qFwI3-0002sg-UL; Sun, 02 Jul 2023 12:34:56 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qFwI3-0007Tb-To; Sun, 02 Jul 2023 12:34:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ynqZEECCfEvPX2FnutKaC9TlrmAHQDTBXdKtCXABFzo=; b=uwinmXfXS76dQAT9MdSWjy/2Lu
	h5GLg9SzvfExGLXGapIS76CxRzvJDwr5mKMHhTOE1SaDQ1S+wjZ3g5DEBCCupYOEKY1q4PYL30XJ4
	XdOAp/FXybSb9Va7DZwd9cQrXE2S+3v9QpZ/3emDWWUPkQ7nYj9zZFJZDaMMYqPSCTwc=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181680-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181680: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=ad7d3ace1ad4d7350d1e1304fab86dffd0f3fd11
X-Osstest-Versions-That:
    ovmf=5a13f5c2fa5ada2eb2fcb961aa3745fd236620bd
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 02 Jul 2023 12:34:55 +0000

flight 181680 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181680/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 ad7d3ace1ad4d7350d1e1304fab86dffd0f3fd11
baseline version:
 ovmf                 5a13f5c2fa5ada2eb2fcb961aa3745fd236620bd

Last test of basis   181659  2023-06-30 16:42:33 Z    1 days
Testing same since   181680  2023-07-02 10:43:52 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Tuan Phan <tphan@ventanamicro.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   5a13f5c2fa..ad7d3ace1a  ad7d3ace1ad4d7350d1e1304fab86dffd0f3fd11 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sun Jul 02 19:09:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 02 Jul 2023 19:09:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557977.871715 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qG2Rk-0008Rj-Bl; Sun, 02 Jul 2023 19:09:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557977.871715; Sun, 02 Jul 2023 19:09:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qG2Rk-0008Rc-9F; Sun, 02 Jul 2023 19:09:20 +0000
Received: by outflank-mailman (input) for mailman id 557977;
 Sun, 02 Jul 2023 19:09:19 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qG2Rj-0008RS-9T; Sun, 02 Jul 2023 19:09:19 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qG2Ri-0006kN-UM; Sun, 02 Jul 2023 19:09:18 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qG2Ri-0003KO-CU; Sun, 02 Jul 2023 19:09:18 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qG2Ri-0004tb-C5; Sun, 02 Jul 2023 19:09:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=WZYu1mwg4DR1ah1UE/6qoYqlf8zHWkNInmq0SGAkmkE=; b=kA+fy4apUP+e5YdWse9B3qaJn8
	4GO1bt7+I6A7ZkYREvSZMOYU9gZ1rzjgYepgTIad2YokHQ1fkqV9s0qouxI5gWEg+DAb0LhOIf7dk
	XC37Sn2VUmTc/JYHcFj5IHoCC87iW7AQW1iCqcIGl3moQUrTzx80MISNT0ze1lYuDRQE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181681-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181681: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:guest-start:fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:debian-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pygrub:debian-di-install:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:leak-check/basis(11):fail:allowable
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=995b406c7e972fab181a4bb57f3b95e59b8e5bf3
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 02 Jul 2023 19:09:18 +0000

flight 181681 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181681/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-libvirt     11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64  8 xen-boot    fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2 11 leak-check/basis(11)   fail REGR. vs. 180278
 test-amd64-amd64-xl          11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64  8 xen-boot    fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd  8 xen-boot            fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow   11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu 14 guest-start             fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl 12 debian-install          fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 12 xen-boot/src_host       fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 13 xen-boot/dst_host       fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-pygrub      12 debian-di-install        fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds     11 leak-check/basis(11)     fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                995b406c7e972fab181a4bb57f3b95e59b8e5bf3
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   76 days
Failing since        180281  2023-04-17 06:24:36 Z   76 days  148 attempts
Testing same since   181681  2023-07-02 12:41:42 Z    0 days    1 attempts

------------------------------------------------------------
3559 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 573018 lines long.)


From xen-devel-bounces@lists.xenproject.org Sun Jul 02 22:26:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 02 Jul 2023 22:26:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557985.871725 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qG5W4-00030E-3s; Sun, 02 Jul 2023 22:26:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557985.871725; Sun, 02 Jul 2023 22:26:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qG5W4-000307-1G; Sun, 02 Jul 2023 22:26:00 +0000
Received: by outflank-mailman (input) for mailman id 557985;
 Sun, 02 Jul 2023 22:25:58 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=KS54=CU=gmail.com=shentey@srs-se1.protection.inumbo.net>)
 id 1qG5W2-0002zy-3G
 for xen-devel@lists.xenproject.org; Sun, 02 Jul 2023 22:25:58 +0000
Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com
 [2a00:1450:4864:20::32f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 67cdac44-1927-11ee-b237-6b7b168915f2;
 Mon, 03 Jul 2023 00:25:55 +0200 (CEST)
Received: by mail-wm1-x32f.google.com with SMTP id
 5b1f17b1804b1-3fbd33a57ddso11000085e9.1
 for <xen-devel@lists.xenproject.org>; Sun, 02 Jul 2023 15:25:53 -0700 (PDT)
Received: from [127.0.0.1] (dynamic-089-014-031-053.89.14.pool.telefonica.de.
 [89.14.31.53]) by smtp.gmail.com with ESMTPSA id
 d1-20020a5d6dc1000000b00304adbeeabbsm23974422wrz.99.2023.07.02.15.25.51
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 02 Jul 2023 15:25:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 67cdac44-1927-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688336752; x=1690928752;
        h=content-transfer-encoding:mime-version:message-id:references
         :in-reply-to:subject:cc:to:from:date:from:to:cc:subject:date
         :message-id:reply-to;
        bh=brJ53WepNRWQm12rssTXlqHMNSqdSpQ3iotpQXlBldw=;
        b=oFqiyjgCuw2kW5i4vvmVZhxFlTsWp8F5rVJGhXKMmfgN63339ooPR9xS3m/kDP8SfX
         OLuDVL953iL23YmgupptKXaWSzl4RBQsMyAK3WJz5PKjjnmy4n2s+ljEtdKuSuzPwuFW
         IiKPjjm+JWazTicIUT+52zRkm237ipHDrqVC/hXxyJj6ZQbg2Vp79R0ZYIVtdhdrtOyR
         byn/DqsvsFuhpQIzNlpKDupg8y3fqzBMmtI2KyDlNXtfJf/UJzWmYDn7UlDEfOd4pQ0i
         zILn3nJMcFa/nRE6m6JCbc2a/wpYQSo2p4dW87txGhyY9C/2hCiK99ozy7xrdPUcLivU
         aoVg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688336752; x=1690928752;
        h=content-transfer-encoding:mime-version:message-id:references
         :in-reply-to:subject:cc:to:from:date:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=brJ53WepNRWQm12rssTXlqHMNSqdSpQ3iotpQXlBldw=;
        b=PUUpzBQC5gc8HSONHTK+FUAKiIKd+ZJ5HHPO2jiSFk8KVyVxVZzvYcY3FUMx/5rY9P
         U3r6aKTHPcZfMAm9FT/ICEwYblVWFjsdyzs76b8vtlCQEJq+lhhJBixZfTK3mPsbbsan
         DrjvfjV7IaHp5Td/fTY8l+iQI3LycJvXsTU7jhW8kU0GHjYujIam4tDbrOANy4wYDRGv
         RTwMXX93mz7d+LxgfNhldGN6TVRM7qDHBZzXbK4WKPWpX2O13KEKMKe3i3UZdN6V6hpU
         w4T4Nuhcp10oGt0rk4uNBnZeh8gn+ViMMiVVcjE0fZF1NZCn/bklp6/9inGvGftIbnnJ
         4Nnw==
X-Gm-Message-State: AC+VfDxLLm0qalMdI95Rm0Iq5u73nxNZxTD/bJaMv8YC3WsTKwe6qgkm
	ijvFPYodN8vCYQrcCA10V3o=
X-Google-Smtp-Source: ACHHUZ5rXCXbjGsIoh5YArs96eCY9/yS9S2QYFz0k3XpXbCvtiSaj9YvSmw1rVnMHxW1fJOK8nsAZA==
X-Received: by 2002:a7b:c847:0:b0:3fa:9348:51a8 with SMTP id c7-20020a7bc847000000b003fa934851a8mr6265209wml.23.1688336752463;
        Sun, 02 Jul 2023 15:25:52 -0700 (PDT)
Date: Sun, 02 Jul 2023 22:25:48 +0000
From: Bernhard Beschow <shentey@gmail.com>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
 Paolo Bonzini <pbonzini@redhat.com>
CC: Olaf Hering <olaf@aepfle.de>, qemu-devel <qemu-devel@nongnu.org>,
 John Snow <jsnow@redhat.com>,
 "open list:X86" <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v2] piix: fix regression during unplug in Xen HVM domUs
In-Reply-To: <b562eb6f-c7ad-dec9-d92f-266ca8561170@ilande.co.uk>
References: <20210317070046.17860-1-olaf@aepfle.de> <4441d32f-bd52-9408-cabc-146b59f0e4dc@redhat.com> <20210325121219.7b5daf76.olaf@aepfle.de> <dae251e1-f808-708e-902c-05cfcbbea9cf@redhat.com> <20230509225818.GA16290@aepfle.de> <20230626231901.5b5d11c1.olaf@aepfle.de> <c939b695-2b68-085a-0f19-108ecdcc1a05@redhat.com> <5DB37FA5-41DF-4ED6-8C8A-CDDD6F276F42@gmail.com> <20230627140740.2736f6e8.olaf@aepfle.de> <4F5609FD-4A89-4450-89E2-3311CC5A9317@gmail.com> <CABgObfamZEHv0W3B6kPXGTiT1f2G__S=Bi1-_PYeSomsiVFaFg@mail.gmail.com> <3987B0DB-46F2-49F1-AEA5-B88BC61A633F@gmail.com> <b562eb6f-c7ad-dec9-d92f-266ca8561170@ilande.co.uk>
Message-ID: <BD839728-D519-42C7-BFE9-CD15CABF09C4@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable



Am 1=2E Juli 2023 11:58:57 UTC schrieb Mark Cave-Ayland <mark=2Ecave-aylan=
d@ilande=2Eco=2Euk>:
>On 01/07/2023 10:53, Bernhard Beschow wrote:
>
>> Am 30=2E Juni 2023 08:48:02 UTC schrieb Paolo Bonzini <pbonzini@redhat=
=2Ecom>:
>>> Il mer 28 giu 2023, 13:28 Bernhard Beschow <shentey@gmail=2Ecom> ha sc=
ritto:
>>>=20
>>>>=20
>>>>=20
>>>> Am 27=2E Juni 2023 12:07:40 UTC schrieb Olaf Hering <olaf@aepfle=2Ede=
>:
>>>>> Tue, 27 Jun 2023 10:12:50 +0000 Bernhard Beschow <shentey@gmail=2Eco=
m>:
>>>>>=20
>>>>>> The BAR is a 32 bit register whose default value is 0x00000001=2E I=
 think
>>>> what's supposed to happen here is a pci_set_long() rather than a
>>>> pci_set_byte()=2E
>>>>>=20
>>>>> Indeed, the u32 at that address changes from c121 to c101 with the
>>>> current code=2E
>>>>=20
>>>> Neat! Would you mind sending a patch fixing the BMIBA register to be =
reset
>>>> as 32 bit?
>>>>=20
>>>=20
>>> I think we should also check why writing the command register is not
>>> disabling the BAR as well=2E
>>=20
>> So IIUC the BMIBA register is managed internally by QEMU's PCI code and=
 we shouldn't have to mess with the register at all=2E We should actually r=
emove the explicit reset of BMIBA, correct?
>>=20
>> I've tried debugging the PCI code when working on the VIA IDE controlle=
r to understand it better=2E But despite QEMU being compiled with --enable-=
debug it seemd to be compiled with -O2 still, making debugging quite hard=
=2E I'm not sure if any compile flags leak into my build environment though=
=2E
>
>Certainly --enable-debug normally does the right thing when building QEMU=
=2E If you want to double-check the compiler flags in use to see if anythin=
g from CFLAGS/LDFLAGS is getting picked up, use "make V=3D1" after configur=
e which outputs the full command being used during the build rather than ju=
st the summary=2E

--enable-debug does the right thing indeed=2E The error was on my side=2E =
Solved!

Thanks,
Bernhard
>
>
>ATB,
>
>Mark=2E
>


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 02:11:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 02:11:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557990.871735 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qG92G-000863-Ul; Mon, 03 Jul 2023 02:11:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557990.871735; Mon, 03 Jul 2023 02:11:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qG92G-00085w-Rt; Mon, 03 Jul 2023 02:11:28 +0000
Received: by outflank-mailman (input) for mailman id 557990;
 Mon, 03 Jul 2023 02:11:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qG92F-00085m-SZ; Mon, 03 Jul 2023 02:11:27 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qG92F-0007fF-FT; Mon, 03 Jul 2023 02:11:27 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qG92F-00048F-2W; Mon, 03 Jul 2023 02:11:27 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qG92F-0007do-21; Mon, 03 Jul 2023 02:11:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=6McL7mdpwCXDRZC2fTA2njb0KLViejys6X52lqhknGs=; b=akU1Mz58BVREn01Gc6Oz9oCxjN
	S70coIg+uYG02fV+nJmv4oLc2qgE1/zPWuntWQsKsz71wz1Xal0Tk9Jz6AXbtvv+19nnVo2w4jp2B
	xbeo6vkjux72NYD1JgZ7WP3t9YpcbaV2qoYRciUsVnC9kzZv9NZ0yRpDBUzoosVlxtRA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181682-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181682: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-qemuu-nested-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-pygrub:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl:debian-install:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:leak-check/basis/dst_host(19):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:build-arm64-pvops:kernel-build:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:xen-boot:fail:allowable
    linux-linus:test-arm64-arm64-xl-credit2:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-examine:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
X-Osstest-Versions-This:
    linux=a901a3568fd26ca9c4a82d8bc5ed5b3ed844d451
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 03 Jul 2023 02:11:27 +0000

flight 181682 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181682/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-qemuu-nested-amd 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-pygrub       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-libvirt     11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2 11 leak-check/basis(11)   fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd 11 leak-check/basis(11)    fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu 12 debian-install          fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm      12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl          12 debian-install           fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 19 leak-check/basis/dst_host(19) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278
 build-arm64-pvops             6 kernel-build             fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds      8 xen-boot                 fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-xl-credit2   1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-thunderx  1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-vhd       1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-xsm       1 build-check(1)               blocked  n/a
 test-arm64-arm64-examine      1 build-check(1)               blocked  n/a
 test-arm64-arm64-libvirt-raw  1 build-check(1)               blocked  n/a
 test-arm64-arm64-libvirt-xsm  1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl           1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-credit1   1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278

version targeted for testing:
 linux                a901a3568fd26ca9c4a82d8bc5ed5b3ed844d451
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   77 days
Failing since        180281  2023-04-17 06:24:36 Z   76 days  149 attempts
Testing same since   181682  2023-07-02 19:42:58 Z    0 days    1 attempts

------------------------------------------------------------
3562 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            fail    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          blocked 
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 blocked 
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      blocked 
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  blocked 
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  blocked 
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     blocked 
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 blocked 
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 blocked 
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      blocked 
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 574059 lines long.)


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 05:13:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 05:13:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.557996.871746 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGBs4-0001it-Al; Mon, 03 Jul 2023 05:13:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 557996.871746; Mon, 03 Jul 2023 05:13:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGBs4-0001im-7G; Mon, 03 Jul 2023 05:13:08 +0000
Received: by outflank-mailman (input) for mailman id 557996;
 Mon, 03 Jul 2023 05:13:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7hCK=CV=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qGBs2-0001id-NF
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 05:13:06 +0000
Received: from EUR03-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur03on20625.outbound.protection.outlook.com
 [2a01:111:f400:fe1b::625])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 49340db7-1960-11ee-b237-6b7b168915f2;
 Mon, 03 Jul 2023 07:13:03 +0200 (CEST)
Received: from AS9PR06CA0775.eurprd06.prod.outlook.com (2603:10a6:20b:484::30)
 by PA4PR08MB6111.eurprd08.prod.outlook.com (2603:10a6:102:e3::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul
 2023 05:12:55 +0000
Received: from AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:484:cafe::c7) by AS9PR06CA0775.outlook.office365.com
 (2603:10a6:20b:484::30) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.26 via Frontend
 Transport; Mon, 3 Jul 2023 05:12:55 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT022.mail.protection.outlook.com (100.127.140.217) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.17 via Frontend Transport; Mon, 3 Jul 2023 05:12:55 +0000
Received: ("Tessian outbound e2424c13b707:v142");
 Mon, 03 Jul 2023 05:12:54 +0000
Received: from 0ee6d2e92890.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 4D577E4A-520E-4358-9E83-EDA5E301BCBF.1; 
 Mon, 03 Jul 2023 05:12:48 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0ee6d2e92890.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Mon, 03 Jul 2023 05:12:48 +0000
Received: from AM0PR02CA0168.eurprd02.prod.outlook.com (2603:10a6:20b:28d::35)
 by PA4PR08MB7409.eurprd08.prod.outlook.com (2603:10a6:102:2a1::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul
 2023 05:12:44 +0000
Received: from AM7EUR03FT039.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:28d:cafe::dc) by AM0PR02CA0168.outlook.office365.com
 (2603:10a6:20b:28d::35) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.30 via Frontend
 Transport; Mon, 3 Jul 2023 05:12:44 +0000
Received: from nebula.arm.com (40.67.248.234) by
 AM7EUR03FT039.mail.protection.outlook.com (100.127.140.224) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.17 via Frontend Transport; Mon, 3 Jul 2023 05:12:43 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com
 (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 3 Jul
 2023 05:12:43 +0000
Received: from [10.169.188.49] (10.169.188.49) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Mon, 3 Jul 2023 05:12:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 49340db7-1960-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=axvEImVGxii6NhLjRL7WGbueaxr5sezn9TuDmMDurvc=;
 b=v0TnHkEOSXYPI0iGw1EZFq43Lk1gWtF6Bb86WreZErSx6AFd5udKFeaDcndf3jVHwEmlS0vATsR2k2jR7Yyzz5Gpy1rizAb0SBcPMesHvR69wMQhT1VSdRvqhLaCWFBfxRwJGQPOOkeLJi7dj7r68Gf4jvGNpzo9yLk5R8uk+EQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 27f3d11d83933588
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ZM7sA2nkkPkd+ajtJxfezYOMnUWnT5c1QLd112bSzR7/iTx1xTYcEiywZ+kvSe0B8QyhMdrWNT90tkQcSbErcq7wuOV2mcycSjGZYKDrDBRcheAuYq1ZqEVcvYclnlJQFyY0Sekdux15sH98srguy85DTdXvWml8Cq0WHmnJEzOwEGP9ye1KgaByVifqYeCg2roGR2xcOpVw5Cx5yWTEVjXsL7YY0DgVbYZ6gne86mc4h2iHZtpwq++JO1YKAW3qIPe+Y60UvTjsM+TjdO0VHE61eyCTTZkvK9wZWpROTbiSlXjL4dzhzFYoPimUeyWOhxxugsklnpznnvkFvhaN7Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=axvEImVGxii6NhLjRL7WGbueaxr5sezn9TuDmMDurvc=;
 b=kk7J9q0E1I2wM/NxlbiGZbAHYfciw9mrb/hZGvgaWaLkyNTQP1iG8lNGghnGqpMqwCKyEWo4WrJo/Xx9P3i2rmqk9ozdmfoQG3/vX01WZa83kkXSeLVcQVEBZA63PSXqAQcEBJJLPFrGfbg7n/zAlf7E6e2Rw8v4i+C6ihdrdkfFXuu6+F2BkLI62RterA4/zEKiG7CtXdwPAVMNcPmpqP+8yOVMw3G6+3ubhGcLgC9ixmV55K6lKdmifglNe1pAR5zqqfZPHX1L3EmUh9RBmiCemE2d307wPQsYtct3RawZOlqn35hbohKPAhRObbAQT9WwQWerpdEQv0aJ2QJOVQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=axvEImVGxii6NhLjRL7WGbueaxr5sezn9TuDmMDurvc=;
 b=v0TnHkEOSXYPI0iGw1EZFq43Lk1gWtF6Bb86WreZErSx6AFd5udKFeaDcndf3jVHwEmlS0vATsR2k2jR7Yyzz5Gpy1rizAb0SBcPMesHvR69wMQhT1VSdRvqhLaCWFBfxRwJGQPOOkeLJi7dj7r68Gf4jvGNpzo9yLk5R8uk+EQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <bd6d9646-f0a8-5341-b4ce-7eca1d6153dc@arm.com>
Date: Mon, 3 Jul 2023 13:12:39 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 31/52] xen/mpu: make early_fdt_map support in MPU
 systems
Content-Language: en-US
To: Julien Grall <julien@xen.org>, Ayan Kumar Halder <ayankuma@amd.com>,
	<xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, Wei Chen <wei.chen@arm.com>,
	"Volodymyr_Babchuk@epam.com" <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-32-Penny.Zheng@arm.com>
 <c2a779e5-51a9-f0c8-4c00-a568ff4bde83@amd.com>
 <a381b1b0-d18a-8fea-56a4-d88c65bd3cea@arm.com>
 <9530f9f8-795b-783a-bc74-e30a3c5c2fd3@amd.com>
 <baed1eac-0f9a-a85a-d4cc-feef772870db@xen.org>
 <c070054d-3f92-ecd2-4f04-a97c5a84d3d7@amd.com>
 <c05ac82d-f9bb-5d52-8b7d-df44d9043a66@xen.org>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <c05ac82d-f9bb-5d52-8b7d-df44d9043a66@xen.org>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	AM7EUR03FT039:EE_|PA4PR08MB7409:EE_|AM7EUR03FT022:EE_|PA4PR08MB6111:EE_
X-MS-Office365-Filtering-Correlation-Id: 95618774-3ce8-4307-f8af-08db7b8428ae
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 1JuUhXCYSyrJK0QL2s+J/rFLJabzub8bJyZLv6Bu0+ooAfuZa0Cxy6Pp40dPwn08/6IE6HP1QAXFNceNfSjmVKo+Zb/qVBtW9SLrwf6RFF2RbWQSG34wRygQ432L8a60nvJ2nG6YTxLYA81buXUGSs4U8DDaC//nsDUgbibiryf/EMJQ+J4Y1EbrCxloBfjCkVRSLo8wXV28Fkmq4uZUO3xtgEN/j/r1PLO9SPBYcSjz06TeoWAHzKqU6mnQb2zMp8xW22G8Xgyfi4WM4AR3exzm3aNqk/WNqaBJREHsbsJEMhReaesVD28wPttEaSRXkkZoouw6jm8DOd2lGpIIHPq/mPDkQlWP8tU77gWAvwdWq6auEvfXEz6oC4JzF/RX2mcoKllt6pl+dsnxAe7CY/vEa6QZ0XCc2G/XhJ/io1KCw4jYS70nXogF0O/xeR1dY8GOTwzZZU8yVoxsxDt1hYktW3G0tZzBs3U9SGaQZxF/gMsYRwTBaW74OCwnyGABFFIV9guRWqd4GvB/RvpTumtA404MRmyAbnA8NQmsJKKpGXo3Zx+rCqz9Vh/cqx24hss/12q0CMLnPCCN8zL7HWuUyOI8eAO/qN9Nqu50vmdt/aEIVi7cBsLkZEP4Ho/8srJ4CeC6UtVS6B1iBO26PbnbQELStoHvaFow7Tkb04OVcANgSDNEBMTRl2IIlko9ZN9RqgS5a4RhfbLGvgSASTOef/O5/B6dgaMxY0Pa3wGeVv6hgq8nkt6PfmlPpPByzA2TESJejeuux7NlnWSJrdwVpdcgnkV2v6qz9/Yx/9D7M4c/xpje+47e2/3EBAwoeOFDfCFMbs1VXMedQ2WlQ2VuZrgzV8JmHg0G1khTnAA=
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(376002)(396003)(39860400002)(451199021)(40470700004)(46966006)(36840700001)(26005)(31686004)(478600001)(82740400003)(86362001)(31696002)(2616005)(186003)(36860700001)(81166007)(16576012)(54906003)(70586007)(4326008)(83380400001)(356005)(336012)(110136005)(426003)(53546011)(70206006)(316002)(47076005)(5660300002)(8676002)(8936002)(44832011)(40460700003)(41300700001)(2906002)(40480700001)(82310400005)(36756003)(21314003)(3940600001)(36900700001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7409
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	c6671a5a-144d-43a8-5b8a-08db7b84220e
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	hmVKibyuUERV3nzI8/mNG6ZDI5Cdt+rCgTV+QBrkmOQ81CVm2N85Y2ZRDnJ8zgm1cOA1KsMI/wNxpsRlcEGABSqjLO55PauO/dqQNnlgGawBf+Gtoi96mJ+wwTHm5YwnKo1Gd3Dw6/zAIosSOPFQqpU9Z/RNYvHl4S25vGuaD01XY66a5FCM8PVxqWsmqKDPtGkeU3Tn0auYuylvrKKu1hoh003Q5bKPMRmj29uu8Xbbn0GwsWjOEYVwEqoVVWmbQwncWsjiFCluwUrqtCQBcwIhn0ou0CmLoaR4PxINktJY2TowI+cSohrPooS4dUJRFpyriYJB1a/fW9TlYXAxYBlRopCuun3UDoxdpxdZe0ArCeN8s7fja63zgS3jyctiq1wtC7DMROpS3T2V5kiK/7vR3t1NfkkFMC/o+9/L5dok9tk1yTG+hhKzXwFBOB/f9Gm6dv9JCPGyuDhP7lnSeQau+Wzy04BFGK2dNO8T+AfSFMN8/5yqi6QySmfg4oa9aNPZHFdu6yYAAHtgwBQ+6P2LO1adPqNk89/Sj5OPMNNgfoG3/BTcMwuXJljOpcE2bOrLuqQya29BermPTD3+Kmd9kwJxxjP747LeS41PdxuddQxOyWmZC0ezMTzq/gxj4Ldre54hrS8PytF/AqswEgQJVPeFYCbGwSw8WbJimPPjw18Mnuk3tIAUw9Bg3sOHUMxxAlWRTow2tyahP/tw7+ivqtrBNlYdUa0odZTX/gmqCeb5fG/SFKGNJ4lRPaOoA2oT0XBxUv/IrvEPVpBNM9hpAE1t6UPyppB05UIpc0As5bc50J9BGVrJN8uY1h0nw2NQjPALYQM+7SJXWGkD9A==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(346002)(136003)(376002)(451199021)(46966006)(40470700004)(36840700001)(54906003)(16576012)(26005)(44832011)(53546011)(186003)(8936002)(36756003)(31696002)(86362001)(8676002)(2906002)(110136005)(31686004)(5660300002)(40460700003)(41300700001)(478600001)(107886003)(81166007)(40480700001)(4326008)(70586007)(82740400003)(70206006)(47076005)(2616005)(336012)(82310400005)(83380400001)(316002)(36860700001)(426003)(21314003)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 05:12:55.0730
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 95618774-3ce8-4307-f8af-08db7b8428ae
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6111

Hi,


On 2023/6/30 23:02, Julien Grall wrote:
> Hi,
> 
> On 30/06/2023 15:42, Ayan Kumar Halder wrote:
>> Hi Julien,
>>
>> On 30/06/2023 12:22, Julien Grall wrote:
>>>
>>>
>>> On 30/06/2023 11:49, Ayan Kumar Halder wrote:
>>>>
>>>> On 30/06/2023 05:07, Penny Zheng wrote:
>>>>> Hi,
>>>> Hi Penny,
>>>>>
>>>>>
>>>>> On 2023/6/30 01:22, Ayan Kumar Halder wrote:
>>>>>>
>>>>>> On 26/06/2023 04:34, Penny Zheng wrote:
>>>>>>> CAUTION: This message has originated from an External Source. 
>>>>>>> Please use proper judgment and caution when opening attachments, 
>>>>>>> clicking links, or responding to this email.
>>>>>>>
>>>>>>>
>>>>>>> In MPU system, MPU memory region is always mapped PAGE_ALIGN, so 
>>>>>>> in order to
>>>>>>> not access unexpected memory area, dtb section in xen.lds.S 
>>>>>>> should be made
>>>>>>> page-aligned too.
>>>>>>> We add . = ALIGN(PAGE_SIZE); in the head of dtb section to make 
>>>>>>> it happen.
>>>>>>>
>>>>>>> In this commit, we map early FDT with a transient MPU memory 
>>>>>>> region, as
>>>>>>> it will be relocated into heap and unmapped at the end of boot.
>>>>>>>
>>>>>>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>>>>>>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>>>>>>> ---
>>>>>>> v3:
>>>>>>> - map the first 2MB. Check the size and then re-map with an extra 
>>>>>>> 2MB if needed
>>>>>>> ---
>>>>>>> Â  xen/arch/arm/include/asm/arm64/mpu.h |Â  3 ++-
>>>>>>> Â  xen/arch/arm/include/asm/page.hÂ Â Â Â Â  |Â  5 +++++
>>>>>>> Â  xen/arch/arm/mm.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  | 26 
>>>>>>> ++++++++++++++++++++------
>>>>>>> Â  xen/arch/arm/mpu/mm.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  1 +
>>>>>>> Â  xen/arch/arm/xen.lds.SÂ Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  5 ++++-
>>>>>>> Â  5 files changed, 32 insertions(+), 8 deletions(-)
>>>>>>>
>>>>>>> diff --git a/xen/arch/arm/include/asm/arm64/mpu.h 
>>>>>>> b/xen/arch/arm/include/asm/arm64/mpu.h
>>>>>>> index a6b07bab02..715ea69884 100644
>>>>>>> --- a/xen/arch/arm/include/asm/arm64/mpu.h
>>>>>>> +++ b/xen/arch/arm/include/asm/arm64/mpu.h
>>>>>>> @@ -72,7 +72,8 @@ typedef union {
>>>>>>> Â Â Â Â Â Â Â Â Â  unsigned long ns:1;Â Â Â Â  /* Not-Secure */
>>>>>>> Â Â Â Â Â Â Â Â Â  unsigned long res:1;Â Â Â  /* Reserved 0 by hardware */
>>>>>>> Â Â Â Â Â Â Â Â Â  unsigned long limit:42; /* Limit Address */
>>>>>>> -Â Â Â Â Â Â Â  unsigned long pad:16;
>>>>>>> +Â Â Â Â Â Â Â  unsigned long pad:15;
>>>>>>> +Â Â Â Â Â Â Â  unsigned long tran:1;Â Â  /* Transient region */
>>>>>>> Â Â Â Â Â  } reg;
>>>>>>> Â Â Â Â Â  uint64_t bits;
>>>>>>> Â  } prlar_t;
>>>>>>> diff --git a/xen/arch/arm/include/asm/page.h 
>>>>>>> b/xen/arch/arm/include/asm/page.h
>>>>>>> index 85ecd5e4de..a434e2205a 100644
>>>>>>> --- a/xen/arch/arm/include/asm/page.h
>>>>>>> +++ b/xen/arch/arm/include/asm/page.h
>>>>>>> @@ -97,19 +97,24 @@
>>>>>>> Â Â  * [3:4] Execute Never
>>>>>>> Â Â  * [5:6] Access Permission
>>>>>>> Â Â  * [7]Â Â  Region Present
>>>>>>> + * [8]Â Â  Transient Region, e.g. MPU memory region is temproraily
>>>>>>> + *Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  mapped for a short time
>>>>>>> Â Â  */
>>>>>>> Â  #define _PAGE_AI_BITÂ Â Â Â Â Â Â Â Â Â Â  0
>>>>>>> Â  #define _PAGE_XN_BITÂ Â Â Â Â Â Â Â Â Â Â  3
>>>>>>> Â  #define _PAGE_AP_BITÂ Â Â Â Â Â Â Â Â Â Â  5
>>>>>>> Â  #define _PAGE_PRESENT_BITÂ Â Â Â Â Â  7
>>>>>>> +#define _PAGE_TRANSIENT_BITÂ Â Â Â  8
>>>>>> I don't think this is related to MPU. At least when I look at the 
>>>>>> bit representation of PRBAR_EL1/2,
>>>>>
>>>>> This set of _PAGE_xxx flags aren't compliant with PRBAR_EL1/2 
>>>>> register map.
>>>>> It is a flag passed to function map_pages_to_xen() to indicate memory
>>>>> attributes and permission.
>>>>
>>>> But aren't you writing these flags to PRBAR_EL1/EL2 when you call 
>>>> xen_mpumap_update_entry().
>>>>
>>>> In the below snippet of xen_mpumap_update_entry(), IIUC, you are 
>>>> writing these flags.
>>>>
>>>> Â Â Â Â Â Â Â Â  xen_mpumap[idx].prbar.reg.ap = PAGE_AP_MASK(flags);
>>>> Â Â Â Â Â Â Â Â  xen_mpumap[idx].prbar.reg.xn = PAGE_XN_MASK(flags);
>>>>
>>>> Â Â Â Â Â Â Â Â  write_protection_region((const pr_t*)(&xen_mpumap[idx]), idx);
>>>>
>>>> Please clarify here.
>>>>
>>>> In this case, I don't prefer mixing hardware specific bits with 
>>>> software only representation for these reasons :-
>>>>
>>>> 1. It makes it confusing and hard to differentiate the hardware 
>>>> specific attrbutes from software only.
>>>
>>> Penny's approach matches what we are doing in the MMU code. We want 
>>> to have a way for the caller to pass just set of flags and let the 
>>> callee to decide what to do with them.
>>>
>>> This may be flags converted for HW fields or just used by the logic.
>>>
>>> If you disagree with this approach, then can you propose a different 
>>> way that we can discuss?

Thanks ayan for pointing out that RES0 is not suitable for storing 
software-only flags, agreed.

Then, maybe we should refine the existing "struct pr_t" to store these
sw bits, like:
```
typedef union {
     struct {
        uint8_t tran:1; /* Transient region */
        uint8_t p2m_type:4; /* Used to store p2m types.*/
     };
     uint8_t bits;
} pr_flags;

/* MPU Protection Region */
typedef struct {
     	prbar_t prbar;
     	prlar_t prlar;
	pr_flags flags;	
} pr_t;
```
The drawback is that, considering the padding, "struct pr_t" expands 
from 16 bytes to 24 bytes.

Wdyt?

>>
>> In MMU, I could see "struct lpae_pt_t{ .avail }" is used for reference 
>> count.
>>
>> Something like this might look better (where the hardware specific 
>> bits are not reused for sw logic)
>>
>> struct {
>>
>> Â Â Â Â Â Â Â Â Â Â  struct __packed {
>>
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  ... /* the existing bits as they are */
>>
>> Â Â  Â  Â  Â  Â  } lpae_pt_t;
>>
>> Â Â Â Â Â Â Â Â Â Â  unsigned int ref_count;
>>
>> } p2m_entry
>> Â > And use "p2m_entry.ref_count" for the reference counting.
> 
> So where would you store 'ref_count'? In the existing approach, this is 
> store in the PTE and that's fine because the bits 58:55 are reserved for 
> software use.
> 
> This is right in the middle of the PTE. So we have no other choice other 
> than describing right in the middle of lpae_pt_t.
> 
> Cheers,
> 


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 05:35:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 05:35:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558002.871755 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGCDv-0004MB-7k; Mon, 03 Jul 2023 05:35:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558002.871755; Mon, 03 Jul 2023 05:35:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGCDv-0004M4-5C; Mon, 03 Jul 2023 05:35:43 +0000
Received: by outflank-mailman (input) for mailman id 558002;
 Mon, 03 Jul 2023 05:35:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ukTE=CV=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qGCDu-0004Lv-7K
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 05:35:42 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 721d0877-1963-11ee-b237-6b7b168915f2;
 Mon, 03 Jul 2023 07:35:40 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id D06B81F8B2;
 Mon,  3 Jul 2023 05:35:39 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B62CE134B1;
 Mon,  3 Jul 2023 05:35:39 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id viL+KiteomSxIQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 03 Jul 2023 05:35:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 721d0877-1963-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688362539; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=SiYx+m5n+OwCValWNWeTAOs4l6Bi7NKlP3Poqq5vL+U=;
	b=jlvZ4uCFeuLjkeoDOXpK1BE+ffn3MH5uGccDB+mCcw1N1OK8u1L0VyNtYoXx8xGE20oFyz
	mDHvLYTeYmj1R23Z74vEQfkCNDP4lazf1MGn774pn/C2KI0TQl1PEe0klqm1OKoEfIiJTE
	zGxkjQBXgrOWO3hH/PNpiipfFo8wQR4=
Message-ID: <6296a02e-863b-879d-6993-1a828e71fac2@suse.com>
Date: Mon, 3 Jul 2023 07:35:39 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
To: osstest service owner <osstest-admin@xenproject.org>,
 xen-devel@lists.xenproject.org
References: <osstest-181682-mainreport@xen.org>
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
Subject: Re: [linux-linus test] 181682: regressions - FAIL
In-Reply-To: <osstest-181682-mainreport@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------E2UM0qlIlQvXqtouwG4lKIp0"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------E2UM0qlIlQvXqtouwG4lKIp0
Content-Type: multipart/mixed; boundary="------------2z695epUxBPhEf0Mexj6tp1v";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: osstest service owner <osstest-admin@xenproject.org>,
 xen-devel@lists.xenproject.org
Message-ID: <6296a02e-863b-879d-6993-1a828e71fac2@suse.com>
Subject: Re: [linux-linus test] 181682: regressions - FAIL
References: <osstest-181682-mainreport@xen.org>
In-Reply-To: <osstest-181682-mainreport@xen.org>

--------------2z695epUxBPhEf0Mexj6tp1v
Content-Type: multipart/mixed; boundary="------------4IoVn4EUPxNb0tLXEWTsVvKt"

--------------4IoVn4EUPxNb0tLXEWTsVvKt
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMDMuMDcuMjMgMDQ6MTEsIG9zc3Rlc3Qgc2VydmljZSBvd25lciB3cm90ZToNCj4gZmxp
Z2h0IDE4MTY4MiBsaW51eC1saW51cyByZWFsIFtyZWFsXQ0KPiBodHRwOi8vbG9ncy50ZXN0
LWxhYi54ZW5wcm9qZWN0Lm9yZy9vc3N0ZXN0L2xvZ3MvMTgxNjgyLw0KPiANCj4gUmVncmVz
c2lvbnMgOi0oDQo+IA0KPiBUZXN0cyB3aGljaCBkaWQgbm90IHN1Y2NlZWQgYW5kIGFyZSBi
bG9ja2luZywNCj4gaW5jbHVkaW5nIHRlc3RzIHdoaWNoIGNvdWxkIG5vdCBiZSBydW46DQoN
Ci4uLg0KDQo+ICAgdGVzdC1hbWQ2NC1hbWQ2NC14bCAgICAgICAgICAxMiBkZWJpYW4taW5z
dGFsbCAgICAgICAgICAgZmFpbCBSRUdSLiB2cy4gMTgwMjc4DQoNCkVycm9ycyBkdXJpbmcg
aW5zdGFsbGF0aW9uIG9mIC5kZWIgZmlsZXMuIFdvcnJ5aW5nIG1lc3NhZ2VzIGluIHRoZSBz
ZXJpYWwgbG9nDQphcmU6DQoNClsgICAgMi45NzcwOTFdIEJhZCBGUFUgc3RhdGUgZGV0ZWN0
ZWQgYXQgcmVzdG9yZV9mcHJlZ3NfZnJvbV9mcHN0YXRlKzB4NTIvMHhjMCwgDQpyZWluaXRp
YWxpemluZyBGUFUgcmVnaXN0ZXJzLg0KDQp0cmFwczogZHBrZy1kZWJbMTQxM10gdHJhcCBp
bnZhbGlkIG9wY29kZSBpcDo3ZjVjMGEwMTY5M2Ygc3A6N2ZmZTNkYWY1ZDk4IA0KZXJyb3I6
MCBpbiBsaWJjLTIuMjguc29bN2Y1YzA5ZWUwMDAwKzE0NzAwMF0NCg0KT2xhZiBoYXMgc2Vl
biBzaW1pbGFyIGZhaWx1cmVzIGxhc3Qgd2Vlaywgc28gd2UgaGF2ZSBhIHJlcHJvZHVjZXIg
YXQgaGFuZC4NCg0KLi4uDQoNCj4gICBidWlsZC1hcm02NC1wdm9wcyAgICAgICAgICAgICA2
IGtlcm5lbC1idWlsZCAgICAgICAgICAgICBmYWlsIFJFR1IuIHZzLiAxODAyNzgNCg0KVGhp
cyBvbmUgZmFpbGVkIHdpdGggYSBjb21waWxlciBwcm9ibGVtIChzZWdtZW50YXRpb24gZmF1
bHQpLg0KDQpJIGRpZG4ndCBsb29rIGludG8gdGhlIG90aGVyIGVycm9ycyBpbiBkZXRhaWwu
DQoNCg0KSnVlcmdlbg0K
--------------4IoVn4EUPxNb0tLXEWTsVvKt
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EO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
N1EblHI//x/e2AaIHpzK5h88NEawQsaNRpNSrcfbFmAg987ATQRTjHAWAQgAyzH6
AOODMBjgfWE9VeCgsrwH3exNAU32gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------4IoVn4EUPxNb0tLXEWTsVvKt--

--------------2z695epUxBPhEf0Mexj6tp1v--

--------------E2UM0qlIlQvXqtouwG4lKIp0
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSiXisFAwAAAAAACgkQsN6d1ii/Ey+i
lAgAiSfapSHNoGVI4zxIzypsH57ugmQacZ7/w5DAtkeQwGZMm6qqxf8VJvY6iK/L9e1uF1ZTrMdf
AY23ygzclUxfXnWjB9Vpc7TRNi+4qvb+Ky8diHUthid6gmXvyfCzfJBlvc8gG+v8AkIBVArxcQwP
4Iq14YU8cYapBd5FprRJIHhHIuewseEquQP9/C3V2nm3k1IyNh2PhxjFDQfcp0KZjrI5iAT8WTJq
vxoi+oPKOXQwdYLxLASKWUHksqFBUt+arQQc5H+rdxPNlpS3y35/p8K2VcEDlA2hfIMMmHCXKCUd
wo9TuQuTXdzc6A1sXuks7OeSzaplCdXoMhFcTRPQzA==
=1il5
-----END PGP SIGNATURE-----

--------------E2UM0qlIlQvXqtouwG4lKIp0--


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 06:11:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 06:11:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558006.871766 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGClx-0000Np-T4; Mon, 03 Jul 2023 06:10:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558006.871766; Mon, 03 Jul 2023 06:10:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGClx-0000Ni-Ps; Mon, 03 Jul 2023 06:10:53 +0000
Received: by outflank-mailman (input) for mailman id 558006;
 Mon, 03 Jul 2023 06:10:52 +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
 <SRS0=7hCK=CV=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qGClw-0000Nc-1t
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 06:10:52 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20602.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::602])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5ad9e684-1968-11ee-8611-37d641c3527e;
 Mon, 03 Jul 2023 08:10:49 +0200 (CEST)
Received: from DUZPR01CA0349.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4b8::14) by AM0PR08MB5428.eurprd08.prod.outlook.com
 (2603:10a6:208:182::18) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul
 2023 06:10:45 +0000
Received: from DBAEUR03FT052.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4b8:cafe::8f) by DUZPR01CA0349.outlook.office365.com
 (2603:10a6:10:4b8::14) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.30 via Frontend
 Transport; Mon, 3 Jul 2023 06:10:45 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT052.mail.protection.outlook.com (100.127.142.144) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.17 via Frontend Transport; Mon, 3 Jul 2023 06:10:45 +0000
Received: ("Tessian outbound d6c4ee3ba1eb:v142");
 Mon, 03 Jul 2023 06:10:44 +0000
Received: from de3b029c99cd.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 4DAE93B2-94F7-4F47-96A2-10DFF62EC42C.1; 
 Mon, 03 Jul 2023 06:10:38 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id de3b029c99cd.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Mon, 03 Jul 2023 06:10:38 +0000
Received: from AS4P250CA0006.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5df::8)
 by PAVPR08MB9794.eurprd08.prod.outlook.com (2603:10a6:102:31e::17) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul
 2023 06:10:33 +0000
Received: from AM7EUR03FT030.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:5df:cafe::46) by AS4P250CA0006.outlook.office365.com
 (2603:10a6:20b:5df::8) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.30 via Frontend
 Transport; Mon, 3 Jul 2023 06:10:33 +0000
Received: from nebula.arm.com (40.67.248.234) by
 AM7EUR03FT030.mail.protection.outlook.com (100.127.140.180) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.17 via Frontend Transport; Mon, 3 Jul 2023 06:10:33 +0000
Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX04.Arm.com
 (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 3 Jul
 2023 06:10:32 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com
 (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 3 Jul
 2023 06:10:31 +0000
Received: from [10.169.188.49] (10.169.188.49) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Mon, 3 Jul 2023 06:10:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5ad9e684-1968-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5ddtpptgBVErJpYyc7OJBm5OKLGxklqjneMQV/9ZNmc=;
 b=pNBCxvFim+SSCiorsnRFvq8c5vKRR49g9u1eNO9N70uzImE+aCzqCz3OdZxESw8WU1tPmC10mfOm/cKraLuEO2z1P4/HN3nrWClszixLvOShKYixhtcLvAqh+5QOHHltJVSqYuitKouIrAqIzCO9je1EfF+lzlY02KXusIaADoU=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: cda4d3550265ad68
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KTyA86J/FX6FJqcXzTN8eWEC4r0nt17sys+ZT5fM/1VuIVQr1mL045mQ3zqMkuSr5oXzer3FEFyLgYFO4mztKXF/eJwKOT42fHANy2uwWokI0lw8EaKfYBy6pWRpenE6OmwqXFRm2pQMusSCXjh9MC71tqEv2vNd4WJzmfmOpWL7xL8Y5aF5rkhaPbv6lZ2V79tvb//4BdFBE6/2KZpJvE6fGLVK/pnO1JrO8zWzvkSM94Be4RVhDdk14GfBiV8ZqM/p7PZhEoAOX7dXBFTFwxqQb1vlIN8/Ago0nx6C3joAfksIzv0ZWeF3XsBNaqAiwmjbuebKXs3IeQQ89O/Ikg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5ddtpptgBVErJpYyc7OJBm5OKLGxklqjneMQV/9ZNmc=;
 b=M/ukbSpRiajz2vEIrsqCgLXP1Wzj8LRkT23vnN9e5VlihRRRWThN3q6Peq0A8adsNGdBDbMjQuKC09mmllUlZ8OBQLRk8b6vZgtPKJ61n22yFcAiSDGhbi8KrNwQ2HT2fZIbwtEGsiNYVdAwK1EgoiScqdAgHdhbaR5fCYy8SpQsAYjJPkCjFTfKTC3urNeNWcvogDdnP0op17NODQUAzsrWU1clSP6TtGqZUaIMK/8qrGOlad5Kr+r4OIHyf7tccKflNUd1W4SlybDL8B02NDiqjXONVThxpCgBBmLC7FGaqcH8FvV5VBb2auFay48XrgXTjPOEMx8UcQ2EsKzFBw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=amd.com smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5ddtpptgBVErJpYyc7OJBm5OKLGxklqjneMQV/9ZNmc=;
 b=pNBCxvFim+SSCiorsnRFvq8c5vKRR49g9u1eNO9N70uzImE+aCzqCz3OdZxESw8WU1tPmC10mfOm/cKraLuEO2z1P4/HN3nrWClszixLvOShKYixhtcLvAqh+5QOHHltJVSqYuitKouIrAqIzCO9je1EfF+lzlY02KXusIaADoU=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <db707ef1-cc91-bc7d-33d2-bf804ece2226@arm.com>
Date: Mon, 3 Jul 2023 14:10:27 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 33/52] xen/mpu: initialize frametable in MPU system
Content-Language: en-US
To: Ayan Kumar Halder <ayankuma@amd.com>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-34-Penny.Zheng@arm.com>
 <ee709651-a6fc-2485-ae2b-edf0306fbc13@amd.com>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <ee709651-a6fc-2485-ae2b-edf0306fbc13@amd.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	AM7EUR03FT030:EE_|PAVPR08MB9794:EE_|DBAEUR03FT052:EE_|AM0PR08MB5428:EE_
X-MS-Office365-Filtering-Correlation-Id: 620ba86c-7b40-4578-5170-08db7b8c3cec
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 9aSGM2pI99lv6gTqc/HpxKf7+RMe+ugoSO7vITA8I/HZxxaEycGSNwVSY2Y70q0C1HMgnde2d33gnUDjn8BKYpv5RHeQPCyK+XfSToJplXf8ah6zzHwg5KEHAwxOArahlzoTZ/i/cJ6H5i1Tfh3OZkFZzhYaAIywTzsB/4jZGnCWhMUDf9PMciRwMqnWa1e0PmCmw9Q4Fdxi8UdWpJ99dJ5v49aoylES5voFowdgkvKkkpp58fLWCBnXEoJ8h2mDNpUYyxmcfXLG6/HmAhn8R2uer8a119qfdH2S4ffChoe9/FdBXKc7PzjxOmWigL2ZBDajNJ7ZcVMPj67j+YJJWYTQ2PJ5h4rMyZmhUO1SSQc6pOUX2+syAmO4itztnJZnXddUqnU5fjGDatcgXDEapN1tWwFWEZcfYW7NRFdYy/0qyfsp2XQN6Su+sEp/1FXjzTnmgT7jCdbTx+nGbPjmiqwRSmqQ9XdcxD3e2UarHu/TKqH0dWUaCc1fWUZhTvlREbQulYGe+tFhe4wQBzwSEQzmDmyaKlqA7TwFc8AWnfppQXi6zcyyFn9g8dUEh7IQltgMVuvFDQfqxNkzZZxPwiQCq7UFe3bCnrwqZovsZknEBMV0Xr2rvuIX8eeN0UUYq0lsKUuD0AJ1Kz8iVi3I8md7xP3CRtyV1EApG0R7CvLesrzVaKwLXgIknh9wWsrgfrY/ngHMjhyL1niLThnJc8ESsqVZasos1p/rIII/rCk1kRI9k8fib0LgoG1rZ4N/DLbm7N9PpxBnMzfged8XWWf59b+gnVPIXsVeDbreY4MeInSGtU7YA/7PfaHbWAX/3sbNdWxU4L8TRmgNa5B4dQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(376002)(396003)(39860400002)(451199021)(40470700004)(46966006)(36840700001)(26005)(31686004)(478600001)(82740400003)(86362001)(31696002)(2616005)(186003)(36860700001)(81166007)(16576012)(54906003)(70586007)(4326008)(83380400001)(356005)(336012)(110136005)(426003)(53546011)(70206006)(316002)(47076005)(5660300002)(8676002)(8936002)(44832011)(40460700003)(41300700001)(2906002)(40480700001)(82310400005)(36756003)(3940600001)(36900700001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9794
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT052.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	5d8a6176-5f70-4d7f-8025-08db7b8c35c9
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	t3U7Btl2goS0gYCbWpR7Qt3+g6Vu6MyVFIXpZdU1bPEvH/wxtUHM1CigWH0I1XRrp3siunfSnkRbtW9QY0HcKlr2bhRDjRYY/ofjVogH7IKdEtnvB5eQUnucSq1yU5+bS5yOfP4qZi7yRAkME012wi5sjpzefQp5aCoqjvhtaVP6QksPWRP32/T+BpIkDA+B2nZQmfh3yRulPZSEyBkjOauCLL/p7EqbtWDcWpy2iEbEgzJXXx6AAbpKwITavifDtNiXcLQ5j/szALfLJBRKjL7+Gyrulss+keXpFKdC44zNp4za22hQA/Xq1Ss3qCt/eTJXzWTxHwf66kKTIRhL9vZ7G5e0T9P0ybLUYSg0IzAOi8Rr3TbytdsbsYJvWcpFzwLhJ7bJOvklixSWcbY1q1SsTxfMZWWkcFjRMeNakMTUOpqOabX51HxIveCMn956miOYWtJtTCYDdZVSGGVFMBKXbm8p6iIUkUfdgixj+MWazc99+iZBzaVcI06+fNqWC1Pv3jSkFlSUQYAfSdtSloV7N0mOS1Z7TNLavnLxlnHXx0lBICtkvCgQR5jNbz+X6gDHyJMznvMaVpwD1CgZUQjizb+63sWAPBaw1avsVSyFVcBguZp+Kdj9ctvnVAYvNRDSNSY0DN433tOjeSL+NVL9E70WWqA+YQFa58tTATOS9u8b6hD1ijwJcV2ZfSxA/kjsMUmYVlVR3G14CcyC7rMsSzsEZSozvKN70WSVDRWzTGip+S1Bw3lqEm9f16HAMTBjCn/Kyy6UvaEwM3Cs3vA4S/7nJfH2EjSIuDcPUmgvOCYMZ1WCZhNheMqKO4Ss
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(376002)(39860400002)(396003)(451199021)(40470700004)(46966006)(36840700001)(40460700003)(2906002)(41300700001)(5660300002)(44832011)(8936002)(8676002)(82310400005)(36756003)(40480700001)(86362001)(31696002)(478600001)(83380400001)(47076005)(426003)(336012)(36860700001)(186003)(26005)(53546011)(31686004)(2616005)(54906003)(110136005)(16576012)(82740400003)(4326008)(70206006)(70586007)(81166007)(316002)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 06:10:45.0659
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 620ba86c-7b40-4578-5170-08db7b8c3cec
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT052.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5428

Hi Ayan

On 2023/6/30 23:19, Ayan Kumar Halder wrote:
> Hi Penny,
> 
> On 26/06/2023 04:34, Penny Zheng wrote:
>> CAUTION: This message has originated from an External Source. Please 
>> use proper judgment and caution when opening attachments, clicking 
>> links, or responding to this email.
>>
>>
>> Xen is using page as the smallest granularity for memory managment.
>> And we want to follow the same concept in MPU system.
>> That is, structure page_info and the frametable which is used for storing
>> and managing the smallest memory managment unit is also required in 
>> MPU system.
>>
>> In MPU system, since we can not use a fixed VA 
>> address(FRAMETABLE_VIRT_START)
>> to map frametable like MMU system does and everything is 1:1 mapping, we
>> instead define a variable "struct page_info *frame_table" as frametable
>> pointer, and ask boot allocator to allocate appropriate memory for 
>> frametable.
>>
>> As frametable is successfully initialized, the convertion between 
>> machine frame
>> number/machine address/"virtual address" and page-info structure is
>> ready too, like mfn_to_page/maddr_to_page/virt_to_page, etc
>>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> ---
>> v3:
>> - add ASSERT() to confirm the MFN you pass is covered by the frametable.
>> ---
>> Â  xen/arch/arm/include/asm/mm.hÂ Â Â Â  | 14 ++++++++++++++
>> Â  xen/arch/arm/include/asm/mpu/mm.h |Â  3 +++
>> Â  xen/arch/arm/mpu/mm.cÂ Â Â Â Â Â Â Â Â Â Â Â  | 27 +++++++++++++++++++++++++++
>> Â  3 files changed, 44 insertions(+)
>>
>> diff --git a/xen/arch/arm/include/asm/mm.h 
>> b/xen/arch/arm/include/asm/mm.h
>> index daa6329505..66d98b9a29 100644
>> --- a/xen/arch/arm/include/asm/mm.h
>> +++ b/xen/arch/arm/include/asm/mm.h
>> @@ -341,6 +341,19 @@ static inline uint64_t gvirt_to_maddr(vaddr_t va, 
>> paddr_t *pa,
>> Â  #define virt_to_mfn(va)Â Â Â Â  __virt_to_mfn(va)
>> Â  #define mfn_to_virt(mfn)Â Â Â  __mfn_to_virt(mfn)
>>
>> +#ifdef CONFIG_HAS_MPU
>> +/* Convert between virtual address to page-info structure. */
>> +static inline struct page_info *virt_to_page(const void *v)
>> +{
>> +Â Â Â  unsigned long pdx;
>> +
>> +Â Â Â  pdx = paddr_to_pdx(virt_to_maddr(v));
>> +Â Â Â  ASSERT(pdx >= frametable_base_pdx);
>> +Â Â Â  ASSERT(pdx < frametable_pdx_end);
>> +
>> +Â Â Â  return frame_table + pdx - frametable_base_pdx;
>> +}
> This should go in xen/arch/arm/include/asm/mpu/mm.h. Then you don't need 
> ifdef
>> +#else
>> Â  /* Convert between Xen-heap virtual addresses and page-info 
>> structures. */
>> Â  static inline struct page_info *virt_to_page(const void *v)
>> Â  {
>> @@ -354,6 +367,7 @@ static inline struct page_info *virt_to_page(const 
>> void *v)
>> Â Â Â Â Â  pdx += mfn_to_pdx(directmap_mfn_start);
>> Â Â Â Â Â  return frame_table + pdx - frametable_base_pdx;
>> Â  }
> Consequently, this should be in xen/arch/arm/include/asm/mmu/mm.h

The reason why I don't put virt_to_page()/page_to_virt() in specific 
header is that we are using some helpers, which are defined just
a few lines before, like mfn_to_virt(), etc.
If you are moving mfn_to_virt() to specific header too, that will
result in a lot dulplication.

>> +#endif
>>
>> Â  static inline void *page_to_virt(const struct page_info *pg)
>> Â  {
>> diff --git a/xen/arch/arm/include/asm/mpu/mm.h 
>> b/xen/arch/arm/include/asm/mpu/mm.h
>> index e26bd4f975..98f6df65b8 100644
>> --- a/xen/arch/arm/include/asm/mpu/mm.h
>> +++ b/xen/arch/arm/include/asm/mpu/mm.h
>> @@ -2,6 +2,9 @@
>> Â  #ifndef __ARCH_ARM_MM_MPU__
>> Â  #define __ARCH_ARM_MM_MPU__
>>
>> +extern struct page_info *frame_table;
> If you define frame_table in xen/arch/arm/include/asm/mm.h , then you 
> don't need the above declaration.

It is a variable only in MPU. In MMU, it is a fixed value.
"#define frame_table ((struct page_info *)FRAMETABLE_VIRT_START)"

>> +extern unsigned long frametable_pdx_end;
> Also you don't need extern as this is only used by xen/arch/arm/mpu/mm.c.

sure.

>> +
>> Â  extern int xen_mpumap_update(paddr_t base, paddr_t limit, unsigned 
>> int flags);
> 
> You don't need extern here as it should be used only in 
> xen/arch/arm/mpu/mm.c
> 
> Currently, I see the following in xen/arch/arm/mm.c,
> 
> int map_pages_to_xen(unsigned long virt,
>  Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_t mfn,
>  Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned long nr_mfns,
>  Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned int flags)
> {
> #ifndef CONFIG_HAS_MPU
>  Â Â Â  return xen_pt_update(virt, mfn, nr_mfns, flags);
> #else
>  Â Â Â  return xen_mpumap_update(mfn_to_maddr(mfn),
>  Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_to_maddr(mfn_add(mfn, nr_mfns)), flags);
> #endif
> }
> 
> int destroy_xen_mappings(unsigned long s, unsigned long e)
> {
>  Â Â Â  ASSERT(IS_ALIGNED(s, PAGE_SIZE));
>  Â Â Â  ASSERT(IS_ALIGNED(e, PAGE_SIZE));
>  Â Â Â  ASSERT(s <= e);
> #ifndef CONFIG_HAS_MPU
>  Â Â Â  return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, 0);
> #else
>  Â Â Â  return xen_mpumap_update(virt_to_maddr((void *)s),
>  Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  virt_to_maddr((void *)e), 0);
> #endif
> }
> 
> int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int 
> flags)
> {
>  Â Â Â  ASSERT(IS_ALIGNED(s, PAGE_SIZE));
>  Â Â Â  ASSERT(IS_ALIGNED(e, PAGE_SIZE));
>  Â Â Â  ASSERT(s <= e);
> #ifndef CONFIG_HAS_MPU
>  Â Â Â  return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, flags);
> #else
>  Â Â Â  return xen_mpumap_update(virt_to_maddr((void *)s),
>  Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  virt_to_maddr((void *)e), flags);
> #endif
> }
> 
> It would be better to have 2 implementations for map_pages_to_xen(), 
> destroy_xen_mappings() and modify_xen_mappings() in 
> xen/arch/arm/mpu/mm.c and xen/arch/arm/mmu/mm.c.
> 

I prefer them staying in the common file, using #ifdef to go to the
different path.

Since if not and when anyone wants to update map_pages_to_xen(), 
destroy_xen_mappings() and modify_xen_mappings() in the future, it is 
possible for them to leave changes in only one file.

>> Â  extern void setup_staticheap_mappings(void);
>>
>> diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
>> index 7bd5609102..0a65b58dc4 100644
>> --- a/xen/arch/arm/mpu/mm.c
>> +++ b/xen/arch/arm/mpu/mm.c
>> @@ -27,6 +27,10 @@
>> Â  #include <asm/page.h>
>> Â  #include <asm/setup.h>
>>
>> +/* Override macros from asm/mm.h to make them work with mfn_t */
>> +#undef mfn_to_virt
> Why do we have to do this ?
>> +#define mfn_to_virt(mfn) __mfn_to_virt(mfn_x(mfn))
>> +
>> Â  #ifdef NDEBUG
>> Â  static inline void __attribute__ ((__format__ (__printf__, 1, 2)))
>> Â  region_printk(const char *fmt, ...) {}
>> @@ -58,6 +62,9 @@ static DEFINE_SPINLOCK(xen_mpumap_lock);
>>
>> Â  static DEFINE_SPINLOCK(xen_mpumap_alloc_lock);
>>
>> +struct page_info *frame_table;
>> +unsigned long frametable_pdx_end __read_mostly;
>> +
>> Â  /* Write a MPU protection region */
>> Â  #define WRITE_PROTECTION_REGION(pr, prbar_el2, prlar_el2) ({Â Â Â  \
>> Â Â Â Â Â  const pr_t *_pr = pr;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  \
>> @@ -513,6 +520,26 @@ void __init setup_staticheap_mappings(void)
>> Â Â Â Â Â  }
>> Â  }
>>
>> +/* Map a frame table to cover physical addresses ps through pe */
>> +void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
>> +{
>> +Â Â Â  mfn_t base_mfn;
>> +Â Â Â  unsigned long nr_pdxs = mfn_to_pdx(mfn_add(maddr_to_mfn(pe), -1)) -
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_to_pdx(maddr_to_mfn(ps)) + 1;
>> +Â Â Â  unsigned long frametable_size = nr_pdxs * sizeof(struct page_info);
>> +
>> +Â Â Â  frametable_base_pdx = paddr_to_pdx(ps);
>> +Â Â Â  frametable_size = ROUNDUP(frametable_size, PAGE_SIZE);
>> +Â Â Â  frametable_pdx_end = frametable_base_pdx + nr_pdxs;
>> +
>> +Â Â Â  base_mfn = alloc_boot_pages(frametable_size >> PAGE_SHIFT, 1);
>> +Â Â Â  frame_table = (struct page_info *)mfn_to_virt(base_mfn);
>> +
>> +Â Â Â  memset(&frame_table[0], 0, nr_pdxs * sizeof(struct page_info));
>> +Â Â Â  memset(&frame_table[nr_pdxs], -1,
>> +Â Â Â Â Â Â Â Â Â Â  frametable_size - (nr_pdxs * sizeof(struct page_info)));
>> +}
>> +
>> Â  /*
>> Â Â  * Local variables:
>> Â Â  * mode: C
>> -- 
>> 2.25.1
> - Ayan


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 06:51:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 06:51:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558013.871776 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGDPM-0004oO-Tq; Mon, 03 Jul 2023 06:51:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558013.871776; Mon, 03 Jul 2023 06:51:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGDPM-0004oH-Qu; Mon, 03 Jul 2023 06:51:36 +0000
Received: by outflank-mailman (input) for mailman id 558013;
 Mon, 03 Jul 2023 06:51:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGDPK-0004o4-LY; Mon, 03 Jul 2023 06:51:34 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGDPK-0006jn-EZ; Mon, 03 Jul 2023 06:51:34 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGDPJ-0000I7-U9; Mon, 03 Jul 2023 06:51:34 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qGDPJ-0006hm-Tl; Mon, 03 Jul 2023 06:51:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=uXgqzOWOUXav1qQOQlyGqXC/+8GT0k+4BTlEKadg8MQ=; b=2ebaBhn6+FoaDOoHlk5+cNlFdX
	5Dd+vUH/fKQTTKiRnOGj0t6Mkju8IPPr9Vly8nXHIu44y89eGpIHXzp6XuD8gEIXnRwSPoZCzoSIk
	5mOhha6IBM9vsXCXX0jZGuhRRieVo9Rwv/ENLPOVteHGTmlwZQQut7kKeYlTE0d641zQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181685-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181685: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=f2188fe5d1553ad1896e27b2514d2f8d0308da8a
X-Osstest-Versions-That:
    ovmf=ad7d3ace1ad4d7350d1e1304fab86dffd0f3fd11
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 03 Jul 2023 06:51:33 +0000

flight 181685 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181685/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 f2188fe5d1553ad1896e27b2514d2f8d0308da8a
baseline version:
 ovmf                 ad7d3ace1ad4d7350d1e1304fab86dffd0f3fd11

Last test of basis   181680  2023-07-02 10:43:52 Z    0 days
Testing same since   181685  2023-07-03 03:12:31 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Abdul Lateef Attar <abdattar@amd.com>
  Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
  Jiewen Yao <Jiewen.yao@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   ad7d3ace1a..f2188fe5d1  f2188fe5d1553ad1896e27b2514d2f8d0308da8a -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 07:09:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 07:09:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558019.871785 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGDgJ-0006Rc-2z; Mon, 03 Jul 2023 07:09:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558019.871785; Mon, 03 Jul 2023 07:09:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGDgJ-0006RV-0J; Mon, 03 Jul 2023 07:09:07 +0000
Received: by outflank-mailman (input) for mailman id 558019;
 Mon, 03 Jul 2023 07:09:05 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7hCK=CV=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qGDgH-0006RP-1d
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 07:09:05 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0603.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::603])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7d085809-1970-11ee-b237-6b7b168915f2;
 Mon, 03 Jul 2023 09:09:02 +0200 (CEST)
Received: from DU2PR04CA0003.eurprd04.prod.outlook.com (2603:10a6:10:3b::8) by
 GVXPR08MB7749.eurprd08.prod.outlook.com (2603:10a6:150:69::11) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6544.24; Mon, 3 Jul 2023 07:08:56 +0000
Received: from DBAEUR03FT053.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:3b:cafe::59) by DU2PR04CA0003.outlook.office365.com
 (2603:10a6:10:3b::8) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.30 via Frontend
 Transport; Mon, 3 Jul 2023 07:08:56 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT053.mail.protection.outlook.com (100.127.142.121) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.17 via Frontend Transport; Mon, 3 Jul 2023 07:08:55 +0000
Received: ("Tessian outbound e2424c13b707:v142");
 Mon, 03 Jul 2023 07:08:55 +0000
Received: from 826c2dc06566.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 87614CE8-B39B-41D8-81C4-B5F4773FCF38.1; 
 Mon, 03 Jul 2023 07:08:49 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 826c2dc06566.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Mon, 03 Jul 2023 07:08:49 +0000
Received: from AM6P191CA0041.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:7f::18)
 by AM9PR08MB6131.eurprd08.prod.outlook.com (2603:10a6:20b:2de::22) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul
 2023 07:08:47 +0000
Received: from AM7EUR03FT041.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:209:7f:cafe::a3) by AM6P191CA0041.outlook.office365.com
 (2603:10a6:209:7f::18) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.30 via Frontend
 Transport; Mon, 3 Jul 2023 07:08:47 +0000
Received: from nebula.arm.com (40.67.248.234) by
 AM7EUR03FT041.mail.protection.outlook.com (100.127.140.233) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.17 via Frontend Transport; Mon, 3 Jul 2023 07:08:47 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com
 (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 3 Jul
 2023 07:08:46 +0000
Received: from [10.169.172.87] (10.169.172.87) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Mon, 3 Jul 2023 07:08:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7d085809-1970-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Uj/cDl03UCXZVJBoV0kYatgjVvUdCe940CYqzl1ONTc=;
 b=ojEddXJiyXrQgXZRZE6u40Re29YC4HySOslswUEK+lquKVC5dHVyF5Kh/ljEE4eKGsos0smRZk9AMNWLUdztcdB7CaahRw3yXo1KCEbpKbROngKciz9Wk7WZb2UJ5RCPTZ8u1RXAZEP4vS8p8JqqViA4c3QngWkwPupPHP6PGcE=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 682245e51d43774b
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=SfUzYA30LaFQqnxlyohNaWI11It6WRwUxWU88ksfqhX2wNdXLVrMzFqa9abCzC52WeeGPhzWdJ/H/wMqeDcdKuffRjKeGsWucyrdKFFCnmCNy6556tigc8/P647u+7mtGOSSexzipj9pfGtSeE23E3jppkKCGi1NEWI7LiP0L65cgyXsHtHqErIan3XST006bjEjCnJ++sTn+vkGYKgRW2CV1U8X6Jn6pdKyFX6jf8LN3528SVeTkAb5/6Q3tZZ3XPADcf5MHyk425ke7GfvlcOA7WLxYsz12qBFcQZlGT9cbgaVa/10a7vX+6nm/EAzHxW1sGDPCkoeW8xB8536lw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Uj/cDl03UCXZVJBoV0kYatgjVvUdCe940CYqzl1ONTc=;
 b=BJskarfGdW2RKr8VyGTQh1q/BpvRq44vhD3LL+kjOTwR1U2DAfceLeJJUD60fsqQxjvN/NZkA3eqUIovfZXjNBIuNJ1t41LIMyFS3yLBjFoEIjzspL5nh7O4B1GL4E4bUyZ5iAelobTbYs25JCip6EsxRo6EN17L9YKf2PkyJ5rCPdkPgutAXUE3triiUGoUsl9uMls1dBEt9B3T+tBAaJibHnYctQ8gV89RnnTPrB9CuKrTz1x99rKC5Yswm0hA7TUBfoKH4G4ix4XCoxW+prwtx/FtwWU03F4CrKlsCu5KUuzYVMN4HNTEBhvNJY8bo9Uzy+dGkGvMonHB8dhf2w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=amd.com smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Uj/cDl03UCXZVJBoV0kYatgjVvUdCe940CYqzl1ONTc=;
 b=ojEddXJiyXrQgXZRZE6u40Re29YC4HySOslswUEK+lquKVC5dHVyF5Kh/ljEE4eKGsos0smRZk9AMNWLUdztcdB7CaahRw3yXo1KCEbpKbROngKciz9Wk7WZb2UJ5RCPTZ8u1RXAZEP4vS8p8JqqViA4c3QngWkwPupPHP6PGcE=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <70007941-cb74-1fc8-61fd-326b66cde84b@arm.com>
Date: Mon, 3 Jul 2023 15:08:41 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 34/52] xen/mpu: destroy an existing entry in Xen MPU
 memory mapping table
Content-Language: en-US
To: Ayan Kumar Halder <ayankuma@amd.com>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-35-Penny.Zheng@arm.com>
 <87564d07-391b-7dfa-e28f-e13d73e67811@amd.com>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <87564d07-391b-7dfa-e28f-e13d73e67811@amd.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	AM7EUR03FT041:EE_|AM9PR08MB6131:EE_|DBAEUR03FT053:EE_|GVXPR08MB7749:EE_
X-MS-Office365-Filtering-Correlation-Id: 5a10ac97-75ee-43a1-6fbf-08db7b945da9
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 MANqSPb7NxUsVDSAXWrF7uu+zh2QE6aCOjjMUPegJpw66j0LAudXMReD7CENYtwD5F+j4B+mvS2v8V9/pUplnQDhqpBBPcaGW6zB0QguxWTmAFUSsGn6dRNpmNb6MS8Zmdk+2ouGmKEjs4u0Ipbt9CRqLEtH5TplrOM7J5W6Nq23GY65hkLmy9Y2qO/aZul6EStuXkxjW3FGdLcut7CoOWN8MzSSMK5SsJpm6vAKiZPU2TWtSPLv8bCJRlgBWMndfEDHJ7gtMPu0cj5Dh/dBXZySWQKlIdjsnKi5ihUJnMEAvYMR3/blD954BmKryNZex3vo+92cm00EhMTeRxxWhLIZUEAOL5BZS6V5mNQ0w671aDKoti5G+9HfG0BwIqG/8bsafhWbn6i0r5EINKyVr9g/C9VGshB/O7k0B7/lTXjdf2spbJ79yKY8/7nbGF0tw2EUFe+7dsOy8TjYvbrxcUGZPPwKkHIpaSNd8zkgaIllxrPHp21mp35B0laR2K8Du9b/LfVLq0IYo+btThdJ0vPKPT0xB9zGl96mf/AdG9Ocu0SjU2OaPgB2FgAFpIQicSfAz0JJ9wZnzsXXG9914pImUUOV0MB62zy5Li0aZ5W1Ep0uaSDTvngRHvwH/sfmAKN25/M/IVLF+q9akxCaRXMfpVmKZN5mQU6XDLXr4syjXhnV7TLQyqQQ03OTBjLOnwLliKC83jr1oOpBK9ilOefi9AjJC33TIMau+KRjVAAosDNj/lKiC6uM1zOLN4LYT7XwwtIjYfcwUkZfA6hBSZ4v3DruhrWG/XhqxJXPeAcpG0SsG3OxB15tPIWvDJ77bDT8opRs4azFctJh3k4eHg==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(396003)(376002)(136003)(451199021)(36840700001)(46966006)(40470700004)(26005)(31686004)(478600001)(82740400003)(31696002)(86362001)(2616005)(186003)(36860700001)(16576012)(54906003)(70586007)(4326008)(81166007)(83380400001)(356005)(336012)(110136005)(426003)(53546011)(316002)(70206006)(47076005)(5660300002)(8936002)(8676002)(44832011)(40460700003)(41300700001)(2906002)(40480700001)(82310400005)(36756003)(3940600001)(36900700001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6131
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT053.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	1f1e4ff8-5a92-42c0-562c-08db7b9458a6
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	HSQbROiKa/SSfec908gUAO38KKdrZiPpUhHYvLm1AnKwgRZbf02/piRKwyG50iBgTBSOh/OekmIDkVSFIG2405BeOhd0INHWglNbBzRF5rWDMSUJ3kodFJvNpp0Iy9I96QyrN8/isznXxQyujzoK/tvSkGP5jyfmOsIn7Uke44E7IjeosEAp8d7oD2Ydyk9A0jyP351LFKCj2y0ucXn6esZLVmE0RrMTpJpQ/0XVq+4SEgN7t2vHZq5BK4HVRqiVJIU1JSkCLgcCPuNJQMa6CzUf28WuKzTY5bEL98NrFalxHeQG+cchjesRuDkdOFGhJ1QqSU2uIawROmzV/+bN2AlQ5mbb47sx2AFml9QRmUfBuwT854fHmR72TvEhLA8dW4lbaC2wbFM4tepHxzqkKNYdJiuOZCH42Yhk32ZlLWcQHlqYs7u/zRMwRoE61a1aQuW7/61AEHcjdr0cUlcIUL5/DcHY3B2b4onIyDCkYDK6H6+e1BB+Nlz3iD1A/yWnPBCvIgO5Uz2A/3uhEd2JypDLROjA1W7onTiOtPAR0npySwVUIM+G7dnLiKy0AmP57+LXWS3aaVZ+yGo/upzR0OFyteMrQ2BIIF9w7/7J0tddJaWikvn7UH3fbCh3LQ2+4/7I37dQwEiB0ceXgyScP7nVrjdoefSgawg3WbQplPGheyJhLHkoChbcYJcvoESfOZ0QcBbBEKwpsocl5BIf2I3f/tULF600UK/GgMltjsF5702NaAeMMHzRXCgUWAiDg2c5VprUpqsTpb94zyt7NjCTD6sq/l+KRfs1nGCpoksJO4FrjJubXz4RedSFp4wV
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(346002)(136003)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(2906002)(82310400005)(8936002)(54906003)(16576012)(110136005)(40480700001)(8676002)(36756003)(41300700001)(40460700003)(336012)(426003)(44832011)(36860700001)(5660300002)(478600001)(31696002)(70206006)(70586007)(186003)(86362001)(53546011)(26005)(4326008)(316002)(31686004)(47076005)(81166007)(2616005)(83380400001)(82740400003)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 07:08:55.9662
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 5a10ac97-75ee-43a1-6fbf-08db7b945da9
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT053.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB7749

Hi Ayan

On 2023/7/1 00:17, Ayan Kumar Halder wrote:
> 
> On 26/06/2023 04:34, Penny Zheng wrote:
>> CAUTION: This message has originated from an External Source. Please 
>> use proper judgment and caution when opening attachments, clicking 
>> links, or responding to this email.
>>
>>
>> This commit expands xen_mpumap_update/xen_mpumap_update_entry to include
>> destroying an existing entry.
>>
>> We define a new helper "control_xen_mpumap_region_from_index" to 
>> enable/disable
>> the MPU region based on index. If region is within [0, 31], we could 
>> quickly
>> disable the MPU region through PRENR_EL2 which provides direct access 
>> to the
>> PRLAR_EL2.EN bits of EL2 MPU regions.
>>
>> Rignt now, we only support destroying a *WHOLE* MPU memory region,
>> part-region removing is not supported, as in worst case, it will
>> leave two fragments behind.
>>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> ---
>> v3:
>> - make pr_get_base()/pr_get_limit() static inline
>> - need an isb to ensure register write visible before zeroing the entry
>> ---
>> Â  xen/arch/arm/include/asm/arm64/mpu.hÂ Â Â Â  |Â  2 +
>> Â  xen/arch/arm/include/asm/arm64/sysregs.h |Â  3 +
>> Â  xen/arch/arm/mm.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  5 ++
>> Â  xen/arch/arm/mpu/mm.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  | 74 ++++++++++++++++++++++++
>> Â  4 files changed, 84 insertions(+)
>>
>> diff --git a/xen/arch/arm/include/asm/arm64/mpu.h 
>> b/xen/arch/arm/include/asm/arm64/mpu.h
>> index 715ea69884..aee7947223 100644
>> --- a/xen/arch/arm/include/asm/arm64/mpu.h
>> +++ b/xen/arch/arm/include/asm/arm64/mpu.h
>> @@ -25,6 +25,8 @@
>> Â  #define REGION_UART_SELÂ Â Â Â Â Â Â Â Â Â Â  0x07
>> Â  #define MPUIR_REGION_MASKÂ Â Â Â Â Â Â Â Â  ((_AC(1, UL) << 8) - 1)
>>
>> +#define MPU_PRENR_BITSÂ Â Â Â Â Â Â Â Â Â Â Â  32
> 
> This is common to R52 and R82.
> 
> Thus, you can put it in the common file (may be 
> xen/arch/arm/include/asm/mpu/mm.h)
> 

Will do.

>> +
>> Â  /* Access permission attributes. */
>> Â  /* Read/Write at EL2, No Access at EL1/EL0. */
>> Â  #define AP_RW_EL2 0x0
>> diff --git a/xen/arch/arm/include/asm/arm64/sysregs.h 
>> b/xen/arch/arm/include/asm/arm64/sysregs.h
>> index c8a679afdd..96c025053b 100644
>> --- a/xen/arch/arm/include/asm/arm64/sysregs.h
>> +++ b/xen/arch/arm/include/asm/arm64/sysregs.h
>> @@ -509,6 +509,9 @@
>> Â  /* MPU Type registers encode */
>> Â  #define MPUIR_EL2Â Â  S3_4_C0_C0_4
>>
>> +/* MPU Protection Region Enable Register encode */
>> +#define PRENR_EL2Â Â  S3_4_C6_C1_1
>> +
>> Â  #endif
>>
>> Â  /* Access to system registers */
>> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
>> index 8625066256..247d17cfa1 100644
>> --- a/xen/arch/arm/mm.c
>> +++ b/xen/arch/arm/mm.c
>> @@ -164,7 +164,12 @@ int destroy_xen_mappings(unsigned long s, 
>> unsigned long e)
>> Â Â Â Â Â  ASSERT(IS_ALIGNED(s, PAGE_SIZE));
>> Â Â Â Â Â  ASSERT(IS_ALIGNED(e, PAGE_SIZE));
>> Â Â Â Â Â  ASSERT(s <= e);
>> +#ifndef CONFIG_HAS_MPU
>> Â Â Â Â Â  return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, 0);
>> +#else
>> +Â Â Â  return xen_mpumap_update(virt_to_maddr((void *)s),
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  virt_to_maddr((void *)e), 0);
>> +#endif
>> Â  }
> 
> Refer my comment in previous patch.
> 
> You can have two implementations of this function 1) 
> xen/arch/arm/mmu/mm.c 2) xen/arch/arm/mpu/mm.h
> 

Refer my comment in previous patch.

I prefer #ifdef in destroy_xen_mappings()

>>
>> Â  int modify_xen_mappings(unsigned long s, unsigned long e, unsigned 
>> int flags)
>> diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
>> index 0a65b58dc4..a40055ae5e 100644
>> --- a/xen/arch/arm/mpu/mm.c
>> +++ b/xen/arch/arm/mpu/mm.c
>> @@ -425,6 +425,59 @@ static int mpumap_contain_region(pr_t *table, 
>> uint8_t nr_regions,
>> Â Â Â Â Â  return MPUMAP_REGION_FAILED;
>> Â  }
>>
>> +/* Disable or enable EL2 MPU memory region at index #index */
>> +static void control_mpu_region_from_index(uint8_t index, bool enable)
>> +{
>> +Â Â Â  pr_t region;
>> +
>> +Â Â Â  read_protection_region(&region, index);
>> +Â Â Â  if ( !region_is_valid(&region) ^ enable )
>> +Â Â Â  {
>> +Â Â Â Â Â Â Â  printk(XENLOG_WARNING
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â  "mpu: MPU memory region[%u] is already %s\n", index,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â  enable ? "enabled" : "disabled");
>> +Â Â Â Â Â Â Â  return;
>> +Â Â Â  }
>> +
>> +Â Â Â  /*
>> +Â Â Â Â  * ARM64v8R provides PRENR_EL2 to have direct access to the
>> +Â Â Â Â  * PRLAR_EL2.EN bits of EL2 MPU regions from 0 to 31.
>> +Â Â Â Â  */
>> +Â Â Â  if ( index < MPU_PRENR_BITS )
>> +Â Â Â  {
>> +Â Â Â Â Â Â Â  uint64_t orig, after;
>> +
>> +Â Â Â Â Â Â Â  orig = READ_SYSREG(PRENR_EL2);
>> +Â Â Â Â Â Â Â  if ( enable )
>> +Â Â Â Â Â Â Â Â Â Â Â  /* Set respective bit */
>> +Â Â Â Â Â Â Â Â Â Â Â  after = orig | (1UL << index);
>> +Â Â Â Â Â Â Â  else
>> +Â Â Â Â Â Â Â Â Â Â Â  /* Clear respective bit */
>> +Â Â Â Â Â Â Â Â Â Â Â  after = orig & (~(1UL << index));
>> +Â Â Â Â Â Â Â  WRITE_SYSREG(after, PRENR_EL2);
>> +Â Â Â  }
>> +Â Â Â  else
>> +Â Â Â  {
>> +Â Â Â Â Â Â Â  region.prlar.reg.en = enable ? 1 : 0;
>> +Â Â Â Â Â Â Â  write_protection_region((const pr_t*)&region, index);
>> +Â Â Â  }
>> +Â Â Â  /* Ensure the write before zeroing the entry */
> dsb(); /* to ensure write completes */
>> +Â Â Â  isb();
>> +
>> +Â Â Â  /* Update according bitfield in xen_mpumap_mask */
>> +Â Â Â  spin_lock(&xen_mpumap_alloc_lock);
>> +
>> +Â Â Â  if ( enable )
>> +Â Â Â Â Â Â Â  set_bit(index, xen_mpumap_mask);
>> +Â Â Â  else
>> +Â Â Â  {
>> +Â Â Â Â Â Â Â  clear_bit(index, xen_mpumap_mask);
>> +Â Â Â Â Â Â Â  memset(&xen_mpumap[index], 0, sizeof(pr_t));
>> +Â Â Â  }
>> +
>> +Â Â Â  spin_unlock(&xen_mpumap_alloc_lock);
>> +}
>> +
>> Â  /*
>> Â Â  * Update an entry in Xen MPU memory region mapping 
>> table(xen_mpumap) at
>> Â Â  * the index @idx.
>> @@ -461,6 +514,27 @@ static int xen_mpumap_update_entry(paddr_t base, 
>> paddr_t limit,
>>
>> Â Â Â Â Â Â Â Â Â  write_protection_region((const pr_t*)(&xen_mpumap[idx]), idx);
>> Â Â Â Â Â  }
>> +Â Â Â  else
>> +Â Â Â  {
>> +Â Â Â Â Â Â Â  /*
>> +Â Â Â Â Â Â Â Â  * Currently, we only support destroying a *WHOLE* MPU memory 
>> region,
>> +Â Â Â Â Â Â Â Â  * part-region removing is not supported, as in worst case, 
>> it will
>> +Â Â Â Â Â Â Â Â  * leave two fragments behind.
>> +Â Â Â Â Â Â Â Â  * part-region removing will be introduced only when actual 
>> usage
>> +Â Â Â Â Â Â Â Â  * comes.
>> +Â Â Â Â Â Â Â Â  */
>> +Â Â Â Â Â Â Â  if ( rc == MPUMAP_REGION_INCLUSIVE )
>> +Â Â Â Â Â Â Â  {
>> +Â Â Â Â Â Â Â Â Â Â Â  region_printk("mpu: part-region removing is not 
>> supported\n");
>> +Â Â Â Â Â Â Â Â Â Â Â  return -EINVAL;
>> +Â Â Â Â Â Â Â  }
>> +
>> +Â Â Â Â Â Â Â  /* We are removing the region */
>> +Â Â Â Â Â Â Â  if ( rc != MPUMAP_REGION_FOUND )
>> +Â Â Â Â Â Â Â Â Â Â Â  return -EINVAL;
>> +
>> +Â Â Â Â Â Â Â  control_mpu_region_from_index(idx, false);
>> +Â Â Â  }
>>
>> Â Â Â Â Â  return 0;
>> Â  }
>> -- 
>> 2.25.1
>>
>>
> - Ayan


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 08:16:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 08:16:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558031.871795 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGEjA-0005rB-B2; Mon, 03 Jul 2023 08:16:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558031.871795; Mon, 03 Jul 2023 08:16:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGEjA-0005r4-8M; Mon, 03 Jul 2023 08:16:08 +0000
Received: by outflank-mailman (input) for mailman id 558031;
 Mon, 03 Jul 2023 08:16:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/H7X=CV=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qGEj8-0005qw-TK
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 08:16:07 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20625.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::625])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id da408494-1979-11ee-b237-6b7b168915f2;
 Mon, 03 Jul 2023 10:16:04 +0200 (CEST)
Received: from AS9PR05CA0245.eurprd05.prod.outlook.com (2603:10a6:20b:493::22)
 by PAVPR08MB8941.eurprd08.prod.outlook.com (2603:10a6:102:328::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul
 2023 08:16:00 +0000
Received: from AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:493:cafe::b1) by AS9PR05CA0245.outlook.office365.com
 (2603:10a6:20b:493::22) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.30 via Frontend
 Transport; Mon, 3 Jul 2023 08:15:59 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT022.mail.protection.outlook.com (100.127.140.217) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.17 via Frontend Transport; Mon, 3 Jul 2023 08:15:59 +0000
Received: ("Tessian outbound c08fa2e31830:v142");
 Mon, 03 Jul 2023 08:15:58 +0000
Received: from 7315607ad8e1.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 8863286A-F5D9-49AE-8CDD-1C1AF73EC2BC.1; 
 Mon, 03 Jul 2023 08:15:52 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 7315607ad8e1.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Mon, 03 Jul 2023 08:15:52 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by PA4PR08MB5981.eurprd08.prod.outlook.com (2603:10a6:102:e2::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul
 2023 08:15:48 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::ed0b:5730:a1f9:577b]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::ed0b:5730:a1f9:577b%5]) with mapi id 15.20.6544.024; Mon, 3 Jul 2023
 08:15:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: da408494-1979-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OQGw7rf6uFTnPj1oTS9nWq0sXkAP5wIfN0+eV5YWRJc=;
 b=m91PnriyNBTQiPg1sDRsBh4A3Iza0uyfo076aq6HcniInd6X1J+lr4q8V3NVsWzO1U8Txq5brEEwDgQ7F9r4gAGCypXyJMx48Uba7AO+ioCT4jdWinuWPMODgYB6De0Gmc1GPOZ7N1ynTVoNX16EYXr3ty++GIjUPcaZtjf1e2s=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 1dee57a5134de968
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=iHkog/xOZi7+D7XW0uFg3V0ooJvBWVY+hW+reHS6t5O0Q3BaxLvVNB3i0ZUNn8TLnkIae4HGFXIcS14AtYxgnvaOa7819sD88jPlvYYPMhs+JS9q7mhBiwTFNWN3n4Kvxa7JFp0lZZx9rqQ4h+i1GW11y0qWUq5Hbeq+FkDusifQeiqdMVfq28RkZL4/JkIY/127wwQu72s/4yXS5PvMju3ovle0dIweDQ/dT+s3Udjwz2/U1O6PO0a+RH3K1JSQP2AuA/uaKkUU5sBU6m/VsNPLBWZ2xcoa1b7cKmOY/Qr5lUae+EckQnV9K23WTdrePGnT8PGPcYoUtoneH6Te5w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OQGw7rf6uFTnPj1oTS9nWq0sXkAP5wIfN0+eV5YWRJc=;
 b=QKft5aUhpq3NuO6DIZBv8UjEBqOPjdmYCxk0n1LZUfmmtaz+xQVEV6X6i02z2LYlHNQUNq6PWzluItPKJEy107zXNE5/bRxQuwK5kZdQAVVcBizO9J+TDFPG+gHt/R0BLvMSd46jjoXxLq2PVv4uK3k7N9WsqEo1+JaEod1u7wRfLufQSuSh66nGit2MNanmoIuy3j6/TLJs8uINnjfTlpT+XsLREjWNP+UltAthmlmF1HOAF86Dg+H5dHn5WD5yh0Is9kTg99i0HnLWPlAilWPPkyuADclZo3aMTIo23FX+h/2791eFIQHE9IcyK0Q9X8VFnrgGLMqj8jrVSjLu2Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OQGw7rf6uFTnPj1oTS9nWq0sXkAP5wIfN0+eV5YWRJc=;
 b=m91PnriyNBTQiPg1sDRsBh4A3Iza0uyfo076aq6HcniInd6X1J+lr4q8V3NVsWzO1U8Txq5brEEwDgQ7F9r4gAGCypXyJMx48Uba7AO+ioCT4jdWinuWPMODgYB6De0Gmc1GPOZ7N1ynTVoNX16EYXr3ty++GIjUPcaZtjf1e2s=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Rich Persaud <persaur@gmail.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>, George Dunlap
	<george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Wei Liu
	<wl@xen.org>, Henry Wang <Henry.Wang@arm.com>, Community Manager
	<community.manager@xenproject.org>, Doug Goldstein <cardoe@cardoe.com>,
	Bertrand Marquis <Bertrand.Marquis@arm.com>, Volodymyr Babchuk
	<volodymyr_babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Christopher Clark <christopher.w.clark@gmail.com>, Daniel Smith
	<dpsmith@apertussolutions.com>, Daniel DeGraaf <dgdegra@tycho.nsa.gov>,
	"openxt@googlegroups.com" <openxt@googlegroups.com>,
	=?utf-8?B?TWFyZWsgTWFyY3p5a293c2tpLUfDs3JlY2tp?=
	<marmarek@invisiblethingslab.com>, =?utf-8?B?UGlvdHIgS3LDs2w=?=
	<piotr.krol@3mdeb.com>
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
Thread-Topic: [RFC PATCH] xen/arm: Rebranding dom0less feature
Thread-Index: AQHZqzMUKP6yBnvUfEC1egkdxmuozK+koJSAgAMWHYA=
Date: Mon, 3 Jul 2023 08:15:48 +0000
Message-ID: <BA3F1695-F893-46A9-9159-F0A98EAC05D8@arm.com>
References: <20230630091210.3742121-1-luca.fancellu@arm.com>
 <B954806C-5D31-483C-964B-17F1EFDB20BD@gmail.com>
In-Reply-To: <B954806C-5D31-483C-964B-17F1EFDB20BD@gmail.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|PA4PR08MB5981:EE_|AM7EUR03FT022:EE_|PAVPR08MB8941:EE_
X-MS-Office365-Filtering-Correlation-Id: 4684282c-3199-49ce-5d76-08db7b9dbbaa
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 0rHn1lfTxPV8DQCttSSAGBrzz68luYyOJRi5GDNsWDZfyWJIEbeTEuJzsfx5iJCeN6lQWku3lSk+kkaV5L1wZPYGKlyUOLb+BI1WJCxFYEh0ZbCXI6ArLp01g7bZ5XUj9v7IpW3he7LxqGnXSYsfax2o8g221rphG1q/HWi3U4pat5dAY+WBUTRpvDYlsPTVSukoZPXQA/eP3mQiNyybvuKz5IFetMElkisdpLVOZWhg+6o0ksmVhZhMWAe2a/fUUYB+KiXECtEYNeJMnYqbN9dUPRkgW4/oO43KtaxYomGM+CCsKFt38eT+L15R4jZmm44n8ufU+mjPn+fwUwbwd727R8L1+Xgavq8JWSXejspwqbD4ZBmQi+bKU06dsQGgzHDNkQW8pho/jbskoiDvZlCd8AevnvovL+HwLuPCU+ceLPcU5yeynWy3bmQu/m4gWI4K2gI93iDAqS35crltFhVA3Ej+hjB2/PBxC4fxexg8/i5tMNrLeSbycVVKVmIzsJtsznoTcydMz1AixnBqHy+fjMb9LfPT9O5yXvuO4EryT/bMkwnij7lweDmaz9Y32ER4HMOAwDwA146nj8xeuZzkI8MFtXO99S7MUJPMM22PTQetg0fyTntgXMGaXHzak+tonpZnmekAaQqGfI90beErOE5F4FLa1mNJoi21wMg=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(366004)(376002)(136003)(396003)(451199021)(6512007)(91956017)(6506007)(53546011)(316002)(66556008)(38070700005)(76116006)(66476007)(66446008)(64756008)(6916009)(66946007)(4326008)(38100700002)(122000001)(2616005)(83380400001)(186003)(26005)(478600001)(54906003)(8936002)(8676002)(2906002)(5660300002)(966005)(6486002)(71200400001)(7416002)(86362001)(41300700001)(36756003)(33656002)(32563001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <D7537DE30C3B784EB1F8653824ED0E75@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB5981
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	a329b11b-64cf-4ea1-2c7b-08db7b9db519
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	2zQVZ4kCwcUCUTDoGX/po7b7qYe4VKWey/yQ1C1IiSGfOQuyRbTjVnkaMsf8ZqU+j5lA4sPvP60SWnSbCYlLUoFAXMH+WPe2oQkG4ow0mQSKsZ6XjkfIVF4f/iQOb2rTMADSms42vLktclBXQtxlqkyWGDDxoY5cnzPa94jOm3kzJ5s0q2vxpdYfMkjDG5s6cWkXlFFTGwhbbWk0S92qUTOGhrUEqAstWAhnL3jifsRs+blNVy3lSjfRiVUPRRml10UF6NaQfKvlYNx3NpgzsZJvggd6Ms2V/fWJWUAnrWqmruOLDBo0WfVbuswWiUru7yoHr4JrR4R2nxdE3J187Ppyqon3MrGLOwUHOcdQDbcBEQ+NODeyPqrdhQZIY3vD/xHaeW693KnatTGwUqMlTsziAkOHtB3hfzrW3G1YzonKjVS2FBskPdRD3yZQeYOkC8MI+GFXQQcFd2vUVJdNfuRQE5lAj2lWHXIPnOvlsyGLiTbMimZ/ajD+Ynn+WWq/u4saE3jiNh8mIOLMU8VK6+LtfYTjrLYLNTWC9cvTYVyhz0Rs7b7b6dxSyPcpslL/i+DXvmb7YpOErZiFhP5dirgxKttHNeADk6RYooVO6RCtP66f3zy1j2ryzDPjB4DBhuQ8WiYn5LL9xA3N7NTN5ecgEaLzamnNw4mPOs0L6rKkQ2p47YO8k7e2yVXE+njc1sgRVtUNM2GKM4p/gmBf0JbLLqRqS0DN5r8uT4cCpVNHf7x5RGuCZ5kke/FHzWjq
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(346002)(136003)(376002)(451199021)(46966006)(40470700004)(36840700001)(54906003)(6862004)(26005)(6512007)(966005)(53546011)(186003)(33656002)(8936002)(36756003)(86362001)(8676002)(2906002)(6486002)(5660300002)(41300700001)(40460700003)(478600001)(107886003)(6506007)(81166007)(40480700001)(70586007)(356005)(82740400003)(4326008)(70206006)(47076005)(2616005)(336012)(82310400005)(83380400001)(316002)(36860700001)(32563001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 08:15:59.1018
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 4684282c-3199-49ce-5d76-08db7b9dbbaa
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB8941

DQoNCj4gT24gMSBKdWwgMjAyMywgYXQgMTA6MDcsIFJpY2ggUGVyc2F1ZCA8cGVyc2F1ckBnbWFp
bC5jb20+IHdyb3RlOg0KPiANCj4gSGkgTHVjYSwNCj4gDQo+IE9uIEp1biAzMCwgMjAyMywgYXQg
MDU6MTIsIEx1Y2EgRmFuY2VsbHUgPGx1Y2EuZmFuY2VsbHVAYXJtLmNvbT4gd3JvdGU6DQo+PiAN
Cj4+IA0KPj4gDQo+PiDvu79UaGUgImRvbTBsZXNzIiBmZWF0dXJlIHdhcyBpbnRlbmRlZCB0byBi
ZSB0aGUgZmVhdHVyZSB3aGVyZSBhIGRvbVUNCj4+IGRvbWFpbiBjb3VsZCBiZSBsYXVuY2hlZCB3
aXRob3V0IHRoZSBjb250cm9sIGRvbWFpbiAoRG9tMCkNCj4+IGludGVydmVudGlvbiwgaG93ZXZl
ciB0aGUgbmFtZSBzZWVtcyB0byBzdWdnZXN0IHRoYXQgRG9tMCBjYW5ub3QNCj4+IGJlIHBhcnQg
b2YgdGhlIGNvbmZpZ3VyYXRpb24sIHdoaWxlIGluc3RlYWQgaXQncyBhIHBvc3NpYmxlIHVzZSBj
YXNlLg0KDQpIaSBSaWNoLA0KDQo+IA0KPiBUaGFua3MgZm9yIHlvdXIgaW50ZXJlc3QgaW4gWGVu
IGJvb3QgaW50ZWdyaXR5LiBQbGVhc2Ugc2VlIHRoZSAyMDE4IGRvbUIgUkZDOg0KPiBodHRwczov
L2xpc3RzLnhlbnByb2plY3Qub3JnL2FyY2hpdmVzL2h0bWwveGVuLWRldmVsLzIwMTgtMDYvbXNn
MDEzMDYuaHRtbA0KPiANCj4gQXQgWGVuIFN1bW1pdCAyMDE4IChOYW5qaW5nKSBhbmQgWGVuIFN1
bW1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lIE1MLCBzcGVjaWZpY2FsbHkgdGhl
IG9uZSByZWxhdGVkIHRvIHRoZSBBcm0gc2lkZS4NCg0KQ2hlZXJzLA0KTHVjYQ0KDQo+IA0KPiBS
aWNoDQoNCg0K


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 09:21:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 09:21:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558037.871805 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGFjh-0004qX-2f; Mon, 03 Jul 2023 09:20:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558037.871805; Mon, 03 Jul 2023 09:20:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGFjg-0004qQ-W3; Mon, 03 Jul 2023 09:20:44 +0000
Received: by outflank-mailman (input) for mailman id 558037;
 Mon, 03 Jul 2023 09:20:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGFjf-0004qK-EF
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 09:20:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGFje-0002EW-SM; Mon, 03 Jul 2023 09:20:42 +0000
Received: from [54.239.6.190] (helo=[192.168.12.110])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGFje-0002nT-LZ; Mon, 03 Jul 2023 09:20:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=bI6eNNRIQh8mHy+gr8uKo01TWCKhmqAEWoqtPPEdrhc=; b=Xx4cduB1J3GBhibYHLIxDFyGrJ
	mVUWdIQ6KcqfmSddwCO95lOzaDt9j1TuGj+A2BVRF2h3vhkJtMQNrIJAXtCw/npjRt8EtG3UxWqMC
	v4EHVGZckjCb40VPk/oYrsfY5j5OQ8NlnXGhu9tsVFcLc/vxbwoyQPjB/NtQFxfg3k3Y=;
Message-ID: <93e0e360-d7f2-1987-a0a6-73420c55afcd@xen.org>
Date: Mon, 3 Jul 2023 10:20:40 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 31/52] xen/mpu: make early_fdt_map support in MPU
 systems
Content-Language: en-US
To: Penny Zheng <penny.zheng@arm.com>, Ayan Kumar Halder <ayankuma@amd.com>,
 xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>, Wei Chen <wei.chen@arm.com>,
 "Volodymyr_Babchuk@epam.com" <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-32-Penny.Zheng@arm.com>
 <c2a779e5-51a9-f0c8-4c00-a568ff4bde83@amd.com>
 <a381b1b0-d18a-8fea-56a4-d88c65bd3cea@arm.com>
 <9530f9f8-795b-783a-bc74-e30a3c5c2fd3@amd.com>
 <baed1eac-0f9a-a85a-d4cc-feef772870db@xen.org>
 <c070054d-3f92-ecd2-4f04-a97c5a84d3d7@amd.com>
 <c05ac82d-f9bb-5d52-8b7d-df44d9043a66@xen.org>
 <bd6d9646-f0a8-5341-b4ce-7eca1d6153dc@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <bd6d9646-f0a8-5341-b4ce-7eca1d6153dc@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 03/07/2023 06:12, Penny Zheng wrote:
> Hi,
> 
> 
> On 2023/6/30 23:02, Julien Grall wrote:
>> Hi,
>>
>> On 30/06/2023 15:42, Ayan Kumar Halder wrote:
>>> Hi Julien,
>>>
>>> On 30/06/2023 12:22, Julien Grall wrote:
>>>>
>>>>
>>>> On 30/06/2023 11:49, Ayan Kumar Halder wrote:
>>>>>
>>>>> On 30/06/2023 05:07, Penny Zheng wrote:
>>>>>> Hi,
>>>>> Hi Penny,
>>>>>>
>>>>>>
>>>>>> On 2023/6/30 01:22, Ayan Kumar Halder wrote:
>>>>>>>
>>>>>>> On 26/06/2023 04:34, Penny Zheng wrote:
>>>>>>>> CAUTION: This message has originated from an External Source. 
>>>>>>>> Please use proper judgment and caution when opening attachments, 
>>>>>>>> clicking links, or responding to this email.
>>>>>>>>
>>>>>>>>
>>>>>>>> In MPU system, MPU memory region is always mapped PAGE_ALIGN, so 
>>>>>>>> in order to
>>>>>>>> not access unexpected memory area, dtb section in xen.lds.S 
>>>>>>>> should be made
>>>>>>>> page-aligned too.
>>>>>>>> We add . = ALIGN(PAGE_SIZE); in the head of dtb section to make 
>>>>>>>> it happen.
>>>>>>>>
>>>>>>>> In this commit, we map early FDT with a transient MPU memory 
>>>>>>>> region, as
>>>>>>>> it will be relocated into heap and unmapped at the end of boot.
>>>>>>>>
>>>>>>>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>>>>>>>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>>>>>>>> ---
>>>>>>>> v3:
>>>>>>>> - map the first 2MB. Check the size and then re-map with an 
>>>>>>>> extra 2MB if needed
>>>>>>>> ---
>>>>>>>> Â  xen/arch/arm/include/asm/arm64/mpu.h |Â  3 ++-
>>>>>>>> Â  xen/arch/arm/include/asm/page.hÂ Â Â Â Â  |Â  5 +++++
>>>>>>>> Â  xen/arch/arm/mm.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  | 26 
>>>>>>>> ++++++++++++++++++++------
>>>>>>>> Â  xen/arch/arm/mpu/mm.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  1 +
>>>>>>>> Â  xen/arch/arm/xen.lds.SÂ Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  5 ++++-
>>>>>>>> Â  5 files changed, 32 insertions(+), 8 deletions(-)
>>>>>>>>
>>>>>>>> diff --git a/xen/arch/arm/include/asm/arm64/mpu.h 
>>>>>>>> b/xen/arch/arm/include/asm/arm64/mpu.h
>>>>>>>> index a6b07bab02..715ea69884 100644
>>>>>>>> --- a/xen/arch/arm/include/asm/arm64/mpu.h
>>>>>>>> +++ b/xen/arch/arm/include/asm/arm64/mpu.h
>>>>>>>> @@ -72,7 +72,8 @@ typedef union {
>>>>>>>> Â Â Â Â Â Â Â Â Â  unsigned long ns:1;Â Â Â Â  /* Not-Secure */
>>>>>>>> Â Â Â Â Â Â Â Â Â  unsigned long res:1;Â Â Â  /* Reserved 0 by hardware */
>>>>>>>> Â Â Â Â Â Â Â Â Â  unsigned long limit:42; /* Limit Address */
>>>>>>>> -Â Â Â Â Â Â Â  unsigned long pad:16;
>>>>>>>> +Â Â Â Â Â Â Â  unsigned long pad:15;
>>>>>>>> +Â Â Â Â Â Â Â  unsigned long tran:1;Â Â  /* Transient region */
>>>>>>>> Â Â Â Â Â  } reg;
>>>>>>>> Â Â Â Â Â  uint64_t bits;
>>>>>>>> Â  } prlar_t;
>>>>>>>> diff --git a/xen/arch/arm/include/asm/page.h 
>>>>>>>> b/xen/arch/arm/include/asm/page.h
>>>>>>>> index 85ecd5e4de..a434e2205a 100644
>>>>>>>> --- a/xen/arch/arm/include/asm/page.h
>>>>>>>> +++ b/xen/arch/arm/include/asm/page.h
>>>>>>>> @@ -97,19 +97,24 @@
>>>>>>>> Â Â  * [3:4] Execute Never
>>>>>>>> Â Â  * [5:6] Access Permission
>>>>>>>> Â Â  * [7]Â Â  Region Present
>>>>>>>> + * [8]Â Â  Transient Region, e.g. MPU memory region is temproraily
>>>>>>>> + *Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  mapped for a short time
>>>>>>>> Â Â  */
>>>>>>>> Â  #define _PAGE_AI_BITÂ Â Â Â Â Â Â Â Â Â Â  0
>>>>>>>> Â  #define _PAGE_XN_BITÂ Â Â Â Â Â Â Â Â Â Â  3
>>>>>>>> Â  #define _PAGE_AP_BITÂ Â Â Â Â Â Â Â Â Â Â  5
>>>>>>>> Â  #define _PAGE_PRESENT_BITÂ Â Â Â Â Â  7
>>>>>>>> +#define _PAGE_TRANSIENT_BITÂ Â Â Â  8
>>>>>>> I don't think this is related to MPU. At least when I look at the 
>>>>>>> bit representation of PRBAR_EL1/2,
>>>>>>
>>>>>> This set of _PAGE_xxx flags aren't compliant with PRBAR_EL1/2 
>>>>>> register map.
>>>>>> It is a flag passed to function map_pages_to_xen() to indicate memory
>>>>>> attributes and permission.
>>>>>
>>>>> But aren't you writing these flags to PRBAR_EL1/EL2 when you call 
>>>>> xen_mpumap_update_entry().
>>>>>
>>>>> In the below snippet of xen_mpumap_update_entry(), IIUC, you are 
>>>>> writing these flags.
>>>>>
>>>>> Â Â Â Â Â Â Â Â  xen_mpumap[idx].prbar.reg.ap = PAGE_AP_MASK(flags);
>>>>> Â Â Â Â Â Â Â Â  xen_mpumap[idx].prbar.reg.xn = PAGE_XN_MASK(flags);
>>>>>
>>>>> Â Â Â Â Â Â Â Â  write_protection_region((const pr_t*)(&xen_mpumap[idx]), 
>>>>> idx);
>>>>>
>>>>> Please clarify here.
>>>>>
>>>>> In this case, I don't prefer mixing hardware specific bits with 
>>>>> software only representation for these reasons :-
>>>>>
>>>>> 1. It makes it confusing and hard to differentiate the hardware 
>>>>> specific attrbutes from software only.
>>>>
>>>> Penny's approach matches what we are doing in the MMU code. We want 
>>>> to have a way for the caller to pass just set of flags and let the 
>>>> callee to decide what to do with them.
>>>>
>>>> This may be flags converted for HW fields or just used by the logic.
>>>>
>>>> If you disagree with this approach, then can you propose a different 
>>>> way that we can discuss?
> 
> Thanks ayan for pointing out that RES0 is not suitable for storing 
> software-only flags, agreed.
> 
> Then, maybe we should refine the existing "struct pr_t" to store these
> sw bits, like:
> ```
> typedef union {
>  Â Â Â  struct {
>  Â Â Â Â Â Â  uint8_t tran:1; /* Transient region */
>  Â Â Â Â Â Â  uint8_t p2m_type:4; /* Used to store p2m types.*/

Why do you need the p2m_type?

>  Â Â Â  };
>  Â Â Â  uint8_t bits;
> } pr_flags;
> 
> /* MPU Protection Region */
> typedef struct {
>  Â Â Â Â Â Â Â  prbar_t prbar;
>  Â Â Â Â Â Â Â  prlar_t prlar;
>  Â Â Â Â pr_flags flags;
> } pr_t;
> ```
> The drawback is that, considering the padding, "struct pr_t" expands 
> from 16 bytes to 24 bytes.

For clarifications, pr_t is going to be used to create an array in Xen, 
right? If so, what's the expected size of the array?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 09:28:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 09:28:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558041.871815 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGFrV-0005TM-RC; Mon, 03 Jul 2023 09:28:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558041.871815; Mon, 03 Jul 2023 09:28:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGFrV-0005TF-Oe; Mon, 03 Jul 2023 09:28:49 +0000
Received: by outflank-mailman (input) for mailman id 558041;
 Mon, 03 Jul 2023 09:28:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=G/7H=CV=citrix.com=prvs=5416de508=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qGFrU-0005T9-1a
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 09:28:48 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 007227dc-1984-11ee-b237-6b7b168915f2;
 Mon, 03 Jul 2023 11:28:44 +0200 (CEST)
Received: from mail-mw2nam04lp2171.outbound.protection.outlook.com (HELO
 NAM04-MW2-obe.outbound.protection.outlook.com) ([104.47.73.171])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 03 Jul 2023 05:28:41 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SN7PR03MB7257.namprd03.prod.outlook.com (2603:10b6:806:2ee::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul
 2023 09:28:38 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902%7]) with mapi id 15.20.6544.024; Mon, 3 Jul 2023
 09:28:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 007227dc-1984-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688376524;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=yXG4lmvoiM4rScTtfKniDJqcjh7RsCVbVHYcfuBUC04=;
  b=bDRTKFaJz60DuaoZgjXXUNanzhYr/oo0Ad325W3dMTQ8jf0uh0eZ8Ecn
   sIRZaa660y6ndPB+Bm3gN8vL8fCxyuDPixRgReUIFMHg20I2mhj5jcoz7
   baGWOiG6lhYwpNzr9jyAbPc3LHPpJhHsgjrsW5hyyoo103tgSVLIpK8dy
   4=;
X-IronPort-RemoteIP: 104.47.73.171
X-IronPort-MID: 114852342
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:jI79Mq67sAi+C6c+5ZcJywxRtPbGchMFZxGqfqrLsTDasY5as4F+v
 mZMCmuHb67fMW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vZ3OVrjRy6d08aa8yqb0N1JNQq97Xw5fTbiQdtPW9f1DWz
X-Talos-CUID: 9a23:xDZ9Em6b4dCwhFkXUNss1EstOP19WCbk62aBEk60JjZEdIe8YArF
X-Talos-MUID: =?us-ascii?q?9a23=3AbsQ6pQ7NFoLZmQyKsom0SPUExow5u7mwIkQvq68?=
 =?us-ascii?q?h4eeCby91Cyqhr3e4F9o=3D?=
X-IronPort-AV: E=Sophos;i="6.01,177,1684814400"; 
   d="scan'208";a="114852342"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=eFlFbuCbvjBD2ywW/gITMlAZkKXM7/mip5Z6R4k3w98CaKaRcq9im5J/3xEGn1HAZdH8F4WSnbNhfhMkM6PDvR46csewyylpFMoA5RxSXyyKgZlcFNyfHekb2siDL1seKqdzDZykikw6RcroRmz1Ii0yLIW5/a5xclSWmB7R/MfbtEbxlXZYLBR0L3Cv+J5RasNmWRYJMUYsUZz4bs6YxvvdtUOgF1VDsIyw0/g7Ew//peiu6LY9mZy0UdjMAdnD5dtNJZQDicnbkVlCekJO0K+W7UhxREXOaNPlG3Ty+gxwjJSE+A1gwLHO0vwPgDlE6bla6a8cHrfEraBeGIXtVA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=CLP1TraNndqjN77FTbv4iykyD/Gr/u0nmg9JO9jv7ac=;
 b=jihuNKG2+0eELS5HZK6v1k4A3wPZGmrTRaMfcYv1F5m6E0aE+pK0wA0C8SeOuL2wNKctEJv/I3l1kdcKUoS8m0fp35cXO03CVbCsiYtlkVArxs26byFzkuwabvIvTd4OSbuM7ZCPHXIkD0r993UuNGsLD/kzKGOo3uuwI8nDAe4zMGOKjTp+Q4COMpEZUmAkiwJpDiMgBTZmofFtWO9qsJ4Zpb/IkVdFhIrTMYAnC3ZuhmJMPvBA2YCP6/Jo57l3GWVrH7AeTrHPmE7OJjfpwCj5SBVze0fmfZx1MpnWuysIiCrEQK9Ya/3N08zv+ZUSNfnimXtd1nghDHi8GLRSxQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=CLP1TraNndqjN77FTbv4iykyD/Gr/u0nmg9JO9jv7ac=;
 b=iAeUVVLBlKTVENMEMpVVhZcHvUlG43kTS0AG9WPssu8QdrmKcMs8eCM8eeN2YenKwXXoywhFU5ve3zYpDGzNQfhXqZc62AaX27groxOgJnZJ6bg/MSpUYouaT5a7o6oZTWExa7Yvf2egRaQpqDrjCKHKsNUaBUFs0janqYXYOHs=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Mon, 3 Jul 2023 11:28:31 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org, Jan Beulich <jbeulich@suse.com>,
	Wei Liu <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v2] amd: disable C6 after 1000 days on Zen2
Message-ID: <ZKKUvxZdK8RuEDdx@MacBook-Air-de-Roger.local>
References: <20230630131820.29323-1-roger.pau@citrix.com>
 <f77359a0-7c14-7365-bbb9-02d86fc08af2@citrix.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <f77359a0-7c14-7365-bbb9-02d86fc08af2@citrix.com>
X-ClientProxiedBy: LO4P302CA0030.GBRP302.PROD.OUTLOOK.COM
 (2603:10a6:600:2c1::16) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SN7PR03MB7257:EE_
X-MS-Office365-Filtering-Correlation-Id: 26aedba8-6dd3-4721-5972-08db7ba7e1a9
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	slzp9kfDHhWzUExUl31oaPx5WXvwNFYJUZiNknOMO7rKzUE5vFzTDlRe12M9s/NBg/R6nYwqqRYfEJEMYIa5lnBFWGCItNbWsFZnHjy7bPOCVAOFj9BjcayVW+eipDoVVsR3I46QhCjTGRp1VyxDPQL84bJfXCrmB+xI4GZW02kYDuEv7htuZwVfcFJgmRyhu7hh6+BbT1a2i2NwtPicmHTXWGEK3nZb+dpARPDK39StCqEwFAJ+Y53OCExJJcqM2M9qvlZfiZukD0jr4FCQIX917hrXuMplNJk/PYXHJQ6a0cbex3da9DWlc7lzbIYkzXmB2r/TiaifZE9H4UWxv0+XC1CzWvoIBNmBIQhrSfkvA8Jg/UO/1YB5QE3EmEP3OvPK/FWNE87RqE/fjfisgrAyxS1+XjaUrD5f3jcSZ9xhuJYfXa9T7EMpeSE6dLFmT5PKKMTmgUFYVOIJ+h1qNxzn1mzvYWuHh0Diu/xNWfATjCwmSWGHfJU8e2SGOeNCOCxN+0i+XDczUc5gTsjfW5qTYotb7N+SPo0aexK7++renW/6NiTrH4QKE+/ytBSFZMxRE8VewGyk2ZtwGqzI5+KYQYgpsJFCogF5Z4MfAlYxtiXYLVFzyKEv5jaQSjfN
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(366004)(136003)(39860400002)(346002)(451199021)(2906002)(41300700001)(6862004)(5660300002)(8936002)(8676002)(85182001)(86362001)(186003)(82960400001)(478600001)(26005)(6512007)(6506007)(9686003)(6666004)(53546011)(6486002)(316002)(6636002)(4326008)(66476007)(66556008)(66946007)(38100700002)(54906003)(83380400001)(221023011);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZW9BL3lMRmtDeWVwNWp3bnl1WHBWUjVSYVp3SE9uM0dYWVZjSUFoZzVCQlVh?=
 =?utf-8?B?aWFJcC9RVFdtVXYzNXdzMzhpbk5LRk9LRkM1NlZBVkhPbTdPeFE3NUREZVZs?=
 =?utf-8?B?eFN0SVBGWThlUDJnSnMvQ005ZUFnV2RCYjFERklIYmZGODJZb0V2S2FQdmIr?=
 =?utf-8?B?dkl3U3NwN0RYR1FUVlRZUDRjQTdKbTl2VjlSSkF0VkZMTktsb1lYRDBWL1Rn?=
 =?utf-8?B?OE5DR0w2U2VobjJsMVdPS3lxZTQrQUxxUkRiVC9yanNIeVlEYUprODY3UTJB?=
 =?utf-8?B?ZTNhc3RXM2FMdEYxcWhIQXRXM1dJL2JDcnZGalM4SG5Dd3N4MTJ0NUhEVkI5?=
 =?utf-8?B?dmJvNFVrWG1oWjJENHZiclRoNmtqMUlsSGhIK0ZjS1pzTE9vU3hMRXJBZ1JI?=
 =?utf-8?B?YkJtSTJ4QjhDYU84eWJhYVNrcmhER1FTdnRRdDNydmh1dWJQK2g4dzgzZ1J0?=
 =?utf-8?B?NmZ2eUlQWEJ4amxhNkt1U0ZIaUZOd2ZUS2o2ajAyMV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jcKIlY5E5hku8dj4pLa4PT3JUTihGjhpUWEX5nuAriT/td7tdgAYhAIDAkAcVzfr++pXJazpDUEx2M0E4HNdPFPr+I1Q36MiAI+qTnTqszj4fzt1a0urE6NrTKIQQ+kU9Oa+SUmRm2oCoYwMgoCCeiDm2Hh6gSmBu09GqTbS9AAbLUYZM+VFxFBV/kMf1+NPdNwybi0ZRK0t6SM1zwYMXLegXK452SWemqeFoCVF/KZ/aOFMIAKgV3xOCA2fG8Q3PGPiykJWCQQ1992NiRjH0snPxSaiBMpL8Xou4YICkYxJHAxQ+8nPkZYA15iS8QygUI2Ndu7tMLquBprQvJKfPswOrPzlTg9qntZFPAi16pARxL3e6qS1uR24e03X0ycMvYkQjnxxnYPcTDP6iJp9EzUm/r16A4n2T1FSRAg0ubIMt3ljuXS6vW+6uMg1570TLmlWe0z/7vvIpnglyggY8+ksmsb2H/gOt2aLCpTX+fPhjt6xivKphUY5KKsP92cCWW7Pv6cUcVs0xhxBL5PIwU3dP8BgI8QMiQVwBEqYYT9X7IxFG6kEU5Hn6zgDhB7xVLAlXEoP7/h21LU8frqBsJPQqtXwECYvwMkcK8J7s271xkwr6SBH2PfCQzb/QwhfMF4u7hMyv2Q5w8tKS7f5Abw2VCX0+CgOavGexn/ERsnVgmQqKBwMhiXG35/13+q8JcaNOseQBX0LCstRM2kgEcEdMQjZngKk30n24tXpMdVc88OOosCzzuUuROSfjkgPFtmxB7mPpLTUvoqq+JXPT2OMLx0ffyHPQpQHdSvG9CePlw=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 26aedba8-6dd3-4721-5972-08db7ba7e1a9
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 09:28:38.0654
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: HACn/XnNDaIgTuXTNGV3EGjRDNk+fzEOpWjLQroT8NPajQhCkUiEqGFv+KH8ZDfEwYhv00QimcH2x/b0t0YGQg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR03MB7257

On Fri, Jun 30, 2023 at 06:10:10PM +0100, Andrew Cooper wrote:
> On 30/06/2023 2:18 pm, Roger Pau Monne wrote:
> > diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
> > index 0eaef82e5145..bdf45f8387e8 100644
> > --- a/xen/arch/x86/cpu/amd.c
> > +++ b/xen/arch/x86/cpu/amd.c
> > @@ -51,6 +51,8 @@ bool __read_mostly amd_acpi_c1e_quirk;
> >  bool __ro_after_init amd_legacy_ssbd;
> >  bool __initdata amd_virt_spec_ctrl;
> >  
> > +static bool __read_mostly c6_disabled;
> > +
> >  static inline int rdmsr_amd_safe(unsigned int msr, unsigned int *lo,
> >  				 unsigned int *hi)
> >  {
> > @@ -905,6 +907,31 @@ void __init detect_zen2_null_seg_behaviour(void)
> >  
> >  }
> >  
> > +static void cf_check disable_c6(void *arg)
> > +{
> > +	uint64_t val;
> > +
> > +	if (!c6_disabled) {
> > +		printk(XENLOG_WARNING
> > +    "Disabling C6 after 1000 days apparent uptime due to AMD errata 1474\n");
> > +		c6_disabled = true;
> > +		smp_call_function(disable_c6, NULL, 0);
> > +	}
> > +
> > +	/* Update the MSR to disable C6, done on all threads. */
> > +	if (rdmsr_safe(MSR_AMD_CSTATE_CFG, val)) {
> > +error:
> > +		printk_once(XENLOG_ERR
> > +		"Unable to disable C6 on AMD system affected by errata 1474\n"
> > +		"Reboot recommended, otherwise system might hang\n");
> > +		return;
> > +	}
> > +	val &= ~(CSTATE_CFG_CCR0_CC6EN | CSTATE_CFG_CCR1_CC6EN |
> > +	         CSTATE_CFG_CCR2_CC6EN);
> > +	if (wrmsr_safe(MSR_AMD_CSTATE_CFG, val))
> > +		goto error;
> 
> These MSRs don't fault, and we already excluded hypervisors previously,
> so the safe() doesn't really help.Â  The only way you'd spot a failure is
> by reading back and noticing that the update didn't take effect.

I was worried about people explicitly clearing the hypervisor flag in
CPUID and then Xen crashing on boot, so better safe than sorry.  I
don't see much value in crashing here if the MSR is somehow
unavailable.

> Independently, this really really makes me want to dust off my
> msr_{set,clear}_bits() helpers to reduce the boilerplate required for
> logic like this.
> 
> > +}
> > +
> >  static void cf_check init_amd(struct cpuinfo_x86 *c)
> >  {
> >  	u32 l, h;
> > @@ -1171,6 +1198,9 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
> >  	if ((smp_processor_id() == 1) && !cpu_has(c, X86_FEATURE_ITSC))
> >  		disable_c1_ramping();
> >  
> > +	if (c6_disabled)
> > +		disable_c6(NULL);
> > +
> >  	check_syscfg_dram_mod_en();
> >  
> >  	amd_log_freq(c);
> > @@ -1180,3 +1210,43 @@ const struct cpu_dev amd_cpu_dev = {
> >  	.c_early_init	= early_init_amd,
> >  	.c_init		= init_amd,
> >  };
> > +
> > +static int __init cf_check c6_errata_check(void)
> > +{
> > +	/*
> > +	 * Errata #1474: A Core May Hang After About 1044 Days
> > +	 * Set up a timer to disable C6 after 1000 days uptime.
> > +	 */
> > +	s_time_t delta;
> > +
> > +	/*
> > +	 * Apply to all Zen2 models.  According to AMD revision guides at least
> > +	 * Rome, Castle Peak, Renoir, Lucienne and Matisse are affected.
> 
> You probably want to replicate the spectral chicken comment about how
> identifying Zen2 is actually very hard.
> 
> That said, I don't see anything which limits this logic to Fam17h.

Oh, right, will add the missing fam17h check.

> > +	 */
> > +	if (cpu_has_hypervisor || !boot_cpu_has(X86_FEATURE_AMD_STIBP))
> > +		return 0;
> > +
> > +	/*
> > +	 * Deduct current TSC value, this would be relevant if kexec'ed for
> > +	 * example.  Might not be accurate, but worst case we end up disabling
> > +	 * C6 before strictly required, which would still be safe.
> > +	 *
> > +	 * NB: all affected models (Zen2) have invariant TSC and TSC adjust
> > +	 * MSR, so early_time_init() will have already cleared any TSC offset.
> > +	 */
> > +	delta = DAYS(1000) - tsc_ticks2ns(rdtsc());
> > +	if (delta > 0) {
> > +		static struct timer errata_c6;
> > +
> > +		init_timer(&errata_c6, disable_c6, NULL, 0);
> > +		set_timer(&errata_c6, NOW() + delta);
> > +	} else
> > +		disable_c6(NULL);
> 
> I doubt the smp_call_function() is going to be happy at presmp time.

I did take a look and forced it by setting delta = 0,  AFAICT it works
fine, cpu_online_map will be zeroed, so on_selected_cpus() is just a
noop.  Interrupts are enabled by that point, so I don't see a problem
with this approach.

> Do we really care if we're already beyond the timeout?

I would expect that C6 will already be disabled in that case, but I
don't see an issue with Xen also setting those bits.

> > +
> > +	return 0;
> > +}
> > +/*
> > + * Must be executed after early_time_init() for tsc_ticks2ns() to have been
> > + * calibrated.  That prevents us doing the check in init_amd().
> > + */
> > +presmp_initcall(c6_errata_check);
> > diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
> > index 2749e433d2a7..5df090fba791 100644
> > --- a/xen/arch/x86/include/asm/msr-index.h
> > +++ b/xen/arch/x86/include/asm/msr-index.h
> > @@ -211,6 +211,11 @@
> >  
> >  #define MSR_VIRT_SPEC_CTRL                  0xc001011f /* Layout matches MSR_SPEC_CTRL */
> >  
> > +#define MSR_AMD_CSTATE_CFG                  0xc0010296
> > +#define  CSTATE_CFG_CCR0_CC6EN              (_AC(1, ULL) <<  6)
> > +#define  CSTATE_CFG_CCR1_CC6EN              (_AC(1, ULL) << 14)
> > +#define  CSTATE_CFG_CCR2_CC6EN              (_AC(1, ULL) << 22)
> 
> While MSR_AMD_CSTATE_CFG is liable to stay stable, the CC6EN bits are
> uarch specific and not applicable to others.
> 
> I'd suggest keeping them local to c6_errata_check(), which probably
> ought to gain a zen2 somewhere in the name.
> 
> They definitely can't say in a global header with names that don't tie
> them to Zen2 specifically.

That MSR and bit definitions are also available on family 19h model
11h and model 70h (with even more bits added to the MSR), so it feels
weird to name them Zen2 specifically (as it seems AMD is attempting to
keep the current bits stable across families).

I can move the defines to inside the function, but I'm not convinced
those are uarch specific.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 09:31:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 09:31:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558046.871825 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGFu9-0006tC-9T; Mon, 03 Jul 2023 09:31:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558046.871825; Mon, 03 Jul 2023 09:31:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGFu9-0006t5-6S; Mon, 03 Jul 2023 09:31:33 +0000
Received: by outflank-mailman (input) for mailman id 558046;
 Mon, 03 Jul 2023 09:31:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGFu7-0006sz-J0
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 09:31:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGFu7-0002S7-2C; Mon, 03 Jul 2023 09:31:31 +0000
Received: from [54.239.6.190] (helo=[192.168.12.110])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGFu6-0003B2-Rx; Mon, 03 Jul 2023 09:31:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=/J1Ygkk6TXdimnrb8R+3iOtnEaTdzS5kxReB1Rk3SQc=; b=aA90aqdXAMLH7UlIFdqKFTl1JH
	Blb7eQrYadtb5yQ8Qh/5McqFaiwzzkW0XM5rt+pfy7SZ+iB5cqVT/fU+jit5XdJ7uC7OcFFomrTJW
	915nFXiJWhsR3HRfQMxtG7jjrzrLcwjv1dWpn5huEppn/MRy3yZay708gljGScp2oc9Q=;
Message-ID: <15791f2e-b4cf-aa60-3f67-d9e74877e54b@xen.org>
Date: Mon, 3 Jul 2023 10:31:28 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 33/52] xen/mpu: initialize frametable in MPU system
Content-Language: en-US
To: Penny Zheng <penny.zheng@arm.com>, Ayan Kumar Halder <ayankuma@amd.com>,
 xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-34-Penny.Zheng@arm.com>
 <ee709651-a6fc-2485-ae2b-edf0306fbc13@amd.com>
 <db707ef1-cc91-bc7d-33d2-bf804ece2226@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <db707ef1-cc91-bc7d-33d2-bf804ece2226@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 03/07/2023 07:10, Penny Zheng wrote:
> On 2023/6/30 23:19, Ayan Kumar Halder wrote:
>> Hi Penny,
>>
>> On 26/06/2023 04:34, Penny Zheng wrote:
>>> CAUTION: This message has originated from an External Source. Please 
>>> use proper judgment and caution when opening attachments, clicking 
>>> links, or responding to this email.
>>>
>>>
>>> Xen is using page as the smallest granularity for memory managment.
>>> And we want to follow the same concept in MPU system.
>>> That is, structure page_info and the frametable which is used for 
>>> storing
>>> and managing the smallest memory managment unit is also required in 
>>> MPU system.
>>>
>>> In MPU system, since we can not use a fixed VA 
>>> address(FRAMETABLE_VIRT_START)
>>> to map frametable like MMU system does and everything is 1:1 mapping, we
>>> instead define a variable "struct page_info *frame_table" as frametable
>>> pointer, and ask boot allocator to allocate appropriate memory for 
>>> frametable.
>>>
>>> As frametable is successfully initialized, the convertion between 
>>> machine frame
>>> number/machine address/"virtual address" and page-info structure is
>>> ready too, like mfn_to_page/maddr_to_page/virt_to_page, etc
>>>
>>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>>> ---
>>> v3:
>>> - add ASSERT() to confirm the MFN you pass is covered by the frametable.
>>> ---
>>> Â  xen/arch/arm/include/asm/mm.hÂ Â Â Â  | 14 ++++++++++++++
>>> Â  xen/arch/arm/include/asm/mpu/mm.h |Â  3 +++
>>> Â  xen/arch/arm/mpu/mm.cÂ Â Â Â Â Â Â Â Â Â Â Â  | 27 +++++++++++++++++++++++++++
>>> Â  3 files changed, 44 insertions(+)
>>>
>>> diff --git a/xen/arch/arm/include/asm/mm.h 
>>> b/xen/arch/arm/include/asm/mm.h
>>> index daa6329505..66d98b9a29 100644
>>> --- a/xen/arch/arm/include/asm/mm.h
>>> +++ b/xen/arch/arm/include/asm/mm.h
>>> @@ -341,6 +341,19 @@ static inline uint64_t gvirt_to_maddr(vaddr_t 
>>> va, paddr_t *pa,
>>> Â  #define virt_to_mfn(va)Â Â Â Â  __virt_to_mfn(va)
>>> Â  #define mfn_to_virt(mfn)Â Â Â  __mfn_to_virt(mfn)
>>>
>>> +#ifdef CONFIG_HAS_MPU
>>> +/* Convert between virtual address to page-info structure. */
>>> +static inline struct page_info *virt_to_page(const void *v)
>>> +{
>>> +Â Â Â  unsigned long pdx;
>>> +
>>> +Â Â Â  pdx = paddr_to_pdx(virt_to_maddr(v));
>>> +Â Â Â  ASSERT(pdx >= frametable_base_pdx);
>>> +Â Â Â  ASSERT(pdx < frametable_pdx_end);
>>> +
>>> +Â Â Â  return frame_table + pdx - frametable_base_pdx;
>>> +}
>> This should go in xen/arch/arm/include/asm/mpu/mm.h. Then you don't 
>> need ifdef
>>> +#else
>>> Â  /* Convert between Xen-heap virtual addresses and page-info 
>>> structures. */
>>> Â  static inline struct page_info *virt_to_page(const void *v)
>>> Â  {
>>> @@ -354,6 +367,7 @@ static inline struct page_info 
>>> *virt_to_page(const void *v)
>>> Â Â Â Â Â  pdx += mfn_to_pdx(directmap_mfn_start);
>>> Â Â Â Â Â  return frame_table + pdx - frametable_base_pdx;
>>> Â  }
>> Consequently, this should be in xen/arch/arm/include/asm/mmu/mm.h
> 
> The reason why I don't put virt_to_page()/page_to_virt() in specific 
> header is that we are using some helpers, which are defined just
> a few lines before, like mfn_to_virt(), etc.
> If you are moving mfn_to_virt() to specific header too, that will
> result in a lot dulplication.
> 
>>> +#endif
>>>
>>> Â  static inline void *page_to_virt(const struct page_info *pg)
>>> Â  {
>>> diff --git a/xen/arch/arm/include/asm/mpu/mm.h 
>>> b/xen/arch/arm/include/asm/mpu/mm.h
>>> index e26bd4f975..98f6df65b8 100644
>>> --- a/xen/arch/arm/include/asm/mpu/mm.h
>>> +++ b/xen/arch/arm/include/asm/mpu/mm.h
>>> @@ -2,6 +2,9 @@
>>> Â  #ifndef __ARCH_ARM_MM_MPU__
>>> Â  #define __ARCH_ARM_MM_MPU__
>>>
>>> +extern struct page_info *frame_table;
>> If you define frame_table in xen/arch/arm/include/asm/mm.h , then you 
>> don't need the above declaration.
> 
> It is a variable only in MPU. In MMU, it is a fixed value.
> "#define frame_table ((struct page_info *)FRAMETABLE_VIRT_START)"
> 
>>> +extern unsigned long frametable_pdx_end;
>> Also you don't need extern as this is only used by xen/arch/arm/mpu/mm.c.
> 
> sure.
> 
>>> +
>>> Â  extern int xen_mpumap_update(paddr_t base, paddr_t limit, unsigned 
>>> int flags);
>>
>> You don't need extern here as it should be used only in 
>> xen/arch/arm/mpu/mm.c
>>
>> Currently, I see the following in xen/arch/arm/mm.c,
>>
>> int map_pages_to_xen(unsigned long virt,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_t mfn,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned long nr_mfns,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned int flags)
>> {
>> #ifndef CONFIG_HAS_MPU
>> Â Â Â Â  return xen_pt_update(virt, mfn, nr_mfns, flags);
>> #else
>> Â Â Â Â  return xen_mpumap_update(mfn_to_maddr(mfn),
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_to_maddr(mfn_add(mfn, nr_mfns)), 
You are ignoring 'virt' here. Shouldn't you at least check that 'virt == 
mfn_to_maddr(mfn)'?

>> flags);
>> #endif
>> }
>>
>> int destroy_xen_mappings(unsigned long s, unsigned long e)
>> {
>> Â Â Â Â  ASSERT(IS_ALIGNED(s, PAGE_SIZE));
>> Â Â Â Â  ASSERT(IS_ALIGNED(e, PAGE_SIZE));
>> Â Â Â Â  ASSERT(s <= e);
>> #ifndef CONFIG_HAS_MPU
>> Â Â Â Â  return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, 0);
>> #else
>> Â Â Â Â  return xen_mpumap_update(virt_to_maddr((void *)s),
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  virt_to_maddr((void *)e), 0);
>> #endif
>> }
>>
>> int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int 
>> flags)
>> {
>> Â Â Â Â  ASSERT(IS_ALIGNED(s, PAGE_SIZE));
>> Â Â Â Â  ASSERT(IS_ALIGNED(e, PAGE_SIZE));
>> Â Â Â Â  ASSERT(s <= e);
>> #ifndef CONFIG_HAS_MPU
>> Â Â Â Â  return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, flags);
>> #else
>> Â Â Â Â  return xen_mpumap_update(virt_to_maddr((void *)s),
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  virt_to_maddr((void *)e), flags);
>> #endif
>> }
>>
>> It would be better to have 2 implementations for map_pages_to_xen(), 
>> destroy_xen_mappings() and modify_xen_mappings() in 
>> xen/arch/arm/mpu/mm.c and xen/arch/arm/mmu/mm.c.
>>
> 
> I prefer them staying in the common file, using #ifdef to go to the
> different path.
I don't like the #ifdef solution in this situation. You are only doing 
it for the benefits of the ASSERT(). But they don't seem to have any 
value for xen_mpumap_update() (you are still passing an address rather 
than a frame).

> Since if not and when anyone wants to update map_pages_to_xen(), 
> destroy_xen_mappings() and modify_xen_mappings() in the future, it is 
> possible for them to leave changes in only one file.

The helpers are just wrappers. I doubt they will change in the future. 
So I think it would be OK to duplicate.

The alternative would to have a common prototype for xen_pt_update() and 
xen_mpumap_update() and avoid any #ifdery. That said, this is not my 
preference at least if they are not static inline.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 09:35:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 09:35:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558052.871835 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGFxP-0007Wt-Ra; Mon, 03 Jul 2023 09:34:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558052.871835; Mon, 03 Jul 2023 09:34:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGFxP-0007Wm-Oq; Mon, 03 Jul 2023 09:34:55 +0000
Received: by outflank-mailman (input) for mailman id 558052;
 Mon, 03 Jul 2023 09:34:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGFxP-0007Wa-2D; Mon, 03 Jul 2023 09:34:55 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGFxO-0002Vb-Vy; Mon, 03 Jul 2023 09:34:55 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGFxO-00057x-IP; Mon, 03 Jul 2023 09:34:54 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qGFxO-0004cW-Ht; Mon, 03 Jul 2023 09:34:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=PQRB39JTuq/xZRteyC9BizfwWn9FErfVxc3N5VNxU9w=; b=F5CJNPmtjx7Es96Vu2J9x6LsPN
	vzT3lTtwHhg2VVpqlzFw/Q8qOVWi1Px17WqIdQNNq18HMqiULo/NStQRHM/ByT73xIPI/lA/1ZyWx
	xAApEuZ6TF8y32ikudWKmf+3LFE40zhNu4Py/X5umKH1WsRDWT5CJQ9aqvN673bGtC8E=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181683-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181683: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-freebsd10-i386:xen-install:fail:heisenbug
    xen-unstable:test-amd64-i386-livepatch:xen-install:fail:heisenbug
    xen-unstable:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-amd64-i386-libvirt:xen-install:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=f51e5d8eae8ece77a949571f39ee49904f3129aa
X-Osstest-Versions-That:
    xen=f51e5d8eae8ece77a949571f39ee49904f3129aa
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 03 Jul 2023 09:34:54 +0000

flight 181683 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181683/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-freebsd10-i386  7 xen-install    fail in 181678 pass in 181683
 test-amd64-i386-livepatch     7 xen-install      fail in 181678 pass in 181683
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat  fail pass in 181678

Tests which did not succeed, but are not blocking:
 test-amd64-i386-libvirt       7 xen-install         fail in 181678 like 181665
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181678
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181678
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181678
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181678
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181678
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181678
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181678
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181678
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181678
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181678
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181678
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181678
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  f51e5d8eae8ece77a949571f39ee49904f3129aa
baseline version:
 xen                  f51e5d8eae8ece77a949571f39ee49904f3129aa

Last test of basis   181683  2023-07-03 01:52:04 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Mon Jul 03 11:12:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 11:12:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558059.871846 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGHTQ-0000p0-Np; Mon, 03 Jul 2023 11:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558059.871846; Mon, 03 Jul 2023 11:12:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGHTQ-0000ot-KS; Mon, 03 Jul 2023 11:12:04 +0000
Received: by outflank-mailman (input) for mailman id 558059;
 Mon, 03 Jul 2023 11:12:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=j+Cz=CV=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qGHTQ-0000on-6H
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 11:12:04 +0000
Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com
 [2a00:1450:4864:20::12d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6f521574-1992-11ee-b237-6b7b168915f2;
 Mon, 03 Jul 2023 13:12:02 +0200 (CEST)
Received: by mail-lf1-x12d.google.com with SMTP id
 2adb3069b0e04-4f122ff663eso6605566e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 03 Jul 2023 04:12:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6f521574-1992-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1688382721; x=1690974721;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=kYzErPWsWB3rFD0aCATtIB3A7HZS3HS2AIf3vRIPPHU=;
        b=YaHrG+9poWqIVAbsOQlNpvzDzimTGVOf3LGw9wMZsHMJavZVUCfu9hghGvCJLCDsQi
         SMMEVo5i/cuKgiWRz0fP5VYkr+4GDmQWXEkGPoOk/bGa+w+RWUxHsErog7AymnyRG+Tc
         cj/ktu6+Mw5UFCyZyX3eypeMEIGPRj7H9NjX8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688382721; x=1690974721;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=kYzErPWsWB3rFD0aCATtIB3A7HZS3HS2AIf3vRIPPHU=;
        b=fVyPmAhh8Zzj2+pMth28pfFIuQgYkHf1CC9eKetEKShgBtMjpWePge3JojDubxOlMM
         ub2NbV1JgXM45pAv5eLdLY6ZE3ZMkgzQKsDbu4cMhFtyHJBaL4qsD6GWzjoGpoHmEFrh
         tMltOoj3ILgCkoWiYhrhnH2qmeb3AmPO/QAgKDtb2n8H9AQCJv1f9kIdsEViNLEKII/8
         dwy1LsdoEZkJAUea1QaXD87yKdn9AZsQuZdkez6QFdGsPJWRbrD/aX0MsjQx2bhJY/9f
         LL6JAIIWkoEOxECsNuEailJB14+txspZ/XwFlexkFpOQ6MPyafXG+ggrt+VGYToM33fv
         3S3A==
X-Gm-Message-State: ABy/qLbipsktl8iQHb9hW/UZB3yyvmNRWkFgcZsfTs5FQawpj6LOqj/o
	veWiZ1jSSX6cOjMPHfBsgfvNvePYsABGSA+WzDxexA==
X-Google-Smtp-Source: APBJJlFnlgcjfesbo8EDfakDCEAhVckvXZTelqyppGLrbNvWACDOC5sxpfqvTIfIPpi+leRliRuZTJehLFbIZ3OEJQ4=
X-Received: by 2002:a05:6512:693:b0:4f8:7513:8cb0 with SMTP id
 t19-20020a056512069300b004f875138cb0mr7147082lfe.2.1688382721362; Mon, 03 Jul
 2023 04:12:01 -0700 (PDT)
MIME-Version: 1.0
References: <20230630113756.672607-1-george.dunlap@cloud.com> <84197474-9ea0-d42a-b591-13821325cf89@xen.org>
In-Reply-To: <84197474-9ea0-d42a-b591-13821325cf89@xen.org>
From: George Dunlap <george.dunlap@cloud.com>
Date: Mon, 3 Jul 2023 12:11:50 +0100
Message-ID: <CA+zSX=bAL4PbtuzrA1QNSC111xwgJxFSnLZqWXNWEWitreKZJA@mail.gmail.com>
Subject: Re: [PATCH 1/2] credit: Limit load balancing to once per millisecond
To: Julien Grall <julien@xen.org>
Cc: xen-devel@lists.xenproject.org, Dario Faggioli <dfaggioli@suse.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, 
	Jan Beulich <jbeulich@suse.com>, Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
Content-Type: multipart/alternative; boundary="0000000000005a240605ff933c7d"

--0000000000005a240605ff933c7d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, Jun 30, 2023 at 6:49=E2=80=AFPM Julien Grall <julien@xen.org> wrote=
:

> Hi,
>
> The subject stay "1/2" but I don't see any "2/2" nor cover letter. Where
> can I find the rest of the series?
>

I didn't make a cover letter, but the mail archive seems to have both
messages:

https://lists.xenproject.org/archives/html/xen-devel/2023-06/msg02298.html

 -George

--0000000000005a240605ff933c7d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jun 30, 2023 at 6:49=E2=80=AF=
PM Julien Grall &lt;<a href=3D"mailto:julien@xen.org">julien@xen.org</a>&gt=
; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px=
 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
The subject stay &quot;1/2&quot; but I don&#39;t see any &quot;2/2&quot; no=
r cover letter. Where <br>
can I find the rest of the series?<br></blockquote><div><br></div><div>I di=
dn&#39;t make a cover letter, but the mail archive seems to have both messa=
ges:</div><div><br></div><div><a href=3D"https://lists.xenproject.org/archi=
ves/html/xen-devel/2023-06/msg02298.html">https://lists.xenproject.org/arch=
ives/html/xen-devel/2023-06/msg02298.html</a></div><div>=C2=A0</div><div>=
=C2=A0-George</div></div></div>

--0000000000005a240605ff933c7d--


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 11:40:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 11:40:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558063.871856 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGHuU-0003eV-Uc; Mon, 03 Jul 2023 11:40:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558063.871856; Mon, 03 Jul 2023 11:40:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGHuU-0003dn-Qn; Mon, 03 Jul 2023 11:40:02 +0000
Received: by outflank-mailman (input) for mailman id 558063;
 Mon, 03 Jul 2023 11:40:01 +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 <SRS0=j+Cz=CV=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qGHuT-0003Ml-Jz
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 11:40:01 +0000
Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com
 [2a00:1450:4864:20::133])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 56d65f0b-1996-11ee-8611-37d641c3527e;
 Mon, 03 Jul 2023 13:39:58 +0200 (CEST)
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-4f95bf5c493so6460803e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 03 Jul 2023 04:39:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 56d65f0b-1996-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1688384398; x=1690976398;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=TaTthgEGqQq8CQcmAUHWGWYwkOxiznWgrpiEPOH7chE=;
        b=EhDDhJOBpdxVKCGdk4YRvkujlGjbvTUd/WpQk0gmbQlBRDCWp4Pr0Z5bOrOUvkEZa0
         UwwMFf2mrWpjGIu/YIJwAeo3g/zRFqY9sXaNewK+GVhczVInKU9ZH2SKcRDyyR94w0qL
         I4FYUt2jbrI/20eGzaAl9x6P643MqoYRV6Vmg=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688384398; x=1690976398;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=TaTthgEGqQq8CQcmAUHWGWYwkOxiznWgrpiEPOH7chE=;
        b=NLOM+pUKYgYwMYTG/HKLjPi+74dX1M3LfTCYVfHgzpBu9ci7c+wmu6a4KxMoVnMeie
         mHR6lvyrKXSyFBmF3OXfZN38lOAV7Ft2JDukBMHiZ9+DTcJ3u6jmQPgpwLmiZa0dwY2W
         RCLxg018r1pry4w8K9FN62UNJYzGv6movYcCO7unvCycA/3KTOc99moqvDpy0Fg8txZs
         s3KB7ihfm2Q5nUSaBp3eFGRNrtUF5PK2SXxbzwstYtPTtJYPk++InA4vNOonBm36i5PM
         Tf5tjQfwvvnBxwUgOvx7aDJhdKOyMa8gqOc7m3VlKxIV30EpKasO4bFz9Mgplmh4bhei
         PeWQ==
X-Gm-Message-State: ABy/qLZsVdFcNT0yzXtf5h6Ie0TqbitV4lsEaAW4hpE4os+FRLRgPBCX
	yyMaU19GrNtNKjqOqaxKt2uLz9VmuRj5OSh/pCMiCw==
X-Google-Smtp-Source: APBJJlEizCxNim1c+KNIlGWUnM/Ni6hYyaMt0ttcO19uFhl3/fFEiKYrKwDwm3Xsa9B7PZY+L1qyuWg6OSr9zxUcJKo=
X-Received: by 2002:a05:6512:3612:b0:4f8:70f8:d424 with SMTP id
 f18-20020a056512361200b004f870f8d424mr5795647lfs.65.1688384398270; Mon, 03
 Jul 2023 04:39:58 -0700 (PDT)
MIME-Version: 1.0
References: <20230630113756.672607-1-george.dunlap@cloud.com> <42d6cf5e-03ab-a55b-a4d5-54bd063f793d@xen.org>
In-Reply-To: <42d6cf5e-03ab-a55b-a4d5-54bd063f793d@xen.org>
From: George Dunlap <george.dunlap@cloud.com>
Date: Mon, 3 Jul 2023 12:39:47 +0100
Message-ID: <CA+zSX=bVtNBUpEW1rFuXZAh-mPXXmLKEOwE1e3igSo5RdV+qYw@mail.gmail.com>
Subject: Re: [PATCH 1/2] credit: Limit load balancing to once per millisecond
To: Julien Grall <julien@xen.org>
Cc: xen-devel@lists.xenproject.org, Dario Faggioli <dfaggioli@suse.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, 
	Jan Beulich <jbeulich@suse.com>, Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
Content-Type: multipart/alternative; boundary="0000000000004db69f05ff93a0c7"

--0000000000004db69f05ff93a0c7
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, Jun 30, 2023 at 6:48=E2=80=AFPM Julien Grall <julien@xen.org> wrote=
:

> Hi George,
>
> On 30/06/2023 12:37, George Dunlap wrote:
> > The credit scheduler tries as hard as it can to ensure that it always
> > runs scheduling units with positive credit (PRI_TS_UNDER) before
> > running those with negative credit (PRI_TS_OVER).  If the next
> > runnable scheduling unit is of priority OVER, it will always run the
> > load balancer, which will scour the system looking for another
> > scheduling unit of the UNDER priority.
> >
> > Unfortunately, as the number of cores on a system has grown, the cost
> > of the work-stealing algorithm has dramatically increased; a recent
> > trace on a system with 128 cores showed this taking over 50
> > microseconds.
> >
> > Add a parameter, load_balance_ratelimit, to limit the frequency of
> > load balance operations on a given pcpu.  Default this to 1
> > millisecond.
> >
> > Invert the load balancing conditional to make it more clear, and line
> > up more closely with the comment above it.
> >
> > Overall it might be cleaner to have the last_load_balance checking
> > happen inside csched_load_balance(), but that would require either
> > passing both now and spc into the function, or looking them up again;
> > both of which seemed to be worse than simply checking and setting the
> > values before calling it.
> >
> > Without this patch, on a system with a vcpu:pcpu ratio of 2:1, running
> > Windows guests (which will end up calling YIELD during spinlock
> > contention), this patch increased performance significantly.
>
> I don't understand this sentence. Did you intende to write
>
> "Without this patch, ..., the performance are significantly worse"?
>

Hmm, yes this was bad editing.  The first clause was written when I was
expecting to include actual numbers; but when I looked at the internal
numbers I had available, they weren't easy to summarize.  The revised
sentence should have simply been:

"On a system with a vcpu:pcpu ratio of 2:1, running Windows guests (which
will end up calling YIELD during spinlock contention), this patch increased
performance significantly."



> > --- a/docs/misc/xen-command-line.pandoc
> > +++ b/docs/misc/xen-command-line.pandoc
> > @@ -1856,6 +1856,12 @@ By default, Xen will use the INVPCID instruction
> for TLB management if
> >   it is available.  This option can be used to cause Xen to fall back t=
o
> >   older mechanisms, which are generally slower.
> >
> > +### load-balance-ratelimit
> > +> `=3D <integer>`
> > +
> > +The minimum interval between load balancing events on a given pcpu.
> > +At the moment only credit honors this parameter.
>
> I would suggest to mention the default value. So a reader don't have to
> look up in the code to find out.
>
> Also, AFAICT, there is max value. I would mention it here too.
>

Ack


> > +/*
> > + * Minimum delay, in microseconds, between load balance operations.
> > + * This prevents spending too much time doing load balancing,
> particularly
> > + * when the system has a high number of YIELDs due to spinlock priorit=
y
> inversion.
> > + */
> > +static unsigned int __read_mostly load_balance_ratelimit_us =3D
> CSCHED_DEFAULT_LOAD_BALANCE_RATELIMIT_US;
>
> AFAICT, load_balance_ratelimit_us is not updated after boot. So
> shouldn't the attribute be __ro_after_init?
>

Ack


> +#define XEN_SYSCTL_CSCHED_LB_RATE_MAX_US (1000000)
> > +    uint32_t load_balance_ratelimit_us;
>
> Shouldn't this change bump the sysctl interface version?
>

Er, yes.

v2 on its way.

 -George

--0000000000004db69f05ff93a0c7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jun 30, 2023 at 6:48=E2=80=AF=
PM Julien Grall &lt;<a href=3D"mailto:julien@xen.org" target=3D"_blank">jul=
ien@xen.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">Hi George,<br>
<br>
On 30/06/2023 12:37, George Dunlap wrote:<br>
&gt; The credit scheduler tries as hard as it can to ensure that it always<=
br>
&gt; runs scheduling units with positive credit (PRI_TS_UNDER) before<br>
&gt; running those with negative credit (PRI_TS_OVER).=C2=A0 If the next<br=
>
&gt; runnable scheduling unit is of priority OVER, it will always run the<b=
r>
&gt; load balancer, which will scour the system looking for another<br>
&gt; scheduling unit of the UNDER priority.<br>
&gt; <br>
&gt; Unfortunately, as the number of cores on a system has grown, the cost<=
br>
&gt; of the work-stealing algorithm has dramatically increased; a recent<br=
>
&gt; trace on a system with 128 cores showed this taking over 50<br>
&gt; microseconds.<br>
&gt; <br>
&gt; Add a parameter, load_balance_ratelimit, to limit the frequency of<br>
&gt; load balance operations on a given pcpu.=C2=A0 Default this to 1<br>
&gt; millisecond.<br>
&gt; <br>
&gt; Invert the load balancing conditional to make it more clear, and line<=
br>
&gt; up more closely with the comment above it.<br>
&gt; <br>
&gt; Overall it might be cleaner to have the last_load_balance checking<br>
&gt; happen inside csched_load_balance(), but that would require either<br>
&gt; passing both now and spc into the function, or looking them up again;<=
br>
&gt; both of which seemed to be worse than simply checking and setting the<=
br>
&gt; values before calling it.<br>
&gt; <br>
&gt; Without this patch, on a system with a vcpu:pcpu ratio of 2:1, running=
<br>
&gt; Windows guests (which will end up calling YIELD during spinlock<br>
&gt; contention), this patch increased performance significantly.<br>
<br>
I don&#39;t understand this sentence. Did you intende to write<br>
<br>
&quot;Without this patch, ..., the performance are significantly worse&quot=
;?<br></blockquote><div><br></div><div>Hmm, yes this was bad editing.=C2=A0=
 The first clause was written when I was expecting to include actual number=
s; but when I looked at the internal numbers I had available, they weren&#3=
9;t easy to summarize.=C2=A0 The revised sentence should have simply been:<=
/div><div><br></div><div>&quot;On a system with a vcpu:pcpu ratio of 2:1, r=
unning Windows guests (which will end up calling YIELD during spinlock cont=
ention), this patch increased performance significantly.&quot;</div><div><b=
r></div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:=
0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt; --- a/docs/misc/xen-command-line.pandoc<br>
&gt; +++ b/docs/misc/xen-command-line.pandoc<br>
&gt; @@ -1856,6 +1856,12 @@ By default, Xen will use the INVPCID instructio=
n for TLB management if<br>
&gt;=C2=A0 =C2=A0it is available.=C2=A0 This option can be used to cause Xe=
n to fall back to<br>
&gt;=C2=A0 =C2=A0older mechanisms, which are generally slower.<br>
&gt;=C2=A0 =C2=A0<br>
&gt; +### load-balance-ratelimit<br>
&gt; +&gt; `=3D &lt;integer&gt;`<br>
&gt; +<br>
&gt; +The minimum interval between load balancing events on a given pcpu.<b=
r>
&gt; +At the moment only credit honors this parameter.<br>
<br>
I would suggest to mention the default value. So a reader don&#39;t have to=
 <br>
look up in the code to find out.<br>
<br>
Also, AFAICT, there is max value. I would mention it here too.<br></blockqu=
ote><div><br></div><div>Ack</div><div>=C2=A0</div><blockquote class=3D"gmai=
l_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,20=
4,204);padding-left:1ex">
&gt; +/*<br>
&gt; + * Minimum delay, in microseconds, between load balance operations.<b=
r>
&gt; + * This prevents spending too much time doing load balancing, particu=
larly<br>
&gt; + * when the system has a high number of YIELDs due to spinlock priori=
ty inversion.<br>
&gt; + */<br>
&gt; +static unsigned int __read_mostly load_balance_ratelimit_us =3D CSCHE=
D_DEFAULT_LOAD_BALANCE_RATELIMIT_US;<br>
<br>
AFAICT, load_balance_ratelimit_us is not updated after boot. So <br>
shouldn&#39;t the attribute be __ro_after_init?<br></blockquote><div><br></=
div><div>Ack</div><div><br></div><div><br></div><blockquote class=3D"gmail_=
quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,=
204);padding-left:1ex">
&gt; +#define XEN_SYSCTL_CSCHED_LB_RATE_MAX_US (1000000)<br>
&gt; +=C2=A0 =C2=A0 uint32_t load_balance_ratelimit_us;<br>
<br>
Shouldn&#39;t this change bump the sysctl interface version?<br></blockquot=
e><div><br></div><div>Er, yes.</div><div><br></div><div>v2 on its way.</div=
><div><br></div><div>=C2=A0-George</div></div></div>

--0000000000004db69f05ff93a0c7--


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 11:40:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 11:40:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558069.871866 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGHvB-0004li-9K; Mon, 03 Jul 2023 11:40:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558069.871866; Mon, 03 Jul 2023 11:40:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGHvB-0004lb-6X; Mon, 03 Jul 2023 11:40:45 +0000
Received: by outflank-mailman (input) for mailman id 558069;
 Mon, 03 Jul 2023 11:40:43 +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
 <SRS0=fMaW=CV=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1qGHv9-0003Ml-4t
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 11:40:43 +0000
Received: from sender3-of-o59.zoho.com (sender3-of-o59.zoho.com
 [136.143.184.59]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6f5ad728-1996-11ee-8611-37d641c3527e;
 Mon, 03 Jul 2023 13:40:41 +0200 (CEST)
Received: from [10.10.1.94] (static-72-81-132-2.bltmmd.fios.verizon.net
 [72.81.132.2]) by mx.zohomail.com
 with SMTPS id 1688384419951877.2414136011109;
 Mon, 3 Jul 2023 04:40:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6f5ad728-1996-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; t=1688384421; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=cFwMk09dzT0vneG+8ZDsuOP5KlklzW8WBklDCPI9LDe9pmEO0rnzSYoVc898fazVnVeZ+CzJpFLPGg7e0dTKhKkEUTjjYRWesITp1lr+kHQzEQXbx+WHJVYrcESiPJMZJgHDglkxMRXHbx6+c+yeZyG8TTeOdT2OIPN1ftLKYaI=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1688384421; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; 
	bh=DTgl9jwz2fepBYFxfxTiktRfHIC/YIshbjxQzz/ZFwI=; 
	b=W9bHqGrTmPXFERq5RL7GA50MY/wWilHzQadzyqos5hpAeoJKivzzP0pOMrpyKOirvqUqRInEXRd5rEd8p9x64WFy2hrDvZOybIHzuoijC7mU7s2LpPz0I9Ce+mV0+gbTqpbNyRTPwS42GEuCPy9Prnjqx9EqfJ6T0U3EJ4YDTYI=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1688384421;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To;
	bh=DTgl9jwz2fepBYFxfxTiktRfHIC/YIshbjxQzz/ZFwI=;
	b=c/pyy6Jry6KoSOCX2t4w/VsxJRTT5+RPvTt76HB56mg3QyfCCX8Z+ClqJXcBvjuq
	2LPwEnA0g1askOAiNLAyNYqKOMnzeGR2hsOUeKiHxcB/NxszM/azFAUUpZ1VAJ+MUgp
	XwibBRYpTmEeNJk6IZwl8NiJe1TZcXk7t02yQ/G8=
Message-ID: <0c113f33-4410-aa75-84b7-c3ca860688f9@apertussolutions.com>
Date: Mon, 3 Jul 2023 07:40:17 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
Content-Language: en-US
To: Luca Fancellu <Luca.Fancellu@arm.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Wei Liu <wl@xen.org>, Henry Wang <Henry.Wang@arm.com>,
 Community Manager <community.manager@xenproject.org>,
 Doug Goldstein <cardoe@cardoe.com>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Anthony PERARD <anthony.perard@citrix.com>,
 Christopher Clark <christopher.w.clark@gmail.com>
References: <20230630091210.3742121-1-luca.fancellu@arm.com>
 <6060dd00-5d9c-3804-4b9d-154b9b9dca49@citrix.com>
 <31FE51E0-0336-4756-8B30-6FE77DE10932@arm.com>
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
In-Reply-To: <31FE51E0-0336-4756-8B30-6FE77DE10932@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

On 7/1/23 11:13, Luca Fancellu wrote:
> 
> 
>> On 1 Jul 2023, at 08:53, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>
>> On 30/06/2023 10:12 am, Luca Fancellu wrote:
>>> The "dom0less" feature was intended to be the feature where a domU
>>> domain could be launched without the control domain (Dom0)
>>> intervention, however the name seems to suggest that Dom0 cannot
>>> be part of the configuration, while instead it's a possible use case.
>>>
>>> To avoid that, rename the "dom0less" configuration with the name
>>> "hyperlaunch", that is less misleading.
>>>
>>> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
>>> ---
>>> This is an RFC to get the feeling of the community about the name
>>> change, for now it's everything in one patch just to see how it
>>> will look like, if there is interest on proceeding into it, I can
>>> split in more commit.
>>
>> Have you discussed this with Dan and Chris at all?  You haven't even
>> CC'd them.
> 
> No, this rename idea started from a chat during the summit, anyway Julien
> promptly add them to the CC, because I forgot.

No worries and thank you for considering and taking the time to do this 
RFC. It is greatly appreciated that there is a strong willingness to 
have dom0less and hyperlaunch merged.

>>
>> While there is a lot of end-goal in common between the dom0less and
>> hyperlaunch, and that the name dom0less is deeply misleading,
>> hyperlaunch is specifically not this.
> 
> Yes Hyperlaunch is more than this, however as I said, with this RFC I would like
> to ear opinions, @Daniel @Christopher could it be a proper name for the dom0less
> feature?

As Andy has alluded, hyperlaunch is meant to provide a flexible means to 
handle domain construction at boot to meet a wide range of possible use 
cases. One of those use cases is dom0less, so yes, ultimately what 
dom0less does today will be achievable under hyperlaunch. Our intended 
approach to align the two implementations is one that is meant to be 
minimally disruptive, since dom0less is considered a supported 
(SUPPORT.md) capability. As mentioned, we are greatly appreciative to 
the openness to adopt the name, but a big concern I personally have is 
the confusion it could cause a general user. A blanket rename would end 
up with two documents in the docs tree that provide two different 
explanations of hyperlaunch and two different device tree definitions. 
So I think a more measured approach should be considered here.

> If this patch makes things more difficult for the Hyperlunch serie, Iâ€™m ok to drop it,
> my only aim was just to find a less misleading name for the feature.

What I would like to suggest as a good first step would be an update to 
the dom0less document. Provide a note at the beginning that points to 
the hyperlaunch design doc as a more general approach that will 
eventually subsume dom0less. This would provide a gentler transition for 
exist users of dom0less.

If it is not too much, I would also ask, please have a look at the 
design for boot modules in the series Christopher just posted. The 
design pulls from the work done by dom0less and expanded upon it. I 
major step into merging the two capabilities will be to have a common 
set of structures. Once those are in place, we can move to a common 
device tree representation, and at that point we would be fairly close, 
if not at the point of a formal merger of between the two.

Thank you and please let me know what you think!

v/r,
dps

> Cheers,
> Luca
> 
>>
>> ~Andrew
> 


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 11:50:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 11:50:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558073.871876 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGI49-0005Tc-4Z; Mon, 03 Jul 2023 11:50:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558073.871876; Mon, 03 Jul 2023 11:50:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGI49-0005TV-0x; Mon, 03 Jul 2023 11:50:01 +0000
Received: by outflank-mailman (input) for mailman id 558073;
 Mon, 03 Jul 2023 11:49:59 +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
 <SRS0=FG1R=CV=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qGI47-0005TP-Hd
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 11:49:59 +0000
Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com
 [2a00:1450:4864:20::229])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bb79e598-1997-11ee-8611-37d641c3527e;
 Mon, 03 Jul 2023 13:49:57 +0200 (CEST)
Received: by mail-lj1-x229.google.com with SMTP id
 38308e7fff4ca-2b6994a8ce3so63601671fa.1
 for <xen-devel@lists.xenproject.org>; Mon, 03 Jul 2023 04:49:57 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 v10-20020a2e7a0a000000b002b6d87ee4a4sm2001316ljc.38.2023.07.03.04.49.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 03 Jul 2023 04:49:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bb79e598-1997-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688384996; x=1690976996;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=Ho534hFMM5oGf4sAHPgs8xtfIsDaUKrevbKZ0uWK43g=;
        b=UEe15vAcFKBoEhSxZkZN65TRYW2dI2IQ6imQ4nXqLMCmJ+++B1mWk0VpkiH+TiI1nI
         u/sn+iVTJAy/oUXCutlZhIH+CeIYQYoEE+jef4CUElJ1cP02PwouNO8F2TVT1S5SealS
         eq+eWRA0S2myzH2w1UdjSrKnxoXeTR7aSLvI/FvTo6LMTkD2NbOUOx8FLLBiF+NMOAP3
         NOzkx9Mxtqwvbviv9Pc7lkJ/yOxV1Ve13VAILJeKQjBnYD7Im2I5Il3QygSIv8elj6PP
         HEO6IP/KVsKUaByq4oBo6Ir5deEsyta6oDZRL0I6djxgiYvQXaFG4scmZiaCjtkSFSSf
         7Dlw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688384996; x=1690976996;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=Ho534hFMM5oGf4sAHPgs8xtfIsDaUKrevbKZ0uWK43g=;
        b=FE7Cbh2LR2pmocBEKLR/xRBXoN7DJvY1rW7s+LYy046mkKFQr//C8vj4pvgMvK2AbI
         diEkMDsxe1vlSb4gpP4kzugxm2dDh5t6AEueHVLf1IReXzkvl59A5k/6shRgaNLv49kR
         0435xnA2rkE6LRXnsVc407TDIJ2tcghhwsY6LtRRHIIdPxVZhFnJ4WZOb/f/9w749uWM
         W8iZcTgwSxJMgwTUqa4yoIxVWocbFAk1NIVobqpj8aAA5yGzjyUcUU6Du65YlN0cj+Ab
         MjQNyMCW7oH+WHhVAOcjvbEPu4ntnz4ONDNSdWpGGxgFYdO0/UR+hLzTVOYCO5gL+j+z
         dIpA==
X-Gm-Message-State: ABy/qLbJq2Co4Jvq/0b7MDmUZZDqRAcAztU43H+unAjCTQO86mjJ0zjL
	B0vOL/jgz1HeAy6BXM9oclfF7bkW5xUHLw==
X-Google-Smtp-Source: APBJJlGm+Ls1vUP8SW9A3kvABZ7pCJi93/IHyZKlPrRodZvYdWTkfLT5emxAeboF/gjBZiyye6ooSw==
X-Received: by 2002:a2e:b60d:0:b0:2b6:c4f3:de with SMTP id r13-20020a2eb60d000000b002b6c4f300demr6549845ljn.24.1688384996085;
        Mon, 03 Jul 2023 04:49:56 -0700 (PDT)
Message-ID: <422f0fbfdb444feb2c1f190ee6e45f7a44c7b4f3.camel@gmail.com>
Subject: Re: [PATCH v2 0/6] xen/riscv: introduce identity mapping
From: Oleksii <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org, Bob Eshleman <bobbyeshleman@gmail.com>, 
	Alistair Francis <alistair.francis@wdc.com>
Cc: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>,  Connor Davis <connojdavis@gmail.com>
Date: Mon, 03 Jul 2023 14:49:55 +0300
In-Reply-To: <cover.1687178053.git.oleksii.kurochko@gmail.com>
References: <cover.1687178053.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.3 (3.48.3-1.fc38) 
MIME-Version: 1.0


Hello Bobby and Alistair,

Some patches of the current patch series were merged, but some still
require your Ack-by/Reviewed-by.

Could you please look at the following patches:
1. [PATCH v2 3/6] xen/riscv: introduce function for physical offset
calculation
2. [PATCH v2 4/6] xen/riscv: introduce identity mapping

Thank you so much for your attention and participation.

~ Oleksii

On Mon, 2023-06-19 at 16:34 +0300, Oleksii Kurochko wrote:
> The patch series introduces things necessary to implement identity
> mapping:
> =C2=A0 1. Make identity mapping for the entire Xen.
> =C2=A0 2. Enable MMU.
> =C2=A0 3. Jump to the virtual address world
> =C2=A0 4. Remove identity mapping.
>=20
> Also current patch series introduces the calculation of physical
> offset before
> MMU is enabled as access to physical offset will be calculated wrong
> after
> MMU will be enabled because access to phys_off variable is PC-
> relative and
> in the case when linker address !=3D load address, it will cause MMU
> fault.
>=20
> One more thing that was done is:
> =C2=A0 * Added SPDX tags.
> =C2=A0 * move extern of cpu0_boot_stack to a header.
>=20
> The reason for this patch series can be found here:
> https://lore.kernel.org/xen-devel/4e336121-fc0c-b007-bf7b-430352563d55@ci=
trix.com/
>=20
> ---
> Changes in V2:
> =C2=A0- update the patch series message.
> =C2=A0- drop patches from the previous version of the patch series:
> =C2=A0=C2=A0 * xen/riscv: add __ASSEMBLY__ guards". ( merged )
> =C2=A0=C2=A0 * xen/riscv: make sure that identity mapping isn't bigger th=
en
> page size
> =C2=A0=C2=A0=C2=A0=C2=A0 ( entire Xen is 1:1 mapped so there is no need f=
or the checks
> from the patch )
> =C2=A0- add .sbss.* and put it befor .bss* .
> =C2=A0- move out reset_stack() to .text section.
> =C2=A0- add '__ro_after_init' for phys_offset variable.
> =C2=A0- add '__init' for calc_phys_offset().
> =C2=A0- declaring variable phys_off as non static as it will be used in
> head.S.
> =C2=A0- update definition of PGTBL_INITIAL_COUNT and the comment above.
> =C2=A0- code style fixes.
> =C2=A0- remove id_addrs array becase entire Xen is mapped.
> =C2=A0- reverse condition for cycle inside remove_identity_mapping().
> =C2=A0- fix page table walk in remove_identity_mapping().
> =C2=A0- save hart_id and dtb_addr before call MMU related C functions
> =C2=A0- use phys_offset variable instead of doing calcultations to get
> phys offset
> =C2=A0=C2=A0 in head.S file. ( it can be easily done as entire Xen is 1:1
> mapped now )
> =C2=A0- declare enable_muu() as __init.
> =C2=A0- Update SPDX tags.
> =C2=A0- Add Review-By/Suggested-By for some patches.
> =C2=A0- code style fixes.
>=20
> Oleksii Kurochko (6):
> =C2=A0 xen/riscv: add .sbss section to .bss
> =C2=A0 xen/riscv: introduce reset_stack() function
> =C2=A0 xen/riscv: introduce function for physical offset calculation
> =C2=A0 xen/riscv: introduce identity mapping
> =C2=A0 xen/riscv: add SPDX tags
> =C2=A0 xen/riscv: move extern of cpu0_boot_stack to header
>=20
> =C2=A0xen/arch/riscv/include/asm/config.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 |=C2=A0=C2=A0 2 +
> =C2=A0xen/arch/riscv/include/asm/current.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =
|=C2=A0=C2=A0 2 +
> =C2=A0xen/arch/riscv/include/asm/early_printk.h |=C2=A0=C2=A0 2 +
> =C2=A0xen/arch/riscv/include/asm/mm.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0 9 +-
> =C2=A0xen/arch/riscv/include/asm/page-bits.h=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=
=A0 2 +
> =C2=A0xen/arch/riscv/include/asm/page.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 |=C2=A0=C2=A0 2 +
> =C2=A0xen/arch/riscv/include/asm/traps.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 |=C2=A0=C2=A0 2 +
> =C2=A0xen/arch/riscv/include/asm/types.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 |=C2=A0=C2=A0 2 +
> =C2=A0xen/arch/riscv/mm.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 | 104 +++++++++++++-------
> --
> =C2=A0xen/arch/riscv/riscv64/head.S=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 46 +++++++++-
> =C2=A0xen/arch/riscv/setup.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=
=A0 16 +---
> =C2=A0xen/arch/riscv/xen.lds.S=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0 =
2 +-
> =C2=A012 files changed, 136 insertions(+), 55 deletions(-)
>=20



From xen-devel-bounces@lists.xenproject.org Mon Jul 03 12:14:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 12:14:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558079.871885 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGIRi-0000Sa-2Y; Mon, 03 Jul 2023 12:14:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558079.871885; Mon, 03 Jul 2023 12:14:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGIRh-0000ST-W2; Mon, 03 Jul 2023 12:14:21 +0000
Received: by outflank-mailman (input) for mailman id 558079;
 Mon, 03 Jul 2023 12:14:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGIRh-0000SJ-1r; Mon, 03 Jul 2023 12:14:21 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGIRg-0006Z8-Tq; Mon, 03 Jul 2023 12:14:20 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGIRg-0000FL-Ik; Mon, 03 Jul 2023 12:14:20 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qGIRg-0002JS-IE; Mon, 03 Jul 2023 12:14:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=RJPHCwgsbLjuA4wE7bBtDuxGQsOVwSyjhMFrwVWRFxY=; b=wJNXcacuczMMxkjrK+xmEbu37J
	bPVJdGz1pAYKJ+l4ePdFAB6JwhWGWWK3DfTYfSu+jWn1RSfSR7t/fqaO172558yl6bBmH+M3wPtGz
	p7vEp8m2wCskIdCTcoiYAfZp4ZfsSpN3wx7hl6UxE+IFyag+OACicfyVhqJQklQ0RoPo=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181684-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181684: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-pygrub:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:freebsd-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:debian-install:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:debian-di-install:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:windows-install:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl:debian-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:leak-check/basis/dst_host(19):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:build-arm64-pvops:kernel-build:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt-qcow2:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-credit2:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-freebsd11-amd64:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-multivcpu:debian-install:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-qemuu-nested-amd:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:xen-boot:fail:heisenbug
    linux-linus:test-amd64-coresched-amd64-xl:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/src_host:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-rtds:xen-boot:fail:allowable
    linux-linus:test-arm64-arm64-libvirt-raw:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-examine:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=a901a3568fd26ca9c4a82d8bc5ed5b3ed844d451
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 03 Jul 2023 12:14:20 +0000

flight 181684 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181684/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-pygrub       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64 12 freebsd-install      fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt     12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm      12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd 12 debian-install          fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu 14 guest-start             fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2  12 debian-install           fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2 12 debian-di-install      fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 12 windows-install  fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd 11 leak-check/basis(11) fail in 181682 REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 11 leak-check/basis(11) fail in 181682 REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 11 leak-check/basis(11) fail in 181682 REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 11 leak-check/basis(11) fail in 181682 REGR. vs. 180278
 test-amd64-amd64-xl          12 debian-install fail in 181682 REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 19 leak-check/basis/dst_host(19) fail in 181682 REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64 12 debian-hvm-install fail in 181682 REGR. vs. 180278
 build-arm64-pvops             6 kernel-build   fail in 181682 REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemut-ws16-amd64 11 leak-check/basis(11) fail in 181682 pass in 181684
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 8 xen-boot fail in 181682 pass in 181684
 test-amd64-amd64-libvirt 11 leak-check/basis(11) fail in 181682 pass in 181684
 test-amd64-amd64-libvirt-qcow2 11 leak-check/basis(11) fail in 181682 pass in 181684
 test-amd64-amd64-xl-pvhv2-amd 11 leak-check/basis(11) fail in 181682 pass in 181684
 test-amd64-amd64-xl-credit2 11 leak-check/basis(11) fail in 181682 pass in 181684
 test-amd64-amd64-freebsd11-amd64 11 leak-check/basis(11) fail in 181682 pass in 181684
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 8 xen-boot fail in 181682 pass in 181684
 test-amd64-amd64-xl-multivcpu 12 debian-install  fail in 181682 pass in 181684
 test-amd64-amd64-xl-qemuu-debianhvm-amd64  8 xen-boot      fail pass in 181682
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot   fail pass in 181682
 test-amd64-amd64-xl          11 leak-check/basis(11)       fail pass in 181682
 test-amd64-amd64-xl-qemut-debianhvm-amd64  8 xen-boot      fail pass in 181682
 test-amd64-amd64-qemuu-nested-amd  8 xen-boot              fail pass in 181682
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 8 xen-boot fail pass in 181682
 test-amd64-coresched-amd64-xl  8 xen-boot                  fail pass in 181682
 test-amd64-amd64-libvirt-pair 12 xen-boot/src_host         fail pass in 181682

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds      8 xen-boot                 fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-libvirt-raw  1 build-check(1)           blocked in 181682 n/a
 test-arm64-arm64-xl-xsm       1 build-check(1)           blocked in 181682 n/a
 test-arm64-arm64-examine      1 build-check(1)           blocked in 181682 n/a
 test-arm64-arm64-libvirt-xsm  1 build-check(1)           blocked in 181682 n/a
 test-arm64-arm64-xl-credit2   1 build-check(1)           blocked in 181682 n/a
 test-arm64-arm64-xl-credit1   1 build-check(1)           blocked in 181682 n/a
 test-arm64-arm64-xl           1 build-check(1)           blocked in 181682 n/a
 test-arm64-arm64-xl-vhd       1 build-check(1)           blocked in 181682 n/a
 test-arm64-arm64-xl-thunderx  1 build-check(1)           blocked in 181682 n/a
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                a901a3568fd26ca9c4a82d8bc5ed5b3ed844d451
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   77 days
Failing since        180281  2023-04-17 06:24:36 Z   77 days  150 attempts
Testing same since   181682  2023-07-02 19:42:58 Z    0 days    2 attempts

------------------------------------------------------------
3562 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 574059 lines long.)


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 13:00:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 13:00:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558085.871897 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGJAU-0005mz-Kw; Mon, 03 Jul 2023 13:00:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558085.871897; Mon, 03 Jul 2023 13:00:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGJAU-0005ms-Gd; Mon, 03 Jul 2023 13:00:38 +0000
Received: by outflank-mailman (input) for mailman id 558085;
 Mon, 03 Jul 2023 13:00:37 +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 <SRS0=ukTE=CV=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qGJAT-0005ml-Ks
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 13:00:37 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9997a690-19a1-11ee-8611-37d641c3527e;
 Mon, 03 Jul 2023 15:00:35 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id E3FD2218F3;
 Mon,  3 Jul 2023 13:00:34 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9A656138FC;
 Mon,  3 Jul 2023 13:00:34 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 2xVZJHLGomSYCgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 03 Jul 2023 13:00:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9997a690-19a1-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688389234; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:  content-transfer-encoding:content-transfer-encoding;
	bh=g/qfo8Cb33qUzg9p/sYx93BIkx/lh9MH46SOSdnmyf8=;
	b=E0ValWnb8323NYs3nZ1reUyn9xcW6UnT/WjrnwfuddpLUbUcW8umrJK2eBg3GMgbEVZlc5
	e7Op8WL+1NzVEDBRQL2foLY3SM64CFvRMXs5yP/7PJD1wYpI7+kCyTD72S180Jsu1OyMFY
	Lwnv8tdJ/g8zVtBTGNEHkHjIPCjEI1g=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org
Subject: [PATCH] x86/xen: fix secondary processor fpu initialization
Date: Mon,  3 Jul 2023 15:00:32 +0200
Message-Id: <20230703130032.22916-1-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Moving the call of fpu__init_cpu() from cpu_init() to start_secondary()
broke Xen PV guests, as those don't call start_secondary() for APs.

Fix that by adding the call of fpu__init_cpu() to cpu_bringup(), which
is the Xen PV replacement of start_secondary().

Fixes: b81fac906a8f ("x86/fpu: Move FPU initialization into arch_cpu_finalize_init()")
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/xen/smp_pv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/xen/smp_pv.c b/arch/x86/xen/smp_pv.c
index d5ae5de2daa2..cef78b8c89f4 100644
--- a/arch/x86/xen/smp_pv.c
+++ b/arch/x86/xen/smp_pv.c
@@ -63,6 +63,7 @@ static void cpu_bringup(void)
 	cr4_init();
 	cpuhp_ap_sync_alive();
 	cpu_init();
+	fpu__init_cpu();
 	touch_softlockup_watchdog();
 
 	/* PVH runs in ring 0 and allows us to do native syscalls. Yay! */
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 03 13:42:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 13:42:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558089.871905 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGJog-0001vm-NK; Mon, 03 Jul 2023 13:42:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558089.871905; Mon, 03 Jul 2023 13:42:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGJog-0001vf-Kk; Mon, 03 Jul 2023 13:42:10 +0000
Received: by outflank-mailman (input) for mailman id 558089;
 Mon, 03 Jul 2023 13:42:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ukTE=CV=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qGJof-0001vZ-P6
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 13:42:09 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 671e4e33-19a7-11ee-b237-6b7b168915f2;
 Mon, 03 Jul 2023 15:42:08 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 509DB219BE;
 Mon,  3 Jul 2023 13:42:07 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 35FCC13276;
 Mon,  3 Jul 2023 13:42:07 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id sLqlCy/QomR7IwAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 03 Jul 2023 13:42:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 671e4e33-19a7-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688391727; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=KDhh5FG/dyHuQMTe3c5cc2HhGzLW1okef93kXWumym4=;
	b=hShXidb6slpC+iPSdqDppTJh1duohh/9cHaUDsGHAtbzOrTi3XF70ihwC87fd24c+t4uHE
	X4lry0n6KiOsyghf7vPzmdfGzRAEgbRyR1YS1mzlXz52uzCiz44UrkosNJMVvq/00WMhXr
	yk5QPUdY0+VM12TKFFGCBNnIWES8VAE=
Message-ID: <46d4253c-551e-4d7a-2a60-7ce57594d85b@suse.com>
Date: Mon, 3 Jul 2023 15:42:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [linux-linus test] 181682: regressions - FAIL
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
To: osstest service owner <osstest-admin@xenproject.org>,
 xen-devel@lists.xenproject.org
References: <osstest-181682-mainreport@xen.org>
 <6296a02e-863b-879d-6993-1a828e71fac2@suse.com>
In-Reply-To: <6296a02e-863b-879d-6993-1a828e71fac2@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------I5wJgGrsWv0vqWJgEprOeGPF"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------I5wJgGrsWv0vqWJgEprOeGPF
Content-Type: multipart/mixed; boundary="------------FSp5redWEW0SrnLwSkM0a3lN";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: osstest service owner <osstest-admin@xenproject.org>,
 xen-devel@lists.xenproject.org
Message-ID: <46d4253c-551e-4d7a-2a60-7ce57594d85b@suse.com>
Subject: Re: [linux-linus test] 181682: regressions - FAIL
References: <osstest-181682-mainreport@xen.org>
 <6296a02e-863b-879d-6993-1a828e71fac2@suse.com>
In-Reply-To: <6296a02e-863b-879d-6993-1a828e71fac2@suse.com>

--------------FSp5redWEW0SrnLwSkM0a3lN
Content-Type: multipart/mixed; boundary="------------7oTm0v08JYx0X0fEtSAsmLeG"

--------------7oTm0v08JYx0X0fEtSAsmLeG
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMDMuMDcuMjMgMDc6MzUsIEp1ZXJnZW4gR3Jvc3Mgd3JvdGU6DQo+IE9uIDAzLjA3LjIz
IDA0OjExLCBvc3N0ZXN0IHNlcnZpY2Ugb3duZXIgd3JvdGU6DQo+PiBmbGlnaHQgMTgxNjgy
IGxpbnV4LWxpbnVzIHJlYWwgW3JlYWxdDQo+PiBodHRwOi8vbG9ncy50ZXN0LWxhYi54ZW5w
cm9qZWN0Lm9yZy9vc3N0ZXN0L2xvZ3MvMTgxNjgyLw0KPj4NCj4+IFJlZ3Jlc3Npb25zIDot
KA0KPj4NCj4+IFRlc3RzIHdoaWNoIGRpZCBub3Qgc3VjY2VlZCBhbmQgYXJlIGJsb2NraW5n
LA0KPj4gaW5jbHVkaW5nIHRlc3RzIHdoaWNoIGNvdWxkIG5vdCBiZSBydW46DQo+IA0KPiAu
Li4NCj4gDQo+PiDCoCB0ZXN0LWFtZDY0LWFtZDY0LXhswqDCoMKgwqDCoMKgwqDCoMKgIDEy
IGRlYmlhbi1pbnN0YWxswqDCoMKgwqDCoMKgwqDCoMKgwqAgZmFpbCBSRUdSLiB2cy4gMTgw
Mjc4DQo+IA0KPiBFcnJvcnMgZHVyaW5nIGluc3RhbGxhdGlvbiBvZiAuZGViIGZpbGVzLiBX
b3JyeWluZyBtZXNzYWdlcyBpbiB0aGUgc2VyaWFsIGxvZw0KPiBhcmU6DQo+IA0KPiBbwqDC
oMKgIDIuOTc3MDkxXSBCYWQgRlBVIHN0YXRlIGRldGVjdGVkIGF0IHJlc3RvcmVfZnByZWdz
X2Zyb21fZnBzdGF0ZSsweDUyLzB4YzAsIA0KPiByZWluaXRpYWxpemluZyBGUFUgcmVnaXN0
ZXJzLg0KPiANCj4gdHJhcHM6IGRwa2ctZGViWzE0MTNdIHRyYXAgaW52YWxpZCBvcGNvZGUg
aXA6N2Y1YzBhMDE2OTNmIHNwOjdmZmUzZGFmNWQ5OCANCj4gZXJyb3I6MCBpbiBsaWJjLTIu
Mjguc29bN2Y1YzA5ZWUwMDAwKzE0NzAwMF0NCj4gDQo+IE9sYWYgaGFzIHNlZW4gc2ltaWxh
ciBmYWlsdXJlcyBsYXN0IHdlZWssIHNvIHdlIGhhdmUgYSByZXByb2R1Y2VyIGF0IGhhbmQu
DQoNClBhdGNoIHNlbnQgdG8gTEtNTDoNCg0KaHR0cHM6Ly9sb3JlLmtlcm5lbC5vcmcvbGtt
bC8yMDIzMDcwMzEzMDAzMi4yMjkxNi0xLWpncm9zc0BzdXNlLmNvbS9ULyN1DQoNCg0KSnVl
cmdlbg0K
--------------7oTm0v08JYx0X0fEtSAsmLeG
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
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zMNOu
5D+jLRZQd1Sv27AR+IP3I8U4aqnhLpwhK7MEy9oCILlgZ1QZe49kpcumcZKORmzB
TNh30FVKK1EvmV2xAKDoaEOgQB4iFQLhJCdP1I5aSgM5IVFdn7v5YgEYuJYx37Io
N1EblHI//x/e2AaIHpzK5h88NEawQsaNRpNSrcfbFmAg987ATQRTjHAWAQgAyzH6
AOODMBjgfWE9VeCgsrwH3exNAU32gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------7oTm0v08JYx0X0fEtSAsmLeG--

--------------FSp5redWEW0SrnLwSkM0a3lN--

--------------I5wJgGrsWv0vqWJgEprOeGPF
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSi0C4FAwAAAAAACgkQsN6d1ii/Ey8G
Swf/Qi50VAeedSnWe8Aem1e8p8sglU9NGCbZ0nAhUORhs2iH98FFMk/j8jAuF2g7N1mcSfGZHj1P
l6U6C4d71AnlV62uorM8iQLzoAdtBfE9ybYENQ0jpkkwqFKO+Jgeq+u+pnCV7ZNpdMT9E5iWp/cu
zjK5yI08284CV/eM/0YKQtaHTh6Ipln694/YhDn4iWszLZadgqLPKizhy18KKm8hMd4Ys3qGVFL9
3sZrBokucNPW2JK3OjJNvh7WDcU5WA+zTgITN4hY1oTCwI/0gQIEljhbTIpywJeRbbMsKmc1q+NE
KoMpMf/f29QzRHjnzTlMYYi9ez/ORsAZWXuFyMOhtQ==
=IWY4
-----END PGP SIGNATURE-----

--------------I5wJgGrsWv0vqWJgEprOeGPF--


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 14:06:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 14:06:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558095.871915 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGKCB-0004cY-QH; Mon, 03 Jul 2023 14:06:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558095.871915; Mon, 03 Jul 2023 14:06:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGKCB-0004cR-NV; Mon, 03 Jul 2023 14:06:27 +0000
Received: by outflank-mailman (input) for mailman id 558095;
 Mon, 03 Jul 2023 14:06:26 +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
 <SRS0=G/7H=CV=citrix.com=prvs=5416de508=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qGKC9-0004cH-Pa
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 14:06:26 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c9480b38-19aa-11ee-8611-37d641c3527e;
 Mon, 03 Jul 2023 16:06:22 +0200 (CEST)
Received: from mail-bn8nam11lp2169.outbound.protection.outlook.com (HELO
 NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.169])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 03 Jul 2023 10:06:12 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SN7PR03MB7208.namprd03.prod.outlook.com (2603:10b6:806:2ef::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul
 2023 14:06:08 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902%7]) with mapi id 15.20.6544.024; Mon, 3 Jul 2023
 14:06:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c9480b38-19aa-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688393182;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=8SDCemCy0Ha/MMvfjru/0aucOrQNCKVjha9IMn2BbpA=;
  b=RzacABmE9Hda+9yoJSsER7w1j/CwzqF9lKEv9LlFEBeE2VCBlRLIEyaf
   7ZBs+3glUGTnu8bb11LvC7I3m4P4EU2SV+yN3a3WmGTnqBEWKe9K7oU8z
   M5PZJ71Wk6AEswGqJjRdKqWcPPswDH+8wxh/JuPXSxmcZDOr4D05k9v1x
   s=;
X-IronPort-RemoteIP: 104.47.58.169
X-IronPort-MID: 114302879
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:cD5Rha5Kf08gw8gc2JcTLwxRtPbGchMFZxGqfqrLsTDasY5as4F+v
 mcfWmmObqvfZzP8eYwnbo2yoUwH6pPVzoBhTFZt+y41Hi5G8cbLO4+Ufxz6V8+wwm8vb2o8t
 plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraCYnsrLeNdYH9JoQp5nOIkiZJfj9G8Agec0
 fv/uMSaM1K+s9JOGjt8B5mr9lU35ZwehBtC5gZlPa8T5weH/5UoJMl3yZ+ZfiOQrrZ8RoZWd
 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4
 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5m7
 8NDCW8fNyK4rcGcnqOpDcJcheEnI5y+VG8fkikIITDxK98DGMmGaYOaoNhS0XE3m9xEGuvYa
 4wBcz1zYR/cYhpJfFAKFJY5m+TujX76G9FagAvN+exrvC6OnEoojumF3Nn9I7RmQe1PmUmVv
 CTe9nnRCRAGLt2PjzGC9xpAg8eWxH+gANhCS+zQGvhC2EOUmTU0ITcqTkK3qOiGgHy3B8h4A
 hlBksYphe1onKCxdfHtUhv9rHOasxo0X9tLD/Z8+AyL0rDT4QuSGi4DVDEpQN4sudIyRDcq/
 kSUhN6vDjtq2JWKTVqN+7HSqim9UQAXMGsDaCksXQYDpd75r+kblQnTR9xuFKq0iNzdGjzqx
 T2O6i8kiN0uYdUj0qy6+RXNhWKqr52QFwotvFyJDySi8x9zY5Oja8qw81/H4P1cLYGfCF6co
 HwDnMvY5+cLZX2QqBGwrCw2NOnBz5643Pf02DaDw7FJG+yRxkOe
IronPort-HdrOrdr: A9a23:rRbk3apYQGMCfPzQ3JhrjT8aV5oGeYIsimQD101hICG9Ffbo7f
 xG/c5rriMc7Qx7ZJhNo6HmBECrewK/yXcN2+Us1MmZLWrbURqTXeRfBOLZqlWOJ8SUzJ846U
 4PSchD4G6cNykDsS4piDPYLz70qOPozEjh7d21858mJTsGV0kvhD0JbHfjLnFL
X-Talos-CUID: 9a23:c21NsG/KgxvWMowCTPWVv1QrQeF6YCTv913zCRGpGyFCeL6wTVDFrQ==
X-Talos-MUID: 9a23:sO4QWgVZ1GO3bwjq/Gfyg247E+5C37+3BEkcrp80spWeEgUlbg==
X-IronPort-AV: E=Sophos;i="6.01,178,1684814400"; 
   d="scan'208";a="114302879"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=V88kPAH84qXFaYIBwibslUnhFk+B9SYBYlZ/gvWhp9YcQS6WewnbTD7Bq5jrDXLdeAlas2rmisF9j+8n0mo1PV3EfTMgIdRM1rHXBpidn6Tdkyu+lW9Bb82735pJ0J4s/HDVd01Cj/1zUaD5tBdrEoFDERlllPjD5wcLY9RLdOoHiCEjl4RiA5F+x+oG9To1MMqvjCz6eBSz05svD4HsDiYO2BgXvvTmk/a6k7P624t59FXn6EPJuCXEMPUsHmA20T8LDMU8WR0sVgsKGrkZDWIET/gMiN3SPFmyTYne6GYfRa8iSeyxTl2sYePgRW/P752i07Cn6MY8ifWkV3SaEg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=xDQU3W5cX687L1WQosDpVw5bcXd4QsSkW2708q0Pimg=;
 b=lrpmT7H8KruKIPzL2qlyXrshbq1dpA0ZP6IIQ1+kOPOHkQIApbz6qh4RxhW9lYxhepo1TnLsaZHLQVlWuulC8SwHLUXQA/6/NeMWvw2lFAYN8on5ofNFNv/aXfRfj47VFxvWeuQEToCHXRFEnPWU/hjlzjUnTWIBx97CZplRwelaJmKNJH2y4yItVF7VRQiSy7rUiBw1LHYmAkxG58VNzuviLkUaRXNcV9VwEPdLx+cDTtn0I43lNlqXs6zTdJ+yTkDlHuDf9VmILeoiZfV2hMabduanxcaXaiPUohG2lorVPtZ1mreMkyIuf6MDG3FJV0NDzEn/WDknNjcqviN8Tw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=xDQU3W5cX687L1WQosDpVw5bcXd4QsSkW2708q0Pimg=;
 b=XEaSSYtGMm0HpUjIrwagRiDPik3Q4UcLpcV9KmlEuProqltjFRyG03pOEHIsCVhIX6hZ/eZvhe/tMC5W3Cw56QE6xXOrFWm7L2njc1KilVoG5kwc040koEMiD9LZH05mf/1kgvnmc/61qYZTn62OgJpskHQp9hMGmVQXGWMjrTs=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Mon, 3 Jul 2023 16:06:01 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v2] amd: disable C6 after 1000 days on Zen2
Message-ID: <ZKLVyfa_Ft_tYCm1@MacBook-Air-de-Roger.local>
References: <20230630131820.29323-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230630131820.29323-1-roger.pau@citrix.com>
X-ClientProxiedBy: LO4P123CA0199.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a5::6) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SN7PR03MB7208:EE_
X-MS-Office365-Filtering-Correlation-Id: 2a8838a4-32d9-4803-816a-08db7bcea582
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	GCQ60Dct4YsxXAEvoTQUe6cBYb5ITGOCD/GCqnFjop5FLc2jbqyaypyna3T/P+EkdOC9qnuTZgU6qFIfpEUdkuibOdCHvHE/ehW34PiWK92i6yYlbGIoSZsYJahq3ZSqoTIVX8/G2RySmIPEWcID8uqeHZsQ21Fha/yB+yxfF3avE/vy2saSTT/vmROUEoF+sfQ0zqklyUNZ9q/3ZsUmg366IcJRIKE6Befhxfa0e2Tqcrh2hIUXGJ+X3GMPElr3WQ+7uW1FdhXc675nNKeVSKZ/o97w5ClL+2VYKkqfz8dx6DHFZ+mHG5xaKMLce2aa6FsVvdNrVRXi7hFnmGh3iP7Om5Y3KgiW181xsWKkNcDQ5Ogz2hkfN76Xybzc/2FJ5zZcdcTSCTNm9DOd+kz8SZQCqKf6tOk9eOtHimrP3AzVB3R/P9+2KjUDrvGCopARsMZ1XWPXCvYbqZtyEoU8Yo0GoieTVVOsLpTOOLHAK+7FeIjeXZDiHBD/G72bOdQPJZbO+7Cm9SadtBe/Cln1PaiB2orzNICMYkRrae0rk5XiLeaVBHmBtvuqCtPOPp/zqTCvmzFTKYPH7kT7pHKfFt2O24L8a2YSRgnqRzHpSP7KcuKWgwpikhLfKxGcHmTu
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(366004)(346002)(39860400002)(376002)(451199021)(6916009)(4326008)(66476007)(66946007)(66556008)(316002)(2906002)(478600001)(85182001)(8936002)(8676002)(5660300002)(41300700001)(9686003)(6512007)(54906003)(86362001)(6666004)(6486002)(38100700002)(6506007)(26005)(186003)(82960400001)(83380400001)(221023011);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Sml2ZWRnQUJlKzBqTm8wenJDMVJ1T0R5MXNCK0VxeHRtRm5PVGViQUtNcGc1?=
 =?utf-8?B?b1o2bGFudXRCb05HUjROazk1N1N6LzIyblZ3K1FOW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XwVoegFk3yLxT/QDMnCUIdlg3lO1BBSZkZ+9xHgJuO67k7Yg7RipJL1nHylwjtfiLxMta0aIy1mdCTecCHB+491jbJWDdv9EzNJtj2a/CaPKeVVFYCKUsLUgqP9BugMkD/gBelVOb0IOLNE+/rloe1uv3efkk9ZOXf1ZUMEHSB36TF/dT3Rvnym4guLdUpUTzSOmmKoqKjGGwaaOozzdskV8dIB0JmJGYR9P2FlsnpVu9KjmFOjxXkGReolK6OZdzO4+IpEalCSkAXUHEzGPfk=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2a8838a4-32d9-4803-816a-08db7bcea582
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 14:06:07.5256
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: CqFPICpDOA5/TVYTg2eq7hR6qyPtyCWdEFBKegZ9Hmbd2I+XBxQqaOHfHvRz5GA+Ii8fpc8pOGVkekQVhOcOQw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR03MB7208

On Fri, Jun 30, 2023 at 03:18:20PM +0200, Roger Pau Monne wrote:
> As specified on Errata 1474:
> 
> "A core will fail to exit CC6 after about 1044 days after the last
> system reset. The time of failure may vary depending on the spread
> spectrum and REFCLK frequency."
> 
> Detect when running on AMD Zen2 (family 17h models 30-3fh, 60-6fh or
> 70-7fh) and setup a timer to prevent entering C6 after 1000 days of
> uptime.  Take into account the TSC value at boot in order to account
> for any time elapsed before Xen has been booted.  Worst case we end
> up disabling C6 before strictly necessary, but that would still be
> safe, and it's better than not taking the TSC value into account and
> hanging.
> 
> Disable C6 by updating the MSR listed in the revision guide, this
> avoids applying workarounds in the CPU idle drivers, as the processor
> won't be allowed to enter C6 by the hardware itself.
> 
> Print a message once C6 is disabled in order to let the user know.
> 
> Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> ---
> The current Revision Guide for Fam17h model 60-6Fh (Lucienne and
> Renoir) hasn't been updated to reflect the MSR workaround, but the PPR
> for those models lists the MSR and the bits as having the expected
> meaning, so I assume it's safe to apply the same workaround there.
> 
> For all accounts this seems to affect all Zen2 models, and hence the
> workaround should be the same.  Might also affect Hygon, albeit I
> think Hygon is strictly limited to Zen1.
> ---
> Changes since v1:
>  - Apply the workaround listed by AMD: toggle some MSR bits.
>  - Do not apply the workaround if virtualized.
>  - Check for STIBP feature instead of listing specific models.
>  - Implement the DAYS macro based on SECONDS.
> ---
>  xen/arch/x86/cpu/amd.c               | 70 ++++++++++++++++++++++++++++
>  xen/arch/x86/include/asm/msr-index.h |  5 ++
>  xen/include/xen/time.h               |  1 +
>  3 files changed, 76 insertions(+)
> 
> diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
> index 0eaef82e5145..bdf45f8387e8 100644
> --- a/xen/arch/x86/cpu/amd.c
> +++ b/xen/arch/x86/cpu/amd.c
> @@ -51,6 +51,8 @@ bool __read_mostly amd_acpi_c1e_quirk;
>  bool __ro_after_init amd_legacy_ssbd;
>  bool __initdata amd_virt_spec_ctrl;
>  
> +static bool __read_mostly c6_disabled;
> +
>  static inline int rdmsr_amd_safe(unsigned int msr, unsigned int *lo,
>  				 unsigned int *hi)
>  {
> @@ -905,6 +907,31 @@ void __init detect_zen2_null_seg_behaviour(void)
>  
>  }
>  
> +static void cf_check disable_c6(void *arg)
> +{
> +	uint64_t val;
> +
> +	if (!c6_disabled) {
> +		printk(XENLOG_WARNING
> +    "Disabling C6 after 1000 days apparent uptime due to AMD errata 1474\n");
> +		c6_disabled = true;
> +		smp_call_function(disable_c6, NULL, 0);

I've realized this is racy with CPU hotplug, so I will need to inhibit
CPU hotplug around the call to smp_call_function() in order to prevent
CPUs being hotplugged and not seeing c6_disabled while set and also
not being set in cpu_online_map when the call to smp_call_function
happens.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 16:52:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 16:52:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558108.871929 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGMmN-0005cN-DO; Mon, 03 Jul 2023 16:51:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558108.871929; Mon, 03 Jul 2023 16:51:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGMmN-0005cG-Ae; Mon, 03 Jul 2023 16:51:59 +0000
Received: by outflank-mailman (input) for mailman id 558108;
 Mon, 03 Jul 2023 16:51:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGMmM-0005c6-17; Mon, 03 Jul 2023 16:51:58 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGMmL-0005Sj-PE; Mon, 03 Jul 2023 16:51:57 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGMmL-0006ZN-H1; Mon, 03 Jul 2023 16:51:57 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qGMmL-0004Ip-GP; Mon, 03 Jul 2023 16:51:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=KAac5I6jp3jYwJPvR518QZO6JDKeojORPLGjiqD+qls=; b=3CsY3B6G2d3c0gb9i2GEI7SgMv
	7QHpu6mSaCK5VR+x8RUl3PbGiS5PZYqJez84ioENvHhI5um+vibEYwGQVfSoQkRGVG79foZKRnW6c
	/kdMP+H/QkIJjkUxpgy10joc9YH9vLt1L3nGJ1iZuViJs10hFtkwLkGYSlpzU+LztIpY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181687-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181687: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=6c744465b6970080dadb1f297db024284153c912
X-Osstest-Versions-That:
    ovmf=f2188fe5d1553ad1896e27b2514d2f8d0308da8a
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 03 Jul 2023 16:51:57 +0000

flight 181687 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181687/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 6c744465b6970080dadb1f297db024284153c912
baseline version:
 ovmf                 f2188fe5d1553ad1896e27b2514d2f8d0308da8a

Last test of basis   181685  2023-07-03 03:12:31 Z    0 days
Testing same since   181687  2023-07-03 14:42:16 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Taylor Beebe <t@taylorbeebe.com>
  Taylor Beebe <tabeebe@microsoft.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   f2188fe5d1..6c744465b6  6c744465b6970080dadb1f297db024284153c912 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 17:48:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 17:48:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558122.871944 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGNfH-0002py-Gr; Mon, 03 Jul 2023 17:48:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558122.871944; Mon, 03 Jul 2023 17:48:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGNfH-0002pr-DX; Mon, 03 Jul 2023 17:48:43 +0000
Received: by outflank-mailman (input) for mailman id 558122;
 Mon, 03 Jul 2023 17:48:42 +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
 <SRS0=O3tK=CV=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qGNfG-0002pl-TW
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 17:48:42 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d70ca3a1-19c9-11ee-8611-37d641c3527e;
 Mon, 03 Jul 2023 19:48:39 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id B4D9460FF0;
 Mon,  3 Jul 2023 17:48:37 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAD89C433CA;
 Mon,  3 Jul 2023 17:48:34 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d70ca3a1-19c9-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688406517;
	bh=tvAAoxxAUVfK9XbIn+RB9Iavrk7EaGPwzNsEzSZhIVI=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=DgQV3jTer36elNMcnfFGcgLqbFgIsn6079opFGC/NTNGJFP4UdjiYg5WcdCvU5isq
	 gpdvTyY71kkBcYCsNJDKjgUWt596f6n9NM/lPg0aMKjqv05ZOrGXXR2kiC+UtKqjAh
	 CQBuO0jn8eyfSfi4jZg7Ekg9ixs0li3JGaekpSyksG0XLU0E5K2bWELhdhy9URXr7N
	 Jr27KLmrjA+UctthtSw7EMH4jb57h8Hc4w5HxKkmgzjxwQpeucv8hcElU6Xx5hssvb
	 87ZvUpz7qz5QsOmSg9nM4jtIJ22kfRPTnFQTmHJKPR1TdQQ9llLGi2+b9+WBo4dqiP
	 ht2jwDxKcVJUQ==
Date: Mon, 3 Jul 2023 10:48:30 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Daniel P. Smith" <dpsmith@apertussolutions.com>
cc: Luca Fancellu <Luca.Fancellu@arm.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Wei Liu <wl@xen.org>, Henry Wang <Henry.Wang@arm.com>, 
    Community Manager <community.manager@xenproject.org>, 
    Doug Goldstein <cardoe@cardoe.com>, 
    Bertrand Marquis <Bertrand.Marquis@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Anthony PERARD <anthony.perard@citrix.com>, 
    Christopher Clark <christopher.w.clark@gmail.com>
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
In-Reply-To: <0c113f33-4410-aa75-84b7-c3ca860688f9@apertussolutions.com>
Message-ID: <alpine.DEB.2.22.394.2307031048220.246273@ubuntu-linux-20-04-desktop>
References: <20230630091210.3742121-1-luca.fancellu@arm.com> <6060dd00-5d9c-3804-4b9d-154b9b9dca49@citrix.com> <31FE51E0-0336-4756-8B30-6FE77DE10932@arm.com> <0c113f33-4410-aa75-84b7-c3ca860688f9@apertussolutions.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; BOUNDARY="8323329-457683244-1688403545=:246273"
Content-ID: <alpine.DEB.2.22.394.2307030959200.246273@ubuntu-linux-20-04-desktop>

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-457683244-1688403545=:246273
Content-Type: text/plain; CHARSET=UTF-8
Content-Transfer-Encoding: 8BIT
Content-ID: <alpine.DEB.2.22.394.2307030959201.246273@ubuntu-linux-20-04-desktop>

On Mon, 3 Jul 2023, Daniel P. Smith wrote:
> On 7/1/23 11:13, Luca Fancellu wrote:
> > > On 1 Jul 2023, at 08:53, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> > > 
> > > On 30/06/2023 10:12 am, Luca Fancellu wrote:
> > > > The "dom0less" feature was intended to be the feature where a domU
> > > > domain could be launched without the control domain (Dom0)
> > > > intervention, however the name seems to suggest that Dom0 cannot
> > > > be part of the configuration, while instead it's a possible use case.
> > > > 
> > > > To avoid that, rename the "dom0less" configuration with the name
> > > > "hyperlaunch", that is less misleading.
> > > > 
> > > > Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> > > > ---
> > > > This is an RFC to get the feeling of the community about the name
> > > > change, for now it's everything in one patch just to see how it
> > > > will look like, if there is interest on proceeding into it, I can
> > > > split in more commit.
> > > 
> > > Have you discussed this with Dan and Chris at all?  You haven't even
> > > CC'd them.
> > 
> > No, this rename idea started from a chat during the summit, anyway Julien
> > promptly add them to the CC, because I forgot.
> 
> No worries and thank you for considering and taking the time to do this RFC.
> It is greatly appreciated that there is a strong willingness to have dom0less
> and hyperlaunch merged.
> 
> > > 
> > > While there is a lot of end-goal in common between the dom0less and
> > > hyperlaunch, and that the name dom0less is deeply misleading,
> > > hyperlaunch is specifically not this.
> > 
> > Yes Hyperlaunch is more than this, however as I said, with this RFC I would
> > like
> > to ear opinions, @Daniel @Christopher could it be a proper name for the
> > dom0less
> > feature?
> 
> As Andy has alluded, hyperlaunch is meant to provide a flexible means to
> handle domain construction at boot to meet a wide range of possible use cases.
> One of those use cases is dom0less, so yes, ultimately what dom0less does
> today will be achievable under hyperlaunch. Our intended approach to align the
> two implementations is one that is meant to be minimally disruptive, since
> dom0less is considered a supported (SUPPORT.md) capability. As mentioned, we
> are greatly appreciative to the openness to adopt the name,

Thanks Daniel!


> but a big concern
> I personally have is the confusion it could cause a general user. A blanket
> rename would end up with two documents in the docs tree that provide two
> different explanations of hyperlaunch and two different device tree
> definitions. So I think a more measured approach should be considered here.
>
> > If this patch makes things more difficult for the Hyperlunch serie, Iâ€™m ok
> > to drop it,
> > my only aim was just to find a less misleading name for the feature.
> 
> What I would like to suggest as a good first step would be an update to the
> dom0less document. Provide a note at the beginning that points to the
> hyperlaunch design doc as a more general approach that will eventually subsume
> dom0less. This would provide a gentler transition for exist users of dom0less.
> 
> If it is not too much, I would also ask, please have a look at the design for
> boot modules in the series Christopher just posted. The design pulls from the
> work done by dom0less and expanded upon it. I major step into merging the two
> capabilities will be to have a common set of structures. Once those are in
> place, we can move to a common device tree representation, and at that point
> we would be fairly close, if not at the point of a formal merger of between
> the two.

At the moment we have a concrete problem with explaining dom0less and
hyperlaunch to potential new users. Using two different names for a
similar feature on arm and x86 causes confusion. It is hurting Xen as a
solution. Personally I already had to switch to use the word
"hyperlaunch" for everything in my users-facing presentations.

At the summit, we discussed that it would be a good idea to use a single
name to refer to both features on arm and x86. Given that "dom0less"
causes additional issues because it makes people think that there is no
Dom0, the suggestion was to use "hyperlaunch" to refer to both features.

We don't need to 100% align the two implementations and data structures.
This is not for engineers that are going to look at the specifications
and improve them. This is for users/customers of Xen that are trying to
understand what the hypervisor enables them to do. We need to be able to
show users architecture slides with the same name and explanation on
both ARM and x86.

I am sure that Daniel and Christopher remember, but for the others on
this email thread, the name "hyperlaunch" was born exactly to be that:
the one name to cover both features on ARM and x86 even if they have a
different implementation. Appended an old email for reference.

Also I agree with Daniel that we need to be careful about the two docs
under docs/. I think he is right we need to add a paragraph explaining
the history and a pointer to the other document. Something like:

"Dom0less is the name that was used when initially introducing the
feature on ARM. Then, the "dom0less" name was retired in favor of
"hyperlaunch" to avoid confusion (a Dom0 might still be present) and to
align with x86 (where a similar feature was called hyperlaunch from the
start)."


---

Subject: [RFP] Overarching name for dom0less and DomB

Greetings,

At the DeviceTree/DomB meeting it was proposed that a new, larger
overarching name under which DomB and dom0less would be covered. There
was a general openness to the idea. As such, since Christopher and
myself are in the midst of finalizing the design document for DomB we
felt it might be better to see if a name could be selected which we
could use in the design doc in lieu of DomB. As always naming things is
hard, but after some brainstorming we believe we have arrived at a
decent name, Î¼Launch (micro-Launch or uLaunch).

---

Î¼Launch became hyperlaunch few days after, and the rest was history :-)
--8323329-457683244-1688403545=:246273--


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 17:52:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 17:52:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558128.871954 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGNin-0004Mp-4C; Mon, 03 Jul 2023 17:52:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558128.871954; Mon, 03 Jul 2023 17:52:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGNim-0004Mi-WE; Mon, 03 Jul 2023 17:52:21 +0000
Received: by outflank-mailman (input) for mailman id 558128;
 Mon, 03 Jul 2023 17:52:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Jtq2=CV=oracle.com=boris.ostrovsky@srs-se1.protection.inumbo.net>)
 id 1qGNil-0004Ma-5c
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 17:52:19 +0000
Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com
 [205.220.177.32]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 58eb6c18-19ca-11ee-b237-6b7b168915f2;
 Mon, 03 Jul 2023 19:52:17 +0200 (CEST)
Received: from pps.filterd (m0246630.ppops.net [127.0.0.1])
 by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 363G8E5O026238; Mon, 3 Jul 2023 17:52:06 GMT
Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com
 (phxpaimrmta03.appoci.oracle.com [138.1.37.129])
 by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rjajdb7ma-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Mon, 03 Jul 2023 17:52:06 +0000
Received: from pps.filterd
 (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1])
 by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19)
 with ESMTP id 363HY3B4004200; Mon, 3 Jul 2023 17:52:05 GMT
Received: from nam11-bn8-obe.outbound.protection.outlook.com
 (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169])
 by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id
 3rjak3v2uc-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Mon, 03 Jul 2023 17:52:05 +0000
Received: from BLAPR10MB5009.namprd10.prod.outlook.com (2603:10b6:208:321::10)
 by CO1PR10MB4785.namprd10.prod.outlook.com (2603:10b6:303:95::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul
 2023 17:52:03 +0000
Received: from BLAPR10MB5009.namprd10.prod.outlook.com
 ([fe80::2bb9:5d2e:a65b:e731]) by BLAPR10MB5009.namprd10.prod.outlook.com
 ([fe80::2bb9:5d2e:a65b:e731%7]) with mapi id 15.20.6544.026; Mon, 3 Jul 2023
 17:52:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 58eb6c18-19ca-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date :
 subject : to : cc : references : from : in-reply-to : content-type :
 content-transfer-encoding : mime-version; s=corp-2023-03-30;
 bh=28yXbymEz3ANKb2ikl9to739c0KzjJQ3hnl6I4urb7k=;
 b=o6QZNOWZlK4fsAiUHM99/qlpjjfUNWFidwwTGkUKITHFJ0eP9VGe6Tb/gFkNBc6knDF3
 lhvDcb6ZOObn8F7dk7Q6IDKIGRuZjFcSWd9zLkbvnJUc+/mA1Xl+t3LbcSyO9Q8Jr4iq
 beuMT//KprwybII7tmwnCuD76WGSYvlDmeJY51y7CWVnuxAdr5YmLS1uEL7A3lUAmpuo
 ZzHlsbzFU4NOIT7elSw7JbesFNxzq4IvNCwJTzogYrWb+6SiPfBq7qOwxMTz+dLkOiuD
 6U2X2Mji1hAVqEyfZR1tKn2e3kQeNSCrFAGgY0GqK6X7lby5tkusliod5CMJoUhvcW1/ 8Q== 
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Zg+ZPCLiM0B217EJNgtAvpOVtTxAqRq+5ZX90KTBw5ZmLuTFB4+Jau7pXbTLRQMFHm9h2BpnFGDvf8iOI4lH2qUZu1sRiwzzereG5g4xxigNPr7m6DTc/4OChzUlsvz1WO1JTtYsNkTNztCKXLE1sbBN6A4dlGAEOJmSuRrMATvakGErXCTnDhhhdGYyp4yWsxAmdzlKohxZK0EsWnJqT7kPfvVyulgjfv4IUVhd0IuWc9WiXyS/+uqWiXUZVI5Pz2DfV1OjmFjDcLGQqUERfy3xYzfuFwY/NGXX9bBVx2c3s6qwxRdburn/zf7ZH6Ho1ngtstreSWyFSapL++/uFQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=28yXbymEz3ANKb2ikl9to739c0KzjJQ3hnl6I4urb7k=;
 b=jzG5h95DKLqBuT3UFMQiX3CCZB0e3uXPRRa9/680J2M0L4wZiHr6iwcD7TRtlUlsMwh4tqZ5ipJG+bW8I7L8Bn6Xg3SssqR8MyVsd3sbvvqWEbTJWJCMLMfP+FnWzxn4K1CloHr07zZJ9YzXZbaXaZ8vxbl8tIoMt/M345z4ZyWW4WraglzJMxNLV/7F3pgp1+7v3q9Brs1LSNIJSXEOhfzBsv7r7cgm/6vFvGmjNqKWQ0X9ucAjxMjVygh75esSE+zvmMQ5rHssUHKt5wgkklcRGThs1EdvQ/1LVq3QSSxVR1yFHddgQctjU3+vGptOCwNoxtfC+sNUC50w8ytCVg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com;
 dkim=pass header.d=oracle.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=28yXbymEz3ANKb2ikl9to739c0KzjJQ3hnl6I4urb7k=;
 b=Hl9ICGe0g32ozp3bgND+VvyeiZkv4jKEx9DcjMvQWcvv/kx0moYoIbNhcnrTa3QrmtCh+UpPliJZY3wQ/Y7ruX/PbE9SHeik63+MLEoNHzXL6uZPLV3CpJclgHDbYHtAwJDdiDL2WLgRvFd6g3Empt1eesVQEhORLI9QCqKiWV4=
Message-ID: <573ce7fa-d64f-7351-b64d-01692fc87512@oracle.com>
Date: Mon, 3 Jul 2023 13:51:57 -0400
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH] x86/xen: fix secondary processor fpu initialization
Content-Language: en-US
To: Juergen Gross <jgross@suse.com>, linux-kernel@vger.kernel.org,
        x86@kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
        Borislav Petkov <bp@alien8.de>,
        Dave Hansen <dave.hansen@linux.intel.com>,
        "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org
References: <20230703130032.22916-1-jgross@suse.com>
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
In-Reply-To: <20230703130032.22916-1-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: BY5PR17CA0056.namprd17.prod.outlook.com
 (2603:10b6:a03:167::33) To BLAPR10MB5009.namprd10.prod.outlook.com
 (2603:10b6:208:321::10)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BLAPR10MB5009:EE_|CO1PR10MB4785:EE_
X-MS-Office365-Filtering-Correlation-Id: 7702ce34-46f3-4e5a-22a8-08db7bee352d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: 
	m11cW2g0hc0kCBB5yhI5xbY1nkPLFA9qxCfam4damnt/1sm581Z7lesRwEDLp7qUgFcIhrONmLgQUfyHIR0FvVwPJP82Y+M7Pifw/UgwCLIWn+1UhR4EQY3Bl9jWtmwyNV8dQHIXA92BV+baAzn/VJab+/4UudIy81ILkdp1nDNL1I0YEP3b0R/S4sF5UBx0dWtrQazLYFNmSDXjLB9Jd7I0Dl48quTpCeYRni5PlcULJR94nLitViHBax04QLH6hT6+8Q/7DgJAJ0VCwKfHuUICBtYJWC+LlqP+89cSRHVhP9u1pMZFFEpmw/Sy615FthK64jtsJRxG3mxWNVFRQ+3QDwM8VrU4bB96gpa4Zn7YOup6gT0x1FS1V2W9J8Rgiybb0wvH/ylbeyWNmLrkzn42Xs/Ybr9b8eAHSoZQ8gprsF792Q+vqHvyJunb8BeBi2sTrHEhzaNi/O1BSvUXF7Wrssq4yPMT3C2xmmDsHQjxtCIWy3VhltR7lwN+ISOvuNt5u9850SlQDXfrn0M+WGtmgcyqjn1hRpITR+c46b4s8w9+sR3ZG38ykR5EJXg0p+6sVJ6UsJMK+FtFIHUBrdJkZjM1Ug2CxoRyZErGic7cMCxJ4NFhFO50hfmaI+M+QtdFGMO6SbdPSHyCAPZEsw==
X-Forefront-Antispam-Report: 
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5009.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(39860400002)(396003)(376002)(136003)(346002)(451199021)(4744005)(2906002)(41300700001)(5660300002)(8676002)(8936002)(44832011)(36756003)(86362001)(31696002)(186003)(2616005)(31686004)(478600001)(26005)(6512007)(6506007)(6666004)(53546011)(6486002)(316002)(4326008)(66556008)(66946007)(38100700002)(54906003)(66476007)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: 
	=?utf-8?B?MXN6VzF5bVVwcVhpYktoZ042bEpkWWhvNlFCOStuWnNJRmZ2QUJsVUVnMExu?=
 =?utf-8?B?dmRJRFdldy9KY0VzTncybmtkMTdocFgwSkJlOU1ON2dJb0txZzNwVWRYSG9h?=
 =?utf-8?B?MXBkaVFuTWtOd0ZjeVo4L1lnd0xPWmFhMk5xRVFGek5yYXpCVHYySGhwS3Y1?=
 =?utf-8?B?dEtzL0VDSlhpVzRtY21TZjF3SWxuK2FUM1hFS2ZKVkd0MTZLZ3RwY3FmT1pB?=
 =?utf-8?B?L2RxMGJYTEtJQlU2c2N4T0xvK0d5UUFDK2huMlhaVnQ2R2Rtb0ZWd081UEFw?=
 =?utf-8?B?aUN2WllNaG81dUdLVkNRb2tHY2g5NVkrekNIOThOSTJkNmdKUmhuNGF5TTZ3?=
 =?utf-8?B?aThMWU1hYjBWajV1aWRGWDQrdmxIcVJOZ0pueDVReU1JWHlsaXRsNzhOVm9T?=
 =?utf-8?B?S080RVYwZHNJWjZtMEVBelNRTmNHbDc0SFpKdnpTa3RXWTFIOFVBdHVLMktD?=
 =?utf-8?B?Q1p3NnVSeUJmV1lrM2F4VGZVeDZ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pZVUpTZHVzdWhFOENaM29ZRG9rcXNncjJ4YUwwVk9GUEVzRXFCblJB?=
 =?utf-8?B?N2lseXBOejVGRUJvZiswZEduZ1ovV1ZpcEM4ZTl0WlZWZjhWLzFiM29LUm4y?=
 =?utf-8?B?cms1ZW90ei9nMHRXZWVtZWdCOCt4akVuZnBaQ2Fwa0F0NHJZdTRIYUZjQjRs?=
 =?utf-8?B?ZEw3bzROWTQwM2FnZ0ZGejhYOGU4YlRGbm1BZC9xWkNaRkJGTmw3TU51OFpu?=
 =?utf-8?B?K2VaSFVMc2gyakN0YWRzb2dSK2ltZkZDdWtNZUlCOW1sSTJsOEQ3VjJ5N3pt?=
 =?utf-8?B?aXpDUDAycm1XUW05aEd6aWhLUWttRHhRR3VuaTVNQ2d0bFpaVkc5SlBQQmI3?=
 =?utf-8?B?QXdSbkFJWTNVTTNOYnhYc1F2aS93N21Rb0lNb0xTaDFRaFJ5TjRhd3pjOEpH?=
 =?utf-8?B?YUdkVVdzdnhLaDlGdjFoREFNU25NRjJJUHplUmhGVEdDU1ltcUFiTGRob3J5?=
 =?utf-8?B?aU9NdzdablRzRXFpVGFZbU8vcDhnNlFKekErRlpqU3Q2ZVJORUVXNTU3cnpI?=
 =?utf-8?B?ckYzZ0J6eC9SYWc9PQ==?=
X-OriginatorOrg: oracle.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7702ce34-46f3-4e5a-22a8-08db7bee352d
X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5009.namprd10.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 17:52:03.0184
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: fYaZgw6LY/VcF9JsLQb8fhp+fjwPHJhG0KPihy5ChJWHzZenyHBC5SSTfCxlK8CpbpWYy0rNmmhSbeig9UDQkm11FZfSrMlRYs8UXjXcYII=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4785
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-03_13,2023-06-30_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 mlxlogscore=999 phishscore=0
 malwarescore=0 spamscore=0 bulkscore=0 suspectscore=0 adultscore=0
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000
 definitions=main-2307030161
X-Proofpoint-ORIG-GUID: vFqCnZoahiG2G0JeDYtrxbPHv_hRygQU
X-Proofpoint-GUID: vFqCnZoahiG2G0JeDYtrxbPHv_hRygQU



On 7/3/23 9:00 AM, Juergen Gross wrote:
> Moving the call of fpu__init_cpu() from cpu_init() to start_secondary()
> broke Xen PV guests, as those don't call start_secondary() for APs.
> 
> Fix that by adding the call of fpu__init_cpu() to cpu_bringup(), which
> is the Xen PV replacement of start_secondary().
> 
> Fixes: b81fac906a8f ("x86/fpu: Move FPU initialization into arch_cpu_finalize_init()")
> Signed-off-by: Juergen Gross <jgross@suse.com>


Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>



From xen-devel-bounces@lists.xenproject.org Mon Jul 03 19:44:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 19:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558133.871965 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGPTU-0007IL-20; Mon, 03 Jul 2023 19:44:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558133.871965; Mon, 03 Jul 2023 19:44:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGPTT-0007IE-TA; Mon, 03 Jul 2023 19:44:39 +0000
Received: by outflank-mailman (input) for mailman id 558133;
 Mon, 03 Jul 2023 19:44:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/H7X=CV=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qGPTS-0007I4-5Q
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 19:44:38 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0626.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::626])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 09f01297-19da-11ee-b237-6b7b168915f2;
 Mon, 03 Jul 2023 21:44:36 +0200 (CEST)
Received: from DUZPR01CA0261.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4b9::19) by DB4PR08MB9312.eurprd08.prod.outlook.com
 (2603:10a6:10:3f4::5) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul
 2023 19:44:24 +0000
Received: from DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4b9:cafe::16) by DUZPR01CA0261.outlook.office365.com
 (2603:10a6:10:4b9::19) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.30 via Frontend
 Transport; Mon, 3 Jul 2023 19:44:24 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT040.mail.protection.outlook.com (100.127.142.157) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.18 via Frontend Transport; Mon, 3 Jul 2023 19:44:23 +0000
Received: ("Tessian outbound d6c4ee3ba1eb:v142");
 Mon, 03 Jul 2023 19:44:23 +0000
Received: from f4023ad8879f.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 DA4C7E9A-C4CC-45B9-97E9-5F68945FFD08.1; 
 Mon, 03 Jul 2023 19:44:12 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f4023ad8879f.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Mon, 03 Jul 2023 19:44:12 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by DB9PR08MB7535.eurprd08.prod.outlook.com (2603:10a6:10:303::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul
 2023 19:44:08 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::ed0b:5730:a1f9:577b]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::ed0b:5730:a1f9:577b%5]) with mapi id 15.20.6544.024; Mon, 3 Jul 2023
 19:44:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 09f01297-19da-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=2kN++LO+K4u/TdNZ2jhD0vy7Ly0CMWt4p0+Myzk0pQ0=;
 b=GvzXsqooMjVW+qvWPQGAMCmwKgjHme2NJdavyM4fpU/sNXYotqfoVBeGFjyKvBcIhFXQUm6jPptFdGEDQbl+aFEOzpTS8hwVYdP7lNkBFHbdRXh1sednJB93n9LNXwDNHLAux6N0OSZJoERShK0JifTcSkL7S7LISY8yoAll+r0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: e63f5242fc9ae38b
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Gy0ZlVONJIOefrpCJOMyeUhvuDIsGz94s5vYj4DoC4wcAkkJgNURulcMYWQNE0AWCcTLYMjV/ukKpNNXWjhMifnCadNvcadDx7gbvNP2aP1joXzOY6rvnrs4v02ioMQSDn+V27x7uedn4jeK3BvtVHmJWf/D0YN0yD3NkZn1VXocD92VbHK92+90WATudHaY7dXZRjxavY+WuoiNZ7ta3mstkNjSzo/I0V05qVoQ2FvgJrizaxzUyUytADYLX6jzjIXg75vXY2VIyXJDUF8jjS0mGQojR2adqZK0He1s18cyJsGOeIiENMj0bpEF8tvTZhxzNow4WVNWg49sPFX45w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=2kN++LO+K4u/TdNZ2jhD0vy7Ly0CMWt4p0+Myzk0pQ0=;
 b=Nz1z/giKFIRF8NyIeURwPy0NQpxXi/36QuptBuo3oLNF4afhAWalg5Tp+ykQV08gjGEBsVKkPrs/G+bJU8YUHgJhbdeuAMewt6uXGUqSvl700TqaNmV1ESdsaEm1boyGM6R851nIN7SorCVcETIovIORR5sltKASTECzI4m6FIX0iy4CPooizoCR+YFC3do/W/JHIeYNNvFrFB6/+EfzooS1PJN+7x55EBeSiXXXtdUGuhEIYULsEIsIQBoACmIlvj6ws8PXiNtk99GAf1yiv0PW4ma12JN6Q/tpL1EI82Ex0ft+v/6PVH7v6gvZNK4UBI/CNqwhxqnZBM4P7PPsIQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=2kN++LO+K4u/TdNZ2jhD0vy7Ly0CMWt4p0+Myzk0pQ0=;
 b=GvzXsqooMjVW+qvWPQGAMCmwKgjHme2NJdavyM4fpU/sNXYotqfoVBeGFjyKvBcIhFXQUm6jPptFdGEDQbl+aFEOzpTS8hwVYdP7lNkBFHbdRXh1sednJB93n9LNXwDNHLAux6N0OSZJoERShK0JifTcSkL7S7LISY8yoAll+r0=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Stefano Stabellini <sstabellini@kernel.org>, "Daniel P. Smith"
	<dpsmith@apertussolutions.com>, Christopher Clark
	<christopher.w.clark@gmail.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Xen-devel
	<xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>, George Dunlap
	<george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, Julien Grall
	<julien@xen.org>, Wei Liu <wl@xen.org>, Henry Wang <Henry.Wang@arm.com>,
	Community Manager <community.manager@xenproject.org>, Doug Goldstein
	<cardoe@cardoe.com>, Bertrand Marquis <Bertrand.Marquis@arm.com>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>, Anthony PERARD
	<anthony.perard@citrix.com>
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
Thread-Topic: [RFC PATCH] xen/arm: Rebranding dom0less feature
Thread-Index: AQHZqzMUKP6yBnvUfEC1egkdxmuozK+ki8cAgAB66ACAAukxgIAAZuEAgAAgQQA=
Date: Mon, 3 Jul 2023 19:44:08 +0000
Message-ID: <8601CDD7-87F7-4FD0-A6E6-BAEAB12E7956@arm.com>
References: <20230630091210.3742121-1-luca.fancellu@arm.com>
 <6060dd00-5d9c-3804-4b9d-154b9b9dca49@citrix.com>
 <31FE51E0-0336-4756-8B30-6FE77DE10932@arm.com>
 <0c113f33-4410-aa75-84b7-c3ca860688f9@apertussolutions.com>
 <alpine.DEB.2.22.394.2307031048220.246273@ubuntu-linux-20-04-desktop>
In-Reply-To:
 <alpine.DEB.2.22.394.2307031048220.246273@ubuntu-linux-20-04-desktop>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|DB9PR08MB7535:EE_|DBAEUR03FT040:EE_|DB4PR08MB9312:EE_
X-MS-Office365-Filtering-Correlation-Id: 776d9609-8886-4fd0-0ea5-08db7bfde736
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 cG3RHMLqcfso/ZE1G/WIk+a+xRYleGvi+FChHiUJ9KNHa79A1PNcvPM/sAEzYiUKgKsiZJ9u8NZDrz1u99PTtQGWY9/Ufl3B4PQFeoB9vlUadUJLvdbCVmgIr6rOZ5tObM1U5PntOrwtJYXgvIwBkqEI3s5i0+FV3/ImNYpX9o2YPfrr6NFz1d9Xva+Mr19R1w+Lf0e2PunWHOVkAwuYZnkg4O1LKM9p8JlgRa5ojPN87pk31IWHF9QzP65ncmURE+LmE/RlWKIn5s7YBes0GH2J1rGPBXlxfBsnRWPpSOecEuC6zjdHML8bUb1+S/gl0fX8OSr7abxb0gNyord4n/+oaqjWO1+HIkpG4MBphpaYqfEeLwGYevGAEb4olpeUbX8ixnd9h89Q3Jlzkf7MtcMhlyYuODKQNgvxgpEE3dZoNqeSf1kXzu606ARwwf+trPmesv1/mO6j9Wyx5KH1qGJreUrJOA95ylVpcQLXy84r6iaBuaQ1A653WNIB1i9h7BT0wAMG3lu2nME/lpl2JNKInZF/Qlbvv/gphYyU94bsR1Pnqxsw0wvxxicEXmqwPwxnMljzN2UDEaF/haWJDSIl/jeo6Z3kuIC+KZxUav8pBv7bKk6A1RGmx2QrJiuGrMG3WCkAHkX8IHLWG0s7NhyMeIaHzklJULUUDfk4+KI=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(396003)(39860400002)(366004)(376002)(451199021)(26005)(478600001)(71200400001)(6506007)(6512007)(86362001)(2616005)(186003)(38100700002)(54906003)(4326008)(66946007)(66446008)(66556008)(66476007)(64756008)(83380400001)(110136005)(6486002)(53546011)(91956017)(76116006)(316002)(122000001)(5660300002)(8936002)(8676002)(7416002)(38070700005)(41300700001)(2906002)(33656002)(36756003)(32563001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <F61E11C4E7B85846958F339B76AC8BAE@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7535
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	0f7da99a-2d8d-4180-3fb2-08db7bfdde2e
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	i2030VVVvPvD8neoq6Ef6HaLwIzKlQ2SWJWeSwoYxMZ1mXvvLeorO1HRk1zptthMpP7HeJWo+fSTD1H3xonxWY4Kpn9lMLhh3St01y3GEJICgedyWzGCtGRWsBVDZIUsiNw24fYRWjHEmfLS1D0Vz8vs9usx/VgXLYujumlSdWuiloszKYXV/Mge10cvwuVYkvBJUCX+2Pe7/Dik53X8FxTrmFBtQbnUzz/m9SudGGAz/18Dtwbpr8tmyRupvct4a3XGMMrS/UmhUAAaRVDqSMk9DTk2H6hAiuge3JrbWpgVASyn2JhqCnIQEME5Kcz2RJAJYwkusx9Zi4DhU+iUgH/v6xGl9PDF/O9GM5p14yvxruDTJ9CLGnPUhySzaOJOJDqY6zefaG3V4R06IRDPOdp9aYtbvV7d86wRXCIjo49mp7dUZlmwjo6C66NfXjcJvD2mhJ3g+/Oi7xSpz76oCFsax5F06aSm0wVciK6G+mPkRytXR89HE1ih7td9km1wG6nt+A7QiDBco6KDrTyyJtv3NWvKk1IvXfPhmFZDR+VKtG53UX7akfQSBcjAFZR3xVZSxXZIifFbc7ID1pljkTbzLnk/6IjMRGiH5vLd3LiSNdW1TleoBskFAbwRO6CqvwMEDiJpoxYNy/N0CD3XVBWtK/gNStZUx2/ETpOtvhV/hhSKhNeL2xihZONWgMT7DP5oUMyIOIlrKFFB4rN8E9KZWWDiAccTw8jTmOiNwlVGAeU9mjoaOnVEbVizd7Ee50rDzA9naGn08ey5ipCgcw==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(346002)(136003)(376002)(451199021)(36840700001)(40470700004)(46966006)(54906003)(26005)(6512007)(186003)(53546011)(33656002)(86362001)(8676002)(36756003)(2906002)(110136005)(8936002)(6486002)(5660300002)(40460700003)(41300700001)(478600001)(107886003)(6506007)(81166007)(40480700001)(4326008)(70586007)(356005)(70206006)(82740400003)(47076005)(2616005)(83380400001)(336012)(82310400005)(316002)(36860700001)(32563001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 19:44:23.8922
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 776d9609-8886-4fd0-0ea5-08db7bfde736
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
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pbmcgbmFtZSB1bmRlciB3aGljaCBEb21CIGFuZCBk
b20wbGVzcyB3b3VsZCBiZSBjb3ZlcmVkLiBUaGVyZQ0KPiB3YXMgYSBnZW5lcmFsIG9wZW5uZXNz
IHRvIHRoZSBpZGVhLiBBcyBzdWNoLCBzaW5jZSBDaHJpc3RvcGhlciBhbmQNCj4gbXlzZWxmIGFy
ZSBpbiB0aGUgbWlkc3Qgb2YgZmluYWxpemluZyB0aGUgZGVzaWduIGRvY3VtZW50IGZvciBEb21C
IHdlDQo+IGZlbHQgaXQgbWlnaHQgYmUgYmV0dGVyIHRvIHNlZSBpZiBhIG5hbWUgY291bGQgYmUg
c2VsZWN0ZWQgd2hpY2ggd2UNCj4gY291bGQgdXNlIGluIHRoZSBkZXNpZ24gZG9jIGluIGxpZXUg
b2YgRG9tQi4gQXMgYWx3YXlzIG5hbWluZyB0aGluZ3MgaXMNCj4gaGFyZCwgYnV0IGFmdGVyIHNv
bWUgYnJhaW5zdG9ybWluZyB3ZSBiZWxpZXZlIHdlIGhhdmUgYXJyaXZlZCBhdCBhDQo+IGRlY2Vu
dCBuYW1lLCDOvExhdW5jaCAobWljcm8tTGF1bmNoIG9yIHVMYXVuY2gpLg0KPiANCj4gLS0tDQo+
IA0KPiDOvExhdW5jaCBiZWNhbWUgaHlwZXJsYXVuY2ggZmV3IGRheXMgYWZ0ZXIsIGFuZCB0aGUg
cmVzdCB3YXMgaGlzdG9yeSA6LSkNCg0KDQo=


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 19:49:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 19:49:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558139.871974 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGPY8-0007z4-MK; Mon, 03 Jul 2023 19:49:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558139.871974; Mon, 03 Jul 2023 19:49:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGPY8-0007yx-Iz; Mon, 03 Jul 2023 19:49:28 +0000
Received: by outflank-mailman (input) for mailman id 558139;
 Mon, 03 Jul 2023 19:49:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGPY7-0007yn-3s; Mon, 03 Jul 2023 19:49:27 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGPY6-0001Ek-R2; Mon, 03 Jul 2023 19:49:26 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGPY6-00026V-B3; Mon, 03 Jul 2023 19:49:26 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qGPY6-00082S-Ac; Mon, 03 Jul 2023 19:49:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=a8bNWrKle78e0CaxbzGMEe30rcVSRUzBE6715Gz368Q=; b=JTiidgByLArD8yjrk4HKShdpBk
	cMHvlKEI2f7wV44aP9bbh+qXq6DrpfLVPvwiKSjoMiJmtI4jT4C1asOLIuZHwl4pH760C8Zkt99vd
	Os0i/bquQnAdntxNAgExFS/BDReeewfbShcbHQH1LKyM64LMqyLwgsm56VM0ME6nALAs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181686-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181686: regressions - trouble: broken/fail/pass
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-vhd:<job status>:broken:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pygrub:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:debian-install:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl:debian-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:leak-check/basis/dst_host(19):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:build-arm64-pvops:kernel-build:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:freebsd-install:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:debian-di-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:windows-install:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:host-install(5):broken:heisenbug
    linux-linus:test-amd64-amd64-libvirt-qcow2:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-credit2:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-pygrub:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-credit1:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-rtds:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-qemuu-nested-amd:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/src_host:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-coresched-amd64-xl:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt-qcow2:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-xsm:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-credit2:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-freebsd11-amd64:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-multivcpu:debian-install:fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/dst_host:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-rtds:debian-install:fail:allowable
    linux-linus:test-arm64-arm64-xl-xsm:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-examine:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=a901a3568fd26ca9c4a82d8bc5ed5b3ed844d451
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 03 Jul 2023 19:49:26 +0000

flight 181686 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181686/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-vhd         <job status>                 broken
 test-amd64-amd64-qemuu-nested-amd 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-pygrub      11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt     12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  12 debian-install           fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 11 leak-check/basis(11) fail in 181682 REGR. vs. 180278
 test-amd64-amd64-xl          12 debian-install fail in 181682 REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 19 leak-check/basis/dst_host(19) fail in 181682 REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64 12 debian-hvm-install fail in 181682 REGR. vs. 180278
 build-arm64-pvops             6 kernel-build   fail in 181682 REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 11 leak-check/basis(11) fail in 181684 REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64 12 freebsd-install fail in 181684 REGR. vs. 180278
 test-amd64-amd64-xl-xsm      12 debian-install fail in 181684 REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd 12 debian-install fail in 181684 REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu 14 guest-start   fail in 181684 REGR. vs. 180278
 test-amd64-amd64-xl-credit2  12 debian-install fail in 181684 REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 12 debian-hvm-install fail in 181684 REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 12 debian-hvm-install fail in 181684 REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot       fail in 181684 REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2 12 debian-di-install fail in 181684 REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 12 windows-install fail in 181684 REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-vhd       5 host-install(5)          broken pass in 181684
 test-amd64-amd64-libvirt-qcow2 11 leak-check/basis(11) fail in 181682 pass in 181684
 test-amd64-amd64-xl-pvhv2-amd 11 leak-check/basis(11) fail in 181682 pass in 181684
 test-amd64-amd64-xl-credit2 11 leak-check/basis(11) fail in 181682 pass in 181684
 test-amd64-amd64-libvirt 11 leak-check/basis(11) fail in 181682 pass in 181686
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 11 leak-check/basis(11) fail in 181682 pass in 181686
 test-amd64-amd64-pygrub       8 xen-boot         fail in 181684 pass in 181686
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 8 xen-boot fail in 181684 pass in 181686
 test-amd64-amd64-xl-credit1 11 leak-check/basis(11) fail in 181684 pass in 181686
 test-amd64-amd64-xl-qemut-debianhvm-amd64 8 xen-boot fail in 181684 pass in 181686
 test-amd64-amd64-xl-rtds      8 xen-boot         fail in 181684 pass in 181686
 test-amd64-amd64-qemuu-nested-amd  8 xen-boot    fail in 181684 pass in 181686
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 8 xen-boot fail in 181684 pass in 181686
 test-amd64-amd64-libvirt-pair 12 xen-boot/src_host fail in 181684 pass in 181686
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot   fail pass in 181682
 test-amd64-amd64-xl          11 leak-check/basis(11)       fail pass in 181682
 test-amd64-amd64-xl-qemut-debianhvm-amd64 11 leak-check/basis(11) fail pass in 181682
 test-amd64-coresched-amd64-xl  8 xen-boot                  fail pass in 181682
 test-amd64-amd64-xl-qemut-ws16-amd64 11 leak-check/basis(11) fail pass in 181684
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 8 xen-boot fail pass in 181684
 test-amd64-amd64-libvirt-qcow2  8 xen-boot                 fail pass in 181684
 test-amd64-amd64-xl-xsm       8 xen-boot                   fail pass in 181684
 test-amd64-amd64-xl-pvhv2-amd  8 xen-boot                  fail pass in 181684
 test-amd64-amd64-xl-credit2   8 xen-boot                   fail pass in 181684
 test-amd64-amd64-xl-qemuu-ovmf-amd64 11 leak-check/basis(11) fail pass in 181684
 test-amd64-amd64-freebsd11-amd64 11 leak-check/basis(11)   fail pass in 181684
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 8 xen-boot fail pass in 181684
 test-amd64-amd64-xl-multivcpu 12 debian-install            fail pass in 181684
 test-amd64-amd64-libvirt-pair 13 xen-boot/dst_host         fail pass in 181684

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds     12 debian-install           fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-xl-xsm       1 build-check(1)           blocked in 181682 n/a
 test-arm64-arm64-xl-thunderx  1 build-check(1)           blocked in 181682 n/a
 test-arm64-arm64-xl-vhd       1 build-check(1)           blocked in 181682 n/a
 test-arm64-arm64-libvirt-xsm  1 build-check(1)           blocked in 181682 n/a
 test-arm64-arm64-xl           1 build-check(1)           blocked in 181682 n/a
 test-arm64-arm64-xl-credit2   1 build-check(1)           blocked in 181682 n/a
 test-arm64-arm64-libvirt-raw  1 build-check(1)           blocked in 181682 n/a
 test-arm64-arm64-examine      1 build-check(1)           blocked in 181682 n/a
 test-arm64-arm64-xl-credit1   1 build-check(1)           blocked in 181682 n/a
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                a901a3568fd26ca9c4a82d8bc5ed5b3ed844d451
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   78 days
Failing since        180281  2023-04-17 06:24:36 Z   77 days  151 attempts
Testing same since   181682  2023-07-02 19:42:58 Z    1 days    3 attempts

------------------------------------------------------------
3562 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      broken  
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-amd64-amd64-xl-vhd broken
broken-step test-amd64-amd64-xl-vhd host-install(5)

Not pushing.

(No revision log; it would be 574059 lines long.)


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 20:55:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 20:55:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558145.871984 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGQZY-0006q9-Cs; Mon, 03 Jul 2023 20:55:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558145.871984; Mon, 03 Jul 2023 20:55:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGQZY-0006q2-9X; Mon, 03 Jul 2023 20:55:00 +0000
Received: by outflank-mailman (input) for mailman id 558145;
 Mon, 03 Jul 2023 20:54: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
 <SRS0=sOBy=CV=gmail.com=pairspace@srs-se1.protection.inumbo.net>)
 id 1qGQZW-0006pd-Mp
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 20:54:58 +0000
Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com
 [2607:f8b0:4864:20::233])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dc140d6f-19e3-11ee-8611-37d641c3527e;
 Mon, 03 Jul 2023 22:54:54 +0200 (CEST)
Received: by mail-oi1-x233.google.com with SMTP id
 5614622812f47-3a04e5baffcso3751235b6e.3
 for <xen-devel@lists.xenproject.org>; Mon, 03 Jul 2023 13:54:54 -0700 (PDT)
Received: from smtpclient.apple ([37.19.200.149])
 by smtp.gmail.com with ESMTPSA id
 bi5-20020a056808188500b003a1ae2d2638sm4219671oib.7.2023.07.03.13.54.52
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 03 Jul 2023 13:54:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dc140d6f-19e3-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688417693; x=1691009693;
        h=to:in-reply-to:cc:references:message-id:date:subject:mime-version
         :from:content-transfer-encoding:from:to:cc:subject:date:message-id
         :reply-to;
        bh=RCbYV9OYll7/BSeuQPWCb5VB0AODorr/L/dKrHXMxBo=;
        b=KvyiQaJGJuxei8mlgbVL3xmpT/3hB51D4Biveo8Y2ILXzYXE4sMB/IejdFnEbskoVq
         T0xFsB45yq2dAfCCAE9IvC2NC28XsyYw19YDRaj9poC9bQv59LIN3FJxXaOakmyy7A4g
         0G1h935BB64aCrTUiNJq0jATI+WTO0NcIC/eHaN2tqNzC0h8Czjxk87cDINcX7//rfbE
         kwQmyaF6e/cPDkbbDvkCpcJWJQzRYtotNJOmlva5eA5J29Te9m7PFBRJ4c/exzblsh4i
         OlGKGadvTjYVCcwjvOTim3n+TtQPfBC+S7A2II/ylpRpC7xKy3yj3FJyuomq8025RbKW
         gV+Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688417693; x=1691009693;
        h=to:in-reply-to:cc:references:message-id:date:subject:mime-version
         :from:content-transfer-encoding:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=RCbYV9OYll7/BSeuQPWCb5VB0AODorr/L/dKrHXMxBo=;
        b=HgL06hh4GXZ88Q8hHzvVUU91jvh4gynBKuPRpN7HTa5BRHeAeo+OAV5t6CZ9d/oZqF
         a5Kh7wjbW/yQf+MqOkIvbZD3oZGvi6EAltwGeqUDzOaYSFM97J12ZkPkSGHJZkIE5dra
         tQ8p1YQVMetFeJGhAHsRfiU7z4ZLd3834LWyQ2dguj1ROCXWUXeXd/ZToHXzKAHvgaLh
         duBIciMKBAalHskT8EnDkZ6FmHtbxwLr0rQUDF/nmPJMpQ04v0PW0W83SBCgHe9mCP0H
         pPrDlk6Y04lXnuQ33//SaWagJBV+SS5xO3bxb4UJCea8z/jwLjGfGZB27hpg6g/MvKpM
         1B/Q==
X-Gm-Message-State: AC+VfDwIvZnmur4WHa7JRTEDRs/J5iu7XK5GCGURkoj3GZlMNnFtvxZt
	p5gpYZwX67ppRUq5O5yj/KY=
X-Google-Smtp-Source: ACHHUZ4TYuQerqjI+UQq0Oy5ny1hAlVQJoSkzLtwefRxwRQcHOV6O/WXlhGjet9++7yben+jyawQVw==
X-Received: by 2002:a54:4414:0:b0:3a3:6f53:e0f6 with SMTP id k20-20020a544414000000b003a36f53e0f6mr10055795oiw.45.1688417692977;
        Mon, 03 Jul 2023 13:54:52 -0700 (PDT)
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
From: P S <pairspace@gmail.com>
Mime-Version: 1.0 (1.0)
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
Date: Mon, 3 Jul 2023 16:54:40 -0400
Message-Id: <234199F8-DBB1-42B6-9A4C-8800EEF60997@gmail.com>
References: <8601CDD7-87F7-4FD0-A6E6-BAEAB12E7956@arm.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 Christopher Clark <christopher.w.clark@gmail.com>,
 Andrew Cooper <Andrew.Cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
 Henry Wang <Henry.Wang@arm.com>,
 Community Manager <community.manager@xenproject.org>,
 Doug Goldstein <cardoe@cardoe.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Anthony PERARD <anthony.perard@citrix.com>
In-Reply-To: <8601CDD7-87F7-4FD0-A6E6-BAEAB12E7956@arm.com>
To: Luca Fancellu <luca.fancellu@arm.com>
X-Mailer: iPad Mail (20F75)



> On Jul 3, 2023, at 15:45, Luca Fancellu <luca.fancellu@arm.com> wrote:
>=20
> =EF=BB=BF
>=20
>> On 3 Jul 2023, at 18:48, Stefano Stabellini <sstabellini@kernel.org> wrot=
e:
>>=20
>>> On Mon, 3 Jul 2023, Daniel P. Smith wrote:
>>> On 7/1/23 11:13, Luca Fancellu wrote:
>>>>> On 1 Jul 2023, at 08:53, Andrew Cooper <andrew.cooper3@citrix.com> wro=
te:
>>>>>=20
>>>>> On 30/06/2023 10:12 am, Luca Fancellu wrote:
>>>>>> The "dom0less" feature was intended to be the feature where a domU
>>>>>> domain could be launched without the control domain (Dom0)
>>>>>> intervention, however the name seems to suggest that Dom0 cannot
>>>>>> be part of the configuration, while instead it's a possible use case.=

>>>>>>=20
>>>>>> To avoid that, rename the "dom0less" configuration with the name
>>>>>> "hyperlaunch", that is less misleading.
>>>>>>=20
>>>>>> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
>>>>>> ---
>>>>>> This is an RFC to get the feeling of the community about the name
>>>>>> change, for now it's everything in one patch just to see how it
>>>>>> will look like, if there is interest on proceeding into it, I can
>>>>>> split in more commit.
>>>>>=20
>>>>> Have you discussed this with Dan and Chris at all?  You haven't even
>>>>> CC'd them.
>>>>=20
>>>> No, this rename idea started from a chat during the summit, anyway Juli=
en
>>>> promptly add them to the CC, because I forgot.
>>>=20
>>> No worries and thank you for considering and taking the time to do this R=
FC.
>>> It is greatly appreciated that there is a strong willingness to have dom=
0less
>>> and hyperlaunch merged.
>>>=20
>>>>>=20
>>>>> While there is a lot of end-goal in common between the dom0less and
>>>>> hyperlaunch, and that the name dom0less is deeply misleading,
>>>>> hyperlaunch is specifically not this.
>>>>=20
>>>> Yes Hyperlaunch is more than this, however as I said, with this RFC I w=
ould
>>>> like
>>>> to ear opinions, @Daniel @Christopher could it be a proper name for the=

>>>> dom0less
>>>> feature?
>>>=20
>>> As Andy has alluded, hyperlaunch is meant to provide a flexible means to=

>>> handle domain construction at boot to meet a wide range of possible use c=
ases.
>>> One of those use cases is dom0less, so yes, ultimately what dom0less doe=
s
>>> today will be achievable under hyperlaunch. Our intended approach to ali=
gn the
>>> two implementations is one that is meant to be minimally disruptive, sin=
ce
>>> dom0less is considered a supported (SUPPORT.md) capability. As mentioned=
, we
>>> are greatly appreciative to the openness to adopt the name,
>>=20
>> Thanks Daniel!
>>=20
>>=20
>>> but a big concern
>>> I personally have is the confusion it could cause a general user. A blan=
ket
>>> rename would end up with two documents in the docs tree that provide two=

>>> different explanations of hyperlaunch and two different device tree
>>> definitions. So I think a more measured approach should be considered he=
re.
>>>=20
>>>> If this patch makes things more difficult for the Hyperlunch serie, I=E2=
=80=99m ok
>>>> to drop it,
>>>> my only aim was just to find a less misleading name for the feature.
>>>=20
>>> What I would like to suggest as a good first step would be an update to t=
he
>>> dom0less document. Provide a note at the beginning that points to the
>>> hyperlaunch design doc as a more general approach that will eventually s=
ubsume
>>> dom0less. This would provide a gentler transition for exist users of dom=
0less.
>>>=20
>>> If it is not too much, I would also ask, please have a look at the desig=
n for
>>> boot modules in the series Christopher just posted. The design pulls fro=
m the
>>> work done by dom0less and expanded upon it. I major step into merging th=
e two
>>> capabilities will be to have a common set of structures. Once those are i=
n
>>> place, we can move to a common device tree representation, and at that p=
oint
>>> we would be fairly close, if not at the point of a formal merger of betw=
een
>>> the two.
>>=20
>> At the moment we have a concrete problem with explaining dom0less and
>> hyperlaunch to potential new users. Using two different names for a
>> similar feature on arm and x86 causes confusion. It is hurting Xen as a
>> solution. Personally I already had to switch to use the word
>> "hyperlaunch" for everything in my users-facing presentations.
>>=20
>> At the summit, we discussed that it would be a good idea to use a single
>> name to refer to both features on arm and x86. Given that "dom0less"
>> causes additional issues because it makes people think that there is no
>> Dom0, the suggestion was to use "hyperlaunch" to refer to both features.
>>=20
>> We don't need to 100% align the two implementations and data structures.
>> This is not for engineers that are going to look at the specifications
>> and improve them. This is for users/customers of Xen that are trying to
>> understand what the hypervisor enables them to do. We need to be able to
>> show users architecture slides with the same name and explanation on
>> both ARM and x86.
>>=20
>> I am sure that Daniel and Christopher remember, but for the others on
>> this email thread, the name "hyperlaunch" was born exactly to be that:
>> the one name to cover both features on ARM and x86 even if they have a
>> different implementation. Appended an old email for reference.
>>=20
>> Also I agree with Daniel that we need to be careful about the two docs
>> under docs/. I think he is right we need to add a paragraph explaining
>> the history and a pointer to the other document. Something like:
>>=20
>> "Dom0less is the name that was used when initially introducing the
>> feature on ARM. Then, the "dom0less" name was retired in favor of
>> "hyperlaunch" to avoid confusion (a Dom0 might still be present) and to
>> align with x86 (where a similar feature was called hyperlaunch from the
>> start)."
>=20
> I=E2=80=99m fully ok to add a section like this pointing to the Hyperlaunc=
h design.

_If_ this text is added, please include links/references to the Hyperlaunch w=
iki page and Hyperlaunch design docs.

> @Daniel and @Christopher would it be ok for you or the changes in the seri=
e
> are going to be problematic for your future work? In the end it=E2=80=99s j=
ust a mechanical
> rename, so I guess we just need to agree on naming conventions.

Please see the history of trademark litigation about the use of symbolic nam=
es to reference similar-but-different artifacts.  It is much easier to use t=
he same name to refer to entirely different objects. Historically, confusion=
 arises when a name is used in similar contexts.

There is also versioning.  Could we refer to dom0less as "Hyperlaunch Versio=
n -1"?=20

How about renaming dom0less to "Hyperlaunch Lite"?

Rich

> Cheers,
> Luca
>=20
>>=20
>>=20
>> ---
>>=20
>> Subject: [RFP] Overarching name for dom0less and DomB
>>=20
>> Greetings,
>>=20
>> At the DeviceTree/DomB meeting it was proposed that a new, larger
>> overarching name under which DomB and dom0less would be covered. There
>> was a general openness to the idea. As such, since Christopher and
>> myself are in the midst of finalizing the design document for DomB we
>> felt it might be better to see if a name could be selected which we
>> could use in the design doc in lieu of DomB. As always naming things is
>> hard, but after some brainstorming we believe we have arrived at a
>> decent name, =CE=BCLaunch (micro-Launch or uLaunch).
>>=20
>> ---
>>=20
>> =CE=BCLaunch became hyperlaunch few days after, and the rest was history :=
-)
>=20
>=20


From xen-devel-bounces@lists.xenproject.org Mon Jul 03 21:35:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Jul 2023 21:35:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558151.871994 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGRCS-0002u2-GM; Mon, 03 Jul 2023 21:35:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558151.871994; Mon, 03 Jul 2023 21:35:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGRCS-0002tv-D7; Mon, 03 Jul 2023 21:35:12 +0000
Received: by outflank-mailman (input) for mailman id 558151;
 Mon, 03 Jul 2023 21:35:11 +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
 <SRS0=uKsj=CV=durham.ac.uk=m.a.young@srs-se1.protection.inumbo.net>)
 id 1qGRCQ-0002tO-WE
 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2023 21:35:11 +0000
Received: from GBR01-CWL-obe.outbound.protection.outlook.com
 (mail-cwlgbr01on0704.outbound.protection.outlook.com
 [2a01:111:f400:fe14::704])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7b3beade-19e9-11ee-8611-37d641c3527e;
 Mon, 03 Jul 2023 23:35:08 +0200 (CEST)
Received: from LO4P265MB6510.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2e3::9)
 by CWLP265MB6049.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:1d2::14) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.28; Mon, 3 Jul
 2023 21:35:06 +0000
Received: from LO4P265MB6510.GBRP265.PROD.OUTLOOK.COM
 ([fe80::4194:3a0a:fe99:688b]) by LO4P265MB6510.GBRP265.PROD.OUTLOOK.COM
 ([fe80::4194:3a0a:fe99:688b%5]) with mapi id 15.20.6544.024; Mon, 3 Jul 2023
 21:35:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7b3beade-19e9-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=XQnY/7lZAsxwxYwJD0CNwOIdatVrHBaNJyNTQfXOxXvOBOnHEGnPrkQjcdMiH7mMkBuknubkqkJQux2qfp27yMmKGxYWqSEfJvzjTW/r6XkeZ91mKkQHlUNnTsosB0kqQXIOWA+DdJVtPaw+PDTiKV/7whlO4EFe7rnlIrP0NfevM5DgIzulmSHKiKSEtxRamcN9TkNE/nerDbmVX/JKza4RIVsSbhH2F0mfjcH7QwxILZMwEWuSCat8W1SSzSKKKDCZK09h87iesU5eCyZBTaj2AEhEUcac5HoqkUQt5hlWQXVOh4Kh7GDW/eUsf0UI4UdvsBBlLw783TjhqhM6MQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ErmgjoGgjac2N22Sjh2+rFJmPgFzQoO2T9EDJXceqgY=;
 b=Eb4wTEasYBjQR+MfWmrThUqV5/l96Pgp+nRVxgzO+ZkXsf0tN+WeENo+kzCewr7h9TnuYOAhAEfNl6yQNr06O3Lz1BHmdcAHXADTNcu6MAfU+dugXlEP+kIl5IRaC5pG6+BiMnoAV3Yw4UMToidQgE+TIfkr3FP8GWEjmHlhQFVBub1GLucacaPLkkkdyzEalx8CK4DyJi4DDu31BJPwQouB/9fRsZ4ytSZLaiDFeRDSqjdRa5qEx8mi5xRJ8CSI+/I8zBnjsSoojYkABVgsB1FuTsKrcC3RWeguEXPmW3jRNHtoNJq4ge3MM6R9La/UpDWjO9hX2CKuFwUpc8DayA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=durham.ac.uk; dmarc=pass action=none header.from=durham.ac.uk;
 dkim=pass header.d=durham.ac.uk; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=durhamuniversity.onmicrosoft.com;
 s=selector2-durhamuniversity-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ErmgjoGgjac2N22Sjh2+rFJmPgFzQoO2T9EDJXceqgY=;
 b=TA0Sbku1e/fCKP7m2u4D4bM932LJwWZ2wxFnx46q7sZqvQDGbHwj4EU5Dl/Nae5kUMbG3t7H21d/Ojc8H4Uy/6SO0089Usng+eKcZon2YMYUIDXbT6IrAwld1TU9l4PKNLJuDx0xWTDXT3yOsx3jbpPoGCofDSiYgE4wNnBhWnk=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=durham.ac.uk;
Date: Mon, 3 Jul 2023 22:35:04 +0100 (BST)
From: Michael Young <m.a.young@durham.ac.uk>
To: Christopher Clark <christopher.w.clark@gmail.com>
cc: xen-devel@lists.xenproject.org, 
    Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, 
    Luca Fancellu <luca.fancellu@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Rich Persaud <persaur@gmail.com>
Subject: Re: [PATCH 10/10] x86 setup: refactor efi, pvh and multiboot
 entrypoints to new boot info
In-Reply-To: <20230701071835.41599-11-christopher.w.clark@gmail.com>
Message-ID: <1cc9dc44-e8ce-1a87-b5b8-12e9b4beea35@durham.ac.uk>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com> <20230701071835.41599-11-christopher.w.clark@gmail.com>
Content-Type: text/plain; format=flowed; charset=US-ASCII
X-ClientProxiedBy: LO0P265CA0005.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:355::10) To LO4P265MB6510.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2e3::9)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: LO4P265MB6510:EE_|CWLP265MB6049:EE_
X-MS-Office365-Filtering-Correlation-Id: 3912cf9b-2c34-4294-030d-08db7c0d5df7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	NuSjRQkIJwFnZsHHeHCuB5OBvVdD4i4WEwHWsA1hOTx8wrHbpVHu9pBoksC1Phr5OC8WMUBBB/4ChWsFuQCZsyrZs6P5OeBznJ7Rp5JxbFGooMKHnJfA4lvD3Or5Y6/8sDWU8G8NDX77uE4Xu/k2ulQiJp+1WFQeWjHB1TegqQ1tad6mssvsE6K8Ikxsh6f08GZVyKhLKXODl5WXBjZnUba5TOpoxNaIJpzn92nCY3KJDqpjXOFnKcFzQOG+yLzivHAJde6NhNeBAA6VpwB2+GpmPpZHQ4aYUFBWrrz6kSa+jdCJ7btfncRw8P0gnwlzQ5Px/J7MEJ8ALIKMJslEShE7O3Y09ZTZF3ERaiZwjXOqnHhz2jxQEqICZRuM6VpX2jVn+VeSB/mpzKo1zxcV8AWuoEHP/6+A7AWlh1A0DPzu3gbMdJkdVSPQI4f09Ooljh0x9gfvDy45B5SY8gKjiXFzQwQRpOpe56dOYT4crUxc1RzwD3S8voIXXJQ+LbY1S7eRVdJ8XvEAxXpfT17/srrdGdoQPEFr3lok9uBvSW/jNyNuf5cqjgNefH9UTcCmVsMGWD1cwHI98JB8PKg0vZkGpqQ9bdHCx8AZ9GWzsyvk8+AJa+qrHYTRLGW8tiXu
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LO4P265MB6510.GBRP265.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(396003)(376002)(136003)(346002)(451199021)(2906002)(41300700001)(5660300002)(8676002)(8936002)(7416002)(36756003)(86362001)(31696002)(186003)(2616005)(478600001)(6512007)(6506007)(31686004)(6486002)(316002)(786003)(4326008)(6916009)(66476007)(66556008)(66946007)(38100700002)(54906003)(83380400001)(45980500001);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?KXSxlpXpFLMcgs4RyBHYNKYiRV5vBF0VUde0XeeDC8aVNii7riqonC3hLYHI?=
 =?us-ascii?Q?uo8AjgYaodm3BQqojoT5wU9rBhcf2u316paooAr00PR5JeHMEejttx2+nocj?=
 =?us-ascii?Q?1Lzyx68liaR9HM9v7KCFozM0p9RqSlBX3gxmVxj+W/PVN85vtj/MwtIKPTJN?=
 =?us-ascii?Q?cOIsxxVier3T6LqWLeti0hz8oBG/SFUl5e3dn1PFBHOwMmVgajSXew7PebCD?=
 =?us-ascii?Q?x5fo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7l9aOfIAC6QDhRuzydrZSojOK1swVEr67y2HeyGRmszU?=
 =?us-ascii?Q?pSty5p/Rdsg5m2aeTZly5nH7EwiHxysEuuMLBjhts+RuX/6R8UEbPQVHVD01?=
 =?us-ascii?Q?+DQcopmqrW67p5UIb3wMvl9M0qh2ZdINQ2yLj402TMakOtGXd3ffhJzhOTyU?=
 =?us-ascii?Q?Lu7EBhv2KOaDdFHmbr2haeLo8fdTpzPDd2VXcdst3KvRCR81ZVTQd14ENzV9?=
 =?us-ascii?Q?4oncVdTl887inJJRY9NfU3UqIl7z00S4ElO4ZWokC4p2VLBRHTA2uIy9HO+w?=
 =?us-ascii?Q?+9SZtX4kSo8IWQXAKTnLAwtIDponhB+R0RSYU5+zQ04AUT5bTBHlZeuC5Gu0?=
 =?us-ascii?Q?yV63rUvJrHgBZYY2hTrePSr/x4Gu1F7Nnfu6QYaQ/xa6OmJ2+mzCjzJod7Em?=
 =?us-ascii?Q?DyGUZ7bWx2qqJENQVOtTV2z+SAmI0xVYyqx8/HqgJ+En+YJ555tzmKYp16+w?=
 =?us-ascii?Q?cJ92MGJS7WmrRijY1waSR9pD4tqzpu4HmIrMXVzMFotDDRrI5rPxvWXIHs0R?=
 =?us-ascii?Q?/zbythgnEb+yzUooMR0XszTrRVKLD2+jZ3ibLISXgy8q?=
X-OriginatorOrg: durham.ac.uk
X-MS-Exchange-CrossTenant-Network-Message-Id: 3912cf9b-2c34-4294-030d-08db7c0d5df7
X-MS-Exchange-CrossTenant-AuthSource: LO4P265MB6510.GBRP265.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 21:35:05.8629
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7250d88b-4b68-4529-be44-d59a2d8a6f94
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: WWEa2DK1ekTvtgraYBtkaP/+BPGK4zuBBGY+Vj23oANIKwUZpWVMivqlpC+9hBHHw1XEUGzK5u+Yk5E9kYXNLA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWLP265MB6049

I was trying a test build with these patches and got the following error

In function 'mbi2_reloc',
     inlined from 'reloc' at arch/x86/boot/reloc.c:437:16:
arch/x86/boot/reloc.c:349:20: error: 'bi_mods' may be used uninitialized 
[-Werror=maybe-uninitialized]
   349 |             bi_mods[mod_idx].start = get_mb2_data(tag, module, 
mod_start);
       |                    ^
arch/x86/boot/reloc.c: In function 'reloc':
arch/x86/boot/reloc.c:237:25: note: 'bi_mods' was declared here
   237 |     struct boot_module *bi_mods;
       |                         ^~~~~~~
In file included from arch/x86/boot/reloc.c:29:
In function 'mbi2_reloc',
     inlined from 'reloc' at arch/x86/boot/reloc.c:437:16:
arch/x86/boot/reloc.c:365:43: error: 'arch_bi_mods' may be used 
uninitialized [-Werror=maybe-uninitialized]
   365 |             bi_mods[mod_idx].arch = _addr(&arch_bi_mods[mod_idx]);
arch/x86/boot/defs.h:47:46: note: in definition of macro '_addr'
    47 | #define _addr(val)  ((unsigned long)(void *)(val))
       |                                              ^~~
arch/x86/boot/reloc.c: In function 'reloc':
arch/x86/boot/reloc.c:238:29: note: 'arch_bi_mods' was declared here
   238 |     struct arch_bootmodule *arch_bi_mods;
       |                             ^~~~~~~~~~~~
cc1: all warnings being treated as errors

Is there a problem in the code?

 	Michael Young



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 03:04:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 03:04:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558157.872004 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGWKv-0001NB-KP; Tue, 04 Jul 2023 03:04:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558157.872004; Tue, 04 Jul 2023 03:04:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGWKv-0001N2-Ec; Tue, 04 Jul 2023 03:04:17 +0000
Received: by outflank-mailman (input) for mailman id 558157;
 Tue, 04 Jul 2023 03:04:17 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGWKu-0001Mq-VX; Tue, 04 Jul 2023 03:04:16 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGWKu-00023Z-KZ; Tue, 04 Jul 2023 03:04:16 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGWKu-0003Px-3U; Tue, 04 Jul 2023 03:04:16 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qGWKu-0007bs-34; Tue, 04 Jul 2023 03:04:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=xjP1LhyxfOy9nOP/noGwZ5mSzoj5B6DxHMaJMaIpwVI=; b=g3bwm01K5gGhEpHMiYgOqJ+8sg
	J35AagJ9AgwkvvxKCrWJP9RzDi4kWAQHqb54djQTnHt5v0XEZpRQXskbq3krB+HfvGD3IqPjbk7R1
	8JDVnaxP7/xeNJPmL9E8uowaX2KI44e2+VN9sp0WZD6ChLbc0kDr8aXK5F9pcCoLwpJU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181688-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181688: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-pygrub:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl:debian-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:debian-install:fail:allowable
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=0a8d6c9c7128a93689fba384cdd7f72b0ce19abd
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 04 Jul 2023 03:04:16 +0000

flight 181688 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181688/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-pygrub       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2  8 xen-boot               fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd 11 leak-check/basis(11)    fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-libvirt      8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu 14 guest-start             fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2  12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl          12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 12 xen-boot/src_host       fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 13 xen-boot/dst_host       fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds     12 debian-install           fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                0a8d6c9c7128a93689fba384cdd7f72b0ce19abd
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   78 days
Failing since        180281  2023-04-17 06:24:36 Z   77 days  152 attempts
Testing same since   181688  2023-07-03 20:11:28 Z    0 days    1 attempts

------------------------------------------------------------
3573 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 576994 lines long.)


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 05:43:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 05:43:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558163.872013 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGYoX-00018y-35; Tue, 04 Jul 2023 05:43:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558163.872013; Tue, 04 Jul 2023 05:43:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGYoX-00018r-0H; Tue, 04 Jul 2023 05:43:01 +0000
Received: by outflank-mailman (input) for mailman id 558163;
 Tue, 04 Jul 2023 05:43:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=KXt5=CW=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qGYoW-00018l-Bi
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 05:43:00 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a17b73e6-1a2d-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 07:42:58 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id A50972033E;
 Tue,  4 Jul 2023 05:42:57 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5787D1377F;
 Tue,  4 Jul 2023 05:42:57 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id cT3kE2Gxo2QyXgAAMHmgww
 (envelope-from <jgross@suse.com>); Tue, 04 Jul 2023 05:42:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a17b73e6-1a2d-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688449377; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=5NwuPs6s1tLTrj/NTRQSBFohPKNsbBrgq7cDUM/Uak0=;
	b=m9Km9mZhS2F9ZjGxYlpibsKVONF/cnBP+sjkMfAJ1EF0wct5Cz22mHvDxsOAAF2EOQFTig
	VZOgVXGochqhf/kAbmgJTk8fMerLOt+bz17uGVN0a62wupZoIpWnwcxitnOn7QVay+atXM
	IJ3FAxa9mbd/8sl9PAq/eWAXnRkMOi0=
Message-ID: <58f3bf1b-c5dd-7ac1-e765-7fa7eb0ba51b@suse.com>
Date: Tue, 4 Jul 2023 07:42:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH] x86/xen: fix secondary processor fpu initialization
Content-Language: en-US
To: linux-kernel@vger.kernel.org, x86@kernel.org,
 Borislav Petkov <bp@alien8.de>, Thomas Gleixner <tglx@linutronix.de>,
 Dave Hansen <dave.hansen@linux.intel.com>, Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org,
 Boris Ostrovsky <boris.ostrovsky@oracle.com>
References: <20230703130032.22916-1-jgross@suse.com>
 <573ce7fa-d64f-7351-b64d-01692fc87512@oracle.com>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <573ce7fa-d64f-7351-b64d-01692fc87512@oracle.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------Gw70l1b7G08YSUIj0nFX09au"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------Gw70l1b7G08YSUIj0nFX09au
Content-Type: multipart/mixed; boundary="------------vAlMdTjTE2SXGQIzESyPAfiN";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org, x86@kernel.org,
 Borislav Petkov <bp@alien8.de>, Thomas Gleixner <tglx@linutronix.de>,
 Dave Hansen <dave.hansen@linux.intel.com>, Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org,
 Boris Ostrovsky <boris.ostrovsky@oracle.com>
Message-ID: <58f3bf1b-c5dd-7ac1-e765-7fa7eb0ba51b@suse.com>
Subject: Re: [PATCH] x86/xen: fix secondary processor fpu initialization
References: <20230703130032.22916-1-jgross@suse.com>
 <573ce7fa-d64f-7351-b64d-01692fc87512@oracle.com>
In-Reply-To: <573ce7fa-d64f-7351-b64d-01692fc87512@oracle.com>

--------------vAlMdTjTE2SXGQIzESyPAfiN
Content-Type: multipart/mixed; boundary="------------z39WHiKNaxFZC80ifpMOBC5K"

--------------z39WHiKNaxFZC80ifpMOBC5K
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMDMuMDcuMjMgMTk6NTEsIEJvcmlzIE9zdHJvdnNreSB3cm90ZToNCj4gDQo+IA0KPiBP
biA3LzMvMjMgOTowMCBBTSwgSnVlcmdlbiBHcm9zcyB3cm90ZToNCj4+IE1vdmluZyB0aGUg
Y2FsbCBvZiBmcHVfX2luaXRfY3B1KCkgZnJvbSBjcHVfaW5pdCgpIHRvIHN0YXJ0X3NlY29u
ZGFyeSgpDQo+PiBicm9rZSBYZW4gUFYgZ3Vlc3RzLCBhcyB0aG9zZSBkb24ndCBjYWxsIHN0
YXJ0X3NlY29uZGFyeSgpIGZvciBBUHMuDQo+Pg0KPj4gRml4IHRoYXQgYnkgYWRkaW5nIHRo
ZSBjYWxsIG9mIGZwdV9faW5pdF9jcHUoKSB0byBjcHVfYnJpbmd1cCgpLCB3aGljaA0KPj4g
aXMgdGhlIFhlbiBQViByZXBsYWNlbWVudCBvZiBzdGFydF9zZWNvbmRhcnkoKS4NCj4+DQo+
PiBGaXhlczogYjgxZmFjOTA2YThmICgieDg2L2ZwdTogTW92ZSBGUFUgaW5pdGlhbGl6YXRp
b24gaW50byANCj4+IGFyY2hfY3B1X2ZpbmFsaXplX2luaXQoKSIpDQo+PiBTaWduZWQtb2Zm
LWJ5OiBKdWVyZ2VuIEdyb3NzIDxqZ3Jvc3NAc3VzZS5jb20+DQo+IA0KPiANCj4gUmV2aWV3
ZWQtYnk6IEJvcmlzIE9zdHJvdnNreSA8Ym9yaXMub3N0cm92c2t5QG9yYWNsZS5jb20+DQo+
IA0KDQp4ODYgbWFpbnRhaW5lcnMsIGNvdWxkIHRoaXMgcGxlYXNlIGdvIHRocm91Z2ggdGhl
IHRpcCB0cmVlPyBUaGUgcGF0Y2ggaXMNCmRlcGVuZGluZyBvbiBvdGhlciA2LjUgcGF0Y2hl
cyB3aGljaCB3ZW50IGluIHZpYSB0aXAuDQoNCg0KSnVlcmdlbg0K
--------------z39WHiKNaxFZC80ifpMOBC5K
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ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1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------z39WHiKNaxFZC80ifpMOBC5K--

--------------vAlMdTjTE2SXGQIzESyPAfiN--

--------------Gw70l1b7G08YSUIj0nFX09au
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSjsWAFAwAAAAAACgkQsN6d1ii/Ey96
owf/X5ApjLsFhOrNfLewRK+1nkdEKFhRd1kjNymIMz3R4KAfY4jJehV269qXMFoND6JqxGjsCn1z
a85JSXBG7Hs4Z9bW00eNObpWeLrCJfUio/s5SSaASN0F6yoJ6RRBDIH0kg67VbuNR/5MEWCjJEy5
ed9aOJS7mrgRkPAUu/KdhgTAkrGvWpembXDm3DDSIgv8YnEtzBw8Js9x0hHUdgQNq3jr5uhO1fV+
Lf0O8M5khNujTiaw9yBP9JRRENzvWIIVx1JfqHo+fhfMEuXxOLB048ytLkQbZHjCBuZb9/9PdoU8
q5aB0zhlLT0b9KZbOESIJoTMWQRkLNE9RwHiJitWBw==
=4DAt
-----END PGP SIGNATURE-----

--------------Gw70l1b7G08YSUIj0nFX09au--


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 06:25:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 06:25:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558169.872024 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGZTb-0005gz-CV; Tue, 04 Jul 2023 06:25:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558169.872024; Tue, 04 Jul 2023 06:25:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGZTb-0005gs-9c; Tue, 04 Jul 2023 06:25:27 +0000
Received: by outflank-mailman (input) for mailman id 558169;
 Tue, 04 Jul 2023 06:25:25 +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 <SRS0=KXt5=CW=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qGZTZ-0005gm-NJ
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 06:25:25 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8e3c3018-1a33-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 08:25:23 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 655C221FD5;
 Tue,  4 Jul 2023 06:25:22 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 28502133F7;
 Tue,  4 Jul 2023 06:25:22 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id yFN3CFK7o2QlcAAAMHmgww
 (envelope-from <jgross@suse.com>); Tue, 04 Jul 2023 06:25:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8e3c3018-1a33-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688451922; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=1qYP92va/e11rKWSltIXYM3dlSes1GmTJGZ6wryoMX4=;
	b=TUuaMWBGxuvaoFRIBs1rAuNC8sx6v8cuJ3oM8sRtjwBNbry8qnD9ictWPeYmIojVFOS9me
	qpslKGAZ6lP0/BNw48rLaQHOPkwLJvO1U+XfYLee0tZl/GVEI2oZp/ANxhSETwA1FP/sul
	mcfX8BV0HpCPVBvor6l7bcrlrgeTVHg=
Message-ID: <319b9f51-c833-49ef-f0e3-1fc5ddb8ae47@suse.com>
Date: Tue, 4 Jul 2023 08:25:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
Cc: Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 vikram.garhwal@amd.com
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
 <b21398eb-2fb2-4fca-dd90-d2c81d8df1c4@epam.com>
 <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------90RvH73Xi3vYjwiAKZs06GnN"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------90RvH73Xi3vYjwiAKZs06GnN
Content-Type: multipart/mixed; boundary="------------STn05AdcU5bge70lDfUXtYfY";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
Cc: Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 vikram.garhwal@amd.com
Message-ID: <319b9f51-c833-49ef-f0e3-1fc5ddb8ae47@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
 <b21398eb-2fb2-4fca-dd90-d2c81d8df1c4@epam.com>
 <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop>

--------------STn05AdcU5bge70lDfUXtYfY
Content-Type: multipart/mixed; boundary="------------W7OmSDerYdL9ey1DQ9qTYn1B"

--------------W7OmSDerYdL9ey1DQ9qTYn1B
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMzAuMDYuMjMgMDA6NDQsIFN0ZWZhbm8gU3RhYmVsbGluaSB3cm90ZToNCj4gT24gVGh1
LCAyOSBKdW4gMjAyMywgT2xla3NhbmRyIFR5c2hjaGVua28gd3JvdGU6DQo+PiBPbiAyOS4w
Ni4yMyAwNDowMCwgU3RlZmFubyBTdGFiZWxsaW5pIHdyb3RlOg0KPj4NCj4+IEhlbGxvIFN0
ZWZhbm8NCj4+DQo+Pj4gT24gV2VkLCAyMSBKdW4gMjAyMywgT2xla3NhbmRyIFR5c2hjaGVu
a28gd3JvdGU6DQo+Pj4+IE9uIDIxLjA2LjIzIDE2OjEyLCBQZXRyIFBhdmx1IHdyb3RlOg0K
Pj4+Pg0KPj4+Pg0KPj4+PiBIZWxsbyBQZXRyDQo+Pj4+DQo+Pj4+DQo+Pj4+PiBXaGVuIGF0
dGVtcHRpbmcgdG8gcnVuIFhlbiBvbiBhIFFFTVUvS1ZNIHZpcnR1YWwgbWFjaGluZSB3aXRo
IHZpcnRpbw0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1bmN0aW9uYWwgZm9yIGJvdGggUFYgYW5kIEhW
TSAqYW5kKiB0byBiZSBhYmxlDQo+PiB0byBzdXBwb3J0IGEgaG90cGx1Zy4gSUlSQywgdGhl
IHhlbnN0b3JlIGNvdWxkIGJlIGEgcG9zc2libGUgY2FuZGlkYXRlLg0KPiANCj4geGVuc3Rv
cmUgd291bGQgYmUgYW1vbmcgdGhlIGVhc2llc3QgdG8gbWFrZSB3b3JrLiBUaGUgb25seSBk
b3duc2lkZSBpcw0KPiB0aGUgZGVwZW5kZW5jeSBvbiB4ZW5zdG9yZSB3aGljaCBvdGhlcndp
c2UgdmlydGlvK2dyYW50cyBkb2Vzbid0IGhhdmUuDQoNCkknbSBpbiBmYXZvciBvZiB1c2lu
ZyB4ZW5zdG9yZS4gRXNwZWNpYWxseSB0aGUgaG90cGx1ZyBzdXBwb3J0IHdvdWxkIGJlDQpt
dWNoIGVhc2llciB1c2luZyB4ZW5zdG9yZSAodGhlIGFsdGVybmF0aXZlIHdvdWxkIGJlIEFD
UEksIHdoaWNoIEkgZG9uJ3QNCnRoaW5rIHdlIHdhbnQgZm9yIFBWIGd1ZXN0cyBvciBtYW55
IEFybSBjb25maWd1cmF0aW9ucykuDQoNCg0KSnVlcmdlbg0K
--------------W7OmSDerYdL9ey1DQ9qTYn1B
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvI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0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------W7OmSDerYdL9ey1DQ9qTYn1B--

--------------STn05AdcU5bge70lDfUXtYfY--

--------------90RvH73Xi3vYjwiAKZs06GnN
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSju1EFAwAAAAAACgkQsN6d1ii/Ey9Z
8gf8CZDmIy6ODm7xebD8YeeabCWV1Hcc9/xof/0/fUBQFOJaRi7b2LJXFqQuWchw63v3gRHsPZqj
RrdOup2UxFtYLC2ZQDsjBqvFW1tf/NXlaFC00KBfHQd4tez/zpTlt4Y0AEEt98vCdd4DTcibnn1i
VL2bzyABH8huZTbdkn8n2vOJJzdHTR87gJrUod886ppM6b/3IPom6Kxq0xjmM712s2/7lMv7Cwg7
NM62DVpOCfbFcgHMWaCAC9XI3ccwvicTV/rXWbhhjebPCJCT5GC8l3H2hYfYRWLxKng42GOyAzOv
gsazPRmy6/PwFe3aERrrxmirz2BerfA2uZ5uDLergA==
=rBab
-----END PGP SIGNATURE-----

--------------90RvH73Xi3vYjwiAKZs06GnN--


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 07:02:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 07:02:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558173.872034 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGa3R-0001cx-4X; Tue, 04 Jul 2023 07:02:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558173.872034; Tue, 04 Jul 2023 07:02:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGa3R-0001cq-19; Tue, 04 Jul 2023 07:02:29 +0000
Received: by outflank-mailman (input) for mailman id 558173;
 Tue, 04 Jul 2023 07:02:27 +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 <SRS0=KXt5=CW=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qGa3P-0001ck-Jq
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 07:02:27 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ba19e9a9-1a38-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 09:02:24 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 5E92B224C5;
 Tue,  4 Jul 2023 07:02:23 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1C182133F7;
 Tue,  4 Jul 2023 07:02:23 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 4NFmBf/Do2TKAQAAMHmgww
 (envelope-from <jgross@suse.com>); Tue, 04 Jul 2023 07:02:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ba19e9a9-1a38-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688454143; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=I2wmCXpl436Dp8ZP2JM7afvCQOhr1hfCC2vxh1ZCMho=;
	b=bn443TypRb0QJOcKUIKKDBJ9iTJpFltDCrtc+5qGKaxTKetUK7xwPl8YdC5TXKW5atUxYM
	XF89NTrHY0zxyeqHS0SZElzSum7Qx+ZiM1PDIgHWs5N+H51231BYHgHnCHrTiz7UOp3QSL
	WY6oBYdrHUb3H3DRJkYT5WX38FvyP94=
Message-ID: <0a05588e-68d3-1550-4c21-e282f4d66060@suse.com>
Date: Tue, 4 Jul 2023 09:02:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: Demi Marie Obenour <demi@invisiblethingslab.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Jan Beulich <JBeulich@suse.com>,
 Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Xen developer discussion <xen-devel@lists.xenproject.org>,
 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
 stable@vger.kernel.org
References: <20230627172216.1359-1-demi@invisiblethingslab.com>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v3] xen: speed up grant-table reclaim
In-Reply-To: <20230627172216.1359-1-demi@invisiblethingslab.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------MNrRNEu0Gn5vUM6zQYoVYHAv"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------MNrRNEu0Gn5vUM6zQYoVYHAv
Content-Type: multipart/mixed; boundary="------------B37XGpMk5E2SqDCYefhE8oq7";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Demi Marie Obenour <demi@invisiblethingslab.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Jan Beulich <JBeulich@suse.com>,
 Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Xen developer discussion <xen-devel@lists.xenproject.org>,
 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
 stable@vger.kernel.org
Message-ID: <0a05588e-68d3-1550-4c21-e282f4d66060@suse.com>
Subject: Re: [PATCH v3] xen: speed up grant-table reclaim
References: <20230627172216.1359-1-demi@invisiblethingslab.com>
In-Reply-To: <20230627172216.1359-1-demi@invisiblethingslab.com>

--------------B37XGpMk5E2SqDCYefhE8oq7
Content-Type: multipart/mixed; boundary="------------xtWTFltP0EaZv0PU6Wx3Xf2W"

--------------xtWTFltP0EaZv0PU6Wx3Xf2W
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjcuMDYuMjMgMTk6MjIsIERlbWkgTWFyaWUgT2Jlbm91ciB3cm90ZToNCj4gV2hlbiBh
IGdyYW50IGVudHJ5IGlzIHN0aWxsIGluIHVzZSBieSB0aGUgcmVtb3RlIGRvbWFpbiwgTGlu
dXggbXVzdCBwdXQNCj4gaXQgb24gYSBkZWZlcnJlZCBsaXN0LiAgTm9ybWFsbHksIHRoaXMg
bGlzdCBpcyB2ZXJ5IHNob3J0LCBiZWNhdXNlDQo+IHRoZSBQViBuZXR3b3JrIGFuZCBibG9j
ayBwcm90b2NvbHMgZXhwZWN0IHRoZSBiYWNrZW5kIHRvIHVubWFwIHRoZSBncmFudA0KPiBm
aXJzdC4gIEhvd2V2ZXIsIFF1YmVzIE9TJ3MgR1VJIHByb3RvY29sIGlzIHN1YmplY3QgdG8g
dGhlIGNvbnN0cmFpbnRzDQo+IG9mIHRoZSBYIFdpbmRvdyBTeXN0ZW0sIGFuZCBhcyBzdWNo
IHdpbmRzIHVwIHdpdGggdGhlIGZyb250ZW5kIHVubWFwcGluZw0KPiB0aGUgd2luZG93IGZp
cnN0LiAgQXMgYSByZXN1bHQsIHRoZSBsaXN0IGNhbiBncm93IHZlcnkgbGFyZ2UsIHJlc3Vs
dGluZw0KPiBpbiBhIG1hc3NpdmUgbWVtb3J5IGxlYWsgYW5kIGV2ZW50dWFsIFZNIGZyZWV6
ZS4NCj4gDQo+IFRvIHBhcnRpYWxseSBzb2x2ZSB0aGlzIHByb2JsZW0sIG1ha2UgdGhlIG51
bWJlciBvZiBlbnRyaWVzIHRoYXQgdGhlIFZNDQo+IHdpbGwgYXR0ZW1wdCB0byBmcmVlIGF0
IGVhY2ggaXRlcmF0aW9uIHR1bmFibGUuICBUaGUgZGVmYXVsdCBpcyBzdGlsbA0KPiAxMCwg
YnV0IGl0IGNhbiBiZSBvdmVycmlkZGVuIGF0IGNvbXBpbGUtdGltZSAodmlhIEtjb25maWcp
LCBib290LXRpbWUNCj4gKHZpYSBhIGtlcm5lbCBjb21tYW5kLWxpbmUgb3B0aW9uKSwgb3Ig
cnVudGltZSAodmlhIHN5c2ZzKS4NCg0KWW91IGFyZSBzdGlsbCBtZW50aW9uaW5nIEtjb25m
aWcuDQoNCkZvciB0aGUgc3lzZnMgZW50cnkgeW91IHNob3VsZCBhZGQgc29tZXRoaW5nIHVu
ZGVyIERvY3VtZW50YXRpb24vQUJJLiBTb3JyeQ0KSSBkaWRuJ3Qgc3BvdCB0aGlzIG9taXNz
aW9uIHByZXZpb3VzbHkuDQoNCg0KSnVlcmdlbg0K
--------------xtWTFltP0EaZv0PU6Wx3Xf2W
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8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6
AOODMBjgfWE9VeCgsrwH3exNAU32gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------xtWTFltP0EaZv0PU6Wx3Xf2W--

--------------B37XGpMk5E2SqDCYefhE8oq7--

--------------MNrRNEu0Gn5vUM6zQYoVYHAv
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSjw/4FAwAAAAAACgkQsN6d1ii/Ey86
+Qf7BVc79+MQbLa9SjzT0G9ygKhf8N61XHUt58BIVHzXuBPyl08NthIgPjR1XAkwDhjb9gk1TFTR
thYepMpEXviC9KuSUeNiVJ0Z64VobeQ2cCuyQ7r6MHWJSLZLtjXjH3/bXnEwXe03k0pZ3Qt0HM+1
aObCnEc26vVpbkc4tmU3W0OlZDq7w9QkVZG21qm8c+GSx3UYTQkfBE5/4s6gisF1+tDinDY0cif7
Nynh+/Ga+5bkhQ5EPHL3CXNZNtmRvzzA/SEWXAlHKEdH7JpQpwUskbzQqoBCWnk58U1np22t7VWt
qKPso3z45GZxSU6UYw8i6hMOjgi0SkEmiIVTXXvI4g==
=3vJC
-----END PGP SIGNATURE-----

--------------MNrRNEu0Gn5vUM6zQYoVYHAv--


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 07:49:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 07:49:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558179.872044 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGamg-0006As-Of; Tue, 04 Jul 2023 07:49:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558179.872044; Tue, 04 Jul 2023 07:49:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGamg-0006Al-KS; Tue, 04 Jul 2023 07:49:14 +0000
Received: by outflank-mailman (input) for mailman id 558179;
 Tue, 04 Jul 2023 07:49:13 +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
 <SRS0=bK4X=CW=citrix.com=prvs=5424eaebb=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qGame-0006Af-W5
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 07:49:13 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 41b22d16-1a3f-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 09:49:10 +0200 (CEST)
Received: from mail-mw2nam10lp2103.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.103])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 04 Jul 2023 03:49:02 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by PH0PR03MB6590.namprd03.prod.outlook.com (2603:10b6:510:bd::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 07:49:00 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902%7]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 07:49:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 41b22d16-1a3f-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688456949;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=WxKuljUVJZ+NeCazNlKEO+PnHvhTo0CW79MzopQi7mM=;
  b=FuU8ByiMPRrXYdYJdem+ZQF1vvqJPLlCqseJ2o28HFguuJU1USJZ5H8Z
   vTkss9OnzYr85s87q4YzpUdTBj3yt6AZTDM+OARTcWANMnPjytsrLDUk4
   bc54rO8133pcA8fdbWuE1ythexgN2/LVWMkCU/GTzaPpl9mYbOH1T1eaa
   I=;
X-IronPort-RemoteIP: 104.47.55.103
X-IronPort-MID: 114385826
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:lj+2NasM3pi0McIvwrKA+V1hZ+fnVMRfMUV32f8akzHdYApBsoF/q
 tZmKTjTO/iCamD2e4txPYjnpB8H68Pcx4RiQVdsqyg1EH4U+JbJXdiXEBz9bniYRiHhoOCLz
 O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQqIu
 Nfjy+XSI1bg0DNvWo4uw/vrRChH4rKq4Vv0gnRkPaoQ5ACGyyFPZH4iDfrZw0XQE9E88tGSH
 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9
 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG
 fMwKDsKfjaEvseMkaOBEq5jgu4Bc+u2BdZK0p1g5Wmx4fcOZ7nmGv2PwOACmTA6i4ZJAOrUY
 NcfZXx3dhPcbhZTO1ARTpUjgOOvgXq5eDpdwL6XjfNvvy6Pk0osjf60aIG9lt+iHK25mm6Co
 W3L5SLhCwwyP92D0zuVtHmrg4cjmAuiAd5JRODorKACbFu71mhNIQw5anKBv+SGmFPhacoPL
 BU49X97xUQ13AnxJjXnZDWju2KNtBMYX9tWEsU55RuLx66S5ByWbkAjSjNCc9UguNUBeS0x1
 lSJktXqAhRiqLSQD3ma89+8tT6uI24NJHEGeAcfUBAIpdLkpekbnh/JC9puDqOxptn0Ai3rh
 SCHqjAkgLcehtJN0L+0lXjDgjSxtt3KQxQz6wH/QG2o9EV6aZSjaoju7kLUhd5CI5yeVUKpp
 2Uflo6V6+VmJY+MlzaERaMCFaup+P+BGDTZjRhkGJxJyti203uqfIQV5S4kIk5sa54AYWWwO
 BSVvh5N7phOOnfsdbVwf4+6F8Uty+7nCMjhUffXKNFJZ/CdaTO6wc2nXmbIt0iFraTmufhX1
 UuzGSp0MUsnNA==
IronPort-HdrOrdr: A9a23:GbkrGaB4LG68f0XlHenP55DYdb4zR+YMi2TDtnoQdfUxSKelfq
 +V8cjzuSWftN9zYhAdcK67V5VoKEm0naKdirN8AV7NZmfbhFc=
X-Talos-CUID: =?us-ascii?q?9a23=3Aguv1EWkgD0+17tbxUQrb/4PDgH7XOX3Wy2f2JHa?=
 =?us-ascii?q?dMzd4cuXSRlu62vxGzvM7zg=3D=3D?=
X-Talos-MUID: 9a23:rv/wGwbH5Mxtz+BTpzuyrSBNC+5S/bmRGl1So41WvJCoOnkl
X-IronPort-AV: E=Sophos;i="6.01,180,1684814400"; 
   d="scan'208";a="114385826"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=noPbFuZq2gBGRC6Kwlu74kZYUK6JMkcvfl4XZlikXNlpbL+tMFhEy1tiQuTCIj/ZJhAFwxfEY7zqE5hVN/KHHtcIDfWWbdCnhfhi3nbr0lcbjRLcbnKEDWJ9bhNvIVdL3xQNmQ/Snam26G0Bx9avzd949kv0KP1+jJyPlX3oprx8eUJCUDVYRUYBShcLl98xlX/NNFbBtbsr6RJ2RgWQLl5NhqZN3kUITZhapA04zxKfSfnUgUqoaSWTR3uxU2D4jh157PGvYQEhVZ6vxDdyT/piOZnKAUA1IpyXPl8gKS8i3rab6kSOJpCke3i6swZSnH9qN2+Py0Aet6wvODhAFw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=rVM7JbmkIJt65OkIbFHrsl4m6lh9mPKw/yEp9eXztFk=;
 b=AB0QPEZOIOoitfUMG51E3o99wMRWIdODrQYEiE8jaOL2KccFefkurpviTs9Xv1rfTJr4RvKGTwNPrZZW3+yPlsc3a+CYJ33zLDOBz4dq0jamQKQgxQDfV4uHxbx3fImonMJqZ+5NzuJhHoPTpLLgfvZYMumnLi6D7hNfTYrhXa3ZGFnAKQeiVW2r3mQvqhCRC9txLDrCMd0x4CvPrlg21mbtCuACAHFthJsOl/LgzUWV8GUVovvXtrYqPajikUMQJ5lhnKcT/sJjMs9bB2SPDTR+mJp25OVyA5nqX4oDKFSZeYeLgVRPUeDo4g0rCTp6vd04+R37KY/FDgsvb7JcZQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=rVM7JbmkIJt65OkIbFHrsl4m6lh9mPKw/yEp9eXztFk=;
 b=Uldcv0RvLtbmYo823umlDPlQt5mjNxJxjssp+zhwI3yo7tCTnzBiLn7hWkysl2O5Cu0b/ixR0HKkWbKyXeYrw6MKqyI3/l1YIAwzIpIVaV8YKA32+hRDTpq2PmiL1QEz7hsIrcqSrLuZa48EKB3MlYfsiU1srD/SoQj3KVwR1IU=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Tue, 4 Jul 2023 09:48:53 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
	Petr Pavlu <petr.pavlu@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"jgross@suse.com" <jgross@suse.com>, vikram.garhwal@amd.com
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
Message-ID: <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
 <b21398eb-2fb2-4fca-dd90-d2c81d8df1c4@epam.com>
 <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop>
X-ClientProxiedBy: LO2P265CA0279.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:a1::27) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|PH0PR03MB6590:EE_
X-MS-Office365-Filtering-Correlation-Id: 7b2e5bb6-27a8-4058-fb47-08db7c6320ce
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	XPPMGRWwpxg19TNdXgrqP82zwiN3uB3xyd6xF72A3RoObCNVCJSS1l4z058NmJO2m1LeBdW171nX3I45M6MAQu6RNPmclEQ2OKBvdLgdCHJ76jJLTtHXEzYSsJVVuRk9+eeVGk/PGA3c/qLiP2QINABEdX0rcJiRvemwBs5urjruaer3caW10OWJtNOcRPFLbEZlLwYODGOS/Jl99uUnbBBJyp6CP9oEIlTi8NfVtzVOSh6OX8LlNOlg2xsF9Su/XYF74TIDF2XtSFIdjWwnvN8SkMJkuiS5KqvrEVP1jsY0EGjn1oQjlaSvNa2JE9xsycOPJqjUmpeJ5Bvfq2IMdz9KJ99ucovk3uuSq6vnUNpkq229OmUkjLZhPHQzium8eZfYLK7Sjy6xGIOu/S0e/gVVrqmHx5zmzh7RniOjkrCrGXXJboAG+zIWgpHRvwnwdpHkRLgyrfxVMquPYFDEsqkwMlfhlRAp3QYH/gmNG1PJNlqokYz3BEEkRLPi3/HHNR2x9SNs8YopslXjX9wj+0htX8Y/pA/932l+CgS8q7GFo8i7YoR5AEKh513KXOgu
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(396003)(136003)(39860400002)(346002)(376002)(451199021)(2906002)(41300700001)(8936002)(8676002)(85182001)(5660300002)(86362001)(186003)(478600001)(26005)(6506007)(6512007)(9686003)(6666004)(82960400001)(53546011)(6486002)(316002)(6916009)(66556008)(4326008)(66946007)(38100700002)(54906003)(66476007)(83380400001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?c3k2cEdYTGExdmE3R0Y1enBNakY1WHhTRW9vdDlzSCtnNU1SbGovZnBEb1pi?=
 =?utf-8?B?Y2FpVzF5N1FiL3RaMDFrRWx3U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Hp38NzXZ+ZJhJGOUeATAW83Jcg60VG59gXJ3wkzEqWT9qqsfNx2xF4dV9gfTLz+DJQsljMnMNE2Rnw66M3JSL1IQCbhSHWwVMkHTLkdzPGKGbho7pqmo94YmonokpPmADQO5hcdMkCPAUjf7JUJGsRlUsyznRWnkKvj2nMuBFwLaTe3FyvHUiS+jcMDZWN3OLQolhKqVf1tdYnuEFv80vIiESb2ZDDa5UuOMHIIdiq/cQdFR1v3HqqNy4TbSW1OpbZemOVrzJljB7TknyHGKP+ObvlGfqBEId1GWXcS+HwEnwTBuUjumVYa/SuJHH/9DRI0I=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7b2e5bb6-27a8-4058-fb47-08db7c6320ce
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 07:49:00.0683
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: /tL/1gYU9NmIv1ItM1+6V9i3uMXtQZHkb5cQhsUh1MqwsJhdncuSe+jGbez7ze6XRYybNBlrSbksd0sL+pS/lw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB6590

On Thu, Jun 29, 2023 at 03:44:04PM -0700, Stefano Stabellini wrote:
> On Thu, 29 Jun 2023, Oleksandr Tyshchenko wrote:
> > On 29.06.23 04:00, Stefano Stabellini wrote:
> > > I think we need to add a second way? It could be anything that can help
> > > us distinguish between a non-grants-capable virtio backend and a
> > > grants-capable virtio backend, such as:
> > > - a string on xenstore
> > > - a xen param
> > > - a special PCI configuration register value
> > > - something in the ACPI tables
> > > - the QEMU machine type
> > 
> > 
> > Yes, I remember there was a discussion regarding that. The point is to 
> > choose a solution to be functional for both PV and HVM *and* to be able 
> > to support a hotplug. IIRC, the xenstore could be a possible candidate.
> 
> xenstore would be among the easiest to make work. The only downside is
> the dependency on xenstore which otherwise virtio+grants doesn't have.

I would avoid introducing a dependency on xenstore, if nothing else we
know it's a performance bottleneck.

We would also need to map the virtio device topology into xenstore, so
that we can pass different options for each device.

> Vikram is working on virtio with grants support in QEMU as we speak.
> Maybe we could find a way to add a flag in QEMU so that we can detect at
> runtime if a given virtio device support grants or not.

Isn't there a way for the device to expose capabilities already?  For
example how does a virtio-blk backend expose support for indirect
descriptors?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 09:29:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 09:29:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558189.872054 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGcLd-0000HZ-4a; Tue, 04 Jul 2023 09:29:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558189.872054; Tue, 04 Jul 2023 09:29:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGcLd-0000HS-1G; Tue, 04 Jul 2023 09:29:25 +0000
Received: by outflank-mailman (input) for mailman id 558189;
 Tue, 04 Jul 2023 09:29:24 +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
 <SRS0=vvOH=CW=citrix.com=prvs=5429f199a=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qGcLc-0000Gl-Bk
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 09:29:24 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 409f4fbf-1a4d-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 11:29:20 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 409f4fbf-1a4d-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688462960;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=ecB0iOwB6Af2HwnYBz9C/QeRWz5MlTffw9iyZWO+Nps=;
  b=S3W5qaS/OxruHi/jR99ZIjKdydGX7Tt88HMSzRPKXNway+rgIuFpssqq
   O0GXdPYmkFLDuId5WgT4rZVEjMRv0M9Ye4ela9XQOvsi9JzpeJQQzdlHE
   0bF091M1JQITelA7UKFh92XeNs2+Mu1TZr+Vv91253RnDqo+ISF2Mgmc8
   c=;
Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 117657058
X-Ironport-Server: esa4.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:9ecr0qynbHgdTSVdkZJ6t+dNxirEfRIJ4+MujC+fZmUNrF6WrkUHz
 GodCmGBPauIZG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N90iNqtr1w
 w==
IronPort-HdrOrdr: A9a23:KUMiE6G8N667OOz1pLqEU8eALOsnbusQ8zAXPo5KKCC9Ffbo8f
 xG/c5rsiMc7Qx6ZJhOo7290cW7LU80sKQFgrX409+ZLXXbUSiTXfxfBbKL+UyeJ8SGzJ8i6U
 4DSchD4azLfDxHZJ3BkXCF+r8bqbHtzEnrv5a9854Kd25XgspbnmJE42igfHGebTM2dKYRJd
 6z5tdnuzHlQngedMK9b0N1JdTrlpnklI/GfRVDPBIs6BCPgTS0gYSKaCSw71MxUy5v3bxnym
 TOkxX46qK/99m3xwTRzXW71eUnpPLRjvVCGe2RgYwuJjLghh3AXvUYZ4G/
X-Talos-CUID: 9a23:t9UWiW1elbo3D2Z3OhY2A7xfGcw5T3D21izsBGyZOGZXd6OIUF2h0fYx
X-Talos-MUID: 9a23:lx/+yQvPwams6IWb9s2n2yk9KMtR4Z6VI1EXtc4sm+yYLDxMNGLI
X-IronPort-AV: E=Sophos;i="6.01,180,1684814400"; 
   d="scan'208";a="117657058"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
	<JBeulich@suse.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>
Subject: [PATCH v2] xen: Correct comments after renaming xen_{dom,sys}ctl_cpu_policy fields
Date: Tue, 4 Jul 2023 10:29:09 +0100
Message-ID: <20230704092909.3635899-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20230629102600.61262-1-andrew.cooper3@citrix.com>
References: <20230629102600.61262-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

Fixes: 21e3ef57e040 ("x86: Rename {domctl,sysctl}.cpu_policy.{cpuid,msr}_policy fields")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>

v2:
 * Fix domctl too.
---
 xen/include/public/domctl.h |  6 ++----
 xen/include/public/sysctl.h | 10 ++++------
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index e2e22cb534d6..a33f9ec32b08 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -679,10 +679,8 @@ struct xen_domctl_set_target {
  * Query or set the CPUID and MSR policies for a specific domain.
  */
 struct xen_domctl_cpu_policy {
-    uint32_t nr_leaves; /* IN/OUT: Number of leaves in/written to
-                         * 'cpuid_policy'. */
-    uint32_t nr_msrs;   /* IN/OUT: Number of MSRs in/written to
-                         * 'msr_policy' */
+    uint32_t nr_leaves; /* IN/OUT: Number of leaves in/written to 'leaves' */
+    uint32_t nr_msrs;   /* IN/OUT: Number of MSRs in/written to 'msrs' */
     XEN_GUEST_HANDLE_64(xen_cpuid_leaf_t) leaves; /* IN/OUT */
     XEN_GUEST_HANDLE_64(xen_msr_entry_t)  msrs;   /* IN/OUT */
 
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 9d06e92d0f6a..33e86ace5140 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -1047,12 +1047,10 @@ struct xen_sysctl_cpu_policy {
 #define XEN_SYSCTL_cpu_policy_pv_default   4
 #define XEN_SYSCTL_cpu_policy_hvm_default  5
     uint32_t index;       /* IN: Which policy to query? */
-    uint32_t nr_leaves;   /* IN/OUT: Number of leaves in/written to
-                           * 'cpuid_policy', or the maximum number of leaves
-                           * if the guest handle is NULL. */
-    uint32_t nr_msrs;     /* IN/OUT: Number of MSRs in/written to
-                           * 'msr_policy', or the maximum number of MSRs if
-                           * the guest handle is NULL. */
+    uint32_t nr_leaves;   /* IN/OUT: Number of leaves in/written to 'leaves',
+                           * or the max number if 'leaves' is NULL. */
+    uint32_t nr_msrs;     /* IN/OUT: Number of MSRs in/written to 'msrs', or
+                           * the max number of if 'msrs' is NULL. */
     uint32_t _rsvd;       /* Must be zero. */
     XEN_GUEST_HANDLE_64(xen_cpuid_leaf_t) leaves; /* OUT */
     XEN_GUEST_HANDLE_64(xen_msr_entry_t)  msrs;   /* OUT */
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 09:35:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 09:35:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558194.872063 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGcRQ-0001lu-Oj; Tue, 04 Jul 2023 09:35:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558194.872063; Tue, 04 Jul 2023 09:35:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGcRQ-0001ln-Kz; Tue, 04 Jul 2023 09:35:24 +0000
Received: by outflank-mailman (input) for mailman id 558194;
 Tue, 04 Jul 2023 09:35:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGcRP-0001lf-Lg
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 09:35:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGcRO-0003Fv-8L; Tue, 04 Jul 2023 09:35:22 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGcRO-0003v9-0j; Tue, 04 Jul 2023 09:35:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=RysJKHX805si3y8duGvxE6FJG8/oDUeDZbBQ5KU+Eyg=; b=vptPXrl9TfUUghBuv8/BcgVsmJ
	G9h+D3vrjZ1yD0CuBQ3rqAdKZgUvmS8iH5acZtqpCieBYkvcbpp0qBcQBhibFURj+U+FFvZ8Agizs
	5aX/uhpC1QULMNxmRGJapIURMGj/kNpEPytrYi9/swQ0ASVC4LbsFS12a5RFeeYmG8+w=;
Message-ID: <855fd25d-07bb-0b08-4c25-75e652c142a6@xen.org>
Date: Tue, 4 Jul 2023 10:35:19 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v4 4/7] iommu/arm: Introduce iommu_add_dt_pci_sideband_ids
 API
Content-Language: en-US
To: Stewart Hildebrand <stewart.hildebrand@amd.com>,
 xen-devel@lists.xenproject.org
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Jan Beulich
 <jbeulich@suse.com>, Paul Durrant <paul@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Rahul Singh <rahul.singh@arm.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>
References: <20230607030220.22698-1-stewart.hildebrand@amd.com>
 <20230607030220.22698-5-stewart.hildebrand@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230607030220.22698-5-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 07/06/2023 04:02, Stewart Hildebrand wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 
> The main purpose of this patch is to add a way to register PCI device
> (which is behind the IOMMU) using the generic PCI-IOMMU DT bindings [1]
> before assigning that device to a domain.
> 
> This behaves similarly to the existing iommu_add_dt_device API, except it
> handles PCI devices, and it is to be invoked from the add_device hook in the
> SMMU driver.
> 
> The function of_map_id to translate an ID through a downstream mapping

You called the function dt_map_id in Xen.

> (which is also suitable for mapping Requester ID) was borrowed from Linux
> (v5.10-rc6) and updated according to the Xen code base.
> 
> [1] https://www.kernel.org/doc/Documentation/devicetree/bindings/pci/pci-iommu.txt
> 
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
> ---
> v3->v4:
> * wrap #include <asm/acpi.h> and if ( acpi_disabled ) in #ifdef CONFIG_ACPI
> * fix Michal's remarks about style, parenthesis, and print formats
> * remove !ops->dt_xlate check since it is already in iommu_dt_xlate helper
> * rename s/iommu_dt_pci_map_id/dt_map_id/ because it is generic, not specific
>    to iommu
> * update commit description
> 
> v2->v3:
> * new patch title (was: iommu/arm: Introduce iommu_add_dt_pci_device API)
> * renamed function
>    from: iommu_add_dt_pci_device
>    to: iommu_add_dt_pci_sideband_ids
> * removed stale ops->add_device check
> * iommu.h: add empty stub iommu_add_dt_pci_sideband_ids for !HAS_DEVICE_TREE
> * iommu.h: add iommu_add_pci_sideband_ids helper
> * iommu.h: don't wrap prototype in #ifdef CONFIG_HAS_PCI
> * s/iommu_fwspec_free(pci_to_dev(pdev))/iommu_fwspec_free(dev)/
> 
> v1->v2:
> * remove extra devfn parameter since pdev fully describes the device
> * remove ops->add_device() call from iommu_add_dt_pci_device(). Instead, rely on
>    the existing iommu call in iommu_add_device().
> * move the ops->add_device and ops->dt_xlate checks earlier
> 
> downstream->v1:
> * rebase
> * add const qualifier to struct dt_device_node *np arg in dt_map_id()
> * add const qualifier to struct dt_device_node *np declaration in iommu_add_pci_device()
> * use stdint.h types instead of u8/u32/etc...
> * rename functions:
>    s/dt_iommu_xlate/iommu_dt_xlate/
>    s/dt_map_id/iommu_dt_pci_map_id/
>    s/iommu_add_pci_device/iommu_add_dt_pci_device/
> * add device_is_protected check in iommu_add_dt_pci_device
> * wrap prototypes in CONFIG_HAS_PCI
> 
> (cherry picked from commit 734e3bf6ee77e7947667ab8fa96c25b349c2e1da from
>   the downstream branch poc/pci-passthrough from
>   https://gitlab.com/xen-project/people/bmarquis/xen-arm-poc.git)
> ---
>   xen/drivers/passthrough/device_tree.c | 134 ++++++++++++++++++++++++++
>   xen/include/xen/device_tree.h         |  25 +++++
>   xen/include/xen/iommu.h               |  22 ++++-
>   3 files changed, 180 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/drivers/passthrough/device_tree.c b/xen/drivers/passthrough/device_tree.c
> index ff9e66ebf92a..bd0aed5df651 100644
> --- a/xen/drivers/passthrough/device_tree.c
> +++ b/xen/drivers/passthrough/device_tree.c
> @@ -154,6 +154,140 @@ static int iommu_dt_xlate(struct device *dev,
>       return ops->dt_xlate(dev, iommu_spec);
>   }
>   
> +#ifdef CONFIG_HAS_PCI

The code below doesn't seem to be specific to PCI.

> +int dt_map_id(const struct dt_device_node *np, uint32_t id,
> +              const char *map_name, const char *map_mask_name,
> +              struct dt_device_node **target, uint32_t *id_out)

AFAICT, this function can also be used outside of the IOMMU code. So 
shouldn't this be implemented in common/device_tree.c?


> +{
> +    uint32_t map_mask, masked_id, map_len;
> +    const __be32 *map = NULL;
> +
> +    if ( !np || !map_name || (!target && !id_out) )
> +        return -EINVAL;
> +
> +    map = dt_get_property(np, map_name, &map_len);
> +    if ( !map )
> +    {
> +        if ( target )
> +            return -ENODEV;
> +
> +        /* Otherwise, no map implies no translation */
> +        *id_out = id;
> +        return 0;
> +    }
> +
> +    if ( !map_len || (map_len % (4 * sizeof(*map))) )
> +    {
> +        printk(XENLOG_ERR "%s: Error: Bad %s length: %u\n", np->full_name,
> +               map_name, map_len);

I think it would be helpful if you add the function name in the error 
message.

> +        return -EINVAL;
> +    }
> +
> +    /* The default is to select all bits. */
> +    map_mask = 0xffffffff;

Please add a U. That said, I would switch to GENMASK(31, 0) so it is 
easier to check the value.

> +
> +    /*
> +     * Can be overridden by "{iommu,msi}-map-mask" property.
> +     * If df_property_read_u32() fails, the default is used.

s/df/dt/

> +     */
> +    if ( map_mask_name )
> +        dt_property_read_u32(np, map_mask_name, &map_mask);
> +
> +    masked_id = map_mask & id;
> +    for ( ; (int)map_len > 0; map_len -= 4 * sizeof(*map), map += 4 )

Why do you cast map_len to 'int'?

> +    {
> +        struct dt_device_node *phandle_node;
> +        uint32_t id_base = be32_to_cpup(map + 0);
> +        uint32_t phandle = be32_to_cpup(map + 1);
> +        uint32_t out_base = be32_to_cpup(map + 2);
> +        uint32_t id_len = be32_to_cpup(map + 3);
> +
> +        if ( id_base & ~map_mask )
> +        {
> +            printk(XENLOG_ERR "%s: Invalid %s translation - %s-mask (0x%"PRIx32") ignores id-base (0x%"PRIx32")\n",
> +                   np->full_name, map_name, map_name, map_mask, id_base);

Same here about adding the function name.

> +            return -EFAULT;
> +        }
> +
> +        if ( (masked_id < id_base) || (masked_id >= (id_base + id_len)) )
> +            continue;
> +
> +        phandle_node = dt_find_node_by_phandle(phandle);
> +        if ( !phandle_node )
> +            return -ENODEV;
> +
> +        if ( target )
> +        {
> +            if ( !*target )
> +                *target = phandle_node;
> +
> +            if ( *target != phandle_node )
> +                continue;
> +        }
> +
> +        if ( id_out )
> +            *id_out = masked_id - id_base + out_base;
> +
> +        printk(XENLOG_DEBUG "%s: %s, using mask %08"PRIx32", id-base: %08"PRIx32", out-base: %08"PRIx32", length: %08"PRIx32", id: %08"PRIx32" -> %08"PRIx32"\n",

How about using dprintk()?

> +               np->full_name, map_name, map_mask, id_base, out_base, id_len, id,
> +               masked_id - id_base + out_base);
> +        return 0;
> +    }
> +
> +    printk(XENLOG_ERR "%s: no %s translation for id 0x%"PRIx32" on %s\n",
> +           np->full_name, map_name, id, (target && *target) ? (*target)->full_name : NULL);

Same here about adding the function name.

> +
> +    /*
> +     * NOTE: Linux bypasses translation without returning an error here,
> +     * but should we behave in the same way on Xen? Restrict for now.
> +     */

Can you outline why we would want to bypass the translation?

> +    return -EFAULT;
> +}
> +
> +int iommu_add_dt_pci_sideband_ids(struct pci_dev *pdev)
> +{
> +    const struct iommu_ops *ops = iommu_get_ops();
> +    struct dt_phandle_args iommu_spec = { .args_count = 1 };
> +    struct device *dev = pci_to_dev(pdev);
> +    const struct dt_device_node *np;
> +    int rc = NO_IOMMU;

AFAICT, the initial value will never be read. So is it necessary?

> +
> +    if ( !iommu_enabled )
> +        return NO_IOMMU;
> +
> +    if ( !ops )
> +        return -EINVAL;
> +
> +    if ( device_is_protected(dev) )
> +        return 0;

These two lines are a bit odd to read because you would think that if 
the device is protected, then you want to continue translation. So can 
you add a comment explaining what this check means?

> +
> +    if ( dev_iommu_fwspec_get(dev) )
> +        return -EEXIST;
> +
> +    np = pci_find_host_bridge_node(pdev);
> +    if ( !np )
> +        return -ENODEV;
> +
> +    /*
> +     * According to the Documentation/devicetree/bindings/pci/pci-iommu.txt
> +     * from Linux.
> +     */
> +    rc = dt_map_id(np, PCI_BDF(pdev->bus, pdev->devfn), "iommu-map",
> +                   "iommu-map-mask", &iommu_spec.np, iommu_spec.args);
> +    if ( rc )
> +        return (rc == -ENODEV) ? NO_IOMMU : rc;
> +
> +    rc = iommu_dt_xlate(dev, &iommu_spec);
> +    if ( rc < 0 )
> +    {
> +        iommu_fwspec_free(dev);
> +        return -EINVAL;
> +    }
> +
> +    return rc;
> +}
> +#endif /* CONFIG_HAS_PCI */
> +
>   int iommu_add_dt_device(struct dt_device_node *np)
>   {
>       const struct iommu_ops *ops = iommu_get_ops();
> diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
> index c2f315140560..8385cd538a58 100644
> --- a/xen/include/xen/device_tree.h
> +++ b/xen/include/xen/device_tree.h
> @@ -892,6 +892,31 @@ int dt_count_phandle_with_args(const struct dt_device_node *np,
>    */
>   int dt_get_pci_domain_nr(struct dt_device_node *node);
>   
> +#ifdef CONFIG_HAS_PCI

In Xen, we don't usually add #ifdef for prototype only.

> +/**
> + * dt_map_id - Translate an ID through a downstream mapping.
> + * @np: root complex device node.
> + * @id: device ID to map.
> + * @map_name: property name of the map to use.
> + * @map_mask_name: optional property name of the mask to use.
> + * @target: optional pointer to a target device node.
> + * @id_out: optional pointer to receive the translated ID.
> + *
> + * Given a device ID, look up the appropriate implementation-defined
> + * platform ID and/or the target device which receives transactions on that
> + * ID, as per the "iommu-map" and "msi-map" bindings. Either of @target or
> + * @id_out may be NULL if only the other is required. If @target points to
> + * a non-NULL device node pointer, only entries targeting that node will be
> + * matched; if it points to a NULL value, it will receive the device node of
> + * the first matching target phandle, with a reference held.
> + *
> + * Return: 0 on success or a standard error code on failure.
> + */
> +int dt_map_id(const struct dt_device_node *np, uint32_t id,
> +              const char *map_name, const char *map_mask_name,
> +              struct dt_device_node **target, uint32_t *id_out);
> +#endif /* CONFIG_HAS_PCI */
> +
>   struct dt_device_node *dt_find_node_by_phandle(dt_phandle handle);
>   
>   #ifdef CONFIG_DEVICE_TREE_DEBUG
> diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
> index 405db59971c5..3cac177840f7 100644
> --- a/xen/include/xen/iommu.h
> +++ b/xen/include/xen/iommu.h
> @@ -26,6 +26,9 @@
>   #include <xen/spinlock.h>
>   #include <public/domctl.h>
>   #include <public/hvm/ioreq.h>
> +#ifdef CONFIG_ACPI
> +#include <asm/acpi.h>
> +#endif
>   #include <asm/device.h>
>   
>   TYPE_SAFE(uint64_t, dfn);
> @@ -219,7 +222,8 @@ int iommu_dt_domain_init(struct domain *d);
>   int iommu_release_dt_devices(struct domain *d);
>   
>   /*
> - * Helper to add master device to the IOMMU using generic IOMMU DT bindings.
> + * Helpers to add master device to the IOMMU using generic (PCI-)IOMMU
> + * DT bindings.
>    *
>    * Return values:
>    *  0 : device is protected by an IOMMU
> @@ -228,12 +232,28 @@ int iommu_release_dt_devices(struct domain *d);
>    *      (IOMMU is not enabled/present or device is not connected to it).
>    */
>   int iommu_add_dt_device(struct dt_device_node *np);
> +int iommu_add_dt_pci_sideband_ids(struct pci_dev *pdev);
>   
>   int iommu_do_dt_domctl(struct xen_domctl *, struct domain *,
>                          XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
>   
> +#else /* !HAS_DEVICE_TREE */
> +static inline int iommu_add_dt_pci_sideband_ids(struct pci_dev *pdev)
> +{
> +    return 0;
Shouldn't this return an error because we wouldn't be able to add the 
Device?

> +}
>   #endif /* HAS_DEVICE_TREE */
>   
> +static inline int iommu_add_pci_sideband_ids(struct pci_dev *pdev)
> +{
> +    int ret = 0;

Same here.

> +#ifdef CONFIG_ACPI
> +    if ( acpi_disabled )
> +#endif
> +        ret = iommu_add_dt_pci_sideband_ids(pdev);
> +    return ret;
> +}
> +
>   struct page_info;
>   
>   /*

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 09:37:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 09:37:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558200.872074 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGcTk-0002NT-9Q; Tue, 04 Jul 2023 09:37:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558200.872074; Tue, 04 Jul 2023 09:37:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGcTk-0002NM-6S; Tue, 04 Jul 2023 09:37:48 +0000
Received: by outflank-mailman (input) for mailman id 558200;
 Tue, 04 Jul 2023 09:37:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=U3Yz=CW=citrix.com=prvs=5427c2329=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qGcTi-0002NG-ND
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 09:37:46 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6cafa7d8-1a4e-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 11:37:44 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6cafa7d8-1a4e-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688463464;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:content-transfer-encoding:in-reply-to;
  bh=/0yM5i/MfkpAusvz4raS8zb7nUWfMXgPEhK7n7D3RcY=;
  b=AHPO4DecT9oG/gaTwaYXtu40/XH2+2s9ddnW8SJVWG05Et/LZflvZ8RJ
   K8mGRpStnImHM0tG0ISTTY/XA9+pTXTD1UenMu7oi5XYxKoU85R1EVEhW
   2lklnSveEoIfnLmsfrAzFik5rxsems7xVd+Ob6pmErItZoSKOIkmlDSpG
   w=;
Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 115110777
X-Ironport-Server: esa3.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:eV13K6rt8pNipSmBiEi2M4foXN9eBmIAZRIvgKrLsJaIsI4StFCzt
 garIBnTOqyCMTDyfYp1PoXi8BkD65HcyoAwTgI4rSo3HiwU9ZuZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weBzyVNVvrzGInqR5fGatgMdgKFb
 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo
 OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay
 RAXAC4qcg/biO2M+auEFONc2sY/dfKoYLpK7xmMzRmBZRonaZXKQqGM7t5ExjYgwMtJGJ4yZ
 eJAN2ApNk6ZJUQSZBFOUslWcOSA3xETdxVRrk6VoqwmpXDe1gVr3JDmMcbPe8zMTsJQ9qqdj
 jufoj2gWk5Fa7RzzxK7132Tq7+VkxnVAr4fD6Wo+KNRoQyckzl75Bo+CgLg/KjRZlSFc9BVJ
 lEQ+yEuhbMv70HtRd74NzWhrXuZ+xIRRddUO+s97g6L1+zT+QnxLngJSHtNZcIrsOcyRCc2z
 RmZktXxHzttvbaJD3WH+d+8pCu/IyEPIUceZCUPSk0O5NyLnW0opkuRFJA5Svfz14CrX2iqm
 FhmsRTSmZ0NqtIUj6q0x2nevGymlsTLUlcOpVnuCzfNAhxCWGK1W2C5wQGFvaYcct/EHwnpU
 GsswJbHsr1XZX2ZvGnUGbhWQun0jxqQGGeE6WODCaXN4NhEF5SLWYlLqA9zK05yWirvUW+4O
 RSD0e+9CXI6AZdLUUOUS9jrYyjS5fK8fekJr9iNBja0XrB/dRWc4AZlblOK0mbmnSAEyP9va
 cvDIJz1UypGWMyLKQZaoM9EgNcWKt0WnzuPFfgXMTz6uVZhWJJlYehcawbfBgzIxKiFvB/U4
 75i2ziikn1ivBnFSnCPq+Y7dAlaRUXX8Liq86S7gMbfeFs5cIzgYteNqY4cl3tNxPsFzruRp
 i7hASe1CjPX3BX6FOlDUVg7AJuHYHq1hStT0fAEVbpw50UeXA==
IronPort-HdrOrdr: A9a23:TwgqKaj8SvSygiAvUawlSS/6C3BQXtwji2hC6mlwRA09TySZ//
 rBoB0+726RtN93YgBGpTngAtjkfZqyz/NICOUqUYtKGTOW3ldAT7sSj7cKoQeBJ8SWzIc0vs
 1dmupFeb7N5DBB/L/HCWKDcurIruPpzJyV
X-Talos-CUID: 9a23:jOj4Om+dqaFWS7ed3quVv1AzBt99fXLn9W7vfUWIVWR1EYbWFWbFrQ==
X-Talos-MUID: 9a23:yNPueQaJ6zCK0eBTiRrjuxwybslSzf6SBVsVgZtbgOjVOnkl
X-IronPort-AV: E=Sophos;i="6.01,180,1684814400"; 
   d="scan'208";a="115110777"
Date: Tue, 4 Jul 2023 10:37:38 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
CC: Jan Beulich <jbeulich@suse.com>, <qemu-devel@nongnu.org>,
	<xen-devel@lists.xenproject.org>
Subject: Re: QEMU assert (was: [xen-unstable test] 181558: regressions - FAIL)
Message-ID: <947da45d-f336-4034-bf51-fb190420506b@perard>
References: <osstest-181558-mainreport@xen.org>
 <ZJwoK50FcnTSfFZ8@MacBook-Air-de-Roger.local>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <ZJwoK50FcnTSfFZ8@MacBook-Air-de-Roger.local>

On Wed, Jun 28, 2023 at 02:31:39PM +0200, Roger Pau Monné wrote:
> On Fri, Jun 23, 2023 at 03:04:21PM +0000, osstest service owner wrote:
> > flight 181558 xen-unstable real [real]
> > http://logs.test-lab.xenproject.org/osstest/logs/181558/
> > 
> > Regressions :-(
> > 
> > Tests which did not succeed and are blocking,
> > including tests which could not be run:
> >  test-amd64-amd64-xl-qcow2   21 guest-start/debian.repeat fail REGR. vs. 181545
> 
> The test failing here is hitting the assert in qemu_cond_signal() as
> called by worker_thread():
> 
> #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
> #1  0x00007ffff740b535 in __GI_abort () at abort.c:79
> #2  0x00007ffff740b40f in __assert_fail_base (fmt=0x7ffff756cef0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55555614abcb "cond->initialized",
>     file=0x55555614ab88 "../qemu-xen-dir-remote/util/qemu-thread-posix.c", line=198, function=<optimized out>) at assert.c:92
> #3  0x00007ffff74191a2 in __GI___assert_fail (assertion=0x55555614abcb "cond->initialized", file=0x55555614ab88 "../qemu-xen-dir-remote/util/qemu-thread-posix.c", line=198,
>     function=0x55555614ad80 <__PRETTY_FUNCTION__.17104> "qemu_cond_signal") at assert.c:101
> #4  0x0000555555f1c8d2 in qemu_cond_signal (cond=0x7fffb800db30) at ../qemu-xen-dir-remote/util/qemu-thread-posix.c:198
> #5  0x0000555555f36973 in worker_thread (opaque=0x7fffb800dab0) at ../qemu-xen-dir-remote/util/thread-pool.c:129
> #6  0x0000555555f1d1d2 in qemu_thread_start (args=0x7fffb8000b20) at ../qemu-xen-dir-remote/util/qemu-thread-posix.c:505
> #7  0x00007ffff75b0fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
> #8  0x00007ffff74e206f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
> 
> I've been trying to figure out how it can get in such state, but so
> far I had no luck.  I'm not a QEMU expert, so it's probably better if
> someone else could handle this.
> 
> In the failures I've seen, and the reproduction I have, the assert
> triggers in the QEMU dom0 instance responsible for locally-attaching
> the disk to dom0 in order to run pygrub.
> 
> This is also with QEMU 7.2, as testing with upstream QEMU is blocked
> ATM, so there's a chance it has already been fixed upstream.
> 
> Thanks, Roger.

So, I've run a test with the latest QEMU and I can still reproduce the
issue. The test also fails with QEMU 7.1.0.

But, QEMU 7.0 seems to pass the test, even with a start-stop loop of 200
iteration. So I'll try to find out if something change in that range.
Or try to find out why would the thread pool be not initialised
properly.

Cheers,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 09:42:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 09:42:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558205.872084 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGcY5-0003qy-PO; Tue, 04 Jul 2023 09:42:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558205.872084; Tue, 04 Jul 2023 09:42:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGcY5-0003qr-MI; Tue, 04 Jul 2023 09:42:17 +0000
Received: by outflank-mailman (input) for mailman id 558205;
 Tue, 04 Jul 2023 09:42:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=U3Yz=CW=citrix.com=prvs=5427c2329=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qGcY4-0003ql-FH
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 09:42:16 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0e589583-1a4f-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 11:42:15 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0e589583-1a4f-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688463735;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=TuXXQxQ7oFrhPAA9ILwXiKoQM74Duw62d1G9RVUZ7ks=;
  b=Mz/XOjr89FtNTvoh8jbOrHKzn0pZJIGDZoEuGpTu3NdbtRqsC9T7ktfP
   /L+podZRoJSVvCSHeLJHWLCifnm6Mm4VxN2PvmGMAxXUz2PJ+PW/q1GFY
   3N5n7Sa9PAtDAe7m9Zou5WALP30txCtQvNbX9vyT4CqWMGcl9MBSoC1fF
   Y=;
Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 113809652
X-Ironport-Server: esa5.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:WC4F664FWwvwp4jd8NsNQQxRtN7HchMFZxGqfqrLsTDasY5as4F+v
 jcfWz/Xbq6MZWL2ftxzPdng/B8C6MXdyNVqSQU9ris8Hi5G8cbLO4+Ufxz6V8+wwm8vb2o8t
 plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraCYnsrLeNdYH9JoQp5nOIkiZJfj9G8Agec0
 fv/uMSaM1K+s9JOGjt8B5mr9lU35ZwehBtC5gZlPa8T4AeE/5UoJMl3yZ+ZfiOQrrZ8RoZWd
 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4
 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5m7
 bsWDCkVNgC/vuPpwKqQZuZpt5UiFZy+VG8fkikIITDxCP8nRdbIQrnQ5M8e1zA17ixMNa+AP
 YxDM2MpNUmeJUQVYT/7C7pn9AusrnD5bz1frkPTvact6nLf5AdwzKLsIJzefdniqcB9xx/D9
 jqXoTmjav0cHOShlwie9Sz8v9/ewgTlVoQ8Poyy3dc/1TV/wURMUUZLBDNXu8KRjlO1UpRRI
 kof9y4qsIA77kntRd74NzWorXjBshMCVt54F+wh9BrL2qfS+xyeBGUPUnhGctNOnMU7XyAw3
 1mF2dbgHyVysaa9QGiYsLyTqFuaJiUUa2QCaCksRBEApdLkpekbkRbnXttlVqmvgbXdHDjqx
 jmQoSsWhrMNjNUK3aG24VDGhT23opHDCAUy423/V3qo9ApjaKa5Zoaj7h7Q6vMoEWqCZgDf5
 j5ewZHYtb1QS8jXz0RhXdnhApmxoPihKSWEkWJWHsYh7x+B9HuSLIFptWQWyFhSDioURdP4S
 BaN6VMNusYObSvCgbxfONzoVZlzpUT0PZG8D62PMIITCnRkXFXflByCc3J8yIwEfKIEtagkc
 amWfs+3ZZrxIfQ2lWHmLwvxPFJC+8zf+Y8wbcqhp/hf+eDCDEN5sJ9cWLd0Usg37bmfvCLe+
 MtFOs2Bxn13CbOuMnWPoNRKcwxWfBDX4KwaTOQOJ4a+zvdOQjl9W5c9P5t8E2Cao0ilvriRp
 SzsMqOp4FH+mWfGOW23hoNLMdvSsWJEhStjZ0QEZA/4s0XPlK7ztM/zgbNrJ+h4nAGipNYoJ
 8Q4lzKoWasfEmieo2tBNvEQbuVKLXyWuO5HBAL9CBBXQnKqb1ahFgPMFuc3yBQzMw==
IronPort-HdrOrdr: A9a23:aLdbkaxhqF2IroRHEj12KrPwFr1zdoMgy1knxilNoEpuA6ulfq
 eV7ZcmPH7P6Ar5N0tKpTntAsO9qBDnlKKdg7N/AV74ZniDhILAFugL0WKF+VDd8kbFmNK1u5
 0NT0DQYueAa2STIazBkWuF+3dL+qjjzJyV
X-Talos-CUID: =?us-ascii?q?9a23=3A2PLarWsyZ1MGvxtx1DHsGsna6Is9NXP51W+IM3O?=
 =?us-ascii?q?BCDlpUJa5RlqhqaJdxp8=3D?=
X-Talos-MUID: 9a23:t0bRdgRi+dngMd5kRXTUum9QL8A2s52eGR8qj5sAleO1PwdZbmI=
X-IronPort-AV: E=Sophos;i="6.01,180,1684814400"; 
   d="scan'208";a="113809652"
Date: Tue, 4 Jul 2023 10:42:01 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Luca Fancellu <luca.fancellu@arm.com>
CC: <xen-devel@lists.xenproject.org>, <bertrand.marquis@arm.com>,
	<wei.chen@arm.com>, Wei Liu <wl@xen.org>, Marek
 =?iso-8859-1?Q?Marczykowski-G=F3recki?= <marmarek@invisiblethingslab.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH 1/2] tools: Fix ifdef for aarch64 that should include
 also arm
Message-ID: <66c3d183-460d-4f34-a331-01ac4d65fc9d@perard>
References: <20230608135913.560413-1-luca.fancellu@arm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230608135913.560413-1-luca.fancellu@arm.com>

On Thu, Jun 08, 2023 at 02:59:12PM +0100, Luca Fancellu wrote:
> Commit 56a7aaa16bfe introduced some SVE related code that is protected by
> '#if defined(__aarch64__)', the issue is that this doesn't take into
> consideration when the toolstack is compiled for an arm32 Dom0 running on
> an arm64 platform, it should be able to create SVE enabled guests but with
> the current code it's not.
> 
> So fix the issue by compiling the code when the toolstack is compiled for
> both arm32 and arm64.
> 
> Fixes: 56a7aaa16bfe ("tools: add physinfo arch_capabilities handling for Arm")
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 09:44:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 09:44:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558210.872095 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGcaP-0004Po-7O; Tue, 04 Jul 2023 09:44:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558210.872095; Tue, 04 Jul 2023 09:44:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGcaP-0004Ph-1j; Tue, 04 Jul 2023 09:44:41 +0000
Received: by outflank-mailman (input) for mailman id 558210;
 Tue, 04 Jul 2023 09:44:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=bK4X=CW=citrix.com=prvs=5424eaebb=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qGcaM-0004PU-UB
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 09:44:38 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6344a856-1a4f-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 11:44:37 +0200 (CEST)
Received: from mail-bn8nam04lp2049.outbound.protection.outlook.com (HELO
 NAM04-BN8-obe.outbound.protection.outlook.com) ([104.47.74.49])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 04 Jul 2023 05:44:35 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by DM4PR03MB6064.namprd03.prod.outlook.com (2603:10b6:5:393::21) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 09:44:33 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902%7]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 09:44:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6344a856-1a4f-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688463877;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=0/Jl8PUvPYhpGd5cqwpfcRbUSXepwc56e8D1WmpqbhY=;
  b=K5TnTCmxUFbljTv6bQSm7UCH18lP4iWFfeUNNJ2sCk2Y7ShXnUzBEPnm
   BdtItXItBKVyXGIRJdqB+g+wGfcSRjaGRqvhkl3dXrR61/lid3PP/aStN
   is469kkSssthWOkPh4hhF5jaRL8QvO1t85uDG6gl7UyxzMQX42diMxaVM
   o=;
X-IronPort-RemoteIP: 104.47.74.49
X-IronPort-MID: 113809947
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:/3t2AKNv0pnlmbTvrR2ClsFynXyQoLVcMsEvi/4bfWQNrUpx1jJSy
 WBMCzvTbK7YMGfxc9olbtyz/EhQscXcndFrSwto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v
 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/
 Nj/uKUzAnf8s9JPGjxSs/vrRC9H5qyo42tH5gBmP5ingXeF/5UrJMNHTU2OByOQrrl8RoaSW
 +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ
 HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0uN1LFF+r
 sMdEj4UcgCRisef2a+eRfY506zPLOGzVG8ekldJ6GmFSNwAEdXESaiM4sJE1jAtgMwIBezZe
 8cSdTtoalLHfgFLPVAUTpk5mY9EhFGmK2Ee9A3T+vZxvzm7IA9ZidABNPLPfdOHX4NNl1uwr
 WPa5WXpRBodMbRzzBLcqyn83r6ewXyTtIQ6LqX/6/pPu32qmG0vJRlLfwOh+Pi5sxvrMz5YA
 wlOksY0loAi+UruQtTjUhmQpH+fogVaS9dWC/c96gyG1uzT+QnxLkouQyNFadcmnNQrXjFs3
 ViM9/v2ARR/vbvTTmiSnop4thu3MCkRaGUENSkNSFNZ58G5+N1iyBXSUtxkDai5yMXvHi39y
 CyLqy54gKgPickM1OOw+lWvby+Qm6UlhzUdvm3/Nl9JJCsgDGJ5T+REMWTm0Ms=
IronPort-HdrOrdr: A9a23:o7xVFKhaqH71vX1LzSOO+opdQnBQXh4ji2hC6mlwRA09TyX5ra
 2TdZUgpHrJYVMqMk3I9uruBEDtex3hHP1OkOss1NWZPDUO0VHARO1fBOPZqAEIcBeOldK1u5
 0AT0B/YueAd2STj6zBkXSF+wBL+qj6zEiq792usEuEVWtRGsVdB58SMHfiLqVxLjM2YqYRJd
 6nyedsgSGvQngTZtTTPAh/YwCSz+e78q4PeHQ9dmca1DU=
X-Talos-CUID: 9a23:pf5WK2xVyXCq87QuchQABgURGO0VQibiyU3eOlOoG2tMYaSIbFCPrfY=
X-Talos-MUID: =?us-ascii?q?9a23=3ASyruBQyLlHMPUgISPk16P6zmM/uaqJ62T10JtK4?=
 =?us-ascii?q?mgpeFCQF0Zh3Flm22QrZyfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,180,1684814400"; 
   d="scan'208";a="113809947"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=UAMnyv4yOAKgh4KuMmbPmEJahIqDnVDi/QIHBmGIg64cKiDBfFjunJmS8VpnGWjReYGM79QC6a+L4mMWvQ8zcqrYpkonaqsSoQIaZJYVwuFBRexU/5/DuLXkIhAQQQxDfYQjBR9N7jnIONqOVIJc3+ADti8UihKVobMwY5V3C7m8ZrSS0JS8RSxcYgmMXM3yEDmhuL+LIQlEs/VEPS41qgptMcCMkHT3uqgs+rxCiVEUOCyCqU5QhsF73vvQ4euxcF4mwRcedFJ7MfBSD5T0GSn/nlYHSqrXrqvpsYRr23AePTsXfGkwlRoWptq2K6rm7fKYbUiydOFsyjvlBvKVjQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0/Jl8PUvPYhpGd5cqwpfcRbUSXepwc56e8D1WmpqbhY=;
 b=ThXUF6cRCzFeiT1cmoGxGBPyxZCHHAOw0os/xF7TLoI1wOOk6HVVqpIkYhmfj64Wqb6Q2RAY2P1ai/4a3zQVNHlTNElBnxerE4kObejyb+OzDlOdbfIOk8qC0Iq0CPHnfooI3JzggZZTwifewFYk4XGQZQNjEeodFoam0dUFm5PvZ6wVQiItuW2UPmSQ+jPdRGQBAHDh1pBnlP05XP8iRVYZd6ePtGnSZmcbsslHrcnm4rF0I+ezlROt2qx1rSDqmUUwv/HzqrF6uJskT+yZL4Z+G+EbsQYQRZIePmkBA14kkDzQptJSWLXcMmGCDBdAi1WHoQ4pEwFGCTztzodV1g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0/Jl8PUvPYhpGd5cqwpfcRbUSXepwc56e8D1WmpqbhY=;
 b=f6MpxYyixuOZatTMKaxfuXONd+462EsTZaa06pV0SGRVrde+sLTxNoW/VVTO1FV2GF0+OH3xBeLe2qtrfnF5RfQCdFjl1RqH+A0W5j+dbW5+wxcK05tD9MlsSW36UWVLEldcCC2Pa3t5zELopUb7CFehGBeQo3jfJ33mIqwuAHA=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Tue, 4 Jul 2023 11:44:28 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Jan Beulich <JBeulich@suse.com>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH v2] xen: Correct comments after renaming
 xen_{dom,sys}ctl_cpu_policy fields
Message-ID: <ZKPp_JI4HwJ2VLxF@MacBook-Air-de-Roger.local>
References: <20230629102600.61262-1-andrew.cooper3@citrix.com>
 <20230704092909.3635899-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230704092909.3635899-1-andrew.cooper3@citrix.com>
X-ClientProxiedBy: LNXP265CA0055.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:5d::19) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|DM4PR03MB6064:EE_
X-MS-Office365-Filtering-Correlation-Id: 15153357-4689-4d9b-96a4-08db7c73458e
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	ZJNTSSIFYi9r4ebSjixuauS1yMDulJRd4ARJnpM8zrjt94gTGAxzpzbjI9593dMsgO/+BNw8GV/O0hIKOJnoKwKuF7xNaEs0lBpzZ3BCHXszuysZ80X24XDZwPOZQA4wSS9WOUDd+vhq9N+769qdvGbWl43snYQyq7mDKkAjGRdUuKRqeAyHlwmZmCPtzeAufcel9NqCUWOwfEHvtDxUu24QDbZoXB84rZuG1X8LVBP8yVcKSCQoIxUPzu6knHnu+n/bHb+WjlucrTfyv9/zM+dEDevBaa7ONt+fyXg8AQ5tP6nCKULc7VegsyEOwcak28KFhVH/TOP/uvAa4fZzPgDaEFEUR/MdFTzisifuKAHdHUiNE8TKu/5mvobez2ozf3Q6RZ2q4iD00nrwTFfPI2n+DlodnGrqwjUh5Q42tsrFhLNpnQbzxN1L61nP+ZVeTcLBd+1K1bCUNOMMJRxJ6vaTjpbuoJkQ2sJXQlYtkgtluj7Rc0IpXLkZyZR2wDBode2L7t0pmOTMZzHEk6nIWL5ivM9cpV/xRpUk9H2Hv/x+qwmeY8usZjtpxdk/oeY4
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(366004)(346002)(376002)(136003)(451199021)(2906002)(41300700001)(6862004)(5660300002)(8676002)(8936002)(558084003)(85182001)(86362001)(186003)(82960400001)(478600001)(26005)(6512007)(6506007)(6666004)(9686003)(6486002)(316002)(6636002)(4326008)(66476007)(66946007)(66556008)(54906003)(38100700002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QU1nWldIZktUVUNCNzluNlZhcVUwMU9reHRoNmZlU3VneVY1QkNQK28rdEVG?=
 =?utf-8?B?N3J4KzJjQ3pWZERESC8rekVxY2I2YnFTSmdHL3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y/WKlZVq7WesJfJPvwIuk/9kbTAbswvUk8nmoOQqTmavaCXQF+Q6R7GgJzprg/O+DQuMfRNrDBWxEkc9UrL89Xs/YFEIrsu4VlpmkSwfgcANlM5sFZznbJc7zuZy4Q3dU/BqpZLbPAb+Nqkpv5C73b2hdhJXbl+fvVQudYFWOt+9WcBcfZxhpTInIqUHyEPbTYUrPLqFvr/rBw408WB/0FZ3yvj
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 15153357-4689-4d9b-96a4-08db7c73458e
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 09:44:33.4628
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: T7/xoWfvKUgF1s1aD42TFOV4z3hl7d/HJu0vYteuQoWj1wPm4zYYgQiwapnOmEVIWFzbuGi2pnkj2fKZzJ7YpA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR03MB6064

On Tue, Jul 04, 2023 at 10:29:09AM +0100, Andrew Cooper wrote:
> Fixes: 21e3ef57e040 ("x86: Rename {domctl,sysctl}.cpu_policy.{cpuid,msr}_policy fields")
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 09:57:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 09:57:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558215.872104 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGcmR-0005yZ-7p; Tue, 04 Jul 2023 09:57:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558215.872104; Tue, 04 Jul 2023 09:57:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGcmR-0005yS-4F; Tue, 04 Jul 2023 09:57:07 +0000
Received: by outflank-mailman (input) for mailman id 558215;
 Tue, 04 Jul 2023 09:57:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=bK4X=CW=citrix.com=prvs=5424eaebb=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qGcmQ-0005yM-In
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 09:57:06 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 204443a4-1a51-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 11:57:04 +0200 (CEST)
Received: from mail-mw2nam12lp2049.outbound.protection.outlook.com (HELO
 NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.49])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 04 Jul 2023 05:57:02 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ2PR03MB7525.namprd03.prod.outlook.com (2603:10b6:a03:566::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 09:57:00 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902%7]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 09:56:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 204443a4-1a51-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688464624;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=U8ZjVsaGXtSV+cvAFoZC7DnUTy09AzEfXrMVBYtc9vU=;
  b=IdTBIo9pPpMv5n9uSwycHsDe6APqvvMFEfmkyqSvD15GWnUjCExh5VQi
   5vT8vTuJVBsVhotY+fDZxdL24OroppGEmoJj93NNZ2/jSRYt6T/JWFoD0
   k9iB4mVPEw90BfTIksUFqwuZSy353Ip3QzYgzzo67JIJxhtNlR7rbsRuj
   s=;
X-IronPort-RemoteIP: 104.47.66.49
X-IronPort-MID: 113811165
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:DzLbqqkZJMRESW3PjKG0g+no5gypJ0RdPkR7XQ2eYbSJt1+Wr1Gzt
 xJKCD+Fbq2Pa2vyL91yPY2woR8G7JPcyoJiQAZr/C40QiMWpZLJC+rC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WnCjCviFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,180,1684814400"; 
   d="scan'208";a="113811165"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=dPReMC9TC8rTNAQPjWq/BMGOzqor6SYsGqPYu6IdJHK8KOzHKNZyUX5flBa2+W15RmTrl9PikuuRf7w0S3zI7dwfdLZ0f6UhKXX2CeJW2sKqtWax1OFjkHsAcTrw+mYVitfWpftNh/Ywy8KWSaWV9nt5j9abdce5uwJYOXciJkTlRSLIjt3IbiXT2+qxeFPpcLUXyh9XXOL3Xg864h2iEqPSbPVnlsvdtkgULjsl6hp9A+uNLw29TFYEABPM2br7+Tu1B4P8nKNT0LoEzRI3TdSG8vwVfrNLrqLISEp2orwLEOthgPKvxYfJbBIhlRXf76/0lOF2NzdCg7gSE+AqnQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=73s0z9K7VLPa8Uyp+Lbp6tEDaXxy79OKqbEz+XfK2UQ=;
 b=kGbmrfpV+FKPAGgFapQYyWHOtxdKvAOXpsLa5E43pgi9i9FflI+hk8XVFvS9qvYOyNnvSrZ9fFwnMGWwE6I8ElNickv80WXoklv61G6+LL9upAriCCimJzKTajm1kAaWxEb/f4vNGQgNyAHaas13sgTLTfLRRns13/ujHlu6ew4llaqeveppAbgzz6+mR6hUQGVZQ8xzS0Ly/vEXwZDqNCr8AUuq7/YM4Kg7aqT8JXUBD2mpl+dd8HooAAOWu2muIX0ZUMgqzOmwd060Xeu2d0yiUsNq/rOwQ842CcprgazMPYs6r+xZzVtdm7w0eFFYH8V1beBdO54QmzoX/gYSRw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=73s0z9K7VLPa8Uyp+Lbp6tEDaXxy79OKqbEz+XfK2UQ=;
 b=vR362JJfIaKw6GvEPCMc6LAzJzYfmhR8WfydISz3SMm4UTmiDOSQsjXi/VLPdlQcTGHuRKsNFrOxQKu3lT4jSFUEAZfFQf+JDKHPHJPAmlPQiEwp0pXMcg6odeBqWMjcUmB5YvDsMj1XnN29MqDjy2puvmM+/McGMDz6QflTurs=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Tue, 4 Jul 2023 11:56:54 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>, qemu-devel@nongnu.org,
	xen-devel@lists.xenproject.org
Subject: Re: QEMU assert (was: [xen-unstable test] 181558: regressions - FAIL)
Message-ID: <ZKPs5r3wen4PymqX@MacBook-Air-de-Roger.local>
References: <osstest-181558-mainreport@xen.org>
 <ZJwoK50FcnTSfFZ8@MacBook-Air-de-Roger.local>
 <947da45d-f336-4034-bf51-fb190420506b@perard>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <947da45d-f336-4034-bf51-fb190420506b@perard>
X-ClientProxiedBy: LO4P265CA0192.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:311::20) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ2PR03MB7525:EE_
X-MS-Office365-Filtering-Correlation-Id: 9b866fd3-80ff-448c-4539-08db7c750257
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	o+8Yr2RnKx1Tl7rf89PtPgTR6qNqQf22rOgs/+hR0JgdJTJTNcqBP65LSFShg9em7w9ag88JKQh43LDmSbNg96BYjSzB5y6TnTfgJg3KnryUh1QfrlpENCl691FSfMvdEBiNVol37K0uqAvh4/ojMUo+edjMpRUr2Iirhw7oxEBIUTvEfrD3AnyOGlP90NR227eevB5CC3gBWajUwcfW1uQkwjSEUbJYEytubxoZSMZp/L+eQB+CUgnI7JoIyY0F6j15GNmmYec9Shz2kBek7jj3tvINglB67MNPiOMW9hsjSBFA5pLymZZyG0p4pka6jdtlRTA/YYzmI6DS8cj7Pb9f88P1ITRfhrBPkiPLK5Tf0JGvYnoDAfqzL4cjHrjD1d5hoOiJWPfdi5hdwNHdDh7H0NXEuRBxCgLMqvJQkQtXNxfTnCsS67A47kHBATpeqx+asK2FM2UoDe1yPxNed3Zj1IohRabrCKo9FQ5dcfoO88qIdFavrzjq0MHz2dHReHEcz04rXOdISsQPyIsQe4fYjvMOc2P1gEvWP0sI4z4=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(366004)(39860400002)(376002)(396003)(136003)(451199021)(41300700001)(6486002)(6666004)(38100700002)(26005)(82960400001)(83380400001)(186003)(6506007)(9686003)(966005)(6512007)(86362001)(478600001)(85182001)(2906002)(316002)(66476007)(4326008)(66946007)(66556008)(8936002)(8676002)(6636002)(6862004)(5660300002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-Message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MflRcIfjf8lcol88d57/hSCR0b7fIjunMKDPc+dRLNrok8kH+wWxrJ6aiZlBn/6ZGJm2+QuyvPpRDhvQxgMMdL54YVVW0q+OWaZAI05tJOSO8QxnLrWkw5DwPRSeMAno8T2Lu1TjeuIO2CqUmp6pSIJwyJ3UOcT7hgLUd50wTEqnIwWNKliL7jJbvvPSNOt1VuQMQ716qL3zvh7hcCSPfECD2+uvRxxhaGuhsqYA0nWPS+CuPJrowC5kOq+AkIWUJ+6uF4QsVXqASDuYCarUs9CEmm6eWxclgDASl3xEZ9mo2CmkevXe5dOpKzAdXdPVIgDdLEMhL9eiKoXNVRuCx15QaM2t8Yc6qAed3smv3qEqYXHi/QqdleY2Fk6mGIwhxDkLKPzZ3Y+oeB8uhC0jszW9aLnOlgOcsDLCA==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9b866fd3-80ff-448c-4539-08db7c750257
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 09:56:59.6823
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: pB8n+i5z6//g6H1OailAKN7JNo+XO9XdqcZHznzIcn3YqKoOEchWrXSbMHmYS7SX442x7HDqNZconzzFyab3mQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR03MB7525

On Tue, Jul 04, 2023 at 10:37:38AM +0100, Anthony PERARD wrote:
> On Wed, Jun 28, 2023 at 02:31:39PM +0200, Roger Pau MonnÃ© wrote:
> > On Fri, Jun 23, 2023 at 03:04:21PM +0000, osstest service owner wrote:
> > > flight 181558 xen-unstable real [real]
> > > http://logs.test-lab.xenproject.org/osstest/logs/181558/
> > > 
> > > Regressions :-(
> > > 
> > > Tests which did not succeed and are blocking,
> > > including tests which could not be run:
> > >  test-amd64-amd64-xl-qcow2   21 guest-start/debian.repeat fail REGR. vs. 181545
> > 
> > The test failing here is hitting the assert in qemu_cond_signal() as
> > called by worker_thread():
> > 
> > #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
> > #1  0x00007ffff740b535 in __GI_abort () at abort.c:79
> > #2  0x00007ffff740b40f in __assert_fail_base (fmt=0x7ffff756cef0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55555614abcb "cond->initialized",
> >     file=0x55555614ab88 "../qemu-xen-dir-remote/util/qemu-thread-posix.c", line=198, function=<optimized out>) at assert.c:92
> > #3  0x00007ffff74191a2 in __GI___assert_fail (assertion=0x55555614abcb "cond->initialized", file=0x55555614ab88 "../qemu-xen-dir-remote/util/qemu-thread-posix.c", line=198,
> >     function=0x55555614ad80 <__PRETTY_FUNCTION__.17104> "qemu_cond_signal") at assert.c:101
> > #4  0x0000555555f1c8d2 in qemu_cond_signal (cond=0x7fffb800db30) at ../qemu-xen-dir-remote/util/qemu-thread-posix.c:198
> > #5  0x0000555555f36973 in worker_thread (opaque=0x7fffb800dab0) at ../qemu-xen-dir-remote/util/thread-pool.c:129
> > #6  0x0000555555f1d1d2 in qemu_thread_start (args=0x7fffb8000b20) at ../qemu-xen-dir-remote/util/qemu-thread-posix.c:505
> > #7  0x00007ffff75b0fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
> > #8  0x00007ffff74e206f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
> > 
> > I've been trying to figure out how it can get in such state, but so
> > far I had no luck.  I'm not a QEMU expert, so it's probably better if
> > someone else could handle this.
> > 
> > In the failures I've seen, and the reproduction I have, the assert
> > triggers in the QEMU dom0 instance responsible for locally-attaching
> > the disk to dom0 in order to run pygrub.
> > 
> > This is also with QEMU 7.2, as testing with upstream QEMU is blocked
> > ATM, so there's a chance it has already been fixed upstream.
> > 
> > Thanks, Roger.
> 
> So, I've run a test with the latest QEMU and I can still reproduce the
> issue. The test also fails with QEMU 7.1.0.
> 
> But, QEMU 7.0 seems to pass the test, even with a start-stop loop of 200
> iteration. So I'll try to find out if something change in that range.
> Or try to find out why would the thread pool be not initialised
> properly.

Thanks for looking into this.

There are a set of changes from Paolo Bonzini:

232e9255478f thread-pool: remove stopping variable
900fa208f506 thread-pool: replace semaphore with condition variable
3c7b72ddca9c thread-pool: optimize scheduling of completion bottom half

That landed in 7.1 that seem like possible candidates.

Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 09:57:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 09:57:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558221.872113 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGcn7-0006X3-KF; Tue, 04 Jul 2023 09:57:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558221.872113; Tue, 04 Jul 2023 09:57:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGcn7-0006Ww-HY; Tue, 04 Jul 2023 09:57:49 +0000
Received: by outflank-mailman (input) for mailman id 558221;
 Tue, 04 Jul 2023 09:57:48 +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
 <SRS0=wjpU=CW=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qGcn5-0006Ui-Pl
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 09:57:48 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on20608.outbound.protection.outlook.com
 [2a01:111:f400:fe16::608])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 398c1112-1a51-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 11:57:45 +0200 (CEST)
Received: from DB9PR05CA0022.eurprd05.prod.outlook.com (2603:10a6:10:1da::27)
 by GV2PR08MB10355.eurprd08.prod.outlook.com (2603:10a6:150:de::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 09:57:38 +0000
Received: from DBAEUR03FT007.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:1da:cafe::ca) by DB9PR05CA0022.outlook.office365.com
 (2603:10a6:10:1da::27) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.30 via Frontend
 Transport; Tue, 4 Jul 2023 09:57:38 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT007.mail.protection.outlook.com (100.127.142.161) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.18 via Frontend Transport; Tue, 4 Jul 2023 09:57:37 +0000
Received: ("Tessian outbound c63645f235c1:v142");
 Tue, 04 Jul 2023 09:57:37 +0000
Received: from 3d7faca57838.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 AB5D6D7C-F7B5-4301-B875-DD30A0CEAEA4.1; 
 Tue, 04 Jul 2023 09:57:27 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3d7faca57838.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 04 Jul 2023 09:57:27 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by AM9PR08MB6114.eurprd08.prod.outlook.com (2603:10a6:20b:287::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 09:57:25 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::ed0b:5730:a1f9:577b]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::ed0b:5730:a1f9:577b%5]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 09:57:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 398c1112-1a51-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=mpShW9uqqSM9P2gZGRUtZ9yTX/59FwNAyOOHoafKpTs=;
 b=W1nV1w8yePTIeiCurvbc1UGIJ8Y5NE/wj5yNHW3A8zrGwnYVh7hXNrOhH2pFJiYXZ+jaf9Hk5J4tNDSuEBr2SM5dS6LPPtp/n4s8t/XxbIuXQeQQPZZkZXoqTqz3jLswTbI47ejXFrGLMsliYzFGKb7Hr1Y8T9xsX/jkxxd5De0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 5664a9e3cd9d4085
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=VYyHTopk82rBfY/7UoI0bP3o7KiGcUMn1vNiNmrOlVB6N31ksVoGtSxIy6y9Be64ApYfKuFQR9C8uOWZIcGkzn53yaFFR0UqfIW3KdPPhTnxRuPOSQcJvWE+yA1SWKTjyj1pbzzYeiL0CNiecDxoP7pLkBz3eRIOZZYJNYzbd/ie6KKNAhTWDsk28Jbki0Tj1rKzrT3l+WQNi5cdDr8QBlkGyu7wFDmjysZCkawpDE2e2qbSLxgc+p7aPRsjlk6R5sAiflZsXySgMANv4TvbOALsLZRZuXMxXEtT7w3aO3tuBiE69YMb6nF/HrT48Zw2Ye/6sZ6Kl4PLtL8Avm6OqA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=mpShW9uqqSM9P2gZGRUtZ9yTX/59FwNAyOOHoafKpTs=;
 b=kG9rsHN9pp79uzrdlYylnL320a7vWe2LQFq80Bgm5dTrAl0xekFNBgJmF48MgN3rTR5kgwrjiz7ToVog/mxTUfa4lT2/QiR8s0sNxUDhG5ZBo1yrsyAjF593t9qgfwmrSZrcOq48//AiKmfF1vjopmCKphtj2aG/p6+9yUWsg0bXg1TgNydAZ5z1LC8JJ/ykpjvwn801khsJR1BuH81dot8FyozqfxZO5elbJVwisLLYYdwy0DrzGuPxe8U5FHY52tJYcnaK/AguR7jHAnvKWqCOV6y44tnZ8HrEGHJ1ke6BEVfhu4zlHrhI2yj/s57qMNXYO7HQ4XeaMrRCgGgkwA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=mpShW9uqqSM9P2gZGRUtZ9yTX/59FwNAyOOHoafKpTs=;
 b=W1nV1w8yePTIeiCurvbc1UGIJ8Y5NE/wj5yNHW3A8zrGwnYVh7hXNrOhH2pFJiYXZ+jaf9Hk5J4tNDSuEBr2SM5dS6LPPtp/n4s8t/XxbIuXQeQQPZZkZXoqTqz3jLswTbI47ejXFrGLMsliYzFGKb7Hr1Y8T9xsX/jkxxd5De0=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: P S <pairspace@gmail.com>
CC: Stefano Stabellini <sstabellini@kernel.org>, "Daniel P. Smith"
	<dpsmith@apertussolutions.com>, Christopher Clark
	<christopher.w.clark@gmail.com>, Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>,
	George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, Henry Wang
	<Henry.Wang@arm.com>, Community Manager <community.manager@xenproject.org>,
	Doug Goldstein <cardoe@cardoe.com>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
Thread-Topic: [RFC PATCH] xen/arm: Rebranding dom0less feature
Thread-Index:
 AQHZqzMUKP6yBnvUfEC1egkdxmuozK+ki8cAgAB66ACAAukxgIAAZuEAgAAgQQCAABPDAIAA2qUA
Date: Tue, 4 Jul 2023 09:57:24 +0000
Message-ID: <5C1EE299-1779-4FA4-BE22-392E819A496F@arm.com>
References: <8601CDD7-87F7-4FD0-A6E6-BAEAB12E7956@arm.com>
 <234199F8-DBB1-42B6-9A4C-8800EEF60997@gmail.com>
In-Reply-To: <234199F8-DBB1-42B6-9A4C-8800EEF60997@gmail.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|AM9PR08MB6114:EE_|DBAEUR03FT007:EE_|GV2PR08MB10355:EE_
X-MS-Office365-Filtering-Correlation-Id: 97e77884-49a0-45f2-00a4-08db7c751930
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 rEaC5Ztop0saiuGs+yn22a1CFYIorES3L+JRbzN2J4ym1liU+rHNwRTFbvaadrpBMKRD7hNCSGtZkSRwpzkGO+ShkHkPp5MJvKDl5OBRFNn2kRRqSZKFZS0XP9BUkMVSi1SXVwey5QuT21Q4V1hkF/ZXtnbenwRT3dgramR82GnA4GkEXbQLFFiVdNNDexQaQZYLlZqRl7l5ZkaExDwdH1NoUEvXRw+RSd1gH8XwkA+7Ju1d/Hd6C/pTxwYM4galMoj/GNhq7uV2no6TFd2fxaRhqmajMA+toKnIpYi1oat2Ao/pqonS+Hx5WqbqgFC5KS2GM59Z5tckLIKJhXzgB2aN6W/BSMIvQ0l4u0IMT9lupGreAbBXrStyOA5LJkopZGcTcg+7VCQJYYtLZ+unXUevvYTyBAljg6gVX5K6mYWHY7cktWmkp8WKYEwDZMK66KWRxGzfxFSfj7TxjPYUs3CrvXdozFZjDlTe4WTz3vb8J/GTaHyeCJGgiq7hHUVmxzdNiCLkjG4PsWgT8psiUnmDPNDRiUnS9IlniCT6Pu7Euu3eeBfMf3WBEMp1yp50n9ZjolzpTTfSeKI1Ri4bZJSHiEKrVro3foWTgwgGQgpUtuTqH9mu+KwtPFpYfFOrZDkPy0RwqoYVCpmvk1e44O3bSZn4h1iwHXysAdSyito=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(376002)(136003)(346002)(39860400002)(396003)(451199021)(478600001)(83380400001)(6512007)(86362001)(6486002)(6506007)(66946007)(38100700002)(76116006)(316002)(71200400001)(53546011)(186003)(122000001)(26005)(66556008)(66476007)(64756008)(4326008)(66446008)(91956017)(6916009)(54906003)(2616005)(7416002)(5660300002)(8936002)(8676002)(38070700005)(2906002)(41300700001)(33656002)(36756003)(32563001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <1278735821AFD448BAF561E66435101D@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6114
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT007.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	f6fe61f1-9be8-40c1-197f-08db7c75114c
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	mu/uqxk7pvTVknmVBBJX9MgOCpGKIK+cVl9VIDOMN4zv1VuzirDu35kL9hNS0Oo4vUcjvp7wppIdOFiBmunaOoS3E944y+uXWDOeIluvsz19pxZrZbaR20qMuaGopKxSL4ZS31BjgAId3t6HwfqaSP3REQQhs752VhqhQJT8BSPuB2u1XzFc+J9r7ZBqG058rpHqgY4OtGv98Xl1sX/EcK8ZX3dwRV4GCyNVMk+/erRmtRoJR2SrMcLtrZiYWq+HyixKn364BbGxKsFi9ufW43t/HbC8xisvGaHQjlPHPbTylUitnzXtaZZLQj+HQswtz8+frPeXvJ9R4zLiTaBs2MUZakgHWJLWucDSzIitTuQxaF+3uP45sZHSYA15I7c8i7lqVW2JXhq34BWZoft0MQs6kU5Vi6h7YFrmxvcuWIHJOW3mo+L12jZ6qRlwfLniw9vPAU1gz+UKSvmruVWPUGdfHsNpW56KI50p0mhRYcRV15fdS+NxP9iirN2R+UU8Tsu7NYBfgNDC/yOKNco2WgWHSkiMdkLLZ/CQPbBvSKUoUl5JVfHY6Ff76q6aKb7IYppEK3qt+3mkWKlTCeZEi60NqJHi59Qdc3ImVlktRode2zIkRLlZrG/lmSgnnbprpPlZ7+C0LJj+s668Dni/btZfOhrM+3mCr6hDjcl8lO5iUtW1kzLAXYURlNqazP72Rb///ggyZzsb9kT/BhAml6JiV/vsoYLzBrltwauK4iyN532o5THnKoOPZtBoPawxSranOxmrVJGee1z3edQ8iA==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(396003)(346002)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(478600001)(336012)(36860700001)(83380400001)(47076005)(6512007)(6486002)(86362001)(107886003)(356005)(81166007)(70206006)(316002)(26005)(53546011)(186003)(82740400003)(54906003)(6506007)(4326008)(70586007)(2616005)(6862004)(5660300002)(8936002)(2906002)(40460700003)(8676002)(41300700001)(40480700001)(33656002)(82310400005)(36756003)(32563001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 09:57:37.8495
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 97e77884-49a0-45f2-00a4-08db7c751930
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT007.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB10355

DQoNCj4gT24gMyBKdWwgMjAyMywgYXQgMjE6NTQsIFAgUyA8cGFpcnNwYWNlQGdtYWlsLmNvbT4g
d3JvdGU6DQo+IA0KPiANCj4gDQo+PiBPbiBKdWwgMywgMjAyMywgYXQgMTU6NDUsIEx1Y2EgRmFu
Y2VsbHUgPGx1Y2EuZmFuY2VsbHVAYXJtLmNvbT4gd3JvdGU6DQo+PiANCj4+IO+7vw0KPj4gDQo+
Pj4gT24gMyBKdWwgMjAyMywgYXQgMTg6NDgsIFN0ZWZhbm8gU3RhYmVsbGluaSA8c3N0YWJlbGxp
bmlAa2VybmVsLm9yZz4gd3JvdGU6DQo+Pj4gDQo+Pj4+IE9uIE1vbiwgMyBKdWwgMjAyMywgRGFu
aWVsIFAuIFNtaXRoIHdyb3RlOg0KPj4+PiBPbiA3LzEvMjMgMTE6MTMsIEx1Y2EgR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b21CIGFuZCBkb20wbGVzcyB3b3VsZCBiZSBjb3Zl
cmVkLiBUaGVyZQ0KPj4+IHdhcyBhIGdlbmVyYWwgb3Blbm5lc3MgdG8gdGhlIGlkZWEuIEFzIHN1
Y2gsIHNpbmNlIENocmlzdG9waGVyIGFuZA0KPj4+IG15c2VsZiBhcmUgaW4gdGhlIG1pZHN0IG9m
IGZpbmFsaXppbmcgdGhlIGRlc2lnbiBkb2N1bWVudCBmb3IgRG9tQiB3ZQ0KPj4+IGZlbHQgaXQg
bWlnaHQgYmUgYmV0dGVyIHRvIHNlZSBpZiBhIG5hbWUgY291bGQgYmUgc2VsZWN0ZWQgd2hpY2gg
d2UNCj4+PiBjb3VsZCB1c2UgaW4gdGhlIGRlc2lnbiBkb2MgaW4gbGlldSBvZiBEb21CLiBBcyBh
bHdheXMgbmFtaW5nIHRoaW5ncyBpcw0KPj4+IGhhcmQsIGJ1dCBhZnRlciBzb21lIGJyYWluc3Rv
cm1pbmcgd2UgYmVsaWV2ZSB3ZSBoYXZlIGFycml2ZWQgYXQgYQ0KPj4+IGRlY2VudCBuYW1lLCDO
vExhdW5jaCAobWljcm8tTGF1bmNoIG9yIHVMYXVuY2gpLg0KPj4+IA0KPj4+IC0tLQ0KPj4+IA0K
Pj4+IM68TGF1bmNoIGJlY2FtZSBoeXBlcmxhdW5jaCBmZXcgZGF5cyBhZnRlciwgYW5kIHRoZSBy
ZXN0IHdhcyBoaXN0b3J5IDotKQ0KPj4gDQo+PiANCg0K


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 10:10:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 10:10:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558226.872124 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGcyu-0008D6-MJ; Tue, 04 Jul 2023 10:10:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558226.872124; Tue, 04 Jul 2023 10:10:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGcyu-0008Cz-Jd; Tue, 04 Jul 2023 10:10:00 +0000
Received: by outflank-mailman (input) for mailman id 558226;
 Tue, 04 Jul 2023 10:09:59 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGcyt-0008Cp-DB; Tue, 04 Jul 2023 10:09:59 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGcys-00045z-TK; Tue, 04 Jul 2023 10:09:58 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGcys-0004Kj-9P; Tue, 04 Jul 2023 10:09:58 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qGcys-0003Ko-8e; Tue, 04 Jul 2023 10:09:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=iFavC+EK0FWsP1lHjixVXV0AnCfurkX9T1P4MvyFKVA=; b=AH287s9x/45tGmaMPbrnaDPe7w
	TWLgjIU8tuMgJaIbOFsfpGsbGdDQxjxeJy8NQTEOTjDRoVaM8LqIdaKg5c7v2+98pk0Q5zT1pVmbF
	vJzQQXwwKE3Zl8j9fTTjvmFsGFcHuTj0OAhp/PNom2suYlo4fYWO+43geXVvAa2dzjfo=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181689-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181689: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-amd64-i386-xl:xen-install:fail:heisenbug
    xen-unstable:test-amd64-amd64-dom0pvh-xl-amd:guest-start:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=f51e5d8eae8ece77a949571f39ee49904f3129aa
X-Osstest-Versions-That:
    xen=f51e5d8eae8ece77a949571f39ee49904f3129aa
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 04 Jul 2023 10:09:58 +0000

flight 181689 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181689/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail in 181683 pass in 181689
 test-amd64-i386-xl            7 xen-install                fail pass in 181683
 test-amd64-amd64-dom0pvh-xl-amd 14 guest-start             fail pass in 181683
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 181683

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181683
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181683
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181683
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181683
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181683
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181683
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181683
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181683
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181683
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181683
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181683
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181683
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  f51e5d8eae8ece77a949571f39ee49904f3129aa
baseline version:
 xen                  f51e5d8eae8ece77a949571f39ee49904f3129aa

Last test of basis   181689  2023-07-04 01:53:28 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           fail    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              fail    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 10:23:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 10:23:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558234.872134 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGdBs-0002ED-V2; Tue, 04 Jul 2023 10:23:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558234.872134; Tue, 04 Jul 2023 10:23:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGdBs-0002E6-SG; Tue, 04 Jul 2023 10:23:24 +0000
Received: by outflank-mailman (input) for mailman id 558234;
 Tue, 04 Jul 2023 10:23:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mVoD=CW=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qGdBr-0002E0-6O
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 10:23:23 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cc7e85a5-1a54-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 12:23:21 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.160.75.228])
 by support.bugseng.com (Postfix) with ESMTPSA id 23B094EE0738;
 Tue,  4 Jul 2023 12:23:17 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cc7e85a5-1a54-11ee-b237-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Paul Durrant <paul@xen.org>,
	Tamas K Lengyel <tamas@tklengyel.com>,
	Alexandru Isaila <aisaila@bitdefender.com>,
	Petre Pircalabu <ppircalabu@bitdefender.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: [XEN PATCH v2] x86: make function declarations consistent with definitions
Date: Tue,  4 Jul 2023 12:23:03 +0200
Message-Id: <1b2d5be30c0e4f335e59dce6e7c001cb0805d702.1688465215.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Change mechanically the parameter names and types of function
declarations to be consistent with the ones used in the corresponding
definitions so as to fix violations of MISRA C:2012 Rule 8.3 ("All
declarations of an object or function shall use the same names and type
qualifiers") and MISRA C:2012 Rule 8.2 ("Function types shall be in
prototype form with named parameters").

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
Changes in v2:
  - fixed violations of Rule 8.2;
  - fixed violations of Rule 8.3 not only for parameter names but
    also for types.
---
 xen/arch/x86/cpu/mcheck/mce.h           |  2 +-
 xen/arch/x86/cpu/mcheck/x86_mca.h       |  2 +-
 xen/arch/x86/hvm/rtc.c                  |  2 +-
 xen/arch/x86/hvm/svm/nestedhvm.h        |  2 +-
 xen/arch/x86/hvm/vioapic.c              |  2 +-
 xen/arch/x86/include/asm/genapic.h      |  2 +-
 xen/arch/x86/include/asm/guest_pt.h     |  2 +-
 xen/arch/x86/include/asm/hap.h          |  2 +-
 xen/arch/x86/include/asm/hvm/io.h       |  2 +-
 xen/arch/x86/include/asm/hvm/monitor.h  |  2 +-
 xen/arch/x86/include/asm/hvm/svm/vmcb.h |  2 +-
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h |  4 ++--
 xen/arch/x86/include/asm/hvm/vmx/vvmx.h | 16 +++++++-------
 xen/arch/x86/include/asm/io_apic.h      |  2 +-
 xen/arch/x86/include/asm/irq.h          |  6 ++---
 xen/arch/x86/include/asm/mem_access.h   |  2 +-
 xen/arch/x86/include/asm/mpspec.h       |  2 +-
 xen/arch/x86/include/asm/msi.h          |  4 ++--
 xen/arch/x86/include/asm/p2m.h          |  8 +++----
 xen/arch/x86/include/asm/paging.h       |  2 +-
 xen/arch/x86/include/asm/psr.h          |  2 +-
 xen/arch/x86/include/asm/setup.h        |  2 +-
 xen/arch/x86/include/asm/uaccess.h      |  6 ++---
 xen/arch/x86/include/asm/xstate.h       |  2 +-
 xen/include/xen/lib/x86/cpu-policy.h    | 29 +++++++++++++------------
 25 files changed, 55 insertions(+), 54 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.h b/xen/arch/x86/cpu/mcheck/mce.h
index bea08bdc74..72d8dbc471 100644
--- a/xen/arch/x86/cpu/mcheck/mce.h
+++ b/xen/arch/x86/cpu/mcheck/mce.h
@@ -44,7 +44,7 @@ extern uint8_t cmci_apic_vector;
 extern bool lmce_support;
 
 /* Init functions */
-enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *c);
+enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *ci);
 enum mcheck_type intel_mcheck_init(struct cpuinfo_x86 *c, bool bsp);
 
 void amd_nonfatal_mcheck_init(struct cpuinfo_x86 *c);
diff --git a/xen/arch/x86/cpu/mcheck/x86_mca.h b/xen/arch/x86/cpu/mcheck/x86_mca.h
index 18116737af..36b6127a37 100644
--- a/xen/arch/x86/cpu/mcheck/x86_mca.h
+++ b/xen/arch/x86/cpu/mcheck/x86_mca.h
@@ -113,7 +113,7 @@ static inline int mcabanks_test(int bit, struct mca_banks* banks)
     return test_bit(bit, banks->bank_map);
 }
 
-struct mca_banks *mcabanks_alloc(unsigned int nr);
+struct mca_banks *mcabanks_alloc(unsigned int nr_mce_banks);
 void mcabanks_free(struct mca_banks *banks);
 extern struct mca_banks *mca_allbanks;
 
diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index c1ab6c7d58..ebb259586a 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -59,7 +59,7 @@ enum rtc_mode {
 static void rtc_copy_date(RTCState *s);
 static void rtc_set_time(RTCState *s);
 static inline int from_bcd(RTCState *s, int a);
-static inline int convert_hour(RTCState *s, int hour);
+static inline int convert_hour(RTCState *s, int raw);
 
 static void rtc_update_irq(RTCState *s)
 {
diff --git a/xen/arch/x86/hvm/svm/nestedhvm.h b/xen/arch/x86/hvm/svm/nestedhvm.h
index 43245e13de..eb9c416307 100644
--- a/xen/arch/x86/hvm/svm/nestedhvm.h
+++ b/xen/arch/x86/hvm/svm/nestedhvm.h
@@ -42,7 +42,7 @@ int cf_check nsvm_vcpu_initialise(struct vcpu *v);
 int cf_check nsvm_vcpu_reset(struct vcpu *v);
 int nsvm_vcpu_vmrun(struct vcpu *v, struct cpu_user_regs *regs);
 int cf_check nsvm_vcpu_vmexit_event(struct vcpu *v,
-                                    const struct x86_event *event);
+                                    const struct x86_event *trap);
 uint64_t cf_check nsvm_vcpu_hostcr3(struct vcpu *v);
 bool cf_check nsvm_vmcb_guest_intercepts_event(
     struct vcpu *v, unsigned int vector, int errcode);
diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index 41e3c4d5e4..4e40d3609a 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -43,7 +43,7 @@
 /* HACK: Route IRQ0 only to VCPU0 to prevent time jumps. */
 #define IRQ0_SPECIAL_ROUTING 1
 
-static void vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int irq);
+static void vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int pin);
 
 static struct hvm_vioapic *addr_vioapic(const struct domain *d,
                                         unsigned long addr)
diff --git a/xen/arch/x86/include/asm/genapic.h b/xen/arch/x86/include/asm/genapic.h
index beeaddf19d..970df8ffe0 100644
--- a/xen/arch/x86/include/asm/genapic.h
+++ b/xen/arch/x86/include/asm/genapic.h
@@ -43,7 +43,7 @@ void cf_check send_IPI_self_legacy(uint8_t vector);
 
 void cf_check init_apic_ldr_flat(void);
 unsigned int cf_check cpu_mask_to_apicid_flat(const cpumask_t *cpumask);
-void cf_check send_IPI_mask_flat(const cpumask_t *mask, int vector);
+void cf_check send_IPI_mask_flat(const cpumask_t *cpumask, int vector);
 const cpumask_t *cf_check vector_allocation_cpumask_flat(int cpu);
 #define GENAPIC_FLAT \
 	.int_delivery_mode = dest_LowestPrio, \
diff --git a/xen/arch/x86/include/asm/guest_pt.h b/xen/arch/x86/include/asm/guest_pt.h
index bde7588342..f616357107 100644
--- a/xen/arch/x86/include/asm/guest_pt.h
+++ b/xen/arch/x86/include/asm/guest_pt.h
@@ -422,7 +422,7 @@ static inline unsigned int guest_walk_to_page_order(const walk_t *gw)
 
 bool
 guest_walk_tables(const struct vcpu *v, struct p2m_domain *p2m,
-                  unsigned long va, walk_t *gw, uint32_t pfec,
+                  unsigned long va, walk_t *gw, uint32_t walk,
                   gfn_t top_gfn, mfn_t top_mfn, void *top_map);
 
 /* Pretty-print the contents of a guest-walk */
diff --git a/xen/arch/x86/include/asm/hap.h b/xen/arch/x86/include/asm/hap.h
index 9d12327b12..05e124ad57 100644
--- a/xen/arch/x86/include/asm/hap.h
+++ b/xen/arch/x86/include/asm/hap.h
@@ -30,7 +30,7 @@ void  hap_vcpu_init(struct vcpu *v);
 int   hap_track_dirty_vram(struct domain *d,
                            unsigned long begin_pfn,
                            unsigned int nr_frames,
-                           XEN_GUEST_HANDLE(void) dirty_bitmap);
+                           XEN_GUEST_HANDLE(void) guest_dirty_bitmap);
 
 extern const struct paging_mode *hap_paging_get_mode(struct vcpu *);
 int hap_set_allocation(struct domain *d, unsigned int pages, bool *preempted);
diff --git a/xen/arch/x86/include/asm/hvm/io.h b/xen/arch/x86/include/asm/hvm/io.h
index 8df33eb6cc..cad082f020 100644
--- a/xen/arch/x86/include/asm/hvm/io.h
+++ b/xen/arch/x86/include/asm/hvm/io.h
@@ -90,7 +90,7 @@ bool handle_mmio_with_translation(unsigned long gla, unsigned long gpfn,
                                   struct npfec);
 bool handle_pio(uint16_t port, unsigned int size, int dir);
 void hvm_interrupt_post(struct vcpu *v, int vector, int type);
-void hvm_dpci_eoi(struct domain *d, unsigned int guest_irq);
+void hvm_dpci_eoi(struct domain *d, unsigned int guest_gsi);
 void msix_write_completion(struct vcpu *);
 
 #ifdef CONFIG_HVM
diff --git a/xen/arch/x86/include/asm/hvm/monitor.h b/xen/arch/x86/include/asm/hvm/monitor.h
index 5276b0af08..02021be47b 100644
--- a/xen/arch/x86/include/asm/hvm/monitor.h
+++ b/xen/arch/x86/include/asm/hvm/monitor.h
@@ -25,7 +25,7 @@ bool hvm_monitor_cr(unsigned int index, unsigned long value,
                     unsigned long old);
 #define hvm_monitor_crX(cr, new, old) \
                         hvm_monitor_cr(VM_EVENT_X86_##cr, new, old)
-bool hvm_monitor_msr(unsigned int msr, uint64_t value, uint64_t old_value);
+bool hvm_monitor_msr(unsigned int msr, uint64_t new_value, uint64_t old_value);
 void hvm_monitor_descriptor_access(uint64_t exit_info,
                                    uint64_t vmx_exit_qualification,
                                    uint8_t descriptor, bool is_write);
diff --git a/xen/arch/x86/include/asm/hvm/svm/vmcb.h b/xen/arch/x86/include/asm/hvm/svm/vmcb.h
index a1a8a7fd25..91221ff4e2 100644
--- a/xen/arch/x86/include/asm/hvm/svm/vmcb.h
+++ b/xen/arch/x86/include/asm/hvm/svm/vmcb.h
@@ -607,7 +607,7 @@ void setup_vmcb_dump(void);
 #define MSR_INTERCEPT_READ    1
 #define MSR_INTERCEPT_WRITE   2
 #define MSR_INTERCEPT_RW      (MSR_INTERCEPT_WRITE | MSR_INTERCEPT_READ)
-void svm_intercept_msr(struct vcpu *v, uint32_t msr, int enable);
+void svm_intercept_msr(struct vcpu *v, uint32_t msr, int flags);
 #define svm_disable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr), MSR_INTERCEPT_NONE)
 #define svm_enable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr), MSR_INTERCEPT_RW)
 
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
index d07fcb2bc9..20ef8e3137 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
@@ -656,10 +656,10 @@ bool vmx_msr_is_intercepted(struct vmx_msr_bitmap *msr_bitmap,
                             unsigned int msr, bool is_write) __nonnull(1);
 void virtual_vmcs_enter(const struct vcpu *);
 void virtual_vmcs_exit(const struct vcpu *);
-u64 virtual_vmcs_vmread(const struct vcpu *, u32 encoding);
+u64 virtual_vmcs_vmread(const struct vcpu *v, u32 vmcs_encoding);
 enum vmx_insn_errno virtual_vmcs_vmread_safe(const struct vcpu *v,
                                              u32 vmcs_encoding, u64 *val);
-void virtual_vmcs_vmwrite(const struct vcpu *, u32 encoding, u64 val);
+void virtual_vmcs_vmwrite(const struct vcpu *v, u32 vmcs_encoding, u64 val);
 enum vmx_insn_errno virtual_vmcs_vmwrite_safe(const struct vcpu *v,
                                               u32 vmcs_encoding, u64 val);
 
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vvmx.h b/xen/arch/x86/include/asm/hvm/vmx/vvmx.h
index dc9db69258..715e509bc2 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vvmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vvmx.h
@@ -144,15 +144,15 @@ enum vvmcs_encoding_type {
     VVMCS_TYPE_HSTATE,
 };
 
-u64 get_vvmcs_virtual(void *vvmcs, u32 encoding);
-u64 get_vvmcs_real(const struct vcpu *, u32 encoding);
-void set_vvmcs_virtual(void *vvmcs, u32 encoding, u64 val);
-void set_vvmcs_real(const struct vcpu *, u32 encoding, u64 val);
+uint64_t get_vvmcs_virtual(void *vvmcs, uint32_t vmcs_encoding);
+u64 get_vvmcs_real(const struct vcpu *v, u32 encoding);
+void set_vvmcs_virtual(void *vvmcs, uint32_t vmcs_encoding, uint64_t val);
+void set_vvmcs_real(const struct vcpu *v, u32 encoding, u64 val);
 enum vmx_insn_errno get_vvmcs_virtual_safe(void *vvmcs, u32 encoding, u64 *val);
-enum vmx_insn_errno get_vvmcs_real_safe(const struct vcpu *, u32 encoding,
+enum vmx_insn_errno get_vvmcs_real_safe(const struct vcpu *v, u32 encoding,
                                         u64 *val);
 enum vmx_insn_errno set_vvmcs_virtual_safe(void *vvmcs, u32 encoding, u64 val);
-enum vmx_insn_errno set_vvmcs_real_safe(const struct vcpu *, u32 encoding,
+enum vmx_insn_errno set_vvmcs_real_safe(const struct vcpu *v, u32 encoding,
                                         u64 val);
 
 #define get_vvmcs(vcpu, encoding) \
@@ -180,9 +180,9 @@ int nvmx_handle_vmx_insn(struct cpu_user_regs *regs, unsigned int exit_reason);
 int nvmx_msr_read_intercept(unsigned int msr,
                                 u64 *msr_content);
 
-void nvmx_update_exec_control(struct vcpu *v, u32 value);
+void nvmx_update_exec_control(struct vcpu *v, u32 host_cntrl);
 void nvmx_update_secondary_exec_control(struct vcpu *v,
-                                        unsigned long value);
+                                        unsigned long host_cntrl);
 void nvmx_update_exception_bitmap(struct vcpu *v, unsigned long value);
 void nvmx_switch_guest(void);
 void nvmx_idtv_handling(void);
diff --git a/xen/arch/x86/include/asm/io_apic.h b/xen/arch/x86/include/asm/io_apic.h
index ef0878b09e..9b22448ef0 100644
--- a/xen/arch/x86/include/asm/io_apic.h
+++ b/xen/arch/x86/include/asm/io_apic.h
@@ -207,6 +207,6 @@ extern int restore_IO_APIC_setup(struct IO_APIC_route_entry **ioapic_entries,
 unsigned highest_gsi(void);
 
 int ioapic_guest_read( unsigned long physbase, unsigned int reg, u32 *pval);
-int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 pval);
+int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val);
 
 #endif
diff --git a/xen/arch/x86/include/asm/irq.h b/xen/arch/x86/include/asm/irq.h
index 424b0e1af8..f49388a47f 100644
--- a/xen/arch/x86/include/asm/irq.h
+++ b/xen/arch/x86/include/asm/irq.h
@@ -112,7 +112,7 @@ void cf_check enable_8259A_irq(struct irq_desc *);
 int i8259A_irq_pending(unsigned int irq);
 void mask_8259A(void);
 void unmask_8259A(void);
-void init_8259A(int aeoi);
+void init_8259A(int auto_eoi);
 void make_8259A_irq(unsigned int irq);
 bool bogus_8259A_irq(unsigned int irq);
 int i8259A_suspend(void);
@@ -141,7 +141,7 @@ struct arch_pirq {
 #define pirq_dpci(pirq) ((pirq) ? &(pirq)->arch.hvm.dpci : NULL)
 #define dpci_pirq(pd) container_of(pd, struct pirq, arch.hvm.dpci)
 
-int pirq_shared(struct domain *d , int irq);
+int pirq_shared(struct domain *d , int pirq);
 
 int map_domain_pirq(struct domain *d, int pirq, int irq, int type,
                            void *data);
@@ -149,7 +149,7 @@ int unmap_domain_pirq(struct domain *d, int pirq);
 int get_free_pirq(struct domain *d, int type);
 int get_free_pirqs(struct domain *, unsigned int nr);
 void free_domain_pirqs(struct domain *d);
-int map_domain_emuirq_pirq(struct domain *d, int pirq, int irq);
+int map_domain_emuirq_pirq(struct domain *d, int pirq, int emuirq);
 int unmap_domain_pirq_emuirq(struct domain *d, int pirq);
 
 /* Reset irq affinities to match the given CPU mask. */
diff --git a/xen/arch/x86/include/asm/mem_access.h b/xen/arch/x86/include/asm/mem_access.h
index 8957e1181c..1a52a10322 100644
--- a/xen/arch/x86/include/asm/mem_access.h
+++ b/xen/arch/x86/include/asm/mem_access.h
@@ -39,7 +39,7 @@ int p2m_set_suppress_ve(struct domain *d, gfn_t gfn, bool suppress_ve,
 
 struct xen_hvm_altp2m_suppress_ve_multi;
 int p2m_set_suppress_ve_multi(struct domain *d,
-                              struct xen_hvm_altp2m_suppress_ve_multi *suppress_ve);
+                              struct xen_hvm_altp2m_suppress_ve_multi *sve);
 
 int p2m_get_suppress_ve(struct domain *d, gfn_t gfn, bool *suppress_ve,
                         unsigned int altp2m_idx);
diff --git a/xen/arch/x86/include/asm/mpspec.h b/xen/arch/x86/include/asm/mpspec.h
index 1246eece0b..cf8b360259 100644
--- a/xen/arch/x86/include/asm/mpspec.h
+++ b/xen/arch/x86/include/asm/mpspec.h
@@ -26,7 +26,7 @@ extern void mp_register_lapic_address (u64 address);
 extern void mp_register_ioapic (u8 id, u32 address, u32 gsi_base);
 extern void mp_override_legacy_irq (u8 bus_irq, u8 polarity, u8 trigger, u32 gsi);
 extern void mp_config_acpi_legacy_irqs (void);
-extern int mp_register_gsi (u32 gsi, int edge_level, int active_high_low);
+extern int mp_register_gsi (u32 gsi, int triggering, int polarity);
 #endif /* CONFIG_ACPI */
 
 #define PHYSID_ARRAY_SIZE	BITS_TO_LONGS(MAX_APICS)
diff --git a/xen/arch/x86/include/asm/msi.h b/xen/arch/x86/include/asm/msi.h
index a53ade95c9..687df5942a 100644
--- a/xen/arch/x86/include/asm/msi.h
+++ b/xen/arch/x86/include/asm/msi.h
@@ -82,7 +82,7 @@ struct hw_interrupt_type;
 struct msi_desc;
 /* Helper functions */
 extern int pci_enable_msi(struct msi_info *msi, struct msi_desc **desc);
-extern void pci_disable_msi(struct msi_desc *desc);
+extern void pci_disable_msi(struct msi_desc *msi_desc);
 extern int pci_prepare_msix(u16 seg, u8 bus, u8 devfn, bool off);
 extern void pci_cleanup_msi(struct pci_dev *pdev);
 extern int setup_msi_irq(struct irq_desc *, struct msi_desc *);
@@ -220,7 +220,7 @@ struct arch_msix {
 };
 
 void early_msi_init(void);
-void msi_compose_msg(unsigned vector, const cpumask_t *mask,
+void msi_compose_msg(unsigned vector, const cpumask_t *cpu_mask,
                      struct msi_msg *msg);
 void __msi_set_enable(u16 seg, u8 bus, u8 slot, u8 func, int pos, int enable);
 void cf_check mask_msi_irq(struct irq_desc *);
diff --git a/xen/arch/x86/include/asm/p2m.h b/xen/arch/x86/include/asm/p2m.h
index 40545f5fa8..67bd3201bc 100644
--- a/xen/arch/x86/include/asm/p2m.h
+++ b/xen/arch/x86/include/asm/p2m.h
@@ -632,7 +632,7 @@ void p2m_change_type_range(struct domain *d,
                            p2m_type_t ot, p2m_type_t nt);
 
 /* Compare-exchange the type of a single p2m entry */
-int p2m_change_type_one(struct domain *d, unsigned long gfn,
+int p2m_change_type_one(struct domain *d, unsigned long gfn_l,
                         p2m_type_t ot, p2m_type_t nt);
 
 /* Synchronously change the p2m type for a range of gfns */
@@ -661,9 +661,9 @@ int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
                            p2m_access_t p2ma, unsigned int flag);
 int clear_identity_p2m_entry(struct domain *d, unsigned long gfn);
 /* HVM-only callers can use these directly: */
-int p2m_add_identity_entry(struct domain *d, unsigned long gfn,
+int p2m_add_identity_entry(struct domain *d, unsigned long gfn_l,
                            p2m_access_t p2ma, unsigned int flag);
-int p2m_remove_identity_entry(struct domain *d, unsigned long gfn);
+int p2m_remove_identity_entry(struct domain *d, unsigned long gfn_l);
 
 /* 
  * Populate-on-demand
@@ -924,7 +924,7 @@ int p2m_altp2m_propagate_change(struct domain *d, gfn_t gfn,
                                 p2m_type_t p2mt, p2m_access_t p2ma);
 
 /* Set a specific p2m view visibility */
-int p2m_set_altp2m_view_visibility(struct domain *d, unsigned int idx,
+int p2m_set_altp2m_view_visibility(struct domain *d, unsigned int altp2m_idx,
                                    uint8_t visible);
 #else /* !CONFIG_HVM */
 struct p2m_domain *p2m_get_altp2m(struct vcpu *v);
diff --git a/xen/arch/x86/include/asm/paging.h b/xen/arch/x86/include/asm/paging.h
index 403243bfbd..a72a8d63ce 100644
--- a/xen/arch/x86/include/asm/paging.h
+++ b/xen/arch/x86/include/asm/paging.h
@@ -246,7 +246,7 @@ paging_fault(unsigned long va, struct cpu_user_regs *regs)
 }
 
 /* Handle invlpg requests on vcpus. */
-void paging_invlpg(struct vcpu *v, unsigned long va);
+void paging_invlpg(struct vcpu *v, unsigned long linear);
 
 /*
  * Translate a guest virtual address to the frame number that the
diff --git a/xen/arch/x86/include/asm/psr.h b/xen/arch/x86/include/asm/psr.h
index c2257da7fc..8ecb7a0eea 100644
--- a/xen/arch/x86/include/asm/psr.h
+++ b/xen/arch/x86/include/asm/psr.h
@@ -81,7 +81,7 @@ int psr_get_info(unsigned int socket, enum psr_type type,
 int psr_get_val(struct domain *d, unsigned int socket,
                 uint32_t *val, enum psr_type type);
 int psr_set_val(struct domain *d, unsigned int socket,
-                uint64_t val, enum psr_type type);
+                uint64_t new_val, enum psr_type type);
 
 void psr_domain_init(struct domain *d);
 void psr_domain_free(struct domain *d);
diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index ae0dd3915a..29ccacfd7f 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -33,7 +33,7 @@ static inline void vesa_init(void) {};
 
 int construct_dom0(
     struct domain *d,
-    const module_t *kernel, unsigned long kernel_headroom,
+    const module_t *image, unsigned long image_headroom,
     module_t *initrd,
     char *cmdline);
 void setup_io_bitmap(struct domain *d);
diff --git a/xen/arch/x86/include/asm/uaccess.h b/xen/arch/x86/include/asm/uaccess.h
index 684fccd95c..7443519d5b 100644
--- a/xen/arch/x86/include/asm/uaccess.h
+++ b/xen/arch/x86/include/asm/uaccess.h
@@ -10,10 +10,10 @@
 #include <asm/x86_64/uaccess.h>
 
 unsigned int copy_to_guest_pv(void __user *to, const void *from,
-                              unsigned int len);
-unsigned int clear_guest_pv(void __user *to, unsigned int len);
+                              unsigned int n);
+unsigned int clear_guest_pv(void __user *to, unsigned int n);
 unsigned int copy_from_guest_pv(void *to, const void __user *from,
-                                unsigned int len);
+                                unsigned int n);
 
 /* Handles exceptions in both to and from, but doesn't do access_ok */
 unsigned int copy_to_guest_ll(void __user*to, const void *from, unsigned int n);
diff --git a/xen/arch/x86/include/asm/xstate.h b/xen/arch/x86/include/asm/xstate.h
index 7ab0bdde89..4fb4312192 100644
--- a/xen/arch/x86/include/asm/xstate.h
+++ b/xen/arch/x86/include/asm/xstate.h
@@ -87,7 +87,7 @@ struct xstate_bndcsr {
 };
 
 /* extended state operations */
-bool __must_check set_xcr0(u64 xfeatures);
+bool __must_check set_xcr0(u64 val);
 uint64_t get_xcr0(void);
 void set_msr_xss(u64 xss);
 uint64_t get_msr_xss(void);
diff --git a/xen/include/xen/lib/x86/cpu-policy.h b/xen/include/xen/lib/x86/cpu-policy.h
index 6d5e9edd26..bab3eecda6 100644
--- a/xen/include/xen/lib/x86/cpu-policy.h
+++ b/xen/include/xen/lib/x86/cpu-policy.h
@@ -451,23 +451,24 @@ typedef xen_msr_entry_t msr_entry_buffer_t[];
  * Serialise the CPUID leaves of a cpu_policy object into an array of cpuid
  * leaves.
  *
- * @param policy     The cpu_policy to serialise.
- * @param leaves     The array of leaves to serialise into.
- * @param nr_entries The number of entries in 'leaves'.
+ * @param p            The cpu_policy to serialise.
+ * @param leaves       The array of leaves to serialise into.
+ * @param nr_entries_p The number of entries in 'leaves'.
  * @returns -errno
  *
  * Writes at most CPUID_MAX_SERIALISED_LEAVES.  May fail with -ENOBUFS if the
  * leaves array is too short.  On success, nr_entries is updated with the
  * actual number of leaves written.
  */
-int x86_cpuid_copy_to_buffer(const struct cpu_policy *policy,
-                             cpuid_leaf_buffer_t leaves, uint32_t *nr_entries);
+int x86_cpuid_copy_to_buffer(const struct cpu_policy *p,
+                             cpuid_leaf_buffer_t leaves,
+                             uint32_t *nr_entries_p);
 
 /**
  * Unserialise the CPUID leaves of a cpu_policy object into an array of cpuid
  * leaves.
  *
- * @param policy      The cpu_policy to unserialise into.
+ * @param p           The cpu_policy to unserialise into.
  * @param leaves      The array of leaves to unserialise from.
  * @param nr_entries  The number of entries in 'leaves'.
  * @param err_leaf    Optional hint for error diagnostics.
@@ -481,7 +482,7 @@ int x86_cpuid_copy_to_buffer(const struct cpu_policy *policy,
  * No content validation of in-range leaves is performed.  Synthesised data is
  * recalculated.
  */
-int x86_cpuid_copy_from_buffer(struct cpu_policy *policy,
+int x86_cpuid_copy_from_buffer(struct cpu_policy *p,
                                const cpuid_leaf_buffer_t leaves,
                                uint32_t nr_entries, uint32_t *err_leaf,
                                uint32_t *err_subleaf);
@@ -489,22 +490,22 @@ int x86_cpuid_copy_from_buffer(struct cpu_policy *policy,
 /**
  * Serialise the MSRs of a cpu_policy object into an array.
  *
- * @param policy     The cpu_policy to serialise.
- * @param msrs       The array of msrs to serialise into.
- * @param nr_entries The number of entries in 'msrs'.
+ * @param p            The cpu_policy to serialise.
+ * @param msrs         The array of msrs to serialise into.
+ * @param nr_entries_p The number of entries in 'msrs'.
  * @returns -errno
  *
  * Writes at most MSR_MAX_SERIALISED_ENTRIES.  May fail with -ENOBUFS if the
  * buffer array is too short.  On success, nr_entries is updated with the
  * actual number of msrs written.
  */
-int x86_msr_copy_to_buffer(const struct cpu_policy *policy,
-                           msr_entry_buffer_t msrs, uint32_t *nr_entries);
+int x86_msr_copy_to_buffer(const struct cpu_policy *p,
+                           msr_entry_buffer_t msrs, uint32_t *nr_entries_p);
 
 /**
  * Unserialise the MSRs of a cpu_policy object from an array of msrs.
  *
- * @param policy     The cpu_policy object to unserialise into.
+ * @param p          The cpu_policy object to unserialise into.
  * @param msrs       The array of msrs to unserialise from.
  * @param nr_entries The number of entries in 'msrs'.
  * @param err_msr    Optional hint for error diagnostics.
@@ -518,7 +519,7 @@ int x86_msr_copy_to_buffer(const struct cpu_policy *policy,
  *
  * No content validation is performed on the data stored in the policy object.
  */
-int x86_msr_copy_from_buffer(struct cpu_policy *policy,
+int x86_msr_copy_from_buffer(struct cpu_policy *p,
                              const msr_entry_buffer_t msrs, uint32_t nr_entries,
                              uint32_t *err_msr);
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 10:37:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 10:37:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558240.872143 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGdPA-0003o3-0s; Tue, 04 Jul 2023 10:37:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558240.872143; Tue, 04 Jul 2023 10:37:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGdP9-0003nw-UR; Tue, 04 Jul 2023 10:37:07 +0000
Received: by outflank-mailman (input) for mailman id 558240;
 Tue, 04 Jul 2023 10:37:06 +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
 <SRS0=Gy6C=CW=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qGdP8-0003nq-1r
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 10:37:06 +0000
Received: from NAM04-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam04on20602.outbound.protection.outlook.com
 [2a01:111:f400:7e8d::602])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b61b1842-1a56-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 12:37:03 +0200 (CEST)
Received: from SN6PR12MB2621.namprd12.prod.outlook.com (2603:10b6:805:73::15)
 by PH7PR12MB8015.namprd12.prod.outlook.com (2603:10b6:510:26a::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 10:36:57 +0000
Received: from SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54]) by SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54%2]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 10:36:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b61b1842-1a56-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=YV/ULC8jdRav2Z/oiP2bCUuzmVFplGVxOLROBKw880zctX5NjsbUou/j+9gml0E0hCK4fjQdt51PcLoaXrrwK13iFgADQWDWLeaUTsM9X1KzyAJHzIMFWHSTmN3W6ZLPaMyR72jJYE5wTGliiI/gfuN+xGJ0TqZGRrzwoQ7SiyZQKrBogqGWnTk9ejXDca0vy/lX4Ids27r4h3VLV/IpQ+DYNF0Tr62MkoDQn87akI0yt/ql6D4BVmOCdKUpdEGDa0er7zYHzWGlriOAdEIl+p7h4lG2eChciptSFL6H6MGuPYC6DZZfsNuDHE5T3IsmBVQtE4TUCqOelk9HdfNnEg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=PJUjuyEd1TRdKKm1b4FR9xxd+vZ5JueFE4Et58xUmqs=;
 b=KO2EHMN4+p6ou6ixrO/7ShOmkHKmk83tlC9uUz6gJKdaLiWCD/21hK7rGYU+CjX6z18pFQQledpWOg8eYeSYUUS40smowrKwwS76AEvGL9aaiGWleL81+QxXmnUVY6WPZ/aG9O6H+rPiZHMO798Rrd0t3Bgj6i4dvQNLWttHnc4d1bfeaLJdYxg061EC/kG+eIGbTDlizIAY6TeGck2PiF51PyCiDHwbIFt6FVg+HGFVbgzyDFOW/QtyHm2XC2a2KowYMbEWEHum/TVyQiT0XIzRqR6ZH3cdp3d9e7YEOZ8V6j+/Z17FCa1oARUgY8IbUArx3YUSP6miXwkYNsMwkQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=PJUjuyEd1TRdKKm1b4FR9xxd+vZ5JueFE4Et58xUmqs=;
 b=ECTbz6dR+/qsrqBThMeoivFiUnKwHyrFp867EqfPRPYO2jkVuS+5tO34EL4N8UfJjKutmLAQaIY5c/kTSYvllCN4ZXSC3g2H+RMIOIfIepD5I7RMP/ri1RxuW4iBwRkjXotR7y+lYa2W1AvcEQEiX0XPwmxmUwVOBbK3dt7Oa24=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <cb7e3d34-bbb8-e5df-f87b-0fcac4b65378@amd.com>
Date: Tue, 4 Jul 2023 11:36:51 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 03/52] xen/arm: add an option to define Xen start
 address for Armv8-R
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-4-Penny.Zheng@arm.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <20230626033443.2943270-4-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P265CA0191.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:311::19) To SN6PR12MB2621.namprd12.prod.outlook.com
 (2603:10b6:805:73::15)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN6PR12MB2621:EE_|PH7PR12MB8015:EE_
X-MS-Office365-Filtering-Correlation-Id: 5a612fa2-c3dc-44ad-4725-08db7c7a9737
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	UH+QxOw97lKT1oXpCfTK+NosbhFF0Ms+e90DeSrSt3DqJJO2WCDATTJEnuS9RdHsG8ngC7IxIy2wSSB41JUbdWv5suBpf0gG+5oZWFfaVL9/NVGjcdfbXZx1CwlarP3go4eIpbI0OkUH0b1Z3oIkIOv3t9pQNMbxwZok1SnY5O5H5HVsi0m5mJcalEqtcIwTa9NeXWwV9R76UGJCn/+jMxwFOFocGScnC/1Jdq8mE7pqT1B+oLY0CT4QHHKG9z0NhO1/26KsAYoQp8GQpXlmBemfBuCh7WwKMxlZrdHmz202hXBzwxYzw49wz3JmAGMl3ZIfcW+UfNSvj99w8GWAw69gFtrXAyX+nbIgujLzhk46CT1U9iorx4jmKrph0ESs0BoN9Fd6ecWndNb5DRintrlLHWN6grTqMvvWfy4txxNaKtpzFm/obugt8wvbd8R3A6MKWmlxhErXpH/Uug1kTOFn1FVqJMBa9kjvOEFj3F7Kk0KN5n5QbuQEXjr4Ldlr18ldpFdcgHoMzlqAOz6XztyAagSidKC9de7HPVe/RJY2JGpl0xa5f4IZKNeBlrwALD7u+XoYfN2JSTpuzf7NjmURW6YNVSjjsgUZ7WLCLRUd3h4L97i3VhNMQ/M5i/4+DtelwgaFYumrxn0JdzSASA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2621.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(136003)(346002)(39860400002)(366004)(451199021)(6666004)(38100700002)(2906002)(6486002)(54906003)(8936002)(8676002)(36756003)(41300700001)(5660300002)(478600001)(31696002)(66946007)(66556008)(66476007)(53546011)(186003)(6506007)(26005)(6512007)(4326008)(316002)(31686004)(2616005)(966005)(83380400001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RDVlTzFRc1BjcHhrenhpaDFVa2tFRURsdVh1Y1hoL3NnVEpWNjVnOTBxUjR0?=
 =?utf-8?B?ZENMcmEzbUh6bDAyR2lkWG9Rc0wrelNzaUZWZDlmckJrd2U2VkJabVQ3ZWFt?=
 =?utf-8?B?Wkh6RU9oWTdJakxXVFdzTktjb0toNjE0Mi9sREtEdkVFRFZobURDYzg0cS9j?=
 =?utf-8?B?aXVMbm1RRTNtaUhEREdURDd1NXFJd09kcjNML0c5bG1IVTVPdzQ3SXVJN1dF?=
 =?utf-8?B?TWh6OXcydmM4Z3VndGI4djZ3dW1VVmwvQ2w2dEpMQkN2UGNOOGVabDdpSDBt?=
 =?utf-8?B?SU5JemtqQ1V5aU5JL3FZQUJHNjNPOVRGanYzME05K2VmMXQrMHFoR1AwRVNC?=
 =?utf-8?B?T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XZadWZ5?=
 =?utf-8?Q?0fcnfQrs5wX/XS4yUirmPRamp?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5a612fa2-c3dc-44ad-4725-08db7c7a9737
X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2621.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 10:36:56.9204
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: OnTkVpegT3v/8yG1SZ34GxwAKvBqXcTV0aaPLcUe170xX/4rRzVkipoemdQxp5ZbFQqhj2H8mCLiRcL9hmV5Mg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8015

Hi Penny,

On 26/06/2023 04:33, Penny Zheng wrote:
> CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
>
>
> From: Wei Chen <wei.chen@arm.com>
>
> On Armv8-A, Xen has a fixed virtual start address (link address
> too) for all Armv8-A platforms. In an MMU based system, Xen can
> map its loaded address to this virtual start address. So, on
> Armv8-A platforms, the Xen start address does not need to be
> configurable. But on Armv8-R platforms, there is no MMU to map
> loaded address to a fixed virtual address and different platforms
> will have very different address space layout. So Xen cannot use
> a fixed physical address on MPU based system and need to have it
> configurable.
>
> In this patch we introduce one Kconfig option for users to define
> the default Xen start address for Armv8-R. Users can enter the
> address in config time, or select the tailored platform config
> file from arch/arm/configs.
>
> And as we introduced Armv8-R to Xen, that means the existed Arm64
> MMU based platforms should not be listed in Armv8-R platform
> list, so we add !HAS_MPU dependency for these platforms.
>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> ---
> v1 -> v2:
> 1. Remove the platform header fvp_baser.h.
> 2. Remove the default start address for fvp_baser64.
> 3. Remove the description of default address from commit log.
> 4. Change HAS_MPU to ARM_V8R for Xen start address dependency.
>     No matter Arm-v8r board has MPU or not, it always need to
>     specify the start address.
> ---
> v3:
> 1. Remove unrelated change of "CONFIG_FVP_BASER"
> 2. Change ARM_V8R to HAS_MPU for Xen start address dependency
> ---
>   xen/arch/arm/Kconfig           | 8 ++++++++
>   xen/arch/arm/platforms/Kconfig | 8 +++++---
>   2 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> index 70fdc2ba63..ff17345cdb 100644
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -181,6 +181,14 @@ config TEE
>            This option enables generic TEE mediators support. It allows guests
>            to access real TEE via one of TEE mediators implemented in XEN.
>
> +config XEN_START_ADDRESS
> +       hex "Xen start address: keep default to use platform defined address"
> +       default 0
> +       depends on HAS_MPU
> +       help
> +         This option allows to set the customized address at which Xen will be
> +         linked on MPU systems. This address must be aligned to a page size.
> +
>   source "arch/arm/tee/Kconfig"
>
>   config STATIC_SHM
> diff --git a/xen/arch/arm/platforms/Kconfig b/xen/arch/arm/platforms/Kconfig
> index c93a6b2756..75af48b5f9 100644
> --- a/xen/arch/arm/platforms/Kconfig
> +++ b/xen/arch/arm/platforms/Kconfig
> @@ -1,6 +1,7 @@
>   choice
>          prompt "Platform Support"
>          default ALL_PLAT
> +       default NO_PLAT if HAS_MPU

I am a bit concerned about this as we will be introducing R52 specific 
platform in xen/arch/arm/platforms/

(For eg 
https://github.com/Xilinx/xen/blob/xlnx_rebase_4.17/xen/arch/arm_mpu/platforms/amd-versal-net.c 
)

Thus, we will have to remove this line at that time.

Can you remove this line, please if it does not cause any issue ?

- Ayan

>          ---help---
>          Choose which hardware platform to enable in Xen.
>
> @@ -8,13 +9,14 @@ choice
>
>   config ALL_PLAT
>          bool "All Platforms"
> +       depends on !HAS_MPU
>          ---help---
>          Enable support for all available hardware platforms. It doesn't
>          automatically select any of the related drivers.
>
>   config QEMU
>          bool "QEMU aarch virt machine support"
> -       depends on ARM_64
> +       depends on ARM_64 && !HAS_MPU
>          select GICV3
>          select HAS_PL011
>          ---help---
> @@ -23,7 +25,7 @@ config QEMU
>
>   config RCAR3
>          bool "Renesas RCar3 support"
> -       depends on ARM_64
> +       depends on ARM_64 && !HAS_MPU
>          select HAS_SCIF
>          select IPMMU_VMSA
>          ---help---
> @@ -31,7 +33,7 @@ config RCAR3
>
>   config MPSOC
>          bool "Xilinx Ultrascale+ MPSoC support"
> -       depends on ARM_64
> +       depends on ARM_64 && !HAS_MPU
>          select HAS_CADENCE_UART
>          select ARM_SMMU
>          ---help---
> --
> 2.25.1
>
>


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 10:39:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 10:39:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558246.872153 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGdRf-0004Qu-HA; Tue, 04 Jul 2023 10:39:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558246.872153; Tue, 04 Jul 2023 10:39:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGdRf-0004Qn-Ec; Tue, 04 Jul 2023 10:39:43 +0000
Received: by outflank-mailman (input) for mailman id 558246;
 Tue, 04 Jul 2023 10:39:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=KXt5=CW=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qGdRe-0004Qh-Up
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 10:39:42 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 154b7789-1a57-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 12:39:41 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 6402B204D8;
 Tue,  4 Jul 2023 10:39:41 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2B0541346D;
 Tue,  4 Jul 2023 10:39:41 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id jF/6CO32o2QEdQAAMHmgww
 (envelope-from <jgross@suse.com>); Tue, 04 Jul 2023 10:39:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 154b7789-1a57-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688467181; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=ufUyszN3FOTy1keSsZFTm+VxsQdbtQ8iR1hztEdTO+U=;
	b=pA9V4VHpYj7BS1DxBVycwdaAXi++0qHtjb0hgEmEQotmgbu0x7nT0crDnrltGWSWHHWbGe
	6f/CEBJ1Vkq2Q9UghaMYK5MylCKZpKUGPQjwn+9t+LBm7ceWUGs/5eT7MtsZ1Xt7/gQd3A
	nCmjQnCt6xATm+NwX0RuhLGnLIlw/rA=
Message-ID: <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com>
Date: Tue, 4 Jul 2023 12:39:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>
Cc: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 vikram.garhwal@amd.com
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
 <b21398eb-2fb2-4fca-dd90-d2c81d8df1c4@epam.com>
 <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop>
 <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
In-Reply-To: <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------xX4qTw8UY8621tTesaaATWaa"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------xX4qTw8UY8621tTesaaATWaa
Content-Type: multipart/mixed; boundary="------------gidE6FoEsgf7uP6gzz4RP2TS";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>
Cc: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 vikram.garhwal@amd.com
Message-ID: <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
 <b21398eb-2fb2-4fca-dd90-d2c81d8df1c4@epam.com>
 <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop>
 <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>
In-Reply-To: <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>

--------------gidE6FoEsgf7uP6gzz4RP2TS
Content-Type: multipart/mixed; boundary="------------L2wHyOVyIZUNYvNlG5ywcrPl"

--------------L2wHyOVyIZUNYvNlG5ywcrPl
Content-Type: text/plain; charset=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QpnZW5lcmljIGVub3VnaCBmb3IgYmVpbmcg
YWJsZSB0byBoYXZlIGEgY2VudHJhbCBwbGFjZSB3aGVyZSB0aGUgYmFja2VuZA0KZG9taWQg
Y291bGQgYmUgcmV0cmlldmVkLCB3aXRob3V0IHJlcXVpcmluZyBhbnkgY2hhbmdlIG9mIHRo
ZSBmcm9udGVuZHMuDQoNCg0KSnVlcmdlbg0KDQpbMV06IGh0dHA6Ly9kb2NzLm9hc2lzLW9w
ZW4ub3JnL3ZpcnRpby92aXJ0aW8vdjEuMi92aXJ0aW8tdjEuMi5odG1sDQo=
--------------L2wHyOVyIZUNYvNlG5ywcrPl
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb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EwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------L2wHyOVyIZUNYvNlG5ywcrPl--

--------------gidE6FoEsgf7uP6gzz4RP2TS--

--------------xX4qTw8UY8621tTesaaATWaa
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSj9uwFAwAAAAAACgkQsN6d1ii/Ey+9
yggAm/nnfzU+zzUQjNzpq4jgN4FPFkr5ki16LnPe/evdn7hmqs8k/+VXrXCW+2xyXD+VoDibBl9Q
pckoziwZFXP4jomvW+oR17HpmibmQ96nXtiRGJvH5oRB1Pul82aEy2PbbkeM357nts2i6IYtR86W
xJalTzeCBRept1bMjYgxyPZmdbGAskeYquTug5wOG2wr9TJRZ3YZohauH3kfKQfnuuqdhbgHYQiu
wexNRngYZHoIH9uHcb2cQnlP4z3Tfhr4ClcIcabczqxKv4qLTD3lrUmRhIUHAVdJjWJQhLoIr/py
A9prgAkJHf5ibJvV4HLe5bNAlri8zB+8gHqmtZibxQ==
=ZF9q
-----END PGP SIGNATURE-----

--------------xX4qTw8UY8621tTesaaATWaa--


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 10:55:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 10:55:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558250.872163 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGdgc-0006qs-Q2; Tue, 04 Jul 2023 10:55:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558250.872163; Tue, 04 Jul 2023 10:55:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGdgc-0006ql-N1; Tue, 04 Jul 2023 10:55:10 +0000
Received: by outflank-mailman (input) for mailman id 558250;
 Tue, 04 Jul 2023 10:55:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=bK4X=CW=citrix.com=prvs=5424eaebb=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qGdgb-0006qf-MX
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 10:55:09 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3ce40c5d-1a59-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 12:55:08 +0200 (CEST)
Received: from mail-mw2nam10lp2101.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.101])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 04 Jul 2023 06:54:58 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB6240.namprd03.prod.outlook.com (2603:10b6:a03:3ae::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 10:54:56 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902%7]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 10:54:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3ce40c5d-1a59-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688468108;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=U3xep052cZDrscjGs+i6jbExtS2iISvL1OSaYUtxwoo=;
  b=QW5Qb5U1xhAjf+sOaS6rX0V3a7WrdBULC388MFQdF/l9b+gL5edCdwKz
   v/NtVMl3CIRd2lV0SuBM+9cUegjy/wZQwCvXRVcdtYjzZL75J1mC2TBEL
   TgvX9MA03DEj5o3faiCR8kSJae4Xinb9qK4cLrGiGkHu6lmeOvHJA5VdO
   A=;
X-IronPort-RemoteIP: 104.47.55.101
X-IronPort-MID: 117666314
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:LU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CRP+tDKK
 ah
X-Talos-CUID: 9a23:H7Ch5GOls35a9+5DSHBV0Ec2PeMZX1r3y3PeKhKHGFRwcejA
X-Talos-MUID: 9a23:Rj/ICgptzlAXmEJHsVoezwtSOZlVuJqjMU5XlrdXp/TZMHZZPQ7I2Q==
X-IronPort-AV: E=Sophos;i="6.01,180,1684814400"; 
   d="scan'208";a="117666314"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Mx4AP+2zc3UQKuNfSc0ietpH/xLeLDUBatiVZT4EHWaiFlaPvxC37jQ+GaCYB5z27GcN/bABe7Z7JFGI8NMaJzT7X1ogThzZFcejFEFEX1mesEFbHqmbHlJhMeQUDBbe6zg1N86e7Q/Fzj6i3NGTAlSjf/9Op4eYt9/zdaXB4Mk2ilRR8OV0F/2D51Vx1LkictGW4AgmUdhNuVGaPdY33M8WLuhSpUofqjat8QLsfGGfjeWinYcZYeCLugaudGpxlICQgXej/CrHHQzpwXKuuylq/b76MUpZnfkXXSYoxwB0fEV5ypjDq5CzsKSx0kIOP+Rv7IWowSNh8gV2xzatMA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=wfCVpSC+fn+ZuRimJA0iZdnw9KK8inwYWaNoCTxnk80=;
 b=PAjP/CEMiqIXFc4jX6L3FkEqTNXoaZPBAxaKc2JolOaaC6K2LYg7+kXnqI9dlNAoQ085/X/ONBt6H3zCuYLI+eV8S4xT0tTNckYaorAnXeTVun7einGHTSipF1A48mjygY8cQZ2FDqiq+s9kU7WxLTppeDq/1UBil8/a4wjHy76IvrCvfnYQXXWG3OhCBVYJqqnrYp2Lja6pU8Z8ZE7mxnYrqoaWOEQpsuuLKMHoR8vR6UXc5ov8p2Y8I/Kzof7o8dD2hlobkZDLnkN+NX6Rcbjc5cvocbiIx5gT6//KnSQceCGvcJHYfSHkQLL+TaYl8UCivNkiIUES1yddMg3GMQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=wfCVpSC+fn+ZuRimJA0iZdnw9KK8inwYWaNoCTxnk80=;
 b=w1bxkR3gkhrG89D+gmJN3LmKjZFN77j0sCx5/hbYwwUaXOT12MWSeE5E7hq1ElKNV4iPjzcDvsszH/SbFyS5My9V3X1oR27nAdogehuBy4Ak56xjJLjC7eRMkWodjSkpF2H6Kq2qX87DJKK4sCN0IsIQ+vk3ilHtaF+Fg05qx3w=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Tue, 4 Jul 2023 12:54:50 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 1/3] multiboot2: parse vga= option when setting GOP
 mode
Message-ID: <ZKP6ekRI0jChJKM3@MacBook-Air-de-Roger.local>
References: <20230601130518.48874-1-roger.pau@citrix.com>
 <20230601130518.48874-2-roger.pau@citrix.com>
 <2e194ebe-f8e8-128a-0ad6-227f8a9be976@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <2e194ebe-f8e8-128a-0ad6-227f8a9be976@suse.com>
X-ClientProxiedBy: LO4P123CA0007.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:150::12) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB6240:EE_
X-MS-Office365-Filtering-Correlation-Id: 178f528a-a823-4da1-3c92-08db7c7d19fd
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	mn9RMSpY+VQ/H79LePtqX3XQ9a61oq6X1LzzxN6V5uQK/bAbSga9Fna8guSkmvkT8CKCB057jU4GnW6dE0ts8DAHAp69tCVjH0WV4P1vCj90y8ZFE6B6a1VZkWKN/UVJRLT9vzJfK7zPzdVuyi5Q34ENEMzVJLQmugccyuckV7Srpmd59jB3qoTjxv8+7SrzWdHpSDSr7zppJ9RjqK7c94QGnZHtN0KcO84QJAQAaEmSPJmChIk/PI6yjgkhUaZJT9xdxQbz9UQuXDFmyD9Jta5qIiSydqaxqX5e4LGkPzSIcZQwEfcLfaYXMXRo7R2yZ+ltJiu8YKK/RGpdmh8azVDxdhk9LRJMzx9OIRYDyWQwLD8WJq0HMfbu17fUpMbiYg4q2AgiaDahwN0KgzYat2IJgO8VW50pUCERaY8RKc/SpvuCKl2N8U+pg1NPWwUo9gkUk+fwVDDTuDKY/A4z+a2JZa/HaPBNg1cKzgJp9j0y7VkK3l05V6fPwFe3Aj2Ei/e7dTu69egVeUPDLvj3cEeTh7dLpjRV9OSqxj6ZTkrEA0KrZ6HX+riqfA861QgM
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(396003)(136003)(39860400002)(346002)(376002)(451199021)(2906002)(41300700001)(5660300002)(8676002)(8936002)(85182001)(86362001)(186003)(478600001)(82960400001)(26005)(6506007)(6512007)(9686003)(6666004)(53546011)(6486002)(316002)(6916009)(4326008)(66556008)(66946007)(38100700002)(54906003)(66476007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?a0MrczV6NDdFZHNqSG42dmZlWC9HY3kzWldlai9Oend0RWRTa3hlWSt5L0dC?=
 =?utf-8?B?M2tFTzA5bE9KWWFvdDZ1Nld0MWRyeVJBSzhzL2tCMWtSODFWbnVvb2c0bHJV?=
 =?utf-8?B?R081b0J2SmZFTWd2UTNOM3FCTm5SZXF0QVNUWjhxbGxzVzVJUzJzZTBSZHVo?=
 =?utf-8?B?ZGlOamtSWUljUUw0WlV5dkFJQ1R6d0VJZUVER0RmT3Vic3RpZ2xnd0hhNVJD?=
 =?utf-8?B?TFdZWEtxRjRMenFFWGtKZ1o0UjVjWnJMeEpOcTkxRDJzbkRkRjMzckMwQVJG?=
 =?utf-8?B?cW9KTGJBdEhHbmlZaWYzQWNvaFlQWUNSOEpVM3NnVkVGVzUzZ1RMb09nVWJx?=
 =?utf-8?B?T1drcis1WEVPRHN6T1BTRjNjd3c0bGU2NEhMUlN2WjUrODdVTm9qSmt2VFpy?=
 =?utf-8?B?eTVsb3o2bWtJMW4wZW1pN0ozNFowM1lBMXcyVzZOMTZmaFJqTzNxQ0R6RjJY?=
 =?utf-8?B?c25GM3Z2TnE2UWY0amxGWVFhM2w5YUtocVRmWVIreS9MeVdGcit0b3dVUzZh?=
 =?utf-8?B?dXpHelg2d3daUlA1VFl2cFk2T1dpK2lJWVZrMUtIaXRmVS81QlB2aHlHVmlJ?=
 =?utf-8?B?em0xZzU1aVd2bFJ2UHRmclBUalgyZncvdWhjRk9xTzBPTUtSOEFHUW5QV2Mz?=
 =?utf-8?B?M0RWZENpeFc4TXBTMHVDQmVsN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ykNIHY2qSTZgKWp7+ijCryWf3RK/280At6omQuuDPTlkzWnNG5m0rbajks3zXNXJUn1InozqAHFel2CwVXmyGapho+KHTrg3KMj/yI5ssoBdWtZGFfZUciql3zJcKCmCW9c6OoYD/Lf1SmJPGRWrHce+TEsVGGbWNe9n7rftERsQz70hVVUnjGMeCSModxIzvOR4aqP7gyPkcUbRmbMhg8zoWCfLLvxTyVVCtQrYjvP0RqZsNwQynO99zKIAVqC7cjkYuIOiThYR6lJcfX6QKrcmY4tMRf+q8qfVvZjdHzHicUkdBWpqrDfhuRNuBv19ZTg9p3kfOKkA6uUUWjd8yen+jGndz0HsVANbU7riIsTKYehXsolq5KQdK7qmyfMYkP3XH5Pw1OVw/5XUy7g1nlhV1z4vIYpzH2dVOKM9kJk8fsKK2KoGTIRyOVvqHgwoa9k0GBxqeewAbprqrObr38Qv2tVv5JD5unsXna6oMbFUxFx29QBSsXyE4JdwaTLq6X3ufmI6y9vlHyjDLmvb9oqc5xy1mXUTDNufkGme42jIGMHfHkD9O2nSllfp/zsX7LlghNMX9lcp+2KFphTstUASnkvZRrzBlkP59QlNuNxLK
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 178f528a-a823-4da1-3c92-08db7c7d19fd
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 10:54:56.0071
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: gtZ9kn0uL8Dq+s0905QXG2HjLS7nGgRqJyeAbqL99p3fEDZxAdyCcDKGq626cestfKJVnYZUrHGGDDTIF5nPRA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB6240

On Wed, Jun 07, 2023 at 11:41:24AM +0200, Jan Beulich wrote:
> On 01.06.2023 15:05, Roger Pau Monne wrote:
> > --- a/xen/arch/x86/boot/head.S
> > +++ b/xen/arch/x86/boot/head.S
> > @@ -329,7 +337,8 @@ __efi64_mb2_start:
> >  
> >          /*
> >           * efi_multiboot2() is called according to System V AMD64 ABI:
> > -         *   - IN:  %rdi - EFI ImageHandle, %rsi - EFI SystemTable.
> > +         *   - IN:  %rdi - EFI ImageHandle, %rsi - EFI SystemTable,
> > +         *          %rdx - MB2 cmdline
> >           */
> >          call    efi_multiboot2
> 
> All you obtain is a pointer to the string, which is fine from what I
> was able to establish, but that's not entirely obvious: The MBI
> structure used has a size field, so it could have been that the
> string isn't nul-terminated, and hence the size would also need
> passing. May I ask that this be mentioned at least in the description?

Sure.  The multiboot2 specification already states that the string
must be zero terminated.  It's my understanding the size field is part
of all the tags, so that a parser can find the next tag even if it
doesn't know how to parse the current one.

> > --- a/xen/arch/x86/efi/efi-boot.h
> > +++ b/xen/arch/x86/efi/efi-boot.h
> > @@ -786,7 +786,30 @@ static bool __init efi_arch_use_config_file(EFI_SYSTEM_TABLE *SystemTable)
> >  
> >  static void __init efi_arch_flush_dcache_area(const void *vaddr, UINTN size) { }
> >  
> > -void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
> > +/* Return the first occurrence of opt in cmd. */
> > +static const char __init *get_option(const char *cmd, const char *opt)
> > +{
> > +    const char *s = cmd, *o = NULL;
> > +
> > +    if ( !cmd || !opt )
> > +        return NULL;
> > +
> > +    while ( (s = strstr(s, opt)) != NULL )
> > +    {
> > +        if ( s == cmd || *(s - 1) == ' ' )
> 
> Iirc I had asked before: Not allowing for at least tab? (See
> cmdline.c:delim_chars_comma[] for what the non-EFI parsing permits,
> which in turn might be going a little too far especially with
> permitting comma as well.)

I've fixed this when parsing the gfx- option but not here, sorry.

> 
> > +        {
> > +            o = s + strlen(opt);
> 
> I don't think the comment ahead of the function describes this
> behavior, i.e. in particular the adding of the length of the
> option.

I've changed the comment to:

Return a pointer to the character after the first occurrence of opt in cmd.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 10:58:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 10:58:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558255.872173 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGdjP-0007PO-8K; Tue, 04 Jul 2023 10:58:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558255.872173; Tue, 04 Jul 2023 10:58:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGdjP-0007PH-5b; Tue, 04 Jul 2023 10:58:03 +0000
Received: by outflank-mailman (input) for mailman id 558255;
 Tue, 04 Jul 2023 10:58:01 +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
 <SRS0=bK4X=CW=citrix.com=prvs=5424eaebb=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qGdjN-0007Oy-Ef
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 10:58:01 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a271461a-1a59-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 12:57:59 +0200 (CEST)
Received: from mail-dm6nam10lp2105.outbound.protection.outlook.com (HELO
 NAM10-DM6-obe.outbound.protection.outlook.com) ([104.47.58.105])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 04 Jul 2023 06:57:56 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SA1PR03MB7056.namprd03.prod.outlook.com (2603:10b6:806:325::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Tue, 4 Jul
 2023 10:57:53 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902%7]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 10:57:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a271461a-1a59-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688468279;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=S0/E6lgGJI26RaFbNiuUvRUXMJ1nPFFf8EETafKROBo=;
  b=cfs7ndo3Xq/+ss8ifs+A8gjX6pCSBXqzCl2MuVYjeM3b3WZ+WcBFuwlc
   rTJbbGMCYKmEEniudZpncle1+iqGgXkPl8j6qQqhpJ/YWRXfHBqkY3ZdT
   0lpMETXDOtPWsU4LiyNuQIhAUgVywEhbPb6BLJyg+Ktvh90LWzzm84l5G
   I=;
X-IronPort-RemoteIP: 104.47.58.105
X-IronPort-MID: 115118969
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:iMvzO6p/gvhneDEfjriSJk03CIJeBmI+ZBIvgKrLsJaIsI4StFCzt
 garIBmFbKqPajCjKNBzaoq2oU4F6J/TnYJhGwRpq3o1F3tH9puZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weBzyVNVvrzGInqR5fGatgMdgKFb
 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo
 OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay
 RAXADMzPx2RmMTx+5uycdBPoeg6cOrsLKpK7xmMzRmBZRonabbqZvySoPN9gnI3jM0IGuvCb
 c0EbzYpdA7HfxBEJlYQDtQ5gfusgX78NTZfrTp5p4JuuzSVkFM3jeiraYKIEjCJbZw9ckKwv
 GXJ8n6/GhgHHNee1SCE4jSngeqncSbTAdtPTeTop6A76LGV7jQ4L0MmVHSXmPK0p2WTBIhgJ
 2tO/AN7+MDe82TuFLERRSaQonSJoxodUNp4CPAh5UeGza+8yxmdLngJSHhGctNOnN87Q3km2
 0GEm/vtBCdzq/uFRHSF7LCWoDiufy8PIgc/iTQsSAIE55zvpd81hxeWFtJ7Svft05vyBC36x
 C2MoG4mnbIPgMUX1qK9u1fanzaroZuPRQkwjunKYl+YAspCTNbNT+SVBZLzsZ6s8K7xooG9g
 UU5
IronPort-HdrOrdr: A9a23:4vwpk64rJf72rU9s9wPXwamCI+orL9Y04lQ7vn2ZFiY5TiXIra
 qTdaogviMc6Ax/ZJjvo6HkBEClewKlyXcV2/hpAV7GZmXbUQSTTL2KgbGSoAEIXheOjdK1tp
 0QD5SWaueAamSS5PySiGfYLz9j+qjgzEnBv5ai854Hd3APV0gP1XYaNu7NeXcGPjWuSKBJYq
 Z1oaF81kqdUEVSSv7+KmgOXuDFqdGOvJX6YSQeDxpixBiSgSiu4LvaFQHd+hsFSTtAzZor7G
 CAymXCl++emsD+7iWZ+37Y7pxQltek4txfBPaUgsxQBiTwhh2ubIFBXaTHmDwuuumg5Hsjjd
 GJiRY9OMZY7W/XYwiO0FDQ8jil9Axrx27pyFeej3emicvlRAgiA84EoY5CaBPW52cpodk5ic
 twriqknqsSKSmFsDX25tDOWR0vvk2ooUA6mepWq3BES4MRZJJYsIRa1kJIF5UrGj789ekcYa
 BTJfCZwMwTXUKRbnjfsGUq6NuwXk4rFhPDeUQGstz96UkioFlJi28jgOAPlHYJ85wwD7Ne4f
 7fD6hunLZSCucLcKNUHo46MIWKI12IZSiJHHOZIFzhGq1CEWnKsYTL7LI84/zvUIAUzaE1hI
 /KXDpjxCEPknrVeI2zNaBwg1PwqD3XZ0Wu9ige3ek0hlTEfsurDcXZI2pe1vdJoJ0kc7/msr
 iISdZr6sTYXBrT8LZyrnLDsqZpWAcjue0uy6IGsgG107X2A7yvkNDnW9DuA5eoOQoYewrEcw
 g+tX7IVYh90nw=
X-Talos-CUID: =?us-ascii?q?9a23=3AVHGQVWsgsphaf9dX7bcrpLRN6IsmTCzQ3mj2ZHS?=
 =?us-ascii?q?RAF1Qa5q5UAOz/7NNxp8=3D?=
X-Talos-MUID: =?us-ascii?q?9a23=3A1hl4uA0eRV/U6xhod3tmvTfL0zUju4+JVnAMvrk?=
 =?us-ascii?q?/sMSpHgEvYQiRq26xa9py?=
X-IronPort-AV: E=Sophos;i="6.01,180,1684814400"; 
   d="scan'208";a="115118969"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=dcnqmzJti7XUz5H2g53I/yQSung+rI5GgfEghGw28MKX6iLYW/R04MAvazLDnkpL4fJDhGGrExH2qi3dXYDquz3j3Ni1/QBrM5eoN/IOcjQRC7md4JF0u4TZxndgKKlzf/pGLhNHW57NgqdQYw4qoCDAJqi6uGTAwmxC5ESbeeQn6VdrdN0iVChU2Nrn65n75sZ4fHqPl77pkj4YtGXErBKGjcEuOSrTsAoYo4/baN1x9DVt2AjTJsfnE0tOZL7sGIR/4uSGn3DdqxqIfKiMMo7CMtcCwBH8QegUuef12cRJ1/Z2e8H3epyUaDOBoEOP+KzGuP58pl6X2/UKucY27Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+iq6Px3XuOK7jou86nQAx7Hx9wTtRpzX0xayRfgmwls=;
 b=P/NlHWJ4wdpPFNQGSDF81HNzgDwztxG+1OuqFzG+PI1H3gkZSMq1twfKT2vpkB7kt1wGE08XGtizvhJWmhplI7DBeJ1lVOEQw1Mm644HFLLmx6D70wACEh2pcRlfebdWYXcH5heMIkj/ZyVSseN07WPyQR/FJly1l34QOI4+gBFYNLYtEBDy1n2qMys2P2z+eK/qs/TiLC6bny5GgJKNyh5eSzk5jVubTFj7WoAG65xiS/qJaRbx4tOjNwQmr4/l+EIvDMmQHpT9Ymulxk8wO33o8QDj/fgjvgLemrAWl4txDMwR7eg0VUF8mh5ExrsB/c6SFJqCO2v4+XY/5Uk4jg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+iq6Px3XuOK7jou86nQAx7Hx9wTtRpzX0xayRfgmwls=;
 b=UyOAtMBln/HP+Ub8xyr2lmTkFoLO8bCCJcC7IgiR7A7QmJf6BYfp5yxt9FRqa4cdOxVLuhBRGQW0L9HNLxEEUGNi135BWfc8HeGPagRi9KxsRfvowFWCtMLje3qJFn6q5IY3f7K0yL3+pigUq+qzrppzVVNjMAhuv6Qi/qyP7WY=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Tue, 4 Jul 2023 12:57:46 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 1/3] multiboot2: parse vga= option when setting GOP
 mode
Message-ID: <ZKP7KlyWkpB5gVD-@MacBook-Air-de-Roger.local>
References: <20230601130518.48874-1-roger.pau@citrix.com>
 <20230601130518.48874-2-roger.pau@citrix.com>
 <7453fd92-0dcc-c278-df57-f119240bae65@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <7453fd92-0dcc-c278-df57-f119240bae65@suse.com>
X-ClientProxiedBy: LO2P265CA0288.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:a1::36) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA1PR03MB7056:EE_
X-MS-Office365-Filtering-Correlation-Id: a7d25573-1963-4338-1d0b-08db7c7d83da
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	dHlLMd9alJwyD1hLxb+Sr0YQ8uy5VGtnbJWZUTe7l6UPvl077ppX/2fLquTSwiqsed/ErhbmISB8NmVznzbTYknxNsInjeRQPFHUbIGWTTS2k6W8hbbZLgjpq1zUsqR9eQBFUaaZuGVhp58zD89CYSe6Tt+EqKeXK0Y0gMtGr4o0kL6Cs3HoqtQPKMhANSuDDnCqqJc+41VUcbj8zEGeiytcWm32VjF8A3KY71nVQlNAVkAss0wh2tmtEZVPdsAwABz6gX9iQ4DRvM22M8CpIVuQE2SLJZFoB1QE9HH+XRT/P9e7hs10ke+BZZLPdWMb+vWZiOwbysLNY2bngTaYqzp+lsjn1vyaVk/jM6dDXym5LgU/6mn+RDaW0A2bqZtbS6uEHzWiCwnhT6FxgC003cDTimnTFwfRk52wbUUENrsynBAo3P2pxF3EqE9W2oOI6UsDjIjjJcfQnFlX1irT8l7YENvvzoaRgcUxMxjMtUBqiTs6feB3heC5lBGq+U6eDXeDyLqXzUyvoEKGoRV3uEFbOyQDfRfOU/KgmmywnDQUYE87emi+OwYpksiymEZX
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(346002)(396003)(39860400002)(366004)(451199021)(26005)(6512007)(9686003)(2906002)(86362001)(6666004)(53546011)(38100700002)(186003)(6486002)(82960400001)(54906003)(41300700001)(478600001)(4326008)(85182001)(66556008)(66946007)(316002)(66476007)(6916009)(5660300002)(8936002)(8676002)(6506007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UTV1K2lmT3JkeFZSS25QeEtZeVBMSUl6d2lad2M0YjBtQ05LQ2xGY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Aeei/4SncRspwgi31b0j2uKo/THuke5HcpyxzdoWFEFyFZN1DI8kh89RjcW4SLIZAludc5XHbT7ToAvqJ3/Z+cNmD7SkKd8NuBBFAJ3k4K6zcqwIDV2npzII4lPFT0Cpbdb5Xqf41PLi4jLaTljINqwYfqWdfahdfQr2MoxMBvD29yilHzFhH0fQFiD9K0AmhrNT+vX4DzvlyQyeqBdqWLGAYmPG6rgZovv+WEa9p8MLd+S2uYD0V6CSusW5W8uX/vo7pjZqw72cZ5JGutdcKH11YOGu1Dyku7c9OxYHj3f0W3NdbBOFKcBks5qh8+OAK
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a7d25573-1963-4338-1d0b-08db7c7d83da
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 10:57:53.0632
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: sE3Wrmgs4axKLzDy1lnVCp9Sakx9paxdTdUECrUdRi2Iq0TvSdjD6zBYwmvsn7u1f6gkNpStrwIUg9guXt1A7Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB7056

On Wed, Jun 07, 2023 at 12:10:28PM +0200, Jan Beulich wrote:
> On 01.06.2023 15:05, Roger Pau Monne wrote:
> > @@ -807,7 +830,41 @@ void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable
> >  
> >      if ( gop )
> >      {
> > -        gop_mode = efi_find_gop_mode(gop, 0, 0, 0);
> > +        const char *last = cmdline;
> > +        unsigned int width = 0, height = 0, depth = 0;
> > +        bool keep_current = false;
> > +
> > +        while ( (last = get_option(last, "vga=")) != NULL )
> > +        {
> > +            if ( !strncmp(last, "gfx-", 4) )
> > +            {
> > +                width = simple_strtoul(last + 4, &last, 10);
> > +                if ( *last == 'x' )
> > +                    height = simple_strtoul(last + 1, &last, 10);
> > +                if ( *last == 'x' )
> > +                    depth = simple_strtoul(last + 1, &last, 10);
> > +                if ( *last != ' ' && *last != '\t' && *last != '\0' &&
> > +                     *last != ',' )
> 
> You check for an appropriate terminator here.
> 
> > +                    width = height = depth = 0;
> > +                keep_current = false;
> > +            }
> > +            else if ( !strncmp(last, "current", 7) )
> 
> Don't you also need to do so here, and maybe even ...
> 
> > +                keep_current = true;
> > +            else if ( !strncmp(last, "keep", 4) )
> > +            {
> > +                /* Ignore. */
> 
> ... here?

Hm, quite possibly for correctness.  I felt it was relevant in gfx- as
to avoid things like: gfx-1024x786x32x64 being handled, but the same
could apply to passing on option like current-bar.

Will try to generalize the terminator parsing so it applies to all
options.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 11:07:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 11:07:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558263.872184 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGdsj-0000ah-AV; Tue, 04 Jul 2023 11:07:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558263.872184; Tue, 04 Jul 2023 11:07:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGdsj-0000aa-62; Tue, 04 Jul 2023 11:07:41 +0000
Received: by outflank-mailman (input) for mailman id 558263;
 Tue, 04 Jul 2023 11:07:39 +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
 <SRS0=Gy6C=CW=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qGdsh-0000aS-6W
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 11:07:39 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on20611.outbound.protection.outlook.com
 [2a01:111:f400:7eab::611])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fa932702-1a5a-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 13:07:36 +0200 (CEST)
Received: from SN6PR12MB2621.namprd12.prod.outlook.com (2603:10b6:805:73::15)
 by SA1PR12MB8920.namprd12.prod.outlook.com (2603:10b6:806:38e::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 11:07:32 +0000
Received: from SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54]) by SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54%2]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 11:07:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fa932702-1a5a-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=F+XthAginLip73YFN46LqnsDbKC/cmYvz5kdx6cdD227qXDZgh1gFowlgMw2wBqAZ0YZM9//UWZl8LtYEIhj564Aodt0Ij3r4YkAqJsLOhgtv4p5XeGtAdNHA/SbwtDcRJ+OEX5IO3o+u/qpW+V+YNqCRx5i8mhH/klp3B289LlwDtRXjZ8A9WQmKU3YBZjQeZHodtasVnNrHybStE1TRjkdo78abK8036RhVtcAcl5zcUJ5VqVuCvwzu2/mOeJ3Dh2+jBAVedXYL08TZ12TO7tw+bpXBh3bFfsIHFFC7v06pBgLIY9hYVt1CFC89VAt2rUF+cPoNiAVmvYAG9wXLQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ABLD5CfrQ/CoGwmoWpyJYZ3oFewgB4NwBVvtre4khZE=;
 b=Q+xvc4naTqeMeWF2x98Zmzq1y/HNeEIA8xCG+BxtXR2QQV36a9c193Ra2a2uX5i1BwM1BUx5XhtDhhzxpj3JhZQI42URsBiGLaJe2eB7B3ja1PtEw0tBn9O0JRLeQiLQVP1l4ST79ViirQn0Q1T6bdasLA37YOgKe46Fhld4/Hm493NBkQdKQPxSsxtvCGu4iKhSxw9Pg8CzoFtT2IyJy/jRRFeQwxI1Yn4v+8ALpSvd5l3nHBodda9ANr1Oo77dBhN3p+OQCzh9h7geGg8pk0rnigU8L4GhomDDzUjPCjaUYG86DaD5YDxzQiT/vrTMGjGFGUKQDEIAta/QYDFVfg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ABLD5CfrQ/CoGwmoWpyJYZ3oFewgB4NwBVvtre4khZE=;
 b=YntzZdQ6YH4dgut0JTYh+8jKQprnQU8LpPpDYMnmlI8t+qRiFTVmg2tB44zLyDg7vBGsexgJ5AEWMlYPEPi3c0DJIFklnPqmxD1rFSJ0B137yiRnjabkHZ7cm/iBWgqf8hLt4kR3Kyl+/hhIzVOzJ7m51fnGkXQnHGT5lzIQ13w=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <2d39d60d-f06d-50fc-6b9a-e3df227e80c0@amd.com>
Date: Tue, 4 Jul 2023 12:07:25 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 05/52] xen/arm64: head: Introduce enable_boot_mmu and
 enable_runtime_mmu
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-6-Penny.Zheng@arm.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <20230626033443.2943270-6-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0113.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:192::10) To SN6PR12MB2621.namprd12.prod.outlook.com
 (2603:10b6:805:73::15)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN6PR12MB2621:EE_|SA1PR12MB8920:EE_
X-MS-Office365-Filtering-Correlation-Id: 4d4c7d0a-6f80-443f-ecf5-08db7c7edcf2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Dd0IHo+AzDZZ+ehSCssLUZKkRmxoL1ohn0sKVDiT38zYH31vQNz/29p6o3ygg16gH8PnVDvkwXOw0JVbfb3MRGyCpocEtVaGtbgDIJBoTtCRsOfRVahhgX+KBWJqIaOSmVj01P+UqO7WeDbas6uSk1gGAqZg9u9Jid1OxnKCi0HDo4A014E8jYKFcM1fQJZne1GzXFaexj1Jg3OhE9e9duo09LQY0/ZMzlo9Y51LeDphwMnbw0dcVLXAbpZOtimumejAGl28Iz1DmJJzI4MHYoSoMhsoHkYGaBllvRknKKKmOeJuHy0oc/USYB2Zqgzvn5FZmQN9YYERoFgJPAIzwh4h8feNiOQ2q9gyHZIkQphj9i9d0FJvbQISyQow3tQiVRd+ihXe/wMxn/qZ6cSuOQbHgOCiDP6Ml9/y27gDerfeWlEYf6Nvh9z77IANBfdJozYbGpK+W2Pfxu8X2XJf3k5Vco8fFon8cdu+8sL/khgI83UmmkpaKonsMBI690ubgJDMt229m4W/gA4eslf4e+1yuQR8Jdl2B09AIS17kCgvK+fKrq1TR1hWdmTDwhvJEdFUCiCL4wD6R3qsIgMC9LPLoECrDIkOAEZpWd+xZ7RWXgC/vibXdSFsQJyKfRZ0CEY8q/QuWSnZk9pjfj3kpg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2621.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(396003)(136003)(39860400002)(346002)(376002)(451199021)(2906002)(41300700001)(5660300002)(8676002)(8936002)(36756003)(31696002)(186003)(2616005)(478600001)(26005)(6506007)(6512007)(6666004)(31686004)(53546011)(6486002)(316002)(4326008)(66556008)(66946007)(38100700002)(54906003)(66476007)(83380400001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?N3l0QVBnNDU2ZE9vWFhjR2F1bzZ6aGtKL3hrbUNvS2JPNURFT2FGSDJWYkVN?=
 =?utf-8?B?SWE2T1kvVzY4bldGelArL1U3dkM3c1V5aDc4SEVCQzZ0RFIzalpVS3pHajYr?=
 =?utf-8?B?VVNmNk02UmNIaEpmMHlJRnpZd04wZlQxdzlNb0wxZUhxTHhxRjUyWS85NVNm?=
 =?utf-8?B?WllXQ2JVOEdEK0ZybXY4RE90d0c4WmZsckxXb3ZIV1N1NHpxUzhFWitEdDh2?=
 =?utf-8?B?eWlFM29sT1Y0a3NWTnhOMSsvbmhVTmpHbTdrb3RKNm1kNC9lQXdmT25EZU1K?=
 =?utf-8?B?QXIyeDZsUlpFeDBoc3F1L3daQ0FEbTZ0YkM3bXVvK2p6ZEZYbG9XeXo4Rlcx?=
 =?utf-8?B?cnVXcXpabml5d1BPODlESmU5MWxOd3JaS3NwejA4ckt0UVd2QUhwT2N0MDZh?=
 =?utf-8?B?cXU0SVhVSUxnOTF5WVRkU0IyVlRHQ0t1OEJMVDlSQ281K25OdVRkbFkvYWp0?=
 =?utf-8?B?dG55T0ppZHd2ZmVaU0FZRFoyUjNlRjlaVUdzaEFYdUd1bm5aNld3aTZSWGJH?=
 =?utf-8?B?OWZyM2lVWjdSTlQzNW5mVVI4VDlKRzBmdWJraWRKaWJpeU1XMERpSTFYR3M2?=
 =?utf-8?B?akxsWHp4azhobmROWW1nSnBOWEE2S3VnRVBucVZwaDR5MkRlN1puYVUzUENn?=
 =?utf-8?B?TTNrb2p5SnpaeXIvUzdZTVUzOGdSRERGc255Q1pWSVFvdXA5VWE4U014RUZs?=
 =?utf-8?B?UzR5aGxacmk0dkpVeFV2VjF0QjUwUFRtVHg0M0NPNWJ6MzFUUUE1R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djkvcXdyR1FObm5lWFkwMnl1Nk9MeUZwK1FwQU92Rkd3UldMZko2U1NBemND?=
 =?utf-8?B?UGRRUS90aUt6QzVlY0hzWjVpMHZRYUpoVndHWjVQQ3NpaExHNG05aUNWTXpM?=
 =?utf-8?B?ZXJtNFBzNnFtNDFTYmdsL0kxOVZCMEJxQkh6OVVlbHBiUnFNQ1djRHJPS2Fu?=
 =?utf-8?B?MnhEZmE1dGlCWk4vTXlOU25xMDlGMWJINFcvSTRpUHpCUXpwY01Xd3V1RHFH?=
 =?utf-8?B?Z0lNUzJIZllpdkJVVW5lNVR6MWZielc2ZTV1RmI3R0U3U0pYZ1M2ZUlMN3Jq?=
 =?utf-8?B?bXA2b29LK09ud2VEOGRyN0YwZGpjdUs2SGlvRGJIREUrZFl3clJVNmZiM1M3?=
 =?utf-8?B?WVNBRERTOW1EOTRMdEVUbUxjd24xNnRIZVlpZFphWVQrWUx4UnVSUk45cCs2?=
 =?utf-8?B?S0Y4cUxJVWJUS2t4L2wvcDBkckZOckZYS2pJUEtRdEd3NFJQb291ZWt0c2x2?=
 =?utf-8?Q?rgfJ9A5/WSXFJsi4NFJgITYf0?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4d4c7d0a-6f80-443f-ecf5-08db7c7edcf2
X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2621.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 11:07:31.9045
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 8Eh3tqLJVCVyeFVNmJSvS7DRvDmQrT3StaX8HEn2M0YFeV9d6n2m3YHeYBjqjnfgQwMyl4wMRRRTDiDUUDCAug==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8920

Hi Penny,

On 26/06/2023 04:33, Penny Zheng wrote:
> CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
>
>
> From: Wei Chen <wei.chen@arm.com>
>
> At the moment, on MMU system, enable_mmu() will return to an
> address in the 1:1 mapping, then each path is responsible to
> switch to virtual runtime mapping. Then remove_identity_mapping()
> is called to remove all 1:1 mapping.
>
> Since remove_identity_mapping() is not necessary on Non-MMU system,
> and we also avoid creating empty function for Non-MMU system, trying
> to keep only one codeflow in arm64/head.S, we move path switch and
> remove_identity_mapping() in enable_mmu() on MMU system.
>
> As the remove_identity_mapping should only be called for the boot
> CPU only, so we introduce enable_boot_mmu for boot CPU and
> enable_runtime_mmu for secondary CPUs in this patch.
>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> ---
> v3:
> - new patch
> ---
>   xen/arch/arm/arm64/head.S | 87 +++++++++++++++++++++++++++++++--------
>   1 file changed, 70 insertions(+), 17 deletions(-)
>
> diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
> index 10a07db428..4dfbe0bc6f 100644
> --- a/xen/arch/arm/arm64/head.S
> +++ b/xen/arch/arm/arm64/head.S
> @@ -314,21 +314,12 @@ real_start_efi:
>
>           bl    check_cpu_mode
>           bl    cpu_init
> -        bl    create_page_tables
> -        load_paddr x0, boot_pgtable
> -        bl    enable_mmu
>
>           /* We are still in the 1:1 mapping. Jump to the runtime Virtual Address. */
> -        ldr   x0, =primary_switched
> -        br    x0
> +        ldr   lr, =primary_switched
> +        b     enable_boot_mmu
> +
>   primary_switched:
> -        /*
> -         * The 1:1 map may clash with other parts of the Xen virtual memory
> -         * layout. As it is not used anymore, remove it completely to
> -         * avoid having to worry about replacing existing mapping
> -         * afterwards.
> -         */
> -        bl    remove_identity_mapping
>           bl    setup_fixmap
>   #ifdef CONFIG_EARLY_PRINTK
>           /* Use a virtual address to access the UART. */
> @@ -373,13 +364,11 @@ GLOBAL(init_secondary)
>   #endif
>           bl    check_cpu_mode
>           bl    cpu_init
> -        load_paddr x0, init_ttbr
> -        ldr   x0, [x0]
> -        bl    enable_mmu
>
>           /* We are still in the 1:1 mapping. Jump to the runtime Virtual Address. */
> -        ldr   x0, =secondary_switched
> -        br    x0
> +        ldr   lr, =secondary_switched
> +        b     enable_runtime_mmu
> +
>   secondary_switched:
>   #ifdef CONFIG_EARLY_PRINTK
>           /* Use a virtual address to access the UART. */
> @@ -694,6 +683,70 @@ enable_mmu:
>           ret
>   ENDPROC(enable_mmu)
>
> +/*
> + * Turn on the Data Cache and the MMU. The function will return
> + * to the virtual address provided in LR (e.g. the runtime mapping).
> + *
> + * Inputs:
> + *   lr : Virtual address to return to.
> + *
> + * Clobbers x0 - x5
> + */
> +enable_runtime_mmu:
> +        mov   x5, lr
> +
> +        load_paddr x0, init_ttbr
> +        ldr   x0, [x0]
> +
> +        bl    enable_mmu
> +        mov   lr, x5
> +
> +        /* return to secondary_switched */
> +        ret
> +ENDPROC(enable_runtime_mmu)
You are renaming this in 08/52.
> +
> +/*
> + * Turn on the Data Cache and the MMU. The function will return
> + * to the virtual address provided in LR (e.g. the runtime mapping).
> + *
> + * Inputs:
> + *   lr : Virtual address to return to.
> + *
> + * Clobbers x0 - x5
> + */
> +enable_boot_mmu:
> +        mov   x5, lr
> +
> +        bl    create_page_tables
> +        load_paddr x0, boot_pgtable
> +
> +        bl    enable_mmu
> +        mov   lr, x5
> +
> +        /*
> +         * The MMU is turned on and we are in the 1:1 mapping. Switch
> +         * to the runtime mapping.
> +         */
> +        ldr   x0, =1f
> +        br    x0

Where are you switching to ?

> +1:
> +        /*
> +         * The 1:1 map may clash with other parts of the Xen virtual memory
> +         * layout. As it is not used anymore, remove it completely to
> +         * avoid having to worry about replacing existing mapping
> +         * afterwards. Function will return to primary_switched.
> +         */
> +        b     remove_identity_mapping
> +
> +        /*
> +         * Here might not be reached, as "ret" in remove_identity_mapping
> +         * will use the return address in LR in advance. But keep ret here
> +         * might be more safe if "ret" in remove_identity_mapping is removed
> +         * in future.
> +         */
> +        ret
> +ENDPROC(enable_boot_mmu)

You are renaming this function in 08/52.

May be you should rename and move the fuctions to the correct place, in 
this patch itself.

- Ayan

> +
>   /*
>    * Remove the 1:1 map from the page-tables. It is not easy to keep track
>    * where the 1:1 map was mapped, so we will look for the top-level entry
> --
> 2.25.1
>
>


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 11:15:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 11:15:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558267.872194 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGe00-00025q-15; Tue, 04 Jul 2023 11:15:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558267.872194; Tue, 04 Jul 2023 11:15:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGdzz-00025j-U8; Tue, 04 Jul 2023 11:15:11 +0000
Received: by outflank-mailman (input) for mailman id 558267;
 Tue, 04 Jul 2023 11:15:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Gy6C=CW=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qGdzz-00025d-CU
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 11:15:11 +0000
Received: from NAM10-BN7-obe.outbound.protection.outlook.com
 (mail-bn7nam10on2060a.outbound.protection.outlook.com
 [2a01:111:f400:7e8a::60a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 090bd87a-1a5c-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 13:15:09 +0200 (CEST)
Received: from SN6PR12MB2621.namprd12.prod.outlook.com (2603:10b6:805:73::15)
 by DS0PR12MB7778.namprd12.prod.outlook.com (2603:10b6:8:151::12) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Tue, 4 Jul
 2023 11:15:04 +0000
Received: from SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54]) by SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54%2]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 11:15:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 090bd87a-1a5c-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=b1qjbqt1h5BVOF9bs5EaQ0vT3FIa5ekaPZkAmJ+UDByOb0SkDjIGNXMGMx5HrMGEBjXPFeaxH0s32qhOoxAMBkq3Y4CaJcJjy6SQvQkF1c5PIwe3fozP21Xo+VVd29J4r4ONJs1h/mhPm90BKTaTKDwcKESAYelA1SvkoXUZ+xFjhhA6WpYztsHzLSUvbmjoBeRfDysNCMoSmYS4xSwXSYWo120R1l6/80lbfjfvTmtE0C7L9BxduOY5CFL6TqTNM37ROguqAtpZTkJydblzL7qR76QB76q04i6zTsCkzDjgIpdLtCqZQAcv6m+hVFTkqcXcvOQg/o8AscK6b2sPyQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=fAI8Ye1hiMiM5bokZODWSS1ZmLb9C8JWqzXtgxkAowk=;
 b=Xm39IlFVxPayxiCV9mYhnT9w3PQOc8Z4Th3seoBs5GMsMNlfmF8E5GTaDadjqY8Rx1WIvMNIIIJ3HmDlwkWZ0HE2n6nlGlFIrbjNwUoDqAGQpjS+eYs2h+jvQioNkwLqma8aq75hPtWCGQKAWovKOcpkdsOQ0JBF8wP9D+xxs78HG00VeBos+qSPyz/llkOjqJTLZqTIFTJwGAa/V+wmqmY41VrBk41DGbQ/xX4FK0lTHciMkYAZyNG6eJEEBpi95zijSB0qBamVuTgv6M2yGqXAW7FHiae7/oTgiflg4cllgOEL5ePQL6lbEQG0Yo997Pr0Q8kL04RQ5kIzi2lshQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fAI8Ye1hiMiM5bokZODWSS1ZmLb9C8JWqzXtgxkAowk=;
 b=PaEFIfo2JwvdWnOVc3ygVzK7l/rqIPuVvsoiO3zOM2Z+sxPHKVfa5Wo29vfyweJxDiDoG7D9kWPF8B2x/gKeQoF66HnFB96ejE+uWUcFpW0DWj1c57MKcPHXgozm05jvOXt0vB4hF4pnEG7LOX90YVqKqQy8JajF+5ncDkrWQQU=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <4303bf0e-a987-1ee4-9524-c83756789322@amd.com>
Date: Tue, 4 Jul 2023 12:14:58 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 06/52] xen/arm: introduce CONFIG_HAS_MMU
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-7-Penny.Zheng@arm.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <20230626033443.2943270-7-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P265CA0197.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:318::13) To SN6PR12MB2621.namprd12.prod.outlook.com
 (2603:10b6:805:73::15)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN6PR12MB2621:EE_|DS0PR12MB7778:EE_
X-MS-Office365-Filtering-Correlation-Id: c0ea7405-330d-4687-adb2-08db7c7fea82
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	2K7ZJzf9uyDygERV9Xolzz8s+O6RgAIMCtB2BaSVft9Y3s73TCikS3Z2JxXk4bkNXEPi2ibKT6POEivQNJzvtmYphqioYLb4G7ue0khOYfigE3241uAnaLibBxyAH9Usv4DoshqwnGhezBve4OVqreoFlnPtVtxyERVLdcXdULxWVWGFPtNPkKEFblrBwDEjB8SaxKm+XeUtbmaA4EBz5bIBGEMiB2Zv5AgTPcKuYvAV7WBVcCseYF0Vlv8taDwDU6zKfCkRMna6drHHiVUbSfqYoqrb9O+AEnLl0MbZiQTnNnNFX+x37Tl/ZZD3arLL48sxyvsVjL+MRZtZ/CHH5kFdGmv+X/dW6Dz68NSdu0RpZPijl69W6b4+JXBo374hA21clx5xdVmRWfaGrWRPotSAUu61i1UPoINPV8+cCSlfuibnIHJa9tcvoTuWVFyCTnDW3FatyPJE5IXAF7DUM8CYIpZ2QkePuogfAgmm+ZGFjHnJZXn7QKeEqJDI4UFRuT2i0sWZusDSkun4OCXQtyrlnCq8qPXnuuhDTeSm7AzpN+LSmRrXD5a9abpEbFN8M+Eq5SY/4nqPcVylo1LTVMHKQaQVQXA7HTrr3+sEW0krfxoQj+rBXLFr+a0rdT7TVXLKRnYa+QZm1lm6qezWfw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2621.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(396003)(366004)(346002)(39860400002)(451199021)(2616005)(2906002)(83380400001)(38100700002)(36756003)(31696002)(6666004)(53546011)(31686004)(6506007)(5660300002)(41300700001)(6486002)(4326008)(8936002)(8676002)(316002)(66476007)(66556008)(66946007)(6512007)(478600001)(54906003)(186003)(26005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QjQwMVZkVmhuanBaUlJ3Z1JEMGppLzE5Wm0yeVozQ3hlVWhBSk5VWmY3bDF6?=
 =?utf-8?B?enhNN0tuUHFyUVFKVjl6RUs5UU1SM2kzYlBQTm9sbHEyRzNLYXp2R3RSK1hF?=
 =?utf-8?B?aGh5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rV3lzTHo1?=
 =?utf-8?B?bmJCenZPRzAxb05ONnZFKzVHRHVVZXYwQ3Zxby95R1ExNDg1U1dCTThPVWJp?=
 =?utf-8?B?MTNKcDRjOWx3WDB3NmdTVnEyYmdTVGt5RjR3MTYzZU1VMGhOU2tsRDg0c2VJ?=
 =?utf-8?B?NmlQeTFrZGJCSUQ1RTVlLzlOWHJ4Vi95Q2ZualNwV25XVWZPS2xzRHl1d2ZD?=
 =?utf-8?B?Y003ejVIQTVsL21LQ2Q2QzJJZFFqaERGT0xjOUk4UDZjV3BUWEk2SG9GY3pR?=
 =?utf-8?Q?HV7wNpFSf43o1fiKgnONoySB/?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c0ea7405-330d-4687-adb2-08db7c7fea82
X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2621.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 11:15:04.2139
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: M4ziEqqUbz9xgBHsE5MGjfK1UwB/KJz9Y0Rx1d3j/k2+fldzvQVkxfuVmC+xYntr7pkLVD88F6RlTGUQME5iIw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7778

Hi Penny,

On 26/06/2023 04:33, Penny Zheng wrote:
> CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
>
>
> This commit wants to introduce a new Kconfig CONFIG_HAS_MMU to guard
> MMU-related codes, to tell two different memory management architecture:
> VMAS and PMSA.
>
> In a VMSA system, a Memory Management Unit (MMU) provides fine-grained
> control of a memory system through a set of virtual to physical address
> mappings and associated memory properties held in memory-mapped tables
> known as translation tables.
>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> ---
> v3:
> - new patch
> ---
>   xen/arch/arm/Kconfig | 8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> index ff17345cdb..fb77392b82 100644
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -60,6 +60,14 @@ config PADDR_BITS
>
>   source "arch/Kconfig"
>
> +config HAS_MMU
> +       bool "Memory Management Unit support in a VMSA system"
> +       default y
> +       help
> +         In a VMSA system, a Memory Management Unit (MMU) provides fine-grained control of
> +         a memory system through a set of virtual to physical address mappings and associated memory
> +         properties held in memory-mapped tables known as translation tables.
> +
>   config ACPI
>          bool "ACPI (Advanced Configuration and Power Interface) Support (UNSUPPORTED)" if UNSUPPORTED
>          depends on ARM_64

I don't think you need this option.

In patch 52 ("xen/arm: add Kconfig option CONFIG_HAS_MPU to enable MPU 
system support"), you have introduced "HAS_MPU" option.

May be you can introduce "HAS_MPU" option a bit earlier, so that 
"!HAS_MPU" is "HAS_MMU". So, you will not need this new option.

Let me know if this makes sense.

- Ayan

> --
> 2.25.1
>
>


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 11:44:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 11:44:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558271.872203 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGeRt-0005TF-1h; Tue, 04 Jul 2023 11:44:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558271.872203; Tue, 04 Jul 2023 11:44:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGeRs-0005T8-VL; Tue, 04 Jul 2023 11:44:00 +0000
Received: by outflank-mailman (input) for mailman id 558271;
 Tue, 04 Jul 2023 11:43:59 +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
 <SRS0=U+xY=CW=invisiblethingslab.com=marmarek@srs-se1.protection.inumbo.net>)
 id 1qGeRr-0005T2-Cc
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 11:43:59 +0000
Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com
 [64.147.123.19]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0d19233a-1a60-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 13:43:55 +0200 (CEST)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.west.internal (Postfix) with ESMTP id 4BCDB3200A5D;
 Tue,  4 Jul 2023 07:43:51 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute5.internal (MEProxy); Tue, 04 Jul 2023 07:43:52 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 4 Jul 2023 07:43:49 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0d19233a-1a60-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm2; t=
	1688471030; x=1688557430; bh=DXvLHS+0i7KcpP91tmBqUwtDBGkK3GQmg1d
	L9ga2TME=; b=tCAVBdS90txzFAY/kbvh0fqlDpF54OjKwYSWGZXBvpmjlN60j/N
	ZxBE4ZebnUhndB1F376MCXu80BXumESmISrYvSjincFvsy+GT/BsKhy/xaLr29EJ
	sHHDqcqUId9mTks0hfL7pZC31e87WVA1uYtEb23l/pUxDSFtSQuMC/QWOM3QgQ61
	VHuO+rT1bEo8xRxcSsASkTl7jOJpQFz6Qy8gcKWoFFl/jdOmu58fBmra9LU2Mj0a
	Obp7OaVD7TXceIr4zirkdJlp0ffgPaoOoNYNyqJr1i+KOz1LdK7FZCQesg8fs9Mw
	AUejzM/dsYowgIsu3SeqlxkJn8ggBMXIJtQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm2; t=1688471030; x=1688557430; bh=DXvLHS+0i7Kcp
	P91tmBqUwtDBGkK3GQmg1dL9ga2TME=; b=Q88FLDWj9kdQwqhgo7RWJg/1w2ncw
	bkXNzTgHQTui4qr91NZmc/YT+FMOFOMGHsU35rGQvEPOrtaFmqkr7qCehqm3MwVF
	HAG3vK/30B0yjlUfedtsdZnrZFpM+6QKkkV/XrszRq3cFuwUztmdd98zncwrO7VR
	du6hl+t2XmNmcEsIYNECs3FSlLe3tJR+8bxI7Q5IS9BRAGa1rWEjRZ9QMqo4rlP7
	lT9tTyOUhiD4jNLe/oy2JwbpN0zTkIdhzuwCwJjdZAcQEZCju2wrbpNgFTMC2GpD
	W2IC9VZd4RI0gfdoh8nkWU5jTyBur6blENG5p5Le4A5/exLr6Z1frgXDw==
X-ME-Sender: <xms:9gWkZFb7d2DcwO0TcRnX8aiae5E_ThiLGtYQ7Xan7nmgN4xszI9mbg>
    <xme:9gWkZMZjI25uS0vMX_Hsy32Ok5XFkkL350uRvB9HCLyPkd6gxO5lEKSkVvfoncP0I
    xVivAvJ3sbpgw>
X-ME-Received: <xmr:9gWkZH-3nVZYsreqTeIEzPSCWJNHN_k7dkoGY2MDgQhAFeLbxHkSOUpXqXc-qGbYhYPP4UuRf9oWrlRCrFwuKDUH9LjOHDrCSBY>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeggdeggecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpeffhffvvefukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpeforghrvghk
    ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh
    hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeeiheff
    iefgteetveeviefhhfelleevgfevvefgtdetteejheeigefhtedvtdevieenucffohhmrg
    hinhepohgrshhishdqohhpvghnrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfr
    rghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslhgvthhhih
    hnghhslhgrsgdrtghomh
X-ME-Proxy: <xmx:9gWkZDqn-iNBkAiMUbJhz0QSeD4EYXZ5tA-Zkm2--80m3br__yse0Q>
    <xmx:9gWkZAoUszWDFlcjGIF-VdDA0VRm9xPwbN65CMPVf8gHPVh2kiYWSg>
    <xmx:9gWkZJQgX2cJQdlgw8_aEbKcjniOGe8jHzWUtZc_OQDKme7f-yq6OQ>
    <xmx:9gWkZFCTIMmfD98ST-RPlQpe_WaYhmCcavPKdwqL408Wo8bCcWsOiA>
Feedback-ID: i1568416f:Fastmail
Date: Tue, 4 Jul 2023 13:43:46 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Juergen Gross <jgross@suse.com>
Cc: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
	Petr Pavlu <petr.pavlu@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	vikram.garhwal@amd.com
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
Message-ID: <ZKQF8qq8Oh5E+Fxx@mail-itl>
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
 <b21398eb-2fb2-4fca-dd90-d2c81d8df1c4@epam.com>
 <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop>
 <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>
 <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="bKEul5l8IcOXfCYH"
Content-Disposition: inline
In-Reply-To: <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com>


--bKEul5l8IcOXfCYH
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Tue, 4 Jul 2023 13:43:46 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Juergen Gross <jgross@suse.com>
Cc: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
	Petr Pavlu <petr.pavlu@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	vikram.garhwal@amd.com
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0

Hi,

FWIW, I have ran into this issue some time ago too. I run Xen on top of
KVM and then passthrough some of the virtio devices (network one
specifically) into a (PV) guest. So, I hit both cases, the dom0 one and
domU one. As a temporary workaround I needed to disable
CONFIG_XEN_VIRTIO completely (just disabling
CONFIG_XEN_VIRTIO_FORCE_GRANT was not enough to fix it).
With that context in place, the actual response below.

On Tue, Jul 04, 2023 at 12:39:40PM +0200, Juergen Gross wrote:
> On 04.07.23 09:48, Roger Pau Monn=C3=A9 wrote:
> > On Thu, Jun 29, 2023 at 03:44:04PM -0700, Stefano Stabellini wrote:
> > > On Thu, 29 Jun 2023, Oleksandr Tyshchenko wrote:
> > > > On 29.06.23 04:00, Stefano Stabellini wrote:
> > > > > I think we need to add a second way? It could be anything that ca=
n help
> > > > > us distinguish between a non-grants-capable virtio backend and a
> > > > > grants-capable virtio backend, such as:
> > > > > - a string on xenstore
> > > > > - a xen param
> > > > > - a special PCI configuration register value
> > > > > - something in the ACPI tables
> > > > > - the QEMU machine type
> > > >=20
> > > >=20
> > > > Yes, I remember there was a discussion regarding that. The point is=
 to
> > > > choose a solution to be functional for both PV and HVM *and* to be =
able
> > > > to support a hotplug. IIRC, the xenstore could be a possible candid=
ate.
> > >=20
> > > xenstore would be among the easiest to make work. The only downside is
> > > the dependency on xenstore which otherwise virtio+grants doesn't have.
> >=20
> > I would avoid introducing a dependency on xenstore, if nothing else we
> > know it's a performance bottleneck.
> >=20
> > We would also need to map the virtio device topology into xenstore, so
> > that we can pass different options for each device.
>=20
> This aspect (different options) is important. How do you want to pass vir=
tio
> device configuration parameters from dom0 to the virtio backend domain? Y=
ou
> probably need something like Xenstore (a virtio based alternative like vi=
rtiofs
> would work, too) for that purpose.
>=20
> Mapping the topology should be rather easy via the PCI-Id, e.g.:
>=20
> /local/domain/42/device/virtio/0000:00:1c.0/backend

While I agree this would probably be the simplest to implement, I don't
like introducing xenstore dependency into virtio frontend either.
Toolstack -> backend communication is probably easier to solve, as it's
much more flexible (could use qemu cmdline, QMP, other similar
mechanisms for non-qemu backends etc).

> > > Vikram is working on virtio with grants support in QEMU as we speak.
> > > Maybe we could find a way to add a flag in QEMU so that we can detect=
 at
> > > runtime if a given virtio device support grants or not.
> >=20
> > Isn't there a way for the device to expose capabilities already?  For
> > example how does a virtio-blk backend expose support for indirect
> > descriptors?
>=20
> Those capabilities are defined in the virtio spec [1]. Adding the backend
> domid would be possible, but it probably wouldn't be that easy (requires
> changing the virtio spec by either expanding an existing config area or by
> adding a new one). I'm not sure handling in the specific frontends is
> generic enough for being able to have a central place where the backend
> domid could be retrieved, without requiring any change of the frontends.

IMHO the proper solution is to extend the spec. I don't have much
experience with virtio code, but reading the spec it looks like new
config area will be better for compatibility/uniform handling in a
frontent-agnostic way. Since it will definitely take time, some
transitional solution (maybe even xenstore...) might be warranted.

> Juergen
>=20
> [1]: http://docs.oasis-open.org/virtio/virtio/v1.2/virtio-v1.2.html






--=20
Best Regards,
Marek Marczykowski-G=C3=B3recki
Invisible Things Lab

--bKEul5l8IcOXfCYH
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmSkBfIACgkQ24/THMrX
1yyXUgf+N/PLUJAoNhlNjh4kow5XxRzM4Afaw1bwhZYI6546o2bL/yRgGWcBqNue
nNZzUUmNMsNvEi0zy/1rWQppCaDZKPhgtb33Ty9oC9iSBeziB9LQk8A8yOMiQ0st
hazKZOfD2GBRpfULOfUCOj6+9AQWadmnHAbKT0gJMSARp3shkfN7kZoL4xczD9tn
2JKsIIBERXc/MpMh7gQwM0F6EBf00Zqi6Qvss8/IKtNuUSI9u7xQLOWrxscUXKCc
OoDe7b4jhgRpRR3BZoiON6khBEKBt59UcZR+mQll0h9XeTH7n0MyaZO5SASVdD3m
L1RNV4X+MQ8fUplS1LMJtKBg3j9pBA==
=CQd8
-----END PGP SIGNATURE-----

--bKEul5l8IcOXfCYH--


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 11:44:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 11:44:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558279.872213 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGeSm-00061l-Dm; Tue, 04 Jul 2023 11:44:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558279.872213; Tue, 04 Jul 2023 11:44:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGeSm-00061e-B7; Tue, 04 Jul 2023 11:44:56 +0000
Received: by outflank-mailman (input) for mailman id 558279;
 Tue, 04 Jul 2023 11:44:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGeSl-00061U-9m
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 11:44:55 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGeSk-0006Pi-Gj; Tue, 04 Jul 2023 11:44:54 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGeSk-00018m-A2; Tue, 04 Jul 2023 11:44:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=FNRxPPITnRQS+7Jl7qtJ4CP52HqUX7u+GL8GLOzKqwQ=; b=6C0d+H+roX0CS+5MFV2gJnRkeM
	TCj6d9BWLKFqvh7XDl+QT6pZcs5WTpRJEnHjwpG7BpmmIE91BnHq8DXEStXb7t7ELrTh3m0Qyx6zd
	lI3cdQloEOG03Por3+J6rl93EkeA/iKeO1eQy9gwmk0bk53AH8h4UUWKcH2WB3n3o86k=;
Message-ID: <1cbf44ae-2500-1428-5dd2-893e846faf1e@xen.org>
Date: Tue, 4 Jul 2023 12:44:52 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 06/52] xen/arm: introduce CONFIG_HAS_MMU
Content-Language: en-US
To: Ayan Kumar Halder <ayankuma@amd.com>, Penny Zheng <Penny.Zheng@arm.com>,
 xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-7-Penny.Zheng@arm.com>
 <4303bf0e-a987-1ee4-9524-c83756789322@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <4303bf0e-a987-1ee4-9524-c83756789322@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 04/07/2023 12:14, Ayan Kumar Halder wrote:
> On 26/06/2023 04:33, Penny Zheng wrote:
>> CAUTION: This message has originated from an External Source. Please 
>> use proper judgment and caution when opening attachments, clicking 
>> links, or responding to this email.
>>
>>
>> This commit wants to introduce a new Kconfig CONFIG_HAS_MMU to guard
>> MMU-related codes, to tell two different memory management architecture:
>> VMAS and PMSA.
>>
>> In a VMSA system, a Memory Management Unit (MMU) provides fine-grained
>> control of a memory system through a set of virtual to physical address
>> mappings and associated memory properties held in memory-mapped tables
>> known as translation tables.
>>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> ---
>> v3:
>> - new patch
>> ---
>> Â  xen/arch/arm/Kconfig | 8 ++++++++
>> Â  1 file changed, 8 insertions(+)
>>
>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>> index ff17345cdb..fb77392b82 100644
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -60,6 +60,14 @@ config PADDR_BITS
>>
>> Â  source "arch/Kconfig"
>>
>> +config HAS_MMU
>> +Â Â Â Â Â Â  bool "Memory Management Unit support in a VMSA system"
>> +Â Â Â Â Â Â  default y

I don't think you can disable HAS_MMU right now. So you want to drop the 
description to prevent a user to select it. This could then be combined to

"def_bool y".

>> +Â Â Â Â Â Â  help
>> +Â Â Â Â Â Â Â Â  In a VMSA system, a Memory Management Unit (MMU) provides 
>> fine-grained control of
>> +Â Â Â Â Â Â Â Â  a memory system through a set of virtual to physical address 
>> mappings and associated memory
>> +Â Â Â Â Â Â Â Â  properties held in memory-mapped tables known as translation 
>> tables.
>> +
>> Â  config ACPI
>> Â Â Â Â Â Â Â Â  bool "ACPI (Advanced Configuration and Power Interface) 
>> Support (UNSUPPORTED)" if UNSUPPORTED
>> Â Â Â Â Â Â Â Â  depends on ARM_64
> 
> I don't think you need this option.

I think we want to introduce a 'choice' where the user can select either 
the MPU or MMU. But not both.

This would be similar to how we select the Physical address space size.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 11:47:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 11:47:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558283.872224 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGeUv-0006eR-Pc; Tue, 04 Jul 2023 11:47:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558283.872224; Tue, 04 Jul 2023 11:47:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGeUv-0006eK-MP; Tue, 04 Jul 2023 11:47:09 +0000
Received: by outflank-mailman (input) for mailman id 558283;
 Tue, 04 Jul 2023 11:47:08 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGeUu-0006dv-4n
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 11:47:08 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGeUt-0006To-Sx; Tue, 04 Jul 2023 11:47:07 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGeUt-0001CP-OA; Tue, 04 Jul 2023 11:47:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=5rAYeeMjuJjW2JpxVAZvepcyLjRUGMz17l6NWz50Mso=; b=6BGFFTvBt1UZLr/oKmn7YJb87o
	mdnGC8yWwxpIHCLiXYQYXT86HWg/cDMzYKctIZX6mmSC2TZpc5fEk0NGo0+nppQoR2IdLdc1nPmdz
	Ajf5flZE2+WI00pjsBCKOXQa85udpn70TFTUBPk3wkiNVIIu1M6yHgz2b5qzRb1klNSc=;
Message-ID: <77c64929-514a-ea67-cf8b-176c895ff971@xen.org>
Date: Tue, 4 Jul 2023 12:47:06 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 03/52] xen/arm: add an option to define Xen start
 address for Armv8-R
Content-Language: en-US
To: Ayan Kumar Halder <ayankuma@amd.com>, Penny Zheng <Penny.Zheng@arm.com>,
 xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-4-Penny.Zheng@arm.com>
 <cb7e3d34-bbb8-e5df-f87b-0fcac4b65378@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <cb7e3d34-bbb8-e5df-f87b-0fcac4b65378@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 04/07/2023 11:36, Ayan Kumar Halder wrote:
> Hi Penny,

Hi Ayan,

> On 26/06/2023 04:33, Penny Zheng wrote:
>> CAUTION: This message has originated from an External Source. Please 
>> use proper judgment and caution when opening attachments, clicking 
>> links, or responding to this email.
>>
>>
>> From: Wei Chen <wei.chen@arm.com>
>>
>> On Armv8-A, Xen has a fixed virtual start address (link address
>> too) for all Armv8-A platforms. In an MMU based system, Xen can
>> map its loaded address to this virtual start address. So, on
>> Armv8-A platforms, the Xen start address does not need to be
>> configurable. But on Armv8-R platforms, there is no MMU to map
>> loaded address to a fixed virtual address and different platforms
>> will have very different address space layout. So Xen cannot use
>> a fixed physical address on MPU based system and need to have it
>> configurable.
>>
>> In this patch we introduce one Kconfig option for users to define
>> the default Xen start address for Armv8-R. Users can enter the
>> address in config time, or select the tailored platform config
>> file from arch/arm/configs.
>>
>> And as we introduced Armv8-R to Xen, that means the existed Arm64
>> MMU based platforms should not be listed in Armv8-R platform
>> list, so we add !HAS_MPU dependency for these platforms.
>>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>> ---
>> v1 -> v2:
>> 1. Remove the platform header fvp_baser.h.
>> 2. Remove the default start address for fvp_baser64.
>> 3. Remove the description of default address from commit log.
>> 4. Change HAS_MPU to ARM_V8R for Xen start address dependency.
>> Â Â Â  No matter Arm-v8r board has MPU or not, it always need to
>> Â Â Â  specify the start address.
>> ---
>> v3:
>> 1. Remove unrelated change of "CONFIG_FVP_BASER"
>> 2. Change ARM_V8R to HAS_MPU for Xen start address dependency
>> ---
>> Â  xen/arch/arm/KconfigÂ Â Â Â Â Â Â Â Â Â  | 8 ++++++++
>> Â  xen/arch/arm/platforms/Kconfig | 8 +++++---
>> Â  2 files changed, 13 insertions(+), 3 deletions(-)
>>
>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>> index 70fdc2ba63..ff17345cdb 100644
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -181,6 +181,14 @@ config TEE
>> Â Â Â Â Â Â Â Â Â Â  This option enables generic TEE mediators support. It 
>> allows guests
>> Â Â Â Â Â Â Â Â Â Â  to access real TEE via one of TEE mediators implemented in 
>> XEN.
>>
>> +config XEN_START_ADDRESS
>> +Â Â Â Â Â Â  hex "Xen start address: keep default to use platform defined 
>> address"
>> +Â Â Â Â Â Â  default 0
>> +Â Â Â Â Â Â  depends on HAS_MPU
>> +Â Â Â Â Â Â  help
>> +Â Â Â Â Â Â Â Â  This option allows to set the customized address at which 
>> Xen will be
>> +Â Â Â Â Â Â Â Â  linked on MPU systems. This address must be aligned to a 
>> page size.
>> +
>> Â  source "arch/arm/tee/Kconfig"
>>
>> Â  config STATIC_SHM
>> diff --git a/xen/arch/arm/platforms/Kconfig 
>> b/xen/arch/arm/platforms/Kconfig
>> index c93a6b2756..75af48b5f9 100644
>> --- a/xen/arch/arm/platforms/Kconfig
>> +++ b/xen/arch/arm/platforms/Kconfig
>> @@ -1,6 +1,7 @@
>> Â  choice
>> Â Â Â Â Â Â Â Â  prompt "Platform Support"
>> Â Â Â Â Â Â Â Â  default ALL_PLAT
>> +Â Â Â Â Â Â  default NO_PLAT if HAS_MPU
> 
> I am a bit concerned about this as we will be introducing R52 specific 
> platform in xen/arch/arm/platforms/
> 
> (For eg 
> https://github.com/Xilinx/xen/blob/xlnx_rebase_4.17/xen/arch/arm_mpu/platforms/amd-versal-net.c )
> 
> Thus, we will have to remove this line at that time.
> 
> Can you remove this line, please if it does not cause any issue ?

 From my understanding of the discussion at Xen Summit, most of the 
platform specific code would be moved to something similar to bootwrapper.

So do you still actually need to have code in Xen for setting up the timer?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 11:51:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 11:51:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558287.872234 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGeYw-00087O-9z; Tue, 04 Jul 2023 11:51:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558287.872234; Tue, 04 Jul 2023 11:51:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGeYw-00087H-7D; Tue, 04 Jul 2023 11:51:18 +0000
Received: by outflank-mailman (input) for mailman id 558287;
 Tue, 04 Jul 2023 11:51:16 +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
 <SRS0=Gy6C=CW=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qGeYu-00087B-90
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 11:51:16 +0000
Received: from NAM10-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam10on2061d.outbound.protection.outlook.com
 [2a01:111:f400:7e88::61d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 12d06a30-1a61-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 13:51:12 +0200 (CEST)
Received: from SN6PR12MB2621.namprd12.prod.outlook.com (2603:10b6:805:73::15)
 by IA0PR12MB7553.namprd12.prod.outlook.com (2603:10b6:208:43f::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 11:51:07 +0000
Received: from SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54]) by SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54%2]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 11:51:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 12d06a30-1a61-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=g05puPOLYeV0Hl5HOlyI37OhNG1W3yCFtTQ3SsGe55Mk0KAGX6kV4P8kssacRRC9262fvOrfuHqgKWRfzll7z6QcT20tO0lACNO1qN/i+MtVw2pK22inep6y2XFByIHyN1C/KcPBN2g0tgvNEXT8m7xd3pplQEqRbcqu9bBW6voM05lfTX0yOMkR2BwACZLQC6gzgpFcUgTz4nyyvGy29s4QQjs0XEk1hvXuKUNZhokUs+TJwUyRbNjkynI0EkWX2Su17LuC9rZ2dMSo2VBlxj2jnIcI5vm/U5SrQ8wzX5vboIkyZ422Ii+bIPJFPDwOvC2I2xEG7SsogeIH3uX+Cw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=f3ANhmqLxdvka1UwAGjja914oZsDBwyaZbAbS5VTPug=;
 b=KL+HTjkRgrPZFjnVuu86MV1TNnAl8wrwWGmHonNMoywCMj1TfAmyjH1HinDMh4Dgh1f7rxROLlbOzPBFa4jnDOurB/guqSqmNXYmDYh8minwl/A3WXvycKVXHNA7sK+CIOaMiA0ZHl3XM7DFqlqpenzdyX6gsqnA3B87uecXYPHHyLb2elnJ6mhwcPm6absiAm2Qvw2/UPPk5XlkUvxvq9hSiEaLo3qKOM/DGEi3SfmZ+fPv9cYEQK4nJnbJVs7rvqItiBhQB6DtCgua/D0r3LUZLujN9AJLsryK4kR7MlvrXvXLdZu2/xzUBlJJUfrryotidnn1IsD4O1aeflpyCA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=f3ANhmqLxdvka1UwAGjja914oZsDBwyaZbAbS5VTPug=;
 b=cNVvrzmNbxniWqXRtegRn4WJj8rUH5o76tKJwcmW0f2TAKjP1oH5ZiHjj/JSgE4Wh4Oc29tAAORx9J/s0re3dhfOE1+PuhXetKmKYXIjWrM9SCkfs6viG8M8jVTBnJvliKfqU+AsV9Pw9UqLEkv91KUqOE+L+TDJjqbKIhor8iE=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <5f3781d8-2f22-d6ab-dfe8-4a3d721a0459@amd.com>
Date: Tue, 4 Jul 2023 12:51:00 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 08/52] xen/arm64: move MMU related code from head.S to
 mmu/head.S
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-9-Penny.Zheng@arm.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <20230626033443.2943270-9-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0148.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:188::9) To SN6PR12MB2621.namprd12.prod.outlook.com
 (2603:10b6:805:73::15)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN6PR12MB2621:EE_|IA0PR12MB7553:EE_
X-MS-Office365-Filtering-Correlation-Id: e3ac331a-b7ff-4426-f9ad-08db7c84f37f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Feic9l5MM7U4MsTiu2rza66mCn+PH0XFbGxMWXvsBli8TT44l9PnpJVV7qam3YaEejwDff6OApo2p7NNgAcjXh7capjFg9y9OQCjHeEikTC8TkHH5G/mxCWHq+aK4XQLsiWsxrVehwXfcCgvJ6ywyUJ3Ml6FaZ2pb4snjARMSBICmULY3z6ZgM6F3jN0zn3e97ykui9bIov5s0jSqKFhf7h2INS6w8u28lCaZtZOHW7SGtp7VtB98fIXf0pHzcKl2aGguiTXiJYToAlyk8PWDYFD1x4r9B/NlFoy9wAqzN43t3XPOKyVYJ9bJhVLtzyAF4ABOQyknFXALYKXz/0/tLn9iR0/i1Ek0dFlIlvNnrRleycFP8rAKRe3lE7f/2I5ZasTNA9mkBqNPMzyXh/Gp8HW1b0eNWxqH1VpcDiZUMyjgnPczDVFXD7pXwExmFG9Ax9SuRwfMqGoEnZ7ssl1U4aWcdB1/Vd361z0lnlQD17mgzbmjMitrsAHDGYwNuM8+aiXaNcSCY+lYggWMZQF4W8x8qStPLXvuBmEg7C+xBH66v7PQFok033DKpzM5GNjL9AX7N1nPaF1NgyGebh3eccEtNBLIbhTORlX2TOd1QIef62LFJSEtTetA/o16S7QNVWJgAADQIpjFXyLntvFsCIrNEyNjQuWG9HWGHYnRUw=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2621.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(136003)(39860400002)(396003)(366004)(451199021)(26005)(31686004)(478600001)(6666004)(6512007)(6506007)(31696002)(2616005)(186003)(53546011)(38100700002)(54906003)(66476007)(66556008)(4326008)(66946007)(83380400001)(6486002)(316002)(8676002)(8936002)(30864003)(41300700001)(2906002)(5660300002)(36756003)(2004002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?emd0VGQ1UEpnZnZvS0h3TTRjSHdoVkUzYkNJd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nE5c0RVYmc3VTYrcWQ5ZW9tTEFVS3JTOExsVDFPK0R3?=
 =?utf-8?B?OGhISEtUb3kvNkpUcHhkb1B5NEZpOGY0dkdDZWNQVzI5clI4WFRKWjcxVSta?=
 =?utf-8?B?U0h2OHRQRGhuQTNCRStkWW11NXVnK1NtWXZSMFBCaUlkRGRTVjB4Vkw4Vmkz?=
 =?utf-8?B?OXVTenBWR0huRk5tWm96b29HRGRsMmVBQTcvYzM0dGo3VWtDdnUxOTdHbHU5?=
 =?utf-8?B?U1JyN1hNUlp4YVUrMWtHWit0SjNsWW04QjRGOFozUUFPQS8rR1h2NFZFQ01u?=
 =?utf-8?B?SUxITkFzZFZiaVRFUW9UZ2FDNXZwdmRkM2RCRFEyUWx2cFVpclh4RmNqdWRP?=
 =?utf-8?Q?PEENc28cUmBswLBna4FPujItk?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e3ac331a-b7ff-4426-f9ad-08db7c84f37f
X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2621.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 11:51:06.8165
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: lJ+VqZ2HobmVFL9VH8J4khvLZlTRr62FnGP87Js0N53TAs93seUCOgEbt12CCuXXZ7nKlK10vfheKkocH8sLxw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7553


On 26/06/2023 04:33, Penny Zheng wrote:
> CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
>
>
> From: Wei Chen <wei.chen@arm.com>
>
> There are lots of MMU specific code in head.S. This code will not
> be used in MPU systems. If we use #ifdef to gate them, the code
> will become messy and hard to maintain. So we move MMU related
> code to mmu/head.S, and keep common code still in head.S. We also
> add .text.idmap in mmu/head.S to make all code in this new file
> are still in identity map page but will be linked after head.S.
>
> As "fail" in head.S is very simple and this name is too easy to
> be conflicted, so duplicate it in mmu/head.S instead of exporting
> it.
>
> And some assembly macros that will be shared by MMU and MPU later,
> we move them to macros.h.
>
> Rename enable_boot_mmu()/enable_runtime_mmu() to a more generic name
> enable_boot_mm()/enable_runtime_mm(), in order to make them common interfaces
> to be used for both MMU and later MPU system.
>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> ---
> v1 -> v2:
> 1. Move macros to macros.h
> 2. Remove the indention modification
> 3. Duplicate "fail" instead of exporting it.
> ---
> v3:
> - Rename enable_boot_mmu()/enable_runtime_mmu() to a more generic name
> enable_boot_mm()/enable_runtime_mm()
> ---
>   xen/arch/arm/arm64/Makefile             |   3 +
>   xen/arch/arm/arm64/head.S               | 469 +-----------------------
>   xen/arch/arm/arm64/mmu/head.S           | 453 +++++++++++++++++++++++
>   xen/arch/arm/include/asm/arm64/macros.h |  51 +++
>   4 files changed, 509 insertions(+), 467 deletions(-)
>   create mode 100644 xen/arch/arm/arm64/mmu/head.S
>
> diff --git a/xen/arch/arm/arm64/Makefile b/xen/arch/arm/arm64/Makefile
> index 54ad55c75c..0c4b177be9 100644
> --- a/xen/arch/arm/arm64/Makefile
> +++ b/xen/arch/arm/arm64/Makefile
> @@ -8,6 +8,9 @@ obj-y += domctl.o
>   obj-y += domain.o
>   obj-y += entry.o
>   obj-y += head.o
> +ifeq ($(CONFIG_HAS_MMU),y)
> +obj-y += mmu/head.o
> +endif
>   obj-y += insn.o
>   obj-$(CONFIG_LIVEPATCH) += livepatch.o
>   obj-y += mm.o
> diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
> index 66347eedcc..e63886b037 100644
> --- a/xen/arch/arm/arm64/head.S
> +++ b/xen/arch/arm/arm64/head.S
> @@ -28,17 +28,6 @@
>   #include <asm/arm64/efibind.h>
>   #endif
>
> -#define PT_PT     0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
> -#define PT_MEM    0xf7d /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=0 P=1 */
> -#define PT_MEM_L3 0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
> -#define PT_DEV    0xe71 /* nG=1 AF=1 SH=10 AP=01 NS=1 ATTR=100 T=0 P=1 */
> -#define PT_DEV_L3 0xe73 /* nG=1 AF=1 SH=10 AP=01 NS=1 ATTR=100 T=1 P=1 */
> -
> -/* Convenience defines to get slot used by Xen mapping. */
> -#define XEN_ZEROETH_SLOT    zeroeth_table_offset(XEN_VIRT_START)
> -#define XEN_FIRST_SLOT      first_table_offset(XEN_VIRT_START)
> -#define XEN_SECOND_SLOT     second_table_offset(XEN_VIRT_START)
> -
>   #define __HEAD_FLAG_PAGE_SIZE   ((PAGE_SHIFT - 10) / 2)
>
>   #define __HEAD_FLAG_PHYS_BASE   1
> @@ -85,57 +74,6 @@
>    *  x30 - lr
>    */
>
> -#ifdef CONFIG_EARLY_PRINTK
> -/*
> - * Macro to print a string to the UART, if there is one.
> - *
> - * Clobbers x0 - x3
> - */
> -#define PRINT(_s)          \
> -        mov   x3, lr ;     \
> -        adr   x0, 98f ;    \
> -        bl    asm_puts ;   \
> -        mov   lr, x3 ;     \
> -        RODATA_STR(98, _s)
> -
> -/*
> - * Macro to print the value of register \xb
> - *
> - * Clobbers x0 - x4
> - */
> -.macro print_reg xb
> -        mov   x0, \xb
> -        mov   x4, lr
> -        bl    putn
> -        mov   lr, x4
> -.endm
> -
> -#else /* CONFIG_EARLY_PRINTK */
> -#define PRINT(s)
> -
> -.macro print_reg xb
> -.endm
> -
> -#endif /* !CONFIG_EARLY_PRINTK */
> -
> -/*
> - * Pseudo-op for PC relative adr <reg>, <symbol> where <symbol> is
> - * within the range +/- 4GB of the PC.
> - *
> - * @dst: destination register (64 bit wide)
> - * @sym: name of the symbol
> - */
> -.macro  adr_l, dst, sym
> -        adrp \dst, \sym
> -        add  \dst, \dst, :lo12:\sym
> -.endm
> -
> -/* Load the physical address of a symbol into xb */
> -.macro load_paddr xb, sym
> -        ldr \xb, =\sym
> -        add \xb, \xb, x20
> -.endm
> -
>   .section .text.header, "ax", %progbits
>   /*.aarch64*/
>
> @@ -317,7 +255,7 @@ real_start_efi:
>
>           /* We are still in the 1:1 mapping. Jump to the runtime Virtual Address. */
>           ldr   lr, =primary_switched
> -        b     enable_boot_mmu
> +        b     enable_boot_mm
>
>   primary_switched:
>           bl    setup_fixmap
> @@ -367,7 +305,7 @@ GLOBAL(init_secondary)
>
>           /* We are still in the 1:1 mapping. Jump to the runtime Virtual Address. */
>           ldr   lr, =secondary_switched
> -        b     enable_runtime_mmu
> +        b     enable_runtime_mm
>
>   secondary_switched:
>   #ifdef CONFIG_EARLY_PRINTK
> @@ -475,364 +413,6 @@ cpu_init:
>           ret
>   ENDPROC(cpu_init)
>
> -/*
> - * Macro to find the slot number at a given page-table level
> - *
> - * slot:     slot computed
> - * virt:     virtual address
> - * lvl:      page-table level
> - */
> -.macro get_table_slot, slot, virt, lvl
> -        ubfx  \slot, \virt, #XEN_PT_LEVEL_SHIFT(\lvl), #XEN_PT_LPAE_SHIFT
> -.endm
> -
> -/*
> - * Macro to create a page table entry in \ptbl to \tbl
> - *
> - * ptbl:    table symbol where the entry will be created
> - * tbl:     table symbol to point to
> - * virt:    virtual address
> - * lvl:     page-table level
> - * tmp1:    scratch register
> - * tmp2:    scratch register
> - * tmp3:    scratch register
> - *
> - * Preserves \virt
> - * Clobbers \tmp1, \tmp2, \tmp3
> - *
> - * Also use x20 for the phys offset.
> - *
> - * Note that all parameters using registers should be distinct.
> - */
> -.macro create_table_entry, ptbl, tbl, virt, lvl, tmp1, tmp2, tmp3
> -        get_table_slot \tmp1, \virt, \lvl   /* \tmp1 := slot in \tlb */
> -
> -        load_paddr \tmp2, \tbl
> -        mov   \tmp3, #PT_PT                 /* \tmp3 := right for linear PT */
> -        orr   \tmp3, \tmp3, \tmp2           /*          + \tlb paddr */
> -
> -        adr_l \tmp2, \ptbl
> -
> -        str   \tmp3, [\tmp2, \tmp1, lsl #3]
> -.endm
> -
> -/*
> - * Macro to create a mapping entry in \tbl to \phys. Only mapping in 3rd
> - * level table (i.e page granularity) is supported.
> - *
> - * ptbl:    table symbol where the entry will be created
> - * virt:    virtual address
> - * phys:    physical address (should be page aligned)
> - * tmp1:    scratch register
> - * tmp2:    scratch register
> - * tmp3:    scratch register
> - * type:    mapping type. If not specified it will be normal memory (PT_MEM_L3)
> - *
> - * Preserves \virt, \phys
> - * Clobbers \tmp1, \tmp2, \tmp3
> - *
> - * Note that all parameters using registers should be distinct.
> - */
> -.macro create_mapping_entry, ptbl, virt, phys, tmp1, tmp2, tmp3, type=PT_MEM_L3
> -        and   \tmp3, \phys, #THIRD_MASK     /* \tmp3 := PAGE_ALIGNED(phys) */
> -
> -        get_table_slot \tmp1, \virt, 3      /* \tmp1 := slot in \tlb */
> -
> -        mov   \tmp2, #\type                 /* \tmp2 := right for section PT */
> -        orr   \tmp2, \tmp2, \tmp3           /*          + PAGE_ALIGNED(phys) */
> -
> -        adr_l \tmp3, \ptbl
> -
> -        str   \tmp2, [\tmp3, \tmp1, lsl #3]
> -.endm
> -
> -/*
> - * Rebuild the boot pagetable's first-level entries. The structure
> - * is described in mm.c.
> - *
> - * After the CPU enables paging it will add the fixmap mapping
> - * to these page tables, however this may clash with the 1:1
> - * mapping. So each CPU must rebuild the page tables here with
> - * the 1:1 in place.
> - *
> - * Inputs:
> - *   x19: paddr(start)
> - *   x20: phys offset
> - *
> - * Clobbers x0 - x4
> - */
> -create_page_tables:
> -        /* Prepare the page-tables for mapping Xen */
> -        ldr   x0, =XEN_VIRT_START
> -        create_table_entry boot_pgtable, boot_first, x0, 0, x1, x2, x3
> -        create_table_entry boot_first, boot_second, x0, 1, x1, x2, x3
> -        create_table_entry boot_second, boot_third, x0, 2, x1, x2, x3
> -
> -        /* Map Xen */
> -        adr_l x4, boot_third
> -
> -        lsr   x2, x19, #THIRD_SHIFT  /* Base address for 4K mapping */
> -        lsl   x2, x2, #THIRD_SHIFT
> -        mov   x3, #PT_MEM_L3         /* x2 := Section map */
> -        orr   x2, x2, x3
> -
> -        /* ... map of vaddr(start) in boot_third */
> -        mov   x1, xzr
> -1:      str   x2, [x4, x1]           /* Map vaddr(start) */
> -        add   x2, x2, #PAGE_SIZE     /* Next page */
> -        add   x1, x1, #8             /* Next slot */
> -        cmp   x1, #(XEN_PT_LPAE_ENTRIES<<3) /* 512 entries per page */
> -        b.lt  1b
> -
> -        /*
> -         * If Xen is loaded at exactly XEN_VIRT_START then we don't
> -         * need an additional 1:1 mapping, the virtual mapping will
> -         * suffice.
> -         */
> -        ldr   x0, =XEN_VIRT_START
> -        cmp   x19, x0
> -        bne   1f
> -        ret
> -1:
> -        /*
> -         * Setup the 1:1 mapping so we can turn the MMU on. Note that
> -         * only the first page of Xen will be part of the 1:1 mapping.
> -         */
> -
> -        /*
> -         * Find the zeroeth slot used. If the slot is not
> -         * XEN_ZEROETH_SLOT, then the 1:1 mapping will use its own set of
> -         * page-tables from the first level.
> -         */
> -        get_table_slot x0, x19, 0       /* x0 := zeroeth slot */
> -        cmp   x0, #XEN_ZEROETH_SLOT
> -        beq   1f
> -        create_table_entry boot_pgtable, boot_first_id, x19, 0, x0, x1, x2
> -        b     link_from_first_id
> -
> -1:
> -        /*
> -         * Find the first slot used. If the slot is not XEN_FIRST_SLOT,
> -         * then the 1:1 mapping will use its own set of page-tables from
> -         * the second level.
> -         */
> -        get_table_slot x0, x19, 1      /* x0 := first slot */
> -        cmp   x0, #XEN_FIRST_SLOT
> -        beq   1f
> -        create_table_entry boot_first, boot_second_id, x19, 1, x0, x1, x2
> -        b     link_from_second_id
> -
> -1:
> -        /*
> -         * Find the second slot used. If the slot is XEN_SECOND_SLOT, then the
> -         * 1:1 mapping will use its own set of page-tables from the
> -         * third level. For slot XEN_SECOND_SLOT, Xen is not yet able to handle
> -         * it.
> -         */
> -        get_table_slot x0, x19, 2     /* x0 := second slot */
> -        cmp   x0, #XEN_SECOND_SLOT
> -        beq   virtphys_clash
> -        create_table_entry boot_second, boot_third_id, x19, 2, x0, x1, x2
> -        b     link_from_third_id
> -
> -link_from_first_id:
> -        create_table_entry boot_first_id, boot_second_id, x19, 1, x0, x1, x2
> -link_from_second_id:
> -        create_table_entry boot_second_id, boot_third_id, x19, 2, x0, x1, x2
> -link_from_third_id:
> -        create_mapping_entry boot_third_id, x19, x19, x0, x1, x2
> -        ret
> -
> -virtphys_clash:
> -        /* Identity map clashes with boot_third, which we cannot handle yet */
> -        PRINT("- Unable to build boot page tables - virt and phys addresses clash. -\r\n")
> -        b     fail
> -ENDPROC(create_page_tables)
> -
> -/*
> - * Turn on the Data Cache and the MMU. The function will return on the 1:1
> - * mapping. In other word, the caller is responsible to switch to the runtime
> - * mapping.
> - *
> - * Inputs:
> - *   x0 : Physical address of the page tables.
> - *
> - * Clobbers x0 - x4
> - */
> -enable_mmu:
> -        mov   x4, x0
> -        PRINT("- Turning on paging -\r\n")
> -
> -        /*
> -         * The state of the TLBs is unknown before turning on the MMU.
> -         * Flush them to avoid stale one.
> -         */
> -        tlbi  alle2                  /* Flush hypervisor TLBs */
> -        dsb   nsh
> -
> -        /* Write Xen's PT's paddr into TTBR0_EL2 */
> -        msr   TTBR0_EL2, x4
> -        isb
> -
> -        mrs   x0, SCTLR_EL2
> -        orr   x0, x0, #SCTLR_Axx_ELx_M  /* Enable MMU */
> -        orr   x0, x0, #SCTLR_Axx_ELx_C  /* Enable D-cache */
> -        dsb   sy                     /* Flush PTE writes and finish reads */
> -        msr   SCTLR_EL2, x0          /* now paging is enabled */
> -        isb                          /* Now, flush the icache */
> -        ret
> -ENDPROC(enable_mmu)
> -
> -/*
> - * Turn on the Data Cache and the MMU. The function will return
> - * to the virtual address provided in LR (e.g. the runtime mapping).
> - *
> - * Inputs:
> - *   lr : Virtual address to return to.
> - *
> - * Clobbers x0 - x5
> - */
> -enable_runtime_mmu:
> -        mov   x5, lr
> -
> -        load_paddr x0, init_ttbr
> -        ldr   x0, [x0]
> -
> -        bl    enable_mmu
> -        mov   lr, x5
> -
> -        /* return to secondary_switched */
> -        ret
> -ENDPROC(enable_runtime_mmu)
> -
> -/*
> - * Turn on the Data Cache and the MMU. The function will return
> - * to the virtual address provided in LR (e.g. the runtime mapping).
> - *
> - * Inputs:
> - *   lr : Virtual address to return to.
> - *
> - * Clobbers x0 - x5
> - */
> -enable_boot_mmu:
> -        mov   x5, lr
> -
> -        bl    create_page_tables
> -        load_paddr x0, boot_pgtable
> -
> -        bl    enable_mmu
> -        mov   lr, x5
> -
> -        /*
> -         * The MMU is turned on and we are in the 1:1 mapping. Switch
> -         * to the runtime mapping.
> -         */
> -        ldr   x0, =1f
> -        br    x0
> -1:
> -        /*
> -         * The 1:1 map may clash with other parts of the Xen virtual memory
> -         * layout. As it is not used anymore, remove it completely to
> -         * avoid having to worry about replacing existing mapping
> -         * afterwards. Function will return to primary_switched.
> -         */
> -        b     remove_identity_mapping
> -
> -        /*
> -         * Here might not be reached, as "ret" in remove_identity_mapping
> -         * will use the return address in LR in advance. But keep ret here
> -         * might be more safe if "ret" in remove_identity_mapping is removed
> -         * in future.
> -         */
> -        ret
> -ENDPROC(enable_boot_mmu)
> -
> -/*
> - * Remove the 1:1 map from the page-tables. It is not easy to keep track
> - * where the 1:1 map was mapped, so we will look for the top-level entry
> - * exclusive to the 1:1 map and remove it.
> - *
> - * Inputs:
> - *   x19: paddr(start)
> - *
> - * Clobbers x0 - x1
> - */
> -remove_identity_mapping:
> -        /*
> -         * Find the zeroeth slot used. Remove the entry from zeroeth
> -         * table if the slot is not XEN_ZEROETH_SLOT.
> -         */
> -        get_table_slot x1, x19, 0       /* x1 := zeroeth slot */
> -        cmp   x1, #XEN_ZEROETH_SLOT
> -        beq   1f
> -        /* It is not in slot XEN_ZEROETH_SLOT, remove the entry. */
> -        ldr   x0, =boot_pgtable         /* x0 := root table */
> -        str   xzr, [x0, x1, lsl #3]
> -        b     identity_mapping_removed
> -
> -1:
> -        /*
> -         * Find the first slot used. Remove the entry for the first
> -         * table if the slot is not XEN_FIRST_SLOT.
> -         */
> -        get_table_slot x1, x19, 1       /* x1 := first slot */
> -        cmp   x1, #XEN_FIRST_SLOT
> -        beq   1f
> -        /* It is not in slot XEN_FIRST_SLOT, remove the entry. */
> -        ldr   x0, =boot_first           /* x0 := first table */
> -        str   xzr, [x0, x1, lsl #3]
> -        b     identity_mapping_removed
> -
> -1:
> -        /*
> -         * Find the second slot used. Remove the entry for the first
> -         * table if the slot is not XEN_SECOND_SLOT.
> -         */
> -        get_table_slot x1, x19, 2       /* x1 := second slot */
> -        cmp   x1, #XEN_SECOND_SLOT
> -        beq   identity_mapping_removed
> -        /* It is not in slot 1, remove the entry */
> -        ldr   x0, =boot_second          /* x0 := second table */
> -        str   xzr, [x0, x1, lsl #3]
> -
> -identity_mapping_removed:
> -        /* See asm/arm64/flushtlb.h for the explanation of the sequence. */
> -        dsb   nshst
> -        tlbi  alle2
> -        dsb   nsh
> -        isb
> -
> -        ret
> -ENDPROC(remove_identity_mapping)
> -
> -/*
> - * Map the UART in the fixmap (when earlyprintk is used) and hook the
> - * fixmap table in the page tables.
> - *
> - * The fixmap cannot be mapped in create_page_tables because it may
> - * clash with the 1:1 mapping.
> - *
> - * Inputs:
> - *   x20: Physical offset
> - *   x23: Early UART base physical address
> - *
> - * Clobbers x0 - x3
> - */
> -setup_fixmap:
> -#ifdef CONFIG_EARLY_PRINTK
> -        /* Add UART to the fixmap table */
> -        ldr   x0, =EARLY_UART_VIRTUAL_ADDRESS
> -        create_mapping_entry xen_fixmap, x0, x23, x1, x2, x3, type=PT_DEV_L3
> -#endif
> -        /* Map fixmap into boot_second */
> -        ldr   x0, =FIXMAP_ADDR(0)
> -        create_table_entry boot_second, xen_fixmap, x0, 2, x1, x2, x3
> -        /* Ensure any page table updates made above have occurred. */
> -        dsb   nshst
> -
> -        ret
> -ENDPROC(setup_fixmap)
> -
>   /*
>    * Setup the initial stack and jump to the C world
>    *
> @@ -861,51 +441,6 @@ fail:   PRINT("- Boot failed -\r\n")
>           b     1b
>   ENDPROC(fail)
>
> -/*
> - * Switch TTBR
> - *
> - * x0    ttbr
> - */
> -ENTRY(switch_ttbr_id)
> -        /* 1) Ensure any previous read/write have completed */
> -        dsb    ish
> -        isb
> -
> -        /* 2) Turn off MMU */
> -        mrs    x1, SCTLR_EL2
> -        bic    x1, x1, #SCTLR_Axx_ELx_M
> -        msr    SCTLR_EL2, x1
> -        isb
> -
> -        /*
> -         * 3) Flush the TLBs.
> -         * See asm/arm64/flushtlb.h for the explanation of the sequence.
> -         */
> -        dsb   nshst
> -        tlbi  alle2
> -        dsb   nsh
> -        isb
> -
> -        /* 4) Update the TTBR */
> -        msr   TTBR0_EL2, x0
> -        isb
> -
> -        /*
> -         * 5) Flush I-cache
> -         * This should not be necessary but it is kept for safety.
> -         */
> -        ic     iallu
> -        isb
> -
> -        /* 6) Turn on the MMU */
> -        mrs   x1, SCTLR_EL2
> -        orr   x1, x1, #SCTLR_Axx_ELx_M  /* Enable MMU */
> -        msr   SCTLR_EL2, x1
> -        isb
> -
> -        ret
> -ENDPROC(switch_ttbr_id)
> -
>   #ifdef CONFIG_EARLY_PRINTK
>   /*
>    * Initialize the UART. Should only be called on the boot CPU.
> diff --git a/xen/arch/arm/arm64/mmu/head.S b/xen/arch/arm/arm64/mmu/head.S
> new file mode 100644
> index 0000000000..2b209fc3ce
> --- /dev/null
> +++ b/xen/arch/arm/arm64/mmu/head.S
> @@ -0,0 +1,453 @@
> +/*
> + * xen/arch/arm/mmu/head.S
> + *
> + * Start-of-day code for an ARMv8.
> + *
> + * Ian Campbell <ian.campbell@citrix.com>
> + * Copyright (c) 2012 Citrix Systems.
> + *
> + * Based on ARMv7-A head.S by
> + * Tim Deegan <tim@xen.org>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <asm/page.h>
> +#include <asm/early_printk.h>
> +
> +#define PT_PT     0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
> +#define PT_MEM    0xf7d /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=0 P=1 */
> +#define PT_MEM_L3 0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
> +#define PT_DEV    0xe71 /* nG=1 AF=1 SH=10 AP=01 NS=1 ATTR=100 T=0 P=1 */
> +#define PT_DEV_L3 0xe73 /* nG=1 AF=1 SH=10 AP=01 NS=1 ATTR=100 T=1 P=1 */
> +
> +/* Convenience defines to get slot used by Xen mapping. */
> +#define XEN_ZEROETH_SLOT    zeroeth_table_offset(XEN_VIRT_START)
> +#define XEN_FIRST_SLOT      first_table_offset(XEN_VIRT_START)
> +#define XEN_SECOND_SLOT     second_table_offset(XEN_VIRT_START)
> +
> +/*
> + * Macro to find the slot number at a given page-table level
> + *
> + * slot:     slot computed
> + * virt:     virtual address
> + * lvl:      page-table level
> + */
> +.macro get_table_slot, slot, virt, lvl
> +        ubfx  \slot, \virt, #XEN_PT_LEVEL_SHIFT(\lvl), #XEN_PT_LPAE_SHIFT
> +.endm
> +
> +/*
> + * Macro to create a page table entry in \ptbl to \tbl
> + *
> + * ptbl:    table symbol where the entry will be created
> + * tbl:     table symbol to point to
> + * virt:    virtual address
> + * lvl:     page-table level
> + * tmp1:    scratch register
> + * tmp2:    scratch register
> + * tmp3:    scratch register
> + *
> + * Preserves \virt
> + * Clobbers \tmp1, \tmp2, \tmp3
> + *
> + * Also use x20 for the phys offset.
> + *
> + * Note that all parameters using registers should be distinct.
> + */
> +.macro create_table_entry, ptbl, tbl, virt, lvl, tmp1, tmp2, tmp3
> +        get_table_slot \tmp1, \virt, \lvl   /* \tmp1 := slot in \tlb */
> +
> +        load_paddr \tmp2, \tbl
> +        mov   \tmp3, #PT_PT                 /* \tmp3 := right for linear PT */
> +        orr   \tmp3, \tmp3, \tmp2           /*          + \tlb paddr */
> +
> +        adr_l \tmp2, \ptbl
> +
> +        str   \tmp3, [\tmp2, \tmp1, lsl #3]
> +.endm
> +
> +/*
> + * Macro to create a mapping entry in \tbl to \phys. Only mapping in 3rd
> + * level table (i.e page granularity) is supported.
> + *
> + * ptbl:    table symbol where the entry will be created
> + * virt:    virtual address
> + * phys:    physical address (should be page aligned)
> + * tmp1:    scratch register
> + * tmp2:    scratch register
> + * tmp3:    scratch register
> + * type:    mapping type. If not specified it will be normal memory (PT_MEM_L3)
> + *
> + * Preserves \virt, \phys
> + * Clobbers \tmp1, \tmp2, \tmp3
> + *
> + * Note that all parameters using registers should be distinct.
> + */
> +.macro create_mapping_entry, ptbl, virt, phys, tmp1, tmp2, tmp3, type=PT_MEM_L3
> +        and   \tmp3, \phys, #THIRD_MASK     /* \tmp3 := PAGE_ALIGNED(phys) */
> +
> +        get_table_slot \tmp1, \virt, 3      /* \tmp1 := slot in \tlb */
> +
> +        mov   \tmp2, #\type                 /* \tmp2 := right for section PT */
> +        orr   \tmp2, \tmp2, \tmp3           /*          + PAGE_ALIGNED(phys) */
> +
> +        adr_l \tmp3, \ptbl
> +
> +        str   \tmp2, [\tmp3, \tmp1, lsl #3]
> +.endm
> +
> +.section .text.idmap, "ax", %progbits
> +
> +/*
> + * Rebuild the boot pagetable's first-level entries. The structure
> + * is described in mm.c.
> + *
> + * After the CPU enables paging it will add the fixmap mapping
> + * to these page tables, however this may clash with the 1:1
> + * mapping. So each CPU must rebuild the page tables here with
> + * the 1:1 in place.
> + *
> + * Inputs:
> + *   x19: paddr(start)
> + *   x20: phys offset
> + *
> + * Clobbers x0 - x4
> + */
> +create_page_tables:
> +        /* Prepare the page-tables for mapping Xen */
> +        ldr   x0, =XEN_VIRT_START
> +        create_table_entry boot_pgtable, boot_first, x0, 0, x1, x2, x3
> +        create_table_entry boot_first, boot_second, x0, 1, x1, x2, x3
> +        create_table_entry boot_second, boot_third, x0, 2, x1, x2, x3
> +
> +        /* Map Xen */
> +        adr_l x4, boot_third
> +
> +        lsr   x2, x19, #THIRD_SHIFT  /* Base address for 4K mapping */
> +        lsl   x2, x2, #THIRD_SHIFT
> +        mov   x3, #PT_MEM_L3         /* x2 := Section map */
> +        orr   x2, x2, x3
> +
> +        /* ... map of vaddr(start) in boot_third */
> +        mov   x1, xzr
> +1:      str   x2, [x4, x1]           /* Map vaddr(start) */
> +        add   x2, x2, #PAGE_SIZE     /* Next page */
> +        add   x1, x1, #8             /* Next slot */
> +        cmp   x1, #(XEN_PT_LPAE_ENTRIES<<3) /* 512 entries per page */
> +        b.lt  1b
> +
> +        /*
> +         * If Xen is loaded at exactly XEN_VIRT_START then we don't
> +         * need an additional 1:1 mapping, the virtual mapping will
> +         * suffice.
> +         */
> +        ldr   x0, =XEN_VIRT_START
> +        cmp   x19, x0
> +        bne   1f
> +        ret
> +1:
> +        /*
> +         * Setup the 1:1 mapping so we can turn the MMU on. Note that
> +         * only the first page of Xen will be part of the 1:1 mapping.
> +         */
> +
> +        /*
> +         * Find the zeroeth slot used. If the slot is not
> +         * XEN_ZEROETH_SLOT, then the 1:1 mapping will use its own set of
> +         * page-tables from the first level.
> +         */
> +        get_table_slot x0, x19, 0       /* x0 := zeroeth slot */
> +        cmp   x0, #XEN_ZEROETH_SLOT
> +        beq   1f
> +        create_table_entry boot_pgtable, boot_first_id, x19, 0, x0, x1, x2
> +        b     link_from_first_id
> +
> +1:
> +        /*
> +         * Find the first slot used. If the slot is not XEN_FIRST_SLOT,
> +         * then the 1:1 mapping will use its own set of page-tables from
> +         * the second level.
> +         */
> +        get_table_slot x0, x19, 1      /* x0 := first slot */
> +        cmp   x0, #XEN_FIRST_SLOT
> +        beq   1f
> +        create_table_entry boot_first, boot_second_id, x19, 1, x0, x1, x2
> +        b     link_from_second_id
> +
> +1:
> +        /*
> +         * Find the second slot used. If the slot is XEN_SECOND_SLOT, then the
> +         * 1:1 mapping will use its own set of page-tables from the
> +         * third level. For slot XEN_SECOND_SLOT, Xen is not yet able to handle
> +         * it.
> +         */
> +        get_table_slot x0, x19, 2     /* x0 := second slot */
> +        cmp   x0, #XEN_SECOND_SLOT
> +        beq   virtphys_clash
> +        create_table_entry boot_second, boot_third_id, x19, 2, x0, x1, x2
> +        b     link_from_third_id
> +
> +link_from_first_id:
> +        create_table_entry boot_first_id, boot_second_id, x19, 1, x0, x1, x2
> +link_from_second_id:
> +        create_table_entry boot_second_id, boot_third_id, x19, 2, x0, x1, x2
> +link_from_third_id:
> +        create_mapping_entry boot_third_id, x19, x19, x0, x1, x2
> +        ret
> +
> +virtphys_clash:
> +        /* Identity map clashes with boot_third, which we cannot handle yet */
> +        PRINT("- Unable to build boot page tables - virt and phys addresses clash. -\r\n")
> +        b     fail
> +ENDPROC(create_page_tables)
> +
> +/*
> + * Turn on the Data Cache and the MMU. The function will return on the 1:1
> + * mapping. In other word, the caller is responsible to switch to the runtime
> + * mapping.
> + *
> + * Inputs:
> + *   x0 : Physical address of the page tables.
> + *
> + * Clobbers x0 - x4
> + */
> +enable_mmu:
> +        mov   x4, x0
> +        PRINT("- Turning on paging -\r\n")
> +
> +        /*
> +         * The state of the TLBs is unknown before turning on the MMU.
> +         * Flush them to avoid stale one.
> +         */
> +        tlbi  alle2                  /* Flush hypervisor TLBs */
> +        dsb   nsh
> +
> +        /* Write Xen's PT's paddr into TTBR0_EL2 */
> +        msr   TTBR0_EL2, x4
> +        isb
> +
> +        mrs   x0, SCTLR_EL2
> +        orr   x0, x0, #SCTLR_Axx_ELx_M  /* Enable MMU */
> +        orr   x0, x0, #SCTLR_Axx_ELx_C  /* Enable D-cache */
> +        dsb   sy                     /* Flush PTE writes and finish reads */
> +        msr   SCTLR_EL2, x0          /* now paging is enabled */
> +        isb                          /* Now, flush the icache */
> +        ret
> +ENDPROC(enable_mmu)
> +
> +/*
> + * Turn on the Data Cache and the MMU. The function will return
> + * to the virtual address provided in LR (e.g. the runtime mapping).
> + *
> + * Inputs:
> + *   lr : Virtual address to return to.
> + *
> + * Clobbers x0 - x5
> + */
> +ENTRY(enable_runtime_mm)
> +        /* save return address */
> +        mov   x5, lr
> +
> +        load_paddr x0, init_ttbr
> +        ldr   x0, [x0]
A newline here as was present in the original code.
> +        bl    enable_mmu
> +        mov   lr, x5
> +
> +        /* return to secondary_switched */
> +        ret
> +ENDPROC(enable_runtime_mm)
> +
> +/*
> + * Turn on the Data Cache and the MMU. The function will return
> + * to the virtual address provided in LR (e.g. the runtime mapping).
> + *
> + * Inputs:
> + *   lr : Virtual address to return to.
> + *
> + * Clobbers x0 - x5
> + */
> +ENTRY(enable_boot_mm)
> +        /* save return address */
> +        mov   x5, lr
> +
> +        bl    create_page_tables
> +        load_paddr x0, boot_pgtable
A newline here as was present in the original code.
> +        bl    enable_mmu
> +        mov   lr, x5
> +
> +        /*
> +         * The MMU is turned on and we are in the 1:1 mapping. Switch
> +         * to the runtime mapping.
> +         */
> +        ldr   x0, =1f
> +        br    x0
> +1:
> +        /*
> +         * The 1:1 map may clash with other parts of the Xen virtual memory
> +         * layout. As it is not used anymore, remove it completely to
> +         * avoid having to worry about replacing existing mapping
> +         * afterwards. Function will return to primary_switched.
> +         */
> +        b     remove_identity_mapping
> +
> +        /*
> +         * Here might not be reached, as "ret" in remove_identity_mapping
> +         * will use the return address in LR in advance. But keep ret here
> +         * might be more safe if "ret" in remove_identity_mapping is removed
> +         * in future.
> +         */
> +        ret
> +ENDPROC(enable_boot_mm)
> +
> +/*
> + * Remove the 1:1 map from the page-tables. It is not easy to keep track
> + * where the 1:1 map was mapped, so we will look for the top-level entry
> + * exclusive to the 1:1 map and remove it.
> + *
> + * Inputs:
> + *   x19: paddr(start)
> + *
> + * Clobbers x0 - x1
> + */
> +remove_identity_mapping:
> +        /*
> +         * Find the zeroeth slot used. Remove the entry from zeroeth
> +         * table if the slot is not XEN_ZEROETH_SLOT.
> +         */
> +        get_table_slot x1, x19, 0       /* x1 := zeroeth slot */
> +        cmp   x1, #XEN_ZEROETH_SLOT
> +        beq   1f
> +        /* It is not in slot XEN_ZEROETH_SLOT, remove the entry. */
> +        ldr   x0, =boot_pgtable         /* x0 := root table */
> +        str   xzr, [x0, x1, lsl #3]
> +        b     identity_mapping_removed
> +
> +1:
> +        /*
> +         * Find the first slot used. Remove the entry for the first
> +         * table if the slot is not XEN_FIRST_SLOT.
> +         */
> +        get_table_slot x1, x19, 1       /* x1 := first slot */
> +        cmp   x1, #XEN_FIRST_SLOT
> +        beq   1f
> +        /* It is not in slot XEN_FIRST_SLOT, remove the entry. */
> +        ldr   x0, =boot_first           /* x0 := first table */
> +        str   xzr, [x0, x1, lsl #3]
> +        b     identity_mapping_removed
> +
> +1:
> +        /*
> +         * Find the second slot used. Remove the entry for the first
> +         * table if the slot is not XEN_SECOND_SLOT.
> +         */
> +        get_table_slot x1, x19, 2       /* x1 := second slot */
> +        cmp   x1, #XEN_SECOND_SLOT
> +        beq   identity_mapping_removed
> +        /* It is not in slot 1, remove the entry */
> +        ldr   x0, =boot_second          /* x0 := second table */
> +        str   xzr, [x0, x1, lsl #3]
> +
> +identity_mapping_removed:
> +        /* See asm/arm64/flushtlb.h for the explanation of the sequence. */
> +        dsb   nshst
> +        tlbi  alle2
> +        dsb   nsh
> +        isb
> +
> +        ret
> +ENDPROC(remove_identity_mapping)
> +
> +/*
> + * Map the UART in the fixmap (when earlyprintk is used) and hook the
> + * fixmap table in the page tables.
> + *
> + * The fixmap cannot be mapped in create_page_tables because it may
> + * clash with the 1:1 mapping.
> + *
> + * Inputs:
> + *   x20: Physical offset
> + *   x23: Early UART base physical address
> + *
> + * Clobbers x0 - x3
> + */
> +ENTRY(setup_fixmap)
> +#ifdef CONFIG_EARLY_PRINTK
> +        /* Add UART to the fixmap table */
> +        ldr   x0, =EARLY_UART_VIRTUAL_ADDRESS
> +        create_mapping_entry xen_fixmap, x0, x23, x1, x2, x3, type=PT_DEV_L3
> +#endif
> +        /* Map fixmap into boot_second */
> +        ldr   x0, =FIXMAP_ADDR(0)
> +        create_table_entry boot_second, xen_fixmap, x0, 2, x1, x2, x3
> +        /* Ensure any page table updates made above have occurred. */
> +        dsb   nshst
> +
> +        ret
> +ENDPROC(setup_fixmap)
> +
Why do we need the below snippet ? It wasn't a part of the original code.
> +/* Fail-stop */
> +fail:   PRINT("- Boot failed -\r\n")
> +1:      wfe
> +        b     1b
> +ENDPROC(fail)
> +
> +/*
> + * Switch TTBR
> + *
> + * x0    ttbr
> + */
> +ENTRY(switch_ttbr_id)
> +        /* 1) Ensure any previous read/write have completed */
> +        dsb    ish
> +        isb
> +
> +        /* 2) Turn off MMU */
> +        mrs    x1, SCTLR_EL2
> +        bic    x1, x1, #SCTLR_Axx_ELx_M
> +        msr    SCTLR_EL2, x1
> +        isb
> +
> +        /*
> +         * 3) Flush the TLBs.
> +         * See asm/arm64/flushtlb.h for the explanation of the sequence.
> +         */
> +        dsb   nshst
> +        tlbi  alle2
> +        dsb   nsh
> +        isb
> +
> +        /* 4) Update the TTBR */
> +        msr   TTBR0_EL2, x0
> +        isb
> +
> +        /*
> +         * 5) Flush I-cache
> +         * This should not be necessary but it is kept for safety.
> +         */
> +        ic     iallu
> +        isb
> +
> +        /* 6) Turn on the MMU */
> +        mrs   x1, SCTLR_EL2
> +        orr   x1, x1, #SCTLR_Axx_ELx_M  /* Enable MMU */
> +        msr   SCTLR_EL2, x1
> +        isb
> +
> +        ret
> +ENDPROC(switch_ttbr_id)
> +
> +/*
> + * Local variables:
> + * mode: ASM
> + * indent-tabs-mode: nil
> + * End:
> + */
> diff --git a/xen/arch/arm/include/asm/arm64/macros.h b/xen/arch/arm/include/asm/arm64/macros.h
> index 140e223b4c..2116e48b7c 100644
> --- a/xen/arch/arm/include/asm/arm64/macros.h
> +++ b/xen/arch/arm/include/asm/arm64/macros.h
> @@ -32,6 +32,57 @@
>           hint    #22
>       .endm
>
> +#ifdef CONFIG_EARLY_PRINTK
> +/*
> + * Macro to print a string to the UART, if there is one.
> + *
> + * Clobbers x0 - x3
> + */
> +#define PRINT(_s)          \
> +        mov   x3, lr ;     \
> +        adr   x0, 98f ;    \
> +        bl    asm_puts ;   \
> +        mov   lr, x3 ;     \
> +        RODATA_STR(98, _s)
> +
> +/*
> + * Macro to print the value of register \xb
> + *
> + * Clobbers x0 - x4
> + */
> +.macro print_reg xb
> +        mov   x0, \xb
> +        mov   x4, lr
> +        bl    putn
> +        mov   lr, x4
> +.endm
> +
> +#else /* CONFIG_EARLY_PRINTK */
> +#define PRINT(s)
> +
> +.macro print_reg xb
> +.endm
> +
> +#endif /* !CONFIG_EARLY_PRINTK */
> +
> +/*
> + * Pseudo-op for PC relative adr <reg>, <symbol> where <symbol> is
> + * within the range +/- 4GB of the PC.
> + *
> + * @dst: destination register (64 bit wide)
> + * @sym: name of the symbol
> + */
> +.macro  adr_l, dst, sym
> +        adrp \dst, \sym
> +        add  \dst, \dst, :lo12:\sym
> +.endm
> +
> +/* Load the physical address of a symbol into xb */
> +.macro load_paddr xb, sym
> +        ldr \xb, =\sym
> +        add \xb, \xb, x20
> +.endm
> +
>   /*
>    * Register aliases.
>    */
> --
> 2.25.1
>
>
- Ayan


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 12:02:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 12:02:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558295.872243 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGejc-0001Iw-Fm; Tue, 04 Jul 2023 12:02:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558295.872243; Tue, 04 Jul 2023 12:02:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGejc-0001Ip-DE; Tue, 04 Jul 2023 12:02:20 +0000
Received: by outflank-mailman (input) for mailman id 558295;
 Tue, 04 Jul 2023 12:02:19 +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
 <SRS0=Gy6C=CW=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qGejb-0001Ij-Iy
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 12:02:19 +0000
Received: from NAM02-SN1-obe.outbound.protection.outlook.com
 (mail-sn1nam02on20625.outbound.protection.outlook.com
 [2a01:111:f400:7ea9::625])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9e5d9f8f-1a62-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 14:02:17 +0200 (CEST)
Received: from SN6PR12MB2621.namprd12.prod.outlook.com (2603:10b6:805:73::15)
 by CH0PR12MB5387.namprd12.prod.outlook.com (2603:10b6:610:d6::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 12:02:13 +0000
Received: from SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54]) by SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54%2]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 12:02:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9e5d9f8f-1a62-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=cGapxe+CO/Kfftf7VWxL3CdTSEndXG9G5UA1KYinWRzecHX4AjKumsVXKflgMFyc6ftRGl80Uivz6H4LeEtDbWasICcINPD3Y2iFNeDyCLmf3gG7xqFtxNfG35budMUdiWADaxJ2QkJ1J5spclPcm9P+xeeXtFn5fA+VevDM4EPmsC2EKksjiRzcgakv/R7s+d8rcqjGIuSilZAKhtBP3VjiUshMr1KEIaeoOrLG9JGJGQhnbjBXh5iZiu6ZZGyq9nY8otjIcE8ZNWU0DcbXqi+mPL7mLLYOTyTY3JXVKsVyM/vhtKO6OmBgVXANRa0CNaMELAJuWhFtEP3L4kB/2w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Jt+agSvOonh8mMnbln3QX+xOm8kA9R3IxbLKvceeA7M=;
 b=jAkGT+Trfgjn9OLbDk/5/tze/3YjILYDi8GU2WB/ExvlJCBINeAA7xgZUrFfyvR3nvGmgXPKJRq4D14gvZWdSoQok/57Jb1e04FdBzLG9inrR3jndavyWTal4OO89Pn4cl4TGtrumdtn5+KI3J+uaEUixe6iLgiY1qcVaZogNOBcA0obTUZ7cGzG4UEucASquYKZ8VhFoT5Y+9aISp1yH5YZicCIaqmWE7647zfMOTMLXbdP6EDay20vZ3jAxtnECNt8U4mzV5HDFX6o4LZMSpaxbOD39wUqZcur7gC4A+7a1d6xFKXtl8afII+SwwVEGQ0uem3i9LmR4Y9OAB7Aww==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Jt+agSvOonh8mMnbln3QX+xOm8kA9R3IxbLKvceeA7M=;
 b=k7BQp/Da4GGXcq5/3KlQsG3AU2uV3FPY/JScOVXkYhrTZpNfOpwYtQ/9JgqTynncnphYA1AWL8mOluFZt4ZPVpXE4MVxD1A/VDGlgEUbK7qYTDfYSB8Su9r5FUb8zvwEMtP4rYCLZjp39MkI0v+Hd593De+0u9jI4/arZkQVhuE=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <682fdfab-b755-e580-7688-3dc0c0e3779e@amd.com>
Date: Tue, 4 Jul 2023 13:02:08 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 03/52] xen/arm: add an option to define Xen start
 address for Armv8-R
To: Julien Grall <julien@xen.org>, Penny Zheng <Penny.Zheng@arm.com>,
 xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-4-Penny.Zheng@arm.com>
 <cb7e3d34-bbb8-e5df-f87b-0fcac4b65378@amd.com>
 <77c64929-514a-ea67-cf8b-176c895ff971@xen.org>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <77c64929-514a-ea67-cf8b-176c895ff971@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P265CA0485.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:13a::10) To SN6PR12MB2621.namprd12.prod.outlook.com
 (2603:10b6:805:73::15)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN6PR12MB2621:EE_|CH0PR12MB5387:EE_
X-MS-Office365-Filtering-Correlation-Id: 4ca65eec-d225-4998-0420-08db7c8680bf
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Ms4YYq8DdLb63WUx7brLgGWpQ224KPpmz7XyWADpAO0B+Q7VRkmcB8eHUI+hTaUiCVS4eVm019NAigPZwhyBjQXAAstdFMD9LDnrV8YFBWDjmCoAQWlf3GjXzfkVS7vIBkiqvP9endfdJz9bUuKxr9DsQAyGRGW1t0JadSht9Eg/OJT3wV3VlS5BCA09oBPj+X0i+Z1YQiDl98KARX1u1xUAdsgEFtCStRBprSxarQGa2DEAJeXyRGH3q4Q4jEWgAcUNEvLTrPcWw2kTksgPEwsRPvOpuZqALYd0oEU3QXXYCN15w64gxaRj5UKY6bmsB9gFn+KGy3Rge0kY7iT5m8kDu1Y8+5Cu1AYG4W1PIzfly0ZivzMIrw2R0bXCkHY46Tmi3pm/LL6JH3LY36HsT0a/uWv+byFu6ssYBvYrIQvyhddJGeAKHT8I0DyO+HqfGQsImT/zjpCwTHd2RLHXKFEvXemUzjlLHfixjysrLwrhX3lt7t/SievoCkndDLb76pVt1i+l2TDWdpiPGH97ITuI6RRlqRixo76yysFC3xFzSY1Sh9eXtfZokxmMT4G4JBftpRNynLKQpP4ST3yQQ0vM+14jXBTmosbsJdoa+Vu4kgyGD2uO/IYUx5iwe2a+xqV1cap/9ocm72M4K3jOWnVOPu9pRG5Bujm1UsmFmN4sdkLBH6XVCv90LeK8Q10R
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2621.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(136003)(346002)(376002)(39860400002)(396003)(451199021)(6506007)(6512007)(53546011)(66476007)(316002)(66556008)(38100700002)(66946007)(4326008)(2616005)(83380400001)(186003)(26005)(478600001)(54906003)(110136005)(2906002)(31686004)(8676002)(8936002)(36756003)(31696002)(5660300002)(6486002)(966005)(41300700001)(6666004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VWJxMTZLU2RXMmRoWHFBY3dGOGZTdjlMV2E1cDVadDlSWWN4MXQ4MHJsL0ZY?=
 =?utf-8?B?d1FGZTZrQ3VHd3ZwcG41QVBPNVRJWWdDamVjUjkxL2lhTWJqU3ozWG55bVVK?=
 =?utf-8?B?eU9mTHVjVFNwV3ZPdlVqN2JlNGc0UEJXZFVHRTZLbXJXVU9FQ2g1czJkTHo5?=
 =?utf-8?B?WnNuRnhXK2h5SkJLbmZQV1U3MzJDcExnWWdDeDdFWUREdElGN2w5MG1XNGcv?=
 =?utf-8?B?T20rY0ZOaFNueWYvbWkxZmR5c0hxaDNDdDJZZUZPYldaWnF3VldTRjRQLy9u?=
 =?utf-8?B?WUcwNTJRbFFCRkNEYXFmNHRud2xtNFZsL2FOajU0R2wycEtZcHc2R2w1bkxH?=
 =?utf-8?B?c3o5NDlSYXN4ZnYrT2cyYUhBWk1LcllCbk8wakdRZEdJeEhxVTZVQlRNUjhs?=
 =?utf-8?B?Z0pa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-Exchange-CrossTenant-Network-Message-Id: 4ca65eec-d225-4998-0420-08db7c8680bf
X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2621.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 12:02:13.2517
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: en5PWDRw2Jp1xouxjhetM12t511DZkSj5ZH+dZd+zMBHn4vCeqI3wa8Nq92MmY5KZ7wSaLUN14UaSVfQoat3bQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5387


On 04/07/2023 12:47, Julien Grall wrote:
>
>
> On 04/07/2023 11:36, Ayan Kumar Halder wrote:
>> Hi Penny,
>
> Hi Ayan,
Hi Julien,
>
>> On 26/06/2023 04:33, Penny Zheng wrote:
>>> CAUTION: This message has originated from an External Source. Please 
>>> use proper judgment and caution when opening attachments, clicking 
>>> links, or responding to this email.
>>>
>>>
>>> From: Wei Chen <wei.chen@arm.com>
>>>
>>> On Armv8-A, Xen has a fixed virtual start address (link address
>>> too) for all Armv8-A platforms. In an MMU based system, Xen can
>>> map its loaded address to this virtual start address. So, on
>>> Armv8-A platforms, the Xen start address does not need to be
>>> configurable. But on Armv8-R platforms, there is no MMU to map
>>> loaded address to a fixed virtual address and different platforms
>>> will have very different address space layout. So Xen cannot use
>>> a fixed physical address on MPU based system and need to have it
>>> configurable.
>>>
>>> In this patch we introduce one Kconfig option for users to define
>>> the default Xen start address for Armv8-R. Users can enter the
>>> address in config time, or select the tailored platform config
>>> file from arch/arm/configs.
>>>
>>> And as we introduced Armv8-R to Xen, that means the existed Arm64
>>> MMU based platforms should not be listed in Armv8-R platform
>>> list, so we add !HAS_MPU dependency for these platforms.
>>>
>>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>>> ---
>>> v1 -> v2:
>>> 1. Remove the platform header fvp_baser.h.
>>> 2. Remove the default start address for fvp_baser64.
>>> 3. Remove the description of default address from commit log.
>>> 4. Change HAS_MPU to ARM_V8R for Xen start address dependency.
>>> Â Â Â  No matter Arm-v8r board has MPU or not, it always need to
>>> Â Â Â  specify the start address.
>>> ---
>>> v3:
>>> 1. Remove unrelated change of "CONFIG_FVP_BASER"
>>> 2. Change ARM_V8R to HAS_MPU for Xen start address dependency
>>> ---
>>> Â  xen/arch/arm/KconfigÂ Â Â Â Â Â Â Â Â Â  | 8 ++++++++
>>> Â  xen/arch/arm/platforms/Kconfig | 8 +++++---
>>> Â  2 files changed, 13 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>> index 70fdc2ba63..ff17345cdb 100644
>>> --- a/xen/arch/arm/Kconfig
>>> +++ b/xen/arch/arm/Kconfig
>>> @@ -181,6 +181,14 @@ config TEE
>>> Â Â Â Â Â Â Â Â Â Â  This option enables generic TEE mediators support. It 
>>> allows guests
>>> Â Â Â Â Â Â Â Â Â Â  to access real TEE via one of TEE mediators implemented 
>>> in XEN.
>>>
>>> +config XEN_START_ADDRESS
>>> +Â Â Â Â Â Â  hex "Xen start address: keep default to use platform defined 
>>> address"
>>> +Â Â Â Â Â Â  default 0
>>> +Â Â Â Â Â Â  depends on HAS_MPU
>>> +Â Â Â Â Â Â  help
>>> +Â Â Â Â Â Â Â Â  This option allows to set the customized address at which 
>>> Xen will be
>>> +Â Â Â Â Â Â Â Â  linked on MPU systems. This address must be aligned to a 
>>> page size.
>>> +
>>> Â  source "arch/arm/tee/Kconfig"
>>>
>>> Â  config STATIC_SHM
>>> diff --git a/xen/arch/arm/platforms/Kconfig 
>>> b/xen/arch/arm/platforms/Kconfig
>>> index c93a6b2756..75af48b5f9 100644
>>> --- a/xen/arch/arm/platforms/Kconfig
>>> +++ b/xen/arch/arm/platforms/Kconfig
>>> @@ -1,6 +1,7 @@
>>> Â  choice
>>> Â Â Â Â Â Â Â Â  prompt "Platform Support"
>>> Â Â Â Â Â Â Â Â  default ALL_PLAT
>>> +Â Â Â Â Â Â  default NO_PLAT if HAS_MPU
>>
>> I am a bit concerned about this as we will be introducing R52 
>> specific platform in xen/arch/arm/platforms/
>>
>> (For eg 
>> https://github.com/Xilinx/xen/blob/xlnx_rebase_4.17/xen/arch/arm_mpu/platforms/amd-versal-net.c 
>> )
>>
>> Thus, we will have to remove this line at that time.
>>
>> Can you remove this line, please if it does not cause any issue ?
>
> From my understanding of the discussion at Xen Summit, most of the 
> platform specific code would be moved to something similar to 
> bootwrapper.

Yes, but I think bootwrappers are now deprecated.

At least 
git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/boot-wrapper-aarch64.git 
does not seem to be active and 
https://github.com/artagnon/boot-wrapper-aarch64 looks archived.

>
> So do you still actually need to have code in Xen for setting up the 
> timer?

I think we can ignore it for now.

Just for information, we are using the platform specific code to achieve 
the following :-

1. Set up the timer and CNTFRQ

2. Set up the secondary boot address and start the secondary cores.

- Ayan

>
> Cheers,
>


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 12:04:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 12:04:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558299.872254 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGelh-0001qb-T9; Tue, 04 Jul 2023 12:04:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558299.872254; Tue, 04 Jul 2023 12:04:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGelh-0001qU-Q3; Tue, 04 Jul 2023 12:04:29 +0000
Received: by outflank-mailman (input) for mailman id 558299;
 Tue, 04 Jul 2023 12:04:28 +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
 <SRS0=Gy6C=CW=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qGelg-0001qO-JB
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 12:04:28 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on2062c.outbound.protection.outlook.com
 [2a01:111:f400:7e89::62c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id eb30bd84-1a62-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 14:04:26 +0200 (CEST)
Received: from SN6PR12MB2621.namprd12.prod.outlook.com (2603:10b6:805:73::15)
 by CH3PR12MB7761.namprd12.prod.outlook.com (2603:10b6:610:14e::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Tue, 4 Jul
 2023 12:04:20 +0000
Received: from SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54]) by SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54%2]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 12:04:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eb30bd84-1a62-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=MHLeh5oAMew7CpQ+EQv8SScb8/ODd/SerzYGlfz4TLcwfM/St1QY/jDTzb6ICZcsdwl6epRTBS5EDBSbMz/7i89TtS3FZWitoKF8fUvwSk1aH8f9z1T4Dtyb2dqqvT/yizjjknKuwgkvtLlpX4oaAfhpWUU9jFJhnE3zoX57lnfsh/rvkky1O0ZODt620AEC2/jloyEIKxZcggSYwjskMwHJRRgB+h168Ipa54nliY3glq+HT6ZKcPrj2YVqCnzUXm2fGOWIM4XYp1xRs8vmZ/B9p6f1SbASBMKeR3t98qYWDQU6S982Z2btOKEu7r30oYfSyq8E6nzOu4s7F4YG6w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=F29/bsQLsktz/PeCjS6khkJbLs7Y9CkTHYNCa6igSYY=;
 b=LuQ+ShI4imysBEH/4Bh7L6jphb4+QGufQNbdVBo8f5WHr302GeuFmwdumH2/ISZhmZLMUZauR4vxwzB6B1kt8NyaRMFzPUIH098y4vGdypgxlRAxAJUnDBRHJiVDKroO/I8NiK76wC9jC5BTQq4QOJ61GZw5yTNa5Jjx54w7DXmxRfAqaCX8+NWLjz6gD4VH8ah6GiamvChcQjcTnh5DDt514CtNeFWtQidJ4+yqnxRSpY/VaVD09BKyzHJAnQ/x9kHuijjD6j+1CrPXxpV32uIoiU0XTHZ6fEFz5CYCmBgXl1G5GeK7700Fc4A27Yf3XtQmk8n4x6JvkqWvKIxXEg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=F29/bsQLsktz/PeCjS6khkJbLs7Y9CkTHYNCa6igSYY=;
 b=aP/TPTsx7iNBJo7h0rmsRRvm/0BoJl8BOEY96lDVdYfQDgVVWyjiFT/JxFPCkP567gLJlvo/YBhN+aLX3wULW2EyBbD2PWat0bCdJKVzwMYlPEk9mRlpk778MbBzH5ba/rtkAJ2ERidlmzzu/QjkqQDhzcWigJA5/U2JJiYW4rs=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <1cc8eaa4-6fcc-21bb-c590-bffa87e14177@amd.com>
Date: Tue, 4 Jul 2023 13:04:14 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 06/52] xen/arm: introduce CONFIG_HAS_MMU
To: Julien Grall <julien@xen.org>, Penny Zheng <Penny.Zheng@arm.com>,
 xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-7-Penny.Zheng@arm.com>
 <4303bf0e-a987-1ee4-9524-c83756789322@amd.com>
 <1cbf44ae-2500-1428-5dd2-893e846faf1e@xen.org>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <1cbf44ae-2500-1428-5dd2-893e846faf1e@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P265CA0292.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:a5::16) To SN6PR12MB2621.namprd12.prod.outlook.com
 (2603:10b6:805:73::15)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN6PR12MB2621:EE_|CH3PR12MB7761:EE_
X-MS-Office365-Filtering-Correlation-Id: 0f6b0c32-7ad6-4974-a7b7-08db7c86cc5f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	/uU+ApQBoW2DflehSSW6DDjFdCWx1RdmiZFwoHPfAysUsrbY8EyMoPqpADTflAc5u6XUyLCPm7yzC59WHf6T+KdJfQCvEkxYC/b2hMz8jtTSQDYYFkGH5nnYz509sFpBFfII98r/RUgMQRzZTiJg6MZMU2566raxgKLuZHwYM1YBQbsoeupmUbpUF0Oq6RLHkiKIxPFLSulau1Ia+eg5rnOK8l+EJCR77rxBhsOAECq+RAQgdxrv8dtSaXhGQtVZ51/Q/qFmP6Ah+fseeImhHIYqf84dTM9v75jb3Bxm4AIkL59xW+cR5/1CngUahRo55jtj1CaoXOcNGOAsFX4z02aWlj4nRjXdVyut72AUdU5BIXr1qqYOCTgQGaslutwGHC/qi+KzS0wGZyd5oW8K6QqIPhg3LVldtnOsJ/kgCntrZnS97Y5hQSqM0gLxve0xVoUXYUBeMn6PMTtgnsHqLKACzJs5dvWzg0O3OLFIG5aw2/DCcG++pJt5bmCcw5AZoOoW5W7MYl9TxXUWHGj4HFo8xftlIuOP2+FBO5+/ia5XkMtGbbp7dyEFU7Yl41UrwIIZWbddtjnrHhWHkRBV5WSrm6zsVDNme77j3aSbayX9yukVGEhaf0b85lvgG3ng0LQOY2rxY8fLKQijkEbcTQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2621.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(376002)(346002)(136003)(396003)(39860400002)(451199021)(31686004)(2616005)(186003)(38100700002)(6666004)(31696002)(66946007)(6512007)(6486002)(2906002)(36756003)(66556008)(110136005)(66476007)(316002)(4326008)(478600001)(54906003)(26005)(53546011)(6506007)(83380400001)(41300700001)(5660300002)(8676002)(8936002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?b20xMzBtWjFnQWVwZGhpbHkxYlAyZkNwRUpiZGN2ZU95aXdGQURjNzBDQjR2?=
 =?utf-8?B?R3Zyb1RNVjN4ZndGM2FaaDdjMWZzU0RPREwyRVgyUWtma0M5RmlKWU5ZVVYz?=
 =?utf-8?B?NUpCUlM3Q2xiRXF3eGdnZ3hUaGdreXVzVDRVU1FXWGZBSlY1ajBCcUVXTDdh?=
 =?utf-8?B?Y1lISytWMEIrZVkvcDRiTGNyNWVPVldSYmJCV0Z1WVZCN29qSTN5RzM3aXhJ?=
 =?utf-8?B?RkJMYWNYQlF1OUxLUGJDRHNsZW9JZHNUOHg5NXphNXZya1RYY0R1anR0dENh?=
 =?utf-8?B?aGd0MUx4TXZnWjROZWpQV1RLNlA2c1FZODlRK2M4ZXZaTVVQQzFLcHN1dzN3?=
 =?utf-8?B?dldZMU8zZ2VXdGQ1UTdXZlhMYW1WNXJrV1BIMmozYnp4M2dxc1I4eXdJVmto?=
 =?utf-8?B?Z1pRcGlkaHdRUzBueS8wQVoycXpIYkV4MThkVDZhREU1c3NQV2x5RDhjbURv?=
 =?utf-8?B?akFXNFZjaE1ETmpqbDhGTlFzZnF3aEo4RDExMFdMREl2S3RqMFhPa2RnVE90?=
 =?utf-8?B?c3VhUE9uaG1qcEZEVE1UOHg1VG9WYUc4S2RFeE13MWk2cUREZWtwUUZLNXBo?=
 =?utf-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NNYllqOUZlVnA0aWJwMlcyMUNMK2xBNW4zelp4WnJQ?=
 =?utf-8?B?dys0ajRCTjRJdHNnaDBtTTJ6dnBhd2M1c1E1OStGYXhmTTJEaE1YZzdXUnF4?=
 =?utf-8?B?TFQ2ZUpZajhpR3hodGxiL1RPSmZJWXVsbytacVdZSDNXWUF5TDBhYkQ1R3NJ?=
 =?utf-8?B?YkdpTDdCcDVHcEtnRGJwNTZ6Wk1FNDZ2bHA2eTVVUitCZ0tZOUoraXE3Slcr?=
 =?utf-8?B?eXJjdXRuTkpWTUNBZTJwR0FaeE8rWDJlaWJmR2Myclc5Y1dRR21hZVJJcTE0?=
 =?utf-8?B?UTZJNjdRL05YdVUreUQweDRiekR6YkN5dEU5MnlHbjR5c1FHWkFLbWVBenky?=
 =?utf-8?B?NHU1UDQxd0xqUXhTSHE5VktyZUg1V2xFNXNENS8rY01HNXhqKzFxSGE1SGFO?=
 =?utf-8?B?NUovSVBuSnlDR1BKQXZlZUhYbThyWFNpd0UzUDJieU9Ua2xIVWtRNCtnVzhn?=
 =?utf-8?B?d2xPN1JkQWFmMTduNVZxcEd3QWNjek5nMit2amF1d2RPWVVtd0R1QzBDV05h?=
 =?utf-8?B?aWNJSG12bm9RQ3ZlcXZsU0FnSEtLUjlVMkZIc3VGcmY2bFpvbHpVcmg3aG1U?=
 =?utf-8?B?MVMxWWZlcER5S3BSUEtTMnpMOXp6UU4wZFdEa0pBUWQrbVc4dStpV3I0V0dw?=
 =?utf-8?Q?68ImuHx1tKgOKoF3/45pfPP1O?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0f6b0c32-7ad6-4974-a7b7-08db7c86cc5f
X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2621.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 12:04:20.1089
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: /cYd3zJBufoRYSs3ag1c3790TYbfO9SaeEFzxYU5W2Sv7j9D1S8T78OB/AwSjcBsP7myd26ZY3ObZYDW/KcFEQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7761


On 04/07/2023 12:44, Julien Grall wrote:
> Hi,
>
> On 04/07/2023 12:14, Ayan Kumar Halder wrote:
>> On 26/06/2023 04:33, Penny Zheng wrote:
>>> CAUTION: This message has originated from an External Source. Please 
>>> use proper judgment and caution when opening attachments, clicking 
>>> links, or responding to this email.
>>>
>>>
>>> This commit wants to introduce a new Kconfig CONFIG_HAS_MMU to guard
>>> MMU-related codes, to tell two different memory management 
>>> architecture:
>>> VMAS and PMSA.
>>>
>>> In a VMSA system, a Memory Management Unit (MMU) provides fine-grained
>>> control of a memory system through a set of virtual to physical address
>>> mappings and associated memory properties held in memory-mapped tables
>>> known as translation tables.
>>>
>>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>>> ---
>>> v3:
>>> - new patch
>>> ---
>>> Â  xen/arch/arm/Kconfig | 8 ++++++++
>>> Â  1 file changed, 8 insertions(+)
>>>
>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>> index ff17345cdb..fb77392b82 100644
>>> --- a/xen/arch/arm/Kconfig
>>> +++ b/xen/arch/arm/Kconfig
>>> @@ -60,6 +60,14 @@ config PADDR_BITS
>>>
>>> Â  source "arch/Kconfig"
>>>
>>> +config HAS_MMU
>>> +Â Â Â Â Â Â  bool "Memory Management Unit support in a VMSA system"
>>> +Â Â Â Â Â Â  default y
>
> I don't think you can disable HAS_MMU right now. So you want to drop 
> the description to prevent a user to select it. This could then be 
> combined to
>
> "def_bool y".
>
>>> +Â Â Â Â Â Â  help
>>> +Â Â Â Â Â Â Â Â  In a VMSA system, a Memory Management Unit (MMU) provides 
>>> fine-grained control of
>>> +Â Â Â Â Â Â Â Â  a memory system through a set of virtual to physical 
>>> address mappings and associated memory
>>> +Â Â Â Â Â Â Â Â  properties held in memory-mapped tables known as 
>>> translation tables.
>>> +
>>> Â  config ACPI
>>> Â Â Â Â Â Â Â Â  bool "ACPI (Advanced Configuration and Power Interface) 
>>> Support (UNSUPPORTED)" if UNSUPPORTED
>>> Â Â Â Â Â Â Â Â  depends on ARM_64
>>
>> I don't think you need this option.
>
> I think we want to introduce a 'choice' where the user can select 
> either the MPU or MMU. But not both.

+1 (I like this approach).

>
> This would be similar to how we select the Physical address space size.
>
> Cheers,
>


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 12:07:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 12:07:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558303.872264 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGeot-0002Sa-Bi; Tue, 04 Jul 2023 12:07:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558303.872264; Tue, 04 Jul 2023 12:07:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGeot-0002ST-85; Tue, 04 Jul 2023 12:07:47 +0000
Received: by outflank-mailman (input) for mailman id 558303;
 Tue, 04 Jul 2023 12:07:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=D/z2=CW=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGeos-0002SN-6a
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 12:07:46 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0612.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::612])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6165f03a-1a63-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 14:07:43 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB9125.eurprd04.prod.outlook.com (2603:10a6:20b:448::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 12:07:41 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 12:07:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6165f03a-1a63-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ZrrvMp8y5SpqvHziuIW8e9ZrRLRoPHom9s4xk/YBEWs5km3UcyJl2+ATa3wHMDcFTZAITQUN/Puk2Hym1myA47RkbI1qlJeQl5JajTLr1K32LTwIy2lMkIhrnU8X8hHBzmnnTVPRJAWEH1WSLYnF803m29ypzYRkJKHZuxy7iEP609mVXGuFStLUIlOmrYv1gdaDHuvI1tCuySB3vpNAOOlqT8VkJMu0vhZJkXPvUgy2V1oHRPKzbpo/IpfT6dTIZl3kKmv0/wLg2WOPqe7bZPIvKwO9cuj5vU7X4bz48n3z7Lwfcg6GeZe43jpdy0N6LSfCT0uX9WI1OwnAeO9DhA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0qz0Ee1j86xIJGrzBSV/HnDcjBMkJZpToooyiz0wtQo=;
 b=DVngeMZbVrKSyMViuzQnRx9P74YGDgVoD0e4WyFZ+SHHjgXUGaPUwM2CjwdsIxMFmnJ+9OcqJ1qMlexrripPSeWhhIj4RfEf4D0mZ/wEf1mgRJWTtyb5vPqdYDqOY9NqJ4F2SNKhcEg56veqYxL1txGSU06xm9wN3EKY8Wrlgvh6PAyyqiyxfEFO9HZCRSOlR9QygWiNgoxfjtk8LQx6ymf6PDd+ELU1dsumgsoBjR1ybBceJt/RL7LcVIoaCGWDjhCSAd0WrP7nXZmYTGJTuUyyobkh6emU9rM0+TchMZIOmp1GuWpIzqHm57+j/vzOFvlkCrFn6ntToZWsuFE3yg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0qz0Ee1j86xIJGrzBSV/HnDcjBMkJZpToooyiz0wtQo=;
 b=YxbPP+LdQ6/ON3uSNCIdxSwVFbnHjyTo3+bVqgHQlmyqnxDwLYzQIjmIqadeW8DywPvHysSC4lhWGtTII/+6fN/VhjG0FgLwg/Iypka1hooYi/18+jWQJfYYWdE/ttWY90lQVMaIICIyx6htYLdjLyhHt/rqJ0QHH4fISIh82mRgg/wkHAOv6Yx5drlzTH/nLAfld07ngETiAtNkZqEEhBQW6VDj76HgNIJiwFvS1tqEgsGPFEnmO8sDmz9lk7tl2Hghm4Kn9AHeVmmaRTRPfTa9hDvQHGBwRd6ihSysSymga43ca+VQUHynRl7JyGxqWsxnINcizoQeUfLi62zIwQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <c11f1c6a-795d-2245-0571-ea956f7881d2@suse.com>
Date: Tue, 4 Jul 2023 14:07:47 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v3] xen: speed up grant-table reclaim
Content-Language: en-US
To: Demi Marie Obenour <demi@invisiblethingslab.com>
Cc: Xen developer discussion <xen-devel@lists.xenproject.org>,
 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
 stable@vger.kernel.org, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
References: <20230627172216.1359-1-demi@invisiblethingslab.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230627172216.1359-1-demi@invisiblethingslab.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0201.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ad::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB9125:EE_
X-MS-Office365-Filtering-Correlation-Id: 82306e69-13bf-497c-52ee-08db7c874448
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	NJzCE91NMvGnE5tj1xskNk7hGUDCCs9Lj5Mgcts+SYrLABUIs92x9ouBMI+Vcg2y/ePSlzCZPjW+xAloFEbhvj17+51o77JvjlXIwLYLIUGnWgx2RmQHiVzO+S+VvtUCblF0XhhZbbYjN/t/53IRPnAHG9hOPT4Cujv+gMrf83Kes9bPU21en6LAt7oEr1DwWEL/PeWbVv3iMpBL2f9VtpF+JTR4CEHZRCMeqg0N8cSySgl6TBapCyA4qkoevkGG9m4SbR0PUM9LNsZyfb15wbvXxy3i50iXDNfuzBo32YK2qsW2boi+jjBJhybMWAtOmM2akdY2K8ltYnD7foZ/HZM2qalQKz3ykyhW2z8D3wUpbaFnuZ1sqy4qHtXs0rC9NGUq/p3UFPAZIlyqyX0ecn7eBluaYbIuA4twGDfcC2sLH4yyuLU+caCm94q9fu/Z8jxfv+QFRgdwvaZBV+GoAqyrrhKjxcU5YXRTZzf9cK0Pum/JqDKDvA2/tzYe24zB3kItgrA5DjWcXvltEJdPM37vzeDsgGBW1gJ9sLeXisx8Nzl4jXr+sjs7eC1seq37KbhZflPUIvUUk0p9Uy005Fa89xujH0JRWbUnw4LZOTchxBVTgdRlL57ZA1iInKqliRS8qBlm7NmDhJDvKaSwQQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(39860400002)(396003)(376002)(136003)(346002)(451199021)(2906002)(41300700001)(8676002)(5660300002)(8936002)(36756003)(31696002)(86362001)(186003)(2616005)(26005)(478600001)(6512007)(6506007)(31686004)(6486002)(53546011)(316002)(66476007)(6916009)(4326008)(66556008)(66946007)(54906003)(38100700002)(83380400001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NVF3ZTdQcFdmb2JhQWRpRmtSVWx2ejA3aDZCUWZhVjdIeEorZWU1WEs0cEhX?=
 =?utf-8?B?K09seGc1NjNIdFFyL3FjZFZPeEE2dHNac2VJODBWV2dYaEZqeC9DMkk1UDI0?=
 =?utf-8?B?UjJycnE3U0xhOWJyTWVtWkVSdnlON0ZIVHBDWi94YWY1WVU2cFYwUkdjcXp4?=
 =?utf-8?B?SWQ0WGZnSXpzaEZwMlJoVlB1YTVuWmtRS0x5bVZDSnlsbWh4UzFqOVRqVk5N?=
 =?utf-8?B?VHRQWHVZeExoWDNzSkNqd1hkYS8yNnFOR2lkSXRhN1JzYWliVWxrTVpzOWVw?=
 =?utf-8?B?TjZBcFQrWjhYbUNZLzcxUDk2NTRmRERlNER2N3BzOGI5YnFpdFlNTFJCYkZY?=
 =?utf-8?B?KzdLTXVQR0NONzI3RjdzeDNDNkI3Uks0S3ROdVRlWU5saHc1aFNmSDRvbnJv?=
 =?utf-8?B?QjBlRENrVTBCUDBhZW04QlFHT09zSlVkdllSU2tidlpMVzRCN1M5SzhmTEsy?=
 =?utf-8?B?dUo1bk5JVkRqVHJyQnZhSjhlZnRrRW94bHJxYkREOHlXY1EyNW1XQnNDU3Qv?=
 =?utf-8?B?OFFuNHBhYmdCRW9oM2QvZGtJRHErdEVuQVQzeWNqbkNFWkNaZGl0Z1FzeFo1?=
 =?utf-8?B?OUpYdEQrZEhoWjF3VGcrZ2JRWFUwSVlnRXdKRnQrY3F0NGo1NWNIOEcvMlN0?=
 =?utf-8?B?VmpFcGp1dDByM1BXbkpSc1hKVlFHMldtS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FM?=
 =?utf-8?B?bUpCNWV0KzlhdEpSTmoxMURrZlhzdHNDd3dMZkMvRkhUZHRMMmxDenlFSjg5?=
 =?utf-8?B?MmZnZzBrZXordGpwTTlxWEZBSWtmSTI5WG9UYWI4WU5iaklCQS9VUUhKQzVK?=
 =?utf-8?B?YmVKai9QcmVaYlZHZHZEdmJEOUY4aU5iZWlUM0ZpRnZQdlRna2pQZks2MXF2?=
 =?utf-8?B?M0tYcnVqZk1BYm9GRjFIelNhaVdRcFluYnpHUUpXN0lBMWxnUElnTTdYcHdu?=
 =?utf-8?B?dDBlcE1WVHMzTkk5VkZpRm5IWGRKUk5iNnFpei9YU205QUY2NkxHT0lHV0xD?=
 =?utf-8?B?eEE3Y0dqdWdMQUlSMTJQbmdUdllKeklQdldIU0EvbkhCbFpQTzhzUklmRUVC?=
 =?utf-8?B?ckdxeEtJUWorMngwTTIzajNncGVKSExLd3ZZekxRaUpUZGc5ejRIKzFtdFdy?=
 =?utf-8?B?VWE2ZnRlcHRqOUdiYkJFUFAwMHdQOVcwU2VEYVVERkU2b3Q1WmtGMkdCSzJj?=
 =?utf-8?B?V211anlKVUh6VFdERGNOK2x6ZHZkUU1lbTZLUERZakRzY0VMMmZKL2doWGFm?=
 =?utf-8?Q?Y4UDppws+b2EZdIeiDXu2l4ez?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 82306e69-13bf-497c-52ee-08db7c874448
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 12:07:41.2205
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: xJV62KrS4qg4GuebwqjRxegd+w56YZImDg1btei5ax5owMe51Z0IbOm899TNSXfnfl4jHauTs/W9VdIc0x2ebw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9125

On 27.06.2023 19:22, Demi Marie Obenour wrote:
> When a grant entry is still in use by the remote domain, Linux must put
> it on a deferred list.  Normally, this list is very short, because
> the PV network and block protocols expect the backend to unmap the grant
> first.  However, Qubes OS's GUI protocol is subject to the constraints
> of the X Window System, and as such winds up with the frontend unmapping
> the window first.  As a result, the list can grow very large, resulting
> in a massive memory leak and eventual VM freeze.
> 
> To partially solve this problem, make the number of entries that the VM
> will attempt to free at each iteration tunable.  The default is still
> 10, but it can be overridden at compile-time (via Kconfig), boot-time
> (via a kernel command-line option), or runtime (via sysfs).
> 
> This is Cc: stable because (when combined with appropriate userspace
> changes) it fixes a severe performance and stability problem for Qubes
> OS users.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com>

Why am I _still_ - after two earlier private questions to the same
effect - on the To: list of this submission? Please can you respect
other people's time and interests and properly follow patch
submission rules, applying common sense when (like has been the
case in the past for Linux) those rules result in overly broad sets
of people.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 12:11:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 12:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558309.872274 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGerz-0003xJ-Sf; Tue, 04 Jul 2023 12:10:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558309.872274; Tue, 04 Jul 2023 12:10:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGerz-0003xC-PX; Tue, 04 Jul 2023 12:10:59 +0000
Received: by outflank-mailman (input) for mailman id 558309;
 Tue, 04 Jul 2023 12:10:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGery-0003x3-0j
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 12:10:58 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGerx-000753-KF; Tue, 04 Jul 2023 12:10:57 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGerx-0002Fd-EX; Tue, 04 Jul 2023 12:10:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=0+NlS8i1p9v08aRSXry7rnarwsmM8IY/lH+nDOMKUf4=; b=B2AMI7eXQ3/t0m2C78bS0eOo5y
	z+Uhmlftz8XGYQeyRvIN2hJit8x3qYxTcti/d3QB5iyQ3wyYTf2jzZfIMMT6kXsVKqV6WUNdpsPSz
	oUwlDK7ugaWc9NaSAMbTqYmBom0YwDeGY6xmD39KHxVADDTRPTv3HzbvowpL/wzfJZiw=;
Message-ID: <f6bed109-f6da-fd0b-bd5b-077a57a04563@xen.org>
Date: Tue, 4 Jul 2023 13:10:55 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 03/52] xen/arm: add an option to define Xen start
 address for Armv8-R
Content-Language: en-US
To: Ayan Kumar Halder <ayankuma@amd.com>, Penny Zheng <Penny.Zheng@arm.com>,
 xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-4-Penny.Zheng@arm.com>
 <cb7e3d34-bbb8-e5df-f87b-0fcac4b65378@amd.com>
 <77c64929-514a-ea67-cf8b-176c895ff971@xen.org>
 <682fdfab-b755-e580-7688-3dc0c0e3779e@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <682fdfab-b755-e580-7688-3dc0c0e3779e@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 04/07/2023 13:02, Ayan Kumar Halder wrote:
> 
> On 04/07/2023 12:47, Julien Grall wrote:
>>
>>
>> On 04/07/2023 11:36, Ayan Kumar Halder wrote:
>>> Hi Penny,
>>
>> Hi Ayan,
> Hi Julien,
>>
>>> On 26/06/2023 04:33, Penny Zheng wrote:
>>>> CAUTION: This message has originated from an External Source. Please 
>>>> use proper judgment and caution when opening attachments, clicking 
>>>> links, or responding to this email.
>>>>
>>>>
>>>> From: Wei Chen <wei.chen@arm.com>
>>>>
>>>> On Armv8-A, Xen has a fixed virtual start address (link address
>>>> too) for all Armv8-A platforms. In an MMU based system, Xen can
>>>> map its loaded address to this virtual start address. So, on
>>>> Armv8-A platforms, the Xen start address does not need to be
>>>> configurable. But on Armv8-R platforms, there is no MMU to map
>>>> loaded address to a fixed virtual address and different platforms
>>>> will have very different address space layout. So Xen cannot use
>>>> a fixed physical address on MPU based system and need to have it
>>>> configurable.
>>>>
>>>> In this patch we introduce one Kconfig option for users to define
>>>> the default Xen start address for Armv8-R. Users can enter the
>>>> address in config time, or select the tailored platform config
>>>> file from arch/arm/configs.
>>>>
>>>> And as we introduced Armv8-R to Xen, that means the existed Arm64
>>>> MMU based platforms should not be listed in Armv8-R platform
>>>> list, so we add !HAS_MPU dependency for these platforms.
>>>>
>>>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>>>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>>>> ---
>>>> v1 -> v2:
>>>> 1. Remove the platform header fvp_baser.h.
>>>> 2. Remove the default start address for fvp_baser64.
>>>> 3. Remove the description of default address from commit log.
>>>> 4. Change HAS_MPU to ARM_V8R for Xen start address dependency.
>>>> Â Â Â  No matter Arm-v8r board has MPU or not, it always need to
>>>> Â Â Â  specify the start address.
>>>> ---
>>>> v3:
>>>> 1. Remove unrelated change of "CONFIG_FVP_BASER"
>>>> 2. Change ARM_V8R to HAS_MPU for Xen start address dependency
>>>> ---
>>>> Â  xen/arch/arm/KconfigÂ Â Â Â Â Â Â Â Â Â  | 8 ++++++++
>>>> Â  xen/arch/arm/platforms/Kconfig | 8 +++++---
>>>> Â  2 files changed, 13 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>>> index 70fdc2ba63..ff17345cdb 100644
>>>> --- a/xen/arch/arm/Kconfig
>>>> +++ b/xen/arch/arm/Kconfig
>>>> @@ -181,6 +181,14 @@ config TEE
>>>> Â Â Â Â Â Â Â Â Â Â  This option enables generic TEE mediators support. It 
>>>> allows guests
>>>> Â Â Â Â Â Â Â Â Â Â  to access real TEE via one of TEE mediators implemented 
>>>> in XEN.
>>>>
>>>> +config XEN_START_ADDRESS
>>>> +Â Â Â Â Â Â  hex "Xen start address: keep default to use platform defined 
>>>> address"
>>>> +Â Â Â Â Â Â  default 0
>>>> +Â Â Â Â Â Â  depends on HAS_MPU
>>>> +Â Â Â Â Â Â  help
>>>> +Â Â Â Â Â Â Â Â  This option allows to set the customized address at which 
>>>> Xen will be
>>>> +Â Â Â Â Â Â Â Â  linked on MPU systems. This address must be aligned to a 
>>>> page size.
>>>> +
>>>> Â  source "arch/arm/tee/Kconfig"
>>>>
>>>> Â  config STATIC_SHM
>>>> diff --git a/xen/arch/arm/platforms/Kconfig 
>>>> b/xen/arch/arm/platforms/Kconfig
>>>> index c93a6b2756..75af48b5f9 100644
>>>> --- a/xen/arch/arm/platforms/Kconfig
>>>> +++ b/xen/arch/arm/platforms/Kconfig
>>>> @@ -1,6 +1,7 @@
>>>> Â  choice
>>>> Â Â Â Â Â Â Â Â  prompt "Platform Support"
>>>> Â Â Â Â Â Â Â Â  default ALL_PLAT
>>>> +Â Â Â Â Â Â  default NO_PLAT if HAS_MPU
>>>
>>> I am a bit concerned about this as we will be introducing R52 
>>> specific platform in xen/arch/arm/platforms/
>>>
>>> (For eg 
>>> https://github.com/Xilinx/xen/blob/xlnx_rebase_4.17/xen/arch/arm_mpu/platforms/amd-versal-net.c )
>>>
>>> Thus, we will have to remove this line at that time.
>>>
>>> Can you remove this line, please if it does not cause any issue ?
>>
>> From my understanding of the discussion at Xen Summit, most of the 
>> platform specific code would be moved to something similar to 
>> bootwrapper.
> 
> Yes, but I think bootwrappers are now deprecated.

They are still used on FVP to boot without UEFI/U-boot.

> 
> At least 
> git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/boot-wrapper-aarch64.git does not seem to be active and https://github.com/artagnon/boot-wrapper-aarch64 looks archived.
I expect bootwrappers to be fairly stable. So I am not entirely 
surprised that it is not "active".

> 
>>
>> So do you still actually need to have code in Xen for setting up the 
>> timer?
> 
> I think we can ignore it for now.
> 
> Just for information, we are using the platform specific code to achieve 
> the following :-
> 
> 1. Set up the timer and CNTFRQ
> 
> 2. Set up the secondary boot address and start the secondary cores.

This sounds like code that could be added in bootwrapper (or similar). 
So Xen (or any other OS/kernel) can share the logic and can rely on 
spin-table/PSCI for SMP bring-up.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 12:22:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 12:22:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558313.872283 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGf2W-0005SR-QC; Tue, 04 Jul 2023 12:21:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558313.872283; Tue, 04 Jul 2023 12:21:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGf2W-0005SK-NN; Tue, 04 Jul 2023 12:21:52 +0000
Received: by outflank-mailman (input) for mailman id 558313;
 Tue, 04 Jul 2023 12:21:51 +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 <SRS0=D/z2=CW=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGf2V-0005SE-0Q
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 12:21:51 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2049.outbound.protection.outlook.com [40.107.7.49])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 58e10ffa-1a65-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 14:21:48 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB7492.eurprd04.prod.outlook.com (2603:10a6:20b:282::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 12:21:19 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 12:21:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 58e10ffa-1a65-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JwfyPA0xH4/RImmUbV8WNHnstvAahL3LRXp/ePTA7FVAWFM96ZYC0mUqJYVG3qwKToFRAqQnVTHik6wDD2ogsoYoomFy5Wzpsf9HvQVGCcWzQA+lG3Oi1WF7ha35Xq0ztysMC28QfhQ109bqBOP0g/3x78E5VbMzulKzTBIEcVnPfb5/UEObOEZW4KqEW0QsojD66oyDAJmKKT/Fhxgkvi4WGjecP/M8Yaa+BHbLFdaQlVT3sBMDv07XHTCiJ6zlYykeh1wdpANmvZXT2dPmrqUlIcHqAuqo2jMUaF+H/8ixQFs5NOzNhEzuTsi839VEkLeRh2U0xCnNVwoREB1fig==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=In3WCiwidXW2LkHXdFTMrEoGDNfe1stpI+BHStJM4dc=;
 b=hSI1tGrZLaCssm6CKsUnVQz2+c+H8ndio3Mg6dm2yXUfQH2D6e7625C5wMkphtD6dklpPfSGqh56xCwWMNX9Y87aYBjYrPn7xuRRBsugXyxew9CKgVFWjnpNmBw7b6975fWEtP6ZWm5zaSHGAmXYOX/5PllVaFfc2Sulrxvv83phypPUqA/fMwxmVnegngO7AxIG0TlOiYPbsAQKwM0QB3dG93f/scqvG8uo5gCWDmuuyrBmb77e0pQGT4fxOoctqPJFjUdzBNqBShcLbqC7R//o/UDyGwKRien8FujiF4fNEtuf2UEHB+tKeRsqIp1P+dER3daaVerShhzQIasbSg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=In3WCiwidXW2LkHXdFTMrEoGDNfe1stpI+BHStJM4dc=;
 b=FW90UHpa88v7rilaCaloLiqgHmMVltpCN3snF2FrzURX6cWKFrfkjP12f6J8+M2+JiUSfDhgLLzvcAG3k97/ywcDrRwhppLx+gc81eKegLeVuYb3NGEZdVlQkzcRL1im/Pn5/gYmHAMLpi6tHnCimM3DWYFrJCYLOXkzjEJ6iVDSi5eKMR1+iXgAkd9Sdvucj/pnUZ3R+t/ePjjJ6LuUaIQBEsq2pMFtGiPCjdARXJ7+86tmc0kjsAE8fbjVgaQP8MpxTVmcylr1ihdMoJKZXiQi/NXmMyXq7qhpwHSrfwNrbALzwK0eBxY5er0E3aitiUkFYQ9RRIc3odx7cAwHjg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <1bc81320-7bc2-3392-528e-8434d6a44ccc@suse.com>
Date: Tue, 4 Jul 2023 14:21:25 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v3 15/52] xen: make VMAP only support in MMU system
Content-Language: en-US
To: Penny Zheng <penny.zheng@arm.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Chen <wei.chen@arm.com>, xen-devel@lists.xenproject.org
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-16-Penny.Zheng@arm.com>
 <654c9925-565a-80d4-5e93-129f6f0f691a@suse.com>
 <7d3ff868-60a4-1eab-0b9b-f6ca649cfdeb@arm.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <7d3ff868-60a4-1eab-0b9b-f6ca649cfdeb@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0159.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b3::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB7492:EE_
X-MS-Office365-Filtering-Correlation-Id: 9ecf48db-ba5e-43db-64d4-08db7c892bbb
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	A9Qs7AAoyN6NPJZvriH5q2znsuWGbo1gHq+uoRnbMFmqS+qMNlTqyBIikzAtP3mDSDpXFEmswq/4AKr1h+cmiYBJQdKyhIuWohuy2uf3JYNK4AjZDAuxpBYVeCz76xrf2OEnCyevHUpR9x+Y3/WPFPaLXl0t7KDbFrpiRlScVXqskooj43fK48MShRN4mzfAclIBbXNfkC5fUkgyRJ7N9eKXFCBajPcANQZCFapLEgT/Ysrm5XaFIM52jowoSnwMmHVbqJGnBupiSafMi7DZ15a5Y8Z/O94xWCRrA2yOxyx0rAs/rUN1uHdUrGf7ua4Wkcp690euzUoHnkOtzGDiGlAphUB7H+09K0gF2wSOLsHI/u2Cro8QevbWZ2qYR1UPOPb4fUqiWkiAGCqpHimeY3xtd8oBNWXI5Uh0RiO3mZyCqgE9PRNHTYuNg+RYBPXRhEvut+fjfQkD2Xi6t9a96oZk2jU0h0hbALu/ol9OoQ1FxWXVPbyLBB2qWemj9qkeCc71x+sfMz6DABzF0ZBEJt5Mpb/L7pOsJYkCvJZnmE97i7g1nMHxbvMfH77xdGCFD+jB0h1JulMelUN2Y+1zIIP6fZqY2VXzV4PixLZQMAztk8qHY/ly1XBDiDH0zMImVcApDe03mns5jgpozltdwMdygFpthCnnqXhxXRip2oc=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(136003)(39860400002)(346002)(396003)(366004)(451199021)(2906002)(41300700001)(5660300002)(7416002)(8676002)(36756003)(8936002)(31696002)(86362001)(6512007)(6486002)(478600001)(6666004)(83380400001)(186003)(53546011)(31686004)(66476007)(26005)(2616005)(66556008)(4326008)(6916009)(54906003)(66946007)(6506007)(316002)(38100700002)(21314003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dG82WVJmRm9ubkJxNDZTcWl2Y0JrY1diQnY5L3p5cVBDN1Bsb1dyZWtCcEVQ?=
 =?utf-8?B?UDIxS09FQlVIWDhDenZWMUhPYk9uaEJzWFpkeFlncG5tY3VkRG5pbHhmS1N2?=
 =?utf-8?B?ZEFDWS9QT3l4Q0FTSmhrZm41S2xtVlN1Q2lKNU1DS1k4OHBwaDNBSjRiWDFQ?=
 =?utf-8?B?L1RpUWMzQy9HaldWb0d3ekhIUHNGMmlEdi9vTkEwMEVjNGJjbmI2enJtMTBy?=
 =?utf-8?B?YkZ0STh5ZGExdVJiNDM1QmQvOHpienVPeTNNUUd4cStSajBZb0tFd0c2U0Ja?=
 =?utf-8?B?L05GenNsclJ3eVVST3Y2MjVXbmFabU9PWWpUa2Y3UnZrNkM1MU5STUttQTQ1?=
 =?utf-8?B?WmJWekZZV0VSYllwbXo2WkFBS2ZWeXRUTTNjcWVDOVZRVzE0eXRFLzdYZW5T?=
 =?utf-8?B?WkhEOHlMY2hvRFhldnFGMGtpbHVYNnNhY0R4WmhwcXk3bEZmbU1GNVl5L05i?=
 =?utf-8?B?L2xLZm9pdjFxK2NiWVZzMU9BSnVkVFpSalR3dnZkY0NRLzVvRGFoeERTVlhv?=
 =?utf-8?B?SnppSDFPQ0hSeThCOXJ1T0M4MDF2cmFZM3l0VTZ2NytKRGNyMWE4M0NzNUFz?=
 =?utf-8?B?TWtXSU5JSXc5aWtwZ1JWWFJFSEV6REZscFdZZ0hDaUR2aVAvTWFJL25YWkQ5?=
 =?utf-8?B?WDNacEtEdENkT1lIVHJiY2FHVFYzTjhYR25KNnphalJHQXVzMnpFdUZrblBn?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CtRYmpmdDdDZkZvZmtqZGJCdFEyM2plbThsM0xW?=
 =?utf-8?B?dHFHM1h2SlVKMzZDYlcxNWRKc25KaHRMaE5BMUtQV3VLM2dmeEdTV3cvQTAy?=
 =?utf-8?B?UFlqaGNocnlhVXJLaXIvMWc4SEhQanhOM21xOUsyT25KNnRweFNvV002VmJw?=
 =?utf-8?B?VlFUM29VTm9RbWNGZFV2dGxFYUlDTVV3NUl1TnBlWFRUbk5OalpsRUZ2eHcz?=
 =?utf-8?B?bGd6UW1ZT0xNckxJWko4UlRIcFhjTGdtYzQ2NHNmZU5lajJjMkRVWTFpV2RQ?=
 =?utf-8?B?elh4WENLQ2YrWTVZRmQybFJEZVc0eW85UnFoQ2FYbkhtWWFROHZGZHpHTG9S?=
 =?utf-8?B?NDFhQWU5bTd1NzROb3N4VE9CTnRkOCs3bVhCTzJaaDJwdiswbWs1L2p1V3Jx?=
 =?utf-8?B?K05xQjJ0NXN3K1NEdFNUQWhCS3VRQU8wR1dOWCtkR2R2aVNEeno0aGRucEk2?=
 =?utf-8?B?YWxzVzc1YTcxb2c1aWVWa003NFhEM2E1eU00L2tsc050elhHRGsxSFB1SUVW?=
 =?utf-8?Q?k3xasOgrDsz524XfZItH322rs?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9ecf48db-ba5e-43db-64d4-08db7c892bbb
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 12:21:19.0399
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: snqGxa1317f6C0YeOJ4Y/OtIovCH/l8Y17VrgTPIAM2QLaIHegwGkoM/P9IwMFOQdUJQkhUXksd6tnbAN5oruQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7492

On 28.06.2023 07:38, Penny Zheng wrote:
> On 2023/6/26 14:00, Jan Beulich wrote:
>> On 26.06.2023 05:34, Penny Zheng wrote:
>>> --- a/xen/arch/x86/Kconfig
>>> +++ b/xen/arch/x86/Kconfig
>>> @@ -27,6 +27,7 @@ config X86
>>>   	select HAS_PDX
>>>   	select HAS_SCHED_GRANULARITY
>>>   	select HAS_UBSAN
>>> +	select HAS_VMAP
>>
>> With this being unconditional, ...
>>
>>> --- a/xen/arch/x86/setup.c
>>> +++ b/xen/arch/x86/setup.c
>>> @@ -1750,12 +1750,14 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>>>           end_boot_allocator();
>>>   
>>>       system_state = SYS_STATE_boot;
>>> +#ifdef CONFIG_HAS_VMAP
>>>       /*
>>>        * No calls involving ACPI code should go between the setting of
>>>        * SYS_STATE_boot and vm_init() (or else acpi_os_{,un}map_memory()
>>>        * will break).
>>>        */
>>>       vm_init();
>>> +#endif
>>
>> ... there's no need to make this code less readable by adding #ifdef.
>> Even for the Arm side I question the #ifdef-ary - it likely would be
>> better to have an empty stub in the header for that case.
>>
> 
> I may misunderstand what you said in last serie and thought #ifdef-ary 
> is preferred compared with inline stubs, referring here to recall
> '''
> Do you really need this and all other inline stubs? Imo the goal ought
> to be to have as few of them as possible: The one above won't be
> referenced if you further make LIVEPATCH depend on HAS_VMAP (which I
> think you need to do anyway), and the only other call to the function
> is visible in context above (i.e. won't be used either when !HAS_VMAP).
> In other cases merely having a declaration (but no definition) may be
> sufficient, as the compiler may be able to eliminate calls.
> '''
> So maybe the preferring order is "declaration > empty inline stubs > 
> #ifdef-ary" ?

Indeed.

> As having a declaration is not enough for vm_init()(when
> !HAS_VMAP), we provide static inline empty stub here.

Really you change the existing vm_init() to an empty stub already; no
need to have a 2nd one (if that was a consideration).

>>> --- a/xen/common/Kconfig
>>> +++ b/xen/common/Kconfig
>>> @@ -15,6 +15,7 @@ config CORE_PARKING
>>>   config GRANT_TABLE
>>>   	bool "Grant table support" if EXPERT
>>>   	default y
>>> +	depends on HAS_VMAP
>>
>> Looking back at the commit which added use of vmap.h there, I can't
>> seem to be bale to spot why it did. Where's the dependency there?
> 
> vzalloc() is used in grant_table_init() in xen/common/grantable.c:2023

You'll need vzalloc() to fall back to xzalloc() anyway when !HAS_VMAP,
I suppose.

>> And even if there is one, I think you don't want to unconditionally
>> turn off a core, guest-visible feature. Instead you would want to
>> identify a way to continue to support the feature in perhaps
>> slightly less efficient a way.
> 
> We have discussed in MPU design, normally, xen guest in MPU system
> will be a linux guest with no pv(with CONFIG_XEN=n), so advanced 
> features like grant table is in no use there.

Is this design decision written down anywhere? It looks pretty limiting
to me ...

>>> --- a/xen/common/vmap.c
>>> +++ b/xen/common/vmap.c
>>> @@ -331,4 +331,11 @@ void vfree(void *va)
>>>       while ( (pg = page_list_remove_head(&pg_list)) != NULL )
>>>           free_domheap_page(pg);
>>>   }
>>> +
>>> +void iounmap(void __iomem *va)
>>> +{
>>> +    unsigned long addr = (unsigned long)(void __force *)va;
>>> +
>>> +    vunmap((void *)(addr & PAGE_MASK));
>>> +}
>>
>> Why does this move here?
> 
> ioremap/iounmap is using vmap, at least in ARM. So for this more
> generic interface, I was intending to implement it on MPU system.
> In commit "[PATCH v3 19/52] xen/arm: switch to use ioremap_xxx in common 
> file", I'm trying to replace all direct vmap interface with ioremap_xxx 
> in common files.
> Then I, in commit "[PATCH v3 36/52] xen/mpu: implememt ioremap_xxx in 
> MPU", will implement MPU version of ioremap_xxx.

Which suggests that the movement _may_ be needed, but doing it here is
likely premature.

>>> --- a/xen/include/xen/vmap.h
>>> +++ b/xen/include/xen/vmap.h
>>> @@ -1,4 +1,4 @@
>>> -#if !defined(__XEN_VMAP_H__) && defined(VMAP_VIRT_START)
>>> +#if !defined(__XEN_VMAP_H__) && (defined(VMAP_VIRT_START) || !defined(CONFIG_HAS_VMAP))
>>>   #define __XEN_VMAP_H__
>>>   
>>>   #include <xen/mm-frame.h>
>>> @@ -25,17 +25,14 @@ void vfree(void *va);
>>>   
>>>   void __iomem *ioremap(paddr_t, size_t);
>>>   
>>> -static inline void iounmap(void __iomem *va)
>>> -{
>>> -    unsigned long addr = (unsigned long)(void __force *)va;
>>> -
>>> -    vunmap((void *)(addr & PAGE_MASK));
>>> -}
>>> +void iounmap(void __iomem *va);
>>>   
>>>   void *arch_vmap_virt_end(void);
>>>   static inline void vm_init(void)
>>>   {
>>> +#if defined(VMAP_VIRT_START)
>>>       vm_init_type(VMAP_DEFAULT, (void *)VMAP_VIRT_START, arch_vmap_virt_end());
>>> +#endif
>>>   }
>>
>> Why the (seemingly unrelated) #ifdef-ary here? You've eliminated
>> the problematic caller already. Didn't you mean to add wider scope
>> #ifdef CONFIG_HAS_VMAP to this header?
>>
> 
> plz correct me if I'm wrong, in MPU system with !HAS_VMAP, if we don't
> #ifdef-ary here, we will have the following compilation error, I guess
> it's because that vm_init() is a static inline stub:
> ```
> ./include/xen/vmap.h: In function â€˜vm_initâ€™:
> ./include/xen/vmap.h:33:40: error: â€˜VMAP_VIRT_STARTâ€™ undeclared (first 
> use in this function); did you mean â€˜XEN_VIRT_STARTâ€™?
>     33 |     vm_init_type(VMAP_DEFAULT, (void *)VMAP_VIRT_START, 
> arch_vmap_virt_end());
>        |                                        ^~~~~~~~~~~~~~~
>        |                                        XEN_VIRT_START
> ```

Perhaps, but that doesn't mean the #ifdef-ary here is the only
solution. I'm afraid the approach so far doesn't really make clear
in what overall direction you want to move. Possibly it may help
if you split the patch ...

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 12:22:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 12:22:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558315.872294 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGf36-0005tu-2G; Tue, 04 Jul 2023 12:22:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558315.872294; Tue, 04 Jul 2023 12:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGf35-0005tl-VY; Tue, 04 Jul 2023 12:22:27 +0000
Received: by outflank-mailman (input) for mailman id 558315;
 Tue, 04 Jul 2023 12:22:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=fUi4=CW=suse.cz=jack@srs-se1.protection.inumbo.net>)
 id 1qGf35-0005t9-9N
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 12:22:27 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6f9381a9-1a65-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 14:22:26 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id CDD3B2286C;
 Tue,  4 Jul 2023 12:22:25 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BEE0C1346D;
 Tue,  4 Jul 2023 12:22:25 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id oTSYLgEPpGQiMAAAMHmgww
 (envelope-from <jack@suse.cz>); Tue, 04 Jul 2023 12:22:25 +0000
Received: by quack3.suse.cz (Postfix, from userid 1000)
 id BE7FCA076A; Tue,  4 Jul 2023 14:22:24 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6f9381a9-1a65-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa;
	t=1688473345; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=hgWYBTc++URz0W+hLmtIO2nNo8AlYvCPUKETELAc3VA=;
	b=Qb8anpmyKDSQIxGdg521F20mvfMC85y7fzDTXZrkbM4kzYIjv6aKCn3+xbBD3uMQAajUVZ
	ugyze9xSihFwzhyBjK9gTL4nkTBbHLDd8zhmdp+o//HY5cZXbMyHPJYuKF4t+E7uXZXBWk
	bzG6bgm1wZDOefw3O4jnuwhDQ54k2TQ=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;
	s=susede2_ed25519; t=1688473345;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=hgWYBTc++URz0W+hLmtIO2nNo8AlYvCPUKETELAc3VA=;
	b=ZR980NIdJUvOgrooVYbDv5bR5vhnyt3H0wWgJQoutm98q8+Ipj1LRpoze+6fCWg9Vd/n9b
	ryyZ0+WIjeGdC1DQ==
From: Jan Kara <jack@suse.cz>
To: <linux-block@vger.kernel.org>
Cc: <linux-fsdevel@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@infradead.org>,
	Jan Kara <jack@suse.cz>,
	xen-devel@lists.xenproject.org
Subject: [PATCH 08/32] xen/blkback: Convert to blkdev_get_handle_by_dev()
Date: Tue,  4 Jul 2023 14:21:35 +0200
Message-Id: <20230704122224.16257-8-jack@suse.cz>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230629165206.383-1-jack@suse.cz>
References: <20230629165206.383-1-jack@suse.cz>
MIME-Version: 1.0
X-Developer-Signature: v=1; a=openpgp-sha256; l=6173; i=jack@suse.cz; h=from:subject; bh=3hrSb/NISdZPkfHN0I6heP9od+4nmfsdU94X3qv9uDU=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBkpA7RR4iuVgQ5/lWBtD1QxcWJDsuRZvmWrM/HrPO3 7WExI7GJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZKQO0QAKCRCcnaoHP2RA2cvGCA Dwim+pDfkemEhFzpm2L4wLqfBTx4bmS+KKKMfrEk8oI7WpFaN4BNg9wKzjIx9e7dom5/NTl2rlRRoq Fu5ZAdFMNskCr8HqswKb/EBn9jfGiRc0tKl9WgB5yrt1FB/Yg17cND+9wPa6KRNCcRXGqJtiw1tF32 o2xKYjfzwE4IJ2S2LNsMQgNEYShri/W2cmEZJTvP4ruTzu2fxFV4NxMshZXFRXm7S30+SKJAEIjjka HnJyzn3ca/m/XDuod5OlVaKPrQbAVvSpY2PaPTEBQcbeuhCcYet6PUb3lg/8ztrJ2754ftD7v9nQF7 U3W2HOS6k97KWMr3RtNouYeHsPNIj8
X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C
Content-Transfer-Encoding: 8bit

Convert xen/blkback to use blkdev_get_handle_by_dev() and pass the
handle around.

CC: xen-devel@lists.xenproject.org
Signed-off-by: Jan Kara <jack@suse.cz>
---
 drivers/block/xen-blkback/blkback.c |  4 +--
 drivers/block/xen-blkback/common.h  |  4 +--
 drivers/block/xen-blkback/xenbus.c  | 40 +++++++++++++++--------------
 3 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index c362f4ad80ab..4defd7f387c7 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -465,7 +465,7 @@ static int xen_vbd_translate(struct phys_req *req, struct xen_blkif *blkif,
 	}
 
 	req->dev  = vbd->pdevice;
-	req->bdev = vbd->bdev;
+	req->bdev = vbd->bdev_handle->bdev;
 	rc = 0;
 
  out:
@@ -969,7 +969,7 @@ static int dispatch_discard_io(struct xen_blkif_ring *ring,
 	int err = 0;
 	int status = BLKIF_RSP_OKAY;
 	struct xen_blkif *blkif = ring->blkif;
-	struct block_device *bdev = blkif->vbd.bdev;
+	struct block_device *bdev = blkif->vbd.bdev_handle->bdev;
 	struct phys_req preq;
 
 	xen_blkif_get(blkif);
diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h
index 40f67bfc052d..5ff50e76cee5 100644
--- a/drivers/block/xen-blkback/common.h
+++ b/drivers/block/xen-blkback/common.h
@@ -221,7 +221,7 @@ struct xen_vbd {
 	unsigned char		type;
 	/* phys device that this vbd maps to. */
 	u32			pdevice;
-	struct block_device	*bdev;
+	struct bdev_handle	*bdev_handle;
 	/* Cached size parameter. */
 	sector_t		size;
 	unsigned int		flush_support:1;
@@ -360,7 +360,7 @@ struct pending_req {
 };
 
 
-#define vbd_sz(_v)	bdev_nr_sectors((_v)->bdev)
+#define vbd_sz(_v)	bdev_nr_sectors((_v)->bdev_handle->bdev)
 
 #define xen_blkif_get(_b) (atomic_inc(&(_b)->refcnt))
 #define xen_blkif_put(_b)				\
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index bb66178c432b..b67d28584c72 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -81,7 +81,7 @@ static void xen_update_blkif_status(struct xen_blkif *blkif)
 	int i;
 
 	/* Not ready to connect? */
-	if (!blkif->rings || !blkif->rings[0].irq || !blkif->vbd.bdev)
+	if (!blkif->rings || !blkif->rings[0].irq || !blkif->vbd.bdev_handle)
 		return;
 
 	/* Already connected? */
@@ -99,12 +99,13 @@ static void xen_update_blkif_status(struct xen_blkif *blkif)
 		return;
 	}
 
-	err = sync_blockdev(blkif->vbd.bdev);
+	err = sync_blockdev(blkif->vbd.bdev_handle->bdev);
 	if (err) {
 		xenbus_dev_error(blkif->be->dev, err, "block flush");
 		return;
 	}
-	invalidate_inode_pages2(blkif->vbd.bdev->bd_inode->i_mapping);
+	invalidate_inode_pages2(
+			blkif->vbd.bdev_handle->bdev->bd_inode->i_mapping);
 
 	for (i = 0; i < blkif->nr_rings; i++) {
 		ring = &blkif->rings[i];
@@ -472,9 +473,9 @@ static void xenvbd_sysfs_delif(struct xenbus_device *dev)
 
 static void xen_vbd_free(struct xen_vbd *vbd)
 {
-	if (vbd->bdev)
-		blkdev_put(vbd->bdev, NULL);
-	vbd->bdev = NULL;
+	if (vbd->bdev_handle)
+		blkdev_handle_put(vbd->bdev_handle);
+	vbd->bdev_handle = NULL;
 }
 
 static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle,
@@ -482,7 +483,7 @@ static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle,
 			  int cdrom)
 {
 	struct xen_vbd *vbd;
-	struct block_device *bdev;
+	struct bdev_handle *bdev_handle;
 
 	vbd = &blkif->vbd;
 	vbd->handle   = handle;
@@ -491,17 +492,17 @@ static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle,
 
 	vbd->pdevice  = MKDEV(major, minor);
 
-	bdev = blkdev_get_by_dev(vbd->pdevice, vbd->readonly ?
+	bdev_handle = blkdev_get_handle_by_dev(vbd->pdevice, vbd->readonly ?
 				 BLK_OPEN_READ : BLK_OPEN_WRITE, NULL, NULL);
 
-	if (IS_ERR(bdev)) {
+	if (IS_ERR(bdev_handle)) {
 		pr_warn("xen_vbd_create: device %08x could not be opened\n",
 			vbd->pdevice);
 		return -ENOENT;
 	}
 
-	vbd->bdev = bdev;
-	if (vbd->bdev->bd_disk == NULL) {
+	vbd->bdev_handle = bdev_handle;
+	if (vbd->bdev_handle->bdev->bd_disk == NULL) {
 		pr_warn("xen_vbd_create: device %08x doesn't exist\n",
 			vbd->pdevice);
 		xen_vbd_free(vbd);
@@ -509,14 +510,14 @@ static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle,
 	}
 	vbd->size = vbd_sz(vbd);
 
-	if (cdrom || disk_to_cdi(vbd->bdev->bd_disk))
+	if (cdrom || disk_to_cdi(vbd->bdev_handle->bdev->bd_disk))
 		vbd->type |= VDISK_CDROM;
-	if (vbd->bdev->bd_disk->flags & GENHD_FL_REMOVABLE)
+	if (vbd->bdev_handle->bdev->bd_disk->flags & GENHD_FL_REMOVABLE)
 		vbd->type |= VDISK_REMOVABLE;
 
-	if (bdev_write_cache(bdev))
+	if (bdev_write_cache(bdev_handle->bdev))
 		vbd->flush_support = true;
-	if (bdev_max_secure_erase_sectors(bdev))
+	if (bdev_max_secure_erase_sectors(bdev_handle->bdev))
 		vbd->discard_secure = true;
 
 	pr_debug("Successful creation of handle=%04x (dom=%u)\n",
@@ -569,7 +570,7 @@ static void xen_blkbk_discard(struct xenbus_transaction xbt, struct backend_info
 	struct xen_blkif *blkif = be->blkif;
 	int err;
 	int state = 0;
-	struct block_device *bdev = be->blkif->vbd.bdev;
+	struct block_device *bdev = be->blkif->vbd.bdev_handle->bdev;
 
 	if (!xenbus_read_unsigned(dev->nodename, "discard-enable", 1))
 		return;
@@ -930,15 +931,16 @@ static void connect(struct backend_info *be)
 		goto abort;
 	}
 	err = xenbus_printf(xbt, dev->nodename, "sector-size", "%lu",
-			    (unsigned long)
-			    bdev_logical_block_size(be->blkif->vbd.bdev));
+			    (unsigned long)bdev_logical_block_size(
+					be->blkif->vbd.bdev_handle->bdev));
 	if (err) {
 		xenbus_dev_fatal(dev, err, "writing %s/sector-size",
 				 dev->nodename);
 		goto abort;
 	}
 	err = xenbus_printf(xbt, dev->nodename, "physical-sector-size", "%u",
-			    bdev_physical_block_size(be->blkif->vbd.bdev));
+			    bdev_physical_block_size(
+					be->blkif->vbd.bdev_handle->bdev));
 	if (err)
 		xenbus_dev_error(dev, err, "writing %s/physical-sector-size",
 				 dev->nodename);
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 12:22:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 12:22:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558316.872304 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGf37-00069V-D9; Tue, 04 Jul 2023 12:22:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558316.872304; Tue, 04 Jul 2023 12:22:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGf37-00069K-A8; Tue, 04 Jul 2023 12:22:29 +0000
Received: by outflank-mailman (input) for mailman id 558316;
 Tue, 04 Jul 2023 12:22:28 +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 <SRS0=fUi4=CW=suse.cz=jack@srs-se1.protection.inumbo.net>)
 id 1qGf36-0005tk-5R
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 12:22:28 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6f3d5dd0-1a65-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 14:22:25 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 37C1422864;
 Tue,  4 Jul 2023 12:22:25 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1D4941346D;
 Tue,  4 Jul 2023 12:22:25 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id j8gfBwEPpGQFMAAAMHmgww
 (envelope-from <jack@suse.cz>); Tue, 04 Jul 2023 12:22:25 +0000
Received: by quack3.suse.cz (Postfix, from userid 1000)
 id 915DAA0722; Tue,  4 Jul 2023 14:22:24 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6f3d5dd0-1a65-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa;
	t=1688473345; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:  content-transfer-encoding:content-transfer-encoding;
	bh=fmLTdco5SVuopuSHDbZ7fgiCJT9fmPtnstwBD5O0cVs=;
	b=LYS1cAt6t7JDeaXCZA2GfkFsvePsCKrBv683wLJKbeQdnB0RB5kex3lpjPlaO0WNrRIj/p
	OKov+tjGtn08tmzrJU88unG7OZdlwokmKgdGkl+OG4epxE3GA77hqhJZhG3Z0dN3YI1cPw
	0UrvrW8qrgzkAVKwdQJPDUFGAz/meEU=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;
	s=susede2_ed25519; t=1688473345;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:  content-transfer-encoding:content-transfer-encoding;
	bh=fmLTdco5SVuopuSHDbZ7fgiCJT9fmPtnstwBD5O0cVs=;
	b=Dse69eRRr1j+O/QtQVzrTyIAnqxKgXzcDp3QAv4KDKTfaZG4HjcsXtXKNaEGDfzmeYyIxx
	WQrcOQN123NhV6Dg==
From: Jan Kara <jack@suse.cz>
To: <linux-block@vger.kernel.org>
Cc: <linux-fsdevel@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@infradead.org>,
	Jan Kara <jack@suse.cz>,
	Alasdair Kergon <agk@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anna Schumaker <anna@kernel.org>,
	Chao Yu <chao@kernel.org>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Dave Kleikamp <shaggy@kernel.org>,
	David Sterba <dsterba@suse.com>,
	dm-devel@redhat.com,
	drbd-dev@lists.linbit.com,
	Gao Xiang <xiang@kernel.org>,
	Jack Wang <jinpu.wang@ionos.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	Joern Engel <joern@lazybastard.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	linux-bcache@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	linux-erofs@lists.ozlabs.org,
	linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-mm@kvack.org,
	linux-mtd@lists.infradead.org,
	linux-nfs@vger.kernel.org,
	linux-nilfs@vger.kernel.org,
	linux-nvme@lists.infradead.org,
	linux-pm@vger.kernel.org,
	linux-raid@vger.kernel.org,
	linux-s390@vger.kernel.org,
	linux-scsi@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	"Md. Haris Iqbal" <haris.iqbal@ionos.com>,
	Mike Snitzer <snitzer@kernel.org>,
	Minchan Kim <minchan@kernel.org>,
	ocfs2-devel@oss.oracle.com,
	reiserfs-devel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Song Liu <song@kernel.org>,
	Sven Schnelle <svens@linux.ibm.com>,
	target-devel@vger.kernel.org,
	Ted Tso <tytso@mit.edu>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	xen-devel@lists.xenproject.org
Subject: [PATCH RFC 0/32] block: Make blkdev_get_by_*() return handle
Date: Tue,  4 Jul 2023 14:21:27 +0200
Message-Id: <20230629165206.383-1-jack@suse.cz>
X-Mailer: git-send-email 2.35.3
MIME-Version: 1.0
X-Developer-Signature: v=1; a=openpgp-sha256; l=2471; i=jack@suse.cz; h=from:subject:message-id; bh=ceZQTtdZjpsFiBb9Fva7YX0lOa2i6Zx53n9hl/3+KQM=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBkpA7DYrlV/5vfqjK0juEsCaKDoUZ39z4YDWexB9PO aQyP7ZaJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZKQOwwAKCRCcnaoHP2RA2S48B/ 476l3pggtn8igKmRoHswxXv63Ks68g/08HDzIZqCtDPA84BSKd93Nq0m/Wn76G+ubHQpfg8PMw5+DG uV+DOTR+NEYKAToQQ8YzmS6RAGasKKWUg3k1pr7jK23l+wcq16ImmBXmWM3nr2j85QcDZeB+vpUKHh bdQJQsBOqKsA+qlImgVwvMS+V4UTLQcIYQo2bDBl0TIbJB0UiXYMYHcvrEkwNZWybXBs+wfERrXuF1 XlXO6rWvLyW94kkpvaZTvPY+yZd7tOLd+W8gsz2uBFG9QJg57aDkZxf6NA+Qxf2O8uwfWiyb1XXBN8 I1wYA/sSduibCw4tF4sYb/wERvIAO+
X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C
Content-Transfer-Encoding: 8bit

Hello,

this patch series implements the idea of blkdev_get_by_*() calls returning
bdev_handle which is then passed to blkdev_put() [1]. This makes the get
and put calls for bdevs more obviously matching and allows us to propagate
context from get to put without having to modify all the users (again!).
In particular I need to propagate used open flags to blkdev_put() to be able
count writeable opens and add support for blocking writes to mounted block
devices. I'll send that series separately.

The series is based on Linus' tree as of yesterday + two bcache fixes which are
in the block tree. Patches have passed some basic testing, I plan to test more
users once we agree this is the right way to go.

								Honza

[1] https://lore.kernel.org/all/ZJGNsVDhZx0Xgs2H@infradead.org

CC: Alasdair Kergon <agk@redhat.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Anna Schumaker <anna@kernel.org>
CC: Chao Yu <chao@kernel.org>
CC: Christian Borntraeger <borntraeger@linux.ibm.com>
CC: Coly Li <colyli@suse.de
CC: "Darrick J. Wong" <djwong@kernel.org>
CC: Dave Kleikamp <shaggy@kernel.org>
CC: David Sterba <dsterba@suse.com>
CC: dm-devel@redhat.com
CC: drbd-dev@lists.linbit.com
CC: Gao Xiang <xiang@kernel.org>
CC: Jack Wang <jinpu.wang@ionos.com>
CC: Jaegeuk Kim <jaegeuk@kernel.org>
CC: jfs-discussion@lists.sourceforge.net
CC: Joern Engel <joern@lazybastard.org>
CC: Joseph Qi <joseph.qi@linux.alibaba.com>
CC: Kent Overstreet <kent.overstreet@gmail.com>
CC: linux-bcache@vger.kernel.org
CC: linux-btrfs@vger.kernel.org
CC: linux-erofs@lists.ozlabs.org
CC: <linux-ext4@vger.kernel.org>
CC: linux-f2fs-devel@lists.sourceforge.net
CC: linux-mm@kvack.org
CC: linux-mtd@lists.infradead.org
CC: linux-nfs@vger.kernel.org
CC: linux-nilfs@vger.kernel.org
CC: linux-nvme@lists.infradead.org
CC: linux-pm@vger.kernel.org
CC: linux-raid@vger.kernel.org
CC: linux-s390@vger.kernel.org
CC: linux-scsi@vger.kernel.org
CC: linux-xfs@vger.kernel.org
CC: "Md. Haris Iqbal" <haris.iqbal@ionos.com>
CC: Mike Snitzer <snitzer@kernel.org>
CC: Minchan Kim <minchan@kernel.org>
CC: ocfs2-devel@oss.oracle.com
CC: reiserfs-devel@vger.kernel.org
CC: Sergey Senozhatsky <senozhatsky@chromium.org>
CC: Song Liu <song@kernel.org>
CC: Sven Schnelle <svens@linux.ibm.com>
CC: target-devel@vger.kernel.org
CC: Ted Tso <tytso@mit.edu>
CC: Trond Myklebust <trond.myklebust@hammerspace.com>
CC: xen-devel@lists.xenproject.org



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 12:22:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 12:22:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558317.872314 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGf38-0006Pc-MD; Tue, 04 Jul 2023 12:22:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558317.872314; Tue, 04 Jul 2023 12:22:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGf38-0006PR-Ig; Tue, 04 Jul 2023 12:22:30 +0000
Received: by outflank-mailman (input) for mailman id 558317;
 Tue, 04 Jul 2023 12:22:28 +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 <SRS0=fUi4=CW=suse.cz=jack@srs-se1.protection.inumbo.net>)
 id 1qGf36-0005tk-Ro
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 12:22:28 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6f7fed8e-1a65-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 14:22:26 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 5D9E422868;
 Tue,  4 Jul 2023 12:22:25 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 433C713A97;
 Tue,  4 Jul 2023 12:22:25 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id fiTSDwEPpGQQMAAAMHmgww
 (envelope-from <jack@suse.cz>); Tue, 04 Jul 2023 12:22:25 +0000
Received: by quack3.suse.cz (Postfix, from userid 1000)
 id 97B9EA0763; Tue,  4 Jul 2023 14:22:24 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6f7fed8e-1a65-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa;
	t=1688473345; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=Y5Z0PpLwK7LWiMwHAJV3g58wt4Pu7/r/oCMflfsspxI=;
	b=Yfx9ztWkVatt0fVfNPxdamFDjV837Nu56ImHpS3yWvwdcdXXyeJ1ONnOd+6RA+xJckyxi2
	Fr1h4BOlDMHKk2yJxxmlop9vtybjvkzPRI8sOxjaR75gWlVSNQjeXkVo/sHlsqPbUV+LJG
	uG3Fi84JhxR4KPvRm9XoLJxwd0lLAD0=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;
	s=susede2_ed25519; t=1688473345;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=Y5Z0PpLwK7LWiMwHAJV3g58wt4Pu7/r/oCMflfsspxI=;
	b=vF6CF3OlMOzmEcsCihpnKLEsv6y6u4duYbSxFgbJ4TrA9OaJnML/9G2T1z6YHtiVQ3zwq6
	zVCIM6qtTQOYAOBg==
From: Jan Kara <jack@suse.cz>
To: <linux-block@vger.kernel.org>
Cc: <linux-fsdevel@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@infradead.org>,
	Jan Kara <jack@suse.cz>,
	Alasdair Kergon <agk@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anna Schumaker <anna@kernel.org>,
	Chao Yu <chao@kernel.org>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Dave Kleikamp <shaggy@kernel.org>,
	David Sterba <dsterba@suse.com>,
	dm-devel@redhat.com,
	drbd-dev@lists.linbit.com,
	Gao Xiang <xiang@kernel.org>,
	Jack Wang <jinpu.wang@ionos.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	Joern Engel <joern@lazybastard.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	linux-bcache@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	linux-erofs@lists.ozlabs.org,
	linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-mm@kvack.org,
	linux-mtd@lists.infradead.org,
	linux-nfs@vger.kernel.org,
	linux-nilfs@vger.kernel.org,
	linux-nvme@lists.infradead.org,
	linux-pm@vger.kernel.org,
	linux-raid@vger.kernel.org,
	linux-s390@vger.kernel.org,
	linux-scsi@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	"Md. Haris Iqbal" <haris.iqbal@ionos.com>,
	Mike Snitzer <snitzer@kernel.org>,
	Minchan Kim <minchan@kernel.org>,
	ocfs2-devel@oss.oracle.com,
	reiserfs-devel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Song Liu <song@kernel.org>,
	Sven Schnelle <svens@linux.ibm.com>,
	target-devel@vger.kernel.org,
	Ted Tso <tytso@mit.edu>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	xen-devel@lists.xenproject.org
Subject: [PATCH 01/32] block: Provide blkdev_get_handle_* functions
Date: Tue,  4 Jul 2023 14:21:28 +0200
Message-Id: <20230704122224.16257-1-jack@suse.cz>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230629165206.383-1-jack@suse.cz>
References: <20230629165206.383-1-jack@suse.cz>
MIME-Version: 1.0
X-Developer-Signature: v=1; a=openpgp-sha256; l=5599; i=jack@suse.cz; h=from:subject; bh=repJSb0/C5PfG8Cx5q/n/kNJZOabhc2tYWxiICNNTtg=; b=owGbwMvMwME4Z+4qdvsUh5uMp9WSGFKW8J3uuK2gorZt+knOzhX81snTGX/57phWXzfXM3w+50Xl rfb7OxmNWRgYORhkxRRZVkde1L42z6hra6iGDMwgViaQKQxcnAIwERsLDobphetsJoi99quKYIut26 wgv/K+lUS+secym02t85epsOp8rtu3acJMN1WFRiX1irKCnSu+LXh+rVyp65RAEGttl+XcP32mOR0n ZJYFm7orF8YFnhVftYzZjm2Rva3I0oqXdap/bUJr8qNjVVfHnBRiFEv0Ocgpck1jlTHfEWUu71NrKu 8EXrbnsfD7wm1qKHDqnnnD21y1n9OFHn8/7qJz4O19panPLvMxrOrNn970IcH6rnhQsq0ZS1v6JUfN RS5ah5XMXNI/c14+vVlVkPVI9n2HQNZlEfdsO13VFx17Z7f0vKnN9UZZ3Zii6WbsWS81/qefFs1Ljl +dK1sZIpSRdXfx+jksz9T4il4AAA==
X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C
Content-Transfer-Encoding: 8bit

Create struct bdev_handle that contains all parameters that need to be
passed to blkdev_put() and provide blkdev_get_handle_* functions that
return this structure instead of plain bdev pointer. This will
eventually allow us to pass one more argument to blkdev_put() without
too much hassle.

CC: Alasdair Kergon <agk@redhat.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Anna Schumaker <anna@kernel.org>
CC: Chao Yu <chao@kernel.org>
CC: Christian Borntraeger <borntraeger@linux.ibm.com>
CC: Coly Li <colyli@suse.de
CC: "Darrick J. Wong" <djwong@kernel.org>
CC: Dave Kleikamp <shaggy@kernel.org>
CC: David Sterba <dsterba@suse.com>
CC: dm-devel@redhat.com
CC: drbd-dev@lists.linbit.com
CC: Gao Xiang <xiang@kernel.org>
CC: Jack Wang <jinpu.wang@ionos.com>
CC: Jaegeuk Kim <jaegeuk@kernel.org>
CC: jfs-discussion@lists.sourceforge.net
CC: Joern Engel <joern@lazybastard.org>
CC: Joseph Qi <joseph.qi@linux.alibaba.com>
CC: Kent Overstreet <kent.overstreet@gmail.com>
CC: linux-bcache@vger.kernel.org
CC: linux-btrfs@vger.kernel.org
CC: linux-erofs@lists.ozlabs.org
CC: <linux-ext4@vger.kernel.org>
CC: linux-f2fs-devel@lists.sourceforge.net
CC: linux-mm@kvack.org
CC: linux-mtd@lists.infradead.org
CC: linux-nfs@vger.kernel.org
CC: linux-nilfs@vger.kernel.org
CC: linux-nvme@lists.infradead.org
CC: linux-pm@vger.kernel.org
CC: linux-raid@vger.kernel.org
CC: linux-s390@vger.kernel.org
CC: linux-scsi@vger.kernel.org
CC: linux-xfs@vger.kernel.org
CC: "Md. Haris Iqbal" <haris.iqbal@ionos.com>
CC: Mike Snitzer <snitzer@kernel.org>
CC: Minchan Kim <minchan@kernel.org>
CC: ocfs2-devel@oss.oracle.com
CC: reiserfs-devel@vger.kernel.org
CC: Sergey Senozhatsky <senozhatsky@chromium.org>
CC: Song Liu <song@kernel.org>
CC: Sven Schnelle <svens@linux.ibm.com>
CC: target-devel@vger.kernel.org
CC: Ted Tso <tytso@mit.edu>
CC: Trond Myklebust <trond.myklebust@hammerspace.com>
CC: xen-devel@lists.xenproject.org
Signed-off-by: Jan Kara <jack@suse.cz>
---
 block/bdev.c           | 47 ++++++++++++++++++++++++++++++++++++++++++
 include/linux/blkdev.h | 10 +++++++++
 2 files changed, 57 insertions(+)

diff --git a/block/bdev.c b/block/bdev.c
index 979e28a46b98..c75de5cac2bc 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -846,6 +846,24 @@ struct block_device *blkdev_get_by_dev(dev_t dev, blk_mode_t mode, void *holder,
 }
 EXPORT_SYMBOL(blkdev_get_by_dev);
 
+struct bdev_handle *blkdev_get_handle_by_dev(dev_t dev, blk_mode_t mode,
+		void *holder, const struct blk_holder_ops *hops)
+{
+	struct bdev_handle *handle = kmalloc(sizeof(struct bdev_handle),
+					     GFP_KERNEL);
+	struct block_device *bdev;
+
+	if (!handle)
+		return ERR_PTR(-ENOMEM);
+	bdev = blkdev_get_by_dev(dev, mode, holder, hops);
+	if (IS_ERR(bdev))
+		return ERR_CAST(bdev);
+	handle->bdev = bdev;
+	handle->holder = holder;
+	return handle;
+}
+EXPORT_SYMBOL(blkdev_get_handle_by_dev);
+
 /**
  * blkdev_get_by_path - open a block device by name
  * @path: path to the block device to open
@@ -884,6 +902,28 @@ struct block_device *blkdev_get_by_path(const char *path, blk_mode_t mode,
 }
 EXPORT_SYMBOL(blkdev_get_by_path);
 
+struct bdev_handle *blkdev_get_handle_by_path(const char *path, blk_mode_t mode,
+		void *holder, const struct blk_holder_ops *hops)
+{
+	struct bdev_handle *handle;
+	dev_t dev;
+	int error;
+
+	error = lookup_bdev(path, &dev);
+	if (error)
+		return ERR_PTR(error);
+
+	handle = blkdev_get_handle_by_dev(dev, mode, holder, hops);
+	if (!IS_ERR(handle) && (mode & BLK_OPEN_WRITE) &&
+	    bdev_read_only(handle->bdev)) {
+		blkdev_handle_put(handle);
+		return ERR_PTR(-EACCES);
+	}
+
+	return handle;
+}
+EXPORT_SYMBOL(blkdev_get_handle_by_path);
+
 void blkdev_put(struct block_device *bdev, void *holder)
 {
 	struct gendisk *disk = bdev->bd_disk;
@@ -920,6 +960,13 @@ void blkdev_put(struct block_device *bdev, void *holder)
 }
 EXPORT_SYMBOL(blkdev_put);
 
+void blkdev_handle_put(struct bdev_handle *handle)
+{
+	blkdev_put(handle->bdev, handle->holder);
+	kfree(handle);
+}
+EXPORT_SYMBOL(blkdev_handle_put);
+
 /**
  * lookup_bdev() - Look up a struct block_device by name.
  * @pathname: Name of the block device in the filesystem.
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index ed44a997f629..a910e9997ddd 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1471,14 +1471,24 @@ struct blk_holder_ops {
 #define sb_open_mode(flags) \
 	(BLK_OPEN_READ | (((flags) & SB_RDONLY) ? 0 : BLK_OPEN_WRITE))
 
+struct bdev_handle {
+	struct block_device *bdev;
+	void *holder;
+};
+
 struct block_device *blkdev_get_by_dev(dev_t dev, blk_mode_t mode, void *holder,
 		const struct blk_holder_ops *hops);
 struct block_device *blkdev_get_by_path(const char *path, blk_mode_t mode,
 		void *holder, const struct blk_holder_ops *hops);
+struct bdev_handle *blkdev_get_handle_by_dev(dev_t dev, blk_mode_t mode,
+		void *holder, const struct blk_holder_ops *hops);
+struct bdev_handle *blkdev_get_handle_by_path(const char *path, blk_mode_t mode,
+		void *holder, const struct blk_holder_ops *hops);
 int bd_prepare_to_claim(struct block_device *bdev, void *holder,
 		const struct blk_holder_ops *hops);
 void bd_abort_claiming(struct block_device *bdev, void *holder);
 void blkdev_put(struct block_device *bdev, void *holder);
+void blkdev_handle_put(struct bdev_handle *handle);
 
 /* just for blk-cgroup, don't use elsewhere */
 struct block_device *blkdev_get_no_open(dev_t dev);
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 12:22:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 12:22:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558318.872324 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGf3A-0006iQ-Vj; Tue, 04 Jul 2023 12:22:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558318.872324; Tue, 04 Jul 2023 12:22:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGf3A-0006iF-Rc; Tue, 04 Jul 2023 12:22:32 +0000
Received: by outflank-mailman (input) for mailman id 558318;
 Tue, 04 Jul 2023 12:22:31 +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 <SRS0=fUi4=CW=suse.cz=jack@srs-se1.protection.inumbo.net>)
 id 1qGf38-0005tk-Oc
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 12:22:31 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 704f3b1d-1a65-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 14:22:27 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 0DABB20572;
 Tue,  4 Jul 2023 12:22:27 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id ABAF1139ED;
 Tue,  4 Jul 2023 12:22:26 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id KsLiKQIPpGRjMAAAMHmgww
 (envelope-from <jack@suse.cz>); Tue, 04 Jul 2023 12:22:26 +0000
Received: by quack3.suse.cz (Postfix, from userid 1000)
 id 59701A078D; Tue,  4 Jul 2023 14:22:25 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 704f3b1d-1a65-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa;
	t=1688473347; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=mjuMHjhognYm/jp+4laDSDXEVfZVsA6D5XD84KVXIlM=;
	b=IfhkJf/r3YX79abK//kvxzsfxO8GBec3aFCgZUqKe4njAdibvh5nuXvRT9veRG5W0AjJWZ
	xkZTl1aaAGPgSVyAjWvo8s6nnqwhJ0ZaLpuEG69dT5keFHsUoEFpqPkzUx9qP0BhNBbooO
	p9QUcEDucrmYuqaoHoaI7BQaQFfMU7A=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;
	s=susede2_ed25519; t=1688473347;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=mjuMHjhognYm/jp+4laDSDXEVfZVsA6D5XD84KVXIlM=;
	b=L7ND2oVd/Fq2jDo7ljy5nF8o5bZWHZeR62gf2Xk9TE6mFJugTr7RIk/BG29uxhMgM00XlI
	Bt3Mp4tdxZ9r7HCg==
From: Jan Kara <jack@suse.cz>
To: <linux-block@vger.kernel.org>
Cc: <linux-fsdevel@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@infradead.org>,
	Jan Kara <jack@suse.cz>,
	Alasdair Kergon <agk@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anna Schumaker <anna@kernel.org>,
	Chao Yu <chao@kernel.org>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Dave Kleikamp <shaggy@kernel.org>,
	David Sterba <dsterba@suse.com>,
	dm-devel@redhat.com,
	drbd-dev@lists.linbit.com,
	Gao Xiang <xiang@kernel.org>,
	Jack Wang <jinpu.wang@ionos.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	Joern Engel <joern@lazybastard.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	linux-bcache@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	linux-erofs@lists.ozlabs.org,
	linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-mm@kvack.org,
	linux-mtd@lists.infradead.org,
	linux-nfs@vger.kernel.org,
	linux-nilfs@vger.kernel.org,
	linux-nvme@lists.infradead.org,
	linux-pm@vger.kernel.org,
	linux-raid@vger.kernel.org,
	linux-s390@vger.kernel.org,
	linux-scsi@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	"Md. Haris Iqbal" <haris.iqbal@ionos.com>,
	Mike Snitzer <snitzer@kernel.org>,
	Minchan Kim <minchan@kernel.org>,
	ocfs2-devel@oss.oracle.com,
	reiserfs-devel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Song Liu <song@kernel.org>,
	Sven Schnelle <svens@linux.ibm.com>,
	target-devel@vger.kernel.org,
	Ted Tso <tytso@mit.edu>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	xen-devel@lists.xenproject.org
Subject: [PATCH 32/32] block: Rename blkdev_get_handle_by_*() and blkdev_handle_put()
Date: Tue,  4 Jul 2023 14:21:59 +0200
Message-Id: <20230704122224.16257-32-jack@suse.cz>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230629165206.383-1-jack@suse.cz>
References: <20230629165206.383-1-jack@suse.cz>
MIME-Version: 1.0
X-Developer-Signature: v=1; a=openpgp-sha256; l=52534; i=jack@suse.cz; h=from:subject; bh=V4VQzqtLPzebd9elTihpjhZGahpeEhAZnI7QsWZdPe4=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBkpA7mNc8ek6WBAiDfxElNQMWOHzv9hYYvjHN3eTqG Gc6z8KeJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZKQO5gAKCRCcnaoHP2RA2TWdB/ 4/tliM0M2A91liOZmHDiXajUGkW4GFvo5u3EtWLBTnoITi1cexbp98BuZsmF37Cwcua38PpwNGdNvC LjevVeWqas0lSaFPJpuEMGUAzkFn4nUF9yXneLyjoILCiV1OdKQNkZRO/tJaC8ntEgkrITOiw/+Z+s 7BqpGpN/dsEGe2ND8MR1y/Zxq99oQJfHMdrtpkdg6JooqUQ7d8jiMehC0ZRkkIrhmi/l6R533RJqXL o2pkFrxgsYDkpHv/Pc7FZA3/rq2WoCPTsRqLDPl1um222jRi2sYUcgPbtMy/oAC1WeVRFT1RFUEA3V nUZ6UiuuDjVfhIUnPyhZWutX8t6+Xs
X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C
Content-Transfer-Encoding: 8bit

Now that everybody is converted, we can rename blkdev_get_handle_by_*()
and blkdev_handle_put() back to their original names. No functional
change.

Done by Coccinelle patch:

@@
expression dev, mode, holder, hops;
@@
-	blkdev_get_handle_by_dev(dev, mode, holder, hops)
+	blkdev_get_by_dev(dev, mode, holder, hops)

@@
expression path, mode, holder, hops;
@@
-	blkdev_get_handle_by_path(path, mode, holder, hops)
+	blkdev_get_by_path(path, mode, holder, hops)

@@
expression handle;
@@
-	blkdev_handle_put(handle)
+	blkdev_put(handle)

plus manual updates of comments, strings, and function declarations itself.

CC: Alasdair Kergon <agk@redhat.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Anna Schumaker <anna@kernel.org>
CC: Chao Yu <chao@kernel.org>
CC: Christian Borntraeger <borntraeger@linux.ibm.com>
CC: Coly Li <colyli@suse.de
CC: "Darrick J. Wong" <djwong@kernel.org>
CC: Dave Kleikamp <shaggy@kernel.org>
CC: David Sterba <dsterba@suse.com>
CC: dm-devel@redhat.com
CC: drbd-dev@lists.linbit.com
CC: Gao Xiang <xiang@kernel.org>
CC: Jack Wang <jinpu.wang@ionos.com>
CC: Jaegeuk Kim <jaegeuk@kernel.org>
CC: jfs-discussion@lists.sourceforge.net
CC: Joern Engel <joern@lazybastard.org>
CC: Joseph Qi <joseph.qi@linux.alibaba.com>
CC: Kent Overstreet <kent.overstreet@gmail.com>
CC: linux-bcache@vger.kernel.org
CC: linux-btrfs@vger.kernel.org
CC: linux-erofs@lists.ozlabs.org
CC: <linux-ext4@vger.kernel.org>
CC: linux-f2fs-devel@lists.sourceforge.net
CC: linux-mm@kvack.org
CC: linux-mtd@lists.infradead.org
CC: linux-nfs@vger.kernel.org
CC: linux-nilfs@vger.kernel.org
CC: linux-nvme@lists.infradead.org
CC: linux-pm@vger.kernel.org
CC: linux-raid@vger.kernel.org
CC: linux-s390@vger.kernel.org
CC: linux-scsi@vger.kernel.org
CC: linux-xfs@vger.kernel.org
CC: "Md. Haris Iqbal" <haris.iqbal@ionos.com>
CC: Mike Snitzer <snitzer@kernel.org>
CC: Minchan Kim <minchan@kernel.org>
CC: ocfs2-devel@oss.oracle.com
CC: reiserfs-devel@vger.kernel.org
CC: Sergey Senozhatsky <senozhatsky@chromium.org>
CC: Song Liu <song@kernel.org>
CC: Sven Schnelle <svens@linux.ibm.com>
CC: target-devel@vger.kernel.org
CC: Ted Tso <tytso@mit.edu>
CC: Trond Myklebust <trond.myklebust@hammerspace.com>
CC: xen-devel@lists.xenproject.org
Signed-off-by: Jan Kara <jack@suse.cz>
---
 block/bdev.c                        | 24 +++++++++---------
 block/fops.c                        |  6 ++---
 block/genhd.c                       |  6 ++---
 block/ioctl.c                       |  4 +--
 drivers/block/drbd/drbd_nl.c        | 10 ++++----
 drivers/block/pktcdvd.c             | 18 +++++++-------
 drivers/block/rnbd/rnbd-srv.c       |  7 +++---
 drivers/block/xen-blkback/xenbus.c  |  7 +++---
 drivers/block/zram/zram_drv.c       |  9 ++++---
 drivers/md/bcache/super.c           | 23 ++++++++---------
 drivers/md/dm.c                     |  6 ++---
 drivers/md/md.c                     | 11 +++++----
 drivers/mtd/devices/block2mtd.c     |  7 +++---
 drivers/nvme/target/io-cmd-bdev.c   |  7 +++---
 drivers/s390/block/dasd_genhd.c     | 20 +++++++--------
 drivers/target/target_core_iblock.c |  8 +++---
 drivers/target/target_core_pscsi.c  | 11 +++++----
 fs/btrfs/dev-replace.c              |  6 ++---
 fs/btrfs/ioctl.c                    |  4 +--
 fs/btrfs/volumes.c                  | 31 ++++++++++++-----------
 fs/erofs/super.c                    |  6 ++---
 fs/ext4/super.c                     |  8 +++---
 fs/f2fs/super.c                     | 15 +++++++-----
 fs/jfs/jfs_logmgr.c                 |  9 ++++---
 fs/nfs/blocklayout/dev.c            | 13 +++++-----
 fs/nilfs2/super.c                   |  8 +++---
 fs/ocfs2/cluster/heartbeat.c        | 10 ++++----
 fs/reiserfs/journal.c               | 10 ++++----
 fs/super.c                          | 38 ++++++++++++++---------------
 fs/xfs/xfs_super.c                  |  6 ++---
 include/linux/blkdev.h              |  8 +++---
 kernel/power/swap.c                 | 15 ++++++------
 mm/swapfile.c                       |  9 ++++---
 33 files changed, 194 insertions(+), 186 deletions(-)

diff --git a/block/bdev.c b/block/bdev.c
index 0423495fe5ac..523ea7289834 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -746,7 +746,7 @@ void blkdev_put_no_open(struct block_device *bdev)
 }
 	
 /**
- * blkdev_get_handle_by_dev - open a block device by device number
+ * blkdev_get_by_dev - open a block device by device number
  * @dev: device number of block device to open
  * @mode: open mode (BLK_OPEN_*)
  * @holder: exclusive holder identifier
@@ -758,7 +758,7 @@ void blkdev_put_no_open(struct block_device *bdev)
  *
  * Use this interface ONLY if you really do not have anything better - i.e. when
  * you are behind a truly sucky interface and all you are given is a device
- * number.  Everything else should use blkdev_get_handle_by_path().
+ * number.  Everything else should use blkdev_get_by_path().
  *
  * CONTEXT:
  * Might sleep.
@@ -767,8 +767,8 @@ void blkdev_put_no_open(struct block_device *bdev)
  * Handle with a reference to the block_device on success, ERR_PTR(-errno) on
  * failure.
  */
-struct bdev_handle *blkdev_get_handle_by_dev(dev_t dev, blk_mode_t mode,
-		void *holder, const struct blk_holder_ops *hops)
+struct bdev_handle *blkdev_get_by_dev(dev_t dev, blk_mode_t mode, void *holder,
+				      const struct blk_holder_ops *hops)
 {
 	struct bdev_handle *handle = kmalloc(sizeof(struct bdev_handle),
 					     GFP_KERNEL);
@@ -856,10 +856,10 @@ struct bdev_handle *blkdev_get_handle_by_dev(dev_t dev, blk_mode_t mode,
 	kfree(handle);
 	return ERR_PTR(ret);
 }
-EXPORT_SYMBOL(blkdev_get_handle_by_dev);
+EXPORT_SYMBOL(blkdev_get_by_dev);
 
 /**
- * blkdev_get_handle_by_path - open a block device by name
+ * blkdev_get_by_path - open a block device by name
  * @path: path to the block device to open
  * @mode: open mode (BLK_OPEN_*)
  * @holder: exclusive holder identifier
@@ -876,7 +876,7 @@ EXPORT_SYMBOL(blkdev_get_handle_by_dev);
  * Handle with a reference to the block_device on success, ERR_PTR(-errno) on
  * failure.
  */
-struct bdev_handle *blkdev_get_handle_by_path(const char *path, blk_mode_t mode,
+struct bdev_handle *blkdev_get_by_path(const char *path, blk_mode_t mode,
 		void *holder, const struct blk_holder_ops *hops)
 {
 	struct bdev_handle *handle;
@@ -887,18 +887,18 @@ struct bdev_handle *blkdev_get_handle_by_path(const char *path, blk_mode_t mode,
 	if (error)
 		return ERR_PTR(error);
 
-	handle = blkdev_get_handle_by_dev(dev, mode, holder, hops);
+	handle = blkdev_get_by_dev(dev, mode, holder, hops);
 	if (!IS_ERR(handle) && (mode & BLK_OPEN_WRITE) &&
 	    bdev_read_only(handle->bdev)) {
-		blkdev_handle_put(handle);
+		blkdev_put(handle);
 		return ERR_PTR(-EACCES);
 	}
 
 	return handle;
 }
-EXPORT_SYMBOL(blkdev_get_handle_by_path);
+EXPORT_SYMBOL(blkdev_get_by_path);
 
-void blkdev_handle_put(struct bdev_handle *handle)
+void blkdev_put(struct bdev_handle *handle)
 {
 	struct block_device *bdev = handle->bdev;
 	struct gendisk *disk = bdev->bd_disk;
@@ -934,7 +934,7 @@ void blkdev_handle_put(struct bdev_handle *handle)
 	blkdev_put_no_open(bdev);
 	kfree(handle);
 }
-EXPORT_SYMBOL(blkdev_handle_put);
+EXPORT_SYMBOL(blkdev_put);
 
 /**
  * lookup_bdev() - Look up a struct block_device by name.
diff --git a/block/fops.c b/block/fops.c
index d7f3b6e67a2f..ba928b0edeb0 100644
--- a/block/fops.c
+++ b/block/fops.c
@@ -509,8 +509,8 @@ static int blkdev_open(struct inode *inode, struct file *filp)
 	filp->f_mode |= FMODE_BUF_RASYNC;
 
 	mode = file_to_blk_mode(filp);
-	handle = blkdev_get_handle_by_dev(inode->i_rdev, mode,
-			mode & BLK_OPEN_EXCL ? filp : NULL, NULL);
+	handle = blkdev_get_by_dev(inode->i_rdev, mode,
+				   mode & BLK_OPEN_EXCL ? filp : NULL, NULL);
 	if (IS_ERR(handle))
 		return PTR_ERR(handle);
 
@@ -527,7 +527,7 @@ static int blkdev_open(struct inode *inode, struct file *filp)
 
 static int blkdev_release(struct inode *inode, struct file *filp)
 {
-	blkdev_handle_put(filp->private_data);
+	blkdev_put(filp->private_data);
 	return 0;
 }
 
diff --git a/block/genhd.c b/block/genhd.c
index d363ddb8d93a..a09fca0af308 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -366,12 +366,12 @@ int disk_scan_partitions(struct gendisk *disk, blk_mode_t mode)
 	}
 
 	set_bit(GD_NEED_PART_SCAN, &disk->state);
-	handle = blkdev_get_handle_by_dev(disk_devt(disk),
-					  mode & ~BLK_OPEN_EXCL, NULL, NULL);
+	handle = blkdev_get_by_dev(disk_devt(disk), mode & ~BLK_OPEN_EXCL, NULL,
+				   NULL);
 	if (IS_ERR(handle))
 		ret = PTR_ERR(handle);
 	else
-		blkdev_handle_put(handle);
+		blkdev_put(handle);
 
 	/*
 	 * If blkdev_get_by_dev() failed early, GD_NEED_PART_SCAN is still set,
diff --git a/block/ioctl.c b/block/ioctl.c
index 940a7b9284c4..96922830f908 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -470,11 +470,11 @@ static int blkdev_bszset(struct block_device *bdev, blk_mode_t mode,
 	if (mode & BLK_OPEN_EXCL)
 		return set_blocksize(bdev, n);
 
-	handle = blkdev_get_handle_by_dev(bdev->bd_dev, mode, &bdev, NULL);
+	handle = blkdev_get_by_dev(bdev->bd_dev, mode, &bdev, NULL);
 	if (IS_ERR(handle))
 		return -EBUSY;
 	ret = set_blocksize(bdev, n);
-	blkdev_handle_put(handle);
+	blkdev_put(handle);
 
 	return ret;
 }
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 4a436a428e12..1f8b53468f0e 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -82,7 +82,7 @@ static atomic_t notify_genl_seq = ATOMIC_INIT(2); /* two. */
 
 DEFINE_MUTEX(notification_mutex);
 
-/* used blkdev_get_handle_by_path, to claim our meta data device(s) */
+/* used blkdev_get_by_path, to claim our meta data device(s) */
 static char *drbd_m_holder = "Hands off! this is DRBD's meta data device.";
 
 static void drbd_adm_send_reply(struct sk_buff *skb, struct genl_info *info)
@@ -1640,8 +1640,8 @@ static struct bdev_handle *open_backing_dev(struct drbd_device *device,
 	struct bdev_handle *handle;
 	int err = 0;
 
-	handle = blkdev_get_handle_by_path(bdev_path,
-			BLK_OPEN_READ | BLK_OPEN_WRITE, claim_ptr, NULL);
+	handle = blkdev_get_by_path(bdev_path, BLK_OPEN_READ | BLK_OPEN_WRITE,
+				    claim_ptr, NULL);
 	if (IS_ERR(handle)) {
 		drbd_err(device, "open(\"%s\") failed with %ld\n",
 				bdev_path, PTR_ERR(handle));
@@ -1653,7 +1653,7 @@ static struct bdev_handle *open_backing_dev(struct drbd_device *device,
 
 	err = bd_link_disk_holder(handle->bdev, device->vdisk);
 	if (err) {
-		blkdev_handle_put(handle);
+		blkdev_put(handle);
 		drbd_err(device, "bd_link_disk_holder(\"%s\", ...) failed with %d\n",
 				bdev_path, err);
 		handle = ERR_PTR(err);
@@ -1704,7 +1704,7 @@ static void close_backing_dev(struct drbd_device *device,
 		return;
 	if (do_bd_unlink)
 		bd_unlink_disk_holder(handle->bdev, device->vdisk);
-	blkdev_handle_put(handle);
+	blkdev_put(handle);
 }
 
 void drbd_backing_dev_free(struct drbd_device *device, struct drbd_backing_dev *ldev)
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index c50333ea9c75..924557408ed0 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2169,8 +2169,8 @@ static int pkt_open_dev(struct pktcdvd_device *pd, bool write)
 	 * to read/write from/to it. It is already opened in O_NONBLOCK mode
 	 * so open should not fail.
 	 */
-	bdev_handle = blkdev_get_handle_by_dev(pd->bdev_handle->bdev->bd_dev,
-					       BLK_OPEN_READ, pd, NULL);
+	bdev_handle = blkdev_get_by_dev(pd->bdev_handle->bdev->bd_dev,
+					BLK_OPEN_READ, pd, NULL);
 	if (IS_ERR(bdev_handle)) {
 		ret = PTR_ERR(bdev_handle);
 		goto out;
@@ -2218,7 +2218,7 @@ static int pkt_open_dev(struct pktcdvd_device *pd, bool write)
 	return 0;
 
 out_putdev:
-	blkdev_handle_put(bdev_handle);
+	blkdev_put(bdev_handle);
 out:
 	return ret;
 }
@@ -2237,7 +2237,7 @@ static void pkt_release_dev(struct pktcdvd_device *pd, int flush)
 	pkt_lock_door(pd, 0);
 
 	pkt_set_speed(pd, MAX_SPEED, MAX_SPEED);
-	blkdev_handle_put(pd->open_bdev_handle);
+	blkdev_put(pd->open_bdev_handle);
 	pd->open_bdev_handle = NULL;
 
 	pkt_shrink_pktlist(pd);
@@ -2519,13 +2519,13 @@ static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev)
 		}
 	}
 
-	bdev_handle = blkdev_get_handle_by_dev(dev,
-			BLK_OPEN_READ | BLK_OPEN_NDELAY, NULL, NULL);
+	bdev_handle = blkdev_get_by_dev(dev, BLK_OPEN_READ | BLK_OPEN_NDELAY,
+					NULL, NULL);
 	if (IS_ERR(bdev_handle))
 		return PTR_ERR(bdev_handle);
 	sdev = scsi_device_from_queue(bdev_handle->bdev->bd_disk->queue);
 	if (!sdev) {
-		blkdev_handle_put(bdev_handle);
+		blkdev_put(bdev_handle);
 		return -EINVAL;
 	}
 	put_device(&sdev->sdev_gendev);
@@ -2550,7 +2550,7 @@ static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev)
 	return 0;
 
 out_mem:
-	blkdev_handle_put(bdev_handle);
+	blkdev_put(bdev_handle);
 	/* This is safe: open() is still holding a reference. */
 	module_put(THIS_MODULE);
 	return -ENOMEM;
@@ -2757,7 +2757,7 @@ static int pkt_remove_dev(dev_t pkt_dev)
 	pkt_debugfs_dev_remove(pd);
 	pkt_sysfs_dev_remove(pd);
 
-	blkdev_handle_put(pd->bdev_handle);
+	blkdev_put(pd->bdev_handle);
 
 	remove_proc_entry(pd->disk->disk_name, pkt_proc);
 	dev_notice(ddev, "writer unmapped\n");
diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index 606db77c1238..d462d6dac297 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -219,7 +219,7 @@ void rnbd_destroy_sess_dev(struct rnbd_srv_sess_dev *sess_dev, bool keep_id)
 	rnbd_put_sess_dev(sess_dev);
 	wait_for_completion(&dc); /* wait for inflights to drop to zero */
 
-	blkdev_handle_put(sess_dev->bdev_handle);
+	blkdev_put(sess_dev->bdev_handle);
 	mutex_lock(&sess_dev->dev->lock);
 	list_del(&sess_dev->dev_list);
 	if (!sess_dev->readonly)
@@ -714,8 +714,7 @@ static int process_msg_open(struct rnbd_srv_session *srv_sess,
 		goto reject;
 	}
 
-	bdev_handle = blkdev_get_handle_by_path(full_path, open_flags, NULL,
-						NULL);
+	bdev_handle = blkdev_get_by_path(full_path, open_flags, NULL, NULL);
 	if (IS_ERR(bdev_handle)) {
 		ret = PTR_ERR(bdev_handle);
 		pr_err("Opening device '%s' on session %s failed, failed to open the block device, err: %d\n",
@@ -792,7 +791,7 @@ static int process_msg_open(struct rnbd_srv_session *srv_sess,
 	}
 	rnbd_put_srv_dev(srv_dev);
 blkdev_put:
-	blkdev_handle_put(bdev_handle);
+	blkdev_put(bdev_handle);
 free_path:
 	kfree(full_path);
 reject:
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index b67d28584c72..c28b31872e5a 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -474,7 +474,7 @@ static void xenvbd_sysfs_delif(struct xenbus_device *dev)
 static void xen_vbd_free(struct xen_vbd *vbd)
 {
 	if (vbd->bdev_handle)
-		blkdev_handle_put(vbd->bdev_handle);
+		blkdev_put(vbd->bdev_handle);
 	vbd->bdev_handle = NULL;
 }
 
@@ -492,8 +492,9 @@ static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle,
 
 	vbd->pdevice  = MKDEV(major, minor);
 
-	bdev_handle = blkdev_get_handle_by_dev(vbd->pdevice, vbd->readonly ?
-				 BLK_OPEN_READ : BLK_OPEN_WRITE, NULL, NULL);
+	bdev_handle = blkdev_get_by_dev(vbd->pdevice,
+					vbd->readonly ? BLK_OPEN_READ : BLK_OPEN_WRITE,
+					NULL, NULL);
 
 	if (IS_ERR(bdev_handle)) {
 		pr_warn("xen_vbd_create: device %08x could not be opened\n",
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 987e4885956e..284f433bf5e9 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -417,7 +417,7 @@ static void reset_bdev(struct zram *zram)
 	if (!zram->backing_dev)
 		return;
 
-	blkdev_handle_put(zram->bdev_handle);
+	blkdev_put(zram->bdev_handle);
 	/* hope filp_close flush all of IO */
 	filp_close(zram->backing_dev, NULL);
 	zram->backing_dev = NULL;
@@ -504,8 +504,9 @@ static ssize_t backing_dev_store(struct device *dev,
 		goto out;
 	}
 
-	bdev_handle = blkdev_get_handle_by_dev(inode->i_rdev,
-				BLK_OPEN_READ | BLK_OPEN_WRITE, zram, NULL);
+	bdev_handle = blkdev_get_by_dev(inode->i_rdev,
+					BLK_OPEN_READ | BLK_OPEN_WRITE, zram,
+					NULL);
 	if (IS_ERR(bdev_handle)) {
 		err = PTR_ERR(bdev_handle);
 		bdev_handle = NULL;
@@ -536,7 +537,7 @@ static ssize_t backing_dev_store(struct device *dev,
 	kvfree(bitmap);
 
 	if (bdev_handle)
-		blkdev_handle_put(bdev_handle);
+		blkdev_put(bdev_handle);
 
 	if (backing_dev)
 		filp_close(backing_dev, NULL);
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 2b3f35fd7477..c6b6b140f3e8 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1369,7 +1369,7 @@ static void cached_dev_free(struct closure *cl)
 		put_page(virt_to_page(dc->sb_disk));
 
 	if (dc->bdev_handle)
-		blkdev_handle_put(dc->bdev_handle);
+		blkdev_put(dc->bdev_handle);
 
 	wake_up(&unregister_wait);
 
@@ -2218,7 +2218,7 @@ void bch_cache_release(struct kobject *kobj)
 		put_page(virt_to_page(ca->sb_disk));
 
 	if (ca->bdev_handle)
-		blkdev_handle_put(ca->bdev_handle);
+		blkdev_put(ca->bdev_handle);
 
 	kfree(ca);
 	module_put(THIS_MODULE);
@@ -2357,10 +2357,10 @@ static int register_cache(struct cache_sb *sb, struct cache_sb_disk *sb_disk,
 		/*
 		 * If we failed here, it means ca->kobj is not initialized yet,
 		 * kobject_put() won't be called and there is no chance to
-		 * call blkdev_handle_put() to bdev in bch_cache_release(). So
-		 * we explicitly call blkdev_handle_put() here.
+		 * call blkdev_put() to bdev in bch_cache_release(). So we
+		 * explicitly call blkdev_put() here.
 		 */
-		blkdev_handle_put(bdev_handle);
+		blkdev_put(bdev_handle);
 		if (ret == -ENOMEM)
 			err = "cache_alloc(): -ENOMEM";
 		else if (ret == -EPERM)
@@ -2551,8 +2551,8 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
 
 	ret = -EINVAL;
 	err = "failed to open device";
-	bdev_handle = blkdev_get_handle_by_path(strim(path), BLK_OPEN_READ,
-						NULL, NULL);
+	bdev_handle = blkdev_get_by_path(strim(path), BLK_OPEN_READ, NULL,
+					 NULL);
 	if (IS_ERR(bdev_handle))
 		goto out_free_sb;
 
@@ -2572,9 +2572,10 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
 	}
 
 	/* Now reopen in exclusive mode with proper holder */
-	bdev_handle2 = blkdev_get_handle_by_dev(bdev_handle->bdev->bd_dev,
-			BLK_OPEN_READ | BLK_OPEN_WRITE, holder, NULL);
-	blkdev_handle_put(bdev_handle);
+	bdev_handle2 = blkdev_get_by_dev(bdev_handle->bdev->bd_dev,
+					 BLK_OPEN_READ | BLK_OPEN_WRITE,
+					 holder, NULL);
+	blkdev_put(bdev_handle);
 	bdev_handle = bdev_handle2;
 	if (IS_ERR(bdev_handle)) {
 		ret = PTR_ERR(bdev_handle);
@@ -2646,7 +2647,7 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
 	put_page(virt_to_page(sb_disk));
 out_blkdev_put:
 	if (bdev_handle)
-		blkdev_handle_put(bdev_handle);
+		blkdev_put(bdev_handle);
 out_free_sb:
 	kfree(sb);
 out_free_path:
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index d73905149bef..018ae5802efb 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -751,7 +751,7 @@ static struct table_device *open_table_device(struct mapped_device *md,
 		return ERR_PTR(-ENOMEM);
 	refcount_set(&td->count, 1);
 
-	bdev_handle = blkdev_get_handle_by_dev(dev, mode, _dm_claim_ptr, NULL);
+	bdev_handle = blkdev_get_by_dev(dev, mode, _dm_claim_ptr, NULL);
 	if (IS_ERR(bdev_handle)) {
 		r = PTR_ERR(bdev_handle);
 		goto out_free_td;
@@ -778,7 +778,7 @@ static struct table_device *open_table_device(struct mapped_device *md,
 	return td;
 
 out_blkdev_put:
-	blkdev_handle_put(bdev_handle);
+	blkdev_put(bdev_handle);
 out_free_td:
 	kfree(td);
 	return ERR_PTR(r);
@@ -791,7 +791,7 @@ static void close_table_device(struct table_device *td, struct mapped_device *md
 {
 	if (md->disk->slave_dir)
 		bd_unlink_disk_holder(td->dm_dev.bdev, md->disk);
-	blkdev_handle_put(td->dm_dev.bdev_handle);
+	blkdev_put(td->dm_dev.bdev_handle);
 	put_dax(td->dm_dev.dax_dev);
 	list_del(&td->list);
 	kfree(td);
diff --git a/drivers/md/md.c b/drivers/md/md.c
index bed142ee6f1f..595aeb6cc766 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2458,7 +2458,7 @@ static void export_rdev(struct md_rdev *rdev, struct mddev *mddev)
 	if (test_bit(AutoDetected, &rdev->flags))
 		md_autodetect_dev(rdev->bdev->bd_dev);
 #endif
-	blkdev_handle_put(rdev->bdev_handle);
+	blkdev_put(rdev->bdev_handle);
 	rdev->bdev = NULL;
 	kobject_put(&rdev->kobj);
 }
@@ -3654,9 +3654,10 @@ static struct md_rdev *md_import_device(dev_t newdev, int super_format, int supe
 	if (err)
 		goto out_clear_rdev;
 
-	rdev->bdev_handle = blkdev_get_handle_by_dev(newdev,
-			BLK_OPEN_READ | BLK_OPEN_WRITE,
-			super_format == -2 ? &claim_rdev : rdev, NULL);
+	rdev->bdev_handle = blkdev_get_by_dev(newdev,
+					      BLK_OPEN_READ | BLK_OPEN_WRITE,
+					      super_format == -2 ? &claim_rdev : rdev,
+					      NULL);
 	if (IS_ERR(rdev->bdev_handle)) {
 		pr_warn("md: could not open device unknown-block(%u,%u).\n",
 			MAJOR(newdev), MINOR(newdev));
@@ -3694,7 +3695,7 @@ static struct md_rdev *md_import_device(dev_t newdev, int super_format, int supe
 	return rdev;
 
 out_blkdev_put:
-	blkdev_handle_put(rdev->bdev_handle);
+	blkdev_put(rdev->bdev_handle);
 out_clear_rdev:
 	md_rdev_clear(rdev);
 out_free_rdev:
diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
index 1614459297d2..385d34096031 100644
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -213,7 +213,7 @@ static void block2mtd_free_device(struct block2mtd_dev *dev)
 	if (dev->bdev_handle) {
 		invalidate_mapping_pages(
 			dev->bdev_handle->bdev->bd_inode->i_mapping, 0, -1);
-		blkdev_handle_put(dev->bdev_handle);
+		blkdev_put(dev->bdev_handle);
 	}
 
 	kfree(dev);
@@ -253,8 +253,7 @@ static struct bdev_handle __ref *mdtblock_early_get_bdev(const char *devname,
 		wait_for_device_probe();
 
 		if (!early_lookup_bdev(devname, &devt)) {
-			bdev_handle = blkdev_get_handle_by_dev(devt, mode, dev,
-							       NULL);
+			bdev_handle = blkdev_get_by_dev(devt, mode, dev, NULL);
 			if (!IS_ERR(bdev_handle))
 				break;
 		}
@@ -280,7 +279,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size,
 		return NULL;
 
 	/* Get a handle on the device */
-	bdev_handle = blkdev_get_handle_by_path(devname, mode, dev, NULL);
+	bdev_handle = blkdev_get_by_path(devname, mode, dev, NULL);
 	if (IS_ERR(bdev_handle))
 		bdev_handle = mdtblock_early_get_bdev(devname, mode, timeout,
 						      dev);
diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd-bdev.c
index 0f177a7e3b37..3f600dad7cbb 100644
--- a/drivers/nvme/target/io-cmd-bdev.c
+++ b/drivers/nvme/target/io-cmd-bdev.c
@@ -51,7 +51,7 @@ void nvmet_bdev_set_limits(struct block_device *bdev, struct nvme_id_ns *id)
 void nvmet_bdev_ns_disable(struct nvmet_ns *ns)
 {
 	if (ns->bdev_handle) {
-		blkdev_handle_put(ns->bdev_handle);
+		blkdev_put(ns->bdev_handle);
 		ns->bdev = NULL;
 		ns->bdev_handle = NULL;
 	}
@@ -85,8 +85,9 @@ int nvmet_bdev_ns_enable(struct nvmet_ns *ns)
 	if (ns->buffered_io)
 		return -ENOTBLK;
 
-	ns->bdev_handle = blkdev_get_handle_by_path(ns->device_path,
-				BLK_OPEN_READ | BLK_OPEN_WRITE, NULL, NULL);
+	ns->bdev_handle = blkdev_get_by_path(ns->device_path,
+					     BLK_OPEN_READ | BLK_OPEN_WRITE,
+					     NULL, NULL);
 	if (IS_ERR(ns->bdev_handle)) {
 		ret = PTR_ERR(ns->bdev_handle);
 		if (ret != -ENOTBLK) {
diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c
index 1c22a5ee2ce7..13af36180372 100644
--- a/drivers/s390/block/dasd_genhd.c
+++ b/drivers/s390/block/dasd_genhd.c
@@ -130,8 +130,8 @@ int dasd_scan_partitions(struct dasd_block *block)
 	struct bdev_handle *bdev_handle;
 	int rc;
 
-	bdev_handle = blkdev_get_handle_by_dev(disk_devt(block->gdp),
-				BLK_OPEN_READ, NULL, NULL);
+	bdev_handle = blkdev_get_by_dev(disk_devt(block->gdp), BLK_OPEN_READ,
+					NULL, NULL);
 	if (IS_ERR(bdev_handle)) {
 		DBF_DEV_EVENT(DBF_ERR, block->base,
 			      "scan partitions error, blkdev_get returned %ld",
@@ -147,13 +147,13 @@ int dasd_scan_partitions(struct dasd_block *block)
 				"scan partitions error, rc %d", rc);
 
 	/*
-	 * Since the matching blkdev_handle_put() call to the
-	 * blkdev_get_handle_by_path() in this function is not called before
-	 * dasd_destroy_partitions the offline open_count limit needs to be
-	 * increased from 0 to 1. This is done by setting device->bdev_handle
-	 * (see dasd_generic_set_offline). As long as the partition detection
-	 * is running no offline should be allowed. That is why the assignment
-	 * to block->bdev_handle is done AFTER the BLKRRPART ioctl.
+	 * Since the matching blkdev_put() call to the blkdev_get_by_path() in
+	 * this function is not called before dasd_destroy_partitions the
+	 * offline open_count limit needs to be increased from 0 to 1. This is
+	 * done by setting device->bdev_handle (see dasd_generic_set_offline).
+	 * As long as the partition detection is running no offline should be
+	 * allowed. That is why the assignment to block->bdev_handle is done
+	 * AFTER the BLKRRPART ioctl.
 	 */
 	block->bdev_handle = bdev_handle;
 	return 0;
@@ -179,7 +179,7 @@ void dasd_destroy_partitions(struct dasd_block *block)
 	mutex_unlock(&bdev_handle->bdev->bd_disk->open_mutex);
 
 	/* Matching blkdev_put to the blkdev_get in dasd_scan_partitions. */
-	blkdev_handle_put(bdev_handle);
+	blkdev_put(bdev_handle);
 }
 
 int dasd_gendisk_init(void)
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 979b0cfbea4a..d271a536d66f 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -117,8 +117,8 @@ static int iblock_configure_device(struct se_device *dev)
 	else
 		dev->dev_flags |= DF_READ_ONLY;
 
-	bdev_handle = blkdev_get_handle_by_path(ib_dev->ibd_udev_path, mode,
-				ib_dev, NULL);
+	bdev_handle = blkdev_get_by_path(ib_dev->ibd_udev_path, mode, ib_dev,
+					 NULL);
 	if (IS_ERR(bdev_handle)) {
 		ret = PTR_ERR(bdev_handle);
 		goto out_free_bioset;
@@ -180,7 +180,7 @@ static int iblock_configure_device(struct se_device *dev)
 	return 0;
 
 out_blkdev_put:
-	blkdev_handle_put(ib_dev->ibd_bdev_handle);
+	blkdev_put(ib_dev->ibd_bdev_handle);
 out_free_bioset:
 	bioset_exit(&ib_dev->ibd_bio_set);
 out:
@@ -206,7 +206,7 @@ static void iblock_destroy_device(struct se_device *dev)
 	struct iblock_dev *ib_dev = IBLOCK_DEV(dev);
 
 	if (ib_dev->ibd_bdev_handle)
-		blkdev_handle_put(ib_dev->ibd_bdev_handle);
+		blkdev_put(ib_dev->ibd_bdev_handle);
 	bioset_exit(&ib_dev->ibd_bio_set);
 }
 
diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c
index 9ea2b29e95bf..38416426707f 100644
--- a/drivers/target/target_core_pscsi.c
+++ b/drivers/target/target_core_pscsi.c
@@ -366,10 +366,11 @@ static int pscsi_create_type_disk(struct se_device *dev, struct scsi_device *sd)
 	 * Claim exclusive struct block_device access to struct scsi_device
 	 * for TYPE_DISK and TYPE_ZBC using supplied udev_path
 	 */
-	bdev_handle = blkdev_get_handle_by_path(dev->udev_path,
-				BLK_OPEN_WRITE | BLK_OPEN_READ, pdv, NULL);
+	bdev_handle = blkdev_get_by_path(dev->udev_path,
+					 BLK_OPEN_WRITE | BLK_OPEN_READ, pdv,
+					 NULL);
 	if (IS_ERR(bdev_handle)) {
-		pr_err("pSCSI: blkdev_get_handle_by_path() failed\n");
+		pr_err("pSCSI: blkdev_get_by_path() failed\n");
 		scsi_device_put(sd);
 		return PTR_ERR(bdev_handle);
 	}
@@ -377,7 +378,7 @@ static int pscsi_create_type_disk(struct se_device *dev, struct scsi_device *sd)
 
 	ret = pscsi_add_device_to_list(dev, sd);
 	if (ret) {
-		blkdev_handle_put(bdev_handle);
+		blkdev_put(bdev_handle);
 		scsi_device_put(sd);
 		return ret;
 	}
@@ -565,7 +566,7 @@ static void pscsi_destroy_device(struct se_device *dev)
 		 */
 		if ((sd->type == TYPE_DISK || sd->type == TYPE_ZBC) &&
 		    pdv->pdv_bdev_handle) {
-			blkdev_handle_put(pdv->pdv_bdev_handle);
+			blkdev_put(pdv->pdv_bdev_handle);
 			pdv->pdv_bdev_handle = NULL;
 		}
 		/*
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c
index 639eaecf1036..9842d777db76 100644
--- a/fs/btrfs/dev-replace.c
+++ b/fs/btrfs/dev-replace.c
@@ -258,8 +258,8 @@ static int btrfs_init_dev_replace_tgtdev(struct btrfs_fs_info *fs_info,
 		return -EINVAL;
 	}
 
-	bdev_handle = blkdev_get_handle_by_path(device_path, BLK_OPEN_WRITE,
-				fs_info->bdev_holder, NULL);
+	bdev_handle = blkdev_get_by_path(device_path, BLK_OPEN_WRITE,
+					 fs_info->bdev_holder, NULL);
 	if (IS_ERR(bdev_handle)) {
 		btrfs_err(fs_info, "target device %s is invalid!", device_path);
 		return PTR_ERR(bdev_handle);
@@ -336,7 +336,7 @@ static int btrfs_init_dev_replace_tgtdev(struct btrfs_fs_info *fs_info,
 	return 0;
 
 error:
-	blkdev_handle_put(bdev_handle);
+	blkdev_put(bdev_handle);
 	return ret;
 }
 
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 7d8f5625ad70..92aaba3e6948 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -2722,7 +2722,7 @@ static long btrfs_ioctl_rm_dev_v2(struct file *file, void __user *arg)
 err_drop:
 	mnt_drop_write_file(file);
 	if (bdev_handle)
-		blkdev_handle_put(bdev_handle);
+		blkdev_put(bdev_handle);
 out:
 	btrfs_put_dev_args_from_path(&args);
 	kfree(vol_args);
@@ -2770,7 +2770,7 @@ static long btrfs_ioctl_rm_dev(struct file *file, void __user *arg)
 
 	mnt_drop_write_file(file);
 	if (bdev_handle)
-		blkdev_handle_put(bdev_handle);
+		blkdev_put(bdev_handle);
 out:
 	btrfs_put_dev_args_from_path(&args);
 	kfree(vol_args);
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index db63b0be5405..fb7082426498 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -517,8 +517,7 @@ btrfs_get_bdev_and_sb(const char *device_path, blk_mode_t flags, void *holder,
 	struct block_device *bdev;
 	int ret;
 
-	*bdev_handle = blkdev_get_handle_by_path(device_path, flags, holder,
-						 NULL);
+	*bdev_handle = blkdev_get_by_path(device_path, flags, holder, NULL);
 
 	if (IS_ERR(*bdev_handle)) {
 		ret = PTR_ERR(*bdev_handle);
@@ -530,14 +529,14 @@ btrfs_get_bdev_and_sb(const char *device_path, blk_mode_t flags, void *holder,
 		sync_blockdev(bdev);
 	ret = set_blocksize(bdev, BTRFS_BDEV_BLOCKSIZE);
 	if (ret) {
-		blkdev_handle_put(*bdev_handle);
+		blkdev_put(*bdev_handle);
 		goto error;
 	}
 	invalidate_bdev(bdev);
 	*disk_super = btrfs_read_dev_super(bdev);
 	if (IS_ERR(*disk_super)) {
 		ret = PTR_ERR(*disk_super);
-		blkdev_handle_put(*bdev_handle);
+		blkdev_put(*bdev_handle);
 		goto error;
 	}
 
@@ -679,7 +678,7 @@ static int btrfs_open_one_device(struct btrfs_fs_devices *fs_devices,
 
 error_free_page:
 	btrfs_release_disk_super(disk_super);
-	blkdev_handle_put(bdev_handle);
+	blkdev_put(bdev_handle);
 
 	return -EINVAL;
 }
@@ -1070,7 +1069,7 @@ static void __btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices,
 			continue;
 
 		if (device->bdev_handle) {
-			blkdev_handle_put(device->bdev_handle);
+			blkdev_put(device->bdev_handle);
 			device->bdev = NULL;
 			device->bdev_handle = NULL;
 			fs_devices->open_devices--;
@@ -1117,7 +1116,7 @@ static void btrfs_close_bdev(struct btrfs_device *device)
 		invalidate_bdev(device->bdev);
 	}
 
-	blkdev_handle_put(device->bdev_handle);
+	blkdev_put(device->bdev_handle);
 }
 
 static void btrfs_close_one_device(struct btrfs_device *device)
@@ -1388,7 +1387,7 @@ struct btrfs_device *btrfs_scan_one_device(const char *path, blk_mode_t flags)
 	 * values temporarily, as the device paths of the fsid are the only
 	 * required information for assembling the volume.
 	 */
-	bdev_handle = blkdev_get_handle_by_path(path, flags, NULL, NULL);
+	bdev_handle = blkdev_get_by_path(path, flags, NULL, NULL);
 	if (IS_ERR(bdev_handle))
 		return ERR_CAST(bdev_handle);
 
@@ -1413,7 +1412,7 @@ struct btrfs_device *btrfs_scan_one_device(const char *path, blk_mode_t flags)
 	btrfs_release_disk_super(disk_super);
 
 error_bdev_put:
-	blkdev_handle_put(bdev_handle);
+	blkdev_put(bdev_handle);
 
 	return device;
 }
@@ -2225,9 +2224,9 @@ int btrfs_rm_device(struct btrfs_fs_info *fs_info,
 	 * free the device.
 	 *
 	 * We cannot call btrfs_close_bdev() here because we're holding the sb
-	 * write lock, and blkdev_handle_put() will pull in the ->open_mutex on
-	 * the block device and it's dependencies.  Instead just flush the
-	 * device and let the caller do the final blkdev_handle_put.
+	 * write lock, and blkdev_put() will pull in the ->open_mutex on the
+	 * block device and it's dependencies.  Instead just flush the device
+	 * and let the caller do the final blkdev_put.
 	 */
 	if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) {
 		btrfs_scratch_superblocks(fs_info, device->bdev,
@@ -2406,7 +2405,7 @@ int btrfs_get_dev_args_from_path(struct btrfs_fs_info *fs_info,
 	else
 		memcpy(args->fsid, disk_super->fsid, BTRFS_FSID_SIZE);
 	btrfs_release_disk_super(disk_super);
-	blkdev_handle_put(bdev_handle);
+	blkdev_put(bdev_handle);
 	return 0;
 }
 
@@ -2639,8 +2638,8 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
 	if (sb_rdonly(sb) && !fs_devices->seeding)
 		return -EROFS;
 
-	bdev_handle = blkdev_get_handle_by_path(device_path, BLK_OPEN_WRITE,
-						fs_info->bdev_holder, NULL);
+	bdev_handle = blkdev_get_by_path(device_path, BLK_OPEN_WRITE,
+					 fs_info->bdev_holder, NULL);
 	if (IS_ERR(bdev_handle))
 		return PTR_ERR(bdev_handle);
 
@@ -2860,7 +2859,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
 error_free_device:
 	btrfs_free_device(device);
 error:
-	blkdev_handle_put(bdev_handle);
+	blkdev_put(bdev_handle);
 	if (locked) {
 		mutex_unlock(&uuid_mutex);
 		up_write(&sb->s_umount);
diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index a4742cc05f95..60d6b43ae5e3 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -254,8 +254,8 @@ static int erofs_init_device(struct erofs_buf *buf, struct super_block *sb,
 			return PTR_ERR(fscache);
 		dif->fscache = fscache;
 	} else if (!sbi->devs->flatdev) {
-		bdev_handle = blkdev_get_handle_by_path(dif->path,
-				BLK_OPEN_READ, sb->s_type, NULL);
+		bdev_handle = blkdev_get_by_path(dif->path, BLK_OPEN_READ,
+						 sb->s_type, NULL);
 		if (IS_ERR(bdev_handle))
 			return PTR_ERR(bdev_handle);
 		dif->bdev_handle = bdev_handle;
@@ -816,7 +816,7 @@ static int erofs_release_device_info(int id, void *ptr, void *data)
 
 	fs_put_dax(dif->dax_dev, NULL);
 	if (dif->bdev_handle)
-		blkdev_handle_put(dif->bdev_handle);
+		blkdev_put(dif->bdev_handle);
 	erofs_fscache_unregister_cookie(dif->fscache);
 	dif->fscache = NULL;
 	kfree(dif->path);
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index a3b982d6abf1..cbeb8a555fe3 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1112,8 +1112,8 @@ static struct bdev_handle *ext4_blkdev_get(dev_t dev, struct super_block *sb)
 {
 	struct bdev_handle *handle;
 
-	handle = blkdev_get_handle_by_dev(dev, BLK_OPEN_READ | BLK_OPEN_WRITE,
-					  sb, &ext4_holder_ops);
+	handle = blkdev_get_by_dev(dev, BLK_OPEN_READ | BLK_OPEN_WRITE, sb,
+				   &ext4_holder_ops);
 	if (IS_ERR(handle))
 		goto fail;
 	return handle;
@@ -1137,7 +1137,7 @@ static void ext4_blkdev_remove(struct ext4_sb_info *sbi)
 		 * hotswapped, and it breaks the `ro-after' testing code.
 		 */
 		invalidate_bdev(sbi->s_journal_bdev_handle->bdev);
-		blkdev_handle_put(sbi->s_journal_bdev_handle);
+		blkdev_put(sbi->s_journal_bdev_handle);
 		sbi->s_journal_bdev_handle = NULL;
 	}
 }
@@ -5928,7 +5928,7 @@ static journal_t *ext4_get_dev_journal(struct super_block *sb,
 out_journal:
 	jbd2_journal_destroy(journal);
 out_bdev:
-	blkdev_handle_put(bdev_handle);
+	blkdev_put(bdev_handle);
 	return NULL;
 }
 
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 570364954578..2823f3eb36c7 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1538,7 +1538,7 @@ static void destroy_device_list(struct f2fs_sb_info *sbi)
 	int i;
 
 	for (i = 0; i < sbi->s_ndevs; i++) {
-		blkdev_handle_put(FDEV(i).bdev_handle);
+		blkdev_put(FDEV(i).bdev_handle);
 #ifdef CONFIG_BLK_DEV_ZONED
 		kvfree(FDEV(i).blkz_seq);
 #endif
@@ -4024,9 +4024,10 @@ static int f2fs_scan_devices(struct f2fs_sb_info *sbi)
 
 		if (max_devices == 1) {
 			/* Single zoned block device mount */
-			FDEV(0).bdev_handle = blkdev_get_handle_by_dev(
-					sbi->sb->s_bdev->bd_dev,
-					mode, sbi->sb->s_type, NULL);
+			FDEV(0).bdev_handle = blkdev_get_by_dev(sbi->sb->s_bdev->bd_dev,
+								mode,
+								sbi->sb->s_type,
+								NULL);
 		} else {
 			/* Multi-device mount */
 			memcpy(FDEV(i).path, RDEV(i).path, MAX_PATH_LEN);
@@ -4044,8 +4045,10 @@ static int f2fs_scan_devices(struct f2fs_sb_info *sbi)
 					(FDEV(i).total_segments <<
 					sbi->log_blocks_per_seg) - 1;
 			}
-			FDEV(i).bdev_handle = blkdev_get_handle_by_path(
-				FDEV(i).path, mode, sbi->sb->s_type, NULL);
+			FDEV(i).bdev_handle = blkdev_get_by_path(FDEV(i).path,
+								 mode,
+								 sbi->sb->s_type,
+								 NULL);
 		}
 		if (IS_ERR(FDEV(i).bdev_handle))
 			return PTR_ERR(FDEV(i).bdev_handle);
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c
index 9d06323261e6..4f5171f24191 100644
--- a/fs/jfs/jfs_logmgr.c
+++ b/fs/jfs/jfs_logmgr.c
@@ -1100,8 +1100,9 @@ int lmLogOpen(struct super_block *sb)
 	 * file systems to log may have n-to-1 relationship;
 	 */
 
-	bdev_handle = blkdev_get_handle_by_dev(sbi->logdev,
-			BLK_OPEN_READ | BLK_OPEN_WRITE, log, NULL);
+	bdev_handle = blkdev_get_by_dev(sbi->logdev,
+					BLK_OPEN_READ | BLK_OPEN_WRITE, log,
+					NULL);
 	if (IS_ERR(bdev_handle)) {
 		rc = PTR_ERR(bdev_handle);
 		goto free;
@@ -1141,7 +1142,7 @@ int lmLogOpen(struct super_block *sb)
 	lbmLogShutdown(log);
 
       close:		/* close external log device */
-	blkdev_handle_put(bdev_handle);
+	blkdev_put(bdev_handle);
 
       free:		/* free log descriptor */
 	mutex_unlock(&jfs_log_mutex);
@@ -1485,7 +1486,7 @@ int lmLogClose(struct super_block *sb)
 	bdev_handle = log->bdev_handle;
 	rc = lmLogShutdown(log);
 
-	blkdev_handle_put(bdev_handle);
+	blkdev_put(bdev_handle);
 
 	kfree(log);
 
diff --git a/fs/nfs/blocklayout/dev.c b/fs/nfs/blocklayout/dev.c
index 549de8600beb..26d22802a6f6 100644
--- a/fs/nfs/blocklayout/dev.c
+++ b/fs/nfs/blocklayout/dev.c
@@ -35,7 +35,7 @@ bl_free_device(struct pnfs_block_dev *dev)
 		}
 
 		if (dev->bdev_handle)
-			blkdev_handle_put(dev->bdev_handle);
+			blkdev_put(dev->bdev_handle);
 	}
 }
 
@@ -243,8 +243,8 @@ bl_parse_simple(struct nfs_server *server, struct pnfs_block_dev *d,
 	if (!dev)
 		return -EIO;
 
-	bdev_handle = blkdev_get_handle_by_dev(dev,
-			BLK_OPEN_READ | BLK_OPEN_WRITE, NULL, NULL);
+	bdev_handle = blkdev_get_by_dev(dev, BLK_OPEN_READ | BLK_OPEN_WRITE,
+					NULL, NULL);
 	if (IS_ERR(bdev_handle)) {
 		printk(KERN_WARNING "pNFS: failed to open device %d:%d (%ld)\n",
 			MAJOR(dev), MINOR(dev), PTR_ERR(bdev_handle));
@@ -311,8 +311,9 @@ bl_open_path(struct pnfs_block_volume *v, const char *prefix)
 	if (!devname)
 		return ERR_PTR(-ENOMEM);
 
-	bdev_handle = blkdev_get_handle_by_path(devname,
-			BLK_OPEN_READ | BLK_OPEN_WRITE, NULL, NULL);
+	bdev_handle = blkdev_get_by_path(devname,
+					 BLK_OPEN_READ | BLK_OPEN_WRITE, NULL,
+					 NULL);
 	if (IS_ERR(bdev_handle)) {
 		pr_warn("pNFS: failed to open device %s (%ld)\n",
 			devname, PTR_ERR(bdev_handle));
@@ -373,7 +374,7 @@ bl_parse_scsi(struct nfs_server *server, struct pnfs_block_dev *d,
 	return 0;
 
 out_blkdev_put:
-	blkdev_handle_put(d->bdev_handle);
+	blkdev_put(d->bdev_handle);
 	return error;
 }
 
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index 0aba0daa06d2..310ebbcc324d 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -1304,8 +1304,8 @@ nilfs_mount(struct file_system_type *fs_type, int flags,
 	struct dentry *root_dentry;
 	int err, s_new = false;
 
-	bdev_handle = blkdev_get_handle_by_path(dev_name, sb_open_mode(flags),
-				fs_type, NULL);
+	bdev_handle = blkdev_get_by_path(dev_name, sb_open_mode(flags),
+					 fs_type, NULL);
 	if (IS_ERR(bdev_handle))
 		return ERR_CAST(bdev_handle);
 
@@ -1377,7 +1377,7 @@ nilfs_mount(struct file_system_type *fs_type, int flags,
 	}
 
 	if (!s_new)
-		blkdev_handle_put(bdev_handle);
+		blkdev_put(bdev_handle);
 
 	return root_dentry;
 
@@ -1386,7 +1386,7 @@ nilfs_mount(struct file_system_type *fs_type, int flags,
 
  failed:
 	if (!s_new)
-		blkdev_handle_put(bdev_handle);
+		blkdev_put(bdev_handle);
 	return ERR_PTR(err);
 }
 
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index 5509e7fb98db..c9f76d6cd796 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -1510,7 +1510,7 @@ static void o2hb_region_release(struct config_item *item)
 	}
 
 	if (reg->hr_bdev_handle)
-		blkdev_handle_put(reg->hr_bdev_handle);
+		blkdev_put(reg->hr_bdev_handle);
 
 	kfree(reg->hr_slots);
 
@@ -1795,9 +1795,9 @@ static ssize_t o2hb_region_dev_store(struct config_item *item,
 	if (!S_ISBLK(f.file->f_mapping->host->i_mode))
 		goto out2;
 
-	reg->hr_bdev_handle = blkdev_get_handle_by_dev(
-			f.file->f_mapping->host->i_rdev,
-			BLK_OPEN_WRITE | BLK_OPEN_READ, NULL, NULL);
+	reg->hr_bdev_handle = blkdev_get_by_dev(f.file->f_mapping->host->i_rdev,
+						BLK_OPEN_WRITE | BLK_OPEN_READ,
+						NULL, NULL);
 	if (IS_ERR(reg->hr_bdev_handle)) {
 		ret = PTR_ERR(reg->hr_bdev_handle);
 		reg->hr_bdev_handle = NULL;
@@ -1904,7 +1904,7 @@ static ssize_t o2hb_region_dev_store(struct config_item *item,
 
 out3:
 	if (ret < 0) {
-		blkdev_handle_put(reg->hr_bdev_handle);
+		blkdev_put(reg->hr_bdev_handle);
 		reg->hr_bdev_handle = NULL;
 	}
 out2:
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 9518ff7865f0..3eaff21947a0 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -2587,7 +2587,7 @@ static void journal_list_init(struct super_block *sb)
 static void release_journal_dev(struct reiserfs_journal *journal)
 {
 	if (journal->j_bdev_handle) {
-		blkdev_handle_put(journal->j_bdev_handle);
+		blkdev_put(journal->j_bdev_handle);
 		journal->j_bdev_handle = NULL;
 	}
 }
@@ -2614,8 +2614,8 @@ static int journal_init_dev(struct super_block *super,
 	if ((!jdev_name || !jdev_name[0])) {
 		if (jdev == super->s_dev)
 			holder = NULL;
-		journal->j_bdev_handle = blkdev_get_handle_by_dev(jdev,
-					blkdev_mode, holder, NULL);
+		journal->j_bdev_handle = blkdev_get_by_dev(jdev, blkdev_mode,
+							   holder, NULL);
 		if (IS_ERR(journal->j_bdev_handle)) {
 			result = PTR_ERR(journal->j_bdev_handle);
 			journal->j_bdev_handle = NULL;
@@ -2630,8 +2630,8 @@ static int journal_init_dev(struct super_block *super,
 		return 0;
 	}
 
-	journal->j_bdev_handle = blkdev_get_handle_by_path(jdev_name,
-				blkdev_mode, holder, NULL);
+	journal->j_bdev_handle = blkdev_get_by_path(jdev_name, blkdev_mode,
+						    holder, NULL);
 	if (IS_ERR(journal->j_bdev_handle)) {
 		result = PTR_ERR(journal->j_bdev_handle);
 		journal->j_bdev_handle = NULL;
diff --git a/fs/super.c b/fs/super.c
index d35545364c5d..ea135fece772 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1266,9 +1266,9 @@ int get_tree_bdev(struct fs_context *fc,
 	if (!fc->source)
 		return invalf(fc, "No source specified");
 
-	bdev_handle = blkdev_get_handle_by_path(fc->source,
-			sb_open_mode(fc->sb_flags), fc->fs_type,
-			&fs_holder_ops);
+	bdev_handle = blkdev_get_by_path(fc->source,
+					 sb_open_mode(fc->sb_flags),
+					 fc->fs_type, &fs_holder_ops);
 	if (IS_ERR(bdev_handle)) {
 		errorf(fc, "%s: Can't open blockdev", fc->source);
 		return PTR_ERR(bdev_handle);
@@ -1283,7 +1283,7 @@ int get_tree_bdev(struct fs_context *fc,
 	if (bdev->bd_fsfreeze_count > 0) {
 		mutex_unlock(&bdev->bd_fsfreeze_mutex);
 		warnf(fc, "%pg: Can't mount, blockdev is frozen", bdev);
-		blkdev_handle_put(bdev_handle);
+		blkdev_put(bdev_handle);
 		return -EBUSY;
 	}
 
@@ -1292,7 +1292,7 @@ int get_tree_bdev(struct fs_context *fc,
 	s = sget_fc(fc, test_bdev_super_fc, set_bdev_super_fc);
 	mutex_unlock(&bdev->bd_fsfreeze_mutex);
 	if (IS_ERR(s)) {
-		blkdev_handle_put(bdev_handle);
+		blkdev_put(bdev_handle);
 		return PTR_ERR(s);
 	}
 
@@ -1301,19 +1301,18 @@ int get_tree_bdev(struct fs_context *fc,
 		if ((fc->sb_flags ^ s->s_flags) & SB_RDONLY) {
 			warnf(fc, "%pg: Can't mount, would change RO state", bdev);
 			deactivate_locked_super(s);
-			blkdev_handle_put(bdev_handle);
+			blkdev_put(bdev_handle);
 			return -EBUSY;
 		}
 
 		/*
 		 * s_umount nests inside open_mutex during
-		 * __invalidate_device().  blkdev_handle_put() acquires
-		 * open_mutex and can't be called under s_umount.  Drop
-		 * s_umount temporarily.  This is safe as we're
-		 * holding an active reference.
+		 * __invalidate_device().  blkdev_put() acquires open_mutex and
+		 * can't be called under s_umount.  Drop s_umount temporarily.
+		 * This is safe as we're holding an active reference.
 		 */
 		up_write(&s->s_umount);
-		blkdev_handle_put(bdev_handle);
+		blkdev_put(bdev_handle);
 		down_write(&s->s_umount);
 	} else {
 		snprintf(s->s_id, sizeof(s->s_id), "%pg", bdev);
@@ -1351,8 +1350,8 @@ struct dentry *mount_bdev(struct file_system_type *fs_type,
 	struct super_block *s;
 	int error = 0;
 
-	bdev_handle = blkdev_get_handle_by_path(dev_name, sb_open_mode(flags),
-				fs_type, &fs_holder_ops);
+	bdev_handle = blkdev_get_by_path(dev_name, sb_open_mode(flags),
+					 fs_type, &fs_holder_ops);
 	if (IS_ERR(bdev_handle))
 		return ERR_CAST(bdev_handle);
 	bdev = bdev_handle->bdev;
@@ -1383,13 +1382,12 @@ struct dentry *mount_bdev(struct file_system_type *fs_type,
 
 		/*
 		 * s_umount nests inside open_mutex during
-		 * __invalidate_device().  blkdev_handle_put() acquires
-		 * open_mutex and can't be called under s_umount.  Drop
-		 * s_umount temporarily.  This is safe as we're
-		 * holding an active reference.
+		 * __invalidate_device().  blkdev_put() acquires open_mutex and
+		 * can't be called under s_umount.  Drop s_umount temporarily.
+		 * This is safe as we're holding an active reference.
 		 */
 		up_write(&s->s_umount);
-		blkdev_handle_put(bdev_handle);
+		blkdev_put(bdev_handle);
 		down_write(&s->s_umount);
 	} else {
 		snprintf(s->s_id, sizeof(s->s_id), "%pg", bdev);
@@ -1411,7 +1409,7 @@ struct dentry *mount_bdev(struct file_system_type *fs_type,
 error_s:
 	error = PTR_ERR(s);
 error_bdev:
-	blkdev_handle_put(bdev_handle);
+	blkdev_put(bdev_handle);
 error:
 	return ERR_PTR(error);
 }
@@ -1424,7 +1422,7 @@ void kill_block_super(struct super_block *sb)
 	bdev->bd_super = NULL;
 	generic_shutdown_super(sb);
 	sync_blockdev(bdev);
-	blkdev_handle_put(sb->s_bdev_handle);
+	blkdev_put(sb->s_bdev_handle);
 }
 
 EXPORT_SYMBOL(kill_block_super);
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 5a958ae3a3ae..b0fbf8ea7846 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -396,8 +396,8 @@ xfs_blkdev_get(
 {
 	int			error = 0;
 
-	*handlep = blkdev_get_handle_by_path(name,
-			BLK_OPEN_READ | BLK_OPEN_WRITE, mp, &xfs_holder_ops);
+	*handlep = blkdev_get_by_path(name, BLK_OPEN_READ | BLK_OPEN_WRITE,
+				      mp, &xfs_holder_ops);
 	if (IS_ERR(*handlep)) {
 		error = PTR_ERR(*handlep);
 		xfs_warn(mp, "Invalid device [%s], error=%d", name, error);
@@ -411,7 +411,7 @@ xfs_blkdev_put(
 	struct bdev_handle	*handle)
 {
 	if (handle)
-		blkdev_handle_put(handle);
+		blkdev_put(handle);
 }
 
 STATIC void
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 134dfd1162e2..4ae3647a0322 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1476,14 +1476,14 @@ struct bdev_handle {
 	void *holder;
 };
 
-struct bdev_handle *blkdev_get_handle_by_dev(dev_t dev, blk_mode_t mode,
-		void *holder, const struct blk_holder_ops *hops);
-struct bdev_handle *blkdev_get_handle_by_path(const char *path, blk_mode_t mode,
+struct bdev_handle *blkdev_get_by_dev(dev_t dev, blk_mode_t mode, void *holder,
+				      const struct blk_holder_ops *hops);
+struct bdev_handle *blkdev_get_by_path(const char *path, blk_mode_t mode,
 		void *holder, const struct blk_holder_ops *hops);
 int bd_prepare_to_claim(struct block_device *bdev, void *holder,
 		const struct blk_holder_ops *hops);
 void bd_abort_claiming(struct block_device *bdev, void *holder);
-void blkdev_handle_put(struct bdev_handle *handle);
+void blkdev_put(struct bdev_handle *handle);
 
 /* just for blk-cgroup, don't use elsewhere */
 struct block_device *blkdev_get_no_open(dev_t dev);
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 9ebac878497f..25f06d92944c 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -357,14 +357,14 @@ static int swsusp_swap_check(void)
 		return res;
 	root_swap = res;
 
-	hib_resume_bdev_handle = blkdev_get_handle_by_dev(swsusp_resume_device,
-			BLK_OPEN_WRITE, NULL, NULL);
+	hib_resume_bdev_handle = blkdev_get_by_dev(swsusp_resume_device,
+						   BLK_OPEN_WRITE, NULL, NULL);
 	if (IS_ERR(hib_resume_bdev_handle))
 		return PTR_ERR(hib_resume_bdev_handle);
 
 	res = set_blocksize(hib_resume_bdev_handle->bdev, PAGE_SIZE);
 	if (res < 0)
-		blkdev_handle_put(hib_resume_bdev_handle);
+		blkdev_put(hib_resume_bdev_handle);
 
 	return res;
 }
@@ -1522,8 +1522,9 @@ int swsusp_check(bool snapshot_test)
 	void *holder = snapshot_test ? &swsusp_holder : NULL;
 	int error;
 
-	hib_resume_bdev_handle = blkdev_get_handle_by_dev(swsusp_resume_device,
-				BLK_OPEN_READ, holder, NULL);
+	hib_resume_bdev_handle = blkdev_get_by_dev(swsusp_resume_device,
+						   BLK_OPEN_READ, holder,
+						   NULL);
 	if (!IS_ERR(hib_resume_bdev_handle)) {
 		set_blocksize(hib_resume_bdev_handle->bdev, PAGE_SIZE);
 		clear_page(swsusp_header);
@@ -1550,7 +1551,7 @@ int swsusp_check(bool snapshot_test)
 
 put:
 		if (error)
-			blkdev_handle_put(hib_resume_bdev_handle);
+			blkdev_put(hib_resume_bdev_handle);
 		else
 			pr_debug("Image signature found, resuming\n");
 	} else {
@@ -1574,7 +1575,7 @@ void swsusp_close(void)
 		return;
 	}
 
-	blkdev_handle_put(hib_resume_bdev_handle);
+	blkdev_put(hib_resume_bdev_handle);
 }
 
 /**
diff --git a/mm/swapfile.c b/mm/swapfile.c
index dbd37aa4724d..921fdb7e5e09 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2528,7 +2528,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
 	inode = mapping->host;
 	if (p->bdev_handle) {
 		set_blocksize(p->bdev, old_block_size);
-		blkdev_handle_put(p->bdev_handle);
+		blkdev_put(p->bdev_handle);
 	}
 
 	inode_lock(inode);
@@ -2758,8 +2758,9 @@ static int claim_swapfile(struct swap_info_struct *p, struct inode *inode)
 	int error;
 
 	if (S_ISBLK(inode->i_mode)) {
-		p->bdev_handle = blkdev_get_handle_by_dev(inode->i_rdev,
-				BLK_OPEN_READ | BLK_OPEN_WRITE, p, NULL);
+		p->bdev_handle = blkdev_get_by_dev(inode->i_rdev,
+						   BLK_OPEN_READ | BLK_OPEN_WRITE,
+						   p, NULL);
 		if (IS_ERR(p->bdev_handle)) {
 			error = PTR_ERR(p->bdev_handle);
 			p->bdev_handle = NULL;
@@ -3211,7 +3212,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
 	p->cluster_next_cpu = NULL;
 	if (p->bdev_handle) {
 		set_blocksize(p->bdev, p->old_block_size);
-		blkdev_handle_put(p->bdev_handle);
+		blkdev_put(p->bdev_handle);
 	}
 	inode = NULL;
 	destroy_swap_extents(p);
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 12:45:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 12:45:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558338.872334 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGfOn-0001pb-VW; Tue, 04 Jul 2023 12:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558338.872334; Tue, 04 Jul 2023 12:44:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGfOn-0001pU-RY; Tue, 04 Jul 2023 12:44:53 +0000
Received: by outflank-mailman (input) for mailman id 558338;
 Tue, 04 Jul 2023 12:44:53 +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
 <SRS0=P5qr=CW=infradead.org=willy@srs-se1.protection.inumbo.net>)
 id 1qGfOm-0001pM-Dh
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 12:44:53 +0000
Received: from casper.infradead.org (casper.infradead.org
 [2001:8b0:10b:1236::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8d9d0c47-1a68-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 14:44:47 +0200 (CEST)
Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red
 Hat Linux)) id 1qGfNn-0099Sz-9Z; Tue, 04 Jul 2023 12:43:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8d9d0c47-1a68-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version:
	References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=MTt8zrAicdNCIRJKdOYeAgLwlWREbjuubDrB9LDLoHk=; b=FQ7AVaBk1GiVkQjqboSqkOGPBq
	D5twh1rJ7Iuli9ASCg3UlAH0AvBtBUwBmFvGFlq65Bob5lYyyxVWcYsI1kpmfheq88Wy3j6xoPYkH
	Yr8SWDhirVenxTbYcufP9aI7qtE9tPtw2HdVYrOWl8KhXSL1///8tHp1coXORoa2/ua7NUKFkm8+i
	dZTW2mGKIGBkD8nw9XAEiECk0hIGw3K+rH1tSbKt2yF6JFa6PpHTgJc3LTGgE/JGwL7FWrIxLj7Op
	grzKnmKKjadKIKnXmQRg0cnlXA7KWmhAcv93Lftb6rhIWGVuVJI8IrHKh1M51oSxQqR7AKzuvj0MI
	qnUduz9Q==;
Date: Tue, 4 Jul 2023 13:43:51 +0100
From: Matthew Wilcox <willy@infradead.org>
To: Jan Kara <jack@suse.cz>
Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@infradead.org>,
	Alasdair Kergon <agk@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anna Schumaker <anna@kernel.org>, Chao Yu <chao@kernel.org>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Dave Kleikamp <shaggy@kernel.org>, David Sterba <dsterba@suse.com>,
	dm-devel@redhat.com, drbd-dev@lists.linbit.com,
	Gao Xiang <xiang@kernel.org>, Jack Wang <jinpu.wang@ionos.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	Joern Engel <joern@lazybastard.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	linux-bcache@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org,
	linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org,
	linux-nilfs@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-pm@vger.kernel.org, linux-raid@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	"Md. Haris Iqbal" <haris.iqbal@ionos.com>,
	Mike Snitzer <snitzer@kernel.org>, Minchan Kim <minchan@kernel.org>,
	ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Song Liu <song@kernel.org>, Sven Schnelle <svens@linux.ibm.com>,
	target-devel@vger.kernel.org, Ted Tso <tytso@mit.edu>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions
Message-ID: <ZKQUB4rU8Gebhq6R@casper.infradead.org>
References: <20230629165206.383-1-jack@suse.cz>
 <20230704122224.16257-1-jack@suse.cz>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20230704122224.16257-1-jack@suse.cz>

On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote:
> +struct bdev_handle *blkdev_get_handle_by_dev(dev_t dev, blk_mode_t mode,
> +		void *holder, const struct blk_holder_ops *hops)
> +{
> +	struct bdev_handle *handle = kmalloc(sizeof(struct bdev_handle),
> +					     GFP_KERNEL);
> +	struct block_device *bdev;
> +
> +	if (!handle)
> +		return ERR_PTR(-ENOMEM);
> +	bdev = blkdev_get_by_dev(dev, mode, holder, hops);
> +	if (IS_ERR(bdev))
> +		return ERR_CAST(bdev);

Would we be better off with a handle->error (and a NULL return from this
function means "we couldn't allocate a handle")?  I have no objection
to what you've done here, just wondering if it might end up nicer for
the users.



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 13:04:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 13:04:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558343.872344 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGfhI-0004Kk-EL; Tue, 04 Jul 2023 13:04:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558343.872344; Tue, 04 Jul 2023 13:04:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGfhI-0004Kd-BK; Tue, 04 Jul 2023 13:04:00 +0000
Received: by outflank-mailman (input) for mailman id 558343;
 Tue, 04 Jul 2023 13:03:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=fUi4=CW=suse.cz=jack@srs-se1.protection.inumbo.net>)
 id 1qGfhH-0004KR-A7
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 13:03:59 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3cb022d0-1a6b-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 15:03:58 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id F0F5F20573;
 Tue,  4 Jul 2023 13:03:56 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id DC3001346D;
 Tue,  4 Jul 2023 13:03:56 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id kueeNbwYpGTARwAAMHmgww
 (envelope-from <jack@suse.cz>); Tue, 04 Jul 2023 13:03:56 +0000
Received: by quack3.suse.cz (Postfix, from userid 1000)
 id 6B4A7A0722; Tue,  4 Jul 2023 15:03:56 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3cb022d0-1a6b-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa;
	t=1688475837; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=rY6MxLY5e9SVa1+4BCCd7ntNwV9Px5uEGT5nvi2Xw9M=;
	b=ejRwbAIwZQbMrOxksN9aG/ZDDESpKoHA5R/d85WHYyhF32Si43PFRfl6mcCR9WYB3Qv5Xb
	bFzVFYQ3692eypLdUzJN5qIXY9S2kweTJplS9sF53SAyJ7HvtNyhlweUs2wFtrS+zKSTOj
	TegqbmWrWk4Vs0DZGSAEKRmheCwdTpE=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;
	s=susede2_ed25519; t=1688475837;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=rY6MxLY5e9SVa1+4BCCd7ntNwV9Px5uEGT5nvi2Xw9M=;
	b=T7VmytPRSDJUviPwV6lejrGCKn7KjlWBXNR5Weqcyul/51HqsbD9tiSRFlJo/bbQX+dGnV
	08LOGAmrpvM1ddAQ==
Date: Tue, 4 Jul 2023 15:03:56 +0200
From: Jan Kara <jack@suse.cz>
To: Matthew Wilcox <willy@infradead.org>
Cc: Jan Kara <jack@suse.cz>, linux-block@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@infradead.org>,
	Alasdair Kergon <agk@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anna Schumaker <anna@kernel.org>, Chao Yu <chao@kernel.org>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Dave Kleikamp <shaggy@kernel.org>, David Sterba <dsterba@suse.com>,
	dm-devel@redhat.com, drbd-dev@lists.linbit.com,
	Gao Xiang <xiang@kernel.org>, Jack Wang <jinpu.wang@ionos.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	Joern Engel <joern@lazybastard.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	linux-bcache@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org,
	linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org,
	linux-nilfs@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-pm@vger.kernel.org, linux-raid@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	"Md. Haris Iqbal" <haris.iqbal@ionos.com>,
	Mike Snitzer <snitzer@kernel.org>, Minchan Kim <minchan@kernel.org>,
	ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Song Liu <song@kernel.org>, Sven Schnelle <svens@linux.ibm.com>,
	target-devel@vger.kernel.org, Ted Tso <tytso@mit.edu>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions
Message-ID: <20230704130356.xwdlxvgvi4l6sruc@quack3>
References: <20230629165206.383-1-jack@suse.cz>
 <20230704122224.16257-1-jack@suse.cz>
 <ZKQUB4rU8Gebhq6R@casper.infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <ZKQUB4rU8Gebhq6R@casper.infradead.org>

On Tue 04-07-23 13:43:51, Matthew Wilcox wrote:
> On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote:
> > +struct bdev_handle *blkdev_get_handle_by_dev(dev_t dev, blk_mode_t mode,
> > +		void *holder, const struct blk_holder_ops *hops)
> > +{
> > +	struct bdev_handle *handle = kmalloc(sizeof(struct bdev_handle),
> > +					     GFP_KERNEL);
> > +	struct block_device *bdev;
> > +
> > +	if (!handle)
> > +		return ERR_PTR(-ENOMEM);
> > +	bdev = blkdev_get_by_dev(dev, mode, holder, hops);
> > +	if (IS_ERR(bdev))
> > +		return ERR_CAST(bdev);
> 
> Would we be better off with a handle->error (and a NULL return from this
> function means "we couldn't allocate a handle")?  I have no objection
> to what you've done here, just wondering if it might end up nicer for
> the users.

Hum, I've checked a couple of users and it seems it would be more
complicated for the users to handle this convention than the one I've
chosen. And that one is also pretty standard so I think by the principle of
least surprise it is also better.

								Honza

> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 13:26:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 13:26:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558347.872353 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGg36-0006qa-3w; Tue, 04 Jul 2023 13:26:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558347.872353; Tue, 04 Jul 2023 13:26:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGg36-0006qT-14; Tue, 04 Jul 2023 13:26:32 +0000
Received: by outflank-mailman (input) for mailman id 558347;
 Tue, 04 Jul 2023 13:26:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGg35-0006qJ-7h; Tue, 04 Jul 2023 13:26:31 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGg34-0000DZ-Sj; Tue, 04 Jul 2023 13:26:30 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGg34-0001Cc-IY; Tue, 04 Jul 2023 13:26:30 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qGg34-0006Zz-I4; Tue, 04 Jul 2023 13:26:30 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=BruUovCD31WgGj21RPHbVYpgyImBf9nbx8FXNQ9VSY4=; b=io+y8IdUdQKf0eK+flTSvpCpzF
	6SRGgwgt/xpQdXnql1h3mBiJXQ43UJeDQ2gZ+/UwZu7S15SBrYbbq3UJWYSDvkAYYlhFOVk6WplpK
	edgzAwvWabjY8l/NZsI9co/JcBlbdZozrvropoSzA1+6WiXKhyDTIWd81xVvCnjxKH+g=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181694-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181694: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=6e06d229d538ea51b92dc189546c522f5e903511
X-Osstest-Versions-That:
    xen=f51e5d8eae8ece77a949571f39ee49904f3129aa
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 04 Jul 2023 13:26:30 +0000

flight 181694 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181694/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  6e06d229d538ea51b92dc189546c522f5e903511
baseline version:
 xen                  f51e5d8eae8ece77a949571f39ee49904f3129aa

Last test of basis   181661  2023-06-30 18:00:29 Z    3 days
Testing same since   181694  2023-07-04 11:03:36 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   f51e5d8eae..6e06d229d5  6e06d229d538ea51b92dc189546c522f5e903511 -> smoke


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 13:31:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 13:31:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558353.872363 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGg7P-0008Hm-LO; Tue, 04 Jul 2023 13:30:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558353.872363; Tue, 04 Jul 2023 13:30:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGg7P-0008He-IR; Tue, 04 Jul 2023 13:30:59 +0000
Received: by outflank-mailman (input) for mailman id 558353;
 Tue, 04 Jul 2023 13:30:58 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=bK4X=CW=citrix.com=prvs=5424eaebb=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qGg7N-0008HV-W4
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 13:30:58 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0033ef6c-1a6f-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 15:30:55 +0200 (CEST)
Received: from mail-co1nam11lp2175.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.175])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 04 Jul 2023 09:30:48 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by BY5PR03MB4951.namprd03.prod.outlook.com (2603:10b6:a03:1ef::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 13:30:46 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902%7]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 13:30:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0033ef6c-1a6f-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688477455;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=WCgkf5IFFnMzkXfG6LshJCt1hfuF+SCIXkc0CgQ4kdQ=;
  b=UuwfAXrDrMyo+sXgTShmEjCqhMvaMkp6hc/GEiLWusIKHzsu+aOWbL3m
   +bUNvsoZ/+y0ZTJCgSaBy60UKg1ZWQv3/USeyOUvkKfkzFis6nQxyW5vU
   Mn6S6krDXXGOYOcYnRiEJoinKyx+5lpJb5Iw26/0PkK2O/6bSiyld14nq
   s=;
X-IronPort-RemoteIP: 104.47.56.175
X-IronPort-MID: 113831609
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:m6WjQKtJ/VtJsj1vUp0GeEqQ9efnVJhfMUV32f8akzHdYApBsoF/q
 tZmKW7VOffeZWX3eognOY6wo0gB65PTn9M2SlZprig3Enwa+JbJXdiXEBz9bniYRiHhoOCLz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M7705O0nj3sduwgoSKaCSl4g==
X-Talos-CUID: 9a23:TFOyf28dMXTq7fmI3fSVv2QvPewBbyyC91L/HB6JGEV7Vb2cRkDFrQ==
X-Talos-MUID: =?us-ascii?q?9a23=3A80wbhw2cCaB2ZmLhqwjnUEJTpzUj55quFUNRqIg?=
 =?us-ascii?q?9i9S+aiZ0HSibjG6FTdpy?=
X-IronPort-AV: E=Sophos;i="6.01,180,1684814400"; 
   d="scan'208";a="113831609"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=W5feD0iZ0EwZsz89Vx2tXQ47rGmSgceff73kmk3VxgBToI6+1j2q/oMB7a/bZ5WFAw7hkxOQC33jbf1Rz9IqBoSovEW6fJ4JjG5NC2rA4VyQzJSpVFzYNGyhXc6dWrT6QBcZUxUbwG3229Sz3LQAULUFnXU+f+7CeONUOPyi1FEv4uwW/S6JjTGK9oiZ5/fxD8stagQ1WFELMcRChvLbZClElXUsiSM6KU0XXy6izBkom3ctZ1suz2aQqDqbL6ffTQf9wXBepVwKmbGM132T25Kje9r+RMxUGnJ5YbmgWsclDCCCVJA37r0DtNAuAUmpoC9h97NI0SU7DPHl7Drfcw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=EZxWrJPo11d4CXK2s+cv8367KL6szoxU2f/YBDm96Yc=;
 b=TWy7k+oBykGIOmOPmrFlpviO1Z/RZhIzAKMBO1RkZKIAi9hJR79FC21o97OHs+9SGm56Ka20foJPdI25bsVIhXVPuWwhBA+H4ftiquDeADCU+qhMtvQMm2EY7Ehnvr8okaXE2VWo8NWrn1ixo/+dWUju6n3TgJYOHm6ijNN5LPrcLl65JrtdFMxNlTKgIFn3YawXKQTtt2PyoLT6viwWz5TdMGMEo8JNKHRFR993KoAKgpvubft2cvjzt0Wts1IFoXsIXTlU0fKdxircaIMGozBhNNCQcArs4rsi/1jB353JugmMxTRUi4BELIIWppN8imiARi4rfCDuaD1sZcqEgQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=EZxWrJPo11d4CXK2s+cv8367KL6szoxU2f/YBDm96Yc=;
 b=CNZRwUJ+eTJbWw4JMEpFXdS/IF+wRIgrtIS1/w2TBt3+0c+CXcLqOxlo6vxSEbmOoprQK8QaZgsGtFLxVG3ix73ENOCNKOCm3PCnyxxl/rnurqZhdGxRqceDYIcHY+ldvImgcWkJJ0Qs+pHnx6kFMY1FHl1aRx3aehT80iWHwrE=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Tue, 4 Jul 2023 15:30:40 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 3/3] cmdline: parse multiple instances of the vga
 option
Message-ID: <ZKQfABhcXgRLZK-n@MacBook-Air-de-Roger.local>
References: <20230601130518.48874-1-roger.pau@citrix.com>
 <20230601130518.48874-4-roger.pau@citrix.com>
 <0a0671ea-9209-37fc-1d9f-1c38aff45bba@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <0a0671ea-9209-37fc-1d9f-1c38aff45bba@suse.com>
X-ClientProxiedBy: LO4P123CA0558.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:33b::14) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|BY5PR03MB4951:EE_
X-MS-Office365-Filtering-Correlation-Id: 78ee22db-5eb5-4013-e1b6-08db7c92df33
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	+X/J0xgXdr7wya8YtfXCBnJC3GzjfgpztNvt/E6NzAcOfwM3HJU26bTvRO752mex7NY71z5wVaAj2KhwYZtiy7dTaZkQNbJdx0NXy+IOxnAJ23qgV8DCVG2AV29ISrZIJIvrHEJz4X2gdATOt28hPMSHZrGs4dCK2cHCghoJsFV9cBD9RAOhxCySsXFA9gQQo4yrKkNomAvzs2+Z8dGlSmKLp1OTRd2KLzKW1yjqW8P/o+MqfMljGGeGleH20DFEvc+iOkFMJo6zPq6V+K6KMKu5i2ZLcIrtFO0RayYYppWygm5ZDThsu7xhNhfTpKmGLA3pP2jP5ABTYtKP/LlohqOGC1MPjA4jjXSKBoyEC6LhCaO3fw1Y1Z0NoxP9bSHOG+rN+MhQTswGyne9ouo3caIEeziLrEC6LP31OgCaoFf5arRJ3mt36RCDIeSgosmfXDiGoZzyBnmpOTN4Fk3SUu5bbR74H9E0mfmTZJvO7rGssleP5W52EN0huGKvceUXX0ehD29u2/MzV5I9oQ8oZEmVI1XQxvvMubdoEkxqwKDTuAiiaR1nzXYAqsTgjOSJ
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(366004)(346002)(376002)(136003)(451199021)(2906002)(41300700001)(5660300002)(8676002)(8936002)(85182001)(86362001)(186003)(82960400001)(478600001)(26005)(6512007)(6506007)(6666004)(9686003)(6486002)(316002)(6916009)(4326008)(66476007)(66946007)(66556008)(53546011)(54906003)(38100700002)(83380400001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?N09QcVgvRFZmTitYTUt4OFRaK2p3Y01wWGpnQzNpeE9vakVMYTYyMHpSUjZa?=
 =?utf-8?B?QmRiTkpHTCtaeTBLT3VRVUpGMXlDQnYwQmNyQ3B1MTBRK2Y2OXgrL1dnRi90?=
 =?utf-8?B?OXZzS003d0puZmIrME1KQ3RLNDl1ZnBmbHRheFJ2WlVCSWZWTnBBWTVQM0RK?=
 =?utf-8?B?U1A0dlZDWDBVUVlWWGdxaTVMOHFrS0ROOTluUXFEd1BuYTZiMTY5Y0hSaDFK?=
 =?utf-8?B?ejZoKzlwRGVzZTlsYkp3SFRCWTNwbklqNHQybUFwT3VTeWRpQ2JDTHU1S3VZ?=
 =?utf-8?B?RHJzR25MWGxWYU0xdUJxZjIzdlhwVVRpRGRGVTB2VEs2RXpvY3VaT2wvei9t?=
 =?utf-8?B?UUN2cVFmRjltNWFtNFdYaWsrVVBKNjhOYTlZOTJzOEg3bXh0ampORHdlSU5p?=
 =?utf-8?B?NE1zaTFsWE9XMm56Q1ZFYUJBRE1iL1pTdDkxSUNDRHdSSEphamRGcW1CMURZ?=
 =?utf-8?B?OWwvRFkrZ3FkU3MwWElnVkQzTnRCQzhFVy9pSDFaRENjeXdJbkNLYUZMUFVM?=
 =?utf-8?B?T1UyUzRWV3RwSERSZ0lRalE2cExjcURZVjZTQ2lOZ0pVTWhsWkwyMXpkVzZh?=
 =?utf-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Zajbw9L7EWWca1ew4jUOl1L0jdQSrUZzugDw9YL4I/wk6sPLii4EWYRXQ8pvqvPGsxfSQ27HyoxGo8Av2uO1Hu2igqEqpIBqe+Ucfg36dRdnOXLdV+gIOSPeVAcg6zA63u5H/7+5DGuDAfhDetlxuv1tpznHqym8txQuPCStjmKKyBPqNVEOBTG2xcGQDQAMXIqOuFM9WBFd0mTOivCtFvSoDfMi+PuMakrTRUefMg3n6/7+lLeZ0hqyKx/cBaAPwqQVLf3wK39PoSfl87PS1yrFirrHBkkksCG63yTbYK4/6r1aqR8kSaWGJ2mEud+sCGhvKgPxubuVHM4wySNbvPRYMNhdkLedpBWz3EZtnCXQT7cbccyuzPMe/EqS5DRD9K3tpN3Vck79QAHd8mHhrVGaies5h4PSuwXi7fHeyHLnAriaDyZC+9hIE9AqislO2u4U6tuQdvcX3a1mrGkfpD3HqrtzsnXfQFXp1xagFB7vvIPZ9NE6SJnuCa2FS0+oAvWtMaH9Kbl9fNamdYPQihZbS9s7vTmDNZAazBZ4zyU+dPTyITSad2QSMjs9aF4Lvc6oKG0NwJ/pntII7cZX7molRMILTdHLlH41g+x1fPpLIBW5eQwhQHRAGaND6TiNePI3VUiLAZnJTFE0NwAzrmAkm8BZcBAUgbIvNTxfHoz528Bqs5tMGo3OymxbeI3gqtPgA=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 78ee22db-5eb5-4013-e1b6-08db7c92df33
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 13:30:45.7618
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: C7KVbj2cthHtbxOWpQAy3zULDXrC9Mamz3wmzCS/lUKN/NG4/F7p0aVvXc23KrOx5f/Ut03jvtwJ5GWbPqtpkg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR03MB4951

On Wed, Jun 07, 2023 at 12:07:54PM +0200, Jan Beulich wrote:
> On 01.06.2023 15:05, Roger Pau Monne wrote:
> > --- a/docs/misc/xen-command-line.pandoc
> > +++ b/docs/misc/xen-command-line.pandoc
> > @@ -2628,6 +2628,9 @@ with the specified width, height and depth.
> >  `ask` option.  (N.B menu modes are displayed in hex, so `<mode>`
> >  should be a hexadecimal number)
> >  
> > +Note that all the occurrences of the vga option in the command line are parsed,
> > +and hence later occurrences can overwrite selections done by prior ones.
> 
> I'm not a native speaker, but is it perhaps more "override" that you
> mean?

TBH I always get confused with overwrite vs override.  I will remove
the line as requested by Andrew.

> > --- a/xen/arch/x86/boot/cmdline.c
> > +++ b/xen/arch/x86/boot/cmdline.c
> > @@ -277,59 +277,58 @@ static u16 rows2vmode(unsigned int rows)
> >  
> >  static void vga_parse(const char *cmdline, early_boot_opts_t *ebo)
> >  {
> > -    const char *c;
> > -    unsigned int tmp, vesa_depth, vesa_height, vesa_width;
> > -
> > -    c = find_opt(cmdline, "vga=", true);
> > -
> > -    if ( !c )
> > -        return;
> > +    const char *c = cmdline;
> >  
> > -    ebo->boot_vid_mode = ASK_VGA;
> 
> I think this needs to stay here along with the addition of the related
> "else if" below. Otherwise I expect behavior for e.g. a sole "vga=keep"
> on the command line would change (in no longer prompting for the mode
> to use).

Done.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 13:39:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 13:39:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558360.872374 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgFq-0000Ym-KH; Tue, 04 Jul 2023 13:39:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558360.872374; Tue, 04 Jul 2023 13:39:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgFq-0000Yf-H7; Tue, 04 Jul 2023 13:39:42 +0000
Received: by outflank-mailman (input) for mailman id 558360;
 Tue, 04 Jul 2023 13:39:41 +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 <SRS0=D/z2=CW=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGgFo-0000YZ-Rv
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 13:39:40 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20601.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::601])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 38646085-1a70-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 15:39:38 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB8215.eurprd04.prod.outlook.com (2603:10a6:20b:3b3::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 13:39:36 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 13:39:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 38646085-1a70-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=l61Y8kkue908wus6N9YdSUQoJ4bADhLt4ftLCHbb9OWwi1mQFjyNj4YqbOJZr2zWutmNp43J3GiWq0NqjMefmX+MeX59wSfxtIOajI9kk9fnNK1k5GeaalqAQVoB6d87R9qoAPsaNovs9W5schgkH/lxn2sqPvrc6OEaEDu8prMO1I8AgaS01aE67upmYiIPb1KihOPXyeRmQhqppT1fpdq0yk/yZ2xHXIuJxVRaIPC4b94+hY63hegWzyv8v6gO8xnvJYgAbcgrmX9llrLhqjuHQSiL61mHQk0iY6V+0k2wxRHXHTNMQLevFVJ0JnAYDPzhrQ75SXZre7moxdgzyg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=134+lnW6M8o5uUgaYmeEKgQrOjOjiI5sdQXc8ZqDUTs=;
 b=KlXho/ymW1jkwDC1ltH7pF0H0rtCM8IHjsq/IQ2+isGcbRsit3ZwLFAhDBFtckmZJuebQIVY4Wo0ABMB+vECN80UbzG3D7JJ+5J0xU4wFCNWqkCyaExoS183q8m8/j2sp9Yc5DPHKLJwyLB41aUhoW7pXxHc3rmB8S9uSH2KJCdR4C6dz6x4me+kkFETECcpgvyvhTugk5N4OYnD9svylrj8+/ytJbSqebL4vgVA0UiWsZvFf9RsSZoA9NQQ5piTzsHBXd/8v5YHksexZ66ATZbIG5ir00ISotWOEWreb4i540tB5YT33kBm+TxAEsqmr0Hau8EQOUdOpFhw6pBEyA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=134+lnW6M8o5uUgaYmeEKgQrOjOjiI5sdQXc8ZqDUTs=;
 b=LMXmkm44OGkhtEOoVQa8Q5PCPHrx8/0XIDXgOR1dE9E/d2OqDBqZSsus7JE8uuyT6xIL9IiugmOAbgCzzeA6uABdJZS5u4lFhhS3L9SP7tS6zxawTpEGgNouu4t0CsNL5c/khyUX7XKwfO56p86U/ZcYvUr76+pweudluLHLhgucYAjcMoq5NHv27JRyWLzUCcRwlUosPDz70TswYepCBSP/HGPuNCLc7496LKkNCn+gefmOh1vBzo2/BJFS9p2k3ZJyrsHS+wdCif5tTYztOc1/LHaBkYgqKSQ+Etu2QqptqhJj4Dt7d6pwVPrFhbdmCmNrSPAnWmCs/5Zj75lTAA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <4cd67316-4347-a3b6-0f4c-1864ce08ad5c@suse.com>
Date: Tue, 4 Jul 2023 15:39:42 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: XenSummit: Empty per-arch files
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bobby Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Timothy Pearson <tpearson@raptorengineering.com>,
 xen-devel <xen-devel@lists.xenproject.org>
References: <2aabfb63-1a2f-bb02-488a-ea79136bc6c0@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <2aabfb63-1a2f-bb02-488a-ea79136bc6c0@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0193.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a4::6) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB8215:EE_
X-MS-Office365-Filtering-Correlation-Id: 920c3806-19b9-44ad-2da5-08db7c941b92
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	YHpTc6hKpmGrUlg3bCjIDWawluBEccKcDmLoSBXXpbSpQNcwSt3FX+OT0MQPoKdBf1Ge0kC43TabqobLZMfIwbVCob7B2jpnI241+NoiNFEEUgleUniUkpki5kVyHDOXkrHnFzwuhXkSjbv/Ep1wmoAit3bT3jqrmx0h7uK0lP0lDPYMw9xPcq812/5OaK/hjMjqo3fYK2h2aydMPZLKsEYJkYe/c4YSpSYZJVlYJkfXcMmeIgRne8GuGkosBpPqq/FDn9MO5lRAChSJQQ/MTOtL0RafOAegOduitE6MfQw8vHsZMzqYmkGrLdiV+vbbT6fV78JAtz9GtSiYRHcCJxvKMYap9klVNM4Am6wKLMIh7KCTeG46+acZ1B09honm+XYxvJG4glcWnxDWzrGn/TB2hwFpCizeB/mC3lUlfLdG72PfkVJLCHpFYPFUy94Ix1ttKj6fbG7yTjEa4vZVRquYSPAcmhVZUdIzHqHhuEid342yEy3eg9sdBA1SiHcpjnBsTQ5Wg6jc61zL7BTzE5lO+O7hnALgo6Zmr2SouolNxlAk7kEC5xp5c6DRahaC7Mgnp44T1IQF20Zx2sz4/mgPS98n4yW1hzRzWHkiMyH/v3H/13S8e0JcYIyR5QxZcS2wOty/V9OJjBOgLMDMYQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(346002)(39850400004)(366004)(396003)(376002)(451199021)(6512007)(6506007)(53546011)(66476007)(316002)(38100700002)(4326008)(66946007)(66556008)(6916009)(2616005)(66899021)(186003)(26005)(478600001)(54906003)(2906002)(8936002)(31686004)(8676002)(36756003)(31696002)(5660300002)(7416002)(86362001)(6486002)(41300700001)(6666004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aUtNTnljbC9iVlBGb1dWNExVU3JaeGFBeHZ0Y2hDbk9EUEZNbGcweXozcTFS?=
 =?utf-8?B?NDFTWkhBNks2ZGlBcitGNENwQ2JnQU04eUZGeUxYNHhBMG9kc3QrZnppVXlZ?=
 =?utf-8?B?K1k0Y0ZxTWloTDFRYlBGaEdMUWVhamd6V2pmdElINlM0SWp6VVBRZ0xLU1VD?=
 =?utf-8?B?ZzZPSzVJTE9OZ1VvbXdJblgvb005YmhDRzkyTE9nazg2WmU1WmNyZHhaV3NP?=
 =?utf-8?B?ZUJmZTA2ZXI5VzBrV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kYUNNNmUydXhRVEFvQ1pKVmhlNmlwS1lGWTJnY05iWjZwMm5BRFp2QmZi?=
 =?utf-8?B?cklQUCs2ZVcvNElDWWVKKzQ1WlZPSDNHZmVaNnJwMzBpNUdPOWUzRW1xbW5q?=
 =?utf-8?Q?lZle47huvORstflK/oUnhINJo?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 920c3806-19b9-44ad-2da5-08db7c941b92
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 13:39:36.4287
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: vVaIAMskdRQH7nI0dHZlUb4wBaSFZTqYvJ5XCUa3jF/M95E4QTiGlqyDsQ6GPy9u9u4lGmwW6+uJKFEEbQyTqg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8215

On 28.06.2023 13:32, Andrew Cooper wrote:
> Hello,
> 
> This wasn't a formal discussion point at XenSummit, but Oleksii pointed
> out that it was still a problem, hence this thread.
> 
> As we take on more architectures, it becomes more and more important for
> things to be handled in a mostly-common way.Â  With that comes quite a
> lot of <xen/foo.h> including <asm/foo.h>, and the arch one being a stub
> in simple cases.
> 
> It would be nice to get rid of the stub files; they're irritating to
> deal with, both when refactoring and simply for the file bloat they create.
> 
> There are two options which come to mind.
> 
> 1) Use __has_include().Â  This would be ideal, but would require us
> bumping the minimum GCC version to 4.9.2 as a prerequisite.Â  I'm not
> aware of any way to emulate the necessary behaviour on older toolchains.
> 
> 2) Have a stub "architecture" which is always last on the include path.Â 
> This would reduce the number of stub files from one set per arch, to
> only one set.

I'd be in favor of 2, which iirc is also how Linux does it (in certain
cases, iirc; or maybe things have changed yet again there). They call
it asm-generic/, which I think is slightly better than anything with
"stub" in its name.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 13:54:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 13:54:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558364.872383 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgTU-0002wa-Q2; Tue, 04 Jul 2023 13:53:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558364.872383; Tue, 04 Jul 2023 13:53:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgTU-0002wT-NA; Tue, 04 Jul 2023 13:53:48 +0000
Received: by outflank-mailman (input) for mailman id 558364;
 Tue, 04 Jul 2023 13:53:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=D/z2=CW=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGgTT-0002wN-DH
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 13:53:47 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20608.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::608])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 31d7aeba-1a72-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 15:53:46 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB9867.eurprd04.prod.outlook.com (2603:10a6:10:4c0::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 13:53:44 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 13:53:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 31d7aeba-1a72-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=NvkVe/SVmonf06KVTBVQjOQu9eFhIfznAt4LpPyusr3Y8hc1JLBkivivkcxrvwk1ZTUw1uufEy2iZXS5viSCOSSuqiXIRAGNJr2VvDuzpaaQc9sCrIJnRgMoY06exgJXEbyC/v2thlCrUxeOg50qHH3jP3N3zHaDrQhvTbBuG1fS4qaYrMZgfEP7BVaW3rutIoZZuRuDMYWQ3wYWjNycKBCGo+txeK+3xtheo2/DLErqgiAUh0vYXPSLDEUp7KBaIXdKM3JjnKLbav9FDOpcAVp73ZveKDHiK06Bzq0B4yBtJ/2nsyGsQMMdhiaCAHkk/Wpe6Q/mbwt/NtiC8jcNSg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=kd5boOvS+q5rVVsOKW3C9SGZ7jvv4HJO+PM0gqNKnl4=;
 b=GsUKpYjO5BvYsbFDTWz7YzsAZG4so9wRCgvlxxT06zTUBD6l5X5uqhYAt1kMCabMGyai0Cb/Bp1JHZaq+HZOzUf5v1hGAkBM173id0nB7fGsQpZLGVTWssSw0DCjnpWs8/g0EFKNy7HoSSa3wUlV8IgpzuF81t24deJLq4jksjH2zuOG8ZaGhxyn+n9/WQAm/CCR2CVrBUVlw2K5vTlksank+dgM8NjkDnI6Gqhpd7dO3xLrkz9Fq0xka4BiuSANAhNc6C7iOZpLY3DjHb9jIALS6cSOCSktrTW9EiFdgNOAMv2LMz4zGkyTPygtalov2Ri71o8OaZegB+3Ra1sX3w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=kd5boOvS+q5rVVsOKW3C9SGZ7jvv4HJO+PM0gqNKnl4=;
 b=BJlaXcAK/ynTnuUQfTUlOT7epSd1VhMqnWLflzmXucz1ZMpSiuFzzjlaY3CUrKcImgFs3pqA9ZkJrNO0LZXdPnAiYGfYooEX5Xe5mdj63vIbTq/KLy4ahqoKC7VA+NJRtVeQJUTglDB6xlEiVCBgVFDJDF6btxaB4UgLMChfKeedQGmSbjYqMVfshVFJ+AE98M6nRrOiLnX93bXzxmLZFtUx88xDKFf7JUEMGv+uTQ1rUrEoDfyKv/77Pwyq4DlySrVQflVAU0ui2Ka4lGRovkjVpRCbYfKqi9h48Zl8ohUsDOTo8ByaOR6KiF160FLbdw6vNfsbIf6Ag0ZLwHUg2Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <7c7d23ec-5961-3370-b774-b547f1316066@suse.com>
Date: Tue, 4 Jul 2023 15:53:50 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH 2/5] x86: change parameter names of
 nestedhvm_vcpu_iomap_get() definition
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <cover.1688049494.git.federico.serafini@bugseng.com>
 <7392b1adc50c77855bec846f1a14e30f6a8ae1d6.1688049495.git.federico.serafini@bugseng.com>
 <alpine.DEB.2.22.394.2306291225000.3936094@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2306291225000.3936094@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0049.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4a::22) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB9867:EE_
X-MS-Office365-Filtering-Correlation-Id: 98858728-3020-4f80-12a9-08db7c961505
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	HoJF3DZWyvW4E2fysxjh5thJm5n03bF1xfs6FjA58EYUa56oi+Q2Gz014dlxdGTjqoxLn1C2E89WnsDLMGC6A8IyuY0CzVkU1TTCCIpiOS5I0knCKSR4TQaRcA5JQNIBDf1ArNPNoQ5UHuSwr3G2Q0n6QGQp+INYgB4D50yOn4aagwQ2MfmTFflXBKvJpNjOpCm6FkeGBdhZx2EeiogilVqzpONoU06dzvkQjHb4HiepvyYPuBiObPbGd0suRmtUAAOTe+Mlb/Cyt/szLjZGH6EomqPpEfzWIAWGRCAUUIhotPLxtCbKX9JiSZLXW7FR0gpzvUWhwRnSvyke8NWPsR4u5nVVynShVbFFuQfq8NUgHUkGic2TKfragl2oivhvQZmwFcHPfxBj3VEjeIMUtfoWCY7enN5/gj6NmCD52Eo9eV/XdljeJ85ZTrd4oNcVaTufABnOPudcIszTikFyN3QR/3bQ6BsuA5r4UbliRWKew2k6m6I7/XOY4705jlYC+3jGSmG9tbj0C++6SOV6YmhZeJHkvUQY5ZeCWrPziudm1KX83U8mvBxlm7bIDDH6qx0iHiE2RPU9GbwiiO1kMc3ucCgVmiiRYOfpxpDPjVRvVI5NjC4X6UxqxZXbmG3n8AmADI3myC1xSGIRtXV7vA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(376002)(346002)(396003)(39860400002)(451199021)(6506007)(66556008)(66476007)(6916009)(4326008)(66946007)(38100700002)(478600001)(41300700001)(316002)(2616005)(83380400001)(186003)(53546011)(26005)(6512007)(54906003)(2906002)(7416002)(8936002)(5660300002)(6486002)(31686004)(86362001)(31696002)(36756003)(6666004)(8676002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam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f-8?B?QlluUzFIYlJQS3RZQjBsV3pPV3J4T2xGQVM1VmU3SzJvOTBpMnNNU3dTMXYv?=
 =?utf-8?B?VDJoR0JBYjdYbnRUMVVoVXd3SzRvcnc1cHVKS21Xd25ac3FydVVtdjdia2Jz?=
 =?utf-8?B?dTBaQURza1ZlZ3FVQVc4NTdwcHBxUDdFT2dSazU1UnFwQ3p2dmdyamFST0ha?=
 =?utf-8?B?ajV2UEdsUlFIQkg1eFd6MWhUdVZUOEdTcVdoRFhPbnBYQUxqQjIzcmVTZXRM?=
 =?utf-8?B?Mi9zdEVST0Q2TlhpWFdQdFNJSEg1U0M1KzBwQVcvYjdpWGgxeEJjUjk4MlpH?=
 =?utf-8?B?ZkRCVnZVa002ZVM2RGtOR2FrdWluWDBEUEhmc05iYXJvMkNLM2pOaGZHeHBP?=
 =?utf-8?B?TnBCMFZpMDVmZTFndzdOcm5TQzJCVXZmWnU0WHQ0WmsrSktPeUJVOStFZzZu?=
 =?utf-8?Q?3z7/3KPJzMlDzP0v8oZNPKykB?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 98858728-3020-4f80-12a9-08db7c961505
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 13:53:44.3632
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: bUXeJrozc0jJ2gzS+OwXSW/5b/+6K0wbTzTfE/dNCUayyaECm3mQnFkTkisl1XdpSZSCGVrfzVG745DOUf/0TA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9867

On 29.06.2023 21:25, Stefano Stabellini wrote:
> On Thu, 29 Jun 2023, Federico Serafini wrote:
>> Change parameter names of nestedhvm_vcpu_iomap_get() definition to
>> those used in the function declaration in order to:
>> 1) improve readability;

I see this was committed already, so ftaod no request to revert or what
not, but I disagree with this: Longer names are generally hampering
readability. What would have helped readability is if coding style was
fixed at least for all the line which were touched anyway.

Jan

>> 2) fix violations of MISRA C:2012 Rule 8.3.
>>
>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> 
> The title would be better as:
> x86/nestedhvm: change parameter names of nestedhvm_vcpu_iomap_get() definition
> 
> could be done on commit
> 
> 
>> ---
>>  xen/arch/x86/hvm/nestedhvm.c | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/xen/arch/x86/hvm/nestedhvm.c b/xen/arch/x86/hvm/nestedhvm.c
>> index ec68551127..64d7eec9a1 100644
>> --- a/xen/arch/x86/hvm/nestedhvm.c
>> +++ b/xen/arch/x86/hvm/nestedhvm.c
>> @@ -155,19 +155,19 @@ static int __init cf_check nestedhvm_setup(void)
>>  __initcall(nestedhvm_setup);
>>  
>>  unsigned long *
>> -nestedhvm_vcpu_iomap_get(bool_t port_80, bool_t port_ed)
>> +nestedhvm_vcpu_iomap_get(bool_t ioport_80, bool_t ioport_ed)
>>  {
>>      int i;
>>  
>>      if (!hvm_port80_allowed)
>> -        port_80 = 1;
>> +        ioport_80 = 1;
>>  
>> -    if (port_80 == 0) {
>> -        if (port_ed == 0)
>> +    if (ioport_80 == 0) {
>> +        if (ioport_ed == 0)
>>              return hvm_io_bitmap;
>>          i = 0;
>>      } else {
>> -        if (port_ed == 0)
>> +        if (ioport_ed == 0)
>>              i = 1;
>>          else
>>              i = 2;
>> -- 
>> 2.34.1
>>



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 13:57:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 13:57:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558368.872394 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgXD-0003Xn-95; Tue, 04 Jul 2023 13:57:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558368.872394; Tue, 04 Jul 2023 13:57:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgXD-0003Xg-64; Tue, 04 Jul 2023 13:57:39 +0000
Received: by outflank-mailman (input) for mailman id 558368;
 Tue, 04 Jul 2023 13:57:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=D/z2=CW=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGgXB-0003XW-Px
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 13:57:37 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on062d.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::62d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bb3b867d-1a72-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 15:57:36 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB9471.eurprd04.prod.outlook.com (2603:10a6:102:2b2::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 13:57:33 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 13:57:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bb3b867d-1a72-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=SlYME6nsKhCsEUXXuLCgfFkqTUJkVDcYuYqyZEPp+uY6acogP1iMPN88ER5CLvCEE508rhU3V8CU2SBoaEQErDzqXDWCbQWH9ZbQbI+whlJB8NZe0tTZD9bJs3EJlC1E1pnqiL06ONr4lTqdTYdHwCdy5xYUUa/E7Q30zj66XygyjD7wABPraZI1FhXtxJjpoaarDl+vFgSfOXY7XTi1qHe1grwtbUf0qSkMyoz7THMNxGPR8mK19u2INntrI5NtzSyUx4DVG3Xtb8jC8nWSGBYGShz6NfWIEtzf/yx6+3/gO3/0PEdNzOJfuJ+hHj1Ylu6H/7t3O83GhhTpBhk/8A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MMuiqdglR/yPIudSk30KF3EwEAcpwXt/Lg63G9vNeGc=;
 b=e4PwJwn2JqQlUthLSaceqKYkEyPViknhEYLSz3TPlED9vqmFoAbKkTdgrZkqldgSEt7Ujl6NpE6TwUAp5M+gK3/UHyiTUpsYiPTt+5fxHXQ6MjAQHur17UDEXda0NwyYH6I3X6muVr7JWX6avSpw6vV6jgkDyBvtpAvaIVs5TgNGPHPpzbtA9E8MqFLE1DoEJVLVHNyxU8PtQj1j1ojt9M6BVE8P6kUFSaJYIPVi9Z/uV8vergM+ESTvbfjo6Mw8ZGVys0t6+xIHUmll2uvBAtMnRb7fhYZM2J8mJAUbIudbYZAtJyLopZZwMvOzY6lcURbx5Y5W6Ml1ZCU/qDMCSA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MMuiqdglR/yPIudSk30KF3EwEAcpwXt/Lg63G9vNeGc=;
 b=WIE4TekLfjBEu4xhhQXwNQ9E8ccAK5MMAYW4pGAKj2cHeVBcO3tRfdXGWy9vex4He6jjfijlUGxllcfZbtDMu/6JADURrnmU8K9BJmyZKY1Cfw+jNzaWXPH43Urpz1L4xfsgF6BMUMVB/yAnzBcWYp7iL1xaZTO6nzi23Sx39pIbXnDc0ZCJ/43AjQnZ3nLGxaJ5ZbQx//J/AQ8C3/qyAaGFLNnOVy72AuqtyU3jnwfe+tMMcRz2lOn6ecrCCVi3JZud6TyFkUW5Uv4LkchUwAq0PBT9mbjzwpLMbIOY+ihzalOgu5sQryVZFehzGFKXY4ZAOrSiJmPQyOwBml/9pw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e7af3c85-92ec-7d0f-0e63-3a1e5d65877e@suse.com>
Date: Tue, 4 Jul 2023 15:57:40 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH 4/5] x86/x86_emulate: change parameter name from 's'
 to 'state'
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>,
 Federico Serafini <federico.serafini@bugseng.com>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
References: <cover.1688049494.git.federico.serafini@bugseng.com>
 <8c8bc96b96a1111a4651f970f506d304809ea40d.1688049495.git.federico.serafini@bugseng.com>
 <alpine.DEB.2.22.394.2306291230500.3936094@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2306291230500.3936094@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0109.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a3::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB9471:EE_
X-MS-Office365-Filtering-Correlation-Id: bb96433c-44e3-42ec-7f95-08db7c969d84
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	9zRgTQhQVyOwVn0EpU/QMmP5OOFlTl2Ga7CLZmXHp4HKy/h8UDkPIs6zqFyuiTpgD12A87X8p97P6fa0+S4VliLUo4TuCBc6/je7RftJ3U3AtKZrqWwWgKOWtC6OJwrSqMqdTqEftr9fMPSrnTaa8SOQd3v85fDTuc7zmBMXLDQPL/nddOekevqBu6UphMjd/SkKGCA4Kqg3Ncp21wtx1sfD1zhZ1s+YsXPXRaDdsBMylHndwFTMafu2b2vOXdMSUW8SKlbqGtL6eFS9LYTvOdKL3GcCO08GDf5JTd3c0HNfaR71uyjRar/jb1f5haqRAdiVuEg80BD9xkFr+ANYJEEyOVmP+phJPFmaxLUrqDWD2gB4vz/Ehp7w0vqoSlmkzBKb7rtHKRg5QAYTZ4iyUPV6ZlQPNLRmNEyhfJuZCEDvov/Z6Rmh+tiGKthY6QhdevEh94NJKAm9itWg5Kk3C2lOgrLs3kA5uxvOKUe7VMQkzf18Ki5YzZlPr36AhPiQMWMF2pgS0rFhW/iPdyqpNBIrj23yWhOlTO0TrqDwB5gfUC69yxibaMOZtY2nxjcLcZWYyVwZjFdqKqgXmL53NMMK0CCpWb57/4qfd/jPBknzpZW15kGmhNV+DhE+/Dfpn0J7hvF1MtCLq4GIpmvrbQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(136003)(39860400002)(396003)(366004)(451199021)(26005)(31686004)(478600001)(6666004)(6512007)(6506007)(31696002)(86362001)(2616005)(186003)(53546011)(38100700002)(54906003)(66476007)(66556008)(4326008)(66946007)(110136005)(83380400001)(6486002)(316002)(8676002)(8936002)(7416002)(4744005)(41300700001)(2906002)(5660300002)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WkY2VXlxSVFmanRKV0VNeUROMHVVelc5ang1VnNGQkxFWVRoejM1U1RTK2dW?=
 =?utf-8?B?RlhvemdPei82K2h6a3YrSTNsNDFMTWE1c080RVZjMnV5UH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FFjd1h0UUl6YzdQNGgzcVR6WWxPdDIwM0Iz?=
 =?utf-8?B?SWlyRGlScVZ6eUZieVdhRU5aN3hxWUxYdDY2ZWFrUE5VWURTYTlZeUpVYmlL?=
 =?utf-8?B?WkJCS3ZHbEs4S3RCMzBnWUs3Y1FwYy9rc0NSTERiZmRYL2ZtTStNV3lVWUYr?=
 =?utf-8?B?MEdYeTlIQkRZWktONEFTNHp2UFVsYUozSmhJekRROUxNdHlTZ1FMRCt1TlZC?=
 =?utf-8?B?QXFrWjEzM2dqenhONldGTC9HMEdvSVBOOFRIMkZJNWVRVGNUczhJT0tnUk14?=
 =?utf-8?Q?yzoIWvjI12a3FyY3XhAwb7Zes?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bb96433c-44e3-42ec-7f95-08db7c969d84
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 13:57:33.3777
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Vkok9Vuv7L6bPj664W/+PtpiHpll7ueIseg75ROr8lEgceZ3xjvNItvt8iTblEU1hetj23T9fwEIKtEURKu0VQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9471

On 29.06.2023 21:31, Stefano Stabellini wrote:
> On Thu, 29 Jun 2023, Federico Serafini wrote:
>> Change parameter name from 's' to 'state' in function definitions in
>> order to:
>> 1) keep consistency with the parameter names used in the corresponding
>>    declarations;
>> 2) keep consistency with parameter names used within x86_emulate.h;
>> 3) fix violations of MISRA C:2012 Rule 8.3.
>>
>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> 
> You could use x86emul: as tag in the title. I'll let Jan choose the tag
> he prefers.

x86emul: or x86/emul: is what we commonly use. That said, I don't like
this change. The files touched are pretty new, and it was deliberate
that I used s, not state, for the names. This is shorthand much like
(globally) we use v (instead of vcpu) and d (instead of domain).

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:01:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:01:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558374.872404 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgaL-00056p-Q1; Tue, 04 Jul 2023 14:00:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558374.872404; Tue, 04 Jul 2023 14:00:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgaL-00056i-N3; Tue, 04 Jul 2023 14:00:53 +0000
Received: by outflank-mailman (input) for mailman id 558374;
 Tue, 04 Jul 2023 14:00:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=D/z2=CW=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGgaK-00056c-BI
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:00:52 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2060d.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::60d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2f2d3c74-1a73-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 16:00:51 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB9138.eurprd04.prod.outlook.com (2603:10a6:102:22d::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:00:48 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:00:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2f2d3c74-1a73-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=kZlPC3vMUIxxH/RE7HuKeAiAVKN33yHhf5QhD62F0YR6GSkaHf+ffVIWzOTAEPMNHEbT9BrdHqMExUaWaPviYOGhNa9KnPBlAu/XlZ2GzJBIQONEnOfKUHgT5B2n1sk6/qJ3/iOv0kkS1hYn5uYgsti/ScKkXNr/zNrYqPHWQvue9El53vGlGozghNBBOYYydBoyeB8SXpJeXjUXh24pPDHiAFfrXcPHYfexNYZzYR6t9MWI2espUJaa4iGq1JveaHovMRdh3mf9Ut35hT3dVcnFNKSXY8K18HtmGbvnuKHbcVccL8ac06EEmbQp2Tg4poa962Wc3h7Bf1vj1+dO+w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=gll7WaYdb8WKnaoDfTPkTUK3k2BeCemleAxdO6F4qNo=;
 b=Z67RlhSK8qtURFLls64BTlKpIefvZjrU16mo5coMSg6O5Px6hVx1Mj0e8W3CB3jIZCmUmu3Qx5oBwMGUprwL4CkEo5hP47o4egLK49Cz3aGLKX98YkaYBy+/mBAqHABtuTI8FJoIG5uUB4cdhpN4ljBQMHUXoWxYVm8bErxRSwdDel3q8/l7Xte8WNxFMOicTmaSZqqaJKOczBoYGgolX+F0zhSt5wPFbTG3jbbQQaCvm3TWAeD6L8w4HE4p7qaiiwCjWTnaozYetCw/pmsR5XoQubQ2shNHF25h/nwjwNwGnaDQK4szcX+9z29VyY2XjUqjPEippPBMHP17JXdXEw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=gll7WaYdb8WKnaoDfTPkTUK3k2BeCemleAxdO6F4qNo=;
 b=WC9q8KFPcjULEPffrLyUBJ/zYk/M5fKBq1mn3vKFuXq/33x1okQ+yjHHO8C0I4IIRmsY9Tq0mxh/5L50IpNfmJkTUOoRxBgCtkkmUGQLZ/fSqLYpD9+jiHaoNrnNVOGTHteMOE/CmZlr/W2sEmIQYValeJyOSw+Hw0ADnN676NrZ4lTVdn9Eu7dGZBdlgFLmGECYjaL3k67S2KylCiiZJIPfGSD6F3utjBoFcoHfsUpRssHMHAYNrYFh2y1/TITT6jLIKWlViZ8ES0Gt2A48S+Bbx4vSPXXA+Oc0XoG2cuSAOFRK9t4Arkw2oM9eDNrRcCBWkOmWF4pFkoaKAJz2Jw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <0076f2d6-03b7-0a1c-c423-1f55b7195407@suse.com>
Date: Tue, 4 Jul 2023 16:00:54 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH 5/5] x86: make parameter names of function
 declarations consistent
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Paul Durrant <paul@xen.org>,
 Tamas K Lengyel <tamas@tklengyel.com>,
 Alexandru Isaila <aisaila@bitdefender.com>,
 Petre Pircalabu <ppircalabu@bitdefender.com>,
 Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1688049494.git.federico.serafini@bugseng.com>
 <5ee57d7bcd79daa0314f182ecb73e1eb6d8ecc03.1688049495.git.federico.serafini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <5ee57d7bcd79daa0314f182ecb73e1eb6d8ecc03.1688049495.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0061.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4b::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB9138:EE_
X-MS-Office365-Filtering-Correlation-Id: 98abebdb-395e-437a-4d38-08db7c97118c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	uP7e0A8XKaVLiYTL7EqaerIX3d/IfDwpU2F0YlJ3SBveLcNGTGZQbwoyZbol0MPIWJSpRXiNLuZFBAiZ0sXzzF3Yh9bCnGJc7w/HbZgBPB65IVSJzghw5LUaztO3xjXkF19SP2TGOzR69TYWd9HwGHu2fqEaz7tD8eIKr/p0qYnm06rRl9dX4F4IslRKJh8No93sztqv89WWHxJD5pu1oIa1fU5HCo3byPH+oej9hoscRQB5vP1d1PhF6mEk5XReg56kdq125sFXS9xzSKHv3oIBMXfBVVR1KNOQre3htqDhJWjyfNwKdTj6hTHM0Q1sOTGiePlTuYdi5w0VohKrn199X6nb+tv4tcPoK3EnOSKiFgiu6LVPYpKORTzCjjEmns38D72+WQvHZT9VLlwu8t4KEsgA5/doohkZjCiL3MCgsLEIJM5wcLtvaMqopS8N/uasCcYpoz73F8pUKa6tnzrCRV+B+p7IVj+fg1y4TYloEZHpuefMgoRZjpJFZJniDK7UZOD6RQguMT6Tl7JOL9ikr7szlROOW2ctWZ8z/n25My8qVVQHk5ldUO1Apaf6mkGygVrpnNvZJ0Fnu4ZNCWLV+uRRWvaXIw55YpgncUNpDEJmR2oGpxuedzFr0Q9ZPtQ+qYH+I7JfBAJ5fRsDOQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(376002)(366004)(346002)(396003)(39860400002)(451199021)(6666004)(478600001)(6512007)(86362001)(31696002)(6486002)(38100700002)(316002)(66946007)(26005)(53546011)(186003)(66476007)(2616005)(66556008)(6506007)(4326008)(54906003)(6916009)(31686004)(5660300002)(7416002)(8676002)(2906002)(4744005)(41300700001)(8936002)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?L2F6YmN0c2lMU3IzdkdGb3ZxUUV3Tk5OQ2k1Yk8rb2xtR010KzdEcDdoLzFt?=
 =?utf-8?B?M1REM0VmcUp1M3JPc0JaN1lVRkNqZ0dGYmptbVRIc1V4R05HYWNya2MwR25Z?=
 =?utf-8?B?WmxpZlhwYkNNNEcwTnpMc2V2N09Rd2pRWTd0dEF6SlZkaVN5SERuREVVR0dH?=
 =?utf-8?B?RVRnZUNqUi9rb3Q3dUhHVUx6VGpITjhNWWpSQ29uREhVK3ZwclZnRlhDbFdz?=
 =?utf-8?B?czc1MHVsWlE3a0tTaFpndlRFZ3lGdGQzdVBGV0lVdC9oUko1MUtPMkpEa1RS?=
 =?utf-8?B?TnQwNDBoVTNhN3BiL2lWamMvNHVZNDdNQWovSjFEdUpmSksxME5IYkU5WklP?=
 =?utf-8?B?NVkyUzE3eUs5TzJyTWJJUHN6cTdEUFVyNEpZRWFMREt3ZHl6cHM2UkdERy9P?=
 =?utf-8?B?c25OSmRUZTdOUVFlcGpVc0lwYy9iS3RoSDlIaWJqa1QyNC9MQXczVWF2TCtn?=
 =?utf-8?B?UmZFYUtDM29raUVUazdmL29HZnBjdStrd2RBTkdtdmExZlVVNkk2OWg2djRp?=
 =?utf-8?B?Ym02cnFXc3JwOUJEK0pVejZ1T0NmbzBYMXc4dlFUd0JFd04wbUhUZjhHS1Fz?=
 =?utf-8?B?S0JNekJ3cllQa3Z1cUdSMFhITVNZZ2tFTGJMYkhGUkVUdGZCV21JOC95dUdF?=
 =?utf-8?B?cURqRFJ4bEEvVXJhdFFIWnhJYTQ5MWJycE4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YR1FB?=
 =?utf-8?B?Q3djcWNqd0dac3M0SzNQL1ArYkkzYXlSVXNmVTltOHhldDZmMWNFVm1BeTBK?=
 =?utf-8?B?WHdia3g1cDJQYVFWM2M4d29HZUM1UTVCN1I0SzJVbHQ0OStqOHRFQ3RjOVBn?=
 =?utf-8?B?bll1MmhTdUttU1YvVG9oRS8wWjJ5S1R3aEMzYWw5N1orMmxTTm9GdGZDVita?=
 =?utf-8?B?bWpxYkZiZndUcFRrU2c5YWhMcVlxOEVxMDlyR2RGelVnejc0Z1VEUFhHbWFC?=
 =?utf-8?B?eDIwSEZwWk1jNnBLUytlTUhTYW1IRjhFT0xIUUgycW9ONEVvTnl1ajY5YndN?=
 =?utf-8?B?UHhsOGxJa0lSNEUvdnJ4QkYxc0lCUTRrMjRjUWRzN2ZwbGV2N0hxby9Pa0Ez?=
 =?utf-8?B?eEFJUFZWL3dYSDMwRUc3WDl1Y1dSaTZWaEJ6LzVFMDFGTFlQSXNLaHZ4OFJE?=
 =?utf-8?B?UWkyNTBUWGhxNXcvUGNPWUhiQzc2NTdPMUVYQ3J5Q0NkV2JER2lzMTBHa000?=
 =?utf-8?B?MVMvT2h1QitPYVkzc0MzaXVjeGtCUG9FMnZrdWlOQlZWZkNQei9hWXp2YXFn?=
 =?utf-8?Q?g378puj0a1nEokpNE6Vs97erl?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 98abebdb-395e-437a-4d38-08db7c97118c
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:00:48.0461
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: KWZ462A6jg7p91S/JGVrZC3YkkYwP9Kg1a68hFs9EikVQ7gcXJRpJ5gXWgI8xfDBsUaiMeDS23Etqu0jnxXcUQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9138

On 29.06.2023 17:55, Federico Serafini wrote:
> --- a/xen/arch/x86/cpu/mcheck/mce.h
> +++ b/xen/arch/x86/cpu/mcheck/mce.h
> @@ -44,7 +44,7 @@ extern uint8_t cmci_apic_vector;
>  extern bool lmce_support;
>  
>  /* Init functions */
> -enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *c);
> +enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *ci);

Supported even by ...

>  enum mcheck_type intel_mcheck_init(struct cpuinfo_x86 *c, bool bsp);

... immediate context, c is the name we use for parameters of this type.
You want to change the definition in such cases instead of the
declaration.

I also think this patch could do with splitting, not the least to
reduce the Cc list(s) needed.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:06:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:06:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558378.872414 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgfq-0005iq-FA; Tue, 04 Jul 2023 14:06:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558378.872414; Tue, 04 Jul 2023 14:06:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgfq-0005ij-BC; Tue, 04 Jul 2023 14:06:34 +0000
Received: by outflank-mailman (input) for mailman id 558378;
 Tue, 04 Jul 2023 14:06:33 +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
 <SRS0=U0S6=CW=gmail.com=bart.vanassche@srs-se1.protection.inumbo.net>)
 id 1qGgfp-0005id-Jv
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:06:33 +0000
Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com
 [209.85.214.177]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f98b8bce-1a73-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 16:06:31 +0200 (CEST)
Received: by mail-pl1-f177.google.com with SMTP id
 d9443c01a7336-1b89bda02ebso13665035ad.0
 for <xen-devel@lists.xenproject.org>; Tue, 04 Jul 2023 07:06:31 -0700 (PDT)
Received: from [192.168.50.14] ([98.51.102.78])
 by smtp.gmail.com with ESMTPSA id
 jk4-20020a170903330400b001b672af624esm13083569plb.164.2023.07.04.07.06.26
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 04 Jul 2023 07:06:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f98b8bce-1a73-11ee-8611-37d641c3527e
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688479590; x=1691071590;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=JV2SCOEdB9t0w6tigDexjJMYhGF54ZwsLlYmJ1gE7wU=;
        b=STgVxKubhKFXFR/0SG2VGwjeMGvGTPSKgdHelGhM7R1cmxEng5CwxQ+949RTd1LW8g
         YFOBs5rBQp3aEo0XvF7MPAT7XXCneN+XVpxX5Snuz8mpBpEQdyJaceEODGA1bt4SFVaV
         nGP76XHESoWY2esDLySFBNSf5Zttuc4Qr3d7H2RYOGylFgXG+8gq/Fa5Ajhf9oG7LSLT
         1bLb2Nhr6eRceNvJ73j17fCmf7aUMHXDO07H7ZYV69eSwl9Z8xITMCylmnFSENncBvSN
         /XKBkgaRap0A/u0+JcyKdMVrT/yUXr1qu1JlNFuXzSiMjkeboGWIGJMfwNsBknaOJ8qL
         T5xA==
X-Gm-Message-State: ABy/qLYm/THb2FhcUrz/8oHkswrynCHJ7Q2Lr1AnuvlxGAKs6+SNgTUB
	kTlFZEZ3birMFJu3prYW0ec=
X-Google-Smtp-Source: APBJJlEESj5502hCCjnCrW5aNdhMviGxH5NXIz8SFwBF+614aVB6e0+1hJtWMTw8TJzZNuQy8olTNg==
X-Received: by 2002:a17:903:447:b0:1b8:a31b:ac85 with SMTP id iw7-20020a170903044700b001b8a31bac85mr2719760plb.41.1688479589749;
        Tue, 04 Jul 2023 07:06:29 -0700 (PDT)
Message-ID: <bb91e76b-0bd8-a949-f8b9-868f919ebcb9@acm.org>
Date: Tue, 4 Jul 2023 07:06:26 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions
Content-Language: en-US
To: Jan Kara <jack@suse.cz>, linux-block@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
 Christoph Hellwig <hch@infradead.org>, Alasdair Kergon <agk@redhat.com>,
 Andrew Morton <akpm@linux-foundation.org>, Anna Schumaker <anna@kernel.org>,
 Chao Yu <chao@kernel.org>, Christian Borntraeger
 <borntraeger@linux.ibm.com>, "Darrick J. Wong" <djwong@kernel.org>,
 Dave Kleikamp <shaggy@kernel.org>, David Sterba <dsterba@suse.com>,
 dm-devel@redhat.com, drbd-dev@lists.linbit.com, Gao Xiang
 <xiang@kernel.org>, Jack Wang <jinpu.wang@ionos.com>,
 Jaegeuk Kim <jaegeuk@kernel.org>, jfs-discussion@lists.sourceforge.net,
 Joern Engel <joern@lazybastard.org>, Joseph Qi
 <joseph.qi@linux.alibaba.com>, Kent Overstreet <kent.overstreet@gmail.com>,
 linux-bcache@vger.kernel.org, linux-btrfs@vger.kernel.org,
 linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org,
 linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org,
 linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org,
 linux-nilfs@vger.kernel.org, linux-nvme@lists.infradead.org,
 linux-pm@vger.kernel.org, linux-raid@vger.kernel.org,
 linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
 linux-xfs@vger.kernel.org, "Md. Haris Iqbal" <haris.iqbal@ionos.com>,
 Mike Snitzer <snitzer@kernel.org>, Minchan Kim <minchan@kernel.org>,
 ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>, Song Liu <song@kernel.org>,
 Sven Schnelle <svens@linux.ibm.com>, target-devel@vger.kernel.org,
 Ted Tso <tytso@mit.edu>, Trond Myklebust <trond.myklebust@hammerspace.com>,
 xen-devel@lists.xenproject.org
References: <20230629165206.383-1-jack@suse.cz>
 <20230704122224.16257-1-jack@suse.cz>
From: Bart Van Assche <bvanassche@acm.org>
In-Reply-To: <20230704122224.16257-1-jack@suse.cz>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 7/4/23 05:21, Jan Kara wrote:
> +struct bdev_handle {
> +	struct block_device *bdev;
> +	void *holder;
> +};

Please explain in the patch description why a holder pointer is 
introduced in struct bdev_handle and how it relates to the bd_holder 
pointer in struct block_device. Is one of the purposes of this patch 
series perhaps to add support for multiple holders per block device?

Thanks,

Bart.



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:09:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:09:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558383.872423 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgiX-0006Hi-SF; Tue, 04 Jul 2023 14:09:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558383.872423; Tue, 04 Jul 2023 14:09:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgiX-0006Hb-PY; Tue, 04 Jul 2023 14:09:21 +0000
Received: by outflank-mailman (input) for mailman id 558383;
 Tue, 04 Jul 2023 14:09:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kGqQ=CW=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qGgiW-0006HV-Fr
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:09:20 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on2061f.outbound.protection.outlook.com
 [2a01:111:f400:fe12::61f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5d62fe3a-1a74-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 16:09:18 +0200 (CEST)
Received: from DB7PR03CA0086.eurprd03.prod.outlook.com (2603:10a6:10:72::27)
 by PAXPR08MB6541.eurprd08.prod.outlook.com (2603:10a6:102:15a::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:09:15 +0000
Received: from DBAEUR03FT014.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:72:cafe::17) by DB7PR03CA0086.outlook.office365.com
 (2603:10a6:10:72::27) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.31 via Frontend
 Transport; Tue, 4 Jul 2023 14:09:15 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT014.mail.protection.outlook.com (100.127.143.22) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.18 via Frontend Transport; Tue, 4 Jul 2023 14:09:15 +0000
Received: ("Tessian outbound c63645f235c1:v142");
 Tue, 04 Jul 2023 14:09:15 +0000
Received: from 441c65287bbb.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 94BABC68-05E5-4F02-AD7E-E6870F9783E5.1; 
 Tue, 04 Jul 2023 14:09:08 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 441c65287bbb.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 04 Jul 2023 14:09:08 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by AS2PR08MB10055.eurprd08.prod.outlook.com (2603:10a6:20b:645::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:09:06 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:09:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5d62fe3a-1a74-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=EogklM6MvVYcQsFwT0exf4GD0ezono7El60mI0r+JDE=;
 b=CVo3SoaHAnHVwho4wobM24lursZHaYC+k/9lzCbg9UZBwCnQnsCxDjK1WVjzOJlhxSshxSPamk3Z/MWBNnE0Gf7etBwU0upMFgTz+/T6yX7vJahb91oVHn8OYhD8bmxndgDSYrJxIfUQqiS22LFSelcw9q8pG3mbyDv9dnIn3bE=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 887afb4d922a0d88
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=T12WbI7oLNSnLx176fcj1mfQyoGBFMgxKus+GNwhyarZ7TYm/6Qc+WOEDwQeTXri9W173dpMvHT98l1GudmDg6JhHXak2Cdfd/rM9xvS62D//MLJZ5Z0HW5CEk7F3gqmAYWJ5j6Vh9w87nWlYCvl4HPjxuxHFu+7x/COK9bvbRWyAnxVzTjKH4Cg1ocBErrkqXL1xJFxqq4UNWP9CqHy+vP3rxO9IQpHimhbc5TAOFG5/4g9VXxLmTULexQ43qBaeldGbIgLeBaQbF2aEVc9dEORr6qnnUgZLk19hfk+pEBXdu8pQTpZVQIG+dJ8PMmasoLPTx9TgqD5ZfpvT+mbsA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=EogklM6MvVYcQsFwT0exf4GD0ezono7El60mI0r+JDE=;
 b=MJ+eNXG0BfuR3zGgPcq2z1Y9BfrzT6fWT3Q11HMo5udYRGAi0sCBfXPlW1+TFvNu30bg/YHSarv2PMwlt0ypdfsC1H56kpQlWr9x1FZoHTFJQd+knIq4rTiOoLJfmS6OPggbT6y+CsVCxzqcBt9TIU60gmY+1pkkhqKtOyXM0UQgN0SityBYn0DI5YeN7bz5yDaVMbGD90U3UKQM0aqTTTueF3pa5eWaPPHzpqMvD/mr0OeFJlfy6/NE3tN1N+L6C//yjPTiA8SvrARN0jSa9fkHp+ach+teJS4aydPFrtV9Lgd0mVipmDNxG8ABtjosIaUGZgCGPVgkwDsveR+s8g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=EogklM6MvVYcQsFwT0exf4GD0ezono7El60mI0r+JDE=;
 b=CVo3SoaHAnHVwho4wobM24lursZHaYC+k/9lzCbg9UZBwCnQnsCxDjK1WVjzOJlhxSshxSPamk3Z/MWBNnE0Gf7etBwU0upMFgTz+/T6yX7vJahb91oVHn8OYhD8bmxndgDSYrJxIfUQqiS22LFSelcw9q8pG3mbyDv9dnIn3bE=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Luca Fancellu
	<Luca.Fancellu@arm.com>, "michal.orzel@amd.com" <michal.orzel@amd.com>, Henry
 Wang <Henry.Wang@arm.com>, Julien Grall <jgrall@amazon.com>
Subject: Re: [v2 1/4] xen/arm64: head: Don't map too much in boot_third
Thread-Topic: [v2 1/4] xen/arm64: head: Don't map too much in boot_third
Thread-Index: AQHZqsX4yAVem92w702jqx8j/I6WWK+prJaA
Date: Tue, 4 Jul 2023 14:09:06 +0000
Message-ID: <DDEAF460-9AEF-4321-876E-A63A0A78F255@arm.com>
References: <20230629201129.12934-1-julien@xen.org>
 <20230629201129.12934-2-julien@xen.org>
In-Reply-To: <20230629201129.12934-2-julien@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|AS2PR08MB10055:EE_|DBAEUR03FT014:EE_|PAXPR08MB6541:EE_
X-MS-Office365-Filtering-Correlation-Id: f7ac2673-8720-43e6-572f-08db7c983ff4
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 XhK7c/2GakBFAns5fb7LagEOvZE+EAGuUqkbc3pCbUAWbdMEIV1WdhbKN0wGitoqAyjiTC/F5klQzUTfPUJa4I6LNwnSYhg/F+bydka+TvAO0jf+F9YUXOQj4Q6hQFrA6/NqzIcZEMThrGQKgQS5YaeERszTUSJSgFVIRBs8C3iVLJD4wORe69u+mj/nFYXiiATIAH01Ql+4i/anDs78/dY4xQ0+YgRvfxf7Jlv1YgsodomsJa0gYA7wj+p14+dT8zeIz6TFE9BUkUYBfngvUo8Z8jeMF2eJ8rW4Zx4ImuWyjAawJpjdsBxsJDaCdS3QcoHPsijxx9TAkhR061k7YKafSjFJhR76sFNYWyvQTlr+534Zz7lNgCYAC3HU2y7Y1XoCkfYyyvC2A3W8w8Ia/eirFf1Vsqn1SSBTZ6TWjq2aU4YFbvlCej2zg7dmk1zQ7Swynu+0tfD2OhTSSt2zVGNVNtUniB5oQ3TtvzE4IhJAuFRPUyey0D706xP9Xhf4/CJO/F45ryUZVd3evxMwJ7ic79QjUZsPVyB+oRy/ddMIwVjGdqPHIRqo7t+1I6RzCN6uomts2z/tbDyBs6v7URqEq6D7jIe0lAAX41SXTKv6mGYrrcelAdkWNKyp0mV+c+HvMvKs10DoaoDXpNrCBQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(366004)(136003)(346002)(39860400002)(451199021)(38100700002)(71200400001)(33656002)(2906002)(6486002)(8936002)(38070700005)(8676002)(54906003)(36756003)(41300700001)(5660300002)(478600001)(76116006)(6916009)(66946007)(66556008)(66476007)(64756008)(53546011)(91956017)(66446008)(6512007)(186003)(6506007)(86362001)(4326008)(316002)(2616005)(122000001)(83380400001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <4F6D1ADFA272554C9156A2EE915821AE@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10055
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT014.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	dc52b7bf-81d5-46b6-b984-08db7c983a7a
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	1bTwQCYWdD2iIFL37zCpbHFn0r/Pj1HGv98PgwX2TV09S/AtwgQi+MVTg0Bbp9JfZLp9/R13KVLv997IfQ8Jx2/zQZIl4Fb+5q1yMIOV3nEhzm7KyCtJqIvfI3hsNHDQTV8xd6b0ieDJA9astB04cusRPcrqxPbl0NDUNAjvV6dN7P/BD/ppTKZ+4vJcSm/l5ou010Owh2kLk/KOFIzmvgpfS9soHhZrpTz4IbdtnYbaW2i5zfooIY5svFOGkw3EaaRN6QeWxBx1n2CpkL/X1NtRDmLewlQy5ibNXUIuF8pubWt6GiIxb2bz2c0zERTLaAxebC2dd9oQOd8RSyN83PMU0k77Ov4x3TU2AxTmrzaRr44Kf7HWCnx0Jr5IO4NrEWOeDKKDUzm04vSH1NfldLu6JCoB9T1Eb9wGAjRVQXM8swpPmz6IWJn6vXxXaSape2lRL/4D+kcbQ3ZhXkQVsKw7/EAJ9Gho83P54/zXQN+QF4yus0VF7kFKAqsnSPJhQT8QS2iupT8Wl4GEdWitPlnEqxHNCO87e6CzRBQPk70WZLeEmz7KgJdBja4HI0qKV9P5PaNdFN1PoTxDshZvoDuK/hZXmNIvVW6S6dg33XIkFrcqrF4YeCuJ4iDYuSxABocDoiFkJclgnIkBgIduQFTzC7mBYp5tU7uaJ7zUr03t0QIlwMy8oQ38gH0zN3Okkelb75ENj22NiZBfAzbz4qktoxFTlNpwsSnfJADW4ryEUMJ6AewjrNXHWFGMU69r
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(346002)(396003)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(107886003)(26005)(478600001)(6506007)(82740400003)(6512007)(86362001)(2616005)(186003)(53546011)(81166007)(54906003)(4326008)(70586007)(36860700001)(83380400001)(356005)(336012)(6486002)(316002)(70206006)(47076005)(8676002)(8936002)(6862004)(40460700003)(41300700001)(2906002)(40480700001)(5660300002)(33656002)(82310400005)(36756003);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:09:15.2751
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: f7ac2673-8720-43e6-572f-08db7c983ff4
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT014.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6541

Hi Julien,

> On 29 Jun 2023, at 22:11, Julien Grall <julien@xen.org> wrote:
>=20
> From: Julien Grall <jgrall@amazon.com>
>=20
> At the moment, we are mapping the size of the reserved area for Xen
> (i.e. 2MB) even if the binary is smaller. We don't exactly know what's
> after Xen, so it is not a good idea to map more than necessary for a
> couple of reasons:
>    * We would need to use break-before-make if the extra PTE needs to
>      be updated to point to another region
>    * The extra area mapped may be mapped again by Xen with different
>      memory attribute. This would result to attribute mismatch.
>=20
> Therefore, rework the logic in create_page_tables() to map only what's
> necessary. To simplify the logic, we also want to make sure _end
> is page-aligned. So align the symbol in the linker and add an assert
> to catch any change.
>=20
> Lastly, take the opportunity to confirm that _start is equal to
> XEN_VIRT_START as the assembly is using both interchangeably.
>=20
> Signed-off-by: Julien Grall <jgrall@amazon.com>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

>=20
> ---
>=20
>    Changes in v2:
>        - Fix typo and coding style
>        - Check _start =3D=3D XEN_VIRT_START
> ---
> xen/arch/arm/arm64/head.S | 15 ++++++++++++++-
> xen/arch/arm/xen.lds.S    |  9 +++++++++
> 2 files changed, 23 insertions(+), 1 deletion(-)
>=20
> diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
> index c0e03755bb10..5e9562a22240 100644
> --- a/xen/arch/arm/arm64/head.S
> +++ b/xen/arch/arm/arm64/head.S
> @@ -572,6 +572,19 @@ create_page_tables:
>         create_table_entry boot_first, boot_second, x0, 1, x1, x2, x3
>         create_table_entry boot_second, boot_third, x0, 2, x1, x2, x3
>=20
> +        /*
> +         * Find the size of Xen in pages and multiply by the size of a
> +         * PTE. This will then be compared in the mapping loop below.
> +         *
> +         * Note the multiplication is just to avoid using an extra
> +         * register/instruction per iteration.
> +         */
> +        ldr   x0, =3D_start            /* x0 :=3D vaddr(_start) */
> +        ldr   x1, =3D_end              /* x1 :=3D vaddr(_end) */
> +        sub   x0, x1, x0             /* x0 :=3D effective size of Xen */
> +        lsr   x0, x0, #PAGE_SHIFT    /* x0 :=3D Number of pages for Xen =
*/
> +        lsl   x0, x0, #3             /* x0 :=3D Number of pages * PTE si=
ze */
> +
>         /* Map Xen */
>         adr_l x4, boot_third
>=20
> @@ -585,7 +598,7 @@ create_page_tables:
> 1:      str   x2, [x4, x1]           /* Map vaddr(start) */
>         add   x2, x2, #PAGE_SIZE     /* Next page */
>         add   x1, x1, #8             /* Next slot */
> -        cmp   x1, #(XEN_PT_LPAE_ENTRIES<<3) /* 512 entries per page */
> +        cmp   x1, x0                 /* Loop until we map all of Xen */
>         b.lt  1b
>=20
>         /*
> diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
> index d36b67708ab1..a3c90ca82316 100644
> --- a/xen/arch/arm/xen.lds.S
> +++ b/xen/arch/arm/xen.lds.S
> @@ -212,6 +212,7 @@ SECTIONS
>        . =3D ALIGN(POINTER_ALIGN);
>        __bss_end =3D .;
>   } :text
> +  . =3D ALIGN(PAGE_SIZE);
>   _end =3D . ;
>=20
>   /* Section for the device tree blob (if any). */
> @@ -226,6 +227,12 @@ SECTIONS
>   ELF_DETAILS_SECTIONS
> }
>=20
> +/*
> + * The assembly code use _start and XEN_VIRT_START interchangeably to
> + * match the context.
> + */
> +ASSERT(_start =3D=3D XEN_VIRT_START, "_start !=3D XEN_VIRT_START")
> +
> /*
>  * We require that Xen is loaded at a page boundary, so this ensures that=
 any
>  * code running on the identity map cannot cross a section boundary.
> @@ -241,4 +248,6 @@ ASSERT(IS_ALIGNED(__init_begin,     4), "__init_begin=
 is misaligned")
> ASSERT(IS_ALIGNED(__init_end,       4), "__init_end is misaligned")
> ASSERT(IS_ALIGNED(__bss_start,      POINTER_ALIGN), "__bss_start is misal=
igned")
> ASSERT(IS_ALIGNED(__bss_end,        POINTER_ALIGN), "__bss_end is misalig=
ned")
> +/* To simplify the logic in head.S, we want to _end to be page aligned *=
/
> +ASSERT(IS_ALIGNED(_end,             PAGE_SIZE), "_end is not page aligne=
d")
> ASSERT((_end - _start) <=3D XEN_VIRT_SIZE, "Xen is too big")
> --=20
> 2.40.1
>=20
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:13:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:13:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558389.872433 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgmT-0007mz-GA; Tue, 04 Jul 2023 14:13:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558389.872433; Tue, 04 Jul 2023 14:13:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgmT-0007ms-DP; Tue, 04 Jul 2023 14:13:25 +0000
Received: by outflank-mailman (input) for mailman id 558389;
 Tue, 04 Jul 2023 14:13:23 +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
 <SRS0=kGqQ=CW=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qGgmR-0007mm-Nk
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:13:23 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2054.outbound.protection.outlook.com [40.107.7.54])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ee77fe87-1a74-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 16:13:21 +0200 (CEST)
Received: from AS9PR06CA0612.eurprd06.prod.outlook.com (2603:10a6:20b:46e::19)
 by AS8PR08MB8490.eurprd08.prod.outlook.com (2603:10a6:20b:567::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:12:52 +0000
Received: from AM7EUR03FT055.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:46e:cafe::4f) by AS9PR06CA0612.outlook.office365.com
 (2603:10a6:20b:46e::19) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.31 via Frontend
 Transport; Tue, 4 Jul 2023 14:12:51 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT055.mail.protection.outlook.com (100.127.141.28) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.18 via Frontend Transport; Tue, 4 Jul 2023 14:12:51 +0000
Received: ("Tessian outbound b11b8bb4dfe8:v142");
 Tue, 04 Jul 2023 14:12:51 +0000
Received: from 8ad9a455646d.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 83C93626-230B-4196-887B-5DE607006AE6.1; 
 Tue, 04 Jul 2023 14:12:40 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8ad9a455646d.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 04 Jul 2023 14:12:40 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by AS2PR08MB10055.eurprd08.prod.outlook.com (2603:10a6:20b:645::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:12:38 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:12:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ee77fe87-1a74-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IEE8KzgJlSHeDg/R+ZsjJ/WFXESyQ2awb5p+KmS80/4=;
 b=uLnIWMwTeXgU2rI3r1b6y1mUNF4NYYJtvTbW4OU7z3HiEWd8fp1h3uh/5Zs3TzAp1+UWm+czHfRbkc9XXVn3p9IpUXtz214ujTCnHcUeesfwpKQmPE4Oxo8WEvJb3oghsXCnoPjpOWox3yDl3NkBqdwMsjx+lzLIpJWoc/0TXJY=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: bc67a2cc176925e3
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=QMXZxLY1tkKhEZ3mhtS12VF0i8KxFvQOfNNRclrNZFUNs/eScF2ppk3y86tVRKYoJq9enNEhYIu+ZAWQ/ytT5U91Nitm8K1d2cRAsY1J9C3lV/VzBj6bKDeiZdyJMx0qyeQrSqzq/A7ckBXFWRBBoX8fo6eejuag4oo1c2uxbG2sWDJdNvF3IlPuEudnv8WTZznAo6WsYOE+VdXY8o/IbTLuo3inOn+/rvPI5ORUh3DuRBn14zzgmnKioHO4u6f1JjIduI8/J35hS5wd/+tNpkQgG4CB6UemFdIYSrSIFQsGO9FJN2RatYOBMfxW84pe0e8B2g8+oWyhKnZPcOBNCw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=IEE8KzgJlSHeDg/R+ZsjJ/WFXESyQ2awb5p+KmS80/4=;
 b=mBBGZgz4fLXBCedR4hjQ0TRFMSvUDiVejSEbCh0nXDiMcgKEdq2Sx7dvU5vOmoGjuz+MPDbVE80eQRIl9r5WdnBDKmlhA/NM/kxT/3DI8pEw45xUOKGs9YSUCAApCLQEPGrWGwft0lNHpjycL2nZweowF+I5g54DS3OpeXdALWBruh7dUGPNqaOuc+bxc66YOmoZHv3LupdiGilNVD4cmbIMBjI5fr3nfBUBo9W9Mwh5F615BobJ4QPvG1VQvNzV5GA4hpgLI32uw9Soe2vz3MgxrXPwBnC0WtPBuPArYs5MctJStk9D+gwVyKQeeyX5lKYvXsu3YPgNJ3jV2X1cjA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IEE8KzgJlSHeDg/R+ZsjJ/WFXESyQ2awb5p+KmS80/4=;
 b=uLnIWMwTeXgU2rI3r1b6y1mUNF4NYYJtvTbW4OU7z3HiEWd8fp1h3uh/5Zs3TzAp1+UWm+czHfRbkc9XXVn3p9IpUXtz214ujTCnHcUeesfwpKQmPE4Oxo8WEvJb3oghsXCnoPjpOWox3yDl3NkBqdwMsjx+lzLIpJWoc/0TXJY=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Luca Fancellu
	<Luca.Fancellu@arm.com>, "michal.orzel@amd.com" <michal.orzel@amd.com>, Henry
 Wang <Henry.Wang@arm.com>, Julien Grall <jgrall@amazon.com>
Subject: Re: [v2 2/4] xen/arm32: head: Don't map too much in boot_third
Thread-Topic: [v2 2/4] xen/arm32: head: Don't map too much in boot_third
Thread-Index: AQHZqsXz4VnOLQ2i/U6Z6/jlIuCSGK+prZQA
Date: Tue, 4 Jul 2023 14:12:38 +0000
Message-ID: <CC83991E-F43E-441C-B13E-4EF976815F7A@arm.com>
References: <20230629201129.12934-1-julien@xen.org>
 <20230629201129.12934-3-julien@xen.org>
In-Reply-To: <20230629201129.12934-3-julien@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|AS2PR08MB10055:EE_|AM7EUR03FT055:EE_|AS8PR08MB8490:EE_
X-MS-Office365-Filtering-Correlation-Id: 63bd1ef2-fda8-47d7-7a67-08db7c98c0e9
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 1+e09frmHXiQweB3W+FBMHcjqkZYfHxxuOPEOxMN4NTRexyy/yKXidlQXikXWsEGM1uX5DftTCAf1VBQfEvm5VSMHJBM4V9UY+kdgxWNxn83BAs04xK+rYwOyA+BBX1O2koheCUAUkNFuD4qzJJ4QKyrq97E4oQElbQgqD2QjTTnyP8tCQxlpDanwUwK84rL7tMdPsWMjOsDWPPSbf8lzkyRm1PQrUV1YZo+uerlg8fuU0177kpiBTJVaD5ijFmr96YbsgmML6G2KwV0O4A9Rkwq1SMBswFJ0zpsd4siXMJCSTFirMSvgSGvXJrT1voAaESFTnUOSh84zvNDrB0Tu5UxMTu8X71RWrXzSZLDtbUzBJe/vn4NIzyM4peRxKwukDzDZsURGTYtPuCTka3llPbo0FdhA0+wvEReoKEwHQoXg+Tqg+HUYdzf/FzMjPesS9YytzD03OnQfqeccym0mMei6xlqWcvXXqma+cBxlwsOnu0kODuUnHqO/wOZFSUcFjJZjBGRkvMdAndfnSIqrwQB5bRtzUTtB3RSftaY2cpIj1OPCQ9TihL7/X3FOdhmZUxFDN1XI+A0koyZ4BCiS9SKtC7drD2DdqT6GQQYPSs+aFIiNHAadCJOKv6UVHlsVQGn9lr4tVht/BWyjOS2Mw==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(366004)(136003)(346002)(39860400002)(451199021)(38100700002)(71200400001)(33656002)(2906002)(6486002)(8936002)(38070700005)(8676002)(54906003)(36756003)(41300700001)(5660300002)(478600001)(76116006)(6916009)(66946007)(66556008)(66476007)(64756008)(53546011)(91956017)(66446008)(6512007)(186003)(6506007)(86362001)(4326008)(316002)(2616005)(122000001)(83380400001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <C482A17C08921546B465F6F869432BC0@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10055
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT055.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	b867d68a-a0bd-4c33-db23-08db7c98b91f
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	T8WQrfGY15rnX5DnFwho78mzR0tV326B1lOXSbEJWx3SemNG+y8YeE6fpQ7bL9hlTWqRgr0IJfx8td/Qb27J2ADVMve+KsJRU8cyiMw9yQSgI3Fv6ikK+4VoJSE/QGtZ1j0cHcCmtE6pKDvEMx/8w5yCqtx1STeA1JSaStDCm70Y+b+W3jrvMxLcg/LXa7hVWzhxymf+GIMOtj+rWuKnbaVhkUt2gzXofKKkObu5/xkwVpQoWGvrqY27JPAsPFKUMBdHODIwoX4968HGHVhmAsIQYlI9E6wQwnJM4pPL0yAgb1zkIDiFQ44hZMAnjGKDAMcwAGCyCDD2Sx7nYqCNimWCrhJ70x4nmbMGdIlnNVI/Onubsxe6RySED8fDW/Cx2FL/dpSbZVIY/x2ZTHYxld8qzbiaEvNFBuK8oykU1liToCH3kxDRpcoU10eX2+RgrtHvzuum8Q9OP5Vycg2rb9CuRdD9hPDLQ2cI/EBnpceXO3RT5JdSGsR2/7QIgnavvonChxso+HWdNAprihkh+46mKz8naudjhB5cmV0YyqdU3A6+JKq+ug/JAxutxHVAa+wvV7uloceKyRSGvV51Fs7mQ+ukCXP4MN8sxMZ7w+xdcURCGOncMKiwg422cE1rgP+k9jyXoMTaDL+Twysg+T2BOgh655pJv6YKG3Fie5QeYZhj4HFGxpUVNVYmW18s/uKK7oQaMCAcvoOqcNz7N6BZzNhalOuooe4BoDBflNUzNeKYOSF2P4bioD+jsVTf
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(346002)(396003)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(107886003)(26005)(478600001)(6506007)(82740400003)(6512007)(86362001)(2616005)(186003)(53546011)(81166007)(54906003)(4326008)(70586007)(36860700001)(83380400001)(356005)(336012)(6486002)(316002)(70206006)(47076005)(8676002)(8936002)(6862004)(40460700003)(41300700001)(2906002)(40480700001)(5660300002)(33656002)(82310400005)(36756003);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:12:51.5832
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 63bd1ef2-fda8-47d7-7a67-08db7c98c0e9
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT055.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8490

Hi Julien,

> On 29 Jun 2023, at 22:11, Julien Grall <julien@xen.org> wrote:
>=20
> From: Julien Grall <jgrall@amazon.com>
>=20
> At the moment, we are mapping the size of the reserved area for Xen
> (i.e. 2MB) even if the binary is smaller. We don't exactly know what's
> after Xen, so it is not a good idea to map more than necessary for a
> couple of reasons:
>    * We would need to use break-before-make if the extra PTE needs to
>      be updated to point to another region
>    * The extra area mapped may be mapped again by Xen with different
>      memory attribute. This would result to attribute mismatch.
>=20
> Therefore, rework the logic in create_page_tables() to map only what's
> necessary. To simplify the logic, we also want to make sure _end
> is page-aligned. So align the symbol in the linker and add an assert
> to catch any change.

The last 2 sentences actually belongs to patch 1 and have been copied
here. Please remove them on commit as alignment of _end is not in
this patch.

>=20
> Signed-off-by: Julien Grall <jgrall@amazon.com>
> Reviewed-by: Michal Orzel <michal.orzel@amd.com>
>=20
With commit message fixed on commit:
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
>=20
>    Changes in v2:
>        - Fix typo
>        - Add Michal's reviewed-by tag
> ---
> xen/arch/arm/arm32/head.S | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
>=20
> diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
> index 1ad981b67460..5e3692eb3abf 100644
> --- a/xen/arch/arm/arm32/head.S
> +++ b/xen/arch/arm/arm32/head.S
> @@ -459,6 +459,19 @@ create_page_tables:
>         create_table_entry boot_pgtable, boot_second, r0, 1
>         create_table_entry boot_second, boot_third, r0, 2
>=20
> +        /*
> +         * Find the size of Xen in pages and multiply by the size of a
> +         * PTE. This will then be compared in the mapping loop below.
> +         *
> +         * Note the multiplication is just to avoid using an extra
> +         * register/instruction per iteration.
> +         */
> +        mov_w r0, _start            /* r0 :=3D vaddr(_start) */
> +        mov_w r1, _end              /* r1 :=3D vaddr(_end) */
> +        sub   r0, r1, r0            /* r0 :=3D effective size of Xen */
> +        lsr   r0, r0, #PAGE_SHIFT   /* r0 :=3D Number of pages for Xen *=
/
> +        lsl   r0, r0, #3            /* r0 :=3D Number of pages * PTE siz=
e */
> +
>         /* Setup boot_third: */
>         adr_l r4, boot_third
>=20
> @@ -473,7 +486,7 @@ create_page_tables:
> 1:      strd  r2, r3, [r4, r1]       /* Map vaddr(start) */
>         add   r2, r2, #PAGE_SIZE     /* Next page */
>         add   r1, r1, #8             /* Next slot */
> -        cmp   r1, #(XEN_PT_LPAE_ENTRIES<<3) /* 512*8-byte entries per pa=
ge */
> +        cmp   r1, r0                 /* Loop until we map all of Xen */
>         blo   1b
>=20
>         /*
> --=20
> 2.40.1
>=20
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:15:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:15:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558393.872443 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgnx-0008KE-R0; Tue, 04 Jul 2023 14:14:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558393.872443; Tue, 04 Jul 2023 14:14:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgnx-0008K7-OS; Tue, 04 Jul 2023 14:14:57 +0000
Received: by outflank-mailman (input) for mailman id 558393;
 Tue, 04 Jul 2023 14:14:56 +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
 <SRS0=kGqQ=CW=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qGgnw-0008K1-Gn
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:14:56 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20616.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::616])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 25b750e8-1a75-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 16:14:54 +0200 (CEST)
Received: from AM0PR02CA0015.eurprd02.prod.outlook.com (2603:10a6:208:3e::28)
 by AM7PR08MB5366.eurprd08.prod.outlook.com (2603:10a6:20b:10b::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:14:52 +0000
Received: from AM7EUR03FT004.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:208:3e:cafe::ef) by AM0PR02CA0015.outlook.office365.com
 (2603:10a6:208:3e::28) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.30 via Frontend
 Transport; Tue, 4 Jul 2023 14:14:52 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT004.mail.protection.outlook.com (100.127.140.210) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.22 via Frontend Transport; Tue, 4 Jul 2023 14:14:51 +0000
Received: ("Tessian outbound 546d04a74417:v142");
 Tue, 04 Jul 2023 14:14:51 +0000
Received: from b98e52ff82e0.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 EA13D457-3978-4FC5-850C-D6A586231AB0.1; 
 Tue, 04 Jul 2023 14:14:45 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b98e52ff82e0.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 04 Jul 2023 14:14:45 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by AS2PR08MB8694.eurprd08.prod.outlook.com (2603:10a6:20b:55d::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:14:43 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:14:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 25b750e8-1a75-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=eiVGKPFwbIjAlKAFWLXTaQK/I0D0UDw/eEEWsAhzXPg=;
 b=UNgw0JYu8wa3TwGbAukXqDDlwHrby01gtpIL+bw3RDK3OdYPvn9gkOhMGKbzOtXOe0BjJV5Iigc9TmPAN99o2JzknX4ogJiQYd9A6Ab4GaHXtG3BlGuIbkasQIOJCtenjDcdIlwyLHKhvnVGX2HXBaNZlDtKt/pMdVy22ugyBTE=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: c4e1208e2f18b545
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=X5fWVKIqI+eAYhkEfon6JNNZsU4+vmmK8eSEqVy4X0AdaXPUIS1LEDXay1XZ0ONXhBdOvyWZ58WTzBWeE1SR2sVbEBkyBvOjEA6UMYbcCn0G5nC+7T1WpofKSUdKD6t3gouHZumaSSLBYoy+JIdsTKeYW0qmB6aHxQtyd9gL1eVylG7J8r4RuJF9yoK+4kYRVdt4lPIuuk85L4ZVsjM6SaSQu0EbxjaPNP08e3pKCQRwT8Gti5qOwcfePLkcS9Ht92TBBXl1ZeeskM8DwDgpGO0i08bTxtbQejsz5J4CFFbVSp3yVBmCjhZOGzVal/b7oCjyKDXL2S2gBXZqE36O1Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=eiVGKPFwbIjAlKAFWLXTaQK/I0D0UDw/eEEWsAhzXPg=;
 b=LdpYJ11XL1Dmc4o9uuvOTrlUnBDk7YWvuX+yy28epW5W3dU2aFo0QSz2xFN2TaYBiI7h5T8myw+43OVECEZ21gSZPYb7hBiUP6yiLGjMG3ZhKbMIQHrqrBkkd7bMYN5xijTADcxgo5UuOYL+Nos4ytxo/OUKkStcqthiDxc7n01d4HiAVV2QZKwCFvAhkhzZzUnK99IcxjA9l8Lg4gfLS8rH64eZVxriQjea7MS9ehuxbmKASKcdDm1dtoeU94OjnE5Ak5UqimENB6lWhfQguBVbCQswxh8rVpeSjeF8YrSxjuh0Nutl3Ud03QWVtZXPUt9Ju4kLG/KWOE/tmnd48g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=eiVGKPFwbIjAlKAFWLXTaQK/I0D0UDw/eEEWsAhzXPg=;
 b=UNgw0JYu8wa3TwGbAukXqDDlwHrby01gtpIL+bw3RDK3OdYPvn9gkOhMGKbzOtXOe0BjJV5Iigc9TmPAN99o2JzknX4ogJiQYd9A6Ab4GaHXtG3BlGuIbkasQIOJCtenjDcdIlwyLHKhvnVGX2HXBaNZlDtKt/pMdVy22ugyBTE=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Luca Fancellu
	<Luca.Fancellu@arm.com>, "michal.orzel@amd.com" <michal.orzel@amd.com>, Henry
 Wang <Henry.Wang@arm.com>, Julien Grall <jgrall@amazon.com>
Subject: Re: [v2 4/4] xen/arm: Allow the user to build Xen with UBSAN
Thread-Topic: [v2 4/4] xen/arm: Allow the user to build Xen with UBSAN
Thread-Index: AQHZqsX05lUuU4F5z0qXrKvpd1a/f6+prigA
Date: Tue, 4 Jul 2023 14:14:42 +0000
Message-ID: <6BC60C8C-745E-459F-91E3-FCFB5DDB9F76@arm.com>
References: <20230629201129.12934-1-julien@xen.org>
 <20230629201129.12934-5-julien@xen.org>
In-Reply-To: <20230629201129.12934-5-julien@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|AS2PR08MB8694:EE_|AM7EUR03FT004:EE_|AM7PR08MB5366:EE_
X-MS-Office365-Filtering-Correlation-Id: 72a7f30c-d7bb-4346-66ae-08db7c990877
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 6ciRGoJqmLtnabO/DcrJpfZ4cTHdlB1q6mXCtQIIsveAncXIOgDlnrRSdwpw1c9RL0q4Ph8wJh+6Hok0Ck66YBjb3ja7SNqfc7XgHxIGVRaa4feOt8mcSQm/DrTqnzPdcwGALugLeVmKr654+DP0irujmdjsVTFs4DHPFcXSgQhnk+CVgfz23krgpcwcvRqiHeT6BY/499fWflTvF4FoLu7YHrx22/bkZUuc4RmBnxPTC/N3UirczRSty2QNwl0CIdmXfeukNq50qE7jXEZHPNC1gkL5FN4oMZxW6Zwp0dIyH/CEoHKEsIOtC7sXvs6CQ5rAmAK6/57Ma3+2p1C5RXE/pbxihq/N+4io0lzcG64qA1lTgLcsrnUDcPrXjKp74vhlU1Tqv/qJHuGEohuFnEP6p1ipUM6Ec0p963uQSthcMCp6mObccjZDNVozs5qJUIlTCy2dkrbtxqQlP8SPzNHlYx3ukdHuI7afrCI53HIMoq48eT+fpDXQKffHyqxMoictfM/hqhsOvcQHha3718dWnCDUeihqeE6blzqumuT8ATrxRT93iPA+rGeaqbB2t2H+hexKY0QjZW98nIBc6ruYQe0prxDl3dFOQwHAYOzz40ZCcbDlp8OVFbTbNjDYPAzPQVl3RO8qzYJ8x87v8w==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(346002)(366004)(396003)(39860400002)(451199021)(478600001)(6506007)(71200400001)(6512007)(86362001)(2616005)(186003)(38100700002)(53546011)(54906003)(4326008)(6916009)(66946007)(66446008)(66476007)(66556008)(83380400001)(64756008)(6486002)(91956017)(76116006)(316002)(122000001)(8676002)(8936002)(38070700005)(41300700001)(2906002)(5660300002)(33656002)(36756003)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <07C1C1DEA003DC4C812C6418AB903CB2@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8694
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT004.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	5b7eeb52-f06d-4a56-6170-08db7c99033c
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	FA58q3xECwUUPkRCu6xhnvnGUGr+ro1d8FmccKRKjlLLe94dLEiq2GgFNh3hpr65nFJZEe0Zdd1S6uuhuEUwd1GidbV8PNNVeLRtI9ub7ioiOXkLltml6tjC8KLjmscQosOtqWAHpArFf6Rvmxz6PA36mU48NUWbSVhcM6dX5Sl5QWZ+BEqzX6iG80X+nlxf9Zb0qoU+zqfYfc1DzoRgYWsAuSn5MsO0z1havFElPqplDFP7xuyptE9lpwcLcZVZsrk+u+OWCE9nboFa4RBfGkDKDa0LmYEfWN6WSKCGxuPBQ3cjvO3B3vKu34H0JNLj6D7uL69UTqf6HGgqpfnBkOkydRDDlED6ha2UvIbeQHNag70OfjKasMVxAdhNHDv+sYMbvlynmExwohps+YDr8lV7cRpbyHjrgdjh3KAel721NpXjwmwpjwgMByTWVOx053juKIq0KN3IYUJFtAaUQg5WtGugK42wm5tUZTSCpywoVmSslTXmUi5BJbwoSl8kqdZ6d3g30nZ5OlTKOuFb9RuMRZ7UP2WFEI8QMoWJ+Gk3/ZYz595am3gSf/d8H8EKVYKopcMAghvuXkmAoF9ckqNuZbxrposkJWoHOIDV8yDzDcdsGmZbQ+314R23wF2xgh2Vbj8fJ5cYoPyFif8h1se9aODGQxtQUh2t30ks4a2igNM6Nzklpj64UYG5eOrexxXlmCqRkyh/1/v/l3nFgg9hXmp+ANwK29+8yFZ2iHulhtxjLIyLb09HXH8oZ4AN
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(346002)(376002)(136003)(451199021)(46966006)(40470700004)(36840700001)(40460700003)(2906002)(41300700001)(6862004)(5660300002)(8676002)(8936002)(82310400005)(33656002)(36756003)(40480700001)(86362001)(186003)(2616005)(478600001)(26005)(6512007)(6506007)(82740400003)(6486002)(70206006)(47076005)(316002)(70586007)(4326008)(36860700001)(107886003)(53546011)(81166007)(54906003)(336012)(83380400001)(356005);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:14:51.6315
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 72a7f30c-d7bb-4346-66ae-08db7c990877
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT004.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5366

Hi Julien,

> On 29 Jun 2023, at 22:11, Julien Grall <julien@xen.org> wrote:
>=20
> From: Julien Grall <jgrall@amazon.com>
>=20
> UBSAN has been enabled a few years ago on x86 but was never
> enabled on Arm because the final binary is bigger than 2MB (
> the maximum we can currently handled).
>=20
> With the recent rework, it is now possible to grow Xen over 2MB.
> So there is no more roadblock to enable Xen other than increasing
> the reserved area.
>=20
> On my setup, for arm32, the final binaray was very close to 4MB.
> Furthermore, one may want to enable UBSAN and GCOV which would put
> the binary well-over 4MB (both features require for some space).
> Therefore, increase the size to 8MB which should us some margin.
>=20
> Signed-off-by: Julien Grall <jgrall@amazon.com>

I am ok with the drawback.

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

>=20
> ---
>=20
> The drawback with this approach is that we are adding 6 new
> page-table (3 for boot and 3 for runtime) that are statically
> allocated. So the final Xen binary will be 24KB bigger when
> neither UBSAN nor GCOV.
>=20
> If this is not considered acceptable, then we could make the
> size of configurable in the Kconfig and decide it based on the
> features enabled.
>=20
>    Changes in v2:
>        - Fix typoes
>        - Add Michal's reviewed-by tag
>        - Add Henry's  reviewed-by tag
>        - Add a comment regarding the reserved size for Xen
> ---
> xen/arch/arm/Kconfig              |  1 +
> xen/arch/arm/include/asm/config.h | 22 +++++++++++++---------
> 2 files changed, 14 insertions(+), 9 deletions(-)
>=20
> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> index 61e581b8c2b0..06b5ff755c95 100644
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -17,6 +17,7 @@ config ARM
> select HAS_PASSTHROUGH
> select HAS_PDX
> select HAS_PMAP
> + select HAS_UBSAN
> select IOMMU_FORCE_PT_SHARE
>=20
> config ARCH_DEFCONFIG
> diff --git a/xen/arch/arm/include/asm/config.h b/xen/arch/arm/include/asm=
/config.h
> index 6d246ab23c48..cc32802ad0e9 100644
> --- a/xen/arch/arm/include/asm/config.h
> +++ b/xen/arch/arm/include/asm/config.h
> @@ -74,10 +74,10 @@
> /*
>  * ARM32 layout:
>  *   0  -   2M   Unmapped
> - *   2M -   4M   Xen text, data, bss
> - *   4M -   6M   Fixmap: special-purpose 4K mapping slots
> - *   6M -  10M   Early boot mapping of FDT
> - *   10M - 12M   Livepatch vmap (if compiled in)
> + *   2M -  10M   Xen text, data, bss
> + *  10M -  12M   Fixmap: special-purpose 4K mapping slots
> + *  12M -  16M   Early boot mapping of FDT
> + *  16M -  18M   Livepatch vmap (if compiled in)
>  *
>  *  32M - 128M   Frametable: 32 bytes per page for 12GB of RAM
>  * 256M -   1G   VMAP: ioremap and early_ioremap use this virtual address
> @@ -94,10 +94,10 @@
>  * 0x0000020000000000 - 0x0000027fffffffff (512GB, L0 slot [4])
>  *  (Relative offsets)
>  *   0  -   2M   Unmapped
> - *   2M -   4M   Xen text, data, bss
> - *   4M -   6M   Fixmap: special-purpose 4K mapping slots
> - *   6M -  10M   Early boot mapping of FDT
> - *  10M -  12M   Livepatch vmap (if compiled in)
> + *   2M -  10M   Xen text, data, bss
> + *  10M -  12M   Fixmap: special-purpose 4K mapping slots
> + *  12M -  16M   Early boot mapping of FDT
> + *  16M -  18M   Livepatch vmap (if compiled in)
>  *
>  *   1G -   2G   VMAP: ioremap and early_ioremap
>  *
> @@ -124,7 +124,11 @@
> #define XEN_VIRT_START          (SLOT0(4) + _AT(vaddr_t, MB(2)))
> #endif
>=20
> -#define XEN_VIRT_SIZE           _AT(vaddr_t, MB(2))
> +/*
> + * Reserve enough space so both UBSAN and GCOV can be enabled together
> + * plus some slack for future growth.
> + */
> +#define XEN_VIRT_SIZE           _AT(vaddr_t, MB(8))
> #define XEN_NR_ENTRIES(lvl)     (XEN_VIRT_SIZE / XEN_PT_LEVEL_SIZE(lvl))
>=20
> #define FIXMAP_VIRT_START       (XEN_VIRT_START + XEN_VIRT_SIZE)
> --=20
> 2.40.1
>=20
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:17:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:17:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558397.872454 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgqJ-0000V1-7h; Tue, 04 Jul 2023 14:17:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558397.872454; Tue, 04 Jul 2023 14:17:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgqJ-0000Uu-4b; Tue, 04 Jul 2023 14:17:23 +0000
Received: by outflank-mailman (input) for mailman id 558397;
 Tue, 04 Jul 2023 14:17:22 +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
 <SRS0=Gy6C=CW=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qGgqI-0000Uo-4U
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:17:22 +0000
Received: from NAM04-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam04on20630.outbound.protection.outlook.com
 [2a01:111:f400:7e8b::630])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7b83863a-1a75-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 16:17:19 +0200 (CEST)
Received: from SN6PR12MB2621.namprd12.prod.outlook.com (2603:10b6:805:73::15)
 by MN2PR12MB4176.namprd12.prod.outlook.com (2603:10b6:208:1d5::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:17:14 +0000
Received: from SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54]) by SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54%2]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:17:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7b83863a-1a75-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=enSzB7C+LshLhSkdk39NI2sA19LfKuFPkImqUsLN0MquQT9bJPI1JF9CyxUrcI2dS5EmXX8gQEIuPN3vxUT0KTH2ZpxUnUSxGAt8vtnbRkgKMm9BRgOMYSLzs2nKOyjVdVjnxYChCkyDXIa7uAJWgEjiJq+DUQXpuwhtajZ2D3hwjsZWlYxbL/kMdWjhIMxuurC3fUwI4tKa59/h5V6BoJ67FxVjZe7MBTJVyiwN+TZbKFQeywoHHR+KMp9DeRsnWsHSoAnCKjuTPLuEC9RXm2svBkKRkCYAjKiBfVEjG28UjSEkqaMWMtfC8LH/NyWGcSQqlIdtKyiQnlz+mImt0g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=NC0QtpFwKtnzvqPqYL1Q9UUuDbyf8nbwSb4gLzA1xhw=;
 b=ELIBtYU0gAzeJ9tO8UiJuUuS6wCuluuuLgStxosTt3Hj2ZF68JDME1vmVKqZTfUFkzLDaLjEjIuCj5iZrKZ27c5ll350XjNorCrue1y4sWFhUUkZwRM13YSLLORr9FBAyRFlUu7o5OsGgFvtcFBA1tIU4iCJk/DFP2ZvHcFQVA77HAHaQ7ylllqSIrlZYrx87+JTlWwAmSBO2/S6KHcEvCJK6mTizYnzrnS3+phknZQcYLEKk1Ekz774VTXhQED0AxoenO5TDOw2m/51+5/GuaFnxtHNxcVw2V0TA62IHc9O6T4cJBFDWA9NWHWGAMa8T3P3U43TwKR7pGXsk+lhkQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=NC0QtpFwKtnzvqPqYL1Q9UUuDbyf8nbwSb4gLzA1xhw=;
 b=xi4xNXrOdqHFrLALjsIloxc6hpLope8UrCS2lOPnGXOu2gU8xmvAOZy4pAI0/5G5jr7cSBs1eMaU+PDqwG2oaHK7Th/i6PAQxLDxaZcEImZaVHWDFp/K/yNVp5cjUuXLKc+TgGhvz3Y3om5qFxcXW1bIF8tbVWhOiC2VrcVQ7A8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <cd77864c-8e8c-b423-5fe0-53a15bf48729@amd.com>
Date: Tue, 4 Jul 2023 15:17:06 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 00/52] xen/arm: Add Armv8-R64 MPU support to Xen -
 Part#1
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Paul Durrant <paul@xen.org>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <20230626033443.2943270-1-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0173.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:18a::16) To SN6PR12MB2621.namprd12.prod.outlook.com
 (2603:10b6:805:73::15)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN6PR12MB2621:EE_|MN2PR12MB4176:EE_
X-MS-Office365-Filtering-Correlation-Id: 0e41b734-22a8-4c7b-e1f6-08db7c995d21
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	I+yAbGhXr6e/FDg5irm3UpsphngIHqVzH0TAdaW3YkMGdFhbeY8e6CZ/lOQcOYFtnrRWTGiDkzmGsWb/pmRYPL2dV2194monfdlt/t8wQY8i+9XLh8XWiz2IxQN47Xl5JzZigunFj5ztO+jXokSABZERlfQWlQhm9Rm4BOgYvEoQA5KgWI9QhlJhnynDXoboMa1y6fzU7VWWEwo5Z8umoAU5Ow2nLYxZs+qAeYFf6ksFNroSpuu++Pe6UUR/nNtJCBGorqD6DCjb+qwHSajbeSOUq0HqbW3Emj5cyRpPnuz+IZ1dwynaclHPOVq5kdw1A9sjf2eeXiOc/xulGcrnI4dK/IXVK9EW9nsHuGTEkwnPAne00lMEUA3AagDC1sEhczkcnl04qUA3up0XLyafCadTJcKfYfQTIIJ8S2/qfszX6vv4ToXv/Z4uPN33ubB4Urpqnd6HvK41yxaGlDy/b/hAwIqFGuznUFGZ7l7M8fZs9BcG8xyCuGw4Y/XJjW3EKb1jRO0xEf9kStJlESpY7X7GzmwWpO+nxVFVLI1caUg0knN3KFW/MzYGn5jWB1p1GpNtmNlkiPJcJHDmeydCR9XrwTniaf5ogt5ytwh8EAd41TClvw68/DwecoppcTcsqoff8CUvgxaWKU5VplekJkdGfUEzL5sLLKOGXxYhRoDnui12JT2GxU+BtowX7StcCdKPvoXi0SKHwUwCBBDzQeVNq1W8cLoP5JuJ+lkos+s=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2621.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(366004)(39860400002)(396003)(376002)(451199021)(316002)(54906003)(66556008)(66476007)(8676002)(41300700001)(4326008)(8936002)(66946007)(38100700002)(53546011)(6506007)(478600001)(31686004)(5660300002)(6512007)(7416002)(26005)(186003)(966005)(6486002)(6666004)(31696002)(83380400001)(36756003)(2616005)(2906002)(17413003)(21314003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bThnL1NsZ09tTWU2UDJnNGhRSDV0Qk1KVUkyOXM1QWYvelJvWkJ1UHp4Y1Yw?=
 =?utf-8?B?S2RXQ25heGprN2VaW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bDQ5S0tPVEVKc21pMGlBZWljcmlCamZXWUFjMUw4RmNrV1ZQN0h3cFV6?=
 =?utf-8?B?N0xTUUIvNWM3dWhuL2VnN0hnK1VXd2tERmZIWUdBODc2MDRVZTBOQll0Z0Fv?=
 =?utf-8?B?SG9nNlYxb2FUM3JkMCtxc0VidzhVRjQ2TjB6ZkRmTFJ5QUNGVWN6aGRoUXFt?=
 =?utf-8?B?em5lSVpHT2hzK0ZiUS9Cei9OS05GM2ZOWDRkY2h5MEdHcDhtQm03dVRDTG5q?=
 =?utf-8?B?R3ZqWmdFYlJrc3NWa0p5azdWOWJTcFRadWdsdTBLTE12T1NWb3ZRdTZSYmds?=
 =?utf-8?Q?wcqCsE8cN9HCDswlFHLnWg46Z?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0e41b734-22a8-4c7b-e1f6-08db7c995d21
X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2621.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:17:14.0184
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: CqaBowDdGqburKS9+ulQt0re3OBefZ3x+c/dGHyWfVVQbeKi8E69HZtlIkozpSQBU1d55pDM9t305nvO/7IYHg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4176


On 26/06/2023 04:33, Penny Zheng wrote:
> CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
>
>
> So sorry for the long long wait before v3 serie, since I got sidetracked to
> a new high priority internal project for quite a time.
>
> The Armv8-R architecture profile was designed to support use cases
> that have a high sensitivity to deterministic execution. (e.g.
> Fuel Injection, Brake control, Drive trains, Motor control etc)
>
> Arm announced Armv8-R in 2013, it is the latest generation Arm
> architecture targeted at the Real-time profile. It introduces
> virtualization at the highest security level while retaining the
> Protected Memory System Architecture (PMSA) based on a Memory
> Protection Unit (MPU). In 2020, Arm announced Cortex-R82,
> which is the first Arm 64-bit Cortex-R processor based on Armv8-R64.
> The latest Armv8-R64 document can be found [1]. And the features of
> Armv8-R64 architecture:
>    - An exception model that is compatible with the Armv8-A model
>    - Virtualization with support for guest operating systems
>    - PMSA virtualization using MPUs In EL2.
>    - Adds support for the 64-bit A64 instruction set.
>    - Supports up to 48-bit physical addressing.
>    - Supports three Exception Levels (ELs)
>          - Secure EL2 - The Highest Privilege
>          - Secure EL1 - RichOS (MMU) or RTOS (MPU)
>          - Secure EL0 - Application Workloads
>   - Supports only a single Security state - Secure.
>   - MPU in EL1 & EL2 is configurable, MMU in EL1 is configurable.
>
> These patch series are implementing the Armv8-R64 MPU support
> for Xen, which are based on the discussion of
> "Proposal for Porting Xen to Armv8-R64 - DraftC" [2].
>
> We will implement the Armv8-R64 and MPU support in three stages:
> 1. Support to boot MMU domains on Armv8-R64 Xen.
> 2. Support to boot MPU domains on Armv8-R64 Xen.
> 3. SMP and other advanced features of Xen support on Armv8-R64.
>
> For having a overall undestanding for reviewers about MPU framework on Xen,
> we have introduced a large patch serie here, including 52 commits. At this
> stage, we could successfully boot a linux guest on FVP_BaseR_AEMv8R
> model[3].
>
> We will split these patches to several parts, this series is the
> part#1, v1 is in [4], the full PoC can be found in [5]. More software for
> Armv8-R64 can be found in [6];
>
> [1] https://developer.arm.com/documentation/ddi0600/latest
> [2] https://lists.xenproject.org/archives/html/xen-devel/2022-05/msg00643.html
> [3] https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms/arm-ecosystem-models
> [4] https://lists.xenproject.org/archives/html/xen-devel/2022-11/msg00289.html
> [5] https://gitlab.com/xen-project/people/weic/xen/-/tree/integration/mpu_v3
> [6] https://armv8r64-refstack.docs.arm.com/en/v5.0/
>
> Penny Zheng (41):
>    xen/arm: introduce CONFIG_HAS_MMU
>    xen/arm: mmu: fold FIXMAP into MMU system
>    xen/mmu: extract early uart mapping from setup_fixmap
>    xen/mmu: move MMU-specific setup_mm to mmu/setup.c
>    xen: make VMAP only support in MMU system
>    xen/mmu: relocate copy_from_paddr into setup.c
>    xen/arm: do not give memory back to static heap
>    xen/arm: only map the init text section RW in free_init_memory
>    xen/arm: switch to use ioremap_xxx in common file
>    xen/mmu: move MMU specific P2M code to mmu/p2m.c and mmu/p2m.h
>    xen: introduce CONFIG_HAS_PAGING_MEMPOOL
>    xen/mmu: enable SMMU subsystem only in MMU
>    xen/mpu: build up start-of-day Xen MPU memory region map
>    xen/mpu: introduce helpers for MPU enablement
>    xen/mpu: map early uart when earlyprintk on
>    xen/mpu: introduce setup_mm_mappings
>    xen/mpu: plump virt/maddr conversion in MPU system
>    xen/mpu: introduce a pair helper
>      read_protection_region()/write_protection_region()
>    xen/mpu: populate a new region in Xen MPU mapping table
>    xen/mpu: make early_fdt_map support in MPU systems
>    xen/mpu: implement MPU version of setup_mm in mpu/setup.c
>    xen/mpu: initialize frametable in MPU system
>    xen/mpu: destroy an existing entry in Xen MPU memory mapping table
>    xen/arm: map static memory on demand
>    xen/mpu: implememt ioremap_xxx in MPU
>    xen/mpu: implement MPU version of copy_from_paddr
>    xen/mpu: map domain page in MPU system
>    xen/mpu: support free_init_memory in MPU system
>    xen/mpu: implement remove_early_mappings in MPU system
>    xen/mpu: Use secure hypervisor timer in MPU system
>    xen/mpu: implement setup_virt_paging for MPU system
>    xen/mpu: configure VSTCR_EL2 in MPU system
>    xen/mpu: P2M initialization in MPU system
>    xen/mpu: insert an new entry into guest physmap in MPU system
>    xen/mpu: look up entry in p2m table
>    xen/mpu: support vcpu context switch in MPU system
>    xen/mpu: enable MMIO region trap in MPU system
>    xen/mpu: enable device passthrough in MPU system
>    xen/mpu: dump debug message in MPU system
>    xen/mpu: create stubs of function/variables for UNSUPPORTED features
>    xen/arm: add Kconfig option CONFIG_HAS_MPU to enable MPU system
>      support
>
> Wei Chen (11):
>    xen/arm: remove xen_phys_start and xenheap_phys_end from config.h
>    xen/arm: make ARM_EFI selectable for Arm64
>    xen/arm: add an option to define Xen start address for Armv8-R
>    xen/arm: add .text.idmap in ld script for Xen identity map sections
>    xen/arm64: head: Introduce enable_boot_mmu and enable_runtime_mmu
>    xen/arm64: prepare for moving MMU related code from head.S
>    xen/arm64: move MMU related code from head.S to mmu/head.S
>    xen/arm: use PA == VA for EARLY_UART_VIRTUAL_ADDRESS on MPU systems
>    xen/arm: Move MMU related definitions from config.h to mmu/layout.h
>    xen/mmu: extract mmu-specific codes from mm.c/mm.h
>    xen/arm: create mpu/layout.h for MPU related address definitions

Hi All,

I had a look at the first 22 patches (which touch the MMU code) and I 
did not find anything which will impact the R52 work directly.

- Ayan

>
>   xen/arch/arm/Kconfig                     |   52 +-
>   xen/arch/arm/Kconfig.debug               |    7 +
>   xen/arch/arm/Makefile                    |   15 +-
>   xen/arch/arm/arm32/head.S                |    2 +-
>   xen/arch/arm/arm64/Makefile              |    7 +-
>   xen/arch/arm/arm64/head.S                |  472 +-----
>   xen/arch/arm/arm64/mmu/head.S            |  463 ++++++
>   xen/arch/arm/arm64/{ => mmu}/mm.c        |    7 +-
>   xen/arch/arm/arm64/mpu/head.S            |  255 ++++
>   xen/arch/arm/arm64/smpboot.c             |    6 +-
>   xen/arch/arm/bootfdt.c                   |    2 +-
>   xen/arch/arm/domain.c                    |    2 +
>   xen/arch/arm/domain_build.c              |    2 +
>   xen/arch/arm/include/asm/arm64/macros.h  |   51 +
>   xen/arch/arm/include/asm/arm64/mm.h      |    7 +-
>   xen/arch/arm/include/asm/arm64/mpu.h     |  140 ++
>   xen/arch/arm/include/asm/arm64/sysregs.h |   76 +
>   xen/arch/arm/include/asm/config.h        |  129 +-
>   xen/arch/arm/include/asm/cpufeature.h    |    7 +
>   xen/arch/arm/include/asm/early_printk.h  |   20 +
>   xen/arch/arm/include/asm/fixmap.h        |   31 +-
>   xen/arch/arm/include/asm/mm.h            |   79 +-
>   xen/arch/arm/include/asm/mmu/layout.h    |  141 ++
>   xen/arch/arm/include/asm/mmu/mm.h        |   54 +
>   xen/arch/arm/include/asm/mmu/p2m.h       |   18 +
>   xen/arch/arm/include/asm/mpu/layout.h    |   32 +
>   xen/arch/arm/include/asm/mpu/mm.h        |   36 +
>   xen/arch/arm/include/asm/mpu/p2m.h       |   18 +
>   xen/arch/arm/include/asm/p2m.h           |   48 +-
>   xen/arch/arm/include/asm/page.h          |   46 +-
>   xen/arch/arm/include/asm/processor.h     |   14 +
>   xen/arch/arm/include/asm/setup.h         |   16 +-
>   xen/arch/arm/kernel.c                    |   42 +-
>   xen/arch/arm/mm.c                        | 1160 +-------------
>   xen/arch/arm/mmu/mm.c                    | 1133 ++++++++++++++
>   xen/arch/arm/mmu/p2m.c                   | 1612 +++++++++++++++++++
>   xen/arch/arm/mmu/setup.c                 |  379 +++++
>   xen/arch/arm/mpu/domain_page.c           |   68 +
>   xen/arch/arm/mpu/mm.c                    |  959 ++++++++++++
>   xen/arch/arm/mpu/p2m.c                   |  518 +++++++
>   xen/arch/arm/mpu/setup.c                 |  102 ++
>   xen/arch/arm/p2m.c                       | 1782 ++--------------------
>   xen/arch/arm/platforms/Kconfig           |    8 +-
>   xen/arch/arm/setup.c                     |  388 +----
>   xen/arch/arm/smpboot.c                   |    6 +-
>   xen/arch/arm/traps.c                     |   97 +-
>   xen/arch/arm/xen.lds.S                   |    6 +-
>   xen/arch/x86/Kconfig                     |    2 +
>   xen/arch/x86/setup.c                     |    2 +
>   xen/common/Kconfig                       |    8 +
>   xen/common/Makefile                      |    2 +-
>   xen/common/domctl.c                      |    2 +
>   xen/common/vmap.c                        |    7 +
>   xen/drivers/passthrough/Kconfig          |    3 +-
>   xen/include/xen/vmap.h                   |   11 +-
>   55 files changed, 6730 insertions(+), 3822 deletions(-)
>   create mode 100644 xen/arch/arm/arm64/mmu/head.S
>   rename xen/arch/arm/arm64/{ => mmu}/mm.c (97%)
>   create mode 100644 xen/arch/arm/arm64/mpu/head.S
>   create mode 100644 xen/arch/arm/include/asm/arm64/mpu.h
>   create mode 100644 xen/arch/arm/include/asm/mmu/layout.h
>   create mode 100644 xen/arch/arm/include/asm/mmu/mm.h
>   create mode 100644 xen/arch/arm/include/asm/mmu/p2m.h
>   create mode 100644 xen/arch/arm/include/asm/mpu/layout.h
>   create mode 100644 xen/arch/arm/include/asm/mpu/mm.h
>   create mode 100644 xen/arch/arm/include/asm/mpu/p2m.h
>   create mode 100644 xen/arch/arm/mmu/mm.c
>   create mode 100644 xen/arch/arm/mmu/p2m.c
>   create mode 100644 xen/arch/arm/mmu/setup.c
>   create mode 100644 xen/arch/arm/mpu/domain_page.c
>   create mode 100644 xen/arch/arm/mpu/mm.c
>   create mode 100644 xen/arch/arm/mpu/p2m.c
>   create mode 100644 xen/arch/arm/mpu/setup.c
>
> --
> 2.25.1
>
>


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:23:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:23:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558403.872463 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgwH-00021u-Uq; Tue, 04 Jul 2023 14:23:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558403.872463; Tue, 04 Jul 2023 14:23:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgwH-00021n-Rk; Tue, 04 Jul 2023 14:23:33 +0000
Received: by outflank-mailman (input) for mailman id 558403;
 Tue, 04 Jul 2023 14:23:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kGqQ=CW=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qGgwG-00021h-Gh
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:23:32 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on2061c.outbound.protection.outlook.com
 [2a01:111:f400:7d00::61c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 59c65b0a-1a76-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 16:23:31 +0200 (CEST)
Received: from AS4P189CA0013.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5d7::16)
 by DBBPR08MB5931.eurprd08.prod.outlook.com (2603:10a6:10:1f7::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:23:28 +0000
Received: from AM7EUR03FT062.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:5d7:cafe::31) by AS4P189CA0013.outlook.office365.com
 (2603:10a6:20b:5d7::16) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.30 via Frontend
 Transport; Tue, 4 Jul 2023 14:23:28 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT062.mail.protection.outlook.com (100.127.140.99) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.18 via Frontend Transport; Tue, 4 Jul 2023 14:23:27 +0000
Received: ("Tessian outbound d6c4ee3ba1eb:v142");
 Tue, 04 Jul 2023 14:23:27 +0000
Received: from 6f96fb54ab16.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 713A28D3-DA81-406F-97B6-1709F1932EA7.1; 
 Tue, 04 Jul 2023 14:23:21 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6f96fb54ab16.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 04 Jul 2023 14:23:21 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by DB9PR08MB7509.eurprd08.prod.outlook.com (2603:10a6:10:300::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:23:18 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:23:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 59c65b0a-1a76-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BWnLRr1NKLouYw/5csM4wai4v6vtQWe/sZa1dgMZm8M=;
 b=fLVSye1KFkpmvtcjfradE2pnWT8AzBBKItU/8jeHxx3BuOvf/0O/6PKzJsq67QgrAHMuRjxTRAb79No21t6Ouw9JiUmW9/SjMZrMdFAEEqzEn08NtViJeun/X2IVuNSOqL/Nec1DFe/Mwa3q+Gkl3ekF/p0hKQ1g82bqTDdunT8=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 8f1ccdb6a8d3a409
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Co5dAPKg0NnlPR7zqHRL8MQSxolO2ECn92y6N2RksEAdxjNB9fRImPj8nkRaZcBjS+jE5cDgq8cwKWcaNOkUBhwvqcph8Q+imczSZ4duzxxqQ+NtyELwJ45TiREb5esq9L1noS285Atr4N3ooSVluPomD96E1nrtAQwJ/M31gW9PiGQy/7LyDRG0jSdr9eHf+eW3SK/wwaeAS6xJnAgHSvm7N9qENey4qJtYKs2M60a6zCBXi/X1OkX9uKWRr56ugvTzBvjlyNJyh5tZZQ2nU4bG/fy6h7yfHJ99sZ1As+645NTSDEyO0ckvNNQuFhGYSpMuYf1u1YC5wLlCtItbDg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BWnLRr1NKLouYw/5csM4wai4v6vtQWe/sZa1dgMZm8M=;
 b=KoFBEuwtceoM9E0hCJkF9PRUW7Iy5kNjKp6oA06Czid9XXlcvvla415KmbtCoibCNdjt30Y1xFqmkToj4fhxAZd6mZ91wFuewhgz27hiKOCBgHMny285yT1x8HNbYJ09S6emMPQS4b3TNUZSdGaZ3zv8+Ls39td65Q0ary9hPooLM450Zr7Jot5urq/hb+I0RHq34nvHVoxqZN8Ec/TVivB8OmqkC1K7H4HNAPJpghyTt51U7L8arW7/MRS4VoGQtWQpx2CLX9fGcY+3fZ/n+Unszc7cohVO2zDoTnAPNe490eLJdVCxkjAYMQy7NIGUshZWEyWmkZUg55OVFi82HA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BWnLRr1NKLouYw/5csM4wai4v6vtQWe/sZa1dgMZm8M=;
 b=fLVSye1KFkpmvtcjfradE2pnWT8AzBBKItU/8jeHxx3BuOvf/0O/6PKzJsq67QgrAHMuRjxTRAb79No21t6Ouw9JiUmW9/SjMZrMdFAEEqzEn08NtViJeun/X2IVuNSOqL/Nec1DFe/Mwa3q+Gkl3ekF/p0hKQ1g82bqTDdunT8=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Luca Fancellu
	<Luca.Fancellu@arm.com>, "michal.orzel@amd.com" <michal.orzel@amd.com>, Henry
 Wang <Henry.Wang@arm.com>, Julien Grall <jgrall@amazon.com>
Subject: Re: [v2 3/4] xen/arm: Rework the code mapping Xen to avoid relying on
 the size of Xen
Thread-Topic: [v2 3/4] xen/arm: Rework the code mapping Xen to avoid relying
 on the size of Xen
Thread-Index: AQHZqsX1dQvVUjA1m0mu4FJvosJOiq+psI6A
Date: Tue, 4 Jul 2023 14:23:18 +0000
Message-ID: <7FE33D49-1D61-4F4F-BB29-3621119ACFFE@arm.com>
References: <20230629201129.12934-1-julien@xen.org>
 <20230629201129.12934-4-julien@xen.org>
In-Reply-To: <20230629201129.12934-4-julien@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|DB9PR08MB7509:EE_|AM7EUR03FT062:EE_|DBBPR08MB5931:EE_
X-MS-Office365-Filtering-Correlation-Id: ee58045e-8a51-4744-19da-08db7c9a3c17
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 LGH8sQh7VXySQCbrj/HUJOWdIbNukCUfrRB5JqiBQhHyYL7fCM5PVYqsp1nRqCjG0L6uNdyiE4jbGJze5j6nt2G7iUEpsO9JQ8clWj815zVyam+eklFpM00MAVsddHfJ3RroUXkXniH/1NHaW7SAxXpkTMAYU6gbzOpexQ8ZOA095jk4oaiFLHo7109SKOyy5P3BZy6CsaT7mslmWkrP6Qpm2H3GEdMz4vhpGXadoaqldNIE95OWMdYLcr97MIj9qSDx9c2IQQAJR7dKY93HUeuIG+AAaXhPyj59DIeY7bSNFsYCGA6rVFnuiNR9XaBYgcwub+RFCdlju6MUFzDfkhwmICw0VOWHn2vIWSxd/OywFzdfEy1SbOy59BXqB8dsK1+JE7gb8yTP0iVHSH9a4p3sOfeLoKoe/2lKEKr7oFWEri+Xvpf7lDCdcJSJ01ACjNcwoTDWxsSCJWhDdqiHWN+xsl10u47D4RVRrkHtjbj7BsqHBeRBWj+pd7hO4P+vCMjqe6OIiXo2uFbXAqCrg4XLihLCGYeevnCUk9+yYTWC7/Nuuh7ffTAIkNt0mk5rZg9TV4xSUVFPPhLISC4ZkOxNPK+cbalYUH1qQ0Vlot1XWBk96HfePjNp8ZLw/UZAEQr0CA8imzJjUTFYeLWhFg==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(346002)(366004)(39860400002)(396003)(451199021)(38100700002)(71200400001)(30864003)(33656002)(2906002)(6486002)(8936002)(8676002)(38070700005)(54906003)(36756003)(41300700001)(478600001)(5660300002)(76116006)(66946007)(66446008)(91956017)(86362001)(64756008)(186003)(6916009)(4326008)(6506007)(6512007)(66476007)(53546011)(66556008)(316002)(122000001)(2616005)(83380400001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <2984BCA479B90D4BBC07C58329D67766@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7509
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT062.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	48ad3f5f-5d65-4d19-b58e-08db7c9a366d
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	RqSH0c2g9Zls+h37TcnP1L8mNWTJNVqreFonv3UdD8gGCpzyCSXkXP7Ro9ng5jzjhyIabc2eEcRfLXazBz+RV9UYJMJWn6L7NDjGTM0+036nfTZCLYlj+7iJ05+r4sRgydpv1qiyB0tL85TxY66ZJ8kuMhYNXRF9QpezYzeP6XsO0yzwqgXojcv8QTruGxesU4ko+Pu7yekvjplaA18kCfbeXt/GZPjqeAOS1c8hAOHy7s2Aeqipzn3arGHYZyksqrLz5wmcIFPPv+fC5bn7iQIOlxwcymqaDYKH2RXJzS5pmsw0l5uufnrTbvxcHgmjd3KJxJjX/u4fZfBBCBZWwnukg+gAnZHItIL2I4Ep2p+zkYFqsTjR6dTj0mPsRIF8rdNxoHPJdmHG7AA1mDOz8Nkc4pP5mUEFENVx3umCZSMSQLwPgUP7Mio0rOl/uVKH9AV+HLh0sFe1e/dfe+Ci2K1qWQkp6GaErNU9Uag4kwh2mPxaguJtEzmAJ/Wdt2X7pSJT9M3faqDFim365AY9Fr0SS5TALVFGOKKolnGaeqM3IKZDjVtYOX+GbyRE5At4sZTKkinwiAQSqKApSYPC7Z3iI9b/pDetr/smoYNsnMaXo+P7qwj2lWt3LrNGakqpaSKm0/Sh0pvUZc7tkQuQOiC5gjppRMeaEgnz/XNmGqrMFMDnFwj3evqLFdQbpSBo8HVssxOhp8LlcLZ0H/TBm3Ofof+xiFkSFmp1bdwlOsfYkdkUB59hG/Wx7nLrApuB
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(376002)(396003)(136003)(451199021)(40470700004)(46966006)(36840700001)(336012)(40460700003)(41300700001)(6486002)(30864003)(82310400005)(26005)(356005)(82740400003)(83380400001)(107886003)(81166007)(2616005)(53546011)(186003)(6506007)(47076005)(40480700001)(6512007)(36860700001)(54906003)(86362001)(478600001)(36756003)(2906002)(316002)(4326008)(70206006)(70586007)(8936002)(8676002)(33656002)(6862004)(5660300002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:23:27.7230
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ee58045e-8a51-4744-19da-08db7c9a3c17
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT062.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB5931



> On 29 Jun 2023, at 22:11, Julien Grall <julien@xen.org> wrote:
>=20
> From: Julien Grall <jgrall@amazon.com>
>=20
> At the moment, the maximum size of Xen binary we can support is 2MB.
> This is what we reserved in the virtual address but also what all
> the code in Xen relies on as we only allocate one L3 page-table.
>=20
> When feature like UBSAN (will be enabled in a follow-up patch) and GCOV
> are enabled, the binary will be way over 2MB.
>=20
> The code is now reworked so it doesn't rely on a specific size but
> will instead look at the reversed size and compute the number of
> page-table to allocate/map.
>=20
> While at it, replace any reference to 4KB mappings with a more
> generic word because the page-size may change in the future.
>=20
> Also fix the typo s/tlb/tbl/ in code move in arm32/head.S
>=20
> Signed-off-by: Julien Grall <jgrall@amazon.com>
>=20

With the commit message fixed as stated by Michal:

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Cheers
Bertrand

> ---
>    Changes in v2:
>        - Fix typoes
>        - Remove comments that don't apply
>        - Reword the explanation for DEFINE_BOOT_PAGE_TABLE{,S}
>        - Be more consistent with the way to from the virtual address to
>          map in mm.c
> ---
> xen/arch/arm/arm32/head.S         | 64 +++++++++++++++++++++++--------
> xen/arch/arm/arm64/head.S         | 54 ++++++++++++++++++++------
> xen/arch/arm/include/asm/config.h |  1 +
> xen/arch/arm/include/asm/lpae.h   | 10 +++--
> xen/arch/arm/mm.c                 | 24 +++++++-----
> 5 files changed, 110 insertions(+), 43 deletions(-)
>=20
> diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
> index 5e3692eb3abf..cfc542b55973 100644
> --- a/xen/arch/arm/arm32/head.S
> +++ b/xen/arch/arm/arm32/head.S
> @@ -141,8 +141,7 @@
>         /*
>          * This must be the very first address in the loaded image.
>          * It should be linked at XEN_VIRT_START, and loaded at any
> -         * 4K-aligned address.  All of text+data+bss must fit in 2MB,
> -         * or the initial pagetable code below will need adjustment.
> +         * 4K-aligned address.
>          */
> GLOBAL(start)
>         /*
> @@ -373,7 +372,35 @@ ENDPROC(cpu_init)
> .endm
>=20
> /*
> - * Macro to create a page table entry in \ptbl to \tbl
> + * Macro to create a page table entry in \ptbl to \tbl (physical
> + * address)
> + *
> + * ptbl:    table symbol where the entry will be created
> + * tbl:     physical address of the table to point to
> + * virt:    virtual address
> + * lvl:     page-table level
> + *
> + * Preserves \virt
> + * Clobbers \tbl, r1 - r3
> + *
> + * Note that \tbl and \virt should be in a register other than r1 - r3
> + */
> +.macro create_table_entry_from_paddr, ptbl, tbl, virt, lvl
> +        get_table_slot r1, \virt, \lvl  /* r1 :=3D slot in \tbl */
> +        lsl   r1, r1, #3                /* r1 :=3D slot offset in \tbl *=
/
> +
> +        movw  r2, #PT_PT             /* r2:r3 :=3D right for linear PT *=
/
> +        orr   r2, r2, \tbl           /*           + \tbl paddr */
> +        mov   r3, #0
> +
> +        adr_l \tbl, \ptbl            /* \tbl :=3D (v,p)addr of \ptbl */
> +
> +        strd  r2, r3, [\tbl, r1]
> +.endm
> +
> +
> +/*
> + * Macro to create a page table entry in \ptbl to \tbl (symbol)
>  *
>  * ptbl:    table symbol where the entry will be created
>  * tbl:     table symbol to point to
> @@ -388,19 +415,9 @@ ENDPROC(cpu_init)
>  * Note that \virt should be in a register other than r1 - r4
>  */
> .macro create_table_entry, ptbl, tbl, virt, lvl
> -        get_table_slot r1, \virt, \lvl  /* r1 :=3D slot in \tlb */
> -        lsl   r1, r1, #3                /* r1 :=3D slot offset in \tlb *=
/
> -
>         load_paddr r4, \tbl
> -
> -        movw  r2, #PT_PT             /* r2:r3 :=3D right for linear PT *=
/
> -        orr   r2, r2, r4             /*           + \tlb paddr */
> -        mov   r3, #0
> -
> -        adr_l r4, \ptbl
> -
> -        strd  r2, r3, [r4, r1]
> -.endm
> +        create_table_entry_from_paddr \ptbl, r4, \virt, \lvl
> + .endm
>=20
> /*
>  * Macro to create a mapping entry in \tbl to \paddr. Only mapping in 3rd
> @@ -451,13 +468,26 @@ ENDPROC(cpu_init)
>  * Output:
>  *   r12: Was a temporary mapping created?
>  *
> - * Clobbers r0 - r4
> + * Clobbers r0 - r5
>  */
> create_page_tables:
>         /* Prepare the page-tables for mapping Xen */
>         mov_w r0, XEN_VIRT_START
>         create_table_entry boot_pgtable, boot_second, r0, 1
> -        create_table_entry boot_second, boot_third, r0, 2
> +
> +        /*
> +         * We need to use a stash register because
> +         * create_table_entry_paddr() will clobber the register storing
> +         * the physical address of the table to point to.
> +         */
> +        load_paddr r5, boot_third
> +        mov_w r4, XEN_VIRT_START
> +.rept XEN_NR_ENTRIES(2)
> +        mov   r0, r5                        /* r0 :=3D paddr(l3 table) *=
/
> +        create_table_entry_from_paddr boot_second, r0, r4, 2
> +        add   r4, r4, #XEN_PT_LEVEL_SIZE(2) /* r4 :=3D Next vaddr */
> +        add   r5, r5, #PAGE_SIZE            /* r5 :=3D Next table */
> +.endr
>=20
>         /*
>          * Find the size of Xen in pages and multiply by the size of a
> diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
> index 5e9562a22240..ad9e0ba87a29 100644
> --- a/xen/arch/arm/arm64/head.S
> +++ b/xen/arch/arm/arm64/head.S
> @@ -146,8 +146,7 @@
>          *
>          * This must be the very first address in the loaded image.
>          * It should be linked at XEN_VIRT_START, and loaded at any
> -         * 4K-aligned address.  All of text+data+bss must fit in 2MB,
> -         * or the initial pagetable code below will need adjustment.
> +         * 4K-aligned address.
>          */
>=20
> GLOBAL(start)
> @@ -490,6 +489,31 @@ ENDPROC(cpu_init)
>         ubfx  \slot, \virt, #XEN_PT_LEVEL_SHIFT(\lvl), #XEN_PT_LPAE_SHIFT
> .endm
>=20
> +/*
> + * Macro to create a page table entry in \ptbl to \tbl
> + * ptbl:    table symbol where the entry will be created
> + * tbl:     physical address of the table to point to
> + * virt:    virtual address
> + * lvl:     page-table level
> + * tmp1:    scratch register
> + * tmp2:    scratch register
> + *
> + * Preserves \virt
> + * Clobbers \tbl, \tmp1, \tmp2
> + *
> + * Note that all parameters using registers should be distinct.
> + */
> +.macro create_table_entry_from_paddr, ptbl, tbl, virt, lvl, tmp1, tmp2
> +        get_table_slot \tmp1, \virt, \lvl   /* \tmp1 :=3D slot in \tbl *=
/
> +
> +        mov   \tmp2, #PT_PT                 /* \tmp2 :=3D right for line=
ar PT */
> +        orr   \tmp2, \tmp2, \tbl            /*          + \tbl */
> +
> +        adr_l \tbl, \ptbl                   /* \tbl :=3D address(\ptbl) =
*/
> +
> +        str   \tmp2, [\tbl, \tmp1, lsl #3]
> +.endm
> +
> /*
>  * Macro to create a page table entry in \ptbl to \tbl
>  *
> @@ -509,15 +533,8 @@ ENDPROC(cpu_init)
>  * Note that all parameters using registers should be distinct.
>  */
> .macro create_table_entry, ptbl, tbl, virt, lvl, tmp1, tmp2, tmp3
> -        get_table_slot \tmp1, \virt, \lvl   /* \tmp1 :=3D slot in \tlb *=
/
> -
> -        load_paddr \tmp2, \tbl
> -        mov   \tmp3, #PT_PT                 /* \tmp3 :=3D right for line=
ar PT */
> -        orr   \tmp3, \tmp3, \tmp2           /*          + \tlb paddr */
> -
> -        adr_l \tmp2, \ptbl
> -
> -        str   \tmp3, [\tmp2, \tmp1, lsl #3]
> +        load_paddr \tmp1, \tbl
> +        create_table_entry_from_paddr \ptbl, \tmp1, \virt, \lvl, \tmp2, =
\tmp3
> .endm
>=20
> /*
> @@ -570,7 +587,20 @@ create_page_tables:
>         ldr   x0, =3DXEN_VIRT_START
>         create_table_entry boot_pgtable, boot_first, x0, 0, x1, x2, x3
>         create_table_entry boot_first, boot_second, x0, 1, x1, x2, x3
> -        create_table_entry boot_second, boot_third, x0, 2, x1, x2, x3
> +
> +        /*
> +         * We need to use a stash register because
> +         * create_table_entry_paddr() will clobber the register storing
> +         * the physical address of the table to point to.
> +         */
> +        load_paddr x4, boot_third
> +        ldr   x1, =3DXEN_VIRT_START
> +.rept XEN_NR_ENTRIES(2)
> +        mov   x0, x4                            /* x0 :=3D paddr(l3 tabl=
e) */
> +        create_table_entry_from_paddr boot_second, x0, x1, 2, x2, x3
> +        add   x1, x1, #XEN_PT_LEVEL_SIZE(2)     /* x1 :=3D Next vaddr */
> +        add   x4, x4, #PAGE_SIZE                /* x4 :=3D Next table */
> +.endr
>=20
>         /*
>          * Find the size of Xen in pages and multiply by the size of a
> diff --git a/xen/arch/arm/include/asm/config.h b/xen/arch/arm/include/asm=
/config.h
> index c969e6da589d..6d246ab23c48 100644
> --- a/xen/arch/arm/include/asm/config.h
> +++ b/xen/arch/arm/include/asm/config.h
> @@ -125,6 +125,7 @@
> #endif
>=20
> #define XEN_VIRT_SIZE           _AT(vaddr_t, MB(2))
> +#define XEN_NR_ENTRIES(lvl)     (XEN_VIRT_SIZE / XEN_PT_LEVEL_SIZE(lvl))
>=20
> #define FIXMAP_VIRT_START       (XEN_VIRT_START + XEN_VIRT_SIZE)
> #define FIXMAP_VIRT_SIZE        _AT(vaddr_t, MB(2))
> diff --git a/xen/arch/arm/include/asm/lpae.h b/xen/arch/arm/include/asm/l=
pae.h
> index 7d2f6fd1bd5a..4a1679cb3334 100644
> --- a/xen/arch/arm/include/asm/lpae.h
> +++ b/xen/arch/arm/include/asm/lpae.h
> @@ -267,15 +267,17 @@ lpae_t mfn_to_xen_entry(mfn_t mfn, unsigned int att=
r);
>=20
> /*
>  * Macros to define page-tables:
> - *  - DEFINE_BOOT_PAGE_TABLE is used to define page-table that are used
> - *  in assembly code before BSS is zeroed.
> + *  - DEFINE_BOOT_PAGE_TABLE{,S} are used to define one or multiple
> + *  page-table that are used in assembly code before BSS is zeroed.
>  *  - DEFINE_PAGE_TABLE{,S} are used to define one or multiple
>  *  page-tables to be used after BSS is zeroed (typically they are only u=
sed
>  *  in C).
>  */
> -#define DEFINE_BOOT_PAGE_TABLE(name)                                    =
      \
> +#define DEFINE_BOOT_PAGE_TABLES(name, nr)                               =
      \
> lpae_t __aligned(PAGE_SIZE) __section(".data.page_aligned")              =
     \
> -    name[XEN_PT_LPAE_ENTRIES]
> +    name[XEN_PT_LPAE_ENTRIES * (nr)]
> +
> +#define DEFINE_BOOT_PAGE_TABLE(name) DEFINE_BOOT_PAGE_TABLES(name, 1)
>=20
> #define DEFINE_PAGE_TABLES(name, nr)                    \
> lpae_t __aligned(PAGE_SIZE) name[XEN_PT_LPAE_ENTRIES * (nr)]
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index 0a3e1f3b64b6..fff6d7a4d37a 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -53,8 +53,8 @@ mm_printk(const char *fmt, ...) {}
>  * to the CPUs own pagetables.
>  *
>  * These pagetables have a very simple structure. They include:
> - *  - 2MB worth of 4K mappings of xen at XEN_VIRT_START, boot_first and
> - *    boot_second are used to populate the tables down to boot_third
> + *  - XEN_VIRT_SIZE worth of L3 mappings of xen at XEN_VIRT_START, boot_=
first
> + *    and boot_second are used to populate the tables down to boot_third
>  *    which contains the actual mapping.
>  *  - a 1:1 mapping of xen at its current physical address. This uses a
>  *    section mapping at whichever of boot_{pgtable,first,second}
> @@ -79,7 +79,7 @@ DEFINE_BOOT_PAGE_TABLE(boot_first_id);
> DEFINE_BOOT_PAGE_TABLE(boot_second_id);
> DEFINE_BOOT_PAGE_TABLE(boot_third_id);
> DEFINE_BOOT_PAGE_TABLE(boot_second);
> -DEFINE_BOOT_PAGE_TABLE(boot_third);
> +DEFINE_BOOT_PAGE_TABLES(boot_third, XEN_NR_ENTRIES(2));
>=20
> /* Main runtime page tables */
>=20
> @@ -115,7 +115,7 @@ DEFINE_BOOT_PAGE_TABLE(xen_fixmap);
>  * Third level page table used to map Xen itself with the XN bit set
>  * as appropriate.
>  */
> -static DEFINE_PAGE_TABLE(xen_xenmap);
> +static DEFINE_PAGE_TABLES(xen_xenmap, XEN_NR_ENTRIES(2));
>=20
> /* Non-boot CPUs use this to find the correct pagetables. */
> uint64_t init_ttbr;
> @@ -518,15 +518,15 @@ void __init setup_pagetables(unsigned long boot_phy=
s_offset)
>     p[0].pt.table =3D 1;
>     p[0].pt.xn =3D 0;
>=20
> -    /* Break up the Xen mapping into 4k pages and protect them separatel=
y. */
> -    for ( i =3D 0; i < XEN_PT_LPAE_ENTRIES; i++ )
> +    /* Break up the Xen mapping into pages and protect them separately. =
*/
> +    for ( i =3D 0; i < XEN_NR_ENTRIES(3); i++ )
>     {
>         vaddr_t va =3D XEN_VIRT_START + (i << PAGE_SHIFT);
>=20
>         if ( !is_kernel(va) )
>             break;
>         pte =3D pte_of_xenaddr(va);
> -        pte.pt.table =3D 1; /* 4k mappings always have this bit set */
> +        pte.pt.table =3D 1; /* third level mappings always have this bit=
 set */
>         if ( is_kernel_text(va) || is_kernel_inittext(va) )
>         {
>             pte.pt.xn =3D 0;
> @@ -539,10 +539,14 @@ void __init setup_pagetables(unsigned long boot_phy=
s_offset)
>=20
>     /* Initialise xen second level entries ... */
>     /* ... Xen's text etc */
> +    for ( i =3D 0; i < XEN_NR_ENTRIES(2); i++ )
> +    {
> +        vaddr_t va =3D XEN_VIRT_START + (i << XEN_PT_LEVEL_SHIFT(2));
>=20
> -    pte =3D pte_of_xenaddr((vaddr_t)xen_xenmap);
> -    pte.pt.table =3D 1;
> -    xen_second[second_table_offset(XEN_VIRT_START)] =3D pte;
> +        pte =3D pte_of_xenaddr((vaddr_t)(xen_xenmap + i * XEN_PT_LPAE_EN=
TRIES));
> +        pte.pt.table =3D 1;
> +        xen_second[second_table_offset(va)] =3D pte;
> +    }
>=20
>     /* ... Fixmap */
>     pte =3D pte_of_xenaddr((vaddr_t)xen_fixmap);
> --=20
> 2.40.1
>=20
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:25:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:25:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558407.872474 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgxc-0002Ys-8b; Tue, 04 Jul 2023 14:24:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558407.872474; Tue, 04 Jul 2023 14:24:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGgxc-0002Yl-5v; Tue, 04 Jul 2023 14:24:56 +0000
Received: by outflank-mailman (input) for mailman id 558407;
 Tue, 04 Jul 2023 14:24:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=D/z2=CW=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGgxa-0002YX-TG
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:24:54 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on20608.outbound.protection.outlook.com
 [2a01:111:f400:fe13::608])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8ac9f626-1a76-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 16:24:53 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8067.eurprd04.prod.outlook.com (2603:10a6:20b:3e5::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:24:51 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:24:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8ac9f626-1a76-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=l50cU5Bx04b/1Gu+l9ZnNbAo8ndlMOMVvE3c7UIqmm2ghsd43qCsTdrmGv5N8MiSqgeWUmuIA2lBqNCVIt9zqoWUqfhiUEsY+bMaTqmQi/sdFhUvv7jKc3JL9fNV1EOZpKFSd9e6AS2sxoNFKgBFNzmMhmxxShFFGfS20z2k26JBXbF7DybS4/c2T/pezjQZxYeqS6qVNHWcrHjzmw8fGFIGZLPjf/kfvyoTXNvT6sE9cXVfy3c6IrRhUTF+AWcDT3abkEG8PaBsqcbQYoY8sS6HZHnvpFFTsqx6H9ElBl9WKCloz9RlDZUtrYR6PY/DQZzl00F/PucNtbBFajptxA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=bfp/sOB1eMVA5o4DqiLd457KZuGKzZ1y3xs5SL2BAFo=;
 b=lKSM/fa+Sd1ibqpJgfSMER7W+8z0AR1PpS+hjQ9pFGf13cMsPfSOAxSH01KfgqcXOCsXdqQPxWXKslabVXFjNSJn0ArBOXn4aXkpv1h2Dz0Dlgg1rv1HtG9gnkir3rAh3ucgDpkfA9KpK5ZZQJnmZzijPeI/xRAnJQVyks7/Lnf3V7EWOKzAUrlWll3n6H8VXTmOPdGtnQpnHkNoedw/Rhj5tDgXQyXLSq++qRyJygo6tqRiWe63xZS/SsRPA4rTsdH+BFovTijv9Dkw4FkNY26ArTZmWdFmOvNlrKNoi4NXRX35pNyu6K5ZkFUh12icAuREvfpI/yLeAjw33j2ofQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=bfp/sOB1eMVA5o4DqiLd457KZuGKzZ1y3xs5SL2BAFo=;
 b=2hgaSbgH719zx96cXoezPD05sPG1jakLJXBjJK0agBfR7IjHkt1zkoCJeCRBboHABccsU4GzocnbSOVeGAJ+LcYZWbGtg1pTMNLGia4iYpqd+C9Bx94kbtWtgx+qnnXKLE0A4ZvuS1W5cizJNfJ+BCk1br/5Og6TJJun8uYc3+o4rZhgSTk536JzO3myn2j0a3RgmSLKHZyN04mzlYlslYkVCi6ySKl5tGf6cmdyQOds6KB83s7D+TulSfB3Lp08yY64C39o6oWH7gJ82jGWRlg94i7m209usJixAExM02zI7HM2EEudmHEznqvqWB3mgI5XDz7vgxr2VMBv16dvYg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <df8a0c82-5f07-6a9b-e24d-7550387fca27@suse.com>
Date: Tue, 4 Jul 2023 16:24:57 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v6] xen/include: avoid using a compiler extension for
 BUILD_BUG_ON_ZERO
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 andrew.cooper3@citrix.com, roger.pau@citrix.com, bertrand.marquis@arm.com,
 julien@xen.org, George Dunlap <george.dunlap@citrix.com>,
 Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
References: <0b0d9a5614daac653b3bfbcfaa29a9b4c11286bb.1687793572.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <0b0d9a5614daac653b3bfbcfaa29a9b4c11286bb.1687793572.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0127.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9e::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8067:EE_
X-MS-Office365-Filtering-Correlation-Id: 3335b553-235f-45d0-3179-08db7c9a6dec
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	WqttBExMSPfvZibV3X18ivCeo5jMoMnNoBXTe70SFMDfQogrT/IuJIAMJgSRnmh2W0YoiNG7u0klfNzI2EDpYVBO73faBqJXnekeIYNhWvZMVVgTb44sWv9xm/p8hu0qa6UHZHKlG0meRmLNBPcZT3kVljAF71NZ0dwkZGNnMffnqBdnWDAle/6puutyPTZyrlYl9Pb4uJCS17D4pCN2P0UvovehbktKmhuCSRGVq1rrh3WPq+Kz5ow1naZwnPiK5hIJGkn/hWSyFRHWKBFrMi9aSYfBbUvLDvs9uVEj/TGUYUOOBNtHG+qeb+M5aJTSluk4EdEyHNef44wvMKtnDWsYiuL+/iHXkG6jf6LXXNp3P5LiuLChgFNpISEvvzRNXrYZ9rCyD2hjVYqOHWrVeavdJtqOvSixF+NeDDgkCS1p1xQZL3c1fe3T02z6N+qLu8feGEFL4a2mTxTuDP2pEkvYJgKmDAFZn6+A5lz/DahY4d1JpJrZ5/7YF/SXxKfxMq0MaQxT6SK3YKLKCVAsToSiWjbVzNrizAVyBbdzPhxWGY1GLRbkADDjS1T3dxhkSMZCQBnRNoxVh0ObUohQKtx969lf7cg44YILp3ZGpy/Aa//C1kmpkn7I76d/TLIAeapwjLCeTsVAClZnqDBslw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(346002)(396003)(376002)(366004)(39860400002)(451199021)(2906002)(41300700001)(5660300002)(7416002)(8936002)(8676002)(36756003)(86362001)(31696002)(6512007)(6486002)(478600001)(83380400001)(186003)(31686004)(53546011)(54906003)(2616005)(66476007)(26005)(66556008)(6916009)(4326008)(66946007)(6506007)(316002)(38100700002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-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M25IK0ZVTG1MMm9waEI0cWtG?=
 =?utf-8?B?ZnJpbHV4UmltV2x1RlZDNUlCNitPc3l5WmNodnM3Nm5PU3FYWmhyNmVXZTl2?=
 =?utf-8?B?NE1zbkMvUGgyZ3VBUVB1bVdnWFFYa3pvYlA3VzhNZ3JuR1BFTHhHTVhzT3Z2?=
 =?utf-8?B?cVVVRklqVDRpQU55dmlrYkdYVVdOSWZWQXRWZzlUVTZKOHlVcDV1UkxSbzN2?=
 =?utf-8?B?T2RWS3RhRG8wTXM5UHVDeVhDS2NYdEYzR2FGZ1JCZnAxR3Q0cUR4bmhTdUVP?=
 =?utf-8?B?RUEwckc4b0EyWlF1VXJCb3M3eWs5QWljeHdKcFlHc2JTTUZNZllyQU9wVEpC?=
 =?utf-8?B?RWhsOGVGTklSbm5UemxHNmsrOWl1MmdCa3BTRDQ1czBYUFRKMlUvd0UrOVh2?=
 =?utf-8?Q?ps/DBWxmwDS3FWEb43W+Vj3zi?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3335b553-235f-45d0-3179-08db7c9a6dec
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:24:51.4947
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: weVR/5Co9X1teVguQ+Umfr2C1hLtiWC4+XmBOJKcfk1CoSgz+h4eb2o8Q5ZypxSItdiGNscrlCt4SP372K6oBQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8067

On 26.06.2023 17:37, Nicola Vetrini wrote:
> Redefine BUILD_BUG_ON_ZERO to avoid using a compiler extension
> that gives an acceptable semantics to C99 undefined behavior 58
> ("A structure or union is defined as containing no named members
> (6.7.2.1)").
> 
> The first definition includes an additional named field of type
> char.
> 
> The chosen ill-formed construct for the second definition is a struct
> with a named bitfield of width 0 when the condition is true,
> which prevents the UB without using the compiler extension while keeping
> the semantic of the construct.
> 
> The choice of the bitwise AND operation to bring the result to 0
> when cond is false boils down to possibly better portability.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

The code change looks okay to me now, but I'd like to double check
towards the testing you did with this change: While it is clear that
you will have checked that the tree builds with the adjustments, I
expect that would have been with a compiler supporting _Static_assert.
Did you also check with an older compiler, using the alternative
implementation? Plus did you also check both constructs for actually
triggering when the supplied condition turns out to be true?

Jan

> --- a/xen/include/xen/lib.h
> +++ b/xen/include/xen/lib.h
> @@ -51,9 +51,10 @@
>     e.g. in a structure initializer (or where-ever else comma expressions
>     aren't permitted). */
>  #define BUILD_BUG_ON_ZERO(cond) \
> -    sizeof(struct { _Static_assert(!(cond), "!(" #cond ")"); })
> +    (sizeof(struct { char c; _Static_assert(!(cond), "!(" #cond ")"); }) & 0)
>  #else
> -#define BUILD_BUG_ON_ZERO(cond) sizeof(struct { int:-!!(cond); })
> +#define BUILD_BUG_ON_ZERO(cond) \
> +    (sizeof(struct { unsigned u : !(cond); }) & 0)
>  #define BUILD_BUG_ON(cond) ((void)BUILD_BUG_ON_ZERO(cond))
>  #endif
>  



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:30:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:30:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558413.872484 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGh2U-0003J4-0o; Tue, 04 Jul 2023 14:29:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558413.872484; Tue, 04 Jul 2023 14:29:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGh2T-0003Ix-Tu; Tue, 04 Jul 2023 14:29:57 +0000
Received: by outflank-mailman (input) for mailman id 558413;
 Tue, 04 Jul 2023 14:29:56 +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 <SRS0=D/z2=CW=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGh2S-0003Ir-Rd
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:29:56 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0620.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::620])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3e3eb0ed-1a77-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 16:29:54 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU0PR04MB9299.eurprd04.prod.outlook.com (2603:10a6:10:356::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:29:53 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:29:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3e3eb0ed-1a77-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=nLORJO8KQhFzUMU6iyoUEt+duBdecNw6+ExxS1fylfUnoBqQB2ldQ3CD6PnEApRbuDUwT5rnlGsh2cBN7ujLivgaSksh9a4bWVVUkQGIU514n1F9bkMVC9EoWFVQdRCUYVbWtl8Ox3OX5LAdr1YlXlX9l+sanKlHFJPaIX64ku1qyBEDBTBjCO49zFl/Gw/jLhHq9+5AiX5AcZpdVXZdSXAeqW0vPZnvVZ/l7DcvAdDCL/4pltlCMEhEScLfuiRXwDOHyKf2Lulk1QxV7y/SkKyANEkpLnhh083R6GWY+gmmPfuEpGbBYLpFEQVYx5F1HKsKP3jK91Fiklsw6VQpgA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=qUo9VbqK1E0QofwcLeUuuaBC3c3sbvfQKGI0IvuYq8o=;
 b=Ipo7NSUySHIhs5FK0Av7vGAppBDsHSclIq8VSlEhf55YvC3TBiB7rAuYvFHcN5MKyCoITXUeo01nGro1IXeTa4RYeDa99ejaMZbsy+Ecv6WHxChOaBGF/FWyif3E3jg8IW5WuI/V7SeJohCJJk/PSskalZUHBQI6i6gg84it+s0IqkicFuzkQ/4VwLIy9O3di+sJ1QlEkpuPdNtR2BksdSEMFJWizrFFUCbh4+ttkrP/Pj5BMO68DNoiUpGIaNVCQi01ducFnh2VKQsWuMUSS8kGldLhAIwCUqZqjdu/M/f0TiNMQ0S/HRolJxVt+kDTmuwEs2BAMDWLs07SuxRurQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=qUo9VbqK1E0QofwcLeUuuaBC3c3sbvfQKGI0IvuYq8o=;
 b=gCnhK+loOeY6iByxOiZCghwIYpmxSMcxvXarUAQ58TEML9MJKNVDCSbVVbmrhEXrdhU9C5OJOorecdVbLHtqaNWDGoTJUJeZUe5c3+iuG7hc/ESTltDyIDgP4wF7QR4O5KMvIIbA9YN9Kng8wZ6BfhRskLtvlfEfy8cRyKJTx8qjdqx84HvEYlPGyCMMVrtRZM1JqIQ3hgtrVrpyMlTdAyN23OdSxwf5TH10Qz+vADlZq/J/CadAgU06irkwAOYkdhbx7AV2C4gHgVnjnr90ml0CZvbTw5CYd3oS9ZDZiWZfCwW6L+C7rgbIkOsmJcTDZ6vwtPdm/iR9U848r4h59A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e85c73ae-aaba-a649-6bf5-5528b4cf6e95@suse.com>
Date: Tue, 4 Jul 2023 16:29:59 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH] x86/asm: Introduce a tailcall pseduo-op
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
References: <20230630152057.2944373-1-andrew.cooper3@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230630152057.2944373-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0206.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a5::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU0PR04MB9299:EE_
X-MS-Office365-Filtering-Correlation-Id: a92b2d95-9150-4494-faa5-08db7c9b21a4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Pg6Ej38RxcLjEQUbqMgOzF+NxhsOiUfn2zLGSGpZMNps2ENLcIJkM8bCepCbzDGbEzuMOCDMmP54t7h9hlKS436DjFFJqvLjt9sL8wz6t0LIwGH6H3ByjLwk2h1Cf5buZ20AVob45Kicn207dub1oh559jpgr8/Qgmeq2v+a17YS9Qjm16agRltu3w4JEHY3MOPncwZVSFBLrmogiTg/LVK8b2u01zGrcTdtCW615gGLOesWZ+gkbP8g0P8VGcn5fpodbKbWcXGAlDwapygdmIHarUZ2e5mLqk04/THYlKg3NZ+0PeEu60AjFTkuVyGNl/zGTKizZpqwe3dqKijFVlz3zMqcbtQcobWfTvjm4mLqJQpppSb4rRnjxyhZk3xIVCxpelGJ0g5ZkoqzB1kuOZ6+Lm31qnEhNcTX2UZCggwHWzxryTRRDVFZyyQN+BA8j6bRnInElRbBVLqEwW7MwaAaVC2vszkCxHpZZFdR+lNKnwm7jRPwYNG1WFndMLI2lnpuHmbDNCQt2LCSi5wfzPnvDDXHXXZftwvUmSuW+q3gj7lamhRCyASS88Hje5aGD1F10go9OcO3dXYyhDEP+9ShwdXK+zPiwdFodGF1uil3RBp0TeY84DmDqF3PKHoFT0YvFAwwpuPPdwNFKfhA/A==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(346002)(396003)(136003)(366004)(451199021)(31696002)(41300700001)(86362001)(38100700002)(4744005)(6486002)(2616005)(186003)(6506007)(53546011)(26005)(6512007)(54906003)(2906002)(478600001)(36756003)(316002)(66476007)(6916009)(4326008)(66556008)(66946007)(8936002)(8676002)(31686004)(5660300002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?V0VXaDc2TkplajVRSHJwYlp4T2F3VUNzWnFkTWdyTnordkJrVk5oT2pJYW5V?=
 =?utf-8?B?aGtYeGpCWnUvSEVoSmIxYnRsdE9qZUhRcUw2MHF6bkpxUDVFUW9yRWxMRnBH?=
 =?utf-8?B?SFI0R2t2UVFXTHJwZ2VHallYZm9CUkdKNFFOVDlPbzVIaUV0dEFRRGJRdHpL?=
 =?utf-8?B?SnhoMWhJUkl6QUpLQTVMSDFCMm9KTlRlb2lPOFdZRFZqS0drRHVVaXZYV01v?=
 =?utf-8?B?TmwxSUpTWE9veFJZakV0enhBWWgzaTJHV3YzN3IvdnE4SWF6aUJyT0owd2Rn?=
 =?utf-8?B?b3RCZVQ3RzJRTnJ5dk5jSmdXYkVGKzlEM0hxM2wySEJHWUFFSnhxeFlPV2M1?=
 =?utf-8?B?T05mMEZpdTZPWWM1V1NVOEl4UGhGekszRk4zTkZYUnpKRUhqa3VtdmhkQnFH?=
 =?utf-8?B?bzd4TlRyN2dFTlhtYmd4YTE1NEFoUCtqZnlrbDBxc3dNOVRZQWhLSzducTYy?=
 =?utf-8?B?M1NsUk02UlVWRDBVNHg5MnN0Z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sLy9l?=
 =?utf-8?B?MlJFV1B6SGVjaGhsSjdYR24xZ2xLb3NWUDZxOWhsREJMTGdSdmpuTkk3WGlN?=
 =?utf-8?B?ZkZXeEtBWWpPeFV0Umx5YUIwK1hkOFNBU293eGd4Y3RCOStOakFNemQwaTBX?=
 =?utf-8?B?cTg4VGhyWTFyRGlIbW9sK1FDdUJPOTFaMWtoazZReVM1MnFRQjhlMWh0aDRN?=
 =?utf-8?B?Nk80YVVxMVNZeURFSEVtY3FOaDBHUWo1UVk3VVNWMjN3dk9vZnNoV0Yyam4x?=
 =?utf-8?B?S2I0VkdTYThtZHlPOSs3eHhhelJYdDRJTmhZOEtEdmE2a1pLMHlrbnlWRUEv?=
 =?utf-8?B?bEFEbTZzaUltRE9EbHhzOE1TYkhlRTREcXZ5dndKOWF2dHA3akw2VE1PQWxO?=
 =?utf-8?B?YkNEM3lzRmZpVS9jblprU0RNVWdjYUpmcHhCMUtCTDl6OWpMdndUbW16cTlJ?=
 =?utf-8?B?bjZWTHNTa2U4MitZb3hNTTlabDRXcGZ2S3hqRU5CY1FBQ2xveWcwZm1ja0xi?=
 =?utf-8?B?YkQxMXg1UFFRbTkwMzlVVVJwTDBhWGFFdXB2UTdldkVyTmcxeGRQVUZxOVVU?=
 =?utf-8?B?bmtncUJ0bkNqNVlwOEJ3endHakF0Qjc1ckx6aG1zK0VUWkNvV3A5WDZkMWtt?=
 =?utf-8?B?SlJRazl3aDhHdHV4anoxV2pPSGwrcFMrV2xaTnBhaklVR0RaTGdnd215QjJW?=
 =?utf-8?B?T0FvMDlmRjY4MG5ZQlpPNjVuVjZId2lncFF1NUxVdDFvdzNpbVNFU3M4ZXN6?=
 =?utf-8?Q?5M106qqXZJapn1bSRY+m3avdp?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a92b2d95-9150-4494-faa5-08db7c9b21a4
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:29:53.0155
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 8I1iGq/27FE3U4PtDMbH+EBs57VUZwGbqYAgEjsEvFsgOqEUD4KzyRxU37XiUkFiA27wyCUva4ifIyIZdZzcxQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9299

On 30.06.2023 17:20, Andrew Cooper wrote:
> It was previously noted that CALL/BUG is a weird combination, but there is
> good reason to use this pattern.
> 
> Introduce an explicit tailcall macro make it clearer in context.
> 
> No functional change.
> 
> Reported-by: Jan Beulich <JBeulich@suse.com>

Did I? Must have been a long time back, as I don't think I remember us
talking about this.

> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
> CC: Wei Liu <wl@xen.org>
> 
> It would be nicer if tailcall was shorter, but that loses clarity.  RISC-V has
> 'tail' as an alias for 'b', but that looses the call aspect, and tcall isn't
> sufficiently recognisable as tailcall IMO.

I agree with all aspects you mention here.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:32:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:32:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558417.872494 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGh4o-0004hn-C8; Tue, 04 Jul 2023 14:32:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558417.872494; Tue, 04 Jul 2023 14:32:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGh4o-0004hg-9R; Tue, 04 Jul 2023 14:32:22 +0000
Received: by outflank-mailman (input) for mailman id 558417;
 Tue, 04 Jul 2023 14:32:21 +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 <SRS0=D/z2=CW=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGh4n-0004hY-Pv
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:32:21 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on20630.outbound.protection.outlook.com
 [2a01:111:f400:fe16::630])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 94d4f2b7-1a77-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 16:32:19 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8095.eurprd04.prod.outlook.com (2603:10a6:102:1c6::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:32:16 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:32:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 94d4f2b7-1a77-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CSabIi0JxtP7hRvSFggeMB/TalYEP691ncwfDyN19F+aGw73NmRYwnZl+ueVA4sCZOHl+Wj05HrfywNTckCg0QZFxmJs+BBjYvjZF2GhHH8r57jz0U5O2a9c6OqYfQSZrN8KhlkhzFi7d5w+9zlfxjIfogK0i42Krmdtq+xXYoJiHGTJq8yHwdA0rlA39k0IbLeYlEDbR+ad6DlsXEcFcCC6eGaYDvaMpoGpit3FYGs6etLtf8q1uRnesmLThyxwgM3IMJNTT0Ja9fKnyHd+t6qYNIPKMMRKac8LUHBh7bXh14VrnnzYq0XIwKucgnXrE5LC/U9B30u3HY81oL5B0g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=gFGoua6aKvlEbN069IhmsjpuFn9TqK52MFlJOSz11Pk=;
 b=IoFGn1WVIwACyBKzJpsiRmFDKYe9FtLjEG0LgG7OOt0ZCiQkIOF2H4I8csugKoH9xvyeC/njgBoBPekTahaHlf9KWGtIOpQ8OeHx1386m+LzXCj/67B1BghiqJy3apBZ6lvt6dMmc89C5nHER2J75oKlBy6uDGGZjW1l1LfF9trSk0h8Z111PPQC/9VE5ABnP1zeb1O42ppmy5Mdm8WkR45LbNqmcMIe++whXoRvsuddmbYyin8anpbvOHh7duYIc73KLop0ScVRsMbymXhHdaLS9PrkJ6zPdp8+BFtnpkkUfts6iRYkJzuArnzgPfPItdPnYijeO8H2ZrCS8iRUJg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=gFGoua6aKvlEbN069IhmsjpuFn9TqK52MFlJOSz11Pk=;
 b=tRG8htXCldXYmEOR6fo3F0m4MnqcnWJD6V/ZmyPP1JAupjORLpWudbjanum0UmGyNhd9c/Z5wVf2gKmFCEdHLnychhtSEdBbgvwYibpTiLUsSwLjCc+51Qp5DGhrl3NDkf4R6QC+5kIYM7m1axOWOPavqcnrZBhQcsTdeTYnY7YIVum90ArrrBuSXUQmKh1GBdqr/fZ+3yxWQfKw2kYl56Jy6++ww81zcXJZL1Uc+7q19SV1mND5mmam5NnKLF7xa5aeo67gcR1DduJPOsjJCJWyvPEZa9SjC0BBFSK5SawzqYnaTS434fpuejC2tJmytF3IuC4N744Ff3Qq4f1MtQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <4194337c-9c21-1a72-bb37-93aa3a0aac31@suse.com>
Date: Tue, 4 Jul 2023 16:32:21 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 2/3] treewide: Avoid including asm/types.h
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Timothy Pearson <tpearson@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230627075618.1180248-1-andrew.cooper3@citrix.com>
 <20230627075618.1180248-3-andrew.cooper3@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230627075618.1180248-3-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FRYP281CA0001.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::11)
 To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8095:EE_
X-MS-Office365-Filtering-Correlation-Id: b6ce9ae3-fb0e-4327-d37c-08db7c9b771f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	oMk2k2vzCob81zu9b3pLZpXLJv/JRe6Q2gXk0SXAHWj0/+5E5vvGvE5+2DpBsw70NcMo+a10M21lL/tyk2XuxyO72DqQmuO6I7ZRP6UmvnQbDv/HufViq3G9hSRjHF7RcJh68vrg8WbF2DD20Ao8Oh8QzuyzBi1tcOPBIwQu5i4iEZSKfGxIIrMzsdvbq7+0awC2mUsKDJSqo0qCCNNWXZdEjMsUO29edlcBmxPIPPPi/V1ld/qOWHyIbhRNUwNxCmJjNVRGlj+mESJgV3f5r1qeryghal6QjKBYJdPkN4CIu9NMaiZaUbgUkn0vlVTz8uXuR9dSbp4emc6MoBE2Vv7mPY0dWSUuunGI2eubAwy54Z13KZO6/pTx2cxuNM/nUUD8lhK4OKztOYcD+6F9macqV76OApOtlwP5LgTPApI2iRPVDiiSp6RM6P3AEiECqr9KxGCGV+MaHytMKbRQXTMw22KZ77uJ7pS+05M9RLJKPMYKHoesv3JfA0xLzH7mh45nVdHEEBIBP0O5Xl2aklQ1FYxIxZh1LgWROXT1OGPclBNaTu/u854/IKAPy2QRq084TYlQS4R0vKWvdhn/OFNTp4TyiAkBAMtiyf3LLiLQhe/NgsUyfYKa6ymo2BiOHbJ5lDQfu6wLHbB77NNdZw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(39860400002)(376002)(346002)(136003)(451199021)(316002)(41300700001)(6512007)(6486002)(26005)(53546011)(31686004)(6506007)(2616005)(186003)(478600001)(6666004)(54906003)(38100700002)(66556008)(66476007)(4326008)(6916009)(66946007)(5660300002)(7416002)(4744005)(86362001)(31696002)(36756003)(8936002)(2906002)(8676002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?b0ZzaFJOcjdVdlk3WXVudXpZSFVhZTRaK3Qzd2ZXTmRuMXBoRU4rN2tQUzlW?=
 =?utf-8?B?TjlSNy9KRnJVYkIxRTZkVFYxQTBJQnVuSGp1YUxiUzdyaWJpNEVzdkE3ZEZT?=
 =?utf-8?B?UEtMSnQ3amZiOHlCdFB2UU5taU94T1A0S2dVYmJMTWwrejJkemduTDNieUVO?=
 =?utf-8?B?aHFGajJqZzdEVUpZTTZVWkJaMnpBQUJxVUxQOEY0ZER6MHZILzlEeEdWRnJZ?=
 =?utf-8?B?bzdjRnp3VklQNXBSbDQ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zV5VC9tbnU5aklYaXBqdzB2c1kxZEFFZ281c1g5a3NvRzN6?=
 =?utf-8?B?aG8rd010MG1xVmN4V1F1TTRPNEdJcDJpclFSWHpNNjNHVlVBYWxOd0JZeVhG?=
 =?utf-8?Q?5uxSsQaItpRqmEPefTSQ6djGE?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b6ce9ae3-fb0e-4327-d37c-08db7c9b771f
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:32:16.4394
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 4YjkDHDAYwDf94OSSibmM8mAK3dhllrwLi0fWTnYRVctNVYlqp4JwK13GNJfdI1OrGz+IJc9tuXMRCNQem21Lg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8095

On 27.06.2023 09:56, Andrew Cooper wrote:
> We're about to rearrange the common and arch types.h split.  While most
> users already include <xen/types.h>, a few do not and some files fail to
> compile as a result.
> 
> Almost all logic is going to have types very early in the include chain.  Drop
> the include entirely from C files, and swap to the common types.h in headers.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:35:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:35:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558421.872504 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGh80-0005JT-Rh; Tue, 04 Jul 2023 14:35:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558421.872504; Tue, 04 Jul 2023 14:35:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGh80-0005JM-OH; Tue, 04 Jul 2023 14:35:40 +0000
Received: by outflank-mailman (input) for mailman id 558421;
 Tue, 04 Jul 2023 14:35:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kGqQ=CW=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qGh7z-0005JF-DF
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:35:39 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on0604.outbound.protection.outlook.com
 [2a01:111:f400:fe02::604])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0b0b32e9-1a78-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 16:35:38 +0200 (CEST)
Received: from DU2PR04CA0188.eurprd04.prod.outlook.com (2603:10a6:10:28d::13)
 by DB8PR08MB5354.eurprd08.prod.outlook.com (2603:10a6:10:114::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:35:31 +0000
Received: from DBAEUR03FT030.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:28d:cafe::bb) by DU2PR04CA0188.outlook.office365.com
 (2603:10a6:10:28d::13) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.31 via Frontend
 Transport; Tue, 4 Jul 2023 14:35:31 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT030.mail.protection.outlook.com (100.127.142.197) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.18 via Frontend Transport; Tue, 4 Jul 2023 14:35:31 +0000
Received: ("Tessian outbound e2424c13b707:v142");
 Tue, 04 Jul 2023 14:35:31 +0000
Received: from 168dc085fa6f.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 D9F33600-BDBD-4DC7-AF68-52DBD044B484.1; 
 Tue, 04 Jul 2023 14:35:19 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 168dc085fa6f.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 04 Jul 2023 14:35:19 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by GV1PR08MB8237.eurprd08.prod.outlook.com (2603:10a6:150:5d::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:35:16 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:35:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0b0b32e9-1a78-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=K+rZJlQ1eC64c5Kq4Za0wz2FbOXczQGH8R/vTXItowE=;
 b=GKzTp23tT0MeMfOovpic2ejI7wFQiV1IGrPf2wBpE2dpLFsQ5Vks2yGoiEE1y+BMOomT0TmPEAnxbjjwG9zJMMP/NbzxJZVESMnpFfLfJAUlTMlkzC0CXWr4VytnTzy1UwvFRswqqfYLcQVOGoKLr9jJ42o/EJa24ttALUXTuPc=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: a9dc3cd63b91531d
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LiHJFWjoU5D7777zsFdh4woyjFaqO6Xk8Ut1phuBYKXejExyteshgG0UFCyctKdo0cFM2TuWqJgC1FrKV9BjEcwcUp9qn591jY5Li8fYk2DwkUK9U7dChsDnEmutJQ9n17EXKMv5OYFNFw7qEt3nArOzJNiYT342at9wYXf28WXPS9C2q8E0KOKxf6zh6Qoc1fRxGTE3GjZJ9QC461l9hrFlMHkunbjRppfPST00YwVbG3dtBi742Uh2jXrsrpSeWEsD01CP/YizmD0cTU6eJZqDkf5jb4aZtBMDNjJdZfiF+9oa3+yCzi6Lb2ktD79hntkRSYvooAWK4EG6ZKdw7g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=K+rZJlQ1eC64c5Kq4Za0wz2FbOXczQGH8R/vTXItowE=;
 b=YmbUzQOcaBnrO6MtF1pbM/lqlcYBS2GhN7tB+NKasTt5duAcSw952btUq8vETlX9chxvh8lIrHngWVjnSzmYK69vGPuWc/MYukuI3CbF3vz2cjy7bmnrPCFjVJxp79p4it0WiMKVu0cJGuKo4XyqXAX0i6Ff46jLqaQZhuUt4DP9x+GdqkHmwyiBwtavdUVs2ZeKZeGC4ywr+O8CTeBh7SSqcmDLQN8VOx4Z4d9L5MRzm7OS14d+Pj448E47PZJnLikzBCyr4+2DDfypRboD/Dvq9ywbRrn56mxhdhyznxp+0cWz9rnGMpNJcdKDe+/dt0TMEJWlvVZZDbiIcpOHJQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=K+rZJlQ1eC64c5Kq4Za0wz2FbOXczQGH8R/vTXItowE=;
 b=GKzTp23tT0MeMfOovpic2ejI7wFQiV1IGrPf2wBpE2dpLFsQ5Vks2yGoiEE1y+BMOomT0TmPEAnxbjjwG9zJMMP/NbzxJZVESMnpFfLfJAUlTMlkzC0CXWr4VytnTzy1UwvFRswqqfYLcQVOGoKLr9jJ42o/EJa24ttALUXTuPc=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Luca Fancellu
	<Luca.Fancellu@arm.com>, "michal.orzel@amd.com" <michal.orzel@amd.com>, Henry
 Wang <Henry.Wang@arm.com>, Julien Grall <jgrall@amazon.com>,
	"federico.serafini@bugseng.com" <federico.serafini@bugseng.com>
Subject: Re: [PATCH] xen/arm: grant-table: Correct the prototype of the arch
 helpers
Thread-Topic: [PATCH] xen/arm: grant-table: Correct the prototype of the arch
 helpers
Thread-Index: AQHZqs0B2zzuMPxesEq0PvPe7uOM1q+ps9kA
Date: Tue, 4 Jul 2023 14:35:16 +0000
Message-ID: <B186E9AD-1DBE-41B2-ADE9-850F1ACC4078@arm.com>
References: <20230629210150.69525-1-julien@xen.org>
In-Reply-To: <20230629210150.69525-1-julien@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|GV1PR08MB8237:EE_|DBAEUR03FT030:EE_|DB8PR08MB5354:EE_
X-MS-Office365-Filtering-Correlation-Id: 0abe300b-2588-4ec1-dbb5-08db7c9beb42
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 HtaIxZGEC+7II/iIThVIuQCgfEMckEvA9BGYjIbuivv459s7J3/R6f4mRutpbHfBbSSJjFrs+XvxOTL8qjdJ8EEvwjob8+/mZjs/LO9vCOd3/NK5bADrchOKBa+AaS6JIsvNi4WJ47c9hE129rpT9cxMMYbDWEeZmsyI0SzP18UDXeMz023YKxNNMWeWxD2SAPTbZ3H1Gm0Gsk4WFVYcENEH7qkJrXExxxEwlzTkW43wQZhnpuTm+Ooq9UYNksMxy4KMDOiQNIsPDpI86oqySzG/0z2nWau587VNfAaFEPzMNlsi/+qATAMbpZSbUuUYMvG9Z1SUGSjOE8VcitDC7dENlKq0+g24bMkEGXvXqD6DtU/6JbwB5WX15++tPLuIDu+FjcyLW2HCkVuj37Z1OqyrtZCs+AuaHvpyhgALVhfGQHQc0wdP6d9GJIHyCNuDEzG9daYCQpYcnigV6sQE8tSnAa5ybLmWQce4KC0VqrvMQrbiv+Q+4RV5mcjiNT+dZfSo7oeXTDWPbT1l7EvIOdMtVMXjsQQFlvsSL9VHovrkLrqGw3RAI9LpNMur15yxhWjKlLc0LN/LVN//tPPe9R08P0PXpnZBiMm0iABsGEb6Yhc9bhgy2ZydlXhwGSmmuuw1nnXyKkLIlaDCaeHg9Q==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(136003)(39860400002)(396003)(366004)(451199021)(478600001)(71200400001)(6512007)(6506007)(86362001)(2616005)(186003)(53546011)(38100700002)(54906003)(66476007)(64756008)(6916009)(66556008)(4326008)(66946007)(66446008)(83380400001)(91956017)(76116006)(6486002)(316002)(122000001)(8676002)(8936002)(38070700005)(41300700001)(2906002)(5660300002)(33656002)(36756003)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <3319E8BA585A3F4A8DC57110E7B9EE0D@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8237
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT030.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	42c3eb7d-cf38-4296-e288-08db7c9be295
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	o8/7ZzrB7Q010kYpZm/vqto8AztIQ5kqp1lULcX9pSRLTf+Z5dmYrwpRjsgJbcV6zMeNkOHSXobmyEoivz2IbyfV34PnZHa2PyTbgvNnB+HglqwoVxb8A+hKDHytsr35TWay68dqTwtzB0qsK1gcWbClOXGfcZRECxNEP06H4QR8aS5Tih2BtG1pXIyIfpjQcF5hJMKoC52Or0bNvlGztqpzA82GGwCLPN5cdNIjsSzEz1jq6A41unzZqKDEPjz/A0c914+aLGm7IrREBPpXX7Ix5HMl+jaPuVg6O5U2lSluAisvi3sWFbsfAdpgUUDl1mRJIAfhyKQWMLkuSoDRQMc5qmIesc0F4jxP6l7qchYFZrAqwY1+SKKd6bMTyfFJfv+5mt4N8UxLR0bfw3MFkRL68bccRe4lQdj9bClASN5S7OsyDeJl4gOONkqDr7xnBLigSBO7Cin55a9l6L9n+cVI9UjSgVVfAXs9bP5KLsytfRnx69Bv5/uulTg/VF1SnX7RCiBWrF5IC8NBU1rmgGAyDdC2KxhH6Y2QAxCDurrySD1EXBC81gR0IUsWh+8JdcC8vuBjlRcMpaQyWkPldzsPkcX1HGmUZd8x8gL4bA/xPtnuBOAR1DKqCcMn9Pv4KbtW9lqUbtGCsHvHCvxPnZZO4Fpu6oyC9WMdGmKQAclatZfoODP+GnZCkt0sIIMAi+RhQqGraC+t2TqvUMes6QkbOae72dzhcbzko8kM172ladQBplkl25uzxPFOgXi5
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(346002)(376002)(136003)(451199021)(46966006)(40470700004)(36840700001)(40460700003)(2906002)(41300700001)(6862004)(5660300002)(8676002)(8936002)(82310400005)(33656002)(36756003)(40480700001)(86362001)(186003)(2616005)(478600001)(26005)(6512007)(6506007)(82740400003)(6486002)(70206006)(47076005)(316002)(70586007)(4326008)(36860700001)(107886003)(53546011)(81166007)(54906003)(336012)(83380400001)(356005);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:35:31.1859
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 0abe300b-2588-4ec1-dbb5-08db7c9beb42
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT030.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5354

Hi Julien,

> On 29 Jun 2023, at 23:01, Julien Grall <julien@xen.org> wrote:
>=20
> From: Julien Grall <jgrall@amazon.com>
>=20
> Both the stub and the x86 prototypes for replace_grant_host_mapping()
> and create_grant_host_mapping() will define the first parameter (and
> third for the former) as uint64_t. Yet Arm will define it as
> 'unsigned long'.
>=20
> While there are no differences for 64-bit, for 32-bit it means
> that the address should be truncated as 32-bit guest could support
> up to 40-bit addresses.
>=20
> So replace 'unsigned long' with 'uint64_t' for the first parameter
> (and third parameter for replace_grant_host_mapping()).
>=20
> Signed-off-by: Julien Grall <jgrall@amazon.com>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
>=20
> Cc: federico.serafini@bugseng.com
> ---
> xen/arch/arm/include/asm/grant_table.h | 6 +++---
> xen/arch/arm/mm.c                      | 6 +++---
> 2 files changed, 6 insertions(+), 6 deletions(-)
>=20
> diff --git a/xen/arch/arm/include/asm/grant_table.h b/xen/arch/arm/includ=
e/asm/grant_table.h
> index f2d115b97d8b..d3c518a926b9 100644
> --- a/xen/arch/arm/include/asm/grant_table.h
> +++ b/xen/arch/arm/include/asm/grant_table.h
> @@ -36,10 +36,10 @@ static inline bool gnttab_release_host_mappings(const=
 struct domain *d)
>     return true;
> }
>=20
> -int create_grant_host_mapping(unsigned long gpaddr, mfn_t frame,
> +int create_grant_host_mapping(uint64_t gpaddr, mfn_t frame,
>                               unsigned int flags, unsigned int cache_flag=
s);
> -int replace_grant_host_mapping(unsigned long gpaddr, mfn_t frame,
> -                               unsigned long new_gpaddr, unsigned int fl=
ags);
> +int replace_grant_host_mapping(uint64_t gpaddr, mfn_t frame,
> +                               uint64_t new_gpaddr, unsigned int flags);
>=20
> /*
>  * The region used by Xen on the memory will never be mapped in DOM0
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index 0a3e1f3b64b6..53773368d036 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -1579,7 +1579,7 @@ void put_page_type(struct page_info *page)
>     return;
> }
>=20
> -int create_grant_host_mapping(unsigned long gpaddr, mfn_t frame,
> +int create_grant_host_mapping(uint64_t gpaddr, mfn_t frame,
>                               unsigned int flags, unsigned int cache_flag=
s)
> {
>     int rc;
> @@ -1600,8 +1600,8 @@ int create_grant_host_mapping(unsigned long gpaddr,=
 mfn_t frame,
>         return GNTST_okay;
> }
>=20
> -int replace_grant_host_mapping(unsigned long gpaddr, mfn_t frame,
> -                               unsigned long new_gpaddr, unsigned int fl=
ags)
> +int replace_grant_host_mapping(uint64_t gpaddr, mfn_t frame,
> +                               uint64_t new_gpaddr, unsigned int flags)
> {
>     gfn_t gfn =3D gaddr_to_gfn(gpaddr);
>     struct domain *d =3D current->domain;
> --=20
> 2.40.1
>=20
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:38:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:38:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558427.872515 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhAu-0005wH-E6; Tue, 04 Jul 2023 14:38:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558427.872515; Tue, 04 Jul 2023 14:38:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhAu-0005wA-8h; Tue, 04 Jul 2023 14:38:40 +0000
Received: by outflank-mailman (input) for mailman id 558427;
 Tue, 04 Jul 2023 14:38:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=D/z2=CW=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGhAt-0005w0-Am
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:38:39 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20608.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::608])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7676027a-1a78-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 16:38:38 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB8136.eurprd04.prod.outlook.com (2603:10a6:20b:3f7::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:38:36 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:38:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7676027a-1a78-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=gi8KVF04OZO9TAcimykRTgGSb1XdqstfXsNZeN2w/ZhdN84RjD4n/UBDO5yG4nRgpd2rWnEwBUGstJBVKgdd+zKIfaHHqEnP7tyZRUhfL5LhmltJUdxZTlyroe0rVHGc3cvgTMx7R2yQJGXEoQ/6+MC+6MCGcL6TXtIPCbt4ERSYR2DjB4cExkChWOsnXYwtaYkYOtZqxmPUyQAYXQVqzv7wqw/kZNmbNKvGBWF890osvZpj8f1aXxutiDunjXQdPrj6Ch9EMrMraoEKPdfDIjuKQyGXoXEUG7voK4tWPjJHqtKLWV/JDDhE4ED1TfiV+7IxUe2fAlyk3Uxxj6V8WQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MuNhuMAqFMs1w6BxdSHXBrN+n65LvlYXXmD1XSEsnTA=;
 b=HVyjcapa7uK3PhrFUZfxTqOcv6igAfIeQdzQ+T5CzK/qVAlD28IHGNLSopgQLDcprlVTWXk2hv/ooG097wrXm9fN1qrkNmCbFTSwdHtHz1lsoDCpy1EGKks05Sr5U/gzhdiUrK9/e8gDBkNs/13/ZEMIG6oW+jCyM3WSwutXXdTxwkq93oYYF6CfICTrDwumHVpqE0vXWZp4fXVIgSeJrbNREplowwkTS6stsqaa+gZev+8Qzf/VY8po58a/E9c9gtVCAmv/K9aS/vg8KLu/AGRxeLOIkKdh1y1NTlcsXW5pjtP/j2iH89z/JHDfRvLFxC4H6BPDhxCIzDcYmHiQ3w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MuNhuMAqFMs1w6BxdSHXBrN+n65LvlYXXmD1XSEsnTA=;
 b=yoGZd9G36JzGuPZSm/OEDBSMYlcx6ECcPBAo1HlcmxpDD9JflaDw7ENH/QSPKbTMcRQPO/bVL3vL1q90eZ2NbPv+GE/TU4yNIt+wzEYBYShn2V5bZTYLYngHlg9DPwUvIDnUMJb/S/Dzl+/QzKIIYb7LB9OkoxzYD30dFL0JsmHpG2QQiys8aqHNdRz85Qw+s6Yd8AJHwIb8MPMF628LUpR4+Ang93gRNiMxneQLC/3XIKujkJHarOk0DB4lclE5Tqq5zG90nyzOe66Z5L+TExIiF4NAz1P9PYxvpwhoKip4sM2XtOAUT8M0uSvkN5Rwca0MNlCWfTYUGOz2QT3FDw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ba212e0a-1bbb-9576-f6ff-c6d46d80b17a@suse.com>
Date: Tue, 4 Jul 2023 16:38:43 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2.5 3/3] xen/types: Rework stdint vs __{u,s}$N types
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Timothy Pearson <tpearson@raptorengineering.com>,
 Roberto Bagnara <roberto.bagnara@bugseng.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230627075618.1180248-4-andrew.cooper3@citrix.com>
 <20230628145403.3630-1-andrew.cooper3@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230628145403.3630-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0138.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:96::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB8136:EE_
X-MS-Office365-Filtering-Correlation-Id: 0d5e8731-c181-4e5a-40dd-08db7c9c59bd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	VgWVImoYrfpryuJGuUmCRBTu1rhQYuL9lyJA1xouNAY52AMftRfeLz5UdKS4hjbMb49lMgwAKbDqtgXy465G4SC7un48skZxtJsYWckc7jCGLQ16UCCMF5Ta9QsmlESkt8Q3Qp3dCr7TfoV4guWqkD9K/6wg/xNZmDrqcyxdLd3FCxMcAuoGZmv/dSXykrq650vruxkEtp5wh4w0c8LvvF/pYPWUsOBj7U2x65xq0SnZtgHkqvBC+6EyrA6JBq+UP9qofb1ZtBX/qnpzFsgWqjvJg0LOV9B8hOoL5sZrBEO4UlM2NGy6OpP9VXVC5i9m0Ww61Jh8SdnsyLeZZ4C5qPRtFsrEau7mFBCrR9IVGJc3oEe7EZnRV4nqrxtEAaG6iaxISNNk4t0sNa8od1Mw/FK4epaT6uM02fZgPC0mlE/UAj2tqw3CmLB19xodL3ri1lqGQrbjvYL11z/w5eP2Bp0+dB1NYsGjAldIBmhCxyC7pMxAsv2M5je7cxSblqb3KBfkhbJVeSgzYkIvVZwCy8p7EKev7t7i0wieVouPDdj8MriMamxiIEac0TTFwpcWVqe04TC7WlNEVDiJG3UolyGRwlyq94eocV95+BVXalhDQHX+BoSlPr+JplqySl7klZYCaHkk3yBEnqvOiJwSwg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(39860400002)(396003)(136003)(376002)(451199021)(316002)(8936002)(83380400001)(8676002)(54906003)(38100700002)(41300700001)(66556008)(4326008)(6916009)(66946007)(66476007)(36756003)(966005)(26005)(186003)(6512007)(7416002)(86362001)(6486002)(31696002)(5660300002)(478600001)(6506007)(2906002)(53546011)(31686004)(2616005)(6666004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NzZ5eStGQlVXU2hLdnFtOHdmL3JtKzE3RklMZmVQRFoyNk9pcGxuVDNybTRo?=
 =?utf-8?B?WTl3eDUrS2pwUkFFQ3BHV3ZvbzYvbmRKRnVwV2w4VGJTVlVmYmlDcWFpOXlx?=
 =?utf-8?B?Ykc3bWdMMmFWOCtLeUxESUdHbVI3bUJ4NGpKUG9Va3dBSlhlcW1Fbkw5NVNJ?=
 =?utf-8?B?QVdsY0xFUDh5TGNocFVUTHhGOHZPUkN6YzFpZFFhWmdBdjV6c1hNNitiNDE5?=
 =?utf-8?B?eHNKNGZPVXkvRUZDT2VQTHdiVGpnUGhUSlpWZUhzWDlObFkzdlV5ZllxaE8z?=
 =?utf-8?B?QkNQTUZlNkFvczFITjBWdU1BTTdUT1V2RTRsSWdVVXlRa09QbVNCY2JjVkhy?=
 =?utf-8?B?WjNwS2hkN1Q5R09tZi83ZzBtTGRTcGdaNmFFS1RHSm1hVWlkQXVjY3hMYW9k?=
 =?utf-8?B?V1dKUm9vQzg5K2NSQlRqd2lHblJuL2ZuWTlSRlVjZHlKMURMMUEzcEZDNE1H?=
 =?utf-8?B?MlVHMFRDdEZob2dLdHRBaGduQnBoQ3Qrbi8xT29PM0Nrb254Ri94RWJRYXNw?=
 =?utf-8?B?L0hmR3M4bXE4ajlvUG05NXRsbXVMN2RDMTJUZVZVOUhQdU8ySzlkRUMxUW5M?=
 =?utf-8?B?WUQ1UndDMmx6ek1PM2R4OW9ITHVKekhqb3U5UTMveWxtcCsyb3BycUcrcmRm?=
 =?utf-8?B?anVQajVlL1NrV1JjSERGcllUQ3lhR3YwTktrekhSTkhpUWpJTmkya0xNcEpF?=
 =?utf-8?B?UDE3TUp2dUlSc29LQ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hZU1diQm9DbzFBNFYzT3Z5?=
 =?utf-8?B?d1RrN3JseUxMellHQllEYXFac2xhbEdxSGQyZ2gzU0lOWlRDMG82dng2UjVz?=
 =?utf-8?B?V3htTzNUeVpiWmxTblNZT3pKVmI3bWdwbkw5NFd0aWJMc3dUODIyU21GcXp1?=
 =?utf-8?B?Qi9Sbms2VEZVV0p1ZnhqWTIyS3FGZEJ3MG9qUE9mWjlIRnFodEJnSVhtRlNF?=
 =?utf-8?B?NHBTR1BSNmlEVjRRWDVHUzdzNEhFMFRNc1FtTm4yOVFPRGlSOXlIcTViUW5U?=
 =?utf-8?B?SXpheC90eVllRk9oYlZkM0pvTXdaMFIzYklwTVdqQXRvWUVlWStyMFJ1OS8x?=
 =?utf-8?B?ZXQxSjBFUG5OQ3V6ZE4rSG1kVWNpQTB3eHdhQzA0SE00T1VZbXNTRXVidjRU?=
 =?utf-8?B?RnJkb1NaVk1TMkY4ZHNWTlJmKzNoSkdWQzdLQmNoR0c1NjliSzduUTZvKzdk?=
 =?utf-8?B?TmhycjA3UVUrM20zOFlhU2FGUjBoanhrYVlUVTB5Y1JyR0xSNEZaam1ZMHd2?=
 =?utf-8?Q?OYW2wSX8kNg64uZeDFxW0IxCI?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0d5e8731-c181-4e5a-40dd-08db7c9c59bd
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:38:36.6149
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: bmiH54OYEezYoKJTu5JCUKL8whwsZNC0BeC52dCwZ+yk3U4mwFAZSD/N34+CzIhcidMs5f12JiDvrJwFd5py4g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8136

On 28.06.2023 16:54, Andrew Cooper wrote:
> Xen uses the stdint types.  Rearrange the types headers to define the
> compatibility __{u,s}$N types in terms of the stdint types, not the other way
> around.
> 
> All supported compilers on architectures other than x86 support the stdint
> __*_TYPE__ macros.  Move these into a new xen/stdint.h to avoid them being
> duplicated in each architecture.  For the very old x86 compilers, synthesize
> suitable types using GCC internals.
> 
> This cleanup has the side effect of removing all use of the undocumented
> __signed__ GCC keyword.  This is a vestigial remnant of `gcc -traditional`
> mode for dialetcs of C prior to the introduction of the signed keyword.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
with one further remark:

> --- /dev/null
> +++ b/xen/include/xen/stdint.h
> @@ -0,0 +1,33 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +#ifndef __XEN_STDINT_H__
> +#define __XEN_STDINT_H__
> +
> +#ifndef __INT8_TYPE__ /* GCC <= 4.4 */
> +
> +/*
> + * Define the types using GCC internal notation.  Clang understands this too.
> + * https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html
> + */
> +typedef   signed __attribute__((__mode__(QI)))     int8_t;
> +typedef unsigned __attribute__((__mode__(QI)))    uint8_t;
> +typedef   signed __attribute__((__mode__(HI)))    int16_t;
> +typedef unsigned __attribute__((__mode__(HI)))   uint16_t;
> +typedef   signed __attribute__((__mode__(SI)))    int32_t;
> +typedef unsigned __attribute__((__mode__(SI)))   uint32_t;
> +typedef   signed __attribute__((__mode__(DI)))    int64_t;
> +typedef unsigned __attribute__((__mode__(DI)))   uint64_t;

Much like you avoid "mode" potentially being the name of a visible macro,
the mode identifiers themselves could in principle be, too. Being upper
case names, perhaps there the risk is even slightly higher. Hence I'd
prefer if you/we could use __QI__ and alike.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:39:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:39:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558431.872523 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhBf-0006SP-Ky; Tue, 04 Jul 2023 14:39:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558431.872523; Tue, 04 Jul 2023 14:39:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhBf-0006SI-IQ; Tue, 04 Jul 2023 14:39:27 +0000
Received: by outflank-mailman (input) for mailman id 558431;
 Tue, 04 Jul 2023 14:39:26 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGhBe-0006S0-6y; Tue, 04 Jul 2023 14:39:26 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGhBe-0001pS-0r; Tue, 04 Jul 2023 14:39:26 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGhBd-00036p-IY; Tue, 04 Jul 2023 14:39:25 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qGhBd-0007xe-Hg; Tue, 04 Jul 2023 14:39:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=jVv2++cePzNrhDTGex7YR+p5YW53+51H0vUOpRhgdOI=; b=r8F1qNt9O2jQRNp248e59fd87B
	tNkM2luM8UZVXrcD/rc43ZWED6HO185MAkYvCsE1APuwQP/8D2S187njqJXJflCy1sEdst2Xrfxc6
	4WZVoYCH416JCLxiyryWzuqET1zzXGPVkmb6RG7zZ3llwGgyLrUTQ9Z1F9zbkSU1jgnI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181690-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181690: regressions - trouble: broken/fail/pass
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-vhd:<job status>:broken:regression
    linux-linus:test-amd64-amd64-xl-vhd:host-install(5):broken:regression
    linux-linus:test-amd64-amd64-pygrub:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:debian-fixup:fail:regression
    linux-linus:test-amd64-amd64-libvirt:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:leak-check/basis/dst_host(19):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:xen-boot:fail:allowable
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=24be4d0b46bb0c3c1dc7bacd30957d6144a70dfc
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 04 Jul 2023 14:39:25 +0000

flight 181690 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181690/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-vhd         <job status>                 broken
 test-amd64-amd64-xl-vhd       5 host-install(5)        broken REGR. vs. 180278
 test-amd64-amd64-pygrub       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2  8 xen-boot               fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl          11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu 13 debian-fixup            fail REGR. vs. 180278
 test-amd64-amd64-libvirt     12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 19 leak-check/basis/dst_host(19) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds      8 xen-boot                 fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                24be4d0b46bb0c3c1dc7bacd30957d6144a70dfc
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   78 days
Failing since        180281  2023-04-17 06:24:36 Z   78 days  153 attempts
Testing same since   181690  2023-07-04 03:09:39 Z    0 days    1 attempts

------------------------------------------------------------
3652 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      broken  
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-amd64-amd64-xl-vhd broken
broken-step test-amd64-amd64-xl-vhd host-install(5)

Not pushing.

(No revision log; it would be 596361 lines long.)


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:49:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:49:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558439.872533 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhKf-00084z-M9; Tue, 04 Jul 2023 14:48:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558439.872533; Tue, 04 Jul 2023 14:48:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhKf-00084s-JU; Tue, 04 Jul 2023 14:48:45 +0000
Received: by outflank-mailman (input) for mailman id 558439;
 Tue, 04 Jul 2023 14:48:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kGqQ=CW=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qGhKe-00084m-Nc
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:48:44 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on20610.outbound.protection.outlook.com
 [2a01:111:f400:fe12::610])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dee2ea4e-1a79-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 16:48:43 +0200 (CEST)
Received: from DBBPR09CA0004.eurprd09.prod.outlook.com (2603:10a6:10:c0::16)
 by GV2PR08MB9302.eurprd08.prod.outlook.com (2603:10a6:150:d4::10) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:48:37 +0000
Received: from DBAEUR03FT024.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:c0:cafe::89) by DBBPR09CA0004.outlook.office365.com
 (2603:10a6:10:c0::16) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.31 via Frontend
 Transport; Tue, 4 Jul 2023 14:48:37 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT024.mail.protection.outlook.com (100.127.142.163) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.18 via Frontend Transport; Tue, 4 Jul 2023 14:48:37 +0000
Received: ("Tessian outbound c08fa2e31830:v142");
 Tue, 04 Jul 2023 14:48:37 +0000
Received: from fbc562dba8b9.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 8CBB86CB-9F31-4BCB-A7C1-1E8A27324675.1; 
 Tue, 04 Jul 2023 14:48:30 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id fbc562dba8b9.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 04 Jul 2023 14:48:30 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by AS2PR08MB10155.eurprd08.prod.outlook.com (2603:10a6:20b:62d::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:48:29 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:48:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dee2ea4e-1a79-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yLnOFhqSItkLt5xxwjGEwhD+ES50PHx4ePZo0o7xazo=;
 b=otqziaZeKDKuijmbzvL0ueVzCYh3SPLWqfHg7N5rDlK+oglkXcPzojr09wfGV2HV0AnIY3ZVP/WCqe4KmT+XQhjuWrVsYfNqLZPm+igK5ZPCP8deQe8dK/66LbPQL62LnhjaTn/1T/r6c36mNMJQutAaxlvBXYsxTErTyRDm4XA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 06850714c190bafc
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ahAEHsXj0wZ2ShNu2SvMcoaTb9+edd2GpMVjn7NtdHmPmzHqD8oNMzA0s38MLXaCTxKPZmUNPZvoVNES9FN9fiYP1JOfV+r5KAozLnkPr8fJ36qaoNlb2NQqQI4COUU8anMr1HcYn/i6tsmELaG1z+gpB2ptujQ1CZHB27VNKG8yICLzOq8nBac0d4rhjE27ea6zmJhY0M7tOWfNs6/7e8ILvKXa8wKQc5gBTbSwRUW9XDzlO+auYMTAQC4BJkFizIUvo0CfYuZ6muQeId7DqFo5GrKN6WwuZ1mPkMiS3zMibDROePeySWjID/aCYn4K5fXkwBnc+mexy4U1m4QbEA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yLnOFhqSItkLt5xxwjGEwhD+ES50PHx4ePZo0o7xazo=;
 b=fuc5xgZQMjkwiB6rEakDKUDPxW5XB8Sz9Y5zXJZ7HR5i4Akr36D8O1/GTJqEh14DRyNL+E4t0jXpnoIGS1LvJoN+PHJdEjD4K/zJ3N+1GM+pYa8rrcJF2anuCcp7pbCjOmDLr/LJH0qLzfaNn7sEdD4eqHssX++H8zham/yKrn6OtoO8IVeU2PsQJ/sP3Cz1PU3YhVWRLOmTFYpyfFZkJLZw97H0okDm+ZDR3G5yf+NpeOi9jYaihCth+e1FgyuBMeKYb7wpovOpqBKDW/a8cUFAzF/Xx2Uki4ZpewLuJ8Pq+UBoGNsOcIxmO/6pxCuC+eBbZ/9/HYAep7BPaUGmdA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yLnOFhqSItkLt5xxwjGEwhD+ES50PHx4ePZo0o7xazo=;
 b=otqziaZeKDKuijmbzvL0ueVzCYh3SPLWqfHg7N5rDlK+oglkXcPzojr09wfGV2HV0AnIY3ZVP/WCqe4KmT+XQhjuWrVsYfNqLZPm+igK5ZPCP8deQe8dK/66LbPQL62LnhjaTn/1T/r6c36mNMJQutAaxlvBXYsxTErTyRDm4XA=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Luca Fancellu
	<Luca.Fancellu@arm.com>, "michal.orzel@amd.com" <michal.orzel@amd.com>, Henry
 Wang <Henry.Wang@arm.com>, Julien Grall <jgrall@amazon.com>, Stefano
 Stabellini <sstabellini@kernel.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH 3/7] xen/arm64: head: Add missing isb in setup_fixmap()
Thread-Topic: [PATCH 3/7] xen/arm64: head: Add missing isb in setup_fixmap()
Thread-Index: AQHZos+3AfbUxPj7/Uqgb3LGizDPV6+px4QA
Date: Tue, 4 Jul 2023 14:48:28 +0000
Message-ID: <BB7C8967-765A-4FAB-BFA1-D6DE5CA0CA85@arm.com>
References: <20230619170115.81398-1-julien@xen.org>
 <20230619170115.81398-4-julien@xen.org>
In-Reply-To: <20230619170115.81398-4-julien@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|AS2PR08MB10155:EE_|DBAEUR03FT024:EE_|GV2PR08MB9302:EE_
X-MS-Office365-Filtering-Correlation-Id: 8e5b482b-4b62-4c63-c118-08db7c9dbfc5
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 qSEa4yZ58G/OCH1UOxrg9fbKIVOGAteSjOYd8wUd3QstLXtKbuZonpVS4mCxA/85uFokkdv3b/V6Uu7hAKtpX+nT7CSnS8hWLT9yrqxntltjUtivsZ1UGeuXDejIsY5Ifr2p1aByhfzttVrkFVcLHzRcHlNUo3/88iVpvdJYs3TlB1epddVisBa6ICb89+UZQQ8d5BsvN/nRJehhZEuMHn7rTqGTj0LBOQ+ynb4GJRblSJwnzmQPqnq31Yxasru/NkpA9xoqcnW6b4UqRK+30KnShJOSuq1/jv9mDJqxSY5kPrVbAPlDJM04nScnFStAOgNh7Q64Q/0jqNc7BS+aK1bq6mGJ1rL1xHOwdLMo7GJZUuCg9A960EFNv8yfyFDiN/Vn4Mcc68195yNxFq/9nHQf55JZmoE6e/9w3UhLYnAZMW5vjp1dKuvhSKO8qIvBG2V2gRit56qwZ4eWsifqb8/Y3lTpaako6CbWN2Rvp62D6fjRzSK1im0ID5fr12VTkvAAnZXVjehe/OanijC/W1gxmjzoN4g/52HvClccNoYqYrrPXERfjXmuH+kSwixaAHGR3YDRLaYtZOAPWzGF764P17cAa1msCp1rA+6XQd4PszIxbZwZi9D5MhYAZgg+mw3QfmEvF/vVtbevWci7Ow==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(136003)(396003)(346002)(39860400002)(451199021)(186003)(478600001)(6512007)(53546011)(6506007)(38100700002)(86362001)(71200400001)(2616005)(91956017)(6916009)(54906003)(4326008)(66446008)(76116006)(66476007)(64756008)(66946007)(66556008)(83380400001)(316002)(122000001)(6486002)(5660300002)(41300700001)(38070700005)(2906002)(36756003)(8936002)(33656002)(8676002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <06A96F0C47109640A34971FAE6F24ADB@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10155
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT024.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	a1f1fbdb-4ddd-4059-3d8f-08db7c9dbac1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	R0UvdW56YYpz/kSOBwJNMy1WQLOlKzSQf5wj9oAWHR5mSvqo7y/29PWHFAUWkAvuTmahC9VCFywfKZ3X1K/dy+zuxIlPCSobM2VAb4/mnEIAhPR4JV1HtuEGdFEslD8BfyF1Dg2jKDO37LxGD88N3JzOs5Uc6shzBc+E72e1Q6epsRBbfadoc5vJrNxjue6EAApUaV3IXZQMmf/r4THBJTEIkYfT19DgushVoTTkG1qz7ZoHxF0Qd7+8ow+vaBv31L5xxJ8bzxrLoTiB+fkFkM8uEz6y/RQw66FkUtOd9kMiiB678YLn2FRy8nncNp/7niu3bMFYuXefSAsg/tMAUGpbdjWDsVQSjDumR0XbiKa5GudJZpXi9990wnTvzyZLbzcVYiZzwnhVWwaApkeFrtQxjylEckZ0AuVly/mMAv9TDwg4UmygJAXk+tWwabJlCoCDDcVmd3p1gA/AAmKB//a09jR5ViYDyU4ZouAIlI4CFtZsXR8RgBgZy8rVia6RDlDvNxoA/tH0MDJ40qu/gbOjXmNeL1xpQKpLj7Cv4/Q89YFL4Db597JJfhfQTfDW58tVaQKVYj8jJJnWypOUflVcsJZ7rB70Jjx1JsSy4UzoH3WM7y7bHs8VNPPwVms8XN3x7XODAwOb4O92Tt8Iy6I1PWnWnnS7d9HiRGoqTr9X2Sk1tjt3xCoRW00G4QdK3Mq+EAlqCuaHX/yWNvjx8ocT/p23ODkG7kfNcrnhMVRNvpmr6IRw5r7GFtmvxWHV
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(346002)(396003)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(107886003)(26005)(478600001)(6506007)(82740400003)(6512007)(86362001)(2616005)(186003)(53546011)(81166007)(54906003)(4326008)(70586007)(36860700001)(83380400001)(356005)(336012)(6486002)(316002)(70206006)(47076005)(8676002)(8936002)(6862004)(40460700003)(41300700001)(2906002)(40480700001)(5660300002)(33656002)(82310400005)(36756003);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:48:37.2175
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 8e5b482b-4b62-4c63-c118-08db7c9dbfc5
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT024.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB9302

Hi Julien,

> On 19 Jun 2023, at 19:01, Julien Grall <julien@xen.org> wrote:
>=20
> From: Julien Grall <jgrall@amazon.com>
>=20
> On older version of the Arm Arm (ARM DDI 0487E.a, B2-125) there were
> the following paragraph:
>=20
> "DMB and DSB instructions affect reads and writes to the memory system
> generated by Load/Store instructions and data or unified cache
> maintenance instructions being executed by the PE. Instruction fetches
> or accesses caused by a hardware translation table access are not
> explicit accesses."
>=20
> Newer revision (e.g. ARM DDI 0487J.a) doesn't have the second sentence
> (it might be somewhere else in the Arm Arm). But the interpretation is
> not much different.
>=20
> In setup_fixmap(), we write the fixmap area and may be used soon after,
> for instance, to write to the UART. IOW, there could be hardware
> translation table access. So we need to ensure the 'dsb' has completed
> before continuing. Therefore add an 'isb'.
>=20
> Fixes: 2b11c3646105 ("xen/arm64: head: Remove 1:1 mapping as soon as it i=
s not used")
> Signed-off-by: Julien Grall <jgrall@amazon.com>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> xen/arch/arm/arm64/head.S | 5 +++++
> 1 file changed, 5 insertions(+)
>=20
> diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
> index f37133cf7ccd..4ea64e70997b 100644
> --- a/xen/arch/arm/arm64/head.S
> +++ b/xen/arch/arm/arm64/head.S
> @@ -769,6 +769,11 @@ setup_fixmap:
>         create_table_entry boot_second, xen_fixmap, x0, 2, x1, x2, x3
>         /* Ensure any page table updates made above have occurred. */
>         dsb   nshst
> +        /*
> +         * The fixmap area will be used soon after. So ensure no hardwar=
e
> +         * translation happens before the dsb completes.
> +         */
> +        isb
>=20
>         ret
> ENDPROC(setup_fixmap)
> --=20
> 2.40.1
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:49:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:49:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558442.872544 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhLJ-00007m-VU; Tue, 04 Jul 2023 14:49:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558442.872544; Tue, 04 Jul 2023 14:49:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhLJ-00007f-SK; Tue, 04 Jul 2023 14:49:25 +0000
Received: by outflank-mailman (input) for mailman id 558442;
 Tue, 04 Jul 2023 14:49:25 +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
 <SRS0=bK4X=CW=citrix.com=prvs=5424eaebb=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qGhLJ-0008VY-41
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:49:25 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f57acfe9-1a79-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 16:49:22 +0200 (CEST)
Received: from mail-co1nam11lp2169.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.169])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 04 Jul 2023 10:49:16 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by BLAPR03MB5442.namprd03.prod.outlook.com (2603:10b6:208:291::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:49:13 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902%7]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:49:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f57acfe9-1a79-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688482162;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=GoQLM3ePx+7KPZBJVGBcUQYU/brh23m+rtZYoh7Wv9Q=;
  b=ZsXJNCXanrIXZX8xmfRLu343v90P9gUYzi1G5eaQjaPcCnBxnl3NqgR+
   xbilnQSqTO6QkpXNNyMn/G0eAMXxLB4DYL+2AVs2w+Sk+/9UReIM6qMOz
   CDnsvVxsbK3NmTzGNSonZl+9zkb0NDBW6YuU2Ob/3iH8mMyOHpDIPLhek
   w=;
X-IronPort-RemoteIP: 104.47.56.169
X-IronPort-MID: 117690903
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:IS6XAakZPWgM1nE/fIl/0pvo5gw8J0RdPkR7XQ2eYbSJt1+Wr1Gzt
 xIfC2COPPrYMGDyeItyYYTn/BsP78TdnN83HQE++HszFCMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5AOGzBH5MbpETU2PByqgKmVrNrbSq
 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/
 f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3
 cwYdj81TwGju8mZh7+WSNJImsI9COC+aevzulk4pd3YJdAPZMmaBo7tvJpf1jp2gd1SF/HDY
 cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVkVI3iea8WDbWUoXiqcF9hEGXq
 3iA523kKhobKMae2XyO9XfEaurnxHqkBtNKReXjnhJsqB6i7DMCK0QdbH+QhaGkk1+xfPR+C
 VNBr0LCqoB3riRHVOLVWhSipXeesx00WtxOEvY74gWA1qrV5QmCAmEOCDVGbbQOtsAsQicx/
 kSUhN6vDjtq2JWOUm6U/LqQqTK0OAAWIHUEaCtCShEKi/HEpIwwlRvJQsxULL+ujtb1FDfzx
 BiHtCE7wb4UiKYjz6in5xbfiiyou7DSUxU4oA7QWwqN/g5/IYKoeYGswVza9upbapaUSEGbu
 3oJkNTY6/oBZbmJlSqQUKAOEauv6vKtLjLRmxhsEoMn+jDr/GSsFahO4TJkLUIvPc8eeSDgZ
 GfavA8X75hWVEZGdodyaoO1Ts8tlK7pEI28UuiON4QfJJ9saAWA4SdiI1aK2Hzgm1Qtlqd5P
 oqHdcGrDjARDqEPICeKetrxGIQDnkgWrV4/j7ihp/h7+dJyvEKodIo=
IronPort-HdrOrdr: A9a23:kLd+o6iHlir4lMlBqYnMvVTwOXBQXhsji2hC6mlwRA09TyVXrb
 HVoB17726ItN91Yh4dcL+7Sc+9qB/nhPlICMwqTNOftUrdyRqVxeJZnOnfKl/balTDH7VmpN
 ldmsFFYbWaZzUXsS+52njcLz9K+qj+zEnHv5ak856vd2BXgmNbgTuRxjz6LmRGAC1PBZ84E5
 TZw8pculObCAQqhw2Adxo4tvD41qL2fYzdEGI7OyI=
X-Talos-CUID: 9a23:ZdfZlG3eVEyBItfuCrZpALxfKsB7fUX83VfsCGD/BEtrc5mJT0G00fYx
X-Talos-MUID: =?us-ascii?q?9a23=3ArPpL2A5EN1ix0xF8xpudeZxIxowr0o7xGWNUmqw?=
 =?us-ascii?q?ikO3cKDVhNBC7rRaoF9o=3D?=
X-IronPort-AV: E=Sophos;i="6.01,181,1684814400"; 
   d="scan'208";a="117690903"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=SfU9qXoZ1t2w1SiIiIaERUNHq5a4Oo/ukxRCKVBz41hTPPeZ9PUUJroeiV//KstA2A2o0HkJI0qUJmEqrCZmdg+sEmulVLkjghuGd+bJMhHjmmq1y0M3kGqvB8yNZjS8fE5tWjoDkuagzI+c+imHDwYOrjzFJgaNatp7UlXjtyMJhcKhIcoZQ1r0Dd3OcyhOseC4Val0wIciJOsW4nlZv6PBPmklWhTLMDU1FgpNazDuSGwCFsj2q2Z3gxH608MgWnpfPh0hgDXD2w2aJCW5XRzvXScAbE40s8/PbfYiShPKHK1qrlYsah4ZHQOjyTdtYwmQOW7pOIKvQsJ/ZfR7ww==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=1a3Wu7ZwpKUye8yTK3Oda4WTS140fzit/X7bwpStt90=;
 b=bTcGDdINW5wAC0QUYz/DEnP0G5pR+nM+ROx4N/SypXQKadnPt11gntNWTmzyGH9er3eNvX3XKFng0LSovuZK/adY4/s4ew2qf+ZnCoE5EWJ4V9oPTV9F38XcJ9XXZMIuUrN2lhjzVWrjss9i9A+fk/s5xNaVEYShFk5Bz2niKwj+rWfEhRa8ZgxXTmyGlMbpa8j73J4jUBXFGiv9kSoD/pkB8o+/TNBtKI7mkeg2SOweB1vO5YmvvGUJb1tvZcsPGygCvRSwwTOdlXTizNNsBBF7KdggmBhNloOhUchDChaLuTcjrS0y/s+HOSbdiDGlTD7ADvC7GkYFs4xKA/i+lg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=1a3Wu7ZwpKUye8yTK3Oda4WTS140fzit/X7bwpStt90=;
 b=eNLPQqjV8GSnI/RPruiQbP5kCS/brN1A7Vu03hvj+K+WqsF5440gozuyQ7dELifMY9kq5BqQ0/jkM1PRvu81DwkWcKhj2MJcDu7/TgvbUQpC+23gY1ohj1jMtyE+a9DJY6OYkhZffwLmV2uBGoc1LkgVKowNYCvJ0vh5PGzskUw=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Tue, 4 Jul 2023 16:49:09 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Cc: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
	Petr Pavlu <petr.pavlu@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	vikram.garhwal@amd.com
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
Message-ID: <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
 <b21398eb-2fb2-4fca-dd90-d2c81d8df1c4@epam.com>
 <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop>
 <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>
 <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com>
 <ZKQF8qq8Oh5E+Fxx@mail-itl>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <ZKQF8qq8Oh5E+Fxx@mail-itl>
X-ClientProxiedBy: LO4P265CA0032.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2ae::18) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|BLAPR03MB5442:EE_
X-MS-Office365-Filtering-Correlation-Id: 2319758f-86bd-4375-76c2-08db7c9dd558
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	l1T3d5TdZ1hP/eSJAJWBDKimtMUic5TzDT15/brgwHraVfYM+D3ZfJC8Eyj409+MQ0lexfbGimqH9om5Vog5Z8mYiiNNGQlnApHul7/itdZp/MzY1pgL0FhMovcj2XH7nDFbQVvh0fN+0ENeVg3afO6IgYOARqNybMLc+RbcjDzzwWT3j6/CF2N0HcNYTDGDTc+jiwqmUb4P9VRb0wyzkrWPEPvKr/iXuET69dIAp1GCip8Sfa9jJwt4zpYYAWs2wQoCjiyrgCq5GjpF5ThqjeM0xGuUWD9iFcRe/plegRqNo7u9BBv6hm6Ak/gr1hkiO2VwXew9arVVepQcb06CU03fyvIw067Wwn5vCbrUQtey1yoVENHry9j7KqrL8bxdBdjD+Xf6fBfs4NgK9FCVXw9hj1MFqdA9xHLAWcNelnTZva/YsoL1NacknCnynIvk1YFEM6Dh79dpRdSab4OJwYw6Agovcqd6j0cvIg5GJQP6vJ8PT8Swb0i6Ducr12l8mMd9sbiRN/Uh53w8UBWIww5j8R9nkU7OwyGoB0mF/xv6WMiT6hEd4cEEGF75naaO
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(376002)(39860400002)(136003)(396003)(346002)(451199021)(186003)(82960400001)(478600001)(6512007)(9686003)(26005)(6506007)(53546011)(86362001)(6666004)(38100700002)(6916009)(4326008)(316002)(66556008)(66946007)(66476007)(66574015)(54906003)(83380400001)(6486002)(5660300002)(41300700001)(2906002)(8676002)(8936002)(85182001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?akVqZjFIOXZyTW9iaWx1VWgyS2ZBQW1qTmE5Q0J0OUxtNExqbmN2UW1XRmtH?=
 =?utf-8?B?ZHNMaE1ReXU4aVpkeDB5QlNlWFAzRDU2dXBGZzIxU0JZa2l2TmpuVWJwSGRF?=
 =?utf-8?B?VXgzU2Vld2h2N3FCazlMTjBZYWNrclB6Q2JRR05idTU3SDhFWWhEWXdDelNk?=
 =?utf-8?B?NHNTWGZKT0tMUkNheGxzemZoNk5wWXU5bEg5ZkVENElSUHR1TERKb1ZkYVlx?=
 =?utf-8?B?cGtRU0x6bmNwaTVuYWtzdkFkMUlWTU42cnJFUitjcmM0MUxKclBZNWxmVlR2?=
 =?utf-8?B?K3lwQjkzTVVtbGxQZXVMSm92QnMyNFlOL2Z0SHJuUkNFeUlVRStSTUlZbm1v?=
 =?utf-8?B?dkhIRnpEOHh6b0VnMTA4cFJ5Z2JSQWh4TTZ1NTJPU0RQak9KNjhXa2NudDIv?=
 =?utf-8?B?Y0Z2dGhuT2RtdkFDSmM4YXpEbjFPaHNIWEIzNjN6aDhYQ0kzNWVaWmM3Zms4?=
 =?utf-8?B?MDlvOEtKY1d1OHZ0bXR2cW1ubFJZUmZEN0hxUGN1clg3Y2YyajBDcStIUW4y?=
 =?utf-8?B?L2pvK1hSVkFkQ0NTb25pMDdWaDFPZjdCd0hONXNLSWR1TU5BTy9laGNwTjRt?=
 =?utf-8?B?MUR6OVA1T2VVelVSMGErZ1laTy95dWptekhVSnZBN2IybGZDdmpjbmwybkZa?=
 =?utf-8?B?Tklyb3VJYStvZHlIcWl1RmtyVm8rN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ZkVXVWtXRmlweVBTRGtiOWlnN1E3YlNzV1Z2SWZmd0JR?=
 =?utf-8?B?eVN6TVVPSlhTRGRlaGlsSmYzTC9GeXpYcHF3K3JpY0hEd1RYT3FBL2hDdGtL?=
 =?utf-8?B?d0JDZ1FzMFRIYkRWVWdZcGdvTUtkMzFZb2RHZ0tDYTQ5azhOOEU0WTlKWnJ2?=
 =?utf-8?B?S2QvbHIvSk51VVhmOFg1aHREV1cycjZXWXd5bktySmVFRkJoaS8zY0dzd0RK?=
 =?utf-8?Q?E0ypvvWOLXGG0=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2319758f-86bd-4375-76c2-08db7c9dd558
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:49:13.6667
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: gWg7fDdByVOuDbp3hhj0/McEWYMLvZkju/Ti54ttU9y7JqR5iqPRmJ0fJ89+dihhYgjaqGOVVqr0kDV9LZy4Kg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR03MB5442

On Tue, Jul 04, 2023 at 01:43:46PM +0200, Marek Marczykowski-GÃ³recki wrote:
> Hi,
> 
> FWIW, I have ran into this issue some time ago too. I run Xen on top of
> KVM and then passthrough some of the virtio devices (network one
> specifically) into a (PV) guest. So, I hit both cases, the dom0 one and
> domU one. As a temporary workaround I needed to disable
> CONFIG_XEN_VIRTIO completely (just disabling
> CONFIG_XEN_VIRTIO_FORCE_GRANT was not enough to fix it).
> With that context in place, the actual response below.
> 
> On Tue, Jul 04, 2023 at 12:39:40PM +0200, Juergen Gross wrote:
> > On 04.07.23 09:48, Roger Pau MonnÃ© wrote:
> > > On Thu, Jun 29, 2023 at 03:44:04PM -0700, Stefano Stabellini wrote:
> > > > On Thu, 29 Jun 2023, Oleksandr Tyshchenko wrote:
> > > > > On 29.06.23 04:00, Stefano Stabellini wrote:
> > > > > > I think we need to add a second way? It could be anything that can help
> > > > > > us distinguish between a non-grants-capable virtio backend and a
> > > > > > grants-capable virtio backend, such as:
> > > > > > - a string on xenstore
> > > > > > - a xen param
> > > > > > - a special PCI configuration register value
> > > > > > - something in the ACPI tables
> > > > > > - the QEMU machine type
> > > > > 
> > > > > 
> > > > > Yes, I remember there was a discussion regarding that. The point is to
> > > > > choose a solution to be functional for both PV and HVM *and* to be able
> > > > > to support a hotplug. IIRC, the xenstore could be a possible candidate.
> > > > 
> > > > xenstore would be among the easiest to make work. The only downside is
> > > > the dependency on xenstore which otherwise virtio+grants doesn't have.
> > > 
> > > I would avoid introducing a dependency on xenstore, if nothing else we
> > > know it's a performance bottleneck.
> > > 
> > > We would also need to map the virtio device topology into xenstore, so
> > > that we can pass different options for each device.
> > 
> > This aspect (different options) is important. How do you want to pass virtio
> > device configuration parameters from dom0 to the virtio backend domain? You
> > probably need something like Xenstore (a virtio based alternative like virtiofs
> > would work, too) for that purpose.
> > 
> > Mapping the topology should be rather easy via the PCI-Id, e.g.:
> > 
> > /local/domain/42/device/virtio/0000:00:1c.0/backend
> 
> While I agree this would probably be the simplest to implement, I don't
> like introducing xenstore dependency into virtio frontend either.
> Toolstack -> backend communication is probably easier to solve, as it's
> much more flexible (could use qemu cmdline, QMP, other similar
> mechanisms for non-qemu backends etc).

I also think features should be exposed uniformly for devices, it's at
least weird to have certain features exposed in the PCI config space
while other features exposed in xenstore.

For virtio-mmio this might get a bit confusing, are we going to add
xenstore entries based on the position of the device config mmio
region?

I think on Arm PCI enumeration is not (usually?) done by the firmware,
at which point the SBDF expected by the tools/backend might be
different than the value assigned by the guest OS.

I think there are two slightly different issues, one is how to pass
information to virtio backends, I think doing this initially based on
xenstore is not that bad, because it's an internal detail of the
backend implementation. However passing information to virtio
frontends using xenstore is IMO a bad idea, there's already a way to
negotiate features between virtio frontends and backends, and Xen
should just expand and use that.


> > > > Vikram is working on virtio with grants support in QEMU as we speak.
> > > > Maybe we could find a way to add a flag in QEMU so that we can detect at
> > > > runtime if a given virtio device support grants or not.
> > > 
> > > Isn't there a way for the device to expose capabilities already?  For
> > > example how does a virtio-blk backend expose support for indirect
> > > descriptors?
> > 
> > Those capabilities are defined in the virtio spec [1]. Adding the backend
> > domid would be possible, but it probably wouldn't be that easy (requires
> > changing the virtio spec by either expanding an existing config area or by
> > adding a new one). I'm not sure handling in the specific frontends is
> > generic enough for being able to have a central place where the backend
> > domid could be retrieved, without requiring any change of the frontends.
> 
> IMHO the proper solution is to extend the spec. I don't have much
> experience with virtio code, but reading the spec it looks like new
> config area will be better for compatibility/uniform handling in a
> frontent-agnostic way. Since it will definitely take time, some
> transitional solution (maybe even xenstore...) might be warranted.

My fear is that such 'transitional' solutions end up being definitive
ones, as people move to other stuff once things work.  Might be better
to implement a transitional approach based on a future virtio
specification change rather than something out of band based on a
completely different communication channel.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:51:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:51:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558449.872554 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhNI-0001fj-Fy; Tue, 04 Jul 2023 14:51:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558449.872554; Tue, 04 Jul 2023 14:51:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhNI-0001fc-CG; Tue, 04 Jul 2023 14:51:28 +0000
Received: by outflank-mailman (input) for mailman id 558449;
 Tue, 04 Jul 2023 14:51:27 +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 <SRS0=D/z2=CW=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGhNH-0001fU-Fh
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:51:27 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0624.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::624])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3f4e0f88-1a7a-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 16:51:25 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS1PR04MB9480.eurprd04.prod.outlook.com (2603:10a6:20b:4d6::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:51:22 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:51:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3f4e0f88-1a7a-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Il4K1W5z5m2wnACDNvA8VtdnXBhb2E5LExQ4ULQ1Z4NNr8lPvmM+RzYum5eHhywN6uuOshNkwi4n1Lkd1f9mQmTsIzt3WvnkOPEl493NBaT+rjsXX4z94u9KNaWKKhTMiYLRDuIUG2PoPp6DpVNqUSw4Q3pD8QzzQ/NAfKHKbNk40TPO5WqA5ieo4y3I+MaI5CPxZkgSP3Sf2e926C1d/yF/SMOYrZa3ZGHqHvkLxrdqRj7SFEAMQuJ+Ox35fV2J++zCopoj/Ce5REhruH0E1Vbg4aDFj8J/jZybsFgXRlhJ2yUr3u5m69A8c/5F4b/pSJFrXmGhOURy54IOtcpPiQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=SswWW9gD5iARnNAjAfHOFpcjojY/wWZgVT6gCXPAXBY=;
 b=hwX1xQXMqNKM1MPjZYfpG7e8pfga5nw/HMBcirw696skvSvTs6/PjFmOcm51iSNWciFVV8ZDkpiPrUcYuMKwbovAcqgZSx7JoT+jTlfa67M6UoGYPVuoGK31DBVqV/XbweiPdMzTR4t6L1MEjcgSCnyo8tHL9wYpEakjo0jPjuORhVrODP1aEVfA4160cDoHdKqlSVtyDjOpy/uGJjsKhmJ3ZypRPs1UldfjS7xLIOjqbdHEi77xC8Kvo3M4GJHJhJoOZqHodf6Qe7PsqNfEyWWMLhPnuNNJPdvP8auVtDd0zEvAlEUwczT63ymeN5tfFag+atdTCuopniXef0RtQA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=SswWW9gD5iARnNAjAfHOFpcjojY/wWZgVT6gCXPAXBY=;
 b=hNekEtoIPvfgyCcAb0dNgVRXEVo9AWWaAtnBKQthNDY7QX5m8khqthNZCnVAAALzA6EERizwy1nChcWNNH1dblDd67PmvP56HgCalwzi0mnIsS8H+3q4fgRCIK0By90E0JtHFLA5W/Ohs+hMUAnVDWkG4++utT7xCuMrnFjkkSqdb0VQTrcGil9p9p9X2w3AB5ehkGqaLsUVP0hrHaHmtFSy0o/X2aV/sPQgWXB692ouiiQX/qlXI6WSOw4M8FlTl4ARb+oPUfsCHbEF/085EJ2Cr206aq7VTVKXeVGhHzrWRDUuIC/EsB2QnJ7vcGY7a+jNsL52QkUNih1H6WUyKg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <a16cdb60-1307-636e-1473-e5388e8f79d9@suse.com>
Date: Tue, 4 Jul 2023 16:51:28 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2] x86: make function declarations consistent with
 definitions
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Paul Durrant <paul@xen.org>,
 Tamas K Lengyel <tamas@tklengyel.com>,
 Alexandru Isaila <aisaila@bitdefender.com>,
 Petre Pircalabu <ppircalabu@bitdefender.com>,
 Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <1b2d5be30c0e4f335e59dce6e7c001cb0805d702.1688465215.git.federico.serafini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <1b2d5be30c0e4f335e59dce6e7c001cb0805d702.1688465215.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0205.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ad::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS1PR04MB9480:EE_
X-MS-Office365-Filtering-Correlation-Id: a29a7cc7-7a3a-43c7-81b1-08db7c9e222e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	HypP/JykcTBghYmpIjB2zjeZf/BnxwYTfjm+5qc3D9aJOcD8hdxGSkGMuIyPBpHreH1vQ7R5GF3Q+CzPVAHSzShR+6XwcbrnsXsCTl3UqM3b7ZFb4uoKiwDf7h9aeAYX/IE21k7kdsnjElN+t5Cr2xDfFLEzKiVVt7vCQ2A+dkptpsRhhiTfFh9e53MnlHEFaUqBTsApkDDA7L4wAjV5kkbdP4sohHtwxnjgjKPGP2qN8Bj3EGZt4oQiFLE5kdRNdxLg1ge3tCbPX4bj7ZWzWs0LrWoJFN6IZEFTsjgq00Xj5BzA98PJN+mLignuTmQI77/U9MQ52Leql2CBRwY/4ZWnHTICQXbdNEl30h2hkLXlsHULXxS1sG7CnSfHMuYMGnJ41fEUKxg+o1tTMoF5iF5ixJ8ilIhaEcLzW46WirsJOuJ9wNOKO9d+6zUGcNzvXx8RqX63jdz6zCgKt+Uk6Mx8NiAA0HIvTJdl16O0v6nUkyFe6M5JBvKsS1mZZk26rWtgbqgzwzhRG9DXURB7b3CulZ4EQwyVcmAFUXtC710woJ5TLn02PyispcwJJ6XCQ4h9Kj/yasKvZW+FffG+P78zZm+HpJ/XPhicADRPi2vbsyx0Mx69oBJTfRKahQcXQq48KsEy3aMV/Y+PiMylFw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(136003)(366004)(376002)(396003)(451199021)(2616005)(83380400001)(54906003)(86362001)(36756003)(31696002)(41300700001)(31686004)(8676002)(2906002)(8936002)(5660300002)(7416002)(316002)(66946007)(66556008)(66476007)(6916009)(6486002)(478600001)(38100700002)(4326008)(53546011)(6506007)(26005)(6512007)(186003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bXR4M1lXSXg5NlcxZUc5M2YwUDQzRVNBTTJmRUxzZVFKVk9McTM5d0s2WXcx?=
 =?utf-8?B?OHFmNFFvWVR4N0F1c3FCL3BkdURCci9lcEl4c05sTTFsVXFNWGJzbTE3OWpy?=
 =?utf-8?B?YUg0QXFpTVVqSGtDN0l1WkhKdEkvVmdWaTM0eUpXVVl4ditxN3B0anFzWkJo?=
 =?utf-8?B?Y3k4UGU2R2o2d1MxcVJ1cDU0MnVnV1ptR2w4ZzMzSkgrQXR2WHVzd2ZtaGNm?=
 =?utf-8?B?aGpqYVhrSWJlbHhOUG1jb0VlVXIwaGptNjN6anMxOUkvMzMxRlZ2NHgwNVoy?=
 =?utf-8?B?TW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TE0OGlNeFJ0VGtQ?=
 =?utf-8?B?cy82NnF1eEx3RmxqZGdCNE1aSGIvWWcvdjNxeDAyZ2NCbCt3V2ptUnZ5eER6?=
 =?utf-8?Q?pSVeUhIeewe03RCeBIiBX8JdR?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a29a7cc7-7a3a-43c7-81b1-08db7c9e222e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:51:22.4173
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Bz8JZ9cOOkG7yordjBc4/I1MyUbUKgtRjjaF83USXsUw6opzaHLAAm9YthLFafeerF4W35VLLTDcikWV6DRDww==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9480

On 04.07.2023 12:23, Federico Serafini wrote:
> Change mechanically the parameter names and types of function
> declarations to be consistent with the ones used in the corresponding
> definitions so as to fix violations of MISRA C:2012 Rule 8.3 ("All
> declarations of an object or function shall use the same names and type
> qualifiers") and MISRA C:2012 Rule 8.2 ("Function types shall be in
> prototype form with named parameters").
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

On top of my earlier remark (when this was part of a series):

> --- a/xen/arch/x86/cpu/mcheck/x86_mca.h
> +++ b/xen/arch/x86/cpu/mcheck/x86_mca.h
> @@ -113,7 +113,7 @@ static inline int mcabanks_test(int bit, struct mca_banks* banks)
>      return test_bit(bit, banks->bank_map);
>  }
>  
> -struct mca_banks *mcabanks_alloc(unsigned int nr);
> +struct mca_banks *mcabanks_alloc(unsigned int nr_mce_banks);

I'm not convinced here.

> --- a/xen/arch/x86/hvm/rtc.c
> +++ b/xen/arch/x86/hvm/rtc.c
> @@ -59,7 +59,7 @@ enum rtc_mode {
>  static void rtc_copy_date(RTCState *s);
>  static void rtc_set_time(RTCState *s);
>  static inline int from_bcd(RTCState *s, int a);
> -static inline int convert_hour(RTCState *s, int hour);
> +static inline int convert_hour(RTCState *s, int raw);

Nor here.

> --- a/xen/arch/x86/include/asm/guest_pt.h
> +++ b/xen/arch/x86/include/asm/guest_pt.h
> @@ -422,7 +422,7 @@ static inline unsigned int guest_walk_to_page_order(const walk_t *gw)
>  
>  bool
>  guest_walk_tables(const struct vcpu *v, struct p2m_domain *p2m,
> -                  unsigned long va, walk_t *gw, uint32_t pfec,
> +                  unsigned long va, walk_t *gw, uint32_t walk,
>                    gfn_t top_gfn, mfn_t top_mfn, void *top_map);

While the definition's use of "walk" makes clear why the variable is
named the way it is despite being used with PFEC_* constants, not
naming it "pfec" here will add confusion, as the connection to those
constants will be lost. One will then be forced to go look at the
definition, when looking at the declaration ought to be sufficient.

I'm not going to look further, but instead repeat my suggestion to
split this patch. Besides reducing the Cc list(s), that'll also
help getting in parts which are uncontroversial (like e.g. the
change to xen/arch/x86/hvm/vioapic.c).

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:52:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:52:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558454.872564 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhO7-0002DE-Of; Tue, 04 Jul 2023 14:52:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558454.872564; Tue, 04 Jul 2023 14:52:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhO7-0002D7-LY; Tue, 04 Jul 2023 14:52:19 +0000
Received: by outflank-mailman (input) for mailman id 558454;
 Tue, 04 Jul 2023 14:52:17 +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
 <SRS0=kGqQ=CW=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qGhO5-0001fU-PL
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:52:17 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on0600.outbound.protection.outlook.com
 [2a01:111:f400:fe02::600])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5dca2be9-1a7a-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 16:52:16 +0200 (CEST)
Received: from DB6PR0301CA0067.eurprd03.prod.outlook.com (2603:10a6:6:30::14)
 by AM8PR08MB6498.eurprd08.prod.outlook.com (2603:10a6:20b:364::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:52:14 +0000
Received: from DBAEUR03FT061.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:6:30:cafe::8c) by DB6PR0301CA0067.outlook.office365.com
 (2603:10a6:6:30::14) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.30 via Frontend
 Transport; Tue, 4 Jul 2023 14:52:14 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT061.mail.protection.outlook.com (100.127.143.28) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.17 via Frontend Transport; Tue, 4 Jul 2023 14:52:13 +0000
Received: ("Tessian outbound 546d04a74417:v142");
 Tue, 04 Jul 2023 14:52:13 +0000
Received: from f509a4f0b285.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 C6053224-CF54-4E13-8901-698587C4F315.1; 
 Tue, 04 Jul 2023 14:52:07 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f509a4f0b285.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 04 Jul 2023 14:52:07 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by AS2PR08MB10155.eurprd08.prod.outlook.com (2603:10a6:20b:62d::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:52:03 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:52:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5dca2be9-1a7a-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=8Mw5zgDD5rJ+Dxf4QZVM1g1KXBfXUpQaXzRUtGGCiUk=;
 b=mF+4OjHj4CwSwbUGPNAfmxNv8r8Bx4d8ZMqHuh6Yhj41nCH9N5Qroiws5ToJWoAEE78xfnS808hZ/jSamfeGiz29vOjuX2aYeJ+x8sbouD7btSZnbn3mmnMWtMX5SUrjgldqVJPcRbY0tErfilOPhWWrD6cPOvXvBWannUaEg6E=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 3cffa5dd4ad0ebea
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JSOe5x25NyjqX7tghhCkfatI1FdhS5X6vK3Pm+2Uet9zlaJHxXOx9V5OHu9KnTdMfPHunnb7HPtGcULbPbVri7CZOiXgz11jhQK9rxoPL0rCbUEYPZS+CZPRKDiNvZoIb6aXxCXSRnyh+RsyNQZ4Flh0+7ciBck5CZ6dXDyD2wA6Z4M2WhXh6RitQya1RVsMvwUFazL8mOtTpVCLIPB1zMPz1PFAK6cU8wLgIBBwTxYz+0Vi1IEnVyXJLwIs1mhx4E1eBP0puHaqMFTLuKjfQ7cbRA1Xywsk6s/GR7Qz/XawywTNndLCFVayPqi0sCZ4CsOvcGlUNluXNPbRgL2zdw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=8Mw5zgDD5rJ+Dxf4QZVM1g1KXBfXUpQaXzRUtGGCiUk=;
 b=bZFFZoXxOrFzEAeqKnD+cZ4/plULC2yADeYXgkdR0c4BEC55WR1NZh77UwtFfO9DSOvtvmuUgIbU/GGZABX2NnZUUFdpPOm2rz7IQgLPkFivRaz++Cuml03iCifFgosXIIBe1kzn3tqnc+pcQTw2negEFshK8K82lRlAtipAtFlFRnOu0pDDZcK9Xcltd6pxz6FrJAHtmmdo4A5yVlOZzGZ0gVsuXItCSvMac9yrNkSfZHB40tIFA9EAVu8419EbEjWHprELYyyvRfOxA8q99TEUxrOxsrfI2yI978WPaLUbn6ScQVC6CkQHCP8ilgXnryyGygbPS/9SSuLbHkq9Qw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=8Mw5zgDD5rJ+Dxf4QZVM1g1KXBfXUpQaXzRUtGGCiUk=;
 b=mF+4OjHj4CwSwbUGPNAfmxNv8r8Bx4d8ZMqHuh6Yhj41nCH9N5Qroiws5ToJWoAEE78xfnS808hZ/jSamfeGiz29vOjuX2aYeJ+x8sbouD7btSZnbn3mmnMWtMX5SUrjgldqVJPcRbY0tErfilOPhWWrD6cPOvXvBWannUaEg6E=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Luca Fancellu
	<Luca.Fancellu@arm.com>, "michal.orzel@amd.com" <michal.orzel@amd.com>, Henry
 Wang <Henry.Wang@arm.com>, Julien Grall <jgrall@amazon.com>, Stefano
 Stabellini <sstabellini@kernel.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH 2/7] xen/arm32: head: Add mising isb in
 switch_to_runtime_mapping()
Thread-Topic: [PATCH 2/7] xen/arm32: head: Add mising isb in
 switch_to_runtime_mapping()
Thread-Index: AQHZos+1DMO9eCrkWkO1W1uZVBjVB6+pyIMA
Date: Tue, 4 Jul 2023 14:52:03 +0000
Message-ID: <A3F57CB5-E79C-48AD-BB08-148F720C8B2D@arm.com>
References: <20230619170115.81398-1-julien@xen.org>
 <20230619170115.81398-3-julien@xen.org>
In-Reply-To: <20230619170115.81398-3-julien@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|AS2PR08MB10155:EE_|DBAEUR03FT061:EE_|AM8PR08MB6498:EE_
X-MS-Office365-Filtering-Correlation-Id: 14eb60a6-628b-4d75-26c2-08db7c9e40ef
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 MVhNHnaGpjG50AH0bU34qVBnLhtm6oJPKbbHmounJN0NXdyJv8zVFzRukBlzn8pv2dh0SUvaASsFqD2W4A6Rlwm6/FsDuKByLXEyufkm/RkGEWB0yHzBOlx49J9atzuSrBRjOD7crS2Hy6HsMSpVWZhQih7YAo5rF+8BHGtmQ6dsr3nOGejTd3BYFvZV8gS+/Jt81ACe1up0SHFg5Vk+9emB1BEJFV9R02JPETHvOtdZ/JYVPN9KuXGCQojyg5YZ7shGClNdiZ5cvS/vrNqHQLDncsqUC8vtb3K9PAYNVlBu8YJ8Pb0g+/w8motnlLL+MpuQqiDcIgiDT3s5XhSfhmIsJQ/oUCaQl5TmO0XLoQKHEE6LWQwtD70MyQB5JjB/q16suVWjFOD9wFig4ArtnSDcWNRfPsJ2fiAKvL+byD0d8wLRtBHHuPuyI5HKYc/Wy5Vw+p2MD5vO4VH7PCEt2MLl9X9VImOw0mOFnEGgE7OzNP20w6bg3NLe4nv5w4Cu7tkm0MToYJ2ejRYCEgcwGA5T2EtslXFE7dPccqIjy/+jwENBBl+R2YW2WDoSE2NwDyt3khi4V50I6MnB5dVXUyCX7h6vyFyYLz22oCthcFc/zDvR3KVvNB2sHfqjEgClxGufeCfnhoUgc1iw51Vp7Q==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(136003)(396003)(346002)(39860400002)(451199021)(186003)(478600001)(6512007)(53546011)(6506007)(38100700002)(86362001)(71200400001)(2616005)(91956017)(6916009)(54906003)(4326008)(66446008)(76116006)(66476007)(64756008)(66946007)(66556008)(83380400001)(316002)(122000001)(6486002)(5660300002)(41300700001)(38070700005)(2906002)(36756003)(8936002)(33656002)(8676002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <3F3EDBF9439185469C9B040B867E2B59@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10155
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT061.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	93d41ff5-83d4-43f1-9d64-08db7c9e3a8b
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	DwD8eB2t93uz3kmQ0od+sOM1Dqs70hCS62GqWDd5JKJInQ+jKhVjU01xwdwoSuthUzB6392arHawJvZheQ1THHcv+yXKbn1FHs4h/1AddsZRIrH5fUWeTzZ0rH8MJ+ydECQ6KT2YdooHqX0m6Pv/5hnMkPDNsdcCMDP1ABHso0XDZ9wIh1AMKD48hRlom5sSNHSHb24evcShlc2a4V4c0kXbEMqUN9Ez5C29KodTMTte41Meb4HAsrUMO/tTZchGVQ/5BhS1hp40+HxjrPZDX94L1c6g693hC+ICYvKk71sMnyihBHLhDZqGlGaj+Qm6eUqZcfU1Gjdow9Y3safJjRFSNlEa/upSNEbCtRgbphrUTdFD9at5oYgj/uX+hUavm8ZbaBnqQBf174LeqIgJFDPxM6RnTjCcRvt8ohIdaL00YRKY7263oNeAi38mRbbBJPqThyXIXi2B+JqDjCgkOJue+/SglCquYQ8HPJKaHYqQrrFYyacExlBNmoiUYT4UZ3qaZBGJe8yigBeOJel1sLh+9HaKL71m4ckxs7IBSoWwlyn6PSC+fA5T3Mi01ghvvP1B6w6G451IrLz+4XlEtbs3s4mId/ano6GBrwX9qeifpO5e1g7Dz3S9twnjM0RoVlj7zl9QQYjmPhawTaNnHdNlRhnUS7ggLecJMWqp1T8DDN04XFHSQvOjenff+YN1o/FuNRdEuA9woX6KQBlllKDvH499v0NqWyvxTDcTC+197get3kkauxpXpPgWim9D
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(396003)(376002)(39860400002)(451199021)(40470700004)(46966006)(36840700001)(40460700003)(2906002)(41300700001)(5660300002)(6862004)(8936002)(8676002)(82310400005)(33656002)(36756003)(40480700001)(86362001)(6512007)(6486002)(107886003)(478600001)(83380400001)(47076005)(36860700001)(336012)(186003)(53546011)(54906003)(2616005)(26005)(4326008)(82740400003)(70586007)(81166007)(356005)(6506007)(70206006)(316002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:52:13.8836
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 14eb60a6-628b-4d75-26c2-08db7c9e40ef
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT061.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6498

Hi Julien,

> On 19 Jun 2023, at 19:01, Julien Grall <julien@xen.org> wrote:
>=20
> From: Julien Grall <jgrall@amazon.com>
>=20
> Per the Arm Arm (ARM DDI 0406C.d A3.8.3):
>=20
> "The DMB and DSB memory barriers affect reads and writes to the memory
> system generated by load/store instructions and data or unified cache
> maintenance operations being executed by the processor. Instruction
> fetches or accesses caused by a hardware translation table access are
> not explicit accesses."
>=20
> The function switch_to_runtime_mapping() is responsible to map the
> Xen at its runtime address if we were using the temporary area before
> jumping returning using a runtime address. So we need to ensure the
> 'dsb' has completed before continuing. Therefore add an 'isb'.
>=20
> Fixes: fbd9b5fb4c26 ("xen/arm32: head: Remove restriction where to load X=
en")
> Signed-off-by: Julien Grall <jgrall@amazon.com>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> xen/arch/arm/arm32/head.S | 5 +++++
> 1 file changed, 5 insertions(+)
>=20
> diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
> index 6ca3329138e3..b942e7e54d08 100644
> --- a/xen/arch/arm/arm32/head.S
> +++ b/xen/arch/arm/arm32/head.S
> @@ -656,6 +656,11 @@ switch_to_runtime_mapping:
>=20
>         /* Ensure any page table updates are visible before continuing */
>         dsb   nsh
> +        /*
> +         * The function will return on the runtime mapping. So we want
> +         * to prevent instruction fetch before the dsb completes.
> +         */
> +        isb
>=20
> ready_to_switch:
>         mov   pc, lr
> --=20
> 2.40.1
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:53:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:53:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558458.872574 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhPD-0002mK-3k; Tue, 04 Jul 2023 14:53:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558458.872574; Tue, 04 Jul 2023 14:53:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhPD-0002mD-03; Tue, 04 Jul 2023 14:53:27 +0000
Received: by outflank-mailman (input) for mailman id 558458;
 Tue, 04 Jul 2023 14:53:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kGqQ=CW=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qGhPB-0002m3-LF
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:53:25 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on2060e.outbound.protection.outlook.com
 [2a01:111:f400:fe12::60e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 86cd72e6-1a7a-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 16:53:24 +0200 (CEST)
Received: from FR3P281CA0167.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a0::6) by
 PR3PR08MB5754.eurprd08.prod.outlook.com (2603:10a6:102:91::15) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6544.24; Tue, 4 Jul 2023 14:53:22 +0000
Received: from VI1EUR03FT016.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:d10:a0:cafe::1d) by FR3P281CA0167.outlook.office365.com
 (2603:10a6:d10:a0::6) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Tue, 4 Jul 2023 14:53:20 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 VI1EUR03FT016.mail.protection.outlook.com (100.127.144.158) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.18 via Frontend Transport; Tue, 4 Jul 2023 14:53:20 +0000
Received: ("Tessian outbound d6c4ee3ba1eb:v142");
 Tue, 04 Jul 2023 14:53:19 +0000
Received: from 9e57fe66d626.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 DFBF878B-4C3D-4B10-AB23-C6721D1F26B8.1; 
 Tue, 04 Jul 2023 14:53:08 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9e57fe66d626.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 04 Jul 2023 14:53:08 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by GV1PR08MB8452.eurprd08.prod.outlook.com (2603:10a6:150:84::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:53:04 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:53:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 86cd72e6-1a7a-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XkwcAseB8LlqXiCLqvgL6pdB6Q9BOj6gCp39v1t9gqU=;
 b=Lt0kzWLKdXwDzaaAgBFqKIkosO7FG9yQbj20UJk99OpTfyTsiRsaOim86P+llrD0c0kkgyCsYy053LpuD1NP37gWpiX/C0R0T/QA928I24G0Njhx28skbW0pryJETuU6+UolMRO4zYsNEWg13iYCefHvitGYY7Rf5E1ACnueiSI=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 989a7c2b5bfc43d2
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=WwmexbrW8eszM0U1dYuUntJJecs7QUXi92gf91XrzNMORoYxIgS2hPme4pk615XEapl5Ri8lZ7Dp20PfMd23FqvW/ljae8+RMnFYOsvJ8c9dh728gKjH6tYsszu0v2F1u3W+E9w4Ass8BUA/pwwkcyhdojfD8KbOy/k+0lXSVqC8KxlfS9Ki9QJUf04CQ+iJAbuujGdv5MwEmxOHMMUYdJ/8U932c4NpzYvyDMMSObDKx4Cfo7h/Bh4OJPIWxqQpGyOBYfyvvW0agohfYoG8e+3szLPPu+mJRE0ZITFHtk29W7na2lKG3+q19VVpecBo7MlneEq9G8a62zwDl0uq3g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=XkwcAseB8LlqXiCLqvgL6pdB6Q9BOj6gCp39v1t9gqU=;
 b=kUm3vtzVUNMXhF38uD99uR0hXk54yS6gQ0pGVtnU3DbnFGKnd/7HA2rJR1p7fawMfJSC63+NqMLZADKWAsuO4AuTuA/XZ0NsuwlZ68Wiw4/C2C8k0B6E5OyQHBBtYoK1X8CKGusTO+Smj5SHIOqDwRf9fohcpNVOx3r0nzJaDHa7VM5tjJWN56Q4IYIOv3Wma+9xD9pVekBra2wK13D6nHRfNHbBD2S++n4SsWyOdndZQcQ2OiUivSmEbv+kvCiP9eA7Raxbk8AcJ9Y0S/th17I/SoeYHDoIpge/PoYkPLmvLq0ZUu1XpR/7yWQt+NoM2fvqLEHWxaioU/43syaqdg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XkwcAseB8LlqXiCLqvgL6pdB6Q9BOj6gCp39v1t9gqU=;
 b=Lt0kzWLKdXwDzaaAgBFqKIkosO7FG9yQbj20UJk99OpTfyTsiRsaOim86P+llrD0c0kkgyCsYy053LpuD1NP37gWpiX/C0R0T/QA928I24G0Njhx28skbW0pryJETuU6+UolMRO4zYsNEWg13iYCefHvitGYY7Rf5E1ACnueiSI=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Luca Fancellu
	<Luca.Fancellu@arm.com>, "michal.orzel@amd.com" <michal.orzel@amd.com>, Henry
 Wang <Henry.Wang@arm.com>, Julien Grall <jgrall@amazon.com>, Stefano
 Stabellini <sstabellini@kernel.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH 1/7] xen/arm32: head: Add missing isb in setup_fixmap()
Thread-Topic: [PATCH 1/7] xen/arm32: head: Add missing isb in setup_fixmap()
Thread-Index: AQHZos+47vv7EKE9Uk66+3hYHIyzLa+pyM0A
Date: Tue, 4 Jul 2023 14:53:04 +0000
Message-ID: <821C567C-5A15-4FE0-BB7E-50F95A61EDAD@arm.com>
References: <20230619170115.81398-1-julien@xen.org>
 <20230619170115.81398-2-julien@xen.org>
In-Reply-To: <20230619170115.81398-2-julien@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|GV1PR08MB8452:EE_|VI1EUR03FT016:EE_|PR3PR08MB5754:EE_
X-MS-Office365-Filtering-Correlation-Id: d4e9183d-04da-4395-357f-08db7c9e687a
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 olPZkW0q9FZbL0V549kpI71l9uLiZDI9mmNMAXHLYUm9XP7/3coT1cRrSm3l2vcf2KJNq8iieypXalMTcrxy4eY2fYVEA+hzus/wZQyfuk2diKpmNzDSKAicnG5rlc0GDfPqPBYBO8glvVB0Ed0QmL386RGI3DRvvPgmpnPAfuTwCMvfw3BXXEOTTAIh7Lt/yrbgqcvO9aqpHC9WsEPDSgO7mJh4zx5C4peINtY+OfPPXRVBqu6vMiNc9X0pLxIqqflciPo07sRgMhJYGTkyhu1/x/HiG7APL0TSQKGypnuWs5HUnhp0Tn3L2n9Ew93Y2VD4B/CjBV7o93aX729onCwxap1I+jHJW9If1z91IgTBzO3v6Tqa1YDFcXc/QTJCrIlQ9eWcKx1/Q332rDpZj4TEWooZuSWi6EWu2dHQh4AcbdAgoVQHfsl05Q6U4iubPao0cUIWb8F7dL6F4Tsy4ADHSk6zSLSVjH5vNP2ZD7o63X/b+nikKVwhs9CL8AHGZ9mkQ6AlR9AUbEx8vwSspeNbXTjfpfk9fB39NacV/uv6vvBuv+1YdCdevoebbKlLQ+akAqtVkruQOlRC+7ae/9obj9TTOck0+OLkQ752DO2d//WUzfr1UE/a7Rc/5YNyaBof5TrSamNoVXGfDl2m9w==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(366004)(39860400002)(376002)(396003)(451199021)(4326008)(316002)(66946007)(64756008)(66556008)(86362001)(91956017)(186003)(6916009)(76116006)(66446008)(6512007)(66476007)(6506007)(53546011)(83380400001)(122000001)(2616005)(2906002)(6486002)(38100700002)(33656002)(71200400001)(5660300002)(478600001)(8676002)(54906003)(38070700005)(8936002)(41300700001)(36756003)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <7059F9B6D7D0CC4DA5789884CAE70013@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8452
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 VI1EUR03FT016.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	65febac4-2b6a-4291-6f23-08db7c9e5f46
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	npFEcwkgv42ZxZkUsh4ruU7eDkKc5t5Qk6Wjpx/pe5bLks8Lu+1Y+/KqHdui8YiSBmL9BvCLlItLM9mgJikakTaqfjABP4CAw2P3s+Sg/tK3qNQXFxxP7ZdLEbGM7mzWz0FVZMIgveGYpsKMBo2AA4nv+FLEGahM0ZlgZ+XWiwRI1fI9hpqvVb917V3aD626RJR8DfqD3qK9+Ob3UR5rJG0+GC0wV+yI2zQcJqYupJz7lR05G/nLtmm/lW2N8cwdvfsicabir7pVFEXZKADApJ9K42SzpQXsm7oESHqsLva8r8tvpB05fRtAzgAjz+wIsalhuA6KtDz1xTMzrsjOLiZKit9ofT9xbqjeB5NDKGkWQ+wY4KOe//nvY95AjuVRnufUC8WAo9RbuamRv1z3BMdcIR5sD3bAQ2BJexpqYZnyfKj2PI9xVkU3Ei1YQvVHiziTibKE9bTFZSMNELADAFDcdT8ot4c5b0rOa8i5h4bk9Kckq0kd8PvXHOXyxn7tIvspCcvKwxnDkqA7V8WngIlfs1TUxepHlq2kzsMQ6tgzPMwDaA977H0sPdv2YHusluPIeVxqo7QSO894fHyhqNwtW3F9FtSHQ1QI7sUcMhkIYNYouSt7wwiF6X0TChimeQmGaDrglm8ya/OFxxzLYLhv6H2kASKF+2UNHx2j8gV3NfIloEaY1tmvoLcXAGEM/tUy+Nzp5W1F2M3sO9pJF2VOMpBC5iQ8d2eOkXyR3IJLvgD2riHOfRo41e3D0+I+
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(376002)(346002)(396003)(451199021)(36840700001)(40470700004)(46966006)(8676002)(8936002)(54906003)(6862004)(478600001)(26005)(41300700001)(33656002)(36756003)(6486002)(2906002)(5660300002)(86362001)(316002)(40460700003)(70586007)(4326008)(70206006)(6512007)(53546011)(82740400003)(6506007)(356005)(40480700001)(81166007)(2616005)(186003)(83380400001)(336012)(82310400005)(107886003)(47076005)(36860700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:53:20.1480
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d4e9183d-04da-4395-357f-08db7c9e687a
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	VI1EUR03FT016.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5754

Hi Julien,

> On 19 Jun 2023, at 19:01, Julien Grall <julien@xen.org> wrote:
>=20
> From: Julien Grall <jgrall@amazon.com>
>=20
> Per the Arm Arm (ARM DDI 0406C.d A3.8.3):
>=20
> "The DMB and DSB memory barriers affect reads and writes to the memory
> system generated by load/store instructions and data or unified cache
> maintenance operations being executed by the processor. Instruction
> fetches or accesses caused by a hardware translation table access are
> not explicit accesses."
>=20
> In setup_fixmap(), we write the fixmap area and may be used soon after,
> for instance, to write to the UART. IOW, there could be hardware
> translation table access. So we need to ensure the 'dsb' has completed
> before continuing. Therefore add an 'isb'.
>=20
> Fixes: e79999e587d7 ("xen/arm32: head: Remove 1:1 mapping as soon as it i=
s not used")
> Signed-off-by: Julien Grall <jgrall@amazon.com>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> xen/arch/arm/arm32/head.S | 5 +++++
> 1 file changed, 5 insertions(+)
>=20
> diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
> index f9f7be9588b1..6ca3329138e3 100644
> --- a/xen/arch/arm/arm32/head.S
> +++ b/xen/arch/arm/arm32/head.S
> @@ -751,6 +751,11 @@ setup_fixmap:
>         create_table_entry boot_second, xen_fixmap, r0, 2
>         /* Ensure any page table updates made above have occurred. */
>         dsb   nshst
> +        /*
> +         * The fixmap area will be used soon after. So ensure no hardwar=
e
> +         * translation happens before the dsb completes.
> +         */
> +        isb
>=20
>         mov   pc, lr
> ENDPROC(setup_fixmap)
> --=20
> 2.40.1
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:54:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:54:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558464.872584 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhPo-0003MS-En; Tue, 04 Jul 2023 14:54:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558464.872584; Tue, 04 Jul 2023 14:54:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhPo-0003MJ-CJ; Tue, 04 Jul 2023 14:54:04 +0000
Received: by outflank-mailman (input) for mailman id 558464;
 Tue, 04 Jul 2023 14:54:03 +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
 <SRS0=KbHz=CW=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qGhPn-0003AZ-NQ
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:54:03 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9cc564cb-1a7a-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 16:54:01 +0200 (CEST)
Received: from [192.168.1.198] (unknown [151.37.153.202])
 by support.bugseng.com (Postfix) with ESMTPSA id 678D24EE0739;
 Tue,  4 Jul 2023 16:53:58 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9cc564cb-1a7a-11ee-8611-37d641c3527e
Message-ID: <d73da8f3-2a76-7c4d-dc7e-82a86bfec3ea@bugseng.com>
Date: Tue, 4 Jul 2023 16:53:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [XEN PATCH v6] xen/include: avoid using a compiler extension for
 BUILD_BUG_ON_ZERO
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 andrew.cooper3@citrix.com, roger.pau@citrix.com, bertrand.marquis@arm.com,
 julien@xen.org, George Dunlap <george.dunlap@citrix.com>,
 Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
References: <0b0d9a5614daac653b3bfbcfaa29a9b4c11286bb.1687793572.git.nicola.vetrini@bugseng.com>
 <df8a0c82-5f07-6a9b-e24d-7550387fca27@suse.com>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <df8a0c82-5f07-6a9b-e24d-7550387fca27@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 04/07/23 16:24, Jan Beulich wrote:
> On 26.06.2023 17:37, Nicola Vetrini wrote:
>> Redefine BUILD_BUG_ON_ZERO to avoid using a compiler extension
>> that gives an acceptable semantics to C99 undefined behavior 58
>> ("A structure or union is defined as containing no named members
>> (6.7.2.1)").
>>
>> The first definition includes an additional named field of type
>> char.
>>
>> The chosen ill-formed construct for the second definition is a struct
>> with a named bitfield of width 0 when the condition is true,
>> which prevents the UB without using the compiler extension while keeping
>> the semantic of the construct.
>>
>> The choice of the bitwise AND operation to bring the result to 0
>> when cond is false boils down to possibly better portability.
>>
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> 
> The code change looks okay to me now, but I'd like to double check
> towards the testing you did with this change: While it is clear that
> you will have checked that the tree builds with the adjustments, I
> expect that would have been with a compiler supporting _Static_assert.
> Did you also check with an older compiler, using the alternative
> implementation? Plus did you also check both constructs for actually
> triggering when the supplied condition turns out to be true?
> 
> Jan
> 

Besides using the build pipelines in gitlab, I checked just the macro on 
Compiler Explorer using gcc 4.4.7 and clang 16 
(https://godbolt.org/z/1d6vznxcW) and the construct is behaving as expected.

Regards,

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:55:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558470.872593 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhQv-0003y0-O7; Tue, 04 Jul 2023 14:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558470.872593; Tue, 04 Jul 2023 14:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhQv-0003xt-LW; Tue, 04 Jul 2023 14:55:13 +0000
Received: by outflank-mailman (input) for mailman id 558470;
 Tue, 04 Jul 2023 14:55:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kGqQ=CW=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qGhQu-0003xn-3E
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:55:12 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on061d.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::61d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c65b6626-1a7a-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 16:55:11 +0200 (CEST)
Received: from AM6P193CA0122.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:85::27)
 by AS8PR08MB8609.eurprd08.prod.outlook.com (2603:10a6:20b:565::12) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:55:06 +0000
Received: from AM7EUR03FT004.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:209:85:cafe::d5) by AM6P193CA0122.outlook.office365.com
 (2603:10a6:209:85::27) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.31 via Frontend
 Transport; Tue, 4 Jul 2023 14:55:06 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT004.mail.protection.outlook.com (100.127.140.210) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.22 via Frontend Transport; Tue, 4 Jul 2023 14:55:05 +0000
Received: ("Tessian outbound 52217515e112:v142");
 Tue, 04 Jul 2023 14:55:05 +0000
Received: from c0b47bfc8967.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 8AC3ED19-EBC6-420F-B2D8-DE639A925F2F.1; 
 Tue, 04 Jul 2023 14:54:59 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c0b47bfc8967.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 04 Jul 2023 14:54:59 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by GV1PR08MB8452.eurprd08.prod.outlook.com (2603:10a6:150:84::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:54:57 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:54:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c65b6626-1a7a-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=uHPLYVWf3D08zYkdIrDgBPEq07v8K351XpAC2djDhZI=;
 b=W5u+z2opk/RYO7357EUKwfyTA4TZ2aw0optdcLgbaWarInYm+ZPEfboQfPHeuG0j16v98rn7Sl7uVtpWefDgOrQgG9pEkFsyZGzMX4Iw3b+3Dg+vSTPhjzdzRGvRzYJ5EZqa95iKSfisWgIwlN/XJjwo4+ujopcLvuuHbVZ2tL8=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 49c299a67b90dc96
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BsdgMlRJ1B6LEewGfqLgbjXo9jwEEstaDw7DM+T9IrSo8YANPL6DaMp1ILLnmRrsDNaKhpqsK76Dv/eCdxtlaKBal5iFn7u6WeH9An5xNrcPKD51m7ShdF8OdkQ3eJ4IVJHmWDz/9RDVm8X/F/4riHoan4f9989vzSS4a9/4hm4eI9Nai6EGcBi+m7OKpYodjaXEdm4G3S+YXvAmBQZYPO3XA4kab0N9VynZd8id+G4hcNzLIlhcO73xQh/WoEn7Gca3i9s5p2re13SgGIjx6i87J94ehVK7FsAtW40LyAeRKupJ5aEDtC8vQxOE7sxQLFlIk7I6MMthku7brblU0w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=uHPLYVWf3D08zYkdIrDgBPEq07v8K351XpAC2djDhZI=;
 b=LhC+7YqZ4hBUZ3+cNI6BjaBEpigVbX8FPjup+MBy2H7BsCXmw0gaAEYzbAbnkPSXrOBPjk8bJhrdNMs7e9c1x+Bvs+u95xkg4wIdgkj1AzGOGacwiycpHkGuXQZikFqTonwC85NCBPSDFTrLiSnqBWXxg9nwz/M0Zgd22FZ+FrWnPSm/frZoLNreVrvbGYlCQgz7P8ja5I54EfjCzXljrglfd1sfFdYocZmoPIj9Nvk5XdUXnExKPnH2SCHltwJ4L8tSOLIn7JyRgZ31YZhWfhxVIFjvYU68YmXfY8jwazf2vM3HmB6VpxjDo8kpuFeQtUWbKXB/g16vZEqrs5GrlA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=uHPLYVWf3D08zYkdIrDgBPEq07v8K351XpAC2djDhZI=;
 b=W5u+z2opk/RYO7357EUKwfyTA4TZ2aw0optdcLgbaWarInYm+ZPEfboQfPHeuG0j16v98rn7Sl7uVtpWefDgOrQgG9pEkFsyZGzMX4Iw3b+3Dg+vSTPhjzdzRGvRzYJ5EZqa95iKSfisWgIwlN/XJjwo4+ujopcLvuuHbVZ2tL8=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Luca Fancellu
	<Luca.Fancellu@arm.com>, "michal.orzel@amd.com" <michal.orzel@amd.com>, Henry
 Wang <Henry.Wang@arm.com>, Julien Grall <jgrall@amazon.com>, Stefano
 Stabellini <sstabellini@kernel.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH 6/7] xen/arm: mm: Add missing ISB in xen_pt_update()
Thread-Topic: [PATCH 6/7] xen/arm: mm: Add missing ISB in xen_pt_update()
Thread-Index: AQHZos+28SuZIXCU302ZL5lufQv4QK+pyVIA
Date: Tue, 4 Jul 2023 14:54:56 +0000
Message-ID: <3BF9CBE5-8EA6-42C4-AE7D-147AB94F3E58@arm.com>
References: <20230619170115.81398-1-julien@xen.org>
 <20230619170115.81398-7-julien@xen.org>
In-Reply-To: <20230619170115.81398-7-julien@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|GV1PR08MB8452:EE_|AM7EUR03FT004:EE_|AS8PR08MB8609:EE_
X-MS-Office365-Filtering-Correlation-Id: 55c9ab90-7e79-4249-ab22-08db7c9ea773
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 jhn24/rLu4V3rEulqJYn+yXLpqUVb7NeblU7EN23Ms89QQv2M6DJHOOlAiSE98Y6gzlQDAmfguHSRK4j/FCcaRHdT0ZGGEAGyDPTf6gJ6vOFHZhJjsBSH3H5NeG+ivZRZz6Roj/Cf46Sk+FyhYIufmoNVaET5ZB67qv9dcQk8xM5c2z6KHip8zN9eBI0vRzlIRfQrQsTJALF1N8kelYb0bdwsgSfJSge51KLoBB40+40P/zmfM5pDCI7KQjcC+9j0WnZY+F/jL7JakpaLawqVyu2pAxE8BnqS2LZiS6cSYptXii0K5puiGTMwLVh43yo91BKZyQ1fo9JWzfXBBzRmAZPgO+sLnqtYaktJBBQN8i7S1Ewhp0qd4L9Bm0ZtBt2XufVbsTRJ1Ii+rz3uXU7pdkTqZe/Q+hG6zzPP1+s9aTeQmJbfL3b9MVw842zK8LCELNbkEq+0/Nw/Y6CGTcM//yWiVR/fqd4h9N9mVuXAEby9iYghLK1xWZ1kVMTpL6vZV72Yi5k2DgB60/ROyEE+MhBMIPHsG/dq+YOwDV81mMsYMUNubeyeiX2WV6IJOe/kXRv9IdqHM7qfHdP304P3Sbbz2Q4jtuPqwLMoLjp2fdG+dlgr40srjvGligN7yO9opG9mt+X8tPrpza/kZNmWA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(366004)(39860400002)(376002)(396003)(451199021)(4326008)(316002)(66946007)(64756008)(66556008)(86362001)(91956017)(186003)(6916009)(76116006)(66446008)(6512007)(66476007)(6506007)(53546011)(83380400001)(122000001)(2616005)(2906002)(6486002)(38100700002)(33656002)(71200400001)(5660300002)(478600001)(8676002)(54906003)(38070700005)(8936002)(41300700001)(36756003)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <CD246B026BE04C4AAC4B40A239DD1B5C@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8452
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT004.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	40929aa7-05e4-4f4c-ea53-08db7c9ea228
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	MZSkjVF4SdQWRnk/lcIPyPa3Q32ieJYSh0oe0LZfeaLw/hlPb7MAS79k6kbpe/sYiY+bhf4cQkorZzoH3EgAmbrUq+qv2ZUjl9o3t+31Pkodz4Nsw12I7WQUqV0lMLPTewNumPfNaTUhTkCShAPfpqTWmPgXXJbmJl8LQf+HmJ7Eq0GgdnYvOflNmw/l2qGHMcPJNbHFIawgG6YpiqvfjFq7AtNdS4caPI06wF4/ST4FW/K6lU1eYj2x+zR960H+u1EFuTpA/JpkovaLHe5j3mD57WaQsvh9hnNr+D3m+ip8Le23PY0K0CJ+3Mj6UYPDfnMniNRDcTR/j+JnI9WTIgaPRJirfBpzg1pgcDX259wzm+754rqHQ+VBLm3XzJns5Q1RSVc1RgxJ3fwsOyu1NUYC6oT/zugG94bnmKoZwg0xKMavw15/UkWsXDZ3JmtWKjIiTkl5DRhzWhn59E47aIWNZDBgKyK/wl/waCKqWhGEh7HQ/gtOs3fD/rGZbPvsfhEDrgOnzCliJi2aZIBjUIfr9zllX0nrqE/UFhsg0mSkh5YQYyad06CSJDN6vrUS89K5ffhHZyonKkIq1e0LGwCmuLtvHcYH4IyNTKwlI4b2Ff2SJUyfPWaRmRrzPqyz3NFsU8QRPV7yfzOYD0WhSln0ptNwl+F7Q+QHm10pvCOGk7SCmZz0aumnB5kIkDY2rA0DXQznhdglBDfGAesWBK1MGn8Mu/3o2W9Sw4zZevU4HXC8g/Z/hOenTWrUTPQ5
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(376002)(346002)(136003)(451199021)(40470700004)(46966006)(36840700001)(36860700001)(107886003)(316002)(41300700001)(6512007)(6486002)(26005)(53546011)(47076005)(83380400001)(336012)(6506007)(2616005)(186003)(478600001)(40460700003)(82740400003)(54906003)(356005)(81166007)(70206006)(4326008)(40480700001)(70586007)(5660300002)(33656002)(86362001)(82310400005)(36756003)(6862004)(8936002)(2906002)(8676002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:55:05.8640
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 55c9ab90-7e79-4249-ab22-08db7c9ea773
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT004.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8609

Hi Julien,

> On 19 Jun 2023, at 19:01, Julien Grall <julien@xen.org> wrote:
>=20
> From: Julien Grall <jgrall@amazon.com>
>=20
> Per the Arm Arm, (Armv7 DDI406C.d A3.8.3 and Armv8 DDI 0487J.a B2.3.12):
>=20
> "The DMB and DSB memory barriers affect reads and writes to the memory
> system generated by load/store instructions and data or unified cache
> maintenance operations being executed by the processor. Instruction
> fetches or accesses caused by a hardware translation table access are
> not explicit accesses."
>=20
> Note that second sentence is not part of the newer Armv8 spec. But the
> interpretation is not much different.
>=20
> The updated entry will not be used until xen_pt_update() completes.
> So rather than adding the ISB after write_pte() in create_xen_table()
> and xen_pt-update_entry(), add it in xen_pt_update().
>=20
> Also document the reasoning of the deferral after each write_pte() calls.
>=20
> Fixes: 07d11f63d03e ("xen/arm: mm: Avoid flushing the TLBs when mapping a=
re inserted")
> Signed-off-by: Julien Grall <jgrall@amazon.com>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> xen/arch/arm/mm.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>=20
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index e460249736c3..84e652799dd2 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -779,6 +779,11 @@ static int create_xen_table(lpae_t *entry)
>     pte =3D mfn_to_xen_entry(mfn, MT_NORMAL);
>     pte.pt.table =3D 1;
>     write_pte(entry, pte);
> +    /*
> +     * No ISB here. It is deferred to xen_pt_update() as the new table
> +     * will not be used for hardware translation table access as part of
> +     * the mapping update.
> +     */
>=20
>     return 0;
> }
> @@ -1017,6 +1022,10 @@ static int xen_pt_update_entry(mfn_t root, unsigne=
d long virt,
>     }
>=20
>     write_pte(entry, pte);
> +    /*
> +     * No ISB or TLB flush here. They are deferred to xen_pt_update()
> +     * as the entry will not be used as part of the mapping update.
> +     */
>=20
>     rc =3D 0;
>=20
> @@ -1196,6 +1205,9 @@ static int xen_pt_update(unsigned long virt,
>     /*
>      * The TLBs flush can be safely skipped when a mapping is inserted
>      * as we don't allow mapping replacement (see xen_pt_check_entry()).
> +     * Although we still need an ISB to ensure any DSB in
> +     * write_pte() will complete because the mapping may be used soon
> +     * after.
>      *
>      * For all the other cases, the TLBs will be flushed unconditionally
>      * even if the mapping has failed. This is because we may have
> @@ -1204,6 +1216,8 @@ static int xen_pt_update(unsigned long virt,
>      */
>     if ( !((flags & _PAGE_PRESENT) && !mfn_eq(mfn, INVALID_MFN)) )
>         flush_xen_tlb_range_va(virt, PAGE_SIZE * nr_mfns);
> +    else
> +        isb();
>=20
>     spin_unlock(&xen_pt_lock);
>=20
> --=20
> 2.40.1
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:57:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:57:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558474.872604 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhSy-0004Z7-5I; Tue, 04 Jul 2023 14:57:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558474.872604; Tue, 04 Jul 2023 14:57:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhSy-0004Z0-1x; Tue, 04 Jul 2023 14:57:20 +0000
Received: by outflank-mailman (input) for mailman id 558474;
 Tue, 04 Jul 2023 14:57:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kGqQ=CW=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qGhSw-0004Ys-8D
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:57:18 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0621.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::621])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1174e8e7-1a7b-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 16:57:17 +0200 (CEST)
Received: from DB8PR06CA0042.eurprd06.prod.outlook.com (2603:10a6:10:120::16)
 by PAXPR08MB6480.eurprd08.prod.outlook.com (2603:10a6:102:155::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:57:12 +0000
Received: from DBAEUR03FT032.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:120:cafe::1a) by DB8PR06CA0042.outlook.office365.com
 (2603:10a6:10:120::16) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.31 via Frontend
 Transport; Tue, 4 Jul 2023 14:57:12 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT032.mail.protection.outlook.com (100.127.142.185) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.18 via Frontend Transport; Tue, 4 Jul 2023 14:57:12 +0000
Received: ("Tessian outbound c63645f235c1:v142");
 Tue, 04 Jul 2023 14:57:12 +0000
Received: from c98421ae3202.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 5A874FAA-909A-4BAE-A394-3CD879AC7C5A.1; 
 Tue, 04 Jul 2023 14:57:01 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c98421ae3202.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 04 Jul 2023 14:57:01 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by GV1PR08MB8452.eurprd08.prod.outlook.com (2603:10a6:150:84::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:56:59 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:56:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1174e8e7-1a7b-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=G3zMTeCLUtM1cEkUBaoYNInhOtFMlJXgNjM4UM4FfTk=;
 b=Nj2sroJzc8K6gysG1kLxwg4ezx6aAaSC2ieRefuiBhJBwO4WgDzBuZkc+iR7Dqvr/b9X+c5H/7h2R5/pu2Ydqc+fm9Pe4ZoXtCJu7yzNr9jzztLpio/zmLTtRoW/ut6ryr6rjUzz+Ql8m0Ye/mbs+hy8ZIHMnOLBksABhRcyPgI=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 0b81cce9aab55068
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LsQWswdpaTupvJYAxEHhIbDSgVfQBhlbaMZ+D7QI+kMhNTQ+4wqNrPzWTphtiprJqpYBG+0ZvPIf1GyQuaeXYwrnzCC/sYd/+SMJ39DiEMcsZW5UUu6nhv0UNyV2df8uACzKCYVPzYiWtQPJdWTroDeOqOwZT85Wx9ZZuCjTklwYw/+pak2rVrJOpeOdiwfOAJ96aU654hFKU9BqjdbYzMgCwZ8LHitv5J6EsqVeX4oKMWkqm4iCv5pFLvRGEX0NyEOv0Tv9RhzelMj/1l3vglCajfpo0p9u7K7LkTw7jFnKvVV7X4b3Mg4icJBkBHwEf/rX2y9hr0EYt6+6qqvQUA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=G3zMTeCLUtM1cEkUBaoYNInhOtFMlJXgNjM4UM4FfTk=;
 b=odFkFRYK56ovLcJlI8qE9TuDFsmi8d8OC4P4I9SMrzWqYlf9i3jA8Giszpw+1Ejl51ouZZAxVPGDJ3mRggFjgUVJZCJ5T6nCxYRiJhCEONBegg8+Em2B/Gq6nN5NrmhO1tgcc/YQmRcJEA0Wfnkg9LXmFv60bUHyh9N4HwKoqEwj+Ujqr9nrxCjIY3dTTYNT2OVvc+ikvPo9GdWWKGP5MXJZscHnsQcqNv5Z/s2kPLg3gxLYGDgqKeOIfaGjLnRcJ7T32PuZN+3IBt74EG4B37daVgai5ZL1MWoPBccp70KPjOIFvztsvahs5Cy/an/hBLEKzobB7UGIJdAwJM+l+A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=G3zMTeCLUtM1cEkUBaoYNInhOtFMlJXgNjM4UM4FfTk=;
 b=Nj2sroJzc8K6gysG1kLxwg4ezx6aAaSC2ieRefuiBhJBwO4WgDzBuZkc+iR7Dqvr/b9X+c5H/7h2R5/pu2Ydqc+fm9Pe4ZoXtCJu7yzNr9jzztLpio/zmLTtRoW/ut6ryr6rjUzz+Ql8m0Ye/mbs+hy8ZIHMnOLBksABhRcyPgI=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Luca Fancellu
	<Luca.Fancellu@arm.com>, Michal Orzel <michal.orzel@amd.com>, Henry Wang
	<Henry.Wang@arm.com>, Julien Grall <jgrall@amazon.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH 5/7] xen/arm: pmap: Add missing ISB in arch_pmap_map()
Thread-Topic: [PATCH 5/7] xen/arm: pmap: Add missing ISB in arch_pmap_map()
Thread-Index: AQHZos+1XQowzy5c7k+9HVrcbAjL6K+pyeQA
Date: Tue, 4 Jul 2023 14:56:59 +0000
Message-ID: <860295F2-1737-4D99-BFAC-C981ADA9AEB7@arm.com>
References: <20230619170115.81398-1-julien@xen.org>
 <20230619170115.81398-6-julien@xen.org>
In-Reply-To: <20230619170115.81398-6-julien@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|GV1PR08MB8452:EE_|DBAEUR03FT032:EE_|PAXPR08MB6480:EE_
X-MS-Office365-Filtering-Correlation-Id: 1b9b2757-6f0f-4aec-24f4-08db7c9ef2be
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 +kkvgpOSEn2tkTJGOMrhssg1Fh5qJ4h9lw+OO5JB/7+mN76Eihd6CnsNh5mCQMZxumOQjPMWZqkydwk42o77pw+bv6Zoqq7JddLEGh6SrQmmZiA6xpgNLIuOmuSntd2uWW+sRycABl1GnUXIUofhzFpI6UZ1Wkd8ptn+RxA0T24WkR1RHwrGbkCXix9JM2at/RCW5s4qM0nZA8z3F2f5xoYfXd7g0mwusEfCKvJbfwlvwgcI+XX3CqZhPFkXbv0K9O2CYWvTUd0+4S/0Qj8docWm6ROw2D1+IgrQ+vXhNs0kDERfJiu1QXLevKT6wwA5r7iGgUszJ4q3QGjJm2u2VZaVb1ci7rhrYz0Df7adbijgIijVNQgQZVwGpCOtiP7+JQv1XCb3YxKx95V9hmHXI9tfYdiIRvR8a6UbqNHnXkEgnjd4WutJJaAz5B//hJYfNJXzkHx8pYVRTf3Vjn1esYH23adGdk6kCEObOXHGGNTI9Ns1zkNrQhiBZpdJ7GzRp2CIPLhwx+aIPYwPjpmpMCs5Ju/yHPWuHb8pkdHfBOWy9wU+WQLIFmXqTZOGJHCiOsdOtME1yNv6smnVeZO17LsDmP3rShmAhJ+eV7Tn/U+B4ccwzdN0rW55L/7YtsB5++AuDdCnTDeMS3uzsK97kA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(366004)(39860400002)(376002)(396003)(451199021)(4326008)(316002)(66946007)(64756008)(66556008)(86362001)(91956017)(186003)(6916009)(76116006)(66446008)(6512007)(66476007)(6506007)(53546011)(83380400001)(122000001)(2616005)(2906002)(6486002)(38100700002)(33656002)(71200400001)(5660300002)(478600001)(8676002)(54906003)(38070700005)(8936002)(41300700001)(36756003)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <0DC7FE4CADB7DF40BFE413748AD632F9@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8452
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT032.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	b711e9e1-8ab6-4519-e661-08db7c9eeaf2
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	o/xxChuR594HJEBm/Mwn30qpR7wMvDodaTCpuDXz8tdH42YQrm3auEA2OmyHFeiQ7qbkkTP5REw2dcqSktFZER4ZeJQoeJOTSDhhvGBC5GQTPMfNQdX1myeQsQZeCWbEHO+pMRPwZhdSbUcgrfk00lM7ZARzMNToAXz95vU1u3rQWZ506Qv1r+4/7ejaf0KxHgTo5/mxqoRElKJ9/06+6OKHA9b6mmzcznSqKfZMyI2DCDrohwbED3x1e5EKlL06uOjRefwaym2cRMAi0klKG3DqHPgKGu6FsUcCUz+opPlz20XhtUnnW3+hJbX6KhM3OMRl+erIcK2aS7BAfZ87TRxuUk0I4gWFAIjLGh6Auk7tEe9IRhKy8iVhZQ+gskLJLbwP4LHVoVjF6Hp10nlhhmKUb5hS1w7w1P59DxdDBTeypKswVTVUKI/AnEnfKN+G7Yr79k/sPCcngZp93hPrENFyf2GqCMMlnFuLgTFXrQBC44PDPLegEOjz9SzhZNkrpH3YpbhLwBOdVgjuFaaJGug5sBlRNK/3aUxeMBuRx5lj5z/9q8SLAc2aID49rLE0DF1HIv2H6SpzVxdJwuPoC1oIzDZAGgtazgossXmHiUZhpvdPJLS86VihCTi5oxLoT/7CT36N+oeWYO2IiWCBk37zRd2PGBjN3lG1eGVmnIRdRkbifle9eyOPSeNnq5lCCpBBZlh/B256deIHZPfRG+84R5xMFHRgeO2Qmf8njRnlxn1ZBgc/K9IIpkT5gSR+
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(346002)(376002)(136003)(451199021)(46966006)(40470700004)(36840700001)(40460700003)(2906002)(41300700001)(6862004)(5660300002)(8676002)(8936002)(82310400005)(33656002)(36756003)(40480700001)(86362001)(186003)(2616005)(478600001)(26005)(6512007)(6506007)(82740400003)(6486002)(70206006)(47076005)(316002)(70586007)(4326008)(36860700001)(107886003)(53546011)(81166007)(54906003)(336012)(83380400001)(356005);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:57:12.1969
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 1b9b2757-6f0f-4aec-24f4-08db7c9ef2be
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT032.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6480

Hi Julien,

> On 19 Jun 2023, at 19:01, Julien Grall <julien@xen.org> wrote:
>=20
> From: Julien Grall <jgrall@amazon.com>
>=20
> Per the Arm Arm, (Armv7 DDI406C.d A3.8.3 and Armv8 DDI 0487J.a B2.3.12):
>=20
> "The DMB and DSB memory barriers affect reads and writes to the memory
> system generated by load/store instructions and data or unified cache
> maintenance operations being executed by the processor. Instruction
> fetches or accesses caused by a hardware translation table access are
> not explicit accesses."
>=20
> Note that second sentence is not part of the newer Armv8 spec. But the
> interpretation is not much different.
>=20
> As the entry created by arch_pmap_map() will be used soon after
> pmap_map() returns, we want to ensure the DSB in write_pte() has
> completed. So add an ISB.
>=20
> Fixes: 4f17357b52f6 ("xen/arm: add Persistent Map (PMAP) infrastructure")
> Signed-off-by: Julien Grall <jgrall@amazon.com>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> xen/arch/arm/include/asm/pmap.h | 5 +++++
> 1 file changed, 5 insertions(+)
>=20
> diff --git a/xen/arch/arm/include/asm/pmap.h b/xen/arch/arm/include/asm/p=
map.h
> index e094d13dd282..bca3381796f3 100644
> --- a/xen/arch/arm/include/asm/pmap.h
> +++ b/xen/arch/arm/include/asm/pmap.h
> @@ -15,6 +15,11 @@ static inline void arch_pmap_map(unsigned int slot, mf=
n_t mfn)
>     pte =3D mfn_to_xen_entry(mfn, PAGE_HYPERVISOR_RW);
>     pte.pt.table =3D 1;
>     write_pte(entry, pte);
> +    /*
> +     * The new entry will be used very soon after arch_pmap_map() return=
s.
> +     * So ensure the DSB in write_pte() has completed before continuing.
> +     */
> +    isb();
> }
>=20
> static inline void arch_pmap_unmap(unsigned int slot)
> --=20
> 2.40.1
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 14:58:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 14:58:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558480.872613 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhU8-0005Az-Hg; Tue, 04 Jul 2023 14:58:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558480.872613; Tue, 04 Jul 2023 14:58:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhU8-0005As-F6; Tue, 04 Jul 2023 14:58:32 +0000
Received: by outflank-mailman (input) for mailman id 558480;
 Tue, 04 Jul 2023 14:58:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=D/z2=CW=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGhU7-0005Am-2f
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 14:58:31 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20627.outbound.protection.outlook.com
 [2a01:111:f400:7d00::627])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3cd5b9c0-1a7b-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 16:58:30 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBAPR04MB7287.eurprd04.prod.outlook.com (2603:10a6:10:1a4::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 14:58:27 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 14:58:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3cd5b9c0-1a7b-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=lpW7+gYYXnrZQmFckHZzpUKZzKl01gGtmaFdFelErASWJbLHX1+4L3iU2K/iMCt6v+6p1YC8JumRj64hJsRzf1WcwNnalA9pgK8hvu3UufKm5j5E2GE24TGgskhZ+rSu+AZJ1qfLfMW4RP5ZXGWpdTOaa0jJwgKC+C/tOxdg9f1yZSZ8yXB+XwsewTjI+KeCJPGMwHqYIFnGibBtwrWphvPjSFJ1g5CUxGOfwK6t/gg41nW19Sm2lXgOqf6etJxL4ZYQLAfX2XMFjakNAQuvgiE22587k7AGgfBg3ZchxxL4BTBcEfrTHW+tUTi3NR456Fl+gx5r76mxNdjDJ7WxuQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=G9jJ7pFCGUg0kAolaJLhlV6C5YYLvflxrUyGM+T3uJU=;
 b=GLAAjucG6y7Yl4YbRoP5o5p7eUauxGI0GzFUplb96IqwEjp1eUaHM5S1nnsv6OxGv1MnzW5q9q3T1QTNlb4DFuY+yYOAz5+VXIR46tcyTuBab6eJDnvZuF7LF2vM1HUSZ9l1l+c7p9mf8wwvt/MLwi6LMXiMLitA3orZo3eKS90ano2JvaljWXNt0NjaLhluDgvs5w/zY4yP+u9QN0eFRe2UsCATOzp/G8xnQtRVXEHt/eOOfhxdTtILcQVr0J7KHa0W9fHJwm4Q30Fii+9Gmm5c2JHqVdWK9q5eugq2g3dd8iGrCrBRLNT6p23cj8SKZx0j2InkbGn+ido5KtGWTw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=G9jJ7pFCGUg0kAolaJLhlV6C5YYLvflxrUyGM+T3uJU=;
 b=uCFiIxssNsOyP2V2vt7ruVuOjV86n6z2J9qPkt+kDKaxmqiCbOtF13o42Gz1Re0tks7+5s5d61yVKJ3+aMZe9VX/DdzCnaftESTlE8O1xRoWC325FDFmII1VDwPAxejDWrhpQo6hlq9CYRdaVTVww29Z42afGRlSrtuLaY9mEA+jTdEvw2sRozs1EMaQJaG9fu6TnrreahW+AEL+YnpljkzQOf7XsFYSekMOpAyfPIY4oxcIK44S47TRFPQflHJzxmSlw9qJVLeCNPxSBu+9BeoRO5V+W0q9KJcTMeUSBC3T5MAUdQLx7wI+j6s1HIe0GXbApO7XBfOxzxMuavP3BA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <27e570a7-f247-0de1-9289-c604db442c9b@suse.com>
Date: Tue, 4 Jul 2023 16:58:33 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v6] xen/include: avoid using a compiler extension for
 BUILD_BUG_ON_ZERO
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 andrew.cooper3@citrix.com, roger.pau@citrix.com, bertrand.marquis@arm.com,
 julien@xen.org, George Dunlap <george.dunlap@citrix.com>,
 Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
References: <0b0d9a5614daac653b3bfbcfaa29a9b4c11286bb.1687793572.git.nicola.vetrini@bugseng.com>
 <df8a0c82-5f07-6a9b-e24d-7550387fca27@suse.com>
 <d73da8f3-2a76-7c4d-dc7e-82a86bfec3ea@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <d73da8f3-2a76-7c4d-dc7e-82a86bfec3ea@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0185.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9f::18) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBAPR04MB7287:EE_
X-MS-Office365-Filtering-Correlation-Id: e306d0d7-d3a6-435a-d295-08db7c9f1f7b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	R6T0CCUgI/BSTjlIS0nWQzdmEOeTutaG6DA4OArL36V4U5SRICD3CBEtoTvy0pH57V5pyWBXd/He2nU/GE0VytkkzsYz6hiMcwUM+Bs+z0A/DueDza22EBG8UQhhv9tta0MxY9yLt2bSOv1i1xVCI5bJSpSzwuI9NP4f/mT1yZ17fKKgdjF2Y8K45jFCRHSOVQkJO144RnV93nwTsKHJ6JHMP5LoWkdYzSD/dv2FiFdSrTSF8stICGJz1WLxZC/twmdEVLthhi9jnASUjTy/GOGkqoUDM9aESl9xr/JfEi+fC8XeUr3fdXrtZMiXBr7hdhvTVPM5lzlJqBNplXGojFEZQRabI82D+ZzkYVVCgmUDlCyL/+IbxBEvN621LxH3hpyl8piFJhs/dCsCn3TKZdu681WV4KcsV8+ZCyBdWIufS63yQkUKHcJO29vEyYmJqRyzT94gpxckxsUtHtPY8oj6ZUgsyHCdw7tR8ivmCCzYesGNbOaG3Rnf0yqUG/7/vnUpdmaIv4jQqUwBmYRHwS0ZPLyG8pZvD+15PUWfGELnlFU4cCkFHRYSuwUuNAkpDUAPz17wCtSv0afR2rSsRPK3fjJjB3zmIu8MUxeGbWRPXP6QNS5hz377ceQksLTU
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(396003)(39850400004)(136003)(376002)(366004)(451199021)(2906002)(41300700001)(7416002)(5660300002)(8676002)(8936002)(36756003)(86362001)(31696002)(6512007)(6666004)(6486002)(478600001)(83380400001)(26005)(186003)(53546011)(2616005)(4326008)(31686004)(66556008)(54906003)(6916009)(66476007)(6506007)(66946007)(316002)(38100700002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WUhyUjN3bHJLRFVoOHc4NUEvdE9YTWRlclZPRzVjaThRREZkRDAxQmRWVUlj?=
 =?utf-8?B?czQxS0FqU1hpY2FnRXJkZEpmTkJrS0dQU2NlMkN5WHVmRWVlSlpMUGpkTXBt?=
 =?utf-8?B?aDRXUTNTQ21LTWFlNkpKS05LZnlXUExERUFUYlRXMmZJbTRCM3BiUUJoRXBn?=
 =?utf-8?B?a2lQRytOUXZsOU9IMEs4ZldZeDU2VTJYK0U0dW5JTXdudkFFRjhJU20xRUtZ?=
 =?utf-8?B?LzNPVHBVU0x0allqK01RTmg3QmprVzVWelcyQWJyNGFGZ2ZyL0NCZkR6aDcv?=
 =?utf-8?B?eWhPRUxuRUh4Y1dkNHFuNFJVY2NkS2hEWHNyem81eUlqVmVySjJXajl5THkw?=
 =?utf-8?B?cnJqQmNzRFkxUDRJNUpxN0VDSTc0REpic3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Hcq?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e306d0d7-d3a6-435a-d295-08db7c9f1f7b
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 14:58:27.4040
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: f3xt7dDpOyLCYyD3yQE+4RSMQrHMdwggb7hpeNOzSDI2OX/wts7lL3ysDXLd4ROm0ZN64gMJEKzlocnJQhUHjw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7287

On 04.07.2023 16:53, Nicola Vetrini wrote:
> 
> 
> On 04/07/23 16:24, Jan Beulich wrote:
>> On 26.06.2023 17:37, Nicola Vetrini wrote:
>>> Redefine BUILD_BUG_ON_ZERO to avoid using a compiler extension
>>> that gives an acceptable semantics to C99 undefined behavior 58
>>> ("A structure or union is defined as containing no named members
>>> (6.7.2.1)").
>>>
>>> The first definition includes an additional named field of type
>>> char.
>>>
>>> The chosen ill-formed construct for the second definition is a struct
>>> with a named bitfield of width 0 when the condition is true,
>>> which prevents the UB without using the compiler extension while keeping
>>> the semantic of the construct.
>>>
>>> The choice of the bitwise AND operation to bring the result to 0
>>> when cond is false boils down to possibly better portability.
>>>
>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>
>> The code change looks okay to me now, but I'd like to double check
>> towards the testing you did with this change: While it is clear that
>> you will have checked that the tree builds with the adjustments, I
>> expect that would have been with a compiler supporting _Static_assert.
>> Did you also check with an older compiler, using the alternative
>> implementation? Plus did you also check both constructs for actually
>> triggering when the supplied condition turns out to be true?
> 
> Besides using the build pipelines in gitlab, I checked just the macro on 
> Compiler Explorer using gcc 4.4.7 and clang 16 
> (https://godbolt.org/z/1d6vznxcW) and the construct is behaving as expected.

Great, thanks for confirming.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 15:07:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 15:07:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558484.872623 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhc8-0006id-Bo; Tue, 04 Jul 2023 15:06:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558484.872623; Tue, 04 Jul 2023 15:06:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhc8-0006iW-96; Tue, 04 Jul 2023 15:06:48 +0000
Received: by outflank-mailman (input) for mailman id 558484;
 Tue, 04 Jul 2023 15:06:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kGqQ=CW=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qGhc7-0006iQ-Hb
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 15:06:47 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20627.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::627])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 64613b99-1a7c-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 17:06:45 +0200 (CEST)
Received: from AM6PR01CA0064.eurprd01.prod.exchangelabs.com
 (2603:10a6:20b:e0::41) by PAXPR08MB7335.eurprd08.prod.outlook.com
 (2603:10a6:102:220::9) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 15:06:38 +0000
Received: from AM7EUR03FT048.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:e0:cafe::c9) by AM6PR01CA0064.outlook.office365.com
 (2603:10a6:20b:e0::41) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.30 via Frontend
 Transport; Tue, 4 Jul 2023 15:06:36 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT048.mail.protection.outlook.com (100.127.140.86) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.18 via Frontend Transport; Tue, 4 Jul 2023 15:06:35 +0000
Received: ("Tessian outbound d6c4ee3ba1eb:v142");
 Tue, 04 Jul 2023 15:06:35 +0000
Received: from c17341142ecd.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 06E7BC79-D510-41C9-8947-F1EAE4B343A8.1; 
 Tue, 04 Jul 2023 15:06:29 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c17341142ecd.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 04 Jul 2023 15:06:29 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by DBBPR08MB5961.eurprd08.prod.outlook.com (2603:10a6:10:203::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 15:06:25 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 15:06:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 64613b99-1a7c-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=FU32I2cFGzf+P1C8PpjK9M/cr0oKEjt/SRWxHv1gNHI=;
 b=cBb/LtmpyO1l9kXjNxIUAnX+QiDXsRB3xNOvmvaf9LdMymGCmj0J78ghFhrMGUCj9I0OpiJFfXzcLXnOaKtN+YqRBxpbOZiaYMqM/P/LLtetCbWyiDba92Aj097j74xcwOzQDOBJ7CyNN4kQnfn4S4jh3tvriIwEF9EtrYR50M8=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 70e0c79b1e6a516f
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=bs6QHnMoLAGCEJgczTAZpxoMwNBi4QraMjQUFNff4a4ba7GyTSUhH/AsWDQaKpaRRiROjMt2Sqjp5rw7JZ4GIlxKVgAlf4jHqbivtXoP6csegLsam8BAtz6NKHXQxGGmXGX4cLgX9X20UReqC96Ne49fPcuVtKdv+dpgHHhprG1/g1Si3Ndz0E8iUfVygU3+6auM3mVUQOYQG8xKg8dNCjKGXIN2WN+Zx6O92CkC+s0eSUZittfjyKgmUp/WPo1J9sQNMVF2pIsMU2URt8sCXS0n/VHw+pASqtl4M1ag3DTQvA+wlEtfS8Vcnm068h1FikN+qwsY9ch2srjXCDEhhA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=FU32I2cFGzf+P1C8PpjK9M/cr0oKEjt/SRWxHv1gNHI=;
 b=WB5Wayxadwfl/yZHtwhePJV6HRyg8NL/iUEFl3OaK8ZwXrIz+Ij78Xf8mHjo06sQ0hquldGiW34dWqQy70JpL+LN2S8ANO5fTJ92fxW/LyShlw3XuZJfJWyTY0YfQ7y/QmTDy0zTvF7wS9IfX4CmGWUtQqNdW7hulfFgps7JoqVm1PEefDW+bD6ABx6es+IeCh2CA7dahI1LSBG6yLR9Y1C8XjuYXAQ4Px2b8CwTytdiIK8lXWiVer6gNjHHJhoR7A5fiZntWWr498CzZ4bNGtPye6e1Z3WY3B9VE6X0LUu97DICikFTI2VcSnptmS0q3j29Zlfhn0xIDLJxWlQxMg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=FU32I2cFGzf+P1C8PpjK9M/cr0oKEjt/SRWxHv1gNHI=;
 b=cBb/LtmpyO1l9kXjNxIUAnX+QiDXsRB3xNOvmvaf9LdMymGCmj0J78ghFhrMGUCj9I0OpiJFfXzcLXnOaKtN+YqRBxpbOZiaYMqM/P/LLtetCbWyiDba92Aj097j74xcwOzQDOBJ7CyNN4kQnfn4S4jh3tvriIwEF9EtrYR50M8=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Luca Fancellu
	<Luca.Fancellu@arm.com>, Michal Orzel <michal.orzel@amd.com>, Henry Wang
	<Henry.Wang@arm.com>, Julien Grall <jgrall@amazon.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH 4/7] xen/arm: page: Consolidate write_pte() and clarify
 the documentation
Thread-Topic: [PATCH 4/7] xen/arm: page: Consolidate write_pte() and clarify
 the documentation
Thread-Index: AQHZos+4vw3nnvONG0uaFwZBq/1j9K+pzIYA
Date: Tue, 4 Jul 2023 15:06:24 +0000
Message-ID: <49DB9A64-FB34-4EAB-9E6D-3C445B1790E4@arm.com>
References: <20230619170115.81398-1-julien@xen.org>
 <20230619170115.81398-5-julien@xen.org>
In-Reply-To: <20230619170115.81398-5-julien@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|DBBPR08MB5961:EE_|AM7EUR03FT048:EE_|PAXPR08MB7335:EE_
X-MS-Office365-Filtering-Correlation-Id: 52c9ca3d-468e-4831-b9b2-08db7ca042ba
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 SP8Q72wI619PZqFV6foA1kqRtkC2B4KoRmS2c66OW6D+KI8mD7RAHLDjjfBfQw9ENcrs91z8jHwEWVCUiu4XNt4s6PY9POZtzbmquC9guEdXLPpd44k0Tb4fL7dmU3Magn58k1nh1qE9hwxNYQtbqveTH+QxrhUQEMChNWNYqG0FJW4Lqnwyerw9lwHKUrZTtjQzeOECsPCyJHTuQqJQW0AqQu2ULHTSsEThFu01r2ggfS7C+obBHM815x9SIfr5/BU5gljuBiD1RwSZLNGKfHKj47EShCeaP0oD1uDOm/H4vjRnZNVuPazEbaesnEaSZmlPPvfAwekavTrY9DflZsfjdcRmmjGLrT5P1ZkSpmNblsrff4b4yYI1Ki4H/X9qRtRbCefKEIhQhr6EdKZOD1H2gX8BlyBVBNoHgaPiC7xCyRi0Wql7gYQgZcZdmMlybqRRKnt1g1GRWg2mMGDNun2/tFuBCC5OXKUbX5TTuaWwf2h5W7XPZDnr4qGN3jCDijyIz5gFRiUfMqWansm4MYKGtSOnCHYi1Yq60ieRNFfoAEQcF9ie1VjWtrGISKiY7qyB2P6TJONAtJAKqOxwRCIiKrbDjw9z+7F+TwyhZTkZ4vMmHVfQeZXLuqPNas49LKwNvD4bpmMA39I3TGIUTg==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(396003)(346002)(366004)(136003)(451199021)(38100700002)(33656002)(2906002)(71200400001)(6486002)(8936002)(38070700005)(8676002)(54906003)(36756003)(41300700001)(5660300002)(478600001)(76116006)(6916009)(66946007)(66556008)(66476007)(64756008)(53546011)(91956017)(66446008)(6512007)(186003)(6506007)(86362001)(4326008)(316002)(2616005)(122000001)(83380400001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <D41CCCCF03F39A4FAA7DE7642910A424@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB5961
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT048.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	5429e24f-18a2-4d7a-16ed-08db7ca03c34
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	9y+fj45XcbaR58tqI+IfxeBRARnGhfgc5wNBiLuNcpgnbd/O129mn4k1+uh9EeFd2JiIkxrMi5tJ1P5BR0aV8mJm31duABdIjiwJyT0btNoUL9wYQMUysaKczpSQ5zFywnig48o7JEv31qIYSkAfPKmEctzgdAlspbnmvYHN2WIQcq2dMHsVLgVxKUcNY/ESruD9v9YJ7RPNb22pXXX54EolOcnZwuHRASirsnq5WCOksQxE1cq85iEv6sPId/j1cvuwWsgkCahOvyPIBfg8ik+J+uqEtMQaHlsyDla0X7mCB+RhjXWrVn+vNsX4H23snkfWudzlxQUorRPRbpWx9pBW5TgoZ6RlEsBHrfj7/aRcmMK+96znHNVJ2PKj++mJhfGztSFsaM7Ntj1xrDrWtfe//oclqSlmU82o+FyRf2j2bTFyzhpVmSvKuMgFIvtPeyNPtitbk84G2EHhEgVd2ovJjInTA+iNmHDSNNxA+RYl9Z2mqNowy678KY0cuM/C14gHkEyHdAvxe3aVVLlvB+Ims9n5vENs5wq0KMiJYxSkZGZwHctPxu4SqReanDccRhuO8XXoHuF8SSaHghW8fsC629QtvtdJR9SpBePbAR+Xn6yGW5e4n28BFizJwukcS1JfIqTsBi4XWtD7pD+67TMIPQ179FgOm5iglZMUq//1xDqVH6WV7MExGbtHegOUjDNfNcvtjKs3Fu/SXxNQW+iYNtFn2inLQ0xW+T6uCpUIP2K/w9YAlFGghyiADNOX
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(39860400002)(136003)(346002)(451199021)(40470700004)(36840700001)(46966006)(54906003)(2906002)(478600001)(26005)(41300700001)(86362001)(6486002)(33656002)(6862004)(8936002)(8676002)(5660300002)(36756003)(316002)(40460700003)(70586007)(70206006)(4326008)(6512007)(53546011)(6506007)(82740400003)(356005)(40480700001)(81166007)(2616005)(186003)(83380400001)(82310400005)(336012)(107886003)(47076005)(36860700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 15:06:35.8421
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 52c9ca3d-468e-4831-b9b2-08db7ca042ba
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT048.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7335

Hi Julien,

> On 19 Jun 2023, at 19:01, Julien Grall <julien@xen.org> wrote:
>=20
> From: Julien Grall <jgrall@amazon.com>
>=20
> The implementation of write_pte() is pretty much the same on arm32
> and arm64. So it would be good to consolidate it as this would help
> to clarify the requirements when using the helper.
>=20
> Take the opportunity to switch from assembly to call macros. Note there
> is a difference on arm32 because the option was not specified. But this
> meant 'sy' (system wide).
>=20
> Futhermore, the requirements for the ISB is incomplete. Per the Arm Arm,
> (Armv7 DDI406C.d A3.8.3 and Armv8 DDI 0487J.a B2.3.12), DSB will only
> affect explicit accesses. So an ISB is necessary after DSB to ensure
> the completion. Having an ISB after each update to the page-tables is
> probably too much, so let the caller add the instruction when it is
> convenient.
>=20
> Lastly, the barrier in write_pte() may be too restrictive but I haven't
> yet find the proper section(s) in the Arm Arm.

I do not think we will find any proper section for that in the Arm Arm as i=
t
depends on use cases.
In ours we might have the page table shared among cores so I think system
is the way to go.

>=20
> Signed-off-by: Julien Grall <jgrall@amazon.com>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ----
>=20
> I am a bit split on whether we should add an ISB in write_pte(). It
> would make easier for the developper, but would likely force a pipeline
> flush too often.
>=20
> It might also be possible to drop the ISB (and even DSB) when updating
> stage-2 PTE (Linux already does it, see 120798d2e7d1). But I am not sure
> this is worth it in Xen.
> ---
> xen/arch/arm/include/asm/arm32/page.h | 16 ----------------
> xen/arch/arm/include/asm/arm64/page.h | 11 -----------
> xen/arch/arm/include/asm/page.h       | 17 +++++++++++++++++
> 3 files changed, 17 insertions(+), 27 deletions(-)
>=20
> diff --git a/xen/arch/arm/include/asm/arm32/page.h b/xen/arch/arm/include=
/asm/arm32/page.h
> index 715a9e4fef48..6d1ff0636ce3 100644
> --- a/xen/arch/arm/include/asm/arm32/page.h
> +++ b/xen/arch/arm/include/asm/arm32/page.h
> @@ -3,22 +3,6 @@
>=20
> #ifndef __ASSEMBLY__
>=20
> -/* Write a pagetable entry.
> - *
> - * If the table entry is changing a text mapping, it is responsibility
> - * of the caller to issue an ISB after write_pte.
> - */
> -static inline void write_pte(lpae_t *p, lpae_t pte)
> -{
> -    asm volatile (
> -        /* Ensure any writes have completed with the old mappings. */
> -        "dsb;"
> -        /* Safely write the entry (STRD is atomic on CPUs that support L=
PAE) */
> -        "strd %0, %H0, [%1];"
> -        "dsb;"
> -        : : "r" (pte.bits), "r" (p) : "memory");
> -}
> -
> /* Inline ASM to invalidate dcache on register R (may be an inline asm op=
erand) */
> #define __invalidate_dcache_one(R) STORE_CP32(R, DCIMVAC)
>=20
> diff --git a/xen/arch/arm/include/asm/arm64/page.h b/xen/arch/arm/include=
/asm/arm64/page.h
> index 0cba2663733b..4f58c0382adc 100644
> --- a/xen/arch/arm/include/asm/arm64/page.h
> +++ b/xen/arch/arm/include/asm/arm64/page.h
> @@ -5,17 +5,6 @@
>=20
> #include <asm/alternative.h>
>=20
> -/* Write a pagetable entry */
> -static inline void write_pte(lpae_t *p, lpae_t pte)
> -{
> -    asm volatile (
> -        /* Ensure any writes have completed with the old mappings. */
> -        "dsb sy;"
> -        "str %0, [%1];"         /* Write the entry */
> -        "dsb sy;"
> -        : : "r" (pte.bits), "r" (p) : "memory");
> -}
> -
> /* Inline ASM to invalidate dcache on register R (may be an inline asm op=
erand) */
> #define __invalidate_dcache_one(R) "dc ivac, %" #R ";"
>=20
> diff --git a/xen/arch/arm/include/asm/page.h b/xen/arch/arm/include/asm/p=
age.h
> index e7cd62190c7f..ea96983ab976 100644
> --- a/xen/arch/arm/include/asm/page.h
> +++ b/xen/arch/arm/include/asm/page.h
> @@ -126,6 +126,7 @@
> #include <xen/errno.h>
> #include <xen/types.h>
> #include <xen/lib.h>
> +#include <asm/atomic.h>
> #include <asm/system.h>
>=20
> #if defined(CONFIG_ARM_32)
> @@ -237,6 +238,22 @@ static inline int clean_and_invalidate_dcache_va_ran=
ge
>             : : "r" (_p), "m" (*_p));                                   \
> } while (0)
>=20
> +/*
> + * Write a pagetable entry.
> + *
> + * It is the responsibility of the caller to issue an ISB (if a new entr=
y)
> + * or a TLB flush (if modified or removed) after write_pte().
> + */
> +static inline void write_pte(lpae_t *p, lpae_t pte)
> +{
> +    /* Ensure any writes have completed with the old mappings. */
> +    dsb(sy);
> +    /* Safely write the entry. This should always be an atomic write. */
> +    write_atomic(p, pte);
> +    dsb(sy);
> +}
> +
> +
> /* Flush the dcache for an entire page. */
> void flush_page_to_ram(unsigned long mfn, bool sync_icache);
>=20
> --=20
> 2.40.1
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 15:08:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 15:08:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558488.872634 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhdA-0007EK-MH; Tue, 04 Jul 2023 15:07:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558488.872634; Tue, 04 Jul 2023 15:07:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhdA-0007ED-IX; Tue, 04 Jul 2023 15:07:52 +0000
Received: by outflank-mailman (input) for mailman id 558488;
 Tue, 04 Jul 2023 15:07:51 +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
 <SRS0=kGqQ=CW=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qGhd9-0007Dw-Bc
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 15:07:51 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on061e.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::61e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 89633b69-1a7c-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 17:07:48 +0200 (CEST)
Received: from DUZPR01CA0054.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:469::10) by DU0PR08MB9418.eurprd08.prod.outlook.com
 (2603:10a6:10:421::17) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 15:07:44 +0000
Received: from DBAEUR03FT059.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:469:cafe::b2) by DUZPR01CA0054.outlook.office365.com
 (2603:10a6:10:469::10) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.30 via Frontend
 Transport; Tue, 4 Jul 2023 15:07:44 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT059.mail.protection.outlook.com (100.127.142.102) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.18 via Frontend Transport; Tue, 4 Jul 2023 15:07:43 +0000
Received: ("Tessian outbound e2424c13b707:v142");
 Tue, 04 Jul 2023 15:07:43 +0000
Received: from c0e9f1f422c8.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 003ECCB4-2662-4C60-9CE2-388EF62B9B1E.1; 
 Tue, 04 Jul 2023 15:07:37 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c0e9f1f422c8.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 04 Jul 2023 15:07:37 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by DBBPR08MB5961.eurprd08.prod.outlook.com (2603:10a6:10:203::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 15:07:35 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::5e17:39a6:eec7:c482%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 15:07:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 89633b69-1a7c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=kZ9n2SLEFfFbZqCFLUdAAKLUSzQfFzQj04NveNWSbto=;
 b=NvzxOigJrrQr8WLdECho050ezlCmrEk0TpZSikGLaFzIJSGCTItZUOs4EpPAx26ny8/yv5pQ7t186cypenXvfsYvoCqkfn4VEpoHbEqOuaf5BGsliKb8WAOM5YGF/aBU6wLVWo7CDzuNDKBVFlTMnobAuSwyF014yDM/UtOCwN8=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: b3f8b296c4d158d3
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=QEn3F3jeMgIoZ8f41tXbsYpr2X0ec2PnnIe+MM2+Q1xg+QTnwN7TppoRL6024d/NeHojfkX78NukNgAf6LsSYMp+2q6Lg1kgmgtD8hc/HdAJoRn3kb0HBrPeUCylwXmCFUxEvAGW49bGq9c+ji/PTHFZrty1gJz9trA7wQkuCMJjfZwvq7gAntUeW2+TZzV40KBI3wxPY5Aubp59UIe+Q7M4yeOSQhkZTUr7y9eoXql2OZba4a996KUI/2KEoant/ibWjG/aOqtNEWcfh3H6cL/M2f92yzqbXEIwltILLpUtNtrSCJIIGXKnhl+OwJ7TGmPySvTajT0y3uB7G0Kv0A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=kZ9n2SLEFfFbZqCFLUdAAKLUSzQfFzQj04NveNWSbto=;
 b=X/s8aN9GRgLbWQyD1Nh9r51lbHJ2zeLnbImWbl6O9EUFPu+bH0Fnien4LMdO8CCiDsajPUbMhrVSU3tvWmOkl1oujvTHizmayVPouvk0AlEmrh0mBy2EwNEDw7pxeneQjwQmPcPzNBjd5JuOJV8yvjiNqRooS4fyPMqz/K2HsMO2fC9kfQKSQn4UtgO7cjX/ani8cMH3WuYZ9ifG8A64js/k00nqmNhWI1qqFp0vi22B8Ch0K84gkmaey6RUaoCIVgcm8XiIm+ZnLhfZxbheVQxrymRyQvVmcdaYNTp52K2myKP7jCl8H9vvT4GoxBLEN9LmeE7HfepzWWlAFm//Rw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=kZ9n2SLEFfFbZqCFLUdAAKLUSzQfFzQj04NveNWSbto=;
 b=NvzxOigJrrQr8WLdECho050ezlCmrEk0TpZSikGLaFzIJSGCTItZUOs4EpPAx26ny8/yv5pQ7t186cypenXvfsYvoCqkfn4VEpoHbEqOuaf5BGsliKb8WAOM5YGF/aBU6wLVWo7CDzuNDKBVFlTMnobAuSwyF014yDM/UtOCwN8=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Luca Fancellu
	<Luca.Fancellu@arm.com>, Michal Orzel <michal.orzel@amd.com>, Henry Wang
	<Henry.Wang@arm.com>, Julien Grall <jgrall@amazon.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH 7/7] xen/arm32: head: Widen the use of the temporary
 mapping
Thread-Topic: [PATCH 7/7] xen/arm32: head: Widen the use of the temporary
 mapping
Thread-Index: AQHZos+8ihLpFUQE50qML8qllPzK9a+pzNoA
Date: Tue, 4 Jul 2023 15:07:34 +0000
Message-ID: <47AF0004-BA7D-4C7B-B5F5-DBD7E53D3CC0@arm.com>
References: <20230619170115.81398-1-julien@xen.org>
 <20230619170115.81398-8-julien@xen.org>
In-Reply-To: <20230619170115.81398-8-julien@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|DBBPR08MB5961:EE_|DBAEUR03FT059:EE_|DU0PR08MB9418:EE_
X-MS-Office365-Filtering-Correlation-Id: 29c48eed-a753-45a9-af26-08db7ca06b4c
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 LT350dYF4wv4BQQq8N77g8LCc2Nk4GuX+yXSyR2ZSpGdiV21XF730MIx7DxuFE24CsC424tAXYpAyuR+v7DyAebd+Cn8Ai3M9oVwegoDQljZ/e+EhyVBx0+ClVRFlhIHyL3HAP2KuVtD+xA31khW8xCZK6RyCZeenHRur6M+mf1BLI+6XAwsM9LQ8pmj0gpmrPUYRblzE7pOT/JSWyXO9RqlwXHWkzV7kMx1fqyxwvSE/3ocR4XQXvuiFQ7JwT1Zy8hdcIm1M7GV8SnFld9TwLqf2G8dlHM0LsR0IfRVA3rZUFmKHY0sKHOXkiI41spm5emNgStmPkKKlYqUSmqtIbQoqg65m9ijRyx4uUZ7SRdrJBGtfJCd7/+Tn6Tc+pCTF5UnfCRw6ILPSScZw1h14bII6FKjg25R/Day4UNZulTyq4hXuQWkPnvqnuuEgzPaiUIyLgOV/z1eaRW6rvAvTnrga9y0R1pCftQX2h04W+ElvZHC/mmIMr9hbvn2nyShjWCNzQXpvRUO8mfdEy2Y/wFR94cjRHV/CLO/RZ+wRm0QFOeL2pUvJCEulFCovwHL3/OCSXzq0UE/+n9qbi8EApTDtrmgXq/9e7K63E9vuCPnqhJuezbggqfgmWxC36jfvGSP2bCrGYT96weBERiwdA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(396003)(346002)(366004)(136003)(451199021)(38100700002)(33656002)(2906002)(71200400001)(6486002)(8936002)(38070700005)(8676002)(54906003)(36756003)(41300700001)(5660300002)(478600001)(76116006)(6916009)(66946007)(66556008)(66476007)(64756008)(53546011)(91956017)(66446008)(6512007)(186003)(6506007)(86362001)(4326008)(316002)(966005)(2616005)(122000001)(83380400001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <219EF33B08E60242B906872E177C0963@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB5961
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT059.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	888ac3f6-07cc-44e2-3e58-08db7ca065e3
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	RFqTeaKI9lHQT/9kllU+UquY9rRHERqASyuhI0N6HolC7UsfpzR3xh5aDZ6x9uAPZg1mMV44+/OF9QVPmrhMo8gIKJWJyHZ6L3R2wQstUpSihmTDmNzrGC5YMKbSWbMEc1oQruPAZXqIhU0jloGxPwEiPXZsTEihXVuYX0RL1ub63POyAoL/9j5H12TEjKRKZehH3/9YoPMr991RcYWacFowa3EYUcEw02ooxQaR/FNvFnvLlKui6FUO2UBP1XaYbUjw0Jv6DVSOoH9ZW47q16ow4DJA3B2dI9xB8EtpzSCVSfrySSkia4ZSpAFHrQfBo6xl9cGpN5b0k+ww11QyEwWs3H9tnIuI0g2swGa9z7xz5g1OSBjPcIWJB1E6h2sjG0E+isH1bWtFBS7LyAizLAxiLRWXejsk7LbGkI9yBZGcDURB84i4zcWAbKKbmWMXtQQRSQwrX2PsvC2nmrmS4GU3s1p2vdSsLPX0zbCA96lJxblClFGlIMeCtSLTGtXmqZJ841XKnMI8G+s0RLSU1dVwidTG2DH/2JRd0G+pcATg/N/3WMS+dUTYlo2LjW7tOf7UgXYMuVHCgYqlEEDUu7fUqp4AhpdI2KaGv5HRxKBG9RV3nfSzB0xFw8+vwrLWFmbNKWpEqB0Fkb4T8PRyCeYQ1nDD1zfZIqd4FKDCgkO5WTzCYkqG4WQpvucDB0vreiq69kHb4jSzs/7lM+sMZcPTOeawz5vRrXbfVLgBpAU=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(376002)(396003)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(4326008)(316002)(86362001)(186003)(70206006)(70586007)(26005)(6512007)(47076005)(6506007)(53546011)(107886003)(82740400003)(83380400001)(81166007)(966005)(2616005)(356005)(2906002)(6486002)(33656002)(36860700001)(5660300002)(336012)(478600001)(6862004)(8676002)(54906003)(40480700001)(40460700003)(82310400005)(8936002)(41300700001)(36756003);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 15:07:43.9700
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 29c48eed-a753-45a9-af26-08db7ca06b4c
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT059.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9418

Hi Julien,

> On 19 Jun 2023, at 19:01, Julien Grall <julien@xen.org> wrote:
>=20
> From: Julien Grall <jgrall@amazon.com>
>=20
> At the moment, the temporary mapping is only used when the virtual
> runtime region of Xen is clashing with the physical region.
>=20
> In follow-up patches, we will rework how secondary CPU bring-up works
> and it will be convenient to use the fixmap area for accessing
> the root page-table (it is per-cpu).
>=20
> Rework the code to use temporary mapping when the Xen physical address
> is not overlapping with the temporary mapping.
>=20
> This also has the advantage to simplify the logic to identity map
> Xen.
>=20
> Signed-off-by: Julien Grall <jgrall@amazon.com>
> Reviewed-by: Henry Wang <Henry.Wang@arm.com>
> Reviewed-by: Michal Orzel <michal.orzel@amd.com>

Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

>=20
> ----
>=20
> This patch was originally part of [1] but it was reverted due to
> Xen not booting on the Arndale. The first patch of this series
> is fixing it (confirmed by booting on the Arndale). So I am including
> this patch. Also all the tags but the tested-by have been kept
> because the code has not changed. Happy to drop any if there are
> any concerns.
>=20
> [1] https://lore.kernel.org/xen-devel/20230416143211.72227-1-julien@xen.o=
rg/
>=20
> Changelog from the previous series:
>=20
>    Changes in v6:
>        - Add Henry's reviewed-by and tested-by tag
>        - Add Michal's reviewed-by
>        - Add newline in remove_identity_mapping for clarity
>=20
>    Changes in v5:
>        - Fix typo in a comment
>        - No need to link boot_{second, third}_id again if we need to
>          create a temporary area.
>=20
>    Changes in v3:
>        - Resolve conflicts after switching from "ldr rX, <label>" to
>          "mov_w rX, <label>" in a previous patch
>=20
>    Changes in v2:
>        - Patch added
> ---
> xen/arch/arm/arm32/head.S | 86 ++++++++-------------------------------
> 1 file changed, 16 insertions(+), 70 deletions(-)
>=20
> diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
> index b942e7e54d08..d70e856ab7dd 100644
> --- a/xen/arch/arm/arm32/head.S
> +++ b/xen/arch/arm/arm32/head.S
> @@ -459,7 +459,6 @@ ENDPROC(cpu_init)
> create_page_tables:
>         /* Prepare the page-tables for mapping Xen */
>         mov_w r0, XEN_VIRT_START
> -        create_table_entry boot_pgtable, boot_second, r0, 1
>         create_table_entry boot_second, boot_third, r0, 2
>=20
>         /* Setup boot_third: */
> @@ -479,70 +478,37 @@ create_page_tables:
>         cmp   r1, #(XEN_PT_LPAE_ENTRIES<<3) /* 512*8-byte entries per pag=
e */
>         blo   1b
>=20
> -        /*
> -         * If Xen is loaded at exactly XEN_VIRT_START then we don't
> -         * need an additional 1:1 mapping, the virtual mapping will
> -         * suffice.
> -         */
> -        cmp   r9, #XEN_VIRT_START
> -        moveq pc, lr
> -
>         /*
>          * Setup the 1:1 mapping so we can turn the MMU on. Note that
>          * only the first page of Xen will be part of the 1:1 mapping.
> -         *
> -         * In all the cases, we will link boot_third_id. So create the
> -         * mapping in advance.
>          */
> +        create_table_entry boot_pgtable, boot_second_id, r9, 1
> +        create_table_entry boot_second_id, boot_third_id, r9, 2
>         create_mapping_entry boot_third_id, r9, r9
>=20
>         /*
> -         * Find the first slot used. If the slot is not XEN_FIRST_SLOT,
> -         * then the 1:1 mapping will use its own set of page-tables from
> -         * the second level.
> +         * Find the first slot used. If the slot is not the same
> +         * as TEMPORARY_AREA_FIRST_SLOT, then we will want to switch
> +         * to the temporary mapping before jumping to the runtime
> +         * virtual mapping.
>          */
>         get_table_slot r1, r9, 1     /* r1 :=3D first slot */
> -        cmp   r1, #XEN_FIRST_SLOT
> -        beq   1f
> -        create_table_entry boot_pgtable, boot_second_id, r9, 1
> -        b     link_from_second_id
> -
> -1:
> -        /*
> -         * Find the second slot used. If the slot is XEN_SECOND_SLOT, th=
en the
> -         * 1:1 mapping will use its own set of page-tables from the
> -         * third level.
> -         */
> -        get_table_slot r1, r9, 2     /* r1 :=3D second slot */
> -        cmp   r1, #XEN_SECOND_SLOT
> -        beq   virtphys_clash
> -        create_table_entry boot_second, boot_third_id, r9, 2
> -        b     link_from_third_id
> +        cmp   r1, #TEMPORARY_AREA_FIRST_SLOT
> +        bne   use_temporary_mapping
>=20
> -link_from_second_id:
> -        create_table_entry boot_second_id, boot_third_id, r9, 2
> -link_from_third_id:
> -        /* Good news, we are not clashing with Xen virtual mapping */
> +        mov_w r0, XEN_VIRT_START
> +        create_table_entry boot_pgtable, boot_second, r0, 1
>         mov   r12, #0                /* r12 :=3D temporary mapping not cr=
eated */
>         mov   pc, lr
>=20
> -virtphys_clash:
> +use_temporary_mapping:
>         /*
> -         * The identity map clashes with boot_third. Link boot_first_id =
and
> -         * map Xen to a temporary mapping. See switch_to_runtime_mapping
> -         * for more details.
> +         * The identity mapping is not using the first slot
> +         * TEMPORARY_AREA_FIRST_SLOT. Create a temporary mapping.
> +         * See switch_to_runtime_mapping for more details.
>          */
> -        PRINT("- Virt and Phys addresses clash  -\r\n")
>         PRINT("- Create temporary mapping -\r\n")
>=20
> -        /*
> -         * This will override the link to boot_second in XEN_FIRST_SLOT.
> -         * The page-tables are not live yet. So no need to use
> -         * break-before-make.
> -         */
> -        create_table_entry boot_pgtable, boot_second_id, r9, 1
> -        create_table_entry boot_second_id, boot_third_id, r9, 2
> -
>         /* Map boot_second (cover Xen mappings) to the temporary 1st slot=
 */
>         mov_w r0, TEMPORARY_XEN_VIRT_START
>         create_table_entry boot_pgtable, boot_second, r0, 1
> @@ -680,33 +646,13 @@ remove_identity_mapping:
>         /* r2:r3 :=3D invalid page-table entry */
>         mov   r2, #0x0
>         mov   r3, #0x0
> -        /*
> -         * Find the first slot used. Remove the entry for the first
> -         * table if the slot is not XEN_FIRST_SLOT.
> -         */
> +
> +        /* Find the first slot used and remove it */
>         get_table_slot r1, r9, 1     /* r1 :=3D first slot */
> -        cmp   r1, #XEN_FIRST_SLOT
> -        beq   1f
> -        /* It is not in slot 0, remove the entry */
>         mov_w r0, boot_pgtable       /* r0 :=3D root table */
>         lsl   r1, r1, #3             /* r1 :=3D Slot offset */
>         strd  r2, r3, [r0, r1]
> -        b     identity_mapping_removed
> -
> -1:
> -        /*
> -         * Find the second slot used. Remove the entry for the first
> -         * table if the slot is not XEN_SECOND_SLOT.
> -         */
> -        get_table_slot r1, r9, 2     /* r1 :=3D second slot */
> -        cmp   r1, #XEN_SECOND_SLOT
> -        beq   identity_mapping_removed
> -        /* It is not in slot 1, remove the entry */
> -        mov_w r0, boot_second        /* r0 :=3D second table */
> -        lsl   r1, r1, #3             /* r1 :=3D Slot offset */
> -        strd  r2, r3, [r0, r1]
>=20
> -identity_mapping_removed:
>         flush_xen_tlb_local r0
>         mov   pc, lr
> ENDPROC(remove_identity_mapping)
> --=20
> 2.40.1
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 15:11:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 15:11:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558494.872644 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhgJ-0000Ki-9J; Tue, 04 Jul 2023 15:11:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558494.872644; Tue, 04 Jul 2023 15:11:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGhgJ-0000Kb-6J; Tue, 04 Jul 2023 15:11:07 +0000
Received: by outflank-mailman (input) for mailman id 558494;
 Tue, 04 Jul 2023 15:11:06 +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
 <SRS0=Gy6C=CW=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qGhgI-0000KV-4B
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 15:11:06 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on20626.outbound.protection.outlook.com
 [2a01:111:f400:7eaa::626])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fd52a637-1a7c-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 17:11:03 +0200 (CEST)
Received: from SN6PR12MB2621.namprd12.prod.outlook.com (2603:10b6:805:73::15)
 by IA1PR12MB6532.namprd12.prod.outlook.com (2603:10b6:208:3a3::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 15:10:59 +0000
Received: from SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54]) by SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54%2]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 15:10:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fd52a637-1a7c-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CJuWo5vFijYkGj5R4ChaPKhw7WOaH++tpUHGIqN3mBPUxiEE8QEAbPsAenJC6feQ0X8ypzMp8bEP+2YHnPBh0bJac62vOzIx7QcmvK8SF6F7AmB/S9NCYupeCMoaBhSQYwZBv4gdMwetl9KoSoTB+g9Zbm1cc7hE0Sjmj+lYH/U6gB+c8KstEq37wnLfHWorqLE/B1uurs54VHDUwzjIiS++OzruIfq77wV9n8y1SBp/V6Wb0U4bm25yHC3dOcCjoOizMbD8CcRowUKG+wAxjL96onfBqwQz4tP/5rLtjyCpbEf8QQz2dEwnqFqvxRvMYOb7yYxy3p00jiS6eW7ogw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=nOcm/RpHgjydAlWbSkr4gvYaSLUTD3uhqwiyKA7/TF0=;
 b=VtpE1i3eY/BbVc6jWGIRs61uEEIQ4QfpQrTpy+tgy2qo4WsU4utocZOvpQcBLrpzwULtcw3kStNGg3oicU+9u3xkRmMgBBNSDhjEtvcaZGHgBgfze5daJk6TlSa8fpyiEc1na1Z5bn7EgpBF07B2zPvaH9xSsK/WitEDmpCLl4Np7lJlqpY5zidiPzTw9Qnsb28pKoKeWV5cyqDfI5QkjHZsmTwui+Z797T9JWU/7u+2Fw1OR40KSOQx5P17eV5+SgdGr0sBu4N0KFEEZiLFjrKtdeZ2x2wQvf+xMMFaZxHZt1nqRanF/RbgRCmZcthxojX0oJkQuvZhrhyyESeL2A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=nOcm/RpHgjydAlWbSkr4gvYaSLUTD3uhqwiyKA7/TF0=;
 b=WcC0GcqK0ulyRQmPMdiduAAlC60BSto4Is7npuFIjvyeTOXJL/xPX3dJ8+kFnhrHHgpF7bDARjcxkt/91X/PBAlyAR5ANNRWOJ/XJS+Afc5ABCErzNOXuci8MYypoRvhDqatarbdPNRVkKeG4F/QjQjkOwGhEzmsZyc9AjMs8u4=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <16428e2d-423c-6a9c-5caa-6ff5770a840e@amd.com>
Date: Tue, 4 Jul 2023 16:10:52 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 35/52] xen/arm: map static memory on demand
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-36-Penny.Zheng@arm.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <20230626033443.2943270-36-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0077.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2bd::8) To SN6PR12MB2621.namprd12.prod.outlook.com
 (2603:10b6:805:73::15)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN6PR12MB2621:EE_|IA1PR12MB6532:EE_
X-MS-Office365-Filtering-Correlation-Id: 36f35e63-7811-4f91-2183-08db7ca0df89
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	QTOuQqnIH0/u/N5tj2BArR/pwwQG4GyUuE96fJRDrJNssLgvII23aI2r86/A7of81RqpcupqKjXDq7EMa/nCKxN5ANumRjnBrQ+75ud/QgPPTUwPKf1PeyFkxv7H5x1CUchtiN36iEM+zXMp4r2iuT/Jq5JXC5HH2lV7OCY1JMlZKfywjjaFE+FHs8Gf/3+DFD2a0rlwa81k8q9PQ7ndqo1cVTbsnhFSze9xi072Y5VOrY3SGfBAxFYHvPtFiccASxwLu4epth66xncqrrl7oNO7ONMYrDb7dmZW1/3cLxKQcBLU2oKwyc7/2sOolyEqSp7PFeU+ICs8l4NvJOUXhDZedN3E5YUZvUAH6MEGklIWBvnfaxv9jwxvkkV4rzcVPC4gtus4bEy1xBnITcRjpJLdwGU+XCbWmTvHEFCzmzpwSotZW1OUAE0hx4AmF8uJygAkh4jrFkH4OeA7P/w+N8S9+BzRI0SD9xcO5bOGIxMrt4OX0h5AbIq2V0F/EMy0QvWCeJrvVEjG+QCq+XpnULu0QWIkb+48EGgRWjKH09IJkA1dchYqalQxRiZ+a6AjHuD5z5ZfnWTnGkqYDZgtspbcN1nbrhRCgyEOcFZ32o9wBPpBI5ss0EZjBOPZUqoY0pdGQ6KJbYGSS4Lxe/UO8A==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2621.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(366004)(376002)(396003)(39860400002)(451199021)(4326008)(31686004)(316002)(66946007)(66556008)(186003)(31696002)(26005)(6512007)(66476007)(6506007)(53546011)(83380400001)(2616005)(2906002)(6486002)(6666004)(38100700002)(5660300002)(478600001)(8676002)(54906003)(8936002)(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f-8?B?djM3dFlkenhXbVczTWw2U1dPYUp3VnRoOU4yTmpldTNhenBQRGQvQXhhRVJZ?=
 =?utf-8?B?Ykl1OWx2aUtad3YrZ3ZJV3dzOVZYWXJsMDdZcS9UWHhRZTZnaCtnL3A0RkhK?=
 =?utf-8?B?Z0gybzVjRE1kVTdRbGwwVUtUaCs3bDBabHZnM21xTFQ4c1FTcXdvOHZuY2dV?=
 =?utf-8?B?RkhzRGd5MUR4ZmZ6Ujd5Njd4L0tJSURmc1ZQWC9NZUtoRmYyL2hxYS96cHVB?=
 =?utf-8?B?azJtNWZoM0RYTmhiS1lWU0MzL3lCaEliK011U3F4V1RDUy9DM1FMRlo3NDdr?=
 =?utf-8?B?TzN1ano3RllIc2RnVW53c0VlM0E1NCtmSjVnKzZQbWV6bmxDWEw3ZjlxdWpJ?=
 =?utf-8?B?VGVHNXVSWjRnb0VHMnBDdGVYR0g2Y054Y2JieFFCR3V4YWlCTW9xclBCZ1JX?=
 =?utf-8?B?bUVaanRjYThjOTB0c1hVbmFGWEVjSEkrelJYVllTcUdzRXVTcy9NRGc1QzZ2?=
 =?utf-8?Q?dZ7anFNUcXqIBMKXqXMZYqS+X?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 36f35e63-7811-4f91-2183-08db7ca0df89
X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2621.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 15:10:59.2218
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: gC5Z0wbvbTinewn9YBBgeCp4H7rRc28J11REK5yDkUojAv6M1fqI1EqkTLN5yCPZvaNrgyk3/idcX6cmnF/0mQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6532

Hi Penny,

On 26/06/2023 04:34, Penny Zheng wrote:
> CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
>
>
> In function init_staticmem_pages, we need the access to static memory
> for proper initialization.
> It is not a problem in MMU system, as Xen map the whole RAM in
> setup_mm(). However, with limited MPU memory regions, it is too luxury
> to map the whole RAM.
> As a result, we follow the rule of "map on demand", to map static memory
> temporarily before its initialization, and unmap immediately after its
> initialization.

I could see that you are using _PAGE_TRANSIENTÂ  to map memory 
temporarily. However, I don't see this being translated to any of the 
MPU hardware features (ie _PAGE_TRANSIENT does not seem to translate to 
any of the attributes in PRBAR, PRLAR, PRENR, etc). Thus, how is it 
different from mapping the memory in "non temporary" way ?

Please let me know what I am missing.

- Ayan

>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> ---
> v3:
> - new commit
> ---
>   xen/arch/arm/include/asm/mm.h |  2 ++
>   xen/arch/arm/mmu/mm.c         | 10 ++++++++++
>   xen/arch/arm/mpu/mm.c         | 10 ++++++++++
>   xen/arch/arm/setup.c          | 21 +++++++++++++++++++++
>   4 files changed, 43 insertions(+)
>
> diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
> index 66d98b9a29..cffbf8a595 100644
> --- a/xen/arch/arm/include/asm/mm.h
> +++ b/xen/arch/arm/include/asm/mm.h
> @@ -224,6 +224,8 @@ extern void mm_init_secondary_cpu(void);
>   extern void setup_frametable_mappings(paddr_t ps, paddr_t pe);
>   /* map a physical range in virtual memory */
>   void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned int attributes);
> +extern int map_staticmem_pages_to_xen(paddr_t start, paddr_t end);
> +extern int unmap_staticmem_pages_to_xen(paddr_t start, paddr_t end);
>
>   static inline void __iomem *ioremap_nocache(paddr_t start, size_t len)
>   {
> diff --git a/xen/arch/arm/mmu/mm.c b/xen/arch/arm/mmu/mm.c
> index 2f29cb53fe..4196a55c32 100644
> --- a/xen/arch/arm/mmu/mm.c
> +++ b/xen/arch/arm/mmu/mm.c
> @@ -1113,6 +1113,16 @@ int populate_pt_range(unsigned long virt, unsigned long nr_mfns)
>       return xen_pt_update(virt, INVALID_MFN, nr_mfns, _PAGE_POPULATE);
>   }
>
> +int __init map_staticmem_pages_to_xen(paddr_t start, paddr_t end)
> +{
> +    return 0;
> +}
> +
> +int __init unmap_staticmem_pages_to_xen(paddr_t start, paddr_t end)
> +{
> +    return 0;
> +}
> +
>   /*
>    * Local variables:
>    * mode: C
> diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
> index a40055ae5e..9d5c1da39c 100644
> --- a/xen/arch/arm/mpu/mm.c
> +++ b/xen/arch/arm/mpu/mm.c
> @@ -614,6 +614,16 @@ void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
>              frametable_size - (nr_pdxs * sizeof(struct page_info)));
>   }
>
> +int __init map_staticmem_pages_to_xen(paddr_t start, paddr_t end)
> +{
> +    return xen_mpumap_update(start, end, PAGE_HYPERVISOR | _PAGE_TRANSIENT);
> +}
> +
> +int __init unmap_staticmem_pages_to_xen(paddr_t start, paddr_t end)
> +{
> +    return xen_mpumap_update(start, end, 0);
> +}
> +
>   /*
>    * Local variables:
>    * mode: C
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index f42b53d17b..c21d1db763 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -637,12 +637,33 @@ void __init init_staticmem_pages(void)
>               mfn_t bank_start = _mfn(PFN_UP(bootinfo.reserved_mem.bank[bank].start));
>               unsigned long bank_pages = PFN_DOWN(bootinfo.reserved_mem.bank[bank].size);
>               mfn_t bank_end = mfn_add(bank_start, bank_pages);
> +            int res;
>
>               if ( mfn_x(bank_end) <= mfn_x(bank_start) )
>                   return;
>
> +            /* Map temporarily before initialization */
> +            res = map_staticmem_pages_to_xen(mfn_to_maddr(bank_start),
> +                                             mfn_to_maddr(bank_end));
> +            if ( res )
> +            {
> +                printk(XENLOG_ERR "Failed to map static memory to Xen: %d\n",
> +                       res);
> +                return;
> +            }
> +
>               unprepare_staticmem_pages(mfn_to_page(bank_start),
>                                         bank_pages, false);
> +
> +            /* Unmap immediately after initialization */
> +            res = unmap_staticmem_pages_to_xen(mfn_to_maddr(bank_start),
> +                                               mfn_to_maddr(bank_end));
> +            if ( res )
> +            {
> +                printk(XENLOG_ERR "Failed to unmap static memory to Xen: %d\n",
> +                       res);
> +                return;
> +            }
>           }
>       }
>   #endif
> --
> 2.25.1
>
>


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 15:32:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 15:32:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558498.872654 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGi0x-0002sL-Ug; Tue, 04 Jul 2023 15:32:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558498.872654; Tue, 04 Jul 2023 15:32:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGi0x-0002sE-Qs; Tue, 04 Jul 2023 15:32:27 +0000
Received: by outflank-mailman (input) for mailman id 558498;
 Tue, 04 Jul 2023 15:32:26 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGi0w-0002s4-Fe; Tue, 04 Jul 2023 15:32:26 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGi0w-00034T-4u; Tue, 04 Jul 2023 15:32:26 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGi0v-0005Mh-Ls; Tue, 04 Jul 2023 15:32:25 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qGi0v-00089r-LJ; Tue, 04 Jul 2023 15:32:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=fk9t+p03b2vrOxtPsWe1Bs1s1OnPjpfLFxOqaVImVGQ=; b=KueaMHPaIMFoQciC5l0sfJOeok
	HLhKgw2mJjzSAf0tIyzLD2VWiH+imHM6lGmGDZmWrt+ffhmp1GmOpHvHka6vD2oVZIZcD/aTzFUy5
	k1yWoZCQ+OmUFYbxGfnihJuTyN3PrGKy/pETZP6yiPQ51IAKNXkD/ZEy5Jo0U5IkHfmQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181691-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 181691: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=cd4bdcb8cf5bad7ea9884d66de9a6f2e654a5f7d
X-Osstest-Versions-That:
    libvirt=7f1562a7397b789f6d540f0010405d089426a5a4
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 04 Jul 2023 15:32:25 +0000

flight 181691 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181691/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181667
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181667
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181667
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 libvirt              cd4bdcb8cf5bad7ea9884d66de9a6f2e654a5f7d
baseline version:
 libvirt              7f1562a7397b789f6d540f0010405d089426a5a4

Last test of basis   181667  2023-07-01 04:18:48 Z    3 days
Testing same since   181691  2023-07-04 04:20:28 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrea Bolognani <abologna@redhat.com>
  Jiri Denemark <jdenemar@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   7f1562a739..cd4bdcb8cf  cd4bdcb8cf5bad7ea9884d66de9a6f2e654a5f7d -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 15:39:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 15:39:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558504.872663 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGi7R-0003WQ-Jq; Tue, 04 Jul 2023 15:39:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558504.872663; Tue, 04 Jul 2023 15:39:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGi7R-0003WJ-HI; Tue, 04 Jul 2023 15:39:09 +0000
Received: by outflank-mailman (input) for mailman id 558504;
 Tue, 04 Jul 2023 15:39:08 +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 <SRS0=D/z2=CW=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGi7Q-0003WD-9T
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 15:39:08 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on20620.outbound.protection.outlook.com
 [2a01:111:f400:fe13::620])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e8ba58bb-1a80-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 17:39:06 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB7733.eurprd04.prod.outlook.com (2603:10a6:20b:288::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 15:39:03 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 15:39:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e8ba58bb-1a80-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=HeXbFAI7YI7FdIKyOXo/rpCLLePIt+zeCnq1yR8oaXq2Ve0OPb8KuLFVu2iTaZ+KH76yyqZjJUrptS5qo3eJI8bLZFoWr6/0u/QrSZ6QPgLYbQvs5158SLyd+1SCIWhTWdBPNVdmEMIKvQC8s1Hgh5ZAgBkuJzRdz0McbAkChhlH5hhwfo0xhU/xD5ramP9TJu+SLUshJ3mRtZ2mubL2YWylR35yBMR3uJcunmZ22t4ZrY0gyUM8hY0JmP5bhj2i0QFVjULiP61FfheUOSYHSdcCQvIUnskeM6fas3WGe/h/fpj8ZnGLvqY6ROMOjZaOEN4Ho8y989+jHyatXa6JEg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=q7zz3Rsy8pxP/JX0TStDJWFtTNM4S9ARPkklH004b2Q=;
 b=VD7/fmDZA2vBrtqWzDR0j7Jn8IkKvuI+fZLr7QQNpbKWledEDIvMtdQ5i1OayXXnMkhF/GaxZR4W8kL8VSPTAsaj23cpfbN0Tn7rfHdafSi+d0c9U4m8C7tFjamnsJnwFTt9L6tDXs9sdvwVWh1WOzkyNqHRLNCBxtFGdPhmt/DQlAP589GIicuTgTeqU8Cv/IuoKfKRjifSGP4ajkJ+/OPmuxrydQ6B5Ta5c40ofBdDyV2wt0U3jblGfxPVdK3Syjo9o60XMM5ukxd4Bixi3UEesDWrwrHr3aH71EFUlS3AWRggBiHdrZPxZcRlF43yfNg+YbkjRJUcoZlTsIfV0Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=q7zz3Rsy8pxP/JX0TStDJWFtTNM4S9ARPkklH004b2Q=;
 b=KlXvQdAVYkKRLiOwleLc3AeT7ktmqoSZzjVKk1NVJ5xYTlH6bEswVY+/WHuDn0DKsAb6HOx7aUZls6o7GyK5FHHLwMhssPhAhsu5S4cngDRz9lJ1J0jA0hULyLKokdXcVcpxET58sdmRmXv6hgEnyR3Er7kYqenXqSAb7vtERkbcvKozv+WATamDmTIXNQz90Tsn/hGl3EjKXiehZAivlQfuME/fDHshuMVNJA31FPCr3pgcVG6GKCdRbLDnFAbNPezYsZgZviMKQhsrUeFhxSZiCRl7KJUCdQ3R9eweQ1NflTkSiez5XY2HNVnMuENwMqPbHh3VN5TZHP3I7ouRTg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <bff9074d-0345-2931-c57b-3acda238a9b5@suse.com>
Date: Tue, 4 Jul 2023 17:39:10 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: xen | Failed pipeline for staging | 9dd3caf1
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <649eeb9f5347_281f686f427353e@gitlab-sidekiq-catchall-v2-54666fdc77-xrbls.mail>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <649eeb9f5347_281f686f427353e@gitlab-sidekiq-catchall-v2-54666fdc77-xrbls.mail>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FRYP281CA0008.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::18)
 To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB7733:EE_
X-MS-Office365-Filtering-Correlation-Id: e4f222d9-1c47-4121-f9c0-08db7ca4cbae
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	y8VpYnzI0bjVrcT44PKiuWJnKME2ubv/H6RRL/oGAxQjdKHYpDNRVaiyZ16yMv0M01fVu6iajogCZdp+2iTafgAYN3f1xY6i8NdbSJi2ImbavmHhlySCm3HBQHkRp+NCaXly2pCdWS7sfMRY3aA478byZB9KyicU7w2sLoZlw3ywykaKFAfHmdXOdTPbbqDK63thAQbEgto2U0IiOXFpVvmZA6X9g1MAndwRmEaQ1EnQs2VQmb5DV+RiNK8ecnh0gHGmalvEEM+aXBx6M5mfH1G+0prRW0kTujgUffH06dnbpF+irLrr6kcQ+3h7ha0YkW01Tp4wxzkyv+7+xrtQ3r0yQ4F8TrTVo6ILOpAc/trRLGzctgOwICHYXg4t39EEL6aTCyv0AbIRxZDjVO5te0j/LWsecldLOm718x6szZTkZZL9OXAgWXEp++IhZuK2QX50dHXQsDn49+K4Fe2kIE7E9lPr8xuMw/aO7H3ax5HiK9p+YvFHAhU9soTMJ9u07B7YL87OulUojwZ0h6ckqZeI9mZk+ZsLK7V0j/Dcp0ad0MLSQyPuMISKuSVrwJqycU6PagOCX8Ov+NeJ/68ASI1jtmeYUtzsBa1Hl1i3L3XePwQp6bcNuWMKfMgZXCUM2MHu/HpO4U1J02Ju7/VDIbFmBGYGS8ykaDUNItVN1eS3zWOTaH+2Yqk1F4rSltuE
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(366004)(136003)(396003)(39860400002)(376002)(451199021)(2906002)(478600001)(6666004)(6486002)(966005)(316002)(5660300002)(41300700001)(8676002)(8936002)(6916009)(66946007)(66476007)(66556008)(83380400001)(36756003)(2616005)(86362001)(31686004)(31696002)(38100700002)(26005)(6506007)(53546011)(6512007)(186003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?K1R2T1BzbzhIQlYyZjVMQ3UzK2hUNnJrYmE1OC9ScUorLytBdXI3WGFuOEQ0?=
 =?utf-8?B?N1Jpd0pWNFBxZ1hKREo5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c3FHK2tHMHR3ZXZBRXUzL3lSK21OZWUrV2RjcTRRaDdIMnhJ?=
 =?utf-8?B?WHhEYmNiOXlKaU1KSU1FYmYyN0ljZ2tiYWtuRDVVaU83RUcwL2EvNFVPZGhL?=
 =?utf-8?B?R3pnSWpzZGtBRW16QmxxR05NZ3ZWL2hvL21ndCt6cGpiMkl5YlFTV3YyY2tF?=
 =?utf-8?B?VEF6R0JuMkpHQ1hpZm1RQU5tek12SFNpcGw0SGRpRmxPbm1JRm9ReE84ZVBt?=
 =?utf-8?B?WmtVbWlKanJvYUs5Q2cxQ2dydXpsLy81dmh2Y1ZGaUhBclZpRW9PM1VzamRT?=
 =?utf-8?Q?Vr6rnTDt5oHLSNqxrTu8TAA8k?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e4f222d9-1c47-4121-f9c0-08db7ca4cbae
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 15:39:03.7856
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: GzACFzlU/vl6l5u90WEPMIiOy/xmeWp5FQQENZXEjEk/td5FlNULgYRnldTPPyGsBCeo6LC9/4AiuVGKrb9YaQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7733

On 30.06.2023 16:50, GitLab wrote:
> 
> 
> Pipeline #917215286 has failed!
> 
> Project: xen ( https://gitlab.com/xen-project/xen )
> Branch: staging ( https://gitlab.com/xen-project/xen/-/commits/staging )
> 
> Commit: 9dd3caf1 ( https://gitlab.com/xen-project/xen/-/commit/9dd3caf12f52b859947c260b1cb3a48b491d53b6 )
> Commit Message: {x86,arm}/mm.c: Make populate_pt_range __init
> 
> ...
> Commit Author: George Dunlap
> Committed by: George Dunlap
> 
> 
> Pipeline #917215286 ( https://gitlab.com/xen-project/xen/-/pipelines/917215286 ) triggered by Ganis ( https://gitlab.com/ganis )
> had 3 failed jobs.
> 
> Job #4573553348 ( https://gitlab.com/xen-project/xen/-/jobs/4573553348/raw )
> 
> Stage: build
> Name: opensuse-tumbleweed-gcc-debug
> Job #4573553345 ( https://gitlab.com/xen-project/xen/-/jobs/4573553345/raw )
> 
> Stage: build
> Name: opensuse-tumbleweed-gcc

While iirc the above continue to be expected, ...

> Job #4573553188 ( https://gitlab.com/xen-project/xen/-/jobs/4573553188/raw )
> 
> Stage: build
> Name: debian-unstable-gcc-debug-arm64-randconfig

... this one has

ld    -EL --no-warn-rwx-segments -T arch/arm/xen.lds -N prelink.o \
    ./common/symbols-dummy.o -o ./.xen-syms.0
ld: Xen is too big

in its build log. Whatever the .config, I'm inclined to say this should
not happen.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 15:42:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 15:42:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558510.872674 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGiAi-00050e-AE; Tue, 04 Jul 2023 15:42:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558510.872674; Tue, 04 Jul 2023 15:42:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGiAi-00050X-5w; Tue, 04 Jul 2023 15:42:32 +0000
Received: by outflank-mailman (input) for mailman id 558510;
 Tue, 04 Jul 2023 15:42:31 +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 <SRS0=D/z2=CW=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGiAh-00050R-SU
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 15:42:31 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20622.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::622])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 623b6172-1a81-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 17:42:30 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8109.eurprd04.prod.outlook.com (2603:10a6:102:1c2::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 15:42:26 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 15:42:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 623b6172-1a81-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=G46KUb610RIawpvIDAo5W32f9k/cpwI8X1M8jMiZ5Yn+qZzGC0Kd2YDZiYjRUzb4MOBp0u9J0b62eO/iz383ddcuwqDX95QsSh01UuTMe22iHoYChwspGL2edPm1SZt5GaVN2HL6Ziq81K4E+rhQOznL2+oGdSVwM6WHeYb8/FPIiW+Yv2ZGs0uphK+tkBJAQsBuceT1T/GXufECcLYdS6ymraW4u99gjvFb10fbfgxoVan4H05UYTaVjEVoiuq2g7a18+atDhXiDbDZxSI+6uwzDYaIRkoTw04UG2qlqaKMmTlV1wzMEvweZqmUQSCqnkBX+jTcORMofnqSQuDAug==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=RuYGw/kTZAsFCEOIrRt7WS5FlKrDH4AEqbBh5jGxLm8=;
 b=jhOsWb+iHoEZQ+sryLwDPvc1/EaN82ZE02jUlTWGhpuLz1fu8zLPCKjnZhkO8DWMNddsWJctqH99g5b7McLpczdtoEFHOXiMVdy50r5eQkOMJR6i7ETDSEWJcHseLUcr2zAKGG4hFup/LTqOE5mQFzWjCFWaJ9+Dx00ohw678IttotAREWVEeprXVVjr3E+uDo2gj4+YaH5yghdizi4Nlu4aCBBrOHzwN78lR/hPAA/90+fe8Rw1K7BaqTC8905kMQacJwR1qv7HkbGxgeb+ZMJ5Rt8kNOoBchPqeYGtwnuiu/anCzASTcYj5rpFnwKHO7OxMUMcYsfouSK7VZea9A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RuYGw/kTZAsFCEOIrRt7WS5FlKrDH4AEqbBh5jGxLm8=;
 b=fohYXgONONwFaPYflCX0bHEPzNFobvr3s6PTWcsAkxaa002H3Ha4bFgtWD7UwitAj6MVQ86IGqDpgcIpeINgcyM5JBKHxocKHu9zBQtPphcl2vi5iqWdvIl6EBXaEickimStfIymrfqu0sjcchdLWTWezAfM9gzhC1HtSbs0STVxUu6uVYp2A8ulj3x26OU2NaJo6kc4fbKwKsaBy5IzxLxAi8r7rF/lYfnct/ao6XvZQiH5G2709fZD5Xxb40t4SfCJTQX+xdFSe7WcfXq7N7aRBw2aVLKnamo48LSTCMf+/836YjVC1r6GFtL0eP5flHWkaIh0ThQmWaldfpXfxQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <4d049335-71fd-8fe0-0f9a-dfdd16fcf41e@suse.com>
Date: Tue, 4 Jul 2023 17:42:33 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: Backport request (was: [PATCH v2] tools: convert bitfields to
 unsigned type)
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
 Juergen Gross <jgross@suse.com>, George Dunlap <george.dunlap@citrix.com>,
 Anthony PERARD <anthony.perard@citrix.com>
References: <20230508164618.21496-1-olaf@aepfle.de>
 <ZJwBkHLwKJNuhekG@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZJwBkHLwKJNuhekG@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0160.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b3::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8109:EE_
X-MS-Office365-Filtering-Correlation-Id: 2bd9fcc7-3671-4e75-e10d-08db7ca544af
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	NWawoUDmHsO4LWL7f4EiCO+3Fv+kSkaduF9w9ewdFgXOCZD5Z1Cj8+qfRgVj8bnAZNhLRtejny9G8PtBShTYHM14v4ryg5AIWUvVy4+zNNfs3O+om3CGFKNEWBiiQsock8gMAqJxFmdnie6wkyl2+zW5rV7NKhiCDo3q/y23x6gRlqf62b8qqnddArK17dnfbGJVKwKRUgMxpRENPW101SegX3ZUQSdz5ARGVKXSIgLpP7ZdGXQsJI8SPxnBfYwLX397o+9JDiAuohFjJL5ZfgTkTf8G2LvVYQCk+0Zq7bSXPU8VEI/975eYhUtx+xhtp9JpQEtkdlxw31Dxooy91yOn6fIAok3qZYkwZm3mXnSUcMmfpXp7cmpl+EkA73vm9P9oyMtNP7MrPXaIA/aeN7oGmXZRBRAzHFx552nOYB9ba4DNtVoqj9GyIZMRLKSqDmcLXbxspVk8NMoYoz+nIJnt0Qte8Tv13r8BBlra+SdB/zTsGnvw1IW4KGiCv+AfkMJhonrkGpHHAuSX7GWdn+zi88xIK5VUmQI7Af6kOSDAWnyDzUWVUMRa3P9/hJI1KTIThXOuMI935per7Y2UZCS9zySYcVcQBhugxZBn2DJcbFkiqAtoyz10TmVM3UUubqTuapVPNP/5hsn2Hnw9dg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(136003)(376002)(346002)(396003)(366004)(451199021)(8676002)(8936002)(54906003)(478600001)(26005)(41300700001)(6666004)(4744005)(36756003)(6486002)(2906002)(5660300002)(31696002)(31686004)(86362001)(316002)(66476007)(66556008)(38100700002)(4326008)(66946007)(6512007)(53546011)(6916009)(6506007)(2616005)(186003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?V1YxcmtiLytrK2lZRXphcXJsWnVUc2ZranhsNStrUmF0LzJ6YmNHUFRYdnlD?=
 =?utf-8?B?UXV6NEZUNHNaNTN3WFNJZTArc0FSeWlESllMamFIQmpySVdjQ0VaNTdkRnVs?=
 =?utf-8?B?WmFxZ0lVdEFnOGVFam1xRTRqUXR1UW1lcnlrUzgwMitxREcxWWNYaHhDVnhl?=
 =?utf-8?B?TWwxR3E1QzR0RDR5SGlzZ0EzcEtORXdLR0dVMWxnNjh5TENqQzJpSzV3VFlz?=
 =?utf-8?B?OWNZUCtBZHg1c1ZKWGwvZHpDVUlwNmswSGk2bUttcHlUd09RN1l6SlA5KzBp?=
 =?utf-8?B?WnptSlFUQ1NnTE9CeUg2Y1MvcEJVNm1GRGhodmRRZFpvNWo2dUZrdGZUM0Mz?=
 =?utf-8?B?blVXMGZGTERsOUxXVkpSSnpCTHdWc2xPem0rT21mRnFiUHdvR3lEZVVtaGRk?=
 =?utf-8?B?dWh3TDFaS2wvSDYrbklaTXhLZGFwRy9XSWloQnNNZVR1SnNhSlFkMmIyQ2Zq?=
 =?utf-8?B?bnhudEZJVEVWS0hoK1hNemxnN1VnUjFLaXVtd2FGaldYOXdVV0RBQVU0OGpD?=
 =?utf-8?B?SlZNQmJjU3E2dmZwcVdKY2lJaDNvVG03LzdCWmMzN3h3Q3hwMFN4cTNvc2pa?=
 =?utf-8?B?Vn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Skh6RXdGWWVpdWFkK1JjazVscmxUVGI1dThp?=
 =?utf-8?B?WDhNOXhUMUVsUllWcVhoNElONm5IZGhTUHVDOWJJTCtWd3NEN2RJWkRITUhn?=
 =?utf-8?B?RElRZjM0ZTJpTGMxTDRsbDZVWmVZWUVMOHJxWkYvMVBEanJ1amV2RHZXVUFN?=
 =?utf-8?B?bnFSY21aNHAyaG16amdkMGdLSXEvcXJtYWR0S00wdWpZQWE0SGhFOGVYaDgr?=
 =?utf-8?B?c3hoTzFPSGlJeHorREZNTWlWZ3FrbHhybUpuUDZGbU16eE1oMkJQc0g2dmJR?=
 =?utf-8?B?cHExVjZ2OXB5Z2VLci9FRlhrSElwYzdQcENlbHRBeGFKWFVQeDBabld5bVZS?=
 =?utf-8?B?bzNnNXF4ZDdlRkNCNXozbnhYVm1tM3JSNzg0K0tKcktFRE5QOWQ5dS9ZWGsv?=
 =?utf-8?B?Z0MxL1M3bkdxbkJNQTkwaEdtV0ZrMmFJaFBZWFZlQ0pURmZoM25md2VCVXlr?=
 =?utf-8?B?VllzLzhVbzN5NC94bzcrSzhyUWxHWkw1VjBUTmMySUYvbnVUbml3YlRvZjlm?=
 =?utf-8?B?TUpxLzNRUGgrRHRBb25aTENSTGlCNXBQNXh1aTE1WHp3MGZOd2liTU1jMXJV?=
 =?utf-8?B?amM3NEVnK1NVUElOL0Q4cW1zZjR6RDZXclNmOVZCOElrYnRBWDVCR3BHU1By?=
 =?utf-8?Q?E9AB6J6TwjxZ1jp5kxvhO43gN?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2bd9fcc7-3671-4e75-e10d-08db7ca544af
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 15:42:26.7809
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: TbIGx9dHtAiJPoBE84AdiPJk/T7YMGIfBkuF3qyfJj8C0MTC2EFPX+EFyL/zzPQTdezFMJC+aGErfdAPGlcNDw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8109

On 28.06.2023 11:46, Roger Pau MonnÃ© wrote:
> On Mon, May 08, 2023 at 04:46:18PM +0000, Olaf Hering wrote:
>> clang complains about the signed type:
>>
>> implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
>>
>> The potential ABI change in libxenvchan is covered by the Xen version based SONAME.
>>
>> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> 
> Can we have this one backported to 4.17 at least?

Hmm, while perhaps simple enough, in principle this wouldn't be a backporting
candidate. May I ask why you consider this relevant? Plus is the mentioned
"potential ABI change" safe to take on a stable branch? There's not going to
be any SONAME change ...

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 15:50:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 15:50:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558514.872684 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGiIV-0006WV-2E; Tue, 04 Jul 2023 15:50:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558514.872684; Tue, 04 Jul 2023 15:50:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGiIU-0006WO-Ve; Tue, 04 Jul 2023 15:50:34 +0000
Received: by outflank-mailman (input) for mailman id 558514;
 Tue, 04 Jul 2023 15:50:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=vvOH=CW=citrix.com=prvs=5429f199a=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qGiIU-0006WI-3J
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 15:50:34 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 80b83b54-1a82-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 17:50:32 +0200 (CEST)
Received: from mail-dm6nam11lp2171.outbound.protection.outlook.com (HELO
 NAM11-DM6-obe.outbound.protection.outlook.com) ([104.47.57.171])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 04 Jul 2023 11:50:25 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by SN7PR03MB7129.namprd03.prod.outlook.com (2603:10b6:806:32f::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 15:50:22 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 15:50:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 80b83b54-1a82-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688485831;
  h=message-id:date:subject:to:references:from:in-reply-to:
   content-transfer-encoding:mime-version;
  bh=oQZ/XOht9AykrlY3uSpZoMMxS8zXuDQ4AH3tpDbuphw=;
  b=I2hwOKe9mio32Z85AHwRQ4oXRAOy3hP8ktE1FOroprhS9n/+do0UKcqQ
   YOdzqUlWa3zC4IZ/8lq/iKFZ2XtDRHxDSEP62zQ6GlZ3y/OVvxqplx2r7
   AowyX1cBnlGtgN2bm0sv7vlXS7Ob+qRsrnYaPuHPeCLA/Nq3yo+9ZTGLE
   s=;
X-IronPort-RemoteIP: 104.47.57.171
X-IronPort-MID: 113847160
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:K8eYo6zGv5Ekbqbc7eh6t+cvxyrEfRIJ4+MujC+fZmUNrF6WrkUDn
 TQeW2qBOPfcMzejKd9/aoy39kwFsMKEmNNgHgQ5qCAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhPawT5zcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KXxy2
 sU9FBIHUi3dxN6x6aCqeMpSust2eaEHPKtH0p1h5RfwKK9/BLzmHeDN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjeVlVMouFTuGIO9ltiibMNZhEuH4
 EnB+Hz0GEoyP92D0zuVtHmrg4cjmAuiAdlCSOLhqKYCbFu75EYQMT88ZFSAsNKir0vudsNQb
 EkK5X97xUQ13AnxJjXnZDW6qnOZuh8XW/JLDvY3rgqKz8L88wufQ2QJUDNFQNgnr9MtAywn0
 EeTmNHkDiApt6eaIU9x7Z+RpDK2fCQQc2kLYHZdSRNfuoa65oYukhjIU9BvVravicH4Ei3xx
 DbMqzUig7IUjogA0KDTEU37vg9Ab6PhFmYdjjg7lEr/t2uVuKbNi1SU1GXm
IronPort-HdrOrdr: A9a23:fyY6zKHxoi8ULdJHpLqE0seALOsnbusQ8zAXPiFKOH9om6mj/P
 xG88526faZslkssRIb+exoWpPvfZq0z/cci+Qs1NyZPTUO1lHYS71K3M/PxCDhBj271sM179
 YHT0GmMqyUMbGtt7ef3OASKadD/OW6
X-Talos-CUID: =?us-ascii?q?9a23=3A67M8pWln6UHQncxka0mgM6OkrD7XOWDh4071H22?=
 =?us-ascii?q?yNVs3C4GSYE2ByoBar8U7zg=3D=3D?=
X-Talos-MUID: 9a23:znhArQbcNQ7/tuBTlRXvvRNIBchT8o+1LUVdvIQJ/MyaKnkl
X-IronPort-AV: E=Sophos;i="6.01,181,1684814400"; 
   d="scan'208";a="113847160"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=K8GItorg/FlGIHvKyJnUx74wnnB/tcjVDSNP3m7H/D3UfsaaZmn4Pty9LaQKrVOCb7TfUCllVjEzqsHVS2+wa+euhQzptXk2qdH70DHVdw5xwGqTBsKmbcBKSKzB/BydXAX7wIGTrUQ12gbH1comxfLMABe0W0Kj+FqmJXw8RI81Kf19LMlWe2rQBny63Y028bFpCcVIXMTaNx7O+SULxFpL07HEKW2Y4Pd7/LYg4JIJkQ4tOD/2oCKBY36/v7WbvxrVDbMwtIwoQ+L6PFEqwPD4TFVsiMRD4EHoXIqXgbW6j1/aRTeml2QTVKgc+z6qvWPu/bcDXD5QS0+Z0P6QJQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=s9DTBbPeDfOKIsbYF36FEDxcq1FyDd38VoaDBTAIM/c=;
 b=OXOGjX8qTwMApbnBP7Y1TVHjDMmJSlZbKL0w3X+fePJzN0Ri60Uo35JJMYFXfMEA3q4DUgGOWHlGmTvuxSGkAbh0IJqL/3hcCF6oU8SsyPkxPzd/0daH4hlFTkIyWQaLik0m/Km58VtPark/8R4TeGNrcI/DPRkAjYlK3iU/30xVti6P8tWDOQNF7JEAcOrD1isXT15yxq4EPpzFR+7MWOEQTDdVtuk9TQIF6sc2p8JMDBFoIGhJ5XCG0odVHRu35jGJT2KG91w1ooXYkXg2GiLpgs9V4NSq7BfJo9EB6BrnAv9jn16K7rmlM2zglOLD5HovNxYHjOq/v+5oYycLYA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=s9DTBbPeDfOKIsbYF36FEDxcq1FyDd38VoaDBTAIM/c=;
 b=bEslETl9C+m7PimdbIkZqJAwoXQDsh8TaY38jWqIcjTo3hfessp9SMcvdpbIETI1dYcyET3ISNw87aB3j2ncT4ZcbAmiasLC8jhlN4w5UPSg4gG/LgIM0usMpmR9cLsYz/icYdqQ0/jbvhiKDFFt4aR8HFtp9dqKBoptlMJqzLw=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <220e6e10-ab9f-b036-9acf-58109d2a7426@citrix.com>
Date: Tue, 4 Jul 2023 16:50:16 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: xen | Failed pipeline for staging | 9dd3caf1
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <649eeb9f5347_281f686f427353e@gitlab-sidekiq-catchall-v2-54666fdc77-xrbls.mail>
 <bff9074d-0345-2931-c57b-3acda238a9b5@suse.com>
From: Andrew Cooper <andrew.cooper3@citrix.com>
In-Reply-To: <bff9074d-0345-2931-c57b-3acda238a9b5@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0337.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:18c::18) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|SN7PR03MB7129:EE_
X-MS-Office365-Filtering-Correlation-Id: 63653c2f-f06d-4217-4dda-08db7ca65ff7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	XzTLhmbLCjRuy290v1OtZUJbGgaB/lSbVRjfCwrf5eTXiMVAJMp+QEykgT4iAliGi3UDjAzZNmtWsIoaYUJwsB+po+sWlmhcdFIzyFbfqBFP/D6nX9z9F83lLxr221bbplMmUJfZIpPZ/haQBaPtFFjpWPx/SkVpzaASef22gZVGD+Gc5uS02kW6c8TuQF3kl6fKPFg5giNXwg0JuhlPs63qzSQ0XQfnsoOUdWI87c3oB4lrNJKkidKHLMOvzuv795J8QKqdY4u0amvj/u0BzDuaasVsxg8A2YbwbouaHzF2PNthpkza9zzQEcAN2Ewvp2cTvsgKh/p5yQWQUh9CVMYWTFzw3q1u7Fqye6H4arnKzv4ZQhIxxIj4EKlk4e9w7WJkwjt3liFnI6PbmcWnPMWqjuh+HdEy193iMXSn6LgBG/SjRMDBjOa9EhaKK2YqTbqoAa8/qDmAE2jcZQg4kD8MuD+QJLrS8Pmz7c368y5fnXxLYOTYsn62WW1k7TwhLMnbnQqmQIUonrykauUehCF3qi7CYZF/Me2fpTDjaIU869IoafpkbO0kgpuJ/TjgKA6KTWFXoi/6z3kCqsWeHwVE8/gTKZsUQQLNTST7HfYNQBePen3d8H2YWPFo2DQisGLp3eOC3k/KMMEcKbILnI28ehUVp55hLu3k3trGIoad2E8nsjUE834bPUYtyhig
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(39860400002)(346002)(366004)(396003)(451199021)(6486002)(86362001)(31696002)(478600001)(5660300002)(66556008)(82960400001)(66946007)(66476007)(6512007)(36756003)(966005)(186003)(26005)(2616005)(6666004)(31686004)(2906002)(53546011)(6506007)(83380400001)(8676002)(316002)(8936002)(41300700001)(38100700002)(110136005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?d0JZemh0a1hURklpc25RRUNYSW1SMmdSclVuaGltMUNlSFlWWDNxd1VrQVkr?=
 =?utf-8?B?WVBtVHlwK0NHNm92SGNrVnk5bFpJeG9ScWpta3J1M2E2QUhLVWQrT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dEZQT1DKpHgMK1w0TAh8cr5sU0EMFXm/4sfgLvpm0kdleH/hrNv3tYpgS6nSd7MNSKlq78+EMOv4g6ESzZfWvOu+utgZcy4+MFL6Iazx8F78dEwBGsuv6EpjPwG1op/CdNe+8g0DQEvrn/NBWU7msiRT99VmoD+iPwMjLFRLPY6jH1QX8P0f6Y14gIlqyzSko+5kiVjQuQ+z6svDxsEvmymyP8ZqebW6DOWRfjiD68IsSXpX/p2Fw+ZCQg0WjzTtFU=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 63653c2f-f06d-4217-4dda-08db7ca65ff7
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 15:50:22.2676
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 9Z15Ug8x4BzrY4aTzqXaOYt4qzxxEUg3kTfHn84cLVVs7ZnM+N7655R70SPWw5pY3JeBsZGl0esgY7w3/rtkPFyh8LR86Y9r3C+5RVujmc0=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR03MB7129

On 04/07/2023 4:39 pm, Jan Beulich wrote:
> On 30.06.2023 16:50, GitLab wrote:
>>
>> Pipeline #917215286 has failed!
>>
>> Project: xen ( https://gitlab.com/xen-project/xen )
>> Branch: staging ( https://gitlab.com/xen-project/xen/-/commits/staging )
>>
>> Commit: 9dd3caf1 ( https://gitlab.com/xen-project/xen/-/commit/9dd3caf12f52b859947c260b1cb3a48b491d53b6 )
>> Commit Message: {x86,arm}/mm.c: Make populate_pt_range __init
>>
>> ...
>> Commit Author: George Dunlap
>> Committed by: George Dunlap
>>
>>
>> Pipeline #917215286 ( https://gitlab.com/xen-project/xen/-/pipelines/917215286 ) triggered by Ganis ( https://gitlab.com/ganis )
>> had 3 failed jobs.
>>
>> Job #4573553348 ( https://gitlab.com/xen-project/xen/-/jobs/4573553348/raw )
>>
>> Stage: build
>> Name: opensuse-tumbleweed-gcc-debug
>> Job #4573553345 ( https://gitlab.com/xen-project/xen/-/jobs/4573553345/raw )
>>
>> Stage: build
>> Name: opensuse-tumbleweed-gcc
> While iirc the above continue to be expected, ...
>
>> Job #4573553188 ( https://gitlab.com/xen-project/xen/-/jobs/4573553188/raw )
>>
>> Stage: build
>> Name: debian-unstable-gcc-debug-arm64-randconfig
> ... this one has
>
> ld    -EL --no-warn-rwx-segments -T arch/arm/xen.lds -N prelink.o \
>     ./common/symbols-dummy.o -o ./.xen-syms.0
> ld: Xen is too big
>
> in its build log. Whatever the .config, I'm inclined to say this should
> not happen.

That is
https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=02a11313cdc60d266d8613899fcc9d3870ef5164
and is intermittent when randconfig chooses COVERAGE

"[v2 0/4] xen/arm: Enable USBAN support" on list should fix it.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 15:51:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 15:51:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558516.872694 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGiJ4-0006y0-Ag; Tue, 04 Jul 2023 15:51:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558516.872694; Tue, 04 Jul 2023 15:51:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGiJ4-0006xt-71; Tue, 04 Jul 2023 15:51:10 +0000
Received: by outflank-mailman (input) for mailman id 558516;
 Tue, 04 Jul 2023 15:51:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=D/z2=CW=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGiJ3-0006xI-9q
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 15:51:09 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on2061c.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::61c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 977e7203-1a82-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 17:51:08 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB7645.eurprd04.prod.outlook.com (2603:10a6:102:eb::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 15:51:05 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 15:51:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 977e7203-1a82-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ZnR9Qjt05YkLNDrruO+vIe6SoBdh+pEyEqYDe8lw3Dzo/hWXZNO2n3co0vR6VlpjjVqPCl4SYfcDeelhvi4N2K6q0Cvie0HCb0hbso/kAbVMe4rbhZa9Fs6lMw/q0wD56C07yKDeYk089H0kygGYluxPJmUCquoFEWmsRXXAuBazy++0eKIzlNx0XtLxrzkHP5m5+wD0F6vckGj0R7HjGfi+PBR4qQPV442Gz0iSiF+jU/xWcnTZCbjTM5jvM1fw65z8Tq6q5CDlgsmd8vyyHyvKloBnBmv2gzghD11s20S8VWGJJNoX7onos47cT96qETHhYotY+w0w+xUywysIUA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=mT6Xy78g6mlD36cWlfcq31hHskTqrQQajOhob0Lw9pM=;
 b=T4BHFjzOz+vFXImHH6BllNNcS1UInUgl09bkxKf6vAauIxYTr3nj8YY1dShECjp4TeOIgLt+E++FlPQY7Zq4CW9BnaUOkIcSlFoiLaRSdh5yqtnPi8hyOaf4Vum6O5t2FjHmaB2oUvClWeRCe+F1IySqooU6kl0lGDVY/MON+dDO+b3DOwirLzbvZOjjPZHsi9hRrskZs8AHdq53K9jU93XD6vhHovyvdG2UwRW1tCUtOokUvo1BqLURzya7+axcS7LNL+h1ib50UlTNTjOusgbVUxofjQMGUBsjiW3Zj8newy3Gip5QDTjuO9Bt1ajZfrA2yAIKlPqgG7wNLhLSyQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=mT6Xy78g6mlD36cWlfcq31hHskTqrQQajOhob0Lw9pM=;
 b=DrGqBzOl4AN2dkNzoqNTUt3yu5Bx1XUzr9vqOFVD/8hptxdg/PkikuJsiDABvIVLt2cA4aQOtIItSFu+Xy4Ltxlwv5aRN5NarssM7NnqVLaWgjwSxeBi68T8Pr81tcElSO6S2h8Fu5RFDuHACoR8q+a7Hv0nf713eDD2FNJIeF9rBM+Lp5RuVQizfVW7DH1cnfSZMAJmcehXARRWHxyEFK3PLHIQxiU/Klr6PG+ZY1oAyRaGR5bZnd13JAcVv4fkK3Pk/+NzVKqBniHbHVWc4qwqWjGFNxsSiTeSCfkbFCPeZVlO3gHHG3UTyKnJNTf3f+6vCkcNaKUT9PxD+kfyVw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3a192d6a-4a4d-b798-c205-ebc0a2302c50@suse.com>
Date: Tue, 4 Jul 2023 17:51:11 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v3 2/3] xen/drivers/passthrough/arm/smmu-v3.c: fix
 violations of MISRA C:2012 Rule 3.1
Content-Language: en-US
To: Luca Fancellu <Luca.Fancellu@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 "xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
 "ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
 "consulting@bugseng.com" <consulting@bugseng.com>,
 "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
 "roger.pau@citrix.com" <roger.pau@citrix.com>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>, "julien@xen.org"
 <julien@xen.org>, Rahul Singh <Rahul.Singh@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Nicola Vetrini <nicola.vetrini@bugseng.com>
References: <cover.1688032865.git.nicola.vetrini@bugseng.com>
 <8a8d5ed47f24791d3927345fafed07023a8b0b76.1688032865.git.nicola.vetrini@bugseng.com>
 <55390224-89CC-44E9-95B1-BBA491BBFEF3@arm.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <55390224-89CC-44E9-95B1-BBA491BBFEF3@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0164.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:99::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB7645:EE_
X-MS-Office365-Filtering-Correlation-Id: dea5e043-dee3-44cd-e98c-08db7ca679b7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	MG0QeqH8FeZZHmoOIp50T3G2xDIeQsV/PaNFIbaT7X0r9K5tEsRpDuBOzmyHJa2OoGGPEuMvcK+yrRzZSaWnni3OIIYshcoS/Rcn/6ybYyJg7aNm2bJb+P3H9qP7Vgh2xS7OTMRZzPzORNSyQMZj4H67bwbVgMwkCD/CeJ4JmgZB/PryZKiOzAraDiLK0686wTEHPUJEh3O0ovs+WNfSn9vrlkVlsme1qUg4B7EzigSdQXTIh4N7a8aq8FLydKP8ZR2jNRYFJk0bzC/GgQ7vT8N/70y3xNDeAgYZXyNyUYuAZVt8PIP9gv6Nd3VbFmlKtV63asIt9CoVVHByn1z9uIOsGeGsTuym3ysLsOHgy1oVcGnAnltnfVTwyf9HedieWTjB6WUV/co16pbyQ1jggKf3fPpyHN+spkNjbZhJDqwBFDj9ojwsqWz3kSeux3HQIwbWUlQHSgzXAoxfKjrb0E5Sqf/Diq1aj+ilCixmBDqM0lJuIyNOrk3fyhJ01MrqBdM7+xbLMV9oxs9XYVFOxDmLGHcWKqyFSfDSWnxj0nCLuzy6p9ztRqbANQeq45/VMrMTMF2I/IxrgAOPl4BM3U3XUXNrx9vPuWVFEnOwPWQ0e+aui1DS6nY3gceOsc5qWrpSLqUqn9lkfuQSbfzigg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(39860400002)(396003)(366004)(136003)(376002)(451199021)(54906003)(26005)(6512007)(53546011)(186003)(86362001)(31696002)(8676002)(36756003)(6666004)(2906002)(7416002)(6486002)(31686004)(5660300002)(8936002)(41300700001)(478600001)(38100700002)(6506007)(66556008)(66946007)(6916009)(4326008)(66476007)(2616005)(83380400001)(316002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QnIvYW9wY3JrdkMxcmFGZEc2NytyOTJUQ3kzL0l5QlRlZnh2V0FRa3JJWURT?=
 =?utf-8?B?dXRkTk52cmZLcERlYXJjL0pXd3ZvV2VmN2hMck5qWk5OUmdHbkQzREpOR1oy?=
 =?utf-8?B?NWRGRGlCdjRHY2w5YXI4bWJUSmlTRGVTL0RHR1FMYk93OWRad0R2MVA0aHlI?=
 =?utf-8?B?RS9LSWZ6TVVEUFpBSWs5TjNmZGV1TnJqNlNyRG5qK2dOMFh2Uzc4YnMyWTV1?=
 =?utf-8?B?bldHUlUzMG1Qd0hRdEFucjY4SERER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GxkTy8zaUlRK0Y3ZFpkWUc4S1g2ZWYwc0ZsU0JoSVhyMEdTRDha?=
 =?utf-8?B?RC9ROFNyVTRMSzNkT2ZSc3hxcnhkekFvKys2T3F3YldNL09tUmxaM0s5aisz?=
 =?utf-8?Q?5g8IsBhEI4oJCtmeLI/3lzeUt?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: dea5e043-dee3-44cd-e98c-08db7ca679b7
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 15:51:05.3058
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: KcMLlLiDk/x66uc7MArMXuPIsbuLelrrQQhSraNsE1kTRWBwoSL3GNXRrJeyg0YIF1yZqErCx433+Lbzz+CS9w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7645

On 29.06.2023 16:52, Luca Fancellu wrote:
> 
> 
>> On 29 Jun 2023, at 11:06, Nicola Vetrini <nicola.vetrini@bugseng.com> wrote:
>>
>> In the file `xen/drivers/passthrough/arm/smmu-v3.c' there are a few occurrences
> 
> here you use a different character to enclose the file path (` vs â€˜) may I suggest to
> use only (â€˜)?
> 
>> of nested '//' character sequences inside C-style comment blocks, which violate
>> Rule 3.1.
>>
>> The patch aims to resolve those by replacing the nested comments with
>> equivalent constructs that do not violate the rule.
>>
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> 
> You are missing the â€œ---â€œ here, meaning that the lines below are part of the
> commit message and Iâ€™m sure you donâ€™t want that.
> 
> Also here, may I suggest to use this commit title instead?
> â€œxen/arm: smmuv3: Fix violations of MISRA C:2012 Rule 3.1â€

Just to mention it: Personally I'm averse to such double subject prefixes.
Why would (here) "xen/smmuv3: " not be sufficient (and entirely unambiguous)?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 15:56:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 15:56:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558525.872705 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGiNj-0007kb-1v; Tue, 04 Jul 2023 15:55:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558525.872705; Tue, 04 Jul 2023 15:55:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGiNi-0007kU-TZ; Tue, 04 Jul 2023 15:55:58 +0000
Received: by outflank-mailman (input) for mailman id 558525;
 Tue, 04 Jul 2023 15:55:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=bK4X=CW=citrix.com=prvs=5424eaebb=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qGiNg-0007kO-U1
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 15:55:57 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 417c260d-1a83-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 17:55:55 +0200 (CEST)
Received: from mail-bn1nam02lp2048.outbound.protection.outlook.com (HELO
 NAM02-BN1-obe.outbound.protection.outlook.com) ([104.47.51.48])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 04 Jul 2023 11:55:52 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by DM6PR03MB5100.namprd03.prod.outlook.com (2603:10b6:5:1e1::23) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 15:55:47 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902%7]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 15:55:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 417c260d-1a83-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688486155;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=nmQaAiz6QSYVhN3X8b4uV8a+ul+In/2wS/ajFTR1y/Y=;
  b=JkCY4JPbD4C9xVThP12bNaSWnk4S0MCTXlvJ7N8oEsz+/LLzUdMlUFwu
   7XWW+I8zeIbnkeh9yPm7RdBN7Fntlmber8UuiEAqvHzmVZJU+g/7D28HH
   IEF37wwKd4dboVLZRS+83s46oxKTdP5nBMqR3BDyC8TWaGx91/zT5imET
   c=;
X-IronPort-RemoteIP: 104.47.51.48
X-IronPort-MID: 115548631
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:7GkDDKmF/ATInQknzuW2Ko/o5gy3J0RdPkR7XQ2eYbSJt1+Wr1Gzt
 xJKCj2Baf/YYTSmf9pzO9+x8xsGuJDcztUxGwE+ryg3QSMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5AOGzBH5MbpETU2PByqgKmVrNrbSq
 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/
 f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3
 cAZFxscURexvej1zb64RdRcpJwHceC+aevzulk4pd3YJdAPZMiZBo/svJpf1jp2gd1SF/HDY
 cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVkVU3jOiF3Nn9I7RmQe1PmUmVv
 CTe9nnRCRAGLt2PjzGC9xpAg8eWxH6mBNJMT+TQGvhC0FS4lkECEwIqcVKdo76AkE6zYIl+J
 BlBksYphe1onKCxdfH/VRClpH+PvjYHRsFdVeY97Wml2qfSpgqUGGUAZjpAc8A98t87QyQw0
 V2ElM+vAiZg2JWKTVqN+7HSqim9UQAXInUFfjQsVhYe7p/op4Rbs/7UZtNqEarwhNusHzj1m
 2qOtHJm2+VVitMX3aKm+1yBmyirupXCUg8y4EPQQ36h6QR6IoWiYuRE9GTm0BqJF67BJnHpg
 ZTOs5T2ADwmZX1VqBGwfQ==
IronPort-HdrOrdr: A9a23:hyUpT699CFfR81n5qmFuk+DiI+orL9Y04lQ7vn2ZKCYlEfBw8v
 rEoB1173PJYVoqN03I+urhBEDjex3hHPdOiOF6UItKNzOGhILHFvAE0aLShxHmBi3i5qp8+M
 5bAs5D4QTLfD1HZBDBkW2F+n0bsbu6zJw=
X-Talos-CUID: 9a23:FhMVZ2D+k8yEIzn6ExVmy2UFJccXSHeewXvTLHKIKz5NFZTAHA==
X-Talos-MUID: 9a23:JkGKaQSziSwX1KE+RXS8jRoyGdZz/JiKAWYP1qwcu8S/bg1/bmI=
X-IronPort-AV: E=Sophos;i="6.01,181,1684814400"; 
   d="scan'208";a="115548631"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JpAZq16RbVrdp8UY3a7h5firUB3C4VrruZYunZDVXwKvQaF79h/1rdNPiRRyW4vSnt1P/fKcgZ8d+HfxFmrbn8QjTY0nvK48iRTDe6sMofUEDY8OELLUPmEJRjkgw0ARNznmN6TSaBOQhknJPGyoqA5L0vYk8rh0+4cFApFPWbXk1dOYl6x09Smkat9idS1BbKtX6NKdTMuxjV5t1C9+40B9vNQq9Te3hX+CinxfkxU/Ul1aW8Nf1GpeJG/ollAvKhIIvENEKneOWS4o9OfzM1+pUYX+alKW2lbofHja5GmONLHBIj3cCb073s3ZET19jyaP4Wfa1VW/Hkmp2AYM+w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5YXhD+nWazyqIPf9QUc22wSfzJIADbl523pHct1rSbI=;
 b=YfpE7BDgLR1RJcQvN3pzuEx4PqWzH0wZY3xVLPnUX9ufHeLEzsGRY0JgY1Q5LODIrgmkgIN9iSRvMpNVUgHBt54yL3MRohU2nhjE2wMH4goeNNNirSiqKO2IzrZOzud6dy1R6HgSx5Cmmjux/bPYizJyHIQBRix6oWqrFOqcEU5avM1F10IRX7OIQgKjom8DfEJoPP98vqKkM4kvAyq0XElkVdrY5upWuz8m3P9yUQPHur1bjHmVUYzvhSNApSh6SIHf+C2N7u8RGXYxKnXEkUJiamD2MnAX4u9kswz+d0qS/6CfdksrVfX5O8HtIsqgeqyXdPq7qEu5nlikrMb8rw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5YXhD+nWazyqIPf9QUc22wSfzJIADbl523pHct1rSbI=;
 b=CI4jNtShMEBE3CcYRPaVKGfQfTCL27h3VolNzkkSo1Tfy++oK7s95zvOINV7gkWT5fA2f4DCr7Fuo8XFTuEdB3TVC5zOnLwrTkyW2XbNDijBQiP6/n8WiczdcKVQDnLnEMzOG1EojtHy9AGfm9dXDwZq66rfN8ZzXiQ7zI03RVI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Tue, 4 Jul 2023 17:55:41 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
	Juergen Gross <jgross@suse.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: Re: Backport request (was: [PATCH v2] tools: convert bitfields to
 unsigned type)
Message-ID: <ZKRA_X9uudh6TRov@MacBook-Air-de-Roger.local>
References: <20230508164618.21496-1-olaf@aepfle.de>
 <ZJwBkHLwKJNuhekG@MacBook-Air-de-Roger.local>
 <4d049335-71fd-8fe0-0f9a-dfdd16fcf41e@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <4d049335-71fd-8fe0-0f9a-dfdd16fcf41e@suse.com>
X-ClientProxiedBy: LO4P123CA0381.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:18f::8) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|DM6PR03MB5100:EE_
X-MS-Office365-Filtering-Correlation-Id: afc26fe2-f393-408b-ae2f-08db7ca721ee
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	8TLOJMouI+F9bQewc5dsWqTNclJ6i9lKBtUEjEkhUL0ePe9LGsEX46rQm3xn4h4E6rjtYeADwxZYosw02NrTPvpoyxZE2WOqk8ihBfbq09g0ZR9DznjT+/8fF/cRfxxiHfXtK/5vrJAZap4TsoHtEWMJcbc+lhNz9ZUFHQnJW59w70TEcyg87Uvvbo2upkJEfAALWYotnhzyTTWVOFu0iVWqplxDvFEJeED1Ac8Kk54WPtkv/wszTmvIt6bcJrX6shPX+2BC3/nbwkyDvhcyo2vsPY1qtcGpLUg8ZhWiOjc58ebaDuvabzL3rOtu0fANC5zK3QAKkhrX+afn5X0QX3LZawWcSQL/Jp4vi9dUWulxC3JZR6PyJyb9KfTnDC6mKkx+9MTcyES+B/guKJA/uUv++0qesZM6Ky+ZyA8DOIhPQpc7Xu5nHGeguskylbANogByJo2S3C6zIWnrGdmag55LJ8XpB9xuZu4V67cSdoG96D8vZfxa0X+fPIu5cLEKPh9z6rfM5gfpwE2FLP9LvXFgzgRAUo9eBpBCiHxP+78a74sl8dz/UsX91aufXVmx
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(376002)(366004)(396003)(39860400002)(451199021)(26005)(478600001)(82960400001)(6666004)(9686003)(6506007)(6512007)(86362001)(186003)(107886003)(53546011)(54906003)(38100700002)(6916009)(66946007)(66556008)(4326008)(66476007)(83380400001)(6486002)(316002)(5660300002)(8676002)(8936002)(41300700001)(2906002)(85182001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MjNXOHI4NGhUU1VnUFBNUGxUQ2ZvYjJpUktNNzNJYkxZRHlDSU9XWFJBdER3?=
 =?utf-8?B?eDNqNTBKZ2VaeUNjS1VONEF3WFpnN3lpTlF3RXJqZFk0UkFFdWd1bG94UTZh?=
 =?utf-8?B?MWVpUHdqZ2x5YlFVK0ZVM3FybC9IS0szVmMvNDNSc2RXV2tpSk9sSEMvK3Fk?=
 =?utf-8?B?V3d3bkdOcVFyQk44dG90Tno2UGRXZE5BZkM3Ry93ZkZ3QmhRN0FFNlJReDJ5?=
 =?utf-8?B?a2xBRzFFLzN2b1FNcFJ0eHpkRHd0S0pEMHlXSG1HZzV0V3kwdkM1V0pVQ0Zj?=
 =?utf-8?B?VUxFQUgxMXU2ZXh5RXdiVlJsTkVielhaU05TY1hINjdnUFUvanBrOGMxVnRD?=
 =?utf-8?B?akhlUDFlbHBWOGJuTUFOV0Q0MEdXWFhUak4yNnhIcVlPdzY3MGtaMmVhRExn?=
 =?utf-8?B?VWk5ZTBmUFFDMEk3bDRtdkFCb0QyQ1B0QWJvOE90ZWpsVmtMYTQ0SDRmY1pP?=
 =?utf-8?B?K013bHFwOWo3VVNEM2M2bUFmblJ0NFVyY3oycGRPcmZ2eGV6Ymwv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/bh5QnWIYVFBxp4TrQAlfnKXx7qpeksPWfD0L8lf80vhh6h9kzEIHW2fUPXRdw96V6avCfg3O5R1XvYqbxXgP6xRs4hwHLSvCxV8KiMWATYI7EyWnGIq0qpnKLQjw34PP5m50aGFSpHB7r+1ReKdqTPB/xM9gYgiGAtgngnVRHkZiLsTQ3Qs0u9kgsovp0MYamdAoujyeGDkCTczGclM4bFyj3kk1jayBR9q6j/FyUVxgbFruhuPu5eeWPA1F9i/U7B7qd18xdihYJI3+DRNOxujw39hO5FOD24j91KBCqwb+f8He8UoKYUkgdnm2IQp7r7e1+MLrWZfF22KbpxYO2agKjpmHKUXHrzdcoThPfUBMcPlLre+lhWfBBPhLjs1lTzcW+fiskQZnhGHPNzeR+KOim6ACwdbuhUPwTs/AYwL3827IDiRTA3nzSV4c2NcLnMvAtZ8L2lRKpWo3Hn7r91FnO7fbDOs6HBkTpRU82Gvt52fnsM+Z3xILK5cGQIUArKEUr6cq5uqsRLFWyaL11a2uIun9Rx/RTGKFphtriQqceAZcCQMGfmvsYSkx94M3p6B6PvHmj1yMuDYYf519xpFzz32A4Br8HMHUoiOJwF/ak2COO9rr/XOnVEeBQ2EYxQYhQMRGAWR+MLOqbpLQd6olK80e5a1C2l2kiNPegL7iTcadCUZqWDQZM+jj4ECzCD3iaG15SwHZJ4+vnU7fSS6Tslom178hc/5TZjFk48RiNP1h6bchUNH6ek95iD1Lc
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: afc26fe2-f393-408b-ae2f-08db7ca721ee
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 15:55:47.5110
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: pCmAeB0DPYKyLXfPYZOABkfYCwNBkmaMg8Mtw/VpFmWMFPcyJV4wreqfCRJF+c+wvWtBFDeR0CMGrDHOGc+hbw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB5100

On Tue, Jul 04, 2023 at 05:42:33PM +0200, Jan Beulich wrote:
> On 28.06.2023 11:46, Roger Pau MonnÃ© wrote:
> > On Mon, May 08, 2023 at 04:46:18PM +0000, Olaf Hering wrote:
> >> clang complains about the signed type:
> >>
> >> implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
> >>
> >> The potential ABI change in libxenvchan is covered by the Xen version based SONAME.
> >>
> >> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> > 
> > Can we have this one backported to 4.17 at least?
> 
> Hmm, while perhaps simple enough, in principle this wouldn't be a backporting
> candidate. May I ask why you consider this relevant?

I have to take this fix in order to build 4.17 with current FreeBSD
clang.  I think in the past we have backported changes in order to
build with newer gcc versions.

> Plus is the mentioned
> "potential ABI change" safe to take on a stable branch? There's not going to
> be any SONAME change ...

Is there any ABI change in practice? Both fields will still have a 1bit
size.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 15:57:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 15:57:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558530.872714 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGiOq-0008GD-9v; Tue, 04 Jul 2023 15:57:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558530.872714; Tue, 04 Jul 2023 15:57:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGiOq-0008G6-7J; Tue, 04 Jul 2023 15:57:08 +0000
Received: by outflank-mailman (input) for mailman id 558530;
 Tue, 04 Jul 2023 15:57:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=D/z2=CW=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGiOp-0007kO-Gd
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 15:57:07 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20620.outbound.protection.outlook.com
 [2a01:111:f400:7d00::620])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6cd0da2f-1a83-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 17:57:07 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB7703.eurprd04.prod.outlook.com (2603:10a6:20b:23c::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 15:57:04 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 15:57:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6cd0da2f-1a83-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=eTpCdJkrYUC5ib2k3qR8mg28jY4QG/Hjm1npOEDkaK4O746fPNo5cKOferVlxLy3YRWft0wrXN3it/hh4rg/oyQi08rtNR3QnRR4E33ngaT1tm80EE235DM2tZ0HFzI/7gAUqRLAdcixn/h8S5bmFBezqPw0lQ6eayOhRAVkzrpi4ENJ6dfE7RNsQspQI8Y8PPk3nBp9pIyXlGKG2V/dAxxWwxFbnxx4HdUqhag0kLph+jcMvhqm2vEs3xojdBPxo+req2zA97Xj7cKiyAYgd+LjhKBYnYb+lM6iuqGATaiZ4j01uTnfPaEdAZsXNVGgmwugRHAd97GB/77Pi/sZoQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=I7hflahPB2lhfBygcWkm3wsGcKXuow/J2FPnNPcunjI=;
 b=bxw7FRA737GN1b/w6B1SqrvWngreHGPwosONpyTLy6fqZ2TPimr/8VAdnCgKEoYko4km80qW+cpGH/r6WGQEoy+7fmtki8auNAxbJ9BWTtGnW7d5z1LLwm6kUUIkSizSuN5PEJA9fHenCf1V7gNe9we6sXX/G10dz2YPmxEQyVl8qDYhyjaJ1jxSBpndiGDe0f0suqus9fxAboDX3+LamCi9ckI2qoTliWIcXsmC/5XjdMpz5WAbGuXhYsKJHetctTYDzWnZ8xPpsL8Rwr+lK5GFqxkQqceTE7Teh6iDhe1c3XNxc7p7ZAB7n1U3a4P7PLU2BUbGWagZXcNf4J+uKw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=I7hflahPB2lhfBygcWkm3wsGcKXuow/J2FPnNPcunjI=;
 b=b8/XwT+/13IpZYLI1khc3oirgPWmS2KlUk/KHMCVapS1kKtEnhvFGr36jp2mDIRX25UkTSGzI56DNTuTnWOK0TaoIISXRTpuSu2qKqhW6Q7Ue/jiJ2I4U3a3QB3w9wBvaTCcVk7iYTFFOBKieeFR6rtCwFVdci7/qy3tUEElv+mOAiD+sWUw//hDPBNx6xvxLdsHQLxuESFUNieF1hmRFcPtZhSzKi/ZwSi+td6XCY9CTKhO+j5hKT4CKBRUyl6VR9xxOq3ptAAC7oJxTVFkfmWLfIAnyFbMRpT9AqpozRH+2H/loeOAeAKW/d/4Zs4SRJmv99CTunIumoOCKMCc/A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ff1a6435-d7ef-eb10-afe2-0fee33788924@suse.com>
Date: Tue, 4 Jul 2023 17:57:10 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v3 3/3] xen: fix violations of MISRA C:2012 Rule 3.1
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 Xen-devel <xen-devel@lists.xenproject.org>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 "xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
 "ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
 "consulting@bugseng.com" <consulting@bugseng.com>,
 "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
 "roger.pau@citrix.com" <roger.pau@citrix.com>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>, "julien@xen.org"
 <julien@xen.org>, George Dunlap <george.dunlap@citrix.com>,
 Wei Liu <wl@xen.org>, Luca Fancellu <Luca.Fancellu@arm.com>
References: <cover.1688032865.git.nicola.vetrini@bugseng.com>
 <c9ff72160539cda49e726ac6ee1486be0d645180.1688032865.git.nicola.vetrini@bugseng.com>
 <771A1A80-0FC6-4D20-84FE-DA0A2DCFF14B@arm.com>
 <alpine.DEB.2.22.394.2306291218350.3936094@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2306291218350.3936094@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0101.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a9::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB7703:EE_
X-MS-Office365-Filtering-Correlation-Id: 7ba64dd3-6949-48e5-1a2f-08db7ca74f9d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	BjuM/f7WNJlOOezweRWRRRXDlglMW26arqpCSkog+JxoamK/4D4VoGbsLY7VjtfexpQngT8PgP0FYKDobu0kHi4dtO0DoiCZ1z1Yo1033bxHzoUoGCwRftrRceTKDhvbfCnJAkZl3jxQ/Rmda4WaXNQySrs0kzx6O6Hh5Bv4Zs1g+I3z5AyAcJxvvIk/03dYD8EryupiGcsa4f7S/e+QZXSoL82ugzBdS9lGRxAiJJvhKvhMIYgsnvch+0UX+0dGk4D/yngKBbj4o81LLWQYNWcZ/RWfOhzgnsNxzbHK2gssNpGzTjEcoLCU1JIpArwUnvzRnnChUB3j8It36XPsAtyEKKXCsADme1A97j5RoplQApkv2R8Bg0kP9a7iITZWidZcTMel2NXTk422u4j7tu8YiwvIjcy93BWbGeF577NubNn3AUk0hut9FRLrPlvbqTZPjB/3Nfnp866Mq+yAedIX5r98uAIdSPQhDYjhc7kDKXvbtLEQd626EyyLMOK2A0YCv9rgKYy+ACAPItG8PZgSdnMJH1CYl8qqaPh/AZcL66LjsqK43N6SzeJ1KQDBtw6eZ1i7MSMtdmFdWMjexJy+T9L1KMFR4v1gU5PC+iUefWd+lWCTO7YC8rdnzIu5ozOuGIzCDeSTybYfbqMfhQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(39860400002)(396003)(346002)(136003)(451199021)(478600001)(6666004)(6512007)(86362001)(31696002)(6486002)(66946007)(6506007)(316002)(38100700002)(26005)(186003)(53546011)(31686004)(66556008)(4326008)(66476007)(54906003)(6916009)(2616005)(5660300002)(7416002)(8676002)(8936002)(2906002)(41300700001)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?d2k1V1FUTzQ2ejMvV1FhVkY5M2tCcXI0RFY0NCtVQjg5Tkx6N29jVzY0SVZS?=
 =?utf-8?B?VnEvOGtRd2NWYXk2bWxEckcwY1E5WmxPeFlMNm5nTGFrR1RYbUdScHMxNncr?=
 =?utf-8?B?UHl3ZFRKS21WS1VJWjNYZnYrTUJwSFVpTUhPTW1GUE53R1duVm5adVMrcTZW?=
 =?utf-8?B?cWQ3YS83Z1BlRzBtcVo2Vk5RL1A2c28ySldVb3F1b2I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VzM4M21zSEZ4R2crTks3ZlZOZDYv?=
 =?utf-8?B?cGZVZGpKYmRlNUdycmcwYWtvS1FoaGhnRHBuMmFibG9kMVYwVkxKU09tSDdk?=
 =?utf-8?B?WWlBR3EyaXQwSUFoZW93ZDgvZ3BpT09ZMDZ5eVljZXpRaGZ1b1FqclBuRzRL?=
 =?utf-8?Q?XxTW3yGxqVke0R55ew/82vhRV?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7ba64dd3-6949-48e5-1a2f-08db7ca74f9d
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 15:57:04.0999
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: KMt2gA21IZtmOwQF3vN/bL4iEls3Dx62OFt0UQldiw2tsT2PsHUuNa+MqqCNUJ9kxNiGwoUQh1JDui3r+UjmyA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7703

On 29.06.2023 21:20, Stefano Stabellini wrote:
> On Thu, 29 Jun 2023, Luca Fancellu wrote:
>>> On 29 Jun 2023, at 11:06, Nicola Vetrini <nicola.vetrini@bugseng.com> wrote:
>>> --- a/xen/common/xmalloc_tlsf.c
>>> +++ b/xen/common/xmalloc_tlsf.c
>>> @@ -140,9 +140,7 @@ static inline void MAPPING_SEARCH(unsigned long *r, int *fl, int *sl)
>>>         *fl = flsl(*r) - 1;
>>>         *sl = (*r >> (*fl - MAX_LOG2_SLI)) - MAX_SLI;
>>>         *fl -= FLI_OFFSET;
>>> -        /*if ((*fl -= FLI_OFFSET) < 0) // FL will be always >0!
>>> -         *fl = *sl = 0;
>>> -         */
>>> +        ASSERT( *fl >= 0 );
>>
>> Iâ€™ve checked the codebase for usage of ASSERT, but Iâ€™ve not seen use of it with spaces
>> before and after the condition (like our if conditions) so I think they can be dropped.
> 
> Yes, that's right. I am OK with this patch but I think we should wait
> for Jan's ack to be sure.
> 
> An alternative that I feel more comfortable in Acking myself because it
> doesn't change the semantics of this code would be to change the 3 lines
> of code above with this:
> 
> /*
>  * ; FL will be always >0!
>  * if ((*fl -= FLI_OFFSET) < 0)
>  *     fl = *sl = 0;
>  */

While I'd be okay with this form, as Luca says it'll get us a different
violation, which we ought to avoid. While I was the one to suggest the
conversion to ASSERT(), having thought about it yet once more I'm now
of the opinion that _any_ transformation of this commented out piece of
code needs first understanding what was originally meant. Or
alternatively, while converting to #if form, to add a comment making
crystal clear that it's simply uncertain what was meant.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 16:04:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 16:04:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558534.872724 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGiW6-0001tt-2m; Tue, 04 Jul 2023 16:04:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558534.872724; Tue, 04 Jul 2023 16:04:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGiW5-0001tm-Va; Tue, 04 Jul 2023 16:04:37 +0000
Received: by outflank-mailman (input) for mailman id 558534;
 Tue, 04 Jul 2023 16:04:37 +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 <SRS0=D/z2=CW=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGiW5-0001te-90
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 16:04:37 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0606.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::606])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 76987971-1a84-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 18:04:32 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB7670.eurprd04.prod.outlook.com (2603:10a6:20b:297::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 16:04:29 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 16:04:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 76987971-1a84-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CWFx1fw4VP7W9ps/a2w1ZGyqb6v0879xA93i3ERNvF3ZzdYYRM7vZzUym8/iCYmsFPO4qfTjUjQtYmTllmCnNyx0BaKq/LgIq8fxx/xOJUzxErvHAWYXpAXI9hJI91sfVveuzqXudRFMLbUTMRQsW4BXdy6VLFOWVH7iai2PkkCXxPWwaz8WMwKq9LXPHDUzB2wo6pCWG9xHFCly6jCfmN3aoqJQZhsQtVDK80scxpa2ofPug+rrj38X1q6gM2K+98WO5Z09o3QHIqsKFQc8H6Gj6NqegdnkbmEefq8Pyj194YlsSJgrqE7qx7lthJV4anZ1SzhECSkumMBPdpmaVA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=hZ/t4T0Rig3rhkRljDfde0rpw+0rv5ls4JN3fAJGi9w=;
 b=mFKlvn2jq9vkg/k46N1PHA6fegOxTT1rOzPtB8GKkuXN8GudWNt6Y8d+MMCtuVwhalGbt8O2fFQEYpfTn0THX+ZLDJtjSmAUYa/fwer2yV4jsjr1JEnT0LXf1ER5PlaxcxAfKGWGG0B52RwFoN6mT+BRHwS4gQXhqYrN091CBQ24j5mL5/2luZIEz8xH9Nf29EMoePQVHKHGB3hf4BF+Wo5XhBJvw+fa9ooQ5jGmNpGM+zCX3XU7WxG+wVCAj1OGBLlbywtemC+3S9/VL1CpCYKLLtWWak+CDE0QZoOCAT7dnXX7Rm6Ebj/NCgJD+XF7C+THfyLoJjrFfCycmw7LKQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=hZ/t4T0Rig3rhkRljDfde0rpw+0rv5ls4JN3fAJGi9w=;
 b=ECRmJYgTRXO6YuhXmkQVDNcpXIoDZMND0QlUATFkc5KtYoEE6xhhUMO2c33hDO0MX5sbn+wnW8VFbqjW2hJIj6sJiREtoX4dD2D/0ULwoBhqrFSvRBf4gRwSlOQpM7xJk67yCwtAHuR8qhSkrQUuXPJaD/NTSGWxXzwnWtP4HKx9ctXYFWtGt5f9iULWRa0ceM6o3OXGYptPo4YRMAxjNRSy0nCIepUNoy1WkDvfPeRX5sud1DZYyt1tkyI2u7PaXw92ZtksDNS2M372gmkl2uik9ME1mTBCgEeOVuwGI7jcUUqtMdIyxYtmy0amNCfvrtc8xJfHwHE+hczfRvSlLA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <39e5b62b-d863-ad2b-5e9a-461fab6c9d31@suse.com>
Date: Tue, 4 Jul 2023 18:04:36 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: Backport request (was: [PATCH v2] tools: convert bitfields to
 unsigned type)
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
 Juergen Gross <jgross@suse.com>, George Dunlap <george.dunlap@citrix.com>,
 Anthony PERARD <anthony.perard@citrix.com>
References: <20230508164618.21496-1-olaf@aepfle.de>
 <ZJwBkHLwKJNuhekG@MacBook-Air-de-Roger.local>
 <4d049335-71fd-8fe0-0f9a-dfdd16fcf41e@suse.com>
 <ZKRA_X9uudh6TRov@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZKRA_X9uudh6TRov@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0110.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a3::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB7670:EE_
X-MS-Office365-Filtering-Correlation-Id: ca527de2-58b8-4b9e-0b36-08db7ca8593c
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	QNw3w898k0cN8tAFG6/lJCshqNqsQzWd+7o5Z2kCGNm8otOTUPheSfhs5P7nMSnZFpO1oy1fpqvFdE/F6/B1TG1dm4+W6vLgThaMz+xd4Q94PMI+oq+isxXBZYC/UDjrwZXPfBho3dN4hOZXezcFpkPLu1HB57/x8kCTulhZxTVzHfCjKdUjnxMPbfzHrxOyy5Z3pEaPY3rUubM9E2SbStjDLKfeNJAEmlgB7daYXeV+HhhPZBWDudmKy4zSR5Txi42IMouNjd/QSO3hAWzs/p9brLDvQZ3bzuTSvR+mgIvPh+cB/QjY6C424nujZcW44OXU46PsxPGHISu+a7dbkchWXcAAs7hv4tUV10CniavukXU/sdCOyxu/Ax3U+xQE/gw4fvp8RLiShvgYCV8vDi/WubckGaG7qtBPHa4vmqIe0cgwnFbfC10/mRiOYqOECv3G/l4c5qLvAsw/D8Av7obO+026QKLgTHHChVTzZcan1eInlWZzCB7XV0E8HBhVgwLytEvOZY3ACbPc5w2Y8WS/lalwappKgNAk9mK38D+vBJw+nhkef1m0CN9XK2xeLVNSHQmCs2KLv5vAeIHOrgx+ngNzHG/1a77RNEGg1kLrUi2SKbFHv9RoC3Dw/KFFQIK/HzrYYweoULoLRa2GSw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(136003)(346002)(396003)(366004)(376002)(451199021)(8676002)(54906003)(8936002)(478600001)(26005)(6666004)(41300700001)(36756003)(6486002)(5660300002)(2906002)(31696002)(31686004)(86362001)(4326008)(316002)(66556008)(38100700002)(66946007)(66476007)(6916009)(53546011)(6512007)(6506007)(2616005)(186003)(83380400001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QWVhRHh4Wkd2UCtscGpCU2R5alhGejNOUFBYZnoxT21RdmdOQ0VEd2RjYkw2?=
 =?utf-8?B?cTRUZzA4U0pJa1E4WHZKdjZvRzdDdW9MZHZnQ2s3M2lrVmg2WWRmODlEMkpW?=
 =?utf-8?B?VlN0cklCTkFiRWJTZjdLQUNEN0xnbFhzRGlnTUNxTjN0bXBIbmVhVlFvSDlX?=
 =?utf-8?B?Yk9DSWl5ZklZOHpnVmxreEdYVngwUmJpcXZYeWYyaFl6OTBaSERLWmRLc29V?=
 =?utf-8?B?WWhqVnFybjU5d25BV3VyT3puNElTUU93a2tTNjVua1ZhU210QkNPSzhXTTdv?=
 =?utf-8?B?WC9sV24rLzBDUWYwNmp0OXpNYzBKd1kyWklQR0FNbkFNS0FHYXBPL3BBOG1Y?=
 =?utf-8?B?OHRkcHp2L3U4MVZnNGZHK3FvaHBLWVpVeDlsMW1oNVZzbml4RU9xWEVjMWM0?=
 =?utf-8?B?TGdJWjAxVThUL1VwczY0Vk9kb3lzbi82OTJoaFdVdXVZR0RSL3QxdUlZeUVI?=
 =?utf-8?B?UmZRVVNoRy9aSkRIWmpmeENRRG1Kd3NHOG1PSk9uSWErRzgwbGVWMU1XbHZC?=
 =?utf-8?B?UTZRcENhTGlmcDJ6cGUxSmpPUTFzVStVT0JNZWFTd1paN3hKRXB1c0hDRkla?=
 =?utf-8?B?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VHczcm5HNnpwSWRTVUt3ekJEVW02RHBGRk1p?=
 =?utf-8?B?eTZsWGxFak9MVXo4TzRHaEdyZTdkZ013OFhwOHZrQmZiemViSWxUZkxVN2d3?=
 =?utf-8?B?NHd6TEl6aVRLa3pkWTI5azlsU3dsc1lnSFlhMFdIWGg2MFZYZEs0dzN3aVMw?=
 =?utf-8?B?MU9qZ293SmdkeElndUpCaWxZd1RBM1RxWU5yWVJRUng0R0o2eWhPMEwvQ1Fk?=
 =?utf-8?B?OTFLc2NKSzkxUEV0UlQwVnQwbW5JZVdLQTVXRW1iY21PRXJzQUQvODRMSFV3?=
 =?utf-8?B?UmhzbHBnbmhIZU5DdzFCWm1iZFVvZWs3SGJlRXAwcFd5aWdyeUJreDAra0RF?=
 =?utf-8?B?Tm12QTdQVm1ybDdSSG5WcTNyWkJnZmt2NFVVd1pWYklnRS9uSEd4UHptZXlF?=
 =?utf-8?B?MlMyUkowMWhsMXhKNGVacElFNndrR2xBNzY5QzFzUzZhSThMaXZWY2ZCTGNP?=
 =?utf-8?B?SWN1LzdtMUhUdnlFVEhCZlQrdU0rc3lKSFphT3RoRzJLdjAwelRzZmZuby9o?=
 =?utf-8?B?RlJuazJUZlB4d2RRV3RiRmFkaU5ld1BEK2RxTGlBdXQ2K1RaUUp5UmI4ckdI?=
 =?utf-8?B?cWo4K2dGVkNxbnhjM1VtTkh6OWFIU2JZOCs3dGwyTFppc1dSbUQxdDhvMVQ2?=
 =?utf-8?Q?FSFOH01aQ2mfJUEOwCufoQNYt?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ca527de2-58b8-4b9e-0b36-08db7ca8593c
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 16:04:29.7507
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: QDFUzbej74AZQDwkybiKsNZTOswAImw+sv0THhdmMn57+FH8FE/lFBR7xv15Nj4rYbz/QALk62SkO+DBNkTj1Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7670

On 04.07.2023 17:55, Roger Pau MonnÃ© wrote:
> On Tue, Jul 04, 2023 at 05:42:33PM +0200, Jan Beulich wrote:
>> On 28.06.2023 11:46, Roger Pau MonnÃ© wrote:
>>> On Mon, May 08, 2023 at 04:46:18PM +0000, Olaf Hering wrote:
>>>> clang complains about the signed type:
>>>>
>>>> implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
>>>>
>>>> The potential ABI change in libxenvchan is covered by the Xen version based SONAME.
>>>>
>>>> Signed-off-by: Olaf Hering <olaf@aepfle.de>
>>>
>>> Can we have this one backported to 4.17 at least?
>>
>> Hmm, while perhaps simple enough, in principle this wouldn't be a backporting
>> candidate. May I ask why you consider this relevant?
> 
> I have to take this fix in order to build 4.17 with current FreeBSD
> clang.  I think in the past we have backported changes in order to
> build with newer gcc versions.

We did, and this is good enough a justification.

>> Plus is the mentioned
>> "potential ABI change" safe to take on a stable branch? There's not going to
>> be any SONAME change ...
> 
> Is there any ABI change in practice? Both fields will still have a 1bit
> size.

But what a consumer of the interface reads out of such a field would change
in case their compiler settings arrange for signed bitfields when signedness
isn't explicit. We don't dictate, after all, what compiler settings to use
with our interfaces (which generally is good, but which bites us here).

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 16:10:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 16:10:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558540.872734 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGic2-0003Rb-Po; Tue, 04 Jul 2023 16:10:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558540.872734; Tue, 04 Jul 2023 16:10:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGic2-0003RU-MK; Tue, 04 Jul 2023 16:10:46 +0000
Received: by outflank-mailman (input) for mailman id 558540;
 Tue, 04 Jul 2023 16:10:45 +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
 <SRS0=bK4X=CW=citrix.com=prvs=5424eaebb=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qGic1-0003RO-Mp
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 16:10:45 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 52aebf9b-1a85-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 18:10:43 +0200 (CEST)
Received: from mail-dm6nam11lp2170.outbound.protection.outlook.com (HELO
 NAM11-DM6-obe.outbound.protection.outlook.com) ([104.47.57.170])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 04 Jul 2023 12:10:40 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB5789.namprd03.prod.outlook.com (2603:10b6:a03:2d6::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 16:10:38 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902%7]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 16:10:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 52aebf9b-1a85-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688487043;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=Bt93nT1zg9KTYasM+uWVMwdTK6kw7XhoHbQfLpgTvUc=;
  b=X56S/Wgj7YF2I/TVleANf9FlQLQzQiZhJgAKULZfVhslItkGPxHkoD0w
   IayHqSSwJsLzAeJkTzJ75xy7i1GqFmUhldS+CE9mwNxqfLqutGA+rBoHP
   wFEl6Qak48pb+oVi905OOKzASr29XOnxYI9YvIlQVyLnjhL0d0FnnZ+7z
   o=;
X-IronPort-RemoteIP: 104.47.57.170
X-IronPort-MID: 115013130
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:pNoBYqDs0HRPjxVW/xjiw5YqxClBgxIJ4kV8jS/XYbTApGkggmMDn
 2EYCzyAOP2OYmL3fdlzaIi+oR8BsJGHyoBmQQY4rX1jcSlH+J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Y5gQCfO76DrpMzSxoxG7+eqU0Ehi65?=
 =?us-ascii?q?F5cSJOwppHiqz1hu4F9o=3D?=
X-IronPort-AV: E=Sophos;i="6.01,181,1684814400"; 
   d="scan'208";a="115013130"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=oUsftBTPZMzxfsfjxodgIKwfju0PGHh9hLpRhUNb3nL53OeuxtoLb9A034EoyVgjAqeBJdwyQa/UHV6wOwOEXe79KASsO46lPp1CLsWQV/Td3pw0TXm1PzIbdu8yGOfIfQuTLrtYNvIh/pfFPvl0TX1daxb3f4sa/LqZjNtp2SPYwIwux+hb+ixKqOsEL/dmBEJliXKlJT0dEwXpgUEmruMxhdz5bmUeRZgR2DuKX00Jo5kKverx3DGuDko5seEiP69Qty1EUx9VVVieDPj6xzhi1evRwVqb4BXorqS7nudGcTVYoeMjKKuUAXgg5rn9oi49xUjmnxEwa+QOymBrUA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yIKXBwrWOoEo2vpzPk3libQACzHijNXPMKP0KCbHiu4=;
 b=oFh57AbBnfyO7cQcXa6Y93VPWYICJmljK1oAekM4C0fSp4sCyL++Mz9Oq6/clcdZFnboK6/GVTIqlh1exW/idLOBmfVFztfRT2T7Y2gstl27VOZpV0cXnu3RubxJIyOGSO7hWtRh6LvDY+5OhqrBndI9kRc6mKgPfzSB3TiVMZvSILyiMCtOi3qCJlWhIa2+ee1fZwBI7ejh2nmydjkE+vbkxZYAGKoMns8hEoVTS+Py+n3dhNi1iIrJ5JcMPq7LkeAkZuguxMXZt3+55j3QbzNtli4nVR9Jp8hdj2dBPIKQ9XDurjGCOaSAAzTca/9JDxz+7z51Pj0Uqs8+c6sEIA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yIKXBwrWOoEo2vpzPk3libQACzHijNXPMKP0KCbHiu4=;
 b=l9wVkJpqvn4G1kIuDOBsZYvByh58uBfwqcbo6wncacv3ucg6tWZRmA7hf0MTQ9xjYAl+nU80nybeJsZZu3UhwwNYLoS/pZscvkCZyeAPHOjAWsm1NQkMbJ2hpqPpcCCPquLKAOhWJnqklpa4Fkt2kbmnGdVThGsRqnJJS3rZbj0=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Tue, 4 Jul 2023 18:10:32 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
	Juergen Gross <jgross@suse.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: Re: Backport request (was: [PATCH v2] tools: convert bitfields to
 unsigned type)
Message-ID: <ZKREeO2XJ9C8FYOM@MacBook-Air-de-Roger.local>
References: <20230508164618.21496-1-olaf@aepfle.de>
 <ZJwBkHLwKJNuhekG@MacBook-Air-de-Roger.local>
 <4d049335-71fd-8fe0-0f9a-dfdd16fcf41e@suse.com>
 <ZKRA_X9uudh6TRov@MacBook-Air-de-Roger.local>
 <39e5b62b-d863-ad2b-5e9a-461fab6c9d31@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <39e5b62b-d863-ad2b-5e9a-461fab6c9d31@suse.com>
X-ClientProxiedBy: LO4P123CA0587.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:295::15) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5789:EE_
X-MS-Office365-Filtering-Correlation-Id: dd341efd-c86b-49a2-f5a2-08db7ca93493
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	wtP6mhAMfZr5WSc+sN2C+bFM7WIfALp1ZDHI0aWi8NirZSSDA2oUR8waNpB5Ci9DtcRpIGaDeP1ZDSHWGzI2kmiye8tA67UozoM1kpVt+jZLcT4TSEVkQoCjJxAicR0YBSZ31I2gvnkK7bzSVeDQ9xFDVTPmBs2iLPggr5VvElXS65H3DIExzoutXRY1p6vBbsLhKR3f4r/wluhWYouvstKXanrGMtGY/e7/1k54AXYJYmgn7UnAblaXaO5GCHbFVme771F+Hnz1E8n6aU9o6p0QP306ojBojDnA8V6iICYY1JQhoi66VwEgihP1Q1SQCsQMAaJZu9jGwNxJ0FNDB3dCrmbU7vtmYDByS9rAFjglBOYqecPvfDRhR3Hu3k8LApesTzVdQ+3MMf+qZz9QCspWVB+lpmDFPEqgUScvTLxIbTQvazfYV0/alxGhZHj5izn6t7o5DXfduRavn6GVh7r2xy1iro4bFis5M9gOpC5GZR4cKq+x3haTpw8ZP86OYrM72zzAeKtyM3NXP2GvmEYXL1Jp0xtfJKTujRSHFF7YkaLKC6HRjgC/Yt/7eGsL
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(39860400002)(346002)(376002)(136003)(451199021)(2906002)(41300700001)(8676002)(8936002)(85182001)(5660300002)(86362001)(186003)(478600001)(107886003)(26005)(6506007)(6512007)(9686003)(6666004)(82960400001)(53546011)(6486002)(316002)(6916009)(66556008)(4326008)(66946007)(38100700002)(54906003)(66476007)(83380400001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?anFwY24yem9hZjRWZ2lLMExUc1F6SjBoaGdHdEpIczlhYmF2ZkN3b1NPbHFG?=
 =?utf-8?B?QW1BWnhIdzFhckNlVHJ5dHJvOWZ2MDdZdXovZkhpMytzNG8xMTBiRmVac0Fh?=
 =?utf-8?B?TnRKdGNGSzcrR0FGdmlDaHNzVDJTOEdteFB2cFlhWjhLOU9LMndlRkN1UCsx?=
 =?utf-8?B?QWZIRXdqcGFkNnpDVU93M0ZqZ3VNRkRWMnlzUDk2NHdKVEJqNTFSYVdYbE1M?=
 =?utf-8?B?ZnFPcVAzbVlaUml4cVM4M2I1WDB0YW03K1R2UmFocUZ0MUl0YVVwYWxVQnNv?=
 =?utf-8?B?T1dDMzkvU2UzTVZVU2Qxam9DRVJlQTVjREVyVS9WMGRWYVkyTDNBanlUZnBx?=
 =?utf-8?B?d1NOQ0FDSGtvcjFOTTNXYmh0bEtZdzg3ZGRiekg0YWFPdUNlYW04TG05aEVW?=
 =?utf-8?B?clorbnF5RFl5NnRnU2RsYm9XclRlR05qd0Jqbm5mc2dVdzhobHBiNUJPVWdE?=
 =?utf-8?B?bVpuWnNXbTZ4YWswMWhEWmdiQUJCNE45TUdXTVNLSVFqTFZTT2NicDhkNW53?=
 =?utf-8?B?cGY1Rm5WNlFzMVNYUGRqbGdjMmwvUVcxUm5uOUVaUUcxSHVlb01wbkxSMHJS?=
 =?utf-8?B?V3pZZG5FbFVkS3VmQ0lPcWl2YUh0ZVNIS2M5QklUc2w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82iROq9OSS9aPRpnCF7d751CC+epdJdbirviHN2lUXQXIwRyyqx94W7HQ9Hl5/vRBxHtJR+5oqZgvmzTos6mfnZ+/nLKEUI3nBRmhkmHFTlveGDxdgSEuZEhps77uii+R4LMQN6H+h/ZKSkcqcios24FoWPcJpDP6eqVxZ22UbXmViU26N7Y0dxMYonU27Axe7M1I0E7Ji5ieSRWBseUWu7Tbo1VJ4CwwKn/L0x/d0SqnFUx55tceNhsm1VV/aqQR/G9FB6ldbgm23/s6QcxHg9KcjjbTQ9FEo1NzXBnO9F0On4g46s75w0898gZm1opdIf7eA/VJWljpmr2Z/L2KaDk2az6pIOSP+KC9y+FpG4xZZ1komBCxF5RFJztlbpXBkf9ZPIoQXabMrugcfC3RL3ytamTkW5UelDRx5bs+SflpCt3AKiUauqxiPrCkFV9VNxoEMFzhz+mY07ZSUX9rnCnOqZUuOpI2fV1lGgl4bicAw616bpNqb+vSsZrKNaqytlCx7+HWPVKPiMxGvlCaL2MLfKzvCb3gKFScdT5jYp0QYttueULWZm6bbDO6ha/ouIwrlLlDwqgjRhGy/Jvvp1oqJOyG/6i7GRBLaLDs1iCeaceKXWv9QkHOgPou8bC25QllJjrGNsYz3jbTORWOoVn7oJLWckErawALeIB9XIPaJ14fm
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: dd341efd-c86b-49a2-f5a2-08db7ca93493
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 16:10:37.9181
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: NDYL2OysTQWyAWAwdUfMZeORrtOFvyPyTfqxqyKjI5uRmx0cXKc97lYvz0VZm1zjGeOHy+0ne7NffRRW4gKvOw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5789

On Tue, Jul 04, 2023 at 06:04:36PM +0200, Jan Beulich wrote:
> On 04.07.2023 17:55, Roger Pau MonnÃ© wrote:
> > On Tue, Jul 04, 2023 at 05:42:33PM +0200, Jan Beulich wrote:
> >> On 28.06.2023 11:46, Roger Pau MonnÃ© wrote:
> >>> On Mon, May 08, 2023 at 04:46:18PM +0000, Olaf Hering wrote:
> >>>> clang complains about the signed type:
> >>>>
> >>>> implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
> >>>>
> >>>> The potential ABI change in libxenvchan is covered by the Xen version based SONAME.
> >>>>
> >>>> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> >>>
> >>> Can we have this one backported to 4.17 at least?
> >>
> >> Hmm, while perhaps simple enough, in principle this wouldn't be a backporting
> >> candidate. May I ask why you consider this relevant?
> > 
> > I have to take this fix in order to build 4.17 with current FreeBSD
> > clang.  I think in the past we have backported changes in order to
> > build with newer gcc versions.
> 
> We did, and this is good enough a justification.
> 
> >> Plus is the mentioned
> >> "potential ABI change" safe to take on a stable branch? There's not going to
> >> be any SONAME change ...
> > 
> > Is there any ABI change in practice? Both fields will still have a 1bit
> > size.
> 
> But what a consumer of the interface reads out of such a field would change
> in case their compiler settings arrange for signed bitfields when signedness
> isn't explicit. We don't dictate, after all, what compiler settings to use
> with our interfaces (which generally is good, but which bites us here).

Hm, I see.  I would argue that sign doesn't matter here, as those are
intended to be booleans, so anything different than 0 would map to
`true`.  But implementation might have hard coded TRUE to -1, and the
change would then break them?

I'm failing to see that, because those implementations would still use
the old struct declarations they have been built with, and hence would
still threat it as signed?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 16:15:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 16:15:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558546.872744 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGig7-00041Z-9o; Tue, 04 Jul 2023 16:14:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558546.872744; Tue, 04 Jul 2023 16:14:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGig7-00041S-6h; Tue, 04 Jul 2023 16:14:59 +0000
Received: by outflank-mailman (input) for mailman id 558546;
 Tue, 04 Jul 2023 16:14:58 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=P5qr=CW=infradead.org=willy@srs-se1.protection.inumbo.net>)
 id 1qGig5-00041M-JB
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 16:14:58 +0000
Received: from casper.infradead.org (casper.infradead.org
 [2001:8b0:10b:1236::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ea1c686f-1a85-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 18:14:56 +0200 (CEST)
Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red
 Hat Linux)) id 1qGifB-009I83-IW; Tue, 04 Jul 2023 16:14:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ea1c686f-1a85-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version:
	References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=R1W87rnlNGGe3O62ySITe0WV/TkO13M6jrCnVpdBC/M=; b=ma0abi+l8BKnWZyE2Bm6SMUpzA
	GY/Sg9bKM4QGi5Fi3SxYqWXxJ46oHMzkk2XTYG6szPrdjaFZvCOeUvh2qeA+qFPnGTya2tgZ0Czoo
	anlh0yET7VOr2nReXBjhvXLbethMJyMQRtOEtJdxTJlnJDQLzVkEFxU1z6LlHa+R1Svpz+R+Zi/2e
	EbHE+jMBvtLJPxFFKggvC8J4kNKoPgnxYJ08D38bFVgefZT0kn05//LL45wE920g1ut/XHRnJF4Ur
	2JcraLDAhTPQ+qGFyYF+arcI4MuDDkahpy1OJ1ZV5vzT8Q6c9E3mK76aIjApGP0H0G7MQh7QY3lZI
	j0pVBAMA==;
Date: Tue, 4 Jul 2023 17:14:01 +0100
From: Matthew Wilcox <willy@infradead.org>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Jan Kara <jack@suse.cz>, linux-block@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@infradead.org>,
	Alasdair Kergon <agk@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anna Schumaker <anna@kernel.org>, Chao Yu <chao@kernel.org>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Dave Kleikamp <shaggy@kernel.org>, David Sterba <dsterba@suse.com>,
	dm-devel@redhat.com, drbd-dev@lists.linbit.com,
	Gao Xiang <xiang@kernel.org>, Jack Wang <jinpu.wang@ionos.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	Joern Engel <joern@lazybastard.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	linux-bcache@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org,
	linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org,
	linux-nilfs@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-pm@vger.kernel.org, linux-raid@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	"Md. Haris Iqbal" <haris.iqbal@ionos.com>,
	Mike Snitzer <snitzer@kernel.org>, Minchan Kim <minchan@kernel.org>,
	ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Song Liu <song@kernel.org>, Sven Schnelle <svens@linux.ibm.com>,
	target-devel@vger.kernel.org, Ted Tso <tytso@mit.edu>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions
Message-ID: <ZKRFSZQglwCba9/i@casper.infradead.org>
References: <20230629165206.383-1-jack@suse.cz>
 <20230704122224.16257-1-jack@suse.cz>
 <bb91e76b-0bd8-a949-f8b9-868f919ebcb9@acm.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <bb91e76b-0bd8-a949-f8b9-868f919ebcb9@acm.org>

On Tue, Jul 04, 2023 at 07:06:26AM -0700, Bart Van Assche wrote:
> On 7/4/23 05:21, Jan Kara wrote:
> > +struct bdev_handle {
> > +	struct block_device *bdev;
> > +	void *holder;
> > +};
> 
> Please explain in the patch description why a holder pointer is introduced
> in struct bdev_handle and how it relates to the bd_holder pointer in struct
> block_device. Is one of the purposes of this patch series perhaps to add
> support for multiple holders per block device?

That is all in patch 0/32.  Why repeat it?


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 16:15:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 16:15:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558551.872754 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGigx-0004ZJ-Jh; Tue, 04 Jul 2023 16:15:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558551.872754; Tue, 04 Jul 2023 16:15:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGigx-0004ZC-Fd; Tue, 04 Jul 2023 16:15:51 +0000
Received: by outflank-mailman (input) for mailman id 558551;
 Tue, 04 Jul 2023 16:15:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=wHuo=CW=invisiblethingslab.com=demi@srs-se1.protection.inumbo.net>)
 id 1qGigv-0004Yy-Kl
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 16:15:49 +0000
Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com
 [66.111.4.28]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 082aaa87-1a86-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 18:15:47 +0200 (CEST)
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.nyi.internal (Postfix) with ESMTP id A58115C00F4;
 Tue,  4 Jul 2023 12:15:45 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute4.internal (MEProxy); Tue, 04 Jul 2023 12:15:45 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 4 Jul 2023 12:15:44 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 082aaa87-1a86-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm2; t=
	1688487345; x=1688573745; bh=Fp/8yqcayF4NwPyZG43PI2MRc2q+xpq7Gn3
	x+6aR+dQ=; b=gB3yGAY34WJrdgMzVzTTU8qsZCzOygCFLug18pyQoj6BKfrDX2s
	H89w+cTaZS5txeMF2ByItwHyhEB+AogK9LfI2rEPXhESkXrZaBG0GIt7n5EHySAD
	ZrvL7C3XlU/oDb1J2q9bldWjP9RlWr6YJeKgAPtiO0Xy7rL7jcIzK9x8BequmKLZ
	UEPxgX+OI65aoEdSdPFdRBIAMnawwiwZUBm/W8kH5/WY5xU/l+Raf+upfdNEJ4sS
	78BYxSDUkGgGHsdkd0BzCYbKSbfkNze4M8JEf1ZR4wDoJzOsAxaOIAs2IynuWAlv
	uRjQzLq8556s00O6nBeuIGFYzge81VQ8jgA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm2; t=1688487345; x=1688573745; bh=Fp/8yqcayF4Nw
	PyZG43PI2MRc2q+xpq7Gn3x+6aR+dQ=; b=fqJgrCQxCy0aPhjZxaCmcswj/Sb0r
	m5vjb6Bzk2Q1nzog0d2QLS/j6qygEPACAUllywoixnoE0PyPBkz0Ky4W1PTSOUsZ
	E9tliLXEfcYjt5me0Qr7Jht3sDd/gEeE6G4+aU6kV817FfTR5T2TJ+6nNfNUuMo4
	jLZGur1iVF9y3MZbYADVaxSLjjPfT5cGjMsg2yMYOLyrZQuG9lKRBn4j/TFgTztj
	TCXBF60871Dc1yXoxfO6P3y/CKJZqo3RrzJnx8/xw2wyd+jD1a6LJZSW/J8WtbRM
	wiMOWgW9v+R/I4NbruXrFhe13uPSshAh3oQ3AYbi2Pylv1vDTHRC5/+rA==
X-ME-Sender: <xms:sEWkZKH4jgHa4KI2nPgPHQ5LBDgdydN4VUBmlNZvh68qje2tBmX5IQ>
    <xme:sEWkZLWeojckH-4Euo99iwalgoeCsa6DW38yNZ0BdBc6-fGX119CLf12yPDD5WVAP
    Q6P1ke7tLX4AJI>
X-ME-Received: <xmr:sEWkZEKJEAccmI15AAOvJvaM_JUWNN0K8ZZGbbr2V1NpGqNvsUphcjBePOoueQxu296ZNTzKlc5TOEPEPyoKOUOSl2gDlKgh4KVuBCyZbTv1tkGk>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeggdelkecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeffvghmihcu
    ofgrrhhivgcuqfgsvghnohhurhcuoeguvghmihesihhnvhhishhisghlvghthhhinhhgsh
    hlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeduieelfeeutedvleehueetffejgeej
    geffkeelveeuleeukeejjeduffetjeekteenucevlhhushhtvghrufhiiigvpedtnecurf
    grrhgrmhepmhgrihhlfhhrohhmpeguvghmihesihhnvhhishhisghlvghthhhinhhgshhl
    rggsrdgtohhm
X-ME-Proxy: <xmx:sUWkZEEpF-cVJXnRaWZuFka8dxOK3bbtNyKIVStjJV4j8fh841CTLw>
    <xmx:sUWkZAW7HNYGP3rI0Uu8Mtft0hVHLVbG5rw9zaLPfnF_sRxesWR6cQ>
    <xmx:sUWkZHO7xDkZMOIm2izF8XmdYkF9OoRGKzfQbp4xFHpavltfK_HFaw>
    <xmx:sUWkZKcmw0RXdHVhky1PWF06v67TCuN0z0gMc8Iez5cGTPNOvtqYvA>
Feedback-ID: iac594737:Fastmail
Date: Tue, 4 Jul 2023 12:15:40 -0400
From: Demi Marie Obenour <demi@invisiblethingslab.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Xen developer discussion <xen-devel@lists.xenproject.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	stable@vger.kernel.org, Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH v3] xen: speed up grant-table reclaim
Message-ID: <ZKRFrtHQ0Gll0IpY@itl-email>
References: <20230627172216.1359-1-demi@invisiblethingslab.com>
 <c11f1c6a-795d-2245-0571-ea956f7881d2@suse.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="KiAHZyX4uOBKxCD9"
Content-Disposition: inline
In-Reply-To: <c11f1c6a-795d-2245-0571-ea956f7881d2@suse.com>


--KiAHZyX4uOBKxCD9
Content-Type: text/plain; protected-headers=v1; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Tue, 4 Jul 2023 12:15:40 -0400
From: Demi Marie Obenour <demi@invisiblethingslab.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Xen developer discussion <xen-devel@lists.xenproject.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	stable@vger.kernel.org, Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH v3] xen: speed up grant-table reclaim

On Tue, Jul 04, 2023 at 02:07:47PM +0200, Jan Beulich wrote:
> On 27.06.2023 19:22, Demi Marie Obenour wrote:
> > When a grant entry is still in use by the remote domain, Linux must put
> > it on a deferred list.  Normally, this list is very short, because
> > the PV network and block protocols expect the backend to unmap the grant
> > first.  However, Qubes OS's GUI protocol is subject to the constraints
> > of the X Window System, and as such winds up with the frontend unmapping
> > the window first.  As a result, the list can grow very large, resulting
> > in a massive memory leak and eventual VM freeze.
> >=20
> > To partially solve this problem, make the number of entries that the VM
> > will attempt to free at each iteration tunable.  The default is still
> > 10, but it can be overridden at compile-time (via Kconfig), boot-time
> > (via a kernel command-line option), or runtime (via sysfs).
> >=20
> > This is Cc: stable because (when combined with appropriate userspace
> > changes) it fixes a severe performance and stability problem for Qubes
> > OS users.
> >=20
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com>
>=20
> Why am I _still_ - after two earlier private questions to the same
> effect - on the To: list of this submission? Please can you respect
> other people's time and interests and properly follow patch
> submission rules, applying common sense when (like has been the
> case in the past for Linux) those rules result in overly broad sets
> of people.
>=20
> Jan

Sorry, I somehow had that in an old version of the patch, and was
editing the patch by hand rather than generating it with git
format-patch.
--=20
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab

--KiAHZyX4uOBKxCD9
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEdodNnxM2uiJZBxxxsoi1X/+cIsEFAmSkRa4ACgkQsoi1X/+c
IsFzEA/8CaiCw3M57idWrMBHxn3aMAdco5w3dfBtLah/UZ3EfXD5Cj8cCWKfW/Qg
+6SRIil/gPCSnXS/l0S+/hfLQEHLb+00kYqVEf6eWVhylAKF2p3bybtkk3PcwX8C
8wfIVIGznoRrf4Si0gmVJOslHW30Jup8nOVHFEq9CCvwUB+1FC/doS85zmlSqMSf
hXUMZVnWfVtxcKNoyKFZ+gCSQNKmL8r6z8OO6lN1QEbo3DmfCRR55NeHEEuZi4RE
+LUtuIhlQQGcQ13dinZiMaO6wkkUnNCEcaYCyZ+XMuSd2BZfzZiiw5kHT6eWNsoq
Pa9NihyEMsmcVvs6zh4tY2KF/P52Ri1M7ptgsU3Fj7qK04goPRwUm/VcdGzFSg+L
qxJgQmLc7FdwSK0KP9oF81rfPsYN5743bmaAQNaakCZ+H+WDqZPYvcb8wNaNFlpi
F4FqU2BJK3JT3HQNEMoCLJjChS9Pi8AaTdDxEOsxxmKFMi/Wx9UX6U8WtdRhCv5O
Dqj3goBK9bkd3b9zIZXbmgHHHkAFJQLzfb2r8ftBWzZxXrCpV6OQmTnUiwC+kfng
rXxFuAgBB6q86TY9to89O14n8T3hT5/Uwl8Ij/z/SUFnO1axRelEaCpj3FA16ODS
mIqyF8EqrJZ8YvGBlziGyPNY9Qec+QdhYAwDReBI3faku5WuUqQ=
=FuCD
-----END PGP SIGNATURE-----

--KiAHZyX4uOBKxCD9--


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 16:16:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 16:16:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558558.872763 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGihk-00056k-RL; Tue, 04 Jul 2023 16:16:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558558.872763; Tue, 04 Jul 2023 16:16:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGihk-00056d-OU; Tue, 04 Jul 2023 16:16:40 +0000
Received: by outflank-mailman (input) for mailman id 558558;
 Tue, 04 Jul 2023 16:16:40 +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 <SRS0=D/z2=CW=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGihk-0004yL-73
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 16:16:40 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on060f.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::60f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 272615f5-1a86-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 18:16:38 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB9517.eurprd04.prod.outlook.com (2603:10a6:102:229::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 16:16:35 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 16:16:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 272615f5-1a86-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=dToEMdClDj7BfeDOGuYViJkHw9ah+c6JzxTAJfROepAGuX75Ap/cmoYIKoHBuAy2LqhxtDl0xWFSoZsql9RdQJrCyxrJQfQ0fWJKb1ohAO462oJf1hSY9t8YHnDPe85Ti0dk25kpqTaRNS/bdAF4VzuYFIrSKzHHYmbWdY25OM9cxRoOat7qyvAzjKyFtqbXtE+0D4IwYy8aZzh105Dntw3eh5O88nr+MyQjUscCU1hGVQt0fC7Qn7NOviFyBhuIBLR1W2wB25jZ77Ft6/hFQ4OtDMf2oxUbta/7+zjP2SE7ld3uCO+KjxQgX4y39BRzmrx4tDcutlVAtdWzliFomw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=by9dNAtVxlZdy0Y9TdvuDIz6tOBX7yrl8a2VU5AbR3A=;
 b=L4FwodA53QSEc4Y19L55ixgKKLQG8RCOTU8cpVkDO2SG/uGWyU/iA2kMZFMuGkyHKz+2V+EQSH3hehyGfLZEOOyXRAQBu+5kVzLlOUrHgoMXSIjID48QTTdwxE1F0/g/fDlbYt5mFb/oH2/x1O1tuFcBkeWQNRyTwNbHH/anvSx/UzFJnYbOjm1Pte7c8cUiYhHRYWDpJrofeU8iQavqEIIu2EFXs4H/gnw23BHIxZb1P0nHF2iJHjQH27Hby06fqk9inenyZnbGM9I4P/dP3eJkY4oUad+duS3XmihG21NE0Y+OQzsrih9JwhotpFuXjQz2us3wbNdFHogYBmZBBQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=by9dNAtVxlZdy0Y9TdvuDIz6tOBX7yrl8a2VU5AbR3A=;
 b=4vX4WghEc2yuf2nP9laUpNIyFBCwftcCWpO1a9L3XgcXK5J5TkoAaQF8U6KOSX0pFa93FY4tAmMVnL4pPL6seFLLfQLyiyNWINcC9rF5ycHquWJ2XB305/7GwBvoG7EsdI7ytp5yKSXqbp/qA/pApz2M4StdGAfoEsHSG4HZSg6KWkceQfb5Kiig2T5ISxJVVagA1sPMtnTLyFsuFJwMXrdcytj8cZ4t23Eb3jKf7NVtVPXtorcfuPzZ7USlK2go0ttSEZvqKFHatiY5kEQE4Pib93mORxW02P5pq7TcJlCD7eeV8xF1hyDKT97DgoEHoqykyhBZEwTGz3TPDy6ZVw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <cbca26b0-b6a8-c529-8a41-6fc58965eaf8@suse.com>
Date: Tue, 4 Jul 2023 18:16:41 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: Backport request (was: [PATCH v2] tools: convert bitfields to
 unsigned type)
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Anthony PERARD <anthony.perard@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
 Juergen Gross <jgross@suse.com>, George Dunlap <george.dunlap@citrix.com>
References: <20230508164618.21496-1-olaf@aepfle.de>
 <ZJwBkHLwKJNuhekG@MacBook-Air-de-Roger.local>
 <4d049335-71fd-8fe0-0f9a-dfdd16fcf41e@suse.com>
 <ZKRA_X9uudh6TRov@MacBook-Air-de-Roger.local>
 <39e5b62b-d863-ad2b-5e9a-461fab6c9d31@suse.com>
 <ZKREeO2XJ9C8FYOM@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZKREeO2XJ9C8FYOM@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0170.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:99::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB9517:EE_
X-MS-Office365-Filtering-Correlation-Id: 977987fb-6d7f-4228-8261-08db7caa0977
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	evq+/dWFY+2CDFGm4x7JpYM/ZWnZGsYE4mKsHe3TJ9qbpW/izTkU2+PTxKlfYjB+nVoik66Kl11a2HBOsI4AvInctfOQ86f71MpVUkf+akuTtY+kJHwrwt+Xw2Rt+03vKxoHZi8zT61XyBEPqzQKWPzE4St+5tlp7pjEQy75EbgnnItivADh+6+FIMaMdxYQip8TX5Je0hTJL2DtnrzkIcoJy2KY1CWlSp58Q9W+OLsCq6ZsPKVGPDVKdrjYUJYgOZVbvurAa1/7bcq9T4g73tUC9FpVu6YumHpBSbbABZM4DKVfrC31wtn47FOngAoaQzU6qKZe51ulsWkQeBW2OwnCTIvG/yhPUlU3JC2kqXDel+OA9Fs/36H2QDunPPUU6SDoqG/Mxn0NVeC+ZiVqTYzs81cGm8J8NOR6oUKyP8eDFioynSDfrJYQxD73xjxhDo/IsMnihgNE2xcIEIO6LYpyUPG/wNYmDfEU+1zYaUM+PHnXVwTSdTllc78jeaN/uuEI2Ol5CZ6lyQi9+rIhm5VdOTd0pVH4Sgcaxd2U9QnVRqCeUHR9mhTCF9jimYHM3w637YAdCMKSY7mGPSmMDPVY9Ja2Mh2r+0liMA9C/2a8k2a50ZcYtSCPWBLtplRQKP8TzJY5QhpZdix0lSLDaA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(396003)(136003)(366004)(39860400002)(451199021)(31686004)(6506007)(53546011)(186003)(36756003)(110136005)(2616005)(54906003)(478600001)(4326008)(41300700001)(316002)(66476007)(66946007)(83380400001)(66556008)(6486002)(6512007)(6666004)(26005)(8936002)(8676002)(5660300002)(31696002)(86362001)(2906002)(38100700002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cXN4alc0KzMzL2p0OXZkdE5TNXg2QllUNWZNeUw0cWVPbjdkbkFnK1k1aVht?=
 =?utf-8?B?Z3NWWGNadkw1SU5OY1ZhMjRCZ1JiNDBYdkdsMGhzVkVtWnJGeGMyTThnSjFV?=
 =?utf-8?B?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ZloxL3N2T0QreWdPTXZLMStKa1dFSVA5T3hGeDdPbkJ2YkRHRWlF?=
 =?utf-8?B?empiQzhIN3EwYkhKcTNiajJ4elFWK1dVQmQxeGJWWFZ1ZUhuUko2ZDhCQzJR?=
 =?utf-8?B?UXFYL2EzRFlmdW83S0x1UlBqS2JsTEE5YVVYN2FOTVh6eEF2TTdPRWZaaXFx?=
 =?utf-8?B?cDdXYzE0bGRBaEZXd3hBZUNvN0lDSkNJcStZMzRHODdlSXh6VmVnNWpjTCtL?=
 =?utf-8?Q?hw0I+u302ZLg1swlTKuO07O+s?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 977987fb-6d7f-4228-8261-08db7caa0977
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 16:16:34.9015
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: QmRygAFLnKxDof1rJnm4HAHjttlNynCTeQiHJQHUgSHWJokaYtstSuRKcxG9NVg6lHEHDFcmfH4jW/0Wske+DA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9517

On 04.07.2023 18:10, Roger Pau MonnÃ© wrote:
> On Tue, Jul 04, 2023 at 06:04:36PM +0200, Jan Beulich wrote:
>> On 04.07.2023 17:55, Roger Pau MonnÃ© wrote:
>>> On Tue, Jul 04, 2023 at 05:42:33PM +0200, Jan Beulich wrote:
>>>> Plus is the mentioned
>>>> "potential ABI change" safe to take on a stable branch? There's not going to
>>>> be any SONAME change ...
>>>
>>> Is there any ABI change in practice? Both fields will still have a 1bit
>>> size.
>>
>> But what a consumer of the interface reads out of such a field would change
>> in case their compiler settings arrange for signed bitfields when signedness
>> isn't explicit. We don't dictate, after all, what compiler settings to use
>> with our interfaces (which generally is good, but which bites us here).
> 
> Hm, I see.  I would argue that sign doesn't matter here, as those are
> intended to be booleans, so anything different than 0 would map to
> `true`.  But implementation might have hard coded TRUE to -1, and the
> change would then break them?

That's a possible scenario I'm wary of here, yes.

> I'm failing to see that, because those implementations would still use
> the old struct declarations they have been built with, and hence would
> still threat it as signed?

Until they rebuild against the updated header, without any change to
their code.

Anthony - do you have any thoughts here?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 16:29:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 16:29:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558564.872774 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGitT-0006kP-0K; Tue, 04 Jul 2023 16:28:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558564.872774; Tue, 04 Jul 2023 16:28:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGitS-0006kI-Tu; Tue, 04 Jul 2023 16:28:46 +0000
Received: by outflank-mailman (input) for mailman id 558564;
 Tue, 04 Jul 2023 16:28:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bHqM=CW=kernel.org=kbusch@srs-se1.protection.inumbo.net>)
 id 1qGitR-0006kC-T3
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 16:28:45 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d79cc4da-1a87-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 18:28:44 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 1A3D9612CF;
 Tue,  4 Jul 2023 16:28:43 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A8C9C433C7;
 Tue,  4 Jul 2023 16:28:39 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d79cc4da-1a87-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688488122;
	bh=ZbfFFniWhSahnp7jSJ3oIaV9POCcbiLvynkhKSgpXe4=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=rYhrvsNpwqCJwn41eekT5X8PaPVwBQ6ub8Netmz5zCPt/qzVPnkLxH2Kjiq9nv1Cm
	 yUeZjhUrBrMq2ThgKqf6VqdUdYp1P2/zpT5yvYD7siJiybpmyKwoPpaa5gXpr6CMMv
	 akxinQnPPwXHrxodKNqiTb/6JTMYG4lY9mmxI0dhS9y7wawVJYcWdRHa64BuE/8weJ
	 eX7co1v82fmGWp5kKAm9BaeWX8/tRjFqKX1EDWvGtKd5aZ5LCCXaAY86lmuE5eezEu
	 Ix6OVXIAm9Wp1Cia2H4ClFO9rKC6nhjukt+dwjQnGXu6F26u0+VUNsprhPIs/s+nRo
	 qHwq5/jxHTM8Q==
Date: Tue, 4 Jul 2023 10:28:36 -0600
From: Keith Busch <kbusch@kernel.org>
To: Jan Kara <jack@suse.cz>
Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@infradead.org>,
	Alasdair Kergon <agk@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anna Schumaker <anna@kernel.org>, Chao Yu <chao@kernel.org>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Dave Kleikamp <shaggy@kernel.org>, David Sterba <dsterba@suse.com>,
	dm-devel@redhat.com, drbd-dev@lists.linbit.com,
	Gao Xiang <xiang@kernel.org>, Jack Wang <jinpu.wang@ionos.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	Joern Engel <joern@lazybastard.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	linux-bcache@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org,
	linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org,
	linux-nilfs@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-pm@vger.kernel.org, linux-raid@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	"Md. Haris Iqbal" <haris.iqbal@ionos.com>,
	Mike Snitzer <snitzer@kernel.org>, Minchan Kim <minchan@kernel.org>,
	ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Song Liu <song@kernel.org>, Sven Schnelle <svens@linux.ibm.com>,
	target-devel@vger.kernel.org, Ted Tso <tytso@mit.edu>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions
Message-ID: <ZKRItBRhm8f5Vba/@kbusch-mbp>
References: <20230629165206.383-1-jack@suse.cz>
 <20230704122224.16257-1-jack@suse.cz>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20230704122224.16257-1-jack@suse.cz>

On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote:
> +struct bdev_handle *blkdev_get_handle_by_dev(dev_t dev, blk_mode_t mode,
> +		void *holder, const struct blk_holder_ops *hops)
> +{
> +	struct bdev_handle *handle = kmalloc(sizeof(struct bdev_handle),
> +					     GFP_KERNEL);

I believe 'sizeof(*handle)' is the preferred style.

> +	struct block_device *bdev;
> +
> +	if (!handle)
> +		return ERR_PTR(-ENOMEM);
> +	bdev = blkdev_get_by_dev(dev, mode, holder, hops);
> +	if (IS_ERR(bdev))
> +		return ERR_CAST(bdev);

Need a 'kfree(handle)' before the error return. Or would it be simpler
to get the bdev first so you can check the mode settings against a
read-only bdev prior to the kmalloc?

> +	handle->bdev = bdev;
> +	handle->holder = holder;
> +	return handle;
> +}
> +EXPORT_SYMBOL(blkdev_get_handle_by_dev);
> +
>  /**
>   * blkdev_get_by_path - open a block device by name
>   * @path: path to the block device to open
> @@ -884,6 +902,28 @@ struct block_device *blkdev_get_by_path(const char *path, blk_mode_t mode,
>  }
>  EXPORT_SYMBOL(blkdev_get_by_path);
>  
> +struct bdev_handle *blkdev_get_handle_by_path(const char *path, blk_mode_t mode,
> +		void *holder, const struct blk_holder_ops *hops)
> +{
> +	struct bdev_handle *handle;
> +	dev_t dev;
> +	int error;
> +
> +	error = lookup_bdev(path, &dev);
> +	if (error)
> +		return ERR_PTR(error);
> +
> +	handle = blkdev_get_handle_by_dev(dev, mode, holder, hops);
> +	if (!IS_ERR(handle) && (mode & BLK_OPEN_WRITE) &&
> +	    bdev_read_only(handle->bdev)) {
> +		blkdev_handle_put(handle);
> +		return ERR_PTR(-EACCES);
> +	}
> +
> +	return handle;
> +}
> +EXPORT_SYMBOL(blkdev_get_handle_by_path);


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 17:05:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 17:05:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558568.872783 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGjSm-0002hH-Pe; Tue, 04 Jul 2023 17:05:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558568.872783; Tue, 04 Jul 2023 17:05:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGjSm-0002hA-My; Tue, 04 Jul 2023 17:05:16 +0000
Received: by outflank-mailman (input) for mailman id 558568;
 Tue, 04 Jul 2023 17:05:15 +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
 <SRS0=vvOH=CW=citrix.com=prvs=5429f199a=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qGjSl-0002h4-47
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 17:05:15 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id eea68201-1a8c-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 19:05:11 +0200 (CEST)
Received: from mail-bn7nam10lp2104.outbound.protection.outlook.com (HELO
 NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.104])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 04 Jul 2023 13:05:02 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by PH0PR03MB5766.namprd03.prod.outlook.com (2603:10b6:510:39::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 17:04:56 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 17:04:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eea68201-1a8c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688490311;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=WziFgsL/Izmx8nMR387oIXKDLqcCWewMvvWHh1fJaKU=;
  b=NA7gALyIWTaU3Qu3WtGkpPi93lcbKXvhzotdCzwg7NUNl44LiVu/PXeF
   gc42EstkBMKg5O++2TCMTVRngR/lkOhnaQtGgpGAnu1zKGxPa4luI0iya
   UOBzj+yeqiKJu0j5r7GadnpPp9BkaRvcIk8ly7fQ3imHf5PHKGIEe8fWX
   0=;
X-IronPort-RemoteIP: 104.47.70.104
X-IronPort-MID: 114443071
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:54T6VavKuw+ddK/icS6Fyp1YqOfnVHtfMUV32f8akzHdYApBsoF/q
 tZmKT+AO/6JYjb3ed9yb9u29U1SscSEztdlGlFu/ypgFStA+JbJXdiXEBz9bniYRiHhoOCLz
 O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQqIu
 Nfjy+XSI1bg0DNvWo4uw/vrRChH4rKq4Vv0gnRkPaoQ5ACGyyFOZH4iDfrZw0XQE9E88tGSH
 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9
 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG
 fMwEj0WZC+io/2K0ejrae53r94JB8LLM9ZK0p1g5Wmx4fcOZ7nmGv2Pz/kHmTA6i4ZJAOrUY
 NcfZXx3dhPcbhZTO1ARTpUjgOOvgXq5eDpdwL6XjfNvvy6Pk0ouiP60aIa9lt+iHK25mm6xo
 G7c8nu/KRYdLNGFkhKO8262h/+JliT+MG4XPOThqqI22wXMnwT/DjUrZ12anteFp3KeWsxfK
 1NPoS0Lh44boRnDot7VGkfQTGS/lhwWVsdUEuY6wBqQ0aeS6AGcbkAbShZRZdpgs9U5LRQ62
 1nMk973CDhHtLyOVWnb5rqStSm1OyUeMSkFfyBscOcey9zqoYV2hBSQSN9mSfaxloesQW22x
 C2Wpi8jgblVldQMy6iw4VHAhXSru4TNSQk2oA7QWwpJ8z9EWWJsXKTwgXCz0BqKBN/xooWp1
 JTcp/Wj0Q==
IronPort-HdrOrdr: A9a23:cA4kEqFAPfzrHiK9pLqE18eALOsnbusQ8zAXPo5KOGVom62j5r
 iTdZEgvyMc5wxhPU3I9erwWpVoBEmslqKdgrNxAV7BZniDhILAFugLhrcKgQeBJ8SUzJ876U
 4PSdkZNDQyNzRHZATBjTVQ3+xO/DBPys6Vuds=
X-Talos-CUID: =?us-ascii?q?9a23=3AQXmGQ2tNrESt78IfFNas18fZ6Isff2bX81b0PHO?=
 =?us-ascii?q?pUzZKT6a8U3W784Nrxp8=3D?=
X-Talos-MUID: =?us-ascii?q?9a23=3A69/HNg91d9NZpdY07HMiXE2Qf/pa5YWRJnwgrbU?=
 =?us-ascii?q?HpcmEKncrPBK3qh3iFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,181,1684814400"; 
   d="scan'208";a="114443071"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=DxLDtPkxIHrtFHj674Cc2CDFiM9miPicsBbwI4Mw4mFWGCJBGhn6lAhNk+dsveFw974sUGWt/sLWlr15DBlXh9gOyHhR5PHdAe/6ycuga68jrbePB8LYoA+hpuUOD9BrICHLK1OHP6+otZe3d0gZO32JwzDOUBzqWniBE+g2JyGoxTHBuzc6ICiiU0d5BJq7b7hWRShrhYrJYfk2laso4FE5VkgpmVQJ3K69UBo9wZHENryUTl4Y7qSCNL2xW6NE12QgbTempKJbKeviqwleS0gcDGVLp/k4nUdi2bO340c5nGgMbxx6/RoXU0rb77KetRjNdU2QGhBLEduD6qgrNw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=WziFgsL/Izmx8nMR387oIXKDLqcCWewMvvWHh1fJaKU=;
 b=Lz0AU5xqpql8iMoa3iTDrBVfqMBpy3uuePbnNvFrbrRCvpxzDMBV56OhpXPZj0t6WBHrISkeBfbPVpz10G1XXp7mEnd3Wv/4xK2QrygR3TMyXNRX+JNls7J7zKletD6MVxDLjG0/4ptqpoYDOkIxl+aeMosIF+fRxbQA6iGEOj/tucdfQelQeBfha5wlCK1zJLBn24ubXYjzqYNWvFjwcuI5btj0IBFBr2NVokS5VMx2R7x+h/gFdmcJTkV2wVQUe86BFkvSokpqbt4iohBrSKEjFF5LLPtrd1+2Kd/2HU0Za3XMEaoPl6TUIoO/k067WjzGJD/p+fc0Ty/yEkqqlA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=WziFgsL/Izmx8nMR387oIXKDLqcCWewMvvWHh1fJaKU=;
 b=Op8DOg8sF1fS/35LRWqD2HSEH2nZLO2p/Js8fPKTAo7czzLFedIV5Fd0TRvbv4+qndHGPGfWABTyZPa6actYqJTCw38kqrBmZ2n00DP0hbGCLszu/6mwCgH86pyPD/Ec19fEbwvJRDBmDPHFPpJkIoV0b2WqpJzUKWp722Flggs=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <91a3c0b4-04b4-d1ae-e849-f9c23540e0ba@citrix.com>
Date: Tue, 4 Jul 2023 18:04:51 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH] x86/asm: Introduce a tailcall pseduo-op
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
References: <20230630152057.2944373-1-andrew.cooper3@citrix.com>
 <e85c73ae-aaba-a649-6bf5-5528b4cf6e95@suse.com>
In-Reply-To: <e85c73ae-aaba-a649-6bf5-5528b4cf6e95@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0440.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a9::13) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|PH0PR03MB5766:EE_
X-MS-Office365-Filtering-Correlation-Id: 86f6dceb-56a6-4e38-e9be-08db7cb0cae0
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	FULov7VTcJKsbh15t9lZWr0R4Cg5IEukMjE/thc1hDQFx7lIf31USnmxH6Tou6xZR5GK25AV51qceBpBOx5OL/uuOad24bItejm5/CPt8qTcVJT72tKXOmVjGE/FS5VIRZo2K/Z+n9gpHD5iDfoZWmXz2efyn0R/IxMu9yW3nbzYFsTB2FXWQGYRLhbca5Qwm8+wobgpA2EcNdpjletwJ2I8Dl3v8lEZSijftnFUSsBchnuotvWQrVwN0Fj2fiUxi9uMmErc+VbNB4PN1L/5B8zhVuvfnloik8wY/Cs0MvYmxQ1uG4k85AIIrN+cdHPvB6We2b35S9zsyBoPzb+CPaI77y4HNVgkiOjZ8NC1cyZ8rHDDynsif6Y2mYW0v+EMCg17Ef6ymKErNhlR6k8Zlhcmb2aTFxI00SDqmiQv84W/Qr1+Hg6AQ+uLKf9hczlEr9Xa961dp+ZX3dJBQZQOnkw0hLHzKBmjx20XGLelf3EnpQuFCMoisODbEE0ukvbuCnzibLFkn5yiaMoxwEDz6QwHN5qTd5m/1UYq1uRqcXhFMBVik+/s51+S/O+KSmt04gzFzcz/rvUIDD8X5iWtuPOZKTaVw4usdVPPOSZbWTcepS6ep4AnWku2TGn2nDH8C7eM3egG6ZBt29L+noFRNA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(366004)(346002)(376002)(39860400002)(451199021)(31686004)(66556008)(66946007)(36756003)(4326008)(66476007)(478600001)(2906002)(316002)(6916009)(8676002)(8936002)(5660300002)(41300700001)(54906003)(86362001)(6486002)(6512007)(31696002)(4744005)(38100700002)(6666004)(53546011)(6506007)(26005)(186003)(82960400001)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?K1Y3THJmVHdMenc2ZXRESFRGUE9qS0tUU1NmRVV1SDFyS2dkbllyYjlKUms3?=
 =?utf-8?B?dlBad2FuRmloU0x0Sk9yT1N3Q3pMYkxid2tmUUFaWHljajdiVlRxNGNVcHYv?=
 =?utf-8?B?YjRabHFGUXBjMzFHNlQ0U3VyZlRZTzVNVzZQWXd0Q3dPUVlBZEJ1R0xSU0hp?=
 =?utf-8?B?b0xCRmRVWWdRUG8ydHV2Z0Z4enFkUlR4aVhuUC9Zb0hkTUVFbVlKSkZ3L3Bt?=
 =?utf-8?B?b2dXeWgzMDZMZmxYcTczRVpzOUJ4YVdpc3A2NEY5a2Z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/8ploTyQqxmV4l7+RUC
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 86f6dceb-56a6-4e38-e9be-08db7cb0cae0
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 17:04:56.6307
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 2xeIEKImwyhqZjeQOsqeUKwk87+E4bzWfwi3VeHHo9PLQ+urguV8jfiVQsheUR123E3fkkSi5WP34OLkfJOJTAb03pDL8DCZ7V+/30Gyylo=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB5766

On 04/07/2023 3:29 pm, Jan Beulich wrote:
> On 30.06.2023 17:20, Andrew Cooper wrote:
>> It was previously noted that CALL/BUG is a weird combination, but there is
>> good reason to use this pattern.
>>
>> Introduce an explicit tailcall macro make it clearer in context.
>>
>> No functional change.
>>
>> Reported-by: Jan Beulich <JBeulich@suse.com>
> Did I? Must have been a long time back, as I don't think I remember us
> talking about this.

This was discussed on multiple patch reviews, where I was introducing
the pattern and you were complaining about the BUG and comment.Â  I can
drop the tag if you'd prefer.

>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Thanks

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 17:10:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 17:10:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558573.872793 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGjXm-00048W-CJ; Tue, 04 Jul 2023 17:10:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558573.872793; Tue, 04 Jul 2023 17:10:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGjXm-00048P-9i; Tue, 04 Jul 2023 17:10:26 +0000
Received: by outflank-mailman (input) for mailman id 558573;
 Tue, 04 Jul 2023 17:10:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=vvOH=CW=citrix.com=prvs=5429f199a=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qGjXk-00048J-NR
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 17:10:24 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a83d2bd9-1a8d-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 19:10:22 +0200 (CEST)
Received: from mail-bn8nam04lp2047.outbound.protection.outlook.com (HELO
 NAM04-BN8-obe.outbound.protection.outlook.com) ([104.47.74.47])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 04 Jul 2023 13:10:18 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by MW4PR03MB6393.namprd03.prod.outlook.com (2603:10b6:303:120::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Tue, 4 Jul
 2023 17:10:16 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 17:10:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a83d2bd9-1a8d-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688490623;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=VuyYMdc3d5GX8D5b2DQCfaSJ+K7fEs29bUWq+BkmG9s=;
  b=ZEqyDlhM/jRqqnVHxeA+daODH/Bmgy9sYR3PyCJ0886KjMpOgAKZXpbr
   tCJdLOiMx0oOGcOfioZq9W3ZpdJ3z4+U1txtDGpNMEUN/UqxnhJOMx2Wd
   FdZmvE/3ieNKgyvFkEkPKUYwCuovVVePi2FLwoSKNXSGX+6Xi2ovVMQ28
   8=;
X-IronPort-RemoteIP: 104.47.74.47
X-IronPort-MID: 114443518
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:TFhjT6PCRY55hdbvrR1ql8FynXyQoLVcMsEvi/4bfWQNrUp31TFUy
 GJNC2zXP6uCMTOgc95waYvg8UID7JPVxt9nGwto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v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rOxCvxmQnZoGsqqwYcvPbYIUayQCq9tYsJ
 9FtRilKKq0npujvk9jFUaTAkQ==
IronPort-HdrOrdr: A9a23:qrav7aP+tXRmVMBcTv6jsMiBIKoaSvp037Dk7TEJdfU1SL3hqy
 nKpp4mPHDP+VMssR0b6LK90ey7MBDhHP1OgLX5X43SODUO0VHAROpfBMnZowEIcBeOkdK1u5
 0QFZSWy+edMbG5t6vHCcWDfOrICePozJyV
X-Talos-CUID: 9a23:VsWS5W2KShjTUl5W5UrZX7xfP+4LaCP6wXfqLgznMDdRcpfPEU2V5/Yx
X-Talos-MUID: 9a23:LmqleQmraOCZ2yuNANgndnpJCclNw/i0JnoGspIWlPLDLzAhBhCS2WE=
X-IronPort-AV: E=Sophos;i="6.01,181,1684814400"; 
   d="scan'208";a="114443518"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=n39cnCBrCDSGX9wet+s/jz0VuPslPIwvkN16Dz1PbFffNZCYiN4W6r1jiuFPoHN10tKTtWg/U67iFXi4od328aSCfPL26RoSm/UVANtrhAT8VcqbLAychuhSV/jsoY4uFmp/93QeG48wCadm/q5wdiRkIT132VM4VL1vSx0mRZgsiC2tuPlIeYK8IPdm8BlnzsGGFMtUjSHcbqA94VsL3r32RnaYZMkorsEhm9fAu0eiY3Sy+roLVyTdz1AO4M5+XJxzKAq1AteQ/HYPxXvFQKCxGxjhQpatlYer0wpfHp3GenlYM5LmVRefk+sV1MDcQJEtlFWM7iisP3g4Cm2rHA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OaOq7/wv29wZjSZRbL/M3qEI7N0Fz0HPjs+f+AcSvhQ=;
 b=jYeTxvuGJIQpn5IvbEXCpkj5qfunDy3JLSvieD4p2o4viTzlY+60BWvJwp4UC/5dlQWq9fsrWC1GkhM7CE2Wk0YEnXLkGpDrLpaR/ysfeqrRNTYEoHCA778IUW2Iumc2uRqPh/mueh00976y4K3XfSdTL/MTrPDNd1cMHkmfwwORBI2Nt+RAWE/pWyvINwuyMCa93VfePFAJ9rJsxIROXGGflobD7pA3YkpfR9z1XFjI2cU7ospPQJteg5LpAsqyxfqnXK56G1Z9giaBixOC5lr/rtH+noSe9LGiWzlV/O/BEsDzoQfEyd8B/Q981uoTDutRhdMJ3PGj1iS6vPe4Vg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OaOq7/wv29wZjSZRbL/M3qEI7N0Fz0HPjs+f+AcSvhQ=;
 b=l9+Lw2LiBSOxJuKG4N2YpbOD7bdRv//CsyKkbZ2E+jkZM8n8P47FYFxfXPlp7ybnjNFQdlL5QQizAX6u4EC1sKrQX/F0xG84HlGEXD1Kz7uS7+ydUBJG/rMLfJr5MiMLCIpH71ym6R/0x5I7rphGarTnoCx3nhijRfUsv7OgI/c=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <15e7fee6-a64e-e6c4-af5f-dbf2e9f22cd5@citrix.com>
Date: Tue, 4 Jul 2023 18:10:08 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v2.5 3/3] xen/types: Rework stdint vs __{u,s}$N types
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Timothy Pearson <tpearson@raptorengineering.com>,
 Roberto Bagnara <roberto.bagnara@bugseng.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230627075618.1180248-4-andrew.cooper3@citrix.com>
 <20230628145403.3630-1-andrew.cooper3@citrix.com>
 <ba212e0a-1bbb-9576-f6ff-c6d46d80b17a@suse.com>
In-Reply-To: <ba212e0a-1bbb-9576-f6ff-c6d46d80b17a@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LNXP265CA0075.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:76::15) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|MW4PR03MB6393:EE_
X-MS-Office365-Filtering-Correlation-Id: 9369991f-8a79-4ebe-9531-08db7cb188fe
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	mQqHlR+EW+GB2u3wjUaaaPN6/eudAiZRIVPTbRSdRGxnrZYZVZrlv/iKB4dvVDy9Wh04rXxCg8BlWJ/+k3+jymSiQWhOrqiubh37ocvLvBHVyoR7FUvOQrIcSyBIRBwKgjyv/gUTAD8nfQGFe06yVFo+o39wUNBaL36LK910EJFsMU/Q6kthpMWVED6fwEf4UUPb44FU+RpCym49jhD4vU50mNi52+79w2RLHJM9nuuTK60NVCT/mq64uatnBkCXKX4cEkeaVXJaZKtsBMjd+CeYBAyZqT+AsqBnpraqGOcpO4ZXY5gC4WcS0ekCktWfeuuwrpa0lplWJnqR033rQsIJiB5U6KJk2jqoO/6PxT50L7ABfqKDiWcj/Jpge9Lwxm5an5uVs3MXck6WzKDurDWryHrjHaSnAVxmLmrnRTSx59CDNLpjne0sbEIPBboeuEM6qqSvIV3gpYd0/F4IjS3I1aG9XOHSpOEU5e5yrVue/KMkHJL62kwk0qe3qX9htzReiu5V2b4nYQ1JvCNHLQB8Nf4aU/b0vVeGNB5MeqQuJ09I9D0hSLKfoXGl78tu2nmZGML7o4XHVHcTwcwPjvT+/LLfVGsBSgvkP1U4CjJiHNAkT3v5PuR5b2VXvsnCUqh/vwORmPiTU1gu7bdALw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(366004)(39860400002)(346002)(396003)(451199021)(6666004)(26005)(6512007)(2906002)(6486002)(86362001)(6506007)(2616005)(38100700002)(82960400001)(83380400001)(53546011)(966005)(31696002)(41300700001)(54906003)(186003)(316002)(36756003)(66946007)(66556008)(66476007)(4326008)(6916009)(31686004)(5660300002)(7416002)(478600001)(8676002)(8936002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VmhVMjN2TlRJODAvWjYrVnZXd1Z3eXFjZ1ZUWmJVdDB6L2QvMURhYWllMWlC?=
 =?utf-8?B?WGhSOGp4SVNQY2hyRjBVS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diWWVhTlFUd3lYYW5McDJ4cG40eE1GRC9yWVFjUVNYNWtFdGVnbitZ?=
 =?utf-8?B?VVdOYVNNOG50WVNpRWNpTXlDdXBjTWNUamxMdyt5NmxvNnd1a21zcEZUOVpr?=
 =?utf-8?B?V0RjczBWblpuQ0E9PQ==?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9369991f-8a79-4ebe-9531-08db7cb188fe
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 17:10:15.5007
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: AWgZNCcnH0JHrUqhQb+rmHK+5GOrGaxlleZUqzjLXXkeR4Zt5g0cJIDsGPi+7jiH2EVI7cpu1B5Alp4Vwr1UiyXltfjP7MIg7VYLh8+3Imo=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR03MB6393

On 04/07/2023 3:38 pm, Jan Beulich wrote:
> On 28.06.2023 16:54, Andrew Cooper wrote:
>> Xen uses the stdint types.  Rearrange the types headers to define the
>> compatibility __{u,s}$N types in terms of the stdint types, not the other way
>> around.
>>
>> All supported compilers on architectures other than x86 support the stdint
>> __*_TYPE__ macros.  Move these into a new xen/stdint.h to avoid them being
>> duplicated in each architecture.  For the very old x86 compilers, synthesize
>> suitable types using GCC internals.
>>
>> This cleanup has the side effect of removing all use of the undocumented
>> __signed__ GCC keyword.  This is a vestigial remnant of `gcc -traditional`
>> mode for dialetcs of C prior to the introduction of the signed keyword.
>>
>> No functional change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Thanks.

> with one further remark:
>
>> --- /dev/null
>> +++ b/xen/include/xen/stdint.h
>> @@ -0,0 +1,33 @@
>> +/* SPDX-License-Identifier: GPL-2.0-only */
>> +#ifndef __XEN_STDINT_H__
>> +#define __XEN_STDINT_H__
>> +
>> +#ifndef __INT8_TYPE__ /* GCC <= 4.4 */
>> +
>> +/*
>> + * Define the types using GCC internal notation.  Clang understands this too.
>> + * https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html
>> + */
>> +typedef   signed __attribute__((__mode__(QI)))     int8_t;
>> +typedef unsigned __attribute__((__mode__(QI)))    uint8_t;
>> +typedef   signed __attribute__((__mode__(HI)))    int16_t;
>> +typedef unsigned __attribute__((__mode__(HI)))   uint16_t;
>> +typedef   signed __attribute__((__mode__(SI)))    int32_t;
>> +typedef unsigned __attribute__((__mode__(SI)))   uint32_t;
>> +typedef   signed __attribute__((__mode__(DI)))    int64_t;
>> +typedef unsigned __attribute__((__mode__(DI)))   uint64_t;
> Much like you avoid "mode" potentially being the name of a visible macro,
> the mode identifiers themselves could in principle be, too. Being upper
> case names, perhaps there the risk is even slightly higher. Hence I'd
> prefer if you/we could use __QI__ and alike.

Fixed locally.Â  I won't resend for just this.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 17:15:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 17:15:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558581.872803 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGjcS-0004o6-1t; Tue, 04 Jul 2023 17:15:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558581.872803; Tue, 04 Jul 2023 17:15:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGjcR-0004nz-Vb; Tue, 04 Jul 2023 17:15:15 +0000
Received: by outflank-mailman (input) for mailman id 558581;
 Tue, 04 Jul 2023 17:15:15 +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
 <SRS0=+Q6u=CW=gmail.com=olekstysh@srs-se1.protection.inumbo.net>)
 id 1qGjcR-0004nt-1u
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 17:15:15 +0000
Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com
 [2607:f8b0:4864:20::631])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 555009b9-1a8e-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 19:15:12 +0200 (CEST)
Received: by mail-pl1-x631.google.com with SMTP id
 d9443c01a7336-1b89e10d356so10624025ad.3
 for <xen-devel@lists.xenproject.org>; Tue, 04 Jul 2023 10:15:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 555009b9-1a8e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688490911; x=1691082911;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=tKZ68cydAkPbtFvf5MYcmHYlMLMsBvPQpIORG93kvps=;
        b=ZJ+6K+Cc+zO2x+/Th/Qw8/RImWEGtcIwUEk++smcOi9U6oAFmmnjoAbx+stgg2cR/7
         naPTqEYWvJQHzJtSeumaeHo0mrR8ryAAm/wzB4Vy3HBkpPAv5KQ20lknynVb/WjDtClb
         1av1OBA8XA626AlD4hIdcr2LYmnEXkmsJE2a6hLYvy9bHpJYrjRirtuWjhB1QOFIXNJ+
         AnJxaRvrGEWPf6p4pvwbW43Wzpan7P8Y02St28Bg4sVaQJDjakJ3/TYx8QgReuPuhJyk
         PVDPN4gPZShhEbFxYzHnmixDKIVMxe/FIc6+WYr3TqaBPw/7ACdfNPXLJzvgjNZw2eHi
         QW2A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688490911; x=1691082911;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=tKZ68cydAkPbtFvf5MYcmHYlMLMsBvPQpIORG93kvps=;
        b=JkBxBHnrq/Vy7KbNSmcR63Z7HVfvkxLs8uKHVvfrkbcQqQC31lBWvcU+n5oPe9pKMQ
         +riq1kw0q1SFbc1kYksE58PC8jHIi2ITA9UJUpOUsaBkktTiV+YR4GWQ0JNhF6x+K1P7
         eqaZy45HuevFgrCAizasDofZs5vHcFfSFBWMTP4E2i7ijIhIZlSjYl1tV1sWofGe2I+3
         1S2QalNqNyFuIwv2d+j/HJ03HE62o/hERFCX6tWihBvErgwZLrkb+aBfofUzQvOC8e+M
         Lswfys+WagO2AIgVibfAJaBF5z4FI3mDflyb9nC5QroBFp4Mpf4sCNbZbJUZoNiNimH7
         wTSA==
X-Gm-Message-State: ABy/qLYwysa+JnMcRVd3yQeShkVUc+OHktlftnVxyL32YzWrpizXN7hu
	GzLHmUwhNmvNmv97UoQ6HQbrGvqPzuvT1uIAHl8=
X-Google-Smtp-Source: APBJJlGxG6QAD6OaWx4SUrnqUir385+eBtxw6rU9uUeMEDOPkEm+/+Wd+dYB2Wxyx8tymUh/paezx1Ygwf6kN3stRZw=
X-Received: by 2002:a17:90a:7b87:b0:263:8083:bdcf with SMTP id
 z7-20020a17090a7b8700b002638083bdcfmr10927832pjc.15.1688490910662; Tue, 04
 Jul 2023 10:15:10 -0700 (PDT)
MIME-Version: 1.0
References: <20230621131214.9398-1-petr.pavlu@suse.com> <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com> <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
 <b21398eb-2fb2-4fca-dd90-d2c81d8df1c4@epam.com> <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop>
 <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local> <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com>
 <ZKQF8qq8Oh5E+Fxx@mail-itl> <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
In-Reply-To: <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
From: Oleksandr Tyshchenko <olekstysh@gmail.com>
Date: Tue, 4 Jul 2023 20:14:59 +0300
Message-ID: <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Stefano Stabellini <sstabellini@kernel.org>, Juergen Gross <jgross@suse.com>, 
	=?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>
Cc: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>, Petr Pavlu <petr.pavlu@suse.com>, 
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, vikram.garhwal@amd.com
Content-Type: multipart/alternative; boundary="000000000000efc60b05ffac6c55"

--000000000000efc60b05ffac6c55
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 4, 2023 at 5:49=E2=80=AFPM Roger Pau Monn=C3=A9 <roger.pau@citr=
ix.com> wrote:

Hello all.

[sorry for the possible format issues]


On Tue, Jul 04, 2023 at 01:43:46PM +0200, Marek Marczykowski-G=C3=B3recki w=
rote:
> > Hi,
> >
> > FWIW, I have ran into this issue some time ago too. I run Xen on top of
> > KVM and then passthrough some of the virtio devices (network one
> > specifically) into a (PV) guest. So, I hit both cases, the dom0 one and
> > domU one. As a temporary workaround I needed to disable
> > CONFIG_XEN_VIRTIO completely (just disabling
> > CONFIG_XEN_VIRTIO_FORCE_GRANT was not enough to fix it).
> > With that context in place, the actual response below.
> >
> > On Tue, Jul 04, 2023 at 12:39:40PM +0200, Juergen Gross wrote:
> > > On 04.07.23 09:48, Roger Pau Monn=C3=A9 wrote:
> > > > On Thu, Jun 29, 2023 at 03:44:04PM -0700, Stefano Stabellini wrote:
> > > > > On Thu, 29 Jun 2023, Oleksandr Tyshchenko wrote:
> > > > > > On 29.06.23 04:00, Stefano Stabellini wrote:
> > > > > > > I think we need to add a second way? It could be anything tha=
t
> can help
> > > > > > > us distinguish between a non-grants-capable virtio backend an=
d
> a
> > > > > > > grants-capable virtio backend, such as:
> > > > > > > - a string on xenstore
> > > > > > > - a xen param
> > > > > > > - a special PCI configuration register value
> > > > > > > - something in the ACPI tables
> > > > > > > - the QEMU machine type
> > > > > >
> > > > > >
> > > > > > Yes, I remember there was a discussion regarding that. The poin=
t
> is to
> > > > > > choose a solution to be functional for both PV and HVM *and* to
> be able
> > > > > > to support a hotplug. IIRC, the xenstore could be a possible
> candidate.
> > > > >
> > > > > xenstore would be among the easiest to make work. The only
> downside is
> > > > > the dependency on xenstore which otherwise virtio+grants doesn't
> have.
> > > >
> > > > I would avoid introducing a dependency on xenstore, if nothing else
> we
> > > > know it's a performance bottleneck.
> > > >
> > > > We would also need to map the virtio device topology into xenstore,
> so
> > > > that we can pass different options for each device.
> > >
> > > This aspect (different options) is important. How do you want to pass
> virtio
> > > device configuration parameters from dom0 to the virtio backend
> domain? You
> > > probably need something like Xenstore (a virtio based alternative lik=
e
> virtiofs
> > > would work, too) for that purpose.
> > >
> > > Mapping the topology should be rather easy via the PCI-Id, e.g.:
> > >
> > > /local/domain/42/device/virtio/0000:00:1c.0/backend
> >
> > While I agree this would probably be the simplest to implement, I don't
> > like introducing xenstore dependency into virtio frontend either.
> > Toolstack -> backend communication is probably easier to solve, as it's
> > much more flexible (could use qemu cmdline, QMP, other similar
> > mechanisms for non-qemu backends etc).
>
> I also think features should be exposed uniformly for devices, it's at
> least weird to have certain features exposed in the PCI config space
> while other features exposed in xenstore.
>
> For virtio-mmio this might get a bit confusing, are we going to add
> xenstore entries based on the position of the device config mmio
> region?
>
> I think on Arm PCI enumeration is not (usually?) done by the firmware,
> at which point the SBDF expected by the tools/backend might be
> different than the value assigned by the guest OS.
>
> I think there are two slightly different issues, one is how to pass
> information to virtio backends, I think doing this initially based on
> xenstore is not that bad, because it's an internal detail of the
> backend implementation. However passing information to virtio
> frontends using xenstore is IMO a bad idea, there's already a way to
> negotiate features between virtio frontends and backends, and Xen
> should just expand and use that.
>
>

On Arm with device-tree we have a special bindings which purpose is to
inform us whether we need to use grants for virtio and backend domid for a
particular device.Here on x86, we don't have a device tree, so cannot
(easily?) reuse this logic.

I have just recollected one idea suggested by Stefano some time ago [1].
The context of discussion was about what to do when device-tree and ACPI
cannot be reused (or something like that).The idea won't cover virtio-mmio,
but I have heard that virtio-mmio usage with x86 Xen is rather unusual case=
.

I will paste the text below for convenience.

**********

Part 1 (intro):

We could reuse a PCI config space register to expose the backend id.
However this solution requires a backend change (QEMU) to expose the
backend id via an emulated register for each emulated device.

To avoid having to introduce a special config space register in all
emulated PCI devices (virtio-net, virtio-block, etc) I wonder if we
could add a special PCI config space register at the emulated PCI Root
Complex level.

Basically the workflow would be as follow:

- Linux recognizes the PCI Root Complex as a Xen PCI Root Complex
- Linux writes to special PCI config space register of the Xen PCI Root
  Complex the PCI device id (basically the BDF)
- The Xen PCI Root Complex emulated by Xen answers by writing back to
  the same location the backend id (domid of the backend)
- Linux reads back the same PCI config space register of the Xen PCI
  Root Complex and learn the relevant domid

Part 2 (clarification):

I think using a special config space register in the root complex would
not be terrible in terms of guest changes because it is easy to
introduce a new root complex driver in Linux and other OSes. The root
complex would still be ECAM compatible so the regular ECAM driver would
still work. A new driver would only be necessary if you want to be able
to access the special config space register.


**********
What do you think about it? Are there any pitfalls, etc? This also requires
system changes, but at least without virtio spec changes.

[1]
https://lore.kernel.org/xen-devel/alpine.DEB.2.22.394.2210061747590.3690179=
@ubuntu-linux-20-04-desktop/


--=20
Regards,

Oleksandr Tyshchenko

--000000000000efc60b05ffac6c55
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Tue, Jul 4, 2023 at 5:49=E2=80=AFP=
M Roger Pau Monn=C3=A9 &lt;<a href=3D"mailto:roger.pau@citrix.com">roger.pa=
u@citrix.com</a>&gt; wrote:<br></div><div dir=3D"ltr" class=3D"gmail_attr">=
<br></div><div class=3D"gmail_attr">Hello all.</div><div dir=3D"ltr" class=
=3D"gmail_attr"><br></div><div class=3D"gmail_attr">[sorry for the possible=
 format issues]</div><div dir=3D"ltr" class=3D"gmail_attr"><br></div><div d=
ir=3D"ltr" class=3D"gmail_attr"><br></div><blockquote class=3D"gmail_quote"=
 style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);p=
adding-left:1ex">On Tue, Jul 04, 2023 at 01:43:46PM +0200, Marek Marczykows=
ki-G=C3=B3recki wrote:<br>
&gt; Hi,<br>
&gt; <br>
&gt; FWIW, I have ran into this issue some time ago too. I run Xen on top o=
f<br>
&gt; KVM and then passthrough some of the virtio devices (network one<br>
&gt; specifically) into a (PV) guest. So, I hit both cases, the dom0 one an=
d<br>
&gt; domU one. As a temporary workaround I needed to disable<br>
&gt; CONFIG_XEN_VIRTIO completely (just disabling<br>
&gt; CONFIG_XEN_VIRTIO_FORCE_GRANT was not enough to fix it).<br>
&gt; With that context in place, the actual response below.<br>
&gt; <br>
&gt; On Tue, Jul 04, 2023 at 12:39:40PM +0200, Juergen Gross wrote:<br>
&gt; &gt; On 04.07.23 09:48, Roger Pau Monn=C3=A9 wrote:<br>
&gt; &gt; &gt; On Thu, Jun 29, 2023 at 03:44:04PM -0700, Stefano Stabellini=
 wrote:<br>
&gt; &gt; &gt; &gt; On Thu, 29 Jun 2023, Oleksandr Tyshchenko wrote:<br>
&gt; &gt; &gt; &gt; &gt; On 29.06.23 04:00, Stefano Stabellini wrote:<br>
&gt; &gt; &gt; &gt; &gt; &gt; I think we need to add a second way? It could=
 be anything that can help<br>
&gt; &gt; &gt; &gt; &gt; &gt; us distinguish between a non-grants-capable v=
irtio backend and a<br>
&gt; &gt; &gt; &gt; &gt; &gt; grants-capable virtio backend, such as:<br>
&gt; &gt; &gt; &gt; &gt; &gt; - a string on xenstore<br>
&gt; &gt; &gt; &gt; &gt; &gt; - a xen param<br>
&gt; &gt; &gt; &gt; &gt; &gt; - a special PCI configuration register value<=
br>
&gt; &gt; &gt; &gt; &gt; &gt; - something in the ACPI tables<br>
&gt; &gt; &gt; &gt; &gt; &gt; - the QEMU machine type<br>
&gt; &gt; &gt; &gt; &gt; <br>
&gt; &gt; &gt; &gt; &gt; <br>
&gt; &gt; &gt; &gt; &gt; Yes, I remember there was a discussion regarding t=
hat. The point is to<br>
&gt; &gt; &gt; &gt; &gt; choose a solution to be functional for both PV and=
 HVM *and* to be able<br>
&gt; &gt; &gt; &gt; &gt; to support a hotplug. IIRC, the xenstore could be =
a possible candidate.<br>
&gt; &gt; &gt; &gt; <br>
&gt; &gt; &gt; &gt; xenstore would be among the easiest to make work. The o=
nly downside is<br>
&gt; &gt; &gt; &gt; the dependency on xenstore which otherwise virtio+grant=
s doesn&#39;t have.<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; I would avoid introducing a dependency on xenstore, if nothi=
ng else we<br>
&gt; &gt; &gt; know it&#39;s a performance bottleneck.<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; We would also need to map the virtio device topology into xe=
nstore, so<br>
&gt; &gt; &gt; that we can pass different options for each device.<br>
&gt; &gt; <br>
&gt; &gt; This aspect (different options) is important. How do you want to =
pass virtio<br>
&gt; &gt; device configuration parameters from dom0 to the virtio backend d=
omain? You<br>
&gt; &gt; probably need something like Xenstore (a virtio based alternative=
 like virtiofs<br>
&gt; &gt; would work, too) for that purpose.<br>
&gt; &gt; <br>
&gt; &gt; Mapping the topology should be rather easy via the PCI-Id, e.g.:<=
br>
&gt; &gt; <br>
&gt; &gt; /local/domain/42/device/virtio/0000:00:1c.0/backend<br>
&gt; <br>
&gt; While I agree this would probably be the simplest to implement, I don&=
#39;t<br>
&gt; like introducing xenstore dependency into virtio frontend either.<br>
&gt; Toolstack -&gt; backend communication is probably easier to solve, as =
it&#39;s<br>
&gt; much more flexible (could use qemu cmdline, QMP, other similar<br>
&gt; mechanisms for non-qemu backends etc).<br>
<br>
I also think features should be exposed uniformly for devices, it&#39;s at<=
br>
least weird to have certain features exposed in the PCI config space<br>
while other features exposed in xenstore.<br>
<br>
For virtio-mmio this might get a bit confusing, are we going to add<br>
xenstore entries based on the position of the device config mmio<br>
region?<br>
<br>
I think on Arm PCI enumeration is not (usually?) done by the firmware,<br>
at which point the SBDF expected by the tools/backend might be<br>
different than the value assigned by the guest OS.<br>
<br>
I think there are two slightly different issues, one is how to pass<br>
information to virtio backends, I think doing this initially based on<br>
xenstore is not that bad, because it&#39;s an internal detail of the<br>
backend implementation. However passing information to virtio<br>
frontends using xenstore is IMO a bad idea, there&#39;s already a way to<br=
>
negotiate features between virtio frontends and backends, and Xen<br>
should just expand and use that.<br><br></blockquote><div><br></div><div><b=
r></div><div>On Arm with device-tree we have a special bindings which purpo=
se is to inform us whether we need to use grants for virtio and backend dom=
id for a particular device.Here on x86, we don&#39;t have a device tree, so=
 cannot (easily?) reuse this logic.</div><div><br>I have just recollected o=
ne idea suggested by Stefano some time ago [1]. The context of discussion w=
as about what to do when device-tree and ACPI cannot be reused (or somethin=
g like that).The idea won&#39;t cover virtio-mmio, but I have heard that vi=
rtio-mmio usage with x86 Xen is rather unusual case.</div><div><br>I will p=
aste the text below for convenience.=C2=A0</div><div><br></div><div>*******=
***</div><div><br>Part 1 (intro):</div><div><br>We could reuse a PCI config=
 space register to expose the backend id.<br>However this solution requires=
 a backend change (QEMU) to expose the<br>backend id via an emulated regist=
er for each emulated device.<br><br>To avoid having to introduce a special =
config space register in all<br>emulated PCI devices (virtio-net, virtio-bl=
ock, etc) I wonder if we<br>could add a special PCI config space register a=
t the emulated PCI Root<br>Complex level.<br><br>Basically the workflow wou=
ld be as follow:<br><br>- Linux recognizes the PCI Root Complex as a Xen PC=
I Root Complex<br>- Linux writes to special PCI config space register of th=
e Xen PCI Root<br>=C2=A0 Complex the PCI device id (basically the BDF)<br>-=
 The Xen PCI Root Complex emulated by Xen answers by writing back to<br>=C2=
=A0 the same location the backend id (domid of the backend)<br>- Linux read=
s back the same PCI config space register of the Xen PCI<br>=C2=A0 Root Com=
plex and learn the relevant domid</div><div><br>Part 2 (clarification):</di=
v><div><br>I think using a special config space register in the root comple=
x would<br>not be terrible in terms of guest changes because it is easy to<=
br>introduce a new root complex driver in Linux and other OSes. The root<br=
>complex would still be ECAM compatible so the regular ECAM driver would<br=
>still work. A new driver would only be necessary if you want to be able<br=
>to access the special config space register.<br><br><br>**********<br>What=
 do=C2=A0you=C2=A0think about it? Are there any pitfalls, etc? This also re=
quires system changes, but at least without virtio spec changes.=C2=A0=C2=
=A0<br><br></div><div>[1]=C2=A0<a href=3D"https://lore.kernel.org/xen-devel=
/alpine.DEB.2.22.394.2210061747590.3690179@ubuntu-linux-20-04-desktop/">htt=
ps://lore.kernel.org/xen-devel/alpine.DEB.2.22.394.2210061747590.3690179@ub=
untu-linux-20-04-desktop/</a><br></div><div><br></div><div><br></div></div>=
<span class=3D"gmail_signature_prefix">-- </span><br><div dir=3D"ltr" class=
=3D"gmail_signature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=
=3D"ltr"><span style=3D"background-color:rgb(255,255,255)"><font size=3D"2"=
><span style=3D"color:rgb(51,51,51);font-family:Arial,sans-serif">Regards,<=
/span></font></span></div><div dir=3D"ltr"><br></div><div dir=3D"ltr"><div>=
<span style=3D"background-color:rgb(255,255,255)"><font size=3D"2">Oleksand=
r Tyshchenko</font></span></div></div></div></div></div></div></div></div>

--000000000000efc60b05ffac6c55--


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 17:19:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 17:19:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558585.872814 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGjgQ-0005Nk-K1; Tue, 04 Jul 2023 17:19:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558585.872814; Tue, 04 Jul 2023 17:19:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGjgQ-0005Nd-G1; Tue, 04 Jul 2023 17:19:22 +0000
Received: by outflank-mailman (input) for mailman id 558585;
 Tue, 04 Jul 2023 17:19:20 +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
 <SRS0=U3Yz=CW=citrix.com=prvs=5427c2329=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qGjgO-0005NX-Tj
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 17:19:20 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e780f911-1a8e-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 19:19:18 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e780f911-1a8e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688491158;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=Eql3MawCi2ZfqehegLJ8cUT771NNec9LMnumXVGF1qE=;
  b=ZEYn5Lme1t0+H1RUjEtc6oNMvWnYCANF32UaxMNYmQm84sPJjUOA7Tbr
   GZFO15RSYAQJ0opBudZHyqVHCGjjuXXPaaYmMuTJFHYNXguPr9aNtZ/yo
   mtxNe3mZol0/lrnyPu+HX68hqWmAi0RgPlb58v6wkWjHpVXrVBLtVjFM0
   k=;
Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 115157045
X-Ironport-Server: esa3.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Polic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Zcb8MUyvcVyy833gs/rrirnk38gdJyiJN4IIrp0WdijchjtstoWC2Pr
 75i2zKikn2zqtHWbCjN6pI0JlsXN3U9Dp2eg5UJJr7fels8QT99V665LVYdl2tNxvU9qws11
 ivlBh8wJKTX2BUr1jlmmlg8MeiyDP6TXFowPDA2PEbA5pTQSd/H0UvrTLNuJeNP3LU6nZZJo
 wwtJ53o7gJnFm6WpFzwrPDV8ORfSfhcrVjfZnL4MGVmIsYIqs6g0oaMQzYDPRImVkKf3fbSa
 ZX5vu8HafLvnzhfMfs=
IronPort-HdrOrdr: A9a23:7HCrbqgBgYreQaAKaZfSTzWLknBQXtQji2hC6mlwRA09TyX4ra
 yTdZEgviMc5wx/ZJhNo7690cu7IU80hKQV3WB5B97LNmTbUQCTXeJfBOXZsljdMhy72ulB1b
 pxN4hSYeeAaWSSVPyKgjWFLw==
X-Talos-CUID: 9a23:HNyfVG4AIKYvsWnX5dssxEcdK/EdQGLk3W7OD2KaF15VF+2bVgrF
X-Talos-MUID: =?us-ascii?q?9a23=3AjOhlcA2EuH6aM7kVfYJV62N7vjUjzJuWEUoEk7I?=
 =?us-ascii?q?6+OaIdnR2fDSx3RLoa9py?=
X-IronPort-AV: E=Sophos;i="6.01,181,1684814400"; 
   d="scan'208";a="115157045"
From: Anthony PERARD <anthony.perard@citrix.com>
To: <qemu-devel@nongnu.org>
CC: Anthony PERARD <anthony.perard@citrix.com>, Peter Maydell
	<peter.maydell@linaro.org>, Stefano Stabellini <sstabellini@kernel.org>,
	"Paul Durrant" <paul@xen.org>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz
	<hreitz@redhat.com>, <xen-devel@lists.xenproject.org>,
	<qemu-block@nongnu.org>
Subject: [PATCH] xen-block: Avoid leaks on new error path
Date: Tue, 4 Jul 2023 18:18:19 +0100
Message-ID: <20230704171819.42564-1-anthony.perard@citrix.com>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain

From: Anthony PERARD <anthony.perard@citrix.com>

Commit 189829399070 ("xen-block: Use specific blockdev driver")
introduced a new error path, without taking care of allocated
resources.

So only allocate the qdicts after the error check, and free both
`filename` and `driver` when we are about to return and thus taking
care of both success and error path.

Coverity only spotted the leak of qdicts (*_layer variables).

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Fixes: Coverity CID 1508722, 1398649
Fixes: 189829399070 ("xen-block: Use specific blockdev driver")
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 hw/block/xen-block.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index f099914831..3906b9058b 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -781,14 +781,15 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
     drive = g_new0(XenBlockDrive, 1);
     drive->id = g_strdup(id);
 
-    file_layer = qdict_new();
-    driver_layer = qdict_new();
-
     rc = stat(filename, &st);
     if (rc) {
         error_setg_errno(errp, errno, "Could not stat file '%s'", filename);
         goto done;
     }
+
+    file_layer = qdict_new();
+    driver_layer = qdict_new();
+
     if (S_ISBLK(st.st_mode)) {
         qdict_put_str(file_layer, "driver", "host_device");
     } else {
@@ -796,7 +797,6 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
     }
 
     qdict_put_str(file_layer, "filename", filename);
-    g_free(filename);
 
     if (mode && *mode != 'w') {
         qdict_put_bool(file_layer, "read-only", true);
@@ -831,7 +831,6 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
     qdict_put_str(file_layer, "locking", "off");
 
     qdict_put_str(driver_layer, "driver", driver);
-    g_free(driver);
 
     qdict_put(driver_layer, "file", file_layer);
 
@@ -842,6 +841,8 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
     qobject_unref(driver_layer);
 
 done:
+    g_free(filename);
+    g_free(driver);
     if (*errp) {
         xen_block_drive_destroy(drive, NULL);
         return NULL;
-- 
Anthony PERARD



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 17:35:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 17:35:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558591.872824 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGjvQ-0007lq-UT; Tue, 04 Jul 2023 17:34:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558591.872824; Tue, 04 Jul 2023 17:34:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGjvQ-0007lj-QL; Tue, 04 Jul 2023 17:34:52 +0000
Received: by outflank-mailman (input) for mailman id 558591;
 Tue, 04 Jul 2023 17:34:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=vvOH=CW=citrix.com=prvs=5429f199a=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qGjvP-0007ld-Em
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 17:34:51 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 12f0de73-1a91-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 19:34:49 +0200 (CEST)
Received: from mail-bn8nam12lp2173.outbound.protection.outlook.com (HELO
 NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.173])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 04 Jul 2023 13:34:47 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by BN8PR03MB5041.namprd03.prod.outlook.com (2603:10b6:408:d5::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Tue, 4 Jul
 2023 17:34:45 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 17:34:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 12f0de73-1a91-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688492089;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=u4qgwxa2HSWQ0Voqd+25mTXU+RkPx4kBj3JVpHJvbhw=;
  b=GOfhfA8unFC1RVCQdLqJ/p8LDNov4SCeblwy8Gx3NvD1cm0m88LAPeM4
   oG3c7ybDQDNQ2SIYJWjdfJZKWWC73fYdkYxEzZRUT4dh8EgqVDBDbnNUo
   m2JjKvdRAHBpkRaGsG36MmiDCyeNaDBJ9aQ4KL02ed/ndCBuTru/GgkZ+
   4=;
X-IronPort-RemoteIP: 104.47.55.173
X-IronPort-MID: 114445133
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:7q2HAahxLMgyuWn3qWXI1tzWX161mBEKZh0ujC45NGQN5FlHY01je
 htvWWmEPqqDNzTyfNx+YN+xoU1SvpfVz4U1SwVp+XoyHnsb9cadCdqndUqhZCn6wu8v7q5Ex
 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv
 cKai8DEMRqu1iUc3lg8sspvkzsx+qyr0N8klgZmP6sT4weCzyJ94K83fsldEVOpGuG4IcbiL
 wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ
 OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+
 tRbbyoSME2+utmQybOEVqoxisQ8BZHSadZ3VnFIlVk1DN4AaLWaGeDgw48d2z09wMdTAfzZe
 swVLyJ1awjNaAFOPVFRD48imOCvhT/0dDgwRFC9/PJrpTSMilEsluGya7I5efTTLSlRtm+eq
 njL4CLSBRYCOcbE4TGE7mitlqnEmiaTtIc6TeTkqqI32QbIroAVIDMYSUeE+8mTtlSjZskAe
 1wM1XcFlrdnoSRHSfG4BXVUukWssRMbQdVdVeEn7gWE0oLf5wGECi4PSTspQMwrsoo6SCIn0
 neNnsj1Hnp/vbuNU3Wf+7yI6zSoNkA9IWELaiAFSg8Ey8L+u4x1hRXKJv5hGqOoitz+GRnr3
 iuH6iM5gt07j9MP1qi91UDKhXSrvJehZhUu+gzdU2ah7wV4TI2ofYql7R7c9/koBJmdZkmMu
 j4Dgcf20QwVJZSElSjISuNdGrisvqyBKGeF3gUpGIQ9/TOw/XLlZZpX/Dx1OEZuNIADZCPtZ
 0jQ/whW4fe/IUeXUEO+WKrpY+xC8EQqPY2Nuiz8BjaWXqVMSQ==
IronPort-HdrOrdr: A9a23:WgYICqkdaHsN1DSzdQRUxVF4sb7pDfKD3DAbv31ZSRFFG/Fw9v
 rDoB1/73TJYVkqN03I9ervBED4ewK4yXcW2+ks1MaZPTUO41HYSL2KhLGKq1eMJ8SZzJ8+6U
 4KSdkcNDSfNykHse/KpCGzH9MkzJ2s+KSwjefRyDNMQGhRGsZdxjY8IgyWF0h7ACNbH4c+EJ
 aGoupLzgDQAEg/X4CSDHUBWuSGg9HQjprpbVonCnccmXGzpALtwLT3Fh2Vmi0TVD5Oxrlny2
 TfjADjooWv2svLsSP05iv65ZhSndek8MdJHsaWisMYMXHNh2+TFeJccozHkDcpoPy+rHYG+e
 O83CvI5v4DkU85qFvF3CfQ5w==
X-Talos-CUID: 9a23:b7EaXWHTFtdc9sdHqmIks1QLRJ0YT0b7xXbvPwzlBWZ2YeWsHAo=
X-Talos-MUID: =?us-ascii?q?9a23=3AbY5tPwxoNvNKaAVUw/IehyYXHZyaqIqgFFwyy6U?=
 =?us-ascii?q?sh9OZCDcvayeFo2mceZByfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,181,1684814400"; 
   d="scan'208";a="114445133"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=NsvUS0JPFzQ/OvkSsj0b56AfmVp05fpFsxPy/Z9tM90WVQjOBW18ygGOM/C42D0eFRNIZ5vaLPEH4usgtDt8Z59o9V5HwqH3it8z6WgJRxnCjFEsxOMqEgFhKqUXowV4okir1kB1su+xVEP2Drf4Z25lF3aAGzxh7q+FYR3sJQdV+pVS5nS94E9vJg/ZgavgpVQXoMA8PBL1PRJbVqtYt1jU4ifLpBqkH4euRWeG8zPBBFUm580wFDorAMzDqBav7Jjg9XfA2dKNjU+YMarqT+B2OjDfZlrgUUmaak4BoF3TYUV/jIVXUl4Jck6w8ls7+o9e9/Y3wjuVTwVcvyg11w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ewONuJ2//BWQUIeHAtHVinAG9ujjLQ7OFAniG1+xqgU=;
 b=g0Nw46L+ikvldbCX1efqKucQ/hYGYFFw5sPAwtBZwrUSIzUY+raVREj7jnqt7k9MtOXRbUkOQPVPtCf8yNkZrglmpITeWPcbMfwdvfMrEwncVwPE5vCrqymelOw8c1A+Qfd2HeAmGTErZFEEbbPVTQoHcicdlauNBJas4qpe96UOuwrtT4E9IaMO45R7PwP0KT+WTIDRwvLGmFEG25xqcMODg4tP7tKcAirwJroxgoj4nyA15vCAhyfyL2yIp9PLLHqooF7FxfdeM7XVafs2XbemfPDS9ezGxocZ4y3K+wRWe+ZcQUwsVMeZcaT5Xik5pmP7PlMf4r0VlyyIHDOTRA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ewONuJ2//BWQUIeHAtHVinAG9ujjLQ7OFAniG1+xqgU=;
 b=o5VfdNuDkxWT7pyXH4EqNJvUVqhVXfAEhJDyWb6L5PXGL9PI9ymV+4wLWGhG15pYupmBjG7jh89XkGjtF6N9oB5xNRj4MZ2es1O6TVMVyY1CYC/2nJ/XImDw0xWcTROPUzYYn8UdXr1qqkuwUTXz4TUhmX3hjCIGD1xaZEW2/9g=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <b046ddf8-d70b-e2db-f996-32e6a7164cd8@citrix.com>
Date: Tue, 4 Jul 2023 18:34:39 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH 1/2] credit: Limit load balancing to once per millisecond
Content-Language: en-GB
To: George Dunlap <george.dunlap@cloud.com>, xen-devel@lists.xenproject.org
Cc: Dario Faggioli <dfaggioli@suse.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Wei Liu <wl@xen.org>
References: <20230630113756.672607-1-george.dunlap@cloud.com>
In-Reply-To: <20230630113756.672607-1-george.dunlap@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0301.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:196::18) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|BN8PR03MB5041:EE_
X-MS-Office365-Filtering-Correlation-Id: b0331d0b-b7bf-42cb-fdb1-08db7cb4f4db
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	gvNtdYhn/pG6w4Wuvpr6HgqgJmTPPV+mZPFPcS/QE74rsrBbm7+zFCDMfqYsqq7q1b4k6l3itagVCEIvhourd/VEbnY57ExtpmT/0bIIlrIrVyVfnFLTpKHxxUj/7albZaTsxw/6pOjSnL3/bN95X5P4YU6u3q3Vc+ynWoMsTTqT3eRKTMGa3whDPEYIZB62UqFUcIlIEdFmq22LGpx5FdLvYcBar71GMZ4TZPsvbYq+VVFXyDiuqlgUpDHP0SejU8KKtsvr3RZs3X+SiruwtIUOwqJItMITH8Vnasg24YqH5ChP0HNCok5fOh+kn5vjuf5XOzlnc5m2fJdwcybRcJ1pphA0gJEub7iSaIxZ0dDrxj2K/G1ADUZl+vxOkm5PhTuE7OJ5xIytrhogU5riiAS26Lke/7gmsfNsWRgSMFyhkjswN6nb5P3s568OB+bL9BJQHCGdOG9uinlAkUMXe5oREP6ACjywRTdh7lpMSoWbFypVGDof0JaL3uGf43Z4Nb3ta+ghaztrzh6lX6oMlUefmBTrZJM7clfLu+OULaJ3g1d5yLHHhiL7/tNUq6ACtEoRZPOqluugDRMSB/ozoEFqqx2payG8FHd1b67fIU9WP0cCKFIGe8nww5DTb+aXcI+GHseGFkdyBa83i051tw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(396003)(376002)(366004)(346002)(451199021)(41300700001)(8936002)(31686004)(8676002)(54906003)(36756003)(6486002)(316002)(5660300002)(2906002)(4326008)(66476007)(66556008)(6666004)(6512007)(478600001)(82960400001)(38100700002)(186003)(86362001)(31696002)(66946007)(2616005)(83380400001)(53546011)(6506007)(26005)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WjgzUDV3ZHZsTEQwMnJCVGJrWUZiUVFxcDAwZnh1S1NqNS9KQndYS1RQY2l4?=
 =?utf-8?B?VC9qdDRRZVlWb090SzM1V2lZOFNVZTdZNG9lTGduRkJ4RTZOb0F3RDNSeWg4?=
 =?utf-8?B?dXJ2Mzlwa01zU2YwZlBLSmw0RzBCZmtjS3BmbjRmNGtxSE4zNkV6UVltUzl1?=
 =?utf-8?B?clZKL0tJZHgzU3ZOMUIvSUs2c3hVWUcxRGNGL1J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POhG2Y0qhuKzJA0iAA7GPloVqnIQt9vlOMwqpb/+M9aDUS76kq8jwOAwwhaOgvb9Zyucn+57dc51vYtxXwGZvvZ94yjhe4wyi3OdedibLHgp5HHALdCXor9kkgVy/kZAB+NWtE7enKH1I+Pe3rfK0NIARH1OSeB1SASzm/etzOoZWEejpGXKu9jdUA
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b0331d0b-b7bf-42cb-fdb1-08db7cb4f4db
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 17:34:44.9931
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: l8utdcEM1tFUn3nI+Hj19YrwRPiFux7oTQT4ZOyfjCAfgoXO7zHvK9SmVwAdE2fIOcu60+b/oV85kFHQWNxPIl7xx5OV0FyilY1UpKsaM9c=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR03MB5041

On 30/06/2023 12:37 pm, George Dunlap wrote:
> The credit scheduler tries as hard as it can to ensure that it always
> runs scheduling units with positive credit (PRI_TS_UNDER) before
> running those with negative credit (PRI_TS_OVER).  If the next
> runnable scheduling unit is of priority OVER, it will always run the
> load balancer, which will scour the system looking for another
> scheduling unit of the UNDER priority.
>
> Unfortunately, as the number of cores on a system has grown, the cost
> of the work-stealing algorithm has dramatically increased; a recent
> trace on a system with 128 cores showed this taking over 50
> microseconds.
>
> Add a parameter, load_balance_ratelimit, to limit the frequency of
> load balance operations on a given pcpu.  Default this to 1
> millisecond.
>
> Invert the load balancing conditional to make it more clear, and line
> up more closely with the comment above it.
>
> Overall it might be cleaner to have the last_load_balance checking
> happen inside csched_load_balance(), but that would require either
> passing both now and spc into the function, or looking them up again;
> both of which seemed to be worse than simply checking and setting the
> values before calling it.
>
> Without this patch, on a system with a vcpu:pcpu ratio of 2:1, running
> Windows guests (which will end up calling YIELD during spinlock
> contention), this patch increased performance significantly.
>
> Signed-off-by: George Dunlap <george.dunlap@cloud.com>
> ---
> CC: Dario Faggioli <dfaggioli@suse.com>
> CC: Andrew Cooper <andrew.cooper3@citrix.com>
> CC: George Dunlap <george.dunlap@citrix.com>
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Julien Grall <julien@xen.org>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Wei Liu <wl@xen.org>
> ---
>  docs/misc/xen-command-line.pandoc |  6 +++++
>  xen/common/sched/credit.c         | 40 ++++++++++++++++++++++++++-----
>  xen/include/public/sysctl.h       |  6 +++++

Given this filelist, why the sysctl change?

There's no logic to drive this parameter in the xc/libxl param get/set.

The only two in-tree users I can see are xenpm, along with an
unconditional print to stderr saying it's deprecated and to use xl, and xl.

> diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
> index 4060ebdc5d..369557020f 100644
> --- a/docs/misc/xen-command-line.pandoc
> +++ b/docs/misc/xen-command-line.pandoc
> @@ -1856,6 +1856,12 @@ By default, Xen will use the INVPCID instruction for TLB management if
>  it is available.  This option can be used to cause Xen to fall back to
>  older mechanisms, which are generally slower.
>  
> +### load-balance-ratelimit
> +> `= <integer>`
> +
> +The minimum interval between load balancing events on a given pcpu.
> +At the moment only credit honors this parameter.

So this is intended to be a global scheduler parameter?

> diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c
> index f2cd3d9da3..b8bdfd5f6a 100644
> --- a/xen/common/sched/credit.c
> +++ b/xen/common/sched/credit.c
> @@ -1267,7 +1272,8 @@ csched_sys_cntl(const struct scheduler *ops,
>                   && (params->ratelimit_us > XEN_SYSCTL_SCHED_RATELIMIT_MAX
>                       || params->ratelimit_us < XEN_SYSCTL_SCHED_RATELIMIT_MIN))
>               || MICROSECS(params->ratelimit_us) > MILLISECS(params->tslice_ms)
> -             || params->vcpu_migr_delay_us > XEN_SYSCTL_CSCHED_MGR_DLY_MAX_US )
> +             || params->vcpu_migr_delay_us > XEN_SYSCTL_CSCHED_MGR_DLY_MAX_US
> +             || params->load_balance_ratelimit_us > XEN_SYSCTL_CSCHED_LB_RATE_MAX_US)

Style (give or take this hunk being with some logic to drive the new
sysctl).

> @@ -1963,10 +1979,12 @@ static void cf_check csched_schedule(
>           * urgent work... If not, csched_load_balance() will return snext, but
>           * already removed from the runq.
>           */
> -        if ( snext->pri > CSCHED_PRI_TS_OVER )
> -            __runq_remove(snext);
> -        else
> +        if ( snext->pri <= CSCHED_PRI_TS_OVER
> +             && now - spc->last_load_balance > prv->load_balance_ratelimit) {
> +            spc->last_load_balance = now;
>              snext = csched_load_balance(prv, sched_cpu, snext, &migrated);
> +        } else
> +            __runq_remove(snext);

Style.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 17:49:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 17:49:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558598.872834 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGk9d-0000yM-8l; Tue, 04 Jul 2023 17:49:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558598.872834; Tue, 04 Jul 2023 17:49:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGk9d-0000yF-4U; Tue, 04 Jul 2023 17:49:33 +0000
Received: by outflank-mailman (input) for mailman id 558598;
 Tue, 04 Jul 2023 17:49:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Gy6C=CW=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qGk9b-0000y9-QR
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 17:49:32 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on2061b.outbound.protection.outlook.com
 [2a01:111:f400:fe59::61b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1f71fbe0-1a93-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 19:49:29 +0200 (CEST)
Received: from SN6PR12MB2621.namprd12.prod.outlook.com (2603:10b6:805:73::15)
 by IA1PR12MB6140.namprd12.prod.outlook.com (2603:10b6:208:3e8::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 17:49:25 +0000
Received: from SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54]) by SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54%2]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 17:49:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1f71fbe0-1a93-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Tnipih9W3SzV6nCC0hl/DvU47MjzDp4iDMAeZKBlMLE3M3kOQj2tt9byU4y5Yh4jc0PmpNosk/8Oos+XhEqXPjSDm5cuOyIx0z9a651e+0ij2CuZKk5O80+IylPV9tY10QMD5UIhNBs9UdfIHkxBzx/cKhh+TCR9Agc5KbfXhi2DHxnvDbCSKKsGKueT74z3MJ+EJ8GTNCdOdooOSmnWLQ036d5TKfpi+nfwj2RJILEZ7zmxJKLgZ9Xsmuvd1C095GiRgypChbRp8R6fAcDsJ0JIGwoW2DAlWous35lAlbSr7qeyhW4RgnRcZ1Aj1oHDhHL0zoPPJdQI0DgQUIxMLA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yGlU24WHe213eNFj1Lqzcqyl9YI7crMqyTQ4h3q0I3U=;
 b=VrQT1Q/C+PAk6Ojc7CAQra1cYiClxBbEKHdfM1cNB5tezSOJ0CyMdS7VVrAyoWU9KjADKesZtGwrvUgcFj6swPdj/db3jp+inMZhgT+frGxn4ZVYOgWy/jFC5kLiSwX8zq/uEppvBOBAabKS4uzvYi3njEt66bIeXQ+e6F+PUobfYqqjTdxh7/ai/6gzy/DGCb9Zlz9RhpgULQ0Zj2cEXnePBpYf2JoescYJghOyE/awkgNV7IEWqS4b0kEJMqJNyFolFyOi3bVhRvZyz78bN4mngBeWc8Jm/jTQNmCy8EZDRtZ2Hr9EhV3lgd74uFGWw85rbb/Ndg3JAicMfS1hDg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yGlU24WHe213eNFj1Lqzcqyl9YI7crMqyTQ4h3q0I3U=;
 b=EXQjW5VTF37xDhnqJeSR+FjZUVD/HfOgDU7rUQZa79JFsyZgvd6JlQd0CzfEnXvqvX/eMPRX3LArQZ1dPwBoqjd6/deRoCOsik0XulpMjP3nfu3U2jHxh98nKaLS90s2Fn5rIHQB2ogLA2je/zj2p4fS1szzky8++usEbYrA+ow=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <516dc7aa-4487-cd7c-f9dc-42738314e3f4@amd.com>
Date: Tue, 4 Jul 2023 18:49:18 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 42/52] xen/mpu: implement setup_virt_paging for MPU
 system
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-43-Penny.Zheng@arm.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <20230626033443.2943270-43-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO2P265CA0356.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:d::32) To SN6PR12MB2621.namprd12.prod.outlook.com
 (2603:10b6:805:73::15)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN6PR12MB2621:EE_|IA1PR12MB6140:EE_
X-MS-Office365-Filtering-Correlation-Id: 2b4ef72b-b4e8-4cf5-42b8-08db7cb70167
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	BBfFTunHatp/JrwwW40x0xe7jSOtephOMRUGkoQYecDePZQfCFdGGyLK5CuSvi5g4iZAPhDJ4hVog6KUBNMLNOKAaCosC8/L5vjbSwFF3H3nfuw4MYT7o0Ga1JjRHoTjlBK9X64/D66d5By4IcU4w5blonH8dxA9s0G76SLJhHvHmI4m2jE62JKmIw2qhZaspjk75YQO5BKPhxRtjj/WUJ5m823RJh4p8QNAJnT4V9i7Qd7BuJ2CM/psOpSDjWpr9JYqWPagCQWZhDBh7h3Y1uOadylSTwEkWon5nU+vtlu/ySV6wDIKdGcg9yUCTEXOvqeEVhzxrW+Isyr2CSl18MI0BXcqGkP5GtUbp0NQZdppHTSpnkb6sqO+MGp2gDMrxZgGXTLKEISEw42Z7xtb9Tu2rB7MnFVPpHlU4X36yXHqroKSu7bVIgKY4r5cwiGdGk/xeZQuUZgOpcUre9YFTGY9tyC82GMpm0UQTjpcaDiFPPzf/4KecS1XXyEV0cmAWJmr9w2KhCcRsW20F93HKI0m7+mFffLicihc2koTQIYuW18mdFrVSwe7MJ5c7SSB4z6YTaYrvMbB47yQfb7l+rv5jwAMS1m6VWdPmf8DfuBOyTklXzMDIHcL1EbvY8kje79c7uc4zuiUINz90X0/iQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2621.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(376002)(396003)(136003)(366004)(451199021)(31696002)(41300700001)(38100700002)(6486002)(6666004)(2616005)(186003)(83380400001)(53546011)(26005)(6506007)(6512007)(54906003)(478600001)(2906002)(36756003)(316002)(66556008)(4326008)(66476007)(66946007)(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clNQYnZNVDhrODJpT1Y5R0hBbnowMkgyWHd4Ym5HdGJmNHZlbDB3ZFdt?=
 =?utf-8?B?Y0RnSzRWQzdmZFNNVGlLc0h3RElHME5IcnJpM2Uyc0JudHdGNmtnYXFpMjE5?=
 =?utf-8?B?NUEwNXFjOUQ2TjJRbHhXTVlPYW91QnZERnd3MUR6ZS8rejAwbmZZN0xoNTZn?=
 =?utf-8?B?cUdWWVUzQ3BNUkFvYXhiNG9ZV0JxckJGQ3I5cUViUTlUREJpTnllRXBxNUht?=
 =?utf-8?B?U3BNcjRMSXMya1p2ZStBTEg5VjhzajE0Q1lCUWxCL0haeGgvOThHMm93U3di?=
 =?utf-8?B?OExmUWVYK21BbndMWmowSk9aL1dvOWM4aWpXV0RVazUwdUdPSGZRV1NyUmQ4?=
 =?utf-8?B?UUdySkpzM0RvMURTYUVHaFVuMjArRFlMWFB4OGFQVmlNaFFUNWxQb1dOSzdq?=
 =?utf-8?B?VnFjSjZKTXY2QUJoaU5QTE9JbDc2M1V5TnRlMHRiNkpZeFZSQXJ5djRYTE9P?=
 =?utf-8?Q?lUbWSZ9Sk+mPHrOdBvaiYYdNl?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2b4ef72b-b4e8-4cf5-42b8-08db7cb70167
X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2621.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 17:49:24.8686
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: PTC0KwjnbCuVFzY2VkA4LrQIfGOTQzc4k9+lT+3YGBkhJvIPXkeKjxadI+p0zfVCEDAyvHlq5UUeEyzV5NJqaA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6140

Hi Penny,

Most of these are specific to ARM_64, thus we can add "#ifdef 
CONFIG_ARM_64" as follows :-

On 26/06/2023 04:34, Penny Zheng wrote:
> CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
>
>
> For MMU system, setup_virt_paging is used to configure stage 2 address
> translation regime, like IPA bits, VMID allocator set up, etc.
> Some could be inherited in MPU system, like VMID allocator set up, etc.
>
> For MPU system, we could have the following memory translation regime:
> - PMSAv8-64 at both EL1/EL0 and EL2
> - VMSAv8-64 at EL1/EL0 and PMSAv8-64 at EL2
> The default option will be the second, unless the platform could not support,
> which could be checked against MSA_frac bit in Memory Model Feature Register 0(
> ID_AA64MMFR0_EL1).
>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> ---
> v3:
> - no change
> ---
>   xen/arch/arm/Makefile                 |  1 +
>   xen/arch/arm/include/asm/cpufeature.h |  7 ++
>   xen/arch/arm/include/asm/p2m.h        |  8 +++
>   xen/arch/arm/include/asm/processor.h  | 13 ++++
>   xen/arch/arm/mpu/p2m.c                | 92 +++++++++++++++++++++++++++
>   5 files changed, 121 insertions(+)
>   create mode 100644 xen/arch/arm/mpu/p2m.c
>
> diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
> index feb49640a0..9f4b11b069 100644
> --- a/xen/arch/arm/Makefile
> +++ b/xen/arch/arm/Makefile
> @@ -47,6 +47,7 @@ obj-y += mmu/p2m.o
>   else
>   obj-y += mpu/mm.o
>   obj-y += mpu/setup.o
> +obj-y += mpu/p2m.o
>   endif
>   obj-y += mm.o
>   obj-y += monitor.o
> diff --git a/xen/arch/arm/include/asm/cpufeature.h b/xen/arch/arm/include/asm/cpufeature.h
> index 894f278a4a..cbaf41881b 100644
> --- a/xen/arch/arm/include/asm/cpufeature.h
> +++ b/xen/arch/arm/include/asm/cpufeature.h
> @@ -250,6 +250,12 @@ struct cpuinfo_arm {
>               unsigned long tgranule_16K:4;
>               unsigned long tgranule_64K:4;
>               unsigned long tgranule_4K:4;
> +#ifdef CONFIG_HAS_MPU
> +            unsigned long __res:16;
> +            unsigned long msa:4;
> +            unsigned long msa_frac:4;
> +            unsigned long __res0:8;
> +#else
>               unsigned long tgranule_16k_2:4;
>               unsigned long tgranule_64k_2:4;
>               unsigned long tgranule_4k_2:4;
> @@ -257,6 +263,7 @@ struct cpuinfo_arm {
>               unsigned long __res0:8;
>               unsigned long fgt:4;
>               unsigned long ecv:4;
> +#endif
>
>               /* MMFR1 */
>               unsigned long hafdbs:4;
> diff --git a/xen/arch/arm/include/asm/p2m.h b/xen/arch/arm/include/asm/p2m.h
> index f62d632830..d9c91d4a98 100644
> --- a/xen/arch/arm/include/asm/p2m.h
> +++ b/xen/arch/arm/include/asm/p2m.h
> @@ -16,8 +16,16 @@ extern unsigned int p2m_ipa_bits;
>
>   extern unsigned int p2m_root_order;
>   extern unsigned int p2m_root_level;
> +#ifdef CONFIG_HAS_MPU
> +/*
> + * A 4KB Page is enough for stage 2 translation in MPU system, which could
> + * store at most 255 EL2 MPU memory regions.
> + */
> +#define P2M_ROOT_ORDER 0
> +#else
>   #define P2M_ROOT_ORDER    p2m_root_order
>   #define P2M_ROOT_LEVEL p2m_root_level
> +#endif
>
>   #define MAX_VMID_8_BIT  (1UL << 8)
>   #define MAX_VMID_16_BIT (1UL << 16)
> diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h
> index 685f9b18fd..fe761ce50f 100644
> --- a/xen/arch/arm/include/asm/processor.h
> +++ b/xen/arch/arm/include/asm/processor.h
> @@ -389,6 +389,12 @@
>
>   #define VTCR_RES1       (_AC(1,UL)<<31)
>
> +#ifdef CONFIG_HAS_MPU
&& ARM_64 /* As these are specific to ID_AA64MMFR0EL1 */
> +#define VTCR_MSA_VMSA   (_AC(0x1,UL)<<31)
> +#define VTCR_MSA_PMSA   ~(_AC(0x1,UL)<<31)
> +#define NSA_SEL2        ~(_AC(0x1,UL)<<30)
> +#endif
> +
>   /* HCPTR Hyp. Coprocessor Trap Register */
>   #define HCPTR_TAM       ((_AC(1,U)<<30))
>   #define HCPTR_TTA       ((_AC(1,U)<<20))        /* Trap trace registers */
> @@ -449,6 +455,13 @@
>   #define MM64_VMID_16_BITS_SUPPORT   0x2
>   #endif
>
> +#ifdef CONFIG_HAS_MPU
&& ARM_64 /* As these are specific to ID_AA64MMFR0EL1 */
> +#define MM64_MSA_PMSA_SUPPORT       0xf
> +#define MM64_MSA_FRAC_NONE_SUPPORT  0x0
> +#define MM64_MSA_FRAC_PMSA_SUPPORT  0x1
> +#define MM64_MSA_FRAC_VMSA_SUPPORT  0x2
> +#endif
> +
>   #ifndef __ASSEMBLY__
>
>   extern register_t __cpu_logical_map[];
> diff --git a/xen/arch/arm/mpu/p2m.c b/xen/arch/arm/mpu/p2m.c
> new file mode 100644
> index 0000000000..04c44825cb
> --- /dev/null
> +++ b/xen/arch/arm/mpu/p2m.c
> @@ -0,0 +1,92 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#include <xen/lib.h>
> +#include <xen/mm-frame.h>
> +#include <xen/sched.h>
> +#include <xen/warning.h>
> +
> +#include <asm/p2m.h>
> +#include <asm/processor.h>
> +#include <asm/sysregs.h>
> +
> +void __init setup_virt_paging(void)
> +{
> +    uint64_t val = 0;
> +    bool p2m_vmsa = true;
> +
> +    /* PA size */
> +    const unsigned int pa_range_info[] = { 32, 36, 40, 42, 44, 48, 52, 0, /* Invalid */ };

As this file is common between ARM_32 and ARM_64 and the following is 
specific to ARM_64, please add

#ifdef CONFIG_ARM_64

> +
> +    /*
> +     * Restrict "p2m_ipa_bits" if needed. As P2M table is always configured
> +     * with IPA bits == PA bits, compare against "pabits".
> +     */
> +    if ( pa_range_info[system_cpuinfo.mm64.pa_range] < p2m_ipa_bits )
> +        p2m_ipa_bits = pa_range_info[system_cpuinfo.mm64.pa_range];
> +
> +    /* In ARMV8R, hypervisor in secure EL2. */
> +    val &= NSA_SEL2;
> +
> +    /*
> +     * The MSA and MSA_frac fields in the ID_AA64MMFR0_EL1 register
> +     * identify the memory system configurations supported at EL1.
> +     * In Armv8-R AArch64, the only permitted value for ID_AA64MMFR0_EL1.MSA is
> +     * 0b1111. When ID_AA64MMFR0_EL1.MSA_frac is 0b0010, the stage 1 of the
> +     * Secure EL1&0 translation regime can enable PMSAv8-64 or VMSAv8-64
> +     * architecture.
> +     */
> +    if ( system_cpuinfo.mm64.msa == MM64_MSA_PMSA_SUPPORT )
> +    {
> +        if ( system_cpuinfo.mm64.msa_frac == MM64_MSA_FRAC_NONE_SUPPORT )
> +            goto fault;
> +
> +        if ( system_cpuinfo.mm64.msa_frac != MM64_MSA_FRAC_VMSA_SUPPORT )
> +        {
> +            p2m_vmsa = false;
> +            warning_add("Be aware of that there is no support for VMSAv8-64 at EL1 on this platform.\n");
> +        }
> +    }
> +    else
> +        goto fault;
> +
> +    /*
> +     * If PE supports both PMSAv8-64 and VMSAv8-64 at EL1, then VTCR_EL2.MSA
> +     * determines the memory system architecture enabled at stage 1 of the
> +     * Secure EL1&0 translation regime.
> +     *
> +     * Normally, we set the initial VTCR_EL2.MSA value VMSAv8-64 support,
> +     * unless this platform only supports PMSAv8-64.
> +     */
> +    if ( !p2m_vmsa )
> +        val &= VTCR_MSA_PMSA;
> +    else
> +        val |= VTCR_MSA_VMSA;
> +
> +    /*
> +     * cpuinfo sanitization makes sure we support 16bits VMID only if
> +     * all cores are supporting it.
> +     */
> +    if ( system_cpuinfo.mm64.vmid_bits == MM64_VMID_16_BITS_SUPPORT )
> +        max_vmid = MAX_VMID_16_BIT;
> +
> +    /* Set the VS bit only if 16 bit VMID is supported. */
> +    if ( MAX_VMID == MAX_VMID_16_BIT )
> +        val |= VTCR_VS;
> +

#endif

- Ayan

> +    p2m_vmid_allocator_init();
> +
> +    WRITE_SYSREG(val, VTCR_EL2);
> +
> +    return;
> +
> +fault:
> +    panic("Hardware with no PMSAv8-64 support in any translation regime.\n");
> +}
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> --
> 2.25.1
>
>


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 17:58:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 17:58:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558602.872844 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGkHi-0002S3-2t; Tue, 04 Jul 2023 17:57:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558602.872844; Tue, 04 Jul 2023 17:57:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGkHh-0002Rw-VO; Tue, 04 Jul 2023 17:57:53 +0000
Received: by outflank-mailman (input) for mailman id 558602;
 Tue, 04 Jul 2023 17:57:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=1/Zo=CW=linaro.org=peter.maydell@srs-se1.protection.inumbo.net>)
 id 1qGkHg-0002Rq-G8
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 17:57:52 +0000
Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com
 [2a00:1450:4864:20::52d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4aff86c3-1a94-11ee-b237-6b7b168915f2;
 Tue, 04 Jul 2023 19:57:51 +0200 (CEST)
Received: by mail-ed1-x52d.google.com with SMTP id
 4fb4d7f45d1cf-51d9695ec29so5676780a12.1
 for <xen-devel@lists.xenproject.org>; Tue, 04 Jul 2023 10:57:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4aff86c3-1a94-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688493471; x=1691085471;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=1I+xLxqpcwpQEj1PAi8T1l+y6v0OvsrHvpN+d3/7Ah8=;
        b=zEhlq1uOikgZZPpqfSX3RUp/JLFryJ5j12vPixlTa9VlCrBGZgWrvX3+NGHyYf0xy9
         ok17VW4ZSRvwogXoy7HZwGx1gEQHwGudp2NqNbbLIpZ6SRhlWjCWSnMjbwfJZeWeln9J
         drFJg7fuJmvBA5B9i8QHpO0oKzwtTuRPA3p8jGjid8tEsrcIILyS65UGhRemr8WayNML
         hMCRnEgkvtv+PEYQqiQxHmxwDC373pXS0XCJAxmrwn0AwMvV2H57nauIhR+hrZ7dU/+8
         /dbfQsQJq95GO6NDGZaNkDdVkMepJlDoltLKBs5AENv/t1moDYB0dr58jyMoOVGUgTKO
         AD1g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688493471; x=1691085471;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=1I+xLxqpcwpQEj1PAi8T1l+y6v0OvsrHvpN+d3/7Ah8=;
        b=Emi3dcpDo4phzFomNRky32CaWm4BvWzKNLsSAjAmPnQIukggiI91Biagt159pqJVhv
         eQwaQzmCC2NRu6FKDTqrcwDKtJTbV6XN8/4jxG6nZA/uwoTygTeq3H3gvSGadG3qzhiY
         iao47dTkkkK90CiPlC5r28MfIl5atxEfkZpTLgUSdsFElSQVWFGRMGXT3Uug2fBwPLkh
         sLHPLXcEfDO3fgdxFLMpGM4BwHk1KZ1jXfoyigOkrv2El3BPBl6oks6OyYTM8joy6wlw
         lPm9D+aRPWepfiBn70i7oRbHjrEMTJkGGBWsXh+Oau5D+AhfR+51nf80Md0In/Errc6L
         Vr3g==
X-Gm-Message-State: ABy/qLbwX91YoxP0nS/QKzMnvyfaTkAGtgXiUZJzxgjtYOTFjaCfj+Lb
	3SMtOqS3Ysu8Ye1PHvy4u6UON3wMw7xxtoi4ISQOyQ==
X-Google-Smtp-Source: APBJJlGcs7caUQUsTleNGcLmtaux9I042ZlS9fWvoL40hBRfqnl4dt2f/GMcXSQ3ze27JqjnGyfbPHY71TEney6NKtc=
X-Received: by 2002:a05:6402:1253:b0:51e:126a:403a with SMTP id
 l19-20020a056402125300b0051e126a403amr3572849edw.13.1688493470741; Tue, 04
 Jul 2023 10:57:50 -0700 (PDT)
MIME-Version: 1.0
References: <20230704171819.42564-1-anthony.perard@citrix.com>
In-Reply-To: <20230704171819.42564-1-anthony.perard@citrix.com>
From: Peter Maydell <peter.maydell@linaro.org>
Date: Tue, 4 Jul 2023 18:57:39 +0100
Message-ID: <CAFEAcA_okj_rH3RR_a7BrOsxxEWBQGa7bGDXK1OrwCD9izVaDg@mail.gmail.com>
Subject: Re: [PATCH] xen-block: Avoid leaks on new error path
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: qemu-devel@nongnu.org, Stefano Stabellini <sstabellini@kernel.org>, 
	Paul Durrant <paul@xen.org>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
	xen-devel@lists.xenproject.org, qemu-block@nongnu.org
Content-Type: text/plain; charset="UTF-8"

On Tue, 4 Jul 2023 at 18:19, Anthony PERARD <anthony.perard@citrix.com> wrote:
>
> From: Anthony PERARD <anthony.perard@citrix.com>
>
> Commit 189829399070 ("xen-block: Use specific blockdev driver")
> introduced a new error path, without taking care of allocated
> resources.
>
> So only allocate the qdicts after the error check, and free both
> `filename` and `driver` when we are about to return and thus taking
> care of both success and error path.
>
> Coverity only spotted the leak of qdicts (*_layer variables).
>
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Fixes: Coverity CID 1508722, 1398649
> Fixes: 189829399070 ("xen-block: Use specific blockdev driver")
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 18:24:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 18:24:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558606.872854 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGkgs-0005sG-37; Tue, 04 Jul 2023 18:23:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558606.872854; Tue, 04 Jul 2023 18:23:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGkgs-0005s9-0K; Tue, 04 Jul 2023 18:23:54 +0000
Received: by outflank-mailman (input) for mailman id 558606;
 Tue, 04 Jul 2023 18:23:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGkgq-0005s0-6d
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 18:23:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGkgp-0007XI-EN; Tue, 04 Jul 2023 18:23:51 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGkgp-0007hD-8X; Tue, 04 Jul 2023 18:23:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=Y0aX9g9aRpkUunebuDtkqLKcZeL4ngk737CZD7anojM=; b=FjigqDh/aLpa7QZHDOzCPgAWfS
	en5IARejf30YixT+hJHQqHsdglObinxBNedEnvWolaEu+6S4BC2EZfV5lRGXTRmIECtTPlItha9xe
	dW/XU9hvDVlXboz4BgD47+sHAC8qNqfkN3t7EnrW5tGCheWdoDJxdV6kfr3764lUrIbs=;
Message-ID: <0b332497-ae42-1356-67d5-1a46ace11b01@xen.org>
Date: Tue, 4 Jul 2023 19:23:49 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH] xen/arm: grant-table: Correct the prototype of the arch
 helpers
Content-Language: en-US
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Luca Fancellu <Luca.Fancellu@arm.com>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 Henry Wang <Henry.Wang@arm.com>, Julien Grall <jgrall@amazon.com>,
 "federico.serafini@bugseng.com" <federico.serafini@bugseng.com>
References: <20230629210150.69525-1-julien@xen.org>
 <B186E9AD-1DBE-41B2-ADE9-850F1ACC4078@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <B186E9AD-1DBE-41B2-ADE9-850F1ACC4078@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Bertrand,

On 04/07/2023 15:35, Bertrand Marquis wrote:
>> On 29 Jun 2023, at 23:01, Julien Grall <julien@xen.org> wrote:
>>
>> From: Julien Grall <jgrall@amazon.com>
>>
>> Both the stub and the x86 prototypes for replace_grant_host_mapping()
>> and create_grant_host_mapping() will define the first parameter (and
>> third for the former) as uint64_t. Yet Arm will define it as
>> 'unsigned long'.
>>
>> While there are no differences for 64-bit, for 32-bit it means
>> that the address should be truncated as 32-bit guest could support
>> up to 40-bit addresses.
>>
>> So replace 'unsigned long' with 'uint64_t' for the first parameter
>> (and third parameter for replace_grant_host_mapping()).
>>
>> Signed-off-by: Julien Grall <jgrall@amazon.com>
> 
> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Thanks. It is now committed.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 18:26:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 18:26:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558610.872863 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGkio-0006RF-Dr; Tue, 04 Jul 2023 18:25:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558610.872863; Tue, 04 Jul 2023 18:25:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGkio-0006R8-B6; Tue, 04 Jul 2023 18:25:54 +0000
Received: by outflank-mailman (input) for mailman id 558610;
 Tue, 04 Jul 2023 18:25:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGkin-0006R2-78
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 18:25:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGkim-0007aX-W3; Tue, 04 Jul 2023 18:25:52 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGkim-0007ls-Qh; Tue, 04 Jul 2023 18:25:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=ZAUI+0haJgBL3ttcEM4j8rCmFTuuZxol0NIwFnn3viY=; b=FI/xEPR3m/Fo/EBlEEmW/Th/Kh
	6wEt6io9Ko0HH47fTYfaWX5D+tXzt6iR0MsJuImTw24s06Z8gvAe1kRdFXTuFArizbkPttR5wBmeH
	qhlGdb4cA8FrDTxYPw8/L+04pH+iwAVSg5flF2vbHoiFxWf30wH9b+1TfhBaaO0/Ad2c=;
Message-ID: <091d93d2-62c0-fbc1-35c6-e414e4c178e9@xen.org>
Date: Tue, 4 Jul 2023 19:25:51 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [v2 1/4] xen/arm64: head: Don't map too much in boot_third
Content-Language: en-US
To: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org
Cc: Luca.Fancellu@arm.com, Henry.Wang@arm.com,
 Julien Grall <jgrall@amazon.com>
References: <20230629201129.12934-1-julien@xen.org>
 <20230629201129.12934-2-julien@xen.org>
 <ad88adc9-5b05-65f9-2071-c746748ec3df@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <ad88adc9-5b05-65f9-2071-c746748ec3df@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Michal,

On 30/06/2023 07:50, Michal Orzel wrote:
> 
> 
> On 29/06/2023 22:11, Julien Grall wrote:
>>
>>
>> From: Julien Grall <jgrall@amazon.com>
>>
>> At the moment, we are mapping the size of the reserved area for Xen
>> (i.e. 2MB) even if the binary is smaller. We don't exactly know what's
>> after Xen, so it is not a good idea to map more than necessary for a
>> couple of reasons:
>>      * We would need to use break-before-make if the extra PTE needs to
>>        be updated to point to another region
>>      * The extra area mapped may be mapped again by Xen with different
>>        memory attribute. This would result to attribute mismatch.
>>
>> Therefore, rework the logic in create_page_tables() to map only what's
>> necessary. To simplify the logic, we also want to make sure _end
>> is page-aligned. So align the symbol in the linker and add an assert
>> to catch any change.
>>
>> Lastly, take the opportunity to confirm that _start is equal to
>> XEN_VIRT_START as the assembly is using both interchangeably.
>>
>> Signed-off-by: Julien Grall <jgrall@amazon.com>
> NIT: it looks like other maintainers are not CCed on this series.

Whoops. I forgot to call scripts/add_maintainers.pl. I see that Bertrand 
reviewed it. So I will not resend it.

> 
> Reviewed-by: Michal Orzel <michal.orzel@amd.com>

Thanks!

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 18:27:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 18:27:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558614.872874 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGkkH-00070J-Nj; Tue, 04 Jul 2023 18:27:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558614.872874; Tue, 04 Jul 2023 18:27:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGkkH-00070C-Kc; Tue, 04 Jul 2023 18:27:25 +0000
Received: by outflank-mailman (input) for mailman id 558614;
 Tue, 04 Jul 2023 18:27:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGkkG-000704-6V
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 18:27:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGkkG-0007c6-09; Tue, 04 Jul 2023 18:27:24 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGkkF-0007oC-Qy; Tue, 04 Jul 2023 18:27:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=2kGXoqJY5IwN/waduG9mep+PyvY/bATseQembqVcYCU=; b=0sbHGf7eV/KqLg5Ve5XhPGk1UM
	+yurDgcY6fcutry204AHxhl5ThYjyalL4CTmeSbNVuZBH1nd7wIz2Q39GYT6wF0xC3j8PLXQD7Fvy
	XyIUmD3LcHcpVOB5ERe0jpAmZxTm3ue4mreBLuB1p5W7NRQFTrMdLTEtz58V5HZcP9mU=;
Message-ID: <68580901-f61f-02d0-9ddf-c89b41e50bf7@xen.org>
Date: Tue, 4 Jul 2023 19:27:22 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [v2 2/4] xen/arm32: head: Don't map too much in boot_third
Content-Language: en-US
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Luca Fancellu <Luca.Fancellu@arm.com>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 Henry Wang <Henry.Wang@arm.com>, Julien Grall <jgrall@amazon.com>
References: <20230629201129.12934-1-julien@xen.org>
 <20230629201129.12934-3-julien@xen.org>
 <CC83991E-F43E-441C-B13E-4EF976815F7A@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <CC83991E-F43E-441C-B13E-4EF976815F7A@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Bertrand,

On 04/07/2023 15:12, Bertrand Marquis wrote:
>> On 29 Jun 2023, at 22:11, Julien Grall <julien@xen.org> wrote:
>>
>> From: Julien Grall <jgrall@amazon.com>
>>
>> At the moment, we are mapping the size of the reserved area for Xen
>> (i.e. 2MB) even if the binary is smaller. We don't exactly know what's
>> after Xen, so it is not a good idea to map more than necessary for a
>> couple of reasons:
>>     * We would need to use break-before-make if the extra PTE needs to
>>       be updated to point to another region
>>     * The extra area mapped may be mapped again by Xen with different
>>       memory attribute. This would result to attribute mismatch.
>>
>> Therefore, rework the logic in create_page_tables() to map only what's
>> necessary. To simplify the logic, we also want to make sure _end
>> is page-aligned. So align the symbol in the linker and add an assert
>> to catch any change.
> 
> The last 2 sentences actually belongs to patch 1 and have been copied
> here. Please remove them on commit as alignment of _end is not in
> this patch.

Good point. I have removed them.

> 
>>
>> Signed-off-by: Julien Grall <jgrall@amazon.com>
>> Reviewed-by: Michal Orzel <michal.orzel@amd.com>
>>
> With commit message fixed on commit:
> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Thanks!

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 18:28:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 18:28:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558620.872884 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGklV-0007cr-5B; Tue, 04 Jul 2023 18:28:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558620.872884; Tue, 04 Jul 2023 18:28:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGklV-0007ck-1y; Tue, 04 Jul 2023 18:28:41 +0000
Received: by outflank-mailman (input) for mailman id 558620;
 Tue, 04 Jul 2023 18:28:40 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGklU-0007ce-32
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 18:28:40 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGklT-0007dK-WB; Tue, 04 Jul 2023 18:28:39 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGklT-0007pY-Qy; Tue, 04 Jul 2023 18:28:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=sl7a547exq3daUqVNlCI3Uw614+AwnEgFNAX9X2TPsg=; b=d7Sxl6veZYilboyrLc/Gck1Lzy
	7bdwOysuD5nUcduFjZvQxUOKtN6fM4nmWRvlnuywbCeM+QRg3mfvATw+L2Yo03qF1hJ8i7Tyxg3bv
	kNTSZtXzRX9TVp/H0LwjzCdtLqCD+pGDgI97iOlJvQk5y7MHuPO4H7945sLeTojHK1ts=;
Message-ID: <de2dbf5c-1165-6297-cbac-b2de6945b880@xen.org>
Date: Tue, 4 Jul 2023 19:28:38 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [v2 3/4] xen/arm: Rework the code mapping Xen to avoid relying on
 the size of Xen
Content-Language: en-US
To: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org
Cc: Luca.Fancellu@arm.com, Henry.Wang@arm.com,
 Julien Grall <jgrall@amazon.com>
References: <20230629201129.12934-1-julien@xen.org>
 <20230629201129.12934-4-julien@xen.org>
 <c921be22-d272-5c15-24d8-5002f9773e16@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <c921be22-d272-5c15-24d8-5002f9773e16@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 30/06/2023 07:56, Michal Orzel wrote:
> 
> 
> On 29/06/2023 22:11, Julien Grall wrote:
>>
>>
>> From: Julien Grall <jgrall@amazon.com>
>>
>> At the moment, the maximum size of Xen binary we can support is 2MB.
>> This is what we reserved in the virtual address but also what all
>> the code in Xen relies on as we only allocate one L3 page-table.
>>
>> When feature like UBSAN (will be enabled in a follow-up patch) and GCOV
>> are enabled, the binary will be way over 2MB.
>>
>> The code is now reworked so it doesn't rely on a specific size but
>> will instead look at the reversed size and compute the number of
>> page-table to allocate/map.
>>
>> While at it, replace any reference to 4KB mappings with a more
>> generic word because the page-size may change in the future.
>>
>> Also fix the typo s/tlb/tbl/ in code move in arm32/head.S
> as well as in arm64 (can be done on commit)

I have replaced "arm32/head.S" with "arm{32,64}/head.S".

> 
>>
>> Signed-off-by: Julien Grall <jgrall@amazon.com>
> Reviewed-by: Michal Orzel <michal.orzel@amd.com>

Thanks!

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 18:31:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 18:31:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558624.872895 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGkng-0000eN-Hi; Tue, 04 Jul 2023 18:30:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558624.872895; Tue, 04 Jul 2023 18:30:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGkng-0000eG-DE; Tue, 04 Jul 2023 18:30:56 +0000
Received: by outflank-mailman (input) for mailman id 558624;
 Tue, 04 Jul 2023 18:30:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGknf-0000e8-Gm
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 18:30:55 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGknf-0007gf-6P; Tue, 04 Jul 2023 18:30:55 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGkne-0007ub-W2; Tue, 04 Jul 2023 18:30:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=wwS1ZcdKEK7hbyQHGkE8+cpQdWEFB3jUg4THvcJuwEw=; b=3eOgtg/tsGU85UwE8NOcw6o17o
	y28DVYlc3FuiKk9G+HvOEJ0ycC3hzU8svk8zO5nEfUez/X2Ed9tFuN7XZrc3Yz8+1hltV+7QHMCmQ
	K9dM2ckkbBAeWuYI3aCuS3P6vczX/gYmGTw8JPFlzBI2N8+81PGZQ19EwBh74mCWY5Ds=;
Message-ID: <c954ac7f-8eaa-672a-1248-ad2612e27f0f@xen.org>
Date: Tue, 4 Jul 2023 19:30:53 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [v2 4/4] xen/arm: Allow the user to build Xen with UBSAN
Content-Language: en-US
To: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org
Cc: Luca.Fancellu@arm.com, Henry.Wang@arm.com,
 Julien Grall <jgrall@amazon.com>
References: <20230629201129.12934-1-julien@xen.org>
 <20230629201129.12934-5-julien@xen.org>
 <1bbde5ea-9cb2-4aac-fe36-66b7cfddd00a@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <1bbde5ea-9cb2-4aac-fe36-66b7cfddd00a@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Michal,

On 30/06/2023 07:58, Michal Orzel wrote:
> 
> 
> On 29/06/2023 22:11, Julien Grall wrote:
>>
>>
>> From: Julien Grall <jgrall@amazon.com>
>>
>> UBSAN has been enabled a few years ago on x86 but was never
>> enabled on Arm because the final binary is bigger than 2MB (
>> the maximum we can currently handled).
>>
>> With the recent rework, it is now possible to grow Xen over 2MB.
>> So there is no more roadblock to enable Xen other than increasing
>> the reserved area.
>>
>> On my setup, for arm32, the final binaray was very close to 4MB.
>> Furthermore, one may want to enable UBSAN and GCOV which would put
>> the binary well-over 4MB (both features require for some space).
>> Therefore, increase the size to 8MB which should us some margin.
>>
>> Signed-off-by: Julien Grall <jgrall@amazon.com>
>>
>> ---
>>
>> The drawback with this approach is that we are adding 6 new
>> page-table (3 for boot and 3 for runtime) that are statically
>> allocated. So the final Xen binary will be 24KB bigger when
>> neither UBSAN nor GCOV.
>>
>> If this is not considered acceptable, then we could make the
>> size of configurable in the Kconfig and decide it based on the
>> features enabled.
>>
>>      Changes in v2:
>>          - Fix typoes
>>          - Add Michal's reviewed-by tag
> I cannot see one, so:

Hmmmm, you gave it on v1 but I can't remember why I didn't carry it. 
Anyway...

> Reviewed-by: Michal Orzel <michal.orzel@amd.com>

Thanks!

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 18:32:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 18:32:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558628.872904 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGkpE-0001D8-QI; Tue, 04 Jul 2023 18:32:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558628.872904; Tue, 04 Jul 2023 18:32:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGkpE-0001D1-NT; Tue, 04 Jul 2023 18:32:32 +0000
Received: by outflank-mailman (input) for mailman id 558628;
 Tue, 04 Jul 2023 18:32:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGkpD-0001Cv-Rp
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 18:32:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGkpD-0007iE-Nc; Tue, 04 Jul 2023 18:32:31 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGkpD-0007wH-I3; Tue, 04 Jul 2023 18:32:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:
	References:Cc:To:From:Subject:MIME-Version:Date:Message-ID;
	bh=pNT2RR9wvp4PdfgVu6RKzM4M4/4i0emwdv4EEw+O2U4=; b=q/llBv5OcNNJowFdvFnbExX3CH
	jya9a0xptF1wlPkI1MpAIKmWG+lYw8dgyN42w1rhB4CYF9FKwGe2rPZrue6q8pGqozlSaRCSPW10Q
	ETZqI5nzSvyFt3xilM5ItL4HnAOQY2ZuoSaf8ukgLvb5AsFb2AHWCdsMB88GpD8CiESY=;
Message-ID: <8de632d2-405c-22b7-91b7-62294c399401@xen.org>
Date: Tue, 4 Jul 2023 19:32:30 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [v2 0/4] xen/arm: Enable USBAN support
Content-Language: en-US
From: Julien Grall <julien@xen.org>
To: xen-devel@lists.xenproject.org
Cc: Luca.Fancellu@arm.com, michal.orzel@amd.com, Henry.Wang@arm.com,
 Julien Grall <jgrall@amazon.com>
References: <20230629201129.12934-1-julien@xen.org>
In-Reply-To: <20230629201129.12934-1-julien@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi all,

On 29/06/2023 21:11, Julien Grall wrote:
> From: Julien Grall <jgrall@amazon.com>
> 
> Hi all,
> 
> At the moment, we are not able to enable UBSAN on Arm because the
> final binary will be over the maximum size of Xen we currently support
> (i.e. 2MB).
> 
> This patch series aim to lift the restrictions and also
> enable UBSAN.
> 
> Cheers,
> 
> Julien Grall (4):
>    xen/arm64: head: Don't map too much in boot_third
>    xen/arm32: head: Don't map too much in boot_third
>    xen/arm: Rework the code mapping Xen to avoid relying on the size of
>      Xen
>    xen/arm: Allow the user to build Xen with UBSAN

This is now committed.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 18:37:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 18:37:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558631.872913 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGktP-0001p5-8w; Tue, 04 Jul 2023 18:36:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558631.872913; Tue, 04 Jul 2023 18:36:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGktP-0001oy-61; Tue, 04 Jul 2023 18:36:51 +0000
Received: by outflank-mailman (input) for mailman id 558631;
 Tue, 04 Jul 2023 18:36:49 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGktN-0001oq-O5
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 18:36:49 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGktL-0007mn-N3; Tue, 04 Jul 2023 18:36:47 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGktL-0008Gi-Hq; Tue, 04 Jul 2023 18:36:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:To:Subject:MIME-Version:Date:Message-ID;
	bh=pUNTY2OwvugjMFqnxMcZ1IG177+ppdCBOHZA/7+TsBI=; b=rAuxCljuAYSJZdIO6GjQwOhp3Q
	Q5IbutG+xYtiRK8zbLpBu6UvvrHRrxUNSIXe4qXKnYTT66kd7cOnXc+X2LAE5rwZUd1H5U7KkawDU
	e6LR7YDk3zP3hZPnRvzo0/sRANyPpL4l2cCQ7MU2kL5LWxGK/Q+EYUoH633nPos/s1wc=;
Message-ID: <f48fdc6d-35b2-6881-b395-13459f9d4d44@xen.org>
Date: Tue, 4 Jul 2023 19:36:46 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: xen | Failed pipeline for staging | 9dd3caf1
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
 <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <649eeb9f5347_281f686f427353e@gitlab-sidekiq-catchall-v2-54666fdc77-xrbls.mail>
 <bff9074d-0345-2931-c57b-3acda238a9b5@suse.com>
 <220e6e10-ab9f-b036-9acf-58109d2a7426@citrix.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <220e6e10-ab9f-b036-9acf-58109d2a7426@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 04/07/2023 16:50, Andrew Cooper wrote:
> On 04/07/2023 4:39 pm, Jan Beulich wrote:
>> On 30.06.2023 16:50, GitLab wrote:
>>>
>>> Pipeline #917215286 has failed!
>>>
>>> Project: xen ( https://gitlab.com/xen-project/xen )
>>> Branch: staging ( https://gitlab.com/xen-project/xen/-/commits/staging )
>>>
>>> Commit: 9dd3caf1 ( https://gitlab.com/xen-project/xen/-/commit/9dd3caf12f52b859947c260b1cb3a48b491d53b6 )
>>> Commit Message: {x86,arm}/mm.c: Make populate_pt_range __init
>>>
>>> ...
>>> Commit Author: George Dunlap
>>> Committed by: George Dunlap
>>>
>>>
>>> Pipeline #917215286 ( https://gitlab.com/xen-project/xen/-/pipelines/917215286 ) triggered by Ganis ( https://gitlab.com/ganis )
>>> had 3 failed jobs.
>>>
>>> Job #4573553348 ( https://gitlab.com/xen-project/xen/-/jobs/4573553348/raw )
>>>
>>> Stage: build
>>> Name: opensuse-tumbleweed-gcc-debug
>>> Job #4573553345 ( https://gitlab.com/xen-project/xen/-/jobs/4573553345/raw )
>>>
>>> Stage: build
>>> Name: opensuse-tumbleweed-gcc
>> While iirc the above continue to be expected, ...
>>
>>> Job #4573553188 ( https://gitlab.com/xen-project/xen/-/jobs/4573553188/raw )
>>>
>>> Stage: build
>>> Name: debian-unstable-gcc-debug-arm64-randconfig
>> ... this one has
>>
>> ld    -EL --no-warn-rwx-segments -T arch/arm/xen.lds -N prelink.o \
>>      ./common/symbols-dummy.o -o ./.xen-syms.0
>> ld: Xen is too big
>>
>> in its build log. Whatever the .config, I'm inclined to say this should
>> not happen.
This was a latent bug because building Xen with GCOV will result to a 
binary bigger than 2MB (the max size we currently support)

The ASSERT() makes it more obvious. I am not sure why we never gated 
GCOV with !ARM as I don't see how this could have booted. Anyway...

> 
> That is
> https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=02a11313cdc60d266d8613899fcc9d3870ef5164
> and is intermittent when randconfig chooses COVERAGE
> 
> "[v2 0/4] xen/arm: Enable USBAN support" on list should fix it.

... I have now committed the series. So randconfig should not fail anymore.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 19:04:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 19:04:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558636.872923 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGlKC-0005Cg-CM; Tue, 04 Jul 2023 19:04:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558636.872923; Tue, 04 Jul 2023 19:04:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGlKC-0005CZ-9j; Tue, 04 Jul 2023 19:04:32 +0000
Received: by outflank-mailman (input) for mailman id 558636;
 Tue, 04 Jul 2023 19:04:30 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGlKA-0005CT-IF
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 19:04:30 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGlK9-0008OX-Qc; Tue, 04 Jul 2023 19:04:29 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGlK9-000155-KN; Tue, 04 Jul 2023 19:04:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=fR3r3e2PTnjvvVPDCXK9R1xFYDK4+kL1uXPL+guGajI=; b=fB4tjsyUgWw7bA08D/WZyAPZxE
	L/Cs17v3vqf6n7mn7bgB8MJa7MvnSsv+iVOStvNjRXGYe9nuuYc6lkVHjfHGR4RIERJCRtYLegEid
	bcQFRZWXFdnzGm4O3+vvKFgrjvPcxOg9vVTX6wel/i690i1eDGG7MeyQUuohjZGUP/48=;
Message-ID: <31aafa59-45a5-59df-c5ff-e429d91851d2@xen.org>
Date: Tue, 4 Jul 2023 20:04:27 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH 4/7] xen/arm: page: Consolidate write_pte() and clarify
 the documentation
Content-Language: en-US
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Luca Fancellu <Luca.Fancellu@arm.com>, Michal Orzel <michal.orzel@amd.com>,
 Henry Wang <Henry.Wang@arm.com>, Julien Grall <jgrall@amazon.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230619170115.81398-1-julien@xen.org>
 <20230619170115.81398-5-julien@xen.org>
 <49DB9A64-FB34-4EAB-9E6D-3C445B1790E4@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <49DB9A64-FB34-4EAB-9E6D-3C445B1790E4@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Bertrand,

On 04/07/2023 16:06, Bertrand Marquis wrote:
>> On 19 Jun 2023, at 19:01, Julien Grall <julien@xen.org> wrote:
>>
>> From: Julien Grall <jgrall@amazon.com>
>>
>> The implementation of write_pte() is pretty much the same on arm32
>> and arm64. So it would be good to consolidate it as this would help
>> to clarify the requirements when using the helper.
>>
>> Take the opportunity to switch from assembly to call macros. Note there
>> is a difference on arm32 because the option was not specified. But this
>> meant 'sy' (system wide).
>>
>> Futhermore, the requirements for the ISB is incomplete. Per the Arm Arm,
>> (Armv7 DDI406C.d A3.8.3 and Armv8 DDI 0487J.a B2.3.12), DSB will only
>> affect explicit accesses. So an ISB is necessary after DSB to ensure
>> the completion. Having an ISB after each update to the page-tables is
>> probably too much, so let the caller add the instruction when it is
>> convenient.
>>
>> Lastly, the barrier in write_pte() may be too restrictive but I haven't
>> yet find the proper section(s) in the Arm Arm.
> 
> I do not think we will find any proper section for that in the Arm Arm as it
> depends on use cases.
> In ours we might have the page table shared among cores so I think system
> is the way to go.

For SMP systems, like Linux, Xen is assuming that all the cores are in 
the same inner-shareable domain. So 'ish' would be sufficient based on 
just that.

However, I haven't made the change because I am not sure about the 
interaction when the modified entry modified to device memory and we 
have an access after/before.

> 
>>
>> Signed-off-by: Julien Grall <jgrall@amazon.com>
> 
> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Thanks!

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 19:08:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 19:08:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558640.872933 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGlOQ-0005o7-RU; Tue, 04 Jul 2023 19:08:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558640.872933; Tue, 04 Jul 2023 19:08:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGlOQ-0005o0-Om; Tue, 04 Jul 2023 19:08:54 +0000
Received: by outflank-mailman (input) for mailman id 558640;
 Tue, 04 Jul 2023 19:08:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGlOO-0005nt-UA
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 19:08:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGlOO-0008TC-J7; Tue, 04 Jul 2023 19:08:52 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGlOO-0001J8-Cd; Tue, 04 Jul 2023 19:08:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=NTvo+K6TduOWV9YLgixUkb08O76KTZtshY5sqLOTJmE=; b=WxOnRYNJO+YpJNW01wSTSaVTqk
	Fyk/K6sL15UFYTDpcrf10sRTX4WWDMaYtr1D0Q0tWeYsyCr7s/snHFSxEsKBj0er5Go3sf3Kwq9xY
	GXMjDlJhZA/WDP1KvZd5TWPqqGoQI/o+0qYt5Drdt+s2yzQjHdrf/4higclALXyDmkBI=;
Message-ID: <979f0580-1217-deb4-f2ba-0d7e3b015a25@xen.org>
Date: Tue, 4 Jul 2023 20:08:50 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH 0/7] xen/arm: Add some missing ISBs after updating the
 PTEs
Content-Language: en-US
To: xen-devel@lists.xenproject.org
Cc: Luca.Fancellu@arm.com, michal.orzel@amd.com, Henry.Wang@arm.com,
 Julien Grall <jgrall@amazon.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230619170115.81398-1-julien@xen.org>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230619170115.81398-1-julien@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 19/06/2023 18:01, Julien Grall wrote:
> From: Julien Grall <jgrall@amazon.com>
> 
> Hi all,
> 
> The main goal of this series is to add some missing ISBs after update
> the PTEs.
> 
> The last patch is re-ingesting a patch that was reverted
> due to a boot failure on the Arndale. This has now been fixed by patch
> #2.
> 
> Cheers,
> 
> Julien Grall (7):
>    xen/arm32: head: Add missing isb in setup_fixmap()
>    xen/arm32: head: Add mising isb in switch_to_runtime_mapping()
>    xen/arm64: head: Add missing isb in setup_fixmap()
>    xen/arm: page: Consolidate write_pte() and clarify the documentation
>    xen/arm: pmap: Add missing ISB in arch_pmap_map()
>    xen/arm: mm: Add missing ISB in xen_pt_update()

I have committed the first 6 patches.

>    xen/arm32: head: Widen the use of the temporary mapping

This patch has non trivial clash with the USBAN series which has been 
recently committed. So I will send a new version.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 19:12:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 19:12:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558644.872943 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGlRK-0007ET-8Z; Tue, 04 Jul 2023 19:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558644.872943; Tue, 04 Jul 2023 19:11:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGlRK-0007EM-5f; Tue, 04 Jul 2023 19:11:54 +0000
Received: by outflank-mailman (input) for mailman id 558644;
 Tue, 04 Jul 2023 19:11:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGlRI-0007EE-RF
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 19:11:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGlRI-0000Fu-8Y; Tue, 04 Jul 2023 19:11:52 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGlRI-0001Zf-15; Tue, 04 Jul 2023 19:11:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=d6N1UGkbglsq2JKcU1Nnq10Dfh0i87isXX7HujVXOMQ=; b=zL10TnoltrieqCn8slPBLAvisT
	L3+AvSFPVNSUjKVweXwqU1snt8qRHcDMWMlnWqQIYwGyJ8LSP6ODNKU4QBeuVGCFVgvPNsqSIayzD
	THRLhpj3s4ZHDRUjpShoMNz2jwzURQzarYnL5P+EZXldq3otQbOYiI4SMtL6NCJ5YRr0=;
Message-ID: <a2df163a-ac61-e53b-25dd-fcd33703adf2@xen.org>
Date: Tue, 4 Jul 2023 20:11:49 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH 1/2] tools: Fix ifdef for aarch64 that should include also
 arm
Content-Language: en-US
To: Luca Fancellu <luca.fancellu@arm.com>
Cc: xen-devel@lists.xenproject.org, bertrand.marquis@arm.com,
 wei.chen@arm.com, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230608135913.560413-1-luca.fancellu@arm.com>
 <66c3d183-460d-4f34-a331-01ac4d65fc9d@perard>
From: Julien Grall <julien@xen.org>
In-Reply-To: <66c3d183-460d-4f34-a331-01ac4d65fc9d@perard>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

Replying here because there is no cover letter (in the future please add 
one if you have more than two patches bundled together).

On 04/07/2023 10:42, Anthony PERARD wrote:
> On Thu, Jun 08, 2023 at 02:59:12PM +0100, Luca Fancellu wrote:
>> Commit 56a7aaa16bfe introduced some SVE related code that is protected by
>> '#if defined(__aarch64__)', the issue is that this doesn't take into
>> consideration when the toolstack is compiled for an arm32 Dom0 running on
>> an arm64 platform, it should be able to create SVE enabled guests but with
>> the current code it's not.
>>
>> So fix the issue by compiling the code when the toolstack is compiled for
>> both arm32 and arm64.
>>
>> Fixes: 56a7aaa16bfe ("tools: add physinfo arch_capabilities handling for Arm")
>> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
>> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Acked-by: Anthony PERARD <anthony.perard@citrix.com>

I have now committed the series.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 19:14:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 19:14:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558648.872954 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGlTL-0007n2-KF; Tue, 04 Jul 2023 19:13:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558648.872954; Tue, 04 Jul 2023 19:13:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGlTL-0007mv-Gw; Tue, 04 Jul 2023 19:13:59 +0000
Received: by outflank-mailman (input) for mailman id 558648;
 Tue, 04 Jul 2023 19:13:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGlTK-0007mn-QE
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 19:13:58 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGlTK-0000I5-H8; Tue, 04 Jul 2023 19:13:58 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGlTK-0001cz-BK; Tue, 04 Jul 2023 19:13:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=Xs1smoJMXuCWOquXZvNmoX+dE513cj31vy6ax5mM30Y=; b=uipi49CC6h2LZaF8Oi329z9Qjc
	HvSArffSWP/iDoKY7tOt+9roxomOq3X6D5vC75On/FPGgp7bW9pSPdxs9f+MrGUtLleNstY4vDpqa
	RC9Gc8eOpBlcvwbg6KT4hu378SOXcSoWNw9e9VnuGZi/UoGtySWA/m3UVZThEq30glIo=;
Message-ID: <54ab8fa3-423c-0947-8b52-480db28afbf6@xen.org>
Date: Tue, 4 Jul 2023 20:13:56 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH] xen/arm: vgic: Add missing 'U' in VGIC_ICFG_MASK for
 shifted constant
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>,
 Henry Wang <Henry.Wang@arm.com>
Cc: xen-devel@lists.xenproject.org,
 Bertrand Marquis <bertrand.marquis@arm.com>, Wei Chen <wei.chen@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230629221800.1478182-1-Henry.Wang@arm.com>
 <alpine.DEB.2.22.394.2306291603010.3936094@ubuntu-linux-20-04-desktop>
From: Julien Grall <julien@xen.org>
In-Reply-To: <alpine.DEB.2.22.394.2306291603010.3936094@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 30/06/2023 00:03, Stefano Stabellini wrote:
> On Fri, 30 Jun 2023, Henry Wang wrote:
>> With UBSAN on some arm64 platforms, e.g. FVP_Base_RevC-2xAEMvA, the
>> following splat will be printed while Dom0 is booting:
>> ```
>> (XEN) ==================================================================
>> (XEN) UBSAN: Undefined behaviour in arch/arm/vgic.c:372:15
>> (XEN) left shift of 1 by 31 places cannot be represented in type 'int'
>> (XEN) Xen WARN at common/ubsan/ubsan.c:172
>> (XEN) ----[ Xen-4.18-unstable  arm64  debug=y ubsan=y  Not tainted ]----
>> ```
>>
>> This is because there is a device node in the device tree with 0xf
>> as the interrupts property. Example of the device tree node is shown
>> below:
>> ```
>> ethernet@202000000 {
>>      compatible = "smsc,lan91c111";
>>      reg = <0x2 0x2000000 0x10000>;
>>      interrupts = <0xf>;
>> };
>> ```
>> and this value is passed to vgic_get_virq_type() as "index" then "intr"
>> in VGIC_ICFG_MASK.
>>
>> Add the missing 'U' in VGIC_ICFG_MASK as a fix, and this should also
>> addressing MISRA Rule 7.2:
>>
>>      A "u" or "U" suffix shall be applied to all integer constants that
>>      are represented in an unsigned type
>>
>> Signed-off-by: Henry Wang <Henry.Wang@arm.com>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

It is now committed.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 19:19:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 19:19:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558654.872964 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGlYc-0008Tc-Cs; Tue, 04 Jul 2023 19:19:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558654.872964; Tue, 04 Jul 2023 19:19:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGlYc-0008TV-8j; Tue, 04 Jul 2023 19:19:26 +0000
Received: by outflank-mailman (input) for mailman id 558654;
 Tue, 04 Jul 2023 19:19:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGlYa-0008Sq-Kv
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 19:19:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGlYa-0000PC-6B; Tue, 04 Jul 2023 19:19:24 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGlYa-0001m6-0A; Tue, 04 Jul 2023 19:19:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=7jSWc4ZZYfjWuk9/U/nRgL1HdDZiQGrnnIrLB5b0sOc=; b=0YhF8qAqxjdRIWyrgtQdd8Q1rk
	JfA4B/3L/MVe8l1GcoM1p6ESU9l1cJoxtICJsu4NdsFLvXGDam6ESJTwRbrn0r3lc2DlT2sj7uetA
	qztuEBXlXyvMyLymm2gW85R/CyHbX6lB8xV0TVppqiFNxjxhE5M5L07R0oaTlSNk0+x8=;
Message-ID: <d859a529-b79c-8c33-960d-6e7bd4910d9b@xen.org>
Date: Tue, 4 Jul 2023 20:19:21 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 00/52] xen/arm: Add Armv8-R64 MPU support to Xen -
 Part#1
Content-Language: en-US
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Paul Durrant <paul@xen.org>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230626033443.2943270-1-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Penny,

On 26/06/2023 04:33, Penny Zheng wrote:
> Wei Chen (11):
>    xen/arm: remove xen_phys_start and xenheap_phys_end from config.h
>    xen/arm: make ARM_EFI selectable for Arm64

I have committed these two patches.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 19:21:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 19:21:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558658.872974 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGlaN-0001ST-MR; Tue, 04 Jul 2023 19:21:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558658.872974; Tue, 04 Jul 2023 19:21:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGlaN-0001SM-JV; Tue, 04 Jul 2023 19:21:15 +0000
Received: by outflank-mailman (input) for mailman id 558658;
 Tue, 04 Jul 2023 19:21:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGlaL-0001Ru-Pt
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 19:21:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGlaL-0000SI-Fy; Tue, 04 Jul 2023 19:21:13 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGlaL-0001qE-Ae; Tue, 04 Jul 2023 19:21:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=L9veqfFAmUqbsDl205lEzBz5WjO7NtwY/8BBgMnGd/c=; b=oLPJyp+BPBuFjBt6/LRl56/LPM
	7tttB4GP6KAEB5kpZaO89a08pn/f492evKoKAOvOXt6tx30Y84KhNT6GnDn91nMZa1Noju9IOwBKu
	3gX5vML2Nhvik6UhsN2nfrjeBv+e6YeoPes/WJYi6rGAwN6Vt3miVDJdskHWt5rQ/8vQ=;
Message-ID: <af5c0bf1-40eb-5b76-17b2-b63205cec182@xen.org>
Date: Tue, 4 Jul 2023 20:21:11 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 03/52] xen/arm: add an option to define Xen start
 address for Armv8-R
Content-Language: en-US
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-4-Penny.Zheng@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230626033443.2943270-4-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 26/06/2023 04:33, Penny Zheng wrote:
> From: Wei Chen <wei.chen@arm.com>
> 
> On Armv8-A, Xen has a fixed virtual start address (link address
> too) for all Armv8-A platforms. In an MMU based system, Xen can
> map its loaded address to this virtual start address. So, on
> Armv8-A platforms, the Xen start address does not need to be
> configurable. But on Armv8-R platforms, there is no MMU to map
> loaded address to a fixed virtual address and different platforms
> will have very different address space layout. So Xen cannot use
> a fixed physical address on MPU based system and need to have it
> configurable.
> 
> In this patch we introduce one Kconfig option for users to define
> the default Xen start address for Armv8-R. Users can enter the
> address in config time, or select the tailored platform config
> file from arch/arm/configs.
> 
> And as we introduced Armv8-R to Xen, that means the existed Arm64
> MMU based platforms should not be listed in Armv8-R platform
> list, so we add !HAS_MPU dependency for these platforms.

 From a brief look, this patch doesn't seem to be necessary in order to 
move the MMU code in separate files. Can you confirm?

If so can this be moved latter in the series? This is to allow the 
reviewers to focus on the MMU split as we discussed on the call today.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 19:24:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 19:24:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558662.872984 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGldZ-00023c-5e; Tue, 04 Jul 2023 19:24:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558662.872984; Tue, 04 Jul 2023 19:24:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGldZ-00023V-2K; Tue, 04 Jul 2023 19:24:33 +0000
Received: by outflank-mailman (input) for mailman id 558662;
 Tue, 04 Jul 2023 19:24:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGldY-00023P-Go
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 19:24:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGldY-0000V6-5G; Tue, 04 Jul 2023 19:24:32 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGldX-00021H-Vw; Tue, 04 Jul 2023 19:24:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=E/peYUKdas0QqKLojm8QuYbMx7tolvhytNAjJWqSpMw=; b=HvvODMdez5+8K1bZ/SD54rfd6C
	5lZYm/26EX6j1knDx3cqCyvYz2jLM6LQkXHral/zZINGdyPEwJQZNZ/u9Jc+Y88mXVTZ8tipmenz1
	4KEDpYslu2AQesYElg9gT46cS0e2gb1odnYT0RBwJhrA4mQxwrf9XiRB2UR58mNRt/ks=;
Message-ID: <95f41dfc-893b-d8b8-9038-14683749672a@xen.org>
Date: Tue, 4 Jul 2023 20:24:30 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 04/52] xen/arm: add .text.idmap in ld script for Xen
 identity map sections
Content-Language: en-US
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-5-Penny.Zheng@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230626033443.2943270-5-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Penny,

On 26/06/2023 04:33, Penny Zheng wrote:
> From: Wei Chen <wei.chen@arm.com>
> 
> Only the first 4KB of Xen image will be mapped as identity
> (PA == VA). At the moment, Xen guarantees this by having
> everything that needs to be used in the identity mapping
> in .text.header section of head.S, and the size will be
> checked by _idmap_start and _idmap_end at link time if this
> fits in 4KB.
> 
> In a later patch, we will move the MMU specific code out
> of head.S. Although we can add .text.header to the new file
> to guarantee all identity map code still in the first 4KB.
> However, the order of these two files on this 4KB depends
> on the build tools. Currently, we use the build tools to
> process the order of objs in the Makefile to ensure that
> head.S must be at the top. But if you change to another
> build tools, it might not be the same result.
> 
> In this patch we introduce a new section named .text.idmap
> in the region between _idmap_start and _idmap_end. And in
> Xen link script, we force the .text.idmap contents to linked
> after .text.header. This will ensure code of head.S always be
> at the top of Xen binary.
> 
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>

Now that this patch is only a single line change, I would fold it in the 
patch introducing the first user (i.e. patch #7).

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 19:25:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 19:25:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558665.872994 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGleE-0002Ze-DH; Tue, 04 Jul 2023 19:25:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558665.872994; Tue, 04 Jul 2023 19:25:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGleE-0002ZO-AM; Tue, 04 Jul 2023 19:25:14 +0000
Received: by outflank-mailman (input) for mailman id 558665;
 Tue, 04 Jul 2023 19:25:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGleD-0002ZI-P6
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 19:25:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGleD-0000Vd-BD; Tue, 04 Jul 2023 19:25:13 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGleD-00022W-5k; Tue, 04 Jul 2023 19:25:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=ExZBwSF/hEg//G9LvJbhNJn/z7huKgumMcmLZn3V4VI=; b=xE/lbv9YWcDymoMFvW6HzEuMbK
	hiGdzU0vrpENFuaXR1AGIktHI8D0qHevZXfNoa9VfuEDGnwwXUIvrWcTXi8TVFCGZ+341a2jMtRrM
	LTblYOa4ET0bK69jcsi16LCiPvYDQT3F9uQNT2s2tAESDZ27evJiepYfTZ6MyarCgbuY=;
Message-ID: <14ea91dc-2af1-f7c7-5888-22df8fd9133d@xen.org>
Date: Tue, 4 Jul 2023 20:25:11 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 09/52] xen/arm: use PA == VA for
 EARLY_UART_VIRTUAL_ADDRESS on MPU systems
Content-Language: en-US
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-10-Penny.Zheng@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230626033443.2943270-10-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Penny,

On 26/06/2023 04:34, Penny Zheng wrote:
> From: Wei Chen <wei.chen@arm.com>
> 
> There is no VMSA support on MPU systems, so we can not map early
> UART to FIXMAP_CONSOLE. In stead, we can use PA == VA for early
> UART on MPU systems.
> 
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>

Is this change necessary for the MMU split? If not, I will skip the 
review for now.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 20:31:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 20:31:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558672.873003 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGmfq-0001Z2-8a; Tue, 04 Jul 2023 20:30:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558672.873003; Tue, 04 Jul 2023 20:30:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGmfq-0001Yv-65; Tue, 04 Jul 2023 20:30:58 +0000
Received: by outflank-mailman (input) for mailman id 558672;
 Tue, 04 Jul 2023 20:30:57 +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
 <SRS0=+Q6u=CW=gmail.com=olekstysh@srs-se1.protection.inumbo.net>)
 id 1qGmfo-0001Yp-Va
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 20:30:57 +0000
Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com
 [2a00:1450:4864:20::22f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ac747a1b-1aa9-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 22:30:54 +0200 (CEST)
Received: by mail-lj1-x22f.google.com with SMTP id
 38308e7fff4ca-2b6f943383eso16814021fa.2
 for <xen-devel@lists.xenproject.org>; Tue, 04 Jul 2023 13:30:54 -0700 (PDT)
Received: from EPUAKYIW03DD.. ([91.123.150.167])
 by smtp.gmail.com with ESMTPSA id
 j6-20020a2e8006000000b002b6e6a4ca47sm1741565ljg.23.2023.07.04.13.30.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 04 Jul 2023 13:30:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ac747a1b-1aa9-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688502653; x=1691094653;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=bYV7DvvyA5ZV4OhZDB1OuNJt7P4bch4onznstHQiPBs=;
        b=RAeoUIKPBJR87c6ZADQRKj7yPKFTWqKXK1b5qN1/8btP0uIciqsNnEV+BiI9KN2Dpt
         LZuKf+gqS7UIXuieCWw0PoXV9BjCFhCM6zVNK6qR15wKD5I638DQirAfpIpm9ohzj5Fv
         +GBo+yDudx1G2S63pUmgF7M603gt0jBmMWJBV8S1lP+BU/pMiRIa2aEHTyhp3Isw4UnA
         EmdA7LvGYPis1EjO+tLWKPj2PfCzbzow+bFJzu3BvyXTsroKLenxudOVTxYxyUCSWpXZ
         dveyPblqJ5V6U+E6iH5sVt1vxlUamu/KW8HoTeO7sq/ei7w3YSVgRbJO7JvR+qOxRor4
         nSTg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688502653; x=1691094653;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=bYV7DvvyA5ZV4OhZDB1OuNJt7P4bch4onznstHQiPBs=;
        b=ZMsTeBtvb56RhpjQw2ld7UCMauBVIiCAHAJqKjLvFDPBqhvCjZ5ws/TjGlFOigScBq
         8FUoK5A4oue3dQKthb40TMcTtowJbwXXLbPvxzRoF8gH/C00xRahdcNTQ0WNh9NeimIz
         2EGXT8MuceSXOLWqW7BSPCQ5j8CTs/GakXvmT8ITy+oO02UGTgtfTj6ksQ5X2rSR3c1w
         2QUfKcpEgKQ+NdeQRxpanAdON1TazpP7vnL8xbBLX174RS78tMBw0QpL3Kj100mpJ/il
         RzouwbFvjXQVwYQQLM1AbRT+d9HA3Fj9tfw8FTcyEJ2k9ydyMobg1CcRTAO4YH1SdTB9
         SILQ==
X-Gm-Message-State: ABy/qLZDgqTXF70BISfV2vr1F0szuQRfgRM2jRhb5X2q2RWlrJYNSBmo
	OI9/LW1CZo9pW2Yd7osOyPNJgtlRtp4=
X-Google-Smtp-Source: APBJJlGuhffoG3hL5abDfraRbWuzg++ENDDJQd9NKG66xTdhvVmErmmBskU9ozzlRY/ttd5r6uXxww==
X-Received: by 2002:a2e:870c:0:b0:2b1:bb66:7b69 with SMTP id m12-20020a2e870c000000b002b1bb667b69mr10225691lji.32.1688502652847;
        Tue, 04 Jul 2023 13:30:52 -0700 (PDT)
From: Oleksandr Tyshchenko <olekstysh@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH] iommu/ipmmu-vmsa: Add missing 'U' in IMTTLBR0_TTBR_MASK for shifted constant
Date: Tue,  4 Jul 2023 23:30:32 +0300
Message-Id: <20230704203032.4062921-1-olekstysh@gmail.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

With enabling both CONFIG_UBSAN and CONFIG_IPMMU_VMSA I have got the following
splat when an IOMMU driver tried to setup page tables:

(XEN) ipmmu: /soc/iommu@e67b0000: d1: Set IPMMU context 1 (pgd 0x77fe90000)
(XEN) ================================================================================
(XEN) UBSAN: Undefined behaviour in drivers/passthrough/arm/ipmmu-vmsa.c:558:51
(XEN) left shift of 1048575 by 12 places cannot be represented in type 'int'
(XEN) Xen WARN at common/ubsan/ubsan.c:172
(XEN) ---[ Xen-4.18-unstable  arm64  debug=y ubsan=y  Tainted:      S ]----
...

This points to shifted constant in IMTTLBR0_TTBR_MASK. Fix that by adding
missing 'U' to it.

This should also address MISRA Rule 7.2:

A "u" or "U" suffix shall be applied to all integer constants that
are represented in an unsigned type.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
---
 xen/drivers/passthrough/arm/ipmmu-vmsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/arm/ipmmu-vmsa.c b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
index 24b9e09a6b..0ccfa53255 100644
--- a/xen/drivers/passthrough/arm/ipmmu-vmsa.c
+++ b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
@@ -201,7 +201,7 @@ static DEFINE_SPINLOCK(ipmmu_devices_lock);
 #define IMTTBCR_TSZ0_SHIFT             0
 
 #define IMTTLBR0              0x0010
-#define IMTTLBR0_TTBR_MASK    (0xfffff << 12)
+#define IMTTLBR0_TTBR_MASK    (0xfffffU << 12)
 #define IMTTUBR0              0x0014
 #define IMTTUBR0_TTBR_MASK    (0xff << 0)
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 04 21:03:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 21:03:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558676.873014 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGnBN-00054B-PS; Tue, 04 Jul 2023 21:03:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558676.873014; Tue, 04 Jul 2023 21:03:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGnBN-000544-Lp; Tue, 04 Jul 2023 21:03:33 +0000
Received: by outflank-mailman (input) for mailman id 558676;
 Tue, 04 Jul 2023 21:03:31 +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
 <SRS0=PjRJ=CW=epam.com=prvs=1549bc4864=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qGnBL-00053y-F5
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 21:03:31 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 387fa172-1aae-11ee-8611-37d641c3527e;
 Tue, 04 Jul 2023 23:03:28 +0200 (CEST)
Received: from pps.filterd (m0174679.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 364EUTf0021326; Tue, 4 Jul 2023 21:03:18 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2051.outbound.protection.outlook.com [104.47.13.51])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rmn8g8w8u-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Tue, 04 Jul 2023 21:03:17 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by DB5PR03MB10049.eurprd03.prod.outlook.com (2603:10a6:10:4a0::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul
 2023 21:03:12 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::10c0:3ca8:e226:2335]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::10c0:3ca8:e226:2335%4]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023
 21:03:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 387fa172-1aae-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=bikOchGA1QKIIn4x0y+0Wub69MgW+r5DaeYgxpKXiPCNB3OXlEoR6I9BKOeAZ4J2KQQlAzbOB1GcFtqrMPPYohDXP4rPIfFHE7XQk63N6AjPbD0N3yFhoBTlJ5x+7eJR1/J0wnf6c8JU7cI7ER4+sSKP1EbnQ9OD9PI+D6DxZAVhDliN1AKhogipkZBaTZGVW+BS4FIoeIUkHTFV/7VclUAWdeyDVD43JMAYbNcnFOPJ0+jbuzBjIMmolfnuLI8nF1u9+a8Uf0L4dbvgM3siKM/VN/YnyyB0hEvNo/2eZOqiZdk3iVWq1vHmGNMzc/rn4+aBvPtn3thrEizJ24tWXg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=eQeeKVZOAR2mJnhk9tyfmSJy/ANeuIFJU7xRGovYa/Y=;
 b=Oaludud6SW24bK3SBgzL6nHAfLddyRRRC8xIsunarnvMAfTlmCjxyg/BzCfu/asPOuUJe+tuJQhfXXjbeIkm6l15XScym3J95l3whHstixywXBNElQvHP0crsIZWDx3WtRQ8p6jYaCXoUdRWh1gbYYV5kTbtq9HQnc90jRz6MYDC8ViYYjew6KJ2rob/vzikr49DN/rB9FE8/9/JpNl7BzDV1Kbw1Oo7ZH9F438xCa0Ez4Mn/zWCn8q9Mf/AIuwO2MfyBtMPtpxgU+GWR9ldlLfkVIKXb2wB5a9rYEKG5nAcTzHoDOrr0ko1i5e7DMAJTx/FH8WcD9WtUuLzeHX0Fg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=eQeeKVZOAR2mJnhk9tyfmSJy/ANeuIFJU7xRGovYa/Y=;
 b=Gkp1PRzOMeL6dMqDiFdlt+DTFikK00mhCsv0VwxKzSRjKGUj0ibPhKAZvwlGuODpLAFG+zocyr0X2p3ARSxJYRLJ6XQ0DKq/UjoIr0B+7tUtKRU5arnL6vZ+ackPSB4gpdnbxOkuhqEv85Qt2irad0VIVN5kVr9Vwv/uKOGwOOm23vPr1Zsj1GeIiuFkUClvQzp1emcsnX3HSmmXWG32leBrGbbJrADHvltQDSCdkB+LRlcJK8ycF/peLjadAy247TfiCzhkGkLle/2gakH1cTWJ4az01h5IhDSkCctfZOcnJSF5mi00lhtEB08O/KtZT7zaHQY2Pvw68ca9NdyNsw==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
        Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
        Jan Beulich
	<jbeulich@suse.com>,
        Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu
	<wl@xen.org>,
        George Dunlap <george.dunlap@citrix.com>,
        Julien Grall
	<julien@xen.org>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Paul Durrant
	<paul@xen.org>
Subject: Re: [PATCH v7 01/12] vpci: introduce per-domain lock to protect vpci
 structure
Thread-Topic: [PATCH v7 01/12] vpci: introduce per-domain lock to protect vpci
 structure
Thread-Index: 
 AQHZneJZdDE+HOoSO0y6VB9l0x1hDq+No9OAgAgqUACAALl2AIAAzUWAgADPAYCAEhJlgA==
Date: Tue, 4 Jul 2023 21:03:12 +0000
Message-ID: <87wmzfmltd.fsf@epam.com>
References: <20230613103159.524763-1-volodymyr_babchuk@epam.com>
 <20230613103159.524763-2-volodymyr_babchuk@epam.com>
 <ZIyOCan//39V3bdy@MacBook-Air-de-Roger.local> <87352kpj04.fsf@epam.com>
 <ZJQDGOrP1I3hR5Jj@MacBook-Air-de-Roger.local> <87ilbfnqmo.fsf@epam.com>
 <ZJVc77SwvyKOEdnJ@MacBook-Air-de-Roger.local>
In-Reply-To: <ZJVc77SwvyKOEdnJ@MacBook-Air-de-Roger.local>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: mu4e 1.8.9; emacs 28.2
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|DB5PR03MB10049:EE_
x-ms-office365-filtering-correlation-id: b27b6351-aec6-4993-6adf-08db7cd213f7
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 fZfLqhMkhXWf+LLaGkhhL2nL3zo+qLDeImhJUl6MU58UOTZRWfyizpzuBDZlp5bi4zzMijKf/ebR4XarZuJmKYchFVKGdL1CixMhw2MWHNnQeu5apq6Nw9ZChKKO3A+391EliEVmLWZGikE+0p2A5tGuUCYyDvyKHDBpORLW89oCgawqCFtkpEcLH1oBbwTATjfRzBY9yaYSaah+7c4ibqiySt6ZCTZX7QnSkb9nBMdhbPplsJ4Sje9CocQ0LxNLswI9XS8u5qAkO3Mg3uO+CgPgZBmBNNuHJqriwY5lKbMupRB98ZXsOC80hEPUepzGX0bJznS0MNPH0pTwvu9vdFwcpGRzyIgnGvE/sZaJvzjeO+HsJu6hPX6kTinWLr/jx3O+n9brcAd0DCId/xEz2grFFeQKOs4AKg0GoKZo9KiZuOMh5romJoCNdtmubX4aefPKxdvvkMn8dlY8FvT/uBf5lHajg6cRm03YVERB7KzsS/T5GhH7y0yQXb2AuRHE3hd9C9dkcW0M/z4C95+5kYywsiKeTOnaVkH3xeZvqbpKSalJ0WnulagPWZrC0l7pqWG0m54goptg66E9EDOj7YiMO8tAK4l2b9//eL8eZbY=
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(346002)(39860400002)(136003)(366004)(451199021)(54906003)(2906002)(478600001)(26005)(41300700001)(86362001)(966005)(6486002)(8936002)(8676002)(71200400001)(5660300002)(36756003)(38100700002)(316002)(66446008)(66946007)(66476007)(64756008)(4326008)(6916009)(122000001)(66556008)(38070700005)(6512007)(6506007)(91956017)(55236004)(76116006)(2616005)(186003)(83380400001)(66899021);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?dHhvbGRhYWNGdTc1ZzRwYm9YejZ3MmFxd0Y5WUNtZnVxbnlSZVlEdmhDdXNX?=
 =?utf-8?B?REVhTUdEQ0lLV1Z3ZzU1cU9rZUlKUTZtNkFsUTJkQWoxRWIxUzRFMldSM3hZ?=
 =?utf-8?B?d0xiald3aWMwcEU3TTJCMXdtTXFQQXNiSDlaWlo1M3c1TmFLdUlFL0NwM3hl?=
 =?utf-8?B?Y3dpbytObFRyNFQ4Ni8xS2Z1eU9Zdkh2L1A5TkZWN2JDNlV2eXhhOHJLSkJU?=
 =?utf-8?B?czI2ZXkrZnFHZklBTXZOOE5GdjJVQ0U0RVhhTVF5SEx5VjZ5YUhzcnNOMWly?=
 =?utf-8?B?d0pLT3lGL0NlZ3RocmJPMzZKR2Uwa2RmOUoyeGx6N01WMFl4NzB2eW1Jb3BR?=
 =?utf-8?B?QVRrWTNIVTBBeU9PZmNDemZLVnM3d1o4OVZ6OExwZkU4RitRdktiOEpnaUFi?=
 =?utf-8?B?enVCTnlXTVk0WTlIRTBkUHlwaG8xSDhkdXMyR2JCYlJHU3VsSllaNG1venJm?=
 =?utf-8?B?eWJ0aFllMnRCOU11cUtZanB3Z2x2cTdmUX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
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b27b6351-aec6-4993-6adf-08db7cd213f7
X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2023 21:03:12.2716
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: CqpVaw0KYWv0qKwa0TMj5j1v+JeJppPGgXu6D+wZybA3YfmmgjUH3CjiMihR1bp8FG6AIHXBYVW60QDMrbijrfPX7L55X0lrxk0KSiHO3Ls=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR03MB10049
X-Proofpoint-GUID: KcyvXOXqydYIlfBy_wyekcmZlzK2zwFM
X-Proofpoint-ORIG-GUID: KcyvXOXqydYIlfBy_wyekcmZlzK2zwFM
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-04_14,2023-07-04_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 suspectscore=0
 spamscore=0 impostorscore=0 clxscore=1011 adultscore=0 mlxscore=0
 mlxlogscore=950 phishscore=0 lowpriorityscore=0 malwarescore=0
 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2305260000 definitions=main-2307040184

DQpIaSBSb2dlciwNCg0KUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+IHdy
aXRlczoNCg0KPiBPbiBUaHUsIEp1biAyMiwgMjAyMyBhdCAwOToxNzozNlBNICswMDAwL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luICpkKQ0Kew0K
ICAgIHN0cnVjdCBwY2lfZGV2ICpwZGV2Ow0KICAgIHU4IGJ1cywgZGV2Zm47DQogICAgaW50IHJl
dDsNCg0KICAgIHBjaWRldnNfbG9jaygpOw0KICAgIHdyaXRlX2xvY2soJmQtPnBjaV9sb2NrKTsN
CiAgICByZXQgPSBhcmNoX3BjaV9jbGVhbl9waXJxcyhkKTsNCiAgICBpZiAoIHJldCApDQogICAg
ew0KICAgICAgICBwY2lkZXZzX3VubG9jaygpOw0KICAgICAgICB3cml0ZV91bmxvY2soJmQtPnBj
aV9sb2NrKTsNCiAgICAgICAgcmV0dXJuIHJldDsNCiAgICB9DQoNCiAgICB3aGlsZSAoICFsaXN0
X2VtcHR5KCZkLT5wZGV2X2xpc3QpICkNCiAgICB7DQogICAgICAgIHBkZXYgPSBsaXN0X2VudHJ5
KCZkLT5wZGV2X2xpc3QsIHN0cnVjdCBwY2lfZGV2LCBkb21haW5fbGlzdCk7DQogICAgICAgIGJ1
cyA9IHBkZXYtPmJ1czsNCiAgICAgICAgZGV2Zm4gPSBwZGV2LT5kZXZmbjsNCiAgICAgICAgbGlz
dF9kZWwoJnBkZXYtPmRvbWFpbl9saXN0KTsNCiAgICAgICAgd3JpdGVfdW5sb2NrKCZkLT5wY2lf
bG9jayk7DQogICAgICAgIHJldCA9IGRlYXNzaWduX2RldmljZShkLCBwZGV2LT5zZWcsIGJ1cywg
ZGV2Zm4pID86IHJldDsNCiAgICAgICAgd3JpdGVfbG9jaygmZC0+cGNpX2xvY2spOw0KICAgIH0N
CiAgICB3cml0ZV91bmxvY2soJmQtPnBjaV9sb2NrKTsNCiAgICBwY2lkZXZzX3VubG9jaygpOw0K
DQogICAgcmV0dXJuIHJldDsNCn0NCg0KQnV0IGl0IGlzIHVnbHkgc29tZXdoYXQuDQoNCg0KLS0g
DQpXQlIsIFZvbG9keW15cg==


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 21:24:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 21:24:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558712.873041 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGnVZ-0000AB-S3; Tue, 04 Jul 2023 21:24:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558712.873041; Tue, 04 Jul 2023 21:24:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGnVZ-0000A3-P1; Tue, 04 Jul 2023 21:24:25 +0000
Received: by outflank-mailman (input) for mailman id 558712;
 Tue, 04 Jul 2023 21:24:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGnVY-00009v-R8
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 21:24:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGnVY-0003Mi-Ey; Tue, 04 Jul 2023 21:24:24 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGnVY-0006tR-7Q; Tue, 04 Jul 2023 21:24:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=e5ubz8UrYX6OL0apaBXuBGIrfFL4OwQgQZ/vdsrV/wQ=; b=dNlWZdb3DrLFSQuMec22f4gzh4
	A0vFVUOPdF/VB706ZodBDnbSxsYb6HA4kLUxyNFP7yEu7Ymy4VLzGJJhv8CPynaMNJZBIjPFa+YG7
	0kED9p/WVXNHjTeCV8OTBKqFA98GFYuk3btVJR6eOxa+u9R0nhRcQmcjv+kDOVnd7cSY=;
Message-ID: <c10bc254-ad79-dada-d5fb-9ee619934ffb@xen.org>
Date: Tue, 4 Jul 2023 22:24:22 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 05/52] xen/arm64: head: Introduce enable_boot_mmu and
 enable_runtime_mmu
Content-Language: en-US
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-6-Penny.Zheng@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230626033443.2943270-6-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Penny,

On 26/06/2023 04:33, Penny Zheng wrote:
> From: Wei Chen <wei.chen@arm.com>
> 
> At the moment, on MMU system, enable_mmu() will return to an
> address in the 1:1 mapping, then each path is responsible to
> switch to virtual runtime mapping. Then remove_identity_mapping()
> is called to remove all 1:1 mapping.

The identity mapping is only removed for the boot CPU. You mention it 
correctly below but here it lead to think it may be called on the 
secondary CPU. So I would add 'on the boot CPU'.

> 
> Since remove_identity_mapping() is not necessary on Non-MMU system,
> and we also avoid creating empty function for Non-MMU system, trying
> to keep only one codeflow in arm64/head.S, we move path switch and
> remove_identity_mapping() in enable_mmu() on MMU system.
> 
> As the remove_identity_mapping should only be called for the boot
> CPU only, so we introduce enable_boot_mmu for boot CPU and
> enable_runtime_mmu for secondary CPUs in this patch.

NIT: Add () after enable_runtime_mmu to be consistent with the rest of 
commit message. Same for the title.

Also, I would prefer if we name the functions properly from the start. 
So we don't have to rename them when they are moved in patch 7.

> 
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> ---
> v3:
> - new patch
> ---
>   xen/arch/arm/arm64/head.S | 87 +++++++++++++++++++++++++++++++--------
>   1 file changed, 70 insertions(+), 17 deletions(-)
> 
> diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
> index 10a07db428..4dfbe0bc6f 100644
> --- a/xen/arch/arm/arm64/head.S
> +++ b/xen/arch/arm/arm64/head.S
> @@ -314,21 +314,12 @@ real_start_efi:
>   
>           bl    check_cpu_mode
>           bl    cpu_init
> -        bl    create_page_tables
> -        load_paddr x0, boot_pgtable
> -        bl    enable_mmu
>   
>           /* We are still in the 1:1 mapping. Jump to the runtime Virtual Address. */

This comment is not accurate anymore given that the MMU is off.

> -        ldr   x0, =primary_switched
> -        br    x0
> +        ldr   lr, =primary_switched
> +        b     enable_boot_mmu
> +
>   primary_switched:
> -        /*
> -         * The 1:1 map may clash with other parts of the Xen virtual memory
> -         * layout. As it is not used anymore, remove it completely to
> -         * avoid having to worry about replacing existing mapping
> -         * afterwards.
> -         */
> -        bl    remove_identity_mapping
>           bl    setup_fixmap
>   #ifdef CONFIG_EARLY_PRINTK
>           /* Use a virtual address to access the UART. */
> @@ -373,13 +364,11 @@ GLOBAL(init_secondary)
>   #endif
>           bl    check_cpu_mode
>           bl    cpu_init
> -        load_paddr x0, init_ttbr
> -        ldr   x0, [x0]
> -        bl    enable_mmu
>   
>           /* We are still in the 1:1 mapping. Jump to the runtime Virtual Address. */
> -        ldr   x0, =secondary_switched
> -        br    x0
> +        ldr   lr, =secondary_switched
> +        b     enable_runtime_mmu
> +
>   secondary_switched:
>   #ifdef CONFIG_EARLY_PRINTK
>           /* Use a virtual address to access the UART. */
> @@ -694,6 +683,70 @@ enable_mmu:
>           ret
>   ENDPROC(enable_mmu)
>   
> +/*
> + * Turn on the Data Cache and the MMU. The function will return
> + * to the virtual address provided in LR (e.g. the runtime mapping).

The description here is exactly the same as below. However, there is a 
different between the two functions. One is to deal with the secondary 
CPUs whilst the second is for the boot CPUs.

> + *
> + * Inputs:
> + *   lr : Virtual address to return to.
> + *
> + * Clobbers x0 - x5
> + */
> +enable_runtime_mmu:

I find "runtime" confusing in this case. How about 
"enable_secondary_cpu_mm"?

> +        mov   x5, lr
> +
> +        load_paddr x0, init_ttbr
> +        ldr   x0, [x0]
> +
> +        bl    enable_mmu
> +        mov   lr, x5
> +
> +        /* return to secondary_switched */
> +        ret
> +ENDPROC(enable_runtime_mmu)
> +
> +/*
> + * Turn on the Data Cache and the MMU. The function will return
> + * to the virtual address provided in LR (e.g. the runtime mapping).

Similar remark as for the comment above.

> + *
> + * Inputs:
> + *   lr : Virtual address to return to.
> + *
> + * Clobbers x0 - x5
> + */
> +enable_boot_mmu:

Based on my comment above, I would sugesst to call it "enable_boot_cpu_mm"

> +        mov   x5, lr
> +
> +        bl    create_page_tables
> +        load_paddr x0, boot_pgtable
> +
> +        bl    enable_mmu
> +        mov   lr, x5
> +
> +        /*
> +         * The MMU is turned on and we are in the 1:1 mapping. Switch
> +         * to the runtime mapping.
> +         */
> +        ldr   x0, =1f
> +        br    x0
> +1:
> +        /*
> +         * The 1:1 map may clash with other parts of the Xen virtual memory
> +         * layout. As it is not used anymore, remove it completely to
> +         * avoid having to worry about replacing existing mapping
> +         * afterwards. Function will return to primary_switched.
> +         */
> +        b     remove_identity_mapping
> +
> +        /*
> +         * Here might not be reached, as "ret" in remove_identity_mapping
> +         * will use the return address in LR in advance. But keep ret here
> +         * might be more safe if "ret" in remove_identity_mapping is removed
> +         * in future.
> +         */
> +        ret

Given this path is meant to be unreachable, I would prefer if we call 
"fail".

> +ENDPROC(enable_boot_mmu)
> +
>   /*
>    * Remove the 1:1 map from the page-tables. It is not easy to keep track
>    * where the 1:1 map was mapped, so we will look for the top-level entry

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 21:36:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 21:36:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558717.873051 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGngj-0001jW-Tl; Tue, 04 Jul 2023 21:35:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558717.873051; Tue, 04 Jul 2023 21:35:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGngj-0001jP-Pr; Tue, 04 Jul 2023 21:35:57 +0000
Received: by outflank-mailman (input) for mailman id 558717;
 Tue, 04 Jul 2023 21:35:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGngi-0001jJ-1o
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 21:35:56 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGngh-0003Zh-IF; Tue, 04 Jul 2023 21:35:55 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGngh-0007Ig-Cg; Tue, 04 Jul 2023 21:35:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=uDt5mMiKSDYb/kJLlR+rwlP8WxXyzPqg54+rqEDvvBA=; b=XAY1P/9RwMlfoGFUrBF5s6SJLO
	xUa1jWXS71VJzU4/adaWymINXia3hNYx018Witd4YFcX3OXyErOEcnl1/FBa7f2TfyakAim8ksXJm
	c1odxtYlGMJXDmS5iqBfTp6Q7RCHffNiB1hTqMKdA2ZdDH9RiSXhM59gLWgvrnzljMjI=;
Message-ID: <2752bf5a-ae87-8cf9-fe4e-d7c2d7a1a6e5@xen.org>
Date: Tue, 4 Jul 2023 22:35:53 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 07/52] xen/arm64: prepare for moving MMU related code
 from head.S
Content-Language: en-US
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-8-Penny.Zheng@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230626033443.2943270-8-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Penny,

On 26/06/2023 04:33, Penny Zheng wrote:
> From: Wei Chen <wei.chen@arm.com>
> 
> We want to reuse head.S for MPU systems, but there are some
> code are implemented for MMU systems only. We will move such
> code to another MMU specific file. But before that we will
> do some indentations fix in this patch to make them be easier
> for reviewing:
> 1. Fix the indentations of code comments.
> 2. Fix the indentations for .text.header section.
> 3. Rename puts() to asm_puts() for global export
> 
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> ---
> v1 -> v2:
> 1. New patch.
> ---
> v3:
> 1. fix commit message
> 2. Rename puts() to asm_puts() for global export
> ---
>   xen/arch/arm/arm64/head.S | 42 +++++++++++++++++++--------------------
>   1 file changed, 21 insertions(+), 21 deletions(-)
> 
> diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
> index 4dfbe0bc6f..66347eedcc 100644
> --- a/xen/arch/arm/arm64/head.S
> +++ b/xen/arch/arm/arm64/head.S
> @@ -94,7 +94,7 @@
>   #define PRINT(_s)          \
>           mov   x3, lr ;     \
>           adr   x0, 98f ;    \

This was recently changed to adr_l in staging. So you will need to 
rebase this patch.

> -        bl    puts    ;    \
> +        bl    asm_puts ;   \
>           mov   lr, x3 ;     \
>           RODATA_STR(98, _s)
>   
> @@ -136,22 +136,22 @@
>           add \xb, \xb, x20
>   .endm
>   
> -        .section .text.header, "ax", %progbits
> -        /*.aarch64*/
> +.section .text.header, "ax", %progbits
> +/*.aarch64*/
>   
> -        /*
> -         * Kernel startup entry point.
> -         * ---------------------------
> -         *
> -         * The requirements are:
> -         *   MMU = off, D-cache = off, I-cache = on or off,
> -         *   x0 = physical address to the FDT blob.
> -         *
> -         * This must be the very first address in the loaded image.
> -         * It should be linked at XEN_VIRT_START, and loaded at any
> -         * 4K-aligned address.  All of text+data+bss must fit in 2MB,
> -         * or the initial pagetable code below will need adjustment.
> -         */
> +/*
> + * Kernel startup entry point.
> + * ---------------------------
> + *
> + * The requirements are:
> + *   MMU = off, D-cache = off, I-cache = on or off,
> + *   x0 = physical address to the FDT blob.
> + *
> + * This must be the very first address in the loaded image.
> + * It should be linked at XEN_VIRT_START, and loaded at any
> + * 4K-aligned address.  All of text+data+bss must fit in 2MB,
> + * or the initial pagetable code below will need adjustment.
> + */
>   
>   GLOBAL(start)
>           /*
> @@ -520,7 +520,7 @@ ENDPROC(cpu_init)
>    * Macro to create a mapping entry in \tbl to \phys. Only mapping in 3rd
>    * level table (i.e page granularity) is supported.
>    *
> - * ptbl:     table symbol where the entry will be created
> + * ptbl:    table symbol where the entry will be created
>    * virt:    virtual address
>    * phys:    physical address (should be page aligned)
>    * tmp1:    scratch register
> @@ -928,15 +928,15 @@ ENDPROC(init_uart)
>    * x0: Nul-terminated string to print.
>    * x23: Early UART base address
>    * Clobbers x0-x1 */
> -puts:
> +ENTRY(asm_puts)

Can you mention in the comment that this function is only supposed to be 
called from assembly?

While you are at it, can you update the comment coding style to:

/*
  * Foo
  * Bar
  */

>           early_uart_ready x23, 1
>           ldrb  w1, [x0], #1           /* Load next char */
>           cbz   w1, 1f                 /* Exit on nul */
>           early_uart_transmit x23, w1
> -        b     puts
> +        b     asm_puts
>   1:
>           ret
> -ENDPROC(puts)
> +ENDPROC(asm_puts)
>   
>   /*
>    * Print a 64-bit number in hex.
> @@ -966,7 +966,7 @@ hex:    .ascii "0123456789abcdef"
>   
>   ENTRY(early_puts)
>   init_uart:
> -puts:
> +asm_puts:

I find odd that you add ENTRY() to the asm_puts() above but not here. 
However... I can't find any use of asm_puts() outside #ifdef 
CONFIG_EARLY_PRINTK. So maybe it can be dropped?


>   putn:   ret
>   
>   #endif /* !CONFIG_EARLY_PRINTK */

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 21:40:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 21:40:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558721.873060 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGnlS-0003Af-Dx; Tue, 04 Jul 2023 21:40:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558721.873060; Tue, 04 Jul 2023 21:40:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGnlS-0003AY-BO; Tue, 04 Jul 2023 21:40:50 +0000
Received: by outflank-mailman (input) for mailman id 558721;
 Tue, 04 Jul 2023 21:40:49 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGnlQ-0003AO-V0; Tue, 04 Jul 2023 21:40:48 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGnlQ-0003oS-LW; Tue, 04 Jul 2023 21:40:48 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGnlQ-0003ux-5t; Tue, 04 Jul 2023 21:40:48 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qGnlQ-00088p-5N; Tue, 04 Jul 2023 21:40:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Ysn3Cjrw+1NG6RRA+rRjkneOmvZtzx/IjLNC5zgvEt8=; b=JyG5bDKCDsKi2Gq0+SNvaLzuAk
	Xvn91g0b9wMV4uEb7JKaWlTTyDp+UGeSuC1PSaEusTHgmVeS3o2fQ5e1SvXSfquN8oTBGiqCGdEQF
	/Zd4LRxNvO2Q9Usizuv3jaGAIIrmJae1rAZPdCF7Uf2g6CN1i2kPntKlD6Vcmm0eVD1g=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181697-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181697: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=abb1522832bb2ef340a56681d486dce51d2f9971
X-Osstest-Versions-That:
    xen=6e06d229d538ea51b92dc189546c522f5e903511
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 04 Jul 2023 21:40:48 +0000

flight 181697 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181697/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  abb1522832bb2ef340a56681d486dce51d2f9971
baseline version:
 xen                  6e06d229d538ea51b92dc189546c522f5e903511

Last test of basis   181694  2023-07-04 11:03:36 Z    0 days
Testing same since   181697  2023-07-04 19:01:56 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Henry Wang <Henry.Wang@arm.com>
  Julien Grall <jgrall@amazon.com>
  Stefano Stabellini <sstabellini@kernel.org>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   6e06d229d5..abb1522832  abb1522832bb2ef340a56681d486dce51d2f9971 -> smoke


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 21:46:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 21:46:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558727.873071 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGnr3-0003n6-4v; Tue, 04 Jul 2023 21:46:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558727.873071; Tue, 04 Jul 2023 21:46:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGnr3-0003mz-1N; Tue, 04 Jul 2023 21:46:37 +0000
Received: by outflank-mailman (input) for mailman id 558727;
 Tue, 04 Jul 2023 21:46:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGnr1-0003mt-HV
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 21:46:35 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGnr0-0003uY-TO; Tue, 04 Jul 2023 21:46:34 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGnr0-0007mb-M2; Tue, 04 Jul 2023 21:46:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=mgq6h4XSKoOlq0FL4kJcBME6t+7iXrA3rBtUkkKjczA=; b=LPBclirkZn67y/OCBgx5r75FoH
	8fh+gzdEtYjIoDzFi3kVn4MpX1A4Ay5igd/puhuZSnvVoqFvWDzJ1HVFcBipHH70o0cBvkOnwHxV2
	OPShaL82g0E1NBqQkZbRQv+Y3Hdxfq+WQl248Yb3fNQkuc34GctwxcK+9xQqjmgdCsbw=;
Message-ID: <39187006-6220-4b76-ada4-9e5be72b60fe@xen.org>
Date: Tue, 4 Jul 2023 22:46:32 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 08/52] xen/arm64: move MMU related code from head.S to
 mmu/head.S
Content-Language: en-US
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-9-Penny.Zheng@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230626033443.2943270-9-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Penny,

On 26/06/2023 04:33, Penny Zheng wrote:
> From: Wei Chen <wei.chen@arm.com>
> 
> There are lots of MMU specific code in head.S. This code will not
> be used in MPU systems. If we use #ifdef to gate them, the code
> will become messy and hard to maintain. So we move MMU related
> code to mmu/head.S, and keep common code still in head.S. We also
> add .text.idmap in mmu/head.S to make all code in this new file
> are still in identity map page but will be linked after head.S.
> 
> As "fail" in head.S is very simple and this name is too easy to
> be conflicted, so duplicate it in mmu/head.S instead of exporting
> it.
> 
> And some assembly macros that will be shared by MMU and MPU later,
> we move them to macros.h.

Aren't those macros already shared between head.S and mmu/head.S?

> 
> Rename enable_boot_mmu()/enable_runtime_mmu() to a more generic name
> enable_boot_mm()/enable_runtime_mm(), in order to make them common interfaces
> to be used for both MMU and later MPU system.

As mentionned in an earlier patch, I would prefer if the name was 
correct from the beginning. So this patch will be merely code movement.

> 
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>

I think this will need a rebase on top of the recent changes in head.S.

> diff --git a/xen/arch/arm/arm64/Makefile b/xen/arch/arm/arm64/Makefile
> index 54ad55c75c..0c4b177be9 100644
> --- a/xen/arch/arm/arm64/Makefile
> +++ b/xen/arch/arm/arm64/Makefile
> @@ -8,6 +8,9 @@ obj-y += domctl.o

[...]

> -/*
> - * Macro to print the value of register \xb
> - *
> - * Clobbers x0 - x4
> - */
> -.macro print_reg xb
> -        mov   x0, \xb
> -        mov   x4, lr
> -        bl    putn
> -        mov   lr, x4
> -.endm

I can't find any use of print_reg() in mmu/head.S. So is it necessary to 
move right now?

[...]

> diff --git a/xen/arch/arm/arm64/mmu/head.S b/xen/arch/arm/arm64/mmu/head.S
> new file mode 100644
> index 0000000000..2b209fc3ce
> --- /dev/null
> +++ b/xen/arch/arm/arm64/mmu/head.S
> @@ -0,0 +1,453 @@
> +/*
> + * xen/arch/arm/mmu/head.S
> + *
> + * Start-of-day code for an ARMv8.
> + *
> + * Ian Campbell <ian.campbell@citrix.com>
> + * Copyright (c) 2012 Citrix Systems.
> + *
> + * Based on ARMv7-A head.S by
> + * Tim Deegan <tim@xen.org>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.

For new file (even split code), please use the SPDX tag. In this case, 
the following line should be added at the top of the file:

/* SPDX-License-Identifier: GPL-2.0-or-later */

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 21:54:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 21:54:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558731.873081 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGnyG-0005G6-TI; Tue, 04 Jul 2023 21:54:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558731.873081; Tue, 04 Jul 2023 21:54:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGnyG-0005Fz-QO; Tue, 04 Jul 2023 21:54:04 +0000
Received: by outflank-mailman (input) for mailman id 558731;
 Tue, 04 Jul 2023 21:54:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGnyF-0005Ft-Ng
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 21:54:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGnyF-00041k-4w; Tue, 04 Jul 2023 21:54:03 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGnyE-0007sv-VT; Tue, 04 Jul 2023 21:54:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=uqqWERl+3py7lBkgztSNuyc4I9voSLciyyk0zf9QtZM=; b=wqP/GM+vVWgzLOnCD/ZVdbeiVZ
	Pc1itbPrQyMgmCv0SKjY6mr9QEP1ZyeXHIGp/XxwpPp9kCUBoiYzWtNeqn6W3q2JDaKK6lPBsm51x
	ZzbQ68xC4q2A2v21pE3QUyGihxLX515VGSqZa7Y6jRFIPdmqCeZR/Ksmwy0ny7raYylU=;
Message-ID: <ee493a26-234c-876e-e19f-3708c13cb484@xen.org>
Date: Tue, 4 Jul 2023 22:54:00 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 10/52] xen/arm: Move MMU related definitions from
 config.h to mmu/layout.h
Content-Language: en-US
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-11-Penny.Zheng@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230626033443.2943270-11-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Penny,

On 26/06/2023 04:34, Penny Zheng wrote:
> From: Wei Chen <wei.chen@arm.com>
> 
> Xen defines some global configuration macros for Arm in config.h.
> We still want to use it for MMU systems, but there are some address

Did you mean MPU?

> layout related definitions that are defined for MMU systems only.
> These definitions could not be used by MPU systems, but adding
> ifdefery with CONFIG_HAS_MPU to gate these definitions will result
> in a messy and hard-to-read/maintain code.
> 
> So we keep some common definitions still in config.h, but move MMU
> related definitions to a new file - mmu/layout.h to avoid spreading
> "#ifdef" everywhere.

Just to ease the review, can you add some details which one are 
considered common?

Also, this patch will need to be rebased on top of the latest staging.

> 
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> ---
> v1 -> v2:
> 1. Remove duplicated FIXMAP definitions from config_mmu.h
> ---
> v3:
> 1. name the new header layout.h
> ---
>   xen/arch/arm/include/asm/config.h     | 127 +----------------------
>   xen/arch/arm/include/asm/mmu/layout.h | 141 ++++++++++++++++++++++++++
>   2 files changed, 143 insertions(+), 125 deletions(-)
>   create mode 100644 xen/arch/arm/include/asm/mmu/layout.h
> 
> diff --git a/xen/arch/arm/include/asm/config.h b/xen/arch/arm/include/asm/config.h
> index 30f4665ba9..204b3dec13 100644
> --- a/xen/arch/arm/include/asm/config.h
> +++ b/xen/arch/arm/include/asm/config.h
> @@ -71,131 +71,8 @@
>   #include <xen/const.h>
>   #include <xen/page-size.h>
>   
> -/*
> - * ARM32 layout:
> - *   0  -   2M   Unmapped
> - *   2M -   4M   Xen text, data, bss
> - *   4M -   6M   Fixmap: special-purpose 4K mapping slots
> - *   6M -  10M   Early boot mapping of FDT
> - *   10M - 12M   Livepatch vmap (if compiled in)
> - *
> - *  32M - 128M   Frametable: 32 bytes per page for 12GB of RAM
> - * 256M -   1G   VMAP: ioremap and early_ioremap use this virtual address
> - *                    space
> - *
> - *   1G -   2G   Xenheap: always-mapped memory
> - *   2G -   4G   Domheap: on-demand-mapped
> - *
> - * ARM64 layout:
> - * 0x0000000000000000 - 0x000001ffffffffff (2TB, L0 slots [0..3])
> - *
> - *  Reserved to identity map Xen
> - *
> - * 0x0000020000000000 - 0x0000027fffffffff (512GB, L0 slot [4])
> - *  (Relative offsets)
> - *   0  -   2M   Unmapped
> - *   2M -   4M   Xen text, data, bss
> - *   4M -   6M   Fixmap: special-purpose 4K mapping slots
> - *   6M -  10M   Early boot mapping of FDT
> - *  10M -  12M   Livepatch vmap (if compiled in)
> - *
> - *   1G -   2G   VMAP: ioremap and early_ioremap
> - *
> - *  32G -  64G   Frametable: 56 bytes per page for 2TB of RAM
> - *
> - * 0x0000028000000000 - 0x00007fffffffffff (125TB, L0 slots [5..255])
> - *  Unused
> - *
> - * 0x0000800000000000 - 0x000084ffffffffff (5TB, L0 slots [256..265])
> - *  1:1 mapping of RAM
> - *
> - * 0x0000850000000000 - 0x0000ffffffffffff (123TB, L0 slots [266..511])
> - *  Unused
> - */
> -
> -#ifdef CONFIG_ARM_32
> -#define XEN_VIRT_START          _AT(vaddr_t, MB(2))
> -#else
> -
> -#define SLOT0_ENTRY_BITS  39
> -#define SLOT0(slot) (_AT(vaddr_t,slot) << SLOT0_ENTRY_BITS)
> -#define SLOT0_ENTRY_SIZE  SLOT0(1)
> -
> -#define XEN_VIRT_START          (SLOT0(4) + _AT(vaddr_t, MB(2)))
> -#endif
> -
> -#define XEN_VIRT_SIZE           _AT(vaddr_t, MB(2))
> -
> -#define FIXMAP_VIRT_START       (XEN_VIRT_START + XEN_VIRT_SIZE)
> -#define FIXMAP_VIRT_SIZE        _AT(vaddr_t, MB(2))
> -
> -#define FIXMAP_ADDR(n)          (FIXMAP_VIRT_START + (n) * PAGE_SIZE)
> -
> -#define BOOT_FDT_VIRT_START     (FIXMAP_VIRT_START + FIXMAP_VIRT_SIZE)
> -#define BOOT_FDT_VIRT_SIZE      _AT(vaddr_t, MB(4))
> -
> -#ifdef CONFIG_LIVEPATCH
> -#define LIVEPATCH_VMAP_START    (BOOT_FDT_VIRT_START + BOOT_FDT_VIRT_SIZE)
> -#define LIVEPATCH_VMAP_SIZE    _AT(vaddr_t, MB(2))
> -#endif
> -
> -#define HYPERVISOR_VIRT_START  XEN_VIRT_START
> -
> -#ifdef CONFIG_ARM_32
> -
> -#define CONFIG_SEPARATE_XENHEAP 1
> -
> -#define FRAMETABLE_VIRT_START  _AT(vaddr_t, MB(32))
> -#define FRAMETABLE_SIZE        MB(128-32)
> -#define FRAMETABLE_NR          (FRAMETABLE_SIZE / sizeof(*frame_table))
> -
> -#define VMAP_VIRT_START        _AT(vaddr_t, MB(256))
> -#define VMAP_VIRT_SIZE         _AT(vaddr_t, GB(1) - MB(256))
> -
> -#define XENHEAP_VIRT_START     _AT(vaddr_t, GB(1))
> -#define XENHEAP_VIRT_SIZE      _AT(vaddr_t, GB(1))
> -
> -#define DOMHEAP_VIRT_START     _AT(vaddr_t, GB(2))
> -#define DOMHEAP_VIRT_SIZE      _AT(vaddr_t, GB(2))
> -
> -#define DOMHEAP_ENTRIES        1024  /* 1024 2MB mapping slots */
> -
> -/* Number of domheap pagetable pages required at the second level (2MB mappings) */
> -#define DOMHEAP_SECOND_PAGES (DOMHEAP_VIRT_SIZE >> FIRST_SHIFT)
> -
> -/*
> - * The temporary area is overlapping with the domheap area. This may
> - * be used to create an alias of the first slot containing Xen mappings
> - * when turning on/off the MMU.
> - */
> -#define TEMPORARY_AREA_FIRST_SLOT    (first_table_offset(DOMHEAP_VIRT_START))
> -
> -/* Calculate the address in the temporary area */
> -#define TEMPORARY_AREA_ADDR(addr)                           \
> -     (((addr) & ~XEN_PT_LEVEL_MASK(1)) |                    \
> -      (TEMPORARY_AREA_FIRST_SLOT << XEN_PT_LEVEL_SHIFT(1)))
> -
> -#define TEMPORARY_XEN_VIRT_START    TEMPORARY_AREA_ADDR(XEN_VIRT_START)
> -
> -#else /* ARM_64 */
> -
> -#define IDENTITY_MAPPING_AREA_NR_L0  4
> -
> -#define VMAP_VIRT_START  (SLOT0(4) + GB(1))
> -#define VMAP_VIRT_SIZE   GB(1)
> -
> -#define FRAMETABLE_VIRT_START  (SLOT0(4) + GB(32))
> -#define FRAMETABLE_SIZE        GB(32)
> -#define FRAMETABLE_NR          (FRAMETABLE_SIZE / sizeof(*frame_table))
> -
> -#define DIRECTMAP_VIRT_START   SLOT0(256)
> -#define DIRECTMAP_SIZE         (SLOT0_ENTRY_SIZE * (266 - 256))
> -#define DIRECTMAP_VIRT_END     (DIRECTMAP_VIRT_START + DIRECTMAP_SIZE - 1)
> -
> -#define XENHEAP_VIRT_START     directmap_virt_start
> -
> -#define HYPERVISOR_VIRT_END    DIRECTMAP_VIRT_END
> -
> +#ifndef CONFIG_HAS_MPU

We are not going to introduce HAS_MPU yet in Xen. So can you use 
CONFIG_HAS_MMU?

Also, I would add:

#else
# error "Unknown memory management layout"
#endif

> +#include <asm/mmu/layout.h>
>   #endif
>   
>   #define NR_hypercalls 64
> diff --git a/xen/arch/arm/include/asm/mmu/layout.h b/xen/arch/arm/include/asm/mmu/layout.h
> new file mode 100644
> index 0000000000..8deda6b84d
> --- /dev/null
> +++ b/xen/arch/arm/include/asm/mmu/layout.h
> @@ -0,0 +1,141 @@
> +/* SPDX-License-Identifier: GPL-2.0 */

GPL-2.0 is deprecated and should not be used for new file. This should 
instead be GPL-2.0-only

> +
> +#ifndef __ARM_MMU_LAYOUT_H__
> +#define __ARM_MMU_LAYOUT_H__
> +
> +/*
> + * ARM32 layout:
> + *   0  -   2M   Unmapped
> + *   2M -   4M   Xen text, data, bss
> + *   4M -   6M   Fixmap: special-purpose 4K mapping slots
> + *   6M -  10M   Early boot mapping of FDT
> + *   10M - 12M   Livepatch vmap (if compiled in)
> + *
> + *  32M - 128M   Frametable: 32 bytes per page for 12GB of RAM
> + * 256M -   1G   VMAP: ioremap and early_ioremap use this virtual address
> + *                    space
> + *
> + *   1G -   2G   Xenheap: always-mapped memory
> + *   2G -   4G   Domheap: on-demand-mapped
> + *
> + * ARM64 layout:
> + * 0x0000000000000000 - 0x000001ffffffffff (2TB, L0 slots [0..3])
> + *
> + *  Reserved to identity map Xen
> + *
> + * 0x0000020000000000 - 0x0000027fffffffff (512GB, L0 slot [4])
> + *  (Relative offsets)
> + *   0  -   2M   Unmapped
> + *   2M -   4M   Xen text, data, bss
> + *   4M -   6M   Fixmap: special-purpose 4K mapping slots
> + *   6M -  10M   Early boot mapping of FDT
> + *  10M -  12M   Livepatch vmap (if compiled in)
> + *
> + *   1G -   2G   VMAP: ioremap and early_ioremap
> + *
> + *  32G -  64G   Frametable: 56 bytes per page for 2TB of RAM
> + *
> + * 0x0000028000000000 - 0x00007fffffffffff (125TB, L0 slots [5..255])
> + *  Unused
> + *
> + * 0x0000800000000000 - 0x000084ffffffffff (5TB, L0 slots [256..265])
> + *  1:1 mapping of RAM
> + *
> + * 0x0000850000000000 - 0x0000ffffffffffff (123TB, L0 slots [266..511])
> + *  Unused
> + */
> +
> +#ifdef CONFIG_ARM_32
> +#define XEN_VIRT_START          _AT(vaddr_t, MB(2))
> +#else
> +
> +#define SLOT0_ENTRY_BITS  39
> +#define SLOT0(slot) (_AT(vaddr_t,slot) << SLOT0_ENTRY_BITS)
> +#define SLOT0_ENTRY_SIZE  SLOT0(1)
> +
> +#define XEN_VIRT_START          (SLOT0(4) + _AT(vaddr_t, MB(2)))
> +#endif
> +
> +#define XEN_VIRT_SIZE           _AT(vaddr_t, MB(2))
> +
> +#define FIXMAP_VIRT_START       (XEN_VIRT_START + XEN_VIRT_SIZE)
> +#define FIXMAP_VIRT_SIZE        _AT(vaddr_t, MB(2))
> +
> +#define FIXMAP_ADDR(n)          (FIXMAP_VIRT_START + (n) * PAGE_SIZE)
> +
> +#define BOOT_FDT_VIRT_START     (FIXMAP_VIRT_START + FIXMAP_VIRT_SIZE)
> +#define BOOT_FDT_VIRT_SIZE      _AT(vaddr_t, MB(4))
> +
> +#ifdef CONFIG_LIVEPATCH
> +#define LIVEPATCH_VMAP_START    (BOOT_FDT_VIRT_START + BOOT_FDT_VIRT_SIZE)
> +#define LIVEPATCH_VMAP_SIZE    _AT(vaddr_t, MB(2))
> +#endif
> +
> +#define HYPERVISOR_VIRT_START  XEN_VIRT_START
> +
> +#ifdef CONFIG_ARM_32
> +
> +#define CONFIG_SEPARATE_XENHEAP 1
> +
> +#define FRAMETABLE_VIRT_START  _AT(vaddr_t, MB(32))
> +#define FRAMETABLE_SIZE        MB(128-32)
> +#define FRAMETABLE_NR          (FRAMETABLE_SIZE / sizeof(*frame_table))
> +
> +#define VMAP_VIRT_START        _AT(vaddr_t, MB(256))
> +#define VMAP_VIRT_SIZE         _AT(vaddr_t, GB(1) - MB(256))
> +
> +#define XENHEAP_VIRT_START     _AT(vaddr_t, GB(1))
> +#define XENHEAP_VIRT_SIZE      _AT(vaddr_t, GB(1))
> +
> +#define DOMHEAP_VIRT_START     _AT(vaddr_t, GB(2))
> +#define DOMHEAP_VIRT_SIZE      _AT(vaddr_t, GB(2))
> +
> +#define DOMHEAP_ENTRIES        1024  /* 1024 2MB mapping slots */
> +
> +/* Number of domheap pagetable pages required at the second level (2MB mappings) */
> +#define DOMHEAP_SECOND_PAGES (DOMHEAP_VIRT_SIZE >> FIRST_SHIFT)
> +
> +/*
> + * The temporary area is overlapping with the domheap area. This may
> + * be used to create an alias of the first slot containing Xen mappings
> + * when turning on/off the MMU.
> + */
> +#define TEMPORARY_AREA_FIRST_SLOT    (first_table_offset(DOMHEAP_VIRT_START))
> +
> +/* Calculate the address in the temporary area */
> +#define TEMPORARY_AREA_ADDR(addr)                           \
> +     (((addr) & ~XEN_PT_LEVEL_MASK(1)) |                    \
> +      (TEMPORARY_AREA_FIRST_SLOT << XEN_PT_LEVEL_SHIFT(1)))
> +
> +#define TEMPORARY_XEN_VIRT_START    TEMPORARY_AREA_ADDR(XEN_VIRT_START)
> +
> +#else /* ARM_64 */
> +
> +#define IDENTITY_MAPPING_AREA_NR_L0  4
> +
> +#define VMAP_VIRT_START  (SLOT0(4) + GB(1))
> +#define VMAP_VIRT_SIZE   GB(1)
> +
> +#define FRAMETABLE_VIRT_START  (SLOT0(4) + GB(32))
> +#define FRAMETABLE_SIZE        GB(32)
> +#define FRAMETABLE_NR          (FRAMETABLE_SIZE / sizeof(*frame_table))
> +
> +#define DIRECTMAP_VIRT_START   SLOT0(256)
> +#define DIRECTMAP_SIZE         (SLOT0_ENTRY_SIZE * (266 - 256))
> +#define DIRECTMAP_VIRT_END     (DIRECTMAP_VIRT_START + DIRECTMAP_SIZE - 1)
> +
> +#define XENHEAP_VIRT_START     directmap_virt_start
> +
> +#define HYPERVISOR_VIRT_END    DIRECTMAP_VIRT_END
> +
> +#endif
> +
> +#endif /* __ARM_MMU_LAYOUT_H__ */
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * indent-tabs-mode: nil
> + * End:
> + */

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 22:12:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 22:12:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558737.873091 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGoGE-0007qX-ED; Tue, 04 Jul 2023 22:12:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558737.873091; Tue, 04 Jul 2023 22:12:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGoGE-0007qQ-Aw; Tue, 04 Jul 2023 22:12:38 +0000
Received: by outflank-mailman (input) for mailman id 558737;
 Tue, 04 Jul 2023 22:12:37 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGoGC-0007qI-UU
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 22:12:36 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGoGC-0004Zj-AR; Tue, 04 Jul 2023 22:12:36 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGoGC-0000Q9-3o; Tue, 04 Jul 2023 22:12:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=p0QJp4Pxt/xIl8/popR1R9Tv9brAC1FHRxiDUoUOtjo=; b=Nldab+1u2NWvoKW4dS1NN2O1HA
	7igDjsYJy6m4XapmB6q1PDXqBl6rnCGvixBb7u6dZ5c2BmojzVnZuhUNG6xYG0evW5kuEkESREd9o
	bMDGyUwafp5yl2YFrIlzTO7K/b/4RXvukqM83DPtv/jjMqApmJGNF/4LP+VBye4cuJ/0=;
Message-ID: <1be18c29-511e-27eb-0970-adaa1c74ce82@xen.org>
Date: Tue, 4 Jul 2023 23:12:34 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 11/52] xen/arm: mmu: fold FIXMAP into MMU system
Content-Language: en-US
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-12-Penny.Zheng@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230626033443.2943270-12-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 26/06/2023 04:34, Penny Zheng wrote:
> FIXMAP in MMU system is used to do special-purpose 4K mapping, like
> mapping early UART, temporarily mapping source codes for copy and paste
> (copy_from_paddr), etc.
> 
> As FIXMAP feature is highly dependent on virtual address translation, we
> introduce a new Kconfig CONFIG_HAS_FIXMAP to wrap all releated codes, then
> we fold it into MMU system.
> Since PMAP relies on FIXMAP, so we fold it too into MMU system.
> 
> Under !CONFIG_HAS_FIXMAP, we provide empty stubbers for not breaking
> compilation.

Looking at the end result, I can't find any use of set_fixmap() in the 
common code. So I am not sure this is warrant to provide any stubs (see 
above).

> 
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> ---
> v1 -> v2
> - new patch
> ---
> v3:
> - fold CONFIG_HAS_FIXMAP into CONFIG_HAS_MMU
> - change CONFIG_HAS_FIXMAP to an Arm-specific Kconfig
> ---
>   xen/arch/arm/Kconfig              |  7 ++++++-
>   xen/arch/arm/include/asm/fixmap.h | 31 ++++++++++++++++++++++++++++---
>   2 files changed, 34 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> index fb77392b82..22b28b8ba2 100644
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -15,7 +15,6 @@ config ARM
>   	select HAS_DEVICE_TREE
>   	select HAS_PASSTHROUGH
>   	select HAS_PDX
> -	select HAS_PMAP
>   	select IOMMU_FORCE_PT_SHARE
>   
>   config ARCH_DEFCONFIG
> @@ -63,11 +62,17 @@ source "arch/Kconfig"
>   config HAS_MMU
>   	bool "Memory Management Unit support in a VMSA system"
>   	default y
> +	select HAS_PMAP
>   	help
>   	  In a VMSA system, a Memory Management Unit (MMU) provides fine-grained control of
>   	  a memory system through a set of virtual to physical address mappings and associated memory
>   	  properties held in memory-mapped tables known as translation tables.
>   
> +config HAS_FIXMAP
> +	bool "Provide special-purpose 4K mapping slots in a VMSA"


Regardless what I wrote above, I don't think a developer should be able 
to disable HAS_FIXMAP when the HAS_MMU is used. So the 3 lines should be 
replaced with:

def_bool HAS_MMU

> +	depends on HAS_MMU
> +	default y
> +
>   config ACPI
>   	bool "ACPI (Advanced Configuration and Power Interface) Support (UNSUPPORTED)" if UNSUPPORTED
>   	depends on ARM_64
> diff --git a/xen/arch/arm/include/asm/fixmap.h b/xen/arch/arm/include/asm/fixmap.h
> index d0c9a52c8c..1b5b62866b 100644
> --- a/xen/arch/arm/include/asm/fixmap.h
> +++ b/xen/arch/arm/include/asm/fixmap.h
> @@ -4,9 +4,6 @@
>   #ifndef __ASM_FIXMAP_H
>   #define __ASM_FIXMAP_H
>   
> -#include <xen/acpi.h>
> -#include <xen/pmap.h>
> -
>   /* Fixmap slots */
>   #define FIXMAP_CONSOLE  0  /* The primary UART */
>   #define FIXMAP_MISC     1  /* Ephemeral mappings of hardware */
> @@ -22,6 +19,11 @@
>   
>   #ifndef __ASSEMBLY__
>   
> +#ifdef CONFIG_HAS_FIXMAP
> +
> +#include <xen/acpi.h>
> +#include <xen/pmap.h>
> +
>   /*
>    * Direct access to xen_fixmap[] should only happen when {set,
>    * clear}_fixmap() is unusable (e.g. where we would end up to
> @@ -43,6 +45,29 @@ static inline unsigned int virt_to_fix(vaddr_t vaddr)
>       return ((vaddr - FIXADDR_START) >> PAGE_SHIFT);
>   }
>   
> +#else /* !CONFIG_HAS_FIXMAP */
> +
> +#include <xen/mm-frame.h>
> +#include <xen/errno.h>

I think they should be included outside of #ifdef.

> +
> +static inline void set_fixmap(unsigned int map, mfn_t mfn,
> +                              unsigned int attributes)
> +{
> +    ASSERT_UNREACHABLE();
> +}

If there is an interest to have a stub, then I think we should be using 
BUG() because if this gets call, then it would likely crash right after 
when the user tries to access it.

> +
> +static inline void clear_fixmap(unsigned int map)
> +{
> +    ASSERT_UNREACHABLE();

This one might be OK with ASSERT_UNREACHABLE(). Yet, it might be best to 
use BUG() as nobody should use it.

> +}
> +
> +static inline unsigned int virt_to_fix(vaddr_t vaddr)
> +{
> +    ASSERT_UNREACHABLE();
> +    return -EINVAL;

This is a bit of a random value. This may or may not be mapped. And 
therefore any user of the return may or may not crash.

Overall, it feels like we are trying to just please the compiler by 
writing bogus stubs. It is going to be hard to get them correct. So it 
would be better if we have no use of the 3 helpers in the common code.


> +}
> +#endif /* !CONFIG_HAS_FIXMAP */
> +
>   #endif /* __ASSEMBLY__ */
>   
>   #endif /* __ASM_FIXMAP_H */

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 22:25:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 22:25:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558741.873101 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGoSM-0000za-F4; Tue, 04 Jul 2023 22:25:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558741.873101; Tue, 04 Jul 2023 22:25:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGoSM-0000zT-Bo; Tue, 04 Jul 2023 22:25:10 +0000
Received: by outflank-mailman (input) for mailman id 558741;
 Tue, 04 Jul 2023 22:25:09 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGoSL-0000zL-CW
 for xen-devel@lists.xenproject.org; Tue, 04 Jul 2023 22:25:09 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGoSK-0004ml-MX; Tue, 04 Jul 2023 22:25:08 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGoSK-0000kw-Fz; Tue, 04 Jul 2023 22:25:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=XHBXrx06SoJfakVZDdkRrVGK/PyBkCUKDhPfidkHeWQ=; b=Uy1ML2TeeUC1ZF/0M1auULkqEL
	0CHN1h9dMcnSjTHrZQv87I38GU+E7jeiY+kgeCMUW+kCysm8D2wyjBNGrxBY94+WNPVWleM8d6nQq
	E39uDJV5uk47H0V1qISwa+akQ2NyDRHJeAtUrkbwOZzb2hbNi85PZm2N0t+L/VZIPkyg=;
Message-ID: <78862bb8-fd7f-5a51-a7ae-3c5b5998ed80@xen.org>
Date: Tue, 4 Jul 2023 23:25:06 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 12/52] xen/mmu: extract early uart mapping from
 setup_fixmap
Content-Language: en-US
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-13-Penny.Zheng@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230626033443.2943270-13-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Penny,

Title: You want to clarify that this change is arm64 only. So:

xen/arm64: mmu: ...

On 26/06/2023 04:34, Penny Zheng wrote:
> Original setup_fixmap is actually doing two seperate tasks, one is enabling
> the early UART when earlyprintk on, and the other is to set up the fixmap
> even when earlyprintk is not configured.
> 
> To be more dedicated and precise, the old function shall be split into two
> functions, setup_early_uart and new setup_fixmap.
While some of the split before would be warrant even without the MPU 
support. This one is not because there is limited point to have 3 lines 
function. So I think you want to justify based on what you plan to do 
with the MPU code.

That said, I don't think we need to introduce setup_fixmap. See below.


> 
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> ---
> v3:
> - new patch
> ---
>   xen/arch/arm/arm64/head.S     |  3 +++
>   xen/arch/arm/arm64/mmu/head.S | 24 +++++++++++++++++-------
>   2 files changed, 20 insertions(+), 7 deletions(-)
> 
> diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
> index e63886b037..55a4cfe69e 100644
> --- a/xen/arch/arm/arm64/head.S
> +++ b/xen/arch/arm/arm64/head.S
> @@ -258,7 +258,10 @@ real_start_efi:
>           b     enable_boot_mm
>   
>   primary_switched:
> +        bl    setup_early_uart
> +#ifdef CONFIG_HAS_FIXMAP
>           bl    setup_fixmap
> +#endif
>   #ifdef CONFIG_EARLY_PRINTK
>           /* Use a virtual address to access the UART. */
>           ldr   x23, =EARLY_UART_VIRTUAL_ADDRESS
> diff --git a/xen/arch/arm/arm64/mmu/head.S b/xen/arch/arm/arm64/mmu/head.S
> index 2b209fc3ce..295596aca1 100644
> --- a/xen/arch/arm/arm64/mmu/head.S
> +++ b/xen/arch/arm/arm64/mmu/head.S
> @@ -367,24 +367,34 @@ identity_mapping_removed:
>   ENDPROC(remove_identity_mapping)
>   
>   /*
> - * Map the UART in the fixmap (when earlyprintk is used) and hook the
> - * fixmap table in the page tables.
> - *
> - * The fixmap cannot be mapped in create_page_tables because it may
> - * clash with the 1:1 mapping.

Since commit 9d267c049d92 ("xen/arm64: Rework the memory layout"), there 
is no chance that the fixmap will clash with the 1:1 mapping. So rather 
than introducing a new function, I would move the creation of the fixmap 
in create_pagetables().

This would avoid the #ifdef CONFIG_HAS_FIXMAP in head.S.

> + * Map the UART in the fixmap (when earlyprintk is used)
>    *
>    * Inputs:
> - *   x20: Physical offset
>    *   x23: Early UART base physical address
>    *
>    * Clobbers x0 - x3
>    */
> -ENTRY(setup_fixmap)
> +ENTRY(setup_early_uart)
>   #ifdef CONFIG_EARLY_PRINTK
>           /* Add UART to the fixmap table */
>           ldr   x0, =EARLY_UART_VIRTUAL_ADDRESS
>           create_mapping_entry xen_fixmap, x0, x23, x1, x2, x3, type=PT_DEV_L3
> +        /* Ensure any page table updates made above have occurred. */
> +        dsb   nshst
> +
> +        ret

The 'ret' needs to be outside of the '#ifdef' block. But, in this case, 
I would prefer if we don't call setup_early_uart() when 
!CONFIG_EARLY_PRINTK in head.S

>   #endif
> +ENDPROC(setup_early_uart)
> +
> +/*
> + * Map the fixmap table in the page tables.
> + *
> + * The fixmap cannot be mapped in create_page_tables because it may
> + * clash with the 1:1 mapping.
> + *
> + * Clobbers x0 - x3
> + */
> +ENTRY(setup_fixmap)
>           /* Map fixmap into boot_second */
>           ldr   x0, =FIXMAP_ADDR(0)
>           create_table_entry boot_second, xen_fixmap, x0, 2, x1, x2, x3

Cheeers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 04 22:36:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Jul 2023 22:36:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558746.873114 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGocv-0002Zl-E0; Tue, 04 Jul 2023 22:36:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558746.873114; Tue, 04 Jul 2023 22:36:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGocv-0002Ze-B0; Tue, 04 Jul 2023 22:36:05 +0000
Received: by outflank-mailman (input) for mailman id 558746;
 Tue, 04 Jul 2023 22:36:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGoct-0002ZU-Ns; Tue, 04 Jul 2023 22:36:03 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGoct-0004zA-LT; Tue, 04 Jul 2023 22:36:03 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGoct-0005Ae-2B; Tue, 04 Jul 2023 22:36:03 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qGoct-0000fi-1d; Tue, 04 Jul 2023 22:36:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=JTFqXaySdfU2Sakd2K8GV3Fd9otbw/HqrmE2O6NAmUE=; b=Xvoc+nH2zhLFmFYXle8WY2iC+D
	jvVJBEWRofK91rze52Pfy7eGEYMDtGvrEDjYEfJ/wJDFpjbEqXI3VSPociT+dc0iTpKyscEPmZBzf
	+DXI6voNZDbszU7oio5AyE9gNchqsPQDtM1gF37GKqiBuFkZuaYN/wSq8h3QeNWiBcA4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181695-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181695: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=6e06d229d538ea51b92dc189546c522f5e903511
X-Osstest-Versions-That:
    xen=f51e5d8eae8ece77a949571f39ee49904f3129aa
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 04 Jul 2023 22:36:03 +0000

flight 181695 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181695/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181689
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181689
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181689
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181689
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181689
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181689
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181689
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181689
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181689
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail like 181689
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181689
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181689
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181689
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  6e06d229d538ea51b92dc189546c522f5e903511
baseline version:
 xen                  f51e5d8eae8ece77a949571f39ee49904f3129aa

Last test of basis   181689  2023-07-04 01:53:28 Z    0 days
Testing same since   181695  2023-07-04 13:38:35 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   f51e5d8eae..6e06d229d5  6e06d229d538ea51b92dc189546c522f5e903511 -> master


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 01:04:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 01:04:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558754.873125 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGqwS-000860-J1; Wed, 05 Jul 2023 01:04:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558754.873125; Wed, 05 Jul 2023 01:04:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGqwS-00085t-Ew; Wed, 05 Jul 2023 01:04:24 +0000
Received: by outflank-mailman (input) for mailman id 558754;
 Wed, 05 Jul 2023 01:04:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGqwQ-00085j-QR; Wed, 05 Jul 2023 01:04:22 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGqwQ-00077f-Jc; Wed, 05 Jul 2023 01:04:22 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGqwQ-0002S7-53; Wed, 05 Jul 2023 01:04:22 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qGqwQ-0005hj-4V; Wed, 05 Jul 2023 01:04:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ucxOON+OMOWAOowfMJMdpIKiW5scAimgsRwAKhLarbg=; b=W+KqyoFrK3n8A0QR9NSZbRCI8M
	2rARf3W0MVeBXcb6NKwlU/BFrdKIEKz1NOq6FAuCv/9FQchEuBwtlNeARo52a5xEQYz64U+e6gJD9
	MVZnv17Q1lQGIDZOdzTEdpqvEZNXDUqPtbo8St+y01kPzNC0ASzKnwANBNKt23KB25eE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181698-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181698: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=12314be5749ecbb338d42ad10df059def6fc259a
X-Osstest-Versions-That:
    xen=abb1522832bb2ef340a56681d486dce51d2f9971
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 05 Jul 2023 01:04:22 +0000

flight 181698 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181698/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  12314be5749ecbb338d42ad10df059def6fc259a
baseline version:
 xen                  abb1522832bb2ef340a56681d486dce51d2f9971

Last test of basis   181697  2023-07-04 19:01:56 Z    0 days
Testing same since   181698  2023-07-04 22:01:54 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Anthony PERARD <anthony.perard@citrix.com>
  Henry Wang <Henry.Wang@arm.com>
  Julien Grall <jgrall@amazon.com>
  Luca Fancellu <luca.fancellu@arm.com>
  Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
  Penny Zheng <penny.zheng@arm.com>
  Wei Chen <wei.chen@arm.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   abb1522832..12314be574  12314be5749ecbb338d42ad10df059def6fc259a -> smoke


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 02:55:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 02:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558762.873135 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGsfQ-0002md-7u; Wed, 05 Jul 2023 02:54:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558762.873135; Wed, 05 Jul 2023 02:54:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGsfQ-0002mV-31; Wed, 05 Jul 2023 02:54:56 +0000
Received: by outflank-mailman (input) for mailman id 558762;
 Wed, 05 Jul 2023 02:54:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGsfO-0002mH-Vh; Wed, 05 Jul 2023 02:54:54 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGsfO-0001jg-F2; Wed, 05 Jul 2023 02:54:54 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGsfO-0008IH-1D; Wed, 05 Jul 2023 02:54:54 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qGsfO-0002U5-08; Wed, 05 Jul 2023 02:54:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=xK3MBL1jDv2SLMXn9N621k3gTD7zrjPr8/Nx/UFKR0o=; b=wIcUi3YWngimOkXhnii6QARItS
	lByBHs9/wqGVrfYmKGHe3YWJV8RNI/bcbq1nKzqaXYcCltcSA2GSLCl682qj06+6Qft0r+QMC8PB8
	ZipXXDnLrcZHQu0oFGiM155L3fRfMMcyVISZM3Ez4G7lhZFdi/Df++deNYr0eCyfjhXg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181696-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181696: regressions - trouble: broken/fail/pass
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-freebsd12-amd64:<job status>:broken:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:host-install(5):broken:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:xen-boot:fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:debian-hvm-install:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:debian-di-install:fail:regression
    linux-linus:test-amd64-amd64-pygrub:guest-localmigrate:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:debian-install:fail:allowable
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:guest-localmigrate:fail:allowable
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=b5641a5d8b8b14643bfe3d017d64da90a5c55479
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 05 Jul 2023 02:54:54 +0000

flight 181696 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181696/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-freebsd12-amd64    <job status>                 broken
 test-amd64-amd64-freebsd12-amd64  5 host-install(5)    broken REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu  8 xen-boot                fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl          11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt     12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd 12 debian-install          fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 12 xen-boot/src_host       fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 12 debian-hvm-install fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2 12 debian-di-install      fail REGR. vs. 180278
 test-amd64-amd64-pygrub      17 guest-localmigrate       fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds     12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 16 guest-localmigrate fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                b5641a5d8b8b14643bfe3d017d64da90a5c55479
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   79 days
Failing since        180281  2023-04-17 06:24:36 Z   78 days  154 attempts
Testing same since   181696  2023-07-04 15:13:53 Z    0 days    1 attempts

------------------------------------------------------------
3652 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             broken  
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-amd64-amd64-freebsd12-amd64 broken
broken-step test-amd64-amd64-freebsd12-amd64 host-install(5)

Not pushing.

(No revision log; it would be 596387 lines long.)


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 03:42:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 03:42:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558768.873145 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGtPB-00085n-Oz; Wed, 05 Jul 2023 03:42:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558768.873145; Wed, 05 Jul 2023 03:42:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGtPB-00085g-Lo; Wed, 05 Jul 2023 03:42:13 +0000
Received: by outflank-mailman (input) for mailman id 558768;
 Wed, 05 Jul 2023 03:42:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=TfY/=CX=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qGtP9-00085a-Qv
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 03:42:12 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on20622.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::622])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id eae7368c-1ae5-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 05:42:09 +0200 (CEST)
Received: from AS4PR09CA0003.eurprd09.prod.outlook.com (2603:10a6:20b:5e0::6)
 by VI1PR08MB5533.eurprd08.prod.outlook.com (2603:10a6:803:12d::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 03:42:04 +0000
Received: from AM7EUR03FT051.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:5e0:cafe::83) by AS4PR09CA0003.outlook.office365.com
 (2603:10a6:20b:5e0::6) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.31 via Frontend
 Transport; Wed, 5 Jul 2023 03:42:04 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT051.mail.protection.outlook.com (100.127.140.64) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.18 via Frontend Transport; Wed, 5 Jul 2023 03:42:03 +0000
Received: ("Tessian outbound c08fa2e31830:v142");
 Wed, 05 Jul 2023 03:42:03 +0000
Received: from f7af70dbc7fd.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 C30B975A-A8D8-45C6-9254-2C53C05A55C7.1; 
 Wed, 05 Jul 2023 03:41:56 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f7af70dbc7fd.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 03:41:56 +0000
Received: from AS9PR06CA0453.eurprd06.prod.outlook.com (2603:10a6:20b:49a::7)
 by AS8PR08MB6421.eurprd08.prod.outlook.com (2603:10a6:20b:31c::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 03:41:54 +0000
Received: from AM7EUR03FT010.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:49a:cafe::6f) by AS9PR06CA0453.outlook.office365.com
 (2603:10a6:20b:49a::7) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.30 via Frontend
 Transport; Wed, 5 Jul 2023 03:41:54 +0000
Received: from nebula.arm.com (40.67.248.234) by
 AM7EUR03FT010.mail.protection.outlook.com (100.127.141.22) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.22 via Frontend Transport; Wed, 5 Jul 2023 03:41:54 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com
 (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 5 Jul
 2023 03:41:52 +0000
Received: from [10.169.172.87] (10.169.172.87) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Wed, 5 Jul 2023 03:41:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eae7368c-1ae5-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4l64INYGwA55w8b43/Qs2oE0thWep9R23LFJjdMeJ8U=;
 b=g1g7mru9dVB0cBIq+bHLeN343TXwYyu423+0+P3wjuKjN1xhB37p9t8tKNvNIG5IQ/bSwqsUYgYOSf5xKP4uxeZN9nqj7bKFlVrzAAt3akc5InLBMGywY06ce1dWVKYc1Z1VMP34JmnrV2zTQ5lqmukC82Tj/e9/o7U+kJWUkdM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 680d2e592cbab0ee
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=gLUi4GCGBaFRRcNBHO96+s8nbobbG4ugZRB5mRoiTu8qGBRc5fVWQw7zpC9Rx1+YiaX5AlSZRKKeRRiJNjIPv9dw7PdUgcV3FA43dhiNghSYstONXa04V0R6PLscA44O1pmdVsVJqHM+qXViaqHGZBHvQWYVpumQ+aFOYlP/8Mr1w7gOdgcriOAFd+63qecZeYMNqbqEd65n9zObHu9js4iLUf46go4p82A8cpCCdpYbzH1M4TJLQlVyoWvIqD+kNv0/u9XUhOQba5oWb4RRQYBvFbfsFiTRFQGCy0VSEgkysHlbrR8ad7nwwr09ogp+rQ15L3raVl74aWeETusvTg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4l64INYGwA55w8b43/Qs2oE0thWep9R23LFJjdMeJ8U=;
 b=D+PNLWfIKRo/7gtLNRkF8ycMezqAp4qQBQL8dGVjjuPYUhONIXE3BKpAW+HZZHdjCmH8saPLHZtPQ6tU9vt5FNGJh+kX/fltmgx+m7AqsqAgL1itbT9LnLFgMmHQxuvgrCMd5ISScjnK8kDtRjvCsRnJNjQI+KUGVzXAvfp2RVLJPDff875FOz/5XLMk+fauZlbFq9USHqjyp9Q8hx2TV9d4gJf0N2YX3sytJBtOX09N4AK6O3jZJNSsM5I9Yz5ArzLtE3gksPtzBPc/uRG68zHs6WxXkiqJfOViVsZ1CoMkmd6YoJGJ4XP1rTbPm+Mx7oqbOTfDU/Vuo2sKe/wQmQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4l64INYGwA55w8b43/Qs2oE0thWep9R23LFJjdMeJ8U=;
 b=g1g7mru9dVB0cBIq+bHLeN343TXwYyu423+0+P3wjuKjN1xhB37p9t8tKNvNIG5IQ/bSwqsUYgYOSf5xKP4uxeZN9nqj7bKFlVrzAAt3akc5InLBMGywY06ce1dWVKYc1Z1VMP34JmnrV2zTQ5lqmukC82Tj/e9/o7U+kJWUkdM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <c5862fea-0ef7-1266-4c13-5b2735ad75c2@arm.com>
Date: Wed, 5 Jul 2023 11:41:48 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 05/52] xen/arm64: head: Introduce enable_boot_mmu and
 enable_runtime_mmu
Content-Language: en-US
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-6-Penny.Zheng@arm.com>
 <c10bc254-ad79-dada-d5fb-9ee619934ffb@xen.org>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <c10bc254-ad79-dada-d5fb-9ee619934ffb@xen.org>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	AM7EUR03FT010:EE_|AS8PR08MB6421:EE_|AM7EUR03FT051:EE_|VI1PR08MB5533:EE_
X-MS-Office365-Filtering-Correlation-Id: b8036f74-d1ae-46c1-8249-08db7d09cc12
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 npBxPwdlf/vmoyVNCRvgdtrTSBkaoEgCYO01kbMLVPuoVcWzUkSYqgHLP0HQ4Qb+yhgQIusxaEKuxnakUDB6gAOdkTeX0pGAxFK5Nz9jtVUAXqrZgb7ODlq/tRDJNNkka8dZaykHYy63GVRYaB7jt8p1agNK4rBwZCDflHZvB2Fd6gjtBgvTsQLWE1sPmm/NXA7+ojjn0qHspCmpWcVt/g6wbo/cl0DkuNyYPkjN08zJmlhGeHMEIaWGl/600EXEElMkMNc+HrdP9u/vubU81yn9lDPTHajCAEeL191tODe8NQ6vnXej9LHtkTIvWuo7e/ceGPbMvpVmWX5KHqNA2f4q9n86NdbY23TeOh5HzKZgKfA7ZjIq8DQkJB2KpVGtL1cR2a/9XHhJsmgZJNFKvbpOgrJR+4jAKumWOA8HhQDARfbVHS9ZVwQMZY93yAQi2mLmRk22KtdM2gdASW5ObyVzLUxB0K0f2JGE2skugcYiAMfQ3THvP26QDeDmJ589hSR21fNbLopzBw+9T6Fq0lprc7g0aN3aJpsPy4As3sO3gmz0Z0odHskCeXStaSfayM+E12OMdbmKCjrWXvnwlagteR+odEvouen749pX4UVCY4svovzL3azNxw1EO52bIE3VYc/tOUB1eQwE3Z8YFUNN2wTY0uKyeg3jF6qZdD26L34mAYRDGuaUxzPP5KyLKoNjs5sZW9NVC5e97wuYfeQNUkw1rBtBb0ZsGWn0Ttz9g/hOo8lY/KCPi0EVNheeGoQKCQpZxcUFdQcssxpXVEwQAZOuvRJ5Qj+fZ5UKKFCI3C0ZZAcrMa12Y8qtaQLF3mE50Tlog0iOWmZ8xD8+VA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(346002)(39860400002)(376002)(451199021)(36840700001)(46966006)(40470700004)(2616005)(4326008)(70206006)(70586007)(81166007)(356005)(40480700001)(186003)(16576012)(86362001)(36756003)(31696002)(54906003)(53546011)(26005)(478600001)(40460700003)(82310400005)(110136005)(36860700001)(8936002)(8676002)(44832011)(5660300002)(31686004)(66899021)(2906002)(47076005)(41300700001)(82740400003)(316002)(83380400001)(426003)(336012)(3940600001)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6421
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT051.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	17f6beb2-3477-48bd-4814-08db7d09c674
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Yu4kxCnEkU59aR+a90jCrl6dvIrZKC2zRke1+hUrLx0i9jZYUpovxCFr4ZIFaDtx2nJdJUk98CG0b9+s2rEA1DuSz6Cc8dVhb/SSp7nqWBgr5znH3AFdTIinq0gNzRfjWQ9g6z+GDJwOdkfkl//mTiEvOybn64ZzAL2R2k4qBJTHCDjxQ4QWKhUxQBKDKjrFzVFGfumCVSMQBVC3NFjWMrCyug7J3iseCo1dwHQ978GlcXPvIG4AHw2bijy8Bz3hlsKSemC8bC6DY3r/nXy2GY5L/jZftxQeetFz6VdB0mXQopDO/UhVpWdGqomd3YwB68doBhk0S33j+NvAG+o3JHDt/cG0UBQev0DnCggkcdN6kYqevrETzWNEHoX6Is3svwLKFzUmJe6gJXRULE1chXE5WQxqDfeqibmRBNS5Mm1kn3VM52x3AVepu01faEg9t/DwiPuBLVM4325IkcPNCwBs9VF4OEUC/zK3A1+uWMDDnbWB95ytKVtjx/Q1DsgLerpMk1Su+YPH2LUSIMaZh45rG0fDDuKl8IomYGREqiempFVddztyY+7G847K5VXRVHOdzxJUpWgeAd1owHVXvm8Pa/Uhncj4you0+Xz0hFrQe+hmpPCq/jFYXGkacjPtnma0YpkZKDkTC1BSegRFx7nSnm7X4NqMcP/41VUUpWjwUDeb/0xewU+C3w4+g88hx/GcYKMJbJaGSydzKzxyRib8o4Rp2Kk+R/QTYvI8wkNpyLbOdOl8G2e2i8MLx878BWuowC1sbUIUsnSJlt2PJ0eDXktVnrPAJGKUQOeVTR6co5eFXy5ys6Secbk1v8Su
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(396003)(376002)(346002)(451199021)(46966006)(36840700001)(40470700004)(316002)(16576012)(107886003)(66899021)(26005)(40460700003)(53546011)(186003)(41300700001)(54906003)(82740400003)(81166007)(478600001)(110136005)(40480700001)(4326008)(82310400005)(70586007)(36756003)(2616005)(426003)(336012)(2906002)(70206006)(47076005)(86362001)(31696002)(31686004)(83380400001)(36860700001)(44832011)(8676002)(8936002)(5660300002)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 03:42:03.4218
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b8036f74-d1ae-46c1-8249-08db7d09cc12
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT051.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5533

Hi Julien

On 2023/7/5 05:24, Julien Grall wrote:
> Hi Penny,
> 
> On 26/06/2023 04:33, Penny Zheng wrote:
>> From: Wei Chen <wei.chen@arm.com>
>>
>> At the moment, on MMU system, enable_mmu() will return to an
>> address in the 1:1 mapping, then each path is responsible to
>> switch to virtual runtime mapping. Then remove_identity_mapping()
>> is called to remove all 1:1 mapping.
> 
> The identity mapping is only removed for the boot CPU. You mention it 
> correctly below but here it lead to think it may be called on the 
> secondary CPU. So I would add 'on the boot CPU'.
> 
>>
>> Since remove_identity_mapping() is not necessary on Non-MMU system,
>> and we also avoid creating empty function for Non-MMU system, trying
>> to keep only one codeflow in arm64/head.S, we move path switch and
>> remove_identity_mapping() in enable_mmu() on MMU system.
>>
>> As the remove_identity_mapping should only be called for the boot
>> CPU only, so we introduce enable_boot_mmu for boot CPU and
>> enable_runtime_mmu for secondary CPUs in this patch.
> 
> NIT: Add () after enable_runtime_mmu to be consistent with the rest of 
> commit message. Same for the title.
> 

sure.

> Also, I would prefer if we name the functions properly from the start. 
> So we don't have to rename them when they are moved in patch 7.
> 

ok. change them to enable_runtime_mm() and enable_boot_mm() at the beginning

>>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>> ---
>> v3:
>> - new patch
>> ---
>> Â  xen/arch/arm/arm64/head.S | 87 +++++++++++++++++++++++++++++++--------
>> Â  1 file changed, 70 insertions(+), 17 deletions(-)
>>
>> diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
>> index 10a07db428..4dfbe0bc6f 100644
>> --- a/xen/arch/arm/arm64/head.S
>> +++ b/xen/arch/arm/arm64/head.S
>> @@ -314,21 +314,12 @@ real_start_efi:
>> Â Â Â Â Â Â Â Â Â  blÂ Â Â  check_cpu_mode
>> Â Â Â Â Â Â Â Â Â  blÂ Â Â  cpu_init
>> -Â Â Â Â Â Â Â  blÂ Â Â  create_page_tables
>> -Â Â Â Â Â Â Â  load_paddr x0, boot_pgtable
>> -Â Â Â Â Â Â Â  blÂ Â Â  enable_mmu
>> Â Â Â Â Â Â Â Â Â  /* We are still in the 1:1 mapping. Jump to the runtime 
>> Virtual Address. */
> 
> This comment is not accurate anymore given that the MMU is off.
> 

I'll remove.

>> -Â Â Â Â Â Â Â  ldrÂ Â  x0, =primary_switched
>> -Â Â Â Â Â Â Â  brÂ Â Â  x0
>> +Â Â Â Â Â Â Â  ldrÂ Â  lr, =primary_switched
>> +Â Â Â Â Â Â Â  bÂ Â Â Â  enable_boot_mmu
>> +
>> Â  primary_switched:
>> -Â Â Â Â Â Â Â  /*
>> -Â Â Â Â Â Â Â Â  * The 1:1 map may clash with other parts of the Xen virtual 
>> memory
>> -Â Â Â Â Â Â Â Â  * layout. As it is not used anymore, remove it completely to
>> -Â Â Â Â Â Â Â Â  * avoid having to worry about replacing existing mapping
>> -Â Â Â Â Â Â Â Â  * afterwards.
>> -Â Â Â Â Â Â Â Â  */
>> -Â Â Â Â Â Â Â  blÂ Â Â  remove_identity_mapping
>> Â Â Â Â Â Â Â Â Â  blÂ Â Â  setup_fixmap
>> Â  #ifdef CONFIG_EARLY_PRINTK
>> Â Â Â Â Â Â Â Â Â  /* Use a virtual address to access the UART. */
>> @@ -373,13 +364,11 @@ GLOBAL(init_secondary)
>> Â  #endif
>> Â Â Â Â Â Â Â Â Â  blÂ Â Â  check_cpu_mode
>> Â Â Â Â Â Â Â Â Â  blÂ Â Â  cpu_init
>> -Â Â Â Â Â Â Â  load_paddr x0, init_ttbr
>> -Â Â Â Â Â Â Â  ldrÂ Â  x0, [x0]
>> -Â Â Â Â Â Â Â  blÂ Â Â  enable_mmu
>> Â Â Â Â Â Â Â Â Â  /* We are still in the 1:1 mapping. Jump to the runtime 
>> Virtual Address. */

Note: Remove this too.

>> -Â Â Â Â Â Â Â  ldrÂ Â  x0, =secondary_switched
>> -Â Â Â Â Â Â Â  brÂ Â Â  x0
>> +Â Â Â Â Â Â Â  ldrÂ Â  lr, =secondary_switched
>> +Â Â Â Â Â Â Â  bÂ Â Â Â  enable_runtime_mmu
>> +
>> Â  secondary_switched:
>> Â  #ifdef CONFIG_EARLY_PRINTK
>> Â Â Â Â Â Â Â Â Â  /* Use a virtual address to access the UART. */
>> @@ -694,6 +683,70 @@ enable_mmu:
>> Â Â Â Â Â Â Â Â Â  ret
>> Â  ENDPROC(enable_mmu)
>> +/*
>> + * Turn on the Data Cache and the MMU. The function will return
>> + * to the virtual address provided in LR (e.g. the runtime mapping).
> 
> The description here is exactly the same as below. However, there is a 
> different between the two functions. One is to deal with the secondary 
> CPUs whilst the second is for the boot CPUs.
> 

I'll add-on: This function deals with the secondary CPUs.

>> + *
>> + * Inputs:
>> + *Â Â  lr : Virtual address to return to.
>> + *
>> + * Clobbers x0 - x5
>> + */
>> +enable_runtime_mmu:
> 
> I find "runtime" confusing in this case. How about 
> "enable_secondary_cpu_mm"?
> 

Sure, will do.

>> +Â Â Â Â Â Â Â  movÂ Â  x5, lr
>> +
>> +Â Â Â Â Â Â Â  load_paddr x0, init_ttbr
>> +Â Â Â Â Â Â Â  ldrÂ Â  x0, [x0]
>> +
>> +Â Â Â Â Â Â Â  blÂ Â Â  enable_mmu
>> +Â Â Â Â Â Â Â  movÂ Â  lr, x5
>> +
>> +Â Â Â Â Â Â Â  /* return to secondary_switched */
>> +Â Â Â Â Â Â Â  ret
>> +ENDPROC(enable_runtime_mmu)
>> +
>> +/*
>> + * Turn on the Data Cache and the MMU. The function will return
>> + * to the virtual address provided in LR (e.g. the runtime mapping).
> 
> Similar remark as for the comment above.

I'll add-on: This function deals with the boot CPUs.

> 
>> + *
>> + * Inputs:
>> + *Â Â  lr : Virtual address to return to.
>> + *
>> + * Clobbers x0 - x5
>> + */
>> +enable_boot_mmu:
> 
> Based on my comment above, I would sugesst to call it "enable_boot_cpu_mm"

sure,

> 
>> +Â Â Â Â Â Â Â  movÂ Â  x5, lr
>> +
>> +Â Â Â Â Â Â Â  blÂ Â Â  create_page_tables
>> +Â Â Â Â Â Â Â  load_paddr x0, boot_pgtable
>> +
>> +Â Â Â Â Â Â Â  blÂ Â Â  enable_mmu
>> +Â Â Â Â Â Â Â  movÂ Â  lr, x5
>> +
>> +Â Â Â Â Â Â Â  /*
>> +Â Â Â Â Â Â Â Â  * The MMU is turned on and we are in the 1:1 mapping. Switch
>> +Â Â Â Â Â Â Â Â  * to the runtime mapping.
>> +Â Â Â Â Â Â Â Â  */
>> +Â Â Â Â Â Â Â  ldrÂ Â  x0, =1f
>> +Â Â Â Â Â Â Â  brÂ Â Â  x0
>> +1:
>> +Â Â Â Â Â Â Â  /*
>> +Â Â Â Â Â Â Â Â  * The 1:1 map may clash with other parts of the Xen virtual 
>> memory
>> +Â Â Â Â Â Â Â Â  * layout. As it is not used anymore, remove it completely to
>> +Â Â Â Â Â Â Â Â  * avoid having to worry about replacing existing mapping
>> +Â Â Â Â Â Â Â Â  * afterwards. Function will return to primary_switched.
>> +Â Â Â Â Â Â Â Â  */
>> +Â Â Â Â Â Â Â  bÂ Â Â Â  remove_identity_mapping
>> +
>> +Â Â Â Â Â Â Â  /*
>> +Â Â Â Â Â Â Â Â  * Here might not be reached, as "ret" in 
>> remove_identity_mapping
>> +Â Â Â Â Â Â Â Â  * will use the return address in LR in advance. But keep ret 
>> here
>> +Â Â Â Â Â Â Â Â  * might be more safe if "ret" in remove_identity_mapping is 
>> removed
>> +Â Â Â Â Â Â Â Â  * in future.
>> +Â Â Â Â Â Â Â Â  */
>> +Â Â Â Â Â Â Â  ret
> 
> Given this path is meant to be unreachable, I would prefer if we call 
> "fail".

sure,

> 
>> +ENDPROC(enable_boot_mmu)
>> +
>> Â  /*
>> Â Â  * Remove the 1:1 map from the page-tables. It is not easy to keep 
>> track
>> Â Â  * where the 1:1 map was mapped, so we will look for the top-level 
>> entry
> 
> Cheers,
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 03:56:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 03:56:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558774.873156 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGtcT-0001H6-3t; Wed, 05 Jul 2023 03:55:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558774.873156; Wed, 05 Jul 2023 03:55:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGtcS-0001Gz-Vl; Wed, 05 Jul 2023 03:55:56 +0000
Received: by outflank-mailman (input) for mailman id 558774;
 Wed, 05 Jul 2023 03:55:56 +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
 <SRS0=TfY/=CX=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qGtcR-0001Gr-Rn
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 03:55:55 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20609.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::609])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d4bade5f-1ae7-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 05:55:51 +0200 (CEST)
Received: from AS9PR0301CA0060.eurprd03.prod.outlook.com
 (2603:10a6:20b:469::18) by VI1PR08MB10175.eurprd08.prod.outlook.com
 (2603:10a6:800:1cf::9) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 03:55:45 +0000
Received: from AM7EUR03FT062.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:469:cafe::af) by AS9PR0301CA0060.outlook.office365.com
 (2603:10a6:20b:469::18) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 03:55:45 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT062.mail.protection.outlook.com (100.127.140.99) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.18 via Frontend Transport; Wed, 5 Jul 2023 03:55:44 +0000
Received: ("Tessian outbound 52217515e112:v142");
 Wed, 05 Jul 2023 03:55:44 +0000
Received: from 39581fb3c7f5.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 7D5E44D0-2EFE-4EF6-ACE2-AEF7064F698D.1; 
 Wed, 05 Jul 2023 03:55:37 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 39581fb3c7f5.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 03:55:37 +0000
Received: from AM0PR03CA0021.eurprd03.prod.outlook.com (2603:10a6:208:14::34)
 by AM0PR08MB5313.eurprd08.prod.outlook.com (2603:10a6:208:17f::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 03:55:35 +0000
Received: from AM7EUR03FT025.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:208:14:cafe::c6) by AM0PR03CA0021.outlook.office365.com
 (2603:10a6:208:14::34) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.31 via Frontend
 Transport; Wed, 5 Jul 2023 03:55:35 +0000
Received: from nebula.arm.com (40.67.248.234) by
 AM7EUR03FT025.mail.protection.outlook.com (100.127.140.199) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.18 via Frontend Transport; Wed, 5 Jul 2023 03:55:34 +0000
Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com
 (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 5 Jul
 2023 03:55:34 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com
 (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 5 Jul
 2023 03:55:33 +0000
Received: from [10.169.172.87] (10.169.172.87) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Wed, 5 Jul 2023 03:55:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d4bade5f-1ae7-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+nhI3Td4I97E56FkVd9XTIqug6xwtt3BnDfM/L/bd0M=;
 b=e6egVE+TbEW5FX+5NPHLvmGIQvOIIBgwRWHwTk8IHfL17xGDUnnDENIXdhVanphppWhAbzlpXcF59wJUh+4npv3gjEs6bocachX1AU2u6LsuHE1CVMZA9R3FO/zujfieyx+Pb77uS+pQupEwIj8BGortNAVUTSkP1pOx5cXYuZ4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 401759e917dbfcf5
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CLoaldjjDzjCbMynY7jn/SfKNrqNopfLZSDEzmG2i1W4Ak/VxoKzvPaksAzOwU8s0Ljk1GVt/TCw/mEfUZpHe29tYZ5diKNkTrcSL3VK56HjRGyLuNF+RyvfOdlcf4hw4+9nwBmzxeTAU84Zc7o/wp0YucdygAIA3CyDkwIXjSR33z3W+pNOzI5bnlcsrqWMuGBx/2gStatZCA5qgIoZCodlsIEseRrvPGQCqAemZtSyU8MFlOzljdRTT9m2loJKN1BTvMtFQOuW2ZxDsXZXEoZiHtGXkwHjysQGIlcWMaEvdcmkSgveUbpWXGZAl4mErLjt2dfY2/W3ztbqaxMtyA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+nhI3Td4I97E56FkVd9XTIqug6xwtt3BnDfM/L/bd0M=;
 b=h453Y7h6jWfPBz+JiFLcd05DJGeOXzh8IcI8W9ZpbBrQhfsWinCUs6p1FuAn5NQAFN8wXQ45LYtREAyH4nUxMTtxNf4VFpXeHGPB6xo4U0EPqjW3i8vd0YPbmSi5Vp4zFJrFbVFIof/9lInvJwfrMsxy9j1KqYUfXDW16GXLpDyG/mYLTdCHdOaCOcICk8bMtQb/a/5x5QwhBX4L/NSH9spVlf2vw10yytYd26X10+ayng5n+Z4srw/zjde1mGkLkZvktJ8BKa7uxsJCS+0pDcaXboJe4pJ3QygmDK1VjrKJr95EJ6955g+TlashuDqvmyfPkJku2Rg0q5Ruh+YcfQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=amd.com smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+nhI3Td4I97E56FkVd9XTIqug6xwtt3BnDfM/L/bd0M=;
 b=e6egVE+TbEW5FX+5NPHLvmGIQvOIIBgwRWHwTk8IHfL17xGDUnnDENIXdhVanphppWhAbzlpXcF59wJUh+4npv3gjEs6bocachX1AU2u6LsuHE1CVMZA9R3FO/zujfieyx+Pb77uS+pQupEwIj8BGortNAVUTSkP1pOx5cXYuZ4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <c5e5121e-3819-2e9a-0e0d-362c7c80a904@arm.com>
Date: Wed, 5 Jul 2023 11:55:29 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 06/52] xen/arm: introduce CONFIG_HAS_MMU
Content-Language: en-US
To: Ayan Kumar Halder <ayankuma@amd.com>, Julien Grall <julien@xen.org>,
	<xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-7-Penny.Zheng@arm.com>
 <4303bf0e-a987-1ee4-9524-c83756789322@amd.com>
 <1cbf44ae-2500-1428-5dd2-893e846faf1e@xen.org>
 <1cc8eaa4-6fcc-21bb-c590-bffa87e14177@amd.com>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <1cc8eaa4-6fcc-21bb-c590-bffa87e14177@amd.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	AM7EUR03FT025:EE_|AM0PR08MB5313:EE_|AM7EUR03FT062:EE_|VI1PR08MB10175:EE_
X-MS-Office365-Filtering-Correlation-Id: 758b6d1e-a7be-4cb4-cf9e-08db7d0bb5a3
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 ocolYZ1TWyQPW1TNd2I0I+Dj1xUCcIHiIrNvZ+R+lE8JesSnD/ccYtNpCs2ttJ3Fej2PxYtTK1oqv7IqP75s40M1hRfn2KHL70iDpDjpYRGwWS/Kr11Q/QB8Wn1wDLod4KvsUGiBwzWEUJz6faEl4f5moqpTsbtLKCMNe6iH/eCisrWjTnjP45FbNckCz8pKeOolRjN+W6ubeBHHWR6/tTUwHedme4tU8JvdRuV/2N+nBffbzBd9uJm9SIly5P9ofmRSxRKEbDpy2qb+8MJHK5MVdh7eU5e//zjnN2wLVPCQ3uC+5SQ5ovDAA147wEGocdez698iPYQlRQpTcjhqCbvZMtaSxDv51M7gLKwjtLCt3LjjmDjIbeCAZfvsdNqkmZsQByeCaUh0QQFisLJOTFEifJsfObGC1SRs5BZIDYoLdceOKhJUKrhrA7zd2NJinu5pMwGHoUKNSCdyg8sGjIlg0mu0y8zPR0OK7KnRnPkR2sXNc7wAMTxfTEKrDZzyhQ0n8eAriJqDh4pfDl7paLR/zSF4Vsz6sf0k5uv0N0DsCF/icY8QrpDFqEU+rIcvP72uDLV3O6HfO5QApV3SAsI6cmSoaXEFO7KileIxpamtoWTfW/itFn4v7Bhvhorm/Eo9c9g1KwHsPlWls9BcX2bSUlpZ9gNvjD/pFGO8flBAp8nuqS2Cp5szHx/SYm5AaSBfA0PFPD8RLYBiBoOxTQl/SHB7M/yjUo9ymRk4eC50X9ijfKM2pW4/bAhspIrl0iisUeVjJmhbmbD4uFkwB5b8AAGLec0X+WFlZ2ZWRmLjGZM3gxvcK3BzzJz3BRk1S8nxkjOYKF7qPmoeId/VgQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(39860400002)(376002)(396003)(451199021)(40470700004)(36840700001)(46966006)(44832011)(5660300002)(36860700001)(8676002)(8936002)(316002)(2906002)(47076005)(336012)(426003)(83380400001)(31686004)(41300700001)(2616005)(82740400003)(40480700001)(81166007)(70206006)(4326008)(356005)(70586007)(40460700003)(82310400005)(86362001)(16576012)(186003)(53546011)(478600001)(26005)(54906003)(110136005)(31696002)(36756003)(3940600001)(36900700001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5313
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT062.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	8ea2c3cb-a8ef-4a76-9e81-08db7d0bafc6
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	828TKgAczlLbI6yv40mWr8Li9tOmU+FS/zTkJZz3W/Ngh1TJ7XlM5Kef5ZJyiDBptDt1IXtbP8K3htDGiI/ByFhPU5EgY1bKODJ5Ps07a4LAwzUWmdejm2ni6WGIc0oB7lppPM4jYF6Kiglz4II9d266ZWl9WMy9eSMIa+ZRJ/NSs4vSivADljFD7/TyAuXR9IfwLLQXnPM4lvlAUFqK15JStUDTQTrwJUeJu74ezpHsuwTScy2df6p7cc5ztl2BNmPU3NYC6oXB5mfzpmxO7h4G0Hf10CYsG3TtHBft5/NgTXX9wIptv3nbLOiKsF7E5oIHoq3+nNo+KpbN01GX1xGaO9CANFj/UPRqtdUrKGwjSggtMun4C/K3LY7fd3MbHK6N7P71PFyMSUFyUv0QrK/SFeLV/Eqsr+sg4M950biwi+6HwRr9Xx5Ha3hKnYbzCMXozJImJr+jBTy9QRmiZYXaXmYQfz9pKNxcYm2lG8cIvsWfuX9tydtMPjzVPfVyhvp6hkIzQE9zyIHeYRU5AL/AfHPjl0msvde/aoVVPsKfwEbBb5cHieDbBDj6hqsVfblsQh//tKpyDhORdkJvN5D7iF+hTUCl1Q/EKdNvTqM2apFYTclwwr965p03F9qW7u4cpgHuvbVGC/jKk0NHoUHA0Pw2Q23cwwFjHYb+CS2+bUF4Mc+nNUwdHRhPG119vAvALIRbVayvI0FDCVGE9WMkIjSnMNodft5FnYbaXHhS7P0JDQ5m6YRJlV+ELxTcIXsfc/rQGjH7dRDEzwn/AR8LkPNss0W/LT9BtqSo33UPO2WqjcYjmFSAy7jD66nN
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(376002)(396003)(39860400002)(451199021)(36840700001)(40470700004)(46966006)(4326008)(31686004)(316002)(86362001)(186003)(31696002)(70206006)(70586007)(26005)(47076005)(53546011)(82740400003)(83380400001)(81166007)(2616005)(2906002)(36860700001)(426003)(336012)(5660300002)(44832011)(478600001)(8676002)(40460700003)(16576012)(54906003)(110136005)(40480700001)(8936002)(82310400005)(41300700001)(36756003)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 03:55:44.7956
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 758b6d1e-a7be-4cb4-cf9e-08db7d0bb5a3
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT062.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB10175

Hi Julien and Ayan

On 2023/7/4 20:04, Ayan Kumar Halder wrote:
> 
> On 04/07/2023 12:44, Julien Grall wrote:
>> Hi,
>>
>> On 04/07/2023 12:14, Ayan Kumar Halder wrote:
>>> On 26/06/2023 04:33, Penny Zheng wrote:
>>>> CAUTION: This message has originated from an External Source. Please 
>>>> use proper judgment and caution when opening attachments, clicking 
>>>> links, or responding to this email.
>>>>
>>>>
>>>> This commit wants to introduce a new Kconfig CONFIG_HAS_MMU to guard
>>>> MMU-related codes, to tell two different memory management 
>>>> architecture:
>>>> VMAS and PMSA.
>>>>
>>>> In a VMSA system, a Memory Management Unit (MMU) provides fine-grained
>>>> control of a memory system through a set of virtual to physical address
>>>> mappings and associated memory properties held in memory-mapped tables
>>>> known as translation tables.
>>>>
>>>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>>>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>>>> ---
>>>> v3:
>>>> - new patch
>>>> ---
>>>> Â  xen/arch/arm/Kconfig | 8 ++++++++
>>>> Â  1 file changed, 8 insertions(+)
>>>>
>>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>>> index ff17345cdb..fb77392b82 100644
>>>> --- a/xen/arch/arm/Kconfig
>>>> +++ b/xen/arch/arm/Kconfig
>>>> @@ -60,6 +60,14 @@ config PADDR_BITS
>>>>
>>>> Â  source "arch/Kconfig"
>>>>
>>>> +config HAS_MMU
>>>> +Â Â Â Â Â Â  bool "Memory Management Unit support in a VMSA system"
>>>> +Â Â Â Â Â Â  default y
>>
>> I don't think you can disable HAS_MMU right now. So you want to drop 
>> the description to prevent a user to select it. This could then be 
>> combined to
>>
>> "def_bool y".
>>
>>>> +Â Â Â Â Â Â  help
>>>> +Â Â Â Â Â Â Â Â  In a VMSA system, a Memory Management Unit (MMU) provides 
>>>> fine-grained control of
>>>> +Â Â Â Â Â Â Â Â  a memory system through a set of virtual to physical 
>>>> address mappings and associated memory
>>>> +Â Â Â Â Â Â Â Â  properties held in memory-mapped tables known as 
>>>> translation tables.
>>>> +
>>>> Â  config ACPI
>>>> Â Â Â Â Â Â Â Â  bool "ACPI (Advanced Configuration and Power Interface) 
>>>> Support (UNSUPPORTED)" if UNSUPPORTED
>>>> Â Â Â Â Â Â Â Â  depends on ARM_64
>>>
>>> I don't think you need this option.
>>
>> I think we want to introduce a 'choice' where the user can select 
>> either the MPU or MMU. But not both.
> 
> +1 (I like this approach).

+1 from me

I will introduce the choice "ARM Memory Management Architecture" and 
default HAS_MMU


> 
>>
>> This would be similar to how we select the Physical address space size.
>>
>> Cheers,
>>


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 04:07:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 04:07:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558779.873165 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGtnX-0002s1-3x; Wed, 05 Jul 2023 04:07:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558779.873165; Wed, 05 Jul 2023 04:07:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGtnX-0002ru-0K; Wed, 05 Jul 2023 04:07:23 +0000
Received: by outflank-mailman (input) for mailman id 558779;
 Wed, 05 Jul 2023 04:07:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=TfY/=CX=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qGtnW-0002ro-97
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 04:07:22 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2062f.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6fb72707-1ae9-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 06:07:20 +0200 (CEST)
Received: from AS4P192CA0029.EURP192.PROD.OUTLOOK.COM (2603:10a6:20b:5e1::14)
 by DU0PR08MB8929.eurprd08.prod.outlook.com (2603:10a6:10:464::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 04:07:17 +0000
Received: from AM7EUR03FT060.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:5e1:cafe::b0) by AS4P192CA0029.outlook.office365.com
 (2603:10a6:20b:5e1::14) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.31 via Frontend
 Transport; Wed, 5 Jul 2023 04:07:17 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT060.mail.protection.outlook.com (100.127.140.216) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.18 via Frontend Transport; Wed, 5 Jul 2023 04:07:17 +0000
Received: ("Tessian outbound c08fa2e31830:v142");
 Wed, 05 Jul 2023 04:07:17 +0000
Received: from acd7fb345927.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 B99CBA0F-F56B-4B67-BFF8-CE802C0618F5.1; 
 Wed, 05 Jul 2023 04:07:10 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id acd7fb345927.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 04:07:10 +0000
Received: from AS9PR05CA0280.eurprd05.prod.outlook.com (2603:10a6:20b:492::32)
 by DU0PR08MB9533.eurprd08.prod.outlook.com (2603:10a6:10:44f::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 04:07:09 +0000
Received: from AM7EUR03FT020.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:492:cafe::b3) by AS9PR05CA0280.outlook.office365.com
 (2603:10a6:20b:492::32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 04:07:09 +0000
Received: from nebula.arm.com (40.67.248.234) by
 AM7EUR03FT020.mail.protection.outlook.com (100.127.140.196) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.18 via Frontend Transport; Wed, 5 Jul 2023 04:07:08 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com
 (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 5 Jul
 2023 04:07:07 +0000
Received: from [10.169.172.87] (10.169.172.87) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Wed, 5 Jul 2023 04:07:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6fb72707-1ae9-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3U8hf6nfEf/aYVO3WFhRRHpgwjqUsbYvpp7kXIbyaXk=;
 b=L6ZzQqbJsHLnjVTcwcXlWZ9Aa3YV6SFacK+162926GpJdgDJvVIeV3GXRIKj9O6Rs4Jo9z8MZKuiHzZ1MCCAfGiFZy6lkn9Hb8r3/g+qnSYzJQVejQkQzv+f2UnLG7nrIFj6VV/CW/RuxxpmewSoDXuH8fcXCpM4BKipsIMQ+iA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 0e6577bf4069bfe2
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=XMuhxBo0y0gF8/ARyGrkDH+uIazQBujY5uv3bGSF3Ox0ighqLLe0/cBRYNjJ1ww7XYC5LYUr6q2nl/eHUppqn1iOhE7AyFBThxgzxcJw9Tz9RUNVds1JtzT60qilkS9KOjjpmMTbyWpxVlDsacfd+fNHog4QQzb0dDYQWU0YM1VAxnbx6ZUOZA2MMRKOmp54kfBGY+4ibAVzrN9TWNSLjgfmZ3xxL1cils40eUqN1KqVdcRz8M42QW1i3Nea+42VjM43Prt0FXOZdhh4kdLOmt9ssN9U577VNTSsRSERgQdRvYGV3r/FBEmfPKVPou8ID18fCzPm63GKnhWiNeMulg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3U8hf6nfEf/aYVO3WFhRRHpgwjqUsbYvpp7kXIbyaXk=;
 b=YSmnTU5YNWVr2GieWiaI7FsXimqJNBZi2nqV3lzrYF/hNXS5Shbo5mpy9xHEv7xTTJwuwwhfJoKyAu6yap1Q9zj4/oO33iRzydF6x9okGi02fd6FXaDMdtQA4Vxe6Ew4vvdaNSbW7q5hTAsEFEIL1mRel4GPQNLvKQB5lz2XCAxiai8SaQS4uYnxuJeGLNQZzx9UvAy7HlN56mceEx0sBwiIIPZHc/Wcwkhx8yQIN8YhR3S2ASLVMuXE3UZS38cFOjl/0Xmm+yZCflMCIVdrFjP2yYv5p+Ame/a8cBC4IWXv36GdAFap4C8WIAVwc9X+eDfNLKgFBwhm4lLtRHlvSQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3U8hf6nfEf/aYVO3WFhRRHpgwjqUsbYvpp7kXIbyaXk=;
 b=L6ZzQqbJsHLnjVTcwcXlWZ9Aa3YV6SFacK+162926GpJdgDJvVIeV3GXRIKj9O6Rs4Jo9z8MZKuiHzZ1MCCAfGiFZy6lkn9Hb8r3/g+qnSYzJQVejQkQzv+f2UnLG7nrIFj6VV/CW/RuxxpmewSoDXuH8fcXCpM4BKipsIMQ+iA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <ec0b3255-3195-d479-a07b-2dbfc14634af@arm.com>
Date: Wed, 5 Jul 2023 12:07:02 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 07/52] xen/arm64: prepare for moving MMU related code
 from head.S
Content-Language: en-US
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-8-Penny.Zheng@arm.com>
 <2752bf5a-ae87-8cf9-fe4e-d7c2d7a1a6e5@xen.org>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <2752bf5a-ae87-8cf9-fe4e-d7c2d7a1a6e5@xen.org>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	AM7EUR03FT020:EE_|DU0PR08MB9533:EE_|AM7EUR03FT060:EE_|DU0PR08MB8929:EE_
X-MS-Office365-Filtering-Correlation-Id: 0464847e-27ce-4f26-0d2f-08db7d0d525b
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 JWfM+uZ5M1NgsZ6hfRdjZZjud4EPxnc1KUx1CbqNnqtlpBsd5PHlaJloOCM1xXHgM6h9tC821M7JB+/MihlctOZbrukFgTWaGyZD+FQfEeaYCyXFw++/zA361yDcU0hR30GhT5VWxdateun54J9TXposwCNxyr7Yzwfxo2ipM0u3LRvydveb9yXzzhbVgjPrqM5o5z8ANGIxBA1p4jnStAyPrg1Crf6m2eSmL/QjmY1JmTCWCl/ftO8o7uS74+f+v1I1Hq0D594VgDDD4VhL5YFM7Kwyo4e6FMmLgZVp6kv0RdezntBLWbe2UOgG3xV4ZgaKOrLHaf03YJOVCV58F7DGI25ZUML0dn2ggHtPolVqxX6HzR9SsgObmOMBTZG7bPlu8EvPzOq3/6fuxfx6lW09R058Y7fMCB88OTMQiJqjTlcRecZv0kofu7tqrXLAfNAvqycpWV5GZHfzH7BUO/XqxGBXUcItJu1j/uXiiSvUjWh31jS+Gi2tHB15/Sp5uNKagG0BD7fk8XYKCTbAwVWq4Jw97akuTFqY28eu6EpwaTNEZewRhrHeF0w9U7u8O6hDgt4NesZujXo1pMzUdBzG7cCdY/m/nQ0pGxxQGiH+0o2uHL2JSpXsaeL6IA8gAv5C7pxuAa3O9PTgb1pEstMLjPpXZzpnu/fU5ZlV95a2UUJkuK9rH5VIThoI/lTNjsXDsCjX+yop6ASy6dE7EinY2f5h4ynxx6EOiOi9ebmeUOJ8DZiPq3/R92hbXXrPRfg0mOyMtO/DwNVgZfKn6Jsbk88oOPoAcddW5eUWlGhYtPPuuPrAUKh9sZ+wkwLj1JYgCbyHiysnIXlU59DJbg==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(376002)(136003)(346002)(451199021)(46966006)(40470700004)(36840700001)(2906002)(82310400005)(8936002)(8676002)(54906003)(40480700001)(16576012)(110136005)(36756003)(41300700001)(36860700001)(426003)(336012)(44832011)(5660300002)(478600001)(40460700003)(31696002)(70206006)(70586007)(186003)(53546011)(26005)(86362001)(4326008)(316002)(31686004)(47076005)(81166007)(356005)(2616005)(83380400001)(82740400003)(3940600001)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9533
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT060.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	e9c53b93-6ec3-42ad-e8c6-08db7d0d4cfa
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	5YFp09q9bwIAKkT4Ax/R9gv3zCqtG+57CQ3uec7wZZU8kk4eRCdgcxB6f0D+epNpD8l16m01/KliJjeT/VcAg7QJc8dm5nF6EgzQA+VQ/IBbkV0W4mJlBYl6m3UDDuTDFTTZp5gpTIH9lysKtpynUMNt/XqDjHRyeq9O1aD/Pr7g6ry0s98VZV/fhXuXiYTkhISjVPgZDfVC1D4ktoths6p2osIcB4OlaMfuSfjcOiVpWwsGSNik0iWtU6CYUB2YegQA/qLJI/wD9ekQkZY19G7OTBbjWsq2PUegc8fWQfYm8UxwCIucEilyoao8Bapn3SttBlOvF8/RFuoJM8Xj6bdZpJaTFQivQnwoqy4wGmhO7po1BSgubt6CZBrWeUt1PD+wUVymgUImpaltxhhcSCc5NL2/90OYRLbSQtOPYh6zaxdxCv2XEx3658rXpC2n5zrFsIz31c9H6xFc9RB7YZJwO1pL/zxTltfX9q6EjVavvE3NGADxQ4gEuOBQD2aee/RFa3Xq36Je0MDzbmY/0HxRIMuvJaHXfyS7aKTtCYeRD4oQJqCT2hcCSzn9vZ2dXTnq961i3yfGI/OKiR/1U7feaanmUyElFdqdbwS7kUmNX4kM7aPP86HKrRtKDJlBYKNZ9wYJT8GYVit647EsjqC+Bdv7VuO12100WJRvycDlGivHNUiloCeDMCRT1l0qZfHE5cSSd4erKS2lEGwj/+W5RXZvzQem5wBBigtj2Myazu1exTt4wAVnHd69L+rKUuWtkJXnx5eG+ThYbLTVgv3d/FCH268Cuifa95sn4O8=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(136003)(346002)(376002)(451199021)(46966006)(36840700001)(40470700004)(107886003)(36860700001)(316002)(426003)(41300700001)(186003)(83380400001)(53546011)(31686004)(47076005)(336012)(26005)(2616005)(40460700003)(110136005)(54906003)(82740400003)(16576012)(478600001)(81166007)(44832011)(70206006)(70586007)(4326008)(40480700001)(5660300002)(82310400005)(8676002)(86362001)(31696002)(8936002)(2906002)(36756003)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 04:07:17.2177
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 0464847e-27ce-4f26-0d2f-08db7d0d525b
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT060.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8929

Hi Julien

On 2023/7/5 05:35, Julien Grall wrote:
> Hi Penny,
> 
> On 26/06/2023 04:33, Penny Zheng wrote:
>> From: Wei Chen <wei.chen@arm.com>
>>
>> We want to reuse head.S for MPU systems, but there are some
>> code are implemented for MMU systems only. We will move such
>> code to another MMU specific file. But before that we will
>> do some indentations fix in this patch to make them be easier
>> for reviewing:
>> 1. Fix the indentations of code comments.
>> 2. Fix the indentations for .text.header section.
>> 3. Rename puts() to asm_puts() for global export
>>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>> ---
>> v1 -> v2:
>> 1. New patch.
>> ---
>> v3:
>> 1. fix commit message
>> 2. Rename puts() to asm_puts() for global export
>> ---
>> Â  xen/arch/arm/arm64/head.S | 42 +++++++++++++++++++--------------------
>> Â  1 file changed, 21 insertions(+), 21 deletions(-)
>>
>> diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
>> index 4dfbe0bc6f..66347eedcc 100644
>> --- a/xen/arch/arm/arm64/head.S
>> +++ b/xen/arch/arm/arm64/head.S
>> @@ -94,7 +94,7 @@
>> Â  #define PRINT(_s)Â Â Â Â Â Â Â Â Â  \
>> Â Â Â Â Â Â Â Â Â  movÂ Â  x3, lr ;Â Â Â Â  \
>> Â Â Â Â Â Â Â Â Â  adrÂ Â  x0, 98f ;Â Â Â  \
> 
> This was recently changed to adr_l in staging. So you will need to 
> rebase this patch.

Sure, I'll rebase.

> 
>> -Â Â Â Â Â Â Â  blÂ Â Â  putsÂ Â Â  ;Â Â Â  \
>> +Â Â Â Â Â Â Â  blÂ Â Â  asm_puts ;Â Â  \
>> Â Â Â Â Â Â Â Â Â  movÂ Â  lr, x3 ;Â Â Â Â  \
>> Â Â Â Â Â Â Â Â Â  RODATA_STR(98, _s)
>> @@ -136,22 +136,22 @@
>> Â Â Â Â Â Â Â Â Â  add \xb, \xb, x20
>> Â  .endm
>> -Â Â Â Â Â Â Â  .section .text.header, "ax", %progbits
>> -Â Â Â Â Â Â Â  /*.aarch64*/
>> +.section .text.header, "ax", %progbits
>> +/*.aarch64*/
>> -Â Â Â Â Â Â Â  /*
>> -Â Â Â Â Â Â Â Â  * Kernel startup entry point.
>> -Â Â Â Â Â Â Â Â  * ---------------------------
>> -Â Â Â Â Â Â Â Â  *
>> -Â Â Â Â Â Â Â Â  * The requirements are:
>> -Â Â Â Â Â Â Â Â  *Â Â  MMU = off, D-cache = off, I-cache = on or off,
>> -Â Â Â Â Â Â Â Â  *Â Â  x0 = physical address to the FDT blob.
>> -Â Â Â Â Â Â Â Â  *
>> -Â Â Â Â Â Â Â Â  * This must be the very first address in the loaded image.
>> -Â Â Â Â Â Â Â Â  * It should be linked at XEN_VIRT_START, and loaded at any
>> -Â Â Â Â Â Â Â Â  * 4K-aligned address.Â  All of text+data+bss must fit in 2MB,
>> -Â Â Â Â Â Â Â Â  * or the initial pagetable code below will need adjustment.
>> -Â Â Â Â Â Â Â Â  */
>> +/*
>> + * Kernel startup entry point.
>> + * ---------------------------
>> + *
>> + * The requirements are:
>> + *Â Â  MMU = off, D-cache = off, I-cache = on or off,
>> + *Â Â  x0 = physical address to the FDT blob.
>> + *
>> + * This must be the very first address in the loaded image.
>> + * It should be linked at XEN_VIRT_START, and loaded at any
>> + * 4K-aligned address.Â  All of text+data+bss must fit in 2MB,
>> + * or the initial pagetable code below will need adjustment.
>> + */
>> Â  GLOBAL(start)
>> Â Â Â Â Â Â Â Â Â  /*
>> @@ -520,7 +520,7 @@ ENDPROC(cpu_init)
>> Â Â  * Macro to create a mapping entry in \tbl to \phys. Only mapping in 
>> 3rd
>> Â Â  * level table (i.e page granularity) is supported.
>> Â Â  *
>> - * ptbl:Â Â Â Â  table symbol where the entry will be created
>> + * ptbl:Â Â Â  table symbol where the entry will be created
>> Â Â  * virt:Â Â Â  virtual address
>> Â Â  * phys:Â Â Â  physical address (should be page aligned)
>> Â Â  * tmp1:Â Â Â  scratch register
>> @@ -928,15 +928,15 @@ ENDPROC(init_uart)
>> Â Â  * x0: Nul-terminated string to print.
>> Â Â  * x23: Early UART base address
>> Â Â  * Clobbers x0-x1 */
>> -puts:
>> +ENTRY(asm_puts)
> 
> Can you mention in the comment that this function is only supposed to be 
> called from assembly?
> 
> While you are at it, can you update the comment coding style to:
> 
> /*
>  Â * Foo
>  Â * Bar
>  Â */
> 

Sure,

>> Â Â Â Â Â Â Â Â Â  early_uart_ready x23, 1
>> Â Â Â Â Â Â Â Â Â  ldrbÂ  w1, [x0], #1Â Â Â Â Â Â Â Â Â Â  /* Load next char */
>> Â Â Â Â Â Â Â Â Â  cbzÂ Â  w1, 1fÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  /* Exit on nul */
>> Â Â Â Â Â Â Â Â Â  early_uart_transmit x23, w1
>> -Â Â Â Â Â Â Â  bÂ Â Â Â  puts
>> +Â Â Â Â Â Â Â  bÂ Â Â Â  asm_puts
>> Â  1:
>> Â Â Â Â Â Â Â Â Â  ret
>> -ENDPROC(puts)
>> +ENDPROC(asm_puts)
>> Â  /*
>> Â Â  * Print a 64-bit number in hex.
>> @@ -966,7 +966,7 @@ hex:Â Â Â  .ascii "0123456789abcdef"
>> Â  ENTRY(early_puts)
>> Â  init_uart:
>> -puts:
>> +asm_puts:
> 
> I find odd that you add ENTRY() to the asm_puts() above but not here. 
> However... I can't find any use of asm_puts() outside #ifdef 
> CONFIG_EARLY_PRINTK. So maybe it can be dropped?
> 

True. It is only used under #ifdef CONFIG_EARLY_PRINTK.
I'll drop.

> 
>> Â  putn:Â Â  ret
>> Â  #endif /* !CONFIG_EARLY_PRINTK */
> 
> Cheers,
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 04:47:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 04:47:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558785.873175 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGuPt-0007Ry-6F; Wed, 05 Jul 2023 04:47:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558785.873175; Wed, 05 Jul 2023 04:47:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGuPt-0007Rr-1l; Wed, 05 Jul 2023 04:47:01 +0000
Received: by outflank-mailman (input) for mailman id 558785;
 Wed, 05 Jul 2023 04:46:59 +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 <SRS0=jglA=CX=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qGuPr-0007Rl-3v
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 04:46:59 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [2001:67c:2178:6::1c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f7a523be-1aee-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 06:46:56 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 1E2EE21FEF;
 Wed,  5 Jul 2023 04:46:55 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C4498134F3;
 Wed,  5 Jul 2023 04:46:54 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id NUxpLr71pGTUZgAAMHmgww
 (envelope-from <jgross@suse.com>); Wed, 05 Jul 2023 04:46:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f7a523be-1aee-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688532415; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=aCGeCa7qbtPCvYkrWYPhbR/hRCyt//MCQhsux/9iG7A=;
	b=QOSdzGFeV2jv/2myrV6jC0O7zlUSQ7qkm0AyH1v8iXtMNXOHzN5Z4x47EzflHzfJ3dWCJV
	3jslnFnFgucw73GwIMeobMy+m425wxLL8Xykiugr3z/3LbxK3wy7KTnKiwND8c33w7J0Ng
	EEnXluq6xm5Kn+kss99+KowAOFVtQsM=
Message-ID: <b948ba7d-74f0-30e5-c4d2-4a4d83866d37@suse.com>
Date: Wed, 5 Jul 2023 06:46:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
To: Oleksandr Tyshchenko <olekstysh@gmail.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= <marmarek@invisiblethingslab.com>
Cc: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 vikram.garhwal@amd.com
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
 <b21398eb-2fb2-4fca-dd90-d2c81d8df1c4@epam.com>
 <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop>
 <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>
 <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com> <ZKQF8qq8Oh5E+Fxx@mail-itl>
 <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
 <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------qx8XvgczXPmsLWXaiKapfNYd"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------qx8XvgczXPmsLWXaiKapfNYd
Content-Type: multipart/mixed; boundary="------------jUaAGbGpIYScoQIf0iA9PuiE";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Oleksandr Tyshchenko <olekstysh@gmail.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= <marmarek@invisiblethingslab.com>
Cc: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 vikram.garhwal@amd.com
Message-ID: <b948ba7d-74f0-30e5-c4d2-4a4d83866d37@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
 <b21398eb-2fb2-4fca-dd90-d2c81d8df1c4@epam.com>
 <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop>
 <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>
 <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com> <ZKQF8qq8Oh5E+Fxx@mail-itl>
 <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
 <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
In-Reply-To: <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>

--------------jUaAGbGpIYScoQIf0iA9PuiE
Content-Type: multipart/mixed; boundary="------------DUN3FKe397JPnfjf0FUM1kRY"

--------------DUN3FKe397JPnfjf0FUM1kRY
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMDQuMDcuMjMgMTk6MTQsIE9sZWtzYW5kciBUeXNoY2hlbmtvIHdyb3RlOg0KPiANCj4g
DQo+IE9uIFR1ZSwgSnVsIDQsIDIwMjMgYXQgNTo0OeKAr1BNIFJvZ2VyIFBhdSBNb25uw6kg
PHJvZ2VyLnBhdUBjaXRyaXguY29tIA0KPiA8bWFpbHRvOnJvZ2VyLnBhdUBjaXRyaXguY29t
Pj4gd3JvdGU6DQo+IA0KPiBIZWxsbyBhbGwuDQo+IA0KPiBbc29ycnkgZm9yIHRoZSBwb3Nz
aWJsZSBmb3JtYXQgaXNzdWVzXQ0KPiANCj4gDQo+ICAgICBPbiBUdWUsIEp1bCAwNCwgMjAy
MyBhdCAwMTo0Mzo0NlBNICswMjAwLCBNYXJlayBNYXJjenlrb3dza2ktR8OzcmVja2kgd3Jv
dGU6DQo+ICAgICAgPiBIaSwNCj4gICAgICA+DQo+ICAgICAgPiBGV0lXLCBJIGhhdmUgcmFu
IGludG8gdGhpcyBpc3N1ZSBzb21lIHRpbWUgYWdvIHRvby4gSSBydW4gWGVuIG9uIHRvcCBv
Zg0KPiAgICAgID4gS1ZNIGFuZCB0aGVuIHBhc3N0aHJvdWdoIHNvbWUgb2YgdGhlIHZpcnRp
byBkZXZpY2VzIChuZXR3b3JrIG9uZQ0KPiAgICAgID4gc3BlY2lmaWNhbGx5KSBpbnRvIGEg
KFBWKSBndWVzdC4gU28sIEkgaGl0IGJvdGggY2FzZXMsIHRoZSBkb20wIG9uZSBhbmQNCj4g
ICAgICA+IGRvbVUgb25lLiBBcyBhIHRlbXBvcmFyeSB3b3JrYXJvdW5kIEkgbmVlZGVkIHRv
IGRpc2FibGUNCj4gICAgICA+IENPTkZJR19YRU5fVklSVElPIGNvbXBsZXRlbH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IGJlIG9uZSBQQ0kgcm9vdCBwZXIgYmFja2VuZCBkb21haW4gbmVlZGVkLA0KYnV0IHRo
YXQgc2hvdWxkIGJlIHBvc3NpYmxlLg0KDQoNCkp1ZXJnZW4NCg0K
--------------DUN3FKe397JPnfjf0FUM1kRY
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5RnNVUJbvoPHZ8SlM4KWm8rG+lIkGurq
qu5gu8q8ZMKdsdGC4bBxdQKDKHEFExLJK/nRPFmAuG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rZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------DUN3FKe397JPnfjf0FUM1kRY--

--------------jUaAGbGpIYScoQIf0iA9PuiE--

--------------qx8XvgczXPmsLWXaiKapfNYd
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSk9b4FAwAAAAAACgkQsN6d1ii/Ey/X
7Qf+M/+32XzDj9Apu0VN3QhMqmIhy/Uw6hFSDD5rdGqYcoMAhmBbCpPMbezmjz5iHooz/iVYL/X7
8r1Tyt4Nz9Qb3VtWb949ECOcWwpG0WqPa2EuJmWMqp7tO80IPSWBquT8AAirAMawPZDTrXDhW4df
10TSzf4tZDPa+NCvWAKNqWpYcHVJCMh+1BczMJK+4W3/LYyRj/swqhfSRBp625GXaTSwzfl7QRs1
8TGro4jGs6JGnl8mif/ngDY+eA5uuNOynhTm9UX4/mXuwitB8IvkrIXKepSXldq7p9S46aVW9a5t
R3Pkfi95pgC4gE+5ILUDFqyskSTqukOHZhDtUMMu+w==
=pI1I
-----END PGP SIGNATURE-----

--------------qx8XvgczXPmsLWXaiKapfNYd--


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 04:50:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 04:50:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558789.873185 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGuT2-0000R0-LT; Wed, 05 Jul 2023 04:50:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558789.873185; Wed, 05 Jul 2023 04:50:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGuT2-0000Qt-HZ; Wed, 05 Jul 2023 04:50:16 +0000
Received: by outflank-mailman (input) for mailman id 558789;
 Wed, 05 Jul 2023 04:50:15 +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
 <SRS0=TfY/=CX=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qGuT0-0000Qn-NX
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 04:50:14 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on2062d.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::62d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6c0fca64-1aef-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 06:50:11 +0200 (CEST)
Received: from AM6P192CA0046.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:82::23)
 by AM0PR08MB5474.eurprd08.prod.outlook.com (2603:10a6:208:187::24) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 04:50:08 +0000
Received: from AM7EUR03FT054.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:209:82:cafe::1b) by AM6P192CA0046.outlook.office365.com
 (2603:10a6:209:82::23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 04:50:08 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT054.mail.protection.outlook.com (100.127.140.133) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.18 via Frontend Transport; Wed, 5 Jul 2023 04:50:07 +0000
Received: ("Tessian outbound e2424c13b707:v142");
 Wed, 05 Jul 2023 04:50:07 +0000
Received: from 5a05a42f66ca.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 36360701-CEC2-428C-8901-A80CB4591DB6.1; 
 Wed, 05 Jul 2023 04:50:00 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5a05a42f66ca.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 04:50:00 +0000
Received: from DBBPR09CA0040.eurprd09.prod.outlook.com (2603:10a6:10:d4::28)
 by PAXPR08MB7598.eurprd08.prod.outlook.com (2603:10a6:102:23d::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 04:49:57 +0000
Received: from DBAEUR03FT057.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:d4:cafe::e) by DBBPR09CA0040.outlook.office365.com
 (2603:10a6:10:d4::28) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 04:49:57 +0000
Received: from nebula.arm.com (40.67.248.234) by
 DBAEUR03FT057.mail.protection.outlook.com (100.127.142.182) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.23 via Frontend Transport; Wed, 5 Jul 2023 04:49:57 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com
 (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 5 Jul
 2023 04:49:55 +0000
Received: from [10.169.188.49] (10.169.188.49) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Wed, 5 Jul 2023 04:49:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6c0fca64-1aef-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=swdTSp1OHz6pRb3lKWx8zNqhL4V6IYQGaNzcIZ1z1Kk=;
 b=Yms5JAln4EmeMW/1eSXcT88lg4DN/eQonHbH5f0ELhSbv6ZV4C+AwpHjd4qe5FkoC//24mat494gcAZbjqrEiuUQ4hV58x2sxh0OhwLGnJkk9HvuaKiEQ25gEZ8meXmh43JwkK4VWkfjElhstGfC3yu6c7YuTmFJOorRCMP4zGM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 46063df358373e5b
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LQ3r7h9Ec9+J6k8O+nwdN7wDYOP3Ce5AW2jz2px7eFpbPzrM6CgHCh6vA+oyig/D3eXfY2p65srrzlctucAsn4uUNg2RnWLL+li+amqXMeI5FPY98KppbIkh0uNUO1LzetQrU0DwrJ0j1mRNwBhJeplqmU5lZxfccBHGgcI5Cx9UAZewwwNORVQhQTIjDv9k1a6GzuJHIC1dSIR3iDkVNS1m0zieQY/Y6XfaFntTSdAgalzukYDSO0ebG4bYsc7OZSD1YtW3eJf92HI+mZ4OXjphNy/78dCmYFCAPAIViItZgw7AC0Bh0wfNE6L9QTmP31ge9pBoS5TGv+UDzTsB8g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=swdTSp1OHz6pRb3lKWx8zNqhL4V6IYQGaNzcIZ1z1Kk=;
 b=K1c/fXB+dKTlbrn0xTim7qg8p3hrt3Y0aXn0EpigZNa8owxSfYyARHe3ku+0tGWl/jYJHYb3Mwx9YxK2Fxjd/LZ1EvKS54Vj2iKwfF4ayjmidXvAs21w5PEfH7BWmZ4cIg79p45zL/uu7AuTBruuYKwOOKCbtLdUB1eF5+GVzZIRfxFzEEKHa6LuzudxlKcYW42ntQpqIXt7ugG3SqHaJmNa/cxCMGkBo61qkTNltlaUkDgGg7ZDxi/yXQpf7kZGuZn+L+1jLDUVNhvXHgqVIhv9uw4WEbQsRxYGo33C3jZcNh02lftm8sJWS5bRJkiKRQ5P4ObEsFWupiyKmtB/Dg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=swdTSp1OHz6pRb3lKWx8zNqhL4V6IYQGaNzcIZ1z1Kk=;
 b=Yms5JAln4EmeMW/1eSXcT88lg4DN/eQonHbH5f0ELhSbv6ZV4C+AwpHjd4qe5FkoC//24mat494gcAZbjqrEiuUQ4hV58x2sxh0OhwLGnJkk9HvuaKiEQ25gEZ8meXmh43JwkK4VWkfjElhstGfC3yu6c7YuTmFJOorRCMP4zGM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <7e73b11b-ae4b-a4fb-f9bd-9a95be41d664@arm.com>
Date: Wed, 5 Jul 2023 12:49:51 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 08/52] xen/arm64: move MMU related code from head.S to
 mmu/head.S
Content-Language: en-US
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-9-Penny.Zheng@arm.com>
 <39187006-6220-4b76-ada4-9e5be72b60fe@xen.org>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <39187006-6220-4b76-ada4-9e5be72b60fe@xen.org>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	DBAEUR03FT057:EE_|PAXPR08MB7598:EE_|AM7EUR03FT054:EE_|AM0PR08MB5474:EE_
X-MS-Office365-Filtering-Correlation-Id: 50c76ac5-939d-4c66-9fca-08db7d134e5e
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 R9a9x4rfXeuBekK8D128efJR4uUKMQFrcoEdEh9ZNekKOko6k1bO/DnJO/zdkjqW85/Jzuin89K6lmRLl5pm9PY+eqAzsHv5bEoJB+MDn/yGg+69CAJTGrzf5a8AKEjYvylymAU8AXERJanqWACcWU71sdDFhIQM56U1+R6nsn/jXK3Sizma2o+yH0wVJZdX+/8EbIZcrEGay5AvpfhxnsmD2eXUfaKYwJKYq5G/xRHVUBJ4fY5KB4KEajJaVUxUyxGjqOcEgvlPCn5+p+pMQTNr7Qk//CTwmDt5hJmY2d7/EtjqztPLzQpcgv/2/PmLmmnthTzhO/QPOfQjkb1Pch+lnEy/LdavobigQpr2vzxhQUXEhsE7xOPFPZyTAGxlnWaXpgsZObZiS2an4m2x5XMkDV3ISplvsv2NFkwaErxX3dLE8QrXekxDWs8Dqf6YCryKYCcZzPyuoLBy/awlLw9XjCiDN6jkSM+roREHOqrcbsmsT0CnGhoJMwBhbGmNTDRRyJK3iTS4bVJ/fYA4VOPdBVa+sz1D+3Ia8tLafuuuKDVPLS0wRZ35s3fuC/7O3yiDb/ppEaDGg/EMJhi3yy+fVZtC9cDH5B5+xTa4s6v8IR9lFxqt6EYXzTd3lJHhzs/BRoRPbZJ0LcI1C98t/KczbpnVmxxJvx/cSKJWhBrM/Jo8Rc6eXL9kNup5YLiUB0w3qBS5IgPmwQB5ijG73cRD7xZ2BblpTS2oAttwZhfC89TgBz8i+YzTUtOXedPq5NUQMVgI/KLtE6+1tqTw81xbl5N5cpZee9J4vc/+Iarf8kL16GEjS6YXiQN1DTgVvAo9uLQY0YA2KTUR9J9vNxvFw4LuS8BomaCV4VFrqx0=
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(396003)(376002)(136003)(451199021)(46966006)(40470700004)(36840700001)(54906003)(16576012)(44832011)(26005)(53546011)(186003)(86362001)(31696002)(8676002)(36756003)(2906002)(110136005)(31686004)(8936002)(5660300002)(41300700001)(40460700003)(478600001)(81166007)(40480700001)(4326008)(70586007)(356005)(82740400003)(70206006)(47076005)(2616005)(82310400005)(83380400001)(336012)(316002)(36860700001)(426003)(2004002)(3940600001)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7598
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT054.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	f613f3e7-d000-4c80-9070-08db7d13482c
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	hDyAPrPREbBVKAZJvEFBQq9qDZM82JvqJxhpIjX1ngmD0aL7MkYE8c7y+unR5RMM0Bg9JtUqU3A/q2WiXRVtgiv6JnomoETnAi0qLEOLzsYlY7baGHA94O2SUwTWy0lSgvhmbAIONUX0KvGk1vp8BsRevRc2DZuKY68lFjnF4Injfe04ThV9FuEnbdCSu/K1ffR9UlU5JYsb/d9A1ov8dp0n1XGQ9+1+obUWUYAKtHHc0gUdUmCfxBEXaND0MPHOIU2RzS1SkuuoTnt8mSZJqqU+NPj6PlNbCSInLi6wHU17tfnrSW9Ky5TL0RJfn9RdAx5pmXvoGLOcDcCJ7JppAwIGDLzGSKM4I2OKiZtIyTKnt5Ab/pZbGGguBSbRDG2Et9QG87eqiLz6e0DsrtpiwniKBUypRwVWpHk5CyRPvHo5eyp4AvjJBwz8LgtuDJ5YddSwUOgHuzxTw69gWprYLC3ObmJRVSQtGmrh4iZStI4XnHtnHrDqYIfFGEMHw4do4jqB6pOQx/YbkPWWAH7fUNGSAATb0YaXZYSxf/UmiMYYVWhEwikAwwIZMwwSBf5J97ixWntCwzV/bjaZHIuZN8C4adAigspiejCZUxw05sXYbw7SGZOJtR8FFM3/KkBN8Nhk59qBMQPsaKq/NhovgTgvU72OSRGHPqkE/m5GF8QfjoVqlQNsz7DsC0jn5jbT10OYy3uqcBTzzgb3FC2+NKQ9Lh2y4KD/0ygl37m3TY83bxAulhp7bMatVcfL5csUD5Tq3S5uRWYFh8Sw8/qiTx/NxHwumR8vkPIODmtU3C6ICKOg+XCBz/NzzvXpaeJFzlDmkQBLEWbBsmnX6MRtzA==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(136003)(39860400002)(346002)(451199021)(36840700001)(40470700004)(46966006)(110136005)(54906003)(478600001)(26005)(107886003)(53546011)(336012)(186003)(82310400005)(16576012)(2906002)(4326008)(44832011)(70586007)(41300700001)(8676002)(316002)(5660300002)(82740400003)(8936002)(70206006)(81166007)(86362001)(40460700003)(36756003)(31696002)(36860700001)(40480700001)(83380400001)(47076005)(2616005)(426003)(31686004)(3940600001)(2004002)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 04:50:07.5106
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 50c76ac5-939d-4c66-9fca-08db7d134e5e
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT054.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5474

Hi Julien

On 2023/7/5 05:46, Julien Grall wrote:
> Hi Penny,
> 
> On 26/06/2023 04:33, Penny Zheng wrote:
>> From: Wei Chen <wei.chen@arm.com>
>>
>> There are lots of MMU specific code in head.S. This code will not
>> be used in MPU systems. If we use #ifdef to gate them, the code
>> will become messy and hard to maintain. So we move MMU related
>> code to mmu/head.S, and keep common code still in head.S. We also
>> add .text.idmap in mmu/head.S to make all code in this new file
>> are still in identity map page but will be linked after head.S.
>>
>> As "fail" in head.S is very simple and this name is too easy to
>> be conflicted, so duplicate it in mmu/head.S instead of exporting
>> it.
>>
>> And some assembly macros that will be shared by MMU and MPU later,
>> we move them to macros.h.
> 
> Aren't those macros already shared between head.S and mmu/head.S?
> 

Correct me if I understand wrongly, so you want to remove the mention of 
MPU, and rephrase it to
"
As some assembly macros need to be shared by head.S and mmu/head.S,
we will move them to macros.h.
"

>>
>> Rename enable_boot_mmu()/enable_runtime_mmu() to a more generic name
>> enable_boot_mm()/enable_runtime_mm(), in order to make them common 
>> interfaces
>> to be used for both MMU and later MPU system.
> 
> As mentionned in an earlier patch, I would prefer if the name was 
> correct from the beginning. So this patch will be merely code movement.
> 

Sure. will fix.


>>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> 
> I think this will need a rebase on top of the recent changes in head.S.
> 

Will do in the next version.

>> diff --git a/xen/arch/arm/arm64/Makefile b/xen/arch/arm/arm64/Makefile
>> index 54ad55c75c..0c4b177be9 100644
>> --- a/xen/arch/arm/arm64/Makefile
>> +++ b/xen/arch/arm/arm64/Makefile
>> @@ -8,6 +8,9 @@ obj-y += domctl.o
> 
> [...]
> 
>> -/*
>> - * Macro to print the value of register \xb
>> - *
>> - * Clobbers x0 - x4
>> - */
>> -.macro print_reg xb
>> -Â Â Â Â Â Â Â  movÂ Â  x0, \xb
>> -Â Â Â Â Â Â Â  movÂ Â  x4, lr
>> -Â Â Â Â Â Â Â  blÂ Â Â  putn
>> -Â Â Â Â Â Â Â  movÂ Â  lr, x4
>> -.endm
> 
> I can't find any use of print_reg() in mmu/head.S. So is it necessary to 
> move right now?
> 

True, it is only used in head.S. I'll leave it here.

> [...]
> 
>> diff --git a/xen/arch/arm/arm64/mmu/head.S 
>> b/xen/arch/arm/arm64/mmu/head.S
>> new file mode 100644
>> index 0000000000..2b209fc3ce
>> --- /dev/null
>> +++ b/xen/arch/arm/arm64/mmu/head.S
>> @@ -0,0 +1,453 @@
>> +/*
>> + * xen/arch/arm/mmu/head.S
>> + *
>> + * Start-of-day code for an ARMv8.
>> + *
>> + * Ian Campbell <ian.campbell@citrix.com>
>> + * Copyright (c) 2012 Citrix Systems.
>> + *
>> + * Based on ARMv7-A head.S by
>> + * Tim Deegan <tim@xen.org>
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License as published by
>> + * the Free Software Foundation; either version 2 of the License, or
>> + * (at your option) any later version.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.Â  See the
>> + * GNU General Public License for more details.
> 
> For new file (even split code), please use the SPDX tag. In this case, 
> the following line should be added at the top of the file:
> 
> /* SPDX-License-Identifier: GPL-2.0-or-later */
> 

Sure.

> Cheers,
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 05:55:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 05:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558795.873195 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGvU4-0007Dg-Iy; Wed, 05 Jul 2023 05:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558795.873195; Wed, 05 Jul 2023 05:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGvU4-0007DZ-Fa; Wed, 05 Jul 2023 05:55:24 +0000
Received: by outflank-mailman (input) for mailman id 558795;
 Wed, 05 Jul 2023 05:55:23 +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 <SRS0=dIgq=CX=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGvU3-0007DT-4D
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 05:55:23 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on061f.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::61f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 85a37ffd-1af8-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 07:55:19 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM7PR04MB6807.eurprd04.prod.outlook.com (2603:10a6:20b:104::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 05:55:17 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 05:55:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 85a37ffd-1af8-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=B1BqsiYL5+m39bPN7PLJtgzoBFXFbTrpfksCMx04T+6PD3GMGuTdqhqEVMQgE0nyeZcHQS46ZNj+r9rCnLcdcNt5LF8F8aNIfDmozVQVukx0/NauG4w17oxBXmHBuuamLkbx+X2mjs3FGe8CMZ6r/jUDBeyQwv5xJ00U3iJUXpDAjRfPEIilCL+G6uVDEpAMu5uYObpxquPqLVdfOMTe/iEjLyRmjVD/YRymUgKX8mDh5drJ7eZvTCsgrtJNp+3I4SqS9jBNeKewNrUgVMGsqW4aHqfhqeK0KsFkET19WX4dMrzDjwCFhxl9xBNW4YUhhEYQyOqWPRUr1UiSLKJY8A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=HFXuHwi8MErehPL94LCVzBnn/1tQkS+ll6kwLciD8FE=;
 b=aAZ4S1NwRdvPlw4p/keYHfoiM9kTzsifTbFzwZpIhjQf9KAbVtJKwZxArXXISVvE/zYdsaszgsP5F61rnIMRqxBchALLyAfXTjy96ZX+Mak0DElacBNqpqghXEbZea8w/2exo0TrdndcHJWQw/Tw/OiSRPYCD177kSZx8SSVi4WQDckyPPDHwRfUq/jUczDhgD11AmjqalKGI5muma0szJh+sXec6Fs7bQ9DteoOLZ58vE/MrYyCMeO0wIa/L7Fgb8HDrjkZpmIeF395Fu0vkA/JJ5eNVDqdcILW57F0Ilkrojk6RiYm3p5yWXRSBVJei05PDbfiSASKMWDWEfSBLg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=HFXuHwi8MErehPL94LCVzBnn/1tQkS+ll6kwLciD8FE=;
 b=0Tgbw+QaKrBhnlDfuF8j++B6teNrC1yN6+/WNf6UIyy/uFvVihxr+8JSkVameTmSaZA69/575Czy36VmUU51BFMSZvzqAfLDulCPe9NsFWuGJ5fM4JAs0S95F8pd4/LByJymXacGo53Jd/v/V5pxvy4ZLZ7ozRu2gBBFh9B2sHOmLgB9fqt36OqKs24H7jLzJsXE351vKQ4PX3KBqqzCC+nRzMn/4imRUZoNN4CMD7diBUN8/Kik1btZK7zMSE75WooBObVF4LTjLMvpHC3HxS7UV1DVZd0mB+560R+zWfjJDIX5TJWgvQfoATW5tAOgvLZ+aO3o4T3jsrTyyw8pKw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <86d278fd-e355-8b22-f402-321328be3976@suse.com>
Date: Wed, 5 Jul 2023 07:55:14 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH] x86/asm: Introduce a tailcall pseduo-op
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
References: <20230630152057.2944373-1-andrew.cooper3@citrix.com>
 <e85c73ae-aaba-a649-6bf5-5528b4cf6e95@suse.com>
 <91a3c0b4-04b4-d1ae-e849-f9c23540e0ba@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <91a3c0b4-04b4-d1ae-e849-f9c23540e0ba@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0162.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:99::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM7PR04MB6807:EE_
X-MS-Office365-Filtering-Correlation-Id: 071e4983-6d1b-4093-8b1a-08db7d1c67f9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	CbDVhftS/IErfbX2Xo6D1kzdAPcaValgSeHFJKmWslwEPddkv7PhGeSyJSpTf6qL+dr2xI9mPyE8RCo43YNyXtLJPgvSFJ2zfH0fBvY8k3ROXv0p2SWqpUIQxPt3oVJUp0vqPfvLnhM8jHuQ4pU3G9KvCPF3QcwMkbB+GGMWiuxSmFnTZp5NwHW55YZlc+3uw2ONxiuPUpOVQ2JIHBYH6uLj3bMlUvtHoPTY0HITw+93/nPHIyuAKRqUPWsTUNWEPYFsEcX0etKMvT0KadIRI0JcXyjqRfzA2hIhqqsIB9NFG63KSNjqA5p2SNIckwp6hfRCtPTm1wIGjRqRArhRA5IYdYZYgP/eoPcyYg96m8sNAetJKCPz9iRCXR4aKUSQ7zR4I2LIzmKfC0nzc9Da5gtz36f+Mj5Bgz3cKiXyg/kUZqhUwPYy/SE/tEmBpkfasujQzEJO/1ZzqB5BwF9/JGfjHwuys2XG5cSkS7HT7NelYwJEG06E8ePQuqNICCwvAydiO/hwErj1AgnzWmM+XoFEj/jMJ0p5lbUuKHZM+MVIv33+np08wvabkd4Lt5Tjyf1gRHgnPOyHRu85tVqg8krnU7F+O3DLIbq8jyNIefmmyosYWlZnfOPs9GxLmnhBFLOKRfEXV5ROoT3P4bSIdQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(136003)(39860400002)(396003)(376002)(451199021)(54906003)(6486002)(478600001)(41300700001)(8936002)(8676002)(38100700002)(4326008)(66946007)(66556008)(66476007)(6916009)(316002)(2616005)(186003)(6512007)(6506007)(26005)(53546011)(31696002)(86362001)(5660300002)(2906002)(4744005)(36756003)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-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UZsM1JxblJHL1RrTm4yYWwxZThSVW9LSy81eWxF?=
 =?utf-8?B?eVBWdGtWUWpZaFBvM1dZVGlhZG0zamE5OU5IQjJLVzA2U1VkREZ0bW5TWWtv?=
 =?utf-8?B?TEZUSmJGd3NHb0RFV2JsTFFxVmxDWjNtcDNKYVFlNFhkTEtlWVV3SDZyRnA0?=
 =?utf-8?B?aHdRY1dDVzc1RmVjUi9rZTYwby9DZTY4WGM2aVNVR0pqMXdDYVhwcUd1SzBX?=
 =?utf-8?B?bndzdlpqWlUvZ0dQN3crRGVrYjg5TlkyNmR1a0JFa2U1OUJ2cjdESitoek0w?=
 =?utf-8?B?RjBYcFYzUGRGSEFwM0Y5cysrSmpTeGdTOXZYU0lqNitBY1ZJMlpnOXlEejB1?=
 =?utf-8?B?cGtqRDBuR0FVcWZuQ1V0N3BuRmluRFppL0xDQy9RcjhaWnV4VExzTFVXWVRB?=
 =?utf-8?Q?A0NBiowNIfX4LLCsBAUP8Y55F?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 071e4983-6d1b-4093-8b1a-08db7d1c67f9
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 05:55:16.1074
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: SSaDNt1uC9CrL5rFziLTZrENWCvrCa6gve86Ptyyw2mmBjhRzRwAwoDYNJvwZ+ulFLOzxHO2JAaL9T9j90cn8w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6807

On 04.07.2023 19:04, Andrew Cooper wrote:
> On 04/07/2023 3:29 pm, Jan Beulich wrote:
>> On 30.06.2023 17:20, Andrew Cooper wrote:
>>> It was previously noted that CALL/BUG is a weird combination, but there is
>>> good reason to use this pattern.
>>>
>>> Introduce an explicit tailcall macro make it clearer in context.
>>>
>>> No functional change.
>>>
>>> Reported-by: Jan Beulich <JBeulich@suse.com>
>> Did I? Must have been a long time back, as I don't think I remember us
>> talking about this.
> 
> This was discussed on multiple patch reviews, where I was introducing
> the pattern and you were complaining about the BUG and comment.Â  I can
> drop the tag if you'd prefer.

I'll leave that up to you. As said, it must have been quite some time back.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 06:26:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 06:26:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558799.873205 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGvyG-0002LZ-VF; Wed, 05 Jul 2023 06:26:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558799.873205; Wed, 05 Jul 2023 06:26:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGvyG-0002LS-SH; Wed, 05 Jul 2023 06:26:36 +0000
Received: by outflank-mailman (input) for mailman id 558799;
 Wed, 05 Jul 2023 06:26:35 +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
 <SRS0=jUcB=CX=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qGvyF-0002LM-JP
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 06:26:35 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on2061f.outbound.protection.outlook.com
 [2a01:111:f400:fe13::61f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e1e2a3ac-1afc-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 08:26:32 +0200 (CEST)
Received: from AM6PR10CA0036.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:89::49)
 by DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 06:26:29 +0000
Received: from AM7EUR03FT046.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:209:89:cafe::3d) by AM6PR10CA0036.outlook.office365.com
 (2603:10a6:209:89::49) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 06:26:29 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT046.mail.protection.outlook.com (100.127.140.78) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.22 via Frontend Transport; Wed, 5 Jul 2023 06:26:27 +0000
Received: ("Tessian outbound d6c4ee3ba1eb:v142");
 Wed, 05 Jul 2023 06:26:27 +0000
Received: from 9360983e0b9a.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 EFC8AFB4-6883-4B71-A135-F1E4F4D88581.1; 
 Wed, 05 Jul 2023 06:26:16 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9360983e0b9a.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 06:26:16 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by PAVPR08MB9628.eurprd08.prod.outlook.com (2603:10a6:102:31c::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 06:26:15 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::3861:64c:eb82:afa1]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::3861:64c:eb82:afa1%4]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023
 06:26:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e1e2a3ac-1afc-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OvBBDYnk7AdcK+fQoBH03oejcpKFeolnTm34igi6Iyw=;
 b=imwZ4H3kPOlnsWzLlpQY8eN/hPEV/lbbRimcIdR46d/e8R+n1/WvjlJxE+rmeDepWHZfEgZqrhi+aw3UYqvC0GFaysU0QyHgfgd2Rn+JEJluxFHWyJKPCaDIaedXs7RcwGQSJBYSuYsWSZyzIAzGxWH2nwLnAxEaqMa7n5LTJks=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 2d5c49eec29cb142
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Cal+RpHZUlbkzT3kovTFueXm/CgSIOotho+Qfoyku15KwiiHZ5mvXXQyGOwoxQaOb21wIKNRRFKbsQm7uYu+jiPWx6+PgTIvQ4SZzlQvkkM19Et9LFj1wWwDQNp2g0MxVz1TQWHuGSce/Cl/BdnkB4L3I34oTm5PEvi1CQavr4HW2BLi1OD9lhGhkL4Le+DzxK9OrOFushWsfkOjcncMw5dGmQ+zY/Ftz7eKqe5lZG2M0ej5sjG4KS2/RJS04JVGSsXU3yYqjHSs1pIgpM2wbC0/5riARxG9ifhf/dwWAVF2dZdTPJfTRW6Y30IRjmk+9czoa3Tq6jnd7bfmCJokrQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OvBBDYnk7AdcK+fQoBH03oejcpKFeolnTm34igi6Iyw=;
 b=HQGWcGnar4O/KowZASvO05Le2he2sfoAnlt3jJJplsS+cZ6RmbySuPiNc+jAz/ximHJGm2HqYzQuYHmbiQ6zHQnaOL5sAXa5daomfI5KygNP5V6DeRMPYWKa988+ynGoUB3DNb7pqxbOuwSKYc80szNOoY82sOizWNURwE8TVaFhkUYDqfu/D2wlsDZNn3jVe9O2ffg97odKWYPXTqYceDZy3UBNtwjbHJTwLKrq3pEtJ0hhxCrgThWO6PYd/l5cVS8Bos9WmjQeARhluEeEx6lksvcWHfGhsD9lZjdcfXeOxT8Cm0KEq1X3CywVngIKzLO/TjAgDi1CRv57+/h3Ig==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OvBBDYnk7AdcK+fQoBH03oejcpKFeolnTm34igi6Iyw=;
 b=imwZ4H3kPOlnsWzLlpQY8eN/hPEV/lbbRimcIdR46d/e8R+n1/WvjlJxE+rmeDepWHZfEgZqrhi+aw3UYqvC0GFaysU0QyHgfgd2Rn+JEJluxFHWyJKPCaDIaedXs7RcwGQSJBYSuYsWSZyzIAzGxWH2nwLnAxEaqMa7n5LTJks=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Julien Grall <julien@xen.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, Wei Chen <Wei.Chen@arm.com>, Wei Liu
	<wl@xen.org>, =?iso-8859-1?Q?Marek_Marczykowski-G=F3recki?=
	<marmarek@invisiblethingslab.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: Re: [PATCH 1/2] tools: Fix ifdef for aarch64 that should include also
 arm
Thread-Topic: [PATCH 1/2] tools: Fix ifdef for aarch64 that should include
 also arm
Thread-Index: AQHZmhGAbKd3CRm5gUS5RUtvHum0Za+pg22AgACfM4CAALxdgA==
Date: Wed, 5 Jul 2023 06:26:12 +0000
Message-ID: <C1445DE0-9E12-4FDA-BF75-BB8F16242D3C@arm.com>
References: <20230608135913.560413-1-luca.fancellu@arm.com>
 <66c3d183-460d-4f34-a331-01ac4d65fc9d@perard>
 <a2df163a-ac61-e53b-25dd-fcd33703adf2@xen.org>
In-Reply-To: <a2df163a-ac61-e53b-25dd-fcd33703adf2@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|PAVPR08MB9628:EE_|AM7EUR03FT046:EE_|DBAPR08MB5814:EE_
X-MS-Office365-Filtering-Correlation-Id: fd06fbac-f641-4268-dce2-08db7d20c3c7
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 jTu8rZ3atNTjoLWU+mMH7CqSCTY04GXXt4cl+monxt1SOAoVjBw5mOfVKRz4CJWza/PP8eaN9gi5PuE5CpUiQ+o0LJoqU+tahxbxauA3pGaTEtpw6e6j3BiIDarXosHwY3oVLVSWk3VpXBGN3Jm/yUzrcS2CvPt8B2m7YlRkHrERW2tS/FQRFNYgaUo9Q0TibNhe0V7x0C9iGzIl2rJr8NbHHfbdnpybRKxMhmzUX4re1b3KEMmBl5B1qNrs6Sx92O0nu8+l12Lul4Ev/Eb3ysImEr6ZAAlGM2LI0Azqg9s4WvokYoQGIAPtcRraR1NiDFWG/c4c8zpDEq2BRy0s+WgQMkyVwiLIEAUgV6XWsxvjnwnxX8Dud+iohc4m/R+wB1Q3ez06A9uyBoalbL7rZOJcviqasZHl0WJjylbyUUc1XQ6eZi6uXP2qJRnX42RddXxaxhV/K9M8MeVV/SM9K1ljHGTgtd5+reGDH34IKUBaHGkcdehqfuViD+90uXJMV0yyv2EdKhqOcENHS1cqbgSzqOhkrSl0KQ7yBNgNxiwtd6tarAzsCzmP1/O+foIX/SoEAjoR600/mDTrStSeYwnbP2zH0lTeMxuEErfdec+BzaHEuGPW7gKv68cp+hra9j28iK1pYqUQEA9aitkbZg==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(396003)(376002)(366004)(39860400002)(451199021)(8676002)(2906002)(41300700001)(5660300002)(38070700005)(8936002)(33656002)(36756003)(86362001)(6512007)(6486002)(71200400001)(478600001)(6666004)(83380400001)(26005)(76116006)(186003)(53546011)(66476007)(2616005)(66446008)(54906003)(122000001)(91956017)(6506007)(4326008)(6916009)(66556008)(66946007)(64756008)(38100700002)(316002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="iso-8859-1"
Content-ID: <A7A3209BE5D174408F8A3EDACA5A1E07@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9628
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT046.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	9ca4b8cf-4784-4e39-1898-08db7d20ba87
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	3XjpSWq3O0rTmebQPVB6Mc9bj1IYz3c1f7CtHhojM8Cy9h8Kn9rgQGPNLKnQGGI5avkrCqxPmCTcSg+XrKWzRqUYBPZri3M5zNfOdZgjr7naBNx5yuYT8W8qh+v5Mer68H7KnKqpb7YCQqvZ8Zns8KWvCQtIRcxuqcYKrS7w8QCBfCjnwGCjgrSh/Gr1VJOsfiFGuJdFTpiSfGGw45Oyg8sKa8L3pvCzrLI7FkBjghevjx8HxypXGWOtclnLj/vMZq9rG3yMdhA6BS5Dwi1XlcK8NeWIxn4V8awpK7ezlb7Ftns/WJOXkPxSPv4LHGV13VR1S1Vd/e8esPnH489BER1UTHJyh9JMtAzROt1P86Tsv+zwGXGu9jOxlS9geRIk/mMvvelq1roY2a0PV+cVGoHTRVezAO9CYFHR/ml259yKG6vNFoKi7q/yhLRaaNwoAxCBU54cXEqX0IXvYsGIbQPMC/gShrYpPDRSO0gocrn9nY+VQ2Lq37c88JBXhSR6UXNwUTmH+cHX4AcsFMLshMx3Wb01fxVGUyW8iOu9z9BqzH7zIEWm05D7/3sH+WFujyvYPR9coUYYKuVEqlbvQ1IM0ChqVgWpS+SvwDPASpSXKMNHrXtGVWOd5/3OjOtgf1hy82iiZgQwyF3U/1M/r9HP51ZYJOMARm4iYi80mECIvZe+B2BrAJFUmqR17bNN8CLn8S02PCPTRisHjY1LNpyQhhWQZvBrjzsnQwae9dIbWFa/PGnLp3sDemRjf+Mx
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(346002)(39860400002)(376002)(451199021)(36840700001)(46966006)(40470700004)(2616005)(4326008)(70586007)(70206006)(81166007)(356005)(40480700001)(186003)(86362001)(33656002)(6486002)(6512007)(6666004)(54906003)(6506007)(26005)(478600001)(53546011)(107886003)(36756003)(82310400005)(40460700003)(36860700001)(6862004)(8676002)(8936002)(5660300002)(2906002)(47076005)(41300700001)(82740400003)(316002)(83380400001)(336012);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 06:26:27.9669
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: fd06fbac-f641-4268-dce2-08db7d20c3c7
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT046.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5814



> On 4 Jul 2023, at 20:11, Julien Grall <julien@xen.org> wrote:
>=20
> Hi,
>=20
> Replying here because there is no cover letter (in the future please add =
one if you have more than two patches bundled together).

Sure I will

>=20
> On 04/07/2023 10:42, Anthony PERARD wrote:
>> On Thu, Jun 08, 2023 at 02:59:12PM +0100, Luca Fancellu wrote:
>>> Commit 56a7aaa16bfe introduced some SVE related code that is protected =
by
>>> '#if defined(__aarch64__)', the issue is that this doesn't take into
>>> consideration when the toolstack is compiled for an arm32 Dom0 running =
on
>>> an arm64 platform, it should be able to create SVE enabled guests but w=
ith
>>> the current code it's not.
>>>=20
>>> So fix the issue by compiling the code when the toolstack is compiled f=
or
>>> both arm32 and arm64.
>>>=20
>>> Fixes: 56a7aaa16bfe ("tools: add physinfo arch_capabilities handling fo=
r Arm")
>>> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
>>> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> Acked-by: Anthony PERARD <anthony.perard@citrix.com>
>=20
> I have now committed the series.

Thank you

>=20
> Cheers,
>=20
> --=20
> Julien Grall



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 06:45:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 06:45:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558803.873214 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGwFo-0005k9-Df; Wed, 05 Jul 2023 06:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558803.873214; Wed, 05 Jul 2023 06:44:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGwFo-0005k2-Ap; Wed, 05 Jul 2023 06:44:44 +0000
Received: by outflank-mailman (input) for mailman id 558803;
 Wed, 05 Jul 2023 06:44:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=dIgq=CX=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGwFn-0005jv-20
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 06:44:43 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on2061f.outbound.protection.outlook.com
 [2a01:111:f400:fe12::61f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6b279eac-1aff-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 08:44:41 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM7PR04MB7190.eurprd04.prod.outlook.com (2603:10a6:20b:115::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 06:44:38 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 06:44:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6b279eac-1aff-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=XaAqXhh5BS+ZpvigB0MxceicwQJUuC79/l8rvqRY1fvjJDuVtpzatFRX39kZ51RRpLUla+69cbW9vbZBtpt7uw7SFDT9YG+pfeR+xnFccQ+sVaXa3OYdJSfJZzDWCuM91CSyckBjz9DQGBbbzB5qFIOaRelaeXw1/LJPY1cbnB6SiWShB4aXFWsWpOlQ7GSqCZrfqPSQUJHu4TINjXhKnevmW9tMfNjxzLmRtaKKGzSUnBsQdH82l6y9wBqOPJEfz2iJYXdcExPCI6jpBjj4FFVTx52+i/bjsQ7C+omJtWX0tGBEtF5rs1WRBR2bKkbQtanrzgU9keIGtPyjFL1DfA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=aLiCr+DxF+lItaSvxrFpQBIF77sFEtJ67bAB1dGMkUs=;
 b=OZ8nO03Z5BqRTwqdoi+AcEQpIyEwlvWs0RVrest73uuIdIZPRNOxt03ep7zU3bq6cdY28TSWSHmwUXG+djzM3qL6TMNhSr5pFPUb1ljEeIHqWt6s8rX3945cf3/XzKvTVTgB4/6P6OOroGTSjWlJmcuucF9F5SqggF/Pxn5azIz6HMANqlDxs4P46ss9fELFW3jgOvjo9Wyq5M14hwihFTZJ4w7OVAmsznAQ0CaARj2FFKf5kdV32TSH1+bUF1QpooW/FATEpuV9/LVFDtjhuQzRdxGbNrEqY+6q//EKAnYrJ4iwlTBue1d/zwWrRhkOvUeodCOiCtjRGQH4i3M9GA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=aLiCr+DxF+lItaSvxrFpQBIF77sFEtJ67bAB1dGMkUs=;
 b=GuSLybMddGfcG1u/NPUev1ny7whW9v+b5VQAyq94cWVfjUpZG2T2Xo6YJB88g9hoGMsksTPDdJRuKe8olnHlBtPn+xdEy0lP2UMmqNpumWBbLA0yYIurT4vKahAfnrcsm+tzyl/mN9R4d+g+Lq5Kg48zUPd03Lq7CdjS83rImqdtS+S1uSZ7ju7uYjkQyC/uiHmJtEg/V7YHQ1SN08azQ/V8t0SHQGSwSmJYuYvDkSiiDibxLojzxw0X/QrijGVSV6NoUe/KQVMBnldKQfs8Lu6dGsKSJVIT2eWBNz1egwSYnV+QNBvvDndnveA99zCy2ZS1HzUWX6Dxx+wWGXdIkQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e8cca7e9-c284-b591-1bdc-00d18c01cab7@suse.com>
Date: Wed, 5 Jul 2023 08:44:36 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v3 2/4] xen: Add files needed for minimal ppc64le build
Content-Language: en-US
To: Shawn Anastasio <shawn@anastas.io>
Cc: tpearson@raptorengineering.com, Andrew Cooper
 <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Wei Liu <wl@xen.org>, Shawn Anastasio <sanastasio@raptorengineering.com>,
 xen-devel@lists.xenproject.org
References: <cover.1686667191.git.shawn@anastas.io>
 <d45855963671225b5e20cb0f26da1e7ec64427f2.1686667191.git.shawn@anastas.io>
 <e04c4cc2-21b4-d508-94d2-5fb786df37b7@suse.com>
 <CTCIQ2OTB80O.2W5D3HEB8OWLZ@Shawns-Mac-mini.lan>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <CTCIQ2OTB80O.2W5D3HEB8OWLZ@Shawns-Mac-mini.lan>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0191.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ab::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM7PR04MB7190:EE_
X-MS-Office365-Filtering-Correlation-Id: e03899eb-504f-440d-7cd8-08db7d234de3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	XEPopODXzzfpxJC9uLauPASD+UNJFcp1yfevQ1xcLQiAyvN0OX9uRILwvocXxMYeyK8Ua4YYsuYK46hTFFi3AkL856zgSe6VHWjslYpOUlvyW0BW7qe5fWZSmCR4LXzR9JgErXbcSYGL0DYBFCn1KRZkn8Fqq043VvuZcN/EBizIXCwHpJEogUnDj5Gl8NiyKDegXVD4C2Bnh3nB41KHlmtto9AJcjgjdXsaVCgRgsN5DXyfEPl3q2vYuD35rbHdRyJ89DHDARO/uvpt1U0gwWnUA8W4JNZ7ULGs3uhAmdDXvrWlmYTyEGE7r2iEB4U4Se7YBLlt3lFmMacIzt0/ldXaVSnxSDtlCvdGXI5KfAi8td8TpJD6eplOIK8ak67nUXMlSfOJkW3jBAjgrieT9xIVLZ/b7z4qsN2QUnLd0nFueD9LhLgwtqBLZSa0rpS49EeyUz6grG5yl+EI7ygRc4x/w/ngCqqFKOnTRa15xdfvDHI9+pYfyDQLuDPbGv7OK0Zlx++/oKO/RW6ddNQ/Z8jLIMpifdg+Wl1/eYJ4g5Mdktk0NKpZDNFPpOtl4CokG7QIKGABrwsO0zLiM7NOAtz7rQhIPMBdVOsNygezZ7jzGdtbXUy+VmI0AqU6iZ5xAmEUTyAmdg7f0R+oRJEvgQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(346002)(136003)(376002)(39850400004)(451199021)(31686004)(2906002)(36756003)(8676002)(2616005)(86362001)(31696002)(66556008)(8936002)(5660300002)(6486002)(53546011)(54906003)(26005)(478600001)(186003)(6512007)(38100700002)(6506007)(4326008)(66476007)(6916009)(66946007)(316002)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YmZTemwrQVVBaEpIOFVranFwaUZLTlRZK3NtRUR0c0FDMVpCcmQ0K2RUZ2ZI?=
 =?utf-8?B?SjlyVEloV1dUeFl1VXBiVjdvakFzNjJod2pJZzROQ2Q2UXdYSWJHZ1E0Ukpy?=
 =?utf-8?B?QUtsM25lTFVDTXJheS83MzB6L21rNWptZHc0S2JzRDVHTjBiYTYyemdBaEQ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G5qZmMvL3VQMy9VNjhzeHV4Q0RP?=
 =?utf-8?B?ZkZTRFg3Yk96THlwTG9QRGxUV1B4cEJYWDBJQkg2U3VEUHRDZzl3SkFkT0ta?=
 =?utf-8?B?b3pUWk9wNkFuKzNwbEcweEhKbDBNR3B6WEFsVXgvcngvTUF3Tjg1R2doR2Vh?=
 =?utf-8?B?dHFhZkFhaElRTWxqSXZFdEg1b3AzOVYzdzh4WVpmUVEzRFhwRC9veGZCbXlS?=
 =?utf-8?Q?CeRl5sy9YNSuhRQfExyubW5Bs?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e03899eb-504f-440d-7cd8-08db7d234de3
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 06:44:38.8350
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: qlCH/5EWxW7utxfrAekEzKlRYxrwCPLFBKQwzuuypqgKggnudwyH0tVHhzNU9uscTOqeMXXMm7DcEjt08sfCKg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB7190

On 14.06.2023 18:36, Shawn Anastasio wrote:
> On Wed Jun 14, 2023 at 10:51 AM CDT, Jan Beulich wrote:
>> On 13.06.2023 16:50, Shawn Anastasio wrote:
>>> --- /dev/null
>>> +++ b/xen/arch/ppc/arch.mk
>>> @@ -0,0 +1,11 @@
>>> +########################################
>>> +# Power-specific definitions
>>> +
>>> +ppc-march-$(CONFIG_POWER_ISA_2_07B) := power8
>>> +ppc-march-$(CONFIG_POWER_ISA_3_00) := power9
>>> +
>>> +CFLAGS += -mcpu=$(ppc-march-y) -mstrict-align -mcmodel=large -mabi=elfv2 -mno-altivec -mno-vsx
>>
>> Wouldn't it make sense to also pass -mlittle here, such that a tool
>> chain defaulting to big-endian can still be used?
> 
> Good call. On this topic, I suppose I'll also add -m64 to allow 32-bit
> toolchains to be used as well.

Turns out this isn't quite enough. When trying to test my little bit of
re-basing of Anthony's series, I ran into ld complaining about little
endian input when the target format is big endian (like for the compiler
I'm using a default configured, i.e. big-endian, binutils build). Looks
like we need to pass "-m elf64lppc" to the linker; I'll see if that
helps (and where exactly to put it).

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 06:52:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 06:52:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558809.873224 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGwN6-0007JV-8p; Wed, 05 Jul 2023 06:52:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558809.873224; Wed, 05 Jul 2023 06:52:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGwN6-0007JO-6A; Wed, 05 Jul 2023 06:52:16 +0000
Received: by outflank-mailman (input) for mailman id 558809;
 Wed, 05 Jul 2023 06:52:15 +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
 <SRS0=TfY/=CX=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qGwN4-0007JI-Sq
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 06:52:15 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20612.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::612])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 778b8513-1b00-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 08:52:11 +0200 (CEST)
Received: from AM6P194CA0084.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:8f::25)
 by GV2PR08MB9208.eurprd08.prod.outlook.com (2603:10a6:150:dc::14) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 06:52:08 +0000
Received: from AM7EUR03FT033.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:209:8f:cafe::6a) by AM6P194CA0084.outlook.office365.com
 (2603:10a6:209:8f::25) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 06:52:08 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT033.mail.protection.outlook.com (100.127.140.129) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.23 via Frontend Transport; Wed, 5 Jul 2023 06:52:07 +0000
Received: ("Tessian outbound b11b8bb4dfe8:v142");
 Wed, 05 Jul 2023 06:52:07 +0000
Received: from 931af8c77eb2.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 70E3CBB5-F95C-4EF7-8E48-F653BF855F63.1; 
 Wed, 05 Jul 2023 06:52:00 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 931af8c77eb2.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 06:52:00 +0000
Received: from AM0PR10CA0105.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:e6::22)
 by AS8PR08MB8325.eurprd08.prod.outlook.com (2603:10a6:20b:536::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 06:51:55 +0000
Received: from AM7EUR03FT040.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:208:e6:cafe::26) by AM0PR10CA0105.outlook.office365.com
 (2603:10a6:208:e6::22) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 06:51:55 +0000
Received: from nebula.arm.com (40.67.248.234) by
 AM7EUR03FT040.mail.protection.outlook.com (100.127.140.128) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.23 via Frontend Transport; Wed, 5 Jul 2023 06:51:54 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com
 (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 5 Jul
 2023 06:51:52 +0000
Received: from [10.169.172.87] (10.169.172.87) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Wed, 5 Jul 2023 06:51:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 778b8513-1b00-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=8ksZUMpbt/rL2MzQhztFmxteoi+WCZfgBRkRjHg2eXA=;
 b=SbMFZmlYiPO4T8ViE7DOuJvt2f67XsIxFQ/QELQTiTlpJFDuMZBLVlGBJ2VorIcEO9doDXzN2ZRrKX9iIPWk6juDInX4hdleIvhhypkqn2yrk3zLWfUaxaNYn5DzoVhoCNS5QopqOQjI1Ud8StG63VRebDhib6Sw1wzsBx+4pzM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 14237d68830cfb8b
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=RkSoNPq0KfpKyNLaxtotTRzxevACTjLtsf2x796QVxAMOXY1lG2I/o/qgV6tL1rN9aZnBB56r2w8BRJUTP/vZf34KxA8kGibfyO1G3FwhiBDSpl/FLOLGgvSMBUTooPH5UwHzZM/tZSZki+J3jxyCkuGIzdxpUKLHJ9Gfk3Nstn7lkcSNT4LxahLRICyxDKtJnRoRvy+jz5SCJfkoHxHd3p3qVmwM6fdkh58sZxHTFIMiKtdXyDpAtJduHUvrkIplROn339YUi+71zF3qVEyjdMMSwscpGIxg1L8gUMMcxi1GrBIvEW8cMSlrPOqocOlXSOF6lfzlByyetPwfVcvqA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=8ksZUMpbt/rL2MzQhztFmxteoi+WCZfgBRkRjHg2eXA=;
 b=XWRpGWgs7Dk2e1sy90YJGIAlFmEINn9p7or9b1ML5no9CCguc98/LxjCODe1EUY1O4cFRFB7TbAJjCWFQaH6BpxbxfpaQmFPFEVZxvgcIMLSdu8lNziebxCBSlyT8QjgS2L7HrXt2fvk8ZnM3xqOXcnTsux+k28v4dqUtQHQc+BMy8HsA0uTlSJMR27GC11NcGLXn9F1bJwVDI6JspBWcxIzDLnvP29cmDOgJmZxDXxdYCq96EqVRUaf6mdwdhD5idLc8pslX3PM8N2SEkzkunYAlJ5IW5iF+BW6Ioc5qyQ22j6I2ie3tIzsW24d03XSK/HdKDXoqNjjb5UDTduKlw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=8ksZUMpbt/rL2MzQhztFmxteoi+WCZfgBRkRjHg2eXA=;
 b=SbMFZmlYiPO4T8ViE7DOuJvt2f67XsIxFQ/QELQTiTlpJFDuMZBLVlGBJ2VorIcEO9doDXzN2ZRrKX9iIPWk6juDInX4hdleIvhhypkqn2yrk3zLWfUaxaNYn5DzoVhoCNS5QopqOQjI1Ud8StG63VRebDhib6Sw1wzsBx+4pzM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <02cc1edb-1f69-7fd3-a057-e5b04d2e14f4@arm.com>
Date: Wed, 5 Jul 2023 14:51:47 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 10/52] xen/arm: Move MMU related definitions from
 config.h to mmu/layout.h
Content-Language: en-US
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-11-Penny.Zheng@arm.com>
 <ee493a26-234c-876e-e19f-3708c13cb484@xen.org>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <ee493a26-234c-876e-e19f-3708c13cb484@xen.org>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	AM7EUR03FT040:EE_|AS8PR08MB8325:EE_|AM7EUR03FT033:EE_|GV2PR08MB9208:EE_
X-MS-Office365-Filtering-Correlation-Id: 0dbba41c-af27-4504-1d7d-08db7d2459ad
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 lyBiXVJgYJ7P1cYeP/NzqoZD5d99333CUZdQ626DFrAgYXpSsm9U/cZqXqrbaH7J36XSzOTYk2LFw8Wc+feIJUtYAPZszRwxOSEB3FFCCXVxbHxQnTRvMPZMv0UoT4jysTn6eAsOxroTTK4xizmKt4OT9Bt9IYdxccGsIVADJDfSYyNHw4D57VniStRlxTlCYJhiv7ByXU8G7aR0gIXzPwfUFDpxkZpKMES1pK3VLmAZUxXCZKOPUuBlntnsyhObnX4SVvil61Q+u0jcgkHYjWnsgCT1iTltR5ANSjeNLjfSd4TganX7hsaYXg6w8t+0Qhc4MDx6MZrHOQCRU62S7/xn8kOd+guTE11AizuE5+aM/KODsq0asgieztqUJoI6DjmQ4V0HBMZlqLUQ30PvMD5qSwUoi8niggBh5FBT69xjqhBN4IvIpPY6Wfnprw79hiUPZL7IHWJb3he30INVzRyYB8+viBuLjrTVdzqOEevkhaHkgI+oeSONwPUnjM+x41zI9J/pa5RN3sTtIVroYq2/tDiM+7Db8ICKsaRZVbdJvy1K7WnK6C7E0y8M6scSjejqE0+rphxlUIp5UNw9T73csPBP5YFFUupcw/gmb5yCFeaArSBOLivCHxyNK0l/O3+tY0P1GZ899OY22ZpxD8FPrGgYMCpPt7rAZf+H9BSuOpSmnchRuFzOtND96DCgch8NrOJOuDhsUaUCRbWMwi5mH6rohvpPYUIHcUEUhK3ZJiC3vsvFR8NljvXDavk+lPuZtIlSZcph94w5Rd86cQp3W0Ssjfc4gnXOFXOfrgzwsGEBFRUg7JkUVyTlCBdaixfeaGXSKHMvWy3IzVJzBA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(396003)(346002)(39860400002)(451199021)(46966006)(40470700004)(36840700001)(8936002)(5660300002)(8676002)(31696002)(40480700001)(86362001)(36860700001)(2616005)(40460700003)(426003)(47076005)(356005)(83380400001)(81166007)(82740400003)(41300700001)(70586007)(36756003)(70206006)(16576012)(4326008)(316002)(186003)(336012)(26005)(54906003)(6666004)(110136005)(53546011)(478600001)(30864003)(82310400005)(31686004)(44832011)(2906002)(3940600001)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8325
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT033.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	d98afef1-b9c4-404b-21ca-08db7d2451d8
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	21QLku9TrV2wkcLcrsMT/AJ+20ewFWiSTsbJHtlSyTrZQiJj5V4bsAJ/TYFF/8VfluBpz3ZmJ/N/F5pfpamVoCPLrfb75RLc6oGF7Rz578JwRnos2syrz1/HtRdDIEdX5Pz2Ff5NAx5gwN5B0Xs9a2x2Vyey7ao4vO+HtEmNC31bHfHMSD8I4YTnXs0NjybSRY0Ll65QNDSggf3343p6iSX5oJ1kq06lU4fWSVCUjB9A+TEkNiwVqNMESoCJVvLrzM9s7IJuLmZfKofwMosqPdONT0rQUIUwpCVjxilwEQSXzKfLC0Aud19+0L+95hBYSFlHa+nXbR1aUqCtqeQjOn6u78gq+X+jCmL9PJoeWVqKh+16uTdJzLo04Yn0oXu2PqsQkyEIVMl2MtwGTDsYgxK7zQ8l81cxT9YJIB3i0xtj4taSV3buW5XDa7Ur6/WRinq/b0XPUGaJ011iZBQUbcACp39Z8poFGKhla6uJ5Vy1fTW8EWIivFw6xjjYj6kgkWVxcwG/tjqUTvOG2HHZZZoCTp39+sxGg1fgnRzLKfEL+bjrbImiBn337jkKJuZ0Qh+zVgc1xUZaMt10AxHvQsUOhkE6ruAgrYTj+63U90TT8mqMM14z6oUuq3SUqWnIl9LN1QjQXAaSqlkgfuWJerdzp5n/ah4H2WCfNCX3JlE2dwZRkq3Dy7CBR+9TKK8qixjYDOTIY9DY+R1qfYmI60dckBsfYF5QU5bio6ZpxJQoti4THfAehsq3pEyIjP666iPqFKjXDoRWqPSZWlyFEu5G3WZ92piVZ74e6sEsXaP4KGp3+Hl+hXG8kcvHJ2Fu
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(39860400002)(396003)(376002)(451199021)(40470700004)(36840700001)(46966006)(107886003)(26005)(478600001)(82740400003)(31686004)(6666004)(86362001)(31696002)(2616005)(186003)(81166007)(16576012)(54906003)(4326008)(70586007)(36860700001)(110136005)(83380400001)(336012)(426003)(53546011)(70206006)(316002)(47076005)(5660300002)(8936002)(44832011)(40460700003)(30864003)(41300700001)(2906002)(40480700001)(8676002)(36756003)(82310400005)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 06:52:07.9088
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 0dbba41c-af27-4504-1d7d-08db7d2459ad
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT033.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB9208

Hi Julien

On 2023/7/5 05:54, Julien Grall wrote:
> Hi Penny,
> 
> On 26/06/2023 04:34, Penny Zheng wrote:
>> From: Wei Chen <wei.chen@arm.com>
>>
>> Xen defines some global configuration macros for Arm in config.h.
>> We still want to use it for MMU systems, but there are some address
> 
> Did you mean MPU?
> 

yes, typo

>> layout related definitions that are defined for MMU systems only.
>> These definitions could not be used by MPU systems, but adding
>> ifdefery with CONFIG_HAS_MPU to gate these definitions will result
>> in a messy and hard-to-read/maintain code.
>>
>> So we keep some common definitions still in config.h, but move MMU
>> related definitions to a new file - mmu/layout.h to avoid spreading
>> "#ifdef" everywhere.
> 
> Just to ease the review, can you add some details which one are 
> considered common?
> 

Sure,
IMOï¼Œ the only part left in common is as follows:
```
#ifdef CONFIG_ARM_64

#define FRAMETABLE_SIZE        GB(32)
#define FRAMETABLE_NR          (FRAMETABLE_SIZE / sizeof(*frame_table))

#endif
```
I couldn't figure a proper way to remove the limit for MPU system.

when calculating variable "pdx_group_valid", which is defined as
```
unsigned long __read_mostly pdx_group_valid[BITS_TO_LONGS(
     (FRAMETABLE_NR + PDX_GROUP_COUNT - 1)/PDX_GROUP_COUNT)] = {[0] = 1}
'''

It relies on FRAMETABLE_NR to limit array length. If we are trying to
get rid of the limit for the MPU, it may bring a lot of changes in pdx 
common codes, like, variable "pdx_group_valid" needs to be allocated in 
runtime, according actual frametable size, at least for MPU case.


> Also, this patch will need to be rebased on top of the latest staging.

sure,

> 
>>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>> ---
>> v1 -> v2:
>> 1. Remove duplicated FIXMAP definitions from config_mmu.h
>> ---
>> v3:
>> 1. name the new header layout.h
>> ---
>> Â  xen/arch/arm/include/asm/config.hÂ Â Â Â  | 127 +----------------------
>> Â  xen/arch/arm/include/asm/mmu/layout.h | 141 ++++++++++++++++++++++++++
>> Â  2 files changed, 143 insertions(+), 125 deletions(-)
>> Â  create mode 100644 xen/arch/arm/include/asm/mmu/layout.h
>>
>> diff --git a/xen/arch/arm/include/asm/config.h 
>> b/xen/arch/arm/include/asm/config.h
>> index 30f4665ba9..204b3dec13 100644
>> --- a/xen/arch/arm/include/asm/config.h
>> +++ b/xen/arch/arm/include/asm/config.h
>> @@ -71,131 +71,8 @@
>> Â  #include <xen/const.h>
>> Â  #include <xen/page-size.h>
>> -/*
>> - * ARM32 layout:
>> - *Â Â  0Â  -Â Â  2MÂ Â  Unmapped
>> - *Â Â  2M -Â Â  4MÂ Â  Xen text, data, bss
>> - *Â Â  4M -Â Â  6MÂ Â  Fixmap: special-purpose 4K mapping slots
>> - *Â Â  6M -Â  10MÂ Â  Early boot mapping of FDT
>> - *Â Â  10M - 12MÂ Â  Livepatch vmap (if compiled in)
>> - *
>> - *Â  32M - 128MÂ Â  Frametable: 32 bytes per page for 12GB of RAM
>> - * 256M -Â Â  1GÂ Â  VMAP: ioremap and early_ioremap use this virtual 
>> address
>> - *Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  space
>> - *
>> - *Â Â  1G -Â Â  2GÂ Â  Xenheap: always-mapped memory
>> - *Â Â  2G -Â Â  4GÂ Â  Domheap: on-demand-mapped
>> - *
>> - * ARM64 layout:
>> - * 0x0000000000000000 - 0x000001ffffffffff (2TB, L0 slots [0..3])
>> - *
>> - *Â  Reserved to identity map Xen
>> - *
>> - * 0x0000020000000000 - 0x0000027fffffffff (512GB, L0 slot [4])
>> - *Â  (Relative offsets)
>> - *Â Â  0Â  -Â Â  2MÂ Â  Unmapped
>> - *Â Â  2M -Â Â  4MÂ Â  Xen text, data, bss
>> - *Â Â  4M -Â Â  6MÂ Â  Fixmap: special-purpose 4K mapping slots
>> - *Â Â  6M -Â  10MÂ Â  Early boot mapping of FDT
>> - *Â  10M -Â  12MÂ Â  Livepatch vmap (if compiled in)
>> - *
>> - *Â Â  1G -Â Â  2GÂ Â  VMAP: ioremap and early_ioremap
>> - *
>> - *Â  32G -Â  64GÂ Â  Frametable: 56 bytes per page for 2TB of RAM
>> - *
>> - * 0x0000028000000000 - 0x00007fffffffffff (125TB, L0 slots [5..255])
>> - *Â  Unused
>> - *
>> - * 0x0000800000000000 - 0x000084ffffffffff (5TB, L0 slots [256..265])
>> - *Â  1:1 mapping of RAM
>> - *
>> - * 0x0000850000000000 - 0x0000ffffffffffff (123TB, L0 slots [266..511])
>> - *Â  Unused
>> - */
>> -
>> -#ifdef CONFIG_ARM_32
>> -#define XEN_VIRT_STARTÂ Â Â Â Â Â Â Â Â  _AT(vaddr_t, MB(2))
>> -#else
>> -
>> -#define SLOT0_ENTRY_BITSÂ  39
>> -#define SLOT0(slot) (_AT(vaddr_t,slot) << SLOT0_ENTRY_BITS)
>> -#define SLOT0_ENTRY_SIZEÂ  SLOT0(1)
>> -
>> -#define XEN_VIRT_STARTÂ Â Â Â Â Â Â Â Â  (SLOT0(4) + _AT(vaddr_t, MB(2)))
>> -#endif
>> -
>> -#define XEN_VIRT_SIZEÂ Â Â Â Â Â Â Â Â Â  _AT(vaddr_t, MB(2))
>> -
>> -#define FIXMAP_VIRT_STARTÂ Â Â Â Â Â  (XEN_VIRT_START + XEN_VIRT_SIZE)
>> -#define FIXMAP_VIRT_SIZEÂ Â Â Â Â Â Â  _AT(vaddr_t, MB(2))
>> -
>> -#define FIXMAP_ADDR(n)Â Â Â Â Â Â Â Â Â  (FIXMAP_VIRT_START + (n) * PAGE_SIZE)
>> -
>> -#define BOOT_FDT_VIRT_STARTÂ Â Â Â  (FIXMAP_VIRT_START + FIXMAP_VIRT_SIZE)
>> -#define BOOT_FDT_VIRT_SIZEÂ Â Â Â Â  _AT(vaddr_t, MB(4))
>> -
>> -#ifdef CONFIG_LIVEPATCH
>> -#define LIVEPATCH_VMAP_STARTÂ Â Â  (BOOT_FDT_VIRT_START + 
>> BOOT_FDT_VIRT_SIZE)
>> -#define LIVEPATCH_VMAP_SIZEÂ Â Â  _AT(vaddr_t, MB(2))
>> -#endif
>> -
>> -#define HYPERVISOR_VIRT_STARTÂ  XEN_VIRT_START
>> -
>> -#ifdef CONFIG_ARM_32
>> -
>> -#define CONFIG_SEPARATE_XENHEAP 1
>> -
>> -#define FRAMETABLE_VIRT_STARTÂ  _AT(vaddr_t, MB(32))
>> -#define FRAMETABLE_SIZEÂ Â Â Â Â Â Â  MB(128-32)
>> -#define FRAMETABLE_NRÂ Â Â Â Â Â Â Â Â  (FRAMETABLE_SIZE / sizeof(*frame_table))
>> -
>> -#define VMAP_VIRT_STARTÂ Â Â Â Â Â Â  _AT(vaddr_t, MB(256))
>> -#define VMAP_VIRT_SIZEÂ Â Â Â Â Â Â Â  _AT(vaddr_t, GB(1) - MB(256))
>> -
>> -#define XENHEAP_VIRT_STARTÂ Â Â Â  _AT(vaddr_t, GB(1))
>> -#define XENHEAP_VIRT_SIZEÂ Â Â Â Â  _AT(vaddr_t, GB(1))
>> -
>> -#define DOMHEAP_VIRT_STARTÂ Â Â Â  _AT(vaddr_t, GB(2))
>> -#define DOMHEAP_VIRT_SIZEÂ Â Â Â Â  _AT(vaddr_t, GB(2))
>> -
>> -#define DOMHEAP_ENTRIESÂ Â Â Â Â Â Â  1024Â  /* 1024 2MB mapping slots */
>> -
>> -/* Number of domheap pagetable pages required at the second level 
>> (2MB mappings) */
>> -#define DOMHEAP_SECOND_PAGES (DOMHEAP_VIRT_SIZE >> FIRST_SHIFT)
>> -
>> -/*
>> - * The temporary area is overlapping with the domheap area. This may
>> - * be used to create an alias of the first slot containing Xen mappings
>> - * when turning on/off the MMU.
>> - */
>> -#define TEMPORARY_AREA_FIRST_SLOT    
>> (first_table_offset(DOMHEAP_VIRT_START))
>> -
>> -/* Calculate the address in the temporary area */
>> -#define TEMPORARY_AREA_ADDR(addr)Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  \
>> -Â Â Â Â  (((addr) & ~XEN_PT_LEVEL_MASK(1)) |Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  \
>> -Â Â Â Â Â  (TEMPORARY_AREA_FIRST_SLOT << XEN_PT_LEVEL_SHIFT(1)))
>> -
>> -#define TEMPORARY_XEN_VIRT_STARTÂ Â Â  TEMPORARY_AREA_ADDR(XEN_VIRT_START)
>> -
>> -#else /* ARM_64 */
>> -
>> -#define IDENTITY_MAPPING_AREA_NR_L0Â  4
>> -
>> -#define VMAP_VIRT_STARTÂ  (SLOT0(4) + GB(1))
>> -#define VMAP_VIRT_SIZEÂ Â  GB(1)
>> -
>> -#define FRAMETABLE_VIRT_STARTÂ  (SLOT0(4) + GB(32))
>> -#define FRAMETABLE_SIZEÂ Â Â Â Â Â Â  GB(32)
>> -#define FRAMETABLE_NRÂ Â Â Â Â Â Â Â Â  (FRAMETABLE_SIZE / sizeof(*frame_table))
>> -
>> -#define DIRECTMAP_VIRT_STARTÂ Â  SLOT0(256)
>> -#define DIRECTMAP_SIZEÂ Â Â Â Â Â Â Â  (SLOT0_ENTRY_SIZE * (266 - 256))
>> -#define DIRECTMAP_VIRT_ENDÂ Â Â Â  (DIRECTMAP_VIRT_START + DIRECTMAP_SIZE 
>> - 1)
>> -
>> -#define XENHEAP_VIRT_STARTÂ Â Â Â  directmap_virt_start
>> -
>> -#define HYPERVISOR_VIRT_ENDÂ Â Â  DIRECTMAP_VIRT_END
>> -
>> +#ifndef CONFIG_HAS_MPU
> 
> We are not going to introduce HAS_MPU yet in Xen. So can you use 
> CONFIG_HAS_MMU?
> 
> Also, I would add:
> 
> #else
> # error "Unknown memory management layout"
> #endif
> 

Sure, will do.

>> +#include <asm/mmu/layout.h>
>> Â  #endif
>> Â  #define NR_hypercalls 64
>> diff --git a/xen/arch/arm/include/asm/mmu/layout.h 
>> b/xen/arch/arm/include/asm/mmu/layout.h
>> new file mode 100644
>> index 0000000000..8deda6b84d
>> --- /dev/null
>> +++ b/xen/arch/arm/include/asm/mmu/layout.h
>> @@ -0,0 +1,141 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
> 
> GPL-2.0 is deprecated and should not be used for new file. This should 
> instead be GPL-2.0-only
> 

understood.

>> +
>> +#ifndef __ARM_MMU_LAYOUT_H__
>> +#define __ARM_MMU_LAYOUT_H__
>> +
>> +/*
>> + * ARM32 layout:
>> + *Â Â  0Â  -Â Â  2MÂ Â  Unmapped
>> + *Â Â  2M -Â Â  4MÂ Â  Xen text, data, bss
>> + *Â Â  4M -Â Â  6MÂ Â  Fixmap: special-purpose 4K mapping slots
>> + *Â Â  6M -Â  10MÂ Â  Early boot mapping of FDT
>> + *Â Â  10M - 12MÂ Â  Livepatch vmap (if compiled in)
>> + *
>> + *Â  32M - 128MÂ Â  Frametable: 32 bytes per page for 12GB of RAM
>> + * 256M -Â Â  1GÂ Â  VMAP: ioremap and early_ioremap use this virtual 
>> address
>> + *Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  space
>> + *
>> + *Â Â  1G -Â Â  2GÂ Â  Xenheap: always-mapped memory
>> + *Â Â  2G -Â Â  4GÂ Â  Domheap: on-demand-mapped
>> + *
>> + * ARM64 layout:
>> + * 0x0000000000000000 - 0x000001ffffffffff (2TB, L0 slots [0..3])
>> + *
>> + *Â  Reserved to identity map Xen
>> + *
>> + * 0x0000020000000000 - 0x0000027fffffffff (512GB, L0 slot [4])
>> + *Â  (Relative offsets)
>> + *Â Â  0Â  -Â Â  2MÂ Â  Unmapped
>> + *Â Â  2M -Â Â  4MÂ Â  Xen text, data, bss
>> + *Â Â  4M -Â Â  6MÂ Â  Fixmap: special-purpose 4K mapping slots
>> + *Â Â  6M -Â  10MÂ Â  Early boot mapping of FDT
>> + *Â  10M -Â  12MÂ Â  Livepatch vmap (if compiled in)
>> + *
>> + *Â Â  1G -Â Â  2GÂ Â  VMAP: ioremap and early_ioremap
>> + *
>> + *Â  32G -Â  64GÂ Â  Frametable: 56 bytes per page for 2TB of RAM
>> + *
>> + * 0x0000028000000000 - 0x00007fffffffffff (125TB, L0 slots [5..255])
>> + *Â  Unused
>> + *
>> + * 0x0000800000000000 - 0x000084ffffffffff (5TB, L0 slots [256..265])
>> + *Â  1:1 mapping of RAM
>> + *
>> + * 0x0000850000000000 - 0x0000ffffffffffff (123TB, L0 slots [266..511])
>> + *Â  Unused
>> + */
>> +
>> +#ifdef CONFIG_ARM_32
>> +#define XEN_VIRT_STARTÂ Â Â Â Â Â Â Â Â  _AT(vaddr_t, MB(2))
>> +#else
>> +
>> +#define SLOT0_ENTRY_BITSÂ  39
>> +#define SLOT0(slot) (_AT(vaddr_t,slot) << SLOT0_ENTRY_BITS)
>> +#define SLOT0_ENTRY_SIZEÂ  SLOT0(1)
>> +
>> +#define XEN_VIRT_STARTÂ Â Â Â Â Â Â Â Â  (SLOT0(4) + _AT(vaddr_t, MB(2)))
>> +#endif
>> +
>> +#define XEN_VIRT_SIZEÂ Â Â Â Â Â Â Â Â Â  _AT(vaddr_t, MB(2))
>> +
>> +#define FIXMAP_VIRT_STARTÂ Â Â Â Â Â  (XEN_VIRT_START + XEN_VIRT_SIZE)
>> +#define FIXMAP_VIRT_SIZEÂ Â Â Â Â Â Â  _AT(vaddr_t, MB(2))
>> +
>> +#define FIXMAP_ADDR(n)Â Â Â Â Â Â Â Â Â  (FIXMAP_VIRT_START + (n) * PAGE_SIZE)
>> +
>> +#define BOOT_FDT_VIRT_STARTÂ Â Â Â  (FIXMAP_VIRT_START + FIXMAP_VIRT_SIZE)
>> +#define BOOT_FDT_VIRT_SIZEÂ Â Â Â Â  _AT(vaddr_t, MB(4))
>> +
>> +#ifdef CONFIG_LIVEPATCH
>> +#define LIVEPATCH_VMAP_STARTÂ Â Â  (BOOT_FDT_VIRT_START + 
>> BOOT_FDT_VIRT_SIZE)
>> +#define LIVEPATCH_VMAP_SIZEÂ Â Â  _AT(vaddr_t, MB(2))
>> +#endif
>> +
>> +#define HYPERVISOR_VIRT_STARTÂ  XEN_VIRT_START
>> +
>> +#ifdef CONFIG_ARM_32
>> +
>> +#define CONFIG_SEPARATE_XENHEAP 1
>> +
>> +#define FRAMETABLE_VIRT_STARTÂ  _AT(vaddr_t, MB(32))
>> +#define FRAMETABLE_SIZEÂ Â Â Â Â Â Â  MB(128-32)
>> +#define FRAMETABLE_NRÂ Â Â Â Â Â Â Â Â  (FRAMETABLE_SIZE / sizeof(*frame_table))
>> +
>> +#define VMAP_VIRT_STARTÂ Â Â Â Â Â Â  _AT(vaddr_t, MB(256))
>> +#define VMAP_VIRT_SIZEÂ Â Â Â Â Â Â Â  _AT(vaddr_t, GB(1) - MB(256))
>> +
>> +#define XENHEAP_VIRT_STARTÂ Â Â Â  _AT(vaddr_t, GB(1))
>> +#define XENHEAP_VIRT_SIZEÂ Â Â Â Â  _AT(vaddr_t, GB(1))
>> +
>> +#define DOMHEAP_VIRT_STARTÂ Â Â Â  _AT(vaddr_t, GB(2))
>> +#define DOMHEAP_VIRT_SIZEÂ Â Â Â Â  _AT(vaddr_t, GB(2))
>> +
>> +#define DOMHEAP_ENTRIESÂ Â Â Â Â Â Â  1024Â  /* 1024 2MB mapping slots */
>> +
>> +/* Number of domheap pagetable pages required at the second level 
>> (2MB mappings) */
>> +#define DOMHEAP_SECOND_PAGES (DOMHEAP_VIRT_SIZE >> FIRST_SHIFT)
>> +
>> +/*
>> + * The temporary area is overlapping with the domheap area. This may
>> + * be used to create an alias of the first slot containing Xen mappings
>> + * when turning on/off the MMU.
>> + */
>> +#define TEMPORARY_AREA_FIRST_SLOT    
>> (first_table_offset(DOMHEAP_VIRT_START))
>> +
>> +/* Calculate the address in the temporary area */
>> +#define TEMPORARY_AREA_ADDR(addr)Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  \
>> +Â Â Â Â  (((addr) & ~XEN_PT_LEVEL_MASK(1)) |Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  \
>> +Â Â Â Â Â  (TEMPORARY_AREA_FIRST_SLOT << XEN_PT_LEVEL_SHIFT(1)))
>> +
>> +#define TEMPORARY_XEN_VIRT_STARTÂ Â Â  TEMPORARY_AREA_ADDR(XEN_VIRT_START)
>> +
>> +#else /* ARM_64 */
>> +
>> +#define IDENTITY_MAPPING_AREA_NR_L0Â  4
>> +
>> +#define VMAP_VIRT_STARTÂ  (SLOT0(4) + GB(1))
>> +#define VMAP_VIRT_SIZEÂ Â  GB(1)
>> +
>> +#define FRAMETABLE_VIRT_STARTÂ  (SLOT0(4) + GB(32))
>> +#define FRAMETABLE_SIZEÂ Â Â Â Â Â Â  GB(32)
>> +#define FRAMETABLE_NRÂ Â Â Â Â Â Â Â Â  (FRAMETABLE_SIZE / sizeof(*frame_table))
>> +
>> +#define DIRECTMAP_VIRT_STARTÂ Â  SLOT0(256)
>> +#define DIRECTMAP_SIZEÂ Â Â Â Â Â Â Â  (SLOT0_ENTRY_SIZE * (266 - 256))
>> +#define DIRECTMAP_VIRT_ENDÂ Â Â Â  (DIRECTMAP_VIRT_START + DIRECTMAP_SIZE 
>> - 1)
>> +
>> +#define XENHEAP_VIRT_STARTÂ Â Â Â  directmap_virt_start
>> +
>> +#define HYPERVISOR_VIRT_ENDÂ Â Â  DIRECTMAP_VIRT_END
>> +
>> +#endif
>> +
>> +#endif /* __ARM_MMU_LAYOUT_H__ */
>> +/*
>> + * Local variables:
>> + * mode: C
>> + * c-file-style: "BSD"
>> + * c-basic-offset: 4
>> + * indent-tabs-mode: nil
>> + * End:
>> + */
> 
> Cheers,
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 07:12:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 07:12:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558814.873235 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGwg0-0001Og-U6; Wed, 05 Jul 2023 07:11:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558814.873235; Wed, 05 Jul 2023 07:11:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGwg0-0001OZ-QF; Wed, 05 Jul 2023 07:11:48 +0000
Received: by outflank-mailman (input) for mailman id 558814;
 Wed, 05 Jul 2023 07:11:48 +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 <SRS0=dIgq=CX=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGwg0-0001OT-0H
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 07:11:48 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2058.outbound.protection.outlook.com [40.107.7.58])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 30fda8f6-1b03-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 09:11:41 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB7607.eurprd04.prod.outlook.com (2603:10a6:20b:294::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 07:11:13 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 07:11:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 30fda8f6-1b03-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=mMeWZ27UYPf02Jvg6cjvMS9Gw/MsKy34gwmLqe1H/1/mtCt1KiUapERlUru94A4hM9MazFR9TRFZgNoU5mhdSgSVDAOrtY2J0xjxCgFc4J6vWvpHh+gKZOswrZ4QCl/RUwT/dvWfY3/g717MebHEj7nse/MY9lK3Co0ts7zsKs614ng8aMFhQZOGgUlLW7chjinpl7GA3VS9d3EcjwCW0quIWodrm7Gr/WBVpwy9dn4kZqpEROO+VaBMBzr+aQzo1gBgVzC0KSefUUv8nCJkVGQltP0DD07tOuSf51OgYPwwNkZiIVk0wpitafYTgpy0IhHmNLg+Spyd62HJmnlnHQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=nuLVbEZtZ1EHxumkqm6EimDsQRKWUXczzKwW109ITuY=;
 b=dYjW2bb6h3HQFEGM08FdtAlQnwJVrKGnNKL5ylB2xEy+UGINeb48/UzTVW6qephe/KynZWA07pTWVKhFKIJUHNNzdnK7gGLTRFMKInLkRAlqnHw8G/VfDdeE/HlmRrTTA2QUiAU5jUdix/vcx3L2A6X5p2LlyvNb9mA3HrZPXStVvlOLE+QQpnnqNg55AjKRi4vLbnHtwYwjqHOY/buEnfpgzs9Nf3txWaXW26gOUdp/6ffrldXI1D7SPkBJGZPS8g90/4LECtJOUsiAY/0CtZxamfcYpPQjd7IjFx72t+eC0JzUWTKG4UDDpYIE4GG52naxLRfnH21xeO5fjn9rvQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=nuLVbEZtZ1EHxumkqm6EimDsQRKWUXczzKwW109ITuY=;
 b=16X4xcj/u/TjqqnNCGXWA93PRKmVmImiE9imRbjydi1axSJX4qyrgq4SlMZmkcphAwmTOi7zTo0oWF8F7Iu9vomtFLu3f8EEQRKNoEqFOIXSXs2tGZ5GpAouqYW34esQFNt14TNnwikMztwf2g8VI+1Qh3DmHMPb175XOFptTh+g2lTIBIZSRDMngIKwYgdFCEiCF46vw7KxB1NVdk2yoD51WhnYUX0rosUf6GAJwu+BNLBfp8drqVPA9GIUno8HuIzUtzyy/7It/p9/8p57nXsu25eV+PluzIv2Ad1Lk+puKtUSpQuLgbUWzpa7XbAkPViJ6ps1Laxlexu8HztcEQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ab79bcb6-6fc8-c68f-65bf-16ce7316c3ae@suse.com>
Date: Wed, 5 Jul 2023 09:11:10 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v7 01/12] vpci: introduce per-domain lock to protect vpci
 structure
Content-Language: en-US
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Paul Durrant <paul@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <20230613103159.524763-1-volodymyr_babchuk@epam.com>
 <20230613103159.524763-2-volodymyr_babchuk@epam.com>
 <ZIyOCan//39V3bdy@MacBook-Air-de-Roger.local> <87352kpj04.fsf@epam.com>
 <ZJQDGOrP1I3hR5Jj@MacBook-Air-de-Roger.local> <87ilbfnqmo.fsf@epam.com>
 <ZJVc77SwvyKOEdnJ@MacBook-Air-de-Roger.local> <87wmzfmltd.fsf@epam.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <87wmzfmltd.fsf@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0112.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9d::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB7607:EE_
X-MS-Office365-Filtering-Correlation-Id: 2a8e17fe-30ac-4e06-6fba-08db7d270440
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	fJzxbh1AIhMPuymkWF203UGI6Vr2hmt0Q+Apc9nubamyD+D52JhSweadw2MhLDuWqoGgRS5FIhAk9eUz5S5djejB/7vnMHPLCJ8F9nhX+CWwSGvnuVcyqixfHcsFRWlLjwjNU/MUrgGFDhN1Mt9wJ3gPLyJkJGJUftFg/tOFwrZi4tkARffVFEYhln8kdUoiyqcelFKzCGPdOMPEssn/IMFZRIboq5/hOB/R8s2MOdObXgCaO6OwkBiMAORI+EPvmTWNz1H9xWqbML5vejLOgoyjSaxogOoBuI16D0nazfU7+WpiYDOUt+uveJxVxHZz/37F6YXOZ5egx5sHtorAm4nhFvK5MIw7e5TiYzKydP4I6uFHxPE9Fq4KlYMZIjCq2CmbtGvc17ARmRecYoqO2L2LAsArPIa2xqjPlXYbpW6kw7SBD/fSHxX54Hnr63hAlQUAVjVuwmcx3BAYsJwOxChsgrVVs/lNt0sbF/lZ1sbb3yNjm4Hsk2JkpGZIr6iIuY2u/kDv/eDLyR7JNu8l87HZbMHahy8Ame0Gky4ik7w8c4gf+ov0DcjGI8u6EFFkvz6XSYc5N3Rk5TkqGcE8acfspJ8QC4+eiJvnWPnzjQbpW9eiekKsENr+s9EVzaCpmGcyxn7KDlwYDDp0QZ+ilw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(136003)(396003)(346002)(39860400002)(451199021)(478600001)(54906003)(5660300002)(7416002)(8676002)(36756003)(8936002)(86362001)(2906002)(66556008)(38100700002)(66476007)(66946007)(6916009)(4326008)(31696002)(316002)(41300700001)(83380400001)(26005)(53546011)(31686004)(6506007)(2616005)(186003)(6512007)(6486002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aGxtaGNjYkc3NGhEYitDRTJvb0UxSTBuNDc0N2dzRTAyMVVCbUtGclNIQVVO?=
 =?utf-8?B?Qm1xYVVEem5XWDVzYUVCb0xia0YxTFVDYzZpblpGVy9VVkxXK2tWNFhibzd5?=
 =?utf-8?B?Vmh6em44RUltVHVuQWdNeEM3Zk5ZZThYVVIwd293S0hEWU9TY0pDbkhMc1BM?=
 =?utf-8?B?U200d2lPaTJGUHBnWVRseks3MUpKbFQ0VlBJb2RoRzdaNn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GFUMHdOUWp0M2wzZHc1NFZyMGZESmxCTlFHQjZEMjdV?=
 =?utf-8?B?N0VQNXc4bk9tc0NaZ0xkSkFEcTFqSkc2SSs3aTF4TTB6Um5GZkdWS0FzWlFJ?=
 =?utf-8?B?ek42bnZkS2FCelI1V2dVMUdZNE93ZllwV1UrNXNQU3BEWmp4a01xa2dYM3Iv?=
 =?utf-8?Q?RPKJ4aLuB12O5bCUKXRu1f7oW?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2a8e17fe-30ac-4e06-6fba-08db7d270440
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 07:11:13.3566
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: VCBelxgdfCpwStF+K+g+3vmUp2tl9+3s8C70E9jsPcDuJ7OyQsKJEWY3Mv81ji/Utst3FRBquJ85PALw/TAeZQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7607

On 04.07.2023 23:03, Volodymyr Babchuk wrote:
> I am currently implementing your proposal (along with Jan's
> suggestions), but I am facing ABBA deadlock with IOMMU's
> reassign_device() call, which has this piece of code:
> 
>         list_move(&pdev->domain_list, &target->pdev_list);
> 
> My immediate change was:
> 
>         write_lock(&pdev->domain->pci_lock);
>         list_del(&pdev->domain_list);
>         write_unlock(&pdev->domain->pci_lock);
> 
>         write_lock(&target->pci_lock);
>         list_add(&pdev->domain_list, &target->pdev_list);
>         write_unlock(&target->pci_lock);
> 
> But this will not work because reassign_device is called from
> pci_release_devices() which iterates over d->pdev_list, so we need to
> take a d->pci_lock early.
> 
> Any suggestions on how to fix this? My idea is to remove a device from a
> list one at time:
> 
> int pci_release_devices(struct domain *d)
> {
>     struct pci_dev *pdev;
>     u8 bus, devfn;
>     int ret;
> 
>     pcidevs_lock();
>     write_lock(&d->pci_lock);
>     ret = arch_pci_clean_pirqs(d);
>     if ( ret )
>     {
>         pcidevs_unlock();
>         write_unlock(&d->pci_lock);
>         return ret;
>     }
> 
>     while ( !list_empty(&d->pdev_list) )
>     {
>         pdev = list_entry(&d->pdev_list, struct pci_dev, domain_list);
>         bus = pdev->bus;
>         devfn = pdev->devfn;
>         list_del(&pdev->domain_list);
>         write_unlock(&d->pci_lock);
>         ret = deassign_device(d, pdev->seg, bus, devfn) ?: ret;
>         write_lock(&d->pci_lock);

I think it needs doing almost like this, but with two more tweaks and
no list_del() right here (first and foremost to avoid needing to
figure whether removing early isn't going to subtly break anything;
see below for an error case that would end up with changed behavior):

    while ( !list_empty(&d->pdev_list) )
    {
        const struct pci_dev *pdev = list_first_entry(&d->pdev_list, struct pci_dev, domain_list);
        uint16_t seg = pdev->seg;
        uint8_t bus = pdev->bus;
        uint8_t devfn = pdev->devfn;

        write_unlock(&d->pci_lock);
        ret = deassign_device(d, seg, bus, devfn) ?: ret;
        write_lock(&d->pci_lock);
    }

One caveat though: The original list_for_each_entry_safe() guarantees
the loop to complete; your use of list_del() would guarantee that too,
but then the device wouldn't be on the list anymore if deassign_device()
failed. Therefore I guess you will need another local list where you
(temporarily) put all the devices which deassign_device() left on the
list, and which you would then move back to d->pdev_list after the loop
has finished. (Whether it is sufficient to inspect the list head to
determine whether the pdev is still on the list needs careful checking.)

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 08:20:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 08:20:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558824.873245 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGxkE-0000x3-7R; Wed, 05 Jul 2023 08:20:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558824.873245; Wed, 05 Jul 2023 08:20:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGxkE-0000ww-3y; Wed, 05 Jul 2023 08:20:14 +0000
Received: by outflank-mailman (input) for mailman id 558824;
 Wed, 05 Jul 2023 08:20:13 +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
 <SRS0=TfY/=CX=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qGxkC-0000wq-Ox
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 08:20:12 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2050.outbound.protection.outlook.com [40.107.7.50])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c0ae07f6-1b0c-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 10:20:08 +0200 (CEST)
Received: from DB9PR02CA0015.eurprd02.prod.outlook.com (2603:10a6:10:1d9::20)
 by DU0PR08MB7811.eurprd08.prod.outlook.com (2603:10a6:10:3b5::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 08:19:38 +0000
Received: from DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:1d9:cafe::68) by DB9PR02CA0015.outlook.office365.com
 (2603:10a6:10:1d9::20) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 08:19:38 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT008.mail.protection.outlook.com (100.127.142.107) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.23 via Frontend Transport; Wed, 5 Jul 2023 08:19:38 +0000
Received: ("Tessian outbound b11b8bb4dfe8:v142");
 Wed, 05 Jul 2023 08:19:37 +0000
Received: from b44fa89475cb.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 5374CC0A-280D-4627-8542-F03FB84132A1.1; 
 Wed, 05 Jul 2023 08:19:30 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b44fa89475cb.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 08:19:30 +0000
Received: from DUZPR01CA0264.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4b9::20) by PA4PR08MB5997.eurprd08.prod.outlook.com
 (2603:10a6:102:f0::18) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 08:19:28 +0000
Received: from DBAEUR03FT016.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4b9:cafe::ed) by DUZPR01CA0264.outlook.office365.com
 (2603:10a6:10:4b9::20) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 08:19:28 +0000
Received: from nebula.arm.com (40.67.248.234) by
 DBAEUR03FT016.mail.protection.outlook.com (100.127.142.204) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.23 via Frontend Transport; Wed, 5 Jul 2023 08:19:28 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com
 (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 5 Jul
 2023 08:19:27 +0000
Received: from [10.169.188.49] (10.169.188.49) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Wed, 5 Jul 2023 08:19:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c0ae07f6-1b0c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=H65zncuAIbrAHpYAL+6dBnTEBxkAPNMlypNJxrtcj5E=;
 b=UeZLKvlu5LJ5x5649HploYTKDbWFlQu+Uy4cxEUjlSAM44RzXjzKFtMKLwNzmEocJAXFhkC2BLEfavXXcgNQ2A8h8diIW7qcQCm+Yn9gSnKk/PjUSFmS4+8yidsFAhaQQhbA8PehJ7qWe2W19ewvOtLu36Z+azhmlvWLybp0d+Q=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 55ee9fd851c434ab
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=i3fL1ytcgOFVWMD6Beo5g54fsDE6+9kq7sZ8iiewoHg938N5CMlSgDj8iXnKefqB0fNMpRBXrUIbqheICEp46MmETQ0ips+BRnoMGCl26EVR8bY6lGanoJxqLpppWnJTRRd7aTPiXyIXuWKDaFfY4nh8AV8JjhhXw7qgeeRP4SUYiwRKQggWcQA/cXldfE+awgLw2MK1iS+1AmPA0I5hCnF2c0gLbszo/QphRtsTZlwGCA5Uc3+VW44z0MQxnZEX0EanB/ozBTV9oimltamdUi4YBtgH226rIcWaE8j7IzgQP6teniMwoVlDo5Ifhhkz+DpcS81CzemggPABDNjang==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=H65zncuAIbrAHpYAL+6dBnTEBxkAPNMlypNJxrtcj5E=;
 b=iZM+zILE5k95PjisUsfxtqCiD6kGLpENoqz+Eyd0X4SGmmE+ULIpphwQvGMOViSt1U9E8qieX+R9gieMVh05A6epES9Fe+BjYKTP5OrkVmlrQp2PtHAjv7SxO7rYO8VURFFlbISk1NO5ywUCi7T3BqXM6RvVq8OtI81eP3p9PW3GA9qNb1GW6axTutDw9vc5qYyfKnmTiB/W62jm96KresGGV21VPX86qrzq5GB0HgnzYuPyuQSdS/XkN99kEFMi96w/FNPu/9JVdPq5ztOPluG2c/g+TH9M/dPxvYPh/AAgKQy1iL4uITCqgY4VipaaUXAzaDOCERxWZlpfyd6jrQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=H65zncuAIbrAHpYAL+6dBnTEBxkAPNMlypNJxrtcj5E=;
 b=UeZLKvlu5LJ5x5649HploYTKDbWFlQu+Uy4cxEUjlSAM44RzXjzKFtMKLwNzmEocJAXFhkC2BLEfavXXcgNQ2A8h8diIW7qcQCm+Yn9gSnKk/PjUSFmS4+8yidsFAhaQQhbA8PehJ7qWe2W19ewvOtLu36Z+azhmlvWLybp0d+Q=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <06760592-ab87-c6c8-83df-e9204fdedadf@arm.com>
Date: Wed, 5 Jul 2023 16:19:23 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 11/52] xen/arm: mmu: fold FIXMAP into MMU system
Content-Language: en-US
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-12-Penny.Zheng@arm.com>
 <1be18c29-511e-27eb-0970-adaa1c74ce82@xen.org>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <1be18c29-511e-27eb-0970-adaa1c74ce82@xen.org>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	DBAEUR03FT016:EE_|PA4PR08MB5997:EE_|DBAEUR03FT008:EE_|DU0PR08MB7811:EE_
X-MS-Office365-Filtering-Correlation-Id: 9ecacef2-2809-4f9d-7c2b-08db7d3092f1
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 FytR5ABOjMblgM41p0DmG+a7ETKMoD74boiLbSwja2VwIqhzGt2IEYKB8qVmTHajN/0rSw1W8RueeH+XZkv4v/Mu509vwZAOafV/652/MrCKNYmOpfGHogPF5pQbewxZH1WSW/Kyk1SDb5LDqJgaIrmb0MJfz1MV0zQPhs/FGTN/KOAAfHNHfhWAHbWUxmSxJAKjeeVXYXKyVaHQDApscNF6v4D+ei0oti1a1pL7a91B6tkbQBsqeOdaLXB0pZk8e+NTmKPU9so8Jn0TXckG46A+j8jTejwAM4UPehHuQSk5LWX4NnqqG8cFe73QM0FDaz2Pv5T/Y3ow//Q+DZ7atTeHpacYoFn6eHdjWLVOwuV0OfoahHus23hkjzqDnvef7OZNwMoY+zVTtpRGtb01KkJlGsg58DMKu7Mt5uBMGJfn+l6spsVlcMdJCPEGIlNkLGaMplxdPD1jEaui+jk2EF9pEthFgDF8jDiAmeDtJNpnpEBek9JkzGmGE/2LGauAmvp9VtSjyq9oA2+Ig2Ut+T9XfCpAunTGPdhE97D3ppLw0lgQJAuUur4zAFwSVFsqIyuECamfIQw41ODujp9ge96SqhaEHIxxfHHlUWudKUqjIdSHM1to2M4P6Aqd5kKql13w3Bt34GJDNGtCVbwBKHcrBYyGfyXUcMoOlY8jnf1m+6TgDgYPLlVCviAd6yLM4g0SOXKW2HoqIWRKipZ1aXjF7XovjRQQGQdksIgO9BS5hD30P0ilEYc+qnQA/JHMAbmAoztTSDp7dVQNr861vtv33QMeEVlLO22VlzL2veNOZNQyECGe4Gl50zvvowrYFqNnBzMyGzYMfrRlB7RwGQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(376002)(136003)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(54906003)(16576012)(44832011)(53546011)(186003)(26005)(86362001)(31696002)(8676002)(36756003)(2906002)(110136005)(31686004)(8936002)(5660300002)(41300700001)(40460700003)(478600001)(81166007)(40480700001)(4326008)(70586007)(356005)(82740400003)(70206006)(47076005)(2616005)(336012)(82310400005)(83380400001)(316002)(36860700001)(426003)(3940600001)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB5997
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	9000dc77-78c0-44f0-bd4f-08db7d308cfc
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	9zJNNDQWNGBN2OiVLTTxhiEzb/zhQSFyKbW4QntNpdIDlxg9LjHcy7vIb7T9mzb7gqvXOu9eWdU7QV9ikVKpGo+WK3CC+kpBIaCCN55hnLOfXbzUhZSvGFXZpPq8kEl/SoHq+nmztZu+JXqkw/Mk/jfds63VB8b4IntMKjle5XAW8kV+v+o05c70m3wNhGetnYaE0qHl76ccKsUInwWXUWhk2R1USJ0Y+0RlbwzTvndgmB+L+6YLOkzT6aJU+BZ3eiOkM44w7hw/chqvsNx4EfNqmkxygU8SLsfeHzoEZ4TXNtOFKf2FRBpm60J62R+9Ux0/P3nc6ks3b0VnhN/Qig6uBSzImb4cBkqr8ujqrGF9HzTZ/KAe/Qr+6KiXB+awcjTfoduf0ZZL/gBlxxE2/vTblUWFR3GLEhIIs1njPzijJHFV0/7Uk9TIlbR6sdDO1yGa3Hfla2g9RvvEvV9ZZ8jt1dSAJsPpwtcJYGDZm/SUbwJVlR68T91lMXQ+BD83FmGiPY5kNzMernKZfSjn284FeQXnMcrM+t0SydFcHBBj/3gLgDXl4xQybLW6UfXIEw6NlcA1mE3Q4ezEFh7pSCZ1xS9iJ3DSQ+4T1IN9eNmfNg5Nrfl5vKST0nUuhKhD5EiJT+3/jumv2HhNhIwa8ILr9Icj6bzYbRUsz3atlchoCiq4EOZaJoV/2vkxoPTHVPbWs6a+18eea/wNX8/oU1Ew5j4eEZzN+/J+DgsmJHVdEF6W+PxZIVNzEG/4A0nZ+qGqVOSdjR8uSUtZuwJrrh8HAszwWDaZM8FDr0MUoZMDL2+Hi8dV2BdZ0gUVXH7p
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(39860400002)(136003)(376002)(451199021)(46966006)(40470700004)(36840700001)(81166007)(316002)(70586007)(70206006)(40460700003)(16576012)(82740400003)(40480700001)(4326008)(186003)(26005)(53546011)(478600001)(36860700001)(31696002)(110136005)(54906003)(47076005)(82310400005)(336012)(31686004)(2616005)(426003)(83380400001)(8936002)(2906002)(5660300002)(44832011)(36756003)(86362001)(8676002)(41300700001)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 08:19:38.0258
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 9ecacef2-2809-4f9d-7c2b-08db7d3092f1
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7811

Hi,

On 2023/7/5 06:12, Julien Grall wrote:
> Hi,
> 
> On 26/06/2023 04:34, Penny Zheng wrote:
>> FIXMAP in MMU system is used to do special-purpose 4K mapping, like
>> mapping early UART, temporarily mapping source codes for copy and paste
>> (copy_from_paddr), etc.
>>
>> As FIXMAP feature is highly dependent on virtual address translation, we
>> introduce a new Kconfig CONFIG_HAS_FIXMAP to wrap all releated codes, 
>> then
>> we fold it into MMU system.
>> Since PMAP relies on FIXMAP, so we fold it too into MMU system.
>>
>> Under !CONFIG_HAS_FIXMAP, we provide empty stubbers for not breaking
>> compilation.
> 
> Looking at the end result, I can't find any use of set_fixmap() in the 
> common code. So I am not sure this is warrant to provide any stubs (see 
> above).
> 

Yes, you're rignt.

I think we do not need to provide stubs for set_fixmap/clear_fixmap, or
even for virt_to_fix(), if we change the static inline virt_to_fix()
to the definition in mmu/mm.c

>>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> ---
>> v1 -> v2
>> - new patch
>> ---
>> v3:
>> - fold CONFIG_HAS_FIXMAP into CONFIG_HAS_MMU
>> - change CONFIG_HAS_FIXMAP to an Arm-specific Kconfig
>> ---
>> Â  xen/arch/arm/KconfigÂ Â Â Â Â Â Â Â Â Â Â Â Â  |Â  7 ++++++-
>> Â  xen/arch/arm/include/asm/fixmap.h | 31 ++++++++++++++++++++++++++++---
>> Â  2 files changed, 34 insertions(+), 4 deletions(-)
>>
>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>> index fb77392b82..22b28b8ba2 100644
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -15,7 +15,6 @@ config ARM
>> Â Â Â Â Â  select HAS_DEVICE_TREE
>> Â Â Â Â Â  select HAS_PASSTHROUGH
>> Â Â Â Â Â  select HAS_PDX
>> -Â Â Â  select HAS_PMAP
>> Â Â Â Â Â  select IOMMU_FORCE_PT_SHARE
>> Â  config ARCH_DEFCONFIG
>> @@ -63,11 +62,17 @@ source "arch/Kconfig"
>> Â  config HAS_MMU
>> Â Â Â Â Â  bool "Memory Management Unit support in a VMSA system"
>> Â Â Â Â Â  default y
>> +Â Â Â  select HAS_PMAP
>> Â Â Â Â Â  help
>> Â Â Â Â Â Â Â  In a VMSA system, a Memory Management Unit (MMU) provides 
>> fine-grained control of
>> Â Â Â Â Â Â Â  a memory system through a set of virtual to physical address 
>> mappings and associated memory
>> Â Â Â Â Â Â Â  properties held in memory-mapped tables known as translation 
>> tables.
>> +config HAS_FIXMAP
>> +Â Â Â  bool "Provide special-purpose 4K mapping slots in a VMSA"
> 
> 
> Regardless what I wrote above, I don't think a developer should be able 
> to disable HAS_FIXMAP when the HAS_MMU is used. So the 3 lines should be 
> replaced with:
> 
> def_bool HAS_MMU

Understood, will fix

> 
>> +Â Â Â  depends on HAS_MMU
>> +Â Â Â  default y
>> +
>> Â  config ACPI
>> Â Â Â Â Â  bool "ACPI (Advanced Configuration and Power Interface) Support 
>> (UNSUPPORTED)" if UNSUPPORTED
>> Â Â Â Â Â  depends on ARM_64
>> diff --git a/xen/arch/arm/include/asm/fixmap.h 
>> b/xen/arch/arm/include/asm/fixmap.h
>> index d0c9a52c8c..1b5b62866b 100644
>> --- a/xen/arch/arm/include/asm/fixmap.h
>> +++ b/xen/arch/arm/include/asm/fixmap.h
>> @@ -4,9 +4,6 @@
>> Â  #ifndef __ASM_FIXMAP_H
>> Â  #define __ASM_FIXMAP_H
>> -#include <xen/acpi.h>
>> -#include <xen/pmap.h>
>> -
>> Â  /* Fixmap slots */
>> Â  #define FIXMAP_CONSOLEÂ  0Â  /* The primary UART */
>> Â  #define FIXMAP_MISCÂ Â Â Â  1Â  /* Ephemeral mappings of hardware */
>> @@ -22,6 +19,11 @@
>> Â  #ifndef __ASSEMBLY__
>> +#ifdef CONFIG_HAS_FIXMAP
>> +
>> +#include <xen/acpi.h>
>> +#include <xen/pmap.h>
>> +
>> Â  /*
>> Â Â  * Direct access to xen_fixmap[] should only happen when {set,
>> Â Â  * clear}_fixmap() is unusable (e.g. where we would end up to
>> @@ -43,6 +45,29 @@ static inline unsigned int virt_to_fix(vaddr_t vaddr)
>> Â Â Â Â Â  return ((vaddr - FIXADDR_START) >> PAGE_SHIFT);
>> Â  }
>> +#else /* !CONFIG_HAS_FIXMAP */
>> +
>> +#include <xen/mm-frame.h>
>> +#include <xen/errno.h>
> 
> I think they should be included outside of #ifdef.
> 
>> +
>> +static inline void set_fixmap(unsigned int map, mfn_t mfn,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned int attributes)
>> +{
>> +Â Â Â  ASSERT_UNREACHABLE();
>> +}
> 
> If there is an interest to have a stub, then I think we should be using 
> BUG() because if this gets call, then it would likely crash right after 
> when the user tries to access it.
> 
>> +
>> +static inline void clear_fixmap(unsigned int map)
>> +{
>> +Â Â Â  ASSERT_UNREACHABLE();
> 
> This one might be OK with ASSERT_UNREACHABLE(). Yet, it might be best to 
> use BUG() as nobody should use it.
> 
>> +}
>> +
>> +static inline unsigned int virt_to_fix(vaddr_t vaddr)
>> +{
>> +Â Â Â  ASSERT_UNREACHABLE();
>> +Â Â Â  return -EINVAL;
> 
> This is a bit of a random value. This may or may not be mapped. And 
> therefore any user of the return may or may not crash.
> 
> Overall, it feels like we are trying to just please the compiler by 
> writing bogus stubs. It is going to be hard to get them correct. So it 
> would be better if we have no use of the 3 helpers in the common code.
> 

Agree.

> 
>> +}
>> +#endif /* !CONFIG_HAS_FIXMAP */
>> +
>> Â  #endif /* __ASSEMBLY__ */
>> Â  #endif /* __ASM_FIXMAP_H */
> 
> Cheers,
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 08:24:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 08:24:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558828.873255 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGxoJ-0001Vw-Od; Wed, 05 Jul 2023 08:24:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558828.873255; Wed, 05 Jul 2023 08:24:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGxoJ-0001Vp-La; Wed, 05 Jul 2023 08:24:27 +0000
Received: by outflank-mailman (input) for mailman id 558828;
 Wed, 05 Jul 2023 08:24:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=dIgq=CX=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGxoI-0001Vj-4u
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 08:24:26 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2080.outbound.protection.outlook.com [40.107.13.80])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 59487273-1b0d-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 10:24:24 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBAPR04MB7301.eurprd04.prod.outlook.com (2603:10a6:10:1a7::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 08:23:55 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 08:23:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 59487273-1b0d-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Jt/1kXTXvCHxycOkJSj4KJvixTT6Z6FZ7voH0tKiO4Y/DZkCkU4HMmLC6+DP9sOfvHphwc8kgcS3ntBqVCOTpJ7DyxjswJAogZcAUopVzWwHTeYiAjOGUqlC4PUxAN87BtfeeGk3nJQIlZnynlsmfSk4SIRG5vec32poBEBtv9DbECnw3oMf/XhWcR18Km63bDntO5X9XUmpUMXU3x6dkcxYbPcHz0IJvdZQ+ZnKlGWrK/dbB/FzhYLlETND4b6cZOdt5/OeSOQUdcITVSJHg9II7xt0KNew6qIrkiblRvTZsAfbzLq7wXABzCOr1RL6mKuWfymS6K583LYLSfvc6w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=gzP53CUvL61s5cwnMZVLJQ+3rnRe65zdq1D2pvuVoc8=;
 b=odI3JXyVxfTGukZLnShlZWHnswAV0I5EiMUFELoiHla3ulwod97BsK+vwLb6+uCg9dOv9QR/2IELEmB5gC3z2PKRtRdUFQ1ndjnmiahkveFWPxTZsvLoThbA1ncHEYp+n5h1V4L9IDWrMYARJB2ltIFhgAtInwYOsQ7ca77seT6sxSXzOhZxN8ObiU8zUJbPOBWWfrC90LTL3hXTHAcRI3tNTAUp62zT4BhTOFN3+63w/6GtwAi/1FehTemCUSJeh1dW1bo7j2WOJ9LpSBLN3ELXhObXWY1pVA6t5uLBVvFICGesLUdbClAJut9DNxg97XTM8D7R8eYH1cjKKQmO1w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=gzP53CUvL61s5cwnMZVLJQ+3rnRe65zdq1D2pvuVoc8=;
 b=kgv9Mz6IC4RsdgqFKJNg95kusKJ8tR7Ql9r1t5uxyswhTYJ0fQfmoEtFVX5CTk+cOLAsRuvhfnvfKfDuCJ+VczDD0qgazRpdWL+EWrKG+qyA0rIvyFxmW5RhmhtcFsTthmoSZamdLd4pDMO24cfLDzz7H2HvNuT0ay0l68yYrUugTwC7GjNf8aSCcp9sNt+O0Sp1wslxBm77mZjuFzHeMwMS4dS9DRP8IQDNHEdT+YKXeAYSMVX5i9pmJzM5XVT6BTuGuqS+YKKqZfEm2YwBc2exUmesmerPB+QwdsocjdUe9so/Q4j6CxU604GLdgtgR3oEJ0wqEmLxGAPaB/5LlA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3773dc6e-9d36-ba80-2a0a-bb1589c9993f@suse.com>
Date: Wed, 5 Jul 2023 10:23:53 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 1/2] x86/mm: add API for marking only part of a MMIO
 page read only
Content-Language: en-US
To: =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>
Cc: Paul Durrant <paul@xen.org>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.dd82aca339854e90ffe12e7bc4298254a6caaf0d.1683321183.git-series.marmarek@invisiblethingslab.com>
 <def382a6481a9d1bcc106200b971cd5b0f3d19c1.1683321183.git-series.marmarek@invisiblethingslab.com>
 <f3531050-fb31-2d9e-f3dd-2d310dc7c5ec@suse.com> <ZJ9XFdGhxyKLY3fm@mail-itl>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZJ9XFdGhxyKLY3fm@mail-itl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0149.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:95::20) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBAPR04MB7301:EE_
X-MS-Office365-Filtering-Correlation-Id: f3b53a5e-5e89-4b51-a533-08db7d312c0a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	rhr4mqgpENL4H2PBbTTnUGiFHVl30rSwcKQ5NO4Kiu+8jOkyrn/PnMrX+0xv+8w8L8hpOvbjBtcQ7Fs3CAUYdsoPLs6/u1Wtp+KTI5JNtA42/lX/Ws9XCXjvhnU9eV6eKPEQXOiGo+12QiL9bBwkNfOJsU5KRaVSxLQjESXzFoLw6BVVb1V8Y0wDCvSLtR/K6VrC2bZ0zjIWsqHmOqt4m36FGHGFeGlAxgfW1VdjBBMg4LLduSEfMKLYhr1ICDiaCahy6K37BF1QADVjWrbnJivGb/WVDTMLeWX2ovYd3mggxvaJ20lhpEHxzPE48y4XOxmslp9E/Og1m3WSumNxTBADZdePvuQgovoe/2EXO5EWCHuFcrQMR7zYRkvUCX0C7Gms1YW4IATr5ZtNRtQd2K/j0eOzot3WiLcKCbfqEDHz0DxdgGkDJGDWis0yfRrBQOHBCzd1t8bCrgEc0VKVKNr95gVF5ugsVzzvQrMQtHmF9waxP/JJ/5OUY8nNq0ZUZ50Wq/Y9DrOKQooNCMWpVgYU68MmTkAEt1sYuaJV4VHRIIq4GCexBxVTLf3IzHqJldgGtcnBCG0G3hNc4VmqfEyLinY0DN9jOMla7qVdk2T5i8BYdIMw8UzYYUkTeG5WZwTOpDGXsfJPCcSWNAoRzQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(136003)(39850400004)(366004)(396003)(451199021)(31686004)(2906002)(66899021)(5660300002)(86362001)(31696002)(8676002)(66556008)(8936002)(2616005)(6506007)(54906003)(53546011)(6512007)(6486002)(478600001)(26005)(186003)(30864003)(38100700002)(316002)(66574015)(83380400001)(4326008)(66476007)(66946007)(6916009)(36756003)(41300700001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?T2pucHlJT24vT212WVFNOHVwaWplaWx3Ym9CQ3NnMHRJZnJFaFNhSjBjQ0lO?=
 =?utf-8?B?WDZ2TzhvZVZSOXF2RUVSYVpRSlBTUEJPaEU2NFRMbE9UbVlBWGlIWHBpQ1E0?=
 =?utf-8?B?T2RRR3UySEVXTlcwK3VBOEVJaXVmRU1YbDBraXhYRXlyUVNmaUZPZTI0bW1J?=
 =?utf-8?B?d2RrY0tpMnJTNTNCZ1IwMVpiWWZwcVUzSktRV2FtK2xyb0pVQ1plRGdJN2Fo?=
 =?utf-8?B?Q2hFeWd2ck9FUVBTTGI0bjVNUDVFVmpSRGoxOUVSbjlUSkI4UkdHb1ZvZStt?=
 =?utf-8?B?MGFZYlZZSDdaenpkU0VoK3ArVVVOWiszUk1yWldLbVFySVZaUlNlRGRrZHF4?=
 =?utf-8?B?My9BTXRrOGxvU01ZTEJ3ODdYUmUzRDJwZDNNK29ZRWJmR3AvL0oydlB3c1k5?=
 =?utf-8?B?WEwyS1dlZjdIbjh5amJWYzVpbnN6bnBlZE5sSVV1b2h4ZzVtUGxrUUp5RlFm?=
 =?utf-8?B?RGJGRmNOdTNIODBvMlljZmw2c2hKYi90K3drYkw0Y3RUeXcyNkw2eHB6ZUpK?=
 =?utf-8?B?U1A5MzU5VCsrYTZ2ZFFSUTZLRGdOQ3I2Wm1Fam15aWtMalpuY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NGNqaWRKOVJiR0xYRlJrZkkzZG85VHRxWlIzMy9NNjRpWk1mQ09yY2ZU?=
 =?utf-8?B?bUlITU5VamtvMVE3bzZGT2FTckhYTkVWS2tQRWc3eGdJdDBVdXgzZDBDUlJT?=
 =?utf-8?B?WnY4cTlDRUkyT3Zza01walE3R0Vlazd3c1h1K0R1VGoxYllMWm5iL2EyQ2s5?=
 =?utf-8?B?U2ZGc1hGc2J2a1pMeHhJbk1XUUlsT1pnUGZJcUs2STREUDlNSmUzY0M0R0FQ?=
 =?utf-8?B?VWZyRDRkL2FVMXlrRGxRVmZxSzV5YXVaWDBCcXNHMGRWQ2VyTXFCazU2cVRt?=
 =?utf-8?B?c0tmRW9NUloxQjQzaWlva3ZYeStzZlh0aDVOa1FHOVE3cVBKU2dXc1kzUE5n?=
 =?utf-8?B?VmdKYk0xdXRyR0FpRmJ4VS9CYWdMWk41dzMrTkxTbzFCWGVCV3FhWDk4Tmhk?=
 =?utf-8?B?STkxeVh3U09pbWh3aDk3V0NaeU12YXJvNC9vakgzT0IrY3NlY0hmUzdESDJj?=
 =?utf-8?B?UkxjTWtBam95djdKSVZVTDZTVHpuSmtRcXY4YXRTUkU3a05CMm02ZlM2cXBY?=
 =?utf-8?B?Nmpac1h4OW8xNDZoZUF2aDNGSTcrY3h1OEJCbWppK01vM283alRHRVZVeXZO?=
 =?utf-8?B?cWpVdGE3WWtMbVhpYWx0RjJLSTI1NnhoQU0rUzFQRjExVXZoWGN2SW5CN2lP?=
 =?utf-8?Q?4gt398khnfR31PWWlWr9U8PzY?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f3b53a5e-5e89-4b51-a533-08db7d312c0a
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 08:23:54.9885
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: p79hWwmMrigjilyewC/L5kAZtXC57S6IPi14AfRlrHkXpe5iWzZUg6NdGHBwqaUcknBABLHLyXOcyirQDiLvlg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7301

On 01.07.2023 00:28, Marek Marczykowski-GÃ³recki wrote:
> On Tue, May 30, 2023 at 01:56:34PM +0200, Jan Beulich wrote:
>> On 05.05.2023 23:25, Marek Marczykowski-GÃ³recki wrote:
>>> In some cases, only few registers on a page needs to be write-protected.
>>> Examples include USB3 console (64 bytes worth of registers) or MSI-X's
>>> PBA table (which doesn't need to span the whole table either), although
>>> in the latter case the spec forbids placing other registers on the same
>>> page. Current API allows only marking whole pages pages read-only,
>>> which sometimes may cover other registers that guest may need to
>>> write into.
>>>
>>> Currently, when a guest tries to write to an MMIO page on the
>>> mmio_ro_ranges, it's either immediately crashed on EPT violation - if
>>> that's HVM, or if PV, it gets #PF. In case of Linux PV, if access was
>>> from userspace (like, /dev/mem), it will try to fixup by updating page
>>> tables (that Xen again will force to read-only) and will hit that #PF
>>> again (looping endlessly). Both behaviors are undesirable if guest could
>>> actually be allowed the write.
>>>
>>> Introduce an API that allows marking part of a page read-only. Since
>>> sub-page permissions are not a thing in page tables (they are in EPT,
>>> but not granular enough), do this via emulation (or simply page fault
>>> handler for PV) that handles writes that are supposed to be allowed.
>>> The new subpage_mmio_ro_add() takes a start physical address and the
>>> region size in bytes. Both start address and the size need to be 8-byte
>>
>> 8-byte (aka qword) here, but ...
>>
>>> aligned, as a practical simplification (allows using smaller bitmask,
>>> and a smaller granularity isn't really necessary right now).
>>> It will internally add relevant pages to mmio_ro_ranges, but if either
>>> start or end address is not page-aligned, it additionally adds that page
>>> to a list for sub-page R/O handling. The list holds a bitmask which
>>> dwords are supposed to be read-only and an address where page is mapped
>>
>> ... dwords here?
>>
>>> for write emulation - this mapping is done only on the first access. A
>>> plain list is used instead of more efficient structure, because there
>>> isn't supposed to be many pages needing this precise r/o control.
>>>
>>> The mechanism this API is plugged in is slightly different for PV and
>>> HVM. For both paths, it's plugged into mmio_ro_emulated_write(). For PV,
>>> it's already called for #PF on read-only MMIO page. For HVM however, EPT
>>> violation on p2m_mmio_direct page results in a direct domain_crash().
>>> To reach mmio_ro_emulated_write(), change how write violations for
>>> p2m_mmio_direct are handled - specifically, check if they relate to such
>>> partially protected page via subpage_mmio_write_accept() and if so, call
>>> hvm_emulate_one_mmio() for them too. This decodes what guest is trying
>>> write and finally calls mmio_ro_emulated_write(). Note that hitting EPT
>>> write violation for p2m_mmio_direct page can only happen if the page was
>>> on mmio_ro_ranges (see ept_p2m_type_to_flags()), so there is no need for
>>> checking that again.
>>
>> Yet that's then putting us on a certain risk wrt potential errata.
>>
>> You also specifically talk about "guests", i.e. more than just hwdom.
>> Adding another easy access to the emulator (for HVM) comes with a
>> certain risk of future XSAs, too.
> 
> There are a lot of ways where a guest with a PCI device can exercise the
> emulator already, no? And even without PCI passthrough, more or less any
> device backed by the device model allows that too. So, while emulator is
> a complex piece of code, I don't think this patch makes it easier
> accessible in any significant way.

Hmm, "easier" was perhaps the wrong term. The emulator doesn't normally
come into play when guests access MMIO regions of passed-through devices.
That's different here. You're right that the emulator is always involved
when accessing MMIO regions of emulated devices.

>>> --- a/xen/arch/x86/hvm/hvm.c
>>> +++ b/xen/arch/x86/hvm/hvm.c
>>> @@ -1990,6 +1990,14 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
>>>          goto out_put_gfn;
>>>      }
>>>  
>>> +    if ( (p2mt == p2m_mmio_direct) && npfec.write_access && npfec.present &&
>>> +         subpage_mmio_write_accept(mfn, gla) &&
>>> +         (hvm_emulate_one_mmio(mfn_x(mfn), gla) == X86EMUL_OKAY) )
>>> +    {
>>> +        rc = 1;
>>> +        goto out_put_gfn;
>>> +    }
>>
>> But npfec.write_access set doesn't mean it was a write permission
>> violation, does it? 
> 
> Doesn't it? IIUC it means it was a write attempt, to a mapped page
> (npfec.present), and since we've got EPT violation, it got denied. 

But the denial may have been for reasons other than the W bit being
clear, at least in principle? Abusing the bit now, even if in
practice there was no other possible reason on existing hardware
with the features we presently use, might lead to hard to locate
issues in case a different reason appears down the road.

>>> --- a/xen/arch/x86/include/asm/mm.h
>>> +++ b/xen/arch/x86/include/asm/mm.h
>>> @@ -522,9 +522,24 @@ extern struct rangeset *mmio_ro_ranges;
>>>  void memguard_guard_stack(void *p);
>>>  void memguard_unguard_stack(void *p);
>>>  
>>> +/*
>>> + * Add more precise r/o marking for a MMIO page. Bytes range specified here
>>> + * will still be R/O, but the rest of the page (nor marked as R/O via another
>>> + * call) will have writes passed through.
>>> + * The start address and the size must be aligned to SUBPAGE_MMIO_RO_ALIGN.
>>
>> With this alignment constraint, the earlier sentence can be read as
>> controdictory. How about "Byte-granular ranges ..." or "Ranges (using
>> byte granularity) ..."? I admit even that doesn't resolve the issue
>> fully, though.
> 
> I don't see where the issue is, alignment requirement doesn't change
> anything regarding the parameter units.

And I didn't say it would. What I said is that starting a sentence with
"Bytes ranges specified ..." is ambiguous in potentially suggesting to
a reader that arbitrary ranges at byte boundaries are permitted. Which
can then be taken as contradicted by the subsequent sentence about
aligment requirements.

> Anyway, I can change to one of the suggested versions.

Well, something even less ambiguous would of course be yet better.

>>> @@ -4882,6 +4895,243 @@ long arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>>>      return 0;
>>>  }
>>>  
>>> +/* This needs subpage_ro_lock already taken */
>>> +static int __init subpage_mmio_ro_add_page(
>>> +    mfn_t mfn, unsigned int offset_s, unsigned int offset_e)
>>> +{
>>> +    struct subpage_ro_range *entry = NULL, *iter;
>>> +    int i;
>>
>> unsigned int please (as almost always for induction variables).
>>
>>> +    list_for_each_entry(iter, &subpage_ro_ranges, list)
>>> +    {
>>> +        if ( mfn_eq(iter->mfn, mfn) )
>>> +        {
>>> +            entry = iter;
>>> +            break;
>>> +        }
>>> +    }
>>> +    if ( !entry )
>>> +    {
>>> +        /* iter==NULL marks it was a newly allocated entry */
>>
>> Nit: Even in a comment I think it would be nice if style rules were
>> followed, and hence == was surrounded by blanks.
>>
>>> +        iter = NULL;
>>> +        entry = xzalloc(struct subpage_ro_range);
>>> +        if ( !entry )
>>> +            return -ENOMEM;
>>> +        entry->mfn = mfn;
>>> +    }
>>> +
>>> +    for ( i = offset_s; i <= offset_e; i += SUBPAGE_MMIO_RO_ALIGN )
>>> +        set_bit(i / SUBPAGE_MMIO_RO_ALIGN, entry->ro_qwords);
>>
>> You're holding a spin lock, so won't __set_bit() suffice here? And
>> then __clear_bit() below?
> 
> Right.
> 
>>> +    if ( !iter )
>>> +        list_add_rcu(&entry->list, &subpage_ro_ranges);
>>> +
>>> +    return 0;
>>> +}
>>
>> Since you mark the qwords which are to be protected, how is one to set
>> up safely two discontiguous ranges on the same page? I think I had
>> asked for v1 already why you don't do things the other way around:
>> Initially the entire page is protected, and then writable regions are
>> carved out.
> 
> Because that's not how the API is used. This API is for those how want
> to write-protect some specific ranges (to be written exclusively by
> Xen). They don't need to even know what is else is on the same page.
> Take XHCI case as an example: it gets the range to write-protect by
> enumerating XHCI extended capabilities, which is a linked list. The
> driver gets info where XHCI console registers are.  Things before/after
> them on that page may not even be XHCI extended caps at all.
> This in fact is very similar approach to already existing
> mmio_ro_ranges.

While I agree there's a similarity, multiple entities caring about the
same MFN isn't an expected scenario there. Whereas here you explicitly
add support for such.

Furthermore you sub-divide pages covered by mmio_ro_ranges here, so
defaulting to "full page protected" and then carving out sub-regions
would be the more natural approach imo.

>> I guess I shouldn't further ask about overlapping r/o ranges and their
>> cleaning up. But at least a comment towards the restriction would be
>> nice. Perhaps even check upon registration that no part of the range
>> is already marked r/o.
> 
> Yes, this is a good suggestion, I'll add that.

As long as all restrictions are properly spelled out, this may be
sufficient. But please don't be surprised if I ask again on a
subsequent version.

>>> +static void __init subpage_mmio_ro_free(struct rcu_head *rcu)
>>> +{
>>> +    struct subpage_ro_range *entry = container_of(
>>> +        rcu, struct subpage_ro_range, rcu);
>>> +
>>> +    ASSERT(bitmap_empty(entry->ro_qwords, PAGE_SIZE / SUBPAGE_MMIO_RO_ALIGN));
>>> +
>>> +    if ( entry->mapped )
>>> +        iounmap(entry->mapped);
>>> +    xfree(entry);
>>> +}
>>> +
>>> +/* This needs subpage_ro_lock already taken */
>>> +static int __init subpage_mmio_ro_remove_page(
>>> +    mfn_t mfn,
>>> +    int offset_s,
>>> +    int offset_e)
>>> +{
>>> +    struct subpage_ro_range *entry = NULL, *iter;
>>> +    int rc, i;
>>> +
>>> +    list_for_each_entry_rcu(iter, &subpage_ro_ranges, list)
>>> +    {
>>> +        if ( mfn_eq(iter->mfn, mfn) )
>>> +        {
>>> +            entry = iter;
>>> +            break;
>>> +        }
>>> +    }
>>> +    if ( !entry )
>>> +        return -ENOENT;
>>
>> Yet the sole caller doesn't care at all, not even by an assertion.
> 
> Indeed, right now it's called under the same spinlock that the page was
> added. Would you prefer to drop return value (not relevant until another
> use is added, beyond cleanup on failure), or add assertion?

Taking Misra into account, dropping unused return values would be better.

>>> +    if ( !size )
>>> +        return 0;
>>> +
>>> +    rc = rangeset_add_range(mmio_ro_ranges, mfn_x(mfn_start), mfn_x(mfn_end));
>>> +    if ( rc )
>>> +        return rc;
>>> +
>>> +    spin_lock(&subpage_ro_lock);
>>> +
>>> +    if ( PAGE_OFFSET(start) ||
>>> +         (mfn_eq(mfn_start, mfn_end) && PAGE_OFFSET(end) != PAGE_SIZE - 1) )
>>> +    {
>>> +        offset_end = mfn_eq(mfn_start, mfn_end) ?
>>> +                     PAGE_OFFSET(end) :
>>> +                     (PAGE_SIZE - 1);
>>> +        rc = subpage_mmio_ro_add_page(mfn_start,
>>> +                                      PAGE_OFFSET(start),
>>> +                                      offset_end);
>>> +        if ( rc )
>>> +            goto err_unlock;
>>> +    }
>>> +
>>> +    if ( !mfn_eq(mfn_start, mfn_end) && PAGE_OFFSET(end) != PAGE_SIZE - 1 )
>>> +    {
>>> +        rc = subpage_mmio_ro_add_page(mfn_end, 0, PAGE_OFFSET(end));
>>> +        if ( rc )
>>> +            goto err_unlock_remove;
>>> +    }
>>> +
>>> +    spin_unlock(&subpage_ro_lock);
>>> +
>>> +    return 0;
>>> +
>>> + err_unlock_remove:
>>> +    if ( offset_end )
>>> +        subpage_mmio_ro_remove_page(mfn_start, PAGE_OFFSET(start), offset_end);
>>> +
>>> + err_unlock:
>>> +    spin_unlock(&subpage_ro_lock);
>>> +    if ( rangeset_remove_range(mmio_ro_ranges, mfn_x(mfn_start), mfn_x(mfn_end)) )
>>> +        printk(XENLOG_ERR "Failed to cleanup on failed subpage_mmio_ro_add()\n");
>>> +    return rc;
>>> +}
>>
>> None of the failures here is particularly likely, so perhaps all is fine as
>> you have it. But there would be an alternative of retaining the
>> mmio_ro_ranges entry/entries, allowing the caller to "ignore" the error.
> 
> That is an option here too, but note one of the potential failures is
> about rangeset_add_range() itself, so one needs to be careful about
> completely ignoring the error.

I agree a fair amount of care would be needed. Hence why I did only suggest
this as an alternative for consideration.

>>> +static void __iomem *subpage_mmio_get_page(struct subpage_ro_range *entry)
>>> +{
>>> +    if ( entry->mapped )
>>> +        return entry->mapped;
>>> +
>>> +    spin_lock(&subpage_ro_lock);
>>> +    /* Re-check under the lock */
>>> +    if ( entry->mapped )
>>> +        goto out_unlock;
>>> +
>>> +    entry->mapped = ioremap(mfn_x(entry->mfn) << PAGE_SHIFT, PAGE_SIZE);
>>> +
>>> + out_unlock:
>>> +    spin_unlock(&subpage_ro_lock);
>>> +    return entry->mapped;
>>> +}
>>
>> This is easy to deal with without any "goto".
>>
>> I'm further inclined to request that the ioremap() occur without the lock
>> held, followed by an iounmap() (after dropping the lock) if in fact the
>> mapping wasn't needed (anymore).
> 
> Is it to limit time the lock is held?

That's only a secondary goal. The primary goal is to avoid lock nesting
where it can be avoided: All forms of allocation acquire some lock in
the process, and any lock nesting needs sufficient care to avoid lock
order inversion. As long as allocation is fully self-contained (no
callbacks, no call-outs or other hooks) the risk is low, but imo better
to avoid the risk altogether where (relatively) easily possible.

>>> +static void subpage_mmio_write_emulate(
>>> +    mfn_t mfn,
>>> +    unsigned int offset,
>>> +    const void *data,
>>> +    unsigned int len)
>>> +{
>>> +    struct subpage_ro_range *entry;
>>> +    void __iomem *addr;
>>> +
>>> +    rcu_read_lock(&subpage_ro_rcu);
>>> +
>>> +    list_for_each_entry_rcu(entry, &subpage_ro_ranges, list)
>>> +    {
>>> +        if ( mfn_eq(entry->mfn, mfn) )
>>> +        {
>>> +            if ( test_bit(offset / SUBPAGE_MMIO_RO_ALIGN, entry->ro_qwords) )
>>> +                goto write_ignored;
>>
>> I think you can get away with just a single "goto" by putting the gprintk()
>> (and its label) here.
> 
> write_ignored label is used also below in "default" case (which should
> be unreachable, but still).

Right, which is why I said 'just a single "goto"' (implying a label would
still be needed).

> Do you suggest jumping from default case into here?

Yes, that would be one way of structuring things.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 08:28:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 08:28:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558834.873265 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGxsW-0002CP-FI; Wed, 05 Jul 2023 08:28:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558834.873265; Wed, 05 Jul 2023 08:28:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGxsW-0002CI-BH; Wed, 05 Jul 2023 08:28:48 +0000
Received: by outflank-mailman (input) for mailman id 558834;
 Wed, 05 Jul 2023 08:28:47 +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 <SRS0=dIgq=CX=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGxsV-0002CC-IU
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 08:28:47 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on2061e.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::61e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f4e2aaa1-1b0d-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 10:28:45 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS4PR04MB9650.eurprd04.prod.outlook.com (2603:10a6:20b:4cd::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 08:28:43 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 08:28:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f4e2aaa1-1b0d-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=fvF3cSBlaFVVxPuyTq6ZVQe4GaJReC1PbYPnw5x70HW0Ah9/yatQtTYhmn5cMuh6htvh8LoCIoqCgAuOdthsuyjUe6gRjE++HKfwisnwjo/uY+a5GuEUs5nsdWNqhyQjTYppX0j6jUAogpMFdT9+hk7/ajl/giHqS49zC4OUcxs2Ye1Qfb5FWjW3RXc/5NpbPqbb/z5AH8OE4RXEWEw7+RAnhinOQCdbJ1dqcdMMyKs86lsByjMQOHIjZus8z0wjPn1lOO/dDs2BozZxisHw6KKLjFaXx/noaLrXQqiNAIYf0s0AnUCgZkXe6NLOiL2yUU0/XmeewYq0eb62Ebr+HA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=fSCsdsKH5vjcnrekux052uZhke+6/pmXzEvD35uhqW4=;
 b=EhTYcsa1aWOj7K6/qxLyG2asF+8BakpY/JAZ/hPFMKCZIk3XBPaNR3S6CpN6rzd28WHbrZNNZ7nGg60wBKdLDd6dmnTzkkiIbKN+4pp6+/5G6sWWIFDpRtrXw8KDoopPsYfOVInCAGuUzv31b5jqtcw1bhN4eKnHSNPtG288qfIANr2M40ShVMsS0b0okqHuxFLwFLaD4hGTaBQ8dqrwus+xonCsOxG895Gg0NygX03jFZwtVoIGeW+u0tTNO62M/Ha4qPW72eqWYUCQ9raQBL5LFCo8P4SbRkVnE9gxIiWyhpdsjp9xKyavHYK1zPtcdobt9dXipJXcufVkfbVDgg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fSCsdsKH5vjcnrekux052uZhke+6/pmXzEvD35uhqW4=;
 b=Wq4gPKjM6vmURkjBsYU0MkXYjafsBngpOSHHH6pMPLZpkDC2ttPnu6rHUGHzKT+YdwqWRBPE+ouP6cYJb434L4LE8dnybvsHL0GIwyOl9kSuXq3xx/R0F7EVhmrzxFswi4S4uNqZj89k94MrstO2WgR+l5tNOtp58rENE7iD+yKybUke4TLPDt0RsoaJGo5VLbRFzuwYYaflMyFX3LIxyDMjX/8X54T3PCfv5vnqf9EdOl/ku2ldA1VrpSWPV+uIGDvtHoco0eT6cc1fP1EsOJxfvsyEFywse378tl4A2BPT0dw1hFrYg59a89jgTCV0h3V+qIuQ+ImKZm9KVEmMxw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <00574cbc-c037-8df8-bd81-cb26382f9253@suse.com>
Date: Wed, 5 Jul 2023 10:28:41 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 2/2] drivers/char: Use sub-page ro API to make just
 xhci dbc cap RO
Content-Language: en-US
To: =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <cover.dd82aca339854e90ffe12e7bc4298254a6caaf0d.1683321183.git-series.marmarek@invisiblethingslab.com>
 <1f9909dacfd7822a1c7d30ba03bbec93fa2ff6fd.1683321183.git-series.marmarek@invisiblethingslab.com>
 <f168a753-45d2-7d66-8ec7-ad06e6cd42eb@suse.com> <ZJ9ZYjWoiPU7GFuV@mail-itl>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZJ9ZYjWoiPU7GFuV@mail-itl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0012.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a::22) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS4PR04MB9650:EE_
X-MS-Office365-Filtering-Correlation-Id: 90d38437-6882-49db-19f6-08db7d31d7f1
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	8OI95TvCjF0vCmuZgDKAxKTezxbyBtCIShFAC2mP8ds4DiesKBbXOWeNW8dK7N2ja3S1eELT8EXMnNzF0aGoARgbljcr8c+T8TKazTJnNTiPv7uwOwN0sga+h4i5HLSOte7AykJrQt8svHiPMmfXCO42yqFb8EclVn+XY8f3t9hl+TRZn7d2zkaJ05zYjyFYSMDW7uPseUTNqVyl2AsrPbC4pQxot/t1DUx61X121FrGRPUryfv8IO8bPpVQScx8DO+PyXJazup402qzcF+NmInxihLapROBYTbEhqjLuENaFTDvnZc4iMoX1+iZ/JLZw6dehZldcsmfbY/ekY47TzvnIgjFxtM55NV3qxpxHl7jJp4SEJdp8cNg5v7MOJwhb7byIagOAXVekxIBhetTIREMfgSYCIaGkRwlnVDjw9i7y/CA1e85dAbY2u2ySbrddmRvnEcHgKANivCYiPQOZFLEc8WLnCscoRLtes9LtS9AAg6m9irzijjyYlDjuFS2nc9T+TEpJWsHCcm0vwa2rUDhch7z7vsRUyG+RPmxge3xEE6ukFDVUfxLDtQ9yWkhJgvkPDBUhJ7j1sQIbuxma0DC6XZEnV6A3V1YVinAQSTVosF33jzjVtGfYivMjaPjxWQKNUz7y89VqBZV1xCjaA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(136003)(346002)(366004)(396003)(39860400002)(451199021)(5660300002)(8936002)(8676002)(41300700001)(316002)(2906002)(66574015)(83380400001)(31686004)(2616005)(66476007)(66556008)(66946007)(6916009)(4326008)(38100700002)(86362001)(186003)(478600001)(54906003)(6506007)(26005)(53546011)(6486002)(31696002)(36756003)(6512007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?THhMQ2IzdlgyeFgzbEtYS0VlSSt5UlQrKzlaV2xDNWVyQlNxQm1YamtNaFJo?=
 =?utf-8?B?VlBSSHBQRW1HTGlXRnVCOHpNdEQ4Y2g5WkR5MHJkd2JrVjBQVHo5TGpETFU4?=
 =?utf-8?B?eXJ0anhDUnRQaEx3UFordFFnNlkvUnVFbUwvTXlvT1V0YUphS1B2ZWJzKzZl?=
 =?utf-8?B?dWx5cW5IMFd3dmJhaENIU1ZSenFDWm9kZjlrQnpULzJ0elp0eW0rRUlLZ2FS?=
 =?utf-8?B?RHJ0bis3cFp4cHc2d0F1ZmQvczNLb3o4QldHZXgya0pFQ1FUV0hTRThMK21m?=
 =?utf-8?B?QzhGUE1iZE5Gd1NtSlB5OHZRVGZ1ci9WWktwUVFwdXJBbFdSSUEwaUdNN1Fr?=
 =?utf-8?B?elA1dHNLL1lHQlRYZ25XM1AxYXBGOEZiREhIOFJGZm9BcHZrb01KNk9FSHVF?=
 =?utf-8?B?MFQ2Rk5WSUpsSzdWQi81NVdKS1RjVElFWHovSldmSk1MS2FOK003WWZYU3Vy?=
 =?utf-8?B?cEkzVWFj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8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 08:28:43.4158
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: lfeRDu/e9oBgGKpwExSrKip4v+rFJBX4oTnzP5tljck+CH0pTyg/2xFEEWD2lQ8nDdsHMNT/dxHv98BigGuMtw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9650

On 01.07.2023 00:38, Marek Marczykowski-GÃ³recki wrote:
> On Tue, May 30, 2023 at 02:04:26PM +0200, Jan Beulich wrote:
>> On 05.05.2023 23:25, Marek Marczykowski-GÃ³recki wrote:
>>> --- a/xen/drivers/char/xhci-dbc.c
>>> +++ b/xen/drivers/char/xhci-dbc.c
>>> @@ -1221,14 +1221,12 @@ static void __init cf_check dbc_uart_init_postirq(struct serial_port *port)
>>>       * Linux's XHCI driver (as of 5.18) works without writting to the whole
>>>       * page, so keep it simple.
>>>       */
>>> -    if ( rangeset_add_range(mmio_ro_ranges,
>>> -                PFN_DOWN((uart->dbc.bar_val & PCI_BASE_ADDRESS_MEM_MASK) +
>>> -                         uart->dbc.xhc_dbc_offset),
>>> -                PFN_UP((uart->dbc.bar_val & PCI_BASE_ADDRESS_MEM_MASK) +
>>> -                       uart->dbc.xhc_dbc_offset +
>>> -                sizeof(*uart->dbc.dbc_reg)) - 1) )
>>> -        printk(XENLOG_INFO
>>> -               "Error while adding MMIO range of device to mmio_ro_ranges\n");
>>> +    if ( subpage_mmio_ro_add(
>>> +            (uart->dbc.bar_val & PCI_BASE_ADDRESS_MEM_MASK) +
>>> +             uart->dbc.xhc_dbc_offset,
>>> +            sizeof(*uart->dbc.dbc_reg)) )
>>> +        printk(XENLOG_WARNING
>>> +               "Error while marking MMIO range of XHCI console as R/O\n");
>>
>> So how about falling back to just rangeset_add_range(mmio_ro_ranges, ...)
>> in this failure case? (I did mention an alternative to doing it here in
>> the comments on patch 1.)
> 
> Or fallback to XHCI_SHARE_NONE (IOW, pci_ro_device()).
> 
>> Also, doesn't the comment ahead of the construct become stale?
> 
> Indeed.
> 
>> Finally I think indentation of the function call arguments is off by one.
> 
> How is it supposed to be? Currently it's 8 spaces over the "if", should
> it be 4 spaces over the function name?

Yes. All our indentation is using a granularity of 4 spaces, of course 
taking into account aligning with respective items on earlier lines
(the length of which may not be a multiple of 4). It is always the
innermost construct relative to which the new indentation level is
determined.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 08:33:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 08:33:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558838.873275 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGxwW-0003eh-Ut; Wed, 05 Jul 2023 08:32:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558838.873275; Wed, 05 Jul 2023 08:32:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGxwW-0003ea-Ri; Wed, 05 Jul 2023 08:32:56 +0000
Received: by outflank-mailman (input) for mailman id 558838;
 Wed, 05 Jul 2023 08:32:55 +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
 <SRS0=hFzj=CX=citrix.com=prvs=5438f3518=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qGxwV-0003eU-BF
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 08:32:55 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 874c21d1-1b0e-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 10:32:52 +0200 (CEST)
Received: from mail-dm6nam12lp2177.outbound.protection.outlook.com (HELO
 NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.177])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 05 Jul 2023 04:32:42 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by CH3PR03MB7410.namprd03.prod.outlook.com (2603:10b6:610:19f::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 08:32:40 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902%7]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 08:32:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 874c21d1-1b0e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688545972;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=eL3MKtJPc6clE+hXfNEUdpeDKzjtx7chsrXgt9T9MJw=;
  b=fccc4SXzqGr/9Uyz+YKF13rdRD9/wBxiSJcTrnvD4VuIZbSSndC7Y+0K
   dd49G4XixF4PihMpDV3bPnK1We7DxZUg6M9v+24OlWVGWmv3OTDaHLros
   T8YAiAVe7RNdiWewtThs2Fvje8/UBYWzwNyby1wklSzWXaNqovd8Us73E
   w=;
X-IronPort-RemoteIP: 104.47.59.177
X-IronPort-MID: 114503051
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:MQchhamsk9OsANAhDt+H3pfo5gzJJkRdPkR7XQ2eYbSJt1+Wr1Gzt
 xIdD2nVO/vbYTb9ctsgbo7ipEwPsMSBmIdjTgNk+y9mQyMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5AKGzhH5MbpETU2PByqgKmVrNrbSq
 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/
 f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3
 d0nDxsGQyigvL67y+y7E7RAvd58d8a+aevzulk4pd3YJdAPZMmZBonvu5pf1jp2gd1SF/HDY
 cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVkV03ieeyWDbWUoXiqcF9hEGXq
 3iA523kKhobKMae2XyO9XfEaurnxHqnBdpJTODhnhJsqFqKwDRDIhw9b0Omgvy01HeOd4hDA
 VNBr0LCqoB3riRHVOLVWBm1o2WYrwUcc9VVGuw+rgqKz8L8+B2FD2IJSjpAbt0Ot8IsQzEuk
 FiTkLvBBzN1t6aOYWmA7brSpjS3UQAQJHUHbDUJTiME5cfiu4A5ih/TTtdlH7Wxh9ezEjb1q
 xitqCU9nLwVgdQ867Sg/VvHjjSvobDEVgcwoA7QWwqN9g5lfsi9bpKs9HDA8O1Nao2eSzGpr
 HUC3sST8u0KJZWMjzCWBvUAGqmz4PSIOyGahkRgd7El9jKw6zugcJpW7TVWOkhkKIAHdCXvb
 UuVvhlejLdNPXiwZKoxbIurC9sjyYDpENijXffRBueiebB0fQ6DuS1rO0iZ2jm3lFB2yP5gf
 5CGbcyrEHAWT7x9yya7TPsc1rltwT0iwWTURtbwyBHPPaeiWUN5gIwtaDOmBt3VJovdyOkJ2
 76z7/e39ig=
IronPort-HdrOrdr: A9a23:rkZru6oDgcM1Is04Yx5I55kaV5oleYIsimQD101hICG9E/b1qy
 nKpp8mPHDP5wr5NEtPpTnjAsm9qALnlKKdiLN5Vd3OYOCMghrKEGgN1/qG/xTQXwH46+5Bxe
 NBXsFFebnN5IFB/KTH3DU=
X-Talos-CUID: 9a23:QSPTBGHShosRs6ESqmJGy2k/Ee0dUUaBwXyOIxblJV1zF+aaHAo=
X-Talos-MUID: 9a23:YYuqMAoEF2Qi9H5+NvcezzZ7Mp84yaWFMlgQspAL5fC0GXZsESjI2Q==
X-IronPort-AV: E=Sophos;i="6.01,182,1684814400"; 
   d="scan'208";a="114503051"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=NKjjxcFSEMMUl5J+9evJXIErkfoG5bec5ITLaGfD31vYS9liOHJLolrCXonTAur09sdm9Xq/lQhlNxiwvfSSTvZU96902Feh/9F4tFDKl2xkpfOJgirT+7RSHJBfqecI2CRwwhX+pu6/87O4p1xzqH9mmROFAj6ChI1/Zz7r71xLyxpKG2ST8znaz0hLkJ6hfP3ORVWYoeiMetNW7CSPt+xomdeMa8upKIhB2iSowR0YEHHQG21/EhUTGoi+bdUaKyxfEAyHviuL1NTEjkGwi5FabCJCmsFZaFSGh5EXxnJyXJuY1v28g4q92zjvv91DwgK98JpEwFLttk6ktMYmxQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7xo8LwWJoLmfNQ+YRzQ1DOI4zaYY9XdJ9XZv0GQRJN0=;
 b=NDACbzQ6j3y3c2NChiI/N4EKbH2W0JzaFe9adijpiJvaumWG9CoDVFK6x2MakXdrQlvRIA2PSK2JcTD0rA78MoF0YMkowx+RkiHc+Y1GJAXQmgYb31UmEQGH7cgpHl2ulh4+uyWr6WOki8bM5iiR9fdtTSP2EKpND0b6VCMQksj0GNaBNrL8F5j58qjAQEQwVF+h0WjMEBwgElgnajqpeY0BbgHh/7VcgHNOmzvahbh5HxvQUBuxmf/2UtFG71mDEaSsEJCBeM1ajzP/lhgAd3sV7Pui5V1IPUzlkOQxv5R+IijQiOq7GmL14r+v2rVUAi04rYSXJp+8VBY5BjOBOw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7xo8LwWJoLmfNQ+YRzQ1DOI4zaYY9XdJ9XZv0GQRJN0=;
 b=JxIUIPHkC4AHZP514f+158PbSOtWxJmZOVUtrW3fgOk8Eu4suafpGyUWBiPBKBlMw2pSrsaLznzNPZ0yaPIZpYLHwWyn1rpJsRm0Cn0npnUBqddzf/hWgbj3DLZPgnRvuDSE2PFPbIiBQ2fyjWOBK3u/2u+XtwS1R7KeuN+IF10=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Wed, 5 Jul 2023 10:32:34 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Oleksandr Tyshchenko <olekstysh@gmail.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
	Petr Pavlu <petr.pavlu@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	vikram.garhwal@amd.com
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
Message-ID: <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
References: <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
 <b21398eb-2fb2-4fca-dd90-d2c81d8df1c4@epam.com>
 <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop>
 <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>
 <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com>
 <ZKQF8qq8Oh5E+Fxx@mail-itl>
 <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
 <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
X-ClientProxiedBy: LO4P265CA0117.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2c3::20) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|CH3PR03MB7410:EE_
X-MS-Office365-Filtering-Correlation-Id: f7d03451-0a6d-41b3-8e0e-08db7d3264fd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	TnTZCII5EMwhhGJ8zHBM7gTaPnm0WcM5+DILxm3fpFoKDlOmuuI0GhUcN63K6Ya6ml7p9oAkAmQBn5e3cKGYgGP3HY81He7LIOHccStKtYIqGeeTh7RxP8elW5ajBlntUX6R39YZruJp7HLC44D0HwVXYENQVHY8k36QlZg3WkSCgckiuZpxaQe6BZ2yzY3IrHH0IgDNglWfU2bduFElP+Ui0EaUI4wTD4qk48hn4GIHmcE3HKih27X7CXuB0Z/K4p4Fqad+8mNe2EwnPH7+hssca7lzgqmrP7h7+NeQw31YBX2WgDf8ZfnM1mOaJa+r4pPyXAwyGPcSP0LtMe8FEtor04cTQV4oL+RFPvJmCdHruC36zEJZ+ytAxm8DEJ9QBK411vSPJnCJT74M6i6+4+t10Gyg1GLjnY5mRJp95J6PiyRBfSG+gWX2wioFJznkWFpyI9o0SMORezOGcLQc11T6Ku7YUc+TQ7nWNbBU8DxHx7C3EOgx6/65TS/O7sf91ORp0E681HsAFtcOE91XyMC1tGjrIVjuN4K8SWDk2PzR3dffx1DrByORfcNTgIU3
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(136003)(346002)(376002)(39860400002)(451199021)(186003)(38100700002)(82960400001)(53546011)(6506007)(26005)(83380400001)(66574015)(5660300002)(41300700001)(8936002)(8676002)(85182001)(86362001)(6916009)(2906002)(6486002)(66946007)(6666004)(4326008)(9686003)(6512007)(316002)(478600001)(66476007)(54906003)(66556008);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UzMrNXE3UEpDMW9PWjRnWGI3cVhpQ1Fid2dVaUFNVWFSMFRteWdCQ1VWWm1v?=
 =?utf-8?B?bVQ0UzhUelRtWEhTSXBIM0JxaTBWb0FOZmR5Zy95bVF3K1VTeXBLbG96Qkhl?=
 =?utf-8?B?QTBwZjdqQjVqbURFYWJNbzU2Y1EvSGh6QkVjOXBkODQ3UFNoSitaUFNNN24y?=
 =?utf-8?B?eE53SUVkVjI4ck16OHhOL0FSYTZlSlZHOThXVG1uOVJhcUdYczRtempDOWhw?=
 =?utf-8?B?MEFhL2V2MGQ1VTFJdE5FNU5QZFVJZ1FkUGdMNUF3bHJqTjlRUk5PZGZDY2pq?=
 =?utf-8?B?QTdmYWlqTVF0OFlwTGw1ZFVDUmVsUy9aWk15djVGdHVlWGo0Uk92c0lCbUUz?=
 =?utf-8?B?MGN1dDMxWnJPa0JOQ2RQOG9mb0UxN2lLRFM3VU5vbWIzSkc5aFRYaldtRE1p?=
 =?utf-8?B?TUdvZmhzWjNodmswbFpnYW05YlMwYlVEU1E0MFlRM3hmTysvUlRwdHZZVWhE?=
 =?utf-8?B?QUZMejdiaGYvaG13eTl5Y0dQd01wTlpPNjFUU24xVlU5VE42cEcrRmJHU3Jx?=
 =?utf-8?B?SXZXZmpweEFqNFVMdC8zY1BEbEo3T1l4ZmN4T3JBV3RMMWkvR2lmemEvUU82?=
 =?utf-8?B?c0xWbXBvbURCVnYzdnlNRk5hd1piS3Fkd2g0MGd4MU10dnp5RDg2MXRpakc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ORDJzb0VrM3ZXZ2RjU010RDNvRlE0Y294N085YWNpN1MrMW5uT0x3?=
 =?utf-8?B?SmZaank2UnpkNkRoK2czSDFTQ0ppcXVIYitkYVpPdVRjTUpZclZ5WkllTFBh?=
 =?utf-8?B?cVJkNFU1aVdzcklQeVpXcDJjdXVYVmJkeW95cG1xek1abGZlckM2djhUOExi?=
 =?utf-8?B?YzZmUlM2ZXQzY1Joa0VqNU1YdkwrbUNNTjlRR2p0RjVxMFVnbmw2ditFdjYx?=
 =?utf-8?B?ZDNPRVRUbmlZRXgxLzFJQ0tJaWtmckpRTnpzY2dRY2R2dUlBSVFTV21nbTZO?=
 =?utf-8?Q?SD+GH5n7bHyKrgVZdMh04FoQxrEGzYb2en?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f7d03451-0a6d-41b3-8e0e-08db7d3264fd
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 08:32:40.2848
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: JaaTlZ50s3ERWKt1KtKcYzb/YwSEIUlhMLpB27MuekP43cLowa0QWOy+AnONG174qGF8s62Ewc955aWdpGiv+A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR03MB7410

On Tue, Jul 04, 2023 at 08:14:59PM +0300, Oleksandr Tyshchenko wrote:
> On Tue, Jul 4, 2023 at 5:49â€¯PM Roger Pau MonnÃ© <roger.pau@citrix.com> wrote:
> 
> Hello all.
> 
> [sorry for the possible format issues]
> 
> 
> On Tue, Jul 04, 2023 at 01:43:46PM +0200, Marek Marczykowski-GÃ³recki wrote:
> > > Hi,
> > >
> > > FWIW, I have ran into this issue some time ago too. I run Xen on top of
> > > KVM and then passthrough some of the virtio devices (network one
> > > specifically) into a (PV) guest. So, I hit both cases, the dom0 one and
> > > domU one. As a temporary workaround I needed to disable
> > > CONFIG_XEN_VIRTIO completely (just disabling
> > > CONFIG_XEN_VIRTIO_FORCE_GRANT was not enough to fix it).
> > > With that context in place, the actual response below.
> > >
> > > On Tue, Jul 04, 2023 at 12:39:40PM +0200, Juergen Gross wrote:
> > > > On 04.07.23 09:48, Roger Pau MonnÃ© wrote:
> > > > > On Thu, Jun 29, 2023 at 03:44:04PM -0700, Stefano Stabellini wrote:
> > > > > > On Thu, 29 Jun 2023, Oleksandr Tyshchenko wrote:
> > > > > > > On 29.06.23 04:00, Stefano Stabellini wrote:
> > > > > > > > I think we need to add a second way? It could be anything that
> > can help
> > > > > > > > us distinguish between a non-grants-capable virtio backend and
> > a
> > > > > > > > grants-capable virtio backend, such as:
> > > > > > > > - a string on xenstore
> > > > > > > > - a xen param
> > > > > > > > - a special PCI configuration register value
> > > > > > > > - something in the ACPI tables
> > > > > > > > - the QEMU machine type
> > > > > > >
> > > > > > >
> > > > > > > Yes, I remember there was a discussion regarding that. The point
> > is to
> > > > > > > choose a solution to be functional for both PV and HVM *and* to
> > be able
> > > > > > > to support a hotplug. IIRC, the xenstore could be a possible
> > candidate.
> > > > > >
> > > > > > xenstore would be among the easiest to make work. The only
> > downside is
> > > > > > the dependency on xenstore which otherwise virtio+grants doesn't
> > have.
> > > > >
> > > > > I would avoid introducing a dependency on xenstore, if nothing else
> > we
> > > > > know it's a performance bottleneck.
> > > > >
> > > > > We would also need to map the virtio device topology into xenstore,
> > so
> > > > > that we can pass different options for each device.
> > > >
> > > > This aspect (different options) is important. How do you want to pass
> > virtio
> > > > device configuration parameters from dom0 to the virtio backend
> > domain? You
> > > > probably need something like Xenstore (a virtio based alternative like
> > virtiofs
> > > > would work, too) for that purpose.
> > > >
> > > > Mapping the topology should be rather easy via the PCI-Id, e.g.:
> > > >
> > > > /local/domain/42/device/virtio/0000:00:1c.0/backend
> > >
> > > While I agree this would probably be the simplest to implement, I don't
> > > like introducing xenstore dependency into virtio frontend either.
> > > Toolstack -> backend communication is probably easier to solve, as it's
> > > much more flexible (could use qemu cmdline, QMP, other similar
> > > mechanisms for non-qemu backends etc).
> >
> > I also think features should be exposed uniformly for devices, it's at
> > least weird to have certain features exposed in the PCI config space
> > while other features exposed in xenstore.
> >
> > For virtio-mmio this might get a bit confusing, are we going to add
> > xenstore entries based on the position of the device config mmio
> > region?
> >
> > I think on Arm PCI enumeration is not (usually?) done by the firmware,
> > at which point the SBDF expected by the tools/backend might be
> > different than the value assigned by the guest OS.
> >
> > I think there are two slightly different issues, one is how to pass
> > information to virtio backends, I think doing this initially based on
> > xenstore is not that bad, because it's an internal detail of the
> > backend implementation. However passing information to virtio
> > frontends using xenstore is IMO a bad idea, there's already a way to
> > negotiate features between virtio frontends and backends, and Xen
> > should just expand and use that.
> >
> >
> 
> On Arm with device-tree we have a special bindings which purpose is to
> inform us whether we need to use grants for virtio and backend domid for a
> particular device.Here on x86, we don't have a device tree, so cannot
> (easily?) reuse this logic.
> 
> I have just recollected one idea suggested by Stefano some time ago [1].
> The context of discussion was about what to do when device-tree and ACPI
> cannot be reused (or something like that).The idea won't cover virtio-mmio,
> but I have heard that virtio-mmio usage with x86 Xen is rather unusual case.
> 
> I will paste the text below for convenience.
> 
> **********
> 
> Part 1 (intro):
> 
> We could reuse a PCI config space register to expose the backend id.
> However this solution requires a backend change (QEMU) to expose the
> backend id via an emulated register for each emulated device.
> 
> To avoid having to introduce a special config space register in all
> emulated PCI devices (virtio-net, virtio-block, etc) I wonder if we
> could add a special PCI config space register at the emulated PCI Root
> Complex level.
> 
> Basically the workflow would be as follow:
> 
> - Linux recognizes the PCI Root Complex as a Xen PCI Root Complex
> - Linux writes to special PCI config space register of the Xen PCI Root
>   Complex the PCI device id (basically the BDF)
> - The Xen PCI Root Complex emulated by Xen answers by writing back to
>   the same location the backend id (domid of the backend)
> - Linux reads back the same PCI config space register of the Xen PCI
>   Root Complex and learn the relevant domid

IMO this seems awfully complex.  I'm not familiar with the VirtIO
spec, but I see there's a Vendor data capability, could we possibly
expose Xen-specific information on that capability?

> Part 2 (clarification):
> 
> I think using a special config space register in the root complex would
> not be terrible in terms of guest changes because it is easy to
> introduce a new root complex driver in Linux and other OSes. The root
> complex would still be ECAM compatible so the regular ECAM driver would
> still work. A new driver would only be necessary if you want to be able
> to access the special config space register.

I'm slightly worry of this approach, we end up modifying a root
complex emulation in order to avoid modifying a PCI device emulation
on QEMU, not sure that's a good trade off.

Note also that different architectures will likely have different root
complex, and so you might need to modify several of them, plus then
arrange the PCI layout correctly in order to have the proper hierarchy
so that devices belonging to different driver domains are assigned to
different bridges.

> 
> 
> **********
> What do you think about it? Are there any pitfalls, etc? This also requires
> system changes, but at least without virtio spec changes.

Why are we so reluctant to add spec changes?  I understand this might
take time an effort, but it's the only way IMO to build a sustainable
VirtIO Xen implementation.  Did we already attempt to negotiate with
Oasis Xen related spec changes and those where refused?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 08:41:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 08:41:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558845.873285 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGy4P-0005Cu-Ro; Wed, 05 Jul 2023 08:41:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558845.873285; Wed, 05 Jul 2023 08:41:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGy4P-0005Cn-Om; Wed, 05 Jul 2023 08:41:05 +0000
Received: by outflank-mailman (input) for mailman id 558845;
 Wed, 05 Jul 2023 08:41:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=NVcp=CX=arm.com=Rahul.Singh@srs-se1.protection.inumbo.net>)
 id 1qGy4N-0005Ch-RV
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 08:41:03 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on0629.outbound.protection.outlook.com
 [2a01:111:f400:fe02::629])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id abc28965-1b0f-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 10:41:02 +0200 (CEST)
Received: from AM0PR06CA0083.eurprd06.prod.outlook.com (2603:10a6:208:fa::24)
 by DB8PR08MB5468.eurprd08.prod.outlook.com (2603:10a6:10:11a::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 08:40:58 +0000
Received: from AM7EUR03FT047.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:208:fa:cafe::3a) by AM0PR06CA0083.outlook.office365.com
 (2603:10a6:208:fa::24) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 08:40:58 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT047.mail.protection.outlook.com (100.127.140.69) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.22 via Frontend Transport; Wed, 5 Jul 2023 08:40:57 +0000
Received: ("Tessian outbound 52217515e112:v142");
 Wed, 05 Jul 2023 08:40:57 +0000
Received: from f464aa013064.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 B0088142-3B17-4CC5-8821-AEB2AEC215C5.1; 
 Wed, 05 Jul 2023 08:40:50 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f464aa013064.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 08:40:50 +0000
Received: from AM9PR08MB7165.eurprd08.prod.outlook.com (2603:10a6:20b:41f::23)
 by DB9PR08MB9826.eurprd08.prod.outlook.com (2603:10a6:10:45d::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 08:40:49 +0000
Received: from AM9PR08MB7165.eurprd08.prod.outlook.com
 ([fe80::a4db:63a3:ef32:ffd3]) by AM9PR08MB7165.eurprd08.prod.outlook.com
 ([fe80::a4db:63a3:ef32:ffd3%4]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023
 08:40:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: abc28965-1b0f-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=47wYujmxUbwb3Q4zhgp3DtFcdHgmy7H65HQAdh2HAng=;
 b=Q2qSvwvPZ6Qq9RBkFo02EqRm6Hfa1Qumc5K/pGsa8F3gPKplyb6p8KzxOCG6piX4kZqtT0UTXHxNf+1hqdqkKNIvxlnFemVEaMpg3Bl/Hs1yh1WLddTjM7ZfjO6cEDBvGWR/fAmqp6yqG6Tmoxwf3+qxR/ngsloSUE+F8217MOg=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 439904bc458a6403
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=UPMIYLAGmrb5/4Y5REZjnSJTbGhJjLeDPavSkGvaCKDDrhZaiFB32EC/4C5C83msv/wH0yegggQ5nphXFYBUrYRY7bbLGhI9pHZkMwjwYdyc2OOzXxdDrnObe8q1SFM8YMxTvfH+/aeDXSKvnP/7UpNZP7sMgOZRDedvGQR4lDCBYPt5H1rvVBAf9dqa3qv1QUSrsUcNfACDQj5OYM6PHCQ4Dspkia8CKdNzktEolUCj4e7NpO00t9LTYltsZ9q5R9fnSkmh/fInBVGTRuHa6XZK3EvwIMzra8VHNiSj+o8qQIQb7bgWP9wnofWMRpuvZdkW5IEYVLfCFd1LH8cWxw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=47wYujmxUbwb3Q4zhgp3DtFcdHgmy7H65HQAdh2HAng=;
 b=TbAbx5A67tr82HvZzQdrw37Pt767EBi25afUXJAwqWSjD2sFhZVADgHcP55jnW4v3/58YFFq/ymHA1OIf9BHPYzhJ6k7z8AJ0rgGS572jTtePiP1MdLEFUoqUPfe5gvpyAGGS+X/54z2ZnCCeG94PwHQFYjNfS+iR8mOan/Ld2/NtNjXkzeQ1HnMVnBfEym/dDgTS2XTMnOvFIbOyDkCPViFTwS82q2xBKcUkYO5JRLTW2+8YxVo2elknGmOAOnt/c838qpxcMWDDDNwrTQNZ37NQlv0pae/PtJNPrLjKURA+pSSoeF+yAcGklBytfNlzZdK7cUCUnnYOErUqLWotQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=47wYujmxUbwb3Q4zhgp3DtFcdHgmy7H65HQAdh2HAng=;
 b=Q2qSvwvPZ6Qq9RBkFo02EqRm6Hfa1Qumc5K/pGsa8F3gPKplyb6p8KzxOCG6piX4kZqtT0UTXHxNf+1hqdqkKNIvxlnFemVEaMpg3Bl/Hs1yh1WLddTjM7ZfjO6cEDBvGWR/fAmqp6yqG6Tmoxwf3+qxR/ngsloSUE+F8217MOg=
From: Rahul Singh <Rahul.Singh@arm.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Luca Fancellu <Luca.Fancellu@arm.com>, Xen-devel
	<xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, "michal.orzel@amd.com" <michal.orzel@amd.com>,
	"xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
	"ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
	"consulting@bugseng.com" <consulting@bugseng.com>,
	"andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
	"roger.pau@citrix.com" <roger.pau@citrix.com>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, "julien@xen.org" <julien@xen.org>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>, Nicola Vetrini
	<nicola.vetrini@bugseng.com>
Subject: Re: [XEN PATCH v3 2/3] xen/drivers/passthrough/arm/smmu-v3.c: fix
 violations of MISRA C:2012 Rule 3.1
Thread-Topic: [XEN PATCH v3 2/3] xen/drivers/passthrough/arm/smmu-v3.c: fix
 violations of MISRA C:2012 Rule 3.1
Thread-Index: AQHZqnF+MEQOQBJ9JkqCgXsEWfzVu6+h3a0AgAfsJYCAARnyAA==
Date: Wed, 5 Jul 2023 08:40:49 +0000
Message-ID: <B53B7ADE-56F0-45D1-992B-BCC9B29C82AB@arm.com>
References: <cover.1688032865.git.nicola.vetrini@bugseng.com>
 <8a8d5ed47f24791d3927345fafed07023a8b0b76.1688032865.git.nicola.vetrini@bugseng.com>
 <55390224-89CC-44E9-95B1-BBA491BBFEF3@arm.com>
 <3a192d6a-4a4d-b798-c205-ebc0a2302c50@suse.com>
In-Reply-To: <3a192d6a-4a4d-b798-c205-ebc0a2302c50@suse.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM9PR08MB7165:EE_|DB9PR08MB9826:EE_|AM7EUR03FT047:EE_|DB8PR08MB5468:EE_
X-MS-Office365-Filtering-Correlation-Id: 654d83db-5133-4336-6f73-08db7d338de3
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 8Bnho6c4oKNadBgRJ1SYUm6sXvV8lYBT/ZsDNJ6Tfz24CVab/UbDMAg/OAUtdMhcm/hceEZSe14q405CfIQyUMC5mzFIo/QiBp5kCH0CWgOU/RFNiilhTzVmrr849N/GU9dXJ5R1/NPegDAxNxhuHPFFCi3fG3pd0HSvbaId/Ryjf3ySqdG63kvuRc108bHSbgPivOyvXMPeE/V1aQOzBrKmgJkPxgJ/Lu8AcGXmeRmgGjy/BzPbLck2Ieel1NIBcnqWWFSnIFgrfenBnZpsREvpBvqvYYIohUqai0ZuRYwQuNc0NrqxrGygUrkxJgSyClnbBDSAtedMJpoxuxMLRGuoD7rgXi/PyCvonIk8P24a1mTQwwhMHVKS5QNXRNC8wt9XKdjXnikFmQnVSP6lL45s/3w8HldMncQduLUVly1LsqLljI4Ggt/gp93pWcTffWg6xiCzK/pQkQA3pD73oFnD+9cuGdnYB5DEyUlVzxpaMQ9rCFhmQTTKM3GRcLgnrHGaJYu4bY2Xrk+C0U24zlBnARMhhilphy9sBmo4cJ75pe+rSnqp13/0QBc/slMRgqpV7Dx4zEFqsGuqYDAsyA3/a9RUXqSZtc47EfHsYGtz2iPDeRXRAXJz8iQR4yV+1A5M+xr9nXj3YU+pqh56xQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR08MB7165.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(39860400002)(396003)(136003)(346002)(451199021)(41300700001)(478600001)(6512007)(38070700005)(54906003)(86362001)(38100700002)(122000001)(6486002)(71200400001)(91956017)(4326008)(316002)(66446008)(83380400001)(6916009)(33656002)(66476007)(64756008)(66556008)(36756003)(76116006)(66946007)(2906002)(2616005)(186003)(6506007)(26005)(8676002)(8936002)(5660300002)(53546011)(7416002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <908282B890F28742A521DD70F1948C71@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB9826
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT047.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	d9127a41-951c-4569-b7d2-08db7d338886
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	/WL/m9xDrwMb/anVh4lMjIMpELECZpFX28R1zAK41PYuTaGtDrJzrFK+V8Vh040J+3MLGeiLKm1+KL8/iNKq1n2OBk5YwiO4eONZxH89/difVwfYb7dY0LI4Lgr+J7GKx6Wrl0+v5Ep4/2Go1tnF7PmTRIJPLtZUNWJpZVkwjDymursToVgpLfCSNoEwRgXgsxCobumsAXoS5CVH0FIiMFC/eTKRgo6PFjAqR1PtQk03GoJW24FtL2M4JAmsi019NU+2lRYWXb+cust23SnybqEndNuGVjBAE5kf4RCgxc1FpJxF4jgF9o8hg56WI9+HGKTluN/YKQHoJMUkYYmT9jlbW91FmpHeFG3ImYeRA315tvjdo9GHY/xafejByw0It4oLq8OhwCJWa/leZoxTzkg7y5QBm0agofnpWLDv5+Cg+I+bNjwDSZKFDh5AgZ5oc/Q0L3x5TkR1xw3IrMj95fSLeZVs5+B2hACc3Z9C7LFU4PYY7eVs7bE+yvtkPr7Vb7ucTswaWOo0sO26oMc4DPOoU0xjA0hJHpntXRqW6OLoNw7zPEvHRRG73MX/F8FVf7YnqPibqJaFlH6xIRXMMeHrMzC9/ZdNDU6aO4hBAT0i4uB7rEw3SMn4YJNcnUngPMJX/gSSDCdoH31DNLI1loelt3lTxGq7zG8qbZwHgZLDJq+8cZKy7OFqUwi/xML51+TSSGjMZy4fayo+b6YGBueoj24CPiTCf8YzXAKtP9vl97G8DRnCA+aigUK9joRl
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(136003)(346002)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(6486002)(478600001)(70586007)(54906003)(2616005)(83380400001)(36860700001)(47076005)(336012)(33656002)(36756003)(86362001)(40480700001)(2906002)(82310400005)(53546011)(186003)(6506007)(26005)(70206006)(107886003)(6512007)(81166007)(356005)(82740400003)(40460700003)(316002)(4326008)(41300700001)(8936002)(8676002)(6862004)(5660300002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 08:40:57.9728
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 654d83db-5133-4336-6f73-08db7d338de3
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT047.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5468

SGksDQoNCj4gT24gNCBKdWwgMjAyMywgYXQgNDo1MSBwbSwgSmFuIEJldWxpY2ggPGpiZXVsaWNo
QHN1c2UuY29tPiB3cm90ZToNCj4gDQo+IE9uIDI5LjA2LjIwMjMgMTY6NTIsIEx1Y2EgRmFuY2Vs
bHUgd3JvdGU6DQ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PiBBbHNvIGhlcmUsIG1heSBJIHN1
Z2dlc3QgdG8gdXNlIHRoaXMgY29tbWl0IHRpdGxlIGluc3RlYWQ/DQo+PiDigJx4ZW4vYXJtOiBz
bW11djM6IEZpeCB2aW9sYXRpb25zIG9mIE1JU1JBIEM6MjAxMiBSdWxlIDMuMeKAnQ0KPiANCj4g
SnVzdCB0byBtZW50aW9uIGl0OiBQZXJzb25hbGx5IEknbSBhdmVyc2UgdG8gc3VjaCBkb3VibGUg
c3ViamVjdCBwcmVmaXhlcy4NCj4gV2h5IHdvdWxkIChoZXJlKSAieGVuL3NtbXV2MzogIiBub3Qg
YmUgc3VmZmljaWVudCAoYW5kIGVudGlyZWx5IHVuYW1iaWd1b3VzKT8NCg0KV2l0aCB0aGUgY2hh
bmdlcyBzdWdnZXN0ZWQgYWJvdmUuDQoNCkFja2VkLWJ5OiBSYWh1bCBTaW5naCA8cmFodWwuc2lu
Z2hAYXJtLmNvbT4NCg0KUmVnYXJkcywNClJhaHVsDQoNCg0K


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 08:57:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 08:57:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558849.873295 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyJy-0006lq-6r; Wed, 05 Jul 2023 08:57:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558849.873295; Wed, 05 Jul 2023 08:57:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyJy-0006lj-2T; Wed, 05 Jul 2023 08:57:10 +0000
Received: by outflank-mailman (input) for mailman id 558849;
 Wed, 05 Jul 2023 08:57:09 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGyJx-0006ld-5T
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 08:57:09 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGyJv-0002PD-Tz; Wed, 05 Jul 2023 08:57:07 +0000
Received: from 54-240-197-234.amazon.com ([54.240.197.234] helo=[192.168.9.70])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGyJv-0004Dk-Ml; Wed, 05 Jul 2023 08:57:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=C7Wx+OvRT57vH8OmMmUDvyBzeLaEHIugBf5phm/IHPo=; b=u0eLEYe6oyRuGuvPO1t9I3A9ey
	fZv6+dNuXTR0LDftDs7rLoo69wIMq1cydKV8Kv7AHnx7jHU3ZxZ64VWPG705AQA8QtUNLQ4ktECsE
	aUL6Poc1WhR+P4TTrs0+8ha+alvLgIuWl1YkS3dMd7GPWUbc1V5pZWEY854KZN/VUX2o=;
Message-ID: <24a0c426-0030-a35f-0178-fb0551fb1f35@xen.org>
Date: Wed, 5 Jul 2023 09:57:04 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v3 2/3] xen/drivers/passthrough/arm/smmu-v3.c: fix
 violations of MISRA C:2012 Rule 3.1
Content-Language: en-US
To: Rahul Singh <Rahul.Singh@arm.com>, Jan Beulich <jbeulich@suse.com>
Cc: Luca Fancellu <Luca.Fancellu@arm.com>,
 Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 "xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
 "ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
 "consulting@bugseng.com" <consulting@bugseng.com>,
 "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
 "roger.pau@citrix.com" <roger.pau@citrix.com>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Nicola Vetrini <nicola.vetrini@bugseng.com>
References: <cover.1688032865.git.nicola.vetrini@bugseng.com>
 <8a8d5ed47f24791d3927345fafed07023a8b0b76.1688032865.git.nicola.vetrini@bugseng.com>
 <55390224-89CC-44E9-95B1-BBA491BBFEF3@arm.com>
 <3a192d6a-4a4d-b798-c205-ebc0a2302c50@suse.com>
 <B53B7ADE-56F0-45D1-992B-BCC9B29C82AB@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <B53B7ADE-56F0-45D1-992B-BCC9B29C82AB@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Rahul,

On 05/07/2023 09:40, Rahul Singh wrote:
>> On 4 Jul 2023, at 4:51 pm, Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 29.06.2023 16:52, Luca Fancellu wrote:
>>>
>>>
>>>> On 29 Jun 2023, at 11:06, Nicola Vetrini <nicola.vetrini@bugseng.com> wrote:
>>>>
>>>> In the file `xen/drivers/passthrough/arm/smmu-v3.c' there are a few occurrences
>>>
>>> here you use a different character to enclose the file path (` vs â€˜) may I suggest to
>>> use only (â€˜)?
>>>
>>>> of nested '//' character sequences inside C-style comment blocks, which violate
>>>> Rule 3.1.
>>>>
>>>> The patch aims to resolve those by replacing the nested comments with
>>>> equivalent constructs that do not violate the rule.
>>>>
>>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>>
>>> You are missing the â€œ---â€œ here, meaning that the lines below are part of the
>>> commit message and Iâ€™m sure you donâ€™t want that.
>>>
>>> Also here, may I suggest to use this commit title instead?
>>> â€œxen/arm: smmuv3: Fix violations of MISRA C:2012 Rule 3.1â€
>>
>> Just to mention it: Personally I'm averse to such double subject prefixes.
>> Why would (here) "xen/smmuv3: " not be sufficient (and entirely unambiguous)?
> 
> With the changes suggested above.

There are conflicting suggestions about the title. So it is not clear to 
me which one you are referring to.

I will assume you were happy either way and so picked Luca's proposal 
and committed.

> 
> Acked-by: Rahul Singh <rahul.singh@arm.com>
> 
> Regards,
> Rahul
> 
> 

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 08:59:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 08:59:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558853.873305 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyM4-0007K0-Gm; Wed, 05 Jul 2023 08:59:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558853.873305; Wed, 05 Jul 2023 08:59:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyM4-0007Jt-Dt; Wed, 05 Jul 2023 08:59:20 +0000
Received: by outflank-mailman (input) for mailman id 558853;
 Wed, 05 Jul 2023 08:59:19 +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
 <SRS0=hFzj=CX=citrix.com=prvs=5438f3518=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qGyM3-0007Jl-Nu
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 08:59:19 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 37c232d1-1b12-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 10:59:17 +0200 (CEST)
Received: from mail-bn7nam10lp2102.outbound.protection.outlook.com (HELO
 NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.102])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 05 Jul 2023 04:59:13 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by PH0PR03MB6477.namprd03.prod.outlook.com (2603:10b6:510:be::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 08:59:10 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902%7]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 08:59:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 37c232d1-1b12-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688547557;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=RDLM8wX+GFsJLjZT93hHlvwkcV8Cd/txxT9hjTWWjpw=;
  b=NUfS09SkGb3D1nSRVJdk5hPhd46x2v34bhYH7emjFppwwE2SNBR+ZzdM
   0pgVDQgFtlahVt7aISZRztFnfU9nv9TJbmJeB+K60VkcM/A5UJYoSbd3a
   nPp/UOJ+KgL49y+JSHbGwz2ApnXpYmBMjsPY9fO8nhDBeoPvF7BsLoOD3
   s=;
X-IronPort-RemoteIP: 104.47.70.102
X-IronPort-MID: 115221195
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:Yp8Sdq3exf7+DMztMvbD5UFwkn2cJEfYwER7XKvMYLTBsI5bpzdSx
 2FJDDyPPP2IZ2X9e9hyaY2z/UkAvJHQzNNjHgFqpC1hF35El5HIVI+TRqvS04F+DeWYFR46s
 J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo
 tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5gNmOKgS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL
 87fwbew+H/u/ht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0R69a9py?=
X-IronPort-AV: E=Sophos;i="6.01,182,1684814400"; 
   d="scan'208";a="115221195"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ZB4PK9ZNgQSx/o7fYZHTzH7L0eTaUdUQaWZ4RGDseuAC3WRW7oHKxamDsFgo/yLUIyzAVKgR9IUYF4VlEbqwsFXPmBGgR/w9Pc+cy702rHJeC16Xi01fo34qLOHl4xpVZJVXkoayQhUNlQNgcfjS+cDuCbGanOgU8nJ6VSv2AETwmzcX0870xH16xV+s/X+LOaj6qvUgxIdVijQp8Q1svOmiOBy5UQPZebwEcWYMcLiPYEabWs+31UTPeP7+sHNwkDp3sNzgim5HPeMSaI/+rLLVuT4T4sEWIgbMcGBkBydHAeKWOdQ+Ix5KLMjkpcG8NhPG0Ucjck9IjBCOjOnU4w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=vG5yjm9LnzT5cClrs/a/AivTKV0lSsBI0fIE2N1cEy8=;
 b=PB3aAldRPgOpPN1v8IxxVPr7U/GGeUahz2nxsE8fd6TKf2QAoTSKU56x8lUG4jNNU77Hat7iiywymtAzNnZY1IIDZMD6FIMGM0NSfNj6kqO56Jy7SiIvMxje3nU1MpGRz+ujMgWty6zc/BRqYsMvMZKth8dOpMcbhCjRXFLWCEveQgKK+7qtImejijQ515dTQlqZajHUQtDERdmgZ9eU3dNV4ZKjzogZL+xo4zAXPrP8Np8+sG5SrDIKX+RVQJqqedCyeRZo/WNZsnAlytlqlrl5pXOE9LAcmFt6ttx3AX8FYqx6ea45Gorenh7RB6OI7WVRmCuAGWofQ7htjgV/oA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=vG5yjm9LnzT5cClrs/a/AivTKV0lSsBI0fIE2N1cEy8=;
 b=iv1AOrU1Ql5pav2goyBBLx0qICG4G+84eJ4tejPNiYOTp1aCk9HL9EUdr86aB6HjfKD5+UJkyu5prdDmtw92uHtWjQ1ooie0fdTPTkUhM6hmxl3vpilNhu686JbdBiPcFIAgxT1zy0OsL95bi1qperaDwWHNLh2othgXMYJetLQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Wed, 5 Jul 2023 10:59:04 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Paul Durrant <paul@xen.org>
Subject: Re: [PATCH v7 01/12] vpci: introduce per-domain lock to protect vpci
 structure
Message-ID: <ZKUw2MPBhOSgG-Eg@MacBook-Air-de-Roger.local>
References: <20230613103159.524763-1-volodymyr_babchuk@epam.com>
 <20230613103159.524763-2-volodymyr_babchuk@epam.com>
 <ZIyOCan//39V3bdy@MacBook-Air-de-Roger.local>
 <87352kpj04.fsf@epam.com>
 <ZJQDGOrP1I3hR5Jj@MacBook-Air-de-Roger.local>
 <87ilbfnqmo.fsf@epam.com>
 <ZJVc77SwvyKOEdnJ@MacBook-Air-de-Roger.local>
 <87wmzfmltd.fsf@epam.com>
 <ab79bcb6-6fc8-c68f-65bf-16ce7316c3ae@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <ab79bcb6-6fc8-c68f-65bf-16ce7316c3ae@suse.com>
X-ClientProxiedBy: LO4P265CA0180.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:311::11) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|PH0PR03MB6477:EE_
X-MS-Office365-Filtering-Correlation-Id: 6f523658-282e-4b6a-a5de-08db7d3618f3
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	FeQHBjioexWrkXsJ4DJ5A58DAQy+NTPHirG+FRZ7tq4JhpFUwb+/P5U2pz6hwec4Ykpgd7RCkDN63t8XqyMbcdSVuxaT09Gf7TWH04i7dcXK3FlHlma4Z+k2vyxsZSWpS4K99tzjTBwtT+porRpGPNVThGldJQnY9BfQC6YzuE6dPYvq/tc0QTvfyuXIKLueSXe2uSXTOLOlK9h+VZrnkHUcRUYVxMJBrA4r4WyHxXIGbbETRWwScCsG9HS5t5PoTc86MIG0UvOWdBl/KI+xVr7cSbMZvUgS2RTiqvk1WuqZEtCjOaGebArIaxOunPUvxLGyGKwIs0lTlT2QfSsfHWKsmkbmTz5BARjLTmKP30YSzusBsOiMyaFpKi3/cgLzOkN4dXGL37buGcXvLfl1FgpU8yRoWZwFbGYKYx9pOiluwsUgC8GN96JwlKkH/pxna8ppuFl0lxtC5zGYfaqu2ApZsFRv3nmMGx4LJyJmf2aQca0LT4u7YH7BRr6W1o8KTQ4kLJrpfTZDaQmE9ibxXd2cQLLLQxb0WAKkdrLBCBFGbUK4Oukksjgrj7myFB9R
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(39860400002)(136003)(396003)(346002)(451199021)(85182001)(7416002)(86362001)(2906002)(5660300002)(6512007)(186003)(83380400001)(9686003)(6506007)(26005)(53546011)(6666004)(54906003)(6486002)(82960400001)(66946007)(66556008)(66476007)(6916009)(38100700002)(316002)(4326008)(478600001)(8936002)(8676002)(41300700001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Vk5PREU2RUtmSTFabmVxOVcwQ05BK2ppQnZrS3NSdE5ISk8wM05GcTF3UGY2?=
 =?utf-8?B?cHVGcFhCTmdSUlN5UHdCbGxneTh0Smhta0I3RlZmSDZPbkt5R0tNNU5ac3BL?=
 =?utf-8?B?TzdYRU9MbmN6YmhKM2FrRmFuSzA3dGQxc0NSY1dLK2twZkFsNEFXL2x4cURG?=
 =?utf-8?B?WkdHaDJ5ci9TQlJRekxlV2RDSFhnZW80VlVGOEVRQmVaL2UwRXdzenNBLzQr?=
 =?utf-8?B?bnlnRFpiZEl6Vng0eThUTlEyck5NclRNejJrdlhXZmh5akVOWTlnUlBsRGly?=
 =?utf-8?B?NDlSZTlsMk05bnlHR2llK1ZvZ0tLQ1hGaitJRFlvTUdnZDZwYkVEM2hSMlk5?=
 =?utf-8?B?bjAxS3BPY29YV085R0NQdFZQK3ZjQjFrUUk1MENsWE0xTXcxNXljbHFyTUkv?=
 =?utf-8?B?S3cvVmtucHpWK21NQVF3bk1QNGg0OHo5UzJQYTRNbHpuSnMxdWI2UmFWaXdM?=
 =?utf-8?B?Qkk2TkNsRkJIb09ENGkrbW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ExternalHop-MessageData-0:
	CrJh6lwCWjvLfZAJ/izPtYukb2hHKx1XGOlvfDLPAYHnAAQIvhw/0VA4wHI2fmcEQVxUJgb838hyh+gHMXguaAwtpo44Z6f0AMT/oB1VUSItqVg8YeqvE318bO9WGRHHwdHrK7/PvTD1Z1fzxlP1Y05NTXpDCWlqR/a4Huy6UmHm2RR9NqjCPvJu1WEKVlbNd1pihI6Idr2IV30jJAeyxOJqT5UZk1wIOBAyiCPwJET96Hd2/tuvBmEuPMBEMmtMUy1KyVVVXobjl+knAPdtTuimwGTpY1C0hhxmilsnhONbf5hKXh99Kbrx1t5oSS2t+udDeHxdAL5zcI5j04Q3KBQNJJ/JwFfahkBhHd+Rp9iSTIY1f1U4YIeIgS57IhhJsPKLByyRFvx+1+d7t3Wm+c2zIeST/1YCwe4CSzzR85PufNXlJuStbZmwww1HysRQEQo9XWztjFOTwDBmoyAywXOCK7K9dzbcoMYjcw9Cc1uFTP1cqzARbaIW+4pydcmHZUKYTAKAJgCDBrEY1WP+bv7IkDQpNuo9sTHvMItYKC6c8R0dg9tXrc7o++h6LLd0pzo15bfMv6AKe92YPj5kFSIo4V6R/z7FndWwKb3hagWpuSpY8spibGGcyFZZbq2E2e90QF7LpJTyVrZ3bt7LRYS5RG9dhSAL4RUonqtX/AnQe6DMLmw05HNL9RY0I9BNt4xsuUgozc0sDiB33eLw98IEtFZiY5Q4KY1dKk5eCBnmw8HoXz0N3NOnWdyqouX15dGkWtCw2m+SKyjJg5bqN+Vk2uIYGI23yXfE/Zzb0mCPGrC5rKgrBnpJXhXlLqzEyCR98dpMuF5VazeHV/RWaOcNshxi5D603T7kJfTBQGVepw3uqbWBpWLmjI5lEYUv
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6f523658-282e-4b6a-a5de-08db7d3618f3
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 08:59:10.6377
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: I9f183Xlpu++pynbtqSZD9/NtjUzXtORQK1MmYWUWjKZKY1TjoL5YK1TFgpZ0VWxNZUrOY1xNsnQwa9yXw1R5Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB6477

On Wed, Jul 05, 2023 at 09:11:10AM +0200, Jan Beulich wrote:
> On 04.07.2023 23:03, Volodymyr Babchuk wrote:
> > I am currently implementing your proposal (along with Jan's
> > suggestions), but I am facing ABBA deadlock with IOMMU's
> > reassign_device() call, which has this piece of code:
> > 
> >         list_move(&pdev->domain_list, &target->pdev_list);
> > 
> > My immediate change was:
> > 
> >         write_lock(&pdev->domain->pci_lock);
> >         list_del(&pdev->domain_list);
> >         write_unlock(&pdev->domain->pci_lock);
> > 
> >         write_lock(&target->pci_lock);
> >         list_add(&pdev->domain_list, &target->pdev_list);
> >         write_unlock(&target->pci_lock);
> > 
> > But this will not work because reassign_device is called from
> > pci_release_devices() which iterates over d->pdev_list, so we need to
> > take a d->pci_lock early.
> > 
> > Any suggestions on how to fix this? My idea is to remove a device from a
> > list one at time:
> > 
> > int pci_release_devices(struct domain *d)
> > {
> >     struct pci_dev *pdev;
> >     u8 bus, devfn;
> >     int ret;
> > 
> >     pcidevs_lock();
> >     write_lock(&d->pci_lock);
> >     ret = arch_pci_clean_pirqs(d);
> >     if ( ret )
> >     {
> >         pcidevs_unlock();
> >         write_unlock(&d->pci_lock);
> >         return ret;
> >     }
> > 
> >     while ( !list_empty(&d->pdev_list) )
> >     {
> >         pdev = list_entry(&d->pdev_list, struct pci_dev, domain_list);
> >         bus = pdev->bus;
> >         devfn = pdev->devfn;
> >         list_del(&pdev->domain_list);
> >         write_unlock(&d->pci_lock);
> >         ret = deassign_device(d, pdev->seg, bus, devfn) ?: ret;
> >         write_lock(&d->pci_lock);
> 
> I think it needs doing almost like this, but with two more tweaks and
> no list_del() right here (first and foremost to avoid needing to
> figure whether removing early isn't going to subtly break anything;
> see below for an error case that would end up with changed behavior):
> 
>     while ( !list_empty(&d->pdev_list) )
>     {
>         const struct pci_dev *pdev = list_first_entry(&d->pdev_list, struct pci_dev, domain_list);
>         uint16_t seg = pdev->seg;
>         uint8_t bus = pdev->bus;
>         uint8_t devfn = pdev->devfn;
> 
>         write_unlock(&d->pci_lock);

I think you need to remove the device from the pdev_list before
dropping the lock, or else release could race with other operations.

That's unlikely, but still if the lock is dropped and the routine
needs to operate on the device it is better remove such device from
the domain so other operations cannot get a reference to it.

Otherwise you could modify reassign_device() implementations so they
require the caller to hold the source->pci_lock when calling the
routine, but that's ugly because the lock would need to be dropped in
order to reassign the device from source to target domains.

Another option would be to move the whole d->pdev_list to a local
variable (so that d->pdev_list would be empty) and then iterate over
it without the d->pci_lock.  On failure you would take the lock and
add the failing device back into d->pdev_list.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:03:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:03:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558860.873315 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyQE-0000RH-6Y; Wed, 05 Jul 2023 09:03:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558860.873315; Wed, 05 Jul 2023 09:03:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyQE-0000RA-2T; Wed, 05 Jul 2023 09:03:38 +0000
Received: by outflank-mailman (input) for mailman id 558860;
 Wed, 05 Jul 2023 09:03:36 +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
 <SRS0=TfY/=CX=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qGyQC-0000R4-Dq
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:03:36 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0623.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::623])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d1d54b8b-1b12-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:03:33 +0200 (CEST)
Received: from AM6PR05CA0028.eurprd05.prod.outlook.com (2603:10a6:20b:2e::41)
 by PAXPR08MB6477.eurprd08.prod.outlook.com (2603:10a6:102:12d::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 09:03:31 +0000
Received: from AM7EUR03FT031.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:2e:cafe::79) by AM6PR05CA0028.outlook.office365.com
 (2603:10a6:20b:2e::41) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 09:03:31 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT031.mail.protection.outlook.com (100.127.140.84) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.23 via Frontend Transport; Wed, 5 Jul 2023 09:03:30 +0000
Received: ("Tessian outbound c63645f235c1:v142");
 Wed, 05 Jul 2023 09:03:30 +0000
Received: from 38f707b2579c.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 3A65B337-F8B1-4BD8-8C9E-A965FEF15041.1; 
 Wed, 05 Jul 2023 09:03:23 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 38f707b2579c.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 09:03:23 +0000
Received: from DB6PR0301CA0079.eurprd03.prod.outlook.com (2603:10a6:6:30::26)
 by DBBPR08MB6217.eurprd08.prod.outlook.com (2603:10a6:10:201::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 09:03:19 +0000
Received: from DBAEUR03FT028.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:6:30:cafe::15) by DB6PR0301CA0079.outlook.office365.com
 (2603:10a6:6:30::26) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 09:03:19 +0000
Received: from nebula.arm.com (40.67.248.234) by
 DBAEUR03FT028.mail.protection.outlook.com (100.127.142.236) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.18 via Frontend Transport; Wed, 5 Jul 2023 09:03:19 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com
 (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 5 Jul
 2023 09:03:18 +0000
Received: from [10.169.188.49] (10.169.188.49) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Wed, 5 Jul 2023 09:03:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d1d54b8b-1b12-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BEbyc0mJr7qR8OXQc2PSISr0q3slBBd/4Umzp6DkF9A=;
 b=eCQqLIee/fGeJiJt+YnC7hhDBHx2f86BtG6DHQZQRl4tKXve+3D3Fs6MA8zWmvDNh4KKmg9Na5K6hCfCI9+sp8DpykHNZLCOnJcx5GtwnPUocY/hpTiqUE9R0AwoFMTs3oPxy3WDj1XU470LvZZnZWanLm/pTl9VqlzEHCouEto=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: da6fc12ba7ce0ab4
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=eGZt+Kns/HH6zktBFi07GcyceL4AWPeMtxVYgmZulYmxDxu/oML6L47m1b6N3NyAQ5jTLOOaL4ppMsga9k7sPNnbCmTBgIB2PHDBXVxcMknvevbv/LVHHzTHx6Ut62WT97VIb/pFiO3K0bkymbs6n9jtSQj7Yo/DwM9rLDt/0yktjP3rgca0MDoGT+pBH1Dnos0dwxaGlE62odED/N+81NZRHr/+bXpdQu/nWq/qfwMtBnzR3pFbEeJA3CarFs1Dn0MQitd2FEADOO2r+DYqGwZEO4p9tDXopSz3ku6ATzlQIQcjDypHE2a1YDCHdMPxQZsozDSsKBevHWtBKQQzyQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BEbyc0mJr7qR8OXQc2PSISr0q3slBBd/4Umzp6DkF9A=;
 b=g9qDHKWCeH4xRwBNJYH5zW2rG8gPREIW/P6FxomODA6Tprg23eK9v9260nKZ0EZCSAr4AqcOMf/iHqZ6hUkyPtVnMvmbYClZVajTxjm/1rPCvzKOXlSQZBB3nYFIyuwSbaMlAFjJ11a3/qwqjpG2U7d/ErZ0AvKkA5a0aPv5YXbonnLKAhIBC57ym5xTlYlDJtzvdM6tdfNBM02sDzmQ9+dl/JTNlM0ymxRpzOjOlo+xKkNI/LO8AzL0p3XxjXA61brVZ6qMO4CJ3prfN//UOAwki7JTsbqKX2BjPwcZmLrbDXCrJ/HD2o6dydftLBqdtZTmjfcsJc2HMEYbprpYfQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BEbyc0mJr7qR8OXQc2PSISr0q3slBBd/4Umzp6DkF9A=;
 b=eCQqLIee/fGeJiJt+YnC7hhDBHx2f86BtG6DHQZQRl4tKXve+3D3Fs6MA8zWmvDNh4KKmg9Na5K6hCfCI9+sp8DpykHNZLCOnJcx5GtwnPUocY/hpTiqUE9R0AwoFMTs3oPxy3WDj1XU470LvZZnZWanLm/pTl9VqlzEHCouEto=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <02df8ce2-fa68-614b-87ce-82bb5b60d2a1@arm.com>
Date: Wed, 5 Jul 2023 17:03:14 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 12/52] xen/mmu: extract early uart mapping from
 setup_fixmap
Content-Language: en-US
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-13-Penny.Zheng@arm.com>
 <78862bb8-fd7f-5a51-a7ae-3c5b5998ed80@xen.org>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <78862bb8-fd7f-5a51-a7ae-3c5b5998ed80@xen.org>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	DBAEUR03FT028:EE_|DBBPR08MB6217:EE_|AM7EUR03FT031:EE_|PAXPR08MB6477:EE_
X-MS-Office365-Filtering-Correlation-Id: 2c74c5ed-805f-4d35-3578-08db7d36b413
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 c82Omk+HmS2gGyIOnwEandcbiJY+dKnq68qZjqAC4wYrMY4tpyUIjMjxA0tt4c0PmFBp30ElK5m5u8Q5GaIES6Teae4lSbatN57UiUp8QXfNxYs8W7mjQR1fgMiTDsjNSSTjzIWuHs3CcYIm3Iub66WAl8bWKKfVvCFa7GbhieZodtpjiGNasl9IpYMSwRmiSGoG6LG83XKtGoBDstQnYPXGF8NfpiVicZnz3VDoC9yy/P3AmHrXatxzY8493g+b1CaImRAmAK8f2fm3bK8z3lDgOMGmZjloZwr5JolJclNBSWNmqMrV7XoRAerjH+k4oziRmhFzVbhS1pr30eo4ZEDGOeT7sy3QxjYdOwTplbqLS6lOK/V9DY1RDuNxeIdT5VLx0tC8+BJo1mMnf2ruXHkrzVIqv3Rkj7weC1Dbhb9F41sJ0NHJvN94AcOuk4oWKhYOsf0xL4IuzObgfYMJf3TKGaNwb55a9Mllv7hISqV8zWPRbiwXEL0vpbIkIiuEb66zdA8yB6hnpIScVRULJR0V9UY2s7Z/FEY7X9CgTjvubYrlpCI+W/dWTbbl0L0Dl715wOjbRj1elbvRTjR8TgFd0MafrOfmvKeWaqdB8rzNnjr4bqWegizSPEet07iw6SKcNjIzYBRz3dcf6D0pvkgN2d7+EbzkUWhAEXiBnkiTIDVbB4pP2wLBZ4Jtbz9SiLwaXu4ElHaTVEoem/x3/NLi1t10Ns1Ye8kwpR2BHn0P3gCUyV9kF+llakc6XyOgc+mfZGnNnyW5IyX74zg//z4jYd7D5FxHMnTWDNB/5aE/5OVJ1UEj6rlYxLruXFTe+CdE2Xr4ReCj54SereaRyQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(136003)(396003)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(41300700001)(2906002)(5660300002)(40460700003)(44832011)(8936002)(8676002)(82310400005)(36756003)(40480700001)(31696002)(86362001)(31686004)(2616005)(82740400003)(426003)(336012)(478600001)(186003)(53546011)(26005)(70586007)(4326008)(70206006)(36860700001)(316002)(110136005)(83380400001)(356005)(54906003)(16576012)(47076005)(81166007)(3940600001)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6217
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT031.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	ef962ad9-a18f-4f59-f31b-08db7d36ad65
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	oyKy0XPx2jgAIasQRw1Iw0Wv76uXNR8/Mlnqdq1BOsoVdJ2S+iZSlfVzF2Kf+MUDSm1Fwu57traJMIn5lWtPb3xUk4WjIPXd0Bv08dEqlWekl5Ga9r/6oWYrZhYwVZ13e+v7AJkrTLIxqrv/DDU/nkEOVKSBuWLe2d4K9VAA0cTi1oVpNuTd5YGr9/MsfDSiarxMVdSxRqawIg0HnO0k06FhrL97v28UduXzDU3AFC83UiI9Uvdid30MND3LgSObQNVfo4qy95trH2n4vYFWkmYE74XuP0NYK2cF2GS8DmdBgXnQwkMi39qpdCI15kYpa/kob7xPBo6rNkGNBkBdKmkxKv6KNOxRaHYRNjsua7dpmgRKijLGqaCUMctru3YIBaIDKpZDk/u1fBRKmwzu4mjkgQTUgoz6BWwvDLl7cf/ANZIvRu2vnYBcGMBNg+phCNYAHN5ToJWmhsoNv/eqV2XxH8B+ayUw3PLAMJFGP0bbszEgdLfABgqmMgnSNAVUJ7osWXzMDw30m8dPWMsL4b1uJlcZGp9MrrpA8huqWnbdkTdwgOR79mu6aQVljycpm1cFUnJJiUQbyjI/mCesfEQnUEYA3dH1aFCgaJsN+vSF1YzBegKA2hiUZlrFZUDpdqABTbzJPtRmcw7TQwi5eExdbGL5MQR7h1MdYbxpajvscQfzusxVpddOykTt4CQBaI4pwiVk8hJTDV5VRIB0BLPHUM4IQ8q0U3n+xgmZ0cwCa9mMWTXetOg5hx191oMyRI+xvO1I2o6Ut6IWqeedXjosbm/7tRPl1YB7POxYYgzWUK/Mn2T/okyF9Z5nhi7U
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(376002)(136003)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(54906003)(16576012)(26005)(44832011)(186003)(53546011)(86362001)(8676002)(31696002)(2906002)(8936002)(110136005)(36756003)(31686004)(5660300002)(41300700001)(40460700003)(478600001)(81166007)(4326008)(40480700001)(82740400003)(70586007)(70206006)(2616005)(47076005)(336012)(82310400005)(83380400001)(36860700001)(316002)(426003)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 09:03:30.5295
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 2c74c5ed-805f-4d35-3578-08db7d36b413
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT031.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6477

Hi Julien

On 2023/7/5 06:25, Julien Grall wrote:
> Hi Penny,
> 
> Title: You want to clarify that this change is arm64 only. So:
> 
> xen/arm64: mmu: ...
> 
> On 26/06/2023 04:34, Penny Zheng wrote:
>> Original setup_fixmap is actually doing two seperate tasks, one is 
>> enabling
>> the early UART when earlyprintk on, and the other is to set up the fixmap
>> even when earlyprintk is not configured.
>>
>> To be more dedicated and precise, the old function shall be split into 
>> two
>> functions, setup_early_uart and new setup_fixmap.
> While some of the split before would be warrant even without the MPU 
> support. This one is not because there is limited point to have 3 lines 
> function. So I think you want to justify based on what you plan to do 
> with the MPU code.
> 
> That said, I don't think we need to introduce setup_fixmap. See below.
> 
> 
>>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> ---
>> v3:
>> - new patch
>> ---
>> Â  xen/arch/arm/arm64/head.SÂ Â Â Â  |Â  3 +++
>> Â  xen/arch/arm/arm64/mmu/head.S | 24 +++++++++++++++++-------
>> Â  2 files changed, 20 insertions(+), 7 deletions(-)
>>
>> diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
>> index e63886b037..55a4cfe69e 100644
>> --- a/xen/arch/arm/arm64/head.S
>> +++ b/xen/arch/arm/arm64/head.S
>> @@ -258,7 +258,10 @@ real_start_efi:
>> Â Â Â Â Â Â Â Â Â  bÂ Â Â Â  enable_boot_mm
>> Â  primary_switched:
>> +Â Â Â Â Â Â Â  blÂ Â Â  setup_early_uart
>> +#ifdef CONFIG_HAS_FIXMAP
>> Â Â Â Â Â Â Â Â Â  blÂ Â Â  setup_fixmap
>> +#endif
>> Â  #ifdef CONFIG_EARLY_PRINTK
>> Â Â Â Â Â Â Â Â Â  /* Use a virtual address to access the UART. */
>> Â Â Â Â Â Â Â Â Â  ldrÂ Â  x23, =EARLY_UART_VIRTUAL_ADDRESS
>> diff --git a/xen/arch/arm/arm64/mmu/head.S 
>> b/xen/arch/arm/arm64/mmu/head.S
>> index 2b209fc3ce..295596aca1 100644
>> --- a/xen/arch/arm/arm64/mmu/head.S
>> +++ b/xen/arch/arm/arm64/mmu/head.S
>> @@ -367,24 +367,34 @@ identity_mapping_removed:
>> Â  ENDPROC(remove_identity_mapping)
>> Â  /*
>> - * Map the UART in the fixmap (when earlyprintk is used) and hook the
>> - * fixmap table in the page tables.
>> - *
>> - * The fixmap cannot be mapped in create_page_tables because it may
>> - * clash with the 1:1 mapping.
> 
> Since commit 9d267c049d92 ("xen/arm64: Rework the memory layout"), there 
> is no chance that the fixmap will clash with the 1:1 mapping. So rather 
> than introducing a new function, I would move the creation of the fixmap 
> in create_pagetables().
> 

Understood. I'll move the creation of the fixmap in create_pagetables().

> This would avoid the #ifdef CONFIG_HAS_FIXMAP in head.S.
> 
>> + * Map the UART in the fixmap (when earlyprintk is used)
>> Â Â  *
>> Â Â  * Inputs:
>> - *Â Â  x20: Physical offset
>> Â Â  *Â Â  x23: Early UART base physical address
>> Â Â  *
>> Â Â  * Clobbers x0 - x3
>> Â Â  */
>> -ENTRY(setup_fixmap)
>> +ENTRY(setup_early_uart)
>> Â  #ifdef CONFIG_EARLY_PRINTK
>> Â Â Â Â Â Â Â Â Â  /* Add UART to the fixmap table */
>> Â Â Â Â Â Â Â Â Â  ldrÂ Â  x0, =EARLY_UART_VIRTUAL_ADDRESS
>> Â Â Â Â Â Â Â Â Â  create_mapping_entry xen_fixmap, x0, x23, x1, x2, x3, 
>> type=PT_DEV_L3
>> +Â Â Â Â Â Â Â  /* Ensure any page table updates made above have occurred. */
>> +Â Â Â Â Â Â Â  dsbÂ Â  nshst
>> +
>> +Â Â Â Â Â Â Â  ret
> 
> The 'ret' needs to be outside of the '#ifdef' block. But, in this case, 
> I would prefer if we don't call setup_early_uart() when 
> !CONFIG_EARLY_PRINTK in head.S
> 

okay. I'll move the #ifdef to the caller in head.S.

>> Â  #endif
>> +ENDPROC(setup_early_uart)
>> +
>> +/*
>> + * Map the fixmap table in the page tables.
>> + *
>> + * The fixmap cannot be mapped in create_page_tables because it may
>> + * clash with the 1:1 mapping.
>> + *
>> + * Clobbers x0 - x3
>> + */
>> +ENTRY(setup_fixmap)
>> Â Â Â Â Â Â Â Â Â  /* Map fixmap into boot_second */
>> Â Â Â Â Â Â Â Â Â  ldrÂ Â  x0, =FIXMAP_ADDR(0)
>> Â Â Â Â Â Â Â Â Â  create_table_entry boot_second, xen_fixmap, x0, 2, x1, x2, x3
> 
> Cheeers,
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:13:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:13:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558864.873324 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyZu-0001w1-2w; Wed, 05 Jul 2023 09:13:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558864.873324; Wed, 05 Jul 2023 09:13:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyZu-0001vu-0M; Wed, 05 Jul 2023 09:13:38 +0000
Received: by outflank-mailman (input) for mailman id 558864;
 Wed, 05 Jul 2023 09:13:36 +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 <SRS0=dIgq=CX=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGyZs-0001vo-SB
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:13:36 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2054.outbound.protection.outlook.com [40.107.13.54])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 37bb9380-1b14-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:13:34 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB7508.eurprd04.prod.outlook.com (2603:10a6:20b:283::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 09:13:05 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 09:13:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 37bb9380-1b14-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BrHmlSK/zm0oG6NGBSpgVwSAVumzhhDefHD0n6SHm669mhalEMDI7ehNSVMb3XwB9dVM0nOtKozzLdhHqFsqKdz2ZQJJLfz5xLru6eTCdUsxIjqVNFQbwJm5SGTtiAyXOkU6Pr1eilPkbRYk1cHfBJOa9bkpaMsiwxpWBxyLXzBnUODXutLlZK5drf0f1GeIjjEV65LKNCALnoJWm6LZxP3Cp7oE+/6NAcDGIf5zJga6BttHfOjop3S/XyGHPNsDSPTQz8pChO29AucLVMdMeO12dJ91dSqIiRChhY/cIzOiZDTXchPTOdz/X8+RsB4Vsq2+aMTFD9rmDHxTlYanxQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=FBxPdtL2k+f4qliEAI+mXmeIC4RVSonltR3JhEIQmbE=;
 b=IvALZep3JIw/jAkR0Qz3BuWo5RLYyfB2j1he4Lpk/CLE2Efs9Ce+aFhJ5dZ5mdhf+LHcoiL3OcB2x7mOU1fYdWTHAiPMuVeflYHrS05c6f2ok6gHCfRVOMtYotfR0opugJoJqE/gyfzUrnH+PG97WDaiV9phHVPcez+qMPhEs/6ojNn8YUPNoQipOAPxkcbVkCWPEWzfNMQk1knm4+3bYROnIZYPZdY9kY3M2NXVkN9zq2MkVY0FWoi8ViH9mzuiHE+cV1JpKvd6u/A3C69xAJxs+O0KNze5y29+IZwHneDFWCDXmyvrz3gxGjCRtptcSH3xK722e73y6nWMymTcrA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=FBxPdtL2k+f4qliEAI+mXmeIC4RVSonltR3JhEIQmbE=;
 b=QGd5jHpDVi74WaZckM58tjHfF7CaFB240WQNbnfjgyktP4DPWuXoDcpEXdz25xJ8Vqb8ftulXl6By9oG0yzgag3UKdAYayxtbGsXdVg0iW6RbZxdnb/gXXtptvXDKExTY/DPbyktCc7iQYKutbrJso1cjiwra18k7lgQwzFo8kxRJyyMOWElkmbvRxgY8yuab+PABUD5x/96damGVV56gg7MGvuiUpQvA6W+4haHjMwUGMBEmFoySfEI9+NmsOyfnFcaDQt8Pdn2RBOeAlsMfsEDAHVzsYrKfn3E1oszuristvnZVDa4tsazrKksp5sqwgdyZGqZPE/YhSrgQ57hyg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <a964cffa-fb42-b0e0-e60a-1044d8794193@suse.com>
Date: Wed, 5 Jul 2023 11:13:03 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v7 01/12] vpci: introduce per-domain lock to protect vpci
 structure
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Paul Durrant <paul@xen.org>
References: <20230613103159.524763-1-volodymyr_babchuk@epam.com>
 <20230613103159.524763-2-volodymyr_babchuk@epam.com>
 <ZIyOCan//39V3bdy@MacBook-Air-de-Roger.local> <87352kpj04.fsf@epam.com>
 <ZJQDGOrP1I3hR5Jj@MacBook-Air-de-Roger.local> <87ilbfnqmo.fsf@epam.com>
 <ZJVc77SwvyKOEdnJ@MacBook-Air-de-Roger.local> <87wmzfmltd.fsf@epam.com>
 <ab79bcb6-6fc8-c68f-65bf-16ce7316c3ae@suse.com>
 <ZKUw2MPBhOSgG-Eg@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZKUw2MPBhOSgG-Eg@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0086.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1f::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB7508:EE_
X-MS-Office365-Filtering-Correlation-Id: 8a0e63a4-a52b-49f5-95b7-08db7d380a6e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	b4svr/RmGRc9jLzxDOnN6Sv597cLV0eGCI+qohoP03YDsgh83bGGl9CfUcXlwI9gHrkCoBo4hNEH5mkNXr+/b3HjOynj+x2t++wwz+qM/OJiJneYNCHI1pMx1PG85TYWTznI9ZjYImdiepukMK+QiCVsLsZFlhZGNmMuH8jvrUje25ySvyTTsTsUu+lDp8+e6Kn4Kf0oylfc+SqFa62MLRdL24So9x3p3scVmunPlmxzyDC6VfC1hFMCetpdsBr9/kU4c/KFr1ZFO+NEvK6b6SPTcqw6puqOR3H5goYasVlaZkLDJZYRuzfG5nNJOX4Z7mdFMSymJGnN4OQgJ8vye8FEDB03b6ZbsURJXRltCpoMpU64oXL/XNBMLJsgbgwUCdtj6Gdalc1JrlnYd0VDrwBUmFS38lkxyEmtqTXKryV7/xjchu2ZgakLU672GIyuupovJB8ov9+P89rCw+Y9sTBBmz2P8mdZF9Qds8iqkwuFOsjbhY45Sc4gZtZ156MjNrKiuVObJYK7DiY1QZZcz7HOFULQ0eeuAi8cgoX2jpbNHOBqH/qxW8eacd+SOuSQE0mVaLb0WTLNkwlsjFzG58gWYfGCnhkXycSdrR3NIy3jNKCNFtlNdwuvPIxhOAAd0PzVGCbtCC0RIAmafqBiOA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(346002)(366004)(136003)(396003)(451199021)(316002)(8936002)(83380400001)(8676002)(54906003)(38100700002)(41300700001)(66556008)(4326008)(6916009)(66476007)(66946007)(36756003)(186003)(26005)(6512007)(6486002)(86362001)(31696002)(7416002)(5660300002)(478600001)(6506007)(2906002)(31686004)(2616005)(53546011)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MDFUbUl1V0J2Y0NBeWlnTktMWk5tM2EvTXVub1NuRzRYQTNSaUdmalNsVW4x?=
 =?utf-8?B?SmhycmNsU1V1Y0NmY3pFNHg4b3FLaCtjN2w4QUF1WXdxRHhUTVMrVkdYVzlI?=
 =?utf-8?B?R21oaUlwZDI4ZVE1djZQMndLVkJ3Si9sK0FBelJGa21YL3BCOVZYOXdGbG5i?=
 =?utf-8?B?aUsyVjJTdEsvZzZWdUJ2T2wzUHFwT0g1bjNCZFlaek0wTEczZEYxbnpON0Yw?=
 =?utf-8?B?Qm9GRmNOL0poTU1veDVCMDhNVnYrdk4rRVk2ZVJCMHZ0SlpmQ2JzWkNUckVB?=
 =?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2FPSGZ2MnVjZXg3czRMY1ZSSWlYMFNJdVdT?=
 =?utf-8?B?UTNRb2pDQW5PaTc1dUNBK01kKzRhNUh1UVZ6YUtUQmpxQlMwZW9qcEdrc1JQ?=
 =?utf-8?Q?TW2lBFV2puQoEF4xaDvITQmAp?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8a0e63a4-a52b-49f5-95b7-08db7d380a6e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 09:13:05.0745
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Lr23Ccx7ixmFS/NvrvCdEwVnICoHvtQihNi3JsHNH1LQFZMPIzQAAMpuZyq6NSrnYmlBH4C4rIXghDNQCMTw8w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7508

On 05.07.2023 10:59, Roger Pau MonnÃ© wrote:
> On Wed, Jul 05, 2023 at 09:11:10AM +0200, Jan Beulich wrote:
>> On 04.07.2023 23:03, Volodymyr Babchuk wrote:
>>> I am currently implementing your proposal (along with Jan's
>>> suggestions), but I am facing ABBA deadlock with IOMMU's
>>> reassign_device() call, which has this piece of code:
>>>
>>>         list_move(&pdev->domain_list, &target->pdev_list);
>>>
>>> My immediate change was:
>>>
>>>         write_lock(&pdev->domain->pci_lock);
>>>         list_del(&pdev->domain_list);
>>>         write_unlock(&pdev->domain->pci_lock);
>>>
>>>         write_lock(&target->pci_lock);
>>>         list_add(&pdev->domain_list, &target->pdev_list);
>>>         write_unlock(&target->pci_lock);
>>>
>>> But this will not work because reassign_device is called from
>>> pci_release_devices() which iterates over d->pdev_list, so we need to
>>> take a d->pci_lock early.
>>>
>>> Any suggestions on how to fix this? My idea is to remove a device from a
>>> list one at time:
>>>
>>> int pci_release_devices(struct domain *d)
>>> {
>>>     struct pci_dev *pdev;
>>>     u8 bus, devfn;
>>>     int ret;
>>>
>>>     pcidevs_lock();
>>>     write_lock(&d->pci_lock);
>>>     ret = arch_pci_clean_pirqs(d);
>>>     if ( ret )
>>>     {
>>>         pcidevs_unlock();
>>>         write_unlock(&d->pci_lock);
>>>         return ret;
>>>     }
>>>
>>>     while ( !list_empty(&d->pdev_list) )
>>>     {
>>>         pdev = list_entry(&d->pdev_list, struct pci_dev, domain_list);
>>>         bus = pdev->bus;
>>>         devfn = pdev->devfn;
>>>         list_del(&pdev->domain_list);
>>>         write_unlock(&d->pci_lock);
>>>         ret = deassign_device(d, pdev->seg, bus, devfn) ?: ret;
>>>         write_lock(&d->pci_lock);
>>
>> I think it needs doing almost like this, but with two more tweaks and
>> no list_del() right here (first and foremost to avoid needing to
>> figure whether removing early isn't going to subtly break anything;
>> see below for an error case that would end up with changed behavior):
>>
>>     while ( !list_empty(&d->pdev_list) )
>>     {
>>         const struct pci_dev *pdev = list_first_entry(&d->pdev_list, struct pci_dev, domain_list);
>>         uint16_t seg = pdev->seg;
>>         uint8_t bus = pdev->bus;
>>         uint8_t devfn = pdev->devfn;
>>
>>         write_unlock(&d->pci_lock);
> 
> I think you need to remove the device from the pdev_list before
> dropping the lock, or else release could race with other operations.
> 
> That's unlikely, but still if the lock is dropped and the routine
> needs to operate on the device it is better remove such device from
> the domain so other operations cannot get a reference to it.
> 
> Otherwise you could modify reassign_device() implementations so they
> require the caller to hold the source->pci_lock when calling the
> routine, but that's ugly because the lock would need to be dropped in
> order to reassign the device from source to target domains.
> 
> Another option would be to move the whole d->pdev_list to a local
> variable (so that d->pdev_list would be empty) and then iterate over
> it without the d->pci_lock.  On failure you would take the lock and
> add the failing device back into d->pdev_list.

Conceptually I like this last variant, but like the individual list_del()
it requires auditing code for no dependency on the device still being on
that list. In fact deassign_device()'s use of pci_get_pdev() does. The
function would then need changing to have struct pci_dev * passed in.
Yet who knows where else there are uses of pci_get_pdev() lurking.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:24:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:24:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558868.873335 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyjx-0003RZ-0J; Wed, 05 Jul 2023 09:24:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558868.873335; Wed, 05 Jul 2023 09:24:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyjw-0003RS-Ts; Wed, 05 Jul 2023 09:24:00 +0000
Received: by outflank-mailman (input) for mailman id 558868;
 Wed, 05 Jul 2023 09:23:59 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGyjv-0003RH-9U; Wed, 05 Jul 2023 09:23:59 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGyju-00031G-RL; Wed, 05 Jul 2023 09:23:58 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGyju-0002ZU-CX; Wed, 05 Jul 2023 09:23:58 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qGyju-0008GY-C3; Wed, 05 Jul 2023 09:23:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=exywVMH/icvPrwaShkCnFrcbfV9XfIRnLwe+U4JtkpI=; b=fpV+gYIPr7hm0XxIdCF00T+AEH
	9znLnNy4730APPXygKaFtlDH3NifDVQJLm1hAnwGv06RWi8RvHofiHaShVXHjwAL0ZvvdI7NCuD7b
	LhKYLB6PSpTR8lyQdZapxHfEXKcDH8zfJ6DIrXDf83mSA0RDiTdFT0VPPLbWrUx1jhLY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181701-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181701: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=5c02dbd0e0adbe6100128345328999876fc78d00
X-Osstest-Versions-That:
    xen=12314be5749ecbb338d42ad10df059def6fc259a
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 05 Jul 2023 09:23:58 +0000

flight 181701 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181701/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  5c02dbd0e0adbe6100128345328999876fc78d00
baseline version:
 xen                  12314be5749ecbb338d42ad10df059def6fc259a

Last test of basis   181698  2023-07-04 22:01:54 Z    0 days
Testing same since   181701  2023-07-05 07:01:53 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Anthony PERARD <anthony.perard@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Jason Andryuk <jandryuk@gmail.com>
  Julien Grall <jgrall@amazon.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   12314be574..5c02dbd0e0  5c02dbd0e0adbe6100128345328999876fc78d00 -> smoke


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:25:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:25:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558876.873344 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGylW-00045K-Em; Wed, 05 Jul 2023 09:25:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558876.873344; Wed, 05 Jul 2023 09:25:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGylW-00045D-CH; Wed, 05 Jul 2023 09:25:38 +0000
Received: by outflank-mailman (input) for mailman id 558876;
 Wed, 05 Jul 2023 09:25:36 +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 <SRS0=rv0Z=CX=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qGylU-000452-LB
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:25:36 +0000
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com
 [2a00:1450:4864:20::132])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e490d042-1b15-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:25:33 +0200 (CEST)
Received: by mail-lf1-x132.google.com with SMTP id
 2adb3069b0e04-4f95bf5c493so9784305e87.3
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:25:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e490d042-1b15-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1688549133; x=1691141133;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=0pJd0CkwnAImw3NilWU6OnypmhAU7YxkyhGF94aLpIE=;
        b=bwvZVb0GHtSzc+R9WMXphYf3E1H9MtpRux2UdqEc7qnLxbyAayr7P8f0DR0sGzhiGQ
         IlCS7+Ixns8vb+PG/ISsqXPUMl1QSd3T0lkbW4S+TmQuS/CoIN2UiUWIfSfq+AIu3kSz
         U0fF2Kq/5yKrOazrHv1OU3R/Y5NwsGID0X874=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549133; x=1691141133;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=0pJd0CkwnAImw3NilWU6OnypmhAU7YxkyhGF94aLpIE=;
        b=K0zk8etgcMU2hgtHdzQja/hSysIOqMYe67iW78YCvGTIXSp10uAJl0AMOBs8qB3ToR
         7SwEnuKnv+kSG2bxdidB2SoqldjLBEFrop3Yr58rY7g2tXWdgRwPZdA97peIzif0nTCV
         OvabFAukdOXkQYAaMifLvC+c5GDsiHnUxRQp2//SVxeedcJk3RqrwjRkmOHv7aejlWbh
         nYxQuAggBcPemqOAfRD3AQWvLN8HgHrStJ/RtQm/lbnNef7JnSzCoofvjG7sgouLohMr
         L6Z01Lwo+iZiOF/iYCq0O8S5RZYXHmDodwZWjbv9T3BHcuLYRagQjVBQ07SkoEcVyFLw
         DaqA==
X-Gm-Message-State: ABy/qLZoR6RDCUdckpe0U6qT9WBPoglAiZNiW185fK2kECrIv5BwaAvj
	q1eLtEsDgM2co9a4H4lXrERDXVNgphezLXLqXBH+Cg==
X-Google-Smtp-Source: APBJJlF0J9mgg+iEe3+37ZZZKVPR9DjI6BJWb33J02eTDuwnjmrQUMZj1+/1VxR8NxjIt9PlzlcvyNYRNIyk8qT4iH8=
X-Received: by 2002:a05:6512:3a83:b0:4f9:92c7:4026 with SMTP id
 q3-20020a0565123a8300b004f992c74026mr13582462lfu.1.1688549133271; Wed, 05 Jul
 2023 02:25:33 -0700 (PDT)
MIME-Version: 1.0
References: <20230630113756.672607-1-george.dunlap@cloud.com> <b046ddf8-d70b-e2db-f996-32e6a7164cd8@citrix.com>
In-Reply-To: <b046ddf8-d70b-e2db-f996-32e6a7164cd8@citrix.com>
From: George Dunlap <george.dunlap@cloud.com>
Date: Wed, 5 Jul 2023 10:25:22 +0100
Message-ID: <CA+zSX=bqf4QspF=ZW+rWwkfNp3u4xYjzDipsJX9_j2CpdtdhLg@mail.gmail.com>
Subject: Re: [PATCH 1/2] credit: Limit load balancing to once per millisecond
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org, Dario Faggioli <dfaggioli@suse.com>, 
	George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
	Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
Content-Type: multipart/alternative; boundary="0000000000004654a305ffb9fb06"

--0000000000004654a305ffb9fb06
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 4, 2023 at 6:34=E2=80=AFPM Andrew Cooper <andrew.cooper3@citrix=
.com>
wrote:

> On 30/06/2023 12:37 pm, George Dunlap wrote:
> >
> >  docs/misc/xen-command-line.pandoc |  6 +++++
> >  xen/common/sched/credit.c         | 40 ++++++++++++++++++++++++++-----
> >  xen/include/public/sysctl.h       |  6 +++++
>
> Given this filelist, why the sysctl change?
>
> There's no logic to drive this parameter in the xc/libxl param get/set.
>
> The only two in-tree users I can see are xenpm, along with an
> unconditional print to stderr saying it's deprecated and to use xl, and x=
l.
>

Yes.  I think unless someone objects then, I'll drop the sysctl interface
from this patch, and add it in a follow-up patch (perhaps at a later date,
depending on how much time I have this week).


> > diff --git a/docs/misc/xen-command-line.pandoc
> b/docs/misc/xen-command-line.pandoc
> > index 4060ebdc5d..369557020f 100644
> > --- a/docs/misc/xen-command-line.pandoc
> > +++ b/docs/misc/xen-command-line.pandoc
> > @@ -1856,6 +1856,12 @@ By default, Xen will use the INVPCID instruction
> for TLB management if
> >  it is available.  This option can be used to cause Xen to fall back to
> >  older mechanisms, which are generally slower.
> >
> > +### load-balance-ratelimit
> > +> `=3D <integer>`
> > +
> > +The minimum interval between load balancing events on a given pcpu.
> > +At the moment only credit honors this parameter.
>
> So this is intended to be a global scheduler parameter?
>

Yes; nearly every scheduler does load balancing, and so any scheduler may
need this sort of limitation at some point.  It doesn't make sense to have
separate, nearly identical parameters for each scheduler.  At some point
this should probably be implemented for credit2, although perhaps with a
different default.

Ack on the two style comments.

 -George

--0000000000004654a305ffb9fb06
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Tue, Jul 4, 2023 at 6:34=E2=80=AFP=
M Andrew Cooper &lt;<a href=3D"mailto:andrew.cooper3@citrix.com" target=3D"=
_blank">andrew.cooper3@citrix.com</a>&gt; wrote:<br></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex">On 30/06/2023 12:37 pm, George Dunlap wrot=
e:<br>
&gt;<br>
&gt;=C2=A0 docs/misc/xen-command-line.pandoc |=C2=A0 6 +++++<br>
&gt;=C2=A0 xen/common/sched/credit.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 40 =
++++++++++++++++++++++++++-----<br>
&gt;=C2=A0 xen/include/public/sysctl.h=C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 6 =
+++++<br>
<br>
Given this filelist, why the sysctl change?<br>
<br>
There&#39;s no logic to drive this parameter in the xc/libxl param get/set.=
<br>
<br>
The only two in-tree users I can see are xenpm, along with an<br>
unconditional print to stderr saying it&#39;s deprecated and to use xl, and=
 xl.<br></blockquote><div><br></div><div>Yes.=C2=A0 I think unless someone =
objects then, I&#39;ll drop the sysctl interface from this patch, and add i=
t in a follow-up patch (perhaps at a later date, depending on how much time=
 I have this week).</div><div>=C2=A0</div><blockquote class=3D"gmail_quote"=
 style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);p=
adding-left:1ex">&gt; diff --git a/docs/misc/xen-command-line.pandoc b/docs=
/misc/xen-command-line.pandoc<br>
&gt; index 4060ebdc5d..369557020f 100644<br>
&gt; --- a/docs/misc/xen-command-line.pandoc<br>
&gt; +++ b/docs/misc/xen-command-line.pandoc<br>
&gt; @@ -1856,6 +1856,12 @@ By default, Xen will use the INVPCID instructio=
n for TLB management if<br>
&gt;=C2=A0 it is available.=C2=A0 This option can be used to cause Xen to f=
all back to<br>
&gt;=C2=A0 older mechanisms, which are generally slower.<br>
&gt;=C2=A0 <br>
&gt; +### load-balance-ratelimit<br>
&gt; +&gt; `=3D &lt;integer&gt;`<br>
&gt; +<br>
&gt; +The minimum interval between load balancing events on a given pcpu.<b=
r>
&gt; +At the moment only credit honors this parameter.<br>
<br>
So this is intended to be a global scheduler parameter?<br></blockquote><di=
v><br></div><div>Yes; nearly every scheduler does load balancing, and so an=
y scheduler may need this sort of limitation at some point.=C2=A0 It doesn&=
#39;t make sense to have separate, nearly identical parameters for each sch=
eduler.=C2=A0 At some point this should probably be implemented for credit2=
, although perhaps with a different default.</div><div>=C2=A0</div><div>Ack=
 on the two style comments.</div><div><br></div><div>=C2=A0-George</div></d=
iv></div>

--0000000000004654a305ffb9fb06--


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:35:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:35:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558880.873355 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyuu-0005bU-B8; Wed, 05 Jul 2023 09:35:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558880.873355; Wed, 05 Jul 2023 09:35:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyuu-0005bN-8O; Wed, 05 Jul 2023 09:35:20 +0000
Received: by outflank-mailman (input) for mailman id 558880;
 Wed, 05 Jul 2023 09:35:19 +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
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyut-0005bC-23
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:19 +0000
Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com
 [2a00:1450:4864:20::233])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3fb296f6-1b17-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:35:16 +0200 (CEST)
Received: by mail-lj1-x233.google.com with SMTP id
 38308e7fff4ca-2b6ef9ed2fdso36662041fa.2
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:16 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.14
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:14 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3fb296f6-1b17-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549715; x=1691141715;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=a3cqS5r3oqkVrzUD3FuBWRly6cy1Q56WUAG1mwp9IVg=;
        b=dXJt2HAbAAz0Zsk/xzoOJAuHhuBNpqe7Almwxv9PedoLPzQZFu2hccO+FVlqZ83zk/
         kA5uKImVCb/1F2F6khe6K0XHKykmOg/Jk+5tjS2QyJxORcKO5zW+GikJ01Lwyd1YIot0
         7+CKZU85yJdgb2cOv7AGWjOqId7oBLLm0WNyiYjeq7IzoMWs49w0G07RA0MzmUq24GgZ
         l1FTkgyBJsiWqmVrjfYzNf33lhgcz/nKsY/JfHOjHXSZV9dWVUKVT5izwZtfyBYaO6OW
         FKpdNBFppB2dGfwRzTYC9iy2/6TpOnYiJgUX4LdD4bqrUU9za6CyuCMOqp3x5gp2WHRT
         fcsA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549715; x=1691141715;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=a3cqS5r3oqkVrzUD3FuBWRly6cy1Q56WUAG1mwp9IVg=;
        b=MXRLXHa/1Akhh5VyoypsMvCxP7uzU9SObFsRsZE2JxEIsDZAwS4lQOLoxSR6QV/9CK
         EgeK6DgvZ2boSu7msaoTEkgi51CbH0w3H3c5nC9Dif5ZLuvDct9el5CBimI5Dcdr4iCp
         QWnPijKdaR/egmwQ24gtpxcSrv/VOFB8Z/k3J9YCZoQ5JR2Ues7c7P4DcUHIvvtUhb71
         fmFvQ628/zzJ3IunveeYCKQKhStoPThsy+RRHztPTaiT1WFMh479uBflbBNTtQ3oZuKq
         qWwdlfy+smoCmRiA+aFd0XlI78RP4NHJL5e89S/rm54a4B+9/vECe85HKtu8vTF+rPh2
         Jo5A==
X-Gm-Message-State: ABy/qLZHKMgOEZLfeUY+93ed+mYTB9Z2xPOD4RfnWFIJIKweTctkqnl1
	lnADC2jXR0qPT/zM5unDPBIzTi9dVKk+DWKjbOk=
X-Google-Smtp-Source: APBJJlEOEfFzi0IlDl8BbrCDYLs1XGwnfJefrHM5qdcSEzmj8uRTcBqW6+Qceo1bC0zNya0ib2MZVg==
X-Received: by 2002:a2e:9c87:0:b0:2b5:9d78:213e with SMTP id x7-20020a2e9c87000000b002b59d78213emr11287897lji.22.1688549715278;
        Wed, 05 Jul 2023 02:35:15 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [XEN PATCH v9 00/24] Xen FF-A mediator
Date: Wed,  5 Jul 2023 11:34:09 +0200
Message-Id: <20230705093433.2514898-1-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Hi,

This patch sets add an FF-A [1] mediator to the TEE mediator framework
already present in Xen.  The FF-A mediator implements the subset of the
FF-A 1.1 specification needed to communicate with OP-TEE using FF-A as
transport mechanism instead of SMC/HVC as with the TEE mediator. It allows
a similar design in OP-TEE as with the TEE mediator where OP-TEE presents
one virtual partition of itself to each guest in Xen.

The FF-A mediator is generic in the sense it has nothing OP-TEE specific
except that only the subset needed for OP-TEE is implemented so far. The
hooks needed to inform OP-TEE that a guest is created or destroyed are part
of the FF-A specification.

It should be possible to extend the FF-A mediator to implement a larger
portion of the FF-A 1.1 specification without breaking with the way OP-TEE
is communicated with here. So it should be possible to support any TEE or
Secure Partition using FF-A as transport with this mediator.

The patches are also available at https://github.com/jenswi-linaro/xen
branch "xen_ffa_v9".

With help from Bertrand I've integrated this in a test setup with OP-TEE.
Please check prerequisites at
https://optee.readthedocs.io/en/latest/building/prerequisites.html

My setup is duplicated using:
repo init -u https://github.com/jenswi-linaro/manifest.git -m qemu_v8.xml \
        -b qemu_xen_ffa
repo sync -j8
cd build
make -j8 toolchains
make -j8 all
make run-only

Test in dom0 with for instance:
xtest 1004

at the prompt.

To start up a domu and connect to it do:
cd /mnt/host/build/qemu_v8/xen
xl create guest_ffa.cfg
xl console domu

Then test as usual with "xtest 1004".

The setup uses the branch "ffa" from https://github.com/jenswi-linaro/xen.
That's currently the same as the "xen_ffa_v9" branch, but the "ffa" branch
may change later as I update for a new version of the patch set.

[1] https://developer.arm.com/documentation/den0077/latest

Thanks,
Jens

v8->v9:
* Patch "xen/arm: ffa: add remaining SMC function IDs"
  - mention the documentation number used
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
* Patch "xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET"
  - Adding a reference to the documentation
  - Renaming FFA_PART_PROP_IS_MASK to FFA_PART_PROP_IS_TYPE_MASK
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
* Patch "xen/arm: ffa: add defines for framework direct request/response messages"
  - add a reference to the documentation
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
* Patch "docs: add Arm FF-A mediator"
  - Updating the wording as requested.
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
  - Fixing a few typos and adding a reference to the code for a list of
    limitations
* Patch "xen/arm: ffa: list current limitations"
  - Fixing a couple of typos
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
  - Removing an invalid limitation of FFA_RXTX_MAP_*
* Patch "xen/arm: ffa: add defines for sharing memory"
  - Fixing a few typos
  - Adding a reference to the documentation
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
  - Updating FFA_MAX_SHM_PAGE_COUNT to have a safe margin to
    TEEC_CONFIG_SHAREDMEM_MAX_SIZE
* Patch "xen/arm: ffa: add direct request support"
  - Fixing a coding style issue
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
  - Updating the TODO comment about features.
* Patch "xen/arm: ffa: send guest events to Secure Partitions"
  - Adding a TODO comment and a limit on the loop in ffa_direct_req_send_vm()
* Patch "xen/arm: ffa: support mapping guest RX/TX buffers"
  - Change FFA_MAX_RXTX_PAGE_COUNT to 1 with a TODO for a larger value
  - Replace !p2m_is_ram(t) test with t != p2m_ram_rw
  - Rename the introduced field tx_is_free to tx_is_free
* Patch "xen/arm: ffa: support sharing memory"
  - Fixing read_atomic() issue in get_shm_pages()
  - Fixing style issue in free_ffa_shm_mem()
  - Replace !p2m_is_ram(t) test with t != p2m_ram_rw in get_shm_pages()
* Patch "tools: add Arm FF-A mediator"
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
  - Adding Acked-by: Anthony PERARD <anthony.perard@citrix.com>
  - Moving the patch to just before the docs patch.
* Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com to:
  - "xen/arm: ffa: enforce dependency on 4k pages"
  - "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h"
  - "xen/arm: ffa: add ABI structs for sharing memory"
* Adding "xen: Introduce arch_domain_teardown()" by Andrew Cooper
* Adding "xen/arm: add TEE teardown to arch_domain_teardown()" 
  based on a patch from Andrew Cooper

v7->v8:
* Adding "xen/arm: ffa: list current limitations" as requested
* Adding tags to "xen/arm: smccc: add support for SMCCCv1.2 extended
  input/output registers"
* Patch "xen/arm: tee: add a primitive FF-A mediator":
  - Changing license for ffa.h and ffa.c to GPL-2.0-only
  - Avoiding IS_ENABLED() in the constant FFA_NR_FUNCS
  - Accepting version 1.1 SPMC only to keep things simple
  - Removes 32bit and only supports 64bit to keep things simple
* Patch "tools: add Arm FF-A mediator"
  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
  - Adding LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE_FFA for the "ffa" value 
    in arch_arm.tee
* Patch "docs: add Arm FF-A mediator"
  - Fixing a spell error
  - Moving the patch last in the series
* Patch "xen/arm: ffa: add remaining SMC function IDs"
  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
  - Renaming the define FFA_MSG_RUN to FFA_RUN to match the specification
* Patch "xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET"
  - Updating the comment describing the flags for FFA_PARTITION_INFO_GET
* Patch "xen/arm: ffa: add defines for framework direct request/response
  messages"
  - Updating the comment describing the flags for MSG_SEND_DIRECT_REQ/RESP
* Patch "xen/arm: ffa: enforce dependency on 4k pages"
  - Updating title of patch
  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
* Patch "xen/arm: ffa: add support for FFA_ID_GET"
  - In ffa_domain_init(), check that domain_id isn't greater than
    UINT16_MAX to avoid a future potential integer overflow in get_vm_id()
* Patch "xen/arm: ffa: add direct request support"
  - Move preemption (interrupted) parts to a separate patch "xen/arm: ffa:
    support preemption of SP during direct request"
  - Remove loop in handle_msg_send_direct_req() to return eventual
    errors back to the VM instead of the SP.
* Patch "xen/arm: ffa: map SPMC rx/tx buffers"
  - Adding a FFA_RXTX_PAGE_COUNT define instead of using 1 directly
* New patch "xen/arm: ffa: support preemption of SP during direct request"
* Patch "xen/arm: ffa: send guest events to Secure Partitions"
  - Replacing unsigned int with uint16_t for subscr_vm_created_count and
    subscr_vm_destroyed_count plus the needed range check to see that
    they don't overflow.
* Patch "xen/arm: ffa: support mapping guest RX/TX buffers"
  - Limit the number of pages in VM RX/TX buffers to 32 using a new
    FFA_MAX_RXTX_PAGE_COUNT define.
* Patch "xen/arm: ffa: support guest FFA_PARTITION_INFO_GET"
  - Renaming tx_is_mine to rx_is_free as requested
  - Simplified the FFA_PARTITION_INFO_GET_COUNT_FLAG check in
    handle_partition_info_get()
  - Adding a comment on ownership of the RX buffer
  - Adding the patch "xen/arm: ffa: improve lock granularity" to address
    parts of the locking concerns.
* Patch "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h"
  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
* Patch "xen/arm: ffa: add defines for sharing memory"
  - Fixing reference for FFA_NORMAL_MEM_REG_ATTR and FFA_MEM_ACC_RW
  - Updating descirption for FFA_MAX_SHM_PAGE_COUNT
* Patch "xen/arm: ffa: add ABI structs for sharing memory"
  - Changing name of the "global_handle" memeber in struct
    ffa_mem_transaction_* to "handle".
* Patch "xen/arm: ffa: support sharing memory"
  - Use FFA_MEM_SHARE_64 only since we changed to only suporting ARM_64.
  - Rename struct ffa_mem_transaction_x to struct ffa_mem_transaction_int
    as requested.
  - Adding a check that shm->page_count isn't 0 before calling share_shm()
  - Masking return value from FFA_MEM_FRAG_RX to avoid an implic cast to
    the int32_t returned by ffa_mem_share().
* Patch "xen/arm: ffa: add support to reclaim shared memory"
  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
* Patch "xen/arm: ffa: support sharing large memory ranges"
  - Adding commetns for struct ffa_ctx
  - Cleaning up and removing the fragmentation state if handle_mem_frag_tx()
    detects an error.
* Adding "xen/arm: ffa: improve lock granularity" to address some of the
  locking concerns.

v6->v7:
* Split some of the larger patches into smaller patches for easier review.
  For instance, the v6 patch "xen/arm: add a primitive FF-A mediator" has
  been replaced with:
  - "xen/arm: add a primitive FF-A mediator"
  - "tools: add Arm FF-A mediator"
  - "docs: add Arm FF-A mediator"
  - "xen/arm: ffa: add remaining SMC function IDs"
* Some small fixes in the error path for handle_mem_share()
* Switched to SPDX for license in new files.
* Fixed comment style issues in
  "xen/arm: smccc: add support for SMCCCv1.2 extended input/output registers"
* Made FFA support UNSUPPORTED in "xen/arm: add a primitive FF-A mediator"
* Replaced ffa_get_call_count() with FFA_NR_FUNCS
* Update the FFA_MAX_SHM_PAGE_COUNT with a formula instead of a value.
* Replaced XEN_ARM_FLAGS_FFA with XEN_DOMCTL_CONFIG_TEE_FFA to minimize impact
  on struct xen_arch_domainconfig. This works because the FF-A mediator and
  the OP-TEE mediator will not be used at the same time in by a guest.
* Replaced "ffa" boolean in the guest config with a new "ffa" value to the
  enumeration "tee_type".
* Integrated the FF-A mediator in the TEE mediator framework instead of
  being its own.
* Rebased on staging as of 2023-02-16

v5->v6:
* Updated "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h"
  commit message and moved the patch right before the patch which needs it.
  Applied Michal Orzel's R-B tag.
* Renamed the guest configuration option "ffa_enabled" to "ffa" and
  updated the description.
* More tools update in "xen/arm: add a primitive FF-A mediator" with the "ffa"
  option, including golang and ocaml.
* Update ffa_domain_init() to return an error if communication with
  the SPMC can't be established.
* Factored out a ffa_domain_destroy() from ffa_relinquish_resources().
* Added ffa_get_call_count() to give an accurate number of FF-A function,
  updated in each patch as new FF-A functions are added.
* Added a flags field in struct xen_arch_domainconfig that replaces the
  ffa_enabled field.
* Made check_mandatory_feature() __init
* Replaced a few printk() calls with gprintk() where needed.
* Rebased on staging as of 2022-09-14

V4->v5:
* Added "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h"
* Added documentation for the "ffa_enabled" guest config flag
* Changed to GPL license for xen/arch/arm/ffa.c
* Added __read_mostly and const where applicable
* Added more describing comments in the code
* Moved list of shared memory object ("ffa_mem_list") into the guest context
  as they are guest specific
* Simplified a few of the simple wrapper functions for SMC to SPMC
* Added a BUILD_BUG_ON(PAGE_SIZE != FFA_PAGE_SIZE) since the mediator
  currently depends on the page size to be same as FFA_PAGE_SIZE (4k).
* Added max number of shared memory object per guest and max number of
  size of each shared memory object
* Added helper macros to calculate offsets of different FF-A data structures
  in the communication buffer instead of relying on pointer arithmetic
* Addressed style issues and other comments
* Broke the commit "xen/arm: add FF-A mediator" into multiple parts, trying
  to add a few features at a time as requested
* Added a missing call to rxtx_unmap() in ffa_relinquish_resources()
* Assignment of "ffa_enabled" is kept as is until I have something definitive
  on the type etc.
* Tested with CONFIG_DEBUG=y

v3->v4:
* Missed v3 and sent a v4 instead by mistake.

v2->v3:
* Generates offsets into struct arm_smccc_1_2_regs with asm-offsets.c in
  order to avoid hard coded offsets in the assembly function
  arm_smccc_1_2_smc()
* Adds an entry in SUPPORT.md on the FF-A status
* Adds a configuration variable "ffa_enabled" to tell if FF-A should be
  enabled for a particular domu guest
* Moves the ffa_frag_list for fragmented memory share requests into
  struct ffa_ctx instead to keep it per guest in order to avoid mixups
  and simplify locking
* Adds a spinlock to struct ffa_ctx for per guest locking
* Addressing style issues and suggestions
* Uses FFA_FEATURES to check that all the needed features are available
  before initializing the mediator
* Rebased on staging as of 2022-06-20

v1->v2:
* Rebased on staging to resolve some merge conflicts as requested

Andrew Cooper (1):
  xen: Introduce arch_domain_teardown()

Jens Wiklander (23):
  xen/arm: add TEE teardown to arch_domain_teardown()
  xen/arm: smccc: add support for SMCCCv1.2 extended input/output
    registers
  xen/arm: tee: add a primitive FF-A mediator
  xen/arm: ffa: add remaining SMC function IDs
  xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET
  xen/arm: ffa: add defines for framework direct request/response
    messages
  xen/arm: ffa: enforce dependency on 4k pages
  xen/arm: ffa: add support for FFA_ID_GET
  xen/arm: ffa: add direct request support
  xen/arm: ffa: map SPMC rx/tx buffers
  xen/arm: ffa: send guest events to Secure Partitions
  xen/arm: ffa: support mapping guest RX/TX buffers
  xen/arm: ffa: support guest FFA_PARTITION_INFO_GET
  xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h
  xen/arm: ffa: add defines for sharing memory
  xen/arm: ffa: add ABI structs for sharing memory
  xen/arm: ffa: support sharing memory
  xen/arm: ffa: add support to reclaim shared memory
  xen/arm: ffa: support sharing large memory ranges
  xen/arm: ffa: improve lock granularity
  xen/arm: ffa: list current limitations
  tools: add Arm FF-A mediator
  docs: add Arm FF-A mediator

 SUPPORT.md                         |    9 +
 docs/man/xl.cfg.5.pod.in           |   15 +
 tools/include/libxl.h              |    5 +
 tools/libs/light/libxl_arm.c       |    3 +
 tools/libs/light/libxl_types.idl   |    3 +-
 xen/arch/arm/arm64/asm-offsets.c   |    9 +
 xen/arch/arm/arm64/smc.S           |   42 +
 xen/arch/arm/domain.c              |   41 +
 xen/arch/arm/include/asm/psci.h    |    4 +
 xen/arch/arm/include/asm/regs.h    |   12 +
 xen/arch/arm/include/asm/smccc.h   |   40 +
 xen/arch/arm/include/asm/tee/ffa.h |   35 +
 xen/arch/arm/include/asm/tee/tee.h |    7 +
 xen/arch/arm/tee/Kconfig           |   11 +
 xen/arch/arm/tee/Makefile          |    1 +
 xen/arch/arm/tee/ffa.c             | 1988 ++++++++++++++++++++++++++++
 xen/arch/arm/tee/optee.c           |   11 +-
 xen/arch/arm/tee/tee.c             |    8 +
 xen/arch/arm/vsmc.c                |   19 +-
 xen/arch/x86/domain.c              |    5 +
 xen/common/domain.c                |    6 +
 xen/include/public/arch-arm.h      |    1 +
 xen/include/xen/domain.h           |    1 +
 xen/include/xen/sched.h            |    1 +
 24 files changed, 2264 insertions(+), 13 deletions(-)
 create mode 100644 xen/arch/arm/include/asm/tee/ffa.h
 create mode 100644 xen/arch/arm/tee/ffa.c

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:35:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:35:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558887.873407 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyv0-0006sH-Fg; Wed, 05 Jul 2023 09:35:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558887.873407; Wed, 05 Jul 2023 09:35:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyv0-0006qn-7L; Wed, 05 Jul 2023 09:35:26 +0000
Received: by outflank-mailman (input) for mailman id 558887;
 Wed, 05 Jul 2023 09:35:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyuy-0006bq-VN
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:24 +0000
Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com
 [2a00:1450:4864:20::12b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 43dcee0b-1b17-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 11:35:23 +0200 (CEST)
Received: by mail-lf1-x12b.google.com with SMTP id
 2adb3069b0e04-4f9fdb0ef35so10482796e87.0
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:23 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 43dcee0b-1b17-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549722; x=1691141722;
        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=4wSiWqYej8EPgULt6otzEwmKVlaIAponcAwfHuOJ0rA=;
        b=r35PHpmueX5C+pIp9nZqViEJktUKqKWBtarwFHhL2i/AgPHEvBdFC8KyHwyTlDrcou
         AssVt2fcoTsmlb4xWImJkUl55hUSUufnAX4NLjvrWqBrY+IZDWwOXKdv+DGCWZPEDjaz
         hsMz/TzFYAvkPLFRRk7yhOC708tUCZXG11u6GQLX2IXRyM7rZ1dyphwMJkFRlUW21yIQ
         xSp6pVbY9HYqwrGd/6pwordftglJ8zOMB2PJPGxW5kX7Eq6/i1DfLUip4OpsOZ33XLC5
         ii2IyefzvcBuiOkjGEsdiKXBbjgZVapiVwSll0CPkiYY21moDwhwF+5zd8IrY3lEmJq8
         HB/A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549722; x=1691141722;
        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=4wSiWqYej8EPgULt6otzEwmKVlaIAponcAwfHuOJ0rA=;
        b=fq//tjTb/zbxQU8oFBeXsq0cr1A1/nUrWJU1YYZkjBi6xfSU9UabOU7An6habjIhTi
         OAyjnwMd07z/wh779DiU8fAPSlitqlSmqgYaVi+1Z57XcUWFHlcz7zlyE48tSxJgOhhO
         VyypjYbzqzMyV+h8OKcBzDgm3rW3EInY8OL9e8XvmxCbjk/5+mqEtK8yRdyuJMXJAOq7
         SrmVYjBZ0ZwnAI/1/2gq1fBwmzOMHa0hLBvqw6tu5+sUBMOy3G6DLY0PZZJHZ83oO90n
         Dgttg5z5ZdS33fSRezPV3491wkbzxOrXxqC9iiUtt9zxVVoc02kxumO/Xn24TBbzS7Xt
         SR7Q==
X-Gm-Message-State: ABy/qLbhNa2eu/XaTiK8Mu0N9hGATf4H8QR4Vk2boOANpTqnwlYl57t+
	CQbm18qJssWeOPI2xZ9VyU30t8BQmIc6MmisjCI=
X-Google-Smtp-Source: APBJJlGqOGGKofqtcuqgQggNsgp6inqP9Q8bZx6Tf0C0P7PTqa8fNrFX6V4UqNchZuYg84fwbvJ70w==
X-Received: by 2002:a2e:860e:0:b0:2b6:e2e4:7d9a with SMTP id a14-20020a2e860e000000b002b6e2e47d9amr7134910lji.38.1688549722702;
        Wed, 05 Jul 2023 02:35:22 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v9 06/24] xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET
Date: Wed,  5 Jul 2023 11:34:15 +0200
Message-Id: <20230705093433.2514898-7-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

According to DEN0077A version 1.1 REL0, section 13.8, defines
flags used for the function FFA_PARTITION_INFO_GET.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 xen/arch/arm/tee/ffa.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 2296e3115beb..c1dead73d1f2 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -57,6 +57,40 @@
 #define FFA_MY_VERSION          MAKE_FFA_VERSION(FFA_MY_VERSION_MAJOR, \
                                                  FFA_MY_VERSION_MINOR)
 
+/*
+ * Flags to determine partition properties in FFA_PARTITION_INFO_GET return
+ * message:
+ * BIT(0): Supports receipt of direct requests
+ * BIT(1): Can send direct requests
+ * BIT(2): Can send and receive indirect messages
+ * BIT(3): Supports receipt of notifications
+ * BIT(4-5): Partition ID is a PE endpoint ID
+ * BIT(6): Partition must be informed about each VM that is created by
+ *         the Hypervisor
+ * BIT(7): Partition must be informed about each VM that is destroyed by
+ *         the Hypervisor
+ * BIT(8): Partition runs in the AArch64 execution state else AArch32
+ *         execution state
+ */
+#define FFA_PART_PROP_DIRECT_REQ_RECV   BIT(0, U)
+#define FFA_PART_PROP_DIRECT_REQ_SEND   BIT(1, U)
+#define FFA_PART_PROP_INDIRECT_MSGS     BIT(2, U)
+#define FFA_PART_PROP_RECV_NOTIF        BIT(3, U)
+#define FFA_PART_PROP_IS_TYPE_MASK      (3U << 4)
+#define FFA_PART_PROP_IS_PE_ID          (0U << 4)
+#define FFA_PART_PROP_IS_SEPID_INDEP    (1U << 4)
+#define FFA_PART_PROP_IS_SEPID_DEP      (2U << 4)
+#define FFA_PART_PROP_IS_AUX_ID         (3U << 4)
+#define FFA_PART_PROP_NOTIF_CREATED     BIT(6, U)
+#define FFA_PART_PROP_NOTIF_DESTROYED   BIT(7, U)
+#define FFA_PART_PROP_AARCH64_STATE     BIT(8, U)
+
+/*
+ * Flag used as parameter to FFA_PARTITION_INFO_GET to return partition
+ * count only.
+ */
+#define FFA_PARTITION_INFO_GET_COUNT_FLAG BIT(0, U)
+
 /* Function IDs */
 #define FFA_ERROR                       0x84000060U
 #define FFA_SUCCESS_32                  0x84000061U
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:35:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:35:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558882.873374 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyuv-00065P-Uq; Wed, 05 Jul 2023 09:35:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558882.873374; Wed, 05 Jul 2023 09:35:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyuv-00065G-S0; Wed, 05 Jul 2023 09:35:21 +0000
Received: by outflank-mailman (input) for mailman id 558882;
 Wed, 05 Jul 2023 09:35:20 +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
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyuu-0005bC-MI
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:20 +0000
Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com
 [2a00:1450:4864:20::229])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4121ccd7-1b17-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:35:18 +0200 (CEST)
Received: by mail-lj1-x229.google.com with SMTP id
 38308e7fff4ca-2b701e1ca63so1938751fa.1
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:18 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4121ccd7-1b17-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549718; x=1691141718;
        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=ope1qDQvv3JfY3UstaYChJhi8PznZe74QQXVc0GdGf0=;
        b=yQRvRdMBEFY/hypIbPRrBs1HNR6BgT+uFRC3j4vCbpwZKfhBFNukSX/z4O8CuiX79M
         cKPEGVUUkcn2T1j+EbmgUH19JAJm7b0mMnka6IJnxQrsdzpnzfKMVj1X2qULH7bNni+t
         P3LALB7miE0ci6w4elxbWD4ycyvuYlbA1LvOeiCy3yPRy7m9/aZOVdB0KaMgKf2j6Stv
         CE15TA6SHQPsNCzMNEr6ziFf4+QWPr2tLTss/bdTnF7QuKo8viJS+IE4KKvBYQzDPZWy
         qegMdHx3ZbAF+Aarkdn1rd/99jl79WaZosFsx/ZFOcqUnPgOuocWdyXoRlcGSNKGLyzd
         K4Ng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549718; x=1691141718;
        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=ope1qDQvv3JfY3UstaYChJhi8PznZe74QQXVc0GdGf0=;
        b=Nj2OjRadSMQ+H1dsAzgvB0oY19Hcx2zkjksr62e6J0vpJ6BfZvGoKlqeYJN+OL3nCU
         WXkzDCHtFGlehnoF72AdsgHS++2ZhOWLEj08hynb0DD6P3x/rVQ6jThljfitZb6++r5M
         tP3bMYpnVUz3EfEZVBUYeX1pnxJ9Mli2fWulOrDlp8Y9Jx3LPjQXBUo4A9r6MS2ln6MX
         KqX36sL/QDtdUiyzXh7yzKmb1EHs444qvEAF6NRyhOPu+ztsLKnn9vHW3NYCGF54Thk0
         qO1Y17xtpgoZ0vVl3iBXPC3Th2B2UZHwGDOY7YHzY3ltoC560sPHvv8CCRScOmxDg19D
         MVNQ==
X-Gm-Message-State: ABy/qLZwctYKcwnFkieH6JnU2213WVd/qeeJgC2xcnbnI/98IgmlHZeg
	Q1aFR9cV/82d8zKRYPEORWZiFZt3aarQ++h3Dg8=
X-Google-Smtp-Source: APBJJlFUO0g/R6+68G1F19Zc1rsGwbxz5DkB4z9w6ruFa/qeFCAUCb3VSNCVeNO3kT8pSD6WhwSixg==
X-Received: by 2002:a2e:a17a:0:b0:2b6:dc84:b93e with SMTP id u26-20020a2ea17a000000b002b6dc84b93emr8292683ljl.21.1688549718034;
        Wed, 05 Jul 2023 02:35:18 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [XEN PATCH v9 02/24] xen/arm: add TEE teardown to arch_domain_teardown()
Date: Wed,  5 Jul 2023 11:34:11 +0200
Message-Id: <20230705093433.2514898-3-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds a progress state for tee_domain_teardown() to be called from
arch_domain_teardown(). tee_domain_teardown() calls the new callback
domain_teardown() in struct tee_mediator_ops.

An empty domain_teardown() callback is added to the OP-TEE mediator.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Co-developed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

---
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/domain.c              | 36 ++++++++++++++++++++++++++++++
 xen/arch/arm/include/asm/tee/tee.h |  7 ++++++
 xen/arch/arm/tee/optee.c           |  6 +++++
 xen/arch/arm/tee/tee.c             |  8 +++++++
 4 files changed, 57 insertions(+)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 15d9709a97d2..18171decdc66 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -795,6 +795,42 @@ fail:
 
 int arch_domain_teardown(struct domain *d)
 {
+    int ret = 0;
+
+    BUG_ON(!d->is_dying);
+
+    /* See domain_teardown() for an explanation of all of this magic. */
+    switch ( d->teardown.arch_val )
+    {
+#define PROGRESS(x)                             \
+        d->teardown.arch_val = PROG_ ## x;      \
+        fallthrough;                            \
+    case PROG_ ## x
+
+        enum {
+            PROG_none,
+            PROG_tee,
+            PROG_done,
+        };
+
+    case PROG_none:
+        BUILD_BUG_ON(PROG_none != 0);
+
+    PROGRESS(tee):
+        ret = tee_domain_teardown(d);
+        if ( ret )
+            return ret;
+        break;
+
+    PROGRESS(done):
+        break;
+
+#undef PROGRESS
+
+    default:
+        BUG();
+    }
+
     return 0;
 }
 
diff --git a/xen/arch/arm/include/asm/tee/tee.h b/xen/arch/arm/include/asm/tee/tee.h
index f483986385c8..da324467e130 100644
--- a/xen/arch/arm/include/asm/tee/tee.h
+++ b/xen/arch/arm/include/asm/tee/tee.h
@@ -34,6 +34,7 @@ struct tee_mediator_ops {
      * guest and create own structures for the new domain.
      */
     int (*domain_init)(struct domain *d);
+    int (*domain_teardown)(struct domain *d);
 
     /*
      * Called during domain destruction to relinquish resources used
@@ -62,6 +63,7 @@ struct tee_mediator_desc {
 
 bool tee_handle_call(struct cpu_user_regs *regs);
 int tee_domain_init(struct domain *d, uint16_t tee_type);
+int tee_domain_teardown(struct domain *d);
 int tee_relinquish_resources(struct domain *d);
 uint16_t tee_get_type(void);
 
@@ -93,6 +95,11 @@ static inline int tee_relinquish_resources(struct domain *d)
     return 0;
 }
 
+static inline int tee_domain_teardown(struct domain *d)
+{
+    return 0;
+}
+
 static inline uint16_t tee_get_type(void)
 {
     return XEN_DOMCTL_CONFIG_TEE_NONE;
diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
index 301d205a36c5..c91bd7d5ac25 100644
--- a/xen/arch/arm/tee/optee.c
+++ b/xen/arch/arm/tee/optee.c
@@ -268,6 +268,11 @@ static int optee_domain_init(struct domain *d)
     return 0;
 }
 
+static int optee_domain_teardown(struct domain *d)
+{
+    return 0;
+}
+
 static uint64_t regpair_to_uint64(register_t reg0, register_t reg1)
 {
     return ((uint64_t)reg0 << 32) | (uint32_t)reg1;
@@ -1732,6 +1737,7 @@ static const struct tee_mediator_ops optee_ops =
 {
     .probe = optee_probe,
     .domain_init = optee_domain_init,
+    .domain_teardown = optee_domain_teardown,
     .relinquish_resources = optee_relinquish_resources,
     .handle_call = optee_handle_call,
 };
diff --git a/xen/arch/arm/tee/tee.c b/xen/arch/arm/tee/tee.c
index 3964a8a5cddf..ddd17506a9ff 100644
--- a/xen/arch/arm/tee/tee.c
+++ b/xen/arch/arm/tee/tee.c
@@ -52,6 +52,14 @@ int tee_domain_init(struct domain *d, uint16_t tee_type)
     return cur_mediator->ops->domain_init(d);
 }
 
+int tee_domain_teardown(struct domain *d)
+{
+    if ( !cur_mediator )
+        return 0;
+
+    return cur_mediator->ops->domain_teardown(d);
+}
+
 int tee_relinquish_resources(struct domain *d)
 {
     if ( !cur_mediator )
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:35:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:35:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558884.873395 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyuz-0006cy-DY; Wed, 05 Jul 2023 09:35:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558884.873395; Wed, 05 Jul 2023 09:35:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyuz-0006cr-AS; Wed, 05 Jul 2023 09:35:25 +0000
Received: by outflank-mailman (input) for mailman id 558884;
 Wed, 05 Jul 2023 09:35:23 +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
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyux-0005bC-4Y
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:23 +0000
Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com
 [2a00:1450:4864:20::232])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 429717a4-1b17-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:35:21 +0200 (CEST)
Received: by mail-lj1-x232.google.com with SMTP id
 38308e7fff4ca-2b701dee4bfso2127031fa.0
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:21 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 429717a4-1b17-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549720; x=1691141720;
        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=eWdsZxNkENko/UmOoCJsCn44L2mriNbtUyUkPA5KWjw=;
        b=PtMM2azYPNLYCU674l2UTHpGLNb6m4A2S+CicJxM1IEK4riNu16LMY5HFAB2UphJOs
         71W6C9Rg2aas2x/eJbJ2jSMUKFaNrxKEWkpD5fD5y1JJo8O0qJ1njmlSiKMN13x2qJMT
         9YNd+ld01xj5mwO55Vvqkux7i4PEpsSb+CPi2YWZ8BDakEX49VGIe3YZFtL/tVbMOXO2
         JXRlFh0cS0GYPj54VYehMs5DmUFdhbu6nDi4XU84yZw1sV2NNql92p+caPtJ+fWmKoVc
         eS26NRoFxb6M6Y378RhlvUS5MTm4o83s3diS8B8lLFwGQcC5CDCdc6MFWDrkqGYtcHpv
         ilDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549720; x=1691141720;
        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=eWdsZxNkENko/UmOoCJsCn44L2mriNbtUyUkPA5KWjw=;
        b=IrlX7c2VU7+xypqAOmNJMMwNDHgpFgHmhY004MNGNU7jNl5SYFr/CgUH0B99Ty90FP
         6fDLyGrbOZnQ9lr0ZA5YZ2LGti0qTj3jXR6Ikjmfa3hbn+WmzoLW6/A5Kfr1N5WBF27J
         /vqUSR1TodCid42GyRLbDnEZH8omy1l4fI5UGSRCR7PsEd0T5H2RrvL5ktet8Jn7umZh
         tX6cqNJnLJPlFD2uzY7nX5lMppGcWp9CRz/IsmhnqybaewukgInOYy7sSBmj0mgI+4uc
         yNd1pkEujLTfekDR100cs2TpulzPFOsGrr0n+EM5gxAEDl251WsGp9bJAMEfTUFLBt/F
         AAFw==
X-Gm-Message-State: ABy/qLa2WcNa4AQRTpOpxBc5ensVEM0KPYMk1jAp6efqq+EMelsoZOlv
	LJ/Kj4K7jr5d781NdAsImtRgSLbZ6HJxnct53yE=
X-Google-Smtp-Source: APBJJlHOMd8tM9yW7zXDCnRwJVvIW1lEoGwpNE1piNVj9RQP3clxYLJzbcgbg2rTHVlcdwytIdvudQ==
X-Received: by 2002:a2e:3009:0:b0:2b6:cca1:9760 with SMTP id w9-20020a2e3009000000b002b6cca19760mr11654855ljw.27.1688549720403;
        Wed, 05 Jul 2023 02:35:20 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [XEN PATCH v9 04/24] xen/arm: tee: add a primitive FF-A mediator
Date: Wed,  5 Jul 2023 11:34:13 +0200
Message-Id: <20230705093433.2514898-5-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds a FF-A version 1.1 [1] mediator to communicate with a Secure
Partition in secure world.

This commit brings in only the parts needed to negotiate FF-A version
number with guest and SPMC.

[1] https://developer.arm.com/documentation/den0077/e
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/include/asm/psci.h    |   4 +
 xen/arch/arm/include/asm/tee/ffa.h |  35 +++++
 xen/arch/arm/tee/Kconfig           |  11 ++
 xen/arch/arm/tee/Makefile          |   1 +
 xen/arch/arm/tee/ffa.c             | 225 +++++++++++++++++++++++++++++
 xen/arch/arm/vsmc.c                |  17 ++-
 xen/include/public/arch-arm.h      |   1 +
 7 files changed, 291 insertions(+), 3 deletions(-)
 create mode 100644 xen/arch/arm/include/asm/tee/ffa.h
 create mode 100644 xen/arch/arm/tee/ffa.c

diff --git a/xen/arch/arm/include/asm/psci.h b/xen/arch/arm/include/asm/psci.h
index 832f77afff3a..4780972621bb 100644
--- a/xen/arch/arm/include/asm/psci.h
+++ b/xen/arch/arm/include/asm/psci.h
@@ -24,6 +24,10 @@ void call_psci_cpu_off(void);
 void call_psci_system_off(void);
 void call_psci_system_reset(void);
 
+/* Range of allocated PSCI function numbers */
+#define	PSCI_FNUM_MIN_VALUE                 _AC(0,U)
+#define	PSCI_FNUM_MAX_VALUE                 _AC(0x1f,U)
+
 /* PSCI v0.2 interface */
 #define PSCI_0_2_FN32(nr) ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL,             \
                                              ARM_SMCCC_CONV_32,               \
diff --git a/xen/arch/arm/include/asm/tee/ffa.h b/xen/arch/arm/include/asm/tee/ffa.h
new file mode 100644
index 000000000000..44361a4e78e4
--- /dev/null
+++ b/xen/arch/arm/include/asm/tee/ffa.h
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * xen/arch/arm/include/asm/tee/ffa.h
+ *
+ * Arm Firmware Framework for ARMv8-A(FFA) mediator
+ *
+ * Copyright (C) 2023  Linaro Limited
+ */
+
+#ifndef __ASM_ARM_TEE_FFA_H__
+#define __ASM_ARM_TEE_FFA_H__
+
+#include <xen/const.h>
+#include <xen/kconfig.h>
+
+#include <asm/smccc.h>
+#include <asm/types.h>
+
+#define FFA_FNUM_MIN_VALUE              _AC(0x60,U)
+#define FFA_FNUM_MAX_VALUE              _AC(0x86,U)
+
+static inline bool is_ffa_fid(uint32_t fid)
+{
+    uint32_t fn = fid & ARM_SMCCC_FUNC_MASK;
+
+    return fn >= FFA_FNUM_MIN_VALUE && fn <= FFA_FNUM_MAX_VALUE;
+}
+
+#ifdef CONFIG_FFA
+#define FFA_NR_FUNCS    12
+#else
+#define FFA_NR_FUNCS    0
+#endif
+
+#endif /*__ASM_ARM_TEE_FFA_H__*/
diff --git a/xen/arch/arm/tee/Kconfig b/xen/arch/arm/tee/Kconfig
index 392169b2559d..923f08ba8cb7 100644
--- a/xen/arch/arm/tee/Kconfig
+++ b/xen/arch/arm/tee/Kconfig
@@ -8,3 +8,14 @@ config OPTEE
 	  virtualization-enabled OP-TEE present. You can learn more
 	  about virtualization for OP-TEE at
 	  https://optee.readthedocs.io/architecture/virtualization.html
+
+config FFA
+	bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
+	default n
+	depends on ARM_64
+	help
+	  This option enables a minimal FF-A mediator. The mediator is
+	  generic as it follows the FF-A specification [1], but it only
+	  implements a small subset of the specification.
+
+	  [1] https://developer.arm.com/documentation/den0077/latest
diff --git a/xen/arch/arm/tee/Makefile b/xen/arch/arm/tee/Makefile
index 982c87968447..58a1015e40e0 100644
--- a/xen/arch/arm/tee/Makefile
+++ b/xen/arch/arm/tee/Makefile
@@ -1,2 +1,3 @@
+obj-$(CONFIG_FFA) += ffa.o
 obj-y += tee.o
 obj-$(CONFIG_OPTEE) += optee.o
diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
new file mode 100644
index 000000000000..927c4d33a380
--- /dev/null
+++ b/xen/arch/arm/tee/ffa.c
@@ -0,0 +1,225 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * xen/arch/arm/tee/ffa.c
+ *
+ * Arm Firmware Framework for ARMv8-A (FF-A) mediator
+ *
+ * Copyright (C) 2023  Linaro Limited
+ */
+
+#include <xen/bitops.h>
+#include <xen/domain_page.h>
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/sched.h>
+#include <xen/sizes.h>
+#include <xen/types.h>
+
+#include <asm/event.h>
+#include <asm/regs.h>
+#include <asm/smccc.h>
+#include <asm/tee/ffa.h>
+#include <asm/tee/tee.h>
+
+/* Error codes */
+#define FFA_RET_OK                      0
+#define FFA_RET_NOT_SUPPORTED           -1
+#define FFA_RET_INVALID_PARAMETERS      -2
+#define FFA_RET_NO_MEMORY               -3
+#define FFA_RET_BUSY                    -4
+#define FFA_RET_INTERRUPTED             -5
+#define FFA_RET_DENIED                  -6
+#define FFA_RET_RETRY                   -7
+#define FFA_RET_ABORTED                 -8
+
+/* FFA_VERSION helpers */
+#define FFA_VERSION_MAJOR_SHIFT         16U
+#define FFA_VERSION_MAJOR_MASK          0x7FFFU
+#define FFA_VERSION_MINOR_SHIFT         0U
+#define FFA_VERSION_MINOR_MASK          0xFFFFU
+#define MAKE_FFA_VERSION(major, minor)  \
+        ((((major) & FFA_VERSION_MAJOR_MASK) << FFA_VERSION_MAJOR_SHIFT) | \
+         ((minor) & FFA_VERSION_MINOR_MASK))
+
+#define FFA_VERSION_1_0         MAKE_FFA_VERSION(1, 0)
+#define FFA_VERSION_1_1         MAKE_FFA_VERSION(1, 1)
+/* The minimal FF-A version of the SPMC that can be supported */
+#define FFA_MIN_SPMC_VERSION    FFA_VERSION_1_1
+
+/*
+ * This is the version we want to use in communication with guests and SPs.
+ * During negotiation with a guest or a SP we may need to lower it for
+ * that particular guest or SP.
+ */
+#define FFA_MY_VERSION_MAJOR    1U
+#define FFA_MY_VERSION_MINOR    1U
+#define FFA_MY_VERSION          MAKE_FFA_VERSION(FFA_MY_VERSION_MAJOR, \
+                                                 FFA_MY_VERSION_MINOR)
+
+/* Function IDs */
+#define FFA_ERROR                       0x84000060U
+#define FFA_SUCCESS_32                  0x84000061U
+#define FFA_VERSION                     0x84000063U
+
+struct ffa_ctx {
+    /* FF-A version used by the guest */
+    uint32_t guest_vers;
+};
+
+/* Negotiated FF-A version to use with the SPMC */
+static uint32_t __ro_after_init ffa_version;
+
+static bool ffa_get_version(uint32_t *vers)
+{
+    const struct arm_smccc_1_2_regs arg = {
+        .a0 = FFA_VERSION,
+        .a1 = FFA_MY_VERSION,
+    };
+    struct arm_smccc_1_2_regs resp;
+
+    arm_smccc_1_2_smc(&arg, &resp);
+    if ( resp.a0 == FFA_RET_NOT_SUPPORTED )
+    {
+        gprintk(XENLOG_ERR, "ffa: FFA_VERSION returned not supported\n");
+        return false;
+    }
+
+    *vers = resp.a0;
+
+    return true;
+}
+
+static void set_regs(struct cpu_user_regs *regs, register_t v0, register_t v1,
+                     register_t v2, register_t v3, register_t v4, register_t v5,
+                     register_t v6, register_t v7)
+{
+        set_user_reg(regs, 0, v0);
+        set_user_reg(regs, 1, v1);
+        set_user_reg(regs, 2, v2);
+        set_user_reg(regs, 3, v3);
+        set_user_reg(regs, 4, v4);
+        set_user_reg(regs, 5, v5);
+        set_user_reg(regs, 6, v6);
+        set_user_reg(regs, 7, v7);
+}
+
+static void handle_version(struct cpu_user_regs *regs)
+{
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+    uint32_t vers = get_user_reg(regs, 1);
+
+    if ( vers < FFA_VERSION_1_1 )
+        vers = FFA_VERSION_1_0;
+    else
+        vers = FFA_VERSION_1_1;
+
+    ctx->guest_vers = vers;
+    set_regs(regs, vers, 0, 0, 0, 0, 0, 0, 0);
+}
+
+static bool ffa_handle_call(struct cpu_user_regs *regs)
+{
+    uint32_t fid = get_user_reg(regs, 0);
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+
+    if ( !ctx )
+        return false;
+
+    switch ( fid )
+    {
+    case FFA_VERSION:
+        handle_version(regs);
+        return true;
+
+    default:
+        gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
+        return false;
+    }
+}
+
+static int ffa_domain_init(struct domain *d)
+{
+    struct ffa_ctx *ctx;
+
+    if ( !ffa_version )
+        return -ENODEV;
+
+    ctx = xzalloc(struct ffa_ctx);
+    if ( !ctx )
+        return -ENOMEM;
+
+    d->arch.tee = ctx;
+
+    return 0;
+}
+
+/* This function is supposed to undo what ffa_domain_init() has done */
+static int ffa_domain_teardown(struct domain *d)
+{
+    struct ffa_ctx *ctx = d->arch.tee;
+
+    if ( !ctx )
+        return 0;
+
+    XFREE(d->arch.tee);
+
+    return 0;
+}
+
+static int ffa_relinquish_resources(struct domain *d)
+{
+    return 0;
+}
+
+static bool ffa_probe(void)
+{
+    uint32_t vers;
+    unsigned int major_vers;
+    unsigned int minor_vers;
+
+    /*
+     * psci_init_smccc() updates this value with what's reported by EL-3
+     * or secure world.
+     */
+    if ( smccc_ver < ARM_SMCCC_VERSION_1_2 )
+    {
+        printk(XENLOG_ERR
+               "ffa: unsupported SMCCC version %#x (need at least %#x)\n",
+               smccc_ver, ARM_SMCCC_VERSION_1_2);
+        return false;
+    }
+
+    if ( !ffa_get_version(&vers) )
+        return false;
+
+    if ( vers < FFA_MIN_SPMC_VERSION || vers > FFA_MY_VERSION )
+    {
+        printk(XENLOG_ERR "ffa: Incompatible version %#x found\n", vers);
+        return false;
+    }
+
+    major_vers = (vers >> FFA_VERSION_MAJOR_SHIFT) & FFA_VERSION_MAJOR_MASK;
+    minor_vers = vers & FFA_VERSION_MINOR_MASK;
+    printk(XENLOG_INFO "ARM FF-A Mediator version %u.%u\n",
+           FFA_MY_VERSION_MAJOR, FFA_MY_VERSION_MINOR);
+    printk(XENLOG_INFO "ARM FF-A Firmware version %u.%u\n",
+           major_vers, minor_vers);
+
+    ffa_version = vers;
+
+    return true;
+}
+
+static const struct tee_mediator_ops ffa_ops =
+{
+    .probe = ffa_probe,
+    .domain_init = ffa_domain_init,
+    .domain_teardown = ffa_domain_teardown,
+    .relinquish_resources = ffa_relinquish_resources,
+    .handle_call = ffa_handle_call,
+};
+
+REGISTER_TEE_MEDIATOR(ffa, "FF-A", XEN_DOMCTL_CONFIG_TEE_FFA, &ffa_ops);
diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c
index cd68fa80e98a..7f2f5eb9ce3d 100644
--- a/xen/arch/arm/vsmc.c
+++ b/xen/arch/arm/vsmc.c
@@ -15,6 +15,7 @@
 #include <asm/monitor.h>
 #include <asm/regs.h>
 #include <asm/smccc.h>
+#include <asm/tee/ffa.h>
 #include <asm/tee/tee.h>
 #include <asm/traps.h>
 #include <asm/vpsci.h>
@@ -24,7 +25,7 @@
 #define XEN_SMCCC_FUNCTION_COUNT 3
 
 /* Number of functions currently supported by Standard Service Service Calls. */
-#define SSSC_SMCCC_FUNCTION_COUNT (3 + VPSCI_NR_FUNCS)
+#define SSSC_SMCCC_FUNCTION_COUNT (3 + VPSCI_NR_FUNCS + FFA_NR_FUNCS)
 
 static bool fill_uid(struct cpu_user_regs *regs, xen_uuid_t uuid)
 {
@@ -188,13 +189,23 @@ static bool handle_existing_apis(struct cpu_user_regs *regs)
     return do_vpsci_0_1_call(regs, fid);
 }
 
+static bool is_psci_fid(uint32_t fid)
+{
+    uint32_t fn = fid & ARM_SMCCC_FUNC_MASK;
+
+    return fn >= PSCI_FNUM_MIN_VALUE && fn <= PSCI_FNUM_MAX_VALUE;
+}
+
 /* PSCI 0.2 interface and other Standard Secure Calls */
 static bool handle_sssc(struct cpu_user_regs *regs)
 {
     uint32_t fid = (uint32_t)get_user_reg(regs, 0);
 
-    if ( do_vpsci_0_2_call(regs, fid) )
-        return true;
+    if ( is_psci_fid(fid) )
+        return do_vpsci_0_2_call(regs, fid);
+
+    if ( is_ffa_fid(fid) )
+        return tee_handle_call(regs);
 
     switch ( fid )
     {
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 38311f559581..c6449893e493 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -296,6 +296,7 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
 
 #define XEN_DOMCTL_CONFIG_TEE_NONE      0
 #define XEN_DOMCTL_CONFIG_TEE_OPTEE     1
+#define XEN_DOMCTL_CONFIG_TEE_FFA       2
 
 struct xen_arch_domainconfig {
     /* IN/OUT */
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:35:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:35:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558885.873401 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyuz-0006ga-SA; Wed, 05 Jul 2023 09:35:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558885.873401; Wed, 05 Jul 2023 09:35:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyuz-0006ez-Jp; Wed, 05 Jul 2023 09:35:25 +0000
Received: by outflank-mailman (input) for mailman id 558885;
 Wed, 05 Jul 2023 09:35:23 +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
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyux-0005bC-Ps
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:23 +0000
Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com
 [2a00:1450:4864:20::232])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 43416c5a-1b17-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:35:22 +0200 (CEST)
Received: by mail-lj1-x232.google.com with SMTP id
 38308e7fff4ca-2b6ff1ad155so5535491fa.0
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:22 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 43416c5a-1b17-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549721; x=1691141721;
        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=dqoldXxWy8H0mye06Jm+vbzYDtmZMz3z5RdS7rzJXrI=;
        b=yuMft45L04JztcnXQTMuUwXg3C+yuWG+iQk+uWUOKI7ixbPrY4+Q0OtD2WIC3VcOHm
         hzAen+5zXi4+pOrHM32vexT8/Yo6/9Td83Xw38T7vHQUvMJXFUGam/6QZp4dX/TtEzG6
         pl4QEO9mT6UawuiXag/RAULeGICoAF6GigS2113JMmLWmdlhO/B53XiOKlt0Ry1uOJrL
         Nr8D/q88n18lAg2YaDHjh2P5aNwoBsPyvgjCIkz5HJPzgj/whtdIOC4CwRL2lMoqaas6
         DNsvuP3izvZxL6BVQGgew9OTCYu9a6EArjs7ttEKqx/adWk7r7Zrxta0TaQTvX7j4k1T
         5BDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549721; x=1691141721;
        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=dqoldXxWy8H0mye06Jm+vbzYDtmZMz3z5RdS7rzJXrI=;
        b=evXomomsPq5z2RohGEpEbp4qT9uSDY7LdQBhZJMLWXm0eU6ri+009/6gJ6yzXa9bge
         5dyslFbjdrHDEQqepQRSzhTegbyOkS+maxplddUerupFkVV+b0LiZMy0hIILE55W8wjp
         +oOzWJzF+z1PPAbJMmLu4T9RdkNoEXE9gnHKOGaGMR29EX6D9CbWCRwlwyK1dilhz+Yr
         Qr+fL6teW1u/+4I25uuNqwYGW1wBGFOVadj4vf3VkdOXqt3Rwj3RPGGnBBXXxvlsWdpD
         hlTYUbcklLHZsO+V0BXxWy0UijIVBajkYkZTJRUJQjJ716PMp7RRS4YW7XmmFlSG0fXj
         IdbQ==
X-Gm-Message-State: ABy/qLZdcaIsvsE+KC16hx/pYxmFp3jBqhHOFnBXzH7keaJSd/HV5zzd
	PTF8jXIGTwqWFmT/Yd6ayWbrO33fBS8mGMYPnG0=
X-Google-Smtp-Source: APBJJlHXrPKLZ1T6BqR2/M0Cyskz25seyh+y7ryNtyh9dtB3tHMVIFKLFAy9H0tdDCA4prZi9cIcGw==
X-Received: by 2002:a05:651c:10ab:b0:2b6:9e1d:cd0f with SMTP id k11-20020a05651c10ab00b002b69e1dcd0fmr717756ljn.12.1688549721596;
        Wed, 05 Jul 2023 02:35:21 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v9 05/24] xen/arm: ffa: add remaining SMC function IDs
Date: Wed,  5 Jul 2023 11:34:14 +0200
Message-Id: <20230705093433.2514898-6-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds the remaining SMC function IDs from FF-A 1.1 specification,
DEN0077A version 1.1 REL0.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 xen/arch/arm/tee/ffa.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 927c4d33a380..2296e3115beb 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -60,7 +60,41 @@
 /* Function IDs */
 #define FFA_ERROR                       0x84000060U
 #define FFA_SUCCESS_32                  0x84000061U
+#define FFA_SUCCESS_64                  0xC4000061U
+#define FFA_INTERRUPT                   0x84000062U
 #define FFA_VERSION                     0x84000063U
+#define FFA_FEATURES                    0x84000064U
+#define FFA_RX_ACQUIRE                  0x84000084U
+#define FFA_RX_RELEASE                  0x84000065U
+#define FFA_RXTX_MAP_32                 0x84000066U
+#define FFA_RXTX_MAP_64                 0xC4000066U
+#define FFA_RXTX_UNMAP                  0x84000067U
+#define FFA_PARTITION_INFO_GET          0x84000068U
+#define FFA_ID_GET                      0x84000069U
+#define FFA_SPM_ID_GET                  0x84000085U
+#define FFA_MSG_WAIT                    0x8400006BU
+#define FFA_MSG_YIELD                   0x8400006CU
+#define FFA_RUN                         0x8400006DU
+#define FFA_MSG_SEND2                   0x84000086U
+#define FFA_MSG_SEND_DIRECT_REQ_32      0x8400006FU
+#define FFA_MSG_SEND_DIRECT_REQ_64      0xC400006FU
+#define FFA_MSG_SEND_DIRECT_RESP_32     0x84000070U
+#define FFA_MSG_SEND_DIRECT_RESP_64     0xC4000070U
+#define FFA_MEM_DONATE_32               0x84000071U
+#define FFA_MEM_DONATE_64               0xC4000071U
+#define FFA_MEM_LEND_32                 0x84000072U
+#define FFA_MEM_LEND_64                 0xC4000072U
+#define FFA_MEM_SHARE_32                0x84000073U
+#define FFA_MEM_SHARE_64                0xC4000073U
+#define FFA_MEM_RETRIEVE_REQ_32         0x84000074U
+#define FFA_MEM_RETRIEVE_REQ_64         0xC4000074U
+#define FFA_MEM_RETRIEVE_RESP           0x84000075U
+#define FFA_MEM_RELINQUISH              0x84000076U
+#define FFA_MEM_RECLAIM                 0x84000077U
+#define FFA_MEM_FRAG_RX                 0x8400007AU
+#define FFA_MEM_FRAG_TX                 0x8400007BU
+#define FFA_MSG_SEND                    0x8400006EU
+#define FFA_MSG_POLL                    0x8400006AU
 
 struct ffa_ctx {
     /* FF-A version used by the guest */
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:35:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:35:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558890.873445 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyv4-00082U-Px; Wed, 05 Jul 2023 09:35:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558890.873445; Wed, 05 Jul 2023 09:35:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyv4-000825-KI; Wed, 05 Jul 2023 09:35:30 +0000
Received: by outflank-mailman (input) for mailman id 558890;
 Wed, 05 Jul 2023 09:35:28 +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
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyv2-0005bC-DQ
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:28 +0000
Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com
 [2a00:1450:4864:20::22b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4603b5a3-1b17-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:35:26 +0200 (CEST)
Received: by mail-lj1-x22b.google.com with SMTP id
 38308e7fff4ca-2b69f958ef3so104571781fa.1
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:26 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4603b5a3-1b17-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549726; x=1691141726;
        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=x0GAChav/BgZruQ3EPU8Qo2tQ1sDnkEZR3Mc3i3hmhg=;
        b=B7NNbw/vy6w4tKLRiLZWwvU8hljfohWfyEwbBn5sSoQWTjZr8y/jX5iaAZwpmb9h5w
         EdzzZOicphG2Ac7ttvHMErFT6+3Skp4xynxoPAzxEww1cbhisDNKRyYH5Yr/kDGXR+K8
         J5miq7s0+zDgptmEUVCh7RWtNuWjt7Hw2wiSEuVsZMEr57JqCyzP/mQRJi2wYirrMUlt
         HO+JSjZ2eRsv5DHGS6H7wj6aTuJr6C2TmlogkK5Uy22KXuETaGqk+4JocCNpK433FEyD
         68egJnjz72Plv/q6Mlp71/VRdGo93gv4n9LDK9hJcBavwyJxhFw0U7OF+m11QT7LC+0N
         JXNQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549726; x=1691141726;
        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=x0GAChav/BgZruQ3EPU8Qo2tQ1sDnkEZR3Mc3i3hmhg=;
        b=XEwhhYedMFU+x9rQwYCUO4xgEs3oDuvvMWBG4L7WKcBNauZPafmA15LuwbPuGX+0db
         9p2PeTK3qBjeKIHXNbS7M6Z0yM6zo1BSi53rgdRYmkBx0yL/vmpXeZE0xWOa8nzFzQ2Q
         7wuaAnAQlgDL39jH26mqMwBCfXE0zeB+TBRtvEiSraPfcZcK7fH0E+ZpfIK5FN5YZavq
         gcaK7K4XFlttWYKtRb1hSARBWI7mXoET62ay0F2jhJVZleMoosITFRfh+Y9EWJKRyi1X
         tx9GIHT7dih1RhGW1abzN85ah076XB7eRLcODRhWnvjx0OwzTtLpERD/4MlpIATdEbOq
         TSjg==
X-Gm-Message-State: ABy/qLaWyETbXtLe1NSHxCUHksSt5OXB8QJbK9y952huPug8FVNqq+RA
	XHAj+mQ0t32WE+fcj5GlMG/QSfg7lJkpAx201uc=
X-Google-Smtp-Source: APBJJlFOVK027Xr13cYrFNIVHsgMnH0tYA85EQAiduYKdHJhh8oelr0qTEPlmLcdJtkcm7XZnqt20w==
X-Received: by 2002:a2e:93d6:0:b0:2b6:fe54:2a4b with SMTP id p22-20020a2e93d6000000b002b6fe542a4bmr1072946ljh.37.1688549726106;
        Wed, 05 Jul 2023 02:35:26 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v9 09/24] xen/arm: ffa: add support for FFA_ID_GET
Date: Wed,  5 Jul 2023 11:34:18 +0200
Message-Id: <20230705093433.2514898-10-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support for the FF-A function FFA_ID_GET to return the ID of the
calling client.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index f0a2715d4bbf..e157ed20ad8b 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -181,6 +181,12 @@ static bool ffa_get_version(uint32_t *vers)
     return true;
 }
 
+static uint16_t get_vm_id(const struct domain *d)
+{
+    /* +1 since 0 is reserved for the hypervisor in FF-A */
+    return d->domain_id + 1;
+}
+
 static void set_regs(struct cpu_user_regs *regs, register_t v0, register_t v1,
                      register_t v2, register_t v3, register_t v4, register_t v5,
                      register_t v6, register_t v7)
@@ -195,6 +201,12 @@ static void set_regs(struct cpu_user_regs *regs, register_t v0, register_t v1,
         set_user_reg(regs, 7, v7);
 }
 
+static void set_regs_success(struct cpu_user_regs *regs, uint32_t w2,
+                             uint32_t w3)
+{
+    set_regs(regs, FFA_SUCCESS_32, 0, w2, w3, 0, 0, 0, 0);
+}
+
 static void handle_version(struct cpu_user_regs *regs)
 {
     struct domain *d = current->domain;
@@ -224,6 +236,9 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     case FFA_VERSION:
         handle_version(regs);
         return true;
+    case FFA_ID_GET:
+        set_regs_success(regs, get_vm_id(d), 0);
+        return true;
 
     default:
         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
@@ -237,6 +252,12 @@ static int ffa_domain_init(struct domain *d)
 
     if ( !ffa_version )
         return -ENODEV;
+     /*
+      * We can't use that last possible domain ID or get_vm_id() would cause
+      * an overflow.
+      */
+    if ( d->domain_id >= UINT16_MAX)
+        return -ERANGE;
 
     ctx = xzalloc(struct ffa_ctx);
     if ( !ctx )
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:35:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:35:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558883.873385 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyux-0006Ky-6V; Wed, 05 Jul 2023 09:35:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558883.873385; Wed, 05 Jul 2023 09:35:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyux-0006Kq-3S; Wed, 05 Jul 2023 09:35:23 +0000
Received: by outflank-mailman (input) for mailman id 558883;
 Wed, 05 Jul 2023 09:35:21 +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
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyuv-0005bC-NG
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:21 +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 41e81fc1-1b17-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:35:20 +0200 (CEST)
Received: by mail-lj1-x231.google.com with SMTP id
 38308e7fff4ca-2b6ff1a637bso6931261fa.3
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:19 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 41e81fc1-1b17-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549719; x=1691141719;
        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=sPB2Dc6t3Zgd1EEjPsex1QWFM8C9VFNKedpjWqBxO5k=;
        b=KzmaQV2K2xH/7mILxkUyQHMyBQr51bl76tMoOkpR5LmbxOQfz2xmwZBtC098B47iRY
         Rr0Yisz6v5tz+R77+f565Y5X9/t2IHXMg/NVgP116iy/fLK1RhGmhvCbTcG5z9qfXUGK
         EKb4jKN+wZO0/qbli2qAs/bNUm3JbW9ZfrBbyKgYVlCbQWzQPNj9v3SK0lu0xWtFF3KC
         qmsQHMm3+Vr4X5HC+yNSZFPM7a6lEFS+AFosXOtEjQb8R3pGT1/bVLL5dhjRp+26KqpQ
         zw/PTEdIWaDjg1GWXwQ9xIBMkp+Z+01H3gyBm5JidRoCQ9TqLggDBct21iX3JUWJOPRL
         1Qtg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549719; x=1691141719;
        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=sPB2Dc6t3Zgd1EEjPsex1QWFM8C9VFNKedpjWqBxO5k=;
        b=ApwQFEnzOBfFqmqz2ubAkFyV2I8WLapvHPlq17mQWAjjFbsA4pSA+w93iC+pNtlY7h
         Xsq0xqKSJoeFIqHUPrfL+kdWefP91DoPRtoR4eh/xAbnNjztatOsDktt7pgxnCcqIwGi
         LbvLrWfUf6ALeNmIx4YiSYiko5zfCxfouV70EZd5R8hDc2XjILFf7A7fC1SJTjf0Vo/L
         L51ablVKowl3VlGVgwnFkc49suXKuM0PW+sqhorbXXMnuBzunGnRKWX6b6ms+pJEzKta
         ++KHGc3BobQ4twbHBdGTizcW3UDaTvknLAQtR9OeKAbc2O/KXHq9VSLVAvojaBARmBXw
         X5eA==
X-Gm-Message-State: ABy/qLYz5zS6CeanCDg2JH92O2swTRBQqy8sNYzb9bjtI7i3SNOmyfKU
	2RYdVBQKeHCBwZ2dTDYIE1njd49SF3AAeRR/HFw=
X-Google-Smtp-Source: APBJJlG2atj/pftIqyUxkI68m2T9ZWgQ4liE5nTUqR4RHRlqXrJJbO8QtoL2Mc+TBw3H4UBwqyxZxw==
X-Received: by 2002:a2e:b0d2:0:b0:2b6:d9dd:f65f with SMTP id g18-20020a2eb0d2000000b002b6d9ddf65fmr8142657ljl.17.1688549719284;
        Wed, 05 Jul 2023 02:35:19 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [XEN PATCH v9 03/24] xen/arm: smccc: add support for SMCCCv1.2 extended input/output registers
Date: Wed,  5 Jul 2023 11:34:12 +0200
Message-Id: <20230705093433.2514898-4-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

SMCCC v1.2 [1] AArch64 allows x0-x17 to be used as both parameter
registers and result registers for the SMC and HVC instructions.

Arm Firmware Framework for Armv8-A specification makes use of x0-x7 as
parameter and result registers.

Let us add new interface to support this extended set of input/output
registers.

This is based on 3fdc0cb59d97 ("arm64: smccc: Add support for SMCCCv1.2
extended input/output registers") by Sudeep Holla from the Linux kernel

The SMCCC version reported to the VM is bumped to 1.2 in order to support
handling FF-A messages.

[1] https://developer.arm.com/documentation/den0028/c/?lang=en

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/arm64/asm-offsets.c |  9 +++++++
 xen/arch/arm/arm64/smc.S         | 42 ++++++++++++++++++++++++++++++++
 xen/arch/arm/include/asm/smccc.h | 40 ++++++++++++++++++++++++++++++
 xen/arch/arm/vsmc.c              |  2 +-
 4 files changed, 92 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/arm64/asm-offsets.c b/xen/arch/arm/arm64/asm-offsets.c
index 7226cd9b2eb0..7adb67a1b81a 100644
--- a/xen/arch/arm/arm64/asm-offsets.c
+++ b/xen/arch/arm/arm64/asm-offsets.c
@@ -57,6 +57,15 @@ void __dummy__(void)
    BLANK();
    OFFSET(SMCCC_RES_a0, struct arm_smccc_res, a0);
    OFFSET(SMCCC_RES_a2, struct arm_smccc_res, a2);
+   OFFSET(ARM_SMCCC_1_2_REGS_X0_OFFS, struct arm_smccc_1_2_regs, a0);
+   OFFSET(ARM_SMCCC_1_2_REGS_X2_OFFS, struct arm_smccc_1_2_regs, a2);
+   OFFSET(ARM_SMCCC_1_2_REGS_X4_OFFS, struct arm_smccc_1_2_regs, a4);
+   OFFSET(ARM_SMCCC_1_2_REGS_X6_OFFS, struct arm_smccc_1_2_regs, a6);
+   OFFSET(ARM_SMCCC_1_2_REGS_X8_OFFS, struct arm_smccc_1_2_regs, a8);
+   OFFSET(ARM_SMCCC_1_2_REGS_X10_OFFS, struct arm_smccc_1_2_regs, a10);
+   OFFSET(ARM_SMCCC_1_2_REGS_X12_OFFS, struct arm_smccc_1_2_regs, a12);
+   OFFSET(ARM_SMCCC_1_2_REGS_X14_OFFS, struct arm_smccc_1_2_regs, a14);
+   OFFSET(ARM_SMCCC_1_2_REGS_X16_OFFS, struct arm_smccc_1_2_regs, a16);
 }
 
 /*
diff --git a/xen/arch/arm/arm64/smc.S b/xen/arch/arm/arm64/smc.S
index 91bae62dd4d2..fc6b676e2ee3 100644
--- a/xen/arch/arm/arm64/smc.S
+++ b/xen/arch/arm/arm64/smc.S
@@ -27,3 +27,45 @@ ENTRY(__arm_smccc_1_0_smc)
         stp     x2, x3, [x4, #SMCCC_RES_a2]
 1:
         ret
+
+/*
+ * void arm_smccc_1_2_smc(const struct arm_smccc_1_2_regs *args,
+ *                        struct arm_smccc_1_2_regs *res)
+ */
+ENTRY(arm_smccc_1_2_smc)
+    /* Save `res` and free a GPR that won't be clobbered by SMC call */
+    stp     x1, x19, [sp, #-16]!
+
+    /* Ensure `args` won't be clobbered while loading regs in next step */
+    mov	x19, x0
+
+    /* Load the registers x0 - x17 from the struct arm_smccc_1_2_regs */
+    ldp	x0, x1, [x19, #ARM_SMCCC_1_2_REGS_X0_OFFS]
+    ldp	x2, x3, [x19, #ARM_SMCCC_1_2_REGS_X2_OFFS]
+    ldp	x4, x5, [x19, #ARM_SMCCC_1_2_REGS_X4_OFFS]
+    ldp	x6, x7, [x19, #ARM_SMCCC_1_2_REGS_X6_OFFS]
+    ldp	x8, x9, [x19, #ARM_SMCCC_1_2_REGS_X8_OFFS]
+    ldp	x10, x11, [x19, #ARM_SMCCC_1_2_REGS_X10_OFFS]
+    ldp	x12, x13, [x19, #ARM_SMCCC_1_2_REGS_X12_OFFS]
+    ldp	x14, x15, [x19, #ARM_SMCCC_1_2_REGS_X14_OFFS]
+    ldp	x16, x17, [x19, #ARM_SMCCC_1_2_REGS_X16_OFFS]
+
+    smc #0
+
+    /* Load the `res` from the stack */
+    ldr	x19, [sp]
+
+    /* Store the registers x0 - x17 into the result structure */
+    stp	x0, x1, [x19, #ARM_SMCCC_1_2_REGS_X0_OFFS]
+    stp	x2, x3, [x19, #ARM_SMCCC_1_2_REGS_X2_OFFS]
+    stp	x4, x5, [x19, #ARM_SMCCC_1_2_REGS_X4_OFFS]
+    stp	x6, x7, [x19, #ARM_SMCCC_1_2_REGS_X6_OFFS]
+    stp	x8, x9, [x19, #ARM_SMCCC_1_2_REGS_X8_OFFS]
+    stp	x10, x11, [x19, #ARM_SMCCC_1_2_REGS_X10_OFFS]
+    stp	x12, x13, [x19, #ARM_SMCCC_1_2_REGS_X12_OFFS]
+    stp	x14, x15, [x19, #ARM_SMCCC_1_2_REGS_X14_OFFS]
+    stp	x16, x17, [x19, #ARM_SMCCC_1_2_REGS_X16_OFFS]
+
+    /* Restore original x19 */
+    ldp     xzr, x19, [sp], #16
+    ret
diff --git a/xen/arch/arm/include/asm/smccc.h b/xen/arch/arm/include/asm/smccc.h
index b3dbeecc90ad..1adcd37443c7 100644
--- a/xen/arch/arm/include/asm/smccc.h
+++ b/xen/arch/arm/include/asm/smccc.h
@@ -33,6 +33,7 @@
 
 #define ARM_SMCCC_VERSION_1_0   SMCCC_VERSION(1, 0)
 #define ARM_SMCCC_VERSION_1_1   SMCCC_VERSION(1, 1)
+#define ARM_SMCCC_VERSION_1_2   SMCCC_VERSION(1, 2)
 
 /*
  * This file provides common defines for ARM SMC Calling Convention as
@@ -265,6 +266,45 @@ void __arm_smccc_1_0_smc(register_t a0, register_t a1, register_t a2,
         else                                                    \
             arm_smccc_1_0_smc(__VA_ARGS__);                     \
     } while ( 0 )
+
+/*
+ * struct arm_smccc_1_2_regs - Arguments for or Results from SMC call
+ * @a0-a17 argument values from registers 0 to 17
+ */
+struct arm_smccc_1_2_regs {
+    unsigned long a0;
+    unsigned long a1;
+    unsigned long a2;
+    unsigned long a3;
+    unsigned long a4;
+    unsigned long a5;
+    unsigned long a6;
+    unsigned long a7;
+    unsigned long a8;
+    unsigned long a9;
+    unsigned long a10;
+    unsigned long a11;
+    unsigned long a12;
+    unsigned long a13;
+    unsigned long a14;
+    unsigned long a15;
+    unsigned long a16;
+    unsigned long a17;
+};
+
+/*
+ * arm_smccc_1_2_smc() - make SMC calls
+ * @args: arguments passed via struct arm_smccc_1_2_regs
+ * @res: result values via struct arm_smccc_1_2_regs
+ *
+ * This function is used to make SMC calls following SMC Calling Convention
+ * v1.2 or above. The content of the supplied param are copied from the
+ * structure to registers prior to the SMC instruction. The return values
+ * are updated with the content from registers on return from the SMC
+ * instruction.
+ */
+void arm_smccc_1_2_smc(const struct arm_smccc_1_2_regs *args,
+                       struct arm_smccc_1_2_regs *res);
 #endif /* CONFIG_ARM_64 */
 
 #endif /* __ASSEMBLY__ */
diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c
index 7335276f3fa1..cd68fa80e98a 100644
--- a/xen/arch/arm/vsmc.c
+++ b/xen/arch/arm/vsmc.c
@@ -85,7 +85,7 @@ static bool handle_arch(struct cpu_user_regs *regs)
     switch ( fid )
     {
     case ARM_SMCCC_VERSION_FID:
-        set_user_reg(regs, 0, ARM_SMCCC_VERSION_1_1);
+        set_user_reg(regs, 0, ARM_SMCCC_VERSION_1_2);
         return true;
 
     case ARM_SMCCC_ARCH_FEATURES_FID:
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:35:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:35:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558892.873450 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyv5-0008BJ-Jw; Wed, 05 Jul 2023 09:35:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558892.873450; Wed, 05 Jul 2023 09:35:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyv5-00089X-9M; Wed, 05 Jul 2023 09:35:31 +0000
Received: by outflank-mailman (input) for mailman id 558892;
 Wed, 05 Jul 2023 09:35:29 +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
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyv3-0005bC-Nl
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:29 +0000
Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com
 [2a00:1450:4864:20::232])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 46c7d82d-1b17-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:35:28 +0200 (CEST)
Received: by mail-lj1-x232.google.com with SMTP id
 38308e7fff4ca-2b701e1ca63so1941201fa.1
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:28 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.26
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 46c7d82d-1b17-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549727; x=1691141727;
        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=C+n5gOj+w1Jr5cwaD9TQj7fEu8jpwI0+pO30/yvaxYY=;
        b=EM0sBwQY9tSqUTMbLrIvqFIY5GpkuUgHl9KHji4cYp+SotFHgcMNLEfioBijVsltOY
         IGiopmKU57bTIfiigojSxbnt/U+GL0ocSxVKiVuWhULCAFBXV8YLQELG89mUp+cHEBze
         e37D/aI1rBPFTXszZ/jMiVfWDxg8jbrfYaBgwm4Cfx1N6wyu9fG82RI/sFZoCPg+uvOd
         EIhb7rG8PVSUmbiFptKJu7eNhe2EEUweCdkTI5wSVE8emMn/MTCgDogKLeiSVb7J5MqK
         07W0Cac+7E+WWZW22zDHNUcsUttSCfOYAesUNiiRfOA4yOghP94yb2N316iXEpVdLb1f
         bJgA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549727; x=1691141727;
        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=C+n5gOj+w1Jr5cwaD9TQj7fEu8jpwI0+pO30/yvaxYY=;
        b=Dq0q4JyPLg3ovXRHmLKbqY8AWnrsXE30YHnxQj3r3QEOJV46HDqavQehMl4QLhXbtJ
         cr9R3vUBrB/M9Knc6te88b0UAIPv+YaVdp8dVNDZ9LDN9eMyeb1QbkPeEWYdG2g5vMxt
         Pp5KK6AGglJ4mSeKGI9kMLmSA0RiO9p8KA0lNbPyfsj5/m9gEGmE4q+UPJq3nQeuSRxS
         4S1KtIRFDQhQw6WNIgGJV3Ln+ewGQYRYa/tmC3+M2fNWE1jmYiC0M/Sn2Vle2Kb5jzCk
         0ZSpycK3OdR5Q46a18waCKDUpKrR+vb+RByyT5ZOqrk0uwqaeAFhyGy0N6zIdjloAUoD
         0shA==
X-Gm-Message-State: ABy/qLbkKQ/KKj3PuLsDktQ+1Q30V+mdoG7QxhNUafI7I/Qmds1jJTn6
	Ml8dHqDu54buY89gMowk5xXTrwsKfq81ik6pOEg=
X-Google-Smtp-Source: APBJJlHTzND0+TurDFFDgmVPf6e+8XxKHVpcScnbrup7W0dblLipHGopPxvW6YyLx4SRCQZn9GEHmQ==
X-Received: by 2002:a2e:8095:0:b0:2b6:a344:29cf with SMTP id i21-20020a2e8095000000b002b6a34429cfmr10214394ljg.17.1688549727373;
        Wed, 05 Jul 2023 02:35:27 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v9 10/24] xen/arm: ffa: add direct request support
Date: Wed,  5 Jul 2023 11:34:19 +0200
Message-Id: <20230705093433.2514898-11-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support for sending a FF-A direct request. Checks that the SP also
supports handling a 32-bit direct request. 64-bit direct requests are
not used by the mediator itself so there is not need to check for that.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 xen/arch/arm/tee/ffa.c | 113 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 113 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index e157ed20ad8b..e05d58cf7755 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -181,6 +181,56 @@ static bool ffa_get_version(uint32_t *vers)
     return true;
 }
 
+static int32_t get_ffa_ret_code(const struct arm_smccc_1_2_regs *resp)
+{
+    switch ( resp->a0 )
+    {
+    case FFA_ERROR:
+        if ( resp->a2 )
+            return resp->a2;
+        else
+            return FFA_RET_NOT_SUPPORTED;
+    case FFA_SUCCESS_32:
+    case FFA_SUCCESS_64:
+        return FFA_RET_OK;
+    default:
+        return FFA_RET_NOT_SUPPORTED;
+    }
+}
+
+static int32_t ffa_simple_call(uint32_t fid, register_t a1, register_t a2,
+                               register_t a3, register_t a4)
+{
+    const struct arm_smccc_1_2_regs arg = {
+        .a0 = fid,
+        .a1 = a1,
+        .a2 = a2,
+        .a3 = a3,
+        .a4 = a4,
+    };
+    struct arm_smccc_1_2_regs resp;
+
+    arm_smccc_1_2_smc(&arg, &resp);
+
+    return get_ffa_ret_code(&resp);
+}
+
+static int32_t ffa_features(uint32_t id)
+{
+    return ffa_simple_call(FFA_FEATURES, id, 0, 0, 0);
+}
+
+static bool check_mandatory_feature(uint32_t id)
+{
+    int32_t ret = ffa_features(id);
+
+    if ( ret )
+        printk(XENLOG_ERR "ffa: mandatory feature id %#x missing: error %d\n",
+               id, ret);
+
+    return !ret;
+}
+
 static uint16_t get_vm_id(const struct domain *d)
 {
     /* +1 since 0 is reserved for the hypervisor in FF-A */
@@ -222,6 +272,57 @@ static void handle_version(struct cpu_user_regs *regs)
     set_regs(regs, vers, 0, 0, 0, 0, 0, 0, 0);
 }
 
+static void handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
+{
+    struct arm_smccc_1_2_regs arg = { .a0 = fid, };
+    struct arm_smccc_1_2_regs resp = { };
+    struct domain *d = current->domain;
+    uint32_t src_dst;
+    uint64_t mask;
+
+    if ( smccc_is_conv_64(fid) )
+        mask = GENMASK_ULL(63, 0);
+    else
+        mask = GENMASK_ULL(31, 0);
+
+    src_dst = get_user_reg(regs, 1);
+    if ( (src_dst >> 16) != get_vm_id(d) )
+    {
+        resp.a0 = FFA_ERROR;
+        resp.a2 = FFA_RET_INVALID_PARAMETERS;
+        goto out;
+    }
+
+    arg.a1 = src_dst;
+    arg.a2 = get_user_reg(regs, 2) & mask;
+    arg.a3 = get_user_reg(regs, 3) & mask;
+    arg.a4 = get_user_reg(regs, 4) & mask;
+    arg.a5 = get_user_reg(regs, 5) & mask;
+    arg.a6 = get_user_reg(regs, 6) & mask;
+    arg.a7 = get_user_reg(regs, 7) & mask;
+
+    arm_smccc_1_2_smc(&arg, &resp);
+    switch ( resp.a0 )
+    {
+    case FFA_ERROR:
+    case FFA_SUCCESS_32:
+    case FFA_SUCCESS_64:
+    case FFA_MSG_SEND_DIRECT_RESP_32:
+    case FFA_MSG_SEND_DIRECT_RESP_64:
+        break;
+    default:
+        /* Bad fid, report back. */
+        memset(&arg, 0, sizeof(arg));
+        arg.a0 = FFA_ERROR;
+        arg.a1 = src_dst;
+        arg.a2 = FFA_RET_ABORTED;
+    }
+
+out:
+    set_regs(regs, resp.a0, resp.a1 & mask, resp.a2 & mask, resp.a3 & mask,
+             resp.a4 & mask, resp.a5 & mask, resp.a6 & mask, resp.a7 & mask);
+}
+
 static bool ffa_handle_call(struct cpu_user_regs *regs)
 {
     uint32_t fid = get_user_reg(regs, 0);
@@ -239,6 +340,10 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     case FFA_ID_GET:
         set_regs_success(regs, get_vm_id(d), 0);
         return true;
+    case FFA_MSG_SEND_DIRECT_REQ_32:
+    case FFA_MSG_SEND_DIRECT_REQ_64:
+        handle_msg_send_direct_req(regs, fid);
+        return true;
 
     default:
         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
@@ -331,6 +436,14 @@ static bool ffa_probe(void)
     printk(XENLOG_INFO "ARM FF-A Firmware version %u.%u\n",
            major_vers, minor_vers);
 
+    /*
+     * At the moment domains must support the same features used by Xen.
+     * TODO: Rework the code to allow domain to use a subset of the
+     * features supported.
+     */
+    if ( !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
+        return false;
+
     ffa_version = vers;
 
     return true;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:35:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:35:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558881.873361 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyuu-0005fS-Ko; Wed, 05 Jul 2023 09:35:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558881.873361; Wed, 05 Jul 2023 09:35:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyuu-0005ed-Fg; Wed, 05 Jul 2023 09:35:20 +0000
Received: by outflank-mailman (input) for mailman id 558881;
 Wed, 05 Jul 2023 09:35:19 +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
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyut-0005bC-MD
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:19 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 406545c0-1b17-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:35:17 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-4fbb281eec6so4765599e87.1
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:17 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.15
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 406545c0-1b17-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549716; x=1691141716;
        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=am4ipN3ru3xzSJvgYsCfVXNDufmrJ7j+gUVMYasa6R8=;
        b=YRRVF3KTUR2CfX8sPtJGO/1Jng4XNRK/IuXWR5mRgQEIlhCd8cqSgFMhzC/Yndbaqi
         jQQ1qOWBoOL9CdNIwvvesIQ/g4Gzn9BW3GiAQGINWc0nmYau2qH51TRxkRJOP9hDFk95
         JDQAX3XZ7mR81dRnlEXo0nPFWc+N8ASyz3MvXJNIc0t3A0v/77JFbmaHRuH8+zG90zV8
         TNdCkmpNNycLL422jOxbgFTGQLdlD4sq7aLzPrCEJay0ScS0BC8V1hPoDfxkQxFlM+rm
         6/O2BXb1U3lyXm+ZOd1HicIqgEel/nX5OkPQcTeXcUQodA2mZ7X/sxVdz4Yz3xz1a12m
         opeg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549716; x=1691141716;
        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=am4ipN3ru3xzSJvgYsCfVXNDufmrJ7j+gUVMYasa6R8=;
        b=kWXTHK3YkqqON6c4nHlEwpyC3FTVQlzxmqz1uLeSib1YisPKvzRnFc1o+jO9v9MRjZ
         n1Kgzd2taZd2Zw72xiVOyZp36boCnFALSMPfE9ibSIIIV4z+e+j3xPJ1tiw5rnZqmO4Q
         +dDn5gqZ6Wj+fBZ/8L8kGTKQNqNSTuZM3oDyYpiAqoxo+7pOeO3ckh3KaWeMp1Tzp9Jm
         gzxG0HZdtVAOQ909qIAPtkj2P4S9n3rFApX5hvdJJk5JXXguiF177Vm8fLp+rK40yQ/o
         sO8wnTOoOfeNsejm+IHp9CQjuez84mC6pjtCai8TxxqdzQ7Sc1ci7G741ygTzmjD8hem
         /eYQ==
X-Gm-Message-State: ABy/qLYd/DjYMpvXZU+dvHl82fMrj9eZ7Cwfzjm0PvFxNFZZryAWG6C+
	42yDLyvFJcfd2Wo/P7NwWeFTzTI+iBGDmkaO7cg=
X-Google-Smtp-Source: APBJJlFmHssN6U2jD6Aj2M55oV1Ks3I50SPjEcyFBfIaeIPGLY9rjYKrdzZePpVHlgKBka1r4/s5Ww==
X-Received: by 2002:a2e:8182:0:b0:2b6:cfec:69f7 with SMTP id e2-20020a2e8182000000b002b6cfec69f7mr10183434ljg.1.1688549716784;
        Wed, 05 Jul 2023 02:35:16 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>
Subject: [XEN PATCH v9 01/24] xen: Introduce arch_domain_teardown()
Date: Wed,  5 Jul 2023 11:34:10 +0200
Message-Id: <20230705093433.2514898-2-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From: Andrew Cooper <andrew.cooper3@citrix.com>

Plumb it into domain_teardown().  Provide arch_val in the teardown
continuation information for use by arch_domain_teardown().

No practical change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/domain.c    | 5 +++++
 xen/arch/x86/domain.c    | 5 +++++
 xen/common/domain.c      | 6 ++++++
 xen/include/xen/domain.h | 1 +
 xen/include/xen/sched.h  | 1 +
 5 files changed, 18 insertions(+)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 8c18e9207907..15d9709a97d2 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -793,6 +793,11 @@ fail:
     return rc;
 }
 
+int arch_domain_teardown(struct domain *d)
+{
+    return 0;
+}
+
 void arch_domain_destroy(struct domain *d)
 {
     /* IOMMU page table is shared with P2M, always call
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 39c215316546..5f66c2ae33d7 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -888,6 +888,11 @@ int arch_domain_create(struct domain *d,
     return rc;
 }
 
+int arch_domain_teardown(struct domain *d)
+{
+    return 0;
+}
+
 void arch_domain_destroy(struct domain *d)
 {
     if ( is_hvm_domain(d) )
diff --git a/xen/common/domain.c b/xen/common/domain.c
index caaa40263792..304aa04fa6cb 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -439,6 +439,7 @@ static int domain_teardown(struct domain *d)
             PROG_none,
             PROG_gnttab_mappings,
             PROG_vcpu_teardown,
+            PROG_arch_teardown,
             PROG_done,
         };
 
@@ -459,6 +460,11 @@ static int domain_teardown(struct domain *d)
                 return rc;
         }
 
+    PROGRESS(arch_teardown):
+        rc = arch_domain_teardown(d);
+        if ( rc )
+            return rc;
+
     PROGRESS(done):
         break;
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 1df8f933d076..d35af348410c 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -81,6 +81,7 @@ int arch_domain_create(struct domain *d,
                        struct xen_domctl_createdomain *config,
                        unsigned int flags);
 
+int arch_domain_teardown(struct domain *d);
 void arch_domain_destroy(struct domain *d);
 
 void arch_domain_shutdown(struct domain *d);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 85242a73d374..854f3e32c00e 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -589,6 +589,7 @@ struct domain
      */
     struct {
         unsigned int val;
+        unsigned int arch_val;
         struct vcpu *vcpu;
     } teardown;
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:35:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:35:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558888.873415 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyv1-00072F-1Q; Wed, 05 Jul 2023 09:35:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558888.873415; Wed, 05 Jul 2023 09:35:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyv0-00070r-Ob; Wed, 05 Jul 2023 09:35:26 +0000
Received: by outflank-mailman (input) for mailman id 558888;
 Wed, 05 Jul 2023 09:35:26 +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
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyuz-0005bC-UC
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:25 +0000
Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com
 [2a00:1450:4864:20::22f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 448c732a-1b17-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:35:24 +0200 (CEST)
Received: by mail-lj1-x22f.google.com with SMTP id
 38308e7fff4ca-2b701e1ca63so1940111fa.1
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:24 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 448c732a-1b17-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549723; x=1691141723;
        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=aYcDkH+NYTJEg4WTYuKdvOgpJpdPrLrE00Jo/az+PMc=;
        b=qdNF81NI4N83t2hYr2K2/bAjBK98JgWSuVIgkhQ6MKSDlmTk/7HEmdS8MIGirJKx8c
         RXrrV93GMmrpNQc55W4LUOULiPsp2SYRrH60pjdBJmYJkHBZz+klwRRUvA4XVsQsfsbQ
         IIzgsVG8LrjKp+R/Ke50nUVEMNr8OqykmbhMMZMPBoB6uIHZ93JBgi8jmkwcOu7t3bsL
         UQKhwKk886ChWnazba94QK1l3J8+GAjB5dk/8RMolLFRER/OFCpywr8XBSpmSV95gmBF
         JsvSjfFBJVKVfANMSTWGNuaR8gVZbd+Q6do1RcXAV1mqLwcnMHteq2fuZPNk70W4uePy
         wtjA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549723; x=1691141723;
        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=aYcDkH+NYTJEg4WTYuKdvOgpJpdPrLrE00Jo/az+PMc=;
        b=K6AjGh84POW/LDmoxnBJ+Qd6RGrdQQhm/4NyGW8ZdKYEPYbVvc0VjDSiML7YiCKhRO
         G/OUqea25QI38gGFuRtYqx2qsbL4e6oaJ67xxbHyhkMjo7c5FngsBFfqjESAKqe3FVus
         yGNfkmH8Dm25hql3zUvFizybSNN2ld7qMVgCZ33dLS8PLPqksf1Q4xOH7wBQrSx1smdR
         PwgTlCygQ7CU0vfeJSg2q92YHrNkWUg51ZNNr/N26rFAUTIpjnH21Ut6G+eGf2uf72kP
         HhLS7LT+FpiL1pcnr5arIEViweOxCNw9IUUrT/TDNblJ8P6o3YHqBob0JuqYml+JAGhL
         571A==
X-Gm-Message-State: ABy/qLY7Jj6MsS7oJ1yv3/dcC2w1BVPCtT4JmLeC9Lrv6gHWk9ngjYfQ
	A4vmi7BrKOsi9Q2iG0vSZdQ9/MedjG3NErtVKds=
X-Google-Smtp-Source: APBJJlGNmiJkwe/ZlBCen5VK7sAfo8dxwOkxD55c0uqBvg2uz6iWiUfGl7wn+2u6butwESe1L0ktwg==
X-Received: by 2002:a2e:9bd6:0:b0:2b5:95a8:4126 with SMTP id w22-20020a2e9bd6000000b002b595a84126mr10320701ljj.52.1688549723757;
        Wed, 05 Jul 2023 02:35:23 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v9 07/24] xen/arm: ffa: add defines for framework direct request/response messages
Date: Wed,  5 Jul 2023 11:34:16 +0200
Message-Id: <20230705093433.2514898-8-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

According to DEN0077A version 1.1 REL0, section 18.3, Table 18.{21, 25,
26, 27, 28}, add defines for framework direct request/response messages.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 xen/arch/arm/tee/ffa.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index c1dead73d1f2..56a0a10c1e99 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -57,6 +57,19 @@
 #define FFA_MY_VERSION          MAKE_FFA_VERSION(FFA_MY_VERSION_MAJOR, \
                                                  FFA_MY_VERSION_MINOR)
 
+/*
+ * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
+ * BIT(31): Framework or partition message
+ * BIT(7-0): Message type for frameworks messages
+ */
+#define FFA_MSG_FLAG_FRAMEWORK          BIT(31, U)
+#define FFA_MSG_TYPE_MASK               0xFFU;
+#define FFA_MSG_PSCI                    0x0U
+#define FFA_MSG_SEND_VM_CREATED         0x4U
+#define FFA_MSG_RESP_VM_CREATED         0x5U
+#define FFA_MSG_SEND_VM_DESTROYED       0x6U
+#define FFA_MSG_RESP_VM_DESTROYED       0x7U
+
 /*
  * Flags to determine partition properties in FFA_PARTITION_INFO_GET return
  * message:
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:35:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:35:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558889.873422 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyv1-0007Bc-EE; Wed, 05 Jul 2023 09:35:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558889.873422; Wed, 05 Jul 2023 09:35:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyv1-00079y-6e; Wed, 05 Jul 2023 09:35:27 +0000
Received: by outflank-mailman (input) for mailman id 558889;
 Wed, 05 Jul 2023 09:35:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyv0-0006bq-1E
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:26 +0000
Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com
 [2a00:1450:4864:20::232])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4544a2c6-1b17-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 11:35:25 +0200 (CEST)
Received: by mail-lj1-x232.google.com with SMTP id
 38308e7fff4ca-2b6ef64342aso37113401fa.3
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:25 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4544a2c6-1b17-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549725; x=1691141725;
        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=tuV8RapENruJ9yIpnO0p4qSE4ssdvVfnP6i34l3RXw0=;
        b=Rnpt5EUPE7G9VmG1WJ9myyfK62kUeDWU2Vb0eOVWtZy7XRGFsPUzyLZMWY4UlT1TNG
         +FfboeWU7NqJXuboGxrfAWeS/LqhH9ElxSA6t8GE/gYBjL8u6+WGK+hpBPzq/d1/++4y
         /jx5IPwq+ABREzb4uqJ3F1bihd+xaEtiOMq7l/NI7OnMghcFPH/NbpQhiUVmH+tBm2dL
         kT2oHqnMiWs2IVlpWpbMTQSGRE1L+sL10UMYlQa09n7YGzo9zNOb0ePHgUF/OOAgMUeJ
         jgcoD7vkSkuyVJPn8ndAGnOrf2sU0wrXXhHZnDB9l9BjczuTAG5evWnpjZlncKiIV6M+
         AJfA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549725; x=1691141725;
        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=tuV8RapENruJ9yIpnO0p4qSE4ssdvVfnP6i34l3RXw0=;
        b=MnRJbcbsxofbyFxhgtkTi2keBTPzJlyrOrdginXqV35cwazqUJBWRiQA7P00lG/DkI
         uzspx8yLWpR3E8LO+Siux81BuqjEJyQIQlRlsxCwvLJJT5xJQJQpuBaxfyyRB+/p8ybz
         gXW3RmPAyitXapLxxoQRaEMF1m9QB7fpNLKaPuHuC+Noe+NQ9gdYwIWIZJPAE8ZNk9p4
         GIiJmbEzOn0si6gGBxSiFMNfFS9pRbwtiwlZpcvDLEVzkhZdoI1y1pQr2ushGHroDL+D
         TuFRkhxKIpiBqOuyZAavtxvanQL/TCKsQhKIXr4yyiCRuYMe3cOGSBT455JetOmLQKox
         /vKQ==
X-Gm-Message-State: ABy/qLZix9BAUpda8GGURMSBhEwa/YfAcX3OhbPZDxJ0wft/kFHTex8J
	DENCyjv+AucHR+uRFQXPgvxLIEACgYHzwe8vGXk=
X-Google-Smtp-Source: APBJJlEyQ1nAz45G88ONDZMf7naLt9F5A+CYbW+n20mlO7bNWFVpw/GB4ieBlNRKLv4M4/XRSSXylg==
X-Received: by 2002:a2e:9657:0:b0:2b6:faaa:fb53 with SMTP id z23-20020a2e9657000000b002b6faaafb53mr2604114ljh.26.1688549724911;
        Wed, 05 Jul 2023 02:35:24 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v9 08/24] xen/arm: ffa: enforce dependency on 4k pages
Date: Wed,  5 Jul 2023 11:34:17 +0200
Message-Id: <20230705093433.2514898-9-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds a BUILD_BUG_ON() to assert the dependency on 4k pages in the FF-A
mediator since the current implementation only works if Xen page size is
the same as the FFA page size.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 xen/arch/arm/tee/ffa.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 56a0a10c1e99..f0a2715d4bbf 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -57,6 +57,16 @@
 #define FFA_MY_VERSION          MAKE_FFA_VERSION(FFA_MY_VERSION_MAJOR, \
                                                  FFA_MY_VERSION_MINOR)
 
+/*
+ * The FF-A specification explicitly works with 4K pages as a measure of
+ * memory size, for example, FFA_RXTX_MAP takes one parameter "RX/TX page
+ * count" which is the number of contiguous 4K pages allocated. Xen may use
+ * a different page size depending on the configuration to avoid confusion
+ * with PAGE_SIZE use a special define when it's a page size as in the FF-A
+ * specification.
+ */
+#define FFA_PAGE_SIZE                   SZ_4K
+
 /*
  * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
  * BIT(31): Framework or partition message
@@ -261,6 +271,17 @@ static bool ffa_probe(void)
     unsigned int major_vers;
     unsigned int minor_vers;
 
+    /*
+     * FF-A often works in units of 4K pages and currently it's assumed
+     * that we can map memory using that granularity. See also the comment
+     * above the FFA_PAGE_SIZE define.
+     *
+     * It is possible to support a PAGE_SIZE larger than 4K in Xen, but
+     * until that is fully handled in this code make sure that we only use
+     * 4K page sizes.
+     */
+    BUILD_BUG_ON(PAGE_SIZE != FFA_PAGE_SIZE);
+
     /*
      * psci_init_smccc() updates this value with what's reported by EL-3
      * or secure world.
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:35:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:35:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558893.873462 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyv6-0008Vo-Vx; Wed, 05 Jul 2023 09:35:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558893.873462; Wed, 05 Jul 2023 09:35:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyv6-0008VA-Mh; Wed, 05 Jul 2023 09:35:32 +0000
Received: by outflank-mailman (input) for mailman id 558893;
 Wed, 05 Jul 2023 09:35:30 +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
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyv4-0005bC-P7
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:30 +0000
Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com
 [2a00:1450:4864:20::22d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 476e6fdc-1b17-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:35:29 +0200 (CEST)
Received: by mail-lj1-x22d.google.com with SMTP id
 38308e7fff4ca-2b6a16254a4so97375261fa.0
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:29 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 476e6fdc-1b17-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549728; x=1691141728;
        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=I6PcGNOj2uFVtSWdI80VqpOM3Tw157fUaqVtYpkv27I=;
        b=DEvL+q710F8tk41SRkTdh0e+4CAz6gsiuAYF2/Qh1nvPJxeVsuvtBY46qIR5CL0W9D
         DjS/xDuPmq1FnFAVKMREGGaifsozQsDRxgtqUCdvqzNMF2M/9RgQXgf8cRuZgLHQFa51
         MwGM8Lr6IekmzgYvu0doaUHDACAA5NRfmPLW/Ek4CMFhPErsIVFs7iqFaYJ4ktDpnU95
         VJDPIMVpw6mOE5WrZomfynZzMwzSPw7xeahQekjrwEphGyFTV6twzsnI5qoco0fL2riG
         nWajvs6prZVdlRGuydjorhG7Q/GIM/W/DufKThXPZObMIWTJf8Jzl+KfIfrfYA31VFvb
         YT8A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549728; x=1691141728;
        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=I6PcGNOj2uFVtSWdI80VqpOM3Tw157fUaqVtYpkv27I=;
        b=ayyvKsoxRGxlBaxi/ezWKv6I2Gdg67b8x6z/ENbPvwt9hvrUP10e80kLtz37JSV1b5
         RErH7oUtV6MbH/et2zkPHMjFGIQshnObyffy/oL3IAL6g+nsR5yalfLKGtDSoxoFJzq1
         +HzoSgWGmvb8zJRKDrA2WmDhQ9KMi2bF09lFjpFatT37N1xKFnUzxPIDfS1zGcbeVrAM
         w/MEFV78MX7xA+dHZzGzObycu4ZUB3ShlEAw68qT3B/nby+aeLyx4CYZM5/Q9t/Ha+KH
         1Ld6xpBLgyZtyN37eSJCRrzW4cV9QjnjdIgXqxQlYYkXWB7Kr4gjb73uB7UebUmWfxZo
         D+NA==
X-Gm-Message-State: ABy/qLYs3NEoyhtVvc29T9RGMIIhYTYRA/cb5aWqmXvQucxaCJjSZFZ9
	qVbTc9NQ7zmWS/j5mwuLxWa1zlVFUUQOPzR4uEI=
X-Google-Smtp-Source: APBJJlF1WoV8nmFc2oR5r4szd6sSBwz7KYe0xDqmvDJ4irnPV5Er1nvwLqLtUFmLapP0IzGV+pkxkQ==
X-Received: by 2002:a2e:a41a:0:b0:2b1:a89a:5f2b with SMTP id p26-20020a2ea41a000000b002b1a89a5f2bmr10849559ljn.2.1688549728532;
        Wed, 05 Jul 2023 02:35:28 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v9 11/24] xen/arm: ffa: map SPMC rx/tx buffers
Date: Wed,  5 Jul 2023 11:34:20 +0200
Message-Id: <20230705093433.2514898-12-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

When initializing the FF-A mediator map the RX and TX buffers shared with
the SPMC.

These buffer are later used to to transmit data that cannot be passed in
registers only.

Adds a check that the SP supports the needed FF-A features
FFA_RXTX_MAP_64 and FFA_RXTX_UNMAP.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c | 50 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 49 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index e05d58cf7755..f8ccaabc568d 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -12,6 +12,7 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
+#include <xen/mm.h>
 #include <xen/sched.h>
 #include <xen/sizes.h>
 #include <xen/types.h>
@@ -67,6 +68,12 @@
  */
 #define FFA_PAGE_SIZE                   SZ_4K
 
+/*
+ * The number of pages used for each of the RX and TX buffers shared with
+ * the SPMC.
+ */
+#define FFA_RXTX_PAGE_COUNT             1
+
 /*
  * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
  * BIT(31): Framework or partition message
@@ -161,6 +168,13 @@ struct ffa_ctx {
 /* Negotiated FF-A version to use with the SPMC */
 static uint32_t __ro_after_init ffa_version;
 
+/*
+ * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
+ * number of pages used in each of these buffers.
+ */
+static void *ffa_rx __read_mostly;
+static void *ffa_tx __read_mostly;
+
 static bool ffa_get_version(uint32_t *vers)
 {
     const struct arm_smccc_1_2_regs arg = {
@@ -231,6 +245,12 @@ static bool check_mandatory_feature(uint32_t id)
     return !ret;
 }
 
+static int32_t ffa_rxtx_map(paddr_t tx_addr, paddr_t rx_addr,
+                            uint32_t page_count)
+{
+    return ffa_simple_call(FFA_RXTX_MAP_64, tx_addr, rx_addr, page_count, 0);
+}
+
 static uint16_t get_vm_id(const struct domain *d)
 {
     /* +1 since 0 is reserved for the hypervisor in FF-A */
@@ -394,6 +414,7 @@ static int ffa_relinquish_resources(struct domain *d)
 static bool ffa_probe(void)
 {
     uint32_t vers;
+    int e;
     unsigned int major_vers;
     unsigned int minor_vers;
 
@@ -441,12 +462,39 @@ static bool ffa_probe(void)
      * TODO: Rework the code to allow domain to use a subset of the
      * features supported.
      */
-    if ( !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
+    if (
+         !check_mandatory_feature(FFA_RXTX_MAP_64) ||
+         !check_mandatory_feature(FFA_RXTX_UNMAP) ||
+         !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
+        return false;
+
+    ffa_rx = alloc_xenheap_pages(get_order_from_pages(FFA_RXTX_PAGE_COUNT), 0);
+    if ( !ffa_rx )
         return false;
 
+    ffa_tx = alloc_xenheap_pages(get_order_from_pages(FFA_RXTX_PAGE_COUNT), 0);
+    if ( !ffa_tx )
+        goto err_free_ffa_rx;
+
+    e = ffa_rxtx_map(__pa(ffa_tx), __pa(ffa_rx), FFA_RXTX_PAGE_COUNT);
+    if ( e )
+    {
+        printk(XENLOG_ERR "ffa: Failed to map rxtx: error %d\n", e);
+        goto err_free_ffa_tx;
+    }
     ffa_version = vers;
 
     return true;
+
+err_free_ffa_tx:
+    free_xenheap_pages(ffa_tx, 0);
+    ffa_tx = NULL;
+err_free_ffa_rx:
+    free_xenheap_pages(ffa_rx, 0);
+    ffa_rx = NULL;
+    ffa_version = 0;
+
+    return false;
 }
 
 static const struct tee_mediator_ops ffa_ops =
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:35:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:35:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558894.873465 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyv7-0000AJ-JV; Wed, 05 Jul 2023 09:35:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558894.873465; Wed, 05 Jul 2023 09:35:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyv7-00009P-81; Wed, 05 Jul 2023 09:35:33 +0000
Received: by outflank-mailman (input) for mailman id 558894;
 Wed, 05 Jul 2023 09:35:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyv6-0006bq-59
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:32 +0000
Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com
 [2a00:1450:4864:20::22c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 48d8192e-1b17-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 11:35:31 +0200 (CEST)
Received: by mail-lj1-x22c.google.com with SMTP id
 38308e7fff4ca-2b69dcf45faso105696701fa.0
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:31 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 48d8192e-1b17-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549731; x=1691141731;
        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=DSBg2xryTcGQSIhkiAk5XZ42VUodB1h52U56N4DUxBw=;
        b=haix9goqTFpeMCgdTNcgcuJZeX+0YMjDXLAQnkf1/sLdppJVDOj+/tcCGGpSE4G8EH
         vQPmx4Yyj5Bsq5d7NH26qdkt0k1KVHYKA+/Q/hxhwNJN3XTSoJPzvhtR0pCSQblTvC+f
         1Ef6o05MuYwmQWRhYVLbF9tIgQx6VW0Fq73Z14/bO+VN6XjhGqoUGGXlZ6KaPAAr3cpQ
         k8WrX1aPPmAX21Abp6bAZEhIbyGgH7I2Hxpc4jYlaITLXWSqvYRqT47RWAAfvSF6S9MX
         kC7r1DeLDmttUjKlKn7GAoGJhJp2uAtbqYay9Et9hYwQ8u2GQ+qmjJQR1w5Hn/WgMkkb
         9PMw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549731; x=1691141731;
        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=DSBg2xryTcGQSIhkiAk5XZ42VUodB1h52U56N4DUxBw=;
        b=dtw2enCkMov8bn/UlslcnBZKzXN3/H6sZZF/U9+YUNTSgnZ25Mbfq1OBjDATyX3937
         FInXpN3Ob9Sz4V3LjhPaVCrCzAPqyhFrkD3GHdi/sfbt9QtFWAF1iu5Drhoh4wzFSbBe
         ICGfRkjZq5lUrgSZmdvNixWojp3Wjlw3L6wgun+US8PUKzEbWH6L73RI0UtY1UJEdwuL
         SVibVdg6XVaibXGcmtYrF+pgnoJRt/L/LN1KX28ElK6yKpGWUvEl4X6U+ZJB67sY07zr
         z7rgNn102x3STTGM78ZbRIJ9UZsuEjpmCDneuvhdAxh1NKRlyOwYc86RuTAZTh9zlGPx
         GYqA==
X-Gm-Message-State: ABy/qLbKIGS6FK/+BuFMvkEVTsMD0i9C1rUd+OdNuPd5Uz93Uo+hBlkF
	qNNStUxWZGICdPSNA/qsYaNwo4esrSMXeXy7qFU=
X-Google-Smtp-Source: APBJJlGVz+GGr1BGYhTewNovKl6bOEcgQCxFMYm0WJ6fzZSavWHZSOqfa3zc0++sJavG17h6yVNjHw==
X-Received: by 2002:a2e:b0d2:0:b0:2b6:d9dd:f65f with SMTP id g18-20020a2eb0d2000000b002b6d9ddf65fmr8142941ljl.17.1688549730903;
        Wed, 05 Jul 2023 02:35:30 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [XEN PATCH v9 13/24] xen/arm: ffa: support mapping guest RX/TX buffers
Date: Wed,  5 Jul 2023 11:34:22 +0200
Message-Id: <20230705093433.2514898-14-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support in the mediator to map and unmap the RX and TX buffers
provided by the guest using the two FF-A functions FFA_RXTX_MAP and
FFA_RXTX_UNMAP.

These buffer are later used to transmit data that cannot be passed in
registers only.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c | 138 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index d755363de686..ffabb5ed0a80 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -74,6 +74,12 @@
  */
 #define FFA_RXTX_PAGE_COUNT             1
 
+/*
+ * Limits the number of pages RX/TX buffers guests can map.
+ * TODO support a larger number.
+ */
+#define FFA_MAX_RXTX_PAGE_COUNT         1
+
 /*
  * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
  * BIT(31): Framework or partition message
@@ -169,6 +175,12 @@ struct ffa_partition_info_1_1 {
 };
 
 struct ffa_ctx {
+    void *rx;
+    const void *tx;
+    struct page_info *rx_pg;
+    struct page_info *tx_pg;
+    /* Number of 4kB pages in each of rx/rx_pg and tx/tx_pg */
+    unsigned int page_count;
     /* FF-A version used by the guest */
     uint32_t guest_vers;
     /*
@@ -176,6 +188,7 @@ struct ffa_ctx {
      * ffa_domain_teardown() to know which SPs need to be signalled.
      */
     uint16_t create_signal_count;
+    bool rx_is_free;
 };
 
 /* Negotiated FF-A version to use with the SPMC */
@@ -371,6 +384,11 @@ static void set_regs(struct cpu_user_regs *regs, register_t v0, register_t v1,
         set_user_reg(regs, 7, v7);
 }
 
+static void set_regs_error(struct cpu_user_regs *regs, uint32_t error_code)
+{
+    set_regs(regs, FFA_ERROR, 0, error_code, 0, 0, 0, 0, 0);
+}
+
 static void set_regs_success(struct cpu_user_regs *regs, uint32_t w2,
                              uint32_t w3)
 {
@@ -392,6 +410,106 @@ static void handle_version(struct cpu_user_regs *regs)
     set_regs(regs, vers, 0, 0, 0, 0, 0, 0, 0);
 }
 
+static uint32_t handle_rxtx_map(uint32_t fid, register_t tx_addr,
+                                register_t rx_addr, uint32_t page_count)
+{
+    uint32_t ret = FFA_RET_INVALID_PARAMETERS;
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+    struct page_info *tx_pg;
+    struct page_info *rx_pg;
+    p2m_type_t t;
+    void *rx;
+    void *tx;
+
+    if ( !smccc_is_conv_64(fid) )
+    {
+        /*
+         * Calls using the 32-bit calling convention must ignore the upper
+         * 32 bits in the argument registers.
+         */
+        tx_addr &= UINT32_MAX;
+        rx_addr &= UINT32_MAX;
+    }
+
+    if ( page_count > FFA_MAX_RXTX_PAGE_COUNT )
+    {
+        printk(XENLOG_ERR "ffa: RXTX_MAP: error: %u pages requested (limit %u)\n",
+               page_count, FFA_MAX_RXTX_PAGE_COUNT);
+        return FFA_RET_NOT_SUPPORTED;
+    }
+
+    /* Already mapped */
+    if ( ctx->rx )
+        return FFA_RET_DENIED;
+
+    tx_pg = get_page_from_gfn(d, gfn_x(gaddr_to_gfn(tx_addr)), &t, P2M_ALLOC);
+    if ( !tx_pg )
+        return FFA_RET_INVALID_PARAMETERS;
+    /* Only normal RW RAM for now */
+    if ( t != p2m_ram_rw )
+        goto err_put_tx_pg;
+
+    rx_pg = get_page_from_gfn(d, gfn_x(gaddr_to_gfn(rx_addr)), &t, P2M_ALLOC);
+    if ( !tx_pg )
+        goto err_put_tx_pg;
+    /* Only normal RW RAM for now */
+    if ( t != p2m_ram_rw )
+        goto err_put_rx_pg;
+
+    tx = __map_domain_page_global(tx_pg);
+    if ( !tx )
+        goto err_put_rx_pg;
+
+    rx = __map_domain_page_global(rx_pg);
+    if ( !rx )
+        goto err_unmap_tx;
+
+    ctx->rx = rx;
+    ctx->tx = tx;
+    ctx->rx_pg = rx_pg;
+    ctx->tx_pg = tx_pg;
+    ctx->page_count = page_count;
+    ctx->rx_is_free = true;
+    return FFA_RET_OK;
+
+err_unmap_tx:
+    unmap_domain_page_global(tx);
+err_put_rx_pg:
+    put_page(rx_pg);
+err_put_tx_pg:
+    put_page(tx_pg);
+
+    return ret;
+}
+
+static void rxtx_unmap(struct ffa_ctx *ctx)
+{
+    unmap_domain_page_global(ctx->rx);
+    unmap_domain_page_global(ctx->tx);
+    put_page(ctx->rx_pg);
+    put_page(ctx->tx_pg);
+    ctx->rx = NULL;
+    ctx->tx = NULL;
+    ctx->rx_pg = NULL;
+    ctx->tx_pg = NULL;
+    ctx->page_count = 0;
+    ctx->rx_is_free = false;
+}
+
+static uint32_t handle_rxtx_unmap(void)
+{
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+
+    if ( !ctx->rx )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    rxtx_unmap(ctx);
+
+    return FFA_RET_OK;
+}
+
 static void handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
 {
     struct arm_smccc_1_2_regs arg = { .a0 = fid, };
@@ -448,6 +566,7 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     uint32_t fid = get_user_reg(regs, 0);
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
+    int e;
 
     if ( !ctx )
         return false;
@@ -460,6 +579,22 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     case FFA_ID_GET:
         set_regs_success(regs, get_vm_id(d), 0);
         return true;
+    case FFA_RXTX_MAP_32:
+    case FFA_RXTX_MAP_64:
+        e = handle_rxtx_map(fid, get_user_reg(regs, 1), get_user_reg(regs, 2),
+                            get_user_reg(regs, 3));
+        if ( e )
+            set_regs_error(regs, e);
+        else
+            set_regs_success(regs, 0, 0);
+        return true;
+    case FFA_RXTX_UNMAP:
+        e = handle_rxtx_unmap();
+        if ( e )
+            set_regs_error(regs, e);
+        else
+            set_regs_success(regs, 0, 0);
+        return true;
     case FFA_MSG_SEND_DIRECT_REQ_32:
     case FFA_MSG_SEND_DIRECT_REQ_64:
         handle_msg_send_direct_req(regs, fid);
@@ -551,6 +686,9 @@ static int ffa_domain_teardown(struct domain *d)
                    get_vm_id(d), subscr_vm_destroyed[n], res);
     }
 
+    if ( ctx->rx )
+        rxtx_unmap(ctx);
+
     XFREE(d->arch.tee);
 
     return 0;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:35:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:35:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558896.873485 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyvE-0001YW-1o; Wed, 05 Jul 2023 09:35:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558896.873485; Wed, 05 Jul 2023 09:35:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyvD-0001Y6-RT; Wed, 05 Jul 2023 09:35:39 +0000
Received: by outflank-mailman (input) for mailman id 558896;
 Wed, 05 Jul 2023 09:35:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyvC-0006bq-IY
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:38 +0000
Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com
 [2a00:1450:4864:20::229])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4c712355-1b17-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 11:35:37 +0200 (CEST)
Received: by mail-lj1-x229.google.com with SMTP id
 38308e7fff4ca-2b701dee4bfso2132311fa.0
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:37 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.35
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:36 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4c712355-1b17-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549737; x=1691141737;
        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=EfUxs6oNXk54MzNkpT+pqgSAZUf1sqgLTIg8nTp7P0A=;
        b=pA6fk+FIoBbWLGluJvHuyyIl3Vv/fJZcabIJwPpBB45JJ6rzomnEVHHm98GRRqVh/L
         g4qSsRiBLMwo0p4m6D8IEZFRjmXhKnQeaRhQZRjPYxC26Ek+rnaOc7gsBQHmkYcYFEYQ
         4ygiXpu1RR8/jr0TwSpu6FVSawzY1AsEtDujhD7uwfcAvGTtMfHup+7ZLDoy7jBAy+Jx
         MnCZ0uJufgyyAgjtrMJlmOZXpcM5BTwRvDEFLWhErCnxbQSmc3RF3WOefmKH761Ug0oC
         vUKHVXOV4vAOcAAZ3Yx4c+DYlP22KehrUIdPkSlPaIe32Giczvbd6b8hXrq3a2KTzqAP
         +mWg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549737; x=1691141737;
        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=EfUxs6oNXk54MzNkpT+pqgSAZUf1sqgLTIg8nTp7P0A=;
        b=e8zfruMlqGyS2Sa1jt7jCriyyyqXoG8+BLxmd7YB2V5icTDAzyvR5riRc4lffAwlgF
         nf/xfHry8ULQXUaLLZnP1pX/CbsoYHrBriMS7QAVUC0M4Np3QLXh5CikkOpU0A8KndWI
         9gJAXZWaHtCdHyu9MFwXY0lzQOWTPjNdTdokarw2cz9t2WRCXXj8Ik1aKr1jUCkDinVX
         svEmNigY5Y9HUPavzzInC2E3d3gVnmWIj1uTeOFSS0k+D10Tw4fEey8ve4tC1gAbzS3g
         Su0APoMj6ytAjQoNsaC1aq/EiJaZW9mAya7v9okJxC75SKHzxo+KYU2yr3N21z53kh+I
         gR/g==
X-Gm-Message-State: ABy/qLaSTxdCt8n7V/HLJyB8FI03xbzV4O3qC45jneyeQYMh/0+HHOOE
	HuUq4aJfyOQda8wEbJqPFidnX7+HwWms1B78m2Y=
X-Google-Smtp-Source: APBJJlErcrEdNv5Br/S5iZ7lSjiqlWippZXRMWVGTzt9ZxkvuOLqCe3vBZx8UfiC6Yczm+ZTM/ajCA==
X-Received: by 2002:a2e:b703:0:b0:2b6:df15:f6c3 with SMTP id j3-20020a2eb703000000b002b6df15f6c3mr8492698ljo.39.1688549736891;
        Wed, 05 Jul 2023 02:35:36 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v9 18/24] xen/arm: ffa: support sharing memory
Date: Wed,  5 Jul 2023 11:34:27 +0200
Message-Id: <20230705093433.2514898-19-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support for a guest to share memory with an SP using FFA_MEM_SHARE.
Only memory regions small enough to be shared with a single call to
FFA_MEM_SHARE are supported.

With this commit we have a FF-A version 1.1 [1] mediator able to
communicate with a Secure Partition in secure world using shared memory.
The secure world must use FF-A version 1.1, but the guest is free to use
version 1.0 or version 1.1.

Adds a check that the SP supports the needed FF-A features
FFA_MEM_SHARE_64 or FFA_MEM_SHARE_32.

[1] https://developer.arm.com/documentation/den0077/latest
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c | 486 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 486 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 03699473cfc5..f3eb84a8e9b7 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -297,6 +297,38 @@ struct ffa_mem_transaction_1_1 {
     uint8_t reserved[12];
 };
 
+/* Calculate offset of struct ffa_mem_access from start of buffer */
+#define MEM_ACCESS_OFFSET(access_idx) \
+    ( sizeof(struct ffa_mem_transaction_1_1) + \
+      ( access_idx ) * sizeof(struct ffa_mem_access) )
+
+/* Calculate offset of struct ffa_mem_region from start of buffer */
+#define REGION_OFFSET(access_count, region_idx) \
+    ( MEM_ACCESS_OFFSET(access_count) + \
+      ( region_idx ) * sizeof(struct ffa_mem_region) )
+
+/* Calculate offset of struct ffa_address_range from start of buffer */
+#define ADDR_RANGE_OFFSET(access_count, region_count, range_idx) \
+    ( REGION_OFFSET(access_count, region_count) + \
+      ( range_idx ) * sizeof(struct ffa_address_range) )
+
+/*
+ * The parts needed from struct ffa_mem_transaction_1_0 or struct
+ * ffa_mem_transaction_1_1, used to provide an abstraction of difference in
+ * data structures between version 1.0 and 1.1. This is just an internal
+ * interface and can be changed without changing any ABI.
+ */
+struct ffa_mem_transaction_int {
+    uint16_t sender_id;
+    uint8_t mem_reg_attr;
+    uint8_t flags;
+    uint8_t mem_access_size;
+    uint8_t mem_access_count;
+    uint16_t mem_access_offs;
+    uint64_t handle;
+    uint64_t tag;
+};
+
 /* Endpoint RX/TX descriptor */
 struct ffa_endpoint_rxtx_descriptor_1_0 {
     uint16_t sender_id;
@@ -327,9 +359,22 @@ struct ffa_ctx {
      */
     uint16_t create_signal_count;
     bool rx_is_free;
+    /* Used shared memory objects, struct ffa_shm_mem */
+    struct list_head shm_list;
+    /* Number of allocated shared memory object */
+    unsigned int shm_count;
     spinlock_t lock;
 };
 
+struct ffa_shm_mem {
+    struct list_head list;
+    uint16_t sender_id;
+    uint16_t ep_id;     /* endpoint, the one lending */
+    uint64_t handle;    /* FFA_HANDLE_INVALID if not set yet */
+    unsigned int page_count;
+    struct page_info *pages[];
+};
+
 /* Negotiated FF-A version to use with the SPMC */
 static uint32_t __ro_after_init ffa_version;
 
@@ -351,6 +396,7 @@ static uint16_t subscr_vm_destroyed_count __read_mostly;
 static void *ffa_rx __read_mostly;
 static void *ffa_tx __read_mostly;
 static DEFINE_SPINLOCK(ffa_rx_buffer_lock);
+static DEFINE_SPINLOCK(ffa_tx_buffer_lock);
 
 static bool ffa_get_version(uint32_t *vers)
 {
@@ -457,6 +503,41 @@ static int32_t ffa_rx_release(void)
     return ffa_simple_call(FFA_RX_RELEASE, 0, 0, 0, 0);
 }
 
+static int32_t ffa_mem_share(uint32_t tot_len, uint32_t frag_len,
+                             register_t addr, uint32_t pg_count,
+                             uint64_t *handle)
+{
+    struct arm_smccc_1_2_regs arg = {
+        .a0 = FFA_MEM_SHARE_64,
+        .a1 = tot_len,
+        .a2 = frag_len,
+        .a3 = addr,
+        .a4 = pg_count,
+    };
+    struct arm_smccc_1_2_regs resp;
+
+    arm_smccc_1_2_smc(&arg, &resp);
+
+    switch ( resp.a0 )
+    {
+    case FFA_ERROR:
+        if ( resp.a2 )
+            return resp.a2;
+        else
+            return FFA_RET_NOT_SUPPORTED;
+    case FFA_SUCCESS_32:
+        *handle = regpair_to_uint64(resp.a3, resp.a2);
+        return FFA_RET_OK;
+    case FFA_MEM_FRAG_RX:
+        *handle = regpair_to_uint64(resp.a2, resp.a1);
+        if ( resp.a3 > INT32_MAX ) /* Impossible value */
+            return FFA_RET_ABORTED;
+        return resp.a3 & INT32_MAX;
+    default:
+        return FFA_RET_NOT_SUPPORTED;
+    }
+}
+
 static int32_t ffa_direct_req_send_vm(uint16_t sp_id, uint16_t vm_id,
                                       uint8_t msg)
 {
@@ -800,6 +881,403 @@ out:
              resp.a4 & mask, resp.a5 & mask, resp.a6 & mask, resp.a7 & mask);
 }
 
+/*
+ * Gets all page and assigns them to the supplied shared memory object. If
+ * this function fails then the caller is still expected to call
+ * put_shm_pages() as a cleanup.
+ */
+static int get_shm_pages(struct domain *d, struct ffa_shm_mem *shm,
+                         const struct ffa_address_range *range,
+                         uint32_t range_count, unsigned int start_page_idx,
+                         unsigned int *last_page_idx)
+{
+    unsigned int pg_idx = start_page_idx;
+    gfn_t gfn;
+    unsigned int n;
+    unsigned int m;
+    p2m_type_t t;
+    uint64_t addr;
+    uint64_t page_count;
+
+    for ( n = 0; n < range_count; n++ )
+    {
+        page_count = read_atomic(&range[n].page_count);
+        addr = read_atomic(&range[n].address);
+        for ( m = 0; m < page_count; m++ )
+        {
+            if ( pg_idx >= shm->page_count )
+                return FFA_RET_INVALID_PARAMETERS;
+
+            gfn = gaddr_to_gfn(addr + m * FFA_PAGE_SIZE);
+            shm->pages[pg_idx] = get_page_from_gfn(d, gfn_x(gfn), &t,
+						   P2M_ALLOC);
+            if ( !shm->pages[pg_idx] )
+                return FFA_RET_DENIED;
+            /* Only normal RW RAM for now */
+            if ( t != p2m_ram_rw )
+                return FFA_RET_DENIED;
+            pg_idx++;
+        }
+    }
+
+    *last_page_idx = pg_idx;
+
+    return FFA_RET_OK;
+}
+
+static void put_shm_pages(struct ffa_shm_mem *shm)
+{
+    unsigned int n;
+
+    for ( n = 0; n < shm->page_count && shm->pages[n]; n++ )
+    {
+        put_page(shm->pages[n]);
+        shm->pages[n] = NULL;
+    }
+}
+
+static struct ffa_shm_mem *alloc_ffa_shm_mem(struct ffa_ctx *ctx,
+                                             unsigned int page_count)
+{
+    struct ffa_shm_mem *shm;
+
+    if ( page_count >= FFA_MAX_SHM_PAGE_COUNT ||
+         ctx->shm_count >= FFA_MAX_SHM_COUNT )
+        return NULL;
+
+    shm = xzalloc_flex_struct(struct ffa_shm_mem, pages, page_count);
+    if ( shm )
+    {
+        ctx->shm_count++;
+        shm->page_count = page_count;
+    }
+
+    return shm;
+}
+
+static void free_ffa_shm_mem(struct ffa_ctx *ctx, struct ffa_shm_mem *shm)
+{
+    if ( !shm )
+        return;
+
+    ASSERT(ctx->shm_count > 0);
+    ctx->shm_count--;
+    put_shm_pages(shm);
+    xfree(shm);
+}
+
+static void init_range(struct ffa_address_range *addr_range,
+                       paddr_t pa)
+{
+    memset(addr_range, 0, sizeof(*addr_range));
+    addr_range->address = pa;
+    addr_range->page_count = 1;
+}
+
+/*
+ * This function uses the ffa_tx buffer to transmit the memory transaction
+ * descriptor. The function depends ffa_tx_buffer_lock to be used to guard
+ * the buffer from concurrent use.
+ */
+static int share_shm(struct ffa_shm_mem *shm)
+{
+    const uint32_t max_frag_len = FFA_RXTX_PAGE_COUNT * FFA_PAGE_SIZE;
+    struct ffa_mem_access *mem_access_array;
+    struct ffa_mem_transaction_1_1 *descr;
+    struct ffa_address_range *addr_range;
+    struct ffa_mem_region *region_descr;
+    const unsigned int region_count = 1;
+    void *buf = ffa_tx;
+    uint32_t frag_len;
+    uint32_t tot_len;
+    paddr_t last_pa;
+    unsigned int n;
+    paddr_t pa;
+
+    ASSERT(spin_is_locked(&ffa_tx_buffer_lock));
+    ASSERT(shm->page_count);
+
+    descr = buf;
+    memset(descr, 0, sizeof(*descr));
+    descr->sender_id = shm->sender_id;
+    descr->handle = shm->handle;
+    descr->mem_reg_attr = FFA_NORMAL_MEM_REG_ATTR;
+    descr->mem_access_count = 1;
+    descr->mem_access_size = sizeof(*mem_access_array);
+    descr->mem_access_offs = MEM_ACCESS_OFFSET(0);
+
+    mem_access_array = buf + descr->mem_access_offs;
+    memset(mem_access_array, 0, sizeof(*mem_access_array));
+    mem_access_array[0].access_perm.endpoint_id = shm->ep_id;
+    mem_access_array[0].access_perm.perm = FFA_MEM_ACC_RW;
+    mem_access_array[0].region_offs = REGION_OFFSET(descr->mem_access_count, 0);
+
+    region_descr = buf + mem_access_array[0].region_offs;
+    memset(region_descr, 0, sizeof(*region_descr));
+    region_descr->total_page_count = shm->page_count;
+
+    region_descr->address_range_count = 1;
+    last_pa = page_to_maddr(shm->pages[0]);
+    for ( n = 1; n < shm->page_count; last_pa = pa, n++ )
+    {
+        pa = page_to_maddr(shm->pages[n]);
+        if ( last_pa + FFA_PAGE_SIZE == pa )
+            continue;
+        region_descr->address_range_count++;
+    }
+
+    tot_len = ADDR_RANGE_OFFSET(descr->mem_access_count, region_count,
+                                region_descr->address_range_count);
+    if ( tot_len > max_frag_len )
+        return FFA_RET_NOT_SUPPORTED;
+
+    addr_range = region_descr->address_range_array;
+    frag_len = ADDR_RANGE_OFFSET(descr->mem_access_count, region_count, 1);
+    last_pa = page_to_maddr(shm->pages[0]);
+    init_range(addr_range, last_pa);
+    for ( n = 1; n < shm->page_count; last_pa = pa, n++ )
+    {
+        pa = page_to_maddr(shm->pages[n]);
+        if ( last_pa + FFA_PAGE_SIZE == pa )
+        {
+            addr_range->page_count++;
+            continue;
+        }
+
+        frag_len += sizeof(*addr_range);
+        addr_range++;
+        init_range(addr_range, pa);
+    }
+
+    return ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
+}
+
+static int read_mem_transaction(uint32_t ffa_vers, const void *buf, size_t blen,
+                                struct ffa_mem_transaction_int *trans)
+{
+    uint16_t mem_reg_attr;
+    uint32_t flags;
+    uint32_t count;
+    uint32_t offs;
+    uint32_t size;
+
+    if ( ffa_vers >= FFA_VERSION_1_1 )
+    {
+        const struct ffa_mem_transaction_1_1 *descr;
+
+        if ( blen < sizeof(*descr) )
+            return FFA_RET_INVALID_PARAMETERS;
+
+        descr = buf;
+        trans->sender_id = descr->sender_id;
+        mem_reg_attr = descr->mem_reg_attr;
+        flags = descr->flags;
+        trans->handle = descr->handle;
+        trans->tag = descr->tag;
+
+        count = descr->mem_access_count;
+        size = descr->mem_access_size;
+        offs = descr->mem_access_offs;
+    }
+    else
+    {
+        const struct ffa_mem_transaction_1_0 *descr;
+
+        if ( blen < sizeof(*descr) )
+            return FFA_RET_INVALID_PARAMETERS;
+
+        descr = buf;
+        trans->sender_id = descr->sender_id;
+        mem_reg_attr = descr->mem_reg_attr;
+        flags = descr->flags;
+        trans->handle = descr->handle;
+        trans->tag = descr->tag;
+
+        count = descr->mem_access_count;
+        size = sizeof(struct ffa_mem_access);
+        offs = offsetof(struct ffa_mem_transaction_1_0, mem_access_array);
+    }
+    /*
+     * Make sure that "descr" which is shared with the guest isn't accessed
+     * again after this point.
+     */
+    barrier();
+
+    /*
+     * We're doing a rough check to see that no information is lost when
+     * tranfering the values into a struct ffa_mem_transaction_int below.
+     * The fields in struct ffa_mem_transaction_int are wide enough to hold
+     * any valid value so being out of range means that something is wrong.
+     */
+    if ( mem_reg_attr > UINT8_MAX || flags > UINT8_MAX || size > UINT8_MAX ||
+        count > UINT8_MAX || offs > UINT16_MAX )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    /* Check that the endpoint memory access descriptor array fits */
+    if ( size * count + offs > blen )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    trans->mem_reg_attr = mem_reg_attr;
+    trans->flags = flags;
+    trans->mem_access_size = size;
+    trans->mem_access_count = count;
+    trans->mem_access_offs = offs;
+
+    return 0;
+}
+
+static void handle_mem_share(struct cpu_user_regs *regs)
+{
+    uint32_t tot_len = get_user_reg(regs, 1);
+    uint32_t frag_len = get_user_reg(regs, 2);
+    uint64_t addr = get_user_reg(regs, 3);
+    uint32_t page_count = get_user_reg(regs, 4);
+    const struct ffa_mem_region *region_descr;
+    const struct ffa_mem_access *mem_access;
+    struct ffa_mem_transaction_int trans;
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+    struct ffa_shm_mem *shm = NULL;
+    unsigned int last_page_idx = 0;
+    register_t handle_hi = 0;
+    register_t handle_lo = 0;
+    int ret = FFA_RET_DENIED;
+    uint32_t range_count;
+    uint32_t region_offs;
+
+    /*
+     * We're only accepting memory transaction descriptors via the rx/tx
+     * buffer.
+     */
+    if ( addr )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out_set_ret;
+    }
+
+    /* Check that fragment length doesn't exceed total length */
+    if ( frag_len > tot_len )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out_set_ret;
+    }
+
+    /* We currently only support a single fragment */
+    if ( frag_len != tot_len )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out_set_ret;
+    }
+
+    spin_lock(&ctx->lock);
+
+    if ( frag_len > ctx->page_count * FFA_PAGE_SIZE )
+        goto out_unlock;
+
+    ret = read_mem_transaction(ctx->guest_vers, ctx->tx, frag_len, &trans);
+    if ( ret )
+        goto out_unlock;
+
+    if ( trans.mem_reg_attr != FFA_NORMAL_MEM_REG_ATTR )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out_unlock;
+    }
+
+    /* Only supports sharing it with one SP for now */
+    if ( trans.mem_access_count != 1 )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out_unlock;
+    }
+
+    if ( trans.sender_id != get_vm_id(d) )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out_unlock;
+    }
+
+    /* Check that it fits in the supplied data */
+    if ( trans.mem_access_offs + trans.mem_access_size > frag_len )
+        goto out_unlock;
+
+    mem_access = ctx->tx + trans.mem_access_offs;
+    if ( read_atomic(&mem_access->access_perm.perm) != FFA_MEM_ACC_RW )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out_unlock;
+    }
+
+    region_offs = read_atomic(&mem_access->region_offs);
+    if ( sizeof(*region_descr) + region_offs > frag_len )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out_unlock;
+    }
+
+    region_descr = ctx->tx + region_offs;
+    range_count = read_atomic(&region_descr->address_range_count);
+    page_count = read_atomic(&region_descr->total_page_count);
+
+    if ( !page_count )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out_unlock;
+    }
+
+    shm = alloc_ffa_shm_mem(ctx, page_count);
+    if ( !shm )
+    {
+        ret = FFA_RET_NO_MEMORY;
+        goto out_unlock;
+    }
+    shm->sender_id = trans.sender_id;
+    shm->ep_id = read_atomic(&mem_access->access_perm.endpoint_id);
+
+    /*
+     * Check that the Composite memory region descriptor fits.
+     */
+    if ( sizeof(*region_descr) + region_offs +
+         range_count * sizeof(struct ffa_address_range) > frag_len )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out;
+    }
+
+    ret = get_shm_pages(d, shm, region_descr->address_range_array, range_count,
+                        0, &last_page_idx);
+    if ( ret )
+        goto out;
+    if ( last_page_idx != shm->page_count )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out;
+    }
+
+    /* Note that share_shm() uses our tx buffer */
+    spin_lock(&ffa_tx_buffer_lock);
+    ret = share_shm(shm);
+    spin_unlock(&ffa_tx_buffer_lock);
+    if ( ret )
+        goto out;
+
+    list_add_tail(&shm->list, &ctx->shm_list);
+
+    uint64_to_regpair(&handle_hi, &handle_lo, shm->handle);
+
+out:
+    if ( ret )
+        free_ffa_shm_mem(ctx, shm);
+out_unlock:
+    spin_unlock(&ctx->lock);
+
+out_set_ret:
+    if ( ret == 0)
+            set_regs_success(regs, handle_lo, handle_hi);
+    else
+            set_regs_error(regs, ret);
+}
+
 static bool ffa_handle_call(struct cpu_user_regs *regs)
 {
     uint32_t fid = get_user_reg(regs, 0);
@@ -857,6 +1335,10 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     case FFA_MSG_SEND_DIRECT_REQ_64:
         handle_msg_send_direct_req(regs, fid);
         return true;
+    case FFA_MEM_SHARE_32:
+    case FFA_MEM_SHARE_64:
+        handle_mem_share(regs);
+        return true;
 
     default:
         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
@@ -898,6 +1380,8 @@ static int ffa_domain_init(struct domain *d)
     }
     ctx->create_signal_count = n;
 
+    INIT_LIST_HEAD(&ctx->shm_list);
+
     return 0;
 }
 
@@ -1086,7 +1570,9 @@ static bool ffa_probe(void)
     if ( !check_mandatory_feature(FFA_PARTITION_INFO_GET) ||
          !check_mandatory_feature(FFA_RX_RELEASE) ||
          !check_mandatory_feature(FFA_RXTX_MAP_64) ||
+         !check_mandatory_feature(FFA_MEM_SHARE_64) ||
          !check_mandatory_feature(FFA_RXTX_UNMAP) ||
+         !check_mandatory_feature(FFA_MEM_SHARE_32) ||
          !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
         return false;
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:35:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:35:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558897.873490 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyvE-0001hk-QR; Wed, 05 Jul 2023 09:35:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558897.873490; Wed, 05 Jul 2023 09:35:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyvE-0001fe-CA; Wed, 05 Jul 2023 09:35:40 +0000
Received: by outflank-mailman (input) for mailman id 558897;
 Wed, 05 Jul 2023 09:35:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyvD-0006bq-IQ
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:39 +0000
Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com
 [2a00:1450:4864:20::233])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4d117840-1b17-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 11:35:38 +0200 (CEST)
Received: by mail-lj1-x233.google.com with SMTP id
 38308e7fff4ca-2b63e5f94f1so6622001fa.1
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:38 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4d117840-1b17-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549738; x=1691141738;
        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=sWua/aGnhgeAUqYKtQ1Lf4Q/vc2pnAQzQP1lQqZFLOs=;
        b=t2lANbONfVCUPmioMdbT5ugJNIAtFeNHJLUO0BudbmZENdOHcp6cnWKOZNcWSPSe44
         FyH6gNeEgGbD5gYkrf282Wg5SQ5hNOMS7IkqvNPTKzitGaF1FnFzBik7MwpbCDVMWTkm
         mt04bNyxh3zxd6HrUNl1iLEAsu71tPIseuxgrVU+6rDKUjgZNiRAP+HO25O1IMGiCmrC
         PsRFLeqQrfOc+4DGK1AuRDHqPLhHSaN+gT8z77/HTSEJAH8ZGIWkcIhKDGYz+MNzw+My
         Sj5Ms0hiSkVmlG3wdoToYh/vGgHh/0xZe22M9yMH1r1Mzz2APH2IfI+v0ctxQUcW0ym5
         Sigg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549738; x=1691141738;
        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=sWua/aGnhgeAUqYKtQ1Lf4Q/vc2pnAQzQP1lQqZFLOs=;
        b=hlO8TwgEOjX7giNOouqHY1KEq6rJlAuy+ZKAC2a6jCUN9mlADzFD0WQRfu8uZIzlp1
         08Fk85+BN3vRcvyGi+t7oWmJiUK6tmyTZVDhY7wr2FZDgDg3eJyILwvqFaO/BRRdBrC2
         7N52+qP3+7YsQgCLfhfjbOU13waoHKj/q0NaOGkY7Aq5MFWdQ7GxaBfYxNbDpi4eN3mL
         s+MZdz+0NW1EwJK9Rji3qcLUd91P5r5VjZeh2e1XiB+1lyNIkgmA2/XYu+JT3qynhyuF
         IpIDFNqaX+mLhI1QcGzKghLiwPCeehmvXEiPP7UIIFRn5/Wub6RKfzSL/bxE8IGjK0DY
         auXw==
X-Gm-Message-State: ABy/qLb+8S6ntcrih1XzZ/S6kfWGLmDcx66eeCmFSd47OwbDtlSflKdh
	CBdf8TY9FaYmEMn+K5CzlxeaxlYigR9U7/IJTZ8=
X-Google-Smtp-Source: APBJJlGIsl0hv181Iy7TeYWQi9ltmrfQxnPlGaqu1gvAxtnhqtpqsv2Zkq7ZEC1I47eH29T1HbLyXA==
X-Received: by 2002:a2e:3c04:0:b0:2b6:b849:c893 with SMTP id j4-20020a2e3c04000000b002b6b849c893mr578326lja.26.1688549738005;
        Wed, 05 Jul 2023 02:35:38 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v9 19/24] xen/arm: ffa: add support to reclaim shared memory
Date: Wed,  5 Jul 2023 11:34:28 +0200
Message-Id: <20230705093433.2514898-20-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support to reclaim memory previously shared with FFA_MEM_SHARE.

A memory region that doesn't need to be shared any longer can be
reclaimed with FFA_MEM_RECLAIM once the SP doesn't use it any longer.
This is checked by the SPMC and not in control of the mediator.

Adds a check that the SP supports the needed FF-A feature
FFA_MEM_RECLAIM.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/tee/ffa.c | 53 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index f3eb84a8e9b7..c623c51168b9 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -538,6 +538,12 @@ static int32_t ffa_mem_share(uint32_t tot_len, uint32_t frag_len,
     }
 }
 
+static int32_t ffa_mem_reclaim(uint32_t handle_lo, uint32_t handle_hi,
+                               uint32_t flags)
+{
+    return ffa_simple_call(FFA_MEM_RECLAIM, handle_lo, handle_hi, flags, 0);
+}
+
 static int32_t ffa_direct_req_send_vm(uint16_t sp_id, uint16_t vm_id,
                                       uint8_t msg)
 {
@@ -1278,6 +1284,43 @@ out_set_ret:
             set_regs_error(regs, ret);
 }
 
+static int handle_mem_reclaim(uint64_t handle, uint32_t flags)
+{
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+    struct ffa_shm_mem *shm;
+    register_t handle_hi;
+    register_t handle_lo;
+    int ret;
+
+    spin_lock(&ctx->lock);
+    list_for_each_entry(shm, &ctx->shm_list, list)
+    {
+        if ( shm->handle == handle )
+            goto found_it;
+    }
+    shm = NULL;
+    ret = FFA_RET_INVALID_PARAMETERS;
+    goto out;
+found_it:
+
+    uint64_to_regpair(&handle_hi, &handle_lo, handle);
+    ret = ffa_mem_reclaim(handle_lo, handle_hi, flags);
+    if ( ret )
+    {
+        shm = NULL;
+        goto out;
+    }
+
+    list_del(&shm->list);
+
+out:
+    free_ffa_shm_mem(ctx, shm);
+    spin_unlock(&ctx->lock);
+
+    return ret;
+}
+
 static bool ffa_handle_call(struct cpu_user_regs *regs)
 {
     uint32_t fid = get_user_reg(regs, 0);
@@ -1339,6 +1382,15 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     case FFA_MEM_SHARE_64:
         handle_mem_share(regs);
         return true;
+    case FFA_MEM_RECLAIM:
+        e = handle_mem_reclaim(regpair_to_uint64(get_user_reg(regs, 2),
+                                                 get_user_reg(regs, 1)),
+                               get_user_reg(regs, 3));
+        if ( e )
+            set_regs_error(regs, e);
+        else
+            set_regs_success(regs, 0, 0);
+        return true;
 
     default:
         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
@@ -1573,6 +1625,7 @@ static bool ffa_probe(void)
          !check_mandatory_feature(FFA_MEM_SHARE_64) ||
          !check_mandatory_feature(FFA_RXTX_UNMAP) ||
          !check_mandatory_feature(FFA_MEM_SHARE_32) ||
+         !check_mandatory_feature(FFA_MEM_RECLAIM) ||
          !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
         return false;
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:35:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:35:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558898.873500 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyvG-0002J0-Pv; Wed, 05 Jul 2023 09:35:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558898.873500; Wed, 05 Jul 2023 09:35:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyvG-0002GF-Cc; Wed, 05 Jul 2023 09:35:42 +0000
Received: by outflank-mailman (input) for mailman id 558898;
 Wed, 05 Jul 2023 09:35:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyvE-0006bq-KV
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:40 +0000
Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com
 [2a00:1450:4864:20::133])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4dc097f4-1b17-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 11:35:39 +0200 (CEST)
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-4fb73ba3b5dso10463065e87.1
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:39 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4dc097f4-1b17-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549739; x=1691141739;
        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=aYbk+SQ1clAFmK5go+uqkAk7DJv+x5ZhyiBn1d+JtnA=;
        b=RYuKrG+nyp98x2XlR4g1pqGU6cthc/eD2x5DpsJORp1UZ4nEIW8PHICrRlP2vFM4nX
         t6tVw4TQseuueu2mcA/Ngy0bkB6nPJY1sHXrAKxNGrX6w5A3y3Adigd1rWlESmb1OTGr
         DhBa8eBoSJKIW7Q0WVBCrHFLrqXUVZG/bt8t3X1rxdGn9jswUa+B9O7LcAPQAo0VO797
         6C1nb+sMFIzkHTyzv78LqyNkRhzUB7ap8UHSBwchTLQUKyZCUx2i7jN7zInJlHUk8TaP
         6o0Jian0GRFem6itEKUG9cRtW2JYMVSV/GLBbFfPdlplxdERyZq6w7Tmb/dXdZmtHlOA
         B3PQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549739; x=1691141739;
        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=aYbk+SQ1clAFmK5go+uqkAk7DJv+x5ZhyiBn1d+JtnA=;
        b=crE1OOkPxeuUHUOoxoIFJ3C68/NRLzQFN7RVwi34cRZ/utc3RC2s2aJAzJe5Ek/age
         VhsvlKo4PuDCPViUMKmEhLBR8dlWm2AOsQdHCu/9n32aDPn5eTQyfCGhpxDAS15bETbG
         PKa+nodOXRi1qGat12hl6mrCj0JuTrosp1NvI1jZiA1juRiMcAd9aULil2PmWTdEMAVr
         U0r03IurlNUHDQuYkJEd+w6c9Ebbtf6OBnTKwedBGBhpKAGVZESz+EcrkR2pUTTOpzNf
         ICSi+msYSaV8q5FyrRllXH25Bwc+5J9OcCnYSalrf4gUc/Wvyk6y40fmxNDhj5S/bzk3
         fFFg==
X-Gm-Message-State: ABy/qLbrkr2gLNJHnllNJo9TiHAmUOr9nztiRU+UYlJCKHgnXPKTdvZE
	nlZK/MPchiRvoDtASYccnrI9JCY9paC2f6nzeNA=
X-Google-Smtp-Source: APBJJlFEsmI9XieucKFevLoCAa5Lqvq6pcooF4RgPlcFUBGQuDcdyXtmjQu7OcvFUzrfWZsUidy+BQ==
X-Received: by 2002:a2e:3611:0:b0:2b6:fa8d:ff91 with SMTP id d17-20020a2e3611000000b002b6fa8dff91mr2738414lja.3.1688549739097;
        Wed, 05 Jul 2023 02:35:39 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v9 20/24] xen/arm: ffa: support sharing large memory ranges
Date: Wed,  5 Jul 2023 11:34:29 +0200
Message-Id: <20230705093433.2514898-21-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support for sharing large memory ranges transmitted in fragments
using FFA_MEM_FRAG_TX.

The implementation is the bare minimum to be able to communicate with
OP-TEE running as an SPMC at S-EL1.

Adds a check that the SP supports the needed FF-A feature
FFA_MEM_FRAG_TX.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c | 253 ++++++++++++++++++++++++++++++++++++++---
 1 file changed, 240 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index c623c51168b9..ac23b9edc74c 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -359,6 +359,8 @@ struct ffa_ctx {
      */
     uint16_t create_signal_count;
     bool rx_is_free;
+    /* Currently used fragment states, struct mem_frag_state */
+    struct list_head frag_list;
     /* Used shared memory objects, struct ffa_shm_mem */
     struct list_head shm_list;
     /* Number of allocated shared memory object */
@@ -375,6 +377,18 @@ struct ffa_shm_mem {
     struct page_info *pages[];
 };
 
+struct mem_frag_state {
+    struct list_head list;
+    struct ffa_shm_mem *shm;
+    uint32_t range_count;
+    unsigned int current_page_idx;
+    unsigned int frag_offset;
+    unsigned int range_offset;
+    const uint8_t *buf;
+    unsigned int buf_size;
+    struct ffa_address_range range;
+};
+
 /* Negotiated FF-A version to use with the SPMC */
 static uint32_t __ro_after_init ffa_version;
 
@@ -538,6 +552,36 @@ static int32_t ffa_mem_share(uint32_t tot_len, uint32_t frag_len,
     }
 }
 
+static int32_t ffa_mem_frag_tx(uint64_t handle, uint32_t frag_len,
+                               uint16_t sender_id)
+{
+    struct arm_smccc_1_2_regs arg = {
+        .a0 = FFA_MEM_FRAG_TX,
+        .a1 = handle & UINT32_MAX,
+        .a2 = handle >> 32,
+        .a3 = frag_len,
+        .a4 = (uint32_t)sender_id << 16,
+    };
+    struct arm_smccc_1_2_regs resp;
+
+    arm_smccc_1_2_smc(&arg, &resp);
+
+    switch ( resp.a0 )
+    {
+    case FFA_ERROR:
+        if ( resp.a2 )
+            return resp.a2;
+        else
+            return FFA_RET_NOT_SUPPORTED;
+    case FFA_SUCCESS_32:
+        return FFA_RET_OK;
+    case FFA_MEM_FRAG_RX:
+        return resp.a3;
+    default:
+            return FFA_RET_NOT_SUPPORTED;
+    }
+}
+
 static int32_t ffa_mem_reclaim(uint32_t handle_lo, uint32_t handle_hi,
                                uint32_t flags)
 {
@@ -627,6 +671,14 @@ static void set_regs_success(struct cpu_user_regs *regs, uint32_t w2,
     set_regs(regs, FFA_SUCCESS_32, 0, w2, w3, 0, 0, 0, 0);
 }
 
+static void set_regs_frag_rx(struct cpu_user_regs *regs, uint32_t handle_lo,
+                             uint32_t handle_hi, uint32_t frag_offset,
+                             uint16_t sender_id)
+{
+    set_regs(regs, FFA_MEM_FRAG_RX, handle_lo, handle_hi, frag_offset,
+             (uint32_t)sender_id << 16, 0, 0, 0);
+}
+
 static void handle_version(struct cpu_user_regs *regs)
 {
     struct domain *d = current->domain;
@@ -999,6 +1051,8 @@ static int share_shm(struct ffa_shm_mem *shm)
     paddr_t last_pa;
     unsigned int n;
     paddr_t pa;
+    bool first;
+    int ret;
 
     ASSERT(spin_is_locked(&ffa_tx_buffer_lock));
     ASSERT(shm->page_count);
@@ -1034,13 +1088,23 @@ static int share_shm(struct ffa_shm_mem *shm)
 
     tot_len = ADDR_RANGE_OFFSET(descr->mem_access_count, region_count,
                                 region_descr->address_range_count);
-    if ( tot_len > max_frag_len )
-        return FFA_RET_NOT_SUPPORTED;
 
+    /*
+     * Sharing memory with secure world may have to be done with multiple
+     * calls depending on how many address ranges will be needed. If we're
+     * sharing physically contiguous memory we will only need one range but
+     * we will also need to deal with the worst case where all physical
+     * pages are non-contiguous. For the first batch of address ranges we
+     * call ffa_mem_share() and for all that follows ffa_mem_frag_tx().
+     *
+     * We use frag_len to keep track of how far into the transmit buffer we
+     * have gone.
+     */
     addr_range = region_descr->address_range_array;
     frag_len = ADDR_RANGE_OFFSET(descr->mem_access_count, region_count, 1);
     last_pa = page_to_maddr(shm->pages[0]);
     init_range(addr_range, last_pa);
+    first = true;
     for ( n = 1; n < shm->page_count; last_pa = pa, n++ )
     {
         pa = page_to_maddr(shm->pages[n]);
@@ -1050,12 +1114,34 @@ static int share_shm(struct ffa_shm_mem *shm)
             continue;
         }
 
-        frag_len += sizeof(*addr_range);
-        addr_range++;
+        if ( frag_len == max_frag_len )
+        {
+            if ( first )
+            {
+                ret = ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
+                first = false;
+            }
+            else
+            {
+                ret = ffa_mem_frag_tx(shm->handle, frag_len, shm->sender_id);
+            }
+            if ( ret <= 0 )
+                return ret;
+            frag_len = sizeof(*addr_range);
+            addr_range = buf;
+        }
+        else
+        {
+            frag_len += sizeof(*addr_range);
+            addr_range++;
+        }
         init_range(addr_range, pa);
     }
 
-    return ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
+    if ( first )
+        return ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
+    else
+        return ffa_mem_frag_tx(shm->handle, frag_len, shm->sender_id);
 }
 
 static int read_mem_transaction(uint32_t ffa_vers, const void *buf, size_t blen,
@@ -1132,8 +1218,53 @@ static int read_mem_transaction(uint32_t ffa_vers, const void *buf, size_t blen,
     return 0;
 }
 
+static int add_mem_share_frag(struct mem_frag_state *s, unsigned int offs,
+                              unsigned int frag_len)
+{
+    struct domain *d = current->domain;
+    unsigned int o = offs;
+    unsigned int l;
+    int ret;
+
+    if ( frag_len < o )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    /* Fill up the first struct ffa_address_range */
+    l = min_t(unsigned int, frag_len - o, sizeof(s->range) - s->range_offset);
+    memcpy((uint8_t *)&s->range + s->range_offset, s->buf + o, l);
+    s->range_offset += l;
+    o += l;
+    if ( s->range_offset != sizeof(s->range) )
+        goto out;
+    s->range_offset = 0;
+
+    while ( true )
+    {
+        ret = get_shm_pages(d, s->shm, &s->range, 1, s->current_page_idx,
+                            &s->current_page_idx);
+        if ( ret )
+            return ret;
+        if ( s->range_count == 1 )
+            return 0;
+        s->range_count--;
+        if ( frag_len - o < sizeof(s->range) )
+            break;
+        memcpy(&s->range, s->buf + o, sizeof(s->range));
+        o += sizeof(s->range);
+    }
+
+    /* Collect any remaining bytes for the next struct ffa_address_range */
+    s->range_offset = frag_len - o;
+    memcpy(&s->range, s->buf + o, frag_len - o);
+out:
+    s->frag_offset += frag_len;
+
+    return s->frag_offset;
+}
+
 static void handle_mem_share(struct cpu_user_regs *regs)
 {
+    static uint64_t next_handle = FFA_HANDLE_HYP_FLAG;
     uint32_t tot_len = get_user_reg(regs, 1);
     uint32_t frag_len = get_user_reg(regs, 2);
     uint64_t addr = get_user_reg(regs, 3);
@@ -1168,13 +1299,6 @@ static void handle_mem_share(struct cpu_user_regs *regs)
         goto out_set_ret;
     }
 
-    /* We currently only support a single fragment */
-    if ( frag_len != tot_len )
-    {
-        ret = FFA_RET_NOT_SUPPORTED;
-        goto out_set_ret;
-    }
-
     spin_lock(&ctx->lock);
 
     if ( frag_len > ctx->page_count * FFA_PAGE_SIZE )
@@ -1240,6 +1364,36 @@ static void handle_mem_share(struct cpu_user_regs *regs)
     shm->sender_id = trans.sender_id;
     shm->ep_id = read_atomic(&mem_access->access_perm.endpoint_id);
 
+    if ( frag_len != tot_len )
+    {
+        struct mem_frag_state *s = xzalloc(struct mem_frag_state);
+
+        if ( !s )
+        {
+            ret = FFA_RET_NO_MEMORY;
+            goto out;
+        }
+        s->shm = shm;
+        s->range_count = range_count;
+        s->buf = ctx->tx;
+        s->buf_size = FFA_RXTX_PAGE_COUNT * FFA_PAGE_SIZE;
+        ret = add_mem_share_frag(s, sizeof(*region_descr)  + region_offs,
+                                 frag_len);
+        if ( ret <= 0 )
+        {
+            xfree(s);
+            if ( ret < 0 )
+                goto out;
+        }
+        else
+        {
+            shm->handle = next_handle++;
+            uint64_to_regpair(&handle_hi, &handle_lo, shm->handle);
+            list_add_tail(&s->list, &ctx->frag_list);
+        }
+        goto out_unlock;
+    }
+
     /*
      * Check that the Composite memory region descriptor fits.
      */
@@ -1278,7 +1432,75 @@ out_unlock:
     spin_unlock(&ctx->lock);
 
 out_set_ret:
-    if ( ret == 0)
+    if ( ret > 0 )
+            set_regs_frag_rx(regs, handle_lo, handle_hi, ret, trans.sender_id);
+    else if ( ret == 0)
+            set_regs_success(regs, handle_lo, handle_hi);
+    else
+            set_regs_error(regs, ret);
+}
+
+static struct mem_frag_state *find_frag_state(struct ffa_ctx *ctx,
+                                              uint64_t handle)
+{
+    struct mem_frag_state *s;
+
+    list_for_each_entry(s, &ctx->frag_list, list)
+        if ( s->shm->handle == handle )
+            return s;
+
+    return NULL;
+}
+
+static void handle_mem_frag_tx(struct cpu_user_regs *regs)
+{
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+    uint32_t frag_len = get_user_reg(regs, 3);
+    uint32_t handle_lo = get_user_reg(regs, 1);
+    uint32_t handle_hi = get_user_reg(regs, 2);
+    uint64_t handle = regpair_to_uint64(handle_hi, handle_lo);
+    struct mem_frag_state *s;
+    uint16_t sender_id = 0;
+    int ret;
+
+    spin_lock(&ctx->lock);
+    s = find_frag_state(ctx, handle);
+    if ( !s )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out;
+    }
+    sender_id = s->shm->sender_id;
+
+    if ( frag_len > s->buf_size )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out_free_s;
+    }
+
+    ret = add_mem_share_frag(s, 0, frag_len);
+    if ( ret < 0 )
+        goto out_free_s;
+
+    /* Note that share_shm() uses our tx buffer */
+    spin_lock(&ffa_tx_buffer_lock);
+    ret = share_shm(s->shm);
+    spin_unlock(&ffa_tx_buffer_lock);
+    if ( ret < 0 )
+        goto out_free_s;
+    list_add_tail(&s->shm->list, &ctx->shm_list);
+out_free_s:
+    if ( ret < 0 )
+        free_ffa_shm_mem(ctx, s->shm);
+    list_del(&s->list);
+    xfree(s);
+out:
+    spin_unlock(&ctx->lock);
+
+    if ( ret > 0 )
+            set_regs_frag_rx(regs, handle_lo, handle_hi, ret, sender_id);
+    else if ( ret == 0)
             set_regs_success(regs, handle_lo, handle_hi);
     else
             set_regs_error(regs, ret);
@@ -1391,6 +1613,9 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
         else
             set_regs_success(regs, 0, 0);
         return true;
+    case FFA_MEM_FRAG_TX:
+        handle_mem_frag_tx(regs);
+        return true;
 
     default:
         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
@@ -1432,6 +1657,7 @@ static int ffa_domain_init(struct domain *d)
     }
     ctx->create_signal_count = n;
 
+    INIT_LIST_HEAD(&ctx->frag_list);
     INIT_LIST_HEAD(&ctx->shm_list);
 
     return 0;
@@ -1625,6 +1851,7 @@ static bool ffa_probe(void)
          !check_mandatory_feature(FFA_MEM_SHARE_64) ||
          !check_mandatory_feature(FFA_RXTX_UNMAP) ||
          !check_mandatory_feature(FFA_MEM_SHARE_32) ||
+         !check_mandatory_feature(FFA_MEM_FRAG_TX) ||
          !check_mandatory_feature(FFA_MEM_RECLAIM) ||
          !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
         return false;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:35:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:35:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558899.873506 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyvH-0002TW-SW; Wed, 05 Jul 2023 09:35:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558899.873506; Wed, 05 Jul 2023 09:35:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyvH-0002Qc-3c; Wed, 05 Jul 2023 09:35:43 +0000
Received: by outflank-mailman (input) for mailman id 558899;
 Wed, 05 Jul 2023 09:35:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyvF-0006bq-J3
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:41 +0000
Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com
 [2a00:1450:4864:20::22b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4e5c5d9d-1b17-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 11:35:40 +0200 (CEST)
Received: by mail-lj1-x22b.google.com with SMTP id
 38308e7fff4ca-2b6994a8ce3so96190141fa.1
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:40 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4e5c5d9d-1b17-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549740; x=1691141740;
        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=ZoIi1uajGrKh0qyhlJNpu9qRdkH7y35FjQEkn4RminE=;
        b=uk1lwxt6nIGp645jtDaH3HmxmOBSm6likMtc1qTznUd3+eCEWs2IiLXL8AaANOMH1q
         sQDspJWiZkwKf5xXk0+oaVksGgF6SVkEKO5pLByJYBXV/IAACw9xwqs9ZE8zEknUYjeO
         gEedd+1pxj41Nx3AkKffU7xE9TCp9zypoqZmqlINOWUCSyLDPh0cFG3UxNTOQugFzweW
         ikBv3QL0XGjgU76FNiBHaN9v4RJyohlmQgQ0LlfXeGir8Wqir2zNHE9kuJJPumM9TC9c
         u2Cqpq7O4kr3xSGPDHSE/LagDto8+EmLcT1No2OiyNZyG+cWQE02fMxblBVQYDvOoS1M
         Z8zw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549740; x=1691141740;
        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=ZoIi1uajGrKh0qyhlJNpu9qRdkH7y35FjQEkn4RminE=;
        b=C+yJIWjTWkLuoy68AppDP945uRDrMYWYsd7RCbMTW2U+GeJ52PnKQzME9CowA+xLQa
         vdO7Qir2VRdBzJ79XSy0v9FZTF2Ci3mQGrqSeslr8CJO1wPlLZvDb5ABJTeOScdJJzCq
         kUlgKsNnyCLCinE2fU114FPg4x6qmuevMZ6zyCUyOuRDrIyMZRSbg518ZJ0KGCBW50M0
         APXO884EeMlnULfZ2Pxj87iY4T1AgQ6+jU8QQdUBzkcKpob46TegJgw/TPGu343sO0v+
         TK3hrA2loNhDnYD2/qubY0INMvEgOjx2BT9qnJPjW4qDT/524xPSNZ+bnSHOA0odCQy2
         AVsg==
X-Gm-Message-State: ABy/qLb5ByFebXdp7kfsoxEwXdeLLCFwj5JA4XpqjDX/ACZm8n5yt1ht
	w3JLNZYsM2bIKauN7pAY49brYpBF2LhCzhqtZDo=
X-Google-Smtp-Source: APBJJlFV3xIQWTSoKCG2Vg3YpY+nX20MmYIbkU/GnXObWSaerREItuD3NzagU7HoZXkbPi6yhntIQw==
X-Received: by 2002:a2e:9b92:0:b0:2b1:d588:a1a5 with SMTP id z18-20020a2e9b92000000b002b1d588a1a5mr10752483lji.52.1688549740175;
        Wed, 05 Jul 2023 02:35:40 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v9 21/24] xen/arm: ffa: improve lock granularity
Date: Wed,  5 Jul 2023 11:34:30 +0200
Message-Id: <20230705093433.2514898-22-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The single lock in struct ffa_ctx is complemented with rx_lock and tx_lock.

The old lock is used for small critical sections, like increasing
shm_count or adding another shm to shm_list.

rx_lock and tx_lock are only acquired using spin_trylock() which for
well-behaving guests should always succeed. Guests using the RX and TX
buffers are expected to serialize accesses before doing the FF-A
request.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c | 121 ++++++++++++++++++++++++++++++-----------
 1 file changed, 89 insertions(+), 32 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index ac23b9edc74c..59832f73c2be 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -365,6 +365,13 @@ struct ffa_ctx {
     struct list_head shm_list;
     /* Number of allocated shared memory object */
     unsigned int shm_count;
+    /*
+     * tx_lock is used to serialize access to tx
+     * rx_lock is used to serialize access to rx
+     * lock is used for the rest in this struct
+     */
+    spinlock_t tx_lock;
+    spinlock_t rx_lock;
     spinlock_t lock;
 };
 
@@ -815,7 +822,9 @@ static int32_t handle_partition_info_get(uint32_t w1, uint32_t w2, uint32_t w3,
     if ( !ffa_rx )
         return FFA_RET_DENIED;
 
-    spin_lock(&ctx->lock);
+    if ( !spin_trylock(&ctx->rx_lock) )
+        return FFA_RET_BUSY;
+
     if ( !ctx->page_count || !ctx->rx_is_free )
         goto out;
     spin_lock(&ffa_rx_buffer_lock);
@@ -866,7 +875,7 @@ out_rx_release:
 out_rx_buf_unlock:
     spin_unlock(&ffa_rx_buffer_lock);
 out:
-    spin_unlock(&ctx->lock);
+    spin_unlock(&ctx->rx_lock);
 
     return ret;
 }
@@ -877,13 +886,15 @@ static int32_t handle_rx_release(void)
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
 
-    spin_lock(&ctx->lock);
+    if ( !spin_trylock(&ctx->rx_lock) )
+        return FFA_RET_BUSY;
+
     if ( !ctx->page_count || ctx->rx_is_free )
         goto out;
     ret = FFA_RET_OK;
     ctx->rx_is_free = true;
 out:
-    spin_unlock(&ctx->lock);
+    spin_unlock(&ctx->rx_lock);
 
     return ret;
 }
@@ -994,21 +1005,43 @@ static void put_shm_pages(struct ffa_shm_mem *shm)
     }
 }
 
+static bool inc_ctx_shm_count(struct ffa_ctx *ctx)
+{
+    bool ret = true;
+
+    spin_lock(&ctx->lock);
+    if (ctx->shm_count >= FFA_MAX_SHM_COUNT)
+        ret = false;
+    else
+        ctx->shm_count++;
+    spin_unlock(&ctx->lock);
+
+    return ret;
+}
+
+static void dec_ctx_shm_count(struct ffa_ctx *ctx)
+{
+    spin_lock(&ctx->lock);
+    ASSERT(ctx->shm_count > 0);
+    ctx->shm_count--;
+    spin_unlock(&ctx->lock);
+}
+
 static struct ffa_shm_mem *alloc_ffa_shm_mem(struct ffa_ctx *ctx,
                                              unsigned int page_count)
 {
     struct ffa_shm_mem *shm;
 
-    if ( page_count >= FFA_MAX_SHM_PAGE_COUNT ||
-         ctx->shm_count >= FFA_MAX_SHM_COUNT )
+    if ( page_count >= FFA_MAX_SHM_PAGE_COUNT )
+        return NULL;
+    if ( !inc_ctx_shm_count(ctx) )
         return NULL;
 
     shm = xzalloc_flex_struct(struct ffa_shm_mem, pages, page_count);
     if ( shm )
-    {
-        ctx->shm_count++;
         shm->page_count = page_count;
-    }
+    else
+        dec_ctx_shm_count(ctx);
 
     return shm;
 }
@@ -1018,8 +1051,7 @@ static void free_ffa_shm_mem(struct ffa_ctx *ctx, struct ffa_shm_mem *shm)
     if ( !shm )
         return;
 
-    ASSERT(ctx->shm_count > 0);
-    ctx->shm_count--;
+    dec_ctx_shm_count(ctx);
     put_shm_pages(shm);
     xfree(shm);
 }
@@ -1299,7 +1331,11 @@ static void handle_mem_share(struct cpu_user_regs *regs)
         goto out_set_ret;
     }
 
-    spin_lock(&ctx->lock);
+    if ( !spin_trylock(&ctx->tx_lock) )
+    {
+        ret = FFA_RET_BUSY;
+        goto out_set_ret;
+    }
 
     if ( frag_len > ctx->page_count * FFA_PAGE_SIZE )
         goto out_unlock;
@@ -1421,7 +1457,9 @@ static void handle_mem_share(struct cpu_user_regs *regs)
     if ( ret )
         goto out;
 
+    spin_lock(&ctx->lock);
     list_add_tail(&shm->list, &ctx->shm_list);
+    spin_unlock(&ctx->lock);
 
     uint64_to_regpair(&handle_hi, &handle_lo, shm->handle);
 
@@ -1429,7 +1467,7 @@ out:
     if ( ret )
         free_ffa_shm_mem(ctx, shm);
 out_unlock:
-    spin_unlock(&ctx->lock);
+    spin_unlock(&ctx->tx_lock);
 
 out_set_ret:
     if ( ret > 0 )
@@ -1464,7 +1502,12 @@ static void handle_mem_frag_tx(struct cpu_user_regs *regs)
     uint16_t sender_id = 0;
     int ret;
 
-    spin_lock(&ctx->lock);
+    if ( !spin_trylock(&ctx->tx_lock) )
+    {
+        ret = FFA_RET_BUSY;
+        goto out_set_ret;
+    }
+
     s = find_frag_state(ctx, handle);
     if ( !s )
     {
@@ -1489,15 +1532,20 @@ static void handle_mem_frag_tx(struct cpu_user_regs *regs)
     spin_unlock(&ffa_tx_buffer_lock);
     if ( ret < 0 )
         goto out_free_s;
+
+    spin_lock(&ctx->lock);
     list_add_tail(&s->shm->list, &ctx->shm_list);
+    spin_unlock(&ctx->lock);
+
 out_free_s:
     if ( ret < 0 )
         free_ffa_shm_mem(ctx, s->shm);
     list_del(&s->list);
     xfree(s);
 out:
-    spin_unlock(&ctx->lock);
+    spin_unlock(&ctx->tx_lock);
 
+out_set_ret:
     if ( ret > 0 )
             set_regs_frag_rx(regs, handle_lo, handle_hi, ret, sender_id);
     else if ( ret == 0)
@@ -1506,6 +1554,18 @@ out:
             set_regs_error(regs, ret);
 }
 
+/* Must only be called with ctx->lock held */
+static struct ffa_shm_mem *find_shm_mem(struct ffa_ctx *ctx, uint64_t handle)
+{
+    struct ffa_shm_mem *shm;
+
+    list_for_each_entry(shm, &ctx->shm_list, list)
+        if ( shm->handle == handle )
+            return shm;
+
+    return NULL;
+}
+
 static int handle_mem_reclaim(uint64_t handle, uint32_t flags)
 {
     struct domain *d = current->domain;
@@ -1516,29 +1576,26 @@ static int handle_mem_reclaim(uint64_t handle, uint32_t flags)
     int ret;
 
     spin_lock(&ctx->lock);
-    list_for_each_entry(shm, &ctx->shm_list, list)
-    {
-        if ( shm->handle == handle )
-            goto found_it;
-    }
-    shm = NULL;
-    ret = FFA_RET_INVALID_PARAMETERS;
-    goto out;
-found_it:
+    shm = find_shm_mem(ctx, handle);
+    if ( shm )
+        list_del(&shm->list);
+    spin_unlock(&ctx->lock);
+    if ( !shm )
+        return FFA_RET_INVALID_PARAMETERS;
 
     uint64_to_regpair(&handle_hi, &handle_lo, handle);
     ret = ffa_mem_reclaim(handle_lo, handle_hi, flags);
+
     if ( ret )
     {
-        shm = NULL;
-        goto out;
+        spin_lock(&ctx->lock);
+        list_add_tail(&shm->list, &ctx->shm_list);
+        spin_unlock(&ctx->lock);
+    }
+    else
+    {
+        free_ffa_shm_mem(ctx, shm);
     }
-
-    list_del(&shm->list);
-
-out:
-    free_ffa_shm_mem(ctx, shm);
-    spin_unlock(&ctx->lock);
 
     return ret;
 }
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:35:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:35:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558901.873518 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyvK-0003Pb-G3; Wed, 05 Jul 2023 09:35:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558901.873518; Wed, 05 Jul 2023 09:35:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyvK-0003Nu-5R; Wed, 05 Jul 2023 09:35:46 +0000
Received: by outflank-mailman (input) for mailman id 558901;
 Wed, 05 Jul 2023 09:35:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyvH-0006bq-Jy
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:43 +0000
Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com
 [2a00:1450:4864:20::22a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4fbbcc8e-1b17-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 11:35:43 +0200 (CEST)
Received: by mail-lj1-x22a.google.com with SMTP id
 38308e7fff4ca-2b6afc1ceffso106242191fa.0
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:43 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4fbbcc8e-1b17-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549742; x=1691141742;
        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=7qJzaSd0HvmBntjUGVzcYap0wvkw2yCzYdORcW1H2Eg=;
        b=ipq/A2Hi2yQUmOcd+UZDrLei6lggYX4sIgnIVHJKc77vrX5poi1Yzzassr7SKrPsnm
         OyhOSngsjtiuR81fAvKtsl1tVmmxfFVuGBBRFSbys7HttK9RFwmoncVPBCK8JHR1vZmU
         SojLhvTT7T2PVQ4kUGa8QlVqc4guEqO3hIjyMVKKnLftmS0f1zn931MCTMzcCepRBDHA
         mwr9GCscYEZA1iumyDG2vffm1NeyA4SMcOZ6QiSLwwC+w2acvCt7D1m0V5mQsqMqyQjf
         Y/4h5UQ8Am8erHTFAt2LXWK2+VFTyoC5a9OjipK3wd/EMG3p5YtCc3zkitATsYMuhJei
         Mr9g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549742; x=1691141742;
        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=7qJzaSd0HvmBntjUGVzcYap0wvkw2yCzYdORcW1H2Eg=;
        b=aOEmrC6xX6kFEP9iO21Yv8iDGLrRG0DAgpcfdb/e8U07LdAKjP+zk0XB/dA2XZio3K
         G+VibI0jQvUFCvpoULLObfAUFKKQh7ZN2gFeG8bP1FSmU+UerqIop7WqzHqOuPmeVG8e
         V1sHwGUwKmXaXO+UctXFrGyOsrYv5MVJ7k/V6VuUvpGYX1crwvGPBzuhkQH9tN+OiCet
         iIDKrcn0f3RrKWfbBvmxM96Ha91d9R5jtUuphiH+e3qNBWedpNP0ARJwb6WywJYFohnr
         8hKQmAQ9O/Ls+x+dZQY670EqmkRm23Crcga8NSIdoNAKmAeM9GefE3MCE1GuM2bXcR9o
         jejQ==
X-Gm-Message-State: ABy/qLaz5n0d9Kt/CEaVSs6SKBWUlR5cEGf80NDPuGbwIfmgL6sDrBOV
	zh/oUtfDmwjSi6I8W/zxzZcJ49mz+g0Ey3KtL1E=
X-Google-Smtp-Source: APBJJlHUJBWSzdcUQruJ6Mrl2LWhLifbL4Yl9LecwWQlfhdSBsxllBSZTar7jy7JAcWGb/JRz/hnQA==
X-Received: by 2002:a2e:3515:0:b0:2b6:d89e:74e2 with SMTP id z21-20020a2e3515000000b002b6d89e74e2mr8243482ljz.7.1688549742487;
        Wed, 05 Jul 2023 02:35:42 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v9 23/24] tools: add Arm FF-A mediator
Date: Wed,  5 Jul 2023 11:34:32 +0200
Message-Id: <20230705093433.2514898-24-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds a new "ffa" value to the Enumeration "tee_type" to indicate if a
guest is trusted to use FF-A.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 tools/include/libxl.h            | 5 +++++
 tools/libs/light/libxl_arm.c     | 3 +++
 tools/libs/light/libxl_types.idl | 3 ++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/tools/include/libxl.h b/tools/include/libxl.h
index cac641a7eba2..bf1a49e5d687 100644
--- a/tools/include/libxl.h
+++ b/tools/include/libxl.h
@@ -283,6 +283,11 @@
  */
 #define LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE 1
 
+/*
+ * arch_arm.tee field in libxl_domain_build_info has ffa value.
+ */
+#define LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE_FFA 1
+
 /*
  * libxl_domain_build_info has the arch_arm.sve_vl field.
  */
diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
index 35f76dfc21e4..e155c68989aa 100644
--- a/tools/libs/light/libxl_arm.c
+++ b/tools/libs/light/libxl_arm.c
@@ -207,6 +207,9 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
     case LIBXL_TEE_TYPE_OPTEE:
         config->arch.tee_type = XEN_DOMCTL_CONFIG_TEE_OPTEE;
         break;
+    case LIBXL_TEE_TYPE_FFA:
+        config->arch.tee_type = XEN_DOMCTL_CONFIG_TEE_FFA;
+        break;
     default:
         LOG(ERROR, "Unknown TEE type %d",
             d_config->b_info.tee);
diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
index 9e48bb772646..65600e17429e 100644
--- a/tools/libs/light/libxl_types.idl
+++ b/tools/libs/light/libxl_types.idl
@@ -520,7 +520,8 @@ libxl_gic_version = Enumeration("gic_version", [
 
 libxl_tee_type = Enumeration("tee_type", [
     (0, "none"),
-    (1, "optee")
+    (1, "optee"),
+    (2, "ffa"),
     ], init_val = "LIBXL_TEE_TYPE_NONE")
 
 libxl_sve_type = Enumeration("sve_type", [
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:39:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:39:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558932.873539 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyyt-0007QY-6D; Wed, 05 Jul 2023 09:39:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558932.873539; Wed, 05 Jul 2023 09:39:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyyt-0007Og-2F; Wed, 05 Jul 2023 09:39:27 +0000
Received: by outflank-mailman (input) for mailman id 558932;
 Wed, 05 Jul 2023 09:39:25 +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
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyvA-0005bC-HF
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:36 +0000
Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com
 [2a00:1450:4864:20::229])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4a477626-1b17-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:35:34 +0200 (CEST)
Received: by mail-lj1-x229.google.com with SMTP id
 38308e7fff4ca-2b6fdaf6eefso9840481fa.0
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:34 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.32
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:32 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4a477626-1b17-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549733; x=1691141733;
        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=YcMbvZQAuDfLbcHqMVEHcqz7Bisfyi8R+YRN0ovSOHM=;
        b=pp3m2feVOW0WTQUVdSOeb6fmKUFShrOpu81W4NVgjIS8b5Ty8XCeqWmEjiaq53i0sA
         AY0mAbR41D74t9Rd/4OnXm7ATqCUoOSDaEWRTbdq7ccaK3U7b6af9RK1dK9zV8VX33Dx
         +t7fihSUtPcUreGuXAaupJsZN7uIPnAnDonGWuv878TxHvyzG7wzagtxIpy8CZiu8JMA
         MiuarmJSNxm3wxsgM24VMoBYd5vMT+9GKQzle2tHx3bNWilRu6HVOo6MtJ58V+i+Bufa
         ++SerX5pwn5aPN3lYev8HKp8u6OToA6AFU/+xA2cOjklelZgWiwMfTSWi6vBcn03LiBd
         ShFA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549733; x=1691141733;
        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=YcMbvZQAuDfLbcHqMVEHcqz7Bisfyi8R+YRN0ovSOHM=;
        b=SkHWtVrfo6ejfm+VkEMNxovF+hUVX9sO5sOflftcKcJYexO6rX/GF2mx2e40eG8bO6
         A6d/TWcLn8uO4uUBE88kCeau0RV7ZvL+XYJBUDTBq77BnvKHN2bZOTZfi0UwzY5GKjgd
         45h/p1ngFyh6RXDolS7bJRkCEBN0vdrCsGgVbnchR8oO0Ns7DernqEwW+uzTwbgwQeRj
         I96AReEAdyM90IIf1iIPmcXz3qEZlQI5pfMMz+U77TfnjA1uKL0KrtjHXMYXGwwbCdIc
         RiGfU0BGTqTfxrXptIKbULYC+kLasdzBwPB0v8tSye6rKPeBtBtLk3fiCivJZeWzdt6T
         xd6Q==
X-Gm-Message-State: ABy/qLZDGkx68ZrQjPdfv6ghRSy+TTLYb5ePp4jquZhDAjo6U90Y1hvf
	5YQfV8YlE/CwyGESHhdmTbIhq2Enpf5Y5prSD1Y=
X-Google-Smtp-Source: APBJJlE0gVfOljS8MpbdcMy7JQIw9Ok0b7WsJC3Oc+ZkT6BTFzwoZPfyp/XWTUXKtDzygRVPkRvuiw==
X-Received: by 2002:a2e:3815:0:b0:2b6:a804:4cc with SMTP id f21-20020a2e3815000000b002b6a80404ccmr10458145lja.53.1688549733391;
        Wed, 05 Jul 2023 02:35:33 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v9 15/24] xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h
Date: Wed,  5 Jul 2023 11:34:24 +0200
Message-Id: <20230705093433.2514898-16-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Moves the two helper functions regpair_to_uint64() and
uint64_to_regpair() from xen/arch/arm/tee/optee.c to the common arm
specific regs.h. This enables reuse of these functions in the FF-A
mediator in a subsequent patch.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 xen/arch/arm/include/asm/regs.h | 12 ++++++++++++
 xen/arch/arm/tee/optee.c        | 11 -----------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/include/asm/regs.h b/xen/arch/arm/include/asm/regs.h
index ef34b38aa171..8a0db9541507 100644
--- a/xen/arch/arm/include/asm/regs.h
+++ b/xen/arch/arm/include/asm/regs.h
@@ -60,6 +60,18 @@ static inline bool guest_mode(const struct cpu_user_regs *r)
 register_t get_user_reg(struct cpu_user_regs *regs, int reg);
 void set_user_reg(struct cpu_user_regs *regs, int reg, register_t value);
 
+static inline uint64_t regpair_to_uint64(register_t reg0, register_t reg1)
+{
+    return ((uint64_t)reg0 << 32) | (uint32_t)reg1;
+}
+
+static inline void uint64_to_regpair(register_t *reg0, register_t *reg1,
+                                     uint64_t val)
+{
+    *reg0 = val >> 32;
+    *reg1 = (uint32_t)val;
+}
+
 #endif
 
 #endif /* __ARM_REGS_H__ */
diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
index c91bd7d5ac25..5151bd90ed02 100644
--- a/xen/arch/arm/tee/optee.c
+++ b/xen/arch/arm/tee/optee.c
@@ -273,17 +273,6 @@ static int optee_domain_teardown(struct domain *d)
     return 0;
 }
 
-static uint64_t regpair_to_uint64(register_t reg0, register_t reg1)
-{
-    return ((uint64_t)reg0 << 32) | (uint32_t)reg1;
-}
-
-static void uint64_to_regpair(register_t *reg0, register_t *reg1, uint64_t val)
-{
-    *reg0 = val >> 32;
-    *reg1 = (uint32_t)val;
-}
-
 static struct page_info *get_domain_ram_page(gfn_t gfn)
 {
     struct page_info *page;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:39:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:39:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558926.873535 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyys-0007Ni-VL; Wed, 05 Jul 2023 09:39:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558926.873535; Wed, 05 Jul 2023 09:39:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyys-0007Nb-Qh; Wed, 05 Jul 2023 09:39:26 +0000
Received: by outflank-mailman (input) for mailman id 558926;
 Wed, 05 Jul 2023 09:39:25 +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
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyvI-0005bC-I6
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:44 +0000
Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com
 [2a00:1450:4864:20::236])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4f0d355d-1b17-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:35:42 +0200 (CEST)
Received: by mail-lj1-x236.google.com with SMTP id
 38308e7fff4ca-2b69dcf45faso105699081fa.0
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:42 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4f0d355d-1b17-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549741; x=1691141741;
        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=l0XHslbV1muN4VtuaM4zruuvudWXBg6/E8tWHxT1G2w=;
        b=f899ZIKOky2C3a7sro1D/PW5bsGIsjNat/XajNAkKNjim/maYyRXaufJNUm8Khzrer
         H90b+A+uxSsw4GWLkTMWL/FxYHSseZQVqgxYjBaxFpPFXnY3F0TNmwbMB6EyA9lQrtc/
         QbftdMNWM4Tg8EOyZNgKnTvMDZq5p3ssHk7W7aOTqwyGr0TNrwrEYg01Jc8vkPNWBGQ/
         spsbGgAg1NkBG1epHMEeBvR1/GEsW1eW6cb1pt5jql9/B5lZYYYwOQf/oZ9Dfl16udxR
         fQ7lL8cAbPXMWM5bsgtMMu5VmhCpbMtP6igz9C45WOxw6kuy9HoQt20YawlDmZfW9tyJ
         77TA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549741; x=1691141741;
        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=l0XHslbV1muN4VtuaM4zruuvudWXBg6/E8tWHxT1G2w=;
        b=JVkwM4o1DAs6YWzYHGLunDyqZ6uavsMbq/jSK1Wc2Cbcngmxjg7PeEjcA7IqL4Jy00
         qmmOLEA4TmsgMwDo0FMIGVqdxWozUHch5GHxpo47PgpSjMXwIaBLGkUJ2C4KEBrdzncM
         whJ6tRWaHtUq5RJiBjsykyEBQDvVTuI1pDFkjbfjd/Gkk3ZfOrggSF1dHL5C1aHoAscR
         W1BwMJiViyxkKecVEgRuVMrc0u8H5jtOw4FqaomHLwU2pOUl2y8mJCsxCL1n9IqdLf16
         dx3l/F6G0X9OnCNHJJZ+jB5cntfv0uBTv3uCDvonVMM+fsA5Xg9WHS/II+Mi5bPOL+Kq
         VeBA==
X-Gm-Message-State: ABy/qLYBJMsieuda4tS0qek+MpQlBd5CMye1Y5NynXAr2yzcA5ssTt1k
	belSFwQ9mgEebs6NZcoNRnkeffra3bBZVuGuJFg=
X-Google-Smtp-Source: APBJJlFz3GD2LUh6Zwr7QSCWB/3NRAG6M/UVX+8FWJ/vvSRXnWpckZNZca5gXfWOTtmlF8Ihw5rOuA==
X-Received: by 2002:a2e:800b:0:b0:2b6:cd40:21ad with SMTP id j11-20020a2e800b000000b002b6cd4021admr10535462ljg.37.1688549741363;
        Wed, 05 Jul 2023 02:35:41 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v9 22/24] xen/arm: ffa: list current limitations
Date: Wed,  5 Jul 2023 11:34:31 +0200
Message-Id: <20230705093433.2514898-23-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds comments with a list of unsupported FF-A interfaces and limitations
in the implemented FF-A interfaces.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 xen/arch/arm/tee/ffa.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 59832f73c2be..0fbaf7e1bb8f 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -13,6 +13,37 @@
  *                https://developer.arm.com/documentation/den0077/e
  * TEEC-1.0C: TEE Client API Specification version 1.0c available at
  *            https://globalplatform.org/specs-library/tee-client-api-specification/
+ *
+ * Notes on the the current implementation.
+ *
+ * Unsupported FF-A interfaces:
+ * o FFA_MSG_POLL and FFA_MSG_SEND - deprecated in FF-A-1.1-REL0
+ * o FFA_MEM_RETRIEVE_* - Used when sharing memory from an SP to a VM
+ * o FFA_MEM_DONATE_* and FFA_MEM_LEND_* - Used when tranferring ownership
+ *   or access of a memory region
+ * o FFA_MSG_SEND2 and FFA_MSG_WAIT - Used for indirect messaging
+ * o FFA_MSG_YIELD
+ * o FFA_INTERRUPT - Used to report preemption
+ * o FFA_RUN
+ *
+ * Limitations in the implemented FF-A interfaces:
+ * o FFA_RXTX_MAP_*:
+ *   - Maps only one 4k page as RX and TX buffers
+ *   - Doesn't support forwarding this call on behalf of an endpoint
+ * o FFA_MEM_SHARE_*: only supports sharing
+ *   - from a VM to an SP
+ *   - with one borrower
+ *   - with the memory transaction descriptor in the RX/TX buffer
+ *   - normal memory
+ *   - at most 512 kB large memory regions
+ *   - at most 32 shared memory regions per guest
+ * o FFA_MSG_SEND_DIRECT_REQ:
+ *   - only supported from a VM to an SP
+ *
+ * There are some large locked sections with ffa_tx_buffer_lock and
+ * ffa_rx_buffer_lock. Especially the ffa_tx_buffer_lock spinlock used
+ * around share_shm() is a very large locked section which can let one VM
+ * affect another VM.
  */
 
 #include <xen/bitops.h>
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:39:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:39:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558940.873555 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyyu-0007rz-GZ; Wed, 05 Jul 2023 09:39:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558940.873555; Wed, 05 Jul 2023 09:39:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyyu-0007qk-Bh; Wed, 05 Jul 2023 09:39:28 +0000
Received: by outflank-mailman (input) for mailman id 558940;
 Wed, 05 Jul 2023 09:39:27 +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
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyv8-0005bC-H8
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:34 +0000
Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com
 [2a00:1450:4864:20::229])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 499a72cb-1b17-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:35:32 +0200 (CEST)
Received: by mail-lj1-x229.google.com with SMTP id
 38308e7fff4ca-2b69923a715so99586011fa.0
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:32 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:31 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 499a72cb-1b17-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549732; x=1691141732;
        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=yGDYqeByXV8bSEztmWgee0JK3pFxnI7HN01UFyB4olQ=;
        b=tOrp+EQBc+CiGVQR1hP1s4epr7j8Wmx1XrqFzK7KK9t4o58/DNwO2O0N+fhOyZJte1
         tbsJhNLi7cFuTcw7+qecjuUMnFsEfBA5te2SO34oypF8mW6TLefIdzs25Vrl60J3ccpn
         tZs74jU0i0y/06ofqvOiDEz3H/hXDltZR3gJevNUneA0VA9+oyYaW+vR1OLYoGCdku8B
         fukcOu7I9CT2HdNMyrTIJKeC4mUQyiQ2GRyES6Xuv8apE7+q2f3V3awtnCjvZHuja3Gu
         PYFxSoRhgsznb6SH0CVCEfl7AwmMOm0ODT+mNWUPRJQ0IJ7B19sJ/HFJkDOE1/3puuvs
         F6SA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549732; x=1691141732;
        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=yGDYqeByXV8bSEztmWgee0JK3pFxnI7HN01UFyB4olQ=;
        b=beZKmUsqqAoFIJiva8mbaPJMbp96Ek2v/RxHxEIE6xQboJKTcvWe5mnUn9KS728OC/
         2T1xRgH4BTcMQ17wzjLsBLvhnh5/UqkO1v7fVwyJM4xxSO6BVrgfOJrMfMB1BRhddDor
         YrqHmFsyyW150OCEFX2GTM1J4sLGbXKZ3aWNxDImy+VJpG47Jsco/g85jDOZKs8dC/wr
         wiCRx1BnO8HeXSX5RqeNTBfv/gNgx+8U0dlXDMQY0M/bs2XYdVmbxWYi8KcFb/mBnMab
         5zqZ2SebyT8v98K0Fyen7vRWOJbWL1XK8QiVPRxjWDPVa1fF9ktEFVOLYt0g1zc9jXsk
         c5pA==
X-Gm-Message-State: ABy/qLbyEnYV1hoXmh6SHkUuc977RPEPz209Hv7l/PrMx/5PzLwqpN7G
	HuzB5RuVs3BaPU9SD7+dk81NVkzEZqzQ+9nNu7U=
X-Google-Smtp-Source: APBJJlFd7t5u9T3m922SVShBOkmmhCN2fZdYiMjgI6t5YOpmbnssRvBS/zlV0BbVl93rNHuGlAuXSw==
X-Received: by 2002:a2e:9d18:0:b0:2b6:dac0:affe with SMTP id t24-20020a2e9d18000000b002b6dac0affemr9952361lji.31.1688549732190;
        Wed, 05 Jul 2023 02:35:32 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v9 14/24] xen/arm: ffa: support guest FFA_PARTITION_INFO_GET
Date: Wed,  5 Jul 2023 11:34:23 +0200
Message-Id: <20230705093433.2514898-15-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support in the mediator to handle FFA_PARTITION_INFO_GET requests
from a guest. The requests are forwarded to the SPMC and the response is
translated according to the FF-A version in use by the guest.

Using FFA_PARTITION_INFO_GET changes the owner of the RX buffer to the
caller (the guest in this case), so once it is done with the buffer it
must be released using FFA_RX_RELEASE before another call can be made.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c | 131 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 131 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index ffabb5ed0a80..d5748b9ce88c 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -166,7 +166,18 @@
 #define FFA_MSG_SEND                    0x8400006EU
 #define FFA_MSG_POLL                    0x8400006AU
 
+/*
+ * Structs below ending with _1_0 are defined in FF-A-1.0-REL and
+ * struct ending with _1_1 are defined in FF-A-1.1-REL0.
+ */
+
 /* Partition information descriptor */
+struct ffa_partition_info_1_0 {
+    uint16_t id;
+    uint16_t execution_context;
+    uint32_t partition_properties;
+};
+
 struct ffa_partition_info_1_1 {
     uint16_t id;
     uint16_t execution_context;
@@ -189,6 +200,7 @@ struct ffa_ctx {
      */
     uint16_t create_signal_count;
     bool rx_is_free;
+    spinlock_t lock;
 };
 
 /* Negotiated FF-A version to use with the SPMC */
@@ -203,9 +215,15 @@ static uint16_t subscr_vm_destroyed_count __read_mostly;
 /*
  * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
  * number of pages used in each of these buffers.
+ *
+ * The RX buffer is protected from concurrent usage with ffa_rx_buffer_lock.
+ * Note that the SPMC is also tracking the ownership of our RX buffer so
+ * for calls which uses our RX buffer to deliver a result we must call
+ * ffa_rx_release() to let the SPMC know that we're done with the buffer.
  */
 static void *ffa_rx __read_mostly;
 static void *ffa_tx __read_mostly;
+static DEFINE_SPINLOCK(ffa_rx_buffer_lock);
 
 static bool ffa_get_version(uint32_t *vers)
 {
@@ -510,6 +528,100 @@ static uint32_t handle_rxtx_unmap(void)
     return FFA_RET_OK;
 }
 
+static int32_t handle_partition_info_get(uint32_t w1, uint32_t w2, uint32_t w3,
+                                         uint32_t w4, uint32_t w5,
+                                         uint32_t *count)
+{
+    int32_t ret = FFA_RET_DENIED;
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+
+    /*
+     * FF-A v1.0 has w5 MBZ while v1.1 allows
+     * FFA_PARTITION_INFO_GET_COUNT_FLAG to be non-zero.
+     */
+    if ( w5 == FFA_PARTITION_INFO_GET_COUNT_FLAG &&
+         ctx->guest_vers == FFA_VERSION_1_1 )
+        return ffa_partition_info_get(w1, w2, w3, w4, w5, count);
+    if ( w5 )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    if ( !ffa_rx )
+        return FFA_RET_DENIED;
+
+    spin_lock(&ctx->lock);
+    if ( !ctx->page_count || !ctx->rx_is_free )
+        goto out;
+    spin_lock(&ffa_rx_buffer_lock);
+    ret = ffa_partition_info_get(w1, w2, w3, w4, w5, count);
+    if ( ret )
+        goto out_rx_buf_unlock;
+    /*
+     * ffa_partition_info_get() succeeded so we now own the RX buffer we
+     * share with the SPMC. We must give it back using ffa_rx_release()
+     * once we've copied the content.
+     */
+
+    if ( ctx->guest_vers == FFA_VERSION_1_0 )
+    {
+        size_t n;
+        struct ffa_partition_info_1_1 *src = ffa_rx;
+        struct ffa_partition_info_1_0 *dst = ctx->rx;
+
+        if ( ctx->page_count * FFA_PAGE_SIZE < *count * sizeof(*dst) )
+        {
+            ret = FFA_RET_NO_MEMORY;
+            goto out_rx_release;
+        }
+
+        for ( n = 0; n < *count; n++ )
+        {
+            dst[n].id = src[n].id;
+            dst[n].execution_context = src[n].execution_context;
+            dst[n].partition_properties = src[n].partition_properties;
+        }
+    }
+    else
+    {
+        size_t sz = *count * sizeof(struct ffa_partition_info_1_1);
+
+        if ( ctx->page_count * FFA_PAGE_SIZE < sz )
+        {
+            ret = FFA_RET_NO_MEMORY;
+            goto out_rx_release;
+        }
+
+
+        memcpy(ctx->rx, ffa_rx, sz);
+    }
+    ctx->rx_is_free = false;
+out_rx_release:
+    ffa_rx_release();
+out_rx_buf_unlock:
+    spin_unlock(&ffa_rx_buffer_lock);
+out:
+    spin_unlock(&ctx->lock);
+
+    return ret;
+}
+
+static int32_t handle_rx_release(void)
+{
+    int32_t ret = FFA_RET_DENIED;
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+
+    spin_lock(&ctx->lock);
+    if ( !ctx->page_count || ctx->rx_is_free )
+        goto out;
+    ret = FFA_RET_OK;
+    ctx->rx_is_free = true;
+out:
+    spin_unlock(&ctx->lock);
+
+    return ret;
+}
+
 static void handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
 {
     struct arm_smccc_1_2_regs arg = { .a0 = fid, };
@@ -566,6 +678,7 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     uint32_t fid = get_user_reg(regs, 0);
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
+    uint32_t count;
     int e;
 
     if ( !ctx )
@@ -595,6 +708,24 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
         else
             set_regs_success(regs, 0, 0);
         return true;
+    case FFA_PARTITION_INFO_GET:
+        e = handle_partition_info_get(get_user_reg(regs, 1),
+                                      get_user_reg(regs, 2),
+                                      get_user_reg(regs, 3),
+                                      get_user_reg(regs, 4),
+                                      get_user_reg(regs, 5), &count);
+        if ( e )
+            set_regs_error(regs, e);
+        else
+            set_regs_success(regs, count, 0);
+        return true;
+    case FFA_RX_RELEASE:
+        e = handle_rx_release();
+        if ( e )
+            set_regs_error(regs, e);
+        else
+            set_regs_success(regs, 0, 0);
+        return true;
     case FFA_MSG_SEND_DIRECT_REQ_32:
     case FFA_MSG_SEND_DIRECT_REQ_64:
         handle_msg_send_direct_req(regs, fid);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:39:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:39:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558941.873560 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyyu-0007vN-Qc; Wed, 05 Jul 2023 09:39:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558941.873560; Wed, 05 Jul 2023 09:39:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyyu-0007um-KJ; Wed, 05 Jul 2023 09:39:28 +0000
Received: by outflank-mailman (input) for mailman id 558941;
 Wed, 05 Jul 2023 09:39:27 +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
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyvK-0005bC-Il
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:46 +0000
Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com
 [2a00:1450:4864:20::22a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 50754205-1b17-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:35:44 +0200 (CEST)
Received: by mail-lj1-x22a.google.com with SMTP id
 38308e7fff4ca-2b69923a715so99588901fa.0
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:44 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 50754205-1b17-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549743; x=1691141743;
        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=6R/D9gUszluJweN/TK1ixSj9VXkkPD7CMOFZ9iBZSkU=;
        b=LobW9+25cTLWzcRstSuR690/dlXuCVYMwbPjIEHTenZ/2nRyXeKwA/h4JAzHRUzD3s
         FmhvlBe2Q1EO5fMOb9VnD+mG9ZME87aqU7YDwVJjHbbHjeiROCCDnsooeVOOfxpDtZ5j
         9ioX15OCbqKNZaAm3a6tIgDXGvCY8M7lUzMzv24y8iQgoIWQh+utR6FxUgrajknE4/6L
         nt47aOLygXEI1KDw0FvuIviN0CZ9nZcBRDTnCAw4YdW3FSaQbWsLsjsgc0Id+7afCimr
         t5Hbe/fTj8Eq0eBBQOqjXDyhwxnqSUUpH/18drtvjaNhf1gf+SeH6o9m6mgpxDoz800U
         Mb+w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549743; x=1691141743;
        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=6R/D9gUszluJweN/TK1ixSj9VXkkPD7CMOFZ9iBZSkU=;
        b=kBvK1h/qtMtdpc5bvxLS/YZPinocxhmd7WOWccix/AYZvko+u2BeeIKOzgeJt5OwpS
         gl//dTUc8VSyXWzyrVn9whDzMGJ95krEkdSeBkECQvIGjy9cjG2QAKLJRCZfHJq6KMDw
         KHR7M/vCyBdj3l5OGwBobItpk8eLNcDGiKeZ/We3T/Ym6sJ+tBEQjew6e0G/v41RMpK4
         CQMOP5MMruBCnThurt1G/yPL/UINcJbtA8GKSPZP4rzw5WsJXbypZk5hsC+Fla40vQwg
         UVm5L6Xn2NgRTyHFfNPZGrkBbEWNidjhWzBICmJlNxz6q2NnBz1sxcXZOpjgoF65SwYz
         BYWw==
X-Gm-Message-State: ABy/qLZ7bJflmzWfdxTH0l0ZJ8SLyiOKJR02yH0V6g5/f6IWPAxlg6pX
	TsP0/47L68kPluvboSGcNbu9vzlvZ/8uPdU4LXY=
X-Google-Smtp-Source: APBJJlG/ZBCtB2DwyEpGctwoEHXQfYDNb0BZg67xTGH4UHtUtorEKgA7D8goMZYyEGY7vBlTlkf+Gg==
X-Received: by 2002:a2e:888e:0:b0:2b6:bb21:8d74 with SMTP id k14-20020a2e888e000000b002b6bb218d74mr13048468lji.1.1688549743794;
        Wed, 05 Jul 2023 02:35:43 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v9 24/24] docs: add Arm FF-A mediator
Date: Wed,  5 Jul 2023 11:34:33 +0200
Message-Id: <20230705093433.2514898-25-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Describes a FF-A version 1.1 [1] mediator to communicate with a Secure
Partition in secure world.

[1] https://developer.arm.com/documentation/den0077/latest
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 SUPPORT.md               |  9 +++++++++
 docs/man/xl.cfg.5.pod.in | 15 +++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/SUPPORT.md b/SUPPORT.md
index 35a6249e03b2..fe512762cee7 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -840,6 +840,15 @@ that covers the DMA of the device to be passed through.
 
 No support for QEMU backends in a 16K or 64K domain.
 
+### ARM: Firmware Framework for Arm A-profile (FF-A) Mediator
+
+    Status, Arm64: Tech Preview
+
+There are still some code paths where a vCPU may hog a pCPU longer than
+necessary. The FF-A mediator is not yet implemented for Arm32. Part of the
+FF-A specification is not supported, see the top comment in
+xen/arch/arm/tee/ffa.c for limitations.
+
 ### ARM: Guest Device Tree support
 
     Status: Supported
diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index 3979be2a590a..911c3619ce32 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -1648,6 +1648,21 @@ in OP-TEE.
 
 This feature is a B<technology preview>.
 
+=item B<ffa>
+
+B<Arm only.> Allow a guest to communicate via FF-A with Secure Partitions
+(SP), default false.
+
+Currently only a small subset of the FF-A specification is supported. Just
+enough to communicate with OP-TEE. In general only direct messaging and
+sharing memory with one SP. More advanced use cases where memory might be
+shared or donated to multiple SPs are not supported.
+
+See L<https://developer.arm.com/documentation/den0077/latest> for more
+information about FF-A.
+
+This feature is a B<technology preview>.
+
 =back
 
 =back
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:39:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:39:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558948.873576 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyz3-0000BZ-E0; Wed, 05 Jul 2023 09:39:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558948.873576; Wed, 05 Jul 2023 09:39:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyz3-0000BK-5s; Wed, 05 Jul 2023 09:39:37 +0000
Received: by outflank-mailman (input) for mailman id 558948;
 Wed, 05 Jul 2023 09:39:35 +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
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyvD-0005bC-Hj
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:39 +0000
Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com
 [2a00:1450:4864:20::234])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4baac23b-1b17-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:35:36 +0200 (CEST)
Received: by mail-lj1-x234.google.com with SMTP id
 38308e7fff4ca-2b702319893so1064051fa.3
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:36 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4baac23b-1b17-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549735; x=1691141735;
        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=KZBEdfHgu5rAc17OpHgYSz2Q4Zpnm6hWeKYd8pGy/wA=;
        b=VapJGscb5IgJCmRF1M/FkdFBn4lJV/Wkqp0/zl1VATS+qXvDKpKe30k0t7lc2LCYbB
         vyFczcjHjWJWxQOkgtUw6VL+aqtFtkygooYvfGWMcciHT97xzvrojDcgGbYgK1u/f1Lm
         2OFG4f7Yc7XgPvN5KhaHenm0q4407tPjWNlRVFQ8A/DLSdIDE8tyPfZ2AZah7a9ppOi3
         pr/lK0si+7k2dPCmnLbeieYe0+cew2BJZ3van1ygtmomihprUSVwNni4TUdmnjG9bimr
         Bh0bISK4kuNhTRNj1ib1yazLnqh4lcrnfJk58CL8bGQDOyp6zDqzpwKub577GUJTqUY6
         2utg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549735; x=1691141735;
        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=KZBEdfHgu5rAc17OpHgYSz2Q4Zpnm6hWeKYd8pGy/wA=;
        b=lqAd7ldkCC2MepOu484Z+FUeb/leJWNllN4C0dp1MPGUbjR3KQsMxORQ40ErkN2Vka
         cTypNJ2izMn8+d/LcvQn/4hfgeXJZY3V5JZN23aZL07Ojx3LLasBcCmuKHEA032rhGws
         l3XjheIJEEC/C94YbR5msPUd1/IvY75ycIWmqLVZa6wkTiZOI6ns5FCzwJ1FnyapCyQS
         HZd8SyDX/5htX+Gx5qYo1ccfSFHby1GGBDLT1sHWeclxKMqDPhc/zCQ41ahgi8ulTNo/
         wCwbsGLU0SBu9SuWh5/+dW2QNdRSzAI7ak2N+vvkDORbKtCwmatLKC+cjLrsvhiyQLWm
         0TOw==
X-Gm-Message-State: ABy/qLZWPZm+VwTZMWorFqBDu5dDkF3ccIPMGYLSsIcXKZI2JFRhkWem
	/KHUOsjSQEY638M88p2RS99XTQ/509uB39fq4yc=
X-Google-Smtp-Source: APBJJlGIZZycqhIAKudqt909+uOsbXnjdgh2GxNsB3tbsqwEgJydSgpmRp2nyDDlRcxBsKlRVOFsNw==
X-Received: by 2002:a2e:8847:0:b0:2b1:e807:f0f with SMTP id z7-20020a2e8847000000b002b1e8070f0fmr11326365ljj.28.1688549735702;
        Wed, 05 Jul 2023 02:35:35 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v9 17/24] xen/arm: ffa: add ABI structs for sharing memory
Date: Wed,  5 Jul 2023 11:34:26 +0200
Message-Id: <20230705093433.2514898-18-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds the ABI structs used by function FFA_MEM_SHARE and friends for
sharing memory.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/tee/ffa.c | 69 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index e895e355e620..03699473cfc5 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -243,6 +243,75 @@ struct ffa_partition_info_1_1 {
     uint8_t uuid[16];
 };
 
+/* Constituent memory region descriptor */
+struct ffa_address_range {
+    uint64_t address;
+    uint32_t page_count;
+    uint32_t reserved;
+};
+
+/* Composite memory region descriptor */
+struct ffa_mem_region {
+    uint32_t total_page_count;
+    uint32_t address_range_count;
+    uint64_t reserved;
+    struct ffa_address_range address_range_array[];
+};
+
+/* Memory access permissions descriptor */
+struct ffa_mem_access_perm {
+    uint16_t endpoint_id;
+    uint8_t perm;
+    uint8_t flags;
+};
+
+/* Endpoint memory access descriptor */
+struct ffa_mem_access {
+    struct ffa_mem_access_perm access_perm;
+    uint32_t region_offs;
+    uint64_t reserved;
+};
+
+/* Lend, donate or share memory transaction descriptor */
+struct ffa_mem_transaction_1_0 {
+    uint16_t sender_id;
+    uint8_t mem_reg_attr;
+    uint8_t reserved0;
+    uint32_t flags;
+    uint64_t handle;
+    uint64_t tag;
+    uint32_t reserved1;
+    uint32_t mem_access_count;
+    struct ffa_mem_access mem_access_array[];
+};
+
+struct ffa_mem_transaction_1_1 {
+    uint16_t sender_id;
+    uint16_t mem_reg_attr;
+    uint32_t flags;
+    uint64_t handle;
+    uint64_t tag;
+    uint32_t mem_access_size;
+    uint32_t mem_access_count;
+    uint32_t mem_access_offs;
+    uint8_t reserved[12];
+};
+
+/* Endpoint RX/TX descriptor */
+struct ffa_endpoint_rxtx_descriptor_1_0 {
+    uint16_t sender_id;
+    uint16_t reserved;
+    uint32_t rx_range_count;
+    uint32_t tx_range_count;
+};
+
+struct ffa_endpoint_rxtx_descriptor_1_1 {
+    uint16_t sender_id;
+    uint16_t reserved;
+    uint32_t rx_region_offs;
+    uint32_t tx_region_offs;
+};
+
 struct ffa_ctx {
     void *rx;
     const void *tx;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:39:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:39:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558960.873585 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyz5-0000eM-Mn; Wed, 05 Jul 2023 09:39:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558960.873585; Wed, 05 Jul 2023 09:39:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyz5-0000eE-Go; Wed, 05 Jul 2023 09:39:39 +0000
Received: by outflank-mailman (input) for mailman id 558960;
 Wed, 05 Jul 2023 09:39:38 +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
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyvC-0005bC-Hh
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:38 +0000
Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com
 [2a00:1450:4864:20::12a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4b053be9-1b17-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:35:35 +0200 (CEST)
Received: by mail-lf1-x12a.google.com with SMTP id
 2adb3069b0e04-4f954d7309fso661802e87.1
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:35 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:34 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4b053be9-1b17-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549734; x=1691141734;
        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=jd1PqoKu3zNmxIHhUbgtRR0UeglIV+SwdMxJBYTSy/E=;
        b=FyL+sojBuZm/elrnCYhlczxOzQWpPWmPl8isP57HPXDdhoMHYoKUusoO22frV6d+QD
         XZixMu173FNWtayEXgoA9jb5K1OiB1ATZLF0bC9OIw2mLHZUADpIJpVBHsqREO24PUCq
         eyKs3uOiTYjEBLe+l3rXkDEIYYM0NbG5owAbwkmCGGuBgyZeLsw1IFIObSSRRzozVizf
         sZN3c17+6GiGyOTcfmPcHurn0nirO8Pd7tOyw4hjtbTCTjptiMxnSfORdOwSzty/OJ6N
         xuQLAx2MoA+Tq1TE401VXlZo/3ZX//w2Ln+xp9HWROBF+wR3Q7fMe80WAm6vqYJMi5dQ
         zttg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549734; x=1691141734;
        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=jd1PqoKu3zNmxIHhUbgtRR0UeglIV+SwdMxJBYTSy/E=;
        b=LqWGZajekorbQXW1+QI4RWPtRENhEn+YTxtF38OVwTGMie15qdBwRsncTMR87Zqn4k
         9QyKMi2VAglapMJg8ECBx6kSkQTeBYYtEcPHGQECu1a4hSiV0QfEJIBLYbShDQN3gi4S
         q0yWMsM4+g3cUeeolm4MtuH8ipvhtfm/nmRWX9Z8tInlKavpyJCNyhFrokFt7dEEPI/2
         qCm6HU3L/WyqQxTejOjGgFh5JkbQgj392Tqfc+8dvzF9n3vY9HMB1raYDqs4pIjKNg28
         872uzd7bjEbn5m/QQtcuext2eljNGMvVLyEZw07YNMc1gADYpNucU/vu0XKp64Ys05QC
         K+dA==
X-Gm-Message-State: ABy/qLYVi4XtVXmQ6QzexDG0VoeKxJojr8gZtqpfV+bJumUOyoZi0GFN
	+sCdfHxk/YUWKwzF/DCAySuUlaDzmsSJ5BxLRbM=
X-Google-Smtp-Source: APBJJlHPM8fpcFFS2935sU4w8P/nYq1uPlNDlVSDk7rIgrQVGG3GkRebkD2L+5ufvFxZ0cpNyjKWVQ==
X-Received: by 2002:a05:6512:1588:b0:4fb:7758:4ec0 with SMTP id bp8-20020a056512158800b004fb77584ec0mr681199lfb.24.1688549734512;
        Wed, 05 Jul 2023 02:35:34 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v9 16/24] xen/arm: ffa: add defines for sharing memory
Date: Wed,  5 Jul 2023 11:34:25 +0200
Message-Id: <20230705093433.2514898-17-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

According to DEN0077A version 1.1 REL0
- Section 10.9.2 Memory region handle, page 167
- Table 10.18 at page 175
- Table 10.15 at page 168
- Section 10.11.4 Flags usage, page 184-187
add defines needed for sharing using the function FFA_MEM_SHARE and
friends.

Also add limits for how many shared buffers that a guest can have at
once and how large a shared buffer can be at most.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 xen/arch/arm/tee/ffa.c | 58 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index d5748b9ce88c..e895e355e620 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -5,6 +5,14 @@
  * Arm Firmware Framework for ARMv8-A (FF-A) mediator
  *
  * Copyright (C) 2023  Linaro Limited
+ *
+ * References:
+ * FF-A-1.0-REL: FF-A specification version 1.0 available at
+ *               https://developer.arm.com/documentation/den0077/a
+ * FF-A-1.1-REL0: FF-A specification version 1.1 available at
+ *                https://developer.arm.com/documentation/den0077/e
+ * TEEC-1.0C: TEE Client API Specification version 1.0c available at
+ *            https://globalplatform.org/specs-library/tee-client-api-specification/
  */
 
 #include <xen/bitops.h>
@@ -80,6 +88,56 @@
  */
 #define FFA_MAX_RXTX_PAGE_COUNT         1
 
+/*
+ * Limit for shared buffer size. Please note that this define limits
+ * number of pages.
+ *
+ * FF-A doesn't have any direct requirements on GlobalPlatform or vice
+ * versa, but an implementation can very well use FF-A in order to provide
+ * a GlobalPlatform interface on top.
+ *
+ * Global Platform specification for TEE requires that any TEE
+ * implementation should allow to share buffers with size of at least
+ * 512KB, defined in TEEC-1.0C page 24, Table 4-1,
+ * TEEC_CONFIG_SHAREDMEM_MAX_SIZE.
+ * Due to overhead which can be hard to predict exactly, double this number
+ * to give a safe margin.
+ */
+#define FFA_MAX_SHM_PAGE_COUNT          (2 * SZ_512K / FFA_PAGE_SIZE)
+
+/*
+ * Limits the number of shared buffers that guest can have at once. This
+ * is to prevent case, when guests trick XEN into exhausting its own
+ * memory by allocating many small buffers. This value has been chosen
+ * arbitrarily.
+ */
+#define FFA_MAX_SHM_COUNT               32
+
+/* FF-A-1.1-REL0 section 10.9.2 Memory region handle, page 167 */
+#define FFA_HANDLE_HYP_FLAG             BIT(63, ULL)
+#define FFA_HANDLE_INVALID              0xffffffffffffffffULL
+
+/*
+ * Memory attributes: Normal memory, Write-Back cacheable, Inner shareable
+ * Defined in FF-A-1.1-REL0 Table 10.18 at page 175.
+ */
+#define FFA_NORMAL_MEM_REG_ATTR         0x2fU
+/*
+ * Memory access permissions: Read-write
+ * Defined in FF-A-1.1-REL0 Table 10.15 at page 168.
+ */
+#define FFA_MEM_ACC_RW                  0x2U
+
+/* FF-A-1.1-REL0 section 10.11.4 Flags usage, page 184-187 */
+/* Clear memory before mapping in receiver */
+#define FFA_MEMORY_REGION_FLAG_CLEAR            BIT(0, U)
+/* Relayer may time slice this operation */
+#define FFA_MEMORY_REGION_FLAG_TIME_SLICE       BIT(1, U)
+/* Clear memory after receiver relinquishes it */
+#define FFA_MEMORY_REGION_FLAG_CLEAR_RELINQUISH BIT(2, U)
+/* Share memory transaction */
+#define FFA_MEMORY_REGION_TRANSACTION_TYPE_SHARE (1U << 3)
+
 /*
  * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
  * BIT(31): Framework or partition message
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:39:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:39:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558964.873590 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyz6-0000gp-3L; Wed, 05 Jul 2023 09:39:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558964.873590; Wed, 05 Jul 2023 09:39:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGyz5-0000fv-QZ; Wed, 05 Jul 2023 09:39:39 +0000
Received: by outflank-mailman (input) for mailman id 558964;
 Wed, 05 Jul 2023 09:39:38 +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
 <SRS0=hy0b=CX=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qGyv6-0005bC-8e
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:35:32 +0000
Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com
 [2a00:1450:4864:20::12f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 48196d2b-1b17-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 11:35:30 +0200 (CEST)
Received: by mail-lf1-x12f.google.com with SMTP id
 2adb3069b0e04-4fb761efa7aso10061091e87.0
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 02:35:30 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 q22-20020a2e84d6000000b002b6d8cfb6d2sm2910625ljh.140.2023.07.05.02.35.28
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 02:35:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 48196d2b-1b17-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688549729; x=1691141729;
        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=xKMZdOi/Dn1qjCZASYiDWBzyjEGqNklqsbHI8w4JIKE=;
        b=Yo5l1JORxuZq/AUfzucBeFEkCWltsrQvif6qfvakkf/kwf/4KYHoc0MC98lzbMGREb
         EfNs/oicp1xaYXvNIWJKg8PyoQLn7y+F2uFlNRg+FF43I0Ba87D2VEyyW90oGX4h76Vs
         rJsenLywtkD+ftIKurzhDSxTwiZdiyAOYEZn+Am7Gm4pRiHjkgYU0poeYdbVt2z7l/XU
         7vuU1FTgN33kJA10NP3o2UBTItvsz3humY+lJLwqs5X7NRQFmr3PwAeSDNgG0BuINNI+
         kufYDlA+lYx7Wp14s7zjTNwMll2Zx2b/HF0lzxsJfkF7+l29zqBtMpgl0AfNDyyWf5/l
         5e8A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688549729; x=1691141729;
        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=xKMZdOi/Dn1qjCZASYiDWBzyjEGqNklqsbHI8w4JIKE=;
        b=CAPFmpfpP3j0vTFCaLqY7/S+/e30p7Lss1LFzA4L9j6peO3pafYHYcjM0z4u8URQjT
         NpfSuOCziDEE1q5xh7zFPYTfyrxWN94EG8f1GDYSkunmIFnHWL7fmc/UZHACwENBAySv
         wbLNcOnJTSi7qOGhqUXYFdIOYi8vmljDKspCoQ+0Un09+JD+dToxQEJhL/mCVRp4uf9e
         yf8twPqtsp49Bi6M/y+DQzfEHuhudI8P4trWeISzSPqAtRrSDjBOUxodhy443WZtcAw6
         /duJHMkk6YFkJGxcWpHqy99c/OIPnQ2XgyfzS2PSnA+4z+RCTVGUGzTdrgY39p/sbOCi
         CEMQ==
X-Gm-Message-State: ABy/qLYkcq7gaOjUBFZ1Jvm3w6Mo7fau+wQBJO6GiVNO5irb7K84PY1U
	TEexO3HFPcqlKp7lG3UEsu0itKjs7B2srBOxf20=
X-Google-Smtp-Source: APBJJlG1vx41HWZkhZrzm5Al4+cHWA0wwjhNJ5mLa89tKq4ICxneInL0vwVIY3DuVhJznqjeNzdDrA==
X-Received: by 2002:a2e:9599:0:b0:2b6:c818:a9bc with SMTP id w25-20020a2e9599000000b002b6c818a9bcmr11146517ljh.23.1688549729693;
        Wed, 05 Jul 2023 02:35:29 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [XEN PATCH v9 12/24] xen/arm: ffa: send guest events to Secure Partitions
Date: Wed,  5 Jul 2023 11:34:21 +0200
Message-Id: <20230705093433.2514898-13-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The FF-A specification defines framework messages sent as direct
requests when certain events occurs. For instance when a VM (guest) is
created or destroyed. Only SPs which have subscribed to these events
will receive them. An SP can subscribe to these messages in its
partition properties.

Adds a check that the SP supports the needed FF-A features
FFA_PARTITION_INFO_GET and FFA_RX_RELEASE.

The partition properties of each SP is retrieved with
FFA_PARTITION_INFO_GET which returns the information in our RX buffer.
Using FFA_PARTITION_INFO_GET changes the owner of the RX buffer to the
caller (us), so once we're done with the buffer it must be released
using FFA_RX_RELEASE before another call can be made.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c | 233 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 231 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index f8ccaabc568d..d755363de686 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -160,14 +160,33 @@
 #define FFA_MSG_SEND                    0x8400006EU
 #define FFA_MSG_POLL                    0x8400006AU
 
+/* Partition information descriptor */
+struct ffa_partition_info_1_1 {
+    uint16_t id;
+    uint16_t execution_context;
+    uint32_t partition_properties;
+    uint8_t uuid[16];
+};
+
 struct ffa_ctx {
     /* FF-A version used by the guest */
     uint32_t guest_vers;
+    /*
+     * Number of SPs that we have sent a VM created signal to, used in
+     * ffa_domain_teardown() to know which SPs need to be signalled.
+     */
+    uint16_t create_signal_count;
 };
 
 /* Negotiated FF-A version to use with the SPMC */
 static uint32_t __ro_after_init ffa_version;
 
+/* SPs subscribing to VM_CREATE and VM_DESTROYED events */
+static uint16_t *subscr_vm_created __read_mostly;
+static uint16_t subscr_vm_created_count __read_mostly;
+static uint16_t *subscr_vm_destroyed __read_mostly;
+static uint16_t subscr_vm_destroyed_count __read_mostly;
+
 /*
  * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
  * number of pages used in each of these buffers.
@@ -251,6 +270,87 @@ static int32_t ffa_rxtx_map(paddr_t tx_addr, paddr_t rx_addr,
     return ffa_simple_call(FFA_RXTX_MAP_64, tx_addr, rx_addr, page_count, 0);
 }
 
+static int32_t ffa_partition_info_get(uint32_t w1, uint32_t w2, uint32_t w3,
+                                      uint32_t w4, uint32_t w5,
+                                      uint32_t *count)
+{
+    const struct arm_smccc_1_2_regs arg = {
+        .a0 = FFA_PARTITION_INFO_GET,
+        .a1 = w1,
+        .a2 = w2,
+        .a3 = w3,
+        .a4 = w4,
+        .a5 = w5,
+    };
+    struct arm_smccc_1_2_regs resp;
+    uint32_t ret;
+
+    arm_smccc_1_2_smc(&arg, &resp);
+
+    ret = get_ffa_ret_code(&resp);
+    if ( !ret )
+        *count = resp.a2;
+
+    return ret;
+}
+
+static int32_t ffa_rx_release(void)
+{
+    return ffa_simple_call(FFA_RX_RELEASE, 0, 0, 0, 0);
+}
+
+static int32_t ffa_direct_req_send_vm(uint16_t sp_id, uint16_t vm_id,
+                                      uint8_t msg)
+{
+    uint32_t exp_resp = FFA_MSG_FLAG_FRAMEWORK;
+    unsigned int retry_count = 0;
+    int32_t res;
+
+    if ( msg == FFA_MSG_SEND_VM_CREATED )
+        exp_resp |= FFA_MSG_RESP_VM_CREATED;
+    else if ( msg == FFA_MSG_SEND_VM_DESTROYED )
+        exp_resp |= FFA_MSG_RESP_VM_DESTROYED;
+    else
+        return FFA_RET_INVALID_PARAMETERS;
+
+    do {
+        const struct arm_smccc_1_2_regs arg = {
+            .a0 = FFA_MSG_SEND_DIRECT_REQ_32,
+            .a1 = sp_id,
+            .a2 = FFA_MSG_FLAG_FRAMEWORK | msg,
+            .a5 = vm_id,
+        };
+        struct arm_smccc_1_2_regs resp;
+
+        arm_smccc_1_2_smc(&arg, &resp);
+        if ( resp.a0 != FFA_MSG_SEND_DIRECT_RESP_32 || resp.a2 != exp_resp )
+        {
+            /*
+             * This is an invalid response, likely due to some error in the
+             * implementation of the ABI.
+             */
+            return FFA_RET_INVALID_PARAMETERS;
+        }
+        res = resp.a3;
+        if ( ++retry_count > 10 )
+        {
+            /*
+             * TODO
+             * FFA_RET_INTERRUPTED means that the SPMC has a pending
+             * non-secure interrupt, we need a way of delivering that
+             * non-secure interrupt.
+             * FFA_RET_RETRY is the SP telling us that it's temporarily
+             * blocked from handling the direct request, we need a generic
+             * way to deal with this.
+             * For now in both cases, give up after a few retries.
+             */
+            return res;
+        }
+    } while ( res == FFA_RET_INTERRUPTED || res == FFA_RET_RETRY );
+
+    return res;
+}
+
 static uint16_t get_vm_id(const struct domain *d)
 {
     /* +1 since 0 is reserved for the hypervisor in FF-A */
@@ -374,6 +474,8 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
 static int ffa_domain_init(struct domain *d)
 {
     struct ffa_ctx *ctx;
+    unsigned int n;
+    int32_t res;
 
     if ( !ffa_version )
         return -ENODEV;
@@ -387,20 +489,68 @@ static int ffa_domain_init(struct domain *d)
     ctx = xzalloc(struct ffa_ctx);
     if ( !ctx )
         return -ENOMEM;
-
     d->arch.tee = ctx;
 
+    for ( n = 0; n < subscr_vm_created_count; n++ )
+    {
+        res = ffa_direct_req_send_vm(subscr_vm_created[n], get_vm_id(d),
+                                     FFA_MSG_SEND_VM_CREATED);
+        if ( res )
+        {
+            printk(XENLOG_ERR "ffa: Failed to report creation of vm_id %u to  %u: res %d\n",
+                   get_vm_id(d), subscr_vm_created[n], res);
+            ctx->create_signal_count = n;
+            return -EIO;
+        }
+    }
+    ctx->create_signal_count = n;
+
     return 0;
 }
 
+static bool is_in_subscr_list(const uint16_t *subscr, uint16_t start,
+                              uint16_t end, uint16_t vm_id)
+{
+    unsigned int n;
+
+    for (n = start; n < end; n++)
+    {
+        if (subscr[n] == vm_id)
+            return true;
+    }
+
+    return false;
+}
+
 /* This function is supposed to undo what ffa_domain_init() has done */
 static int ffa_domain_teardown(struct domain *d)
 {
     struct ffa_ctx *ctx = d->arch.tee;
+    unsigned int n;
+    int32_t res;
 
     if ( !ctx )
         return 0;
 
+    for ( n = 0; n < subscr_vm_destroyed_count; n++ )
+    {
+        /*
+         * Skip SPs subscribed to the VM created event that never was
+         * notified of the VM creation due to an error during
+         * ffa_domain_init().
+         */
+        if ( is_in_subscr_list(subscr_vm_created, ctx->create_signal_count,
+                               subscr_vm_created_count, get_vm_id(d)) )
+            continue;
+
+        res = ffa_direct_req_send_vm(subscr_vm_destroyed[n], get_vm_id(d),
+                                     FFA_MSG_SEND_VM_DESTROYED);
+
+        if ( res )
+            printk(XENLOG_ERR "ffa: Failed to report destruction of vm_id %u to  %u: res %d\n",
+                   get_vm_id(d), subscr_vm_destroyed[n], res);
+    }
+
     XFREE(d->arch.tee);
 
     return 0;
@@ -411,6 +561,81 @@ static int ffa_relinquish_resources(struct domain *d)
     return 0;
 }
 
+static void uninit_subscribers(void)
+{
+        subscr_vm_created_count = 0;
+        subscr_vm_destroyed_count = 0;
+        XFREE(subscr_vm_created);
+        XFREE(subscr_vm_destroyed);
+}
+
+static bool init_subscribers(struct ffa_partition_info_1_1 *fpi, uint16_t count)
+{
+    uint16_t n;
+    uint16_t c_pos;
+    uint16_t d_pos;
+
+    subscr_vm_created_count = 0;
+    subscr_vm_destroyed_count = 0;
+    for ( n = 0; n < count; n++ )
+    {
+        if (fpi[n].partition_properties & FFA_PART_PROP_NOTIF_CREATED)
+            subscr_vm_created_count++;
+        if (fpi[n].partition_properties & FFA_PART_PROP_NOTIF_DESTROYED)
+            subscr_vm_destroyed_count++;
+    }
+
+    if ( subscr_vm_created_count )
+        subscr_vm_created = xzalloc_array(uint16_t, subscr_vm_created_count);
+    if ( subscr_vm_destroyed_count )
+        subscr_vm_destroyed = xzalloc_array(uint16_t,
+                                            subscr_vm_destroyed_count);
+    if ( (subscr_vm_created_count && !subscr_vm_created) ||
+         (subscr_vm_destroyed_count && !subscr_vm_destroyed) )
+    {
+        printk(XENLOG_ERR "ffa: Failed to allocate subscription lists\n");
+        uninit_subscribers();
+        return false;
+    }
+
+    for ( c_pos = 0, d_pos = 0, n = 0; n < count; n++ )
+    {
+        if ( fpi[n].partition_properties & FFA_PART_PROP_NOTIF_CREATED )
+            subscr_vm_created[c_pos++] = fpi[n].id;
+        if ( fpi[n].partition_properties & FFA_PART_PROP_NOTIF_DESTROYED )
+            subscr_vm_destroyed[d_pos++] = fpi[n].id;
+    }
+
+    return true;
+}
+
+static bool init_sps(void)
+{
+    bool ret = false;
+    uint32_t count;
+    int e;
+
+    e = ffa_partition_info_get(0, 0, 0, 0, 0, &count);
+    if ( e )
+    {
+        printk(XENLOG_ERR "ffa: Failed to get list of SPs: %d\n", e);
+        goto out;
+    }
+
+    if ( count >= UINT16_MAX )
+    {
+        printk(XENLOG_ERR "ffa: Impossible number of SPs: %u\n", count);
+        goto out;
+    }
+
+    ret = init_subscribers(ffa_rx, count);
+
+out:
+    ffa_rx_release();
+
+    return ret;
+}
+
 static bool ffa_probe(void)
 {
     uint32_t vers;
@@ -462,7 +687,8 @@ static bool ffa_probe(void)
      * TODO: Rework the code to allow domain to use a subset of the
      * features supported.
      */
-    if (
+    if ( !check_mandatory_feature(FFA_PARTITION_INFO_GET) ||
+         !check_mandatory_feature(FFA_RX_RELEASE) ||
          !check_mandatory_feature(FFA_RXTX_MAP_64) ||
          !check_mandatory_feature(FFA_RXTX_UNMAP) ||
          !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
@@ -484,6 +710,9 @@ static bool ffa_probe(void)
     }
     ffa_version = vers;
 
+    if ( !init_sps() )
+        goto err_free_ffa_tx;
+
     return true;
 
 err_free_ffa_tx:
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:54:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:54:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.558992.873605 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzCt-0004kf-AX; Wed, 05 Jul 2023 09:53:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 558992.873605; Wed, 05 Jul 2023 09:53:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzCt-0004kY-6g; Wed, 05 Jul 2023 09:53:55 +0000
Received: by outflank-mailman (input) for mailman id 558992;
 Wed, 05 Jul 2023 09:53:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=TfY/=CX=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qGzCr-0004kR-BT
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 09:53:53 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on2062b.outbound.protection.outlook.com
 [2a01:111:f400:7d00::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d7fbb26f-1b19-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 11:53:51 +0200 (CEST)
Received: from DUZPR01CA0342.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4b8::26) by DB9PR08MB6522.eurprd08.prod.outlook.com
 (2603:10a6:10:250::7) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 09:53:48 +0000
Received: from DBAEUR03FT036.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4b8:cafe::99) by DUZPR01CA0342.outlook.office365.com
 (2603:10a6:10:4b8::26) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 09:53:48 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT036.mail.protection.outlook.com (100.127.142.193) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.22 via Frontend Transport; Wed, 5 Jul 2023 09:53:48 +0000
Received: ("Tessian outbound c63645f235c1:v142");
 Wed, 05 Jul 2023 09:53:48 +0000
Received: from f5e93bac19ff.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 105A9751-9A5D-46F8-91EF-3AC2DF07EA86.1; 
 Wed, 05 Jul 2023 09:53:42 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f5e93bac19ff.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 09:53:42 +0000
Received: from AS9PR05CA0309.eurprd05.prod.outlook.com (2603:10a6:20b:491::12)
 by AS2PR08MB9389.eurprd08.prod.outlook.com (2603:10a6:20b:597::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 09:53:37 +0000
Received: from AM7EUR03FT029.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:491:cafe::73) by AS9PR05CA0309.outlook.office365.com
 (2603:10a6:20b:491::12) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 09:53:37 +0000
Received: from nebula.arm.com (40.67.248.234) by
 AM7EUR03FT029.mail.protection.outlook.com (100.127.140.143) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.24 via Frontend Transport; Wed, 5 Jul 2023 09:53:37 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com
 (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 5 Jul
 2023 09:53:34 +0000
Received: from [10.169.188.49] (10.169.188.49) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Wed, 5 Jul 2023 09:53:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d7fbb26f-1b19-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/NBN7ve4Cg99N+iX5JvrwNX2ZLUWx1ZwjzaCq0w36aM=;
 b=3kFxN2kRQWTk6Yy1twZuSO8dzAyOlsxlHAybB1ImQQSMzrThCyP6nayu/sPyG/RqE8lMNSnCZx+pXW0F2WC5xwUTtxuG8QeYQz08/4np8lJ2Z6pL3lBEo5YJz1b9b13hsjnItQFRKik3B1ABW6XCsm1a1Pk5uTFnxr+t1pLWE3M=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 4f382e8da34336c4
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=jJ6Zu4DdRcNG7ag/bSqwpH1FKPEndPCZywAVlkNVIzstzlDi2i62koWjO0j5lKiLtf4wBUH0/N51KPf6S5w2/G3MXdCB1crSFUq8FzZb8Tp+rw/xxEYD2KSPy26dVAUC7gFhZ9Lakw9Eyc+55HFocAa5p7IUdLNXKHETTQnTAv9gkGO+CfXN2PYrEjgS307h188bGRkbNr/OjUpti6RH1JNzExOOItD3Nu0pvZzEev1zKhTKDLFVzhPtJjOEGSNbwYOwT35hdCQ69GCdB1MlIGNGgwtVy4ciWGHSvskb9pjq+ojhJXbzGcLG/mtVYQ+5mm1KtlEB1Bt7F7GGlie1/w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/NBN7ve4Cg99N+iX5JvrwNX2ZLUWx1ZwjzaCq0w36aM=;
 b=amSEuAoJyxEjLlTfba6jbjdzAtL7sXUUuWDxHn5k0U8Kki7WYEvS0vM7A4VSZ87siih1tFAfVaC0nXOcspzKGcZLtYEcpWy6fhMKaJXEjA/S4b4Wfq1TnNNyKu3Lci/bBVXzzLxYSDooByATQ/pQad0GRtT8BPSG6OaRApX4JTflhGTmpNUMbb0Ukxv6VXxww1bPitd4k4/myNOJkEWFp02tVi1oldDI9HwajubaT9hpNXCsIsnfIJCd6XxPdqZRL6Z7pXDLCkmzkVuR9vhKRoZJBxRcDTQM1FN0S4oepEfIOlWj7Nrz45uMo2YqoELu78VGuoKjr8IG2kbb4BxOnA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/NBN7ve4Cg99N+iX5JvrwNX2ZLUWx1ZwjzaCq0w36aM=;
 b=3kFxN2kRQWTk6Yy1twZuSO8dzAyOlsxlHAybB1ImQQSMzrThCyP6nayu/sPyG/RqE8lMNSnCZx+pXW0F2WC5xwUTtxuG8QeYQz08/4np8lJ2Z6pL3lBEo5YJz1b9b13hsjnItQFRKik3B1ABW6XCsm1a1Pk5uTFnxr+t1pLWE3M=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <63c58ce7-08c0-e86c-acec-9273f48cdc12@arm.com>
Date: Wed, 5 Jul 2023 17:53:30 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 33/52] xen/mpu: initialize frametable in MPU system
Content-Language: en-US
To: Julien Grall <julien@xen.org>, Ayan Kumar Halder <ayankuma@amd.com>,
	<xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-34-Penny.Zheng@arm.com>
 <ee709651-a6fc-2485-ae2b-edf0306fbc13@amd.com>
 <db707ef1-cc91-bc7d-33d2-bf804ece2226@arm.com>
 <15791f2e-b4cf-aa60-3f67-d9e74877e54b@xen.org>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <15791f2e-b4cf-aa60-3f67-d9e74877e54b@xen.org>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	AM7EUR03FT029:EE_|AS2PR08MB9389:EE_|DBAEUR03FT036:EE_|DB9PR08MB6522:EE_
X-MS-Office365-Filtering-Correlation-Id: 4237196c-5465-46d6-703b-08db7d3dbac2
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 cP8DjhzdoUANJaBiHmz7i/f1LckYjcQ8o9yUST6Y1BH+K3nJBydfGLteeDQ3s1+raXgD7ZNT3GrKHUfHFPni64tr06lUfuOhbGy9riH1AFzzFDDbbJ7PtGPurL484WP9lPRl4mbuxj3EsE4G88VD8BCWDnOIs7Q/h4+k907Fjvww69yF5BbTVQ6XMvbufmgPAXNUl1UjTapPrqrFxcqON3dZIOwGakZMfvN2ZoIapU1ubm4GklygJuueFxct4YkMe8WY+SaxXoTT8QszezI5veN9L8xuPXkVHx+XlSkamgaQwvHIA4UbaykwhM0l0lnvyqjr1Ph1ExOVhEpenMTwtxJ0sNSnUBV1uZwpM1tI54CtqPaOlD01nsO5Oc6KCRsP774529iz1fZ3Hfglk6RjcIfVHcK1owVxQB6/DrX2cFYRJSTVvvZnHKYyTo2+koIVuZifNUveHxp65tHlqOCWs2YTJEzjrDL1DZSjBPqlEfLCiWZDZ7DBpXblO9lb4Wiim33AYEOxS+mv5o+EFgpfJGSo/1vswnRDWYLxB1Y4VIDmZ9danSb8iFeGOneyEC8x2EtJ4z15gd2W6BnD+QxaVlPGgAV9/ICfZ2EMLXxADgu6j+h1YT2aJSNxnx/UyNkb37aQ4b7Qkw8Mx4oSb3aH7artM35ldTwbf7fL99xajc4ZZTSZy4+xdu09mLDGitRsBYaiBpmBWkBumZu/kf/DhGJkgETPUJWPHYlKOn7zdBo+7n8ytAeUa4/vLcESgBfS74CDLVTktAXSEsBXlsF5TwZVYJS1LN8VFnVlJd2qeX+/xVCYhlKQPy35F2JLDDL2zlPT6tHFAS6JzBRimuZelw==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(396003)(346002)(39860400002)(451199021)(36840700001)(40470700004)(46966006)(31686004)(2906002)(82310400005)(44832011)(8676002)(86362001)(2616005)(36860700001)(31696002)(40480700001)(8936002)(5660300002)(54906003)(53546011)(110136005)(478600001)(26005)(186003)(336012)(81166007)(356005)(82740400003)(47076005)(426003)(40460700003)(83380400001)(316002)(4326008)(70206006)(70586007)(36756003)(16576012)(41300700001)(3940600001)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9389
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT036.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	efd54b26-6e4c-4f87-e3c6-08db7d3db426
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	riqTz0cbspTAPylX7RvmlGCd7EUR7wCipC1lP3TBNrjelNvywBEjvv2ekmGFOZ5B7o6JYnuVVd085AxTgKna93be4Vj+LmjypyCet1y0zDF9Nv1nBrfrxpLBSWQM/X5B+/HRldfP+ph2ze6Vm4Kpqv7Cf6THCyu/7Qvsw5dj6niCIJas9LsPJoRxbNQoSIHmw6JGBDPXhzobZdF8rl8Ku/TUY9c9UL5s7j3Y2Tz9DhCMg8KHLwOJpfgO6Ny6Wxs4UDTS8NscqrjNRz3T81/s2TgcF9cDqBTKtXr6m2wF9katUZL5gEOf24eo1D6/JvOvgfqwKNOBG05bJcWm9aya9zm0Uvw+c2YcoYkO+5a4HeF08pDAiz5Vk2Dstd3vhMONqbjwY7wqVO3uzouaIFzB78bpYdidbykIR6X1B4OI5v07TbM2ec6Vo5bDaV3cuuwPb1/NBtqYUsx3/9342mqaOtvXG9LZeLcASrjSs9SxaAuRRl4Y90b5mQfyAWbGnJ8Mvwtr/Suf7oPlwlyWbijFdkIhe4nDqPZgjjGrgL8+ZByIXSi5ZfvAlPb7iVaO16PnzgZ+6n9PCqKUmk+kBE/XQRVBFAxe2XLqm8FKrZf3xe2raDV4MChZJx78Lo7ztfB5PqE8H6SSeKK0qd1QrgIgHY9iSt17CvqYDqPpWDQrq4jl4JCEc2tbpLLgF9awlWeKs6cColRskFdSKGFMhpqmFkcaObE4jP2+xYc0RZcQSp8q1Ex3CnMEzHvqtkGfVWrtHFc1lnoPOQdQzQK9GS226dGu51ZEzKWS9yGj1/wrlZUZVDMjcvVB2pnl6PYqubHV
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(39860400002)(396003)(346002)(451199021)(36840700001)(46966006)(40470700004)(8936002)(8676002)(2906002)(2616005)(70586007)(40480700001)(5660300002)(53546011)(44832011)(26005)(31686004)(336012)(186003)(70206006)(41300700001)(40460700003)(82740400003)(81166007)(16576012)(426003)(4326008)(36756003)(316002)(83380400001)(47076005)(54906003)(110136005)(36860700001)(478600001)(82310400005)(86362001)(31696002)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 09:53:48.2682
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 4237196c-5465-46d6-703b-08db7d3dbac2
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT036.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6522

Hiï¼Œ

On 2023/7/3 17:31, Julien Grall wrote:
> Hi,
> 
> On 03/07/2023 07:10, Penny Zheng wrote:
>> On 2023/6/30 23:19, Ayan Kumar Halder wrote:
>>> Hi Penny,
>>>
>>> On 26/06/2023 04:34, Penny Zheng wrote:
>>>> CAUTION: This message has originated from an External Source. Please 
>>>> use proper judgment and caution when opening attachments, clicking 
>>>> links, or responding to this email.
>>>>
>>>>
>>>> Xen is using page as the smallest granularity for memory managment.
>>>> And we want to follow the same concept in MPU system.
>>>> That is, structure page_info and the frametable which is used for 
>>>> storing
>>>> and managing the smallest memory managment unit is also required in 
>>>> MPU system.
>>>>
>>>> In MPU system, since we can not use a fixed VA 
>>>> address(FRAMETABLE_VIRT_START)
>>>> to map frametable like MMU system does and everything is 1:1 
>>>> mapping, we
>>>> instead define a variable "struct page_info *frame_table" as frametable
>>>> pointer, and ask boot allocator to allocate appropriate memory for 
>>>> frametable.
>>>>
>>>> As frametable is successfully initialized, the convertion between 
>>>> machine frame
>>>> number/machine address/"virtual address" and page-info structure is
>>>> ready too, like mfn_to_page/maddr_to_page/virt_to_page, etc
>>>>
>>>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>>>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>>>> ---
>>>> v3:
>>>> - add ASSERT() to confirm the MFN you pass is covered by the 
>>>> frametable.
>>>> ---
>>>> Â  xen/arch/arm/include/asm/mm.hÂ Â Â Â  | 14 ++++++++++++++
>>>> Â  xen/arch/arm/include/asm/mpu/mm.h |Â  3 +++
>>>> Â  xen/arch/arm/mpu/mm.cÂ Â Â Â Â Â Â Â Â Â Â Â  | 27 +++++++++++++++++++++++++++
>>>> Â  3 files changed, 44 insertions(+)
>>>>
>>>> diff --git a/xen/arch/arm/include/asm/mm.h 
>>>> b/xen/arch/arm/include/asm/mm.h
>>>> index daa6329505..66d98b9a29 100644
>>>> --- a/xen/arch/arm/include/asm/mm.h
>>>> +++ b/xen/arch/arm/include/asm/mm.h
>>>> @@ -341,6 +341,19 @@ static inline uint64_t gvirt_to_maddr(vaddr_t 
>>>> va, paddr_t *pa,
>>>> Â  #define virt_to_mfn(va)Â Â Â Â  __virt_to_mfn(va)
>>>> Â  #define mfn_to_virt(mfn)Â Â Â  __mfn_to_virt(mfn)
>>>>
>>>> +#ifdef CONFIG_HAS_MPU
>>>> +/* Convert between virtual address to page-info structure. */
>>>> +static inline struct page_info *virt_to_page(const void *v)
>>>> +{
>>>> +Â Â Â  unsigned long pdx;
>>>> +
>>>> +Â Â Â  pdx = paddr_to_pdx(virt_to_maddr(v));
>>>> +Â Â Â  ASSERT(pdx >= frametable_base_pdx);
>>>> +Â Â Â  ASSERT(pdx < frametable_pdx_end);
>>>> +
>>>> +Â Â Â  return frame_table + pdx - frametable_base_pdx;
>>>> +}
>>> This should go in xen/arch/arm/include/asm/mpu/mm.h. Then you don't 
>>> need ifdef
>>>> +#else
>>>> Â  /* Convert between Xen-heap virtual addresses and page-info 
>>>> structures. */
>>>> Â  static inline struct page_info *virt_to_page(const void *v)
>>>> Â  {
>>>> @@ -354,6 +367,7 @@ static inline struct page_info 
>>>> *virt_to_page(const void *v)
>>>> Â Â Â Â Â  pdx += mfn_to_pdx(directmap_mfn_start);
>>>> Â Â Â Â Â  return frame_table + pdx - frametable_base_pdx;
>>>> Â  }
>>> Consequently, this should be in xen/arch/arm/include/asm/mmu/mm.h
>>
>> The reason why I don't put virt_to_page()/page_to_virt() in specific 
>> header is that we are using some helpers, which are defined just
>> a few lines before, like mfn_to_virt(), etc.
>> If you are moving mfn_to_virt() to specific header too, that will
>> result in a lot dulplication.
>>
>>>> +#endif
>>>>
>>>> Â  static inline void *page_to_virt(const struct page_info *pg)
>>>> Â  {
>>>> diff --git a/xen/arch/arm/include/asm/mpu/mm.h 
>>>> b/xen/arch/arm/include/asm/mpu/mm.h
>>>> index e26bd4f975..98f6df65b8 100644
>>>> --- a/xen/arch/arm/include/asm/mpu/mm.h
>>>> +++ b/xen/arch/arm/include/asm/mpu/mm.h
>>>> @@ -2,6 +2,9 @@
>>>> Â  #ifndef __ARCH_ARM_MM_MPU__
>>>> Â  #define __ARCH_ARM_MM_MPU__
>>>>
>>>> +extern struct page_info *frame_table;
>>> If you define frame_table in xen/arch/arm/include/asm/mm.h , then you 
>>> don't need the above declaration.
>>
>> It is a variable only in MPU. In MMU, it is a fixed value.
>> "#define frame_table ((struct page_info *)FRAMETABLE_VIRT_START)"
>>
>>>> +extern unsigned long frametable_pdx_end;
>>> Also you don't need extern as this is only used by 
>>> xen/arch/arm/mpu/mm.c.
>>
>> sure.
>>
>>>> +
>>>> Â  extern int xen_mpumap_update(paddr_t base, paddr_t limit, unsigned 
>>>> int flags);
>>>
>>> You don't need extern here as it should be used only in 
>>> xen/arch/arm/mpu/mm.c
>>>
>>> Currently, I see the following in xen/arch/arm/mm.c,
>>>
>>> int map_pages_to_xen(unsigned long virt,
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_t mfn,
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned long nr_mfns,
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned int flags)
>>> {
>>> #ifndef CONFIG_HAS_MPU
>>> Â Â Â Â  return xen_pt_update(virt, mfn, nr_mfns, flags);
>>> #else
>>> Â Â Â Â  return xen_mpumap_update(mfn_to_maddr(mfn),
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_to_maddr(mfn_add(mfn, nr_mfns)), 
> You are ignoring 'virt' here. Shouldn't you at least check that 'virt == 
> mfn_to_maddr(mfn)'?
> 

Sure, I'll do the check.

>>> flags);
>>> #endif
>>> }
>>>
>>> int destroy_xen_mappings(unsigned long s, unsigned long e)
>>> {
>>> Â Â Â Â  ASSERT(IS_ALIGNED(s, PAGE_SIZE));
>>> Â Â Â Â  ASSERT(IS_ALIGNED(e, PAGE_SIZE));
>>> Â Â Â Â  ASSERT(s <= e);
>>> #ifndef CONFIG_HAS_MPU
>>> Â Â Â Â  return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, 0);
>>> #else
>>> Â Â Â Â  return xen_mpumap_update(virt_to_maddr((void *)s),
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  virt_to_maddr((void *)e), 0);
>>> #endif
>>> }
>>>
>>> int modify_xen_mappings(unsigned long s, unsigned long e, unsigned 
>>> int flags)
>>> {
>>> Â Â Â Â  ASSERT(IS_ALIGNED(s, PAGE_SIZE));
>>> Â Â Â Â  ASSERT(IS_ALIGNED(e, PAGE_SIZE));
>>> Â Â Â Â  ASSERT(s <= e);
>>> #ifndef CONFIG_HAS_MPU
>>> Â Â Â Â  return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, flags);
>>> #else
>>> Â Â Â Â  return xen_mpumap_update(virt_to_maddr((void *)s),
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  virt_to_maddr((void *)e), flags);
>>> #endif
>>> }
>>>
>>> It would be better to have 2 implementations for map_pages_to_xen(), 
>>> destroy_xen_mappings() and modify_xen_mappings() in 
>>> xen/arch/arm/mpu/mm.c and xen/arch/arm/mmu/mm.c.
>>>
>>
>> I prefer them staying in the common file, using #ifdef to go to the
>> different path.
> I don't like the #ifdef solution in this situation. You are only doing 
> it for the benefits of the ASSERT(). But they don't seem to have any 
> value for xen_mpumap_update() (you are still passing an address rather 
> than a frame).
> 

Okayï¼Œ I will pass a page or a valid mfn next version.

>> Since if not and when anyone wants to update map_pages_to_xen(), 
>> destroy_xen_mappings() and modify_xen_mappings() in the future, it is 
>> possible for them to leave changes in only one file.
> 
> The helpers are just wrappers. I doubt they will change in the future. 
> So I think it would be OK to duplicate.
> 
> The alternative would to have a common prototype for xen_pt_update() and 
> xen_mpumap_update() and avoid any #ifdery. That said, this is not my 
> preference at least if they are not static inline.
> 

Correct me if I'm wrong, you are suggesting something like this:
A more-generic wrapper like xen_mm_update, and we introduce static 
inline implementation in mmu/mm.h with xen_pt_update(), and static
inline implementation in mpu/mm.h with xen_mpumap_update().

> Cheers,
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 09:59:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 09:59:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559003.873634 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzI4-0005eC-87; Wed, 05 Jul 2023 09:59:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559003.873634; Wed, 05 Jul 2023 09:59:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzI4-0005e5-5Y; Wed, 05 Jul 2023 09:59:16 +0000
Received: by outflank-mailman (input) for mailman id 559003;
 Wed, 05 Jul 2023 09:59:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGzI2-0005dv-Lf; Wed, 05 Jul 2023 09:59:14 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGzI2-0003rm-HS; Wed, 05 Jul 2023 09:59:14 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGzI1-0003Uc-VI; Wed, 05 Jul 2023 09:59:14 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qGzI1-0001mO-Ut; Wed, 05 Jul 2023 09:59:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=eGjp29TB0X0AXDWgkeg2chbTejyAI/rkR1MUr7aLxH0=; b=bJBGJpY+QrH67u76vRnWA+u2bi
	mnHgytRSjJAUL+mutOiVgeEKWSaolj32OhvVkpl94Ggy5axBL9f2B5HZF4Br5h6bqItCd2EsoQPtX
	pc4RGRbaqPcDx0SxflCy0tHvHPZ0Q+krkMbLKjI4MZeHZqBfzfC8E0blugSJpvrbYfY4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181699-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181699: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=abb1522832bb2ef340a56681d486dce51d2f9971
X-Osstest-Versions-That:
    xen=6e06d229d538ea51b92dc189546c522f5e903511
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 05 Jul 2023 09:59:13 +0000

flight 181699 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181699/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181695
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181695
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181695
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181695
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181695
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181695
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181695
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181695
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181695
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181695
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181695
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181695
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  abb1522832bb2ef340a56681d486dce51d2f9971
baseline version:
 xen                  6e06d229d538ea51b92dc189546c522f5e903511

Last test of basis   181695  2023-07-04 13:38:35 Z    0 days
Testing same since   181699  2023-07-04 22:38:42 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Henry Wang <Henry.Wang@arm.com>
  Julien Grall <jgrall@amazon.com>
  Stefano Stabellini <sstabellini@kernel.org>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   6e06d229d5..abb1522832  abb1522832bb2ef340a56681d486dce51d2f9971 -> master


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 10:00:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 10:00:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559008.873645 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzIq-0006v1-LK; Wed, 05 Jul 2023 10:00:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559008.873645; Wed, 05 Jul 2023 10:00:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzIq-0006uu-FJ; Wed, 05 Jul 2023 10:00:04 +0000
Received: by outflank-mailman (input) for mailman id 559008;
 Wed, 05 Jul 2023 10:00:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGzIp-0006hl-Ft; Wed, 05 Jul 2023 10:00:03 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGzIp-0003ye-AN; Wed, 05 Jul 2023 10:00:03 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qGzIo-0003VF-Pq; Wed, 05 Jul 2023 10:00:02 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qGzIo-0002RK-PP; Wed, 05 Jul 2023 10:00:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=T0rZCL7xykdFm88wEhYGTOg4bjGxge2L9LXulpto4QM=; b=c2Jf5UwnoiU/75AaUNFVoXux+7
	ZZN2RpdbXYxZFBzuw36wFqd17yH15tyKN1AWiJRZdhyKmBzd14VbpykZFGhWKGIZlyDBvi57Kiut0
	9ZMAA12bJJU7YmPIIlwl6PBVsHp5sh3YoDGhjagf5EB1UNWqZNG/FKqX6z/tlN4Q7bQg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181702-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181702: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=1fadd18d0c0c65ffde9e128a486414ba43b3387c
X-Osstest-Versions-That:
    ovmf=6c744465b6970080dadb1f297db024284153c912
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 05 Jul 2023 10:00:02 +0000

flight 181702 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181702/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 1fadd18d0c0c65ffde9e128a486414ba43b3387c
baseline version:
 ovmf                 6c744465b6970080dadb1f297db024284153c912

Last test of basis   181687  2023-07-03 14:42:16 Z    1 days
Testing same since   181702  2023-07-05 07:40:44 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Gerd Hoffmann <kraxel@redhat.com>
  Hongbin1 Zhang <hongbin1.zhang@intel.com>
  Zhang, Hongbin1 <Hongbin1.Zhang@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   6c744465b6..1fadd18d0c  1fadd18d0c0c65ffde9e128a486414ba43b3387c -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 10:12:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 10:12:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559015.873655 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzUL-0000FZ-Kf; Wed, 05 Jul 2023 10:11:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559015.873655; Wed, 05 Jul 2023 10:11:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzUL-0000FS-HI; Wed, 05 Jul 2023 10:11:57 +0000
Received: by outflank-mailman (input) for mailman id 559015;
 Wed, 05 Jul 2023 10:11:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGzUK-0000FM-CL
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 10:11:56 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGzUJ-0004Li-Lz; Wed, 05 Jul 2023 10:11:55 +0000
Received: from [15.248.3.5] (helo=[10.24.67.21])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGzUJ-0008BX-Fj; Wed, 05 Jul 2023 10:11:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=RF7JK2NR6pH+ReRWBnKCtDO2tYrvH+V8eapC7j73158=; b=VvKslTPzHzAVG0cGAQh56YLBbw
	ee7oWyvK+pzG+ZqwOaV/k+g6TvMdmkDCR8AGLQXIokFeZHeNiC/KviS7eFOQGZstlY2rHeY/MW1+Z
	bgDNPoXZ4TsqKEj1CTbbXeAAOx2vMW6V07qRmjADYlxwSIIRW/GMuUXVyEdRhxcJ9mHI=;
Message-ID: <1ca1f3d7-03cf-0bcf-2862-dad3901f116a@xen.org>
Date: Wed, 5 Jul 2023 11:11:53 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 08/52] xen/arm64: move MMU related code from head.S to
 mmu/head.S
Content-Language: en-US
To: Penny Zheng <penny.zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-9-Penny.Zheng@arm.com>
 <39187006-6220-4b76-ada4-9e5be72b60fe@xen.org>
 <7e73b11b-ae4b-a4fb-f9bd-9a95be41d664@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <7e73b11b-ae4b-a4fb-f9bd-9a95be41d664@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 05/07/2023 05:49, Penny Zheng wrote:
> Hi Julien

Hi,

> On 2023/7/5 05:46, Julien Grall wrote:
>> Hi Penny,
>>
>> On 26/06/2023 04:33, Penny Zheng wrote:
>>> From: Wei Chen <wei.chen@arm.com>
>>>
>>> There are lots of MMU specific code in head.S. This code will not
>>> be used in MPU systems. If we use #ifdef to gate them, the code
>>> will become messy and hard to maintain. So we move MMU related
>>> code to mmu/head.S, and keep common code still in head.S. We also
>>> add .text.idmap in mmu/head.S to make all code in this new file
>>> are still in identity map page but will be linked after head.S.
>>>
>>> As "fail" in head.S is very simple and this name is too easy to
>>> be conflicted, so duplicate it in mmu/head.S instead of exporting
>>> it.
>>>
>>> And some assembly macros that will be shared by MMU and MPU later,
>>> we move them to macros.h.
>>
>> Aren't those macros already shared between head.S and mmu/head.S?
>>
> 
> Correct me if I understand wrongly, so you want to remove the mention of 
> MPU, and rephrase it to

So far, I am asking whether all the macros moved in macros.h are shared 
between mmu/head.S and head.S. If they are then...

> "
> As some assembly macros need to be shared by head.S and mmu/head.S,
> we will move them to macros.h.
> "

... yes this is the rephrase I would like to see.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 10:17:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 10:17:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559019.873665 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzZg-0000rw-7P; Wed, 05 Jul 2023 10:17:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559019.873665; Wed, 05 Jul 2023 10:17:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzZg-0000rp-4n; Wed, 05 Jul 2023 10:17:28 +0000
Received: by outflank-mailman (input) for mailman id 559019;
 Wed, 05 Jul 2023 10:17:26 +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
 <SRS0=TfY/=CX=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qGzZe-0000rj-JG
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 10:17:26 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2074.outbound.protection.outlook.com [40.107.7.74])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2218d24b-1b1d-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 12:17:24 +0200 (CEST)
Received: from DB8PR06CA0059.eurprd06.prod.outlook.com (2603:10a6:10:120::33)
 by GV2PR08MB8438.eurprd08.prod.outlook.com (2603:10a6:150:bc::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 10:16:47 +0000
Received: from DBAEUR03FT036.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:120:cafe::6d) by DB8PR06CA0059.outlook.office365.com
 (2603:10a6:10:120::33) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 10:16:47 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT036.mail.protection.outlook.com (100.127.142.193) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.22 via Frontend Transport; Wed, 5 Jul 2023 10:16:46 +0000
Received: ("Tessian outbound 546d04a74417:v142");
 Wed, 05 Jul 2023 10:16:46 +0000
Received: from 20d070d6f704.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 AD7B940E-5B18-4841-B6ED-01FBE54B8FA0.1; 
 Wed, 05 Jul 2023 10:16:40 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 20d070d6f704.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 10:16:40 +0000
Received: from DU2PR04CA0029.eurprd04.prod.outlook.com (2603:10a6:10:3b::34)
 by AM8PR08MB5617.eurprd08.prod.outlook.com (2603:10a6:20b:1dc::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 10:16:38 +0000
Received: from DBAEUR03FT060.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:3b:cafe::97) by DU2PR04CA0029.outlook.office365.com
 (2603:10a6:10:3b::34) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 10:16:38 +0000
Received: from nebula.arm.com (40.67.248.234) by
 DBAEUR03FT060.mail.protection.outlook.com (100.127.142.238) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.18 via Frontend Transport; Wed, 5 Jul 2023 10:16:38 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com
 (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 5 Jul
 2023 10:16:36 +0000
Received: from [10.169.188.49] (10.169.188.49) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Wed, 5 Jul 2023 10:16:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2218d24b-1b1d-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=lGKcRV8ZVxRk6HkQxNgVHoGgzsREVbM/znqOXqnir2w=;
 b=OMeCyu5UTF8aQxFJvjVIiXOLeg+QhgkNd34nafXrYafPXLmgn/MG6b0XQYNPCtpAoeQxFzfECdUxBEfJFfKK93kU4wZ1xFkuTCdGqtXAZYjK7s4qJHSnCyBZYRub0AzZgiVDr2ykynwsGRdT4+p8wk1DwQODsZKOYca83AIcLjw=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 8b806ed44ce0801b
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=oYEAq32Ne4gRIEJ3N0LEY+ZKmj9wtLFJlYxyeG2q/gKqRO3xezT2oryxzkPRFXQgfE4jP1Iuk8vdsu2RYmT/aeyOwFWwTQW+fuz1yde7syd/LZ6FcsiZH8ToAibX6hgUKDydYwcXOAi3q/JWaxjzxfeppQ1c+E8l6J+VS6cIhtTg1MnT5Q1Q9PG7mbGuv6r3jDfNOfp6JkfaqN5xP0cBo8n4mqwSdtxNNEKcPO+GFDKi2zc0BRm+UBeyvkB1rMeXAZx2OAe+lySd5XacjD3YdCCFSegjC0v+vgD2vje3ggiMJp5C1bmf8vxf/aT4vHaxXKT0a1czEONTG3qQl2PM7w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=lGKcRV8ZVxRk6HkQxNgVHoGgzsREVbM/znqOXqnir2w=;
 b=g4X+4C+7/HftVooZ617XIWiUdOR8zI5QVbLMPPTeRzy4C3n47s6Hl3Cwk2o2UB0izwl1JKLYQ9hx+DlG88Ytdrz8MXx4xjjT6Xh9CvtD4L7bKRo7V0eHkhZ8nIOLw11eEq6s7s3xCppZuVUJoMpE6OzrgQ7WgCvBVsfvEnmwsBWeJtx6tvv73RAy/9MW3OqWskDFb4TyDF7t8UtHR/OMkRPkrDzD4qEADEN2jHuWSDgOHrf0Nd74dNlyjox92nWcZeHSkcjHty8heT6VjejcSbCfinZ5oPeSfdSeydinw7YEJjb4IJ0l+UQ7v15lGJXC+Hicr5Ew9pY1TOGRIAybaQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=amd.com smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=lGKcRV8ZVxRk6HkQxNgVHoGgzsREVbM/znqOXqnir2w=;
 b=OMeCyu5UTF8aQxFJvjVIiXOLeg+QhgkNd34nafXrYafPXLmgn/MG6b0XQYNPCtpAoeQxFzfECdUxBEfJFfKK93kU4wZ1xFkuTCdGqtXAZYjK7s4qJHSnCyBZYRub0AzZgiVDr2ykynwsGRdT4+p8wk1DwQODsZKOYca83AIcLjw=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <add845b8-31c1-52a6-18ff-b19a6cb6ef38@arm.com>
Date: Wed, 5 Jul 2023 18:16:32 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 35/52] xen/arm: map static memory on demand
Content-Language: en-US
To: Ayan Kumar Halder <ayankuma@amd.com>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-36-Penny.Zheng@arm.com>
 <16428e2d-423c-6a9c-5caa-6ff5770a840e@amd.com>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <16428e2d-423c-6a9c-5caa-6ff5770a840e@amd.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	DBAEUR03FT060:EE_|AM8PR08MB5617:EE_|DBAEUR03FT036:EE_|GV2PR08MB8438:EE_
X-MS-Office365-Filtering-Correlation-Id: ec4e92d9-b1a7-4742-d471-08db7d40f075
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 p145TI0F01eFD7sN9pfhOwbmoSzOKaqaG1Ro8D0hInQC2/O8la49SPT7OUPIuWF+NqQBW0+LkYj16PrU3wmDmA+Bhgor+uL9GKt7qJMHa1IqNFr5KlUl/S9l4Dw+c7kg4/1CkyqHUMLZ/wPuyfHOHPNiphfPqN50JP9PHs1h/7tKqRpPFjnwIgUSk/YPHpfts7RXtChJKoYIVix+g2OuQ65rIDvPzp5DnnactZ/iu2LDm+7By370BXAfjsdMkPYbhd9yWpp2lcXmb28k6wYXrrRq0JuXjC71Z31/S/h00Inxx4roXh79izJ1xwgycjxdrWaamp0qH+HGP/uFnrnCRsq7eDhwgJ/h1Hj1tgHFf+wBIBywQ51tIbsULDQQdphAyxUvC/gzj9uyUSTeL+xLUTCf7wcBcmq32iGRPuUkAJLGoDLGWoCKMUW+CY6H2gd4WhYA7EmxVwh6Luz8Ac5IHUdx0Jo3lMu3oWiNpRpvuuu3X0A5rtCmUvYRxRlVUv2l2Co4ZHuEFji2nG74b0aN08F6w0sqoDPtj/MQjWS03SBZ9OhTzjscuY6F0kN9ALhfAzhzUahMA7dbsl/oxViR7FmfD7e0RcYhm4ZsscD33o7gPpDNBeK6qHWfTsrQG/nhGs5zIfGXVJi+WITvs7Z4rVhJqD0AMnlQvi1h6ZEg17od6N1VclSrKgWK35lmMxll+hLrt8LnQ8Nd1S/yujEmgCRMszp9nrmDLUHX2vYosbK7ybufE1ruZcfueGZxeHbN60fLSCiqhGEglV46Af/dft4ZGXP5mMWZefDqI8aVD1Iyig8lTG+B+jpX1ijmR9V1zrUev5wtvfgxiikP81+6vv25J44KM1UZU4xteDjCINc=
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(376002)(346002)(396003)(451199021)(40470700004)(46966006)(36840700001)(31686004)(2906002)(82310400005)(44832011)(336012)(5660300002)(86362001)(2616005)(40480700001)(36860700001)(31696002)(70206006)(8676002)(8936002)(53546011)(110136005)(54906003)(478600001)(16576012)(26005)(186003)(356005)(82740400003)(426003)(47076005)(40460700003)(81166007)(83380400001)(4326008)(70586007)(36756003)(316002)(41300700001)(3940600001)(21314003)(36900700001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5617
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT036.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	016afb09-63e1-4647-ee93-08db7d40eb43
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	kMv0/TBR7Fxmb2iFBPSGN4LQsrBPeKCuc+MdkCe/VvuZFgmmvU48JR0jsCxmkOzoBaX0KKnZRiJmNOgZWkZzRJJa/1d93Q86zaK6ArTQchOBHTIkWAL9Jn1AelXdF9IkxbQqKS6eIeDYQ/C8XTyzkK07NSb6F2wtlDKokI9vh+S+4zAdXd+o5pGeCuyS69wn35elLeQ34m0bpyUnd9Cnk+wuEd124k9gVrCyIgJQckw71H9LOXO2Fgx9erObXq1o9lJgVL8jax5wOK5kxUKUI0jjoLNnrlrb1aMNOhQXpTz2OQbZnnD636xPp8EQzyZlbA5gGyO8s0PC9ZzwPMT8zPzSPsk+bobMCiFtV4ZsPCf3hPOyxLssuh7dmUc+GMo3f3XPfcTzu0GUPvDM4ILzkZhU7J+mU139zM5AMYV7AHGZIrQHxj8aUb2JTEYEpime9KnKNosLPT4EZXrLr/7BS1uICXCsz6vpehl/iXZkwPMwFFrZ5lhP3YcRDpF1gRy4Qy9ARY+sSdBGOclxokb5kYG/GxP1Ls/ABIWG/HZr0OS9x90jBr9TygU41Q15rWFGBYzdZvsrAZiL+jWWDBT+DE3C/0z56e1/qh2YCKiG2Vd8qr0/1K0ggehuBE9r4wNudgG3qs4cnmpJFBggi28KP4rOtsYnuyl9hgO9CQPOZbV5QfvRzxLsZq7O/YrHvaHaSC6jlhadk3F4ye0Fsi6rn2Oly4rpMRZWNzXAAt1VmxEbld2Sia6pZlx3hzgwpUwxODUlabrprW/L9CvMu1YlI4lVQrA0CEzOKMxDxWqreDdBq5ckkW5ipfSZykhWDBKTBKyVaeXXSWemBD/veFcAUA==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(376002)(346002)(39860400002)(451199021)(46966006)(40470700004)(36840700001)(31686004)(44832011)(2906002)(4326008)(478600001)(316002)(70586007)(70206006)(8676002)(8936002)(5660300002)(36756003)(40460700003)(336012)(31696002)(41300700001)(40480700001)(36860700001)(86362001)(110136005)(16576012)(54906003)(82310400005)(186003)(53546011)(2616005)(26005)(47076005)(81166007)(426003)(83380400001)(82740400003)(21314003)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 10:16:46.8533
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ec4e92d9-b1a7-4742-d471-08db7d40f075
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT036.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8438

Hi Ayan

On 2023/7/4 23:10, Ayan Kumar Halder wrote:
> Hi Penny,
> 
> On 26/06/2023 04:34, Penny Zheng wrote:
>> CAUTION: This message has originated from an External Source. Please 
>> use proper judgment and caution when opening attachments, clicking 
>> links, or responding to this email.
>>
>>
>> In function init_staticmem_pages, we need the access to static memory
>> for proper initialization.
>> It is not a problem in MMU system, as Xen map the whole RAM in
>> setup_mm(). However, with limited MPU memory regions, it is too luxury
>> to map the whole RAM.
>> As a result, we follow the rule of "map on demand", to map static memory
>> temporarily before its initialization, and unmap immediately after its
>> initialization.
> 
> I could see that you are using _PAGE_TRANSIENTÂ  to map memory 
> temporarily. However, I don't see this being translated to any of the 
> MPU hardware features (ie _PAGE_TRANSIENT does not seem to translate to 
> any of the attributes in PRBAR, PRLAR, PRENR, etc). Thus, how is it 
> different from mapping the memory in "non temporary" way ?
> 

It is only software feature.
It is designed for implementing functions like ioremap_xxx(), or 
map_staticmem_pages_to_xen() here, which are always occuring with its 
reverse unmapping function nearby like iounmap(), or 
unmap_staticmem_pages_to_xen(), to map a chunk of memory *temporarily*, 
for a very short time.
I want to check this flag in the unmapping function, to ensure that we 
are unmapping the proper MPU region.

Fixed MPU regions are like Xen text section, Xen data section, etc.

> Please let me know what I am missing.
> 
> - Ayan
> 
>>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> ---
>> v3:
>> - new commit
>> ---
>> Â  xen/arch/arm/include/asm/mm.h |Â  2 ++
>> Â  xen/arch/arm/mmu/mm.cÂ Â Â Â Â Â Â Â  | 10 ++++++++++
>> Â  xen/arch/arm/mpu/mm.cÂ Â Â Â Â Â Â Â  | 10 ++++++++++
>> Â  xen/arch/arm/setup.cÂ Â Â Â Â Â Â Â Â  | 21 +++++++++++++++++++++
>> Â  4 files changed, 43 insertions(+)
>>
>> diff --git a/xen/arch/arm/include/asm/mm.h 
>> b/xen/arch/arm/include/asm/mm.h
>> index 66d98b9a29..cffbf8a595 100644
>> --- a/xen/arch/arm/include/asm/mm.h
>> +++ b/xen/arch/arm/include/asm/mm.h
>> @@ -224,6 +224,8 @@ extern void mm_init_secondary_cpu(void);
>> Â  extern void setup_frametable_mappings(paddr_t ps, paddr_t pe);
>> Â  /* map a physical range in virtual memory */
>> Â  void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned int 
>> attributes);
>> +extern int map_staticmem_pages_to_xen(paddr_t start, paddr_t end);
>> +extern int unmap_staticmem_pages_to_xen(paddr_t start, paddr_t end);
>>
>> Â  static inline void __iomem *ioremap_nocache(paddr_t start, size_t len)
>> Â  {
>> diff --git a/xen/arch/arm/mmu/mm.c b/xen/arch/arm/mmu/mm.c
>> index 2f29cb53fe..4196a55c32 100644
>> --- a/xen/arch/arm/mmu/mm.c
>> +++ b/xen/arch/arm/mmu/mm.c
>> @@ -1113,6 +1113,16 @@ int populate_pt_range(unsigned long virt, 
>> unsigned long nr_mfns)
>> Â Â Â Â Â  return xen_pt_update(virt, INVALID_MFN, nr_mfns, _PAGE_POPULATE);
>> Â  }
>>
>> +int __init map_staticmem_pages_to_xen(paddr_t start, paddr_t end)
>> +{
>> +Â Â Â  return 0;
>> +}
>> +
>> +int __init unmap_staticmem_pages_to_xen(paddr_t start, paddr_t end)
>> +{
>> +Â Â Â  return 0;
>> +}
>> +
>> Â  /*
>> Â Â  * Local variables:
>> Â Â  * mode: C
>> diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
>> index a40055ae5e..9d5c1da39c 100644
>> --- a/xen/arch/arm/mpu/mm.c
>> +++ b/xen/arch/arm/mpu/mm.c
>> @@ -614,6 +614,16 @@ void __init setup_frametable_mappings(paddr_t ps, 
>> paddr_t pe)
>> Â Â Â Â Â Â Â Â Â Â Â Â  frametable_size - (nr_pdxs * sizeof(struct page_info)));
>> Â  }
>>
>> +int __init map_staticmem_pages_to_xen(paddr_t start, paddr_t end)
>> +{
>> +Â Â Â  return xen_mpumap_update(start, end, PAGE_HYPERVISOR | 
>> _PAGE_TRANSIENT);
>> +}
>> +
>> +int __init unmap_staticmem_pages_to_xen(paddr_t start, paddr_t end)
>> +{
>> +Â Â Â  return xen_mpumap_update(start, end, 0);
>> +}
>> +
>> Â  /*
>> Â Â  * Local variables:
>> Â Â  * mode: C
>> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
>> index f42b53d17b..c21d1db763 100644
>> --- a/xen/arch/arm/setup.c
>> +++ b/xen/arch/arm/setup.c
>> @@ -637,12 +637,33 @@ void __init init_staticmem_pages(void)
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_t bank_start = 
>> _mfn(PFN_UP(bootinfo.reserved_mem.bank[bank].start));
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned long bank_pages = 
>> PFN_DOWN(bootinfo.reserved_mem.bank[bank].size);
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_t bank_end = mfn_add(bank_start, bank_pages);
>> +Â Â Â Â Â Â Â Â Â Â Â  int res;
>>
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  if ( mfn_x(bank_end) <= mfn_x(bank_start) )
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  return;
>>
>> +Â Â Â Â Â Â Â Â Â Â Â  /* Map temporarily before initialization */
>> +Â Â Â Â Â Â Â Â Â Â Â  res = map_staticmem_pages_to_xen(mfn_to_maddr(bank_start),
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_to_maddr(bank_end));
>> +Â Â Â Â Â Â Â Â Â Â Â  if ( res )
>> +Â Â Â Â Â Â Â Â Â Â Â  {
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  printk(XENLOG_ERR "Failed to map static memory to 
>> Xen: %d\n",
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  res);
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  return;
>> +Â Â Â Â Â Â Â Â Â Â Â  }
>> +
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  unprepare_staticmem_pages(mfn_to_page(bank_start),
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  bank_pages, false);
>> +
>> +Â Â Â Â Â Â Â Â Â Â Â  /* Unmap immediately after initialization */
>> +Â Â Â Â Â Â Â Â Â Â Â  res = unmap_staticmem_pages_to_xen(mfn_to_maddr(bank_start),
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_to_maddr(bank_end));
>> +Â Â Â Â Â Â Â Â Â Â Â  if ( res )
>> +Â Â Â Â Â Â Â Â Â Â Â  {
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  printk(XENLOG_ERR "Failed to unmap static memory to 
>> Xen: %d\n",
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  res);
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  return;
>> +Â Â Â Â Â Â Â Â Â Â Â  }
>> Â Â Â Â Â Â Â Â Â  }
>> Â Â Â Â Â  }
>> Â  #endif
>> -- 
>> 2.25.1
>>
>>


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 10:21:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 10:21:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559025.873674 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzd3-0002La-PN; Wed, 05 Jul 2023 10:20:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559025.873674; Wed, 05 Jul 2023 10:20:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzd3-0002LT-Ml; Wed, 05 Jul 2023 10:20:57 +0000
Received: by outflank-mailman (input) for mailman id 559025;
 Wed, 05 Jul 2023 10:20:56 +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
 <SRS0=TfY/=CX=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qGzd1-0002LL-VB
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 10:20:56 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20626.outbound.protection.outlook.com
 [2a01:111:f400:7d00::626])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9f312ac9-1b1d-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 12:20:53 +0200 (CEST)
Received: from AM6PR0502CA0069.eurprd05.prod.outlook.com
 (2603:10a6:20b:56::46) by AS1PR08MB7474.eurprd08.prod.outlook.com
 (2603:10a6:20b:4de::13) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 10:20:44 +0000
Received: from AM7EUR03FT015.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:56:cafe::9) by AM6PR0502CA0069.outlook.office365.com
 (2603:10a6:20b:56::46) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 10:20:44 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT015.mail.protection.outlook.com (100.127.140.173) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.24 via Frontend Transport; Wed, 5 Jul 2023 10:20:44 +0000
Received: ("Tessian outbound d6c4ee3ba1eb:v142");
 Wed, 05 Jul 2023 10:20:43 +0000
Received: from 0b1ad951777f.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 15A9EEE9-FF19-4B60-B8DA-8ABC7D228B35.1; 
 Wed, 05 Jul 2023 10:20:38 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0b1ad951777f.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 10:20:38 +0000
Received: from DBBPR09CA0030.eurprd09.prod.outlook.com (2603:10a6:10:d4::18)
 by AM9PR08MB5873.eurprd08.prod.outlook.com (2603:10a6:20b:2dd::17) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 10:20:33 +0000
Received: from DBAEUR03FT055.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:d4:cafe::8) by DBBPR09CA0030.outlook.office365.com
 (2603:10a6:10:d4::18) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 10:20:33 +0000
Received: from nebula.arm.com (40.67.248.234) by
 DBAEUR03FT055.mail.protection.outlook.com (100.127.142.171) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.22 via Frontend Transport; Wed, 5 Jul 2023 10:20:33 +0000
Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com
 (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 5 Jul
 2023 10:20:32 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com
 (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 5 Jul
 2023 10:20:32 +0000
Received: from [10.169.188.49] (10.169.188.49) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Wed, 5 Jul 2023 10:20:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9f312ac9-1b1d-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Sqve7jRIF2F2L+4fzmXf8o3N3GXZG2uKad+g8Ckc4AA=;
 b=iWepzbcVsO798Hoc3vrSfL7XteyFyh8QVngqFO/7hb8XznlzS2LPbYdAcU/n7jsDU4cD7CgUotIUBKaCHoB/YTX+ExLo63xrBSelVBEWIa8VuiWgykwGNLjT1L6BAua/uPyccNcHDo5f1n4n16yEPdH/pDveUZbBcplY4eV6PVQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 2dcd6158c96eef2d
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=oCkuLjakX4nDSMtaUMJ6LhFC7s1LJ7i9NHHHjNju0mNTJCvfxfktYqaSgc4j2/zokyqfbRZPrQGP9PYooWmR7j+LPPc4k4c2EsbqzB0GULQrEmmvTM6RHKTlR/eSNDkVJEHjz4Y01KyjlW6AZ3t566vEWnbYqtuxI8lKefaFuXua6opNxz0cNjRXFsEyhyxuGv3s9Pp3p/Qg84Fj3RdT88Aq3ewNMfXGxOJNvevu/tb4/+HDEf7wE4kf1QBOinO6248FnwhnaI5y0hplLkRv90ErVwy4pPEd6AIAkLK2vxdPgOwNFBowOkaEgU1L/mAfu4ZC+uIlQRUznB9HyXPkog==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Sqve7jRIF2F2L+4fzmXf8o3N3GXZG2uKad+g8Ckc4AA=;
 b=b+JKO4pdWGQ80AOJF2SZihhjTOdpgmbTKZ0M978FxO5XdMjxPP9u4xadzXpsZtBMbD2KnWoaqu2gjcr9BxGXwjXbzxieU+ZxBFHBXRGRIxLdcvwBMg9fQ2Sx5hPLFBFLHKKAyvC9CN/YzlF1iqJCiUyVi4JDgq61k/Ax1twj16fbw55xvT4yz+8ZQUIVWaRiyv64RREayYzk0OnI9r7fIQwrlWCJ9vwZ8BQpObICk4/vGw+/2Zvm6YN1Gs6YPFp1eE8qQ8YUxz/0Gr8KTh5Lf+XzGhBvQD+2/s1yaD2htF7CpKRl//6pZvMq953xbTNNdEiR3CzJ/NtWkUUn6tS6iw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=amd.com smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Sqve7jRIF2F2L+4fzmXf8o3N3GXZG2uKad+g8Ckc4AA=;
 b=iWepzbcVsO798Hoc3vrSfL7XteyFyh8QVngqFO/7hb8XznlzS2LPbYdAcU/n7jsDU4cD7CgUotIUBKaCHoB/YTX+ExLo63xrBSelVBEWIa8VuiWgykwGNLjT1L6BAua/uPyccNcHDo5f1n4n16yEPdH/pDveUZbBcplY4eV6PVQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <73eade6e-94c6-ecc6-f369-5abc5a7dc86d@arm.com>
Date: Wed, 5 Jul 2023 18:20:28 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 42/52] xen/mpu: implement setup_virt_paging for MPU
 system
Content-Language: en-US
To: Ayan Kumar Halder <ayankuma@amd.com>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-43-Penny.Zheng@arm.com>
 <516dc7aa-4487-cd7c-f9dc-42738314e3f4@amd.com>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <516dc7aa-4487-cd7c-f9dc-42738314e3f4@amd.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	DBAEUR03FT055:EE_|AM9PR08MB5873:EE_|AM7EUR03FT015:EE_|AS1PR08MB7474:EE_
X-MS-Office365-Filtering-Correlation-Id: 1402db50-14bd-4474-fa94-08db7d417ded
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 F98aMAKUcSiaiAygu6n8/J1m/U5W9F7ITzw4O/KMNn9kpnyyfJUfHHKUn1HQuzjDhXeWmPfq3hGPLPMswjOJrw9SwKvZSDdzLRCWgLW2XQ9kFtzYN3A1sRlFU+O1SGbhbab7hA1pfueUNJR2CD1HviMYM7awzd2dlw1fq/CgeBplBDRmDnXWBcD7cIdKFMJZXS2736evoc4yrSB4fpKqrCTpSXRv/66FZQltcFLsLVVdocfGsPLL9fjgg+HgW5qpYIpx+2xHgQrCS1rtBCFwyMtryiYHZ+KKm4LqJGWerO45lxW7DKSKKR2GbytY07M9sWfaGL8mqoe/HfHD56dw9dAAd4pmSJ19F3Ru9S7FzLiaQOjUSnNaaeSKBvYAOFYtmTN7D2OBm3GjNobT21k4qn+siwzlEMUpyJitsLlIfpTdg0tZnhl9xB2OBsNsz6i05tclxFx7W5TCNv4UrCR/ZvyX3OZwzzAfoOkdaH1oHwW92Ng1z6r1b5TtxfLnS54CTiq5ffXbAVBp4M6clQBpUwW18vszWrdD6Fr6HHxGInoB3GTs2j9rPY4hJZFCiotZ9J28COIyJrZhB1oRke85IPCo//OyoPbGoEFv04QLmF6m2QQVfzZkRNKQsMbkD2nUk/qwuRKdVQpwMrg1k8maQ1csTMOIIjaxELTI4YH/X3qrY+tgjkSOb5oh45jVW4XP2T0mMD3G9TReQ0eP+nt4YVC2cHrVM6bYl9U1s8uKSjti6UydNS5/NkmtSfzML+EgqUWC0ioPOdJ9b8F8AiAz+6vMBY3LTyGW9OoAba7/RoJ75uDQ6JQk0Gi24u46ZRM+JCRIMhAGULgFFZAZF0fONw==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(396003)(136003)(376002)(451199021)(40470700004)(46966006)(36840700001)(478600001)(110136005)(54906003)(47076005)(53546011)(2906002)(426003)(316002)(336012)(26005)(186003)(82310400005)(16576012)(8936002)(70586007)(5660300002)(44832011)(4326008)(41300700001)(70206006)(8676002)(82740400003)(356005)(81166007)(86362001)(36756003)(31696002)(40480700001)(40460700003)(36860700001)(2616005)(83380400001)(31686004)(3940600001)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB5873
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT015.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	1e1f2c50-6aa4-4e0b-35f4-08db7d417746
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	mLVrYPBPPat2xJ5wPFsSjfT5u7sDrP0PVjdbf84PEyyppFirClUZMOSD+Avo/yCvRDPj5nc1QmbyhGVVRHQmQ4FANa4OYC92tNEHQe6qLMy0SLcR3aoWYvjhTplnd2sC1iufIkl/2cYEEVbP5uamLlcOMdQX4FbObTuHhRCIJ46krP4Y8Z4vRFwa9b/cWpQn2rSg7o29+tfMNTVBWLqS+IUOMTlUByDW9slbp6KRRjS47FaJ1qUN3weEiDOE9Ix2cYuDer+mrAU/gVVyXUHGSxq1qq+k+p8d6Mr3bu2fWfglYTX+ycD5zcCKfqg16bEtoBoxytekpbMRf0PSdfZ4Ngm7z/uDare/I31MWEgbgOyr39AjjeECDT6dRGZzNrfB4wJ8t6hWn0cuMbH9AVp/4Hf//0AEuTckt+C9KgLzWERiWMhHQetSslwmH9vfaddry8ip3+pBjU1KfdyukWEEuviJmXxeXx8v9dCMPj0ZPcUjFmRFHU5v1avw78BsEZzsSlM+OfSpV5ammcW61+/vqWmjqk4SnbL08PquwsUgVufzJJ5WJOu6hkBirje6IYqx2PYFxJ2o8jhHaZm6kjaSr0gEUqvT0t9Az+pdVpw3PeBs6upT3XQYa/9eSsVmCHVei6NFfZV16y00pnTw8Q5j3zQa4+Ya3tr4CNjtrLzNkmF44f5QhTtf/FoUN7fSL3qRzt7rrLy4vTgfmCJf6th6LZuAs30uj1HWjZ2UMEs12DzZSq/sOMikSsjPXAGHFZpZBuLz9h1FA3hUAFSxvcK8n4GjNRPWMAtHrN2vSAi2jAE=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(376002)(346002)(39860400002)(451199021)(46966006)(40470700004)(36840700001)(316002)(16576012)(70586007)(5660300002)(86362001)(70206006)(110136005)(41300700001)(4326008)(8936002)(82310400005)(8676002)(186003)(26005)(336012)(44832011)(53546011)(31696002)(31686004)(54906003)(478600001)(426003)(2906002)(2616005)(83380400001)(40460700003)(47076005)(36860700001)(40480700001)(36756003)(82740400003)(81166007)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 10:20:44.1526
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 1402db50-14bd-4474-fa94-08db7d417ded
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT015.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR08MB7474

Hi Ayan

On 2023/7/5 01:49, Ayan Kumar Halder wrote:
> Hi Penny,
> 
> Most of these are specific to ARM_64, thus we can add "#ifdef 
> CONFIG_ARM_64" as follows :-

Yes, you're right.

> 
> On 26/06/2023 04:34, Penny Zheng wrote:
>> CAUTION: This message has originated from an External Source. Please 
>> use proper judgment and caution when opening attachments, clicking 
>> links, or responding to this email.
>>
>>
>> For MMU system, setup_virt_paging is used to configure stage 2 address
>> translation regime, like IPA bits, VMID allocator set up, etc.
>> Some could be inherited in MPU system, like VMID allocator set up, etc.
>>
>> For MPU system, we could have the following memory translation regime:
>> - PMSAv8-64 at both EL1/EL0 and EL2
>> - VMSAv8-64 at EL1/EL0 and PMSAv8-64 at EL2
>> The default option will be the second, unless the platform could not 
>> support,
>> which could be checked against MSA_frac bit in Memory Model Feature 
>> Register 0(
>> ID_AA64MMFR0_EL1).
>>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> ---
>> v3:
>> - no change
>> ---
>> Â  xen/arch/arm/MakefileÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  1 +
>> Â  xen/arch/arm/include/asm/cpufeature.h |Â  7 ++
>> Â  xen/arch/arm/include/asm/p2m.hÂ Â Â Â Â Â Â  |Â  8 +++
>> Â  xen/arch/arm/include/asm/processor.hÂ  | 13 ++++
>> Â  xen/arch/arm/mpu/p2m.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â  | 92 +++++++++++++++++++++++++++
>> Â  5 files changed, 121 insertions(+)
>> Â  create mode 100644 xen/arch/arm/mpu/p2m.c
>>
>> diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
>> index feb49640a0..9f4b11b069 100644
>> --- a/xen/arch/arm/Makefile
>> +++ b/xen/arch/arm/Makefile
>> @@ -47,6 +47,7 @@ obj-y += mmu/p2m.o
>> Â  else
>> Â  obj-y += mpu/mm.o
>> Â  obj-y += mpu/setup.o
>> +obj-y += mpu/p2m.o
>> Â  endif
>> Â  obj-y += mm.o
>> Â  obj-y += monitor.o
>> diff --git a/xen/arch/arm/include/asm/cpufeature.h 
>> b/xen/arch/arm/include/asm/cpufeature.h
>> index 894f278a4a..cbaf41881b 100644
>> --- a/xen/arch/arm/include/asm/cpufeature.h
>> +++ b/xen/arch/arm/include/asm/cpufeature.h
>> @@ -250,6 +250,12 @@ struct cpuinfo_arm {
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned long tgranule_16K:4;
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned long tgranule_64K:4;
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned long tgranule_4K:4;
>> +#ifdef CONFIG_HAS_MPU
>> +Â Â Â Â Â Â Â Â Â Â Â  unsigned long __res:16;
>> +Â Â Â Â Â Â Â Â Â Â Â  unsigned long msa:4;
>> +Â Â Â Â Â Â Â Â Â Â Â  unsigned long msa_frac:4;
>> +Â Â Â Â Â Â Â Â Â Â Â  unsigned long __res0:8;
>> +#else
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned long tgranule_16k_2:4;
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned long tgranule_64k_2:4;
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned long tgranule_4k_2:4;
>> @@ -257,6 +263,7 @@ struct cpuinfo_arm {
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned long __res0:8;
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned long fgt:4;
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned long ecv:4;
>> +#endif
>>
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  /* MMFR1 */
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned long hafdbs:4;
>> diff --git a/xen/arch/arm/include/asm/p2m.h 
>> b/xen/arch/arm/include/asm/p2m.h
>> index f62d632830..d9c91d4a98 100644
>> --- a/xen/arch/arm/include/asm/p2m.h
>> +++ b/xen/arch/arm/include/asm/p2m.h
>> @@ -16,8 +16,16 @@ extern unsigned int p2m_ipa_bits;
>>
>> Â  extern unsigned int p2m_root_order;
>> Â  extern unsigned int p2m_root_level;
>> +#ifdef CONFIG_HAS_MPU
>> +/*
>> + * A 4KB Page is enough for stage 2 translation in MPU system, which 
>> could
>> + * store at most 255 EL2 MPU memory regions.
>> + */
>> +#define P2M_ROOT_ORDER 0
>> +#else
>> Â  #define P2M_ROOT_ORDERÂ Â Â  p2m_root_order
>> Â  #define P2M_ROOT_LEVEL p2m_root_level
>> +#endif
>>
>> Â  #define MAX_VMID_8_BITÂ  (1UL << 8)
>> Â  #define MAX_VMID_16_BIT (1UL << 16)
>> diff --git a/xen/arch/arm/include/asm/processor.h 
>> b/xen/arch/arm/include/asm/processor.h
>> index 685f9b18fd..fe761ce50f 100644
>> --- a/xen/arch/arm/include/asm/processor.h
>> +++ b/xen/arch/arm/include/asm/processor.h
>> @@ -389,6 +389,12 @@
>>
>> Â  #define VTCR_RES1Â Â Â Â Â Â  (_AC(1,UL)<<31)
>>
>> +#ifdef CONFIG_HAS_MPU
> && ARM_64 /* As these are specific to ID_AA64MMFR0EL1 */

Will do

>> +#define VTCR_MSA_VMSAÂ Â  (_AC(0x1,UL)<<31)
>> +#define VTCR_MSA_PMSAÂ Â  ~(_AC(0x1,UL)<<31)
>> +#define NSA_SEL2Â Â Â Â Â Â Â  ~(_AC(0x1,UL)<<30)
>> +#endif
>> +
>> Â  /* HCPTR Hyp. Coprocessor Trap Register */
>> Â  #define HCPTR_TAMÂ Â Â Â Â Â  ((_AC(1,U)<<30))
>> Â  #define HCPTR_TTAÂ Â Â Â Â Â  ((_AC(1,U)<<20))Â Â Â Â Â Â Â  /* Trap trace 
>> registers */
>> @@ -449,6 +455,13 @@
>> Â  #define MM64_VMID_16_BITS_SUPPORTÂ Â  0x2
>> Â  #endif
>>
>> +#ifdef CONFIG_HAS_MPU
> && ARM_64 /* As these are specific to ID_AA64MMFR0EL1 */

Will do

>> +#define MM64_MSA_PMSA_SUPPORTÂ Â Â Â Â Â  0xf
>> +#define MM64_MSA_FRAC_NONE_SUPPORTÂ  0x0
>> +#define MM64_MSA_FRAC_PMSA_SUPPORTÂ  0x1
>> +#define MM64_MSA_FRAC_VMSA_SUPPORTÂ  0x2
>> +#endif
>> +
>> Â  #ifndef __ASSEMBLY__
>>
>> Â  extern register_t __cpu_logical_map[];
>> diff --git a/xen/arch/arm/mpu/p2m.c b/xen/arch/arm/mpu/p2m.c
>> new file mode 100644
>> index 0000000000..04c44825cb
>> --- /dev/null
>> +++ b/xen/arch/arm/mpu/p2m.c
>> @@ -0,0 +1,92 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +#include <xen/lib.h>
>> +#include <xen/mm-frame.h>
>> +#include <xen/sched.h>
>> +#include <xen/warning.h>
>> +
>> +#include <asm/p2m.h>
>> +#include <asm/processor.h>
>> +#include <asm/sysregs.h>
>> +
>> +void __init setup_virt_paging(void)
>> +{
>> +Â Â Â  uint64_t val = 0;
>> +Â Â Â  bool p2m_vmsa = true;
>> +
>> +Â Â Â  /* PA size */
>> +Â Â Â  const unsigned int pa_range_info[] = { 32, 36, 40, 42, 44, 48, 
>> 52, 0, /* Invalid */ };
> 
> As this file is common between ARM_32 and ARM_64 and the following is 
> specific to ARM_64, please add
> 
> #ifdef CONFIG_ARM_64

Will do

> 
>> +
>> +Â Â Â  /*
>> +Â Â Â Â  * Restrict "p2m_ipa_bits" if needed. As P2M table is always 
>> configured
>> +Â Â Â Â  * with IPA bits == PA bits, compare against "pabits".
>> +Â Â Â Â  */
>> +Â Â Â  if ( pa_range_info[system_cpuinfo.mm64.pa_range] < p2m_ipa_bits )
>> +Â Â Â Â Â Â Â  p2m_ipa_bits = pa_range_info[system_cpuinfo.mm64.pa_range];
>> +
>> +Â Â Â  /* In ARMV8R, hypervisor in secure EL2. */
>> +Â Â Â  val &= NSA_SEL2;
>> +
>> +Â Â Â  /*
>> +Â Â Â Â  * The MSA and MSA_frac fields in the ID_AA64MMFR0_EL1 register
>> +Â Â Â Â  * identify the memory system configurations supported at EL1.
>> +Â Â Â Â  * In Armv8-R AArch64, the only permitted value for 
>> ID_AA64MMFR0_EL1.MSA is
>> +Â Â Â Â  * 0b1111. When ID_AA64MMFR0_EL1.MSA_frac is 0b0010, the stage 1 
>> of the
>> +Â Â Â Â  * Secure EL1&0 translation regime can enable PMSAv8-64 or VMSAv8-64
>> +Â Â Â Â  * architecture.
>> +Â Â Â Â  */
>> +Â Â Â  if ( system_cpuinfo.mm64.msa == MM64_MSA_PMSA_SUPPORT )
>> +Â Â Â  {
>> +Â Â Â Â Â Â Â  if ( system_cpuinfo.mm64.msa_frac == 
>> MM64_MSA_FRAC_NONE_SUPPORT )
>> +Â Â Â Â Â Â Â Â Â Â Â  goto fault;
>> +
>> +Â Â Â Â Â Â Â  if ( system_cpuinfo.mm64.msa_frac != 
>> MM64_MSA_FRAC_VMSA_SUPPORT )
>> +Â Â Â Â Â Â Â  {
>> +Â Â Â Â Â Â Â Â Â Â Â  p2m_vmsa = false;
>> +Â Â Â Â Â Â Â Â Â Â Â  warning_add("Be aware of that there is no support for 
>> VMSAv8-64 at EL1 on this platform.\n");
>> +Â Â Â Â Â Â Â  }
>> +Â Â Â  }
>> +Â Â Â  else
>> +Â Â Â Â Â Â Â  goto fault;
>> +
>> +Â Â Â  /*
>> +Â Â Â Â  * If PE supports both PMSAv8-64 and VMSAv8-64 at EL1, then 
>> VTCR_EL2.MSA
>> +Â Â Â Â  * determines the memory system architecture enabled at stage 1 
>> of the
>> +Â Â Â Â  * Secure EL1&0 translation regime.
>> +Â Â Â Â  *
>> +Â Â Â Â  * Normally, we set the initial VTCR_EL2.MSA value VMSAv8-64 
>> support,
>> +Â Â Â Â  * unless this platform only supports PMSAv8-64.
>> +Â Â Â Â  */
>> +Â Â Â  if ( !p2m_vmsa )
>> +Â Â Â Â Â Â Â  val &= VTCR_MSA_PMSA;
>> +Â Â Â  else
>> +Â Â Â Â Â Â Â  val |= VTCR_MSA_VMSA;
>> +
>> +Â Â Â  /*
>> +Â Â Â Â  * cpuinfo sanitization makes sure we support 16bits VMID only if
>> +Â Â Â Â  * all cores are supporting it.
>> +Â Â Â Â  */
>> +Â Â Â  if ( system_cpuinfo.mm64.vmid_bits == MM64_VMID_16_BITS_SUPPORT )
>> +Â Â Â Â Â Â Â  max_vmid = MAX_VMID_16_BIT;
>> +
>> +Â Â Â  /* Set the VS bit only if 16 bit VMID is supported. */
>> +Â Â Â  if ( MAX_VMID == MAX_VMID_16_BIT )
>> +Â Â Â Â Â Â Â  val |= VTCR_VS;
>> +
> 
> #endif
> 
> - Ayan
> 
>> +Â Â Â  p2m_vmid_allocator_init();
>> +
>> +Â Â Â  WRITE_SYSREG(val, VTCR_EL2);
>> +
>> +Â Â Â  return;
>> +
>> +fault:
>> +Â Â Â  panic("Hardware with no PMSAv8-64 support in any translation 
>> regime.\n");
>> +}
>> +
>> +/*
>> + * Local variables:
>> + * mode: C
>> + * c-file-style: "BSD"
>> + * c-basic-offset: 4
>> + * indent-tabs-mode: nil
>> + * End:
>> + */
>> -- 
>> 2.25.1
>>
>>


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 10:21:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 10:21:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559029.873684 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzdc-0002q3-2U; Wed, 05 Jul 2023 10:21:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559029.873684; Wed, 05 Jul 2023 10:21:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzdb-0002pw-W2; Wed, 05 Jul 2023 10:21:31 +0000
Received: by outflank-mailman (input) for mailman id 559029;
 Wed, 05 Jul 2023 10:21:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Sl8t=CX=suse.cz=jack@srs-se1.protection.inumbo.net>)
 id 1qGzda-0002n0-Hu
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 10:21:30 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b4d6a8be-1b1d-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 12:21:29 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 58F0C1F6E6;
 Wed,  5 Jul 2023 10:21:29 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 44C0D13460;
 Wed,  5 Jul 2023 10:21:29 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id Xem5EClEpWRSCwAAMHmgww
 (envelope-from <jack@suse.cz>); Wed, 05 Jul 2023 10:21:29 +0000
Received: by quack3.suse.cz (Postfix, from userid 1000)
 id C5467A0707; Wed,  5 Jul 2023 12:21:28 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b4d6a8be-1b1d-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa;
	t=1688552489; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=qqER76PXnxWxMVZH46uY+IP0A7ISNxa4dFOpqm8Npig=;
	b=rK+eFTza2+XXgbRvOv5tQtV93F/4zZpu7norREAepZy5yow7baD/dvvqWhpeeItBt0IPcu
	Y5rwLWutv/on4mwv5EJraqTeqhb05mRkTW0yYXikGz/UA9AQcATVDIgxrBuvXRHMAszN6R
	RSIAN/j2D8s9RJrt3/Umhb+lT3pvazU=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;
	s=susede2_ed25519; t=1688552489;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=qqER76PXnxWxMVZH46uY+IP0A7ISNxa4dFOpqm8Npig=;
	b=0Ik5A3faiNr6MKUo0ZlFf0SVDy0zGGeX4x6PTOEnPlUJVjHk96v3tsbq/TGqKcufwhGJGx
	3sf2EXg0rHzUTICQ==
Date: Wed, 5 Jul 2023 12:21:28 +0200
From: Jan Kara <jack@suse.cz>
To: Keith Busch <kbusch@kernel.org>
Cc: Jan Kara <jack@suse.cz>, linux-block@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@infradead.org>,
	Alasdair Kergon <agk@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anna Schumaker <anna@kernel.org>, Chao Yu <chao@kernel.org>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Dave Kleikamp <shaggy@kernel.org>, David Sterba <dsterba@suse.com>,
	dm-devel@redhat.com, drbd-dev@lists.linbit.com,
	Gao Xiang <xiang@kernel.org>, Jack Wang <jinpu.wang@ionos.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	Joern Engel <joern@lazybastard.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	linux-bcache@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org,
	linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org,
	linux-nilfs@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-pm@vger.kernel.org, linux-raid@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	"Md. Haris Iqbal" <haris.iqbal@ionos.com>,
	Mike Snitzer <snitzer@kernel.org>, Minchan Kim <minchan@kernel.org>,
	ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Song Liu <song@kernel.org>, Sven Schnelle <svens@linux.ibm.com>,
	target-devel@vger.kernel.org, Ted Tso <tytso@mit.edu>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions
Message-ID: <20230705102128.vquve4qencbbn2br@quack3>
References: <20230629165206.383-1-jack@suse.cz>
 <20230704122224.16257-1-jack@suse.cz>
 <ZKRItBRhm8f5Vba/@kbusch-mbp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <ZKRItBRhm8f5Vba/@kbusch-mbp>

On Tue 04-07-23 10:28:36, Keith Busch wrote:
> On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote:
> > +struct bdev_handle *blkdev_get_handle_by_dev(dev_t dev, blk_mode_t mode,
> > +		void *holder, const struct blk_holder_ops *hops)
> > +{
> > +	struct bdev_handle *handle = kmalloc(sizeof(struct bdev_handle),
> > +					     GFP_KERNEL);
> 
> I believe 'sizeof(*handle)' is the preferred style.

OK.

> > +	struct block_device *bdev;
> > +
> > +	if (!handle)
> > +		return ERR_PTR(-ENOMEM);
> > +	bdev = blkdev_get_by_dev(dev, mode, holder, hops);
> > +	if (IS_ERR(bdev))
> > +		return ERR_CAST(bdev);
> 
> Need a 'kfree(handle)' before the error return. Or would it be simpler
> to get the bdev first so you can check the mode settings against a
> read-only bdev prior to the kmalloc?

Yeah. Good point with kfree(). I'm not sure calling blkdev_get_by_dev()
first will be "simpler" - then we need blkdev_put() in case of kmalloc()
failure. Thanks for review!
 
								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 10:31:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 10:31:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559034.873695 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzma-0004QV-TV; Wed, 05 Jul 2023 10:30:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559034.873695; Wed, 05 Jul 2023 10:30:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzma-0004QO-Qr; Wed, 05 Jul 2023 10:30:48 +0000
Received: by outflank-mailman (input) for mailman id 559034;
 Wed, 05 Jul 2023 10:30:46 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGzmY-0004QI-Ov
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 10:30:46 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGzmY-0004j5-7I; Wed, 05 Jul 2023 10:30:46 +0000
Received: from [15.248.3.5] (helo=[10.24.67.21])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGzmX-0000Mo-UD; Wed, 05 Jul 2023 10:30:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=/QWmM8v5X95kpNnn1GWfLEzgAH3n+A/TIDoD1UWZVsE=; b=D1uhnmEL/KQeald57T0qCOx0xa
	lyHj17XLcNC9T9WIK+Gsyjay1rLL6IUvFko191fDemll60U6HtIYyUUsK05oFAV5Zui495vDIqXYo
	WiUPlm55gT02we0dICbEjva7gh73miYFfON3CqPpmoQqN6Z4DvULo0Bngl6ZYqbbCjUo=;
Message-ID: <d2c0d251-8b10-c211-48ee-ce547aacbe91@xen.org>
Date: Wed, 5 Jul 2023 11:30:44 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 10/52] xen/arm: Move MMU related definitions from
 config.h to mmu/layout.h
Content-Language: en-US
To: Penny Zheng <penny.zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-11-Penny.Zheng@arm.com>
 <ee493a26-234c-876e-e19f-3708c13cb484@xen.org>
 <02cc1edb-1f69-7fd3-a057-e5b04d2e14f4@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <02cc1edb-1f69-7fd3-a057-e5b04d2e14f4@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Penny,

On 05/07/2023 07:51, Penny Zheng wrote:
> On 2023/7/5 05:54, Julien Grall wrote:
>> Hi Penny,
>>
>> On 26/06/2023 04:34, Penny Zheng wrote:
>>> From: Wei Chen <wei.chen@arm.com>
>>>
>>> Xen defines some global configuration macros for Arm in config.h.
>>> We still want to use it for MMU systems, but there are some address
>>
>> Did you mean MPU?
>>
> 
> yes, typo
> 
>>> layout related definitions that are defined for MMU systems only.
>>> These definitions could not be used by MPU systems, but adding
>>> ifdefery with CONFIG_HAS_MPU to gate these definitions will result
>>> in a messy and hard-to-read/maintain code.
>>>
>>> So we keep some common definitions still in config.h, but move MMU
>>> related definitions to a new file - mmu/layout.h to avoid spreading
>>> "#ifdef" everywhere.
>>
>> Just to ease the review, can you add some details which one are 
>> considered common?
>>
> 
> Sure,
> IMOï¼Œ the only part left in common is as follows:
> ```
> #ifdef CONFIG_ARM_64
> 
> #define FRAMETABLE_SIZEÂ Â Â Â Â Â Â  GB(32)
> #define FRAMETABLE_NRÂ Â Â Â Â Â Â Â Â  (FRAMETABLE_SIZE / sizeof(*frame_table))
> 
> #endif
> ```

Hmmm... Looking at the result of the patch, you moved FRAMETABLE_SIZE 
and FRAMETABLE_NR in layout.h. Also, I can't find any layout specific 
define in config.h. So I think the paragraph could be dropped.

> I couldn't figure a proper way to remove the limit for MPU system.
> 
> when calculating variable "pdx_group_valid", which is defined as
> ```
> unsigned long __read_mostly pdx_group_valid[BITS_TO_LONGS(
>  Â Â Â  (FRAMETABLE_NR + PDX_GROUP_COUNT - 1)/PDX_GROUP_COUNT)] = {[0] = 1}
> '''
> 
> It relies on FRAMETABLE_NR to limit array length. If we are trying to
> get rid of the limit for the MPU, it may bring a lot of changes in pdx 
> common codes, like, variable "pdx_group_valid" needs to be allocated in 
> runtime, according actual frametable size, at least for MPU case.

The main problem is that, at least on Arm, the PDX is initialized before 
you can allocate any memory. You should be able to re-order the code so 
we populate the boot allocator first.

But I don't think this is worth it right now as, if I am not mistaken, 
the pdx_group_valid is only 256 bytes on Arm64.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 10:31:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 10:31:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559039.873706 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGznO-0004xO-BJ; Wed, 05 Jul 2023 10:31:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559039.873706; Wed, 05 Jul 2023 10:31:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGznO-0004xH-6x; Wed, 05 Jul 2023 10:31:38 +0000
Received: by outflank-mailman (input) for mailman id 559039;
 Wed, 05 Jul 2023 10:31:37 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGznM-0004xB-Vo
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 10:31:36 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGznM-0004jw-JW; Wed, 05 Jul 2023 10:31:36 +0000
Received: from [15.248.3.5] (helo=[10.24.67.21])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGznM-0000OG-Ei; Wed, 05 Jul 2023 10:31:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=2OG0gEQin0vUyf4v3tDzrqVWK+tqFLxSry0EtGtmz6c=; b=681JF8G13zjVWaCfh20XKixDUq
	xUnJpOKpMFeKS27uqcjGqdb+VdDVYFRhX0HcveuVVplN91OXIaMv1LMy1bLn2Y+/NK+Aa9EwG1s7e
	hoAELhMxYlwgUrZrj8Bj23RfMZZv8ts2lFQveBtmYTUFpNChtDMmL4f9l6w834Mrwh8E=;
Message-ID: <059b1018-58b9-5daf-7bf3-f9b84c0625ff@xen.org>
Date: Wed, 5 Jul 2023 11:31:34 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 11/52] xen/arm: mmu: fold FIXMAP into MMU system
Content-Language: en-US
To: Penny Zheng <penny.zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-12-Penny.Zheng@arm.com>
 <1be18c29-511e-27eb-0970-adaa1c74ce82@xen.org>
 <06760592-ab87-c6c8-83df-e9204fdedadf@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <06760592-ab87-c6c8-83df-e9204fdedadf@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Penny,

On 05/07/2023 09:19, Penny Zheng wrote:
> On 2023/7/5 06:12, Julien Grall wrote:
>> On 26/06/2023 04:34, Penny Zheng wrote:
>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>> index fb77392b82..22b28b8ba2 100644
>>> --- a/xen/arch/arm/Kconfig
>>> +++ b/xen/arch/arm/Kconfig
>>> @@ -15,7 +15,6 @@ config ARM
>>> Â Â Â Â Â  select HAS_DEVICE_TREE
>>> Â Â Â Â Â  select HAS_PASSTHROUGH
>>> Â Â Â Â Â  select HAS_PDX
>>> -Â Â Â  select HAS_PMAP
>>> Â Â Â Â Â  select IOMMU_FORCE_PT_SHARE
>>> Â  config ARCH_DEFCONFIG
>>> @@ -63,11 +62,17 @@ source "arch/Kconfig"
>>> Â  config HAS_MMU
>>> Â Â Â Â Â  bool "Memory Management Unit support in a VMSA system"
>>> Â Â Â Â Â  default y
>>> +Â Â Â  select HAS_PMAP
>>> Â Â Â Â Â  help
>>> Â Â Â Â Â Â Â  In a VMSA system, a Memory Management Unit (MMU) provides 
>>> fine-grained control of
>>> Â Â Â Â Â Â Â  a memory system through a set of virtual to physical address 
>>> mappings and associated memory
>>> Â Â Â Â Â Â Â  properties held in memory-mapped tables known as translation 
>>> tables.
>>> +config HAS_FIXMAP
>>> +Â Â Â  bool "Provide special-purpose 4K mapping slots in a VMSA"
>>
>>
>> Regardless what I wrote above, I don't think a developer should be 
>> able to disable HAS_FIXMAP when the HAS_MMU is used. So the 3 lines 
>> should be replaced with:
>>
>> def_bool HAS_MMU
> 
> Understood, will fix

Do you still need HAS_FIXMAP if this patch is dropped?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 10:36:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 10:36:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559044.873715 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzrU-0005eh-RJ; Wed, 05 Jul 2023 10:35:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559044.873715; Wed, 05 Jul 2023 10:35:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzrU-0005ea-NK; Wed, 05 Jul 2023 10:35:52 +0000
Received: by outflank-mailman (input) for mailman id 559044;
 Wed, 05 Jul 2023 10:35:51 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGzrT-0005eU-JJ
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 10:35:51 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGzrT-0004p4-8k; Wed, 05 Jul 2023 10:35:51 +0000
Received: from [15.248.3.5] (helo=[10.24.67.21])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGzrT-0000ha-2q; Wed, 05 Jul 2023 10:35:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=n4uxSm5vcoYhxj5k7kJ/YEQPQFQ+phIt8SvxSoImtfw=; b=yld9CDXlAofDQCSiZT68qEsdGq
	DO/+1vkuRhNUppWMgZSPjT4XpNO99jf5vevihlXXXkTy//rjG85tRgZTYbdHCOv3RJ6K0ZthRlXXO
	CAggVrCuk3AiQ/aL2BNbMsi6VtyiI+FRvCJjqJT26EB5mV+prqjxJ5GQuaBK9wxVlqL8=;
Message-ID: <1c0a7397-0129-d0d5-2941-3ef1fddef61b@xen.org>
Date: Wed, 5 Jul 2023 11:35:49 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 12/52] xen/mmu: extract early uart mapping from
 setup_fixmap
Content-Language: en-US
To: Penny Zheng <penny.zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-13-Penny.Zheng@arm.com>
 <78862bb8-fd7f-5a51-a7ae-3c5b5998ed80@xen.org>
 <02df8ce2-fa68-614b-87ce-82bb5b60d2a1@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <02df8ce2-fa68-614b-87ce-82bb5b60d2a1@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Penny,

On 05/07/2023 10:03, Penny Zheng wrote:
> On 2023/7/5 06:25, Julien Grall wrote:
>> Hi Penny,
>>
>> Title: You want to clarify that this change is arm64 only. So:
>>
>> xen/arm64: mmu: ...
>>
>> On 26/06/2023 04:34, Penny Zheng wrote:
>>> Original setup_fixmap is actually doing two seperate tasks, one is 
>>> enabling
>>> the early UART when earlyprintk on, and the other is to set up the 
>>> fixmap
>>> even when earlyprintk is not configured.
>>>
>>> To be more dedicated and precise, the old function shall be split 
>>> into two
>>> functions, setup_early_uart and new setup_fixmap.
>> While some of the split before would be warrant even without the MPU 
>> support. This one is not because there is limited point to have 3 
>> lines function. So I think you want to justify based on what you plan 
>> to do with the MPU code.
>>
>> That said, I don't think we need to introduce setup_fixmap. See below.
>>
>>
>>>
>>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>>> ---
>>> v3:
>>> - new patch
>>> ---
>>> Â  xen/arch/arm/arm64/head.SÂ Â Â Â  |Â  3 +++
>>> Â  xen/arch/arm/arm64/mmu/head.S | 24 +++++++++++++++++-------
>>> Â  2 files changed, 20 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
>>> index e63886b037..55a4cfe69e 100644
>>> --- a/xen/arch/arm/arm64/head.S
>>> +++ b/xen/arch/arm/arm64/head.S
>>> @@ -258,7 +258,10 @@ real_start_efi:
>>> Â Â Â Â Â Â Â Â Â  bÂ Â Â Â  enable_boot_mm
>>> Â  primary_switched:
>>> +Â Â Â Â Â Â Â  blÂ Â Â  setup_early_uart
>>> +#ifdef CONFIG_HAS_FIXMAP
>>> Â Â Â Â Â Â Â Â Â  blÂ Â Â  setup_fixmap
>>> +#endif
>>> Â  #ifdef CONFIG_EARLY_PRINTK
>>> Â Â Â Â Â Â Â Â Â  /* Use a virtual address to access the UART. */
>>> Â Â Â Â Â Â Â Â Â  ldrÂ Â  x23, =EARLY_UART_VIRTUAL_ADDRESS
>>> diff --git a/xen/arch/arm/arm64/mmu/head.S 
>>> b/xen/arch/arm/arm64/mmu/head.S
>>> index 2b209fc3ce..295596aca1 100644
>>> --- a/xen/arch/arm/arm64/mmu/head.S
>>> +++ b/xen/arch/arm/arm64/mmu/head.S
>>> @@ -367,24 +367,34 @@ identity_mapping_removed:
>>> Â  ENDPROC(remove_identity_mapping)
>>> Â  /*
>>> - * Map the UART in the fixmap (when earlyprintk is used) and hook the
>>> - * fixmap table in the page tables.
>>> - *
>>> - * The fixmap cannot be mapped in create_page_tables because it may
>>> - * clash with the 1:1 mapping.
>>
>> Since commit 9d267c049d92 ("xen/arm64: Rework the memory layout"), 
>> there is no chance that the fixmap will clash with the 1:1 mapping. So 
>> rather than introducing a new function, I would move the creation of 
>> the fixmap in create_pagetables().
>>
> 
> Understood. I'll move the creation of the fixmap in create_pagetables().
> 
>> This would avoid the #ifdef CONFIG_HAS_FIXMAP in head.S.
>>
>>> + * Map the UART in the fixmap (when earlyprintk is used)
>>> Â Â  *
>>> Â Â  * Inputs:
>>> - *Â Â  x20: Physical offset
>>> Â Â  *Â Â  x23: Early UART base physical address
>>> Â Â  *
>>> Â Â  * Clobbers x0 - x3
>>> Â Â  */
>>> -ENTRY(setup_fixmap)
>>> +ENTRY(setup_early_uart)
>>> Â  #ifdef CONFIG_EARLY_PRINTK
>>> Â Â Â Â Â Â Â Â Â  /* Add UART to the fixmap table */
>>> Â Â Â Â Â Â Â Â Â  ldrÂ Â  x0, =EARLY_UART_VIRTUAL_ADDRESS
>>> Â Â Â Â Â Â Â Â Â  create_mapping_entry xen_fixmap, x0, x23, x1, x2, x3, 
>>> type=PT_DEV_L3
>>> +Â Â Â Â Â Â Â  /* Ensure any page table updates made above have occurred. */
>>> +Â Â Â Â Â Â Â  dsbÂ Â  nshst
>>> +
>>> +Â Â Â Â Â Â Â  ret
>>
>> The 'ret' needs to be outside of the '#ifdef' block. But, in this 
>> case, I would prefer if we don't call setup_early_uart() when 
>> !CONFIG_EARLY_PRINTK in head.S
>>
> 
> okay. I'll move the #ifdef to the caller in head.S.

Thinking about this again. I think you can actually move the mapping of 
the UART in create_pagetables() because it will also not clash with the 1:1.

For the MPU, the mapping could then be moved in prepare_early_mappings().

This would reduce the number of functions exposed.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 10:36:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 10:36:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559048.873725 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzrv-000696-2h; Wed, 05 Jul 2023 10:36:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559048.873725; Wed, 05 Jul 2023 10:36:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzru-00068z-Vj; Wed, 05 Jul 2023 10:36:18 +0000
Received: by outflank-mailman (input) for mailman id 559048;
 Wed, 05 Jul 2023 10:36:17 +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 <SRS0=dIgq=CX=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGzrt-000672-Ga
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 10:36:17 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on061c.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::61c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c4ae6ce4-1b1f-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 12:36:15 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VI1PR04MB9764.eurprd04.prod.outlook.com (2603:10a6:800:1d2::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 10:36:11 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 10:36:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c4ae6ce4-1b1f-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=VVZNiPM3hiLIrWWDvGEAdBDhHeCdbawB52sUllg0N+1X/Sw0U63ksp/pmevV0Ydkil9PZnmzeDpyWGXaYSTGZtuIBEkOF27O+pDnZu5k1gy4X/453mHVlj86QxSAOlSs6rezOd47gCIWixjjz2tNctVqwVL/EwijkJJXOV6871gCGjOwE16rHGEXd3MuwTlkcwykkCDT1yF2+mFZ618FuC8qbptYfIDkkI4JThi0Chmaif6d+84MD+5IRxwjlBiUr4kI8n73PLVVhJmf/64Yep41olAeflQgH6neaX08FM0QjGWAD+ZozrJ8gJE4wRCrlIhBQOT91UyC+jAdopteiA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LngUjxPdqlRRT/0MD4HYtqAs9ZhjYruk+5DtfnwbvXA=;
 b=Hdqi1hI8WJKBYTFLd2z7X2VGW2J1gs7xsBPzNasPBlOWeygn5WLFLyV5sMnouGZYQZdYju+CWmEGXP2drD2Pd0RP2WHRVXaFL5ZGyTfWznZVQMKfBMGGrhmhtsjwbKlSQKtrFhj6sZNY80CrMrSnPab4Q8VBhWRTXUBrG5qN+i4tTv7YqhgqFg/iHAVAWMYmwf8I9WqGcqxwZA3MuEvXI1yYsx7mNHgGqb92/8acHGjwzUw7xNTMGYhTgzPqaBbhpE1vO6ch3oy/9rQCQFomXy4v8emDkbm10jOjuhm0vJv8arly6D/di4wl61jFt1zc/nCHj9SaCnBnbQ/BMTh5WQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LngUjxPdqlRRT/0MD4HYtqAs9ZhjYruk+5DtfnwbvXA=;
 b=WPVXVMkPrdaP9WZTuH4C0umc9awuXYhOlqyv5dnZF4SJNb87c/VKx5cCsxpC0vb2BXsrYSY6UKqgLfJgm0kcaw0g0c+V4wIQJlDY7/mhExkS/WyscAM+6hY1en/AAlQOpFj0p0z0BnOQhlbngBAFGtcV3DkRfL4xt/bRdkNpeoN/UsFGGHrXb9g4RFQrXf7u/iJizqyjiMo56EkTsAud8heZKwjblp1kQioYwozmebxlOZvZMnjarMfjSHm6Hi9L8rzQ67D52iM7H65J9cJ3Pelf673ErOzO4aBqP1dX2I3pFGsGEaOe8lBwShLyWKBhfAQ6dKmc1lLPK8Q0A4JqAA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <b1717870-6013-fc4b-6aff-10e560571759@suse.com>
Date: Wed, 5 Jul 2023 12:36:09 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v9 01/24] xen: Introduce arch_domain_teardown()
Content-Language: en-US
To: Jens Wiklander <jens.wiklander@linaro.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand.Marquis@arm.com, Anthony PERARD <anthony.perard@citrix.com>,
 Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>,
 Marc Bonnici <marc.bonnici@arm.com>, Achin Gupta <achin.gupta@arm.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
 <20230705093433.2514898-2-jens.wiklander@linaro.org>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230705093433.2514898-2-jens.wiklander@linaro.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0059.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4b::21) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VI1PR04MB9764:EE_
X-MS-Office365-Filtering-Correlation-Id: c824952c-87e9-48fc-6c0b-08db7d43a6a5
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	WZR/f73wHxsgy/If4oJvlgorJjVISCKJWPVwLihLJiWPFDi0tx68hk3z8R3Nw/5V8WWIZabDl67zaOqUcqlSVJADKxizlYfhw7E5CURHQKqczJOO/xGJF5G3B1k2vZdgGWLolq2OYvHQrR2IMH3LhhRKTdjl7vsqTyQUTigTK2Jdi0YrNmGsCqeGGuQwNn3lw7qHNGei3rnysGI/HINyW8XvQkJAkFQwU6IJZeD4cHEGnzo6wHyqj0pVJV6kG5Yjsa0E70D5H1vy/Sp7zdPRObFO7O8pohUaRCBQR/wEspKtPVsx5IL/Itpd2oAEJ7b6RSCidiGO5MyHwgjUp0BO8TLlUYPi/0jYgnRXcbFzuUKpSOZbCru17AKm/3Jg2rfkARvheVnH32EorWi4sqLJ3DmrgnNKO1paiDw9GeNStpINYIO5GKrQft5ETCJubkF3sKVf+tJ7DB/JBoOYb8Do8WIqLcYoA5RAS0igY1KqtvoGsbmN/Z1pmDjEINv+LSyILVU8UJKqHgD5mYJGv3wM+AUQpbD0z+BkgxpptTlOg4J7NVZGIgWyGmJz58D6ueSB+q7FA+EATcvoBO4lgorjku7tAYJJSak3KKpYXMmKRkjvM9huoy4AnwYW437irovDq5Qw5KEr5jfDC5qXwGf0hKbEtZ5MRe3g9Ecest+m9h/tJaL35UHYFViexVohxYMiQT/cXR7VLAekuLeq4kwRPA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(136003)(396003)(366004)(346002)(39850400004)(451199021)(26005)(31686004)(7416002)(66556008)(66946007)(36756003)(66476007)(4326008)(316002)(478600001)(8676002)(6916009)(8936002)(5660300002)(2906002)(54906003)(41300700001)(86362001)(6486002)(6512007)(31696002)(4744005)(38100700002)(186003)(6506007)(53546011)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?b1NrbzhJaWpNK2llSVhaZTBOdEJMV0p5em1JZVdpcE94cnlXZU1oMkM1dmZS?=
 =?utf-8?B?U3VaMEZabUt4Vi8wRGZxMytTY0RDbzQ0bmJQY2NENGpNVDh3VzhZbzkyVlFO?=
 =?utf-8?B?RERMUFhpd0lIWEZkZnIwcDVzdHo4ZnEwSXptR09aQ05YZ05uZlRyR2VCNzVN?=
 =?utf-8?B?SFNsSlQzRFM0NEdPNS9rVjFaT2F5YTVIN1F2T1paWW82ZkVsYmpRc0pUNlVN?=
 =?utf-8?B?QzdJeFpHVm9GL3ZVT1NZeVNocXFLNlNyWlQ3N1JlZXdJbW5RdUFFUWJZV2Rt?=
 =?utf-8?B?YTBqTG9CY2RkV0dUc2Z5WTN0UXF1SWU2Mk9RbFUzNnRDZG85SkY3Wms2K0h2?=
 =?utf-8?B?NG96QnZiR2w3TkJTd0ZsUXd2N05xVDFhMkFzMDFFMnIrL3lvbFlkNFZSRi9I?=
 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atorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c824952c-87e9-48fc-6c0b-08db7d43a6a5
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 10:36:11.6377
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 3wOmhRLg+mHYpc7F887fs4xcC+9NhkApRDk+FpRVUVzA2Egr5jpUIT5eGLCWAdatZA6v/A0MRgQgYFCg56/TwA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB9764

On 05.07.2023 11:34, Jens Wiklander wrote:
> From: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Plumb it into domain_teardown().  Provide arch_val in the teardown
> continuation information for use by arch_domain_teardown().
> 
> No practical change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

Reviewed-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 05 10:41:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 10:41:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559052.873735 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzwP-0007em-K3; Wed, 05 Jul 2023 10:40:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559052.873735; Wed, 05 Jul 2023 10:40:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzwP-0007ef-HN; Wed, 05 Jul 2023 10:40:57 +0000
Received: by outflank-mailman (input) for mailman id 559052;
 Wed, 05 Jul 2023 10:40:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGzwN-0007eZ-Kw
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 10:40:55 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGzwN-00054D-3m; Wed, 05 Jul 2023 10:40:55 +0000
Received: from [15.248.3.5] (helo=[10.24.67.21])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGzwM-0000w5-U1; Wed, 05 Jul 2023 10:40:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=YCuZM3j36LKscsvZbyWgzojDDQZP1lgWsD/23JEmPD4=; b=NBwdeMBxzJi9N5WLTiivrM55Kn
	hjgRFUZFTezTkMePEixcJGVg/sRbkNYBM/v36nR14e2xoAmZzxZc5UNQrQ/D+s/7NxYgdMPZobIPa
	wU7MeeZpd6MCJQ3gsE0kL7/O01wzKxxdh8K8aKGjP1p/j2uAuTie7w4q06RLY4CgdeIY=;
Message-ID: <bab83c9f-dda8-460c-40ee-c2e0b95f20fd@xen.org>
Date: Wed, 5 Jul 2023 11:40:52 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 00/52] xen/arm: Add Armv8-R64 MPU support to Xen -
 Part#1
Content-Language: en-US
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Paul Durrant <paul@xen.org>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230626033443.2943270-1-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Penny,

On 26/06/2023 04:33, Penny Zheng wrote:
> So sorry for the long long wait before v3 serie, since I got sidetracked to
> a new high priority internal project for quite a time.
> 
> The Armv8-R architecture profile was designed to support use cases
> that have a high sensitivity to deterministic execution. (e.g.
> Fuel Injection, Brake control, Drive trains, Motor control etc)
> 
> Arm announced Armv8-R in 2013, it is the latest generation Arm
> architecture targeted at the Real-time profile. It introduces
> virtualization at the highest security level while retaining the
> Protected Memory System Architecture (PMSA) based on a Memory
> Protection Unit (MPU). In 2020, Arm announced Cortex-R82,
> which is the first Arm 64-bit Cortex-R processor based on Armv8-R64.
> The latest Armv8-R64 document can be found [1]. And the features of
> Armv8-R64 architecture:
>    - An exception model that is compatible with the Armv8-A model
>    - Virtualization with support for guest operating systems
>    - PMSA virtualization using MPUs In EL2.
>    - Adds support for the 64-bit A64 instruction set.
>    - Supports up to 48-bit physical addressing.
>    - Supports three Exception Levels (ELs)
>          - Secure EL2 - The Highest Privilege
>          - Secure EL1 - RichOS (MMU) or RTOS (MPU)
>          - Secure EL0 - Application Workloads
>   - Supports only a single Security state - Secure.
>   - MPU in EL1 & EL2 is configurable, MMU in EL1 is configurable.
> 
> These patch series are implementing the Armv8-R64 MPU support
> for Xen, which are based on the discussion of
> "Proposal for Porting Xen to Armv8-R64 - DraftC" [2].
> 
> We will implement the Armv8-R64 and MPU support in three stages:
> 1. Support to boot MMU domains on Armv8-R64 Xen.
> 2. Support to boot MPU domains on Armv8-R64 Xen.
> 3. SMP and other advanced features of Xen support on Armv8-R64.
> 
> For having a overall undestanding for reviewers about MPU framework on Xen,
> we have introduced a large patch serie here, including 52 commits. At this
> stage, we could successfully boot a linux guest on FVP_BaseR_AEMv8R
> model[3].
> 
> We will split these patches to several parts, this series is the
> part#1, v1 is in [4], the full PoC can be found in [5]. More software for
> Armv8-R64 can be found in [6];
> 
> [1] https://developer.arm.com/documentation/ddi0600/latest
> [2] https://lists.xenproject.org/archives/html/xen-devel/2022-05/msg00643.html
> [3] https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms/arm-ecosystem-models
> [4] https://lists.xenproject.org/archives/html/xen-devel/2022-11/msg00289.html
> [5] https://gitlab.com/xen-project/people/weic/xen/-/tree/integration/mpu_v3

The first few patches in this tree seems to be different compare to this 
series. Can you provide a tree with all the patches from this series 
applied?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 10:43:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 10:43:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559056.873745 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzyo-0008ET-0x; Wed, 05 Jul 2023 10:43:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559056.873745; Wed, 05 Jul 2023 10:43:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzyn-0008EM-Ss; Wed, 05 Jul 2023 10:43:25 +0000
Received: by outflank-mailman (input) for mailman id 559056;
 Wed, 05 Jul 2023 10:43:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qGzym-0008Dx-1D
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 10:43:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGzyl-00056S-Lt; Wed, 05 Jul 2023 10:43:23 +0000
Received: from [15.248.3.5] (helo=[10.24.67.21])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qGzyl-0000zE-Gt; Wed, 05 Jul 2023 10:43:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=gc7KcbLyyY64bpEe5vbHn6NHmmmDoyv+thNynPBDSD8=; b=FGRJ/z1c8y05CDQeeXNRz10J+c
	4duVc2jNSPpet3TlNcYeaj30rZJkH4hkVF+5Mh5OyGANrQcgXgfXLgu8moTJs4R1eJccAo1538IM3
	+sa8qc0SIvb3Kx9ciGB9WethQUb1Ji7I3ai295LvDDCMp7PyIcST1AjHcsJO3ZpqPh3I=;
Message-ID: <3e01a7bb-73ff-9363-29e3-e4882cd03e37@xen.org>
Date: Wed, 5 Jul 2023 11:43:22 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 08/52] xen/arm64: move MMU related code from head.S to
 mmu/head.S
Content-Language: en-US
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-9-Penny.Zheng@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230626033443.2943270-9-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Penny,

One more remark.

On 26/06/2023 04:33, Penny Zheng wrote:
> From: Wei Chen <wei.chen@arm.com>
> 
> There are lots of MMU specific code in head.S. This code will not
> be used in MPU systems. If we use #ifdef to gate them, the code
> will become messy and hard to maintain. So we move MMU related
> code to mmu/head.S, and keep common code still in head.S. We also
> add .text.idmap in mmu/head.S to make all code in this new file
> are still in identity map page but will be linked after head.S.
> 
> As "fail" in head.S is very simple and this name is too easy to
> be conflicted, so duplicate it in mmu/head.S instead of exporting
> it.
> 
> And some assembly macros that will be shared by MMU and MPU later,
> we move them to macros.h.
> 
> Rename enable_boot_mmu()/enable_runtime_mmu() to a more generic name
> enable_boot_mm()/enable_runtime_mm(), in order to make them common interfaces
> to be used for both MMU and later MPU system.
> 
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> ---
> v1 -> v2:
> 1. Move macros to macros.h
> 2. Remove the indention modification
> 3. Duplicate "fail" instead of exporting it.
> ---
> v3:
> - Rename enable_boot_mmu()/enable_runtime_mmu() to a more generic name
> enable_boot_mm()/enable_runtime_mm()
> ---
>   xen/arch/arm/arm64/Makefile             |   3 +
>   xen/arch/arm/arm64/head.S               | 469 +-----------------------
>   xen/arch/arm/arm64/mmu/head.S           | 453 +++++++++++++++++++++++
>   xen/arch/arm/include/asm/arm64/macros.h |  51 +++
>   4 files changed, 509 insertions(+), 467 deletions(-)
>   create mode 100644 xen/arch/arm/arm64/mmu/head.S
> 
> diff --git a/xen/arch/arm/arm64/Makefile b/xen/arch/arm/arm64/Makefile
> index 54ad55c75c..0c4b177be9 100644
> --- a/xen/arch/arm/arm64/Makefile
> +++ b/xen/arch/arm/arm64/Makefile
> @@ -8,6 +8,9 @@ obj-y += domctl.o
>   obj-y += domain.o
>   obj-y += entry.o
>   obj-y += head.o
> +ifeq ($(CONFIG_HAS_MMU),y)
> +obj-y += mmu/head.o
> +endif

You could use obj-$(CONFIG_HAS_MMU) += mmu/head.o.

But in this case, I would rather prefer if we match how other 
subdirectory are added. I.e. on the parent's directory Makefile you add:

obj-$(CONFIG_MMU) += mmu/

And in the directory you add a Makefile which list the files to compile.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 10:44:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 10:44:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559061.873755 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzzQ-0000Kc-BH; Wed, 05 Jul 2023 10:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559061.873755; Wed, 05 Jul 2023 10:44:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qGzzQ-0000KV-7z; Wed, 05 Jul 2023 10:44:04 +0000
Received: by outflank-mailman (input) for mailman id 559061;
 Wed, 05 Jul 2023 10:44:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=dIgq=CX=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qGzzO-0000F8-Qo
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 10:44:02 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2041.outbound.protection.outlook.com [40.107.7.41])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id daf375b7-1b20-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 12:44:02 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU0PR04MB9669.eurprd04.prod.outlook.com (2603:10a6:10:316::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 10:43:31 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 10:43:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: daf375b7-1b20-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=n7/R22Fz7oHm3IQFEiMO8gBzdrKBCSbd/+eiLnrCu1E9Pk2fvko+FX+Xn7WIi7z9WNf7/kr/0wly8DVZYJyUhRVHESia43D7bnqa9PK9/iDsGZMyx8NK35gPFmiofGd4UcHR8+ONFHxRqQBMVRH/IhdWtpcGKb3UNrNP2BlX+jkRqiut6trwy1OLuCzHh86Sq2G6aqdSpVQNH4rAfJdVzaVeW3U5JvqNlXzhbO6r01BkKRLbUb6oXRAsgRwoLqf7F/68PJ47j8jWeB0SVZ/oPhLifEf9ydr9hmo7//vYFyAUrBmX9Bhmj7rjjIbsFFaLLFHHBRUzzm/NyB0s37k4TA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=kj6GmKg/KqA1sstnJgxozqSyYWM91LU7Gjl25Xzka4U=;
 b=WawDF8fAtwpe9QteSEPpV0FQJm60DIFfnF2HLiIfd86fxIEdWxxG3q6GeikXRbrv/ITHmXf20VqMY0Eu/1y9tao4GcefpftJJY3uqMeClqJCg7B1ecM4hZXT5206S7PCrk+Xx19/WkAHJiXGjGzJ5awV2t4p74X5yDlGGgKMcqwveLgfOhlDCiV2g/PUsvtMbLCRYGm4pTrnaDBsmIGqDQGFWJPkVjir1atD9yEoCzOVu+aRd0ZtVp27zJ2R+MR65IPaLZUPxG3J4ixSta54nCa8UXA/oZmxFEjxRcmWopIR7wo9hDvqp0pNjkjWKvjE5E9PTRa3NHDzM+PdLQsvCA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=kj6GmKg/KqA1sstnJgxozqSyYWM91LU7Gjl25Xzka4U=;
 b=YRVOvfvSG+U6Q1A5zBeP8GeDrkvwYHMIKZTmwlK8zZ0MJTkqXw3Iq64DFuFqZGIsftkX6eaMaej5/p9YpG9DWcdVVpcZYQbggcqJj9dwIN7b3tTT5VDQNQ9rFHL8fNjpT5eC8c6AbWGw6+zG3wlZWAC1yJgviRbsXwyiAJMnEGBYm7lpt5fa5ppa+4Edzd+mhdrv8xgtXPULpDSuCiZ4VlOMa9KpZ+rjIjtSe964oIx9vfxQJqXAISUk35WsBLlNXk3MMx5+StZEGqEVfZ/dQrWpZW5/OAkoB5apTtF1yHglOxAulQuS31t6ITuqTxUfoQZEjv8TjCW8YldLBZKHaw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <0dafce38-e572-3675-7f5f-a44a097abf09@suse.com>
Date: Wed, 5 Jul 2023 12:43:27 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v5 3/4] x86: Read MSR_ARCH_CAPS immediately after
 early_microcode_init()
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
References: <20230629152656.12655-1-alejandro.vallejo@cloud.com>
 <20230629152656.12655-4-alejandro.vallejo@cloud.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230629152656.12655-4-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0090.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9b::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU0PR04MB9669:EE_
X-MS-Office365-Filtering-Correlation-Id: e439d9c9-28c9-492f-ce0e-08db7d44ab6c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	4Og/12uxU3Ktm7JOjiXPoIT0zwcG6d2VdHjTWMq46L4NqCYedTXN/wu7XBPD/OEB2OkqUqr71mJO8FlV5RwBck2LOH1ph3m1DwFaNBaqAbBUsP0NsXe+85j+KjnejctvDJtPkX+8DDpfxo4HSdprN++EWa8Fn8ls2CLBPZor9WjXyuhAxO6ZnTXMZAgBY2Iu+MjcNrl5HJOlDgWMijjbaMb1s9DCRXU0NLiEmiYzacKIygvbKD6q+FD/OpPLEcsNKO6gn+M8ykvGbA2yTuU7i3n4+2xvNVNdZHZqxVxtVr/SNj2Z7SamycssmULCbT7xWW9iJFh/cNNEWpL3be4Hurr9Rw/VYKi2M5UbWTMS8csFcFoMEFybgzywk3vmPsQGl9+SaRKDjAWuV+L+goFMVxPGkDHrvEM2zngFWvL8yJc/iC0g76tjzm74hsPpA0UHbVrpZz3lcQ+SSBR4UgfVMmd7KL2DEzyEXN7WdCoNyK+6tolY4zIVMswH8CG1HIHuNQWgEFiag4n+o6fHtsd5kPGU7GD2nfbchPRhjWnMqCGN7s4aVczyegjgYapynboUh48U4NnCzWKAuAP1JTONcH00l3oVAV9vsqAkIUXu0/c6/rvJGOWFuMFOQuWgeGy6Lg6zy38W84Ldkq55vkVOP9PSzx7JCed4Vr8B1TBJpjQ=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(376002)(396003)(346002)(39860400002)(451199021)(2906002)(41300700001)(5660300002)(8936002)(36756003)(8676002)(86362001)(31696002)(186003)(2616005)(478600001)(26005)(6512007)(6506007)(31686004)(53546011)(6486002)(316002)(4326008)(6916009)(66556008)(66476007)(66946007)(38100700002)(54906003)(83380400001)(14773001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RlZoU3JjaXFEOHY3ZjlzMjJiS0UwWmtJY0hXMlBqNk1LTmRwOERObm56Q0JG?=
 =?utf-8?B?QmQyTUZVWk5HVlMzTEpFR3FOU3pxY1pDTERWbGdRajhYTm9LVzlBSWJJRERh?=
 =?utf-8?B?ZnhYck5CVEVuOGJsVVNsck9TMWhIc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rOXBacDBZUEsxVVJ1c0grdTVBckdTa0xEZGlsZ1dldDMy?=
 =?utf-8?B?bGRPRGEvZnpIM0hXN2FnczBUUVFGR2lBRjRYc29xd0pLMGJ3QU1pWnZRZytu?=
 =?utf-8?B?ODl6TVFBdHpndFAxeVRDa1ArUlhjdm9OMENpYVVyZ3dnVjcrOFJ6SW5CMWJh?=
 =?utf-8?B?V0V5dzd1TytUckhucG9USllyV00wR2pmMGU1VUgzdkV4dnFVNFhWN2pNcGdZ?=
 =?utf-8?Q?bWurKvinDPdSkuAGl9xGaoY0t?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e439d9c9-28c9-492f-ce0e-08db7d44ab6c
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 10:43:29.1275
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: UFlW+LMu63/k+nZihU5TOP7n4VYpJFP1eYhyTm5SOi7Iwp81E8vWXNSeWwlJHXAOWWT17d0go21Ay4CZEi9p5A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9669

On 29.06.2023 17:26, Alejandro Vallejo wrote:
> @@ -324,9 +324,10 @@ void __init early_cpu_init(void)
>  	case X86_VENDOR_SHANGHAI: this_cpu = &shanghai_cpu_dev; break;
>  	case X86_VENDOR_HYGON:    this_cpu = &hygon_cpu_dev;    break;
>  	default:
> -		printk(XENLOG_ERR
> -		       "Unrecognised or unsupported CPU vendor '%.12s'\n",
> -		       c->x86_vendor_id);
> +		if (verbose)
> +			printk(XENLOG_ERR
> +			       "Unrecognised or unsupported CPU vendor '%.12s'\n",
> +			       c->x86_vendor_id);

Just as a remark:

	if (!verbose)
		break;

would have been less of a delta and keeping all lines within the 80
chars limit.

> @@ -340,10 +341,11 @@ void __init early_cpu_init(void)
>  	c->x86_capability[FEATURESET_1d] = edx;
>  	c->x86_capability[FEATURESET_1c] = ecx;
>  
> -	printk(XENLOG_INFO
> -	       "CPU Vendor: %s, Family %u (%#x), Model %u (%#x), Stepping %u (raw %08x)\n",
> -	       x86_cpuid_vendor_to_str(c->x86_vendor), c->x86, c->x86,
> -	       c->x86_model, c->x86_model, c->x86_mask, eax);
> +	if (verbose)
> +		printk(XENLOG_INFO
> +		       "CPU Vendor: %s, Family %u (%#x), Model %u (%#x), Stepping %u (raw %08x)\n",
> +		       x86_cpuid_vendor_to_str(boot_cpu_data->x86_vendor), c->x86, c->x86,
> +		       c->x86_model, c->x86_model, c->x86_mask, eax);

Since rearrangement to limit line length isn't really possible here,
the last two lines need re-flowing to stay within limits.

> --- a/xen/arch/x86/cpu/microcode/core.c
> +++ b/xen/arch/x86/cpu/microcode/core.c
> @@ -886,5 +886,11 @@ int __init early_microcode_init(unsigned long *module_map,
>      if ( ucode_mod.mod_end || ucode_blob.size )
>          rc = early_microcode_update_cpu();
>  
> +    /*
> +     * MSR_ARCH_CAPS may have appeared after the microcode update. Reload
> +     * boot_cpu_data if so because they are needed in tsx_init().
> +     */
> +    early_cpu_init(false);

I think the comment would better talk of ARCH_CAPS as an example of what
may newly appear with a ucode update.

With at least the middle item taken care of (which I'd be happy to
do while committing)
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 10:52:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 10:52:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559066.873764 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH07R-0001vS-4M; Wed, 05 Jul 2023 10:52:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559066.873764; Wed, 05 Jul 2023 10:52:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH07R-0001vL-1Y; Wed, 05 Jul 2023 10:52:21 +0000
Received: by outflank-mailman (input) for mailman id 559066;
 Wed, 05 Jul 2023 10:52:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=dIgq=CX=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qH07Q-0001vF-Bj
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 10:52:20 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2054.outbound.protection.outlook.com [40.107.7.54])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 03212e97-1b22-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 12:52:19 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8305.eurprd04.prod.outlook.com (2603:10a6:20b:3ee::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 10:51:49 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 10:51:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 03212e97-1b22-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=VXPo1JLr+obMsXGZuEehwW9JiHVghp+Ge65CETrq15vzZq4zt9oqvzrnE7tkpAf9XFrMvHl5TDM16Gh7ASo/6pG7NyjyVa4/r4jiQKeAIXaypwzgBhSLrYAcjxIqJ/vq+FOXzLea66dXwITApFoffi6Hdqa938lCfk+pooCvLtZjzg0amJg/LLXWMyChQrIv8z88YpeYK/5u/L2ZwYBItM0+31SjVdl4MF07sCIJC/7+67V+7Vf4a0aVzKEwwDvpKtwLYbfCu0hlxWxpnrOaIYnNuP0TDaav4ddnI9PV56XkEHjD5Mxs0dKIK9OsXotAgKt50jtfMi8pB8WnI4I6Wg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=8bvbw1tm6Hz3nLztoL7t76OJzMGSv4pIc1wPZMxG4Y0=;
 b=B9pnlgNzv09LK+tWRIBijygOU2x2aH9QSmF/S0sUGYws0mSuPaqR57NIcM6ifjbHeqbrEOvcVNY0m0v9e9lgPqWnonDl9b3ww7b+1TfvJryNJ6dJ1hZQw93ht38SOOSx+NJQU1hUSTwvT0PbjM6LsruTwAyvX1lLvC9bwZw3mnbSFSiZULYs8vq40U8pGNKrVpN9pQeCjanlALipGYj40CPRG7wNXkmkn0jOsfMqoAprVQL1jSC8uEJKFYv7wZ6u2fJ1lRCytkLFNkRIY4yG2SXu2OPzCpTzKRhaRVilkDMbDsKA57734dcMVILOEtdB2KMDkZcQG0OsiaD30WSX+Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=8bvbw1tm6Hz3nLztoL7t76OJzMGSv4pIc1wPZMxG4Y0=;
 b=ZHsaBPEN9He0feYOiB+kFBLtkbTVmTojSOqQROTWNpHuYwa1xLDfSVymmyva5FIotoXl4YJki+Vx94G7HbHOxx6Hxgk8rgggRju1H1OnfG4p45olP6ZqYDNPMCm8/rPS8ovlpqn63yEU8HrC2FH7GhJLtSj9jzfQSHM4jmA+K8mGXguyQyjsS4WK2OXSep4uf+96MhGU5Bu7zAmEwHNaukpV9paefMaj4yZHKBYbg5B+hMJ+o31mz8uTnio6gGaA+0QF7K/ZqHBWnCV/U1lOkmBPrbv9r6f6ceeenC8EFX34PRzTY+CHb6jaaWENP2Idn+ZPCoveZgjOEHjqpOfvsg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <1c9fe38e-d8aa-21fb-8dbe-4c54385b5a67@suse.com>
Date: Wed, 5 Jul 2023 12:51:47 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v5 4/4] x86/microcode: Disable microcode update handler if
 DIS_MCU_UPDATE is set
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
References: <20230629152656.12655-1-alejandro.vallejo@cloud.com>
 <20230629152656.12655-5-alejandro.vallejo@cloud.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230629152656.12655-5-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0268.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b5::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8305:EE_
X-MS-Office365-Filtering-Correlation-Id: e93a344e-14fd-4087-6c6f-08db7d45d5ac
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	CLgQq4C824VGtOwCv4N9aJF7JNe5PJE9q3s4W9Xyyn+oHhbDpUWDFiqYBHYq+HTYjBu8PkuGm6ane+Q2u5NQ+TX3VZgCaybGqQPBM46osYd2wHQnQceWgEzcYb/u05lJn+Swtn793XrbIkn67nKi6IRDvmtZ0nGqRQrSSTL2BU9XKnb4d/eJDpA61owP1BWM+yYtHDHPLbFrFa89KtyGWjBUhMwPj5LJuEuDaAg5gZsUOCjuzYCuRySXDsoBM7jhbHX0hhxTzTPBVUhw636pwQG33MrlVmK5St3XjaTYU9/daWdvShNly+af0kUNe5Asr75Xp0TlBE8TCO2PPHxtDRZoHXzn5+OJ73YKZfq11uK3/s6sLJA/9/BPCw52sITv4XPEMd1Zmi2sYRCSIyZvE+cmfR7o7HxxHbB51qiQnHHZKulQ6DDWpgMgX7/vxllYJccOWhuFjx0dqfsf2aaBAVUbhufqA2fQ4UcueTW935pdJRNCOOVUB/MZQtxclnjLYLFysFTiGMvzjQ05S/Nv2TE9pgGiIYep1rlHIP4nVasXKkfv5egORZNvRuFoWJ2ZvGOP+XqVEBKeduD8PXTtx9aoy8j69D3uhB7RwbBQcaYfs3HHNdS23+V2vsXOlLxfPpn2joaPnMjkcHR58gSk6g==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(39860400002)(136003)(396003)(366004)(451199021)(31686004)(8936002)(8676002)(15650500001)(83380400001)(41300700001)(316002)(5660300002)(2906002)(2616005)(66946007)(38100700002)(6916009)(4326008)(66476007)(66556008)(86362001)(186003)(53546011)(478600001)(54906003)(26005)(6506007)(6486002)(36756003)(31696002)(6512007)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?U1ZENC84SnBtbzJUci8xTFNDYVBBVk53MkxPRGg4QkVpNDlmQ1JYZ2l0b29Y?=
 =?utf-8?B?akQrNTRxOTdiV1g1eHpmeHhraWozYm5VbGNqT0x0NkF3b2JtKys0eUJxRCtW?=
 =?utf-8?B?SXBjNXE2aWNlSnRPSTVJbU5tSzhsRHorYXpTZVhVWkh3KzFRcjJ2STJpM1NC?=
 =?utf-8?B?RUlFQ1ZEL2hqZkZ3V21XZ2FOSzZsbHVtM2Z6aFpwTEE0WlJ5STQrelMrc0M2?=
 =?utf-8?B?cnQya2tPN1AwWHNWKy8xZEc1ZkluUjFJY2pJMFY4c3BBa2tJMTgrV0oyQk1y?=
 =?utf-8?B?VGhQdCs0Q3lrNEVkWUd6cVRHdkM0ZjRscVdmWWl6NVo2LzBJOTF0ak1WNGVh?=
 =?utf-8?B?Q0pNYkxy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?Q?aB5uaX8Zq5IZ7x5B6jFfSFgRC?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e93a344e-14fd-4087-6c6f-08db7d45d5ac
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 10:51:49.4960
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: bJGn29eO1FIUZl/7fMWhVznTSef48S/dzbl0okzfmUMQgNzVIyKgBcRlSjaIIseNKXik3OCEDdu46LcPT2spJQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8305

On 29.06.2023 17:26, Alejandro Vallejo wrote:
> --- a/xen/arch/x86/cpu/microcode/core.c
> +++ b/xen/arch/x86/cpu/microcode/core.c
> @@ -847,17 +847,21 @@ int __init early_microcode_init(unsigned long *module_map,
>  {
>      const struct cpuinfo_x86 *c = &boot_cpu_data;
>      int rc = 0;
> +    bool can_load = false;
>  
>      switch ( c->x86_vendor )
>      {
>      case X86_VENDOR_AMD:
>          if ( c->x86 >= 0x10 )
> +        {
>              ucode_ops = amd_ucode_ops;
> +            can_load = true;
> +        }
>          break;
>  
>      case X86_VENDOR_INTEL:
> -        if ( c->x86 >= 6 )
> -            ucode_ops = intel_ucode_ops;
> +        ucode_ops = intel_ucode_ops;
> +        can_load = intel_can_load_microcode();
>          break;
>      }
>  
> @@ -874,7 +878,7 @@ int __init early_microcode_init(unsigned long *module_map,
>       * mean that they will not accept microcode updates. We take the hint
>       * and ignore the microcode interface in that case.
>       */
> -    if ( this_cpu(cpu_sig).rev == ~0 )
> +    if ( this_cpu(cpu_sig).rev == ~0 || !can_load )

While not too bad, the addition brings code and comment slightly out
of sync.

> --- a/xen/arch/x86/cpu/microcode/intel.c
> +++ b/xen/arch/x86/cpu/microcode/intel.c
> @@ -385,6 +385,19 @@ static struct microcode_patch *cf_check cpu_request_microcode(
>      return patch;
>  }
>  
> +bool __init intel_can_load_microcode(void)
> +{
> +    uint64_t mcu_ctrl;
> +
> +    if ( !cpu_has_mcu_ctrl )
> +        return true;
> +
> +    rdmsrl(MSR_MCU_CONTROL, mcu_ctrl);

While one would hope that feature bit and MSR access working come in
matched pairs, I still wonder whether - just to be on the safe side -
the caller wouldn't better avoid calling here when rev == ~0 (and
hence we won't try to load ucode anyway). I would envision can_load's
initializer to become this_cpu(cpu_sig).rev != ~0, with other logic
adjusted as necessary in early_microcode_init().

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 11:21:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 11:21:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559094.873774 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH0ZO-0005UC-79; Wed, 05 Jul 2023 11:21:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559094.873774; Wed, 05 Jul 2023 11:21:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH0ZO-0005U5-4P; Wed, 05 Jul 2023 11:21:14 +0000
Received: by outflank-mailman (input) for mailman id 559094;
 Wed, 05 Jul 2023 11:21:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=asTv=CX=citrix.com=prvs=543a7ddba=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qH0ZM-0005Tz-VT
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 11:21:13 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0aa158fd-1b26-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 13:21:11 +0200 (CEST)
Received: from mail-dm6nam10lp2105.outbound.protection.outlook.com (HELO
 NAM10-DM6-obe.outbound.protection.outlook.com) ([104.47.58.105])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 05 Jul 2023 07:21:07 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by PH0PR03MB7115.namprd03.prod.outlook.com (2603:10b6:510:290::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 11:21:06 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606%4]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023
 11:21:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0aa158fd-1b26-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688556071;
  h=message-id:date:subject:to:cc:references:from:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=2SpJePAoRfnyrkf7ck2zFXGTteLBdcylXjgKrVyVZg0=;
  b=A1Ojzwea/fL5fMxeJcrOO7p6ODSSEKSS4BWRCbxRV13OQNd7UDM2/nR8
   fAUBxyI0GI8IqbfPhq4nr9NK7M0o3ABTUOYlWL+j9xWZnw07V5fMWi6I7
   IQ84z3YWYw7Ya+AjlqbTlTt6hCQJKqteGYbkl0iKhDRm16zmbQo3XSTUp
   8=;
X-IronPort-RemoteIP: 104.47.58.105
X-IronPort-MID: 115631925
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:yU3y+Kys11/Z/bEtrqh6t+e8xyrEfRIJ4+MujC+fZmUNrF6WrkVWm
 mMZUWqGb6yNMGH2cthzb9vi9RlV78DUxt9hHQFlpSAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhPa0T5TcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KTpu5
 MY9LTAvVCDZqL2y//GHRNVI2u12eaEHPKtH0p1h5RfwKK9+BLzmHeDN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjiVlVQsuFTuGIO9ltiibMNZhEuH4
 EnB+Hz0GEoyP92D0zuVtHmrg4cjmAuiAd9MT+TprKMCbFu7zS8pISMuR3+Cv9bljlDkUokHF
 BYl0397xUQ13AnxJjXnZDWArXiCr1guW9dWHMUz8gTLwa3Riy6JC25BQjNfZdgOsM4tWSdsx
 lKPh8nuBzFkrPuSU3313qiZrHW5OSUTBWYYYGkPSg5ty8L4vIg5gxbLT9BiOK24lNv4HXf32
 T/ihCojg7Qei+Yb2qP9+krI6xqmq4LVVAcz6kPSV3i88wJiTIe/Ysqj7l2zxchHKIGVX1yQp
 k8uksKV7P0NJZyVnSnLS+IIdIxF/N6AOTzYxFJqQZ8o8m31/2b5JNgNpjZjOE1uL8AIPyfzZ
 1Pesh9Q45kVO2a2aahwYMS6DMFCIbXcKOkJn8v8NrJmCqWdvifdlM2yTSZ8B1zQrXU=
IronPort-HdrOrdr: A9a23:h+DUR6nHTAQqaglyrkvF11H5pDDpDfLa3DAbv31ZSRFFG/Fw9/
 rCoB3U73/JYVcqKRcdcLW7UpVoLkmyyXcY2+cs1PKZLWvbUQiTXeZfBOnZsl7d8kTFn4Yw6U
 4jSdkaNDSZNzNHZK3BkW2F+rgboeVu8MqT9JjjJ3UGd3AVV0m3hT0JezpyESdNNXl77YJSLu
 vk2iLezQDQBEj+aK6AdwE4dtmGnfLnvrT8byULAhY2gTP+8Q9BuNbBYmOlNg51aUI0/Ysf
X-Talos-CUID: 9a23:JGIjv2z4CryiR6vN0nvlBgVPOtEfV3jd7k3geWDnDVkqdLOpbQO5rfY=
X-Talos-MUID: =?us-ascii?q?9a23=3AlujFZg1t13a47w9C18hM+fM/LTUj6OeUIX41g7E?=
 =?us-ascii?q?/pebYMTIqMmzFs26Ga9py?=
X-IronPort-AV: E=Sophos;i="6.01,182,1684814400"; 
   d="scan'208";a="115631925"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=cVDSPrVGTccLw7MxgQPOJzG4ceT3JApyjmO7/ZOHp8lS26SwVD0cr+VjeJvtu+Q62RI7gMGkRts+ayuVZVNMRX7KQqmfC7nTskYgRsr/+XS6Pd4ofZm8XRb8M5YtG3UOqgWLlZG7jkfWRCOgIAgh5Ns0vmS/L/9E9M/hG3kF5f0b9Xc2/xKSk9hGXgWRpEFuVLTWeiZMaH6sjEo5US3Kd9Z+iUxTJEkv0q3+fhpxl26g2rO6CoJ3GI9K2d7htEFNSas1gUkZ8R8KV73Kxb3BYE9p7sriZAWME3mKs7vK2o1UWS7RmQ0L5RwsnTVvdl86nvMOuKxjwk8xwNNzFCcuHQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=2SpJePAoRfnyrkf7ck2zFXGTteLBdcylXjgKrVyVZg0=;
 b=JkR1pi9a85Jw16Exw3wI+l2wQK1VeGj4pJm1lT1qwd41YanFCq0lQqIc7lHtKg9sUPqqnl5pbIDCNQLNU+7uzYzzMWENB9T+RjH05bPh3dptLhTWCqHqvIs2wXKVaQcrEREBQrOYLiKVGMHahgCTTC7ToPiXZN3fgLfukCGppe2ZUIfmIv8Y9EG3YAWK8JGl5bxadKH/0tYztZY3Ue26KopTIvqfgjMt4fU0z+Iq3yOQXu6XDjgbzNQbRoA2IX4l5VeB5hTptCPK98pVWNSx/nXnFVrmD6vqA+Xb7Oo2cORcf6oDtKCc3AspGChl8ctgdnpe+jEc73WpL5GYgefSKA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=2SpJePAoRfnyrkf7ck2zFXGTteLBdcylXjgKrVyVZg0=;
 b=I0KDFutN1MRjRsaAj4jBB/xlH/G4pkHftPMAnzFPB/jD7LiTZCMHORyYp+sioHh2MPLiQpLJg4/xniOUJQSUpquI9fbKNEvub3g/y3lwEtPqlKxmNMI+PeQ1xCbKJusArIAYMJiQQLozs9ehCZoU/IGXzNuEuRVVgIdft8mXGoc=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <1956a273-27a9-d0e6-e328-be69ff91e5d3@citrix.com>
Date: Wed, 5 Jul 2023 12:20:58 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: [RANDCONFIG failure] Re: [PATCH v3 02/52] xen/arm: make ARM_EFI
 selectable for Arm64
Content-Language: en-GB
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-3-Penny.Zheng@arm.com>
From: Andrew Cooper <andrew.cooper3@citrix.com>
In-Reply-To: <20230626033443.2943270-3-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO6P123CA0051.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:310::7) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|PH0PR03MB7115:EE_
X-MS-Office365-Filtering-Correlation-Id: 34cd6955-0f47-47da-4b59-08db7d49ec0e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	oIxu3rzqcmPYFWh6t2tZq/Oit++d/dEbStUFhkaRbKLXYPhAApJe3sLlgmRFPdoKKBPhJImVkp9SfO2AEKZXlbH9h5wOEEBzaadTJry3fWJEolD7Q/2DJtq3pI77rf/CHPSCgUozBSfOwF1qsCOLLI7rkTQBOEpZXTumt/wsIXWn5NX9izV7TZ/yIlvn1tzSyPtdxKhTcEOq2LkKCDPZBNp32vwruoCRiox6VrzGLQI3nRgOEHmIxBo7at9Ow5nTiN7YQCyP4IWe4ytoTMarEsels7KGiqStw/faSuNLMcd2Ij80QCe6PDhtPLDKeobvwUE1NL15zf/sfuJIgZqEy/KwT/Nrk2GpJN08PxgD+wmrBEmbhcF/XPf3KH5PkaaipqYKDf+Nyrz5c/FPZ6LLNz9ZnLPdI4eQmF4ohw92kPiqNc2M7mQl2l+NnfhAViHqoD+wqai4D6dJFBHYHyYwjNlwGbq0pWTj+uUpZrH0SCrmBl0mUavcfsDPBd/LbYjnoWxah+2jvmwVMiIWqtTS1YVwaArOeq9q2tlHmy9Tlhb2skHe6krMxTi2Fkk0QLGD+15GRbPUVaeEmoNW4IhhEu+pmPEDSNavfkVA3Pn3QRMYfjYjKou3RL80+W8MZp+JEpvXDcFNl4fFQEPUaG1zJw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(396003)(39860400002)(136003)(366004)(451199021)(6666004)(6512007)(6486002)(966005)(478600001)(54906003)(2906002)(6506007)(186003)(26005)(53546011)(8936002)(5660300002)(8676002)(4326008)(66556008)(41300700001)(66946007)(316002)(82960400001)(66476007)(38100700002)(86362001)(31696002)(36756003)(2616005)(31686004)(43740500002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HsiAv1z8GOqtlI6S1F647ohEKFNIl/La8mCkzf5DU0JlWgl8Vr9X7Yzl/wo3qQWI4dq7x1/wdqS2RmwhTJ/kdb+G9dJe82Q1Pn2LZPmzdqUIP7yrYrc1dvksC6NNS/6M3q8FwhcpemOg+BVgCjmlhurOdiiPZJa0LrbHmIS7qaV6OcccsO3EFG3cFf0/VqoFfNWQngetyCVwaie/ymHua6/tsPwetLdcHIVXjjNGPpqwy8Ed5/u5aVdkBoJ0vXJnWIbRRDuVyEHJs9HhznYpeSXlQIuTxt3qj6tW17s89VzWHvj4EszuXgj3TQtFTq8jOQw/NAX82KhDR6lnIVwVm3KgMkE5FBSh9hZJ0xwH/A6cIMFXDxVFWksw6lkFKvlgSl5zK7/tjkBf9W2mAWS7Bn/2cZNNFFXrp9gNJ11lPHL7qw67UUJi0k42TK4FujuauQYZoda71woZecDFBHjcDd4Yhxpxu7sAdvLoxqTvVBwydU6bhd+BNuzOZMOAS7jfCIVgPEdRfOalhLOxI4DI/BBvPrZxUwzpDVTtY01dKNbUM+iO9QxYa
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 34cd6955-0f47-47da-4b59-08db7d49ec0e
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 11:21:05.2995
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: VDEFj+NahK4ulJcv2yzlnnyWUCO0YKW29+VS2PrcCD1+HjTj4UFeCKtvmQGrJtNLB81jblgCby2We8/1mTJ0tuUvfclzg3zWMTHnUBrTdfk=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB7115

On 26/06/2023 4:33 am, Penny Zheng wrote:
> From: Wei Chen <wei.chen@arm.com>
>
> Currently, ARM_EFI will mandatorily selected by Arm64.
> Even if the user knows for sure that their images will not
> start in the EFI environment, they can't disable the EFI
> support for Arm64. This means there will be about 3K lines
> unused code in their images.
>
> So in this patch, we make ARM_EFI selectable for Arm64, and
> based on that, we can use CONFIG_ARM_EFI to gate the EFI
> specific code in head.S for those images that will not be
> booted in EFI environment.
>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>

Randconfig has found a bug:

https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/4595568303

ld: prelink.o: in function `acpi_os_get_root_pointer':
/builds/xen-project/people/andyhhp/xen/xen/drivers/acpi/osl.c:73:
undefined reference to `efi'
/builds/xen-project/people/andyhhp/xen/xen/drivers/acpi/osl.c:73:(.init.text+0x8ac0):
relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against
undefined symbol `efi'

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 11:33:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 11:33:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559101.873785 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH0lW-00073z-DT; Wed, 05 Jul 2023 11:33:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559101.873785; Wed, 05 Jul 2023 11:33:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH0lW-00073s-AC; Wed, 05 Jul 2023 11:33:46 +0000
Received: by outflank-mailman (input) for mailman id 559101;
 Wed, 05 Jul 2023 11:33:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=asTv=CX=citrix.com=prvs=543a7ddba=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qH0lU-00073m-TE
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 11:33:45 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ca122e7a-1b27-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 13:33:42 +0200 (CEST)
Received: from mail-bn7nam10lp2100.outbound.protection.outlook.com (HELO
 NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.100])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 05 Jul 2023 07:33:39 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by LV3PR03MB7477.namprd03.prod.outlook.com (2603:10b6:408:199::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 11:33:29 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606%4]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023
 11:33:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ca122e7a-1b27-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688556822;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=j21lgw9NU0+Yn3gk7f3NFmLWy6YsieeH8EAnHE4vLYU=;
  b=GuUgMrgc1ltdFB4bXC+XsF95eAn67CZYXwNmWYsmx2FPbE2t//oA6UVb
   1XcEbESShGjQhp/iXRQvTKwLc3aFZvn8XURsAAq0YWI1cDEWCCnhrtQ31
   HSLv+jQXf/sZfScDxaXMp5twsVjpyYk1YYYXm/fnBRf/OKjsUS1yoQAlj
   c=;
X-IronPort-RemoteIP: 104.47.70.100
X-IronPort-MID: 115237688
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:hes7kamIvMi7D4mrcLVqfrbo5gx5J0RdPkR7XQ2eYbSJt1+Wr1Gzt
 xJMXzvXP6uMMGr9et1xb9nioR4F6JeAmIJlGVQ/+yE1RiMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5AKGzhH5MbpETU2PByqgKmVrNrbSq
 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/
 f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3
 aUWGDxOUT6Evd63wLm2Ee9jiOMcFPC+aevzulk4pd3YJdAPZMmbBo/suppf1jp2gd1SF/HDY
 cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVk1Q3ieC1WDbWUoXiqcF9t0CUv
 G/ZuU/+BQkXLoe3wjuZ6HO8wOTImEsXXapLTeDiraE00A37Kmo7FEU0eRjjr+mAtV+1C9BSN
 G054DI3lP1nnKCsZpynN/Gim1aLsxkGVNcWH/A87AiV4qHQ5BuVQGMDS1ZpeNEg8cM7WzEu/
 luIhM/yQyxitqWPTnCQ/avSqim9UQAZI2YNai4DSQot+MT4rcc4iRenZtRpHbOxj9b1MSrt2
 D3Mpy87750RkMoK2qOT7V3BxTW2qfDhVRUp7w/aWmak6AJRZ4O/YYGsr1/B4p5oM4KxXlSH+
 n8elKCjAPsmCJiMkGmHRroLFbTwv/KdamSE2RhoAoUr8Cmr9zi7Z4dM7TpiJUBvdMEZZTvuZ
 0yVsgRUjHNOAEaXgWZMS9rZI6wXIWLITLwJiti8ggJyX6VM
IronPort-HdrOrdr: A9a23:wk44b6CXgzkCl4flHemi55DYdb4zR+YMi2TDtnoBLiC9F/by/f
 xG88526faZslsssQgb6LK90cq7MBfhHOBOj7X5VI3KNDUO3lHIEGhM1+vfKlbbdBEWmNQttp
 uJmMVFebjNMWQ=
X-Talos-CUID: =?us-ascii?q?9a23=3AbfHC2WkbGhXZxmaJDV3yUtvfidLXOSTT/HuTHGG?=
 =?us-ascii?q?/M1poSLaYElmf9oRbq/M7zg=3D=3D?=
X-Talos-MUID: 9a23:EfXxUwnf/3U8r+Wc21FVdnp+bOVEoPygGHkygJ5WucSbFAFqIy6k2WE=
X-IronPort-AV: E=Sophos;i="6.01,182,1684814400"; 
   d="scan'208";a="115237688"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=SPKueWkKlYd73LcWADI/Ms5j/ppSQPXYxpa8kppRsgt1e7v8gCipdxcLupmFRhwWv0iaRfzdgGXvsYSK4uwnOvZtAww2S++D3YxvLWs4fMNlFnCPQI8bzYJQTnZDtnxUT+9oiSulPydNiVE2be71Ns78IdCv5HN3sJweKrETv3AG/PlD5wgq4RFwk5yw+T2vK9DujuMZJilSz5sQfIXygVsK7hOj0vn+yE7NMLPAFd3lhIxAQU95GUkwRCxDb2TiDSyTmFjiBBEZZXuJShgEf+bAmAVIRyVFb3I6yIMxVea4gmX8SO7uQIwWJ91UknthYqj8/UwSdtBa3bljIFPtRQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=q68qehWTC/YAaN/i7zcOXWAiNaBe8hg/BHivHXV3zhk=;
 b=n1nEX2nk5F5tJXb5uHTUgdbcV9LkC3lUbQxt8Pu4ohe31KQ0Js1/mHnkjTauCZU4IJso0q8C87ZknZKf+zwCU8ZJzwHpdi5u6QaJnDSIfyojObUtNvCdLWBiwzgAZ0p8bq5VvAwK69CUXZKOiTGlMOwIF+pufHz1OHA0cmAqMcc46amZXuB8DgQ7VyOYycQahjarkcxmAebhrCb/NHrrOZLeknn/X7hlpth6XX+nm9EzKwXofWrPtEagTha3rlNqLXJV6dHXA4rTU6D3UkuFWJageUg/EjmIkcmRH9njDh71nsdSlydB/r+IznB9ArF8qkqZinC4HlZuFWYgNZWUHQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=q68qehWTC/YAaN/i7zcOXWAiNaBe8hg/BHivHXV3zhk=;
 b=Z7xmjq79X/lyNKGMo1GHaiI8YrfcdW30kNCcva9CXi7nD38uMYRCplWfItR0GRVK3ueUIfk35MGI5FPmmpadg25zvgKtvtZk1jayZ+F+/JoK0FYp7EYn/ydH7lMRES3w2J34diZbTFZJY3aaTw5Vess4LmYcyXlkGvq4iuF82Xc=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <48a105af-2a8f-23cb-48ae-ead12ceadd68@citrix.com>
Date: Wed, 5 Jul 2023 12:33:22 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH 1/2] credit: Limit load balancing to once per millisecond
Content-Language: en-GB
To: George Dunlap <george.dunlap@cloud.com>
Cc: xen-devel@lists.xenproject.org, Dario Faggioli <dfaggioli@suse.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Wei Liu <wl@xen.org>
References: <20230630113756.672607-1-george.dunlap@cloud.com>
 <b046ddf8-d70b-e2db-f996-32e6a7164cd8@citrix.com>
 <CA+zSX=bqf4QspF=ZW+rWwkfNp3u4xYjzDipsJX9_j2CpdtdhLg@mail.gmail.com>
In-Reply-To: <CA+zSX=bqf4QspF=ZW+rWwkfNp3u4xYjzDipsJX9_j2CpdtdhLg@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0282.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:37a::14) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|LV3PR03MB7477:EE_
X-MS-Office365-Filtering-Correlation-Id: e6858e94-64cf-4e2c-36a5-08db7d4ba7be
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	hDhiaRbepGDbbYd8fjUt3sVC+OljFzVm4Z0sEt8Jw8Ru8ghmTjB0/w5Ko6IWY0T68WEScxfCRbHE9HfM9tN0lUTqxgVUwFo3n4+ueGjT1nUEi/mfeB0m+5WEP15nQ4enRdurOiS9ORYCzpeUKtBOgGkwD/w8SEjY3vGb5D2ZtjxUw0tFfjHF0gAupGwIkWackjzwnikyrzpDYBkM+JX61ZPyZWcEG3oYpo20YNd8DRACo0AiBArfqtdBzVkNaSVmrx+F1IyeHumlP22+wDzauRnvusmCNXXeaByQUeZYCtBrftqoSU07k3eXmlEe00XRFWnJ+nRsDf0L3y6hQbtl0KiXMEiQUSoxDk79sLtCHOcOHn0ikquYNVnB4UdqSAZ8FkRQktHWNz8/BBBX0hfpWHd2RKRb1v1j7LTGwvuZhRAkt64FVm+hLk1uoazMJlLZnY2n0B7Dk5/eRm9K8qEEzQ28s2IQRPi6M/Tr8VdgTbtXAzKS3o36z56XawOnB5mi9AHovjMTFQD+4tuBagAy2FOSfsnc/wNP9a3XlvLm95huwKq+LfZTQhUrcvoIMO40TWpJ296jJnGS3yDSPLKF2RhovMXoIonYDQ5QXi2cTGQqEfza5b57VKaBVvg6H+yTsnUJ6Yo54CCacPrd4tJTmw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(136003)(376002)(346002)(396003)(451199021)(36756003)(31686004)(4744005)(86362001)(31696002)(2906002)(5660300002)(6512007)(186003)(26005)(6506007)(53546011)(6666004)(54906003)(6486002)(82960400001)(66556008)(66476007)(6916009)(4326008)(38100700002)(316002)(2616005)(66946007)(478600001)(8936002)(8676002)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RDNwL1k2ZUR1ZTU2SUx4ODlYams3T0VBZDV6TXZqWEQwMFNnTUExYmlBK2NM?=
 =?utf-8?B?V1dGVEZVSzRyYVZkQjRuYWFselBzT1FrSFRjdlpib2JmQ2QwTzFjSTNIcElQ?=
 =?utf-8?B?dGp4QTNPUDU0R0x5YmNzWGVrTHBPS2ZkaVV5WnJOYnc3aS9LM1F0YnBZT1BF?=
 =?utf-8?B?aHpmYTR6aXJRUUtYMEpDbjZ3RGM3SEljalRqVzdTeVB1MGx5NVc4Nlhwa3Zy?=
 =?utf-8?B?Y0c3SG5BZVo4a3RHd0FaZlllOERrTkZuZk5TM05zOUlJckNjWk1rL3dxNFlJ?=
 =?utf-8?B?bHRONXhweERjVU5ZcWVBeGJIblFRR2VUOFYzL1lSSXM0SnRmOWcwVmd4OFhH?=
 =?utf-8?B?M2c2Y01rWE9nWHMwbXB0MmhPcGVWblpidUFySFlhVkhqa3VUS3NrVW83Y09V?=
 =?utf-8?B?STh4OGkyZkVDRnRaL05GUDRWRU53S2Nzb3pKOE5CNGMwTWhUYzc3M3pzTlBX?=
 =?utf-8?B?aWw1K0xvY0VLbEwwNW84UDJMRkpURXQ1VzhLOGR4d093cTVUTmlSRzdLSHJR?=
 =?utf-8?B?TnBsalZycjZzZWFFYnNwMFFoeGxndlFJVnlwRnJvU01KQ3VLTVkrTUE0RVgz?=
 =?utf-8?B?WE9CTHdQbzlVR0JjQ1VOT09aTDhuaTk2VEFkOVdjUTJxNUQrZExaVVYyc1dZ?=
 =?utf-8?B?RGhPT1RmTDVkN0xvZERRbFlTOUZwU0dockpsUE9nSGhFMEdDQTQ2c1huK2xH?=
 =?utf-8?B?Z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SF3hn7KLZiHjAHSGBYCVZ1G2pfuEAbmC7TBmSjNL26+OfYhSJusGe5YfQSivlfrpec3uvqrMbqBLtO6zGmzH6bsbW9F8GUs12IoTACmA6+myMwq7c+WW5EerYnHozFcoUOUZqjdoay/QOSrBwO/s1KjX/YAUSOl9paV77+sAFW2JX26CpJ82RZ6uWZX00VElbeaNcL1+oiNiDqwjyFZZEoU2mq97aXADBMUOwf/3cbRjDJQDbqG99n+VlafwYAYXr+nPeUz95/fnn3ZIZSf97yxVR6j740Wp3S1Aw9mczs1rqk8Cxnbf6EcEAqfVFJIxEU0CjKQLR7GtstjfWje8cGfLj82ubJ3/FyqMwBUCFGsmRZQY2awwYjttzcVesRj40fLyOSmojwcKmsQDp9UfpkOsCv2mDhpyLALWAp6G+gReaKcZ0kk4g1n+boj3yWGKEfTI11NKDcyt3fRGwQUSUWBy/bf22sU2urfUrwqxZp6S/dGdV5WqOmTnmSlbOjW6QwuAULL9Qb/iLuoYS6CztpUTvIkFjyXZlDrDJk0KaUrOIeUjtFMg6z27nRjJegQsXydobz4ZhFV/8gwZumrnLONBzug4td/vD8kLO
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e6858e94-64cf-4e2c-36a5-08db7d4ba7be
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 11:33:29.5798
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 62HQQcguWur63+AUI0/VskxPd45fNjhHGB5+flxwzBxdy/htvkz9FLeChhaRtQZl4o5mv/LGkC9Gn9a0uAjbT/3Jo1REohf5O23pX6tsYZI=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR03MB7477

On 05/07/2023 10:25 am, George Dunlap wrote:
> On Tue, Jul 4, 2023 at 6:34â€¯PM Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> On 30/06/2023 12:37 pm, George Dunlap wrote:
>>>
>>>Â  docs/misc/xen-command-line.pandoc |Â  6 +++++
>>>Â  xen/common/sched/credit.cÂ  Â  Â  Â  Â | 40 ++++++++++++++++++++++++++-----
>>>Â  xen/include/public/sysctl.hÂ  Â  Â  Â |Â  6 +++++
> 
>> Given this filelist, why the sysctl change?
> 
>> There's no logic to drive this parameter in the xc/libxl param get/set.
>> 
>> The only two in-tree users I can see are xenpm, along with an
>> unconditional print to stderr saying it's deprecated and to use xl,
>> and xl.
> 
> 
> Yes.Â  I think unless someone objects then, I'll drop the sysctl
> interface from this patch, and add it in a follow-up patch (perhaps at a
> later date, depending on how much time I have this week).

Yeah, that sounds fine.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 11:46:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 11:46:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559108.873795 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH0y2-0000BT-Gx; Wed, 05 Jul 2023 11:46:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559108.873795; Wed, 05 Jul 2023 11:46:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH0y2-0000BM-DW; Wed, 05 Jul 2023 11:46:42 +0000
Received: by outflank-mailman (input) for mailman id 559108;
 Wed, 05 Jul 2023 11:46:41 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qH0y1-0000BE-2D
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 11:46:41 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH0y0-0006Tj-Cz; Wed, 05 Jul 2023 11:46:40 +0000
Received: from [15.248.3.5] (helo=[10.24.67.21])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH0y0-0003uD-7j; Wed, 05 Jul 2023 11:46:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=lXvCSk08WPwL2c7BWWjOvzHxJbd8/PWfi6lIGz63fkw=; b=dv6cttt78RQ/s56KX9sqL39Xvx
	8I0BtUSSbcMkW+wOeRGoj/tyTQEDrWXaM5ZJSSUem+A/jC1cuZ3zTekWvqQb2v4yUWWMf7wJeTOnR
	++xvu+/nmNDxn8ywW3OMj1cCl4+Xv/X7NU0/fVzMoDRjf4QxFZ7e5QigHtpzvG1xEIq8=;
Message-ID: <886fdf18-5369-9b9c-2984-365b8ed404a3@xen.org>
Date: Wed, 5 Jul 2023 12:46:38 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [RANDCONFIG failure] Re: [PATCH v3 02/52] xen/arm: make ARM_EFI
 selectable for Arm64
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-3-Penny.Zheng@arm.com>
 <1956a273-27a9-d0e6-e328-be69ff91e5d3@citrix.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <1956a273-27a9-d0e6-e328-be69ff91e5d3@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 05/07/2023 12:20, Andrew Cooper wrote:
> On 26/06/2023 4:33 am, Penny Zheng wrote:
>> From: Wei Chen <wei.chen@arm.com>
>>
>> Currently, ARM_EFI will mandatorily selected by Arm64.
>> Even if the user knows for sure that their images will not
>> start in the EFI environment, they can't disable the EFI
>> support for Arm64. This means there will be about 3K lines
>> unused code in their images.
>>
>> So in this patch, we make ARM_EFI selectable for Arm64, and
>> based on that, we can use CONFIG_ARM_EFI to gate the EFI
>> specific code in head.S for those images that will not be
>> booted in EFI environment.
>>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> 
> Randconfig has found a bug:
> 
> https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/4595568303
> 
> ld: prelink.o: in function `acpi_os_get_root_pointer':
> /builds/xen-project/people/andyhhp/xen/xen/drivers/acpi/osl.c:73:
> undefined reference to `efi'
> /builds/xen-project/people/andyhhp/xen/xen/drivers/acpi/osl.c:73:(.init.text+0x8ac0):
> relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against
> undefined symbol `efi'

:/. That's because ACPI depends on UEFI. I will send a patch to update 
the Kconfig accordingly.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 11:48:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 11:48:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559112.873804 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH0zL-0000ir-Qx; Wed, 05 Jul 2023 11:48:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559112.873804; Wed, 05 Jul 2023 11:48:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH0zL-0000ik-Nu; Wed, 05 Jul 2023 11:48:03 +0000
Received: by outflank-mailman (input) for mailman id 559112;
 Wed, 05 Jul 2023 11:48:03 +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
 <SRS0=hFzj=CX=citrix.com=prvs=5438f3518=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qH0zL-0000ie-2v
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 11:48:03 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c9d5f01d-1b29-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 13:48:00 +0200 (CEST)
Received: from mail-sn1nam02lp2041.outbound.protection.outlook.com (HELO
 NAM02-SN1-obe.outbound.protection.outlook.com) ([104.47.57.41])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 05 Jul 2023 07:47:54 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by PH0PR03MB5718.namprd03.prod.outlook.com (2603:10b6:510:40::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 11:47:48 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902%7]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 11:47:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c9d5f01d-1b29-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688557680;
  h=from:to:cc:subject:date:message-id:
   content-transfer-encoding:mime-version;
  bh=51gqjf1YS6obMPSOc6sxI7IlSPb3irKbpmSYuFSjz5U=;
  b=aepftzVY1cssLSLt4KIbKwpPReQoHI+lDzeevEWg2IRMfyhhLJURRUm8
   FDc08unCYkms30A8jTThSw+pyUVNHu/9vV0MtIYhizwjUpxe9gFuvvi5D
   /BR7fzcRl5zEMsgVBGZ+nnmhRQ0oUcKz0RaxtR7B5VZUxdvO//YYsUwIh
   8=;
X-IronPort-RemoteIP: 104.47.57.41
X-IronPort-MID: 114522347
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:CujpBq0QQNZkAKBOK/bD5fRwkn2cJEfYwER7XKvMYLTBsI5bp2AGz
 TRKDzzUPPaLNmSgLo0jaYrn9U8H7cLUnNdqSws4pC1hF35El5HIVI+TRqvS04F+DeWYFR46s
 J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo
 tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5gNmOKgR1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL
 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ
 OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfMTh+6
 fk7EHc0TA2Khbro+vWCG/F3v5F2RCXrFNt3VnBI6xj8VaxjeraaBqLA6JlfwSs6gd1IEbDGf
 c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxqvC6PlWSd05C0WDbRUsaNSshP2F6Ru
 0rN/njjAwFcP9uaodaA2iv12rKVx3inB+r+EpX7+6drpQy/4lYDCSQTV2CKgcPkqk6xDoc3x
 0s8v3BGQbIJ3FymSJzxUgO1pFaAvwUAQJxAHusi8gaPx6HIpQGDCQAsTDRMddgnv88eXiEx2
 xmCmNaBLSNrmK2YTzSa7Lj8kN+pES0cLGtHfildSwIAu4PnuNtr0kuJSct/GqmoiNGzASv33
 z2BsCk5gfMUkNIP0KK4u1vAhlpAu6T0c+L83S2P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scan'208";a="114522347"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=PjqyACE4Rm8HnL4tfzwaRdeeq0cFBxxcxGja5sb+C8Hr3NqIaIa8AQ6GTlDEsUEDw8GPU0C1T+lU1Jl++XDDP0jyT0T+jC5OnfyPN1v34ylIjtNCuwSbQVZ7yE9S6oLM3YQGxguHocEFoGksLv77f2nnkisoXhx0tHBh63kS7QOdcre8ckK0pvX7F7l10t0Db2lK879dzHbYCusOavFhb37dMuFJL9BrSZ8mXC7dbXDjJfbD+F9NLh3MPhGv3R4NT+vDSl5w2E1VIX45OuRr3BsG4KB78KgLK3g23ox/3V8NIonbexJ6iPIlv1PG0uPl3qTmo1osKMGkSVtN8DeuEA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BH8cZ+Sn26CIH1jKYtqzqcmUZfi0hDkjTz7umGx38vU=;
 b=bvfV8bwrQxZCy1hFhn9x49G4Fz/bInCoJGb//SbhCbaGp5BAwPWly8RbxKjGb8+LPcP/aEQ3aOwo6++MOSY7198ct7RJ4sAnPNHNiPs7JxnGdrKRXJAFjBPlyUU4lEc3ESn08/0H4D8EE8fXLTgfbAhbek4qoV/kAUYEhjtBZq1hQ5N7RlQG/hFGTC193UisZT4Lb5iK9iHO6Gnk8nYKKl6M0RuC0HPFSUvOdgbgDIpsgr87BgK3XH0npCQbsG15awbtnviDJopvJ6qVvvmvYDc22za4+V1Blhh/Q45Sd1+Lu7lIu708tJoIhhvWyZSgq7a9bLKUY6IunhlbCPKQ/Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BH8cZ+Sn26CIH1jKYtqzqcmUZfi0hDkjTz7umGx38vU=;
 b=ieatkynIOYW5uAw1LmXFeJfUN0k2DrccK6a8GAIoMIQB7hvTur2BLrlYVa4rsaXH7cyp+3uQ9n7nSB1czUGnDSDzk0wQgBOuS4MyI/WuObFcwyXvgtIVI5zvHiZSfUdvn0lDqdbYtn5qr2JJiql4x7y9zyKvEgCYTwfyUHwJkCs=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v4 0/3] x86/gfx: early boot improvements
Date: Wed,  5 Jul 2023 13:47:38 +0200
Message-ID: <20230705114741.11449-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0012.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:150::17) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|PH0PR03MB5718:EE_
X-MS-Office365-Filtering-Correlation-Id: 007ea356-0412-4a29-0575-08db7d4da728
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	j2pGQzZunpx93JfEzfGfRaeJSMr25XIzDrKO16kbG9z2NroXEAdHNkjldFSOv2Bb5EEttNCIZ5DJaF2GFa5UEEKUP4czKXm9mGgtD5ikqygLPeJ0bWg1dArw7YqDiiKPY7IsGHTONm9TAI9XoCcHDZ4fLywkw5K8ebCfxRItr3k3ysF+82OYLruuUkTBWPTRFlkvBD1gfEb4Wuz6/QQD6e7HW0QEHy9khi6glh0ez3cNoQ1notUrl+fdVZ7Yj1q002f67ckFax1q2hcNvAhOrJahA0W0EYoeIGnFaQ7rx9QLmSYjYYk8v6tmkuFWDSqLhlthN6PCVjzfeW/Xra4fm9S1EO76usr3tpjdqnRVFnJSJAVm8GRDC4aoHAPPp0ceT2oGmRw4IauGUzyjHDtrYPT0wdQ4TCoB/aJyogDbW8WwPtokZ4zOaObE66ElBIXkcR4yOdtJ7VYakSoMAhym3CxJ60PtMJroTUcybREDZyZL0ZVr1m9dZTyQ+GGtFVrcJj6PU3tyGJ6jPobxNuFs1MwaI0F+S7FrnNniM1TlYZaYgebwGIb6t8qKzk0knMho
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(346002)(366004)(376002)(451199021)(186003)(82960400001)(478600001)(6512007)(6506007)(1076003)(26005)(86362001)(2616005)(6666004)(316002)(83380400001)(54906003)(38100700002)(6486002)(66556008)(6916009)(66946007)(4326008)(66476007)(5660300002)(8676002)(8936002)(4744005)(2906002)(41300700001)(36756003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZXQzNm1PQzJabGN0Nk4weFNFVEF5VmpPNVl4K3ZESjFKeHVRcGo1VFk2SklT?=
 =?utf-8?B?TEsvZ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yYhHo/gEz6o3JUJ3nuNgz58b219Gz275pE3P2mcCX+hBw7EzCnrZkxdTTK8hp4kEyZXTzFX4yNGNJTz0Hpki7BCMtTX45t4P9bUsNenRI1XvJT9zSdCxdm4B08RXKnCgSWlmjZbqZCtnIZ+EtKXbl5a4V4khhXJ78dCw3Dc1jmTe7rQy9wcGspMRbaRPbJqZutSGyTJrM8cqe/4NV9mcB2EseGsSb6oXWFJqWJGDIomNxRbk4P32EUb2GJ3X7tRJfxJ/HKvgEd2UBzEuM41mYHysnG7Lc
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 007ea356-0412-4a29-0575-08db7d4da728
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 11:47:47.5336
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: p7ZWDRj4sDlqIYvXCStWCuBoHHrZaTwJb8RCfPgDnIa74fLRgqtJPOKX/lfgjISIDX8YxlzsoPP3/wyf8DoR5Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB5718

Hello,

The following series contains some fixes and improvements related to
graphics usage when booting Xen.

Proposed patches fix some shortcomings when using multiboot2, like the
ignoring of the vga= parameter and forcefully switching the console to
the maximum supported resolution.

Thanks, Roger.

Roger Pau Monne (3):
  multiboot2: parse vga= option when setting GOP mode
  multiboot2: do not set StdOut mode unconditionally
  cmdline: parse multiple instances of the vga option

 xen/arch/x86/boot/cmdline.c       | 83 ++++++++++++++++---------------
 xen/arch/x86/boot/head.S          | 13 ++++-
 xen/arch/x86/efi/efi-boot.h       | 82 ++++++++++++++++++++++++++++--
 xen/arch/x86/x86_64/asm-offsets.c |  1 +
 4 files changed, 133 insertions(+), 46 deletions(-)

-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 11:48:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 11:48:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559113.873815 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH0zN-0000yB-5o; Wed, 05 Jul 2023 11:48:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559113.873815; Wed, 05 Jul 2023 11:48:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH0zN-0000y4-1e; Wed, 05 Jul 2023 11:48:05 +0000
Received: by outflank-mailman (input) for mailman id 559113;
 Wed, 05 Jul 2023 11:48:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=hFzj=CX=citrix.com=prvs=5438f3518=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qH0zM-0000nM-BM
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 11:48:04 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cb5a6f32-1b29-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 13:48:03 +0200 (CEST)
Received: from mail-sn1nam02lp2042.outbound.protection.outlook.com (HELO
 NAM02-SN1-obe.outbound.protection.outlook.com) ([104.47.57.42])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 05 Jul 2023 07:48:00 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by PH0PR03MB5718.namprd03.prod.outlook.com (2603:10b6:510:40::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 11:47:58 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902%7]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 11:47:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cb5a6f32-1b29-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688557683;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=AKU486u+7V2Xni1iRq+MaEEwYMswYGdyLZUMhihfHfI=;
  b=GVBp9L7pWqwFDxpXfQ1XYJS3WZkMw7lEX2pvLAhjQgElunGgGU6RXXJe
   Cu6TSWCvYn//uGT3mb1URYIG9tQ/Snybv0loE7GcmE876Tnlbb1s0TFpG
   qrSACrYgiBmy8E7jkafS2YI6DGNSPBgiPOn/+8i4GGXukFoZOJOm+I/07
   w=;
X-IronPort-RemoteIP: 104.47.57.42
X-IronPort-MID: 117786678
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:5pvWsawrgW9FfL6YxIR6t+cQxyrEfRIJ4+MujC+fZmUNrF6WrkUAy
 GZLXz/UOamJZzekKtFxbo6180wEuZ6Bm9JnTVE+ryAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhPa0T5jcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KTto2
 NcyA2sHVQLZnv/v++K+ZLZwmMt2eaEHPKtH0p1h5RfwKK58BKvlGuDN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjeVkFYZPLvFabI5fvSQQspYhACAr
 3/u9GXlGBAKcteYzFJp91r137CQzX2lB9J6+LuQ1sVqnHS2+HMpNCIVbEG9rKeHiEKSVIcKQ
 6AT0m90xUQoz2S7Q9+4UxCmrXqsuh8HR8EWA+A88BuKyKff/0CeHGdsZjxLZcEitcQ2bSc3z
 VLPlNTsbRRwtJWFRHTb8a2bxQ5eIgAQJG4GIDQCFA0M5oG5pJlp1k6VCNF+DKSyk9v5Xynqx
 CyHpzQ/gLNVitMX06K8/hbMhDfESoX1czPZLz7/BgqNhj6Vrqb8D2B0wTA3Ncp9Ebs=
IronPort-HdrOrdr: A9a23:OWV6oq9mjMz71UJkHcRuk+G/dr1zdoMgy1knxilNoENuH/Bwxv
 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w92LC8Duw8slymrmHq+PUvA2o1LJD+XcWB8L2YH04Tbvdo4hIgjVddzKPWy41boJI0NzcSzymq9x5lPUS2txUSr36SXc9+c9Nr8zM0j4QpXJmiOEqhh5sL3o7hXdnAj+Lh8V1d6yylSbsbaey90+WNuPpUogbEYmqsJKDauE95iIF38/xWe2uLCazZQ17KlPeeBYFQV39iQtZMccG9lhCxBjairdKuUm40U0MLSCC6hS7k0jHou8/1AslCYEmLoamBHvLFnTnYe/feO8v5PK+R4W1L5RPg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=R8YvMDDpI8T971tJbHPd1tPqKr7FAFvy+J0vBuvNH0M=;
 b=Yf3ZS/gHweAnZwu0ozs3exFprFZ495m9olHaMOwaIpi8XJDYyFLtdz4ndhaBMuzt1xnp6X2osKqwN/2JnEeB/p19SuEOgV/a5mk9fKV/gXwSoygkD8V3XICOXvu9YEcVpQ0Wnk+z7D044zuEjiF7em1eV2fzodQ7zSgeiYxQAOjwrXKIv9a14EpTLNrFJtDiKhIibmB5zLNgLe84X6j3V0OCdSQV7DivEe0CSLxC3EcB8fHiyb56k+daDb5p01gaRhdtb8KtCcjeZI0MKXAB+p0rlvSxkdJeElH2XMJ/zOhNw7v8pYD1j3BA4yni1f9/Heejy8KoPkRFFZmS1ao2Lg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=R8YvMDDpI8T971tJbHPd1tPqKr7FAFvy+J0vBuvNH0M=;
 b=Rd9fQfwcBFCnVb7424nUOGpy18j4kjEk1jZBbXnR9OBEpCvoiDo1gFMqLir1DeLKImJsb1NWfzHICjiszeuHEAzed6KYeuSoHIoqIfTBZzSzmc5Y9Rwue/qtJDZW2pPMGW+dVw38G6mtuji322XjeVDM8XWOj16ulJ8vVZsFF3k=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v4 2/3] multiboot2: do not set StdOut mode unconditionally
Date: Wed,  5 Jul 2023 13:47:40 +0200
Message-ID: <20230705114741.11449-3-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230705114741.11449-1-roger.pau@citrix.com>
References: <20230705114741.11449-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO6P123CA0049.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:310::9) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|PH0PR03MB5718:EE_
X-MS-Office365-Filtering-Correlation-Id: a7950b4c-759b-4c1b-a8b1-08db7d4dad8d
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	JZ3urN4fzyyu1MCxL0kMBauazYdnCPSj9J3zkY9AL4vXHepHqL2ond9WymrtRTQYEW98XBjqXwzn3SxtRRmL2jeyfvyEZ6cWkbJ4chk66HwgD4GS+iCNsCmZoDfzERW+XRkUKjV4GsqCMYPC5Ej91A8a26sHl4wHgIvb7mvKvBLkSouNKvqgIA31NOeHTuA7eHwg3ipZXgQZ+rtMoxqiwd9xIFjguGwD8FaFudSq+h4mxVosmR0jFvbRTnyU+7PBrB16z2lCtoD7OUjE5kiIevy9lCeceg8nBNQ21T9zcHnp9pbzMwDox5XOw6ogRhCSRP21mg0QbvrQvxm1FefYF9+d2amxtCwl7QVk5Up+ZIFdTq2jDwJj/jJD8/l28iiM1s+lsqIvYK34uwB/HLKaldbc5ZgFWQ0V4qle0KOjOfAJDCmicbt6S5nt5I61lqa0v5ZmSe/AydgVo0ABlFEegVkZOOVQomm/ymoI8dalBa8cIzYv763jKdVszh5r1s15F4ykXCTreyTegFv5bxCGbkmTsSdd4IyIg8IbxO5mnKP668X1XrjxvVk9nkWNRYNl
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(346002)(366004)(376002)(451199021)(186003)(82960400001)(478600001)(6512007)(6506007)(1076003)(26005)(86362001)(2616005)(6666004)(316002)(83380400001)(54906003)(38100700002)(6486002)(66556008)(6916009)(66946007)(4326008)(66476007)(5660300002)(8676002)(8936002)(2906002)(41300700001)(36756003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?b0t6L1hVRzFTNmZrS293Z2JlZCt2Q2I0eUcyaXBqTFlqOEhKMVVRRDZ4RlFI?=
 =?utf-8?B?b1VsM01aNzJCRHhSeGxoaHh5RHNqY1JJL0MzQ2xIVEx0a2JMSDUzd3JqNG0v?=
 =?utf-8?B?MXF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kFXa1QHqTmQqm1Njayl+wWPs5HpnFVBItyfsEY/SBRqdeh3IEkaZM36arpWC1oKcrTXxoKZsOHUyEsDxzOYWND7E6qPaoYPoNAFI0svx4tLfZdND0aUNUbroxYw1E4OpUjB+mKPkmFL3ecc0rZbTGCF5K3F65CaWFeBGcWcdznitucEZ/qTDrJeoexPbDVKKNgSD4dAikwiyid2+7FuXZZ6UhrrNREgEQ6dGN/rO4HvSSWdjxPXQ1oYBkVTL6R3fWUtLW4ycuFrQKtmR
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a7950b4c-759b-4c1b-a8b1-08db7d4dad8d
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 11:47:58.3914
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 12M+438blw2Y6ptahfLZpiE8scMhS4A2fLCbdLa5PJh1AdxEyoocOvEYtaO+ULOugZZT1pl1rS4Lh1B05B7IGQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB5718

Only initialize StdOut if the current StdOut mode is unusable.  This
avoids forcefully switching StdOut to the maximum supported
resolution, and thus very likely changing the GOP mode without having
first parsed the command line options.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
Changes since v2:
 - Use approach suggested by Jan.

Changes since v1:
 - New in this version.
---
 xen/arch/x86/efi/efi-boot.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 4394c7276aa3..a13a335d24a9 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -829,7 +829,13 @@ void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable
 
     efi_init(ImageHandle, SystemTable);
 
-    efi_console_set_mode();
+    if ( StdOut->QueryMode(StdOut, StdOut->Mode->Mode,
+                           &cols, &rows) != EFI_SUCCESS )
+        /*
+         * If active StdOut mode is invalid init ConOut (StdOut) to the max
+         * supported size.
+         */
+        efi_console_set_mode();
 
     if ( StdOut->QueryMode(StdOut, StdOut->Mode->Mode,
                            &cols, &rows) == EFI_SUCCESS )
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 11:48:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 11:48:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559114.873824 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH0zO-0001E3-Dw; Wed, 05 Jul 2023 11:48:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559114.873824; Wed, 05 Jul 2023 11:48:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH0zO-0001Dt-Ag; Wed, 05 Jul 2023 11:48:06 +0000
Received: by outflank-mailman (input) for mailman id 559114;
 Wed, 05 Jul 2023 11:48:05 +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
 <SRS0=hFzj=CX=citrix.com=prvs=5438f3518=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qH0zN-0000ie-0V
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 11:48:05 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cc251a14-1b29-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 13:48:03 +0200 (CEST)
Received: from mail-sn1nam02lp2041.outbound.protection.outlook.com (HELO
 NAM02-SN1-obe.outbound.protection.outlook.com) ([104.47.57.41])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 05 Jul 2023 07:47:55 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by PH0PR03MB5718.namprd03.prod.outlook.com (2603:10b6:510:40::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 11:47:52 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902%7]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 11:47:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cc251a14-1b29-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688557682;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=Xu8jv7IgkcRUE/FiwP8HIt/7kSmCnukE8JV2qsMCh+U=;
  b=d4sYXYQvwAEsLhSbsOxS2tn9pNWWHxJFsI3xfvgP4qf8odR9HyHeretN
   uzPPG/56cEJMuiQt3TU3YpTVXDLQZ6wnHU7dG1zsX5UxIOUf1M9ZxEBH6
   4O+Y4LBgNYpFzFJUtf1pIywKWcSCcaF+qKl/0MCo9yk3GB5z30USm/dtz
   w=;
X-IronPort-RemoteIP: 104.47.57.41
X-IronPort-MID: 114522350
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:VlNw4aMoPTJydinvrR2ClsFynXyQoLVcMsEvi/4bfWQNrUom1DwPn
 zRLDT2BPazYYGaheNkjOYng9hwDuZPQxoQ1SQto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v
 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/
 Nj/uKUzAnf8s9JPGjxSs/vrRC9H5qyo42tH5gFmP5ingXeF/5UrJMNHTU2OByOQrrl8RoaSW
 +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ
 HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0qFXPWBUp
 KVDEw4mNjmo2+uTmuieZ9A506zPLOGzVG8ekldJ6GmDSM0AGNXESaiM4sJE1jAtgMwIBezZe
 8cSdTtoalLHfgFLPVAUTpk5mY9EhFGmK2Ee9A3T+PVxvzG7IA9ZidABNPLPfdOHX4NNl1uwr
 WPa5WXpRBodMbRzzBLcqy7x3LWUwHuTtIQ6CuSS7K5B0V2p4EseKEMGTXmfrN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=?us-ascii?q?9a23=3Aw2wsw2qV0L+dSZYhT1XIa+/mUYcFTnzHnS6LGHG?=
 =?us-ascii?q?TUU9CFLSwEwW11Zoxxg=3D=3D?=
X-Talos-MUID: =?us-ascii?q?9a23=3AxMdU5g/7JXmnBulVgDkdHAiQf9kxyb7+IxENq7M?=
 =?us-ascii?q?htunaJTRSHzqznh3iFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,183,1684814400"; 
   d="scan'208";a="114522350"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=PMgcmzMeqEModnRR8JDGobDqehOMzO8wfTltfnqpDjfHkLGh8epc+eLYbenbMeyu0u0Kpomid8TWrTqmOsbish3IBjTT8i4olXw5qP+DCoK9mZs+nk+hqkPfDnwQrfSRJ0VaLs78meqpNMNluuvNYDZSbVIa3xAL1ARCl4zrDlmzAswoDXTDFjOkvQUzzs+4Z3bSbPL6fl7VycYmSTFUNjTi7RQLMAkV9MMgiPBYdzbwWOxzHc6iJi6eHRCxRqDRkAh4GmcJGU0gXdWVDaTf9UU1Lj23oSd8V3kHc6wSRyqOhMevF7m/G7P8nAa8oHREBjt4kp08OxeXdcp9rY/3Mw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=S5lU6Y2Zp/yt/v9at2Re4kK9dwJ//xaxqBkbP+le2gk=;
 b=VQDZenYool+cDLf0KUZWqtOnuVDn7/moKmanVWchf0tJsiUBX2Niocb4kbc8hoJCyMor44z2oZwtdeVEGARTFC+jbSAJzVe7zNC+MJ00xjq6nGC92jpGMbsR+dCOSaOMY/gGXC8EardceeM3Pr/aEgy8Suwx9+C8IBqUF61RvVMZknMZaPcfybR+7aRHIs6kcfE7qDQxr7Lw4RnFONFK8YAmj+vp8vu/qFHy3HF55Cukmxq7jJfPDsUbNYmgfRycU1fIVmyjlhsYM09jGU6N5ryn7wmNfOjGqQXHAKMsl9W9s0kyznz1yUiDqEfmYYCdWDNY1IB0mN5qCX2RsD3iUQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=S5lU6Y2Zp/yt/v9at2Re4kK9dwJ//xaxqBkbP+le2gk=;
 b=ccMdENAs1t/Wyd3Euul5aS2HftOHFec9vdSsxuEFQElPBB/ngl1ilFojSPpmpEhefGwGUwkSxUbCeZUaFZTnTi3UowwM2wNDVr6MWGZ3U6ZAl/lm69VPnCZh3TAnJ+iYy1Epfa46V7Te7rguiCFZG3suYjIMSD3dcxdlXfwqOsQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v4 1/3] multiboot2: parse vga= option when setting GOP mode
Date: Wed,  5 Jul 2023 13:47:39 +0200
Message-ID: <20230705114741.11449-2-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230705114741.11449-1-roger.pau@citrix.com>
References: <20230705114741.11449-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0123.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2c6::10) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|PH0PR03MB5718:EE_
X-MS-Office365-Filtering-Correlation-Id: 037a5203-ae00-44d5-8222-08db7d4daa33
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	fSQJF7Pv7XKvy0mqJlBezj2HPwqKg7xG12cFrZBdpyDrEf9F+YqdwvuVWvyDa8h//dGoJsTzR5yL2oKigZyGCistKxS3ukE+VwRthlNw1J5FgLClEL0me+3oyOKJFOA66xQqiQwwQ4+UpG+4Zb0bAZ7wJHhP5/UfWkZ5Hrd83P4QKsrkbzYHorwKZaeQBgVdwKltlMytj2zILjXitARMpHaDieZGgbwfrBNS9aE/fGKHuw9DVNbwP03u5xFo0jNmpZi/TYaTjm5YgEVJuxZbdj2AAZ38hxJihwBMj04c2ZILeHTIyGRXBhQhGE7fY30plAyfm+3Xr5uC/VPopzZ5MtpEmSG1BAn27dOnZqWM7zRU7UyN3yUW0e+wgfAoYV+cyR9FKkg0U/0C0CxRnE85reKhMugwB51OTCI6D/V4hQtBBO/GRFovCPYnL6qLUlrVQgKmMiAeGjYUtRr+zfr7Fi7YFUqa2uqGv83f4OI6gU5Yu4ziSsxJ1n+TKn02MI7NUbAw09Bt0OIfWDUIGc4IBMQEQxkQl/Qurz9Qly87S3znPJvHnA352EfF64gEejYE
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(346002)(366004)(376002)(451199021)(186003)(82960400001)(478600001)(6512007)(6506007)(1076003)(26005)(86362001)(2616005)(6666004)(316002)(83380400001)(54906003)(38100700002)(6486002)(66556008)(6916009)(66946007)(4326008)(66476007)(5660300002)(8676002)(8936002)(2906002)(41300700001)(36756003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MDB4dCtwTGtGcjk0NFhESm5PM0NXYnM2L0xrRnpncDR5bDRDaGMrL2dHSFp5?=
 =?utf-8?B?RG5wbjBNVVp1OEh5SFpZUWNzenZPMlc0bzkya2JGWTh5N0VOcUlRWHNXRGt4?=
 =?utf-8?B?RWw5cElqajhVMTJqMGRVc3FJR0VwampHa1NhZDZyaytRRUprK0xEZUdmY3Fs?=
 =?utf-8?B?L2l6QnRoR2NvMUViekFoRDNPQ2dYdGpFeGJKQjJWSVNndHpZK2NOd3lEazF5?=
 =?utf-8?B?RUhsUzVVSUpnRHpoNU5IQmhzTm9iYXRDcnU1MGlGN0djek00ejBLUUxjZURH?=
 =?utf-8?B?cXNJUms0ZWFWNXlWRG05d3Z1ZkhPa3hzY1VNeWhNZFM3N2JCZDNtOTBHOWJF?=
 =?utf-8?B?OHp6cmxFRHNZL1NDVWROcUdxT2lHWjYrcXhCd3liY1ZwYnpMMDRwVm56d0Zm?=
 =?utf-8?B?aytPSVAyZ1AwVnpRNk1pQk8zRmh0RnpvWktVOXUxR2RQUEMvd0I1TmhmeVlu?=
 =?utf-8?B?YnFsZXZGdW0raGpBK01ibnNCTFhZaWJCZGk2WGF1cjBWejRzQnBvVEVHZ0l0?=
 =?utf-8?B?ZHg5OEhVZTNwU1BSUGxjTktqTGl5WVRLUXhBdklUZC9rcURuNVJxekNjNHJ1?=
 =?utf-8?B?YVhNR3FHTG9xamY5SHl3NWpoVytpbXp6a2RPbStINnJmbkFWUXdBMWVhSW1x?=
 =?utf-8?B?aU1OeE9XZmF6NmM5WG5mSlQzS3p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47foKVLjC9COmNCYa5DPeAfGUXgW0+uS/QgR0uRU4rFEJI0q1hVBAYehOvqGN5vWUbUh9KymubqPr3PVjQOkqVvN72Tad+gt4SwA1rEp3k7kZwtUEX7XzBM1g0J3vvgdRgyOUizqcEkdIWmYwAo0M4f2ziVyTG+f04Z6tB9rqmN8ZL5Gkw4CbkGtUiv4CTpxm6eYdIzwiKKHN16dBrJvXp30pa7LmmXFBBwmt7gBdMVuyW16LgKdV+UG7D7xZrdzc2ETmjdx4jC3JZQEBlsZxlZr4V8SgPPwCxCN3oAYyKwO1McDb42Tf0Rzat7wuftaSrV9QEDDTtVrKKEr9vtM5Zb32uBqgzBBEOkZQvVt5+JWMjOR2TC8f0W5zGgf3KXdasNkDI0NhKzmfioHSiwXvlKvMCocVH3EPf6KFrswugrDI4bE3OmgJH6lJVdLKb5GqmLX7rCiOCFwyM/OaiYN+sS54/7neZ6cqhVBpbXfbL3rlfp9vmB0oIUmN9ToVlsm01OnYs+ytX8GEQxs3WOKvEJUbrvNaRe1WqoK4a9wCg0DmCQ+flmq0L1qlHykHQ+xRVaUf6nwLmG1vLPF5H5Gnk27/wH57MG9oMuRwcp
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 037a5203-ae00-44d5-8222-08db7d4daa33
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 11:47:52.7346
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: X6ixaL/nfXriLOd9IGAKKv/fSCEflunpvLJJBWWaFJMmOyGPZjCiZJ8VFtSeqUxpNaz274GwYhThhc0L6l0AKA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB5718

Introduce support for passing the command line to the efi_multiboot2()
helper, and parse the vga= option if present.

Add support for the 'gfx' and 'current' vga options, ignore the 'keep'
option, and print a warning message about other options not being
currently implemented.

Note that the multboot2 command line string must always be
zero-terminated according to the multiboot2 specification, and hence
there's no need to pass the string size to efi_multiboot2().

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
Changes since v3:
 - s/last/cur/
 - asm style fixes.
 - Add note about cmdline always being 0 terminated.
 - Also allow \t as valid option separator (as space).
 - Expand comment about expected get_option() behavior.
 - Always check for valid option terminator.

Changes since v2:
 - Do not parse console=.
 - Allow width or height to be 0 as long as the gfx- option is well
   formed.

Changes since v1:
 - Do not return the last occurrence of a command line.
 - Rearrange the code for assembly processing of the cmdline and use
   lea.
 - Merge patches handling console= and vga= together.
---
 xen/arch/x86/boot/head.S          | 13 +++++-
 xen/arch/x86/efi/efi-boot.h       | 74 ++++++++++++++++++++++++++++++-
 xen/arch/x86/x86_64/asm-offsets.c |  1 +
 3 files changed, 84 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index e03f52c75535..1eb829ab419f 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -237,9 +237,10 @@ __efi64_mb2_start:
         jmp     x86_32_switch
 
 .Lefi_multiboot2_proto:
-        /* Zero EFI SystemTable and EFI ImageHandle addresses. */
+        /* Zero EFI SystemTable, EFI ImageHandle addresses and cmdline. */
         xor     %esi,%esi
         xor     %edi,%edi
+        xor     %edx,%edx
 
         /* Skip Multiboot2 information fixed part. */
         lea     (MB2_fixed_sizeof+MULTIBOOT2_TAG_ALIGN-1)(%rbx),%ecx
@@ -277,6 +278,13 @@ __efi64_mb2_start:
         cmove   MB2_efi64_ih(%rcx),%rdi
         je      .Lefi_mb2_next_tag
 
+        /* Get command line from Multiboot2 information. */
+        cmpl    $MULTIBOOT2_TAG_TYPE_CMDLINE, MB2_tag_type(%rcx)
+        jne     .Lno_cmdline
+        lea     MB2_tag_string(%rcx), %rdx
+        jmp     .Lefi_mb2_next_tag
+.Lno_cmdline:
+
         /* Is it the end of Multiboot2 information? */
         cmpl    $MULTIBOOT2_TAG_TYPE_END,MB2_tag_type(%rcx)
         je      .Lrun_bs
@@ -340,7 +348,8 @@ __efi64_mb2_start:
 
         /*
          * efi_multiboot2() is called according to System V AMD64 ABI:
-         *   - IN:  %rdi - EFI ImageHandle, %rsi - EFI SystemTable.
+         *   - IN:  %rdi - EFI ImageHandle, %rsi - EFI SystemTable,
+         *          %rdx - MB2 cmdline
          */
         call    efi_multiboot2
 
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 64c1a02cf10a..4394c7276aa3 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -795,7 +795,30 @@ static bool __init efi_arch_use_config_file(EFI_SYSTEM_TABLE *SystemTable)
 
 static void __init efi_arch_flush_dcache_area(const void *vaddr, UINTN size) { }
 
-void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
+/* Return a pointer to the character after the first occurrence of opt in cmd */
+static const char __init *get_option(const char *cmd, const char *opt)
+{
+    const char *s = cmd, *o = NULL;
+
+    if ( !cmd || !opt )
+        return NULL;
+
+    while ( (s = strstr(s, opt)) != NULL )
+    {
+        if ( s == cmd || *(s - 1) == ' ' || *(s - 1) == '\t' )
+        {
+            o = s + strlen(opt);
+            break;
+        }
+
+        s += strlen(opt);
+    }
+
+    return o;
+}
+
+void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable,
+                           const char *cmdline)
 {
     EFI_GRAPHICS_OUTPUT_PROTOCOL *gop;
     EFI_HANDLE gop_handle;
@@ -816,7 +839,54 @@ void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable
 
     if ( gop )
     {
-        gop_mode = efi_find_gop_mode(gop, 0, 0, 0);
+        const char *cur = cmdline;
+        unsigned int width = 0, height = 0, depth = 0;
+        bool keep_current = false;
+
+        while ( (cur = get_option(cur, "vga=")) != NULL )
+        {
+#define VALID_TERMINATOR(c) \
+    (*(c) == ' ' || *(c) == '\t' || *(c) == '\0' || *(c) == ',')
+            if ( !strncmp(cur, "gfx-", 4) )
+            {
+                width = simple_strtoul(cur + 4, &cur, 10);
+
+                if ( *cur == 'x' )
+                    height = simple_strtoul(cur + 1, &cur, 10);
+                else
+                    goto error;
+
+                if ( *cur == 'x' )
+                    depth = simple_strtoul(cur + 1, &cur, 10);
+                else
+                    goto error;
+
+                if ( !VALID_TERMINATOR(cur) )
+                {
+error:
+                    PrintStr(L"Warning: Invalid gfx- option detected.\r\n");
+                    width = height = depth = 0;
+                }
+                keep_current = false;
+            }
+            else if ( !strncmp(cur, "current", 7) && VALID_TERMINATOR(cur + 7) )
+                keep_current = true;
+            else if ( !strncmp(cur, "keep", 4) && VALID_TERMINATOR(cur + 4) )
+            {
+                /* Ignore, handled in later vga= parsing. */
+            }
+            else
+            {
+                /* Fallback to defaults if unimplemented. */
+                width = height = depth = 0;
+                keep_current = false;
+                PrintStr(L"Warning: Cannot use selected vga option.\r\n");
+            }
+#undef VALID_TERMINATOR
+        }
+
+        if ( !keep_current )
+            gop_mode = efi_find_gop_mode(gop, width, height, depth);
 
         efi_arch_edid(gop_handle);
     }
diff --git a/xen/arch/x86/x86_64/asm-offsets.c b/xen/arch/x86/x86_64/asm-offsets.c
index 287dac101ad4..fbd6c54188db 100644
--- a/xen/arch/x86/x86_64/asm-offsets.c
+++ b/xen/arch/x86/x86_64/asm-offsets.c
@@ -175,6 +175,7 @@ void __dummy__(void)
     OFFSET(MB2_mem_lower, multiboot2_tag_basic_meminfo_t, mem_lower);
     OFFSET(MB2_efi64_st, multiboot2_tag_efi64_t, pointer);
     OFFSET(MB2_efi64_ih, multiboot2_tag_efi64_ih_t, pointer);
+    OFFSET(MB2_tag_string, multiboot2_tag_string_t, string);
     BLANK();
 
     OFFSET(DOMAIN_vm_assist, struct domain, vm_assist);
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 11:48:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 11:48:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559116.873835 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH0zR-0001XR-Pf; Wed, 05 Jul 2023 11:48:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559116.873835; Wed, 05 Jul 2023 11:48:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH0zR-0001XE-MA; Wed, 05 Jul 2023 11:48:09 +0000
Received: by outflank-mailman (input) for mailman id 559116;
 Wed, 05 Jul 2023 11:48:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=hFzj=CX=citrix.com=prvs=5438f3518=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qH0zQ-0000nM-5J
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 11:48:08 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ce793e82-1b29-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 13:48:06 +0200 (CEST)
Received: from mail-sn1nam02lp2043.outbound.protection.outlook.com (HELO
 NAM02-SN1-obe.outbound.protection.outlook.com) ([104.47.57.43])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 05 Jul 2023 07:48:06 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by PH0PR03MB5718.namprd03.prod.outlook.com (2603:10b6:510:40::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 11:48:04 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902%7]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 11:48:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ce793e82-1b29-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688557687;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=aXd53r/4eYVmkGUvAQMKmeysxWpF/omPBjlPTSLTmQU=;
  b=A7kjVzBTx70ZTl+Pu8ggKbOmYmlHUh4Vg7pzeQ4tmA0RNWJ0aa0hCj8b
   J2CtskxqbzpyGlCM9QqDOSViipzevQFndum2+M1+zfcUooIL95U1IOyhk
   S18l6qFNXL+TLgwXt0x364JVGpRCKn+/IhZZJ+PJSdoWf2ZJAT4cy4n09
   g=;
X-IronPort-RemoteIP: 104.47.57.43
X-IronPort-MID: 117786688
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:qYjbrKC7V3IToRVW/w7iw5YqxClBgxIJ4kV8jS/XYbTApGkk3zQBz
 mAZXT2Fa/eJNDT8c9EkOYzn9R5XsJeGmtBrQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h
 yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs
 t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GxA4wRkDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS
 uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada
 jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIw1txMJmF/r
 9MiawshZSCsgOuW8oyxRbw57igjBJGD0II3nFhFlWucNtB/BJfJTuPN+MNS2yo2ioZWB/HCa
 sEFaD1pKhPdfxlIPVRRA5U79AuqriCnL3sE9xTI+uxruAA/zyQouFTpGMDSddGQA91cg26Tp
 37c/nS/CRYfXDCa4WPcrS382LGfzUsXXqopM+GS+PB1r2G3z00eKSMuXlC4kaGQ3xvWt9V3b
 hZ8FjAVhbg/8gmnQ8fwWzW8oWWYpVgMVtxICeo45QqRjK3O7G6xBGIJUzpAY9wOr9ItSHoh0
 Vrht8ztLSxitvuSU331y1uPhTa7OCxQNmlbYyYBFVEB+4O7/Np1iQ/TRNF+FqLzlsfyBTz73
 zGNqm45mqkXiskIka68+Dgrng6Rm3QAdSZtji2/Y45vxlkRiFKND2Bw1WXm0A==
IronPort-HdrOrdr: A9a23:uPEUa6FEr4c6R+1xpLqFVZHXdLJyesId70hD6qkvc3Nom52j+/
 xGws536fatskdqZJkh8erwWpVoMkmsiKKdgLNhd4tKMzOW3ldAQLsD0WKm+UyaJ8SczJ8R6U
 4DSdkGNDSYNzET5qyVgTVQUexQuOVvmJrYwts2pE0dKD2CHpsQiDuRfTzrdnGeKjM2ZqYRJd
 653I5qtjCgcXMYYoCQHX8eRdXOoNXNidbPfQMGLwRP0njDsRqYrJrBVzSI1BYXVD1ChZ0493
 LergD/7qK/99mm1x7n0XPJ5Zg+oqqv9jIDPr3DtiEmEESttu+aXvUjZ1REhkF2nAib0idqrD
 ALmWZkAy080QKUQoj/m2qQ5+Cp6kdQ15al8y7fvZKrm72JeBsqT4dam4JFeBqx0TtfgPhslK
 1MxG6XrJxREFfJmzn8/cHBU1VwmlOzumdKq59bs5Vza/poVFZql/1owGpFVJMbWC7q4oEuF+
 djSMna+fZNaFufK3TUpHNmztCgVmk6Wk7ueDlIhuWFlzxN2HxpxUoRw8IS2n8G6ZImUpFBo+
 DJKL5hmr1CRtIfKah9GOACS82qDXGle2OFDEuCZVD8UK0XMXPErJD6pL0z+eGxYZQNiIA/nZ
 zQOWkowVLau3iefPFm8Kc7gCwlGl/NLQgF4vsulKREhg==
X-Talos-CUID: 9a23:lYgOZGFjLaHs1/qwqmJLznUzGvF/XUee91vbE2C/AEZbdreaHAo=
X-Talos-MUID: 9a23:OvBv4gsH3prr0nJJ9s2nvxY+Hslm/IuSLEksnLQ4g8KPNhwoEmLI
X-IronPort-AV: E=Sophos;i="6.01,183,1684814400"; 
   d="scan'208";a="117786688"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=U4HFPfDsqOmfzYJUGO2R+PhYV8yuirtcum/mLRVgy0Teu1gXq5C8xNAPoQqEmG+rPw0geVpf+rd4L4KBiWV6+OyjtLD0xRawGwPeTbY5dnsb/fajSY+f2qhBi4YmbDP0PWaiME0F2os8y5gI9Yq0c2buPl9faVgsEhFPSiY3TzJub/zEf8p4ufizDfegXK5rBVQbfoTHbyaT7pG/r6BICup19fyb4CbOpxmIMaKgQV4XQ8BEedpdB6ZKbLPr1+lvL3AxK4L5xJRMD82ZBCUb9E2G+M8GOEziQJjl+SJlXSc+qC2DJkigcgyL3qo2caffXBWGYJ3cIOTutUPUvoH3hg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=zgKxqQHr4ShwbPmBjiVo8c6X9VCkUpAoN5RBLlpefTM=;
 b=DppKI6M5d3lSBQNoAb02xgH3QpVsPthQuyXOa38WYOdjHe1fT5sOXyXzX9Kq9lxPqd+to8CkirXTNS4+jXZVf1ReHzB1b/e+OBFIN9ka4LxwLe3Bmx1uOODqKe6DzZakGphgGrDJenL4k47lVP6zCmftF+gJLLDL/jVDj5g9AUFf+d4EZ4Xpnb/v7T1YEQmCO7nO3C7WeBNCiGZpgMEHCcACP5T3M7QWDORf+kwvZ7JjofPq8JuNqU6wMZJcNGIErgILi6wPyeN4G6NakNYcRBXxxpPpoXTMYFgj701Nv4ic+aMaehYaa9rxNFxtSt3fbiL3ZmRFLWKA7nQTLSmDbg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=zgKxqQHr4ShwbPmBjiVo8c6X9VCkUpAoN5RBLlpefTM=;
 b=E8hq28SZrADnoJ4aNwrU3Nky/t7nZMvrzrDuvp7hunxQKF2KWD+hi8qlNgoSo2znpQtLdnZE5wpaAgl8JW5Y9gqKXoiOj9tIef418OvKbmani0eYr7rSyRWW1AHTXccP99K1j+5buEIPqNTu7JOSm13EqoiJW6iHde8ShJ4RZzQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v4 3/3] cmdline: parse multiple instances of the vga option
Date: Wed,  5 Jul 2023 13:47:41 +0200
Message-ID: <20230705114741.11449-4-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230705114741.11449-1-roger.pau@citrix.com>
References: <20230705114741.11449-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P265CA0513.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:13b::20) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|PH0PR03MB5718:EE_
X-MS-Office365-Filtering-Correlation-Id: a4f1c001-36b7-4792-1cb3-08db7d4db0f6
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	NrQfB0dqjQ6jJ0Qx0GYQQeQxqCr9aZx2cP8qgHfEp/UZStgr/k9Q62Xl8Od3UO9w9Hr4uUSIE4yWqqdZLMrVTtTIKkRwiwldZFeqk3L/hUbj1RL9clyLWlIbKDWO61qrAgNcq51G12pIjjnQL4Hh709mC+QiQlH2QAq1utfZun3DO5vH54N4T6mrtdT4VLmS4MGdb1piTzvSlBtHAk5N9jC5ftvKDCFF/B5TpqOt0zHZlxj1/jUQeU5R7yjlUy+rtSoY3t+cLy6mPmFN+q7nSw1Pk5FvLvbcdCu5a3/ZPoA6e8PfXoysYPfx/A03NPqodG7oTlnEDKjLD7pklBgnlS7+NCnc0mB4SVUoOEpfwyWQP6QDmtRKFlY7joAVBenTAhx827oQUY9BtVqIZMUSQKN+VX9JGrrEabDz6lG0/jRpRODq+V8kBsIvhCuyxXGJdDodD1jXDOqyR/Vd9e2Kw5uRMzLet2Oe0XvfCMqcb2BpCM+yxGecmYTochH48nrdlJ4N9nQUwZ8iWg0VMmb/A2yzBBS7ZsJkQcJGdOWTV/huIxE/imtJmI95rV76qGhS
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(346002)(366004)(376002)(451199021)(186003)(82960400001)(478600001)(6512007)(6506007)(1076003)(26005)(86362001)(2616005)(6666004)(316002)(83380400001)(54906003)(38100700002)(6486002)(66556008)(6916009)(66946007)(4326008)(66476007)(5660300002)(8676002)(8936002)(2906002)(41300700001)(36756003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZVNmcmdvZ2lDeWJnWS9Xb2FyaFlWVEhYRzZ3MVdJZHBqY0pjcWgzUHVCZXdF?=
 =?utf-8?B?T1YyR0lSb2gzNkF6Z3JkVTZnd2RaY3RydkxmbWtnNWwyNmJXQ1FpV0ZoZlpl?=
 =?utf-8?B?ZGxoc0huMU45SnhxNU5uTHhDTUhTMzFRbVM4NU05QllCWDdVZll1Z2dhU2JD?=
 =?utf-8?B?RUNUMVRxRXBBR3prbzFsUTJD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B/C4XXhgAMeeH2ovlaQI0wpIHAo8cj2buO6Qe07Zb80sGPA6WfVagkWLW9XOYQNfiPBQfzFIj09K6daBngYKvSjsS1N59IhOXImcGqqJAJwbtUIoJA+HPwiwhthhdAWenpxIokT4UOe81A+SRp340Z4hjfwRk9W8hyPA5YrS
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a4f1c001-36b7-4792-1cb3-08db7d4db0f6
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 11:48:04.0995
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: IzgFMRCbRolYQNVQZGHCMqf/BbeeUCyv1dcsJ7fqUgdAxzkzCYQd/HIncws8IzKKeODEkso5D6e2KUo3jWl8Ng==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB5718

Parse all instances of the vga= option on the command line, in order
to always enforce the last selection on the command line.

Note that it's not safe to parse just the last occurrence of the vga=
option, as then a command line with `vga=current vga=keep` would
result in current being ignored.

Adjust the command line documentation to describe the new behavior.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
Changes since v3:
 - Remove xen-command-line doc addition.
 - Set mode to 'ask' by default.

Changes since v2:
 - New in this version.
---
Build tested only, as I don't have a system that does legacy boot and
has VGA output I can check.

It's mostly encapsulating the current code inside of a while loop and
adding an extra else if for the "ask" option, there's a lot of
indentation changes.
---
 xen/arch/x86/boot/cmdline.c | 83 +++++++++++++++++++------------------
 1 file changed, 42 insertions(+), 41 deletions(-)

diff --git a/xen/arch/x86/boot/cmdline.c b/xen/arch/x86/boot/cmdline.c
index fc11c6d3c5c4..10dcc6142c85 100644
--- a/xen/arch/x86/boot/cmdline.c
+++ b/xen/arch/x86/boot/cmdline.c
@@ -277,59 +277,60 @@ static u16 rows2vmode(unsigned int rows)
 
 static void vga_parse(const char *cmdline, early_boot_opts_t *ebo)
 {
-    const char *c;
-    unsigned int tmp, vesa_depth, vesa_height, vesa_width;
-
-    c = find_opt(cmdline, "vga=", true);
-
-    if ( !c )
-        return;
+    const char *c = cmdline;
 
     ebo->boot_vid_mode = ASK_VGA;
 
-    if ( !strmaxcmp(c, "current", delim_chars_comma) )
-        ebo->boot_vid_mode = VIDEO_CURRENT_MODE;
-    else if ( !strsubcmp(c, "text-80x") )
-    {
-        c += strlen("text-80x");
-        ebo->boot_vid_mode = rows2vmode(strtoui(c, delim_chars_comma, NULL));
-    }
-    else if ( !strsubcmp(c, "gfx-") )
+    while ( (c = find_opt(c, "vga=", true)) != NULL )
     {
-        vesa_width = strtoui(c + strlen("gfx-"), "x", &c);
+        unsigned int tmp, vesa_depth, vesa_height, vesa_width;
+
+        if ( !strmaxcmp(c, "current", delim_chars_comma) )
+            ebo->boot_vid_mode = VIDEO_CURRENT_MODE;
+        else if ( !strsubcmp(c, "text-80x") )
+        {
+            c += strlen("text-80x");
+            ebo->boot_vid_mode = rows2vmode(strtoui(c, delim_chars_comma, NULL));
+        }
+        else if ( !strsubcmp(c, "gfx-") )
+        {
+            vesa_width = strtoui(c + strlen("gfx-"), "x", &c);
 
-        if ( vesa_width > U16_MAX )
-            return;
+            if ( vesa_width > U16_MAX )
+                return;
 
-        /*
-         * Increment c outside of strtoui() because otherwise some
-         * compiler may complain with following message:
-         * warning: operation on 'c' may be undefined.
-         */
-        ++c;
-        vesa_height = strtoui(c, "x", &c);
+            /*
+             * Increment c outside of strtoui() because otherwise some
+             * compiler may complain with following message:
+             * warning: operation on 'c' may be undefined.
+             */
+            ++c;
+            vesa_height = strtoui(c, "x", &c);
 
-        if ( vesa_height > U16_MAX )
-            return;
+            if ( vesa_height > U16_MAX )
+                return;
 
-        vesa_depth = strtoui(++c, delim_chars_comma, NULL);
+            vesa_depth = strtoui(++c, delim_chars_comma, NULL);
 
-        if ( vesa_depth > U16_MAX )
-            return;
+            if ( vesa_depth > U16_MAX )
+                return;
 
-        ebo->vesa_width = vesa_width;
-        ebo->vesa_height = vesa_height;
-        ebo->vesa_depth = vesa_depth;
-        ebo->boot_vid_mode = VIDEO_VESA_BY_SIZE;
-    }
-    else if ( !strsubcmp(c, "mode-") )
-    {
-        tmp = strtoui(c + strlen("mode-"), delim_chars_comma, NULL);
+            ebo->vesa_width = vesa_width;
+            ebo->vesa_height = vesa_height;
+            ebo->vesa_depth = vesa_depth;
+            ebo->boot_vid_mode = VIDEO_VESA_BY_SIZE;
+        }
+        else if ( !strsubcmp(c, "mode-") )
+        {
+            tmp = strtoui(c + strlen("mode-"), delim_chars_comma, NULL);
 
-        if ( tmp > U16_MAX )
-            return;
+            if ( tmp > U16_MAX )
+                return;
 
-        ebo->boot_vid_mode = tmp;
+            ebo->boot_vid_mode = tmp;
+        }
+        else if ( !strmaxcmp(c, "ask", delim_chars_comma) )
+            ebo->boot_vid_mode = ASK_VGA;
     }
 }
 #endif
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 11:55:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 11:55:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559136.873844 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH16h-00041r-GR; Wed, 05 Jul 2023 11:55:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559136.873844; Wed, 05 Jul 2023 11:55:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH16h-00041k-Du; Wed, 05 Jul 2023 11:55:39 +0000
Received: by outflank-mailman (input) for mailman id 559136;
 Wed, 05 Jul 2023 11:55:38 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qH16g-00041e-QF
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 11:55:38 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH16g-0006eb-3D; Wed, 05 Jul 2023 11:55:38 +0000
Received: from 54-240-197-224.amazon.com ([54.240.197.224]
 helo=dev-dsk-jgrall-1b-035652ec.eu-west-1.amazon.com)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH16f-0004DO-Qu; Wed, 05 Jul 2023 11:55:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:
	Subject:Cc:To:From; bh=1NOg8Ty/xGUQ867fNNCVthaQPTx0ZAW3TR9lv7vglH0=; b=AOfokm
	TxwyT4ziekBzHE67ftDkHNIiHvy5S93fxkqLB7lbYH1L2wfSp3l3NChWNUEXG/TlprsiDSbisdpEK
	bq8/zflPhe4gjSpYWKlOG565ND9cmx5Okm/f+WD3SeKYXylyPFwLfwnaaoapijKHGCF7s9rcRXjoH
	RPbWEzQvke8=;
From: Julien Grall <julien@xen.org>
To: xen-devel@lists.xenproject.org
Cc: Luca.Fancellu@arm.com,
	michal.orzel@amd.com,
	Henry.Wang@arm.com,
	andrew.cooper3@citrix.com,
	Penny.Zheng@arm.com,
	wei.chen@arm.com,
	Julien Grall <jgrall@amazon.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH] xen/arm: Kconfig: ACPI should depend on UEFI
Date: Wed,  5 Jul 2023 12:55:34 +0100
Message-Id: <20230705115534.26004-1-julien@xen.org>
X-Mailer: git-send-email 2.40.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Julien Grall <jgrall@amazon.com>

On Arm, it is not possible to use ACPI without UEFI. In fact disabling
UEFI but not ACPI will lead to a compilation error:

ld: prelink.o: in function `acpi_os_get_root_pointer':
/builds/xen-project/people/andyhhp/xen/xen/drivers/acpi/osl.c:73:
undefined reference to `efi'
/builds/xen-project/people/andyhhp/xen/xen/drivers/acpi/osl.c:73:(.init.text+0x8ac0):
relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against
undefined symbol `efi'

So make the dependency clear in the Kconfig.

This was spotted by the randconfig build in gitlab CI.

Fixes: 12314be5749e ("xen/arm: make ARM_EFI selectable for Arm64")
Signed-off-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index c30f32457388..439cc94f3344 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -63,11 +63,11 @@ source "arch/Kconfig"
 
 config ACPI
 	bool "ACPI (Advanced Configuration and Power Interface) Support (UNSUPPORTED)" if UNSUPPORTED
-	depends on ARM_64
+	depends on ARM_64 && ARM_EFI
 	---help---
 
 	  Advanced Configuration and Power Interface (ACPI) support for Xen is
-	  an alternative to device tree on ARM64.
+	  an alternative to device tree on ARM64. This requires UEFI.
 
 config ARM_EFI
 	bool "UEFI boot service support"
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 11:58:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 11:58:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559140.873855 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH19E-0004aY-Ub; Wed, 05 Jul 2023 11:58:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559140.873855; Wed, 05 Jul 2023 11:58:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH19E-0004aR-RY; Wed, 05 Jul 2023 11:58:16 +0000
Received: by outflank-mailman (input) for mailman id 559140;
 Wed, 05 Jul 2023 11:58:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qH19D-0004aL-ST
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 11:58:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH19D-0006gZ-F9; Wed, 05 Jul 2023 11:58:15 +0000
Received: from [15.248.3.5] (helo=[10.24.67.21])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH19D-0004F6-AO; Wed, 05 Jul 2023 11:58:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:
	References:Cc:To:From:Subject:MIME-Version:Date:Message-ID;
	bh=VuQCYaO/N9+Z/JjDGmx8/j1wpLT4IloXhHqFDhpcLKk=; b=6gjTVaGqezbAWEX+QAxFy6RW1Y
	ejSzk4D+TccR1sxnpgh3oZBHg+4RAyEDK3EoxjB6aF5xVA1h3iYAJfyEmlidIgUtKSqZEpMXpJdd1
	WS0UaSmpG2hRosap8zg4UlPkDAM9RO760ujBAIrJT5re4/YoYiAszgpo02HF/LUhOsQA=;
Message-ID: <9ed7ab49-7f29-5a77-0bfd-377d21aed2a8@xen.org>
Date: Wed, 5 Jul 2023 12:58:13 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [RANDCONFIG failure] Re: [PATCH v3 02/52] xen/arm: make ARM_EFI
 selectable for Arm64
Content-Language: en-US
From: Julien Grall <julien@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-3-Penny.Zheng@arm.com>
 <1956a273-27a9-d0e6-e328-be69ff91e5d3@citrix.com>
 <886fdf18-5369-9b9c-2984-365b8ed404a3@xen.org>
In-Reply-To: <886fdf18-5369-9b9c-2984-365b8ed404a3@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 05/07/2023 12:46, Julien Grall wrote:
> Hi,
> 
> On 05/07/2023 12:20, Andrew Cooper wrote:
>> On 26/06/2023 4:33 am, Penny Zheng wrote:
>>> From: Wei Chen <wei.chen@arm.com>
>>>
>>> Currently, ARM_EFI will mandatorily selected by Arm64.
>>> Even if the user knows for sure that their images will not
>>> start in the EFI environment, they can't disable the EFI
>>> support for Arm64. This means there will be about 3K lines
>>> unused code in their images.
>>>
>>> So in this patch, we make ARM_EFI selectable for Arm64, and
>>> based on that, we can use CONFIG_ARM_EFI to gate the EFI
>>> specific code in head.S for those images that will not be
>>> booted in EFI environment.
>>>
>>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>>
>> Randconfig has found a bug:
>>
>> https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/4595568303
>>
>> ld: prelink.o: in function `acpi_os_get_root_pointer':
>> /builds/xen-project/people/andyhhp/xen/xen/drivers/acpi/osl.c:73:
>> undefined reference to `efi'
>> /builds/xen-project/people/andyhhp/xen/xen/drivers/acpi/osl.c:73:(.init.text+0x8ac0):
>> relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against
>> undefined symbol `efi'
> 
> :/. That's because ACPI depends on UEFI. I will send a patch to update 
> the Kconfig accordingly.

Patch sent: 
https://lore.kernel.org/all/20230705115534.26004-1-julien@xen.org/

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 12:04:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 12:04:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559153.873865 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH1FN-0006J7-S5; Wed, 05 Jul 2023 12:04:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559153.873865; Wed, 05 Jul 2023 12:04:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH1FN-0006J0-PP; Wed, 05 Jul 2023 12:04:37 +0000
Received: by outflank-mailman (input) for mailman id 559153;
 Wed, 05 Jul 2023 12:04:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=dIgq=CX=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qH1FM-0006Iu-B5
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 12:04:36 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20607.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::607])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1b90ff65-1b2c-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 14:04:35 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8384.eurprd04.prod.outlook.com (2603:10a6:20b:3e8::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 12:04:33 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 12:04:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1b90ff65-1b2c-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=lnIWJhw1xIMFJexrkqnk3I/9H0RFBi/QOfvV3yMNpL+8pvsA1hekZ0gHSM95uizNKKKEJTWFlovAbyLJfLq6bRUv3ciCib3Xr7wLTlfJaVYPuV+Jh5GEw2ULUUX+XE1Lx8PObJQ3dIOx+6tP5JPlBYm+0unT/qr6JR5BIOsbY3v9Fui6V3vjFd+b1b9IkaTlhClo4qKIsRsC8Xh7WfrkYJ4aG/5G0zd7PDA3Hzfn3rUZ+T7EoDcuT2mLM18WhqE0JvPHjqZWoXwSkY2vbH58hPD9jrTiGnrJmU/QR7QCCgi5yX834PHmSSydPw7nUJJ2pdTAQ6neW8VXk4ItIkdonA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=tD60D6TKkD3e6czsRHd+8j0IitlMBo+ga/K4o1sXNIg=;
 b=QNqS5jP1owCZV4gGWJ/PzWJFLkXohf8u6bN3ochiBKxZ2txQA34WF69oUhmLRP+DHO/ynMQ4JthsyIGh0CBibcQagV8/I1KTwXtsXMeIILvydYiVGMhjZYsMMkjmMR8MayDUq4vo6T/QjMTLHg5CpUTWm2fiX209D2XcPrF7otDdhidozgUQrIx7MlT14APFv2hXbKF/QygC8uf5y+KW1JJVSF176aXKySewk137vm0e3F+w1HI4vPPFpp3r3LbmQfHF7WeZf/AbTWPSz9OpzfJq+QOY6Z9nQGrTnCIsAz4FMzUfW+dqziQYYKTpVcL/zTqm2ufPAfxQmmRKnKHM8Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=tD60D6TKkD3e6czsRHd+8j0IitlMBo+ga/K4o1sXNIg=;
 b=beHrs0DwbVxAsY6Gk+lEsUApdxg6wZi6fvp4tMRR+8J+9PG4KKb5HgOSwac4zV5EIeAPtQ1UWYlQwlhC+DYLexmRXOKHvcsHO5U3Ns6prHduhCBzciN0yXfZX00zA+IWuToCD3tEXA236IRNEycXv1lHKDmHUgQfIuvk2Px9FYq6Hp/3NvIzuDPmVymlB/hN4n4h0i3/mhI4wbAHew6CxtI+CIpr/iYB8gEu8Zv0Z6NUFqQrzhD6SeKpyYe9kSIiNIm34FS06jdjCXEIjGyurgAtZIvIW4aXMC+XRI1dgvm4fPJSF1AafHzED8ZNeZUUrfKRYAcIuT5P2PmgYbKhCg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <2761ae84-113d-c230-ad50-e9cfb0ae434b@suse.com>
Date: Wed, 5 Jul 2023 14:04:30 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH] xen/arm: Kconfig: ACPI should depend on UEFI
Content-Language: en-US
To: Julien Grall <julien@xen.org>
Cc: Luca.Fancellu@arm.com, michal.orzel@amd.com, Henry.Wang@arm.com,
 andrew.cooper3@citrix.com, Penny.Zheng@arm.com, wei.chen@arm.com,
 Julien Grall <jgrall@amazon.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 xen-devel@lists.xenproject.org
References: <20230705115534.26004-1-julien@xen.org>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230705115534.26004-1-julien@xen.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0005.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:15::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8384:EE_
X-MS-Office365-Filtering-Correlation-Id: 13c841d7-a245-42ce-bce3-08db7d4ffed2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	YIen00zR+Go2xfDLNuKpOAkntt3prVyZb5A2VAEWNVZC8rcNnTrZm/PQj+CkjQTmMW6iqwW5g2oZyzvISVkvVNSqe+VRoxPgzPgKutUSB6ldHSuNoZqDrCiYhffc+H+JnPeTHDLyrn8bd8qH0cMRS6fNffLJ0rbowZwAXC1iPa7eCHprYxC/e4nId60s5UOSWerVYIEdiqra5/y1Rgf2uBqijGbuO2MsXq5f0DpxV2lE+97T72PKTxFAyFTvdaPKkize5FBlfUxad8kGxlU8WZHtcXJL7B10bcUo2iDvlUoWWYLxGKr/l50+qfstNYWsIhCkV3Cyn4s5l3Rm72/SZAFuMSBbisxvlxdsplBebVas5RpzgGqRM1lpFyNCeGAU/l2czS6h13pux2YhSezRhrvKBI7EH+R8ovJh0Ztz5TnqyjzO2X3dF2dzfLclron0mKlACTJ47KZ1vIpYIhzffsiueqpuM5mQTmpx1rGGX9MWvkWvZP5Fl3Xzs0i6THrZPUPr0CxPOanfBQ7yzIcrBSI13NvaPno9ddqEo5PeHsUWIaTjYBUjYI98Ns3s3DkTZdX6frp0+ruMFrGmO4pQO3whQDkwFXWVE0xdNcgw6p1+z4R1MKtIqPsok4SrohSbXEuoAd+HEGDc5utIDXBqhw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(396003)(376002)(346002)(39860400002)(451199021)(6916009)(4326008)(38100700002)(66946007)(66476007)(66556008)(2616005)(186003)(86362001)(36756003)(31696002)(6486002)(6512007)(54906003)(53546011)(478600001)(26005)(6506007)(4744005)(7416002)(31686004)(8936002)(8676002)(5660300002)(316002)(2906002)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VC84OGZJN3dpeHB2N0FJMm1WeFpBMFVLTnBtbkppT1FOOEs2cHltRE9nRFRh?=
 =?utf-8?B?TlZFTUZHVGFoZVhxV1RNWlR2VEs3NFN4by94d3o0M1Z6bjI2K0FSYlliY3JH?=
 =?utf-8?B?WldUZmZ4QkJuQyt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Nn?=
 =?utf-8?B?QkZOU0k2S0lBVm8vc1YxVGtrN3oxN1RRYkRORUVsSzZIS1dJZk5TbmhmSUNF?=
 =?utf-8?B?dFZvdlBsNi9HOXk4N0htNHZ6NWdhYjhMRHlYekE1ZFJhM0ZOVDhaaFMvMXZq?=
 =?utf-8?B?aFU4dnBHdWdrSkhKcVdxdGlBdkc5U3RpQmdxM0pMUWtQeGMxTzI3VmFWTkk5?=
 =?utf-8?B?ZGtwN1dBVkJUVzI5NGluS0trVlk0NElNTnhKb282V0VjYVFwd1pwOWJwY2F3?=
 =?utf-8?Q?0LZvKKEGClB7Tg1BHcBX1FGn7?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 13c841d7-a245-42ce-bce3-08db7d4ffed2
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 12:04:33.5170
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 71OcOoIh3DQm4n9SgYTDEDdfF9iHY/yGuTDPk11i2enxofb7PFaH3grHwSi5+kBWNp3vsK+thChlKkCZq0AqxA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8384

On 05.07.2023 13:55, Julien Grall wrote:
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -63,11 +63,11 @@ source "arch/Kconfig"
>  
>  config ACPI
>  	bool "ACPI (Advanced Configuration and Power Interface) Support (UNSUPPORTED)" if UNSUPPORTED
> -	depends on ARM_64
> +	depends on ARM_64 && ARM_EFI

Wouldn't it make sense to drop the ARM_64 dependency then? It's now
redundant, and it seems quite likely that if EFI was ever support
for 32-bit, ACPI could then be supported there as well.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 12:30:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 12:30:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559159.873875 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH1ej-0001JE-Tr; Wed, 05 Jul 2023 12:30:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559159.873875; Wed, 05 Jul 2023 12:30:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH1ej-0001J7-RI; Wed, 05 Jul 2023 12:30:49 +0000
Received: by outflank-mailman (input) for mailman id 559159;
 Wed, 05 Jul 2023 12:30:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qH1ei-0001J1-Oh
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 12:30:48 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH1ee-0007SX-9v; Wed, 05 Jul 2023 12:30:44 +0000
Received: from [15.248.3.5] (helo=[10.24.67.21])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH1ee-0005aj-3m; Wed, 05 Jul 2023 12:30:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=iIuxbPU1CAtJT8bBUEgNsAXEcm9/IPHbfJ0sN4WYZWY=; b=WsEsZfXIEe+Gql1E9HwouyPJQM
	nGBzWIjnFrJoAwRP92V8g6qutjYexRCAg2smiaJmGnUnomvGWIwh5+PvYzc17tyKGT7FOgd7yNkxa
	r+uek7OOSXAFTsJNC3IBaBcfw/IM/WC+m2SL3vuAPcv0op5gnYG0J/90isoAKKMhfc6U=;
Message-ID: <822b68a0-7832-9213-d340-a3787e790a3f@xen.org>
Date: Wed, 5 Jul 2023 13:30:41 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH] xen/arm: Kconfig: ACPI should depend on UEFI
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Luca.Fancellu@arm.com, michal.orzel@amd.com, Henry.Wang@arm.com,
 andrew.cooper3@citrix.com, Penny.Zheng@arm.com, wei.chen@arm.com,
 Julien Grall <jgrall@amazon.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 xen-devel@lists.xenproject.org
References: <20230705115534.26004-1-julien@xen.org>
 <2761ae84-113d-c230-ad50-e9cfb0ae434b@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <2761ae84-113d-c230-ad50-e9cfb0ae434b@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Jan,

On 05/07/2023 13:04, Jan Beulich wrote:
> On 05.07.2023 13:55, Julien Grall wrote:
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -63,11 +63,11 @@ source "arch/Kconfig"
>>   
>>   config ACPI
>>   	bool "ACPI (Advanced Configuration and Power Interface) Support (UNSUPPORTED)" if UNSUPPORTED
>> -	depends on ARM_64
>> +	depends on ARM_64 && ARM_EFI
> 
> Wouldn't it make sense to drop the ARM_64 dependency then? It's now
> redundant, and it seems quite likely that if EFI was ever support
> for 32-bit, ACPI could then be supported there as well.

I think so. I am not planning to resend a new version for that. So I 
will do it on commit and mention it in the commit message.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 12:35:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 12:35:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559163.873885 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH1jJ-0001vl-Er; Wed, 05 Jul 2023 12:35:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559163.873885; Wed, 05 Jul 2023 12:35:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH1jJ-0001ve-Bq; Wed, 05 Jul 2023 12:35:33 +0000
Received: by outflank-mailman (input) for mailman id 559163;
 Wed, 05 Jul 2023 12:35:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qH1jH-0001vY-TD
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 12:35:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH1jC-0007YB-Qa; Wed, 05 Jul 2023 12:35:26 +0000
Received: from [15.248.3.5] (helo=[10.24.67.21])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH1jC-0005rs-K7; Wed, 05 Jul 2023 12:35:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:
	References:Cc:To:From:Subject:MIME-Version:Date:Message-ID;
	bh=ECMCk4HBvCjz7KbnoHhTgYsniKL+TN4oFsCzhk3SwP8=; b=uxZcRTtVJVBXEL3kTyt9avOAUC
	8fS+22ENhCyPUyXVbnIK0P7vca9tG/tbjdPQ0uQ/nYdeJTOFUxh4qfB4X1RZbCSGAhDjqeFRv/SL7
	jjd943Co88KlGam/rL9+GrVB8JPul+HHOM5XcEoo/g0K0Pqm80Ya2pB+6s2OhLznmquw=;
Message-ID: <f14104cd-8be0-925d-3ab4-8b5f922024f0@xen.org>
Date: Wed, 5 Jul 2023 13:35:24 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH] xen/arm: Kconfig: ACPI should depend on UEFI
Content-Language: en-US
From: Julien Grall <julien@xen.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: Luca.Fancellu@arm.com, michal.orzel@amd.com, Henry.Wang@arm.com,
 andrew.cooper3@citrix.com, Penny.Zheng@arm.com, wei.chen@arm.com,
 Julien Grall <jgrall@amazon.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 xen-devel@lists.xenproject.org
References: <20230705115534.26004-1-julien@xen.org>
 <2761ae84-113d-c230-ad50-e9cfb0ae434b@suse.com>
 <822b68a0-7832-9213-d340-a3787e790a3f@xen.org>
In-Reply-To: <822b68a0-7832-9213-d340-a3787e790a3f@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 05/07/2023 13:30, Julien Grall wrote:
> Hi Jan,
> 
> On 05/07/2023 13:04, Jan Beulich wrote:
>> On 05.07.2023 13:55, Julien Grall wrote:
>>> --- a/xen/arch/arm/Kconfig
>>> +++ b/xen/arch/arm/Kconfig
>>> @@ -63,11 +63,11 @@ source "arch/Kconfig"
>>> Â  config ACPI
>>> Â Â Â Â Â  bool "ACPI (Advanced Configuration and Power Interface) Support 
>>> (UNSUPPORTED)" if UNSUPPORTED
>>> -Â Â Â  depends on ARM_64
>>> +Â Â Â  depends on ARM_64 && ARM_EFI
>>
>> Wouldn't it make sense to drop the ARM_64 dependency then? It's now
>> redundant, and it seems quite likely that if EFI was ever support
>> for 32-bit, ACPI could then be supported there as well.
> 
> I think so. I am not planning to resend a new version for that. So I 
> will do it on commit and mention it in the commit message.

Actually no. It would be easier to add UEFI on Arm32 compare to adding 
ACPI. So it would be best to keep ARM_64 here at least for the time been.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 12:51:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 12:51:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559167.873895 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH1y7-0004MA-M3; Wed, 05 Jul 2023 12:50:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559167.873895; Wed, 05 Jul 2023 12:50:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH1y7-0004M3-IC; Wed, 05 Jul 2023 12:50:51 +0000
Received: by outflank-mailman (input) for mailman id 559167;
 Wed, 05 Jul 2023 12:50:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=cLSs=CX=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qH1y6-0004Lv-Io
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 12:50:50 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20618.outbound.protection.outlook.com
 [2a01:111:f400:7d00::618])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 906736d7-1b32-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 14:50:48 +0200 (CEST)
Received: from AS9PR06CA0483.eurprd06.prod.outlook.com (2603:10a6:20b:49b::8)
 by VE1PR08MB5823.eurprd08.prod.outlook.com (2603:10a6:800:1a5::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 12:50:45 +0000
Received: from AM7EUR03FT042.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:49b:cafe::6a) by AS9PR06CA0483.outlook.office365.com
 (2603:10a6:20b:49b::8) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 12:50:45 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT042.mail.protection.outlook.com (100.127.140.209) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.23 via Frontend Transport; Wed, 5 Jul 2023 12:50:44 +0000
Received: ("Tessian outbound 52217515e112:v142");
 Wed, 05 Jul 2023 12:50:44 +0000
Received: from 29feb8045175.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 EA9CD027-5B42-42CD-B11E-EF143E65577F.1; 
 Wed, 05 Jul 2023 12:50:38 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 29feb8045175.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 12:50:38 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by DB9PR08MB6588.eurprd08.prod.outlook.com (2603:10a6:10:25a::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 12:50:36 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::8f61:5b01:4db1:8363]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::8f61:5b01:4db1:8363%6]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023
 12:50:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 906736d7-1b32-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RxU1bv8hf79o9FM0D6C7G2JK7frg2Hk/AA2sHpts080=;
 b=jOboZZ2OGM48iHJowW8u8ed3ktAiX8C1b8ZA54GOfwlxyqeaEdsxb/Nubnv/4i4m/Dkvv1+bbrJYWT392T/VNSSi+aWfA36WYQlEN2xkh+1Wv3K5DpK/I3zoBmxAeDWwRUswnId1whLxKdpiHhNTS59uNve+g2vAcO4WkhtpWKA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 7e2c3a50ea8dca21
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=n/JOKmI+lIUxUrHdAIqLlpBKBt08kep0Q0cTxRGMgIvacbJECvxS7MDE2FrrxUA7VRp1xeRVXFB+lGESJ3vJ849swb7mRXm8SpedDjYoL/kSb2dEV8PK7Phc1IcTkNlIjqSJFeXItcRmTNloko5A/RrB7ugRqf14p2ATSH2UvqkToycFFfwV/dX+qLJJCyvNLr73KgxbxU9IeMPdhNJ/6oosolqY6aIuQ5Ak2KkFPR9Zyb+BxgF+tWOorLu4/wnJYZOfh8se84RuETuG4+rOpEFERG4/8MEmXw861rbU1RgGqbIhoTpuh+9DrwjWAoy/0tyZZB10hRicqTeyjkroiQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=RxU1bv8hf79o9FM0D6C7G2JK7frg2Hk/AA2sHpts080=;
 b=fEuHypBZC+T91QwynNq3XaNv70Y8CO1RL7k205WbljZM9tJUy4UB4o1ziBRhDd7siQcq4GhoaBadandU6EdB9QWOaj11v4xFbU1s4OL2BmrvQtFIAZxwK96DJ1bWmFE4YaypbbvdwE1CFX4GMqWcG5KORwWRM+j6ijCRbMcIGArOH7eXkecIJzAV240cZklpEC7/qfqagGK/nXfMwHx/ZbDHdPFAG9S2Xmcg1Hi3VY2kJYto2kR/LjywlYRHJaJMOZttl8afNhNo9VdWacfotw+3X5IQ7gJPMmCzRifmb3HRclD8NuFwJ4L3oMJwHmp8YaZiyyr6IHZrg+aUD2kylQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RxU1bv8hf79o9FM0D6C7G2JK7frg2Hk/AA2sHpts080=;
 b=jOboZZ2OGM48iHJowW8u8ed3ktAiX8C1b8ZA54GOfwlxyqeaEdsxb/Nubnv/4i4m/Dkvv1+bbrJYWT392T/VNSSi+aWfA36WYQlEN2xkh+1Wv3K5DpK/I3zoBmxAeDWwRUswnId1whLxKdpiHhNTS59uNve+g2vAcO4WkhtpWKA=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Julien Grall <julien@xen.org>, Luca Fancellu <Luca.Fancellu@arm.com>,
	Michal Orzel <michal.orzel@amd.com>, Henry Wang <Henry.Wang@arm.com>,
	"andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>, Penny Zheng
	<Penny.Zheng@arm.com>, Wei Chen <Wei.Chen@arm.com>, Julien Grall
	<jgrall@amazon.com>, Stefano Stabellini <sstabellini@kernel.org>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] xen/arm: Kconfig: ACPI should depend on UEFI
Thread-Topic: [PATCH] xen/arm: Kconfig: ACPI should depend on UEFI
Thread-Index: AQHZrzemFhjMGQXcTkKAEu+0mA/HSq+rE0UAgAAM0AA=
Date: Wed, 5 Jul 2023 12:50:33 +0000
Message-ID: <3C9C10E5-D5E0-4B4E-935D-80832BB795C4@arm.com>
References: <20230705115534.26004-1-julien@xen.org>
 <2761ae84-113d-c230-ad50-e9cfb0ae434b@suse.com>
In-Reply-To: <2761ae84-113d-c230-ad50-e9cfb0ae434b@suse.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|DB9PR08MB6588:EE_|AM7EUR03FT042:EE_|VE1PR08MB5823:EE_
X-MS-Office365-Filtering-Correlation-Id: fa38f0d3-cfae-444c-3472-08db7d567290
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 vpkgcxEKLGNFbG69IFUA+PJOsX348qq8cq0/PZrDEdaSyoc3S3WrkFROXI4r/EtsM3YYROG9su6uRUXA9U83riox+E7nhOG+u9YjZNVQFSKG/M/CjS6RzFOV+fTacBj61gGUSNZF4rqwTie48Ob0GJWVV1wwpIfyYCaiVRea/3PXZbKsOuCvkFoGAo1Ii/ZK3L76swR2Xm+blzI41aQl1jyXMOTCRnC8xL5nhsXMFIPzg4QYMOUkj2a7ocmxpikXSbo/7BTF89P9JAOCmYydxwfj0rt7oZ22iVqCMdfluRIrqw9p6RvTCFdM+grxbBEdwZzvqwXeUwaquKz5aD5pRmICg9AUN1XjBPjR+k8zuZdhwgWL9/EvO0rTFcTqP1wvAUgna+jhdVIm1xcga+06C1QfZBpFfJgrZ91qRAl6fU2TobkbF4iuXojAivwtrkfOnXtFWX65ixzvnDdf9AvJpN2L4RmKPzoAVvmRP+QZrqjnrRXM3D8f+IJPJobTPSXX5masFc06iQtHOTj5y6etiSs+qefCpA/TYkEgWxlRj92O3TmDFwWW9jYIgbmRnBMhYAr3uweBKvsXGyusQ73URBGEQH1bpivxrdZEOM3IPoBbeH9h3hR+yaYuzj9qgEQqyX06B3gg0PdLEPrlzVSyXA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(39860400002)(136003)(396003)(346002)(451199021)(36756003)(4744005)(38070700005)(86362001)(33656002)(2906002)(5660300002)(6512007)(186003)(6506007)(53546011)(91956017)(6666004)(54906003)(6486002)(122000001)(66556008)(66476007)(66446008)(64756008)(6916009)(4326008)(38100700002)(316002)(2616005)(66946007)(76116006)(478600001)(71200400001)(8936002)(8676002)(41300700001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <FB128949C9A9564DBCB7C95568F75A26@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6588
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT042.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	fbb9d14a-3bcf-4cba-d6ee-08db7d566bed
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	zSnRcHuWwsLOMlvzl6wRStB2Wb/0rpoDEvGxjhVHLVuunir1rxinS4mSUaV/KX7iLFkrmGvmuX6jF4v1hxlN3U1oz3YDOM0Uf65IRAJv+NQfs6A3/fOIq2wf9wIUbFRG98SWLMfpjHiNeaytTKQPkIch2JRFFNC2r9+I9U4KGsLWb+i2SZ8nDDaKmMUneFwtz41OrpdMLCUkgGhLn+7Tks6SRxGbDYj9pjz6quKU6RuBnc+HWOgwAGovuaaZ7Na/Q/ZlkpJBsO2EmCrAcjW4MNT7S5qJ8s86V4ryjKj7o3JfIYC7Lcu4CBUbrChEUW46cLQrECkc7OISawFOFrlf5b0O/gHa7iCC8HwJdj4QN2N1b8yBXFMP1YkZsBpFUm1XYlwmd6AWgvYwez9tiGMgdh+Zsfqw7LK3YgOmwGLRghWZo+eeb3m4KMwpFnnDWvtrZ0PPYYRcNmYKYB46ObtY7xRUj7oMz5OKY9ztC3+sMjMXwqbByVXLZdkXgqNYVAn7o785q6vHfSf0iZykq1QFHQY+3ykXAtsHI3jkgJ6hYWjxSA5gpvOj8+q41YK5vDlFtsKaz74DXsJxGrTfF1kaqxymwAnlPZgNYuqjjUnkLa2yvZrKSRQ51L5ef0KnTTy+/3DvLhEAiV/g+5nBbra21NJWEdu1dk9VTB7Xqdr877G2rvvB6LfHjvi6evy/08o/MU347k+MSDykfX7TeDvT9bUzgcq16d3tiBjMeD2WFBES0gTwwn8HDw2jzeEhAK1r
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(376002)(346002)(39860400002)(451199021)(46966006)(40470700004)(36840700001)(82740400003)(40460700003)(70586007)(40480700001)(33656002)(316002)(86362001)(36756003)(36860700001)(82310400005)(81166007)(356005)(70206006)(47076005)(336012)(2616005)(6512007)(26005)(186003)(6506007)(53546011)(478600001)(6666004)(6486002)(41300700001)(4326008)(54906003)(5660300002)(8936002)(8676002)(2906002)(4744005)(6862004);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 12:50:44.5301
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: fa38f0d3-cfae-444c-3472-08db7d567290
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT042.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5823

Hi Jan,

> On 5 Jul 2023, at 14:04, Jan Beulich <jbeulich@suse.com> wrote:
>=20
> On 05.07.2023 13:55, Julien Grall wrote:
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -63,11 +63,11 @@ source "arch/Kconfig"
>>=20
>> config ACPI
>> bool "ACPI (Advanced Configuration and Power Interface) Support (UNSUPPO=
RTED)" if UNSUPPORTED
>> - depends on ARM_64
>> + depends on ARM_64 && ARM_EFI
>=20
> Wouldn't it make sense to drop the ARM_64 dependency then? It's now
> redundant, and it seems quite likely that if EFI was ever support
> for 32-bit, ACPI could then be supported there as well.

I think we need to keep it.
If we add one day EFI support on arm32, we will probably not add ACPI suppo=
rt anyway.

Cheers
Bertrand

>=20
> Jan



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 12:51:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 12:51:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559168.873905 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH1yX-0004mv-UH; Wed, 05 Jul 2023 12:51:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559168.873905; Wed, 05 Jul 2023 12:51:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH1yX-0004mo-Qu; Wed, 05 Jul 2023 12:51:17 +0000
Received: by outflank-mailman (input) for mailman id 559168;
 Wed, 05 Jul 2023 12:51:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=cLSs=CX=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qH1yW-0004Lv-Bx
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 12:51:16 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on061e.outbound.protection.outlook.com
 [2a01:111:f400:fe02::61e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a0998cc6-1b32-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 14:51:15 +0200 (CEST)
Received: from AS9PR01CA0036.eurprd01.prod.exchangelabs.com
 (2603:10a6:20b:542::9) by DB9PR08MB8267.eurprd08.prod.outlook.com
 (2603:10a6:10:3c5::22) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 12:51:13 +0000
Received: from AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:542:cafe::90) by AS9PR01CA0036.outlook.office365.com
 (2603:10a6:20b:542::9) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.31 via Frontend
 Transport; Wed, 5 Jul 2023 12:51:13 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT059.mail.protection.outlook.com (100.127.140.215) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.18 via Frontend Transport; Wed, 5 Jul 2023 12:51:12 +0000
Received: ("Tessian outbound 52217515e112:v142");
 Wed, 05 Jul 2023 12:51:12 +0000
Received: from 997c12af747f.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 083DF943-F324-4B86-AF6E-82841F3EF1CE.1; 
 Wed, 05 Jul 2023 12:51:05 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 997c12af747f.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 12:51:05 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by DB9PR08MB6588.eurprd08.prod.outlook.com (2603:10a6:10:25a::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 12:51:04 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::8f61:5b01:4db1:8363]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::8f61:5b01:4db1:8363%6]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023
 12:51:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a0998cc6-1b32-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ub/C/RLbS6rI+dxyw0fnlJ0n+0f8QBhZXs+h7BtJJuw=;
 b=TKssBKktVvd4dFjjPg8TttV4yPCie+/ezTrYxEI8dPKkYlRXfbZnhh0Jrew/bjOi5WPp2qKYO+xgpIiAd/fCmC1qwHWyRlXvioxkQS8UP0758wg0fPPZ3XOX88FBCV3apD1DkZagBgvWNbMnEADEhNmts/uKlNfMxAf7nRDS69Y=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 6120206b02126603
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=eCoslujw56y/OSov1rHkDriXWhtOWQ6UFfrSlflNWJAv3VJF1Tt3CSGz7bApqjQkcp6bcJyWViA5i/3X2pQdk0dmGXIfUJYSsWmlyWzSemQlBkPxtRpNYDU8vNwQ7ybYqWl9ESElTX2UpFpYzwFQfkyWBs7GzjkuswXjWKxxGyM5ReFNHTA2paKRZyfukTl0DbcIGJYjhP1r3H5IU8atPRUrRgHTXciPNKamBhvPrpmsIRI08x32HhSveITb2d7EtVNZBPiV8oQVnFg5SOz6OulsGyjVrNnzzOz5kZstGBHwlPAkvOj88D1SpU8OkoIGKiGqI+bV2n/QDeEaz2/a5w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ub/C/RLbS6rI+dxyw0fnlJ0n+0f8QBhZXs+h7BtJJuw=;
 b=W/G9znqQWbjUSmXK/eWMMLYQ5iswbdAO+3t+CsVeiN8XhsPy/nvNp7WBIyf7qWmLPJ7EuBSXeT4SeZHeOPNEkcXhRwI0GwSyMsZQcZMIZ+Z696NkeTCiDykuJm7uJE95Fn6B99O/SIVmk/tGEFTuxh1wUk9pvPsMZRATVGX7gjjHIWDfroTtP05zqzbrBb1LxXTrukMEFXeLdUnplAxPmHBg1kCUFUAVPGRECFeol2la6tyINAeMp9SzsWi+GPrJFLhDjOQYcrg04HmriENPHAfNS77j5G55Be2j+V/WPlKDLCTEAxnDqpcDSgE9oS6wPmIMjk8Ze2ru1P1awDWQig==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ub/C/RLbS6rI+dxyw0fnlJ0n+0f8QBhZXs+h7BtJJuw=;
 b=TKssBKktVvd4dFjjPg8TttV4yPCie+/ezTrYxEI8dPKkYlRXfbZnhh0Jrew/bjOi5WPp2qKYO+xgpIiAd/fCmC1qwHWyRlXvioxkQS8UP0758wg0fPPZ3XOX88FBCV3apD1DkZagBgvWNbMnEADEhNmts/uKlNfMxAf7nRDS69Y=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Luca Fancellu
	<Luca.Fancellu@arm.com>, Michal Orzel <michal.orzel@amd.com>, Henry Wang
	<Henry.Wang@arm.com>, "andrew.cooper3@citrix.com"
	<andrew.cooper3@citrix.com>, Penny Zheng <Penny.Zheng@arm.com>, Wei Chen
	<Wei.Chen@arm.com>, Julien Grall <jgrall@amazon.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH] xen/arm: Kconfig: ACPI should depend on UEFI
Thread-Topic: [PATCH] xen/arm: Kconfig: ACPI should depend on UEFI
Thread-Index: AQHZrzemFhjMGQXcTkKAEu+0mA/HSq+rIDqA
Date: Wed, 5 Jul 2023 12:51:03 +0000
Message-ID: <FE3E6650-ECCE-4E3D-9515-FDB589FF025D@arm.com>
References: <20230705115534.26004-1-julien@xen.org>
In-Reply-To: <20230705115534.26004-1-julien@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|DB9PR08MB6588:EE_|AM7EUR03FT059:EE_|DB9PR08MB8267:EE_
X-MS-Office365-Filtering-Correlation-Id: c9f6b45e-a0b6-44e0-d31e-08db7d568348
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 HXE0NfzYtwKvpJhA5uay40i66KVaVK18qRjyg0dhWaxOYxAZSmbrWam5fYrgMEfNC0C5lko667wpfgyTArs7Ei+iWO6GjbHneZvdRnL0VL84qJQOeIHguWbRhUqIn+tcbwROUK4Q5aKKEFRUV9U8B97uke2kNSEYuCPkErLCgZYtjYI5U62Q+bY8vVi98xJatcozJRbCAQqpfZSulsn7ltuu+1K6GaN+vYX5SetVqAAZ7brz7Zh7a/z/PYJlm1zlXLY9xBbPuvK9Q5FQ6AqfldHh34o5Afs4QktI4kUykHdJc9FqRWnx+bWUgcBmzX134pTDuGNJ4vh6pqm/M8fHJt1ys3CXKJ4IqmUTB5ZsQj411j7ygXxVC5wC2ah0zVLf241eqvjZS5FQz2Nn406SOMhoLUEGWxUuZE2Qsy0nik+/vt1bdWWv0shVTNnvd9AioZkKGdW5yvdwxYIUoxH7DLvfTuiw68+XiPWCmfGvsDti3mSwAIqaUd1wnXJs2sg/qblEYgmc2V/yz4jncpst7c+HOnGft6GMV7dTKUlOjj+exhB5QA07jgbiQnjMD+BTMGh3OAWaZMOKjYhVqrfJbtpybBNAS7uhecTKDE/Wu07vW78NQNPay4EO8YVxs5hIf3tubBh49ybB3s8KTrIR2g==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(39860400002)(136003)(396003)(346002)(451199021)(36756003)(38070700005)(86362001)(33656002)(2906002)(5660300002)(6512007)(83380400001)(186003)(6506007)(53546011)(91956017)(54906003)(6486002)(122000001)(66556008)(66476007)(66446008)(64756008)(6916009)(4326008)(38100700002)(316002)(2616005)(66946007)(76116006)(478600001)(71200400001)(8936002)(8676002)(41300700001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <E1E10B91C0C8264A8584D68678EDEDF6@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6588
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	ad7d4547-45b0-4728-eca4-08db7d567e29
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	xgfL8gbZ+fRwNzBvVILQFBdz04hFPDjn0xYFJUKkvrce0l5FgeeHqEEaD/fv0SJog7F3SEYP9lngAyHBNqLrhTFb5msG5RqALWbQgSU56FKxffN1VWajCR7igwMlOLp3vEydPyIGNNtwiz+MHHNBDWxTzDlAg7rgF19yrVqmnOYRnWNPQ432BQijVMOo5n/AzHoP9+TF6jq17lB+XcVdgjiDK1Iz81Jy1Txva7Me1fjeZ6l+dGjkwXvKMMb8QbncAK6ZKGyMUPhSBxt7qHTvNc5Qz2JFLN8ueyCiNOLbQg8IbdXl2cUuwYc6m0nUqH2ZcRRlVe7scaSs1JEd7xuvUZv1QkVhzdzi5275RQKr+MV90u69tIK0zvCpAewdU+kXF/e52Hwsu3N3un4bDbExV7UOB0bGbJDBQ5rULVAhQ55wqaatmlEq2ppSj1XhbVtTW/tBPE/X1tdCRGuknJe/+NvmTfL974/nQwc8W3vRXzmG3d4SfI7QH1ASQPkTBKpJlN69JC+AZKRzCXlHn3iqdcwsFCreQ2vy7V+axKhJjDQuE68fe/mHLtto/UsigAKafq3cYZypktZhvMy1JiSCuzitmIAANO5SzyZImBzGA2nJ4TEYeDnJpd9aAlH3N6+s0M47BW4ocvmoD8juA3AIObwa7qWMPEDz4TgRx5CvDiTGeOIZLBHqyws3BFvlIwl4iOh52igwlTqdqhzT6DwiYPlo+K349p1XaQy173OxHhBpSgb49ZXHC3dy+drEf5zG
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(376002)(346002)(396003)(451199021)(46966006)(40470700004)(36840700001)(70206006)(8676002)(8936002)(6862004)(2906002)(2616005)(70586007)(40480700001)(5660300002)(6506007)(53546011)(26005)(186003)(336012)(41300700001)(40460700003)(107886003)(82740400003)(356005)(81166007)(6486002)(4326008)(47076005)(33656002)(36756003)(316002)(83380400001)(54906003)(36860700001)(478600001)(6512007)(82310400005)(86362001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 12:51:12.5679
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: c9f6b45e-a0b6-44e0-d31e-08db7d568348
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8267

Hi Julien,

> On 5 Jul 2023, at 13:55, Julien Grall <julien@xen.org> wrote:
>=20
> From: Julien Grall <jgrall@amazon.com>
>=20
> On Arm, it is not possible to use ACPI without UEFI. In fact disabling
> UEFI but not ACPI will lead to a compilation error:
>=20
> ld: prelink.o: in function `acpi_os_get_root_pointer':
> /builds/xen-project/people/andyhhp/xen/xen/drivers/acpi/osl.c:73:
> undefined reference to `efi'
> /builds/xen-project/people/andyhhp/xen/xen/drivers/acpi/osl.c:73:(.init.t=
ext+0x8ac0):
> relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against
> undefined symbol `efi'
>=20
> So make the dependency clear in the Kconfig.
>=20
> This was spotted by the randconfig build in gitlab CI.
>=20
> Fixes: 12314be5749e ("xen/arm: make ARM_EFI selectable for Arm64")
> Signed-off-by: Julien Grall <jgrall@amazon.com>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> xen/arch/arm/Kconfig | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>=20
> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> index c30f32457388..439cc94f3344 100644
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -63,11 +63,11 @@ source "arch/Kconfig"
>=20
> config ACPI
> bool "ACPI (Advanced Configuration and Power Interface) Support (UNSUPPOR=
TED)" if UNSUPPORTED
> - depends on ARM_64
> + depends on ARM_64 && ARM_EFI
> ---help---
>=20
>  Advanced Configuration and Power Interface (ACPI) support for Xen is
> -  an alternative to device tree on ARM64.
> +  an alternative to device tree on ARM64. This requires UEFI.
>=20
> config ARM_EFI
> bool "UEFI boot service support"
> --=20
> 2.40.1
>=20



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 12:52:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 12:52:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559177.873915 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH1zw-0005Uf-Bp; Wed, 05 Jul 2023 12:52:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559177.873915; Wed, 05 Jul 2023 12:52:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH1zw-0005UY-8l; Wed, 05 Jul 2023 12:52:44 +0000
Received: by outflank-mailman (input) for mailman id 559177;
 Wed, 05 Jul 2023 12:52:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=cLSs=CX=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qH1zu-0005UQ-6m
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 12:52:42 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on060e.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::60e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d3920fac-1b32-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 14:52:41 +0200 (CEST)
Received: from AM6P191CA0043.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:7f::20)
 by DB3PR08MB9086.eurprd08.prod.outlook.com (2603:10a6:10:430::10) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Wed, 5 Jul
 2023 12:52:37 +0000
Received: from AM7EUR03FT023.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:209:7f:cafe::34) by AM6P191CA0043.outlook.office365.com
 (2603:10a6:209:7f::20) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 12:52:37 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT023.mail.protection.outlook.com (100.127.140.73) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.24 via Frontend Transport; Wed, 5 Jul 2023 12:52:37 +0000
Received: ("Tessian outbound 546d04a74417:v142");
 Wed, 05 Jul 2023 12:52:37 +0000
Received: from ed63330c8289.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 3910A205-1919-4859-83A0-F1F41B4BEB0A.1; 
 Wed, 05 Jul 2023 12:51:38 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ed63330c8289.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 12:51:38 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by DB9PR08MB6588.eurprd08.prod.outlook.com (2603:10a6:10:25a::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 12:51:37 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::8f61:5b01:4db1:8363]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::8f61:5b01:4db1:8363%6]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023
 12:51:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d3920fac-1b32-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=oj1W+bkzJHz01I0MRE3nVj2CGpAeYUaqX+hFXrc6Eug=;
 b=Ily2BCQV36u0SqMvrcgySVG3/H2SgL7THOWj5EsTkGSA+eZDzcS+n2MtN/HxP2GONoSvAyMlOJYXWNoBQVjGX759ubPFOdfMqd83J6mo42h2sY9ktlfqAVHBl0cq2HqUUMeK9STZs0kwIUMALM2+cfp8PUzHd2GV4sAqI4vV4b0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 923ca02a12a65704
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=GhZyVQl7VZpIf9mQsC1neuD17za21HHng246E4iQO+5YnkmiMwIk1NgA5pIc0y9I5REYCANhNgNQpCMhgLg+nt2bwZL2Tzh1Z5qKLs3wX2rRLy+0l1KympivbCFRngCpJYIlzQE+0ubbr7bQW7VEuDb1YUzR8ELoe1PNneat9z0V+M/aa8OQP4eD5zYuT3eprlKzkEcXtbd3BwzKgGfEr9p9pEFHD+oiq/3dp0A8ZJVCX8sY3WCKssNcJgJEoC9XkPDyvFzrC8RBioP6yynih6zQnwH67V5oMJDXxdCE+YW3b2iK6F0vl8XAuSfnY2hmP4dNO6fZ4BdVzqwkf87jTw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=oj1W+bkzJHz01I0MRE3nVj2CGpAeYUaqX+hFXrc6Eug=;
 b=nvIQdd0KzhO0LYD96rYDYEObHeP2ECb527Zw96yXan4nTag0OCHjIkQW/c/V4zHOVvbtORwOb39xO8ISeJmROlmwT/c3UoLXUo1Ntl2aRZCEu8YGFORqj60q9ldw9QsnxVtbaD9waEiRgPcwJpDQPxciPqKE+jbr8PBMt7R/JWRiDGmwX2wae7kmPp+HYIdNhr0sBkWq9PTUDxSLPXHsgtAkw9fcKednpYhGM0HQB1+Lss1/qR2hSpJAior9K9NjmmDUpp2mO6XhNPk8L/5szdT963bgOWfMl9FWd3lmDeSZdfEA1nxttpzH4KQlF6Q2aK890F1hufZIpeI+x3Tdhg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=oj1W+bkzJHz01I0MRE3nVj2CGpAeYUaqX+hFXrc6Eug=;
 b=Ily2BCQV36u0SqMvrcgySVG3/H2SgL7THOWj5EsTkGSA+eZDzcS+n2MtN/HxP2GONoSvAyMlOJYXWNoBQVjGX759ubPFOdfMqd83J6mo42h2sY9ktlfqAVHBl0cq2HqUUMeK9STZs0kwIUMALM2+cfp8PUzHd2GV4sAqI4vV4b0=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Julien Grall <julien@xen.org>, Luca Fancellu <Luca.Fancellu@arm.com>,
	Michal Orzel <michal.orzel@amd.com>, Henry Wang <Henry.Wang@arm.com>,
	"andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>, Penny Zheng
	<Penny.Zheng@arm.com>, Wei Chen <Wei.Chen@arm.com>, Julien Grall
	<jgrall@amazon.com>, Stefano Stabellini <sstabellini@kernel.org>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] xen/arm: Kconfig: ACPI should depend on UEFI
Thread-Topic: [PATCH] xen/arm: Kconfig: ACPI should depend on UEFI
Thread-Index: AQHZrzemFhjMGQXcTkKAEu+0mA/HSq+rE0UAgAAM0ACAAABNAA==
Date: Wed, 5 Jul 2023 12:51:37 +0000
Message-ID: <A6830B87-B202-42BE-A2E5-095B197F6678@arm.com>
References: <20230705115534.26004-1-julien@xen.org>
 <2761ae84-113d-c230-ad50-e9cfb0ae434b@suse.com>
 <3C9C10E5-D5E0-4B4E-935D-80832BB795C4@arm.com>
In-Reply-To: <3C9C10E5-D5E0-4B4E-935D-80832BB795C4@arm.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|DB9PR08MB6588:EE_|AM7EUR03FT023:EE_|DB3PR08MB9086:EE_
X-MS-Office365-Filtering-Correlation-Id: 588e6456-437b-4541-47df-08db7d56b5d6
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 5llzmBfHfoilQK5lMXpaTPnnReHnYkvmvBsf+P3odQQLPOKvLfhWJBtJbLyxkeni4RNb8yhoBpYbZVRh5N9gyLolenKzUuXDfjFNeKZXAQ48dLqR2KJwDEVsdqI3glo8KY50Yy+akvMdrzuFkSSYxWTqq4o1yCYtPVlJeHxkxMuUlhEYZZ+pzu2TTiv7mxqIvZk9vxh37U60h9ueHfs2HeIgXDZjSeLUSgzLZQqGVk0+SRAbdSg2d6VckftgiWWyrdSqpvSTQgSPMisyIwBOcpVFa85JLNzshZ2FtwFes1oC+rb2nVVROuv9rXjAC8jGVN0twBBuSyAzSNfvOK05y6uII4d2E2fpaDosZQ2yeXqhB9CbbNhFj14kl9skjZXyNz2NYg1iQtfQQlpv26ntTJn2X4fCr64FBP3aPaAl+EtJnbeaoLxvOKzyg7AA3oIpe1ab4zaXyyf5XwL2tWAUrdI5QDfngYbdYgL9BIwZst1DiRbk+Aao6pfRGx1ozy1dpWaY1FM1EXR4K3lP2ucwIIH66r8HQiYH16WqbAfxFNZZTFPgrZuJki+WFzhj+TTEh6pZiddfun7m+w6kc+WV4x8eGlY6IgG+tIsB8bSfcFSxwgrOUd//uhgZKltEAmTl0bNw4fM4r0BHba2Cm0HicA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(39860400002)(136003)(396003)(346002)(451199021)(36756003)(4744005)(38070700005)(86362001)(33656002)(2906002)(5660300002)(6512007)(186003)(6506007)(53546011)(91956017)(54906003)(6486002)(122000001)(66556008)(66476007)(66446008)(64756008)(6916009)(4326008)(38100700002)(316002)(2616005)(66946007)(76116006)(478600001)(71200400001)(8936002)(8676002)(41300700001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <A5DCBE915CEF1C4780923C40F3DD6C48@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6588
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT023.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	6e0202b2-03ff-4f75-38ed-08db7d5691e8
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	gZmDGsC3jnYSaC27LvzfbnKag59RkdhoAkVeu+RE4TMzGonllWqdWio4JaHWekf5p7uEQ1lbk6os4M2Rky78XCaAQUpaD95KVJXzf1iJSOfxQ6+tIJx2s2vMe2qxthc2iPSYuXZ1LXiIQ0iJ/6YAJcZpXYqCuPMuGSskM9ldB3STf8gZLQr64KqIZMUmovQ4un+D9jlAEDE410vtnQJvQOW0ManqEYiBrRClDe7P1KyvlpSLQ/KbYCneyHbeFZHzdHnMxxE2abUTjGkAuvgbLxF2YSS180AhpTPussrGDuV3riVTA/yhXo3KVWClMVnqKJtGKkR8Sempx9HBXXoobx/Uo//mpQ9AEm/OCdvetE7eGBXbpYqNDjNY8+RYJJkPQrxQIZOxLCHja0k3nqH1T6ndxMHCuXR5EV20JK1eDvH48Jc0iqva0GmavR4eJyBSvJfis4aklKNkwFbn3hSdJq2ZTfzCgz2kERwvJVPJl5957Kh9HMtAhQkggOoc76wYmJjcUZ92+98VrtzNrgCvnp0su3+0Ccr4VdcikDlVi4/E63p93dlZa0QPKcaF31IkxFB/WJBeRvL+Azba0jCv+yWta6ULAVMtVQnX+TEzr+JzNiLBygHPH0v/1hwcy4qzfsLfoHfk7BNPHPYfClOupr3ynioq1t26l2jZzENlO1R9EAe5eFPjrIAZlaHGl8e9icmU5U50wM+DrgLHNPtLygEPWy4IgoaEML9DSv+llZQ0el2ZaUcA0eZEN7STIQff
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(376002)(39860400002)(136003)(451199021)(40470700004)(36840700001)(46966006)(4744005)(2906002)(41300700001)(40460700003)(6486002)(82310400005)(81166007)(356005)(82740400003)(2616005)(6512007)(47076005)(336012)(53546011)(6506007)(26005)(186003)(36860700001)(40480700001)(54906003)(86362001)(478600001)(33656002)(4326008)(70206006)(316002)(70586007)(5660300002)(8676002)(36756003)(8936002)(6862004);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 12:52:37.3654
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 588e6456-437b-4541-47df-08db7d56b5d6
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT023.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB9086



> On 5 Jul 2023, at 14:50, Bertrand Marquis <bertrand.marquis@arm.com> wrot=
e:
>=20
> Hi Jan,
>=20
>> On 5 Jul 2023, at 14:04, Jan Beulich <jbeulich@suse.com> wrote:
>>=20
>> On 05.07.2023 13:55, Julien Grall wrote:
>>> --- a/xen/arch/arm/Kconfig
>>> +++ b/xen/arch/arm/Kconfig
>>> @@ -63,11 +63,11 @@ source "arch/Kconfig"
>>>=20
>>> config ACPI
>>> bool "ACPI (Advanced Configuration and Power Interface) Support (UNSUPP=
ORTED)" if UNSUPPORTED
>>> - depends on ARM_64
>>> + depends on ARM_64 && ARM_EFI
>>=20
>> Wouldn't it make sense to drop the ARM_64 dependency then? It's now
>> redundant, and it seems quite likely that if EFI was ever support
>> for 32-bit, ACPI could then be supported there as well.
>=20
> I think we need to keep it.
> If we add one day EFI support on arm32, we will probably not add ACPI sup=
port anyway.

Sorry Julien I answered Jan before seeing your mail but I said the same :-)

Cheers
Bertrand

>=20
> Cheers
> Bertrand
>=20
>>=20
>> Jan




From xen-devel-bounces@lists.xenproject.org Wed Jul 05 13:13:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 13:13:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559181.873925 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH2Ja-00080T-U2; Wed, 05 Jul 2023 13:13:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559181.873925; Wed, 05 Jul 2023 13:13:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH2Ja-00080M-RP; Wed, 05 Jul 2023 13:13:02 +0000
Received: by outflank-mailman (input) for mailman id 559181;
 Wed, 05 Jul 2023 13:13:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Ax/R=CX=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qH2Ja-00080G-AM
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 13:13:02 +0000
Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com
 [2a00:1450:4864:20::630])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id aa87936c-1b35-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 15:13:00 +0200 (CEST)
Received: by mail-ej1-x630.google.com with SMTP id
 a640c23a62f3a-99357737980so425395566b.2
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 06:13:00 -0700 (PDT)
Received: from EMEAENGAAD19049. (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 bu2-20020a170906a14200b009829dc0f2a0sm14489665ejb.111.2023.07.05.06.12.59
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 06:12:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aa87936c-1b35-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1688562780; x=1691154780;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=TY199SDQDe/xSpHLWKJswILQ0On+ma3T5edE7oPEr20=;
        b=GUhh5S2vZNItlczwPmcZzOWV1m+EQjGJmoqOGCe3d8Whm344G17eYnkbaU7oY4p5no
         lEPubtGaAyVckFRc2ciqE85rjUQflh8uHjXJEsAG+kttU2TB3U1h8fRM2kHLtxskqvGZ
         Sq0/lKjpy9A+02vn14CS/q3YGqMoJPjpRyYG0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688562780; x=1691154780;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=TY199SDQDe/xSpHLWKJswILQ0On+ma3T5edE7oPEr20=;
        b=ZOQNmYfSF9RJsGPcpWJtKcp1yGb3M4fILmc2yLy71Mqis/Q9wNwh32LzrEJdZp2cvr
         auFDImGKZXfT0BuABpkVZHBTu0GP+hueJLUoWOdtNcjP5FTxRugSfu0WdnI75w2wapa7
         c2eQ2aEALKyBwfDj2LjJ/EIs2Ign1S8vEJlK0ZnYAXJQNVp5xljY3lMIyp5MVSKfVASG
         5t+B3akjKsG2gTQm/W3Y00VD4oDLK26MITK5tJby3MeksEFZLZBnJTRVhKoCS2JqOGGF
         ii7TBig81ND1kcP9rJrhgApMRhA84F1cQ0m7oZzdN0IBxFN4siy9qvbC0+7aezSQvmaQ
         76Eg==
X-Gm-Message-State: ABy/qLbg4WNno+0MqGNCwpnNNA7mVI9YDEug/JIJXq0H7RPOkJmcJdk5
	nWZZ2ncth7jXQsqh5r+l8iddDQ==
X-Google-Smtp-Source: APBJJlFzs5tkCN9yKqz4UrRDVhkU1qJ7han4QMFDjCZdPK3iSa+j19VZj4gW24/ADDI5i90aV+f+tg==
X-Received: by 2002:a17:906:5fd1:b0:975:942e:81e7 with SMTP id k17-20020a1709065fd100b00975942e81e7mr11808499ejv.37.1688562780063;
        Wed, 05 Jul 2023 06:13:00 -0700 (PDT)
Message-ID: <64a56c5b.170a0220.c33b5.793c@mx.google.com>
X-Google-Original-Message-ID: <ZKVsWhLTlxojSwaM@EMEAENGAAD19049.>
Date: Wed, 5 Jul 2023 14:12:58 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v5 3/4] x86: Read MSR_ARCH_CAPS immediately after
 early_microcode_init()
References: <20230629152656.12655-1-alejandro.vallejo@cloud.com>
 <20230629152656.12655-4-alejandro.vallejo@cloud.com>
 <0dafce38-e572-3675-7f5f-a44a097abf09@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <0dafce38-e572-3675-7f5f-a44a097abf09@suse.com>

On Wed, Jul 05, 2023 at 12:43:27PM +0200, Jan Beulich wrote:
> On 29.06.2023 17:26, Alejandro Vallejo wrote:
> > @@ -324,9 +324,10 @@ void __init early_cpu_init(void)
> >  	case X86_VENDOR_SHANGHAI: this_cpu = &shanghai_cpu_dev; break;
> >  	case X86_VENDOR_HYGON:    this_cpu = &hygon_cpu_dev;    break;
> >  	default:
> > -		printk(XENLOG_ERR
> > -		       "Unrecognised or unsupported CPU vendor '%.12s'\n",
> > -		       c->x86_vendor_id);
> > +		if (verbose)
> > +			printk(XENLOG_ERR
> > +			       "Unrecognised or unsupported CPU vendor '%.12s'\n",
> > +			       c->x86_vendor_id);
> 
> Just as a remark:
> 
> 	if (!verbose)
> 		break;
> 
> would have been less of a delta and keeping all lines within the 80
> chars limit.
Very true, that looks nicer.

> > @@ -340,10 +341,11 @@ void __init early_cpu_init(void)
> >  	c->x86_capability[FEATURESET_1d] = edx;
> >  	c->x86_capability[FEATURESET_1c] = ecx;
> >  
> > -	printk(XENLOG_INFO
> > -	       "CPU Vendor: %s, Family %u (%#x), Model %u (%#x), Stepping %u (raw %08x)\n",
> > -	       x86_cpuid_vendor_to_str(c->x86_vendor), c->x86, c->x86,
> > -	       c->x86_model, c->x86_model, c->x86_mask, eax);
> > +	if (verbose)
> > +		printk(XENLOG_INFO
> > +		       "CPU Vendor: %s, Family %u (%#x), Model %u (%#x), Stepping %u (raw %08x)\n",
> > +		       x86_cpuid_vendor_to_str(boot_cpu_data->x86_vendor), c->x86, c->x86,
> > +		       c->x86_model, c->x86_model, c->x86_mask, eax);
> 
> Since rearrangement to limit line length isn't really possible here,
> the last two lines need re-flowing to stay within limits.
I assumed they could could share the length of the printk string. I don't
mind either way.

> 
> > --- a/xen/arch/x86/cpu/microcode/core.c
> > +++ b/xen/arch/x86/cpu/microcode/core.c
> > @@ -886,5 +886,11 @@ int __init early_microcode_init(unsigned long *module_map,
> >      if ( ucode_mod.mod_end || ucode_blob.size )
> >          rc = early_microcode_update_cpu();
> >  
> > +    /*
> > +     * MSR_ARCH_CAPS may have appeared after the microcode update. Reload
> > +     * boot_cpu_data if so because they are needed in tsx_init().
> > +     */
> > +    early_cpu_init(false);
> 
> I think the comment would better talk of ARCH_CAPS as an example of what
> may newly appear with a ucode update.
I just started writing a paragraph stating that it's unlikely anything else
will just appear, but thinking it through you're definitely right. A new
MSR_NEW_SPEC_MITIGATIONS might very well appear.

Something along this lines would be better?
```
          * Microcode updates may change CPUID or MSRs. We need to reload
          * the early subset boot_cpu_data before continuing. Notably tsx_init()
          * needs an up to date MSR_ARCH_CAPS.
```

> 
> With at least the middle item taken care of (which I'd be happy to
> do while committing)
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> 
> Jan
Thanks. I'm happy with all 3 changes being done on commit.

Alejandro


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 13:19:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 13:19:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559184.873935 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH2Pz-0000CJ-GQ; Wed, 05 Jul 2023 13:19:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559184.873935; Wed, 05 Jul 2023 13:19:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH2Pz-0000CC-DU; Wed, 05 Jul 2023 13:19:39 +0000
Received: by outflank-mailman (input) for mailman id 559184;
 Wed, 05 Jul 2023 13:19:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Ax/R=CX=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qH2Py-0000C5-KR
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 13:19:38 +0000
Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com
 [2a00:1450:4864:20::52a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 97391a0f-1b36-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 15:19:37 +0200 (CEST)
Received: by mail-ed1-x52a.google.com with SMTP id
 4fb4d7f45d1cf-51d9695ec29so6611967a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 06:19:37 -0700 (PDT)
Received: from EMEAENGAAD19049. (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 n15-20020a05640204cf00b0050bc4600d38sm13102913edw.79.2023.07.05.06.19.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 06:19:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 97391a0f-1b36-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1688563177; x=1691155177;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=fNWqkfpY8O+LC0woT+RLk77yDqFKrDnTj3/t36sTusI=;
        b=YcTveAsZ9sQKA38cVjoUweNk6puMB+HXMcXOpdn9COQOphtDv8izLubOW2Gp81pxKc
         aHvhMr3vSDTp8d6Q6z47Knw7MeWkPg1kb5v4wBtHpn98oAwvPeD+ChJAOqD8ljfO4Xnn
         ToCl7PktRS6Pm6AZgWLIRM3esxlhanjZvJj3M=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688563177; x=1691155177;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=fNWqkfpY8O+LC0woT+RLk77yDqFKrDnTj3/t36sTusI=;
        b=FQa5HdM07VNBlbwb6t96AfMlv7Otp47HQBP7N19HVncERersG2rhrhQSCVqbXWsjT6
         7yXji/Ea8b7DDfObJ/+64FOBlTyX0zEUIb1ZjeqVFTfU3TYZ3zdTjqi3lFRyeYiZN3aF
         e0JG29c7v5O+XvjOs31DGs/lrnBh8gduzR9NwqzJtF9CIqNlXBxU4D+76AX2JlGburZK
         Gv8lapnjtHT2iSb9Q4/qctEAcPJpMnCnaUyOJht8CS7//MXNAmugRXmMwzfi5GEaSj0h
         ARzBahtitDmBQ2wlVBX/vmrSg2vGf/TNSBHlCcuRNwsuALsklJkiY7U/yGq83O9+SDno
         eM4w==
X-Gm-Message-State: ABy/qLbgnBXYVzEFAk2KoNtt31pi364GkubtJ2qhrgjUofcdrFg0PBrp
	nK4pnY7jnwpfv2+PWBrQMQfFzQ==
X-Google-Smtp-Source: APBJJlE83lVD7cj5ICvUFNipVkGEakx5iPewbWcvjlVwejs+p5tLdwAvv2uTVnryv63Xo0nraVEAHA==
X-Received: by 2002:aa7:de10:0:b0:51e:26a3:1ba3 with SMTP id h16-20020aa7de10000000b0051e26a31ba3mr1451557edv.19.1688563177191;
        Wed, 05 Jul 2023 06:19:37 -0700 (PDT)
Message-ID: <64a56de9.050a0220.a91e8.eeca@mx.google.com>
X-Google-Original-Message-ID: <ZKVt558EsgVrbZTa@EMEAENGAAD19049.>
Date: Wed, 5 Jul 2023 14:19:35 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v5 3/4] x86: Read MSR_ARCH_CAPS immediately after
 early_microcode_init()
References: <20230629152656.12655-1-alejandro.vallejo@cloud.com>
 <20230629152656.12655-4-alejandro.vallejo@cloud.com>
 <0dafce38-e572-3675-7f5f-a44a097abf09@suse.com>
 <64a56c5b.170a0220.c33b5.793c@mx.google.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <64a56c5b.170a0220.c33b5.793c@mx.google.com>

On Wed, Jul 05, 2023 at 02:12:58PM +0100, Alejandro Vallejo wrote:
> Something along this lines would be better?
> ```
>           * Microcode updates may change CPUID or MSRs. We need to reload
>           * the early subset boot_cpu_data before continuing. Notably tsx_init()
>           * needs an up to date MSR_ARCH_CAPS.
> ```
That makes no sense. I sent the email before completing the sentence. I
meant:

```
          * Microcode updates may change CPUID or MSRs. We need to reload
          * the subset of boot_cpu_data we got on early_cpu_init() before
          * continuing. Notably tsx_init() needs an up to date MSR_ARCH_CAPS.
```

Alejandro


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 13:33:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 13:33:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559187.873944 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH2dY-0002au-Li; Wed, 05 Jul 2023 13:33:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559187.873944; Wed, 05 Jul 2023 13:33:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH2dY-0002an-J2; Wed, 05 Jul 2023 13:33:40 +0000
Received: by outflank-mailman (input) for mailman id 559187;
 Wed, 05 Jul 2023 13:33:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gl5h=CX=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qH2dX-0002ah-Hr
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 13:33:39 +0000
Received: from NAM02-BN1-obe.outbound.protection.outlook.com
 (mail-bn1nam02on2060d.outbound.protection.outlook.com
 [2a01:111:f400:7eb2::60d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8b8486a0-1b38-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 15:33:37 +0200 (CEST)
Received: from SN6PR12MB2621.namprd12.prod.outlook.com (2603:10b6:805:73::15)
 by DS0PR12MB8199.namprd12.prod.outlook.com (2603:10b6:8:de::20) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 13:33:34 +0000
Received: from SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54]) by SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54%2]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 13:33:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8b8486a0-1b38-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=j3ZTC3Vp8S4UO5Y1CFQZ9IdG0OBCZHotp6UH+NtQsEnR5XD/yW1x0BhLQTwkahW2D+oLiTSVEZNUziaO6n7fIy22ZT5l/m8UqDEaV5Ib/KN2rG93hLJ354n5q14ERbcPrQGi2lQieGjZN0ZCrSMVghJRgF0Ej+Wf0TdCbSVkM+0oYzXnBK69uuZHAH75fTg408dISlxp66qMmjuq+OZzUYRut9HgcnvIM7KO+K0d2Qhj41HsC6jUHz9wEgTCrVQsXsQz2T1XNy1xpvCC+ryP9p/AN9H4X9n1k/UFpBQGsgl0bDG0Gp6MRS32bUzW7I8qWtkeJ+sYjFVfJBLIUqpdvQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=lmxiVaawXqxwBbjDUbbsZNK9Ny7gAEItquCWJR+ztws=;
 b=eP8obBVhYh0RpFR0yvhU3xpDl41mGPZ1q51dDVMQYgVb6CG2ZMvFOus47tZnR926do2xYndWh7ibgjhgi8prSfunGbHBqk9gblPc4GKW7WtyjnjGChOjyMFSJnOqun8Qg6RpQ8IqFlAczhf/OHIK5zHpff3KYwfgp5Os/AKtRrygJCCgzjCwMgRYXVGzNI3yf3Ou0JXHAN4BdQEd/PPxjxDeVok50YEldXOkRkKv4UJRtaeysNRPQHQe4L7DZFd25gQTIHUterBvCQeiCqNG3qbpoO+ycfxBq8q95h0pn1w4f/myLnUf3fz9GZT2LX4LBpRP0Vu9skxdyhETIm2prQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=lmxiVaawXqxwBbjDUbbsZNK9Ny7gAEItquCWJR+ztws=;
 b=OX6QOFdBZdK1fxuvRTcdKeATJKUeMXwoGzqWnmiluZSj6zMWIlNSlICM7dhhhNDclNiz70FEWDe559B8HTjBPMTuUKFZ7wi6OK1aKPDc3VdZZs/zZdCuXUQhPiCpktUN0gHrIlrLRFCCBKG4qes5kV72ZkkCneNgsoKVs5ofBS4=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <ae0f338b-e86e-79db-8cb1-65cdd36c0911@amd.com>
Date: Wed, 5 Jul 2023 14:33:28 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 35/52] xen/arm: map static memory on demand
To: Penny Zheng <penny.zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-36-Penny.Zheng@arm.com>
 <16428e2d-423c-6a9c-5caa-6ff5770a840e@amd.com>
 <add845b8-31c1-52a6-18ff-b19a6cb6ef38@arm.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <add845b8-31c1-52a6-18ff-b19a6cb6ef38@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P123CA0089.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:138::22) To SN6PR12MB2621.namprd12.prod.outlook.com
 (2603:10b6:805:73::15)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN6PR12MB2621:EE_|DS0PR12MB8199:EE_
X-MS-Office365-Filtering-Correlation-Id: 5b9af914-5930-4f5c-f9fa-08db7d5c6df5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	+W+fjTTEzGSec4jzHfapoDZpqC97tG227B1tEkvDM5XYIh72yge9+DEzst0t1E9IiH5vTqTR4A+izi2kwSQLEPkFGcpx2zMnnQouoiU/MefsHgo95+iLqeVx3BQrceqR8c75LpR9Pc3rKmPriYKg9yTklCadL2HeRDjHYbHiM0dWg8By5J4X3FG7z3UqDKGvnZR230zxxkrV/ISlZJvHdW8iQHPzORC1Dv/NfYXfwhwsHOtNvbG4/mdBaPV2qt/oeoDgXBL0xuF2Q2KBPXdEGfgV4aPLV6U4yYATksHITWC+mRWm2NB8vTaWcfXluW4NZsuOuA6yrO1DXY9Vs6be6MJ0DBBZR+HxI5UUAbLmqMDXqGDyPfput4r0VSa7+wwNxIfYEMspgX8HZqrWIZsyAMmPgNoURYG8vk3fgwfdPNWyds5KPU53RaiL+ZSxtatAH3JCrwM7/uTWu1B3qEOBPwHWkXhunHprlE6/AXzsaMePs9+uN9XHEDWq3eMpcPVUJuqLRRbL0kxJgGp5WfXdFvzzEwNHJS7pZpuzaVuwmDHErKXs/cec4U+ORs+5VECkkTBNMMhDW/06rVdW2L41BfRusLY0VxuoeyXDagVadkATFq7VCEtf0MFpkIlCR2SPmngcY1bYUOEoVE7rDSqUzzEE5tbDO3OCt5pK+Vtrgak=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2621.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(136003)(396003)(376002)(366004)(451199021)(41300700001)(478600001)(6512007)(54906003)(31696002)(38100700002)(6666004)(6486002)(4326008)(36756003)(316002)(83380400001)(66556008)(66476007)(66946007)(2616005)(8936002)(8676002)(2906002)(5660300002)(31686004)(186003)(53546011)(6506007)(26005)(21314003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Y2ZkMTVhcjhHcjlhTy9pUWJvOVdTYUNmTFZRQjF4TEtpVDFqa0wyZlRxbjh5?=
 =?utf-8?B?WUJidzU3S0tuLy9BdlptOFhRdFNjZEhuS1NiaGcwdXN3YVB5SkcrcXM0ako2?=
 =?utf-8?B?bXlJU2pndXlRcC9HeHZqSWZMektINStjc3FLdk9DV3RxQWk0aVM1RnJEeith?=
 =?utf-8?B?ak4xdGpyQVk3dFhNSU9kc09oZFRyWkRzdkkwR3dNOTBiajA0WGpaSTlVbFZW?=
 =?utf-8?B?azdaaWhidWszejFMR05kTzFFTERDNERjOFhmY3NreDNrUUxDUEcwbkJjMDVZ?=
 =?utf-8?B?Z0NJQ0lxVm1PU1hNbTRyY2FlZk1XMGgzeXJrS0sxaTY5NkhmY3E0R2g1RjEv?=
 =?utf-8?B?T3E1RkRDTFp2NzBqd0JZNGdZblhxYkJybTdGNHJGVDlXUTdYNzB4ZG5Wbjhn?=
 =?utf-8?B?RUlVSno3M3pFV0ZrQjVuckwrbkdPanBFT0M3ak1JWEhneGJUMUxxcVhzRlJB?=
 =?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XcE15WXNuKzIybjRvdHFNS25CeGxrc0Ri?=
 =?utf-8?B?d0lSdmVaRDdHK25MQzhjbTN1eUpPZk9iQWlhODIwYVRjb1dlQndzVlRWZ2ox?=
 =?utf-8?B?cTI0VWxXOVMzVnNlcHYrRk1HcEdVT1ptalVycTNRYTVydzc2YmRjTDJlcjVU?=
 =?utf-8?B?c0dVTmY3Mm51bTNxZ0tobkplWHlOeUtvd3pTUlFFa1ZUMy9YbmVDNEtJdC9Q?=
 =?utf-8?B?RDBPUXkzQ093RkZHa3dJOGVMODgwajBSeHVYdHo5T05JM0lpajR2RkIxQnll?=
 =?utf-8?B?NnQzOUtPK3dPRi9rY09sU1N2SGxaWFhFYkhSQlo4VmgxdHgxaHp1MnFBSXIw?=
 =?utf-8?B?SkZiRXEwd1FBaWRnVGNGRE05NW9vajM0aHk0REZsSTNac29aMGo4ZFRpZlJw?=
 =?utf-8?B?RG8zckN4enk5MnlCQ3JabTFXdUpybzMyaTdsODZvT2hpKzd6d0w2NmRJZFV0?=
 =?utf-8?B?MHhOMWFUK2FWazVCcS9PYk55RmNONHlzUmVUQy9mcFF1ZDNraDlOMFRHSGda?=
 =?utf-8?B?TVNrTDBoU0RiRktHMTc0dGxFQzk2aWt2b0ZRREZzWjJValFmWXdsalM2d3BM?=
 =?utf-8?B?YjFPbzl2dStoNTZsSnpuYUpuR0JES1lkMi9XOEdGTjRlMUtrTjBKbVRtc1U0?=
 =?utf-8?B?RGlab3ZZdlBEYzV2bFFxcG96dG9zS21tM3JINTFoS0dzT2hDNzJVQTZRM05u?=
 =?utf-8?B?Qis3eDZkeTZOaUtUMUJaRk1MR1NjZWt6eCtKSjNIUS9TZmRzYkhsYm9CcjRr?=
 =?utf-8?Q?SKclPzx6vaSoAMdS716vVNcOi?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5b9af914-5930-4f5c-f9fa-08db7d5c6df5
X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2621.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 13:33:34.1246
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: AFHKKduELXteVPH9CykIwWmUdiJGNsKASIXJMOqEqXh5GKc1ZHHQdN6HaN+R3gE1O11yMC56jFwybAiTXnQQ5w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8199


On 05/07/2023 11:16, Penny Zheng wrote:
> Hi Ayan
Hi Penny,
>
> On 2023/7/4 23:10, Ayan Kumar Halder wrote:
>> Hi Penny,
>>
>> On 26/06/2023 04:34, Penny Zheng wrote:
>>> CAUTION: This message has originated from an External Source. Please 
>>> use proper judgment and caution when opening attachments, clicking 
>>> links, or responding to this email.
>>>
>>>
>>> In function init_staticmem_pages, we need the access to static memory
>>> for proper initialization.
>>> It is not a problem in MMU system, as Xen map the whole RAM in
>>> setup_mm(). However, with limited MPU memory regions, it is too luxury
>>> to map the whole RAM.
>>> As a result, we follow the rule of "map on demand", to map static 
>>> memory
>>> temporarily before its initialization, and unmap immediately after its
>>> initialization.
>>
>> I could see that you are using _PAGE_TRANSIENTÂ  to map memory 
>> temporarily. However, I don't see this being translated to any of the 
>> MPU hardware features (ie _PAGE_TRANSIENT does not seem to translate 
>> to any of the attributes in PRBAR, PRLAR, PRENR, etc). Thus, how is 
>> it different from mapping the memory in "non temporary" way ?
>>
>
> It is only software feature.
> It is designed for implementing functions like ioremap_xxx(), or 
> map_staticmem_pages_to_xen() here, which are always occuring with its 
> reverse unmapping function nearby like iounmap(), or 
> unmap_staticmem_pages_to_xen(), to map a chunk of memory 
> *temporarily*, for a very short time.
I understand that it is a software only feature. But why does the 
software need to know if the memory is mapped temporarily or not ? What 
difference does it make ?
> I want to check this flag in the unmapping function, to ensure that we 
> are unmapping the proper MPU region.

I had a look at unmap_staticmem_pages_to_xen() --> xen_mpumap_update() 
--> control_mpu_region_from_index() and I don't see this flag used anywhere.

- Ayan

>
> Fixed MPU regions are like Xen text section, Xen data section, etc.
>
>> Please let me know what I am missing.
>>
>> - Ayan
>>
>>>
>>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>>> ---
>>> v3:
>>> - new commit
>>> ---
>>> Â  xen/arch/arm/include/asm/mm.h |Â  2 ++
>>> Â  xen/arch/arm/mmu/mm.cÂ Â Â Â Â Â Â Â  | 10 ++++++++++
>>> Â  xen/arch/arm/mpu/mm.cÂ Â Â Â Â Â Â Â  | 10 ++++++++++
>>> Â  xen/arch/arm/setup.cÂ Â Â Â Â Â Â Â Â  | 21 +++++++++++++++++++++
>>> Â  4 files changed, 43 insertions(+)
>>>
>>> diff --git a/xen/arch/arm/include/asm/mm.h 
>>> b/xen/arch/arm/include/asm/mm.h
>>> index 66d98b9a29..cffbf8a595 100644
>>> --- a/xen/arch/arm/include/asm/mm.h
>>> +++ b/xen/arch/arm/include/asm/mm.h
>>> @@ -224,6 +224,8 @@ extern void mm_init_secondary_cpu(void);
>>> Â  extern void setup_frametable_mappings(paddr_t ps, paddr_t pe);
>>> Â  /* map a physical range in virtual memory */
>>> Â  void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned int 
>>> attributes);
>>> +extern int map_staticmem_pages_to_xen(paddr_t start, paddr_t end);
>>> +extern int unmap_staticmem_pages_to_xen(paddr_t start, paddr_t end);
>>>
>>> Â  static inline void __iomem *ioremap_nocache(paddr_t start, size_t 
>>> len)
>>> Â  {
>>> diff --git a/xen/arch/arm/mmu/mm.c b/xen/arch/arm/mmu/mm.c
>>> index 2f29cb53fe..4196a55c32 100644
>>> --- a/xen/arch/arm/mmu/mm.c
>>> +++ b/xen/arch/arm/mmu/mm.c
>>> @@ -1113,6 +1113,16 @@ int populate_pt_range(unsigned long virt, 
>>> unsigned long nr_mfns)
>>> Â Â Â Â Â  return xen_pt_update(virt, INVALID_MFN, nr_mfns, _PAGE_POPULATE);
>>> Â  }
>>>
>>> +int __init map_staticmem_pages_to_xen(paddr_t start, paddr_t end)
>>> +{
>>> +Â Â Â  return 0;
>>> +}
>>> +
>>> +int __init unmap_staticmem_pages_to_xen(paddr_t start, paddr_t end)
>>> +{
>>> +Â Â Â  return 0;
>>> +}
>>> +
>>> Â  /*
>>> Â Â  * Local variables:
>>> Â Â  * mode: C
>>> diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
>>> index a40055ae5e..9d5c1da39c 100644
>>> --- a/xen/arch/arm/mpu/mm.c
>>> +++ b/xen/arch/arm/mpu/mm.c
>>> @@ -614,6 +614,16 @@ void __init setup_frametable_mappings(paddr_t 
>>> ps, paddr_t pe)
>>> Â Â Â Â Â Â Â Â Â Â Â Â  frametable_size - (nr_pdxs * sizeof(struct page_info)));
>>> Â  }
>>>
>>> +int __init map_staticmem_pages_to_xen(paddr_t start, paddr_t end)
>>> +{
>>> +Â Â Â  return xen_mpumap_update(start, end, PAGE_HYPERVISOR | 
>>> _PAGE_TRANSIENT);
>>> +}
>>> +
>>> +int __init unmap_staticmem_pages_to_xen(paddr_t start, paddr_t end)
>>> +{
>>> +Â Â Â  return xen_mpumap_update(start, end, 0);
>>> +}
>>> +
>>> Â  /*
>>> Â Â  * Local variables:
>>> Â Â  * mode: C
>>> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
>>> index f42b53d17b..c21d1db763 100644
>>> --- a/xen/arch/arm/setup.c
>>> +++ b/xen/arch/arm/setup.c
>>> @@ -637,12 +637,33 @@ void __init init_staticmem_pages(void)
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_t bank_start = 
>>> _mfn(PFN_UP(bootinfo.reserved_mem.bank[bank].start));
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned long bank_pages = 
>>> PFN_DOWN(bootinfo.reserved_mem.bank[bank].size);
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_t bank_end = mfn_add(bank_start, bank_pages);
>>> +Â Â Â Â Â Â Â Â Â Â Â  int res;
>>>
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  if ( mfn_x(bank_end) <= mfn_x(bank_start) )
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  return;
>>>
>>> +Â Â Â Â Â Â Â Â Â Â Â  /* Map temporarily before initialization */
>>> +Â Â Â Â Â Â Â Â Â Â Â  res = map_staticmem_pages_to_xen(mfn_to_maddr(bank_start),
>>> + mfn_to_maddr(bank_end));
>>> +Â Â Â Â Â Â Â Â Â Â Â  if ( res )
>>> +Â Â Â Â Â Â Â Â Â Â Â  {
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  printk(XENLOG_ERR "Failed to map static memory to 
>>> Xen: %d\n",
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  res);
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  return;
>>> +Â Â Â Â Â Â Â Â Â Â Â  }
>>> +
>>> unprepare_staticmem_pages(mfn_to_page(bank_start),
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  bank_pages, false);
>>> +
>>> +Â Â Â Â Â Â Â Â Â Â Â  /* Unmap immediately after initialization */
>>> +Â Â Â Â Â Â Â Â Â Â Â  res = 
>>> unmap_staticmem_pages_to_xen(mfn_to_maddr(bank_start),
>>> + mfn_to_maddr(bank_end));
>>> +Â Â Â Â Â Â Â Â Â Â Â  if ( res )
>>> +Â Â Â Â Â Â Â Â Â Â Â  {
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  printk(XENLOG_ERR "Failed to unmap static memory to 
>>> Xen: %d\n",
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  res);
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  return;
>>> +Â Â Â Â Â Â Â Â Â Â Â  }
>>> Â Â Â Â Â Â Â Â Â  }
>>> Â Â Â Â Â  }
>>> Â  #endif
>>> -- 
>>> 2.25.1
>>>
>>>


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 13:48:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 13:48:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559193.873955 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH2rj-0004DV-0w; Wed, 05 Jul 2023 13:48:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559193.873955; Wed, 05 Jul 2023 13:48:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH2ri-0004DO-UI; Wed, 05 Jul 2023 13:48:18 +0000
Received: by outflank-mailman (input) for mailman id 559193;
 Wed, 05 Jul 2023 13:48:17 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qH2rh-0004DI-7N
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 13:48:17 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH2rg-0000nr-NQ; Wed, 05 Jul 2023 13:48:16 +0000
Received: from 54-240-197-239.amazon.com ([54.240.197.239]
 helo=[192.168.19.213]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH2rg-000106-Df; Wed, 05 Jul 2023 13:48:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=9786cWhmHLb79msPfaC4Ne0US48ChbVFnRfaB9ovDkg=; b=eOqypQUHAWPou1ae3Nv0t3jTKo
	epdWnzZqmXIUK05gPP2cw0YJcFN8SHRY5Sh5BaBcjJ8Budhpba9N1ny7XgSdKwCrjrr12vHkocLsU
	Pm4Ff0lgjOrXFIKKVqRnNWGf6wOtY3+0y/F7wT5W+yKH4GUxgt7GUIkEhUrHqgZnfV4Y=;
Message-ID: <d7ba609e-bdb1-c756-fda2-d23400a8e317@xen.org>
Date: Wed, 5 Jul 2023 14:48:14 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH] xen/arm: Kconfig: ACPI should depend on UEFI
Content-Language: en-US
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Luca Fancellu <Luca.Fancellu@arm.com>, Michal Orzel <michal.orzel@amd.com>,
 Henry Wang <Henry.Wang@arm.com>,
 "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
 Penny Zheng <Penny.Zheng@arm.com>, Wei Chen <Wei.Chen@arm.com>,
 Julien Grall <jgrall@amazon.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230705115534.26004-1-julien@xen.org>
 <FE3E6650-ECCE-4E3D-9515-FDB589FF025D@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <FE3E6650-ECCE-4E3D-9515-FDB589FF025D@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 05/07/2023 13:51, Bertrand Marquis wrote:
>> On 5 Jul 2023, at 13:55, Julien Grall <julien@xen.org> wrote:
>>
>> From: Julien Grall <jgrall@amazon.com>
>>
>> On Arm, it is not possible to use ACPI without UEFI. In fact disabling
>> UEFI but not ACPI will lead to a compilation error:
>>
>> ld: prelink.o: in function `acpi_os_get_root_pointer':
>> /builds/xen-project/people/andyhhp/xen/xen/drivers/acpi/osl.c:73:
>> undefined reference to `efi'
>> /builds/xen-project/people/andyhhp/xen/xen/drivers/acpi/osl.c:73:(.init.text+0x8ac0):
>> relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against
>> undefined symbol `efi'
>>
>> So make the dependency clear in the Kconfig.
>>
>> This was spotted by the randconfig build in gitlab CI.
>>
>> Fixes: 12314be5749e ("xen/arm: make ARM_EFI selectable for Arm64")
>> Signed-off-by: Julien Grall <jgrall@amazon.com>
> 
> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Thanks. I have committed the patch.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 13:52:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 13:52:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559197.873965 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH2vV-0005e2-Je; Wed, 05 Jul 2023 13:52:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559197.873965; Wed, 05 Jul 2023 13:52:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH2vV-0005dv-Ex; Wed, 05 Jul 2023 13:52:13 +0000
Received: by outflank-mailman (input) for mailman id 559197;
 Wed, 05 Jul 2023 13:52:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qH2vU-0005dp-5n
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 13:52:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH2vT-0000sJ-Lf; Wed, 05 Jul 2023 13:52:11 +0000
Received: from 54-240-197-231.amazon.com ([54.240.197.231]
 helo=[192.168.19.213]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH2vT-00017N-G6; Wed, 05 Jul 2023 13:52:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=KSSwevGb69gYHitIjlCFTafPkDM1vWEpOw4yY1XS/2o=; b=x9YZMe51s2nbaizT6GI4RATYmZ
	qcYYw+IatlecOJ5MViD/W6PoznjIz3qBTRCaCobOg6idVQs1cdaL3ppqed9oBC3Yxt3sbF9xJQGQJ
	A1tF5ps3WlJpAcLUsasXe6649yreaR6xYpFMMstGlR97gM1sQLEOlEMtKqg7IF27mUYM=;
Message-ID: <3114b76e-1cf9-12ef-d83c-76c566009e71@xen.org>
Date: Wed, 5 Jul 2023 14:52:09 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 33/52] xen/mpu: initialize frametable in MPU system
Content-Language: en-US
To: Penny Zheng <penny.zheng@arm.com>, Ayan Kumar Halder <ayankuma@amd.com>,
 xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-34-Penny.Zheng@arm.com>
 <ee709651-a6fc-2485-ae2b-edf0306fbc13@amd.com>
 <db707ef1-cc91-bc7d-33d2-bf804ece2226@arm.com>
 <15791f2e-b4cf-aa60-3f67-d9e74877e54b@xen.org>
 <63c58ce7-08c0-e86c-acec-9273f48cdc12@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <63c58ce7-08c0-e86c-acec-9273f48cdc12@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 05/07/2023 10:53, Penny Zheng wrote:
>>> Since if not and when anyone wants to update map_pages_to_xen(), 
>>> destroy_xen_mappings() and modify_xen_mappings() in the future, it is 
>>> possible for them to leave changes in only one file.
>>
>> The helpers are just wrappers. I doubt they will change in the future. 
>> So I think it would be OK to duplicate.
>>
>> The alternative would to have a common prototype for xen_pt_update() 
>> and xen_mpumap_update() and avoid any #ifdery. That said, this is not 
>> my preference at least if they are not static inline.
>>
> 
> Correct me if I'm wrong, you are suggesting something like this:
> A more-generic wrapper like xen_mm_update, and we introduce static 
> inline implementation in mmu/mm.h with xen_pt_update(), and static
> inline implementation in mpu/mm.h with xen_mpumap_update().

Yes as an alternative proposal. But my preference here is to duplicate 
the helpers in mm-mmu.c and mm-mpu.c.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 14:01:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 14:01:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559201.873975 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH33n-0007D5-CG; Wed, 05 Jul 2023 14:00:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559201.873975; Wed, 05 Jul 2023 14:00:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH33n-0007Cy-8p; Wed, 05 Jul 2023 14:00:47 +0000
Received: by outflank-mailman (input) for mailman id 559201;
 Wed, 05 Jul 2023 14:00:46 +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
 <SRS0=asTv=CX=citrix.com=prvs=543a7ddba=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qH33m-0007Cs-IZ
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 14:00:46 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 546ea13c-1b3c-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 16:00:43 +0200 (CEST)
Received: from mail-bn7nam10lp2109.outbound.protection.outlook.com (HELO
 NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.109])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 05 Jul 2023 10:00:41 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by DM6PR03MB5337.namprd03.prod.outlook.com (2603:10b6:5:229::17) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 14:00:38 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606%4]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023
 14:00:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 546ea13c-1b3c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688565643;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=R2jF+Fk+1av2peT0OTKrWYAC9FnMUH30qKEkY/xy79Q=;
  b=ZCIrVZb3pFm4iipjVAeqy0uJelhn4sXLkJfDk+Zn4odaSbwCA6ZlSPbY
   mmCa2MpY+XDup1fF9+V6xd1znMXWY7meucAJQN/2eAeJulhobOPRyRCYJ
   7LyEW2iklDn6aI/dYHOFpxqMr5RLV5wIQIV1+194YjsSFeHDE8rbZocuu
   I=;
X-IronPort-RemoteIP: 104.47.70.109
X-IronPort-MID: 115650006
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:l6YoR6ztKWoAaPqVd4d6t+f3xyrEfRIJ4+MujC+fZmUNrF6WrkVUm
 GoZW2yGPvaKMzSmKYhxbYm0oB4BsJPQnNA3SARq+SAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhPa0T5jcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KTtJ1
 s0/FBInVCi4ifOT+PGqTs5Krf12eaEHPKtH0p1h5RfwKK9+BLrlHODN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvDCVlVQguFTuGIO9ltiibMNZhEuH4
 EnB+Hz0GEoyP92D0zuVtHmrg4cjmAuiAd9MSeXgrqACbFu7wGMRSyc7a3iBhbqArECAYddwC
 UAaw397xUQ13AnxJjXnZDWxpHOGtxgQQd0WDeQ+7AyPzYLf5wGECi4PSTspQMwrsoo6SCIn0
 neNnsj1Hnp/vbuNU3Wf+7yI6zSoNkA9L2UPeCsFRgst+MT4rcc4iRenZslnOL64iJvyAz6Y/
 tyRhC03hrFWh8hU0ay+pAjDm2j1/smPSRMp7ALKWG7j9hl+eIOue42v7x7c8OpEK4GaCFKGu
 RDohvSj0QzHNrnV/ATlfQnHNOjBCyqtWNEEvWNSIg==
IronPort-HdrOrdr: A9a23:39wCrK9+u3PvU53XeWFuk+AVI+orL9Y04lQ7vn2ZKSY5TiX4rb
 HKoB1/73XJYVkqN03I9ervBEDiewK/yXcW2+ks1N6ZNWGLhILBFupfBODZsl7d8kPFl9K01c
 1bAtJD4N+bNykGsS74ijPIb+rJ2LO8gcSVbX+19QYUceltAZsQiDtRO0KgPWBdYhJJPpY9HI
 r03Ls9m9LxEU5nCPhSHxM+LpH+m+E=
X-Talos-CUID: 9a23:01aUuWESM68T+/KQqmI9820lPfwHWEfl93nBBnf7GGJObpasHAo=
X-Talos-MUID: =?us-ascii?q?9a23=3ANiqH5QxjLPKVcv+6NEoWZP1k99WaqKKhCgM3vKs?=
 =?us-ascii?q?lge3HDAp+BQ2Yoxa7TLZyfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,183,1684814400"; 
   d="scan'208";a="115650006"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=DThuuqUeHZNXUA+vbQU8sDTl0kcwft4/JpZ6No2w6v6L6rxgGfRPrCkugPeR2Gk1bm25XPxJSi91VEHGoJO5TawKJ+FWMUZKsTKiz9pQ01ufm/H+2LTVXAG+58YERyCvLYfHYuC/88BwVyaJx1Ntdj/eFRHbJOH4A0tkwmrDMAteJy+bJ/KLuycDK8m7hXsVfHnTdi48cDqZ1gC9IcPQERE2zDKBt5OmrDplu0gA6OfLsm5IeyjxEYizAhdYErQhjhnTQ7nWJWOGNa9N1a12QuDxc0XKzc0BmHZiA5fY/lu0cJ124hds7yMHMFADwA9CDXU7H6aiE56RUrAlYCGL3g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=R2jF+Fk+1av2peT0OTKrWYAC9FnMUH30qKEkY/xy79Q=;
 b=Nr/d8vXblj/EaNFIDAEOnVSlgtm59z1uXHXYH8o1oGkSJjcsUFrRAMZu/4aitH0oFZ1tT49wQ3M2yYpgWNMgWZRQQinbGtHa9usO6pDpOXtyIH49rHVZMMQ8UOv9ThaBTELd3AZ5UduF6yyIIq310QnGX1RuXOW7hX5LiJ9M9ef8FMvTnNUFg+ZUR7BZ/ae4vuBEETB0wVPL++GFuUSSySXXHNrpMZPzbkQYdSTZKMd1c9c0sbcqiJereJniUSo0ubuUUxn6weQj3ZmYIrLVmLk4F4hnw3ePiZ7r5C1WTIDj2yweYYAihGDw3l/1G/zEaKjP6PiViTK3a2AQcJFl4Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=R2jF+Fk+1av2peT0OTKrWYAC9FnMUH30qKEkY/xy79Q=;
 b=JuMi/mTQxv5C20G4G0TqUkwPoHK6UL+GcC49YLD+B1cLlkT9EQvhFr2jv5QK+BtuF1ZL10gp9NBWKf/MjQWR3aMj6D5i44e6n8dczx1Q9pJ1mnSfauYY+BrpTpo9jZp8r5pDTHutlgujqk3GMb60WL6C7XoLcwiwVGDz8Zbkmns=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <9c46b711-cbc8-7de0-4136-7815a02ca169@citrix.com>
Date: Wed, 5 Jul 2023 15:00:31 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v5 1/4] x86/microcode: Allow reading microcode revision
 even if it can't be updated
Content-Language: en-GB
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Jan Beulich <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>
References: <20230629152656.12655-1-alejandro.vallejo@cloud.com>
 <20230629152656.12655-2-alejandro.vallejo@cloud.com>
In-Reply-To: <20230629152656.12655-2-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P265CA0292.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:38f::18) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|DM6PR03MB5337:EE_
X-MS-Office365-Filtering-Correlation-Id: 64067151-c2b2-4f00-4126-08db7d6035d4
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	wiIu0KUKd/WrCk5rr3t+gTapbTLHQMAzKR+BDkGKNaf+ZSFel9BPQasE9EOoK32JIczVoO7rAis3a7xKUKe902SL88o+vxjZh+zmu+UkyroHcnjdEzLHvkUDqChCeXvDBerVlN6OHVv1Z0W/IduE0mzpWOktNbs7Ri3Tae6LU28MkRiI75fWIQLc6ubN0i51FJOW9DouU4O4WpNjbH5hye79VceQ6nEnxMMOrtozl4PYeF4zefFmYzvwyG/oQXf4XX+CpeD8nZcX9nZXOGaAiDYyUzpRO53FN5kYiC45heAQ7AYSMIsQTK56/bzmYcE7+82i4LC/SjYhX0CG+ZduY3qYmS1afMmXU+1hTw7zWp66ZvG4b/mu94p/N8JCn5/PPC94CAuNT4Q+38DWMZdgEJxu8icF6NOvYl11CGg5A19KBfiCCIpQ7Uhk9lgjLRcyLZAvxLRz6NJsM6ps8VKqS+XQ4Ez/dosA7sYXpWdDp2oHet4ffIHAiK1DOJo6ShIvj1nL2PNVsieOlzjw57hrSqwxZPoG0Vn+nKlHmfJM+HaDpHYFKYIW44G2RfKSCr8mDfofPaXS7V8udHYQfuEgY8HN/1/wsk99+CR9jkWI+Ka2rahiZBWVqfQzJMC2XvxBpLLf5wDZ3H/1XQHN9Tqwmg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(366004)(396003)(39860400002)(346002)(451199021)(82960400001)(110136005)(54906003)(6486002)(478600001)(6666004)(41300700001)(8936002)(8676002)(38100700002)(66946007)(66556008)(66476007)(4326008)(316002)(2616005)(186003)(83380400001)(6512007)(53546011)(6506007)(26005)(86362001)(31696002)(5660300002)(2906002)(4744005)(36756003)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SHZsa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v+jhg+2Y5YF1Qu3XomtDwzJmhi4QHkuipRaHfmQbbEizT6LpL0roP0DrkqRJZ7nruCmON8ZaAti0rqCMOoIV3/yOFQiuYTTN7TZ8gzaukKz80WNlawx+mqkJHFRSbxnrQGtuICejCs7iFF0xYODQm6YgQNFhT/NmHihNce1Oi2zNWJdMZILPAB5EbmFbgQFD7Uh/BONtR4fRX+sxU5BnRhsEcDCe1/NdVSHIKZ5hi7PCnZOagruDpPRm7ksKn63Nj+N3h+v+Zd2YyKpWcR2NLSTM0h+WQeUFNJ5tZWVJhBieJ+N2QgsCITyyFluUeR3INiOjpucbtWRWRKJ4lhuRyNgqDLGqolrNUMtbjX/esFCS5AANooOb+6myWdSCUkqWLcrktcuh80r2nskXtw/2s=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 64067151-c2b2-4f00-4126-08db7d6035d4
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 14:00:37.9683
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: TRxeez01K4Z7qX7HvjRJSVLL6L6MjGyx7tttBeseiQhcBw5ZnMRYBCRH2BzIksKyDvIppdWQJBpLCLZbxuLaAUYKjHZNV+eWw805BZQNrvI=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB5337

On 29/06/2023 4:26 pm, Alejandro Vallejo wrote:
> microcode_update_one() currently assumes all microcode handlers are set or
> none are. That won't be the case in a future patch, as apply_microcode()
> may not be set while the others are. Hence, this patch allows reading the
> microcode revision even if updating it is unavailable.
>
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 14:02:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 14:02:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559205.873985 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH34q-0007ix-L3; Wed, 05 Jul 2023 14:01:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559205.873985; Wed, 05 Jul 2023 14:01:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH34q-0007iq-IL; Wed, 05 Jul 2023 14:01:52 +0000
Received: by outflank-mailman (input) for mailman id 559205;
 Wed, 05 Jul 2023 14:01:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gl5h=CX=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qH34p-0007hY-Ko
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 14:01:51 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on20631.outbound.protection.outlook.com
 [2a01:111:f400:fe59::631])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7ba43835-1b3c-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 16:01:49 +0200 (CEST)
Received: from SN6PR12MB2621.namprd12.prod.outlook.com (2603:10b6:805:73::15)
 by MW4PR12MB5604.namprd12.prod.outlook.com (2603:10b6:303:18d::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 14:01:46 +0000
Received: from SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54]) by SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54%2]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 14:01:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7ba43835-1b3c-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=UJQXhN6KvalqVqKRocGPGV0bHkzrsOjRiDPQC5IJUCR/4tOL01cEM1aHo9yY1kb2FSUokTqq6EnKS3axad/NAwSCjo2ZuDflLNX+N6DHubkpiH2g49qKxaFVgaS0NvCvTFGLEqeCE6t38ZAYWHzDpobS8U5CbepVewVx/UdsldRsUsBsadmMBTWUsrMj3gajY1ltgdlR3CkIZdUDIiA5muZ6ff4Azi9Z+EAYuDrTlyIjyduK+ZbeGAKWqLSwpRVWyxeRqTGYWk6+yRD1BlP0tKOYY2a3nAt5Q6LI1a5lF7od9oPYtjN5tVon98FvZTUkS2pgw6vaMPo2f3ilwEm4tg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=xnV1Oz20FfKAim9cI+eKjVqxL+7UpJ7EFksK3UnlPaA=;
 b=ThvmnrmE6OIDjqrIUEq/n1iHJr0tebVlVLJCYY1gQ3+Wuk50kRagpd6wuSB80OhIj7AAW6MbD7nz1XYaqHZ/7ryfXg4X9qzYH8bLk18nXce4LR7NkiPQ6XXKpdUcvuvc5jvIvQ7D6fx4Gfx+8WIv81Rbkn+tsqxfdnoBjGuRwQlM83cEQJ4XYZhHPwBmr0ocjGPG6J2j16T4GrXQ3sBnrTrWZRFAWLuuEe70tSa+du4hmX7OziUlwZuLKlYXam6/Kaq7qerPmApuQZZSoNvk/fozfbUH277zr3vRLMBj2k+rUxD/FRdF7N0pmuVrZu3wc7zzCUuTEYqnh11DVXlU7Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=xnV1Oz20FfKAim9cI+eKjVqxL+7UpJ7EFksK3UnlPaA=;
 b=GIjCQPhPJwFa0gbuKTA0Sm0pEsfBMzfxhfIUpwZIhSIBRl0K1KF4My7yb8CcrYn0NF69D1kJDXrZivKnhVxNw2J9Lz5J83YOTZFVocxWxWEsYi4k+tzb1jH3wtmH7sPWhqHTgJTy0maLkyBzvxUIhIvWRjIILcaubD9pm0rXP00=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <60afd920-6fdb-5403-e096-57f86e4ed35e@amd.com>
Date: Wed, 5 Jul 2023 15:01:39 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 36/52] xen/mpu: implememt ioremap_xxx in MPU
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-37-Penny.Zheng@arm.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <20230626033443.2943270-37-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0192.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a4::17) To SN6PR12MB2621.namprd12.prod.outlook.com
 (2603:10b6:805:73::15)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN6PR12MB2621:EE_|MW4PR12MB5604:EE_
X-MS-Office365-Filtering-Correlation-Id: 381acf25-5b73-48b9-b3ac-08db7d605e55
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	fvyEJldpMY/NONDyGPdTLwQkoHKbfnkMLwo1ZHqZQHjCJZIv/kwMPx9CEwfo+BsoNMVplbxfNnIBVuUtDdxdEhFvfh5Z5FKXEM6EEQTZ6oZjsAHXEnJvEuBOGcjZX3o77k04tzq03GbUE71hmZjyJo+nvdKpT/eak3wYPPSEIe5NdeHDpIqwSfaNszUrXRr31Yj+eEpV58xdU0G25kNy29vxGDYb/YtQEyOFzVPT876T1MO/CGO4m0s+/lgN6bylQrWTGec3UdzTt2AHmx+nHupvrW9RtxQi4wB5FWyDtTh9i/FR309VonoSaI0vZTHQ0UNj5eVzTTB+J4qY4vbcEHaYsGEL1czQ7KToYff+VMacVOIEmr0gDTvALf5cQ46OB34UjrhG6wbbdRnr69VH2AuHmmeblgkzniCBCMuRco9e9DVsZu8nLvw2SfqXvdKvpCIgdrjsCODaauX3BwFxJJDHFB8aFkAwua3lphxsHc67X3q7xFmipQQlNGAAid1ke1oZKYU7kHzn8hjHqXjSAyuVHXjUG8YVilt/nmIV22eaOq36+iKykmwrmuxoNQ611CwPJE+7m7AZBAysiLtbAyi7bYeBomM05FQo5X8LtSfPUgkuGkXrqWD2cyweqgA/jEVdQb8pDLEzBlJ1q8PdjT8JUjpdMFn/QuiAj6yukM0=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2621.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(396003)(39860400002)(136003)(366004)(451199021)(2616005)(54906003)(6666004)(6512007)(6486002)(478600001)(53546011)(186003)(6506007)(26005)(2906002)(8936002)(5660300002)(41300700001)(8676002)(4326008)(66556008)(66476007)(316002)(66946007)(38100700002)(31696002)(36756003)(83380400001)(31686004)(66899021)(21314003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bTJINWdvRXQ1NU1sVG5QV0NtTFNQYUhMQW5xY2M3V2FidzRjR0QzQkY5MEtt?=
 =?utf-8?B?a2ZieTVGc0x3bTZzSE52RGZ1SkplaGJNTGVnK1hBV1ZSQk96emc1allrR0ZK?=
 =?utf-8?B?dFhqVkMrSUZKTjU1L3BVeENTZC95U0ppVDZhb1czUUkxSHY0TlphV1V2K3BD?=
 =?utf-8?B?ay9qZjJoWWZrek5JNTV5THltT0tPa3J6Nlc5Uk56UHFGWFd1bGYyMFhWSmEy?=
 =?utf-8?B?ekVmU1Q1U1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 =?utf-8?B?UWd3RndTUDdSSktYNGx5OGw4cWo1VjRVemJTaXF4dnVVaUNpdjRMMGZlTURM?=
 =?utf-8?B?VU8xRUxmS1FnZUNSbTZWSSs3VVppaHBqdzArenlLcDhMRHNuOEJVTzlsL3dz?=
 =?utf-8?Q?xRwhExJpmW0+Yn2p/7SzFJK03?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 381acf25-5b73-48b9-b3ac-08db7d605e55
X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2621.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 14:01:45.8421
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: mUdIq9W0MDOKnE3STecwM82MXIk0zF5iClXtp22gGmvN673wrtRHcvKSO+abA3VyTJ/U5G/ocsH3FhsrCxtgbA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB5604

Hi Penny,

On 26/06/2023 04:34, Penny Zheng wrote:
> CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
>
>
> A set of function ioremap_xxx are designed to map deivce memory or
> remap part of memory temporarily for short-time special purpose, like
> using ioremap_wc to temporarily remap guest kernel non-cacheable, for
> copying it to guest memory.
>
> As virtual translation is not supported in MPU, and we always follow the
> rule of "map in demand" in MPU, we implement MPU version of ioremap_xxx,
> through mapping the memory with a transient MPU memory region.
>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> ---
> v3:
> - adapt to the new rule of "map in demand"
> ---
>   xen/arch/arm/include/asm/arm64/mpu.h |   4 +
>   xen/arch/arm/include/asm/mm.h        |   6 +
>   xen/arch/arm/mpu/mm.c                | 185 +++++++++++++++++++++++++++
>   3 files changed, 195 insertions(+)
>
> diff --git a/xen/arch/arm/include/asm/arm64/mpu.h b/xen/arch/arm/include/asm/arm64/mpu.h
> index aee7947223..c5e69f239a 100644
> --- a/xen/arch/arm/include/asm/arm64/mpu.h
> +++ b/xen/arch/arm/include/asm/arm64/mpu.h
> @@ -121,6 +121,10 @@ static inline bool region_is_valid(pr_t *pr)
>       return pr->prlar.reg.en;
>   }
>
> +static inline bool region_is_transient(pr_t *pr)
> +{
> +    return pr->prlar.reg.tran;
> +}
>   #endif /* __ASSEMBLY__ */
>
>   #endif /* __ARM64_MPU_H__ */
> diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
> index cffbf8a595..0352182d99 100644
> --- a/xen/arch/arm/include/asm/mm.h
> +++ b/xen/arch/arm/include/asm/mm.h
> @@ -227,6 +227,7 @@ void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned int attributes);
>   extern int map_staticmem_pages_to_xen(paddr_t start, paddr_t end);
>   extern int unmap_staticmem_pages_to_xen(paddr_t start, paddr_t end);
>
> +#ifndef CONFIG_HAS_MPU
>   static inline void __iomem *ioremap_nocache(paddr_t start, size_t len)
>   {
>       return ioremap_attr(start, len, PAGE_HYPERVISOR_NOCACHE);
> @@ -241,6 +242,11 @@ static inline void __iomem *ioremap_wc(paddr_t start, size_t len)
>   {
>       return ioremap_attr(start, len, PAGE_HYPERVISOR_WC);
>   }
> +#else
> +extern void __iomem *ioremap_nocache(paddr_t start, size_t len);
> +extern void __iomem *ioremap_cache(paddr_t start, size_t len);
> +extern void __iomem *ioremap_wc(paddr_t start, size_t len);
> +#endif
>
>   /* XXX -- account for base */
>   #define mfn_valid(mfn)        ({                                              \
> diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
> index 9d5c1da39c..3bb1a5c7c4 100644
> --- a/xen/arch/arm/mpu/mm.c
> +++ b/xen/arch/arm/mpu/mm.c
> @@ -624,6 +624,191 @@ int __init unmap_staticmem_pages_to_xen(paddr_t start, paddr_t end)
>       return xen_mpumap_update(start, end, 0);
>   }
>
> +/*
> + * Check whether memory range [pa, pa + len) is mapped in Xen MPU
> + * memory mapping table xen_mpumap.
> + *
> + * If it is mapped, the associated index will be returned.
> + * If it is not mapped, INVALID_REGION_IDX will be returned.
> + */
> +static uint8_t is_mm_range_mapped(paddr_t pa, paddr_t len)
> +{
> +    int rc;
> +    uint8_t idx;
> +
> +    rc = mpumap_contain_region(xen_mpumap, max_xen_mpumap, pa, pa + len - 1,
> +                               &idx);
> +    if ( (rc == MPUMAP_REGION_FOUND) || (rc == MPUMAP_REGION_INCLUSIVE) )
> +        return idx;
> +
> +    if ( rc == MPUMAP_REGION_OVERLAP )
> +         panic("mpu: can not deal with overlapped MPU memory region\n");
> +    /* Not mapped */
> +    return INVALID_REGION_IDX;
> +}
> +
> +static bool is_mm_attr_match(pr_t *region, unsigned int attributes)
> +{
> +    if ( region->prbar.reg.ap != PAGE_AP_MASK(attributes) )
> +    {
> +        printk(XENLOG_WARNING "region permission is not matched (0x%x -> 0x%x)\n",
> +               region->prbar.reg.ap, PAGE_AP_MASK(attributes));
> +        return false;
> +    }
> +
> +    if ( region->prbar.reg.xn != PAGE_XN_MASK(attributes) )
> +    {
> +        printk(XENLOG_WARNING "region execution permission is not matched (0x%x -> 0x%x)\n",
> +               region->prbar.reg.xn, PAGE_XN_MASK(attributes));
> +        return false;
> +    }
> +
> +    if ( region->prlar.reg.ai != PAGE_AI_MASK(attributes) )
> +    {
> +        printk(XENLOG_WARNING "region memory attributes is not matched (0x%x -> 0x%x)\n",
> +               region->prlar.reg.ai, PAGE_AI_MASK(attributes));
> +        return false;
> +    }
> +
> +    return true;
> +}
> +
> +/*
> + * Check whether memory range [pa, pa + len) is mapped with memory
> + * attributes #attr in Xen MPU memory mapping table xen_mpumap.
> + *
> + * If it is mapped but with different memory attributes, Errno -EINVAL
> + * will be returned.
> + * If it is not mapped at all, Errno -ENOENT will be returned.
> + */
> +static int is_mm_range_mapped_with_attr(paddr_t pa, paddr_t len,
> +                                        unsigned int attr)
> +{
> +    uint8_t idx;
> +
> +    idx = is_mm_range_mapped(pa, len);
> +    if ( idx != INVALID_REGION_IDX )
> +    {
> +        pr_t *region;
> +
> +        region = &xen_mpumap[idx];
> +        if ( !is_mm_attr_match(region, attr) )
> +            return -EINVAL;
> +
> +        return 0;
> +    }
> +
> +    return -ENOENT;
> +}
> +
> +/*
> + * map_mm_range shall work with unmap_mm_range to map a chunk
> + * of memory with a transient MPU memory region for a period of short time.
> + */
> +static void *map_mm_range(paddr_t pa, size_t len, unsigned int attributes)
> +{
> +    if ( xen_mpumap_update(pa, pa + len, attributes | _PAGE_TRANSIENT) )
> +        printk(XENLOG_ERR "Failed to map_mm_range 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
> +               pa, pa + len);
Don't you want to return NULL or something from here ?
> +
> +    return maddr_to_virt(pa);
> +}
> +
> +static void unmap_mm_range(paddr_t pa)
> +{
> +    uint8_t idx;
> +
> +    /*
> +     * The mapping size in map_mm_range is at least PAGE_SIZE.
> +     * Find the MPU memory region mapped through map_mm_range, and associated
> +     * idx will be returned.
> +     */
> +    idx = is_mm_range_mapped(pa, PAGE_SIZE);
> +    if ( idx == INVALID_REGION_IDX )
> +    {
> +        printk(XENLOG_ERR "Failed to unmap_mm_range MPU memory region at 0x%"PRIpaddr"\n",
> +               pa);
> +        return;
> +    }
> +
> +    if ( !region_is_transient(&xen_mpumap[idx]) )
> +    {
> +        printk(XENLOG_WARNING "Failed to unmap MPU memory region at 0x%"PRIpaddr"\n, as it is not transient\n",
> +               pa);
> +        return;
> +    }

Does this mean you only allow unmapping of transient memory ?

So, is the non transient memory always expected to be mapped throughout 
the lifetime of the system ?

> +
> +    /* Disable MPU memory region and clear the according entry in xen_mpumap */
> +    control_mpu_region_from_index(idx, false);
> +}
> +
> +/*
> + * It works with "iounmap" as a pair to temporarily map a chunk of memory
> + * with a transient MPU memory region, for short-time special accessing.
> + */
> +void *ioremap_attr(paddr_t pa, size_t len, unsigned int attributes)
> +{
> +    return map_mm_range(round_pgdown(pa), round_pgup(len), attributes);
> +}
> +
> +/* ioremap_nocache is normally used to map device memory */
> +void __iomem *ioremap_nocache(paddr_t start, size_t len)
> +{
> +    int rc;

For this function and others (ioremap_xxx()), don't we need to check if 
the memory is transient ?

- Ayan

> +
> +    /* Check whether it is already mapped as device memory */
> +    rc = is_mm_range_mapped_with_attr(start, len, PAGE_HYPERVISOR_NOCACHE);
> +    if ( rc == -ENOENT )
> +        return ioremap_attr(start, len, PAGE_HYPERVISOR_NOCACHE);
> +    else if ( rc != 0 )
> +        return NULL;
> +
> +    /* Already mapped */
> +    return maddr_to_virt(start);
> +}
> +
> +/*
> + * ioremap_cache which is working with iounmap as a pair, is normally used to
> + * map a chunck of cacheable memory temporarily for short-time special purpose.
> + */
> +void __iomem *ioremap_cache(paddr_t start, size_t len)
> +{
> +    int rc;
> +
> +    rc = is_mm_range_mapped_with_attr(start, len, PAGE_HYPERVISOR);
> +    if ( rc == -ENOENT )
> +        return ioremap_attr(start, len, PAGE_HYPERVISOR);
> +    else if ( rc != 0 )
> +        return NULL;
> +
> +    /* Already mapped */
> +    return maddr_to_virt(start);
> +}
> +
> +/*
> + * ioremap_wc which is working with iounmap as a pair, is normally used to
> + * map a chunck of non-cacheable memory temporarily for short-time special
> + * purpose.
> + */
> +void __iomem *ioremap_wc(paddr_t start, size_t len)
> +{
> +    int rc;
> +
> +    rc = is_mm_range_mapped_with_attr(start, len, PAGE_HYPERVISOR_WC);
> +    if ( rc == -ENOENT )
> +        ioremap_attr(start, len, PAGE_HYPERVISOR_WC);
> +    else if ( rc != 0 )
> +        return NULL;
> +
> +    /* Already mapped */
> +    return maddr_to_virt(start);
> +}
> +
> +void iounmap(void __iomem *va)
> +{
> +    unmap_mm_range(virt_to_maddr(va));
> +}
> +
>   /*
>    * Local variables:
>    * mode: C
> --
> 2.25.1
>
>


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 14:03:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 14:03:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559211.873994 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH36D-0008Lv-1m; Wed, 05 Jul 2023 14:03:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559211.873994; Wed, 05 Jul 2023 14:03:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH36C-0008Lo-VR; Wed, 05 Jul 2023 14:03:16 +0000
Received: by outflank-mailman (input) for mailman id 559211;
 Wed, 05 Jul 2023 14:03:15 +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
 <SRS0=Ax/R=CX=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qH36B-0008Lg-DC
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 14:03:15 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ae3572a6-1b3c-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 16:03:13 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-98e39784a85so148223966b.1
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 07:03:13 -0700 (PDT)
Received: from EMEAENGAAD19049. (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 v14-20020a1709060b4e00b0099251942e1esm9935798ejg.119.2023.07.05.07.03.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 07:03:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ae3572a6-1b3c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1688565792; x=1691157792;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=DA7AHs1dJvA/14EguUz/rtIog8Dju2MFE10F3aRW5a8=;
        b=R7Zwn1cyOLR0TcnME0GGSk4oQXZ7S00LfiB9ZP8l0kHhwy5Hf9fLEaVlHNQOSsAapC
         QAMQhVgwjjeV0s+slZI0msN0JDkS1Q2yTr3DKwH0ZcAysOwkPZWmZ4/Y990tTWk6hw6G
         MUZTTAuNnfD8yC1LwGfiCHSZ9QF1fh6JFIYb8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688565792; x=1691157792;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=DA7AHs1dJvA/14EguUz/rtIog8Dju2MFE10F3aRW5a8=;
        b=BL5m3gZBH4fHV7FALUIhB04jT5xwy940ltOLSCOXWOGKnOSWbOIojXlpMYbOL7d5j+
         H3hOtCEwrTR/WsVOSk1oQ2pn9ysYeYkpjI/5JQ3tA9yjK7tPLQ2HRRrsvJjfC7oVou3/
         UGeJmmttEGr5gPcyXrOavfR2hSQrSKtH9wmShmAqFvB2SkFPjSYwrGzoAA0dU5C4aJ7L
         NFw6EM6xiaVEtpLHWg6kRMz+/QsGORqGKPeBXn33PQeI/vXU+x6NgoXPzkA3PsUoA4E9
         imxbzh3fqYIaz6kCDh99pd1qo6df5eQsc0WMA1Ckz5AeaucnqO1gewdLMN9irefby3Yh
         4yXg==
X-Gm-Message-State: ABy/qLbkCKjlKsmVKO43+wOZEwEy0H5w4NYqt9SzG9Wf1ENb8NbRXLV1
	QySsAN0l42sRT/uHj4M8DKb3Tg==
X-Google-Smtp-Source: APBJJlFSpjh75liyaGGvF+FrIgeusClIu6o8PMInTWkR8lvij3xq0E48oSB9AlFfW1HLxJ9BPuwOQA==
X-Received: by 2002:a17:906:72c9:b0:992:ef60:aadd with SMTP id m9-20020a17090672c900b00992ef60aaddmr2183752ejl.13.1688565792671;
        Wed, 05 Jul 2023 07:03:12 -0700 (PDT)
Message-ID: <64a57820.170a0220.9a035.9a30@mx.google.com>
X-Google-Original-Message-ID: <ZKV4H/kTz/txlzOT@EMEAENGAAD19049.>
Date: Wed, 5 Jul 2023 15:03:11 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v5 4/4] x86/microcode: Disable microcode update handler
 if DIS_MCU_UPDATE is set
References: <20230629152656.12655-1-alejandro.vallejo@cloud.com>
 <20230629152656.12655-5-alejandro.vallejo@cloud.com>
 <1c9fe38e-d8aa-21fb-8dbe-4c54385b5a67@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1c9fe38e-d8aa-21fb-8dbe-4c54385b5a67@suse.com>

On Wed, Jul 05, 2023 at 12:51:47PM +0200, Jan Beulich wrote:
> > --- a/xen/arch/x86/cpu/microcode/intel.c
> > +++ b/xen/arch/x86/cpu/microcode/intel.c
> > @@ -385,6 +385,19 @@ static struct microcode_patch *cf_check cpu_request_microcode(
> >      return patch;
> >  }
> >  
> > +bool __init intel_can_load_microcode(void)
> > +{
> > +    uint64_t mcu_ctrl;
> > +
> > +    if ( !cpu_has_mcu_ctrl )
> > +        return true;
> > +
> > +    rdmsrl(MSR_MCU_CONTROL, mcu_ctrl);
> 
> While one would hope that feature bit and MSR access working come in
> matched pairs, I still wonder whether - just to be on the safe side -
> the caller wouldn't better avoid calling here when rev == ~0 (and
> hence we won't try to load ucode anyway). I would envision can_load's
> initializer to become this_cpu(cpu_sig).rev != ~0, with other logic
> adjusted as necessary in early_microcode_init().
> 
> Jan
We only know about the ucode revision after the collect_cpu_info() call,
and we can only make that call after the vendor-specific section that sets
the function pointers up (and calls intel_can_load_microcode()).

One could imagine turning can_load into a function pointer so that its
execution is deferred until after the revision check (and skipped
altogether if `rev==~0`).

Alejandro


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 14:07:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 14:07:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559216.874015 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH39o-0000nA-P4; Wed, 05 Jul 2023 14:07:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559216.874015; Wed, 05 Jul 2023 14:07:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH39o-0000n3-Ln; Wed, 05 Jul 2023 14:07:00 +0000
Received: by outflank-mailman (input) for mailman id 559216;
 Wed, 05 Jul 2023 14:06:59 +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 <SRS0=rv0Z=CX=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qH39n-0000YA-4M
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 14:06:59 +0000
Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com
 [2a00:1450:4864:20::12e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 33cfda8d-1b3d-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 16:06:57 +0200 (CEST)
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-4fba8f2197bso7587690e87.3
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 07:06:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 33cfda8d-1b3d-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1688566016; x=1691158016;
        h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
         :date:message-id:reply-to;
        bh=dnWhl+MIwE58CJEf3W/jqi5kFqSUl9OafZbr+bDDPvc=;
        b=W3r9wcn+cAMjV5yYdiWTWvABqC4XLzj1drHGLvaArHUAIq12+gGB9/RPVvmzHXSQ+t
         Q2eper1wxnpiIrUf9b37RQHTWm8FLvvXH8KFfkZhTZdpWIHXxsApWgBuv6VxBd1U41zA
         bLbBl5muR86c6Jn/CtFMliyrmUUQaksp80XgQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688566016; x=1691158016;
        h=to:subject:message-id:date:from:mime-version:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=dnWhl+MIwE58CJEf3W/jqi5kFqSUl9OafZbr+bDDPvc=;
        b=ilTuSvmn7097pbgRFS9dh7z/lzXDOA4J5UYpDwp8WO+lYLKdr0K9UipAPo62Uqmxzt
         V5nVTQ+tCEiqap5mgj4nSbV0sUQ6LHX03iQdJ8HL+7fFxj0hQx1xJ1lpOATInMozXVs0
         A7V0pFg29HZB2x6+4Y1AcAFdVlnUlH+PR+oPRSAh/prxa3dVQqXQ4z+lxr662BR8GPYj
         ayQG80B2jKCOiF7e0riEfoEyOahzVrck4goBgf+KH2JKLQnMWTFGNuGBRKfeYgPPg+WX
         YOdDlZwWdB9ihIEaVyb7SCVyeSJARxXSs/RCf3AF0FxFXpBgkpb4if1NI2HcKs82qlgN
         xVuA==
X-Gm-Message-State: ABy/qLZ0obbgsmn3I5uxPDWpYChh2SmekcOxZeI9BnSi4Yx08xxtgvLt
	zbkX5BS+MJgCCkS3izJ2L7W2NQ+6rslBX5unHcCFrR+oFxOsVm4IgDM=
X-Google-Smtp-Source: APBJJlHSJhzd1AKgv4k5v/k1N5ze4DbrOnFKQsKqhuAdaVEB6SH1qauphMd4UeKAe7atp3zgLQ+Rvn9gDFF3JIJF3o0=
X-Received: by 2002:a19:7418:0:b0:4f9:5d2a:e0f6 with SMTP id
 v24-20020a197418000000b004f95d2ae0f6mr10781156lfe.14.1688566016329; Wed, 05
 Jul 2023 07:06:56 -0700 (PDT)
MIME-Version: 1.0
From: George Dunlap <george.dunlap@cloud.com>
Date: Wed, 5 Jul 2023 15:06:45 +0100
Message-ID: <CA+zSX=bCxc4P+FZujuVG5zfLC5ZLXTncU-auV-u2ZYJ5URb40Q@mail.gmail.com>
Subject: NO COMMUNITY CALL for July
To: Xen-devel <xen-devel@lists.xenproject.org>, 
	Tamas K Lengyel <tamas.k.lengyel@gmail.com>, "intel-xen@intel.com" <intel-xen@intel.com>, 
	"daniel.kiper@oracle.com" <daniel.kiper@oracle.com>, Roger Pau Monne <roger.pau@citrix.com>, 
	Sergey Dyasli <sergey.dyasli@citrix.com>, 
	Christopher Clark <christopher.w.clark@gmail.com>, Rich Persaud <persaur@gmail.com>, 
	Kevin Pearson <kevin.pearson@ortmanconsulting.com>, Juergen Gross <jgross@suse.com>, 
	Paul Durrant <pdurrant@amazon.com>, "Ji, John" <john.ji@intel.com>, 
	"edgar.iglesias@xilinx.com" <edgar.iglesias@xilinx.com>, 
	"robin.randhawa@arm.com" <robin.randhawa@arm.com>, Artem Mygaiev <Artem_Mygaiev@epam.com>, 
	Matt Spencer <Matt.Spencer@arm.com>, Stewart Hildebrand <Stewart.Hildebrand@amd.com>, 
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>, Jeff Kubascik <Jeff.Kubascik@dornerworks.com>, 
	Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
	Rian Quinn <rianquinn@gmail.com>, "Daniel P. Smith" <dpsmith@apertussolutions.com>, 
	=?UTF-8?B?4oCL4oCL4oCL4oCL4oCL4oCL4oCLRG91ZyBHb2xkc3RlaW4=?= <cardoe@cardoe.com>, 
	George Dunlap <george.dunlap@citrix.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	=?UTF-8?B?4oCL4oCL4oCL4oCL4oCL4oCL4oCLQW1pdCBTaGFo?= <amit@infradead.org>, 
	=?UTF-8?B?4oCL4oCL4oCL4oCL4oCL4oCL4oCLVmFyYWQgR2F1dGFt?= <varadgautam@gmail.com>, 
	Brian Woods <brian.woods@xilinx.com>, Robert Townley <rob.townley@gmail.com>, 
	Bobby Eshleman <bobby.eshleman@gmail.com>, 
	=?UTF-8?B?4oCL4oCL4oCL4oCL4oCL4oCL4oCLQ29yZXkgTWlueWFyZA==?= <cminyard@mvista.com>, 
	Olivier Lambert <olivier.lambert@vates.fr>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	Ash Wilding <ash.j.wilding@gmail.com>, Rahul Singh <Rahul.Singh@arm.com>, 
	=?UTF-8?Q?Piotr_Kr=C3=B3l?= <piotr.krol@3mdeb.com>, 
	Brendan Kerrigan <brendank310@gmail.com>, Thierry Laurion <insurgo@riseup.net>, 
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, Scott Davis <scottwd@gmail.com>, 
	Anthony PERARD <anthony.perard@citrix.com>, Michal Orzel <michal.orzel@amd.com>, 
	Marc Ungeschikts <marc.ungeschikts@vates.fr>, Zhiming Shen <zshen@exotanium.io>, 
	Xenia Ragiadakou <burzalodowa@gmail.com>, 
	=?UTF-8?B?4oCL4oCL4oCL4oCL4oCL4oCL4oCLSGVucnkgV2FuZw==?= <Henry.Wang@arm.com>, 
	Per Bilse <per.bilse@citrix.com>, Samuel Verschelde <stormi-xcp@ylix.fr>, 
	Andrei Semenov <andrei.semenov@vates.fr>, Yann Dirson <yann.dirson@vates.fr>, 
	Bernhard Kaindl <bernhard.kaindl@cloud.com>, 
	=?UTF-8?B?4oCL4oCL4oCL4oCL4oCL4oCL4oCLTHVjYSBGYW5jZWxsdQ==?= <luca.fancellu@arm.com>, 
	=?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>, 
	Vikram Garhwal <vikram.garhwal@amd.com>
Content-Type: multipart/alternative; boundary="000000000000956e7b05ffbde94a"

--000000000000956e7b05ffbde94a
Content-Type: text/plain; charset="UTF-8"

Hey all,

Just a reminder, given that we just had the Xen Summit last week, that
there will be no community call this month.  See you next month.

 -George Dunlap

--000000000000956e7b05ffbde94a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hey all,<div><br></div><div>Just a reminder, given that we=
 just had the Xen Summit last week, that there will be no community call th=
is month.=C2=A0 See you next month.</div><div><br></div><div>=C2=A0-George =
Dunlap</div></div>

--000000000000956e7b05ffbde94a--


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 14:07:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 14:07:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559215.874005 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH39n-0000YN-HM; Wed, 05 Jul 2023 14:06:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559215.874005; Wed, 05 Jul 2023 14:06:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH39n-0000YG-EI; Wed, 05 Jul 2023 14:06:59 +0000
Received: by outflank-mailman (input) for mailman id 559215;
 Wed, 05 Jul 2023 14:06:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qH39l-0000Y4-Uo
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 14:06:57 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH39k-0001E2-FO; Wed, 05 Jul 2023 14:06:56 +0000
Received: from 54-240-197-239.amazon.com ([54.240.197.239]
 helo=[192.168.19.213]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH39k-0002Ma-8N; Wed, 05 Jul 2023 14:06:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=cTwsWwAkHS+cxxxtYxFE3djYhwdllEQ8vBVDtI5URuU=; b=idvWPzM7yjBZvVf/WndgvzaTZ0
	7cvSvFNMyQJQLVqnTE9l7G/M3mBvKar9y3Sf/0Ug2woLZiiTSOsA1xdlj1W7y5A8oWqceB8zodhx1
	rb8HCKou6VQ+FUoObO9UzQzals7VJzmtd4JWKXi1IxJ6asUOnkPXta0f3x5Iu68n+2O0=;
Message-ID: <e9822dae-54b2-ee0c-b626-ea601723e3f8@xen.org>
Date: Wed, 5 Jul 2023 15:06:53 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 0/3] xen/types: Cleanup
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Jan Beulich <JBeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Timothy Pearson <tpearson@raptorengineering.com>
References: <20230627075618.1180248-1-andrew.cooper3@citrix.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230627075618.1180248-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 27/06/2023 08:56, Andrew Cooper wrote:
> v2, adjusted per the discussion at XenSummit
> 
> https://cirrus-ci.com/build/6611877547999232
> https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/912782128
> 
> Andrew Cooper (3):
>    xen/types: Drop #ifdefary for __{SIZE,PTRDIFF}_TYPE__
>    treewide: Avoid including asm/types.h
>    xen/types: Rework stdint vs __{u,s}$N types

For the series (including v2.5):

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 14:14:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 14:14:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559223.874024 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3H2-0002Yr-Gv; Wed, 05 Jul 2023 14:14:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559223.874024; Wed, 05 Jul 2023 14:14:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3H2-0002Yk-Dv; Wed, 05 Jul 2023 14:14:28 +0000
Received: by outflank-mailman (input) for mailman id 559223;
 Wed, 05 Jul 2023 14:14:27 +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
 <SRS0=asTv=CX=citrix.com=prvs=543a7ddba=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qH3H1-0002Ye-8V
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 14:14:27 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3dbb1328-1b3e-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 16:14:24 +0200 (CEST)
Received: from mail-mw2nam10lp2106.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.106])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 05 Jul 2023 10:14:11 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by MW4PR03MB6364.namprd03.prod.outlook.com (2603:10b6:303:11f::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 14:14:04 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606%4]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023
 14:14:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3dbb1328-1b3e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688566464;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=JvLzSDUGnmKIeeI6Mb+yCtQWowOLtKjTeLJC4kdP4yc=;
  b=Bgjh+TGmT5TN8pBrn+hz1vYRlaRqEzspgvI57J6Fn9yk4/N3L/i/Iti/
   8R+WXs6jSfWrXV5SOP0IWepJvfTIJPvGUuz+KVLd3/iTaht7MpElDEWjx
   uui3lzc+xqH33eoVrHJnTMaku8Hh4r27VOEVUV8cc9HVCXTf4hHKNsq4W
   0=;
X-IronPort-RemoteIP: 104.47.55.106
X-IronPort-MID: 113951527
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:8xVbRKnxlyy0R4K/WdVt7FXo5gxBJ0RdPkR7XQ2eYbSJt1+Wr1Gzt
 xJJD26COayNamegeowkbYuy800P657Wx9NlSgpqpHgyEyMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5AKGzRH5MbpETU2PByqgKmVrNrbSq
 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/
 f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3
 eU4cTYkbgiEvt+dxq2lUvQ3meEELOC+aevzulk4pd3YJdAPZMmbBoD1v5pf1jp2gd1SF/HDY
 cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVkVE3ieCzWDbWUoXiqcF9t0CUv
 G/ZuU/+BQkXLoe3wjuZ6HO8wOTImEsXXapLTebpq6c32gL7Kmo7OF4ubVK6rNKCrG2HRu0AC
 UgoxDYRlP1nnKCsZpynN/Gim1aNuhMeUtxcCep89giJzqfW5C6SAm8ZQnhKb9lOnN87Q3km2
 0GEm/vtBCdzq/uFRHSF7LCWoDiufy8PIgcqZyUJUA8E6NnLu5wog1TESdMLOLGxps34H3f32
 T/ikcQlr7AajMpO0rrh+1nC2mqovsKQFlBz4RjLVGW46A8/fJSie4Gj9Vnc67BHMZqdSV6C+
 nMDnqBy8dwzMH1ErwTVKM1lIV1jz6/t3OH06bK3I6Qcyg==
IronPort-HdrOrdr: A9a23:OifEKarXwMpylJ2vuMg9PTUaV5pIeYIsimQD101hICG9E/b5qy
 nKpp8mPHDP5Qr5NEtLpTniAsi9qA3nmqKdiLN5VYtKNzOLhILHFu9f0bc=
X-Talos-CUID: =?us-ascii?q?9a23=3AEo3XmGsjDTpR0Uckhv0sNx+76Is8UiTb5XfIJHa?=
 =?us-ascii?q?FImB2VqWIEkC136NNxp8=3D?=
X-Talos-MUID: 9a23:T0mkFAQdWXPC193MRXTcxwlaPcZlyJ+IK3kQrsokv/W6KRNJbmI=
X-IronPort-AV: E=Sophos;i="6.01,183,1684814400"; 
   d="scan'208";a="113951527"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=HRunkEK7i/UhzP5n2OI8DxC71Fck9neVE+weqCxHj+nYd1dj0yiNO5dbY/QqqasIbAeZmN3taXOVAOz/zibrKgrbKAiiDLv4jg7VpB4TDXZ3FnZpLwc5fI02rhKGEx1pSxhxlEWt4AkS0sM11/Hi6kC1zkveI7Zbw3Tehhc3FoLcO9uwuISgWhqorEE7jL36zOJrpDOqt6RKwRwjsXo5m5ZxJ0TfWvBISetXpVMYbdStYNYrqrV0cd80V3UvZYYo1uhLI62sH7GEJxpRJJPawKuaDfQ05zMZIStjasu5s7obq1M/fel1rGbKfyJkrxZghcwOVSv+SV3UK4G7/GQpnA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=kZheg9kcAvUSpKIAiMkLuHXH3CvT5QsCXu7xch1Jf60=;
 b=MUwIhoGpNoQIYtR15Lte2Die1GraY6zLSVDqvhctDEd0HZWauP+fz7aqyNOUPYmVGK3Ct0T1yfJMn+AX+06ujlAK27xnhqhUKh+D2qVkO8HiP1wLIbzAybfIg0DUQg6JftJzzLNiXDHsHgRJFdQnHywIF4OABi1o2NHiEalWiIn7UrkrQgvPS3jurI/4V/sNwqy+WUmVXsfhnYpVHTD9Cg5JupF4sJb0RZRMyuGq1fLZm6Zm2aO4NvnZXjDyGM+q/Fd2sPIQ7C+hM/2ovNvykt5E/2zh1Py890eS87xO79aICsLKBBE0KmfoP8WaligyzSGePY6fGffzXDnN7N/+Qw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=kZheg9kcAvUSpKIAiMkLuHXH3CvT5QsCXu7xch1Jf60=;
 b=khXE9aD82LTDB8+7C4idqT4mTQlScL7fOZcpU9bdel8xGMcXeCZ8yb2M5/R60FP3QSRImdrDFgEkDTEaH0ygMxg77yBF48goAixQQKb4yW88ebQZ8Nu5vzwSZ0yXshK/J5WKTq2ei1zYL7rVMChvssCdp0VMS0QXunDSIvr3Ios=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <d498ba69-564d-8232-5f5b-da52050772d8@citrix.com>
Date: Wed, 5 Jul 2023 15:13:58 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v5 2/4] x86/microcode: Ignore microcode loading interface
 for revision = -1
Content-Language: en-GB
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Jan Beulich <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>
References: <20230629152656.12655-1-alejandro.vallejo@cloud.com>
 <20230629152656.12655-3-alejandro.vallejo@cloud.com>
In-Reply-To: <20230629152656.12655-3-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0597.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:295::14) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|MW4PR03MB6364:EE_
X-MS-Office365-Filtering-Correlation-Id: 19028cd6-4363-42bf-e8dd-08db7d621639
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	G5Lg/W4Qz1Mn0wD64Pn5GKX6kn10u4r9op9oNks7clXvsQK8m18mdd1c039Yr6WRlM5deMOTzikIviNNlG3u5N9+nRkWqhmNC/TwjGK20UIjdibPl2B6TuXjvIsINNi7WsALlReEmlEC5ZU/yxuaaXdTA8/6fn9JjCf8J8yUMUSYk6Zbet7pRvu/ZBIoFyGuQlLPjgcFFi/rhpw5CLyYYq87HPt8Za0cGo/k43m9kWl/g5ZBi8ZBwGz6zztpdKyBx5wDwYBM2eGygVAOdiEpANYlxxiIGNXngAR5r+PkZkM7gIAaHomJ8hUfynv/O6O0z9fSa5PuPaLql8nIRElE1J7tqdC8DAbP8aptNrmhXrk9JMpk7IUZXCFvrhukNIBU+I8UT/YKBg5ztD4hB8x3jCyxcikuJ/+Sd2eVL/TCdZWcUvll8npYKVtfHPaDyxGAg3qkYAYX4+DdrxHFrMBQc+YloQsg0uH9gcNOeS8t16GhNjmSiogKtrM/pxnJQeEd785OJwQkEEnPH6Vxho0z0k/T5kipcJSueQB2/92vXSm2WBFhXaegj6H0JUX2OYKLwbQBzkz2+N5ERsB4K9HfsUyWn9iFZQ/ivTv0oHJxu4ZU9bjHL60bocDUblrLsxkynrXqbnhID6VTY4qxj9Iizw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(366004)(136003)(39860400002)(376002)(451199021)(186003)(38100700002)(2616005)(82960400001)(53546011)(31696002)(26005)(6506007)(83380400001)(41300700001)(5660300002)(8936002)(8676002)(6486002)(86362001)(36756003)(4326008)(2906002)(66946007)(6512007)(6666004)(478600001)(316002)(110136005)(54906003)(66476007)(66556008)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bGtETnhUdnZwSldEVGRPZ0xiYytZakRJN0N1Sm5wOG84VGFZb0ltTXJ0WGFu?=
 =?utf-8?B?S1o3bE1lVk9TYUxrWE95d05hTkFuU0FWMDhRcFUxVTlON0dwZFFaR1F2bG5T?=
 =?utf-8?B?bnh1ODFzUy9aVXlqemp3bHY3TXBSckZzNjUwZEpwZ2ViOTNnYzZHV1ptY2Nm?=
 =?utf-8?B?RjdRQnJvWHk4eGxvQk53ZGhVRUFyWUVYeTF1d201am9xRmVza3hZN2UrN2lF?=
 =?utf-8?B?bzRZNFNzZ0d2cFNQM3FHMTQ2SUpvMW1teG9wZHpmMTkyTUJkdkdzRjdwUlFa?=
 =?utf-8?B?UmtkMlFQZ3o0K01zTWVQdUlBNFdzbmMrRnpqdjVlK1Mwei9KOVZ6U0JLWEtp?=
 =?utf-8?B?bGlrUHBNV3EyMkxOOWxvU2dNR2xvUC9TeTczQ1dHK0lxSmhvTXp3Qk8xalZq?=
 =?utf-8?B?Rk03ZmZKaUhWeFdOcXJlcTRUdU9qeTZ6Ump2cmJoeGdjN3RHNlc2dDdNSXpE?=
 =?utf-8?B?MmFvNUNVZHRSMTdEZmcyNzhRQzlRamJVazNOai92eEJNREdtdWRPZTducWJS?=
 =?utf-8?B?d2lEQ2FFL2ZMODhDMXBvWFQxUDcySmVGSW45enZGbG95UjRrT0tFSDdUck9K?=
 =?utf-8?B?dWFiZEsyY0szeUFRMFhoRWJ6ZFA4eStQWEV4Wlh4L2tEN3MrdzBTZm9nNFk1?=
 =?utf-8?B?cHFJTGxSYTBORHpGTnpPTkhJaFpUbmpRUHpUak8wZU5VQWVFQXFjRGVWTUli?=
 =?utf-8?B?dVo5UW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fGG7/IHhu6ennSYms5ftD20CKD4aYST14n4QF2mkphrd06fyNOZuwEQaBigS4lfXo5FVBOOtJwR4JHBemy6jWdhgr8w6ZjKK4ytyKfHoo5Qo9i4uHnCbceJDJsgElOYQN3vGVGwR/VwPXlU90ANMT3OGyHH5PQ+u2TJlneXFNhR5XEZz1NvhAKbE03xnqOuSCoQUM/c7pqbLlpcXAKeUMGRFFsmHaW7LAB72XlchZs8KTCm3/vGKqMweStdn9vdguirEFlSS1+QJMepQnYVWxCfwLzV7/XAYBMuUnAVIrGRJ8Q3lgn2oCrdoO1pPg3PJA193WVgxA+091lWVwl+t7uM52kU1/DahyWNK8BNm2iPqL6kOjAzWTHFNhG0djRYOjG6FufUwifnuh58f9loANjTnO9PdlNDNPw5ONYR7TFizn3Xypkv4SHkb3n1leCR18DuK9bPVKd/6jkOcq7ikL4YhrDAj7Sxy5CR6j2lbP4zOPmeFheK1lrhK5rouN5QLdIoM2AVl8MdHnh9fEn8UBjFsGIJCunk57sxC/zNR/fJ+YsSnFx4BCUQzOcnZYxR/gs4oFkn2Y0=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 19028cd6-4363-42bf-e8dd-08db7d621639
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 14:14:03.8980
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 7PZgFnvcFRIAPbbx6B2Rh9NtyOWQsEehda14xdFl1k/ljKU7Htr+JhEJH4b9RrIandn0xA9Zhd1lHu6mNE8JJxCGU9Nb9VQ09lhog6GLyWo=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR03MB6364

On 29/06/2023 4:26 pm, Alejandro Vallejo wrote:
> diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
> index bec8b55db2..b620e3bfa6 100644
> --- a/xen/arch/x86/cpu/microcode/core.c
> +++ b/xen/arch/x86/cpu/microcode/core.c
> @@ -867,10 +867,22 @@ int __init early_microcode_init(unsigned long *module_map,
>          return -ENODEV;
>      }
>  
> -    microcode_grab_module(module_map, mbi);
> -
>      ucode_ops.collect_cpu_info();
>  
> +    /*
> +     * Some hypervisors deliberately report a microcode revision of -1 to
> +     * mean that they will not accept microcode updates. We take the hint
> +     * and ignore the microcode interface in that case.
> +     */
> +    if ( this_cpu(cpu_sig).rev == ~0 )
> +    {
> +        printk(XENLOG_WARNING "Microcode loading disabled\n");

XENLOG_INFO "Found microcode revision ~0;Â  Disabling loading because of
virt\n"

It's normal (and not a warning) when running under other hypervisors,
and just "loading disabled" is too little information.

Happy to fix on commit.Â  Everything else looks ok.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 14:16:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 14:16:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559227.874035 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3Iv-00037n-Sl; Wed, 05 Jul 2023 14:16:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559227.874035; Wed, 05 Jul 2023 14:16:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3Iv-00037g-Pq; Wed, 05 Jul 2023 14:16:25 +0000
Received: by outflank-mailman (input) for mailman id 559227;
 Wed, 05 Jul 2023 14:16:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qH3Iu-00037W-Rn; Wed, 05 Jul 2023 14:16:24 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qH3Iu-0001Xx-L2; Wed, 05 Jul 2023 14:16:24 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qH3It-0005cH-Mc; Wed, 05 Jul 2023 14:16:23 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qH3It-0002ZX-Kq; Wed, 05 Jul 2023 14:16:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=l3+4ZG2YXelD1nL1K0wR23EL1O0A0yBW4zTtBCwxxP4=; b=KnXYXpzgQFt2IrTIJz3brMDR7i
	PxlnejACRXRWSHKApHVv+85sihirVe8D4tR50bratkawrDHgPbBVuFgmsdYMSMCA8o5OjqdZZAvis
	KOyYk7opIknbChpDLtKVsuPM2r5MtHI577gni+CyFDQi4dnyi0fcz/TMVd4P0feRll5s=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181700-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181700: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pygrub:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:xen-boot:fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:debian-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:leak-check/basis/src_host(18):fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:leak-check/basis/dst_host(19):fail:regression
    linux-linus:test-arm64-arm64-xl:guest-stop:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:windows-install:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:xen-boot:fail:allowable
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=d528014517f2b0531862c02865b9d4c908019dc4
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 05 Jul 2023 14:16:23 +0000

flight 181700 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181700/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-pygrub       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu  8 xen-boot                fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl           8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2 11 leak-check/basis(11)   fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd 11 leak-check/basis(11)    fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd  8 xen-boot            fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-libvirt     12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2  12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow   12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 18 leak-check/basis/src_host(18) fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 19 leak-check/basis/dst_host(19) fail REGR. vs. 180278
 test-arm64-arm64-xl          17 guest-stop               fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 12 windows-install  fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds      8 xen-boot                 fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                d528014517f2b0531862c02865b9d4c908019dc4
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   79 days
Failing since        180281  2023-04-17 06:24:36 Z   79 days  155 attempts
Testing same since   181700  2023-07-05 02:59:54 Z    0 days    1 attempts

------------------------------------------------------------
3658 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          fail    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 599534 lines long.)


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 14:21:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 14:21:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559236.874044 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3Nl-0004fY-Ia; Wed, 05 Jul 2023 14:21:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559236.874044; Wed, 05 Jul 2023 14:21:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3Nl-0004fR-Fn; Wed, 05 Jul 2023 14:21:25 +0000
Received: by outflank-mailman (input) for mailman id 559236;
 Wed, 05 Jul 2023 14:21:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gl5h=CX=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qH3Nk-0004fL-49
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 14:21:24 +0000
Received: from NAM04-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam04on20602.outbound.protection.outlook.com
 [2a01:111:f400:7e8b::602])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 36de9213-1b3f-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 16:21:22 +0200 (CEST)
Received: from SN6PR12MB2621.namprd12.prod.outlook.com (2603:10b6:805:73::15)
 by SA1PR12MB7248.namprd12.prod.outlook.com (2603:10b6:806:2be::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 14:21:17 +0000
Received: from SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54]) by SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54%2]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 14:21:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 36de9213-1b3f-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=AWD8LeanzrwJb0RRV/KXsDfaajhdQMLhbZMUt5smOEcoeQ/RCS5Nlzq3gR3JH+LrB+BaD5M6XdtG0O9VKDzoFFP7B3K+5TsU2USQWD2x6lnOEJLAaxL+dgr66oQFN6rwRBozVrbSEl6xuXze5cet0Ol23rcVTiEy7HjJtj4JiRv0gCkgBqcBczGVwsfJEkRWAgq7oh3MFwZwNj/uyxHCra2cf1qxf7E7tO1NxZbLd+2ACwxj9aTUMcOG2DyHPYLHq9ZkTS9JzkMBkGQeSGbWSTvQdqHxB90xw+BbWYOq6D2iQv24gexuXbsJgGmbE8iHqRFNpxSW3IlPkcqWZp3Yug==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=lvFvdJIGeOI7z9GBRSz7Y5eAvlGkW/B+cgC1jVH4bP8=;
 b=StDP1ikhiL7KbXNtoBLyR7ETrG3PLLQpr5xBeEGWwNox9t1PqqPX4OGpoWztMRuNW4hl3XRoCrW7fUOxxkOEqsGNj7vt9BtiBERz2LNpQx5BgdK78JS7yzcqHmjrYW5mWFSVtiKrZbU3IXXn+oqcQL6pVAfSP1BkfWwHyEk+vPqiF7Dp+YRJfoBKua7yPdM45uIxhN3BYA9FrCp3p19dn86rrec+K9gOTmpsZvWdiMbX4k7JzmDlCKVzGfX7A5SVEVvfuqYW8qdoHs2xjtk2HP3izMO5HmRXp/TrEdPWGgWuLq88wmy2fDIZyKtvwNLd2mBcA1OztRyBzkr8o9/Nmw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=lvFvdJIGeOI7z9GBRSz7Y5eAvlGkW/B+cgC1jVH4bP8=;
 b=vjNu2zngjxZpBLVw5n0ONnNOyz7jn+TtrX12T8+c0peRx2uBqDjZCQp+NArjdgA/eXNNT8uYmnnIkb6pUcRk7rTis/Hc+Faml/pRoJI+PnAvk+MM5H498/BlFsLoLxMp88kZP1FqZFfLXnZI8f30kvh5Q8Hg5jxmCWSgm+kxzT4=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <040d7ea3-aeaf-62ea-5561-81e283f2185c@amd.com>
Date: Wed, 5 Jul 2023 15:21:09 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 43/52] xen/mpu: configure VSTCR_EL2 in MPU system
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-44-Penny.Zheng@arm.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <20230626033443.2943270-44-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0275.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:37a::11) To SN6PR12MB2621.namprd12.prod.outlook.com
 (2603:10b6:805:73::15)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN6PR12MB2621:EE_|SA1PR12MB7248:EE_
X-MS-Office365-Filtering-Correlation-Id: 8a25b0b5-429b-4d63-36c3-08db7d631878
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	fioPn84B2gb9YAJ1XAZbPufKpwpnXHtncjAXJIHEaw2FW/ZHPcMYQq4k2y9TYG4dSdlHLsRn3Ie2GjDcPxrcq/cbojhkHq/H99YNLn1HGHjr8KkzneQ/GLK6cL2IZl7b7QO2eTFoYM2jMKNcawidVI8VOswsgIkczkHc+DoM4DtXeSLq7jsHzyye5yxtQROvUZfpqblGW54lxP3+W/CsOj+yBJeOKaz3goUG914wZnBM54JqVQkmEu7/vA0KHD5QdGXEtwGlLYKfvO8Ea+lQqCr4w4ztCT31EL0mk97NUrDxcHnb+FpcnmeU/GVw4/wX/rHVYuGyKJXZFwIt0X6WaRCB61luzFPZZ6sRuN087OHiZnuGkk3OUjjHy+k3iUaqTM/egAVaG1YCM1iBo5HDwFKZUoAczSr4xIsTNY5wm9/FrOn/wOyMR4uiswzwT10GmAasCARVcPkEEvVuoOUTi24e6MDoqtOrdIhFUCAx8QXuodUsMT5wuqeFi5IJKCb2NJQ/2i1yv4nA8AWs/TB+KmmAgzjvF9SZ3GUDK2t3HUmvPB8hhIAHyPrF2y2BndFOYiAQJeDNtMG9DEfKCpYu9a7HbPe5N+WMjbTZhRnDQ75Bk54pzFxv3rD+gayocwXFr5prunVnRY2vLTymUdpGAw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2621.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(136003)(366004)(39860400002)(396003)(451199021)(54906003)(478600001)(6486002)(6666004)(41300700001)(8936002)(8676002)(38100700002)(4326008)(66946007)(66556008)(66476007)(316002)(2616005)(186003)(83380400001)(6512007)(6506007)(26005)(53546011)(31696002)(5660300002)(2906002)(36756003)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NDN1akdwTnlCWHcrdnN1ZlF4QTJ6bFFKeGd1VE5mdGJYZXNPL1pqbUFqTTIr?=
 =?utf-8?B?Mk1aUDcvaGRWS1VDQUdEZnJjcitubS96aGsrZXZINmtVUW1FNGcydlVCaXJr?=
 =?utf-8?B?UVgxUGJKa2s2SDY0TVhSQnk1WTNOY0NBblM0aXM0R2ZFMzV1SHp0MU16V3pX?=
 =?utf-8?B?cUhWZEJlTUxEZjdSSnp3YVdQbGlIS0FLb2hJbXpFRS9wdENVN2ZyU0ZlNW9m?=
 =?utf-8?B?NVpaYWRUTWN6OS9lM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C9n?=
 =?utf-8?B?WFpQRCtNcDFTZlVEY1lmNzM1QTc3NjZRSXJnNnpLSU1oMjNrZTlSTWhBL2Er?=
 =?utf-8?B?UjczMk9sRTdSVHBrSllQMzFiRXQ0U3JNY0tQc014N0hZWUt3UTgyNkloVGYy?=
 =?utf-8?Q?fPRj8cFIsLt1qwP944GRxTDHE?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8a25b0b5-429b-4d63-36c3-08db7d631878
X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2621.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 14:21:17.1545
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: TRvNzv6Zk7F6FnTmV9AG1jV524lJaHBRNKSyMA9R2hFkHIH1sg1YdaYUsRfaSK+dYZJbiLOCy5xOsksYmlHCNQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7248


On 26/06/2023 04:34, Penny Zheng wrote:
> CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
>
>
> VSTCR_EL2, Virtualization Secure Translation Control Registerï¼Œis
> the control register for stage 2 of the Secure EL1&0 translation regime.
>
> VSTCR_EL2.SA defines secure stage 2 translation output address space.
> To make sure that all stage 2 translations for the Secure PA space
> access the Secure PA space, we keep SA bit as 0.
> VSTCR_EL2.SC is NS check enable bit.
> To make sure that Stage 2 NS configuration is checked against stage 1
> NS configuration in EL1&0 translation regime for the given address, and
> generates a fault if they are different, we set SC bit 1.
>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> ---
> v3:
> - new commit
> ---
>   xen/arch/arm/include/asm/arm64/sysregs.h |  6 ++++++
>   xen/arch/arm/mpu/p2m.c                   | 17 ++++++++++++++++-
>   2 files changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/include/asm/arm64/sysregs.h b/xen/arch/arm/include/asm/arm64/sysregs.h
> index ab0e6a97d3..35d7da411d 100644
> --- a/xen/arch/arm/include/asm/arm64/sysregs.h
> +++ b/xen/arch/arm/include/asm/arm64/sysregs.h
> @@ -512,6 +512,12 @@
>   /* MPU Protection Region Enable Register encode */
>   #define PRENR_EL2   S3_4_C6_C1_1
>
> +/* Virtualization Secure Translation Control Register */
> +#define VSTCR_EL2            S3_4_C2_C6_2
> +#define VSTCR_EL2_RES1_SHIFT 31
> +#define VSTCR_EL2_SA         ~(_AC(0x1,UL)<<30)
> +#define VSTCR_EL2_SC         (_AC(0x1,UL)<<20)
> +
>   #endif
>
>   #ifdef CONFIG_ARM_SECURE_STATE
> diff --git a/xen/arch/arm/mpu/p2m.c b/xen/arch/arm/mpu/p2m.c
> index 04c44825cb..a7a3912a9a 100644
> --- a/xen/arch/arm/mpu/p2m.c
> +++ b/xen/arch/arm/mpu/p2m.c
> @@ -10,7 +10,7 @@
>
>   void __init setup_virt_paging(void)
>   {
> -    uint64_t val = 0;
> +    uint64_t val = 0, val2 = 0;
>       bool p2m_vmsa = true;
>
>       /* PA size */
> @@ -76,6 +76,21 @@ void __init setup_virt_paging(void)
>
>       WRITE_SYSREG(val, VTCR_EL2);
#ifdef CONFIG_ARM_64
>
> +    /*
> +     * VSTCR_EL2.SA defines secure stage 2 translation output address space.
> +     * To make sure that all stage 2 translations for the Secure PA space
> +     * access the Secure PA space, we keep SA bit as 0.
> +     *
> +     * VSTCR_EL2.SC is NS check enable bit.
> +     * To make sure that Stage 2 NS configuration is checked against stage 1
> +     * NS configuration in EL1&0 translation regime for the given address, and
> +     * generates a fault if they are different, we set SC bit 1.
> +     */
> +    val2 = 1 << VSTCR_EL2_RES1_SHIFT;
> +    val2 &= VSTCR_EL2_SA;
> +    val2 |= VSTCR_EL2_SC;
> +    WRITE_SYSREG(val2, VSTCR_EL2);
#endif
> +
>       return;
>
>   fault:
> --
> 2.25.1
>
>


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 14:25:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 14:25:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559240.874055 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3R8-0005Ey-0h; Wed, 05 Jul 2023 14:24:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559240.874055; Wed, 05 Jul 2023 14:24:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3R7-0005Er-UD; Wed, 05 Jul 2023 14:24:53 +0000
Received: by outflank-mailman (input) for mailman id 559240;
 Wed, 05 Jul 2023 14:24:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=dIgq=CX=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qH3R7-0005El-4k
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 14:24:53 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on20630.outbound.protection.outlook.com
 [2a01:111:f400:fe12::630])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b420f75a-1b3f-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 16:24:52 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS4PR04MB9338.eurprd04.prod.outlook.com (2603:10a6:20b:4e6::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 14:24:49 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 14:24:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b420f75a-1b3f-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=J99eCFFdYfNAfb9lgMeJOHlqkJ9gjtodwn3QNiLcIME6/v8mgkYyox82H47If5Q9xrAaDcjRv9BMDffvlsqvotzt+ERwT/iMpw6BBiX7muOaS8V+yiI7XSqTuSACbr/iqaSU25eNV8MrXlIBWkAw6LAcorX+Ykz29TNztcDv3DYyzQPOtIHO+9aaeqkyuHwS1kBrIXTaN60PNIXbCJ1JRZOn4fZrFbpqPGNvX/XzrhM/HFr8pSlIjstguEwYtpVY2QnfR0yS5isHcVL8+3iGt0Jkf/xXgFWlKERHr1F/3AflIdEPHTi4rxlz+I1STD88nyZGfL/1+BMIuJyZiePU/w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=pHTD7xr08KeyYTp781kIA9UvGB/ybvIaCBq3czqtgSU=;
 b=WnEE4d/QYkhFTGsajT3Y8HoD1T1iiZkQ/HpkH2bUyDp8Jk9LHwZ0QhqJZ+AEZbl9gt/YITp2qKbbMvnYyZ6FI6tzI6rk27kDfaDtzr8J3SrdrRpJ8BlNibXsLC+g+NGq/gM7Q0KBvItpWhI6nIbP/62gR1PoMUmwHyaB6TyhE4XutZTNGOBJxTCGcXOXS7RFCF2sp5L9OoeQ5fn+XLH1weWW3QY3S3/Bho+/nMKNt26HTnZ1oG/GyZQtAyOgEz5h1ctXa5ircL+Uk8WltvUEy4n6i0AxFbjE1TUjUZETeDzw8bndZOO7UJNI1lEZ8wVSvIiTFfwfIRM3MCinbKbe1g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=pHTD7xr08KeyYTp781kIA9UvGB/ybvIaCBq3czqtgSU=;
 b=WhojixWDw3+DkbDQRWo6sxzRKnycrj+lfXmTxEJqHmvTLaGAAzGym/yLBVjnCjlWHmWknpC2zUdLbrSNsuKK3yXefUE9LJjoAfeWoSb3XxvBIgAllI/BaOqsVFKbGK3IPYwIDHTlsuBGlnjxkYaaWFUJMtIURh6uXC9g8u4Frgs0O4V3vr884i/x2asI7cCBJmzQP4XI2dPUh1RWeIvJQ0ArJQ9hVi9D/ueCQRRxn8mASxl8UBH7ZCAN5vafWmcEBTZwD4zomcQwMkJ1KDN6dCzKigkXaP2jvBbaE6NlxcfFk8l92mdEz1nFG5aOfykX8WluGRj0/CcbL4yMROfjjg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <33af8ca2-dc65-0167-5569-c35744ea4f0d@suse.com>
Date: Wed, 5 Jul 2023 16:24:47 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v5 2/4] x86/microcode: Ignore microcode loading interface
 for revision = -1
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>
References: <20230629152656.12655-1-alejandro.vallejo@cloud.com>
 <20230629152656.12655-3-alejandro.vallejo@cloud.com>
 <d498ba69-564d-8232-5f5b-da52050772d8@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <d498ba69-564d-8232-5f5b-da52050772d8@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0135.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9e::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS4PR04MB9338:EE_
X-MS-Office365-Filtering-Correlation-Id: ffabd376-ee5c-46d6-fae3-08db7d6396fb
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	xn61blvcv8F2uv6mq0i0OS0IpkRbwSOC33XzNs1Lq914Zkk2rD6LWu6Xop5KDA3ihzz/vZxzbKsf1YV/J5Kkhk7EyDsVBj3vCkGdOMeGddd9BMlq7QLnHUvjtF1vsH+NTZY03rCLMjTFEql03fBFyuhR6xoCAsXC7pOOoGEE9iggIhC3VYnQnzeXgPqMKLzPzFDxQtlc2wVlSAkiHORzgDTQv3byX8bDCODUr5TqKDuKuUHWtgxeJvQjxyQvEFT26x0tNSoGghoFYiQLUCYr8wuktKuU4f19wkj8kChML2fRsaQQeVgaa1q6mBsT1tz3kGRZSD8RkfZ+Gutp855sxUHWnGwfvHPTS1vdo9HZUuLJ1u6GaHBgph9Pm7T84SprT3YB3ZwTQwicdKkSc+WWeK3EbHWfeaOEwMOxD0PFU65SsS0DJSI3GhbBzZCz01xStP3qd4pAF2AHXLhNvB2lXiLGeaQm9TJbX34MkEnwH3YPuILWKgevC78+SSPel08LIyZ5aIYq55pYV0T5ZIs5P7frrc8Hpks7Xsjb9MSEOGHt0tO0p7D5fwBHZXksutlcXvTBRD5aoR+FJsdZolJmQ1ESXtBReeyUXUSb72m6RFFeVjEVh9hR7J7HycX00PZk+0DokIXBUr2zKBu146FBoQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(136003)(376002)(396003)(366004)(39860400002)(451199021)(5660300002)(186003)(31686004)(6506007)(2616005)(2906002)(8936002)(8676002)(26005)(53546011)(41300700001)(6486002)(6916009)(4326008)(83380400001)(66556008)(36756003)(66946007)(316002)(66476007)(54906003)(478600001)(6512007)(38100700002)(31696002)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bGtxWUJVU3ZkRkJHMnUyM0V6clpDY2IrR3A2NXA0R1pFWTVGSWtUTFNDRWVR?=
 =?utf-8?B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wUEY1Qm5XVkJWd1psOEVHOFRF?=
 =?utf-8?B?SGMwV0NtTzNMNHoxM0JSazh1N1hCMzdzUkRZY1RHeTZCK3hjTmhwY3VYUjZm?=
 =?utf-8?B?N0pUVE1WampycUpSazV6UGlMRzNEeGVvT3M2Ull1MDJmTjF4UUx5dW9WeFNG?=
 =?utf-8?B?blZCclpwSEZHWDQ5Nld0MmtUUzZBa3U4R2ZwL1ZUODNtVHlIMlIrTmNiTWNF?=
 =?utf-8?B?YVprR3NsdS8reDN1NU1idjVscFo2UTViZVhIcm9adVpNcm4xY0RXeWRxenZm?=
 =?utf-8?B?QWRHWDV5KzBCUDcyQldUYmpWV0lLU1BORnF2eElJdzN3bHhOR0tHSXRsU2ZK?=
 =?utf-8?Q?8vWbJDYo3W4qUmht5AVpZJGwV?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ffabd376-ee5c-46d6-fae3-08db7d6396fb
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 14:24:49.2531
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: deI3xUZOhMiVGz40oh/w2RbSimcUUOuVESyClnFQwrJpGzv/xiLYNcV87WB71ZFayQXtGGOCH611sKzCd9pOeQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9338

On 05.07.2023 16:13, Andrew Cooper wrote:
> On 29/06/2023 4:26 pm, Alejandro Vallejo wrote:
>> diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
>> index bec8b55db2..b620e3bfa6 100644
>> --- a/xen/arch/x86/cpu/microcode/core.c
>> +++ b/xen/arch/x86/cpu/microcode/core.c
>> @@ -867,10 +867,22 @@ int __init early_microcode_init(unsigned long *module_map,
>>          return -ENODEV;
>>      }
>>  
>> -    microcode_grab_module(module_map, mbi);
>> -
>>      ucode_ops.collect_cpu_info();
>>  
>> +    /*
>> +     * Some hypervisors deliberately report a microcode revision of -1 to
>> +     * mean that they will not accept microcode updates. We take the hint
>> +     * and ignore the microcode interface in that case.
>> +     */
>> +    if ( this_cpu(cpu_sig).rev == ~0 )
>> +    {
>> +        printk(XENLOG_WARNING "Microcode loading disabled\n");
> 
> XENLOG_INFO "Found microcode revision ~0;Â  Disabling loading because of
> virt\n"
> 
> It's normal (and not a warning) when running under other hypervisors,

Except that INFO won't be visible by default in release configurations.

Jan

> and just "loading disabled" is too little information.
> 
> Happy to fix on commit.Â  Everything else looks ok.
> 
> ~Andrew



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 14:28:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 14:28:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559244.874065 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3UT-0005pv-Fq; Wed, 05 Jul 2023 14:28:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559244.874065; Wed, 05 Jul 2023 14:28:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3UT-0005po-Cv; Wed, 05 Jul 2023 14:28:21 +0000
Received: by outflank-mailman (input) for mailman id 559244;
 Wed, 05 Jul 2023 14:28:20 +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
 <SRS0=asTv=CX=citrix.com=prvs=543a7ddba=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qH3US-0005pi-Cm
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 14:28:20 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2e464450-1b40-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 16:28:17 +0200 (CEST)
Received: from mail-dm6nam10lp2108.outbound.protection.outlook.com (HELO
 NAM10-DM6-obe.outbound.protection.outlook.com) ([104.47.58.108])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 05 Jul 2023 10:28:15 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by SN4PR03MB6685.namprd03.prod.outlook.com (2603:10b6:806:21c::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 14:28:12 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606%4]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023
 14:28:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2e464450-1b40-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688567297;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=pf/gHzsx5bmWAJagMTYZaeU8AfyOt/R6BMeRi9EEGZk=;
  b=hTvsOyikDV44klJIWLvFO/rJre4neo8I3MU8KuDs7Sm/3p9tU/XmtgCK
   I8ZXi8skfg9pPh4XJ/3eLdGfGp41fOAhHwMs77SWv8ex+RyihKfw32DK8
   UNtanJTzRfzmCxAnEvflc5/3fvFqu9+FFG1wEVPTyuso4bLbq6nZmv4sG
   o=;
X-IronPort-RemoteIP: 104.47.58.108
X-IronPort-MID: 115654408
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:SpqrW6Ms+pVSp37vrR1llsFynXyQoLVcMsEvi/4bfWQNrUoi12MPy
 2ZJCG3Xb6qOZGr1fNt0a4mz8UlSsJOGnYRmTQto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v
 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/
 Nj/uKUzAnf8s9JPGjxSs/vrRC9H5qyo42tH5gFmP5ingXeF/5UrJMNHTU2OByOQrrl8RoaSW
 +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ
 HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0tcsBWJjx
 9wxFD4yVQ+/uOeZxbu4R9A506zPLOGzVG8ekldJ6GiBSNoDH9XESaiM4sJE1jAtgMwIBezZe
 8cSdTtoalLHfgFLPVAUTpk5mY9EhFGm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lp8v3M2nogtYGN5toKaUEVE8tb89u8y5Cy91JGLI
X-IronPort-AV: E=Sophos;i="6.01,183,1684814400"; 
   d="scan'208";a="115654408"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=OUBlQkeDqgJvFJ6IXImmBLeQN4W+hEbZ5QlGDkxLVfbAw+1susQE/jF8OyEuf7qRjaP8etpbjXkEodKd0c02Rd917lJFdsBidHy1Uyo6Qly4MFt3SAdmchoc5p6royuGUHTTAgQdMH8j+A6mcctv5q5PtX7A7dqfj3MGhL9GnnQKlZ+InR86pFfTToCmghRV6YUKHt0Wzx2VYigwoPCoCmPtuiFU+lEVApzCH8uyi+6ZGxyD1HsrXWGch03AtdrM+WF8Vqs4IqN+qFdb78DZpYF1Q2OqeYUyonxpZtemRLD8h92OnkYMi/B6bhBU1XNmtq3lv6PCFVophs5v+sezBg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=C6o5fL6QH4qo/QG/Pszbms0PnXNz92j6WRyXhSYHkkw=;
 b=f2E1wLIv12gA4cxlUpLFNpynvUZeaOc0OOuKPuWC/948Ry2AvseoAS4snTmDygKgfn1kWMOfkMRvXyJIhJunwZN7E9vp/9dzch8ui3UICq3EFwwA8FiOByM1qmKTrpWLBuEGgiZI4EdGnPLcyl7zIkPW6SjHylRQz0LxXnL1CPpGzqBkjb8Mf98OSHUt00V4aAZcSDvUCIJCb4WTm1O7cM0c68achfTa23/HuUIhbx/2GxBc49+PE5XHTKwOzAidYtRyR8aj9ukEGFJv63XEs4TrKj4URbCgHGsNRBjYEOz6R7hDTtSFEG8yUNJaR40z1sjO6mOUX/VTiaT9Ka3TsA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=C6o5fL6QH4qo/QG/Pszbms0PnXNz92j6WRyXhSYHkkw=;
 b=i+lBqfk77d28xJAJgeVdPpRvXVeSt28hg9dlI2V/C91djEGfxHgFPvnxvl7K2brG1f/0NJUEtQr2fh8hEQG35937YDwZzyMVpc1UUpQv1OfgOqvPOJRBD3qC+KP2aOLMEsvlTSrlltpLd5YcTjUbKeynkooxxNY/3+DtoNKkicA=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <ea4bb2c4-a099-0d89-9b9c-fe7ac8ffa0c2@citrix.com>
Date: Wed, 5 Jul 2023 15:28:07 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v5 2/4] x86/microcode: Ignore microcode loading interface
 for revision = -1
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>
References: <20230629152656.12655-1-alejandro.vallejo@cloud.com>
 <20230629152656.12655-3-alejandro.vallejo@cloud.com>
 <d498ba69-564d-8232-5f5b-da52050772d8@citrix.com>
 <33af8ca2-dc65-0167-5569-c35744ea4f0d@suse.com>
In-Reply-To: <33af8ca2-dc65-0167-5569-c35744ea4f0d@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0198.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a4::23) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|SN4PR03MB6685:EE_
X-MS-Office365-Filtering-Correlation-Id: c405e285-2f36-479c-50a2-08db7d64102d
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	8fwisbIjP/wTISEPjLF+qWiNKV/BJH/P4urNkrqDHb75fmFUKwTi/9llIF7MGqBKTE1pQWyE7ti4kH6VPu4lU2zn4JpI8r2zrB8IbcOHHlUuOw9zB4tJ0KpIRX4HiSv8wdDTtpPO88Es08yVBqQmTPQumPhs+i8GygBsesP5jeUrdvPr+UEr12hFNYgqS+PnNAsZWJP9bKkOGXPJk7i+dt1xnRS5lyAYdKtANQ587L9AtIHkvCq/OI6Sc6NBgl9I2H01ajTgBemO+epA2x7L3nRAvoH6J47rd/CrD9HUUR4PKxJ+q/+j54wfCAD5vO0hS+1Yl7L5H+rjvl6u3fx1ryzgN76ryZ9qUG36ipA0UiW5YH/KjyejQXRYDBkqElvhhAjDmYpgJ7aRbZ0QqSbz5ue/js87pZZeVwcBdqm3haWKxoGET7NQg0RhcJgqXy+6huYvap3UcUA2JpdmGtgJ1+lFNZ9Gz72ypRPuC9bS/w3uGW5lHehW9A/5l6c6Hshll5Spt/DcX8g21K3OvmfzS5MIq/FPu5UIgwVMFsNw97/7tZgWFcV4guDROtzQ8QiyMWnpBeua4z8kC5vSrgSB/gbGWwxg+NXGV7fxKwyix6vrfgs+74RqZJS7V2586mRV6bWCVErceyTbsyRWI9TkYA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(136003)(376002)(396003)(346002)(451199021)(53546011)(6512007)(6506007)(31686004)(186003)(8676002)(8936002)(26005)(41300700001)(6486002)(2616005)(83380400001)(66946007)(478600001)(82960400001)(54906003)(6666004)(38100700002)(66476007)(6916009)(4326008)(66556008)(316002)(31696002)(86362001)(2906002)(5660300002)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MWZMTlNaemhiTTNmUjY0TlZDTGtoR2ErTzNaTkp1YmZsN1NvbWlqQk5VZDBi?=
 =?utf-8?B?SFZpSWJtQWRRUTkvRVEvc1VDUk1IWjNLTUpqWVNiVHVDT2VLRmpXYUdpQXFO?=
 =?utf-8?B?dk1CRHpxVHk4dU5NWkRFc2Q4eE5aR3plR2pwT2xad1paQUt0c3QxMGZEbm9N?=
 =?utf-8?B?NW1iWlFtVHc4Nmh0UFM4YTZTai9Rc2p4VFlpMG9ISUNldGVCRkEyR0IwczhR?=
 =?utf-8?B?N21tNFZJRUZhdmsxRnU4V0pmdUNQYUpTYXBOSkFmbkNrcVk1MGtRcVh3N0V3?=
 =?utf-8?B?Sy8yb1hXeXdSK0FoNURQQXV0eXBtbVdvbkdSWFZqUW0xK1RsRWNKR3JjdmM1?=
 =?utf-8?B?dFZCTy83OGdmZ3lsZzVUSVpjcnlXSHdBZXBTS0cvZWV6VGJBYUQxd0FMZjRD?=
 =?utf-8?B?OUQ4dXdCaWQzUGJHL0N0YXU2bFBGa252RkxhNG4zRzlETUUvekIrMmJKUkMz?=
 =?utf-8?B?S1RCWU5sRncyb1JUY01WNXFSQVp5NjNhZnZsZzN0WDAwdVlQYVVZcDFpQXdR?=
 =?utf-8?B?Q0VWOUZMWHdNejh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PK6FK1Xx19vsEMrfIkM1eBrY6o/J96B2mz+0lrZoxgPV9OTRMEq+E29qzu9yKYzLWHqfVXBfHsY9J64dVCRROMFfVH3/lwnJ2/rS6ouKrS+vEYa0gMoSkeKbpkQs977CnWaATO6BcO/nrg42R/e1cnx8439CB2l5VqqMHqzzfWFnsKuJuAvQT7iKxHpzpgApEFIyzqEhaWC8BCOf+Z1TybrR7x35JBF75QsKZD1qBHGTq+pCKCAYbKZNlkku04mJCyJBxX+EjUYDgAT3cTgk6LOBIPyogRvWu3P1n8MKQvwE8Z5+FcH04Hjg4oSqsdzf31szjI9s+PngZNa0A9K1HMm2jQHDKXlQTUy4PXyRoi0SELlRBEExQWJkK6LLNYDtk+eQELAToMzZbx2whi2COQE9OPkyjWHeOXCbEyKubcMRpcd5NhK0jaewpeejIxvGCXa3G0RPjQRSRjBxrcDVKkK/SNSeivmmuhwuaC1rexNGF3772PDqU4mphC3lmE6JavmXn5iR3uCgw11HNneiNFJj6jnLHq13+hgt5WGZGlT5cewXDM1oJq79gZCRL5Y0tTuNjBqgAl8uemLO/Y0qKngl96api1N2PdeR/BvccGvV0UDxiyLZD5wEQuEk/BWr/U+mqoZ7VlAzOTeS4mRVcUPa3Vbnr0Ik/gnQIDgk1UEWYMee3jTvCSch6vwLJtPR1yLtWEAmQm5HCYiTC1KfD9i/8RPNp/4pihrDPWLOCT0rylvsHCRNI1dsukhXO5Hq/eLYRJ7jHfwONXjcpk6NvA0LxLGkp0=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c405e285-2f36-479c-50a2-08db7d64102d
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 14:28:12.6855
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: lFGKu2G1XMYJiH5AhB4LZooRz89mZ8lGULHf46hFPzIyZbHxlx8G7z3I2IzKTEWKowm32QKwZn+V6zXoqs2n1i3WULJ8YX5QqSdvslEWhRM=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR03MB6685

On 05/07/2023 3:24 pm, Jan Beulich wrote:
> On 05.07.2023 16:13, Andrew Cooper wrote:
>> On 29/06/2023 4:26 pm, Alejandro Vallejo wrote:
>>> diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
>>> index bec8b55db2..b620e3bfa6 100644
>>> --- a/xen/arch/x86/cpu/microcode/core.c
>>> +++ b/xen/arch/x86/cpu/microcode/core.c
>>> @@ -867,10 +867,22 @@ int __init early_microcode_init(unsigned long *module_map,
>>>          return -ENODEV;
>>>      }
>>>  
>>> -    microcode_grab_module(module_map, mbi);
>>> -
>>>      ucode_ops.collect_cpu_info();
>>>  
>>> +    /*
>>> +     * Some hypervisors deliberately report a microcode revision of -1 to
>>> +     * mean that they will not accept microcode updates. We take the hint
>>> +     * and ignore the microcode interface in that case.
>>> +     */
>>> +    if ( this_cpu(cpu_sig).rev == ~0 )
>>> +    {
>>> +        printk(XENLOG_WARNING "Microcode loading disabled\n");
>> XENLOG_INFO "Found microcode revision ~0;Â  Disabling loading because of
>> virt\n"
>>
>> It's normal (and not a warning) when running under other hypervisors,
> Except that INFO won't be visible by default in release configurations.

Well that's not a bug with microcode then, is it...

I can't believe I'm having to say no to emitting messages at the wrong
log level to work around a bug with selecting the default log level in
the first place.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 14:30:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 14:30:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559251.874074 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3WD-0007JD-W6; Wed, 05 Jul 2023 14:30:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559251.874074; Wed, 05 Jul 2023 14:30:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3WD-0007J6-So; Wed, 05 Jul 2023 14:30:09 +0000
Received: by outflank-mailman (input) for mailman id 559251;
 Wed, 05 Jul 2023 14:30:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=dIgq=CX=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qH3WB-0007IA-UT
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 14:30:07 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on20607.outbound.protection.outlook.com
 [2a01:111:f400:fe12::607])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6faf8839-1b40-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 16:30:07 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS4PR04MB9338.eurprd04.prod.outlook.com (2603:10a6:20b:4e6::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 14:30:04 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 14:30:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6faf8839-1b40-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=X/xYbC3teToJlrixCqXHnXLtyRIQHTbm2NmWNaVwvoXkYosJMyKMrCdrd2N5tqZaMIBw7zi3gZcB85Lz00gQWE0IJ+ZA1N/I8wa/fNEFJStbHOCnUv7yqpON86m1rUGlaFnTqcdsBEpWqqSSt+61IkFq6lwM1QsMYX1Y7fgWzl1XGHTcZ/Q02DQsfX009v/Tewbxvs/H9ZOB2AEpEzW+Yan12J1MVsULhioMGGr+7nA5f9FGKAPtTWAgWaWbtv1sysNS8CwCfpiyKKZDavrA97r1DXapQuO6NvRCPgN/iOzn/goymosKGbZ8GmW62pQ6nNCMLB/fEdK/XovzMQ9yZA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Xw9h9wWD64siM8OP/lbu56fim0p2aLIeCIgWWeRwyuw=;
 b=PoSBVchfAjt0lMVEUl+E8cSga4wZnSopnixXyr0xyWUinsWz6IswPa2EcAQWkKPqXe5T0dyQQ8ovBMpiewmdWNrVgNuoQyxvUDLm9szY+y2QDfzqWjk6TadTrhy360Ss9VmU4qDxgr8aoZ+qYsMR/zh65oZzuajaZYN7set6HjR4Be7CqLKTtq8pUeVmnnn+BPAkEZIOR304iWLC6daFmQIVRQH+og4iWYzxZyNfDZLLQD71r0jdLxpGlGDhM2/eQjtHLTMU4w9ZT5VMmhth8M3XWTn33vOQiASdwnw1mUQQBUlr8W8+DseZYA7gR2ByBite15aVh5ToSuM00+/HGw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Xw9h9wWD64siM8OP/lbu56fim0p2aLIeCIgWWeRwyuw=;
 b=DhqL1FOrPDBivlc8UEihpOllrbx8s8uw8W7voDsRNysojYWzt46acm1O71a35iUEX6Rc48YDM4PgI5ArFfmuHa0o+V5cwi7+WH0UeH3SaMhMsciUx9qX+3oyEhK3yEnz8W85cfYmIqASf1YlSFTBBSZvEROgOnmHmKyWQ2Wh69N/WahFDC1LHoDdLet56OLAl39QJil19UR51njaxImyceiZtBdf+mZ0y37JRJhaxoRI9Mb5v8OSfNNcncbPhZ4HDQ5ykP8ALAhpZV+mARyQpP4L/HurMTXdhZqRRmz0nIV2h3MP7Whyq02bjLceWDp3KoW7B7xcOUw4EU1aMOBRtg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <b5d551ed-6523-0ead-9c83-a7fae10eee67@suse.com>
Date: Wed, 5 Jul 2023 16:30:02 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v5 4/4] x86/microcode: Disable microcode update handler if
 DIS_MCU_UPDATE is set
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
References: <20230629152656.12655-1-alejandro.vallejo@cloud.com>
 <20230629152656.12655-5-alejandro.vallejo@cloud.com>
 <1c9fe38e-d8aa-21fb-8dbe-4c54385b5a67@suse.com>
 <64a57820.170a0220.9a035.9a30@mx.google.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <64a57820.170a0220.9a035.9a30@mx.google.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0107.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a3::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS4PR04MB9338:EE_
X-MS-Office365-Filtering-Correlation-Id: f0918c21-7159-41b4-b3ee-08db7d6452ce
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	2SfkxbwO8pefyaalXwtS0lROlQWT9+deaIjeRaNhEkT3Er89quMp2Z4oaYql47kc5G0PZEGO5R5QK/meAWeUiGKkLyszUEFLQJZZi8qWQJmdI73ks6eY6NHP1e5BduLb+C5mHJ3YvPIUX7m9KNl/wGRABUwo9/PN0ZLf53QiF9jeD7nbSwuRvmjomGwdD+wSV8x3mo7grEV86uP/7RZAs3yjdztP8yoTfwzj84VL7ag39PTO4+EfW2hZnQGbLmwl/Va9CYGfwjQUsD/FpFMUVuLc0ibVxuLvCP9toYLoev5kZc4J4OzxPp+K86fwoWsbyo31DhYjk4VnK6rUc7iIyEtj27IxYvfPHn7DO3Uxt81qFi8DYp+ZXc+8qADcf6qq9X4CgbthSkfXvfiZKQo5Kxc4wfdTIqnKSgrLkHACuWAFBTOVYX2A5M1g+1+KPeXGD6Ik4y5fRY3atb1dfGZPsUGEQyzkn3qHp2GCyZpybMbD9ElW7/RjrW7tXaBK5D5+tTU0aheOL//Byl0SNU3NgI0TwvhSqWYHv7yCDigfC4hLQe1/lmISAus7Sowas2jKtniC/PWbK9C/xIOZtVdMWtDZio/1KXsEpXH1Z2YILa+RqUA8Zv4Cny5NAOSHoQmhte5sAJrV2KbZhH7UU0yyBA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(136003)(376002)(396003)(366004)(39860400002)(451199021)(5660300002)(186003)(31686004)(6506007)(2616005)(2906002)(8936002)(8676002)(26005)(53546011)(41300700001)(6486002)(6916009)(4326008)(83380400001)(66556008)(36756003)(66946007)(316002)(66476007)(54906003)(478600001)(6512007)(38100700002)(31696002)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eFp5aUl3NFc3MzVReUgwSUJMNDlRaUMvbDZ6U2gweklLblhqa0F4Vm1rVmZr?=
 =?utf-8?B?Tkh5NWt1WlNxVlJNUkNjWmh5ZnI2R1BNbkJvSDcrSVN2eWs5cXlpUVpYMDUx?=
 =?utf-8?B?NjFXblh6YlExWkhQdDJCOVo1VEVsNG9lR0swaExXYUxsOGY2cW5YU21hSGZG?=
 =?utf-8?B?Z1JaZytqOUlrNnEyZ1ZtSCtpcWtxa1RBNE0rdERoSmllWmx2d3RBM3BOVmpC?=
 =?utf-8?B?a1RMOFFuVDNyN2RLQmNDSFM1d2V0SFJCRUM5NDFjeF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lU4NlY1cEtkY2FramdIWVFYNDdNVHJ3MTRGYmkvQXYz?=
 =?utf-8?B?dHl0TmlrdXBPZFlsalZiWFh0R0p4cGV4U2NTdVNnR2REWTFSVHNKVWRPYnI3?=
 =?utf-8?Q?vBhh10z7pDK7IufcPKMbPdecP?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f0918c21-7159-41b4-b3ee-08db7d6452ce
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 14:30:04.3467
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ct3v1jGVQQVxSdkijE5TCNtQ4qhCS37ZIR3uZ6alDd58y7W4XAWybopKVKLVFoxgGT5JymYNAehbpiFn+ODkFA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9338

On 05.07.2023 16:03, Alejandro Vallejo wrote:
> On Wed, Jul 05, 2023 at 12:51:47PM +0200, Jan Beulich wrote:
>>> --- a/xen/arch/x86/cpu/microcode/intel.c
>>> +++ b/xen/arch/x86/cpu/microcode/intel.c
>>> @@ -385,6 +385,19 @@ static struct microcode_patch *cf_check cpu_request_microcode(
>>>      return patch;
>>>  }
>>>  
>>> +bool __init intel_can_load_microcode(void)
>>> +{
>>> +    uint64_t mcu_ctrl;
>>> +
>>> +    if ( !cpu_has_mcu_ctrl )
>>> +        return true;
>>> +
>>> +    rdmsrl(MSR_MCU_CONTROL, mcu_ctrl);
>>
>> While one would hope that feature bit and MSR access working come in
>> matched pairs, I still wonder whether - just to be on the safe side -
>> the caller wouldn't better avoid calling here when rev == ~0 (and
>> hence we won't try to load ucode anyway). I would envision can_load's
>> initializer to become this_cpu(cpu_sig).rev != ~0, with other logic
>> adjusted as necessary in early_microcode_init().
>>
> We only know about the ucode revision after the collect_cpu_info() call,
> and we can only make that call after the vendor-specific section that sets
> the function pointers up (and calls intel_can_load_microcode()).

Hmm, right, that wasn't quite visible from looking at patch and
current tree, because of what earlier patches in the series do.

> One could imagine turning can_load into a function pointer so that its
> execution is deferred until after the revision check (and skipped
> altogether if `rev==~0`).

Perhaps not worth going this far, and instead stay with what you
have until we know (if ever) that further tweaking is necessary.

Reviewed-by: Jan Beulich <jbeulich@suse.com>
(maybe with an adjustment to the comment, as mentioned in the
earlier reply)

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 14:32:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 14:32:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559255.874085 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3Xy-0007s0-Bu; Wed, 05 Jul 2023 14:31:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559255.874085; Wed, 05 Jul 2023 14:31:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3Xy-0007rt-8L; Wed, 05 Jul 2023 14:31:58 +0000
Received: by outflank-mailman (input) for mailman id 559255;
 Wed, 05 Jul 2023 14:31:57 +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 <SRS0=rv0Z=CX=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qH3Xx-0007rl-KW
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 14:31:57 +0000
Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com
 [2a00:1450:4864:20::12a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b094f5a4-1b40-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 16:31:55 +0200 (CEST)
Received: by mail-lf1-x12a.google.com with SMTP id
 2adb3069b0e04-4fb73ba3b5dso10990903e87.1
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 07:31:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b094f5a4-1b40-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1688567514; x=1691159514;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=ZZYGWYPAfRB5K0sCUF/70UHdTu7iGcGN41Q1A4RW/NM=;
        b=cSB2kDWY6AueC+CAaiCkgwSzhnqoK7jmGEeVHi4k+aIDctcmOmYEDYDwEWm6RqpR4z
         7Z1k7ZcMDFdLCi+tu/baN7NqJ2Q2TIFtqe9vrSbwMjr5kRoblQ1e42wKrJzyd9QPnuIe
         i22b18LjO7w0fcgYWS+qY5ux8HH7xCoSRc4QY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688567514; x=1691159514;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=ZZYGWYPAfRB5K0sCUF/70UHdTu7iGcGN41Q1A4RW/NM=;
        b=j92OpdWvbwch6Y0loTg1+34Hm4lqYJwCtmVNN3I+PANborKSPPAgpcq7v91T1VyxWc
         aGPhLz6mNQsd7oyEL0aCk0fTWO/JCTwQm4xiKD4ZCPw69pH15ZIufPro3jqQMboRRhWU
         xX5+4x9y2WCC5fq4riAJCR/0wePcVkwY5AC+JeYYuBHzbPUmHOpN0O3P2LeL6AY5HEQ0
         S5rtT/4a7jWcGes5F2eVO01VnwGCy6hAEH/3WGNd8V52YsWA5ptM7nf8tuzkT4npy1rk
         B87hlAjEHwLPSq0j1AhzTwA/9vnyTXkZTSE2H333YXf3kMHi2tIkD8wBdDp7ThM8FHt6
         qq6A==
X-Gm-Message-State: ABy/qLZw6BecAfQ/lKuQ++zOiovJYzd9wFlMg7+YtVdNajrKo8nyT8BR
	56KgH99ENMdZgLELdwDuUyOXT+yfA0gM8IhXsU2Lsg==
X-Google-Smtp-Source: APBJJlEtX/0mPSGvMYE9w/MmNB4jyFS1mDcOrpIX3kR1flQCukMFjFHMIyYek/PghdiGRv7aZ+ztzbcEeXTx88PTq6Q=
X-Received: by 2002:a05:6512:285:b0:4fb:82d8:994f with SMTP id
 j5-20020a056512028500b004fb82d8994fmr10966476lfp.33.1688567514363; Wed, 05
 Jul 2023 07:31:54 -0700 (PDT)
MIME-Version: 1.0
References: <8601CDD7-87F7-4FD0-A6E6-BAEAB12E7956@arm.com> <234199F8-DBB1-42B6-9A4C-8800EEF60997@gmail.com>
In-Reply-To: <234199F8-DBB1-42B6-9A4C-8800EEF60997@gmail.com>
From: George Dunlap <george.dunlap@cloud.com>
Date: Wed, 5 Jul 2023 15:31:43 +0100
Message-ID: <CA+zSX=Y3_g_aq4+sDK7CuZajywVqQ4xOrq7hKZ80eUT3uSxzuQ@mail.gmail.com>
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
To: P S <pairspace@gmail.com>
Cc: Luca Fancellu <luca.fancellu@arm.com>, Stefano Stabellini <sstabellini@kernel.org>, 
	"Daniel P. Smith" <dpsmith@apertussolutions.com>, 
	Christopher Clark <christopher.w.clark@gmail.com>, Andrew Cooper <Andrew.Cooper3@citrix.com>, 
	Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>, 
	George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
	Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, Henry Wang <Henry.Wang@arm.com>, 
	Community Manager <community.manager@xenproject.org>, Doug Goldstein <cardoe@cardoe.com>, 
	Bertrand Marquis <bertrand.marquis@arm.com>, Volodymyr Babchuk <volodymyr_babchuk@epam.com>, 
	Anthony PERARD <anthony.perard@citrix.com>
Content-Type: multipart/alternative; boundary="000000000000df8c5505ffbe4238"

--000000000000df8c5505ffbe4238
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Jul 3, 2023 at 9:55=E2=80=AFPM P S <pairspace@gmail.com> wrote:

>
>
> > On Jul 3, 2023, at 15:45, Luca Fancellu <luca.fancellu@arm.com> wrote:
> >
> > =EF=BB=BF
> >
> >> On 3 Jul 2023, at 18:48, Stefano Stabellini <sstabellini@kernel.org>
> wrote:
> >>
> >>> On Mon, 3 Jul 2023, Daniel P. Smith wrote:
> >>> On 7/1/23 11:13, Luca Fancellu wrote:
> >>>>> On 1 Jul 2023, at 08:53, Andrew Cooper <andrew.cooper3@citrix.com>
> wrote:
> >>>>>
> >>>>> On 30/06/2023 10:12 am, Luca Fancellu wrote:
> >>>>>> The "dom0less" feature was intended to be the feature where a domU
> >>>>>> domain could be launched without the control domain (Dom0)
> >>>>>> intervention, however the name seems to suggest that Dom0 cannot
> >>>>>> be part of the configuration, while instead it's a possible use
> case.
> >>>>>>
> >>>>>> To avoid that, rename the "dom0less" configuration with the name
> >>>>>> "hyperlaunch", that is less misleading.
> >>>>>>
> >>>>>> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> >>>>>> ---
> >>>>>> This is an RFC to get the feeling of the community about the name
> >>>>>> change, for now it's everything in one patch just to see how it
> >>>>>> will look like, if there is interest on proceeding into it, I can
> >>>>>> split in more commit.
> >>>>>
> >>>>> Have you discussed this with Dan and Chris at all?  You haven't eve=
n
> >>>>> CC'd them.
> >>>>
> >>>> No, this rename idea started from a chat during the summit, anyway
> Julien
> >>>> promptly add them to the CC, because I forgot.
> >>>
> >>> No worries and thank you for considering and taking the time to do
> this RFC.
> >>> It is greatly appreciated that there is a strong willingness to have
> dom0less
> >>> and hyperlaunch merged.
> >>>
> >>>>>
> >>>>> While there is a lot of end-goal in common between the dom0less and
> >>>>> hyperlaunch, and that the name dom0less is deeply misleading,
> >>>>> hyperlaunch is specifically not this.
> >>>>
> >>>> Yes Hyperlaunch is more than this, however as I said, with this RFC =
I
> would
> >>>> like
> >>>> to ear opinions, @Daniel @Christopher could it be a proper name for
> the
> >>>> dom0less
> >>>> feature?
> >>>
> >>> As Andy has alluded, hyperlaunch is meant to provide a flexible means
> to
> >>> handle domain construction at boot to meet a wide range of possible
> use cases.
> >>> One of those use cases is dom0less, so yes, ultimately what dom0less
> does
> >>> today will be achievable under hyperlaunch. Our intended approach to
> align the
> >>> two implementations is one that is meant to be minimally disruptive,
> since
> >>> dom0less is considered a supported (SUPPORT.md) capability. As
> mentioned, we
> >>> are greatly appreciative to the openness to adopt the name,
> >>
> >> Thanks Daniel!
> >>
> >>
> >>> but a big concern
> >>> I personally have is the confusion it could cause a general user. A
> blanket
> >>> rename would end up with two documents in the docs tree that provide
> two
> >>> different explanations of hyperlaunch and two different device tree
> >>> definitions. So I think a more measured approach should be considered
> here.
> >>>
> >>>> If this patch makes things more difficult for the Hyperlunch serie,
> I=E2=80=99m ok
> >>>> to drop it,
> >>>> my only aim was just to find a less misleading name for the feature.
> >>>
> >>> What I would like to suggest as a good first step would be an update
> to the
> >>> dom0less document. Provide a note at the beginning that points to the
> >>> hyperlaunch design doc as a more general approach that will eventuall=
y
> subsume
> >>> dom0less. This would provide a gentler transition for exist users of
> dom0less.
> >>>
> >>> If it is not too much, I would also ask, please have a look at the
> design for
> >>> boot modules in the series Christopher just posted. The design pulls
> from the
> >>> work done by dom0less and expanded upon it. I major step into merging
> the two
> >>> capabilities will be to have a common set of structures. Once those
> are in
> >>> place, we can move to a common device tree representation, and at tha=
t
> point
> >>> we would be fairly close, if not at the point of a formal merger of
> between
> >>> the two.
> >>
> >> At the moment we have a concrete problem with explaining dom0less and
> >> hyperlaunch to potential new users. Using two different names for a
> >> similar feature on arm and x86 causes confusion. It is hurting Xen as =
a
> >> solution. Personally I already had to switch to use the word
> >> "hyperlaunch" for everything in my users-facing presentations.
> >>
> >> At the summit, we discussed that it would be a good idea to use a sing=
le
> >> name to refer to both features on arm and x86. Given that "dom0less"
> >> causes additional issues because it makes people think that there is n=
o
> >> Dom0, the suggestion was to use "hyperlaunch" to refer to both feature=
s.
> >>
> >> We don't need to 100% align the two implementations and data structure=
s.
> >> This is not for engineers that are going to look at the specifications
> >> and improve them. This is for users/customers of Xen that are trying t=
o
> >> understand what the hypervisor enables them to do. We need to be able =
to
> >> show users architecture slides with the same name and explanation on
> >> both ARM and x86.
> >>
> >> I am sure that Daniel and Christopher remember, but for the others on
> >> this email thread, the name "hyperlaunch" was born exactly to be that:
> >> the one name to cover both features on ARM and x86 even if they have a
> >> different implementation. Appended an old email for reference.
> >>
> >> Also I agree with Daniel that we need to be careful about the two docs
> >> under docs/. I think he is right we need to add a paragraph explaining
> >> the history and a pointer to the other document. Something like:
> >>
> >> "Dom0less is the name that was used when initially introducing the
> >> feature on ARM. Then, the "dom0less" name was retired in favor of
> >> "hyperlaunch" to avoid confusion (a Dom0 might still be present) and t=
o
> >> align with x86 (where a similar feature was called hyperlaunch from th=
e
> >> start)."
> >
> > I=E2=80=99m fully ok to add a section like this pointing to the Hyperla=
unch
> design.
>
> _If_ this text is added, please include links/references to the
> Hyperlaunch wiki page and Hyperlaunch design docs.
>
> > @Daniel and @Christopher would it be ok for you or the changes in the
> serie
> > are going to be problematic for your future work? In the end it=E2=80=
=99s just a
> mechanical
> > rename, so I guess we just need to agree on naming conventions.
>
> Please see the history of trademark litigation about the use of symbolic
> names to reference similar-but-different artifacts.  It is much easier to
> use the same name to refer to entirely different objects. Historically,
> confusion arises when a name is used in similar contexts.
>
> There is also versioning.  Could we refer to dom0less as "Hyperlaunch
> Version -1"?
>
> How about renaming dom0less to "Hyperlaunch Lite"?
>

Perhaps it would be helpful if you could explain more clearly your
concerns.  I take it that you want a name which can be used specifically to
indicate the full "domB measured boot" functionality that was Daniel and
Christopher's original goal, and that you're afraid that using plain
"Hyperlaunch" for only the "start VMs from Xen on boot" functionality will
dilute that?

The "start VMs from Xen on boot" functionality is the *only* thing that a
big chunk of the users of this functionality want;  referring to it as
"Hyperlaunch Lite" or "Hyperlaunch -1" will undermine the value of the
functionality.

What if we use "Measured Hyperlaunch", or "Hyperlaunch Measured Boot" to
refer to the full measured boot functionality?

Or, "Hyperlaunch DT" for "Booting VMs from Xen using Device Tree" (without
the involvement of a domB), "Hyperlaunch Boot Domain / Hyperlaunch domB"
for a more general "domB" functionality, and "Hyperlaunch Measured Boot"
for the full functionality (assuming there's more to this than simply
having a domB involved)?

 -George




>
> Rich
>
> > Cheers,
> > Luca
> >
> >>
> >>
> >> ---
> >>
> >> Subject: [RFP] Overarching name for dom0less and DomB
> >>
> >> Greetings,
> >>
> >> At the DeviceTree/DomB meeting it was proposed that a new, larger
> >> overarching name under which DomB and dom0less would be covered. There
> >> was a general openness to the idea. As such, since Christopher and
> >> myself are in the midst of finalizing the design document for DomB we
> >> felt it might be better to see if a name could be selected which we
> >> could use in the design doc in lieu of DomB. As always naming things i=
s
> >> hard, but after some brainstorming we believe we have arrived at a
> >> decent name, =CE=BCLaunch (micro-Launch or uLaunch).
> >>
> >> ---
> >>
> >> =CE=BCLaunch became hyperlaunch few days after, and the rest was histo=
ry :-)
> >
> >
>

--000000000000df8c5505ffbe4238
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Mon, Jul 3, 2023 at 9:55=E2=80=AFP=
M P S &lt;<a href=3D"mailto:pairspace@gmail.com">pairspace@gmail.com</a>&gt=
; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px=
 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
&gt; On Jul 3, 2023, at 15:45, Luca Fancellu &lt;<a href=3D"mailto:luca.fan=
cellu@arm.com" target=3D"_blank">luca.fancellu@arm.com</a>&gt; wrote:<br>
&gt; <br>
&gt; =EF=BB=BF<br>
&gt; <br>
&gt;&gt; On 3 Jul 2023, at 18:48, Stefano Stabellini &lt;<a href=3D"mailto:=
sstabellini@kernel.org" target=3D"_blank">sstabellini@kernel.org</a>&gt; wr=
ote:<br>
&gt;&gt; <br>
&gt;&gt;&gt; On Mon, 3 Jul 2023, Daniel P. Smith wrote:<br>
&gt;&gt;&gt; On 7/1/23 11:13, Luca Fancellu wrote:<br>
&gt;&gt;&gt;&gt;&gt; On 1 Jul 2023, at 08:53, Andrew Cooper &lt;<a href=3D"=
mailto:andrew.cooper3@citrix.com" target=3D"_blank">andrew.cooper3@citrix.c=
om</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt; On 30/06/2023 10:12 am, Luca Fancellu wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt; The &quot;dom0less&quot; feature was intended to b=
e the feature where a domU<br>
&gt;&gt;&gt;&gt;&gt;&gt; domain could be launched without the control domai=
n (Dom0)<br>
&gt;&gt;&gt;&gt;&gt;&gt; intervention, however the name seems to suggest th=
at Dom0 cannot<br>
&gt;&gt;&gt;&gt;&gt;&gt; be part of the configuration, while instead it&#39=
;s a possible use case.<br>
&gt;&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt;&gt; To avoid that, rename the &quot;dom0less&quot; con=
figuration with the name<br>
&gt;&gt;&gt;&gt;&gt;&gt; &quot;hyperlaunch&quot;, that is less misleading.<=
br>
&gt;&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt;&gt; Signed-off-by: Luca Fancellu &lt;<a href=3D"mailto=
:luca.fancellu@arm.com" target=3D"_blank">luca.fancellu@arm.com</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; ---<br>
&gt;&gt;&gt;&gt;&gt;&gt; This is an RFC to get the feeling of the community=
 about the name<br>
&gt;&gt;&gt;&gt;&gt;&gt; change, for now it&#39;s everything in one patch j=
ust to see how it<br>
&gt;&gt;&gt;&gt;&gt;&gt; will look like, if there is interest on proceeding=
 into it, I can<br>
&gt;&gt;&gt;&gt;&gt;&gt; split in more commit.<br>
&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt; Have you discussed this with Dan and Chris at all?=C2=
=A0 You haven&#39;t even<br>
&gt;&gt;&gt;&gt;&gt; CC&#39;d them.<br>
&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt; No, this rename idea started from a chat during the summit=
, anyway Julien<br>
&gt;&gt;&gt;&gt; promptly add them to the CC, because I forgot.<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; No worries and thank you for considering and taking the time t=
o do this RFC.<br>
&gt;&gt;&gt; It is greatly appreciated that there is a strong willingness t=
o have dom0less<br>
&gt;&gt;&gt; and hyperlaunch merged.<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt; While there is a lot of end-goal in common between the=
 dom0less and<br>
&gt;&gt;&gt;&gt;&gt; hyperlaunch, and that the name dom0less is deeply misl=
eading,<br>
&gt;&gt;&gt;&gt;&gt; hyperlaunch is specifically not this.<br>
&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt; Yes Hyperlaunch is more than this, however as I said, with=
 this RFC I would<br>
&gt;&gt;&gt;&gt; like<br>
&gt;&gt;&gt;&gt; to ear opinions, @Daniel @Christopher could it be a proper=
 name for the<br>
&gt;&gt;&gt;&gt; dom0less<br>
&gt;&gt;&gt;&gt; feature?<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; As Andy has alluded, hyperlaunch is meant to provide a flexibl=
e means to<br>
&gt;&gt;&gt; handle domain construction at boot to meet a wide range of pos=
sible use cases.<br>
&gt;&gt;&gt; One of those use cases is dom0less, so yes, ultimately what do=
m0less does<br>
&gt;&gt;&gt; today will be achievable under hyperlaunch. Our intended appro=
ach to align the<br>
&gt;&gt;&gt; two implementations is one that is meant to be minimally disru=
ptive, since<br>
&gt;&gt;&gt; dom0less is considered a supported (SUPPORT.md) capability. As=
 mentioned, we<br>
&gt;&gt;&gt; are greatly appreciative to the openness to adopt the name,<br=
>
&gt;&gt; <br>
&gt;&gt; Thanks Daniel!<br>
&gt;&gt; <br>
&gt;&gt; <br>
&gt;&gt;&gt; but a big concern<br>
&gt;&gt;&gt; I personally have is the confusion it could cause a general us=
er. A blanket<br>
&gt;&gt;&gt; rename would end up with two documents in the docs tree that p=
rovide two<br>
&gt;&gt;&gt; different explanations of hyperlaunch and two different device=
 tree<br>
&gt;&gt;&gt; definitions. So I think a more measured approach should be con=
sidered here.<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt; If this patch makes things more difficult for the Hyperlun=
ch serie, I=E2=80=99m ok<br>
&gt;&gt;&gt;&gt; to drop it,<br>
&gt;&gt;&gt;&gt; my only aim was just to find a less misleading name for th=
e feature.<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; What I would like to suggest as a good first step would be an =
update to the<br>
&gt;&gt;&gt; dom0less document. Provide a note at the beginning that points=
 to the<br>
&gt;&gt;&gt; hyperlaunch design doc as a more general approach that will ev=
entually subsume<br>
&gt;&gt;&gt; dom0less. This would provide a gentler transition for exist us=
ers of dom0less.<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; If it is not too much, I would also ask, please have a look at=
 the design for<br>
&gt;&gt;&gt; boot modules in the series Christopher just posted. The design=
 pulls from the<br>
&gt;&gt;&gt; work done by dom0less and expanded upon it. I major step into =
merging the two<br>
&gt;&gt;&gt; capabilities will be to have a common set of structures. Once =
those are in<br>
&gt;&gt;&gt; place, we can move to a common device tree representation, and=
 at that point<br>
&gt;&gt;&gt; we would be fairly close, if not at the point of a formal merg=
er of between<br>
&gt;&gt;&gt; the two.<br>
&gt;&gt; <br>
&gt;&gt; At the moment we have a concrete problem with explaining dom0less =
and<br>
&gt;&gt; hyperlaunch to potential new users. Using two different names for =
a<br>
&gt;&gt; similar feature on arm and x86 causes confusion. It is hurting Xen=
 as a<br>
&gt;&gt; solution. Personally I already had to switch to use the word<br>
&gt;&gt; &quot;hyperlaunch&quot; for everything in my users-facing presenta=
tions.<br>
&gt;&gt; <br>
&gt;&gt; At the summit, we discussed that it would be a good idea to use a =
single<br>
&gt;&gt; name to refer to both features on arm and x86. Given that &quot;do=
m0less&quot;<br>
&gt;&gt; causes additional issues because it makes people think that there =
is no<br>
&gt;&gt; Dom0, the suggestion was to use &quot;hyperlaunch&quot; to refer t=
o both features.<br>
&gt;&gt; <br>
&gt;&gt; We don&#39;t need to 100% align the two implementations and data s=
tructures.<br>
&gt;&gt; This is not for engineers that are going to look at the specificat=
ions<br>
&gt;&gt; and improve them. This is for users/customers of Xen that are tryi=
ng to<br>
&gt;&gt; understand what the hypervisor enables them to do. We need to be a=
ble to<br>
&gt;&gt; show users architecture slides with the same name and explanation =
on<br>
&gt;&gt; both ARM and x86.<br>
&gt;&gt; <br>
&gt;&gt; I am sure that Daniel and Christopher remember, but for the others=
 on<br>
&gt;&gt; this email thread, the name &quot;hyperlaunch&quot; was born exact=
ly to be that:<br>
&gt;&gt; the one name to cover both features on ARM and x86 even if they ha=
ve a<br>
&gt;&gt; different implementation. Appended an old email for reference.<br>
&gt;&gt; <br>
&gt;&gt; Also I agree with Daniel that we need to be careful about the two =
docs<br>
&gt;&gt; under docs/. I think he is right we need to add a paragraph explai=
ning<br>
&gt;&gt; the history and a pointer to the other document. Something like:<b=
r>
&gt;&gt; <br>
&gt;&gt; &quot;Dom0less is the name that was used when initially introducin=
g the<br>
&gt;&gt; feature on ARM. Then, the &quot;dom0less&quot; name was retired in=
 favor of<br>
&gt;&gt; &quot;hyperlaunch&quot; to avoid confusion (a Dom0 might still be =
present) and to<br>
&gt;&gt; align with x86 (where a similar feature was called hyperlaunch fro=
m the<br>
&gt;&gt; start).&quot;<br>
&gt; <br>
&gt; I=E2=80=99m fully ok to add a section like this pointing to the Hyperl=
aunch design.<br>
<br>
_If_ this text is added, please include links/references to the Hyperlaunch=
 wiki page and Hyperlaunch design docs.<br>
<br>
&gt; @Daniel and @Christopher would it be ok for you or the changes in the =
serie<br>
&gt; are going to be problematic for your future work? In the end it=E2=80=
=99s just a mechanical<br>
&gt; rename, so I guess we just need to agree on naming conventions.<br>
<br>
Please see the history of trademark litigation about the use of symbolic na=
mes to reference similar-but-different artifacts.=C2=A0 It is much easier t=
o use the same name to refer to entirely different objects. Historically, c=
onfusion arises when a name is used in similar contexts.<br>
<br>
There is also versioning.=C2=A0 Could we refer to dom0less as &quot;Hyperla=
unch Version -1&quot;? <br>
<br>
How about renaming dom0less to &quot;Hyperlaunch Lite&quot;?<br></blockquot=
e><div><br></div><div>Perhaps it would be helpful if you could explain more=
 clearly your concerns.=C2=A0 I take it that you want a name which can be u=
sed specifically to indicate the full &quot;domB measured boot&quot; functi=
onality that was Daniel and Christopher&#39;s original goal, and that you&#=
39;re afraid that using plain &quot;Hyperlaunch&quot; for only the &quot;st=
art VMs from Xen on boot&quot; functionality will dilute that?</div><div><b=
r></div><div><div>The &quot;start VMs from Xen on boot&quot; functionality =
is the *only* thing that a big chunk of the users of this functionality wan=
t;=C2=A0 referring to it as &quot;Hyperlaunch Lite&quot; or &quot;Hyperlaun=
ch -1&quot; will undermine the value of the functionality.</div></div><div>=
<br></div><div>What if we use &quot;Measured Hyperlaunch&quot;, or &quot;Hy=
perlaunch Measured Boot&quot; to refer to the full measured boot functional=
ity?</div><div><br></div><div>Or, &quot;Hyperlaunch DT&quot; for &quot;Boot=
ing VMs from Xen using Device Tree&quot; (without the involvement of a domB=
), &quot;Hyperlaunch Boot Domain / Hyperlaunch domB&quot; for a more genera=
l &quot;domB&quot; functionality, and &quot;Hyperlaunch Measured Boot&quot;=
 for the full functionality (assuming there&#39;s more to this than simply =
having a domB involved)?</div><div><br></div><div>=C2=A0-George</div><div><=
br></div><div><br></div><div>=C2=A0</div><blockquote class=3D"gmail_quote" =
style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa=
dding-left:1ex">
<br>
Rich<br>
<br>
&gt; Cheers,<br>
&gt; Luca<br>
&gt; <br>
&gt;&gt; <br>
&gt;&gt; <br>
&gt;&gt; ---<br>
&gt;&gt; <br>
&gt;&gt; Subject: [RFP] Overarching name for dom0less and DomB<br>
&gt;&gt; <br>
&gt;&gt; Greetings,<br>
&gt;&gt; <br>
&gt;&gt; At the DeviceTree/DomB meeting it was proposed that a new, larger<=
br>
&gt;&gt; overarching name under which DomB and dom0less would be covered. T=
here<br>
&gt;&gt; was a general openness to the idea. As such, since Christopher and=
<br>
&gt;&gt; myself are in the midst of finalizing the design document for DomB=
 we<br>
&gt;&gt; felt it might be better to see if a name could be selected which w=
e<br>
&gt;&gt; could use in the design doc in lieu of DomB. As always naming thin=
gs is<br>
&gt;&gt; hard, but after some brainstorming we believe we have arrived at a=
<br>
&gt;&gt; decent name, =CE=BCLaunch (micro-Launch or uLaunch).<br>
&gt;&gt; <br>
&gt;&gt; ---<br>
&gt;&gt; <br>
&gt;&gt; =CE=BCLaunch became hyperlaunch few days after, and the rest was h=
istory :-)<br>
&gt; <br>
&gt; <br>
</blockquote></div></div>

--000000000000df8c5505ffbe4238--


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 14:34:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 14:34:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559261.874094 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3a9-0008Uv-SS; Wed, 05 Jul 2023 14:34:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559261.874094; Wed, 05 Jul 2023 14:34:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3a9-0008Uo-Pc; Wed, 05 Jul 2023 14:34:13 +0000
Received: by outflank-mailman (input) for mailman id 559261;
 Wed, 05 Jul 2023 14:34:12 +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 <SRS0=dIgq=CX=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qH3a8-0008Ug-5L
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 14:34:12 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on20614.outbound.protection.outlook.com
 [2a01:111:f400:fe13::614])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 012152e3-1b41-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 16:34:10 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PR3PR04MB7353.eurprd04.prod.outlook.com (2603:10a6:102:82::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 14:34:08 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 14:34:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 012152e3-1b41-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JD8uP3gU71VYFsyPMVvLJcUcuJm3Y8+QBQkUtc1rswzqci+69m27qxBtDz57EMtqSBMAEnAoGIm7HyD713V6cV1Q1JERZPQFQ54rUHLRw4uh8due3to2M2ro7Mi3Ki/XVcA8hMl4NsWbNNpogaHCPqZTKdWJohWyMVSRPpH05AngGZnUHVR89dsCA3LyL4Wnx8lg1Q1rnQh1nW7ezcBBDvFPjYwH4qaae0Qg9pTo+GKrzWIGml5w5+W0Y8elF35YX/97I8eWZThT8uKqeA7/X4ynRHSXqOEZV3F41FZewYag3uMHTkgNyJAzL28vW0mfosu8dvcUMNSMfMbEC6QVCg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=gWh8In+Ih046tj4975K2wzNVkdfZjyhtOeWDXIutzX8=;
 b=WMUJ/JISw7MeoRiFGsoJlDFXsq+fEYv5GftnQFqCkkqvKtssHPFYppBXU5vm2301HOkzzEwqdzp9ueVAi0+uieAEQhkCGIz6Qjb159XP6ngKNUyCsWdrKtAOaaSjD4NPqVOejreQVX4wKvchRdjNan/tgbzv4Rx7aBj2EhWlLhMzADxboUDAgHWVbF95cy8QUs8iuDUxz1ZJY77LLj83rP+Ffn8J7+qAP8DG5YoUcZnjXL8IfQn0M6gtnDlKIJtpoNkwp2IsmD35NoQWHsYbMjPRZCJHicyGFWn2BPm9k7De9yUQkCDuBRRklrOaR21lFt9mzHdLQE1fuznptNYI2A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=gWh8In+Ih046tj4975K2wzNVkdfZjyhtOeWDXIutzX8=;
 b=UpzvqXeywLM9oTRZUa4bIFkOGwANbUnEligmeB27AZzhjO54EsMdf7EJCFZxRw+1l5GbJ0ZCyuQKBWHcr8tRERqmEmWjX7a5bHozGMNnP/25bXDMWYniV928POEM682ZMuYOpg7hEHOzggchKKmvBt3rp7yUZluxfnweyXzacq1RoIGi65h1Or/a4/MdYM4X+LB4KKdcERmmbBVSb58+1L2Z7sWF546eIgupnZgVTPt8Rx/JONAPaL3ypc45j7bXp/Qh572JKNwCBbFg6KmIvSjX7j684Q/6JO/qV+yAVrQL1Hbbo13IHzqvytzLMPxx0jk/S1WxqXyfFLSR+5zhdA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <b41c472e-48e9-ee6a-0f4d-f927801bb26e@suse.com>
Date: Wed, 5 Jul 2023 16:34:06 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v5 2/4] x86/microcode: Ignore microcode loading interface
 for revision = -1
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>
References: <20230629152656.12655-1-alejandro.vallejo@cloud.com>
 <20230629152656.12655-3-alejandro.vallejo@cloud.com>
 <d498ba69-564d-8232-5f5b-da52050772d8@citrix.com>
 <33af8ca2-dc65-0167-5569-c35744ea4f0d@suse.com>
 <ea4bb2c4-a099-0d89-9b9c-fe7ac8ffa0c2@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ea4bb2c4-a099-0d89-9b9c-fe7ac8ffa0c2@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0223.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ac::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PR3PR04MB7353:EE_
X-MS-Office365-Filtering-Correlation-Id: 3a0ca372-6620-4e6d-e641-08db7d64e45f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	6Xh8xbnaD6DRKjLJXzA4QDGLEA4hG7XkTzmOJeL8AWiBTsvhTSpT1qwhwQjCGjf6o5HGfkjsBE7+2uM+khqA0NWnSDCrIYamjWzD2CfWwzNfCIAV6EvSJscyEa8MvEevfSsOBG4K+ExrBgr6Y9aLtNHSOPh0A+o7MpNqhkiwSlTgk8EHgFD4iDSAYoGZyaRuXZz5MdhRa+KCgs9dpLiDnw5Ja8nqlo3JoHFCOFDIbMoLZfhYt06gMRGBTLFfhuw/pp9p3J3v02XXY/+dLrghJUNsk3gLiuQ49sPzpsIipZN+DUk6AbnYlkryEp4EOIDG3U19UUYXGQFUPaVIMJEUis+Rm0bdyYlHouM2EZJkXfFAhk1+FQm5UB8+kdlYNwWkJ2o6DZtSCeShWCWVsyoMdS272hQtLltQFfdOHa5OGuRAfvpl6eQjdhJl+0Bpzq9vaev8p1AVv49H5LMlFBHm4ZGc7wlTNvjrMkuecK/s77ixQLKlX1RMb8yWY/EnQrmDOwXXqmJ1uWS42n0dBxUIz5QQUFUw7zhvEELwzOFi0sJGKfJMJOF/0bN1fs2zOD2wqxNG0LC5FjgFtFJI8g6sEia3oAJeZw9rBiyar4byCuyS8Po9ehJuVEM+MxijTccwk+r6NE9rWGrgFQWUwvo5EA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(136003)(396003)(376002)(366004)(39860400002)(451199021)(54906003)(478600001)(6486002)(186003)(6506007)(26005)(53546011)(6512007)(2906002)(66946007)(316002)(41300700001)(66476007)(66556008)(6916009)(4326008)(8676002)(8936002)(5660300002)(38100700002)(86362001)(31696002)(2616005)(83380400001)(36756003)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UUM1V3BKUCtENFNBL3NzK0wxeFc0b0dqeW1qajk1TXhFQ2oreGE2VkxMc2FB?=
 =?utf-8?B?dGtJTWpSQnl1SnRlanpMVHR2bnh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B?YldqeHBobnA2ZVVLS0ZMNnFGQkJpbGk0MVpQSGoyMkx4djdXb0d1aExZbTF4?=
 =?utf-8?B?Y2hjKzFjS2VwTkc2djZnak90Z0EzWlYvcVNCODAzYnRTbUdqQTVheGFOQkp1?=
 =?utf-8?B?SXNXYzlJTjZia1JrSC9KTnprR3dxeE43M2YrWW1oR1owVmFyZ2F3ZUZpRDUx?=
 =?utf-8?B?WHBZTFk4d2dTZFVqQ0swUVpmbkR2WDVUeWpVNG1uVEcvVkRMSDRrK0Z1WFBT?=
 =?utf-8?B?QzF4R2dPcnpsa2dqWkZ4WmZlOUQ5WEFkZi9EcEVXbnJ1YzBvalFLYmIrbjYz?=
 =?utf-8?Q?en+0E3uhybFSLsC9iG/pAGKUP?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3a0ca372-6620-4e6d-e641-08db7d64e45f
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 14:34:08.5584
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 6PUUBScvYS/H83jeWNpUqVYIZ894gwIsAPbl/5IFQ2UEgZ2/FFT7T1dAL6MIitOBDn9xwGh48pDtpzx5mit7ew==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7353

On 05.07.2023 16:28, Andrew Cooper wrote:
> On 05/07/2023 3:24 pm, Jan Beulich wrote:
>> On 05.07.2023 16:13, Andrew Cooper wrote:
>>> On 29/06/2023 4:26 pm, Alejandro Vallejo wrote:
>>>> diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
>>>> index bec8b55db2..b620e3bfa6 100644
>>>> --- a/xen/arch/x86/cpu/microcode/core.c
>>>> +++ b/xen/arch/x86/cpu/microcode/core.c
>>>> @@ -867,10 +867,22 @@ int __init early_microcode_init(unsigned long *module_map,
>>>>          return -ENODEV;
>>>>      }
>>>>  
>>>> -    microcode_grab_module(module_map, mbi);
>>>> -
>>>>      ucode_ops.collect_cpu_info();
>>>>  
>>>> +    /*
>>>> +     * Some hypervisors deliberately report a microcode revision of -1 to
>>>> +     * mean that they will not accept microcode updates. We take the hint
>>>> +     * and ignore the microcode interface in that case.
>>>> +     */
>>>> +    if ( this_cpu(cpu_sig).rev == ~0 )
>>>> +    {
>>>> +        printk(XENLOG_WARNING "Microcode loading disabled\n");
>>> XENLOG_INFO "Found microcode revision ~0;Â  Disabling loading because of
>>> virt\n"
>>>
>>> It's normal (and not a warning) when running under other hypervisors,
>> Except that INFO won't be visible by default in release configurations.
> 
> Well that's not a bug with microcode then, is it...
> 
> I can't believe I'm having to say no to emitting messages at the wrong
> log level to work around a bug with selecting the default log level in
> the first place.

Hmm, I think not emitting info level messages is quite right. If I'm
not mistaken we emit various others at warning level to "account" for
this (you might instead call it "to work around this").

Furthermore, as to your suggestions here: What would you expect patch
4 to do? Emit yet another message, instead of having both conditions
fold to just one of them?

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 14:43:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 14:43:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559265.874105 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3jC-0001ZW-OU; Wed, 05 Jul 2023 14:43:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559265.874105; Wed, 05 Jul 2023 14:43:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3jC-0001ZP-Ku; Wed, 05 Jul 2023 14:43:34 +0000
Received: by outflank-mailman (input) for mailman id 559265;
 Wed, 05 Jul 2023 14:43:33 +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 <SRS0=dIgq=CX=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qH3jB-0001ZJ-C9
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 14:43:33 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on20606.outbound.protection.outlook.com
 [2a01:111:f400:fe16::606])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4ee4f756-1b42-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 16:43:30 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB7967.eurprd04.prod.outlook.com (2603:10a6:102:b8::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 14:43:27 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 14:43:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4ee4f756-1b42-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=nr+iubOFZXPHM4eMB0oJQfMX6qA/q+a7+RzyrIz/ZFJpBnvIir2BvUwTpcjq1MLZRfzcMVpfgdQjBMxLtqTtKR7IeD1Ajzz94FA44OC9AvcOmj0Nks+s7nLMpzpyIPrwUv3Rj+ick5fVk/zT7QMDC6Zx8qiBe3c1eUyo4IQtg6JtkryemMGViFs23eK4aaOUeiQbw9tl0Wa4+NtCNA0yPVPm0pcQYh41Fgmv+0S/Zk2NDDiigQXKiYEjYVTDIg41Subs7JBGU1ehxZic2qQusu084FA1oU5Kn/2ARxLCBYbBz0kg7oN/wug2aIS6ccFDlCO08JHLlU3wTZosXvfG4w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=llJw1VTo2PuTW6gZLgumHh6+pa58Vf1JrRg2NdUcPQU=;
 b=MYZOwvxVseDBehtNl6F4mQeOFmInpyfyhILpYLhTi/gOpl9GJHaQa24LBDKBOQ37gJlktr5KpPJ+OBNQgZvGF3Jjv9v2EYZGp3cnFqWog6qy2X9HEAuExN+LoWFqtYhSqaMbjKpRJvCipnm7WkpvUNBtd/HwHL9dWGYA/bl7XoMZLwqKxo7Kln4GRnZ59q35qHZQijWMa1IGiEdZc/TchqJKOWP2Ea9g8zyiaf0ZBru9GW+nfDLEMy3stZk//GVxk9aAJyvvePB+fAidCiD0XYx4zX3egSBiNFr3LGjame/iw8reSy8aol8tJMYiCE3pjMsqxi0D/+5o1lEe7uTTfw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=llJw1VTo2PuTW6gZLgumHh6+pa58Vf1JrRg2NdUcPQU=;
 b=lFXC7TT8iRwgcUft7J5kvO4X9y+bkXdYYZ9OwJJuTe0JetRLLJQbBwPuzcpNdVYLGuxpQiatORVXrXFIdLrg8VgZlQHOAljp+MONQQftzJJvYfBvGOWpmLmmE4kNgf/PTRVeSl64um9lgYp5g6WdbrnFv1MPDZfNVoGRaEFKR2ETbTViVyrPw9cYgFlj5pJt/pEwn6seZALAifqz4+M9PXfkJMKNQITpwYLiMq7vD26IYV8kVeRZx6ijPXjL1QuRQxjnMoqHN0yQpHxDXBQdevaUcpKF9rrhgj8yTrEhvE3aUsX+wNvqNxW8L5kOjRIasLNtnrog8YA/TDhXsc0ZnA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <59e4faa6-7b1c-7d48-64d5-925a618c43da@suse.com>
Date: Wed, 5 Jul 2023 16:43:25 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>,
 Julien Grall <julien@xen.org>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] xenstore: talloc.h needs to include stdarg.h
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0003.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:15::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB7967:EE_
X-MS-Office365-Filtering-Correlation-Id: b5a28559-6b68-4a46-115b-08db7d663162
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	wSbYCCO+3ufmRMzzJYQmIL5TdV0X0gMYjS61auaR2pymrbcIvdE0zrtlfb1j68+Pb1iLQop3BeGb0khcjlyywt4NU3NQk2stKdELgILtEGJ3n5peS+VjXaNeF8iLmkkBsuEtUtoYocoQwhJKl0fVNKDNqpsaelqGgGA9QuuU46RAVw+10NMLp6d3xj8RiltmBvUiZJgndrPMSzdCsRZMQA4Y6Vapkqm7XNlEXjNsOWcbFZEgLT0Bs3QuBcmA2Udh8aSpdMD4bXezwcx9Ci1i6gajTvOKXmtWQPO7O8P+hjPT590TR4TX39rIAwqzMD4yZqC8aREprJpRbepj77mlvUA+E+I59JUz4FEzFpA4ZRnm6D74RAXlW87U4CsRLEvX1agta2ljMPCsBbwguPnKping6oQVSEMe7q9iY6I3/C5vWnPyw0wKPPGHBZOX3WraH03tMqrRrKuz8vIfc++2b8GJrxrRee3n3Cb8N9m2NW4u11bm2xTkq/KXvU4S3lmOtvSsRpVk/xE3j56OP4cdCmy0oKI2xQ6tAgxHYhX+ck5hQ0HZ5N+v7f829eizVdJaS8Fb+EDWADsHwYsihbtWq51HT8vgqtSLpWQevd+9HT0sgU4s5fGIw88lmoKDWAVctKnqoDu25poPA00IaAGt7A==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(39860400002)(136003)(376002)(366004)(451199021)(36756003)(31686004)(86362001)(4744005)(31696002)(2906002)(5660300002)(6512007)(186003)(83380400001)(6506007)(26005)(6486002)(54906003)(6916009)(66946007)(66556008)(66476007)(38100700002)(4326008)(2616005)(316002)(8676002)(478600001)(8936002)(41300700001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bVJiYWQ2d3IvV3lYcVpQNnQ4TjhoOEhuYlJNVWRSMmZibjhXeWtQakUzNWVl?=
 =?utf-8?B?WlNuL3dWYzZzdDdrQ25QR1YveVFQeVpYK1owZ2FaWWV1cnVPdFU1THhOSzlz?=
 =?utf-8?B?WnZqNGI4cjRCeEtSL0QyYUJmWnVVekFLa0h2K3IwT2F0UzBYYnZHaWVVUk1U?=
 =?utf-8?B?TENVaEFQY3hBSDQvbHJmRTY3VldYN3I4RkRFMHo2Y2xzcVd5Vzgxbmo0Zkha?=
 =?utf-8?B?eGJGSVBiaGI1U3kyV25KYkVaMUhGM1JEM0dqV3lRV2dlUy93NlFDcGNZZCtm?=
 =?utf-8?B?bG5YS3NFanV6SEcwbmJERzhDQ1pYWEhIWVY2dzNwN00vbm1kcVIwVnNqNjdx?=
 =?utf-8?B?Q2xiSU8xVGpOeGgzbmJ2Z1ZjZ0xpb0pESEVIMisrOU52OXdoeElHZE01c3lK?=
 =?utf-8?B?RlJlRXdUcWhkWmZNeEh5TzNEMjdiQ3k1L3VXN2gvSURBQkQ5L3FLODd2QTJk?=
 =?utf-8?B?cUNlWk9GYVUybmxlcE9qc0dvY3QwUjVsaldBUjY2azlUZXRPdVJ6MTFkcU50?=
 =?utf-8?B?bmc0NWw4SUNmUDA2UHZJYmhaMVJyUjZpVGw3cFhldVFjTlhXNFRqd0ZqRVE3?=
 =?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VlGL0hFQUxpR215MDU4T3hkL3pmK2hXTUpEbjZuYXhlamZyVUgvZkxF?=
 =?utf-8?B?eW9Zd1JwdGpOMG9TSGdrRlFCR2w1ZExiR3MwL1Exa1NkemE3YnFCZXgwWG9U?=
 =?utf-8?B?ODVnUkpYL1BLWGYzUmRxeXF6em5lRzZ2OU9ZTGpQUzBieUlKemtFTmtTWko1?=
 =?utf-8?B?cysxaDdmU2xnV3BqQXJEY2NkL0NjU1I4UmtDcWkvOHo3SWNtVmJtMWt6Njlx?=
 =?utf-8?B?bUUwWW9JbWRxOS91dWJoUW5yREVyeURWbEhaSzY1U3RqK0VyN2tERk40MHcr?=
 =?utf-8?B?UHA0RXNxYXF0OHlUaEtvcW1XWDlSeThGQURPbW9pQzZKdGNoZmkyTGk0VDBE?=
 =?utf-8?B?czZUbGNnNlg3Q1JyOFRrUFNVM0YwTXNTUjVMMXJkWkpzdE12dnovcUp6MVVW?=
 =?utf-8?B?OWRDUHhNdG5wSnhQRUtYVkVWenZRT2FvT1FTdXRoT09xMEtocVo5R085M0l2?=
 =?utf-8?B?MjJGNlh0cGN4WTBrcjZQOVNRZnUxaCtGMnM4SkVIcTBRL04ydTdOcmNiWEtt?=
 =?utf-8?B?alRMbkV3aXU2T0JTVzQ2T09iUmlDa3V1YUNHeG0wQXJjdFdTcHZnYUJPQjdI?=
 =?utf-8?B?TzJvZ1NaQUpFczNhOWF4Tkduempyb1B1ckZNNU1MZG0vSzM1K0U1UGhma2to?=
 =?utf-8?Q?GbLYcuL9tBwA9n8xG6SyvQF66?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b5a28559-6b68-4a46-115b-08db7d663162
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 14:43:27.3324
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: vX1+nrN382/BlIFvoynARsZCljfcPsZl993xLS3OFt6IZwCeusRgwV7njngI8/m6hWDhr8BSpc/ZkpK7VVXoLg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7967

talloc_vasprintf() has a va_list type parameter, so this type needs to
be defined (independent of the particular libc implementation).

Fixes: 63b6419d2a2d ("tools/xenstore: split out rest of live update control code")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
The Fixes: tag is largely a guess; I did not verify whether any other of
the recent changes would also play into this.

--- a/tools/xenstore/talloc.h
+++ b/tools/xenstore/talloc.h
@@ -24,6 +24,7 @@
    License along with this library; If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include <stdarg.h>
 #include <sys/types.h>
 
 #include "utils.h"


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 14:45:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 14:45:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559269.874115 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3kf-00026i-23; Wed, 05 Jul 2023 14:45:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559269.874115; Wed, 05 Jul 2023 14:45:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3ke-00026b-VN; Wed, 05 Jul 2023 14:45:04 +0000
Received: by outflank-mailman (input) for mailman id 559269;
 Wed, 05 Jul 2023 14:45:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qH3kd-00026E-6S; Wed, 05 Jul 2023 14:45:03 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qH3kc-0002BG-Vz; Wed, 05 Jul 2023 14:45:02 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qH3kc-0007lM-Jm; Wed, 05 Jul 2023 14:45:02 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qH3kc-0005x3-JO; Wed, 05 Jul 2023 14:45:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=v1zcKeyKSihIVK/xf+6HzIBn2T9YKFqjQS+mjU9g55Q=; b=IEwiZwvnVyxzhuSevIHDT8lWpL
	DKUKbu3hxrnPuKoFYRvhhYgEYjXA9W5V6kWea8cR0PBW/MuZnMLpl5AAjOeP0kIFHbY63+KE6qMib
	A0TdksITpT+cMMG2e5kdMlRGLZ5cZ7cykbWiKIlTaV8oG9sR2AdgmSkJj9h/KJB+BMWk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181704-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181704: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=c2ff2ca3a9dd60e1fb7d6c252be5cb1865952fda
X-Osstest-Versions-That:
    xen=5c02dbd0e0adbe6100128345328999876fc78d00
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 05 Jul 2023 14:45:02 +0000

flight 181704 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181704/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  c2ff2ca3a9dd60e1fb7d6c252be5cb1865952fda
baseline version:
 xen                  5c02dbd0e0adbe6100128345328999876fc78d00

Last test of basis   181701  2023-07-05 07:01:53 Z    0 days
Testing same since   181704  2023-07-05 10:03:34 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Rahul Singh <rahul.singh@arm.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   5c02dbd0e0..c2ff2ca3a9  c2ff2ca3a9dd60e1fb7d6c252be5cb1865952fda -> smoke


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 14:45:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 14:45:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559271.874118 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3kf-00028V-93; Wed, 05 Jul 2023 14:45:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559271.874118; Wed, 05 Jul 2023 14:45:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3kf-00028F-5o; Wed, 05 Jul 2023 14:45:05 +0000
Received: by outflank-mailman (input) for mailman id 559271;
 Wed, 05 Jul 2023 14:45:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=dIgq=CX=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qH3kd-00026F-Cj
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 14:45:03 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on2060f.outbound.protection.outlook.com
 [2a01:111:f400:fe16::60f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 84f8baaa-1b42-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 16:45:02 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB7967.eurprd04.prod.outlook.com (2603:10a6:102:b8::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 14:44:59 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 14:44:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 84f8baaa-1b42-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=mglIsDgYji/n0RIRgu1L0gEW+VVH2FhDxgsKfCC5bcWQW1tvwFldtTlxBYyMxRuD2kaclPNqUSO9W7Qzl+GPPCny60YKKrPkaia80YVh5Ak0wJiaJUGtMBWRYsCtYSifV9+zrc6GPtAFxQvOX7L7/VlJ9i1l1t1ZrljqXKDSTecZMWBZFCnFyxxZ7WZFp4qQMjlrcMrV87e8F4hX21jCZL+Lf6JNYOk+kR7bCYHlt7hb0rimig3KFHErJXexWQs8NKFzkR1P3+NG2mA6NTo2weMQ36fdI6spfYLDw7lB53yrPHfDPTzCE504sBmMlX4ZJy4cmGFOnSjEj9Kw6mud/g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ko37wEC+VNTFnAWzbH9mATLPo7l3CEHB83K3DoPeiFQ=;
 b=MSHTicFmqe8N2foVuMDm30CAms3zIGHRo1ZihgkuNzFzwQRmuULG39TODEv+/QxUqE8sZnGfJEWFBJ5SbayWCYoqwklMCjZO16nnav6os9RMO32KhXfGZaGOeBQx991KsxqGM9TN6VcyuVcBrsx1bRIrYSLdAFIOgiB3hcFu4vlN1EObc1VU5eys8wQkYgdv+C/OdPcoPSfrpXpJOWndJ5eo+4X86d7cawOuoDRbfVFz9zvatxRiHZSqOJG60k/bopiB/5N6Jpex4LTR+3ApRfAh80Kysp/wIQBbn/SqvDG64McOOnaxTQhiaLlodY4FCsFNK/PuFrD4sAURZt9Xxw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ko37wEC+VNTFnAWzbH9mATLPo7l3CEHB83K3DoPeiFQ=;
 b=MuVsoCvFbwvwGCi0JyESlIJfbxMO71AZN9PQaiTnF7Wzm2qOwYSzFqydnVw2JcTJbJWaIeW8H2geZ6yj3Gs+QnBSVcU5w9aUF1Ga9jwMpY4OEJXdSBN9PL9V3WnA74Eo/QBXQBD9Uw4gTjF/ZWMCMD3ku1GHzxF+dCi4JXzx8is7wuhht3Bln+BfRx7+Ea05hxhqPaEQGR+xWb711nCXZz/c5orq2eRNXPrTERPY6UhLE+zOD4S25sKboQEaREnngEQx5mYyX8IoSBGkyt5HP4WRWR+SI1Wz5gu2tdGr7EEFXDSi+/3Wvuk2WCUJHTHW9KoM0bI83ALyf47bj5m82A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <f56a208f-97d1-b7ec-afad-3b7bc180cf87@suse.com>
Date: Wed, 5 Jul 2023 16:44:57 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Shawn Anastasio <sanastasio@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] ppc: make also linking work with big-endian tool chain
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0137.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9e::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB7967:EE_
X-MS-Office365-Filtering-Correlation-Id: ef22a4c8-ca9d-4fe3-150a-08db7d66684b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	p9EMgO487SrY+cKic1g7DlWjmGYuRq3Yjql60AJKIrj7ihBqDdFIUxt5cWdsdWBCmgGlGEUiVrS0QBlZS2tI5RGihxlvGWVElvuPJfQ4R2crF/vKLEOj0cFS+lZjNE02ldyVPqQ3JnyJ37aRUPrwrU0af4gZrPMlQn+Rv2vfsgFjP6DXwyYiPazYqTDslH6GtZd2iItFCt2WJm5JU8gYpz/CGRWMq+wJhN/w6kk5uFdzZc5Cg7FpZ/Kch7+Kq8YRNffiVK1Cv0V0jSnH0HdzBOW+CrKXiD7xol1UFLZScYy4V3+ekYJhwXwaGZvIDqk/dVVdIV9gqc3IlOxUWQnF20X4Xv9a677EsoXAQEttukEVE1BiTB7/6o62HQHpxob2ml08mPS3jmWVLDtZHAUSRYhX7RELqL4Y0eq3HCIKTrCLNR8sY6V+DR7p351r99O8mpPxPoyH2Ko02tirw98FafS1LewTvEp3ZsWJYwpRl1CnQ9lRkx9vn/ldunK1rCc4lleiu+PHwb4iavU+06sL4+0XmkZ2Sdnw+YRJXXLNjbZ+Ds/4R177QpudcHaXAQ5JipBhRnliLMGdxZv2K9SIo0NrE7k2ntXgCVenhoyyW3AIV3b5itJRQ20JSRDRw7/B6KeKp8T6xnNYc9NYCoxweQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(39860400002)(136003)(376002)(366004)(451199021)(36756003)(31686004)(86362001)(4744005)(31696002)(2906002)(5660300002)(6512007)(186003)(6506007)(26005)(6486002)(6916009)(66946007)(66556008)(66476007)(38100700002)(4326008)(2616005)(316002)(8676002)(478600001)(8936002)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yS0dYeEc4aVFCUUp4SjdO?=
 =?utf-8?B?OUJDMlR6WUFzNFlSVEUwbU1aaFFPeGgrSkFwZWtsSU9pRnFZOG0rTjNJQmdY?=
 =?utf-8?B?UTBHNkhvNDgyYjdDUWdSa1RWOU5vQWtOWUdyWUVwb2FXakhDdXl6b1pBTW1j?=
 =?utf-8?B?OXlCaHZVTGFoZ0Q5L29ic1QwV1l3NUdpT0U1SG5hUTBWeWlyK2doVG9MeHl4?=
 =?utf-8?B?RFIreWpzMHpHWkZMSHd5YjNWMStnQVNFdXZnU0lSdW5KeTBDNkN2aHpsZ2ZZ?=
 =?utf-8?B?NmF5RGlLbk9VTnlYRGVmY2wrektQU0s5SUxxSDZscXNhNENVWXMyWVo0MzFR?=
 =?utf-8?B?blJIMEdjakpaYzJWYTZldmRZTFI0UzRpeDNoUC9RUlBoUVBPOHk4T3dnUUpi?=
 =?utf-8?B?YzVjRjZYM3h6VkxjRDZkSldQaTQxQTYrUGk1WDVHRE9OdDEzNkI3TWh4bDFC?=
 =?utf-8?Q?OB5+C8uqPYL8DAXgfJo+YEncx?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ef22a4c8-ca9d-4fe3-150a-08db7d66684b
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 14:44:59.4832
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: KyW6un+OWSUdhRIP+trCnl+2Kk0FVNjTvXFWMVie2tULNxihFP3DqQYOEYuIZImhTKmn+UoK9kcTYwHCYcAhag==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7967

Telling just the compiler to produce little-endian objects isn't enough.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/ppc/arch.mk
+++ b/xen/arch/ppc/arch.mk
@@ -7,6 +7,8 @@ ppc-march-$(CONFIG_POWER_ISA_3_00) := po
 CFLAGS += -m64 -mlittle-endian -mcpu=$(ppc-march-y)
 CFLAGS += -mstrict-align -mcmodel=large -mabi=elfv2 -mno-altivec -mno-vsx
 
+LDFLAGS += -m elf64lppc
+
 # TODO: Drop override when more of the build is working
 override ALL_OBJS-y = arch/$(SRCARCH)/built_in.o
 override ALL_LIBS-y =


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 14:46:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 14:46:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559281.874136 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3mI-0003In-SV; Wed, 05 Jul 2023 14:46:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559281.874136; Wed, 05 Jul 2023 14:46:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH3mI-0003Ig-My; Wed, 05 Jul 2023 14:46:46 +0000
Received: by outflank-mailman (input) for mailman id 559281;
 Wed, 05 Jul 2023 14:46:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qH3mH-0003IS-HQ; Wed, 05 Jul 2023 14:46:45 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qH3mH-0002EM-GM; Wed, 05 Jul 2023 14:46:45 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qH3mH-0007n6-1e; Wed, 05 Jul 2023 14:46:45 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qH3mH-0006F3-1E; Wed, 05 Jul 2023 14:46:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=F9LoW0gBMKtN3qK0pbTK8hMQF+yIU5l4J6BGj4GkSbI=; b=rTNvtG374MdQvJxSBQ4cMXW7Ql
	r0zEw0rKj+z0x8YuzW2Ij/PmpClCTA5sR3yGz1oA2dj1BXmaICshhhAT9gdnS/T9m8+2le+IkSXTS
	Cp6Cn8rK4F5iJ6j0Hlfbo7nQSMlpMPpwd8WEuo6Yp7L19x4IrDRLpccVL8Vlw6LhIMlw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181705-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181705: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=af8859bce2ffa8d72d8fb30149a0ef6423a8cc47
X-Osstest-Versions-That:
    ovmf=1fadd18d0c0c65ffde9e128a486414ba43b3387c
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 05 Jul 2023 14:46:45 +0000

flight 181705 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181705/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 af8859bce2ffa8d72d8fb30149a0ef6423a8cc47
baseline version:
 ovmf                 1fadd18d0c0c65ffde9e128a486414ba43b3387c

Last test of basis   181702  2023-07-05 07:40:44 Z    0 days
Testing same since   181705  2023-07-05 10:10:39 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Gerd Hoffmann <kraxel@redhat.com>
  Yi Li <yi1.li@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   1fadd18d0c..af8859bce2  af8859bce2ffa8d72d8fb30149a0ef6423a8cc47 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:04:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:04:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559289.874154 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH43o-00064c-GC; Wed, 05 Jul 2023 15:04:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559289.874154; Wed, 05 Jul 2023 15:04:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH43o-00064V-DI; Wed, 05 Jul 2023 15:04:52 +0000
Received: by outflank-mailman (input) for mailman id 559289;
 Wed, 05 Jul 2023 15:04:51 +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
 <SRS0=Ax/R=CX=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qH43n-0005mH-KJ
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:04:51 +0000
Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com
 [2a00:1450:4864:20::631])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 49a9f1a3-1b45-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 17:04:49 +0200 (CEST)
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-992af8b3b1bso772883466b.1
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 08:04:49 -0700 (PDT)
Received: from EMEAENGAAD19049. (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 sb23-20020a170906edd700b0098d486d2bdfsm15008140ejb.177.2023.07.05.08.04.48
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jul 2023 08:04:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 49a9f1a3-1b45-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1688569489; x=1691161489;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=TSGMFxZjABZHJWtgyG5iqDKIZ/mAJXJlcxIhd/A4F9o=;
        b=jgpSXnoFQzRGOV7f5NZZGnVz2dZkjslbKHu8CYgx08M0WwbXVrkyEctkvQ80kzLl+4
         9oRO7O011UV5yt6xpbJ8/zg11FMT7FgLydGYg2OffcUBcYdCOyaD54lp8Si9L9znd5Yl
         z10wjtwWHfIL35pCDvQ4ue8fBCddxJcn5tbwA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688569489; x=1691161489;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=TSGMFxZjABZHJWtgyG5iqDKIZ/mAJXJlcxIhd/A4F9o=;
        b=DpJ8ttuKFdaEfPxJHCXwwSCuxPcHZbbdHAeUGf6DPL/WCAHnJtppPWv8ZIisrsB2DW
         FZVFi/MYUbo5RE9Sj9PPUG/oOpMKyaIxxOAtjY9lCTpFUVc9/oHBN8mk2lK9qzY7lL8v
         wdehN7RAyXJ2RezeOh6PgT1VwAw6dn9IrXGe4TdB6NM6TNiGmF/3xewIoYCztGJY2yb8
         JZSjF09mucHgH/kRloULLsFYKIYMsDzpaCpQKaE6DcU/n9PCxi5m0X4cei/iDtGjMMnz
         QXisoqNVgdiRbNqbjlqkGIhIekCnv6FXtj+NxqPEAhgaPal7XuuDDIR5dDffT5V3gqpr
         zepQ==
X-Gm-Message-State: ABy/qLaf/SiXSzoDIwjXDk6pc9wyAXuTi2Ke24L/6PQM/X74hPmEmBxi
	kOw/ts6XkrVRJ4Gu0kgKzlyFog==
X-Google-Smtp-Source: ACHHUZ6/mnH280tPlNQIa4Skr9UhUtI23S9wXMl8KmyzBrsvhUSYFzzWzoCACyGv5VfE62858cIBWw==
X-Received: by 2002:a17:906:bcc1:b0:98e:1deb:caf8 with SMTP id lw1-20020a170906bcc100b0098e1debcaf8mr12971061ejb.57.1688569489471;
        Wed, 05 Jul 2023 08:04:49 -0700 (PDT)
Message-ID: <64a58691.170a0220.ef84.9a1c@mx.google.com>
X-Google-Original-Message-ID: <ZKWGjzqiE7UbTeCv@EMEAENGAAD19049.>
Date: Wed, 5 Jul 2023 16:04:47 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v5 4/4] x86/microcode: Disable microcode update handler
 if DIS_MCU_UPDATE is set
References: <20230629152656.12655-1-alejandro.vallejo@cloud.com>
 <20230629152656.12655-5-alejandro.vallejo@cloud.com>
 <1c9fe38e-d8aa-21fb-8dbe-4c54385b5a67@suse.com>
 <64a57820.170a0220.9a035.9a30@mx.google.com>
 <b5d551ed-6523-0ead-9c83-a7fae10eee67@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <b5d551ed-6523-0ead-9c83-a7fae10eee67@suse.com>

On Wed, Jul 05, 2023 at 04:30:02PM +0200, Jan Beulich wrote:
> (maybe with an adjustment to the comment, as mentioned in the
> earlier reply)
> 
> Jan
Yes, that sounds good to me. Thanks.

Alejandro


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:04:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:04:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559288.874145 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH43U-0005mU-8W; Wed, 05 Jul 2023 15:04:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559288.874145; Wed, 05 Jul 2023 15:04:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH43U-0005mN-5g; Wed, 05 Jul 2023 15:04:32 +0000
Received: by outflank-mailman (input) for mailman id 559288;
 Wed, 05 Jul 2023 15:04:31 +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 <SRS0=jglA=CX=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qH43S-0005mH-V0
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:04:30 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3d197db2-1b45-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 17:04:28 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 4E8591FDE2;
 Wed,  5 Jul 2023 15:04:28 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2832A13460;
 Wed,  5 Jul 2023 15:04:28 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 9ZBTCHyGpWQJIAAAMHmgww
 (envelope-from <jgross@suse.com>); Wed, 05 Jul 2023 15:04:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3d197db2-1b45-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688569468; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=g0dmMJQsqoya/TV3q7sSSRkGaTzLfyltNziN/hBy/s8=;
	b=Os12Qvygz9VCRh7g1Ee9ky1kh7C1ZjTciwVif90fvNwfVFQqW6WHB9R6TyewFcyz2FNYD1
	7ddt9qwWly5u/08aCPc/4WX9Gw9ItTcPD3VNS/KkW7yl7u+trkiyRsuxfhMAkSlB6qigbs
	2eXa4iQKv7lnDsBGwm/4vox5KaJlrkw=
Message-ID: <1c48639d-1ad9-7de4-1f0d-818a8b4fd8ec@suse.com>
Date: Wed, 5 Jul 2023 17:04:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH] xenstore: talloc.h needs to include stdarg.h
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Wei Liu <wl@xen.org>, Julien Grall <julien@xen.org>
References: <59e4faa6-7b1c-7d48-64d5-925a618c43da@suse.com>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <59e4faa6-7b1c-7d48-64d5-925a618c43da@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------uW0H6Hu0mAfhbgO00gboWtr1"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------uW0H6Hu0mAfhbgO00gboWtr1
Content-Type: multipart/mixed; boundary="------------vYF7q2nIe4xF0O99FbqXeJRx";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Wei Liu <wl@xen.org>, Julien Grall <julien@xen.org>
Message-ID: <1c48639d-1ad9-7de4-1f0d-818a8b4fd8ec@suse.com>
Subject: Re: [PATCH] xenstore: talloc.h needs to include stdarg.h
References: <59e4faa6-7b1c-7d48-64d5-925a618c43da@suse.com>
In-Reply-To: <59e4faa6-7b1c-7d48-64d5-925a618c43da@suse.com>

--------------vYF7q2nIe4xF0O99FbqXeJRx
Content-Type: multipart/mixed; boundary="------------62yzmAXtxC6ROkb2KX0RNHt9"

--------------62yzmAXtxC6ROkb2KX0RNHt9
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMDUuMDcuMjMgMTY6NDMsIEphbiBCZXVsaWNoIHdyb3RlOg0KPiB0YWxsb2NfdmFzcHJp
bnRmKCkgaGFzIGEgdmFfbGlzdCB0eXBlIHBhcmFtZXRlciwgc28gdGhpcyB0eXBlIG5lZWRz
IHRvDQo+IGJlIGRlZmluZWQgKGluZGVwZW5kZW50IG9mIHRoZSBwYXJ0aWN1bGFyIGxpYmMg
aW1wbGVtZW50YXRpb24pLg0KPiANCj4gRml4ZXM6IDYzYjY0MTlkMmEyZCAoInRvb2xzL3hl
bnN0b3JlOiBzcGxpdCBvdXQgcmVzdCBvZiBsaXZlIHVwZGF0ZSBjb250cm9sIGNvZGUiKQ0K
PiBTaWduZWQtb2ZmLWJ5OiBKYW4gQmV1bGljaCA8amJldWxpY2hAc3VzZS5jb20+DQoNClJl
dmlld2VkLWJ5OiBKdWVyZ2VuIEdyb3NzIDxqZ3Jvc3NAc3VzZS5jb20+DQoNCg0KSnVlcmdl
bg0KDQo=
--------------62yzmAXtxC6ROkb2KX0RNHt9
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mE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ugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------62yzmAXtxC6ROkb2KX0RNHt9--

--------------vYF7q2nIe4xF0O99FbqXeJRx--

--------------uW0H6Hu0mAfhbgO00gboWtr1
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSlhnsFAwAAAAAACgkQsN6d1ii/Ey/s
tQf8DZw5LAKp4/Vl2pjhze2CPnUipKMHNKk4bDTH0qYBk3CEy1MqKLWe7DSiwFThmBcUWe6IRyxR
xJZm6eC+qmtlOUqCDE4ISGzKeIbEFuX5ZyAR2+Petzz3J2yjMZY0j1ZeSKYUgfBH7zdnvhLLWJoa
CtZpF3W5HWwjdpHuK19A1IncDb+I05EywqUiF4cVVgTMZQkApyUtLAwDUMH5mAXPZGZTogxWwcPM
1SAaJZvbTqdunNL4tWAi2yVdyRAd/55eiTbeuet2aWt/kwnN/f77Ji39EWwJcT3wQq8ViFVU2Emj
olegkT/PpE51sivd4IY3TozgB5nmL6SSvaemhz5K8w==
=O6YN
-----END PGP SIGNATURE-----

--------------uW0H6Hu0mAfhbgO00gboWtr1--


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:10:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:10:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559295.874165 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH48x-0007n4-4n; Wed, 05 Jul 2023 15:10:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559295.874165; Wed, 05 Jul 2023 15:10:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH48x-0007mx-1V; Wed, 05 Jul 2023 15:10:11 +0000
Received: by outflank-mailman (input) for mailman id 559295;
 Wed, 05 Jul 2023 15:10:10 +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
 <SRS0=Yom7=CX=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qH48w-0007mr-A1
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:10:10 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0600d908-1b46-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 17:10:07 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 32B438285804;
 Wed,  5 Jul 2023 10:10:05 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id RYmcS1xxnvJl; Wed,  5 Jul 2023 10:10:03 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id D9DA18285880;
 Wed,  5 Jul 2023 10:10:03 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id kT4MQj9Us6Z8; Wed,  5 Jul 2023 10:10:03 -0500 (CDT)
Received: from [10.11.0.2] (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 9686A8285804;
 Wed,  5 Jul 2023 10:10:03 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0600d908-1b46-11ee-8611-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com D9DA18285880
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1688569803; bh=y3GXWOyjTGt1PcKeTkzWiswVTfpkERibBOjx7VBKEx8=;
	h=Message-ID:Date:MIME-Version:To:From;
	b=V5igoIOukjWAaC+jBVy8Agzp5Z/nZNTh0q1kqwEKe1Fsa7zszktYcc8vHQZSsKTIE
	 AvKPKhJ20A27FbvfoiRvcMvplo5R+ypkYK7hxXXoTJ+n+kyOuGzhn67MNqpToCjk3Q
	 oVlC0m69UaLQCsrRSpKqpIGena6NG6rEvOjrmfPw=
X-Virus-Scanned: amavisd-new at rptsys.com
Message-ID: <4725795c-3f0e-af91-5683-1059ba6163c9@raptorengineering.com>
Date: Wed, 5 Jul 2023 10:10:03 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH] ppc: make also linking work with big-endian tool chain
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <f56a208f-97d1-b7ec-afad-3b7bc180cf87@suse.com>
From: Shawn Anastasio <sanastasio@raptorengineering.com>
In-Reply-To: <f56a208f-97d1-b7ec-afad-3b7bc180cf87@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 7/5/23 9:44 AM, Jan Beulich wrote:
> Telling just the compiler to produce little-endian objects isn't enough.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/arch/ppc/arch.mk
> +++ b/xen/arch/ppc/arch.mk
> @@ -7,6 +7,8 @@ ppc-march-$(CONFIG_POWER_ISA_3_00) := po
>  CFLAGS += -m64 -mlittle-endian -mcpu=$(ppc-march-y)
>  CFLAGS += -mstrict-align -mcmodel=large -mabi=elfv2 -mno-altivec -mno-vsx
>  
> +LDFLAGS += -m elf64lppc

Looking around, it seems GNU ld also has a -EL flag:

  -EL Link little-endian objects.  This affects the default output format.

Linux's build system passes both -EL and -m elf64lppc, though I'm
wondering if -EL alone would be enough.

In any case, this doesn't break the build with my ppc64le toolchain, so
if this fixes issues you're seeing with BE toolchains then it's fine
with me.

>  # TODO: Drop override when more of the build is working
>  override ALL_OBJS-y = arch/$(SRCARCH)/built_in.o
>  override ALL_LIBS-y =

Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:19:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:19:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559299.874175 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4Hv-0008Qm-R4; Wed, 05 Jul 2023 15:19:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559299.874175; Wed, 05 Jul 2023 15:19:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4Hv-0008Qf-OO; Wed, 05 Jul 2023 15:19:27 +0000
Received: by outflank-mailman (input) for mailman id 559299;
 Wed, 05 Jul 2023 15:19:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xpdo=CX=gmail.com=bart.vanassche@srs-se1.protection.inumbo.net>)
 id 1qH4Hu-0008Q7-NA
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:19:26 +0000
Received: from mail-io1-f42.google.com (mail-io1-f42.google.com
 [209.85.166.42]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5325d743-1b47-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 17:19:25 +0200 (CEST)
Received: by mail-io1-f42.google.com with SMTP id
 ca18e2360f4ac-783546553ddso241845339f.0
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 08:19:25 -0700 (PDT)
Received: from ?IPV6:2620:15c:211:201:c1f1:7d21:6172:cbd2?
 ([2620:15c:211:201:c1f1:7d21:6172:cbd2])
 by smtp.gmail.com with ESMTPSA id
 l6-20020a656806000000b005579c73d209sm15456631pgt.1.2023.07.05.08.19.17
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 05 Jul 2023 08:19:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5325d743-1b47-11ee-b237-6b7b168915f2
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688570364; x=1691162364;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=vhOVd+fM39By6Neo4SNlvIwXWgDBhgramNmEhS79nFc=;
        b=Z97UNyDgzNS3xSouwOAlvgti1JhvSIgx2MkBRWZzcN6zUYAeBeA+QCZzHcCVC2jyY1
         ZaHMsmLQly1JWFwRtzWCJNrMc4u6NBM6AipTtT7xUnYAs8TAr9BnOJOkYtEIn9t3iuY6
         xBMZnZzYEbix5X4XdtfJ9tgVo5Q9bCIzj9vEDNmteamI71pL888CyS4wIlxFemaEU+IW
         TFmOAMexP4GbSMyV+Qfq/Ri8VtFsmexFM6Y+DGCmga9IIj3EuG7toPFc/dL/TZATtf8e
         KgfV0rg3EhWQYVMcD+AVO3V4f/7WRikoV2jBUW+vb1gUpikJJBL52MKwyMX+ibYbiz/C
         ejyg==
X-Gm-Message-State: AC+VfDx7h2A9XPArpLT1xtET4nuhWLGQZlN1lealuIvKn6XXMqFDMhZY
	NQyCuk8dobNvqVnQCCZzTxg=
X-Google-Smtp-Source: ACHHUZ70uoI88DRVhGiNe4v8NMOn4CckRug5A25bO6UrnrhXn4O+oQb9CB+u9z1UucgpvIObIHjohw==
X-Received: by 2002:a05:6602:2113:b0:784:314f:8d68 with SMTP id x19-20020a056602211300b00784314f8d68mr18093430iox.1.1688570364015;
        Wed, 05 Jul 2023 08:19:24 -0700 (PDT)
Message-ID: <1ea08f84-f900-92f2-e32b-2db242a74559@acm.org>
Date: Wed, 5 Jul 2023 08:19:16 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions
Content-Language: en-US
To: Matthew Wilcox <willy@infradead.org>
Cc: Jan Kara <jack@suse.cz>, linux-block@vger.kernel.org,
 linux-fsdevel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
 Christoph Hellwig <hch@infradead.org>, Alasdair Kergon <agk@redhat.com>,
 Andrew Morton <akpm@linux-foundation.org>, Anna Schumaker <anna@kernel.org>,
 Chao Yu <chao@kernel.org>, Christian Borntraeger
 <borntraeger@linux.ibm.com>, "Darrick J. Wong" <djwong@kernel.org>,
 Dave Kleikamp <shaggy@kernel.org>, David Sterba <dsterba@suse.com>,
 dm-devel@redhat.com, drbd-dev@lists.linbit.com, Gao Xiang
 <xiang@kernel.org>, Jack Wang <jinpu.wang@ionos.com>,
 Jaegeuk Kim <jaegeuk@kernel.org>, jfs-discussion@lists.sourceforge.net,
 Joern Engel <joern@lazybastard.org>, Joseph Qi
 <joseph.qi@linux.alibaba.com>, Kent Overstreet <kent.overstreet@gmail.com>,
 linux-bcache@vger.kernel.org, linux-btrfs@vger.kernel.org,
 linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org,
 linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org,
 linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org,
 linux-nilfs@vger.kernel.org, linux-nvme@lists.infradead.org,
 linux-pm@vger.kernel.org, linux-raid@vger.kernel.org,
 linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
 linux-xfs@vger.kernel.org, "Md. Haris Iqbal" <haris.iqbal@ionos.com>,
 Mike Snitzer <snitzer@kernel.org>, Minchan Kim <minchan@kernel.org>,
 ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>, Song Liu <song@kernel.org>,
 Sven Schnelle <svens@linux.ibm.com>, target-devel@vger.kernel.org,
 Ted Tso <tytso@mit.edu>, Trond Myklebust <trond.myklebust@hammerspace.com>,
 xen-devel@lists.xenproject.org
References: <20230629165206.383-1-jack@suse.cz>
 <20230704122224.16257-1-jack@suse.cz>
 <bb91e76b-0bd8-a949-f8b9-868f919ebcb9@acm.org>
 <ZKRFSZQglwCba9/i@casper.infradead.org>
From: Bart Van Assche <bvanassche@acm.org>
In-Reply-To: <ZKRFSZQglwCba9/i@casper.infradead.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 7/4/23 09:14, Matthew Wilcox wrote:
> On Tue, Jul 04, 2023 at 07:06:26AM -0700, Bart Van Assche wrote:
>> On 7/4/23 05:21, Jan Kara wrote:
>>> +struct bdev_handle {
>>> +	struct block_device *bdev;
>>> +	void *holder;
>>> +};
>>
>> Please explain in the patch description why a holder pointer is introduced
>> in struct bdev_handle and how it relates to the bd_holder pointer in struct
>> block_device. Is one of the purposes of this patch series perhaps to add
>> support for multiple holders per block device?
> 
> That is all in patch 0/32.  Why repeat it?

This cover letter: https://lore.kernel.org/linux-block/20230629165206.383-1-jack@suse.cz/T/#t?

The word "holder" doesn't even occur in that cover letter so how could the
answer to my question be present in the cover letter?

Bart.



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:27:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:27:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559306.874205 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4PY-0001zl-3f; Wed, 05 Jul 2023 15:27:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559306.874205; Wed, 05 Jul 2023 15:27:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4PY-0001ze-06; Wed, 05 Jul 2023 15:27:20 +0000
Received: by outflank-mailman (input) for mailman id 559306;
 Wed, 05 Jul 2023 15:27:18 +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
 <SRS0=yX3c=CX=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qH4PW-0001jW-B5
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:27:18 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6bfce8a8-1b48-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 17:27:16 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.248.64])
 by support.bugseng.com (Postfix) with ESMTPSA id D8C704EE0C89;
 Wed,  5 Jul 2023 17:27:14 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6bfce8a8-1b48-11ee-8611-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v2 02/13] AMD/IOMMU: fix violations of MISRA C:2012 Rule 7.2
Date: Wed,  5 Jul 2023 17:26:24 +0200
Message-Id: <89ec1b24e6da5738c00155f6f142cb99385fb838.1688559115.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1688559115.git.gianluca.luparini@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v2:
- minor change to commit title
- change commit message
---
 xen/drivers/passthrough/amd/iommu-defs.h | 122 +++++++++++------------
 1 file changed, 61 insertions(+), 61 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu-defs.h b/xen/drivers/passthrough/amd/iommu-defs.h
index 35de548e3a..c145248f9a 100644
--- a/xen/drivers/passthrough/amd/iommu-defs.h
+++ b/xen/drivers/passthrough/amd/iommu-defs.h
@@ -38,49 +38,49 @@
         ((uint64_t)(offset) << (12 + (PTE_PER_TABLE_SHIFT * ((level) - 1))))
 
 /* IOMMU Capability */
-#define PCI_CAP_ID_MASK		0x000000FF
+#define PCI_CAP_ID_MASK		0x000000FFU
 #define PCI_CAP_ID_SHIFT	0
-#define PCI_CAP_NEXT_PTR_MASK	0x0000FF00
+#define PCI_CAP_NEXT_PTR_MASK	0x0000FF00U
 #define PCI_CAP_NEXT_PTR_SHIFT	8
-#define PCI_CAP_TYPE_MASK	0x00070000
+#define PCI_CAP_TYPE_MASK	0x00070000U
 #define PCI_CAP_TYPE_SHIFT	16
-#define PCI_CAP_REV_MASK	0x00F80000
+#define PCI_CAP_REV_MASK	0x00F80000U
 #define PCI_CAP_REV_SHIFT	19
-#define PCI_CAP_IOTLB_MASK	0x01000000
+#define PCI_CAP_IOTLB_MASK	0x01000000U
 #define PCI_CAP_IOTLB_SHIFT	24
-#define PCI_CAP_HT_TUNNEL_MASK	0x02000000
+#define PCI_CAP_HT_TUNNEL_MASK	0x02000000U
 #define PCI_CAP_HT_TUNNEL_SHIFT	25
-#define PCI_CAP_NP_CACHE_MASK	0x04000000
+#define PCI_CAP_NP_CACHE_MASK	0x04000000U
 #define PCI_CAP_NP_CACHE_SHIFT	26
 #define PCI_CAP_EFRSUP_SHIFT    27
-#define PCI_CAP_RESET_MASK	0x80000000
+#define PCI_CAP_RESET_MASK	0x80000000U
 #define PCI_CAP_RESET_SHIFT	31
 
 #define PCI_CAP_TYPE_IOMMU		0x3
 
 #define PCI_CAP_MMIO_BAR_LOW_OFFSET	0x04
 #define PCI_CAP_MMIO_BAR_HIGH_OFFSET	0x08
-#define PCI_CAP_MMIO_BAR_LOW_MASK	0xFFFFC000
+#define PCI_CAP_MMIO_BAR_LOW_MASK	0xFFFFC000U
 #define IOMMU_MMIO_REGION_LENGTH	0x4000
 
 #define PCI_CAP_RANGE_OFFSET		0x0C
-#define PCI_CAP_BUS_NUMBER_MASK		0x0000FF00
+#define PCI_CAP_BUS_NUMBER_MASK		0x0000FF00U
 #define PCI_CAP_BUS_NUMBER_SHIFT	8
-#define PCI_CAP_FIRST_DEVICE_MASK	0x00FF0000
+#define PCI_CAP_FIRST_DEVICE_MASK	0x00FF0000U
 #define PCI_CAP_FIRST_DEVICE_SHIFT	16
-#define PCI_CAP_LAST_DEVICE_MASK	0xFF000000
+#define PCI_CAP_LAST_DEVICE_MASK	0xFF000000U
 #define PCI_CAP_LAST_DEVICE_SHIFT	24
 
-#define PCI_CAP_UNIT_ID_MASK    0x0000001F
+#define PCI_CAP_UNIT_ID_MASK    0x0000001FU
 #define PCI_CAP_UNIT_ID_SHIFT   0
 #define PCI_CAP_MISC_INFO_OFFSET    0x10
-#define PCI_CAP_MSI_NUMBER_MASK     0x0000001F
+#define PCI_CAP_MSI_NUMBER_MASK     0x0000001FU
 #define PCI_CAP_MSI_NUMBER_SHIFT    0
 
 /* Device Table */
 #define IOMMU_DEV_TABLE_BASE_LOW_OFFSET		0x00
 #define IOMMU_DEV_TABLE_BASE_HIGH_OFFSET	0x04
-#define IOMMU_DEV_TABLE_SIZE_MASK		0x000001FF
+#define IOMMU_DEV_TABLE_SIZE_MASK		0x000001FFU
 #define IOMMU_DEV_TABLE_SIZE_SHIFT		0
 
 #define IOMMU_DEV_TABLE_ENTRIES_PER_BUS		256
@@ -159,13 +159,13 @@ struct amd_iommu_dte {
 #define IOMMU_CMD_BUFFER_BASE_HIGH_OFFSET	0x0C
 #define IOMMU_CMD_BUFFER_HEAD_OFFSET		0x2000
 #define IOMMU_CMD_BUFFER_TAIL_OFFSET		0x2008
-#define IOMMU_CMD_BUFFER_LENGTH_MASK		0x0F000000
+#define IOMMU_CMD_BUFFER_LENGTH_MASK		0x0F000000U
 #define IOMMU_CMD_BUFFER_LENGTH_SHIFT		24
 
 #define IOMMU_CMD_BUFFER_ENTRY_ORDER            4
 #define IOMMU_CMD_BUFFER_MAX_ENTRIES            (1u << 15)
 
-#define IOMMU_CMD_OPCODE_MASK			0xF0000000
+#define IOMMU_CMD_OPCODE_MASK			0xF0000000U
 #define IOMMU_CMD_OPCODE_SHIFT			28
 #define IOMMU_CMD_COMPLETION_WAIT		0x1
 #define IOMMU_CMD_INVALIDATE_DEVTAB_ENTRY	0x2
@@ -178,50 +178,50 @@ struct amd_iommu_dte {
 /* COMPLETION_WAIT command */
 #define IOMMU_COMP_WAIT_DATA_BUFFER_SIZE	8
 #define IOMMU_COMP_WAIT_DATA_BUFFER_ALIGNMENT	8
-#define IOMMU_COMP_WAIT_S_FLAG_MASK		0x00000001
-#define IOMMU_COMP_WAIT_I_FLAG_MASK		0x00000002
-#define IOMMU_COMP_WAIT_F_FLAG_MASK		0x00000004
-#define IOMMU_COMP_WAIT_ADDR_LOW_MASK		0xFFFFFFF8
+#define IOMMU_COMP_WAIT_S_FLAG_MASK		0x00000001U
+#define IOMMU_COMP_WAIT_I_FLAG_MASK		0x00000002U
+#define IOMMU_COMP_WAIT_F_FLAG_MASK		0x00000004U
+#define IOMMU_COMP_WAIT_ADDR_LOW_MASK		0xFFFFFFF8U
 #define IOMMU_COMP_WAIT_ADDR_LOW_SHIFT		3
-#define IOMMU_COMP_WAIT_ADDR_HIGH_MASK		0x000FFFFF
+#define IOMMU_COMP_WAIT_ADDR_HIGH_MASK		0x000FFFFFU
 #define IOMMU_COMP_WAIT_ADDR_HIGH_SHIFT		0
 
 /* INVALIDATE_IOMMU_PAGES command */
-#define IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_MASK	0x0000FFFF
+#define IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_MASK	0x0000FFFFU
 #define IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_SHIFT	0
-#define IOMMU_INV_IOMMU_PAGES_S_FLAG_MASK	0x00000001
+#define IOMMU_INV_IOMMU_PAGES_S_FLAG_MASK	0x00000001U
 #define IOMMU_INV_IOMMU_PAGES_S_FLAG_SHIFT	0
-#define IOMMU_INV_IOMMU_PAGES_PDE_FLAG_MASK	0x00000002
+#define IOMMU_INV_IOMMU_PAGES_PDE_FLAG_MASK	0x00000002U
 #define IOMMU_INV_IOMMU_PAGES_PDE_FLAG_SHIFT	1
-#define IOMMU_INV_IOMMU_PAGES_ADDR_LOW_MASK	0xFFFFF000
+#define IOMMU_INV_IOMMU_PAGES_ADDR_LOW_MASK	0xFFFFF000U
 #define IOMMU_INV_IOMMU_PAGES_ADDR_LOW_SHIFT	12
-#define IOMMU_INV_IOMMU_PAGES_ADDR_HIGH_MASK	0xFFFFFFFF
+#define IOMMU_INV_IOMMU_PAGES_ADDR_HIGH_MASK	0xFFFFFFFFU
 #define IOMMU_INV_IOMMU_PAGES_ADDR_HIGH_SHIFT	0
 
 /* INVALIDATE_DEVTAB_ENTRY command */
-#define IOMMU_INV_DEVTAB_ENTRY_DEVICE_ID_MASK   0x0000FFFF
+#define IOMMU_INV_DEVTAB_ENTRY_DEVICE_ID_MASK   0x0000FFFFU
 #define IOMMU_INV_DEVTAB_ENTRY_DEVICE_ID_SHIFT  0
 
 /* INVALIDATE_INTERRUPT_TABLE command */
-#define IOMMU_INV_INT_TABLE_DEVICE_ID_MASK   0x0000FFFF
+#define IOMMU_INV_INT_TABLE_DEVICE_ID_MASK   0x0000FFFFU
 #define IOMMU_INV_INT_TABLE_DEVICE_ID_SHIFT  0
 
 /* INVALIDATE_IOTLB_PAGES command */
-#define IOMMU_INV_IOTLB_PAGES_MAXPEND_MASK          0xff000000
+#define IOMMU_INV_IOTLB_PAGES_MAXPEND_MASK          0xff000000U
 #define IOMMU_INV_IOTLB_PAGES_MAXPEND_SHIFT         24
-#define IOMMU_INV_IOTLB_PAGES_PASID1_MASK           0x00ff0000
+#define IOMMU_INV_IOTLB_PAGES_PASID1_MASK           0x00ff0000U
 #define IOMMU_INV_IOTLB_PAGES_PASID1_SHIFT          16
-#define IOMMU_INV_IOTLB_PAGES_PASID2_MASK           0x0fff0000
+#define IOMMU_INV_IOTLB_PAGES_PASID2_MASK           0x0fff0000U
 #define IOMMU_INV_IOTLB_PAGES_PASID2_SHIFT          16
-#define IOMMU_INV_IOTLB_PAGES_QUEUEID_MASK          0x0000ffff
+#define IOMMU_INV_IOTLB_PAGES_QUEUEID_MASK          0x0000ffffU
 #define IOMMU_INV_IOTLB_PAGES_QUEUEID_SHIFT         0
-#define IOMMU_INV_IOTLB_PAGES_DEVICE_ID_MASK        0x0000FFFF
+#define IOMMU_INV_IOTLB_PAGES_DEVICE_ID_MASK        0x0000FFFFU
 #define IOMMU_INV_IOTLB_PAGES_DEVICE_ID_SHIFT       0
-#define IOMMU_INV_IOTLB_PAGES_ADDR_LOW_MASK         0xFFFFF000
+#define IOMMU_INV_IOTLB_PAGES_ADDR_LOW_MASK         0xFFFFF000U
 #define IOMMU_INV_IOTLB_PAGES_ADDR_LOW_SHIFT        12
-#define IOMMU_INV_IOTLB_PAGES_ADDR_HIGH_MASK        0xFFFFFFFF
+#define IOMMU_INV_IOTLB_PAGES_ADDR_HIGH_MASK        0xFFFFFFFFU
 #define IOMMU_INV_IOTLB_PAGES_ADDR_HIGH_SHIFT       0
-#define IOMMU_INV_IOTLB_PAGES_S_FLAG_MASK           0x00000001
+#define IOMMU_INV_IOTLB_PAGES_S_FLAG_MASK           0x00000001U
 #define IOMMU_INV_IOTLB_PAGES_S_FLAG_SHIFT          0
 
 /* Event Log */
@@ -229,18 +229,18 @@ struct amd_iommu_dte {
 #define IOMMU_EVENT_LOG_BASE_HIGH_OFFSET	0x14
 #define IOMMU_EVENT_LOG_HEAD_OFFSET		0x2010
 #define IOMMU_EVENT_LOG_TAIL_OFFSET		0x2018
-#define IOMMU_EVENT_LOG_LENGTH_MASK		0x0F000000
+#define IOMMU_EVENT_LOG_LENGTH_MASK		0x0F000000U
 #define IOMMU_EVENT_LOG_LENGTH_SHIFT		24
-#define IOMMU_EVENT_LOG_HEAD_MASK		0x0007FFF0
+#define IOMMU_EVENT_LOG_HEAD_MASK		0x0007FFF0U
 #define IOMMU_EVENT_LOG_HEAD_SHIFT		4
-#define IOMMU_EVENT_LOG_TAIL_MASK		0x0007FFF0
+#define IOMMU_EVENT_LOG_TAIL_MASK		0x0007FFF0U
 #define IOMMU_EVENT_LOG_TAIL_SHIFT		4
 
 #define IOMMU_EVENT_LOG_ENTRY_SIZE 			16
 #define IOMMU_EVENT_LOG_POWER_OF2_ENTRIES_PER_PAGE	8
 #define IOMMU_EVENT_LOG_U32_PER_ENTRY	(IOMMU_EVENT_LOG_ENTRY_SIZE / 4)
 
-#define IOMMU_EVENT_CODE_MASK			0xF0000000
+#define IOMMU_EVENT_CODE_MASK			0xF0000000U
 #define IOMMU_EVENT_CODE_SHIFT			28
 #define IOMMU_EVENT_ILLEGAL_DEV_TABLE_ENTRY	0x1
 #define IOMMU_EVENT_IO_PAGE_FAULT		0x2
@@ -251,12 +251,12 @@ struct amd_iommu_dte {
 #define IOMMU_EVENT_IOTLB_INV_TIMEOUT		0x7
 #define IOMMU_EVENT_INVALID_DEV_REQUEST		0x8
 
-#define IOMMU_EVENT_DOMAIN_ID_MASK           0x0000FFFF
+#define IOMMU_EVENT_DOMAIN_ID_MASK           0x0000FFFFU
 #define IOMMU_EVENT_DOMAIN_ID_SHIFT          0
-#define IOMMU_EVENT_DEVICE_ID_MASK           0x0000FFFF
+#define IOMMU_EVENT_DEVICE_ID_MASK           0x0000FFFFU
 #define IOMMU_EVENT_DEVICE_ID_SHIFT          0
 #define IOMMU_EVENT_FLAGS_SHIFT              16
-#define IOMMU_EVENT_FLAGS_MASK               0x0FFF0000
+#define IOMMU_EVENT_FLAGS_MASK               0x0FFF0000U
 
 /* PPR Log */
 #define IOMMU_PPR_LOG_ENTRY_SIZE                        16
@@ -265,21 +265,21 @@ struct amd_iommu_dte {
 
 #define IOMMU_PPR_LOG_BASE_LOW_OFFSET                   0x0038
 #define IOMMU_PPR_LOG_BASE_HIGH_OFFSET                  0x003C
-#define IOMMU_PPR_LOG_BASE_LOW_MASK                     0xFFFFF000
+#define IOMMU_PPR_LOG_BASE_LOW_MASK                     0xFFFFF000U
 #define IOMMU_PPR_LOG_BASE_LOW_SHIFT                    12
-#define IOMMU_PPR_LOG_BASE_HIGH_MASK                    0x000FFFFF
+#define IOMMU_PPR_LOG_BASE_HIGH_MASK                    0x000FFFFFU
 #define IOMMU_PPR_LOG_BASE_HIGH_SHIFT                   0
-#define IOMMU_PPR_LOG_LENGTH_MASK                       0x0F000000
+#define IOMMU_PPR_LOG_LENGTH_MASK                       0x0F000000U
 #define IOMMU_PPR_LOG_LENGTH_SHIFT                      24
-#define IOMMU_PPR_LOG_HEAD_MASK                         0x0007FFF0
+#define IOMMU_PPR_LOG_HEAD_MASK                         0x0007FFF0U
 #define IOMMU_PPR_LOG_HEAD_SHIFT                        4
-#define IOMMU_PPR_LOG_TAIL_MASK                         0x0007FFF0
+#define IOMMU_PPR_LOG_TAIL_MASK                         0x0007FFF0U
 #define IOMMU_PPR_LOG_TAIL_SHIFT                        4
 #define IOMMU_PPR_LOG_HEAD_OFFSET                       0x2030
 #define IOMMU_PPR_LOG_TAIL_OFFSET                       0x2038
-#define IOMMU_PPR_LOG_DEVICE_ID_MASK                    0x0000FFFF
+#define IOMMU_PPR_LOG_DEVICE_ID_MASK                    0x0000FFFFU
 #define IOMMU_PPR_LOG_DEVICE_ID_SHIFT                   0
-#define IOMMU_PPR_LOG_CODE_MASK                         0xF0000000
+#define IOMMU_PPR_LOG_CODE_MASK                         0xF0000000U
 #define IOMMU_PPR_LOG_CODE_SHIFT                        28
 
 #define IOMMU_LOG_ENTRY_TIMEOUT                         1000
@@ -342,17 +342,17 @@ union amd_iommu_control {
 #define IOMMU_EXCLUSION_BASE_HIGH_OFFSET	0x24
 #define IOMMU_EXCLUSION_LIMIT_LOW_OFFSET	0x28
 #define IOMMU_EXCLUSION_LIMIT_HIGH_OFFSET	0x2C
-#define IOMMU_EXCLUSION_BASE_LOW_MASK		0xFFFFF000
+#define IOMMU_EXCLUSION_BASE_LOW_MASK		0xFFFFF000U
 #define IOMMU_EXCLUSION_BASE_LOW_SHIFT		12
-#define IOMMU_EXCLUSION_BASE_HIGH_MASK		0xFFFFFFFF
+#define IOMMU_EXCLUSION_BASE_HIGH_MASK		0xFFFFFFFFU
 #define IOMMU_EXCLUSION_BASE_HIGH_SHIFT		0
-#define IOMMU_EXCLUSION_RANGE_ENABLE_MASK	0x00000001
+#define IOMMU_EXCLUSION_RANGE_ENABLE_MASK	0x00000001U
 #define IOMMU_EXCLUSION_RANGE_ENABLE_SHIFT	0
-#define IOMMU_EXCLUSION_ALLOW_ALL_MASK		0x00000002
+#define IOMMU_EXCLUSION_ALLOW_ALL_MASK		0x00000002U
 #define IOMMU_EXCLUSION_ALLOW_ALL_SHIFT		1
-#define IOMMU_EXCLUSION_LIMIT_LOW_MASK		0xFFFFF000
+#define IOMMU_EXCLUSION_LIMIT_LOW_MASK		0xFFFFF000U
 #define IOMMU_EXCLUSION_LIMIT_LOW_SHIFT		12
-#define IOMMU_EXCLUSION_LIMIT_HIGH_MASK		0xFFFFFFFF
+#define IOMMU_EXCLUSION_LIMIT_HIGH_MASK		0xFFFFFFFFU
 #define IOMMU_EXCLUSION_LIMIT_HIGH_SHIFT	0
 
 /* Extended Feature Register */
@@ -476,14 +476,14 @@ union amd_iommu_pte {
 
 #define INV_IOMMU_ALL_PAGES_ADDRESS      ((1ULL << 63) - 1)
 
-#define IOMMU_RING_BUFFER_PTR_MASK                  0x0007FFF0
+#define IOMMU_RING_BUFFER_PTR_MASK                  0x0007FFF0U
 
-#define IOMMU_CMD_DEVICE_ID_MASK                    0x0000FFFF
+#define IOMMU_CMD_DEVICE_ID_MASK                    0x0000FFFFU
 #define IOMMU_CMD_DEVICE_ID_SHIFT                   0
 
-#define IOMMU_REG_BASE_ADDR_LOW_MASK                0xFFFFF000
+#define IOMMU_REG_BASE_ADDR_LOW_MASK                0xFFFFF000U
 #define IOMMU_REG_BASE_ADDR_LOW_SHIFT               12
-#define IOMMU_REG_BASE_ADDR_HIGH_MASK               0x000FFFFF
+#define IOMMU_REG_BASE_ADDR_HIGH_MASK               0x000FFFFFU
 #define IOMMU_REG_BASE_ADDR_HIGH_SHIFT              0
 
 #endif /* AMD_IOMMU_DEFS_H */
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:27:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:27:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559304.874185 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4PU-0001Ug-Id; Wed, 05 Jul 2023 15:27:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559304.874185; Wed, 05 Jul 2023 15:27:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4PU-0001UZ-Fu; Wed, 05 Jul 2023 15:27:16 +0000
Received: by outflank-mailman (input) for mailman id 559304;
 Wed, 05 Jul 2023 15:27:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yX3c=CX=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qH4PT-0001UO-7O
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:27:15 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6acc2a55-1b48-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 17:27:14 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.248.64])
 by support.bugseng.com (Postfix) with ESMTPSA id 7E31A4EE0739;
 Wed,  5 Jul 2023 17:27:11 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6acc2a55-1b48-11ee-b237-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Paul Durrant <paul@xen.org>,
	Juergen Gross <jgross@suse.com>,
	Tamas K Lengyel <tamas@tklengyel.com>,
	Alexandru Isaila <aisaila@bitdefender.com>,
	Petre Pircalabu <ppircalabu@bitdefender.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: [XEN PATCH v2 00/13] xen: fix violations of MISRA C:2012 Rule 7.2
Date: Wed,  5 Jul 2023 17:26:22 +0200
Message-Id: <cover.1688559115.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose headline
states:
"A 'u' or 'U' suffix shall be applied to all integer constants that are
represented in an unsigned type".

These violations are caused by the missing "u" or "U" suffix in unsigned
integer constants, such as:

xen/arch/x86/hvm/hypercall.c:132.17-132.26
if ( (eax & 0x80000000) && is_viridian_domain(currd) )

If a rule is not met, fixes are needed in order to achieve compliance.
The patches in this series achieve compliance for MISRA C:2012 Rule 7.2 by
adding the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Changes to macros 'X86_CR0_PG' and 'MSR_EFER' in files
"xen/arch/x86/include/asm/x86-defns.h" and "xen/arch/x86/include/asm/msr-index.h"
are not made since they are used also in assembly files.

---
Changes in v2:
- fixes following review comments
- change title and commit messages
- remove changes in out of scope files
- remove changes in some macros

Gianluca Luparini (13):
  x86/cpufreq: fix violations of MISRA C:2012 Rule 7.2
  AMD/IOMMU: fix violations of MISRA C:2012 Rule 7.2
  x86/svm: fix violations of MISRA C:2012 Rule 7.2
  xen/arm: fix violations of MISRA C:2012 Rule 7.2
  xen/device-tree: fix violations of MISRA C:2012 Rule 7.2
  xen/efi: fix violations of MISRA C:2012 Rule 7.2
  x86/vmx: fix violations of MISRA C:2012 Rule 7.2
  xen/pci: fix violations of MISRA C:2012 Rule 7.2
  xen/public: fix violations of MISRA C:2012 Rule 7.2
  x86/monitor: fix violations of MISRA C:2012 Rule 7.2
  xen/vpci: fix violations of MISRA C:2012 Rule 7.2
  xen/x86: fix violations of MISRA C:2012 Rule 7.2
  xen: fix violations of MISRA C:2012 Rule 7.2

 xen/arch/arm/domain_build.c                  |   4 +-
 xen/arch/arm/efi/efi-boot.h                  |   2 +-
 xen/arch/arm/gic-v2.c                        |   6 +-
 xen/arch/arm/gic-v3.c                        |  10 +-
 xen/arch/arm/include/asm/arm64/brk.h         |   2 +-
 xen/arch/arm/include/asm/arm64/efibind.h     |  10 +-
 xen/arch/arm/include/asm/arm64/insn.h        |  16 +-
 xen/arch/arm/include/asm/vreg.h              |   2 +-
 xen/arch/arm/kernel.c                        |   2 +-
 xen/arch/arm/traps.c                         |  14 +-
 xen/arch/arm/vgic-v2.c                       |   2 +-
 xen/arch/arm/vgic-v3.c                       |   2 +-
 xen/arch/x86/acpi/cpufreq/powernow.c         |  14 +-
 xen/arch/x86/apic.c                          |   2 +-
 xen/arch/x86/cpu-policy.c                    |   8 +-
 xen/arch/x86/cpu/mcheck/mce-apei.c           |   8 +-
 xen/arch/x86/cpu/vpmu_intel.c                |   2 +-
 xen/arch/x86/cpuid.c                         |   8 +-
 xen/arch/x86/efi/efi-boot.h                  |   6 +-
 xen/arch/x86/extable.c                       |   2 +-
 xen/arch/x86/hvm/hypercall.c                 |   2 +-
 xen/arch/x86/hvm/irq.c                       |   2 +-
 xen/arch/x86/hvm/pmtimer.c                   |   4 +-
 xen/arch/x86/hvm/stdvga.c                    |  66 +++---
 xen/arch/x86/hvm/svm/asid.c                  |   2 +-
 xen/arch/x86/hvm/svm/svm.c                   |   8 +-
 xen/arch/x86/hvm/viridian/viridian.c         |   2 +-
 xen/arch/x86/hvm/vlapic.c                    |   6 +-
 xen/arch/x86/hvm/vmx/vmcs.c                  |   6 +-
 xen/arch/x86/hvm/vmx/vvmx.c                  |  12 +-
 xen/arch/x86/include/asm/apicdef.h           |   2 +-
 xen/arch/x86/include/asm/config.h            |   2 +-
 xen/arch/x86/include/asm/guest/hyperv-tlfs.h |  28 +--
 xen/arch/x86/include/asm/hpet.h              |   2 +-
 xen/arch/x86/include/asm/hvm/trace.h         |   4 +-
 xen/arch/x86/include/asm/hvm/vioapic.h       |   2 +-
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h      |   6 +-
 xen/arch/x86/include/asm/hvm/vmx/vmx.h       |  34 ++--
 xen/arch/x86/include/asm/msi.h               |   2 +-
 xen/arch/x86/include/asm/msr-index.h         | 202 +++++++++----------
 xen/arch/x86/include/asm/pci.h               |   8 +-
 xen/arch/x86/include/asm/x86-defns.h         |   2 +-
 xen/arch/x86/monitor.c                       |   6 +-
 xen/arch/x86/percpu.c                        |   2 +-
 xen/arch/x86/psr.c                           |   2 +-
 xen/arch/x86/spec_ctrl.c                     |   8 +-
 xen/arch/x86/x86_64/acpi_mmcfg.c             |   2 +-
 xen/arch/x86/x86_64/pci.c                    |   2 +-
 xen/arch/x86/x86_emulate/x86_emulate.h       |   2 +-
 xen/common/device_tree.c                     |   4 +-
 xen/common/efi/boot.c                        |   8 +-
 xen/common/efi/runtime.c                     |   2 +-
 xen/common/gunzip.c                          |   2 +-
 xen/common/xmalloc_tlsf.c                    |   2 +-
 xen/drivers/char/ehci-dbgp.c                 |   4 +-
 xen/drivers/passthrough/amd/iommu-defs.h     | 122 +++++------
 xen/drivers/passthrough/pci.c                |   4 +-
 xen/drivers/video/vesa.c                     |   2 +-
 xen/drivers/vpci/msi.c                       |   2 +-
 xen/drivers/vpci/msix.c                      |   2 +-
 xen/drivers/vpci/vpci.c                      |   6 +-
 xen/include/acpi/cpufreq/processor_perf.h    |   2 +-
 xen/include/public/arch-arm/smccc.h          |   8 +-
 xen/include/public/io/ring.h                 |  10 +-
 xen/include/public/memory.h                  |   2 +-
 xen/include/public/sysctl.h                  |   4 +-
 xen/include/xen/bitops.h                     |  10 +-
 xen/include/xen/cper.h                       |  34 ++--
 xen/lib/muldiv64.c                           |   2 +-
 xen/lib/x86/cpuid.c                          |   8 +-
 xen/lib/x86/policy.c                         |   2 +-
 71 files changed, 396 insertions(+), 396 deletions(-)

-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:27:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:27:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559305.874195 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4PW-0001k0-SW; Wed, 05 Jul 2023 15:27:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559305.874195; Wed, 05 Jul 2023 15:27:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4PW-0001jt-Pk; Wed, 05 Jul 2023 15:27:18 +0000
Received: by outflank-mailman (input) for mailman id 559305;
 Wed, 05 Jul 2023 15:27:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yX3c=CX=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qH4PT-0001UO-SK
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:27:15 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6b61d52b-1b48-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 17:27:15 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.248.64])
 by support.bugseng.com (Postfix) with ESMTPSA id B058F4EE0C81;
 Wed,  5 Jul 2023 17:27:13 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6b61d52b-1b48-11ee-b237-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v2 01/13] x86/cpufreq: fix violations of MISRA C:2012 Rule 7.2
Date: Wed,  5 Jul 2023 17:26:23 +0200
Message-Id: <7df9377d4cb218dd54646c2cb1b70327c8b44c96.1688559115.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1688559115.git.gianluca.luparini@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
---
Changes in v2:
- change commit title to make it unique
- change commit message
---
 xen/arch/x86/acpi/cpufreq/powernow.c      | 14 +++++++-------
 xen/include/acpi/cpufreq/processor_perf.h |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/powernow.c b/xen/arch/x86/acpi/cpufreq/powernow.c
index d4c7dcd5d9..8e0784b69c 100644
--- a/xen/arch/x86/acpi/cpufreq/powernow.c
+++ b/xen/arch/x86/acpi/cpufreq/powernow.c
@@ -32,14 +32,14 @@
 #include <acpi/acpi.h>
 #include <acpi/cpufreq/cpufreq.h>
 
-#define HW_PSTATE_MASK          0x00000007
-#define HW_PSTATE_VALID_MASK    0x80000000
-#define HW_PSTATE_MAX_MASK      0x000000f0
+#define HW_PSTATE_MASK          0x00000007U
+#define HW_PSTATE_VALID_MASK    0x80000000U
+#define HW_PSTATE_MAX_MASK      0x000000f0U
 #define HW_PSTATE_MAX_SHIFT     4
-#define MSR_PSTATE_DEF_BASE     0xc0010064 /* base of Pstate MSRs */
-#define MSR_PSTATE_STATUS       0xc0010063 /* Pstate Status MSR */
-#define MSR_PSTATE_CTRL         0xc0010062 /* Pstate control MSR */
-#define MSR_PSTATE_CUR_LIMIT    0xc0010061 /* pstate current limit MSR */
+#define MSR_PSTATE_DEF_BASE     0xc0010064U /* base of Pstate MSRs */
+#define MSR_PSTATE_STATUS       0xc0010063U /* Pstate Status MSR */
+#define MSR_PSTATE_CTRL         0xc0010062U /* Pstate control MSR */
+#define MSR_PSTATE_CUR_LIMIT    0xc0010061U /* pstate current limit MSR */
 #define MSR_HWCR_CPBDIS_MASK    0x02000000ULL
 
 #define ARCH_CPU_FLAG_RESUME	1
diff --git a/xen/include/acpi/cpufreq/processor_perf.h b/xen/include/acpi/cpufreq/processor_perf.h
index d8a1ba68a6..8b5a1b9bde 100644
--- a/xen/include/acpi/cpufreq/processor_perf.h
+++ b/xen/include/acpi/cpufreq/processor_perf.h
@@ -5,7 +5,7 @@
 #include <public/sysctl.h>
 #include <xen/acpi.h>
 
-#define XEN_PX_INIT 0x80000000
+#define XEN_PX_INIT 0x80000000U
 
 int powernow_cpufreq_init(void);
 unsigned int powernow_register_driver(void);
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:27:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:27:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559307.874209 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4PY-00022l-Dk; Wed, 05 Jul 2023 15:27:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559307.874209; Wed, 05 Jul 2023 15:27:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4PY-00021M-8D; Wed, 05 Jul 2023 15:27:20 +0000
Received: by outflank-mailman (input) for mailman id 559307;
 Wed, 05 Jul 2023 15:27:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yX3c=CX=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qH4PW-0001UO-Te
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:27:18 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6d4e126d-1b48-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 17:27:18 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.248.64])
 by support.bugseng.com (Postfix) with ESMTPSA id 1164F4EE0C8D;
 Wed,  5 Jul 2023 17:27:17 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6d4e126d-1b48-11ee-b237-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v2 04/13] xen/arm: fix violations of MISRA C:2012 Rule 7.2
Date: Wed,  5 Jul 2023 17:26:26 +0200
Message-Id: <c58aa850214380cb6f799226a911968fd33a98ff.1688559115.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1688559115.git.gianluca.luparini@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
---
Changes in v2:
- minor change to commit title
- change commit message
- fix in 'domain_build.c' file for consistency
- fix typo in 'gic-v2.c' file
- fix in 'insn.h' file for consistency
- add fixes in 'gic-v3.c', 'traps.c' and 'vgic-v3.c'
---
 xen/arch/arm/domain_build.c              |  4 ++--
 xen/arch/arm/efi/efi-boot.h              |  2 +-
 xen/arch/arm/gic-v2.c                    |  6 +++---
 xen/arch/arm/gic-v3.c                    | 10 +++++-----
 xen/arch/arm/include/asm/arm64/brk.h     |  2 +-
 xen/arch/arm/include/asm/arm64/efibind.h | 10 +++++-----
 xen/arch/arm/include/asm/arm64/insn.h    | 16 ++++++++--------
 xen/arch/arm/include/asm/vreg.h          |  2 +-
 xen/arch/arm/kernel.c                    |  2 +-
 xen/arch/arm/traps.c                     | 14 +++++++-------
 xen/arch/arm/vgic-v2.c                   |  2 +-
 xen/arch/arm/vgic-v3.c                   |  2 +-
 xen/include/public/arch-arm/smccc.h      |  8 ++++----
 13 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index d0d6be922d..d58604ef4a 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -3751,8 +3751,8 @@ static int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
          * r1 = machine nr, r2 = atags or dtb pointer.
          *...
          */
-        regs->r0 = 0; /* SBZ */
-        regs->r1 = 0xffffffff; /* We use DTB therefore no machine id */
+        regs->r0 = 0U; /* SBZ */
+        regs->r1 = 0xffffffffU; /* We use DTB therefore no machine id */
         regs->r2 = kinfo->dtb_paddr;
     }
 #ifdef CONFIG_ARM_64
diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index bb64925d70..585332647d 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -46,7 +46,7 @@ static int get_module_file_index(const char *name, unsigned int name_len);
 static void PrintMessage(const CHAR16 *s);
 
 #define DEVICE_TREE_GUID \
-{0xb1b621d5, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0}}
+{0xb1b621d5U, 0xf19cU, 0x41a5U, {0x83U, 0x0bU, 0xd9U, 0x15U, 0x2cU, 0x69U, 0xaaU, 0xe0U}}
 
 static struct file __initdata dtbfile;
 static void __initdata *fdt;
diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 6476ff4230..cf392bfd1c 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -386,9 +386,9 @@ static void gicv2_cpu_init(void)
     /* The first 32 interrupts (PPI and SGI) are banked per-cpu, so
      * even though they are controlled with GICD registers, they must
      * be set up here with the other per-cpu state. */
-    writel_gicd(0xffffffff, GICD_ICACTIVER); /* Diactivate PPIs and SGIs */
-    writel_gicd(0xffff0000, GICD_ICENABLER); /* Disable all PPI */
-    writel_gicd(0x0000ffff, GICD_ISENABLER); /* Enable all SGI */
+    writel_gicd(0xffffffffU, GICD_ICACTIVER); /* De-activate PPIs and SGIs */
+    writel_gicd(0xffff0000U, GICD_ICENABLER); /* Disable all PPI */
+    writel_gicd(0x0000ffffU, GICD_ISENABLER); /* Enable all SGI */
 
     /* Set SGI priorities */
     for ( i = 0; i < 16; i += 4 )
diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 4e6c98bada..95e4f020fe 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -619,8 +619,8 @@ static void __init gicv3_dist_init(void)
     /* Disable/deactivate all global interrupts */
     for ( i = NR_GIC_LOCAL_IRQS; i < nr_lines; i += 32 )
     {
-        writel_relaxed(0xffffffff, GICD + GICD_ICENABLER + (i / 32) * 4);
-        writel_relaxed(0xffffffff, GICD + GICD_ICACTIVER + (i / 32) * 4);
+        writel_relaxed(0xffffffffU, GICD + GICD_ICENABLER + (i / 32) * 4);
+        writel_relaxed(0xffffffffU, GICD + GICD_ICACTIVER + (i / 32) * 4);
     }
 
     /*
@@ -832,13 +832,13 @@ static int gicv3_cpu_init(void)
      * The activate state is unknown at boot, so make sure all
      * SGIs and PPIs are de-activated.
      */
-    writel_relaxed(0xffffffff, GICD_RDIST_SGI_BASE + GICR_ICACTIVER0);
+    writel_relaxed(0xffffffffU, GICD_RDIST_SGI_BASE + GICR_ICACTIVER0);
     /*
      * Disable all PPI interrupts, ensure all SGI interrupts are
      * enabled.
      */
-    writel_relaxed(0xffff0000, GICD_RDIST_SGI_BASE + GICR_ICENABLER0);
-    writel_relaxed(0x0000ffff, GICD_RDIST_SGI_BASE + GICR_ISENABLER0);
+    writel_relaxed(0xffff0000U, GICD_RDIST_SGI_BASE + GICR_ICENABLER0);
+    writel_relaxed(0x0000ffffU, GICD_RDIST_SGI_BASE + GICR_ISENABLER0);
     /* Configure SGIs/PPIs as non-secure Group-1 */
     writel_relaxed(GENMASK(31, 0), GICD_RDIST_SGI_BASE + GICR_IGROUPR0);
 
diff --git a/xen/arch/arm/include/asm/arm64/brk.h b/xen/arch/arm/include/asm/arm64/brk.h
index 04442c4b9f..3af153a053 100644
--- a/xen/arch/arm/include/asm/arm64/brk.h
+++ b/xen/arch/arm/include/asm/arm64/brk.h
@@ -21,7 +21,7 @@
  * BRK instruction encoding
  * The #imm16 value should be placed at bits[20:5] within BRK ins
  */
-#define AARCH64_BREAK_MON 0xd4200000
+#define AARCH64_BREAK_MON 0xd4200000U
 
 /*
  * BRK instruction for provoking a fault on purpose
diff --git a/xen/arch/arm/include/asm/arm64/efibind.h b/xen/arch/arm/include/asm/arm64/efibind.h
index 8b43bb8495..0e890b666d 100644
--- a/xen/arch/arm/include/asm/arm64/efibind.h
+++ b/xen/arch/arm/include/asm/arm64/efibind.h
@@ -22,12 +22,12 @@ Revision History
 #pragma pack()
 #endif
 
-#define EFIERR(a)           (0x8000000000000000 | a)
-#define EFI_ERROR_MASK      0x8000000000000000
-#define EFIERR_OEM(a)       (0xc000000000000000 | a)
+#define EFIERR(a)           (0x8000000000000000U | a)
+#define EFI_ERROR_MASK      0x8000000000000000U
+#define EFIERR_OEM(a)       (0xc000000000000000U | a)
 
-#define BAD_POINTER         0xFBFBFBFBFBFBFBFB
-#define MAX_ADDRESS         0xFFFFFFFFFFFFFFFF
+#define BAD_POINTER         0xFBFBFBFBFBFBFBFBU
+#define MAX_ADDRESS         0xFFFFFFFFFFFFFFFFU
 
 #define EFI_STUB_ERROR      MAX_ADDRESS
 
diff --git a/xen/arch/arm/include/asm/arm64/insn.h b/xen/arch/arm/include/asm/arm64/insn.h
index 4e0d364d41..6308959449 100644
--- a/xen/arch/arm/include/asm/arm64/insn.h
+++ b/xen/arch/arm/include/asm/arm64/insn.h
@@ -60,14 +60,14 @@ static always_inline bool aarch64_insn_is_##abbr(u32 code) \
 static always_inline u32 aarch64_insn_get_##abbr##_value(void) \
 { return (val); }
 
-__AARCH64_INSN_FUNCS(b,		0xFC000000, 0x14000000)
-__AARCH64_INSN_FUNCS(bl,	0xFC000000, 0x94000000)
-__AARCH64_INSN_FUNCS(cbz,	0x7F000000, 0x34000000)
-__AARCH64_INSN_FUNCS(cbnz,	0x7F000000, 0x35000000)
-__AARCH64_INSN_FUNCS(tbz,	0x7F000000, 0x36000000)
-__AARCH64_INSN_FUNCS(tbnz,	0x7F000000, 0x37000000)
-__AARCH64_INSN_FUNCS(bcond,	0xFF000010, 0x54000000)
-__AARCH64_INSN_FUNCS(hint,	0xFFFFF01F, 0xD503201F)
+__AARCH64_INSN_FUNCS(b,		0xFC000000U, 0x14000000U)
+__AARCH64_INSN_FUNCS(bl,	0xFC000000U, 0x94000000U)
+__AARCH64_INSN_FUNCS(cbz,	0x7F000000U, 0x34000000U)
+__AARCH64_INSN_FUNCS(cbnz,	0x7F000000U, 0x35000000U)
+__AARCH64_INSN_FUNCS(tbz,	0x7F000000U, 0x36000000U)
+__AARCH64_INSN_FUNCS(tbnz,	0x7F000000U, 0x37000000U)
+__AARCH64_INSN_FUNCS(bcond,	0xFF000010U, 0x54000000U)
+__AARCH64_INSN_FUNCS(hint,	0xFFFFF01FU, 0xD503201FU)
 
 bool aarch64_insn_is_branch_imm(u32 insn);
 
diff --git a/xen/arch/arm/include/asm/vreg.h b/xen/arch/arm/include/asm/vreg.h
index bf945eebbd..387ce76e7e 100644
--- a/xen/arch/arm/include/asm/vreg.h
+++ b/xen/arch/arm/include/asm/vreg.h
@@ -56,7 +56,7 @@ static inline bool vreg_emulate_cp64(struct cpu_user_regs *regs, union hsr hsr,
 
     if ( ret && cp64.read )
     {
-        set_user_reg(regs, cp64.reg1, x & 0xffffffff);
+        set_user_reg(regs, cp64.reg1, x & 0xffffffffU);
         set_user_reg(regs, cp64.reg2, x >> 32);
     }
 
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index ca5318515e..508c54824d 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -39,7 +39,7 @@ struct minimal_dtb_header {
     /* There are other fields but we don't use them yet. */
 };
 
-#define DTB_MAGIC 0xd00dfeed
+#define DTB_MAGIC 0xd00dfeedU
 
 /**
  * copy_from_paddr - copy data from a physical address
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index ef5c6a8195..d1ef787638 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -398,7 +398,7 @@ static vaddr_t exception_handler32(vaddr_t offset)
     register_t sctlr = READ_SYSREG(SCTLR_EL1);
 
     if ( sctlr & SCTLR_A32_EL1_V )
-        return 0xffff0000 + offset;
+        return 0xffff0000U + offset;
     else /* always have security exceptions */
         return READ_SYSREG(VBAR_EL1) + offset;
 }
@@ -809,7 +809,7 @@ static void show_registers_32(const struct cpu_user_regs *regs,
 #ifdef CONFIG_ARM_64
                (uint32_t)(ctxt->far >> 32),
                ctxt->ifsr32_el2,
-               (uint32_t)(ctxt->far & 0xffffffff),
+               (uint32_t)(ctxt->far & 0xffffffffU),
                ctxt->esr_el1
 #else
                ctxt->ifar, ctxt->ifsr, ctxt->dfar, ctxt->dfsr
@@ -1414,16 +1414,16 @@ static void do_trap_hypercall(struct cpu_user_regs *regs, register_t *nr,
     {
         /* Deliberately corrupt parameter regs used by this hypercall. */
         switch ( hypercall_args[*nr] ) {
-        case 5: HYPERCALL_ARG5(regs) = 0xDEADBEEF;
-        case 4: HYPERCALL_ARG4(regs) = 0xDEADBEEF;
-        case 3: HYPERCALL_ARG3(regs) = 0xDEADBEEF;
-        case 2: HYPERCALL_ARG2(regs) = 0xDEADBEEF;
+        case 5: HYPERCALL_ARG5(regs) = 0xDEADBEEFU;
+        case 4: HYPERCALL_ARG4(regs) = 0xDEADBEEFU;
+        case 3: HYPERCALL_ARG3(regs) = 0xDEADBEEFU;
+        case 2: HYPERCALL_ARG2(regs) = 0xDEADBEEFU;
         case 1: /* Don't clobber x0/r0 -- it's the return value */
         case 0: /* -ENOSYS case */
             break;
         default: BUG();
         }
-        *nr = 0xDEADBEEF;
+        *nr = 0xDEADBEEFU;
     }
 #endif
 
diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 0b083c33e6..35363fee09 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -306,7 +306,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case VREG32(GICD_SGIR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* Write only -- read unknown */
-        *r = 0xdeadbeef;
+        *r = 0xdeadbeefU;
         return 1;
 
     case VRANGE32(0xF04, 0xF0C):
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 9c1fdcc3f8..f3e9eb2f92 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -354,7 +354,7 @@ read_reserved:
     return 1;
 
 read_unknown:
-    *r = vreg_reg64_extract(0xdeadbeafdeadbeaf, info);
+    *r = vreg_reg64_extract(0xdeadbeafdeadbeafU, info);
     return 1;
 }
 
diff --git a/xen/include/public/arch-arm/smccc.h b/xen/include/public/arch-arm/smccc.h
index 802d800aad..8553f2f39e 100644
--- a/xen/include/public/arch-arm/smccc.h
+++ b/xen/include/public/arch-arm/smccc.h
@@ -26,16 +26,16 @@
 #define XEN_SMCCC_MINOR_REVISION 1
 
 /* Hypervisor Service UID. Randomly generated with uuidgen. */
-#define XEN_SMCCC_UID XEN_DEFINE_UUID(0xa71812dc, 0xc698, 0x4369, 0x9acf, \
-                                      0x79, 0xd1, 0x8d, 0xde, 0xe6, 0x67)
+#define XEN_SMCCC_UID XEN_DEFINE_UUID(0xa71812dcU, 0xc698U, 0x4369U, 0x9acfU, \
+                                      0x79U, 0xd1U, 0x8dU, 0xdeU, 0xe6U, 0x67U)
 
 /* Standard Service Service Call version. */
 #define SSSC_SMCCC_MAJOR_REVISION 0
 #define SSSC_SMCCC_MINOR_REVISION 1
 
 /* Standard Service Call UID. Randomly generated with uuidgen. */
-#define SSSC_SMCCC_UID XEN_DEFINE_UUID(0xf863386f, 0x4b39, 0x4cbd, 0x9220,\
-                                       0xce, 0x16, 0x41, 0xe5, 0x9f, 0x6f)
+#define SSSC_SMCCC_UID XEN_DEFINE_UUID(0xf863386fU, 0x4b39U, 0x4cbdU, 0x9220U,\
+                                       0xceU, 0x16U, 0x41U, 0xe5U, 0x9fU, 0x6fU)
 
 #endif /* __XEN_PUBLIC_ARCH_ARM_SMCCC_H__ */
 
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:27:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:27:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559308.874216 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4PY-0002Aw-Qq; Wed, 05 Jul 2023 15:27:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559308.874216; Wed, 05 Jul 2023 15:27:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4PY-0002AB-Jh; Wed, 05 Jul 2023 15:27:20 +0000
Received: by outflank-mailman (input) for mailman id 559308;
 Wed, 05 Jul 2023 15:27:19 +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
 <SRS0=yX3c=CX=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qH4PW-0001jW-Vl
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:27:18 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6ca95199-1b48-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 17:27:17 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.248.64])
 by support.bugseng.com (Postfix) with ESMTPSA id E85EF4EE0C8B;
 Wed,  5 Jul 2023 17:27:15 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6ca95199-1b48-11ee-8611-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v2 03/13] x86/svm: fix violations of MISRA C:2012 Rule 7.2
Date: Wed,  5 Jul 2023 17:26:25 +0200
Message-Id: <015d7c13dc4e1b481abb23a3eaa254e316b7ca53.1688559115.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1688559115.git.gianluca.luparini@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v2:
- change commit title to make it unique
- change commit message
---
 xen/arch/x86/hvm/svm/asid.c | 2 +-
 xen/arch/x86/hvm/svm/svm.c  | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/asid.c b/xen/arch/x86/hvm/svm/asid.c
index 09f8c23fd9..56306d1a16 100644
--- a/xen/arch/x86/hvm/svm/asid.c
+++ b/xen/arch/x86/hvm/svm/asid.c
@@ -16,7 +16,7 @@ void svm_asid_init(const struct cpuinfo_x86 *c)
 
     /* Check for erratum #170, and leave ASIDs disabled if it's present. */
     if ( !cpu_has_amd_erratum(c, AMD_ERRATUM_170) )
-        nasids = cpuid_ebx(0x8000000A);
+        nasids = cpuid_ebx(0x8000000AU);
 
     hvm_asid_init(nasids);
 }
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 59a6e88dff..56cb2f61bb 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -269,9 +269,9 @@ svm_msrbit(unsigned long *msr_bitmap, uint32_t msr)
      */
     if ( msr <= 0x1fff )
         msr_bit = msr_bitmap + 0x0000 / BYTES_PER_LONG;
-    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
+    else if ( (msr >= 0xc0000000U) && (msr <= 0xc0001fffU) )
         msr_bit = msr_bitmap + 0x0800 / BYTES_PER_LONG;
-    else if ( (msr >= 0xc0010000) && (msr <= 0xc0011fff) )
+    else if ( (msr >= 0xc0010000U) && (msr <= 0xc0011fffU) )
         msr_bit = msr_bitmap + 0x1000 / BYTES_PER_LONG;
 
     return msr_bit;
@@ -2539,8 +2539,8 @@ const struct hvm_function_table * __init start_svm(void)
 
     setup_vmcb_dump();
 
-    if ( boot_cpu_data.extended_cpuid_level >= 0x8000000a )
-        svm_feature_flags = cpuid_edx(0x8000000a);
+    if ( boot_cpu_data.extended_cpuid_level >= 0x8000000aU )
+        svm_feature_flags = cpuid_edx(0x8000000aU);
 
     printk("SVM: Supported advanced features:\n");
 
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:27:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:27:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559309.874225 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4PZ-0002KW-Di; Wed, 05 Jul 2023 15:27:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559309.874225; Wed, 05 Jul 2023 15:27:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4PZ-0002Ij-4f; Wed, 05 Jul 2023 15:27:21 +0000
Received: by outflank-mailman (input) for mailman id 559309;
 Wed, 05 Jul 2023 15:27:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yX3c=CX=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qH4PX-0001UO-Tn
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:27:19 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6dd367f7-1b48-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 17:27:19 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.248.64])
 by support.bugseng.com (Postfix) with ESMTPSA id 144FF4EE0C8A;
 Wed,  5 Jul 2023 17:27:18 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6dd367f7-1b48-11ee-b237-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v2 05/13] xen/device-tree: fix violations of MISRA C:2012 Rule 7.2
Date: Wed,  5 Jul 2023 17:26:27 +0200
Message-Id: <da656a93e42e5d04e02f62002b1f5ab357c8c16a.1688559115.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1688559115.git.gianluca.luparini@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
---
Changes in v2:
- change commit title to the right one
- change commit message
- change maintainers in Cc
- remove changes in 'libfdt'
---
 xen/common/device_tree.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 8da1052911..0677193ab3 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -2115,7 +2115,7 @@ static void __init __unflatten_device_tree(const void *fdt,
     /* Allocate memory for the expanded device tree */
     mem = (unsigned long)_xmalloc (size + 4, __alignof__(struct dt_device_node));
 
-    ((__be32 *)mem)[size / 4] = cpu_to_be32(0xdeadbeef);
+    ((__be32 *)mem)[size / 4] = cpu_to_be32(0xdeadbeefU);
 
     dt_dprintk("  unflattening %lx...\n", mem);
 
@@ -2125,7 +2125,7 @@ static void __init __unflatten_device_tree(const void *fdt,
     if ( be32_to_cpup((__be32 *)start) != FDT_END )
         printk(XENLOG_WARNING "Weird tag at end of tree: %08x\n",
                   *((u32 *)start));
-    if ( be32_to_cpu(((__be32 *)mem)[size / 4]) != 0xdeadbeef )
+    if ( be32_to_cpu(((__be32 *)mem)[size / 4]) != 0xdeadbeefU )
         printk(XENLOG_WARNING "End of tree marker overwritten: %08x\n",
                   be32_to_cpu(((__be32 *)mem)[size / 4]));
     *allnextp = NULL;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:27:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:27:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559310.874242 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4Pa-0002qZ-OX; Wed, 05 Jul 2023 15:27:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559310.874242; Wed, 05 Jul 2023 15:27:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4Pa-0002p2-FQ; Wed, 05 Jul 2023 15:27:22 +0000
Received: by outflank-mailman (input) for mailman id 559310;
 Wed, 05 Jul 2023 15:27:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yX3c=CX=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qH4PY-0001UO-U5
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:27:20 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6e568660-1b48-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 17:27:19 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.248.64])
 by support.bugseng.com (Postfix) with ESMTPSA id F1CB24EE0C91;
 Wed,  5 Jul 2023 17:27:18 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6e568660-1b48-11ee-b237-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v2 06/13] xen/efi: fix violations of MISRA C:2012 Rule 7.2
Date: Wed,  5 Jul 2023 17:26:28 +0200
Message-Id: <9a791b84be74d7ca575eb94e070aae7294d95bbf.1688559115.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1688559115.git.gianluca.luparini@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
---
Changes in v2:
- minor change to commit title
- change commit message
- remove changes in 'efibind.h', 'efiapi.h', 'efidef.h' and 'efiprot.h'
---
 xen/common/efi/boot.c    | 8 ++++----
 xen/common/efi/runtime.c | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index c5850c26af..28a57fe434 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -34,13 +34,13 @@
 #define EFI_REVISION(major, minor) (((major) << 16) | (minor))
 
 #define SMBIOS3_TABLE_GUID \
-  { 0xf2fd1544, 0x9794, 0x4a2c, {0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94} }
+  { 0xf2fd1544U, 0x9794U, 0x4a2cU, {0x99U, 0x2eU, 0xe5U, 0xbbU, 0xcfU, 0x20U, 0xe3U, 0x94U} }
 #define SHIM_LOCK_PROTOCOL_GUID \
-  { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} }
+  { 0x605dab50U, 0xe046U, 0x4300U, {0xabU, 0xb6U, 0x3dU, 0xd8U, 0x10U, 0xddU, 0x8bU, 0x23U} }
 #define APPLE_PROPERTIES_PROTOCOL_GUID \
-  { 0x91bd12fe, 0xf6c3, 0x44fb, { 0xa5, 0xb7, 0x51, 0x22, 0xab, 0x30, 0x3a, 0xe0} }
+  { 0x91bd12feU, 0xf6c3U, 0x44fbU, { 0xa5U, 0xb7U, 0x51U, 0x22U, 0xabU, 0x30U, 0x3aU, 0xe0U} }
 #define EFI_SYSTEM_RESOURCE_TABLE_GUID    \
-  { 0xb122a263, 0x3661, 0x4f68, {0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80} }
+  { 0xb122a263U, 0x3661U, 0x4f68U, {0x99U, 0x29U, 0x78U, 0xf8U, 0xb0U, 0xd6U, 0x21U, 0x80U} }
 #define EFI_SYSTEM_RESOURCE_TABLE_FIRMWARE_RESOURCE_VERSION 1
 
 typedef struct {
diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
index 13b0975866..5cb7504c96 100644
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -698,7 +698,7 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
 #ifndef COMPAT
     op->status = status;
 #else
-    op->status = (status & 0x3fffffff) | ((status >> 32) & 0xc0000000);
+    op->status = (status & 0x3fffffffU) | ((status >> 32) & 0xc0000000U);
 #endif
 
     return rc;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:27:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:27:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559312.874253 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4Pc-0003Hu-4D; Wed, 05 Jul 2023 15:27:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559312.874253; Wed, 05 Jul 2023 15:27:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4Pb-0003Gw-V2; Wed, 05 Jul 2023 15:27:23 +0000
Received: by outflank-mailman (input) for mailman id 559312;
 Wed, 05 Jul 2023 15:27:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yX3c=CX=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qH4Pa-0001UO-GN
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:27:22 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6f9c2b0d-1b48-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 17:27:22 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.248.64])
 by support.bugseng.com (Postfix) with ESMTPSA id E83FE4EE0C97;
 Wed,  5 Jul 2023 17:27:20 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6f9c2b0d-1b48-11ee-b237-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Paul Durrant <paul@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v2 08/13] xen/pci: fix violations of MISRA C:2012 Rule 7.2
Date: Wed,  5 Jul 2023 17:26:30 +0200
Message-Id: <b921f7a9a13475da9fe4c71b5cf7173bab55b439.1688559115.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1688559115.git.gianluca.luparini@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v2:
- minor change to commit title
- change commit message
---
 xen/drivers/passthrough/pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 07d1986d33..95846e84f2 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -990,8 +990,8 @@ bool_t __init pci_device_detect(u16 seg, u8 bus, u8 dev, u8 func)
 
     vendor = pci_conf_read32(PCI_SBDF(seg, bus, dev, func), PCI_VENDOR_ID);
     /* some broken boards return 0 or ~0 if a slot is empty: */
-    if ( (vendor == 0xffffffff) || (vendor == 0x00000000) ||
-         (vendor == 0x0000ffff) || (vendor == 0xffff0000) )
+    if ( (vendor == 0xffffffffU) || (vendor == 0x00000000U) ||
+         (vendor == 0x0000ffffU) || (vendor == 0xffff0000U) )
         return 0;
     return 1;
 }
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:27:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:27:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559313.874259 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4Pc-0003Mx-IV; Wed, 05 Jul 2023 15:27:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559313.874259; Wed, 05 Jul 2023 15:27:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4Pc-0003KV-D0; Wed, 05 Jul 2023 15:27:24 +0000
Received: by outflank-mailman (input) for mailman id 559313;
 Wed, 05 Jul 2023 15:27:22 +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
 <SRS0=yX3c=CX=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qH4Pa-0001jW-OY
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:27:22 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6ef988ec-1b48-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 17:27:21 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.248.64])
 by support.bugseng.com (Postfix) with ESMTPSA id C4E454EE073E;
 Wed,  5 Jul 2023 17:27:19 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6ef988ec-1b48-11ee-8611-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v2 07/13] x86/vmx: fix violations of MISRA C:2012 Rule 7.2
Date: Wed,  5 Jul 2023 17:26:29 +0200
Message-Id: <f30ef7c2cda2516d9ef07bb79e5da5513cd90c6c.1688559115.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1688559115.git.gianluca.luparini@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
---
Changes in v2:
- minor change to commit title
- change commit message
- remove unnecessary changes in 'vpmu_intel.c' and 'vmx.h'
- add 'ULL' suffix in 'vpmu_intel.c'
- add zero-padding to constants in 'vmx.h'
- add missing 'U' in 'vmx.h'
---
 xen/arch/x86/cpu/vpmu_intel.c           |  2 +-
 xen/arch/x86/hvm/vmx/vmcs.c             |  6 ++---
 xen/arch/x86/hvm/vmx/vvmx.c             | 12 ++++-----
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h |  6 ++---
 xen/arch/x86/include/asm/hvm/vmx/vmx.h  | 34 ++++++++++++-------------
 5 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index bda5d511ac..890c279310 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -946,7 +946,7 @@ const struct arch_vpmu_ops *__init core2_vpmu_init(void)
     fixed_counters_mask = ~((1ull << core2_get_bitwidth_fix_count()) - 1);
     global_ctrl_mask = ~((((1ULL << fixed_pmc_cnt) - 1) << 32) |
                          ((1ULL << arch_pmc_cnt) - 1));
-    global_ovf_ctrl_mask = ~(0xC000000000000000 |
+    global_ovf_ctrl_mask = ~(0xC000000000000000ULL |
                              (((1ULL << fixed_pmc_cnt) - 1) << 32) |
                              ((1ULL << arch_pmc_cnt) - 1));
     if ( version > 2 )
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index b209563625..d5a2b847a9 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -911,7 +911,7 @@ void vmx_clear_msr_intercept(struct vcpu *v, unsigned int msr,
         if ( type & VMX_MSR_W )
             clear_bit(msr, msr_bitmap->write_low);
     }
-    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
+    else if ( (msr >= 0xc0000000U) && (msr <= 0xc0001fffU) )
     {
         msr &= 0x1fff;
         if ( type & VMX_MSR_R )
@@ -939,7 +939,7 @@ void vmx_set_msr_intercept(struct vcpu *v, unsigned int msr,
         if ( type & VMX_MSR_W )
             set_bit(msr, msr_bitmap->write_low);
     }
-    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
+    else if ( (msr >= 0xc0000000U) && (msr <= 0xc0001fffU) )
     {
         msr &= 0x1fff;
         if ( type & VMX_MSR_R )
@@ -957,7 +957,7 @@ bool vmx_msr_is_intercepted(struct vmx_msr_bitmap *msr_bitmap,
     if ( msr <= 0x1fff )
         return test_bit(msr, is_write ? msr_bitmap->write_low
                                       : msr_bitmap->read_low);
-    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
+    else if ( (msr >= 0xc0000000U) && (msr <= 0xc0001fffU) )
         return test_bit(msr & 0x1fff, is_write ? msr_bitmap->write_high
                                                : msr_bitmap->read_high);
     else
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 1034534c97..f59de0f124 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -257,14 +257,14 @@ uint64_t get_vvmcs_virtual(void *vvmcs, uint32_t vmcs_encoding)
 
     switch ( enc.width ) {
     case VVMCS_WIDTH_16:
-        res &= 0xffff;
+        res &= 0xffffU;
         break;
    case VVMCS_WIDTH_64:
         if ( enc.access_type )
             res >>= 32;
         break;
     case VVMCS_WIDTH_32:
-        res &= 0xffffffff;
+        res &= 0xffffffffU;
         break;
     case VVMCS_WIDTH_NATURAL:
     default:
@@ -311,19 +311,19 @@ void set_vvmcs_virtual(void *vvmcs, uint32_t vmcs_encoding, uint64_t val)
 
     switch ( enc.width ) {
     case VVMCS_WIDTH_16:
-        res = val & 0xffff;
+        res = val & 0xffffU;
         break;
     case VVMCS_WIDTH_64:
         if ( enc.access_type )
         {
-            res &= 0xffffffff;
+            res &= 0xffffffffU;
             res |= val << 32;
         }
         else
             res = val;
         break;
     case VVMCS_WIDTH_32:
-        res = val & 0xffffffff;
+        res = val & 0xffffffffU;
         break;
     case VVMCS_WIDTH_NATURAL:
     default:
@@ -2307,7 +2307,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         break;
     case MSR_IA32_VMX_CR0_FIXED1:
         /* allow 0-settings for all bits */
-        data = 0xffffffff;
+        data = 0xffffffffU;
         break;
     case MSR_IA32_VMX_CR4_FIXED0:
         /* VMXE bit must be 1 in VMX operation */
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
index d07fcb2bc9..4acf3970f5 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
@@ -207,7 +207,7 @@ void vmx_vmcs_reload(struct vcpu *v);
 #define CPU_BASED_ACTIVATE_MSR_BITMAP         0x10000000
 #define CPU_BASED_MONITOR_EXITING             0x20000000
 #define CPU_BASED_PAUSE_EXITING               0x40000000
-#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000
+#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000U
 extern u32 vmx_cpu_based_exec_control;
 
 #define PIN_BASED_EXT_INTR_MASK         0x00000001
@@ -257,7 +257,7 @@ extern u32 vmx_vmentry_control;
 #define SECONDARY_EXEC_XSAVES                   0x00100000
 #define SECONDARY_EXEC_TSC_SCALING              0x02000000
 #define SECONDARY_EXEC_BUS_LOCK_DETECTION       0x40000000
-#define SECONDARY_EXEC_NOTIFY_VM_EXITING        0x80000000
+#define SECONDARY_EXEC_NOTIFY_VM_EXITING        0x80000000U
 extern u32 vmx_secondary_exec_control;
 
 #define VMX_EPT_EXEC_ONLY_SUPPORTED                         0x00000001
@@ -346,7 +346,7 @@ extern u64 vmx_ept_vpid_cap;
 #define cpu_has_vmx_notify_vm_exiting \
     (vmx_secondary_exec_control & SECONDARY_EXEC_NOTIFY_VM_EXITING)
 
-#define VMCS_RID_TYPE_MASK              0x80000000
+#define VMCS_RID_TYPE_MASK              0x80000000U
 
 /* GUEST_INTERRUPTIBILITY_INFO flags. */
 #define VMX_INTR_SHADOW_STI             0x00000001
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
index 36c108d879..6642688e1d 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
@@ -136,7 +136,7 @@ static inline void pi_clear_sn(struct pi_desc *pi_desc)
 /*
  * Exit Reasons
  */
-#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000
+#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000U
 #define VMX_EXIT_REASONS_BUS_LOCK       (1u << 26)
 
 #define EXIT_REASON_EXCEPTION_NMI       0
@@ -208,12 +208,12 @@ static inline void pi_clear_sn(struct pi_desc *pi_desc)
  * Note INTR_INFO_NMI_UNBLOCKED_BY_IRET is also used with Exit Qualification
  * field for EPT violations, PML full and SPP-related event vmexits.
  */
-#define INTR_INFO_VECTOR_MASK           0xff            /* 7:0 */
-#define INTR_INFO_INTR_TYPE_MASK        0x700           /* 10:8 */
-#define INTR_INFO_DELIVER_CODE_MASK     0x800           /* 11 */
-#define INTR_INFO_NMI_UNBLOCKED_BY_IRET 0x1000          /* 12 */
-#define INTR_INFO_VALID_MASK            0x80000000      /* 31 */
-#define INTR_INFO_RESVD_BITS_MASK       0x7ffff000
+#define INTR_INFO_VECTOR_MASK           0x000000ffU      /* 7:0 */
+#define INTR_INFO_INTR_TYPE_MASK        0x00000700U      /* 10:8 */
+#define INTR_INFO_DELIVER_CODE_MASK     0x00000800U      /* 11 */
+#define INTR_INFO_NMI_UNBLOCKED_BY_IRET 0x00001000U      /* 12 */
+#define INTR_INFO_VALID_MASK            0x80000000U      /* 31 */
+#define INTR_INFO_RESVD_BITS_MASK       0x7ffff000U
 
 /*
  * Exit Qualifications for NOTIFY VM EXIT
@@ -246,15 +246,15 @@ typedef union cr_access_qual {
 /*
  * Access Rights
  */
-#define X86_SEG_AR_SEG_TYPE     0xf        /* 3:0, segment type */
-#define X86_SEG_AR_DESC_TYPE    (1u << 4)  /* 4, descriptor type */
-#define X86_SEG_AR_DPL          0x60       /* 6:5, descriptor privilege level */
-#define X86_SEG_AR_SEG_PRESENT  (1u << 7)  /* 7, segment present */
-#define X86_SEG_AR_AVL          (1u << 12) /* 12, available for system software */
-#define X86_SEG_AR_CS_LM_ACTIVE (1u << 13) /* 13, long mode active (CS only) */
-#define X86_SEG_AR_DEF_OP_SIZE  (1u << 14) /* 14, default operation size */
-#define X86_SEG_AR_GRANULARITY  (1u << 15) /* 15, granularity */
-#define X86_SEG_AR_SEG_UNUSABLE (1u << 16) /* 16, segment unusable */
+#define X86_SEG_AR_SEG_TYPE     0xfU       /* 3:0, segment type */
+#define X86_SEG_AR_DESC_TYPE    (1U << 4)  /* 4, descriptor type */
+#define X86_SEG_AR_DPL          0x60U      /* 6:5, descriptor privilege level */
+#define X86_SEG_AR_SEG_PRESENT  (1U << 7)  /* 7, segment present */
+#define X86_SEG_AR_AVL          (1U << 12) /* 12, available for system software */
+#define X86_SEG_AR_CS_LM_ACTIVE (1U << 13) /* 13, long mode active (CS only) */
+#define X86_SEG_AR_DEF_OP_SIZE  (1U << 14) /* 14, default operation size */
+#define X86_SEG_AR_GRANULARITY  (1U << 15) /* 15, granularity */
+#define X86_SEG_AR_SEG_UNUSABLE (1U << 16) /* 16, segment unusable */
 
 #define VMCALL_OPCODE   ".byte 0x0f,0x01,0xc1\n"
 #define VMCLEAR_OPCODE  ".byte 0x66,0x0f,0xc7\n"        /* reg/opcode: /6 */
@@ -606,7 +606,7 @@ static inline void vmx_pi_hooks_assign(struct domain *d) {}
 static inline void vmx_pi_hooks_deassign(struct domain *d) {}
 #endif
 
-#define APIC_INVALID_DEST           0xffffffff
+#define APIC_INVALID_DEST           0xffffffffU
 
 /* EPT violation qualifications definitions */
 typedef union ept_qual {
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:27:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:27:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559314.874267 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4Pd-0003Sw-7b; Wed, 05 Jul 2023 15:27:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559314.874267; Wed, 05 Jul 2023 15:27:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4Pc-0003RD-Re; Wed, 05 Jul 2023 15:27:24 +0000
Received: by outflank-mailman (input) for mailman id 559314;
 Wed, 05 Jul 2023 15:27:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yX3c=CX=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qH4Pb-0001UO-CH
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:27:23 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 701f4b6e-1b48-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 17:27:22 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.248.64])
 by support.bugseng.com (Postfix) with ESMTPSA id EA41A4EE0C99;
 Wed,  5 Jul 2023 17:27:21 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 701f4b6e-1b48-11ee-b237-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v2 09/13] xen/public: fix violations of MISRA C:2012 Rule 7.2
Date: Wed,  5 Jul 2023 17:26:31 +0200
Message-Id: <9e0d463e2fc09193a742fc7a64a331855705a4fb.1688559115.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1688559115.git.gianluca.luparini@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
---
Changes in v2:
- minor change to commit title
- change commit message
- correct macros code style
---
 xen/include/public/io/ring.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/include/public/io/ring.h b/xen/include/public/io/ring.h
index 025939278b..0cae4367be 100644
--- a/xen/include/public/io/ring.h
+++ b/xen/include/public/io/ring.h
@@ -36,11 +36,11 @@
 typedef unsigned int RING_IDX;
 
 /* Round a 32-bit unsigned constant down to the nearest power of two. */
-#define __RD2(_x)  (((_x) & 0x00000002) ? 0x2                  : ((_x) & 0x1))
-#define __RD4(_x)  (((_x) & 0x0000000c) ? __RD2((_x)>>2)<<2    : __RD2(_x))
-#define __RD8(_x)  (((_x) & 0x000000f0) ? __RD4((_x)>>4)<<4    : __RD4(_x))
-#define __RD16(_x) (((_x) & 0x0000ff00) ? __RD8((_x)>>8)<<8    : __RD8(_x))
-#define __RD32(_x) (((_x) & 0xffff0000) ? __RD16((_x)>>16)<<16 : __RD16(_x))
+#define __RD2(x)  (((x) & 0x00000002U) ? 0x2                     : ((x) & 0x1))
+#define __RD4(x)  (((x) & 0x0000000cU) ? __RD2((x) >> 2) << 2    : __RD2(x))
+#define __RD8(x)  (((x) & 0x000000f0U) ? __RD4((x) >> 4) << 4    : __RD4(x))
+#define __RD16(x) (((x) & 0x0000ff00U) ? __RD8((x) >> 8) << 8    : __RD8(x))
+#define __RD32(x) (((x) & 0xffff0000U) ? __RD16((x) >> 16) << 16 : __RD16(x))
 
 /*
  * Calculate size of a shared ring, given the total available space for the
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:27:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:27:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559317.874285 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4Pf-0004Ej-MM; Wed, 05 Jul 2023 15:27:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559317.874285; Wed, 05 Jul 2023 15:27:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4Pf-0004E6-HA; Wed, 05 Jul 2023 15:27:27 +0000
Received: by outflank-mailman (input) for mailman id 559317;
 Wed, 05 Jul 2023 15:27:25 +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
 <SRS0=yX3c=CX=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qH4Pd-0001jW-MY
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:27:25 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 70dc1d4e-1b48-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 17:27:24 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.248.64])
 by support.bugseng.com (Postfix) with ESMTPSA id CFD1E4EE0C9B;
 Wed,  5 Jul 2023 17:27:22 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 70dc1d4e-1b48-11ee-8611-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Tamas K Lengyel <tamas@tklengyel.com>,
	Alexandru Isaila <aisaila@bitdefender.com>,
	Petre Pircalabu <ppircalabu@bitdefender.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v2 10/13] x86/monitor: fix violations of MISRA C:2012 Rule 7.2
Date: Wed,  5 Jul 2023 17:26:32 +0200
Message-Id: <8fd5ef2ace63cfd86e94aafb533a139f2a7d0f96.1688559115.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1688559115.git.gianluca.luparini@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v2:
- change commit title to make it unique
- change commit message
---
 xen/arch/x86/monitor.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/monitor.c b/xen/arch/x86/monitor.c
index d4857faf8a..dc336c239a 100644
--- a/xen/arch/x86/monitor.c
+++ b/xen/arch/x86/monitor.c
@@ -48,17 +48,17 @@ static unsigned long *monitor_bitmap_for_msr(const struct domain *d, u32 *msr)
 
     switch ( *msr )
     {
-    case 0 ... 0x1fff:
+    case 0 ... 0x1fffU:
         BUILD_BUG_ON(sizeof(d->arch.monitor.msr_bitmap->low) * 8 <= 0x1fff);
         return d->arch.monitor.msr_bitmap->low;
 
-    case 0x40000000 ... 0x40001fff:
+    case 0x40000000U ... 0x40001fffU:
         BUILD_BUG_ON(
             sizeof(d->arch.monitor.msr_bitmap->hypervisor) * 8 <= 0x1fff);
         *msr &= 0x1fff;
         return d->arch.monitor.msr_bitmap->hypervisor;
 
-    case 0xc0000000 ... 0xc0001fff:
+    case 0xc0000000U ... 0xc0001fffU:
         BUILD_BUG_ON(sizeof(d->arch.monitor.msr_bitmap->high) * 8 <= 0x1fff);
         *msr &= 0x1fff;
         return d->arch.monitor.msr_bitmap->high;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:27:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:27:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559319.874294 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4Ph-0004Vb-0t; Wed, 05 Jul 2023 15:27:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559319.874294; Wed, 05 Jul 2023 15:27:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4Pg-0004VM-Q4; Wed, 05 Jul 2023 15:27:28 +0000
Received: by outflank-mailman (input) for mailman id 559319;
 Wed, 05 Jul 2023 15:27:26 +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
 <SRS0=yX3c=CX=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qH4Pe-0001jW-KZ
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:27:26 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7164c290-1b48-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 17:27:25 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.248.64])
 by support.bugseng.com (Postfix) with ESMTPSA id 1E4744EE0C9D;
 Wed,  5 Jul 2023 17:27:24 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7164c290-1b48-11ee-8611-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v2 11/13] xen/vpci: fix violations of MISRA C:2012 Rule 7.2
Date: Wed,  5 Jul 2023 17:26:33 +0200
Message-Id: <4b4fad089f8fc85db19b33524ea6b14b1aef7cbb.1688559115.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1688559115.git.gianluca.luparini@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v2:
- minor change to commit title
- change commit message
---
 xen/drivers/vpci/msi.c  | 2 +-
 xen/drivers/vpci/msix.c | 2 +-
 xen/drivers/vpci/vpci.c | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/vpci/msi.c b/xen/drivers/vpci/msi.c
index 8f2b59e61a..7908a5dac6 100644
--- a/xen/drivers/vpci/msi.c
+++ b/xen/drivers/vpci/msi.c
@@ -124,7 +124,7 @@ static void cf_check address_hi_write(
     struct vpci_msi *msi = data;
 
     /* Clear and update high part. */
-    msi->address &= 0xffffffff;
+    msi->address &= 0xffffffffU;
     msi->address |= (uint64_t)val << 32;
 
     update_msi(pdev, msi);
diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 25bde77586..d440ffcd81 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -531,7 +531,7 @@ static int cf_check msix_write(
 
     case PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET:
         entry->updated = true;
-        entry->addr &= 0xffffffff;
+        entry->addr &= 0xffffffffU;
         entry->addr |= (uint64_t)data << 32;
         break;
 
diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index d73fa76302..3bec9a4153 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -319,7 +319,7 @@ static void vpci_write_hw(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
 static uint32_t merge_result(uint32_t data, uint32_t new, unsigned int size,
                              unsigned int offset)
 {
-    uint32_t mask = 0xffffffff >> (32 - 8 * size);
+    uint32_t mask = 0xffffffffU >> (32 - 8 * size);
 
     return (data & ~(mask << (offset * 8))) | ((new & mask) << (offset * 8));
 }
@@ -402,7 +402,7 @@ uint32_t vpci_read(pci_sbdf_t sbdf, unsigned int reg, unsigned int size)
         data = merge_result(data, tmp_data, size - data_offset, data_offset);
     }
 
-    return data & (0xffffffff >> (32 - 8 * size));
+    return data & (0xffffffffU >> (32 - 8 * size));
 }
 
 /*
@@ -427,7 +427,7 @@ static void vpci_write_helper(const struct pci_dev *pdev,
         data = merge_result(val, data, size, offset);
     }
 
-    r->write(pdev, r->offset, data & (0xffffffff >> (32 - 8 * r->size)),
+    r->write(pdev, r->offset, data & (0xffffffffU >> (32 - 8 * r->size)),
              r->private);
 }
 
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:27:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:27:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559322.874306 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4Pj-0004rb-IS; Wed, 05 Jul 2023 15:27:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559322.874306; Wed, 05 Jul 2023 15:27:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4Pi-0004ps-F5; Wed, 05 Jul 2023 15:27:30 +0000
Received: by outflank-mailman (input) for mailman id 559322;
 Wed, 05 Jul 2023 15:27:29 +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
 <SRS0=yX3c=CX=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qH4Ph-0001jW-Ee
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:27:29 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 72e5859c-1b48-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 17:27:27 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.248.64])
 by support.bugseng.com (Postfix) with ESMTPSA id 4758C4EE0C98;
 Wed,  5 Jul 2023 17:27:26 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 72e5859c-1b48-11ee-8611-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v2 13/13] xen: fix violations of MISRA C:2012 Rule 7.2
Date: Wed,  5 Jul 2023 17:26:35 +0200
Message-Id: <76cf70cb43492966fbcf77d7a2d67d90fe0a32d4.1688559115.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1688559115.git.gianluca.luparini@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
---
Changes in v2:
- minor change to commit title
- change commit message
- add '(uint32_t)' in 'muldiv64.c' for consistency
- add fix in 'vesa.c'
---
 xen/common/gunzip.c          |  2 +-
 xen/common/xmalloc_tlsf.c    |  2 +-
 xen/drivers/char/ehci-dbgp.c |  4 ++--
 xen/drivers/video/vesa.c     |  2 +-
 xen/include/public/memory.h  |  2 +-
 xen/include/public/sysctl.h  |  4 ++--
 xen/include/xen/bitops.h     | 10 +++++-----
 xen/include/xen/cper.h       | 34 +++++++++++++++++-----------------
 xen/lib/muldiv64.c           |  2 +-
 9 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/xen/common/gunzip.c b/xen/common/gunzip.c
index 71ec5f26be..b810499be2 100644
--- a/xen/common/gunzip.c
+++ b/xen/common/gunzip.c
@@ -11,7 +11,7 @@ static unsigned char *__initdata window;
 static memptr __initdata free_mem_ptr;
 static memptr __initdata free_mem_end_ptr;
 
-#define WSIZE           0x80000000
+#define WSIZE           0x80000000U
 
 static unsigned char *__initdata inbuf;
 static unsigned int __initdata insize;
diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c
index 75bdf18c4e..c21bf71e88 100644
--- a/xen/common/xmalloc_tlsf.c
+++ b/xen/common/xmalloc_tlsf.c
@@ -46,7 +46,7 @@
 #define BHDR_OVERHEAD   (sizeof(struct bhdr) - MIN_BLOCK_SIZE)
 
 #define PTR_MASK        (sizeof(void *) - 1)
-#define BLOCK_SIZE_MASK (0xFFFFFFFF - PTR_MASK)
+#define BLOCK_SIZE_MASK (0xFFFFFFFFU - PTR_MASK)
 
 #define GET_NEXT_BLOCK(addr, r) ((struct bhdr *) \
                                 ((char *)(addr) + (r)))
diff --git a/xen/drivers/char/ehci-dbgp.c b/xen/drivers/char/ehci-dbgp.c
index bb9d3198d9..4d8d765122 100644
--- a/xen/drivers/char/ehci-dbgp.c
+++ b/xen/drivers/char/ehci-dbgp.c
@@ -375,12 +375,12 @@ static inline u32 dbgp_pid_write_update(u32 x, u32 tok)
     static u8 data0 = USB_PID_DATA1;
 
     data0 ^= USB_PID_DATA0 ^ USB_PID_DATA1;
-    return (x & 0xffff0000) | (data0 << 8) | (tok & 0xff);
+    return (x & 0xffff0000U) | (data0 << 8) | (tok & 0xffU);
 }
 
 static inline u32 dbgp_pid_read_update(u32 x, u32 tok)
 {
-    return (x & 0xffffff00) | (tok & 0xff);
+    return (x & 0xffffff00U) | (tok & 0xffU);
 }
 
 static inline void dbgp_set_data(struct ehci_dbg_port __iomem *ehci_debug,
diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c
index c41f6b8d40..b007ff5678 100644
--- a/xen/drivers/video/vesa.c
+++ b/xen/drivers/video/vesa.c
@@ -123,7 +123,7 @@ void __init vesa_init(void)
     if ( vlfb_info.bits_per_pixel > 8 )
     {
         /* Light grey in truecolor. */
-        unsigned int grey = 0xaaaaaaaa;
+        unsigned int grey = 0xaaaaaaaaU;
         lfbp.pixel_on =
             ((grey >> (32 - vlfb_info.  red_size)) << vlfb_info.  red_pos) |
             ((grey >> (32 - vlfb_info.green_size)) << vlfb_info.green_pos) |
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index c5f0d31e23..5e545ae9a4 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -234,7 +234,7 @@ struct xen_add_to_physmap {
 
     unsigned int space; /* => enum phys_map_space */
 
-#define XENMAPIDX_grant_table_status 0x80000000
+#define XENMAPIDX_grant_table_status 0x80000000U
 
     /* Index into space being mapped. */
     xen_ulong_t idx;
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 33e86ace51..fa7147de47 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -384,7 +384,7 @@ struct xen_sysctl_pm_op {
         struct xen_set_cpufreq_para set_para;
         uint64_aligned_t get_avgfreq;
         uint32_t                    set_sched_opt_smt;
-#define XEN_SYSCTL_CX_UNLIMITED 0xffffffff
+#define XEN_SYSCTL_CX_UNLIMITED 0xffffffffU
         uint32_t                    get_max_cstate;
         uint32_t                    set_max_cstate;
     } u;
@@ -547,7 +547,7 @@ struct xen_sysctl_numainfo {
 #define XEN_SYSCTL_CPUPOOL_OP_RMCPU                 5  /* R */
 #define XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN            6  /* M */
 #define XEN_SYSCTL_CPUPOOL_OP_FREEINFO              7  /* F */
-#define XEN_SYSCTL_CPUPOOL_PAR_ANY     0xFFFFFFFF
+#define XEN_SYSCTL_CPUPOOL_PAR_ANY     0xFFFFFFFFU
 struct xen_sysctl_cpupool_op {
     uint32_t op;          /* IN */
     uint32_t cpupool_id;  /* IN: CDIARM OUT: CI */
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index 33619a0873..3b7e09a26e 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -227,11 +227,11 @@ static inline __u32 ror32(__u32 word, unsigned int shift)
 }
 
 /* base-2 logarithm */
-#define __L2(_x)  (((_x) & 0x00000002) ?   1 : 0)
-#define __L4(_x)  (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
-#define __L8(_x)  (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
-#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
-#define ilog2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x))
+#define __L2(_x)  (((_x) & 0x00000002U) ?   1 : 0)
+#define __L4(_x)  (((_x) & 0x0000000cU) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
+#define __L8(_x)  (((_x) & 0x000000f0U) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
+#define __L16(_x) (((_x) & 0x0000ff00U) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
+#define ilog2(_x) (((_x) & 0xffff0000U) ? (16 + __L16((_x)>>16)) : __L16(_x))
 
 /**
  * for_each_set_bit - iterate over every set bit in a memory region
diff --git a/xen/include/xen/cper.h b/xen/include/xen/cper.h
index f8e5272bc1..71d14faa02 100644
--- a/xen/include/xen/cper.h
+++ b/xen/include/xen/cper.h
@@ -56,7 +56,7 @@ static inline uint64_t cper_next_record_id(void)
 #define CPER_SIG_RECORD				"CPER"
 #define CPER_SIG_SIZE				4
 /* Used in signature_end field in struct cper_record_header */
-#define CPER_SIG_END				0xffffffff
+#define CPER_SIG_END				0xffffffffU
 
 /*
  * CPER record header revision, used in revision field in struct
@@ -80,36 +80,36 @@ static inline uint64_t cper_next_record_id(void)
  * Corrected Machine Check
  */
 #define CPER_NOTIFY_CMC							\
-	UUID_LE(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4,	\
-		0xEB, 0xD4, 0xF8, 0x90)
+	UUID_LE(0x2DCE8BB1U, 0xBDD7U, 0x450eU, 0xB9U, 0xADU, 0x9CU, 0xF4U,	\
+		0xEBU, 0xD4U, 0xF8U, 0x90U)
 /* Corrected Platform Error */
 #define CPER_NOTIFY_CPE							\
-	UUID_LE(0x4E292F96, 0xD843, 0x4a55, 0xA8, 0xC2, 0xD4, 0x81,	\
-		0xF2, 0x7E, 0xBE, 0xEE)
+	UUID_LE(0x4E292F96U, 0xD843U, 0x4a55U, 0xA8U, 0xC2U, 0xD4U, 0x81U,	\
+		0xF2U, 0x7EU, 0xBEU, 0xEEU)
 /* Machine Check Exception */
 #define CPER_NOTIFY_MCE							\
-	UUID_LE(0xE8F56FFE, 0x919C, 0x4cc5, 0xBA, 0x88, 0x65, 0xAB,	\
-		0xE1, 0x49, 0x13, 0xBB)
+	UUID_LE(0xE8F56FFEU, 0x919CU, 0x4cc5U, 0xBAU, 0x88U, 0x65U, 0xABU,	\
+		0xE1U, 0x49U, 0x13U, 0xBBU)
 /* PCI Express Error */
 #define CPER_NOTIFY_PCIE						\
-	UUID_LE(0xCF93C01F, 0x1A16, 0x4dfc, 0xB8, 0xBC, 0x9C, 0x4D,	\
-		0xAF, 0x67, 0xC1, 0x04)
+	UUID_LE(0xCF93C01FU, 0x1A16U, 0x4dfcU, 0xB8U, 0xBCU, 0x9CU, 0x4DU,	\
+		0xAFU, 0x67U, 0xC1U, 0x04U)
 /* INIT Record (for IPF) */
 #define CPER_NOTIFY_INIT						\
-	UUID_LE(0xCC5263E8, 0x9308, 0x454a, 0x89, 0xD0, 0x34, 0x0B,	\
-		0xD3, 0x9B, 0xC9, 0x8E)
+	UUID_LE(0xCC5263E8U, 0x9308U, 0x454aU, 0x89U, 0xD0U, 0x34U, 0x0BU,	\
+		0xD3U, 0x9BU, 0xC9U, 0x8EU)
 /* Non-Maskable Interrupt */
 #define CPER_NOTIFY_NMI							\
-	UUID_LE(0x5BAD89FF, 0xB7E6, 0x42c9, 0x81, 0x4A, 0xCF, 0x24,	\
-		0x85, 0xD6, 0xE9, 0x8A)
+	UUID_LE(0x5BAD89FFU, 0xB7E6U, 0x42c9U, 0x81U, 0x4AU, 0xCFU, 0x24U,	\
+		0x85U, 0xD6U, 0xE9U, 0x8AU)
 /* BOOT Error Record */
 #define CPER_NOTIFY_BOOT						\
-	UUID_LE(0x3D61A466, 0xAB40, 0x409a, 0xA6, 0x98, 0xF3, 0x62,	\
-		0xD4, 0x64, 0xB3, 0x8F)
+	UUID_LE(0x3D61A466U, 0xAB40U, 0x409aU, 0xA6U, 0x98U, 0xF3U, 0x62U,	\
+		0xD4U, 0x64U, 0xB3U, 0x8FU)
 /* DMA Remapping Error */
 #define CPER_NOTIFY_DMAR						\
-	UUID_LE(0x667DD791, 0xC6B3, 0x4c27, 0x8A, 0x6B, 0x0F, 0x8E,	\
-		0x72, 0x2D, 0xEB, 0x41)
+	UUID_LE(0x667DD791U, 0xC6B3U, 0x4c27U, 0x8AU, 0x6BU, 0x0FU, 0x8EU,	\
+		0x72U, 0x2DU, 0xEBU, 0x41U)
 
 /*
  * Flags bits definitions for flags in struct cper_record_header
diff --git a/xen/lib/muldiv64.c b/xen/lib/muldiv64.c
index 78177ce616..e9bacc4c59 100644
--- a/xen/lib/muldiv64.c
+++ b/xen/lib/muldiv64.c
@@ -27,7 +27,7 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)
     rh = (uint64_t)u.l.high * (uint64_t)b;
     rh += (rl >> 32);
     res.l.high = rh / c;
-    res.l.low = (((rh % c) << 32) + (rl & 0xffffffff)) / c;
+    res.l.low = (((rh % c) << 32) + ((uint32_t)rl & 0xffffffffU)) / c;
 
     return res.ll;
 #endif
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:30:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:30:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559375.874315 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4SM-0001GK-6p; Wed, 05 Jul 2023 15:30:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559375.874315; Wed, 05 Jul 2023 15:30:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4SM-0001GD-0N; Wed, 05 Jul 2023 15:30:14 +0000
Received: by outflank-mailman (input) for mailman id 559375;
 Wed, 05 Jul 2023 15:30:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yX3c=CX=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qH4Pf-0001UO-SV
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:27:28 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 722e86fe-1b48-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 17:27:26 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.248.64])
 by support.bugseng.com (Postfix) with ESMTPSA id 07A434EE0C88;
 Wed,  5 Jul 2023 17:27:24 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 722e86fe-1b48-11ee-b237-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Paul Durrant <paul@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v2 12/13] xen/x86: fix violations of MISRA C:2012 Rule 7.2
Date: Wed,  5 Jul 2023 17:26:34 +0200
Message-Id: <e414542d76d4a4a0df6ad969cc6332e355d6ef38.1688559115.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1688559115.git.gianluca.luparini@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
---
Changes in v2:
- minor change to commit title
- change commit message
- remove comments from 'gr_mask' in 'stdvga.c'
- correct code style in 'trace.h'
- add fix in 'extable.c'
- remove changes in 'x86-defns.h', 'msr-index.h' and 'xen-x86_64.h'
---
 xen/arch/x86/apic.c                          |   2 +-
 xen/arch/x86/cpu-policy.c                    |   8 +-
 xen/arch/x86/cpu/mcheck/mce-apei.c           |   8 +-
 xen/arch/x86/cpuid.c                         |   8 +-
 xen/arch/x86/efi/efi-boot.h                  |   6 +-
 xen/arch/x86/extable.c                       |   2 +-
 xen/arch/x86/hvm/hypercall.c                 |   2 +-
 xen/arch/x86/hvm/irq.c                       |   2 +-
 xen/arch/x86/hvm/pmtimer.c                   |   4 +-
 xen/arch/x86/hvm/stdvga.c                    |  66 +++---
 xen/arch/x86/hvm/viridian/viridian.c         |   2 +-
 xen/arch/x86/hvm/vlapic.c                    |   6 +-
 xen/arch/x86/include/asm/apicdef.h           |   2 +-
 xen/arch/x86/include/asm/config.h            |   2 +-
 xen/arch/x86/include/asm/guest/hyperv-tlfs.h |  28 +--
 xen/arch/x86/include/asm/hpet.h              |   2 +-
 xen/arch/x86/include/asm/hvm/trace.h         |   4 +-
 xen/arch/x86/include/asm/hvm/vioapic.h       |   2 +-
 xen/arch/x86/include/asm/msi.h               |   2 +-
 xen/arch/x86/include/asm/msr-index.h         | 202 +++++++++----------
 xen/arch/x86/include/asm/pci.h               |   8 +-
 xen/arch/x86/include/asm/x86-defns.h         |   2 +-
 xen/arch/x86/percpu.c                        |   2 +-
 xen/arch/x86/psr.c                           |   2 +-
 xen/arch/x86/spec_ctrl.c                     |   8 +-
 xen/arch/x86/x86_64/acpi_mmcfg.c             |   2 +-
 xen/arch/x86/x86_64/pci.c                    |   2 +-
 xen/arch/x86/x86_emulate/x86_emulate.h       |   2 +-
 xen/lib/x86/cpuid.c                          |   8 +-
 xen/lib/x86/policy.c                         |   2 +-
 30 files changed, 199 insertions(+), 199 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index f71474d47d..03c5c0f2ee 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1211,7 +1211,7 @@ static void __init calibrate_APIC_clock(void)
      * Setup the APIC counter to maximum. There is no way the lapic
      * can underflow in the 100ms detection time frame.
      */
-    __setup_APIC_LVTT(0xffffffff);
+    __setup_APIC_LVTT(0xffffffffU);
 
     bus_freq = calibrate_apic_timer();
     if ( !bus_freq )
diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c
index f40eeb8be8..5516249cb6 100644
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -321,7 +321,7 @@ static void recalculate_misc(struct cpu_policy *p)
         p->extd.vendor_edx = p->basic.vendor_edx;
 
         p->extd.raw_fms = p->basic.raw_fms;
-        p->extd.raw[0x1].b &= 0xff00ffff;
+        p->extd.raw[0x1].b &= 0xff00ffffU;
         p->extd.e1d |= p->basic._1d & CPUID_COMMON_1D_FEATURES;
 
         p->extd.raw[0x8].a &= 0x0000ffff; /* GuestMaxPhysAddr hidden. */
@@ -378,9 +378,9 @@ static void __init calculate_host_policy(void)
      * this information.
      */
     if ( cpu_has_lfence_dispatch )
-        max_extd_leaf = max(max_extd_leaf, 0x80000021);
+        max_extd_leaf = max(max_extd_leaf, 0x80000021U);
 
-    p->extd.max_leaf = 0x80000000 | min_t(uint32_t, max_extd_leaf & 0xffff,
+    p->extd.max_leaf = 0x80000000U | min_t(uint32_t, max_extd_leaf & 0xffffU,
                                           ARRAY_SIZE(p->extd.raw) - 1);
 
     x86_cpu_featureset_to_policy(boot_cpu_data.x86_capability, p);
@@ -768,7 +768,7 @@ void recalculate_cpuid_policy(struct domain *d)
 
     p->basic.max_leaf   = min(p->basic.max_leaf,   max->basic.max_leaf);
     p->feat.max_subleaf = min(p->feat.max_subleaf, max->feat.max_subleaf);
-    p->extd.max_leaf    = 0x80000000 | min(p->extd.max_leaf & 0xffff,
+    p->extd.max_leaf    = 0x80000000U | min(p->extd.max_leaf & 0xffff,
                                            ((p->x86_vendor & (X86_VENDOR_AMD |
                                                               X86_VENDOR_HYGON))
                                             ? CPUID_GUEST_NR_EXTD_AMD
diff --git a/xen/arch/x86/cpu/mcheck/mce-apei.c b/xen/arch/x86/cpu/mcheck/mce-apei.c
index 53b6735896..1aa213b321 100644
--- a/xen/arch/x86/cpu/mcheck/mce-apei.c
+++ b/xen/arch/x86/cpu/mcheck/mce-apei.c
@@ -37,11 +37,11 @@
 #include "mce.h"
 
 #define CPER_CREATOR_MCE						\
-	UUID_LE(0x75a574e3, 0x5052, 0x4b29, 0x8a, 0x8e, 0xbe, 0x2c,	\
-		0x64, 0x90, 0xb8, 0x9d)
+	UUID_LE(0x75a574e3U, 0x5052U, 0x4b29U, 0x8aU, 0x8eU, 0xbeU, 0x2cU,	\
+		0x64U, 0x90U, 0xb8U, 0x9dU)
 #define CPER_SECTION_TYPE_MCE						\
-	UUID_LE(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96,	\
-		0x04, 0x4a, 0x38, 0xfc)
+	UUID_LE(0xfe08ffbeU, 0x95e4U, 0x4be7U, 0xbcU, 0x73U, 0x40U, 0x96U,	\
+		0x04U, 0x4aU, 0x38U, 0xfcU)
 
 /*
  * CPER specification (in UEFI specification 2.3 appendix N) requires
diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c
index 455a09b2dd..7290a979c6 100644
--- a/xen/arch/x86/cpuid.c
+++ b/xen/arch/x86/cpuid.c
@@ -93,7 +93,7 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
         }
         break;
 
-    case 0x40000000 ... 0x400000ff:
+    case 0x40000000U ... 0x400000ffU:
         if ( is_viridian_domain(d) )
             return cpuid_viridian_leaves(v, leaf, subleaf, res);
 
@@ -103,10 +103,10 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
          * Intel reserve up until 0x4fffffff for hypervisor use.  AMD reserve
          * only until 0x400000ff, but we already use double that.
          */
-    case 0x40000100 ... 0x400001ff:
+    case 0x40000100U ... 0x400001ffU:
         return cpuid_hypervisor_leaves(v, leaf, subleaf, res);
 
-    case 0x80000000 ... 0x80000000 + CPUID_GUEST_NR_EXTD - 1:
+    case 0x80000000U ... 0x80000000U + CPUID_GUEST_NR_EXTD - 1:
         ASSERT((p->extd.max_leaf & 0xffff) < ARRAY_SIZE(p->extd.raw));
         if ( (leaf & 0xffff) > min_t(uint32_t, p->extd.max_leaf & 0xffff,
                                      ARRAY_SIZE(p->extd.raw) - 1) )
@@ -352,7 +352,7 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
         }
         break;
 
-    case 0x80000001:
+    case 0x80000001U:
         /* SYSCALL is hidden outside of long mode on Intel. */
         if ( p->x86_vendor == X86_VENDOR_INTEL &&
              is_hvm_domain(d) && !hvm_long_mode_active(v) )
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 64c1a02cf1..cef3c2634e 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -740,16 +740,16 @@ static void __init efi_arch_handle_module(const struct file *file,
 
 static void __init efi_arch_cpu(void)
 {
-    uint32_t eax = cpuid_eax(0x80000000);
+    uint32_t eax = cpuid_eax(0x80000000U);
     uint32_t *caps = boot_cpu_data.x86_capability;
 
     boot_tsc_stamp = rdtsc();
 
     caps[FEATURESET_1c] = cpuid_ecx(1);
 
-    if ( (eax >> 16) == 0x8000 && eax > 0x80000000 )
+    if ( (eax >> 16) == 0x8000 && eax > 0x80000000U )
     {
-        caps[FEATURESET_e1d] = cpuid_edx(0x80000001);
+        caps[FEATURESET_e1d] = cpuid_edx(0x80000001U);
 
         /*
          * This check purposefully doesn't use cpu_has_nx because
diff --git a/xen/arch/x86/extable.c b/xen/arch/x86/extable.c
index c3771c2e39..6951a433e8 100644
--- a/xen/arch/x86/extable.c
+++ b/xen/arch/x86/extable.c
@@ -141,7 +141,7 @@ static int __init cf_check stub_selftest(void)
           .rax = 0x0123456789abcdef,
           .res.fields.trapnr = X86_EXC_GP },
         { .opc = { endbr64, 0x02, 0x04, 0x04, 0xc3 }, /* add (%rsp,%rax),%al */
-          .rax = 0xfedcba9876543210,
+          .rax = 0xfedcba9876543210U,
           .res.fields.trapnr = X86_EXC_SS },
         { .opc = { endbr64, 0xcc, 0xc3, 0xc3, 0xc3 }, /* int3 */
           .res.fields.trapnr = X86_EXC_BP },
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 20d266ffd5..eeb73e1aa5 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen/arch/x86/hvm/hypercall.c
@@ -129,7 +129,7 @@ int hvm_hypercall(struct cpu_user_regs *regs)
         break;
     }
 
-    if ( (eax & 0x80000000) && is_viridian_domain(currd) )
+    if ( (eax & 0x80000000U) && is_viridian_domain(currd) )
     {
         int ret;
 
diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index 1258371eb0..5c00127cfc 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -383,7 +383,7 @@ int hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
 
     if ( !vector )
     {
-        int pirq = ((addr >> 32) & 0xffffff00) | dest;
+        int pirq = ((addr >> 32) & 0xffffff00U) | dest;
 
         if ( pirq > 0 )
         {
diff --git a/xen/arch/x86/hvm/pmtimer.c b/xen/arch/x86/hvm/pmtimer.c
index 2145c531b6..eb4a455763 100644
--- a/xen/arch/x86/hvm/pmtimer.c
+++ b/xen/arch/x86/hvm/pmtimer.c
@@ -40,8 +40,8 @@
 #define SCI_IRQ 9
 
 /* We provide a 32-bit counter (must match the TMR_VAL_EXT bit in the FADT) */
-#define TMR_VAL_MASK  (0xffffffff)
-#define TMR_VAL_MSB   (0x80000000)
+#define TMR_VAL_MASK  (0xffffffffU)
+#define TMR_VAL_MSB   (0x80000000U)
 
 /* Dispatch SCIs based on the PM1a_STS and PM1a_EN registers */
 static void pmt_update_sci(PMTState *s)
diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index 798a9a0549..d2cc7e0457 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -39,46 +39,46 @@
 
 #define PAT(x) (x)
 static const uint32_t mask16[16] = {
-    PAT(0x00000000),
-    PAT(0x000000ff),
-    PAT(0x0000ff00),
-    PAT(0x0000ffff),
-    PAT(0x00ff0000),
-    PAT(0x00ff00ff),
-    PAT(0x00ffff00),
-    PAT(0x00ffffff),
-    PAT(0xff000000),
-    PAT(0xff0000ff),
-    PAT(0xff00ff00),
-    PAT(0xff00ffff),
-    PAT(0xffff0000),
-    PAT(0xffff00ff),
-    PAT(0xffffff00),
-    PAT(0xffffffff),
+    PAT(0x00000000U),
+    PAT(0x000000ffU),
+    PAT(0x0000ff00U),
+    PAT(0x0000ffffU),
+    PAT(0x00ff0000U),
+    PAT(0x00ff00ffU),
+    PAT(0x00ffff00U),
+    PAT(0x00ffffffU),
+    PAT(0xff000000U),
+    PAT(0xff0000ffU),
+    PAT(0xff00ff00U),
+    PAT(0xff00ffffU),
+    PAT(0xffff0000U),
+    PAT(0xffff00ffU),
+    PAT(0xffffff00U),
+    PAT(0xffffffffU),
 };
 
 /* force some bits to zero */
 static const uint8_t sr_mask[8] = {
-    (uint8_t)~0xfc,
-    (uint8_t)~0xc2,
-    (uint8_t)~0xf0,
-    (uint8_t)~0xc0,
-    (uint8_t)~0xf1,
-    (uint8_t)~0xff,
-    (uint8_t)~0xff,
-    (uint8_t)~0x00,
+    (uint8_t)~0xfcU,
+    (uint8_t)~0xc2U,
+    (uint8_t)~0xf0U,
+    (uint8_t)~0xc0U,
+    (uint8_t)~0xf1U,
+    (uint8_t)~0xffU,
+    (uint8_t)~0xffU,
+    (uint8_t)~0x00U,
 };
 
 static const uint8_t gr_mask[9] = {
-    (uint8_t)~0xf0, /* 0x00 */
-    (uint8_t)~0xf0, /* 0x01 */
-    (uint8_t)~0xf0, /* 0x02 */
-    (uint8_t)~0xe0, /* 0x03 */
-    (uint8_t)~0xfc, /* 0x04 */
-    (uint8_t)~0x84, /* 0x05 */
-    (uint8_t)~0xf0, /* 0x06 */
-    (uint8_t)~0xf0, /* 0x07 */
-    (uint8_t)~0x00, /* 0x08 */
+    (uint8_t)~0xf0U,
+    (uint8_t)~0xf0U,
+    (uint8_t)~0xf0U,
+    (uint8_t)~0xe0U,
+    (uint8_t)~0xfcU,
+    (uint8_t)~0x84U,
+    (uint8_t)~0xf0U,
+    (uint8_t)~0xf0U,
+    (uint8_t)~0x00U,
 };
 
 static uint8_t *vram_getb(struct hvm_hw_stdvga *s, unsigned int a)
diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 7405c117bc..61171e3363 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -291,7 +291,7 @@ static void enable_hypercall_page(struct domain *d)
      * calling convention) to differentiate Xen and Viridian hypercalls.
      */
     *(u8  *)(p + 0) = 0x0d; /* orl $0x80000000, %eax */
-    *(u32 *)(p + 1) = 0x80000000;
+    *(u32 *)(p + 1) = 0x80000000U;
     *(u8  *)(p + 5) = 0x0f; /* vmcall/vmmcall */
     *(u8  *)(p + 6) = 0x01;
     *(u8  *)(p + 7) = (cpu_has_vmx ? 0xc1 : 0xd9);
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index c7ce82d064..a8e87c4446 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -237,7 +237,7 @@ bool_t vlapic_match_dest(
     case APIC_DEST_NOSHORT:
         if ( dest_mode )
             return vlapic_match_logical_addr(target, dest);
-        return (dest == _VLAPIC_ID(target, 0xffffffff)) ||
+        return (dest == _VLAPIC_ID(target, 0xffffffffU)) ||
                (dest == VLAPIC_ID(target));
 
     case APIC_DEST_SELF:
@@ -467,7 +467,7 @@ static bool_t is_multicast_dest(struct vlapic *vlapic, unsigned int short_hand,
         return short_hand != APIC_DEST_SELF;
 
     if ( vlapic_x2apic_mode(vlapic) )
-        return dest_mode ? hweight16(dest) > 1 : dest == 0xffffffff;
+        return dest_mode ? hweight16(dest) > 1 : dest == 0xffffffffU;
 
     if ( dest_mode )
         return hweight8(dest &
@@ -831,7 +831,7 @@ void vlapic_reg_write(struct vcpu *v, unsigned int reg, uint32_t val)
         break;
 
     case APIC_ICR2:
-        vlapic_set_reg(vlapic, APIC_ICR2, val & 0xff000000);
+        vlapic_set_reg(vlapic, APIC_ICR2, val & 0xff000000U);
         break;
 
     case APIC_LVTT:         /* LVT Timer Reg */
diff --git a/xen/arch/x86/include/asm/apicdef.h b/xen/arch/x86/include/asm/apicdef.h
index 2440d83c8d..7f21d3f49c 100644
--- a/xen/arch/x86/include/asm/apicdef.h
+++ b/xen/arch/x86/include/asm/apicdef.h
@@ -8,7 +8,7 @@
  * Ingo Molnar <mingo@redhat.com>, 1999, 2000
  */
 
-#define		APIC_DEFAULT_PHYS_BASE	0xfee00000
+#define		APIC_DEFAULT_PHYS_BASE	0xfee00000U
  
 #define		APIC_ID		0x20
 #define			APIC_ID_MASK		(0xFFu<<24)
diff --git a/xen/arch/x86/include/asm/config.h b/xen/arch/x86/include/asm/config.h
index fbc4bb3416..bbced338be 100644
--- a/xen/arch/x86/include/asm/config.h
+++ b/xen/arch/x86/include/asm/config.h
@@ -257,7 +257,7 @@ extern unsigned char boot_edid_info[128];
 #endif /* CONFIG_PV32 */
 
 #define MACH2PHYS_COMPAT_VIRT_START    HYPERVISOR_COMPAT_VIRT_START
-#define MACH2PHYS_COMPAT_VIRT_END      0xFFE00000
+#define MACH2PHYS_COMPAT_VIRT_END      0xFFE00000U
 #define MACH2PHYS_COMPAT_NR_ENTRIES(d) \
     ((MACH2PHYS_COMPAT_VIRT_END-MACH2PHYS_COMPAT_VIRT_START(d))>>2)
 
diff --git a/xen/arch/x86/include/asm/guest/hyperv-tlfs.h b/xen/arch/x86/include/asm/guest/hyperv-tlfs.h
index 38f997a0c8..a6915ad731 100644
--- a/xen/arch/x86/include/asm/guest/hyperv-tlfs.h
+++ b/xen/arch/x86/include/asm/guest/hyperv-tlfs.h
@@ -471,30 +471,30 @@ typedef struct _HV_REFERENCE_TSC_PAGE {
 
 /* Define hypervisor message types. */
 enum hv_message_type {
-	HVMSG_NONE			= 0x00000000,
+	HVMSG_NONE			= 0x00000000U,
 
 	/* Memory access messages. */
-	HVMSG_UNMAPPED_GPA		= 0x80000000,
-	HVMSG_GPA_INTERCEPT		= 0x80000001,
+	HVMSG_UNMAPPED_GPA		= 0x80000000U,
+	HVMSG_GPA_INTERCEPT		= 0x80000001U,
 
 	/* Timer notification messages. */
-	HVMSG_TIMER_EXPIRED			= 0x80000010,
+	HVMSG_TIMER_EXPIRED			= 0x80000010U,
 
 	/* Error messages. */
-	HVMSG_INVALID_VP_REGISTER_VALUE	= 0x80000020,
-	HVMSG_UNRECOVERABLE_EXCEPTION	= 0x80000021,
-	HVMSG_UNSUPPORTED_FEATURE		= 0x80000022,
+	HVMSG_INVALID_VP_REGISTER_VALUE	= 0x80000020U,
+	HVMSG_UNRECOVERABLE_EXCEPTION	= 0x80000021U,
+	HVMSG_UNSUPPORTED_FEATURE		= 0x80000022U,
 
 	/* Trace buffer complete messages. */
-	HVMSG_EVENTLOG_BUFFERCOMPLETE	= 0x80000040,
+	HVMSG_EVENTLOG_BUFFERCOMPLETE	= 0x80000040U,
 
 	/* Platform-specific processor intercept messages. */
-	HVMSG_X64_IOPORT_INTERCEPT		= 0x80010000,
-	HVMSG_X64_MSR_INTERCEPT		= 0x80010001,
-	HVMSG_X64_CPUID_INTERCEPT		= 0x80010002,
-	HVMSG_X64_EXCEPTION_INTERCEPT	= 0x80010003,
-	HVMSG_X64_APIC_EOI			= 0x80010004,
-	HVMSG_X64_LEGACY_FP_ERROR		= 0x80010005
+	HVMSG_X64_IOPORT_INTERCEPT		= 0x80010000U,
+	HVMSG_X64_MSR_INTERCEPT		= 0x80010001U,
+	HVMSG_X64_CPUID_INTERCEPT		= 0x80010002U,
+	HVMSG_X64_EXCEPTION_INTERCEPT	= 0x80010003U,
+	HVMSG_X64_APIC_EOI			= 0x80010004U,
+	HVMSG_X64_LEGACY_FP_ERROR		= 0x80010005U
 };
 
 /* Define synthetic interrupt controller message flags. */
diff --git a/xen/arch/x86/include/asm/hpet.h b/xen/arch/x86/include/asm/hpet.h
index 9919f74730..c5e8e9c8db 100644
--- a/xen/arch/x86/include/asm/hpet.h
+++ b/xen/arch/x86/include/asm/hpet.h
@@ -41,7 +41,7 @@
 #define HPET_TN_ROUTE		0x3e00
 #define HPET_TN_FSB		0x4000
 #define HPET_TN_FSB_CAP		0x8000
-#define HPET_TN_RESERVED	0xffff0081
+#define HPET_TN_RESERVED	0xffff0081U
 #define HPET_TN_INT_ROUTE_CAP	(0xffffffffULL << 32)
 
 
diff --git a/xen/arch/x86/include/asm/hvm/trace.h b/xen/arch/x86/include/asm/hvm/trace.h
index 696e42eb94..0437966d1f 100644
--- a/xen/arch/x86/include/asm/hvm/trace.h
+++ b/xen/arch/x86/include/asm/hvm/trace.h
@@ -58,7 +58,7 @@
 #define DO_TRC_HVM_VLAPIC           DEFAULT_HVM_MISC
 
 
-#define TRC_PAR_LONG(par) ((par)&0xFFFFFFFF),((par)>>32)
+#define TRC_PAR_LONG(par) ((par) & 0xFFFFFFFFU), ((par) >> 32)
 
 #define TRACE_2_LONG_2D(_e, d1, d2, ...) \
     TRACE_4D(_e, d1, d2)
@@ -93,7 +93,7 @@
     HVMTRACE_ND(evt, 0, 0)
 
 #define HVMTRACE_LONG_1D(evt, d1)                  \
-                   HVMTRACE_2D(evt ## 64, (d1) & 0xFFFFFFFF, (d1) >> 32)
+                   HVMTRACE_2D(evt ## 64, (d1) & 0xFFFFFFFFU, (d1) >> 32)
 #define HVMTRACE_LONG_2D(evt, d1, d2, ...)              \
                    HVMTRACE_3D(evt ## 64, d1, d2)
 #define HVMTRACE_LONG_3D(evt, d1, d2, d3, ...)      \
diff --git a/xen/arch/x86/include/asm/hvm/vioapic.h b/xen/arch/x86/include/asm/hvm/vioapic.h
index 2944ec20dd..68af6dce79 100644
--- a/xen/arch/x86/include/asm/hvm/vioapic.h
+++ b/xen/arch/x86/include/asm/hvm/vioapic.h
@@ -32,7 +32,7 @@
 #define VIOAPIC_EDGE_TRIG  0
 #define VIOAPIC_LEVEL_TRIG 1
 
-#define VIOAPIC_DEFAULT_BASE_ADDRESS  0xfec00000
+#define VIOAPIC_DEFAULT_BASE_ADDRESS  0xfec00000U
 #define VIOAPIC_MEM_LENGTH            0x100
 
 /* Direct registers. */
diff --git a/xen/arch/x86/include/asm/msi.h b/xen/arch/x86/include/asm/msi.h
index a53ade95c9..d89723d009 100644
--- a/xen/arch/x86/include/asm/msi.h
+++ b/xen/arch/x86/include/asm/msi.h
@@ -37,7 +37,7 @@
  */
 
 #define MSI_ADDR_BASE_HI            0
-#define MSI_ADDR_BASE_LO            0xfee00000
+#define MSI_ADDR_BASE_LO            0xfee00000U
 #define MSI_ADDR_BASE_MASK          (~0xfffff)
 #define MSI_ADDR_HEADER             MSI_ADDR_BASE_LO
 
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 4f861c0bb4..69ca8677c0 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -30,7 +30,7 @@
 
 #define MSR_INTEL_CORE_THREAD_COUNT         0x00000035
 #define  MSR_CTC_THREAD_MASK                0x0000ffff
-#define  MSR_CTC_CORE_MASK                  0xffff0000
+#define  MSR_CTC_CORE_MASK                  0xffff0000U
 
 #define MSR_SPEC_CTRL                       0x00000048
 #define  SPEC_CTRL_IBRS                     (_AC(1, ULL) <<  0)
@@ -181,35 +181,35 @@
     (EFER_SCE | EFER_LME | EFER_LMA | EFER_NXE | EFER_SVME | EFER_FFXSE | \
      EFER_AIBRSE)
 
-#define MSR_STAR                            0xc0000081 /* legacy mode SYSCALL target */
-#define MSR_LSTAR                           0xc0000082 /* long mode SYSCALL target */
-#define MSR_CSTAR                           0xc0000083 /* compat mode SYSCALL target */
-#define MSR_SYSCALL_MASK                    0xc0000084 /* EFLAGS mask for syscall */
-#define MSR_FS_BASE                         0xc0000100 /* 64bit FS base */
-#define MSR_GS_BASE                         0xc0000101 /* 64bit GS base */
-#define MSR_SHADOW_GS_BASE                  0xc0000102 /* SwapGS GS shadow */
-#define MSR_TSC_AUX                         0xc0000103 /* Auxiliary TSC */
+#define MSR_STAR                            0xc0000081U /* legacy mode SYSCALL target */
+#define MSR_LSTAR                           0xc0000082U /* long mode SYSCALL target */
+#define MSR_CSTAR                           0xc0000083U /* compat mode SYSCALL target */
+#define MSR_SYSCALL_MASK                    0xc0000084U /* EFLAGS mask for syscall */
+#define MSR_FS_BASE                         0xc0000100U /* 64bit FS base */
+#define MSR_GS_BASE                         0xc0000101U /* 64bit GS base */
+#define MSR_SHADOW_GS_BASE                  0xc0000102U /* SwapGS GS shadow */
+#define MSR_TSC_AUX                         0xc0000103U /* Auxiliary TSC */
 
-#define MSR_K8_SYSCFG                       0xc0010010
+#define MSR_K8_SYSCFG                       0xc0010010U
 #define  SYSCFG_MTRR_FIX_DRAM_EN            (_AC(1, ULL) << 18)
 #define  SYSCFG_MTRR_FIX_DRAM_MOD_EN        (_AC(1, ULL) << 19)
 #define  SYSCFG_MTRR_VAR_DRAM_EN            (_AC(1, ULL) << 20)
 #define  SYSCFG_MTRR_TOM2_EN                (_AC(1, ULL) << 21)
 #define  SYSCFG_TOM2_FORCE_WB               (_AC(1, ULL) << 22)
 
-#define MSR_K8_IORR_BASE0                   0xc0010016
-#define MSR_K8_IORR_MASK0                   0xc0010017
-#define MSR_K8_IORR_BASE1                   0xc0010018
-#define MSR_K8_IORR_MASK1                   0xc0010019
+#define MSR_K8_IORR_BASE0                   0xc0010016U
+#define MSR_K8_IORR_MASK0                   0xc0010017U
+#define MSR_K8_IORR_BASE1                   0xc0010018U
+#define MSR_K8_IORR_MASK1                   0xc0010019U
 
-#define MSR_K8_TSEG_BASE                    0xc0010112 /* AMD doc: SMMAddr */
-#define MSR_K8_TSEG_MASK                    0xc0010113 /* AMD doc: SMMMask */
+#define MSR_K8_TSEG_BASE                    0xc0010112U /* AMD doc: SMMAddr */
+#define MSR_K8_TSEG_MASK                    0xc0010113U /* AMD doc: SMMMask */
 
-#define MSR_K8_VM_CR                        0xc0010114
+#define MSR_K8_VM_CR                        0xc0010114U
 #define  VM_CR_INIT_REDIRECTION             (_AC(1, ULL) <<  1)
 #define  VM_CR_SVM_DISABLE                  (_AC(1, ULL) <<  4)
 
-#define MSR_VIRT_SPEC_CTRL                  0xc001011f /* Layout matches MSR_SPEC_CTRL */
+#define MSR_VIRT_SPEC_CTRL                  0xc001011fU /* Layout matches MSR_SPEC_CTRL */
 
 /*
  * Legacy MSR constants in need of cleanup.  No new MSRs below this comment.
@@ -293,7 +293,7 @@
 #define CMCI_EN 			(1UL<<30)
 #define CMCI_THRESHOLD_MASK		0x7FFF
 
-#define MSR_AMD64_MC0_MASK		0xc0010044
+#define MSR_AMD64_MC0_MASK		0xc0010044U
 
 #define MSR_IA32_MCx_CTL(x)		(MSR_IA32_MC0_CTL + 4*(x))
 #define MSR_IA32_MCx_STATUS(x)		(MSR_IA32_MC0_STATUS + 4*(x))
@@ -325,83 +325,83 @@
 
 /* K7/K8 MSRs. Not complete. See the architecture manual for a more
    complete list. */
-#define MSR_K7_EVNTSEL0			0xc0010000
-#define MSR_K7_PERFCTR0			0xc0010004
-#define MSR_K7_EVNTSEL1			0xc0010001
-#define MSR_K7_PERFCTR1			0xc0010005
-#define MSR_K7_EVNTSEL2			0xc0010002
-#define MSR_K7_PERFCTR2			0xc0010006
-#define MSR_K7_EVNTSEL3			0xc0010003
-#define MSR_K7_PERFCTR3			0xc0010007
-#define MSR_K8_TOP_MEM1			0xc001001a
-#define MSR_K7_CLK_CTL			0xc001001b
-#define MSR_K8_TOP_MEM2			0xc001001d
-
-#define MSR_K8_HWCR			0xc0010015
+#define MSR_K7_EVNTSEL0			0xc0010000U
+#define MSR_K7_PERFCTR0			0xc0010004U
+#define MSR_K7_EVNTSEL1			0xc0010001U
+#define MSR_K7_PERFCTR1			0xc0010005U
+#define MSR_K7_EVNTSEL2			0xc0010002U
+#define MSR_K7_PERFCTR2			0xc0010006U
+#define MSR_K7_EVNTSEL3			0xc0010003U
+#define MSR_K7_PERFCTR3			0xc0010007U
+#define MSR_K8_TOP_MEM1			0xc001001aU
+#define MSR_K7_CLK_CTL			0xc001001bU
+#define MSR_K8_TOP_MEM2			0xc001001dU
+
+#define MSR_K8_HWCR			0xc0010015U
 #define K8_HWCR_TSC_FREQ_SEL		(1ULL << 24)
 #define K8_HWCR_CPUID_USER_DIS		(1ULL << 35)
 
-#define MSR_K7_FID_VID_CTL		0xc0010041
-#define MSR_K7_FID_VID_STATUS		0xc0010042
-#define MSR_K8_PSTATE_LIMIT		0xc0010061
-#define MSR_K8_PSTATE_CTRL		0xc0010062
-#define MSR_K8_PSTATE_STATUS		0xc0010063
-#define MSR_K8_PSTATE0			0xc0010064
-#define MSR_K8_PSTATE1			0xc0010065
-#define MSR_K8_PSTATE2			0xc0010066
-#define MSR_K8_PSTATE3			0xc0010067
-#define MSR_K8_PSTATE4			0xc0010068
-#define MSR_K8_PSTATE5			0xc0010069
-#define MSR_K8_PSTATE6			0xc001006A
-#define MSR_K8_PSTATE7			0xc001006B
-#define MSR_K8_ENABLE_C1E		0xc0010055
-#define MSR_K8_VM_HSAVE_PA		0xc0010117
-
-#define MSR_AMD_FAM15H_EVNTSEL0		0xc0010200
-#define MSR_AMD_FAM15H_PERFCTR0		0xc0010201
-#define MSR_AMD_FAM15H_EVNTSEL1		0xc0010202
-#define MSR_AMD_FAM15H_PERFCTR1		0xc0010203
-#define MSR_AMD_FAM15H_EVNTSEL2		0xc0010204
-#define MSR_AMD_FAM15H_PERFCTR2		0xc0010205
-#define MSR_AMD_FAM15H_EVNTSEL3		0xc0010206
-#define MSR_AMD_FAM15H_PERFCTR3		0xc0010207
-#define MSR_AMD_FAM15H_EVNTSEL4		0xc0010208
-#define MSR_AMD_FAM15H_PERFCTR4		0xc0010209
-#define MSR_AMD_FAM15H_EVNTSEL5		0xc001020a
-#define MSR_AMD_FAM15H_PERFCTR5		0xc001020b
-
-#define MSR_AMD_L7S0_FEATURE_MASK	0xc0011002
-#define MSR_AMD_THRM_FEATURE_MASK	0xc0011003
-#define MSR_K8_FEATURE_MASK		0xc0011004
-#define MSR_K8_EXT_FEATURE_MASK		0xc0011005
+#define MSR_K7_FID_VID_CTL		0xc0010041U
+#define MSR_K7_FID_VID_STATUS		0xc0010042U
+#define MSR_K8_PSTATE_LIMIT		0xc0010061U
+#define MSR_K8_PSTATE_CTRL		0xc0010062U
+#define MSR_K8_PSTATE_STATUS		0xc0010063U
+#define MSR_K8_PSTATE0			0xc0010064U
+#define MSR_K8_PSTATE1			0xc0010065U
+#define MSR_K8_PSTATE2			0xc0010066U
+#define MSR_K8_PSTATE3			0xc0010067U
+#define MSR_K8_PSTATE4			0xc0010068U
+#define MSR_K8_PSTATE5			0xc0010069U
+#define MSR_K8_PSTATE6			0xc001006AU
+#define MSR_K8_PSTATE7			0xc001006BU
+#define MSR_K8_ENABLE_C1E		0xc0010055U
+#define MSR_K8_VM_HSAVE_PA		0xc0010117U
+
+#define MSR_AMD_FAM15H_EVNTSEL0		0xc0010200U
+#define MSR_AMD_FAM15H_PERFCTR0		0xc0010201U
+#define MSR_AMD_FAM15H_EVNTSEL1		0xc0010202U
+#define MSR_AMD_FAM15H_PERFCTR1		0xc0010203U
+#define MSR_AMD_FAM15H_EVNTSEL2		0xc0010204U
+#define MSR_AMD_FAM15H_PERFCTR2		0xc0010205U
+#define MSR_AMD_FAM15H_EVNTSEL3		0xc0010206U
+#define MSR_AMD_FAM15H_PERFCTR3		0xc0010207U
+#define MSR_AMD_FAM15H_EVNTSEL4		0xc0010208U
+#define MSR_AMD_FAM15H_PERFCTR4		0xc0010209U
+#define MSR_AMD_FAM15H_EVNTSEL5		0xc001020aU
+#define MSR_AMD_FAM15H_PERFCTR5		0xc001020bU
+
+#define MSR_AMD_L7S0_FEATURE_MASK	0xc0011002U
+#define MSR_AMD_THRM_FEATURE_MASK	0xc0011003U
+#define MSR_K8_FEATURE_MASK			0xc0011004U
+#define MSR_K8_EXT_FEATURE_MASK		0xc0011005U
 
 /* AMD64 MSRs */
-#define MSR_AMD64_NB_CFG		0xc001001f
+#define MSR_AMD64_NB_CFG		0xc001001fU
 #define AMD64_NB_CFG_CF8_EXT_ENABLE_BIT	46
-#define MSR_AMD64_LS_CFG		0xc0011020
-#define MSR_AMD64_IC_CFG		0xc0011021
-#define MSR_AMD64_DC_CFG		0xc0011022
-#define MSR_AMD64_DE_CFG		0xc0011029
+#define MSR_AMD64_LS_CFG		0xc0011020U
+#define MSR_AMD64_IC_CFG		0xc0011021U
+#define MSR_AMD64_DC_CFG		0xc0011022U
+#define MSR_AMD64_DE_CFG		0xc0011029U
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
-#define MSR_AMD64_EX_CFG		0xc001102c
-#define MSR_AMD64_DE_CFG2		0xc00110e3
+#define MSR_AMD64_EX_CFG		0xc001102cU
+#define MSR_AMD64_DE_CFG2		0xc00110e3U
 
-#define MSR_AMD64_DR0_ADDRESS_MASK	0xc0011027
-#define MSR_AMD64_DR1_ADDRESS_MASK	0xc0011019
-#define MSR_AMD64_DR2_ADDRESS_MASK	0xc001101a
-#define MSR_AMD64_DR3_ADDRESS_MASK	0xc001101b
+#define MSR_AMD64_DR0_ADDRESS_MASK	0xc0011027U
+#define MSR_AMD64_DR1_ADDRESS_MASK	0xc0011019U
+#define MSR_AMD64_DR2_ADDRESS_MASK	0xc001101aU
+#define MSR_AMD64_DR3_ADDRESS_MASK	0xc001101bU
 
 /* AMD Family10h machine check MSRs */
-#define MSR_F10_MC4_MISC1		0xc0000408
-#define MSR_F10_MC4_MISC2		0xc0000409
-#define MSR_F10_MC4_MISC3		0xc000040A
+#define MSR_F10_MC4_MISC1		0xc0000408U
+#define MSR_F10_MC4_MISC2		0xc0000409U
+#define MSR_F10_MC4_MISC3		0xc000040AU
 
 /* AMD Family10h Bus Unit MSRs */
-#define MSR_F10_BU_CFG 		0xc0011023
-#define MSR_F10_BU_CFG2		0xc001102a
+#define MSR_F10_BU_CFG 		0xc0011023U
+#define MSR_F10_BU_CFG2		0xc001102aU
 
 /* Other AMD Fam10h MSRs */
-#define MSR_FAM10H_MMIO_CONF_BASE	0xc0010058
+#define MSR_FAM10H_MMIO_CONF_BASE	0xc0010058U
 #define FAM10H_MMIO_CONF_ENABLE         (1<<0)
 #define FAM10H_MMIO_CONF_BUSRANGE_MASK	0xf
 #define FAM10H_MMIO_CONF_BUSRANGE_SHIFT 2
@@ -410,31 +410,31 @@
 
 /* AMD Microcode MSRs */
 #define MSR_AMD_PATCHLEVEL		0x0000008b
-#define MSR_AMD_PATCHLOADER		0xc0010020
+#define MSR_AMD_PATCHLOADER		0xc0010020U
 
 /* AMD TSC RATE MSR */
-#define MSR_AMD64_TSC_RATIO		0xc0000104
+#define MSR_AMD64_TSC_RATIO		0xc0000104U
 
 /* AMD Lightweight Profiling MSRs */
-#define MSR_AMD64_LWP_CFG		0xc0000105
-#define MSR_AMD64_LWP_CBADDR		0xc0000106
+#define MSR_AMD64_LWP_CFG		0xc0000105U
+#define MSR_AMD64_LWP_CBADDR		0xc0000106U
 
 /* AMD OS Visible Workaround MSRs */
-#define MSR_AMD_OSVW_ID_LENGTH          0xc0010140
-#define MSR_AMD_OSVW_STATUS             0xc0010141
+#define MSR_AMD_OSVW_ID_LENGTH          0xc0010140U
+#define MSR_AMD_OSVW_STATUS             0xc0010141U
 
 /* AMD Protected Processor Inventory Number */
-#define MSR_AMD_PPIN_CTL                0xc00102f0
-#define MSR_AMD_PPIN                    0xc00102f1
+#define MSR_AMD_PPIN_CTL                0xc00102f0U
+#define MSR_AMD_PPIN                    0xc00102f1U
 
 /* K6 MSRs */
-#define MSR_K6_EFER			0xc0000080
-#define MSR_K6_STAR			0xc0000081
-#define MSR_K6_WHCR			0xc0000082
-#define MSR_K6_UWCCR			0xc0000085
-#define MSR_K6_EPMR			0xc0000086
-#define MSR_K6_PSOR			0xc0000087
-#define MSR_K6_PFIR			0xc0000088
+#define MSR_K6_EFER			0xc0000080U
+#define MSR_K6_STAR			0xc0000081U
+#define MSR_K6_WHCR			0xc0000082U
+#define MSR_K6_UWCCR			0xc0000085U
+#define MSR_K6_EPMR			0xc0000086U
+#define MSR_K6_PSOR			0xc0000087U
+#define MSR_K6_PFIR			0xc0000088U
 
 /* Centaur-Hauls/IDT defined MSRs. */
 #define MSR_IDT_FCR1			0x00000107
@@ -459,10 +459,10 @@
 #define MSR_VIA_BCR2			0x00001147
 
 /* Transmeta defined MSRs */
-#define MSR_TMTA_LONGRUN_CTRL		0x80868010
-#define MSR_TMTA_LONGRUN_FLAGS		0x80868011
-#define MSR_TMTA_LRTI_READOUT		0x80868018
-#define MSR_TMTA_LRTI_VOLT_MHZ		0x8086801a
+#define MSR_TMTA_LONGRUN_CTRL		0x80868010U
+#define MSR_TMTA_LONGRUN_FLAGS		0x80868011U
+#define MSR_TMTA_LRTI_READOUT		0x80868018U
+#define MSR_TMTA_LRTI_VOLT_MHZ		0x8086801aU
 
 /* Intel defined MSRs. */
 #define MSR_IA32_P5_MC_ADDR		0x00000000
diff --git a/xen/arch/x86/include/asm/pci.h b/xen/arch/x86/include/asm/pci.h
index f4a58c8acf..e1dd12eb19 100644
--- a/xen/arch/x86/include/asm/pci.h
+++ b/xen/arch/x86/include/asm/pci.h
@@ -3,10 +3,10 @@
 
 #include <xen/mm.h>
 
-#define CF8_BDF(cf8)     (  ((cf8) & 0x00ffff00) >> 8)
-#define CF8_ADDR_LO(cf8) (   (cf8) & 0x000000fc)
-#define CF8_ADDR_HI(cf8) (  ((cf8) & 0x0f000000) >> 16)
-#define CF8_ENABLED(cf8) (!!((cf8) & 0x80000000))
+#define CF8_BDF(cf8)     (  ((cf8) & 0x00ffff00U) >> 8)
+#define CF8_ADDR_LO(cf8) (   (cf8) & 0x000000fcU)
+#define CF8_ADDR_HI(cf8) (  ((cf8) & 0x0f000000U) >> 16)
+#define CF8_ENABLED(cf8) (!!((cf8) & 0x80000000U))
 
 #define IS_SNB_GFX(id) (id == 0x01068086 || id == 0x01168086 \
                         || id == 0x01268086 || id == 0x01028086 \
diff --git a/xen/arch/x86/include/asm/x86-defns.h b/xen/arch/x86/include/asm/x86-defns.h
index e350227e57..491ec6f298 100644
--- a/xen/arch/x86/include/asm/x86-defns.h
+++ b/xen/arch/x86/include/asm/x86-defns.h
@@ -103,7 +103,7 @@
 /*
  * Debug status flags in DR6.
  */
-#define X86_DR6_DEFAULT         0xffff0ff0  /* Default %dr6 value. */
+#define X86_DR6_DEFAULT         0xffff0ff0U  /* Default %dr6 value. */
 
 /*
  * Debug control flags in DR7.
diff --git a/xen/arch/x86/percpu.c b/xen/arch/x86/percpu.c
index 288050cdba..1ebeb65ad6 100644
--- a/xen/arch/x86/percpu.c
+++ b/xen/arch/x86/percpu.c
@@ -12,7 +12,7 @@ unsigned long __per_cpu_offset[NR_CPUS];
  * possible #PF at (NULL + a little) which has security implications in the
  * context of PV guests.
  */
-#define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
+#define INVALID_PERCPU_AREA (0x8000000000000000UL - (long)__per_cpu_start)
 #define PERCPU_ORDER get_order_from_bytes(__per_cpu_data_end - __per_cpu_start)
 
 void __init percpu_init_areas(void)
diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index a1e0af27c5..5581b4717a 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -191,7 +191,7 @@ static struct feat_node *feat_l2_cat;
 static struct feat_node *feat_mba;
 
 /* Common functions */
-#define cat_default_val(len) (0xffffffff >> (32 - (len)))
+#define cat_default_val(len) (0xffffffffU >> (32 - (len)))
 
 /*
  * get_cdp_data - get DATA COS register value from input COS ID.
diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index 4081cef200..b030ad8a5b 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -398,8 +398,8 @@ static void __init print_details(enum ind_thunk thunk)
         cpuid_count(7, 0, &max, &tmp, &tmp, &_7d0);
     if ( max >= 2 )
         cpuid_count(7, 2, &tmp, &tmp, &tmp, &_7d2);
-    if ( boot_cpu_data.extended_cpuid_level >= 0x80000008 )
-        cpuid(0x80000008, &tmp, &e8b, &tmp, &tmp);
+    if ( boot_cpu_data.extended_cpuid_level >= 0x80000008U )
+        cpuid(0x80000008U, &tmp, &e8b, &tmp, &tmp);
     if ( cpu_has_arch_caps )
         rdmsrl(MSR_ARCH_CAPABILITIES, caps);
 
@@ -1337,8 +1337,8 @@ void __init init_speculation_mitigations(void)
          * TODO: Adjust cpu_has_svm_spec_ctrl to be usable earlier on boot.
          */
         if ( opt_msr_sc_hvm &&
-             (boot_cpu_data.extended_cpuid_level >= 0x8000000a) &&
-             (cpuid_edx(0x8000000a) & (1u << SVM_FEATURE_SPEC_CTRL)) )
+             (boot_cpu_data.extended_cpuid_level >= 0x8000000aU) &&
+             (cpuid_edx(0x8000000aU) & (1u << SVM_FEATURE_SPEC_CTRL)) )
             setup_force_cpu_cap(X86_FEATURE_SC_MSR_HVM);
     }
 
diff --git a/xen/arch/x86/x86_64/acpi_mmcfg.c b/xen/arch/x86/x86_64/acpi_mmcfg.c
index 2159c68189..cdde7e453c 100644
--- a/xen/arch/x86/x86_64/acpi_mmcfg.c
+++ b/xen/arch/x86/x86_64/acpi_mmcfg.c
@@ -50,7 +50,7 @@ static int __init acpi_mcfg_check_entry(struct acpi_table_mcfg *mcfg,
 {
     int year;
 
-    if (cfg->address < 0xFFFFFFFF)
+    if (cfg->address < 0xFFFFFFFFU)
         return 0;
 
     if (!strncmp(mcfg->header.oem_id, "SGI", 3))
diff --git a/xen/arch/x86/x86_64/pci.c b/xen/arch/x86/x86_64/pci.c
index aad1c3f7cf..8d33429103 100644
--- a/xen/arch/x86/x86_64/pci.c
+++ b/xen/arch/x86/x86_64/pci.c
@@ -9,7 +9,7 @@
 #include <asm/io.h>
 
 #define PCI_CONF_ADDRESS(sbdf, reg) \
-    (0x80000000 | ((sbdf).bdf << 8) | ((reg) & ~3))
+    (0x80000000U | ((sbdf).bdf << 8) | ((reg) & ~3))
 
 uint8_t pci_conf_read8(pci_sbdf_t sbdf, unsigned int reg)
 {
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h
index 40d5054fb7..ec6d93fb2f 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.h
+++ b/xen/arch/x86/x86_emulate/x86_emulate.h
@@ -620,7 +620,7 @@ struct x86_emulate_ctxt
  * below).
  * Hence no separate #define-s get added.
  */
-#define X86EMUL_OPC_EXT_MASK         0xffff0000
+#define X86EMUL_OPC_EXT_MASK         0xffff0000U
 #define X86EMUL_OPC(ext, byte)       ((uint8_t)(byte) | \
                                       MASK_INSR((ext), X86EMUL_OPC_EXT_MASK))
 /*
diff --git a/xen/lib/x86/cpuid.c b/xen/lib/x86/cpuid.c
index 07e5501914..a4ea579ebe 100644
--- a/xen/lib/x86/cpuid.c
+++ b/xen/lib/x86/cpuid.c
@@ -217,10 +217,10 @@ void x86_cpu_policy_fill_native(struct cpu_policy *p)
     }
 
     /* Extended leaves. */
-    cpuid_leaf(0x80000000, &p->extd.raw[0]);
+    cpuid_leaf(0x80000000U, &p->extd.raw[0]);
     for ( i = 1; i <= MIN(p->extd.max_leaf & 0xffffU,
                           ARRAY_SIZE(p->extd.raw) - 1); ++i )
-        cpuid_leaf(0x80000000 + i, &p->extd.raw[i]);
+        cpuid_leaf(0x80000000U + i, &p->extd.raw[i]);
 
     /* Don't report leaves from possible lower level hypervisor, for now. */
     p->hv_limit = 0;
@@ -421,7 +421,7 @@ int x86_cpuid_copy_to_buffer(const struct cpu_policy *p,
     /* Extended leaves. */
     for ( leaf = 0; leaf <= MIN(p->extd.max_leaf & 0xfffful,
                                 ARRAY_SIZE(p->extd.raw) - 1); ++leaf )
-        COPY_LEAF(0x80000000 | leaf, XEN_CPUID_NO_SUBLEAF, &p->extd.raw[leaf]);
+        COPY_LEAF(0x80000000U | leaf, XEN_CPUID_NO_SUBLEAF, &p->extd.raw[leaf]);
 
 #undef COPY_LEAF
 
@@ -521,7 +521,7 @@ int x86_cpuid_copy_from_buffer(struct cpu_policy *p,
             p->hv2_limit = l.a;
             break;
 
-        case 0x80000000 ... 0x80000000 + ARRAY_SIZE(p->extd.raw) - 1:
+        case 0x80000000U ... 0x80000000U + ARRAY_SIZE(p->extd.raw) - 1:
             if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
                 goto out_of_range;
 
diff --git a/xen/lib/x86/policy.c b/xen/lib/x86/policy.c
index a9c60000af..f033d22785 100644
--- a/xen/lib/x86/policy.c
+++ b/xen/lib/x86/policy.c
@@ -22,7 +22,7 @@ int x86_cpu_policies_are_compatible(const struct cpu_policy *host,
         FAIL_CPUID(7, 0);
 
     if ( guest->extd.max_leaf > host->extd.max_leaf )
-        FAIL_CPUID(0x80000000, NA);
+        FAIL_CPUID(0x80000000U, NA);
 
     /* TODO: Audit more CPUID data. */
 
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:34:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:34:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559396.874325 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4W3-0001x3-Nu; Wed, 05 Jul 2023 15:34:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559396.874325; Wed, 05 Jul 2023 15:34:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4W3-0001ww-L9; Wed, 05 Jul 2023 15:34:03 +0000
Received: by outflank-mailman (input) for mailman id 559396;
 Wed, 05 Jul 2023 15:34:02 +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 <SRS0=jglA=CX=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qH4W2-0001wm-DC
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:34:02 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5d1181f7-1b49-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 17:34:00 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 014331FE31;
 Wed,  5 Jul 2023 15:34:00 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B244213460;
 Wed,  5 Jul 2023 15:33:59 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id nMyHKWeNpWRHLgAAMHmgww
 (envelope-from <jgross@suse.com>); Wed, 05 Jul 2023 15:33:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5d1181f7-1b49-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688571240; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=VsB419Adq9NfBRaDhLDZrhEMVvbNumGt9zZMlDfcTE0=;
	b=YNXnkkw3jpKcGU/kxSN6BVyKBSslhIshiarmSBXi9299F9EMV69D3AZieEhrt5oPSYPmw/
	cafHXhpBdOoDXsp7O6cQrqRZ3/bnJqkP9zZgnSx4sehUVa7wPFNKeoin44wx9Gw73y5Xde
	Q3wL9I2KqR9oIpJI9WEDjKiLTy4c4M4=
Message-ID: <290e4dbf-c9c9-49c9-29ea-6fc9b9a5a4fc@suse.com>
Date: Wed, 5 Jul 2023 17:33:59 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 09/13] xen/public: fix violations of MISRA C:2012
 Rule 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <9e0d463e2fc09193a742fc7a64a331855705a4fb.1688559115.git.gianluca.luparini@bugseng.com>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <9e0d463e2fc09193a742fc7a64a331855705a4fb.1688559115.git.gianluca.luparini@bugseng.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------0pWndwupcTBDbpx56Mor2GJK"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------0pWndwupcTBDbpx56Mor2GJK
Content-Type: multipart/mixed; boundary="------------BYthgFz0vDFMvcBILi4y0aB5";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Simone Ballarin <simone.ballarin@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Message-ID: <290e4dbf-c9c9-49c9-29ea-6fc9b9a5a4fc@suse.com>
Subject: Re: [XEN PATCH v2 09/13] xen/public: fix violations of MISRA C:2012
 Rule 7.2
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <9e0d463e2fc09193a742fc7a64a331855705a4fb.1688559115.git.gianluca.luparini@bugseng.com>
In-Reply-To: <9e0d463e2fc09193a742fc7a64a331855705a4fb.1688559115.git.gianluca.luparini@bugseng.com>

--------------BYthgFz0vDFMvcBILi4y0aB5
Content-Type: multipart/mixed; boundary="------------x6hgpCT9NRC0xcIGPSnjNU7x"

--------------x6hgpCT9NRC0xcIGPSnjNU7x
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMDUuMDcuMjMgMTc6M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RC0xcIGPSnjNU7x
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5RnNVUJbvoPHZ8SlM4KWm8rG+lIkGurq
qu5gu8q8ZMKdsdGC4bBxdQKDKHEFExLJK/nRPFmAuGlId1E3fe10v5QL+qHI3EIP
tyfE7i9Hz6rVwi7lWKgh7pe0ZvatAudZ+JNIlBKptb64FaiIOAWDCx1SzR9KdWVy
Z2VuIEdyb3NzIDxqZ3Jvc3NAc3VzZS5jb20+wsB5BBMB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BLIC KEY BLOCK-----

--------------x6hgpCT9NRC0xcIGPSnjNU7x--

--------------BYthgFz0vDFMvcBILi4y0aB5--

--------------0pWndwupcTBDbpx56Mor2GJK
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSljWcFAwAAAAAACgkQsN6d1ii/Ey9R
Ygf/TJT4yysky8yain6t5wlNxWG39asnutij1H8xA6RWZW5H9G9x8mB1LPVvpoJPTEF4Hx7mOVf/
LP6PgtB9es40xMfteqtGInow0HQJJ8VphjrVqeYUgLW17utHOGp4tXcnY5yxTXw8muq5anbtk8Jf
SQ9OR+1AVQw+O9xco0ccS5iZHA2YS9Id2Q7ZxN7BbQI9ovuRyRoZg1wcp/UI1bsC9sVLtjMfwxWh
IiP2mLJy0uExclH5hbeEtoC+nve++cSuJynydKo7uliFFjX4uRtAEtKoToiRREVrpw+6I0Rz8Ivo
MSPBbIaCr4j57/4aSDgc0vMhpckj6iXZr38iMFUicg==
=cVIZ
-----END PGP SIGNATURE-----

--------------0pWndwupcTBDbpx56Mor2GJK--


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:36:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:36:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559400.874335 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4Xt-0002Wx-3X; Wed, 05 Jul 2023 15:35:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559400.874335; Wed, 05 Jul 2023 15:35:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4Xt-0002Wq-0n; Wed, 05 Jul 2023 15:35:57 +0000
Received: by outflank-mailman (input) for mailman id 559400;
 Wed, 05 Jul 2023 15:35:56 +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
 <SRS0=gl5h=CX=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qH4Xr-0002W5-SB
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:35:56 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on20607.outbound.protection.outlook.com
 [2a01:111:f400:fe59::607])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9fa62861-1b49-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 17:35:53 +0200 (CEST)
Received: from SN6PR12MB2621.namprd12.prod.outlook.com (2603:10b6:805:73::15)
 by BL1PR12MB5141.namprd12.prod.outlook.com (2603:10b6:208:309::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 15:35:47 +0000
Received: from SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54]) by SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54%2]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 15:35:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9fa62861-1b49-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KQcoAJZGt3/mGPj/MSYKBDUiYKvf5NY7NElNsSeCyTaIWl+U1JDn7BDzSqQIL1ZpIwLs66La2Y7c8K2vo7SrC7GQdh8RmtkK2PADjblHoz54OAZ2cLoo7sKTrddxaoMQ1E62zboaOwwzECSxl+c2Ek05XmOAMS3MdYK3UVa4lTY91mDZG8wqv564rtivNttH/hF5t6pnqIj9GedJ5+obk8zb1PoWhtcbaYIyLieWnOFwkqzHYm3kxDKZp38w6rfnHCRYn5zKa7UDgy5dshyMW6zPbU5MCJApUJARpCsEdmmIaC+O2Cf1gMeB4OUnxu66IeOevccahkwzZ1Wga6CD2g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Y/X95fl4pACk9QABCfkwPBpjGEjw28DThdzEJwEWRfY=;
 b=UJ/+kT5K9/trgUQNeu3qPofRPXAfif38SLmiYZe5rXggDq+GxlajQA1B5KhyNXBpjDmp6Zc5996Attof6kgzqD6F/cR7w5/niYHmP/gMxdfCnLadMdGZKxh660gTaIh1Bj+6+0KUcxjzXSeNr/cugb5SPrKzhmR6LNoljeQsHrUZt0nrkQfB6tMr6Yy+l2vR07z+oPekslJ4UYwjXbee/qufwKq4o6WSJTuf4RvomPQlrXBccYkUSaUtbfpCM1nweOO8l8/kQN9/edD+Gmla7YPe4eZVHygPtc+JGx/QmtLMKkn512yxGxIty71+6kJ/qm/JC2Mn33VsePiSnheCoQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Y/X95fl4pACk9QABCfkwPBpjGEjw28DThdzEJwEWRfY=;
 b=mRSQJ78Dlsnedpxv5dHtYHmFLwyUvrSswjyD/h1yblr9OoCzwQCjRYhTzvEwm0MFgG0GxYS1jPSI0rU8pU1jKExj7lEFVLiqOIWy3Mi6kXpl3axWWDMCQdfcfl+jRDVNXNvZNAWW0MVTe9j01bRe/+xEU5svalIs1Td0GxuL0vM=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <7df5b74c-8570-a484-b0c3-978a44a7c66a@amd.com>
Date: Wed, 5 Jul 2023 16:35:38 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 44/52] xen/mpu: P2M initialization in MPU system
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-45-Penny.Zheng@arm.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <20230626033443.2943270-45-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: PA7P264CA0227.FRAP264.PROD.OUTLOOK.COM
 (2603:10a6:102:372::14) To SN6PR12MB2621.namprd12.prod.outlook.com
 (2603:10b6:805:73::15)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN6PR12MB2621:EE_|BL1PR12MB5141:EE_
X-MS-Office365-Filtering-Correlation-Id: f0bd8c8d-1fad-42d6-5912-08db7d6d811c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	BG++Ff4iPrgtlKM+u0yeb/puS9yje+kCS6M3koYTk/QRsMsTf0jycss/C4Ixlj6S4whVrU8tzHjHekgXTxDHpaG23zdXYRULL3rUiP4/sgPrYvqRzf0s6/D9BnWaeUTi4uyhLP+S0Jz6oVzPIWEytJ64MIui96bsXo2Sjz8MyRn32DSXiruRUxsam1IsLiXlpUhiI/Kvry0SBsY2ADB2sis+mEgILkZ5jpsW6SbzwdGE3FVFzx6dyt2Uv4B7g3U4bEKJRZSW1avQrcKMlDaln0gVeyvwORpJ1QDiau6PGkzC207b4FhB/oDmN98BttdHoAA3j+OE805rJKJn3W/9FVQF6eqYRMVHd97auShq23i6/nHxqEFwyjnqN/oqbA52rbwYzys6xP4ueuuzA/KqCRmsSYvGDg2q3jV9xeYQoY2Gk46TWJwW12SPi87W2ltyk/e8tacOVW6aqFHD8toMkZ7NLbfeyl5zpFVSe/V/KwMfWjVDJlOk3R6ot6CNqTgveodCW/XYr9yIxkzZiSS4apkazcJ7JSQSROzFsKRPPa17ReydpBp8a7McW2bheBkJp8WqrG47QnYEXsjh69hPFsV0ZwMzU1bxn0kTXGxKfyeIZW25F5qPI1CzQ25JTQwtJ6c5pNwEcdryaAYTYPJMDA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2621.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(39860400002)(136003)(376002)(366004)(451199021)(36756003)(31686004)(31696002)(2906002)(5660300002)(6512007)(186003)(83380400001)(6506007)(26005)(53546011)(6486002)(54906003)(66556008)(66476007)(4326008)(38100700002)(2616005)(316002)(66946007)(478600001)(6666004)(8936002)(8676002)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aThxTE9oVTJRSkRyTXZrQk9HTmsvQlJub2xLWEU0czZqd3R2MWZvdEdtOEpt?=
 =?utf-8?B?blR1OGJpeS9RZkd4K2hYNVd0SHVkOXp6SlU5N09aQ3hIWXVaaWdUb2JqWXhI?=
 =?utf-8?B?cW5TM2lRSjllZmc0QkVDVWpUV00vcE02cExIOWNtNGRyaFpTUElCSm9RSzFl?=
 =?utf-8?B?NjMyL094bXYwQ0JTNTB5akVDQ04rOXo1Ymx4NU5LSkdvNVFCTGxIVUltN3ZE?=
 =?utf-8?B?MXZhZE9tS3MrL2VsQktjaDJCU2JJemhXd3FQSlJPaHFrOUNlaFdRdVdzbW1z?=
 =?utf-8?B?S3liZHBnNjk5M2RBZzJGd2IxTUhPbE9rcDM3Nit1QXppQ1hiYjJRQXJhVm1X?=
 =?utf-8?B?TkhFMUx0Q1FmOXN2aGJVaW1BNkJVaDlhN1pSemdlcWxUWW9NaHJYVzgxZThQ?=
 =?utf-8?B?bG5ZeUhlZWk2bDZPdFlUK05pT2R3L2Qrc2dpaXJKbTdqQm9hQktlMm5mN1cr?=
 =?utf-8?B?ZUNLTlBTZWtKamZXVGV2Z3ZxdmxoSEczVVpEQ2lYZTQyOFJhdC94WUJMWkFr?=
 =?utf-8?B?cThqalVDUC9XRmRhR2ZUdkNSUjFVZitpcXdyVnlHZ0VEbE9yOE56Vkx1OGRC?=
 =?utf-8?B?WXdZcWdWZUZWQUdNSHc0ZldYdGp5Q3V3RnZablRDY2tmWE5ja3IvT21Ea0M4?=
 =?utf-8?B?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Rkpsc3ZpZjVmckdoZ24vNzVEcHNzakhFbkk3QjdSS3VT?=
 =?utf-8?B?THhiUWo0K0lDVmtWTWtwS3RkNkR6cmRYYkUreGxsMklCb0JzZ29JUUxiN3l0?=
 =?utf-8?B?MUQ5Qmk3UjdDaGRYL1AxZ2dSMkpNTnpUQVhLN3daSW1PUFlTSWIvQVRUNExs?=
 =?utf-8?B?ZnM2bG5kZ0xNZUV1ald6SlY0cGtWMkNRNHZ0anBiN0ZoZ0lpN3dIRUVnL005?=
 =?utf-8?B?M2laMzhNNEIzeEE4NHBDQnp4eVpuN3RVd0pLNi9KMUNmeEFDTWJnMU9HMlN1?=
 =?utf-8?B?NXVjcERNY01rVUlMZE9zRXRPYW9aUC9hU2JCZVRlQjJTZ2JnNGI2Q1BnelhL?=
 =?utf-8?B?TEpJT3dWY2tHMVd5YW9Qb2VMR2V5QXNVUG4weHhBbWlRNEtBbG9DaHVPOGs3?=
 =?utf-8?B?VmdDZndnYUlDVWk4QmlGZHhsSG9PK0hXK0x2TU5HWGlId0FEVUhJYzlEaVdr?=
 =?utf-8?B?cTNla3VQek5JeXJKQnNYUXp6VCsyelhaamlaNTdQNlUzTkNyUkNKWDQ1eUx6?=
 =?utf-8?B?VFlnelpiNFRKSzFhaFBYS0VQOFF0R28xdUZ5cHhjNk5BMTFGV2MrNVUxL2NI?=
 =?utf-8?Q?cJyVm9fgBY2OkN7V27hunvpev?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f0bd8c8d-1fad-42d6-5912-08db7d6d811c
X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2621.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 15:35:47.6648
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: TZ7Nb3hQ80nDeC6KzUrOQPu7hL9TjMYMuoJDT+I/PrFZ9x9cnbz+2GzABwIfaoD7TausaTvUPtxB+swkPSHOGA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5141

Hi Penny,

On 26/06/2023 04:34, Penny Zheng wrote:
> CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
>
>
> We inherit p2m_init() to do P2M initialization in MPU system, including
> VMID assignment, setting up P2M MPU region mapping table, etc.
>
> p2m_alloc_table() is responsible for allocating per-domain P2M MPU memory
> region mapping table. As a MPU memory region structure(pr_t) takes 16 bytes,
> even with maximum supported MPU memory regions, 255, MPU memory mapping table
> at most takes up less than 4KB.
>
> VSCTLR_EL2, Virtualization System Control Register, provides configuration
> information for VMSAv8-64 and PMSAv8-64 virtualization using stage 2
> of EL1&0 translation regime, bit[63:48] of which determines VMID for the
> EL1-Guest-OS.
>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> ---
> v3:
> - new commit
> ---
>   xen/arch/arm/include/asm/mpu/mm.h |  3 ++
>   xen/arch/arm/include/asm/p2m.h    |  5 +++
>   xen/arch/arm/mpu/mm.c             | 22 ++++++++++
>   xen/arch/arm/mpu/p2m.c            | 69 +++++++++++++++++++++++++++++++
>   4 files changed, 99 insertions(+)
>
> diff --git a/xen/arch/arm/include/asm/mpu/mm.h b/xen/arch/arm/include/asm/mpu/mm.h
> index a83519ad13..4df69245c6 100644
> --- a/xen/arch/arm/include/asm/mpu/mm.h
> +++ b/xen/arch/arm/include/asm/mpu/mm.h
> @@ -2,6 +2,8 @@
>   #ifndef __ARCH_ARM_MM_MPU__
>   #define __ARCH_ARM_MM_MPU__
#ifdef CONFIG_ARM_64
> +#include <asm/arm64/mpu.h>
#endif
> +
>   extern struct page_info *frame_table;
>   extern unsigned long frametable_pdx_end;
>
> @@ -11,6 +13,7 @@ extern uint8_t is_mm_range_mapped(paddr_t pa, paddr_t len);
>   extern void *map_mm_range(paddr_t pa, size_t len, unsigned int attributes);
>   extern void unmap_mm_range(paddr_t pa);
>   extern bool is_mm_range_mapped_transient(paddr_t pa, paddr_t len);
> +extern pr_t *alloc_mpumap(void);
>
>   #endif /* __ARCH_ARM_MM_MPU__ */
>
> diff --git a/xen/arch/arm/include/asm/p2m.h b/xen/arch/arm/include/asm/p2m.h
> index d9c91d4a98..c3598d514e 100644
> --- a/xen/arch/arm/include/asm/p2m.h
> +++ b/xen/arch/arm/include/asm/p2m.h
> @@ -61,8 +61,13 @@ struct p2m_domain {
>       /* Current VMID in use */
>       uint16_t vmid;
>
> +#ifndef CONFIG_HAS_MPU
>       /* Current Translation Table Base Register for the p2m */
>       uint64_t vttbr;
> +#else
> +    /* Current Virtualization System Control Register for the p2m */
> +    uint64_t vsctlr;

register_t vsctlr;

So that it is 64-bit for ARM_64 and 32-bit for ARM_32.

> +#endif
>
>       /* Highest guest frame that's ever been mapped in the p2m */
>       gfn_t max_mapped_gfn;
> diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
> index 27d924e449..de5da96b80 100644
> --- a/xen/arch/arm/mpu/mm.c
> +++ b/xen/arch/arm/mpu/mm.c
> @@ -872,6 +872,28 @@ void __init remove_early_mappings(paddr_t dtb_paddr)
>               panic("Unable to destroy early Device-Tree mapping.\n");
>   }
>
> +/*
> + * Standard entry to dynamically allocate MPU memory region mapping table.
> + * A 4KB page is enough for holding the maximum supported MPU memory
> + * regions.
> + */
> +pr_t *alloc_mpumap(void)
> +{
> +    pr_t *map;
> +
> +    /*
> +     * A MPU memory region structure(pr_t) takes 16 bytes, even with maximum
> +     * supported MPU memory regions, 255, MPU memory mapping table at most
> +     * takes up less than 4KB.
> +     */
> +    map = alloc_xenheap_pages(0, 0);
> +    if ( map == NULL )
> +        return NULL;
> +
> +    clear_page(map);
> +    return map;
> +}
> +
>   /*
>    * Local variables:
>    * mode: C
> diff --git a/xen/arch/arm/mpu/p2m.c b/xen/arch/arm/mpu/p2m.c
> index a7a3912a9a..8f728f8957 100644
> --- a/xen/arch/arm/mpu/p2m.c
> +++ b/xen/arch/arm/mpu/p2m.c
> @@ -4,6 +4,7 @@
>   #include <xen/sched.h>
>   #include <xen/warning.h>
>
> +#include <asm/mpu/mm.h>
>   #include <asm/p2m.h>
>   #include <asm/processor.h>
>   #include <asm/sysregs.h>
> @@ -97,6 +98,74 @@ fault:
>       panic("Hardware with no PMSAv8-64 support in any translation regime.\n");
>   }
>
> +static uint64_t __init generate_vsctlr(uint16_t vmid)
> +{
> +    return ((uint64_t)vmid << 48);
> +}

Please move ^^^ to ./xen/arch/arm/include/asm/arm64/mpu.h as it differs 
between R82 and R52

- Ayan

> +
> +static int __init p2m_alloc_table(struct domain *d)
> +{
> +    struct p2m_domain *p2m = p2m_get_hostp2m(d);
> +    pr_t* p2m_map;
> +
> +    p2m_map = alloc_mpumap();
> +    if ( !p2m_map )
> +    {
> +        printk(XENLOG_G_ERR "DOM%pd: p2m: unable to allocate P2M MPU mapping table\n", d);
> +        return -ENOMEM;
> +    }
> +
> +    p2m->root = virt_to_page((const void *)p2m_map);
> +
> +    return 0;
> +}
> +
> +int p2m_init(struct domain *d)
> +{
> +    struct p2m_domain *p2m = p2m_get_hostp2m(d);
> +    int rc = 0;
> +    unsigned int cpu;
> +
> +    rwlock_init(&p2m->lock);
> +    spin_lock_init(&d->arch.paging.lock);
> +
> +    p2m->vmid = INVALID_VMID;
> +    p2m->max_mapped_gfn = _gfn(0);
> +    p2m->lowest_mapped_gfn = _gfn(ULONG_MAX);
> +
> +    p2m->default_access = p2m_access_rwx;
> +    /* mem_access is NOT supported in MPU system. */
> +    p2m->mem_access_enabled = false;
> +
> +    /*
> +     * Make sure that the type chosen to is able to store an vCPU ID
> +     * between 0 and the maximum of virtual CPUS supported as long as
> +     * the INVALID_VCPU_ID.
> +     */
> +    BUILD_BUG_ON((1 << (sizeof(p2m->last_vcpu_ran[0]) * 8)) < MAX_VIRT_CPUS);
> +    BUILD_BUG_ON((1 << (sizeof(p2m->last_vcpu_ran[0]) * 8)) < INVALID_VCPU_ID);
> +
> +    for_each_possible_cpu(cpu)
> +       p2m->last_vcpu_ran[cpu] = INVALID_VCPU_ID;
> +
> +    /*
> +     * "Trivial" initialisation is now complete.  Set the backpointer so
> +     * p2m_teardown() and friends know to do something.
> +     */
> +    p2m->domain = d;
> +
> +    rc = p2m_alloc_vmid(d);
> +    if ( rc )
> +        return rc;
> +    p2m->vsctlr = generate_vsctlr(p2m->vmid);
> +
> +    rc = p2m_alloc_table(d);
> +    if ( rc )
> +        return rc;
> +
> +    return rc;
> +}
> +
>   /*
>    * Local variables:
>    * mode: C
> --
> 2.25.1
>
>


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 15:51:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 15:51:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559404.874344 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4mj-0004xK-Ei; Wed, 05 Jul 2023 15:51:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559404.874344; Wed, 05 Jul 2023 15:51:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH4mj-0004xD-BO; Wed, 05 Jul 2023 15:51:17 +0000
Received: by outflank-mailman (input) for mailman id 559404;
 Wed, 05 Jul 2023 15:51:16 +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 <SRS0=rv0Z=CX=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qH4mi-0004x7-62
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 15:51:16 +0000
Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com
 [2a00:1450:4864:20::234])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c501f2c6-1b4b-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 17:51:13 +0200 (CEST)
Received: by mail-lj1-x234.google.com with SMTP id
 38308e7fff4ca-2b63e5f94f1so11779221fa.1
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 08:51:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c501f2c6-1b4b-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1688572273; x=1691164273;
        h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
         :date:message-id:reply-to;
        bh=z07d8C2904EI4u93qwFqu/++JzuP0a72uGQy8qj17lo=;
        b=EV3r1oOBOJjoz3f7pg8q+V3mgfpVQ533HX7PYI8xF8wDZ68Nm2P8BE8iJL8WgVSXJt
         4th3deOpGAKt9z2ErIPQ/zx0mleZEIt8YOnY5cg3ezI/2tVsCVLruXyfjaDl8WyZu50v
         WkCk3kZVW8LvkzpKUw4/hKXhOul4AYetfpnVY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688572273; x=1691164273;
        h=to:subject:message-id:date:from:mime-version:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=z07d8C2904EI4u93qwFqu/++JzuP0a72uGQy8qj17lo=;
        b=OprXo2qol6PSuRyNcrZKPgQwMB/zwobfgosPGauawBvreltwUJWhLktZTpHRSVCo7S
         q+JC9J//5mUk7589c0ZP88D1V7FE9sIxXdHmEiKpW8uO5uFPQn8sQWVEEcwvSheCfCHi
         RlMI/wP9VEEIgo4f+LIFY04+JQRe9biaxWXkaqWEYUEt/rvDD74TmRp/BHvWMkzq0X3C
         pioZAk2kUtaFQ5XlfKJ8xITeMjcWjGRgHnQaVZc94G9vfQmx0opD1SHTCzZO4ROaYvR1
         FIzYBBvGOdpEQK1MxSRRHxh/TE9mF757v7Vg6dM5vzjG7xhdfZ7r1Um/9/KHi5jSMEf1
         bJTA==
X-Gm-Message-State: ABy/qLa1FjKkL+6UWlHHQByecgd5VxQPaHdfwGRah8T/YFV3u94if+TK
	x4NuHSz+dWxhJYM3csRzViEol0hVXTOANtvElQu3azfiyVAuzZgB+oH73g==
X-Google-Smtp-Source: APBJJlHeGykRTp7ezA0Ph4ch8J8R1riDQiPvSzfGNlvnCvWHX4JdGe/D37+nNp31BVBfZWEZgBCbvd/LuKtXtAqfbDI=
X-Received: by 2002:a2e:a490:0:b0:2b6:b943:4361 with SMTP id
 h16-20020a2ea490000000b002b6b9434361mr1020355lji.22.1688572272874; Wed, 05
 Jul 2023 08:51:12 -0700 (PDT)
MIME-Version: 1.0
From: George Dunlap <george.dunlap@cloud.com>
Date: Wed, 5 Jul 2023 16:51:02 +0100
Message-ID: <CA+zSX=Y4MwsDSd9oSG1NQyt==YAw9SeRdh=eJxTUhhOx57ihWg@mail.gmail.com>
Subject: Detecting whether dom0 is in a VM
To: Xen-devel <xen-devel@lists.xenproject.org>
Content-Type: multipart/alternative; boundary="00000000000081030f05ffbf5ecb"

--00000000000081030f05ffbf5ecb
Content-Type: text/plain; charset="UTF-8"

Hey all,

The following systemd issue was brought to my attention:

https://github.com/systemd/systemd/issues/28113

I think basically, they want `systemd-detect-virt` return the following
values:

Xen on hardware, from a dom0:  `none`
Xen on hardware, from a domU: `xen`
Xen in a VM, from a dom0: (ideally the virtualization type, or `vm-other`
if not)
Xen in a VM, from a domU: `xen`

Is there a reliable set of tests which would work across all dom0 guest
types / architectures?  If not, can we expose the information somehow?

 -George

--00000000000081030f05ffbf5ecb
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hey all,<br><br>The following systemd issue was brought to=
 my attention:<br><br><a href=3D"https://github.com/systemd/systemd/issues/=
28113">https://github.com/systemd/systemd/issues/28113</a><br><br>I think b=
asically, they want `systemd-detect-virt` return the following values:<div>=
<br></div><div>Xen on hardware, from a dom0:=C2=A0 `none`</div><div>Xen on =
hardware, from a domU: `xen`</div><div>Xen in a VM, from a dom0: (ideally t=
he virtualization type, or `vm-other` if not)</div><div>Xen in a VM, from a=
 domU: `xen`</div><div><br></div><div>Is there a reliable set of tests whic=
h would work across all dom0 guest types / architectures?=C2=A0 If not, can=
 we expose the information somehow?</div><div><br></div><div>=C2=A0-George<=
/div></div>

--00000000000081030f05ffbf5ecb--


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 16:09:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 16:09:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559410.874354 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH54X-00078m-18; Wed, 05 Jul 2023 16:09:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559410.874354; Wed, 05 Jul 2023 16:09:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH54W-00078f-Um; Wed, 05 Jul 2023 16:09:40 +0000
Received: by outflank-mailman (input) for mailman id 559410;
 Wed, 05 Jul 2023 16:09:39 +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 <SRS0=dIgq=CX=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qH54V-00078Z-7a
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 16:09:39 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on0621.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::621])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 552c9573-1b4e-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 18:09:35 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB7661.eurprd04.prod.outlook.com (2603:10a6:102:e3::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 16:09:32 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 16:09:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 552c9573-1b4e-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=iixZgmlfQZdmARS041G/rfHmjfzJwrfs8edlyuMbqPqDWn2XH/YGFkoIxVIldsUHObgIryMiFPFPC+Xj5/38bvAJvZo9qGlm8G3uhNVEI20bp9GIynt1QfPKBI9lTqcP0htiywLkLe08/hTdTpLfKEWhkOUxHTP4QXbtmB8NBmQ7OgokZIOS6wo0bjGxZOtg6fFjBYBY7z1L17e84lEhuUg+du1EpZDYFmA3Sno4zoP0h5P47RYiraH55k9Tmbk2U+7w5nzYz3hGcR73Q/cNRRj/SGuy43C0L1xNOJMhiPzqwc3g1bNovg5lHvSIwKGAroZE8IHYrO6d6iO+N2nMwg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0VKhlOi63tb7CSHiqLYBRVxGNILIVhDrL9rIEgQudYE=;
 b=RshxQBN4SqiqmGUOPvMk3V3g1V74eD/TPbvPQqaa46+oZ73llx9kfMV4fVtSvDW/wgkLzfEdHHNHru85NWGi0z8AOcCx+yGgsKsjhVay/syDm2CLr6JNqiTiG4m6haGlcJF1LinCKaw1VfTQJt7TGP4CtpF6PsWmSvG4fSYkc7kPCnN8NuWgXtzkGJKsAH1gp2lAxogohaBOXBA4B6cbafX8Hs9jgawrgRrXOESsPUb/35w6+Zshuo6ReF95I4Da8NsIg9dmXfDrRF3ve+ucYPR4hEVFqyJPBB2hROri4GJ+s+vNUfYWD8YHYdkeIJqXd4T/Yb0DOgqSidMRDhLWSQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0VKhlOi63tb7CSHiqLYBRVxGNILIVhDrL9rIEgQudYE=;
 b=2ODfQnnYKii9mE/mOqYittRxNqyXw8JoUDGc0rJAG0OPzeefnAU/pt2T1BueRr0FVAwSt/UnEBaUAYMwPfAVB2y91gRHcZegMnyqJyNw/UlLBJS081Jqe6Nw6m8M0KETnZS5xCp78ok1YdDc3MhwN98Lg4jsZAublvmMxGvqcIy8WfZsknzXxNiyKBrYNDP2rSAwEV0zCgFPW8NapjCpekdYLuV1663vgEn3DMhqnQ4ldRGHjwOe4ZX5ZNKHeV7ef8bVH1A2IwAF287ZiiqTgqk/Mb8gKYlqkZkyio7V51ZnGsRkRlNelp/YgRlkZTBa6c/BS8jXhdBUnVKXqmAMOQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <cbf263fe-9221-018d-b187-3d17be76e937@suse.com>
Date: Wed, 5 Jul 2023 18:09:30 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH] ppc: make also linking work with big-endian tool chain
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <f56a208f-97d1-b7ec-afad-3b7bc180cf87@suse.com>
 <4725795c-3f0e-af91-5683-1059ba6163c9@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <4725795c-3f0e-af91-5683-1059ba6163c9@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0087.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1f::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB7661:EE_
X-MS-Office365-Filtering-Correlation-Id: ed88e716-7413-4cca-1dab-08db7d723839
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	TE3J/Yx5tX9y2ZAdJcsyYgjq6RtFLTZ4MngECr8obGmeOSAsgCY+cKznjSAIambFHp5QXNYwqGNi3OU2chQSkhSN2Nrh4ByEq6rqV4XVioQfCZMIi6tklOxdGptOQBIqhLReqoI1HQa9DOmmhGPb6IRDn/k4q7/KvCBPkd6fMV0KKbGm/Tbk7e/JXUr+3i4cMbGJeSVSppMFWBRpPNCwsJ9mtXx1oq4NitCBXDkND8OzGnN4ekXM9LocyTyS8wFcOfok8pWsd0Uy+TCqv1KJT9m1QXtE15IWHJpcAPH8QpiHib3FKCn5iXdE+iv7qZgUtxgWGMzo5junMYJWA3rCmdocxQRgnu9lL8W/u1sZMS0Fb8fT58EXkHvhDxODwX3SLTIDgL1KkHsky3tgOeOEsIPtHWf0CQBPGgjhGkzzc+8upF2xKyfpnn9eAAlCavtGRz37ipFkLYD4On2ZBzsspy7+Fc3f0Ozg6qql0/2pGXQHpghZzryzz8e3EL/Yz/50hFyoEyfFiMmoiVLl6mpN9IAyGE37x6AMRgtKqe9mjshyGcrRNcLzhkhsnBDREEzjBtLgvABGEAdbI/pn6BnW1NniZHI1UL//nXFo7sDLXf2nsNF9Luhun3prWLDcc58YlitjM6pbimIV3UpqHdUvPA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(136003)(39860400002)(366004)(396003)(451199021)(26005)(31686004)(478600001)(6512007)(6506007)(31696002)(86362001)(2616005)(186003)(38100700002)(53546011)(66946007)(66476007)(66556008)(110136005)(6486002)(316002)(8676002)(8936002)(41300700001)(2906002)(5660300002)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bE1EbW56ZE5DN3IwZXpzV2llcTY0WmN6eEdLT1JRQkxyTGxPdzN3R0Z5OVZz?=
 =?utf-8?B?bUdUMWpaTE42dVZPQzAwMytWaFVqYXFRcjNrOVkwQnlPd05UV2ZHdTNiVmRK?=
 =?utf-8?B?VnkrUXJBeTV1RlFIaVFwSEpDZ2t6dU9SZXhmeFpZMWk5ektlUU92aGdHa1pE?=
 =?utf-8?B?YVg4Lzc1OU5hbXR4QVZFdTJnbkxSMkxRWVZhK2MvclBmU053cG15K1htZklD?=
 =?utf-8?B?TTFHRS90bXUxUExZTWpac0RvNW9FQnl0VFJXOGFhUWlLcG9ZVG5ZbzBFeG1a?=
 =?utf-8?B?RDJSNVdqcnNhbVVlc3hSUXU3Qi8wbHNzZVZ3UmI0dlNaS1duTEt4SW95c3Fz?=
 =?utf-8?B?OC9qMm1Db3VKc1JpQzZDdUJOS2tsSUpBYmpEZGszNlFmVVQyYkZZY1l3aER0?=
 =?utf-8?B?Ukx4VkgwYnlib21ENXlBOTAzTTRST2tNZ1hwOUZTMFI1SkczRjFWY0I3aVhq?=
 =?utf-8?B?Tk1nbTlUSVdqemhMeUg2N21CWTZGRUZsMDU0TWhJR1JLZHdEdG50S2QzYkdP?=
 =?utf-8?B?T0ovcWxJRjlQOUhyMzNCd2lUS2xkTXl4OTdIb2hKZ2tKNW5DRER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UEZSY0NQZWRtcGQyVi9vUmVyZ09TT2dhNVhrbUpQejVXQkpw?=
 =?utf-8?B?czhVallpR25tblJubjFKOUJDeFRDVjZ5akRJUkV6WHlPYXZnQlRSTDFJaVJv?=
 =?utf-8?B?c3dKTTRvK2x2dll1azRFQ2NHUnFJVmExWUNpRmJrcTJSd1hYODQyUFlNNndM?=
 =?utf-8?B?eXdveDlkdkFCUURtMGRZcEQ3Sm1RU2ozemdCbjgySHc2NlFBOW5EbjJTMGFW?=
 =?utf-8?B?bFN6bXlPSkJxQThCL1JHM0pzVi9SaVdDVVJiTU96T2NVdmJveDhlM1FDS3B0?=
 =?utf-8?B?REpFb1ZlT3BmT2c2VTFZdW50aTFXbTAxN213MDFqekxIc3gvMzM4dVJ3TllX?=
 =?utf-8?B?cTlUdlJIYklYYjd4a1Q3MnRsYXJQb3NiVFpNbzhvUFlwa1oxYUxXbUVRVk9z?=
 =?utf-8?B?N1J4cFRZdlNVdkhoQXZlZldQSm1RN1pwTnVtbUVVY1FOYm9HaVE1UXlGdkpS?=
 =?utf-8?B?aWpOSjNOdTJpVEdlMUFMdXF3cG0ycEE1LzVNaEhsem1vbStqYnh6d1N0TW1m?=
 =?utf-8?B?bS9EZ2hXRUtuemp1dWd1dFJpY2NrSmFMY1hzRTFYU2J0ZDZsUHBycEpKMEU5?=
 =?utf-8?B?YkY3TUhoMFY2RDRsdG5aTWYyZ3R3RldMdFhIUUFRNzZNdk5zUWZlOWZuMnNy?=
 =?utf-8?Q?DeKK+18Wr9Do85L9A4byWlnW9?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ed88e716-7413-4cca-1dab-08db7d723839
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 16:09:32.7564
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: JsdVM3c+nJOYSmMDQ+KDBIwnlpPdym61wXDWmkjrTh7KY/7MNAtjfN1QtvrYDSB+LNYDSf9HyiLSWoSzGOjaMA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7661

On 05.07.2023 17:10, Shawn Anastasio wrote:
> On 7/5/23 9:44 AM, Jan Beulich wrote:
>> Telling just the compiler to produce little-endian objects isn't enough.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>
>> --- a/xen/arch/ppc/arch.mk
>> +++ b/xen/arch/ppc/arch.mk
>> @@ -7,6 +7,8 @@ ppc-march-$(CONFIG_POWER_ISA_3_00) := po
>>  CFLAGS += -m64 -mlittle-endian -mcpu=$(ppc-march-y)
>>  CFLAGS += -mstrict-align -mcmodel=large -mabi=elfv2 -mno-altivec -mno-vsx
>>  
>> +LDFLAGS += -m elf64lppc
> 
> Looking around, it seems GNU ld also has a -EL flag:
> 
>   -EL Link little-endian objects.  This affects the default output format.
> 
> Linux's build system passes both -EL and -m elf64lppc, though I'm
> wondering if -EL alone would be enough.

What I did is check what gcc passes to ld when itself passed -mlittle
or -mlittle-endian.

> In any case, this doesn't break the build with my ppc64le toolchain, so
> if this fixes issues you're seeing with BE toolchains then it's fine
> with me.
> 
>>  # TODO: Drop override when more of the build is working
>>  override ALL_OBJS-y = arch/$(SRCARCH)/built_in.o
>>  override ALL_LIBS-y =
> 
> Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>

Thanks.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 16:12:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 16:12:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559414.874365 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH57F-00005k-FZ; Wed, 05 Jul 2023 16:12:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559414.874365; Wed, 05 Jul 2023 16:12:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH57F-00005d-Bl; Wed, 05 Jul 2023 16:12:29 +0000
Received: by outflank-mailman (input) for mailman id 559414;
 Wed, 05 Jul 2023 16:12:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Sl8t=CX=suse.cz=jack@srs-se1.protection.inumbo.net>)
 id 1qH57E-00005T-DD
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 16:12:28 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bb92eaad-1b4e-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 18:12:26 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id CB46921E20;
 Wed,  5 Jul 2023 16:12:25 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A8D5D134F3;
 Wed,  5 Jul 2023 16:12:25 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id p7ssKWmWpWRbQAAAMHmgww
 (envelope-from <jack@suse.cz>); Wed, 05 Jul 2023 16:12:25 +0000
Received: by quack3.suse.cz (Postfix, from userid 1000)
 id 1C3A6A0707; Wed,  5 Jul 2023 18:12:25 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bb92eaad-1b4e-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa;
	t=1688573545; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=laJnl7HhQK/Tv/PqzUYoidR/wXDE+WAIJVPIFf2lcfQ=;
	b=pVxtRSYxDum30xk4c2JQyuaRHFNvjqGI5pa+1l9TjK2H7ROMjo7EdIGdDlzQXwaIwGyi0D
	MYHnvgKqRst/eyFC+Okrc961iU1V/Mr8qyrvjiZzwHXWReUpWSrhSFOpe79t3kyTfJeQAV
	Hf2p1cnNnsYhDEREwuHH1JI7foWXj1M=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;
	s=susede2_ed25519; t=1688573545;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=laJnl7HhQK/Tv/PqzUYoidR/wXDE+WAIJVPIFf2lcfQ=;
	b=6GnGLv2MGHnmlspZbI9IPcwZjE0UgNGbJUyuJME/ujhWk8XPp6xGrnnDrvfBxv6bSto5fw
	0j8hz2dNTzGg/WAQ==
Date: Wed, 5 Jul 2023 18:12:25 +0200
From: Jan Kara <jack@suse.cz>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Jan Kara <jack@suse.cz>, linux-block@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@infradead.org>,
	Alasdair Kergon <agk@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anna Schumaker <anna@kernel.org>, Chao Yu <chao@kernel.org>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Dave Kleikamp <shaggy@kernel.org>, David Sterba <dsterba@suse.com>,
	dm-devel@redhat.com, drbd-dev@lists.linbit.com,
	Gao Xiang <xiang@kernel.org>, Jack Wang <jinpu.wang@ionos.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	Joern Engel <joern@lazybastard.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	linux-bcache@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org,
	linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org,
	linux-nilfs@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-pm@vger.kernel.org, linux-raid@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	"Md. Haris Iqbal" <haris.iqbal@ionos.com>,
	Mike Snitzer <snitzer@kernel.org>, Minchan Kim <minchan@kernel.org>,
	ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Song Liu <song@kernel.org>, Sven Schnelle <svens@linux.ibm.com>,
	target-devel@vger.kernel.org, Ted Tso <tytso@mit.edu>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions
Message-ID: <20230705161225.cwig5a3mo6oz7lew@quack3>
References: <20230629165206.383-1-jack@suse.cz>
 <20230704122224.16257-1-jack@suse.cz>
 <bb91e76b-0bd8-a949-f8b9-868f919ebcb9@acm.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <bb91e76b-0bd8-a949-f8b9-868f919ebcb9@acm.org>

On Tue 04-07-23 07:06:26, Bart Van Assche wrote:
> On 7/4/23 05:21, Jan Kara wrote:
> > +struct bdev_handle {
> > +	struct block_device *bdev;
> > +	void *holder;
> > +};
> 
> Please explain in the patch description why a holder pointer is introduced
> in struct bdev_handle and how it relates to the bd_holder pointer in struct
> block_device. Is one of the purposes of this patch series perhaps to add
> support for multiple holders per block device?

No. The reason for adding holder to struct bdev_handle is that it is an
argument blkdev_put() needs. Currently, every user of blkdev_put() has to
remember what it has passed as 'holder' to blkdev_get_by_*() call and pass
that to blkdev_put(). With struct bdev_handle this will happen
automatically. This is already explained in the changelog of this patch:

"Create struct bdev_handle that contains all parameters that need to be
passed to blkdev_put()..."

If it was only about holder, the intrusive patches would not be warranted
but as the description also says:

"This will eventually allow us to pass one more argument to blkdev_put()
without too much hassle."

Because we will additionaly need to propagate the 'mode' argument used at
open to blkdev_put().

								Honza

-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 16:20:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 16:20:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559418.874375 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5F4-0001cG-81; Wed, 05 Jul 2023 16:20:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559418.874375; Wed, 05 Jul 2023 16:20:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5F4-0001c9-53; Wed, 05 Jul 2023 16:20:34 +0000
Received: by outflank-mailman (input) for mailman id 559418;
 Wed, 05 Jul 2023 16:20:32 +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 <SRS0=j+zt=CX=rabbit.lu=slack@srs-se1.protection.inumbo.net>)
 id 1qH5F2-0001c3-GT
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 16:20:32 +0000
Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com
 [2a00:1450:4864:20::435])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dbadb072-1b4f-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 18:20:29 +0200 (CEST)
Received: by mail-wr1-x435.google.com with SMTP id
 ffacd0b85a97d-314319c0d3eso4580687f8f.0
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 09:20:29 -0700 (PDT)
Received: from [192.168.2.1] (82-64-138-184.subs.proxad.net. [82.64.138.184])
 by smtp.googlemail.com with ESMTPSA id
 b7-20020a5d45c7000000b003141a3c4353sm16771546wrs.30.2023.07.05.09.20.28
 for <xen-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 05 Jul 2023 09:20:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dbadb072-1b4f-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=rabbit-lu.20221208.gappssmtp.com; s=20221208; t=1688574029; x=1691166029;
        h=content-transfer-encoding:in-reply-to:from:references:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=vd4i6GUUWzkaWI2I6bKoQby3/uL88g/Mw2tctfykYVw=;
        b=O4/uPLeCiWqIHF0VcAesp4tlOvsBwmXccPeOVP4JOAdfQ/KXn6MWLLh/xIUwNWUQBN
         yQ2Z7SqNqC0klPovJZBeXw1xo3FOyb0BntNF32wduhUhH/3MHSkxB0C+JQ3MJ1/VoeF4
         w6OkmVE/JI/JZ7ytdAZiX4AOXPTn68GMLbbfJ9GCcqkZIj5bcv1ulbNUUanJN6XNHbOZ
         Fo/Qeh5dyp+tvjBsDby48rqSTIwjKH9lAGBdXU8fGCpcmRhbr+gSkyKR/cdhrSVgRcxS
         9pqiUYndTQXP5kHrHH5O/gq0h+06cpul1toqF+eUdpxMVZdLqIAOvKnvcyyuRd7iqHPp
         eagA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688574029; x=1691166029;
        h=content-transfer-encoding:in-reply-to:from:references:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=vd4i6GUUWzkaWI2I6bKoQby3/uL88g/Mw2tctfykYVw=;
        b=aSYQFcn6h56QtFuohKaT8R5oAY902IM36wo7ycQoGBhoOPqFgKWq8fvudzro/Zh1Jz
         6d1Ra4mEbipquR6nAKqIrPXP9+eBIt2cXIKOj+hW7nqRElKUpZRxZp1zIUD46Gs5mQ+Z
         FC8qZFfAlzQpHQNPztMyNCtgPEFhWN+sAQSl6BlLWkb1bH2l0NrkJORJ7pV+6u+vHEZ0
         NnZilsDBm/y12M0obxg6rs30ccgDpS7SdjwaFkh96K8PJPgFmZBxVNd7DbGq1pO0hqKt
         vYm9XaQJmx6L27hFqYRV04LObLdCWg8vYIy205XPV6rLVcMuUciO7R8oi/ocYTpzaVGI
         /szg==
X-Gm-Message-State: ABy/qLboZxm4iWzu6XjbnMTlSvllux893ms0e7PjfzJ44bh2ASQDK6zp
	Vuqe8m2g4ZQPhuImY0WcE7qxOy918zrgscitlt0=
X-Google-Smtp-Source: APBJJlHm4SZb8p+/IS7vEBor1JWImZTOAoeaHOGi4govHlWtAG19wye+FVFQWDCthm918+G8UL3yiA==
X-Received: by 2002:adf:fc08:0:b0:314:824:378c with SMTP id i8-20020adffc08000000b003140824378cmr14058993wrr.20.1688574028779;
        Wed, 05 Jul 2023 09:20:28 -0700 (PDT)
Message-ID: <4ee01a0f-063e-ef93-ac24-da387d5b3438@rabbit.lu>
Date: Wed, 5 Jul 2023 18:20:25 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: Detecting whether dom0 is in a VM
Content-Language: en-US
To: xen-devel@lists.xenproject.org
References: <CA+zSX=Y4MwsDSd9oSG1NQyt==YAw9SeRdh=eJxTUhhOx57ihWg@mail.gmail.com>
From: zithro <slack@rabbit.lu>
In-Reply-To: <CA+zSX=Y4MwsDSd9oSG1NQyt==YAw9SeRdh=eJxTUhhOx57ihWg@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 05 Jul 2023 17:51, George Dunlap wrote:
> Hey all,
> 
> The following systemd issue was brought to my attention:
> 
> https://github.com/systemd/systemd/issues/28113
> 
> I think basically, they want `systemd-detect-virt` return the following
> values:
> 
> Xen on hardware, from a dom0:  `none`
> Xen on hardware, from a domU: `xen`
> Xen in a VM, from a dom0: (ideally the virtualization type, or `vm-other`
> if not)
> Xen in a VM, from a domU: `xen`
> 
> Is there a reliable set of tests which would work across all dom0 guest
> types / architectures?  If not, can we expose the information somehow?
> 
>   -George
> 

Small follow-up, I did some more tests (AMD platforms).
systemd-detect-virt (sdv) is using "/sys/class/dmi/id/sys_vendor".

On both "baremetal" dom0s, sdv is reporting the platform manufacturer 
("MSI" or "Micro-Star International Co., Ltd." on my systems).

On a nested dom0, sdv is reporting "xen" :
   root@xen-nested:~# SYSTEMD_LOG_LEVEL=debug systemd-detect-virt
   Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy
   Found container virtualization none.
   Virtualization Xen found in DMI (/sys/class/dmi/id/sys_vendor)
   Found VM virtualization xen
   xen

PS: my host "xen-nested" is not masking CPUID leaves in cfg file.

So I'm wondering, isn't that path enough for correct detection ?
I mean, if "/sys/class/dmi/id/sys_vendor" reports Xen (or KVM, or any 
other known hypervisor), it's nested, otherwise it's on hardware ?

Is that really mandatory to use CPUID leaves ?


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 16:22:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 16:22:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559422.874385 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5Gw-0002AG-Iw; Wed, 05 Jul 2023 16:22:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559422.874385; Wed, 05 Jul 2023 16:22:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5Gw-0002A9-FY; Wed, 05 Jul 2023 16:22:30 +0000
Received: by outflank-mailman (input) for mailman id 559422;
 Wed, 05 Jul 2023 16:22:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Yom7=CX=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qH5Gv-0002A3-DJ
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 16:22:29 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 20b068e3-1b50-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 18:22:26 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id E9C56828567C;
 Wed,  5 Jul 2023 11:22:24 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id CBDxtnRCiVAK; Wed,  5 Jul 2023 11:22:24 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 4AF958285887;
 Wed,  5 Jul 2023 11:22:24 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id lii_44lKzvfG; Wed,  5 Jul 2023 11:22:24 -0500 (CDT)
Received: from [10.11.0.2] (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id D49A0828567C;
 Wed,  5 Jul 2023 11:22:23 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 20b068e3-1b50-11ee-b237-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 4AF958285887
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1688574144; bh=AusMONxj1EnyFiiKuk2xJDRzmoM33Z6sxYwSdwy5Ka8=;
	h=Message-ID:Date:MIME-Version:To:From;
	b=Dzo9hR0bWSJLDhfs8XMaPEgcDgH2jicdgGCXMSflMaQMdHeQurayaakayiOIRaOOz
	 m9T8o3Rhdea28/G4KHXbHhIE4eRdn2qgq8zmg5iuaC0wu9FsnRk68GcIPZWfc+vbG6
	 86zfmWF9fNmaRATszziEj7karcMR4DH2dQzEZ0tU=
X-Virus-Scanned: amavisd-new at rptsys.com
Message-ID: <1b3a9165-43fd-d8e0-5c2f-49875973c8e1@raptorengineering.com>
Date: Wed, 5 Jul 2023 11:22:23 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH] ppc: make also linking work with big-endian tool chain
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <f56a208f-97d1-b7ec-afad-3b7bc180cf87@suse.com>
 <4725795c-3f0e-af91-5683-1059ba6163c9@raptorengineering.com>
 <cbf263fe-9221-018d-b187-3d17be76e937@suse.com>
From: Shawn Anastasio <sanastasio@raptorengineering.com>
In-Reply-To: <cbf263fe-9221-018d-b187-3d17be76e937@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 7/5/23 11:09 AM, Jan Beulich wrote:
> On 05.07.2023 17:10, Shawn Anastasio wrote:
>> Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
> 
> Thanks.

Just to clarify, as the maintainer of PPC64, would it be my
responsibility to commit this now directly to xen/staging? Or should I
commit it to my own tree and have someone pull it?

I'm not super familiar with the project's maintainer workflow yet so any
hints would be appreciated.

> Jan

Thanks,
Shawn


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 16:28:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 16:28:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559428.874404 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5MF-00034U-Fi; Wed, 05 Jul 2023 16:27:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559428.874404; Wed, 05 Jul 2023 16:27:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5MF-00034N-D7; Wed, 05 Jul 2023 16:27:59 +0000
Received: by outflank-mailman (input) for mailman id 559428;
 Wed, 05 Jul 2023 16:27:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jUcB=CX=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qH5MD-0002mx-Am
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 16:27:57 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2071.outbound.protection.outlook.com [40.107.7.71])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e5bf7eab-1b50-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 18:27:56 +0200 (CEST)
Received: from AS9PR07CA0033.eurprd07.prod.outlook.com (2603:10a6:20b:46b::19)
 by VI1PR08MB10030.eurprd08.prod.outlook.com (2603:10a6:800:1c9::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 16:27:16 +0000
Received: from AM7EUR03FT045.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:46b:cafe::48) by AS9PR07CA0033.outlook.office365.com
 (2603:10a6:20b:46b::19) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 16:27:16 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT045.mail.protection.outlook.com (100.127.140.150) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.22 via Frontend Transport; Wed, 5 Jul 2023 16:27:15 +0000
Received: ("Tessian outbound e2424c13b707:v142");
 Wed, 05 Jul 2023 16:27:15 +0000
Received: from 6d9256312912.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 B795DFCA-32A7-4581-895A-1452529E0C4B.1; 
 Wed, 05 Jul 2023 16:27:03 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6d9256312912.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 16:27:03 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by AS8PR08MB6469.eurprd08.prod.outlook.com (2603:10a6:20b:33c::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 16:27:01 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::3861:64c:eb82:afa1]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::3861:64c:eb82:afa1%4]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023
 16:27:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e5bf7eab-1b50-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Le09054YEX6s0TRwwotIsDcNWfolsiiLOmqo1dTHFJU=;
 b=JqD12rvQxtzRaBTRBH0A1hSDMcleetaux46UQZa4ijncYBWWMPqMsnNXx4I9eSX5q31YxenumFJKr2980AoKMPLjSGj+9CxC+hgEhxljfI+QFvTaRJgPbs+QLoMKSpATJKQ/fkEeq2Xmn4/rmJNc2+4m0+JlYo3vZ3BnXjvHDkA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 8168b3122a6a71c3
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=i76+VH3v/lHPt27vCe29rDBKCFGA7M8+L1hVrLBTqoHQHfrY8Al3nKepxMT66BpQnnjculuTnsaT6HPHAKE8bhFUMLmCknWxlIkXxEUaOQSW5b7ToXXbVoW3H/rO5uxYPT+mYYIDsIdspSVdm8b4EeuzknKK04mGLt+viDyIGLSpHitO13xa4vQjIb9NrSmNIsFQEtO4yCP3eS1dyxUTyLK+CA85JP8uTfnzjk+jmMEgn3+QFX/kkRF71n2yww8PNZufuaxAECFSiiq7ThdVxVWWgcirKOQzxVC5TP0mr9q5iQFoz71kuhcAEV0Ch2cWB/2O3Mjp7y8Ti15kwn4Ntg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Le09054YEX6s0TRwwotIsDcNWfolsiiLOmqo1dTHFJU=;
 b=modq7cPWmhxJjDgkf8RDLzWgVBecr6DcBNQhTFHXcIGVp6wugMhj9KO5o9blBEI7PAbDrR+b0Oh8IBe8PN75P9lf6HZ6Wv52JCWoB2vtLhsl/XJEdHfd78SypFeGutNxjhiKrRPDLCAqGzqQn2aHGz9Micp6KYEhw0Q8nKJs3Wndv7fvxS1LNCCd0eu/504DBJg/jXJ+JysUrPBfxE0ewO1ixJ51DjoEaJYYx+GJj/MfxyDCqCKb9vzNVO6cSQEJTaOMECh/5wtqBeL9MqMo/SQl68XCVCKgq5JLZ9XsQf044rNSoZiCAodM3+9rpBz6tkrV1CBrhJb/kD8LtJeUQw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Le09054YEX6s0TRwwotIsDcNWfolsiiLOmqo1dTHFJU=;
 b=JqD12rvQxtzRaBTRBH0A1hSDMcleetaux46UQZa4ijncYBWWMPqMsnNXx4I9eSX5q31YxenumFJKr2980AoKMPLjSGj+9CxC+hgEhxljfI+QFvTaRJgPbs+QLoMKSpATJKQ/fkEeq2Xmn4/rmJNc2+4m0+JlYo3vZ3BnXjvHDkA=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Simone Ballarin <simone.ballarin@bugseng.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, "consulting@bugseng.com"
	<consulting@bugseng.com>, Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
	Bertrand Marquis <Bertrand.Marquis@arm.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Michal Orzel <michal.orzel@amd.com>, Xenia
 Ragiadakou <Xenia.Ragiadakou@amd.com>, Ayan Kumar Halder
	<ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH v2 04/13] xen/arm: fix violations of MISRA C:2012 Rule
 7.2
Thread-Topic: [XEN PATCH v2 04/13] xen/arm: fix violations of MISRA C:2012
 Rule 7.2
Thread-Index: AQHZr1U7uIYEMfg1kUezCieUYnmo76+rXFUA
Date: Wed, 5 Jul 2023 16:27:01 +0000
Message-ID: <FDCB18E6-3D49-4634-BD11-931E03B2438C@arm.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <c58aa850214380cb6f799226a911968fd33a98ff.1688559115.git.gianluca.luparini@bugseng.com>
In-Reply-To:
 <c58aa850214380cb6f799226a911968fd33a98ff.1688559115.git.gianluca.luparini@bugseng.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|AS8PR08MB6469:EE_|AM7EUR03FT045:EE_|VI1PR08MB10030:EE_
X-MS-Office365-Filtering-Correlation-Id: 3396434f-f2e3-4e08-7af2-08db7d74b1e1
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 98mLDqE5lRFDP8QLThYaGAQmFGw7Zbfu1wPPx99qACpwDP5vQaZXWjU2aEMTEhy+u1dLK1yuJSyjFHMCSdDnvrTUS5SqGP9xewd5SltDTS5+B55w0oXqQxryB/ZbXSPTdJlANVzpouE1EJtbbQuinLxKWfNuuqhbxC/5kHnL/IPUEEdGvRfW+go4eh9asa4IgsyIy0KEI/KHKEw33TPgKgz0E2RYkn4VWHCFZ1qeIOm1EeaqiNBW8iz7m0MChKghLQUBJikp8bKPeXSn/mBPc61LPZpZ7VJpBwds1YXLCgtSLNX+WVDr+2sdsEAWDbHdJTgZXEr7o6YruLxL0MlURdOltbRt9mEFkwB9Ywxok1jswsvpHVffdC/BtVqo0jtgEjFGpqfYEFGhLpWIX+k4jDhLfYz1k4U09IJXOe/vrcUWWkkjkOQ5PN1tgXO2OS2hWkKaIEQ09AdlXQABqLMq0WhWspjYk4G2/p1vUtUYpM7BObRrZs9uGBpeTbiEJ7VIblrg8mtjYNKqfD7BczX5h1lz8u8UHKWbZZACECn4SHq16sILyk2UciH+ISjXrXtc2Ak8YmmsOCbs6/m5kzfTBjekzjAwQd2DSa4VaGyP91salKH+/gwHTVBw0np+IYAXOX68mafqzBRasvQatWf0OA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(366004)(39860400002)(396003)(346002)(376002)(451199021)(2616005)(4326008)(76116006)(66946007)(91956017)(38100700002)(66446008)(66476007)(64756008)(66556008)(6916009)(122000001)(186003)(86362001)(478600001)(36756003)(38070700005)(6486002)(33656002)(71200400001)(6512007)(26005)(53546011)(6506007)(8676002)(8936002)(30864003)(54906003)(5660300002)(7416002)(2906002)(41300700001)(316002)(83380400001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <7E9CE499CF5F924AB3CD657546FA26CD@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6469
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT045.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	5ed9818c-1b75-4f63-2370-08db7d74a943
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	oGR4Qwt6f1ZYaQlYNjZpohSsRskAKYFRocnOLI6Pp+etRQpWPoxeCXuZYwkE8ZmitqleVKVTPGZ/Gg2hfkbxaZkDhaLO6DzQRb2FpdW4X7/vPsMURZH5ogLOw8/dP2FXSCa42jO5qbB2DtIzBY8onXY46GcZAZqj+5zLOKV/ByjyvjYp7P3/v9kvKlSS3+SCx1jI/x8NyVei6gusP+XfpPyWcjhN/nrbNgTLCY+eLoHn0BMyUpks2MXq0vVF67W3jN+FsY2Ulp8RvXfgrz45UFG5ndcQqFEY654BvKGsdx/lAmVMj5WUw40dh3rwwQexTRdUkXfD4RFjmMcCisKnOu76NP2lFEnxv70ZTaqhMWkOu+eYoCegUiJn0SZG7oi+kAO0T9g4vL1SETdmsZxig1fPIDAC+eZhIT+KZq4pzbHLGQgzrmzmNIlL/SWCdChQ03COhyEywuD0iuy9cDtTm30K+sAS6WS2+1uXhNqSfa2nJSuOVrdNrsC32T18JC9eVwHWdQ6CZiYQt/gCXa7FIL5XyBm1ByRTfKwnUU+Wi+6lrMO4pkk+kF9lNWF1gYwMWVdwB/kuBOpSIvl0jY8jzfqy+1nOTsst1yoNsU5MJrcTYiBB4a6lhhlIJdGkIyI8m1Yb2N18+agf8kG9FE81Pf3cIWgl+ZiKRIfJCuZvbGrw2+hJUXdovrX7RmEJ86bMFJLRC4xME5AW5LlhCY87b8duqC/FCanvJTTFgsLL/UqMPE/9WvY9fxLOr2uHi31K
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(396003)(376002)(136003)(451199021)(36840700001)(40470700004)(46966006)(30864003)(40460700003)(8676002)(2906002)(41300700001)(6862004)(5660300002)(8936002)(82310400005)(33656002)(36756003)(40480700001)(86362001)(6512007)(6486002)(478600001)(83380400001)(47076005)(336012)(36860700001)(70206006)(186003)(26005)(53546011)(2616005)(82740400003)(6506007)(4326008)(54906003)(81166007)(356005)(316002)(70586007);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 16:27:15.6298
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 3396434f-f2e3-4e08-7af2-08db7d74b1e1
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT045.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB10030



> On 5 Jul 2023, at 16:26, Simone Ballarin <simone.ballarin@bugseng.com> wr=
ote:
>=20
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
>=20
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
>=20
> Add the 'U' suffix to integers literals with unsigned type and also to ot=
her
> literals used in the same contexts or near violations, when their positiv=
e
> nature is immediately clear. The latter changes are done for the sake of
> uniformity.
>=20
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> ---
> Changes in v2:
> - minor change to commit title
> - change commit message
> - fix in 'domain_build.c' file for consistency
> - fix typo in 'gic-v2.c' file
> - fix in 'insn.h' file for consistency
> - add fixes in 'gic-v3.c', 'traps.c' and 'vgic-v3.c'
> ---
> xen/arch/arm/domain_build.c              |  4 ++--
> xen/arch/arm/efi/efi-boot.h              |  2 +-
> xen/arch/arm/gic-v2.c                    |  6 +++---
> xen/arch/arm/gic-v3.c                    | 10 +++++-----
> xen/arch/arm/include/asm/arm64/brk.h     |  2 +-
> xen/arch/arm/include/asm/arm64/efibind.h | 10 +++++-----
> xen/arch/arm/include/asm/arm64/insn.h    | 16 ++++++++--------
> xen/arch/arm/include/asm/vreg.h          |  2 +-
> xen/arch/arm/kernel.c                    |  2 +-
> xen/arch/arm/traps.c                     | 14 +++++++-------
> xen/arch/arm/vgic-v2.c                   |  2 +-
> xen/arch/arm/vgic-v3.c                   |  2 +-
> xen/include/public/arch-arm/smccc.h      |  8 ++++----
> 13 files changed, 40 insertions(+), 40 deletions(-)
>=20
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index d0d6be922d..d58604ef4a 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -3751,8 +3751,8 @@ static int __init construct_domain(struct domain *d=
, struct kernel_info *kinfo)
>          * r1 =3D machine nr, r2 =3D atags or dtb pointer.
>          *...
>          */
> -        regs->r0 =3D 0; /* SBZ */
> -        regs->r1 =3D 0xffffffff; /* We use DTB therefore no machine id *=
/
> +        regs->r0 =3D 0U; /* SBZ */
> +        regs->r1 =3D 0xffffffffU; /* We use DTB therefore no machine id =
*/
>         regs->r2 =3D kinfo->dtb_paddr;
>     }
> #ifdef CONFIG_ARM_64
> diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
> index bb64925d70..585332647d 100644
> --- a/xen/arch/arm/efi/efi-boot.h
> +++ b/xen/arch/arm/efi/efi-boot.h
> @@ -46,7 +46,7 @@ static int get_module_file_index(const char *name, unsi=
gned int name_len);
> static void PrintMessage(const CHAR16 *s);
>=20
> #define DEVICE_TREE_GUID \
> -{0xb1b621d5, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, =
0xe0}}
> +{0xb1b621d5U, 0xf19cU, 0x41a5U, {0x83U, 0x0bU, 0xd9U, 0x15U, 0x2cU, 0x69=
U, 0xaaU, 0xe0U}}
>=20
> static struct file __initdata dtbfile;
> static void __initdata *fdt;
> diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
> index 6476ff4230..cf392bfd1c 100644
> --- a/xen/arch/arm/gic-v2.c
> +++ b/xen/arch/arm/gic-v2.c
> @@ -386,9 +386,9 @@ static void gicv2_cpu_init(void)
>     /* The first 32 interrupts (PPI and SGI) are banked per-cpu, so
>      * even though they are controlled with GICD registers, they must
>      * be set up here with the other per-cpu state. */
> -    writel_gicd(0xffffffff, GICD_ICACTIVER); /* Diactivate PPIs and SGIs=
 */
> -    writel_gicd(0xffff0000, GICD_ICENABLER); /* Disable all PPI */
> -    writel_gicd(0x0000ffff, GICD_ISENABLER); /* Enable all SGI */
> +    writel_gicd(0xffffffffU, GICD_ICACTIVER); /* De-activate PPIs and SG=
Is */
> +    writel_gicd(0xffff0000U, GICD_ICENABLER); /* Disable all PPI */
> +    writel_gicd(0x0000ffffU, GICD_ISENABLER); /* Enable all SGI */
>=20
>     /* Set SGI priorities */
>     for ( i =3D 0; i < 16; i +=3D 4 )
> diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
> index 4e6c98bada..95e4f020fe 100644
> --- a/xen/arch/arm/gic-v3.c
> +++ b/xen/arch/arm/gic-v3.c
> @@ -619,8 +619,8 @@ static void __init gicv3_dist_init(void)
>     /* Disable/deactivate all global interrupts */
>     for ( i =3D NR_GIC_LOCAL_IRQS; i < nr_lines; i +=3D 32 )
>     {
> -        writel_relaxed(0xffffffff, GICD + GICD_ICENABLER + (i / 32) * 4)=
;
> -        writel_relaxed(0xffffffff, GICD + GICD_ICACTIVER + (i / 32) * 4)=
;
> +        writel_relaxed(0xffffffffU, GICD + GICD_ICENABLER + (i / 32) * 4=
);
> +        writel_relaxed(0xffffffffU, GICD + GICD_ICACTIVER + (i / 32) * 4=
);
>     }
>=20
>     /*
> @@ -832,13 +832,13 @@ static int gicv3_cpu_init(void)
>      * The activate state is unknown at boot, so make sure all
>      * SGIs and PPIs are de-activated.
>      */
> -    writel_relaxed(0xffffffff, GICD_RDIST_SGI_BASE + GICR_ICACTIVER0);
> +    writel_relaxed(0xffffffffU, GICD_RDIST_SGI_BASE + GICR_ICACTIVER0);
>     /*
>      * Disable all PPI interrupts, ensure all SGI interrupts are
>      * enabled.
>      */
> -    writel_relaxed(0xffff0000, GICD_RDIST_SGI_BASE + GICR_ICENABLER0);
> -    writel_relaxed(0x0000ffff, GICD_RDIST_SGI_BASE + GICR_ISENABLER0);
> +    writel_relaxed(0xffff0000U, GICD_RDIST_SGI_BASE + GICR_ICENABLER0);
> +    writel_relaxed(0x0000ffffU, GICD_RDIST_SGI_BASE + GICR_ISENABLER0);
>     /* Configure SGIs/PPIs as non-secure Group-1 */
>     writel_relaxed(GENMASK(31, 0), GICD_RDIST_SGI_BASE + GICR_IGROUPR0);
>=20
> diff --git a/xen/arch/arm/include/asm/arm64/brk.h b/xen/arch/arm/include/=
asm/arm64/brk.h
> index 04442c4b9f..3af153a053 100644
> --- a/xen/arch/arm/include/asm/arm64/brk.h
> +++ b/xen/arch/arm/include/asm/arm64/brk.h
> @@ -21,7 +21,7 @@
>  * BRK instruction encoding
>  * The #imm16 value should be placed at bits[20:5] within BRK ins
>  */
> -#define AARCH64_BREAK_MON 0xd4200000
> +#define AARCH64_BREAK_MON 0xd4200000U
>=20
> /*
>  * BRK instruction for provoking a fault on purpose
> diff --git a/xen/arch/arm/include/asm/arm64/efibind.h b/xen/arch/arm/incl=
ude/asm/arm64/efibind.h
> index 8b43bb8495..0e890b666d 100644
> --- a/xen/arch/arm/include/asm/arm64/efibind.h
> +++ b/xen/arch/arm/include/asm/arm64/efibind.h
> @@ -22,12 +22,12 @@ Revision History
> #pragma pack()
> #endif
>=20
> -#define EFIERR(a)           (0x8000000000000000 | a)
> -#define EFI_ERROR_MASK      0x8000000000000000
> -#define EFIERR_OEM(a)       (0xc000000000000000 | a)
> +#define EFIERR(a)           (0x8000000000000000U | a)
> +#define EFI_ERROR_MASK      0x8000000000000000U
> +#define EFIERR_OEM(a)       (0xc000000000000000U | a)
>=20
> -#define BAD_POINTER         0xFBFBFBFBFBFBFBFB
> -#define MAX_ADDRESS         0xFFFFFFFFFFFFFFFF
> +#define BAD_POINTER         0xFBFBFBFBFBFBFBFBU
> +#define MAX_ADDRESS         0xFFFFFFFFFFFFFFFFU
>=20

Should these be UL? (From EFIERR to MAX_ADDRESS)


> #define EFI_STUB_ERROR      MAX_ADDRESS
>=20
> diff --git a/xen/arch/arm/include/asm/arm64/insn.h b/xen/arch/arm/include=
/asm/arm64/insn.h
> index 4e0d364d41..6308959449 100644
> --- a/xen/arch/arm/include/asm/arm64/insn.h
> +++ b/xen/arch/arm/include/asm/arm64/insn.h
> @@ -60,14 +60,14 @@ static always_inline bool aarch64_insn_is_##abbr(u32 =
code) \
> static always_inline u32 aarch64_insn_get_##abbr##_value(void) \
> { return (val); }
>=20
> -__AARCH64_INSN_FUNCS(b, 0xFC000000, 0x14000000)
> -__AARCH64_INSN_FUNCS(bl, 0xFC000000, 0x94000000)
> -__AARCH64_INSN_FUNCS(cbz, 0x7F000000, 0x34000000)
> -__AARCH64_INSN_FUNCS(cbnz, 0x7F000000, 0x35000000)
> -__AARCH64_INSN_FUNCS(tbz, 0x7F000000, 0x36000000)
> -__AARCH64_INSN_FUNCS(tbnz, 0x7F000000, 0x37000000)
> -__AARCH64_INSN_FUNCS(bcond, 0xFF000010, 0x54000000)
> -__AARCH64_INSN_FUNCS(hint, 0xFFFFF01F, 0xD503201F)
> +__AARCH64_INSN_FUNCS(b, 0xFC000000U, 0x14000000U)
> +__AARCH64_INSN_FUNCS(bl, 0xFC000000U, 0x94000000U)
> +__AARCH64_INSN_FUNCS(cbz, 0x7F000000U, 0x34000000U)
> +__AARCH64_INSN_FUNCS(cbnz, 0x7F000000U, 0x35000000U)
> +__AARCH64_INSN_FUNCS(tbz, 0x7F000000U, 0x36000000U)
> +__AARCH64_INSN_FUNCS(tbnz, 0x7F000000U, 0x37000000U)
> +__AARCH64_INSN_FUNCS(bcond, 0xFF000010U, 0x54000000U)
> +__AARCH64_INSN_FUNCS(hint, 0xFFFFF01FU, 0xD503201FU)
>=20
> bool aarch64_insn_is_branch_imm(u32 insn);
>=20
> diff --git a/xen/arch/arm/include/asm/vreg.h b/xen/arch/arm/include/asm/v=
reg.h
> index bf945eebbd..387ce76e7e 100644
> --- a/xen/arch/arm/include/asm/vreg.h
> +++ b/xen/arch/arm/include/asm/vreg.h
> @@ -56,7 +56,7 @@ static inline bool vreg_emulate_cp64(struct cpu_user_re=
gs *regs, union hsr hsr,
>=20
>     if ( ret && cp64.read )
>     {
> -        set_user_reg(regs, cp64.reg1, x & 0xffffffff);
> +        set_user_reg(regs, cp64.reg1, x & 0xffffffffU);
>         set_user_reg(regs, cp64.reg2, x >> 32);
>     }
>=20
> diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
> index ca5318515e..508c54824d 100644
> --- a/xen/arch/arm/kernel.c
> +++ b/xen/arch/arm/kernel.c
> @@ -39,7 +39,7 @@ struct minimal_dtb_header {
>     /* There are other fields but we don't use them yet. */
> };
>=20
> -#define DTB_MAGIC 0xd00dfeed
> +#define DTB_MAGIC 0xd00dfeedU
>=20
> /**
>  * copy_from_paddr - copy data from a physical address
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index ef5c6a8195..d1ef787638 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -398,7 +398,7 @@ static vaddr_t exception_handler32(vaddr_t offset)
>     register_t sctlr =3D READ_SYSREG(SCTLR_EL1);
>=20
>     if ( sctlr & SCTLR_A32_EL1_V )
> -        return 0xffff0000 + offset;
> +        return 0xffff0000U + offset;
>     else /* always have security exceptions */
>         return READ_SYSREG(VBAR_EL1) + offset;
> }
> @@ -809,7 +809,7 @@ static void show_registers_32(const struct cpu_user_r=
egs *regs,
> #ifdef CONFIG_ARM_64
>                (uint32_t)(ctxt->far >> 32),
>                ctxt->ifsr32_el2,
> -               (uint32_t)(ctxt->far & 0xffffffff),
> +               (uint32_t)(ctxt->far & 0xffffffffU),
>                ctxt->esr_el1
> #else
>                ctxt->ifar, ctxt->ifsr, ctxt->dfar, ctxt->dfsr
> @@ -1414,16 +1414,16 @@ static void do_trap_hypercall(struct cpu_user_reg=
s *regs, register_t *nr,
>     {
>         /* Deliberately corrupt parameter regs used by this hypercall. */
>         switch ( hypercall_args[*nr] ) {
> -        case 5: HYPERCALL_ARG5(regs) =3D 0xDEADBEEF;
> -        case 4: HYPERCALL_ARG4(regs) =3D 0xDEADBEEF;
> -        case 3: HYPERCALL_ARG3(regs) =3D 0xDEADBEEF;
> -        case 2: HYPERCALL_ARG2(regs) =3D 0xDEADBEEF;
> +        case 5: HYPERCALL_ARG5(regs) =3D 0xDEADBEEFU;
> +        case 4: HYPERCALL_ARG4(regs) =3D 0xDEADBEEFU;
> +        case 3: HYPERCALL_ARG3(regs) =3D 0xDEADBEEFU;
> +        case 2: HYPERCALL_ARG2(regs) =3D 0xDEADBEEFU;
>         case 1: /* Don't clobber x0/r0 -- it's the return value */
>         case 0: /* -ENOSYS case */
>             break;
>         default: BUG();
>         }
> -        *nr =3D 0xDEADBEEF;
> +        *nr =3D 0xDEADBEEFU;
>     }
> #endif
>=20
> diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
> index 0b083c33e6..35363fee09 100644
> --- a/xen/arch/arm/vgic-v2.c
> +++ b/xen/arch/arm/vgic-v2.c
> @@ -306,7 +306,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mm=
io_info_t *info,
>     case VREG32(GICD_SGIR):
>         if ( dabt.size !=3D DABT_WORD ) goto bad_width;
>         /* Write only -- read unknown */
> -        *r =3D 0xdeadbeef;
> +        *r =3D 0xdeadbeefU;
>         return 1;
>=20
>     case VRANGE32(0xF04, 0xF0C):
> diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
> index 9c1fdcc3f8..f3e9eb2f92 100644
> --- a/xen/arch/arm/vgic-v3.c
> +++ b/xen/arch/arm/vgic-v3.c
> @@ -354,7 +354,7 @@ read_reserved:
>     return 1;
>=20
> read_unknown:
> -    *r =3D vreg_reg64_extract(0xdeadbeafdeadbeaf, info);
> +    *r =3D vreg_reg64_extract(0xdeadbeafdeadbeafU, info);

Should this be UL?


>     return 1;
> }
>=20
> diff --git a/xen/include/public/arch-arm/smccc.h b/xen/include/public/arc=
h-arm/smccc.h
> index 802d800aad..8553f2f39e 100644
> --- a/xen/include/public/arch-arm/smccc.h
> +++ b/xen/include/public/arch-arm/smccc.h
> @@ -26,16 +26,16 @@
> #define XEN_SMCCC_MINOR_REVISION 1
>=20
> /* Hypervisor Service UID. Randomly generated with uuidgen. */
> -#define XEN_SMCCC_UID XEN_DEFINE_UUID(0xa71812dc, 0xc698, 0x4369, 0x9acf=
, \
> -                                      0x79, 0xd1, 0x8d, 0xde, 0xe6, 0x67=
)
> +#define XEN_SMCCC_UID XEN_DEFINE_UUID(0xa71812dcU, 0xc698U, 0x4369U, 0x9=
acfU, \
> +                                      0x79U, 0xd1U, 0x8dU, 0xdeU, 0xe6U,=
 0x67U)
>=20
> /* Standard Service Service Call version. */
> #define SSSC_SMCCC_MAJOR_REVISION 0
> #define SSSC_SMCCC_MINOR_REVISION 1
>=20
> /* Standard Service Call UID. Randomly generated with uuidgen. */
> -#define SSSC_SMCCC_UID XEN_DEFINE_UUID(0xf863386f, 0x4b39, 0x4cbd, 0x922=
0,\
> -                                       0xce, 0x16, 0x41, 0xe5, 0x9f, 0x6=
f)
> +#define SSSC_SMCCC_UID XEN_DEFINE_UUID(0xf863386fU, 0x4b39U, 0x4cbdU, 0x=
9220U,\
> +                                       0xceU, 0x16U, 0x41U, 0xe5U, 0x9fU=
, 0x6fU)
>=20
> #endif /* __XEN_PUBLIC_ARCH_ARM_SMCCC_H__ */
>=20
> --=20
> 2.41.0
>=20
>=20



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 16:28:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 16:28:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559426.874395 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5M7-0002nA-5t; Wed, 05 Jul 2023 16:27:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559426.874395; Wed, 05 Jul 2023 16:27:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5M7-0002n3-28; Wed, 05 Jul 2023 16:27:51 +0000
Received: by outflank-mailman (input) for mailman id 559426;
 Wed, 05 Jul 2023 16:27:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gl5h=CX=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qH5M5-0002mx-U7
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 16:27:50 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on20630.outbound.protection.outlook.com
 [2a01:111:f400:7e89::630])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e06593eb-1b50-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 18:27:48 +0200 (CEST)
Received: from SN6PR12MB2621.namprd12.prod.outlook.com (2603:10b6:805:73::15)
 by SJ2PR12MB8652.namprd12.prod.outlook.com (2603:10b6:a03:53a::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 16:27:44 +0000
Received: from SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54]) by SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54%2]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 16:27:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e06593eb-1b50-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=HDB+52/djLom5DrtcEKV/WpVFlvpAJLBkBTcf2McfnwxfVV3Xa0cl3rOF41bWy/FzkimEQcX4Pz6n+f9mP+YxlZsToYoZFaUCs+pxaGFTzcgkbqdX/GCIYdg2e4WgRGoZ4zq9qJ67lNn/6BP+UE8T2HUfG6Kd3Ka+/Tn0rN85zcBhuV2788oVJ7Agsy5HDJ7skLxDx7/COtmnMvQOB7aISwoU0+jJk+1WrX6DE2gYKH0M3JJg8s33AAzH9E6M8ZsTa0oQNXDuBdB58qGHFqCW9HxqQCdva/C3uEq8kxCuEBYVpVNgsuEFFqrry+3SMzsUqgE1loe6azAI7bjVvkfhw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=9vrpqg61jSmVONtw1lmX8Dqjztw4DVbBAsbJXAywOIw=;
 b=Yxt0PQWRhwM/txL0aJrmD9Wl+yYyqRaZu7ROHDSa9uh7gp3dV2YKTyXOEaO3ZbVDuGYH7SA9tTDBJCSFMXMhY2A8mucLBwkdXqvCbgFIM1r4ZbV8UMnavhOUz6PnJyLl4H1Jjnupv2Oxe89dUOYdD6955cXtF4M/pNUb+Aaz0YfLEPc9WVSX7IPePmmyejLlpHneBlMoR1y9k01lIHwaq+NP1Hd6tz1rCVcXp7zSqQzwy6BOFsI/J5frr3xPIs0cMBS79OFDMDUSLEXP6gtbXN9h7P6bmFd1HHBSwp0qE88Jh6PWt+bgdl9M039Pm01ypqT522oX6JdNUJLpnwzRdw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=9vrpqg61jSmVONtw1lmX8Dqjztw4DVbBAsbJXAywOIw=;
 b=BGNehqwAQCrJDrVFUh26lmOHWnXdypsXFc2JVHr64bruX6vELvYulKbes8kx6sEqFnEe6u/+W+h37JzGLlLkQdY66rE4RNWX5HJzSOC8LxNIHNVvIC0uEb/CNFWPywH1b92nhOMZGC+f523J2zZW4sPZylMlHjZ00J72sluteZk=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <09bbbd4f-08fb-9159-5ff9-16389b4c46d5@amd.com>
Date: Wed, 5 Jul 2023 17:27:37 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 45/52] xen/mpu: insert an new entry into guest physmap
 in MPU system
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-46-Penny.Zheng@arm.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <20230626033443.2943270-46-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P265CA0184.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:311::10) To SN6PR12MB2621.namprd12.prod.outlook.com
 (2603:10b6:805:73::15)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN6PR12MB2621:EE_|SJ2PR12MB8652:EE_
X-MS-Office365-Filtering-Correlation-Id: bc8c5c5a-6350-4f15-a731-08db7d74c29a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	aOReQf4wu9OXczFMjuGoJuu1i0nHQEDbozxhdDuLHGXgnKGXfqrTwzH/wpalz3YnGqEojyAOf6wKdxA/h5bTbMFuji9eDsYkRgxrSftSpk2Odn+Ma1oE+vjW/FHQpCcEYBSPmd7H3GIrr+sVaR/+vTR7w5ByySr0zWd0a4s/cKl3kWeQQt8CnsJ/RlKg0mKfp54gTtcE3npii2cINAa6NLNDDFkoKbGEQLgTtWH+ci83EUdAx8VXMyYMbqurWgv2fTNrvR8lODfucKeXtFcczhnvUAfb3/cnxTDwU+Jgu5vAxJkywG6hMcuDn0nShsZwwFucoVOixKXpb8fJtx4Ar6zsOOqKUQ7NdObx/bllnbNkWOwem45cFsk2BKB9SS2DmwQxQ+RXQv/1Any2fGj65tIcVOiwm8yNaGEmcEFPqoK2kvr/chigwh8TWZKEaFOTllFOilmxZJrjRt+4DVmoMO8lyKsNkIadkC/aYxtPLzp/rxazgMp/TE7ckBfyUTJsBcCHTQggZ8wdFOGqOWZ2jK7k9/Cqqv97icYpBSvElr2vIN7KYqU6bCQTyPDe0Zvt3aTRZRnb00NBIYxcBgczldJerntf7/nHjaob4hXgN8Vys1QS+3fYSbJds9a7OPRii7K9ZpFxJfEmPshHuTMm6Q==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2621.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(376002)(346002)(366004)(39860400002)(451199021)(26005)(31686004)(66556008)(66946007)(36756003)(66476007)(4326008)(316002)(478600001)(8676002)(8936002)(5660300002)(2906002)(54906003)(41300700001)(6486002)(6512007)(31696002)(38100700002)(6666004)(83380400001)(6506007)(186003)(53546011)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SFNQZFpUaGV6aWNsL3RQc2JCN3FoZHB1em0zQzkxZGFZTFpzWUt2c3NoSllN?=
 =?utf-8?B?Q0M5d3hKMXVKZ1d6NDh0RkdldFNhbFV2dDk2aVJPdU8wM0xHaWRrVU84ak5X?=
 =?utf-8?B?K0VTN3FIN3YrRGpkMWtTTnFKWlJxYWlQVGJnekZBbjBqeE11RHFnMUZuMkhQ?=
 =?utf-8?B?MjFudEduMHJydDNidjRFN3lEdVlJV2RRSktEakNnRmdtU3kraGc0bEdJK0sx?=
 =?utf-8?B?dm8vY2MyeWpEYlNiYmVxckhhTk9x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swV29KNXpWd0dGOUZPMnYrNlFJQkhTMzVnR040WWky?=
 =?utf-8?B?NkNoU2JJOWxSb1NXUTJHbFkvMVpTMmZEUFdsU1AxWHcwZmtSekRCejlUQisy?=
 =?utf-8?Q?a9lqfU1FizX59be9RXgqyFBuW?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bc8c5c5a-6350-4f15-a731-08db7d74c29a
X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2621.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 16:27:43.8710
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Bec8LmMVCE4ehEPVQ6774KmRRhlbc4rv0p4HYYt+AVXJm5B09h98AHYMAo2OXGx397E3J+/TBODZeYZDXyKwLw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8652


On 26/06/2023 04:34, Penny Zheng wrote:
> CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
>
>
> Function p2m_set_entry/__p2m_set_entry is responsible for inserting an entry
> in the p2m. In MPU system, it includes the following steps:
> - checking whether mapping already exists(sgfn -> mfn)
> - constituting a new P2M MPU memory region structure(pr_t) through
> standard entry region_to_p2m_entry()
> - insert the new entry into domain P2M table(p2m->root)
>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> ---
> v3:
> - new commit
> ---
>   xen/arch/arm/include/asm/arm64/mpu.h |   3 +-
>   xen/arch/arm/include/asm/mpu/mm.h    |   6 +
>   xen/arch/arm/include/asm/p2m.h       |   3 +
>   xen/arch/arm/mpu/mm.c                |   4 +-
>   xen/arch/arm/mpu/p2m.c               | 172 +++++++++++++++++++++++++++
>   5 files changed, 185 insertions(+), 3 deletions(-)
>
> diff --git a/xen/arch/arm/include/asm/arm64/mpu.h b/xen/arch/arm/include/asm/arm64/mpu.h
> index c5e69f239a..444ca716b8 100644
> --- a/xen/arch/arm/include/asm/arm64/mpu.h
> +++ b/xen/arch/arm/include/asm/arm64/mpu.h
> @@ -61,7 +61,8 @@ typedef union {
>           unsigned long ap:2;       /* Acess Permission */
>           unsigned long sh:2;       /* Sharebility */
>           unsigned long base:42;    /* Base Address */
> -        unsigned long pad:16;
> +        unsigned long pad:12;
> +        unsigned long p2m_type:4; /* Ignore by hardware. Used to store p2m types.*/

This will change based on the outcome of " [PATCH v3 31/52] xen/mpu: 
make early_fdt_map support in MPU systems".

Anyhow, we can't use RES0 bits for software purposes.

- Ayan

>       } reg;
>       uint64_t bits;
>   } prbar_t;
> diff --git a/xen/arch/arm/include/asm/mpu/mm.h b/xen/arch/arm/include/asm/mpu/mm.h
> index 4df69245c6..0abb0a6c92 100644
> --- a/xen/arch/arm/include/asm/mpu/mm.h
> +++ b/xen/arch/arm/include/asm/mpu/mm.h
> @@ -14,6 +14,12 @@ extern void *map_mm_range(paddr_t pa, size_t len, unsigned int attributes);
>   extern void unmap_mm_range(paddr_t pa);
>   extern bool is_mm_range_mapped_transient(paddr_t pa, paddr_t len);
>   extern pr_t *alloc_mpumap(void);
> +#define MPUMAP_REGION_FAILED    0
> +#define MPUMAP_REGION_FOUND     1
> +#define MPUMAP_REGION_INCLUSIVE 2
> +#define MPUMAP_REGION_OVERLAP   3
> +extern int mpumap_contain_region(pr_t *table, uint8_t nr_regions,
> +                                 paddr_t base, paddr_t limit, uint8_t *index);
>
>   #endif /* __ARCH_ARM_MM_MPU__ */
>
> diff --git a/xen/arch/arm/include/asm/p2m.h b/xen/arch/arm/include/asm/p2m.h
> index c3598d514e..68837b6df7 100644
> --- a/xen/arch/arm/include/asm/p2m.h
> +++ b/xen/arch/arm/include/asm/p2m.h
> @@ -67,6 +67,9 @@ struct p2m_domain {
>   #else
>       /* Current Virtualization System Control Register for the p2m */
>       uint64_t vsctlr;
> +
> +    /* Number of MPU memory regions in P2M MPU memory mapping table. */
> +    uint8_t nr_regions;
>   #endif
>
>       /* Highest guest frame that's ever been mapped in the p2m */
> diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
> index de5da96b80..8cdb7d7219 100644
> --- a/xen/arch/arm/mpu/mm.c
> +++ b/xen/arch/arm/mpu/mm.c
> @@ -378,8 +378,8 @@ out:
>    *  MPUMAP_REGION_INCLUSIVE: find an inclusive match in #table
>    *  MPUMAP_REGION_OVERLAP: overlap with the existing mapping
>    */
> -static int mpumap_contain_region(pr_t *table, uint8_t nr_regions,
> -                                 paddr_t base, paddr_t limit, uint8_t *index)
> +int mpumap_contain_region(pr_t *table, uint8_t nr_regions,
> +                          paddr_t base, paddr_t limit, uint8_t *index)
>   {
>       uint8_t i = 0, _index = INVALID_REGION_IDX;
>
> diff --git a/xen/arch/arm/mpu/p2m.c b/xen/arch/arm/mpu/p2m.c
> index 8f728f8957..4838d5b625 100644
> --- a/xen/arch/arm/mpu/p2m.c
> +++ b/xen/arch/arm/mpu/p2m.c
> @@ -166,6 +166,178 @@ int p2m_init(struct domain *d)
>       return rc;
>   }
>
> +static void p2m_set_permission(pr_t *region, p2m_type_t t)
> +{
> +    switch ( t )
> +    {
> +    case p2m_ram_rw:
> +        region->prbar.reg.xn = XN_DISABLED;
> +        region->prbar.reg.ap = AP_RW_ALL;
> +        break;
> +
> +    case p2m_ram_ro:
> +        region->prbar.reg.xn = XN_DISABLED;
> +        region->prbar.reg.ap = AP_RO_ALL;
> +        break;
> +
> +    case p2m_invalid:
> +        region->prbar.reg.xn = XN_P2M_ENABLED;
> +        region->prbar.reg.ap = AP_RO_ALL;
> +        break;
> +
> +    case p2m_max_real_type:
> +        BUG();
> +        break;
> +
> +    case p2m_mmio_direct_dev:
> +    case p2m_mmio_direct_nc:
> +    case p2m_mmio_direct_c:
> +    case p2m_iommu_map_ro:
> +    case p2m_iommu_map_rw:
> +    case p2m_map_foreign_ro:
> +    case p2m_map_foreign_rw:
> +    case p2m_grant_map_ro:
> +    case p2m_grant_map_rw:
> +        panic(XENLOG_G_ERR "p2m: UNIMPLEMENTED p2m permission in MPU system\n");
> +        break;
> +    }
> +}
> +
> +static inline pr_t region_to_p2m_entry(mfn_t smfn, unsigned long nr_mfn,
> +                                       p2m_type_t t)
> +{
> +    prbar_t prbar;
> +    prlar_t prlar;
> +    pr_t region;
> +
> +    prbar = (prbar_t) {
> +        .reg = {
> +            .p2m_type = t,  /* P2M Type */
> +        }};
> +
> +    prlar = (prlar_t) {
> +        .reg = {
> +            .ns = 0,        /* Hyp mode is in secure world */
> +            .en = 1,        /* Region enabled */
> +        }};
> +
> +    BUILD_BUG_ON(p2m_max_real_type > (1 << 4));
> +
> +    switch ( t )
> +    {
> +    case p2m_invalid:
> +    case p2m_ram_rw:
> +    case p2m_ram_ro:
> +    case p2m_max_real_type:
> +        prbar.reg.sh = LPAE_SH_INNER;
> +        prlar.reg.ai = MT_NORMAL;
> +        break;
> +
> +    default:
> +        panic(XENLOG_G_ERR "p2m: UNIMPLEMENTED p2m type in MPU system\n");
> +        break;
> +    }
> +
> +    region = (pr_t) {
> +        .prbar = prbar,
> +        .prlar = prlar,
> +    };
> +
> +    /*
> +     * xn and ap bit will be defined in the p2m_set_permission
> +     * based on t.
> +     */
> +    p2m_set_permission(&region, t);
> +
> +    /* Set base address and limit address */
> +    pr_set_base(&region, mfn_to_maddr(smfn));
> +    pr_set_limit(&region, (mfn_to_maddr(mfn_add(smfn, nr_mfn)) - 1));
> +
> +    return region;
> +}
> +
> +/*
> + * Check whether guest memory [sgfn, sgfn + nr_gfns) is mapped.
> + *
> + * If it is mapped, the index of associated MPU memory region will be filled
> + * up, and 0 is returned.
> + * If it is not mapped, -ENOENT errno will be returned.
> + */
> +static int is_gfns_mapped(struct p2m_domain *p2m, gfn_t sgfn,
> +                          unsigned long nr_gfns, uint8_t *idx)
> +{
> +    paddr_t gbase = gfn_to_gaddr(sgfn),
> +            glimit = gfn_to_gaddr(gfn_add(sgfn, nr_gfns)) - 1;
> +    int rc;
> +    pr_t *table;
> +
> +    table = (pr_t *)page_to_virt(p2m->root);
> +    if ( !table )
> +        return -EEXIST;
> +
> +    rc = mpumap_contain_region(table, p2m->nr_regions, gbase, glimit, idx);
> +    if ( (rc == MPUMAP_REGION_FOUND) || (rc == MPUMAP_REGION_INCLUSIVE) )
> +        return 0;
> +    else if ( rc == MPUMAP_REGION_FAILED )
> +        return -ENOENT;
> +
> +    /* Partially mapped */
> +    return -EINVAL;
> +}
> +
> +int __p2m_set_entry(struct p2m_domain *p2m, gfn_t sgfn, unsigned int nr,
> +                    mfn_t smfn, p2m_type_t t, p2m_access_t a)
> +{
> +    pr_t *table;
> +    mfn_t emfn = mfn_add(smfn, nr);
> +    uint8_t idx = INVALID_REGION_IDX;
> +
> +    /*
> +     * Other than removing mapping (i.e MFN_INVALID),
> +     * gfn == mfn in MPU system.
> +     */
> +    if ( !mfn_eq(smfn, INVALID_MFN) )
> +        if ( gfn_x(sgfn) != mfn_x(smfn) )
> +        {
> +            printk(XENLOG_G_ERR "Unable to map MFN %#"PRI_mfn" at %#"PRI_mfn"\n",
> +                   mfn_x(smfn), gfn_x(sgfn));
> +            return -EINVAL;
> +        }
> +
> +    if ( is_gfns_mapped(p2m, sgfn, nr, &idx) != -ENOENT )
> +    {
> +        printk(XENLOG_G_ERR "p2m: unable to insert P2M MPU memory region 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
> +               gfn_to_gaddr(sgfn), gfn_to_gaddr(gfn_add(sgfn, nr)));
> +        return -EINVAL;
> +    }
> +
> +    table = (pr_t *)page_to_virt(p2m->root);
> +    if ( !table )
> +        return -EEXIST;
> +    table[p2m->nr_regions] = region_to_p2m_entry(smfn, nr, t);
> +    p2m->nr_regions++;
> +
> +    p2m->max_mapped_gfn = gfn_max(p2m->max_mapped_gfn, _gfn(mfn_x(emfn)));
> +    p2m->lowest_mapped_gfn = gfn_min(p2m->lowest_mapped_gfn, _gfn(mfn_x(smfn)));
> +
> +    return 0;
> +}
> +
> +int p2m_set_entry(struct p2m_domain *p2m, gfn_t sgfn, unsigned long nr,
> +                  mfn_t smfn, p2m_type_t t, p2m_access_t a)
> +{
> +    /*
> +     * Any reference taken by the P2M mappings (e.g. foreign mapping) will
> +     * be dropped in relinquish_p2m_mapping(). As the P2M will still
> +     * be accessible after, we need to prevent mapping to be added when the
> +     * domain is dying.
> +     */
> +    if ( unlikely(p2m->domain->is_dying) )
> +        return -ENOMEM;
> +
> +    return __p2m_set_entry(p2m, sgfn, nr, smfn, t, a);
> +}
> +
>   /*
>    * Local variables:
>    * mode: C
> --
> 2.25.1
>
>


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 16:29:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 16:29:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559436.874414 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5NQ-0003vj-Ps; Wed, 05 Jul 2023 16:29:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559436.874414; Wed, 05 Jul 2023 16:29:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5NQ-0003vc-N3; Wed, 05 Jul 2023 16:29:12 +0000
Received: by outflank-mailman (input) for mailman id 559436;
 Wed, 05 Jul 2023 16:29:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jUcB=CX=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qH5NP-0003vW-N7
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 16:29:11 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20612.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::612])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1209abc6-1b51-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 18:29:10 +0200 (CEST)
Received: from AS9PR06CA0417.eurprd06.prod.outlook.com (2603:10a6:20b:461::21)
 by DU0PR08MB8811.eurprd08.prod.outlook.com (2603:10a6:10:478::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 16:29:08 +0000
Received: from AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:461:cafe::1e) by AS9PR06CA0417.outlook.office365.com
 (2603:10a6:20b:461::21) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 16:29:08 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT022.mail.protection.outlook.com (100.127.140.217) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.24 via Frontend Transport; Wed, 5 Jul 2023 16:29:07 +0000
Received: ("Tessian outbound c63645f235c1:v142");
 Wed, 05 Jul 2023 16:29:07 +0000
Received: from 4d94515c619c.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 312E5DF7-CC26-4C5B-88EF-39B01728B762.1; 
 Wed, 05 Jul 2023 16:28:59 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4d94515c619c.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 16:28:59 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by AS8PR08MB6469.eurprd08.prod.outlook.com (2603:10a6:20b:33c::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 16:28:55 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::3861:64c:eb82:afa1]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::3861:64c:eb82:afa1%4]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023
 16:28:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1209abc6-1b51-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QzzK/XhWGOrk8HnjhJkj84yrN41q/XYrrsoE2vG07Tg=;
 b=lZPSkFlXDAbZxlyKDQxIArMFuSp2NJ4Rzb7b/Hfv2J6B5tWs5EuAckP9nCLd5a5b9Q14IXj65hoA9xHTTdOU4EW3jmybUsice4A+ttEqfFc3R4D/kDhk+rd9UZy/O6WoMM1c9JUJLsdyjwV6DGN19OP2HO1V9Viy9JXw3DG3ioM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 750f814f1cda6cef
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=muJWuD8CyC3HZNOXpSa2go82nU+ej+0FcMU8oiAQxmGWZXooB2nN7aBvAFt8tBOjmgl8RRxm+hr17wVX6JBmYAr04D/nypoe1UcCQWJzbzxuWEIy5vU10m80HuyJ6nUoqrKso6JrdtVC/3CAiWCBt73uMEbYSskdCeB5DcgQZtopxJArw5th/lW/N5RFMbUnVbNRIK+O3aMYRem98HhPHSpLnma54q5Yh6P+fy6O+2cNKBjQ1eRMia0vEdy23zQYUIPmM5J2WctAk2POVILoirjR6LGZycJ5ioQMCKiPe6x3lVDF9OmblFnLOP1IUCDgBCzn6csUO4rq7MyEZSt0fA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=QzzK/XhWGOrk8HnjhJkj84yrN41q/XYrrsoE2vG07Tg=;
 b=PIGcKOG6fWHc4JcvZ6WgPHQW2bipPVA+D18zQ6Eupm4tOGNZNGHvXudtdOBNyto8PdRd1KgAQTYQC3TWqPoE3fsTs5x1JJS0ZmuRVaxtp7AZgcTtLU4a2XftzRyXhJG8glrC/dQ9d0oGqDVb4zqV7Zx81UXGp0FYKioFX/OspzQad9OcEkm/GkHeTd0NL9TX5cqV6zJVA4fv1JLgn1AqaqIzZSjIYSID4wMy39llR3wR8ou4bw9GZJMa2SWTY9FmQU9QB4dFhUYgGkvfJnYU9VdjDj+FF/MPHsIVULyRkeD6tEvN9haboYM76TbNPkyjUcVsJsrgcNztPmwPm1XO+g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QzzK/XhWGOrk8HnjhJkj84yrN41q/XYrrsoE2vG07Tg=;
 b=lZPSkFlXDAbZxlyKDQxIArMFuSp2NJ4Rzb7b/Hfv2J6B5tWs5EuAckP9nCLd5a5b9Q14IXj65hoA9xHTTdOU4EW3jmybUsice4A+ttEqfFc3R4D/kDhk+rd9UZy/O6WoMM1c9JUJLsdyjwV6DGN19OP2HO1V9Viy9JXw3DG3ioM=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Simone Ballarin <simone.ballarin@bugseng.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, "consulting@bugseng.com"
	<consulting@bugseng.com>, Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
	Michal Orzel <michal.orzel@amd.com>, Xenia Ragiadakou
	<Xenia.Ragiadakou@amd.com>, Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH v2 05/13] xen/device-tree: fix violations of MISRA
 C:2012 Rule 7.2
Thread-Topic: [XEN PATCH v2 05/13] xen/device-tree: fix violations of MISRA
 C:2012 Rule 7.2
Thread-Index: AQHZr1U/ZRs2G60btUij4+Ecgr80f6+rXN6A
Date: Wed, 5 Jul 2023 16:28:55 +0000
Message-ID: <A5B858FA-8737-47B6-A230-38C2E0E56179@arm.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <da656a93e42e5d04e02f62002b1f5ab357c8c16a.1688559115.git.gianluca.luparini@bugseng.com>
In-Reply-To:
 <da656a93e42e5d04e02f62002b1f5ab357c8c16a.1688559115.git.gianluca.luparini@bugseng.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|AS8PR08MB6469:EE_|AM7EUR03FT022:EE_|DU0PR08MB8811:EE_
X-MS-Office365-Filtering-Correlation-Id: 7793d5f4-d685-44c4-509c-08db7d74f49b
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 i3Uzf10QVqxfLrQv64bt5DeAcAa04w1/L4TZ4knXiR/oqZtsv9vW7GMnLdppLlAFC2MQgXFQfxhERp97dUTM34cKcNZuQi3tVoKjR1rhMth+joW6wD7RDSnS+J7b/ILiQjZktNtidkItDHYAMtZjHFZcdNof4yQJDUHuWtIRZoQZRxl9g+hC24VdoLeYEAH26Vnn/khZG1TFNgxNba61Z/jyKBdNaohoH+7eQi78ZmphSI6CpuPz2WURx2sVhY3CK9WQ2PExcmtiU7nb1Le31AZSW0Q5Vt7fqdQe5Me8i3ooutJupvRpklPWJe5cPmASU/tV2XUT3Q7yDnpna8BxgFDumacPirKOteNczNAPQ762i7v0IVztEtVFu6WAFqcoX9mVT538+AuL2NChlVLN1tRJB/HxOxvfWCItEQLr9KOcN31CTCJjx3UrgtK3e+U5f/oesAVSFaNEelnnuOS5oXQhaeioT4ZxysfFNNz3V8wA1KiPoV/mayvFhg0u1BDPe9LbJyjIiq9+dEZ5cpp0n4tFa/XzOz39Mxg0gYWkSlPtONCKV0Dxl9x6eL/LoTsH2MM98VomhOj4aajzkVavgZ/Gjfv0wpvQOliWOEl1ca1Qn7k4RMgCvpY1SfZWikoZEQS7N1GQjIFqFl1S/XbrVQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(366004)(39860400002)(396003)(346002)(376002)(451199021)(2616005)(4326008)(76116006)(66946007)(91956017)(38100700002)(66446008)(66476007)(64756008)(66556008)(6916009)(122000001)(186003)(86362001)(478600001)(36756003)(38070700005)(6486002)(33656002)(71200400001)(6512007)(26005)(53546011)(6506007)(8676002)(8936002)(54906003)(5660300002)(2906002)(41300700001)(316002)(83380400001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <A463C0DE1EB3C6428104F395D80B5F03@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6469
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	baaaf976-7a43-4445-6ece-08db7d74ed70
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	hvU8vBiUouUD50akTMfPeXvvaxg4kSDiV50Cwjptcn4pWihbOQk74aVrT/lBgiEkrTGQsfH5OHPeCwP680IO+BjbBt01EUa7NgACWLhMqdO7w5GLYWPDRZzwQNoYfkDteRZNYz0NYZa7xOf307/XtO4PzEF8/FfkcqX4i5IPeOekhvEObl+7AskzqR2yNmYWqzkG0u7eXbeTKAgGAmSpjCSboSz5PaLpzoGeAE5HusMhkOwChUj8equB//lh428ghKM6KocX0GiTifx5jTRRhtqrg3FrsBt7Fn0Hp+63+2ggN27Kk7vMCuaGkgg9VOpCT8qe78omhK3O/Lrs5oK21YyiNwODMCwgOEWvlv2gLdVAdfMEd59Vk2zSYerNeEFj5czsuC27zaxNe4qNUJw5HU4EGoIeIwVZU7WAMVOJB3CbQuBjpMtMFT75q9BlLy25/AE/muG5M2SJUsdvwK+bYjm3QKnnX1qp2CHaW+v5YsIbTEOJERHFcGYtSuT8FJ437HF0/mRpn3osbaYDiIrXLOESULON8Pkh8HI425QOk3pxlfMkWmW3NGlgfoqEnYWHQIRvF8n3D8KM93vN8YaYMhrutwxZdWM3/hZCBZ2344iRZwa4WpJbxXbxTaCu8AJBA51gcAm8Yy3mC7QdqCL88HbfowL/xq05U75EURFwpR9ZwdQXrFYiKSq1CDI4OhoEX4KZZ6fRvFdUAtAwmare2vLLfjb10ZTPiZUdKMypmv+xcCrqVK1LXOKTzWuWioN/
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(346002)(396003)(136003)(451199021)(40470700004)(46966006)(36840700001)(336012)(40460700003)(41300700001)(86362001)(6486002)(82310400005)(53546011)(47076005)(83380400001)(82740400003)(356005)(81166007)(6506007)(2616005)(26005)(36860700001)(6512007)(40480700001)(54906003)(478600001)(316002)(36756003)(4326008)(70206006)(70586007)(33656002)(8936002)(8676002)(186003)(6862004)(2906002)(5660300002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 16:29:07.5929
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 7793d5f4-d685-44c4-509c-08db7d74f49b
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8811



> On 5 Jul 2023, at 16:26, Simone Ballarin <simone.ballarin@bugseng.com> wr=
ote:
>=20
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
>=20
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
>=20
> Add the 'U' suffix to integers literals with unsigned type and also to ot=
her
> literals used in the same contexts or near violations, when their positiv=
e
> nature is immediately clear. The latter changes are done for the sake of
> uniformity.
>=20
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>

Looks good to me

Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>

> ---
> Changes in v2:
> - change commit title to the right one
> - change commit message
> - change maintainers in Cc
> - remove changes in 'libfdt'
> ---
> xen/common/device_tree.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>=20
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 8da1052911..0677193ab3 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -2115,7 +2115,7 @@ static void __init __unflatten_device_tree(const vo=
id *fdt,
>     /* Allocate memory for the expanded device tree */
>     mem =3D (unsigned long)_xmalloc (size + 4, __alignof__(struct dt_devi=
ce_node));
>=20
> -    ((__be32 *)mem)[size / 4] =3D cpu_to_be32(0xdeadbeef);
> +    ((__be32 *)mem)[size / 4] =3D cpu_to_be32(0xdeadbeefU);
>=20
>     dt_dprintk("  unflattening %lx...\n", mem);
>=20
> @@ -2125,7 +2125,7 @@ static void __init __unflatten_device_tree(const vo=
id *fdt,
>     if ( be32_to_cpup((__be32 *)start) !=3D FDT_END )
>         printk(XENLOG_WARNING "Weird tag at end of tree: %08x\n",
>                   *((u32 *)start));
> -    if ( be32_to_cpu(((__be32 *)mem)[size / 4]) !=3D 0xdeadbeef )
> +    if ( be32_to_cpu(((__be32 *)mem)[size / 4]) !=3D 0xdeadbeefU )
>         printk(XENLOG_WARNING "End of tree marker overwritten: %08x\n",
>                   be32_to_cpu(((__be32 *)mem)[size / 4]));
>     *allnextp =3D NULL;
> --=20
> 2.41.0
>=20
>=20



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 16:34:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 16:34:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559442.874425 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5SZ-0005Tv-Ge; Wed, 05 Jul 2023 16:34:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559442.874425; Wed, 05 Jul 2023 16:34:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5SZ-0005To-Dw; Wed, 05 Jul 2023 16:34:31 +0000
Received: by outflank-mailman (input) for mailman id 559442;
 Wed, 05 Jul 2023 16:34:30 +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
 <SRS0=jUcB=CX=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qH5SY-0005Ti-Li
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 16:34:30 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on0601.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::601])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ce2fa6ff-1b51-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 18:34:27 +0200 (CEST)
Received: from DUZPR01CA0081.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:46a::6) by GV1PR08MB8689.eurprd08.prod.outlook.com
 (2603:10a6:150:82::8) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 16:34:23 +0000
Received: from DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:46a:cafe::fa) by DUZPR01CA0081.outlook.office365.com
 (2603:10a6:10:46a::6) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.30 via Frontend
 Transport; Wed, 5 Jul 2023 16:34:23 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT013.mail.protection.outlook.com (100.127.142.222) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.23 via Frontend Transport; Wed, 5 Jul 2023 16:34:23 +0000
Received: ("Tessian outbound e2424c13b707:v142");
 Wed, 05 Jul 2023 16:34:23 +0000
Received: from 3762e53d0410.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 4111EE69-1B58-49B4-B6BB-9D099061A873.1; 
 Wed, 05 Jul 2023 16:34:15 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3762e53d0410.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 16:34:15 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by DB9PR08MB9804.eurprd08.prod.outlook.com (2603:10a6:10:45f::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 16:34:14 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::3861:64c:eb82:afa1]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::3861:64c:eb82:afa1%4]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023
 16:34:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ce2fa6ff-1b51-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=X6DZn+acH4T7vQpD2hCMzs9pM95ym7skUiR8tWqfbaU=;
 b=QkP7ZMpdFy+9cP5JVXocl77gdRYOI9aMVZTjaaLHiKC4NhrY/T+ef/F0jWpwWBfzxaBdevOQZso+1ijRvBPThPaYOROQfHjlOujuc1POQBtxuYeeTRhhnuYHS4Db/piPDzex6otMwbr3KKRkDVLqi7lrNyGTf4WBMdyPFF9Fvzs=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 7f094d9fdea62c1e
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Huvhd64kMHxuPrzbHUhH0qpGiL1EW1ZEwABaE79BdkxHKaeSbSWlF59Auwdt0Ir2+TplbMDHfUNIZCZxpkUasooPe821nG1og6HzqmDveyHJQ37dzG4IRgiAVj0pMnsrUhn6PMavE2CjL68NEa8YGjpDuuxj/GsTIY9imozw1vAx1KtfrN2vxczZ7Jpl/bOm2jxGfG1hMRQDadqC4bPJnxrtybVnwWRl/5xTZK6ho1Z0A3iOww9uxGN+FdehhP3fQNkxRbVIhLOcCLezExSrTtUiBepYmcdPDpj5PRS4d3jDbAJuLkfTQxxomm2WuMix7w2u/1RyGnzOSjSjSMH3mQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=X6DZn+acH4T7vQpD2hCMzs9pM95ym7skUiR8tWqfbaU=;
 b=f+pOJhm4/8Uh4+TzrQOgtZ+dsuvFwXeJlfj6QCmqVrWjlvxixTseo07R6SAmulDy/2IEhtcnNKMTbwswr1jntrLCpa1Uvv67OaJmUyjiNWKrR/e2a9YXgg3dO0Qc9jo6QRAGxpomMVL9/MFgC3FNFrucyez5FpNiwVoZrGQS6NPAFkO8GKEbpt62+UgLMhNGjOg6twwQCfW+PGAJMRkFD1QN2nVcZ+yxgyo4yWlKsjiSc7B+BCk4hhmFYfFGg9Z8KUBHaznTa7IzerSZAqkwAiqZcCBDbtMnXrEe/rHQLvd+G6tIV5LzMAGyT6LJbHHK51A2GHybm+GxL6wUbVJcfQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=X6DZn+acH4T7vQpD2hCMzs9pM95ym7skUiR8tWqfbaU=;
 b=QkP7ZMpdFy+9cP5JVXocl77gdRYOI9aMVZTjaaLHiKC4NhrY/T+ef/F0jWpwWBfzxaBdevOQZso+1ijRvBPThPaYOROQfHjlOujuc1POQBtxuYeeTRhhnuYHS4Db/piPDzex6otMwbr3KKRkDVLqi7lrNyGTf4WBMdyPFF9Fvzs=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Simone Ballarin <simone.ballarin@bugseng.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, "consulting@bugseng.com"
	<consulting@bugseng.com>, Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>, Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>, Xenia Ragiadakou
	<Xenia.Ragiadakou@amd.com>, Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH v2 06/13] xen/efi: fix violations of MISRA C:2012 Rule
 7.2
Thread-Topic: [XEN PATCH v2 06/13] xen/efi: fix violations of MISRA C:2012
 Rule 7.2
Thread-Index: AQHZr1VIs7cSnKcK+EWsrhmpc3alsa+rXlmA
Date: Wed, 5 Jul 2023 16:34:14 +0000
Message-ID: <810E4A64-F51D-474B-995A-11CEF9AB2C85@arm.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <9a791b84be74d7ca575eb94e070aae7294d95bbf.1688559115.git.gianluca.luparini@bugseng.com>
In-Reply-To:
 <9a791b84be74d7ca575eb94e070aae7294d95bbf.1688559115.git.gianluca.luparini@bugseng.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|DB9PR08MB9804:EE_|DBAEUR03FT013:EE_|GV1PR08MB8689:EE_
X-MS-Office365-Filtering-Correlation-Id: 76291f55-358e-494c-eaae-08db7d75b0b1
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 dWEuN7Up+BTo4Bg7ygJav+lfdk8zVQk1itm2ve0GVTTs++4dAdcTiB6e2TIviWmDXEpEUdw/ytpMD79rftVVXPrT70/Fa47zFzes96q4Grgi4LVcD+E55HbuiDaoSK7mMAflK3Ew0z+e68Tv0ctVndIIhkgmOXrSd1Bx6d3BwP9rOrBFN9zUZrL1TWdA97GQmTfYr44bzBZRe51bfhCNK3zcCVPGJce5BddW+URueTvFiHgXdumdguYQyVtjGSlXdu+qNgT9UCdsnCBKQFJ4OLeVpeW2M4JHqj8DdJBIFlOsAYPjffWpuRHeKrgziANFDhajoAz/97opJDX/87xt7yZBhtZdNc/tw6ASpj6HOR+ZyFI8yv/C7wO2B7T/euBXJvRrlnZMUbRRtD9U+ptfqsx2DvUiFSeBTjfexDSmFuVEfvud43N7EvAIdQO1eSy2IcyLLo0fO1Sf6Y+kMbGvArZJork8i9zO1+uRbI2B3kg074TbY0vbi9RkdS2xvA6lADBfeUx1n1i1eRhvIFBRyWYoXvT3fdzTFvZ/KHB3U1G9RG3l++MiwY1x2j52yPBmvRuELl0aB4eJoQ/FD0Vd1ZPnOznxRDunFWYffeD0XdhERy38FuzY+KwYdkb2aNTtRVnQaaBOBkzRwClCI201wQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(39860400002)(346002)(376002)(136003)(451199021)(8676002)(36756003)(8936002)(53546011)(5660300002)(2616005)(86362001)(83380400001)(38100700002)(38070700005)(122000001)(41300700001)(91956017)(66556008)(76116006)(66476007)(6916009)(64756008)(66446008)(4326008)(316002)(66946007)(54906003)(33656002)(6512007)(186003)(478600001)(6506007)(26005)(71200400001)(6486002)(2906002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <24CFDD4E3B28454A881F87DCA7A1FAB3@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB9804
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	24168de0-ba45-433e-aea4-08db7d75ab6c
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	SPqXMfZHpHm1QRKJE4ep7Q3jpflmIThm21TXUVjagUdk8nf+8moX5DnrCQpPFhXemGn0CV5Rc/90+a6LcUnMjdM5foDBcIWmDacdAqz6Co6opehz4lKNyVDUwyPSGMtU3h2bV7b6hn9sXlvvMoHomY8Jg81vNqMa76kbgQgYEtgUgO8gf6AFpp1BtFar6YgeCdguVtkQ7EpOyrZpA/d/GA0ZjFiLMnxCR8LrSCRtaDTvRvYZCmKSAnJwNKxGilHPNqQFXZ6hWOx7NDNCEmKMwcIvyG3klzWEY1pq6rsN9FnHxTlYbFzY3LZy6iwYQdfH6hmMeuofCpE9S7a5fOvDWhkpng3+3uvd4lsVAsTiP9Fr+oVZmDP3oFpnlHIfYNsClaER6t5UrtIQVEfsjlzV5qJmM0LviRJK6Vr0J505EfMn+TBLje1fAalJ0HoZznetDrw22niOgFNXJcPQSDYMH1LOxae/gZ56QaYNz0nTBKnEnf6DNLVBortH8QoEQ2l5GgW9cM58sV5S5Jn+0UD0RFd2bIyMF4hcRt8syc/DNc3KqQqvzcXj/vTMd732WGRo7I7igFw6dJXuJIDeG2lV0+BD5ITEcJZDIxOpDTt+csRoG5H8YXQSkuSACk0snwB67DKVXXAexWWppxOqtH1KmTdQ6VEQ1TUYNzcTlw2RnFRWh7S0/hfm0GNtS0Iw18yZzCqlZmK933RXMSuTRUkOHxnpIppIKvQfPIUiz77gLMbQPo7iTr7bb0u0Bxk4ujMQ
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(376002)(136003)(396003)(451199021)(40470700004)(36840700001)(46966006)(26005)(6506007)(478600001)(82740400003)(6512007)(86362001)(2616005)(186003)(6486002)(54906003)(53546011)(4326008)(81166007)(70586007)(36860700001)(336012)(356005)(83380400001)(70206006)(316002)(47076005)(8676002)(6862004)(8936002)(40460700003)(41300700001)(2906002)(40480700001)(5660300002)(33656002)(82310400005)(36756003);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 16:34:23.1840
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 76291f55-358e-494c-eaae-08db7d75b0b1
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8689



> On 5 Jul 2023, at 16:26, Simone Ballarin <simone.ballarin@bugseng.com> wr=
ote:
>=20
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
>=20
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
>=20
> Add the 'U' suffix to integers literals with unsigned type and also to ot=
her
> literals used in the same contexts or near violations, when their positiv=
e
> nature is immediately clear. The latter changes are done for the sake of
> uniformity.
>=20
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>

Changes looks good to me, probably Jan knows better this part

Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>

> ---
> Changes in v2:
> - minor change to commit title
> - change commit message
> - remove changes in 'efibind.h', 'efiapi.h', 'efidef.h' and 'efiprot.h'
> ---
> xen/common/efi/boot.c    | 8 ++++----
> xen/common/efi/runtime.c | 2 +-
> 2 files changed, 5 insertions(+), 5 deletions(-)
>=20
> diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
> index c5850c26af..28a57fe434 100644
> --- a/xen/common/efi/boot.c
> +++ b/xen/common/efi/boot.c
> @@ -34,13 +34,13 @@
> #define EFI_REVISION(major, minor) (((major) << 16) | (minor))
>=20
> #define SMBIOS3_TABLE_GUID \
> -  { 0xf2fd1544, 0x9794, 0x4a2c, {0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe=
3, 0x94} }
> +  { 0xf2fd1544U, 0x9794U, 0x4a2cU, {0x99U, 0x2eU, 0xe5U, 0xbbU, 0xcfU, 0=
x20U, 0xe3U, 0x94U} }
> #define SHIM_LOCK_PROTOCOL_GUID \
> -  { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8=
b, 0x23} }
> +  { 0x605dab50U, 0xe046U, 0x4300U, {0xabU, 0xb6U, 0x3dU, 0xd8U, 0x10U, 0=
xddU, 0x8bU, 0x23U} }
> #define APPLE_PROPERTIES_PROTOCOL_GUID \
> -  { 0x91bd12fe, 0xf6c3, 0x44fb, { 0xa5, 0xb7, 0x51, 0x22, 0xab, 0x30, 0x=
3a, 0xe0} }
> +  { 0x91bd12feU, 0xf6c3U, 0x44fbU, { 0xa5U, 0xb7U, 0x51U, 0x22U, 0xabU, =
0x30U, 0x3aU, 0xe0U} }
> #define EFI_SYSTEM_RESOURCE_TABLE_GUID    \
> -  { 0xb122a263, 0x3661, 0x4f68, {0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x2=
1, 0x80} }
> +  { 0xb122a263U, 0x3661U, 0x4f68U, {0x99U, 0x29U, 0x78U, 0xf8U, 0xb0U, 0=
xd6U, 0x21U, 0x80U} }
> #define EFI_SYSTEM_RESOURCE_TABLE_FIRMWARE_RESOURCE_VERSION 1
>=20
> typedef struct {
> diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
> index 13b0975866..5cb7504c96 100644
> --- a/xen/common/efi/runtime.c
> +++ b/xen/common/efi/runtime.c
> @@ -698,7 +698,7 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *o=
p)
> #ifndef COMPAT
>     op->status =3D status;
> #else
> -    op->status =3D (status & 0x3fffffff) | ((status >> 32) & 0xc0000000)=
;
> +    op->status =3D (status & 0x3fffffffU) | ((status >> 32) & 0xc0000000=
U);
> #endif
>=20
>     return rc;
> --=20
> 2.41.0
>=20
>=20



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 16:43:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 16:43:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559446.874435 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5aY-0006y1-A7; Wed, 05 Jul 2023 16:42:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559446.874435; Wed, 05 Jul 2023 16:42:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5aY-0006xu-6W; Wed, 05 Jul 2023 16:42:46 +0000
Received: by outflank-mailman (input) for mailman id 559446;
 Wed, 05 Jul 2023 16:42:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qH5aW-0006xo-Tf
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 16:42:44 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH5aW-0005V3-1A; Wed, 05 Jul 2023 16:42:44 +0000
Received: from 54-240-197-239.amazon.com ([54.240.197.239]
 helo=[192.168.19.213]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH5aV-0001lD-Pt; Wed, 05 Jul 2023 16:42:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=dINrxk4jzyAV5ddpUdYH8xJ6xCsxhj44rA4YszpTDak=; b=fujywRd/vQDRiBCCPQZJ7S2lIk
	vAkhOjHhbCQX4nWQshFjh9KVwuffCLUM3mC0HRZ2n0gN+5k3mcdKkRLn+zyA5fc9Hc+h+elKG7ji9
	S+tXiDu7IrBK3sN0KJoCqU2mzpasaje/0SgciOrQQeiQMs9F6xdsVyfCDIamA3REcwYo=;
Message-ID: <a2455b22-1876-dce9-e907-0b437d9c7e8c@xen.org>
Date: Wed, 5 Jul 2023 17:42:40 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 04/13] xen/arm: fix violations of MISRA C:2012 Rule
 7.2
Content-Language: en-US
To: Luca Fancellu <Luca.Fancellu@arm.com>,
 Simone Ballarin <simone.ballarin@bugseng.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 "consulting@bugseng.com" <consulting@bugseng.com>,
 Gianluca Luparini <gianluca.luparini@bugseng.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <c58aa850214380cb6f799226a911968fd33a98ff.1688559115.git.gianluca.luparini@bugseng.com>
 <FDCB18E6-3D49-4634-BD11-931E03B2438C@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <FDCB18E6-3D49-4634-BD11-931E03B2438C@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 05/07/2023 17:27, Luca Fancellu wrote:
>> diff --git a/xen/arch/arm/include/asm/arm64/efibind.h b/xen/arch/arm/include/asm/arm64/efibind.h
>> index 8b43bb8495..0e890b666d 100644
>> --- a/xen/arch/arm/include/asm/arm64/efibind.h
>> +++ b/xen/arch/arm/include/asm/arm64/efibind.h
>> @@ -22,12 +22,12 @@ Revision History
>> #pragma pack()
>> #endif
>>
>> -#define EFIERR(a)           (0x8000000000000000 | a)
>> -#define EFI_ERROR_MASK      0x8000000000000000
>> -#define EFIERR_OEM(a)       (0xc000000000000000 | a)
>> +#define EFIERR(a)           (0x8000000000000000U | a)
>> +#define EFI_ERROR_MASK      0x8000000000000000U
>> +#define EFIERR_OEM(a)       (0xc000000000000000U | a)
>>
>> -#define BAD_POINTER         0xFBFBFBFBFBFBFBFB
>> -#define MAX_ADDRESS         0xFFFFFFFFFFFFFFFF
>> +#define BAD_POINTER         0xFBFBFBFBFBFBFBFBU
>> +#define MAX_ADDRESS         0xFFFFFFFFFFFFFFFFU
>>
> 
> Should these be UL? (From EFIERR to MAX_ADDRESS)

Even though this arm64 only, it would be best to use ULL.

[...]

>> diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
>> index 9c1fdcc3f8..f3e9eb2f92 100644
>> --- a/xen/arch/arm/vgic-v3.c
>> +++ b/xen/arch/arm/vgic-v3.c
>> @@ -354,7 +354,7 @@ read_reserved:
>>      return 1;
>>
>> read_unknown:
>> -    *r = vreg_reg64_extract(0xdeadbeafdeadbeaf, info);
>> +    *r = vreg_reg64_extract(0xdeadbeafdeadbeafU, info);
> 
> Should this be UL?

The code is common between arm32 and arm64. So this wants to be ULL (UL 
is 32-bit on arm32).

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 16:43:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 16:43:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559450.874445 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5bQ-0007TL-IW; Wed, 05 Jul 2023 16:43:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559450.874445; Wed, 05 Jul 2023 16:43:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5bQ-0007TE-Ev; Wed, 05 Jul 2023 16:43:40 +0000
Received: by outflank-mailman (input) for mailman id 559450;
 Wed, 05 Jul 2023 16:43:38 +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
 <SRS0=jUcB=CX=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qH5bO-0007Rs-M5
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 16:43:38 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2061d.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::61d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 152cb747-1b53-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 18:43:36 +0200 (CEST)
Received: from DUZPR01CA0101.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4bb::22) by AS2PR08MB10177.eurprd08.prod.outlook.com
 (2603:10a6:20b:64f::15) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 16:43:31 +0000
Received: from DBAEUR03FT052.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4bb:cafe::b3) by DUZPR01CA0101.outlook.office365.com
 (2603:10a6:10:4bb::22) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 16:43:31 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT052.mail.protection.outlook.com (100.127.142.144) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.22 via Frontend Transport; Wed, 5 Jul 2023 16:43:31 +0000
Received: ("Tessian outbound 52217515e112:v142");
 Wed, 05 Jul 2023 16:43:31 +0000
Received: from 2ae597092974.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 1289A75B-3476-4DDB-94E9-39260DD31E22.1; 
 Wed, 05 Jul 2023 16:43:24 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2ae597092974.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 05 Jul 2023 16:43:24 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by PAWPR08MB9711.eurprd08.prod.outlook.com (2603:10a6:102:2ee::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 16:43:20 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::3861:64c:eb82:afa1]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::3861:64c:eb82:afa1%4]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023
 16:43:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 152cb747-1b53-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fIi9B7jnXfzyLuLGj3XCXlBBFM6JCGQ/BYzLTYtCZt4=;
 b=MPk75Tbdd1E52d7c6ZX4TzxlpapGCcqacaAhPGE+W0aA7jJvfuxyCMzaBWwJ5E1yc+/0Mhh+6ZrTO5jOIxbl3b+i2cPexGR7jrnDCLXYSkgH7DYaBWmkHvR2DVAtyffJeF9cYWs1fdEvrrqCX5nek0qE8uchggdN52ra2Tx1K1g=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: af08e1882f5c467d
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BucdwuisCeji1C+Vnf0dT49XAqyCHmeOPzEwF7ipjieip6KlIMt4HNKK32oP5HvH7DUxsv2h8GQASuQjBQTxoc4N/xlBwipHNkyIBzf9DAxJCfk9hFpyiplehBjokfIV1xI+YPXDCdsOWkYHdMzqUW5wgxaRCNT0NrfGVZxW0JbIQcNegQs3hNI+7wDXhEFdn51Mh73cxbp34bSvd+qI3WQGzPHsVKme6cig8U4LdBZWm5bqsGWFru5zzGYuz3g4rkNfrv/7sFZ9w+owqkWtlWU0YOblsJbnwTynVtQSMxPURBZJScphqTMAxi9nPUpOKbDRhHAlloTcBooOYI1tcA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=fIi9B7jnXfzyLuLGj3XCXlBBFM6JCGQ/BYzLTYtCZt4=;
 b=eCkKMaZgQD89A/1pH3nftiv2pChwEtfdrYJXqB/dVbPDIWvbmRsR4qieG6LWsYnNUbyvRtGt2urhNrtOh9j2i5MgRIJqNxMyy+d5W9K3CLIux6WeJqIwDcLPX/BBA1PXt2+wgjq5rc0HpLcA+gvWSvLAM/Q3PACxONxpfGfIRP84V8+jZEu0nW0u94hx5E3ygkW4JqXKRL+hOAVks3M9xwXPNbSm/1puwsS5zLWwa0JTXgMDV8jSLCU6N+wVxRXZknIdPaTycyX9UbHn3MK28gct353/LM7AS8W3x9sMmAFDl/OrpPaXn9nJaFTHjrjxEhkKzBACtR9JfxlmNVTzbw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fIi9B7jnXfzyLuLGj3XCXlBBFM6JCGQ/BYzLTYtCZt4=;
 b=MPk75Tbdd1E52d7c6ZX4TzxlpapGCcqacaAhPGE+W0aA7jJvfuxyCMzaBWwJ5E1yc+/0Mhh+6ZrTO5jOIxbl3b+i2cPexGR7jrnDCLXYSkgH7DYaBWmkHvR2DVAtyffJeF9cYWs1fdEvrrqCX5nek0qE8uchggdN52ra2Tx1K1g=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Simone Ballarin <simone.ballarin@bugseng.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, "consulting@bugseng.com"
	<consulting@bugseng.com>, Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap
	<george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Wei Liu
	<wl@xen.org>, Michal Orzel <michal.orzel@amd.com>, Xenia Ragiadakou
	<Xenia.Ragiadakou@amd.com>, Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH v2 13/13] xen: fix violations of MISRA C:2012 Rule 7.2
Thread-Topic: [XEN PATCH v2 13/13] xen: fix violations of MISRA C:2012 Rule
 7.2
Thread-Index: AQHZr1VOQBgqK+BWvkmUqJ/ZE9Ai1q+rYO8A
Date: Wed, 5 Jul 2023 16:43:20 +0000
Message-ID: <00B5545B-7564-4AA6-9654-48FB30A074A4@arm.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <76cf70cb43492966fbcf77d7a2d67d90fe0a32d4.1688559115.git.gianluca.luparini@bugseng.com>
In-Reply-To:
 <76cf70cb43492966fbcf77d7a2d67d90fe0a32d4.1688559115.git.gianluca.luparini@bugseng.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|PAWPR08MB9711:EE_|DBAEUR03FT052:EE_|AS2PR08MB10177:EE_
X-MS-Office365-Filtering-Correlation-Id: 909c1120-ae33-4c74-ca79-08db7d76f749
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 pYLzoaGjqUZ2jLBbqfQfzdfVheCCAqYF/jeKFQRvUwqlyll6J5tsllxD/OmHB8ezurOfJOTORj/0lBedAXpNpia58jYlaF6u0pQtR33aQDEIpWP/CLv59DYqBuzR4B0PWiVlZP7Khii+WgwyNu98tdFcufTGe/uuvfy9grX8Y1rOLEX6lJhUbeRbhQbLvybnTge5Nbuh+DqQ6AycLOnU9QvqnHcXhPYxjM5xaX+Bfl/V6gApShuJG5KNNlXSy35GVCHyBp6sM9rXYNVAHy7TFwokVKTAn7/H2DaPciC9PZTa38fxJjtNgF8TIFwbn+y74+nMukDjy5ngL06MX6pnzy3cDnZL9mKh/ttLy15Nk1j+1HKYCiCWr0fOA343VzQIsLxgAXO98yIlxWEZRQgstl/ee/qMlXq57tOVBxdU0eUDnm2VAfn4w4bR1J8uGJOE5rda1+7UImLzykuDvVNftlX0Gm1ck969AS6eTCg5HNFHbXl8XywDxz5UoNkuktfQYW0r7wFFRWL/HtLLKNF+mnbn0+1qLdzIObAihW38ZjX+nalenZ1GH2UBLNJLMMj1UZubNFuc1qgGOgQNoWPjZ5cCXlwIn+USsev+w5YOGb63unOxoaf/bOmmjqnLqOsvMaRNhosG7nNzTt+zGfDZCQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(39860400002)(366004)(346002)(136003)(451199021)(38100700002)(71200400001)(33656002)(2906002)(6486002)(8936002)(7416002)(38070700005)(8676002)(54906003)(36756003)(41300700001)(5660300002)(478600001)(76116006)(64756008)(86362001)(91956017)(66946007)(66556008)(186003)(26005)(6916009)(53546011)(6506007)(6512007)(66476007)(66446008)(4326008)(316002)(122000001)(2616005)(83380400001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <EED67B60242A5F42BC83C60DFAFDB26D@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9711
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT052.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	291cca9f-cb78-4b48-94cf-08db7d76f0d0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Z0av9SrsEUngNWVOOrV9uwFHY8UZZ8ZeNBXa2QJ5gsKP7RAVHCMFgCaRNZJHHhwVJsv2ix8bENBFE17PbDH/vdOudqUGgPgK4k9+gHkTMespASzXzvZI7bT0VpS+q+Acyms1nK0VshPi1WQYpFfoz3Sj0JabcuVXuDwOJvmPqduP2H7jUEUMUMvDA6ZGb1DWn7DFjLQutkBFGyWjkh3gP/86BcDBT+dGQBI/S3VOKJezsgzYhVteGKrq6ccIe0pt5rW8eOP6U8FRgs7DRsrhwkTSf8Wtfu0hTTHT6Zbt482Al4VXzyViZmmpCqca0g0hv4q+rMww/4XJoLDEGI0Sc2SSKGGWec1HjMxO9TCWfTzezoThbuIywGZisX1QL6Xj1c05bLE5etNwS9xb0n0Z1vmYQBM+BHCLeyEXPxEQA7Rb618oJRSdB/MokOWYSXFgEWMF18dgYPZx9CAvPXdES6raYtvQBJt47WjUJMu7O7CYYRVIdn+QFmPaZhPWzCp6hz/KDU+lzUvz2SZ9rbNQaGn3EhkEsOW37ty5zEBuhFdjLJH+EkcVlR+Z6Dv4ta9WezPjRQdf4rv4NuW0T9RZc2PwkGwHvrCNi90QKLv1CnIPaRNel87MmCs+p4z7TQqu4KcBOKOWOB8p5FC6W1luNce+xUoXDl2IbTGQ/k3tyd86gylFuzTVdbc+VYfq5eFzSU2IIJ6nEIE3b/7gbhqBaeaVNxMcbgfARUxG0N0eJpWiSsrX6fvv5mDEaHd3usMf
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(136003)(376002)(39860400002)(451199021)(46966006)(40470700004)(36840700001)(70206006)(4326008)(70586007)(356005)(82740400003)(2616005)(81166007)(40480700001)(186003)(86362001)(6486002)(33656002)(6512007)(36756003)(26005)(54906003)(6506007)(53546011)(478600001)(40460700003)(82310400005)(36860700001)(6862004)(8936002)(8676002)(5660300002)(316002)(2906002)(47076005)(41300700001)(83380400001)(336012);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 16:43:31.1322
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 909c1120-ae33-4c74-ca79-08db7d76f749
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT052.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10177

DQoNCj4gT24gNSBKdWwgMjAyMywgYXQgMTY6MjYsIFNpbW9uZSBCYWxsYXJpbiA8c2ltb25lLmJh
bGxhcmluQGJ1Z3NlbmcuY29tPiB3cm90ZToNCj4gDQo+IEZyb206IEdpYW5sdWNhIEx1cGFyaW5p
IDxnaWFubHVjYS5sdXBhcmluaUBidWdzZW5nLmNvbT4NCj4gDQo+IFRoZSB4ZW4gc291cmNlcyBj
b250YWlucyB2aW9sYXRpb25zIG9mIE1JU1JBIEM6MjAxMiBSdWxlIDcuMiB3aG9zZQ0KPiBoZWFk
bGluZSBzdGF0ZXM6DQo+ICJBICd1JyBvciAnVScgc3VmZml4IHNoYWxsIGJlIGFwcGxpZWQgdG8g
YWxsIGludGVnZXIgY29uc3RhbnRzDQo+IHRoYXQgYXJlIHJlcHJlc2VudGVkIGluIGFuIHVuc2ln
bmVkIHR5cGUiLg0KPiANCj4gQWRkIHRoZSAnVScgc3VmZml4IH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xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 16:54:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559458.874455 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5ll-0000ej-Mw; Wed, 05 Jul 2023 16:54:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559458.874455; Wed, 05 Jul 2023 16:54:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5ll-0000ec-K8; Wed, 05 Jul 2023 16:54:21 +0000
Received: by outflank-mailman (input) for mailman id 559458;
 Wed, 05 Jul 2023 16:54:20 +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
 <SRS0=asTv=CX=citrix.com=prvs=543a7ddba=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qH5lk-0000eW-4O
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 16:54:20 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 92f956fc-1b54-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 18:54:17 +0200 (CEST)
Received: from mail-bn8nam12lp2176.outbound.protection.outlook.com (HELO
 NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.176])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 05 Jul 2023 12:54:05 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by DS7PR03MB5637.namprd03.prod.outlook.com (2603:10b6:5:2ca::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 16:54:02 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::bd96:913a:c06c:d606%4]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023
 16:54:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 92f956fc-1b54-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688576057;
  h=message-id:date:subject:to:references:from:in-reply-to:
   content-transfer-encoding:mime-version;
  bh=QVsjvRaEGDlHN/4NWGx9UspnGUsD1bKvKve0FC2IWb0=;
  b=aBjCm/taydTIFcbe2s3fGnkXJXOQv6qTFyh9PgiN2A3qpGKWA+i1bQhq
   0CEk0mQfk+Ufk886PKQ481cr18UegNfsJD4bGAKF1OqWEbe86PKiLShn+
   91uqLPow3VFnFvhPPaGz0JVqCNUgEz946aIxwDJgcpgzvC9mSjsZQ4HvB
   k=;
X-IronPort-RemoteIP: 104.47.55.176
X-IronPort-MID: 113972566
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-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j5xBnY3lvhNQpZkBUdAZ0+9+YDzrdXFedU19KrcSMo
 GT3cZDryrIQwVtUizqbkN1OdQqvrfw5evbXSI=
X-Talos-CUID: 9a23:+biuv265izS3GNZHYNssz2oSCs95I23n0WrrHGWbFWp0drbIRgrF
X-Talos-MUID: 9a23:jbswfwajeobmEOBTsi7uiTVtFv1SzKWzOU1OlrYPicCFKnkl
X-IronPort-AV: E=Sophos;i="6.01,183,1684814400"; 
   d="scan'208";a="113972566"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=NAVS6nQDB85AFEug2Qejh2cJhXZEG6y2AaOHj6FwCeWxSvSXzTA/6I/JgIZArvZ5O+3A2/Ei2/DbVQQcDMuMGZb08wwmP1yFIcv99n2orjdsxL/uaQfKbF1vZTAnhUNmKkLpn3mTGPh/JdUMdTxpoQVTWB0edM+fPddHbY09vuNcRNrd9GnA5pgyxtasHJ/QMnnOkS5+GHvJ6uEGoYmX9TptDUhAxvbHr/lZ4Q/NigEopnAEtFdnAf0WMBmq+Uxh8uVo4uDSqAdVCNxe2qr8Ull5Llmn1D8FHGTFIIXzchUkVBBrrCebxjX1MtFBnEG/DPt1Hz1nvcIYZRc4G+ZSOQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=QVsjvRaEGDlHN/4NWGx9UspnGUsD1bKvKve0FC2IWb0=;
 b=UR7qTyColrgXWkZDMhm9JcN0ElSYpeg176gsNNbL2GYQC3Yz8yBqUq3hSkudzJyzQCAvZ5+BukjBrJYBK66sCtVlj11mgpqJh4ohFgDZmv+hs43YexsYRHREB/fYqW+VHsxoXhADKCcgZRp4ZXCiwh06ZvguaqQ/WtKMalT8CFjCBWkgP6SOTrmvfDPxHDJIpR+ro2WB2dpWnGODWItS4GmFtQwZ/Vz8sCbjPVoQZ2r+4i6Q2KketDrqnKNOlmRQzdOpKcmvopKpEHzJIDLJpO7dIbMop1RJT2ECLCV/8AmCLF8+utD0lYZhLdtLfOI0JEpOI3XNgnkC81Vz50orpg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QVsjvRaEGDlHN/4NWGx9UspnGUsD1bKvKve0FC2IWb0=;
 b=ASgMqmJOffdAOwBjny6/bHccBOHrX414vRyFF8jnGiggZQ4D76zofP/NKRzCw924WunoDwqVUHIfQ9dZwg6r+dc/wjpfWvzLNYPx+buBpWYPR8HMj2zpnVy/96YtOhbZYrfeQou1RBqUjJQeTEFHlic20YQlrGZvPrddz67ulpw=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <55c311cc-7ee3-93d8-21c2-ce03e3222096@citrix.com>
Date: Wed, 5 Jul 2023 17:53:56 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [PATCH] ppc: make also linking work with big-endian tool chain
Content-Language: en-GB
To: Shawn Anastasio <sanastasio@raptorengineering.com>,
 Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <f56a208f-97d1-b7ec-afad-3b7bc180cf87@suse.com>
 <4725795c-3f0e-af91-5683-1059ba6163c9@raptorengineering.com>
 <cbf263fe-9221-018d-b187-3d17be76e937@suse.com>
 <1b3a9165-43fd-d8e0-5c2f-49875973c8e1@raptorengineering.com>
From: Andrew Cooper <andrew.cooper3@citrix.com>
In-Reply-To: <1b3a9165-43fd-d8e0-5c2f-49875973c8e1@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0087.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:190::20) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|DS7PR03MB5637:EE_
X-MS-Office365-Filtering-Correlation-Id: 3da1176a-a009-4cda-8f49-08db7d786f30
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	qVkXAosh77dnPxGxk0KP7EB6XQTAIp5PtjF4/SgqRFov6UKft4qXjUFm0vPoWf+We+WiMqEMvOODU4kDWMMcQ8OaOvZ6s4rFupV/qK5JUXVLQV1qOP+4fVv8l9pA0A3lkrYpywQLIYjjryX1aLPZDrNLPR3pzCuZMuP8kwBmolbTc9P+QG8t9I/aouYRWhkWIMUct4ipuy3OIK9Ue2aLwfeKYNnxnZafTuBYadVcnR6h9jWyUDYiQdUIcEsJkvDKugYwW+wnar+2X0lU5oKI64vc9GDU7hayromicPLj2RmBduZNYMDR2Y3Hf5Cs55r8C1RRgYjHrxRZ8kdVEHSRhWJBhRw3kp+nQHyMSdLYPF7hgayl74S5U9tWT5TzFOd8oOaalkaDR1raKZvkEKyZEty4Ibwr1sxQS3kf7lDfCNWjMSqtnnx7gLNez4uV6BkCHORc8ei0uG+0sR4Sj0H/pP5Uwc5RrE2JUykkU4ytY71AiRRQNz7669HJemeUkwStHdKD6n6YqjPyL4oOPIxJFEC4iA0TUb/WV4QWZiHZGew/3/S6gVgJl7dl+D0g66IpjC2t56ztXzajZY0mE+2ePgN1abnMP3K0E4PlfaphxljcHhIT0v+DWvt+ORlljkcnWNj/D/AvyMsJnpQXXJbbQA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(346002)(376002)(136003)(396003)(451199021)(478600001)(6666004)(6486002)(110136005)(53546011)(186003)(6506007)(26005)(6512007)(66946007)(2906002)(41300700001)(66476007)(66556008)(316002)(8936002)(8676002)(5660300002)(38100700002)(82960400001)(36756003)(86362001)(2616005)(83380400001)(31696002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?a0hOQklYK2dNK0VIMEZwOTkrSWw3UmpUZGtVTkk5aGpLZ2lnK1FBTGFtbCtj?=
 =?utf-8?B?R29MUzlNOTJNVnBwdUQ0bGswSjYxQmo2TnVZeTc0RjJoUFN2Y1hiVjM4MGlj?=
 =?utf-8?B?V0hDdC9nYWJJZXExeGgzOW8yZ3JWWUdzd2RvUjVnVU9VMXhFNytqYi8xQ24z?=
 =?utf-8?B?WHNOS0wvYjJpUmN1R3B5aWZONmdzWFVHODBQSGxuN3B6V1JQalBnaXdqeEpx?=
 =?utf-8?B?Nlp6aEcyYVlGK0psTzc4RWl3NkpNOGhRQmpyRnNvMjdMS2x2MWhyNFhISzNK?=
 =?utf-8?B?T29McGFMbi83UGs1Qk43ODcwYzVERjBIZElYNnJLak9OZk03VGxqcWtKNXZL?=
 =?utf-8?B?QWYwMjliSmhTKzJoVGl4RzJSOW1lTXcxdktYYmtQSCtOVkw0ZDZNTUN6TWFG?=
 =?utf-8?B?c2NZOS80R1lVNUxKVC84UmJWT2lmaER0dStPZWJtOW5mdUtCZlRjUGJNSG5p?=
 =?utf-8?B?WWJPQ3JoKzZPVWJuSTVteGJUeWZIYlVlM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ExternalHop-MessageData-0:
	kXfw+Tmt4LLVbwaoPJk5RGbh2VZjSWGcJkqTZGOibEI9901chsW8BD1yXeEgVNBIH+pOv8OLahtQKaWwzprpsDteQHdw1gv9DyMT8KPIbVkbAcixXkszXL2ruk02WPame//QY6WuGiNULl7M//iqbFfxQD9jtn32wTHWkkhL3wuF3Z0ZlKR2C1jWj0SdaLX/+CpDMWT+0pWihp0o2tCNVHSZ5T8Nfj8jRLyHf5m9U/0UUUfWvbHmlXIlAWKKUYCaZoDv5cLq9khleoGBDMLpGB+Xpt1zYWezVcB/uErvWue59/hUAT6pUun5Rm4dLTLyTFHt9laJ+Z2m/h78AQYgVgbzVNqNjHvJprpVxSrpyAhzxfIUZ15nSw0JFJpWzdkNSzJzKAxE3EVz6dFn/Nwcowuv88Zb3EStG753htP/blf/3kNXku3Hoo/ntQLAiLYk631T3WplUTxWT5QOQqcZTus4Mye4UVyu5Z0WDFrqJXQY6+ej1j+fx2X4amEcGmTqSUaP3EODoAjdTSjqA9v99aR0ht+tBY+bvn/0B08uqNes6Fy/u9OemiYS1l3ybRuLzXp+cDs5Df9AB3lzhgo3ONDL5Zv8u9roTEvTfHO8HWJHBijwHmGJOwJ8fQk1sNjM1YxgBZZO226Cuwk9757eKDrRqPxJUkMy1R40y6q9XNmytt0Zdni7YRRLL1wbcmfUzEohj1gQ15iZqpVjuL4ApY+ykVWgC1khc5L+WQbGYr6QBE3TxY4CB8T7L+XSvu5Cozk7Y6Xk8wWSSBu5hBi37WjrcwdabV0MhQV8/r16EilUutt+2PngRmBtaxqsDTJqEuo0S79WRH2KCGgsSHP20RiUHjrHLfh2Rdys15WKIYE=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3da1176a-a009-4cda-8f49-08db7d786f30
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 16:54:02.0828
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ISQblI1vnweHXthLI4GkEje6y/CzMAl3OVInx2kW/j8rDdCyobyTxTXJVlGgzu6eIoE/GQ0FDZ4kptVP3FVdfFN7Hxzy73fYLD9vu3OTm/g=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR03MB5637

On 05/07/2023 5:22 pm, Shawn Anastasio wrote:
> On 7/5/23 11:09 AM, Jan Beulich wrote:
>> On 05.07.2023 17:10, Shawn Anastasio wrote:
>>> Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
>> Thanks.
> Just to clarify, as the maintainer of PPC64, would it be my
> responsibility to commit this now directly to xen/staging? Or should I
> commit it to my own tree and have someone pull it?
>
> I'm not super familiar with the project's maintainer workflow yet so any
> hints would be appreciated.

Ah, so this is somewhere where we're quite different to Linux.

There is one single tree, and there are a small group of people with
commit access.Â  We're "THE REST" in the maintainers file.Â  Jan can
commit, as can I, and several others.

The role of committers is (technically at least) to take any patch from
the mailing list which is suitably acked, and commit it.

So, in principle you have nothing further to do here.Â  As this is one of
Jan's patches, I'm sure he'll include in in the next set of patches he
commits.

It can happen that patches fall between the cracks, so it is generally
helpful for maintainers to double check and ping on IRC/email/etc if
there are patches that appear to be outstanding.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 17:04:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 17:04:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559465.874465 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5v7-0002Bt-KS; Wed, 05 Jul 2023 17:04:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559465.874465; Wed, 05 Jul 2023 17:04:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH5v7-0002Bm-GE; Wed, 05 Jul 2023 17:04:01 +0000
Received: by outflank-mailman (input) for mailman id 559465;
 Wed, 05 Jul 2023 17:04:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Yom7=CX=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qH5v6-0002Bg-UN
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 17:04:00 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ef03f90d-1b55-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 19:03:59 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 8CCA98285553;
 Wed,  5 Jul 2023 12:03:58 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id gIrsQYezwWCG; Wed,  5 Jul 2023 12:03:57 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id CE5058285563;
 Wed,  5 Jul 2023 12:03:57 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id pbAPpExwlw_u; Wed,  5 Jul 2023 12:03:57 -0500 (CDT)
Received: from [10.11.0.2] (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 6AD4D8285553;
 Wed,  5 Jul 2023 12:03:57 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ef03f90d-1b55-11ee-b237-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com CE5058285563
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1688576637; bh=JM/NQ1l/xxAwLlFO3BI/MiFvFYF49qkS0yr7kU5GZnA=;
	h=Message-ID:Date:MIME-Version:To:From;
	b=htp6mr6Jhj/XbAAg7CDHGNoXVqUIDLaM5ihnvm5Kj4zFVf5k7FP8OlKjYUieo2pjF
	 F/M0AP1+sgLNfSYaCxbBRV6Lfjcrx1KyziVe5bdwmJmCq8njlbZSnOKfmL/WCH3+uC
	 tAgpQxcaSV3bwz1YeZiPuFGEbKQhCziV52qrTngI=
X-Virus-Scanned: amavisd-new at rptsys.com
Message-ID: <a72163cf-a958-2b06-7b94-79adafa85a57@raptorengineering.com>
Date: Wed, 5 Jul 2023 12:03:56 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH] ppc: make also linking work with big-endian tool chain
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
 <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <f56a208f-97d1-b7ec-afad-3b7bc180cf87@suse.com>
 <4725795c-3f0e-af91-5683-1059ba6163c9@raptorengineering.com>
 <cbf263fe-9221-018d-b187-3d17be76e937@suse.com>
 <1b3a9165-43fd-d8e0-5c2f-49875973c8e1@raptorengineering.com>
 <55c311cc-7ee3-93d8-21c2-ce03e3222096@citrix.com>
From: Shawn Anastasio <sanastasio@raptorengineering.com>
In-Reply-To: <55c311cc-7ee3-93d8-21c2-ce03e3222096@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 7/5/23 11:53 AM, Andrew Cooper wrote:
> On 05/07/2023 5:22 pm, Shawn Anastasio wrote:
>> On 7/5/23 11:09 AM, Jan Beulich wrote:
>>> On 05.07.2023 17:10, Shawn Anastasio wrote:
>>>> Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
>>> Thanks.
>> Just to clarify, as the maintainer of PPC64, would it be my
>> responsibility to commit this now directly to xen/staging? Or should I
>> commit it to my own tree and have someone pull it?
>>
>> I'm not super familiar with the project's maintainer workflow yet so any
>> hints would be appreciated.
> 
> Ah, so this is somewhere where we're quite different to Linux.
> 
> There is one single tree, and there are a small group of people with
> commit access.  We're "THE REST" in the maintainers file.  Jan can
> commit, as can I, and several others.
> 
> The role of committers is (technically at least) to take any patch from
> the mailing list which is suitably acked, and commit it.
> 
> So, in principle you have nothing further to do here.  As this is one of
> Jan's patches, I'm sure he'll include in in the next set of patches he
> commits.
> 
> It can happen that patches fall between the cracks, so it is generally
> helpful for maintainers to double check and ping on IRC/email/etc if
> there are patches that appear to be outstanding.
> 
> ~Andrew

Thanks for the explanation, that makes sense.

Shawn


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 17:21:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 17:21:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559469.874474 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH6BM-0004dT-TX; Wed, 05 Jul 2023 17:20:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559469.874474; Wed, 05 Jul 2023 17:20:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH6BM-0004dM-Qy; Wed, 05 Jul 2023 17:20:48 +0000
Received: by outflank-mailman (input) for mailman id 559469;
 Wed, 05 Jul 2023 17:20:47 +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
 <SRS0=gl5h=CX=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qH6BL-0004dC-A6
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 17:20:47 +0000
Received: from NAM04-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam04on20622.outbound.protection.outlook.com
 [2a01:111:f400:7e8b::622])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 44bd7c04-1b58-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 19:20:43 +0200 (CEST)
Received: from SN6PR12MB2621.namprd12.prod.outlook.com (2603:10b6:805:73::15)
 by DM6PR12MB5519.namprd12.prod.outlook.com (2603:10b6:5:1b5::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul
 2023 17:20:39 +0000
Received: from SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54]) by SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54%2]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023
 17:20:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 44bd7c04-1b58-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=C4mfbyeNN2cuVaaWgGOJ2rSlvgDVAL5rfzwy7CkZUFaw/NGYj1rwK50+aaYhVCOBdr4BY3Zup5WEpSxy/oZWXS58VWGDTkAXFo82DIw/Ru4Cm0uqjqFE135Op5v8xMXRSQZtET36Lui2e0875wT6bcM6DvUCcso+a3fGgm1WIW/TkNv2vAxGNfiSP+oVYR/5LKyd6JtuL5tj7tkAHclkBdmU5TpTg1wF2XcArcMMzRayAHKG9dP7JyVHj3Ix1RLvzHGFjHxi5DYSvo0KqcLngrPiNTViFC+WX/OH4y2Fw5lmbj2d3mT/IbDl1MObobe2Fzw8ieENrh/QCMl1diLK3A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=JKgoBxJu6agzDjVMWOWJwdJ1oYzgFy9V/XL4tulXSys=;
 b=ffTPtwUemzn9OAAZfI3CAJr5teNn3iFbUnpKC8Cz+ESMT0v50Ex5C7pTcya3rAWwl2W7+/+qv7eczV6vohM6ngILRkhl/iSTQeaxgzedydrZgeCKzs5yt8V0iaGX8QHqb/KyDJIWXd/v+vGIgY2/QifbmpRIiZukAzYtlPD676Gb0fTY2/gBDv/pcA+wwoQPyK/NVKgdNLx+hbb/+Npy3yeKN72DbkiOws4IYEBKB391VcnVpwvQT3E+KFZqtGWxHTdcBgM5dVZHzGvdhE0yWjM2w31CEoSTPafQ+D4XQ4kNtTon+iauS4xDOHxpEB0Ux5P12us5FE54WEmMSzvZvQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=JKgoBxJu6agzDjVMWOWJwdJ1oYzgFy9V/XL4tulXSys=;
 b=oJcHHsTg7539cTv+fUDfDnySHnCwOzWEuYLYQZZAkBjSm1H7ly/5AWRwnOJQve4BJkx5RspQPYDa0PUjiEjmd8ziROX9FVK6TU8KDI7NfAei3IKQ6wtcKFaMq/5JBzfWhYk1YIvUt5TkauRRBCGlnVG7hBSj0Y2rT/tuoFt5tpI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <e88e1685-0ba1-8c2a-9a9a-d9fad631018d@amd.com>
Date: Wed, 5 Jul 2023 18:20:33 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 52/52] xen/arm: add Kconfig option CONFIG_HAS_MPU to
 enable MPU system support
To: Penny Zheng <Penny.Zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-53-Penny.Zheng@arm.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <20230626033443.2943270-53-Penny.Zheng@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P265CA0129.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:9f::21) To SN6PR12MB2621.namprd12.prod.outlook.com
 (2603:10b6:805:73::15)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN6PR12MB2621:EE_|DM6PR12MB5519:EE_
X-MS-Office365-Filtering-Correlation-Id: b1d37988-512f-46ab-48ee-08db7d7c2769
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	RukKHwSQ+caOCQK5jQqpkwB2jGj2+LVDDluyJZNUhSBohH8Jq9FIxN5JurkzaAzY/IN0wCQCm0I6gyQIClCXsIJT1w8p+nt+fab592JszL7GBVoesRcqz1JymHSw/w2F42+1MZxCCw1Q3ZCYP+delcQcZoG5G9AZwxSJUbeW/qjGIK5rr2J4ZRTrWlsAOiH8VZP5LREAl2OnfPPBGph9DCxqZrfJ+BC7IryKAqLibQunLUJPb1o1mjTT3tvkLNcDfiQSP2f+yDm2zJdsYxOMu2efrbOs19vblD7tXk3NRIo/1DdGjJjcdC0sfsirLNGhns/pq7mdjiOK3deGCr8Td9OlIUmm57Hc7dxMsgA7QbRO7E5hN3X4kPIME5ko2igLq8yBZIUJvxC7zPD8hwqctXlvJJ1WgpLGeJUcG46syx7Fw4Hr/5z8dudbFwpUHPCjgGz19QKq7/nVYzhQEjYxF+rtITyVEd8FmTff8RyPR5tLaw7Op47R3a6MKVkruxKZnM53hGjOJEM+UsN6W+l12oRArjS2odoYCic9fjhZNeQY7z2eVR7uJq5MlyMQNErNGWsGzVS0/73kQ9/3lng/4EoJt4bmFCxZDKXvvjRJlgH7W7McY05zXVRGZboqeFYsibJ0lEWFyBjJ4a2QwY/9NA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2621.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(136003)(39860400002)(366004)(396003)(451199021)(26005)(6506007)(31686004)(478600001)(6666004)(6512007)(2616005)(31696002)(186003)(66556008)(38100700002)(54906003)(66476007)(53546011)(4326008)(66946007)(83380400001)(316002)(6486002)(5660300002)(8676002)(8936002)(41300700001)(2906002)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MjB5Nm8rdko0ZXJlRjR3dnppSXhFOE5DN3cyUklJbG5nSnNRMWdtTTdsM3dJ?=
 =?utf-8?B?ZVBYNjkvL2s0ajhpTU9NZElWTVJCeHZoWG1ObWFGTzRjb3pXd2lpSVpERmE3?=
 =?utf-8?B?a0tIUmhnYWppZTBTd210eFRJcjRmVWU1OG5hbGVPM2VYNWg2VUQvcmo2QmRv?=
 =?utf-8?B?b3hsbU1DKzRyL1k5WFRqN0J2YjRhbFZzOXFEeUp5bE9reHJ6MFM2RGJ4eXdi?=
 =?utf-8?B?dGJnL3RVM0h0bG1yMjlCeGZrLzVELzVzS0pBdWZvRDVVRTU3dStNaVZNOFp4?=
 =?utf-8?B?bUVvRDFwRk5wSWJlUUFvNyt6WkRLbERRQUE3blhtdFE0Vnh2Q1ZOaXdaRzlh?=
 =?utf-8?B?bzVMeGthbHlBZjNtanZWdXpwQW9rOVhNQ3pnQnZYdzN2Zk1WazVYVi93clpS?=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
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b1d37988-512f-46ab-48ee-08db7d7c2769
X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2621.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 17:20:39.7100
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: MVV0HxsIu3+6cwOhf6b6s+3D1qHN9b3UoH8paCxfvKshve0ol8GrkmaqyI57rtWTHFzJwH3dUimBD9jbBCOsIQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB5519


On 26/06/2023 04:34, Penny Zheng wrote:
> CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
>
>
> Introduce a Kconfig option CONFIG_HAS_MPU to enable MPU architecture
> support. STATIC_MEMORY, ARCH_MAP_DOMAIN_PAGE and ARM_SECURE_STATE will
> be selected by MPU system by default. Also, features like, ARM_EFI, are
> not supported right now.
>
> Current MPU system design is only for ARM 64-bit platform.
>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> ---
> v3:
> - select ARCH_MAP_DOMAIN_PAGE and ARM_SECURE_STATE
> - remove platform-specific config: CONFIG_ARM_V8R
> ---
>   xen/arch/arm/Kconfig | 14 +++++++++++++-
>   1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> index 3f67aacbbf..2acdf39ec8 100644
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -62,6 +62,7 @@ source "arch/Kconfig"
>   config HAS_MMU
>          bool "Memory Management Unit support in a VMSA system"
>          default y
> +       depends on !HAS_MPU
>          select HAS_PAGING_MEMPOOL
>          select HAS_PMAP
>          select HAS_VMAP
> @@ -70,6 +71,17 @@ config HAS_MMU
>            a memory system through a set of virtual to physical address mappings and associated memory
>            properties held in memory-mapped tables known as translation tables.
>
> +config HAS_MPU
> +       bool "Memory Protection Unit support in a PMSA system"
> +       default n
> +       depends on ARM_64
This will not be true as R52 will support MPU
> +       select ARCH_MAP_DOMAIN_PAGE
> +       select ARM_SECURE_STATE
Also, R52 does not support secure state.
> +       select STATIC_MEMORY
> +       help
> +         The PMSA is based on a Memory Protection Unit (MPU), which provides a much simpler
> +         memory protection scheme than the MMU based VMSA.
> +

Instead, I will suggest something like this :-

config ARM_V8R
 Â Â Â  bool "ARMv8-R AArch64 architecture support (UNSUPPORTED)" if 
UNSUPPORTED
 Â Â Â  default n
 Â Â Â  select HAS_MPU
 Â Â Â  select ARM_SECURE_STATE
 Â Â Â  select STATIC_MEMORY
 Â Â Â  depends on ARM_64
 Â Â Â  help
 Â Â Â Â Â  This option enables Armv8-R profile for Arm64. Enabling this option
 Â Â Â Â Â  results in selecting MPU.


So, that later on we can add :-

config AARCH32_V8R
 Â Â Â  bool "AArch32 Arm V8R Support (UNSUPPORTED)" if UNSUPPORTED
 Â Â Â  default n
 Â Â Â  select HAS_MPU
 Â Â Â  select STATIC_MEMORY
 Â Â Â  depends on ARM_32
 Â Â Â  help
 Â Â Â Â Â  This option enables Armv8-R profile for Arm32.

- Ayan

>   config HAS_FIXMAP
>          bool "Provide special-purpose 4K mapping slots in a VMSA"
>          depends on HAS_MMU
> @@ -85,7 +97,7 @@ config ACPI
>
>   config ARM_EFI
>          bool "UEFI boot service support"
> -       depends on ARM_64
> +       depends on ARM_64 && !HAS_MPU
>          default y
>          help
>            This option provides support for boot services through
> --
> 2.25.1
>
>


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 18:41:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 18:41:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559477.874485 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH7Qw-0004ce-O4; Wed, 05 Jul 2023 18:40:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559477.874485; Wed, 05 Jul 2023 18:40:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH7Qw-0004cX-JX; Wed, 05 Jul 2023 18:40:58 +0000
Received: by outflank-mailman (input) for mailman id 559477;
 Wed, 05 Jul 2023 18:40:57 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qH7Qv-0004cN-8R; Wed, 05 Jul 2023 18:40:57 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qH7Qv-0008HV-2p; Wed, 05 Jul 2023 18:40:57 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qH7Qu-0006Yw-Om; Wed, 05 Jul 2023 18:40:56 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qH7Qu-00072c-OD; Wed, 05 Jul 2023 18:40:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=lIOjkceT758IiA1lOMeL/bQFI0ewytFohA6E4geXpRc=; b=64mnTX9fdPWY5DxJTYsyfhlT29
	UlEgUjikdnnyZExvuPkHENxyTb433R1mL4POKw7VxoRG16TUwED4wT0xFEK1z4WbDVATGpvLeOAtk
	+dIALDyZL+e3PIcAt2BvbnWeN3sB21keq3X2BnV4pPVkRpRacP29qNAHyDpuNyVbX09o=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181710-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181710: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=dc5e6082f5b36c4a4008c158b53320699025f895
X-Osstest-Versions-That:
    xen=c2ff2ca3a9dd60e1fb7d6c252be5cb1865952fda
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 05 Jul 2023 18:40:56 +0000

flight 181710 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181710/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  dc5e6082f5b36c4a4008c158b53320699025f895
baseline version:
 xen                  c2ff2ca3a9dd60e1fb7d6c252be5cb1865952fda

Last test of basis   181704  2023-07-05 10:03:34 Z    0 days
Testing same since   181710  2023-07-05 15:00:25 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Julien Grall <jgrall@amazon.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   c2ff2ca3a9..dc5e6082f5  dc5e6082f5b36c4a4008c158b53320699025f895 -> smoke


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 18:42:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 18:42:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559483.874495 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH7SX-000598-2K; Wed, 05 Jul 2023 18:42:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559483.874495; Wed, 05 Jul 2023 18:42:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH7SW-000591-Vg; Wed, 05 Jul 2023 18:42:36 +0000
Received: by outflank-mailman (input) for mailman id 559483;
 Wed, 05 Jul 2023 18:42:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yX3c=CX=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qH7SV-00058v-PM
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 18:42:35 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b3ad1622-1b63-11ee-b237-6b7b168915f2;
 Wed, 05 Jul 2023 20:42:33 +0200 (CEST)
Received: from mail-ua1-f48.google.com (mail-ua1-f48.google.com
 [209.85.222.48])
 by support.bugseng.com (Postfix) with ESMTPSA id 81F6C4EE0C88
 for <xen-devel@lists.xenproject.org>; Wed,  5 Jul 2023 20:42:32 +0200 (CEST)
Received: by mail-ua1-f48.google.com with SMTP id
 a1e0cc1a2514c-783f17f0a00so2295755241.2
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 11:42:32 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b3ad1622-1b63-11ee-b237-6b7b168915f2
X-Gm-Message-State: ABy/qLYf8RRgvOLPlTqQInI3aDU+iJbzLf2kVLBBmMW2QqrZNE1rNHfO
	KaGyrMSaiQ1+4p1rqeAZEkmznBRs0ERjuGu/h4o=
X-Google-Smtp-Source: APBJJlHy8XOXH0o6ndqvqU1gTE0sKaHFjr3+GiU7oeQgumsNnlLCA6YBLQ5ldhndIz+h92gZ/fGAh0FWBB8+02YiLG4=
X-Received: by 2002:a67:d097:0:b0:443:4e53:97c7 with SMTP id
 s23-20020a67d097000000b004434e5397c7mr9074vsi.3.1688582551214; Wed, 05 Jul
 2023 11:42:31 -0700 (PDT)
MIME-Version: 1.0
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <76cf70cb43492966fbcf77d7a2d67d90fe0a32d4.1688559115.git.gianluca.luparini@bugseng.com>
 <00B5545B-7564-4AA6-9654-48FB30A074A4@arm.com>
In-Reply-To: <00B5545B-7564-4AA6-9654-48FB30A074A4@arm.com>
From: Simone Ballarin <simone.ballarin@bugseng.com>
Date: Wed, 5 Jul 2023 20:42:19 +0200
X-Gmail-Original-Message-ID: <CAFHJcJtgGQXVTJc9ibpmXHA7oZR1wd-GMVCKAJKZhJm+BTCk2Q@mail.gmail.com>
Message-ID: <CAFHJcJtgGQXVTJc9ibpmXHA7oZR1wd-GMVCKAJKZhJm+BTCk2Q@mail.gmail.com>
Subject: Re: [XEN PATCH v2 13/13] xen: fix violations of MISRA C:2012 Rule 7.2
To: Luca Fancellu <Luca.Fancellu@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, 
	"consulting@bugseng.com" <consulting@bugseng.com>, Gianluca Luparini <gianluca.luparini@bugseng.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, 
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, 
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, Michal Orzel <michal.orzel@amd.com>, 
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Content-Type: multipart/alternative; boundary="00000000000023a16405ffc1c315"

--00000000000023a16405ffc1c315
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Il giorno mer 5 lug 2023 alle ore 18:43 Luca Fancellu <Luca.Fancellu@arm.co=
m>
ha scritto:

>
>
> > On 5 Jul 2023, at 16:26, Simone Ballarin <simone.ballarin@bugseng.com>
> wrote:
> >
> > From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> >
> > The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> > headline states:
> > "A 'u' or 'U' suffix shall be applied to all integer constants
> > that are represented in an unsigned type".
> >
> > Add the 'U' suffix to integers literals with unsigned type and also to
> other
> > literals used in the same contexts or near violations, when their
> positive
> > nature is immediately clear. The latter changes are done for the sake o=
f
> > uniformity.
> >
> > Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> > Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> > ---
> > Changes in v2:
> > - minor change to commit title
> > - change commit message
> > - add '(uint32_t)' in 'muldiv64.c' for consistency
> > - add fix in 'vesa.c'
> > ---
> > xen/common/gunzip.c          |  2 +-
> > xen/common/xmalloc_tlsf.c    |  2 +-
> > xen/drivers/char/ehci-dbgp.c |  4 ++--
> > xen/drivers/video/vesa.c     |  2 +-
> > xen/include/public/memory.h  |  2 +-
> > xen/include/public/sysctl.h  |  4 ++--
> > xen/include/xen/bitops.h     | 10 +++++-----
> > xen/include/xen/cper.h       | 34 +++++++++++++++++-----------------
> > xen/lib/muldiv64.c           |  2 +-
> > 9 files changed, 31 insertions(+), 31 deletions(-)
> >
> > diff --git a/xen/common/gunzip.c b/xen/common/gunzip.c
> > index 71ec5f26be..b810499be2 100644
> > --- a/xen/common/gunzip.c
> > +++ b/xen/common/gunzip.c
> > @@ -11,7 +11,7 @@ static unsigned char *__initdata window;
> > static memptr __initdata free_mem_ptr;
> > static memptr __initdata free_mem_end_ptr;
> >
> > -#define WSIZE           0x80000000
> > +#define WSIZE           0x80000000U
> >
> > static unsigned char *__initdata inbuf;
> > static unsigned int __initdata insize;
> > diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c
> > index 75bdf18c4e..c21bf71e88 100644
> > --- a/xen/common/xmalloc_tlsf.c
> > +++ b/xen/common/xmalloc_tlsf.c
> > @@ -46,7 +46,7 @@
> > #define BHDR_OVERHEAD   (sizeof(struct bhdr) - MIN_BLOCK_SIZE)
> >
> > #define PTR_MASK        (sizeof(void *) - 1)
> > -#define BLOCK_SIZE_MASK (0xFFFFFFFF - PTR_MASK)
> > +#define BLOCK_SIZE_MASK (0xFFFFFFFFU - PTR_MASK)
> >
> > #define GET_NEXT_BLOCK(addr, r) ((struct bhdr *) \
> >                                 ((char *)(addr) + (r)))
> > diff --git a/xen/drivers/char/ehci-dbgp.c b/xen/drivers/char/ehci-dbgp.=
c
> > index bb9d3198d9..4d8d765122 100644
> > --- a/xen/drivers/char/ehci-dbgp.c
> > +++ b/xen/drivers/char/ehci-dbgp.c
> > @@ -375,12 +375,12 @@ static inline u32 dbgp_pid_write_update(u32 x, u3=
2
> tok)
> >     static u8 data0 =3D USB_PID_DATA1;
> >
> >     data0 ^=3D USB_PID_DATA0 ^ USB_PID_DATA1;
> > -    return (x & 0xffff0000) | (data0 << 8) | (tok & 0xff);
> > +    return (x & 0xffff0000U) | (data0 << 8) | (tok & 0xffU);
> > }
> >
> > static inline u32 dbgp_pid_read_update(u32 x, u32 tok)
> > {
> > -    return (x & 0xffffff00) | (tok & 0xff);
> > +    return (x & 0xffffff00U) | (tok & 0xffU);
> > }
> >
> > static inline void dbgp_set_data(struct ehci_dbg_port __iomem
> *ehci_debug,
> > diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c
> > index c41f6b8d40..b007ff5678 100644
> > --- a/xen/drivers/video/vesa.c
> > +++ b/xen/drivers/video/vesa.c
> > @@ -123,7 +123,7 @@ void __init vesa_init(void)
> >     if ( vlfb_info.bits_per_pixel > 8 )
> >     {
> >         /* Light grey in truecolor. */
> > -        unsigned int grey =3D 0xaaaaaaaa;
> > +        unsigned int grey =3D 0xaaaaaaaaU;
> >         lfbp.pixel_on =3D
> >             ((grey >> (32 - vlfb_info.  red_size)) << vlfb_info.
> red_pos) |
> >             ((grey >> (32 - vlfb_info.green_size)) <<
> vlfb_info.green_pos) |
> > diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
> > index c5f0d31e23..5e545ae9a4 100644
> > --- a/xen/include/public/memory.h
> > +++ b/xen/include/public/memory.h
> > @@ -234,7 +234,7 @@ struct xen_add_to_physmap {
> >
> >     unsigned int space; /* =3D> enum phys_map_space */
> >
> > -#define XENMAPIDX_grant_table_status 0x80000000
> > +#define XENMAPIDX_grant_table_status 0x80000000U
> >
> >     /* Index into space being mapped. */
> >     xen_ulong_t idx;
> > diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
> > index 33e86ace51..fa7147de47 100644
> > --- a/xen/include/public/sysctl.h
> > +++ b/xen/include/public/sysctl.h
> > @@ -384,7 +384,7 @@ struct xen_sysctl_pm_op {
> >         struct xen_set_cpufreq_para set_para;
> >         uint64_aligned_t get_avgfreq;
> >         uint32_t                    set_sched_opt_smt;
> > -#define XEN_SYSCTL_CX_UNLIMITED 0xffffffff
> > +#define XEN_SYSCTL_CX_UNLIMITED 0xffffffffU
> >         uint32_t                    get_max_cstate;
> >         uint32_t                    set_max_cstate;
> >     } u;
> > @@ -547,7 +547,7 @@ struct xen_sysctl_numainfo {
> > #define XEN_SYSCTL_CPUPOOL_OP_RMCPU                 5  /* R */
> > #define XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN            6  /* M */
> > #define XEN_SYSCTL_CPUPOOL_OP_FREEINFO              7  /* F */
> > -#define XEN_SYSCTL_CPUPOOL_PAR_ANY     0xFFFFFFFF
> > +#define XEN_SYSCTL_CPUPOOL_PAR_ANY     0xFFFFFFFFU
> > struct xen_sysctl_cpupool_op {
> >     uint32_t op;          /* IN */
> >     uint32_t cpupool_id;  /* IN: CDIARM OUT: CI */
> > diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
> > index 33619a0873..3b7e09a26e 100644
> > --- a/xen/include/xen/bitops.h
> > +++ b/xen/include/xen/bitops.h
> > @@ -227,11 +227,11 @@ static inline __u32 ror32(__u32 word, unsigned in=
t
> shift)
> > }
> >
> > /* base-2 logarithm */
> > -#define __L2(_x)  (((_x) & 0x00000002) ?   1 : 0)
> > -#define __L4(_x)  (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2=
(
> _x))
> > -#define __L8(_x)  (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4=
(
> _x))
> > -#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8=
(
> _x))
> > -#define ilog2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) :
> __L16(_x))
> > +#define __L2(_x)  (((_x) & 0x00000002U) ?   1 : 0)
> > +#define __L4(_x)  (((_x) & 0x0000000cU) ? ( 2 + __L2( (_x)>> 2)) :
> __L2( _x))
> > +#define __L8(_x)  (((_x) & 0x000000f0U) ? ( 4 + __L4( (_x)>> 4)) :
> __L4( _x))
> > +#define __L16(_x) (((_x) & 0x0000ff00U) ? ( 8 + __L8( (_x)>> 8)) :
> __L8( _x))
> > +#define ilog2(_x) (((_x) & 0xffff0000U) ? (16 + __L16((_x)>>16)) :
> __L16(_x))
> >
> > /**
> >  * for_each_set_bit - iterate over every set bit in a memory region
> > diff --git a/xen/include/xen/cper.h b/xen/include/xen/cper.h
> > index f8e5272bc1..71d14faa02 100644
> > --- a/xen/include/xen/cper.h
> > +++ b/xen/include/xen/cper.h
> > @@ -56,7 +56,7 @@ static inline uint64_t cper_next_record_id(void)
> > #define CPER_SIG_RECORD "CPER"
> > #define CPER_SIG_SIZE 4
> > /* Used in signature_end field in struct cper_record_header */
> > -#define CPER_SIG_END 0xffffffff
> > +#define CPER_SIG_END 0xffffffffU
> >
> > /*
> >  * CPER record header revision, used in revision field in struct
> > @@ -80,36 +80,36 @@ static inline uint64_t cper_next_record_id(void)
> >  * Corrected Machine Check
> >  */
> > #define CPER_NOTIFY_CMC \
> > - UUID_LE(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4, \
> > - 0xEB, 0xD4, 0xF8, 0x90)
> > + UUID_LE(0x2DCE8BB1U, 0xBDD7U, 0x450eU, 0xB9U, 0xADU, 0x9CU, 0xF4U, \
> > + 0xEBU, 0xD4U, 0xF8U, 0x90U)
> > /* Corrected Platform Error */
> > #define CPER_NOTIFY_CPE \
> > - UUID_LE(0x4E292F96, 0xD843, 0x4a55, 0xA8, 0xC2, 0xD4, 0x81, \
> > - 0xF2, 0x7E, 0xBE, 0xEE)
> > + UUID_LE(0x4E292F96U, 0xD843U, 0x4a55U, 0xA8U, 0xC2U, 0xD4U, 0x81U, \
> > + 0xF2U, 0x7EU, 0xBEU, 0xEEU)
> > /* Machine Check Exception */
> > #define CPER_NOTIFY_MCE \
> > - UUID_LE(0xE8F56FFE, 0x919C, 0x4cc5, 0xBA, 0x88, 0x65, 0xAB, \
> > - 0xE1, 0x49, 0x13, 0xBB)
> > + UUID_LE(0xE8F56FFEU, 0x919CU, 0x4cc5U, 0xBAU, 0x88U, 0x65U, 0xABU, \
> > + 0xE1U, 0x49U, 0x13U, 0xBBU)
> > /* PCI Express Error */
> > #define CPER_NOTIFY_PCIE \
> > - UUID_LE(0xCF93C01F, 0x1A16, 0x4dfc, 0xB8, 0xBC, 0x9C, 0x4D, \
> > - 0xAF, 0x67, 0xC1, 0x04)
> > + UUID_LE(0xCF93C01FU, 0x1A16U, 0x4dfcU, 0xB8U, 0xBCU, 0x9CU, 0x4DU, \
> > + 0xAFU, 0x67U, 0xC1U, 0x04U)
> > /* INIT Record (for IPF) */
> > #define CPER_NOTIFY_INIT \
> > - UUID_LE(0xCC5263E8, 0x9308, 0x454a, 0x89, 0xD0, 0x34, 0x0B, \
> > - 0xD3, 0x9B, 0xC9, 0x8E)
> > + UUID_LE(0xCC5263E8U, 0x9308U, 0x454aU, 0x89U, 0xD0U, 0x34U, 0x0BU, \
> > + 0xD3U, 0x9BU, 0xC9U, 0x8EU)
> > /* Non-Maskable Interrupt */
> > #define CPER_NOTIFY_NMI \
> > - UUID_LE(0x5BAD89FF, 0xB7E6, 0x42c9, 0x81, 0x4A, 0xCF, 0x24, \
> > - 0x85, 0xD6, 0xE9, 0x8A)
> > + UUID_LE(0x5BAD89FFU, 0xB7E6U, 0x42c9U, 0x81U, 0x4AU, 0xCFU, 0x24U, \
> > + 0x85U, 0xD6U, 0xE9U, 0x8AU)
> > /* BOOT Error Record */
> > #define CPER_NOTIFY_BOOT \
> > - UUID_LE(0x3D61A466, 0xAB40, 0x409a, 0xA6, 0x98, 0xF3, 0x62, \
> > - 0xD4, 0x64, 0xB3, 0x8F)
> > + UUID_LE(0x3D61A466U, 0xAB40U, 0x409aU, 0xA6U, 0x98U, 0xF3U, 0x62U, \
> > + 0xD4U, 0x64U, 0xB3U, 0x8FU)
> > /* DMA Remapping Error */
> > #define CPER_NOTIFY_DMAR \
> > - UUID_LE(0x667DD791, 0xC6B3, 0x4c27, 0x8A, 0x6B, 0x0F, 0x8E, \
> > - 0x72, 0x2D, 0xEB, 0x41)
> > + UUID_LE(0x667DD791U, 0xC6B3U, 0x4c27U, 0x8AU, 0x6BU, 0x0FU, 0x8EU, \
> > + 0x72U, 0x2DU, 0xEBU, 0x41U)
> >
> > /*
> >  * Flags bits definitions for flags in struct cper_record_header
> > diff --git a/xen/lib/muldiv64.c b/xen/lib/muldiv64.c
> > index 78177ce616..e9bacc4c59 100644
> > --- a/xen/lib/muldiv64.c
> > +++ b/xen/lib/muldiv64.c
> > @@ -27,7 +27,7 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)
> >     rh =3D (uint64_t)u.l.high * (uint64_t)b;
> >     rh +=3D (rl >> 32);
> >     res.l.high =3D rh / c;
> > -    res.l.low =3D (((rh % c) << 32) + (rl & 0xffffffff)) / c;
> > +    res.l.low =3D (((rh % c) << 32) + ((uint32_t)rl & 0xffffffffU)) / =
c;
>
> Why the explicit cast on rl? Shouldn=E2=80=99t it work without it?
>
> Yes, the cast is not related to the MISRA rule.
It was requested by Jan in "[XEN PATCH 00/13] xen: fixed violations of
MISRA C:2012 Rule 7.2"
to be more consistent with the surrounding code.


> >
> >     return res.ll;
>


--=20
Simone Ballarin, M.Sc.

Field Application Engineer, BUGSENG (https://bugseng.com
<http://bugseng.com>)

--00000000000023a16405ffc1c315
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">Il giorno mer 5 lug 2023 alle ore 18:=
43 Luca Fancellu &lt;<a href=3D"mailto:Luca.Fancellu@arm.com">Luca.Fancellu=
@arm.com</a>&gt; ha scritto:<br></div><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddi=
ng-left:1ex"><br>
<br>
&gt; On 5 Jul 2023, at 16:26, Simone Ballarin &lt;<a href=3D"mailto:simone.=
ballarin@bugseng.com" target=3D"_blank">simone.ballarin@bugseng.com</a>&gt;=
 wrote:<br>
&gt; <br>
&gt; From: Gianluca Luparini &lt;<a href=3D"mailto:gianluca.luparini@bugsen=
g.com" target=3D"_blank">gianluca.luparini@bugseng.com</a>&gt;<br>
&gt; <br>
&gt; The xen sources contains violations of MISRA C:2012 Rule 7.2 whose<br>
&gt; headline states:<br>
&gt; &quot;A &#39;u&#39; or &#39;U&#39; suffix shall be applied to all inte=
ger constants<br>
&gt; that are represented in an unsigned type&quot;.<br>
&gt; <br>
&gt; Add the &#39;U&#39; suffix to integers literals with unsigned type and=
 also to other<br>
&gt; literals used in the same contexts or near violations, when their posi=
tive<br>
&gt; nature is immediately clear. The latter changes are done for the sake =
of<br>
&gt; uniformity.<br>
&gt; <br>
&gt; Signed-off-by: Simone Ballarin &lt;<a href=3D"mailto:simone.ballarin@b=
ugseng.com" target=3D"_blank">simone.ballarin@bugseng.com</a>&gt;<br>
&gt; Signed-off-by: Gianluca Luparini &lt;<a href=3D"mailto:gianluca.lupari=
ni@bugseng.com" target=3D"_blank">gianluca.luparini@bugseng.com</a>&gt;<br>
&gt; ---<br>
&gt; Changes in v2:<br>
&gt; - minor change to commit title<br>
&gt; - change commit message<br>
&gt; - add &#39;(uint32_t)&#39; in &#39;muldiv64.c&#39; for consistency<br>
&gt; - add fix in &#39;vesa.c&#39;<br>
&gt; ---<br>
&gt; xen/common/gunzip.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 2 +-<br>
&gt; xen/common/xmalloc_tlsf.c=C2=A0 =C2=A0 |=C2=A0 2 +-<br>
&gt; xen/drivers/char/ehci-dbgp.c |=C2=A0 4 ++--<br>
&gt; xen/drivers/video/vesa.c=C2=A0 =C2=A0 =C2=A0|=C2=A0 2 +-<br>
&gt; xen/include/public/memory.h=C2=A0 |=C2=A0 2 +-<br>
&gt; xen/include/public/sysctl.h=C2=A0 |=C2=A0 4 ++--<br>
&gt; xen/include/xen/bitops.h=C2=A0 =C2=A0 =C2=A0| 10 +++++-----<br>
&gt; xen/include/xen/cper.h=C2=A0 =C2=A0 =C2=A0 =C2=A0| 34 ++++++++++++++++=
+-----------------<br>
&gt; xen/lib/muldiv64.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 2 +=
-<br>
&gt; 9 files changed, 31 insertions(+), 31 deletions(-)<br>
&gt; <br>
&gt; diff --git a/xen/common/gunzip.c b/xen/common/gunzip.c<br>
&gt; index 71ec5f26be..b810499be2 100644<br>
&gt; --- a/xen/common/gunzip.c<br>
&gt; +++ b/xen/common/gunzip.c<br>
&gt; @@ -11,7 +11,7 @@ static unsigned char *__initdata window;<br>
&gt; static memptr __initdata free_mem_ptr;<br>
&gt; static memptr __initdata free_mem_end_ptr;<br>
&gt; <br>
&gt; -#define WSIZE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00x80000000<br>
&gt; +#define WSIZE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00x80000000U<br>
&gt; <br>
&gt; static unsigned char *__initdata inbuf;<br>
&gt; static unsigned int __initdata insize;<br>
&gt; diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c<br>
&gt; index 75bdf18c4e..c21bf71e88 100644<br>
&gt; --- a/xen/common/xmalloc_tlsf.c<br>
&gt; +++ b/xen/common/xmalloc_tlsf.c<br>
&gt; @@ -46,7 +46,7 @@<br>
&gt; #define BHDR_OVERHEAD=C2=A0 =C2=A0(sizeof(struct bhdr) - MIN_BLOCK_SIZ=
E)<br>
&gt; <br>
&gt; #define PTR_MASK=C2=A0 =C2=A0 =C2=A0 =C2=A0 (sizeof(void *) - 1)<br>
&gt; -#define BLOCK_SIZE_MASK (0xFFFFFFFF - PTR_MASK)<br>
&gt; +#define BLOCK_SIZE_MASK (0xFFFFFFFFU - PTR_MASK)<br>
&gt; <br>
&gt; #define GET_NEXT_BLOCK(addr, r) ((struct bhdr *) \<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((char *)(addr) + (r)))<br>
&gt; diff --git a/xen/drivers/char/ehci-dbgp.c b/xen/drivers/char/ehci-dbgp=
.c<br>
&gt; index bb9d3198d9..4d8d765122 100644<br>
&gt; --- a/xen/drivers/char/ehci-dbgp.c<br>
&gt; +++ b/xen/drivers/char/ehci-dbgp.c<br>
&gt; @@ -375,12 +375,12 @@ static inline u32 dbgp_pid_write_update(u32 x, u=
32 tok)<br>
&gt;=C2=A0 =C2=A0 =C2=A0static u8 data0 =3D USB_PID_DATA1;<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0data0 ^=3D USB_PID_DATA0 ^ USB_PID_DATA1;<br>
&gt; -=C2=A0 =C2=A0 return (x &amp; 0xffff0000) | (data0 &lt;&lt; 8) | (tok=
 &amp; 0xff);<br>
&gt; +=C2=A0 =C2=A0 return (x &amp; 0xffff0000U) | (data0 &lt;&lt; 8) | (to=
k &amp; 0xffU);<br>
&gt; }<br>
&gt; <br>
&gt; static inline u32 dbgp_pid_read_update(u32 x, u32 tok)<br>
&gt; {<br>
&gt; -=C2=A0 =C2=A0 return (x &amp; 0xffffff00) | (tok &amp; 0xff);<br>
&gt; +=C2=A0 =C2=A0 return (x &amp; 0xffffff00U) | (tok &amp; 0xffU);<br>
&gt; }<br>
&gt; <br>
&gt; static inline void dbgp_set_data(struct ehci_dbg_port __iomem *ehci_de=
bug,<br>
&gt; diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c<br>
&gt; index c41f6b8d40..b007ff5678 100644<br>
&gt; --- a/xen/drivers/video/vesa.c<br>
&gt; +++ b/xen/drivers/video/vesa.c<br>
&gt; @@ -123,7 +123,7 @@ void __init vesa_init(void)<br>
&gt;=C2=A0 =C2=A0 =C2=A0if ( vlfb_info.bits_per_pixel &gt; 8 )<br>
&gt;=C2=A0 =C2=A0 =C2=A0{<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Light grey in truecolor. */<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 unsigned int grey =3D 0xaaaaaaaa;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 unsigned int grey =3D 0xaaaaaaaaU;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0lfbp.pixel_on =3D<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((grey &gt;&gt; (32 - v=
lfb_info.=C2=A0 red_size)) &lt;&lt; vlfb_info.=C2=A0 red_pos) |<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((grey &gt;&gt; (32 - v=
lfb_info.green_size)) &lt;&lt; vlfb_info.green_pos) |<br>
&gt; diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h=
<br>
&gt; index c5f0d31e23..5e545ae9a4 100644<br>
&gt; --- a/xen/include/public/memory.h<br>
&gt; +++ b/xen/include/public/memory.h<br>
&gt; @@ -234,7 +234,7 @@ struct xen_add_to_physmap {<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0unsigned int space; /* =3D&gt; enum phys_map_space =
*/<br>
&gt; <br>
&gt; -#define XENMAPIDX_grant_table_status 0x80000000<br>
&gt; +#define XENMAPIDX_grant_table_status 0x80000000U<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0/* Index into space being mapped. */<br>
&gt;=C2=A0 =C2=A0 =C2=A0xen_ulong_t idx;<br>
&gt; diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h=
<br>
&gt; index 33e86ace51..fa7147de47 100644<br>
&gt; --- a/xen/include/public/sysctl.h<br>
&gt; +++ b/xen/include/public/sysctl.h<br>
&gt; @@ -384,7 +384,7 @@ struct xen_sysctl_pm_op {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct xen_set_cpufreq_para set_para;=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0uint64_aligned_t get_avgfreq;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0uint32_t=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 set_sched_opt_smt;<br>
&gt; -#define XEN_SYSCTL_CX_UNLIMITED 0xffffffff<br>
&gt; +#define XEN_SYSCTL_CX_UNLIMITED 0xffffffffU<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0uint32_t=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 get_max_cstate;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0uint32_t=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 set_max_cstate;<br>
&gt;=C2=A0 =C2=A0 =C2=A0} u;<br>
&gt; @@ -547,7 +547,7 @@ struct xen_sysctl_numainfo {<br>
&gt; #define XEN_SYSCTL_CPUPOOL_OP_RMCPU=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A05=C2=A0 /* R */<br>
&gt; #define XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 6=C2=A0 /* M */<br>
&gt; #define XEN_SYSCTL_CPUPOOL_OP_FREEINFO=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 7=C2=A0 /* F */<br>
&gt; -#define XEN_SYSCTL_CPUPOOL_PAR_ANY=C2=A0 =C2=A0 =C2=A00xFFFFFFFF<br>
&gt; +#define XEN_SYSCTL_CPUPOOL_PAR_ANY=C2=A0 =C2=A0 =C2=A00xFFFFFFFFU<br>
&gt; struct xen_sysctl_cpupool_op {<br>
&gt;=C2=A0 =C2=A0 =C2=A0uint32_t op;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* I=
N */<br>
&gt;=C2=A0 =C2=A0 =C2=A0uint32_t cpupool_id;=C2=A0 /* IN: CDIARM OUT: CI */=
<br>
&gt; diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h<br>
&gt; index 33619a0873..3b7e09a26e 100644<br>
&gt; --- a/xen/include/xen/bitops.h<br>
&gt; +++ b/xen/include/xen/bitops.h<br>
&gt; @@ -227,11 +227,11 @@ static inline __u32 ror32(__u32 word, unsigned i=
nt shift)<br>
&gt; }<br>
&gt; <br>
&gt; /* base-2 logarithm */<br>
&gt; -#define __L2(_x)=C2=A0 (((_x) &amp; 0x00000002) ?=C2=A0 =C2=A01 : 0)<=
br>
&gt; -#define __L4(_x)=C2=A0 (((_x) &amp; 0x0000000c) ? ( 2 + __L2( (_x)&gt=
;&gt; 2)) : __L2( _x))<br>
&gt; -#define __L8(_x)=C2=A0 (((_x) &amp; 0x000000f0) ? ( 4 + __L4( (_x)&gt=
;&gt; 4)) : __L4( _x))<br>
&gt; -#define __L16(_x) (((_x) &amp; 0x0000ff00) ? ( 8 + __L8( (_x)&gt;&gt;=
 8)) : __L8( _x))<br>
&gt; -#define ilog2(_x) (((_x) &amp; 0xffff0000) ? (16 + __L16((_x)&gt;&gt;=
16)) : __L16(_x))<br>
&gt; +#define __L2(_x)=C2=A0 (((_x) &amp; 0x00000002U) ?=C2=A0 =C2=A01 : 0)=
<br>
&gt; +#define __L4(_x)=C2=A0 (((_x) &amp; 0x0000000cU) ? ( 2 + __L2( (_x)&g=
t;&gt; 2)) : __L2( _x))<br>
&gt; +#define __L8(_x)=C2=A0 (((_x) &amp; 0x000000f0U) ? ( 4 + __L4( (_x)&g=
t;&gt; 4)) : __L4( _x))<br>
&gt; +#define __L16(_x) (((_x) &amp; 0x0000ff00U) ? ( 8 + __L8( (_x)&gt;&gt=
; 8)) : __L8( _x))<br>
&gt; +#define ilog2(_x) (((_x) &amp; 0xffff0000U) ? (16 + __L16((_x)&gt;&gt=
;16)) : __L16(_x))<br>
&gt; <br>
&gt; /**<br>
&gt;=C2=A0 * for_each_set_bit - iterate over every set bit in a memory regi=
on<br>
&gt; diff --git a/xen/include/xen/cper.h b/xen/include/xen/cper.h<br>
&gt; index f8e5272bc1..71d14faa02 100644<br>
&gt; --- a/xen/include/xen/cper.h<br>
&gt; +++ b/xen/include/xen/cper.h<br>
&gt; @@ -56,7 +56,7 @@ static inline uint64_t cper_next_record_id(void)<br>
&gt; #define CPER_SIG_RECORD &quot;CPER&quot;<br>
&gt; #define CPER_SIG_SIZE 4<br>
&gt; /* Used in signature_end field in struct cper_record_header */<br>
&gt; -#define CPER_SIG_END 0xffffffff<br>
&gt; +#define CPER_SIG_END 0xffffffffU<br>
&gt; <br>
&gt; /*<br>
&gt;=C2=A0 * CPER record header revision, used in revision field in struct<=
br>
&gt; @@ -80,36 +80,36 @@ static inline uint64_t cper_next_record_id(void)<b=
r>
&gt;=C2=A0 * Corrected Machine Check<br>
&gt;=C2=A0 */<br>
&gt; #define CPER_NOTIFY_CMC \<br>
&gt; - UUID_LE(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4, \<br>
&gt; - 0xEB, 0xD4, 0xF8, 0x90)<br>
&gt; + UUID_LE(0x2DCE8BB1U, 0xBDD7U, 0x450eU, 0xB9U, 0xADU, 0x9CU, 0xF4U, \=
<br>
&gt; + 0xEBU, 0xD4U, 0xF8U, 0x90U)<br>
&gt; /* Corrected Platform Error */<br>
&gt; #define CPER_NOTIFY_CPE \<br>
&gt; - UUID_LE(0x4E292F96, 0xD843, 0x4a55, 0xA8, 0xC2, 0xD4, 0x81, \<br>
&gt; - 0xF2, 0x7E, 0xBE, 0xEE)<br>
&gt; + UUID_LE(0x4E292F96U, 0xD843U, 0x4a55U, 0xA8U, 0xC2U, 0xD4U, 0x81U, \=
<br>
&gt; + 0xF2U, 0x7EU, 0xBEU, 0xEEU)<br>
&gt; /* Machine Check Exception */<br>
&gt; #define CPER_NOTIFY_MCE \<br>
&gt; - UUID_LE(0xE8F56FFE, 0x919C, 0x4cc5, 0xBA, 0x88, 0x65, 0xAB, \<br>
&gt; - 0xE1, 0x49, 0x13, 0xBB)<br>
&gt; + UUID_LE(0xE8F56FFEU, 0x919CU, 0x4cc5U, 0xBAU, 0x88U, 0x65U, 0xABU, \=
<br>
&gt; + 0xE1U, 0x49U, 0x13U, 0xBBU)<br>
&gt; /* PCI Express Error */<br>
&gt; #define CPER_NOTIFY_PCIE \<br>
&gt; - UUID_LE(0xCF93C01F, 0x1A16, 0x4dfc, 0xB8, 0xBC, 0x9C, 0x4D, \<br>
&gt; - 0xAF, 0x67, 0xC1, 0x04)<br>
&gt; + UUID_LE(0xCF93C01FU, 0x1A16U, 0x4dfcU, 0xB8U, 0xBCU, 0x9CU, 0x4DU, \=
<br>
&gt; + 0xAFU, 0x67U, 0xC1U, 0x04U)<br>
&gt; /* INIT Record (for IPF) */<br>
&gt; #define CPER_NOTIFY_INIT \<br>
&gt; - UUID_LE(0xCC5263E8, 0x9308, 0x454a, 0x89, 0xD0, 0x34, 0x0B, \<br>
&gt; - 0xD3, 0x9B, 0xC9, 0x8E)<br>
&gt; + UUID_LE(0xCC5263E8U, 0x9308U, 0x454aU, 0x89U, 0xD0U, 0x34U, 0x0BU, \=
<br>
&gt; + 0xD3U, 0x9BU, 0xC9U, 0x8EU)<br>
&gt; /* Non-Maskable Interrupt */<br>
&gt; #define CPER_NOTIFY_NMI \<br>
&gt; - UUID_LE(0x5BAD89FF, 0xB7E6, 0x42c9, 0x81, 0x4A, 0xCF, 0x24, \<br>
&gt; - 0x85, 0xD6, 0xE9, 0x8A)<br>
&gt; + UUID_LE(0x5BAD89FFU, 0xB7E6U, 0x42c9U, 0x81U, 0x4AU, 0xCFU, 0x24U, \=
<br>
&gt; + 0x85U, 0xD6U, 0xE9U, 0x8AU)<br>
&gt; /* BOOT Error Record */<br>
&gt; #define CPER_NOTIFY_BOOT \<br>
&gt; - UUID_LE(0x3D61A466, 0xAB40, 0x409a, 0xA6, 0x98, 0xF3, 0x62, \<br>
&gt; - 0xD4, 0x64, 0xB3, 0x8F)<br>
&gt; + UUID_LE(0x3D61A466U, 0xAB40U, 0x409aU, 0xA6U, 0x98U, 0xF3U, 0x62U, \=
<br>
&gt; + 0xD4U, 0x64U, 0xB3U, 0x8FU)<br>
&gt; /* DMA Remapping Error */<br>
&gt; #define CPER_NOTIFY_DMAR \<br>
&gt; - UUID_LE(0x667DD791, 0xC6B3, 0x4c27, 0x8A, 0x6B, 0x0F, 0x8E, \<br>
&gt; - 0x72, 0x2D, 0xEB, 0x41)<br>
&gt; + UUID_LE(0x667DD791U, 0xC6B3U, 0x4c27U, 0x8AU, 0x6BU, 0x0FU, 0x8EU, \=
<br>
&gt; + 0x72U, 0x2DU, 0xEBU, 0x41U)<br>
&gt; <br>
&gt; /*<br>
&gt;=C2=A0 * Flags bits definitions for flags in struct cper_record_header<=
br>
&gt; diff --git a/xen/lib/muldiv64.c b/xen/lib/muldiv64.c<br>
&gt; index 78177ce616..e9bacc4c59 100644<br>
&gt; --- a/xen/lib/muldiv64.c<br>
&gt; +++ b/xen/lib/muldiv64.c<br>
&gt; @@ -27,7 +27,7 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c=
)<br>
&gt;=C2=A0 =C2=A0 =C2=A0rh =3D (uint64_t)u.l.high * (uint64_t)b;<br>
&gt;=C2=A0 =C2=A0 =C2=A0rh +=3D (rl &gt;&gt; 32);<br>
&gt;=C2=A0 =C2=A0 =C2=A0res.l.high =3D rh / c;<br>
&gt; -=C2=A0 =C2=A0 res.l.low =3D (((rh % c) &lt;&lt; 32) + (rl &amp; 0xfff=
fffff)) / c;<br>
&gt; +=C2=A0 =C2=A0=C2=A0res.l.low =3D (((rh % c) &lt;&lt; 32) + ((uint32_t=
)rl &amp; 0xffffffffU)) / c;<br>
<br>
Why the explicit cast on rl? Shouldn=E2=80=99t it work without it?<br>
<br></blockquote><div>Yes, the cast is not related to the MISRA rule. <br><=
/div><div>It was requested by Jan in &quot;[XEN PATCH 00/13] xen: fixed vio=
lations of MISRA C:2012 Rule 7.2&quot;<br></div><div>to be more consistent =
with the surrounding code.</div><div><br></div><blockquote class=3D"gmail_q=
uote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,2=
04);padding-left:1ex">
<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0return res.ll; <br>
</blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre=
fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"l=
tr">Simone Ballarin, M.Sc.<br><br><div>Field Application Engineer, BUGSENG =
(<a href=3D"http://bugseng.com" target=3D"_blank">https://bugseng.com</a>)<=
/div></div></div></div>

--00000000000023a16405ffc1c315--


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 19:32:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 19:32:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559495.874505 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH8Ej-0002AR-2S; Wed, 05 Jul 2023 19:32:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559495.874505; Wed, 05 Jul 2023 19:32:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH8Ei-0002AK-VD; Wed, 05 Jul 2023 19:32:24 +0000
Received: by outflank-mailman (input) for mailman id 559495;
 Wed, 05 Jul 2023 19:32:23 +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
 <SRS0=yX3c=CX=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qH8Eh-0002AE-Ly
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 19:32:23 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a8c699f6-1b6a-11ee-8611-37d641c3527e;
 Wed, 05 Jul 2023 21:32:20 +0200 (CEST)
Received: from mail-ua1-f48.google.com (mail-ua1-f48.google.com
 [209.85.222.48])
 by support.bugseng.com (Postfix) with ESMTPSA id 5FFF44EE074E
 for <xen-devel@lists.xenproject.org>; Wed,  5 Jul 2023 21:32:20 +0200 (CEST)
Received: by mail-ua1-f48.google.com with SMTP id
 a1e0cc1a2514c-78701841ccbso2461257241.2
 for <xen-devel@lists.xenproject.org>; Wed, 05 Jul 2023 12:32:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a8c699f6-1b6a-11ee-8611-37d641c3527e
X-Gm-Message-State: ABy/qLakfzGJ6HtExg3W1bh/Zv/dEWWBrF+whXBdcV5+J3+dQ8wcYs7L
	JzSUSD1Q9eM9GJ69eayYJwaAsZefFnkXT7ClPdI=
X-Google-Smtp-Source: APBJJlGxlIKmZmjIA1W24MyIu72ywURag2jAOD8n9kdYasweqCHRoroZfyrYArthz1BIMHXhmNGiR4G+MVr558lboKM=
X-Received: by 2002:a05:6102:7ce:b0:443:5e1a:640b with SMTP id
 y14-20020a05610207ce00b004435e1a640bmr87872vsg.9.1688585539184; Wed, 05 Jul
 2023 12:32:19 -0700 (PDT)
MIME-Version: 1.0
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <76cf70cb43492966fbcf77d7a2d67d90fe0a32d4.1688559115.git.gianluca.luparini@bugseng.com>
 <00B5545B-7564-4AA6-9654-48FB30A074A4@arm.com> <CAFHJcJtgGQXVTJc9ibpmXHA7oZR1wd-GMVCKAJKZhJm+BTCk2Q@mail.gmail.com>
In-Reply-To: <CAFHJcJtgGQXVTJc9ibpmXHA7oZR1wd-GMVCKAJKZhJm+BTCk2Q@mail.gmail.com>
From: Simone Ballarin <simone.ballarin@bugseng.com>
Date: Wed, 5 Jul 2023 21:32:07 +0200
X-Gmail-Original-Message-ID: <CAFHJcJtVDc0q6cZUFdSwB9Koj2HGf67jL=hEWXt38qhQ-F4Bvw@mail.gmail.com>
Message-ID: <CAFHJcJtVDc0q6cZUFdSwB9Koj2HGf67jL=hEWXt38qhQ-F4Bvw@mail.gmail.com>
Subject: Re: [XEN PATCH v2 13/13] xen: fix violations of MISRA C:2012 Rule 7.2
To: Luca Fancellu <Luca.Fancellu@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, 
	"consulting@bugseng.com" <consulting@bugseng.com>, Gianluca Luparini <gianluca.luparini@bugseng.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, 
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, 
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, Michal Orzel <michal.orzel@amd.com>, 
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Content-Type: multipart/alternative; boundary="0000000000003c713505ffc27571"

--0000000000003c713505ffc27571
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Rethinking about it, probably Jan's hint was to add the cast and remove the
&.
I will fix it in the next patch.


Il giorno mer 5 lug 2023 alle ore 20:42 Simone Ballarin <
simone.ballarin@bugseng.com> ha scritto:

>
>
> Il giorno mer 5 lug 2023 alle ore 18:43 Luca Fancellu <
> Luca.Fancellu@arm.com> ha scritto:
>
>>
>>
>> > On 5 Jul 2023, at 16:26, Simone Ballarin <simone.ballarin@bugseng.com>
>> wrote:
>> >
>> > From: Gianluca Luparini <gianluca.luparini@bugseng.com>
>> >
>> > The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
>> > headline states:
>> > "A 'u' or 'U' suffix shall be applied to all integer constants
>> > that are represented in an unsigned type".
>> >
>> > Add the 'U' suffix to integers literals with unsigned type and also to
>> other
>> > literals used in the same contexts or near violations, when their
>> positive
>> > nature is immediately clear. The latter changes are done for the sake =
of
>> > uniformity.
>> >
>> > Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
>> > Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
>> > ---
>> > Changes in v2:
>> > - minor change to commit title
>> > - change commit message
>> > - add '(uint32_t)' in 'muldiv64.c' for consistency
>> > - add fix in 'vesa.c'
>> > ---
>> > xen/common/gunzip.c          |  2 +-
>> > xen/common/xmalloc_tlsf.c    |  2 +-
>> > xen/drivers/char/ehci-dbgp.c |  4 ++--
>> > xen/drivers/video/vesa.c     |  2 +-
>> > xen/include/public/memory.h  |  2 +-
>> > xen/include/public/sysctl.h  |  4 ++--
>> > xen/include/xen/bitops.h     | 10 +++++-----
>> > xen/include/xen/cper.h       | 34 +++++++++++++++++-----------------
>> > xen/lib/muldiv64.c           |  2 +-
>> > 9 files changed, 31 insertions(+), 31 deletions(-)
>> >
>> > diff --git a/xen/common/gunzip.c b/xen/common/gunzip.c
>> > index 71ec5f26be..b810499be2 100644
>> > --- a/xen/common/gunzip.c
>> > +++ b/xen/common/gunzip.c
>> > @@ -11,7 +11,7 @@ static unsigned char *__initdata window;
>> > static memptr __initdata free_mem_ptr;
>> > static memptr __initdata free_mem_end_ptr;
>> >
>> > -#define WSIZE           0x80000000
>> > +#define WSIZE           0x80000000U
>> >
>> > static unsigned char *__initdata inbuf;
>> > static unsigned int __initdata insize;
>> > diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c
>> > index 75bdf18c4e..c21bf71e88 100644
>> > --- a/xen/common/xmalloc_tlsf.c
>> > +++ b/xen/common/xmalloc_tlsf.c
>> > @@ -46,7 +46,7 @@
>> > #define BHDR_OVERHEAD   (sizeof(struct bhdr) - MIN_BLOCK_SIZE)
>> >
>> > #define PTR_MASK        (sizeof(void *) - 1)
>> > -#define BLOCK_SIZE_MASK (0xFFFFFFFF - PTR_MASK)
>> > +#define BLOCK_SIZE_MASK (0xFFFFFFFFU - PTR_MASK)
>> >
>> > #define GET_NEXT_BLOCK(addr, r) ((struct bhdr *) \
>> >                                 ((char *)(addr) + (r)))
>> > diff --git a/xen/drivers/char/ehci-dbgp.c b/xen/drivers/char/ehci-dbgp=
.c
>> > index bb9d3198d9..4d8d765122 100644
>> > --- a/xen/drivers/char/ehci-dbgp.c
>> > +++ b/xen/drivers/char/ehci-dbgp.c
>> > @@ -375,12 +375,12 @@ static inline u32 dbgp_pid_write_update(u32 x,
>> u32 tok)
>> >     static u8 data0 =3D USB_PID_DATA1;
>> >
>> >     data0 ^=3D USB_PID_DATA0 ^ USB_PID_DATA1;
>> > -    return (x & 0xffff0000) | (data0 << 8) | (tok & 0xff);
>> > +    return (x & 0xffff0000U) | (data0 << 8) | (tok & 0xffU);
>> > }
>> >
>> > static inline u32 dbgp_pid_read_update(u32 x, u32 tok)
>> > {
>> > -    return (x & 0xffffff00) | (tok & 0xff);
>> > +    return (x & 0xffffff00U) | (tok & 0xffU);
>> > }
>> >
>> > static inline void dbgp_set_data(struct ehci_dbg_port __iomem
>> *ehci_debug,
>> > diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c
>> > index c41f6b8d40..b007ff5678 100644
>> > --- a/xen/drivers/video/vesa.c
>> > +++ b/xen/drivers/video/vesa.c
>> > @@ -123,7 +123,7 @@ void __init vesa_init(void)
>> >     if ( vlfb_info.bits_per_pixel > 8 )
>> >     {
>> >         /* Light grey in truecolor. */
>> > -        unsigned int grey =3D 0xaaaaaaaa;
>> > +        unsigned int grey =3D 0xaaaaaaaaU;
>> >         lfbp.pixel_on =3D
>> >             ((grey >> (32 - vlfb_info.  red_size)) << vlfb_info.
>> red_pos) |
>> >             ((grey >> (32 - vlfb_info.green_size)) <<
>> vlfb_info.green_pos) |
>> > diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
>> > index c5f0d31e23..5e545ae9a4 100644
>> > --- a/xen/include/public/memory.h
>> > +++ b/xen/include/public/memory.h
>> > @@ -234,7 +234,7 @@ struct xen_add_to_physmap {
>> >
>> >     unsigned int space; /* =3D> enum phys_map_space */
>> >
>> > -#define XENMAPIDX_grant_table_status 0x80000000
>> > +#define XENMAPIDX_grant_table_status 0x80000000U
>> >
>> >     /* Index into space being mapped. */
>> >     xen_ulong_t idx;
>> > diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
>> > index 33e86ace51..fa7147de47 100644
>> > --- a/xen/include/public/sysctl.h
>> > +++ b/xen/include/public/sysctl.h
>> > @@ -384,7 +384,7 @@ struct xen_sysctl_pm_op {
>> >         struct xen_set_cpufreq_para set_para;
>> >         uint64_aligned_t get_avgfreq;
>> >         uint32_t                    set_sched_opt_smt;
>> > -#define XEN_SYSCTL_CX_UNLIMITED 0xffffffff
>> > +#define XEN_SYSCTL_CX_UNLIMITED 0xffffffffU
>> >         uint32_t                    get_max_cstate;
>> >         uint32_t                    set_max_cstate;
>> >     } u;
>> > @@ -547,7 +547,7 @@ struct xen_sysctl_numainfo {
>> > #define XEN_SYSCTL_CPUPOOL_OP_RMCPU                 5  /* R */
>> > #define XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN            6  /* M */
>> > #define XEN_SYSCTL_CPUPOOL_OP_FREEINFO              7  /* F */
>> > -#define XEN_SYSCTL_CPUPOOL_PAR_ANY     0xFFFFFFFF
>> > +#define XEN_SYSCTL_CPUPOOL_PAR_ANY     0xFFFFFFFFU
>> > struct xen_sysctl_cpupool_op {
>> >     uint32_t op;          /* IN */
>> >     uint32_t cpupool_id;  /* IN: CDIARM OUT: CI */
>> > diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
>> > index 33619a0873..3b7e09a26e 100644
>> > --- a/xen/include/xen/bitops.h
>> > +++ b/xen/include/xen/bitops.h
>> > @@ -227,11 +227,11 @@ static inline __u32 ror32(__u32 word, unsigned
>> int shift)
>> > }
>> >
>> > /* base-2 logarithm */
>> > -#define __L2(_x)  (((_x) & 0x00000002) ?   1 : 0)
>> > -#define __L4(_x)  (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) :
>> __L2( _x))
>> > -#define __L8(_x)  (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) :
>> __L4( _x))
>> > -#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) :
>> __L8( _x))
>> > -#define ilog2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) :
>> __L16(_x))
>> > +#define __L2(_x)  (((_x) & 0x00000002U) ?   1 : 0)
>> > +#define __L4(_x)  (((_x) & 0x0000000cU) ? ( 2 + __L2( (_x)>> 2)) :
>> __L2( _x))
>> > +#define __L8(_x)  (((_x) & 0x000000f0U) ? ( 4 + __L4( (_x)>> 4)) :
>> __L4( _x))
>> > +#define __L16(_x) (((_x) & 0x0000ff00U) ? ( 8 + __L8( (_x)>> 8)) :
>> __L8( _x))
>> > +#define ilog2(_x) (((_x) & 0xffff0000U) ? (16 + __L16((_x)>>16)) :
>> __L16(_x))
>> >
>> > /**
>> >  * for_each_set_bit - iterate over every set bit in a memory region
>> > diff --git a/xen/include/xen/cper.h b/xen/include/xen/cper.h
>> > index f8e5272bc1..71d14faa02 100644
>> > --- a/xen/include/xen/cper.h
>> > +++ b/xen/include/xen/cper.h
>> > @@ -56,7 +56,7 @@ static inline uint64_t cper_next_record_id(void)
>> > #define CPER_SIG_RECORD "CPER"
>> > #define CPER_SIG_SIZE 4
>> > /* Used in signature_end field in struct cper_record_header */
>> > -#define CPER_SIG_END 0xffffffff
>> > +#define CPER_SIG_END 0xffffffffU
>> >
>> > /*
>> >  * CPER record header revision, used in revision field in struct
>> > @@ -80,36 +80,36 @@ static inline uint64_t cper_next_record_id(void)
>> >  * Corrected Machine Check
>> >  */
>> > #define CPER_NOTIFY_CMC \
>> > - UUID_LE(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4, \
>> > - 0xEB, 0xD4, 0xF8, 0x90)
>> > + UUID_LE(0x2DCE8BB1U, 0xBDD7U, 0x450eU, 0xB9U, 0xADU, 0x9CU, 0xF4U, \
>> > + 0xEBU, 0xD4U, 0xF8U, 0x90U)
>> > /* Corrected Platform Error */
>> > #define CPER_NOTIFY_CPE \
>> > - UUID_LE(0x4E292F96, 0xD843, 0x4a55, 0xA8, 0xC2, 0xD4, 0x81, \
>> > - 0xF2, 0x7E, 0xBE, 0xEE)
>> > + UUID_LE(0x4E292F96U, 0xD843U, 0x4a55U, 0xA8U, 0xC2U, 0xD4U, 0x81U, \
>> > + 0xF2U, 0x7EU, 0xBEU, 0xEEU)
>> > /* Machine Check Exception */
>> > #define CPER_NOTIFY_MCE \
>> > - UUID_LE(0xE8F56FFE, 0x919C, 0x4cc5, 0xBA, 0x88, 0x65, 0xAB, \
>> > - 0xE1, 0x49, 0x13, 0xBB)
>> > + UUID_LE(0xE8F56FFEU, 0x919CU, 0x4cc5U, 0xBAU, 0x88U, 0x65U, 0xABU, \
>> > + 0xE1U, 0x49U, 0x13U, 0xBBU)
>> > /* PCI Express Error */
>> > #define CPER_NOTIFY_PCIE \
>> > - UUID_LE(0xCF93C01F, 0x1A16, 0x4dfc, 0xB8, 0xBC, 0x9C, 0x4D, \
>> > - 0xAF, 0x67, 0xC1, 0x04)
>> > + UUID_LE(0xCF93C01FU, 0x1A16U, 0x4dfcU, 0xB8U, 0xBCU, 0x9CU, 0x4DU, \
>> > + 0xAFU, 0x67U, 0xC1U, 0x04U)
>> > /* INIT Record (for IPF) */
>> > #define CPER_NOTIFY_INIT \
>> > - UUID_LE(0xCC5263E8, 0x9308, 0x454a, 0x89, 0xD0, 0x34, 0x0B, \
>> > - 0xD3, 0x9B, 0xC9, 0x8E)
>> > + UUID_LE(0xCC5263E8U, 0x9308U, 0x454aU, 0x89U, 0xD0U, 0x34U, 0x0BU, \
>> > + 0xD3U, 0x9BU, 0xC9U, 0x8EU)
>> > /* Non-Maskable Interrupt */
>> > #define CPER_NOTIFY_NMI \
>> > - UUID_LE(0x5BAD89FF, 0xB7E6, 0x42c9, 0x81, 0x4A, 0xCF, 0x24, \
>> > - 0x85, 0xD6, 0xE9, 0x8A)
>> > + UUID_LE(0x5BAD89FFU, 0xB7E6U, 0x42c9U, 0x81U, 0x4AU, 0xCFU, 0x24U, \
>> > + 0x85U, 0xD6U, 0xE9U, 0x8AU)
>> > /* BOOT Error Record */
>> > #define CPER_NOTIFY_BOOT \
>> > - UUID_LE(0x3D61A466, 0xAB40, 0x409a, 0xA6, 0x98, 0xF3, 0x62, \
>> > - 0xD4, 0x64, 0xB3, 0x8F)
>> > + UUID_LE(0x3D61A466U, 0xAB40U, 0x409aU, 0xA6U, 0x98U, 0xF3U, 0x62U, \
>> > + 0xD4U, 0x64U, 0xB3U, 0x8FU)
>> > /* DMA Remapping Error */
>> > #define CPER_NOTIFY_DMAR \
>> > - UUID_LE(0x667DD791, 0xC6B3, 0x4c27, 0x8A, 0x6B, 0x0F, 0x8E, \
>> > - 0x72, 0x2D, 0xEB, 0x41)
>> > + UUID_LE(0x667DD791U, 0xC6B3U, 0x4c27U, 0x8AU, 0x6BU, 0x0FU, 0x8EU, \
>> > + 0x72U, 0x2DU, 0xEBU, 0x41U)
>> >
>> > /*
>> >  * Flags bits definitions for flags in struct cper_record_header
>> > diff --git a/xen/lib/muldiv64.c b/xen/lib/muldiv64.c
>> > index 78177ce616..e9bacc4c59 100644
>> > --- a/xen/lib/muldiv64.c
>> > +++ b/xen/lib/muldiv64.c
>> > @@ -27,7 +27,7 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c=
)
>> >     rh =3D (uint64_t)u.l.high * (uint64_t)b;
>> >     rh +=3D (rl >> 32);
>> >     res.l.high =3D rh / c;
>> > -    res.l.low =3D (((rh % c) << 32) + (rl & 0xffffffff)) / c;
>> > +    res.l.low =3D (((rh % c) << 32) + ((uint32_t)rl & 0xffffffffU)) /=
 c;
>>
>> Why the explicit cast on rl? Shouldn=E2=80=99t it work without it?
>>
>> Yes, the cast is not related to the MISRA rule.
> It was requested by Jan in "[XEN PATCH 00/13] xen: fixed violations of
> MISRA C:2012 Rule 7.2"
> to be more consistent with the surrounding code.
>
>
>> >
>> >     return res.ll;
>>
>
>
> --
> Simone Ballarin, M.Sc.
>
> Field Application Engineer, BUGSENG (https://bugseng.com
> <http://bugseng.com>)
>


--=20
Simone Ballarin, M.Sc.

Field Application Engineer, BUGSENG (https://bugseng.com
<http://bugseng.com>)

--0000000000003c713505ffc27571
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Rethinking about it, probably Jan&#39;s hint was to a=
dd the cast and remove the &amp;.</div><div>I will fix it in the next patch=
.<br></div><br></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=
=3D"gmail_attr">Il giorno mer 5 lug 2023 alle ore 20:42 Simone Ballarin &lt=
;<a href=3D"mailto:simone.ballarin@bugseng.com">simone.ballarin@bugseng.com=
</a>&gt; ha scritto:<br></div><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:=
1ex"><div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_qu=
ote"><div dir=3D"ltr" class=3D"gmail_attr">Il giorno mer 5 lug 2023 alle or=
e 18:43 Luca Fancellu &lt;<a href=3D"mailto:Luca.Fancellu@arm.com" target=
=3D"_blank">Luca.Fancellu@arm.com</a>&gt; ha scritto:<br></div><blockquote =
class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px sol=
id rgb(204,204,204);padding-left:1ex"><br>
<br>
&gt; On 5 Jul 2023, at 16:26, Simone Ballarin &lt;<a href=3D"mailto:simone.=
ballarin@bugseng.com" target=3D"_blank">simone.ballarin@bugseng.com</a>&gt;=
 wrote:<br>
&gt; <br>
&gt; From: Gianluca Luparini &lt;<a href=3D"mailto:gianluca.luparini@bugsen=
g.com" target=3D"_blank">gianluca.luparini@bugseng.com</a>&gt;<br>
&gt; <br>
&gt; The xen sources contains violations of MISRA C:2012 Rule 7.2 whose<br>
&gt; headline states:<br>
&gt; &quot;A &#39;u&#39; or &#39;U&#39; suffix shall be applied to all inte=
ger constants<br>
&gt; that are represented in an unsigned type&quot;.<br>
&gt; <br>
&gt; Add the &#39;U&#39; suffix to integers literals with unsigned type and=
 also to other<br>
&gt; literals used in the same contexts or near violations, when their posi=
tive<br>
&gt; nature is immediately clear. The latter changes are done for the sake =
of<br>
&gt; uniformity.<br>
&gt; <br>
&gt; Signed-off-by: Simone Ballarin &lt;<a href=3D"mailto:simone.ballarin@b=
ugseng.com" target=3D"_blank">simone.ballarin@bugseng.com</a>&gt;<br>
&gt; Signed-off-by: Gianluca Luparini &lt;<a href=3D"mailto:gianluca.lupari=
ni@bugseng.com" target=3D"_blank">gianluca.luparini@bugseng.com</a>&gt;<br>
&gt; ---<br>
&gt; Changes in v2:<br>
&gt; - minor change to commit title<br>
&gt; - change commit message<br>
&gt; - add &#39;(uint32_t)&#39; in &#39;muldiv64.c&#39; for consistency<br>
&gt; - add fix in &#39;vesa.c&#39;<br>
&gt; ---<br>
&gt; xen/common/gunzip.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 2 +-<br>
&gt; xen/common/xmalloc_tlsf.c=C2=A0 =C2=A0 |=C2=A0 2 +-<br>
&gt; xen/drivers/char/ehci-dbgp.c |=C2=A0 4 ++--<br>
&gt; xen/drivers/video/vesa.c=C2=A0 =C2=A0 =C2=A0|=C2=A0 2 +-<br>
&gt; xen/include/public/memory.h=C2=A0 |=C2=A0 2 +-<br>
&gt; xen/include/public/sysctl.h=C2=A0 |=C2=A0 4 ++--<br>
&gt; xen/include/xen/bitops.h=C2=A0 =C2=A0 =C2=A0| 10 +++++-----<br>
&gt; xen/include/xen/cper.h=C2=A0 =C2=A0 =C2=A0 =C2=A0| 34 ++++++++++++++++=
+-----------------<br>
&gt; xen/lib/muldiv64.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 2 +=
-<br>
&gt; 9 files changed, 31 insertions(+), 31 deletions(-)<br>
&gt; <br>
&gt; diff --git a/xen/common/gunzip.c b/xen/common/gunzip.c<br>
&gt; index 71ec5f26be..b810499be2 100644<br>
&gt; --- a/xen/common/gunzip.c<br>
&gt; +++ b/xen/common/gunzip.c<br>
&gt; @@ -11,7 +11,7 @@ static unsigned char *__initdata window;<br>
&gt; static memptr __initdata free_mem_ptr;<br>
&gt; static memptr __initdata free_mem_end_ptr;<br>
&gt; <br>
&gt; -#define WSIZE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00x80000000<br>
&gt; +#define WSIZE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00x80000000U<br>
&gt; <br>
&gt; static unsigned char *__initdata inbuf;<br>
&gt; static unsigned int __initdata insize;<br>
&gt; diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c<br>
&gt; index 75bdf18c4e..c21bf71e88 100644<br>
&gt; --- a/xen/common/xmalloc_tlsf.c<br>
&gt; +++ b/xen/common/xmalloc_tlsf.c<br>
&gt; @@ -46,7 +46,7 @@<br>
&gt; #define BHDR_OVERHEAD=C2=A0 =C2=A0(sizeof(struct bhdr) - MIN_BLOCK_SIZ=
E)<br>
&gt; <br>
&gt; #define PTR_MASK=C2=A0 =C2=A0 =C2=A0 =C2=A0 (sizeof(void *) - 1)<br>
&gt; -#define BLOCK_SIZE_MASK (0xFFFFFFFF - PTR_MASK)<br>
&gt; +#define BLOCK_SIZE_MASK (0xFFFFFFFFU - PTR_MASK)<br>
&gt; <br>
&gt; #define GET_NEXT_BLOCK(addr, r) ((struct bhdr *) \<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((char *)(addr) + (r)))<br>
&gt; diff --git a/xen/drivers/char/ehci-dbgp.c b/xen/drivers/char/ehci-dbgp=
.c<br>
&gt; index bb9d3198d9..4d8d765122 100644<br>
&gt; --- a/xen/drivers/char/ehci-dbgp.c<br>
&gt; +++ b/xen/drivers/char/ehci-dbgp.c<br>
&gt; @@ -375,12 +375,12 @@ static inline u32 dbgp_pid_write_update(u32 x, u=
32 tok)<br>
&gt;=C2=A0 =C2=A0 =C2=A0static u8 data0 =3D USB_PID_DATA1;<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0data0 ^=3D USB_PID_DATA0 ^ USB_PID_DATA1;<br>
&gt; -=C2=A0 =C2=A0 return (x &amp; 0xffff0000) | (data0 &lt;&lt; 8) | (tok=
 &amp; 0xff);<br>
&gt; +=C2=A0 =C2=A0 return (x &amp; 0xffff0000U) | (data0 &lt;&lt; 8) | (to=
k &amp; 0xffU);<br>
&gt; }<br>
&gt; <br>
&gt; static inline u32 dbgp_pid_read_update(u32 x, u32 tok)<br>
&gt; {<br>
&gt; -=C2=A0 =C2=A0 return (x &amp; 0xffffff00) | (tok &amp; 0xff);<br>
&gt; +=C2=A0 =C2=A0 return (x &amp; 0xffffff00U) | (tok &amp; 0xffU);<br>
&gt; }<br>
&gt; <br>
&gt; static inline void dbgp_set_data(struct ehci_dbg_port __iomem *ehci_de=
bug,<br>
&gt; diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c<br>
&gt; index c41f6b8d40..b007ff5678 100644<br>
&gt; --- a/xen/drivers/video/vesa.c<br>
&gt; +++ b/xen/drivers/video/vesa.c<br>
&gt; @@ -123,7 +123,7 @@ void __init vesa_init(void)<br>
&gt;=C2=A0 =C2=A0 =C2=A0if ( vlfb_info.bits_per_pixel &gt; 8 )<br>
&gt;=C2=A0 =C2=A0 =C2=A0{<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Light grey in truecolor. */<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 unsigned int grey =3D 0xaaaaaaaa;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 unsigned int grey =3D 0xaaaaaaaaU;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0lfbp.pixel_on =3D<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((grey &gt;&gt; (32 - v=
lfb_info.=C2=A0 red_size)) &lt;&lt; vlfb_info.=C2=A0 red_pos) |<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((grey &gt;&gt; (32 - v=
lfb_info.green_size)) &lt;&lt; vlfb_info.green_pos) |<br>
&gt; diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h=
<br>
&gt; index c5f0d31e23..5e545ae9a4 100644<br>
&gt; --- a/xen/include/public/memory.h<br>
&gt; +++ b/xen/include/public/memory.h<br>
&gt; @@ -234,7 +234,7 @@ struct xen_add_to_physmap {<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0unsigned int space; /* =3D&gt; enum phys_map_space =
*/<br>
&gt; <br>
&gt; -#define XENMAPIDX_grant_table_status 0x80000000<br>
&gt; +#define XENMAPIDX_grant_table_status 0x80000000U<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0/* Index into space being mapped. */<br>
&gt;=C2=A0 =C2=A0 =C2=A0xen_ulong_t idx;<br>
&gt; diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h=
<br>
&gt; index 33e86ace51..fa7147de47 100644<br>
&gt; --- a/xen/include/public/sysctl.h<br>
&gt; +++ b/xen/include/public/sysctl.h<br>
&gt; @@ -384,7 +384,7 @@ struct xen_sysctl_pm_op {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct xen_set_cpufreq_para set_para;=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0uint64_aligned_t get_avgfreq;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0uint32_t=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 set_sched_opt_smt;<br>
&gt; -#define XEN_SYSCTL_CX_UNLIMITED 0xffffffff<br>
&gt; +#define XEN_SYSCTL_CX_UNLIMITED 0xffffffffU<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0uint32_t=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 get_max_cstate;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0uint32_t=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 set_max_cstate;<br>
&gt;=C2=A0 =C2=A0 =C2=A0} u;<br>
&gt; @@ -547,7 +547,7 @@ struct xen_sysctl_numainfo {<br>
&gt; #define XEN_SYSCTL_CPUPOOL_OP_RMCPU=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A05=C2=A0 /* R */<br>
&gt; #define XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 6=C2=A0 /* M */<br>
&gt; #define XEN_SYSCTL_CPUPOOL_OP_FREEINFO=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 7=C2=A0 /* F */<br>
&gt; -#define XEN_SYSCTL_CPUPOOL_PAR_ANY=C2=A0 =C2=A0 =C2=A00xFFFFFFFF<br>
&gt; +#define XEN_SYSCTL_CPUPOOL_PAR_ANY=C2=A0 =C2=A0 =C2=A00xFFFFFFFFU<br>
&gt; struct xen_sysctl_cpupool_op {<br>
&gt;=C2=A0 =C2=A0 =C2=A0uint32_t op;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* I=
N */<br>
&gt;=C2=A0 =C2=A0 =C2=A0uint32_t cpupool_id;=C2=A0 /* IN: CDIARM OUT: CI */=
<br>
&gt; diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h<br>
&gt; index 33619a0873..3b7e09a26e 100644<br>
&gt; --- a/xen/include/xen/bitops.h<br>
&gt; +++ b/xen/include/xen/bitops.h<br>
&gt; @@ -227,11 +227,11 @@ static inline __u32 ror32(__u32 word, unsigned i=
nt shift)<br>
&gt; }<br>
&gt; <br>
&gt; /* base-2 logarithm */<br>
&gt; -#define __L2(_x)=C2=A0 (((_x) &amp; 0x00000002) ?=C2=A0 =C2=A01 : 0)<=
br>
&gt; -#define __L4(_x)=C2=A0 (((_x) &amp; 0x0000000c) ? ( 2 + __L2( (_x)&gt=
;&gt; 2)) : __L2( _x))<br>
&gt; -#define __L8(_x)=C2=A0 (((_x) &amp; 0x000000f0) ? ( 4 + __L4( (_x)&gt=
;&gt; 4)) : __L4( _x))<br>
&gt; -#define __L16(_x) (((_x) &amp; 0x0000ff00) ? ( 8 + __L8( (_x)&gt;&gt;=
 8)) : __L8( _x))<br>
&gt; -#define ilog2(_x) (((_x) &amp; 0xffff0000) ? (16 + __L16((_x)&gt;&gt;=
16)) : __L16(_x))<br>
&gt; +#define __L2(_x)=C2=A0 (((_x) &amp; 0x00000002U) ?=C2=A0 =C2=A01 : 0)=
<br>
&gt; +#define __L4(_x)=C2=A0 (((_x) &amp; 0x0000000cU) ? ( 2 + __L2( (_x)&g=
t;&gt; 2)) : __L2( _x))<br>
&gt; +#define __L8(_x)=C2=A0 (((_x) &amp; 0x000000f0U) ? ( 4 + __L4( (_x)&g=
t;&gt; 4)) : __L4( _x))<br>
&gt; +#define __L16(_x) (((_x) &amp; 0x0000ff00U) ? ( 8 + __L8( (_x)&gt;&gt=
; 8)) : __L8( _x))<br>
&gt; +#define ilog2(_x) (((_x) &amp; 0xffff0000U) ? (16 + __L16((_x)&gt;&gt=
;16)) : __L16(_x))<br>
&gt; <br>
&gt; /**<br>
&gt;=C2=A0 * for_each_set_bit - iterate over every set bit in a memory regi=
on<br>
&gt; diff --git a/xen/include/xen/cper.h b/xen/include/xen/cper.h<br>
&gt; index f8e5272bc1..71d14faa02 100644<br>
&gt; --- a/xen/include/xen/cper.h<br>
&gt; +++ b/xen/include/xen/cper.h<br>
&gt; @@ -56,7 +56,7 @@ static inline uint64_t cper_next_record_id(void)<br>
&gt; #define CPER_SIG_RECORD &quot;CPER&quot;<br>
&gt; #define CPER_SIG_SIZE 4<br>
&gt; /* Used in signature_end field in struct cper_record_header */<br>
&gt; -#define CPER_SIG_END 0xffffffff<br>
&gt; +#define CPER_SIG_END 0xffffffffU<br>
&gt; <br>
&gt; /*<br>
&gt;=C2=A0 * CPER record header revision, used in revision field in struct<=
br>
&gt; @@ -80,36 +80,36 @@ static inline uint64_t cper_next_record_id(void)<b=
r>
&gt;=C2=A0 * Corrected Machine Check<br>
&gt;=C2=A0 */<br>
&gt; #define CPER_NOTIFY_CMC \<br>
&gt; - UUID_LE(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4, \<br>
&gt; - 0xEB, 0xD4, 0xF8, 0x90)<br>
&gt; + UUID_LE(0x2DCE8BB1U, 0xBDD7U, 0x450eU, 0xB9U, 0xADU, 0x9CU, 0xF4U, \=
<br>
&gt; + 0xEBU, 0xD4U, 0xF8U, 0x90U)<br>
&gt; /* Corrected Platform Error */<br>
&gt; #define CPER_NOTIFY_CPE \<br>
&gt; - UUID_LE(0x4E292F96, 0xD843, 0x4a55, 0xA8, 0xC2, 0xD4, 0x81, \<br>
&gt; - 0xF2, 0x7E, 0xBE, 0xEE)<br>
&gt; + UUID_LE(0x4E292F96U, 0xD843U, 0x4a55U, 0xA8U, 0xC2U, 0xD4U, 0x81U, \=
<br>
&gt; + 0xF2U, 0x7EU, 0xBEU, 0xEEU)<br>
&gt; /* Machine Check Exception */<br>
&gt; #define CPER_NOTIFY_MCE \<br>
&gt; - UUID_LE(0xE8F56FFE, 0x919C, 0x4cc5, 0xBA, 0x88, 0x65, 0xAB, \<br>
&gt; - 0xE1, 0x49, 0x13, 0xBB)<br>
&gt; + UUID_LE(0xE8F56FFEU, 0x919CU, 0x4cc5U, 0xBAU, 0x88U, 0x65U, 0xABU, \=
<br>
&gt; + 0xE1U, 0x49U, 0x13U, 0xBBU)<br>
&gt; /* PCI Express Error */<br>
&gt; #define CPER_NOTIFY_PCIE \<br>
&gt; - UUID_LE(0xCF93C01F, 0x1A16, 0x4dfc, 0xB8, 0xBC, 0x9C, 0x4D, \<br>
&gt; - 0xAF, 0x67, 0xC1, 0x04)<br>
&gt; + UUID_LE(0xCF93C01FU, 0x1A16U, 0x4dfcU, 0xB8U, 0xBCU, 0x9CU, 0x4DU, \=
<br>
&gt; + 0xAFU, 0x67U, 0xC1U, 0x04U)<br>
&gt; /* INIT Record (for IPF) */<br>
&gt; #define CPER_NOTIFY_INIT \<br>
&gt; - UUID_LE(0xCC5263E8, 0x9308, 0x454a, 0x89, 0xD0, 0x34, 0x0B, \<br>
&gt; - 0xD3, 0x9B, 0xC9, 0x8E)<br>
&gt; + UUID_LE(0xCC5263E8U, 0x9308U, 0x454aU, 0x89U, 0xD0U, 0x34U, 0x0BU, \=
<br>
&gt; + 0xD3U, 0x9BU, 0xC9U, 0x8EU)<br>
&gt; /* Non-Maskable Interrupt */<br>
&gt; #define CPER_NOTIFY_NMI \<br>
&gt; - UUID_LE(0x5BAD89FF, 0xB7E6, 0x42c9, 0x81, 0x4A, 0xCF, 0x24, \<br>
&gt; - 0x85, 0xD6, 0xE9, 0x8A)<br>
&gt; + UUID_LE(0x5BAD89FFU, 0xB7E6U, 0x42c9U, 0x81U, 0x4AU, 0xCFU, 0x24U, \=
<br>
&gt; + 0x85U, 0xD6U, 0xE9U, 0x8AU)<br>
&gt; /* BOOT Error Record */<br>
&gt; #define CPER_NOTIFY_BOOT \<br>
&gt; - UUID_LE(0x3D61A466, 0xAB40, 0x409a, 0xA6, 0x98, 0xF3, 0x62, \<br>
&gt; - 0xD4, 0x64, 0xB3, 0x8F)<br>
&gt; + UUID_LE(0x3D61A466U, 0xAB40U, 0x409aU, 0xA6U, 0x98U, 0xF3U, 0x62U, \=
<br>
&gt; + 0xD4U, 0x64U, 0xB3U, 0x8FU)<br>
&gt; /* DMA Remapping Error */<br>
&gt; #define CPER_NOTIFY_DMAR \<br>
&gt; - UUID_LE(0x667DD791, 0xC6B3, 0x4c27, 0x8A, 0x6B, 0x0F, 0x8E, \<br>
&gt; - 0x72, 0x2D, 0xEB, 0x41)<br>
&gt; + UUID_LE(0x667DD791U, 0xC6B3U, 0x4c27U, 0x8AU, 0x6BU, 0x0FU, 0x8EU, \=
<br>
&gt; + 0x72U, 0x2DU, 0xEBU, 0x41U)<br>
&gt; <br>
&gt; /*<br>
&gt;=C2=A0 * Flags bits definitions for flags in struct cper_record_header<=
br>
&gt; diff --git a/xen/lib/muldiv64.c b/xen/lib/muldiv64.c<br>
&gt; index 78177ce616..e9bacc4c59 100644<br>
&gt; --- a/xen/lib/muldiv64.c<br>
&gt; +++ b/xen/lib/muldiv64.c<br>
&gt; @@ -27,7 +27,7 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c=
)<br>
&gt;=C2=A0 =C2=A0 =C2=A0rh =3D (uint64_t)u.l.high * (uint64_t)b;<br>
&gt;=C2=A0 =C2=A0 =C2=A0rh +=3D (rl &gt;&gt; 32);<br>
&gt;=C2=A0 =C2=A0 =C2=A0res.l.high =3D rh / c;<br>
&gt; -=C2=A0 =C2=A0 res.l.low =3D (((rh % c) &lt;&lt; 32) + (rl &amp; 0xfff=
fffff)) / c;<br>
&gt; +=C2=A0 =C2=A0=C2=A0res.l.low =3D (((rh % c) &lt;&lt; 32) + ((uint32_t=
)rl &amp; 0xffffffffU)) / c;<br>
<br>
Why the explicit cast on rl? Shouldn=E2=80=99t it work without it?<br>
<br></blockquote><div>Yes, the cast is not related to the MISRA rule. <br><=
/div><div>It was requested by Jan in &quot;[XEN PATCH 00/13] xen: fixed vio=
lations of MISRA C:2012 Rule 7.2&quot;<br></div><div>to be more consistent =
with the surrounding code.</div><div><br></div><blockquote class=3D"gmail_q=
uote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,2=
04);padding-left:1ex">
<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0return res.ll; <br>
</blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre=
fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"l=
tr">Simone Ballarin, M.Sc.<br><br><div>Field Application Engineer, BUGSENG =
(<a href=3D"http://bugseng.com" target=3D"_blank">https://bugseng.com</a>)<=
/div></div></div></div>
</blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre=
fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"l=
tr">Simone Ballarin, M.Sc.<br><br><div>Field Application Engineer, BUGSENG =
(<a href=3D"http://bugseng.com" target=3D"_blank">https://bugseng.com</a>)<=
/div></div></div>

--0000000000003c713505ffc27571--


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 19:51:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 19:51:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559501.874514 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH8Wz-0004cH-Ib; Wed, 05 Jul 2023 19:51:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559501.874514; Wed, 05 Jul 2023 19:51:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH8Wz-0004cA-Fo; Wed, 05 Jul 2023 19:51:17 +0000
Received: by outflank-mailman (input) for mailman id 559501;
 Wed, 05 Jul 2023 19:51:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qH8Wx-0004c4-No
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 19:51:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH8Wx-0001RR-7O; Wed, 05 Jul 2023 19:51:15 +0000
Received: from 54-240-197-231.amazon.com ([54.240.197.231]
 helo=[192.168.19.213]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qH8Ww-0007Nc-W3; Wed, 05 Jul 2023 19:51:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=KbCa1+EZ3DdEju2DRt6wgavw4F1Rbogq9N2Xe8uoGhA=; b=4QMPFiH3OGLAIn2JxHiADhP6V5
	AVvpeJ4j9aXAe/05VFMdmC2y9wQE79gXo2u8Qd96ORknvouXnwTwQibxaVJQIGZm2HNQkcQuKVy6b
	f8/K5hVYTb20whFiiaF62Tr7DI/3ZQaksR83AuQn6EMVUXsCT7ZoxKhg/8KjGouvs7mI=;
Message-ID: <89814361-c9ff-0ab1-2b44-508ff2fb20f4@xen.org>
Date: Wed, 5 Jul 2023 20:51:12 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 52/52] xen/arm: add Kconfig option CONFIG_HAS_MPU to
 enable MPU system support
Content-Language: en-US
To: Ayan Kumar Halder <ayankuma@amd.com>, Penny Zheng <Penny.Zheng@arm.com>,
 xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-53-Penny.Zheng@arm.com>
 <e88e1685-0ba1-8c2a-9a9a-d9fad631018d@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <e88e1685-0ba1-8c2a-9a9a-d9fad631018d@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 05/07/2023 18:20, Ayan Kumar Halder wrote:
> 
> On 26/06/2023 04:34, Penny Zheng wrote:
>> CAUTION: This message has originated from an External Source. Please 
>> use proper judgment and caution when opening attachments, clicking 
>> links, or responding to this email.
>>
>>
>> Introduce a Kconfig option CONFIG_HAS_MPU to enable MPU architecture
>> support. STATIC_MEMORY, ARCH_MAP_DOMAIN_PAGE and ARM_SECURE_STATE will
>> be selected by MPU system by default. Also, features like, ARM_EFI, are
>> not supported right now.
>>
>> Current MPU system design is only for ARM 64-bit platform.
>>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> ---
>> v3:
>> - select ARCH_MAP_DOMAIN_PAGE and ARM_SECURE_STATE
>> - remove platform-specific config: CONFIG_ARM_V8R
>> ---
>> Â  xen/arch/arm/Kconfig | 14 +++++++++++++-
>> Â  1 file changed, 13 insertions(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>> index 3f67aacbbf..2acdf39ec8 100644
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -62,6 +62,7 @@ source "arch/Kconfig"
>> Â  config HAS_MMU
>> Â Â Â Â Â Â Â Â  bool "Memory Management Unit support in a VMSA system"
>> Â Â Â Â Â Â Â Â  default y
>> +Â Â Â Â Â Â  depends on !HAS_MPU
>> Â Â Â Â Â Â Â Â  select HAS_PAGING_MEMPOOL
>> Â Â Â Â Â Â Â Â  select HAS_PMAP
>> Â Â Â Â Â Â Â Â  select HAS_VMAP
>> @@ -70,6 +71,17 @@ config HAS_MMU
>> Â Â Â Â Â Â Â Â Â Â  a memory system through a set of virtual to physical 
>> address mappings and associated memory
>> Â Â Â Â Â Â Â Â Â Â  properties held in memory-mapped tables known as 
>> translation tables.
>>
>> +config HAS_MPU
>> +Â Â Â Â Â Â  bool "Memory Protection Unit support in a PMSA system"
>> +Â Â Â Â Â Â  default n
>> +Â Â Â Â Â Â  depends on ARM_64
> This will not be true as R52 will support MPU

But the code will not compile until you work is added, correct? If so, I 
think it make sense to depend on ARM_64 for now.

>> +Â Â Â Â Â Â  select ARCH_MAP_DOMAIN_PAGE
>> +Â Â Â Â Â Â  select ARM_SECURE_STATE
> Also, R52 does not support secure state.
>> +Â Â Â Â Â Â  select STATIC_MEMORY
>> +Â Â Â Â Â Â  help
>> +Â Â Â Â Â Â Â Â  The PMSA is based on a Memory Protection Unit (MPU), which 
>> provides a much simpler
>> +Â Â Â Â Â Â Â Â  memory protection scheme than the MMU based VMSA.
>> +
> 
> Instead, I will suggest something like this :-
> 
> config ARM_V8R
>  Â Â Â  bool "ARMv8-R AArch64 architecture support (UNSUPPORTED)" if 
> UNSUPPORTED
>  Â Â Â  default n
>  Â Â Â  select HAS_MPU
>  Â Â Â  select ARM_SECURE_STATE
>  Â Â Â  select STATIC_MEMORY
>  Â Â Â  depends on ARM_64
>  Â Â Â  help
>  Â Â Â Â Â  This option enables Armv8-R profile for Arm64. Enabling this option
>  Â Â Â Â Â  results in selecting MPU.
> 
> 
> So, that later on we can add :-
> 
> config AARCH32_V8R
>  Â Â Â  bool "AArch32 Arm V8R Support (UNSUPPORTED)" if UNSUPPORTED
>  Â Â Â  default n
>  Â Â Â  select HAS_MPU
>  Â Â Â  select STATIC_MEMORY
>  Â Â Â  depends on ARM_32
>  Â Â Â  help
>  Â Â Â Â Â  This option enables Armv8-R profile for Arm32.

I believe the the duplication can be avoided if you write:

config ARM_MPU
       bool "..." if  UNSUPPORTED
       default n
       select ARM_SECURE_STATE if ARM_64
       select STATIC_MEMORY
       help
         ...

Not that I didn't use your proposed name because in the future there 
might be an ArmVx-R and we don't want to rename everything. So a more 
generic name is better.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 20:25:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 20:25:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559507.874524 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH94E-0008Je-7l; Wed, 05 Jul 2023 20:25:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559507.874524; Wed, 05 Jul 2023 20:25:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qH94E-0008JX-58; Wed, 05 Jul 2023 20:25:38 +0000
Received: by outflank-mailman (input) for mailman id 559507;
 Wed, 05 Jul 2023 20:25:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qH94C-0008JN-SS; Wed, 05 Jul 2023 20:25:36 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qH94C-0002YT-L1; Wed, 05 Jul 2023 20:25:36 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qH94C-0000m4-8M; Wed, 05 Jul 2023 20:25:36 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qH94C-0006Og-7r; Wed, 05 Jul 2023 20:25:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=nfUfNfs+MfgPIRlXthWpWQXuyt6fz+7nKylp46OwGSM=; b=ok8qstqIfMIp9YRz2Krr9JTUwV
	rgkdqISmQ8SdM6F7RUTpkXhsqmsjG0u6LiS1ZLupo/tQ81aViZPETSOS9HKDczAM2haxzjllNuG10
	z4Ua4MxPYb6+zKks5ORocuTBypW2ZcfwS4VGR6AE0KeAUK/04sDtGRjfS0btWDnNqyis=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181703-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181703: regressions - trouble: broken/fail/pass
X-Osstest-Failures:
    xen-unstable:test-xtf-amd64-amd64-5:<job status>:broken:regression
    xen-unstable:test-xtf-amd64-amd64-5:host-install(5):broken:regression
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:xen-install:fail:regression
    xen-unstable:test-armhf-armhf-libvirt-qcow2:guest-start:fail:regression
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=5c02dbd0e0adbe6100128345328999876fc78d00
X-Osstest-Versions-That:
    xen=abb1522832bb2ef340a56681d486dce51d2f9971
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 05 Jul 2023 20:25:36 +0000

flight 181703 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181703/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-xtf-amd64-amd64-5          <job status>                 broken
 test-xtf-amd64-amd64-5        5 host-install(5)        broken REGR. vs. 181699
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 7 xen-install fail REGR. vs. 181699
 test-armhf-armhf-libvirt-qcow2 13 guest-start            fail REGR. vs. 181699

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181699
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181699
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181699
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181699
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181699
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181699
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181699
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181699
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181699
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181699
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181699
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  5c02dbd0e0adbe6100128345328999876fc78d00
baseline version:
 xen                  abb1522832bb2ef340a56681d486dce51d2f9971

Last test of basis   181699  2023-07-04 22:38:42 Z    0 days
Testing same since   181703  2023-07-05 10:03:18 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Anthony PERARD <anthony.perard@citrix.com>
  Henry Wang <Henry.Wang@arm.com>
  Jan Beulich <jbeulich@suse.com>
  Jason Andryuk <jandryuk@gmail.com>
  Julien Grall <jgrall@amazon.com>
  Luca Fancellu <luca.fancellu@arm.com>
  Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Penny Zheng <penny.zheng@arm.com>
  Wei Chen <wei.chen@arm.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       broken  
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-xtf-amd64-amd64-5 broken
broken-step test-xtf-amd64-amd64-5 host-install(5)

Not pushing.

(No revision log; it would be 393 lines long.)


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 22:14:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 22:14:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559513.874535 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHAlU-0002d2-Tr; Wed, 05 Jul 2023 22:14:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559513.874535; Wed, 05 Jul 2023 22:14:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHAlU-0002cv-Qh; Wed, 05 Jul 2023 22:14:24 +0000
Received: by outflank-mailman (input) for mailman id 559513;
 Wed, 05 Jul 2023 22:14:22 +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
 <SRS0=NcX8=CX=amd.com=stefano.stabellini@srs-se1.protection.inumbo.net>)
 id 1qHAlS-0002cp-Hg
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 22:14:22 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on2062b.outbound.protection.outlook.com
 [2a01:111:f400:fe59::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4834a5f2-1b81-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 00:14:18 +0200 (CEST)
Received: from BN6PR17CA0028.namprd17.prod.outlook.com (2603:10b6:405:75::17)
 by DS7PR12MB8276.namprd12.prod.outlook.com (2603:10b6:8:da::19) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul
 2023 22:14:14 +0000
Received: from BN8NAM11FT011.eop-nam11.prod.protection.outlook.com
 (2603:10b6:405:75:cafe::c6) by BN6PR17CA0028.outlook.office365.com
 (2603:10b6:405:75::17) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Wed, 5 Jul 2023 22:14:14 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 BN8NAM11FT011.mail.protection.outlook.com (10.13.176.140) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6521.45 via Frontend Transport; Wed, 5 Jul 2023 22:14:14 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 5 Jul
 2023 17:14:14 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 5 Jul
 2023 17:14:13 -0500
Received: from ubuntu-20.04.2-arm64.shared (10.180.168.240) by
 SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.23 via Frontend Transport; Wed, 5 Jul 2023 17:14:12 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4834a5f2-1b81-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=k+W0Kb2ficp/VBipOmN4sUeTKOgaPr4WhKKW524UbdO3IM4u1QBIl9KcrPpH5Q7xzC+lCR33xGFKxUm65QgdAABuKC+g+ujiWKh563O+FHtPFDn70/b4sSOpBawcGEW4ooKILmF92d2KT/xjwhJDbms7TIUZploU8HOPrpUwxPoAk2yCo+5utnR0KZ6BukYBegAg8SlHosDwmsu2o0r4l9Qnt4J5KbDPiXkBC4eAc3/RSLRC5J35y0ptBgpwnOXCBmowZ2DzofPrWQWmweYyLn8v31jSneEpw9dewCBFoKaefgmL3M/2cDMZkKirJmoZ0eaA+rb07S4m2o8IsimI1w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=pGs2kJ4CAC7LFFl5DmSHfm2IFp4VYEn02qim9W/36LA=;
 b=P824jKKAscIcWNHSDcc18Ha3/w3bHtbPg/xNjJOksRq9y2V7Dp+L6LtS0E0UuCBP6nMiCsAln4yfe1KelaoDiq5COa+3RZxAOFebx7QHKsK5Rm1FZwYq2isPbl7k0HD2s0LQZXTEyfhoK7PHPij1d6Ya1sRrQ0aactmYZV1xGUbEBj47lqy/I11dCRmXI2GDwX4s20gMBUR+l9qf4UGsnrrEBnIw6Ad7LIc/eR5czmZxf8LQuKj2+sbWIKizrzYt+6cBFVrDCS/uUCkWsQ03l7MWrkpoH6HYN8iplO6oAPSiI4CtTA45eiVtpXIs8E+CtngmMCNs/LUHqmnA/khedQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=cloud.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=pGs2kJ4CAC7LFFl5DmSHfm2IFp4VYEn02qim9W/36LA=;
 b=A1TbHy91Hf3iTEl9NPnvJDF3W3gQWU6uelYYzpvbcCTVAayCcnD0u23bpXGNla3miu84YB83WzvfBRmm8Kwvr60esDmce8ep+lhWwur2vSzF8zPYDd1JgSCqZXUftolDq67p62WzmwJFOKebcgARHSOCDMtpppPYF4DDXE7XSpc=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Date: Wed, 5 Jul 2023 15:14:11 -0700
From: Stefano Stabellini <stefano.stabellini@amd.com>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: George Dunlap <george.dunlap@cloud.com>
CC: P S <pairspace@gmail.com>, Luca Fancellu <luca.fancellu@arm.com>, "Stefano
 Stabellini" <sstabellini@kernel.org>, "Daniel P. Smith"
	<dpsmith@apertussolutions.com>, Christopher Clark
	<christopher.w.clark@gmail.com>, Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>,
	George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, Henry Wang
	<Henry.Wang@arm.com>, Community Manager <community.manager@xenproject.org>,
	Doug Goldstein <cardoe@cardoe.com>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
In-Reply-To: <CA+zSX=Y3_g_aq4+sDK7CuZajywVqQ4xOrq7hKZ80eUT3uSxzuQ@mail.gmail.com>
Message-ID: <alpine.DEB.2.22.394.2307051436120.761183@ubuntu-linux-20-04-desktop>
References: <8601CDD7-87F7-4FD0-A6E6-BAEAB12E7956@arm.com> <234199F8-DBB1-42B6-9A4C-8800EEF60997@gmail.com> <CA+zSX=Y3_g_aq4+sDK7CuZajywVqQ4xOrq7hKZ80eUT3uSxzuQ@mail.gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="8323329-1866474564-1688593430=:761183"
Content-ID: <alpine.DEB.2.22.394.2307051444270.761183@ubuntu-linux-20-04-desktop>
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN8NAM11FT011:EE_|DS7PR12MB8276:EE_
X-MS-Office365-Filtering-Correlation-Id: 14bda639-a9cf-4c10-328a-08db7da52ac9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	odXU4HITXQVuy54+wCvIfWnDkoUuriICk4vtZmDX/ViIkjsBPs+/e09ShOLZNhlebD07pvZ/8n3hIprvZUKkjnT5bCsoHNeb9Z2dGdK9AUvO52NX81RVX5xL1EpHvr3ne2LrBTAYb25XkvgzvRavCFImzRoyx16HG63nnMoCoYc6OPpVv23+dPBAd346klQTfb/gLpxKWGrO3ponlsdxmO4KiBB94KNACd84IuSS7k7ee2C9JXOfYComptGkYuQd8nrpOnIhKzRlZTVgnsdrDlDEoQu1gDPtg/2ejbxioB12kDLHslWF1NwJx3IHpZEP3YgwM082NaVUrdRsjKt0qFstQauY+E/pbCiBnoxTfW2TUXsBLhY//9/40WTyd08Q2d/ehRXuudK+J7vpkTm8eC0Q4qtEyqgE85+CE7qwIvvEZO4RB4JuNVJ93oaJ3enTkVIdF+A7aqzXukN1zIbg8JxWOGnbdrZCe16ZOa3MApvuIJJRlNxmgFwiNeTOJwmVXxWw48F+qytOctffs9CZJS0zKqjcSEWFC0NyMSXNDzHPkJuXdf+6jszuwh/Hw/DOYsTmlaRvebxu7JT/xG+rdOIkAqeZnh0lPDDJyyOnhoP/LS81zdUJYixZ5TCQKGLGBYlY2E3zBttSTH16qgBjC5ImaSznivQ/svPWxMKVG+BqJsyQmauwGm/STm7EgJaFYd0vbXf0gY3MAPBrH76FUbidhNGqzdTpU6CrdIzk25ZGZq6zxDDDSaP/rrolCPZjxiHAIu6kzRl6zrCwxi4HKiasc9NvU3MHr2N1KRtgCY4=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(7916004)(4636009)(396003)(136003)(346002)(376002)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(40480700001)(8676002)(2906002)(70206006)(8936002)(5660300002)(53546011)(44832011)(26005)(336012)(7416002)(186003)(70586007)(41300700001)(40460700003)(356005)(81166007)(82740400003)(4326008)(426003)(6916009)(83380400001)(316002)(47076005)(36860700001)(54906003)(478600001)(9686003)(82310400005)(86362001)(33964004)(33716001)(32563001)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 22:14:14.3493
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 14bda639-a9cf-4c10-328a-08db7da52ac9
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN8NAM11FT011.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB8276

--8323329-1866474564-1688593430=:761183
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8BIT
Content-ID: <alpine.DEB.2.22.394.2307051444271.761183@ubuntu-linux-20-04-desktop>

On Wed, 5 Jul 2023, George Dunlap wrote:
> On Mon, Jul 3, 2023 at 9:55â€¯PM P S <pairspace@gmail.com> wrote:
>       > On Jul 3, 2023, at 15:45, Luca Fancellu <luca.fancellu@arm.com> wrote:
>       ï»¿>
>       >> On 3 Jul 2023, at 18:48, Stefano Stabellini <sstabellini@kernel.org> wrote:
>       >>
>       >>> On Mon, 3 Jul 2023, Daniel P. Smith wrote:
>       >>> On 7/1/23 11:13, Luca Fancellu wrote:
>       >>>>> On 1 Jul 2023, at 08:53, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>       >>>>>
>       >>>>> On 30/06/2023 10:12 am, Luca Fancellu wrote:
>       >>>>>> The "dom0less" feature was intended to be the feature where a domU
>       >>>>>> domain could be launched without the control domain (Dom0)
>       >>>>>> intervention, however the name seems to suggest that Dom0 cannot
>       >>>>>> be part of the configuration, while instead it's a possible use case.
>       >>>>>>
>       >>>>>> To avoid that, rename the "dom0less" configuration with the name
>       >>>>>> "hyperlaunch", that is less misleading.
>       >>>>>>
>       >>>>>> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
>       >>>>>> ---
>       >>>>>> This is an RFC to get the feeling of the community about the name
>       >>>>>> change, for now it's everything in one patch just to see how it
>       >>>>>> will look like, if there is interest on proceeding into it, I can
>       >>>>>> split in more commit.
>       >>>>>
>       >>>>> Have you discussed this with Dan and Chris at all?Â  You haven't even
>       >>>>> CC'd them.
>       >>>>
>       >>>> No, this rename idea started from a chat during the summit, anyway Julien
>       >>>> promptly add them to the CC, because I forgot.
>       >>>
>       >>> No worries and thank you for considering and taking the time to do this RFC.
>       >>> It is greatly appreciated that there is a strong willingness to have dom0less
>       >>> and hyperlaunch merged.
>       >>>
>       >>>>>
>       >>>>> While there is a lot of end-goal in common between the dom0less and
>       >>>>> hyperlaunch, and that the name dom0less is deeply misleading,
>       >>>>> hyperlaunch is specifically not this.
>       >>>>
>       >>>> Yes Hyperlaunch is more than this, however as I said, with this RFC I would
>       >>>> like
>       >>>> to ear opinions, @Daniel @Christopher could it be a proper name for the
>       >>>> dom0less
>       >>>> feature?
>       >>>
>       >>> As Andy has alluded, hyperlaunch is meant to provide a flexible means to
>       >>> handle domain construction at boot to meet a wide range of possible use cases.
>       >>> One of those use cases is dom0less, so yes, ultimately what dom0less does
>       >>> today will be achievable under hyperlaunch. Our intended approach to align the
>       >>> two implementations is one that is meant to be minimally disruptive, since
>       >>> dom0less is considered a supported (SUPPORT.md) capability. As mentioned, we
>       >>> are greatly appreciative to the openness to adopt the name,
>       >>
>       >> Thanks Daniel!
>       >>
>       >>
>       >>> but a big concern
>       >>> I personally have is the confusion it could cause a general user. A blanket
>       >>> rename would end up with two documents in the docs tree that provide two
>       >>> different explanations of hyperlaunch and two different device tree
>       >>> definitions. So I think a more measured approach should be considered here.
>       >>>
>       >>>> If this patch makes things more difficult for the Hyperlunch serie, Iâ€™m ok
>       >>>> to drop it,
>       >>>> my only aim was just to find a less misleading name for the feature.
>       >>>
>       >>> What I would like to suggest as a good first step would be an update to the
>       >>> dom0less document. Provide a note at the beginning that points to the
>       >>> hyperlaunch design doc as a more general approach that will eventually subsume
>       >>> dom0less. This would provide a gentler transition for exist users of dom0less.
>       >>>
>       >>> If it is not too much, I would also ask, please have a look at the design for
>       >>> boot modules in the series Christopher just posted. The design pulls from the
>       >>> work done by dom0less and expanded upon it. I major step into merging the two
>       >>> capabilities will be to have a common set of structures. Once those are in
>       >>> place, we can move to a common device tree representation, and at that point
>       >>> we would be fairly close, if not at the point of a formal merger of between
>       >>> the two.
>       >>
>       >> At the moment we have a concrete problem with explaining dom0less and
>       >> hyperlaunch to potential new users. Using two different names for a
>       >> similar feature on arm and x86 causes confusion. It is hurting Xen as a
>       >> solution. Personally I already had to switch to use the word
>       >> "hyperlaunch" for everything in my users-facing presentations.
>       >>
>       >> At the summit, we discussed that it would be a good idea to use a single
>       >> name to refer to both features on arm and x86. Given that "dom0less"
>       >> causes additional issues because it makes people think that there is no
>       >> Dom0, the suggestion was to use "hyperlaunch" to refer to both features.
>       >>
>       >> We don't need to 100% align the two implementations and data structures.
>       >> This is not for engineers that are going to look at the specifications
>       >> and improve them. This is for users/customers of Xen that are trying to
>       >> understand what the hypervisor enables them to do. We need to be able to
>       >> show users architecture slides with the same name and explanation on
>       >> both ARM and x86.
>       >>
>       >> I am sure that Daniel and Christopher remember, but for the others on
>       >> this email thread, the name "hyperlaunch" was born exactly to be that:
>       >> the one name to cover both features on ARM and x86 even if they have a
>       >> different implementation. Appended an old email for reference.
>       >>
>       >> Also I agree with Daniel that we need to be careful about the two docs
>       >> under docs/. I think he is right we need to add a paragraph explaining
>       >> the history and a pointer to the other document. Something like:
>       >>
>       >> "Dom0less is the name that was used when initially introducing the
>       >> feature on ARM. Then, the "dom0less" name was retired in favor of
>       >> "hyperlaunch" to avoid confusion (a Dom0 might still be present) and to
>       >> align with x86 (where a similar feature was called hyperlaunch from the
>       >> start)."
>       >
>       > Iâ€™m fully ok to add a section like this pointing to the Hyperlaunch design.
> 
>       _If_ this text is added, please include links/references to the Hyperlaunch wiki page and Hyperlaunch design docs.
> 
>       > @Daniel and @Christopher would it be ok for you or the changes in the serie
>       > are going to be problematic for your future work? In the end itâ€™s just a mechanical
>       > rename, so I guess we just need to agree on naming conventions.
> 
>       Please see the history of trademark litigation about the use of symbolic names to reference similar-but-different artifacts.Â 
>       It is much easier to use the same name to refer to entirely different objects. Historically, confusion arises when a name is
>       used in similar contexts.
> 
>       There is also versioning.Â  Could we refer to dom0less as "Hyperlaunch Version -1"?
> 
>       How about renaming dom0less to "Hyperlaunch Lite"?
> 
> 
> Perhaps it would be helpful if you could explain more clearly your concerns.Â  I take it that you want a name which can be used specifically
> to indicate the full "domB measured boot" functionality that was Daniel and Christopher's original goal, and that you're afraid that using
> plain "Hyperlaunch" for only the "start VMs from Xen on boot" functionality will dilute that?
> 
> The "start VMs from Xen on boot" functionality is the *only* thing that a big chunk of the users of this functionality want;Â  referring to
> it as "Hyperlaunch Lite" or "Hyperlaunch -1" will undermine the value of the functionality.
> 
> What if we use "Measured Hyperlaunch", or "Hyperlaunch Measured Boot" to refer to the full measured boot functionality?

I think this is the best way.


> Or, "Hyperlaunch DT" for "Booting VMs from Xen using Device Tree" (without the involvement of a domB), "Hyperlaunch Boot Domain /
> Hyperlaunch domB" for a more general "domB" functionality, and "Hyperlaunch Measured Boot" for the full functionality (assuming there's
> more to this than simply having a domB involved)?


We need an overarching name to cover the feature "start VMs from Xen on
boot" on both ARM and x86. From my understanding and from the original
emails on the subject, the name "hyperlaunch" was it.

If we want to add extra things on top of "start VMs from Xen on
boot", such as TPM/SecureBoot/etc., I would suggest to call it "Measured
Hyperlaunch" or "Hyperlaunch with Measured Boot".

If you guys feel that we should reserve "Hyperlaunch" for something
else, then we need a new name for the cross-arch feature "start VMs
from Xen on boot".

That is OK, we can come up with another name that has no baggage. Not a
problem. But I don't suggest to go down this route because I think it
will cause confusion as HyperLaunch has both "hyper" and "launch" in its
name that strongly point to "start VMs from Xen on boot". Whatever other
name we could come up for "start VMs from Xen on boot", hyperlaunch will
end up getting confused with it.


We also need a way to distinguish the x86 implementation from the ARM
implementations because there are going to be differences. We'll strive
to align them as much as possible but still we are going to have some
differences in configuration options.

I think we should use "hyperlaunch" as it was intended: the overarching
name to refer to "start VMs from Xen on boot". And we should use
"hyperlaunch x86" and "hyperlaunch ARM" to distiguish between the two
implementations.
--8323329-1866474564-1688593430=:761183--


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 22:26:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 22:26:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559519.874545 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHAx4-0004FG-3L; Wed, 05 Jul 2023 22:26:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559519.874545; Wed, 05 Jul 2023 22:26:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHAx3-0004F9-UE; Wed, 05 Jul 2023 22:26:21 +0000
Received: by outflank-mailman (input) for mailman id 559519;
 Wed, 05 Jul 2023 22:26:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHAx2-0004Ez-V6; Wed, 05 Jul 2023 22:26:20 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHAx2-0005NS-JL; Wed, 05 Jul 2023 22:26:20 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHAx2-00057l-7b; Wed, 05 Jul 2023 22:26:20 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qHAx2-0007bp-71; Wed, 05 Jul 2023 22:26:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=SiWts2Yb4nDynxTbOiYEPETpSl5mF2/+AcUELYHotRc=; b=BEIcCrJc+JDW9mBD0oLhpGXkbB
	32MZeU4m4LtKCuHsk8uG0qbAQMQGjejQsKR0RYNdQSpso7z9R2HcISVRZgnDAUNMQjQijrTq1scIg
	eS2AcDJyGPvjHoPBOsZVptPrketfWf01aJAf4TafV58iJKzItvLDsG0Y5mK3rMTmc7kA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181714-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181714: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=1c139701ebaef5072ccfa5fdafc3bc60c650bb7e
X-Osstest-Versions-That:
    xen=dc5e6082f5b36c4a4008c158b53320699025f895
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 05 Jul 2023 22:26:20 +0000

flight 181714 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181714/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  1c139701ebaef5072ccfa5fdafc3bc60c650bb7e
baseline version:
 xen                  dc5e6082f5b36c4a4008c158b53320699025f895

Last test of basis   181710  2023-07-05 15:00:25 Z    0 days
Testing same since   181714  2023-07-05 20:03:33 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Julien Grall <jgrall@amazon.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   dc5e6082f5..1c139701eb  1c139701ebaef5072ccfa5fdafc3bc60c650bb7e -> smoke


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 22:41:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 22:41:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559525.874554 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHBBa-0006dq-9j; Wed, 05 Jul 2023 22:41:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559525.874554; Wed, 05 Jul 2023 22:41:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHBBa-0006dj-6o; Wed, 05 Jul 2023 22:41:22 +0000
Received: by outflank-mailman (input) for mailman id 559525;
 Wed, 05 Jul 2023 22:41:21 +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
 <SRS0=UsP3=CX=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHBBZ-0006dd-I6
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 22:41:21 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0e1d01d2-1b85-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 00:41:18 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 44408617A8;
 Wed,  5 Jul 2023 22:41:17 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28A45C433C8;
 Wed,  5 Jul 2023 22:41:15 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0e1d01d2-1b85-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688596876;
	bh=5lO1UZwr1QyXUX5X9qJwcmT+eeoq/3hGknbkT7qB0Sk=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=vQ3yxb8k5vJtWOZaak0lKZfinVXALmUL2GrI1zIRfeOrPtAcLNn9fO7kLtmKmpXDF
	 huAx0MIgcShHwGt1Qep9IGZDHA5RnC9K6vNkjkp1ahy+fYu408FTKdpZO8iGqN5HN3
	 C9/dxmJEoH/iRBSaH8JvjxOwTYdHXhnQMnmSBDRC/xLX3tm66BSKG953J7QCIFDcEY
	 asu07R7fe9UDI9l1qc8J7qkiWdHijpw6ZktA7JO19r8VRczLtYtQrF6hl7I8vL/Xqn
	 zBpfgOwrArdo4DLA0iiHIy40w4hH6TOvPgXxV1H3uvfAdmjyjprA3NMUn04kuuMmKR
	 /yizIdDS6tQlg==
Date: Wed, 5 Jul 2023 15:41:10 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
cc: Oleksandr Tyshchenko <olekstysh@gmail.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Juergen Gross <jgross@suse.com>, 
    =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>, 
    Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>, 
    Petr Pavlu <petr.pavlu@suse.com>, 
    "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
    "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, 
    vikram.garhwal@amd.com
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
In-Reply-To: <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
Message-ID: <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
References: <20230621131214.9398-3-petr.pavlu@suse.com> <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com> <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop> <b21398eb-2fb2-4fca-dd90-d2c81d8df1c4@epam.com>
 <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop> <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local> <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com> <ZKQF8qq8Oh5E+Fxx@mail-itl> <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
 <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com> <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; BOUNDARY="8323329-245712701-1688596068=:761183"
Content-ID: <alpine.DEB.2.22.394.2307051527500.761183@ubuntu-linux-20-04-desktop>

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-245712701-1688596068=:761183
Content-Type: text/plain; CHARSET=UTF-8
Content-Transfer-Encoding: 8BIT
Content-ID: <alpine.DEB.2.22.394.2307051527501.761183@ubuntu-linux-20-04-desktop>

On Wed, 5 Jul 2023, Roger Pau MonnÃ© wrote:
> On Tue, Jul 04, 2023 at 08:14:59PM +0300, Oleksandr Tyshchenko wrote:
> > On Tue, Jul 4, 2023 at 5:49â€¯PM Roger Pau MonnÃ© <roger.pau@citrix.com> wrote:
> > 
> > Hello all.
> > 
> > [sorry for the possible format issues]
> > 
> > 
> > On Tue, Jul 04, 2023 at 01:43:46PM +0200, Marek Marczykowski-GÃ³recki wrote:
> > > > Hi,
> > > >
> > > > FWIW, I have ran into this issue some time ago too. I run Xen on top of
> > > > KVM and then passthrough some of the virtio devices (network one
> > > > specifically) into a (PV) guest. So, I hit both cases, the dom0 one and
> > > > domU one. As a temporary workaround I needed to disable
> > > > CONFIG_XEN_VIRTIO completely (just disabling
> > > > CONFIG_XEN_VIRTIO_FORCE_GRANT was not enough to fix it).
> > > > With that context in place, the actual response below.
> > > >
> > > > On Tue, Jul 04, 2023 at 12:39:40PM +0200, Juergen Gross wrote:
> > > > > On 04.07.23 09:48, Roger Pau MonnÃ© wrote:
> > > > > > On Thu, Jun 29, 2023 at 03:44:04PM -0700, Stefano Stabellini wrote:
> > > > > > > On Thu, 29 Jun 2023, Oleksandr Tyshchenko wrote:
> > > > > > > > On 29.06.23 04:00, Stefano Stabellini wrote:
> > > > > > > > > I think we need to add a second way? It could be anything that
> > > can help
> > > > > > > > > us distinguish between a non-grants-capable virtio backend and
> > > a
> > > > > > > > > grants-capable virtio backend, such as:
> > > > > > > > > - a string on xenstore
> > > > > > > > > - a xen param
> > > > > > > > > - a special PCI configuration register value
> > > > > > > > > - something in the ACPI tables
> > > > > > > > > - the QEMU machine type
> > > > > > > >
> > > > > > > >
> > > > > > > > Yes, I remember there was a discussion regarding that. The point
> > > is to
> > > > > > > > choose a solution to be functional for both PV and HVM *and* to
> > > be able
> > > > > > > > to support a hotplug. IIRC, the xenstore could be a possible
> > > candidate.
> > > > > > >
> > > > > > > xenstore would be among the easiest to make work. The only
> > > downside is
> > > > > > > the dependency on xenstore which otherwise virtio+grants doesn't
> > > have.
> > > > > >
> > > > > > I would avoid introducing a dependency on xenstore, if nothing else
> > > we
> > > > > > know it's a performance bottleneck.
> > > > > >
> > > > > > We would also need to map the virtio device topology into xenstore,
> > > so
> > > > > > that we can pass different options for each device.
> > > > >
> > > > > This aspect (different options) is important. How do you want to pass
> > > virtio
> > > > > device configuration parameters from dom0 to the virtio backend
> > > domain? You
> > > > > probably need something like Xenstore (a virtio based alternative like
> > > virtiofs
> > > > > would work, too) for that purpose.
> > > > >
> > > > > Mapping the topology should be rather easy via the PCI-Id, e.g.:
> > > > >
> > > > > /local/domain/42/device/virtio/0000:00:1c.0/backend
> > > >
> > > > While I agree this would probably be the simplest to implement, I don't
> > > > like introducing xenstore dependency into virtio frontend either.
> > > > Toolstack -> backend communication is probably easier to solve, as it's
> > > > much more flexible (could use qemu cmdline, QMP, other similar
> > > > mechanisms for non-qemu backends etc).
> > >
> > > I also think features should be exposed uniformly for devices, it's at
> > > least weird to have certain features exposed in the PCI config space
> > > while other features exposed in xenstore.
> > >
> > > For virtio-mmio this might get a bit confusing, are we going to add
> > > xenstore entries based on the position of the device config mmio
> > > region?
> > >
> > > I think on Arm PCI enumeration is not (usually?) done by the firmware,
> > > at which point the SBDF expected by the tools/backend might be
> > > different than the value assigned by the guest OS.
> > >
> > > I think there are two slightly different issues, one is how to pass
> > > information to virtio backends, I think doing this initially based on
> > > xenstore is not that bad, because it's an internal detail of the
> > > backend implementation. However passing information to virtio
> > > frontends using xenstore is IMO a bad idea, there's already a way to
> > > negotiate features between virtio frontends and backends, and Xen
> > > should just expand and use that.
> > >
> > >
> > 
> > On Arm with device-tree we have a special bindings which purpose is to
> > inform us whether we need to use grants for virtio and backend domid for a
> > particular device.Here on x86, we don't have a device tree, so cannot
> > (easily?) reuse this logic.
> > 
> > I have just recollected one idea suggested by Stefano some time ago [1].
> > The context of discussion was about what to do when device-tree and ACPI
> > cannot be reused (or something like that).The idea won't cover virtio-mmio,
> > but I have heard that virtio-mmio usage with x86 Xen is rather unusual case.
> > 
> > I will paste the text below for convenience.

Thanks Oleksandr! I had forgotten about this, but in retrospect it was a
good suggestion :-D


> > **********
> > 
> > Part 1 (intro):
> > 
> > We could reuse a PCI config space register to expose the backend id.
> > However this solution requires a backend change (QEMU) to expose the
> > backend id via an emulated register for each emulated device.
> > 
> > To avoid having to introduce a special config space register in all
> > emulated PCI devices (virtio-net, virtio-block, etc) I wonder if we
> > could add a special PCI config space register at the emulated PCI Root
> > Complex level.
> > 
> > Basically the workflow would be as follow:
> > 
> > - Linux recognizes the PCI Root Complex as a Xen PCI Root Complex
> > - Linux writes to special PCI config space register of the Xen PCI Root
> >   Complex the PCI device id (basically the BDF)
> > - The Xen PCI Root Complex emulated by Xen answers by writing back to
> >   the same location the backend id (domid of the backend)
> > - Linux reads back the same PCI config space register of the Xen PCI
> >   Root Complex and learn the relevant domid
> 
> IMO this seems awfully complex.  I'm not familiar with the VirtIO
> spec, but I see there's a Vendor data capability, could we possibly
> expose Xen-specific information on that capability?

That is also a possibility too. Also we could use a PCI conf register
which is known to be unused in the Virtio spec to expose the grant
capability and backend domid.


> > Part 2 (clarification):
> > 
> > I think using a special config space register in the root complex would
> > not be terrible in terms of guest changes because it is easy to
> > introduce a new root complex driver in Linux and other OSes. The root
> > complex would still be ECAM compatible so the regular ECAM driver would
> > still work. A new driver would only be necessary if you want to be able
> > to access the special config space register.
> 
> I'm slightly worry of this approach, we end up modifying a root
> complex emulation in order to avoid modifying a PCI device emulation
> on QEMU, not sure that's a good trade off.
> 
> Note also that different architectures will likely have different root
> complex, and so you might need to modify several of them, plus then
> arrange the PCI layout correctly in order to have the proper hierarchy
> so that devices belonging to different driver domains are assigned to
> different bridges.

I do think that adding something to the PCI conf register somewhere is
the best option because it is not dependent on ACPI and it is not
dependent on xenstore both of which are very undesirable.

I am not sure where specifically is the best place. These are 3 ideas
we came up with:
1. PCI root complex
2. a register on the device itself
3. a new capability of the device
4. add one extra dummy PCI device for the sole purpose of exposing the
   grants capability


Looking at the spec, there is a way to add a vendor-specific capability
(cap_vndr = 0x9). Could we use that? It doesn't look like it is used
today, Linux doesn't parse it.


> > 
> > 
> > **********
> > What do you think about it? Are there any pitfalls, etc? This also requires
> > system changes, but at least without virtio spec changes.
> 
> Why are we so reluctant to add spec changes?  I understand this might
> take time an effort, but it's the only way IMO to build a sustainable
> VirtIO Xen implementation.  Did we already attempt to negotiate with
> Oasis Xen related spec changes and those where refused?

That's because spec changes can be very slow. This is a bug that we need
a relatively quick solution for and waiting 12-24 months for a spec
update is not realistic.

I think a spec change would be best as a long term solution. We also
need a short term solution. The short term solution doesn't have to be
ideal but it has to work now.
--8323329-245712701-1688596068=:761183--


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 22:49:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 22:49:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559529.874564 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHBJh-0007IG-2l; Wed, 05 Jul 2023 22:49:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559529.874564; Wed, 05 Jul 2023 22:49:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHBJh-0007I9-0C; Wed, 05 Jul 2023 22:49:45 +0000
Received: by outflank-mailman (input) for mailman id 559529;
 Wed, 05 Jul 2023 22:49:44 +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
 <SRS0=UsP3=CX=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHBJg-0007I3-7K
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 22:49:44 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3a386f12-1b86-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 00:49:42 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 9EC93615CB;
 Wed,  5 Jul 2023 22:49:40 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9626EC433C8;
 Wed,  5 Jul 2023 22:49:38 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3a386f12-1b86-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688597380;
	bh=amol4WjrB6hlMYel/91lmijSHoW3Wrghh5fod2Q4kMA=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=LMSxJr/LPJ7gnd7KDmhmhsUkLH5pDkq6N5aeHo0Gyji4r4G1D2P6mfsaMFLILeH7L
	 ghY9xKqVswzCG+48MIh+g++74afsD3XI32Z9x5O3Et4YK0bxshUV2t7GSsJmYHkp6d
	 tlBSR99Sl044OtMwccwGQxd1kJbn1crcgwlhyKeCXniqjgCVjI92Pjj7LItgReuw6d
	 wKVOTGOLdBGB2N3kYWytcJif2QZjhuFJkFBh7j8kGb3TYAF5XHHRF3Gd8zElFjLtrh
	 Hg4wCV21AHtN5e47qEGYb3xx2fJdXBZRzv+q8xqCF1EMwcwe0n3u9Hz0BZN3Dg+0l3
	 RaFsNMbmYiUbQ==
Date: Wed, 5 Jul 2023 15:49:36 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    Federico Serafini <federico.serafini@bugseng.com>, 
    xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <xenia.ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH 4/5] x86/x86_emulate: change parameter name from 's'
 to 'state'
In-Reply-To: <e7af3c85-92ec-7d0f-0e63-3a1e5d65877e@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307051544340.761183@ubuntu-linux-20-04-desktop>
References: <cover.1688049494.git.federico.serafini@bugseng.com> <8c8bc96b96a1111a4651f970f506d304809ea40d.1688049495.git.federico.serafini@bugseng.com> <alpine.DEB.2.22.394.2306291230500.3936094@ubuntu-linux-20-04-desktop>
 <e7af3c85-92ec-7d0f-0e63-3a1e5d65877e@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 4 Jul 2023, Jan Beulich wrote:
> On 29.06.2023 21:31, Stefano Stabellini wrote:
> > On Thu, 29 Jun 2023, Federico Serafini wrote:
> >> Change parameter name from 's' to 'state' in function definitions in
> >> order to:
> >> 1) keep consistency with the parameter names used in the corresponding
> >>    declarations;
> >> 2) keep consistency with parameter names used within x86_emulate.h;
> >> 3) fix violations of MISRA C:2012 Rule 8.3.
> >>
> >> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> > 
> > You could use x86emul: as tag in the title. I'll let Jan choose the tag
> > he prefers.
> 
> x86emul: or x86/emul: is what we commonly use. That said, I don't like
> this change. The files touched are pretty new, and it was deliberate
> that I used s, not state, for the names. This is shorthand much like
> (globally) we use v (instead of vcpu) and d (instead of domain).

Are you suggesting that the functions changed in this patch should be
adapted in the other direction instead?  Meaning that the declaration is
changed to match the definition instead of the opposite?

If so, are you referring to all the functions changed in this patch? Or
only some?

I am asking so that Federico can know how to proceed exactly.


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 22:52:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 22:52:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559533.874574 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHBLn-0000GZ-EZ; Wed, 05 Jul 2023 22:51:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559533.874574; Wed, 05 Jul 2023 22:51:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHBLn-0000GS-Bi; Wed, 05 Jul 2023 22:51:55 +0000
Received: by outflank-mailman (input) for mailman id 559533;
 Wed, 05 Jul 2023 22:51:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=UsP3=CX=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHBLm-0000GL-3x
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 22:51:54 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 884cca92-1b86-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 00:51:53 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id D56AE617D6;
 Wed,  5 Jul 2023 22:51:51 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2FA7C433C8;
 Wed,  5 Jul 2023 22:51:48 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 884cca92-1b86-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688597511;
	bh=vO7Yl7m+q7JdSQZRp1hY/N+jE5J0w5UZvs6BPOLE1Dc=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=JpMkTzSPcqp1mdq1TJsJLc6tvJpWZ49VyoiKXeM73qlCChloKr+O/H5Ax2Lg44bA+
	 DPjIlnh/AjB4TYjjMSIQ+Y5wokjMwZ1lh6gMxe7meQjUh6IACM0Jnv1AtsNA/lEszz
	 lv2M9uAXFtC8ryfnoMerYT52VldpFGjAaJVsP2vZVoIVKpub8H/fbxtPJ+ygf7IB8C
	 MH5onCuHX3c/5PQ6nZbYzyqYGbT2vcFqLfCKCk7Dw1wTpH4jk4fYuhf7WU5oUhZkrF
	 jGzbUh0aZReFDTOgeTGt1inIZoZ8BQIGlzoB3tVesImJudpUtMxI1OQfMKnY2Bf+dP
	 EWRASsxDT98NQ==
Date: Wed, 5 Jul 2023 15:51:47 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Federico Serafini <federico.serafini@bugseng.com>, consulting@bugseng.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Paul Durrant <paul@xen.org>, 
    Tamas K Lengyel <tamas@tklengyel.com>, 
    Alexandru Isaila <aisaila@bitdefender.com>, 
    Petre Pircalabu <ppircalabu@bitdefender.com>, 
    Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <xenia.ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>, 
    xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH 5/5] x86: make parameter names of function declarations
 consistent
In-Reply-To: <0076f2d6-03b7-0a1c-c423-1f55b7195407@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307051550070.761183@ubuntu-linux-20-04-desktop>
References: <cover.1688049494.git.federico.serafini@bugseng.com> <5ee57d7bcd79daa0314f182ecb73e1eb6d8ecc03.1688049495.git.federico.serafini@bugseng.com> <0076f2d6-03b7-0a1c-c423-1f55b7195407@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 4 Jul 2023, Jan Beulich wrote:
> On 29.06.2023 17:55, Federico Serafini wrote:
> > --- a/xen/arch/x86/cpu/mcheck/mce.h
> > +++ b/xen/arch/x86/cpu/mcheck/mce.h
> > @@ -44,7 +44,7 @@ extern uint8_t cmci_apic_vector;
> >  extern bool lmce_support;
> >  
> >  /* Init functions */
> > -enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *c);
> > +enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *ci);
> 
> Supported even by ...
> 
> >  enum mcheck_type intel_mcheck_init(struct cpuinfo_x86 *c, bool bsp);
> 
> ... immediate context, c is the name we use for parameters of this type.
> You want to change the definition in such cases instead of the
> declaration.
> 
> I also think this patch could do with splitting, not the least to
> reduce the Cc list(s) needed.

This is a very large patch but it is entirely mechanical (good!)

How would you see it split? By individual files (too many in my
opinion), or maybe by directory? By directory it would be something
like:

xen/arch/x86/cpu/mcheck
xen/arch/x86/hvm
xen/arch/x86/include/asm



From xen-devel-bounces@lists.xenproject.org Wed Jul 05 22:53:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 22:53:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559537.874585 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHBMs-0000oV-Oo; Wed, 05 Jul 2023 22:53:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559537.874585; Wed, 05 Jul 2023 22:53:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHBMs-0000oM-Le; Wed, 05 Jul 2023 22:53:02 +0000
Received: by outflank-mailman (input) for mailman id 559537;
 Wed, 05 Jul 2023 22:53:01 +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
 <SRS0=UsP3=CX=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHBMr-0000oG-Sg
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 22:53:01 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b0352e9f-1b86-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 00:52:59 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 95766617C9;
 Wed,  5 Jul 2023 22:52:58 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6BD0C433C7;
 Wed,  5 Jul 2023 22:52:55 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b0352e9f-1b86-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688597578;
	bh=iGnBfSz0mj7OxHHYqpq7lHKTkUFEI66UzH2HHcb/G7w=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=QHc0u8cbK2oF1vekwuLvuc/qe7EKS0jeevpK++nrfKVz9YvWyHPcnzUT4ODg3iMaG
	 O0H4G2SFX2KTPL6kMOp5ndOD4IOt83vEAcEfwTjJWBr4mDiAp/iU+M371I7DTUFsA4
	 ASvAEbM0bV7VZGfxLAjutPtwI/kCOO4k2I7i5i++QTSUsDOa7Zq9cwgL7PFXW7IlKj
	 qujpkFhpqSuQYzUJtVYz93FN84M2+EmU9LZoar2xQ30iIx9QVIMHzBkdVLQHHl0NFS
	 504WvTC+vRBekIsAm8nPGhTgbylE375IO40+kiHUNCc1YU4F/GZNstx61vZVTkSv5R
	 rCy/Uh3f6r7cw==
Date: Wed, 5 Jul 2023 15:52:54 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Stefano Stabellini <sstabellini@kernel.org>
cc: Jan Beulich <jbeulich@suse.com>, 
    Federico Serafini <federico.serafini@bugseng.com>, consulting@bugseng.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Paul Durrant <paul@xen.org>, 
    Tamas K Lengyel <tamas@tklengyel.com>, 
    Alexandru Isaila <aisaila@bitdefender.com>, 
    Petre Pircalabu <ppircalabu@bitdefender.com>, 
    Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <xenia.ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>, 
    xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH 5/5] x86: make parameter names of function declarations
 consistent
In-Reply-To: <alpine.DEB.2.22.394.2307051550070.761183@ubuntu-linux-20-04-desktop>
Message-ID: <alpine.DEB.2.22.394.2307051552080.761183@ubuntu-linux-20-04-desktop>
References: <cover.1688049494.git.federico.serafini@bugseng.com> <5ee57d7bcd79daa0314f182ecb73e1eb6d8ecc03.1688049495.git.federico.serafini@bugseng.com> <0076f2d6-03b7-0a1c-c423-1f55b7195407@suse.com>
 <alpine.DEB.2.22.394.2307051550070.761183@ubuntu-linux-20-04-desktop>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 5 Jul 2023, Stefano Stabellini wrote:
> On Tue, 4 Jul 2023, Jan Beulich wrote:
> > On 29.06.2023 17:55, Federico Serafini wrote:
> > > --- a/xen/arch/x86/cpu/mcheck/mce.h
> > > +++ b/xen/arch/x86/cpu/mcheck/mce.h
> > > @@ -44,7 +44,7 @@ extern uint8_t cmci_apic_vector;
> > >  extern bool lmce_support;
> > >  
> > >  /* Init functions */
> > > -enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *c);
> > > +enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *ci);
> > 
> > Supported even by ...
> > 
> > >  enum mcheck_type intel_mcheck_init(struct cpuinfo_x86 *c, bool bsp);
> > 
> > ... immediate context, c is the name we use for parameters of this type.
> > You want to change the definition in such cases instead of the
> > declaration.

I should add that if we are going to change some functions in the other
direction then it would be best to move those changes in a separate
patch to make it easier to review.


> > I also think this patch could do with splitting, not the least to
> > reduce the Cc list(s) needed.
> 
> This is a very large patch but it is entirely mechanical (good!)
> 
> How would you see it split? By individual files (too many in my
> opinion), or maybe by directory? By directory it would be something
> like:
> 
> xen/arch/x86/cpu/mcheck
> xen/arch/x86/hvm
> xen/arch/x86/include/asm
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 22:56:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 22:56:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559543.874594 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHBPl-0001VZ-8i; Wed, 05 Jul 2023 22:56:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559543.874594; Wed, 05 Jul 2023 22:56:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHBPl-0001VS-69; Wed, 05 Jul 2023 22:56:01 +0000
Received: by outflank-mailman (input) for mailman id 559543;
 Wed, 05 Jul 2023 22:55:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=UsP3=CX=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHBPj-0001VF-CJ
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 22:55:59 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1a7483f2-1b87-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 00:55:58 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id EBD5C617D6;
 Wed,  5 Jul 2023 22:55:56 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 471D4C433C7;
 Wed,  5 Jul 2023 22:55:55 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1a7483f2-1b87-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688597756;
	bh=iCjXfAWyaodspGZXjz4PHtjmYjcAp7/azNCHO+AfHcY=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=cwZJT0tbs4kGnZrXzrpb6/3vO+ScZnIdtP++dF0SEN5jDVosDTR80ab8JbVlceeey
	 mSM/9uLWBSyZjwjhiKNQ4/VfnNP6wWSfjOUtlXd5J5nsCBoDeXiV2u3cD9bndh9uJx
	 D1QrvVZxDLp4xK/QCNTFlq8MCzYJrq/3ynAJGENkvn6EBvaRaoDXN7fT6z5n0d8Q1O
	 Dqg0WsgQeJt+zhyoHbUNRcdkghmdUW8y8IZOzs/Z/M+1RsZjuYrO0H7/3O010dJQrv
	 OfBBT1arWr7pdf+qSowfEtTkoopeHW1J8O6lk/DP9nyAPkFvKSJkkuJHuh0OnwtJLP
	 dJ+e3tUwmNUVg==
Date: Wed, 5 Jul 2023 15:55:53 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Oleksandr Tyshchenko <olekstysh@gmail.com>
cc: xen-devel@lists.xenproject.org, 
    Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
    Bertrand Marquis <bertrand.marquis@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH] iommu/ipmmu-vmsa: Add missing 'U' in IMTTLBR0_TTBR_MASK
 for shifted constant
In-Reply-To: <20230704203032.4062921-1-olekstysh@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2307051555460.761183@ubuntu-linux-20-04-desktop>
References: <20230704203032.4062921-1-olekstysh@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 4 Jul 2023, Oleksandr Tyshchenko wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 
> With enabling both CONFIG_UBSAN and CONFIG_IPMMU_VMSA I have got the following
> splat when an IOMMU driver tried to setup page tables:
> 
> (XEN) ipmmu: /soc/iommu@e67b0000: d1: Set IPMMU context 1 (pgd 0x77fe90000)
> (XEN) ================================================================================
> (XEN) UBSAN: Undefined behaviour in drivers/passthrough/arm/ipmmu-vmsa.c:558:51
> (XEN) left shift of 1048575 by 12 places cannot be represented in type 'int'
> (XEN) Xen WARN at common/ubsan/ubsan.c:172
> (XEN) ---[ Xen-4.18-unstable  arm64  debug=y ubsan=y  Tainted:      S ]----
> ...
> 
> This points to shifted constant in IMTTLBR0_TTBR_MASK. Fix that by adding
> missing 'U' to it.
> 
> This should also address MISRA Rule 7.2:
> 
> A "u" or "U" suffix shall be applied to all integer constants that
> are represented in an unsigned type.
> 
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  xen/drivers/passthrough/arm/ipmmu-vmsa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/drivers/passthrough/arm/ipmmu-vmsa.c b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
> index 24b9e09a6b..0ccfa53255 100644
> --- a/xen/drivers/passthrough/arm/ipmmu-vmsa.c
> +++ b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
> @@ -201,7 +201,7 @@ static DEFINE_SPINLOCK(ipmmu_devices_lock);
>  #define IMTTBCR_TSZ0_SHIFT             0
>  
>  #define IMTTLBR0              0x0010
> -#define IMTTLBR0_TTBR_MASK    (0xfffff << 12)
> +#define IMTTLBR0_TTBR_MASK    (0xfffffU << 12)
>  #define IMTTUBR0              0x0014
>  #define IMTTUBR0_TTBR_MASK    (0xff << 0)
>  
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 23:22:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 23:22:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559547.874605 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHBpK-00051f-8Y; Wed, 05 Jul 2023 23:22:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559547.874605; Wed, 05 Jul 2023 23:22:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHBpK-00051Y-5r; Wed, 05 Jul 2023 23:22:26 +0000
Received: by outflank-mailman (input) for mailman id 559547;
 Wed, 05 Jul 2023 23:22:24 +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
 <SRS0=UsP3=CX=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHBpI-00051S-JW
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 23:22:24 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c93d90d6-1b8a-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 01:22:20 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 8A82361873;
 Wed,  5 Jul 2023 23:22:18 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0E5FC433C8;
 Wed,  5 Jul 2023 23:22:15 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c93d90d6-1b8a-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688599338;
	bh=2FUWcLyefO4K9IhiYR9eAWGie4xg0l1+Lv4GPuBDxDI=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=XCRgiQsctdiMTB0BOIIY5cEdiQs9G1DAImGgYwWwTTFo3VUGWZnrWoXdexG1+SjfT
	 ILZglbYVr2lcDBt3BS4CTfa0XFcVBMHrDgCa/A3+fsjDA0+z/+PKTTJkbETgEaOUM3
	 O7QGsUpCfy1geqxvkUWxi2GiHqQ2sHrWUmF/4SIugx1zmbqDOcZW21d/3weEx+mAlF
	 MpTdI6PsoEL5u4TxYkQD7bgoUbY0GUMew3VIol9Sy7sLoYM18Lkt5I3d+4gYf8F2e6
	 SYsrpoGKb+SA3V+CUw2mxmF6Rq7cX2jH718pgh/RAyVSj6BqOk8lM1MtPZe9tqyK4o
	 MT5gIKVQEMjbw==
Date: Wed, 5 Jul 2023 16:22:14 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Federico Serafini <federico.serafini@bugseng.com>, consulting@bugseng.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Paul Durrant <paul@xen.org>, 
    Tamas K Lengyel <tamas@tklengyel.com>, 
    Alexandru Isaila <aisaila@bitdefender.com>, 
    Petre Pircalabu <ppircalabu@bitdefender.com>, 
    Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <xenia.ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>, 
    xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v2] x86: make function declarations consistent with
 definitions
In-Reply-To: <a16cdb60-1307-636e-1473-e5388e8f79d9@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307051604380.761183@ubuntu-linux-20-04-desktop>
References: <1b2d5be30c0e4f335e59dce6e7c001cb0805d702.1688465215.git.federico.serafini@bugseng.com> <a16cdb60-1307-636e-1473-e5388e8f79d9@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 4 Jul 2023, Jan Beulich wrote:
> On 04.07.2023 12:23, Federico Serafini wrote:
> > Change mechanically the parameter names and types of function
> > declarations to be consistent with the ones used in the corresponding
> > definitions so as to fix violations of MISRA C:2012 Rule 8.3 ("All
> > declarations of an object or function shall use the same names and type
> > qualifiers") and MISRA C:2012 Rule 8.2 ("Function types shall be in
> > prototype form with named parameters").
> > 
> > Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> 
> On top of my earlier remark (when this was part of a series):

Hi Jan,

I am not addressing specifically this comment. I am trying to build a
common understanding on how to do things so that we can go faster in the
future.

In general, as discussed at Xen Summit, in order to successfully merge
large numbers of changes in the coming weeks we should try to keep
mechanical changes mechanical. Separate non-mechanical changes into
different patches.

This patch is large but mechanical. If I understand you correctly, you
are asking:
1) to split the patch into smaller patches
2) make a couple of non-mechanical changes described below


For 1), in my opinion it is not necessary as long as all changes remain
mechanical. If some changes are not mechanical they should be split out.
So if you are asking non-mechanical changes in 2), then 2) should be
split out but everything else could stay in the same patch.

If you'd still like the patch to be split, OK but then you might want to
suggest exactly how it should be split because it is not obvious: all
changes are similar, local, and mechanical. I for one wouldn't know how
you would like this patch to be split.


For 2), I would encourage you to consider the advantage of keeping the
changes as-is in this patch, then send out a patch on top the way you
prefer. That is because it costs you more time to describe how you
would like these lines to be changed in English and review the full
patch a second time, than change them yourself and anyone could ack them
(feel free to CC me).

For clarity: I think it is totally fine that you have better suggestions
on parameter names. I am only pointing out that providing those
suggestions as feedback in an email reply is not a very efficient way to
get it done.


> > --- a/xen/arch/x86/cpu/mcheck/x86_mca.h
> > +++ b/xen/arch/x86/cpu/mcheck/x86_mca.h
> > @@ -113,7 +113,7 @@ static inline int mcabanks_test(int bit, struct mca_banks* banks)
> >      return test_bit(bit, banks->bank_map);
> >  }
> >  
> > -struct mca_banks *mcabanks_alloc(unsigned int nr);
> > +struct mca_banks *mcabanks_alloc(unsigned int nr_mce_banks);
> 
> I'm not convinced here.
> 
> > --- a/xen/arch/x86/hvm/rtc.c
> > +++ b/xen/arch/x86/hvm/rtc.c
> > @@ -59,7 +59,7 @@ enum rtc_mode {
> >  static void rtc_copy_date(RTCState *s);
> >  static void rtc_set_time(RTCState *s);
> >  static inline int from_bcd(RTCState *s, int a);
> > -static inline int convert_hour(RTCState *s, int hour);
> > +static inline int convert_hour(RTCState *s, int raw);
> 
> Nor here.
> 
> > --- a/xen/arch/x86/include/asm/guest_pt.h
> > +++ b/xen/arch/x86/include/asm/guest_pt.h
> > @@ -422,7 +422,7 @@ static inline unsigned int guest_walk_to_page_order(const walk_t *gw)
> >  
> >  bool
> >  guest_walk_tables(const struct vcpu *v, struct p2m_domain *p2m,
> > -                  unsigned long va, walk_t *gw, uint32_t pfec,
> > +                  unsigned long va, walk_t *gw, uint32_t walk,
> >                    gfn_t top_gfn, mfn_t top_mfn, void *top_map);
> 
> While the definition's use of "walk" makes clear why the variable is
> named the way it is despite being used with PFEC_* constants, not
> naming it "pfec" here will add confusion, as the connection to those
> constants will be lost. One will then be forced to go look at the
> definition, when looking at the declaration ought to be sufficient.
> 
> I'm not going to look further, but instead repeat my suggestion to
> split this patch. Besides reducing the Cc list(s), that'll also
> help getting in parts which are uncontroversial (like e.g. the
> change to xen/arch/x86/hvm/vioapic.c).


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 23:29:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 23:29:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559551.874615 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHBvq-0005gF-06; Wed, 05 Jul 2023 23:29:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559551.874615; Wed, 05 Jul 2023 23:29:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHBvp-0005g8-Rb; Wed, 05 Jul 2023 23:29:09 +0000
Received: by outflank-mailman (input) for mailman id 559551;
 Wed, 05 Jul 2023 23:29:09 +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
 <SRS0=UsP3=CX=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHBvp-0005g2-5E
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 23:29:09 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bbdfc650-1b8b-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 01:29:07 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id C17636188D;
 Wed,  5 Jul 2023 23:29:05 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E746C433C7;
 Wed,  5 Jul 2023 23:29:03 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bbdfc650-1b8b-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688599745;
	bh=q5Zom3uXf9/N7/cy25D+SCQRSKDm6WI67TYQy5N5bh4=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=sDOr+D0Jmt3IV2rfq4OXfo7u3xx1JGKPvno7nLwn6HlL0rrFHqTcc11r9l/SG8Tfl
	 c0k/lhN1NtKMMwGGg/Z26sszkFOmYuujEKUEJAjS1zOCSaE7qMKJTkRCDrWyac+7VA
	 jOIynWpFEAftuDF0kZGYVQOZRQgwJEtV1xJkMmdkQKYEwvskuhVxByHbBFcpPFwUk8
	 wCVy3W3KdX1lzgTJzF7TGrWcCjcSFUmm5xt40ZxtXiJ81x+iOU8KMXbkRQOpShCSOK
	 lEWc98bUBSOdSBp5R5gJq/fjonKcKtCgehjYsIAJtETpTC0G6gbOoOBbTq8+g9gAuN
	 YFSokxwETfB/Q==
Date: Wed, 5 Jul 2023 16:29:01 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Gianluca Luparini <gianluca.luparini@bugseng.com>, 
    Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH v2 01/13] x86/cpufreq: fix violations of MISRA C:2012
 Rule 7.2
In-Reply-To: <7df9377d4cb218dd54646c2cb1b70327c8b44c96.1688559115.git.gianluca.luparini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307051628500.761183@ubuntu-linux-20-04-desktop>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com> <7df9377d4cb218dd54646c2cb1b70327c8b44c96.1688559115.git.gianluca.luparini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 5 Jul 2023, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type and also to other
> literals used in the same contexts or near violations, when their positive
> nature is immediately clear. The latter changes are done for the sake of
> uniformity.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes in v2:
> - change commit title to make it unique
> - change commit message
> ---
>  xen/arch/x86/acpi/cpufreq/powernow.c      | 14 +++++++-------
>  xen/include/acpi/cpufreq/processor_perf.h |  2 +-
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/xen/arch/x86/acpi/cpufreq/powernow.c b/xen/arch/x86/acpi/cpufreq/powernow.c
> index d4c7dcd5d9..8e0784b69c 100644
> --- a/xen/arch/x86/acpi/cpufreq/powernow.c
> +++ b/xen/arch/x86/acpi/cpufreq/powernow.c
> @@ -32,14 +32,14 @@
>  #include <acpi/acpi.h>
>  #include <acpi/cpufreq/cpufreq.h>
>  
> -#define HW_PSTATE_MASK          0x00000007
> -#define HW_PSTATE_VALID_MASK    0x80000000
> -#define HW_PSTATE_MAX_MASK      0x000000f0
> +#define HW_PSTATE_MASK          0x00000007U
> +#define HW_PSTATE_VALID_MASK    0x80000000U
> +#define HW_PSTATE_MAX_MASK      0x000000f0U
>  #define HW_PSTATE_MAX_SHIFT     4
> -#define MSR_PSTATE_DEF_BASE     0xc0010064 /* base of Pstate MSRs */
> -#define MSR_PSTATE_STATUS       0xc0010063 /* Pstate Status MSR */
> -#define MSR_PSTATE_CTRL         0xc0010062 /* Pstate control MSR */
> -#define MSR_PSTATE_CUR_LIMIT    0xc0010061 /* pstate current limit MSR */
> +#define MSR_PSTATE_DEF_BASE     0xc0010064U /* base of Pstate MSRs */
> +#define MSR_PSTATE_STATUS       0xc0010063U /* Pstate Status MSR */
> +#define MSR_PSTATE_CTRL         0xc0010062U /* Pstate control MSR */
> +#define MSR_PSTATE_CUR_LIMIT    0xc0010061U /* pstate current limit MSR */
>  #define MSR_HWCR_CPBDIS_MASK    0x02000000ULL
>  
>  #define ARCH_CPU_FLAG_RESUME	1
> diff --git a/xen/include/acpi/cpufreq/processor_perf.h b/xen/include/acpi/cpufreq/processor_perf.h
> index d8a1ba68a6..8b5a1b9bde 100644
> --- a/xen/include/acpi/cpufreq/processor_perf.h
> +++ b/xen/include/acpi/cpufreq/processor_perf.h
> @@ -5,7 +5,7 @@
>  #include <public/sysctl.h>
>  #include <xen/acpi.h>
>  
> -#define XEN_PX_INIT 0x80000000
> +#define XEN_PX_INIT 0x80000000U
>  
>  int powernow_cpufreq_init(void);
>  unsigned int powernow_register_driver(void);
> -- 
> 2.41.0
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 23:31:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 23:31:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559555.874626 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHBy2-00077g-Bg; Wed, 05 Jul 2023 23:31:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559555.874626; Wed, 05 Jul 2023 23:31:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHBy2-00077Z-7J; Wed, 05 Jul 2023 23:31:26 +0000
Received: by outflank-mailman (input) for mailman id 559555;
 Wed, 05 Jul 2023 23:31:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=UsP3=CX=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHBy0-00077R-QQ
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 23:31:24 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0ca0392b-1b8c-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 01:31:22 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 4E0906183D;
 Wed,  5 Jul 2023 23:31:21 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FEBBC433C7;
 Wed,  5 Jul 2023 23:31:19 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0ca0392b-1b8c-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688599880;
	bh=T+dhTuJDCMtm9hrnpRUKhJFzV1cCbzMYyvx9KayRubY=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=dki1/sCbGZlq8tZ0g/9QDnHNN6TqsgLP+8Xux4zai18yb1gMc5XYpwdCuo/rVhKPn
	 uGsHPOmU9xeO/YnDQZwRRugAozMWnSs9ablcS8mgkPE5YgAlgyM2yO6NNCqgoXsbZ+
	 7EAKfyKb5sWnDCpoRLmGI17547DXlgxke5O+eZrvG+fk6U0d8aLwxdmvngiy9550Et
	 iECaBnahJUO5jgkKwvLAri7uS/L2ZpZhoctFuGmgFW5kRa+BH7VKu0gtjqpBiS9hd2
	 9GM4EOxK9z8y01aosGFkIzzU1DvpK5gfWccWOb3qZgk7Fg/SvviSiFngKsIV5yVjks
	 GJ0N62Nwx0uow==
Date: Wed, 5 Jul 2023 16:31:17 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Gianluca Luparini <gianluca.luparini@bugseng.com>, 
    Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH v2 02/13] AMD/IOMMU: fix violations of MISRA C:2012
 Rule 7.2
In-Reply-To: <89ec1b24e6da5738c00155f6f142cb99385fb838.1688559115.git.gianluca.luparini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307051630480.761183@ubuntu-linux-20-04-desktop>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com> <89ec1b24e6da5738c00155f6f142cb99385fb838.1688559115.git.gianluca.luparini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 5 Jul 2023, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type and also to other
> literals used in the same contexts or near violations, when their positive
> nature is immediately clear. The latter changes are done for the sake of
> uniformity.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> Acked-by: Stefano Stabellini <sstabellini@kernel.org>

I reviewed this again and I also the tag should be Reviewed-by (sorry it
was my mistake last time):

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes in v2:
> - minor change to commit title
> - change commit message
> ---
>  xen/drivers/passthrough/amd/iommu-defs.h | 122 +++++++++++------------
>  1 file changed, 61 insertions(+), 61 deletions(-)
> 
> diff --git a/xen/drivers/passthrough/amd/iommu-defs.h b/xen/drivers/passthrough/amd/iommu-defs.h
> index 35de548e3a..c145248f9a 100644
> --- a/xen/drivers/passthrough/amd/iommu-defs.h
> +++ b/xen/drivers/passthrough/amd/iommu-defs.h
> @@ -38,49 +38,49 @@
>          ((uint64_t)(offset) << (12 + (PTE_PER_TABLE_SHIFT * ((level) - 1))))
>  
>  /* IOMMU Capability */
> -#define PCI_CAP_ID_MASK		0x000000FF
> +#define PCI_CAP_ID_MASK		0x000000FFU
>  #define PCI_CAP_ID_SHIFT	0
> -#define PCI_CAP_NEXT_PTR_MASK	0x0000FF00
> +#define PCI_CAP_NEXT_PTR_MASK	0x0000FF00U
>  #define PCI_CAP_NEXT_PTR_SHIFT	8
> -#define PCI_CAP_TYPE_MASK	0x00070000
> +#define PCI_CAP_TYPE_MASK	0x00070000U
>  #define PCI_CAP_TYPE_SHIFT	16
> -#define PCI_CAP_REV_MASK	0x00F80000
> +#define PCI_CAP_REV_MASK	0x00F80000U
>  #define PCI_CAP_REV_SHIFT	19
> -#define PCI_CAP_IOTLB_MASK	0x01000000
> +#define PCI_CAP_IOTLB_MASK	0x01000000U
>  #define PCI_CAP_IOTLB_SHIFT	24
> -#define PCI_CAP_HT_TUNNEL_MASK	0x02000000
> +#define PCI_CAP_HT_TUNNEL_MASK	0x02000000U
>  #define PCI_CAP_HT_TUNNEL_SHIFT	25
> -#define PCI_CAP_NP_CACHE_MASK	0x04000000
> +#define PCI_CAP_NP_CACHE_MASK	0x04000000U
>  #define PCI_CAP_NP_CACHE_SHIFT	26
>  #define PCI_CAP_EFRSUP_SHIFT    27
> -#define PCI_CAP_RESET_MASK	0x80000000
> +#define PCI_CAP_RESET_MASK	0x80000000U
>  #define PCI_CAP_RESET_SHIFT	31
>  
>  #define PCI_CAP_TYPE_IOMMU		0x3
>  
>  #define PCI_CAP_MMIO_BAR_LOW_OFFSET	0x04
>  #define PCI_CAP_MMIO_BAR_HIGH_OFFSET	0x08
> -#define PCI_CAP_MMIO_BAR_LOW_MASK	0xFFFFC000
> +#define PCI_CAP_MMIO_BAR_LOW_MASK	0xFFFFC000U
>  #define IOMMU_MMIO_REGION_LENGTH	0x4000
>  
>  #define PCI_CAP_RANGE_OFFSET		0x0C
> -#define PCI_CAP_BUS_NUMBER_MASK		0x0000FF00
> +#define PCI_CAP_BUS_NUMBER_MASK		0x0000FF00U
>  #define PCI_CAP_BUS_NUMBER_SHIFT	8
> -#define PCI_CAP_FIRST_DEVICE_MASK	0x00FF0000
> +#define PCI_CAP_FIRST_DEVICE_MASK	0x00FF0000U
>  #define PCI_CAP_FIRST_DEVICE_SHIFT	16
> -#define PCI_CAP_LAST_DEVICE_MASK	0xFF000000
> +#define PCI_CAP_LAST_DEVICE_MASK	0xFF000000U
>  #define PCI_CAP_LAST_DEVICE_SHIFT	24
>  
> -#define PCI_CAP_UNIT_ID_MASK    0x0000001F
> +#define PCI_CAP_UNIT_ID_MASK    0x0000001FU
>  #define PCI_CAP_UNIT_ID_SHIFT   0
>  #define PCI_CAP_MISC_INFO_OFFSET    0x10
> -#define PCI_CAP_MSI_NUMBER_MASK     0x0000001F
> +#define PCI_CAP_MSI_NUMBER_MASK     0x0000001FU
>  #define PCI_CAP_MSI_NUMBER_SHIFT    0
>  
>  /* Device Table */
>  #define IOMMU_DEV_TABLE_BASE_LOW_OFFSET		0x00
>  #define IOMMU_DEV_TABLE_BASE_HIGH_OFFSET	0x04
> -#define IOMMU_DEV_TABLE_SIZE_MASK		0x000001FF
> +#define IOMMU_DEV_TABLE_SIZE_MASK		0x000001FFU
>  #define IOMMU_DEV_TABLE_SIZE_SHIFT		0
>  
>  #define IOMMU_DEV_TABLE_ENTRIES_PER_BUS		256
> @@ -159,13 +159,13 @@ struct amd_iommu_dte {
>  #define IOMMU_CMD_BUFFER_BASE_HIGH_OFFSET	0x0C
>  #define IOMMU_CMD_BUFFER_HEAD_OFFSET		0x2000
>  #define IOMMU_CMD_BUFFER_TAIL_OFFSET		0x2008
> -#define IOMMU_CMD_BUFFER_LENGTH_MASK		0x0F000000
> +#define IOMMU_CMD_BUFFER_LENGTH_MASK		0x0F000000U
>  #define IOMMU_CMD_BUFFER_LENGTH_SHIFT		24
>  
>  #define IOMMU_CMD_BUFFER_ENTRY_ORDER            4
>  #define IOMMU_CMD_BUFFER_MAX_ENTRIES            (1u << 15)
>  
> -#define IOMMU_CMD_OPCODE_MASK			0xF0000000
> +#define IOMMU_CMD_OPCODE_MASK			0xF0000000U
>  #define IOMMU_CMD_OPCODE_SHIFT			28
>  #define IOMMU_CMD_COMPLETION_WAIT		0x1
>  #define IOMMU_CMD_INVALIDATE_DEVTAB_ENTRY	0x2
> @@ -178,50 +178,50 @@ struct amd_iommu_dte {
>  /* COMPLETION_WAIT command */
>  #define IOMMU_COMP_WAIT_DATA_BUFFER_SIZE	8
>  #define IOMMU_COMP_WAIT_DATA_BUFFER_ALIGNMENT	8
> -#define IOMMU_COMP_WAIT_S_FLAG_MASK		0x00000001
> -#define IOMMU_COMP_WAIT_I_FLAG_MASK		0x00000002
> -#define IOMMU_COMP_WAIT_F_FLAG_MASK		0x00000004
> -#define IOMMU_COMP_WAIT_ADDR_LOW_MASK		0xFFFFFFF8
> +#define IOMMU_COMP_WAIT_S_FLAG_MASK		0x00000001U
> +#define IOMMU_COMP_WAIT_I_FLAG_MASK		0x00000002U
> +#define IOMMU_COMP_WAIT_F_FLAG_MASK		0x00000004U
> +#define IOMMU_COMP_WAIT_ADDR_LOW_MASK		0xFFFFFFF8U
>  #define IOMMU_COMP_WAIT_ADDR_LOW_SHIFT		3
> -#define IOMMU_COMP_WAIT_ADDR_HIGH_MASK		0x000FFFFF
> +#define IOMMU_COMP_WAIT_ADDR_HIGH_MASK		0x000FFFFFU
>  #define IOMMU_COMP_WAIT_ADDR_HIGH_SHIFT		0
>  
>  /* INVALIDATE_IOMMU_PAGES command */
> -#define IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_MASK	0x0000FFFF
> +#define IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_MASK	0x0000FFFFU
>  #define IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_SHIFT	0
> -#define IOMMU_INV_IOMMU_PAGES_S_FLAG_MASK	0x00000001
> +#define IOMMU_INV_IOMMU_PAGES_S_FLAG_MASK	0x00000001U
>  #define IOMMU_INV_IOMMU_PAGES_S_FLAG_SHIFT	0
> -#define IOMMU_INV_IOMMU_PAGES_PDE_FLAG_MASK	0x00000002
> +#define IOMMU_INV_IOMMU_PAGES_PDE_FLAG_MASK	0x00000002U
>  #define IOMMU_INV_IOMMU_PAGES_PDE_FLAG_SHIFT	1
> -#define IOMMU_INV_IOMMU_PAGES_ADDR_LOW_MASK	0xFFFFF000
> +#define IOMMU_INV_IOMMU_PAGES_ADDR_LOW_MASK	0xFFFFF000U
>  #define IOMMU_INV_IOMMU_PAGES_ADDR_LOW_SHIFT	12
> -#define IOMMU_INV_IOMMU_PAGES_ADDR_HIGH_MASK	0xFFFFFFFF
> +#define IOMMU_INV_IOMMU_PAGES_ADDR_HIGH_MASK	0xFFFFFFFFU
>  #define IOMMU_INV_IOMMU_PAGES_ADDR_HIGH_SHIFT	0
>  
>  /* INVALIDATE_DEVTAB_ENTRY command */
> -#define IOMMU_INV_DEVTAB_ENTRY_DEVICE_ID_MASK   0x0000FFFF
> +#define IOMMU_INV_DEVTAB_ENTRY_DEVICE_ID_MASK   0x0000FFFFU
>  #define IOMMU_INV_DEVTAB_ENTRY_DEVICE_ID_SHIFT  0
>  
>  /* INVALIDATE_INTERRUPT_TABLE command */
> -#define IOMMU_INV_INT_TABLE_DEVICE_ID_MASK   0x0000FFFF
> +#define IOMMU_INV_INT_TABLE_DEVICE_ID_MASK   0x0000FFFFU
>  #define IOMMU_INV_INT_TABLE_DEVICE_ID_SHIFT  0
>  
>  /* INVALIDATE_IOTLB_PAGES command */
> -#define IOMMU_INV_IOTLB_PAGES_MAXPEND_MASK          0xff000000
> +#define IOMMU_INV_IOTLB_PAGES_MAXPEND_MASK          0xff000000U
>  #define IOMMU_INV_IOTLB_PAGES_MAXPEND_SHIFT         24
> -#define IOMMU_INV_IOTLB_PAGES_PASID1_MASK           0x00ff0000
> +#define IOMMU_INV_IOTLB_PAGES_PASID1_MASK           0x00ff0000U
>  #define IOMMU_INV_IOTLB_PAGES_PASID1_SHIFT          16
> -#define IOMMU_INV_IOTLB_PAGES_PASID2_MASK           0x0fff0000
> +#define IOMMU_INV_IOTLB_PAGES_PASID2_MASK           0x0fff0000U
>  #define IOMMU_INV_IOTLB_PAGES_PASID2_SHIFT          16
> -#define IOMMU_INV_IOTLB_PAGES_QUEUEID_MASK          0x0000ffff
> +#define IOMMU_INV_IOTLB_PAGES_QUEUEID_MASK          0x0000ffffU
>  #define IOMMU_INV_IOTLB_PAGES_QUEUEID_SHIFT         0
> -#define IOMMU_INV_IOTLB_PAGES_DEVICE_ID_MASK        0x0000FFFF
> +#define IOMMU_INV_IOTLB_PAGES_DEVICE_ID_MASK        0x0000FFFFU
>  #define IOMMU_INV_IOTLB_PAGES_DEVICE_ID_SHIFT       0
> -#define IOMMU_INV_IOTLB_PAGES_ADDR_LOW_MASK         0xFFFFF000
> +#define IOMMU_INV_IOTLB_PAGES_ADDR_LOW_MASK         0xFFFFF000U
>  #define IOMMU_INV_IOTLB_PAGES_ADDR_LOW_SHIFT        12
> -#define IOMMU_INV_IOTLB_PAGES_ADDR_HIGH_MASK        0xFFFFFFFF
> +#define IOMMU_INV_IOTLB_PAGES_ADDR_HIGH_MASK        0xFFFFFFFFU
>  #define IOMMU_INV_IOTLB_PAGES_ADDR_HIGH_SHIFT       0
> -#define IOMMU_INV_IOTLB_PAGES_S_FLAG_MASK           0x00000001
> +#define IOMMU_INV_IOTLB_PAGES_S_FLAG_MASK           0x00000001U
>  #define IOMMU_INV_IOTLB_PAGES_S_FLAG_SHIFT          0
>  
>  /* Event Log */
> @@ -229,18 +229,18 @@ struct amd_iommu_dte {
>  #define IOMMU_EVENT_LOG_BASE_HIGH_OFFSET	0x14
>  #define IOMMU_EVENT_LOG_HEAD_OFFSET		0x2010
>  #define IOMMU_EVENT_LOG_TAIL_OFFSET		0x2018
> -#define IOMMU_EVENT_LOG_LENGTH_MASK		0x0F000000
> +#define IOMMU_EVENT_LOG_LENGTH_MASK		0x0F000000U
>  #define IOMMU_EVENT_LOG_LENGTH_SHIFT		24
> -#define IOMMU_EVENT_LOG_HEAD_MASK		0x0007FFF0
> +#define IOMMU_EVENT_LOG_HEAD_MASK		0x0007FFF0U
>  #define IOMMU_EVENT_LOG_HEAD_SHIFT		4
> -#define IOMMU_EVENT_LOG_TAIL_MASK		0x0007FFF0
> +#define IOMMU_EVENT_LOG_TAIL_MASK		0x0007FFF0U
>  #define IOMMU_EVENT_LOG_TAIL_SHIFT		4
>  
>  #define IOMMU_EVENT_LOG_ENTRY_SIZE 			16
>  #define IOMMU_EVENT_LOG_POWER_OF2_ENTRIES_PER_PAGE	8
>  #define IOMMU_EVENT_LOG_U32_PER_ENTRY	(IOMMU_EVENT_LOG_ENTRY_SIZE / 4)
>  
> -#define IOMMU_EVENT_CODE_MASK			0xF0000000
> +#define IOMMU_EVENT_CODE_MASK			0xF0000000U
>  #define IOMMU_EVENT_CODE_SHIFT			28
>  #define IOMMU_EVENT_ILLEGAL_DEV_TABLE_ENTRY	0x1
>  #define IOMMU_EVENT_IO_PAGE_FAULT		0x2
> @@ -251,12 +251,12 @@ struct amd_iommu_dte {
>  #define IOMMU_EVENT_IOTLB_INV_TIMEOUT		0x7
>  #define IOMMU_EVENT_INVALID_DEV_REQUEST		0x8
>  
> -#define IOMMU_EVENT_DOMAIN_ID_MASK           0x0000FFFF
> +#define IOMMU_EVENT_DOMAIN_ID_MASK           0x0000FFFFU
>  #define IOMMU_EVENT_DOMAIN_ID_SHIFT          0
> -#define IOMMU_EVENT_DEVICE_ID_MASK           0x0000FFFF
> +#define IOMMU_EVENT_DEVICE_ID_MASK           0x0000FFFFU
>  #define IOMMU_EVENT_DEVICE_ID_SHIFT          0
>  #define IOMMU_EVENT_FLAGS_SHIFT              16
> -#define IOMMU_EVENT_FLAGS_MASK               0x0FFF0000
> +#define IOMMU_EVENT_FLAGS_MASK               0x0FFF0000U
>  
>  /* PPR Log */
>  #define IOMMU_PPR_LOG_ENTRY_SIZE                        16
> @@ -265,21 +265,21 @@ struct amd_iommu_dte {
>  
>  #define IOMMU_PPR_LOG_BASE_LOW_OFFSET                   0x0038
>  #define IOMMU_PPR_LOG_BASE_HIGH_OFFSET                  0x003C
> -#define IOMMU_PPR_LOG_BASE_LOW_MASK                     0xFFFFF000
> +#define IOMMU_PPR_LOG_BASE_LOW_MASK                     0xFFFFF000U
>  #define IOMMU_PPR_LOG_BASE_LOW_SHIFT                    12
> -#define IOMMU_PPR_LOG_BASE_HIGH_MASK                    0x000FFFFF
> +#define IOMMU_PPR_LOG_BASE_HIGH_MASK                    0x000FFFFFU
>  #define IOMMU_PPR_LOG_BASE_HIGH_SHIFT                   0
> -#define IOMMU_PPR_LOG_LENGTH_MASK                       0x0F000000
> +#define IOMMU_PPR_LOG_LENGTH_MASK                       0x0F000000U
>  #define IOMMU_PPR_LOG_LENGTH_SHIFT                      24
> -#define IOMMU_PPR_LOG_HEAD_MASK                         0x0007FFF0
> +#define IOMMU_PPR_LOG_HEAD_MASK                         0x0007FFF0U
>  #define IOMMU_PPR_LOG_HEAD_SHIFT                        4
> -#define IOMMU_PPR_LOG_TAIL_MASK                         0x0007FFF0
> +#define IOMMU_PPR_LOG_TAIL_MASK                         0x0007FFF0U
>  #define IOMMU_PPR_LOG_TAIL_SHIFT                        4
>  #define IOMMU_PPR_LOG_HEAD_OFFSET                       0x2030
>  #define IOMMU_PPR_LOG_TAIL_OFFSET                       0x2038
> -#define IOMMU_PPR_LOG_DEVICE_ID_MASK                    0x0000FFFF
> +#define IOMMU_PPR_LOG_DEVICE_ID_MASK                    0x0000FFFFU
>  #define IOMMU_PPR_LOG_DEVICE_ID_SHIFT                   0
> -#define IOMMU_PPR_LOG_CODE_MASK                         0xF0000000
> +#define IOMMU_PPR_LOG_CODE_MASK                         0xF0000000U
>  #define IOMMU_PPR_LOG_CODE_SHIFT                        28
>  
>  #define IOMMU_LOG_ENTRY_TIMEOUT                         1000
> @@ -342,17 +342,17 @@ union amd_iommu_control {
>  #define IOMMU_EXCLUSION_BASE_HIGH_OFFSET	0x24
>  #define IOMMU_EXCLUSION_LIMIT_LOW_OFFSET	0x28
>  #define IOMMU_EXCLUSION_LIMIT_HIGH_OFFSET	0x2C
> -#define IOMMU_EXCLUSION_BASE_LOW_MASK		0xFFFFF000
> +#define IOMMU_EXCLUSION_BASE_LOW_MASK		0xFFFFF000U
>  #define IOMMU_EXCLUSION_BASE_LOW_SHIFT		12
> -#define IOMMU_EXCLUSION_BASE_HIGH_MASK		0xFFFFFFFF
> +#define IOMMU_EXCLUSION_BASE_HIGH_MASK		0xFFFFFFFFU
>  #define IOMMU_EXCLUSION_BASE_HIGH_SHIFT		0
> -#define IOMMU_EXCLUSION_RANGE_ENABLE_MASK	0x00000001
> +#define IOMMU_EXCLUSION_RANGE_ENABLE_MASK	0x00000001U
>  #define IOMMU_EXCLUSION_RANGE_ENABLE_SHIFT	0
> -#define IOMMU_EXCLUSION_ALLOW_ALL_MASK		0x00000002
> +#define IOMMU_EXCLUSION_ALLOW_ALL_MASK		0x00000002U
>  #define IOMMU_EXCLUSION_ALLOW_ALL_SHIFT		1
> -#define IOMMU_EXCLUSION_LIMIT_LOW_MASK		0xFFFFF000
> +#define IOMMU_EXCLUSION_LIMIT_LOW_MASK		0xFFFFF000U
>  #define IOMMU_EXCLUSION_LIMIT_LOW_SHIFT		12
> -#define IOMMU_EXCLUSION_LIMIT_HIGH_MASK		0xFFFFFFFF
> +#define IOMMU_EXCLUSION_LIMIT_HIGH_MASK		0xFFFFFFFFU
>  #define IOMMU_EXCLUSION_LIMIT_HIGH_SHIFT	0
>  
>  /* Extended Feature Register */
> @@ -476,14 +476,14 @@ union amd_iommu_pte {
>  
>  #define INV_IOMMU_ALL_PAGES_ADDRESS      ((1ULL << 63) - 1)
>  
> -#define IOMMU_RING_BUFFER_PTR_MASK                  0x0007FFF0
> +#define IOMMU_RING_BUFFER_PTR_MASK                  0x0007FFF0U
>  
> -#define IOMMU_CMD_DEVICE_ID_MASK                    0x0000FFFF
> +#define IOMMU_CMD_DEVICE_ID_MASK                    0x0000FFFFU
>  #define IOMMU_CMD_DEVICE_ID_SHIFT                   0
>  
> -#define IOMMU_REG_BASE_ADDR_LOW_MASK                0xFFFFF000
> +#define IOMMU_REG_BASE_ADDR_LOW_MASK                0xFFFFF000U
>  #define IOMMU_REG_BASE_ADDR_LOW_SHIFT               12
> -#define IOMMU_REG_BASE_ADDR_HIGH_MASK               0x000FFFFF
> +#define IOMMU_REG_BASE_ADDR_HIGH_MASK               0x000FFFFFU
>  #define IOMMU_REG_BASE_ADDR_HIGH_SHIFT              0
>  
>  #endif /* AMD_IOMMU_DEFS_H */
> -- 
> 2.41.0
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 23:32:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 23:32:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559561.874636 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHBzL-0007jo-Qd; Wed, 05 Jul 2023 23:32:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559561.874636; Wed, 05 Jul 2023 23:32:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHBzL-0007jh-M7; Wed, 05 Jul 2023 23:32:47 +0000
Received: by outflank-mailman (input) for mailman id 559561;
 Wed, 05 Jul 2023 23:32:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=UsP3=CX=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHBzK-0007jZ-FO
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 23:32:46 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3df53aef-1b8c-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 01:32:45 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 2304F61864;
 Wed,  5 Jul 2023 23:32:44 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42254C433C7;
 Wed,  5 Jul 2023 23:32:42 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3df53aef-1b8c-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688599963;
	bh=wOTkpRt6ujLa6ZjkUKlKZ0ZZRhSVaR6y2nqF3tbav+0=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=MdRZT86OeddAUJupyHQewf1wxsSSV+r9WfgeTI9bEzbACq/aEJL3bWgcg685KAzKt
	 oIagMjMw89wzUgnlGwq6ZqsaSsboptdxlG58eXfHhS91szAV7jcynoshC8Df6WrAmb
	 sLTqTPZKMT8TlHumFKdv73z7qX33Oisj1j+/g/KCgBofUTw/TrXfW4Pyn3de6ShL1d
	 QX2vYWnrk/ten8aImW5lJkniLv6ED5E1fniEK8yor21t5w+CuY1hCUXJtR89Gejqix
	 GYgqw7921SziUmiPSdY8IKGv44O7xAElufdLyb68mAvrxUr1JSACqmbaVzVrG+Lw2R
	 AJh7ZEWFRsgLQ==
Date: Wed, 5 Jul 2023 16:32:40 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Gianluca Luparini <gianluca.luparini@bugseng.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH v2 05/13] xen/device-tree: fix violations of MISRA
 C:2012 Rule 7.2
In-Reply-To: <da656a93e42e5d04e02f62002b1f5ab357c8c16a.1688559115.git.gianluca.luparini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307051632260.761183@ubuntu-linux-20-04-desktop>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com> <da656a93e42e5d04e02f62002b1f5ab357c8c16a.1688559115.git.gianluca.luparini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 5 Jul 2023, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type and also to other
> literals used in the same contexts or near violations, when their positive
> nature is immediately clear. The latter changes are done for the sake of
> uniformity.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes in v2:
> - change commit title to the right one
> - change commit message
> - change maintainers in Cc
> - remove changes in 'libfdt'
> ---
>  xen/common/device_tree.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 8da1052911..0677193ab3 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -2115,7 +2115,7 @@ static void __init __unflatten_device_tree(const void *fdt,
>      /* Allocate memory for the expanded device tree */
>      mem = (unsigned long)_xmalloc (size + 4, __alignof__(struct dt_device_node));
>  
> -    ((__be32 *)mem)[size / 4] = cpu_to_be32(0xdeadbeef);
> +    ((__be32 *)mem)[size / 4] = cpu_to_be32(0xdeadbeefU);
>  
>      dt_dprintk("  unflattening %lx...\n", mem);
>  
> @@ -2125,7 +2125,7 @@ static void __init __unflatten_device_tree(const void *fdt,
>      if ( be32_to_cpup((__be32 *)start) != FDT_END )
>          printk(XENLOG_WARNING "Weird tag at end of tree: %08x\n",
>                    *((u32 *)start));
> -    if ( be32_to_cpu(((__be32 *)mem)[size / 4]) != 0xdeadbeef )
> +    if ( be32_to_cpu(((__be32 *)mem)[size / 4]) != 0xdeadbeefU )
>          printk(XENLOG_WARNING "End of tree marker overwritten: %08x\n",
>                    be32_to_cpu(((__be32 *)mem)[size / 4]));
>      *allnextp = NULL;
> -- 
> 2.41.0
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 23:38:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 23:38:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559565.874644 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHC4Q-0008NL-Ap; Wed, 05 Jul 2023 23:38:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559565.874644; Wed, 05 Jul 2023 23:38:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHC4Q-0008NE-8F; Wed, 05 Jul 2023 23:38:02 +0000
Received: by outflank-mailman (input) for mailman id 559565;
 Wed, 05 Jul 2023 23:38:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=UsP3=CX=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHC4O-0008N6-PR
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 23:38:00 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f930aad2-1b8c-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 01:37:59 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 29935617C6;
 Wed,  5 Jul 2023 23:37:58 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57D1AC433C7;
 Wed,  5 Jul 2023 23:37:56 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f930aad2-1b8c-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688600277;
	bh=DyKLPNUAgJMFu6qoqSKWIs84x3QhKTRjUa+S683YyIs=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=SjJbAJNdByWwpNMWJqOsJZ6TH8GEUJCorFpGTPfDeYFVn/fdtDgyV7VmWB2q7BPzD
	 SU+fH8Y0ks2Ep6uBY/aZHQMprTdqzhQUHFhbhX2DVgzJvgzkp0dARJJjsCNjkabgYC
	 gqh8QhRpbVsJdi33tHwIgr9+r3lbMrn5ahYaJsMxCWtoHPVQZn4+ExjLCGwppok+6K
	 s1AWe6DzC7kylh9x8c3DcKHCPpxJQkwi1zfBFXDFAnF+dLzeuKMnABY4qXXoo8cgpl
	 wntewHnnjyuhokMUgMI930/qn2aXARiGgJBk52pMGdti44fU7mcka//wH5Q8vT8Sl1
	 RvdNWarx4nDow==
Date: Wed, 5 Jul 2023 16:37:54 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Gianluca Luparini <gianluca.luparini@bugseng.com>, 
    Jan Beulich <jbeulich@suse.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH v2 06/13] xen/efi: fix violations of MISRA C:2012
 Rule 7.2
In-Reply-To: <9a791b84be74d7ca575eb94e070aae7294d95bbf.1688559115.git.gianluca.luparini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307051635170.761183@ubuntu-linux-20-04-desktop>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com> <9a791b84be74d7ca575eb94e070aae7294d95bbf.1688559115.git.gianluca.luparini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 5 Jul 2023, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type and also to other
> literals used in the same contexts or near violations, when their positive
> nature is immediately clear. The latter changes are done for the sake of
> uniformity.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
>
> ---
> Changes in v2:
> - minor change to commit title
> - change commit message
> - remove changes in 'efibind.h', 'efiapi.h', 'efidef.h' and 'efiprot.h'
> ---
>  xen/common/efi/boot.c    | 8 ++++----
>  xen/common/efi/runtime.c | 2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
> index c5850c26af..28a57fe434 100644
> --- a/xen/common/efi/boot.c
> +++ b/xen/common/efi/boot.c
> @@ -34,13 +34,13 @@
>  #define EFI_REVISION(major, minor) (((major) << 16) | (minor))
>  
>  #define SMBIOS3_TABLE_GUID \
> -  { 0xf2fd1544, 0x9794, 0x4a2c, {0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94} }
> +  { 0xf2fd1544U, 0x9794U, 0x4a2cU, {0x99U, 0x2eU, 0xe5U, 0xbbU, 0xcfU, 0x20U, 0xe3U, 0x94U} }
>  #define SHIM_LOCK_PROTOCOL_GUID \
> -  { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} }
> +  { 0x605dab50U, 0xe046U, 0x4300U, {0xabU, 0xb6U, 0x3dU, 0xd8U, 0x10U, 0xddU, 0x8bU, 0x23U} }
>  #define APPLE_PROPERTIES_PROTOCOL_GUID \
> -  { 0x91bd12fe, 0xf6c3, 0x44fb, { 0xa5, 0xb7, 0x51, 0x22, 0xab, 0x30, 0x3a, 0xe0} }
> +  { 0x91bd12feU, 0xf6c3U, 0x44fbU, { 0xa5U, 0xb7U, 0x51U, 0x22U, 0xabU, 0x30U, 0x3aU, 0xe0U} }
>  #define EFI_SYSTEM_RESOURCE_TABLE_GUID    \
> -  { 0xb122a263, 0x3661, 0x4f68, {0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80} }
> +  { 0xb122a263U, 0x3661U, 0x4f68U, {0x99U, 0x29U, 0x78U, 0xf8U, 0xb0U, 0xd6U, 0x21U, 0x80U} }
>  #define EFI_SYSTEM_RESOURCE_TABLE_FIRMWARE_RESOURCE_VERSION 1

To be honest in these case I don't know if this is better or if it is
better to add U only to the first numbers (0xf2fd1544U, 0x605dab50U,
0x91bd12feU, 0xb122a263U).

Either way:

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>



>  typedef struct {
> diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
> index 13b0975866..5cb7504c96 100644
> --- a/xen/common/efi/runtime.c
> +++ b/xen/common/efi/runtime.c
> @@ -698,7 +698,7 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
>  #ifndef COMPAT
>      op->status = status;
>  #else
> -    op->status = (status & 0x3fffffff) | ((status >> 32) & 0xc0000000);
> +    op->status = (status & 0x3fffffffU) | ((status >> 32) & 0xc0000000U);
>  #endif
>  
>      return rc;
> -- 
> 2.41.0
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 23:40:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 23:40:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559569.874655 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHC6G-0000XP-NH; Wed, 05 Jul 2023 23:39:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559569.874655; Wed, 05 Jul 2023 23:39:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHC6G-0000XI-Kb; Wed, 05 Jul 2023 23:39:56 +0000
Received: by outflank-mailman (input) for mailman id 559569;
 Wed, 05 Jul 2023 23:39:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=UsP3=CX=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHC6F-0000XC-QG
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 23:39:55 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3d70aa4b-1b8d-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 01:39:54 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id B816B617AB;
 Wed,  5 Jul 2023 23:39:52 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45F51C433C8;
 Wed,  5 Jul 2023 23:39:50 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3d70aa4b-1b8d-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688600392;
	bh=C3PaxGNtxovnao9glhvsLfL4Yq0FNDJmWgoPDpPofdo=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=f4aMsMHNMKKDLZdQ27Kg1Yg6dJyQHzR7vgsaNOMBlHVAeX1/UBWZjzosUbzDsrUeg
	 jcJSp3L9L38YtfOI6jc0mI5QwdwdIen3me9CR3DY/x1HIB7YBKmcVdzgd53nq3U3YB
	 fCa6QokGxzK9jyP3aS+MspB5mFMhWwvsGZvEZ1HaxYoHudsooN1for4CYbaQxMjp4g
	 x+tYGACekGeC0fH1GaqWfig98lQTe1Td0GdMe8pKF+ii3nTQ5daCp1vfe3LL36ILIt
	 r1F7cNao30wiSTFb1GLqDMScH1UwLj0nx/jzVffnsf2kWSJlkoOnA77J3LXACv+gB8
	 4Dqvq1Auh0OTg==
Date: Wed, 5 Jul 2023 16:39:48 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Gianluca Luparini <gianluca.luparini@bugseng.com>, 
    Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>, 
    Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH v2 07/13] x86/vmx: fix violations of MISRA C:2012
 Rule 7.2
In-Reply-To: <f30ef7c2cda2516d9ef07bb79e5da5513cd90c6c.1688559115.git.gianluca.luparini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307051638440.761183@ubuntu-linux-20-04-desktop>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com> <f30ef7c2cda2516d9ef07bb79e5da5513cd90c6c.1688559115.git.gianluca.luparini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 5 Jul 2023, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type and also to other
> literals used in the same contexts or near violations, when their positive
> nature is immediately clear. The latter changes are done for the sake of
> uniformity.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes in v2:
> - minor change to commit title
> - change commit message
> - remove unnecessary changes in 'vpmu_intel.c' and 'vmx.h'
> - add 'ULL' suffix in 'vpmu_intel.c'
> - add zero-padding to constants in 'vmx.h'
> - add missing 'U' in 'vmx.h'
> ---
>  xen/arch/x86/cpu/vpmu_intel.c           |  2 +-
>  xen/arch/x86/hvm/vmx/vmcs.c             |  6 ++---
>  xen/arch/x86/hvm/vmx/vvmx.c             | 12 ++++-----
>  xen/arch/x86/include/asm/hvm/vmx/vmcs.h |  6 ++---
>  xen/arch/x86/include/asm/hvm/vmx/vmx.h  | 34 ++++++++++++-------------
>  5 files changed, 30 insertions(+), 30 deletions(-)
> 
> diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
> index bda5d511ac..890c279310 100644
> --- a/xen/arch/x86/cpu/vpmu_intel.c
> +++ b/xen/arch/x86/cpu/vpmu_intel.c
> @@ -946,7 +946,7 @@ const struct arch_vpmu_ops *__init core2_vpmu_init(void)
>      fixed_counters_mask = ~((1ull << core2_get_bitwidth_fix_count()) - 1);
>      global_ctrl_mask = ~((((1ULL << fixed_pmc_cnt) - 1) << 32) |
>                           ((1ULL << arch_pmc_cnt) - 1));
> -    global_ovf_ctrl_mask = ~(0xC000000000000000 |
> +    global_ovf_ctrl_mask = ~(0xC000000000000000ULL |
>                               (((1ULL << fixed_pmc_cnt) - 1) << 32) |
>                               ((1ULL << arch_pmc_cnt) - 1));
>      if ( version > 2 )
> diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
> index b209563625..d5a2b847a9 100644
> --- a/xen/arch/x86/hvm/vmx/vmcs.c
> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
> @@ -911,7 +911,7 @@ void vmx_clear_msr_intercept(struct vcpu *v, unsigned int msr,
>          if ( type & VMX_MSR_W )
>              clear_bit(msr, msr_bitmap->write_low);
>      }
> -    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
> +    else if ( (msr >= 0xc0000000U) && (msr <= 0xc0001fffU) )
>      {
>          msr &= 0x1fff;
>          if ( type & VMX_MSR_R )
> @@ -939,7 +939,7 @@ void vmx_set_msr_intercept(struct vcpu *v, unsigned int msr,
>          if ( type & VMX_MSR_W )
>              set_bit(msr, msr_bitmap->write_low);
>      }
> -    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
> +    else if ( (msr >= 0xc0000000U) && (msr <= 0xc0001fffU) )
>      {
>          msr &= 0x1fff;
>          if ( type & VMX_MSR_R )
> @@ -957,7 +957,7 @@ bool vmx_msr_is_intercepted(struct vmx_msr_bitmap *msr_bitmap,
>      if ( msr <= 0x1fff )
>          return test_bit(msr, is_write ? msr_bitmap->write_low
>                                        : msr_bitmap->read_low);
> -    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
> +    else if ( (msr >= 0xc0000000U) && (msr <= 0xc0001fffU) )
>          return test_bit(msr & 0x1fff, is_write ? msr_bitmap->write_high
>                                                 : msr_bitmap->read_high);
>      else
> diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
> index 1034534c97..f59de0f124 100644
> --- a/xen/arch/x86/hvm/vmx/vvmx.c
> +++ b/xen/arch/x86/hvm/vmx/vvmx.c
> @@ -257,14 +257,14 @@ uint64_t get_vvmcs_virtual(void *vvmcs, uint32_t vmcs_encoding)
>  
>      switch ( enc.width ) {
>      case VVMCS_WIDTH_16:
> -        res &= 0xffff;
> +        res &= 0xffffU;
>          break;
>     case VVMCS_WIDTH_64:
>          if ( enc.access_type )
>              res >>= 32;
>          break;
>      case VVMCS_WIDTH_32:
> -        res &= 0xffffffff;
> +        res &= 0xffffffffU;
>          break;
>      case VVMCS_WIDTH_NATURAL:
>      default:
> @@ -311,19 +311,19 @@ void set_vvmcs_virtual(void *vvmcs, uint32_t vmcs_encoding, uint64_t val)
>  
>      switch ( enc.width ) {
>      case VVMCS_WIDTH_16:
> -        res = val & 0xffff;
> +        res = val & 0xffffU;
>          break;
>      case VVMCS_WIDTH_64:
>          if ( enc.access_type )
>          {
> -            res &= 0xffffffff;
> +            res &= 0xffffffffU;
>              res |= val << 32;
>          }
>          else
>              res = val;
>          break;
>      case VVMCS_WIDTH_32:
> -        res = val & 0xffffffff;
> +        res = val & 0xffffffffU;
>          break;
>      case VVMCS_WIDTH_NATURAL:
>      default:
> @@ -2307,7 +2307,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
>          break;
>      case MSR_IA32_VMX_CR0_FIXED1:
>          /* allow 0-settings for all bits */
> -        data = 0xffffffff;
> +        data = 0xffffffffU;
>          break;
>      case MSR_IA32_VMX_CR4_FIXED0:
>          /* VMXE bit must be 1 in VMX operation */
> diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
> index d07fcb2bc9..4acf3970f5 100644
> --- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
> +++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
> @@ -207,7 +207,7 @@ void vmx_vmcs_reload(struct vcpu *v);
>  #define CPU_BASED_ACTIVATE_MSR_BITMAP         0x10000000
>  #define CPU_BASED_MONITOR_EXITING             0x20000000
>  #define CPU_BASED_PAUSE_EXITING               0x40000000
> -#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000
> +#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000U
>  extern u32 vmx_cpu_based_exec_control;
>  
>  #define PIN_BASED_EXT_INTR_MASK         0x00000001
> @@ -257,7 +257,7 @@ extern u32 vmx_vmentry_control;
>  #define SECONDARY_EXEC_XSAVES                   0x00100000
>  #define SECONDARY_EXEC_TSC_SCALING              0x02000000
>  #define SECONDARY_EXEC_BUS_LOCK_DETECTION       0x40000000
> -#define SECONDARY_EXEC_NOTIFY_VM_EXITING        0x80000000
> +#define SECONDARY_EXEC_NOTIFY_VM_EXITING        0x80000000U
>  extern u32 vmx_secondary_exec_control;
>  
>  #define VMX_EPT_EXEC_ONLY_SUPPORTED                         0x00000001
> @@ -346,7 +346,7 @@ extern u64 vmx_ept_vpid_cap;
>  #define cpu_has_vmx_notify_vm_exiting \
>      (vmx_secondary_exec_control & SECONDARY_EXEC_NOTIFY_VM_EXITING)
>  
> -#define VMCS_RID_TYPE_MASK              0x80000000
> +#define VMCS_RID_TYPE_MASK              0x80000000U
>  
>  /* GUEST_INTERRUPTIBILITY_INFO flags. */
>  #define VMX_INTR_SHADOW_STI             0x00000001
> diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
> index 36c108d879..6642688e1d 100644
> --- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
> +++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
> @@ -136,7 +136,7 @@ static inline void pi_clear_sn(struct pi_desc *pi_desc)
>  /*
>   * Exit Reasons
>   */
> -#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000
> +#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000U
>  #define VMX_EXIT_REASONS_BUS_LOCK       (1u << 26)
>  
>  #define EXIT_REASON_EXCEPTION_NMI       0
> @@ -208,12 +208,12 @@ static inline void pi_clear_sn(struct pi_desc *pi_desc)
>   * Note INTR_INFO_NMI_UNBLOCKED_BY_IRET is also used with Exit Qualification
>   * field for EPT violations, PML full and SPP-related event vmexits.
>   */
> -#define INTR_INFO_VECTOR_MASK           0xff            /* 7:0 */
> -#define INTR_INFO_INTR_TYPE_MASK        0x700           /* 10:8 */
> -#define INTR_INFO_DELIVER_CODE_MASK     0x800           /* 11 */
> -#define INTR_INFO_NMI_UNBLOCKED_BY_IRET 0x1000          /* 12 */
> -#define INTR_INFO_VALID_MASK            0x80000000      /* 31 */
> -#define INTR_INFO_RESVD_BITS_MASK       0x7ffff000
> +#define INTR_INFO_VECTOR_MASK           0x000000ffU      /* 7:0 */
> +#define INTR_INFO_INTR_TYPE_MASK        0x00000700U      /* 10:8 */
> +#define INTR_INFO_DELIVER_CODE_MASK     0x00000800U      /* 11 */
> +#define INTR_INFO_NMI_UNBLOCKED_BY_IRET 0x00001000U      /* 12 */
> +#define INTR_INFO_VALID_MASK            0x80000000U      /* 31 */
> +#define INTR_INFO_RESVD_BITS_MASK       0x7ffff000U
>  
>  /*
>   * Exit Qualifications for NOTIFY VM EXIT
> @@ -246,15 +246,15 @@ typedef union cr_access_qual {
>  /*
>   * Access Rights
>   */
> -#define X86_SEG_AR_SEG_TYPE     0xf        /* 3:0, segment type */
> -#define X86_SEG_AR_DESC_TYPE    (1u << 4)  /* 4, descriptor type */
> -#define X86_SEG_AR_DPL          0x60       /* 6:5, descriptor privilege level */
> -#define X86_SEG_AR_SEG_PRESENT  (1u << 7)  /* 7, segment present */
> -#define X86_SEG_AR_AVL          (1u << 12) /* 12, available for system software */
> -#define X86_SEG_AR_CS_LM_ACTIVE (1u << 13) /* 13, long mode active (CS only) */
> -#define X86_SEG_AR_DEF_OP_SIZE  (1u << 14) /* 14, default operation size */
> -#define X86_SEG_AR_GRANULARITY  (1u << 15) /* 15, granularity */
> -#define X86_SEG_AR_SEG_UNUSABLE (1u << 16) /* 16, segment unusable */
> +#define X86_SEG_AR_SEG_TYPE     0xfU       /* 3:0, segment type */
> +#define X86_SEG_AR_DESC_TYPE    (1U << 4)  /* 4, descriptor type */
> +#define X86_SEG_AR_DPL          0x60U      /* 6:5, descriptor privilege level */
> +#define X86_SEG_AR_SEG_PRESENT  (1U << 7)  /* 7, segment present */
> +#define X86_SEG_AR_AVL          (1U << 12) /* 12, available for system software */
> +#define X86_SEG_AR_CS_LM_ACTIVE (1U << 13) /* 13, long mode active (CS only) */
> +#define X86_SEG_AR_DEF_OP_SIZE  (1U << 14) /* 14, default operation size */
> +#define X86_SEG_AR_GRANULARITY  (1U << 15) /* 15, granularity */
> +#define X86_SEG_AR_SEG_UNUSABLE (1U << 16) /* 16, segment unusable */
>  
>  #define VMCALL_OPCODE   ".byte 0x0f,0x01,0xc1\n"
>  #define VMCLEAR_OPCODE  ".byte 0x66,0x0f,0xc7\n"        /* reg/opcode: /6 */
> @@ -606,7 +606,7 @@ static inline void vmx_pi_hooks_assign(struct domain *d) {}
>  static inline void vmx_pi_hooks_deassign(struct domain *d) {}
>  #endif
>  
> -#define APIC_INVALID_DEST           0xffffffff
> +#define APIC_INVALID_DEST           0xffffffffU
>  
>  /* EPT violation qualifications definitions */
>  typedef union ept_qual {
> -- 
> 2.41.0
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 23:42:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 23:42:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559573.874665 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHC8j-0001xM-3l; Wed, 05 Jul 2023 23:42:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559573.874665; Wed, 05 Jul 2023 23:42:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHC8j-0001xF-11; Wed, 05 Jul 2023 23:42:29 +0000
Received: by outflank-mailman (input) for mailman id 559573;
 Wed, 05 Jul 2023 23:42:28 +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
 <SRS0=UsP3=CX=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHC8i-0001x9-DC
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 23:42:28 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 980e11d9-1b8d-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 01:42:26 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id BFC5E6177F;
 Wed,  5 Jul 2023 23:42:24 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4AC9C433C7;
 Wed,  5 Jul 2023 23:42:22 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 980e11d9-1b8d-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688600544;
	bh=dWbri8bzF1HDakQksuSj1aHl1CKUSs74FrqPbyC1llM=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=FRDMnjqVAPkfNYvHrPI4AiszoUMOWvqpY+91FdUbXFmxrK3E5h3IbrOTHXfuIQhL4
	 GtAcjR2Eeo1ajdqlE1f5im3w2IJYa08eCjm4BtjXf0mpz6MwezavxtDS/IjFWf/psp
	 QuQ45u4BpuQM1Hiz6eH5+pu3u1cCK6t0BUnFKIE2+eX/+HtcpQisBljppuUHtPctIi
	 RTPXiQrU0bZpBfDAmDRhOAVB1JPL45f657jUNwyGgKyYxfTLSaiyfw/yjPn5zP3rFf
	 mUmvu3ztpOIP98n21cK/7CW6pm435wQ5pdKeAPRg8mhPBJek+sUDnVof79EY17BKcf
	 LigqD1AttGqjQ==
Date: Wed, 5 Jul 2023 16:42:20 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Gianluca Luparini <gianluca.luparini@bugseng.com>, 
    Juergen Gross <jgross@suse.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH v2 09/13] xen/public: fix violations of MISRA C:2012
 Rule 7.2
In-Reply-To: <9e0d463e2fc09193a742fc7a64a331855705a4fb.1688559115.git.gianluca.luparini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307051641350.761183@ubuntu-linux-20-04-desktop>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com> <9e0d463e2fc09193a742fc7a64a331855705a4fb.1688559115.git.gianluca.luparini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 5 Jul 2023, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type and also to other
> literals used in the same contexts or near violations, when their positive
> nature is immediately clear. The latter changes are done for the sake of
> uniformity.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes in v2:
> - minor change to commit title
> - change commit message
> - correct macros code style
> ---
>  xen/include/public/io/ring.h | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/include/public/io/ring.h b/xen/include/public/io/ring.h
> index 025939278b..0cae4367be 100644
> --- a/xen/include/public/io/ring.h
> +++ b/xen/include/public/io/ring.h
> @@ -36,11 +36,11 @@
>  typedef unsigned int RING_IDX;
>  
>  /* Round a 32-bit unsigned constant down to the nearest power of two. */
> -#define __RD2(_x)  (((_x) & 0x00000002) ? 0x2                  : ((_x) & 0x1))
> -#define __RD4(_x)  (((_x) & 0x0000000c) ? __RD2((_x)>>2)<<2    : __RD2(_x))
> -#define __RD8(_x)  (((_x) & 0x000000f0) ? __RD4((_x)>>4)<<4    : __RD4(_x))
> -#define __RD16(_x) (((_x) & 0x0000ff00) ? __RD8((_x)>>8)<<8    : __RD8(_x))
> -#define __RD32(_x) (((_x) & 0xffff0000) ? __RD16((_x)>>16)<<16 : __RD16(_x))
> +#define __RD2(x)  (((x) & 0x00000002U) ? 0x2                     : ((x) & 0x1))
> +#define __RD4(x)  (((x) & 0x0000000cU) ? __RD2((x) >> 2) << 2    : __RD2(x))
> +#define __RD8(x)  (((x) & 0x000000f0U) ? __RD4((x) >> 4) << 4    : __RD4(x))
> +#define __RD16(x) (((x) & 0x0000ff00U) ? __RD8((x) >> 8) << 8    : __RD8(x))
> +#define __RD32(x) (((x) & 0xffff0000U) ? __RD16((x) >> 16) << 16 : __RD16(x))
>  
>  /*
>   * Calculate size of a shared ring, given the total available space for the
> -- 
> 2.41.0
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 05 23:49:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Jul 2023 23:49:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559579.874675 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHCFQ-0002f8-VW; Wed, 05 Jul 2023 23:49:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559579.874675; Wed, 05 Jul 2023 23:49:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHCFQ-0002f1-Ry; Wed, 05 Jul 2023 23:49:24 +0000
Received: by outflank-mailman (input) for mailman id 559579;
 Wed, 05 Jul 2023 23:49:23 +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
 <SRS0=UsP3=CX=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHCFP-0002ep-72
 for xen-devel@lists.xenproject.org; Wed, 05 Jul 2023 23:49:23 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8f2b3672-1b8e-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 01:49:20 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 4787F616D6;
 Wed,  5 Jul 2023 23:49:19 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECCDCC433C8;
 Wed,  5 Jul 2023 23:49:16 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8f2b3672-1b8e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688600958;
	bh=N6zwyVtFXjFKJh4rOltiMDQHpi3dRk/+f74ARbfihAA=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=CgIcq3eHoZyXIqvPNoPXNAyjFPE4Oy/3UVN6L999qEhhpiyZf2dQTzTV2ulr2qtZ2
	 20RHuPzH0zE9QVvYOfUuoq/uSvxn9ILc1p8bD8qgb02/FYqhVGmwm4Ck/Slwvdzq7W
	 FJkT4rBVJ06t1JTHHq2unxsXorQw1JGTFL96oSEVdWx+P8pJSz+qLWNctbqJwLjQ9Y
	 iWc2Cz5RVjBaFl0FY8QvHN13YnTKKvI+dSO8P/tj7gj5eXqsJLPOviAWfZKtr4We+C
	 Mxw4xrhLIZ2UlC75/8nZjltknhabQCMAlePAXDqVC0rZZ1W9O8WhIGfT6kFdbcfSFo
	 YkZ1TTrJrNjdA==
Date: Wed, 5 Jul 2023 16:49:14 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Gianluca Luparini <gianluca.luparini@bugseng.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Wei Liu <wl@xen.org>, Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH v2 13/13] xen: fix violations of MISRA C:2012 Rule
 7.2
In-Reply-To: <76cf70cb43492966fbcf77d7a2d67d90fe0a32d4.1688559115.git.gianluca.luparini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307051646360.761183@ubuntu-linux-20-04-desktop>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com> <76cf70cb43492966fbcf77d7a2d67d90fe0a32d4.1688559115.git.gianluca.luparini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 5 Jul 2023, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type and also to other
> literals used in the same contexts or near violations, when their positive
> nature is immediately clear. The latter changes are done for the sake of
> uniformity.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> ---
> Changes in v2:
> - minor change to commit title
> - change commit message
> - add '(uint32_t)' in 'muldiv64.c' for consistency
> - add fix in 'vesa.c'
> ---
>  xen/common/gunzip.c          |  2 +-
>  xen/common/xmalloc_tlsf.c    |  2 +-
>  xen/drivers/char/ehci-dbgp.c |  4 ++--
>  xen/drivers/video/vesa.c     |  2 +-
>  xen/include/public/memory.h  |  2 +-
>  xen/include/public/sysctl.h  |  4 ++--
>  xen/include/xen/bitops.h     | 10 +++++-----
>  xen/include/xen/cper.h       | 34 +++++++++++++++++-----------------
>  xen/lib/muldiv64.c           |  2 +-
>  9 files changed, 31 insertions(+), 31 deletions(-)
> 
> diff --git a/xen/common/gunzip.c b/xen/common/gunzip.c
> index 71ec5f26be..b810499be2 100644
> --- a/xen/common/gunzip.c
> +++ b/xen/common/gunzip.c
> @@ -11,7 +11,7 @@ static unsigned char *__initdata window;
>  static memptr __initdata free_mem_ptr;
>  static memptr __initdata free_mem_end_ptr;
>  
> -#define WSIZE           0x80000000
> +#define WSIZE           0x80000000U
>  
>  static unsigned char *__initdata inbuf;
>  static unsigned int __initdata insize;
> diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c
> index 75bdf18c4e..c21bf71e88 100644
> --- a/xen/common/xmalloc_tlsf.c
> +++ b/xen/common/xmalloc_tlsf.c
> @@ -46,7 +46,7 @@
>  #define BHDR_OVERHEAD   (sizeof(struct bhdr) - MIN_BLOCK_SIZE)
>  
>  #define PTR_MASK        (sizeof(void *) - 1)
> -#define BLOCK_SIZE_MASK (0xFFFFFFFF - PTR_MASK)
> +#define BLOCK_SIZE_MASK (0xFFFFFFFFU - PTR_MASK)
>  
>  #define GET_NEXT_BLOCK(addr, r) ((struct bhdr *) \
>                                  ((char *)(addr) + (r)))
> diff --git a/xen/drivers/char/ehci-dbgp.c b/xen/drivers/char/ehci-dbgp.c
> index bb9d3198d9..4d8d765122 100644
> --- a/xen/drivers/char/ehci-dbgp.c
> +++ b/xen/drivers/char/ehci-dbgp.c
> @@ -375,12 +375,12 @@ static inline u32 dbgp_pid_write_update(u32 x, u32 tok)
>      static u8 data0 = USB_PID_DATA1;
>  
>      data0 ^= USB_PID_DATA0 ^ USB_PID_DATA1;
> -    return (x & 0xffff0000) | (data0 << 8) | (tok & 0xff);
> +    return (x & 0xffff0000U) | (data0 << 8) | (tok & 0xffU);
>  }
>  
>  static inline u32 dbgp_pid_read_update(u32 x, u32 tok)
>  {
> -    return (x & 0xffffff00) | (tok & 0xff);
> +    return (x & 0xffffff00U) | (tok & 0xffU);
>  }
>  
>  static inline void dbgp_set_data(struct ehci_dbg_port __iomem *ehci_debug,
> diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c
> index c41f6b8d40..b007ff5678 100644
> --- a/xen/drivers/video/vesa.c
> +++ b/xen/drivers/video/vesa.c
> @@ -123,7 +123,7 @@ void __init vesa_init(void)
>      if ( vlfb_info.bits_per_pixel > 8 )
>      {
>          /* Light grey in truecolor. */
> -        unsigned int grey = 0xaaaaaaaa;
> +        unsigned int grey = 0xaaaaaaaaU;
>          lfbp.pixel_on =
>              ((grey >> (32 - vlfb_info.  red_size)) << vlfb_info.  red_pos) |
>              ((grey >> (32 - vlfb_info.green_size)) << vlfb_info.green_pos) |
> diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
> index c5f0d31e23..5e545ae9a4 100644
> --- a/xen/include/public/memory.h
> +++ b/xen/include/public/memory.h
> @@ -234,7 +234,7 @@ struct xen_add_to_physmap {
>  
>      unsigned int space; /* => enum phys_map_space */
>  
> -#define XENMAPIDX_grant_table_status 0x80000000
> +#define XENMAPIDX_grant_table_status 0x80000000U
>  
>      /* Index into space being mapped. */
>      xen_ulong_t idx;
> diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
> index 33e86ace51..fa7147de47 100644
> --- a/xen/include/public/sysctl.h
> +++ b/xen/include/public/sysctl.h
> @@ -384,7 +384,7 @@ struct xen_sysctl_pm_op {
>          struct xen_set_cpufreq_para set_para;
>          uint64_aligned_t get_avgfreq;
>          uint32_t                    set_sched_opt_smt;
> -#define XEN_SYSCTL_CX_UNLIMITED 0xffffffff
> +#define XEN_SYSCTL_CX_UNLIMITED 0xffffffffU
>          uint32_t                    get_max_cstate;
>          uint32_t                    set_max_cstate;
>      } u;
> @@ -547,7 +547,7 @@ struct xen_sysctl_numainfo {
>  #define XEN_SYSCTL_CPUPOOL_OP_RMCPU                 5  /* R */
>  #define XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN            6  /* M */
>  #define XEN_SYSCTL_CPUPOOL_OP_FREEINFO              7  /* F */
> -#define XEN_SYSCTL_CPUPOOL_PAR_ANY     0xFFFFFFFF
> +#define XEN_SYSCTL_CPUPOOL_PAR_ANY     0xFFFFFFFFU
>  struct xen_sysctl_cpupool_op {
>      uint32_t op;          /* IN */
>      uint32_t cpupool_id;  /* IN: CDIARM OUT: CI */
> diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
> index 33619a0873..3b7e09a26e 100644
> --- a/xen/include/xen/bitops.h
> +++ b/xen/include/xen/bitops.h
> @@ -227,11 +227,11 @@ static inline __u32 ror32(__u32 word, unsigned int shift)
>  }
>  
>  /* base-2 logarithm */
> -#define __L2(_x)  (((_x) & 0x00000002) ?   1 : 0)
> -#define __L4(_x)  (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
> -#define __L8(_x)  (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
> -#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
> -#define ilog2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x))
> +#define __L2(_x)  (((_x) & 0x00000002U) ?   1 : 0)
> +#define __L4(_x)  (((_x) & 0x0000000cU) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
> +#define __L8(_x)  (((_x) & 0x000000f0U) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
> +#define __L16(_x) (((_x) & 0x0000ff00U) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
> +#define ilog2(_x) (((_x) & 0xffff0000U) ? (16 + __L16((_x)>>16)) : __L16(_x))

Jan, would you want to replace _x with x here as well?

If so, I think it would be best if done in a separate patch (keep
mechanical changes mechanical) and keep this patch as is:

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


>  /**
>   * for_each_set_bit - iterate over every set bit in a memory region
> diff --git a/xen/include/xen/cper.h b/xen/include/xen/cper.h
> index f8e5272bc1..71d14faa02 100644
> --- a/xen/include/xen/cper.h
> +++ b/xen/include/xen/cper.h
> @@ -56,7 +56,7 @@ static inline uint64_t cper_next_record_id(void)
>  #define CPER_SIG_RECORD				"CPER"
>  #define CPER_SIG_SIZE				4
>  /* Used in signature_end field in struct cper_record_header */
> -#define CPER_SIG_END				0xffffffff
> +#define CPER_SIG_END				0xffffffffU
>  
>  /*
>   * CPER record header revision, used in revision field in struct
> @@ -80,36 +80,36 @@ static inline uint64_t cper_next_record_id(void)
>   * Corrected Machine Check
>   */
>  #define CPER_NOTIFY_CMC							\
> -	UUID_LE(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4,	\
> -		0xEB, 0xD4, 0xF8, 0x90)
> +	UUID_LE(0x2DCE8BB1U, 0xBDD7U, 0x450eU, 0xB9U, 0xADU, 0x9CU, 0xF4U,	\
> +		0xEBU, 0xD4U, 0xF8U, 0x90U)
>  /* Corrected Platform Error */
>  #define CPER_NOTIFY_CPE							\
> -	UUID_LE(0x4E292F96, 0xD843, 0x4a55, 0xA8, 0xC2, 0xD4, 0x81,	\
> -		0xF2, 0x7E, 0xBE, 0xEE)
> +	UUID_LE(0x4E292F96U, 0xD843U, 0x4a55U, 0xA8U, 0xC2U, 0xD4U, 0x81U,	\
> +		0xF2U, 0x7EU, 0xBEU, 0xEEU)
>  /* Machine Check Exception */
>  #define CPER_NOTIFY_MCE							\
> -	UUID_LE(0xE8F56FFE, 0x919C, 0x4cc5, 0xBA, 0x88, 0x65, 0xAB,	\
> -		0xE1, 0x49, 0x13, 0xBB)
> +	UUID_LE(0xE8F56FFEU, 0x919CU, 0x4cc5U, 0xBAU, 0x88U, 0x65U, 0xABU,	\
> +		0xE1U, 0x49U, 0x13U, 0xBBU)
>  /* PCI Express Error */
>  #define CPER_NOTIFY_PCIE						\
> -	UUID_LE(0xCF93C01F, 0x1A16, 0x4dfc, 0xB8, 0xBC, 0x9C, 0x4D,	\
> -		0xAF, 0x67, 0xC1, 0x04)
> +	UUID_LE(0xCF93C01FU, 0x1A16U, 0x4dfcU, 0xB8U, 0xBCU, 0x9CU, 0x4DU,	\
> +		0xAFU, 0x67U, 0xC1U, 0x04U)
>  /* INIT Record (for IPF) */
>  #define CPER_NOTIFY_INIT						\
> -	UUID_LE(0xCC5263E8, 0x9308, 0x454a, 0x89, 0xD0, 0x34, 0x0B,	\
> -		0xD3, 0x9B, 0xC9, 0x8E)
> +	UUID_LE(0xCC5263E8U, 0x9308U, 0x454aU, 0x89U, 0xD0U, 0x34U, 0x0BU,	\
> +		0xD3U, 0x9BU, 0xC9U, 0x8EU)
>  /* Non-Maskable Interrupt */
>  #define CPER_NOTIFY_NMI							\
> -	UUID_LE(0x5BAD89FF, 0xB7E6, 0x42c9, 0x81, 0x4A, 0xCF, 0x24,	\
> -		0x85, 0xD6, 0xE9, 0x8A)
> +	UUID_LE(0x5BAD89FFU, 0xB7E6U, 0x42c9U, 0x81U, 0x4AU, 0xCFU, 0x24U,	\
> +		0x85U, 0xD6U, 0xE9U, 0x8AU)
>  /* BOOT Error Record */
>  #define CPER_NOTIFY_BOOT						\
> -	UUID_LE(0x3D61A466, 0xAB40, 0x409a, 0xA6, 0x98, 0xF3, 0x62,	\
> -		0xD4, 0x64, 0xB3, 0x8F)
> +	UUID_LE(0x3D61A466U, 0xAB40U, 0x409aU, 0xA6U, 0x98U, 0xF3U, 0x62U,	\
> +		0xD4U, 0x64U, 0xB3U, 0x8FU)
>  /* DMA Remapping Error */
>  #define CPER_NOTIFY_DMAR						\
> -	UUID_LE(0x667DD791, 0xC6B3, 0x4c27, 0x8A, 0x6B, 0x0F, 0x8E,	\
> -		0x72, 0x2D, 0xEB, 0x41)
> +	UUID_LE(0x667DD791U, 0xC6B3U, 0x4c27U, 0x8AU, 0x6BU, 0x0FU, 0x8EU,	\
> +		0x72U, 0x2DU, 0xEBU, 0x41U)
>  
>  /*
>   * Flags bits definitions for flags in struct cper_record_header
> diff --git a/xen/lib/muldiv64.c b/xen/lib/muldiv64.c
> index 78177ce616..e9bacc4c59 100644
> --- a/xen/lib/muldiv64.c
> +++ b/xen/lib/muldiv64.c
> @@ -27,7 +27,7 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)
>      rh = (uint64_t)u.l.high * (uint64_t)b;
>      rh += (rl >> 32);
>      res.l.high = rh / c;
> -    res.l.low = (((rh % c) << 32) + (rl & 0xffffffff)) / c;
> +    res.l.low = (((rh % c) << 32) + ((uint32_t)rl & 0xffffffffU)) / c;
>  
>      return res.ll;
>  #endif
> -- 
> 2.41.0
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 00:11:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 00:11:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559583.874684 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHCb8-0006db-Aq; Thu, 06 Jul 2023 00:11:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559583.874684; Thu, 06 Jul 2023 00:11:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHCb8-0006dU-8I; Thu, 06 Jul 2023 00:11:50 +0000
Received: by outflank-mailman (input) for mailman id 559583;
 Thu, 06 Jul 2023 00:11:48 +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
 <SRS0=9JNo=CY=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHCb6-0006dO-94
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 00:11:48 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b0f64186-1b91-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 02:11:45 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 461AE61780;
 Thu,  6 Jul 2023 00:11:44 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF5C1C433C7;
 Thu,  6 Jul 2023 00:11:41 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b0f64186-1b91-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688602303;
	bh=Y3MUHD3iL66yRkr5/mlylaIgHmjmvCNQvdOMp5ArEzw=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=hMC8zqsn6xYWEoQeIXTHhzMFwibaQ+G+Bn5qKdFVxdGzxsA+5tfvohj9AfCyfWi4E
	 EpAAmekKLvjK70pF9/SEsW0x+YS/4x4M/TQP9Ea9rDiY2oddX0QFcwjPRntOy3lgS/
	 7Jcfl32BEkd0ysX6x+yLzEDuDCC8Dxcg81Ew44XV41CtXVs+9oaGrD+V2n/IUinaNJ
	 N5ti6eikf07KawCwY9yQyPfL96qn50zROeGY+kykLN4eXspkmLtZ4tzutoSZpZY8iS
	 +GU8dmjWyQRYbGlFld65iS+LjYPCAbFA3OwschsxcI2Whk+JU5ezU99afBefdpsAFD
	 UKWkvvEgGeIMg==
Date: Wed, 5 Jul 2023 17:11:40 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Gianluca Luparini <gianluca.luparini@bugseng.com>, 
    Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Paul Durrant <paul@xen.org>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH v2 12/13] xen/x86: fix violations of MISRA C:2012
 Rule 7.2
In-Reply-To: <e414542d76d4a4a0df6ad969cc6332e355d6ef38.1688559115.git.gianluca.luparini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307051704030.761183@ubuntu-linux-20-04-desktop>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com> <e414542d76d4a4a0df6ad969cc6332e355d6ef38.1688559115.git.gianluca.luparini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 5 Jul 2023, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type and also to other
> literals used in the same contexts or near violations, when their positive
> nature is immediately clear. The latter changes are done for the sake of
> uniformity.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>

[...]

> diff --git a/xen/arch/x86/extable.c b/xen/arch/x86/extable.c
> index c3771c2e39..6951a433e8 100644
> --- a/xen/arch/x86/extable.c
> +++ b/xen/arch/x86/extable.c
> @@ -141,7 +141,7 @@ static int __init cf_check stub_selftest(void)
>            .rax = 0x0123456789abcdef,
>            .res.fields.trapnr = X86_EXC_GP },
>          { .opc = { endbr64, 0x02, 0x04, 0x04, 0xc3 }, /* add (%rsp,%rax),%al */
> -          .rax = 0xfedcba9876543210,
> +          .rax = 0xfedcba9876543210U,

In my opinion 64-bit values should be either UL or ULL. This one should
be UL ?

Everything else looks fine to me


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 01:36:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 01:36:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559587.874695 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHDuz-0004lA-Em; Thu, 06 Jul 2023 01:36:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559587.874695; Thu, 06 Jul 2023 01:36:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHDuz-0004kw-7L; Thu, 06 Jul 2023 01:36:25 +0000
Received: by outflank-mailman (input) for mailman id 559587;
 Thu, 06 Jul 2023 01:36:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHDuy-0004km-8e; Thu, 06 Jul 2023 01:36:24 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHDux-0000Dc-PV; Thu, 06 Jul 2023 01:36:23 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHDux-0007OA-6y; Thu, 06 Jul 2023 01:36:23 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qHDux-0003s8-6W; Thu, 06 Jul 2023 01:36:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=SuboR2FCc3V8bEyPt0CcTloUm4fqbEftrz6y8CZg0OA=; b=tB148ZNxNzj6GkzE3HgSA/SmLB
	7U3r8aWrqfSvcW93cG6pbkivTNmrsPFZ7GNKpTOe5K+nLT+XzCmTtBveDcNJlVlmQuMkmjLRVk/08
	5ta/paB2/dTc3u2uNnYaGweRtgYvTnmPTtrtrel8Y9Jy8tD47lV8h+gjvzSJUzsh1XPI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181706-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181706: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pygrub:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-libvirt:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:debian-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:leak-check/basis/src_host(18):fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:leak-check/basis/dst_host(19):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:windows-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-multivcpu:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-xsm:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-rtds:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:xen-boot:fail:heisenbug
    linux-linus:test-arm64-arm64-xl:guest-stop:fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-credit2:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/dst_host:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-rtds:leak-check/basis(11):fail:allowable
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=d528014517f2b0531862c02865b9d4c908019dc4
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 06 Jul 2023 01:36:23 +0000

flight 181706 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181706/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-pygrub       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2 11 leak-check/basis(11)   fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd  8 xen-boot            fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm      12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd 12 debian-install          fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu 14 guest-start             fail REGR. vs. 180278
 test-amd64-amd64-xl          12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-libvirt     12 debian-install fail in 181700 REGR. vs. 180278
 test-amd64-amd64-xl-credit2  12 debian-install fail in 181700 REGR. vs. 180278
 test-amd64-amd64-xl-shadow   12 debian-install fail in 181700 REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 18 leak-check/basis/src_host(18) fail in 181700 REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 19 leak-check/basis/dst_host(19) fail in 181700 REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 12 windows-install fail in 181700 REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 11 leak-check/basis(11) fail in 181700 pass in 181706
 test-amd64-amd64-xl-multivcpu  8 xen-boot        fail in 181700 pass in 181706
 test-amd64-amd64-xl           8 xen-boot         fail in 181700 pass in 181706
 test-amd64-amd64-xl-xsm       8 xen-boot         fail in 181700 pass in 181706
 test-amd64-amd64-xl-pvhv2-amd 11 leak-check/basis(11) fail in 181700 pass in 181706
 test-amd64-amd64-xl-rtds      8 xen-boot         fail in 181700 pass in 181706
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 8 xen-boot fail in 181700 pass in 181706
 test-arm64-arm64-xl          17 guest-stop       fail in 181700 pass in 181706
 test-amd64-amd64-libvirt     11 leak-check/basis(11)       fail pass in 181700
 test-amd64-amd64-xl-credit2  11 leak-check/basis(11)       fail pass in 181700
 test-amd64-amd64-xl-qemut-ws16-amd64  8 xen-boot           fail pass in 181700
 test-amd64-amd64-xl-shadow    8 xen-boot                   fail pass in 181700
 test-amd64-amd64-libvirt-pair 13 xen-boot/dst_host         fail pass in 181700

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds     11 leak-check/basis(11)     fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                d528014517f2b0531862c02865b9d4c908019dc4
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   80 days
Failing since        180281  2023-04-17 06:24:36 Z   79 days  156 attempts
Testing same since   181700  2023-07-05 02:59:54 Z    0 days    2 attempts

------------------------------------------------------------
3658 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 599534 lines long.)


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 03:51:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 03:51:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559597.874705 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHG1M-0002A9-RB; Thu, 06 Jul 2023 03:51:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559597.874705; Thu, 06 Jul 2023 03:51:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHG1M-0002A2-Ne; Thu, 06 Jul 2023 03:51:08 +0000
Received: by outflank-mailman (input) for mailman id 559597;
 Thu, 06 Jul 2023 03:51:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=q9yd=CY=microsoft.com=mikelley@srs-se1.protection.inumbo.net>)
 id 1qHG1L-00029w-9U
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 03:51:07 +0000
Received: from DM5PR00CU002.outbound.protection.outlook.com
 (mail-cusazlp170110003.outbound.protection.outlook.com
 [2a01:111:f403:c111::3])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 52cccaff-1bb0-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 05:51:04 +0200 (CEST)
Received: from BYAPR21MB1688.namprd21.prod.outlook.com (2603:10b6:a02:bf::26)
 by DM4PR21MB3538.namprd21.prod.outlook.com (2603:10b6:8:a2::21) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.4; Thu, 6 Jul
 2023 03:50:56 +0000
Received: from BYAPR21MB1688.namprd21.prod.outlook.com
 ([fe80::4295:75a9:26d2:e64]) by BYAPR21MB1688.namprd21.prod.outlook.com
 ([fe80::4295:75a9:26d2:e64%5]) with mapi id 15.20.6588.006; Thu, 6 Jul 2023
 03:50:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 52cccaff-1bb0-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Fz5ncPKoNIEylk7JFXusCVzyuedqPPXKpDgSI+RS9cHSnBCOQGlKk3y8sv+/DUveDv0bVtZN1a5Fu2i8mcSf0/5gj5zGBumZKyPpUbyDqZCjk/+aErYdkm6wioJ/X7Lpj3YhrzZDQcEKSXpvUjPzok3H/IbZky0klQpah2XtMJX1/md4e5cBu5+g0oPPtNULQALSmpvhHeTOT+oMoiUMMkQBfMAMDwIMv1DJ5dZ/AglSORfoLSN1ToPGLn52Z4G7OiWl06jpGJUTvJ0pIfc4VrClFyqzfuMUftI3+ueg/O9UwbX2Ut8bzf/IHTDRpbuYJXIFPI6US2a7bYqUn7YJdw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=T1zbsxGPrJMiTo/S/Ks0ebDluwilIcyqNnqUC0ir39k=;
 b=Ail+0IJehakkj1Zod0fPQHg1yQShl9TDakZSyxOf6oyBoB9yx28LbcxyjOSCzMPqnzqQQbyI8vdDPvnjdz+g+oWOVsWfNhInLT4LOxnIjoRtlXdNNDqgfwj/Ef+A8wsDqHz+9AD2626XF+5Z6jff69y5l/4Aj+ntqZWA+jRrJJ0GVLrS8DDpVbdS6+S+UqXOXgiHjytEdyn3ya6gkOb2BDOtYqoJaprgCXrZQbPD+yGo0dcXTcZsEYStTmWhHjKnduNmkVSykKf7TCGkeXygnUPFVCBnhut8Q92Qp1mlHMFKfR+JiMC4Hlyu5djeK6IYpAWOZMy6HbmpkebbYhXsRw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=microsoft.com; dmarc=pass action=none
 header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=T1zbsxGPrJMiTo/S/Ks0ebDluwilIcyqNnqUC0ir39k=;
 b=FHhBy+e+4a8aPoFnDSCHi7WbgFEopIjIOxsdEdECY3cgMry8kknLGrq4HRuAMbNvB3/V9YEr9mMapOkyx6qA6FVGv+aUCqVev/7G2aH2mAk7ktf4L5rUo62f9dyXZeWfj5Dplid8gmLVBGxV3IB+msMdBm4MxUGmxBy4oYLn7V4=
From: "Michael Kelley (LINUX)" <mikelley@microsoft.com>
To: Petr Tesarik <petrtesarik@huaweicloud.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>, "H. Peter
 Anvin" <hpa@zytor.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>, Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, Christoph Hellwig
	<hch@lst.de>, Marek Szyprowski <m.szyprowski@samsung.com>, Robin Murphy
	<robin.murphy@arm.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>, Jason Gunthorpe <jgg@ziepe.ca>, Kees
 Cook <keescook@chromium.org>, Saravana Kannan <saravanak@google.com>,
	"moderated list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>,
	"moderated list:ARM PORT" <linux-arm-kernel@lists.infradead.org>, open list
	<linux-kernel@vger.kernel.org>, "open list:MIPS"
	<linux-mips@vger.kernel.org>, "open list:XEN SWIOTLB SUBSYSTEM"
	<iommu@lists.linux.dev>
CC: Roberto Sassu <roberto.sassu@huaweicloud.com>, Kefeng Wang
	<wangkefeng.wang@huawei.com>, "petr@tesarici.cz" <petr@tesarici.cz>
Subject: RE: [PATCH v3 4/7] swiotlb: if swiotlb is full, fall back to a
 transient memory pool
Thread-Topic: [PATCH v3 4/7] swiotlb: if swiotlb is full, fall back to a
 transient memory pool
Thread-Index: AQHZqN4Es6xs27E7q0W1vSuhepPC1q+p0aJA
Date: Thu, 6 Jul 2023 03:50:55 +0000
Message-ID:
 <BYAPR21MB1688AAC65852E75764F53099D72CA@BYAPR21MB1688.namprd21.prod.outlook.com>
References: <cover.1687859323.git.petr.tesarik.ext@huawei.com>
 <34c2a1ba721a7bc496128aac5e20724e4077f1ab.1687859323.git.petr.tesarik.ext@huawei.com>
In-Reply-To:
 <34c2a1ba721a7bc496128aac5e20724e4077f1ab.1687859323.git.petr.tesarik.ext@huawei.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
 MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=a10c81ad-217e-4ea7-9f38-c5cae7c29d67;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2023-07-04T16:07:51Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=microsoft.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BYAPR21MB1688:EE_|DM4PR21MB3538:EE_
x-ms-office365-filtering-correlation-id: cddab2e1-cf6d-4306-1e20-08db7dd433d2
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info:
 mAH/4sOy5ewwQd2xsz2DYpBmsKFdtJQFBXVz72AcKc8CHjaG8urFZuLXk1bozQQbLq8sQSMARq80e2aD+XNdJsNXtrnv2iO3Zk1ajVnPswpKVjApQ75RCF2GLvQ8uhFEFAwXz0n1mvEqm3ivdp1e8OP9Fyy2hKS0RC8EuUFFUJyEKQT9Op1hefXPTEWaO9sIvyx6O6Zh0yEuyGmUG42+5Mhkp90UXNLENJExeiY/tPisQCKNNQ+v7Cu9VX45HhXAXyIkzwwDlgLy0Et3bgE0ekebuqM6OXM8VFXraGMMW3Rj7IaF6vrwQ2qgohteE06oLsw8J7BgJY+jC3AdKHFskzppG04EXtTRfuzcusErI0pZqNRz+V7/LyiahM0zrd9WCJCAuq+O7X6LhxKdvSnaS4wwLbNgyiP3Gl+j8pqnZbNgCm9vXkkSu1171/5O/nBW9oLKzK8WDxrtIKCM3f6zSTyRODaCccnx6Z+z+J0MKp06NHU+58VqbQf7xDXmyHbp9OSbi/9Zpnjbgxf9hRJ6tT9+FGfyDGKsn+Dky8Bwqd8D22zlQmYU8p++uiBN4+i98lYs4neZ1DOH0/cOKF1Kl+tqE6JakRxImZGkftf5AQ8zEcu0YcrVg/Q5FveKUHo2+Bi47YvVaC+9BVkDrfAL7JGQDergh9L3UAiF5seTx+R9KRDwqrfT4W4TI9mBer7dThx2kzTwDUVVf6CVttT/+Q==
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR21MB1688.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(366004)(136003)(376002)(396003)(39860400002)(451199021)(4326008)(316002)(86362001)(64756008)(26005)(66946007)(186003)(66556008)(76116006)(9686003)(66446008)(6506007)(66476007)(8990500004)(82950400001)(82960400001)(83380400001)(921005)(122000001)(2906002)(38100700002)(30864003)(7696005)(33656002)(71200400001)(5660300002)(52536014)(10290500003)(478600001)(54906003)(8676002)(110136005)(41300700001)(38070700005)(8936002)(7416002)(55016003)(579004)(309714004);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?WbzUp58HEqcsE8tJDgA2nJNT653vcfg3NRvs1OnAoehLuuyXquobDaA6ibT0?=
 =?us-ascii?Q?NTHMRcqxwMD1oEAj6Uth3kYV6fKPIAAhs0oljzDiOwFJikLKu2jEYj/X9/A1?=
 =?us-ascii?Q?Txp4SCnyYJt9oPmKCRP77m2hlocGz2nEyoFE15aPZXhKpZXEwF8hv8ELI7/x?=
 =?us-ascii?Q?Fk4lVuzE9tvKQkANc3CWSqDnOlc0TFiU1lLt5ZGwJiSqbgQ4rohf/NZgD6Lx?=
 =?us-ascii?Q?DGD3KFnR3OCt1mGasj6dphDC+N5PQlS2Mcz/Z9yllW5STtkzQgwHfmc83sIB?=
 =?us-ascii?Q?DT+1ATscssymcEy4UUXNx/qJCIJ4OSh5p7flYiKef9yIvLAoXU7v/yyLVjF1?=
 =?us-ascii?Q?o1Nho1NFHTV57HU8ZEmefa9z+bWfOs35YEUj7RGDm/DOQA+cPm2gkmKnvHcZ?=
 =?us-ascii?Q?f2UTKlhR4ueHYk6ZeUcjpjQzvNw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ClU?=
 =?us-ascii?Q?unUqxcG0TrMZ5P0j7jUzdhhnobTrSHHHiK0OXypK9oqx1yuDO5/TnAYVs1nb?=
 =?us-ascii?Q?v2VPq/BzuomdqaH6iq2BzGalHnQP4eZkrtD9YTLPZWg1SA2D4+aSITs4tIEP?=
 =?us-ascii?Q?sBvFmzp+Og2yjX6/WZ7HVnxd18TTfJKLJ3lSafZQBXyxnxm1jhpaS9lpT5vN?=
 =?us-ascii?Q?QKsHlCvzvpG6VQQgcuvB31e48tHH7dnX/yTQvqT5t8pWzcOwDQaPlIqVdCFD?=
 =?us-ascii?Q?HXNAIBCDDLRLmTaj3MI8wQtG/nN4XvZEMK+WkqnoYm+Gub3sVzLnTevbbXoW?=
 =?us-ascii?Q?2Q=3D=3D?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BYAPR21MB1688.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: cddab2e1-cf6d-4306-1e20-08db7dd433d2
X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jul 2023 03:50:55.8549
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: psHbcPHMKSymoQmaGty3EIrzhOFH9mBc5FFzkNgasGdLOuhHmBCxuD/jmXd+ciaATfd+uAQmlNA5Q92heKGCJstb2MPEC05vzATkv6GdfWs=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR21MB3538

From: Petr Tesarik <petrtesarik@huaweicloud.com> Sent: Tuesday, June 27, 20=
23 2:54 AM
>=20
> Try to allocate a transient memory pool if no suitable slots can be found=
,
> except when allocating from a restricted pool. The transient pool is just
> enough big for this one bounce buffer. It is inserted into a per-device
> list of transient memory pools, and it is freed again when the bounce
> buffer is unmapped.
>=20
> Transient memory pools are kept in an RCU list. A memory barrier is
> required after adding a new entry, because any address within a transient
> buffer must be immediately recognized as belonging to the SWIOTLB, even i=
f
> it is passed to another CPU.
>=20
> Deletion does not require any synchronization beyond RCU ordering
> guarantees. After a buffer is unmapped, its physical addresses may no
> longer be passed to the DMA API, so the memory range of the corresponding
> stale entry in the RCU list never matches. If the memory range gets
> allocated again, then it happens only after a RCU quiescent state.
>=20
> Since bounce buffers can now be allocated from different pools, add a
> parameter to swiotlb_alloc_pool() to let the caller know which memory poo=
l
> is used. Add swiotlb_find_pool() to find the memory pool corresponding to
> an address. This function is now also used by is_swiotlb_buffer(), becaus=
e
> a simple boundary check is no longer sufficient.
>=20
> The logic in swiotlb_alloc_tlb() is taken from __dma_direct_alloc_pages()=
,
> simplified and enhanced to use coherent memory pools if needed.
>=20
> Note that this is not the most efficient way to provide a bounce buffer,
> but when a DMA buffer can't be mapped, something may (and will) actually
> break. At that point it is better to make an allocation, even if it may b=
e
> an expensive operation.

I continue to think about swiotlb memory management from the standpoint
of CoCo VMs that may be quite large with high network and storage loads.
These VMs are often running mission-critical workloads that can't tolerate
a bounce buffer allocation failure.  To prevent such failures, the swiotlb
memory size must be overly large, which wastes memory.

Your new approach helps by using the coherent memory pools as an overflow
space.   But in a lot of ways, it only pushes the problem around.  As you
noted in your cover letter, reducing the initial size of the swiotlb might
require increasing the size of the coherent pools.

What might be really useful is to pend bounce buffer requests while the
new worker thread is adding more swiotlb pools.  Of course, requests made
from interrupt level can't be pended, but at least in my experience with la=
rge
CoCo VMs, storage I/O is the biggest consumer of bounce buffers.  A lot
(most?) storage requests make the swiotlb_map() call in a context where
it is OK to pend.   If the coherent pool overflow space is could be used on=
ly
for swiotlb_map() calls that can't pend, it's more likely to be sufficient =
to
bridge the gap until new pools are added.

Could swiotlb code detect if it's OK to pend, and then pend a bounce
buffer request until the worker thread adds a new pool?  Even an overly
conversative check would help reduce pressure on the coherent pools
as overflow space.

Michael

>=20
> Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
> ---
>  include/linux/device.h      |   4 +
>  include/linux/dma-mapping.h |   2 +
>  include/linux/swiotlb.h     |  13 +-
>  kernel/dma/direct.c         |   2 +-
>  kernel/dma/swiotlb.c        | 265 ++++++++++++++++++++++++++++++++++--
>  5 files changed, 272 insertions(+), 14 deletions(-)
>=20
> diff --git a/include/linux/device.h b/include/linux/device.h
> index 83081aa99e6a..a1ee4c5924b8 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -510,6 +510,8 @@ struct device_physical_location {
>   * @dma_mem:	Internal for coherent mem override.
>   * @cma_area:	Contiguous memory area for dma allocations
>   * @dma_io_tlb_mem: Software IO TLB allocator.  Not for driver use.
> + * @dma_io_tlb_pools:	List of transient swiotlb memory pools.
> + * @dma_io_tlb_lock:	Protects changes to the list of active pools.
>   * @archdata:	For arch-specific additions.
>   * @of_node:	Associated device tree node.
>   * @fwnode:	Associated device node supplied by platform firmware.
> @@ -615,6 +617,8 @@ struct device {
>  #endif
>  #ifdef CONFIG_SWIOTLB
>  	struct io_tlb_mem *dma_io_tlb_mem;
> +	struct list_head dma_io_tlb_pools;
> +	spinlock_t dma_io_tlb_lock;
>  #endif
>  	/* arch specific additions */
>  	struct dev_archdata	archdata;
> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
> index 0ee20b764000..c36c5a546787 100644
> --- a/include/linux/dma-mapping.h
> +++ b/include/linux/dma-mapping.h
> @@ -417,6 +417,8 @@ static inline void dma_sync_sgtable_for_device(struct=
 device
> *dev,
>  #define dma_get_sgtable(d, t, v, h, s) dma_get_sgtable_attrs(d, t, v, h,=
 s, 0)
>  #define dma_mmap_coherent(d, v, c, h, s) dma_mmap_attrs(d, v, c, h, s, 0=
)
>=20
> +bool dma_coherent_ok(struct device *dev, phys_addr_t phys, size_t size);
> +
>  static inline void *dma_alloc_coherent(struct device *dev, size_t size,
>  		dma_addr_t *dma_handle, gfp_t gfp)
>  {
> diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
> index 0aa6868cb68c..ae1688438850 100644
> --- a/include/linux/swiotlb.h
> +++ b/include/linux/swiotlb.h
> @@ -63,6 +63,7 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t =
phys,
>=20
>  /**
>   * struct io_tlb_pool - IO TLB memory pool descriptor
> + * @node:	Member of the IO TLB memory pool list.
>   * @start:	The start address of the swiotlb memory pool. Used to do a qu=
ick
>   *		range check to see if the memory was in fact allocated by this
>   *		API.
> @@ -77,22 +78,27 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_=
t
> phys,
>   *		see setup_io_tlb_npages().
>   * @used:	The number of used IO TLB slots.
>   * @late_alloc:	%true if allocated using the page allocator.
> + * @transient:  %true if transient memory pool.
>   * @nareas:	Number of areas in the pool.
>   * @area_nslabs: Number of slots in each area.
>   * @areas:	Array of memory area descriptors.
>   * @slots:	Array of slot descriptors.
> + * @rcu:	RCU head for swiotlb_dyn_free().
>   */
>  struct io_tlb_pool {
> +	struct list_head node;
>  	phys_addr_t start;
>  	phys_addr_t end;
>  	void *vaddr;
>  	unsigned long nslabs;
>  	unsigned long used;
>  	bool late_alloc;
> +	bool transient;
>  	unsigned int nareas;
>  	unsigned int area_nslabs;
>  	struct io_tlb_area *areas;
>  	struct io_tlb_slot *slots;
> +	struct rcu_head rcu;
>  };
>=20
>  /**
> @@ -120,6 +126,8 @@ struct io_tlb_mem {
>  #endif
>  };
>=20
> +struct io_tlb_pool *swiotlb_find_pool(struct device *dev, phys_addr_t pa=
ddr);
> +
>  /**
>   * is_swiotlb_buffer() - check if a physical address belongs to a swiotl=
b
>   * @dev:        Device which has mapped the buffer.
> @@ -133,9 +141,8 @@ struct io_tlb_mem {
>   */
>  static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t pad=
dr)
>  {
> -	struct io_tlb_mem *mem =3D dev->dma_io_tlb_mem;
> -
> -	return mem && paddr >=3D mem->pool->start && paddr < mem->pool->end;
> +	return dev->dma_io_tlb_mem &&
> +		!!swiotlb_find_pool(dev, paddr);
>  }
>=20
>  static inline bool is_swiotlb_force_bounce(struct device *dev)
> diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
> index 5595d1d5cdcc..820561cab38d 100644
> --- a/kernel/dma/direct.c
> +++ b/kernel/dma/direct.c
> @@ -66,7 +66,7 @@ static gfp_t dma_direct_optimal_gfp_mask(struct device =
*dev,
> u64 *phys_limit)
>  	return 0;
>  }
>=20
> -static bool dma_coherent_ok(struct device *dev, phys_addr_t phys, size_t=
 size)
> +bool dma_coherent_ok(struct device *dev, phys_addr_t phys, size_t size)
>  {
>  	dma_addr_t dma_addr =3D phys_to_dma_direct(dev, phys);
>=20
> diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
> index 4c5de91bda57..06b4fa7c2e9b 100644
> --- a/kernel/dma/swiotlb.c
> +++ b/kernel/dma/swiotlb.c
> @@ -35,6 +35,7 @@
>  #include <linux/memblock.h>
>  #include <linux/mm.h>
>  #include <linux/pfn.h>
> +#include <linux/rculist.h>
>  #include <linux/scatterlist.h>
>  #include <linux/set_memory.h>
>  #include <linux/spinlock.h>
> @@ -500,6 +501,157 @@ void __init swiotlb_exit(void)
>  	memset(mem, 0, sizeof(*mem));
>  }
>=20
> +/**
> + * alloc_dma_pages() - allocate pages to be used for DMA
> + * @gfp:	GFP flags for the allocation.
> + * @bytes:	Size of the buffer.
> + *
> + * Allocate pages from the buddy allocator. If successful, make the allo=
cated
> + * pages decrypted that they can be used for DMA.
> + *
> + * Return: Decrypted pages, or %NULL on failure.
> + */
> +static struct page *alloc_dma_pages(gfp_t gfp, size_t bytes)
> +{
> +	unsigned int order =3D get_order(bytes);
> +	struct page *page;
> +	void *vaddr;
> +
> +	page =3D alloc_pages(gfp, order);
> +	if (!page)
> +		return NULL;
> +
> +	vaddr =3D page_address(page);
> +	if (set_memory_decrypted((unsigned long)vaddr, PFN_UP(bytes))) {
> +		__free_pages(page, order);
> +		return NULL;
> +	}
> +
> +	return page;
> +}
> +
> +/**
> + * swiotlb_alloc_tlb() - allocate a dynamic IO TLB buffer
> + * @dev:	Device for which a memory pool is allocated.
> + * @bytes:	Size of the buffer.
> + * @phys_limit:	Maximum allowed physical address of the buffer.
> + * @gfp:	GFP flags for the allocation.
> + *
> + * Return: Allocated pages, or %NULL on allocation failure.
> + */
> +static struct page *swiotlb_alloc_tlb(struct device *dev, size_t bytes,
> +		u64 phys_limit, gfp_t gfp)
> +{
> +	struct page *page;
> +
> +	/*
> +	 * Allocate from the atomic pools if memory is encrypted and
> +	 * the allocation is atomic, because decrypting may block.
> +	 */
> +	if (dev && force_dma_unencrypted(dev) && !gfpflags_allow_blocking(gfp))=
 {
> +		void *vaddr;
> +
> +		return IS_ENABLED(CONFIG_DMA_COHERENT_POOL)
> +			? dma_alloc_from_pool(dev, bytes, &vaddr, gfp,
> +					      dma_coherent_ok)
> +			: NULL;
> +	}
> +
> +	gfp &=3D ~GFP_ZONEMASK;
> +	if (phys_limit <=3D DMA_BIT_MASK(zone_dma_bits))
> +		gfp |=3D __GFP_DMA;
> +	else if (phys_limit <=3D DMA_BIT_MASK(32))
> +		gfp |=3D __GFP_DMA32;
> +
> +	while ((page =3D alloc_dma_pages(gfp, bytes)) &&
> +	       page_to_phys(page) + bytes - 1 > phys_limit) {
> +		/* allocated, but too high */
> +		__free_pages(page, get_order(bytes));
> +
> +		if (IS_ENABLED(CONFIG_ZONE_DMA32) &&
> +		    phys_limit < DMA_BIT_MASK(64) &&
> +		    !(gfp & (__GFP_DMA32 | __GFP_DMA)))
> +			gfp |=3D __GFP_DMA32;
> +		else if (IS_ENABLED(CONFIG_ZONE_DMA) &&
> +			 !(gfp & __GFP_DMA))
> +			gfp =3D (gfp & ~__GFP_DMA32) | __GFP_DMA;
> +		else
> +			return NULL;
> +	}
> +
> +	return page;
> +}
> +
> +/**
> + * swiotlb_free_tlb() - free a dynamically allocated IO TLB buffer
> + * @vaddr:	Virtual address of the buffer.
> + * @bytes:	Size of the buffer.
> + */
> +static void swiotlb_free_tlb(void *vaddr, size_t bytes)
> +{
> +	if (IS_ENABLED(CONFIG_DMA_COHERENT_POOL) &&
> +	    dma_free_from_pool(NULL, vaddr, bytes))
> +		return;
> +
> +	/* Intentional leak if pages cannot be encrypted again. */
> +	if (!set_memory_encrypted((unsigned long)vaddr, PFN_UP(bytes)))
> +		__free_pages(virt_to_page(vaddr), get_order(bytes));
> +}
> +
> +/**
> + * swiotlb_alloc_pool() - allocate a new IO TLB memory pool
> + * @dev:	Device for which a memory pool is allocated.
> + * @nslabs:	Desired number of slabs.
> + * @phys_limit:	Maximum DMA buffer physical address.
> + * @gfp:	GFP flags for the allocations.
> + *
> + * Allocate and initialize a new IO TLB memory pool.
> + *
> + * Return: New memory pool, or %NULL on allocation failure.
> + */
> +static struct io_tlb_pool *swiotlb_alloc_pool(struct device *dev,
> +		unsigned int nslabs, u64 phys_limit, gfp_t gfp)
> +{
> +	struct io_tlb_pool *pool;
> +	struct page *tlb;
> +	size_t pool_size;
> +	size_t tlb_size;
> +
> +	pool_size =3D sizeof(*pool) + array_size(sizeof(*pool->areas), 1) +
> +		array_size(sizeof(*pool->slots), nslabs);
> +	pool =3D kzalloc(pool_size, gfp);
> +	if (!pool)
> +		goto error;
> +	pool->areas =3D (void *)pool + sizeof(*pool);
> +	pool->slots =3D (void *)pool->areas + sizeof(*pool->areas);
> +
> +	tlb_size =3D nslabs << IO_TLB_SHIFT;
> +	tlb =3D swiotlb_alloc_tlb(dev, tlb_size, phys_limit, gfp);
> +	if (!tlb)
> +		goto error_tlb;
> +
> +	swiotlb_init_io_tlb_pool(pool, page_to_phys(tlb), nslabs, true, 1);
> +	return pool;
> +
> +error_tlb:
> +	kfree(pool);
> +error:
> +	return NULL;
> +}
> +
> +/**
> + * swiotlb_dyn_free() - RCU callback to free a memory pool
> + * @rcu:	RCU head in the corresponding struct io_tlb_pool.
> + */
> +static void swiotlb_dyn_free(struct rcu_head *rcu)
> +{
> +	struct io_tlb_pool *pool =3D container_of(rcu, struct io_tlb_pool, rcu)=
;
> +	size_t tlb_size =3D pool->end - pool->start;
> +
> +	swiotlb_free_tlb(pool->vaddr, tlb_size);
> +	kfree(pool);
> +}
> +
>  /**
>   * swiotlb_dev_init() - initialize swiotlb fields in &struct device
>   * @dev:	Device to be initialized.
> @@ -507,6 +659,56 @@ void __init swiotlb_exit(void)
>  void swiotlb_dev_init(struct device *dev)
>  {
>  	dev->dma_io_tlb_mem =3D &io_tlb_default_mem;
> +	INIT_LIST_HEAD(&dev->dma_io_tlb_pools);
> +	spin_lock_init(&dev->dma_io_tlb_lock);
> +}
> +
> +/**
> + * swiotlb_find_pool() - find the IO TLB pool for a physical address
> + * @dev:        Device which has mapped the DMA buffer.
> + * @paddr:      Physical address within the DMA buffer.
> + *
> + * Find the IO TLB memory pool descriptor which contains the given physi=
cal
> + * address, if any.
> + *
> + * Return: Memory pool which contains @paddr, or %NULL if none.
> + */
> +struct io_tlb_pool *swiotlb_find_pool(struct device *dev, phys_addr_t pa=
ddr)
> +{
> +	struct io_tlb_mem *mem =3D dev->dma_io_tlb_mem;
> +	struct io_tlb_pool *pool =3D mem->pool;
> +
> +	if (paddr >=3D pool->start && paddr < pool->end)
> +		return pool;
> +
> +	/* Pairs with smp_wmb() in swiotlb_find_slots(). */
> +	smp_rmb();
> +
> +	rcu_read_lock();
> +	list_for_each_entry_rcu(pool, &dev->dma_io_tlb_pools, node) {
> +		if (paddr >=3D pool->start && paddr < pool->end)
> +			goto out;
> +	}
> +	pool =3D NULL;
> +out:
> +	rcu_read_unlock();
> +	return pool;
> +}
> +
> +/**
> + * swiotlb_del_pool() - remove an IO TLB pool from a device
> + * @dev:	Owning device.
> + * @pool:	Memory pool to be removed.
> + */
> +static void swiotlb_del_pool(struct device *dev, struct io_tlb_pool *poo=
l)
> +{
> +	unsigned long flags;
> +
> +	spin_lock_irqsave(&dev->dma_io_tlb_lock, flags);
> +	list_del_rcu(&pool->node);
> +	spin_unlock_irqrestore(&dev->dma_io_tlb_lock, flags);
> +
> +	call_rcu(&pool->rcu, swiotlb_dyn_free);
>  }
>=20
>  /*
> @@ -523,7 +725,7 @@ static unsigned int swiotlb_align_offset(struct devic=
e *dev, u64
> addr)
>  static void swiotlb_bounce(struct device *dev, phys_addr_t tlb_addr, siz=
e_t size,
>  			   enum dma_data_direction dir)
>  {
> -	struct io_tlb_pool *mem =3D dev->dma_io_tlb_mem->pool;
> +	struct io_tlb_pool *mem =3D swiotlb_find_pool(dev, tlb_addr);
>  	int index =3D (tlb_addr - mem->start) >> IO_TLB_SHIFT;
>  	phys_addr_t orig_addr =3D mem->slots[index].orig_addr;
>  	size_t alloc_size =3D mem->slots[index].alloc_size;
> @@ -796,6 +998,7 @@ static int pool_find_slots(struct device *dev, struct=
 io_tlb_pool
> *pool,
>   * @alloc_size: Total requested size of the bounce buffer,
>   *		including initial alignment padding.
>   * @alloc_align_mask:	Required alignment of the allocated buffer.
> + * @retpool:	Used memory pool, updated on return.
>   *
>   * Search through the whole software IO TLB to find a sequence of slots =
that
>   * match the allocation constraints.
> @@ -803,10 +1006,46 @@ static int pool_find_slots(struct device *dev, str=
uct
> io_tlb_pool *pool,
>   * Return: Index of the first allocated slot, or -1 on error.
>   */
>  static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
> -		size_t alloc_size, unsigned int alloc_align_mask)
> +		size_t alloc_size, unsigned int alloc_align_mask,
> +		struct io_tlb_pool **retpool)
>  {
> -	return pool_find_slots(dev, dev->dma_io_tlb_mem->pool, orig_addr,
> -			       alloc_size, alloc_align_mask);
> +	struct io_tlb_pool *pool;
> +	unsigned long flags;
> +	u64 phys_limit;
> +	int index;
> +
> +	pool =3D dev->dma_io_tlb_mem->pool;
> +	index =3D pool_find_slots(dev, pool, orig_addr,
> +				alloc_size, alloc_align_mask);
> +	if (index >=3D 0)
> +		goto found;
> +
> +	if (dev->dma_io_tlb_mem->for_alloc)
> +		return -1;
> +
> +	phys_limit =3D min_not_zero(dev->coherent_dma_mask, dev->bus_dma_limit)=
;
> +	pool =3D swiotlb_alloc_pool(dev, nr_slots(alloc_size), phys_limit,
> +				  GFP_NOWAIT | __GFP_NOWARN);
> +	if (!pool)
> +		return -1;
> +
> +	index =3D pool_find_slots(dev, pool, orig_addr,
> +				alloc_size, alloc_align_mask);
> +	if (index < 0) {
> +		swiotlb_dyn_free(&pool->rcu);
> +		return -1;
> +	}
> +
> +	pool->transient =3D true;
> +	spin_lock_irqsave(&dev->dma_io_tlb_lock, flags);
> +	list_add_rcu(&pool->node, &dev->dma_io_tlb_pools);
> +	spin_unlock_irqrestore(&dev->dma_io_tlb_lock, flags);
> +
> +	/* Pairs with smp_rmb() in swiotlb_find_pool(). */
> +	smp_wmb();
> +found:
> +	*retpool =3D pool;
> +	return index;
>  }
>=20
>  /**
> @@ -869,7 +1108,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *de=
v,
> phys_addr_t orig_addr,
>  	}
>=20
>  	index =3D swiotlb_find_slots(dev, orig_addr,
> -				   alloc_size + offset, alloc_align_mask);
> +				   alloc_size + offset, alloc_align_mask, &pool);
>  	if (index =3D=3D -1) {
>  		if (!(attrs & DMA_ATTR_NO_WARN))
>  			dev_warn_ratelimited(dev,
> @@ -883,7 +1122,6 @@ phys_addr_t swiotlb_tbl_map_single(struct device *de=
v,
> phys_addr_t orig_addr,
>  	 * This is needed when we sync the memory.  Then we sync the buffer if
>  	 * needed.
>  	 */
> -	pool =3D mem->pool;
>  	for (i =3D 0; i < nr_slots(alloc_size + offset); i++)
>  		pool->slots[index + i].orig_addr =3D slot_addr(orig_addr, i);
>  	tlb_addr =3D slot_addr(pool->start, index) + offset;
> @@ -900,7 +1138,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *de=
v,
> phys_addr_t orig_addr,
>=20
>  static void swiotlb_release_slots(struct device *dev, phys_addr_t tlb_ad=
dr)
>  {
> -	struct io_tlb_pool *mem =3D dev->dma_io_tlb_mem->pool;
> +	struct io_tlb_pool *mem =3D swiotlb_find_pool(dev, tlb_addr);
>  	unsigned long flags;
>  	unsigned int offset =3D swiotlb_align_offset(dev, tlb_addr);
>  	int index =3D (tlb_addr - offset - mem->start) >> IO_TLB_SHIFT;
> @@ -954,6 +1192,8 @@ void swiotlb_tbl_unmap_single(struct device *dev,
> phys_addr_t tlb_addr,
>  			      size_t mapping_size, enum dma_data_direction dir,
>  			      unsigned long attrs)
>  {
> +	struct io_tlb_pool *pool;
> +
>  	/*
>  	 * First, sync the memory before unmapping the entry
>  	 */
> @@ -961,7 +1201,13 @@ void swiotlb_tbl_unmap_single(struct device *dev,
> phys_addr_t tlb_addr,
>  	    (dir =3D=3D DMA_FROM_DEVICE || dir =3D=3D DMA_BIDIRECTIONAL))
>  		swiotlb_bounce(dev, tlb_addr, mapping_size, DMA_FROM_DEVICE);
>=20
> -	swiotlb_release_slots(dev, tlb_addr);
> +	pool =3D swiotlb_find_pool(dev, tlb_addr);
> +	if (pool->transient) {
> +		dec_used(dev->dma_io_tlb_mem, pool->nslabs);
> +		swiotlb_del_pool(dev, pool);
> +	} else {
> +		swiotlb_release_slots(dev, tlb_addr);
> +	}
>  }
>=20
>  void swiotlb_sync_single_for_device(struct device *dev, phys_addr_t tlb_=
addr,
> @@ -1145,11 +1391,10 @@ struct page *swiotlb_alloc(struct device *dev, si=
ze_t size)
>  	if (!mem)
>  		return NULL;
>=20
> -	index =3D swiotlb_find_slots(dev, 0, size, 0);
> +	index =3D swiotlb_find_slots(dev, 0, size, 0, &pool);
>  	if (index =3D=3D -1)
>  		return NULL;
>=20
> -	pool =3D mem->pool;
>  	tlb_addr =3D slot_addr(pool->start, index);
>=20
>  	return pfn_to_page(PFN_DOWN(tlb_addr));
> --
> 2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 06:28:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 06:28:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559606.874715 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHITD-0000tJ-LT; Thu, 06 Jul 2023 06:28:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559606.874715; Thu, 06 Jul 2023 06:28:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHITD-0000tC-I1; Thu, 06 Jul 2023 06:28:03 +0000
Received: by outflank-mailman (input) for mailman id 559606;
 Thu, 06 Jul 2023 06:28:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHITC-0000t6-41
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 06:28:02 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on061c.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::61c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 40b93ac2-1bc6-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 08:28:00 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB7974.eurprd04.prod.outlook.com (2603:10a6:20b:2a1::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 06:27:57 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 06:27:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 40b93ac2-1bc6-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ALdsiUSRHAKg55ClmFzd9Fz5hmFRyaG99YWyG26BOEg49z0C/CsDx0n2uor/isiAJZxvivygUYQqyB48SrooG2vh8VAbwZ8O0uibrxSxsCOL9GoptBMJZLBs1b/DvjNfbn22NxBWv5793ScjKupoxnp95P4dpaY/zOUb0oCL9YEqzUAqrCINOLf6VFwXzFkjQLPjdm2ALKlgemwUAVZAcQ3TUWAWrG526nyipVCDPzg9BHmkybm/94f+c/tmwS9SqyATGsJNAak/tZrNJ3a9I6m3epXjfzegWpFzWgPlQGP5oFGaLoEr3YYn4XnFreTCRsjmI9YY04wDBY+rL7jFKw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=VeQhAvnn9t5CFGlnixpbBOKQTUVYlkm4QPRjUZao/po=;
 b=nqh2DP6SyYV4umBgYwnNpUxM+zC3TZoor18QP/Cm1vyoe3glzWgNWxUolyRdEgJkan0yzhivPz+fSQ6tZohumV9uHpHFghF68OstZtPGocYYSjuBw37s57n99eP/lZlA75t6db5KwGwtLFGciX3CuIFI7o66tUSDiVQVLWxJZ7m6nJ+sa60YB/MXf3HhFURxgGaE3847E7hAlF7JJneODVkK2rFoxFA7qd7cnWYrkr8FNKBmTYw17WmXOFtIk+UX70hDEiSYNabh5grooNjDnsgKayV8TC1JGaaq+s8FsUCrrXtSPQyJKSVefL5cRr8Z8y+iplvph4llq/90rRNteQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=VeQhAvnn9t5CFGlnixpbBOKQTUVYlkm4QPRjUZao/po=;
 b=RaxW5BIQTzbhiyPtzxC7HvpQt4aLi4fmcZkoXijDRg2P63WsnGhjt4+nRcWj3dR5Rm7eZt1r3y6+84w8Xy61Iw+9SqBN8MS+lwPNFAeRXTMsG4rFIoy0yV/ZHZ13U9ipoOESqUC4Qt26zDKfmtXxLKSQ7MoavB/qWA8F96m9SnTS3f4oYfOKQl88AOMOiHouCONHbDI1dI28nHV2Ryd6DoUP965pO7KUsVP0deDPNH4kNEevNvxRlnValQGpu4lfwDPnfZNCSTato/baaH/hcJHF/JXE8SOFS+zvqttiACpdQ8fRnKGGOR+GWhG5dGiZZQxy+tU/cpcOsk65Lbj8HA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <2c7d71cb-067d-8dac-3ee4-3af42b2756f3@suse.com>
Date: Thu, 6 Jul 2023 08:27:55 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2] x86: make function declarations consistent with
 definitions
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Federico Serafini <federico.serafini@bugseng.com>,
 consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Paul Durrant <paul@xen.org>,
 Tamas K Lengyel <tamas@tklengyel.com>,
 Alexandru Isaila <aisaila@bitdefender.com>,
 Petre Pircalabu <ppircalabu@bitdefender.com>,
 Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <1b2d5be30c0e4f335e59dce6e7c001cb0805d702.1688465215.git.federico.serafini@bugseng.com>
 <a16cdb60-1307-636e-1473-e5388e8f79d9@suse.com>
 <alpine.DEB.2.22.394.2307051604380.761183@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307051604380.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0130.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9e::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB7974:EE_
X-MS-Office365-Filtering-Correlation-Id: d42a1a72-a5e4-4615-fb6d-08db7dea23af
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	XJwUDHJdxHXNp0EUdTntc6986Rvw5Smdhd4yL8u74GY4MVnoVu1lwptGGb64Z/NPog86pzfoRw8ry+x0qjnPcTp+1e9KeMSytkhrBLh0qj7hp2IQyta3i7ztX3tshL+g/Wi6vUee3He3ko82JBXiN2F4ZK/LxgxVu01VV852rztTMv8jFwpcLnbIpOMezdfhemGaSc34NEnYbS9cYRoz+SLCyYWTDLmOYpEV2ljbsFWw9EuU0fmB0rw4hfpuInwmksMRGXZ+TIBhykZTTdLClWzZikJo1NtegEA/e/flHIG3WlFuMNp/3exK768qFeLseOcfA8jxnc3ODbKBhjKIiL7MSLLJHDxiPxn66ofRS2THvon7ydURrTg6JMCOH+YeAu2EuUsWLqRpALHWnxp5TfE/MkY3CifTRk2D7H2Ct0vELnqhLDPi9MRnzePs3espJp0x2Qpm3398itLMSJa5lu1tV9c0iCXFTb7t9lMlOC5FwEvI+QXAds40dWStPbIle6RQkJ+vIK5lhrJr34mucaLmB0ofXpzdeyLYQzadWihQ7FZfR/PTIJkzVGBMtDeZSpJRJ7x7DDY2RnhCK3+nrftI0JRrSQcwK6ZKBQErKIVuNp6V6jjDG1ckg78sx3MTCO4Psog+gEB8hwCjn1+i3g==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(39860400002)(396003)(366004)(136003)(451199021)(5660300002)(8936002)(8676002)(7416002)(316002)(2906002)(83380400001)(31686004)(41300700001)(6506007)(2616005)(4326008)(6916009)(38100700002)(66476007)(66556008)(66946007)(86362001)(186003)(53546011)(54906003)(26005)(6512007)(36756003)(6486002)(31696002)(478600001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZmlaK3RoTmFsODRTMDMwRi9TMU5zYVl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3VOd2hQdlJNR255ZWdiRHVSQUZoZFVEYnlV?=
 =?utf-8?B?NTFuSFZTaFc4T2swdVV4bklCSTdZbUhMMmQyM1JGMU5nSWRLK2owTitidjdU?=
 =?utf-8?B?c2twc2pnT2ZTN3VSTUhkaFA1ZStGTlZWaWFnUzN0aklnQ1ZiUWZHSmU0bkZF?=
 =?utf-8?B?dnVEdmhDamwxMm1FbEVydmhKZUpUZU05TisrVEQwbTFSTWU2NnpVVEFMT3Rs?=
 =?utf-8?B?YWMwSFpwOThUMDZwWFdXZWx1UjVMOWxPRnFDbEFyZTZtNlpSK0FxaTQzTU5t?=
 =?utf-8?B?a1VxU3NUTTFoYmZJc25RWFQ5dHRtQ1Rib0pmNWhCa2VEME9Kclpjd3FvUGx6?=
 =?utf-8?Q?LIsM28qEGAJAZp6OUHne87Vr6?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d42a1a72-a5e4-4615-fb6d-08db7dea23af
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 06:27:57.8895
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: FKyY9KU5J7QIRTeU+2yNM10mdQPG+BZmGsVXtnDeZgZF1vL5Ec08EoNZ/4sVXoWAO7ezfeAGNKagDDMY/eYyCA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7974

On 06.07.2023 01:22, Stefano Stabellini wrote:
> On Tue, 4 Jul 2023, Jan Beulich wrote:
>> On 04.07.2023 12:23, Federico Serafini wrote:
>>> Change mechanically the parameter names and types of function
>>> declarations to be consistent with the ones used in the corresponding
>>> definitions so as to fix violations of MISRA C:2012 Rule 8.3 ("All
>>> declarations of an object or function shall use the same names and type
>>> qualifiers") and MISRA C:2012 Rule 8.2 ("Function types shall be in
>>> prototype form with named parameters").
>>>
>>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
>>
>> On top of my earlier remark (when this was part of a series):
> 
> I am not addressing specifically this comment. I am trying to build a
> common understanding on how to do things so that we can go faster in the
> future.
> 
> In general, as discussed at Xen Summit, in order to successfully merge
> large numbers of changes in the coming weeks we should try to keep
> mechanical changes mechanical. Separate non-mechanical changes into
> different patches.
> 
> This patch is large but mechanical. If I understand you correctly, you
> are asking:
> 1) to split the patch into smaller patches
> 2) make a couple of non-mechanical changes described below
> 
> 
> For 1), in my opinion it is not necessary as long as all changes remain
> mechanical. If some changes are not mechanical they should be split out.
> So if you are asking non-mechanical changes in 2), then 2) should be
> split out but everything else could stay in the same patch.
> 
> If you'd still like the patch to be split, OK but then you might want to
> suggest exactly how it should be split because it is not obvious: all
> changes are similar, local, and mechanical. I for one wouldn't know how
> you would like this patch to be split.

So I gave a clear reason and guideline how to split: To reduce the Cc
list of (because of requiring fewer acks for) individual patches, and
to separate (possibly) controversial from non-controversial changes.
This then allows "easy" changes to go in quickly.

I realize that what may be controversial may not always be obvious,
but if in doubt this can be addressed in a v2 by simply omitting such
changes after a respective comment was given (see also below).

> For 2), I would encourage you to consider the advantage of keeping the
> changes as-is in this patch, then send out a patch on top the way you
> prefer. That is because it costs you more time to describe how you
> would like these lines to be changed in English and review the full
> patch a second time, than change them yourself and anyone could ack them
> (feel free to CC me).
> 
> For clarity: I think it is totally fine that you have better suggestions
> on parameter names. I am only pointing out that providing those
> suggestions as feedback in an email reply is not a very efficient way to
> get it done.

What you suggest results in the same code being touched twice to
achieve the overall goal (satisfy Misra while at the same time not
making the code any worse than it already is). I'd like to avoid this
whenever possible, so my preference would be that if the English
description isn't clear, then the respective change would best be
omitted (and left to be addressed separately). (I hope it is obvious
enough why [largely needlessly] touching the same code twice isn't
nice.)

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 06:37:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 06:37:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559610.874725 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHIbu-0002O8-Gu; Thu, 06 Jul 2023 06:37:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559610.874725; Thu, 06 Jul 2023 06:37:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHIbu-0002O1-E7; Thu, 06 Jul 2023 06:37:02 +0000
Received: by outflank-mailman (input) for mailman id 559610;
 Thu, 06 Jul 2023 06:37:01 +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
 <SRS0=VUoY=CY=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qHIbt-0002Nv-Ep
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 06:37:01 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0621.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::621])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 81549c54-1bc7-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 08:36:57 +0200 (CEST)
Received: from AS9PR05CA0057.eurprd05.prod.outlook.com (2603:10a6:20b:489::35)
 by PAXPR08MB6461.eurprd08.prod.outlook.com (2603:10a6:102:153::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 06:36:54 +0000
Received: from AM7EUR03FT038.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:489:cafe::ef) by AS9PR05CA0057.outlook.office365.com
 (2603:10a6:20b:489::35) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Thu, 6 Jul 2023 06:36:54 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT038.mail.protection.outlook.com (100.127.140.120) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.24 via Frontend Transport; Thu, 6 Jul 2023 06:36:53 +0000
Received: ("Tessian outbound 7c913606c6e6:v142");
 Thu, 06 Jul 2023 06:36:53 +0000
Received: from 05d1cc8144b2.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 386F99E4-E37A-4316-A6A8-7D24537EF831.1; 
 Thu, 06 Jul 2023 06:36:46 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 05d1cc8144b2.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 06 Jul 2023 06:36:46 +0000
Received: from DU2PR04CA0072.eurprd04.prod.outlook.com (2603:10a6:10:232::17)
 by AS8PR08MB9551.eurprd08.prod.outlook.com (2603:10a6:20b:61c::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 06:36:44 +0000
Received: from DBAEUR03FT006.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:232:cafe::eb) by DU2PR04CA0072.outlook.office365.com
 (2603:10a6:10:232::17) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Thu, 6 Jul 2023 06:36:44 +0000
Received: from nebula.arm.com (40.67.248.234) by
 DBAEUR03FT006.mail.protection.outlook.com (100.127.142.72) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.24 via Frontend Transport; Thu, 6 Jul 2023 06:36:43 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com
 (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 6 Jul
 2023 06:36:43 +0000
Received: from [10.169.188.49] (10.169.188.49) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Thu, 6 Jul 2023 06:36:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 81549c54-1bc7-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5Rhbf8WQggoKCKape9Ne6KIQIcBJ2Fl5IFRmJBlqXPM=;
 b=Ipvxf2IcTDl0nkY0yz2/2X3Rt2vMdw3klfkE5aSwYxqR0PBrVk/G7aEYhLS4VTjEevhAlwnZi8KkQ2RY9UyIzbclC1DcD3itV3yHsMBygxc/+i5D/+cQg3yk2UmQNwWWbMOXC6PrfEap/j3KiDnInQGmvD2NFgK37YUeyWjLiHA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: fcd4b463adf9b175
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=aIgLWGncblDhjMPIYPR1n/trAgwLJN46pfXWNy+Q0Xn19AzXWV5CYq5LYWVqh4nP/qzimPcQ+HGo83nr5P/yrFYKJrXOqSnaUa9kScRhDhxnWx6Zspdk+xecEOT6WsP+wd2FD5yOFl5jT/Tmma5R6DSNjrG2Hkwb1f9pEHjq9XPfPOsTCK/0yKfG34zNUapCV6/WEYhmiZeeZ48P3dcdmKvDs1so1WV8sJqnFOWEeDl7vE55x+d//VXJYboAUjK2lAXHp8koiGYKpArRG0DTtZrR9iUSuvgoPSuX1YacsWPtEBSfcOAapkOV+MtKT7JaUgTGh6BH5Bb2Dj/ZyrO6Zg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5Rhbf8WQggoKCKape9Ne6KIQIcBJ2Fl5IFRmJBlqXPM=;
 b=Uayd2Mk+otZuIG1adfdPNaTJeLsB4iuQnL4dsqLNlfq+YVzzO2Lsd9Vd9ZbVo5AWcBdo4NAKmCrwDXeqg8eR6bvqrATlD12Bp1GZl9hP3tNs+ryVtwZvIgD8GGCT3TLeggUtd8bmheW5wKPLFgrz2QQw25GQ0gShZspcx3ScMjgvr2M6bBXFVSlmFldxQRkn0IeCfbWhqD4gSlFzVkO51fI1KIbp1S4Y20+/L6lQVGpWYzwnPuoJZE6ibhvZgw3zHt45Q5DUrHbvt+CcJfYfVvqjmluAm60HoPs1OClWGwhah6lwAoGWWmANnkc2GWuI8LqEQ0hAlQm7sSjuX7gOgw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5Rhbf8WQggoKCKape9Ne6KIQIcBJ2Fl5IFRmJBlqXPM=;
 b=Ipvxf2IcTDl0nkY0yz2/2X3Rt2vMdw3klfkE5aSwYxqR0PBrVk/G7aEYhLS4VTjEevhAlwnZi8KkQ2RY9UyIzbclC1DcD3itV3yHsMBygxc/+i5D/+cQg3yk2UmQNwWWbMOXC6PrfEap/j3KiDnInQGmvD2NFgK37YUeyWjLiHA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <528c968e-f6f1-eda2-4e16-55b32f400814@arm.com>
Date: Thu, 6 Jul 2023 14:36:39 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 03/52] xen/arm: add an option to define Xen start
 address for Armv8-R
Content-Language: en-US
To: Julien Grall <julien@xen.org>, Ayan Kumar Halder <ayankuma@amd.com>,
	<xen-devel@lists.xenproject.org>
CC: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-4-Penny.Zheng@arm.com>
 <cb7e3d34-bbb8-e5df-f87b-0fcac4b65378@amd.com>
 <77c64929-514a-ea67-cf8b-176c895ff971@xen.org>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <77c64929-514a-ea67-cf8b-176c895ff971@xen.org>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	DBAEUR03FT006:EE_|AS8PR08MB9551:EE_|AM7EUR03FT038:EE_|PAXPR08MB6461:EE_
X-MS-Office365-Filtering-Correlation-Id: 142cea54-6d63-4adc-d192-08db7deb6324
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 ignhynuixOuoCUaNnK8sil1Vvej8gYQM9YvwSK6pt4hyhZn0cPm/qqZKmwZ9xIzNkiRfjJ/xgjcnCcs2uCbVcWG0PSTYSgfke9xqhd6ccy6rImBswGtDcFzzbLWxqDbSYSAvedEb6iPIwiwGaVy0L0yGm02bOi5GU5inz/CmTIMD6rbhWp8VoSUcg6IroOs5fu+/JGZ0aF6we3Rk0ejkoMkiqiVQZVrlY9tSkwi8HSeAB2+xj7S3Ow/ovxm5cdZI/O7NhRIQGGbCJF3k+yhu+uaN9IfGQXEwZ/I79IHEZSIaAQQl8YkCAU4SdvG3PbuldBA9zlQ85rsBPO732MNw8ZeSx16Cfw+T4+Gqku+fjPE6go5bIh7N0YbvxxUc5sf1HGpYlh/6S26/uLBEfgY6K/xnimIl1h7AdiI0Iu+KP1r0E6cCn2S9ogMI4PIjgmABGH1NQTT+VlN24fNQPvu7WkJXvoEmXDVzWwelTTGkwbm1soqvPnr3Kvh3Xkpnlz3KdKNfrvtrhI3FOQNezQaY/cG5wDeG6zZKwjNc0gxk7HYMSeIyvyZGOK+Kquk8E5H/NecSCfaYLcB+oey7yMzH+asczD7GyRKJAWRsSUiVQHN7fJwDMIle2vKMpHZBZG8cUBHflwnDv4I5JyUaNiIwpio115eigtfaNHrmTakfSbS0se2to1Y/P2Ronp9oyWpqRNtIEq0evxmagPLKazU+LP7jydaHM6IiPs39YKySGRizAziaCMbMEUxfqbT//J88koZcFt7vWgEPGjN7JM9WsZlCQj87yQYofEJkEORpoFqXXDXvz92/NrvUhDqQ14v3
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(136003)(346002)(396003)(451199021)(46966006)(36840700001)(40470700004)(31686004)(70206006)(2906002)(82310400005)(44832011)(36860700001)(336012)(2616005)(86362001)(40480700001)(31696002)(8676002)(8936002)(54906003)(26005)(186003)(478600001)(110136005)(16576012)(966005)(53546011)(5660300002)(81166007)(426003)(40460700003)(83380400001)(356005)(47076005)(82740400003)(4326008)(36756003)(70586007)(316002)(41300700001)(3940600001)(36900700001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9551
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT038.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	d11d9ae6-7090-4403-1495-08db7deb5d51
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	jv7r9KzE5x/EYzKPc4LCAwbwtTQNaEiUfAZCvleHj+x8ckNdMiFp8ZXAOuDPt/2IfZngDIVVJCIFAxO1LjwmMAItAicjqywE1xNZO4WA2OqcU94SE45Ei1Z54uVS+k4Tn61WWYLlDU+nR2eHFrOiVl4CMmwYsH3SmyhOWHVJnlNbzeXru48r2y9jZmajhfRIa8Q+6CzqhrmA4zUkQhAYySUnSznw5fFWJAr5DEKXJkX8o+DJOcruop8FfwIAGUHKmDAmrahaeHpEKh067iMhJsevRDeDdCRv9dCGmwGBEnke4kwLBht0gyme6FUT+bnmA3jVPFAlL4nzSM/oaTWKJWhrs5G/hawjGs70QX87DVE6f5KpPE5fcFYdp8XGGymSVOxzasjF0+1LUTTots8mUH2MslupYFJ5cIwl1mBXXkqsM44RHKLItedBgWoZ3/4Kxu1Rupj7AGYFwk81fEJvgAKtqUNfy43iSTRZpFVGXk21rZSRRniM4/GipMQWoL3zMXKrRQUsHnuOna1LnULcLTbb9vL2leJYGCKG3uZQ4DhjXnfJUCqKHzEH1Xx+DNEaafE7aK41tilAxbzMl2ZSofAqOeFugyDKLzx3z0K4XutMP6OQUfev9I1deUfDHofDSxXyttvfaguzLwPGJj/zQlG5U39KUvKryaBEkBF2wp2QGJYQUeXJBpFI48nrgZc8yH4Tqb2d/yefuiO9DZC9WcQ3ikqA0EtG26cdtR/F/J/226+1eZ45NBZQrRD46ZcQd4a5KIPyAPgAetfZErGcc1YLndZWGlfeMkPFaWseC3A=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(376002)(346002)(451199021)(36840700001)(46966006)(40470700004)(41300700001)(40460700003)(82310400005)(53546011)(107886003)(82740400003)(2616005)(81166007)(83380400001)(186003)(336012)(26005)(47076005)(110136005)(36860700001)(966005)(40480700001)(426003)(86362001)(31696002)(16576012)(54906003)(478600001)(2906002)(316002)(70206006)(4326008)(70586007)(31686004)(36756003)(5660300002)(8936002)(8676002)(44832011)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 06:36:53.6576
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 142cea54-6d63-4adc-d192-08db7deb6324
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT038.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6461



On 2023/7/4 19:47, Julien Grall wrote:
> 
> 
> On 04/07/2023 11:36, Ayan Kumar Halder wrote:
>> Hi Penny,
> 
> Hi Ayan,
> 
>> On 26/06/2023 04:33, Penny Zheng wrote:
>>> CAUTION: This message has originated from an External Source. Please 
>>> use proper judgment and caution when opening attachments, clicking 
>>> links, or responding to this email.
>>>
>>>
>>> From: Wei Chen <wei.chen@arm.com>
>>>
>>> On Armv8-A, Xen has a fixed virtual start address (link address
>>> too) for all Armv8-A platforms. In an MMU based system, Xen can
>>> map its loaded address to this virtual start address. So, on
>>> Armv8-A platforms, the Xen start address does not need to be
>>> configurable. But on Armv8-R platforms, there is no MMU to map
>>> loaded address to a fixed virtual address and different platforms
>>> will have very different address space layout. So Xen cannot use
>>> a fixed physical address on MPU based system and need to have it
>>> configurable.
>>>
>>> In this patch we introduce one Kconfig option for users to define
>>> the default Xen start address for Armv8-R. Users can enter the
>>> address in config time, or select the tailored platform config
>>> file from arch/arm/configs.
>>>
>>> And as we introduced Armv8-R to Xen, that means the existed Arm64
>>> MMU based platforms should not be listed in Armv8-R platform
>>> list, so we add !HAS_MPU dependency for these platforms.
>>>
>>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>>> ---
>>> v1 -> v2:
>>> 1. Remove the platform header fvp_baser.h.
>>> 2. Remove the default start address for fvp_baser64.
>>> 3. Remove the description of default address from commit log.
>>> 4. Change HAS_MPU to ARM_V8R for Xen start address dependency.
>>> Â Â Â  No matter Arm-v8r board has MPU or not, it always need to
>>> Â Â Â  specify the start address.
>>> ---
>>> v3:
>>> 1. Remove unrelated change of "CONFIG_FVP_BASER"
>>> 2. Change ARM_V8R to HAS_MPU for Xen start address dependency
>>> ---
>>> Â  xen/arch/arm/KconfigÂ Â Â Â Â Â Â Â Â Â  | 8 ++++++++
>>> Â  xen/arch/arm/platforms/Kconfig | 8 +++++---
>>> Â  2 files changed, 13 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>> index 70fdc2ba63..ff17345cdb 100644
>>> --- a/xen/arch/arm/Kconfig
>>> +++ b/xen/arch/arm/Kconfig
>>> @@ -181,6 +181,14 @@ config TEE
>>> Â Â Â Â Â Â Â Â Â Â  This option enables generic TEE mediators support. It 
>>> allows guests
>>> Â Â Â Â Â Â Â Â Â Â  to access real TEE via one of TEE mediators implemented in 
>>> XEN.
>>>
>>> +config XEN_START_ADDRESS
>>> +Â Â Â Â Â Â  hex "Xen start address: keep default to use platform defined 
>>> address"
>>> +Â Â Â Â Â Â  default 0
>>> +Â Â Â Â Â Â  depends on HAS_MPU
>>> +Â Â Â Â Â Â  help
>>> +Â Â Â Â Â Â Â Â  This option allows to set the customized address at which 
>>> Xen will be
>>> +Â Â Â Â Â Â Â Â  linked on MPU systems. This address must be aligned to a 
>>> page size.
>>> +
>>> Â  source "arch/arm/tee/Kconfig"
>>>
>>> Â  config STATIC_SHM
>>> diff --git a/xen/arch/arm/platforms/Kconfig 
>>> b/xen/arch/arm/platforms/Kconfig
>>> index c93a6b2756..75af48b5f9 100644
>>> --- a/xen/arch/arm/platforms/Kconfig
>>> +++ b/xen/arch/arm/platforms/Kconfig
>>> @@ -1,6 +1,7 @@
>>> Â  choice
>>> Â Â Â Â Â Â Â Â  prompt "Platform Support"
>>> Â Â Â Â Â Â Â Â  default ALL_PLAT
>>> +Â Â Â Â Â Â  default NO_PLAT if HAS_MPU
>>
>> I am a bit concerned about this as we will be introducing R52 specific 
>> platform in xen/arch/arm/platforms/
>>
>> (For eg 
>> https://github.com/Xilinx/xen/blob/xlnx_rebase_4.17/xen/arch/arm_mpu/platforms/amd-versal-net.c )
>>
>> Thus, we will have to remove this line at that time.
>>
>> Can you remove this line, please if it does not cause any issue ?
> 
>  From my understanding of the discussion at Xen Summit, most of the 
> platform specific code would be moved to something similar to bootwrapper.
> 
> So do you still actually need to have code in Xen for setting up the timer?
> 
> Cheers,
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 06:38:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 06:38:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559614.874735 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHIdV-0002w1-Rx; Thu, 06 Jul 2023 06:38:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559614.874735; Thu, 06 Jul 2023 06:38:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHIdV-0002vu-Og; Thu, 06 Jul 2023 06:38:41 +0000
Received: by outflank-mailman (input) for mailman id 559614;
 Thu, 06 Jul 2023 06:38:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VUoY=CY=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qHIdU-0002vm-BM
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 06:38:40 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0612.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::612])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bd9af718-1bc7-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 08:38:39 +0200 (CEST)
Received: from AS9PR06CA0113.eurprd06.prod.outlook.com (2603:10a6:20b:465::30)
 by DB5PR08MB10140.eurprd08.prod.outlook.com (2603:10a6:10:4a1::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 06:38:33 +0000
Received: from AM7EUR03FT039.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:465:cafe::38) by AS9PR06CA0113.outlook.office365.com
 (2603:10a6:20b:465::30) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Thu, 6 Jul 2023 06:38:33 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT039.mail.protection.outlook.com (100.127.140.224) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.24 via Frontend Transport; Thu, 6 Jul 2023 06:38:31 +0000
Received: ("Tessian outbound b11b8bb4dfe8:v142");
 Thu, 06 Jul 2023 06:38:31 +0000
Received: from 78e95d999980.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 C4E4100F-2DC4-44C3-9950-987E5AB4DA02.1; 
 Thu, 06 Jul 2023 06:38:25 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 78e95d999980.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 06 Jul 2023 06:38:25 +0000
Received: from AS9PR05CA0018.eurprd05.prod.outlook.com (2603:10a6:20b:488::22)
 by VI1PR08MB10276.eurprd08.prod.outlook.com (2603:10a6:800:1bd::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Thu, 6 Jul
 2023 06:38:23 +0000
Received: from AM7EUR03FT019.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:488:cafe::46) by AS9PR05CA0018.outlook.office365.com
 (2603:10a6:20b:488::22) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Thu, 6 Jul 2023 06:38:23 +0000
Received: from nebula.arm.com (40.67.248.234) by
 AM7EUR03FT019.mail.protection.outlook.com (100.127.140.245) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.24 via Frontend Transport; Thu, 6 Jul 2023 06:38:22 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com
 (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 6 Jul
 2023 06:38:21 +0000
Received: from [10.169.188.49] (10.169.188.49) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Thu, 6 Jul 2023 06:38:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bd9af718-1bc7-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ZbHoRgOIZuboUDejV0ywB+/9fhE4hpMgPE1PiuIVL5Q=;
 b=Q3FErF3510HA8NlazeJRKT5TGs7/EnKC6YfqbmZZpLQlDUwL+eFbAQsLn+kn+91UCatXp9+XFiDEDp1+tQUTmpycksJPRT04+KDd0hXCKvBkfmcFYYHIvHPhkTLDF97arrSI/pImIDHFl2O3OnCzPVRbYv3MwSjtzi8CSDo5GEs=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: d234a8df0fe0bb1d
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=mWaZVK/X9+R/h5jUDY3eZaHBl7hZKOf8Mces8jNHB7JuwQK2uGeMT+3PxMbhG0F3xXOYM7p3Uwgg2N9B8HQzyDRcPRVXgEbaeQGT5deXfyrxcLk9K1DaKzzehD8qSx18UfM8IgfQRcI79N8fzjUID/HSnvbJuIko1Oi7BJPt5LhqeblQSk9c43eZ4EWu7jFoomdpOF52ybhxAudpqEy7MqT6B8eHGDevbjNMoB+zAKUmxxLxzJbFKKT+tZxjBrCX3PwH/gUoN164QaZR09qJwXgErqqPQFE1lbPPE/4cTes1jtqoHHLLAGTBmDc84Vl0AYSfwhByXKxQAkhYo0UTBQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ZbHoRgOIZuboUDejV0ywB+/9fhE4hpMgPE1PiuIVL5Q=;
 b=MPob6s+Nsc+bOHEI+C2nQsp5NCTzSOS6+yIJlNqKxRhPpyZ8m0aD9hAv4lool7yvNgycPQ9WqHGNaCsoKp6RUfmPVVU82NWjKJt7eGsUGW8Z6G93yvXRA+gl3obXXjIdGAWxQYQFd0N68aeKIAQi3BFlesOkxgYLHhf1FbwjoINZz2lEXcBEC2u48gRDExsV+G6fzmPRoKs+gRyXCbwCZHK9UDNO2NMhoPTGBTh42ZgzjsnqLKQIlJ2Ivw1rZJlynGCOeRdozjXlqffwLWFd4ihB8DjIu9fr6JAUjlsV4CkYdBaNgg52sVvrBy479Vbn5rYtHtKHYOP8ULjJ0xnCWg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ZbHoRgOIZuboUDejV0ywB+/9fhE4hpMgPE1PiuIVL5Q=;
 b=Q3FErF3510HA8NlazeJRKT5TGs7/EnKC6YfqbmZZpLQlDUwL+eFbAQsLn+kn+91UCatXp9+XFiDEDp1+tQUTmpycksJPRT04+KDd0hXCKvBkfmcFYYHIvHPhkTLDF97arrSI/pImIDHFl2O3OnCzPVRbYv3MwSjtzi8CSDo5GEs=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <486a1a88-bddc-3364-1e10-793faf67f856@arm.com>
Date: Thu, 6 Jul 2023 14:38:17 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 03/52] xen/arm: add an option to define Xen start
 address for Armv8-R
Content-Language: en-US
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-4-Penny.Zheng@arm.com>
 <af5c0bf1-40eb-5b76-17b2-b63205cec182@xen.org>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <af5c0bf1-40eb-5b76-17b2-b63205cec182@xen.org>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	AM7EUR03FT019:EE_|VI1PR08MB10276:EE_|AM7EUR03FT039:EE_|DB5PR08MB10140:EE_
X-MS-Office365-Filtering-Correlation-Id: 017379c9-717c-479b-1562-08db7deb9dbd
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 YdFQlIAxn06SjgAFe+r70rkfFUIpwa491CjMEiSFHLA1uj7mXaWkD3fk7GJArmtOpUpXxm72lu1V82XU7mrpjBewlq1VzCgCVDZHzzPNMAzLDI3col0SH0fh87oR6aMQdizY/iaSM8LQjL283kd7hBTiAKvVUmOuDSQ1YLmZnATHIGgt+hmvbkXuldq5RJwSpKOEpSP/WTamerIODF5kdyXikSxXw8kq26mRWdduzN/wJhOmbUP3tvm+a8VFEp17UQzE1Vh431EepGqZHe4ywSxNPRkkjdlogsbMNbCb1680uZ2jctm2/SqI7wGZt0l8/lTnzBPnfx37GUvgs/cqgQ4CKVJmNPXEIzBXrJoHdHCjvvnQFiCQZd7a3AmLTxaeE5hPZZyG0awlixlgs8FVCdrY/Dv0N6XVDPeWslVsaSErjkNOKcGS4A8XKTCoashG/VzqcF0cxOuNjuF+aWN7YNdH9R9toSSZxpbFX4VPzIpFF5EmwhGzefbfZHmbRCcK23A5LdioNL7tkRfzNfuvpmLB3YkEiyt7zbCqBvkXI4M7EadronCedfuozyGxOxbg7j6l4aV6QI9R578autlUqobwXKVOIxJ1fUmP3EBO/yjYsXge5mAIQWC2gDxleM0SCpjG9jw6NWVnwZJnsST5ZsrLXv+74oFqyEciQFi4NYrJlgkT78s0Bw6sR1nmxbFTF1T1hnrPanG+uh+xDw2nxd5Q4+bCEdzQg/2dSQtoRx49SGqRRD+NVMoofUopsv4OoTpb9QsoHz3h3nBQSkEmz0cQjoCGylnWufSJjUfR4UqmfsefJqlf/h+9dMZGE4pU8lK3o7cKBGRtf2Az3hH9sQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(346002)(39860400002)(376002)(451199021)(40470700004)(46966006)(36840700001)(40460700003)(2906002)(41300700001)(8936002)(5660300002)(8676002)(44832011)(82310400005)(36756003)(40480700001)(31696002)(186003)(2616005)(26005)(478600001)(82740400003)(31686004)(53546011)(70206006)(86362001)(47076005)(316002)(4326008)(70586007)(81166007)(36860700001)(54906003)(16576012)(110136005)(356005)(426003)(336012)(83380400001)(3940600001)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB10276
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT039.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	40e74400-3fa5-42e5-d095-08db7deb981b
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	UJOgk3iDjX2rpDtf9Ka0S7jJ57wSVELdO5aJqECOf80E8hgCpco3X60LwNESqidybMqt5qdBgDTp+j4zDc6j4eX7eLuC5I7DaBgyAeRDdR0CQtiM0rafDWd1yZAUT14ZKmB/u1NKbaF4ZLAZ7jXjurvjIc8/J0gfn/4XYxnOCVoj98ZqIOTobFByB2I8+ZniwEJj4PNsHWPVG1tGf3BQELhOppE4n2fyCFpe07bxIAX81MWN+3HdLBfCxLOg2VQZ+EzGF7KCfhser1SXP1cWGZK4R1Jin1zuJkNkmJqQIZTISjktt8G1W7LMWsnW9+X6KuXjAMFeeKcwL14HWlxn9jG7CfA+SacxI++RvrfnWglFqT2/EDwAIEdn8FMR2JbUpDx064mF6urlAIgOELrAzmlXn/N2OAi8eUexHvvUVRjoPm6cwHkfGSDkQutnhk8eS0A7pl3QEnD5iS4oNAaUDjHbOqkbmmzHpt7rurcRAJjgjuEHfjJQNS+zeSg/WczVYivIYSk+YA5mZpr41c0WLW+rVAkXPdzNy+xvdwKxrDIKtvdUqO2BB+8VAnpAZLJpxe4rRWfIyrCl3//InVW/cFLqvigPDGKMs83+MEsFaFdwH4ghmxfWuTKuejykIEXYM5OHqpOFML4DLNlntY9415TijipfShFUXejVcT3OU7NkK1kKhcXxojTZjmpq7dwSt9HCSPahLn/H15y31Xr61TsRHsLx20jSpJLpsr3J4/dW1EeBEY5g8xoAiLbTLN0QViNhRM6OuK6eHm+tFQgj9a7UmH3WpbVgFBYjmYvURr2SZ4HvWKSmd1ov4TFg26Oy
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(376002)(346002)(396003)(451199021)(46966006)(40470700004)(36840700001)(40460700003)(41300700001)(478600001)(54906003)(36860700001)(110136005)(31696002)(86362001)(82310400005)(81166007)(16576012)(82740400003)(107886003)(4326008)(426003)(83380400001)(36756003)(316002)(47076005)(70206006)(2616005)(2906002)(8936002)(5660300002)(8676002)(31686004)(186003)(44832011)(53546011)(26005)(336012)(70586007)(40480700001)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 06:38:31.9789
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 017379c9-717c-479b-1562-08db7deb9dbd
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT039.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR08MB10140

Hi Julien

On 2023/7/5 03:21, Julien Grall wrote:
> Hi,
> 
> On 26/06/2023 04:33, Penny Zheng wrote:
>> From: Wei Chen <wei.chen@arm.com>
>>
>> On Armv8-A, Xen has a fixed virtual start address (link address
>> too) for all Armv8-A platforms. In an MMU based system, Xen can
>> map its loaded address to this virtual start address. So, on
>> Armv8-A platforms, the Xen start address does not need to be
>> configurable. But on Armv8-R platforms, there is no MMU to map
>> loaded address to a fixed virtual address and different platforms
>> will have very different address space layout. So Xen cannot use
>> a fixed physical address on MPU based system and need to have it
>> configurable.
>>
>> In this patch we introduce one Kconfig option for users to define
>> the default Xen start address for Armv8-R. Users can enter the
>> address in config time, or select the tailored platform config
>> file from arch/arm/configs.
>>
>> And as we introduced Armv8-R to Xen, that means the existed Arm64
>> MMU based platforms should not be listed in Armv8-R platform
>> list, so we add !HAS_MPU dependency for these platforms.
> 
>  From a brief look, this patch doesn't seem to be necessary in order to 
> move the MMU code in separate files. Can you confirm?
> 
> If so can this be moved latter in the series? This is to allow the 
> reviewers to focus on the MMU split as we discussed on the call today.
> 

Sureï¼Œit will be not included in the next serie focusing on MMU split.

> Cheers,
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 06:40:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 06:40:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559620.874745 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHIf2-0004Pa-9h; Thu, 06 Jul 2023 06:40:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559620.874745; Thu, 06 Jul 2023 06:40:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHIf2-0004PT-6z; Thu, 06 Jul 2023 06:40:16 +0000
Received: by outflank-mailman (input) for mailman id 559620;
 Thu, 06 Jul 2023 06:40:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHIf0-0004PJ-Va
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 06:40:14 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on2061d.outbound.protection.outlook.com
 [2a01:111:f400:fe16::61d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f5b34cd5-1bc7-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 08:40:13 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM0PR04MB7108.eurprd04.prod.outlook.com (2603:10a6:208:19e::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 06:40:11 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 06:40:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f5b34cd5-1bc7-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=drJ+2L/69BDEbUsgdqrqwhS0Roi8duIxv6n0r+tXhFqv6poxyKm5ULBqC6noV+SLleS2sWw2kgcOYFay3GZGCZQQlJ1NF6S+tko/E7AnCwQX6QxE3g+6rzoOFsx27dSlfJCW3iaA7KEcTbgzJ9wGBpeEaRw6kHHYqgvAWao83ZMlg/51XneFj2AFjNb3dgxfA0hAUIfS01RfMc2eI28gVNOrI2VEZItJ5YfMLdsqEuJPTOQo10692ILivme/EIql6F6Mz6DGl+RxMA1Lw8sc4mEJB+6Xehxxf7a6omvivYjttW97M7uLfikGWIBgvs+YVNquJ1SCcrU4N7sQIoGZZw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=W1bAXBIljCermuSp5k0xbELbiX6Vm0XgYNfSgB3Om90=;
 b=igwPotojeLX0fNKSOgkGdChXGrC6uFrOqJ9SWxRiXC1rQYTVYDp8icsVkoxlyr22Nmcw5w2XiqJii4RJWsFebRJzpM0lxBKWtMmsuU1XmnprJl+IOnyUHETKDqqghoVn2maacQjVexcaw+CUVoVfxAAxYvwU7KPNUDoHnv/eVPuvgTU3RH3NVBaMQX3Y3XBPMI6tzuqcVO/K0vmlUUNfehuaw3+pc70fzfwmxY/xnUjO+F08eOVTb5upXY/abVJUAY+bQF1Q4CNXOeaaOs8Q/iJ+mWAjhGvXOu3n9K4GUE2qL5dm5laWIMRoYEkVFE09tq7eMMdbGXRPqqbJOHzylQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=W1bAXBIljCermuSp5k0xbELbiX6Vm0XgYNfSgB3Om90=;
 b=tvAzC7sw0whiSLH6M+4NbK1aP+vaxYAOpCa+o5C/8G5YKINJmNPp1uI2mkLZN9bjGAB0Cg9o5UteFK52bDFsdOLsBRx5tmwdRgtKH0u7QwtoQQbihMylaxKxIhflvR4Zdc7KflE2DOfw4OJMYDKHEwyTLHWm+rh04lXB2DhxEEx30NYRRzu5v35LBMqsFIHqWh+OJwY7nZlkL0r0+l3L3sJ4LV4YqRCvlilVsxu7cwNau2GYbAzpwY4IQvxWtAuKCllmDyVv8kM2cL7aPjWw3hOhhX3PRwYnoOIruxnAh8qL2UreT+uBp72mnJ4uCDm/zRZvCQa6aj39YzLV/oegAQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <c2a52a88-a8bf-3e14-f3f5-616177c3d807@suse.com>
Date: Thu, 6 Jul 2023 08:40:08 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH 4/5] x86/x86_emulate: change parameter name from 's'
 to 'state'
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Federico Serafini <federico.serafini@bugseng.com>,
 xen-devel@lists.xenproject.org, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
References: <cover.1688049494.git.federico.serafini@bugseng.com>
 <8c8bc96b96a1111a4651f970f506d304809ea40d.1688049495.git.federico.serafini@bugseng.com>
 <alpine.DEB.2.22.394.2306291230500.3936094@ubuntu-linux-20-04-desktop>
 <e7af3c85-92ec-7d0f-0e63-3a1e5d65877e@suse.com>
 <alpine.DEB.2.22.394.2307051544340.761183@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307051544340.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0173.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9f::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM0PR04MB7108:EE_
X-MS-Office365-Filtering-Correlation-Id: 3eac04e7-ed79-4062-7e86-08db7debd8b4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	uQYTD3iCsmmNWwunbIZwGgbEjacPl9w3JDo/Bjfm9BO1eAc3ZrhlmOmshyoVe98ViPrHyUME/WxGQjzw4zfx8vuNweMn9Rl206sqt5feffv2fRQsmyztsQ7lDtU9iHAX6IcQaJJmdC6j0psEDOh4MBM+QcwMk0rG5aFQspcan2iFyF0oMnoa470bs+KXbiqAJ+BFzuzyYuceUagoPgTN5HmbL9dUIsXTuTdj6H+dePWTlSdExpPD4/jGJClmatEuzqpTDgLClxcwQgEnZBBPINVdiA4GhMXona/FSqP1V1JURg/1obPeGJm7b38aAODU9c3YbyzAEOVxy7OK2oYjiQsmSBf49ZmJAK1Z/q0ZOm0XX1UaEjnBTXnFE3onC6uRTGnmdAixx8U2TQkwIAZBBjffeDevS6i+A+qtVgqq+hJx3ptBx7La/iIGGWv0wOKLdgmUPRxbbRBW+dM6MOoC3UZ1TUQ6Yau87AFplOl75cWD1QWnzegioeuj0lH+M6f7MWnckSNbDms4EaCWzhD4e4RjBNGOau2yD06q5ujDmbz2DqV+dCf/F95SEWOdL4HilpT3BsqomTmdJZWrtAA12rB7yscS3hKVuYqY8kmd6b5V2tcV+edL9tfGSYDEnhtH3aNgqjtpeV/9zSHkBQUN8w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(136003)(376002)(346002)(39860400002)(366004)(451199021)(2616005)(54906003)(38100700002)(66946007)(66476007)(66556008)(6916009)(4326008)(186003)(36756003)(6486002)(6512007)(6666004)(6506007)(26005)(53546011)(31696002)(478600001)(86362001)(41300700001)(8936002)(8676002)(5660300002)(7416002)(31686004)(316002)(2906002)(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NkNEUWxab0w3NU9F?=
 =?utf-8?B?aWorNkl2cVBrZlpWMEpaSzhUVmpaTWp0MS82YjJ5MjdUU0JxYkx2cDBVd0wv?=
 =?utf-8?B?a2pQd1dBQUdGV2VjT1BPVnRiY0lZdFNBdkFZcmF2L1g2aklBVEdqdFBZU09i?=
 =?utf-8?B?L00zeXYxUFNGM0VSMDNKQUtOUXdnNjNzK0RvNnh6R016VTREN2o2bloxeWhI?=
 =?utf-8?B?akRwblNYczlnYmhkR3E0dXZUWGlJenkxeUxGVklqdytlRWVGTVNIT1Rva01w?=
 =?utf-8?B?SmxzVXlwaVFOeFpvM1JGcWJPNWpxUjdpSmc3Z1hLL3dvV3F0bHAwd0laZ3Z6?=
 =?utf-8?B?dGw4eExlMTc2LytlVHhaTFpZTmhzQis5aFYrd0QxWUhkZXlxVXRhem1JVm1h?=
 =?utf-8?B?L3FIaEwrWWRBVlJzWC80SWFvYmh4WitrRjh3eElWdzFxUFlaUXgxUWdlWTNt?=
 =?utf-8?Q?yLxyHthaCbvO2xTbI/Ck5OzR5?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3eac04e7-ed79-4062-7e86-08db7debd8b4
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 06:40:11.0664
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: rUpdnUW5y5MZ2o5C5flPXKCdaPa35u9MV62pFdjxbCmAKzBNNCgmhLt0D4yH6eIsWckQvMpl05lbEayW0xdXrA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7108

On 06.07.2023 00:49, Stefano Stabellini wrote:
> On Tue, 4 Jul 2023, Jan Beulich wrote:
>> On 29.06.2023 21:31, Stefano Stabellini wrote:
>>> On Thu, 29 Jun 2023, Federico Serafini wrote:
>>>> Change parameter name from 's' to 'state' in function definitions in
>>>> order to:
>>>> 1) keep consistency with the parameter names used in the corresponding
>>>>    declarations;
>>>> 2) keep consistency with parameter names used within x86_emulate.h;
>>>> 3) fix violations of MISRA C:2012 Rule 8.3.
>>>>
>>>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
>>>
>>> You could use x86emul: as tag in the title. I'll let Jan choose the tag
>>> he prefers.
>>
>> x86emul: or x86/emul: is what we commonly use. That said, I don't like
>> this change. The files touched are pretty new, and it was deliberate
>> that I used s, not state, for the names. This is shorthand much like
>> (globally) we use v (instead of vcpu) and d (instead of domain).
> 
> Are you suggesting that the functions changed in this patch should be
> adapted in the other direction instead?  Meaning that the declaration is
> changed to match the definition instead of the opposite?
> 
> If so, are you referring to all the functions changed in this patch? Or
> only some?

All of the files touched here are ones which were recently introduced,
and which are deliberately the way they are. This "deliberately" really
goes as far as declarations and definitions disagreeing in names: For
the former, what matters are adjacent declarations in the header. For
the latter what matters is code readability. I'm sorry, I think the
Misra rule simply gets in the way of the original intentions here (and
I continue to disagree with there being any confusion from name
mismatches between declarations and definitions, the more that in the
case here it would be easy to avoid by simply omitting names in
declarations, but that is violating yet another rule I don't fully
agree with either, as voiced when discussing it).

My preferred course of action here would be to simply drop the patch.
The least bad adjustment, if one is absolutely necessary, would be to
change the declarations, but then in a way that all adjacent ones
remain consistent (which may in turn require some _other_ definitions
to change). The mid- to long-term goal certainly is to use "s" more
where "state" may be used right now.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 06:43:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 06:43:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559624.874755 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHIi7-0004zV-Pd; Thu, 06 Jul 2023 06:43:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559624.874755; Thu, 06 Jul 2023 06:43:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHIi7-0004zO-LX; Thu, 06 Jul 2023 06:43:27 +0000
Received: by outflank-mailman (input) for mailman id 559624;
 Thu, 06 Jul 2023 06:43:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHIi6-0004zI-8K
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 06:43:26 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on2060d.outbound.protection.outlook.com
 [2a01:111:f400:fe12::60d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 67da3576-1bc8-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 08:43:25 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8145.eurprd04.prod.outlook.com (2603:10a6:20b:3e1::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 06:43:23 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 06:43:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 67da3576-1bc8-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=f7Vs6VFmHkUSNlwrB/oCrT1pkAV4hxSxPBd1OZtbA2Ci2iN6aLB1HQ4TIC8EGESw+SkV8KJL8zUFn2Ru3/p55ZYY1AXsAUZ6VWnQ4J7bWvwTQ5SnbvAAcI2d/pbo/P0XSR0+KRUbYWW9ejuZqqHWCZPe27Hrrhv7CTfk2RkvW2GrFbzGx1z36o90/Ba6rreGPMm4oYxhaob+Tj0u5TU4C5gYTLsicpd29+uruQo66CQE/apFQK5v++aUCz5/ag97I3E496EhDjZ4tqY14NbtSUYCOQFvNg1CpwtFlx6OFsYSG/w6Uqr4jLOOcf5/AQhO/+fDP3dyuYlOEV4cckTtRw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3bagEtTKs5q13dVLsVFlOthdrN3/s/CIu16GN5UDm2k=;
 b=amBcjYuPhao2LNGanEHyVaKciSJv9zJd/AqU6Ims75/5KGuCgZgfABdeMSxQqOGKkC992nKzJqd1p2L0DyZxtdTcTw+mlvjiroHJ95kx3vQY9uzT6FQpZH7r8uO6UN8AIscwrQ5bzmAcqwMpQn9OFw27Q5KyI77QxEJ9f548ou+/YcHhZEO5sRZO7IIJgXnV6CXaOrvctWMhQv+cxup5nc60pw2xOku0z1kfJ4Iqx14yNkTBtVCI45CiHwbNdSF2I5RaRz34PvN9o5z4iv7jqR1gn9lxPy+L+1ZQLQuTrxkiGLd22woDkCRMe0zxiyxh7vJ/hrF092hQ2b7NRuJ77g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3bagEtTKs5q13dVLsVFlOthdrN3/s/CIu16GN5UDm2k=;
 b=NOXyWL0UhFKQKxOVCW7w3AANrjhUucVqPJStYHI7jTZmeLYw9UeQxNtjkn/4HN6IENbrRWlPY4+yapEMGjEbEWt+meWl/cTVIxRZILXxh2aXYdqIPzkbTbsu2s6Keog5hIdOKte65X3FCs8rjesKU0GsYG3pDysVoL9kOduKLoIJVbJoSOUIU0BRrnmg5e9x+ZBYLwPXYhIF/cD2r3gs1dp2+UKmQaztw+wEkFT4rOcUcrIV1AHhqeD2H4smO5ZOVWbgGcCZs5zGu+A0OLdnAJev5JEson7+CNuruidkpsnLzfi7Y+uyXobEjv/eSsiYa1L8Nb3q7haNz5HsaRDqJQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <2f821cb7-37ea-5f50-0bb8-57044fe46817@suse.com>
Date: Thu, 6 Jul 2023 08:43:20 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH 5/5] x86: make parameter names of function
 declarations consistent
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Federico Serafini <federico.serafini@bugseng.com>,
 consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Paul Durrant <paul@xen.org>,
 Tamas K Lengyel <tamas@tklengyel.com>,
 Alexandru Isaila <aisaila@bitdefender.com>,
 Petre Pircalabu <ppircalabu@bitdefender.com>,
 Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1688049494.git.federico.serafini@bugseng.com>
 <5ee57d7bcd79daa0314f182ecb73e1eb6d8ecc03.1688049495.git.federico.serafini@bugseng.com>
 <0076f2d6-03b7-0a1c-c423-1f55b7195407@suse.com>
 <alpine.DEB.2.22.394.2307051550070.761183@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307051550070.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0058.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4b::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8145:EE_
X-MS-Office365-Filtering-Correlation-Id: 7428f4ce-08df-4ffa-1b9a-08db7dec4b27
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	/cW266jYN86XZzmx9bLVvJDWop5ENwr/bV97ahnnynQJFqozYzDwI+O5ZTZrw7GpKOI/aOjwgn38W4NNniR69pzWIKqgm1t9f9YI0SvFKwhmR+wuqL6FwDSSaUybX95MS9Xyo1QIea/7MhKqmqUzUlPUaawjomY20N5H6xL33aPQdfp8Ubtszb5kTYYfvSpZWToyPQ3PijwoD+3F3Wasb85HaGDWvfUh48b7ORrOHSRiOsJsIL4ePgobSISpDw36wfB8cFmI/IdzirinRTjgy/7ESxcu8ol91jrJoO4Dkus+6fMaCEkg1EfrI0ufqxhMOMG3Tlnkd98V8PKKmQ8wx5qo51Iatx+3d9e4P9MTXqdiTn+T7IKPUkyQA11pbQrKtfGd8MefxOme7LgRjT/W7M05ahQ6NbAKcjmcGxb963MTgMr6KLmcpbYZCrOCXDeRWm3Rxr6dJ3YPWP/pn0SVVtcSYRAuO6HBRlWXpizbFRXoEJwrMigF6LDSxiUKfkvwKz+YILGe8tWEuM4Tu5Je+TYGChvOMMW0lAOWgrP/ho4Y2SaEUKfUfgnEDBCk9leLxji7xiJ6wpn7CXDK3isI7oh+B8sG6F/IjIt6iHaOpbCz5DMNPzLHiYgCwyajVCFCNY490G5WM3tVIWOEWt67HQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(39860400002)(396003)(366004)(136003)(451199021)(31686004)(7416002)(8936002)(8676002)(5660300002)(41300700001)(83380400001)(316002)(2906002)(2616005)(66946007)(38100700002)(6916009)(4326008)(66556008)(66476007)(86362001)(186003)(54906003)(53546011)(26005)(478600001)(6506007)(31696002)(6486002)(36756003)(6512007)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VnY1ZTFCbEI5SS9WbWlaVzI0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hNS2swcjlTWWNQbHpkUy84RG0vTjh3MDd4SlhUQWJZZ3BXalRz?=
 =?utf-8?B?Rk1WQ0hDcWtJK0FzaTY2REFlWEY5WkU1UWhNQXdwMGhjaDlQa3F1amhZK0la?=
 =?utf-8?B?aGFMeXk5andvYXpKdU80UmExT2wwWEpxVlNQSCtEVk9HZUNTRHRiNDZodVZo?=
 =?utf-8?B?cUVoWHVza2tmZHFLLzM2cWJaSlpzT3NpK0lhYlAxblF0WktXZU8vT3Rid1lL?=
 =?utf-8?B?WHhmWEU0d0JQN25GbnJzdzkwZjVsZHo5QklmTHFOYVVLQUlXeVFKNHk0akxU?=
 =?utf-8?B?elA3MlZWdEZieEpvNGJJaTArRlNKT0xtRkJsT2VCYXdxdFc4WGNwN2JFWlZ6?=
 =?utf-8?Q?/dXxA2xPO/pCjKhVlXQtSSV4a?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7428f4ce-08df-4ffa-1b9a-08db7dec4b27
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 06:43:23.0730
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ZvGqw+rNvK953LRmpgMnDHx215rFhAe4FTlJ/X0XkzwtzJ/9SPL33330QATxQKDAZHcpuIfWcRWL+6eX4EhxPA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8145

On 06.07.2023 00:51, Stefano Stabellini wrote:
> On Tue, 4 Jul 2023, Jan Beulich wrote:
>> On 29.06.2023 17:55, Federico Serafini wrote:
>>> --- a/xen/arch/x86/cpu/mcheck/mce.h
>>> +++ b/xen/arch/x86/cpu/mcheck/mce.h
>>> @@ -44,7 +44,7 @@ extern uint8_t cmci_apic_vector;
>>>  extern bool lmce_support;
>>>  
>>>  /* Init functions */
>>> -enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *c);
>>> +enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *ci);
>>
>> Supported even by ...
>>
>>>  enum mcheck_type intel_mcheck_init(struct cpuinfo_x86 *c, bool bsp);
>>
>> ... immediate context, c is the name we use for parameters of this type.
>> You want to change the definition in such cases instead of the
>> declaration.
>>
>> I also think this patch could do with splitting, not the least to
>> reduce the Cc list(s) needed.
> 
> This is a very large patch but it is entirely mechanical (good!)
> 
> How would you see it split? By individual files (too many in my
> opinion), or maybe by directory? By directory it would be something
> like:
> 
> xen/arch/x86/cpu/mcheck
> xen/arch/x86/hvm
> xen/arch/x86/include/asm

As for the other patch and as mentioned in the earlier replay: By
maintainership area, such that we don't need to accumulate a dozen
of acks (easy to miss one) in order for the patch to go in. As much
as the patch is mechanical, it ought to be largely mechanical to
split the patch at maintainership boundaries.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 06:44:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 06:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559628.874764 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHIim-0005V6-17; Thu, 06 Jul 2023 06:44:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559628.874764; Thu, 06 Jul 2023 06:44:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHIil-0005Uz-UO; Thu, 06 Jul 2023 06:44:07 +0000
Received: by outflank-mailman (input) for mailman id 559628;
 Thu, 06 Jul 2023 06:44:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHIil-0004zI-4S
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 06:44:07 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on20626.outbound.protection.outlook.com
 [2a01:111:f400:fe12::626])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 80b0a40a-1bc8-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 08:44:06 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8145.eurprd04.prod.outlook.com (2603:10a6:20b:3e1::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 06:44:04 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 06:44:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 80b0a40a-1bc8-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=XdjhvDArecvF9rvdUcaBCxtJV9GlAZ1QMKblbnHCfEW+X+xOH132E7YV7PGsWp0M3JNOVdmZaXInXyU1/WHTFW+gHNY9qDoj6Ki+t4mwJ+2EuVHHMW2eHfsimIH8y6OdRbT8xl+obLLkYn2jw7YmLLh9tGZd5cOOrs+W2Z49s7i7vT6KXi7B+4Rpqfn8AjGtcmog9bGK4vZH5Vw+jdP7AIVDD8n51XDIRcAFGmR6Ygk4hKA/donISgGEOJENglbjtO7smatHDe06zyzrGGjASVCvtxzKjDI5fI+on+kCeDtzKYGMvzF2Pnf1TugAxosPv7jt1HfzTb38KSEcO6/05w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=xvTXt4pOUkcAXx8fS3hBkQbH2/Hl9K9RB7E6QAy7dDI=;
 b=NNz8LKyqLwXoXuAYbtqvQewu0A5huDxkp5mQ9nl8kMDNeW4PEHCWdbskVXu/IFq4mit2wJzNgAwAqjaxQ/FdCH5anOOjbDK4dRRu1dm4njKroDjiDvkwMf4L8r/s+zNepkFGsaTENgLUq3Mus2el+Mym+SLt9r0m7hOoIkrmuGdHi34d9BZugnMQE/88hxxeY/Kfoc2lxMBFEAPtqf1miwSSQIOqSiLg0n4h4TsAY6P2+A+yN41vgkoKfvpPj8DbOIFt9IuC+QBl41qx5TT7ish8BX3HEXpNhoiOqDAG1cpEO/3UgLdiJ5scpC4ODAG3dwkDLm65rAaGGfx2WVm0zw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=xvTXt4pOUkcAXx8fS3hBkQbH2/Hl9K9RB7E6QAy7dDI=;
 b=ZKpAOLni+uIDW9Hd6+1hYy4E9/hsLZ7T1LOk7My22wQgblswYwYsc2ViSQ8nPp5E7z1wNKMHVkEA19HSRQg7/UDXb8ErExhnAu1qTZMsFoBQs8jNh/W2zOV1twHzxCuzqocuDhrdNXpdq4cjvbsx6L0b7HTVv/alNG2fSgZK6WEP8m83fHdggZAXxZuzM2c6iD5ezqFXvO2+hMfWBM0qYXPLrAXvxKKKnTQgos86I68aff3Csaq1KUJ9VhtnJOos/mqURg6Z1g1y7rMKoLtQsz2yuyG2Fzq3XGM6VZkRJx6h1aNJmt0I1wdA3PPZKe7ehZpMrKDLqKyKe9XWaR6UWA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <dedb7736-3998-991e-d3c4-c830ac73b3b1@suse.com>
Date: Thu, 6 Jul 2023 08:44:02 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH 5/5] x86: make parameter names of function
 declarations consistent
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Federico Serafini <federico.serafini@bugseng.com>,
 consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Paul Durrant <paul@xen.org>,
 Tamas K Lengyel <tamas@tklengyel.com>,
 Alexandru Isaila <aisaila@bitdefender.com>,
 Petre Pircalabu <ppircalabu@bitdefender.com>,
 Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1688049494.git.federico.serafini@bugseng.com>
 <5ee57d7bcd79daa0314f182ecb73e1eb6d8ecc03.1688049495.git.federico.serafini@bugseng.com>
 <0076f2d6-03b7-0a1c-c423-1f55b7195407@suse.com>
 <alpine.DEB.2.22.394.2307051550070.761183@ubuntu-linux-20-04-desktop>
 <alpine.DEB.2.22.394.2307051552080.761183@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307051552080.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0068.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4b::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8145:EE_
X-MS-Office365-Filtering-Correlation-Id: a1e92fa3-2093-4ed2-40be-08db7dec640d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	sFynyDEqIl4ac1awnuvLBHWA6/KTrkuPL1cESmKDEt5yMRtY5LE7grWFw/0KTeFm1VlnCgDMSP0sOORHfm1EqTcP4j7zHwb58asEgSvEaAJeAfB32g1KlmwyixNKxTJxwvzDtZe58G22cVR6n0x6hoL6yevxHtV5kwcT/SagJmAvUZZ2e+sC7hQ5e/B0N0Ke3wNbJpzeIKaKMmEp+Vs8i2czjp9Wisj1Fe/LOSZSBAFtaW7g9j/9AEct0qKixQgXyncwJyF+G0QSfwgMmX/X+rTpFqfWhuK3WcP15J1Frz6GLs8kjbP1btP5DCmhgvE1meo5NxrFobOEv2S5hd6tDCtNAnQAJwwRnMTXynNkcL8wJ1mhrbke8YYJrN/FA7hRuD+5nS6TytaQp68BV0X3KfXYPxL6qNHWpdVCAuAQ6N52e1v3j7c3ZSrrmqIUGYXlDbldw1BAoxkQI8bi2BQI9xYYon81af1YBNjvDcfMpt4LMVDkE95+E0T7qTbMysAlGBbKYPSJ4eYUtXsMiMok6agivTmdP/MLR69ErhK31KKETP4kMHL3j3Vt0RwjAvel/HPlE2OFBMqmls0M2hFOAbkz6j+ljEv6v2qmSfCXp017W+axFCzPd1GBRdzQdhVm55/MDq6M83AX/j09swv5NQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(39860400002)(396003)(366004)(136003)(451199021)(31686004)(7416002)(8936002)(8676002)(5660300002)(4744005)(41300700001)(316002)(2906002)(2616005)(66946007)(38100700002)(6916009)(4326008)(66556008)(66476007)(86362001)(186003)(54906003)(53546011)(26005)(478600001)(6506007)(31696002)(6486002)(36756003)(6512007)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WkdmL1p4dUk2KzBEMmgrbFJaQ3hSVTdQaWlaYmdJdEVsNGpJU3E5K0xEb0g0?=
 =?utf-8?B?RmFXbm1sN3g1TmVhUFpyL0ppWVpHekIvRmNwTkwzNzZ3S0U3MEdndi9WSUti?=
 =?utf-8?B?NXBSc000WU5KQ1hGT2hhVmNGRktxays2U0lGM2JEbHRqdENzc0phWkJyc0FJ?=
 =?utf-8?B?c3RyOEJIOHVMU2U3dC91QUtpWm5Kdm1sa3h0ZXFGNDRlOHYzVWpYMzhWNTFP?=
 =?utf-8?B?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V2RWSjRoczRlRkVJ?=
 =?utf-8?B?bWRqUEVSZmlBQlhNRC9xQVV6aFNJbjYxVFVOMS95Zk9wMFQrSDluSGkyU1p6?=
 =?utf-8?B?NzhPMjR0SEc2dHNDQzJ3NTNlQlBVWCtzWmZrUXNWOUU2aU9UMTNvRXlVZERm?=
 =?utf-8?Q?EWUTHix1nNngNHZtNIhJM4bdr?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a1e92fa3-2093-4ed2-40be-08db7dec640d
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 06:44:04.8617
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 9ZVO6mpA9WA+gTqzR9ymKw3qxGdjiWyf+EQZoM32jhiV5lBWIehtst4KKJEraV70MAEA3W32H93tK4n/S1/Muw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8145

On 06.07.2023 00:52, Stefano Stabellini wrote:
> On Wed, 5 Jul 2023, Stefano Stabellini wrote:
>> On Tue, 4 Jul 2023, Jan Beulich wrote:
>>> On 29.06.2023 17:55, Federico Serafini wrote:
>>>> --- a/xen/arch/x86/cpu/mcheck/mce.h
>>>> +++ b/xen/arch/x86/cpu/mcheck/mce.h
>>>> @@ -44,7 +44,7 @@ extern uint8_t cmci_apic_vector;
>>>>  extern bool lmce_support;
>>>>  
>>>>  /* Init functions */
>>>> -enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *c);
>>>> +enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *ci);
>>>
>>> Supported even by ...
>>>
>>>>  enum mcheck_type intel_mcheck_init(struct cpuinfo_x86 *c, bool bsp);
>>>
>>> ... immediate context, c is the name we use for parameters of this type.
>>> You want to change the definition in such cases instead of the
>>> declaration.
> 
> I should add that if we are going to change some functions in the other
> direction then it would be best to move those changes in a separate
> patch to make it easier to review.

+1

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 06:47:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 06:47:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559634.874775 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHImL-0006DZ-KB; Thu, 06 Jul 2023 06:47:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559634.874775; Thu, 06 Jul 2023 06:47:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHImL-0006DS-HP; Thu, 06 Jul 2023 06:47:49 +0000
Received: by outflank-mailman (input) for mailman id 559634;
 Thu, 06 Jul 2023 06:47:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VUoY=CY=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qHImK-0006DM-46
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 06:47:48 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on20618.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::618])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 04047341-1bc9-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 08:47:46 +0200 (CEST)
Received: from AS8PR04CA0005.eurprd04.prod.outlook.com (2603:10a6:20b:310::10)
 by GV2PR08MB8727.eurprd08.prod.outlook.com (2603:10a6:150:b6::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Thu, 6 Jul
 2023 06:47:42 +0000
Received: from AM7EUR03FT044.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:310:cafe::d9) by AS8PR04CA0005.outlook.office365.com
 (2603:10a6:20b:310::10) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Thu, 6 Jul 2023 06:47:42 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT044.mail.protection.outlook.com (100.127.140.169) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.24 via Frontend Transport; Thu, 6 Jul 2023 06:47:41 +0000
Received: ("Tessian outbound b11b8bb4dfe8:v142");
 Thu, 06 Jul 2023 06:47:41 +0000
Received: from a8e40f54b6c9.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 055FCABA-8AAE-483E-AF54-9D47F995A023.1; 
 Thu, 06 Jul 2023 06:47:34 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a8e40f54b6c9.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 06 Jul 2023 06:47:34 +0000
Received: from AM6P191CA0043.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:7f::20)
 by AS2PR08MB10226.eurprd08.prod.outlook.com (2603:10a6:20b:62f::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 06:47:33 +0000
Received: from AM7EUR03FT009.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:209:7f:cafe::51) by AM6P191CA0043.outlook.office365.com
 (2603:10a6:209:7f::20) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Thu, 6 Jul 2023 06:47:33 +0000
Received: from nebula.arm.com (40.67.248.234) by
 AM7EUR03FT009.mail.protection.outlook.com (100.127.140.130) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.24 via Frontend Transport; Thu, 6 Jul 2023 06:47:32 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com
 (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 6 Jul
 2023 06:47:31 +0000
Received: from [10.169.188.49] (10.169.188.49) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Thu, 6 Jul 2023 06:47:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 04047341-1bc9-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=f5b5E1cMVzF6B/zdq+/OZfX8IFK2i/XNLsgy4hp3eME=;
 b=hJmzJrzxaWsWEvGKTY48TQ7/NEXnB9JjWviCdpbYQ0PuybI7pBzGt6WqVYT/EuOOTZG+HFxKTX6i71nYIQV4rJkbqSBgO6tg6QLZ8p9mZTDD/N074t9NvUuwW2aThPO4465/PpRdgmdttEVVuHZydIye9Cc4tDp+YXYokyibvS0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: d11678a93077d1ea
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=czg3lUr/E68EQoSlbgtZAOahwsDRehd9jnBvL1aL54GpH0a8Ej7vZVpvUvyVmQrZ8ADmXfvihVMCMMM1Z1UDr4XeF1gJ7c/tX8+3uact+AA7+NG9w9sma+3NP/5eK1ZDCYZsLzBU1Vbsz50sL0mZniQr/xK6M4tej5kgPZmGYjwvs2A0yaTDp9lRAshgVCf5DV5UlvUiaojxpp9rDnynA5mTt0w55XFsK9HYD2geh7nieKwTGAA+UAt0C/BopvgkFnvh+s1M9Rj0lCK9cDuBHm+jw1rj5/DdzIxHxkvcaLiPgOemcA2BEliFk0XpKPotNM7+4/PvaklyOhwS1yqv8w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=f5b5E1cMVzF6B/zdq+/OZfX8IFK2i/XNLsgy4hp3eME=;
 b=cDQklGBfmfACV9aLAbfrsfwrf0+zHgo4T35aQfQRIZOc8p4nmrmZSxWYo6Ad1sQJA23KJS2nh/0b0m7enuP79zf9vAIgruW59BicEOWtGp+6vACUPZ5WDIRgs/hv4VCe/dN4SzxlKBBED8AiL/X5uhyzMGgl1Tthkmhh5EGM3W8ylCAlLnty+PGO9KUBUR1TcdNSpTnjup0/IZYMb1CHiLfcdpOuX/Z/ZkqYbNeX8zBIZYEo5O0uqg2PlheVTAd/+tnQBUHU/0nMd7kTg2pryNoOmfg4V5FkJS7i6ALFMTX/yag9THr9bbT9FXIlKEfv+OpCTPQ0K1+tNM+ggJgmpA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=f5b5E1cMVzF6B/zdq+/OZfX8IFK2i/XNLsgy4hp3eME=;
 b=hJmzJrzxaWsWEvGKTY48TQ7/NEXnB9JjWviCdpbYQ0PuybI7pBzGt6WqVYT/EuOOTZG+HFxKTX6i71nYIQV4rJkbqSBgO6tg6QLZ8p9mZTDD/N074t9NvUuwW2aThPO4465/PpRdgmdttEVVuHZydIye9Cc4tDp+YXYokyibvS0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <1227ef3c-2e80-de71-14ed-f9e195be1020@arm.com>
Date: Thu, 6 Jul 2023 14:47:27 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 08/52] xen/arm64: move MMU related code from head.S to
 mmu/head.S
Content-Language: en-US
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-9-Penny.Zheng@arm.com>
 <3e01a7bb-73ff-9363-29e3-e4882cd03e37@xen.org>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <3e01a7bb-73ff-9363-29e3-e4882cd03e37@xen.org>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	AM7EUR03FT009:EE_|AS2PR08MB10226:EE_|AM7EUR03FT044:EE_|GV2PR08MB8727:EE_
X-MS-Office365-Filtering-Correlation-Id: ed47ab4d-b48b-49aa-0563-08db7dece56d
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 VSvx8mwm5gnxfbedQ81CbcvSEh3NtdlgufYuM94FgKDC0aYojAi4aLnJu6VM2uuNIqgesEXCDNb3G/dYISJeZVcLlwTo4TlYpiGK2BR2tjQlsEJDpJUM3siwqMZIKUR4+Rkia8RNTbfo/wX+aDhMhNaLyvbREIn/2avWKdW9sRSXWlJQjPLDUlie1UVZM29cZvEMGjgh0fLxCxbqKs68u0QbRs5l6MrsjjBWpiOyGdS5s73OVUUCOHkALMFOXSVuu94CGpK0dqe1NZtLUf/R2/4pum87Ii1hd32YUo3kFRJ6XyOe9mKFVY3pzF829ibsespvfhsOqj9Oef+hLDwDtOX9kJrGpBwI7XWWJ+Mf8AFbKh2ViT7V7jIocGLKG0eOJDNET65ZCLbUZbaf2jP5yhAcbf7mQf4BRAJxd5V+7K2YY/crWpVm2Hajp8y0qBxtEIJ/bF1b8SRexOdHGf0UJnjqcxXlw19o7XG1+V6e6BC7VfbyiwVS5V+P0Ry9ufIlUTGyZcWoQlNU+7Q46zyj7FpSXKiTbyw1kTO/uEU9WjwwIdLADlQWdKWXD8GKznCYu4hgbwqY6h4nAG12DxcQcSbVqtVilP3wnSAdFbL4ZOzyNVuW4ZMV3iAI640/q1dohdiebt2InJiOhhMLwThiC7ELJJDxPS+A6jtQaKp1dmNtXjYUrevZFbuu9ELtR8ySXneJfbtTOC2ufVJQdoZAj6DKg8rDlTQA6L4XeVi3e9luQ7mKDYmMss9u2OrRCFZfL178IyLz4HZM3ZjhKpOKeuur3uhEXvPTf30hqtTjVKzDrLXDVSD1AOpqyADGNx+wV33o/llQ9YFs8dKJOJESLQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(396003)(136003)(39860400002)(451199021)(46966006)(36840700001)(40470700004)(82740400003)(82310400005)(40480700001)(40460700003)(356005)(41300700001)(8676002)(83380400001)(70586007)(8936002)(426003)(4326008)(316002)(70206006)(2906002)(2616005)(86362001)(5660300002)(31696002)(47076005)(36860700001)(44832011)(336012)(53546011)(110136005)(186003)(16576012)(31686004)(54906003)(36756003)(81166007)(478600001)(26005)(3940600001)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10226
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT044.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	b9ad7d2e-81d2-4df9-8aa8-08db7decdfec
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	em6WAmrNTfB1CL0Z4qVE4wojvQ7DErJEuJhaWEBtK6Gkx51TxDBleV6u9rew6L9r6uzyhsLhAEEqIUllkc5Xkp6V1XbfAwnAltk436o8J9SqxTyRskc1eSsnOugwl6eYG6CLK3FlwEp6EofXRYxjpLY70/mZWTyW+ynx7YR28/N0hXclep81LH0eBcvLBNTAHVQ0e2TKo75+S7qTF0N85b9xqcSsRPuBenSSxdI0izjSRDS04674mIKcvqXT6oYJ4ocyIF8cWPYTDzjSJYlChJZe3Y1IwTpVEK8MpG2CDXpduhFL/Y9PUl5AaFDPbCEUByMLtyP8LHRQssZGi0gQhZtt9lgnje3LNzXUxMPVIDMAQbSRtz1r/3PDJ7lOO7c7sT7RzdgxQIi1DN44MaYEEjFau36OVuU2DFHscaotuoESnrTa3ZQaEnG4GWPiof9yrH4Bt110FUBTXOEXOwr2fcHohAJ43A55BBJ57clzVfy7OUFveRGqgCjTPoFupRA6k7XKgPpTDqh0yaCSfiCsxNCQhESwflAETvHgIjdrR1VsC0tm6Yi79Aepn5m6JaY4idT2MLspcMNjxDv+XR3db5vWBMziNrrAHawDQSIQCiWhraQ5LWAkdUjiB+tFP50f76SFDlVycMHsS7ha010UVFys+3Ek866BhO/NvByLSxh6FgOkNuZp98jlrRxQmZ7jURe7wXyFJjPv8ZClG88i06R7tAp0hsb9xTQweWyYQhgoFJAmQrKMROtvtnV5R99oLZd2ELgj57P6sUYo01/Q11OesVTCrgdd6dLPDU3BIMcSDwMsKax2U5SXbu1l0+1h
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(136003)(39860400002)(396003)(451199021)(40470700004)(46966006)(36840700001)(5660300002)(26005)(107886003)(31686004)(478600001)(82740400003)(2616005)(31696002)(186003)(54906003)(16576012)(53546011)(81166007)(4326008)(70586007)(36860700001)(336012)(110136005)(426003)(83380400001)(70206006)(316002)(86362001)(47076005)(8676002)(8936002)(44832011)(40460700003)(41300700001)(2906002)(40480700001)(82310400005)(36756003)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 06:47:41.7313
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ed47ab4d-b48b-49aa-0563-08db7dece56d
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT044.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8727

Hi Julien

On 2023/7/5 18:43, Julien Grall wrote:
> Hi Penny,
> 
> One more remark.
> 
> On 26/06/2023 04:33, Penny Zheng wrote:
>> From: Wei Chen <wei.chen@arm.com>
>>
>> There are lots of MMU specific code in head.S. This code will not
>> be used in MPU systems. If we use #ifdef to gate them, the code
>> will become messy and hard to maintain. So we move MMU related
>> code to mmu/head.S, and keep common code still in head.S. We also
>> add .text.idmap in mmu/head.S to make all code in this new file
>> are still in identity map page but will be linked after head.S.
>>
>> As "fail" in head.S is very simple and this name is too easy to
>> be conflicted, so duplicate it in mmu/head.S instead of exporting
>> it.
>>
>> And some assembly macros that will be shared by MMU and MPU later,
>> we move them to macros.h.
>>
>> Rename enable_boot_mmu()/enable_runtime_mmu() to a more generic name
>> enable_boot_mm()/enable_runtime_mm(), in order to make them common 
>> interfaces
>> to be used for both MMU and later MPU system.
>>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>> ---
>> v1 -> v2:
>> 1. Move macros to macros.h
>> 2. Remove the indention modification
>> 3. Duplicate "fail" instead of exporting it.
>> ---
>> v3:
>> - Rename enable_boot_mmu()/enable_runtime_mmu() to a more generic name
>> enable_boot_mm()/enable_runtime_mm()
>> ---
>> Â  xen/arch/arm/arm64/MakefileÂ Â Â Â Â Â Â Â Â Â Â Â  |Â Â  3 +
>> Â  xen/arch/arm/arm64/head.SÂ Â Â Â Â Â Â Â Â Â Â Â Â Â  | 469 +-----------------------
>> Â  xen/arch/arm/arm64/mmu/head.SÂ Â Â Â Â Â Â Â Â Â  | 453 +++++++++++++++++++++++
>> Â  xen/arch/arm/include/asm/arm64/macros.h |Â  51 +++
>> Â  4 files changed, 509 insertions(+), 467 deletions(-)
>> Â  create mode 100644 xen/arch/arm/arm64/mmu/head.S
>>
>> diff --git a/xen/arch/arm/arm64/Makefile b/xen/arch/arm/arm64/Makefile
>> index 54ad55c75c..0c4b177be9 100644
>> --- a/xen/arch/arm/arm64/Makefile
>> +++ b/xen/arch/arm/arm64/Makefile
>> @@ -8,6 +8,9 @@ obj-y += domctl.o
>> Â  obj-y += domain.o
>> Â  obj-y += entry.o
>> Â  obj-y += head.o
>> +ifeq ($(CONFIG_HAS_MMU),y)
>> +obj-y += mmu/head.o
>> +endif
> 
> You could use obj-$(CONFIG_HAS_MMU) += mmu/head.o.
> 
> But in this case, I would rather prefer if we match how other 
> subdirectory are added. I.e. on the parent's directory Makefile you add:
> 
> obj-$(CONFIG_MMU) += mmu/
> 
> And in the directory you add a Makefile which list the files to compile.
> 

Understood. thanks for the instruction.

> Cheers,
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 06:52:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 06:52:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559638.874784 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHIqU-0007es-3e; Thu, 06 Jul 2023 06:52:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559638.874784; Thu, 06 Jul 2023 06:52:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHIqU-0007el-16; Thu, 06 Jul 2023 06:52:06 +0000
Received: by outflank-mailman (input) for mailman id 559638;
 Thu, 06 Jul 2023 06:52:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHIqT-0007eb-6G; Thu, 06 Jul 2023 06:52:05 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHIqS-0000Y0-Si; Thu, 06 Jul 2023 06:52:04 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHIqS-0008Sl-E3; Thu, 06 Jul 2023 06:52:04 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qHIqS-0002Fn-DH; Thu, 06 Jul 2023 06:52:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=0Y6ihNEE7YsFdAJn1SsxIPVVrmtU5L/Z/fIN8dxcydM=; b=tUueVrpf6xH7Nadq5ZNj2e8DdH
	2DjHyydjcsnPpo+BlOobDFGWiQfQ30da/HQu/fQwC7GN36emlQiD5vVmDrPnZEpmbg4HD/Aw729MT
	t7e1bqdb0XeDUlzce5xTJiZRATcYo58i3MBeb7A07hhw0DFHQixqQb0GgR4HeeYTtq5M=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181715-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181715: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-libvirt-raw:xen-install:fail:heisenbug
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=dc5e6082f5b36c4a4008c158b53320699025f895
X-Osstest-Versions-That:
    xen=abb1522832bb2ef340a56681d486dce51d2f9971
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 06 Jul 2023 06:52:04 +0000

flight 181715 xen-unstable real [real]
flight 181718 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181715/
http://logs.test-lab.xenproject.org/osstest/logs/181718/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-libvirt-raw   7 xen-install         fail pass in 181718-retest

Tests which did not succeed, but are not blocking:
 test-amd64-i386-libvirt-raw 14 migrate-support-check fail in 181718 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181699
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181699
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181699
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181699
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181699
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181699
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181699
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181699
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181699
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181699
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181699
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181699
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  dc5e6082f5b36c4a4008c158b53320699025f895
baseline version:
 xen                  abb1522832bb2ef340a56681d486dce51d2f9971

Last test of basis   181699  2023-07-04 22:38:42 Z    1 days
Failing since        181703  2023-07-05 10:03:18 Z    0 days    2 attempts
Testing same since   181715  2023-07-05 20:38:52 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Anthony PERARD <anthony.perard@citrix.com>
  Henry Wang <Henry.Wang@arm.com>
  Jan Beulich <jbeulich@suse.com>
  Jason Andryuk <jandryuk@gmail.com>
  Julien Grall <jgrall@amazon.com>
  Luca Fancellu <luca.fancellu@arm.com>
  Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Penny Zheng <penny.zheng@arm.com>
  Rahul Singh <rahul.singh@arm.com>
  Wei Chen <wei.chen@arm.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   abb1522832..dc5e6082f5  dc5e6082f5b36c4a4008c158b53320699025f895 -> master


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 07:02:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 07:02:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559667.874874 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJ0b-0001kf-V6; Thu, 06 Jul 2023 07:02:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559667.874874; Thu, 06 Jul 2023 07:02:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJ0b-0001kY-SK; Thu, 06 Jul 2023 07:02:33 +0000
Received: by outflank-mailman (input) for mailman id 559667;
 Thu, 06 Jul 2023 07:02:32 +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 <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHJ0a-0001kS-Ne
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 07:02:32 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20604.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::604])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 128ea40b-1bcb-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 09:02:29 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DUZPR04MB9897.eurprd04.prod.outlook.com (2603:10a6:10:4ad::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 07:02:26 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 07:02:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 128ea40b-1bcb-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KMq7ACFRx5I5UkB7D2RlExeczLp6Y7HZxFkq1kU8VDHFDmxCtCh7KU4UXn5QfKwmZJ1lQJnqDJTSDaq4tc+LelFy1yZ0mEWINSxarMMNuyP3V2Q+Vpymtn/rtimXpl/3tEvYI1+Ip6IcZndLSil58nG10+4toojE7Lj7HitD64aDr4TS/3mnFRVGi1VOVcvC7azLoK7DGAI2SgyK96d8e+yF3AhD0ntsJyxFiyWH3G64j5zUMHaaUpejPe2Q7sbTFyN2vOfvhJPnpdOxEIgiI0BwmSMKBfd9teUm6jX7kYJm5OzXynKn6sDfh0zxWcXPUIu8ECCiBKn7UBX8UN/JOA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BPe3zNBQ4lGBiaCq8dSmkN78oAZohVXDcdQYpgQrZ4E=;
 b=A4CSb1Bph+dD5zlyHmMqed+vn3dhNudT2fns60Fnqg3z0ZHWb/J43Hn3j4qGl/c33vKmyLei16uoHHlk8zmriBWLaYvVko73pBz5wBG0Q1nm86QQeU8WECO2mgxTPkPl/9QEk7Jh64hapHiq2jlZGw8r3B6am7+vEApURj0bG6BiBzjXqXCF4FuvRA1X8Z0JDadAlAGBnf4hE9G8W0qzT7gAyf6gIy2+NDXweTeW9tx0LDrMhXyNnzZ1FmQDkjFWBcoSxJ+Jk/LJIyvSO+xgyu91M2mo0CwsHmly1gy8ASNObKtq9rKDfsFXGlXT5QWEHm9BS4BlWuflqtiVIIFg6Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BPe3zNBQ4lGBiaCq8dSmkN78oAZohVXDcdQYpgQrZ4E=;
 b=z1O9NlwuacNCfxYX8DhAOuP5BfTj1xS7EnfRZDt2azdyl13lDpR1Bmk5tgeF3leQNWxvGGPCUZUJ7HBjdZshqKDCU64BZqruSuUTfz9aTBKY0l8H8jf7Tlsi8s8BbVhsyf1RIuUa7ue7W8yLlvHYphB2WH/FuhjJ4zbYWA+/zhTwhcYRhhrLPmhWsRylHBuC2gvbpS60Quu/R7a/Oj5nVuQYKlrf1JNCBBU2cRXRKxG/xboMLZd2vtVvnjLBolK7CG3yhv/aclrVl8Z6xz6rC9vM9QQlNbNK1dHhEhpVvaS31nK9ashkAR8/rzJM4Mm97L9A/0Azz5PEKeVAc4H46A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <a680ae62-7765-aa51-1edd-9a1a7e39e449@suse.com>
Date: Thu, 6 Jul 2023 09:02:23 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: Detecting whether dom0 is in a VM
Content-Language: en-US
To: zithro <slack@rabbit.lu>
References: <CA+zSX=Y4MwsDSd9oSG1NQyt==YAw9SeRdh=eJxTUhhOx57ihWg@mail.gmail.com>
 <4ee01a0f-063e-ef93-ac24-da387d5b3438@rabbit.lu>
From: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, George Dunlap <george.dunlap@cloud.com>
In-Reply-To: <4ee01a0f-063e-ef93-ac24-da387d5b3438@rabbit.lu>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0020.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1c::21) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DUZPR04MB9897:EE_
X-MS-Office365-Filtering-Correlation-Id: 9f27cde5-c24d-44a6-dded-08db7deef458
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	/DiRLQtgtOkBPjjvu5a4XfanUvtEgyhn+tBFNyU2BUPU7Q9NJh950wuyNYuHMBe72ChhtShZVqyCd1ACv0XNRuG5nN7+i8UO+D1k2pnv7AkKRhZKPiPZQRkfxCJaj46VwdQKAe4Cdx5gjGSfXeMLIzB7RP2DGT1kbCuJMpzfhUrbmHomC1Dyo8QDybs+Kj1tRxlYykGScusZ9ZMWKwBJBa8pKN0U4UyUJsrPKnDGJFQMO/lXm3+kuvb7jBmUTB3+j35Hud1F+vjeWhdqIXVP9B5EOUzd2Gl1+4q7Zily1q8onHiWO/T99xyXiX9dPPWHR0XPsHWJZ6SiYv0ZQDI4/S5qzmQaxe6wGWaCf5PuKFhF9YUryfZmrGk1u5UeVX407rLU72Ng1mlHhnPm8Qzz5zc/eTYLa1EJYlKIEKI6fLLA5ad7s1c/VwJyEezRaGo++f3hl1ElmDZlOIrnYleUOUe/hpq5r96tuKOcelezrSNvCRXpjBBgoooiKA0B2vFWlVLX0Nvmx/Wnf+EdI0PhLn1k/V4rcIkhlDdYTgwYZVPuWdmFFScw9ny39kFX4DDNyyMp0l5qEgswW37fq60eUoo2/y/iCIOjclKArJdHRzCcRf0+1x/k2IF3BfX8pa0l8MiIb/zUNqw0/hEf1Zb1c6hNPHnZTKwGkfyHFFb4BvxZt8UOHIwzmsNjmAkMcJcn
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(39860400002)(366004)(136003)(346002)(376002)(451199021)(31686004)(66899021)(6666004)(478600001)(6486002)(2616005)(83380400001)(26005)(36756003)(31696002)(86362001)(2906002)(66946007)(186003)(53546011)(6506007)(966005)(6512007)(38100700002)(66556008)(316002)(4326008)(6916009)(41300700001)(66476007)(8676002)(8936002)(5660300002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-Chun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ZFdDg1bVBlVzl0OWlweUxTVmJzTE9uV01NZjhEOUU1ZHk2QWJlWEV3RXJj?=
 =?utf-8?B?a0ZsbGJVSEpkZnlQNkdULzRkczc1MVNKdzJudkJhUDZpMFpSK21nSXBJRjJM?=
 =?utf-8?B?bnlRaHFkS1B3clNGSkFrRWI2UTlrWnUrVis1QkgyTHNoYUlWYXpBd053Y0xR?=
 =?utf-8?B?bFlGQTh4cGprbnZZeEVkS0tlWkJrakhLNGdxYnhFd090bW5JU1NUMEVQVm40?=
 =?utf-8?B?L204MUttU1FtcVlVN1dsOGRZcGdEODYyOTBlZktoR3B2Zm11RmxlbkNSNENj?=
 =?utf-8?B?bG1sNE9rMzd3OVdzQ05VdUZtN3hKdHA1aTlNcEZ3MEZSbEVlSHZCdG5CKzBj?=
 =?utf-8?B?MWluQmhiWVgrNks3bXVQYms4azJlWElERWpYUVFDRmszUjVZY1NlemE3YjBr?=
 =?utf-8?Q?dtBpIf9XI7H9gAuXWmQguWLGC?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9f27cde5-c24d-44a6-dded-08db7deef458
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 07:02:25.9220
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: eELqaDS6fUU8+TBzy0cxBxQbzsCODNAOPS7ZgAUteIVSd+EfHJOFF50fo/D9Sk7w5Sb9yOg2kC5mor9jJdIelA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DUZPR04MB9897

On 05.07.2023 18:20, zithro wrote:
> On 05 Jul 2023 17:51, George Dunlap wrote:
>> Hey all,
>>
>> The following systemd issue was brought to my attention:
>>
>> https://github.com/systemd/systemd/issues/28113
>>
>> I think basically, they want `systemd-detect-virt` return the following
>> values:
>>
>> Xen on hardware, from a dom0:  `none`
>> Xen on hardware, from a domU: `xen`
>> Xen in a VM, from a dom0: (ideally the virtualization type, or `vm-other`
>> if not)
>> Xen in a VM, from a domU: `xen`
>>
>> Is there a reliable set of tests which would work across all dom0 guest
>> types / architectures?  If not, can we expose the information somehow?
>>
>>   -George
>>
> 
> Small follow-up, I did some more tests (AMD platforms).
> systemd-detect-virt (sdv) is using "/sys/class/dmi/id/sys_vendor".
> 
> On both "baremetal" dom0s, sdv is reporting the platform manufacturer 
> ("MSI" or "Micro-Star International Co., Ltd." on my systems).
> 
> On a nested dom0, sdv is reporting "xen" :
>    root@xen-nested:~# SYSTEMD_LOG_LEVEL=debug systemd-detect-virt
>    Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy
>    Found container virtualization none.
>    Virtualization Xen found in DMI (/sys/class/dmi/id/sys_vendor)
>    Found VM virtualization xen
>    xen
> 
> PS: my host "xen-nested" is not masking CPUID leaves in cfg file.
> 
> So I'm wondering, isn't that path enough for correct detection ?
> I mean, if "/sys/class/dmi/id/sys_vendor" reports Xen (or KVM, or any 
> other known hypervisor), it's nested, otherwise it's on hardware ?
> 
> Is that really mandatory to use CPUID leaves ?

Let me ask the other way around: In user mode code under a non-nested
vs nested Xen, what would you be able to derive from CPUID? The
"hypervisor" bit is going to be set in both cases. (All assuming you
run on new enough hardware+Xen such that CPUID would be intercepted
even for PV.)

Yet relying on DMI is fragile, too: Along the lines of
https://lists.xen.org/archives/html/xen-devel/2022-01/msg00604.html
basically any value in there could be "inherited" from the host (i.e.
from the layer below, to be precise). The only way to be reasonably
certain is to ask Xen about its view. The raw or host featuresets
should give you this information, in the "mirror" of said respective
CPUID leave's "hypervisor" bit. But of course that still won't tell
you which _kind_ of hypervisor is the immediate next one underneath
Xen.

This then further raises the question of what use it is to know the
kind of the next level hypervisor, when multiple may be stacked on
top of one another ...

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 07:06:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 07:06:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559671.874885 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJ4B-0002MJ-GA; Thu, 06 Jul 2023 07:06:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559671.874885; Thu, 06 Jul 2023 07:06:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJ4B-0002MC-DH; Thu, 06 Jul 2023 07:06:15 +0000
Received: by outflank-mailman (input) for mailman id 559671;
 Thu, 06 Jul 2023 07:06:13 +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
 <SRS0=VUoY=CY=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qHJ49-0002M5-UU
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 07:06:13 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0615.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::615])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 95904a1c-1bcb-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 09:06:10 +0200 (CEST)
Received: from AS9PR06CA0627.eurprd06.prod.outlook.com (2603:10a6:20b:46e::31)
 by DU0PR08MB9025.eurprd08.prod.outlook.com (2603:10a6:10:471::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 07:06:07 +0000
Received: from AM7EUR03FT043.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:46e:cafe::c0) by AS9PR06CA0627.outlook.office365.com
 (2603:10a6:20b:46e::31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Thu, 6 Jul 2023 07:06:07 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT043.mail.protection.outlook.com (100.127.140.160) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.24 via Frontend Transport; Thu, 6 Jul 2023 07:06:06 +0000
Received: ("Tessian outbound 546d04a74417:v142");
 Thu, 06 Jul 2023 07:06:06 +0000
Received: from 164b35c9a721.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 0DA2893F-0F0D-4452-BF38-B50BC92D5A36.1; 
 Thu, 06 Jul 2023 07:05:59 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 164b35c9a721.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 06 Jul 2023 07:05:59 +0000
Received: from DUZPR01CA0015.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:3c3::18) by DU2PR08MB9963.eurprd08.prod.outlook.com
 (2603:10a6:10:495::6) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 07:05:57 +0000
Received: from DBAEUR03FT003.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:3c3:cafe::eb) by DUZPR01CA0015.outlook.office365.com
 (2603:10a6:10:3c3::18) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Thu, 6 Jul 2023 07:05:57 +0000
Received: from nebula.arm.com (40.67.248.234) by
 DBAEUR03FT003.mail.protection.outlook.com (100.127.142.89) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.24 via Frontend Transport; Thu, 6 Jul 2023 07:05:56 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com
 (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 6 Jul
 2023 07:05:55 +0000
Received: from [10.169.188.49] (10.169.188.49) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Thu, 6 Jul 2023 07:05:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 95904a1c-1bcb-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=X+lrRyVhzycLPYk73qkHO03Gg8HAnH3q4wV/adoM6mA=;
 b=E/s2rTMIfS2RPg+SvR0N8qBNvZDsQQtidyXkm5r+rr2pOmQmKT4dcNuvosI6z2pOf36mDFSePZubKMeghx5tzsFTZIQYqI62duOAQt1ytV9SnZcDHoOQk/s7YsZa5AZlbsJZOfka1jH9xfaekeJYfuH49NcvY/VU/+OBaz5Bdlw=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 7b27577b2912c9df
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=dztXu9Q/tO4fX79Pavs/2/GvNF6OdS8/UDBaAn5Pchho8j76Z320IMw7hgfNSBCJ80UhV4pSfUR92apElX/39exLhvXru8URcVRDJVdSKquukcVjIZjfgQoXYBDpcdcvc8mJG+jLIrgGj6NxTP5COV2+/3ddFOa8lu0pJ5fJqen0zu8Ko3Kgo0IPOLY+fkGsvtjGR+uJqGlrgpJhuMEgK+WEs5JkRKmKieWwPCdH6kLR7IXNuFDKAsB27nhfG1dycoZFop90yDrduQoJKmOaOALLOUgWBhEyPoRHKIKZA1VMJxaBV2r3wYrO5xKgGX9CeiJdwEl8fShbvQEGdZ/ulw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=X+lrRyVhzycLPYk73qkHO03Gg8HAnH3q4wV/adoM6mA=;
 b=KLhYqqVfE0IGBDhGO5/0VjLxv2gn8YzANotPa3msNie0MSyrnwmwPzgF9gasr/raqyJNKD+R1IVO2zh3Ljd2M5fkCe6PnKL9L5+2udkErt4EUDQQwJIY3tcQE0FPi38FNBGcvQFXXgHDsaHWkis4ifzq/kZNNoH70aQMvjJ2yF11dF3mSgLgdQMi5U1qa8QJefi4c2HbCIgs+821ZyeRqUUcSGF2O1vuEd4p9x7qTKUWr02CeG8dDqKQK34JBftx2ODJIeVb26/S5B5AfbXN2ivgqRFkMjLTxoFyNevbjQ2v3rpU6VfOtU2jbVcQxQ0wDoiGO3GS5EaVnWKQyb7fgw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=X+lrRyVhzycLPYk73qkHO03Gg8HAnH3q4wV/adoM6mA=;
 b=E/s2rTMIfS2RPg+SvR0N8qBNvZDsQQtidyXkm5r+rr2pOmQmKT4dcNuvosI6z2pOf36mDFSePZubKMeghx5tzsFTZIQYqI62duOAQt1ytV9SnZcDHoOQk/s7YsZa5AZlbsJZOfka1jH9xfaekeJYfuH49NcvY/VU/+OBaz5Bdlw=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <af324ae7-464b-7e04-e3fb-bc436e22a369@arm.com>
Date: Thu, 6 Jul 2023 15:05:51 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 09/52] xen/arm: use PA == VA for
 EARLY_UART_VIRTUAL_ADDRESS on MPU systems
Content-Language: en-US
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-10-Penny.Zheng@arm.com>
 <14ea91dc-2af1-f7c7-5888-22df8fd9133d@xen.org>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <14ea91dc-2af1-f7c7-5888-22df8fd9133d@xen.org>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	DBAEUR03FT003:EE_|DU2PR08MB9963:EE_|AM7EUR03FT043:EE_|DU0PR08MB9025:EE_
X-MS-Office365-Filtering-Correlation-Id: 5fe46011-1d21-4776-e430-08db7def77fe
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 fqXkt05WnwDwm3RO6N2G8xROsiBvYgaeL3Qw6hahXuJEsvYkQ3XbFXZrv0z6dqRHqHyLuTTasEZIE1PWc4pgm/9ZHIz4rveXN2m7D/EQm9MJByS6GMngfKhRTZcz1c/CSFHR+dv5DS+KCGkwqWiQAhTGTdtGfHdNW3HNOZYHhq1x/YTHQ+xh/owEWw7KJf1ArGIh7XzonFGb8PkAw1/JxEACY2PlWj4w9qw0hlkuqmofBJpptqmNkC54NMcz23xouTigTQQdAQtRrErRYyiMmWfUt2o55vSUuZnD3Jj64Nt6lErsVnA6xYcZhV7BTfDaYORm5j9vMH1cffk/fbWCpts/TSmiNhAG0g+29ldoDoJ29uFY8vZmg1XuDWVvhsskUwpXOHbUReN0cYVp+qs5xFmAX0QBrVWpAyIqG3c5LIa0JMnvdXNtacQP4sAvKcllBQBPAoN1XiHBcQneuNZsVyD55DwmrNEjfntARemlULNoAQL5whRfJ4CpriuvNpYdd0FPktWvc30cuRFXJxOmk9ubIqybDEjYALYSvGqWc2X8qHbAmMT91dlJ/ENkSfj68DgjgpbjmfihkTPOsTdl0LcVKW/aDu2BOsj0fv+a7WxHQrYyat9HiLQUtJU84WleypoOZOt0XP9CieyPZjL1LT2SlZbnA6bdR3DBkQ2OzOKKMGIjdN4wMCRtcn4BAi1FxWGSH941+mi53M/9vHT0SSAEh0t5HvnOYIHH2khTMKUmfKNjdgrm1tw8jy70Q5q0cA5RsV049s53Kk+uyrwiVocIrFoHQr948KQHgR/GG69NHgcxaI+KtqE8uuMN4PI5WzWNBnE3sWSQOzf8B5BZYA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(376002)(136003)(346002)(451199021)(46966006)(40470700004)(36840700001)(186003)(82740400003)(478600001)(426003)(26005)(53546011)(31686004)(86362001)(336012)(2616005)(110136005)(316002)(81166007)(47076005)(356005)(16576012)(54906003)(36860700001)(70206006)(4326008)(70586007)(5660300002)(8936002)(8676002)(40460700003)(44832011)(4744005)(41300700001)(2906002)(40480700001)(31696002)(82310400005)(36756003)(3940600001)(36900700001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB9963
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT043.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	5347ccd3-8eb5-44df-a0a1-08db7def71e5
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	52TpJVUTc01dtZcQZp7bjW1rPgOZVX8LQjFyvKWkTmnyzRzxlATUfrQZDz1JCo7Wh15AhBzEMcRz0Oq+/y2u/MYAg6NleSXpD7acsOmVXrP6W7GzTWNY7hk+TKNlU4i3jhJa/xDjdnduvfDDgXZlcf5nvRWOoW/f7Msd+yn0eddrhwtTOntBwNZzR+JAoYfO7nXNfgiLEUOQ56T8tD1cxzGJnHqMTJz532YQO7jBQWIo683MUrZtg87+KU14ERpUQRv6p5ZkJx6GUHga8ikvh22IZQHvM/JaFeIfI8G7ykhrkGg4Thr6oyWQSdBhTHnXQ3zybjcK3u2JpvVO8dQt6sT+oyeS+khyVDGPoQ+sFjZ+HhyjqPF+z18w+kTLPKborcJd44Qe+XvWHF6NraAQIXOI771bjY5ESjEvPOt6szEVamZ+kk0gM9ttbcLxj36SHkNzAcPSJD9RBnxx/b7ZuvQdrXEN2aajXvBdUkLXmntAMzjyB3COEy7hmhI0/ySzbWYpIjSIAbIwwag8KIFCaqHyawgRvgRhJmPVQRUWo6/E6d5U3AJVMq8Qq4RQESBGdxFQttcF8JNkb9FtlHpTRw+ALSlyvJSsvat6uD2bUVn80/xTKHYpA8zRRwruKyA9+eUcvjM0z1Ij7VLt/Dc7wcy8F6vwH3SnEQ9Pcuqs9/+iy/JG5AbngeNsCBeQ5oNHRBIyTq6iSSbrNRz0m+SWWdIdS4jHH6tq8KIqe98WZd/yBRBtC8d23N0OkLjA76HfOwedpzpmFGMufZ7rR4rsAGHJGGg1RaFW9c0tLKitmls=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(376002)(136003)(346002)(451199021)(46966006)(40470700004)(36840700001)(186003)(82740400003)(478600001)(426003)(26005)(53546011)(31686004)(86362001)(107886003)(336012)(2616005)(110136005)(316002)(81166007)(47076005)(16576012)(54906003)(36860700001)(70206006)(4326008)(70586007)(5660300002)(8936002)(8676002)(40460700003)(44832011)(4744005)(41300700001)(2906002)(40480700001)(31696002)(82310400005)(36756003)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 07:06:06.6281
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 5fe46011-1d21-4776-e430-08db7def77fe
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT043.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9025

Hi Julien

On 2023/7/5 03:25, Julien Grall wrote:
> Hi Penny,
> 
> On 26/06/2023 04:34, Penny Zheng wrote:
>> From: Wei Chen <wei.chen@arm.com>
>>
>> There is no VMSA support on MPU systems, so we can not map early
>> UART to FIXMAP_CONSOLE. In stead, we can use PA == VA for early
>> UART on MPU systems.
>>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> 
> Is this change necessary for the MMU split? If not, I will skip the 
> review for now.
> 

It is not necessary. I will not include it in next series focusing on 
MMU split.

> Cheers,
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 07:30:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 07:30:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559675.874895 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJR7-0004xT-BB; Thu, 06 Jul 2023 07:29:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559675.874895; Thu, 06 Jul 2023 07:29:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJR7-0004xM-8E; Thu, 06 Jul 2023 07:29:57 +0000
Received: by outflank-mailman (input) for mailman id 559675;
 Thu, 06 Jul 2023 07:29:55 +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
 <SRS0=oboG=CY=linaro.org=viresh.kumar@srs-se1.protection.inumbo.net>)
 id 1qHJR5-0004xE-Lq
 for xen-devel@lists.xen.org; Thu, 06 Jul 2023 07:29:55 +0000
Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com
 [2607:f8b0:4864:20::1036])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e4434788-1bce-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 09:29:51 +0200 (CEST)
Received: by mail-pj1-x1036.google.com with SMTP id
 98e67ed59e1d1-262e839647eso367262a91.2
 for <xen-devel@lists.xen.org>; Thu, 06 Jul 2023 00:29:51 -0700 (PDT)
Received: from localhost ([122.172.87.195]) by smtp.gmail.com with ESMTPSA id
 t11-20020a170902e84b00b001b8b6a19bd6sm690159plg.63.2023.07.06.00.29.48
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 06 Jul 2023 00:29:48 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e4434788-1bce-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1688628589; x=1691220589;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=Ur6U8znIrg+MN1C36AIYyVQaxBlVTa6MnJ12V0yVeWc=;
        b=dk4yfLxO8MqrpL0At35TL5vjmOQOzIZIL8HlehxabEUx4MXzFwfguq+MwfC59UoLNw
         Nd8gXX7nFsBU/oXffL0gpam4l7aFKM0y+Y+E5LIS85dCEd+crABbs6xichq2oIqLa2NF
         qHxzySTciQHGjbJ/91CJ4hOGkHDZkIa/32GkFdtNCyPYC4xThBH6s3B4Aba0kMrMLKCj
         66Yw+MKE2B9uuwvSVxAsFd6LkFfNhlHoY5tXgsy7VFED7/76Pcs9KJsIw0nPd67S+17B
         PmvJwiwTUFndTJLoRV+cADqPoiu+HXypyWc2cdymKLm2/9r6Iix50wr4BUxLDWQfUV/7
         E1pg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688628589; x=1691220589;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=Ur6U8znIrg+MN1C36AIYyVQaxBlVTa6MnJ12V0yVeWc=;
        b=JXzjI6ky1W64C3i8suOLFIBSESzrYXLT8TcIxSvg7G5cWAHjUgUFvJftOnvoOn/cJp
         cQdXNWvk3vXkEHzR1KBJhOhiTWZIXZ+u68zE/ohIebf8d/iokqcW5ALsUCYwk0h1uypz
         Si4idwlpD17IPk7r4rnaJWayvKNrkNdWadTGTZbxFkaQrr7rGF+SOEjIZntI2s8UmzuJ
         rfG2cGLDbtHm44IrVcEnGvkn5ezMtB6FOrQhhGOX5p076+k+bWZDFkclDgDxsZltp+ja
         cmE6dvCpb1omT5BdivUlHjErqwwqDvp0Ct8+2l9C6dKotsd7M+S6GQ4HkxKO9z+h5/vC
         fI/A==
X-Gm-Message-State: ABy/qLaMguZvX2DrKxhDIf3f9J+rBPXLnTEw2WmDrUJ21ZQxjVDF//Tb
	rHfK40xPN4tSI19qHPc8sPoHq/Kh9DQ0NgH9MD0=
X-Google-Smtp-Source: APBJJlFWdg1wCn3ML0F/nyJH5NldND2oLYGYDiT7x2hCCHOfTnYm3RlEj8jcTw/xgxrhbkVzXkBCMA==
X-Received: by 2002:a17:90b:4f85:b0:261:875:c2be with SMTP id qe5-20020a17090b4f8500b002610875c2bemr979257pjb.29.1688628589457;
        Thu, 06 Jul 2023 00:29:49 -0700 (PDT)
From: Viresh Kumar <viresh.kumar@linaro.org>
To: xen-devel@lists.xen.org,
	Juergen Gross <jgross@suse.com>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Nick Rosbrook <rosbrookn@gmail.com>,
	Wei Liu <wl@xen.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	stratos-dev@op-lists.linaro.org,
	=?UTF-8?q?Alex=20Benn=C3=A9e?= <alex.bennee@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.com>,
	Oleksandr Tyshchenko <olekstysh@gmail.com>,
	Erik Schilling <erik.schilling@linaro.org>
Subject: [PATCH V4] libxl: arm: Add grant_usage parameter for virtio devices
Date: Thu,  6 Jul 2023 12:59:45 +0530
Message-Id: <144a57807d6f3e6c1e9b45215cb4fa5fa4535f10.1688628006.git.viresh.kumar@linaro.org>
X-Mailer: git-send-email 2.31.1.272.g89b43f80a514
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Currently, the grant mapping related device tree properties are added if
the backend domain is not Dom0. While Dom0 is privileged and can do
foreign mapping for the entire guest memory, it is still desired for
Dom0 to access guest's memory via grant mappings and hence map only what
is required.

This commit adds the "grant_usage" parameter for virtio devices, which
provides better control over the functionality.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
---
V3.1->V4:
- Added Reviewed-by tags.
- Other patches from the series are already applied.
- No code changes.

V3->V3.1:
- Print "0" or "1" in xenstore instead of "True" or "False" for grant_usage.

V2->V3:
- Reuse `libxl_defbool` instead of defining a new type, it can take values 0 and 1.
- Improved commit logs and comments.

V1->V2:
- Instead of just 0 or 1, the argument can take multiple values now and control
  the functionality in a better way.

- Update .gen.go files as well.

- Don't add nodes under frontend path.

 docs/man/xl.cfg.5.pod.in             |  8 ++++++++
 tools/golang/xenlight/helpers.gen.go |  6 ++++++
 tools/golang/xenlight/types.gen.go   |  1 +
 tools/libs/light/libxl_arm.c         | 22 +++++++++++++---------
 tools/libs/light/libxl_types.idl     |  1 +
 tools/libs/light/libxl_virtio.c      | 23 +++++++++++++++++++++--
 tools/xl/xl_parse.c                  |  2 ++
 7 files changed, 52 insertions(+), 11 deletions(-)

diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index 3979be2a590a..b6fc20ef01c8 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -1619,6 +1619,14 @@ hexadecimal format, without the "0x" prefix and all in lower case, like
 Specifies the transport mechanism for the Virtio device, only "mmio" is
 supported for now.
 
+=item B<grant_usage=BOOLEAN>
+
+If this option is B<true>, the Xen grants are always enabled.
+If this option is B<false>, the Xen grants are always disabled.
+
+If this option is missing, then the default grant setting will be used,
+i.e. enable grants if backend-domid != 0.
+
 =back
 
 =item B<tee="STRING">
diff --git a/tools/golang/xenlight/helpers.gen.go b/tools/golang/xenlight/helpers.gen.go
index cd1a16e32eac..3ecffdf0ef3a 100644
--- a/tools/golang/xenlight/helpers.gen.go
+++ b/tools/golang/xenlight/helpers.gen.go
@@ -1794,6 +1794,9 @@ func (x *DeviceVirtio) fromC(xc *C.libxl_device_virtio) error {
 x.BackendDomname = C.GoString(xc.backend_domname)
 x.Type = C.GoString(xc._type)
 x.Transport = VirtioTransport(xc.transport)
+if err := x.GrantUsage.fromC(&xc.grant_usage);err != nil {
+return fmt.Errorf("converting field GrantUsage: %v", err)
+}
 x.Devid = Devid(xc.devid)
 x.Irq = uint32(xc.irq)
 x.Base = uint64(xc.base)
@@ -1811,6 +1814,9 @@ xc.backend_domname = C.CString(x.BackendDomname)}
 if x.Type != "" {
 xc._type = C.CString(x.Type)}
 xc.transport = C.libxl_virtio_transport(x.Transport)
+if err := x.GrantUsage.toC(&xc.grant_usage); err != nil {
+return fmt.Errorf("converting field GrantUsage: %v", err)
+}
 xc.devid = C.libxl_devid(x.Devid)
 xc.irq = C.uint32_t(x.Irq)
 xc.base = C.uint64_t(x.Base)
diff --git a/tools/golang/xenlight/types.gen.go b/tools/golang/xenlight/types.gen.go
index b131a7eedc9d..4f40aac28c2a 100644
--- a/tools/golang/xenlight/types.gen.go
+++ b/tools/golang/xenlight/types.gen.go
@@ -706,6 +706,7 @@ BackendDomid Domid
 BackendDomname string
 Type string
 Transport VirtioTransport
+GrantUsage Defbool
 Devid Devid
 Irq uint32
 Base uint64
diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
index 35f76dfc21e4..f98e1affa294 100644
--- a/tools/libs/light/libxl_arm.c
+++ b/tools/libs/light/libxl_arm.c
@@ -930,7 +930,8 @@ static int make_xen_iommu_node(libxl__gc *gc, void *fdt)
 
 /* The caller is responsible to complete / close the fdt node */
 static int make_virtio_mmio_node_common(libxl__gc *gc, void *fdt, uint64_t base,
-                                        uint32_t irq, uint32_t backend_domid)
+                                        uint32_t irq, uint32_t backend_domid,
+                                        bool grant_usage)
 {
     int res;
     gic_interrupt intr;
@@ -953,7 +954,7 @@ static int make_virtio_mmio_node_common(libxl__gc *gc, void *fdt, uint64_t base,
     res = fdt_property(fdt, "dma-coherent", NULL, 0);
     if (res) return res;
 
-    if (backend_domid != LIBXL_TOOLSTACK_DOMID) {
+    if (grant_usage) {
         uint32_t iommus_prop[2];
 
         iommus_prop[0] = cpu_to_fdt32(GUEST_PHANDLE_IOMMU);
@@ -967,11 +968,12 @@ static int make_virtio_mmio_node_common(libxl__gc *gc, void *fdt, uint64_t base,
 }
 
 static int make_virtio_mmio_node(libxl__gc *gc, void *fdt, uint64_t base,
-                                 uint32_t irq, uint32_t backend_domid)
+                                 uint32_t irq, uint32_t backend_domid,
+                                 bool grant_usage)
 {
     int res;
 
-    res = make_virtio_mmio_node_common(gc, fdt, base, irq, backend_domid);
+    res = make_virtio_mmio_node_common(gc, fdt, base, irq, backend_domid, grant_usage);
     if (res) return res;
 
     return fdt_end_node(fdt);
@@ -1027,11 +1029,11 @@ static int make_virtio_mmio_node_gpio(libxl__gc *gc, void *fdt)
 
 static int make_virtio_mmio_node_device(libxl__gc *gc, void *fdt, uint64_t base,
                                         uint32_t irq, const char *type,
-                                        uint32_t backend_domid)
+                                        uint32_t backend_domid, bool grant_usage)
 {
     int res;
 
-    res = make_virtio_mmio_node_common(gc, fdt, base, irq, backend_domid);
+    res = make_virtio_mmio_node_common(gc, fdt, base, irq, backend_domid, grant_usage);
     if (res) return res;
 
     /* Add device specific nodes */
@@ -1371,7 +1373,8 @@ static int libxl__prepare_dtb(libxl__gc *gc, libxl_domain_config *d_config,
                     iommu_needed = true;
 
                 FDT( make_virtio_mmio_node(gc, fdt, disk->base, disk->irq,
-                                           disk->backend_domid) );
+                                           disk->backend_domid,
+                                           disk->backend_domid != LIBXL_TOOLSTACK_DOMID) );
             }
         }
 
@@ -1381,12 +1384,13 @@ static int libxl__prepare_dtb(libxl__gc *gc, libxl_domain_config *d_config,
             if (virtio->transport != LIBXL_VIRTIO_TRANSPORT_MMIO)
                 continue;
 
-            if (virtio->backend_domid != LIBXL_TOOLSTACK_DOMID)
+            if (libxl_defbool_val(virtio->grant_usage))
                 iommu_needed = true;
 
             FDT( make_virtio_mmio_node_device(gc, fdt, virtio->base,
                                               virtio->irq, virtio->type,
-                                              virtio->backend_domid) );
+                                              virtio->backend_domid,
+                                              libxl_defbool_val(virtio->grant_usage)) );
         }
 
         /*
diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
index 9e48bb772646..700b44a164f4 100644
--- a/tools/libs/light/libxl_types.idl
+++ b/tools/libs/light/libxl_types.idl
@@ -762,6 +762,7 @@ libxl_device_virtio = Struct("device_virtio", [
     ("backend_domname", string),
     ("type", string),
     ("transport", libxl_virtio_transport),
+    ("grant_usage", libxl_defbool),
     ("devid", libxl_devid),
     # Note that virtio-mmio parameters (irq and base) are for internal
     # use by libxl and can't be modified.
diff --git a/tools/libs/light/libxl_virtio.c b/tools/libs/light/libxl_virtio.c
index f8a78e22d156..e5e321adc5c4 100644
--- a/tools/libs/light/libxl_virtio.c
+++ b/tools/libs/light/libxl_virtio.c
@@ -23,8 +23,16 @@ static int libxl__device_virtio_setdefault(libxl__gc *gc, uint32_t domid,
                                            libxl_device_virtio *virtio,
                                            bool hotplug)
 {
-    return libxl__resolve_domid(gc, virtio->backend_domname,
-                                &virtio->backend_domid);
+    int rc;
+
+    rc = libxl__resolve_domid(gc, virtio->backend_domname,
+                              &virtio->backend_domid);
+    if (rc < 0) return rc;
+
+    libxl_defbool_setdefault(&virtio->grant_usage,
+                             virtio->backend_domid != LIBXL_TOOLSTACK_DOMID);
+
+    return 0;
 }
 
 static int libxl__device_from_virtio(libxl__gc *gc, uint32_t domid,
@@ -53,6 +61,8 @@ static int libxl__set_xenstore_virtio(libxl__gc *gc, uint32_t domid,
     flexarray_append_pair(back, "base", GCSPRINTF("%#"PRIx64, virtio->base));
     flexarray_append_pair(back, "type", GCSPRINTF("%s", virtio->type));
     flexarray_append_pair(back, "transport", GCSPRINTF("%s", transport));
+    flexarray_append_pair(back, "grant_usage",
+                          libxl_defbool_val(virtio->grant_usage) ? "1" : "0");
 
     return 0;
 }
@@ -104,6 +114,15 @@ static int libxl__virtio_from_xenstore(libxl__gc *gc, const char *libxl_path,
         }
     }
 
+    tmp = NULL;
+    rc = libxl__xs_read_checked(gc, XBT_NULL,
+                                GCSPRINTF("%s/grant_usage", be_path), &tmp);
+    if (rc) goto out;
+
+    if (tmp) {
+        libxl_defbool_set(&virtio->grant_usage, strtoul(tmp, NULL, 0));
+    }
+
     tmp = NULL;
     rc = libxl__xs_read_checked(gc, XBT_NULL,
 				GCSPRINTF("%s/type", be_path), &tmp);
diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index f036e56fc239..dfd432ca02e2 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -1215,6 +1215,8 @@ static int parse_virtio_config(libxl_device_virtio *virtio, char *token)
     } else if (MATCH_OPTION("transport", token, oparg)) {
         rc = libxl_virtio_transport_from_string(oparg, &virtio->transport);
         if (rc) return rc;
+    } else if (MATCH_OPTION("grant_usage", token, oparg)) {
+        libxl_defbool_set(&virtio->grant_usage, strtoul(oparg, NULL, 0));
     } else {
         fprintf(stderr, "Unknown string \"%s\" in virtio spec\n", token);
         return -1;
-- 
2.31.1.272.g89b43f80a514



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 07:37:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 07:37:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559681.874905 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJY9-0006Va-7W; Thu, 06 Jul 2023 07:37:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559681.874905; Thu, 06 Jul 2023 07:37:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJY9-0006VT-3I; Thu, 06 Jul 2023 07:37:13 +0000
Received: by outflank-mailman (input) for mailman id 559681;
 Thu, 06 Jul 2023 07:37:11 +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
 <SRS0=VUoY=CY=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qHJY7-0006VN-LV
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 07:37:11 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on20617.outbound.protection.outlook.com
 [2a01:111:f400:fe12::617])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e98f66ad-1bcf-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 09:37:09 +0200 (CEST)
Received: from DUZPR01CA0326.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4ba::25) by GV1PR08MB8108.eurprd08.prod.outlook.com
 (2603:10a6:150:93::22) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 07:37:03 +0000
Received: from DBAEUR03FT057.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4ba:cafe::45) by DUZPR01CA0326.outlook.office365.com
 (2603:10a6:10:4ba::25) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Thu, 6 Jul 2023 07:37:03 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT057.mail.protection.outlook.com (100.127.142.182) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.24 via Frontend Transport; Thu, 6 Jul 2023 07:37:02 +0000
Received: ("Tessian outbound e2424c13b707:v142");
 Thu, 06 Jul 2023 07:37:02 +0000
Received: from 1eb9b6c22cad.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 1F501259-F8A5-49CA-8DAD-02744B794CC1.1; 
 Thu, 06 Jul 2023 07:36:56 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1eb9b6c22cad.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 06 Jul 2023 07:36:55 +0000
Received: from AS9PR05CA0116.eurprd05.prod.outlook.com (2603:10a6:20b:498::10)
 by AS4PR08MB7478.eurprd08.prod.outlook.com (2603:10a6:20b:4e5::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 07:36:53 +0000
Received: from AM7EUR03FT030.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:498:cafe::1e) by AS9PR05CA0116.outlook.office365.com
 (2603:10a6:20b:498::10) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Thu, 6 Jul 2023 07:36:53 +0000
Received: from nebula.arm.com (40.67.248.234) by
 AM7EUR03FT030.mail.protection.outlook.com (100.127.140.180) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.24 via Frontend Transport; Thu, 6 Jul 2023 07:36:52 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com
 (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 6 Jul
 2023 07:36:51 +0000
Received: from [10.169.188.49] (10.169.188.49) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Thu, 6 Jul 2023 07:36:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e98f66ad-1bcf-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=t0Y95sPTVDAB8hXY0t0JqFTvngRZNVAQT03PkRKRyUw=;
 b=RsIKAq7FP1l0u6ICTjg0/ZjwkgzL+8AWREpt9pvzMnTxO0R0zs2fqHMEZBPzQnhGJXlqPuSrQGEqcUTBDceB6tV5ZM9fm2ulQspKJpWxvEwwYJhZzAntSJJ7L3qI9n6EUR6znSz7VWFVGEUgJmmXMa5ahZMfYDBOLf/BAQvM0CU=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: f08f9d8ed0562c44
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ajfIj7711o3si50q3yIgfLxAbb+Gve4qEolrGdT3wh2qDZKW+YrMtWmq+BNte2e2AK2Yn5Oxpq2tK4EqlsXJcMuJqBCIzFjwbcMkXTdjzktOJBFA875b7vdoCXNK0A2AvsyYyHqJbZkZglgh8iExlEodLBJuv4LQz3vuZy5khkvHQMOdJv1Cerq+4BNnZcTdn5iog+mnH0mb1ucHDnuaXf9TGYgxuhsBz50YeIvEwZ1n+LlhGM7ChjLEIug70BbwYo11hOnhtyCPOgoErCcRcHPHSev8gr4jRGXt63qA8mv30dJtCWI1il+iuY/CAhXSnFwndcewtqezSqECwNKAlA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=t0Y95sPTVDAB8hXY0t0JqFTvngRZNVAQT03PkRKRyUw=;
 b=GjvAZBP63g7DR4s5hyUtVZi8JEe6tYpQJKyKekyOWd62dFstYqzmvk+rhy2ynKYTbzwxrQAIrtFeJeB2cU4+jRkYqqs3QDERUa+4zJRJh2wkn5qVLq1jiqAYWo3BWhSqmGjE+UCfYcMmgHYK8Flvl+pbEB4tSq4sWgbOs89mgSaTIq5WTT4Sz+mTPWa48RZxrotf3BAcXV67Ncguc0WN4dKy+dgfinZthCYJIZV8ellQ+hJtbiB8ncfxkvvKgHQJ2cAUA92RV8mXGFbZZZsk8b6Evs+9Y3FU/YufIRtbZ3OBELMbIB7s0+6lnzzZTHAaOUxbJIK48Q1UWiOW5BHZ4A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=t0Y95sPTVDAB8hXY0t0JqFTvngRZNVAQT03PkRKRyUw=;
 b=RsIKAq7FP1l0u6ICTjg0/ZjwkgzL+8AWREpt9pvzMnTxO0R0zs2fqHMEZBPzQnhGJXlqPuSrQGEqcUTBDceB6tV5ZM9fm2ulQspKJpWxvEwwYJhZzAntSJJ7L3qI9n6EUR6znSz7VWFVGEUgJmmXMa5ahZMfYDBOLf/BAQvM0CU=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <f731455a-0639-d0fb-62cc-544347ce6e1d@arm.com>
Date: Thu, 6 Jul 2023 15:36:47 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 10/52] xen/arm: Move MMU related definitions from
 config.h to mmu/layout.h
Content-Language: en-US
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-11-Penny.Zheng@arm.com>
 <ee493a26-234c-876e-e19f-3708c13cb484@xen.org>
 <02cc1edb-1f69-7fd3-a057-e5b04d2e14f4@arm.com>
 <d2c0d251-8b10-c211-48ee-ce547aacbe91@xen.org>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <d2c0d251-8b10-c211-48ee-ce547aacbe91@xen.org>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	AM7EUR03FT030:EE_|AS4PR08MB7478:EE_|DBAEUR03FT057:EE_|GV1PR08MB8108:EE_
X-MS-Office365-Filtering-Correlation-Id: 074875fd-2b97-45ca-5913-08db7df3ca4a
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 wpiSaj5kKMvyKynLKYMIIRebnqJVaYpP4UJfsM2cTGJSTwngiEV5gHsyOsf7D50dmT1W1LOVAYOTxiREuLhAyFipTCW5cQry5tFbudb5Q2qLlVIu9x16QRVlfWm+LNkrx9CfFdof0XBpQk2M/h1tiD/QrH+Ieb+GjyxH3v/o3AvqQj7sCu5cgVBUIy0dNgH1kQj7A4QkX7Pom7GZWyEcdq+HQb2mgbbyEd3Nb4jQHAQ11EcwyeK20gMtfk4nyuVAuAJjM25A/WS5kYG6khqLHqqJfoCm72FIG9y54NEosc0r0KjfjSNRdurj3zt1rtPZjv4sAW/Z+huwB492ZwEI2/iV3Ogg/yCCAlqc1LjL17ya1Z8JW3teSUKjAtdBz6dMyxEnaLHXOwFiEp6BmTOluaH9/CtACPo/YmZFsKK5At1nMH8FBj7QRkOiqxZ1mjB9If3PgiDESdMWlU8q2nws+/asoos97IdxGr6OpB2L0dwZLTJBiSdWCg6GeeGAixcHYzGY7yqipkuwaQf3rcKWRhxoHkHpJzoe53UhOE+qcOFHsRPQ0k37AyV+oCIac+WCPN+rkx9XCpEIMp09klyK2uo6BtO0H+8lKaeE1X+GCx45z9CTIXP09BJNx/eoPSj9RQdPWZUB+qXuB/XSuSXQ13QTdxuQT7mxifGzy0WFpJn0Dv12VT65OVvzIypvgwG6OuXcgSk8JD4oCAxN9g91fuK2Ag1ADCfyk36MrxrzOxYRJYZJQ3sFPulGDuXdexS19FGconfnDqGgoIKP6AXEYfKegnzZcggBKzST8D7/8er8FvVjep6GUb0oOg6BZv+4Qg74cva0X4DlMrl430l6qA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(136003)(396003)(39860400002)(451199021)(40470700004)(46966006)(36840700001)(110136005)(54906003)(478600001)(70586007)(16576012)(53546011)(186003)(36860700001)(2906002)(82310400005)(70206006)(316002)(8936002)(41300700001)(40460700003)(44832011)(5660300002)(8676002)(4326008)(81166007)(356005)(82740400003)(86362001)(83380400001)(31696002)(36756003)(47076005)(336012)(26005)(426003)(40480700001)(2616005)(31686004)(3940600001)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7478
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT057.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	d3debaae-a755-4468-2f62-08db7df3c46b
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	NPcccinOpQVNcO4Hlpb/vt+3ncVtEDnhXB+XzIieElh4NR5dpYvkL3Ze+Y0+w7dPe7Vxp9rxkB7eDwgOgpVRwktI6KBgzcAaODMSyFWJ0GpOwpxNSnXo4b0l6WLeqyleojHKgLeMGj/nTu2NNCXOCkeIAZ5WUnfrVeHosUmYHOTGRVXlNN9xpKCv3a/BzuwryFjRQS8XjUMY2iPaFEiFQDJpZKh0qdY2opD1g2JOeP6nWg/E5JE90VEv1nj0Z2jZJSHE3i6DL8vawdcsarshQDp7pX1vejAjW/TTQNBUW3xeagjZCbjPaHm7fGikszJWFGufaBboclrPiO4j5aAvINcXekUFuZPjdYHdc+JIQQMIc0yKrfrntIp8mfO5pQs76NhcZMnNlTm1Vlesadtctrq2MBvMpBfrKfIgiRsBGhKKck81ttRMG1NWwaDkfUru8YIHO53WA2tiYyYbyqpVlYMXvBQDG/mvu5LxxhYDtucothzh2AuR4wkOBVSxvGHoM1hHxIDnkWZKBaCkjfia+xLnunwmtjQqsNHFOfmeagIKF3cR26mcPoHD6OvD0xa5UtXr1qz7eJ7z9UXnYObz049EJO+dgOhvXhPHzRLQekZ1w6MZMxhx7EoThKyNwnszy6dTH1aCo8DXxW0myoz4gnI2e4r536sTSGePeFo9WKgELNklvTw2jwS2Z7oOF7yirfA6rC8lwWG5ocXqQxIiH08mC97QKZjQdkW1nwUtXqNjDaYLFTHWW+zugCmHzqYOWU3ndO3xKPEljTzhOOlascfSXAg132YZzSBJyIEYHbiDXKiebSJFfCR3vidZ/Oev
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(396003)(346002)(376002)(451199021)(36840700001)(40470700004)(46966006)(82310400005)(81166007)(82740400003)(40480700001)(36756003)(40460700003)(31696002)(86362001)(478600001)(426003)(186003)(53546011)(107886003)(26005)(8676002)(8936002)(44832011)(5660300002)(16576012)(54906003)(110136005)(31686004)(41300700001)(70586007)(70206006)(4326008)(2906002)(316002)(36860700001)(336012)(2616005)(47076005)(83380400001)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 07:37:02.7295
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 074875fd-2b97-45ca-5913-08db7df3ca4a
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT057.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8108

Hi Julien

On 2023/7/5 18:30, Julien Grall wrote:
> Hi Penny,
> 
> On 05/07/2023 07:51, Penny Zheng wrote:
>> On 2023/7/5 05:54, Julien Grall wrote:
>>> Hi Penny,
>>>
>>> On 26/06/2023 04:34, Penny Zheng wrote:
>>>> From: Wei Chen <wei.chen@arm.com>
>>>>
>>>> Xen defines some global configuration macros for Arm in config.h.
>>>> We still want to use it for MMU systems, but there are some address
>>>
>>> Did you mean MPU?
>>>
>>
>> yes, typo
>>
>>>> layout related definitions that are defined for MMU systems only.
>>>> These definitions could not be used by MPU systems, but adding
>>>> ifdefery with CONFIG_HAS_MPU to gate these definitions will result
>>>> in a messy and hard-to-read/maintain code.
>>>>
>>>> So we keep some common definitions still in config.h, but move MMU
>>>> related definitions to a new file - mmu/layout.h to avoid spreading
>>>> "#ifdef" everywhere.
>>>
>>> Just to ease the review, can you add some details which one are 
>>> considered common?
>>>
>>
>> Sure,
>> IMOï¼Œ the only part left in common is as follows:
>> ```
>> #ifdef CONFIG_ARM_64
>>
>> #define FRAMETABLE_SIZEÂ Â Â Â Â Â Â  GB(32)
>> #define FRAMETABLE_NRÂ Â Â Â Â Â Â Â Â  (FRAMETABLE_SIZE / sizeof(*frame_table))
>>
>> #endif
>> ```
> 
> Hmmm... Looking at the result of the patch, you moved FRAMETABLE_SIZE 
> and FRAMETABLE_NR in layout.h. Also, I can't find any layout specific 
> define in config.h. So I think the paragraph could be dropped.
> 

That's because I define this same snippet in both mmu/layout.h and
mpu/layout.h, see [PATCH v3 23/52] xen/arm: create mpu/layout.h for MPU 
related address definitions.
So it is common for both mmu/layout.h and mpu/layout.h.
We could leave it later for discussion.

>> I couldn't figure a proper way to remove the limit for MPU system.
>>
>> when calculating variable "pdx_group_valid", which is defined as
>> ```
>> unsigned long __read_mostly pdx_group_valid[BITS_TO_LONGS(
>> Â Â Â Â  (FRAMETABLE_NR + PDX_GROUP_COUNT - 1)/PDX_GROUP_COUNT)] = {[0] = 1}
>> '''
>>
>> It relies on FRAMETABLE_NR to limit array length. If we are trying to
>> get rid of the limit for the MPU, it may bring a lot of changes in pdx 
>> common codes, like, variable "pdx_group_valid" needs to be allocated 
>> in runtime, according actual frametable size, at least for MPU case.
> 
> The main problem is that, at least on Arm, the PDX is initialized before 
> you can allocate any memory. You should be able to re-order the code so 
> we populate the boot allocator first.
> 
> But I don't think this is worth it right now as, if I am not mistaken, 
> the pdx_group_valid is only 256 bytes on Arm64.
> 
> Cheers,
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 07:43:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 07:43:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559685.874915 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJeQ-0007zc-Ro; Thu, 06 Jul 2023 07:43:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559685.874915; Thu, 06 Jul 2023 07:43:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJeQ-0007zV-Od; Thu, 06 Jul 2023 07:43:42 +0000
Received: by outflank-mailman (input) for mailman id 559685;
 Thu, 06 Jul 2023 07:43:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHJeO-0007zP-Kx
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 07:43:40 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on2062f.outbound.protection.outlook.com
 [2a01:111:f400:fe12::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d240bf78-1bd0-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 09:43:39 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM8PR04MB7746.eurprd04.prod.outlook.com (2603:10a6:20b:235::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 07:43:37 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 07:43:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d240bf78-1bd0-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=HBmKOHxTC4J+rH/cU6LYHYQayG9GYzhIfkYkJ8tHQi4W8++a8BbdmjSCecijSq94gYuZYGQY557dH9XqTM2tzP1Y8824kZOWVyAr86cMibqiyYD7kaX33pxDYqqIxJuiMQ+ja864egUd5OR9fnzT1TIF02wURX/y/EYHAMAhQvFh1Y5LZJETbTlOZ3DbFyEwRpGytU8Ymk0CN5MuQ/oHFAiee8AbwxZT+IEHANd/iM5YFN3i+gTU9ivmfhFL3OgN4MAIOUxYLC07QzIjw1D6pPBajBqnUeeUzouw0zfjMlfNlDfQcbXyeiHjrDVpUtT7CLMWt8iw68ezLWEJFqOPxQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=VuKre1ml5J9+q2ccCSZj/nPbIAuvM31TeYDtCVeOiJs=;
 b=R4jD3rTg+5H+VMKH6tnJUBPTJxV0YnXQo2joCFQYOVyGrmMowGOczBGvw7PX0SjQPO+VXDM+VOcwciplv3UAjcpiZvv4OP2hp3Ktk94nMSi6csuntPEqakmk3t1QOySjZ3fDSh1RN9QhiLTksVne7xg3udpvfqU3wRBMd2bL16yH1KdqWFZVW9xoaLTpxUSs0nROQhwRHJZrlXcdV3pBN9wEt0P/+wf3WZfkcmHoX7SraXlFepfQ0gY9FTqAtuROi4eA3dzJru9JtxqVA4Aj1Ys94wER+FbOhwFXhXN38PL//EC3YYwDVa0Bhtaq5bLWxtL7hQNvQFJjKxjv+Zg2iw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=VuKre1ml5J9+q2ccCSZj/nPbIAuvM31TeYDtCVeOiJs=;
 b=0ShykCoMkzbd8xg7HHXAShbCsIRP9KG3GikC+Eu6lYviG47Nz7Cmn/SEIxFYohOyzNa4niC8kZFAIcEcBMjCezyFm3D1vrjr3pzMiUScuIzVO40wpWzPspz/27nQYFKpHGqcPBKS/idAlFWMj61pGxb3vWN2fmSfIo482oYkMAc5dOnvwjlpE0iH3ImYP2IdmyA1ae+NYtJKRMDPYFgaGeWmjmBs+rspOGyC0iI7mqrSKQqnaVSf72MDj4CBhrSaEig+NxeS5CMxasKpjeDjHVHfAhyh7zotfROMyJUmzYs1OdoOQ1TcZUplHjrBpnoZqD1r2xu2vS+rLTUHADplug==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <a55021d5-39d9-a928-4b82-6bc6a02b42ef@suse.com>
Date: Thu, 6 Jul 2023 09:43:24 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 09/13] xen/public: fix violations of MISRA C:2012
 Rule 7.2
Content-Language: en-US
To: Juergen Gross <jgross@suse.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 xen-devel@lists.xenproject.org, Simone Ballarin <simone.ballarin@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <9e0d463e2fc09193a742fc7a64a331855705a4fb.1688559115.git.gianluca.luparini@bugseng.com>
 <290e4dbf-c9c9-49c9-29ea-6fc9b9a5a4fc@suse.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <290e4dbf-c9c9-49c9-29ea-6fc9b9a5a4fc@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: CP7P275CA0003.ZAFP275.PROD.OUTLOOK.COM
 (2603:1086:100:42::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM8PR04MB7746:EE_
X-MS-Office365-Filtering-Correlation-Id: 1b89560f-93aa-420e-b72a-08db7df4b50a
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	/axOjy3p74EGbkiVdhj8Yq7kFE2pSkjl41BcXPd99JshWdQ6hHl/Y5Vp5Nn+ce0XJWDUK75SD+0kBksQwvq6MCou8qdNEfjYU1ERbuiuHFiOYewTAjZF8ZTxQnUIoVaCBnmxaUH2DbPh/DWDaFBACKXhtgPXJLTP2Qe788zozhM6bk1cJk8GJ0y6ieZtDvWdnwkKS/iLQndRYB2On+xfLllV8ePr/MzD2F5xToueik2qbbu8rj9FyV/beXZ/68VS6Nr9fwdxLxV5oe4IYGp1ZrcwtNXPtxSs6axrp1n7v8Jeh/2wnpkSFUm+yyTn01L40ZxjXZdWWTb5EHVL1NUpCyRElHKoVynZKNfXwVfwTscxN4mt2h84EI9/w7Dixo1a6Ojv2UprV4KkWLD2XvdzOxc5yI3j5V8hW/uU/lZgjww7Lhsv3qmGK/FyxVStmz37mwO+RfLi8GCqqsgjtmjlOFcxwY4sYq5iaPlZ1ovklEGQK9ZQ0OhmAsxl7g5Nzh9ouMVj333pAdI2gZCrBdhQgXGzsT/QjqS9JjyZWDwSNztCmB1ZsXeCXgVpgj5INQX5ng5YG9qs3iAdpn9sjNtOOh435HkeMobIyrGWr0Iuh2y7EBO9ESaSOztVb0hP19iRH5hsIhPOtkZYMw4hBgmaGA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(39860400002)(396003)(366004)(136003)(451199021)(31686004)(8936002)(6862004)(8676002)(5660300002)(41300700001)(83380400001)(316002)(2906002)(2616005)(66946007)(38100700002)(4326008)(66556008)(66476007)(86362001)(186003)(37006003)(6636002)(54906003)(53546011)(26005)(478600001)(6506007)(31696002)(6486002)(36756003)(6512007)(6666004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?R2ZBNVlQTm54Rm5UZklz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UWRQYWpwckV4aWw1SWozc01ua3ltWXZsc0RTbkpYZkhiME1GM3lkVVVy?=
 =?utf-8?B?alh0N2FCajlncVRpd1VFSDVmN29ORy9HY1JZUmxVYkdpV29QN1F5OVJhcTBB?=
 =?utf-8?B?R1Z3RGtkN0hkQi9hbkV4RHlIWURkbjVDczJhVWd4NUZudzA2Y0h5S0hXeXRM?=
 =?utf-8?B?dTh4d0RZcC9jckdKaDhwUno3NXIxaFBqV0t6eGY3QW82UmE5QVhSaHR3Mndw?=
 =?utf-8?B?THVzL1hjVW93ampIWDI3R3drWDJmNU1UTU5wWHZ6dkJ0cStsVXVwRUd6clRO?=
 =?utf-8?B?VnJNQTFMcUZ1eTZWQ05hNFNQSDlOdXFxVGIzUWJpVjhRVGJGenBxMSt4S20x?=
 =?utf-8?Q?8QL86tCUf8EF+ZCGK6nYOLOGG?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1b89560f-93aa-420e-b72a-08db7df4b50a
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 07:43:36.9575
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 6sMpWiJNIpc9il3tATwW6vWauSxhvhmkzfKMqCll2/Sa3gG+ZXLbkWVBQqZ047BgXToecH+PY1/X/SuElYNiTg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7746

On 05.07.2023 17:33, Juergen Gross wrote:
> On 05.07.23 17:26, Simone Ballarin wrote:
>> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
>>
>> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
>> headline states:
>> "A 'u' or 'U' suffix shall be applied to all integer constants
>> that are represented in an unsigned type".
>>
>> Add the 'U' suffix to integers literals with unsigned type and also to other
>> literals used in the same contexts or near violations, when their positive
>> nature is immediately clear. The latter changes are done for the sake of
>> uniformity.
>>
>> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
>> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
>> ---
>> Changes in v2:
>> - minor change to commit title
>> - change commit message
>> - correct macros code style
>> ---
>>   xen/include/public/io/ring.h | 10 +++++-----
>>   1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/xen/include/public/io/ring.h b/xen/include/public/io/ring.h
>> index 025939278b..0cae4367be 100644
>> --- a/xen/include/public/io/ring.h
>> +++ b/xen/include/public/io/ring.h
>> @@ -36,11 +36,11 @@
>>   typedef unsigned int RING_IDX;
>>   
>>   /* Round a 32-bit unsigned constant down to the nearest power of two. */
>> -#define __RD2(_x)  (((_x) & 0x00000002) ? 0x2                  : ((_x) & 0x1))
>> -#define __RD4(_x)  (((_x) & 0x0000000c) ? __RD2((_x)>>2)<<2    : __RD2(_x))
>> -#define __RD8(_x)  (((_x) & 0x000000f0) ? __RD4((_x)>>4)<<4    : __RD4(_x))
>> -#define __RD16(_x) (((_x) & 0x0000ff00) ? __RD8((_x)>>8)<<8    : __RD8(_x))
>> -#define __RD32(_x) (((_x) & 0xffff0000) ? __RD16((_x)>>16)<<16 : __RD16(_x))
>> +#define __RD2(x)  (((x) & 0x00000002U) ? 0x2                     : ((x) & 0x1))
> 
> Shouldn't this be rather:
> 
> +#define __RD2(x)  (((x) & 0x00000002U) ? 0x2U                   : ((x) & 0x1U))

I don't think it matters much (as the comment says, the input is expected
to be unsigned anyway), and I expect even the one U that was added here
was only added for consistency. The sole one that really matter is imo ...

>> +#define __RD4(x)  (((x) & 0x0000000cU) ? __RD2((x) >> 2) << 2    : __RD2(x))
>> +#define __RD8(x)  (((x) & 0x000000f0U) ? __RD4((x) >> 4) << 4    : __RD4(x))
>> +#define __RD16(x) (((x) & 0x0000ff00U) ? __RD8((x) >> 8) << 8    : __RD8(x))
>> +#define __RD32(x) (((x) & 0xffff0000U) ? __RD16((x) >> 16) << 16 : __RD16(x))

... this single one.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 07:44:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 07:44:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559689.874924 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJfT-0008Vj-57; Thu, 06 Jul 2023 07:44:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559689.874924; Thu, 06 Jul 2023 07:44:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJfT-0008Vc-2B; Thu, 06 Jul 2023 07:44:47 +0000
Received: by outflank-mailman (input) for mailman id 559689;
 Thu, 06 Jul 2023 07:44:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHJfS-0008VU-I7
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 07:44:46 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on0630.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::630])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f9bea118-1bd0-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 09:44:45 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DUZPR04MB9872.eurprd04.prod.outlook.com (2603:10a6:10:4dc::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 07:44:43 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 07:44:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f9bea118-1bd0-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KzYgK0RWFwHgfK3UEKHQmkzk0s6y1NyPn8To0ukvFO7cRNtX2ucJlUbidMsKw1YU6iY/uBVJjVCM6Pp2DYTFA6G5aGUMYIEcIvTOXv0TgoD0immQINRN2IMxm9fPsy6nM5m5zTJLzIgqGw6WZ7wk5gWFrqBO9mfCaR2cia3p5PD4OkJBQBW/n1TuI9sVpz0lUnnrERpdi+Z+lDlcXohWIFX85fE6CNJgpbRMf1REE1YZcdREAZfq0BALp7+XSYe66Edrsf3DPR+roHEsFtkWMCpaHYSj9VoLYuaASGnXjKtyjQmMZS+ESTdCeOHLFTsV3XnX5WMkuWsVoc4QiI85hg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=1yXmY6+CsqTU3qyr4W0Ux2LYOOUkhbvGRdVHPpU1xQo=;
 b=jjUIgKrQbRNWLxHVfpDCuPGezeys1lbaI0bxJEQPrTbqXGiUi4VbpDXaUmw+3xaPZ4KBLkTdt8V6OD7yNPOlxPx44xKPs5oV5tALo3Rgl8RZKDXmsMVvSJpZv7jVr0bUuNHaFu52fY3yXQkx/llzFLhIdF56bc6tsRskjUCKp3mkxlY+Lv2JE1mQjmEjwAkrbkA+gc/p+S1UxzPYt6rOEMqi0jcODi7fK+MHYAD7KchXdL66R2Ury3b37zjw4llNit9YCKBDpL5vL23kzxvPrk3LXwfHKd86C3Y3k5MZwUxptJPX/3Dmph7NRL03GI/m5W5hl6qmCPsw8RLePW/yzA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=1yXmY6+CsqTU3qyr4W0Ux2LYOOUkhbvGRdVHPpU1xQo=;
 b=A0tJhzLazO7iQpt8YKQmUk3HoskTqINpM+qCRbGZsAZsXS8RmBSyHedmLbivtjqXOJlda2w+NDtJ1dSHdLszGUVaq7uWfQwwcBCyKT2kjyfmPaBbyVgcD8oozwIHRDD3+py3A5ZjrTY9a378GyJnaDQh/s89tjbAzJKzZzNoMRMhAK3LJyGamFhRkuyAL3I5ifKxuqdyrQoI2H8c2HTz+VEepCh2RhBLlI6ybA5mQNveZ9OZsfrRpku7bvJnm5TJX8oDzpcv/c5CKm0AmURwQiuytv1igqp6EX4rvq/78CuEfJ/uwZWqP+BtN0hyL3oFMnMzraj63YD82sgQjWwyUQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <a7bcb8cc-2353-0a35-fe33-0339c25d6002@suse.com>
Date: Thu, 6 Jul 2023 09:44:41 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 01/13] x86/cpufreq: fix violations of MISRA C:2012
 Rule 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
 Gianluca Luparini <gianluca.luparini@bugseng.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <7df9377d4cb218dd54646c2cb1b70327c8b44c96.1688559115.git.gianluca.luparini@bugseng.com>
 <alpine.DEB.2.22.394.2307051628500.761183@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307051628500.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0092.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a9::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DUZPR04MB9872:EE_
X-MS-Office365-Filtering-Correlation-Id: 96758612-0c30-4952-1b8a-08db7df4dcd2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	e9V/RF38RgqJRnuZB9bRuMx85VhK+etWSctYZBoNBqwoN70+/srztZ8HeHesywQcqKGpN4LbKzn42IH9JC2tQnjqcupzay1AQRn86c86thtu0qWrosviuRItoKiopK52eDWf4wmAjyW4SOdRn5oRIQWnjtg2OBlORia8UyTUk1AnCkq9DGHX2AGWOWacWpDfXviIfkXkhKfGmLm4kY41WS1dDGpMMmqoSWFrsvmcU4lYFexwHQ1sipCOoHcYgWs89Vr0OW2e+Yxi7IJzIoCTr4q2A1VgOwgHqVk+BErd9/Gp1qaCMdFvcXkSellUfeQ/Fqvj/0CyIu9AnBLqLEQr7ioZAq4sTyrg0GRcxgCNI020JTGX3FPF9E6dE/pSXSq2h7SSpxyi9Mm2RDigYMw6uo2d8ID1KMe/Eq7Z6Dex59XZf16fnVbcxnDcENCU10NLco4lmn9XT9dIcyReFnNyqR/jkdxiIfIl4A8Mo8geNcUYViPkLhsw4YRlBfzWJvkCj+8siSK7jZcJ1wkjR1osi1aei4I6KMMqmfvXnmekHCFl0VPHi6jyfB5iLQP4ofQQ7GfkqRo1f4p7MKAKBFRuvd44W5a55Mbh27RCgXO8zsBSo4dy0nZLR+bFMrnG9b/2P8cyoJH1+n492i5BimiqqQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(346002)(39860400002)(136003)(396003)(451199021)(4744005)(41300700001)(2906002)(5660300002)(7416002)(8676002)(8936002)(36756003)(31696002)(86362001)(31686004)(2616005)(478600001)(66476007)(54906003)(53546011)(26005)(6506007)(6512007)(186003)(6916009)(4326008)(66946007)(66556008)(83380400001)(316002)(6486002)(38100700002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YkZNL1N6M3BUNWVIekZDQ0UvKzMzbWZIaEtubk85OER4emYyVmFKc3hDUUc1?=
 =?utf-8?B?Z0owM09vSmkzbEVVKy84cmtDejVWSzJrem04aFNOVE8vRVl5YXk4ZXM0c0NH?=
 =?utf-8?B?elBUYWJjUGFTUmhLRTloSnRPVUExdUwrNklpSm1WVzlBMFJ0b1BNU0J6NWxF?=
 =?utf-8?B?RlVtVU5kQWMwazI1VHVkUi9pT0VwM0U4QTUybDFEZ3dNWVM2VCs0VE9nSDcx?=
 =?utf-8?B?cGxiTksxc1lua3AweUZOUXgvL0Z4WlRocDFuVThQRXhTN3ZGTDUwOGlqeFNO?=
 =?utf-8?B?c2ZhM3ZDTm9OU08xN3h1MXJhZEI0Rzl5M0twcThFVTZnK2FVTjdyZlNjdnli?=
 =?utf-8?B?bUljVzZ0R3F1cXdMSFNSaHpLbjF3UEJJYkVCYmxHdHpzMWFqb040L3BJUHp5?=
 =?utf-8?B?TTd0a0M5MXJaRnMxa0R6aHBjU21zREVXMXZMaURHalJzSHRQM1llajZhWThX?=
 =?utf-8?B?M29VL2Y2ZWJ0ZGJWN1RMVTl1dGNhWGF2Vjltb3QxTFh1N1VkREMzRVFxVTBs?=
 =?utf-8?B?QWxCZzFlMzB3R2ZUK2hxVnVmdTJWT2NSMDRMRGhUQ0Y5MmZMQS9MOUszTk5t?=
 =?utf-8?B?Ti9rS0pLSmxoUXkzaGN6TkY3a1F6UFJjZ1dZMEl3STBNTFA4UWQyQXFLQ28r?=
 =?utf-8?B?eTBiUmhnUGVkNkQ2VXcyK29iWnE4cU5aRVBCWWNKZElRTnQrT21QUUNRRmNH?=
 =?utf-8?B?bGdMS2VzTlIxOWNLQnE2R29VO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WS9wRnlRdCtP?=
 =?utf-8?B?Y1MzZm9LVkw4eFQzdXZxQ3NEejZrdWlTOTA3eW1CT3FwanZGTndYTHVnb09L?=
 =?utf-8?B?bWY4QmJCVWVLMU9SQ1pRdys2SjRNcXNQWCtyTTloaFlGN3B3M1d0OG5KMmdC?=
 =?utf-8?B?SlF6YzROcjJ0ejkyckxKSnovakp4Sm5UMWJtQXJveFJESGhISmc5NlNnd0Vt?=
 =?utf-8?B?K3lXeXBmM3J6N2J5eTg4STR0czg2T3laMmhIbWUxdk81aHNzeWZGVjZOcVRn?=
 =?utf-8?B?QkpYamlXRkd0dURhY01aUVl5L0I2bFBBZWk1bWJ0c0pOcXlnMUdJVWthS3hT?=
 =?utf-8?B?ZXVKWi9yMGw0RDB2VFE0TFFEeVRTcXpaM3gvMmhBQ2hEN3l1ZGJxS1FwUkZ6?=
 =?utf-8?B?UkJpL0NXMi9IUDBmU29hQmJmSFRvNm9XaW83OFArTGlSKzZwaWtWQ2tNSUUz?=
 =?utf-8?B?bFV6R0Q2ZmZMRXMxdmIvR2EzUzdud2pIWnVFNy8vNTN4dzZoUnozNGNRMVZ4?=
 =?utf-8?Q?kRPyDoSJXj/BwPZB6AR6vJU72?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 96758612-0c30-4952-1b8a-08db7df4dcd2
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 07:44:43.5392
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Xu1aLpzeSpZG5//3X+Mjc4PeaCBZj/B3sZugG53/zAu+wD+fNlVZeIp9vM8Bf0eb676C27y+JCb+tKrY4IHqhA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DUZPR04MB9872

On 06.07.2023 01:29, Stefano Stabellini wrote:
> On Wed, 5 Jul 2023, Simone Ballarin wrote:
>> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
>>
>> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
>> headline states:
>> "A 'u' or 'U' suffix shall be applied to all integer constants
>> that are represented in an unsigned type".
>>
>> Add the 'U' suffix to integers literals with unsigned type and also to other
>> literals used in the same contexts or near violations, when their positive
>> nature is immediately clear. The latter changes are done for the sake of
>> uniformity.
>>
>> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
>> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Thu Jul 06 07:49:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 07:49:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559695.874935 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJk0-0000oS-QS; Thu, 06 Jul 2023 07:49:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559695.874935; Thu, 06 Jul 2023 07:49:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJk0-0000oL-NK; Thu, 06 Jul 2023 07:49:28 +0000
Received: by outflank-mailman (input) for mailman id 559695;
 Thu, 06 Jul 2023 07:49:27 +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 <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHJjz-0000oF-TE
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 07:49:27 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2085.outbound.protection.outlook.com [40.107.7.85])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a0d4e343-1bd1-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 09:49:26 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM8PR04MB7761.eurprd04.prod.outlook.com (2603:10a6:20b:248::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 07:48:56 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 07:48:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a0d4e343-1bd1-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Kb1VehfciubqLxxr5UXSKQiDCDKd1N6+vS2KBo9EdRrKFkLM/yb9TuOJ/EgaGjRUoa1HyNWEymKc/ItnNkfQlOCAX/Vmkura7x080btmSb7QCPA3KX8VvT6tUEIs7YyHsuC0gQEcd/WIu5Ahl/0NXrvAkWwbuNCWdzavOYZka+zJsASrSeIfqVci3RGaGFMSCvBbBe7odsglOeg+DJIL5aGzkT7lZXna79doxSdxby5Dk7i9EY3aqL1Z4qFhuV8kYqccKCcn9Tr4+YaALF2R9shsnzAdpvoR64v6P6Qks9i9oHBCj3OFDWMM+n4pSCLuWiuGsHgynF2zw5y5D0Y/bA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=L5G9+VngUfCmzdWJ5fpaE2QOiiNZvSwpvjPVIrTbYIw=;
 b=WEYgepiMU+e9FVF8cIuSYnuag/kJvIRBn5fqRX034aacyv+H2VmZ4Rdf33t9VHlspF1M6/TDlpIVm+0bPsGO9LlnU7K6k5AEcOPL/jJmBtT9Ba0rsCmRxMbXxPWq7x8CSvA3jDgesfNEbmsArhh9kOQpLaitXbzptMuLF/ElIpvCR63vyNLNTYl9eMXI5csb/Qp/pyIYi/Tcg1MNMehlZXoBvibcOOaAKv62WTHBtjjLA8c5NkgM6wy4eCj/5u2XI6l3dj2dOisHaob8UrVyuoHPxA8MJYiOyoi0fJTWjBOLtNuqm9FHaTxDx3TOtPHyjR7MFRev2XyAd1/wZmmx/A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=L5G9+VngUfCmzdWJ5fpaE2QOiiNZvSwpvjPVIrTbYIw=;
 b=a3vWlo6t2+tegGbMd6wc/T++c3OFfwmkqvLjbtv1Nn355DEN06wVs/9abwZ9NiXWAyxaA1T7egte2a0rTeHoZC8YfMUzoiRwuYXqE2g4++DIx4UMgFm0eCfVbVcWo5G2oLXQiI9oNjlYOpXUPZELtsP+WN5jZzRZAHwP75XYl6nu5lveI9K9rF5UG8dzyJYFN+K+Ov/HXjeqMCzIkn+takJP9ASGB/ZM5s5iwxZSIvuz1X/Fw3ZhZtwGJJ2DiCUa4MwreClMIJFPilKb5jNfIal3tz0ZmCEybpVDWfbEvWunWVndlW/wv7NIMhN4bDKLYFFnm6a84M7/IzaZtvf7Xg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e2cb36ff-8908-662d-1bc5-6ee0659c7904@suse.com>
Date: Thu, 6 Jul 2023 09:48:54 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 02/13] AMD/IOMMU: fix violations of MISRA C:2012
 Rule 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
 Gianluca Luparini <gianluca.luparini@bugseng.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <89ec1b24e6da5738c00155f6f142cb99385fb838.1688559115.git.gianluca.luparini@bugseng.com>
 <alpine.DEB.2.22.394.2307051630480.761183@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307051630480.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0090.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9b::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM8PR04MB7761:EE_
X-MS-Office365-Filtering-Correlation-Id: 002533f0-8144-409c-4ca8-08db7df5739a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	r4ZuU2YjbSAiNsxA8V4oNhnHdssjqa0ShMkJNiyWtTi7ZoU8cWJcBUVanKKkPmcv1kVFAJ9a0LlludEgZuZFIKv0MyP2IMk8caffSZ5MZgmNB0qsQ355QIqXPFbB9bJtaUOz05Tw5Z343rV3gJuAr1dplmj1BdnMHoeZwgbz/Yj5/nUEqd0pioiOthzCdruqTTbKmEWhFSVHWICVVEWrV3+5zkyKVmwRm8LoGWgX/gNnPnhvyrtU4FKjDp2+zJf72CdZIdw0AtdPAovFkN/NecBbTB43QIl3bP+MDSxeiqwut1s8oRaqwPOElZ8cjR29wIFSdnlHpNLcxbaiAiB0q48+RWH3F71ltm4vmnMxGFTLXVrOMjFOqz19rznsfjmOUHcs92/xR6QjVVWbo4VNO8n4Tzy9x/UOTQQ1BQ94BrpBU2pRJ1ImjxPiDqpjxlfk4da8cUxoRDH7yC+WEg0e25joNxoIG01ONobt/juKE8B4H91dGu5DL26XfxnLewxxRiZGgr+oo3j+X8Cr8OohhE1Vlj6WLD2KNj/p00A6/+gXk5X8igztIBSFnSod+hTt/wYyrGbfyqInbOwxbbDENZ90rjdNgjAuePzCoUEwiMSioDYRl1+c+ARqkfoqkVMLwOxEkCzTpKdCXF1IjkfqMw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(39860400002)(396003)(346002)(366004)(376002)(451199021)(31686004)(54906003)(41300700001)(6486002)(8676002)(8936002)(2906002)(316002)(5660300002)(66476007)(66946007)(6916009)(4326008)(66556008)(36756003)(6512007)(86362001)(38100700002)(31696002)(186003)(478600001)(2616005)(26005)(83380400001)(6506007)(53546011)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YUIxVEhpNS84eGxsRzJEUWZxQUJCYitZbFlZdFZKdEpva3hiampPVjI2RWZW?=
 =?utf-8?B?czk2enNhS0lvdWhta2YwY3BpZlVYdlkyYjloajRxeWRoNitpa0pjeVN1S2Z4?=
 =?utf-8?B?elYzcExMM2dOb2tFLzhvWW5GZWJTbllzSUtkSmtUU2JkeDY2TjdNa09FbkZP?=
 =?utf-8?B?MVg4VklXMXdqSTdjb3dxZjhsQVBsS1NGZ09PejVaSjN6aVQzVUVocndpVHli?=
 =?utf-8?B?VEs2Q0V1ck1LL040L2hLN3dHRGdxendUcjNNdjRhSVduK3FqNnp2UThBTmhZ?=
 =?utf-8?B?dXM0dHljejRaeVJrOUdQeVhtbHV3MVRTUk55VXFyWE03QmFuNDFwMjNRVzlQ?=
 =?utf-8?B?VWFLaVlTTnJoeSt2N0U0Y3QvZGJoL0lnS2hhd1E2UERXL3phV2VUc3dMV1Y4?=
 =?utf-8?B?ZVpNYXpHYU9zZjA5ZDFHRkkxRVkxT2RMaFMybG5pZGtpcWUvb2JYTTZiUDZr?=
 =?utf-8?B?WGxFVWc3MGZDeEVPNkd2cDJsL2ViODF3UWYybzFocXlnUTIvZDNHQlBDVWY4?=
 =?utf-8?B?VE5KMFdu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VjY1YrZkZiQWZHckNhdjVBL3ErWXFZ?=
 =?utf-8?B?Q296RkIwNnZBcFZhNCt3YjZVbVk3UXl0TTg3QWxQZGFLS0pLNFNhdGZYTGdW?=
 =?utf-8?B?ZXdVZkVDZTU2VzQ5MmdXV0kyYXpxY01WOHBPTzJhQlRTNDJyU3BzczEvSXhX?=
 =?utf-8?B?VjZxY2NQZTZWZlFsb3QyektDUUZWL0kzWm9MMzlPYUxRNUxaa0tPMHJaRWIz?=
 =?utf-8?B?OFJ6OHhQNFcycHNnUDR4RTRvMDhqZFlUWnRNdzFCRDVFNzNWRnFibUl4eERr?=
 =?utf-8?B?MXlmK3J2emVGWEFIaDRGOVF1NjBhSUMxYmErVm85clBLaWQ0bUMyNDE1bTRQ?=
 =?utf-8?B?eGl3Y0hlT3E3Mmg5ckIyd1Fxa21IbkxMbkdUS3hUQzY1QjJ5QW9RYTh5Ylpa?=
 =?utf-8?B?d0RiS0U4aEt4UDNZaVVhbnFQY3FmdE12QTJucE1teWlNbTdsck1EUWtHQkQ0?=
 =?utf-8?B?WVM1amRKYWdvMHJrZEtFTXRZaFphbVRFTEg2cmZDVHZwSmVkQVRINjV6cmZW?=
 =?utf-8?B?WWpYYk5UZGkzeVJ3VkVjRm40VzRLa0NVS1RhMFpPZzlLdW9USXlyVGNsMHB2?=
 =?utf-8?B?bVFxREpmV292UWwrUmRJQ2x2VjFoa296OVZ2YjY1OHdXQ3pGajFKa1hxY0Vq?=
 =?utf-8?B?SFFMZjlEcENsbGZqelZtczlITHFaU1ZxOUhIaExMVEd5UmVQZkRYRzI3eHNF?=
 =?utf-8?Q?WQ6XLnQeoJyvtI3UIlfyPkSXp?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 002533f0-8144-409c-4ca8-08db7df5739a
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 07:48:56.3987
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: bH6ZYuYCuJleRtxx+ugjsP5j+9CSr8Rdd7j1wulFIh6T28PU4dzhiGuegC9s0F+AEuJU/Inw8ZJ+4ZtjWZFEEw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7761

On 06.07.2023 01:31, Stefano Stabellini wrote:
> On Wed, 5 Jul 2023, Simone Ballarin wrote:
>> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
>>
>> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
>> headline states:
>> "A 'u' or 'U' suffix shall be applied to all integer constants
>> that are represented in an unsigned type".
>>
>> Add the 'U' suffix to integers literals with unsigned type and also to other
>> literals used in the same contexts or near violations, when their positive
>> nature is immediately clear. The latter changes are done for the sake of
>> uniformity.
>>
>> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
>> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
>> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
> 
> I reviewed this again and I also the tag should be Reviewed-by (sorry it
> was my mistake last time):
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Thu Jul 06 07:52:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 07:52:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559699.874945 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJn6-0002EB-82; Thu, 06 Jul 2023 07:52:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559699.874945; Thu, 06 Jul 2023 07:52:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJn6-0002E4-4e; Thu, 06 Jul 2023 07:52:40 +0000
Received: by outflank-mailman (input) for mailman id 559699;
 Thu, 06 Jul 2023 07:52:38 +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 <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHJn4-0002Di-KY
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 07:52:38 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on062d.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::62d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 127f2fce-1bd2-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 09:52:36 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM0PR04MB6769.eurprd04.prod.outlook.com (2603:10a6:208:17f::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 07:52:34 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 07:52:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 127f2fce-1bd2-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Lb7+DR0s9cWBhTPuWubiAYthWiHjCzXSzvJJqSG3zhp0//hN1wF0AGYFsoQoFokar9pgYb2sVptIacavr1QlS/Czb0jFJBGohXEn5fCahMGgpRQCcqwh1HFJg4KjAMp6KG+UTX9pjcgTlZt5fsF0WOTo+Z1RduDtynYwC0txQpTq5G6DgQcIvpFEMGXB7hFMf54ilUEGW3XKyzkb2x+Bie0YbwobamnNKzVEBBdGiCW/6xCWRtE6h8jS5ewMtZkYwVRei4h1Q2zKGelNyCfOyKvGSIjDMH1mkaMlgj3w4OhehpBwp96wfSJjK/GVOw+SdCS8WxUQLrqWAwxOxGU8ZQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BNVcBEloDrmt0iivkfMlGV5iUJfAo7HKrQy9dejK0tg=;
 b=X59rieXMTUlz1jPJt93APonCsIIj83+2tUIMu+2Jo0lmFVFB99Rpdo0OfCcpGPkAA4y5U3eS85zktqPAuiA65ynZRSMyb/5Tzq5NN7kX1fdfrp53i8N3aCLum/DHRgPHE9a9nqTrqfGo0UvD8AQ/WQgWbkUGyd0IEVtRa17u898koXSADBFPcjnSm63dbE3wF+bRo1Zo8rV1d5TFBcS2pBCnwsvJFUcVR+Sl053HZH3hTbqdSCq89SwyF9q8xkw5+d9nOzN8E/xRKCaV+iVZBZedfRE9gh2KoBWutwAj0Jc4sZldWPAAeR7gI64rueNQ9VHeCOjAQMMmkHgdCezrxw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BNVcBEloDrmt0iivkfMlGV5iUJfAo7HKrQy9dejK0tg=;
 b=0180pSLdxESxnLdQkHPJGTfn5lBcQ5ZiaV0jkbBQteYfRWBuPx8GygCTo1aFCIjr9WUzlL3GJpxg6phhovrJPkiKN/YNETcJvyKmkGt01bc504P6j9Mo00pzTNEe0sxAbSIuMR0A4C0wEjCd3rilsrKqmj6z2kSMlktgjD6G6fqjmblQ3fIMxz1SF/cecqcacoqUasAPkTJ9noIS4hzlg22PewW4RsCGEkhjqZJw2xO9ZmcV//AHgXYxbbZyrZDadjq2125fKdDsaqZyder5IFfzXqIYzNZ/lhGWmIcWK6QxqqAvF0E2xpRGgwP3AZCE+1w7J0hEGMu45o+44lCJzA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <4818b88b-10d3-b55d-cd6b-e40d1f2995ff@suse.com>
Date: Thu, 6 Jul 2023 09:52:32 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 03/13] x86/svm: fix violations of MISRA C:2012 Rule
 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <015d7c13dc4e1b481abb23a3eaa254e316b7ca53.1688559115.git.gianluca.luparini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <015d7c13dc4e1b481abb23a3eaa254e316b7ca53.1688559115.git.gianluca.luparini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0170.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:99::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM0PR04MB6769:EE_
X-MS-Office365-Filtering-Correlation-Id: c5b1718f-d6a6-4b1c-9e4a-08db7df5f5c9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	rDPrs1Opkqx+I2hsbXCorqiIB2rwFm5MGV1pibYeFjFzNNQcAdWBC68TG4VkDyf+iOn8pgjD3aJglh5aYC2ndhcbEwL7O+8m0yKwXIzKZLwjgRdHdNLo7lYWcB+MMgsoEBbjEE/WTF3QdyWfevWXRjLnQCHIPERW20JxfJphmaz3WZM5EqE8vWsPR4uG09VtNLXKyAg5TD6jR4p8OZXAue9vz0GMccjWv5siADPIAdX0fL6nTFsKLCFwfKHCRGB6p9lm7d0j0KYjalZUOf3esNdVyeh5W4QW18uCp/cxAhOKeQ3EhIOGIFv0GOSuEQBGGbBEFLec33oEOKqGRtoAu1riPQMqapgmj1PCq/MoX6/FGY0vHM/iGglYl0C1g7gvtE70r5vlXg2fWHUYcnWC5oyO+oUaWJU2h+Qg2YVfYkMj2V4bsmiik9jWSba/nAaJRaWBGwsyXGr5kVHIFlowRD7DhxHGQat750i2diOdwdVsBv098/sGZCkOU9Qn2qjGev0Gx/3lzGilRm2H4GQmf0QqFXA/3WaC2p5jHdYsZ4IrjIgQA1uLYrO8/5tTUd0K7YQGtWHwWqw8rZEdWp6EJUEwItFb7loPx0SmY7BDF2isAmyx0GCP31g0hHoqMrWeZXrP4IFQQ7DLQYLDzs0Btw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(39860400002)(396003)(366004)(136003)(451199021)(31686004)(7416002)(8936002)(8676002)(5660300002)(41300700001)(83380400001)(316002)(2906002)(2616005)(66946007)(38100700002)(6916009)(4326008)(66556008)(66476007)(86362001)(186003)(54906003)(53546011)(26005)(478600001)(6506007)(31696002)(6486002)(36756003)(6512007)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TUFRKzJFbHkzNGlQd3JaaEl1TGcrUTlBWjF3c0huK1k1cDJSQzM0OVVNbUVT?=
 =?utf-8?B?S0NJdXQzaVZSa3NESW9MSXBDSys0NUxqWk04dXJHbndVYTNoZ3c2ZHZ0akhv?=
 =?utf-8?B?YU1vWTUxR3lvOGtCZ3VTRE1OWU1ENGV4ek9KV2F4ZU1rNTdKRG5rSlpuNDRv?=
 =?utf-8?B?b2ZsVWxRQmhIWk5JNldHcjFOa1hOYnMyTDMxZnYzVjJJS3pycDJQdEc3V2RL?=
 =?utf-8?B?TFVxc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ky?=
 =?utf-8?B?Q0tYd3FGcTdrT2lZVzIyS29xbmUwTERGQWswQ2FnQzhoUWU2TXk3dXI3eWxN?=
 =?utf-8?B?KzJ0K0xKZFhJdVZzR2ZIenJtWStWUEVVM25EeDdyQ05LUHZzam05NUlsb3hZ?=
 =?utf-8?Q?Y6mpPqTijudKgUbQ2WctPMq3o?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c5b1718f-d6a6-4b1c-9e4a-08db7df5f5c9
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 07:52:34.8642
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 0h4tyjXhLyHRZ2a0i58tTrgYJQx1h9MzMATYWvnTDTCnY2YJZlQfwEdwfaEEof4MAtzHEmaTYOtNSuRHFYbDAA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6769

On 05.07.2023 17:26, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type and also to other
> literals used in the same contexts or near violations, when their positive
> nature is immediately clear. The latter changes are done for the sake of
> uniformity.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Acked-by: Jan Beulich <jbeulich@suse.com>
albeit ...

> --- a/xen/arch/x86/hvm/svm/asid.c
> +++ b/xen/arch/x86/hvm/svm/asid.c
> @@ -16,7 +16,7 @@ void svm_asid_init(const struct cpuinfo_x86 *c)
>  
>      /* Check for erratum #170, and leave ASIDs disabled if it's present. */
>      if ( !cpu_has_amd_erratum(c, AMD_ERRATUM_170) )
> -        nasids = cpuid_ebx(0x8000000A);
> +        nasids = cpuid_ebx(0x8000000AU);

... I guess it would be nice to also change A to a here, to match ...

> --- a/xen/arch/x86/hvm/svm/svm.c
> +++ b/xen/arch/x86/hvm/svm/svm.c
> @@ -269,9 +269,9 @@ svm_msrbit(unsigned long *msr_bitmap, uint32_t msr)
>       */
>      if ( msr <= 0x1fff )
>          msr_bit = msr_bitmap + 0x0000 / BYTES_PER_LONG;
> -    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
> +    else if ( (msr >= 0xc0000000U) && (msr <= 0xc0001fffU) )
>          msr_bit = msr_bitmap + 0x0800 / BYTES_PER_LONG;
> -    else if ( (msr >= 0xc0010000) && (msr <= 0xc0011fff) )
> +    else if ( (msr >= 0xc0010000U) && (msr <= 0xc0011fffU) )
>          msr_bit = msr_bitmap + 0x1000 / BYTES_PER_LONG;
>  
>      return msr_bit;
> @@ -2539,8 +2539,8 @@ const struct hvm_function_table * __init start_svm(void)
>  
>      setup_vmcb_dump();
>  
> -    if ( boot_cpu_data.extended_cpuid_level >= 0x8000000a )
> -        svm_feature_flags = cpuid_edx(0x8000000a);
> +    if ( boot_cpu_data.extended_cpuid_level >= 0x8000000aU )
> +        svm_feature_flags = cpuid_edx(0x8000000aU);
>  
>      printk("SVM: Supported advanced features:\n");
>  

... other (similar and dissimilar) constants used (and adjusted).
I guess I'll take the liberty to make this adjustment while
committing.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 07:55:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 07:55:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559703.874954 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJq5-0002pD-MG; Thu, 06 Jul 2023 07:55:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559703.874954; Thu, 06 Jul 2023 07:55:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJq5-0002p6-Jd; Thu, 06 Jul 2023 07:55:45 +0000
Received: by outflank-mailman (input) for mailman id 559703;
 Thu, 06 Jul 2023 07:55:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHJq4-0002p0-Eg
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 07:55:44 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0602.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::602])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 81db9767-1bd2-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 09:55:43 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB9245.eurprd04.prod.outlook.com (2603:10a6:102:2a0::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 07:55:40 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 07:55:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 81db9767-1bd2-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=O11EvokaK/M0IK3w32tVu1czcNN1HXbYiV76e0q2WaXJhxfCKpcgtvMrUzn0HZ8WZBf7BvJ+SXpUegbW6eWklIOiN8y32NQuex+/OZ7T1FVS15Xbm6wFJQGGTG5HWExT9L7cfUX5leT18eEqFygMNXuGc403bX/lOFELIa6mx6R0yKQnk9594ygQdeuf5p/qmsA3MTTVn0OrAfAKOfB6fD8H5vh7QVCVbJiv0oUkpnIKlXxvwDr70dW+9ZgJIgEi19wos7lxQYHIBDEgvHN2SKckoB7Ys1652MJBTBAuX4HiH1cCcmuI20NpNtI+LSw14Ncl7MpdJmkceFNrScq8aA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=nB3ss0zZcTG4ngDKW3KalbdWIcY/w9BdAoFh5Oojdxk=;
 b=khku9GNXLlY8doHc7QaCKSx62NVlRO3O28BFb2ayvNWYZmRi35SWwvnVr7m3Kxx11al6SyNx+1M9O2Iq7L3YeDKYL0B00g0QNZmdWYsNLCh8chSAqgRwzTHDW+/FxEOiIRZwpAv635ushjt/UYhACF+zdAyOwOEAbNRlSmsDWFb2HOOFhNgP51e1CUBB/GsP15LFq8GRjRF3sN6E71NkiP9sSkfdcLonJjuH9aehAVI6dvMXH7bApP3wrgjAqgyF1EJm8DfZ90tohKW9jFuBGD4E3ybn3Y+/nYCKhVAnUAorMNL0YUIpAjHU+uouwBbNWjgwT+JPFp3xbmJAmAkHpA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=nB3ss0zZcTG4ngDKW3KalbdWIcY/w9BdAoFh5Oojdxk=;
 b=MyIKwZHXYwWq7dWY+40QiDEdYMl5Hzk0amZ1IXfPc6r1TvNctwv0W/cwnBvTyhtcHAVoCeFVvmAuw/QbLXJjfPacFsjyQyWaBDplb9mKwnNFRZS1MMuuiwdOMHVZnlE8H0514TiBcHUZJcDpsFKI/EUYJBMeWpXRdlvXOV8OHwnfnO/QrY8dA/TfGpsWTyMy/0tyivyCoK3o6lfbWlAgHd9fvnXd6xeJbhG6qg5gfJOxcRE/PUj+ihWuW5Orb7TIiKg/0OKtCx09eE7wqC0AZisfRJBe+pET/JuOQ+eswhE/8amUQ1tpCd+fXTvxS4UEvGf0b0cueCLpJqfwAuS3fw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <45dad847-7d0e-c2e5-62a2-f640d9879676@suse.com>
Date: Thu, 6 Jul 2023 09:55:38 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 06/13] xen/efi: fix violations of MISRA C:2012 Rule
 7.2
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
 Gianluca Luparini <gianluca.luparini@bugseng.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 Simone Ballarin <simone.ballarin@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <9a791b84be74d7ca575eb94e070aae7294d95bbf.1688559115.git.gianluca.luparini@bugseng.com>
 <alpine.DEB.2.22.394.2307051635170.761183@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307051635170.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0172.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a0::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB9245:EE_
X-MS-Office365-Filtering-Correlation-Id: da5cadd0-261b-4f0b-295e-08db7df66472
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	nu+iPTfjns9iej1nsceJnFpUYy2lyp4T5ZiAlB4tZrzByGzduzmBYH8oBylQBOWgbl4/vkx/IuOibM+Pc+UIuj2VlICUbZJAhsAB2vDACtEDrBpZm28cfRlTaUZ8CazZdAWoY3Y6iNQUAZm4Cgox1DnVBYs1gRSPJCI62RZ6fGZNvDBXVFaYWrTqp96oX420XcGyRy8rNRCAlhBxGfk2aCYUnTqiU2iblpamxLY4PnkYhK1PPcTtJU853tZWQdiCm42dQD9ClN5ZX+lcRk/M+yfKjl6MSH190pBVaYh5IuEW78prz6GODKJlOidkQ1QVJX+bMY15n9TfA7AQewtuVbV09aYfxFbVqZtUbesd6MjTFFqKm9/cL9eQWtfsCeZ7im/ULB4s4UINAAIEeC3yiPXtQThJwdSX1QBuqmW6NckXBWgFcVvBNi/4f6c7yKT5ntoVt8VqG18r+kCNwmpfd/puakIKANQsJ8e+7lAr7h2cmloByiFBD+pWdTz+S7mpTCrV4LWejHlKxyUrJV4S8gmzkGsBNdDd4mpwG39e1KVl2nz68n9vUBsjqi/0b0FFe6LHOzjew7tWY1cx56KxsUUWpiAnwv4pkYrTgTSFS5creyAwpJ08I2IigxfQSbWvwuNRpXS3O9Z7oaX43bdPKw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(366004)(376002)(39860400002)(396003)(136003)(451199021)(38100700002)(36756003)(31696002)(86362001)(6512007)(478600001)(6486002)(186003)(6506007)(53546011)(26005)(8936002)(8676002)(5660300002)(54906003)(66946007)(31686004)(41300700001)(6916009)(4326008)(66556008)(66476007)(316002)(2906002)(2616005)(83380400001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UmZBVG8vbVR1SjV5NjlJNi9vYzF5QkxYdEhwS1dKK3hmVmJlVlNIRWhFaHNq?=
 =?utf-8?B?Q2h4bGpiV2ZBWEJEdkgwWG1HY2Z4ZVJiZiswakM1U0cxM2Y3Z2pDa1kxRWVm?=
 =?utf-8?B?K3N1NXRqS3FHUnZadkk4VzhkS0UvUFNDbVppdTZZV216VkY4MTlIYks5Q1lT?=
 =?utf-8?B?SFN3b1NTNzZmU2xaem9DWVA3eG93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 =?utf-8?B?R1UrK1pYNDA4anNKclE0NWUyVTlsQ2NYSTAxVDNKUVJsNUZZajhhOWhzVnlx?=
 =?utf-8?B?YXMvY3JLNEtoL0hoOElkNmFCRUwzWDR0RGdOODVENHVNOEliQThSUWM1ZExW?=
 =?utf-8?B?VjlUODdWNU5ZVjdzRW4xKzgwZk0yYVB1ZEpvMnlDemlFUjFmYWJPZUVWSlFh?=
 =?utf-8?Q?HSlivieru1MMPUj6e/0tKMpC2?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: da5cadd0-261b-4f0b-295e-08db7df66472
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 07:55:40.5453
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: nVtKJ6Hnf/Eeo9cumYNouEe1xQ1anRwCSO4ujLqgCqMkjEMk6upbYAnJb5K6u0e3kDTH/BdRT9aFz0o+L+HfMQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9245

On 06.07.2023 01:37, Stefano Stabellini wrote:
> On Wed, 5 Jul 2023, Simone Ballarin wrote:
>> --- a/xen/common/efi/boot.c
>> +++ b/xen/common/efi/boot.c
>> @@ -34,13 +34,13 @@
>>  #define EFI_REVISION(major, minor) (((major) << 16) | (minor))
>>  
>>  #define SMBIOS3_TABLE_GUID \
>> -  { 0xf2fd1544, 0x9794, 0x4a2c, {0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94} }
>> +  { 0xf2fd1544U, 0x9794U, 0x4a2cU, {0x99U, 0x2eU, 0xe5U, 0xbbU, 0xcfU, 0x20U, 0xe3U, 0x94U} }
>>  #define SHIM_LOCK_PROTOCOL_GUID \
>> -  { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} }
>> +  { 0x605dab50U, 0xe046U, 0x4300U, {0xabU, 0xb6U, 0x3dU, 0xd8U, 0x10U, 0xddU, 0x8bU, 0x23U} }
>>  #define APPLE_PROPERTIES_PROTOCOL_GUID \
>> -  { 0x91bd12fe, 0xf6c3, 0x44fb, { 0xa5, 0xb7, 0x51, 0x22, 0xab, 0x30, 0x3a, 0xe0} }
>> +  { 0x91bd12feU, 0xf6c3U, 0x44fbU, { 0xa5U, 0xb7U, 0x51U, 0x22U, 0xabU, 0x30U, 0x3aU, 0xe0U} }
>>  #define EFI_SYSTEM_RESOURCE_TABLE_GUID    \
>> -  { 0xb122a263, 0x3661, 0x4f68, {0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80} }
>> +  { 0xb122a263U, 0x3661U, 0x4f68U, {0x99U, 0x29U, 0x78U, 0xf8U, 0xb0U, 0xd6U, 0x21U, 0x80U} }
>>  #define EFI_SYSTEM_RESOURCE_TABLE_FIRMWARE_RESOURCE_VERSION 1
> 
> To be honest in these case I don't know if this is better or if it is
> better to add U only to the first numbers (0xf2fd1544U, 0x605dab50U,
> 0x91bd12feU, 0xb122a263U).

I'd prefer the latter, but I wonder whether that's in the spirit of Misra.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 07:57:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 07:57:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559709.874965 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJrR-0003Q2-4S; Thu, 06 Jul 2023 07:57:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559709.874965; Thu, 06 Jul 2023 07:57:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJrR-0003Pv-1Q; Thu, 06 Jul 2023 07:57:09 +0000
Received: by outflank-mailman (input) for mailman id 559709;
 Thu, 06 Jul 2023 07:57:07 +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 <SRS0=pJ4M=CY=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qHJrP-0003Pp-QP
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 07:57:07 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b2e9c5c0-1bd2-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 09:57:05 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 0B99C22889;
 Thu,  6 Jul 2023 07:57:05 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B6C8C138FC;
 Thu,  6 Jul 2023 07:57:04 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id UJP9KtBzpmTPKAAAMHmgww
 (envelope-from <jgross@suse.com>); Thu, 06 Jul 2023 07:57:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b2e9c5c0-1bd2-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688630225; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=3iWmgcANU5eTWuh1LhgWH3O4PQam1Ynr8e8VXomF76U=;
	b=eNI2cmERW9+oS7dXzKxXkMuIV8UddaPQ7NFu96eDk2ySU4GVumCbcP/tD7sdPQy4qtXXSB
	TMNU5AJJuYc1/75CQk3j74dkGV3xc1kVWdRddTIPED9ZD3nM8V5S26SAk5wvBcvEsZi7NA
	ruPQj82JJ61CpCSYB5+ZwQ3KwRSmmJE=
Message-ID: <006e528d-8955-8324-ed58-bb0bc0e72acc@suse.com>
Date: Thu, 6 Jul 2023 09:57:04 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 xen-devel@lists.xenproject.org, Simone Ballarin <simone.ballarin@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <9e0d463e2fc09193a742fc7a64a331855705a4fb.1688559115.git.gianluca.luparini@bugseng.com>
 <290e4dbf-c9c9-49c9-29ea-6fc9b9a5a4fc@suse.com>
 <a55021d5-39d9-a928-4b82-6bc6a02b42ef@suse.com>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [XEN PATCH v2 09/13] xen/public: fix violations of MISRA C:2012
 Rule 7.2
In-Reply-To: <a55021d5-39d9-a928-4b82-6bc6a02b42ef@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------VR7kfxUSuiDvpvnhyzHRtvlu"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------VR7kfxUSuiDvpvnhyzHRtvlu
Content-Type: multipart/mixed; boundary="------------nZ0qt6U0ix5GIiR1n875uEmt";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 xen-devel@lists.xenproject.org, Simone Ballarin <simone.ballarin@bugseng.com>
Message-ID: <006e528d-8955-8324-ed58-bb0bc0e72acc@suse.com>
Subject: Re: [XEN PATCH v2 09/13] xen/public: fix violations of MISRA C:2012
 Rule 7.2
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <9e0d463e2fc09193a742fc7a64a331855705a4fb.1688559115.git.gianluca.luparini@bugseng.com>
 <290e4dbf-c9c9-49c9-29ea-6fc9b9a5a4fc@suse.com>
 <a55021d5-39d9-a928-4b82-6bc6a02b42ef@suse.com>
In-Reply-To: <a55021d5-39d9-a928-4b82-6bc6a02b42ef@suse.com>

--------------nZ0qt6U0ix5GIiR1n875uEmt
Content-Type: multipart/mixed; boundary="------------WcA11sfEmO8gE3DoBgueRF3g"

--------------WcA11sfEmO8gE3DoBgueRF3g
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMDYuMDcuMjMgMDk6NDMsIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAwNS4wNy4yMDIz
IDE3OjMzLCBKdWVyZ2VuIEdyb3NzIHdyb3RlOg0KPj4gT24gMDUuMDcuMjMgMTc6MjYsIFNp
bW9uZSBCYWxsYXJpbiB3cm90ZToNCj4+PiBGcm9tOiBHaWFubHVjYSBMdXBhcmluaSA8Z2lh
bmx1Y2EubHVwYXJpbmlAYnVnc2VuZy5jb20+DQo+Pj4NCj4+PiBUaGUgeGVuIHNvdXJjZXMg
Y29udGFpbnMgdmlvbGF0aW9ucyBvZiBNSVNSQSBDOjIwMTIgUnVsZSA3LjIgd2hvc2UNCj4+
PiBoZWFkbGluZSBzdGF0ZXM6DQo+Pj4gIkEgJ3UnIG9yICdVJyBzdWZmaXggc2hhbGwgYmUg
YXBwbGllZCB0byBhbGwgaW50ZWdlciBjb25zdGFudHMNCj4+PiB0aGF0IGFyZSByZXByZXNl
bnRlZCBpbiBhbiB1bnNpZ25lZCB0eXBlIi4NCj4+Pg0KPj4+IEFkZCB0aGUgJ1UnIHN1ZmZp
eCB0byBpbnRlZ2VycyBsaXRlcmFscyB3aXRoIHVuc2lnbmVkIHR5cGUgYW5kIGFsc28gdG8g
b3RoZXINCj4+PiBsaXRlcmFscyB1c2VkIGluIHRoZSBzYW1lIGNvbnRleHRzIG9yIG5lYXIg
dmlvbGF0aW9ucywgd2hlbiB0aGVpciBwb3NpdGl2ZQ0KPj4+IG5hdHVyZSBpcyBpbW1lZGlh
dGVseSBjbGVhci4gVGhlIGxhdHRlciBjaGFuZ2VzIGFyZ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gYWRkZWQgZm9yIGNv
bnNpc3RlbmN5LiBUaGUgc29sZSBvbmUgdGhhdCByZWFsbHkgbWF0dGVyIGlzIGltbyAuLi4N
Cj4gDQo+Pj4gKyNkZWZpbmUgX19SRDQoeCkgICgoKHgpICYgMHgwMDAwMDAwY1UpID8gX19S
RDIoKHgpID4+IDIpIDw8IDIgICAgOiBfX1JEMih4KSkNCj4+PiArI2RlZmluZSBfX1JEOCh4
KSAgKCgoeCkgJiAweDAwMDAwMGYwVSkgPyBfX1JENCgoeCkgPj4gNCkgPDwgNCAgICA6IF9f
UkQ0KHgpKQ0KPj4+ICsjZGVmaW5lIF9fUkQxNih4KSAoKCh4KSAmIDB4MDAwMGZmMDBVKSA/
IF9fUkQ4KCh4KSA+PiA4KSA8PCA4ICAgIDogX19SRDgoeCkpDQo+Pj4gKyNkZWZpbmUgX19S
RDMyKHgpICgoKHgpICYgMHhmZmZmMDAwMFUpID8gX19SRDE2KCh4KSA+PiAxNikgPDwgMTYg
OiBfX1JEMTYoeCkpDQo+IA0KPiAuLi4gdGhpcyBzaW5nbGUgb25lLg0KDQpJIGFncmVlIHRo
YXQgb25seSB0aGUgbGFzdCBvbmUgaXMgcmVhbGx5IG5lZWRlZC4NCg0KQnV0IGZvciBjb25z
aXN0ZW5jeSByZWFzb25zIEknZCBleHBlY3QgYWxsIG9wdGlvbmFsICJVInMgdG8gYmUgZWl0
aGVyIGRyb3BwZWQgb3INCnNwZWNpZmllZCwgaW5zdGVhZCBvZiBhIG1peHR1cmUuDQoNCg0K
SnVlcmdlbg0K
--------------WcA11sfEmO8gE3DoBgueRF3g
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs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LhJCdP1I5aSgM5IVFdn7v5YgEYuJYx37Io
N1EblHI//x/e2AaIHpzK5h88NEawQsaNRpNSrcfbFmAg987ATQRTjHAWAQgAyzH6
AOODMBjgfWE9VeCgsrwH3exNAU32gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------WcA11sfEmO8gE3DoBgueRF3g--

--------------nZ0qt6U0ix5GIiR1n875uEmt--

--------------VR7kfxUSuiDvpvnhyzHRtvlu
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSmc9AFAwAAAAAACgkQsN6d1ii/Ey/q
wQf7Bk6SjgPDCElP1TwjK/jJx133UT4w5NRM+Kq9FfNYIXosocW+I4Uf142d2v13fSomgHcEMmql
1ZcEPQokT4luPUHqCR5LHGB32v0RkPFWtRbPLKs2v9eIBAF5MlwCCuaKMrVbINQqpMZ/9H+5i2uc
52Z0Wc82/0OgvaUT0g1qKFHIpC547nezp2b3Y5AzBc/9riOkMaaUr5C8HOI13Vvns3K+piBKWpWF
Euxzm7z9263zgGU1hy0d/KFE+q3xvHmN71xsvwmBM1CKyvb0EhTJirqkSsN/o47xLrCRwfKovD4h
DU+kU0Rpl44a8GQ9zmRI6N3J7P+0zKB8/GGCntbJDQ==
=cfGr
-----END PGP SIGNATURE-----

--------------VR7kfxUSuiDvpvnhyzHRtvlu--


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 08:00:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 08:00:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559721.874975 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJug-0005U1-3n; Thu, 06 Jul 2023 08:00:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559721.874975; Thu, 06 Jul 2023 08:00:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJug-0005Tu-12; Thu, 06 Jul 2023 08:00:30 +0000
Received: by outflank-mailman (input) for mailman id 559721;
 Thu, 06 Jul 2023 08:00:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VUoY=CY=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qHJue-0005Tk-7c
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 08:00:28 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on0621.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::621])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2a84677b-1bd3-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 10:00:26 +0200 (CEST)
Received: from AS9PR06CA0254.eurprd06.prod.outlook.com (2603:10a6:20b:45f::29)
 by DU0PR08MB9632.eurprd08.prod.outlook.com (2603:10a6:10:447::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 08:00:24 +0000
Received: from AM7EUR03FT006.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:45f:cafe::f9) by AS9PR06CA0254.outlook.office365.com
 (2603:10a6:20b:45f::29) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Thu, 6 Jul 2023 08:00:23 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT006.mail.protection.outlook.com (100.127.141.21) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.24 via Frontend Transport; Thu, 6 Jul 2023 08:00:23 +0000
Received: ("Tessian outbound b11b8bb4dfe8:v142");
 Thu, 06 Jul 2023 08:00:23 +0000
Received: from eed91a4eaa4f.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 B6F91BB3-F120-4321-8E33-30C2BD5A8D0A.1; 
 Thu, 06 Jul 2023 08:00:16 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id eed91a4eaa4f.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 06 Jul 2023 08:00:16 +0000
Received: from AS8PR04CA0186.eurprd04.prod.outlook.com (2603:10a6:20b:2f3::11)
 by AM7PR08MB5399.eurprd08.prod.outlook.com (2603:10a6:20b:104::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 08:00:15 +0000
Received: from AM7EUR03FT016.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:2f3:cafe::21) by AS8PR04CA0186.outlook.office365.com
 (2603:10a6:20b:2f3::11) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Thu, 6 Jul 2023 08:00:14 +0000
Received: from nebula.arm.com (40.67.248.234) by
 AM7EUR03FT016.mail.protection.outlook.com (100.127.140.106) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.24 via Frontend Transport; Thu, 6 Jul 2023 08:00:14 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com
 (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 6 Jul
 2023 08:00:10 +0000
Received: from [10.169.188.49] (10.169.188.49) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Thu, 6 Jul 2023 08:00:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2a84677b-1bd3-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=id3mbd/WET/yOTr9X2S9gwoCRet20H+18f9ajyGqou0=;
 b=ZqGnq5htFJJUfnAAOtrszykQzOPyIfka8Y9nrnCh6vNuZhazs/dwaeEYxjyBcfXx+SctX1/jMzEIc5PUBjKkla1ZLLBQlKZwHngctf36o3QCsgXGq4UqhxKKKCRvRHHvhCnZneGKVtsPh7MN34hmZv5cJOgzecTF40hzR5he1WM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: aeb6469a1e5f72e8
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=nicvspyILb/jPnu9/Wm9Ks72O2pA/PZl+DaoAQ+Jpti5RwkjrzIPItof+QMSJa579il+bOtXmONhr3DaS0ufzc0SmA3JlGxurPhEION2g/S0Laoy6r0qoRI/GrRxwPBbgYgb1+lK9Urx2lkKjF3lGgpINBmR1ljIxWQSv+XCVSiZSKihY8rPp//vsAvuO1WSiG8ttTzrnW/Qoqel+qTpuvIwTt3BHX/tt9jU02fE5STkyvZhi1qNHXaVSGI4qIqwjzMAiKpcaYaBpAiO0tHx2xEKzv6+kOdjyZPHh1XBmQzYbQiEdLmUWoohw9yj291NVKgx0xfXHx1zZ/m55FVj/w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=id3mbd/WET/yOTr9X2S9gwoCRet20H+18f9ajyGqou0=;
 b=UCYLLvY6y5iDVeJbJLVTAqJsjkAFJJ9IAvCBix1l0GrjNSsirBynpJhgtt3smQD7N5I+SMh0tgaliwOH1Ya0KFfCUVRuKq42sARrd7rpmHjlO8v5T8izlytGlGlNIMiXYtj9ziPFsEZuW24vMtM//7Sf5N4GyMPjuh03MRiLxwVoWk42Q/ttCeWzdN89MQhAUYNRJJBUYsMsSynuzHVuEz/Xw4EBWj/KkE6JO/8BQD1SSDCu6AGkA/Zfgqqv75k0Qhn4z1f+lg+ogOVlP4OSC7r6NenbSVXsDeHAgO6oj3KMFfK4MHLhOY/KAV7sUOhbSJeih1JSTiL7U+HZBvHyhg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=id3mbd/WET/yOTr9X2S9gwoCRet20H+18f9ajyGqou0=;
 b=ZqGnq5htFJJUfnAAOtrszykQzOPyIfka8Y9nrnCh6vNuZhazs/dwaeEYxjyBcfXx+SctX1/jMzEIc5PUBjKkla1ZLLBQlKZwHngctf36o3QCsgXGq4UqhxKKKCRvRHHvhCnZneGKVtsPh7MN34hmZv5cJOgzecTF40hzR5he1WM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <429ab357-08bd-4dd2-06f4-b8e2bc032ce1@arm.com>
Date: Thu, 6 Jul 2023 16:00:06 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 11/52] xen/arm: mmu: fold FIXMAP into MMU system
Content-Language: en-US
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-12-Penny.Zheng@arm.com>
 <1be18c29-511e-27eb-0970-adaa1c74ce82@xen.org>
 <06760592-ab87-c6c8-83df-e9204fdedadf@arm.com>
 <059b1018-58b9-5daf-7bf3-f9b84c0625ff@xen.org>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <059b1018-58b9-5daf-7bf3-f9b84c0625ff@xen.org>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	AM7EUR03FT016:EE_|AM7PR08MB5399:EE_|AM7EUR03FT006:EE_|DU0PR08MB9632:EE_
X-MS-Office365-Filtering-Correlation-Id: 8570485c-8c3f-4432-1e38-08db7df70d5e
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 f4DUuelWSFVucjsiDHGAr8HNBKuqX64NrQr80CTCMJJ3z290npH/E9Al4RTUiWqSjUr2+XU872qPi4oSwYQkTTjB3ehyad0dgZqDHcOneQO8M8z4u9vd/nt8tqbehO97v4rrl5/0gSX4qWNMfwl0O/GvF8DMKmNhlrAWyljBMR40DiKQvxdA1oo0gx5d1JBVaBBmEhR1n2DAqHla0sU/57CC5i18u5TbdIqPxbDAI4LgIuUfXeUHP+cn6YZNzanYUfC+omvgECgyrVVnHIPfx5+mX6iq9l2R1iXif4xBx9hpYLb4oYD6StUZifennG9EtfH4xICYyM1enENYsEpPcmtfEEX/0fiet4e8FDCrA1llZAexVBEvOH4L3RUqFngiAn64l6mitMnrXOWnNgTdW6SxDbVtZ0I/XgUHxmnLpU5EONVFVxnWvGo9B+9N8V1L7mWiorkrYBDrQtW79taoWQJd+qtPPijZwxABPHi6tshdAf78ET6iWs73Kl26sKtjnJsgCWRieCz14kGJSEpWJyYpyFVJQ9yc4afd6GOSbS3QeGKk27cFfJgf0bLX5eKpvMw63fj9uhY4b37RJ60LsPCtv//mnLWAMgxaUrgYi4O2cGC28dgIGJMk2uhJbT286UWXffcdFhw9TjKLQLCLvFJyaA5KbaxjS7Lvy0T4k8XiOE/OBObIpFMFTjWSOTyxp2pz+5qh/fRpyqxK1HBRw4rV841ONyXwBCm57Hbtnf0E7D698w4iU67GhcBkb8RcCPN4aMsiUAc167UkftitKjsrp5iXy/I+PveC5iAlmse+3faj/rdsuuIHU6bdQTUftNKHH170ng82PX8xtiEjWA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(136003)(39860400002)(376002)(451199021)(36840700001)(40470700004)(46966006)(70206006)(4326008)(70586007)(356005)(82740400003)(2616005)(81166007)(40480700001)(186003)(16576012)(86362001)(31696002)(36756003)(26005)(478600001)(110136005)(53546011)(54906003)(82310400005)(40460700003)(36860700001)(8936002)(41300700001)(8676002)(44832011)(5660300002)(31686004)(47076005)(2906002)(316002)(336012)(426003)(3940600001)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5399
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT006.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	b4876ddb-857f-4acf-4921-08db7df707e3
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	XZFqfzBFU6nWJmhVRVa/XNqgFXvMjs69GYa4KV+RZt7rwi8VnlrV+F7qHsaIMW4F0bPP1hT5Z+9ZvUAkYCv3yDPgJASWzIkzKTTmY9nN7ao5+jupAbl3tRqqnWzu5afsmFF5ClrWDRfYDVHWxhQlLBnn6dvXQ9Xa7MoiN28oGk3ellS7G/eSGUonlMFgsvJ2GfN4S4Zk6QqQ/Am1+/NlG6rAFXLcV6rkqDxe4dMtnJPm+8EVWlk5Gi8gNPhdEwbS4R5UbzvhwmV77x0Bii2KW+9m7J9G2YWWVLlvmQu9PleKZsBLJRA+klO3I9f4Vhn8DNsO7nawp0qx7QZdvj8fnGr155t6B/iwfdhpb4KaZObLTRT8/5HkhBBNtPFEvgS6YfRUozcL4p8W0SQLaXaswVdmdY5LhHdP7edB8iq3XKLXicfaYyPbRjyfon95SZxxn2Yw/ziUNCHNeB5kmChS3J/tYNF36OpOMDItV0UwyGnYjS2U22xYbrmOywmWws1z3txUBwnDrgkRmn+P3Bj5GnvBrUeKnJ2tsbdLpbLZticNRpHWDGOjOr0dKcomufLfrYMbv7c1lNtrJztpfiG2bRKPiS6AHMqtz/3koMzwzDmsX+hncLAVJ89Q0qp8hAto/FffIutRjLZWIgOEAWbF7jBcRmY6RpI0ZTjgxY2HIHwcMrIHMMD7R4hToVaeyjh4S+g56co4+kUQh4YIUerZ/pCR15AR18wPjr2LuQ6n+J9RB8PZjht4mPeT9Tz48VK1X94mZHx4twhHh+1soD931jVl2Eth9te9Vmq7rjQPIdtfikfQeqHCSgGb2IGt85yG
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(376002)(39860400002)(346002)(451199021)(40470700004)(46966006)(36840700001)(31686004)(478600001)(110136005)(70586007)(16576012)(54906003)(36860700001)(336012)(36756003)(2616005)(47076005)(426003)(31696002)(86362001)(40480700001)(82310400005)(2906002)(70206006)(53546011)(26005)(186003)(81166007)(82740400003)(4326008)(316002)(8936002)(41300700001)(40460700003)(44832011)(8676002)(5660300002)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 08:00:23.7254
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 8570485c-8c3f-4432-1e38-08db7df70d5e
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT006.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9632

Hi Julien

On 2023/7/5 18:31, Julien Grall wrote:
> Hi Penny,
> 
> On 05/07/2023 09:19, Penny Zheng wrote:
>> On 2023/7/5 06:12, Julien Grall wrote:
>>> On 26/06/2023 04:34, Penny Zheng wrote:
>>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>>> index fb77392b82..22b28b8ba2 100644
>>>> --- a/xen/arch/arm/Kconfig
>>>> +++ b/xen/arch/arm/Kconfig
>>>> @@ -15,7 +15,6 @@ config ARM
>>>> Â Â Â Â Â  select HAS_DEVICE_TREE
>>>> Â Â Â Â Â  select HAS_PASSTHROUGH
>>>> Â Â Â Â Â  select HAS_PDX
>>>> -Â Â Â  select HAS_PMAP
>>>> Â Â Â Â Â  select IOMMU_FORCE_PT_SHARE
>>>> Â  config ARCH_DEFCONFIG
>>>> @@ -63,11 +62,17 @@ source "arch/Kconfig"
>>>> Â  config HAS_MMU
>>>> Â Â Â Â Â  bool "Memory Management Unit support in a VMSA system"
>>>> Â Â Â Â Â  default y
>>>> +Â Â Â  select HAS_PMAP
>>>> Â Â Â Â Â  help
>>>> Â Â Â Â Â Â Â  In a VMSA system, a Memory Management Unit (MMU) provides 
>>>> fine-grained control of
>>>> Â Â Â Â Â Â Â  a memory system through a set of virtual to physical address 
>>>> mappings and associated memory
>>>> Â Â Â Â Â Â Â  properties held in memory-mapped tables known as translation 
>>>> tables.
>>>> +config HAS_FIXMAP
>>>> +Â Â Â  bool "Provide special-purpose 4K mapping slots in a VMSA"
>>>
>>>
>>> Regardless what I wrote above, I don't think a developer should be 
>>> able to disable HAS_FIXMAP when the HAS_MMU is used. So the 3 lines 
>>> should be replaced with:
>>>
>>> def_bool HAS_MMU
>>
>> Understood, will fix
> 
> Do you still need HAS_FIXMAP if this patch is dropped?

Right now, this patch only contains:
1) wrap PMAP into MMU
2) change static inline virt_to_fix() to declaration in fixmap.h and
definition in mmu/mm.c.
HAS_FIXMAP is not needed anymore.

> 
> Cheers,
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 08:02:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 08:02:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559727.874995 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJw5-0006I0-Oe; Thu, 06 Jul 2023 08:01:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559727.874995; Thu, 06 Jul 2023 08:01:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJw5-0006Ht-Lc; Thu, 06 Jul 2023 08:01:57 +0000
Received: by outflank-mailman (input) for mailman id 559727;
 Thu, 06 Jul 2023 08:01:56 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VUoY=CY=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qHJw4-0006HE-Qu
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 08:01:56 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on2062f.outbound.protection.outlook.com
 [2a01:111:f400:7d00::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5fd66498-1bd3-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 10:01:55 +0200 (CEST)
Received: from DU2PR04CA0341.eurprd04.prod.outlook.com (2603:10a6:10:2b4::30)
 by DB4PR08MB9262.eurprd08.prod.outlook.com (2603:10a6:10:3f9::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 08:01:51 +0000
Received: from DBAEUR03FT041.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:2b4:cafe::ad) by DU2PR04CA0341.outlook.office365.com
 (2603:10a6:10:2b4::30) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Thu, 6 Jul 2023 08:01:51 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT041.mail.protection.outlook.com (100.127.142.233) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.24 via Frontend Transport; Thu, 6 Jul 2023 08:01:50 +0000
Received: ("Tessian outbound c08fa2e31830:v142");
 Thu, 06 Jul 2023 08:01:50 +0000
Received: from f2a780f975cf.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 3CCFBD23-7725-480F-BFDA-F619904B0565.1; 
 Thu, 06 Jul 2023 08:01:44 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f2a780f975cf.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 06 Jul 2023 08:01:44 +0000
Received: from AM6P195CA0085.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:86::26)
 by PA4PR08MB5949.eurprd08.prod.outlook.com (2603:10a6:102:eb::22) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 08:01:41 +0000
Received: from AM7EUR03FT010.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:209:86:cafe::84) by AM6P195CA0085.outlook.office365.com
 (2603:10a6:209:86::26) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Thu, 6 Jul 2023 08:01:41 +0000
Received: from nebula.arm.com (40.67.248.234) by
 AM7EUR03FT010.mail.protection.outlook.com (100.127.141.22) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6565.24 via Frontend Transport; Thu, 6 Jul 2023 08:01:41 +0000
Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX04.Arm.com
 (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 6 Jul
 2023 08:01:39 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com
 (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 6 Jul
 2023 08:01:39 +0000
Received: from [10.169.188.49] (10.169.188.49) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Thu, 6 Jul 2023 08:01:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5fd66498-1bd3-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IjFlBriCUqIiYxpiIcklky5G1qQ7Ym6ZrrTYNXjCpO4=;
 b=mVyW2LhEDol0xVTD3Hp2ElGKEv/0xc7VrWYFu/sxBNeFCruHTZ7Y28+TxxeQm510YTuAC09T3u5ImkN7/tRRmLBy2mzSMQ95rMWw+xzVVdteGfJBF3kRTgMaFTsvrM0ge01m1O9W1qtCQEG36rPkJZ1dVKl91R/sPa1x1WLc6AQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: bc8f29814506501c
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=WWP1V9GP7jBnLn6sET0Hg8EFRCScpdSw7pIafUACdCfbZnfPFBJHrT7V9VWxzqPclAF6b5uiokJK7aws+w5yPw5oOHjCbXVNGBvD6Ac1Gna7T67fzQhozhuVBADsI+nBhghdnqtP/ZofIKVWJ0ckdc5sd+yCG+tB0mNHCTnQtRd+q4HTikhuGSFbV6ijxouSNxGx8VtX6jMOxdA2X5RzMgdW7TYIICh+aVTqzYa9dqATo2ZsNdxkqTmwLfJpjJZC8JzV8g8s7Q9t3OlknYrlKFaJDlg1pby9U3pNV5OYyRBE6rao9JHcfslShSi5jTBNmry+QF4g52LVpWmpDgtqxA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=IjFlBriCUqIiYxpiIcklky5G1qQ7Ym6ZrrTYNXjCpO4=;
 b=J89jVbwh70o6LhbZQglRBt9SZ70oEUlHkbzq6fJuA0OFyf6jZUhZhD958UrB4AHBA7BFjp0AbM75ST8cuhxGitITQJ4jxnhT+vd6CDm6wWJWmCtJMZr/N7WHjXtP05u4XbKsKg7PPJ6L96QeeBerT128m2fR8K3NRfBD/Oc6DJ09kzT/359pXpNTH/OKninXbKtJfFgkxrfR5P2AAJKLeqGBPxXnkvmoQoBFUj7HR4Kl378KjNdBSxmRNo3mZiWGFuBWO1iyC3bl/cbi918bio6rJO88KnTxJ62Y5YQ6Iyv2ToHiVVCf9AHbRncs9Ge3YOYB98vvHQBHB9YPZk8YVA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IjFlBriCUqIiYxpiIcklky5G1qQ7Ym6ZrrTYNXjCpO4=;
 b=mVyW2LhEDol0xVTD3Hp2ElGKEv/0xc7VrWYFu/sxBNeFCruHTZ7Y28+TxxeQm510YTuAC09T3u5ImkN7/tRRmLBy2mzSMQ95rMWw+xzVVdteGfJBF3kRTgMaFTsvrM0ge01m1O9W1qtCQEG36rPkJZ1dVKl91R/sPa1x1WLc6AQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <f88fb44e-2a18-a4fc-6618-558773e6e773@arm.com>
Date: Thu, 6 Jul 2023 16:01:35 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 12/52] xen/mmu: extract early uart mapping from
 setup_fixmap
Content-Language: en-US
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-13-Penny.Zheng@arm.com>
 <78862bb8-fd7f-5a51-a7ae-3c5b5998ed80@xen.org>
 <02df8ce2-fa68-614b-87ce-82bb5b60d2a1@arm.com>
 <1c0a7397-0129-d0d5-2941-3ef1fddef61b@xen.org>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <1c0a7397-0129-d0d5-2941-3ef1fddef61b@xen.org>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	AM7EUR03FT010:EE_|PA4PR08MB5949:EE_|DBAEUR03FT041:EE_|DB4PR08MB9262:EE_
X-MS-Office365-Filtering-Correlation-Id: b136d383-ead0-4755-0a67-08db7df7415a
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 ucRXTROrOE/VUPzv49eu5I4G3HyehAp6iOCaeMO0bm50FDbkGQlVNpjLZNaLtf35IBuRj+Asi2dh84DJppVbsmzd1guhaQZ+iyy0bDZuV7ovJIxJCC/PlodKcC1FXnVLRMiDb/Gdc81NmnX7WzURnpkOfYGop0TQL1hTQXhcsJH5hBVGVxBFD2d0xYa/tdhnGxXc84MUyVYNmtWMn5kmWM3yeYgWx7B+UgMDlMgz9pHhW9hrCJCyCQAub/io2RbdJKQzZnMkGpR6ZiXbBFNAy4TR/oUZde6udFrt5D9FPcnXPSiDWUB+qzwIBQI9Asp4JRqI7j4DqPhtn1j0JIX21iftMAaFesC4gtLFZbjpjuX71fNUnD0V/jd8CMT1jXyL9x3qdf2NtCdCeK35cBZeGXDCHPzwWgg1cFsv5cAR5y1iO6ww7KSAb6pfUsg79vfefxfqIxGS538Hu1/DkmRPvJRG2u724fF1pBCva1iv0ufrqeDyNzMc9y0VauN4cWUhOdw/2AcbhDndHYL+SCyd4TRVpirwOu44Pszuiiy2b41Oe17DRP1IgQcHHjpwQpFFWNhaPyJfacRv+cmvqeLAOwp6jqxi2VIMv7rC3BKbqmbGzRuKVNQZZDBq4KgkU6W9xyMDtebzqZZ3ULocEV2XCvv/ACFbLrcHPj7WO+RN05aq+pIU/5YBxVoSXxhUal88wqVkRXr9KIE6tAzqHExoaI2Oy1X/SMjOMSkFdAj5VzVYZx26mU0vZJ54Lb7C3nAAs0njX26bLqP/HbEaiVCQwzQjRX5ys3/dpW0cqeT8SpbPrx9GGrgnHSRViqPA8Jh/xn39xJJM37IgI9YRanImPw==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(396003)(346002)(136003)(451199021)(46966006)(40470700004)(36840700001)(2906002)(36860700001)(41300700001)(40460700003)(40480700001)(2616005)(5660300002)(44832011)(82310400005)(53546011)(70586007)(31686004)(70206006)(4326008)(54906003)(478600001)(110136005)(86362001)(26005)(31696002)(186003)(336012)(16576012)(316002)(83380400001)(8936002)(426003)(36756003)(81166007)(356005)(82740400003)(47076005)(8676002)(3940600001)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB5949
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT041.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	74e7fed0-441a-4c58-c2ba-08db7df73b78
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	8yKrLw7pz2e1kSgM4iMjRCk8cxT3ZwozhmzKQM7WCBHhWOWVOOZAniSu2E6Ysx0+JryZ4EujivTkZp3uZO3lMFAPYQ2pJTxokU04RO1FBVoWklfoWRyRlw1FESMfFa57X9qolr4FzoFbMlzz8Z5RdIN0zvtA9BkQ0RJdEnJTKuAE7tLeSrFMCT0ZOGMBrzZTKtcqdu7MWZAxltCAMcoW0RhQAxEx5jk3xRVrjA3lqqQYLOpGB1F2v8Ystc8ZiwbO+TstlcIa4Idf+p4LAAcls89vUMJ783eigtL+/MVot8iTx2Mn3HLwAY+liVifbqCVKo9JdqEd6+TF1TrI363em2MB+mZbOPIjO3mLeAslbNXJFYz3pRh9/b7XrpKXMN7nJUh+b6sUufx8ttR20cabN20dOMPto2pDfPBdoGGMcBbywinwcQEFhVJVsWiJFJ4LL6pWKmjVbwgqJQr2s3ulKQuATcuJU2RAjXB/1dzkb4j6jfsZloaxGKIAYKJOvnl4m59VRffD0ghubTpPSJyy5RGXbJ/IdZwIFVIPfq4HR5BEqyp1yipfWLHDD8kW/gWzjdaxHG7e4nHaes4HEyj3nrEfVltkLvKnLao7vrEdmFck/TKJ4Gg9lKpYFHZJh5Xu130oOyz2G+FRWFFuzC8bJzOAc8QgwcU6aF7pMB75QPlb3q56MIvsacgqOaK55W2DZRZ3rCC5ZNB+IoFv9XzF1LqmuUJTzciMNmzXEBRwvMqsizSIvbf/BuUGIJZOVmkXbviIXy8uvA6eS0+VIYiTraPgBndexmFQeDPp4GxcT6bLQD3PEHKgJkmBbxR44rf7
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(376002)(136003)(346002)(451199021)(46966006)(40470700004)(36840700001)(186003)(82740400003)(478600001)(426003)(26005)(53546011)(31686004)(86362001)(336012)(2616005)(110136005)(316002)(81166007)(47076005)(83380400001)(16576012)(54906003)(36860700001)(70206006)(4326008)(70586007)(5660300002)(8936002)(8676002)(40460700003)(44832011)(41300700001)(2906002)(40480700001)(31696002)(82310400005)(36756003)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 08:01:50.9714
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b136d383-ead0-4755-0a67-08db7df7415a
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT041.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR08MB9262

Hi Julien

On 2023/7/5 18:35, Julien Grall wrote:
> Hi Penny,
> 
> On 05/07/2023 10:03, Penny Zheng wrote:
>> On 2023/7/5 06:25, Julien Grall wrote:
>>> Hi Penny,
>>>
>>> Title: You want to clarify that this change is arm64 only. So:
>>>
>>> xen/arm64: mmu: ...
>>>
>>> On 26/06/2023 04:34, Penny Zheng wrote:
>>>> Original setup_fixmap is actually doing two seperate tasks, one is 
>>>> enabling
>>>> the early UART when earlyprintk on, and the other is to set up the 
>>>> fixmap
>>>> even when earlyprintk is not configured.
>>>>
>>>> To be more dedicated and precise, the old function shall be split 
>>>> into two
>>>> functions, setup_early_uart and new setup_fixmap.
>>> While some of the split before would be warrant even without the MPU 
>>> support. This one is not because there is limited point to have 3 
>>> lines function. So I think you want to justify based on what you plan 
>>> to do with the MPU code.
>>>
>>> That said, I don't think we need to introduce setup_fixmap. See below.
>>>
>>>
>>>>
>>>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>>>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>>>> ---
>>>> v3:
>>>> - new patch
>>>> ---
>>>> Â  xen/arch/arm/arm64/head.SÂ Â Â Â  |Â  3 +++
>>>> Â  xen/arch/arm/arm64/mmu/head.S | 24 +++++++++++++++++-------
>>>> Â  2 files changed, 20 insertions(+), 7 deletions(-)
>>>>
>>>> diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
>>>> index e63886b037..55a4cfe69e 100644
>>>> --- a/xen/arch/arm/arm64/head.S
>>>> +++ b/xen/arch/arm/arm64/head.S
>>>> @@ -258,7 +258,10 @@ real_start_efi:
>>>> Â Â Â Â Â Â Â Â Â  bÂ Â Â Â  enable_boot_mm
>>>> Â  primary_switched:
>>>> +Â Â Â Â Â Â Â  blÂ Â Â  setup_early_uart
>>>> +#ifdef CONFIG_HAS_FIXMAP
>>>> Â Â Â Â Â Â Â Â Â  blÂ Â Â  setup_fixmap
>>>> +#endif
>>>> Â  #ifdef CONFIG_EARLY_PRINTK
>>>> Â Â Â Â Â Â Â Â Â  /* Use a virtual address to access the UART. */
>>>> Â Â Â Â Â Â Â Â Â  ldrÂ Â  x23, =EARLY_UART_VIRTUAL_ADDRESS
>>>> diff --git a/xen/arch/arm/arm64/mmu/head.S 
>>>> b/xen/arch/arm/arm64/mmu/head.S
>>>> index 2b209fc3ce..295596aca1 100644
>>>> --- a/xen/arch/arm/arm64/mmu/head.S
>>>> +++ b/xen/arch/arm/arm64/mmu/head.S
>>>> @@ -367,24 +367,34 @@ identity_mapping_removed:
>>>> Â  ENDPROC(remove_identity_mapping)
>>>> Â  /*
>>>> - * Map the UART in the fixmap (when earlyprintk is used) and hook the
>>>> - * fixmap table in the page tables.
>>>> - *
>>>> - * The fixmap cannot be mapped in create_page_tables because it may
>>>> - * clash with the 1:1 mapping.
>>>
>>> Since commit 9d267c049d92 ("xen/arm64: Rework the memory layout"), 
>>> there is no chance that the fixmap will clash with the 1:1 mapping. 
>>> So rather than introducing a new function, I would move the creation 
>>> of the fixmap in create_pagetables().
>>>
>>
>> Understood. I'll move the creation of the fixmap in create_pagetables().
>>
>>> This would avoid the #ifdef CONFIG_HAS_FIXMAP in head.S.
>>>
>>>> + * Map the UART in the fixmap (when earlyprintk is used)
>>>> Â Â  *
>>>> Â Â  * Inputs:
>>>> - *Â Â  x20: Physical offset
>>>> Â Â  *Â Â  x23: Early UART base physical address
>>>> Â Â  *
>>>> Â Â  * Clobbers x0 - x3
>>>> Â Â  */
>>>> -ENTRY(setup_fixmap)
>>>> +ENTRY(setup_early_uart)
>>>> Â  #ifdef CONFIG_EARLY_PRINTK
>>>> Â Â Â Â Â Â Â Â Â  /* Add UART to the fixmap table */
>>>> Â Â Â Â Â Â Â Â Â  ldrÂ Â  x0, =EARLY_UART_VIRTUAL_ADDRESS
>>>> Â Â Â Â Â Â Â Â Â  create_mapping_entry xen_fixmap, x0, x23, x1, x2, x3, 
>>>> type=PT_DEV_L3
>>>> +Â Â Â Â Â Â Â  /* Ensure any page table updates made above have occurred. */
>>>> +Â Â Â Â Â Â Â  dsbÂ Â  nshst
>>>> +
>>>> +Â Â Â Â Â Â Â  ret
>>>
>>> The 'ret' needs to be outside of the '#ifdef' block. But, in this 
>>> case, I would prefer if we don't call setup_early_uart() when 
>>> !CONFIG_EARLY_PRINTK in head.S
>>>
>>
>> okay. I'll move the #ifdef to the caller in head.S.
> 
> Thinking about this again. I think you can actually move the mapping of 
> the UART in create_pagetables() because it will also not clash with the 
> 1:1.
> 
> For the MPU, the mapping could then be moved in prepare_early_mappings().
> 
> This would reduce the number of functions exposed.

Understood! will do.

> 
> Cheers,
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 08:02:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 08:02:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559726.874985 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJw3-00062H-G8; Thu, 06 Jul 2023 08:01:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559726.874985; Thu, 06 Jul 2023 08:01:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJw3-00062A-Ba; Thu, 06 Jul 2023 08:01:55 +0000
Received: by outflank-mailman (input) for mailman id 559726;
 Thu, 06 Jul 2023 08:01:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qHJw1-00061y-AX
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 08:01:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHJw0-0002ll-KS; Thu, 06 Jul 2023 08:01:52 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHJw0-0006u4-E5; Thu, 06 Jul 2023 08:01:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=kV+uiA0FNsCPRSdI4j90Eom0nMtud28n16Xs5aXrcGo=; b=3/tdHZcxwXoBsVyybGmiTgQ2qX
	crT9I8ih96zPRjGwPADK/NPM/3tSdB62hGRdQTlZlWDxIZTXRwEhr5cBhSA+adsoqFXSR/iz4Z7TU
	PKhhEyGZ4rvLwNpx9MIS9OjcxQLwlsxSpXqIiRM2bniTRsDtbX1a2yaxDSCgUfnhXUuQ=;
Message-ID: <29756ff8-adcd-5184-c8b1-c619a5a8d3f2@xen.org>
Date: Thu, 6 Jul 2023 09:01:50 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 05/13] xen/device-tree: fix violations of MISRA
 C:2012 Rule 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <da656a93e42e5d04e02f62002b1f5ab357c8c16a.1688559115.git.gianluca.luparini@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <da656a93e42e5d04e02f62002b1f5ab357c8c16a.1688559115.git.gianluca.luparini@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 05/07/2023 16:26, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>

This suggest the author is Gianluca but...

> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type and also to other
> literals used in the same contexts or near violations, when their positive
> nature is immediately clear. The latter changes are done for the sake of
> uniformity.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

... the first signed-off-by is yours. So who is the author?

More generally, there tags are order chronogically. So if Gianluca is 
the author then it should be the first Signed-off-by. Then it is yours.

This will be followed-by the Acked-by/Reviewed-by tags.

The same remark goes for the rest of the series.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 08:04:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 08:04:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559739.875004 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJyh-0007EA-81; Thu, 06 Jul 2023 08:04:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559739.875004; Thu, 06 Jul 2023 08:04:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJyh-0007E3-57; Thu, 06 Jul 2023 08:04:39 +0000
Received: by outflank-mailman (input) for mailman id 559739;
 Thu, 06 Jul 2023 08:04:37 +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 <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHJyf-0007Dh-PA
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 08:04:37 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20614.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::614])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bef780fd-1bd3-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 10:04:35 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VI1PR04MB6912.eurprd04.prod.outlook.com (2603:10a6:803:134::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 08:04:32 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 08:04:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bef780fd-1bd3-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JwkZpv0N2cq9dZYM2hqHQTNuPkXJsRJzAMYer0sz5A0BXJBBd855Dw9K48ZZOd45sJUNPA7pq1rYPNQ1F9clA0t6REKKWqIUZPd+uGGDL8SzdpbWxpkbt32OAS6l7ssYwR3YqZqdVfpesX+Eu39vaC7LfojdVgulKMY37UmIj84pVTD8vQfamQqzNdXlm+UibuzDheSvMag5i1BcaZDdjIy+OYoE2V+W+K1u/RPLsLFXTCepPrO30E/uLtEr1vV3U9v57RIkMXNxL1/qjJcx74q/q/L0/4Wbd7rcb9WKOvcLkYiONQkkVtCyO0pQ4QDa6t3OmpzfeXsDuOUlq1tRvA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=hArFJNFoKK19jjNG/YMjS3I+u6H7IIRRIkcKQARosLg=;
 b=j3THx/cnnML85M3uLYGqBzcnMhi68L2MZvz9rnM3PPXOpbLxG3JSe1QwWk+NzT6soB6nUkO+zmlycGVOonsBRuTk2zdCsFudKgD+hu/+T0Qw6tigiOeY9MBb5nKN1kj2HSesx29qFZv6BFFxcZxBo40O9KShFOecNWF9JlDWaGJpdmPs9eQPh5Rv/t26uuV2nky2bsl+JuMt+XNbhsEeAsFmic2UAk5z5rHLLFTZiA+naVTvTcfEXTmV54+/T64LcuYXrzPdQkM64qjxwg8TsXttPb1abySIZfSTBTNIfsCNc6/uf+4IbA+xMnecRbpOLM9PxhkeZzwpDAQVMAL5Bg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=hArFJNFoKK19jjNG/YMjS3I+u6H7IIRRIkcKQARosLg=;
 b=4tTvtyKauCdn82C8Ci4934Q8nw1zqldvgkLlZh3phf1usyPrRRgv+iCaxWsKc4pEH8VPiZwkwzKZEeVg61HWTyqTAn8dsh7hpZuQtLT4DjmsAsiqnoqvFw4UlMNTpKm/ivYYwGUyj16Rw1VfM6uQs54LD3wSQCqhFhCGO/abU9b2q5wGBBaBltaLIVPVHjg7pbZ+cNM29w/QGeesPDTaAjd/BDmD6arCUad9JaDeMyNKI38uj3NkDaJgiRs+GmnWK6dMcfHD8Hdp4M6ZWIPKvJItoH3NXuKvMb8gQAab9Kw3fBCw+bj/CvFiGmwfKfKUaQRHBPbPPLWdWLoT59zTMQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <f3b6170a-db0d-ef00-b3f8-7deba17b9fe2@suse.com>
Date: Thu, 6 Jul 2023 10:04:29 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 07/13] x86/vmx: fix violations of MISRA C:2012 Rule
 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Jun Nakajima <jun.nakajima@intel.com>,
 Kevin Tian <kevin.tian@intel.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <f30ef7c2cda2516d9ef07bb79e5da5513cd90c6c.1688559115.git.gianluca.luparini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <f30ef7c2cda2516d9ef07bb79e5da5513cd90c6c.1688559115.git.gianluca.luparini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0170.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:99::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VI1PR04MB6912:EE_
X-MS-Office365-Filtering-Correlation-Id: d4b139bf-ae06-4ae4-1b26-08db7df7a0f9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	N/g/6tRG3bDx7/Ige6OUEP2bPsm/NdvdO/f7+Fp8sbwQPYXkJZedvJ9zCDYWVsTfYmD9xjgYxVNBqEjK7tOwqiBVujcRgejlcbUDf8KySqCj1fKKBB5cQqX4kDHRVagVZ628nymFs4tfOaNjujw38RiqeWkgHmnHql/wKDpd+D/rrfNCCLJ3j8eEaYNjKIEVALM6j2fUI5Xxn09hzoL6Fh96OfXZwMI5Fxm4Dad4E9UQMzlEuaVsBSplwU5b2O7o91F7wmZZqHrI5Dchpp4mQJKyRNl8j5XAEmmlDL5d+IUmEB3yG4NeRekIdM61Dh6yOU0MJrOs4p6ei4m7Ahzi751SQcwrcJdNS3f7jJFvpZyab7HwxyNQ4/2hKXcT/TjfVYV/go6HXl0PSSpvvj7Hv+GSIJXRmsWyNVgCAqhDNP4dQkFpWbtZ8xBvGYRTByNNtT/3KpXpFpPLWWUoBnsLhxnG30JtkMLbiRTAkkG4FKHZrVYDei6EmAwmgVUgwM/2VvSNmlGiXJI7LuBQZNI8GGgA5GiJR3R1ziUr2LfR/NqHuBn45uBhA5QfGwGVzgg9VBY4kHKxY5WMDHF8KcnuQ1iG5f00BDua8osysmsRqA+/tscVmn+Bv++ZIubk5L9jkIQUx4deE4zXiDpGU04/rw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(366004)(376002)(136003)(346002)(451199021)(4326008)(186003)(478600001)(6512007)(26005)(6506007)(53546011)(31686004)(86362001)(66476007)(2616005)(316002)(83380400001)(38100700002)(54906003)(6486002)(66556008)(6916009)(66946007)(5660300002)(7416002)(8676002)(8936002)(41300700001)(2906002)(31696002)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VElXNH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B?TGhqM0taU29SM082NUdVMFBmamtxanhsMnpkWDczeVdidGlyakNOeEJnMHVO?=
 =?utf-8?B?bjJOajNramNiRWZ2T3BVYWk4TUE0RHlOdWRsUjRzQlhjNTBDNzJKWHQ5MDl4?=
 =?utf-8?B?ajZVd1ltUUZwY2ZBVlN1c1JvNFBjc1lOcWFJUkNKRGtqODRSZ0V0b2cyWjdT?=
 =?utf-8?B?OXhzWmJDVzlLblYxVW9jWW44OVVxaFdSWnVXWXE1dnlwdEtLSmJPQlNRMVRQ?=
 =?utf-8?B?Z1IwVHN5WlRmZmIzWHlGZUQ0MWFjQlVaMVVlMzF4RlZJRkNyb0lwK05xL0Qz?=
 =?utf-8?B?MUZNSllFRGF1Z1hDdDhmckNFNFVEWC9NS2dNY2RiZlZ1N0dSMEp3T3VRTVB5?=
 =?utf-8?Q?AoKhRdAiYsrGpm6fP8fbLpkaW?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d4b139bf-ae06-4ae4-1b26-08db7df7a0f9
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 08:04:31.5454
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: tk3S4oqSQwxMwEYIVEZUiReury1w9+o4Fo07yt8MInBbWlRaNV6lCGDkuLyFoikwxf2BM/PgJqjWQL8u1whdtQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6912

On 05.07.2023 17:26, Simone Ballarin wrote:
> --- a/xen/arch/x86/hvm/vmx/vvmx.c
> +++ b/xen/arch/x86/hvm/vmx/vvmx.c
> @@ -257,14 +257,14 @@ uint64_t get_vvmcs_virtual(void *vvmcs, uint32_t vmcs_encoding)
>  
>      switch ( enc.width ) {
>      case VVMCS_WIDTH_16:
> -        res &= 0xffff;
> +        res &= 0xffffU;

I don't think the suffix is needed in cases like this one, and ...

>          break;
>     case VVMCS_WIDTH_64:
>          if ( enc.access_type )
>              res >>= 32;
>          break;
>      case VVMCS_WIDTH_32:
> -        res &= 0xffffffff;
> +        res &= 0xffffffffU;

... while generally I'm suggesting to avoid casts I wonder whether
casting to uint32_t here wouldn't make things more obviously match
the purpose. (Same again further down then.)

> --- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
> +++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
> @@ -207,7 +207,7 @@ void vmx_vmcs_reload(struct vcpu *v);
>  #define CPU_BASED_ACTIVATE_MSR_BITMAP         0x10000000
>  #define CPU_BASED_MONITOR_EXITING             0x20000000
>  #define CPU_BASED_PAUSE_EXITING               0x40000000
> -#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000
> +#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000U

Interesting - you don't change adjacent #define-s here, nor ...

> @@ -257,7 +257,7 @@ extern u32 vmx_vmentry_control;
>  #define SECONDARY_EXEC_XSAVES                   0x00100000
>  #define SECONDARY_EXEC_TSC_SCALING              0x02000000
>  #define SECONDARY_EXEC_BUS_LOCK_DETECTION       0x40000000
> -#define SECONDARY_EXEC_NOTIFY_VM_EXITING        0x80000000
> +#define SECONDARY_EXEC_NOTIFY_VM_EXITING        0x80000000U

... here. May I ask why that is? (I'm not opposed, but the
description suggests otherwise.)

> --- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
> +++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
> @@ -136,7 +136,7 @@ static inline void pi_clear_sn(struct pi_desc *pi_desc)
>  /*
>   * Exit Reasons
>   */
> -#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000
> +#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000U
>  #define VMX_EXIT_REASONS_BUS_LOCK       (1u << 26)

Along the lines of the latter, perhaps switch to 1u << 31?

> @@ -246,15 +246,15 @@ typedef union cr_access_qual {
>  /*
>   * Access Rights
>   */
> -#define X86_SEG_AR_SEG_TYPE     0xf        /* 3:0, segment type */
> -#define X86_SEG_AR_DESC_TYPE    (1u << 4)  /* 4, descriptor type */
> -#define X86_SEG_AR_DPL          0x60       /* 6:5, descriptor privilege level */
> -#define X86_SEG_AR_SEG_PRESENT  (1u << 7)  /* 7, segment present */
> -#define X86_SEG_AR_AVL          (1u << 12) /* 12, available for system software */
> -#define X86_SEG_AR_CS_LM_ACTIVE (1u << 13) /* 13, long mode active (CS only) */
> -#define X86_SEG_AR_DEF_OP_SIZE  (1u << 14) /* 14, default operation size */
> -#define X86_SEG_AR_GRANULARITY  (1u << 15) /* 15, granularity */
> -#define X86_SEG_AR_SEG_UNUSABLE (1u << 16) /* 16, segment unusable */
> +#define X86_SEG_AR_SEG_TYPE     0xfU       /* 3:0, segment type */
> +#define X86_SEG_AR_DESC_TYPE    (1U << 4)  /* 4, descriptor type */
> +#define X86_SEG_AR_DPL          0x60U      /* 6:5, descriptor privilege level */
> +#define X86_SEG_AR_SEG_PRESENT  (1U << 7)  /* 7, segment present */
> +#define X86_SEG_AR_AVL          (1U << 12) /* 12, available for system software */
> +#define X86_SEG_AR_CS_LM_ACTIVE (1U << 13) /* 13, long mode active (CS only) */
> +#define X86_SEG_AR_DEF_OP_SIZE  (1U << 14) /* 14, default operation size */
> +#define X86_SEG_AR_GRANULARITY  (1U << 15) /* 15, granularity */
> +#define X86_SEG_AR_SEG_UNUSABLE (1U << 16) /* 16, segment unusable */

How is this change related to rule 7.2? There are u suffixes already where
needed (and 0xf and 0x60 don't strictly need one), so there's no violation
here afaict. A mere style change to switch from u to U imo doesn't belong
here (and, as mentioned while discussing the rule, is imo hampering
readability in cases like these ones).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 08:05:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 08:05:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559745.875014 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJzT-0007pO-LR; Thu, 06 Jul 2023 08:05:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559745.875014; Thu, 06 Jul 2023 08:05:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHJzT-0007pH-IY; Thu, 06 Jul 2023 08:05:27 +0000
Received: by outflank-mailman (input) for mailman id 559745;
 Thu, 06 Jul 2023 08:05:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHJzR-0007p2-PB
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 08:05:25 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20625.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::625])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dc5c2aa1-1bd3-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 10:05:24 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VI1PR04MB6912.eurprd04.prod.outlook.com (2603:10a6:803:134::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 08:05:23 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 08:05:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dc5c2aa1-1bd3-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CRa08L/OsIoanHLBe/sMM65gEvbEtleH9tWEHUcDL+ZwnRj4D4FmgQPzTYrW9ob2sJQZ403a/IEc5hhfPo0n8od8yuRWW4x2CF2k/Bvywv/t5Zt2puUbbzB5wh2XF6QB1rinJskAlV9LGPWu/QmG4vcviiC3Gp9s+ZLM/WrxH9YRD4t0S6M+hAjQTap4DfRY+7jEjV8pJPtnnS80dxWt+qlbTZoblDKX4P+qYhp0kcC+7TKyzIfR/KNwZj6xnOzjm1Ra8nXlJkiuo44lKgL8wovVcMirlIB9QAwpbvEoU3W68+x4Zj3hXO5PSHJpP/1OHYJFCv3D1UFNvmmKaUujTQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=PffBXkoKNZD3aGEzj7kMg9mzXoHV2+hn7WAjxl3Lwe4=;
 b=jinAmZNteTnDZ0wvaSr/AO/ylFO9XO6M3ZMoY2FPU+nPfeHhgJ2lAnYlwQrKz3aRw77vEreYZMhwRiAOsvKms0pgrv12GzvdSpAQlKnkLF59snYzw7vXj82/mqY97Fp6NaZs8WVcU8l3j50g5tDgm9TSsidvbxygZTCkQPuU1kY+lyfzWf9hEvHFmN/RYFdsOjx9QDlet94tnfAegRAs6oyqrq+Y1FP8RWlNFEGG2+O89nuicDEP5BLlR2Q33DwKORkXi/cOYl+CY4CeLhcr8fI6DC2jZ8ZuSAVLICj3Owk9Uyhqu8tDx0jMF7XF5FpE0Yx4DLVsp44Omxk5oJpTJg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=PffBXkoKNZD3aGEzj7kMg9mzXoHV2+hn7WAjxl3Lwe4=;
 b=sLyLkbQMB46zcL/Ob1kurzsxapU8V58jlCwT0m68lteMfRAqiFPWH1tKf557ZKSrGE1BunvQcVzmbSge6UJPxxhLmdQiWoyJEM+E4vPV2Q/q+Y1xah8ZE3c/m1qKzAZYj+pU2081+qtfOPyuByoy4lNB3XHiUPlEMkXQRkpC5tvuUS1kPpCvLOw17LFetwkqi6S7v+Ux8ckN9VqRRdOJvcOwgLspY+zbeJn8h2yrqf6q1tg+3Hc+v2AZNZJU4ugiMngMWxA2t/QVDfg7+IJD6uywo1vg8ShpPmqFOb/uJDKbaH/Mv4siAIziM243z6nMe4tHoFLm4OBWu1ih4bGMJg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <701c4207-503a-1597-35aa-2fa4c427f7d3@suse.com>
Date: Thu, 6 Jul 2023 10:05:21 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 08/13] xen/pci: fix violations of MISRA C:2012 Rule
 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Paul Durrant <paul@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <b921f7a9a13475da9fe4c71b5cf7173bab55b439.1688559115.git.gianluca.luparini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <b921f7a9a13475da9fe4c71b5cf7173bab55b439.1688559115.git.gianluca.luparini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0160.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:99::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VI1PR04MB6912:EE_
X-MS-Office365-Filtering-Correlation-Id: 7aae739d-0d76-45c5-e3b0-08db7df7bfb5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	NtCOqSLk/CFZChL1zE2J8+N8/22Qe294BB7803njU5eApX+NnJZgZIVOHLsw0zizZHESx/3L9N69HblIzfuN8jFt9tHiCRRN5STTLTt0IfUuWoz/ffcjxdQqpXKdpueu8sRya1o7fSJO6zEdAjIa4dHsfke9QNA995or0PX6V54uw29IuQytZjMEdjerpacIonzPlamrTqZ2J5iiXcESEjQKgZzxBeQdhX+ipycsQpap457HSjcZ8klWgJKINv3lZsp99u6iUn1hHlUr9Gd4QjBFYX2z+SiNKtbhhA7/GysGSuzO0lG9hWnTN5dYiCZ4PIOBWjRjVAOCJLBB+A/3xRq8ZXh4mzD5m0Ok5A0BOS1koueiZuHYHyJ0ECFP79HGjtROetCSt7+oIO1UEcBO4uKg8Kt8WA2ZCrNcaG4X5QZ9kwhLHsF+ApD+ZDhQRy5N5d8rfJS68Udrcw0XGNXdxkJt5N56bOfP0k0y+BTg2Qxn50y9YUKXNk+3ysMNaNrVYMDB3CnPQBq8CY2AfLXUBwaDGpCl8j2iGJBz2yV59VcQLtbsMIYMo1Fh/cKLs7VQM9BKhcZQvOy534UC8ZHCpqqg92rJOyeQWRIfHbPwXehal1MH5lR6qMCSK4IeltlDE1TrtSxNQMeTgk1OPNV0kg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(366004)(376002)(136003)(346002)(451199021)(4326008)(186003)(478600001)(6512007)(26005)(6506007)(53546011)(31686004)(86362001)(66476007)(2616005)(316002)(83380400001)(38100700002)(54906003)(6486002)(66556008)(6916009)(66946007)(5660300002)(7416002)(8676002)(8936002)(4744005)(41300700001)(2906002)(31696002)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TW05eDIwQ1dYNE14ZEV5dys0aGZwRGVsMEk0eURVam9CYzhsMXd5K0ltcVFa?=
 =?utf-8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ZHZBVFRGbUtNRXQ2N3dq?=
 =?utf-8?B?RllDVUhTY3Y2SzZvZFg5VDE3amJaaDIvdHhES2R5ZzNaUWYvdFVIanVQaEIw?=
 =?utf-8?B?NXBwZTZHbmVyQld2a29tWTNvQ0hyNWVhaVFEVklicko0VGd1dHNXMnlpemRS?=
 =?utf-8?B?UUlab0YrNUxWb3pvdkdhcXlSb3hKaFpBWXZiV1NZcmZQM25LeWwvRUpoUWdm?=
 =?utf-8?B?N3VzOHdSN3FEQkdGU2p1emo1dkh2Z1VGUzI4RTl0S29yd01PODIxVHhnZFlG?=
 =?utf-8?B?VjhseXBlVTRoTk5LZFFPdzdjTVNZWVE1TmpRakZZU0x2blNjZktJOEI5Sm5R?=
 =?utf-8?Q?xMCt6nf2NWRXzdYEjbybroQEo?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7aae739d-0d76-45c5-e3b0-08db7df7bfb5
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 08:05:23.0928
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: jsGurzZWLRUtwMC9SZ9NQPZyGY7vZX7HDpNx7QSbt00HFqQ1QB+wZnhl0IBPV3T95rYkjWKZJKysHGI92GH/Tg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6912

On 05.07.2023 17:26, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type and also to other
> literals used in the same contexts or near violations, when their positive
> nature is immediately clear. The latter changes are done for the sake of
> uniformity.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Thu Jul 06 08:07:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 08:07:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559750.875025 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHK1J-0008Qz-21; Thu, 06 Jul 2023 08:07:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559750.875025; Thu, 06 Jul 2023 08:07:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHK1I-0008Qs-US; Thu, 06 Jul 2023 08:07:20 +0000
Received: by outflank-mailman (input) for mailman id 559750;
 Thu, 06 Jul 2023 08:07:20 +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
 <SRS0=dPu9=CY=linuxfoundation.org=gregkh@srs-se1.protection.inumbo.net>)
 id 1qHK1I-0008Qm-9K
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 08:07:20 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1eebcc83-1bd4-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 10:07:17 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 9D2FB61701;
 Thu,  6 Jul 2023 08:07:15 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DD56C433C8;
 Thu,  6 Jul 2023 08:07:14 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1eebcc83-1bd4-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org;
	s=korg; t=1688630835;
	bh=iNI/V0FUmVFi1ifs3C8XNjXKbihtOUYD+TDijCk37HE=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=OB+27qMDSzSjagtWO3H4twriHs6EnYntX7f3TliqB+th2ekfBwodAiGjyoiF52+0o
	 SDWo0DcO9dd1onHNcAuM7KPg9vg1oxEShO52NsmMLe5nM7cg41BHSJXYx+G0uAVF8v
	 PtEyANTWI23BraWaPOeLX69jQfpIO3MWHj2Wyu5E=
Date: Thu, 6 Jul 2023 09:07:12 +0100
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Michael Kelley (LINUX)" <mikelley@microsoft.com>
Cc: Petr Tesarik <petrtesarik@huaweicloud.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>, Jason Gunthorpe <jgg@ziepe.ca>,
	Kees Cook <keescook@chromium.org>,
	Saravana Kannan <saravanak@google.com>,
	"moderated list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>,
	"moderated list:ARM PORT" <linux-arm-kernel@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:MIPS" <linux-mips@vger.kernel.org>,
	"open list:XEN SWIOTLB SUBSYSTEM" <iommu@lists.linux.dev>,
	Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	"petr@tesarici.cz" <petr@tesarici.cz>
Subject: Re: [PATCH v3 4/7] swiotlb: if swiotlb is full, fall back to a
 transient memory pool
Message-ID: <2023070626-boxcar-bubbly-471d@gregkh>
References: <cover.1687859323.git.petr.tesarik.ext@huawei.com>
 <34c2a1ba721a7bc496128aac5e20724e4077f1ab.1687859323.git.petr.tesarik.ext@huawei.com>
 <BYAPR21MB1688AAC65852E75764F53099D72CA@BYAPR21MB1688.namprd21.prod.outlook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <BYAPR21MB1688AAC65852E75764F53099D72CA@BYAPR21MB1688.namprd21.prod.outlook.com>

On Thu, Jul 06, 2023 at 03:50:55AM +0000, Michael Kelley (LINUX) wrote:
> From: Petr Tesarik <petrtesarik@huaweicloud.com> Sent: Tuesday, June 27, 2023 2:54 AM
> > 
> > Try to allocate a transient memory pool if no suitable slots can be found,
> > except when allocating from a restricted pool. The transient pool is just
> > enough big for this one bounce buffer. It is inserted into a per-device
> > list of transient memory pools, and it is freed again when the bounce
> > buffer is unmapped.
> > 
> > Transient memory pools are kept in an RCU list. A memory barrier is
> > required after adding a new entry, because any address within a transient
> > buffer must be immediately recognized as belonging to the SWIOTLB, even if
> > it is passed to another CPU.
> > 
> > Deletion does not require any synchronization beyond RCU ordering
> > guarantees. After a buffer is unmapped, its physical addresses may no
> > longer be passed to the DMA API, so the memory range of the corresponding
> > stale entry in the RCU list never matches. If the memory range gets
> > allocated again, then it happens only after a RCU quiescent state.
> > 
> > Since bounce buffers can now be allocated from different pools, add a
> > parameter to swiotlb_alloc_pool() to let the caller know which memory pool
> > is used. Add swiotlb_find_pool() to find the memory pool corresponding to
> > an address. This function is now also used by is_swiotlb_buffer(), because
> > a simple boundary check is no longer sufficient.
> > 
> > The logic in swiotlb_alloc_tlb() is taken from __dma_direct_alloc_pages(),
> > simplified and enhanced to use coherent memory pools if needed.
> > 
> > Note that this is not the most efficient way to provide a bounce buffer,
> > but when a DMA buffer can't be mapped, something may (and will) actually
> > break. At that point it is better to make an allocation, even if it may be
> > an expensive operation.
> 
> I continue to think about swiotlb memory management from the standpoint
> of CoCo VMs that may be quite large with high network and storage loads.
> These VMs are often running mission-critical workloads that can't tolerate
> a bounce buffer allocation failure.  To prevent such failures, the swiotlb
> memory size must be overly large, which wastes memory.

If "mission critical workloads" are in a vm that allowes overcommit and
no control over other vms in that same system, then you have worse
problems, sorry.

Just don't do that.

thanks,

greg k-h


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 08:07:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 08:07:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559753.875035 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHK1k-0000Ue-9F; Thu, 06 Jul 2023 08:07:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559753.875035; Thu, 06 Jul 2023 08:07:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHK1k-0000UX-62; Thu, 06 Jul 2023 08:07:48 +0000
Received: by outflank-mailman (input) for mailman id 559753;
 Thu, 06 Jul 2023 08:07:47 +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 <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHK1j-0008Qm-0d
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 08:07:47 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on20609.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::609])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 30436f51-1bd4-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 10:07:45 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB7696.eurprd04.prod.outlook.com (2603:10a6:102:f1::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 08:07:43 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 08:07:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 30436f51-1bd4-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=kiWkJ536bqj5oN3/lG0/t54Z4hBP+yHy4IWOIL6H/pC/f8B/tE/+9cRNeNW2yh31LgOXwqZXmG6TiJGi9ute1WfXTvIXNAD9AnuBM1tZCFhy9nb2pL3mfp/48ip3dKV4yhucxrRc4/o97VkwOFA/LCukX3rqLVKF0t4U4UT/nIdez5hdOHcxn1nxDx9Pg3hALAN8fTGc3qozkaAfQOl92UGh6ASJw6vZUO3SkWd4+2uW5aIRuMoVEVefh4bQoHO8KjRA93oJCF0XrtpL0PJiVZ4WfdMX50/yPJgSFbx0QYwlGwFUpGjN/5KfAnMg/MsSbJ+u83f7BevTHFGrPBzIQA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=tFZoEIrQU47U0K+QZ8IYQiWuvPurugmP0N4JzpVB1w4=;
 b=nLSnzDlQtvaRPBDnWEcnzzm1M5RoJcqii/XxI3qmdqSmajsFpWhxX5m+1aICBYs+GdsfJhLDGKYzP4OIuD/p05SXBmBpVMiUhsqGTe4q5Xk55hdpWbuw/90xzE7rfwsNSFXgYOrYDjtfOGs67n7WVG0ng4EjU4xLKr8Je7iOlrHrKApcLSxNEcht5rX5mY1PjdZ/mFEbmCJTTlPnIURkD/MR+mXXJj5BBhVR4VectIsALLJ162fdeifYvcezMhoBc1/a8Mvsa23hDiO+V3ulvvpcZJ2wGgFbAqTvwwTbKkozz2rs5y1YirUHyKa3rme9DyJbO21QRao8mvC8DvVF8w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=tFZoEIrQU47U0K+QZ8IYQiWuvPurugmP0N4JzpVB1w4=;
 b=dLIbJs6e+XRBuslkahpy4zazHPFB3p1h3xNWYT7kcJiT7YLv9e6qnw9NvtsN8fuCI8GiPqEAgrDFtV60JI+LnrFJIbJcH5bxaktzxaDqfBVtsMIhrHfG4D9n339/LdLsY5iqLG9XtT4usLvYEDaMHthECyO56X17camQ01KjZDEn7LEFAgeUvyqgiZhigccLKXUjgHY+YLy0XqlkUlkULKcW+mPVj6gSUroN4JqS79fPDufAXsA1yk9ixJY2VDB/VluHNHR0pS5JieIq+jjgf2OZK9waJ1nk/xUOXc6H08AB/TlDNwVTyCjzoJKyP9B//j3V1061NziLFnXRHga3Ew==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <32017fef-dc47-0c8e-f51d-f3c1de5deede@suse.com>
Date: Thu, 6 Jul 2023 10:07:41 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 11/13] xen/vpci: fix violations of MISRA C:2012
 Rule 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <4b4fad089f8fc85db19b33524ea6b14b1aef7cbb.1688559115.git.gianluca.luparini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <4b4fad089f8fc85db19b33524ea6b14b1aef7cbb.1688559115.git.gianluca.luparini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0147.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:98::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB7696:EE_
X-MS-Office365-Filtering-Correlation-Id: d630b9f2-7e0c-4c91-403c-08db7df8136e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	sMhQwF96Y24lZtNZeFvamv2xpo255DkfABw6g8LgEyVFkl4jlSdYq3+78t7clPUkXKT2mcA5dsdiHE8RawSZgdFmlSyy9m0FETRh+KZVQGnL0Lv5cZrGeTFs4+UBdqjCqCoPG9tIbXv7t+9pxXBz6Yc0F7NSvnijISW40fLMxIfLAokkk8HU1IbaQ4CYUsId8k17EF8jxFX81TlgEwipTpR3KlapzUSEVM0gnDCuSH7CSJebmwHRN6V/MToaIpwUAV3VkrLQgb1S7NHVieEJFpdNbshiSJmcggdW9WaP60Ar2vVYC/tKSlYUwyogFjdLeSww9q7aWqoc7i5HX9n4Sa0MozNrnc+/Z/zjEeUmOoTtEnwJPCe71EHNkH+K+qFak3XhdLxefOFasZ6ocDupJqmOMP6NoWO/3d82Tk1Ei3c4xIG3qunCG2KXYDch110JNwBpV5V/xHKRFrMdE5ahOZZBId36GWnd1Fi1lmbFrWz6uHufyepf0v4+Y+GS4ZV6aRzRbiYpGnSsrOxdYZA1sUVXGcqVCgZCVaa/v8P3SRWqwwLzKbQmXAgC0jxpuYqagYvKqAh8gnWDYISJn9pm1Ogo25InTfIhGMbgxH+CxeHj/5Kmcewq9xvMBdS3SMr2juOKAB4gUg/ChF++zEOyWg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(346002)(376002)(396003)(39860400002)(366004)(451199021)(38100700002)(478600001)(6486002)(54906003)(26005)(53546011)(186003)(6506007)(2906002)(66946007)(4744005)(6512007)(6916009)(41300700001)(66476007)(66556008)(316002)(5660300002)(8936002)(8676002)(4326008)(36756003)(86362001)(83380400001)(2616005)(31696002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SWg1U2Z3aTFiRVZjRDNaOEpQTHpDSlRPUmhodWtoYXlzckZpNXZiandOK2c0?=
 =?utf-8?B?Zm8vU1VwcEp4SFZLeFhIMHd1R2JrbFNGR001dnBuWFdEZWhaTEZETjVyU0Mx?=
 =?utf-8?B?S0xWQU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utf-8?B?RTl5OFl1ZjBSc3RBT2E4QXAyeisva3lRenZuYmhMOHhRZE9aU2ZDdHcxM2dl?=
 =?utf-8?B?em9EUldPS1BsWkYvaU1FRlJxN0N3RkRPb2hvS2VYRHA0NVFPZHkvK3JtTjBL?=
 =?utf-8?B?RkwrQ2NGZXVwQjBHazYyb1czbW5FVVdNcmZGUDZacHdzTEtQTmt5RDA1d1dv?=
 =?utf-8?B?TUNzS0piVTRIT3J0U0J6THZWS3k4T3JwSnNZdEd2NU5NWTBHZzhCQmVWeEZT?=
 =?utf-8?Q?x0NfSEj7JE0quYyyRAf2uXcMh?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d630b9f2-7e0c-4c91-403c-08db7df8136e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 08:07:43.5713
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: K1wkLf3PHKkpDY/ll2iaEVvc0A4hEnVPz1GhiLNKABEgxVcLUUpEgyQP6jgNJ5R+eCpkZ7Gc2wEDN/JGHaVowA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7696

On 05.07.2023 17:26, Simone Ballarin wrote:
> --- a/xen/drivers/vpci/msi.c
> +++ b/xen/drivers/vpci/msi.c
> @@ -124,7 +124,7 @@ static void cf_check address_hi_write(
>      struct vpci_msi *msi = data;
>  
>      /* Clear and update high part. */
> -    msi->address &= 0xffffffff;
> +    msi->address &= 0xffffffffU;
>      msi->address |= (uint64_t)val << 32;

Along the lines of the comment to an earlier patch and considering that
a cast to uint64_t is already present here, I again wonder whether
switching to casting to uint32_t wouldn't be the better change.

> --- a/xen/drivers/vpci/msix.c
> +++ b/xen/drivers/vpci/msix.c
> @@ -531,7 +531,7 @@ static int cf_check msix_write(
>  
>      case PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET:
>          entry->updated = true;
> -        entry->addr &= 0xffffffff;
> +        entry->addr &= 0xffffffffU;
>          entry->addr |= (uint64_t)data << 32;
>          break;

Same here then.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 08:08:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 08:08:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559758.875045 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHK2k-00014d-Hy; Thu, 06 Jul 2023 08:08:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559758.875045; Thu, 06 Jul 2023 08:08:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHK2k-00014W-FM; Thu, 06 Jul 2023 08:08:50 +0000
Received: by outflank-mailman (input) for mailman id 559758;
 Thu, 06 Jul 2023 08:08:49 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qHK2j-00014M-MX
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 08:08:49 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHK2j-0002u7-48; Thu, 06 Jul 2023 08:08:49 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHK2i-0007CK-UJ; Thu, 06 Jul 2023 08:08:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=wi+CY5hp1ZexLwyeibtj/Eu1V6QpPqKpCLFWMgelhMA=; b=kNxUKcKbJJgscati7BY2rfXQzM
	JCNEEf54Ui8eLXs6xspYO1YvBED9DcMfZWn8CH3Vdt30TIBlwzNoOTerZFarLWsts409tzr04/JxZ
	KdAMLbuKP/RAZpIixXbPanVXZIHeWI1D7UmugDaaa0CTFvbP0y3gIlTaBu4TALUGfPbQ=;
Message-ID: <d64d1ba6-7826-bc75-e8f1-ac597aa675e2@xen.org>
Date: Thu, 6 Jul 2023 09:08:47 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 10/52] xen/arm: Move MMU related definitions from
 config.h to mmu/layout.h
Content-Language: en-US
To: Penny Zheng <penny.zheng@arm.com>, xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-11-Penny.Zheng@arm.com>
 <ee493a26-234c-876e-e19f-3708c13cb484@xen.org>
 <02cc1edb-1f69-7fd3-a057-e5b04d2e14f4@arm.com>
 <d2c0d251-8b10-c211-48ee-ce547aacbe91@xen.org>
 <f731455a-0639-d0fb-62cc-544347ce6e1d@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <f731455a-0639-d0fb-62cc-544347ce6e1d@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Penny,

On 06/07/2023 08:36, Penny Zheng wrote:
> Hi Julien
> 
> On 2023/7/5 18:30, Julien Grall wrote:
>> Hi Penny,
>>
>> On 05/07/2023 07:51, Penny Zheng wrote:
>>> On 2023/7/5 05:54, Julien Grall wrote:
>>>> Hi Penny,
>>>>
>>>> On 26/06/2023 04:34, Penny Zheng wrote:
>>>>> From: Wei Chen <wei.chen@arm.com>
>>>>>
>>>>> Xen defines some global configuration macros for Arm in config.h.
>>>>> We still want to use it for MMU systems, but there are some address
>>>>
>>>> Did you mean MPU?
>>>>
>>>
>>> yes, typo
>>>
>>>>> layout related definitions that are defined for MMU systems only.
>>>>> These definitions could not be used by MPU systems, but adding
>>>>> ifdefery with CONFIG_HAS_MPU to gate these definitions will result
>>>>> in a messy and hard-to-read/maintain code.
>>>>>
>>>>> So we keep some common definitions still in config.h, but move MMU
>>>>> related definitions to a new file - mmu/layout.h to avoid spreading
>>>>> "#ifdef" everywhere.
>>>>
>>>> Just to ease the review, can you add some details which one are 
>>>> considered common?
>>>>
>>>
>>> Sure,
>>> IMOï¼Œ the only part left in common is as follows:
>>> ```
>>> #ifdef CONFIG_ARM_64
>>>
>>> #define FRAMETABLE_SIZEÂ Â Â Â Â Â Â  GB(32)
>>> #define FRAMETABLE_NRÂ Â Â Â Â Â Â Â Â  (FRAMETABLE_SIZE / sizeof(*frame_table))
>>>
>>> #endif
>>> ```
>>
>> Hmmm... Looking at the result of the patch, you moved FRAMETABLE_SIZE 
>> and FRAMETABLE_NR in layout.h. Also, I can't find any layout specific 
>> define in config.h. So I think the paragraph could be dropped.
>>
> 
> That's because I define this same snippet in both mmu/layout.h and
> mpu/layout.h, see [PATCH v3 23/52] xen/arm: create mpu/layout.h for MPU 
> related address definitions.
> So it is common for both mmu/layout.h and mpu/layout.h.
This is different from what you wrote in the commit message:

"So we keep some common definitions still in config.h"

 From the perspective of this patch you moved everything related to the 
layout in mmu/layout.h. Whether there might be duplication in the future 
is a different subject.

In this case, I would prefer the duplication because the size of the 
frametable really depend on how you configure the layout. So it should 
stay close the rest of the defines.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 08:17:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 08:17:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559765.875055 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHKAw-0002hc-Ht; Thu, 06 Jul 2023 08:17:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559765.875055; Thu, 06 Jul 2023 08:17:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHKAw-0002hV-Eb; Thu, 06 Jul 2023 08:17:18 +0000
Received: by outflank-mailman (input) for mailman id 559765;
 Thu, 06 Jul 2023 08:17:16 +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
 <SRS0=eqJS=CY=citrix.com=prvs=54431dde5=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qHKAu-0002hP-Cj
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 08:17:16 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 81e18d78-1bd5-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 10:17:13 +0200 (CEST)
Received: from mail-mw2nam12lp2049.outbound.protection.outlook.com (HELO
 NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.49])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 06 Jul 2023 04:17:08 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB5744.namprd03.prod.outlook.com (2603:10b6:a03:2df::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 08:17:06 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::1c83:1877:a68b:8902%7]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 08:17:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 81e18d78-1bd5-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688631432;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=dwWhS+OHpuH7onc023wGBQr4L5EfDSMSVWZz56h4F+w=;
  b=EflIu12mnWynT4Muxf0COKJGqjDMurDBCsSwpEqiwK1Zs8Nd+GjLvUr0
   C+rKpZZGDOrg0gWCIfLDdrbwFpWM72lwzc9P4iTvqKJzMMEIHUQ7NbC5a
   2DwPItVNLcLonMQjdOGe2rre3lUgRpBwOMH3U8elnQTHypfbVfMBPXeFf
   o=;
X-IronPort-RemoteIP: 104.47.66.49
X-IronPort-MID: 117897198
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:wZwIganq+rDK5RMIwqAVeuDo5gzIJkRdPkR7XQ2eYbSJt1+Wr1Gzt
 xIZWGuOMvvcMzHyetl1OY++8UoDvsKDm4A3QQQ6rC4wHyMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5AGGzhH5MbpETU2PByqgKmVrNrbSq
 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/
 f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3
 b88LTEEXyyBvaW3yurqRONd1+h8K8a+aevzulk4pd3YJdAPZMmZBoD1v5pf1jp2gd1SF/HDY
 cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVklI3jOmF3Nn9I7RmQe1PmUmVv
 CTe9nnRCRAGLt2PjzGC9xpAg8eWxHyrCd1LRe3QGvhC2AyQnkEtLSIqTlqphtyk0WjufohbN
 BlBksYphe1onKCxdfHmRAGxqnOAuh8aWvJTHvc85QXLzbDbiy6eAmUHVSJQc9wOu8o/RDhs3
 ViM9/vrCiZoq6a9Um+G+/GfqjbaES0cN2oLfyIHZQoD/dj4oYs3gw7PT9BsC6q8hJv+HjSY6
 xeOoSsljrMfl/k3xr679lDKhTGrjpXRRwtz7QLSNkq94x9jIpaseYi1wUPG9vsGJ4GcJnGRs
 X5Bl8WA4eQmCZCWiDfLUOgLBKuu5fuOLHvbm1EHN50g8Sm9vn2uZ4Zd5BlgK0pzdMUJYznkZ
 AnUoww5zIFSP2GjaOl4apixFM0u5aHlGZLuUfW8UzZVSp14dQvC+T40Y0eVhjrpiBJ0zfB5P
 oqHe8GxC3pcEb5g0De9W+Ya1/ks2zw6wmTQA5v8ynxLzIajWZJccp9dWHPmUwzzxPrsTNn9m
 zqHC/a39g==
IronPort-HdrOrdr: A9a23:QrgGfq7A2YlwAb5tiAPXwAzXdLJyesId70hD6qkQc3Fom62j5q
 WTdZEgvyMc5wx/ZJhNo7690cq7MBHhHPxOgbX5VI3KNGXbUQOTR72KhrGSoAEIdReeygZcv5
 0QCZSXCrfLfCVHZRCR2njFLz4iquP3j5xBnY3lvhNQpZkBUdAZ0+9+YDzrdXFedU19KrcSMo
 GT3cZDryrIQwVtUizqbkN1OdQqvrfw5evbXSI=
X-Talos-CUID: 9a23:FqUziG39UO/DOvdTwoa4b7xfWeQgc3Ts8HXqZE6yUTdnQozEZQCX9/Yx
X-Talos-MUID: =?us-ascii?q?9a23=3ATqFSNgwOjQmEPGqZGoOOOpIAfjGaqPz/Cxggr7A?=
 =?us-ascii?q?5h9KFJwtVJmy73BHtRpByfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,185,1684814400"; 
   d="scan'208";a="117897198"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=NlfysLimKAF6NbirKNIGaWhnU07ITXIjwyARK7Ek9UsMTMrVQ1oh/X+sS4klUMcBEz8CQ0wMpcfl+FUH7Tdv6f/C6C5Ur+UjeC6qj/5S3dM985Hp1USiLKU4JF3RWZI70Uh0FS/fSlfgTpXK48cR2Mq9g6bNmepE1Z/+OAf6/trs3/xZsI8DFKc6gfM1K6fTPxsn5+7rXFOIp8Q7iCKcDsOCnc/WjiNDuF02bw14/CKCGGvU1isDI6gIPAiMLvDTb4jcs6mNwR3QGU+JDvVk0v3lPolLbG7xTr6RrVONpsYpsk0tNyLYQhq+/qfjDCf9aKiWEZEUYxiqhdZfrpp7dA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Ebr3eL0nExbOnagfNqFlIad5XC9VJWJ+dIUg48dt3K8=;
 b=EJq1yjsYdQnpJJaZFj1hmLB5rVPg9jb9Omu454ffJmFLX/nIVfG1Cc6cQEMxDeJAVVukGxoT7RP1umnch14W0RXUiFOS01D98Rp9Egih8ppXNwo4vkM1p1UyOlnp+B1EDVx66MV6xOROdL9Z/pZAXBNyhFxOBXbwz2+j2nu/ofvI5wDYyXcZPEEaJHLmer81V+dygHyTJqXEr7+rF0apgaQsk8HO7j8cbwfwBpIGkP+XtkwVhP9l0wI4CcvwPbjbDvpOCp91r0vid7VjnSPZpIgN52JtdltQooYOXX9w3yDQa7ID7KoPX12xkcAkV9Y3XSu6OkT7ykgSCwft2Y83qg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Ebr3eL0nExbOnagfNqFlIad5XC9VJWJ+dIUg48dt3K8=;
 b=ck/B7MlIY/JDg436ihf5b0DFc9Q5Gd5s7gBVKWiUC/aN4X1ksvKm5isNzRrNQJ59RUJHn8SXZmQ4p9RBK8vz+7RNBxX6oUSBnGG1qGJDUtgN+nnyH3hEWdYE9qY/+FbzpKqkzCOc+ay+8Bq7QT0g36vCsItxY5rTpxviha72kzc=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Thu, 6 Jul 2023 10:17:00 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Oleksandr Tyshchenko <olekstysh@gmail.com>,
	Juergen Gross <jgross@suse.com>,
	Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
	Petr Pavlu <petr.pavlu@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	vikram.garhwal@amd.com
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
Message-ID: <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
References: <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
 <b21398eb-2fb2-4fca-dd90-d2c81d8df1c4@epam.com>
 <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop>
 <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>
 <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com>
 <ZKQF8qq8Oh5E+Fxx@mail-itl>
 <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
 <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
 <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
X-ClientProxiedBy: LO2P265CA0501.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:13b::8) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5744:EE_
X-MS-Office365-Filtering-Correlation-Id: c4740fa4-fcb0-4cc2-d814-08db7df962e6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	vP8vKvKWP6EO3pCtJRFvQL0IfMni4IHInhavu5Wp0ISy1DN+xbSGjQU3Rx2LdG3HhzY0XeaVQ/hrZns3ch7NYZjvCWKXidvwoF40kAoK9P/P86/j+XjMcuAr7Ru1Q3Xas8fMhrkA3lHtYR0CBGLd3XS1r44/JG8LCWRF2Ir2k2LmHGFxP6OvW/v4t4orIZDbDKjeApuANdcOnzNSpiIeaARSiiq6/sQ+52XzXJa8sTe7e0UsQpG/We+kFXdvmpn/n7yCN8W+od/P9jL+R9QU1xeadeAbKCKVfod8WErFMHVEtgVfNxaxRKTojOFBvay/mEghFvKZd2LL0fAcAiB3OIm7j0J/1e4h1nBrT5YHTjbqK164Hq5PLVEIAMNTcB7Ju71KcTa/tpW78C6p11j1NHJTUcNNMV7hOW2ZxGFTfsL5Hf3oayzmrYOvwd+Op+HM2Ftj65/SJMmvHyYNuotZGGUlMSD2jMsMmiNcoRC7NzfYCJRbAw3/gUNr3juZYTGG2ipVB+auCsKijAR7qWBpoIa7jNyP0zsA284chTg6jV+JUd5Ly3RGlcryJwd1uD8B
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(396003)(346002)(366004)(376002)(451199021)(85182001)(86362001)(5660300002)(2906002)(66899021)(6512007)(38100700002)(186003)(83380400001)(26005)(9686003)(6506007)(6486002)(82960400001)(54906003)(66556008)(4326008)(6916009)(66476007)(66946007)(316002)(8676002)(8936002)(478600001)(41300700001)(6666004);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Kzh6WG4ydU5FYTNKVVoxdDhETnEzYkxFSDBadUoxVVo3alRaeWU2NlNWaERZ?=
 =?utf-8?B?dXloZjdxTUhCTjAwd0RyU1lJTHNiQlFaWm15YkdvQWdRZW1zM2xpOCtsT2hm?=
 =?utf-8?B?Tzg0a1hOdkw0dWNsZTMvcjFyUU5HaVAyZ25qY1YwWmdDbUtHZFNnelpIcm9Y?=
 =?utf-8?B?dXJMdFQ3eUlFQWZFSFZJdWxJRzJNSkhFRG1xL1VKRVd6TkhEWXdjaTljSUtq?=
 =?utf-8?B?M2kwaHNoSXZoWXMrdWxFR2tPRGFkc2dXRUZWQWFsU1g2bGxIK1VyeHpJWEt5?=
 =?utf-8?B?UGNOMFFxSzJ1V3RPUVFJY3M3THp1R0loekVkS215OGZ5bHhwVUYvQ2R5VC9p?=
 =?utf-8?B?TUgwSWtmV2RSdmRQdVhZdmlMZXdMc3J3SDFyRGRKRWgyTEt3NFczUW5nYi9q?=
 =?utf-8?B?STROR2JXcGlqWkluaDFRTlRsSm8rMXZKZ2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NRUpF?=
 =?utf-8?B?THRRVnd6WjNwT0xTaDYxTm4xZm0vL2hVcTZ3VHNBcE1yVGFJSTZzL1g1c1kr?=
 =?utf-8?B?a3kvN08zNTBoN1dJcjFiTStmNTYvam5vOEtPa2lSMVBUVjN3OEI1TDhSMHRu?=
 =?utf-8?B?bk1hRW1FaHM2ZDFlc0FNMk1yQlJxQTkxK2lSandIalJHWXptWlJSZWRCYWEw?=
 =?utf-8?B?aDU3c29IRDNFUlZPU1VoRktyN3FMMVpacUdBNHVMeEIzYmZwMWlObjExVVhH?=
 =?utf-8?B?SzRDNkZoeDgxWk53TFo1T005V2VYdzNzWUdIdDlVbVQyZUtrME1La0tueEdx?=
 =?utf-8?B?M01ZWWd2cmtKOS9PYWhmcmRIYmN5VHNpM3FnTTNpQ2V0ZEVhaUJSWHQyNEpq?=
 =?utf-8?B?QXFMMmxFbnlIVElFK1VwMWRDTHZZSGlNUTZhMzg1UHpmS3hRUC9ueVRUb2VF?=
 =?utf-8?B?MDlXQ0VWUmw5SENUcDFEdXA0eDdQRkg4VE44WGRPUHRIb1V4WkZmVEZmaEZq?=
 =?utf-8?Q?LaMUdsTsBg/DXDsdSP3rwgKDdgJd/B+OIr?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c4740fa4-fcb0-4cc2-d814-08db7df962e6
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 08:17:06.5662
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: JjnKhky8pjNOBMsV5hgtgUxabY+65jBnkjXmmZ/3Dcmwdo09nv+1E4Ym3BI4ilsuDUqlpZMetM2wEXaadyp7Xw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5744

On Wed, Jul 05, 2023 at 03:41:10PM -0700, Stefano Stabellini wrote:
> On Wed, 5 Jul 2023, Roger Pau MonnÃ© wrote:
> > On Tue, Jul 04, 2023 at 08:14:59PM +0300, Oleksandr Tyshchenko wrote:
> > > **********
> > > 
> > > Part 1 (intro):
> > > 
> > > We could reuse a PCI config space register to expose the backend id.
> > > However this solution requires a backend change (QEMU) to expose the
> > > backend id via an emulated register for each emulated device.
> > > 
> > > To avoid having to introduce a special config space register in all
> > > emulated PCI devices (virtio-net, virtio-block, etc) I wonder if we
> > > could add a special PCI config space register at the emulated PCI Root
> > > Complex level.
> > > 
> > > Basically the workflow would be as follow:
> > > 
> > > - Linux recognizes the PCI Root Complex as a Xen PCI Root Complex
> > > - Linux writes to special PCI config space register of the Xen PCI Root
> > >   Complex the PCI device id (basically the BDF)
> > > - The Xen PCI Root Complex emulated by Xen answers by writing back to
> > >   the same location the backend id (domid of the backend)
> > > - Linux reads back the same PCI config space register of the Xen PCI
> > >   Root Complex and learn the relevant domid
> > 
> > IMO this seems awfully complex.  I'm not familiar with the VirtIO
> > spec, but I see there's a Vendor data capability, could we possibly
> > expose Xen-specific information on that capability?
> 
> That is also a possibility too. Also we could use a PCI conf register
> which is known to be unused in the Virtio spec to expose the grant
> capability and backend domid.

Capabilities don't have a fixed config space register, they are a
linked list, and so capabilities end up at different positions
depending on the specific device layout.  The only fixed part is the
range from [0, 0x3F), and that's fully defined in the specification.

Trying to define a fixed address for Xen use after the 3f boundary
seems like a bad idea, as it's going to be hard to make sure that such
address is not used on all possible devices.  IMO the only way is to
place such information in a capability, whether that's an existing
capability or a new one I don't really know.

> 
> > > Part 2 (clarification):
> > > 
> > > I think using a special config space register in the root complex would
> > > not be terrible in terms of guest changes because it is easy to
> > > introduce a new root complex driver in Linux and other OSes. The root
> > > complex would still be ECAM compatible so the regular ECAM driver would
> > > still work. A new driver would only be necessary if you want to be able
> > > to access the special config space register.
> > 
> > I'm slightly worry of this approach, we end up modifying a root
> > complex emulation in order to avoid modifying a PCI device emulation
> > on QEMU, not sure that's a good trade off.
> > 
> > Note also that different architectures will likely have different root
> > complex, and so you might need to modify several of them, plus then
> > arrange the PCI layout correctly in order to have the proper hierarchy
> > so that devices belonging to different driver domains are assigned to
> > different bridges.
> 
> I do think that adding something to the PCI conf register somewhere is
> the best option because it is not dependent on ACPI and it is not
> dependent on xenstore both of which are very undesirable.
> 
> I am not sure where specifically is the best place. These are 3 ideas
> we came up with:
> 1. PCI root complex
> 2. a register on the device itself
> 3. a new capability of the device
> 4. add one extra dummy PCI device for the sole purpose of exposing the
>    grants capability
> 
> 
> Looking at the spec, there is a way to add a vendor-specific capability
> (cap_vndr = 0x9). Could we use that? It doesn't look like it is used
> today, Linux doesn't parse it.

I did wonder the same from a quick look at the spec.  There's however
a text in the specification that says:

"The driver SHOULD NOT use the Vendor data capability except for
debugging and reporting purposes."

So we would at least need to change that because the capability would
then be used by other purposes different than debugging and reporting.

Seems like a minor adjustment, so might we worth asking upstream about
their opinion, and to get a conversation started.

> 
> > > 
> > > 
> > > **********
> > > What do you think about it? Are there any pitfalls, etc? This also requires
> > > system changes, but at least without virtio spec changes.
> > 
> > Why are we so reluctant to add spec changes?  I understand this might
> > take time an effort, but it's the only way IMO to build a sustainable
> > VirtIO Xen implementation.  Did we already attempt to negotiate with
> > Oasis Xen related spec changes and those where refused?
> 
> That's because spec changes can be very slow. This is a bug that we need
> a relatively quick solution for and waiting 12-24 months for a spec
> update is not realistic.
> 
> I think a spec change would be best as a long term solution. We also
> need a short term solution. The short term solution doesn't have to be
> ideal but it has to work now.

My fear with such approach is that once a bodge is in place people
move on to other stuff and this never gets properly fixed.

I know this might not be a well received opinion, but it would be
better if such bodge is kept in each interested party patchqueue for
the time being, until a proper solution is implemented.  That way
there's an interest from parties into properly fixing it upstream.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 08:23:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 08:23:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559770.875065 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHKH0-0004Ck-72; Thu, 06 Jul 2023 08:23:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559770.875065; Thu, 06 Jul 2023 08:23:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHKH0-0004Cd-3O; Thu, 06 Jul 2023 08:23:34 +0000
Received: by outflank-mailman (input) for mailman id 559770;
 Thu, 06 Jul 2023 08:23:32 +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
 <SRS0=W7Zt=CY=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qHKGx-0004CX-VQ
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 08:23:31 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 62dde4ed-1bd6-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 10:23:29 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.161.201.129])
 by support.bugseng.com (Postfix) with ESMTPSA id D21DD4EE0739;
 Thu,  6 Jul 2023 10:23:26 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 62dde4ed-1bd6-11ee-8611-37d641c3527e
Message-ID: <8d730008-f7ab-20d3-69b1-52a83282e2a7@bugseng.com>
Date: Thu, 6 Jul 2023 10:23:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [XEN PATCH v3 3/3] xen: fix violations of MISRA C:2012 Rule 3.1
To: Jan Beulich <jbeulich@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 "xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
 "ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
 "consulting@bugseng.com" <consulting@bugseng.com>,
 "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
 "roger.pau@citrix.com" <roger.pau@citrix.com>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>, "julien@xen.org"
 <julien@xen.org>, George Dunlap <george.dunlap@citrix.com>,
 Wei Liu <wl@xen.org>, Luca Fancellu <Luca.Fancellu@arm.com>
References: <cover.1688032865.git.nicola.vetrini@bugseng.com>
 <c9ff72160539cda49e726ac6ee1486be0d645180.1688032865.git.nicola.vetrini@bugseng.com>
 <771A1A80-0FC6-4D20-84FE-DA0A2DCFF14B@arm.com>
 <alpine.DEB.2.22.394.2306291218350.3936094@ubuntu-linux-20-04-desktop>
 <ff1a6435-d7ef-eb10-afe2-0fee33788924@suse.com>
Content-Language: en-US
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <ff1a6435-d7ef-eb10-afe2-0fee33788924@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 04/07/23 17:57, Jan Beulich wrote:
> On 29.06.2023 21:20, Stefano Stabellini wrote:
>> On Thu, 29 Jun 2023, Luca Fancellu wrote:
>>>> On 29 Jun 2023, at 11:06, Nicola Vetrini <nicola.vetrini@bugseng.com> wrote:
>>>> --- a/xen/common/xmalloc_tlsf.c
>>>> +++ b/xen/common/xmalloc_tlsf.c
>>>> @@ -140,9 +140,7 @@ static inline void MAPPING_SEARCH(unsigned long *r, int *fl, int *sl)
>>>>          *fl = flsl(*r) - 1;
>>>>          *sl = (*r >> (*fl - MAX_LOG2_SLI)) - MAX_SLI;
>>>>          *fl -= FLI_OFFSET;
>>>> -        /*if ((*fl -= FLI_OFFSET) < 0) // FL will be always >0!
>>>> -         *fl = *sl = 0;
>>>> -         */
>>>> +        ASSERT( *fl >= 0 );
>>>
>>> Iâ€™ve checked the codebase for usage of ASSERT, but Iâ€™ve not seen use of it with spaces
>>> before and after the condition (like our if conditions) so I think they can be dropped.
>>
>> Yes, that's right. I am OK with this patch but I think we should wait
>> for Jan's ack to be sure.
>>
>> An alternative that I feel more comfortable in Acking myself because it
>> doesn't change the semantics of this code would be to change the 3 lines
>> of code above with this:
>>
>> /*
>>   * ; FL will be always >0!
>>   * if ((*fl -= FLI_OFFSET) < 0)
>>   *     fl = *sl = 0;
>>   */
> 
> While I'd be okay with this form, as Luca says it'll get us a different
> violation, which we ought to avoid. While I was the one to suggest the
> conversion to ASSERT(), having thought about it yet once more I'm now
> of the opinion that _any_ transformation of this commented out piece of
> code needs first understanding what was originally meant. Or
> alternatively, while converting to #if form, to add a comment making
> crystal clear that it's simply uncertain what was meant.
> 

About the violation of D4.4: the Directive was never considered for 
compliance because it's an advisory directive, and hence considerably 
less urgent.

Having looked a bit at the surrounding code, since *fl and *sl are used
as array indices later in 'FIND_SUITABLE_BLOCK', I suggest using 
something along the lines of "If *fl ever becomes < 0, reset it to a 
safe value." (either using the form suggested by Stefano or an #if 0).

In any case this should become a standalone patch, right?

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 08:27:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 08:27:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559776.875075 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHKKF-0004oL-Ln; Thu, 06 Jul 2023 08:26:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559776.875075; Thu, 06 Jul 2023 08:26:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHKKF-0004oE-ID; Thu, 06 Jul 2023 08:26:55 +0000
Received: by outflank-mailman (input) for mailman id 559776;
 Thu, 06 Jul 2023 08:26:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHKKE-0004o8-AB
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 08:26:54 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0611.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::611])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dbeffbfa-1bd6-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 10:26:52 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB9510.eurprd04.prod.outlook.com (2603:10a6:20b:44a::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 08:26:49 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 08:26:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dbeffbfa-1bd6-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=WMyAFVtbP7WjBFtGnATtvc5d4RsmuopCFw7y0wovvkvpFEmVMXhEcCnUoZdU71pGnoNQp5aVtKhVGdENgfLgvi+j8UbmEpaasSgbYW5u45rGvAXhNREbztv5bTCmFx6+1gP3TDqB+wF6WEaf6MhtH/1b8svej1YMpGnPhOQVdzoGqfvCejJjuNjw+6NIRb3SWhfRll6EYYeJp1JfZiDRWE/HN0R7RlzeOOpezBtr53ABTY/jKLhQgmjsHdWrXaMNoaqZfj03K6ieQyuJSVWdHIWCxR7U44NZ2rheWoj+C/q57NGL7TCG5gWnnFevEpGin8UwquV0JgOoqMS0eQ/BGg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LAfA0guC5Ov+ZFLS248RHoGYPc6EK5BtnnFn///VmJk=;
 b=OnoC0B5PWDVYx/3KstUCGsyXxwNTTMM0ugzMMNpTUkd7f/b8SQ1roundnLzDx1HI7W+ONNy4Kcm2GdSAqfrzmN+1k0mbsecwcwk5HJzVlE0iWhh2nzzbWF0W42LB9vfhArK6fvgT+oPIdpmNZrM0gSaE2gZAg8qHWG5r7s5vRIBhIGwXUbNpXjOxkI1+t0qrUaO9xjO5t64NyBrQ19RdX6DmZsY5HAB83LwlX/vuyyaZuwAC+cu3dREcmjagSm714CeJklYa25dwrt6uXUyazOD6+FPZd39E51POdKze5ZFf643fvhjHEelFJhi+cFFkpNhyk5eKEsyRNIJQFLUuYQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LAfA0guC5Ov+ZFLS248RHoGYPc6EK5BtnnFn///VmJk=;
 b=3nzTord4O9vxWj7+XBLV/YxZX9fkt0qDLoOJuE/VO1//8P8KNgQ2LZADulbG1nNBeA7vwoyD9t7d1JvjEGVwgFTsBP+EZJve1cbPK9BBaV9LyBrfdRaeKpZPrFKq8ZB1EJEAujC4mLKube30i5n/xM/HM85KJk+JMXNe7tx+yBR7knMi072wLHVWFziwBpxwjQOxNftf5HNZ8AwOGp4iEvYSPmhAHzyIF/mruuDSqRSyQXSPVKcJ03Pd10em6pl69RxmIRDZ9v1t+qpUhKAb1Xy1GSlwvoGg2gYxeuQaivcxSLSv3j0XSBy6kStsTND6hOEkq/wvr+hVJ+iv1bCQLA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <a343fc97-84df-48e6-1c91-cd933c6e5210@suse.com>
Date: Thu, 6 Jul 2023 10:26:46 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 12/13] xen/x86: fix violations of MISRA C:2012 Rule
 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Paul Durrant <paul@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <e414542d76d4a4a0df6ad969cc6332e355d6ef38.1688559115.git.gianluca.luparini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <e414542d76d4a4a0df6ad969cc6332e355d6ef38.1688559115.git.gianluca.luparini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0145.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:96::18) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB9510:EE_
X-MS-Office365-Filtering-Correlation-Id: b3daf9c3-6c96-4de0-9f8d-08db7dfabe4f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	fPqkS2y9+mNI4/tcNsnEyufcBZtWYPqGy088yI0zb6BRARs3w9XCAKgqtujSqxVqaMZJ7hJQ0lsQ4uJDStWsRkHhdGeGljcqSiklz8U/89bgihwJ/Zcud3ktLpabXWbsfzYJnAPl1+SXCAAF1hkckbhabEFDlgB7//VTd5iTAX1ZSE9Gf02GedS/d+loayhRtlujm+Nn0xuQbCBXMATmIQ8qjAUedJ6QnouIp3OOvLPPVRZsaMvfv3NxklLe5enVu8d/HLAfnjItE3FPdM95Pw9Lt4DV6mkJMxXqFX7BNpUF7AZ2bZHz/Ut2iy9dbjX52yhdO7S8XkEaFdmPXOVtWiHOGquKwFiUxg/BvxAiEljQXvlan14bv7NFQH9Cqgh56OjTcvoAmT6ibP8rBZ9Gc166AkpldYwaMwFuBk/piAas8w8RVit8k0i9rVnai5X4LQY/p9ruB8V6D6UEakNH1Di2kTC1nyMdg0iTfFp/UGe8gdWxTYNEJq1DY58iRYuwJ40FsXug/qWMVQK4wtrwnTVZH1XFChkEJp2As4jqkZgC9h7uZzKl+Mmv2Rn1kTyXc84OHgRkSkV5w1hWcqRWD78YG8N4JieM1Aia5+vwSKYRLT5/0A9NoO4+/9eajfScpSEjIrySTNQVrizOWPLfIA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(136003)(366004)(39860400002)(376002)(346002)(451199021)(6916009)(4326008)(66946007)(38100700002)(66556008)(66476007)(2616005)(86362001)(186003)(36756003)(31696002)(6486002)(6512007)(6666004)(54906003)(53546011)(6506007)(26005)(478600001)(5660300002)(7416002)(31686004)(8936002)(8676002)(316002)(2906002)(41300700001)(83380400001)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1QXFaS21NMkExWVFyU1lPOU1T?=
 =?utf-8?B?V0NsaDN6RFB0WlBRK3BWSkhJVWpFaUltQWRGaGJsSExrSjgvVmRsbXJlWEJW?=
 =?utf-8?B?dDRmOTNtUjFvVG1DRkFqSG9vVWtyd00wb2xJM1AyaHFOZjBYQkNWOE1SbTND?=
 =?utf-8?B?eWVaaVRpZ05FLytLd2NjS3RZY212WjJZcERsWjYxTzMzb2dkT3dhcVpsWmp0?=
 =?utf-8?B?QzloK2o4ZU1KclhjSnY1eFR4cjB1aTFPSGZhdTNKRjdnbXJoTHA4WTg5azB2?=
 =?utf-8?B?aThIZ1JqSmZ3NDgvZ2w1MzcwNytsd1huVGsxVEtWN3huRjhhMXkxN3c1aVYz?=
 =?utf-8?B?akgvN3c0S3hpL2JiWG5reHNFbTFUTVcyUzBuN3pwMlhiM0oxZ3hJaVRvMnZ3?=
 =?utf-8?B?YmhYbkF6WkFHVHpTZllUL0tpUndweHpJMFBwblZqd0pxbStsVGNaYzhHY3FM?=
 =?utf-8?Q?mdO0XyR0t0t3AKv8kgjf3ymB9?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b3daf9c3-6c96-4de0-9f8d-08db7dfabe4f
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 08:26:49.2199
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: QauBAkJX45pP/ihtBla276Gy2ITwpvtwDaC/hyQK0RGpPdywbX0iruUR70zBeV2JHqPqKGkuw0soZ6pIRyZtJw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9510

On 05.07.2023 17:26, Simone Ballarin wrote:
> --- a/xen/arch/x86/apic.c
> +++ b/xen/arch/x86/apic.c
> @@ -1211,7 +1211,7 @@ static void __init calibrate_APIC_clock(void)
>       * Setup the APIC counter to maximum. There is no way the lapic
>       * can underflow in the 100ms detection time frame.
>       */
> -    __setup_APIC_LVTT(0xffffffff);
> +    __setup_APIC_LVTT(0xffffffffU);

While making the change less mechanical, we want to consider to switch
to ~0 in this and similar cases.

> @@ -378,9 +378,9 @@ static void __init calculate_host_policy(void)
>       * this information.
>       */
>      if ( cpu_has_lfence_dispatch )
> -        max_extd_leaf = max(max_extd_leaf, 0x80000021);
> +        max_extd_leaf = max(max_extd_leaf, 0x80000021U);
>  
> -    p->extd.max_leaf = 0x80000000 | min_t(uint32_t, max_extd_leaf & 0xffff,
> +    p->extd.max_leaf = 0x80000000U | min_t(uint32_t, max_extd_leaf & 0xffffU,
>                                            ARRAY_SIZE(p->extd.raw) - 1);

Adjustments like this or ...

> @@ -768,7 +768,7 @@ void recalculate_cpuid_policy(struct domain *d)
>  
>      p->basic.max_leaf   = min(p->basic.max_leaf,   max->basic.max_leaf);
>      p->feat.max_subleaf = min(p->feat.max_subleaf, max->feat.max_subleaf);
> -    p->extd.max_leaf    = 0x80000000 | min(p->extd.max_leaf & 0xffff,
> +    p->extd.max_leaf    = 0x80000000U | min(p->extd.max_leaf & 0xffff,
>                                             ((p->x86_vendor & (X86_VENDOR_AMD |
>                                                                X86_VENDOR_HYGON))
>                                              ? CPUID_GUEST_NR_EXTD_AMD

... this also need to adjust indentation of the following lines.

> --- a/xen/arch/x86/cpu/mcheck/mce-apei.c
> +++ b/xen/arch/x86/cpu/mcheck/mce-apei.c
> @@ -37,11 +37,11 @@
>  #include "mce.h"
>  
>  #define CPER_CREATOR_MCE						\
> -	UUID_LE(0x75a574e3, 0x5052, 0x4b29, 0x8a, 0x8e, 0xbe, 0x2c,	\
> -		0x64, 0x90, 0xb8, 0x9d)
> +	UUID_LE(0x75a574e3U, 0x5052U, 0x4b29U, 0x8aU, 0x8eU, 0xbeU, 0x2cU,	\
> +		0x64U, 0x90U, 0xb8U, 0x9dU)
>  #define CPER_SECTION_TYPE_MCE						\
> -	UUID_LE(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96,	\
> -		0x04, 0x4a, 0x38, 0xfc)
> +	UUID_LE(0xfe08ffbeU, 0x95e4U, 0x4be7U, 0xbcU, 0x73U, 0x40U, 0x96U,	\
> +		0x04U, 0x4aU, 0x38U, 0xfcU)

See the earlier (EFI) comment regarding excessive use of suffixes here.

> --- a/xen/arch/x86/hvm/stdvga.c
> +++ b/xen/arch/x86/hvm/stdvga.c
> @@ -39,46 +39,46 @@
>  
>  #define PAT(x) (x)
>  static const uint32_t mask16[16] = {
> -    PAT(0x00000000),
> -    PAT(0x000000ff),
> -    PAT(0x0000ff00),
> -    PAT(0x0000ffff),
> -    PAT(0x00ff0000),
> -    PAT(0x00ff00ff),
> -    PAT(0x00ffff00),
> -    PAT(0x00ffffff),
> -    PAT(0xff000000),
> -    PAT(0xff0000ff),
> -    PAT(0xff00ff00),
> -    PAT(0xff00ffff),
> -    PAT(0xffff0000),
> -    PAT(0xffff00ff),
> -    PAT(0xffffff00),
> -    PAT(0xffffffff),
> +    PAT(0x00000000U),
> +    PAT(0x000000ffU),
> +    PAT(0x0000ff00U),
> +    PAT(0x0000ffffU),
> +    PAT(0x00ff0000U),
> +    PAT(0x00ff00ffU),
> +    PAT(0x00ffff00U),
> +    PAT(0x00ffffffU),
> +    PAT(0xff000000U),
> +    PAT(0xff0000ffU),
> +    PAT(0xff00ff00U),
> +    PAT(0xff00ffffU),
> +    PAT(0xffff0000U),
> +    PAT(0xffff00ffU),
> +    PAT(0xffffff00U),
> +    PAT(0xffffffffU),
>  };

While I agree here, ...

>  /* force some bits to zero */
>  static const uint8_t sr_mask[8] = {
> -    (uint8_t)~0xfc,
> -    (uint8_t)~0xc2,
> -    (uint8_t)~0xf0,
> -    (uint8_t)~0xc0,
> -    (uint8_t)~0xf1,
> -    (uint8_t)~0xff,
> -    (uint8_t)~0xff,
> -    (uint8_t)~0x00,
> +    (uint8_t)~0xfcU,
> +    (uint8_t)~0xc2U,
> +    (uint8_t)~0xf0U,
> +    (uint8_t)~0xc0U,
> +    (uint8_t)~0xf1U,
> +    (uint8_t)~0xffU,
> +    (uint8_t)~0xffU,
> +    (uint8_t)~0x00U,
>  };
>  
>  static const uint8_t gr_mask[9] = {
> -    (uint8_t)~0xf0, /* 0x00 */
> -    (uint8_t)~0xf0, /* 0x01 */
> -    (uint8_t)~0xf0, /* 0x02 */
> -    (uint8_t)~0xe0, /* 0x03 */
> -    (uint8_t)~0xfc, /* 0x04 */
> -    (uint8_t)~0x84, /* 0x05 */
> -    (uint8_t)~0xf0, /* 0x06 */
> -    (uint8_t)~0xf0, /* 0x07 */
> -    (uint8_t)~0x00, /* 0x08 */
> +    (uint8_t)~0xf0U,
> +    (uint8_t)~0xf0U,
> +    (uint8_t)~0xf0U,
> +    (uint8_t)~0xe0U,
> +    (uint8_t)~0xfcU,
> +    (uint8_t)~0x84U,
> +    (uint8_t)~0xf0U,
> +    (uint8_t)~0xf0U,
> +    (uint8_t)~0x00U,
>  };

I continue to question these changes. They don't fix anything, do they?

> --- a/xen/arch/x86/hvm/viridian/viridian.c
> +++ b/xen/arch/x86/hvm/viridian/viridian.c
> @@ -291,7 +291,7 @@ static void enable_hypercall_page(struct domain *d)
>       * calling convention) to differentiate Xen and Viridian hypercalls.
>       */
>      *(u8  *)(p + 0) = 0x0d; /* orl $0x80000000, %eax */
> -    *(u32 *)(p + 1) = 0x80000000;
> +    *(u32 *)(p + 1) = 0x80000000U;
>      *(u8  *)(p + 5) = 0x0f; /* vmcall/vmmcall */
>      *(u8  *)(p + 6) = 0x01;
>      *(u8  *)(p + 7) = (cpu_has_vmx ? 0xc1 : 0xd9);

Please can this and ...

> --- a/xen/arch/x86/include/asm/guest/hyperv-tlfs.h
> +++ b/xen/arch/x86/include/asm/guest/hyperv-tlfs.h
> @@ -471,30 +471,30 @@ typedef struct _HV_REFERENCE_TSC_PAGE {
>  
>  /* Define hypervisor message types. */
>  enum hv_message_type {
> -	HVMSG_NONE			= 0x00000000,
> +	HVMSG_NONE			= 0x00000000U,
>  
>  	/* Memory access messages. */
> -	HVMSG_UNMAPPED_GPA		= 0x80000000,
> -	HVMSG_GPA_INTERCEPT		= 0x80000001,
> +	HVMSG_UNMAPPED_GPA		= 0x80000000U,
> +	HVMSG_GPA_INTERCEPT		= 0x80000001U,
>  
>  	/* Timer notification messages. */
> -	HVMSG_TIMER_EXPIRED			= 0x80000010,
> +	HVMSG_TIMER_EXPIRED			= 0x80000010U,
>  
>  	/* Error messages. */
> -	HVMSG_INVALID_VP_REGISTER_VALUE	= 0x80000020,
> -	HVMSG_UNRECOVERABLE_EXCEPTION	= 0x80000021,
> -	HVMSG_UNSUPPORTED_FEATURE		= 0x80000022,
> +	HVMSG_INVALID_VP_REGISTER_VALUE	= 0x80000020U,
> +	HVMSG_UNRECOVERABLE_EXCEPTION	= 0x80000021U,
> +	HVMSG_UNSUPPORTED_FEATURE		= 0x80000022U,
>  
>  	/* Trace buffer complete messages. */
> -	HVMSG_EVENTLOG_BUFFERCOMPLETE	= 0x80000040,
> +	HVMSG_EVENTLOG_BUFFERCOMPLETE	= 0x80000040U,
>  
>  	/* Platform-specific processor intercept messages. */
> -	HVMSG_X64_IOPORT_INTERCEPT		= 0x80010000,
> -	HVMSG_X64_MSR_INTERCEPT		= 0x80010001,
> -	HVMSG_X64_CPUID_INTERCEPT		= 0x80010002,
> -	HVMSG_X64_EXCEPTION_INTERCEPT	= 0x80010003,
> -	HVMSG_X64_APIC_EOI			= 0x80010004,
> -	HVMSG_X64_LEGACY_FP_ERROR		= 0x80010005
> +	HVMSG_X64_IOPORT_INTERCEPT		= 0x80010000U,
> +	HVMSG_X64_MSR_INTERCEPT		= 0x80010001U,
> +	HVMSG_X64_CPUID_INTERCEPT		= 0x80010002U,
> +	HVMSG_X64_EXCEPTION_INTERCEPT	= 0x80010003U,
> +	HVMSG_X64_APIC_EOI			= 0x80010004U,
> +	HVMSG_X64_LEGACY_FP_ERROR		= 0x80010005U
>  };

... this together be made a separate Viridian-specific change? (I
continue to be uncertain about touching the header file; the
Viridian maintainers will need to judge.)

> --- a/xen/arch/x86/include/asm/x86-defns.h
> +++ b/xen/arch/x86/include/asm/x86-defns.h
> @@ -103,7 +103,7 @@
>  /*
>   * Debug status flags in DR6.
>   */
> -#define X86_DR6_DEFAULT         0xffff0ff0  /* Default %dr6 value. */
> +#define X86_DR6_DEFAULT         0xffff0ff0U  /* Default %dr6 value. */

Considering the respective register is pointer-/long-size, wouldn't
this better use UL? But of course we'd want to check that this then
doesn't affect code in do_debug() in an undesirable way.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 08:28:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 08:28:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559782.875085 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHKLV-0005QE-32; Thu, 06 Jul 2023 08:28:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559782.875085; Thu, 06 Jul 2023 08:28:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHKLV-0005Q7-0K; Thu, 06 Jul 2023 08:28:13 +0000
Received: by outflank-mailman (input) for mailman id 559782;
 Thu, 06 Jul 2023 08:28:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHKLT-0005Py-Me
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 08:28:11 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on060e.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::60e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0969b2e5-1bd7-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 10:28:10 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB9510.eurprd04.prod.outlook.com (2603:10a6:20b:44a::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 08:28:07 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 08:28:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0969b2e5-1bd7-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ilvDoTOWbGh/mlCj2X8gen9cHhScOQWX/1Xp+LkBWekew8Gl3DMseCETYTk4pKuHHBhWLgUNUSjzFpKJLPCj+K3OIxTkunHEEM/MS9Gpz9KqbrKUOR3hWE1kBMVLWarUE+hVlBbfBfoRha/hAYhQ8rflXlNfbEnPXZ4r3eq9lopj9tvmfuH1MCPqseey6N1jG1a4LgC9h4NSFyoENm31a5oydwevxmGwa0Oj4kutWOF3QKZK0X1ryXrbihuc5XroQjZfnvGJWVFnqzW49KKYzW97sDu2Xxmj2pnGBJnq+O60kXKAEC9Jyf4D10NHFzsacINWR9/96GbmW/rq7r/fyw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=AKIxWTdXVbNouRxTYXUB2l6mMWFiniubUmd4XyQOMVk=;
 b=JjzQNPYCkqpVMJyYjDCHnukng0PRZ6YXAVNN/1K2JKiWwAeWk0ovhxJv9QRRLUypYh/ydX/6c0AdBzKXto94bXnRULJe/Dvb+S4T4UT73vZB7ryFr177I2P1h+tEQeEr69XUVwVcckH+5i5SxS5KoFOdThdpn+KR4CzfhFaamQodRd9wNDcePKtTw3TW30XW0OAh09Zk9EWYn25ft/zOhJumj4dxZNuID7QXRoO8bgwTX7CKERHYmazsLO3JYyLirjuXogWBX6t2AYgZ72cBJ+aFwNamZ9AVp3aSg/2zh1c5gf7KjiBXWliqhJCXLhuo2FxsUEl2DN6jmPqNIiZJPg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=AKIxWTdXVbNouRxTYXUB2l6mMWFiniubUmd4XyQOMVk=;
 b=0TK3LUWu88iAIIiqmt88UO7IkCRKVt2ADlKI5tp2birx7DhwEOQafWPrXP3tp1zDx7/sU4KMP6BUFSGhKByiS0JfmERjr3O3PDi+XeYWpwru83DVbBkFt40Pf8C9fYnQzImwg1hXBPT6S4xi6kgMUde5ZKtsSzRLdPvaqpyAMGwwtlp22+MYfzue0TWnfAirqVHO8XDJhwjFcplEA1mYgcoyqL05U7NyX5GrlFySh8cc4Y5OdDepOH9vOsF4zLYuAHvwnD+uMrFifLld5MuwIYd91EPhTK8ZIAZTctE9psnIM9jLpegoMQHhToPG8HmIQf0unkRbhQ1PhgrmXvt/Pg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <07841452-7f20-769d-9fbf-2cffedeb9ef4@suse.com>
Date: Thu, 6 Jul 2023 10:28:05 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 13/13] xen: fix violations of MISRA C:2012 Rule 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 "consulting@bugseng.com" <consulting@bugseng.com>,
 Gianluca Luparini <gianluca.luparini@bugseng.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 Luca Fancellu <Luca.Fancellu@arm.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <76cf70cb43492966fbcf77d7a2d67d90fe0a32d4.1688559115.git.gianluca.luparini@bugseng.com>
 <00B5545B-7564-4AA6-9654-48FB30A074A4@arm.com>
 <CAFHJcJtgGQXVTJc9ibpmXHA7oZR1wd-GMVCKAJKZhJm+BTCk2Q@mail.gmail.com>
 <CAFHJcJtVDc0q6cZUFdSwB9Koj2HGf67jL=hEWXt38qhQ-F4Bvw@mail.gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <CAFHJcJtVDc0q6cZUFdSwB9Koj2HGf67jL=hEWXt38qhQ-F4Bvw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0093.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a9::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB9510:EE_
X-MS-Office365-Filtering-Correlation-Id: 6d0200ce-ab65-4cde-c0b2-08db7dfaed1e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	D7mcZooTBanNyUt+Q8aZ7xQxkzGCAs9gPPNCqMzEsMH8j1xznTSYkbcRWQikZ33EGPewPrdsUnurc0FY49OO0I3l0J9f78FJ494jrsRH1IqwU7yLDE1HBhmhUnhClh5NtXeXMeE/pNGqf0CmfrrrHlIfWJha/KckFi2VdjTTyneUvDLw3q20nPO9DTtidHNpbeHJ+bs8UkA+7ERZuzZp1F4BFGQ3snnpdozpaOqeDVyfOkHQhuO/qoXgtt10e1dN3EFhCr1tNPyfTDV2dINJ9o0RdP93VK0X9p0hc2RYpXhkkaz3lqSzAeisVZv6dkUgdkFNZ9TBM25lP8nVHR98w3Q9YuY2EnNRpyn5RY7ICiAf0RiB/o6pkjigy3VfCVt2RpFXw+wvBhZAFF5CPojm7z+Kw874J2PEAFe740Fx8fgd1fkLeACY9Zvj7vn7QqJbe3lGlzlPXP3IEdYym2q/rxwv0OqML6o5iJ2ghzsyyiCOwIsdhKKYzwt3DMV2VMAEakr7WPMZks4RTHwdrdJq/0Xdiyygk8AqB7clPUdLUezt2Ip0MiCkJ45gKWlxrYV85X2bX5d9sXEGvZ7J/cm9I0WN506lLtpsrx7Tg5YZY8b4ajIdtqFZdnyOZ2gPpx3rouziXlkrNh24ce31Hbg8vQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(136003)(366004)(39860400002)(376002)(346002)(451199021)(6916009)(4326008)(66946007)(38100700002)(66556008)(66476007)(2616005)(86362001)(186003)(36756003)(31696002)(558084003)(6486002)(6512007)(54906003)(53546011)(6506007)(26005)(478600001)(5660300002)(7416002)(31686004)(8936002)(8676002)(316002)(2906002)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?c1IrYUdldGF2dG5NQ3g5eDZZa3JpbTFjc1pzS3pFTlI1b2Y4RlFwK1BsTVFE?=
 =?utf-8?B?OFMzZjdZL2lRaFRjRlBFWTIyTXdRbTY4a2h4ZkVxYlBMWjNESm9RTng3c3Nj?=
 =?utf-8?B?QjNHRzMyUklORVRCOEphTCtaL0R0Q2twWEZ0Rlc0cnU0K1FLYzRoMldtNGJN?=
 =?utf-8?B?NDdWS3VuYlBXKzBmQVQvOVZpQjY0NmlQaVo4UGJxUWdCTjFIci9nUm93ZjZw?=
 =?utf-8?B?Zk5IZ3pmODJlQzY2Z0pESGJYNGNQRUpnYWF4VGdHZkN0VnNuQXZ1UGVnZ0da?=
 =?utf-8?B?K0JMRDYrR2N3QS9vcWJpOTJVejhOQU9NMGhDdVUyeEh3WFBna0VaMmNRT2t4?=
 =?utf-8?B?WUZiandLck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f-8?Q?C0cG1TZHqh7kDi/8E1sI2SKCh?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6d0200ce-ab65-4cde-c0b2-08db7dfaed1e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 08:28:07.7609
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: JNHQ3AfB2CyuvzY8d3xG3gAtarOmfej3Tbx/iT+9vi1I5HJYTzbm2NII5VEkthP5OQN0L6jDMNE7Iu4viyJF/g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9510

On 05.07.2023 21:32, Simone Ballarin wrote:
> Rethinking about it, probably Jan's hint was to add the cast and remove the
> &.

Indeed.

> I will fix it in the next patch.

Thanks.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 08:35:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 08:35:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559786.875095 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHKRc-0006v3-O5; Thu, 06 Jul 2023 08:34:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559786.875095; Thu, 06 Jul 2023 08:34:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHKRc-0006uw-L3; Thu, 06 Jul 2023 08:34:32 +0000
Received: by outflank-mailman (input) for mailman id 559786;
 Thu, 06 Jul 2023 08:34:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHKRb-0006uq-6k
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 08:34:31 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on2062b.outbound.protection.outlook.com
 [2a01:111:f400:fe16::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ec36303c-1bd7-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 10:34:29 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PR3PR04MB7484.eurprd04.prod.outlook.com (2603:10a6:102:8d::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 08:34:26 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 08:34:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ec36303c-1bd7-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=htPfyuXSQvh2yhZRXeqPAxaGer0VuqIOV/S/EqE522NtiL/xvgwScWOllecDWCrXoS46slUsO7nnGtgLvrYKycXHkeKgGG9k2tIrIqdwTYX9bosaIUBuYdBGnx7FoATHnDaQwIXPtku9AApCb3Q/etYDShumMNO2MvBphS15uRWu+JdFb+QQaPPtnrL8qnvwF0s7xCODUZ9XjD2Bxr8UKiUlIiq8vmI/uUN2zKRigkSWNNpud5c9ZGkY6i5Bd6bueZQCpLdTjxH8NoJbtGJJy1PciZo6UNHsnL00kdr8BGkkBJEoFIwIHxxewWWvpp5nCL+TgG+35mz2RlWPhEjtWQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+NOxynQXX1tQdQGDdvVqQcs6GJKWsm6hgQHCMdod6QA=;
 b=CPUx/hgjLzITknFjNeDQSHo7SpTEkDfdE/dDZFAWzSN/nPg4MHDnlykm/2aJGX9HvpQX/v82bZQpiorn5nzRbINsPz/9cbEIS4NqcpPZvb6jY27HmI6Ey4v8RAEt8BiywbbA1ZVC04UuA8J94R9GDBdmaDWeYLybyVEd3XlO1hoSAnV9jF2ArQSGntV7Y/jAor16/qRzx6vTkZxa7UpMglqTu1D3tdHWLyRwB9dDYGaB6syqgb4SIJlwYII24Xd/vdKQoDXnXIe/il8dgiV0CbHh3aQ2KQMWf8Qb9QXnZV4cHQ7TzDtqeqUuXJDfDe8iVLxqwQumfkqy+iOzYBPlbg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+NOxynQXX1tQdQGDdvVqQcs6GJKWsm6hgQHCMdod6QA=;
 b=IYLzcUiEe92D+6KYblmwKB79AOT0zRWgvI4J6uhDiqhbGmejt7BCU1WckA8QC8cT0PEFU4xzivADIePG9GcfQj4qg+fFbzdRHCT2JpkBKP/GpxPzqcIhjr2DqmdmKTFkKPLuOdZ0kVqXrXLvSaPepKRMsBwBWRD1Ehdkf6ysqVxKv3AfenU6aDDI1HFAxfWXhrCJ6yo7L0FNLaASApLuLfL6oWWKHk/A6AmqVKeJImOuODZ3F5llAw/qPbJT5VHDO1azXCTBbSyF6VTcFpDUy6vJr7bV0JlemdUHK4Uy/L0KPc51jkFC4Gg3x9al0eiq4l9l86FlRpKbn059O5srNA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3696380a-b3f9-8fd3-a900-c15c6eea74f6@suse.com>
Date: Thu, 6 Jul 2023 10:34:24 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 13/13] xen: fix violations of MISRA C:2012 Rule 7.2
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
 Gianluca Luparini <gianluca.luparini@bugseng.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 Simone Ballarin <simone.ballarin@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <76cf70cb43492966fbcf77d7a2d67d90fe0a32d4.1688559115.git.gianluca.luparini@bugseng.com>
 <alpine.DEB.2.22.394.2307051646360.761183@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307051646360.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0055.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4b::18) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PR3PR04MB7484:EE_
X-MS-Office365-Filtering-Correlation-Id: 55e2fa02-ae2d-4220-fb76-08db7dfbcf06
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	N93ofNk9+gkHZHYR6V0CqEtptW8fn3upvKTADlLOqpcUW7M05rViVk6lYBeYCFVyKW5QjCZhbJdV3AzxP8v6p3VO4tj7lDHgkDevNB98S7Ee+k/XUvvGPw8/UMzbRNW25DnCOpnhIMWpOzliYD8iKNmyBfnPPfbRha0EjEyi981v6kkuo1OJ0RbuHuxlSmaQGwgoNPGUM2TRf1DVM5beQooYIz6/7oJoh25vtrXk28CCz50TmQOv17ab+U+zKv4stV8tz5yLEgUpDcrAhihJutLKSW+OrE8mCzpi+wQxovbcm4r0h58mjkzxyvNXbuSxGGjNRMtxQihzaGwZMETMwc7PVV2eS96faemxLSZrb/Kg9MME1d6us9GvTJBIWxWPQ4g/3jYhKoFyGxHOewk0sL8ZE0kry/x9cSXKJiC/GdokLZW9XSeboaGh9hYTVeW+Q+7eeGj/Vqtpoc6wgqb+3lp6H1d0V8jzotcKSMm+1tWxojYCgXjb6ym1MGGrAamh9N5lSA2rD/VIIV3ldekjfgXy/IxIGEPGyPFCeisBVMoOSbQDsLeTwuuiuam63IJBfpRPs+B3KC2kb/6qz/oZ0YItHHM809wYtiA4hFmPwrmPVXA9WMyaFpC5peXhftEGFJD7sSW2fOPfxIlx/buIgg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(136003)(346002)(39860400002)(396003)(366004)(451199021)(8936002)(8676002)(2616005)(2906002)(5660300002)(53546011)(26005)(7416002)(6506007)(31686004)(186003)(41300700001)(6486002)(316002)(66946007)(4326008)(6916009)(66556008)(36756003)(83380400001)(54906003)(6512007)(478600001)(66476007)(38100700002)(31696002)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WlRnZU1heFFGaWx3N3p2dnVyRXR5SzY4c3ZaRnZWdzc2SUYwS2FKbDNGN3FG?=
 =?utf-8?B?ZUZVcWc2ZHNqQUVJTmRMQlBPS0xTYm0xbm11QUEzTmN3amVENDNMOG9Dcnd4?=
 =?utf-8?B?WlJxUGI1Mmx4WEMxRkZZQVdMOXlMemNlTER4Qm5ZU1VjVTM0aTZZRFJnVXNJ?=
 =?utf-8?B?d0k1V1RSRW1BUWg3Yk1xd3lOWUhWVUc3aSs4WWJHWEhWU2Qyd3lQdlFjZ3B2?=
 =?utf-8?B?VU1mdjB6Y3Qza1NONjN0dXlSVlBNSitSTXpENWxkU3pSVTlRaEE1ckpVQTRr?=
 =?utf-8?B?TmRNQUNGTUxKQklZSTZnM09kbjZQM25hNDU5aWlDajVnWTUwdkRlanR2dHFq?=
 =?utf-8?B?dVBuekMzdm5WeU1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?utf-8?Q?fyLFknxUGttKdbd5n2GDIa+VO?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 55e2fa02-ae2d-4220-fb76-08db7dfbcf06
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 08:34:26.8073
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: YQuAd216oPnhfFF0WB/5Tpa2ael8m2eqB5MyQ753Utiq7TRCnxTUNxf7AbeaTOcdPw/zGvbjTZzDzgEnEROtMw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7484

On 06.07.2023 01:49, Stefano Stabellini wrote:
>> --- a/xen/include/xen/bitops.h
>> +++ b/xen/include/xen/bitops.h
>> @@ -227,11 +227,11 @@ static inline __u32 ror32(__u32 word, unsigned int shift)
>>  }
>>  
>>  /* base-2 logarithm */
>> -#define __L2(_x)  (((_x) & 0x00000002) ?   1 : 0)
>> -#define __L4(_x)  (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
>> -#define __L8(_x)  (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
>> -#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
>> -#define ilog2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x))
>> +#define __L2(_x)  (((_x) & 0x00000002U) ?   1 : 0)
>> +#define __L4(_x)  (((_x) & 0x0000000cU) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
>> +#define __L8(_x)  (((_x) & 0x000000f0U) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
>> +#define __L16(_x) (((_x) & 0x0000ff00U) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
>> +#define ilog2(_x) (((_x) & 0xffff0000U) ? (16 + __L16((_x)>>16)) : __L16(_x))
> 
> Jan, would you want to replace _x with x here as well?

Yes.

> If so, I think it would be best if done in a separate patch (keep
> mechanical changes mechanical) and keep this patch as is:

It was done in one go in patch 9, so I don't see why doing it here
as well would do any harm. Additionally missing blanks before >>
should be inserted at this occasion, and perhaps excess ones dropped
from the first of the changed lines (or further ones added to align
toe colons). While with that the lines still stay just below the 80
chars limit, dropping the leading underscores would get us a little
father away from that boundary.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 08:40:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 08:40:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559790.875105 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHKXL-0008RT-De; Thu, 06 Jul 2023 08:40:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559790.875105; Thu, 06 Jul 2023 08:40:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHKXL-0008RM-A8; Thu, 06 Jul 2023 08:40:27 +0000
Received: by outflank-mailman (input) for mailman id 559790;
 Thu, 06 Jul 2023 08:40:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHKXJ-0008RG-JE
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 08:40:25 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20624.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::624])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bfed5ba6-1bd8-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 10:40:24 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB7967.eurprd04.prod.outlook.com (2603:10a6:102:b8::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 08:40:21 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 08:40:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bfed5ba6-1bd8-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=GcBtOM98e0n9JDSDnLmLJeR1F0E21sQ/sgRU/iR6LiCfGSwoeoyND+xWlylt/9E6W+3MylZ3c57oSD9/rpNu84+lf0jIILAbwhdZ6HQ9fyNFSWvzYkQmBD1zvTn8kcFzGTdLJnBkIWPiF4KvgQiQJrbKl2iIqSDhqkT6wSjsgcGZws3ZpeU1jYASk4b7m987l5VP9oKKGL9BW0AxCwnAJWkFYSBGP+SYXeYte2PmNoaBttUz+MbObWiub0+y7lAnwrikqRkdzjAfXYO0ACb3vmNrXjXgFCaf8ek1qnKJLHc5N5k5lUQKdnvsjJPvysbQkAsSbz8uMcaC0Nl/PnuEcw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=sc/VbG+Q/mz9bj7O0eceK15ZM3WOZVJH7ScrdEB2dlI=;
 b=TwhfveldVZmkMatMCsYCAF7yN1Ojv5yGZA0Zyz5sT8IwE4W/01BrqEDdW8eQXVnfCXpz2LPftbb2tfBYuaFQD9tugmFyBYyHIURxOdF3VOUGlolrSDLlovroTzs0r/IyLaC3G4Y7tNrptCuWPLZX8w82ctgpY9fpXpx2y9HKSIYrXfaL293ZEXf9BGNx7VN4bHWUniPouYpsEcoVhpTOp555/3CmaKYFPwUflmxLfnC6rKZjx8csfzdNE402VbGXGFfGNT9ltfU3ygkbU3DqJIjhd9YL5LmFp3kx0vHfYOoJKifFBX6uhwPtfyFCTb5DUfLs6YOWmZ67EG7UbBj0HA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=sc/VbG+Q/mz9bj7O0eceK15ZM3WOZVJH7ScrdEB2dlI=;
 b=llbajvfh/iNXR2cpENDicrRwz463+Engs0SnFF133qkxdw6n4aEGB+k83hjCvcc/UwrSvz57KOAEeD+VtaM5eF/pSwI1kl5U47v8MovRCmsejJNQY4ZDA8Ho/c2UbH3RZpuyAjryOaMnZ8TOTde/qUZ2aMtlXqHGdABrQ11cwSk4CoHuAL4D1Lz55wLsx3BTGk5LHJ2D6RTN+qsnDQGE4ZjE4qWSV4nQt2XNNGzXyhHJr8H3F4oeERHUm3Ixl9anUp70MCXhzFajVVTOQxhhTsgxg4qcHhrMN1H2lfcGQ04fYFiZCCqZAX43CoBW+Sv+63XZcrA9Xw6yE51wx4XDqg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <56c15732-1917-dd05-6f98-d02ff5c8dad0@suse.com>
Date: Thu, 6 Jul 2023 10:40:19 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 13/13] xen: fix violations of MISRA C:2012 Rule 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <76cf70cb43492966fbcf77d7a2d67d90fe0a32d4.1688559115.git.gianluca.luparini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <76cf70cb43492966fbcf77d7a2d67d90fe0a32d4.1688559115.git.gianluca.luparini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0207.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ad::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB7967:EE_
X-MS-Office365-Filtering-Correlation-Id: f96b9878-e32d-42f8-59a2-08db7dfca2ab
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Kkd+VmpR/b9XE5+9wQ67OedShFydCJwpIk3Mm5XOU0O39HeIinjLtMsM1KPfV7jZFXbrA90bIhU3HR0+b/5saHgXb5qc+DF73nAAH72TiNK5es2Pe4yL1IwfhpiDWTw36MpzSOJmW4ENtCAQ3zvKDgV0sGy1r37FZT1XgRqEOxLvCrxVXPaewlj+sY2G07lLuKclGJFrV38w6XtfCg1GpaF/eaasoF8kPiZUh8bY0Ub/gYS92HlW7ARe/icJSf/pLbUxdmAB3J6SDLI+1IO9oYlUmtfce+LUJ8TIue+qC/37hMaziLiQs2wWoOUC4m0vJGN91maZ8BPWn3Sla0eYh9otPBw1dtMNl7s++f6rDK/rUF7NtCClWXdFBPrlyvFO8qLW167xHJVaSh7ooVLTY3KclVlwkV+RoAPyGHcbHmyr/DhUr7gvUgonRQSfWCHhky+ydfM6CCPsmb1CShxTYI2ByAu1ZeWWHzDuTpbDOpRuUQ4AQ7OnGpmGatePlrq42ij4yE4BJlhAPYf1OA10nx8S/YecLm0sKBMKrvwSnDawk9NptYFJuBhAC06IJcPhF1XjlLmpDvGe8pZ88OZMaAW4V60cKSgTvqbOmg8si0btUJO1zbGrZxQKTGz1oSaSJL7b2gO+BnF5V0fZZub2zQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(396003)(366004)(136003)(39860400002)(451199021)(6916009)(54906003)(6486002)(478600001)(66476007)(66946007)(41300700001)(8936002)(8676002)(66556008)(38100700002)(4326008)(2616005)(316002)(186003)(6512007)(53546011)(26005)(6506007)(31696002)(86362001)(5660300002)(7416002)(2906002)(36756003)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZGU4TndVL0dvVlptOWNPaHhrTWZsMkN3bUJLQTlFell4Q09wRWI4MCtoZTJl?=
 =?utf-8?B?R3FqZW1KRGk3anJVT3N3eEFBTURaR2lzQjZqbHVicmRmSUdHM2ZHZHk0WmVp?=
 =?utf-8?B?UWE0Ulk4Y0RLYStjY2tJaEl6V24wbnRsbWl5TllTangvRnZQNG9NMDd2SnFv?=
 =?utf-8?B?WldzcjdsVWNad2JBT0EzWFVGL3dUOERmTWFJbytVcFNHTyt2cjhPS0NKODB0?=
 =?utf-8?B?YndBRGlnSmFmNGp3RmdLYlY4ejdia2dFM08rb1JudVlYUEFVdHExblVZNUl5?=
 =?utf-8?B?WjdTbE9udm1uY09aSkthY0ozL2RONjVQMForY2RpUElUd0xXb2RrTHlIa3ZT?=
 =?utf-8?B?bFA0OEhXdm5vNk5FdEVJeEpLd3NBUmwrWWl0ZTFhYm1YQkNkOFVlM3o4TnlH?=
 =?utf-8?B?V0p5R2t6Rzg4RndpVGloRWI4RVI0Y3AwZ0lSekZ5dTc4NGRJd09VMFNNUmNw?=
 =?utf-8?B?R0RkMzIrQzRZT2tSVGlyWFE2U2preGFucXpCcldLUEkzejdhMnNRSmpCbk5w?=
 =?utf-8?B?dWFFZTRFcWQ0cE8yMlNLL2lOb0Y0NEZqUWx5b2ZUdU9WTmtRazRibFpROWdv?=
 =?utf-8?B?UVZjQzV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N0M3JwK21LNERqbXF2UzBKVHhP?=
 =?utf-8?B?NEQ4cnhXL2Y2QVhnMzhTMEhua0VQUlZ0TXdac0d6UDZ0M25TQnNNUjRGSUw0?=
 =?utf-8?B?VTM1V1AvNm5OWkRLK0toVEkxT1pKeFRoRkRucis3bVdjbndIQlVuVm9IcFNj?=
 =?utf-8?B?QW1XSDAxSTY1VitmaUZuOUVzL3ZzNmZiR3lGNzBpVFFIZ3lWNkQ5d3pVdDlz?=
 =?utf-8?B?Vi9jc3krcFg2QVg3SEhsN1FzWGRKMXFUSmdBNTVjU2RmUGh3UVRjVHRsZkpK?=
 =?utf-8?B?aXUwbzFGVjVQbXhhZ015WXdoQ0MrcC9TMUhIWWNtdklualU5cmhucHZFU1RH?=
 =?utf-8?B?Uk1OQkJRVWd6VXVKTzNWSTkxZTRHbmZhQzFIVVZXZHYxQTBwNzBHeVc2UUZE?=
 =?utf-8?B?ZWt3WU83TS90L3E5ZEtkSGFCRC9NSHVWb2t0WnlxM1JSQWRUMC9FZTF6NEsr?=
 =?utf-8?B?QVFQY1dBSE9EMzUyWVZsZHlrSGJadkhSTStWMkJsYXM1ZDQzTXFHdFVMcjVL?=
 =?utf-8?B?MlRQRnlGRmppUTdxK1E4akxKQ2tVNFFyVXhGaEFUdkttVFdoTGFoTFNoU05X?=
 =?utf-8?B?MFp2VmJ6eUhGb21UU3hFdnJUTk9HcGZNV1R2SG9ST2ttNWdBUHpUUk8rVW5j?=
 =?utf-8?Q?w8ipydD9UZPAH9KNDZsn93xcz?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f96b9878-e32d-42f8-59a2-08db7dfca2ab
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 08:40:21.8955
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: OF9IG7muwM2l4zRd6SRmCzstr5DYHuCTx75BOv3gYXQ062j1MoQBzbtDS2ApIvTechW9cJD99niF6l7yhUWNAA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7967

On 05.07.2023 17:26, Simone Ballarin wrote:
> @@ -80,36 +80,36 @@ static inline uint64_t cper_next_record_id(void)
>   * Corrected Machine Check
>   */
>  #define CPER_NOTIFY_CMC							\
> -	UUID_LE(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4,	\
> -		0xEB, 0xD4, 0xF8, 0x90)
> +	UUID_LE(0x2DCE8BB1U, 0xBDD7U, 0x450eU, 0xB9U, 0xADU, 0x9CU, 0xF4U,	\
> +		0xEBU, 0xD4U, 0xF8U, 0x90U)
>  /* Corrected Platform Error */
>  #define CPER_NOTIFY_CPE							\
> -	UUID_LE(0x4E292F96, 0xD843, 0x4a55, 0xA8, 0xC2, 0xD4, 0x81,	\
> -		0xF2, 0x7E, 0xBE, 0xEE)
> +	UUID_LE(0x4E292F96U, 0xD843U, 0x4a55U, 0xA8U, 0xC2U, 0xD4U, 0x81U,	\
> +		0xF2U, 0x7EU, 0xBEU, 0xEEU)
>  /* Machine Check Exception */
>  #define CPER_NOTIFY_MCE							\
> -	UUID_LE(0xE8F56FFE, 0x919C, 0x4cc5, 0xBA, 0x88, 0x65, 0xAB,	\
> -		0xE1, 0x49, 0x13, 0xBB)
> +	UUID_LE(0xE8F56FFEU, 0x919CU, 0x4cc5U, 0xBAU, 0x88U, 0x65U, 0xABU,	\
> +		0xE1U, 0x49U, 0x13U, 0xBBU)
>  /* PCI Express Error */
>  #define CPER_NOTIFY_PCIE						\
> -	UUID_LE(0xCF93C01F, 0x1A16, 0x4dfc, 0xB8, 0xBC, 0x9C, 0x4D,	\
> -		0xAF, 0x67, 0xC1, 0x04)
> +	UUID_LE(0xCF93C01FU, 0x1A16U, 0x4dfcU, 0xB8U, 0xBCU, 0x9CU, 0x4DU,	\
> +		0xAFU, 0x67U, 0xC1U, 0x04U)
>  /* INIT Record (for IPF) */
>  #define CPER_NOTIFY_INIT						\
> -	UUID_LE(0xCC5263E8, 0x9308, 0x454a, 0x89, 0xD0, 0x34, 0x0B,	\
> -		0xD3, 0x9B, 0xC9, 0x8E)
> +	UUID_LE(0xCC5263E8U, 0x9308U, 0x454aU, 0x89U, 0xD0U, 0x34U, 0x0BU,	\
> +		0xD3U, 0x9BU, 0xC9U, 0x8EU)
>  /* Non-Maskable Interrupt */
>  #define CPER_NOTIFY_NMI							\
> -	UUID_LE(0x5BAD89FF, 0xB7E6, 0x42c9, 0x81, 0x4A, 0xCF, 0x24,	\
> -		0x85, 0xD6, 0xE9, 0x8A)
> +	UUID_LE(0x5BAD89FFU, 0xB7E6U, 0x42c9U, 0x81U, 0x4AU, 0xCFU, 0x24U,	\
> +		0x85U, 0xD6U, 0xE9U, 0x8AU)
>  /* BOOT Error Record */
>  #define CPER_NOTIFY_BOOT						\
> -	UUID_LE(0x3D61A466, 0xAB40, 0x409a, 0xA6, 0x98, 0xF3, 0x62,	\
> -		0xD4, 0x64, 0xB3, 0x8F)
> +	UUID_LE(0x3D61A466U, 0xAB40U, 0x409aU, 0xA6U, 0x98U, 0xF3U, 0x62U,	\
> +		0xD4U, 0x64U, 0xB3U, 0x8FU)
>  /* DMA Remapping Error */
>  #define CPER_NOTIFY_DMAR						\
> -	UUID_LE(0x667DD791, 0xC6B3, 0x4c27, 0x8A, 0x6B, 0x0F, 0x8E,	\
> -		0x72, 0x2D, 0xEB, 0x41)
> +	UUID_LE(0x667DD791U, 0xC6B3U, 0x4c27U, 0x8AU, 0x6BU, 0x0FU, 0x8EU,	\
> +		0x72U, 0x2DU, 0xEBU, 0x41U)

Same remark again regarding excess uses of suffixes. The changes to this
file may want splitting out anyway, as this is an ACPI (APEI) header (and
could hence do with saying so in the subject).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 08:43:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 08:43:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559796.875116 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHKaM-0000du-0m; Thu, 06 Jul 2023 08:43:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559796.875116; Thu, 06 Jul 2023 08:43:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHKaL-0000dn-SS; Thu, 06 Jul 2023 08:43:33 +0000
Received: by outflank-mailman (input) for mailman id 559796;
 Thu, 06 Jul 2023 08:43:33 +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 <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHKaL-0000dh-85
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 08:43:33 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20630.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::630])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2f13da59-1bd9-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 10:43:31 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB7967.eurprd04.prod.outlook.com (2603:10a6:102:b8::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 08:43:28 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 08:43:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2f13da59-1bd9-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KL6ruDbBCGmYXCpfKUhwAPXlnYLtFKs9dLLc7umR+8N5p73zy3G5ujwdkkY1Im1ehOBxBnUYQle/wknpGnXst4lES57XWZI08wtGLGgPeMcq0SIe6G8nTHgpNFuMoJQOrPuLu9vPjP8OqhvxKgCcaaxTXN5ZxSdWBwBOyGwHZUZp6uNinwMSQlUD2V5zoGXmidLYvYWfErJccjNU+R7q7/G6/nU3NpnU/GVOgtarsZOrn1PavRc4azEedB9UJsuSHHErL/RPlJOSQoSKcN01rrARheWZmOxPXeMK6WWt2pbE8JsFQrJKghJ0C4T79xpWDoqCuaQBn6N1JVhf6p40RA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=B6qKOx1wn4Cf7fVZBAez4dodxwvH4ey9Fihm5FBMGno=;
 b=kMxG4Z9wxA5IzLLWb7Gq0vC2hY5f8taJL5VLY8UlbLhl9UKKoPsXEPyErEaUJB8vkmjcDxaFmKWBMO+0ndcpAcHi2qgJ5zks7YuU23EksX0maSyFmba2lb2T0Jc5qbES0BoULSF/+IUuFkZ5r1vbGAc7oUcDncHlMK3/tCL5YRXWgqNKOMljjOk0lBwzs9zKegWJ3bBA0TMLg5jZpg02P4dFuGiRPIYr3JOMC8ASNPvVDY2fx9lEk2FCjZUufuDi20Qx0aYFehTiSc0b5dggj74tHqlarPHmvPQXR0yBxFSs1vRAv9Um7hV8VhSExdzRpxLpd00YtjOGVaooWZKIuA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=B6qKOx1wn4Cf7fVZBAez4dodxwvH4ey9Fihm5FBMGno=;
 b=ynCkkK7eevzYdkQ7IreNvq3io9woi4BN28KLoiKFCJ9lD1n2v8TMvzmF7HQMFEpS+Fx2rwV78pjKCt/r4W6muh8Cyex/OwOpiW8P4DNqc4sbNFX/KAIEaAQyHJcxPoQ601TQf22ZhUAeN2BQEF+3E7wVUvE+vTcKiljjRY4CZdlYY4W0JGThEc+vs7TieIPGTW5vJqfxIzOcbAm40ccKwvcIiNhKnkmBO0uAPKSOPeTroHbuUTw/rMzSUZaD0HD9pVRIPExPQ+GsoH7nq1IWXYRMiQYhU4LIA14LkpZ4qAszbNWUh5FJXcjCYyMvSwmxwH0vGB9w4VXATo4QzKwn6Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <763fdbb2-d63b-906a-7432-f3b1e14cbb3e@suse.com>
Date: Thu, 6 Jul 2023 10:43:26 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 09/13] xen/public: fix violations of MISRA C:2012
 Rule 7.2
Content-Language: en-US
To: Juergen Gross <jgross@suse.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 xen-devel@lists.xenproject.org, Simone Ballarin <simone.ballarin@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <9e0d463e2fc09193a742fc7a64a331855705a4fb.1688559115.git.gianluca.luparini@bugseng.com>
 <290e4dbf-c9c9-49c9-29ea-6fc9b9a5a4fc@suse.com>
 <a55021d5-39d9-a928-4b82-6bc6a02b42ef@suse.com>
 <006e528d-8955-8324-ed58-bb0bc0e72acc@suse.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <006e528d-8955-8324-ed58-bb0bc0e72acc@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0100.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9c::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB7967:EE_
X-MS-Office365-Filtering-Correlation-Id: 853e1f17-1025-4336-eb58-08db7dfd1201
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	iibGL/UPMrDQ2roUx4+aFMq1x8Dd7fvkTwG9BKQuR+Us0zfdH0y9z0sqIKViBQuNpqhFIsGhXg8Zl67peYV/IHoM9C/WiHU9YhodIatlUrtN+ntHHaQSo3DZFvN92/wafkl9dCKeFvjnTQ3xlo7cogCpjQOHftCjg7GT3mUIpx1Aig1ylYUsjGjv3eQq9Srb4SbdZt8SoBlPFA0Vz4NDfG7ob8A9AIv2eakAydR/jla7ACWof/COpEsXCXW+dCeozJ8Lcwuqx/Pu2sN/BKXvWCvGAKy7BGt7xNFJx2aHKleDUzAxBP2CmZfieMprDbym9ERFK7vd0YSfXnval8xEmv3W/3Fs4vE+/uD/ECswfVs36bT3vitsXOCEsZlW39qfAgpq7T68G8A0k2ZusrmPnQAryT+xLd0QQjy6ATl+XChXTEkd+oEicFLRIM6/PSAyuLt/BM/TL3buDN9O62Og3UiAhDA0LVYuRwQyRZJkrZjsNn93IgYm6aatUVSznjc48v6GT+U14nWR9rBuHZ8M49ADAyZjicT8j55M1I/TaFyLghaHkisf7q9jwonL1FutP/YjHsXolq6JV5sVFumtWABpz/rx3rg/gYTI40D5kHInYby/lRr+vf+xpWrZYwZg029h7eyp/84jR7S0rOxDAA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(396003)(366004)(136003)(39860400002)(451199021)(37006003)(54906003)(6486002)(478600001)(66476007)(66946007)(6862004)(41300700001)(8936002)(8676002)(66556008)(38100700002)(4326008)(2616005)(6636002)(316002)(186003)(83380400001)(6512007)(53546011)(26005)(6506007)(31696002)(86362001)(5660300002)(2906002)(36756003)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-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DU21RenJTK1lXZ1FqcXF3?=
 =?utf-8?B?ajJVNjlIZlM3cExZZFBOQkxTMHFqSzZ5Z2Q4V0xOR3E1ZFBIRXJTNVZrc0tm?=
 =?utf-8?B?VmozNkxSaWhwNVE4NGFnWmNSbzlXSFZnMHJIKzhHem5hWXdhb1VnczNUUEc1?=
 =?utf-8?B?QmtHM0drbXNhaHg1ZW1USE1tdXMrZTU0eC95MFZVeVBwUFRDc2RCZ2VLcEpn?=
 =?utf-8?B?MUJ6WkhPOGc5N2Z6dFFDL0dMMXFKR05mY09mUlJjN01jK09RZmlaY1pVa0hL?=
 =?utf-8?B?bHU4bkhDNGFVQmxLVzROQ25zcEJDT3dpUXJsVzgzaWZjSUoxMFA4aWtXeFNz?=
 =?utf-8?B?Z0c1a2hhdDhCVk00T2FGSkRMS25UbURCS0N3STNUUEhIbHBwcTNyZ1JLMnJo?=
 =?utf-8?B?TEEzY3kwbmd5K2ExN1Y1QUhVenNuSmpNalBnd1hMY2xTN0cyNXhPQ2RxNkd1?=
 =?utf-8?Q?bfNWaGiNpKe6+RagjHWdGAYvV?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 853e1f17-1025-4336-eb58-08db7dfd1201
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 08:43:28.6456
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: FKP2LdfRN26DpxEx7sli4RZe3FA1/qSV3oBTTpNLJ6UHz5WSmbDl3jWRX028hcgQW0zi4Qrst1QBY/NQqLD/NQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7967

On 06.07.2023 09:57, Juergen Gross wrote:
> On 06.07.23 09:43, Jan Beulich wrote:
>> On 05.07.2023 17:33, Juergen Gross wrote:
>>> On 05.07.23 17:26, Simone Ballarin wrote:
>>>> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
>>>>
>>>> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
>>>> headline states:
>>>> "A 'u' or 'U' suffix shall be applied to all integer constants
>>>> that are represented in an unsigned type".
>>>>
>>>> Add the 'U' suffix to integers literals with unsigned type and also to other
>>>> literals used in the same contexts or near violations, when their positive
>>>> nature is immediately clear. The latter changes are done for the sake of
>>>> uniformity.
>>>>
>>>> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
>>>> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
>>>> ---
>>>> Changes in v2:
>>>> - minor change to commit title
>>>> - change commit message
>>>> - correct macros code style
>>>> ---
>>>>    xen/include/public/io/ring.h | 10 +++++-----
>>>>    1 file changed, 5 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/xen/include/public/io/ring.h b/xen/include/public/io/ring.h
>>>> index 025939278b..0cae4367be 100644
>>>> --- a/xen/include/public/io/ring.h
>>>> +++ b/xen/include/public/io/ring.h
>>>> @@ -36,11 +36,11 @@
>>>>    typedef unsigned int RING_IDX;
>>>>    
>>>>    /* Round a 32-bit unsigned constant down to the nearest power of two. */
>>>> -#define __RD2(_x)  (((_x) & 0x00000002) ? 0x2                  : ((_x) & 0x1))
>>>> -#define __RD4(_x)  (((_x) & 0x0000000c) ? __RD2((_x)>>2)<<2    : __RD2(_x))
>>>> -#define __RD8(_x)  (((_x) & 0x000000f0) ? __RD4((_x)>>4)<<4    : __RD4(_x))
>>>> -#define __RD16(_x) (((_x) & 0x0000ff00) ? __RD8((_x)>>8)<<8    : __RD8(_x))
>>>> -#define __RD32(_x) (((_x) & 0xffff0000) ? __RD16((_x)>>16)<<16 : __RD16(_x))
>>>> +#define __RD2(x)  (((x) & 0x00000002U) ? 0x2                     : ((x) & 0x1))
>>>
>>> Shouldn't this be rather:
>>>
>>> +#define __RD2(x)  (((x) & 0x00000002U) ? 0x2U                   : ((x) & 0x1U))
>>
>> I don't think it matters much (as the comment says, the input is expected
>> to be unsigned anyway), and I expect even the one U that was added here
>> was only added for consistency. The sole one that really matter is imo ...
>>
>>>> +#define __RD4(x)  (((x) & 0x0000000cU) ? __RD2((x) >> 2) << 2    : __RD2(x))
>>>> +#define __RD8(x)  (((x) & 0x000000f0U) ? __RD4((x) >> 4) << 4    : __RD4(x))
>>>> +#define __RD16(x) (((x) & 0x0000ff00U) ? __RD8((x) >> 8) << 8    : __RD8(x))
>>>> +#define __RD32(x) (((x) & 0xffff0000U) ? __RD16((x) >> 16) << 16 : __RD16(x))
>>
>> ... this single one.
> 
> I agree that only the last one is really needed.
> 
> But for consistency reasons I'd expect all optional "U"s to be either dropped or
> specified, instead of a mixture.

Funny you should say this. Shift counts also aren't allowed to be negative
... For this reason, the pattern I see here is to have U uniformly on the
lhs of the ?: operator, and nowhere else.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 08:49:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 08:49:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559800.875125 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHKfS-0001Fr-IL; Thu, 06 Jul 2023 08:48:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559800.875125; Thu, 06 Jul 2023 08:48:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHKfS-0001Fk-EP; Thu, 06 Jul 2023 08:48:50 +0000
Received: by outflank-mailman (input) for mailman id 559800;
 Thu, 06 Jul 2023 08:48:49 +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 <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHKfR-0001Fe-2m
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 08:48:49 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on0617.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::617])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id eb3ee3ad-1bd9-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 10:48:46 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8227.eurprd04.prod.outlook.com (2603:10a6:20b:3b4::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 08:48:44 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 08:48:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eb3ee3ad-1bd9-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=I06ve9Xufops2hqhRfmKnB6qQN6/bol2iaIbANoqKWo/Z4gelENEKTjxMnHcwJ1lnFV96eAcLL9LBKrCCWhk/ECC66g3S6CpLXWdJ+BFQPYewzOYE1aVvMvPP3WCfKJcMu8Y6layNwEID5qNRE4aJVLPJRVN9dX3i6I/yvvOVqZBWFZ1z9jLYZ6WUwczysHUITPac5InhkVu7zVZUNMKAnKc/2v23uOE81Sgeg1nTohefVpum4WBzE3kvFN7ibgKlFddzsC5a5gQoPPjIDZJ0oJI/ZbmdLi93Ah5GIvR/guJH6VH1sGT0tZvL2g/ZJk1xuQ0ZlqnCk8apl38GZlr6Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=twSSBAZPFkmYgt52ZhxD0l0oayTHv+lwpr3fYUXWvpE=;
 b=i+HZCMGjvNyEtNsENdinfrtCNZZqHKAE1yZ6mPOZT3fG6YzgYv1E/3LvDvILBVEXErlCLokJgmJ2UWPr7hg3GTMlSXun+VzwBNICJoKR+rm18RqxWov3t9EXLdXeA1uzZJp91fuisac4ncj/IkH1qeeCPLzlsbEZkh4BJd5aSolPNrvIbdj9v55lN7/Imwu7g0XOtJ/WagcbbCnI0wU8bjCAKEMdEq0M2TM2BV+t3cT2p0D1URPg6aFNcsGDvLtt5+kdpH3t7yMbiTmTRDmMx6e/jeGhKWd0YevI6YWihCxlQqBfyyfCzGnm7FU/VuB9uuHHMplK+1yCVpYSGPey9A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=twSSBAZPFkmYgt52ZhxD0l0oayTHv+lwpr3fYUXWvpE=;
 b=2dnRNRZZco+xWvxIDwC/UT7V0xJWs+Qctt6sSK/zVNXqGKY6BN8MfhVdOk9xJu1PAKrXZC9/H2KJTea2nvR32U+LBHaubb9xkXbmLH2BqOnoibBf0uNwGkpl71y4ITRzX/Pl7yjvBvO+2KkfQBWuCFk3GbySGYPCyjyzKmpkOLD022N+Z6Ia3eu9QH4UQ/pgYRTrzNIIF0m0w0Uo5/oafn9ygsefXTFOi4mYFzYM01/b9tn9sn5/3tIbUspGMIkPiMvkUoWBWnwfj/tl50E2RhCU3EAKrilFB36mDhhr0y/q5PYvGhcTJ/I7rkvu/1A2EPn0fMBUkaiXJgs3ggE4tw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <536f3049-41f7-b127-ba94-81925e34ea0f@suse.com>
Date: Thu, 6 Jul 2023 10:48:41 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v3 3/3] xen: fix violations of MISRA C:2012 Rule 3.1
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 "xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
 "ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
 "consulting@bugseng.com" <consulting@bugseng.com>,
 "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
 "roger.pau@citrix.com" <roger.pau@citrix.com>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>, "julien@xen.org"
 <julien@xen.org>, George Dunlap <george.dunlap@citrix.com>,
 Wei Liu <wl@xen.org>, Luca Fancellu <Luca.Fancellu@arm.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <cover.1688032865.git.nicola.vetrini@bugseng.com>
 <c9ff72160539cda49e726ac6ee1486be0d645180.1688032865.git.nicola.vetrini@bugseng.com>
 <771A1A80-0FC6-4D20-84FE-DA0A2DCFF14B@arm.com>
 <alpine.DEB.2.22.394.2306291218350.3936094@ubuntu-linux-20-04-desktop>
 <ff1a6435-d7ef-eb10-afe2-0fee33788924@suse.com>
 <8d730008-f7ab-20d3-69b1-52a83282e2a7@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <8d730008-f7ab-20d3-69b1-52a83282e2a7@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0179.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a0::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8227:EE_
X-MS-Office365-Filtering-Correlation-Id: 7dfcc17b-3698-4b33-9829-08db7dfdce12
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	tpNy11IF3efqht9iSfoZeb3gPkMKoB34MqO3ahfCz4MZ1PCGdiq585hLCOiOSHM9O4jyduYsMcEpmYeHqIBDxU9vgEdhCPD1MnedxaxjUo1gsMtwVUbU7hTc8ZFySGyeS2GkbikcJ17WbNuHpjAR02o7/DkfS05lFLb9rAYSUE3mZksT1KAORLp5mS+cyGVIET7JHkTaP+zFtNeh1sLSZaUylhymMO1tLPfG5bVH8PPwBul0j7dtWJ3ybZKPwi9UDSIBV8hoO5q7EQu87rNWJU2hSCvsngWim0MBbZZ3XqmT95r2/KP2tbeoRV9+rhW7oRSqv+wmkEQVsurxiwUqyv7jAFemAV1Ix/lwl7GDdOfZpazibVLvy+cC+yQXcqpgSExWd7TSitarBL+GXNvf2A5w6teUjSZKT6RyDY+CQSvgx3SyEd/gk0Zi4Y/RlQSpwj0QF4ETd5n2lnU5TiV8mEGGISrkcFInG1eEmtnkmKepFUm1gmq2MOpU7XQERPRuFWkg2yo73O/ny+zvuWMY4/7LZMhOSTxGaWXKKfC4g2MqQGAD1sz7JVs3Xt7BL+SnRsAsCDhmfCWn++G1Nmg3e2uuE262Ra7NRFJX38edER6gtQRd7W/vkEj4fJYEhrSk6P47dSlexXTuXyrXT02CdQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(366004)(136003)(396003)(39860400002)(451199021)(31686004)(7416002)(8936002)(8676002)(5660300002)(41300700001)(83380400001)(316002)(2906002)(2616005)(66946007)(38100700002)(6916009)(4326008)(66556008)(66476007)(86362001)(186003)(54906003)(53546011)(26005)(478600001)(6506007)(31696002)(6486002)(36756003)(6512007)(6666004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Qy96Z0ZJWHNmMDIzM3RzQURVYTF1SjNLQlF1WFFMWmRnQmRtdVNza0MwaHNE?=
 =?utf-8?B?bCtzSkczU0ZFVm1uMWlpcE1NVlkzcEIrUVcxbVZmNjJHMHlpU1BTakFXS2RX?=
 =?utf-8?B?OUptS1NqR0JaUjBpVy9zVGYxWjhpTThPREhsSnpIUElmUHBIMXRDMStCMktn?=
 =?utf-8?B?Wnovc2dtL01hWFhQY1VCVnFuVDl4ZTQ0ZHFVeUY3LzhM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QjJpMENUdjlwL21DWDFBK0x5UXBk?=
 =?utf-8?B?Qk9Sc2VQd2FweTlNa2FORVhqenE2djZPbnFjNjJ0K2pjRmFoNGZDeDlGSnY4?=
 =?utf-8?B?RkYzSTNMN0RQY0hmS1V0T2czcVpCZEdFenUxZFpJU1ZSQkRHUXBqekEwQll6?=
 =?utf-8?Q?rHaC0ET8ZB69D2vTif6YCQkOL?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7dfcc17b-3698-4b33-9829-08db7dfdce12
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 08:48:44.1599
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: n7eJzM8p8HNKxtilO9vDJdUYoWtzc3886ZOPUj8KXJSPi8YKvU69ASTdPfem51ds8pQ6yO3xxs1DVLllYrAChQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8227

On 06.07.2023 10:23, Nicola Vetrini wrote:
> On 04/07/23 17:57, Jan Beulich wrote:
>> On 29.06.2023 21:20, Stefano Stabellini wrote:
>>> On Thu, 29 Jun 2023, Luca Fancellu wrote:
>>>>> On 29 Jun 2023, at 11:06, Nicola Vetrini <nicola.vetrini@bugseng.com> wrote:
>>>>> --- a/xen/common/xmalloc_tlsf.c
>>>>> +++ b/xen/common/xmalloc_tlsf.c
>>>>> @@ -140,9 +140,7 @@ static inline void MAPPING_SEARCH(unsigned long *r, int *fl, int *sl)
>>>>>          *fl = flsl(*r) - 1;
>>>>>          *sl = (*r >> (*fl - MAX_LOG2_SLI)) - MAX_SLI;
>>>>>          *fl -= FLI_OFFSET;
>>>>> -        /*if ((*fl -= FLI_OFFSET) < 0) // FL will be always >0!
>>>>> -         *fl = *sl = 0;
>>>>> -         */
>>>>> +        ASSERT( *fl >= 0 );
>>>>
>>>> Iâ€™ve checked the codebase for usage of ASSERT, but Iâ€™ve not seen use of it with spaces
>>>> before and after the condition (like our if conditions) so I think they can be dropped.
>>>
>>> Yes, that's right. I am OK with this patch but I think we should wait
>>> for Jan's ack to be sure.
>>>
>>> An alternative that I feel more comfortable in Acking myself because it
>>> doesn't change the semantics of this code would be to change the 3 lines
>>> of code above with this:
>>>
>>> /*
>>>   * ; FL will be always >0!
>>>   * if ((*fl -= FLI_OFFSET) < 0)
>>>   *     fl = *sl = 0;
>>>   */
>>
>> While I'd be okay with this form, as Luca says it'll get us a different
>> violation, which we ought to avoid. While I was the one to suggest the
>> conversion to ASSERT(), having thought about it yet once more I'm now
>> of the opinion that _any_ transformation of this commented out piece of
>> code needs first understanding what was originally meant. Or
>> alternatively, while converting to #if form, to add a comment making
>> crystal clear that it's simply uncertain what was meant.
>>
> 
> About the violation of D4.4: the Directive was never considered for 
> compliance because it's an advisory directive, and hence considerably 
> less urgent.
> 
> Having looked a bit at the surrounding code, since *fl and *sl are used
> as array indices later in 'FIND_SUITABLE_BLOCK', I suggest using 
> something along the lines of "If *fl ever becomes < 0, reset it to a 
> safe value." (either using the form suggested by Stefano or an #if 0).

The main issue I see with any such transformation is how the
immediately preceding "*fl -= FLI_OFFSET;" is intended to interact
with the commented out code. My gut feeling (but nothing else) says
that what was meant would have been

#if 1
        *fl -= FLI_OFFSET;
#else
        if ((*fl -= FLI_OFFSET) < 0) /* FL will be always >0! */
            *fl = *sl = 0;
#endif

But of course without properly understanding the logic it might
also have been

        *fl -= FLI_OFFSET;
#if 0
        if ((*fl -= FLI_OFFSET) < 0) /* FL will be always >0! */
            *fl = *sl = 0;
#endif

> In any case this should become a standalone patch, right?

Preferably, yes.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 08:53:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 08:53:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559804.875134 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHKjy-0002jF-2u; Thu, 06 Jul 2023 08:53:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559804.875134; Thu, 06 Jul 2023 08:53:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHKjy-0002j8-0J; Thu, 06 Jul 2023 08:53:30 +0000
Received: by outflank-mailman (input) for mailman id 559804;
 Thu, 06 Jul 2023 08:53:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHKjw-0002j2-7x
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 08:53:28 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0608.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::608])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9281910e-1bda-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 10:53:27 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB9749.eurprd04.prod.outlook.com (2603:10a6:10:4ed::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 08:53:24 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 08:53:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9281910e-1bda-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=MJC6R65WUuCBJ5kDEh/FEAPz+gG4QLRu4aCamMi2I9VQ9ieE+F6551G5pOU/s8mWcq5mQr7PJCJhUj3Rsmk80ukdt+6+7izrXxJGd7dZmWh8UbrRCxjQ05ZpCu8Uoj4KZBCHt2WM/GjhLYipbhfJBelrCqFRDCHGFqGvwzWLqXQ7VU3EnHsQZAVMu3qiZy4zgqUGDKjAO8Lpv+zgygHWhbGOZ/v2a/hdnrx6qZaxRh4OYNrPJIw+3Y4Dp3g5s/gIKGq5zUp6wIUvpKKL1B72eCGJ3t2LqDf4sd8KRKHot8QXd/s4AXYyxC+yiS+ZFRyM26/gKhZtJJCl/iwHYtilYQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=2ZpOws28dab5EZe7Whl8rvvBliq7pfyOrkFq1YZ9tdw=;
 b=RQ8JbAaVISkVEZUa0+IYIjZFgOISTjea22qCpNW/IMJUMzIXmfOh3NtDgHQk8Vcmwqr3+Poy9TcevGoblWj6onKjb1SI/5W2IOMpSMUJL2GMGB0vdH9JsnAaDVPe/ADZ9P8j8z7/JBLFyTSbjubbHP78F5cE49AwOOFT71TTldmaIhs1DR0xNsvRBs6IU2DhWeLlnPKYJ9jj5hQ/2Eje3ZjM7YWzr0Fpkb2ycUkYhX/rzlY4BrMWyqejrw5fd6AzWCRYmWJa27KhZiSQZa/zN/nNgpcLKElVDdkmXWdKtzl9XWgVr8HM4D72Nmwxho3BUVysOvKTCSyvGbraDfOEpA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=2ZpOws28dab5EZe7Whl8rvvBliq7pfyOrkFq1YZ9tdw=;
 b=W56Ye9qnvtzYp5yQOcKVJ/b1e66QwLAS6JBcKNOmprBDCXzSfRKGFLgqloDLuSCfAQJ4aYKJH+QbDZvtNrHEHhjjfpHgNKh150+FNCx2ePriEe42R1pdBjPOPovL6xmkH8lGm5Z4wFYRCSIPT328Ee9U4s8+66KC2QehkLF5NfKTz/HTtySrcCXmPGhC7kOYDOzBX5Ll++RO0BMSi9e5sQXS/QVJSdEDQonI5AkkjM3l1VkvsEjGHkADG31uAlwERXrWocKzVp+9Sz3dMA4o/VV6YDV6dIptuPTLfFWTWWjj8NPVPy4wclle5oQW91+rLBjQ2d/SbXKrIG+2Znl/JQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <4bf7b868-1a48-17e0-e268-7a076a532647@suse.com>
Date: Thu, 6 Jul 2023 10:53:21 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: Backport request (was: [PATCH v2] tools: convert bitfields to
 unsigned type)
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
 Juergen Gross <jgross@suse.com>, George Dunlap <george.dunlap@citrix.com>,
 Anthony PERARD <anthony.perard@citrix.com>
References: <20230508164618.21496-1-olaf@aepfle.de>
 <ZJwBkHLwKJNuhekG@MacBook-Air-de-Roger.local>
 <4d049335-71fd-8fe0-0f9a-dfdd16fcf41e@suse.com>
 <ZKRA_X9uudh6TRov@MacBook-Air-de-Roger.local>
 <39e5b62b-d863-ad2b-5e9a-461fab6c9d31@suse.com>
 <ZKREeO2XJ9C8FYOM@MacBook-Air-de-Roger.local>
 <cbca26b0-b6a8-c529-8a41-6fc58965eaf8@suse.com>
In-Reply-To: <cbca26b0-b6a8-c529-8a41-6fc58965eaf8@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0012.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1d::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB9749:EE_
X-MS-Office365-Filtering-Correlation-Id: 6d981b29-b358-4f96-8410-08db7dfe7502
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	dcpy9BmN/P5RLThD53is45d2DaCBsPd5e9JLz5v4tnUWhdEuQfWiMSwcq9FeeQpT2D0gbeX/vQnu5tCEvEJtUtxxlILRFqYYbEJUe7I5p1O90ykZYL403scQMHULoJ2e/ucZHmweu/9pv5R37RuhYg5xzMAzP8i3ryF/YFZ7NzOJErtwSokyxwDkmbDlux6/hG6BuJHVmWMyIYEuJOXb/7GHDTU0G3Xr8yVz9yREKbj84gbjZ05qZHHwZFtHFh9JNwDjbJtf2uCOI5GjN9zQMjWSdiAXAUO5suw4Als8Ofx8f3liBNVa5hi3Ltz3y39c+CgJkMJaOKY/pNpEb/VESdLewUbyhLtj3jR6+Ksae70NyYFata+1apM6mp1sObBeuycMgpQoI2IeOJfx7AmZP7oZF2wdTwgS7LWFy0rgdiRApHI44y97Ln5eB/hfFYW1J5mRxlnn8rT/+BwmEd3tLjRXrYgSAsjL/2Bs/BYqksvmty7jQT2FE7ZN6iW4xzYBqKghAmTmADM/PyKC8W/Dlrso0reko5yvry53OmWj+oLA9JpvbFgcXDk39zVohnMBnMWGU1FQUiuoJ8bi2FqyX5RkYsjNOzio8zxsjop8OXV78Ewh/W9rmMT9FaijIVgyyawFrZHBI26EcvQEcZw76A==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(376002)(39860400002)(366004)(346002)(396003)(451199021)(66946007)(8936002)(66556008)(5660300002)(31696002)(86362001)(2616005)(6506007)(83380400001)(41300700001)(4326008)(66476007)(6916009)(316002)(53546011)(6512007)(186003)(26005)(478600001)(54906003)(6666004)(38100700002)(6486002)(8676002)(36756003)(31686004)(2906002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?R2dDSGhnMDd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
 =?utf-8?B?NS8ySU5NZ2VmeGZyb1ZSYzFnczRQSWxjNkF3UFkwMjFYRkRIT3ZCYkd6NzJ2?=
 =?utf-8?B?NlRZRkdEdzEvNHd5TkppYmhGamE5ei9abVdoTm5DdmVtWHlKMlhxQ1RBRTJj?=
 =?utf-8?B?cWNMcERXWVcrM2pLakp4c0dUeVZQQzcwV2YwaklLZzRWRkVyc0lJRHhvRXpm?=
 =?utf-8?B?YzkzK2tQTGQ5SWtjN2xKaUdtWDdPNS84cGtzTTY3eEhocHA4alFXOFhqWnN3?=
 =?utf-8?B?QXZqcTlLajl2UStzVUFxdUtqSUlpekhxYWJBR096SHlCR1c3WStYU09EU3Bl?=
 =?utf-8?B?OXE1YXZaZjI5NGlSNW9zVTdzOVRacis5NmJVaU9CMUxuMk5SQnhhekdkSm1s?=
 =?utf-8?Q?LkC+EpDfFMPvjs2SyG03v+pqa?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6d981b29-b358-4f96-8410-08db7dfe7502
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 08:53:24.2767
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: g2gJNfAoCkgpMiFdyh4LI9NLKPd705My2hr6o1cLsUy2tcQCS+lgtBcC1TDUE5hNIjsUhTTn3jFc+55OX+p/UA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9749

On 04.07.2023 18:16, Jan Beulich wrote:
> On 04.07.2023 18:10, Roger Pau MonnÃ© wrote:
>> On Tue, Jul 04, 2023 at 06:04:36PM +0200, Jan Beulich wrote:
>>> On 04.07.2023 17:55, Roger Pau MonnÃ© wrote:
>>>> On Tue, Jul 04, 2023 at 05:42:33PM +0200, Jan Beulich wrote:
>>>>> Plus is the mentioned
>>>>> "potential ABI change" safe to take on a stable branch? There's not going to
>>>>> be any SONAME change ...
>>>>
>>>> Is there any ABI change in practice? Both fields will still have a 1bit
>>>> size.
>>>
>>> But what a consumer of the interface reads out of such a field would change
>>> in case their compiler settings arrange for signed bitfields when signedness
>>> isn't explicit. We don't dictate, after all, what compiler settings to use
>>> with our interfaces (which generally is good, but which bites us here).
>>
>> Hm, I see.  I would argue that sign doesn't matter here, as those are
>> intended to be booleans, so anything different than 0 would map to
>> `true`.  But implementation might have hard coded TRUE to -1, and the
>> change would then break them?
> 
> That's a possible scenario I'm wary of here, yes.
> 
>> I'm failing to see that, because those implementations would still use
>> the old struct declarations they have been built with, and hence would
>> still threat it as signed?
> 
> Until they rebuild against the updated header, without any change to
> their code.
> 
> Anthony - do you have any thoughts here?

Btw in the meantime I'll queue the uncontroversial part of the patch
for backport (with a respective not about what was dropped).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 09:11:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 09:11:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559810.875144 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHL0v-0005Nn-La; Thu, 06 Jul 2023 09:11:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559810.875144; Thu, 06 Jul 2023 09:11:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHL0v-0005Ng-Iy; Thu, 06 Jul 2023 09:11:01 +0000
Received: by outflank-mailman (input) for mailman id 559810;
 Thu, 06 Jul 2023 09:11:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=pJ4M=CY=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qHL0t-0005Na-Vv
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 09:10:59 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 052aa002-1bdd-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 11:10:58 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 22198204D8;
 Thu,  6 Jul 2023 09:10:58 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C3627138EE;
 Thu,  6 Jul 2023 09:10:57 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id t1UTLiGFpmQdTgAAMHmgww
 (envelope-from <jgross@suse.com>); Thu, 06 Jul 2023 09:10:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 052aa002-1bdd-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688634658; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=s1QrIZhNYZZ8gmVYX7ogc12++MCXKbi/IylLaKA4CAI=;
	b=PyOZgwHruYftmZd6RSYQTzipuGPGIqamb4T0B+kChpRqMSGIEM5TCm7fchOAgD9w3RLoqg
	r9Y3mm1u8n0AEXYT+voD/HOrYNTEpOJ1x/X/S3zcgjnjTyvcSUWMemh24PM1/EtJhnqa4h
	JuUKJoEM2KA248vyFB72DQw9XnPbsnU=
Message-ID: <75cb1f1c-cfff-8976-6ab6-d226577829c3@suse.com>
Date: Thu, 6 Jul 2023 11:10:57 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 xen-devel@lists.xenproject.org, Simone Ballarin <simone.ballarin@bugseng.com>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <9e0d463e2fc09193a742fc7a64a331855705a4fb.1688559115.git.gianluca.luparini@bugseng.com>
 <290e4dbf-c9c9-49c9-29ea-6fc9b9a5a4fc@suse.com>
 <a55021d5-39d9-a928-4b82-6bc6a02b42ef@suse.com>
 <006e528d-8955-8324-ed58-bb0bc0e72acc@suse.com>
 <763fdbb2-d63b-906a-7432-f3b1e14cbb3e@suse.com>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [XEN PATCH v2 09/13] xen/public: fix violations of MISRA C:2012
 Rule 7.2
In-Reply-To: <763fdbb2-d63b-906a-7432-f3b1e14cbb3e@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------iWlzB0JQYRtJgCaS7Upw4zGw"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------iWlzB0JQYRtJgCaS7Upw4zGw
Content-Type: multipart/mixed; boundary="------------gP2k8k3jXK7DAqGsDZe0wnse";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 xen-devel@lists.xenproject.org, Simone Ballarin <simone.ballarin@bugseng.com>
Message-ID: <75cb1f1c-cfff-8976-6ab6-d226577829c3@suse.com>
Subject: Re: [XEN PATCH v2 09/13] xen/public: fix violations of MISRA C:2012
 Rule 7.2
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <9e0d463e2fc09193a742fc7a64a331855705a4fb.1688559115.git.gianluca.luparini@bugseng.com>
 <290e4dbf-c9c9-49c9-29ea-6fc9b9a5a4fc@suse.com>
 <a55021d5-39d9-a928-4b82-6bc6a02b42ef@suse.com>
 <006e528d-8955-8324-ed58-bb0bc0e72acc@suse.com>
 <763fdbb2-d63b-906a-7432-f3b1e14cbb3e@suse.com>
In-Reply-To: <763fdbb2-d63b-906a-7432-f3b1e14cbb3e@suse.com>

--------------gP2k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WQgb3INCj4+IHNwZWNpZmllZCwgaW5zdGVhZCBvZiBhIG1peHR1cmUuDQo+IA0KPiBGdW5u
eSB5b3Ugc2hvdWxkIHNheSB0aGlzLiBTaGlmdCBjb3VudHMgYWxzbyBhcmVuJ3QgYWxsb3dl
ZCB0byBiZSBuZWdhdGl2ZQ0KPiAuLi4gRm9yIHRoaXMgcmVhc29uLCB0aGUgcGF0dGVybiBJ
IHNlZSBoZXJlIGlzIHRvIGhhdmUgVSB1bmlmb3JtbHkgb24gdGhlDQo+IGxocyBvZiB0aGUg
Pzogb3BlcmF0b3IsIGFuZCBub3doZXJlIGVsc2UuDQoNClllcywgdGhpcyBpcyBvbmUgd2F5
IHRvIGxvb2sgYXQgaXQuDQoNCk15IHZpZXcgd291bGQgYmUgdGhhdCAoYXQgbGVhc3QpIHRo
ZSBjb25zdGFudHMgdXNlZCBmb3IgQU5EaW5nIHNob3VsZCBoYXZlIGENCnVuaWZvcm0gVSBh
dHRyaWJ1dGlvbi4NCg0KSW4gdGhlIGVuZCBJJ20gZmluZSB3aXRoIGVpdGhlciB3YXkuIEkg
anVzdCB3YW50ZWQgdG8gcG9pbnQgb3V0IGEgc2xpZ2h0DQppbmNvbnNpc3RlbmN5IHdpdGgg
dGhlIHBhdGNoLg0KDQoNCkp1ZXJnZW4NCg==
--------------etbgSaCZ7o6tfSfBKn65tHLo
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1O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jpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------etbgSaCZ7o6tfSfBKn65tHLo--

--------------gP2k8k3jXK7DAqGsDZe0wnse--

--------------iWlzB0JQYRtJgCaS7Upw4zGw
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSmhSEFAwAAAAAACgkQsN6d1ii/Ey/D
gAf6A8bAsOA96ptHUcpH9ntk0i91tEg/EaB5hlusZ0hhzM2O82L8p/uIy57kGusUmmQjmTR0ASfv
SUB9nYLB2QEHMTokbwqJ4nZwiyuwFA/Ga/Ej/WsZoP8+nf86gHrjxykdvaJT7t6rJnNjOysJTKtv
4J4nqFSActzJ4UDwu5rsaO+ZSP4+TrElX3IVPdyU0ZlfnspaFVsLKwBcczrBi+wI4yRVqnFS77oJ
xDeiMV5dcVoQInQ+W2S0Lu9paJ8VhF+qvvdtAu8JqHA+n4DgvEC8wwcDYYhLSP6ONLfY1EakXGka
p3bmLRUtyGX5XkIV6Xq9+1EiKRi6DNzUwLvb6GJl1g==
=jQiX
-----END PGP SIGNATURE-----

--------------iWlzB0JQYRtJgCaS7Upw4zGw--


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 09:17:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 09:17:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559815.875155 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHL7W-00060r-DH; Thu, 06 Jul 2023 09:17:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559815.875155; Thu, 06 Jul 2023 09:17:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHL7W-00060k-AY; Thu, 06 Jul 2023 09:17:50 +0000
Received: by outflank-mailman (input) for mailman id 559815;
 Thu, 06 Jul 2023 09:16:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pr8h=CY=vivo.com=zhangzehao@srs-se1.protection.inumbo.net>)
 id 1qHL6F-0005zS-Cv
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 09:16:31 +0000
Received: from APC01-PSA-obe.outbound.protection.outlook.com
 (mail-psaapc01on2072e.outbound.protection.outlook.com
 [2a01:111:f400:feae::72e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c9d1adff-1bdd-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 11:16:30 +0200 (CEST)
Received: from TY0PR06MB5706.apcprd06.prod.outlook.com (2603:1096:400:272::6)
 by SEZPR06MB6644.apcprd06.prod.outlook.com (2603:1096:101:181::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 09:16:22 +0000
Received: from TY0PR06MB5706.apcprd06.prod.outlook.com
 ([fe80::d6ff:1295:38d7:a019]) by TY0PR06MB5706.apcprd06.prod.outlook.com
 ([fe80::d6ff:1295:38d7:a019%7]) with mapi id 15.20.6565.016; Thu, 6 Jul 2023
 09:16:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c9d1adff-1bdd-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KQg2l9U3FZwPKer7Tr+6BMCuTknxh2PaVDmRl8/b9Q+CsGtfwF77PvlNRXwEmxlcyjVeveog9TWikvpunioNL+zXR+/l3VCTRqDkyTu+vzpigX/K17SQ86vC/hPvoa8zgW1IXr5zMVJKl08hiA8NdsGAsyHKpgqu7Io+WcrGuGyzgtOOrgtTNpAwQV+Mujd/wJZanOZ1eK41+JSRGQEC2LdarR6egO7aZ9ki9cN79dgo+iuh769Kg5bHF5u5aCqLOnKeg+z8pARwSZWmwXki+7+HP57/cTviqNKC7Lp807Bv48V1aOsEyLEIeDVOu4dkJyM0c49UmXlF9I3rD84J7g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=TC40/Mk4pipYtQMPyX5G7aM5k75xPSo9LeZORXXwFLM=;
 b=iVZwERdTueaVUWkcP/g3KSptDC8Nl76uoVohYGMYG4e3XZXekd3GKCyX9urPrW2NFQuhiKhOYOW2er+gV7aRY7Xhwrf8Q4xnk9vK9V4f8m2uR90sauZgqxZrx7K9GaitTSK1oVbQCyrkTbUB1gH6vJfXg4i09VyCBBEPgeTV/r7HP4P5XWd/Q9ZBeSbbhL6/o8JAMkN/btjPbWJFv8WPM+UASn3/tH7s4tN5kXcCmnCzy4OYop0QE+NySQR+gnhy+wELHh337llEHpTe5EayjGh24Bel1B6J3P6qhIAK90cIJVaya1asys9O/veIILJ963/tVl14ZV0yIO3RbaOLjg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com;
 dkim=pass header.d=vivo.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=TC40/Mk4pipYtQMPyX5G7aM5k75xPSo9LeZORXXwFLM=;
 b=YPpV2D6Kzr1+ckGZxDnqD1v8CRhzKqmxD5VhufI0tByx6qBGjR/bghcaCHdi/QAgsOOW0K0QIJ7i5q82ef2SwiKRYm9X8J61LGdHHDN1cJgJ4AUtGkiqcBh+sm2B175NribjWTzNlFwIxneNETyd+uw5+hjVr1INj/5Enb1+w8s35JAXyKFm7W2vZK1ENa/YajSb/JHqiFmOy85DDEVq9uvKDPg+nvz3kcUoHcNxQwHNhsV4rbc0OxKhaDly3JVVpRM9EfmAWeRFp1uzb1tEPnf95AmK/IJXURj9MO1Ia9PXcOY/Qd66XEjCHAITPunLsY91P5knapZEL3EC3ttsKA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=vivo.com;
From: Zehao Zhang <zhangzehao@vivo.com>
To: roger.pau@citrix.com,
	axboe@kernel.dk
Cc: xen-devel@lists.xenproject.org,
	linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Zehao Zhang <zhangzehao@vivo.com>
Subject: [PATCH] xen/blkback: Convert to use time_after_eq macro
Date: Thu,  6 Jul 2023 17:16:13 +0800
Message-Id: <20230706091613.40136-1-zhangzehao@vivo.com>
X-Mailer: git-send-email 2.35.3
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYCP286CA0015.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:400:26c::19) To TY0PR06MB5706.apcprd06.prod.outlook.com
 (2603:1096:400:272::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: TY0PR06MB5706:EE_|SEZPR06MB6644:EE_
X-MS-Office365-Filtering-Correlation-Id: 0cfb6c15-44c5-496d-0214-08db7e01aa79
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	qob8ffNRD+wzU20BEmolrHKDTaimOfoJRM/Ktyh8gfiiOjn545q71M632RsMINJIi1GRuRud+zbKeT21h2LyV8p21bVRVcy6u+0DYx8fT4DBW1U4XOPYmh+uUKnCvMlwiHCfn1kvP38obepKYq3Xvse/qIyhjl+ODFmd9QkcxMjPpzzXClcbdBNnxPbhCEGQe4SxeIa7r9LlqqGBc/JFi5WOYsAgVjKbQaTv2QDyt1XO3ovkRvpcB3hk1y2ZG4lF44FsUrLIZrDvu4AK7ldNq1nOotheToVwX/aGqZHGioOIvVUlJtyTRRSOUaKj8ezNkAG3p3MGvGlLxeoVf1mPoM1O8jb0gBN1HozmAtHYCGqKENs7UPc2SZz4TNHxESoAxZySwOY1K36hqup31gqt1VtCfxQrf2nFecpLMIHFH6b8kgIviBRj6McTDNMElqc0NXbtwd/1Z5gASkIGH0uLTxAuiX7mjN7j9hPZ/aQlTPEFVMGPNadBZjnSclPqluJrlXUW/AxkTc1T+l3opjNQ7+IsSD+Usorw8gK7zEIBT9isJK2eBI37CWv0nK+hax8aoU+wWzzq4mNsEQNPEBY8Np2NReCBEL3GjTb9hf1t3tcJrmAMmj3jpd83HYsrvt0g
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TY0PR06MB5706.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(376002)(366004)(346002)(136003)(451199021)(2906002)(5660300002)(2616005)(86362001)(66556008)(66946007)(8676002)(8936002)(6506007)(6486002)(6666004)(26005)(1076003)(478600001)(52116002)(107886003)(186003)(6512007)(38100700002)(38350700002)(83380400001)(66476007)(4326008)(316002)(36756003)(41300700001);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?cxLkbjFMD31cFBSS80uSjWUy1fz8HLX+CTquCDBX4zzdb9wHOwUInrMXAzBy?=
 =?us-ascii?Q?Vp0lRKEZE9MYYDLsjNPoQCQkBGI8jwx6G7ZojQeFMGjs5QN1AvIPEezZAPrn?=
 =?us-ascii?Q?GEr15q6r/zz8qGJleOBeABX9vfRWh0N7oTl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w/y/6YuLoWzHKB?=
 =?us-ascii?Q?KYMg4ERUMgrEiQqx/+h6qTMmI80A+5+myXvfgPaSZJy5/X5nkpgPzUAqPVAr?=
 =?us-ascii?Q?U0yAQGdikZxzgwz+L3pIBlBrrzlKxB9FB8/gGm6iwBemVy/UYEySfpTvmArd?=
 =?us-ascii?Q?0n7u9B3nR9ZJTgzRDur3e7QkM78C5H2b6JV3C5oPeAdmpxgJpmyN5Ao8G8+g?=
 =?us-ascii?Q?2q1yposGeJcoOk8Av6KE5WDAVqi4EEH6GLlcY+dBZTwYv82mo4NANTOhzSFq?=
 =?us-ascii?Q?4sqLnTuLHNUQlgiHW+OyYhL4fbomXOEhHdAyFkkrnPsDgxQ1qJqSvDri8osq?=
 =?us-ascii?Q?u69QyKb/M4tKsJcvfmP/gFnbTWfFZNIHK2X93+hcyqz5pvuV/a6Rj+tg5AOH?=
 =?us-ascii?Q?LxkuiIYDEE7EwDGruhmKcvohpQRjM3kuxZVGtL5ekOMPU70hIabt8+Jn7bLZ?=
 =?us-ascii?Q?gJp2oWSk1hh0ltPpe5w3DYeqsWJ+ZhNsScbgx5rHhCrs8gCbq/92L/wnwvaQ?=
 =?us-ascii?Q?mdqi3R+0G3QgAuIs32ngLViv8abOjVhnJQuqIb9E4jJ7TcaOqZUfM3xWrTE0?=
 =?us-ascii?Q?Og9RO5567X8/Geif6jGSz95O/83EKkuERxFS4MYt?=
X-OriginatorOrg: vivo.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0cfb6c15-44c5-496d-0214-08db7e01aa79
X-MS-Exchange-CrossTenant-AuthSource: TY0PR06MB5706.apcprd06.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 09:16:22.7995
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 8VOZVjM2kgNNbV09fogH6VvaM81sWFIbx7bxCXQT+r3yDYZMBdO6tBF4evhKmWHHdb8PYXd4I3v9yzhSXyhyEA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB6644

Use time_after_eq macro instead of opening it for readability.

Signed-off-by: Zehao Zhang <zhangzehao@vivo.com>
---
 drivers/block/xen-blkback/blkback.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index c362f4ad80ab..77b1b1785eb3 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -42,6 +42,7 @@
 #include <linux/delay.h>
 #include <linux/freezer.h>
 #include <linux/bitmap.h>
+#include <linux/jiffies.h>
 
 #include <xen/events.h>
 #include <xen/page.h>
@@ -134,8 +135,8 @@ module_param(log_stats, int, 0644);
 
 static inline bool persistent_gnt_timeout(struct persistent_gnt *persistent_gnt)
 {
-	return pgrant_timeout && (jiffies - persistent_gnt->last_used >=
-			HZ * pgrant_timeout);
+	return pgrant_timeout && (time_after_eq(jiffies,
+			persistent_gnt->last_used + HZ * pgrant_timeout));
 }
 
 #define vaddr(page) ((unsigned long)pfn_to_kaddr(page_to_pfn(page)))
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 09:51:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 09:51:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559820.875165 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHLdk-00022i-SW; Thu, 06 Jul 2023 09:51:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559820.875165; Thu, 06 Jul 2023 09:51:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHLdk-00022b-PB; Thu, 06 Jul 2023 09:51:08 +0000
Received: by outflank-mailman (input) for mailman id 559820;
 Thu, 06 Jul 2023 09:51:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHLdj-00022T-Ce
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 09:51:07 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20602.outbound.protection.outlook.com
 [2a01:111:f400:7d00::602])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9eb6cef5-1be2-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 11:51:03 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB7548.eurprd04.prod.outlook.com (2603:10a6:10:20c::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Thu, 6 Jul
 2023 09:51:01 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 09:51:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9eb6cef5-1be2-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=TWl01o09j+mH5zmoiSRsAMLaipay7z6zSX5+/rVPUTLWRwsZVr3KFB9dyNnyLs6GWwvmFBWyLcr1j21dO3eapGMwNwc7G+SWZGg96o8Q1d2/GORxoxCr/ocJOpscwJ8kC1qgXrS+l7H9BTW0cBfsk4Gw7f/K7iNcxYl45Ajz9p8HZa6LMRQxpA0ID/QbIixVXeHESdt18BuMoguWwod1m6iCiwTpIxLoSkzt2nXmYHHpq7AxYRyK5Ih/x/SPS+MQTyqaT2m9C53OOui8KapXNhwboEPSuBd35EYzwGp5wM26/cpKj9kBke+UCvo3vp8HwpDmuZwMpGVk0e0uUG4aMQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=qU2zuEB2aWoDPFyG6rz9hcymQi25LlvFvg+n83waVrc=;
 b=a1+YVTZDnD+wJL/Lk1DbvtWHBPut15blUEG5eR2xCINEkj0LCPAE+ntC3dqcSd8Ew89FzhYfeJB4rOa7ChZPijt1V3IrVDZ5UV0RPVcLrgcJo+iQVEPSKTtQtb6dVkMbrHIYYZnEUNCXhFLMOfQV0oI8nv+d9FpDIKoj5vVgORl6IWw7M/T4Y3uBUv0DSTGq0BiW8/m7WFe4zq9yqgWNthgF31nqlgrq/lbtnUSc3XAduFLyyeqEYxIQ/36oPeis71A1n6LTvZFPrgktv3AqWYbth3Bw3OQ6t5AHA9f8t2QB3ZPepPWquzmVg2NfeUFZruoqRz0rJtCm+uSItGk5SA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=qU2zuEB2aWoDPFyG6rz9hcymQi25LlvFvg+n83waVrc=;
 b=zjQ9YeCmENSDdAZSZ/9IBQc2ZqZQEmxZuFsDISYcneDeYNHvMeJ0a2V5BNW77/3gAI2FsskXI6h9M8sy/ZMX1zg4oW/oH3YS85lfCjN1UDW9KxuUmKx+UPhVuqqCSWTLeNTt0+65DsniJV25O5rOElXzXmLzbARFJ6HNlA6leIb3bjRxMeB4ZztzbklA4zmewOXuZZMtLIrGD1nwT3+/wjdxrFHEbnDeruD9ByeCyfNqCMTp3yxelwvE1NIe2piTSkMFdcOCNW1zBfWaHMg0TCnyIwBEz/iVYBdlfKvUGzYgvCkzmFQhEyREurbBJn/3fM5cQ1jZJV9tkWXfRLpGqA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e7d3daa3-7d5b-1c36-51f1-453bf11b55d2@suse.com>
Date: Thu, 6 Jul 2023 11:50:58 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2] mm/pdx: Add comments throughout the codebase for pdx
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230622140237.8996-1-alejandro.vallejo@cloud.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230622140237.8996-1-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0014.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1d::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB7548:EE_
X-MS-Office365-Filtering-Correlation-Id: 83aa8f4b-8bc7-40a9-52d5-08db7e068175
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	UxuphrxQgZCYbkV+ugoJCYilUMbFP1kh5C451Z+qsxV1D+npaDmc29R3y9fV3pJym4mv01FIwy0FRDiNeZ7XHStFEeJ3FnnBJGG82SOKqi1hyBq3WC1DrOEstI3oNEuMuGZbCJroLHTsC5gUFBIaiM/Buz7vzYUEd4NihKZSb0DGnmKgXhd8Xn5KOu+AgMvxLbk/ryraQ3BVCaUybiDFu8zTBDB0WHybioJpuF40uA4WQYIgNf0+B83oezyvqXQjAneMnfyCAUkLAaeZBr+fjWn+BhTf3lnSq7JvXxXw0NXaCq4KFXhSO5MIZSfwtDugY9ihP51KzOvIIGGkEQ2LAT3mT9ve4FzAnE9cAc6amYS34hsiSWQMx/5xWNNidrlGPJzrCRHKmkEdU0pVF/Gb+B7yhZW9Zwr56q7ye7GhBa3/+QAfEj5qWCKyK6Ivmg21megl/UYRnkU8oTpvvXOEcDkvxeg3BzKk6EJexXAVL5J+Q4+3Tib3IFFS12O2SONhbIUgT7p6SbSJqwAP9JWRMjI41/5tHUlDX5hS4A30XIRp7Zs9CdRzi1v0z/VaqFdj7Yehov+uF63HkjzvZcw/Yv7p6P+ryjahf0Tv+Ue/B6t26vFxkOE7Kd4IHCUg0o/anECD2z3XFYYSQQpmL+UJwA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(136003)(376002)(396003)(39860400002)(451199021)(6506007)(53546011)(6512007)(6916009)(38100700002)(316002)(66946007)(66476007)(66556008)(4326008)(2616005)(83380400001)(66899021)(186003)(26005)(478600001)(54906003)(2906002)(31686004)(8936002)(8676002)(36756003)(5660300002)(31696002)(86362001)(6486002)(41300700001)(6666004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aDNMNDNBdVRmUDhWY2t3Sks3cU5BK2ZkYTEyVTN0STVkYmVaYTZ2dVJIUjNv?=
 =?utf-8?B?QTlDazdhK3N4M0tTdVlOM0dJZVpqdHhZRTlmZTRGNm5HSnhTZHN0bWo5SDNX?=
 =?utf-8?B?QWdvYUw0WTZoZnh5N2ltWUsyc0VsM2E0d3E1N2I3TE5ySkk2SXVTWS85RGtJ?=
 =?utf-8?B?OUZZN3hCQVpTZzI4STNqTEJnclFJK05xcHNOQUdMVDlOckNUL2RQaE9vVEFw?=
 =?utf-8?B?anE1TUEzTGlCd0dMbHMxdSt6Qlh0aTlSMG9XdTZJbGNldnNBTndxNGQwbS9h?=
 =?utf-8?B?dkJOVjRUU2JVc3E5b3R6YnNMdmZqRlNmWXRYeU5wVWxjZVY2VzFIazlBMEla?=
 =?utf-8?B?QzdRSDNvY0hqVjEwUlV5dGdBRGJacmROYmdvTEdlM0VNZ3dObHcrSDJWZmkz?=
 =?utf-8?B?SDVFclMvVWhPVUJZdVNVU0R2MWhHTFJ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-Message-Id: 83aa8f4b-8bc7-40a9-52d5-08db7e068175
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 09:51:01.0949
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: cYgtNOUCKiC+ira8LKcjevyffuoDzt7mOA/7df1bnDJv/3EZ5CR9nVvn7II1F0/RHilMx9G6VFp1gskyPWu3rA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7548

On 22.06.2023 16:02, Alejandro Vallejo wrote:
> @@ -57,9 +100,25 @@ uint64_t __init pdx_init_mask(uint64_t base_addr)
>                           (uint64_t)1 << (MAX_ORDER + PAGE_SHIFT)) - 1);
>  }
>  
> -u64 __init pdx_region_mask(u64 base, u64 len)
> +uint64_t __init pdx_region_mask(uint64_t base, uint64_t len)
>  {
> -    return fill_mask(base ^ (base + len - 1));
> +    uint64_t last = base + len - 1;
> +    /*
> +     * The only bit that matters in base^last is the MSB. There are 2 cases.
> +     *
> +     * case msb(base) < msb(last):
> +     *     then msb(fill_mask(base^last)) == msb(last). This is non
> +     *     compressible.
> +     * case msb(base) == msb(last):
> +     *     This means that there _may_ be a sequence of compressible zeroes
> +     *     for all addresses between `base` and `last` iff `base` has enough
> +     *     trailing zeroes. That is, it's compressible when

Why trailing zeros? [100000f000,10ffffffff] has compressible bits
32-35, but the low bits of base don't matter at all.

> +     *     msb(fill_mask(base^last)) < msb(last)

No caller uses the result this way, so I'm unconvinced it is helpful
to explain it here this way. This is also why I'm still not convinced
of the introduction of "last" (as a real variable and in the comment).
It's only the invariant bits in the range that we're after, as you
say ...

> +     * The resulting mask is effectively the moving bits between `base` and
> +     * `last`.

... here (where things could be expressed without "last").

In any event, nit: If you introduce a local variable, then it wants
following by a blank line.

> --- a/xen/include/xen/mm.h
> +++ b/xen/include/xen/mm.h
> @@ -31,6 +31,16 @@
>   *   (i.e. all devices assigned to) a guest share a single DMA address space
>   *   and, by default, Xen will ensure dfn == pfn.
>   *
> + * pdx: Page InDeX
> + *   Indices into the frame table holding the per-page's book-keeping
> + *   metadata. A compression scheme is used and there's a possibly non

s/is/may be/ ?

Also as said earlier at least on x86 pdx-es are also used as direct map
indices. I think this wants mentioning irrespective of what Arm does.

> --- a/xen/include/xen/pdx.h
> +++ b/xen/include/xen/pdx.h
> @@ -1,6 +1,67 @@
>  #ifndef __XEN_PDX_H__
>  #define __XEN_PDX_H__
>  
> +/*
> + * PDX (Page inDeX)
> + *
> + * This file deals with optimisations pertaining frame table indexing,

Nit: Missing "to"?

> + * A pdx is an index into the frame table. However, having an identity
> + * relationship between mfn and pdx could waste copious amounts of memory
> + * in empty frame table entries. There are some techniques to bring memory
> + * wastage down.

Like above the direct map wants mentioning here as well, I think.

> + * ## PDX grouping
> + *
> + * The frame table may have some sparsity even on systems where the memory
> + * banks are tightly packed. This is due to system quirks (like the PCI
> + * hole) which might introduce several GiB of unused page frame numbers
> + * that uselessly waste memory in the frame table. PDX grouping addresses
> + * this by keeping a bitmap of the ranges in the frame table containing
> + * invalid entries and not allocating backing memory for them.
> + *
> + * ## PDX compression
> + *
> + * This is a technique to avoid wasting memory on machines known to have
> + * split their machine address space in several big discontinuous and highly
> + * disjoint chunks.
> + *
> + * In its uncompressed form the frame table must have book-keeping metadata
> + * structures for every page between [0, max_mfn) (whether they are backed
> + * by RAM or not), and a similar condition exists for the direct map. We
> + * know some systems, however, that have some sparsity in their address
> + * space, leading to a lot of wastage in the form of unused frame table
> + * entries.
> + *
> + * This is where compression becomes useful. The idea is to note that if
> + * you have several big chunks of memory sufficiently far apart you can
> + * ignore the middle part of the address because it will always contain
> + * zeroes as long as the base address is sufficiently well aligned and the
> + * length of the region is much smaller than the base address.

As per above alignment of the base address doesn't really matter.

> + * i.e:
> + *   Consider 2 regions of memory. One starts at 0 while the other starts
> + *   at offset 2^off_h. Furthermore, let's assume both regions are smaller
> + *   than 2^off_l. This means that all addresses between [2^off_l, 2^off_h)
> + *   are invalid and we can assume them to be zero on all valid addresses.
> + *
> + *                 off_h     off_l
> + *                 |         |
> + *                 V         V
> + *         --------------------------
> + *         |HHHHHHH|000000000|LLLLLL| <--- mfn
> + *         --------------------------
> + *           ^ |
> + *           | | (de)compression by adding/removing "useless" zeroes
> + *           | V
> + *         ---------------
> + *         |HHHHHHHLLLLLL| <--- pdx
> + *         ---------------
> + *
> + * This scheme also holds for multiple regions, where HHHHHHH acts as
> + * the region identifier and LLLLLL fully contains the span of every
> + * region involved. Consider the following 3 regions.
> + */
> +
>  #ifdef CONFIG_HAS_PDX

Stray last sentence in the comment?

> @@ -13,22 +74,81 @@ extern unsigned long pfn_top_mask, ma_top_mask;
>                           (sizeof(*frame_table) & -sizeof(*frame_table)))
>  extern unsigned long pdx_group_valid[];
>  
> -extern uint64_t pdx_init_mask(u64 base_addr);
> -extern u64 pdx_region_mask(u64 base, u64 len);
> +/**
> + * Calculates a mask covering "moving" bits of all addresses of a region
> + *
> + * The i-th bit of the mask must be set if there's 2 different addresses
> + * in the region that have different j-th bits. where j >= i.
> + *
> + * e.g:
> + *       base=0x1B00000000
> + *   len+base=0x1B00082000
> + *
> + *   ought to return 0x00000FFFFF, which implies that every bit position
> + *   with a zero in the mask remains unchanged in every address of the
> + *   region.

Maybe the example would look "more generic" if the resulting mask didn't
consist of just 0s and Fs, e.g.

 *       base=0x1B00000000
 *   len+base=0x1B00042000
 *
 *   ought to return 0x000007FFFF, ...

> + * @param base Base address of the region
> + * @param len  Size in octets of the region
> + * @return Mask of moving bits at the bottom of all the region addresses
> + */
> +uint64_t pdx_region_mask(uint64_t base, uint64_t len);
>  
> -extern void set_pdx_range(unsigned long smfn, unsigned long emfn);
> +/**
> + * Creates a basic pdx mask

What is "basic" trying to describe here? "The mask to start from" would
look more to the point to me, plus saying that this is the (up front)
companion to pdx_region_mask().

> + * This mask is used to determine non-compressible bits. No address in the
> + * system shall have compressible bits covered by this initial mask.
> + *
> + * It's the larger of:
> + *   - A mask of MAX_ORDER + PAGESHIFT 1s
> + *   - base_addr rounded up to the nearest `2^n - 1`

I'm having trouble with this mathematically: Rounding always means
going to some proper multiple of some base number (granularity). This
doesn't fit with the value being 2^n-1. Maybe "padded"?

> + * @param base_addr Address of the first maddr in the system
> + * @return An integer of the form 2^n - 1
> + */
> +uint64_t pdx_init_mask(uint64_t base_addr);
> +
> +/**
> + * Mark [smfn, emfn) as allocatable in the frame table

What does "allocatable" mean here?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 10:01:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 10:01:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559826.875175 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHLo6-0003jS-UJ; Thu, 06 Jul 2023 10:01:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559826.875175; Thu, 06 Jul 2023 10:01:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHLo6-0003jL-Qi; Thu, 06 Jul 2023 10:01:50 +0000
Received: by outflank-mailman (input) for mailman id 559826;
 Thu, 06 Jul 2023 10:01:49 +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 <SRS0=Jm08=CY=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qHLo5-0003jF-6l
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 10:01:49 +0000
Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com
 [2a00:1450:4864:20::232])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1dd4b4d8-1be4-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 12:01:46 +0200 (CEST)
Received: by mail-lj1-x232.google.com with SMTP id
 38308e7fff4ca-2b701e1c80fso6590261fa.2
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 03:01:46 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1dd4b4d8-1be4-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1688637706; x=1691229706;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=CXvmPGa5oa/4U8HJIGwjcQ85FGvfc+qPVsCGxMP5qzU=;
        b=IRczryd5lBoEpGKKNADf+2APN7EZi3gZlsfvJaSEEvTebvKyGKshDBCsQOpYzN90XE
         0xOxzOfy06MBR6HdWIegJlHMc6ZAy9PQuUphQvrfFPcL33K7qaf94NW4aiqh80il/hlx
         rIzHxDWESXJv4D2KxPwrGWv1+QzdHHNUQU3cc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688637706; x=1691229706;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=CXvmPGa5oa/4U8HJIGwjcQ85FGvfc+qPVsCGxMP5qzU=;
        b=kYlXviPw6KHIyf+vGrWmlDXaCWV5CZiUEFUYT/KkrvdE5K3/XAriaxCxUmquMH0brR
         f2ehIAqucTbA0R243M2pEzpodYcmSBb3PBzsT/aBY3pULh3bMILKeJm2i9HCTb2WSEGW
         50mZedYyzoHYzA/n/037rqI9+Esrb3zyHO8DXGeJj3qbey39ls4ZLeu5jz39IeqfEcZg
         CMfyWqRm4zSev8nMRcKOXQXfDFzRUh5MRbEQFi1UhAD6e/fZ6vBnTwJNboPYp6gdYR3w
         IP5flPGOQ1EH2ZVTWcOI/quCs1IEjaiyGTVkjBI76szA0zZltO9zoJ54d+uPUfrs2u8x
         iI1w==
X-Gm-Message-State: ABy/qLY+Fq3KNXVcN3bpKqbUQwfU4yB2aUMHq880mGNYJE11/mcyEJbK
	pKwcu0iXwRMXa3GqhS0Pp6cgOAF4WhCMJG1BwSqZ9w==
X-Google-Smtp-Source: APBJJlFJq/ZNbrUWRWXv9OBgD+AWBoAUA1DVuEg0kdYZObktsLdSi41LfDjnsofkCMTWeGSUDWjjT4rq4E88YLQQ6ds=
X-Received: by 2002:a2e:9c14:0:b0:2b6:dd13:4f26 with SMTP id
 s20-20020a2e9c14000000b002b6dd134f26mr867285lji.46.1688637705535; Thu, 06 Jul
 2023 03:01:45 -0700 (PDT)
MIME-Version: 1.0
References: <8601CDD7-87F7-4FD0-A6E6-BAEAB12E7956@arm.com> <234199F8-DBB1-42B6-9A4C-8800EEF60997@gmail.com>
 <CA+zSX=Y3_g_aq4+sDK7CuZajywVqQ4xOrq7hKZ80eUT3uSxzuQ@mail.gmail.com> <alpine.DEB.2.22.394.2307051436120.761183@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2307051436120.761183@ubuntu-linux-20-04-desktop>
From: George Dunlap <george.dunlap@cloud.com>
Date: Thu, 6 Jul 2023 11:01:34 +0100
Message-ID: <CA+zSX=ashTi590+cVss_3zyLESC8S=zVSMLjTKD00s6xfjZbJA@mail.gmail.com>
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
To: Stefano Stabellini <stefano.stabellini@amd.com>
Cc: P S <pairspace@gmail.com>, Luca Fancellu <luca.fancellu@arm.com>, 
	Stefano Stabellini <sstabellini@kernel.org>, "Daniel P. Smith" <dpsmith@apertussolutions.com>, 
	Christopher Clark <christopher.w.clark@gmail.com>, Andrew Cooper <Andrew.Cooper3@citrix.com>, 
	Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>, 
	George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
	Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, Henry Wang <Henry.Wang@arm.com>, 
	Community Manager <community.manager@xenproject.org>, Doug Goldstein <cardoe@cardoe.com>, 
	Bertrand Marquis <bertrand.marquis@arm.com>, Volodymyr Babchuk <volodymyr_babchuk@epam.com>, 
	Anthony PERARD <anthony.perard@citrix.com>
Content-Type: multipart/alternative; boundary="00000000000097d3ab05ffce9a1d"

--00000000000097d3ab05ffce9a1d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 5, 2023 at 11:14=E2=80=AFPM Stefano Stabellini <
stefano.stabellini@amd.com> wrote:

> On Wed, 5 Jul 2023, George Dunlap wrote:
> > On Mon, Jul 3, 2023 at 9:55=E2=80=AFPM P S <pairspace@gmail.com> wrote:
> >       > On Jul 3, 2023, at 15:45, Luca Fancellu <luca.fancellu@arm.com>
> wrote:
> >       =EF=BB=BF>
> >       >> On 3 Jul 2023, at 18:48, Stefano Stabellini <
> sstabellini@kernel.org> wrote:
> >       >>
> >       >>> On Mon, 3 Jul 2023, Daniel P. Smith wrote:
> >       >>> On 7/1/23 11:13, Luca Fancellu wrote:
> >       >>>>> On 1 Jul 2023, at 08:53, Andrew Cooper <
> andrew.cooper3@citrix.com> wrote:
> >       >>>>>
> >       >>>>> On 30/06/2023 10:12 am, Luca Fancellu wrote:
> >       >>>>>> The "dom0less" feature was intended to be the feature wher=
e
> a domU
> >       >>>>>> domain could be launched without the control domain (Dom0)
> >       >>>>>> intervention, however the name seems to suggest that Dom0
> cannot
> >       >>>>>> be part of the configuration, while instead it's a possibl=
e
> use case.
> >       >>>>>>
> >       >>>>>> To avoid that, rename the "dom0less" configuration with th=
e
> name
> >       >>>>>> "hyperlaunch", that is less misleading.
> >       >>>>>>
> >       >>>>>> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> >       >>>>>> ---
> >       >>>>>> This is an RFC to get the feeling of the community about
> the name
> >       >>>>>> change, for now it's everything in one patch just to see
> how it
> >       >>>>>> will look like, if there is interest on proceeding into it=
,
> I can
> >       >>>>>> split in more commit.
> >       >>>>>
> >       >>>>> Have you discussed this with Dan and Chris at all?  You
> haven't even
> >       >>>>> CC'd them.
> >       >>>>
> >       >>>> No, this rename idea started from a chat during the summit,
> anyway Julien
> >       >>>> promptly add them to the CC, because I forgot.
> >       >>>
> >       >>> No worries and thank you for considering and taking the time
> to do this RFC.
> >       >>> It is greatly appreciated that there is a strong willingness
> to have dom0less
> >       >>> and hyperlaunch merged.
> >       >>>
> >       >>>>>
> >       >>>>> While there is a lot of end-goal in common between the
> dom0less and
> >       >>>>> hyperlaunch, and that the name dom0less is deeply misleadin=
g,
> >       >>>>> hyperlaunch is specifically not this.
> >       >>>>
> >       >>>> Yes Hyperlaunch is more than this, however as I said, with
> this RFC I would
> >       >>>> like
> >       >>>> to ear opinions, @Daniel @Christopher could it be a proper
> name for the
> >       >>>> dom0less
> >       >>>> feature?
> >       >>>
> >       >>> As Andy has alluded, hyperlaunch is meant to provide a
> flexible means to
> >       >>> handle domain construction at boot to meet a wide range of
> possible use cases.
> >       >>> One of those use cases is dom0less, so yes, ultimately what
> dom0less does
> >       >>> today will be achievable under hyperlaunch. Our intended
> approach to align the
> >       >>> two implementations is one that is meant to be minimally
> disruptive, since
> >       >>> dom0less is considered a supported (SUPPORT.md) capability. A=
s
> mentioned, we
> >       >>> are greatly appreciative to the openness to adopt the name,
> >       >>
> >       >> Thanks Daniel!
> >       >>
> >       >>
> >       >>> but a big concern
> >       >>> I personally have is the confusion it could cause a general
> user. A blanket
> >       >>> rename would end up with two documents in the docs tree that
> provide two
> >       >>> different explanations of hyperlaunch and two different devic=
e
> tree
> >       >>> definitions. So I think a more measured approach should be
> considered here.
> >       >>>
> >       >>>> If this patch makes things more difficult for the Hyperlunch
> serie, I=E2=80=99m ok
> >       >>>> to drop it,
> >       >>>> my only aim was just to find a less misleading name for the
> feature.
> >       >>>
> >       >>> What I would like to suggest as a good first step would be an
> update to the
> >       >>> dom0less document. Provide a note at the beginning that point=
s
> to the
> >       >>> hyperlaunch design doc as a more general approach that will
> eventually subsume
> >       >>> dom0less. This would provide a gentler transition for exist
> users of dom0less.
> >       >>>
> >       >>> If it is not too much, I would also ask, please have a look a=
t
> the design for
> >       >>> boot modules in the series Christopher just posted. The desig=
n
> pulls from the
> >       >>> work done by dom0less and expanded upon it. I major step into
> merging the two
> >       >>> capabilities will be to have a common set of structures. Once
> those are in
> >       >>> place, we can move to a common device tree representation, an=
d
> at that point
> >       >>> we would be fairly close, if not at the point of a formal
> merger of between
> >       >>> the two.
> >       >>
> >       >> At the moment we have a concrete problem with explaining
> dom0less and
> >       >> hyperlaunch to potential new users. Using two different names
> for a
> >       >> similar feature on arm and x86 causes confusion. It is hurting
> Xen as a
> >       >> solution. Personally I already had to switch to use the word
> >       >> "hyperlaunch" for everything in my users-facing presentations.
> >       >>
> >       >> At the summit, we discussed that it would be a good idea to us=
e
> a single
> >       >> name to refer to both features on arm and x86. Given that
> "dom0less"
> >       >> causes additional issues because it makes people think that
> there is no
> >       >> Dom0, the suggestion was to use "hyperlaunch" to refer to both
> features.
> >       >>
> >       >> We don't need to 100% align the two implementations and data
> structures.
> >       >> This is not for engineers that are going to look at the
> specifications
> >       >> and improve them. This is for users/customers of Xen that are
> trying to
> >       >> understand what the hypervisor enables them to do. We need to
> be able to
> >       >> show users architecture slides with the same name and
> explanation on
> >       >> both ARM and x86.
> >       >>
> >       >> I am sure that Daniel and Christopher remember, but for the
> others on
> >       >> this email thread, the name "hyperlaunch" was born exactly to
> be that:
> >       >> the one name to cover both features on ARM and x86 even if the=
y
> have a
> >       >> different implementation. Appended an old email for reference.
> >       >>
> >       >> Also I agree with Daniel that we need to be careful about the
> two docs
> >       >> under docs/. I think he is right we need to add a paragraph
> explaining
> >       >> the history and a pointer to the other document. Something lik=
e:
> >       >>
> >       >> "Dom0less is the name that was used when initially introducing
> the
> >       >> feature on ARM. Then, the "dom0less" name was retired in favor
> of
> >       >> "hyperlaunch" to avoid confusion (a Dom0 might still be
> present) and to
> >       >> align with x86 (where a similar feature was called hyperlaunch
> from the
> >       >> start)."
> >       >
> >       > I=E2=80=99m fully ok to add a section like this pointing to the
> Hyperlaunch design.
> >
> >       _If_ this text is added, please include links/references to the
> Hyperlaunch wiki page and Hyperlaunch design docs.
> >
> >       > @Daniel and @Christopher would it be ok for you or the changes
> in the serie
> >       > are going to be problematic for your future work? In the end
> it=E2=80=99s just a mechanical
> >       > rename, so I guess we just need to agree on naming conventions.
> >
> >       Please see the history of trademark litigation about the use of
> symbolic names to reference similar-but-different artifacts.
> >       It is much easier to use the same name to refer to entirely
> different objects. Historically, confusion arises when a name is
> >       used in similar contexts.
> >
> >       There is also versioning.  Could we refer to dom0less as
> "Hyperlaunch Version -1"?
> >
> >       How about renaming dom0less to "Hyperlaunch Lite"?
> >
> >
> > Perhaps it would be helpful if you could explain more clearly your
> concerns.  I take it that you want a name which can be used specifically
> > to indicate the full "domB measured boot" functionality that was Daniel
> and Christopher's original goal, and that you're afraid that using
> > plain "Hyperlaunch" for only the "start VMs from Xen on boot"
> functionality will dilute that?
> >
> > The "start VMs from Xen on boot" functionality is the *only* thing that
> a big chunk of the users of this functionality want;  referring to
> > it as "Hyperlaunch Lite" or "Hyperlaunch -1" will undermine the value o=
f
> the functionality.
> >
> > What if we use "Measured Hyperlaunch", or "Hyperlaunch Measured Boot" t=
o
> refer to the full measured boot functionality?
>
> I think this is the best way.
>
>
> > Or, "Hyperlaunch DT" for "Booting VMs from Xen using Device Tree"
> (without the involvement of a domB), "Hyperlaunch Boot Domain /
> > Hyperlaunch domB" for a more general "domB" functionality, and
> "Hyperlaunch Measured Boot" for the full functionality (assuming there's
> > more to this than simply having a domB involved)?
>
>
> We need an overarching name to cover the feature "start VMs from Xen on
> boot" on both ARM and x86. From my understanding and from the original
> emails on the subject, the name "hyperlaunch" was it.
>

Sure; but think "guitar" vs "acoustic guitar" vs "electric guitar".
"Electric guitar" is new, "guitar" covers them both, but you sometimes need
a way to specify "acoustic".  Right now target configurations we're talking
about include:

1. Booting all your domains directly from Xen using DT configurations
2. Booting a domB, which then executes some more complicated programmatic
configuration to launch VMs before disappearing
3. Doing full measured boot on the whole system using a domB.

If "Hyperlaunch" means 1-3, we not only need a way to specify that you're
talking about 3, but *also* a way to specify that you're talking about 1.
In the vast majority of cases for the foreseeable future are going to be
1.  Additionally, we want to make sure that "Hyperlaunch" *actually* turns
out to mean 1-3, and not just 1.

The thing I like about "Hyperlaunch DT" is that to me it sounds pretty cool
but also is very descriptive: I haven't talked to people building these
systems, but it seems like saying, "The hypervisor launches VMs based on a
Device Tree passed to it at boot" will be immediately understood, and stick
in people's minds.

So maybe informally, or in "short usage" use "Hyperlaunch", but in
documentation or reference systems, when talking specifically about #1, try
to use "Hyperlaunch DT", just to reinforce the idea that there's more to
Hyperlaunch that's coming down the road?

 -George

--00000000000097d3ab05ffce9a1d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Wed, Jul 5, 2023 at 11:14=E2=80=AF=
PM Stefano Stabellini &lt;<a href=3D"mailto:stefano.stabellini@amd.com">ste=
fano.stabellini@amd.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_=
quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,=
204);padding-left:1ex">On Wed, 5 Jul 2023, George Dunlap wrote:<br>
&gt; On Mon, Jul 3, 2023 at 9:55=E2=80=AFPM P S &lt;<a href=3D"mailto:pairs=
pace@gmail.com" target=3D"_blank">pairspace@gmail.com</a>&gt; wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; On Jul 3, 2023, at 15:45, Luca Fancellu=
 &lt;<a href=3D"mailto:luca.fancellu@arm.com" target=3D"_blank">luca.fancel=
lu@arm.com</a>&gt; wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0=EF=BB=BF&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; On 3 Jul 2023, at 18:48, Stefano St=
abellini &lt;<a href=3D"mailto:sstabellini@kernel.org" target=3D"_blank">ss=
tabellini@kernel.org</a>&gt; wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; On Mon, 3 Jul 2023, Daniel P. S=
mith wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; On 7/1/23 11:13, Luca Fancellu =
wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt; On 1 Jul 2023, at 08:53=
, Andrew Cooper &lt;<a href=3D"mailto:andrew.cooper3@citrix.com" target=3D"=
_blank">andrew.cooper3@citrix.com</a>&gt; wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt; On 30/06/2023 10:12 am,=
 Luca Fancellu wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt;&gt; The &quot;dom0less&=
quot; feature was intended to be the feature where a domU<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt;&gt; domain could be lau=
nched without the control domain (Dom0)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt;&gt; intervention, howev=
er the name seems to suggest that Dom0 cannot<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt;&gt; be part of the conf=
iguration, while instead it&#39;s a possible use case.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt;&gt; To avoid that, rena=
me the &quot;dom0less&quot; configuration with the name<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt;&gt; &quot;hyperlaunch&q=
uot;, that is less misleading.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt;&gt; Signed-off-by: Luca=
 Fancellu &lt;<a href=3D"mailto:luca.fancellu@arm.com" target=3D"_blank">lu=
ca.fancellu@arm.com</a>&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt;&gt; ---<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt;&gt; This is an RFC to g=
et the feeling of the community about the name<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt;&gt; change, for now it&=
#39;s everything in one patch just to see how it<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt;&gt; will look like, if =
there is interest on proceeding into it, I can<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt;&gt; split in more commi=
t.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt; Have you discussed this=
 with Dan and Chris at all?=C2=A0 You haven&#39;t even<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt; CC&#39;d them.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt; No, this rename idea starte=
d from a chat during the summit, anyway Julien<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt; promptly add them to the CC=
, because I forgot.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; No worries and thank you for co=
nsidering and taking the time to do this RFC.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; It is greatly appreciated that =
there is a strong willingness to have dom0less<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; and hyperlaunch merged.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt; While there is a lot of=
 end-goal in common between the dom0less and<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt; hyperlaunch, and that t=
he name dom0less is deeply misleading,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;&gt; hyperlaunch is specific=
ally not this.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt; Yes Hyperlaunch is more tha=
n this, however as I said, with this RFC I would<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt; like<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt; to ear opinions, @Daniel @C=
hristopher could it be a proper name for the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt; dom0less<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt; feature?<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; As Andy has alluded, hyperlaunc=
h is meant to provide a flexible means to<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; handle domain construction at b=
oot to meet a wide range of possible use cases.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; One of those use cases is dom0l=
ess, so yes, ultimately what dom0less does<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; today will be achievable under =
hyperlaunch. Our intended approach to align the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; two implementations is one that=
 is meant to be minimally disruptive, since<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; dom0less is considered a suppor=
ted (SUPPORT.md) capability. As mentioned, we<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; are greatly appreciative to the=
 openness to adopt the name,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; Thanks Daniel!<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; but a big concern<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; I personally have is the confus=
ion it could cause a general user. A blanket<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; rename would end up with two do=
cuments in the docs tree that provide two<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; different explanations of hyper=
launch and two different device tree<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; definitions. So I think a more =
measured approach should be considered here.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt; If this patch makes things =
more difficult for the Hyperlunch serie, I=E2=80=99m ok<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt; to drop it,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&gt; my only aim was just to fin=
d a less misleading name for the feature.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; What I would like to suggest as=
 a good first step would be an update to the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; dom0less document. Provide a no=
te at the beginning that points to the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; hyperlaunch design doc as a mor=
e general approach that will eventually subsume<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; dom0less. This would provide a =
gentler transition for exist users of dom0less.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; If it is not too much, I would =
also ask, please have a look at the design for<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; boot modules in the series Chri=
stopher just posted. The design pulls from the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; work done by dom0less and expan=
ded upon it. I major step into merging the two<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; capabilities will be to have a =
common set of structures. Once those are in<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; place, we can move to a common =
device tree representation, and at that point<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; we would be fairly close, if no=
t at the point of a formal merger of between<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; the two.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; At the moment we have a concrete pr=
oblem with explaining dom0less and<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; hyperlaunch to potential new users.=
 Using two different names for a<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; similar feature on arm and x86 caus=
es confusion. It is hurting Xen as a<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; solution. Personally I already had =
to switch to use the word<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; &quot;hyperlaunch&quot; for everyth=
ing in my users-facing presentations.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; At the summit, we discussed that it=
 would be a good idea to use a single<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; name to refer to both features on a=
rm and x86. Given that &quot;dom0less&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; causes additional issues because it=
 makes people think that there is no<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; Dom0, the suggestion was to use &qu=
ot;hyperlaunch&quot; to refer to both features.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; We don&#39;t need to 100% align the=
 two implementations and data structures.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; This is not for engineers that are =
going to look at the specifications<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; and improve them. This is for users=
/customers of Xen that are trying to<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; understand what the hypervisor enab=
les them to do. We need to be able to<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; show users architecture slides with=
 the same name and explanation on<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; both ARM and x86.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; I am sure that Daniel and Christoph=
er remember, but for the others on<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; this email thread, the name &quot;h=
yperlaunch&quot; was born exactly to be that:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; the one name to cover both features=
 on ARM and x86 even if they have a<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; different implementation. Appended =
an old email for reference.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; Also I agree with Daniel that we ne=
ed to be careful about the two docs<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; under docs/. I think he is right we=
 need to add a paragraph explaining<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; the history and a pointer to the ot=
her document. Something like:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; &quot;Dom0less is the name that was=
 used when initially introducing the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; feature on ARM. Then, the &quot;dom=
0less&quot; name was retired in favor of<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; &quot;hyperlaunch&quot; to avoid co=
nfusion (a Dom0 might still be present) and to<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; align with x86 (where a similar fea=
ture was called hyperlaunch from the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; start).&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; I=E2=80=99m fully ok to add a section l=
ike this pointing to the Hyperlaunch design.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0_If_ this text is added, please include link=
s/references to the Hyperlaunch wiki page and Hyperlaunch design docs.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; @Daniel and @Christopher would it be ok=
 for you or the changes in the serie<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; are going to be problematic for your fu=
ture work? In the end it=E2=80=99s just a mechanical<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; rename, so I guess we just need to agre=
e on naming conventions.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Please see the history of trademark litigati=
on about the use of symbolic names to reference similar-but-different artif=
acts.=C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0It is much easier to use the same name to re=
fer to entirely different objects. Historically, confusion arises when a na=
me is<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0used in similar contexts.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0There is also versioning.=C2=A0 Could we ref=
er to dom0less as &quot;Hyperlaunch Version -1&quot;?<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0How about renaming dom0less to &quot;Hyperla=
unch Lite&quot;?<br>
&gt; <br>
&gt; <br>
&gt; Perhaps it would be helpful if you could explain more clearly your con=
cerns.=C2=A0 I take it that you want a name which can be used specifically<=
br>
&gt; to indicate the full &quot;domB measured boot&quot; functionality that=
 was Daniel and Christopher&#39;s original goal, and that you&#39;re afraid=
 that using<br>
&gt; plain &quot;Hyperlaunch&quot; for only the &quot;start VMs from Xen on=
 boot&quot; functionality will dilute that?<br>
&gt; <br>
&gt; The &quot;start VMs from Xen on boot&quot; functionality is the *only*=
 thing that a big chunk of the users of this functionality want;=C2=A0 refe=
rring to<br>
&gt; it as &quot;Hyperlaunch Lite&quot; or &quot;Hyperlaunch -1&quot; will =
undermine the value of the functionality.<br>
&gt; <br>
&gt; What if we use &quot;Measured Hyperlaunch&quot;, or &quot;Hyperlaunch =
Measured Boot&quot; to refer to the full measured boot functionality?<br>
<br>
I think this is the best way.<br>
<br>
<br>
&gt; Or, &quot;Hyperlaunch DT&quot; for &quot;Booting VMs from Xen using De=
vice Tree&quot; (without the involvement of a domB), &quot;Hyperlaunch Boot=
 Domain /<br>
&gt; Hyperlaunch domB&quot; for a more general &quot;domB&quot; functionali=
ty, and &quot;Hyperlaunch Measured Boot&quot; for the full functionality (a=
ssuming there&#39;s<br>
&gt; more to this than simply having a domB involved)?<br>
<br>
<br>
We need an overarching name to cover the feature &quot;start VMs from Xen o=
n<br>
boot&quot; on both ARM and x86. From my understanding and from the original=
<br>
emails on the subject, the name &quot;hyperlaunch&quot; was it.<br></blockq=
uote><div><br></div><div>Sure; but think &quot;guitar&quot; vs &quot;acoust=
ic guitar&quot; vs &quot;electric guitar&quot;.=C2=A0 &quot;Electric guitar=
&quot; is new, &quot;guitar&quot; covers them both, but you sometimes need =
a way to specify &quot;acoustic&quot;.=C2=A0 Right now target configuration=
s we&#39;re talking about include:</div><div><br></div><div>1. Booting all =
your domains directly from Xen using DT configurations</div><div>2. Booting=
 a domB, which then executes some more complicated programmatic configurati=
on to launch VMs before disappearing</div><div>3. Doing full measured boot =
on the whole system using a domB.</div><div><br></div><div>If &quot;Hyperla=
unch&quot; means 1-3, we not only need a way to specify that you&#39;re tal=
king about 3, but *also* a way to specify that you&#39;re talking about 1.=
=C2=A0 In the vast majority of cases for the foreseeable future are=C2=A0go=
ing to be 1.=C2=A0 Additionally, we want to make sure that &quot;Hyperlaunc=
h&quot; *actually* turns out to mean 1-3, and not just 1.</div><div><br></d=
iv><div>The thing I like about &quot;Hyperlaunch DT&quot; is that to me it =
sounds pretty cool but also is very descriptive: I haven&#39;t talked to pe=
ople building these systems, but it seems like saying, &quot;The hypervisor=
 launches VMs based on a Device Tree passed to it at boot&quot; will be imm=
ediately understood, and stick in people&#39;s minds.</div><div><br></div><=
div>So maybe informally, or in &quot;short usage&quot; use &quot;Hyperlaunc=
h&quot;, but in documentation or reference systems, when talking specifical=
ly about #1, try to use &quot;Hyperlaunch DT&quot;, just to reinforce the i=
dea that there&#39;s more to Hyperlaunch that&#39;s coming down the road?</=
div><div><br></div><div>=C2=A0-George</div></div></div>

--00000000000097d3ab05ffce9a1d--


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 10:42:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 10:42:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559832.875185 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHMRU-0008CU-3E; Thu, 06 Jul 2023 10:42:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559832.875185; Thu, 06 Jul 2023 10:42:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHMRT-0008CN-Vk; Thu, 06 Jul 2023 10:42:31 +0000
Received: by outflank-mailman (input) for mailman id 559832;
 Thu, 06 Jul 2023 10:42:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHMRS-0008CH-OC
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 10:42:30 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2055.outbound.protection.outlook.com [40.107.13.55])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cdbb3f2f-1be9-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 12:42:29 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAWPR04MB9806.eurprd04.prod.outlook.com (2603:10a6:102:389::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 10:42:00 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 10:41:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cdbb3f2f-1be9-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=j+/0BNIEjvT/PdUV8eZdurJhMpcP0IJdhq7ZtDHaJNbOwBWwSW+DK9RxogwED0TCbCDZuy7+z6fru8v9//gnYQVj0wRxL/V/Ym/LNreUZz+ANMgP/hXBCfuwyCYhItVJ4mQ5qFN2jfmkLUjgo+VPKRwvruGw4ePUxRJlUAVPFCR4RxKjcn3ztLH/W65gk6YJt+T1xqkPYr2m0iTrx3T1jVBpBMIMTeWBnrrZMN9amONfnTAdHA7h6I+UitRhVMpm3I/wRayUsU7TQ/fiMMsa8bUyoDfYvPWvc+eqHcPvQib8JP7l5eRaGGOdFqWldLNzyoK3ELmwibZhCVaImqxssA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=6GIA2cEGWA93UR7I6adr6dZSo5gee1gyxHc+wJ8ZC5g=;
 b=V2xbypczwDKbehjnqyoUulRpmTiK/uZn8ol6DQgsk8+b+KTfRgwrVLO410NPxIC/hALyozMBPXXu5w8uapDYIbcuD8zWZRUi1awdaY1bgp3/xshzEktzmUryf8ahJKV9/5Ve7aaamhi2gN/zaf3KtzH7Y3ydlgJClNzPRsmOj8bps+scUFQHA8yzqXbsttkWBirE/5XWqLqdaMr9DvOXXnSuM2piDDAGVOEjn7yS9WDHmYTZz22j4g8SF7Hk/jJ3cE/A2V/rcq3qmLevaE1EdBmvdKcTck9CZWFnwJLNQboryhuIlnEKuMZ3B8fOjtAktOaEO2T1DJwZ7MlZV1SC6w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=6GIA2cEGWA93UR7I6adr6dZSo5gee1gyxHc+wJ8ZC5g=;
 b=iax0HbeppCnQSQg8DgpePEZjh0Y/oojSKSti2UFUQImKcAWkqHJREMUdvmTqo+CQIAS6migg+42mrL/8JDw6VnyO7p/XaBbJi7QEYodwxUdViG35E7qkpIwpjEZOarTUTleiH+si6GpxVY+nDd2UmLBcB5pdPmsL5I+KCBCyUQkNryl/jn+Ya+Y3UXehMC7cU/PzEye71AxNZemXyHwpQzvvv6zVXvbpTDEVlrWGi1cIPZgzG3MTn0mDqnesWzNBKTbdXOHQs6QZdQV6fn95l4zwZTnGWCAa2DK7cdm8gi61lAWscKIo1COs+ILuvBUMZdqnXtJ9bQZlZUEJLT3IeA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <47cc5f67-973a-2095-932f-6ebea2d3bd9e@suse.com>
Date: Thu, 6 Jul 2023 12:41:58 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v4 1/3] multiboot2: parse vga= option when setting GOP
 mode
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230705114741.11449-1-roger.pau@citrix.com>
 <20230705114741.11449-2-roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230705114741.11449-2-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0089.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1f::18) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAWPR04MB9806:EE_
X-MS-Office365-Filtering-Correlation-Id: eb171eea-63c6-44ad-0b6a-08db7e0da0ad
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	tnSQozHERjO48he4ZJo0rU3/IPldrRM96Wuwyg/5gjh9R5ancUpSdyvdWkV2ZHAUCgxhnNEElNhuuauJfJEA4bLcIqvOkk9zAm6cXTJAGrXhgkcNyauP7o/fEVZVM96Chx/wk6gNWxrttR5PUO7PKqyPG+r8IK+6ul78Z4ds12PNAqFaml7gDLhpcAwz2eQwdveMRGXesGwLYIgOniaQtdoTvAI/YYRpY6+rJwWR5OXQ15L6NnRQgVDEzEacu0A6oIQq6cCHiAAaTNq8RgZcAZopCY5klulatlWy+Y8pTS3B57dNsDR4V2g6jQATB8DpmdyoSFvZnbUIyekXpmnosQkD8o6gdcGIKOyVRS0jN+xVfZ9efWQoNleC3UXObWAz+GmXBU0Jv5aYDqxX24O1gPaRWM0PQ9fXC4AC09z/JxGvYLjDOHKqHygJeis/nEvIruHIFXdkYUMiYr3TmCrDW+F0u5WqrAci0ptz6AFGUICPF57Hx8P2idg5gbWwuhOPCaFVkFNpzJSPhdRqC7bGf9WP2G/anZUsayrAyXVO5GO8OnzFy/UbkjXb+Jvt2s9XGtxt2YHG/Fn3s0HS4zmMxClOXO9TGPQuCfLlNBsTAIk+tN4cta0tmDIzYWhTWr0CoK1tqnrzigFt/mngjKTqrQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(376002)(366004)(346002)(136003)(451199021)(6486002)(478600001)(54906003)(83380400001)(2616005)(36756003)(86362001)(31696002)(31686004)(2906002)(66946007)(6506007)(53546011)(186003)(26005)(6512007)(38100700002)(316002)(66476007)(6916009)(4326008)(41300700001)(66556008)(8936002)(8676002)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YzB4YnZ0RFhmRDR2cTUwVzdtN25ZSzAvRmpHNk1RZEhVODlqNHdSSlg1SUJO?=
 =?utf-8?B?SWR1QnFuWmpjNTd5cEZwQVd5M3A3ZWNhd2pkS3ZlUWo0RExsbUxQN1ZTWXAx?=
 =?utf-8?B?Zko4V1owdmp2Z1E5Wkl4WHFCbm9nNUxER3dOUWZLL1c1RWZocEd6YngyVURU?=
 =?utf-8?B?aUVsdDZib3A1TW9JNitraGEvckJEenZCM202RThQWTM4K1hZekl1OXNFS2pt?=
 =?utf-8?B?QkFPK1hVcnpGQ1FxTTc0Nk5tVXpOYkZFMXBmdFFlNlMxMFk3V0VIZX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ZzBZeXlLMldT?=
 =?utf-8?B?NUZyaGI2NlBKZWwycHpETC9oZmw3Ni9MVGNsdnlPU1U4UDJFRVFsRHlMRDB2?=
 =?utf-8?Q?yKjNiVQx8x9nT6CmtqEPykui5?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: eb171eea-63c6-44ad-0b6a-08db7e0da0ad
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 10:41:59.9626
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: BAX4vE52JGUOIrUZ5mF49KLK3fVMfq1U7nfZm0bZJbhv4rO+c5jlQGhAaqvKsuUVktCfihZgAls7+AysdUADWA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9806

On 05.07.2023 13:47, Roger Pau Monne wrote:
> --- a/xen/arch/x86/efi/efi-boot.h
> +++ b/xen/arch/x86/efi/efi-boot.h
> @@ -795,7 +795,30 @@ static bool __init efi_arch_use_config_file(EFI_SYSTEM_TABLE *SystemTable)
>  
>  static void __init efi_arch_flush_dcache_area(const void *vaddr, UINTN size) { }
>  
> -void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
> +/* Return a pointer to the character after the first occurrence of opt in cmd */
> +static const char __init *get_option(const char *cmd, const char *opt)

Nit: __init and * want to change places.

> @@ -816,7 +839,54 @@ void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable
>  
>      if ( gop )
>      {
> -        gop_mode = efi_find_gop_mode(gop, 0, 0, 0);
> +        const char *cur = cmdline;
> +        unsigned int width = 0, height = 0, depth = 0;
> +        bool keep_current = false;
> +
> +        while ( (cur = get_option(cur, "vga=")) != NULL )
> +        {
> +#define VALID_TERMINATOR(c) \
> +    (*(c) == ' ' || *(c) == '\t' || *(c) == '\0' || *(c) == ',')
> +            if ( !strncmp(cur, "gfx-", 4) )
> +            {
> +                width = simple_strtoul(cur + 4, &cur, 10);
> +
> +                if ( *cur == 'x' )
> +                    height = simple_strtoul(cur + 1, &cur, 10);
> +                else
> +                    goto error;
> +
> +                if ( *cur == 'x' )
> +                    depth = simple_strtoul(cur + 1, &cur, 10);
> +                else
> +                    goto error;
> +
> +                if ( !VALID_TERMINATOR(cur) )
> +                {
> +error:

Nit: Labels want to be indented by at least one blank. Here I'm
inclined to suggest indenting to the level of the enclosing curly
braces.

> +                    PrintStr(L"Warning: Invalid gfx- option detected.\r\n");

Maybe better PrintErr() and no trailing full stop?

> +                    width = height = depth = 0;
> +                }
> +                keep_current = false;
> +            }
> +            else if ( !strncmp(cur, "current", 7) && VALID_TERMINATOR(cur + 7) )
> +                keep_current = true;
> +            else if ( !strncmp(cur, "keep", 4) && VALID_TERMINATOR(cur + 4) )
> +            {
> +                /* Ignore, handled in later vga= parsing. */
> +            }
> +            else
> +            {
> +                /* Fallback to defaults if unimplemented. */
> +                width = height = depth = 0;
> +                keep_current = false;
> +                PrintStr(L"Warning: Cannot use selected vga option.\r\n");

Same here then?

With these addressed (which are all mechanical and hence can probably
be done while committing, as long as we can reach agreement)
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 10:45:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 10:45:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559836.875195 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHMUd-0000N0-Gs; Thu, 06 Jul 2023 10:45:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559836.875195; Thu, 06 Jul 2023 10:45:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHMUd-0000Mt-Dg; Thu, 06 Jul 2023 10:45:47 +0000
Received: by outflank-mailman (input) for mailman id 559836;
 Thu, 06 Jul 2023 10:45:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHMUc-0000Mm-OD
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 10:45:46 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20606.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::606])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 42e3a4cf-1bea-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 12:45:45 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM8PR04MB7218.eurprd04.prod.outlook.com (2603:10a6:20b:1d9::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 10:45:43 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 10:45:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 42e3a4cf-1bea-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CUQ6jlEK+XqSfQNpIInl4N4uwLR6eaqP2ywb6LhtW2VGVlcaNSFqIatIEWH6ywau7R0fOF5ws1Oh5dsH6hq4Zr11rJ4qYtZnOeha5Bv4b3vG+XzFytK8J86d4dGBowRLUPRfreFCK0u8YrpSZLk8eAQ2YZ6/GBoesvC32y71MwnadLLoeUX3xw0f8VNdCEe5w7RmvayWipQpIEKdxTDvIsCTFb+EyjhfB9tyxYJ2EbFQkAiC5TobTCdn7ELXNmTxfKtcUFzzWCGPfzQFmEEhwiR8/BG1pU9hqU49GzLmaE/aZrNckmd2UDTiYDhcZxefkhwQzhfvip9cb3V3uiLYGQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=bp026+l+SXvaxUzxwK97199lQP8K0Mm67wbPdTQF5rg=;
 b=IbBEuePPWEFQ3SvBQrHapW5Ug3ub21ugFQe+mBeFc2oc69VRSoEdgWJ9iH0epOdMiN3TSX17c0i/PuSdx18kdl7XasgkYe86IAf5sUIxxGWxRYuaF7aq6KzEOh3jUUvxf1kcEZkN8cVCK0VFEvJa6S4fvd/8zvVFpdrbaY3lFC0KhoIHGwjnXJkVinnhCOtVvQYytCjXcCyoni2fVmRiRP2U+g7wyLUgzS4tTCnr2IXJG2TjVfzAEgCI77EPQPv505LJNsRhJzm5eBVPxlw4T+MQaQ2aovrh3MwHmFIqyYv6TjpFtpxu3JUSXBejVU5Xq6WJx+hj9F34Fdyqnb4vjQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=bp026+l+SXvaxUzxwK97199lQP8K0Mm67wbPdTQF5rg=;
 b=URLGkKBdJKNRkIcfy8HCZqWpXazaWEY7XMNi0ESA0OtrW4WW2ZG+UeS+ypZGw/veNOahDYP171nRvsqvv/PQhgO87JT3xPmWHB8gPqLyQjPK0t4sHlEulIHdFLNpVymD0s029FVfzaCxl5RPTjSQju85+48/Lej9sGZdCx46MdV67LoGo+jVReMjudPt7fJjiAGrqQSy/UMuMgd+GLZTJ9U6Y4Ca1JTIri9ceVZlWdWRMKeomt/zSBW7iQBcNBnyfDL9Xq9rl7oORKSQNzRq6O4x55NuunhFVALUxcSa8VvPjzhDDq/wv/LJr7se2bmgw9nOywiomm1ihkWVuAVF6Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <111078b3-399a-40d8-b8ed-db80dbea3bc7@suse.com>
Date: Thu, 6 Jul 2023 12:45:41 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v4 3/3] cmdline: parse multiple instances of the vga
 option
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230705114741.11449-1-roger.pau@citrix.com>
 <20230705114741.11449-4-roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230705114741.11449-4-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0113.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9d::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM8PR04MB7218:EE_
X-MS-Office365-Filtering-Correlation-Id: b05661b9-bc09-40b3-dbc8-08db7e0e25fa
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	g/EZ+3pQC8YhBkSfwl7uuq8VlHOvhh8JDIsUks9exX7aw+7raYpxTrWmKCWm4Ig+B1HNy14mxmVCFJ22Cf1kWZxM464IPh7cziKgrdU24f3ddQ0L3n2xgzKjGLa+r/DSPI5n7YFKwhGyI3HiXwjOvu480RGcH8kAFZdoboWcoEV4FrPD8KTZ1oQot/kZ1xmGv/BgxdHIAglX5g15AE583mUK8jMszMAK+SkIjtjSBdpsDdDhhnxHI+yzFrec0+tF6sfiQrrUpguftSM/bPbA1oyfruNicYUneiKA2YJjVUYg1GI8x0U6YI2mn6fr8RSibddK5dukujS73FEvYJ+MqISOBsMwdk0FkwbB5wf1N+ZiPb42DH06xkgdkYDYgNlhihegN7o3LXCSyGc0OCw2Gxr9LnMyHpp8mVOyvqFM/RTP/mIRDEebw4FoBX6+o8u7QHbx1su72tJ1mdaX/ZhYawbVFinpRfwrN9jOy9nz0zzwNnQPFT2DUAInUxR5nx8LyfxbZr3EPAgPGgFD6eMj++UK0l26LZyVrrhq9o457GJSNclojnGA0I0HExBVI1fEyDgp+uLhMgRabDZ1UZh+UqNgB51iwPEbXhi0jrlUu2Ex3D1R8Co9wTN5nDHr5cEFdw5cyWGd8dhs/5cPO09PJA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(39860400002)(376002)(366004)(346002)(136003)(451199021)(31686004)(2906002)(5660300002)(53546011)(2616005)(86362001)(31696002)(66556008)(66946007)(8676002)(8936002)(6506007)(6486002)(54906003)(26005)(478600001)(186003)(6512007)(4744005)(38100700002)(83380400001)(66476007)(4326008)(316002)(36756003)(6916009)(41300700001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UUwxVGllRmsrVC96QktjUDlYZ0hSMVB0QXZCZXRXL25YUTIwVXlaV3U4ZGYr?=
 =?utf-8?B?Y05JN2Z4MzNtZldsbDJDQ1pDUVZ2WStpbTZEbHJpT1BGTWFLSDdqcGpZZi9E?=
 =?utf-8?B?OVY5UnBqYzNSc1BxYVV3N0FQNEsrY3NvRmwvS3RiYjU0N2kvUGYrVmh5OGJw?=
 =?utf-8?B?UUl2OXVEejV0NVpmZnNpS3hqd1NNLzUyOWp2UEJaRXFYMTZtTmVwclZ1aHho?=
 =?utf-8?B?OHZOdld2ZjR5cnY5aDNSc1BsaTkyR0Q4NWY3R0VkTDNRSG1hSmlvQk55Qlli?=
 =?utf-8?B?SThoR2VSMiszN0E3Z21MTkU2MlJ3eDZzM0hpWXYwdVljcE9Oa0NQb25CcUtT?=
 =?utf-8?B?ZFZ5alhBaSttRWFFSW5OY0dCN3NLdmpGQndicElteWQ5RXo2RTljekMxWlIr?=
 =?utf-8?B?VHpiNVUvaDFHSlByUVIvekNrVVpJdWgrYlJ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0e25fa
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 10:45:43.6083
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: E5QeHXl5wy42bwoeGiIa3pUglgHXE0bfAltpOtcyXihntqdQrzi4tIiRj3gauU519XDuVnGjKyA+qLhhNVWoqg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7218

On 05.07.2023 13:47, Roger Pau Monne wrote:
> Parse all instances of the vga= option on the command line, in order
> to always enforce the last selection on the command line.
> 
> Note that it's not safe to parse just the last occurrence of the vga=
> option, as then a command line with `vga=current vga=keep` would
> result in current being ignored.
> 
> Adjust the command line documentation to describe the new behavior.

This was likely meant to be dropped along with ...

> Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> ---
> Changes since v3:
>  - Remove xen-command-line doc addition.

... this? Beyond that (easy to adjust while committing)
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 10:51:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 10:51:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559840.875204 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHMaB-0001o8-4d; Thu, 06 Jul 2023 10:51:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559840.875204; Thu, 06 Jul 2023 10:51:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHMaB-0001o1-1X; Thu, 06 Jul 2023 10:51:31 +0000
Received: by outflank-mailman (input) for mailman id 559840;
 Thu, 06 Jul 2023 10:51:29 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHMa9-0001nr-Rq; Thu, 06 Jul 2023 10:51:29 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHMa9-0006iI-Gy; Thu, 06 Jul 2023 10:51:29 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHMa9-0001Cv-AP; Thu, 06 Jul 2023 10:51:29 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qHMa9-0002NS-9t; Thu, 06 Jul 2023 10:51:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ZYeqitQlcJPckDt/wYh7fV7XKjPQQzvpN1j7e8y7Tpg=; b=CFjPFhNpujfJuA8xpkCLdpOkcQ
	SpCPcrlzpCmJmXoPPiPJImjcFf6Aj2+mTaLpNxxEQkjOPJPxw0EGMMDuhY/G8Q/kDT6CUoLlF1/xU
	PqOpzCTAE1QYNmejYmGA0bd07jsZQrbScUMp7g4xTlPvE834XfgaCkF21r0cijogXkIc=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181720-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181720: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=886c22f00c575199f7bb3dc5b7662dd09bf05146
X-Osstest-Versions-That:
    xen=1c139701ebaef5072ccfa5fdafc3bc60c650bb7e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 06 Jul 2023 10:51:29 +0000

flight 181720 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181720/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  886c22f00c575199f7bb3dc5b7662dd09bf05146
baseline version:
 xen                  1c139701ebaef5072ccfa5fdafc3bc60c650bb7e

Last test of basis   181714  2023-07-05 20:03:33 Z    0 days
Testing same since   181720  2023-07-06 08:00:30 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alejandro Vallejo <alejandro.vallejo@cloud.com>
  Jan Beulich <jbeulich@suse.com>
  Shawn Anastasio <sanastasio@raptorengineering.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   1c139701eb..886c22f00c  886c22f00c575199f7bb3dc5b7662dd09bf05146 -> smoke


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 10:57:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 10:57:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559846.875215 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHMg1-0002SM-Pz; Thu, 06 Jul 2023 10:57:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559846.875215; Thu, 06 Jul 2023 10:57:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHMg1-0002SF-Mm; Thu, 06 Jul 2023 10:57:33 +0000
Received: by outflank-mailman (input) for mailman id 559846;
 Thu, 06 Jul 2023 10:57:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHMg0-0002S9-Us
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 10:57:33 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on20628.outbound.protection.outlook.com
 [2a01:111:f400:fe12::628])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e784dd7e-1beb-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 12:57:31 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8238.eurprd04.prod.outlook.com (2603:10a6:102:1bc::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 10:57:28 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 10:57:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e784dd7e-1beb-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=nnlDXOYKZfqgmqctd4+SVKTTlmfbH/zL8xfZRMi2C34C9QI6LsQz75rzw48pFBQUZA9+11+VlFydGoW1Qj7aKeuR34MufOLioce7G3xlO2QeqFTn6EgZ8AyOOs8EQhQcC5d4o5gh92vaPFZjpuIzaTC7yy9KvupkfY9gAfm65rQqAJrJUAwmJN+JB5njRuW/Fd/3+O/haBBlGrEIHE5quKV2R6K5R/Jha0ooNzHPxZcpf+drdlf2/Xymj2E0JDArVSewXYDZN3CAaOl0tkcO3vC+yabK0+wcPfFSVkOav3Zx98RC1SsfnXaRxJRQ6aaxz7AWWFC7D1YF0LuOk2kKBw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=qQOYFUOMHuj7uxPP7uf5chHqnNg/cVk5WHpGtOP6fbQ=;
 b=USFSeYSTwOrHxdM4VvL7MgHv9atqeZrr4JQ2zOJFZxUlN70I5Q4wENwEVa6Vo+DHUdFVBcM382yeJiu+brmAQy01UdzyvkHbSjMKIHM59BnX01QqetwBHx2Sj0IbiAclb6QAPOGHiXuN18tWDGvxykfbisfkQn2eKnlPO5eKj/Z7NzCpks1s3gcp3zL3BlTmlMrEqhc1b9N2Ta0MwQCw6Dm4p3Oc9N4lnHlkpzr3iYNkDOrd6LqjMZmDLX7+r6XpmtMDFxwwU6Wstw8dvP8YWffemuGbPN76xL2Wb5k5fowTDdy7ZCrqJBpmaLmId/KD1cTbTevrPcifo4Dchv2S3A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=qQOYFUOMHuj7uxPP7uf5chHqnNg/cVk5WHpGtOP6fbQ=;
 b=Uxr9/DKI7r3psc3iDuWdEHw9nyX8ZpJl6Qoad2VSvxLyk0jBw6qqH/C44pv7Gp9fhEYKPsOeMQiaNajCeHCe6dd08GL4As+u6MH87Uz6Bo+9p7HhY1R/xkVpPHQHgn/qjYs70QE9TGluJUefytNaQKMOVLrftvmJqSoq8wa0TaVDbDdkVg+42puNLKJvmBmkSkIVeUDjwCSlVZCooEVckFXW6FzrQEmEJuo9k8XUUxIuU+0HPJuxllkpDr+X1ndJoufSJZFpskM4FjqgRKEnWvOWugbXSLtzvXkozFQxQ8UO6oBL5M+uedBNjC2FzuDx4ftutQshW5e9N0cVr+FuEw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <9e519164-24ff-2362-1ffa-d19649d068c6@suse.com>
Date: Thu, 6 Jul 2023 12:57:25 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH 08/13] libs/guest: introduce support for setting guest
 MSRs
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>,
 Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
References: <20230616131019.11476-1-roger.pau@citrix.com>
 <20230616131019.11476-9-roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230616131019.11476-9-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0097.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9c::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8238:EE_
X-MS-Office365-Filtering-Correlation-Id: 4d1a5dcf-8e17-45ad-bdb5-08db7e0fc9ad
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	lr0yl/gCNi6qSHgsPeXviwYpT/ssr4px6t+4tT07IlczhbZgJezqVoESToTDYoq8U1+O89JAdk3CH/wojoxgBA7/g73hRl87JVj7kwhT/eVW1TmRS4ueT9ufLv/GMFVCwoHRG2Q3Recj4CTlAlVOH/1jR95MoK5C4mjKas127lP9xkAxCL+ApWVYoq6Up1SUB+/gPD13066upz1pgEBnNl8MsEkSCenzDVBhmzC70Ze9WxQyjN5KNFxAiBJMmbh4G8qchhU9aTBpjVnUncdmHDGjrwXvBp0Vm0q4vyxiT5DdBrehOROS7DGNP7VR74tIy0vNyb1h//8C5/Ep5yfiSHyUOCYJVvrKQw82H5rtYn1Fe5pepPLJaSp0GEHtQTsAJRD/l2tR6uqeG0zsYNRQuHISAuRj8fPhXP8z+JBQaKTqPFChIrLF7nWSN1dwFartKYOEFjg6JjQ2eEOT+CjYmtGFgpXz4PREcik2rald5N6G80FmgLH7c8BU8m9NSXcq9a4RJqpFT+KjxkSzigMQep+rLdmHKq7ufM1DD/RkAZwhl2vXsNdfHScUSXHCFHIKJ3RKExWXnC5uwmPXLnXqZd2Nf4mPA4JCvMw9vMKTRioQk3nWoSk1Ivtl/gj+NvEBYyJgI+7cwAD/RsPykBeXxQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(136003)(366004)(396003)(376002)(39860400002)(451199021)(31686004)(66556008)(4326008)(6916009)(66946007)(66476007)(54906003)(478600001)(186003)(26005)(31696002)(86362001)(2616005)(6506007)(53546011)(5660300002)(36756003)(8936002)(8676002)(38100700002)(6666004)(316002)(6486002)(2906002)(41300700001)(6512007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cGQzVGRpZ0hQNHFUeXRSU3U1dWk0bFRrRHlOTTVpZ00zWEVRVnFiN2YyNURn?=
 =?utf-8?B?VkdFQUZiUitrTHhld1lUWjJpSFF6RmNTb1k0V01mQkFIa1BGeDY3MUt2d3ho?=
 =?utf-8?B?VDZtYmVFVTdtYXNCS29jbkNWUlNGcS9QZEdOTDhmYUFVQWxpREtOMnZlbFRE?=
 =?utf-8?B?TGUwZ01VWFc0MHZmVFZ4Y2I5TUgvVWJPR2RzZ0p6bmJlbVIzS0pPMXpHWTBy?=
 =?utf-8?B?QjdpRlBKZ0FPQ09ueWNZczErdElQVTFZWktETitCT0dpMWZkNFFzWHhGSkp0?=
 =?utf-8?B?bDMrVWRtUGRDUDI1dFlBbzVqNyt1WFJrUkdRdjYyaDlBT3luL0NOREZOaWo5?=
 =?utf-8?B?UmlUZnlJL1hZVXVWR2RnVHc0VHNHVHlnS2JOSlJ1K0pxQUl4T2dvcGVmVWJW?=
 =?utf-8?B?RWIzTHdFMlVqRlBlUVlUdUtVa29CbVM4WC85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b5-08db7e0fc9ad
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 10:57:27.9378
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 5xClvzsy1SZu5es7Ys1D9cK6cy0mW78XU1w7Pp8bK8n/J2vyVniwK6bBNw33eV+4k1+XXU95ZIK6g1JiE9cDWQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8238

On 16.06.2023 15:10, Roger Pau Monne wrote:
> --- a/tools/libs/guest/xg_cpuid_x86.c
> +++ b/tools/libs/guest/xg_cpuid_x86.c
> @@ -331,10 +331,74 @@ int xc_cpu_policy_apply_cpuid(xc_interface *xch, xc_cpu_policy_t *policy,
>      return 0;
>  }
>  
> +int xc_cpu_policy_apply_msr(xc_interface *xch, xc_cpu_policy_t *policy,
> +                            const struct xc_msr *msr,
> +                            const xc_cpu_policy_t *host)
> +{
> +    for ( ; msr->index != XC_MSR_INPUT_UNUSED; ++msr )
> +    {
> +        xen_msr_entry_t cur_msr, host_msr;
> +        int rc;
> +
> +        rc = xc_cpu_policy_get_msr(xch, policy, msr->index, &cur_msr);
> +        if ( rc )
> +        {
> +            ERROR("Failed to get current MSR %#x", msr->index);
> +            return rc;
> +        }
> +        rc = xc_cpu_policy_get_msr(xch, host, msr->index, &host_msr);
> +        if ( rc )
> +        {
> +            ERROR("Failed to get host policy MSR %#x", msr->index);
> +            return rc;
> +        }
> +
> +        for ( unsigned int i = 0; i < ARRAY_SIZE(msr->policy) - 1; i++ )

While correct, the "- 1" struck me as odd. Could we deviate a little from
the CPUID side and permit an early nul in the string, implying all 'x' in
subsequent slots? Then you could drop the -1 here and simply bail from the
loop when finding a nul char.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 11:04:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 11:04:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559852.875224 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHMmc-0003zS-IU; Thu, 06 Jul 2023 11:04:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559852.875224; Thu, 06 Jul 2023 11:04:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHMmc-0003zL-Fj; Thu, 06 Jul 2023 11:04:22 +0000
Received: by outflank-mailman (input) for mailman id 559852;
 Thu, 06 Jul 2023 11:04:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qHMma-0003zF-UO
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 11:04:20 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHMmU-0006zC-CM; Thu, 06 Jul 2023 11:04:14 +0000
Received: from [54.239.6.185] (helo=[192.168.30.29])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHMmU-0006YL-5W; Thu, 06 Jul 2023 11:04:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=2nezJdZxaMgCEf6dSrZX0vLeyWT/+zkjVE0FJT6BpdQ=; b=IxgQinflPjC6/4SnaNmxZ+ztv6
	dvujS0skjL9GciAfc54T4mtTQ4cgqUhYyTcgnbdI+eKnKkQnI+/EXStUkzLGCrrWxdIOvf/C2n9/f
	80E/2reVWJEWdUNDZRIF5KC4GdtAYyaryZbey6CKfxSEvp2EnkCtzXETJQT2ASCeMO5E=;
Message-ID: <f140d902-b55e-ae41-3ec0-09244e65e857@xen.org>
Date: Thu, 6 Jul 2023 12:04:10 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
Content-Language: en-US
To: Stefano Stabellini <stefano.stabellini@amd.com>,
 George Dunlap <george.dunlap@cloud.com>
Cc: P S <pairspace@gmail.com>, Luca Fancellu <luca.fancellu@arm.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 Christopher Clark <christopher.w.clark@gmail.com>,
 Andrew Cooper <Andrew.Cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Henry Wang <Henry.Wang@arm.com>,
 Community Manager <community.manager@xenproject.org>,
 Doug Goldstein <cardoe@cardoe.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Anthony PERARD <anthony.perard@citrix.com>
References: <8601CDD7-87F7-4FD0-A6E6-BAEAB12E7956@arm.com>
 <234199F8-DBB1-42B6-9A4C-8800EEF60997@gmail.com>
 <CA+zSX=Y3_g_aq4+sDK7CuZajywVqQ4xOrq7hKZ80eUT3uSxzuQ@mail.gmail.com>
 <alpine.DEB.2.22.394.2307051436120.761183@ubuntu-linux-20-04-desktop>
From: Julien Grall <julien@xen.org>
In-Reply-To: <alpine.DEB.2.22.394.2307051436120.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Stefano,

On 05/07/2023 23:14, Stefano Stabellini wrote:
  > I think we should use "hyperlaunch" as it was intended: the overarching
> name to refer to "start VMs from Xen on boot". And we should use
> "hyperlaunch x86" and "hyperlaunch ARM" to distiguish between the two
> implementations.

 From my understanding is the assumption behind your proposed naming is 
every architecture will do hyperlaunch differently. That might be the 
case between x86 and arm today. But I would hope we can have the same 
features across x86 and arm in the future.

Furthermore, I highly doubt that RISC-V/PowerPC will also invent their 
own version of Hyperlaunch. Instead, they would likely re-use one of the 
existing implementations.

So I think using the architecture in the name is a short-sighted idea. 
If you want to differentiate the two implementations, then it would be 
better to use a second word that describe best the feature.

This will avoid yet another round of re-branding discussion :).

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 11:09:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 11:09:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559856.875234 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHMrX-0004bY-1Z; Thu, 06 Jul 2023 11:09:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559856.875234; Thu, 06 Jul 2023 11:09:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHMrW-0004bQ-V0; Thu, 06 Jul 2023 11:09:26 +0000
Received: by outflank-mailman (input) for mailman id 559856;
 Thu, 06 Jul 2023 11:09:25 +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 <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHMrV-0004bK-HM
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 11:09:25 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20617.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::617])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8fbabdc9-1bed-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 13:09:23 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB8PR04MB6956.eurprd04.prod.outlook.com (2603:10a6:10:11b::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 11:09:21 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 11:09:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8fbabdc9-1bed-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=n/fKdRH17+eC4Sad4U+DuECg7Jn3K1u0ef1a2ta/GVbNzHvqxxSMMGvkd4/D2oWy+ohj4SBdqVCr07nnRPYkxm+lbNVzHcLK5wYDo9Eyn78ZjSWRdMB9mA+IXP+fDPRfVNTE6xcDtlbRLqRDcjoObd8Ve2qohLcZX+zMF4aC8RCG85N/+kiSBwkrYhJXG98BECo9sCW2qTk+VuND4aBkCG8aw+XCdwKZCBWeK8JJ1qifC36qts79ri+SOm6VWVgweWYHd9SgiQOSTPYdq+77XvhppXRN1LrQku1tQLUBzzvMIy3T930SYtGnAMLIo5J1kE9/NmG6ZVNbHOBi7Zg54A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=1EDqj7iwfxfnLB0x6opR63ESaVOE0wZE6U9/F73SJw8=;
 b=VPEdw1Ya9YM/kGFNP4wjW7+b23h53Rd8iHQyBc1omaBx1f0CFJ63FyWFIy1ZoRByxbR+e6ixax1+2cw6Y3+HCTLSHX84nfn/5w454ienAsaIdyFtN+FsPsIIQhebOP9R8KUQl5X2XtldpYa+jjg5snafMoUi3R4r17Tz6DJH+uP5XBHsaRPzQpl/aCHf3MqdIvhv4elgQAkPtsfJSz23OVxfUY4QMqk9uUXt/cW2/HsDGpismmJojXviQk5WyCTZ96GJhmQMga+YlsKdTsM0n0pxDHZpal7iXQmgNSxGQXNx2qtzqUl15ogqVU9sKjYIiy9Kou1jxCop9dXp/MgH0g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=1EDqj7iwfxfnLB0x6opR63ESaVOE0wZE6U9/F73SJw8=;
 b=EHsMZ0053kGHXmFP37TMi16LUSrQL+ejf90nCoyyPnaLCjFzDf0AaEQvhrbsR6pYtsAEu0ArtPPQb9xXM5c/aLOpiD0njfcbJ2JRRwCXBuKhC+ImxRjgvk+SbDxCb2mzftxZAjLthLKZkdjmBL5Kwpn6N3OK3kADcx9fNlBQya7datVeHiqNBlSZFpDn1GnWU/hZIT+XxSuSgTY30MXzxeRew5HtRDVMB0/3Jq0IXkG5P66La0MhQWGDKMu3MZEU5dbxP5gynhQ38XgCi5yn+D3fDKnDTLfByOvHO2Um06D+XSLz5iEmA7q4X+9ULZC/839ILgpBcmNxU9zgWziovQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3484d4e2-4c2e-cbcb-44b4-09252227e1ac@suse.com>
Date: Thu, 6 Jul 2023 13:09:19 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH 11/13] libxl: split logic to parse user provided CPUID
 features
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>,
 Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
References: <20230616131019.11476-1-roger.pau@citrix.com>
 <20230616131019.11476-12-roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230616131019.11476-12-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0113.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a3::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB8PR04MB6956:EE_
X-MS-Office365-Filtering-Correlation-Id: 0007932a-c089-486e-e36e-08db7e1172d7
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	j4uPWcNQGqO/304ZrBJPx37QAkuLXJV3PpR3th6sR3znxThbKF1oxuFKQAyVoEE83CbQX8mftp33gaPnBp48QbOQcvWHEcPjKypbuXn+HoUgP7e2iL2c4pZdTVx2npivhj2XFX1imgtxZKmo8GOvUr4pnDIqClhxYdueIFSPhggCPQJTPEXnJigaFj0iVfXC3fvZ01n6omTAPa/P62E/pYomS2wRkcvZ57Cil+Hx0DEQ2yci39u25bXQbgqhBY7AqHrVYuqTUKo08R0Xz7zNyN5wqrDp7DntoHSnnAPUggX7ZHmMYRfd6T/XcMt6PlTTyIPhqs2Zy4sKIzl9ebiv2AsHrZ5fcUeInSbvkHaecfHA6WOkwHEsPXTY8sggHz+h43FzS2dRd2lVC9EYN1mn1p9W6Z1exIQaPY/y9wnzox1bQH6EpWeME4N7yvVbM1UO9UoiXbqCnIW2abIDxY6USDXqa9XhuX9SKeKhYlW2lhMJMPowLkE/Fby5kSe7SD1TVw9GFSEwaJOpU7IBFEeK0DGZl96KiUTI2mCCm8vl+lJsCP2Zc16eC/lM2QDKZBz1YGP68NjaPT23rZhJ667DXWC+vHhBNiY5Pb1TTddmzFfGF/roJ0WYSRK7bdYlPd2rrviYkmP/AFVvk6wZwDpt4w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(39860400002)(366004)(376002)(346002)(136003)(451199021)(478600001)(26005)(6506007)(186003)(53546011)(31686004)(2616005)(6486002)(6512007)(38100700002)(4326008)(6916009)(41300700001)(2906002)(86362001)(8676002)(8936002)(316002)(31696002)(66476007)(66556008)(66946007)(36756003)(54906003)(5660300002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UFhUNnRZOGI2UURoS0d4ZmhIakhYNVdWSjBOTGlsNEh5L2pEVlJVY0NoSjhB?=
 =?utf-8?B?SkJhTGpwNDlVTlJPR0RPWFAvM2ppSEI0NnV5N2pOc2lTZDEvUW1Ldk5icG51?=
 =?utf-8?B?ZWlGTFI4SldsVGxQM2oyR1Ywakx1cVNNK2wyZEVnbUo4K3p0WlBvSUsvUWdo?=
 =?utf-8?B?eWRMdjhCK3RTb1FTblkyazlZVnd4aS9sc3hzWk9iaVA5K0FmUWJXV2FCQkFZ?=
 =?utf-8?B?QXVkbm9FWkRaRUdra0dZdHZtMktXbW1rTG43Q245b1NHV2xnSE9tR0w1cTlv?=
 =?utf-8?B?ZFZCUm5uZ2R1OU9RQ05rNjlraVczVHBEd3VGVjAxNmI2VzB5ZXlHMDRtU3Yy?=
 =?utf-8?B?cUVacVN1V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ORVViSituSVJt?=
 =?utf-8?Q?XeOzpnpKF/6/YUFGg+UaOdvIY?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0007932a-c089-486e-e36e-08db7e1172d7
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 11:09:21.0870
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: qm/JXBFbDBn6KLhJFtrH7tOt/k6a2ZwZX1kM+5Eqg94glJGEioF2HShw+yVUUtS2LKhKvvZG0dgSpb1wVPtOAQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6956

On 16.06.2023 15:10, Roger Pau Monne wrote:
> --- a/tools/libs/light/libxl_cpuid.c
> +++ b/tools/libs/light/libxl_cpuid.c
> @@ -88,6 +88,66 @@ static struct xc_xend_cpuid *cpuid_find_match(libxl_cpuid_policy *policy,
>      return *list + i;
>  }
>  
> +static int cpuid_add(libxl_cpuid_policy *policy, const struct cpuid_flags *flag,
> +                     const char *val)
> +{
> +    struct xc_xend_cpuid *entry = cpuid_find_match(policy, flag->leaf,
> +                                                   flag->subleaf);
> +    unsigned long num;
> +    char flags[33], *resstr, *endptr;
> +    unsigned int i;
> +
> +    resstr = entry->policy[flag->reg - 1];
> +    num = strtoull(val, &endptr, 0);
> +    flags[flag->length] = 0;
> +    if (endptr != val) {
> +        /* if this was a valid number, write the binary form into the string */
> +        for (i = 0; i < flag->length; i++) {
> +            flags[flag->length - 1 - i] = "01"[!!(num & (1 << i))];

I expect you've left this as is because you really only want to move code
here? At the very least the UB should be eliminated imo, by using 1u in
the shift. Even better might be "01"[(num >> i) & 1]. And of course using
strtoull() when num is unsigned long is a little fishy as well ...

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 11:17:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 11:17:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559860.875244 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHMzM-00066M-Qv; Thu, 06 Jul 2023 11:17:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559860.875244; Thu, 06 Jul 2023 11:17:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHMzM-00066F-OO; Thu, 06 Jul 2023 11:17:32 +0000
Received: by outflank-mailman (input) for mailman id 559860;
 Thu, 06 Jul 2023 11:17:31 +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 <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHMzL-000669-35
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 11:17:31 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on20623.outbound.protection.outlook.com
 [2a01:111:f400:fe13::623])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b0a81864-1bee-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 13:17:28 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8736.eurprd04.prod.outlook.com (2603:10a6:102:20c::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Thu, 6 Jul
 2023 11:17:26 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 11:17:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b0a81864-1bee-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BQDM0a4Ra7eV6OuWXpFajAiPuolR9yrTAZLJ7zT2qiHx4cHm2xiVUi/TiW1OG3x9dKUtjF1NMjaTS/U1wlnL+eFJrh8FDH1rkuIhdxie7WSM+E7C0oPTxolHuPWkQBeSFwuC2hjFF+mNWIwHv/bMKhc5GhH00I4+5bDt6tZiJB+iBv23tiEI5VuadRMnzPh51iaplC9Ca5/ztagxZZaK5SFhtyCkBHMWecEmyp77POpLybNPP0hpMZzRBVQd4KFYJjyTO0EycW0Ux4KSXshTpKkIakXtdAKpYLh1FBOC1Mwf/NNsl9smHZKB4pn0GdW72Ph0fYW37mCbmltJ3NqbCA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Z4dy5ESI3AgHnzlzCu9+1b+Pp2FyvKSQvyxwkQkZn/I=;
 b=VD28/lGBkoUQv2mDc0+pGW7KckdkqXa+eUEtDWVmdvIkostK6pUBAyAsisbFWMNE3udFKxoVuxU3sjA4Ccd/kdiFvFLda2tFTzoMP5D60h8tMJp5pp/USQnuaAOeXaQqLlEYfM3Tvk7HSwi1iTJKMK0ttrTaQ3UkKKypOkHFqxo1t0eXZ5ek5QIR8JMbl5NyL/RTHKNJyZeEtXFRX2JTQ2vKNusYjVoRHYn0ixgsI9j7LDamnrgVqPnRi7DqLAq1oV4ew8Z3wF3WGSnS6PxHOwAGtCserrtmEwLzsr8YGngG70tZoGbBbJu0CnIBZlmmcqQkBuEyX4WlUBF5oGQ45Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Z4dy5ESI3AgHnzlzCu9+1b+Pp2FyvKSQvyxwkQkZn/I=;
 b=dbLennHOjQKA/L6N6GvH/czsiMnKpuSazpd7QougxwSz4aYgA7bZin9p3Es9FuQFvIwYJknEIaKRsBZ9agcrstEL2brX5rAYHhse5VhuOWGPJ1Wps0RL5TND/MnrDrKi/v259gGTfGvb97hNH8mWrQVSwyk27sB84ricNBeAbcK3tFeU23gyC+it2WtLP8pQEMLcjePVtjR1geAmJU6sIKsF3uMkJCpmpzdeeggU05SzwX8QdEvNBokOO746UMB8OJAGRYN248ymO83NM7xOO/NGSwE4c/zJPsacuY8t99Jg0vgiKbuceCYzz7MzXgK/3OlAuDa6g7Oh/qbrM/Fpsg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <98f1cb38-673a-c66f-96be-ba2cb6ff242f@suse.com>
Date: Thu, 6 Jul 2023 13:17:23 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 2/6] xen/riscv: introduce reset_stack() function
Content-Language: en-US
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1687178053.git.oleksii.kurochko@gmail.com>
 <6024617719467cd2da8ae03b81ddc899f2ba4311.1687178053.git.oleksii.kurochko@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <6024617719467cd2da8ae03b81ddc899f2ba4311.1687178053.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0148.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:95::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8736:EE_
X-MS-Office365-Filtering-Correlation-Id: ac6a60e7-32b3-4f12-a474-08db7e1293f2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	gehbTRH/X4/K8mhKTCBmaiM0ZjZo/pJIQxG2HoRqldvNyRY7Hye6vQSHODW29JeGXSZoHSh4U7MEg6GIiwxblRZVndjA4+JI/yx1ErGR0X1uijfpDMgSnoV5xbzcv8W1NCTRFEQv/zPiC2AKwcB94VMxqKrzDV/unckJIwa0McBvXgbMhI1QunVznqObyATsWF2gjUu8/2s2ubE0xXruLp0nPXV7fgGbUGlH1Ily3ZZjOnMZfuJ+7HK0IeKH64GqeJ6AQW4SfI4al5ey/AFXTQjGOwN7k0TvpkyJ0gsKDc/AWCf/no9GJk/xULNP3dcHniFsPtdLoAE0ScVdn2yo5tGISAelDviJ544wLCibreru4da8UIJScRzUCxMuiKONmwPpxUnRywe53Iv7DoLhuhag6HK2VBi6+zSYUHsc0kUqwUx5UY/jZNiZ4X2ThJ9vx8tsqvoD1Qwt34BJh7KvaQUv5Jz5CafSG0Zv5ACcqXDUxtRuvhxJVznU2OJUDa//qmKY9h2Pt6HER/llDw7CwXMc+NgTJ3IzUQoGXunL0kCFBHcV9ZivyOVEMwJhAOlPnA+ADhG8NusEMguet4msHDJa6u0jrLymM22XYlmOBml1nxoo2GmmVZ7io9mVilnQXnuU6ymgxiMlkh84lPB01Q==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199021)(6666004)(478600001)(186003)(6512007)(86362001)(31696002)(6486002)(66946007)(316002)(38100700002)(2616005)(66476007)(53546011)(66556008)(31686004)(6916009)(26005)(6506007)(54906003)(4326008)(8936002)(5660300002)(4744005)(8676002)(2906002)(41300700001)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?b056YlFCTDlLRlczNkxRUzAwUnlJTTBMc0tLLzNzOHJlNmR6VUU5dDFYdnM3?=
 =?utf-8?B?MXZ6c1Z2ZUdIYkJiOWVpS0dEcmVYL0N3eFcvbGZ3TFdNNERGRUFUNzBobHJW?=
 =?utf-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
 =?utf-8?B?K25xRjIwbkhOdFNNN1A0dGF0ODFRK0JHcGxIcjM2OFJHOHVYb1YzVVNEb3hS?=
 =?utf-8?B?WEZWYlZLWkd4dklPeTROR1pRTnZ6SERNcE10ZDU0RWo2U1p6TkpTVDVDUjdU?=
 =?utf-8?B?MGljSEorZmlwOHZIYi9aM1hhQzRhaHVSV0I0cEZlL2p3NGVkRHZUcDViaXNi?=
 =?utf-8?B?WUIrdVB4QkcwVEtnV1duekRYbW80SzBPOGxoK1I5VnZzNEdLZmdtTkZ3QVc2?=
 =?utf-8?Q?6BG0m/HmsMvIOvhaDP1uwxa4o?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ac6a60e7-32b3-4f12-a474-08db7e1293f2
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 11:17:26.0741
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 0HO630aYrwLuBuoLizkMIxiG6M4fC1cgG7iKSNX13incNDFVkSHMYqfkZqMlMzxLGJzSTzbmR3+lZrWm/J38Ng==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8736

On 19.06.2023 15:34, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/riscv64/head.S
> +++ b/xen/arch/riscv/riscv64/head.S
> @@ -27,8 +27,16 @@ ENTRY(start)
>          add     t3, t3, __SIZEOF_POINTER__
>          bltu    t3, t4, .L_clear_bss
>  
> +        jal     reset_stack
> +
> +        tail    start_xen
> +
> +        .section .text, "ax", %progbits
> +
> +ENTRY(reset_stack)
>          la      sp, cpu0_boot_stack
>          li      t0, STACK_SIZE
>          add     sp, sp, t0
>  
> -        tail    start_xen
> +        ret
> +

Looking at patch 4 you will want to add a comment here to emphasize
that a0 and a1 have to remain unclobbered.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 11:19:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 11:19:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559864.875254 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHN15-0006en-6D; Thu, 06 Jul 2023 11:19:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559864.875254; Thu, 06 Jul 2023 11:19:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHN15-0006eg-3f; Thu, 06 Jul 2023 11:19:19 +0000
Received: by outflank-mailman (input) for mailman id 559864;
 Thu, 06 Jul 2023 11:19:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHN13-0006eW-QT
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 11:19:17 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2053.outbound.protection.outlook.com [40.107.7.53])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f1a2c4fa-1bee-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 13:19:16 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8736.eurprd04.prod.outlook.com (2603:10a6:102:20c::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Thu, 6 Jul
 2023 11:18:47 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 11:18:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f1a2c4fa-1bee-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=H5crOF8KVX7MiaaKEwWmV5DoJWiLWY8Feq+T5nUtkmmlwrR154lqx7gKF2lly+o4J1If2HWSDa01cCWMYSGLw3eUvg+6UWJTPyHNeOH/ERRcZ4vUTN4BCJkCh8ShlMze3VvsKsIhem0TA1od/U4EMk6NQLd06OqhWuBZ6t3fEGKraEbK/lhKKdH3n5myk3a2qiFZ6jSQ8w4xWY11yXOYGBE57TDUUCr+oBCNIduLWIk++TaBTtYRwRCiSXUiKvLhklgCBzdOrZauwFfiPiUvUafYSux3H5wIJh2ft29sYyMYMSgFp7skH5ea7iu5FXdETp0h1zJD+UtKjnb6yQ8TZw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BttqFmpdTOAAXy7pC2eeykehOkY8SMzO0n6C4sL3QBc=;
 b=PsfWPa5QLyuSPHo7Khk21xjPBq1ss+SKOoTVezrCyhmunu/e5cMRcEyQSpQRo8GOUrcN82YR36gz33qy29Vnq/NPPkJiJaHZuV2i8AsMkCEGpl6TTuygHuoYp9sSQns5k+M9Fh1OuNi1tWK7Fim3MC9VmRlJp2QZ3EZZiWvR4BUp3ukNS52CtMfxC738Ikqw4MdVtXK/H1hvjSfYmCVEwpBP4NbnFCoNJYLfZrbgTdgEYm5C65e6DczWDIACIKPSfwIVyU0djW3mxKQkIMQBE1zXaqnqmL9QdrPoKHEoh4qK8v/FoTYdQW7T5vCVANtuE6yiJ0RavPGXMQKYQLKkYg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BttqFmpdTOAAXy7pC2eeykehOkY8SMzO0n6C4sL3QBc=;
 b=N5jYl4+o7Zr3GxJMwYw0LP9r85Iyf6CgpiP+xBLJZ1WXsx5Ta9AqRfLgq1XeUOReVbhg2Ppdq38fm0KfZCRHUaVm7zJ/+ydRBxvIFY3+ch/pg4SSjIK/9Tpdvjn2A1EXo+o/88BBPh/1BnCuH2vJD8Itvk788sWxKJ3iWRC9ARV/VhpOeK6++4zFQUViuniKf4q+F5CUkIEepXYLiVJ8r+ulxZRm9vtsRN2e2wcZAYUSLZwIXkGORoFRIunHwy4kbD3oH6eLu7BuR85Jr3KidHbQjvdspKJQ4aN/4uEXNB8DBqiMQ/ZAunQr9Rq8xWlCP9L27DVmpd5uDowAXpA4Uw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <c716120e-8228-826a-bb33-298aa47b94f7@suse.com>
Date: Thu, 6 Jul 2023 13:18:45 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 3/6] xen/riscv: introduce function for physical offset
 calculation
Content-Language: en-US
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1687178053.git.oleksii.kurochko@gmail.com>
 <f84bdc5ad9f10f864d070f7581dce663ccc9cb53.1687178053.git.oleksii.kurochko@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <f84bdc5ad9f10f864d070f7581dce663ccc9cb53.1687178053.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0021.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:14::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8736:EE_
X-MS-Office365-Filtering-Correlation-Id: 277f63b4-1247-4eae-e9ca-08db7e12c481
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	N1HOQIFo2uwjFq870GMByQQF6Wd0Uu2gsbfM7NqePQ7jm9GubI3s3DVCTVPlPlvMnKhGk0kwoCKJ5rnGTTr5KCW8xu3BzToC7HKMbv+c+DdgQXlElvd1hWD9hRdaXgdCOozoG8gsMzzqai1jkI8DoEbrnLBaBXOh4qxasZ8OzV4SE1x7yP91ydvR6k9lyhXqqMdROKfhFlVlDMFly13SQa4AKJjXy94LHz+Iqs2XrvdhmBMBfkY/NcAFNirviVlVgYw14tGXMYM+6r58nS3Zmuoz0i/E8nR1bkuiNanyl0CSqOQE4nRyQYivEQhK0ZcP4XulisdXjx+GSBvOORDy0aTDm/EMwZHYJ9n0zKD8hTVW084hOJUBrxxd1M766BELm3Ffw7HiK9FMymNhT5qiFhcuqb5QNoFCCuZ+NxTxmeGXc356Pp7xZ915AbaHvLvKQST0QZ+telJDnjEnNvNAZjB/pZwmQ+OA0oATFmsNRld0dBz3py4YzuGY1Mtj74i+Vp0ReE6KSNrcVXopsLKcHMtPJmOTn2+f38cbeSTSmWrpZb3+YAnUWLBxTtc5HcYh3YB3X+B+V4KCYroI26soLjGvgzifPIrFB0x9SetC7cbJbnvMRx1Otpz4ZHxCZXANp65lcL8NBkLNq0WctL3Ukw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199021)(478600001)(83380400001)(186003)(6512007)(86362001)(31696002)(6486002)(66946007)(316002)(38100700002)(2616005)(66476007)(53546011)(66556008)(31686004)(6916009)(26005)(6506007)(54906003)(4326008)(8936002)(5660300002)(4744005)(8676002)(2906002)(41300700001)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aXBxV2llcE1CbnNldEdWOTRiaUdBakhnWGRVcldBQzgvVk5CUmZYMUl6cjll?=
 =?utf-8?B?R3FxSW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ZVSlVYYUFTa0RoT243?=
 =?utf-8?B?czNrZ3RDS3FQK2FzTDJyWjh0KzJNWEwyQzJNdTd3eE9FNXkxRXU4ZDFNVWE0?=
 =?utf-8?B?NlFYZ0ZRNXBDVzJTQ2ZxM1ZoblVRUmFGYzExKzM1M3poUFlXd2F6RUZHVzNF?=
 =?utf-8?B?NC9HUjFCMzZrZDhvK3FrYkZSMllrdENBV1hBSUxVdVNaY21FNWoySnk4OWV6?=
 =?utf-8?B?ZUIvdmZFMGIwaEEwWEFlNVA1V3hVL2RBa0owK201NGhKREFjcWIxc1g2eW5Q?=
 =?utf-8?B?WVNtTDRSeS9sK0MwV3VteXdXQnI4UVRWc3N0ckZMOEN0N1VQZE53NkZaWFZL?=
 =?utf-8?Q?GwkcqMY7WnxCkilF74fTduZPP?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 277f63b4-1247-4eae-e9ca-08db7e12c481
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 11:18:47.5604
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: xuD4dt7le5mqXd3z3Z26V/o3XWzWeBGvwTfpEASkVsMXhk4BDmJIJVr9fqYlaD92tI/QeWGgyaWmHuEbnp38tQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8736

On 19.06.2023 15:34, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/riscv64/head.S
> +++ b/xen/arch/riscv/riscv64/head.S
> @@ -29,6 +29,8 @@ ENTRY(start)
>  
>          jal     reset_stack
>  
> +        jal     calc_phys_offset
> +
>          tail    start_xen
>  
>          .section .text, "ax", %progbits

Since you call a C function, the code to save/restore a0/a1 needs to
move here (from patch 4).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 11:35:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 11:35:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559870.875265 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHNGo-0000iv-Ma; Thu, 06 Jul 2023 11:35:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559870.875265; Thu, 06 Jul 2023 11:35:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHNGo-0000io-JQ; Thu, 06 Jul 2023 11:35:34 +0000
Received: by outflank-mailman (input) for mailman id 559870;
 Thu, 06 Jul 2023 11:35:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHNGn-0000ig-Ei
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 11:35:33 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on20625.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::625])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 372df7f3-1bf1-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 13:35:32 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS5PR04MB9755.eurprd04.prod.outlook.com (2603:10a6:20b:650::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 11:35:30 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 11:35:30 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 372df7f3-1bf1-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=UFgCxtRCzOsCAnEN51lyK9dH7dVeTmRFegGIEEueEXNZXJnC8Jt9t8cekS2zwfD0rQHcFL9OL1kzT1bfuDusyE1aQW2FOa4o3g6CGA0XylvTJmz7jgEFvXVhooycTF2MbnT3CPEGnlHnN8SV+Eji2xpkFXwjG6ADFr7xPx5f8GI4wwiZQ4rOP+1OdQbWJjj/Fzk5+AyaywdilbC0F56gzkaFwfzqAqAzVOwEzKQSrfG1VpKKjVVI6Y0MMWND+ymuQNGrEDBmvxYMnI8BHY72Oxb9MVt7+Y7NWAks5ZT1+0SuFYZxHcrEcetrm55f7fIIzA1uTEJ/RCRdAoCN37EczQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+quS3CO3zvxhccjUTIkOuJF4zafkjpKtTXzsyQgJbp0=;
 b=TbcYJfaZ/PkePJvy+fcMB666AOFZagJeLVEM3ak+5uw8cTX9ddY9k1s7CaRMkATuhznR3llQ68BS4T+GG8agyx10s7WwStXtHrOMqiB1erH0YtJjFSuxOhaBFUSQycD+2P1dQ6cxDRQC2CkNPmGtH4bqOLzSjWMhzFSq4v/xQYRJ1yVbZy78XefdoBKNU07Rlcs5JK/IeK1Okux55yD8MY63nMxSEcWhEEfwFvqbtoCWcIftZGaog4GQslr9yosrposKabFcSUYvCAiIsxr3hJJCDjbSzI+sOX2jYSfVg4ddZ0HPIGp1RvPAUPYMGI7GvPz7MQ/3sV8+NLs2UPdqgA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+quS3CO3zvxhccjUTIkOuJF4zafkjpKtTXzsyQgJbp0=;
 b=MJoQdb4T2P91xyUP7L1zCdlWmnBOtJV7xZeTjz4MuUahu+Jqlh5uR2Da/EuM93eHr3SHkc9eIb4Luo/1tbkUgN6/CZPYbnGHj1djNwSy3ak5RYHz4VkI+5gPGbQYPMtiY4t0EtuJnU21vZIb0TrsIY2lG5QFw3xmgCthLqLHwZr1n1SoyRhfTASJz4grDWR/EKqEfvDnN931+MX0Cq7xzanlQZKUD2q4OcwpgDRZ9ObyukM+vBsSubWilESR5iUW56l1eNKrNaiAgqBGMOaO0+mds+Qb7cXRSy45FCCij/ilyCLdTMXbqoQO/0Gs5HJCq5E9txq4KFk8xXQBtTivPA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <67df28ad-060e-07d5-acf2-02c3cd5f0b96@suse.com>
Date: Thu, 6 Jul 2023 13:35:28 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 4/6] xen/riscv: introduce identity mapping
Content-Language: en-US
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1687178053.git.oleksii.kurochko@gmail.com>
 <21d8ce65f718bc10c2213688f79cf5f978bcaf16.1687178053.git.oleksii.kurochko@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <21d8ce65f718bc10c2213688f79cf5f978bcaf16.1687178053.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0055.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4b::18) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS5PR04MB9755:EE_
X-MS-Office365-Filtering-Correlation-Id: 95d88692-bc33-4f99-92f4-08db7e151a40
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	eqJdMUiEyagkzPUSA8wwfdRbjQovftalcsCG1T8d2zsq//AG/tdY8dwDBNyJ3yrHFLlTuiH97ELt+G8jsd7UAsc9+H31BGyQEK3yeg0mFw5MgJY43UG9Ei5jM0KQlmo3BJFinemPdCWOT2/UJI3joO18Z/4qg+ev0NqABwBikAu3M4pkUpS/v65c9DmvFmB8pwkz4t08G95mnTBpwBQt29moqBdamDT0NUXkedlYTDmmLixgVnqGFYk39wNKOBPJ454Kvxf9g+sy+8Jp3x6I9qrQvj6qI85URwPLYI4Un7gjqqa1sKKdKy77lVvqORw2CY0DXJlyyah0v2Wxx0E2aOpMVn3IM1c+C7JmOeC24R8t+yl9uZ0WRt4FXbZ0GqObQc7Do9F1O02KBQfQrKGthimvgWLdUn0VPdIaqNKQE/nzwu/X1XJeULrFTGPE0GTS0HjXlNpTPoW1ZGSdd6z4kqeWlS2WwaLEqWuhqWfuZSqE3yqDyOPp86x+GnaGp2C0myTWu6VXvPE83czRa+IyyYrYE+ZBDbCJwqHmr9vVXdVYmclnjEiCr3GicY9/4RIEWZqKv1SKhyy2JZ31GMId4F9JfwHjFwL8WY8WEaAutOFR9y8KLcPKU1cyZhbMHTTsa/RyI/GBr/NCWYdMsVHhtQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(366004)(376002)(396003)(39860400002)(136003)(451199021)(66556008)(6916009)(4326008)(66476007)(2616005)(66946007)(38100700002)(31696002)(86362001)(186003)(26005)(6506007)(53546011)(83380400001)(6512007)(478600001)(54906003)(36756003)(41300700001)(8676002)(8936002)(31686004)(2906002)(6486002)(5660300002)(316002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WnJ1V0xWYUdKcENDQ0hsTlg1Q0JTbTdlamptZm8vOUFDTi9rNGRSVitYYm5B?=
 =?utf-8?B?U2JGV3gwRExHMTFCN1pUb2x2a3N0dkcyY3kzOUJYTX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mUHNpVUNjanlYUkZJRnJzcEoyVHFLN3Yz?=
 =?utf-8?B?TXpLYzJac3dEY25nN0ZPUW95Z0Q4U3lKdmpWaWtJTU5SUWRuQzBBRU5jM21u?=
 =?utf-8?B?cFR5ZFVhdmQrbFlnYVdvbXpvLyt0T0RCVHd1dTJPQ2gxb0EyTkdlVVprVGVu?=
 =?utf-8?B?RnAvNVVtNGl6OUVFQUJMZ0d4eWt0NHA3VmlJK1lCQVhEMTVpTU5aRzVHcm5s?=
 =?utf-8?B?eUpiVGlBK3hrRXJqb2RGYnpJRmJPQmhQRE1VM0JObUgwTXFGQXFhSFdYdEt0?=
 =?utf-8?Q?y5jOCSfEBqUN7zRteZ3eL79wC?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 95d88692-bc33-4f99-92f4-08db7e151a40
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 11:35:30.3877
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: xe9MCmegJNCsLIJK+JXDfFHBpgCbl8iCLc86JHF/2QG6gm+NoOhveVRroFta89w1Mx+oEq/fmyQXi1/aCWFrtQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB9755

On 19.06.2023 15:34, Oleksii Kurochko wrote:
> Since it is not easy to keep track where the identity map was mapped,
> so we will look for the top-level entry exclusive to the identity
> map and remove it.

I think you mean "top-most" or some such, as it's not necessarily the
top-level entry you zap.

> --- a/xen/arch/riscv/include/asm/config.h
> +++ b/xen/arch/riscv/include/asm/config.h
> @@ -1,3 +1,5 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
>  #ifndef __RISCV_CONFIG_H__
>  #define __RISCV_CONFIG_H__
>  

Unrelated change?

> --- a/xen/arch/riscv/mm.c
> +++ b/xen/arch/riscv/mm.c
> @@ -25,6 +25,12 @@ unsigned long __ro_after_init phys_offset;
>  #define LOAD_TO_LINK(addr) ((unsigned long)(addr) - phys_offset)
>  #define LINK_TO_LOAD(addr) ((unsigned long)(addr) + phys_offset)
>  
> +/*
> + * Should be removed as soon as enough headers will be merged for inclusion of
> + * <xen/lib.h>.
> + */
> +#define ARRAY_SIZE(arr)		(sizeof(arr) / sizeof((arr)[0]))
> +
>  /*
>   * It is expected that Xen won't be more then 2 MB.
>   * The check in xen.lds.S guarantees that.
> @@ -35,8 +41,10 @@ unsigned long __ro_after_init phys_offset;
>   *
>   * It might be needed one more page table in case when Xen load address
>   * isn't 2 MB aligned.
> + *
> + * (CONFIG_PAGING_LEVELS - 1) page tables are needed for identity mapping.
>   */
> -#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) + 1)
> +#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) * 2 + 1)

How come the extra page (see the comment sentence in context) isn't
needed for the identity-mapping case?

> @@ -255,25 +262,30 @@ void __init noreturn noinline enable_mmu()
>      csr_write(CSR_SATP,
>                PFN_DOWN((unsigned long)stage1_pgtbl_root) |
>                RV_STAGE1_MODE << SATP_MODE_SHIFT);
> +}
>  
> -    asm volatile ( ".p2align 2" );
> - mmu_is_enabled:
> -    /*
> -     * Stack should be re-inited as:
> -     * 1. Right now an address of the stack is relative to load time
> -     *    addresses what will cause an issue in case of load start address
> -     *    isn't equal to linker start address.
> -     * 2. Addresses in stack are all load time relative which can be an
> -     *    issue in case when load start address isn't equal to linker
> -     *    start address.
> -     *
> -     * We can't return to the caller because the stack was reseted
> -     * and it may have stash some variable on the stack.
> -     * Jump to a brand new function as the stack was reseted
> -     */
> +void __init remove_identity_mapping(void)
> +{
> +    unsigned int i;
> +    pte_t *pgtbl;
> +    unsigned int index, xen_index;
> +    unsigned long load_addr = LINK_TO_LOAD(_start);
>  
> -    switch_stack_and_jump((unsigned long)cpu0_boot_stack + STACK_SIZE,
> -                          cont_after_mmu_is_enabled);
> +    for ( pgtbl = stage1_pgtbl_root, i = 0;
> +          i <= (CONFIG_PAGING_LEVELS - 1);

i < CONFIG_PAGING_LEVELS ? But maybe it would be easier for i to start
at CONFIG_PAGING_LEVELS and be decremented, simplifying ...

> +          i++ )
> +    {
> +        index = pt_index(CONFIG_PAGING_LEVELS - 1 - i, load_addr);
> +        xen_index = pt_index(CONFIG_PAGING_LEVELS - 1 - i, XEN_VIRT_START);

... these two expressions?

> +        if ( index != xen_index )
> +        {
> +            pgtbl[index].pte = 0;
> +            break;
> +        }

Is this enough? When load and link address are pretty close (but not
overlapping), can't they share a leaf table, in which case you need
to clear more than just a single entry? The present overlap check
looks to be 4k-granular, not 2M (in which case this couldn't happen;
IOW adjusting the overlap check may also be a way out).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 12:31:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 12:31:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559876.875275 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHO8O-00072N-P2; Thu, 06 Jul 2023 12:30:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559876.875275; Thu, 06 Jul 2023 12:30:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHO8O-00072G-Ks; Thu, 06 Jul 2023 12:30:56 +0000
Received: by outflank-mailman (input) for mailman id 559876;
 Thu, 06 Jul 2023 12:30:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHO8N-000726-JU; Thu, 06 Jul 2023 12:30:55 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHO8N-0000ef-B7; Thu, 06 Jul 2023 12:30:55 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHO8M-0005Ru-WC; Thu, 06 Jul 2023 12:30:55 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qHO8M-0004lH-Vh; Thu, 06 Jul 2023 12:30:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=GOqZe9UU/zqKBaYS01GoQHT7Bz9oiQixhsFpZVeIdB4=; b=aJVCr3+IJXLAHJ//B6CBw8bwLV
	vZ0cbBnt2ncpP9p8fmXF5QQSxIChn9pqIB28VID6zZw6yy+DLF0kjRWNozwrRCMVSFCMRrbDoQ890
	OouNPXscic/50quCR0wp4ljNKvmU865oU7iMK9f3wm/hW1f4THCG8QRrZFfpizsc0+Sk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181716-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181716: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-pygrub:debian-di-install:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:windows-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:leak-check/basis(11):fail:allowable
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=6843306689aff3aea608e4d2630b2a5a0137f827
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 06 Jul 2023 12:30:54 +0000

flight 181716 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181716/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2  8 xen-boot               fail REGR. vs. 180278
 test-amd64-amd64-xl           8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-libvirt     11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd 11 leak-check/basis(11)    fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64  8 xen-boot    fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd  8 xen-boot            fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow   12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 13 xen-boot/dst_host       fail REGR. vs. 180278
 test-amd64-amd64-pygrub      12 debian-di-install        fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 12 windows-install  fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds     11 leak-check/basis(11)     fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                6843306689aff3aea608e4d2630b2a5a0137f827
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   80 days
Failing since        180281  2023-04-17 06:24:36 Z   80 days  157 attempts
Testing same since   181716  2023-07-06 01:45:28 Z    0 days    1 attempts

------------------------------------------------------------
3695 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 610496 lines long.)


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 12:31:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 12:31:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559881.875285 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHO98-0007XC-1t; Thu, 06 Jul 2023 12:31:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559881.875285; Thu, 06 Jul 2023 12:31:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHO97-0007X5-Ub; Thu, 06 Jul 2023 12:31:41 +0000
Received: by outflank-mailman (input) for mailman id 559881;
 Thu, 06 Jul 2023 12:31:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=NM3K=CY=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qHO96-0007TL-MT
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 12:31:40 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on061e.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::61e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0de68802-1bf9-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 14:31:39 +0200 (CEST)
Received: from DU2PR04CA0251.eurprd04.prod.outlook.com (2603:10a6:10:28e::16)
 by AM8PR08MB6436.eurprd08.prod.outlook.com (2603:10a6:20b:365::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.19; Thu, 6 Jul
 2023 12:31:34 +0000
Received: from DBAEUR03FT038.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:28e:cafe::f4) by DU2PR04CA0251.outlook.office365.com
 (2603:10a6:10:28e::16) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Thu, 6 Jul 2023 12:31:34 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT038.mail.protection.outlook.com (100.127.143.23) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.24 via Frontend Transport; Thu, 6 Jul 2023 12:31:33 +0000
Received: ("Tessian outbound e2424c13b707:v142");
 Thu, 06 Jul 2023 12:31:33 +0000
Received: from df0511b79b9c.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 91283564-B3AB-4497-A796-5E811B494832.1; 
 Thu, 06 Jul 2023 12:31:22 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id df0511b79b9c.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 06 Jul 2023 12:31:22 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by DU0PR08MB8786.eurprd08.prod.outlook.com (2603:10a6:10:473::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Thu, 6 Jul
 2023 12:31:19 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::3861:64c:eb82:afa1]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::3861:64c:eb82:afa1%4]) with mapi id 15.20.6565.016; Thu, 6 Jul 2023
 12:31:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0de68802-1bf9-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Jm3ACxOy7D6NMWxNknWHeDscW3nXfaihZ3AGo9W+uf4=;
 b=1czTkXmD+k7Mk5n6ezOU6fK7ZH23dHoprFfllWC2ZfJjMqGRb5AClZlVHyxnqu/m4V2C4zT+07QiVWv/2h6UY4YOMJWw08xrzTJ1N5rfmMuaiguV/CKteMTmdpBzAVIlJjXL/J+q80SnTkjyEGZL2fY/0pwLclp47A9Ps13QHZk=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: b1cde73cd8cb7e3b
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JXKLQYcClltGPNF6xtb5aNK6xT84tq4seUcpAFZZUVpuSlsWJ3dl7m0uLXwEW0TVXAMPy3/hRPtakZgUeIF51g/mQlNkH5PZ6FRFWxjkYOeL97JS7A1qMoOXdaLRe7wj2hiQxT8I4Pj/w/PuYH3z3cS8wP/WD5zTZUp1GjRQclNJSJxgnxlgzkbQVmTVCn6YBvpUeP0x3tuL5O7Fv1jAZnopFikRpR02E8ajQjFiY9KF2ffe1ycbmJ8l/3ZWP2PAVbSBUSmCcgNE1dfkj0fI2oPe7IDDqLNU+8zMLz78DutxrtjAZCJQ3ZNLcIcPzI/m2qcNK/IjYjgrBmeR6WuwKw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Jm3ACxOy7D6NMWxNknWHeDscW3nXfaihZ3AGo9W+uf4=;
 b=be/KMCm+/VNgs/LDAB7XWwKA/1DwN/Nr4EbNy6QfuYAm77kIEAO+N7tYH9J2XibIYX6I78PYu/Zq5NPEXHbH6KAnvrasoePeqRgeCf1sAe5/BfNBJQ2WkX7s7f7jYPgCEy+GxeXcPpJoshdcPc98b7RuuOX+ZejhPe5ib7cJW0Tan8EeloU5Q13jAMllL9RUgC5uRteNiPAQbM6OghjXtfXSVwFrfdCR0JUqvrk0QzmEVBIXX5h3HeP7RS0Rzty7mWovbkU+tO7uy0WiRvCJACt8WPLpLiUB/QVp3TLrWzdlYvwDZn/m4QsfUMPwDZsOOOC/cLZfdwxP+hs51dng2g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Jm3ACxOy7D6NMWxNknWHeDscW3nXfaihZ3AGo9W+uf4=;
 b=1czTkXmD+k7Mk5n6ezOU6fK7ZH23dHoprFfllWC2ZfJjMqGRb5AClZlVHyxnqu/m4V2C4zT+07QiVWv/2h6UY4YOMJWw08xrzTJ1N5rfmMuaiguV/CKteMTmdpBzAVIlJjXL/J+q80SnTkjyEGZL2fY/0pwLclp47A9Ps13QHZk=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: George Dunlap <george.dunlap@cloud.com>
CC: Stefano Stabellini <stefano.stabellini@amd.com>, P S
	<pairspace@gmail.com>, Stefano Stabellini <sstabellini@kernel.org>, "Daniel
 P. Smith" <dpsmith@apertussolutions.com>, Christopher Clark
	<christopher.w.clark@gmail.com>, Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>,
	George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, Henry Wang
	<Henry.Wang@arm.com>, Community Manager <community.manager@xenproject.org>,
	Doug Goldstein <cardoe@cardoe.com>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
Thread-Topic: [RFC PATCH] xen/arm: Rebranding dom0less feature
Thread-Index:
 AQHZqzMUKP6yBnvUfEC1egkdxmuozK+ki8cAgAB66ACAAukxgIAAZuEAgAAgQQCAABPDAIACuauAgACBNoCAAMWkAIAAKcoA
Date: Thu, 6 Jul 2023 12:31:18 +0000
Message-ID: <A89C2FC7-999E-4FCE-8A05-4F4B86573DBA@arm.com>
References: <8601CDD7-87F7-4FD0-A6E6-BAEAB12E7956@arm.com>
 <234199F8-DBB1-42B6-9A4C-8800EEF60997@gmail.com>
 <CA+zSX=Y3_g_aq4+sDK7CuZajywVqQ4xOrq7hKZ80eUT3uSxzuQ@mail.gmail.com>
 <alpine.DEB.2.22.394.2307051436120.761183@ubuntu-linux-20-04-desktop>
 <CA+zSX=ashTi590+cVss_3zyLESC8S=zVSMLjTKD00s6xfjZbJA@mail.gmail.com>
In-Reply-To:
 <CA+zSX=ashTi590+cVss_3zyLESC8S=zVSMLjTKD00s6xfjZbJA@mail.gmail.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|DU0PR08MB8786:EE_|DBAEUR03FT038:EE_|AM8PR08MB6436:EE_
X-MS-Office365-Filtering-Correlation-Id: a1f12919-cca9-47a1-5720-08db7e1ceeec
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 MSeKIJ6Me1W+Y84jFW4AFFZpUcc0rLc2eni3cUKs4jMR7XrrXCDo7f35rFl7SJiA5+rFM1e4SYDUNBMx7Tqru2nweHEFy3T6Wht2WPSH+BhnNIRJOABuESi1Q3MFaWiit0rj/JUVh0wcfKfKLaQIr6IQ9gfsGYhYtPhcDAUSHflZ49wKoar4GqlbdeYeZ/iFA50lsVrT3fU3z0MwlGqCkPcPnXRMBDMnqWIa0aYTTjgkdIERvpX+ZADIPmcr0LWKjk9ujyOv60G6eC0Obq8GS8uocntpR/8nocsJnmUlT9Ja9lnptSPJD8czdrIw7YIbhUGwivYTgpN7MTPsu+EUNB4LYpGu7XnM7NxiA2r26z3r0eRVUqeOVlfCZIIILHKbL6/WgXjhxvswa0nVrY8uA+Gz7UQ8YioIuoltHGxerTf934UD1F3Po8s64EhhWpm3yD+6DqQyknrKQPrb4+HtzOw7MR9bBUke2qzCguM9nRxJKneetZBvFspwuNNuJYwYxt/2Gi9A6bAV2QO4sz1aHg5Zx1j3pYLMqzK1GvN9dSjoME03Wz0puLbcPkyD6mQ9iua0sEjRMFqiDCN5Jypufo00l/nTY0HI8dYclS5FbtxphfJjlSpIIcz7BE9cqvzdTGq2Kuvzlnq6exPWQr20ceNpbYNzY/UT8acNUnYwP3M=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(396003)(39860400002)(366004)(346002)(451199021)(33656002)(30864003)(38100700002)(71200400001)(2906002)(6486002)(8936002)(54906003)(38070700005)(8676002)(41300700001)(36756003)(478600001)(7416002)(5660300002)(53546011)(66476007)(66556008)(6916009)(6512007)(66446008)(66946007)(91956017)(6506007)(186003)(26005)(64756008)(86362001)(76116006)(4326008)(316002)(122000001)(2616005)(83380400001)(32563001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <D5B7DC32EF2BE6418020C9387A590289@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8786
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT038.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	e071d0e0-5f06-4853-809c-08db7e1ce645
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	QZRLsWwXCF3yVXkZ1UEvyFxyRw/s3CxsjFS5S6XVcFHtprD/jlxK9HcHKOJIkPA8cVWQG/6VPYliVCmm9XKqEWDsGFVmEVo6xqCqcMCa6uHb0GmUBeRJ2bx6heSDspE0XBOS+8+mZIkMppfZzXXOZjbd4e/jtJ3BPZz0sP59i9W/w2J8KRGduUMN8VVIeFIrLihK02dUgREkE6SoXOP7I3WwOITVjtDwI3ftvVJ5mJF1TLRcRoIsgJ8/QTayJImVKtNzQ/mtv7xUu1Hih4GOn+tcY7rzKYiq70Jmg2d6421MLxOqRJvLutf2psh6D3/hfwwEpt/NzMF+yGJNdvA6+hw6BNV1lYeV1ojLv+79E9v4mchjRydI6yk0oqeONQZZ47RdZ/6tYt3CDPralfv6amqzd9OAGfC2CymTFV7H9jU9sTIbwE8ezoLfkiqIOIYZvtnq+a9xaDCIfJDvgmeLOjsmsN/66P2Ag4fxaYRC06WkOuh95nnwoJDyOokBmtH5FPMFWSJ5gK1QAcST3IbcVDaU/jdZC75coG65eLfJVARM4Fv96+dZMtYJNB5Uf/F+h+/PP3mHoGPl2YtzEmw8DZZUY4TST6eLfH35yiDPY4ZQ2TN45udYuLY5zoQ88BPJK5Bfq1HWxj2kGKMZNlB17RWJJa6fboA3kfrCmlOpUJOTOXxKHxOtmxJyFzXpsH86H+cJ2Vs8X88cNGyx8PSIK8ZoQG6lywd4x77nf7l0Ztplb4IT16/UkeAe6ikRNTEPz6BCk3bCCZ+/LwsEIf1sjQ==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(376002)(346002)(451199021)(46966006)(40470700004)(36840700001)(54906003)(8936002)(478600001)(36756003)(107886003)(5660300002)(8676002)(6486002)(70206006)(4326008)(70586007)(6862004)(316002)(41300700001)(6512007)(40460700003)(40480700001)(81166007)(356005)(47076005)(6506007)(86362001)(2616005)(26005)(53546011)(82740400003)(336012)(30864003)(36860700001)(83380400001)(82310400005)(2906002)(186003)(33656002)(32563001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 12:31:33.4926
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: a1f12919-cca9-47a1-5720-08db7e1ceeec
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT038.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6436

DQoNCj4gT24gNiBKdWwgMjAyMywgYXQgMTE6MDEsIEdlb3JnZSBEdW5sYXAgPGdlb3JnZS5kdW5s
YXBAY2xvdWQuY29tPiB3cm90ZToNCj4gDQo+IA0KPiANCj4gT24gV2VkLCBKdWwgNSwgMjAyMyBh
dCAxMToxNOKAr1BNIFN0ZWZhbm8gU3RhYmVsbGluaSA8c3RlZmFuby5zdGFiZWxsaW5pQGFtZC5j
b20+IHdyb3RlOg0KPiBPbiBXZWQsIDUgSnVsIDIwMjMsIEdlb3JnZSBEdW5sYXAgd3JvdGU6DQo+
ID4gT24gTW9uLCBKdWwgMywgMjAyMyBhdCA5OjU14oCvUE0gUCBTIDxwYWlyc3BhY2VAZ21haWwu
Y29tPiB3cm90ZToNCj4gPiAgICAgICA+IE9uIEp1bCAzLCAyMDIzLCBhdCAxNTo0NSwgTHVjYSBG
YW5jZWxsdSA8bHVjYS5mYW5jZWxsdUBhcm0uY29tPiB3cm90ZToNCj4gPiAgICAgICDvu78+DQo+
ID4gICAgICAgPj4gT24gMyBKdWwgMjAyMywgYXQgMTg6NDgsIFN0ZWZhbm8gU3Rh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hlcmUncyBtb3JlIHRvIEh5cGVybGF1bmNoIHRoYXQncyBjb21p
bmcgZG93biB0aGUgcm9hZD8NCj4gDQo+ICAtR2VvcmdlDQoNCg==


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 12:45:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 12:45:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559888.875295 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHOMM-0000lV-6U; Thu, 06 Jul 2023 12:45:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559888.875295; Thu, 06 Jul 2023 12:45:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHOMM-0000lO-2L; Thu, 06 Jul 2023 12:45:22 +0000
Received: by outflank-mailman (input) for mailman id 559888;
 Thu, 06 Jul 2023 12:45:20 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qHOMK-0000lI-L0
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 12:45:20 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHOMD-00016s-Gu; Thu, 06 Jul 2023 12:45:13 +0000
Received: from [54.239.6.185] (helo=[192.168.30.29])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHOMD-0002KC-5s; Thu, 06 Jul 2023 12:45:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=QHzoLoECchFXzDTUbZPqRdCe6SzEqxD8ctaXCoIgKBg=; b=Vmhjr3wBXUTOzPAkIdX2RksJ8O
	hYbGhnOdqi6I+AQLVuchS+P2KGj8g/a9Qaogbh7qEgB4/l3HM0smoaGIOEsGw4CXDI7cj7fpJvjmH
	sjLF4HZ1WDYlcI2paonZxI4WiHjTnKEDcLRomYhFHyOU0gx2YcWAtWocYV+3pNlkg1L0=;
Message-ID: <4aec2aca-e2e6-d9e4-1f73-b5f98245033a@xen.org>
Date: Thu, 6 Jul 2023 13:45:09 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
Content-Language: en-US
To: Luca Fancellu <Luca.Fancellu@arm.com>,
 George Dunlap <george.dunlap@cloud.com>
Cc: Stefano Stabellini <stefano.stabellini@amd.com>, P S
 <pairspace@gmail.com>, Stefano Stabellini <sstabellini@kernel.org>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 Christopher Clark <christopher.w.clark@gmail.com>,
 Andrew Cooper <Andrew.Cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Henry Wang <Henry.Wang@arm.com>,
 Community Manager <community.manager@xenproject.org>,
 Doug Goldstein <cardoe@cardoe.com>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Anthony PERARD <anthony.perard@citrix.com>
References: <8601CDD7-87F7-4FD0-A6E6-BAEAB12E7956@arm.com>
 <234199F8-DBB1-42B6-9A4C-8800EEF60997@gmail.com>
 <CA+zSX=Y3_g_aq4+sDK7CuZajywVqQ4xOrq7hKZ80eUT3uSxzuQ@mail.gmail.com>
 <alpine.DEB.2.22.394.2307051436120.761183@ubuntu-linux-20-04-desktop>
 <CA+zSX=ashTi590+cVss_3zyLESC8S=zVSMLjTKD00s6xfjZbJA@mail.gmail.com>
 <A89C2FC7-999E-4FCE-8A05-4F4B86573DBA@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <A89C2FC7-999E-4FCE-8A05-4F4B86573DBA@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 06/07/2023 13:31, Luca Fancellu wrote:
> 
> 
>> On 6 Jul 2023, at 11:01, George Dunlap <george.dunlap@cloud.com> wrote:
>>
>>
>>
>> On Wed, Jul 5, 2023 at 11:14â€¯PM Stefano Stabellini <stefano.stabellini@amd.com> wrote:
>> On Wed, 5 Jul 2023, George Dunlap wrote:
>>> On Mon, Jul 3, 2023 at 9:55â€¯PM P S <pairspace@gmail.com> wrote:
>>>        > On Jul 3, 2023, at 15:45, Luca Fancellu <luca.fancellu@arm.com> wrote:
>>>        ï»¿>
>>>        >> On 3 Jul 2023, at 18:48, Stefano Stabellini <sstabellini@kernel.org> wrote:
>>>        >>
>>>        >>> On Mon, 3 Jul 2023, Daniel P. Smith wrote:
>>>        >>> On 7/1/23 11:13, Luca Fancellu wrote:
>>>        >>>>> On 1 Jul 2023, at 08:53, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>>        >>>>>
>>>        >>>>> On 30/06/2023 10:12 am, Luca Fancellu wrote:
>>>        >>>>>> The "dom0less" feature was intended to be the feature where a domU
>>>        >>>>>> domain could be launched without the control domain (Dom0)
>>>        >>>>>> intervention, however the name seems to suggest that Dom0 cannot
>>>        >>>>>> be part of the configuration, while instead it's a possible use case.
>>>        >>>>>>
>>>        >>>>>> To avoid that, rename the "dom0less" configuration with the name
>>>        >>>>>> "hyperlaunch", that is less misleading.
>>>        >>>>>>
>>>        >>>>>> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
>>>        >>>>>> ---
>>>        >>>>>> This is an RFC to get the feeling of the community about the name
>>>        >>>>>> change, for now it's everything in one patch just to see how it
>>>        >>>>>> will look like, if there is interest on proceeding into it, I can
>>>        >>>>>> split in more commit.
>>>        >>>>>
>>>        >>>>> Have you discussed this with Dan and Chris at all?  You haven't even
>>>        >>>>> CC'd them.
>>>        >>>>
>>>        >>>> No, this rename idea started from a chat during the summit, anyway Julien
>>>        >>>> promptly add them to the CC, because I forgot.
>>>        >>>
>>>        >>> No worries and thank you for considering and taking the time to do this RFC.
>>>        >>> It is greatly appreciated that there is a strong willingness to have dom0less
>>>        >>> and hyperlaunch merged.
>>>        >>>
>>>        >>>>>
>>>        >>>>> While there is a lot of end-goal in common between the dom0less and
>>>        >>>>> hyperlaunch, and that the name dom0less is deeply misleading,
>>>        >>>>> hyperlaunch is specifically not this.
>>>        >>>>
>>>        >>>> Yes Hyperlaunch is more than this, however as I said, with this RFC I would
>>>        >>>> like
>>>        >>>> to ear opinions, @Daniel @Christopher could it be a proper name for the
>>>        >>>> dom0less
>>>        >>>> feature?
>>>        >>>
>>>        >>> As Andy has alluded, hyperlaunch is meant to provide a flexible means to
>>>        >>> handle domain construction at boot to meet a wide range of possible use cases.
>>>        >>> One of those use cases is dom0less, so yes, ultimately what dom0less does
>>>        >>> today will be achievable under hyperlaunch. Our intended approach to align the
>>>        >>> two implementations is one that is meant to be minimally disruptive, since
>>>        >>> dom0less is considered a supported (SUPPORT.md) capability. As mentioned, we
>>>        >>> are greatly appreciative to the openness to adopt the name,
>>>        >>
>>>        >> Thanks Daniel!
>>>        >>
>>>        >>
>>>        >>> but a big concern
>>>        >>> I personally have is the confusion it could cause a general user. A blanket
>>>        >>> rename would end up with two documents in the docs tree that provide two
>>>        >>> different explanations of hyperlaunch and two different device tree
>>>        >>> definitions. So I think a more measured approach should be considered here.
>>>        >>>
>>>        >>>> If this patch makes things more difficult for the Hyperlunch serie, Iâ€™m ok
>>>        >>>> to drop it,
>>>        >>>> my only aim was just to find a less misleading name for the feature.
>>>        >>>
>>>        >>> What I would like to suggest as a good first step would be an update to the
>>>        >>> dom0less document. Provide a note at the beginning that points to the
>>>        >>> hyperlaunch design doc as a more general approach that will eventually subsume
>>>        >>> dom0less. This would provide a gentler transition for exist users of dom0less.
>>>        >>>
>>>        >>> If it is not too much, I would also ask, please have a look at the design for
>>>        >>> boot modules in the series Christopher just posted. The design pulls from the
>>>        >>> work done by dom0less and expanded upon it. I major step into merging the two
>>>        >>> capabilities will be to have a common set of structures. Once those are in
>>>        >>> place, we can move to a common device tree representation, and at that point
>>>        >>> we would be fairly close, if not at the point of a formal merger of between
>>>        >>> the two.
>>>        >>
>>>        >> At the moment we have a concrete problem with explaining dom0less and
>>>        >> hyperlaunch to potential new users. Using two different names for a
>>>        >> similar feature on arm and x86 causes confusion. It is hurting Xen as a
>>>        >> solution. Personally I already had to switch to use the word
>>>        >> "hyperlaunch" for everything in my users-facing presentations.
>>>        >>
>>>        >> At the summit, we discussed that it would be a good idea to use a single
>>>        >> name to refer to both features on arm and x86. Given that "dom0less"
>>>        >> causes additional issues because it makes people think that there is no
>>>        >> Dom0, the suggestion was to use "hyperlaunch" to refer to both features.
>>>        >>
>>>        >> We don't need to 100% align the two implementations and data structures.
>>>        >> This is not for engineers that are going to look at the specifications
>>>        >> and improve them. This is for users/customers of Xen that are trying to
>>>        >> understand what the hypervisor enables them to do. We need to be able to
>>>        >> show users architecture slides with the same name and explanation on
>>>        >> both ARM and x86.
>>>        >>
>>>        >> I am sure that Daniel and Christopher remember, but for the others on
>>>        >> this email thread, the name "hyperlaunch" was born exactly to be that:
>>>        >> the one name to cover both features on ARM and x86 even if they have a
>>>        >> different implementation. Appended an old email for reference.
>>>        >>
>>>        >> Also I agree with Daniel that we need to be careful about the two docs
>>>        >> under docs/. I think he is right we need to add a paragraph explaining
>>>        >> the history and a pointer to the other document. Something like:
>>>        >>
>>>        >> "Dom0less is the name that was used when initially introducing the
>>>        >> feature on ARM. Then, the "dom0less" name was retired in favor of
>>>        >> "hyperlaunch" to avoid confusion (a Dom0 might still be present) and to
>>>        >> align with x86 (where a similar feature was called hyperlaunch from the
>>>        >> start)."
>>>        >
>>>        > Iâ€™m fully ok to add a section like this pointing to the Hyperlaunch design.
>>>
>>>        _If_ this text is added, please include links/references to the Hyperlaunch wiki page and Hyperlaunch design docs.
>>>
>>>        > @Daniel and @Christopher would it be ok for you or the changes in the serie
>>>        > are going to be problematic for your future work? In the end itâ€™s just a mechanical
>>>        > rename, so I guess we just need to agree on naming conventions.
>>>
>>>        Please see the history of trademark litigation about the use of symbolic names to reference similar-but-different artifacts.
>>>        It is much easier to use the same name to refer to entirely different objects. Historically, confusion arises when a name is
>>>        used in similar contexts.
>>>
>>>        There is also versioning.  Could we refer to dom0less as "Hyperlaunch Version -1"?
>>>
>>>        How about renaming dom0less to "Hyperlaunch Lite"?
>>>
>>>
>>> Perhaps it would be helpful if you could explain more clearly your concerns.  I take it that you want a name which can be used specifically
>>> to indicate the full "domB measured boot" functionality that was Daniel and Christopher's original goal, and that you're afraid that using
>>> plain "Hyperlaunch" for only the "start VMs from Xen on boot" functionality will dilute that?
>>>
>>> The "start VMs from Xen on boot" functionality is the *only* thing that a big chunk of the users of this functionality want;  referring to
>>> it as "Hyperlaunch Lite" or "Hyperlaunch -1" will undermine the value of the functionality.
>>>
>>> What if we use "Measured Hyperlaunch", or "Hyperlaunch Measured Boot" to refer to the full measured boot functionality?
>>
>> I think this is the best way.
>>
>>
>>> Or, "Hyperlaunch DT" for "Booting VMs from Xen using Device Tree" (without the involvement of a domB), "Hyperlaunch Boot Domain /
>>> Hyperlaunch domB" for a more general "domB" functionality, and "Hyperlaunch Measured Boot" for the full functionality (assuming there's
>>> more to this than simply having a domB involved)?
>>
>>
>> We need an overarching name to cover the feature "start VMs from Xen on
>> boot" on both ARM and x86. From my understanding and from the original
>> emails on the subject, the name "hyperlaunch" was it.
>>
>> Sure; but think "guitar" vs "acoustic guitar" vs "electric guitar".  "Electric guitar" is new, "guitar" covers them both, but you sometimes need a way to specify "acoustic".  Right now target configurations we're talking about include:
>>
>> 1. Booting all your domains directly from Xen using DT configurations
>> 2. Booting a domB, which then executes some more complicated programmatic configuration to launch VMs before disappearing
>> 3. Doing full measured boot on the whole system using a domB.
>>
>> If "Hyperlaunch" means 1-3, we not only need a way to specify that you're talking about 3, but *also* a way to specify that you're talking about 1.  In the vast majority of cases for the foreseeable future are going to be 1.  Additionally, we want to make sure that "Hyperlaunch" *actually* turns out to mean 1-3, and not just 1.
>>
>> The thing I like about "Hyperlaunch DT" is that to me it sounds pretty cool but also is very descriptive: I haven't talked to people building these systems, but it seems like saying, "The hypervisor launches VMs based on a Device Tree passed to it at boot" will be immediately understood, and stick in people's minds.
> 
> Personally, I like the name â€œHyperlaunch DTâ€, because it tells me that we are launching VMs and the DT is involved, if I understood correctly the design,
> it would be the same also on x86 (and in every architecture that will come later) so being â€œHyperlaunch DTâ€ an arch agnostic name makes it a good
> candidate for phase out dom0less name and for the future when a common code will use the DT to launch VMs at Xen boot.

I assume that DT means Device-Tree here. If so, I find a name a bit 
misleading because we are talking about the way to pass the 
configuration rather than what the feature is doing.

My assumption here is that a DomB solution would still use the 
Device-Tree to describe the domains.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 13:05:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 13:05:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559892.875305 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHOfR-0003Dc-Oc; Thu, 06 Jul 2023 13:05:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559892.875305; Thu, 06 Jul 2023 13:05:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHOfR-0003DV-LQ; Thu, 06 Jul 2023 13:05:05 +0000
Received: by outflank-mailman (input) for mailman id 559892;
 Thu, 06 Jul 2023 13:05:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=NM3K=CY=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qHOfP-0003DK-QR
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 13:05:03 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on20620.outbound.protection.outlook.com
 [2a01:111:f400:fe12::620])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b755970c-1bfd-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 15:05:01 +0200 (CEST)
Received: from DUZPR01CA0265.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4b9::15) by AM0PR08MB5297.eurprd08.prod.outlook.com
 (2603:10a6:208:18a::11) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 13:04:57 +0000
Received: from DBAEUR03FT039.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4b9:cafe::f3) by DUZPR01CA0265.outlook.office365.com
 (2603:10a6:10:4b9::15) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Thu, 6 Jul 2023 13:04:56 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT039.mail.protection.outlook.com (100.127.142.225) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.25 via Frontend Transport; Thu, 6 Jul 2023 13:04:56 +0000
Received: ("Tessian outbound b11b8bb4dfe8:v142");
 Thu, 06 Jul 2023 13:04:56 +0000
Received: from 98b2a3619080.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 1DFEC923-1132-4DDC-9E31-A147C79C331F.1; 
 Thu, 06 Jul 2023 13:04:44 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 98b2a3619080.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 06 Jul 2023 13:04:44 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by AS8PR08MB6245.eurprd08.prod.outlook.com (2603:10a6:20b:293::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 13:04:41 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::3861:64c:eb82:afa1]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::3861:64c:eb82:afa1%4]) with mapi id 15.20.6565.016; Thu, 6 Jul 2023
 13:04:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b755970c-1bfd-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=kNmXZzv9rE6xoyvZGJQ2zheUllSb6Z5PLPixAz+g5f0=;
 b=7179aILZ2LLwtf3fz0fB2N1M50M2KSPspkYy5h4piqJkBd1+LR7fv5qLdcYaXzu/shnTgn+KwEP4fCjmajctZfpyyxaYttGwEEnmxCArOGQV9dgvZSf5vtuC0DYuaNbr2ou2bSmJ3i6l00+iKyuD2iglFDBqjJu4gcYHzG4CzKA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 731cf3a407cd7a37
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=VJ5GdfYIiEwcLBPozqyAv3UfpwB2tnIJbGHaad8cql+V2XU3ZHaJQaq8e+2qrwUiCLdNPyaBCdv7JagMspfV1g/Ey3JhCacA+ex58TKDp8GpGzlkrLIDndIHZoxmuDcM7vr2lH6xwJCp/inXiWe7VDzT3G29EfEd9fSEboOTiRmg16HBQk++CR72OuPZHUpVjgMSfiOaxVhF1H0WrkWMRSx3rc4Rta/KWQ6LcxxMnebgVfkj3fVcsz78S7eDeq804c2zxhPbYRr+t/ffjkuPPWubB4ggYl5/M7yXO8tujHwWJihbYAXBiJ9+D6/XnbBXJRCWoaFVQhjZhFlyaLvcMA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=kNmXZzv9rE6xoyvZGJQ2zheUllSb6Z5PLPixAz+g5f0=;
 b=GnO7JfPJ7MwU8P3bSnom8Jcf9E7GNaCekH0Hj5GMTHdOxT3+2hO6rdlnmnKktyfdHWo/4tIy89Gt7duRpSZGV4ffPhMDaOnE4QN94nMi0EAHuJbRUtK5Gwq7gi5TCnpSaXTXGauqBXB7xtyojPMJ4auhNvoQ+lm37XZDkkmlpCnBk66btzvbKD+wX6fL07Ciz8KMA2aRvTUe0uSC1VDBFKT8QtIqhazs//CMi61rDQ6noxU4ZSD6l+jrJ1k88UVnSHnLUPqhlElnjbqnY2O7QXnPjKAIqbknX3fv3ei09MLcyuRyiQEiv2cYhr1eG0a+5rIzaqM8FYLkN+wCTFIjCg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=kNmXZzv9rE6xoyvZGJQ2zheUllSb6Z5PLPixAz+g5f0=;
 b=7179aILZ2LLwtf3fz0fB2N1M50M2KSPspkYy5h4piqJkBd1+LR7fv5qLdcYaXzu/shnTgn+KwEP4fCjmajctZfpyyxaYttGwEEnmxCArOGQV9dgvZSf5vtuC0DYuaNbr2ou2bSmJ3i6l00+iKyuD2iglFDBqjJu4gcYHzG4CzKA=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Julien Grall <julien@xen.org>
CC: George Dunlap <george.dunlap@cloud.com>, Stefano Stabellini
	<stefano.stabellini@amd.com>, P S <pairspace@gmail.com>, Stefano Stabellini
	<sstabellini@kernel.org>, "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	Christopher Clark <christopher.w.clark@gmail.com>, Andrew Cooper
	<Andrew.Cooper3@citrix.com>, Xen-devel <xen-devel@lists.xenproject.org>, Wei
 Chen <Wei.Chen@arm.com>, George Dunlap <george.dunlap@citrix.com>, Jan
 Beulich <jbeulich@suse.com>, Wei Liu <wl@xen.org>, Henry Wang
	<Henry.Wang@arm.com>, Community Manager <community.manager@xenproject.org>,
	Doug Goldstein <cardoe@cardoe.com>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
Thread-Topic: [RFC PATCH] xen/arm: Rebranding dom0less feature
Thread-Index:
 AQHZqzMUKP6yBnvUfEC1egkdxmuozK+ki8cAgAB66ACAAukxgIAAZuEAgAAgQQCAABPDAIACuauAgACBNoCAAMWkAIAAKcoAgAAD6oCAAAVoAA==
Date: Thu, 6 Jul 2023 13:04:41 +0000
Message-ID: <4717B214-33FF-4B8B-B213-E6C0767D69C6@arm.com>
References: <8601CDD7-87F7-4FD0-A6E6-BAEAB12E7956@arm.com>
 <234199F8-DBB1-42B6-9A4C-8800EEF60997@gmail.com>
 <CA+zSX=Y3_g_aq4+sDK7CuZajywVqQ4xOrq7hKZ80eUT3uSxzuQ@mail.gmail.com>
 <alpine.DEB.2.22.394.2307051436120.761183@ubuntu-linux-20-04-desktop>
 <CA+zSX=ashTi590+cVss_3zyLESC8S=zVSMLjTKD00s6xfjZbJA@mail.gmail.com>
 <A89C2FC7-999E-4FCE-8A05-4F4B86573DBA@arm.com>
 <4aec2aca-e2e6-d9e4-1f73-b5f98245033a@xen.org>
In-Reply-To: <4aec2aca-e2e6-d9e4-1f73-b5f98245033a@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|AS8PR08MB6245:EE_|DBAEUR03FT039:EE_|AM0PR08MB5297:EE_
X-MS-Office365-Filtering-Correlation-Id: ce70e8a3-d5b9-4f3a-6abe-08db7e2198c1
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 Oyfac2SaPks3Z7XJl4lYym3jtSW+jM0cRMI0RMcwcc7mATKPqjQT5ipO1oFUhfaxqWDN+tYGWASucrn2IwZdoA7fi288/pcsyL3Er4/hJ6TYZEfxBGEJGsfQ+kg5rh4aG3AwWtWCl38gnuHKtTA0rf+e2KXqYpn4RQ3C6wrDszCBRaaySm4KK+TiMOthjt5RU7+dbMMjVw+KXIAaxUlSavVmoC6WlDLOcqPsLZIby8EZkCL9/9LroWtkrsrhYy6tQP4HUKOjOjr8UZxf+0OeVXuEIwHF6Xk1SNYZpAd7BMX1pMweQs6/TFwb8zgF+Zp8UCyG3BFDOctQxA4IDdR9eGT1Zckyr4pm7KnWZc/WmId9e6dPXmVfhHZ/jVoIxbCcE7wyQ/m9kK2xQvTbfKqOdYSKJcFD+P0wk4mK7J6ND1MJaC0ObsGQ7ueUc1BTPqUCVhAASvkj99BNA0JwYM+mcdcqNHij0F7mmTGp5u2a57mOuS/y+QT/Ki0cJweVzoTZLMqeULdDlJ/30Y7gHD9/xowyrqxUNAAUqurx6j6DYmeylox5+lYLzUxvDjUUCEYFAIsTp90NIxBAjkLwiH4JY2ySmcdGYyp4ZErThNmT8aPsQWyl+BJ1dEOqgT7poesQQAbOY6HLr7bgGI/UJ6sZKJaXrXzYnng9jVouL7aNt5M=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(366004)(136003)(376002)(346002)(396003)(451199021)(41300700001)(66556008)(64756008)(478600001)(6512007)(38070700005)(54906003)(86362001)(38100700002)(122000001)(71200400001)(6486002)(66946007)(316002)(4326008)(66476007)(76116006)(83380400001)(6916009)(36756003)(91956017)(33656002)(8936002)(2906002)(2616005)(5660300002)(66446008)(8676002)(186003)(7416002)(6506007)(26005)(32563001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <233756765D36714CAE12938E937082FE@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6245
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT039.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	9e8308a1-6125-4948-5835-08db7e218fc7
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	5uUTeDr/x7RbI41zq0+zhOo9tCCkNtRUgzUhCGQbqWmIdnOZv83jYBh1OhcFMjZ2Dnr8nDF98VH6h2Ue1Mrc2mEZq+HG075r5Id8C1GP+g4uWA1ecTvvKs33avrIJ+owN5RoVBIqIuxU0iysImeZiKcF7Lud6W5wYwFVmQBn9S6G+Qxw/YKi270fURz1FwR7ISkrRdfsLoc960i/nMDhK2gpu1YviqYzYX3I/LkZCRbsChWlskD8RYYUqpOjvVThH/2kJAOG4ze8DQSODe2PBWeDCBO8FZMtzYp7A5sF0OJCk+pVGb/H196uT1SHUJw5rVhbyjff0ATal1VWaXV6F5lgeDJoTZ67qqbfVOlAmUonRaHDDpsDG1QiAdM888abJp08XPWhhx9xuneTD0e9f/KmW8wrcPIxgGf+ZohFEZykYf8kusLZTy0HBWyuKqPE1x1A/6mODq/OzTF++/gCbjAD/sKmaw9HUypFVNP5mzlzk/s/06IoorYe2sXod1pB9JPCfWsj87RAYiRGa5QNS+QShHEadC17F4PxPDkdl3XiMWUjHzVejua7HHSv2fueFKzsVGwJZU1yK8wLkndX0dI8LQ7BCsPRuA0wbvBErQkPzMQ2Hf8/D3dYCBG4+wjpt4mbv9BHpouiPbyXPoOApME24C2OJvvFvClewjULS2PVCunlAmdBRreso1NN9vtPVsjIdHP3CQXY4hJlW5j/EZ52nkpd/DgDPGqZEneCh1RK7ReAgGpQCj0qhyEV/q17ijDmtbQx7SNl4HElVJwiSw==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(39860400002)(376002)(346002)(451199021)(36840700001)(46966006)(40470700004)(4326008)(70206006)(70586007)(356005)(81166007)(2616005)(40480700001)(186003)(86362001)(36756003)(33656002)(6486002)(6512007)(478600001)(6506007)(107886003)(54906003)(26005)(82310400005)(40460700003)(36860700001)(6862004)(8936002)(8676002)(316002)(82740400003)(2906002)(336012)(83380400001)(5660300002)(47076005)(41300700001)(32563001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 13:04:56.4890
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ce70e8a3-d5b9-4f3a-6abe-08db7e2198c1
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT039.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5297

DQo+Pj4+IA0KPj4+PiBUaGUgInN0YXJ0IFZNcyBmcm9tIFhlbiBvbiBib290IiBmdW5jdGlvbmFs
aXR5IGlzIHRoZSAqb25seSogdGhpbmcgdGhhdCBhIGJpZyBjaHVuayBvZiB0aGUgdXNlcnMgb2Yg
dGhpcyBmdW5jdGlvbmFsaXR5IHdhbnQ7ICByZWZlcnJpbmcgdG8NCj4+Pj4gaXQgYXMgIkh5cGVy
bGF1bmNoIExpdGUiIG9yICJIeXBlcmxhdW5jaCAtMSIgd2lsbCB1bmRlcm1pbmUgdGhlIHZhbHVl
IG9mIHRoZSBmdW5jdGlvbmFsaXR5Lg0KPj4+PiANCj4+Pj4gV2hhdCBpZiB3ZSB1c2UgIk1lYXN1
cmVkIEh5cGVybGF1bmNoIiwgb3IgIkh5cGVybGF1bmNoIE1lYXN1cmVkIEJvb3QiIHRvIHJlZmVy
IHRv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2x2ZWQpPw0KDQoNCkF0IGxl
YXN0IGluIG15IHBlcnNvbmFsIG9waW5pb24sIHdlIGhhdmUgcGVvcGxlIHRoYXQgd29ya2VkIGEg
bG90IG1vcmUgdGhhbiBtZSBvbiB0aGlzIHByb2plY3Qgc28gdGhleSBjYW4ga25vdyBiZXR0ZXIu
DQoNCg0KPiANCj4gQ2hlZXJzLA0KPiANCj4gLS0gDQo+IEp1bGllbiBHcmFsbA0KDQo=


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 14:23:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 14:23:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559898.875315 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHPtG-00032U-Ad; Thu, 06 Jul 2023 14:23:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559898.875315; Thu, 06 Jul 2023 14:23:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHPtG-00032N-7d; Thu, 06 Jul 2023 14:23:26 +0000
Received: by outflank-mailman (input) for mailman id 559898;
 Thu, 06 Jul 2023 14:23:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=q9yd=CY=microsoft.com=mikelley@srs-se1.protection.inumbo.net>)
 id 1qHPtE-00032H-Ot
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 14:23:24 +0000
Received: from BN6PR00CU002.outbound.protection.outlook.com
 (mail-eastus2azon11021014.outbound.protection.outlook.com [52.101.57.14])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a8f9ae17-1c08-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 16:23:22 +0200 (CEST)
Received: from BYAPR21MB1688.namprd21.prod.outlook.com (2603:10b6:a02:bf::26)
 by CY5PR21MB3493.namprd21.prod.outlook.com (2603:10b6:930:e::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.19; Thu, 6 Jul
 2023 14:22:50 +0000
Received: from BYAPR21MB1688.namprd21.prod.outlook.com
 ([fe80::733d:6263:4482:ba25]) by BYAPR21MB1688.namprd21.prod.outlook.com
 ([fe80::733d:6263:4482:ba25%4]) with mapi id 15.20.6588.010; Thu, 6 Jul 2023
 14:22:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a8f9ae17-1c08-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=UwhdvMOTCj1pk6YoWX/0vA8V1MM1yW1X+cgckphBoWw18+TH5Wq4fo6sy5T77KA9dxG2QmsFTIED0utRdGSKbFhjMifbh0Yx5wjIefStAvpwxYREUbfvGnyNJp74WgBoV6/zkzgu1ro93YJgZmAqlvDxcv19Yf0ne/v32iCEfyibMuTwXufpKaiV/jiLLwOxN6tiBgOpj2T1iIVTb3yQ6dQ10HKf/K40XhmE4fLUWzyBE9ipz1Q320hp35gTgZ1ChNcQEwbMJY3ERm6nSf+UmZN+ifGu+PzwaTnIZ9jGa/nCal+N25zkuQTZYRzV9dkKMvcBNMMTgKbW9FMKvxbJdQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=wG+YaDqOerIORGaH0fUqy7utjqv7UUuWUSk817E/mzg=;
 b=ndEu3JVKgKXySe5MQlXcBi/fbhKlL2O0ptdcmhzZZxiudcIPTbIuVNkdkB7HkH16H+jm5k6aAN4AnE+XU/Bvf+Gbx1R3+7dta0Lcn6aYfG+gC0CCAU0mfxQfTbhB7RQZI28QC+FK6HoyeJmazK9axvEgoJf1S8XHAN5MIikeRHp7Ubrli0RYpTiUsZolPvoEta0+yaUEHgModwpkI6gDAPusar30t15FZF7HmHAh+AOZc0VXj0LuXz8lKc2c9SPM4H5QN6pffvIkThZvUj7YwHPFN99E7t/QoUkv1YcH+JkRqtxD+dBLRm8stD2aC8qqWCyamxXnaxRzoidhuSwbHw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=microsoft.com; dmarc=pass action=none
 header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=wG+YaDqOerIORGaH0fUqy7utjqv7UUuWUSk817E/mzg=;
 b=BX5CjAB/nwUpSZIB8jmjak4/kZaXQUY83pGmmBzgho/V+8jgYNNr3ujodWzkus5oPCYtGCbxA/qEh6fTt8pO/YEE2JphEFOWikQdRVCbke2dzDhP87v/7JdeiUCoOKtPp1bBq2vejmj/TjBffepZ2mCOmgtFmAzX+kKEmbktEJc=
From: "Michael Kelley (LINUX)" <mikelley@microsoft.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CC: Petr Tesarik <petrtesarik@huaweicloud.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>, "H. Peter
 Anvin" <hpa@zytor.com>, "Rafael J. Wysocki" <rafael@kernel.org>, Juergen
 Gross <jgross@suse.com>, Oleksandr Tyshchenko
	<oleksandr_tyshchenko@epam.com>, Christoph Hellwig <hch@lst.de>, Marek
 Szyprowski <m.szyprowski@samsung.com>, Robin Murphy <robin.murphy@arm.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Hans de Goede
	<hdegoede@redhat.com>, Jason Gunthorpe <jgg@ziepe.ca>, Kees Cook
	<keescook@chromium.org>, Saravana Kannan <saravanak@google.com>, "moderated
 list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>, "moderated
 list:ARM PORT" <linux-arm-kernel@lists.infradead.org>, open list
	<linux-kernel@vger.kernel.org>, "open list:MIPS"
	<linux-mips@vger.kernel.org>, "open list:XEN SWIOTLB SUBSYSTEM"
	<iommu@lists.linux.dev>, Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>, "petr@tesarici.cz"
	<petr@tesarici.cz>
Subject: RE: [PATCH v3 4/7] swiotlb: if swiotlb is full, fall back to a
 transient memory pool
Thread-Topic: [PATCH v3 4/7] swiotlb: if swiotlb is full, fall back to a
 transient memory pool
Thread-Index: AQHZqN4Es6xs27E7q0W1vSuhepPC1q+p0aJAgAKeXgCAAGWX4A==
Date: Thu, 6 Jul 2023 14:22:50 +0000
Message-ID:
 <BYAPR21MB168802F691D3041C9B2F9F2DD72CA@BYAPR21MB1688.namprd21.prod.outlook.com>
References: <cover.1687859323.git.petr.tesarik.ext@huawei.com>
 <34c2a1ba721a7bc496128aac5e20724e4077f1ab.1687859323.git.petr.tesarik.ext@huawei.com>
 <BYAPR21MB1688AAC65852E75764F53099D72CA@BYAPR21MB1688.namprd21.prod.outlook.com>
 <2023070626-boxcar-bubbly-471d@gregkh>
In-Reply-To: <2023070626-boxcar-bubbly-471d@gregkh>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
 MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=a8aa5c53-11c1-447d-8308-ef08c97544cc;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2023-07-06T14:10:48Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=microsoft.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BYAPR21MB1688:EE_|CY5PR21MB3493:EE_
x-ms-office365-filtering-correlation-id: 2aad2f2f-3f4a-4a93-0f5d-08db7e2c7a80
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info:
 ffQ8B6GEk16LjgRECqfLARZg2milg373MaXIenId9pbAhydXyqiowRyCuEtSjHvmWz8CslFOoJOdwPPy6TAHIIyoXSAdLEomrjgAA8N1FiJueN6DY+grG3dT4d+N6jYopUIMOEnqe1Iqrh+pF1ji/035vpeLn9UvQe2il3FQvFwP7gPN7A5GakVYyuAKeMkMs5/jGPvmtFRwCQ5r1vzcGlPjd4nL4JoFRjAhzYUm6AC1W5qE+DpwnOsv8vVD07zz0lYyD2yp/DWTSln2UdCoeQGyrlJWngx8eVQ0Qg89zrySEAGmP4CA1IDithsRcKWmZoe+vWp4i0STxWHIy0pcY9qFwUk+huKeBqdpZN6cj9GcTq+XcAlXwZmy5+s6GFj+TCjF7u3nBTMODt+MreNwwWsO6PE5nAilJxZHxTQnXxzy+G8kge8ZxoCz1zXFP3xOqOcc/ViOW/ooSfdK/78KKppj9nd5yLlYz98XzGumO7NmxPwDxQlWY2HO+8SGpMCTHwHebc7G8V/ksw01ZVdPIbOkFyrdPQY1nR0Mru60esT9d6QTRD9DuGgJw0O2bZimJ89U9rbRuBsYDiREBKpYmQo0cxQAjHT4uKUvU9tqus1Ez/Iji8xty6CyQyatRxYFsWJjrPCn26lFYu0iVXdbUpRUtMWhAYUhalaioeZ131Y=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR21MB1688.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(376002)(396003)(136003)(346002)(451199021)(71200400001)(54906003)(7696005)(122000001)(478600001)(10290500003)(66556008)(38070700005)(83380400001)(33656002)(55016003)(86362001)(2906002)(26005)(6506007)(76116006)(8990500004)(9686003)(186003)(38100700002)(8676002)(82950400001)(66946007)(316002)(64756008)(66476007)(66446008)(8936002)(4326008)(7416002)(82960400001)(41300700001)(52536014)(5660300002)(6916009);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?8C/RmAxRX6jrwILrS+C+xpuXVOlUz8jEfM3RdZheqKoyckjlfp/wxCeq1jOL?=
 =?us-ascii?Q?FNrXHxZNtCjj+NJagqMj26M0rSjNKLVsCyltm/Jv/S1qPrAUgGE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us-ascii?Q?Tuwg1niNEo3cBrOeYFq+SoZ6kX0O1dxJ3GR5xUc+JPEblRPO8HyBHhQyT9Qx?=
 =?us-ascii?Q?ohCq1i5HAKieEJyip+Kj6aiIFz3XuGleFYeXHS012B2NguRM3G6Wa1hodhNx?=
 =?us-ascii?Q?keYoBqoK1DpyG6WtL3V9nW8WIhTvvzxvfxWjggIAxxkYWnwo6eW1R+Ukj2a9?=
 =?us-ascii?Q?yiqMH20LgWjvWyhYSfVlYdWM/V8hcdXEBwGArvi6as0+zEcgs1+XNxZO4wnx?=
 =?us-ascii?Q?mII7SKLN6oiEX4pKspIfTxYi5Q2PFkW4OVTJR7v4N1muFKMkRvbWMlgZIpn+?=
 =?us-ascii?Q?X7UN7YkPeAvP2KPaDkph3HqQbcQXiS/LDYjoar/Q99xpKxE7N0Mk0A4WTJ3f?=
 =?us-ascii?Q?rWycxmCWILHlOMsm6KmzrNEsIXAdR1Upi2vYSMQBwjWG9OYgEC0f/y1Dip+z?=
 =?us-ascii?Q?averv8YToXbJ7Jf4O9gR5GoYDSiWCtdgwXxoN3qWIS5JEsF8G7FU4fRlwTCC?=
 =?us-ascii?Q?b8MM8oNO1v/eTC0O+4MUROzlHonkc0uEmtKwrcFL3lsCFC1/kGhakhezEGM4?=
 =?us-ascii?Q?LUzVWweOmKMFsC+iA9384d7SNCzPhmvjNnjktdQEZ6CrKf8lUverIaxTxSNq?=
 =?us-ascii?Q?d9S3cFLVzVdOoM2cnKcWI1/pT47njF1ZZEMprTYyGYN/Lp0V3OFObKDZEjaP?=
 =?us-ascii?Q?pA=3D=3D?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BYAPR21MB1688.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2aad2f2f-3f4a-4a93-0f5d-08db7e2c7a80
X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jul 2023 14:22:50.1701
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: DqFDnJYrC3LQC9s/7hcOB4tP41bB/DlWxzkQUJ0CSsmiPR3HPjjgb5lGqUiN4d+9ahRtC3W7Vc5xrCP1s7UEelf8bvq0Nc35AfvfI/KqtAE=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR21MB3493

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Sent: Thursday, July =
6, 2023 1:07 AM
>=20
> On Thu, Jul 06, 2023 at 03:50:55AM +0000, Michael Kelley (LINUX) wrote:
> > From: Petr Tesarik <petrtesarik@huaweicloud.com> Sent: Tuesday, June 27=
, 2023
> 2:54 AM
> > >
> > > Try to allocate a transient memory pool if no suitable slots can be f=
ound,
> > > except when allocating from a restricted pool. The transient pool is =
just
> > > enough big for this one bounce buffer. It is inserted into a per-devi=
ce
> > > list of transient memory pools, and it is freed again when the bounce
> > > buffer is unmapped.
> > >
> > > Transient memory pools are kept in an RCU list. A memory barrier is
> > > required after adding a new entry, because any address within a trans=
ient
> > > buffer must be immediately recognized as belonging to the SWIOTLB, ev=
en if
> > > it is passed to another CPU.
> > >
> > > Deletion does not require any synchronization beyond RCU ordering
> > > guarantees. After a buffer is unmapped, its physical addresses may no
> > > longer be passed to the DMA API, so the memory range of the correspon=
ding
> > > stale entry in the RCU list never matches. If the memory range gets
> > > allocated again, then it happens only after a RCU quiescent state.
> > >
> > > Since bounce buffers can now be allocated from different pools, add a
> > > parameter to swiotlb_alloc_pool() to let the caller know which memory=
 pool
> > > is used. Add swiotlb_find_pool() to find the memory pool correspondin=
g to
> > > an address. This function is now also used by is_swiotlb_buffer(), be=
cause
> > > a simple boundary check is no longer sufficient.
> > >
> > > The logic in swiotlb_alloc_tlb() is taken from __dma_direct_alloc_pag=
es(),
> > > simplified and enhanced to use coherent memory pools if needed.
> > >
> > > Note that this is not the most efficient way to provide a bounce buff=
er,
> > > but when a DMA buffer can't be mapped, something may (and will) actua=
lly
> > > break. At that point it is better to make an allocation, even if it m=
ay be
> > > an expensive operation.
> >
> > I continue to think about swiotlb memory management from the standpoint
> > of CoCo VMs that may be quite large with high network and storage loads=
.
> > These VMs are often running mission-critical workloads that can't toler=
ate
> > a bounce buffer allocation failure.  To prevent such failures, the swio=
tlb
> > memory size must be overly large, which wastes memory.
>=20
> If "mission critical workloads" are in a vm that allowes overcommit and
> no control over other vms in that same system, then you have worse
> problems, sorry.
>=20
> Just don't do that.
>=20

No, the cases I'm concerned about don't involve memory overcommit.

CoCo VMs must use swiotlb bounce buffers to do DMA I/O.  Current swiotlb
code in the Linux guest allocates a configurable, but fixed, amount of gues=
t
memory at boot time for this purpose.  But it's hard to know how much
swiotlb bounce buffer memory will be needed to handle peak I/O loads.
This patch set does dynamic allocation of swiotlb bounce buffer memory,
which can help avoid needing to configure an overly large fixed size at boo=
t.

Michael


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 14:56:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 14:56:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559903.875325 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHQOe-0006Ug-PF; Thu, 06 Jul 2023 14:55:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559903.875325; Thu, 06 Jul 2023 14:55:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHQOe-0006UZ-MI; Thu, 06 Jul 2023 14:55:52 +0000
Received: by outflank-mailman (input) for mailman id 559903;
 Thu, 06 Jul 2023 14:55:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=73gZ=CY=bombadil.srs.infradead.org=BATV+3c95f280863011604c0c+7256+infradead.org+hch@srs-se1.protection.inumbo.net>)
 id 1qHQOc-0006US-H4
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 14:55:51 +0000
Received: from bombadil.infradead.org (bombadil.infradead.org
 [2607:7c80:54:3::133])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 307529e7-1c0d-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 16:55:48 +0200 (CEST)
Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat
 Linux)) id 1qHQNf-001vuf-2T; Thu, 06 Jul 2023 14:54:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 307529e7-1c0d-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version
	:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=fhykVYOZkzlXT4yh75rGeCVJ3cPkDr5sjhaxZXHjD+c=; b=zbagyQChudyQPE2bMPZfTnWPir
	xEx+mIn+jmhXiSkClrK6vyYVxVucLdM5bush+XAhi1L8+RYYMWbrfI/PXNLKjNrWkvX1JuFMBGnvz
	hobfOtgzfc30tNgXDTW5f735BiGierSS2sw4A5BsLsjO+NIDmCJaoqnJvjB6GpO63lTBhPw1Ktdzv
	09/JTSE1nHQ4VXLt2IEwE6yDDWWPLCfOggEtJrOTiDfYzQXVq9m9NhYrAKw8aQvc7GPBw2+8hQS8A
	80c0RawRFeosEEQrvmZs9gRIzWZlEHNQkGLdtR04aftBqsNeChaMLjpw0CwixmzDs5mdRTNLsZohR
	2STEGtcw==;
Date: Thu, 6 Jul 2023 07:54:51 -0700
From: Christoph Hellwig <hch@infradead.org>
To: Jan Kara <jack@suse.cz>
Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@infradead.org>,
	Alasdair Kergon <agk@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anna Schumaker <anna@kernel.org>, Chao Yu <chao@kernel.org>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Dave Kleikamp <shaggy@kernel.org>, David Sterba <dsterba@suse.com>,
	dm-devel@redhat.com, drbd-dev@lists.linbit.com,
	Gao Xiang <xiang@kernel.org>, Jack Wang <jinpu.wang@ionos.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	Joern Engel <joern@lazybastard.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	linux-bcache@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org,
	linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org,
	linux-nilfs@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-pm@vger.kernel.org, linux-raid@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	"Md. Haris Iqbal" <haris.iqbal@ionos.com>,
	Mike Snitzer <snitzer@kernel.org>, Minchan Kim <minchan@kernel.org>,
	ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Song Liu <song@kernel.org>, Sven Schnelle <svens@linux.ibm.com>,
	target-devel@vger.kernel.org, Ted Tso <tytso@mit.edu>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH RFC 0/32] block: Make blkdev_get_by_*() return handle
Message-ID: <ZKbVuyn0jELh8UDM@infradead.org>
References: <20230629165206.383-1-jack@suse.cz>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20230629165206.383-1-jack@suse.cz>
X-SRS-Rewrite: SMTP reverse-path rewritten from <hch@infradead.org> by bombadil.infradead.org. See http://www.infradead.org/rpr.html

On Tue, Jul 04, 2023 at 02:21:27PM +0200, Jan Kara wrote:
> Hello,
> 
> this patch series implements the idea of blkdev_get_by_*() calls returning
> bdev_handle which is then passed to blkdev_put() [1]. This makes the get
> and put calls for bdevs more obviously matching and allows us to propagate
> context from get to put without having to modify all the users (again!).
> In particular I need to propagate used open flags to blkdev_put() to be able
> count writeable opens and add support for blocking writes to mounted block
> devices. I'll send that series separately.
> 
> The series is based on Linus' tree as of yesterday + two bcache fixes which are
> in the block tree. Patches have passed some basic testing, I plan to test more
> users once we agree this is the right way to go.

Can you post a link to a git branch for this and the follow up series?
Especially with a fairly unstable base it's kinda hard to look at the
result otherwise.


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 15:35:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 15:35:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559908.875335 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHR0o-0002Rd-OS; Thu, 06 Jul 2023 15:35:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559908.875335; Thu, 06 Jul 2023 15:35:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHR0o-0002RW-L8; Thu, 06 Jul 2023 15:35:18 +0000
Received: by outflank-mailman (input) for mailman id 559908;
 Thu, 06 Jul 2023 15:35:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=t3sh=CY=rabbit.lu=slack@srs-se1.protection.inumbo.net>)
 id 1qHR0n-0002RN-IX
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 15:35:17 +0000
Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com
 [2a00:1450:4864:20::333])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b4202267-1c12-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 17:35:15 +0200 (CEST)
Received: by mail-wm1-x333.google.com with SMTP id
 5b1f17b1804b1-3fbc77e76abso9317175e9.1
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 08:35:15 -0700 (PDT)
Received: from [192.168.2.1] (82-64-138-184.subs.proxad.net. [82.64.138.184])
 by smtp.googlemail.com with ESMTPSA id
 v20-20020a05600c215400b003fb41491670sm5491806wml.24.2023.07.06.08.35.13
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 06 Jul 2023 08:35:14 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b4202267-1c12-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=rabbit-lu.20221208.gappssmtp.com; s=20221208; t=1688657715; x=1691249715;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=pmURNMQ4g+uKDqBOxCU5QGpeFr3wMwvEX8bNZ1mDVJY=;
        b=VaDdq43FhQMU6byXsfkWDp33XNSPIty3PBCtU1FvG0OzKguSFEQ0i18xlRfvUcdP4M
         LTUlqwfnIeInhazupwXFMGYGqVYL8JQFCSraXPE2eI5z/DMz110zYDu5gDzihoeyyzZd
         o6vOvSipIV/hx6/ByUiLoK5mxvUrUqGi+/9GPUBq/l3ZmziBIvpEUCoc3x4ve9bbAf+o
         4sJsDiDGi6cDvwrgk8JTvaE3sK6ynZR7en7kBhc/3b8JP41rtQgodnxOOPIuSA+vz6FB
         b+6WDG9mImk11YYJgq/zRrz7pvctS+xUtMy1nQaS4yCrXqsGC1cmYRgUpYNWpSSaTzNB
         32pg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688657715; x=1691249715;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=pmURNMQ4g+uKDqBOxCU5QGpeFr3wMwvEX8bNZ1mDVJY=;
        b=RT0dQQGd+DT7eTBtXMlTyJJTMIlfcAQd+CS9KaC3XDC9Gb2vL7NSOfhH5M8mkdfJ7j
         EOaOIaUMuca4UAvnTEYO++8ydF2JV+P6ZXhIsKAu9wxHsz1n3QpZLTVsTilGc1+HhiNF
         Kj/lLq3TtNR0/Jqo8uSN6+ThIM1ocj3t6ugheXc+3Ro7w2L+KQy8iWIYtNJcWmEi5EkE
         KA8qS4EVYi5fSFN3U8yKZPk0u9rdXoTzi2YXFoEPCrZP3rnsICZspK5A3GY6v48mujSF
         KgA6rZ0Qsv1NqZrvl5COHGhXvrIM4KNnknFz6l+OPzu0Mvg2WPhRacACyeIrdGfWJ3q2
         842w==
X-Gm-Message-State: ABy/qLaoNDnNIDYRFOMBEwvCnLkRO5nRXAPxk1Zq8zgAcJIhBu516Uy5
	Gi8TXHUMkQdkYUgzlfYMn0OXv59gfMDfKHP62Rw=
X-Google-Smtp-Source: APBJJlFkYwWhK36VkNZrbFUHE0TKrqUY9g3uWosgBNGZ1lbMr9olYEPwE1akgM+Vn5fAtg9w+Xi95A==
X-Received: by 2002:a05:600c:c8:b0:3fb:b05d:f27c with SMTP id u8-20020a05600c00c800b003fbb05df27cmr1634748wmm.34.1688657714685;
        Thu, 06 Jul 2023 08:35:14 -0700 (PDT)
Message-ID: <20b1a79c-23c1-93bc-2090-8052f143422c@rabbit.lu>
Date: Thu, 6 Jul 2023 17:35:10 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: Detecting whether dom0 is in a VM
Content-Language: en-US
To: xen-devel@lists.xenproject.org
Cc: George Dunlap <george.dunlap@cloud.com>, Jan Beulich <jbeulich@suse.com>
References: <CA+zSX=Y4MwsDSd9oSG1NQyt==YAw9SeRdh=eJxTUhhOx57ihWg@mail.gmail.com>
 <4ee01a0f-063e-ef93-ac24-da387d5b3438@rabbit.lu>
 <a680ae62-7765-aa51-1edd-9a1a7e39e449@suse.com>
From: zithro <slack@rabbit.lu>
In-Reply-To: <a680ae62-7765-aa51-1edd-9a1a7e39e449@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 06 Jul 2023 09:02, Jan Beulich wrote:
> On 05.07.2023 18:20, zithro wrote:
>> So I'm wondering, isn't that path enough for correct detection ?
>> I mean, if "/sys/class/dmi/id/sys_vendor" reports Xen (or KVM, or any
>> other known hypervisor), it's nested, otherwise it's on hardware ?
>>
>> Is that really mandatory to use CPUID leaves ?
> 
> Let me ask the other way around: In user mode code under a non-nested
> vs nested Xen, what would you be able to derive from CPUID? The
> "hypervisor" bit is going to be set in both cases. (All assuming you
> run on new enough hardware+Xen such that CPUID would be intercepted
> even for PV.)

I'm a bit clueless about CPUID stuff, but if I understand correctly, 
you're essentially saying that using CPUID may not be the perfect way ?
Also, I don't get why the cpuid command returns two different values, 
depending on the -k switch :
# cpuid -l 0x40000000
hypervisor_id (0x40000000) = "\0\0\0\0\0\0\0\0\0\0\0\0"
# cpuid -k -l 0x40000000
hypervisor_id (0x40000000) = "XenVMMXenVMM"

> Yet relying on DMI is fragile, too: Along the lines of
> https://lists.xen.org/archives/html/xen-devel/2022-01/msg00604.html
> basically any value in there could be "inherited" from the host (i.e.
> from the layer below, to be precise).

So using "/sys/class/dmi/id/sys_vendor", or simply doing "dmesg | grep 
DMI:" is also not perfect, as values can be inherited/spoofed by 
underneath hypervisor ?

> The only way to be reasonably
> certain is to ask Xen about its view. The raw or host featuresets
> should give you this information, in the "mirror" of said respective
> CPUID leave's "hypervisor" bit. 

As said above, I'm clueless, can you expand please ?

> But of course that still won't tell
> you which _kind_ of hypervisor is the immediate next one underneath
> Xen.
> 
> This then further raises the question of what use it is to know the
> kind of the next level hypervisor, when multiple may be stacked on
> top of one another ...

We need an answer from systemd guys, but the commiter expanded on the 
reasons why the change was made [1] : "the detect_vm_cpuid check was 
returning a VIRTUALIZATION_NONE result on non-nested dom0 (checking the 
log from back then I was getting No virtualization found in CPUID), but 
would report other CPUID-detectable hypervisors when dom0 was nested, so 
we still wanted to check it for this case".

Systemd is using this information to not start some services when 
nested, like SMART/smartmontools (which have 
"ConditionVirtualization=no" in their systemd unit files).
As the check now fails on baremetal dom0s, the service is not starting.

[1] https://github.com/systemd/systemd/issues/28113#issuecomment-1621559642


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 15:39:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 15:39:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559912.875345 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHR4X-00031A-6z; Thu, 06 Jul 2023 15:39:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559912.875345; Thu, 06 Jul 2023 15:39:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHR4X-000313-43; Thu, 06 Jul 2023 15:39:09 +0000
Received: by outflank-mailman (input) for mailman id 559912;
 Thu, 06 Jul 2023 15:39:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=73gZ=CY=bombadil.srs.infradead.org=BATV+3c95f280863011604c0c+7256+infradead.org+hch@srs-se1.protection.inumbo.net>)
 id 1qHR4V-00030x-8X
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 15:39:07 +0000
Received: from bombadil.infradead.org (bombadil.infradead.org
 [2607:7c80:54:3::133])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3d2c2118-1c13-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 17:39:06 +0200 (CEST)
Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat
 Linux)) id 1qHR44-0021w3-0C; Thu, 06 Jul 2023 15:38:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3d2c2118-1c13-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version
	:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=YwAEpZO7Vu5hoax5tz5QpnX5k8pjtsK6yDO/dOzPntw=; b=LJt1aHPpR1VtNNU97F662mFcBQ
	04pv5pjmhELPxcfY8IU2J9oyhfgQvItd1fUo/P+Wom3ADKBICTxeaU2ubravoUlJ9bJKThqcbtmZO
	YHZ6Bq5JNF5Oy1kZk0vGrojv9a9LNU4bL+WXTD5k/gljEqzdXg69aNBObe/lnHCHtRlMc6Ppc7Hqe
	+NefvxaKjDH4eBZ/aYpgK8N4uyEQGVFSG36iqC/zjMjHjPuCdtgFFvp4F+STCUxI3HsTMMx8Jecfh
	X5dQPxytEjbEWkMaTy11b/rkROV7wOirXDfTif06nI996QOXUgedgb0owSphnlvJb3u4X61SBTklq
	DymCsIxA==;
Date: Thu, 6 Jul 2023 08:38:40 -0700
From: Christoph Hellwig <hch@infradead.org>
To: Jan Kara <jack@suse.cz>
Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@infradead.org>,
	Alasdair Kergon <agk@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anna Schumaker <anna@kernel.org>, Chao Yu <chao@kernel.org>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Dave Kleikamp <shaggy@kernel.org>, David Sterba <dsterba@suse.com>,
	dm-devel@redhat.com, drbd-dev@lists.linbit.com,
	Gao Xiang <xiang@kernel.org>, Jack Wang <jinpu.wang@ionos.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	Joern Engel <joern@lazybastard.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	linux-bcache@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org,
	linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org,
	linux-nilfs@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-pm@vger.kernel.org, linux-raid@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	"Md. Haris Iqbal" <haris.iqbal@ionos.com>,
	Mike Snitzer <snitzer@kernel.org>, Minchan Kim <minchan@kernel.org>,
	ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Song Liu <song@kernel.org>, Sven Schnelle <svens@linux.ibm.com>,
	target-devel@vger.kernel.org, Ted Tso <tytso@mit.edu>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions
Message-ID: <ZKbgAG5OoHVyUKOG@infradead.org>
References: <20230629165206.383-1-jack@suse.cz>
 <20230704122224.16257-1-jack@suse.cz>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20230704122224.16257-1-jack@suse.cz>
X-SRS-Rewrite: SMTP reverse-path rewritten from <hch@infradead.org> by bombadil.infradead.org. See http://www.infradead.org/rpr.html

On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote:
> Create struct bdev_handle that contains all parameters that need to be
> passed to blkdev_put() and provide blkdev_get_handle_* functions that
> return this structure instead of plain bdev pointer. This will
> eventually allow us to pass one more argument to blkdev_put() without
> too much hassle.

Can we use the opportunity to come up with better names?  blkdev_get_*
was always a rather horrible naming convention for something that
ends up calling into ->open.

What about:

struct bdev_handle *bdev_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
		const struct blk_holder_ops *hops);
struct bdev_handle *bdev_open_by_path(dev_t dev, blk_mode_t mode,
		void *holder, const struct blk_holder_ops *hops);
void bdev_release(struct bdev_handle *handle);

?


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 15:43:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 15:43:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559919.875354 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHR8k-0004Vu-R9; Thu, 06 Jul 2023 15:43:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559919.875354; Thu, 06 Jul 2023 15:43:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHR8k-0004Vn-Oc; Thu, 06 Jul 2023 15:43:30 +0000
Received: by outflank-mailman (input) for mailman id 559919;
 Thu, 06 Jul 2023 15:43:30 +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
 <SRS0=OuuY=CY=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qHR8k-0004Vh-6w
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 15:43:30 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d815800e-1c13-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 17:43:26 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 731E68285452;
 Thu,  6 Jul 2023 10:43:24 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id IYMxrxYsk_aE; Thu,  6 Jul 2023 10:43:23 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 845E08285514;
 Thu,  6 Jul 2023 10:43:23 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id F-Xbx5_Cs6bE; Thu,  6 Jul 2023 10:43:23 -0500 (CDT)
Received: from [10.11.0.2] (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 1A8928285452;
 Thu,  6 Jul 2023 10:43:23 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d815800e-1c13-11ee-8611-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 845E08285514
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1688658203; bh=Z/xe/+UZWeimo/sm92wEXj+a5NzsiDM7/3QqDelMVdc=;
	h=Message-ID:Date:MIME-Version:From:To;
	b=nhESvTEKiH/wm7PrTilxSFP6TlLzIA7EYkovXojTkPKXVjmqrh2n5EuU2BR8JrciX
	 p18eTIM3Elyb1OPb62I6PPbVdju0piWGogDR9jUcg2k8j2IOMKRTpR+ukz8m+m3mVL
	 BOwO/LtpUL+Kdlgu94wLPHCmlyV6w9hd70DPRHLo=
X-Virus-Scanned: amavisd-new at rptsys.com
Message-ID: <0c0e7324-cb99-31af-34a2-94ba8d581a31@raptorengineering.com>
Date: Thu, 6 Jul 2023 10:43:22 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 1/3] xen/ppc: Set up a basic C environment
Content-Language: en-US
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>
References: <cover.1687466822.git.sanastasio@raptorengineering.com>
 <1afe27097c5e1b55dcffa9464dc0cd0c1038a23e.1687466822.git.sanastasio@raptorengineering.com>
 <bfaba0e5-36e9-b201-30fd-b96add91cb1c@citrix.com>
 <5011cde3-b553-6a17-85aa-a30edf3102fd@raptorengineering.com>
In-Reply-To: <5011cde3-b553-6a17-85aa-a30edf3102fd@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 6/22/23 8:26 PM, Shawn Anastasio wrote:
> On 6/22/23 5:49 PM, Andrew Cooper wrote:
>> On 22/06/2023 9:57 pm, Shawn Anastasio wrote:
>>> Update ppc64/head.S to set up an initial boot stack, zero the .bss
>>> section, and jump to C.
>>>
>>> Also refactor the endian fixup trampoline into its own macro, since it
>>> will need to be used in multiple places, including every time we make a
>>> call into firmware (see next commit).
>>>
>>> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
>>
>> Thankyou for making this change - it definitely simplifies things.
> 
> No problem.
> 
>> I've done a bit of reading around, and it's rather sad that things prior
>> to Power10 don't have PC-relative addressing.  So the LOAD_IMM64()'s do
>> look necessary for the stack and bss.  I guess that means we can't be
>> sensibly be position independent in head.S?
> 
> Prior to the introduction of pcrel loads/stores in P10, PIC is achieved
> using a Table of Contents (TOC) whose base address is kept in r2 and can
> be used as a relative base to address other symbols. I don't have -fPIC
> enabled in this series yet (it's in the series I was hoping to submit
> after this one), so for now I'm just loading the addresses as immediates
> directly.
> 
>> Also, why store 0 onto the stack ?
> 
> On the ELFv2 ABI which we're using here, sp+0 is reserved for the "back
> chain" pointer which is used to store the address of the caller's stack
> frame and is used to support backtraces.
> 
> At the top of the stack, we need to make sure the first back chain
> pointer is zero to ensure that anything walking the stack via these
> pointers eventually terminates.
> 
>>> +
>>> +    /* clear .bss */
>>> +    LOAD_IMM64(%r14, __bss_start)
>>> +    LOAD_IMM64(%r15, __bss_end)
>>> +1:
>>> +    std %r11, 0(%r14)
>>> +    addi %r14, %r14, 8
>>> +    cmpld %r14, %r15
>>> +    blt 1b
>>
>> This loop is correct, except for the corner case of this patch alone,
>> where the BSS is empty and this will write one word out-of-bounds.
>>
>> For RISC-V, we put a temporary "char bss_tmp;" in setup.c, and I suggest
>> you do the same here, deleting it at a later point when there's real
>> data in the bss.
> 
> Good catch. I actually introduce a .bss variable in patch 2 of this
> series, so perhaps it would make the most sense for me to move this loop
> to that patch?
> 
> Also it might make sense to have an assert in the linker script checking
> that sizeof(.bss) > 0, though past early bring-up an empty .bss is
> probably a pretty unlikely scenario...
> 
>>> +
>>> +    /* call the C entrypoint */
>>> +    LOAD_IMM64(%r12, start_xen)
>>> +    mtctr %r12
>>> +    bctrl
>>
>> Why is this a LOAD_IMM64(), and not just:
>>
>>     b start_xen
>>
>> ?  From the same reading around, PPC64 seems to have +/- 32M addressing
>> for branches, and the entire x86 hypervisor (.init included) is within 3M.
> 
> Good question. You're right that here it's entirely unnecessary. Once we
> enable -fPIC, though, the calling convention for functions changes a bit
> and necessitates that in certain scenarios r12 contains the entrypoint
> of the function being called.

Turns out I was actually wrong here -- changing the indirect load +
branch to a direct branch does actually break the code here, but for a
reason other than what I anticipated. Even with PIC disabled, r2 needs
to contain a valid TOC pointer. The function address doesn't need to be
contained in r12 to calculate it since it's an absolute address rather
than function-relative, but using a simple direct branch here causes the
linker to skip past the TOC calculation prologue in `start_xen` as an
optimization, since it assumes that r2 is already set up. Since we
haven't set up r2, though, this results in the program using a
garbage TOC pointer at run-time.

I'll just set up the TOC before making the call in `start` to fix this.

Thanks,
Shawn



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 15:47:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 15:47:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559923.875365 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHRC4-00058L-AD; Thu, 06 Jul 2023 15:46:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559923.875365; Thu, 06 Jul 2023 15:46:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHRC4-00058E-7Z; Thu, 06 Jul 2023 15:46:56 +0000
Received: by outflank-mailman (input) for mailman id 559923;
 Thu, 06 Jul 2023 15:46:55 +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
 <SRS0=/0J5=CY=bounce.vates.fr=bounce-md_30504962.64a6e1ea.v1-0e73e11d67d545b69f274766bbb5033d@srs-se1.protection.inumbo.net>)
 id 1qHRC2-000588-U5
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 15:46:55 +0000
Received: from mail145-16.atl61.mandrillapp.com
 (mail145-16.atl61.mandrillapp.com [198.2.145.16])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5351ce93-1c14-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 17:46:52 +0200 (CEST)
Received: from pmta06.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail145-16.atl61.mandrillapp.com (Mailchimp) with ESMTP id
 4QxgrC14Xpz8XRsZZ
 for <xen-devel@lists.xenproject.org>; Thu,  6 Jul 2023 15:46:51 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 0e73e11d67d545b69f274766bbb5033d; Thu, 06 Jul 2023 15:46:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5351ce93-1c14-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.fr;
	s=mandrill; t=1688658411; x=1688918911; i=yann.dirson@vates.fr;
	bh=7iebBR2+WFMMCXpGZS2CNAoG6BhDktl65DqP2Xa1wrE=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=BxnmuFNjQqFrZn9kIYwzwozBZ0wpVXHoNGgu+GnwH2qtdE60cX1bjpkMukE619nC5
	 CGs0Y/dZguS7OY6QpRko7cmi5HVBzbXkUZvRRBnaVbaqxc1LIEq6mtM3C95rIn/C7z
	 DhToPQhKnc+CTPy6nCe+mjqDmOhy/OmbmAe2gFSY=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; 
 i=@mandrillapp.com; q=dns/txt; s=mandrill; t=1688658411; h=From : 
 Subject : Message-Id : To : References : In-Reply-To : Date : 
 MIME-Version : Content-Type : Content-Transfer-Encoding : From : 
 Subject : Date : X-Mandrill-User : List-Unsubscribe; 
 bh=7iebBR2+WFMMCXpGZS2CNAoG6BhDktl65DqP2Xa1wrE=; 
 b=E8ZKrPzx9bwMJJdgGQKuEeh1jgFX7b/rGv8x5LitfxjVkNchpdfruxLJGK1zqTTC9GWUdV
 ZiWwJa4wHNMdap2WbK33PXsTFvVsRyNOq9GrozOLbjFJxz1CamAOX6+u/uY0RrZ9C1EXlFnh
 IRKNApdvdMvHRW/uA1Qaodm40bN48=
From: Yann Dirson <yann.dirson@vates.fr>
Subject: =?utf-8?Q?Re:=20Detecting=20whether=20dom0=20is=20in=20a=20VM?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 39f1d088-dab6-450b-998d-f0ee110bfa80
X-Bm-Transport-Timestamp: 1688658408944
Message-Id: <87770379-a53c-cfe4-3809-4dfce4787894@vates.fr>
To: xen-devel@lists.xenproject.org
References: <CA+zSX=Y4MwsDSd9oSG1NQyt==YAw9SeRdh=eJxTUhhOx57ihWg@mail.gmail.com> <4ee01a0f-063e-ef93-ac24-da387d5b3438@rabbit.lu> <a680ae62-7765-aa51-1edd-9a1a7e39e449@suse.com> <20b1a79c-23c1-93bc-2090-8052f143422c@rabbit.lu>
In-Reply-To: <20b1a79c-23c1-93bc-2090-8052f143422c@rabbit.lu>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.0e73e11d67d545b69f274766bbb5033d?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20230706:md
Date: Thu, 06 Jul 2023 15:46:51 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit



On 7/6/23 17:35, zithro wrote:
> On 06 Jul 2023 09:02, Jan Beulich wrote:
>> On 05.07.2023 18:20, zithro wrote:
>>> So I'm wondering, isn't that path enough for correct detection ?
>>> I mean, if "/sys/class/dmi/id/sys_vendor" reports Xen (or KVM, or any
>>> other known hypervisor), it's nested, otherwise it's on hardware ?
>>>
>>> Is that really mandatory to use CPUID leaves ?
>>
>> Let me ask the other way around: In user mode code under a non-nested
>> vs nested Xen, what would you be able to derive from CPUID? The
>> "hypervisor" bit is going to be set in both cases. (All assuming you
>> run on new enough hardware+Xen such that CPUID would be intercepted
>> even for PV.)
> 
> I'm a bit clueless about CPUID stuff, but if I understand correctly, 
> you're essentially saying that using CPUID may not be the perfect way ?
> Also, I don't get why the cpuid command returns two different values, 
> depending on the -k switch :
> # cpuid -l 0x40000000
> hypervisor_id (0x40000000) = "\0\0\0\0\0\0\0\0\0\0\0\0"
> # cpuid -k -l 0x40000000
> hypervisor_id (0x40000000) = "XenVMMXenVMM"
> 
>> Yet relying on DMI is fragile, too: Along the lines of
>> https://lists.xen.org/archives/html/xen-devel/2022-01/msg00604.html
>> basically any value in there could be "inherited" from the host (i.e.
>> from the layer below, to be precise).
> 
> So using "/sys/class/dmi/id/sys_vendor", or simply doing "dmesg | grep 
> DMI:" is also not perfect, as values can be inherited/spoofed by 
> underneath hypervisor ?
> 
>> The only way to be reasonably
>> certain is to ask Xen about its view. The raw or host featuresets
>> should give you this information, in the "mirror" of said respective
>> CPUID leave's "hypervisor" bit. 
> 
> As said above, I'm clueless, can you expand please ?
> 
>> But of course that still won't tell
>> you which _kind_ of hypervisor is the immediate next one underneath
>> Xen.
>>
>> This then further raises the question of what use it is to know the
>> kind of the next level hypervisor, when multiple may be stacked on
>> top of one another ...
> 
> We need an answer from systemd guys, but the commiter expanded on the 
> reasons why the change was made [1] : "the detect_vm_cpuid check was 
> returning a VIRTUALIZATION_NONE result on non-nested dom0 (checking the 
> log from back then I was getting No virtualization found in CPUID), but 
> would report other CPUID-detectable hypervisors when dom0 was nested, so 
> we still wanted to check it for this case".
> 
> Systemd is using this information to not start some services when 
> nested, like SMART/smartmontools (which have 
> "ConditionVirtualization=no" in their systemd unit files).
> As the check now fails on baremetal dom0s, the service is not starting.

Is this really wise?  With any passed-through device the user likely 
wants such a service to start.  Are they not misled with this effort?

> 
> [1] https://github.com/systemd/systemd/issues/28113#issuecomment-1621559642
> 

-- 
Yann Dirson | Vates Platform Developer
XCP-ng & Xen Orchestra - Vates solutions
w: vates.tech | xcp-ng.org | xen-orchestra.com


Yann Dirson | Vates Platform Developer

XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 16:09:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 16:09:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559927.875374 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHRXM-0008Ea-0P; Thu, 06 Jul 2023 16:08:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559927.875374; Thu, 06 Jul 2023 16:08:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHRXL-0008ET-U0; Thu, 06 Jul 2023 16:08:55 +0000
Received: by outflank-mailman (input) for mailman id 559927;
 Thu, 06 Jul 2023 16:08:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xukH=CY=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qHRXK-0008EJ-8X
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 16:08:54 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 65fee781-1c17-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 18:08:52 +0200 (CEST)
Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com
 [209.85.210.54])
 by support.bugseng.com (Postfix) with ESMTPSA id 2E2A54EE074E
 for <xen-devel@lists.xenproject.org>; Thu,  6 Jul 2023 18:08:51 +0200 (CEST)
Received: by mail-ot1-f54.google.com with SMTP id
 46e09a7af769-6b8b6f7399aso741234a34.1
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 09:08:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 65fee781-1c17-11ee-b237-6b7b168915f2
X-Gm-Message-State: ABy/qLaHTBazpsjULBlBW6qw3DiNCWZLzGUXwukEYA4/+C2Y1bLD/lOm
	UUnr62pLFAkik2x9HlWoc5Lx525Dhg3f84/rbSE=
X-Google-Smtp-Source: APBJJlGtV9+mfXOJSAeWCDAjamKiqBWUpBcLoyIq2tRFRjXe4cXSDFalY24wOEfrvQOIeHrlvLQojFfDTH2Zj9q1/PE=
X-Received: by 2002:a05:6358:9910:b0:134:ddad:2b4f with SMTP id
 w16-20020a056358991000b00134ddad2b4fmr2826690rwa.18.1688659729733; Thu, 06
 Jul 2023 09:08:49 -0700 (PDT)
MIME-Version: 1.0
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <e414542d76d4a4a0df6ad969cc6332e355d6ef38.1688559115.git.gianluca.luparini@bugseng.com>
 <a343fc97-84df-48e6-1c91-cd933c6e5210@suse.com>
In-Reply-To: <a343fc97-84df-48e6-1c91-cd933c6e5210@suse.com>
From: Simone Ballarin <simone.ballarin@bugseng.com>
Date: Thu, 6 Jul 2023 18:08:38 +0200
X-Gmail-Original-Message-ID: <CAFHJcJu=S2JtFJy_XnMhrr0gP7+sPfvrS_1940qzL9rc_j60nA@mail.gmail.com>
Message-ID: <CAFHJcJu=S2JtFJy_XnMhrr0gP7+sPfvrS_1940qzL9rc_j60nA@mail.gmail.com>
Subject: Re: [XEN PATCH v2 12/13] xen/x86: fix violations of MISRA C:2012 Rule 7.2
To: Jan Beulich <jbeulich@suse.com>
Cc: consulting@bugseng.com, Gianluca Luparini <gianluca.luparini@bugseng.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Wei Liu <wl@xen.org>, Paul Durrant <paul@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
	Michal Orzel <michal.orzel@amd.com>, Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, 
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000565cbb05ffd3bb98"

--000000000000565cbb05ffd3bb98
Content-Type: text/plain; charset="UTF-8"

Il giorno gio 6 lug 2023 alle ore 10:26 Jan Beulich <jbeulich@suse.com> ha
scritto:

> On 05.07.2023 17:26, Simone Ballarin wrote:
> > --- a/xen/arch/x86/apic.c
> > +++ b/xen/arch/x86/apic.c
> > @@ -1211,7 +1211,7 @@ static void __init calibrate_APIC_clock(void)
> >       * Setup the APIC counter to maximum. There is no way the lapic
> >       * can underflow in the 100ms detection time frame.
> >       */
> > -    __setup_APIC_LVTT(0xffffffff);
> > +    __setup_APIC_LVTT(0xffffffffU);
>
> While making the change less mechanical, we want to consider to switch
> to ~0 in this and similar cases.
>

Changing ~0U is more than not mechanical: it is possibly dangerous.
The resulting value could be different depending on the architecture,
I prefer to not make such kind of changes in a MISRA-related patch.


>
> > @@ -378,9 +378,9 @@ static void __init calculate_host_policy(void)
> >       * this information.
> >       */
> >      if ( cpu_has_lfence_dispatch )
> > -        max_extd_leaf = max(max_extd_leaf, 0x80000021);
> > +        max_extd_leaf = max(max_extd_leaf, 0x80000021U);
> >
> > -    p->extd.max_leaf = 0x80000000 | min_t(uint32_t, max_extd_leaf &
> 0xffff,
> > +    p->extd.max_leaf = 0x80000000U | min_t(uint32_t, max_extd_leaf &
> 0xffffU,
> >                                            ARRAY_SIZE(p->extd.raw) - 1);
>
> Adjustments like this or ...
>
> > @@ -768,7 +768,7 @@ void recalculate_cpuid_policy(struct domain *d)
> >
> >      p->basic.max_leaf   = min(p->basic.max_leaf,   max->basic.max_leaf);
> >      p->feat.max_subleaf = min(p->feat.max_subleaf,
> max->feat.max_subleaf);
> > -    p->extd.max_leaf    = 0x80000000 | min(p->extd.max_leaf & 0xffff,
> > +    p->extd.max_leaf    = 0x80000000U | min(p->extd.max_leaf & 0xffff,
> >                                             ((p->x86_vendor &
> (X86_VENDOR_AMD |
> >
> X86_VENDOR_HYGON))
> >                                              ? CPUID_GUEST_NR_EXTD_AMD
>
> ... this also need to adjust indentation of the following lines.
>
Ok.

>
> > --- a/xen/arch/x86/cpu/mcheck/mce-apei.c
> > +++ b/xen/arch/x86/cpu/mcheck/mce-apei.c
> > @@ -37,11 +37,11 @@
> >  #include "mce.h"
> >
> >  #define CPER_CREATOR_MCE                                             \
> > -     UUID_LE(0x75a574e3, 0x5052, 0x4b29, 0x8a, 0x8e, 0xbe, 0x2c,     \
> > -             0x64, 0x90, 0xb8, 0x9d)
> > +     UUID_LE(0x75a574e3U, 0x5052U, 0x4b29U, 0x8aU, 0x8eU, 0xbeU,
> 0x2cU,      \
> > +             0x64U, 0x90U, 0xb8U, 0x9dU)
> >  #define CPER_SECTION_TYPE_MCE
>       \
> > -     UUID_LE(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96,     \
> > -             0x04, 0x4a, 0x38, 0xfc)
> > +     UUID_LE(0xfe08ffbeU, 0x95e4U, 0x4be7U, 0xbcU, 0x73U, 0x40U,
> 0x96U,      \
> > +             0x04U, 0x4aU, 0x38U, 0xfcU)
>
> See the earlier (EFI) comment regarding excessive use of suffixes here.
>
Ok.

>
> > --- a/xen/arch/x86/hvm/stdvga.c
> > +++ b/xen/arch/x86/hvm/stdvga.c
> > @@ -39,46 +39,46 @@
> >
> >  #define PAT(x) (x)
> >  static const uint32_t mask16[16] = {
> > -    PAT(0x00000000),
> > -    PAT(0x000000ff),
> > -    PAT(0x0000ff00),
> > -    PAT(0x0000ffff),
> > -    PAT(0x00ff0000),
> > -    PAT(0x00ff00ff),
> > -    PAT(0x00ffff00),
> > -    PAT(0x00ffffff),
> > -    PAT(0xff000000),
> > -    PAT(0xff0000ff),
> > -    PAT(0xff00ff00),
> > -    PAT(0xff00ffff),
> > -    PAT(0xffff0000),
> > -    PAT(0xffff00ff),
> > -    PAT(0xffffff00),
> > -    PAT(0xffffffff),
> > +    PAT(0x00000000U),
> > +    PAT(0x000000ffU),
> > +    PAT(0x0000ff00U),
> > +    PAT(0x0000ffffU),
> > +    PAT(0x00ff0000U),
> > +    PAT(0x00ff00ffU),
> > +    PAT(0x00ffff00U),
> > +    PAT(0x00ffffffU),
> > +    PAT(0xff000000U),
> > +    PAT(0xff0000ffU),
> > +    PAT(0xff00ff00U),
> > +    PAT(0xff00ffffU),
> > +    PAT(0xffff0000U),
> > +    PAT(0xffff00ffU),
> > +    PAT(0xffffff00U),
> > +    PAT(0xffffffffU),
> >  };
>
> While I agree here, ...
>
> >  /* force some bits to zero */
> >  static const uint8_t sr_mask[8] = {
> > -    (uint8_t)~0xfc,
> > -    (uint8_t)~0xc2,
> > -    (uint8_t)~0xf0,
> > -    (uint8_t)~0xc0,
> > -    (uint8_t)~0xf1,
> > -    (uint8_t)~0xff,
> > -    (uint8_t)~0xff,
> > -    (uint8_t)~0x00,
> > +    (uint8_t)~0xfcU,
> > +    (uint8_t)~0xc2U,
> > +    (uint8_t)~0xf0U,
> > +    (uint8_t)~0xc0U,
> > +    (uint8_t)~0xf1U,
> > +    (uint8_t)~0xffU,
> > +    (uint8_t)~0xffU,
> > +    (uint8_t)~0x00U,
> >  };
> >
> >  static const uint8_t gr_mask[9] = {
> > -    (uint8_t)~0xf0, /* 0x00 */
> > -    (uint8_t)~0xf0, /* 0x01 */
> > -    (uint8_t)~0xf0, /* 0x02 */
> > -    (uint8_t)~0xe0, /* 0x03 */
> > -    (uint8_t)~0xfc, /* 0x04 */
> > -    (uint8_t)~0x84, /* 0x05 */
> > -    (uint8_t)~0xf0, /* 0x06 */
> > -    (uint8_t)~0xf0, /* 0x07 */
> > -    (uint8_t)~0x00, /* 0x08 */
> > +    (uint8_t)~0xf0U,
> > +    (uint8_t)~0xf0U,
> > +    (uint8_t)~0xf0U,
> > +    (uint8_t)~0xe0U,
> > +    (uint8_t)~0xfcU,
> > +    (uint8_t)~0x84U,
> > +    (uint8_t)~0xf0U,
> > +    (uint8_t)~0xf0U,
> > +    (uint8_t)~0x00U,
> >  };
>
> I continue to question these changes. They don't fix anything, do they?
>

No, they do not. They were done just for uniformity here.
I will remove the changes in sr_mask and gr_mask.

> --- a/xen/arch/x86/hvm/viridian/viridian.c
> > +++ b/xen/arch/x86/hvm/viridian/viridian.c
> > @@ -291,7 +291,7 @@ static void enable_hypercall_page(struct domain *d)
> >       * calling convention) to differentiate Xen and Viridian hypercalls.
> >       */
> >      *(u8  *)(p + 0) = 0x0d; /* orl $0x80000000, %eax */
> > -    *(u32 *)(p + 1) = 0x80000000;
> > +    *(u32 *)(p + 1) = 0x80000000U;
> >      *(u8  *)(p + 5) = 0x0f; /* vmcall/vmmcall */
> >      *(u8  *)(p + 6) = 0x01;
> >      *(u8  *)(p + 7) = (cpu_has_vmx ? 0xc1 : 0xd9);
>
> Please can this and ...
>
> > --- a/xen/arch/x86/include/asm/guest/hyperv-tlfs.h
> > +++ b/xen/arch/x86/include/asm/guest/hyperv-tlfs.h
> > @@ -471,30 +471,30 @@ typedef struct _HV_REFERENCE_TSC_PAGE {
> >
> >  /* Define hypervisor message types. */
> >  enum hv_message_type {
> > -     HVMSG_NONE                      = 0x00000000,
> > +     HVMSG_NONE                      = 0x00000000U,
> >
> >       /* Memory access messages. */
> > -     HVMSG_UNMAPPED_GPA              = 0x80000000,
> > -     HVMSG_GPA_INTERCEPT             = 0x80000001,
> > +     HVMSG_UNMAPPED_GPA              = 0x80000000U,
> > +     HVMSG_GPA_INTERCEPT             = 0x80000001U,
> >
> >       /* Timer notification messages. */
> > -     HVMSG_TIMER_EXPIRED                     = 0x80000010,
> > +     HVMSG_TIMER_EXPIRED                     = 0x80000010U,
> >
> >       /* Error messages. */
> > -     HVMSG_INVALID_VP_REGISTER_VALUE = 0x80000020,
> > -     HVMSG_UNRECOVERABLE_EXCEPTION   = 0x80000021,
> > -     HVMSG_UNSUPPORTED_FEATURE               = 0x80000022,
> > +     HVMSG_INVALID_VP_REGISTER_VALUE = 0x80000020U,
> > +     HVMSG_UNRECOVERABLE_EXCEPTION   = 0x80000021U,
> > +     HVMSG_UNSUPPORTED_FEATURE               = 0x80000022U,
> >
> >       /* Trace buffer complete messages. */
> > -     HVMSG_EVENTLOG_BUFFERCOMPLETE   = 0x80000040,
> > +     HVMSG_EVENTLOG_BUFFERCOMPLETE   = 0x80000040U,
> >
> >       /* Platform-specific processor intercept messages. */
> > -     HVMSG_X64_IOPORT_INTERCEPT              = 0x80010000,
> > -     HVMSG_X64_MSR_INTERCEPT         = 0x80010001,
> > -     HVMSG_X64_CPUID_INTERCEPT               = 0x80010002,
> > -     HVMSG_X64_EXCEPTION_INTERCEPT   = 0x80010003,
> > -     HVMSG_X64_APIC_EOI                      = 0x80010004,
> > -     HVMSG_X64_LEGACY_FP_ERROR               = 0x80010005
> > +     HVMSG_X64_IOPORT_INTERCEPT              = 0x80010000U,
> > +     HVMSG_X64_MSR_INTERCEPT         = 0x80010001U,
> > +     HVMSG_X64_CPUID_INTERCEPT               = 0x80010002U,
> > +     HVMSG_X64_EXCEPTION_INTERCEPT   = 0x80010003U,
> > +     HVMSG_X64_APIC_EOI                      = 0x80010004U,
> > +     HVMSG_X64_LEGACY_FP_ERROR               = 0x80010005U
> >  };
>
> ... this together be made a separate Viridian-specific change? (I
> continue to be uncertain about touching the header file; the
> Viridian maintainers will need to judge.)
>

Ok, I will split the patch.


> > --- a/xen/arch/x86/include/asm/x86-defns.h
> > +++ b/xen/arch/x86/include/asm/x86-defns.h
> > @@ -103,7 +103,7 @@
> >  /*
> >   * Debug status flags in DR6.
> >   */
> > -#define X86_DR6_DEFAULT         0xffff0ff0  /* Default %dr6 value. */
> > +#define X86_DR6_DEFAULT         0xffff0ff0U  /* Default %dr6 value. */
>
> Considering the respective register is pointer-/long-size, wouldn't
> this better use UL? But of course we'd want to check that this then
> doesn't affect code in do_debug() in an undesirable way.
>
> Jan
>


-- 
Simone Ballarin, M.Sc.

Field Application Engineer, BUGSENG (https://bugseng.com
<http://bugseng.com>)

--000000000000565cbb05ffd3bb98
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">Il giorno gio 6 lug 2023 alle ore 10:=
26 Jan Beulich &lt;<a href=3D"mailto:jbeulich@suse.com">jbeulich@suse.com</=
a>&gt; ha scritto:<br></div><blockquote class=3D"gmail_quote" style=3D"marg=
in:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1e=
x">On 05.07.2023 17:26, Simone Ballarin wrote:<br>
&gt; --- a/xen/arch/x86/apic.c<br>
&gt; +++ b/xen/arch/x86/apic.c<br>
&gt; @@ -1211,7 +1211,7 @@ static void __init calibrate_APIC_clock(void)<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0* Setup the APIC counter to maximum. There i=
s no way the lapic<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0* can underflow in the 100ms detection time =
frame.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0*/<br>
&gt; -=C2=A0 =C2=A0 __setup_APIC_LVTT(0xffffffff);<br>
&gt; +=C2=A0 =C2=A0 __setup_APIC_LVTT(0xffffffffU);<br>
<br>
While making the change less mechanical, we want to consider to switch<br>
to ~0 in this and similar cases.<br></blockquote><div><br></div><div>Changi=
ng ~0U is more than not mechanical: it is possibly dangerous.</div><div>The=
 resulting value could be different depending on the architecture,</div><di=
v>I prefer to not make such kind of changes in a MISRA-related patch.<br></=
div><div>=C2=A0 <br></div><blockquote class=3D"gmail_quote" style=3D"margin=
:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"=
>
<br>
&gt; @@ -378,9 +378,9 @@ static void __init calculate_host_policy(void)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0* this information.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0*/<br>
&gt;=C2=A0 =C2=A0 =C2=A0 if ( cpu_has_lfence_dispatch )<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 max_extd_leaf =3D max(max_extd_leaf, 0x80=
000021);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 max_extd_leaf =3D max(max_extd_leaf, 0x80=
000021U);<br>
&gt;=C2=A0 <br>
&gt; -=C2=A0 =C2=A0 p-&gt;extd.max_leaf =3D 0x80000000 | min_t(uint32_t, ma=
x_extd_leaf &amp; 0xffff,<br>
&gt; +=C2=A0 =C2=A0 p-&gt;extd.max_leaf =3D 0x80000000U | min_t(uint32_t, m=
ax_extd_leaf &amp; 0xffffU,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 ARRAY_SIZE(p-&gt;extd.raw) - 1);<br>
<br>
Adjustments like this or ...<br>
<br>
&gt; @@ -768,7 +768,7 @@ void recalculate_cpuid_policy(struct domain *d)<br=
>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 p-&gt;basic.max_leaf=C2=A0 =C2=A0=3D min(p-&gt;bas=
ic.max_leaf,=C2=A0 =C2=A0max-&gt;basic.max_leaf);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 p-&gt;feat.max_subleaf =3D min(p-&gt;feat.max_subl=
eaf, max-&gt;feat.max_subleaf);<br>
&gt; -=C2=A0 =C2=A0 p-&gt;extd.max_leaf=C2=A0 =C2=A0 =3D 0x80000000 | min(p=
-&gt;extd.max_leaf &amp; 0xffff,<br>
&gt; +=C2=A0 =C2=A0 p-&gt;extd.max_leaf=C2=A0 =C2=A0 =3D 0x80000000U | min(=
p-&gt;extd.max_leaf &amp; 0xffff,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0((p-&gt;x86_vendor &amp; (X86_VENDOR_AMD |<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 X86_VENDOR_HYGON))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 ? CPUID_GUEST_NR_EXTD_AMD<br>
<br>
... this also need to adjust indentation of the following lines.<br></block=
quote><div>Ok. <br></div><blockquote class=3D"gmail_quote" style=3D"margin:=
0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
&gt; --- a/xen/arch/x86/cpu/mcheck/mce-apei.c<br>
&gt; +++ b/xen/arch/x86/cpu/mcheck/mce-apei.c<br>
&gt; @@ -37,11 +37,11 @@<br>
&gt;=C2=A0 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LE(0xfe08ffbeU, 0x95e4U, 0x4be7U, 0xbcU, 0x7=
3U, 0x40U, 0x96U,=C2=A0 =C2=A0 =C2=A0 \<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00x04U, 0x4aU, 0x38U, =
0xfcU)<br>
<br>
See the earlier (EFI) comment regarding excessive use of suffixes here.<br>=
</blockquote><div>Ok. <br></div><blockquote class=3D"gmail_quote" style=3D"=
margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-lef=
t:1ex">
<br>
&gt; --- a/xen/arch/x86/hvm/stdvga.c<br>
&gt; +++ b/xen/arch/x86/hvm/stdvga.c<br>
&gt; @@ -39,46 +39,46 @@<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 #define PAT(x) (x)<br>
&gt;=C2=A0 static const uint32_t mask16[16] =3D {<br>
&gt; -=C2=A0 =C2=A0 PAT(0x00000000),<br>
&gt; -=C2=A0 =C2=A0 PAT(0x000000ff),<br>
&gt; -=C2=A0 =C2=A0 PAT(0x0000ff00),<br>
&gt; -=C2=A0 =C2=A0 PAT(0x0000ffff),<br>
&gt; -=C2=A0 =C2=A0 PAT(0x00ff0000),<br>
&gt; -=C2=A0 =C2=A0 PAT(0x00ff00ff),<br>
&gt; -=C2=A0 =C2=A0 PAT(0x00ffff00),<br>
&gt; -=C2=A0 =C2=A0 PAT(0x00ffffff),<br>
&gt; -=C2=A0 =C2=A0 PAT(0xff000000),<br>
&gt; -=C2=A0 =C2=A0 PAT(0xff0000ff),<br>
&gt; -=C2=A0 =C2=A0 PAT(0xff00ff00),<br>
&gt; -=C2=A0 =C2=A0 PAT(0xff00ffff),<br>
&gt; -=C2=A0 =C2=A0 PAT(0xffff0000),<br>
&gt; -=C2=A0 =C2=A0 PAT(0xffff00ff),<br>
&gt; -=C2=A0 =C2=A0 PAT(0xffffff00),<br>
&gt; -=C2=A0 =C2=A0 PAT(0xffffffff),<br>
&gt; +=C2=A0 =C2=A0 PAT(0x00000000U),<br>
&gt; +=C2=A0 =C2=A0 PAT(0x000000ffU),<br>
&gt; +=C2=A0 =C2=A0 PAT(0x0000ff00U),<br>
&gt; +=C2=A0 =C2=A0 PAT(0x0000ffffU),<br>
&gt; +=C2=A0 =C2=A0 PAT(0x00ff0000U),<br>
&gt; +=C2=A0 =C2=A0 PAT(0x00ff00ffU),<br>
&gt; +=C2=A0 =C2=A0 PAT(0x00ffff00U),<br>
&gt; +=C2=A0 =C2=A0 PAT(0x00ffffffU),<br>
&gt; +=C2=A0 =C2=A0 PAT(0xff000000U),<br>
&gt; +=C2=A0 =C2=A0 PAT(0xff0000ffU),<br>
&gt; +=C2=A0 =C2=A0 PAT(0xff00ff00U),<br>
&gt; +=C2=A0 =C2=A0 PAT(0xff00ffffU),<br>
&gt; +=C2=A0 =C2=A0 PAT(0xffff0000U),<br>
&gt; +=C2=A0 =C2=A0 PAT(0xffff00ffU),<br>
&gt; +=C2=A0 =C2=A0 PAT(0xffffff00U),<br>
&gt; +=C2=A0 =C2=A0 PAT(0xffffffffU),<br>
&gt;=C2=A0 };<br>
<br>
While I agree here, ...<br>
<br>
&gt;=C2=A0 /* force some bits to zero */<br>
&gt;=C2=A0 static const uint8_t sr_mask[8] =3D {<br>
&gt; -=C2=A0 =C2=A0 (uint8_t)~0xfc,<br>
&gt; -=C2=A0 =C2=A0 (uint8_t)~0xc2,<br>
&gt; -=C2=A0 =C2=A0 (uint8_t)~0xf0,<br>
&gt; -=C2=A0 =C2=A0 (uint8_t)~0xc0,<br>
&gt; -=C2=A0 =C2=A0 (uint8_t)~0xf1,<br>
&gt; -=C2=A0 =C2=A0 (uint8_t)~0xff,<br>
&gt; -=C2=A0 =C2=A0 (uint8_t)~0xff,<br>
&gt; -=C2=A0 =C2=A0 (uint8_t)~0x00,<br>
&gt; +=C2=A0 =C2=A0 (uint8_t)~0xfcU,<br>
&gt; +=C2=A0 =C2=A0 (uint8_t)~0xc2U,<br>
&gt; +=C2=A0 =C2=A0 (uint8_t)~0xf0U,<br>
&gt; +=C2=A0 =C2=A0 (uint8_t)~0xc0U,<br>
&gt; +=C2=A0 =C2=A0 (uint8_t)~0xf1U,<br>
&gt; +=C2=A0 =C2=A0 (uint8_t)~0xffU,<br>
&gt; +=C2=A0 =C2=A0 (uint8_t)~0xffU,<br>
&gt; +=C2=A0 =C2=A0 (uint8_t)~0x00U,<br>
&gt;=C2=A0 };<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 static const uint8_t gr_mask[9] =3D {<br>
&gt; -=C2=A0 =C2=A0 (uint8_t)~0xf0, /* 0x00 */<br>
&gt; -=C2=A0 =C2=A0 (uint8_t)~0xf0, /* 0x01 */<br>
&gt; -=C2=A0 =C2=A0 (uint8_t)~0xf0, /* 0x02 */<br>
&gt; -=C2=A0 =C2=A0 (uint8_t)~0xe0, /* 0x03 */<br>
&gt; -=C2=A0 =C2=A0 (uint8_t)~0xfc, /* 0x04 */<br>
&gt; -=C2=A0 =C2=A0 (uint8_t)~0x84, /* 0x05 */<br>
&gt; -=C2=A0 =C2=A0 (uint8_t)~0xf0, /* 0x06 */<br>
&gt; -=C2=A0 =C2=A0 (uint8_t)~0xf0, /* 0x07 */<br>
&gt; -=C2=A0 =C2=A0 (uint8_t)~0x00, /* 0x08 */<br>
&gt; +=C2=A0 =C2=A0 (uint8_t)~0xf0U,<br>
&gt; +=C2=A0 =C2=A0 (uint8_t)~0xf0U,<br>
&gt; +=C2=A0 =C2=A0 (uint8_t)~0xf0U,<br>
&gt; +=C2=A0 =C2=A0 (uint8_t)~0xe0U,<br>
&gt; +=C2=A0 =C2=A0 (uint8_t)~0xfcU,<br>
&gt; +=C2=A0 =C2=A0 (uint8_t)~0x84U,<br>
&gt; +=C2=A0 =C2=A0 (uint8_t)~0xf0U,<br>
&gt; +=C2=A0 =C2=A0 (uint8_t)~0xf0U,<br>
&gt; +=C2=A0 =C2=A0 (uint8_t)~0x00U,<br>
&gt;=C2=A0 };<br>
<br>
I continue to question these changes. They don&#39;t fix anything, do they?=
<br>=C2=A0</blockquote><div>No, they do not. They were done just for unifor=
mity here.</div><div>I will remove the changes in sr_mask and gr_mask.</div=
><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt; --- a/xen/arch/x86/hvm/viridian/viridian.c<br>
&gt; +++ b/xen/arch/x86/hvm/viridian/viridian.c<br>
&gt; @@ -291,7 +291,7 @@ static void enable_hypercall_page(struct domain *d=
)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0* calling convention) to differentiate Xen a=
nd Viridian hypercalls.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0*/<br>
&gt;=C2=A0 =C2=A0 =C2=A0 *(u8=C2=A0 *)(p + 0) =3D 0x0d; /* orl $0x80000000,=
 %eax */<br>
&gt; -=C2=A0 =C2=A0 *(u32 *)(p + 1) =3D 0x80000000;<br>
&gt; +=C2=A0 =C2=A0 *(u32 *)(p + 1) =3D 0x80000000U;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 *(u8=C2=A0 *)(p + 5) =3D 0x0f; /* vmcall/vmmcall *=
/<br>
&gt;=C2=A0 =C2=A0 =C2=A0 *(u8=C2=A0 *)(p + 6) =3D 0x01;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 *(u8=C2=A0 *)(p + 7) =3D (cpu_has_vmx ? 0xc1 : 0xd=
9);<br>
<br>
Please can this and ...<br>
<br>
&gt; --- a/xen/arch/x86/include/asm/guest/hyperv-tlfs.h<br>
&gt; +++ b/xen/arch/x86/include/asm/guest/hyperv-tlfs.h<br>
&gt; @@ -471,30 +471,30 @@ typedef struct _HV_REFERENCE_TSC_PAGE {<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 /* Define hypervisor message types. */<br>
&gt;=C2=A0 enum hv_message_type {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0HVMSG_NONE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D 0x00000000,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0HVMSG_NONE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D 0x00000000U,<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Memory access messages. */<br>
&gt; -=C2=A0 =C2=A0 =C2=A0HVMSG_UNMAPPED_GPA=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =3D 0x80000000,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0HVMSG_GPA_INTERCEPT=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0=3D 0x80000001,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0HVMSG_UNMAPPED_GPA=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =3D 0x80000000U,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0HVMSG_GPA_INTERCEPT=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0=3D 0x80000001U,<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Timer notification messages. */<br>
&gt; -=C2=A0 =C2=A0 =C2=A0HVMSG_TIMER_EXPIRED=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D 0x80000010,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0HVMSG_TIMER_EXPIRED=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D 0x80000010U,<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Error messages. */<br>
&gt; -=C2=A0 =C2=A0 =C2=A0HVMSG_INVALID_VP_REGISTER_VALUE =3D 0x80000020,<b=
r>
&gt; -=C2=A0 =C2=A0 =C2=A0HVMSG_UNRECOVERABLE_EXCEPTION=C2=A0 =C2=A0=3D 0x8=
0000021,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0HVMSG_UNSUPPORTED_FEATURE=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D 0x80000022,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0HVMSG_INVALID_VP_REGISTER_VALUE =3D 0x80000020U,<=
br>
&gt; +=C2=A0 =C2=A0 =C2=A0HVMSG_UNRECOVERABLE_EXCEPTION=C2=A0 =C2=A0=3D 0x8=
0000021U,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0HVMSG_UNSUPPORTED_FEATURE=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D 0x80000022U,<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Trace buffer complete messages. */<br>
&gt; -=C2=A0 =C2=A0 =C2=A0HVMSG_EVENTLOG_BUFFERCOMPLETE=C2=A0 =C2=A0=3D 0x8=
0000040,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0HVMSG_EVENTLOG_BUFFERCOMPLETE=C2=A0 =C2=A0=3D 0x8=
0000040U,<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Platform-specific processor intercept mes=
sages. */<br>
&gt; -=C2=A0 =C2=A0 =C2=A0HVMSG_X64_IOPORT_INTERCEPT=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D 0x80010000,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0HVMSG_X64_MSR_INTERCEP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 =3D 0x80010004U,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0HVMSG_X64_LEGACY_FP_ERROR=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D 0x80010005U<br>
&gt;=C2=A0 };<br>
<br>
... this together be made a separate Viridian-specific change? (I<br>
continue to be uncertain about touching the header file; the<br>
Viridian maintainers will need to judge.)<br>=C2=A0</blockquote><div>Ok, I =
will split the patch.</div><div>=C2=A0<br></div><blockquote class=3D"gmail_=
quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,=
204);padding-left:1ex">
&gt; --- a/xen/arch/x86/include/asm/x86-defns.h<br>
&gt; +++ b/xen/arch/x86/include/asm/x86-defns.h<br>
&gt; @@ -103,7 +103,7 @@<br>
&gt;=C2=A0 /*<br>
&gt;=C2=A0 =C2=A0* Debug status flags in DR6.<br>
&gt;=C2=A0 =C2=A0*/<br>
&gt; -#define X86_DR6_DEFAULT=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00xffff0ff0=
=C2=A0 /* Default %dr6 value. */<br>
&gt; +#define X86_DR6_DEFAULT=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00xffff0ff0U=
=C2=A0 /* Default %dr6 value. */<br>
<br>
Considering the respective register is pointer-/long-size, wouldn&#39;t<br>
this better use UL? But of course we&#39;d want to check that this then<br>
doesn&#39;t affect code in do_debug() in an undesirable way.<br>
<br>
Jan<br>
</blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre=
fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"l=
tr">Simone Ballarin, M.Sc.<br><br><div>Field Application Engineer, BUGSENG =
(<a href=3D"http://bugseng.com" target=3D"_blank">https://bugseng.com</a>)<=
/div></div></div></div>

--000000000000565cbb05ffd3bb98--


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 16:14:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 16:14:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559935.875385 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHRcs-0001PH-NZ; Thu, 06 Jul 2023 16:14:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559935.875385; Thu, 06 Jul 2023 16:14:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHRcs-0001PA-KF; Thu, 06 Jul 2023 16:14:38 +0000
Received: by outflank-mailman (input) for mailman id 559935;
 Thu, 06 Jul 2023 16:14:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ZWa/=CY=suse.cz=jack@srs-se1.protection.inumbo.net>)
 id 1qHRcq-0001P4-HV
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 16:14:36 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 32aa0a48-1c18-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 18:14:35 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 4E502223E8;
 Thu,  6 Jul 2023 16:14:34 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2ADF1138EE;
 Thu,  6 Jul 2023 16:14:34 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id +RN/CmropmTIKwAAMHmgww
 (envelope-from <jack@suse.cz>); Thu, 06 Jul 2023 16:14:34 +0000
Received: by quack3.suse.cz (Postfix, from userid 1000)
 id B00D6A0707; Thu,  6 Jul 2023 18:14:33 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 32aa0a48-1c18-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa;
	t=1688660074; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=U3X2c4DZ7u1WJQoXTnnFA0EIrJReIsvKkxSR5ka0KIA=;
	b=QmpkaGPRZaoHJzRo2a6TjndqPucrWh7f/FY2L3L/tkSmDEI1eMsM8wrizbEulyyCbALdKF
	NAhJw22VD9dE7RV9U1X7QxEMrx2wMp7N4RocvtwIIP7j7sOckxmGngjpgD0K7UzZlI8BMj
	7TaptoZ4hnlDaa+a0YvCourIJS7rkEc=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;
	s=susede2_ed25519; t=1688660074;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=U3X2c4DZ7u1WJQoXTnnFA0EIrJReIsvKkxSR5ka0KIA=;
	b=BFZ9TyrydR/g+7ExWBaMGJWuaCnekgsDWt3QOA77tpx+pa0ab3V9kDQ7HgXi8ns77IxFLs
	krph+7hPTygy6eCw==
Date: Thu, 6 Jul 2023 18:14:33 +0200
From: Jan Kara <jack@suse.cz>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jan Kara <jack@suse.cz>, linux-block@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Alasdair Kergon <agk@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anna Schumaker <anna@kernel.org>, Chao Yu <chao@kernel.org>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Dave Kleikamp <shaggy@kernel.org>, David Sterba <dsterba@suse.com>,
	dm-devel@redhat.com, drbd-dev@lists.linbit.com,
	Gao Xiang <xiang@kernel.org>, Jack Wang <jinpu.wang@ionos.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	Joern Engel <joern@lazybastard.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	linux-bcache@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org,
	linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org,
	linux-nilfs@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-pm@vger.kernel.org, linux-raid@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	"Md. Haris Iqbal" <haris.iqbal@ionos.com>,
	Mike Snitzer <snitzer@kernel.org>, Minchan Kim <minchan@kernel.org>,
	ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Song Liu <song@kernel.org>, Sven Schnelle <svens@linux.ibm.com>,
	target-devel@vger.kernel.org, Ted Tso <tytso@mit.edu>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions
Message-ID: <20230706161433.lj4apushiwguzvdd@quack3>
References: <20230629165206.383-1-jack@suse.cz>
 <20230704122224.16257-1-jack@suse.cz>
 <ZKbgAG5OoHVyUKOG@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <ZKbgAG5OoHVyUKOG@infradead.org>

On Thu 06-07-23 08:38:40, Christoph Hellwig wrote:
> On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote:
> > Create struct bdev_handle that contains all parameters that need to be
> > passed to blkdev_put() and provide blkdev_get_handle_* functions that
> > return this structure instead of plain bdev pointer. This will
> > eventually allow us to pass one more argument to blkdev_put() without
> > too much hassle.
> 
> Can we use the opportunity to come up with better names?  blkdev_get_*
> was always a rather horrible naming convention for something that
> ends up calling into ->open.
> 
> What about:
> 
> struct bdev_handle *bdev_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
> 		const struct blk_holder_ops *hops);
> struct bdev_handle *bdev_open_by_path(dev_t dev, blk_mode_t mode,
> 		void *holder, const struct blk_holder_ops *hops);
> void bdev_release(struct bdev_handle *handle);

I'd maybe use bdev_close() instead of bdev_release() but otherwise I like
the new naming.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 16:20:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 16:20:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559939.875394 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHRiD-0002s6-9v; Thu, 06 Jul 2023 16:20:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559939.875394; Thu, 06 Jul 2023 16:20:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHRiD-0002rz-6l; Thu, 06 Jul 2023 16:20:09 +0000
Received: by outflank-mailman (input) for mailman id 559939;
 Thu, 06 Jul 2023 16:20:08 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHRiC-0002rb-1U; Thu, 06 Jul 2023 16:20:08 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHRiB-0006a3-Pu; Thu, 06 Jul 2023 16:20:07 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHRiB-0004Mj-Fj; Thu, 06 Jul 2023 16:20:07 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qHRiB-0008NN-FC; Thu, 06 Jul 2023 16:20:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=jaejcnp8yWjDSVK9CwDcKtkfB7OBb545AkYlm4dSKGg=; b=rKq5E92JEWJLm7WWZBGHOytoH5
	jr6G3BzS6uRVRl7zri+6225Z+96SAWzVLDi3ngZbSdgwaBCK8VjMwPpousjnot9PTr8HRv2OhVXKV
	f3BXPhk9toYpn0OspATmTMnfz/uTpvHezBH1d9tG1izOrD3oqHBAg4OcjsTHMnNVXwXw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181722-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181722: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=60475162a66a73426cd971174bb3cd853a4619cf
X-Osstest-Versions-That:
    ovmf=af8859bce2ffa8d72d8fb30149a0ef6423a8cc47
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 06 Jul 2023 16:20:07 +0000

flight 181722 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181722/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 60475162a66a73426cd971174bb3cd853a4619cf
baseline version:
 ovmf                 af8859bce2ffa8d72d8fb30149a0ef6423a8cc47

Last test of basis   181705  2023-07-05 10:10:39 Z    1 days
Testing same since   181722  2023-07-06 13:42:14 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Nickle Wang <nicklew@nvidia.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   af8859bce2..60475162a6  60475162a66a73426cd971174bb3cd853a4619cf -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 16:22:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 16:22:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559945.875404 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHRkn-0003Rk-NR; Thu, 06 Jul 2023 16:22:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559945.875404; Thu, 06 Jul 2023 16:22:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHRkn-0003Rd-Kn; Thu, 06 Jul 2023 16:22:49 +0000
Received: by outflank-mailman (input) for mailman id 559945;
 Thu, 06 Jul 2023 16:22:47 +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 <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHRkl-0003RS-FB
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 16:22:47 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on2060f.outbound.protection.outlook.com
 [2a01:111:f400:fe12::60f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 56a33654-1c19-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 18:22:45 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM0PR04MB6852.eurprd04.prod.outlook.com (2603:10a6:208:18c::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 16:22:43 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 16:22:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 56a33654-1c19-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=nRwIwElOGE3UXmFigUas2qYOjerWOW3zfaf9WJiRUQLkRf7v++WN4w4l+N30dAMZHZXU57wx2YryND8o5zTQLxEFgtx9LPBLozKej8xWgRfJyLdY2acnkfVTVxMmxJXR12vu1Qj5cGTBa/I5NQYshRV7OqDIdCgV3e41POygSXJJLaAiPljtIG2CI+CmFjrgcItHJRcsiLY62JxAmMIXsMPJdI81tMrAjVblmH+7PS16ePIkcX/HVqMQlmig70omKEDUMoi1rNULW3b+8Sxy1tN6FIDzHHYf8AmzP3CzW4aaz6IvSF7/Ijp757FdtObdh8YkbnHgFFn+YLbGiHNoxw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4VUaRakA8WXAnt74HRa63Lz7G4ULWu80U3CpXtW1wTI=;
 b=nMMKheQggf4TYJkXoiPdxyGYaKXIcxldWORAv9Uv08T3UjmdNVnWdzMXKKyPs0jfZyBw3PmxT1PkfP4Wt6wm1GQ2td46Ex+bXLBKcgcwEv9mZ8se8DwOzqM+LgYEC43TQhgH2Hg0jbHod0bIfpR4S4WMvaS5aePBn6TJjb50YA8fNmTFbtMteXqBxKeLiUIrkL0GivjLyQbDdH0w1onqZwO6oUpvF14JZkxGj8+F0pJ39/VPZ9AkFUyLVfYxAUtwzz40dP0BFcx6nPgE9yiPif9KLj5zv5AmBoUEyz1EF9UmqhgUpKqrg9XJ4x/siuJfnBW2BI4Y/RaGFVrZqDBwcA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4VUaRakA8WXAnt74HRa63Lz7G4ULWu80U3CpXtW1wTI=;
 b=4vJ2q+dq8NPeRgDwUwyW3gCofjinsShGRyYz4EgT528+gYo9gQjJfbS+hQ9UG/ufVRAp0vu6wiDVxX+7eRLx/r0MUfM7IWoircJI7G4ciILiTkaJKgdvcLSZPOEHwT+fQdB/YLMcEcejue3Ri4yEqzNSKYmyS12Of8pjt1yM1dO4B1lL6tWZD9DktGpQWSfJhaiOErPxKoSLpr5deWccRgDS3m2X4hD/FrCLg6jXLZiMD1Pxo+YmhrPdZJJBTrACfpn7xVynq8xqQHk9eJ3s4RvrVeaWl6zNdlLdlnicnT9RVsO/ixOGqW+Q8/qSz1WjKJqoON0PGCZ3nDbC/SZRHA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <f93f0561-abea-bdae-223e-d69932e435c4@suse.com>
Date: Thu, 6 Jul 2023 18:22:40 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 12/13] xen/x86: fix violations of MISRA C:2012 Rule
 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Paul Durrant <paul@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <e414542d76d4a4a0df6ad969cc6332e355d6ef38.1688559115.git.gianluca.luparini@bugseng.com>
 <a343fc97-84df-48e6-1c91-cd933c6e5210@suse.com>
 <CAFHJcJu=S2JtFJy_XnMhrr0gP7+sPfvrS_1940qzL9rc_j60nA@mail.gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <CAFHJcJu=S2JtFJy_XnMhrr0gP7+sPfvrS_1940qzL9rc_j60nA@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0115.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9d::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM0PR04MB6852:EE_
X-MS-Office365-Filtering-Correlation-Id: 63bddc42-e571-479d-91aa-08db7e3d39b6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	IQUpe4uvHXZH98kt/BV33jOn2sXk0u2LMa2EBabzTzQhB4YpMhYp3vACW797lFdV+hNI9z5Vpm+EC8voNj+RnJm3vNM8TQy1yQSO7Ex45BKjtFe8B6IGnFTjdgc7yX9W19nhc3fa0W+AsPz37ATyKoDp3Ci8358eK1XEPi34LqJ5J2hK7OHLyX8S9Ow3Fy2g84e0NhytGnxVz+bansJGIrzYZvveQSVEuOGaZQ2EPptlYb7TglBJ1b2iWnCmwgojNKOliyWD0UNa+H902LiPutmsVdYTqHB6dazjWGw4QBBy3Orm83GB4o2Eydy3JmcbkF1nGwB8jCh9zsduYiJWBfGJsZyYjq51Zd+uSNtap/hpNwKmZ3pDD5jM5gOe7fYpd86TXlQlbw1ZcVcXuogRbwmYCznlFH5qvTZNI5q2kLPWaNKOVhcEgn+BxdttdVi4Lcrolg1+kyKJftknQcXx0+OfY4dxtyeq3RPoG9jtCbL7OaAOTapEkuOp5riUVHLgBE7Iuhh/qUJdgE3m6bZgedSzfr6sQZ3Mg9RWdHkTnuTk7a7j47IjTD4KDxdYwzUd4LJULqKOZs4+tA4ElAxkVKlRJmkC9iTr7unLCzr8V4mq8gBZmgLIC07/O9Id7cbAESOY2ubFaVHgfByRmCuR2w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(39860400002)(396003)(366004)(136003)(451199021)(31686004)(7416002)(8936002)(8676002)(5660300002)(4744005)(41300700001)(83380400001)(316002)(2906002)(2616005)(66946007)(38100700002)(6916009)(4326008)(66556008)(66476007)(86362001)(186003)(53546011)(26005)(478600001)(6506007)(6486002)(54906003)(31696002)(36756003)(6512007)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YzR6OGZodXZ0c1BNYWduSTQvTkhITkZTQm9GMjBJQ3dpWk50Yy9rY20yQXBo?=
 =?utf-8?B?ZHFKU2k4QnBBVnZEMlJsMmVHVWpZSFNLTXhyUGJKanZxaUlJOUc5UHpQTHI0?=
 =?utf-8?B?c29zRVBibmFFZGdZMXJiL3JyRmVDVk9ibi9lTkVNQ0gwSjJpbGNxWm9MSVFD?=
 =?utf-8?B?NHNFL0hYTVo5WklBSkdhY1pBLzU3aGVyV041eGZ6K3RLc3ZMT0xvTWZlbWlv?=
 =?utf-8?B?WlljdmxieVpmc0gvaUJxTmJCdXQrbVZJbnIxQTR4b2JXaCs4T2p3WXZpUE40?=
 =?utf-8?B?LzVkamsweFYvUTFwblF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rQml5Z3BZ?=
 =?utf-8?B?V1JDWmJTdUowL1J5NUMxVEMrYUE4NEhJbWo4Z3RrbmFmcTR1RU5WeS9SdnBB?=
 =?utf-8?Q?vMvuuHjHJRNbVwctlGQhiDapT?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 63bddc42-e571-479d-91aa-08db7e3d39b6
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 16:22:43.0875
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: US64W9akg0GzjWgQj4FDuyfA/eQZ36UWoJAe6THCX0ArQPuARO0wTHXxxOdOKmnTkHNZuqFqduRb6SAusc9zMA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6852

On 06.07.2023 18:08, Simone Ballarin wrote:
> Il giorno gio 6 lug 2023 alle ore 10:26 Jan Beulich <jbeulich@suse.com> ha
> scritto:
> 
>> On 05.07.2023 17:26, Simone Ballarin wrote:
>>> --- a/xen/arch/x86/apic.c
>>> +++ b/xen/arch/x86/apic.c
>>> @@ -1211,7 +1211,7 @@ static void __init calibrate_APIC_clock(void)
>>>       * Setup the APIC counter to maximum. There is no way the lapic
>>>       * can underflow in the 100ms detection time frame.
>>>       */
>>> -    __setup_APIC_LVTT(0xffffffff);
>>> +    __setup_APIC_LVTT(0xffffffffU);
>>
>> While making the change less mechanical, we want to consider to switch
>> to ~0 in this and similar cases.
>>
> 
> Changing ~0U is more than not mechanical: it is possibly dangerous.
> The resulting value could be different depending on the architecture,
> I prefer to not make such kind of changes in a MISRA-related patch.

What do you mean by "depending on the architecture", when this is
x86-only code _and_ you can check what type parameter the called
function has?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 16:22:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 16:22:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559946.875415 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHRko-0003gp-UM; Thu, 06 Jul 2023 16:22:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559946.875415; Thu, 06 Jul 2023 16:22:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHRko-0003gi-Ra; Thu, 06 Jul 2023 16:22:50 +0000
Received: by outflank-mailman (input) for mailman id 559946;
 Thu, 06 Jul 2023 16:22:48 +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 <SRS0=jdui=CY=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHRkm-0003RS-K8
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 16:22:48 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on2060f.outbound.protection.outlook.com
 [2a01:111:f400:fe12::60f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 57f72967-1c19-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 18:22:47 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM0PR04MB6852.eurprd04.prod.outlook.com (2603:10a6:208:18c::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul
 2023 16:22:44 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Thu, 6 Jul 2023
 16:22:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 57f72967-1c19-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Y+OsARf3630O7JzDGdYUpxqzq9d1br5GepZSPyj57hC9r/p3i4KUgJtvgOVPPfat5YAeg9oKy6aiLW4LMuuTk7lxnfxFeqoznG8VJdkTrvtNPPqcFsPymEKzYS83GIAa5WLzGw7XcUPyR2P7AJLdCPWDT9D3LvZKBWVaiH3E2Fjx8OSaZaoi3m+p4syijJES0pXymslJkKpykhiWCMezEIzNNkjRFlkfKuq0xmegdnkkpGtUsMsVz+MZjR+KVY5AxypXpcH7LIGcWu6Lb8s2gB/bCxSCRjos9/XeJqAZ74+O79s+ETOHdyPqzSCLRBN2hcbuu8V8vtAoUAWBXAoEEg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4VUaRakA8WXAnt74HRa63Lz7G4ULWu80U3CpXtW1wTI=;
 b=IuvRYFh6MBo3CnBMC3mROYiOmTPUY+W+8f65HKZFU2F0Ty4JgXS5wJ0RLi2Rgjta68whQHz8PrPrvk2YB6Z3kv43SKazGsiKQhvelVGCesoAzE0ZQmDwSXhyk1PGbRyio/+Q1mjQO7Ne7EqMChlYqAcL0/Q7uZ7/mGn+7HNARktyFVbIyhzp8lyooA8zb2ANF63QML51WuGc1CpHx91b1R8dM5KDTY270PS7vVL4OGq/5N5Ly+d5PPvSRayJbPqPNpwB/xlD05vk8+UccDc7MqybisalldDCQij603yqamHmWxYKGsmx2gTAb3Cee9lbkQxP41NdisEoFJGr+JacaQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4VUaRakA8WXAnt74HRa63Lz7G4ULWu80U3CpXtW1wTI=;
 b=v//jmLFxVC2JVQhDqCOeAU0LndvkfwbqtiLl/k2pBU3QyK7stQdB/dvwYWVGTiplbVyvWQgnkWzU0bXA3s4p+jebCxv9DhxYSJl0WaW0xulw7jOWd/vQMfGvC1LSn5XC+bKQ2XTHWjEiiDjYRW3Rh5Fu1GSc3k2MV8gsS8IoqjW8IgfBRtvITApW47Md+72QKJxLSgEzEw2XSK5bPxiXi6N+HjMVlIeyk2cQUwliQE3oFR+cmgB4DNh7RXtNafPkjoTY72HsQHhgKTlJtxyZpBvxS0OzF13isDXFkWrgHH6JTeth3x/GX+Pa0v+10uweejO+kCq7ZDwFcUYvUcJ56Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <9f02a81f-648f-4f80-ad79-9f70eb50d296@suse.com>
Date: Thu, 6 Jul 2023 18:22:40 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 12/13] xen/x86: fix violations of MISRA C:2012 Rule
 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Paul Durrant <paul@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <e414542d76d4a4a0df6ad969cc6332e355d6ef38.1688559115.git.gianluca.luparini@bugseng.com>
 <a343fc97-84df-48e6-1c91-cd933c6e5210@suse.com>
 <CAFHJcJu=S2JtFJy_XnMhrr0gP7+sPfvrS_1940qzL9rc_j60nA@mail.gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <CAFHJcJu=S2JtFJy_XnMhrr0gP7+sPfvrS_1940qzL9rc_j60nA@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0124.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9d::18) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM0PR04MB6852:EE_
X-MS-Office365-Filtering-Correlation-Id: c213a86e-b366-49fe-8ec0-08db7e3d39d5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	HKBU5TDFlVfTEPD6tgM4fIe7yRcDjtR1zmib+EkfVItGHa6Jy+roBXtJYnKOWfoC9+9+026ZdTFyJVX+0NE11O55TW+fb0hpjoKzBXdfWezOv8MjIB0pYkORGunkJiX1QJRXbqGM5w3zF6PbIe46bVoOZGOGkRzuHf8WtNjMX7+svQpHX4nSh9Bt8WFmebQnBCHltCgIgiXdAZRjOuj6/ZfOkiC5h1HlpOu5GfcS9R2r8RFBbHmvrjdTWcbFXUXkRkd+h3JaMpeMnOB36UN+cPCObEJEXKPNJYiU1Nl+abD3BpyFsIUOvNJ5XdhJdi6/KvQZaVtw0ppz/DdeFC+khoIZxawVL3hdRW1eJu3a/ldbKO5RzdwQXVtcKRB0F6LSBYy27oE+lpnqfEC3h58ZSKXzbyNAvKCgsS2M22JamO5Bh2np/Xlpq8eNb3ji9AWkq7z07SqMmRXcAtFeju3aYikSK+ZfLazEs/011Nj5Xi0FxYLSn+2s59ShYGdOARJgFpkOgq+BoxUqddeBIter/zM+ZLfXEVndN1CoeANRrYHh8xio7bd8ewSjkMh0j9TL7g7Bu/4GtY0IVdGEto52ZDQVw3q1qPPF72mTgh2S+sM6o+5168ovfRehC32XZY/GAR5Ntw1JrPxj8YnepkAD4w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(39860400002)(396003)(366004)(136003)(451199021)(31686004)(7416002)(8936002)(8676002)(5660300002)(4744005)(41300700001)(83380400001)(316002)(2906002)(2616005)(66946007)(38100700002)(6916009)(4326008)(66556008)(66476007)(86362001)(186003)(53546011)(26005)(478600001)(6506007)(6486002)(54906003)(31696002)(36756003)(6512007)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MjVMM0lXbGxKaUU3bTVoUkZkZHdaSExWVXl2MHRUS2pBM1pxdi9CcXI4d1Vi?=
 =?utf-8?B?UFJYc2p6VkVWUlFoVWpZUzVlcjNJaEdHcnpNdjVQbk9wcUtGT3FOYStzR0g4?=
 =?utf-8?B?bnZUMUEyWitDeXRNNlpjOXcrdW15UGVDT3hZWStZRjBKbDhnZHpPTktZQnEw?=
 =?utf-8?B?QjdNMFNmSCtFK2xwQTZORno0RjVOQ2c0bHFKSDRNRmxZS3dscmpVNzFrYmh4?=
 =?utf-8?B?TkNGSHQrejYrRUs2cDltOS96RjdNVWpGU2dSd2pXVnlQMkRSN2VyZFkxWm1D?=
 =?utf-8?B?anluWGk5OHRuRUxsS25qWlFCRG15QTRrcnp1dUpBK2NES0tnRVMrUHdYY2oy?=
 =?utf-8?B?RzNjWWlXcDFqL0NnNVl0dE5hUDk4bUZyL2gxSlM0Y3kxNGhlelJucVd3VWhN?=
 =?utf-8?B?aklQVjNjTHBFZGlqdWpZRjNsaHBBbTd3cUZuTXhPb1JCNUZtVllFUnJEN2lq?=
 =?utf-8?B?Qm9qMDcrVitNQy9tSnluandWaEpqTjFESTEvS05UUmErVk5RbzdvUGNDY21x?=
 =?utf-8?B?OXYzY0JObTF2bDJGSkpMalQ1SEdIMWYxSDZKODE5bjdsbnV1ejJUSXowUUxY?=
 =?utf-8?B?ZWNlRlFqeWl3Yld6YjluZEJFc2JtMGNjRTlRSTFRV3Y0K0VqOHlZRjFncmw1?=
 =?utf-8?B?bUpOazAvQWNjTVNTNys5aC9makhjT1lmODU0MTdaSFh0L2JJQ20vYTRxWnph?=
 =?utf-8?B?Q2lYcEcwa0lLbmM5bTFCSmhQT0o5UVFpNStLS3U2aGpQSGlsZFlsYThCdGgr?=
 =?utf-8?B?Tl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samF1Wmc3N0l1TXVTeURIY0dwOHFGdCs3RzIrazNBRi9h?=
 =?utf-8?B?NHJlbVBzM1EzUng3emR3VlB6R3RBS3B2SDkzcGc5R0Q2UGYvblA4SWh6ZXVw?=
 =?utf-8?B?UDFQNmRDMnVLbkZISXFnM3dUaEtlVUcwY3hFWVV6OTI2Q283d3hia3RqNHA2?=
 =?utf-8?B?VWNvZ05TNjdvL2Jyc00xYTNpdE12UU1RK2J3M0x4ZEdJb1k2ckU5bnJKbUQy?=
 =?utf-8?B?R0VHWFFNektOYUZiSFFhZFRPMmxaK3lheFJxOUNWQTQzN3lqYUIxcW5JZjVv?=
 =?utf-8?B?aVRLMWNtaXByMDI5eXkvN2FwNXVRUkVUNFArdUo3azdjSkZkSEtqTjhWVEpo?=
 =?utf-8?B?OUZ1WVRURDE0TVc3clZXdzdkM2RNZDFVK21qVGxnY3ovdlp4MWtSeHVNVy91?=
 =?utf-8?B?VlJQNkxEQlFvZWtLR2FVclJ2VzVuSjg1bjIrUlVQSElGaEM5d0gvSEFCcnlS?=
 =?utf-8?Q?oSWfoHnGoagmfpjEVLEKFPkR3?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c213a86e-b366-49fe-8ec0-08db7e3d39d5
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 16:22:43.2512
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: gqL3anNBVWXNEWlAux0tX6kK9rQ473WNuJAI+qSftjzKPHSvINtAS4NWu5sUhva6d7jmAx/kr0YgOzJYhXYQEg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6852

On 06.07.2023 18:08, Simone Ballarin wrote:
> Il giorno gio 6 lug 2023 alle ore 10:26 Jan Beulich <jbeulich@suse.com> ha
> scritto:
> 
>> On 05.07.2023 17:26, Simone Ballarin wrote:
>>> --- a/xen/arch/x86/apic.c
>>> +++ b/xen/arch/x86/apic.c
>>> @@ -1211,7 +1211,7 @@ static void __init calibrate_APIC_clock(void)
>>>       * Setup the APIC counter to maximum. There is no way the lapic
>>>       * can underflow in the 100ms detection time frame.
>>>       */
>>> -    __setup_APIC_LVTT(0xffffffff);
>>> +    __setup_APIC_LVTT(0xffffffffU);
>>
>> While making the change less mechanical, we want to consider to switch
>> to ~0 in this and similar cases.
>>
> 
> Changing ~0U is more than not mechanical: it is possibly dangerous.
> The resulting value could be different depending on the architecture,
> I prefer to not make such kind of changes in a MISRA-related patch.

What do you mean by "depending on the architecture", when this is
x86-only code _and_ you can check what type parameter the called
function has?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 16:29:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 16:29:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559955.875424 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHRqh-0004fW-Pd; Thu, 06 Jul 2023 16:28:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559955.875424; Thu, 06 Jul 2023 16:28:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHRqh-0004fP-MA; Thu, 06 Jul 2023 16:28:55 +0000
Received: by outflank-mailman (input) for mailman id 559955;
 Thu, 06 Jul 2023 16:28:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=TRuO=CY=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1qHRqg-0004fJ-Pl
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 16:28:54 +0000
Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com
 [2a00:1450:4864:20::330])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 32553325-1c1a-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 18:28:53 +0200 (CEST)
Received: by mail-wm1-x330.google.com with SMTP id
 5b1f17b1804b1-3fbc1218262so10103845e9.3
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 09:28:53 -0700 (PDT)
Received: from [10.95.131.194] (54-240-197-233.amazon.com. [54.240.197.233])
 by smtp.gmail.com with ESMTPSA id
 n10-20020a1c720a000000b003f733c1129fsm797wmc.33.2023.07.06.09.28.52
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 06 Jul 2023 09:28:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 32553325-1c1a-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688660933; x=1691252933;
        h=content-transfer-encoding:in-reply-to:organization:references:cc:to
         :content-language:subject:reply-to:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=3Nrzaoz+rsxVgQTd6TxexIuCRlSLkofQwGuRUpX9fTY=;
        b=lRE5ncMMCLuhjZR7WCD9aIRabbtkx72rnve+GOLxtTjFVgCmhjIjI1BAyFoegY0t6+
         PRFrrxdVjaFL3OLdaNmXR16w786N8MHGmcm+MVOoZMMjs5GKyfOF7sP5DClmcmwAsSAK
         0wzjGoSKnIHCBGRAmu+3uOt8aK5g6xWX0lxQof+d4tKxb+P+1RFJE5DOp2fjpqZ7lucF
         fZf9ukLA0CS1JZaSzCMIoRL1X/6334t/BCvebW/LS0c+2fwJV4oVzQ7jRjickoReikRX
         z5CSX5skhwsPzo/LUkGGZ9Dnntgbp2CX2XjBLynF5Kon+6KTS1ecJO63B3Ap+TTfsMBZ
         SWWQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688660933; x=1691252933;
        h=content-transfer-encoding:in-reply-to:organization:references:cc:to
         :content-language:subject:reply-to:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=3Nrzaoz+rsxVgQTd6TxexIuCRlSLkofQwGuRUpX9fTY=;
        b=LdR52mEEsgvTP5qe4CjdR7fs5IB0sQnCK35ZoD6YqBfstOvvPDSquJLCiZ2NPTgUma
         2pUQXDEIdnbwVaJ2k5Ota1VoDVXonwi/ZDRTXpmv3EoQBEuNn/sh1tlFHB436i9sPCSM
         zg24Gk8CUknGrFNdwoJocyJO4oIP2wT+5Tt22iIOwa1DkULp/pf8msdGIsh8elW8Jwkj
         Eriyup2gd+edvdlAzvRfab8+d4XQ//Gl4NT8Y5JB+RXGv3rCmNyGu/4mKvYzB8J40quD
         hEzv9IFFBtOWWHcXEiK0WlYzg+axGaXT7RpcOZYrw0d8wd9Mwzf1P5qa5Oj0mEBJZoD1
         1OUQ==
X-Gm-Message-State: ABy/qLYDKbq023LpCLyULFtxaXckMwdQqooTQYkcL+1ajnFda+Hytvq3
	1LjyHe9qbB+cTCPeDrlZsFw=
X-Google-Smtp-Source: APBJJlGWcxJJF03lZm81+ayN8BYKTAHsb1a6gRv3FRByPiONZ3DSvT07hsvUipV0f0QybLNHfc56Dg==
X-Received: by 2002:a05:600c:2055:b0:3f7:4961:52ad with SMTP id p21-20020a05600c205500b003f7496152admr1975126wmg.3.1688660932849;
        Thu, 06 Jul 2023 09:28:52 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <c1d5ff39-2e2a-d863-7de5-7092e559c344@xen.org>
Date: Thu, 6 Jul 2023 17:28:51 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Reply-To: paul@xen.org
Subject: Re: [PATCH] xen-block: Avoid leaks on new error path
Content-Language: en-US
To: Anthony PERARD <anthony.perard@citrix.com>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Kevin Wolf <kwolf@redhat.com>,
 Hanna Reitz <hreitz@redhat.com>, xen-devel@lists.xenproject.org,
 qemu-block@nongnu.org
References: <20230704171819.42564-1-anthony.perard@citrix.com>
Organization: Xen Project
In-Reply-To: <20230704171819.42564-1-anthony.perard@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 04/07/2023 18:18, Anthony PERARD wrote:
> From: Anthony PERARD <anthony.perard@citrix.com>
> 
> Commit 189829399070 ("xen-block: Use specific blockdev driver")
> introduced a new error path, without taking care of allocated
> resources.
> 
> So only allocate the qdicts after the error check, and free both
> `filename` and `driver` when we are about to return and thus taking
> care of both success and error path.
> 
> Coverity only spotted the leak of qdicts (*_layer variables).
> 
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Fixes: Coverity CID 1508722, 1398649
> Fixes: 189829399070 ("xen-block: Use specific blockdev driver")
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
>   hw/block/xen-block.c | 11 ++++++-----
>   1 file changed, 6 insertions(+), 5 deletions(-)
> 

Reviewed-by: Paul Durrant <paul@xen.org>



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 17:09:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 17:09:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559959.875434 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHSTD-0000j2-Ic; Thu, 06 Jul 2023 17:08:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559959.875434; Thu, 06 Jul 2023 17:08:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHSTD-0000iv-G8; Thu, 06 Jul 2023 17:08:43 +0000
Received: by outflank-mailman (input) for mailman id 559959;
 Thu, 06 Jul 2023 17:08:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHSTC-0000il-AN; Thu, 06 Jul 2023 17:08:42 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHSTC-0007Z0-4A; Thu, 06 Jul 2023 17:08:42 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHSTB-0005W2-Ra; Thu, 06 Jul 2023 17:08:41 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qHSTB-0004gt-R4; Thu, 06 Jul 2023 17:08:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=sErIAHjMjy8D/rT6ZI0D8U9AnRHgvkkeQDTKhsl8oQs=; b=x8LEg7H4zs0GwqM90X+3DhPs7M
	7wt5lp7izqUwqMytp7Vo/H6om7VS12UCBcyZRAQay6g91BI47pO9s7t9bfo9h5CYTE7tXaiUZNdam
	emH40FIUX7/DTY214wAwls5nxE7GcplvgbxKwLbF68Bg2Mvgdk/1Yah3uZedt3Ij5CwE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181717-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 181717: tolerable FAIL - PUSHED
X-Osstest-Failures:
    libvirt:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=00cd7d2b1a9bd5a0d2f7555b7f54a6197af3c00f
X-Osstest-Versions-That:
    libvirt=cd4bdcb8cf5bad7ea9884d66de9a6f2e654a5f7d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 06 Jul 2023 17:08:41 +0000

flight 181717 libvirt real [real]
flight 181723 libvirt real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181717/
http://logs.test-lab.xenproject.org/osstest/logs/181723/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail pass in 181723-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181691
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181691
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181691
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 libvirt              00cd7d2b1a9bd5a0d2f7555b7f54a6197af3c00f
baseline version:
 libvirt              cd4bdcb8cf5bad7ea9884d66de9a6f2e654a5f7d

Last test of basis   181691  2023-07-04 04:20:28 Z    2 days
Testing same since   181717  2023-07-06 04:18:48 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Temuri Doghonadze <temuri.doghonadze@gmail.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-libvirt-vhd                                 fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   cd4bdcb8cf..00cd7d2b1a  00cd7d2b1a9bd5a0d2f7555b7f54a6197af3c00f -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 18:24:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 18:24:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559965.875445 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHTe7-0000WX-Jr; Thu, 06 Jul 2023 18:24:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559965.875445; Thu, 06 Jul 2023 18:24:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHTe7-0000WQ-Fu; Thu, 06 Jul 2023 18:24:03 +0000
Received: by outflank-mailman (input) for mailman id 559965;
 Thu, 06 Jul 2023 18:24:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHTe6-0000WG-Ko; Thu, 06 Jul 2023 18:24:02 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHTe6-00013K-GG; Thu, 06 Jul 2023 18:24:02 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHTe6-0007O0-8y; Thu, 06 Jul 2023 18:24:02 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qHTe6-0002w1-8X; Thu, 06 Jul 2023 18:24:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=BiE6lVpoVbFr2GzD1z2/dM8gHyiq5W4BSEZ9RtOPxrQ=; b=Web3B4j1RML3a4z6N3RvOYr0rF
	g7gdrdOKxD8t1MzgEBmFz5w1WTb00WBRcKGeCNTuVlHIvkxYtrJQbps8Y/MYLMGLbf4bMKXl0X1Q4
	LiZwnYCIlaOo4Rmoh0/F94VnuwtVz+x4iyXd1diInLEsMHZemRzNLVe/d5APyuKbr8OU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181724-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181724: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=96d691166f07b7ed422f9536832edadc0aea35c9
X-Osstest-Versions-That:
    ovmf=60475162a66a73426cd971174bb3cd853a4619cf
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 06 Jul 2023 18:24:02 +0000

flight 181724 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181724/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 96d691166f07b7ed422f9536832edadc0aea35c9
baseline version:
 ovmf                 60475162a66a73426cd971174bb3cd853a4619cf

Last test of basis   181722  2023-07-06 13:42:14 Z    0 days
Testing same since   181724  2023-07-06 16:42:07 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Nickle Wang <nicklew@nvidia.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   60475162a6..96d691166f  96d691166f07b7ed422f9536832edadc0aea35c9 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 18:55:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 18:55:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559971.875455 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8R-0003xL-Vr; Thu, 06 Jul 2023 18:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559971.875455; Thu, 06 Jul 2023 18:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8R-0003xE-St; Thu, 06 Jul 2023 18:55:23 +0000
Received: by outflank-mailman (input) for mailman id 559971;
 Thu, 06 Jul 2023 18:55:22 +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
 <SRS0=zM/b=CY=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qHU8Q-0003x0-Gy
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 18:55:22 +0000
Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com
 [2607:f8b0:4864:20::f34])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a601fbbd-1c2e-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 20:55:18 +0200 (CEST)
Received: by mail-qv1-xf34.google.com with SMTP id
 6a1803df08f44-6348a8045a2so7444386d6.1
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 11:55:18 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 g25-20020ae9e119000000b0075b168fcde9sm1015297qkm.77.2023.07.06.11.55.14
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 06 Jul 2023 11:55:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a601fbbd-1c2e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688669716; x=1691261716;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=AYmV7VY5SmyvTbfm36064tISmAIn1NHXX4PfvnHonn8=;
        b=FfvHqcW4AR36cQNtwpptveK4316yocjuuLz6TctRFt38TtGvemm+oSl958cKnE184N
         rXx+vHeMMqeu+fPPwOxiHjU7R08DiovBhsV4XauoJXpEP7p0oGxTbEPlQpFBpU0VI8jr
         eS5XX83C0n1BKe4zB6kYKxNyYrzDntvMQYrxnWl9gVXGvKkCn/3mBRSc5gcIVy13tS3b
         Bqqly537INjEV0aPWMkhSePX8EgkqAloY/t+0P1grhQepE2VMa4je4EBZOqHVO6jkG7t
         ILiaSbiQa9ym+d7dLMABtBHViP37ULC8CNfmF6wht9C+2/IGWVxyOj22/WDWK67iJ3IX
         PbJQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688669716; x=1691261716;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=AYmV7VY5SmyvTbfm36064tISmAIn1NHXX4PfvnHonn8=;
        b=l/MwdnKnMl/nD8swaeIByvUZpXvzQaY38aIs+Pmsi6h2EJiOSGasgRh9OBCpYFcMgu
         TzabDX+Rc22XJCnC/+CHU35bBfOLKyQmxAWusNTy9PCTpzuHv++IClWSE98/iHTDiGze
         nv1S1buA4BMd9bJVAFKy0wMUJ+taAIGLRMLK36d0KDTP71wOPv9UsfEsz1HqXIGxUvUX
         7oHP70VcE5bsX7I+Cyn2YoBTpN076Fcfa2vgneqmOTKE6i2nV1OR5Xe3KQaCLMcjm0Qu
         U5NDnM+A5w0WxzeYFQ1PMzUDFcAPcOjudA89r+VkocD3qUyb/jiDme0Vj9HR8O8cIVZC
         AVCg==
X-Gm-Message-State: ABy/qLZcMmhVhNQI3oOg1pLlXmK2RwBw4LdOeqApsNP2V5+H/SOE4X0S
	7Zh6pD4yLqGBsUHh35VtGDYt9ZCM6bw=
X-Google-Smtp-Source: APBJJlFUVxBpb3x7L13HT45CQuTTGvUcKl/PSHIo7xovOVFHdbRjAFcmjKkAd7nVsvCMiHJ5RH5KxQ==
X-Received: by 2002:a0c:de13:0:b0:637:8c63:6c5 with SMTP id t19-20020a0cde13000000b006378c6306c5mr2368193qvk.64.1688669716289;
        Thu, 06 Jul 2023 11:55:16 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Henry Wang <Henry.Wang@arm.com>,
	Community Manager <community.manager@xenproject.org>
Subject: [PATCH v5 00/15] Intel Hardware P-States (HWP) support
Date: Thu,  6 Jul 2023 14:54:25 -0400
Message-ID: <20230706185440.48333-1-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Hi,

This patch series adds Hardware-Controlled Performance States (HWP) for
Intel processors to Xen.

v2 was only partially reviewed, so v3 is mostly a reposting of v2.  In v2 &
v3, I think I addressed all comments for v1.  I kept patch 11 "xenpm:
Factor out a non-fatal cpuid_parse variant", with a v2 comment
explaining why I keep it.

v3 adds "xen/x86: Tweak PDC bits when using HWP".  Qubes testing revealed
an issue where enabling HWP can crash firwmare code (maybe SMM).  This
requires a Linux change to get the PDC bits from Xen and pass them to
ACPI.  Roger has a patch [0] to set the PDC bits.  Roger's 3 patch
series was tested with "xen/x86: Tweak PDC bits when using HWP" on
affected hardware and allowed proper operation.

v4:
There is a large amount or renaming from HWP/hwp to CPPC/cppc in the series.
The driver remains hwp_ prefixed since it is dealing with the hardware
interface.  The sysctl, xc and xenpm interfaces were renamed to cppc to
be the generic ACPI CPPC (Collaborative Processor Performance Control)
interface.

struct xen_get_cpufreq_para was re-organized in a binary compatible
fashion to nest scaling governor options.  This allows the cppc support
to use uint32_t's for its parameters.

HWP is now enabled with a top-level cpufreq=hwp option.  It will
fallback to cpufreq=xen if hwp is unavailable.  This seems like the most
user-friendly option.  Since the user was trying to specify *some*
cpufreq, we should give them the best that we can instead of disabling
the functionality.

"xenpm: Factor out a non-fatal cpuid_parse variant" was dropped.
set-cpufreq-cppc expects either a cpu number or none specified, which
implies all.

Some patches were re-arrange - "xen/x86: Tweak PDC bits when using HWP"
now comes immediately after "cpufreq: Add Hardware P-State (HWP) driver"

The implementation of "cpufreq: Allow restricting to internal governors
only " changed, so I removed Jan's Ack.

v5:
HWP is enabled with a toplevel cpufreq=hwp option.  There is no fallback
by default, but a cpufreq=hwp;xen syntax is now supported.  That tries
hwp first.  If HWP registration is unsuccessful, then xen registration
is performed as a fallback.

More changes from Jan's feedback.  They are typically minor and
documented in individual patches.

Previous cover letter:

With HWP, the processor makes its own determinations for frequency
selection, though users can set some parameters and preferences.  There
is also Turbo Boost which dynamically pushes the max frequency if
possible.

The existing governors don't work with HWP since they select frequencies
and HWP doesn't expose those.  Therefore a dummy hwp-interal governor is
used that doesn't do anything.

xenpm get-cpufreq-para is extended to show HWP parameters, and
set-cpufreq-cppc is added to set them.

A lightly loaded OpenXT laptop showed ~1W power savings according to
powertop.  A mostly idle Fedora system (dom0 only) showed a more modest
power savings.

This is for a 10th gen 6-core 1600 MHz base 4900 MHZ max cpu.  In the
default balance mode, Turbo Boost doesn't exceed 4GHz.  Tweaking the
energy_perf preference with `xenpm set-cpufreq-para balance ene:64`,
I've seen the CPU hit 4.7GHz before throttling down and bouncing around
between 4.3 and 4.5 GHz.  Curiously the other cores read ~4GHz when
turbo boost takes affect.  This was done after pinning all dom0 cores,
and using taskset to pin to vCPU/pCPU 11 and running a bash tightloop.

HWP defaults to disabled and running with the existing HWP configuration
- it doesn't reconfigure by default.  It can be enabled with
cpufreq=hwp.

Hardware Duty Cycling (HDC) is another feature to autonomously powerdown
things.  It defaults to enabled when HWP is enabled, but HDC can be
disabled on the command line.  cpufreq=xen:hwp,no-hdc

I've only tested on 8th gen and 10th gen systems with activity window
and energy_perf support.  So the pathes for CPUs lacking those features
are untested.

Fast MSR support was removed in v2.  The model specific checking was not
done properly, and I don't have hardware to test with.  Since writes are
expected to be infrequent, I just removed the code.

This changes the systcl_pm_op hypercall, so that wants review.

Regards,
Jason

[0] https://lore.kernel.org/xen-devel/20221121102113.41893-3-roger.pau@citrix.com/

Jason Andryuk (15):
  cpufreq: Allow restricting to internal governors only
  cpufreq: Add perf_freq to cpuinfo
  cpufreq: Export intel_feature_detect
  xen/sysctl: Nest cpufreq scaling options
  pmstat&xenpm: Re-arrage for cpufreq union
  cpufreq: Add Hardware P-State (HWP) driver
  xen/x86: Tweak PDC bits when using HWP
  xenpm: Change get-cpufreq-para output for hwp
  cpufreq: Export HWP parameters to userspace as CPPC
  libxc: Include cppc_para in definitions
  xenpm: Print HWP/CPPC parameters
  xen: Add SET_CPUFREQ_HWP xen_sysctl_pm_op
  libxc: Add xc_set_cpufreq_cppc
  xenpm: Add set-cpufreq-cppc subcommand
  CHANGELOG: Add Intel HWP entry

 CHANGELOG.md                                 |   2 +-
 docs/misc/xen-command-line.pandoc            |  18 +-
 tools/include/xenctrl.h                      |  28 +-
 tools/libs/ctrl/xc_pm.c                      |  42 +-
 tools/misc/xenpm.c                           | 392 +++++++++--
 xen/arch/x86/acpi/cpufreq/Makefile           |   1 +
 xen/arch/x86/acpi/cpufreq/cpufreq.c          |  29 +-
 xen/arch/x86/acpi/cpufreq/hwp.c              | 646 +++++++++++++++++++
 xen/arch/x86/acpi/lib.c                      |   5 +
 xen/arch/x86/cpu/mcheck/mce_intel.c          |   6 +
 xen/arch/x86/include/asm/cpufeature.h        |  12 +-
 xen/arch/x86/include/asm/msr-index.h         |  16 +-
 xen/drivers/acpi/pmstat.c                    | 100 +--
 xen/drivers/cpufreq/cpufreq.c                |  56 +-
 xen/drivers/cpufreq/cpufreq_misc_governors.c |   9 +
 xen/drivers/cpufreq/cpufreq_ondemand.c       |   3 +
 xen/drivers/cpufreq/utility.c                |   1 +
 xen/include/acpi/cpufreq/cpufreq.h           |  21 +
 xen/include/acpi/pdc_intel.h                 |   1 +
 xen/include/public/sysctl.h                  | 144 ++++-
 20 files changed, 1411 insertions(+), 121 deletions(-)
 create mode 100644 xen/arch/x86/acpi/cpufreq/hwp.c

-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 18:55:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 18:55:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559973.875474 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8W-0004Si-J5; Thu, 06 Jul 2023 18:55:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559973.875474; Thu, 06 Jul 2023 18:55:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8W-0004Sb-Fg; Thu, 06 Jul 2023 18:55:28 +0000
Received: by outflank-mailman (input) for mailman id 559973;
 Thu, 06 Jul 2023 18:55:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zM/b=CY=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qHU8U-0003x8-Ke
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 18:55:26 +0000
Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com
 [2607:f8b0:4864:20::72a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id aac4751e-1c2e-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 20:55:26 +0200 (CEST)
Received: by mail-qk1-x72a.google.com with SMTP id
 af79cd13be357-76547539775so89981585a.3
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 11:55:26 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 g25-20020ae9e119000000b0075b168fcde9sm1015297qkm.77.2023.07.06.11.55.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 06 Jul 2023 11:55:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aac4751e-1c2e-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688669724; x=1691261724;
        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=tj29XCVclI+6QGR1ahwKo+P0a4dIzt4OqPyhJ7hCJ/k=;
        b=I1SPNwYIsNcJaeKqpP8Szu9Rn6t5Ki5A+Wcsw8iP53+wPocHBK6kXk/NXUU6+Y3kZl
         XSKL4B8pXdtLDQDraW3F4lKQQj9PxOffPmlJdNJYXSMXUxh07akGHDLOHLlON0hLE9MQ
         fStBFou2G9J/MEL834kcFlovwnGDb4r0aGTJVys3YKu73k3MQ4SdZAUYdSovgyPfmc2c
         7015i/qRtUuxIYh8W+AobYamyLTKDc4Hxg43Jz/1PMZXvBgzihlIbAKaWCsyZjKuZdl8
         8DDPHVEHciBRy4PgFlwojRpQ0PvvaP9q+K6BjrxN7BxIXkZmv7aiZK830HFGzJ0KSG6E
         Q/7g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688669724; x=1691261724;
        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=tj29XCVclI+6QGR1ahwKo+P0a4dIzt4OqPyhJ7hCJ/k=;
        b=D78Lk0J9+ymqcqZOFp2kaTAZAWqQ+PALLv5He47bRgoaGWnVqEnIhUMfE69KcKMBIj
         hHqLqfyYrk1FINS/aop3DmNXZlz5wD5c+OIr8IuKrwXcIG5ZPakEqskwuJtKUFRl5OXc
         i+amhED97uQe+bvsluLgB2gHSqoPtS7KgzqrTWTfqJGMaN4WvPyqtXvzYSqWG338ylsd
         GdoTX8OUBv2hci3H6TKO7z8jWApIWuxyVhu+YUk2FQILrykagl8woWTiaCsF9wNjJaPh
         gFvgDtgELCogLc7/pxXmAx5x+ZYhKYp+KlwSQ3DhzCPgvcbeYAZ1NZBQb1DzDEKrWu8L
         Jj+w==
X-Gm-Message-State: ABy/qLYgzM3/Ee6bkRZcnAyJrU6c9nUtw+KkILng3nvEm+h0tf9OBGbZ
	n6bvIeO6yKpRhckc/HKnJdYbszXdCUc=
X-Google-Smtp-Source: APBJJlFUXhr4+jOWe6Boh7rUmyu5qDPto/0X2MBL7ciO/vPRWZsplRaYMm5FH2hjBeaZs4ZMIYpHjA==
X-Received: by 2002:a0c:f0d3:0:b0:61b:79ab:7129 with SMTP id d19-20020a0cf0d3000000b0061b79ab7129mr2390557qvl.37.1688669724311;
        Thu, 06 Jul 2023 11:55:24 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v5 02/15] cpufreq: Add perf_freq to cpuinfo
Date: Thu,  6 Jul 2023 14:54:27 -0400
Message-ID: <20230706185440.48333-3-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230706185440.48333-1-jandryuk@gmail.com>
References: <20230706185440.48333-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

acpi-cpufreq scales the aperf/mperf measurements by max_freq, but HWP
needs to scale by base frequency.  Settings max_freq to base_freq
"works" but the code is not obvious, and returning values to userspace
is tricky.  Add an additonal perf_freq member which is used for scaling
aperf/mperf measurements.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v3:
Add Jan's Ack

I don't like this, but it seems the best way to re-use the common
aperf/mperf code.  The other option would be to add wrappers that then
do the acpi vs. hwp scaling.
---
 xen/arch/x86/acpi/cpufreq/cpufreq.c | 2 +-
 xen/drivers/cpufreq/utility.c       | 1 +
 xen/include/acpi/cpufreq/cpufreq.h  | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index 2e0067fbe5..6c70d04395 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -316,7 +316,7 @@ unsigned int get_measured_perf(unsigned int cpu, unsigned int flag)
     else
         perf_percent = 0;
 
-    return policy->cpuinfo.max_freq * perf_percent / 100;
+    return policy->cpuinfo.perf_freq * perf_percent / 100;
 }
 
 static unsigned int cf_check get_cur_freq_on_cpu(unsigned int cpu)
diff --git a/xen/drivers/cpufreq/utility.c b/xen/drivers/cpufreq/utility.c
index 9eb7ecedcd..6831f62851 100644
--- a/xen/drivers/cpufreq/utility.c
+++ b/xen/drivers/cpufreq/utility.c
@@ -236,6 +236,7 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
 
     policy->min = policy->cpuinfo.min_freq = min_freq;
     policy->max = policy->cpuinfo.max_freq = max_freq;
+    policy->cpuinfo.perf_freq = max_freq;
     policy->cpuinfo.second_max_freq = second_max_freq;
 
     if (policy->min == ~0)
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 44fc4c58fc..1f1898d811 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -37,6 +37,9 @@ extern struct acpi_cpufreq_data *cpufreq_drv_data[NR_CPUS];
 struct cpufreq_cpuinfo {
     unsigned int        max_freq;
     unsigned int        second_max_freq;    /* P1 if Turbo Mode is on */
+    unsigned int        perf_freq; /* Scaling freq for aperf/mpref.
+                                      acpi-cpufreq uses max_freq, but HWP uses
+                                      base_freq.*/
     unsigned int        min_freq;
     unsigned int        transition_latency; /* in 10^(-9) s = nanoseconds */
 };
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 18:55:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 18:55:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559972.875459 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8S-0003z8-77; Thu, 06 Jul 2023 18:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559972.875459; Thu, 06 Jul 2023 18:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8S-0003ys-2w; Thu, 06 Jul 2023 18:55:24 +0000
Received: by outflank-mailman (input) for mailman id 559972;
 Thu, 06 Jul 2023 18:55:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zM/b=CY=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qHU8R-0003x8-AF
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 18:55:23 +0000
Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com
 [2607:f8b0:4864:20::736])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a87189a5-1c2e-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 20:55:22 +0200 (CEST)
Received: by mail-qk1-x736.google.com with SMTP id
 af79cd13be357-765942d497fso104741085a.1
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 11:55:22 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 g25-20020ae9e119000000b0075b168fcde9sm1015297qkm.77.2023.07.06.11.55.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 06 Jul 2023 11:55:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a87189a5-1c2e-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688669720; x=1691261720;
        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=aycMLLTtkVhp4cOSefmKjKietLSeza3V+cbVoUfTbl0=;
        b=D+TZYy4fGZjGy+FgIRROffkomu3McxJniQxK3velbReBOlt8VFQBxbK3RJVUxGXQvK
         +rkIr6De7801ozYjBB2wk9nNVicLZvTZztYV1CYRRy7qq2URpQxQRcaSmdIdD6Dux/TH
         xtd2XwrYmO62EAi776URy3ZBKEKENf06rx5hkGE9KqLpDQPeTqeNjHXTzZOh3zFtirZp
         l5f0hM4YHvWKyThFjUO2mySlRIoVt2XfCFpInaYrVbtq1X8z35NPRvWCbvq5J9l/JwVM
         vhBQEq+yYxMykHmc7rjXEhZW+2QqSWOKh2gXLSH9D7wkYonXEObD9lziVR0l+Pd8MEfU
         abLQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688669720; x=1691261720;
        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=aycMLLTtkVhp4cOSefmKjKietLSeza3V+cbVoUfTbl0=;
        b=coHIa4zCnuOiu7aGY2mwXIBttAdIMT05Ssq1d7a/4xKtWpk3ypYQmkBkd6VCwd3u/B
         HUx6Ry9bQqByC5q+49rkGuDOMuTl4SgD9jTeU13grmtN1UIyRVMbP2z9xIHUdQWeFLza
         xQ60JAPBJDDLb0ENDrHf+in2Iv1qX5WiuvE4SnWl3WwyzZGX2G7TATDGOKdVeRneiqtY
         Tvhy4nso4XuHQsAdQYdij9qLlM9pio1XNoVDvdE6kHdWZDbs8h++elvttuMDwy3T1JCw
         26BJLgGjxps2C9u5fwUmCMrlhN2LL/HHEqyOJn5OBLJzfawTtzfY5J8BmVdLcRZeWic6
         Pdfg==
X-Gm-Message-State: ABy/qLbQGMVmaE48l0JIiaGR1Frl9it6ZeFaod5+jXDPKKgVxbvVRGq4
	M5crcLVwusiEvJuAbaXm9StVkCMqEVs=
X-Google-Smtp-Source: APBJJlGKcaPEkc/C3x40sAt6Ntk1OpgdIHGddjk8juPw606QxSOs0aUq+cBfTaSdai/79xgKFr9x2g==
X-Received: by 2002:a05:620a:24cf:b0:767:4057:1d6d with SMTP id m15-20020a05620a24cf00b0076740571d6dmr3131937qkn.62.1688669720445;
        Thu, 06 Jul 2023 11:55:20 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v5 01/15] cpufreq: Allow restricting to internal governors only
Date: Thu,  6 Jul 2023 14:54:26 -0400
Message-ID: <20230706185440.48333-2-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230706185440.48333-1-jandryuk@gmail.com>
References: <20230706185440.48333-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

For hwp, the standard governors are not usable, and only the internal
one is applicable.  Add the cpufreq_governor_internal boolean to
indicate when an internal governor, like hwp, will be used.  This is set
during presmp_initcall, and governor registration can be skipped when
called during initcall.

This way unusable governors are not registered, and only compatible
governors are advertised to userspace.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
v5:
Check cpufreq_governor_internal and skip registration as applicable
Remove internal flag

v4:
Rework to use an internal flag
Removed Jan's Ack since the approach is different.

v3:
Switch to initdata
Add Jan Acked-by
Commit message s/they/the/ typo
Don't register hwp-internal when running non-hwp - Marek

v2:
Switch to "-internal"
Add blank line in header
---
 xen/drivers/cpufreq/cpufreq.c                | 1 +
 xen/drivers/cpufreq/cpufreq_misc_governors.c | 9 +++++++++
 xen/drivers/cpufreq/cpufreq_ondemand.c       | 3 +++
 xen/include/acpi/cpufreq/cpufreq.h           | 2 ++
 4 files changed, 15 insertions(+)

diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 2321c7dd07..67a58d409b 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -56,6 +56,7 @@ struct cpufreq_dom {
 };
 static LIST_HEAD_READ_MOSTLY(cpufreq_dom_list_head);
 
+bool __initdata cpufreq_governor_internal;
 struct cpufreq_governor *__read_mostly cpufreq_opt_governor;
 LIST_HEAD_READ_MOSTLY(cpufreq_governor_list);
 
diff --git a/xen/drivers/cpufreq/cpufreq_misc_governors.c b/xen/drivers/cpufreq/cpufreq_misc_governors.c
index f5571f5486..0327fad23b 100644
--- a/xen/drivers/cpufreq/cpufreq_misc_governors.c
+++ b/xen/drivers/cpufreq/cpufreq_misc_governors.c
@@ -120,6 +120,9 @@ static int __init cf_check cpufreq_gov_userspace_init(void)
 {
     unsigned int cpu;
 
+    if ( cpufreq_governor_internal )
+        return 0;
+
     for_each_online_cpu(cpu)
         per_cpu(cpu_set_freq, cpu) = userspace_cmdline_freq;
     register_cpu_notifier(&cpufreq_userspace_cpu_nfb);
@@ -162,6 +165,9 @@ struct cpufreq_governor cpufreq_gov_performance = {
 
 static int __init cf_check cpufreq_gov_performance_init(void)
 {
+    if ( cpufreq_governor_internal )
+        return 0;
+
     return cpufreq_register_governor(&cpufreq_gov_performance);
 }
 __initcall(cpufreq_gov_performance_init);
@@ -201,6 +207,9 @@ struct cpufreq_governor cpufreq_gov_powersave = {
 
 static int __init cf_check cpufreq_gov_powersave_init(void)
 {
+    if ( cpufreq_governor_internal )
+        return 0;
+
     return cpufreq_register_governor(&cpufreq_gov_powersave);
 }
 __initcall(cpufreq_gov_powersave_init);
diff --git a/xen/drivers/cpufreq/cpufreq_ondemand.c b/xen/drivers/cpufreq/cpufreq_ondemand.c
index fbcd14d6c3..06cfc88d30 100644
--- a/xen/drivers/cpufreq/cpufreq_ondemand.c
+++ b/xen/drivers/cpufreq/cpufreq_ondemand.c
@@ -360,6 +360,9 @@ struct cpufreq_governor cpufreq_gov_dbs = {
 
 static int __init cf_check cpufreq_gov_dbs_init(void)
 {
+    if ( cpufreq_governor_internal )
+        return 0;
+
     return cpufreq_register_governor(&cpufreq_gov_dbs);
 }
 __initcall(cpufreq_gov_dbs_init);
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 35dcf21e8f..44fc4c58fc 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -116,6 +116,8 @@ extern struct cpufreq_governor cpufreq_gov_powersave;
 
 extern struct list_head cpufreq_governor_list;
 
+extern bool cpufreq_governor_internal;
+
 extern int cpufreq_register_governor(struct cpufreq_governor *governor);
 extern struct cpufreq_governor *__find_governor(const char *governor);
 #define CPUFREQ_DEFAULT_GOVERNOR &cpufreq_gov_dbs
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 18:55:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 18:55:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559975.875485 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8Z-0004lV-PB; Thu, 06 Jul 2023 18:55:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559975.875485; Thu, 06 Jul 2023 18:55:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8Z-0004lM-M7; Thu, 06 Jul 2023 18:55:31 +0000
Received: by outflank-mailman (input) for mailman id 559975;
 Thu, 06 Jul 2023 18:55:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zM/b=CY=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qHU8Y-0003x8-F6
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 18:55:30 +0000
Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com
 [2607:f8b0:4864:20::735])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ad123d90-1c2e-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 20:55:30 +0200 (CEST)
Received: by mail-qk1-x735.google.com with SMTP id
 af79cd13be357-7659db6339eso53385585a.1
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 11:55:29 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 g25-20020ae9e119000000b0075b168fcde9sm1015297qkm.77.2023.07.06.11.55.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 06 Jul 2023 11:55:27 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ad123d90-1c2e-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688669728; x=1691261728;
        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=6N7tHO/NpGPoNencisuqLlnFkoHrBAPddvPlzfIc1r8=;
        b=NAErraLZHKMB+GJUgJqMw+/SLS1MlY6VMy/Ns8TMxwjCB94CkN0sknUtBSveIV7i2/
         698ep9Tpi27mK7SXrhLbLPW8eUh4DqLtqk8iQAjfwC6H6sltzapXkShnU+kn3wCs9TWb
         0SCUxA87aa1Bv5aT7dlFn71gWe8+7dLk9aa999QkkmfLmUGYcDYy+dZYZptPeT/kykaz
         /X70g2HoY6u3sjcrD/IJ/kYNTJOBXOwIznr4C/5cgXp+JYi9+/XJgGF8OxqindvmKgvU
         Votvflon5IxRaPbheAm9hBXZFQ0f5DwyDy0pKP+C5opuFF6Lfupvoe2fT8KvpJigCxgm
         Ar7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688669728; x=1691261728;
        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=6N7tHO/NpGPoNencisuqLlnFkoHrBAPddvPlzfIc1r8=;
        b=VharDf88/mSD3s5q7kiKjX6VTuJaYnMkfWhF469gG/N7dD5XzM7Xhx7vXbahoqmZ7u
         2QSQp5f3h/Sc3Xx5ix2/VZ6HfX78dOTGouaGG2xj6w0rHSOcwOPFLBkePxRmFTK+kf/Y
         x6x/BsUrdSCS72mCU03/J0LMhcsipl6l9GHmIl0CuAkMdY8JFeXMlgF2R/D3fvo3eW7Z
         CCphyqN1O9H/Osl866LDdwbyMOQpZbGnLXelB+CMXrU2CIyDlrULnIVrnvOev21YCn7G
         eIJbWgK+2KWB+ZyjEjHZMXCY7CkAsgRio7JsnvtFENltlx1aKd+QCWoSkbxLSQnPatYL
         mnSg==
X-Gm-Message-State: ABy/qLYnRzotb40WbOWkl0KbWLTYbvowU1aBtc+sVw+ienK5FXu/ser5
	0DHfEfGdNkeS+UTR8hJoVfvAVf6o+IY=
X-Google-Smtp-Source: APBJJlFyWedTLrAyP45SfAWkp0UgcxFi5stN5rICTm6xaXdlZRTCY/n84qAugW9czA+NsPI4gx/8HA==
X-Received: by 2002:a05:620a:1a92:b0:760:6fcb:77db with SMTP id bl18-20020a05620a1a9200b007606fcb77dbmr3279121qkb.36.1688669728233;
        Thu, 06 Jul 2023 11:55:28 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v5 03/15] cpufreq: Export intel_feature_detect
Date: Thu,  6 Jul 2023 14:54:28 -0400
Message-ID: <20230706185440.48333-4-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230706185440.48333-1-jandryuk@gmail.com>
References: <20230706185440.48333-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Export feature_detect as intel_feature_detect so it can be re-used by
HWP.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v4:
Add Jan's Ack

v3:
Remove void * cast when calling intel_feature_detect

v2:
export intel_feature_detect with typed pointer
Move intel_feature_detect to acpi/cpufreq/cpufreq.h since the
declaration now contains struct cpufreq_policy *.
---
 xen/arch/x86/acpi/cpufreq/cpufreq.c | 8 ++++++--
 xen/include/acpi/cpufreq/cpufreq.h  | 2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index 6c70d04395..f1cc473b4f 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -339,9 +339,8 @@ static unsigned int cf_check get_cur_freq_on_cpu(unsigned int cpu)
     return extract_freq(get_cur_val(cpumask_of(cpu)), data);
 }
 
-static void cf_check feature_detect(void *info)
+void intel_feature_detect(struct cpufreq_policy *policy)
 {
-    struct cpufreq_policy *policy = info;
     unsigned int eax;
 
     eax = cpuid_eax(6);
@@ -353,6 +352,11 @@ static void cf_check feature_detect(void *info)
     }
 }
 
+static void cf_check feature_detect(void *info)
+{
+    intel_feature_detect(info);
+}
+
 static unsigned int check_freqs(const cpumask_t *mask, unsigned int freq,
                                 struct acpi_cpufreq_data *data)
 {
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 1f1898d811..482ea5b0de 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -243,4 +243,6 @@ int write_userspace_scaling_setspeed(unsigned int cpu, unsigned int freq);
 void cpufreq_dbs_timer_suspend(void);
 void cpufreq_dbs_timer_resume(void);
 
+void intel_feature_detect(struct cpufreq_policy *policy);
+
 #endif /* __XEN_CPUFREQ_PM_H__ */
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 18:55:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 18:55:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559976.875495 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8d-00054G-0K; Thu, 06 Jul 2023 18:55:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559976.875495; Thu, 06 Jul 2023 18:55:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8c-000543-TJ; Thu, 06 Jul 2023 18:55:34 +0000
Received: by outflank-mailman (input) for mailman id 559976;
 Thu, 06 Jul 2023 18:55:34 +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
 <SRS0=zM/b=CY=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qHU8c-0003x0-Fh
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 18:55:34 +0000
Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com
 [2607:f8b0:4864:20::72f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id aeb02015-1c2e-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 20:55:32 +0200 (CEST)
Received: by mail-qk1-x72f.google.com with SMTP id
 af79cd13be357-765a311a7a9so54225485a.0
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 11:55:32 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 g25-20020ae9e119000000b0075b168fcde9sm1015297qkm.77.2023.07.06.11.55.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 06 Jul 2023 11:55:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aeb02015-1c2e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688669731; x=1691261731;
        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=vdPPmSCUBtdPIby1qoYSPcEtoI4o/SgaXEEieAqfMj0=;
        b=sJaEGKppRJvId0tTZ9dcdExDZg9dma1jaGvEwvOmrRruRrcWy67hx0DvKg5Bb0rXvk
         AISoypginNLOBa8LcGgHDbAz1nBf0E14d1nOp2L6hO/rZAXRaYnEsgybSpSjgVivUHAk
         pSaqd9FyP9uIUZHnLAApw8E8o81FyqzOUNI0TrYQocoas1vPWrYEb0mLokcVpCFaiaWV
         M1WOtxsPVwMevyReDnphwFFN7boGlvJHDh0T56NZlW//O+hxx46GgI6Bm6OsNGX+cb1G
         m+B9L+G7rq03XPovXCzIdSeAOd9HwJPSl3cp/McPldvO0Fc0tYnLU6H07ine7wiMVHEG
         qHJA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688669731; x=1691261731;
        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=vdPPmSCUBtdPIby1qoYSPcEtoI4o/SgaXEEieAqfMj0=;
        b=j7YkN9P703UFkPZUrXujzZD9F8FFWtlcotwr2CNqlrfH+KfADlb3aua7HydtmpI/1k
         FJrAEM3j2/CEyizvbz77LwEDACe6BCX8NJSUo8x85UcD7VmI1vCUdZC2F+egj69jfAMa
         a11CHofV8F/rVCna4TXUJU2hlLjmcKC6ooj/ar7F8b35zDEE0XlsSOxjB4Fu1EuGrpPU
         LuJvppQovdpfO/epKVnBMPD5kibnJdjbdni1gtH6TmOtlAhew+Leo1HLGG6vp1c61o2x
         tUVJ99RF77hH4VegdM8cH0Fqda2Sq47CJHyA1/8Cj78H7yMZzos8lXMwbOmriiRELHQ5
         y+tA==
X-Gm-Message-State: ABy/qLaGIwV1lQOg5HYO5Nx1XhWgdf39xyEYizbCZvaMaY5nud3eF1NR
	1BAn/O+0Fpuv3DtWMIZzQbP55ScfHEk=
X-Google-Smtp-Source: APBJJlG7GISg3g5UMgbRMlJYffrQCdQ6cZ2B87wh6U1X1LPvTtb/U+R6Z2xFDQ13was/yle0x18w/Q==
X-Received: by 2002:a05:620a:199f:b0:75b:23a1:d847 with SMTP id bm31-20020a05620a199f00b0075b23a1d847mr6281003qkb.9.1688669730910;
        Thu, 06 Jul 2023 11:55:30 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 04/15] xen/sysctl: Nest cpufreq scaling options
Date: Thu,  6 Jul 2023 14:54:29 -0400
Message-ID: <20230706185440.48333-5-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230706185440.48333-1-jandryuk@gmail.com>
References: <20230706185440.48333-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add a union and struct so that most of the scaling variables of struct
xen_get_cpufreq_para are within in a binary-compatible layout.  This
allows cppc_para to live in the larger union and use uint32_ts - struct
xen_cppc_para will be 10 uint32_t's.

The new scaling struct is 3 * uint32_t + 16 bytes CPUFREQ_NAME_LEN + 4 *
uint32_t for xen_ondemand = 11 uint32_t.  That means the old size is
retained, int32_t turbo_enabled doesn't move and it's binary compatible.

The out-of-context memcpy() in xc_get_cpufreq_para() now handles the
copying of the fields removed there.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
v5:
Expand commit message
Change comment to driver/governor
---
 tools/include/xenctrl.h     | 22 +++++++++++++---------
 tools/libs/ctrl/xc_pm.c     |  7 +------
 tools/misc/xenpm.c          | 24 ++++++++++++------------
 xen/drivers/acpi/pmstat.c   | 27 ++++++++++++++-------------
 xen/include/public/sysctl.h | 22 +++++++++++++---------
 5 files changed, 53 insertions(+), 49 deletions(-)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index dba33d5d0f..8aedb952a0 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1909,16 +1909,20 @@ struct xc_get_cpufreq_para {
     uint32_t cpuinfo_cur_freq;
     uint32_t cpuinfo_max_freq;
     uint32_t cpuinfo_min_freq;
-    uint32_t scaling_cur_freq;
-
-    char scaling_governor[CPUFREQ_NAME_LEN];
-    uint32_t scaling_max_freq;
-    uint32_t scaling_min_freq;
-
-    /* for specific governor */
     union {
-        xc_userspace_t userspace;
-        xc_ondemand_t ondemand;
+        struct {
+            uint32_t scaling_cur_freq;
+
+            char scaling_governor[CPUFREQ_NAME_LEN];
+            uint32_t scaling_max_freq;
+            uint32_t scaling_min_freq;
+
+            /* for specific governor */
+            union {
+                xc_userspace_t userspace;
+                xc_ondemand_t ondemand;
+            } u;
+        } s;
     } u;
 
     int32_t turbo_enabled;
diff --git a/tools/libs/ctrl/xc_pm.c b/tools/libs/ctrl/xc_pm.c
index c3a9864bf7..6e751e242f 100644
--- a/tools/libs/ctrl/xc_pm.c
+++ b/tools/libs/ctrl/xc_pm.c
@@ -265,17 +265,12 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
         user_para->cpuinfo_cur_freq = sys_para->cpuinfo_cur_freq;
         user_para->cpuinfo_max_freq = sys_para->cpuinfo_max_freq;
         user_para->cpuinfo_min_freq = sys_para->cpuinfo_min_freq;
-        user_para->scaling_cur_freq = sys_para->scaling_cur_freq;
-        user_para->scaling_max_freq = sys_para->scaling_max_freq;
-        user_para->scaling_min_freq = sys_para->scaling_min_freq;
         user_para->turbo_enabled    = sys_para->turbo_enabled;
 
         memcpy(user_para->scaling_driver,
                 sys_para->scaling_driver, CPUFREQ_NAME_LEN);
-        memcpy(user_para->scaling_governor,
-                sys_para->scaling_governor, CPUFREQ_NAME_LEN);
 
-        /* copy to user_para no matter what cpufreq governor */
+        /* copy to user_para no matter what cpufreq driver/governor */
         BUILD_BUG_ON(sizeof(((struct xc_get_cpufreq_para *)0)->u) !=
 		     sizeof(((struct xen_get_cpufreq_para *)0)->u));
 
diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 1bb6187e56..ee8ce5d5f2 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -730,39 +730,39 @@ static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
     printf("scaling_avail_gov    : %s\n",
            p_cpufreq->scaling_available_governors);
 
-    printf("current_governor     : %s\n", p_cpufreq->scaling_governor);
-    if ( !strncmp(p_cpufreq->scaling_governor,
+    printf("current_governor     : %s\n", p_cpufreq->u.s.scaling_governor);
+    if ( !strncmp(p_cpufreq->u.s.scaling_governor,
                   "userspace", CPUFREQ_NAME_LEN) )
     {
         printf("  userspace specific :\n");
         printf("    scaling_setspeed : %u\n",
-               p_cpufreq->u.userspace.scaling_setspeed);
+               p_cpufreq->u.s.u.userspace.scaling_setspeed);
     }
-    else if ( !strncmp(p_cpufreq->scaling_governor,
+    else if ( !strncmp(p_cpufreq->u.s.scaling_governor,
                        "ondemand", CPUFREQ_NAME_LEN) )
     {
         printf("  ondemand specific  :\n");
         printf("    sampling_rate    : max [%u] min [%u] cur [%u]\n",
-               p_cpufreq->u.ondemand.sampling_rate_max,
-               p_cpufreq->u.ondemand.sampling_rate_min,
-               p_cpufreq->u.ondemand.sampling_rate);
+               p_cpufreq->u.s.u.ondemand.sampling_rate_max,
+               p_cpufreq->u.s.u.ondemand.sampling_rate_min,
+               p_cpufreq->u.s.u.ondemand.sampling_rate);
         printf("    up_threshold     : %u\n",
-               p_cpufreq->u.ondemand.up_threshold);
+               p_cpufreq->u.s.u.ondemand.up_threshold);
     }
 
     printf("scaling_avail_freq   :");
     for ( i = 0; i < p_cpufreq->freq_num; i++ )
         if ( p_cpufreq->scaling_available_frequencies[i] ==
-             p_cpufreq->scaling_cur_freq )
+             p_cpufreq->u.s.scaling_cur_freq )
             printf(" *%d", p_cpufreq->scaling_available_frequencies[i]);
         else
             printf(" %d", p_cpufreq->scaling_available_frequencies[i]);
     printf("\n");
 
     printf("scaling frequency    : max [%u] min [%u] cur [%u]\n",
-           p_cpufreq->scaling_max_freq,
-           p_cpufreq->scaling_min_freq,
-           p_cpufreq->scaling_cur_freq);
+           p_cpufreq->u.s.scaling_max_freq,
+           p_cpufreq->u.s.scaling_min_freq,
+           p_cpufreq->u.s.scaling_cur_freq);
 
     printf("turbo mode           : %s\n",
            p_cpufreq->turbo_enabled ? "enabled" : "disabled or n/a");
diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index 1bae635101..f5a9ac3f1a 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -258,37 +258,38 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
         cpufreq_driver.get ? cpufreq_driver.get(op->cpuid) : policy->cur;
     op->u.get_para.cpuinfo_max_freq = policy->cpuinfo.max_freq;
     op->u.get_para.cpuinfo_min_freq = policy->cpuinfo.min_freq;
-    op->u.get_para.scaling_cur_freq = policy->cur;
-    op->u.get_para.scaling_max_freq = policy->max;
-    op->u.get_para.scaling_min_freq = policy->min;
+
+    op->u.get_para.u.s.scaling_cur_freq = policy->cur;
+    op->u.get_para.u.s.scaling_max_freq = policy->max;
+    op->u.get_para.u.s.scaling_min_freq = policy->min;
 
     if ( cpufreq_driver.name[0] )
-        strlcpy(op->u.get_para.scaling_driver, 
+        strlcpy(op->u.get_para.scaling_driver,
             cpufreq_driver.name, CPUFREQ_NAME_LEN);
     else
         strlcpy(op->u.get_para.scaling_driver, "Unknown", CPUFREQ_NAME_LEN);
 
     if ( policy->governor->name[0] )
-        strlcpy(op->u.get_para.scaling_governor, 
+        strlcpy(op->u.get_para.u.s.scaling_governor,
             policy->governor->name, CPUFREQ_NAME_LEN);
     else
-        strlcpy(op->u.get_para.scaling_governor, "Unknown", CPUFREQ_NAME_LEN);
+        strlcpy(op->u.get_para.u.s.scaling_governor, "Unknown", CPUFREQ_NAME_LEN);
 
     /* governor specific para */
-    if ( !strncasecmp(op->u.get_para.scaling_governor,
+    if ( !strncasecmp(op->u.get_para.u.s.scaling_governor,
                       "userspace", CPUFREQ_NAME_LEN) )
     {
-        op->u.get_para.u.userspace.scaling_setspeed = policy->cur;
+        op->u.get_para.u.s.u.userspace.scaling_setspeed = policy->cur;
     }
 
-    if ( !strncasecmp(op->u.get_para.scaling_governor,
+    if ( !strncasecmp(op->u.get_para.u.s.scaling_governor,
                       "ondemand", CPUFREQ_NAME_LEN) )
     {
         ret = get_cpufreq_ondemand_para(
-            &op->u.get_para.u.ondemand.sampling_rate_max,
-            &op->u.get_para.u.ondemand.sampling_rate_min,
-            &op->u.get_para.u.ondemand.sampling_rate,
-            &op->u.get_para.u.ondemand.up_threshold);
+            &op->u.get_para.u.s.u.ondemand.sampling_rate_max,
+            &op->u.get_para.u.s.u.ondemand.sampling_rate_min,
+            &op->u.get_para.u.s.u.ondemand.sampling_rate,
+            &op->u.get_para.u.s.u.ondemand.up_threshold);
     }
     op->u.get_para.turbo_enabled = cpufreq_get_turbo_status(op->cpuid);
 
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 33e86ace51..b0028d3058 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -317,16 +317,20 @@ struct xen_get_cpufreq_para {
     uint32_t cpuinfo_cur_freq;
     uint32_t cpuinfo_max_freq;
     uint32_t cpuinfo_min_freq;
-    uint32_t scaling_cur_freq;
-
-    char scaling_governor[CPUFREQ_NAME_LEN];
-    uint32_t scaling_max_freq;
-    uint32_t scaling_min_freq;
-
-    /* for specific governor */
     union {
-        struct  xen_userspace userspace;
-        struct  xen_ondemand ondemand;
+        struct {
+            uint32_t scaling_cur_freq;
+
+            char scaling_governor[CPUFREQ_NAME_LEN];
+            uint32_t scaling_max_freq;
+            uint32_t scaling_min_freq;
+
+            /* for specific governor */
+            union {
+                struct  xen_userspace userspace;
+                struct  xen_ondemand ondemand;
+            } u;
+        } s;
     } u;
 
     int32_t turbo_enabled;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 18:55:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 18:55:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559977.875505 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8f-0005OV-AG; Thu, 06 Jul 2023 18:55:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559977.875505; Thu, 06 Jul 2023 18:55:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8f-0005OK-5S; Thu, 06 Jul 2023 18:55:37 +0000
Received: by outflank-mailman (input) for mailman id 559977;
 Thu, 06 Jul 2023 18:55:36 +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
 <SRS0=zM/b=CY=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qHU8e-0003x0-ED
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 18:55:36 +0000
Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com
 [2607:f8b0:4864:20::730])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id afeee0ff-1c2e-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 20:55:34 +0200 (CEST)
Received: by mail-qk1-x730.google.com with SMTP id
 af79cd13be357-7658752ce2fso90918985a.1
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 11:55:34 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 g25-20020ae9e119000000b0075b168fcde9sm1015297qkm.77.2023.07.06.11.55.32
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 06 Jul 2023 11:55:32 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: afeee0ff-1c2e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688669733; x=1691261733;
        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=d1trDvYrNW8WPrDTiUKj6xI03JCfHC/t+OXw0Nd9Uyw=;
        b=TpZmqRr4VVbFVOTvlwCSgIJfcGPcQuN3NHgunuhFoq5m4tBxo/JwS7hUuXsq8AqYEb
         QzQaabeZuIMQKT/iRUTzO1N1Zt6bmzIE3uO/BWyROwioWpWnggNgBqdyIZTqPc/5Itj7
         EWkQ72cNcLkfemPC+q/8T3+N50Ym4Yq7EkLDVAbXWZFYmVRD0uq84p6FlI9uoW1NEkwC
         3XkTlQUg3ojgBD+/+kJnOlZErP4SZsyFsFsX1g5cnOqQOidn8qzRvlaZuu80FjnA1iXE
         yCSAz4L9GMloW+aNNaxTA7VURw1Q/Vy3nYD6cMt2T9W26TuP3Ayrs4V3aGsNSdpGugK3
         YttA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688669733; x=1691261733;
        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=d1trDvYrNW8WPrDTiUKj6xI03JCfHC/t+OXw0Nd9Uyw=;
        b=Nn6wtefd3wfj0aI7tVHcTfm7uuja5UIg066JdmhiYXjLLNDw2GWHbrZNWtXaBmbgFJ
         xsYAgZwDSCmWhBW+Hht50w4r9MYn9RIlvF0EAvHSS2btqGp344e2EYZSab0xjlSChs9w
         hT4fsKQuzc7U7033QOuGxqKgOJ6NMiQ3OwAy1BHE1wcpylLIjHufVvMqbPeFIO6mbacK
         7ZW+ExbQwGMhtnMG+R7+d6mhJdlhEMi7pz3mcFlqy3zHRk/KQshU4NPQ/k6KiCyETwEn
         FjQ6J+SltzumYAOBuVNq2hPMkw+gJlF+VrTJJA4TreofBrLxyvvDtfAyVougTrC72Rmf
         ylBA==
X-Gm-Message-State: ABy/qLayb0sQA2arWLP9eRJScO7dGgFwR9XBILvxy7uBaQNuQWtJHL8F
	0sScwBgq/WEhSAyM5PYXxeU0XuoF4m0=
X-Google-Smtp-Source: APBJJlFJO7rcRaXr7mnXh6KtXYHkCJKp43TntAQcU5txu71wuK0OM+Sm2KokmciqoLI6/15dAW/N/A==
X-Received: by 2002:a05:620a:4446:b0:767:2021:4988 with SMTP id w6-20020a05620a444600b0076720214988mr3112643qkp.13.1688669733021;
        Thu, 06 Jul 2023 11:55:33 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v5 05/15] pmstat&xenpm: Re-arrage for cpufreq union
Date: Thu,  6 Jul 2023 14:54:30 -0400
Message-ID: <20230706185440.48333-6-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230706185440.48333-1-jandryuk@gmail.com>
References: <20230706185440.48333-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rearrange code now that xen_sysctl_pm_op's get_para fields has the
nested union and struct.  In particular, the scaling governor
information like scaling_available_governors is inside the union, so it
is not always available.  Move those fields (op->u.get_para.u.s.u.*)
together as well as the common fields (ones outside the union like
op->u.get_para.turbo_enabled).

With that, gov_num may be 0, so bounce buffer handling needs
to be modified.

scaling_governor and other fields inside op->u.get_para.u.s.u.* won't be
used for hwp, so this will simplify the change when hwp support is
introduced and re-indents these lines all together.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
v5:
Remove some formatting changes
Expand commit message
---
 tools/libs/ctrl/xc_pm.c   | 12 ++++++++----
 tools/misc/xenpm.c        |  3 ++-
 xen/drivers/acpi/pmstat.c | 24 ++++++++++++------------
 3 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/tools/libs/ctrl/xc_pm.c b/tools/libs/ctrl/xc_pm.c
index 6e751e242f..cea3eab22e 100644
--- a/tools/libs/ctrl/xc_pm.c
+++ b/tools/libs/ctrl/xc_pm.c
@@ -221,7 +221,7 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
     {
         if ( (!user_para->affected_cpus)                    ||
              (!user_para->scaling_available_frequencies)    ||
-             (!user_para->scaling_available_governors) )
+             (user_para->gov_num && !user_para->scaling_available_governors) )
         {
             errno = EINVAL;
             return -1;
@@ -230,12 +230,15 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
             goto unlock_1;
         if ( xc_hypercall_bounce_pre(xch, scaling_available_frequencies) )
             goto unlock_2;
-        if ( xc_hypercall_bounce_pre(xch, scaling_available_governors) )
+        if ( user_para->gov_num &&
+             xc_hypercall_bounce_pre(xch, scaling_available_governors) )
             goto unlock_3;
 
         set_xen_guest_handle(sys_para->affected_cpus, affected_cpus);
         set_xen_guest_handle(sys_para->scaling_available_frequencies, scaling_available_frequencies);
-        set_xen_guest_handle(sys_para->scaling_available_governors, scaling_available_governors);
+        if ( user_para->gov_num )
+            set_xen_guest_handle(sys_para->scaling_available_governors,
+                                 scaling_available_governors);
     }
 
     sysctl.cmd = XEN_SYSCTL_pm_op;
@@ -278,7 +281,8 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
     }
 
 unlock_4:
-    xc_hypercall_bounce_post(xch, scaling_available_governors);
+    if ( user_para->gov_num )
+        xc_hypercall_bounce_post(xch, scaling_available_governors);
 unlock_3:
     xc_hypercall_bounce_post(xch, scaling_available_frequencies);
 unlock_2:
diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index ee8ce5d5f2..1c474c3b59 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -811,7 +811,8 @@ static int show_cpufreq_para_by_cpuid(xc_interface *xc_handle, int cpuid)
             ret = -ENOMEM;
             goto out;
         }
-        if (!(p_cpufreq->scaling_available_governors =
+        if (p_cpufreq->gov_num &&
+            !(p_cpufreq->scaling_available_governors =
               malloc(p_cpufreq->gov_num * CPUFREQ_NAME_LEN * sizeof(char))))
         {
             fprintf(stderr,
diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index f5a9ac3f1a..d67d99e62f 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -239,6 +239,18 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
     if ( ret )
         return ret;
 
+    op->u.get_para.cpuinfo_cur_freq =
+        cpufreq_driver.get ? cpufreq_driver.get(op->cpuid) : policy->cur;
+    op->u.get_para.cpuinfo_max_freq = policy->cpuinfo.max_freq;
+    op->u.get_para.cpuinfo_min_freq = policy->cpuinfo.min_freq;
+    op->u.get_para.turbo_enabled = cpufreq_get_turbo_status(op->cpuid);
+
+    if ( cpufreq_driver.name[0] )
+        strlcpy(op->u.get_para.scaling_driver,
+            cpufreq_driver.name, CPUFREQ_NAME_LEN);
+    else
+        strlcpy(op->u.get_para.scaling_driver, "Unknown", CPUFREQ_NAME_LEN);
+
     if ( !(scaling_available_governors =
            xzalloc_array(char, gov_num * CPUFREQ_NAME_LEN)) )
         return -ENOMEM;
@@ -254,21 +266,10 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
     if ( ret )
         return ret;
 
-    op->u.get_para.cpuinfo_cur_freq =
-        cpufreq_driver.get ? cpufreq_driver.get(op->cpuid) : policy->cur;
-    op->u.get_para.cpuinfo_max_freq = policy->cpuinfo.max_freq;
-    op->u.get_para.cpuinfo_min_freq = policy->cpuinfo.min_freq;
-
     op->u.get_para.u.s.scaling_cur_freq = policy->cur;
     op->u.get_para.u.s.scaling_max_freq = policy->max;
     op->u.get_para.u.s.scaling_min_freq = policy->min;
 
-    if ( cpufreq_driver.name[0] )
-        strlcpy(op->u.get_para.scaling_driver,
-            cpufreq_driver.name, CPUFREQ_NAME_LEN);
-    else
-        strlcpy(op->u.get_para.scaling_driver, "Unknown", CPUFREQ_NAME_LEN);
-
     if ( policy->governor->name[0] )
         strlcpy(op->u.get_para.u.s.scaling_governor,
             policy->governor->name, CPUFREQ_NAME_LEN);
@@ -291,7 +292,6 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
             &op->u.get_para.u.s.u.ondemand.sampling_rate,
             &op->u.get_para.u.s.u.ondemand.up_threshold);
     }
-    op->u.get_para.turbo_enabled = cpufreq_get_turbo_status(op->cpuid);
 
     return ret;
 }
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 18:55:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 18:55:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559979.875515 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8j-0005uk-Oz; Thu, 06 Jul 2023 18:55:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559979.875515; Thu, 06 Jul 2023 18:55:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8j-0005uT-Kr; Thu, 06 Jul 2023 18:55:41 +0000
Received: by outflank-mailman (input) for mailman id 559979;
 Thu, 06 Jul 2023 18:55:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zM/b=CY=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qHU8h-0003x8-DV
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 18:55:39 +0000
Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com
 [2607:f8b0:4864:20::72c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b1d520f5-1c2e-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 20:55:37 +0200 (CEST)
Received: by mail-qk1-x72c.google.com with SMTP id
 af79cd13be357-765ae938b1bso105803085a.0
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 11:55:37 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 g25-20020ae9e119000000b0075b168fcde9sm1015297qkm.77.2023.07.06.11.55.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 06 Jul 2023 11:55:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b1d520f5-1c2e-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688669736; x=1691261736;
        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=u9ZMLiUGCgNNNe5L3edreIOnx1x4HftZ1emHftuFEs8=;
        b=bXkdMv4MqP9qwWzo7YzjZte4nDbkCl0a9UrsCpEIj/lsgiYEE+dix9KN8Krf6PurDA
         sg7hDOY58BymuHvXfjXqYT4WWZrrK95iD+uVmqVsYFcAyslqYoNcJw9iZ1gJRqQjBQtv
         TYcRw1Qasc7hUG1hW3bMh+hC4Yh7eqwvzvirugJQzqCi3vV/80+Ta39TegYqHf93KEQW
         iKxaQlNY12YJmlvdji6KBbnKBwSRzBbaPQiqTIrCRScKbKz8q1XOtIbbFQfatJaSH/OF
         U/bXzUY7v4dR1jdTBHuA/NIkOX7CTb1Dw6/DXKBcEtdiEWfDsg/CcVGt2HI1LbnhUjvc
         3MgA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688669736; x=1691261736;
        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=u9ZMLiUGCgNNNe5L3edreIOnx1x4HftZ1emHftuFEs8=;
        b=IdIlRV9GUdbXIs0MhVTxofR7FwvkRvg40LcD5u+x0acGIIA+ZMavST2T4Bh15QVjiY
         Nw5PlKmlmvPglD0BePdLGsSdb5TKjQUwtJDQZA3HRbFz4ErNl1cX5/q/MsSdn8K20s6t
         bbsx2YRlu79wZULPBusOp1h2a1r0Ti1YoQ7YZS3TSKUihE7X+FlgsD4kOwLDMk9SgeTF
         x/DdQ50bUtnHJn3572HYUW3oSRF0SIH2wqpuZUfTSvsHmjXPaTFuIdtav2Bk5kAG9wci
         M1/qHKb3vPAk4LzucR6bA3xYLuqSjwbkLGZDx/wSgmyB1QO77bFAmMVUPtdjxs7ZDVvM
         17jA==
X-Gm-Message-State: ABy/qLZv8xVOxtuys4fEY3h+T9TtlvrLMG4mXio7SjvgnFpYVvw5cN/U
	EZElmWDs1rpkSUekSnkdOjIIG19YFdg=
X-Google-Smtp-Source: APBJJlE+bPsd2H0oupILrSGcTJXu0G5EIHKa9QxI6wxMnsecZ46Yc2TEEMaW2GqezblirMufjuOHtA==
X-Received: by 2002:a37:2c81:0:b0:765:a720:5a61 with SMTP id s123-20020a372c81000000b00765a7205a61mr2177625qkh.31.1688669735953;
        Thu, 06 Jul 2023 11:55:35 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v5 06/15] cpufreq: Add Hardware P-State (HWP) driver
Date: Thu,  6 Jul 2023 14:54:31 -0400
Message-ID: <20230706185440.48333-7-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230706185440.48333-1-jandryuk@gmail.com>
References: <20230706185440.48333-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

>From the Intel SDM: "Hardware-Controlled Performance States (HWP), which
autonomously selects performance states while utilizing OS supplied
performance guidance hints."

Enable HWP to run in autonomous mode by poking the correct MSRs.  HWP is
disabled by default, and cpufreq=hwp enables it.

cpufreq= parsing is expanded to allow cpufreq=hwp;xen.  This allows
trying HWP and falling back to xen if not available.  Only hwp and xen
are supported for this fallback feature.  hdc is a sub-option under hwp
(i.e.  cpufreq=hwp,hdc=0) as is verbose.

There is no interface to configure - xen_sysctl_pm_op/xenpm will
be extended to configure in subsequent patches.  It will run with the
default values, which should be the default 0x80 (out of 0x0-0xff)
energy/performance preference.

Unscientific powertop measurement of an mostly idle, customized OpenXT
install:
A 10th gen 6-core laptop showed battery discharge drop from ~9.x to
~7.x watts.
A 8th gen 4-core laptop dropped from ~10 to ~9

Power usage depends on many factors, especially display brightness, but
this does show a power saving in balanced mode when CPU utilization is
low.

HWP isn't compatible with an external governor - it doesn't take
explicit frequency requests.  Therefore a minimal internal governor,
hwp, is also added as a placeholder.

While adding to the xen-command-line.pandoc entry, un-nest verbose from
minfreq.  They are independent.

With cpufreq=hwp,verbose, HWP prints processor capabilities that are not
used by the code, like HW_FEEDBACK.  This is done because otherwise
there isn't a convenient way to query the information.

Xen doesn't use the HWP interrupt, so it is disabled like in the Linux
pstate driver.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
We disable on cpuid_level < 0x16.  cpuid(0x16) is used to get the cpu
frequencies for calculating the APERF/MPERF.  Without it, things would
still work, but the average cpu frequency output would be wrong.

My 8th & 10th gen test systems both report:
(XEN) HWP: 1 notify: 1 act_window: 1 energy_perf: 1 pkg_level: 0 peci: 0
(XEN) HWP: Hardware Duty Cycling (HDC) supported
(XEN) HWP: HW_FEEDBACK not supported

We can't use parse_boolean() since it requires a single name=val string
and cpufreq_handle_common_option is provided two strings.  Use
parse_bool() and manual handle no-hwp.

FAST_IA32_HWP_REQUEST was removed in v2.  The check in v1 was wrong,
it's a model specific feature and the CPUID bit is only available
after enabling via the MSR.  Support was untested since I don't have
hardware with the feature.  Writes are expected to be infrequent, so
just leave it out.

---
v2:
Alphabetize headers
Re-work driver registration
name hwp_drv_data anonymous union "hw"
Drop hwp_verbose_cont
style cleanups
Condense hwp_governor switch
hwp_cpufreq_target remove .raw from hwp_req assignment
Use typed-pointer in a few functions
Pass type to xzalloc
Add HWP_ENERGY_PERF_BALANCE/IA32_ENERGY_BIAS_BALANCE defines
Add XEN_HWP_GOVERNOR define for "hwp-internal"
Capitalize CPUID and MSR defines
Change '_' to '-' for energy-perf & act-window
Read-modify-write MSRs updates
Use FAST_IA32_HWP_REQUEST_MSR_ENABLE define
constify pointer in hwp_set_misc_turbo
Add space after non-fallthrough break in governor switch
Add IA32_ENERGY_BIAS_MASK define
Check CPUID_PM_LEAK for energy bias when needed
Fail initialization with curr_req = -1
Fold hwp_read_capabilities into hwp_init_msrs
Add command line cpufreq=xen:hwp
Add command line cpufreq=xen:hdc
Use per_cpu for hwp_drv_data pointers
Move hwp_energy_perf_bias call into hwp_write_request
energy_perf 0 is valid, so hwp_energy_perf_bias cannot be skipped
Ensure we don't generate interrupts
Remove Fast Write of Uncore MSR
Initialize hwp_drv_data from curr_req
Use SPDX line instead of license text in hwp.c

v3:
Add cf_check to cpufreq_gov_hwp_init() - Marek
Print cpuid_level with %#x - Marek

v4:
Use BIT() for CPUID and MSR bits
Move __initdata after type
Add __ro_after_init to feature_*
Remove aperf/mperf comment
Move feature_hwp_energy_perf { to newline
Remove _IA32_ infix
Use unsigned int & bool for bitfields
Require energy perf pref (Remove ENERGY_PERF_BIAS support)
Initialize activity_window
Return errors on wrmsr failure
Change command line to: cpufreq=xen:hwp
Move hdc into the hwp-specific handle_options
Drop feature_hwp_energy_perf, feature_hwp_pkg_level_ctl & feature_hwp_peci
Print features before exiting when energy/performance preference isn't available
Disable HWP MSR on initialization error
Change hwp_ print macros to add prefixes
Disable HDC when hdc=0 - (opt_hdc no longer initdata)
Mark hwp governor internal and use "hwp" name
Add XEN_HWP_DRIVER
Use top-level cpufreq=hwp command line option
Document that cpufreq=hwp falls back to cpufreq=xen without hardware
Add SPDX suffix GPL-2.0-only

v5:
Use _AC() macro in MSR_IA32_MISC_ENABLE_TURBO_DISENGAGE definition
hwp_err arg re-ordering
Use XEN_HWP_DRIVER_NAME
Use cpufreq.h for all declarations
Clear feature_hdc on failure and print a message
Use unnamed bitfields instead of reservered
Remove asm/io.h include
static DEFINE_PER_CPU_READ_MOSTLY(struct hwp_drv_data
Remove some empty newlines
Align feature_hdc assignment
Remove feature_hwp
Remove unnecesary return at end of void hwp_init_msrs()
BUILD_BUG_ON member variable
Reformat a compound if
Clear pre_cpu hwp_drv_data before xfree()
Only print HWP capabilities for CPU 0
Specify processor models in turbo comment
Use arg[1] in setup_cpufreq_option()
Remove some log messages
Drop double newline
Parse verbose as a boolean instead of the custom parsing.
Support cpufreq=hwp;xen fallback
Call hwp_available() from hwp_register_driver()
Move cpufreq_govenor_internal setting to hwp_register_driver
---
 docs/misc/xen-command-line.pandoc     |  18 +-
 xen/arch/x86/acpi/cpufreq/Makefile    |   1 +
 xen/arch/x86/acpi/cpufreq/cpufreq.c   |  19 +-
 xen/arch/x86/acpi/cpufreq/hwp.c       | 513 ++++++++++++++++++++++++++
 xen/arch/x86/include/asm/cpufeature.h |  12 +-
 xen/arch/x86/include/asm/msr-index.h  |  15 +-
 xen/drivers/cpufreq/cpufreq.c         |  55 ++-
 xen/include/acpi/cpufreq/cpufreq.h    |   9 +
 xen/include/public/sysctl.h           |   2 +
 9 files changed, 629 insertions(+), 15 deletions(-)
 create mode 100644 xen/arch/x86/acpi/cpufreq/hwp.c

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 4060ebdc5d..f6138da173 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -499,7 +499,7 @@ If set, force use of the performance counters for oprofile, rather than detectin
 available support.
 
 ### cpufreq
-> `= none | {{ <boolean> | xen } [:[powersave|performance|ondemand|userspace][,<maxfreq>][,[<minfreq>][,[verbose]]]]} | dom0-kernel`
+> `= none | {{ <boolean> | xen } { [:[powersave|performance|ondemand|userspace][,[<maxfreq>]][,[<minfreq>]]] } [,verbose]} | dom0-kernel | hwp[:[<hdc>][,verbose]]`
 
 > Default: `xen`
 
@@ -510,6 +510,22 @@ choice of `dom0-kernel` is deprecated and not supported by all Dom0 kernels.
 * `<maxfreq>` and `<minfreq>` are integers which represent max and min processor frequencies
   respectively.
 * `verbose` option can be included as a string or also as `verbose=<integer>`
+  for `xen`.  It is a boolean for `hwp`.
+* `hwp` selects Hardware-Controlled Performance States (HWP) on supported Intel
+  hardware.  HWP is a Skylake+ feature which provides better CPU power
+  management.  The default is disabled.  If `hwp` is selected, but hardware
+  support is not available, Xen will fallback to cpufreq=xen.
+* `<hdc>` is a boolean to enable Hardware Duty Cycling (HDC).  HDC enables the
+  processor to autonomously force physical package components into idle state.
+  The default is enabled, but the option only applies when `hwp` is enabled.
+
+There is also support for `;`-separated fallback options:
+`cpufreq=hwp,verbose;xen`.  This first tries `hwp` and falls back to `xen`
+if unavailable.
+
+Note: grub2 requires to escape or quote ';', so `"cpufreq=hwp;xen"` should be
+specified within double quotes inside grub.cfg.  Refer to the grub2
+documentation for more information.
 
 ### cpuid (x86)
 > `= List of comma separated booleans`
diff --git a/xen/arch/x86/acpi/cpufreq/Makefile b/xen/arch/x86/acpi/cpufreq/Makefile
index f75da9b9ca..db83aa6b14 100644
--- a/xen/arch/x86/acpi/cpufreq/Makefile
+++ b/xen/arch/x86/acpi/cpufreq/Makefile
@@ -1,2 +1,3 @@
 obj-y += cpufreq.o
+obj-y += hwp.o
 obj-y += powernow.o
diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index f1cc473b4f..3adc99f377 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -642,7 +642,24 @@ static int __init cf_check cpufreq_driver_init(void)
         switch ( boot_cpu_data.x86_vendor )
         {
         case X86_VENDOR_INTEL:
-            ret = cpufreq_register_driver(&acpi_cpufreq_driver);
+            unsigned int i;
+            ret = -ENOENT;
+
+            for ( i = 0; i < cpufreq_xen_cnt; i++ )
+            {
+                switch ( cpufreq_xen_opts[i] )
+                {
+                case CPUFREQ_xen:
+                    ret = cpufreq_register_driver(&acpi_cpufreq_driver);
+                    break;
+                case CPUFREQ_hwp:
+                    ret = hwp_register_driver();
+                    break;
+                }
+
+                if ( ret == 0 )
+                    break;
+            }
             break;
 
         case X86_VENDOR_AMD:
diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
new file mode 100644
index 0000000000..1ac07bbeb1
--- /dev/null
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -0,0 +1,513 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * hwp.c cpufreq driver to run Intel Hardware P-States (HWP)
+ *
+ * Copyright (C) 2021 Jason Andryuk <jandryuk@gmail.com>
+ */
+
+#include <xen/cpumask.h>
+#include <xen/init.h>
+#include <xen/param.h>
+#include <xen/xmalloc.h>
+#include <asm/msr.h>
+#include <acpi/cpufreq/cpufreq.h>
+
+static bool __ro_after_init feature_hwp_notification;
+static bool __ro_after_init feature_hwp_activity_window;
+
+static bool __ro_after_init feature_hdc;
+
+static bool __ro_after_init opt_cpufreq_hdc = true;
+
+union hwp_request
+{
+    struct
+    {
+        unsigned int min_perf:8;
+        unsigned int max_perf:8;
+        unsigned int desired:8;
+        unsigned int energy_perf:8;
+        unsigned int activity_window:10;
+        bool package_control:1;
+        unsigned int :16;
+        bool activity_window_valid:1;
+        bool energy_perf_valid:1;
+        bool desired_valid:1;
+        bool max_perf_valid:1;
+        bool min_perf_valid:1;
+    };
+    uint64_t raw;
+};
+
+struct hwp_drv_data
+{
+    union
+    {
+        uint64_t hwp_caps;
+        struct
+        {
+            unsigned int highest:8;
+            unsigned int guaranteed:8;
+            unsigned int most_efficient:8;
+            unsigned int lowest:8;
+            unsigned int :32;
+        } hw;
+    };
+    union hwp_request curr_req;
+    int ret;
+    uint16_t activity_window;
+    uint8_t minimum;
+    uint8_t maximum;
+    uint8_t desired;
+    uint8_t energy_perf;
+};
+static DEFINE_PER_CPU_READ_MOSTLY(struct hwp_drv_data *, hwp_drv_data);
+
+#define hwp_err(cpu, fmt, ...) \
+    printk(XENLOG_ERR "HWP: CPU%u error: " fmt, cpu, ##__VA_ARGS__)
+#define hwp_info(fmt, ...)    printk(XENLOG_INFO "HWP: " fmt, ##__VA_ARGS__)
+#define hwp_verbose(fmt, ...)                             \
+({                                                        \
+    if ( cpufreq_verbose )                                \
+        printk(XENLOG_DEBUG "HWP: " fmt, ##__VA_ARGS__);  \
+})
+
+static int cf_check hwp_governor(struct cpufreq_policy *policy,
+                                 unsigned int event)
+{
+    int ret;
+
+    if ( policy == NULL )
+        return -EINVAL;
+
+    switch ( event )
+    {
+    case CPUFREQ_GOV_START:
+    case CPUFREQ_GOV_LIMITS:
+        ret = 0;
+        break;
+
+    case CPUFREQ_GOV_STOP:
+    default:
+        ret = -EINVAL;
+        break;
+    }
+
+    return ret;
+}
+
+static bool hwp_handle_option(const char *s, const char *end)
+{
+    int ret;
+
+    ret = parse_boolean("verbose", s, end);
+    if ( ret >= 0 ) {
+        cpufreq_verbose = ret;
+        return true;
+    }
+
+    ret = parse_boolean("hdc", s, end);
+    if ( ret >= 0 ) {
+        opt_cpufreq_hdc = ret;
+        return true;
+    }
+
+    return false;
+}
+
+int __init hwp_cmdline_parse(const char *s, const char *e)
+{
+    do
+    {
+        const char *end = strpbrk(s, ",;");
+
+        if ( s && !hwp_handle_option(s, end) )
+        {
+            printk(XENLOG_WARNING "cpufreq/hwp: option '%s' not recognized\n",
+                   s);
+
+            return -1;
+        }
+
+        s = end ? ++end : end;
+    } while ( s && s < e );
+
+    return 0;
+}
+
+static struct cpufreq_governor cpufreq_gov_hwp =
+{
+    .name          = "hwp",
+    .governor      = hwp_governor,
+};
+
+static int __init cf_check cpufreq_gov_hwp_init(void)
+{
+    if ( !cpufreq_governor_internal )
+        return 0;
+
+    return cpufreq_register_governor(&cpufreq_gov_hwp);
+}
+__initcall(cpufreq_gov_hwp_init);
+
+static bool __init hwp_available(void)
+{
+    unsigned int eax;
+
+    if ( boot_cpu_data.cpuid_level < CPUID_PM_LEAF )
+    {
+        hwp_verbose("cpuid_level (%#x) lacks HWP support\n",
+                    boot_cpu_data.cpuid_level);
+
+        return false;
+    }
+
+    if ( boot_cpu_data.cpuid_level < 0x16 )
+    {
+        hwp_info("HWP disabled: cpuid_level %#x < 0x16 lacks CPU freq info\n",
+                 boot_cpu_data.cpuid_level);
+
+        return false;
+    }
+
+    eax = cpuid_eax(CPUID_PM_LEAF);
+
+    hwp_verbose("%d notify: %d act-window: %d energy-perf: %d pkg-level: %d peci: %d\n",
+                !!(eax & CPUID6_EAX_HWP),
+                !!(eax & CPUID6_EAX_HWP_NOTIFICATION),
+                !!(eax & CPUID6_EAX_HWP_ACTIVITY_WINDOW),
+                !!(eax & CPUID6_EAX_HWP_ENERGY_PERFORMANCE_PREFERENCE),
+                !!(eax & CPUID6_EAX_HWP_PACKAGE_LEVEL_REQUEST),
+                !!(eax & CPUID6_EAX_HWP_PECI));
+
+    if ( !(eax & CPUID6_EAX_HWP) )
+        return false;
+
+    if ( !(eax & CPUID6_EAX_HWP_ENERGY_PERFORMANCE_PREFERENCE) )
+    {
+        hwp_verbose("disabled: No energy/performance preference available");
+
+        return false;
+    }
+
+    feature_hwp_notification    = eax & CPUID6_EAX_HWP_NOTIFICATION;
+    feature_hwp_activity_window = eax & CPUID6_EAX_HWP_ACTIVITY_WINDOW;
+    feature_hdc                 = eax & CPUID6_EAX_HDC;
+
+    hwp_verbose("Hardware Duty Cycling (HDC) %ssupported%s\n",
+                feature_hdc ? "" : "not ",
+                feature_hdc ? opt_cpufreq_hdc ? ", enabled" : ", disabled"
+                            : "");
+
+    hwp_verbose("HW_FEEDBACK %ssupported\n",
+                (eax & CPUID6_EAX_HW_FEEDBACK) ? "" : "not ");
+
+    hwp_info("Using HWP for cpufreq\n");
+
+    return true;
+}
+
+static int hdc_set_pkg_hdc_ctl(unsigned int cpu, bool val)
+{
+    uint64_t msr;
+
+    if ( rdmsr_safe(MSR_PKG_HDC_CTL, msr) )
+    {
+        hwp_err(cpu, "rdmsr_safe(MSR_PKG_HDC_CTL)\n");
+        return -1;
+    }
+
+    if ( val )
+        msr |= PKG_HDC_CTL_HDC_PKG_ENABLE;
+    else
+        msr &= ~PKG_HDC_CTL_HDC_PKG_ENABLE;
+
+    if ( wrmsr_safe(MSR_PKG_HDC_CTL, msr) )
+    {
+        hwp_err(cpu, "wrmsr_safe(MSR_PKG_HDC_CTL): %016lx\n", msr);
+        return -1;
+    }
+
+    return 0;
+}
+
+static int hdc_set_pm_ctl1(unsigned int cpu, bool val)
+{
+    uint64_t msr;
+
+    if ( rdmsr_safe(MSR_PM_CTL1, msr) )
+    {
+        hwp_err(cpu, "rdmsr_safe(MSR_PM_CTL1)\n");
+        return -1;
+    }
+
+    if ( val )
+        msr |= PM_CTL1_HDC_ALLOW_BLOCK;
+    else
+        msr &= ~PM_CTL1_HDC_ALLOW_BLOCK;
+
+    if ( wrmsr_safe(MSR_PM_CTL1, msr) )
+    {
+        hwp_err(cpu, "wrmsr_safe(MSR_PM_CTL1): %016lx\n", msr);
+        return -1;
+    }
+
+    return 0;
+}
+
+static void hwp_get_cpu_speeds(struct cpufreq_policy *policy)
+{
+    uint32_t base_khz, max_khz, bus_khz, edx;
+
+    cpuid(0x16, &base_khz, &max_khz, &bus_khz, &edx);
+
+    policy->cpuinfo.perf_freq = base_khz * 1000;
+    policy->cpuinfo.min_freq = base_khz * 1000;
+    policy->cpuinfo.max_freq = max_khz * 1000;
+    policy->min = base_khz * 1000;
+    policy->max = max_khz * 1000;
+    policy->cur = 0;
+}
+
+static void cf_check hwp_init_msrs(void *info)
+{
+    struct cpufreq_policy *policy = info;
+    struct hwp_drv_data *data = this_cpu(hwp_drv_data);
+    uint64_t val;
+
+    /*
+     * Package level MSR, but we don't have a good idea of packages here, so
+     * just do it everytime.
+     */
+    if ( rdmsr_safe(MSR_PM_ENABLE, val) )
+    {
+        hwp_err(policy->cpu, "rdmsr_safe(MSR_PM_ENABLE)\n");
+        data->curr_req.raw = -1;
+        return;
+    }
+
+    /* Ensure we don't generate interrupts */
+    if ( feature_hwp_notification )
+        wrmsr_safe(MSR_HWP_INTERRUPT, 0);
+
+    hwp_verbose("CPU%u: MSR_PM_ENABLE: %016lx\n", policy->cpu, val);
+    if ( !(val & PM_ENABLE_HWP_ENABLE) )
+    {
+        val |= PM_ENABLE_HWP_ENABLE;
+        if ( wrmsr_safe(MSR_PM_ENABLE, val) )
+        {
+            hwp_err(policy->cpu, "wrmsr_safe(MSR_PM_ENABLE, %lx)\n", val);
+            data->curr_req.raw = -1;
+            return;
+        }
+    }
+
+    if ( rdmsr_safe(MSR_HWP_CAPABILITIES, data->hwp_caps) )
+    {
+        hwp_err(policy->cpu, "rdmsr_safe(MSR_HWP_CAPABILITIES)\n");
+        goto error;
+    }
+
+    if ( rdmsr_safe(MSR_HWP_REQUEST, data->curr_req.raw) )
+    {
+        hwp_err(policy->cpu, "rdmsr_safe(MSR_HWP_REQUEST)\n");
+        goto error;
+    }
+
+    /*
+     * Check for APERF/MPERF support in hardware
+     * also check for boost/turbo support
+     */
+    intel_feature_detect(policy);
+
+    if ( feature_hdc )
+    {
+        if ( hdc_set_pkg_hdc_ctl(policy->cpu, opt_cpufreq_hdc) ||
+             hdc_set_pm_ctl1(policy->cpu, opt_cpufreq_hdc) ) {
+            hwp_err(policy->cpu, "Disabling HDC support\n");
+            feature_hdc = false;
+            goto error;
+        }
+    }
+
+    hwp_get_cpu_speeds(policy);
+
+    return;
+
+ error:
+    data->curr_req.raw = -1;
+    val &= ~PM_ENABLE_HWP_ENABLE;
+    if ( wrmsr_safe(MSR_PM_ENABLE, val) )
+        hwp_err(policy->cpu, "wrmsr_safe(MSR_PM_ENABLE, %lx)\n", val);
+}
+
+static int cf_check hwp_cpufreq_verify(struct cpufreq_policy *policy)
+{
+    struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
+
+    if ( !feature_hwp_activity_window && data->activity_window )
+    {
+        hwp_verbose("HWP activity window not supported\n");
+
+        return -EINVAL;
+    }
+
+    return 0;
+}
+
+static void cf_check hwp_write_request(void *info)
+{
+    const struct cpufreq_policy *policy = info;
+    struct hwp_drv_data *data = this_cpu(hwp_drv_data);
+    union hwp_request hwp_req = data->curr_req;
+
+    data->ret = 0;
+
+    BUILD_BUG_ON(sizeof(union hwp_request) != sizeof(hwp_req.raw));
+    if ( wrmsr_safe(MSR_HWP_REQUEST, hwp_req.raw) )
+    {
+        hwp_verbose("CPU%u: error wrmsr_safe(MSR_HWP_REQUEST, %lx)\n",
+                    policy->cpu, hwp_req.raw);
+        rdmsr_safe(MSR_HWP_REQUEST, data->curr_req.raw);
+        data->ret = -EINVAL;
+    }
+}
+
+static int cf_check hwp_cpufreq_target(struct cpufreq_policy *policy,
+                                       unsigned int target_freq,
+                                       unsigned int relation)
+{
+    unsigned int cpu = policy->cpu;
+    struct hwp_drv_data *data = per_cpu(hwp_drv_data, cpu);
+    /* Zero everything to ensure reserved bits are zero... */
+    union hwp_request hwp_req = { .raw = 0 };
+
+    /* .. and update from there */
+    hwp_req.min_perf = data->minimum;
+    hwp_req.max_perf = data->maximum;
+    hwp_req.desired = data->desired;
+    hwp_req.energy_perf = data->energy_perf;
+    if ( feature_hwp_activity_window )
+        hwp_req.activity_window = data->activity_window;
+
+    if ( hwp_req.raw == data->curr_req.raw )
+        return 0;
+
+    data->curr_req = hwp_req;
+
+    on_selected_cpus(cpumask_of(cpu), hwp_write_request, policy, 1);
+
+    return data->ret;
+}
+
+static int cf_check hwp_cpufreq_cpu_init(struct cpufreq_policy *policy)
+{
+    unsigned int cpu = policy->cpu;
+    struct hwp_drv_data *data;
+
+    data = xzalloc(struct hwp_drv_data);
+    if ( !data )
+        return -ENOMEM;
+
+    policy->governor = &cpufreq_gov_hwp;
+
+    per_cpu(hwp_drv_data, cpu) = data;
+
+    on_selected_cpus(cpumask_of(cpu), hwp_init_msrs, policy, 1);
+
+    if ( data->curr_req.raw == -1 )
+    {
+        hwp_err(cpu, "Could not initialize HWP properly\n");
+        per_cpu(hwp_drv_data, cpu) = NULL;
+        xfree(data);
+        return -ENODEV;
+    }
+
+    data->minimum = data->curr_req.min_perf;
+    data->maximum = data->curr_req.max_perf;
+    data->desired = data->curr_req.desired;
+    data->energy_perf = data->curr_req.energy_perf;
+    data->activity_window = data->curr_req.activity_window;
+
+    if ( cpu == 0 )
+        hwp_verbose("CPU%u: HWP_CAPABILITIES: %016lx\n", cpu, data->hwp_caps);
+
+    hwp_verbose("CPU%u: rdmsr HWP_REQUEST %016lx\n", cpu, data->curr_req.raw);
+
+    return 0;
+}
+
+static int cf_check hwp_cpufreq_cpu_exit(struct cpufreq_policy *policy)
+{
+    struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
+    per_cpu(hwp_drv_data, policy->cpu) = NULL;
+    xfree(data);
+
+    return 0;
+}
+
+/*
+ * The SDM reads like turbo should be disabled with MSR_IA32_PERF_CTL and
+ * PERF_CTL_TURBO_DISENGAGE, but that does not seem to actually work, at least
+ * with testing on i7-10810U and i7-8550U.  MSR_MISC_ENABLE and
+ * MISC_ENABLE_TURBO_DISENGAGE is what Linux uses and seems to work.
+ */
+static void cf_check hwp_set_misc_turbo(void *info)
+{
+    const struct cpufreq_policy *policy = info;
+    struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
+    uint64_t msr;
+
+    data->ret = 0;
+
+    if ( rdmsr_safe(MSR_IA32_MISC_ENABLE, msr) )
+    {
+        hwp_verbose("CPU%u: error rdmsr_safe(MSR_IA32_MISC_ENABLE)\n",
+                    policy->cpu);
+        data->ret = -EINVAL;
+
+        return;
+    }
+
+    if ( policy->turbo == CPUFREQ_TURBO_ENABLED )
+        msr &= ~MSR_IA32_MISC_ENABLE_TURBO_DISENGAGE;
+    else
+        msr |= MSR_IA32_MISC_ENABLE_TURBO_DISENGAGE;
+
+    if ( wrmsr_safe(MSR_IA32_MISC_ENABLE, msr) )
+    {
+        hwp_verbose("CPU%u: error wrmsr_safe(MSR_IA32_MISC_ENABLE): %016lx\n",
+                    policy->cpu, msr);
+        data->ret = -EINVAL;
+    }
+}
+
+static int cf_check hwp_cpufreq_update(int cpuid, struct cpufreq_policy *policy)
+{
+    on_selected_cpus(cpumask_of(cpuid), hwp_set_misc_turbo, policy, 1);
+
+    return per_cpu(hwp_drv_data, cpuid)->ret;
+}
+
+static const struct cpufreq_driver __initconstrel hwp_cpufreq_driver =
+{
+    .name   = XEN_HWP_DRIVER_NAME,
+    .verify = hwp_cpufreq_verify,
+    .target = hwp_cpufreq_target,
+    .init   = hwp_cpufreq_cpu_init,
+    .exit   = hwp_cpufreq_cpu_exit,
+    .update = hwp_cpufreq_update,
+};
+
+int __init hwp_register_driver(void)
+{
+    int ret;
+
+    if ( !hwp_available() )
+        return -EINVAL;
+
+    ret = cpufreq_register_driver(&hwp_cpufreq_driver);
+    cpufreq_governor_internal = (ret == 0);
+
+    return ret;
+}
diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h
index 64e1dad225..93466441f5 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -52,8 +52,16 @@ static inline bool boot_cpu_has(unsigned int feat)
     return cpu_has(&boot_cpu_data, feat);
 }
 
-#define CPUID_PM_LEAF                    6
-#define CPUID6_ECX_APERFMPERF_CAPABILITY 0x1
+#define CPUID_PM_LEAF                                6
+#define CPUID6_EAX_HWP                               BIT(7, U)
+#define CPUID6_EAX_HWP_NOTIFICATION                  BIT(8, U)
+#define CPUID6_EAX_HWP_ACTIVITY_WINDOW               BIT(9, U)
+#define CPUID6_EAX_HWP_ENERGY_PERFORMANCE_PREFERENCE BIT(10, U)
+#define CPUID6_EAX_HWP_PACKAGE_LEVEL_REQUEST         BIT(11, U)
+#define CPUID6_EAX_HDC                               BIT(13, U)
+#define CPUID6_EAX_HWP_PECI                          BIT(16, U)
+#define CPUID6_EAX_HW_FEEDBACK                       BIT(19, U)
+#define CPUID6_ECX_APERFMPERF_CAPABILITY             BIT(0, U)
 
 /* CPUID level 0x00000001.edx */
 #define cpu_has_fpu             1
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 4f861c0bb4..68407bd707 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -151,6 +151,13 @@
 
 #define MSR_PKRS                            0x000006e1
 
+#define MSR_PM_ENABLE                       0x00000770
+#define  PM_ENABLE_HWP_ENABLE               BIT(0, ULL)
+
+#define MSR_HWP_CAPABILITIES                0x00000771
+#define MSR_HWP_INTERRUPT                   0x00000773
+#define MSR_HWP_REQUEST                     0x00000774
+
 #define MSR_X2APIC_FIRST                    0x00000800
 #define MSR_X2APIC_LAST                     0x000008ff
 
@@ -165,6 +172,11 @@
 #define  PASID_PASID_MASK                   0x000fffff
 #define  PASID_VALID                        (_AC(1, ULL) << 31)
 
+#define MSR_PKG_HDC_CTL                     0x00000db0
+#define  PKG_HDC_CTL_HDC_PKG_ENABLE         BIT(0, ULL)
+#define MSR_PM_CTL1                         0x00000db1
+#define  PM_CTL1_HDC_ALLOW_BLOCK            BIT(0, ULL)
+
 #define MSR_UARCH_MISC_CTRL                 0x00001b01
 #define  UARCH_CTRL_DOITM                   (_AC(1, ULL) <<  0)
 
@@ -502,7 +514,8 @@
 #define MSR_IA32_MISC_ENABLE_MONITOR_ENABLE (1<<18)
 #define MSR_IA32_MISC_ENABLE_LIMIT_CPUID  (1<<22)
 #define MSR_IA32_MISC_ENABLE_XTPR_DISABLE (1<<23)
-#define MSR_IA32_MISC_ENABLE_XD_DISABLE   (_AC(1, ULL) << 34)
+#define MSR_IA32_MISC_ENABLE_XD_DISABLE      (_AC(1, ULL) << 34)
+#define MSR_IA32_MISC_ENABLE_TURBO_DISENGAGE (_AC(1, ULL) << 38)
 
 #define MSR_IA32_TSC_DEADLINE		0x000006E0
 #define MSR_IA32_ENERGY_PERF_BIAS	0x000001b0
diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 67a58d409b..67f01a8293 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -63,12 +63,18 @@ LIST_HEAD_READ_MOSTLY(cpufreq_governor_list);
 /* set xen as default cpufreq */
 enum cpufreq_controller cpufreq_controller = FREQCTL_xen;
 
-static int __init cpufreq_cmdline_parse(const char *s);
+enum cpufreq_xen_opt cpufreq_xen_opts[2] = { CPUFREQ_xen, };
+unsigned int cpufreq_xen_cnt = 1;
+
+static int __init cpufreq_cmdline_parse(const char *s, const char *e);
 
 static int __init cf_check setup_cpufreq_option(const char *str)
 {
-    const char *arg = strpbrk(str, ",:");
+    const char *arg = strpbrk(str, ",:;");
     int choice;
+    int ret = -EINVAL;
+
+    cpufreq_xen_cnt = 0;
 
     if ( !arg )
         arg = strchr(str, '\0');
@@ -89,15 +95,42 @@ static int __init cf_check setup_cpufreq_option(const char *str)
         return 0;
     }
 
-    if ( choice > 0 || !cmdline_strcmp(str, "xen") )
+    do
     {
-        xen_processor_pmbits |= XEN_PROCESSOR_PM_PX;
-        cpufreq_controller = FREQCTL_xen;
-        if ( *arg && *(arg + 1) )
-            return cpufreq_cmdline_parse(arg + 1);
-    }
+        const char *end = strchr(str, ';');
+        if ( end == NULL )
+            end = strchr(str, '\0');
+
+        arg = strchr(str, ',');
+        if ( !arg || arg > end )
+            arg = strchr(str, '\0');
+
+        if ( cpufreq_xen_cnt == ARRAY_SIZE(cpufreq_xen_opts) )
+            return -E2BIG;
+
+        if ( choice > 0 || !cmdline_strcmp(str, "xen") )
+        {
+            xen_processor_pmbits |= XEN_PROCESSOR_PM_PX;
+            cpufreq_controller = FREQCTL_xen;
+            cpufreq_xen_opts[cpufreq_xen_cnt++] = CPUFREQ_xen;
+            if ( arg[0] && arg[1] )
+                ret = cpufreq_cmdline_parse(arg + 1, end);
+        }
+        else if ( choice < 0 && !cmdline_strcmp(str, "hwp") )
+        {
+            xen_processor_pmbits |= XEN_PROCESSOR_PM_PX;
+            cpufreq_controller = FREQCTL_xen;
+            cpufreq_xen_opts[cpufreq_xen_cnt++] = CPUFREQ_hwp;
+            if ( arg[0] && arg[1] )
+                ret = hwp_cmdline_parse(arg + 1, end);
+        }
+        else
+            ret = -EINVAL;
+
+        str = end ? ++end : end;
+    } while ( choice < 0 && ret == 0 && *str );
 
-    return (choice < 0) ? -EINVAL : 0;
+    return (choice < 0) ? ret : 0;
 }
 custom_param("cpufreq", setup_cpufreq_option);
 
@@ -576,7 +609,7 @@ static int __init cpufreq_handle_common_option(const char *name, const char *val
     return 0;
 }
 
-static int __init cpufreq_cmdline_parse(const char *s)
+static int __init cpufreq_cmdline_parse(const char *s, const char *e)
 {
     static struct cpufreq_governor *__initdata cpufreq_governors[] =
     {
@@ -592,6 +625,8 @@ static int __init cpufreq_cmdline_parse(const char *s)
     int rc = 0;
 
     strlcpy(buf, s, sizeof(buf));
+    if (e - s < sizeof(buf))
+        buf[e - s] = '\0';
     do {
         char *val, *end = strchr(str, ',');
         unsigned int i;
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 482ea5b0de..c965a8c6b6 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -24,6 +24,12 @@ DECLARE_PER_CPU(spinlock_t, cpufreq_statistic_lock);
 
 extern bool_t cpufreq_verbose;
 
+enum cpufreq_xen_opt {
+    CPUFREQ_xen,
+    CPUFREQ_hwp,
+};
+extern enum cpufreq_xen_opt cpufreq_xen_opts[2];
+extern unsigned int cpufreq_xen_cnt;
 struct cpufreq_governor;
 
 struct acpi_cpufreq_data {
@@ -245,4 +251,7 @@ void cpufreq_dbs_timer_resume(void);
 
 void intel_feature_detect(struct cpufreq_policy *policy);
 
+int hwp_cmdline_parse(const char *s, const char *e);
+int hwp_register_driver(void);
+
 #endif /* __XEN_CPUFREQ_PM_H__ */
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index b0028d3058..59700b02f2 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -296,6 +296,8 @@ struct xen_ondemand {
     uint32_t up_threshold;
 };
 
+#define XEN_HWP_DRIVER_NAME "hwp"
+
 /*
  * cpufreq para name of this structure named
  * same as sysfs file name of native linux
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 18:55:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 18:55:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559980.875520 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8k-00060r-AL; Thu, 06 Jul 2023 18:55:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559980.875520; Thu, 06 Jul 2023 18:55:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8k-0005zF-3x; Thu, 06 Jul 2023 18:55:42 +0000
Received: by outflank-mailman (input) for mailman id 559980;
 Thu, 06 Jul 2023 18:55:41 +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
 <SRS0=zM/b=CY=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qHU8j-0003x0-Ei
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 18:55:41 +0000
Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com
 [2607:f8b0:4864:20::732])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b2ee0279-1c2e-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 20:55:39 +0200 (CEST)
Received: by mail-qk1-x732.google.com with SMTP id
 af79cd13be357-7659c6cae2cso92082485a.1
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 11:55:39 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 g25-20020ae9e119000000b0075b168fcde9sm1015297qkm.77.2023.07.06.11.55.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 06 Jul 2023 11:55:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b2ee0279-1c2e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688669738; x=1691261738;
        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=KN/89cmmlDVrGXWlTK5wABJrp3BHjn1APTznmlWm8Is=;
        b=VKYpegKTek9Wj6oG+Y0lrCkwIJEnH47KefRCM4WhP/vkljR/H8nBtXz+CoYKK4b29J
         SkpxIGjtaV/in2pgOQKdY8oI3lJRoZxpXPPApl/pMsCX7VSX8zI4ozfAA3+LzhYKMpqs
         slbxHWCvbYgYKVFgfxkunTmD6FL5B0bonbH834v9Vn2t29oq63XNWjmB1utLMPUgnyo1
         d3ooDy3I/xwalkZUJDw1VeHxB7zKokNHia1rS5RL8Jk6GerCw/xrMh66RVMQg1te3AWy
         AT6Ne5QAQJiezMS6owD8PT4U1Xviyzahj9BFfl5+efaWPenNQ3757/QZ1RdXT9MOFghf
         dcWg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688669738; x=1691261738;
        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=KN/89cmmlDVrGXWlTK5wABJrp3BHjn1APTznmlWm8Is=;
        b=E1kPXXgTV/kVOFbeCPj/RhjIS1+0bOos4OZoSVfNq3XplQ4LQf3LRnuCXUXzyACs05
         vSeQm5hiGrOIL0RnLqEeHhAuscqoy4yb/qO7HwXOvZ646GWc5N5gykwGnKnEV3osRldm
         D84AXDaS71BhEITZ76WAwaOTQHJhxfCNxNWn/zqvq0XkHMU1J24fTUclyIaCmrCh9n3V
         nxm37sMqfrEiL9l19lyeMA06o6Ka+uxaoP0FaAVV/Q/Jy9K2vatB++Rmx3ftJEQhigaE
         Tg9bhJiko4tEL26n0iQoGFv1TRzelPTn/1WW/GIEeYI/wtLHf7IY14HU/CsVrCFvjCAX
         8tbw==
X-Gm-Message-State: ABy/qLZ6VKC1YGe1vjEBYoC4NXgasCXZKrJ1Qgn1R0ibPHcl1oVaixEl
	6DO0LG0KIZlV0dQghO5wVFkVZbZZpvM=
X-Google-Smtp-Source: APBJJlFDmGfdCx45dI2upKrHXVttiysn3TYraZbQ0DOoV4J2w7H7RRRC+5i2RvOiEVWWDU+vAMiYJA==
X-Received: by 2002:a05:620a:2546:b0:767:a1ab:b3db with SMTP id s6-20020a05620a254600b00767a1abb3dbmr2579014qko.16.1688669738038;
        Thu, 06 Jul 2023 11:55:38 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v5 07/15] xen/x86: Tweak PDC bits when using HWP
Date: Thu,  6 Jul 2023 14:54:32 -0400
Message-ID: <20230706185440.48333-8-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230706185440.48333-1-jandryuk@gmail.com>
References: <20230706185440.48333-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Qubes testing of HWP support had a report of a laptop, Thinkpad X1
Carbon Gen 4 with a Skylake processor, locking up during boot when HWP
is enabled.  A user found a kernel bug that seems to be the same issue:
https://bugzilla.kernel.org/show_bug.cgi?id=110941.

That bug was fixed by Linux commit a21211672c9a ("ACPI / processor:
Request native thermal interrupt handling via _OSC").  The tl;dr is SMM
crashes when it receives thermal interrupts, so Linux calls the ACPI
_OSC method to take over interrupt handling.

The Linux fix looks at the CPU features to decide whether or not to call
_OSC with bit 12 set to take over native interrupt handling.  Xen needs
some way to communicate HWP to Dom0 for making an equivalent call.

Xen exposes modified PDC bits via the platform_op set_pminfo hypercall.
Expand that to set bit 12 when HWP is present and in use.

Any generated interrupt would be handled by Xen's thermal drive, which
clears the status.

Bit 12 isn't named in the linux header and is open coded in Linux's
usage.  Name it ACPI_PDC_CPPC_NATIVE_INTR.

This will need a corresponding linux patch to pick up and apply the PDC
bits.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
v5:
Minor fixup for feature_hwp removal
Use cpurfreq.h for declaration

v4:
Added __ro_after_init
s/ACPI_PDC_CPPC_NTV_INT/ACPI_PDC_CPPC_NATIVE_INTR/
Remove _IA32_
Fixup for opt_cpufreq_hwp removal
Add Jan Reviewed-by

v3:
New
---
 xen/arch/x86/acpi/cpufreq/hwp.c      | 9 +++++++++
 xen/arch/x86/acpi/lib.c              | 5 +++++
 xen/arch/x86/cpu/mcheck/mce_intel.c  | 6 ++++++
 xen/arch/x86/include/asm/msr-index.h | 1 +
 xen/include/acpi/cpufreq/cpufreq.h   | 1 +
 xen/include/acpi/pdc_intel.h         | 1 +
 6 files changed, 23 insertions(+)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index 1ac07bbeb1..ce897d566f 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -12,6 +12,8 @@
 #include <asm/msr.h>
 #include <acpi/cpufreq/cpufreq.h>
 
+static bool __ro_after_init hwp_in_use;
+
 static bool __ro_after_init feature_hwp_notification;
 static bool __ro_after_init feature_hwp_activity_window;
 
@@ -150,6 +152,11 @@ static int __init cf_check cpufreq_gov_hwp_init(void)
 }
 __initcall(cpufreq_gov_hwp_init);
 
+bool hwp_active(void)
+{
+    return hwp_in_use;
+}
+
 static bool __init hwp_available(void)
 {
     unsigned int eax;
@@ -202,6 +209,8 @@ static bool __init hwp_available(void)
     hwp_verbose("HW_FEEDBACK %ssupported\n",
                 (eax & CPUID6_EAX_HW_FEEDBACK) ? "" : "not ");
 
+    hwp_in_use = true;
+
     hwp_info("Using HWP for cpufreq\n");
 
     return true;
diff --git a/xen/arch/x86/acpi/lib.c b/xen/arch/x86/acpi/lib.c
index 43831b92d1..51cb082ca0 100644
--- a/xen/arch/x86/acpi/lib.c
+++ b/xen/arch/x86/acpi/lib.c
@@ -26,6 +26,8 @@
 #include <asm/fixmap.h>
 #include <asm/mwait.h>
 
+#include <acpi/cpufreq/cpufreq.h>
+
 u32 __read_mostly acpi_smi_cmd;
 u8 __read_mostly acpi_enable_value;
 u8 __read_mostly acpi_disable_value;
@@ -140,5 +142,8 @@ int arch_acpi_set_pdc_bits(u32 acpi_id, u32 *pdc, u32 mask)
 	    !(ecx & CPUID5_ECX_INTERRUPT_BREAK))
 		pdc[2] &= ~(ACPI_PDC_C_C1_FFH | ACPI_PDC_C_C2C3_FFH);
 
+	if (hwp_active())
+		pdc[2] |= ACPI_PDC_CPPC_NATIVE_INTR;
+
 	return 0;
 }
diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index 2f23f02923..4045c6591d 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -15,6 +15,9 @@
 #include <asm/p2m.h>
 #include <asm/mce.h>
 #include <asm/apic.h>
+
+#include <acpi/cpufreq/cpufreq.h>
+
 #include "mce.h"
 #include "x86_mca.h"
 #include "barrier.h"
@@ -64,6 +67,9 @@ static void cf_check intel_thermal_interrupt(struct cpu_user_regs *regs)
 
     ack_APIC_irq();
 
+    if ( hwp_active() )
+        wrmsr_safe(MSR_HWP_STATUS, 0);
+
     if ( NOW() < per_cpu(next, cpu) )
         return;
 
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 68407bd707..c8f507c92b 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -157,6 +157,7 @@
 #define MSR_HWP_CAPABILITIES                0x00000771
 #define MSR_HWP_INTERRUPT                   0x00000773
 #define MSR_HWP_REQUEST                     0x00000774
+#define MSR_HWP_STATUS                      0x00000777
 
 #define MSR_X2APIC_FIRST                    0x00000800
 #define MSR_X2APIC_LAST                     0x000008ff
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index c965a8c6b6..ccbd6ea4c5 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -253,5 +253,6 @@ void intel_feature_detect(struct cpufreq_policy *policy);
 
 int hwp_cmdline_parse(const char *s, const char *e);
 int hwp_register_driver(void);
+bool hwp_active(void);
 
 #endif /* __XEN_CPUFREQ_PM_H__ */
diff --git a/xen/include/acpi/pdc_intel.h b/xen/include/acpi/pdc_intel.h
index 4fb719d6f5..abaa098b51 100644
--- a/xen/include/acpi/pdc_intel.h
+++ b/xen/include/acpi/pdc_intel.h
@@ -17,6 +17,7 @@
 #define ACPI_PDC_C_C1_FFH		(0x0100)
 #define ACPI_PDC_C_C2C3_FFH		(0x0200)
 #define ACPI_PDC_SMP_P_HWCOORD		(0x0800)
+#define ACPI_PDC_CPPC_NATIVE_INTR	(0x1000)
 
 #define ACPI_PDC_EST_CAPABILITY_SMP	(ACPI_PDC_SMP_C1PT | \
 					 ACPI_PDC_C_C1_HALT | \
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 18:55:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 18:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559981.875535 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8m-0006Zw-Ks; Thu, 06 Jul 2023 18:55:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559981.875535; Thu, 06 Jul 2023 18:55:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8m-0006Zn-Fb; Thu, 06 Jul 2023 18:55:44 +0000
Received: by outflank-mailman (input) for mailman id 559981;
 Thu, 06 Jul 2023 18:55:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zM/b=CY=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qHU8k-0003x8-Vn
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 18:55:42 +0000
Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com
 [2607:f8b0:4864:20::734])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b486abfb-1c2e-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 20:55:42 +0200 (CEST)
Received: by mail-qk1-x734.google.com with SMTP id
 af79cd13be357-7659c6cae2cso92086285a.1
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 11:55:42 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 g25-20020ae9e119000000b0075b168fcde9sm1015297qkm.77.2023.07.06.11.55.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 06 Jul 2023 11:55:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b486abfb-1c2e-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688669741; x=1691261741;
        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=aw1/CynLpBcgrYjNJfRHcPPsQKW2D4eyDyqElDmf4oI=;
        b=nJjjohg+MptI1ijKbY1o3ZwqWvYJXGZh/wApwyE5GI8FI4L0UxGDkx0sVne5xp8vJc
         jajH/ufRjam/l3ed/k7V8XsibGbXrKlM52gCM5ITjfbLSU1sqkrq2gv7agH2mwDslPlq
         ae/aUoX3RjTvSRBgpTMZ9JZ+ba0u0cisYGE5wJWvXaGHMI97Y2VETu3c6qlNzXwmk19z
         QrEJ3VyRin21RN9mKMD0aSAvVY3YWU3PNphv8PnPi9Jesd3mya9X3DT5WboUCZ4y6H8t
         e0xoDoi/BTZN7xTZb9SD+afFBJN2BA1EPro+SgpMpSwOf7QjoBJIacHs44KMaMW3ttlw
         ZSzw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688669741; x=1691261741;
        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=aw1/CynLpBcgrYjNJfRHcPPsQKW2D4eyDyqElDmf4oI=;
        b=lrS7tyLV+6faJEU8YPn32oK6zlo8JKCVS7K5o4ddVbIMvy+ibjN3VC7Ix1yoyDxfi2
         GTQ3o29UsLxCCCSmhwLuixdj6tU3EfZmpdkLC06j8Zq4aQMIthzaKD2DOkL+d1ngTM6I
         TVKqgzFxRnFX+wSwRK3Px01fbqqFvWLNsz4dBf870bnTpJ4al9WK5tYsYt1UMP17I4DO
         nCXK3oIMpPpUnUZh4S9kaGpSCRKsSjjhnZgs3/c0yTfrUzLWZdtaaH9TNXs8Q8p5llzO
         OAS3wJYJxyVt725idg+/D7yvLLc7BdWNsOFZTpN9zRZ1adp/EYg4nJzBSsXGkgONt7rG
         FXBA==
X-Gm-Message-State: ABy/qLY+AM9y8t/7kftjfeOMzIS9V+rB26T28X4PkLpLeZvuDfALHLxG
	oacjYVZLWgv0xGY7cw/rE3QsPFD3ivc=
X-Google-Smtp-Source: APBJJlHt8LClt1JdqMYxV6/OpGoYIA6wPZewZm8knNKhGf1/HJVF/0Fp4ML9DeWuRjd+ldN+9i5U4g==
X-Received: by 2002:a05:620a:668c:b0:767:671b:250f with SMTP id qh12-20020a05620a668c00b00767671b250fmr2017519qkn.52.1688669740645;
        Thu, 06 Jul 2023 11:55:40 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v5 08/15] xenpm: Change get-cpufreq-para output for hwp
Date: Thu,  6 Jul 2023 14:54:33 -0400
Message-ID: <20230706185440.48333-9-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230706185440.48333-1-jandryuk@gmail.com>
References: <20230706185440.48333-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

When using HWP, some of the returned data is not applicable.  In that
case, we should just omit it to avoid confusing the user.  So switch to
printing the base and max frequencies since those are relevant to HWP.
Similarly, stop printing the CPU frequencies since those do not apply.
The scaling fields are also no longer printed.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v5:
Use XEN_HWP_DRIVER_NAME
Add Jan's Ack

v4:
s/turbo/max/
Check for XEN_HWP_DRIVER driver instead of "-internal"

v2:
Use full governor name XEN_HWP_GOVERNOR to change output
Style fixes
---
 tools/misc/xenpm.c | 83 +++++++++++++++++++++++++---------------------
 1 file changed, 46 insertions(+), 37 deletions(-)

diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 1c474c3b59..21c93386de 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -711,6 +711,7 @@ void start_gather_func(int argc, char *argv[])
 /* print out parameters about cpu frequency */
 static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
 {
+    bool hwp = strcmp(p_cpufreq->scaling_driver, XEN_HWP_DRIVER_NAME) == 0;
     int i;
 
     printf("cpu id               : %d\n", cpuid);
@@ -720,49 +721,57 @@ static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
         printf(" %d", p_cpufreq->affected_cpus[i]);
     printf("\n");
 
-    printf("cpuinfo frequency    : max [%u] min [%u] cur [%u]\n",
-           p_cpufreq->cpuinfo_max_freq,
-           p_cpufreq->cpuinfo_min_freq,
-           p_cpufreq->cpuinfo_cur_freq);
+    if ( hwp )
+        printf("cpuinfo frequency    : base [%u] max [%u]\n",
+               p_cpufreq->cpuinfo_min_freq,
+               p_cpufreq->cpuinfo_max_freq);
+    else
+        printf("cpuinfo frequency    : max [%u] min [%u] cur [%u]\n",
+               p_cpufreq->cpuinfo_max_freq,
+               p_cpufreq->cpuinfo_min_freq,
+               p_cpufreq->cpuinfo_cur_freq);
 
     printf("scaling_driver       : %s\n", p_cpufreq->scaling_driver);
 
-    printf("scaling_avail_gov    : %s\n",
-           p_cpufreq->scaling_available_governors);
-
-    printf("current_governor     : %s\n", p_cpufreq->u.s.scaling_governor);
-    if ( !strncmp(p_cpufreq->u.s.scaling_governor,
-                  "userspace", CPUFREQ_NAME_LEN) )
-    {
-        printf("  userspace specific :\n");
-        printf("    scaling_setspeed : %u\n",
-               p_cpufreq->u.s.u.userspace.scaling_setspeed);
-    }
-    else if ( !strncmp(p_cpufreq->u.s.scaling_governor,
-                       "ondemand", CPUFREQ_NAME_LEN) )
+    if ( !hwp )
     {
-        printf("  ondemand specific  :\n");
-        printf("    sampling_rate    : max [%u] min [%u] cur [%u]\n",
-               p_cpufreq->u.s.u.ondemand.sampling_rate_max,
-               p_cpufreq->u.s.u.ondemand.sampling_rate_min,
-               p_cpufreq->u.s.u.ondemand.sampling_rate);
-        printf("    up_threshold     : %u\n",
-               p_cpufreq->u.s.u.ondemand.up_threshold);
-    }
+        printf("scaling_avail_gov    : %s\n",
+               p_cpufreq->scaling_available_governors);
 
-    printf("scaling_avail_freq   :");
-    for ( i = 0; i < p_cpufreq->freq_num; i++ )
-        if ( p_cpufreq->scaling_available_frequencies[i] ==
-             p_cpufreq->u.s.scaling_cur_freq )
-            printf(" *%d", p_cpufreq->scaling_available_frequencies[i]);
-        else
-            printf(" %d", p_cpufreq->scaling_available_frequencies[i]);
-    printf("\n");
+        printf("current_governor     : %s\n", p_cpufreq->u.s.scaling_governor);
+        if ( !strncmp(p_cpufreq->u.s.scaling_governor,
+                      "userspace", CPUFREQ_NAME_LEN) )
+        {
+            printf("  userspace specific :\n");
+            printf("    scaling_setspeed : %u\n",
+                   p_cpufreq->u.s.u.userspace.scaling_setspeed);
+        }
+        else if ( !strncmp(p_cpufreq->u.s.scaling_governor,
+                           "ondemand", CPUFREQ_NAME_LEN) )
+        {
+            printf("  ondemand specific  :\n");
+            printf("    sampling_rate    : max [%u] min [%u] cur [%u]\n",
+                   p_cpufreq->u.s.u.ondemand.sampling_rate_max,
+                   p_cpufreq->u.s.u.ondemand.sampling_rate_min,
+                   p_cpufreq->u.s.u.ondemand.sampling_rate);
+            printf("    up_threshold     : %u\n",
+                   p_cpufreq->u.s.u.ondemand.up_threshold);
+        }
+
+        printf("scaling_avail_freq   :");
+        for ( i = 0; i < p_cpufreq->freq_num; i++ )
+            if ( p_cpufreq->scaling_available_frequencies[i] ==
+                 p_cpufreq->u.s.scaling_cur_freq )
+                printf(" *%d", p_cpufreq->scaling_available_frequencies[i]);
+            else
+                printf(" %d", p_cpufreq->scaling_available_frequencies[i]);
+        printf("\n");
 
-    printf("scaling frequency    : max [%u] min [%u] cur [%u]\n",
-           p_cpufreq->u.s.scaling_max_freq,
-           p_cpufreq->u.s.scaling_min_freq,
-           p_cpufreq->u.s.scaling_cur_freq);
+        printf("scaling frequency    : max [%u] min [%u] cur [%u]\n",
+               p_cpufreq->u.s.scaling_max_freq,
+               p_cpufreq->u.s.scaling_min_freq,
+               p_cpufreq->u.s.scaling_cur_freq);
+    }
 
     printf("turbo mode           : %s\n",
            p_cpufreq->turbo_enabled ? "enabled" : "disabled or n/a");
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 18:55:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 18:55:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559984.875545 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8q-00077K-1c; Thu, 06 Jul 2023 18:55:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559984.875545; Thu, 06 Jul 2023 18:55:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8p-00076s-Ri; Thu, 06 Jul 2023 18:55:47 +0000
Received: by outflank-mailman (input) for mailman id 559984;
 Thu, 06 Jul 2023 18:55:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zM/b=CY=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qHU8o-0003x8-Ha
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 18:55:46 +0000
Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com
 [2607:f8b0:4864:20::730])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b6b5a3cf-1c2e-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 20:55:46 +0200 (CEST)
Received: by mail-qk1-x730.google.com with SMTP id
 af79cd13be357-76754b9eac0so104080485a.0
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 11:55:46 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 g25-20020ae9e119000000b0075b168fcde9sm1015297qkm.77.2023.07.06.11.55.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 06 Jul 2023 11:55:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b6b5a3cf-1c2e-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688669744; x=1691261744;
        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=5g90NEIr2gEQRrKv4KW4CuJMuwsS8xE3NxELsPnfYWs=;
        b=T9B/rbXisqKcz3wjgtmoVu7LdeqFGH4UAy8BoQR86t/OyPsZbWT0r+K2WAUV02EDRR
         UyJM7tXdj9KkZ082Bhrp5eNr4HI5X38ndXHjXFIWmHyGPyAHC4N6TC3LFQIsIHTtv9wK
         uCz43pF7Ql6U9GskVfBfoOTikWovLgrvSiCllHIXfmd7XFrmrKx4MXv0lXnkcB3n2pBg
         Fu+eD955SYfdcdFIedmoaO2bHL8UYmQYfkCCYWXrwiimZgAmDsBxQ33jlM/jMVDADVjS
         o0WWBitcXgZObSAu2jREoAPbotfP/jlvOCq8z1iT61smB5S09H9FBAPq7EF8nO4eig10
         fLZw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688669744; x=1691261744;
        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=5g90NEIr2gEQRrKv4KW4CuJMuwsS8xE3NxELsPnfYWs=;
        b=Jlc1kqN7WSWI94fQIi7lO2L+alTBmuo1hUEp8nDxqRfBwfoop0KxnHKhp17xy47NLE
         rfvym67xpLLNdEBX9fiivgJTj38bo3j1PYJ5F6TbzjDMSz6Z10xPCkIVADovpmgjg8sc
         Rz8DjRlE5GLTxuFeWrkXT83GyK9VGnPOf7saVTIX3/k6dZHH1bvHMKSeeUt4Z8QxtOVL
         5TyBhj8shDXdZ05tHQf1dQqB9REol+/Ni/r4lWhfa45G2hFkVrtrX2KN1G+SnCJhy6HF
         aWao+Db/wq8LsRILdyinXjiW+wTj5EKUUnppbsimUi0caB9QWgtNvCNAXM0xESS4r433
         Ym3Q==
X-Gm-Message-State: ABy/qLaFyVXTkqmXD6prfU/WHjHfH5L7rlG7ovTo9X/FsppyEFtFYJP5
	qONUSzMtvIUGmCLPU8pQ4oli7+6riC0=
X-Google-Smtp-Source: APBJJlFBbgTddzz4gkYjb55I0xVyztqRXSWUHbdU49ztUxKJdfHmghk89ZbnvnxzRzGJtEZKjkonew==
X-Received: by 2002:a05:620a:4441:b0:767:159f:eb62 with SMTP id w1-20020a05620a444100b00767159feb62mr3114315qkp.70.1688669744488;
        Thu, 06 Jul 2023 11:55:44 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v5 10/15] libxc: Include cppc_para in definitions
Date: Thu,  6 Jul 2023 14:54:35 -0400
Message-ID: <20230706185440.48333-11-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230706185440.48333-1-jandryuk@gmail.com>
References: <20230706185440.48333-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Expose the cppc_para fields through libxc.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
---
v4:
Rename hwp to cppc
Add Anthony's Ack
---
 tools/include/xenctrl.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index 8aedb952a0..2092632296 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1892,6 +1892,7 @@ int xc_smt_disable(xc_interface *xch);
  */
 typedef struct xen_userspace xc_userspace_t;
 typedef struct xen_ondemand xc_ondemand_t;
+typedef struct xen_cppc_para xc_cppc_para_t;
 
 struct xc_get_cpufreq_para {
     /* IN/OUT variable */
@@ -1923,6 +1924,7 @@ struct xc_get_cpufreq_para {
                 xc_ondemand_t ondemand;
             } u;
         } s;
+        xc_cppc_para_t cppc_para;
     } u;
 
     int32_t turbo_enabled;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 18:55:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 18:55:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559985.875548 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8q-0007Du-GN; Thu, 06 Jul 2023 18:55:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559985.875548; Thu, 06 Jul 2023 18:55:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8q-0007Cv-8j; Thu, 06 Jul 2023 18:55:48 +0000
Received: by outflank-mailman (input) for mailman id 559985;
 Thu, 06 Jul 2023 18:55:47 +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
 <SRS0=zM/b=CY=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qHU8p-0003x0-6F
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 18:55:47 +0000
Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com
 [2607:f8b0:4864:20::336])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b6062e8e-1c2e-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 20:55:45 +0200 (CEST)
Received: by mail-ot1-x336.google.com with SMTP id
 46e09a7af769-6b5d6a05b6dso912886a34.0
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 11:55:45 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 g25-20020ae9e119000000b0075b168fcde9sm1015297qkm.77.2023.07.06.11.55.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 06 Jul 2023 11:55:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b6062e8e-1c2e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688669743; x=1691261743;
        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=UeS/hmy10nz4aQykj0+Uw88/Yi5kbVY8pjPL/tcCOMQ=;
        b=gtMbL1byL9r5kQz4Fo46/iY/OKMCNrd5M2IQA2Wjh3svqmst4yZrwITfXgQtBzs4B8
         XQCcurWAH84U68X675WIm+AvC2x38zP8ccNfcxnCHhnh1eBgGx8sTpP+GGI3tdF3JEE6
         47+gBRyICKyZhy/DmhR7r2kUClK1GWgilwwtWXNxJULdnJLjVPpBKoLg0bK5N8kOy8pT
         z5HBDu5/Mx6oQN6BX4gK7nLL8Ae1dWt7UEgtauOXEUsbEQqXERkPI9hHG9Z0iSPUlVRL
         OuMqOpezXVbbnkREfboLByl6l0YL/dx/nKH7tGyZgU28U0elB5SVk72pW83tYE2lXZ4K
         gbfg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688669743; x=1691261743;
        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=UeS/hmy10nz4aQykj0+Uw88/Yi5kbVY8pjPL/tcCOMQ=;
        b=EFeoB7ee4UGGNp+WJxHu/LI2dncceBWDAyLS5cXcpDZsYS1vavyIBwc3OVPxc0lbrb
         qEAdK9ZMAfawdLYiVE7KlFP8yfBp/yBIZfjO+7qg7E8u9wSh4MLrXLd+GFlJahZ7ExPX
         enCL5ugmCbmpi8vpO/m69Q7Sdi2sDRK6DTlVWVDm4hBjwW8LS+jswIMJv5jTx+Wjwo26
         InaeFYceoRjkDpPQ9PV2c3dsWJmKngDql3JGuh+OEVyRoQ8BnSPNpyn2Hhu0oCrokCgc
         PJVRVqzi66hfEWicG9p/2Wa9xkF1BbT/S/g2SxUsZUjJpTEAnPYAvBIASX/zu9GpH9sM
         5QtA==
X-Gm-Message-State: ABy/qLatqTY2np5drtnkqmYgyzAvUKo6CtGFuDbW3VcYfSGxyTnY+zjx
	g3FIRWaTl78/38aYaM6DEr4GdNZ9Jvo=
X-Google-Smtp-Source: APBJJlHIR0YGsSPD1RKw0+RBFa980aVwxHoVDMzZrJY7bfraGqOVfFA/7G4ZF6G2E2sCjUewNhJaMw==
X-Received: by 2002:a05:6358:4308:b0:134:d26c:4a97 with SMTP id r8-20020a056358430800b00134d26c4a97mr3204325rwc.23.1688669743000;
        Thu, 06 Jul 2023 11:55:43 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 09/15] cpufreq: Export HWP parameters to userspace as CPPC
Date: Thu,  6 Jul 2023 14:54:34 -0400
Message-ID: <20230706185440.48333-10-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230706185440.48333-1-jandryuk@gmail.com>
References: <20230706185440.48333-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Extend xen_get_cpufreq_para to return hwp parameters.  HWP is an
implementation of ACPI CPPC (Collaborative Processor Performance
Control).  Use the CPPC name since that might be useful in the future
for AMD P-state.

We need the features bitmask to indicate fields supported by the actual
hardware - this only applies to activity window for the time being.

The HWP most_efficient is mapped to CPPC lowest_nonlinear, and guaranteed is
mapped to nominal.  CPPC has a guaranteed that is optional while nominal
is required.  ACPI spec says "If this register is not implemented, OSPM
assumes guaranteed performance is always equal to nominal performance."

The use of uint8_t parameters matches the hardware size.  uint32_t
entries grows the sysctl_t past the build assertion in setup.c.  The
uint8_t ranges are supported across multiple generations, so hopefully
they won't change.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
v2:
Style fixes
Don't bump XEN_SYSCTL_INTERFACE_VERSION
Drop cpufreq.h comment divider
Expand xen_hwp_para comment
Add HWP activity window mantissa/exponent defines
Handle union rename
Add const to get_hwp_para
Remove hw_ prefix from xen_hwp_para members
Use XEN_HWP_GOVERNOR
Use per_cpu for hwp_drv_data

v4:
Fixup for opt_cpufreq_hwp/hdc removal
get_hwp_para() takes cpu as arg
XEN_ prefix HWP_ACT_WINDOW_*
Drop HWP_ACT_WINDOW_EXPONENT_SHIFT - shift MASK
Remove Energy Bias (0-15) EPP fallback
Rename xen_hwp_para to xen_cppc_para
s/hwp/cppc/
Use scaling driver to switch output

v5:
Use XEN_HWP_DRIVER_NAME
Use cpufreq.h for declarations
Fixup some comments
Drop const from unsigned int cpu
Drop some unnecessary { }
Use strncmp
Switch sizeof(char) to sizeof(*scaling_available_governors)
Reindent copy_to_guest call
Add "HWP: " prefix to sysctl comments for cppc->hwp mapping
---
 xen/arch/x86/acpi/cpufreq/hwp.c    | 23 ++++++++++
 xen/drivers/acpi/pmstat.c          | 74 ++++++++++++++++--------------
 xen/include/acpi/cpufreq/cpufreq.h |  2 +
 xen/include/public/sysctl.h        | 56 ++++++++++++++++++++++
 4 files changed, 121 insertions(+), 34 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index ce897d566f..50b66a0449 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -508,6 +508,29 @@ static const struct cpufreq_driver __initconstrel hwp_cpufreq_driver =
     .update = hwp_cpufreq_update,
 };
 
+int get_hwp_para(unsigned int cpu,
+                 struct xen_cppc_para *cppc_para)
+{
+    const struct hwp_drv_data *data = per_cpu(hwp_drv_data, cpu);
+
+    if ( data == NULL )
+        return -ENODATA;
+
+    cppc_para->features         =
+        (feature_hwp_activity_window ? XEN_SYSCTL_CPPC_FEAT_ACT_WINDOW : 0);
+    cppc_para->lowest           = data->hw.lowest;
+    cppc_para->lowest_nonlinear = data->hw.most_efficient;
+    cppc_para->nominal          = data->hw.guaranteed;
+    cppc_para->highest          = data->hw.highest;
+    cppc_para->minimum          = data->minimum;
+    cppc_para->maximum          = data->maximum;
+    cppc_para->desired          = data->desired;
+    cppc_para->energy_perf      = data->energy_perf;
+    cppc_para->activity_window  = data->activity_window;
+
+    return 0;
+}
+
 int __init hwp_register_driver(void)
 {
     int ret;
diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index d67d99e62f..f674ef51aa 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -251,46 +251,52 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
     else
         strlcpy(op->u.get_para.scaling_driver, "Unknown", CPUFREQ_NAME_LEN);
 
-    if ( !(scaling_available_governors =
-           xzalloc_array(char, gov_num * CPUFREQ_NAME_LEN)) )
-        return -ENOMEM;
-    if ( (ret = read_scaling_available_governors(scaling_available_governors,
-                gov_num * CPUFREQ_NAME_LEN * sizeof(char))) )
+    if ( !strncmp(op->u.get_para.scaling_driver, XEN_HWP_DRIVER_NAME,
+                      CPUFREQ_NAME_LEN) )
+        ret = get_hwp_para(policy->cpu, &op->u.get_para.u.cppc_para);
+    else
     {
+        if ( !(scaling_available_governors =
+               xzalloc_array(char, gov_num * CPUFREQ_NAME_LEN)) )
+            return -ENOMEM;
+        if ( (ret = read_scaling_available_governors(
+                        scaling_available_governors,
+                        gov_num * CPUFREQ_NAME_LEN *
+                            sizeof(*scaling_available_governors) )) )
+        {
+            xfree(scaling_available_governors);
+            return ret;
+        }
+        ret = copy_to_guest(op->u.get_para.scaling_available_governors,
+                            scaling_available_governors,
+                            gov_num * CPUFREQ_NAME_LEN);
         xfree(scaling_available_governors);
-        return ret;
-    }
-    ret = copy_to_guest(op->u.get_para.scaling_available_governors,
-                scaling_available_governors, gov_num * CPUFREQ_NAME_LEN);
-    xfree(scaling_available_governors);
-    if ( ret )
-        return ret;
+        if ( ret )
+            return ret;
 
-    op->u.get_para.u.s.scaling_cur_freq = policy->cur;
-    op->u.get_para.u.s.scaling_max_freq = policy->max;
-    op->u.get_para.u.s.scaling_min_freq = policy->min;
+        op->u.get_para.u.s.scaling_cur_freq = policy->cur;
+        op->u.get_para.u.s.scaling_max_freq = policy->max;
+        op->u.get_para.u.s.scaling_min_freq = policy->min;
 
-    if ( policy->governor->name[0] )
-        strlcpy(op->u.get_para.u.s.scaling_governor,
-            policy->governor->name, CPUFREQ_NAME_LEN);
-    else
-        strlcpy(op->u.get_para.u.s.scaling_governor, "Unknown", CPUFREQ_NAME_LEN);
+        if ( policy->governor->name[0] )
+            strlcpy(op->u.get_para.u.s.scaling_governor,
+                policy->governor->name, CPUFREQ_NAME_LEN);
+        else
+            strlcpy(op->u.get_para.u.s.scaling_governor, "Unknown",
+                    CPUFREQ_NAME_LEN);
 
-    /* governor specific para */
-    if ( !strncasecmp(op->u.get_para.u.s.scaling_governor,
-                      "userspace", CPUFREQ_NAME_LEN) )
-    {
-        op->u.get_para.u.s.u.userspace.scaling_setspeed = policy->cur;
-    }
+        /* governor specific para */
+        if ( !strncasecmp(op->u.get_para.u.s.scaling_governor,
+                          "userspace", CPUFREQ_NAME_LEN) )
+            op->u.get_para.u.s.u.userspace.scaling_setspeed = policy->cur;
 
-    if ( !strncasecmp(op->u.get_para.u.s.scaling_governor,
-                      "ondemand", CPUFREQ_NAME_LEN) )
-    {
-        ret = get_cpufreq_ondemand_para(
-            &op->u.get_para.u.s.u.ondemand.sampling_rate_max,
-            &op->u.get_para.u.s.u.ondemand.sampling_rate_min,
-            &op->u.get_para.u.s.u.ondemand.sampling_rate,
-            &op->u.get_para.u.s.u.ondemand.up_threshold);
+        if ( !strncasecmp(op->u.get_para.u.s.scaling_governor,
+                          "ondemand", CPUFREQ_NAME_LEN) )
+            ret = get_cpufreq_ondemand_para(
+                &op->u.get_para.u.s.u.ondemand.sampling_rate_max,
+                &op->u.get_para.u.s.u.ondemand.sampling_rate_min,
+                &op->u.get_para.u.s.u.ondemand.sampling_rate,
+                &op->u.get_para.u.s.u.ondemand.up_threshold);
     }
 
     return ret;
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index ccbd6ea4c5..c5636edf0e 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -254,5 +254,7 @@ void intel_feature_detect(struct cpufreq_policy *policy);
 int hwp_cmdline_parse(const char *s, const char *e);
 int hwp_register_driver(void);
 bool hwp_active(void);
+int get_hwp_para(unsigned int cpu,
+                 struct xen_cppc_para *cppc_para);
 
 #endif /* __XEN_CPUFREQ_PM_H__ */
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 59700b02f2..a5f8369116 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -296,6 +296,61 @@ struct xen_ondemand {
     uint32_t up_threshold;
 };
 
+struct xen_cppc_para {
+    /* OUT */
+    /* activity_window supported if set */
+#define XEN_SYSCTL_CPPC_FEAT_ACT_WINDOW  (1 << 0)
+    uint32_t features; /* bit flags for features */
+    /*
+     * See Intel SDM: HWP Performance Range and Dynamic Capabilities
+     *
+     * These four are 0-255 hardware-provided values.  They "continuous,
+     * abstract unit-less, performance" values.  Smaller numbers are slower
+     * and larger ones are faster.
+     */
+    uint32_t lowest;
+    uint32_t lowest_nonlinear; /* HWP: most_efficient */
+    uint32_t nominal; /* HWP: guaranteed */
+    uint32_t highest;
+    /*
+     * See Intel SDM: IA32_HWP_REQUEST MSR (Address: 774H Logical Processor
+     * Scope)
+     *
+     * These are all hints, and the processor may deviate outside of them.
+     * Values below are 0-255.
+     *
+     * minimum and maximum can be set to the above hardware values to constrain
+     * operation.  The full range 0-255 is accepted and will be clipped by
+     * hardware.
+     */
+    uint32_t minimum;
+    uint32_t maximum;
+    /*
+     * An explicit performance hint, disabling hardware selection.
+     * 0 lets the hardware decide.
+     */
+    uint32_t desired;
+    /*
+     * Hint to hardware for energy/performance preference.
+     * 0:   Performance
+     * 128: Balance (Default)
+     * 255: Powersaving
+     */
+    uint32_t energy_perf;
+    /*
+     * Activity Window is a moving history window for the processor's operation
+     * calculations, controlling responsiveness.  Measured in microseconds
+     * encoded as:
+     *
+     * bits 6:0   - 7bit mantissa
+     * bits 9:7   - 3bit base-10 exponent
+     * btis 15:10 - Unused - must be 0
+     */
+#define XEN_CPPC_ACT_WINDOW_MANTISSA_MASK  0x07f
+#define XEN_CPPC_ACT_WINDOW_EXPONENT_MASK  0x380
+    uint32_t activity_window;
+};
+
 #define XEN_HWP_DRIVER_NAME "hwp"
 
 /*
@@ -333,6 +388,7 @@ struct xen_get_cpufreq_para {
                 struct  xen_ondemand ondemand;
             } u;
         } s;
+        struct xen_cppc_para cppc_para;
     } u;
 
     int32_t turbo_enabled;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 18:55:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 18:55:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559988.875563 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8s-0007pa-CJ; Thu, 06 Jul 2023 18:55:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559988.875563; Thu, 06 Jul 2023 18:55:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8s-0007oS-5s; Thu, 06 Jul 2023 18:55:50 +0000
Received: by outflank-mailman (input) for mailman id 559988;
 Thu, 06 Jul 2023 18:55:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zM/b=CY=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qHU8q-0003x8-Kx
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 18:55:48 +0000
Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com
 [2607:f8b0:4864:20::72d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b78a2727-1c2e-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 20:55:47 +0200 (CEST)
Received: by mail-qk1-x72d.google.com with SMTP id
 af79cd13be357-765a5b93b5bso103326185a.3
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 11:55:47 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 g25-20020ae9e119000000b0075b168fcde9sm1015297qkm.77.2023.07.06.11.55.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 06 Jul 2023 11:55:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b78a2727-1c2e-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688669746; x=1691261746;
        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=imeu59UbyEmxk/60do4rzt8IPOfqsoGRviRd+fRZmSg=;
        b=NHygVEY9QHYm0AxnCyYcRC5dW9Ivh6lam9Ug1/ng7OkZjORovjTOpUy2fmK3bMMHMo
         vC9KL5t7f2ru+WsNNRxf2WQHSa8FDWHNtTW44ozimEdJ3yCUu0hOL3pedcjQ+z7qbYP9
         ciEe9dlPQPKw0EQTwaJo7PtvKw5D8c6QxscJi49efTjcvvIxdw2XSQzpd7gB6YacqwlF
         RWm9+fDPXYu3R6dDdGLR1OP4K1oih2vwXb2O0Yd4NVVh92XwyWHjbglf8xtbfBu/j/nP
         ykn9KYVnfbr/d8OX/FGViAnncPW/3fO4LGFdQP9yQdfOqLliqfSYw+R2XFGBaF4dueAJ
         Fstw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688669746; x=1691261746;
        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=imeu59UbyEmxk/60do4rzt8IPOfqsoGRviRd+fRZmSg=;
        b=Bp0SAhJkJMbmBYT7gY1Y+/LKojO6bTmB/EWgQOCVl7U6VCcOXTMOmTi57oHMg703/4
         N3nHfLtDgbbMGf+JNjMQWElKqASsP84tEUylIduGQ9n0WIPt1qwZRT0HNNp8uFUfYcF9
         5ATKQOG5G9cfs+ocejz71CUqa2JPRAtUp8tM8ne2MMKv8nBBngLC0OALgoxTCd2tiBcA
         hSRWKk60Y4TNm/8PbTW+8/cHXDWVBCs3zIdtQklbfsnQw8iBfTrXvuUAjPJUJFrEbNq6
         4aZPjGgeeu0O3Btyux95vFAy/kk2R8yoJwST+nQn1GXMMpIUN8kMjy9pMnSsB/IgdObQ
         boBA==
X-Gm-Message-State: ABy/qLa0qZmiEpie9DXn7WBWvvD5Lfa1ejKHvMVT0HIBz4qISRruuiXY
	+dIADviIJyBHgeG6TrGWXo4nKwnln3c=
X-Google-Smtp-Source: APBJJlGRtr2Fnlb5yOuSTMEK/PcIgC735LSbHwdAe6KkPCEgJ5r1+PvRWk0d25RVB86Orqw4SB11Fg==
X-Received: by 2002:a37:b6c2:0:b0:767:32cd:5fe8 with SMTP id g185-20020a37b6c2000000b0076732cd5fe8mr2473424qkf.14.1688669745733;
        Thu, 06 Jul 2023 11:55:45 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v5 11/15] xenpm: Print HWP/CPPC parameters
Date: Thu,  6 Jul 2023 14:54:36 -0400
Message-ID: <20230706185440.48333-12-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230706185440.48333-1-jandryuk@gmail.com>
References: <20230706185440.48333-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Print HWP-specific parameters.  Some are always present, but others
depend on hardware support.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
v2:
Style fixes
Declare i outside loop
Replace repearted hardware/configured limits with spaces
Fixup for hw_ removal
Use XEN_HWP_GOVERNOR
Use HWP_ACT_WINDOW_EXPONENT_*
Remove energy_perf hw autonomous - 0 doesn't mean autonomous

v4:
Return activity_window from calculate_hwp_activity_window
Use blanks instead of _ in output
Use MASK_EXTR
Check XEN_HWP_DRIVER name since governor is no longer returned
s/hwp/cppc

v5:
Add Jan's Reviewed-by
---
 tools/misc/xenpm.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 21c93386de..3abd99fd20 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -708,6 +708,46 @@ void start_gather_func(int argc, char *argv[])
     pause();
 }
 
+static unsigned int calculate_activity_window(const xc_cppc_para_t *cppc,
+                                              const char **units)
+{
+    unsigned int mantissa = MASK_EXTR(cppc->activity_window,
+                                      XEN_CPPC_ACT_WINDOW_MANTISSA_MASK);
+    unsigned int exponent = MASK_EXTR(cppc->activity_window,
+                                      XEN_CPPC_ACT_WINDOW_EXPONENT_MASK);
+    unsigned int multiplier = 1;
+    unsigned int i;
+
+    /*
+     * SDM only states a 0 register is hardware selected, and doesn't mention
+     * a 0 mantissa with a non-0 exponent.  Only special case a 0 register.
+     */
+    if ( cppc->activity_window == 0 )
+    {
+        *units = "hardware selected";
+
+        return 0;
+    }
+
+    if ( exponent >= 6 )
+    {
+        *units = "s";
+        exponent -= 6;
+    }
+    else if ( exponent >= 3 )
+    {
+        *units = "ms";
+        exponent -= 3;
+    }
+    else
+        *units = "us";
+
+    for ( i = 0; i < exponent; i++ )
+        multiplier *= 10;
+
+    return mantissa * multiplier;
+}
+
 /* print out parameters about cpu frequency */
 static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
 {
@@ -772,6 +812,32 @@ static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
                p_cpufreq->u.s.scaling_min_freq,
                p_cpufreq->u.s.scaling_cur_freq);
     }
+    else
+    {
+        const xc_cppc_para_t *cppc = &p_cpufreq->u.cppc_para;
+
+        printf("cppc variables       :\n");
+        printf("  hardware limits    : lowest [%u] lowest nonlinear [%u]\n",
+               cppc->lowest, cppc->lowest_nonlinear);
+        printf("                     : nominal [%u] highest [%u]\n",
+               cppc->nominal, cppc->highest);
+        printf("  configured limits  : min [%u] max [%u] energy perf [%u]\n",
+               cppc->minimum, cppc->maximum, cppc->energy_perf);
+
+        if ( cppc->features & XEN_SYSCTL_CPPC_FEAT_ACT_WINDOW )
+        {
+            unsigned int activity_window;
+            const char *units;
+
+            activity_window = calculate_activity_window(cppc, &units);
+            printf("                     : activity_window [%u %s]\n",
+                   activity_window, units);
+        }
+
+        printf("                     : desired [%u%s]\n",
+               cppc->desired,
+               cppc->desired ? "" : " hw autonomous");
+    }
 
     printf("turbo mode           : %s\n",
            p_cpufreq->turbo_enabled ? "enabled" : "disabled or n/a");
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 18:55:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 18:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.559994.875575 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8w-0000BO-M1; Thu, 06 Jul 2023 18:55:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 559994.875575; Thu, 06 Jul 2023 18:55:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHU8w-0000Ai-IX; Thu, 06 Jul 2023 18:55:54 +0000
Received: by outflank-mailman (input) for mailman id 559994;
 Thu, 06 Jul 2023 18:55:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zM/b=CY=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qHU8v-0003x8-55
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 18:55:53 +0000
Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com
 [2607:f8b0:4864:20::730])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ba81e867-1c2e-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 20:55:52 +0200 (CEST)
Received: by mail-qk1-x730.google.com with SMTP id
 af79cd13be357-76571dae5feso102687985a.1
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 11:55:52 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 g25-20020ae9e119000000b0075b168fcde9sm1015297qkm.77.2023.07.06.11.55.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 06 Jul 2023 11:55:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ba81e867-1c2e-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688669751; x=1691261751;
        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=savaEWdvLzkx6DV1aoYiZExthvBmTcE7WQ2R0f6tjOA=;
        b=dx2pJ5Hntb6hN8xQftk2wa381Blwhqk+HNGADK8AiYAFwAeZ6qdX/NfhW/f8PKNuW5
         CYwu306lXp7sJW5kmJ5P8rl+220TA/XV8I5CM5a4rETUKbHGZFM9+JIUS6d4TB2+ncsM
         tspfuzmv6Tj+b2DZlGRINlOiBB+M73cxgGH7FcOeAmPCiEpDdfhcxCVUKxjkKvgQHGx2
         +9/OpyHzneck4X1oBsrjVbDT8FukL7Bq6bWX7NFw3thQbhmh8WQ/ALhiueF+ZXSe5HuU
         UqTEcg/25HqdQ2MviwpYMCsG74IYVJESP0EiHz0d0ZpQyCDNLXRB7FCY4DOOkJcew/wQ
         sUVQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688669751; x=1691261751;
        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=savaEWdvLzkx6DV1aoYiZExthvBmTcE7WQ2R0f6tjOA=;
        b=k/UFQDqOY8XcoBu3hTnficZEEN2a5YExD/Bfz0b8NnoPlFjqEnf1qYpTkGxeXDZXB0
         adLYLnHkHG3mHtn4/ukJBADAjUxPQuyd2oC+DuQyxxLPLB8MZba6qmthuhh0on+aiQPe
         BcQDo/R7F9z0N9qiuUVbv9SehGrUVC9WnMDL5gDOxY+ZL1LybwXqP96qlcuAacC6xHB4
         c+GR8bu899w/MJUPM+nHpcWypdt2bD2CEJBNBYWkiBkG5wMUFJpmcGp6JB1gS3DiLb1u
         xFTNf/KaU5vlzo7MXOe8lPTkdQPOf3iv1g5NVG/fUFRBCFoCFtzTKJWw5xTzI1Np/czN
         N3Nw==
X-Gm-Message-State: ABy/qLak25F+9zuOzxUE/kMLu+9fqlgBApRZp3s+VqkbE+yG4SUrAoPJ
	nDOQwzUy07GpoXQQKZgXp6aBQFE9YUQ=
X-Google-Smtp-Source: APBJJlGZxh8OJ53r93O4Ni5k7AnsFyxsi4nSVs12XTaJwI+OgQA+gzT5iOZzIXIdoCRQFI0euxc1Xg==
X-Received: by 2002:a05:620a:40d0:b0:767:3cfd:3eb1 with SMTP id g16-20020a05620a40d000b007673cfd3eb1mr3228782qko.52.1688669750734;
        Thu, 06 Jul 2023 11:55:50 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 12/15] xen: Add SET_CPUFREQ_HWP xen_sysctl_pm_op
Date: Thu,  6 Jul 2023 14:54:37 -0400
Message-ID: <20230706185440.48333-13-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230706185440.48333-1-jandryuk@gmail.com>
References: <20230706185440.48333-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add SET_CPUFREQ_HWP xen_sysctl_pm_op to set HWP parameters.  The sysctl
supports setting multiple values simultaneously as indicated by the
set_params bits.  This allows atomically applying new HWP configuration
via a single wrmsr.

XEN_SYSCTL_HWP_SET_PRESET_BALANCE/PERFORMANCE/POWERSAVE provide three
common presets.  Setting them depends on hardware limits which the
hypervisor is already caching.  So using them allows skipping a
hypercall to query the limits (lowest/highest) to then set those same
values.  The code is organized to allow a preset to be refined with
additional parameters if desired.

"most_efficient" and "guaranteed" could be additional presets in the
future, but the are not added now.  Those levels can change at runtime,
but we don't have code in place to monitor and update for those events.

Since activity window may not be supported by all hardware, omit writing
it when not supported, and return that fact to userspace by updating
set_params.

CPPC parameter checking disallows setting reserved bytes and ensure
values are only non-zero when the corresponding set_params bit is set.
There is no range checking (0-255 is allowed) since hardware is
documented to clip internally.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>

---
v5:
Use cpufreq.h for include
Add () around bit test
Fix Configure typo
Drop duplicated energy_perf comment
Define XEN_SYSCTL_CPPC_ACT_WINDOW_MASK from *_MANTISSA_MASK and *_EXPONENT_MASK
Re-order XEN_SYSCTL_CPPC_SET_* flags to match field and hardware order.
Remove const from set_cppc param to update set_params
Skip Activity Window if not supported by hardware and clear set_params
Make parameter parsing consistent
Add an exit path when there are no parameters to write.
Expand the header file to cover the IN/OUT set_params.
Remove the "desired" lowest/highest checking as hardware clips internally

v4:
Remove IA32_ENERGY_BIAS support
Validate parameters don't exceed 255
Use CPPC/cppc name
set_cppc_para() add const
set_cppc_para() return hwp_cpufreq_target()
Expand sysctl comments

v3:
Remove cpufreq_governor_internal from set_cpufreq_hwp

v2:
Update for naming anonymous union
Drop hwp_err for invalid input in set_hwp_para()
Drop uint16_t cast in XEN_SYSCTL_HWP_SET_PARAM_MASK
Drop parens for HWP_SET_PRESET defines
Reference activity_window format comment
Place SET_CPUFREQ_HWP after SET_CPUFREQ_PARA
Add {HWP,IA32}_ENERGY_PERF_MAX_{PERFORMANCE,POWERSAVE} defines
Order defines before fields in sysctl.h
Use XEN_HWP_GOVERNOR
Use per_cpu for hwp_drv_data
---
 xen/arch/x86/acpi/cpufreq/hwp.c    | 101 +++++++++++++++++++++++++++++
 xen/drivers/acpi/pmstat.c          |  17 +++++
 xen/include/acpi/cpufreq/cpufreq.h |   2 +
 xen/include/public/sysctl.h        |  64 ++++++++++++++++++
 4 files changed, 184 insertions(+)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index 50b66a0449..32df9af4b3 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -21,6 +21,10 @@ static bool __ro_after_init feature_hdc;
 
 static bool __ro_after_init opt_cpufreq_hdc = true;
 
+#define HWP_ENERGY_PERF_MAX_PERFORMANCE 0
+#define HWP_ENERGY_PERF_BALANCE         0x80
+#define HWP_ENERGY_PERF_MAX_POWERSAVE   0xff
+
 union hwp_request
 {
     struct
@@ -531,6 +535,103 @@ int get_hwp_para(unsigned int cpu,
     return 0;
 }
 
+int set_hwp_para(struct cpufreq_policy *policy,
+                 struct xen_set_cppc_para *set_cppc)
+{
+    unsigned int cpu = policy->cpu;
+    struct hwp_drv_data *data = per_cpu(hwp_drv_data, cpu);
+    bool cleared_act_window = false;
+
+    if ( data == NULL )
+        return -EINVAL;
+
+    /* Validate all parameters - Disallow reserved bits. */
+    if ( set_cppc->minimum > 255 ||
+         set_cppc->maximum > 255 ||
+         set_cppc->desired > 255 ||
+         set_cppc->energy_perf > 255 ||
+         set_cppc->set_params & ~XEN_SYSCTL_CPPC_SET_PARAM_MASK ||
+         set_cppc->activity_window & ~XEN_SYSCTL_CPPC_ACT_WINDOW_MASK )
+        return -EINVAL;
+
+    /* Only allow values if params bit is set. */
+    if ( (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_DESIRED) &&
+          set_cppc->desired) ||
+         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_MINIMUM) &&
+          set_cppc->minimum) ||
+         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_MAXIMUM) &&
+          set_cppc->maximum) ||
+         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ENERGY_PERF) &&
+          set_cppc->energy_perf) ||
+         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ACT_WINDOW) &&
+          set_cppc->activity_window) )
+        return -EINVAL;
+
+    /* Clear out activity window if lacking HW supported. */
+    if ( (set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ACT_WINDOW) &&
+         !feature_hwp_activity_window ) {
+        set_cppc->set_params &= ~XEN_SYSCTL_CPPC_SET_ACT_WINDOW;
+        cleared_act_window = true;
+    }
+
+    /* Return if there is nothing to do. */
+    if ( set_cppc->set_params == 0 )
+        return cleared_act_window ? 0 : -EINVAL;
+
+    /* Apply presets */
+    switch ( set_cppc->set_params & XEN_SYSCTL_CPPC_SET_PRESET_MASK )
+    {
+    case XEN_SYSCTL_CPPC_SET_PRESET_POWERSAVE:
+        data->minimum = data->hw.lowest;
+        data->maximum = data->hw.lowest;
+        data->activity_window = 0;
+        data->energy_perf = HWP_ENERGY_PERF_MAX_POWERSAVE;
+        data->desired = 0;
+        break;
+
+    case XEN_SYSCTL_CPPC_SET_PRESET_PERFORMANCE:
+        data->minimum = data->hw.highest;
+        data->maximum = data->hw.highest;
+        data->activity_window = 0;
+        data->energy_perf = HWP_ENERGY_PERF_MAX_PERFORMANCE;
+        data->desired = 0;
+        break;
+
+    case XEN_SYSCTL_CPPC_SET_PRESET_BALANCE:
+        data->minimum = data->hw.lowest;
+        data->maximum = data->hw.highest;
+        data->activity_window = 0;
+        data->energy_perf = HWP_ENERGY_PERF_BALANCE;
+        data->desired = 0;
+        break;
+
+    case XEN_SYSCTL_CPPC_SET_PRESET_NONE:
+        break;
+
+    default:
+        return -EINVAL;
+    }
+
+    /* Further customize presets if needed */
+    if ( set_cppc->set_params & XEN_SYSCTL_CPPC_SET_MINIMUM )
+        data->minimum = set_cppc->minimum;
+
+    if ( set_cppc->set_params & XEN_SYSCTL_CPPC_SET_MAXIMUM )
+        data->maximum = set_cppc->maximum;
+
+    if ( set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ENERGY_PERF )
+        data->energy_perf = set_cppc->energy_perf;
+
+    if ( set_cppc->set_params & XEN_SYSCTL_CPPC_SET_DESIRED )
+        data->desired = set_cppc->desired;
+
+    if ( set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ACT_WINDOW )
+        data->activity_window = set_cppc->activity_window &
+                                XEN_SYSCTL_CPPC_ACT_WINDOW_MASK;
+
+    return hwp_cpufreq_target(policy, 0, 0);
+}
+
 int __init hwp_register_driver(void)
 {
     int ret;
diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index f674ef51aa..cfd7fdfb1c 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -400,6 +400,19 @@ static int set_cpufreq_para(struct xen_sysctl_pm_op *op)
     return ret;
 }
 
+static int set_cpufreq_cppc(struct xen_sysctl_pm_op *op)
+{
+    struct cpufreq_policy *policy = per_cpu(cpufreq_cpu_policy, op->cpuid);
+
+    if ( !policy || !policy->governor )
+        return -EINVAL;
+
+    if ( !hwp_active() )
+        return -EINVAL;
+
+    return set_hwp_para(policy, &op->u.set_cppc);
+}
+
 int do_pm_op(struct xen_sysctl_pm_op *op)
 {
     int ret = 0;
@@ -472,6 +485,10 @@ int do_pm_op(struct xen_sysctl_pm_op *op)
         break;
     }
 
+    case SET_CPUFREQ_CPPC:
+        ret = set_cpufreq_cppc(op);
+        break;
+
     case GET_CPUFREQ_AVGFREQ:
     {
         op->u.get_avgfreq = cpufreq_driver_getavg(op->cpuid, USR_GETAVG);
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index c5636edf0e..c6b8c991b4 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -256,5 +256,7 @@ int hwp_register_driver(void);
 bool hwp_active(void);
 int get_hwp_para(unsigned int cpu,
                  struct xen_cppc_para *cppc_para);
+int set_hwp_para(struct cpufreq_policy *policy,
+                 struct xen_set_cppc_para *set_cppc);
 
 #endif /* __XEN_CPUFREQ_PM_H__ */
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index a5f8369116..2457bf5e8f 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -351,6 +351,68 @@ struct xen_cppc_para {
     uint32_t activity_window;
 };
 
+/*
+ * Set CPPC values.
+ *
+ * Configure the parameters for CPPC.  Set bits in set_params control which
+ * values are applied.  If a bit is not set in set_params, the field must be
+ * zero.
+ *
+ * For HWP specifically, values must be limited to 0-255 or within
+ * XEN_SYSCTL_CPPC_ACT_WINDOW_MASK for activity window.  Set bits outside the
+ * range will be returned as -EINVAL.
+ *
+ * Activity Window may not be supported by the hardware.  In that case, the
+ * returned set_params will clear XEN_SYSCTL_CPPC_SET_ACT_WINDOW to indicate
+ * that it was not applied - though the rest of the values will be applied.
+ *
+ * There are a set of presets along with individual fields.  Presets are
+ * applied first, and then individual fields.  This allows customizing
+ * a preset without having to specify every value.
+ *
+ * The preset options values are as follows:
+ *
+ * preset      | minimum | maxium  | energy_perf
+ * ------------+---------+---------+----------------
+ * powersave   | lowest  | lowest  | powersave (255)
+ * ------------+---------+---------+----------------
+ * balance     | lowest  | highest | balance (128)
+ * ------------+---------+---------+----------------
+ * performance | highest | highest | performance (0)
+ *
+ * desired and activity_window are set to 0, hardware selected.
+ */
+struct xen_set_cppc_para {
+#define XEN_SYSCTL_CPPC_SET_MINIMUM              (1U << 0)
+#define XEN_SYSCTL_CPPC_SET_MAXIMUM              (1U << 1)
+#define XEN_SYSCTL_CPPC_SET_DESIRED              (1U << 2)
+#define XEN_SYSCTL_CPPC_SET_ENERGY_PERF          (1U << 3)
+#define XEN_SYSCTL_CPPC_SET_ACT_WINDOW           (1U << 4)
+#define XEN_SYSCTL_CPPC_SET_PRESET_MASK          0xf0000000
+#define XEN_SYSCTL_CPPC_SET_PRESET_NONE          0x00000000
+#define XEN_SYSCTL_CPPC_SET_PRESET_BALANCE       0x10000000
+#define XEN_SYSCTL_CPPC_SET_PRESET_POWERSAVE     0x20000000
+#define XEN_SYSCTL_CPPC_SET_PRESET_PERFORMANCE   0x30000000
+#define XEN_SYSCTL_CPPC_SET_PARAM_MASK \
+        (XEN_SYSCTL_CPPC_SET_PRESET_MASK | \
+         XEN_SYSCTL_CPPC_SET_MINIMUM     | \
+         XEN_SYSCTL_CPPC_SET_MAXIMUM     | \
+         XEN_SYSCTL_CPPC_SET_DESIRED     | \
+         XEN_SYSCTL_CPPC_SET_ENERGY_PERF | \
+         XEN_SYSCTL_CPPC_SET_ACT_WINDOW  )
+    /* IN/OUT */
+    uint32_t set_params; /* bitflags for valid values */
+    /* See comments in struct xen_cppc_para. */
+    /* IN */
+    uint32_t minimum;
+    uint32_t maximum;
+    uint32_t desired;
+    uint32_t energy_perf;
+#define XEN_SYSCTL_CPPC_ACT_WINDOW_MASK (XEN_CPPC_ACT_WINDOW_MANTISSA_MASK | \
+                                         XEN_CPPC_ACT_WINDOW_EXPONENT_MASK)
+    uint32_t activity_window;
+};
+
 #define XEN_HWP_DRIVER_NAME "hwp"
 
 /*
@@ -418,6 +480,7 @@ struct xen_sysctl_pm_op {
     #define SET_CPUFREQ_GOV            (CPUFREQ_PARA | 0x02)
     #define SET_CPUFREQ_PARA           (CPUFREQ_PARA | 0x03)
     #define GET_CPUFREQ_AVGFREQ        (CPUFREQ_PARA | 0x04)
+    #define SET_CPUFREQ_CPPC           (CPUFREQ_PARA | 0x05)
 
     /* set/reset scheduler power saving option */
     #define XEN_SYSCTL_pm_op_set_sched_opt_smt    0x21
@@ -444,6 +507,7 @@ struct xen_sysctl_pm_op {
         struct xen_get_cpufreq_para get_para;
         struct xen_set_cpufreq_gov  set_gov;
         struct xen_set_cpufreq_para set_para;
+        struct xen_set_cppc_para    set_cppc;
         uint64_aligned_t get_avgfreq;
         uint32_t                    set_sched_opt_smt;
 #define XEN_SYSCTL_CX_UNLIMITED 0xffffffff
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 18:59:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 18:59:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560012.875586 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHUCN-0002w0-ES; Thu, 06 Jul 2023 18:59:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560012.875586; Thu, 06 Jul 2023 18:59:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHUCN-0002vt-8Q; Thu, 06 Jul 2023 18:59:27 +0000
Received: by outflank-mailman (input) for mailman id 560012;
 Thu, 06 Jul 2023 18:59:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zM/b=CY=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qHU8y-0003x8-7a
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 18:55:56 +0000
Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com
 [2607:f8b0:4864:20::72d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bc82c15b-1c2e-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 20:55:55 +0200 (CEST)
Received: by mail-qk1-x72d.google.com with SMTP id
 af79cd13be357-76714caf466so98515985a.1
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 11:55:55 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 g25-20020ae9e119000000b0075b168fcde9sm1015297qkm.77.2023.07.06.11.55.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 06 Jul 2023 11:55:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bc82c15b-1c2e-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688669754; x=1691261754;
        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=wIB5Z/ggG5eJ8M2F2JBMwNaYc9A5YlbhT5y/HdVUB7g=;
        b=CL80xBSVUOr7DE4xzYXCvCDvI+BPp2amSVoahY4kQuR1PHBh+NFe5hjeX1QiE4gZSN
         GdHDadQwBRVSwPt0WN+u/P6dSjyNNWa+aW1f0WumZxxdkwKPF2RYqalod9Zv3AArAtq/
         07BUyZ7L6yj0ma/OlJlHKGf+GH69W2eDCx+zpU2i1U2/ibCZB0ZOY+KSH2Kq80Y3y0Pl
         y0B+S6sI17vrAGIV5GM6KqX+jO69DkGpltbNpOyjLVJycMZmdoRprtFcI5vvFDVPzeGM
         rw0R9nx7RegHtMF6ENPZtd6tQYc/HzSj6mRfBqSkMbD0VuiSqAVjXix37Lf6tzQ7nbFc
         NGVQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688669754; x=1691261754;
        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=wIB5Z/ggG5eJ8M2F2JBMwNaYc9A5YlbhT5y/HdVUB7g=;
        b=g0l1UpKOSilVY2QADSv1Pe1nQ/kDuf+fsEQFJ/0ltknhvFWMoQRUDmbjCACxsCAaFZ
         fDtUPiMMDC9RAMPFeXtL9xm4J6uf0rYToC9COUvbfJ6WCx0Tl9Gsf+yjYTp5YMhJewv2
         fh1DFK4UR2vQP7osLn3rn1Q+6pMZx36NYwi7bv2zP9LGvqvi5QN0T1/Rs24vaLxCYCKE
         Iioq8VBZNrBzSNHuA2138u0LwG52qKKh4hp3b7KrpoYpRgJU0kEPlDchOO0g+7OzGxg+
         3d+WkVpdkv5bAIQYr5r0dSbcWaMW2X8cCsqI/8QSx1TIXfwSY587F6maRu1D3HnRxWmE
         4FsA==
X-Gm-Message-State: ABy/qLbQfkndZ25Wau25Y94NTcfipwuo0KWDew8NzwN/FS5HI4Lxhyoj
	5N9diZQvOKuspwf+iJoLGJsfoR1gbrE=
X-Google-Smtp-Source: APBJJlH+p8na6m3NXr3ToUwrDnUbgIyH0Bwij5oF6kagcSBUe8Cu9am00jA/3AtA1l/flGpTQArkdA==
X-Received: by 2002:a05:620a:254f:b0:766:77b7:4c73 with SMTP id s15-20020a05620a254f00b0076677b74c73mr2887406qko.35.1688669754167;
        Thu, 06 Jul 2023 11:55:54 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v5 13/15] libxc: Add xc_set_cpufreq_cppc
Date: Thu,  6 Jul 2023 14:54:38 -0400
Message-ID: <20230706185440.48333-14-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230706185440.48333-1-jandryuk@gmail.com>
References: <20230706185440.48333-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add xc_set_cpufreq_cppc to allow calling xen_systctl_pm_op
SET_CPUFREQ_CPPC.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
---
v2:
Mark xc_set_hwp_para_t const

v4:
s/hwp/cppc/
Add Anthony's Ack

v5:
Remove const and copy back result
---
 tools/include/xenctrl.h |  4 ++++
 tools/libs/ctrl/xc_pm.c | 23 +++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index 2092632296..52f42fb5b6 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1930,11 +1930,15 @@ struct xc_get_cpufreq_para {
     int32_t turbo_enabled;
 };
 
+typedef struct xen_set_cppc_para xc_set_cppc_para_t;
+
 int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
                         struct xc_get_cpufreq_para *user_para);
 int xc_set_cpufreq_gov(xc_interface *xch, int cpuid, char *govname);
 int xc_set_cpufreq_para(xc_interface *xch, int cpuid,
                         int ctrl_type, int ctrl_value);
+int xc_set_cpufreq_cppc(xc_interface *xch, int cpuid,
+                        xc_set_cppc_para_t *set_cppc);
 int xc_get_cpufreq_avgfreq(xc_interface *xch, int cpuid, int *avg_freq);
 
 int xc_set_sched_opt_smt(xc_interface *xch, uint32_t value);
diff --git a/tools/libs/ctrl/xc_pm.c b/tools/libs/ctrl/xc_pm.c
index cea3eab22e..1f267147f6 100644
--- a/tools/libs/ctrl/xc_pm.c
+++ b/tools/libs/ctrl/xc_pm.c
@@ -329,6 +329,29 @@ int xc_set_cpufreq_para(xc_interface *xch, int cpuid,
     return xc_sysctl(xch, &sysctl);
 }
 
+int xc_set_cpufreq_cppc(xc_interface *xch, int cpuid,
+                        xc_set_cppc_para_t *set_cppc)
+{
+    DECLARE_SYSCTL;
+    int ret;
+
+    if ( !xch )
+    {
+        errno = EINVAL;
+        return -1;
+    }
+    sysctl.cmd = XEN_SYSCTL_pm_op;
+    sysctl.u.pm_op.cmd = SET_CPUFREQ_CPPC;
+    sysctl.u.pm_op.cpuid = cpuid;
+    sysctl.u.pm_op.u.set_cppc = *set_cppc;
+
+    ret = xc_sysctl(xch, &sysctl);
+
+    *set_cppc = sysctl.u.pm_op.u.set_cppc;
+
+    return ret;
+}
+
 int xc_get_cpufreq_avgfreq(xc_interface *xch, int cpuid, int *avg_freq)
 {
     int ret = 0;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 18:59:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 18:59:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560029.875595 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHUCP-0003Cd-Hx; Thu, 06 Jul 2023 18:59:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560029.875595; Thu, 06 Jul 2023 18:59:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHUCP-0003CU-Eq; Thu, 06 Jul 2023 18:59:29 +0000
Received: by outflank-mailman (input) for mailman id 560029;
 Thu, 06 Jul 2023 18:59:27 +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
 <SRS0=zM/b=CY=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qHU93-0003x0-6f
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 18:56:01 +0000
Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com
 [2607:f8b0:4864:20::731])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id be88c7ac-1c2e-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 20:55:59 +0200 (CEST)
Received: by mail-qk1-x731.google.com with SMTP id
 af79cd13be357-766fd5f9536so91290685a.3
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 11:55:59 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 g25-20020ae9e119000000b0075b168fcde9sm1015297qkm.77.2023.07.06.11.55.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 06 Jul 2023 11:55:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: be88c7ac-1c2e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688669757; x=1691261757;
        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=gblVHwIRoZ9Cb4sFC+wqThP0YWJWsFM4Sph0J9w8nz0=;
        b=HKZ8WfMZFZrUBl8E6JeIbkyEDqzsk49wKWIfc5+cn/s3uHdhLTuugUvb8UDp9Im+J7
         OWol+ZqYlmNVgUGPa7rVUJNSobCDcWRU+madg4NPO8L0Izu+l7Z4WgqbSZYUwGTK5T1m
         GkT5iQvhunLoWl805UkhUM2tYD3U5i5V8gCQYFFHB1kxpUC31aG7Cgl05yUpWFdSs5BE
         +EzTqA0MA+I08FYhTTXwPQOyiluv9wBOfwrvqP/OTXlxW9oblvalFQvMW0UOH7I22Puo
         WPuc5iJYcdMUKPC0uDlgT5o2+DpXmxVJdveIvdjvxtHrBBnSIImN8wO2rRNCNGZ9Q8ZD
         6NpQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688669757; x=1691261757;
        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=gblVHwIRoZ9Cb4sFC+wqThP0YWJWsFM4Sph0J9w8nz0=;
        b=kSMVxMPNecb1RSBub7rwxt0lYtaZFl0O8IrXcSLSmR/ayZl4AFFlClZlXMTkZYez7v
         mmaCTz5QnTWQP3LkM8174FNxT601l0+12oQKUu4p/x6die4lsD2aqC93Aj1yxY+nbkyX
         GGWXgiITXF5fbA90bjN5VzV8P32ah0lfzar1e81CsVxW/72RwjmsKz3sjO6+wNAU5Gv0
         3c99gCB/Z9ARSyDS9M6xLcRdx/Gfz02ZL+af5PZqn/1dYPHKi5naSgrhGvm2iEPOK1m6
         FT/mXdpF5nZzQW8+cNWp2ZMmg/uRcXX5S3ulHZ9FyoH5q6CyCUVFm/2ZC875XnS193Ah
         pQPw==
X-Gm-Message-State: ABy/qLYxHbWIZeowdv6lfmGDRnQ4L+RrT7QTTN7dToawudKMP2f8dTHP
	GyF3G2ie3ycNF+y55Z9qXvuRHx3/uVg=
X-Google-Smtp-Source: APBJJlEZc1uaT+n1dr8rdgGogn1D1RIvRYHslxYmUDLpvEY7l4uy9Ea/fy0or1TQaS84UaV0U+oBBw==
X-Received: by 2002:a05:620a:24cf:b0:765:575b:415 with SMTP id m15-20020a05620a24cf00b00765575b0415mr3328877qkn.24.1688669757355;
        Thu, 06 Jul 2023 11:55:57 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v5 14/15] xenpm: Add set-cpufreq-cppc subcommand
Date: Thu,  6 Jul 2023 14:54:39 -0400
Message-ID: <20230706185440.48333-15-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230706185440.48333-1-jandryuk@gmail.com>
References: <20230706185440.48333-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

set-cpufreq-cppc allows setting the Hardware P-State (HWP) parameters.

It can be run on all or just a single cpu.  There are presets of
balance, powersave & performance.  Those can be further tweaked by
param:val arguments as explained in the usage description.

Parameter names are just checked to the first 3 characters to shorten
typing.

Some options are hardware dependent, and ranges can be found in
get-cpufreq-para.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v5:
Make i unsigned int
Use local max_cpuid instead of max_cpu_nr
Add Jan's Ack
Check set_params and print a message if activity window wasn't set

v4:
Remove energy bias 0-15 & 7 references
Use MASK_INSR
Fixup { placement
Drop extra case in parse_activity_window
strcmp suffix
Expand help text
s/hwp/cppc/
Use isdigit() to check cpuid - otherwise run on all CPUs.

v2:
Compare provided parameter name and not just 3 characters.
Use "-" in parameter names
Remove hw_
Replace sscanf with strchr & strtoul.
Remove toplevel error message with lower level ones.
Help text s/127/128/
Help text mention truncation.
Avoid some truncation rounding down by adding 5 before division.
Help test mention default microseconds
Also comment the limit check written to avoid overflow.
---
 tools/misc/xenpm.c | 244 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 244 insertions(+)

diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 3abd99fd20..0877f43946 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -16,6 +16,8 @@
  */
 #define MAX_NR_CPU 512
 
+#include <ctype.h>
+#include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -67,6 +69,30 @@ void show_help(void)
             " set-max-cstate        <num>|'unlimited' [<num2>|'unlimited']\n"
             "                                     set the C-State limitation (<num> >= 0) and\n"
             "                                     optionally the C-sub-state limitation (<num2> >= 0)\n"
+            " set-cpufreq-cppc      [cpuid] [balance|performance|powersave] <param:val>*\n"
+            "                                     set Hardware P-State (HWP) parameters\n"
+            "                                     on CPU <cpuid> or all if omitted.\n"
+            "                                     optionally a preset of one of:\n"
+            "                                       balance|performance|powersave\n"
+            "                                     an optional list of param:val arguments\n"
+            "                                       minimum:N (0-255)\n"
+            "                                       maximum:N (0-255)\n"
+            "                                           get-cpufreq-para lowest/highest\n"
+            "                                           values are limits for\n"
+            "                                           minumum/maximum.\n"
+            "                                       desired:N (0-255)\n"
+            "                                           set explicit performance target.\n"
+            "                                           non-zero disables auto-HWP mode.\n"
+            "                                       energy-perf:N (0-255)\n"
+            "                                                   energy/performance hint\n"
+            "                                                   lower - favor performance\n"
+            "                                                   higher - favor powersave\n"
+            "                                                   128 - balance\n"
+            "                                       act-window:N{,m,u}s range 1us-1270s\n"
+            "                                           window for internal calculations.\n"
+            "                                           units default to \"us\" if unspecified.\n"
+            "                                           truncates un-representable values.\n"
+            "                                           0 lets the hardware decide.\n"
             " start [seconds]                     start collect Cx/Px statistics,\n"
             "                                     output after CTRL-C or SIGINT or several seconds.\n"
             " enable-turbo-mode     [cpuid]       enable Turbo Mode for processors that support it.\n"
@@ -1292,6 +1318,223 @@ void disable_turbo_mode(int argc, char *argv[])
                 errno, strerror(errno));
 }
 
+/*
+ * Parse activity_window:NNN{us,ms,s} and validate range.
+ *
+ * Activity window is a 7bit mantissa (0-127) with a 3bit exponent (0-7) base
+ * 10 in microseconds.  So the range is 1 microsecond to 1270 seconds.  A value
+ * of 0 lets the hardware autonomously select the window.
+ *
+ * Return 0 on success
+ *       -1 on error
+ */
+static int parse_activity_window(xc_set_cppc_para_t *set_cppc, unsigned long u,
+                                 const char *suffix)
+{
+    unsigned int exponent = 0;
+    unsigned int multiplier = 1;
+
+    if ( suffix && suffix[0] )
+    {
+        if ( strcmp(suffix, "s") == 0 )
+        {
+            multiplier = 1000 * 1000;
+            exponent = 6;
+        }
+        else if ( strcmp(suffix, "ms") == 0 )
+        {
+            multiplier = 1000;
+            exponent = 3;
+        }
+        else if ( strcmp(suffix, "us") != 0 )
+        {
+            fprintf(stderr, "invalid activity window units: \"%s\"\n", suffix);
+
+            return -1;
+        }
+    }
+
+    /* u * multipler > 1270 * 1000 * 1000 transformed to avoid overflow. */
+    if ( u > 1270 * 1000 * 1000 / multiplier )
+    {
+        fprintf(stderr, "activity window is too large\n");
+
+        return -1;
+    }
+
+    /* looking for 7 bits of mantissa and 3 bits of exponent */
+    while ( u > 127 )
+    {
+        u += 5; /* Round up to mitigate truncation rounding down
+                   e.g. 128 -> 120 vs 128 -> 130. */
+        u /= 10;
+        exponent += 1;
+    }
+
+    set_cppc->activity_window =
+        MASK_INSR(exponent, XEN_CPPC_ACT_WINDOW_EXPONENT_MASK) |
+        MASK_INSR(u, XEN_CPPC_ACT_WINDOW_MANTISSA_MASK);
+    set_cppc->set_params |= XEN_SYSCTL_CPPC_SET_ACT_WINDOW;
+
+    return 0;
+}
+
+static int parse_cppc_opts(xc_set_cppc_para_t *set_cppc, int *cpuid,
+                           int argc, char *argv[])
+{
+    int i = 0;
+
+    if ( argc < 1 )
+    {
+        fprintf(stderr, "Missing arguments\n");
+        return -1;
+    }
+
+    if ( isdigit(argv[i][0]) )
+    {
+        if ( sscanf(argv[i], "%d", cpuid) != 1 || *cpuid < 0 )
+        {
+            fprintf(stderr, "Could not parse cpuid \"%s\"\n", argv[i]);
+            return -1;
+        }
+
+        i++;
+    }
+
+    if ( i == argc )
+    {
+        fprintf(stderr, "Missing arguments\n");
+        return -1;
+    }
+
+    if ( strcasecmp(argv[i], "powersave") == 0 )
+    {
+        set_cppc->set_params = XEN_SYSCTL_CPPC_SET_PRESET_POWERSAVE;
+        i++;
+    }
+    else if ( strcasecmp(argv[i], "performance") == 0 )
+    {
+        set_cppc->set_params = XEN_SYSCTL_CPPC_SET_PRESET_PERFORMANCE;
+        i++;
+    }
+    else if ( strcasecmp(argv[i], "balance") == 0 )
+    {
+        set_cppc->set_params = XEN_SYSCTL_CPPC_SET_PRESET_BALANCE;
+        i++;
+    }
+
+    for ( ; i < argc; i++)
+    {
+        unsigned long val;
+        char *param = argv[i];
+        char *value;
+        char *suffix;
+        int ret;
+
+        value = strchr(param, ':');
+        if ( value == NULL )
+        {
+            fprintf(stderr, "\"%s\" is an invalid cppc parameter\n", argv[i]);
+            return -1;
+        }
+
+        value[0] = '\0';
+        value++;
+
+        errno = 0;
+        val = strtoul(value, &suffix, 10);
+        if ( (errno && val == ULONG_MAX) || value == suffix )
+        {
+            fprintf(stderr, "Could not parse number \"%s\"\n", value);
+            return -1;
+        }
+
+        if ( strncasecmp(param, "act-window", strlen(param)) == 0 )
+        {
+            ret = parse_activity_window(set_cppc, val, suffix);
+            if (ret)
+                return -1;
+
+            continue;
+        }
+
+        if ( val > 255 )
+        {
+            fprintf(stderr, "\"%s\" value \"%lu\" is out of range\n", param,
+                    val);
+            return -1;
+        }
+
+        if ( suffix && suffix[0] )
+        {
+            fprintf(stderr, "Suffix \"%s\" is invalid\n", suffix);
+            return -1;
+        }
+
+        if ( strncasecmp(param, "minimum", MAX(2, strlen(param))) == 0 )
+        {
+            set_cppc->minimum = val;
+            set_cppc->set_params |= XEN_SYSCTL_CPPC_SET_MINIMUM;
+        }
+        else if ( strncasecmp(param, "maximum", MAX(2, strlen(param))) == 0 )
+        {
+            set_cppc->maximum = val;
+            set_cppc->set_params |= XEN_SYSCTL_CPPC_SET_MAXIMUM;
+        }
+        else if ( strncasecmp(param, "desired", strlen(param)) == 0 )
+        {
+            set_cppc->desired = val;
+            set_cppc->set_params |= XEN_SYSCTL_CPPC_SET_DESIRED;
+        }
+        else if ( strncasecmp(param, "energy-perf", strlen(param)) == 0 )
+        {
+            set_cppc->energy_perf = val;
+            set_cppc->set_params |= XEN_SYSCTL_CPPC_SET_ENERGY_PERF;
+        }
+        else
+        {
+            fprintf(stderr, "\"%s\" is an invalid parameter\n", param);
+            return -1;
+        }
+    }
+
+    if ( set_cppc->set_params == 0 )
+    {
+        fprintf(stderr, "No parameters set in request\n");
+        return -1;
+    }
+
+    return 0;
+}
+
+static void cppc_set_func(int argc, char *argv[])
+{
+    xc_set_cppc_para_t set_cppc = {};
+    unsigned int max_cpuid = max_cpu_nr;
+    int cpuid = -1;
+    unsigned int i = 0;
+    uint32_t set_params;
+
+    if ( parse_cppc_opts(&set_cppc, &cpuid, argc, argv) )
+        exit(EINVAL);
+
+    if ( cpuid != -1 )
+    {
+        i = cpuid;
+        max_cpuid = i + 1;
+    }
+
+    set_params = set_cppc.set_params;
+    for ( ; i < max_cpuid; i++ ) {
+        if ( xc_set_cpufreq_cppc(xc_handle, i, &set_cppc) )
+            fprintf(stderr, "[CPU%d] failed to set cppc params (%d - %s)\n",
+                    i, errno, strerror(errno));
+    }
+
+    if ( (set_params ^ set_cppc.set_params) & XEN_SYSCTL_CPPC_SET_ACT_WINDOW )
+        printf("Activity window not supported and omitted\n");
+}
+
 struct {
     const char *name;
     void (*function)(int argc, char *argv[]);
@@ -1302,6 +1545,7 @@ struct {
     { "get-cpufreq-average", cpufreq_func },
     { "start", start_gather_func },
     { "get-cpufreq-para", cpufreq_para_func },
+    { "set-cpufreq-cppc", cppc_set_func },
     { "set-scaling-maxfreq", scaling_max_freq_func },
     { "set-scaling-minfreq", scaling_min_freq_func },
     { "set-scaling-governor", scaling_governor_func },
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 18:59:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 18:59:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560031.875601 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHUCP-0003GB-Tl; Thu, 06 Jul 2023 18:59:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560031.875601; Thu, 06 Jul 2023 18:59:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHUCP-0003Fw-Nw; Thu, 06 Jul 2023 18:59:29 +0000
Received: by outflank-mailman (input) for mailman id 560031;
 Thu, 06 Jul 2023 18:59:28 +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
 <SRS0=zM/b=CY=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qHU96-0003x0-89
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 18:56:04 +0000
Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com
 [2607:f8b0:4864:20::72f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c0117658-1c2e-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 20:56:01 +0200 (CEST)
Received: by mail-qk1-x72f.google.com with SMTP id
 af79cd13be357-7659db6fb4bso109881385a.1
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 11:56:01 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 g25-20020ae9e119000000b0075b168fcde9sm1015297qkm.77.2023.07.06.11.55.59
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 06 Jul 2023 11:55:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c0117658-1c2e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688669760; x=1691261760;
        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=7fKIbOA4RKJwyWZPk8ACAEU8hAgIi7aDz2OnDwWBK4c=;
        b=Cr6G8uPAXjG966YgCd12RSzArtdKrgtdtFDqM8CSqVMC0WewIyxV9rSiVUUWIEQfQk
         KYJ330wfhgBT8DweHIXH60w2JtbygVkVJJ3nsoq+OLKJuC75SRZr68JnEXDhIsI9kufJ
         d85xIhvfS4uc+BmNY7RI12I3aED+fYuE+MKG4Fhyb9A03i9T9ysr4XvBJCuwEcKvSrGZ
         jTWQV6dCoyUeMe+gvQOG0LveTvB1jTVVedPpHA5uK1P3yiLF7vowSt2nilrEGiHF7DKh
         I8O9WYwriOizfcVOYsLj+1cre4jzb4bE3IytJ6HOONcu/h333G/r6jorGyjFXF9/GY7L
         lGUg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688669760; x=1691261760;
        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=7fKIbOA4RKJwyWZPk8ACAEU8hAgIi7aDz2OnDwWBK4c=;
        b=G6rqSlH6+HFJIxDfMiP1mIQO1pqa0PlLYJZFgfKttqnl3Rmylq6IusEP/X+YOvAJeX
         qp9EVaBtZACWR8N1SZQnu2SIiouAbiNAAZxjG9hYRK4N509vLpUfYbk+MndulBdf2u46
         ja52aiXrRlZfrm/+0QCy/1+AJzFyq6jABjwDm0BHi7mTzG0B1OrwtiQbFKTJTDkh+tMr
         EtIB8NqFLo+JGKaSy3oEire0QyBbr+fn0P5mLreJHNsoYcRNHHJLwUm1BBKGdMzbmjAk
         p2OdzPhQuEu5NbdO/Z8QsIxkanM2zvvSFMmID3nrdKQ7BkKrDnl2GQRgBLHTC6BcxBln
         LLaA==
X-Gm-Message-State: ABy/qLaoFL3onhnjW7L44EgTfaGkOUVTAeQkFoANgFUBOml5pWkUty2Y
	VY8hyygXqLMx5mpih5LJwHgJ9pXWcys=
X-Google-Smtp-Source: APBJJlFlSWbJAikYw4AY9jIZZRIdFLX7OQYroKAh+RQQeDlJKPSMq65aJxNrRUo7YbzQsyxSaz/SkA==
X-Received: by 2002:a05:620a:4013:b0:765:aca9:1a10 with SMTP id h19-20020a05620a401300b00765aca91a10mr3805641qko.39.1688669760128;
        Thu, 06 Jul 2023 11:56:00 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Henry Wang <Henry.Wang@arm.com>,
	Community Manager <community.manager@xenproject.org>
Subject: [PATCH v5 15/15] CHANGELOG: Add Intel HWP entry
Date: Thu,  6 Jul 2023 14:54:40 -0400
Message-ID: <20230706185440.48333-16-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230706185440.48333-1-jandryuk@gmail.com>
References: <20230706185440.48333-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Henry Wang <Henry.Wang@arm.com>
---
v3:
Position under existing Added section
Add Henry's Ack

v2:
Add blank line
---
 CHANGELOG.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7d7e0590f8..8d6e6c3088 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -24,7 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - xl/libxl can customize SMBIOS strings for HVM guests.
  - Add support for AVX512-FP16 on x86.
  - On Arm, Xen supports guests running SVE/SVE2 instructions. (Tech Preview)
-
+ - Add Intel Hardware P-States (HWP) cpufreq driver.
 
 ## [4.17.0](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.17.0) - 2022-12-12
 
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 19:05:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 19:05:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560047.875630 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHUI6-0005vR-5g; Thu, 06 Jul 2023 19:05:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560047.875630; Thu, 06 Jul 2023 19:05:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHUI6-0005ud-0P; Thu, 06 Jul 2023 19:05:22 +0000
Received: by outflank-mailman (input) for mailman id 560047;
 Thu, 06 Jul 2023 19:05:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=OuuY=CY=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qHUI4-0005cz-MI
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 19:05:20 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0b29dc20-1c30-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 21:05:17 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 5F21D8285345;
 Thu,  6 Jul 2023 14:05:16 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id 6n4c9tihhj2V; Thu,  6 Jul 2023 14:05:15 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 737E18285BEC;
 Thu,  6 Jul 2023 14:05:15 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id fzlH4Fgri6P2; Thu,  6 Jul 2023 14:05:15 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id E545C828595F;
 Thu,  6 Jul 2023 14:05:14 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0b29dc20-1c30-11ee-b237-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 737E18285BEC
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1688670315; bh=t2XSxlE4JcYvYurr+9ZptgwwCybbDwha+GFsOD84g3s=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=Z71D0EFBLYDTXmQA0N/4+MPJwD+/2jTmcFsxWy7r+uxcB9/Ghmp6/FrQg3Ai1Y44M
	 25NUtmrlHTOmRZEkHYD1irByKChWx3+2VXUDlkyd+ruLG/tvb0KBaDDZaM8ZuIdHPi
	 mVE+QGDlOhtvoAbgRJX0jcG7uyl2EaNoafJOG62U=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v3 3/3] automation: Add smoke test for ppc64le
Date: Thu,  6 Jul 2023 14:04:41 -0500
Message-Id: <6a8ba0e562bc99903267b1c9890ab936dc468a20.1688670018.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1688670018.git.sanastasio@raptorengineering.com>
References: <cover.1688670018.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Add an initial smoke test that boots xen on a ppc64/pseries machine and
checks for a magic string. Based on the riscv smoke test.

Eventually the powernv9 (POWER9 bare metal) machine type will want to be
tested as well, but for now we only boot on pseries.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/test.yaml           | 20 ++++++++++++++++++
 automation/scripts/qemu-smoke-ppc64le.sh | 27 ++++++++++++++++++++++++
 2 files changed, 47 insertions(+)
 create mode 100755 automation/scripts/qemu-smoke-ppc64le.sh

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.y=
aml
index d5cb238b0a..45e8ddb7a3 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -71,6 +71,19 @@
   tags:
     - x86_64
=20
+.qemu-ppc64le:
+  extends: .test-jobs-common
+  variables:
+    CONTAINER: debian:bullseye-ppc64le
+    LOGFILE: qemu-smoke-ppc64le.log
+  artifacts:
+    paths:
+      - smoke.serial
+      - '*.log'
+    when: always
+  tags:
+    - x86_64
+
 .xilinx-arm64:
   extends: .test-jobs-common
   variables:
@@ -444,3 +457,10 @@ qemu-smoke-riscv64-gcc:
     - ./automation/scripts/qemu-smoke-riscv64.sh 2>&1 | tee ${LOGFILE}
   needs:
     - archlinux-current-gcc-riscv64-debug
+
+qemu-smoke-ppc64le-pseries-gcc:
+  extends: .qemu-ppc64le
+  script:
+    - ./automation/scripts/qemu-smoke-ppc64le.sh pseries-5.2 2>&1 | tee =
${LOGFILE}
+  needs:
+    - debian-bullseye-gcc-ppc64le-debug
diff --git a/automation/scripts/qemu-smoke-ppc64le.sh b/automation/script=
s/qemu-smoke-ppc64le.sh
new file mode 100755
index 0000000000..eb55221221
--- /dev/null
+++ b/automation/scripts/qemu-smoke-ppc64le.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+set -ex
+
+# machine type from first arg passed directly to qemu -M
+machine=3D$1
+
+# Run the test
+rm -f smoke.serial
+set +e
+
+touch smoke.serial
+
+timeout -k 1 20 \
+qemu-system-ppc64 \
+    -M $machine \
+    -m 2g \
+    -smp 1 \
+    -vga none \
+    -monitor none \
+    -nographic \
+    -serial file:smoke.serial \
+    -kernel binaries/xen
+
+set -e
+(grep -q "Hello, ppc64le!" smoke.serial) || exit 1
+exit 0
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 19:05:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 19:05:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560046.875624 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHUI5-0005s6-S7; Thu, 06 Jul 2023 19:05:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560046.875624; Thu, 06 Jul 2023 19:05:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHUI5-0005rz-PO; Thu, 06 Jul 2023 19:05:21 +0000
Received: by outflank-mailman (input) for mailman id 560046;
 Thu, 06 Jul 2023 19:05:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=OuuY=CY=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qHUI4-0005cz-0L
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 19:05:20 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0afa9013-1c30-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 21:05:17 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 183CD8285730;
 Thu,  6 Jul 2023 14:05:16 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id vfnQ-v9rtfVS; Thu,  6 Jul 2023 14:05:14 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 5D7A68285345;
 Thu,  6 Jul 2023 14:05:14 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id K-pbp7Q3LbEK; Thu,  6 Jul 2023 14:05:14 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 03F6A828573A;
 Thu,  6 Jul 2023 14:05:13 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0afa9013-1c30-11ee-b237-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 5D7A68285345
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1688670314; bh=jxqgMUbaPR0uONSpM8cEw6PmxgXYo6TJVoLtsVO1/jQ=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=pAEEdILrzxKWlEMgSdqPXqMXKLNuSZq2krpuhMQSs1goRuUsALWPgQfjP5KsAeR0a
	 vY4hvBWqr90obgUj/m+Kx5Qy9A0u1jkMqC0t8Q+qpZ5l+k8JEwkCO8tKeeiSptM9dr
	 7zPk74tMCM6C3ILcXB/YfYNS9yqNJiSK+L0mDoBA=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v3 1/3] xen/ppc: Set up a basic C environment
Date: Thu,  6 Jul 2023 14:04:39 -0500
Message-Id: <8c79f498ffcb0837ff18640dbaf5b66f79186574.1688670018.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1688670018.git.sanastasio@raptorengineering.com>
References: <cover.1688670018.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Update ppc64/head.S to set up an initial boot stack, zero the .bss
section, and jump to C.

Also refactor the endian fixup trampoline into its own macro, since it
will need to be used in multiple places, including every time we make a
call into firmware (see next commit).

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/ppc/Makefile                |  2 ++
 xen/arch/ppc/include/asm/asm-defns.h | 40 ++++++++++++++++++++++++++++
 xen/arch/ppc/include/asm/config.h    |  2 +-
 xen/arch/ppc/ppc64/head.S            | 40 ++++++++++++++--------------
 xen/arch/ppc/setup.c                 | 19 +++++++++++++
 5 files changed, 82 insertions(+), 21 deletions(-)
 create mode 100644 xen/arch/ppc/include/asm/asm-defns.h
 create mode 100644 xen/arch/ppc/setup.c

diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index 98220648af..530fba2121 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -1,5 +1,7 @@
 obj-$(CONFIG_PPC64) +=3D ppc64/
=20
+obj-y +=3D setup.o
+
 $(TARGET): $(TARGET)-syms
 	cp -f $< $@
=20
diff --git a/xen/arch/ppc/include/asm/asm-defns.h b/xen/arch/ppc/include/=
asm/asm-defns.h
new file mode 100644
index 0000000000..6ea35f6edb
--- /dev/null
+++ b/xen/arch/ppc/include/asm/asm-defns.h
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef _ASM_PPC_ASM_DEFNS_H
+#define _ASM_PPC_ASM_DEFNS_H
+
+/*
+ * Load a 64-bit immediate value into the specified GPR.
+ */
+#define LOAD_IMM64(reg, val)                                            =
     \
+    lis reg, (val) @highest;                                            =
     \
+    ori reg, reg, (val) @higher;                                        =
     \
+    rldicr reg, reg, 32, 31;                                            =
     \
+    oris reg, reg, (val) @h;                                            =
     \
+    ori reg, reg, (val) @l;
+
+#define LOAD_IMM32(reg, val)                                            =
     \
+    lis reg, (val) @h;                                                  =
     \
+    ori reg, reg, (val) @l;                                             =
     \
+
+/*
+ * Depending on how we were booted, the CPU could be running in either
+ * Little Endian or Big Endian mode. The following trampoline from Linux
+ * cleverly uses an instruction that encodes to a NOP if the CPU's
+ * endianness matches the assumption of the assembler (LE, in our case)
+ * or a branch to code that performs the endian switch in the other case=
.
+ */
+#define FIXUP_ENDIAN                                                    =
       \
+    tdi 0, 0, 0x48;   /* Reverse endian of b . + 8          */          =
       \
+    b . + 44;         /* Skip trampoline if endian is good  */          =
       \
+    .long 0xa600607d; /* mfmsr r11                          */          =
       \
+    .long 0x01006b69; /* xori r11,r11,1                     */          =
       \
+    .long 0x00004039; /* li r10,0                           */          =
       \
+    .long 0x6401417d; /* mtmsrd r10,1                       */          =
       \
+    .long 0x05009f42; /* bcl 20,31,$+4                      */          =
       \
+    .long 0xa602487d; /* mflr r10                           */          =
       \
+    .long 0x14004a39; /* addi r10,r10,20                    */          =
       \
+    .long 0xa6035a7d; /* mtsrr0 r10                         */          =
       \
+    .long 0xa6037b7d; /* mtsrr1 r11                         */          =
       \
+    .long 0x2400004c  /* rfid                               */
+
+#endif /* _ASM_PPC_ASM_DEFNS_H */
diff --git a/xen/arch/ppc/include/asm/config.h b/xen/arch/ppc/include/asm=
/config.h
index b9a6814f00..01ca5d0803 100644
--- a/xen/arch/ppc/include/asm/config.h
+++ b/xen/arch/ppc/include/asm/config.h
@@ -43,7 +43,7 @@
=20
 #define SMP_CACHE_BYTES (1 << 6)
=20
-#define STACK_ORDER 2
+#define STACK_ORDER 0
 #define STACK_SIZE  (PAGE_SIZE << STACK_ORDER)
=20
 /* 288 bytes below the stack pointer must be preserved by interrupt hand=
lers */
diff --git a/xen/arch/ppc/ppc64/head.S b/xen/arch/ppc/ppc64/head.S
index 2fcefb40d8..7d848611cc 100644
--- a/xen/arch/ppc/ppc64/head.S
+++ b/xen/arch/ppc/ppc64/head.S
@@ -1,30 +1,30 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
=20
+#include <asm/asm-defns.h>
+
     .section .text.header, "ax", %progbits
=20
 ENTRY(start)
     /*
-     * Depending on how we were booted, the CPU could be running in eith=
er
-     * Little Endian or Big Endian mode. The following trampoline from L=
inux
-     * cleverly uses an instruction that encodes to a NOP if the CPU's
-     * endianness matches the assumption of the assembler (LE, in our ca=
se)
-     * or a branch to code that performs the endian switch in the other =
case.
+     * NOTE: argument registers (r3-r9) must be preserved until the C en=
trypoint
      */
-    tdi 0, 0, 0x48    /* Reverse endian of b . + 8          */
-    b . + 44          /* Skip trampoline if endian is good  */
-    .long 0xa600607d  /* mfmsr r11                          */
-    .long 0x01006b69  /* xori r11,r11,1                     */
-    .long 0x00004039  /* li r10,0                           */
-    .long 0x6401417d  /* mtmsrd r10,1                       */
-    .long 0x05009f42  /* bcl 20,31,$+4                      */
-    .long 0xa602487d  /* mflr r10                           */
-    .long 0x14004a39  /* addi r10,r10,20                    */
-    .long 0xa6035a7d  /* mtsrr0 r10                         */
-    .long 0xa6037b7d  /* mtsrr1 r11                         */
-    .long 0x2400004c  /* rfid                               */
-
-    /* Now that the endianness is confirmed, continue */
-1:  b 1b
+    FIXUP_ENDIAN
+
+    /* set up the TOC pointer */
+    LOAD_IMM32(%r2, .TOC.)
+
+    /* set up the initial stack */
+    LOAD_IMM32(%r1, cpu0_boot_stack)
+    li %r11, 0
+    stdu %r11, -STACK_FRAME_OVERHEAD(%r1)
+
+    /* call the C entrypoint */
+    bl start_xen
+
+    /* should never return */
+    trap
=20
     .size start, . - start
     .type start, %function
+
+    .section .init.data, "aw", @progbits
diff --git a/xen/arch/ppc/setup.c b/xen/arch/ppc/setup.c
new file mode 100644
index 0000000000..73106474b2
--- /dev/null
+++ b/xen/arch/ppc/setup.c
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#include <xen/init.h>
+
+/* Xen stack for bringing up the first CPU. */
+unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZ=
E);
+
+/* Macro to adjust thread priority for hardware multithreading */
+#define HMT_very_low()  asm volatile (" or %r31, %r31, %r31 ")
+
+void __init noreturn start_xen(unsigned long r3, unsigned long r4,
+                               unsigned long r5, unsigned long r6,
+                               unsigned long r7)
+{
+    for ( ; ; )
+        /* Set current hardware thread to very low priority */
+        HMT_very_low();
+
+    unreachable();
+}
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 19:05:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 19:05:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560048.875645 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHUI8-0006Nr-Bl; Thu, 06 Jul 2023 19:05:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560048.875645; Thu, 06 Jul 2023 19:05:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHUI8-0006Ne-8t; Thu, 06 Jul 2023 19:05:24 +0000
Received: by outflank-mailman (input) for mailman id 560048;
 Thu, 06 Jul 2023 19:05:23 +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
 <SRS0=OuuY=CY=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qHUI7-0005ct-1e
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 19:05:23 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0d38f780-1c30-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 21:05:20 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id BD48D8285730;
 Thu,  6 Jul 2023 14:05:19 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id niZpaZRW4zAv; Thu,  6 Jul 2023 14:05:15 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id E314D828573A;
 Thu,  6 Jul 2023 14:05:14 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id qqjirBYSRP74; Thu,  6 Jul 2023 14:05:14 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 65DDC8285741;
 Thu,  6 Jul 2023 14:05:14 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0d38f780-1c30-11ee-8611-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com E314D828573A
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1688670314; bh=iT/kxfPyFb1GfSxJiSkrtxjbxMpPwhwpcrYOxHz76Wc=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=Bs1RLXVVWuU4jH96DMnSX6lQBDhikl/M/vAAPgqgF5JyR2ppvQ+89ys93grOotyfe
	 c3E3rz+4ZCXTUfeVA60c5fLcSz64kCM/lmEmwiMdUnNyBBkI12ZznEi5lFyer87Ey3
	 OAYRQFquPOWBAcAkKMQ7CJGpTK/VF2A29qGNMz7I=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v3 2/3] xen/ppc: Implement early serial printk on pseries
Date: Thu,  6 Jul 2023 14:04:40 -0500
Message-Id: <85172d385a730e196999b366207e2b2e8a261906.1688670018.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1688670018.git.sanastasio@raptorengineering.com>
References: <cover.1688670018.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

On typical Power VMs (e.g. QEMU's -M pseries), a variety of services
including an early serial console are provided by Open Firmware.
Implement the required interfaces to call into Open Firmware and write
to the serial console.

Since Open Firmware runs in 32-bit Big Endian mode and Xen runs in
64-bit Little Endian mode, a thunk is required to save/restore
any potentially-clobbered registers as well as to perform the
required endianness switch. Thankfully, linux already has such
a routine, which was imported into ppc64/of-call.S.

Support for bare metal (PowerNV) will be implemented in a future
patch.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/ppc/Kconfig.debug              |   5 +
 xen/arch/ppc/Makefile                   |   2 +
 xen/arch/ppc/boot-of.c                  | 100 +++++++++++++++++
 xen/arch/ppc/configs/ppc64_defconfig    |   1 +
 xen/arch/ppc/early_printk.c             |  28 +++++
 xen/arch/ppc/include/asm/asm-defns.h    |  17 +++
 xen/arch/ppc/include/asm/boot.h         |  23 ++++
 xen/arch/ppc/include/asm/byteorder.h    |  12 ++
 xen/arch/ppc/include/asm/config.h       |   3 +
 xen/arch/ppc/include/asm/early_printk.h |  15 +++
 xen/arch/ppc/include/asm/msr.h          |  51 +++++++++
 xen/arch/ppc/include/asm/processor.h    | 139 ++++++++++++++++++++++++
 xen/arch/ppc/include/asm/types.h        |  21 ++++
 xen/arch/ppc/ppc64/Makefile             |   1 +
 xen/arch/ppc/ppc64/asm-offsets.c        |  59 ++++++++++
 xen/arch/ppc/ppc64/head.S               |   9 ++
 xen/arch/ppc/ppc64/of-call.S            |  83 ++++++++++++++
 xen/arch/ppc/setup.c                    |  19 +++-
 18 files changed, 585 insertions(+), 3 deletions(-)
 create mode 100644 xen/arch/ppc/boot-of.c
 create mode 100644 xen/arch/ppc/early_printk.c
 create mode 100644 xen/arch/ppc/include/asm/boot.h
 create mode 100644 xen/arch/ppc/include/asm/byteorder.h
 create mode 100644 xen/arch/ppc/include/asm/early_printk.h
 create mode 100644 xen/arch/ppc/include/asm/msr.h
 create mode 100644 xen/arch/ppc/include/asm/processor.h
 create mode 100644 xen/arch/ppc/include/asm/types.h
 create mode 100644 xen/arch/ppc/ppc64/of-call.S

diff --git a/xen/arch/ppc/Kconfig.debug b/xen/arch/ppc/Kconfig.debug
index e69de29bb2..608c9ff832 100644
--- a/xen/arch/ppc/Kconfig.debug
+++ b/xen/arch/ppc/Kconfig.debug
@@ -0,0 +1,5 @@
+config EARLY_PRINTK
+    bool "Enable early printk"
+    default DEBUG
+    help
+      Enables early printk debug messages
diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index 530fba2121..e1d4590d67 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -1,5 +1,7 @@
 obj-$(CONFIG_PPC64) +=3D ppc64/
=20
+obj-y +=3D boot-of.init.o
+obj-$(CONFIG_EARLY_PRINTK) +=3D early_printk.o
 obj-y +=3D setup.o
=20
 $(TARGET): $(TARGET)-syms
diff --git a/xen/arch/ppc/boot-of.c b/xen/arch/ppc/boot-of.c
new file mode 100644
index 0000000000..6c69ca94ba
--- /dev/null
+++ b/xen/arch/ppc/boot-of.c
@@ -0,0 +1,100 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright IBM Corp. 2005, 2006, 2007
+ * Copyright Raptor Engineering, LLC
+ *
+ * Authors: Jimi Xenidis <jimix@watson.ibm.com>
+ *          Hollis Blanchard <hollisb@us.ibm.com>
+ *          Shawn Anastasio <sanastasio@raptorengineering.com>
+ */
+
+#include <xen/init.h>
+#include <xen/stdarg.h>
+#include <xen/types.h>
+#include <asm/boot.h>
+#include <asm/byteorder.h>
+#include <asm/early_printk.h>
+
+#define ADDR(x) (uint32_t)(unsigned long)(x)
+
+/* OF entrypoint*/
+static unsigned long __initdata of_vec;
+
+/* OF device handles*/
+static int __initdata bof_chosen;
+static int __initdata of_out;
+
+static int __init of_call(const char *service, uint32_t nargs, uint32_t =
nrets,
+                   int32_t rets[], ...)
+{
+    int rc;
+    va_list args;
+    int i;
+    struct of_service s =3D { 0 };
+
+    s.ofs_service =3D cpu_to_be32(ADDR(service));
+    s.ofs_nargs =3D cpu_to_be32(nargs);
+    s.ofs_nrets =3D cpu_to_be32(nrets);
+
+    /* copy all the params into the args array */
+    va_start(args, rets);
+
+    for ( i =3D 0; i < nargs; i++ )
+        s.ofs_args[i] =3D cpu_to_be32(va_arg(args, uint32_t));
+
+    va_end(args);
+
+    rc =3D enter_of(&s, of_vec);
+
+    /* copy all return values to the output rets array */
+    for ( i =3D 0; i < nrets; i++ )
+        rets[i] =3D be32_to_cpu(s.ofs_args[i + nargs]);
+
+    return rc;
+}
+
+static int __init of_finddevice(const char *devspec)
+{
+    int rets[1] =3D { OF_FAILURE };
+
+    of_call("finddevice", 1, 1, rets, devspec);
+    return rets[0];
+}
+
+static int __init of_getprop(int ph, const char *name, void *buf, uint32=
_t buflen)
+{
+    int rets[1] =3D { OF_FAILURE };
+
+    of_call("getprop", 4, 1, rets, ph, ADDR(name), buf, buflen);
+    return rets[0];
+}
+
+int __init of_write(int ih, const char *addr, uint32_t len)
+{
+    int rets[1] =3D { OF_FAILURE };
+
+    of_call("write", 3, 1, rets, ih, addr, len);
+    return rets[0];
+}
+
+static void __init of_putchar(char c)
+{
+    if ( c =3D=3D '\n' )
+    {
+        char buf =3D '\r';
+        of_write(of_out, &buf, 1);
+    }
+    of_write(of_out, &c, 1);
+}
+
+void __init boot_of_init(unsigned long vec)
+{
+    of_vec =3D vec;
+
+    /* Get a handle to the default console */
+    bof_chosen =3D of_finddevice("/chosen");
+    of_getprop(bof_chosen, "stdout", &of_out, sizeof(of_out));
+    of_out =3D be32_to_cpu(of_out);
+
+    early_printk_init(of_putchar);
+}
diff --git a/xen/arch/ppc/configs/ppc64_defconfig b/xen/arch/ppc/configs/=
ppc64_defconfig
index 8783eb3488..f7cc075e45 100644
--- a/xen/arch/ppc/configs/ppc64_defconfig
+++ b/xen/arch/ppc/configs/ppc64_defconfig
@@ -10,4 +10,5 @@
 CONFIG_PPC64=3Dy
 CONFIG_DEBUG=3Dy
 CONFIG_DEBUG_INFO=3Dy
+CONFIG_EARLY_PRINTK=3Dy
 CONFIG_EXPERT=3Dy
diff --git a/xen/arch/ppc/early_printk.c b/xen/arch/ppc/early_printk.c
new file mode 100644
index 0000000000..c5014945ef
--- /dev/null
+++ b/xen/arch/ppc/early_printk.c
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include <xen/init.h>
+#include <asm/boot.h>
+
+static void (*putchar_func)(char);
+
+void __init early_printk_init(void (*putchar)(char))
+{
+    putchar_func =3D putchar;
+}
+
+void __init early_puts(const char *s, size_t nr)
+{
+    if ( !putchar_func )
+        return;
+
+    while ( nr-- > 0 )
+        putchar_func(*s++);
+}
+
+void __init early_printk(const char *s)
+{
+    if ( !putchar_func )
+        return;
+
+    while ( *s )
+        putchar_func(*s++);
+}
diff --git a/xen/arch/ppc/include/asm/asm-defns.h b/xen/arch/ppc/include/=
asm/asm-defns.h
index 6ea35f6edb..9d7328f4a2 100644
--- a/xen/arch/ppc/include/asm/asm-defns.h
+++ b/xen/arch/ppc/include/asm/asm-defns.h
@@ -37,4 +37,21 @@
     .long 0xa6037b7d; /* mtsrr1 r11                         */          =
       \
     .long 0x2400004c  /* rfid                               */
=20
+
+/* Taken from Linux kernel source (arch/powerpc/boot/crt0.S) */
+.macro OP_REGS op, width, start, end, base, offset
+	.Lreg=3D\start
+	.rept (\end - \start + 1)
+	\op	.Lreg,\offset+\width*.Lreg(\base)
+	.Lreg=3D.Lreg+1
+	.endr
+.endm
+
+#define SAVE_GPRS(start, end, base) OP_REGS std, 8, start, end, base, 0
+#define REST_GPRS(start, end, base) OP_REGS ld, 8, start, end, base, 0
+#define SAVE_GPR(n, base)           SAVE_GPRS(n, n, base)
+#define REST_GPR(n, base)           REST_GPRS(n, n, base)
+#define SAVE_NVGPRS(base)           SAVE_GPRS(14, 31, base)
+#define REST_NVGPRS(base)           REST_GPRS(14, 31, base)
+
 #endif /* _ASM_PPC_ASM_DEFNS_H */
diff --git a/xen/arch/ppc/include/asm/boot.h b/xen/arch/ppc/include/asm/b=
oot.h
new file mode 100644
index 0000000000..9b8a7c43c2
--- /dev/null
+++ b/xen/arch/ppc/include/asm/boot.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef _ASM_PPC_BOOT_H
+#define _ASM_PPC_BOOT_H
+
+#include <xen/types.h>
+
+/* a collection of interfaces used during boot. */
+enum {
+    OF_FAILURE =3D -1,
+    OF_SUCCESS =3D 0,
+};
+
+struct of_service {
+    __be32 ofs_service;
+    __be32 ofs_nargs;
+    __be32 ofs_nrets;
+    __be32 ofs_args[10];
+};
+
+int enter_of(struct of_service *args, unsigned long entry);
+void boot_of_init(unsigned long vec);
+
+#endif /* _ASM_PPC_BOOT_H */
diff --git a/xen/arch/ppc/include/asm/byteorder.h b/xen/arch/ppc/include/=
asm/byteorder.h
new file mode 100644
index 0000000000..2b5f6b9f63
--- /dev/null
+++ b/xen/arch/ppc/include/asm/byteorder.h
@@ -0,0 +1,12 @@
+#ifndef _ASM_PPC_BYTEORDER_H
+#define _ASM_PPC_BYTEORDER_H
+
+#define __arch__swab16 __builtin_bswap16
+#define __arch__swab32 __builtin_bswap32
+#define __arch__swab64 __builtin_bswap64
+
+#define __BYTEORDER_HAS_U64__
+
+#include <xen/byteorder/little_endian.h>
+
+#endif /* _ASM_PPC_BYTEORDER_H */
diff --git a/xen/arch/ppc/include/asm/config.h b/xen/arch/ppc/include/asm=
/config.h
index 01ca5d0803..cb27d2781e 100644
--- a/xen/arch/ppc/include/asm/config.h
+++ b/xen/arch/ppc/include/asm/config.h
@@ -52,6 +52,9 @@
 /* size of minimum stack frame; C code can write into the caller's stack=
 */
 #define STACK_FRAME_OVERHEAD 32
=20
+/* ELFv2 ABI mandates 16 byte alignment */
+#define STACK_ALIGN 16
+
 #endif /* __PPC_CONFIG_H__ */
 /*
  * Local variables:
diff --git a/xen/arch/ppc/include/asm/early_printk.h b/xen/arch/ppc/inclu=
de/asm/early_printk.h
new file mode 100644
index 0000000000..d1d8b416f4
--- /dev/null
+++ b/xen/arch/ppc/include/asm/early_printk.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef _ASM_PPC_EARLY_PRINTK_H
+#define _ASM_PPC_EARLY_PRINTK_H
+
+#include <xen/early_printk.h>
+
+#ifdef CONFIG_EARLY_PRINTK
+void early_printk_init(void (*putchar)(char));
+void early_printk(const char *s);
+#else
+static inline void early_printk_init(void (*putchar)(char)) {}
+static inline void early_printk(const char *s) {}
+#endif
+
+#endif /* _ASM_PPC_EARLY_PRINTK_H */
diff --git a/xen/arch/ppc/include/asm/msr.h b/xen/arch/ppc/include/asm/ms=
r.h
new file mode 100644
index 0000000000..144511e5c3
--- /dev/null
+++ b/xen/arch/ppc/include/asm/msr.h
@@ -0,0 +1,51 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) IBM Corp. 2005
+ * Copyright Raptor Engineering, LLC
+ *
+ * Authors: Jimi Xenidis <jimix@watson.ibm.com>
+ *          Shawn Anastasio <sanastasio@raptorengineering.com>
+ */
+
+#ifndef _ASM_PPC_MSR_H
+#define _ASM_PPC_MSR_H
+
+#include <xen/const.h>
+
+/* Flags in MSR: */
+#define MSR_SF      _AC(0x8000000000000000, ULL)
+#define MSR_TA      _AC(0x4000000000000000, ULL)
+#define MSR_ISF     _AC(0x2000000000000000, ULL)
+#define MSR_HV      _AC(0x1000000000000000, ULL)
+#define MSR_VMX     _AC(0x0000000002000000, ULL)
+#define MSR_MER     _AC(0x0000000000200000, ULL)
+#define MSR_POW     _AC(0x0000000000040000, ULL)
+#define MSR_ILE     _AC(0x0000000000010000, ULL)
+#define MSR_EE      _AC(0x0000000000008000, ULL)
+#define MSR_PR      _AC(0x0000000000004000, ULL)
+#define MSR_FP      _AC(0x0000000000002000, ULL)
+#define MSR_ME      _AC(0x0000000000001000, ULL)
+#define MSR_FE0     _AC(0x0000000000000800, ULL)
+#define MSR_SE      _AC(0x0000000000000400, ULL)
+#define MSR_BE      _AC(0x0000000000000200, ULL)
+#define MSR_FE1     _AC(0x0000000000000100, ULL)
+#define MSR_IP      _AC(0x0000000000000040, ULL)
+#define MSR_IR      _AC(0x0000000000000020, ULL)
+#define MSR_DR      _AC(0x0000000000000010, ULL)
+#define MSR_PMM     _AC(0x0000000000000004, ULL)
+#define MSR_RI      _AC(0x0000000000000002, ULL)
+#define MSR_LE      _AC(0x0000000000000001, ULL)
+
+/* MSR bits set on the systemsim simulator */
+#define MSR_SIM       _AC(0x0000000020000000, ULL)
+#define MSR_SYSTEMSIM _AC(0x0000000010000000, ULL)
+
+/* On a trap, srr1's copy of msr defines some bits as follows: */
+#define MSR_TRAP_FE     _AC(0x0000000000100000, ULL) /* Floating Point E=
xception */
+#define MSR_TRAP_IOP    _AC(0x0000000000080000, ULL) /* Illegal Instruct=
ion */
+#define MSR_TRAP_PRIV   _AC(0x0000000000040000, ULL) /* Privileged Instr=
uction */
+#define MSR_TRAP        _AC(0x0000000000020000, ULL) /* Trap Instruction=
 */
+#define MSR_TRAP_NEXT   _AC(0x0000000000010000, ULL) /* PC is next instr=
uction */
+#define MSR_TRAP_BITS  (MSR_TRAP_FE|MSR_TRAP_IOP|MSR_TRAP_PRIV|MSR_TRAP)
+
+#endif /* _ASM_PPC_MSR_H */
diff --git a/xen/arch/ppc/include/asm/processor.h b/xen/arch/ppc/include/=
asm/processor.h
new file mode 100644
index 0000000000..2d2e582f08
--- /dev/null
+++ b/xen/arch/ppc/include/asm/processor.h
@@ -0,0 +1,139 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright IBM Corp. 2005, 2006, 2007
+ * Copyright Raptor Engineering, LLC
+ *
+ * Authors: Hollis Blanchard <hollisb@us.ibm.com>
+ *          Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
+ *          Timothy Pearson <tpearson@raptorengineering.com>
+ *          Shawn Anastasio <sanastasio@raptorengineering.com>
+ */
+
+#ifndef _ASM_PPC_PROCESSOR_H
+#define _ASM_PPC_PROCESSOR_H
+
+#include <xen/config.h>
+#include <xen/types.h>
+
+#define IOBMP_BYTES          8192
+#define IOBMP_INVALID_OFFSET 0x8000
+
+/* Processor Version Register (PVR) field extraction */
+
+#define PVR_VER(pvr) (((pvr) >> 16) & 0xFFFF) /* Version field */
+#define PVR_REV(pvr) (((pvr) >> 0) & 0xFFFF)  /* Revison field */
+
+#define __is_processor(pv) (PVR_VER(mfspr(SPRN_PVR)) =3D=3D (pv))
+
+/*
+ * IBM has further subdivided the standard PowerPC 16-bit version and
+ * revision subfields of the PVR for the PowerPC 403s into the following=
:
+ */
+
+#define PVR_FAM(pvr)  (((pvr) >> 20) & 0xFFF) /* Family field */
+#define PVR_MEM(pvr)  (((pvr) >> 16) & 0xF)   /* Member field */
+#define PVR_CORE(pvr) (((pvr) >> 12) & 0xF)   /* Core field */
+#define PVR_CFG(pvr)  (((pvr) >> 8) & 0xF)    /* Configuration field */
+#define PVR_MAJ(pvr)  (((pvr) >> 4) & 0xF)    /* Major revision field */
+#define PVR_MIN(pvr)  (((pvr) >> 0) & 0xF)    /* Minor revision field */
+
+/* Processor Version Numbers */
+
+#define PVR_403GA    0x00200000
+#define PVR_403GB    0x00200100
+#define PVR_403GC    0x00200200
+#define PVR_403GCX   0x00201400
+#define PVR_405GP    0x40110000
+#define PVR_STB03XXX 0x40310000
+#define PVR_NP405H   0x41410000
+#define PVR_NP405L   0x41610000
+#define PVR_601      0x00010000
+#define PVR_602      0x00050000
+#define PVR_603      0x00030000
+#define PVR_603e     0x00060000
+#define PVR_603ev    0x00070000
+#define PVR_603r     0x00071000
+#define PVR_604      0x00040000
+#define PVR_604e     0x00090000
+#define PVR_604r     0x000A0000
+#define PVR_620      0x00140000
+#define PVR_740      0x00080000
+#define PVR_750      PVR_740
+#define PVR_740P     0x10080000
+#define PVR_750P     PVR_740P
+#define PVR_7400     0x000C0000
+#define PVR_7410     0x800C0000
+#define PVR_7450     0x80000000
+#define PVR_8540     0x80200000
+#define PVR_8560     0x80200000
+/*
+ * For the 8xx processors, all of them report the same PVR family for
+ * the PowerPC core. The various versions of these processors must be
+ * differentiated by the version number in the Communication Processor
+ * Module (CPM).
+ */
+#define PVR_821  0x00500000
+#define PVR_823  PVR_821
+#define PVR_850  PVR_821
+#define PVR_860  PVR_821
+#define PVR_8240 0x00810100
+#define PVR_8245 0x80811014
+#define PVR_8260 PVR_8240
+
+/* 64-bit processors */
+#define PVR_NORTHSTAR 0x0033
+#define PVR_PULSAR    0x0034
+#define PVR_POWER4    0x0035
+#define PVR_ICESTAR   0x0036
+#define PVR_SSTAR     0x0037
+#define PVR_POWER4p   0x0038
+#define PVR_970       0x0039
+#define PVR_POWER5    0x003A
+#define PVR_POWER5p   0x003B
+#define PVR_970FX     0x003C
+#define PVR_POWER6    0x003E
+#define PVR_POWER7    0x003F
+#define PVR_630       0x0040
+#define PVR_630p      0x0041
+#define PVR_970MP     0x0044
+#define PVR_970GX     0x0045
+#define PVR_POWER7p   0x004A
+#define PVR_POWER8E   0x004B
+#define PVR_POWER8NVL 0x004C
+#define PVR_POWER8    0x004D
+#define PVR_POWER9    0x004E
+#define PVR_POWER10   0x0080
+#define PVR_BE        0x0070
+#define PVR_PA6T      0x0090
+
+/* Macro to adjust thread priority for hardware multithreading */
+#define HMT_very_low()  asm volatile (" or %r31, %r31, %r31 ")
+
+#ifndef __ASSEMBLY__
+
+#include <xen/types.h>
+
+/* User-accessible registers: nost of these need to be saved/restored
+ * for every nested Xen invocation. */
+struct cpu_user_regs
+{
+    uint64_t gprs[32];
+    uint64_t lr;
+    uint64_t ctr;
+    uint64_t srr0;
+    uint64_t srr1;
+    uint64_t pc;
+    uint64_t msr;
+    uint64_t fpscr;
+    uint64_t xer;
+    uint64_t hid4;  /* debug only */
+    uint64_t dar;   /* debug only */
+    uint32_t dsisr; /* debug only */
+    uint32_t cr;
+    uint32_t __pad; /* good spot for another 32bit reg */
+    uint32_t entry_vector;
+};
+
+#endif
+
+#endif /* _ASM_PPC_PROCESSOR_H */
diff --git a/xen/arch/ppc/include/asm/types.h b/xen/arch/ppc/include/asm/=
types.h
new file mode 100644
index 0000000000..cee08e111a
--- /dev/null
+++ b/xen/arch/ppc/include/asm/types.h
@@ -0,0 +1,21 @@
+/* from xen/arch/x86/include/asm/types.h */
+
+#ifndef _ASM_PPC_TYPES_H
+#define _ASM_PPC_TYPES_H
+
+typedef signed char s8;
+typedef unsigned char u8;
+
+typedef signed short s16;
+typedef unsigned short u16;
+
+typedef signed int s32;
+typedef unsigned int u32;
+
+typedef signed long s64;
+typedef unsigned long u64;
+typedef unsigned long paddr_t;
+#define INVALID_PADDR (~0UL)
+#define PRIpaddr "016lx"
+
+#endif /* _ASM_PPC_TYPES_H */
diff --git a/xen/arch/ppc/ppc64/Makefile b/xen/arch/ppc/ppc64/Makefile
index 3340058c08..f4956daaa9 100644
--- a/xen/arch/ppc/ppc64/Makefile
+++ b/xen/arch/ppc/ppc64/Makefile
@@ -1 +1,2 @@
 obj-y +=3D head.o
+obj-y +=3D of-call.o
diff --git a/xen/arch/ppc/ppc64/asm-offsets.c b/xen/arch/ppc/ppc64/asm-of=
fsets.c
index e69de29bb2..7fc29d5db1 100644
--- a/xen/arch/ppc/ppc64/asm-offsets.c
+++ b/xen/arch/ppc/ppc64/asm-offsets.c
@@ -0,0 +1,59 @@
+/*
+ * Generate definitions needed by assembly language modules.
+ * This code generates raw asm output which is post-processed
+ * to extract and format the required data.
+ */
+
+#include <asm/processor.h>
+
+#define DEFINE(_sym, _val)                                              =
   \
+    asm volatile ("\n.ascii\"=3D=3D>#define " #_sym " %0 /* " #_val " */=
<=3D=3D\"" \
+                  : : "i" (_val) )
+#define BLANK()                                                         =
   \
+    asm volatile ( "\n.ascii\"=3D=3D><=3D=3D\"" : : )
+#define OFFSET(_sym, _str, _mem)                                        =
   \
+    DEFINE(_sym, offsetof(_str, _mem));
+
+/* base-2 logarithm */
+#define __L2(_x)  (((_x) & 0x00000002) ?   1 : 0)
+#define __L4(_x)  (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( =
_x))
+#define __L8(_x)  (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( =
_x))
+#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( =
_x))
+#define LOG_2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(=
_x))
+
+void __dummy__(void)
+{
+    DEFINE(GPR_WIDTH, sizeof(unsigned long));
+    DEFINE(FPR_WIDTH, sizeof(double));
+
+    OFFSET(UREGS_gprs, struct cpu_user_regs, gprs);
+    OFFSET(UREGS_r0, struct cpu_user_regs, gprs[0]);
+    OFFSET(UREGS_r1, struct cpu_user_regs, gprs[1]);
+    OFFSET(UREGS_r13, struct cpu_user_regs, gprs[13]);
+    OFFSET(UREGS_srr0, struct cpu_user_regs, srr0);
+    OFFSET(UREGS_srr1, struct cpu_user_regs, srr1);
+    OFFSET(UREGS_pc, struct cpu_user_regs, pc);
+    OFFSET(UREGS_msr, struct cpu_user_regs, msr);
+    OFFSET(UREGS_lr, struct cpu_user_regs, lr);
+    OFFSET(UREGS_ctr, struct cpu_user_regs, ctr);
+    OFFSET(UREGS_xer, struct cpu_user_regs, xer);
+    OFFSET(UREGS_hid4, struct cpu_user_regs, hid4);
+    OFFSET(UREGS_dar, struct cpu_user_regs, dar);
+    OFFSET(UREGS_dsisr, struct cpu_user_regs, dsisr);
+    OFFSET(UREGS_cr, struct cpu_user_regs, cr);
+    OFFSET(UREGS_fpscr, struct cpu_user_regs, fpscr);
+    DEFINE(UREGS_sizeof, sizeof(struct cpu_user_regs));
+}
+
+/* TODO: Replace with BUILD_BUG_ON + IS_ALIGNED once we can use <xen/lib=
.h> */
+_Static_assert(sizeof(struct cpu_user_regs) % STACK_ALIGN =3D=3D 0,
+               "struct cpu_user_regs not stack aligned!");
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/ppc/ppc64/head.S b/xen/arch/ppc/ppc64/head.S
index 7d848611cc..8497d8f37e 100644
--- a/xen/arch/ppc/ppc64/head.S
+++ b/xen/arch/ppc/ppc64/head.S
@@ -18,6 +18,15 @@ ENTRY(start)
     li %r11, 0
     stdu %r11, -STACK_FRAME_OVERHEAD(%r1)
=20
+    /* clear .bss */
+    LOAD_IMM32(%r14, __bss_start)
+    LOAD_IMM32(%r15, __bss_end)
+1:
+    std %r11, 0(%r14)
+    addi %r14, %r14, 8
+    cmpld %r14, %r15
+    blt 1b
+
     /* call the C entrypoint */
     bl start_xen
=20
diff --git a/xen/arch/ppc/ppc64/of-call.S b/xen/arch/ppc/ppc64/of-call.S
new file mode 100644
index 0000000000..5f13e3b327
--- /dev/null
+++ b/xen/arch/ppc/ppc64/of-call.S
@@ -0,0 +1,83 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Adapted from Linux's arch/powerpc/kernel/entry_64.S, with the
+ * following copyright notice:
+ *
+ *  PowerPC version
+ *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
+ *  Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
+ *    Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
+ *  Adapted for Power Macintosh by Paul Mackerras.
+ *  Low-level exception handlers and MMU support
+ *  rewritten by Paul Mackerras.
+ *    Copyright (C) 1996 Paul Mackerras.
+ *  MPC8xx modifications Copyright (C) 1997 Dan Malek (dmalek@jlc.net).
+ */
+
+#include <asm/asm-offsets.h>
+#include <asm/asm-defns.h>
+#include <asm/msr.h>
+
+/* size of minimum stack frame that can hold an entire cpu_user_regs str=
uct */
+#define STACK_SWITCH_FRAME_SIZE UREGS_sizeof
+
+    .section .init.text, "ax", @progbits
+
+ENTRY(enter_of)
+    mflr %r0
+    std %r0, 16(%r1)
+    stdu %r1,-STACK_SWITCH_FRAME_SIZE(%r1) /* Save SP and create stack s=
pace */
+
+    /*
+     * Because PROM is running in 32b mode, it clobbers the high order h=
alf
+     * of all registers that it saves.  We therefore save those register=
s
+     * PROM might touch to the stack.  (%r0, %r3-%r13 are caller saved)
+     */
+    SAVE_GPR(2, %r1)
+    SAVE_GPR(13, %r1)
+    SAVE_NVGPRS(%r1)
+    mfcr %r10
+    mfmsr %r11
+    std %r10, UREGS_cr(%r1)
+    std %r11, UREGS_msr(%r1)
+
+    /* Put PROM address in SRR0 */
+    mtsrr0 %r4
+
+    /* Setup our trampoline return addr in LR */
+    bcl 20, 31,.+4
+0:  mflr %r4
+    addi %r4, %r4,(1f - 0b)
+    mtlr %r4
+
+    /* Prepare a 32-bit mode big endian MSR */
+    LOAD_IMM64(%r12, MSR_SF | MSR_LE)
+    andc %r11, %r11, %r12
+    mtsrr1 %r11
+    rfid
+
+1:  /* Return from OF */
+    FIXUP_ENDIAN
+
+    /* Just make sure that %r1 top 32 bits didn't get corrupt by OF */
+    rldicl %r1, %r1, 0, 32
+
+    /* Restore the MSR (back to 64 bits) */
+    ld %r0, UREGS_msr(%r1)
+    mtmsrd %r0
+    isync
+
+    /* Restore other registers */
+    REST_GPR(2, %r1)
+    REST_GPR(13, %r1)
+    REST_NVGPRS(%r1)
+    ld %r4, UREGS_cr(%r1)
+    mtcr %r4
+
+    addi %r1, %r1, STACK_SWITCH_FRAME_SIZE
+    ld %r0, 16(%r1)
+    mtlr %r0
+    blr
+
+    .size enter_of, . - enter_of
+    .type enter_of, %function
diff --git a/xen/arch/ppc/setup.c b/xen/arch/ppc/setup.c
index 73106474b2..7c623a49f5 100644
--- a/xen/arch/ppc/setup.c
+++ b/xen/arch/ppc/setup.c
@@ -1,16 +1,29 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #include <xen/init.h>
+#include <asm/boot.h>
+#include <asm/early_printk.h>
+#include <asm/processor.h>
=20
 /* Xen stack for bringing up the first CPU. */
 unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZ=
E);
=20
-/* Macro to adjust thread priority for hardware multithreading */
-#define HMT_very_low()  asm volatile (" or %r31, %r31, %r31 ")
-
 void __init noreturn start_xen(unsigned long r3, unsigned long r4,
                                unsigned long r5, unsigned long r6,
                                unsigned long r7)
 {
+    if ( r5 )
+    {
+        /* OpenFirmware boot protocol */
+        boot_of_init(r5);
+    }
+    else
+    {
+        /* kexec boot: Unimplemented */
+        __builtin_trap();
+    }
+
+    early_printk("Hello, ppc64le!\n");
+
     for ( ; ; )
         /* Set current hardware thread to very low priority */
         HMT_very_low();
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 19:05:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 19:05:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560045.875614 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHUI4-0005dC-K1; Thu, 06 Jul 2023 19:05:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560045.875614; Thu, 06 Jul 2023 19:05:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHUI4-0005d5-HW; Thu, 06 Jul 2023 19:05:20 +0000
Received: by outflank-mailman (input) for mailman id 560045;
 Thu, 06 Jul 2023 19:05:19 +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
 <SRS0=OuuY=CY=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qHUI3-0005ct-92
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 19:05:19 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0ae538e6-1c30-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 21:05:16 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id A2F0C8285741;
 Thu,  6 Jul 2023 14:05:15 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id yOAFtSgPUg5c; Thu,  6 Jul 2023 14:05:14 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id ED0DE8285730;
 Thu,  6 Jul 2023 14:05:13 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id BHL8IxSI0nzW; Thu,  6 Jul 2023 14:05:13 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 699948285345;
 Thu,  6 Jul 2023 14:05:13 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0ae538e6-1c30-11ee-8611-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com ED0DE8285730
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1688670314; bh=0ZI6Xig5+7HzPsOyKIZS0BXKLNylwn8aTM6JW5kDEnQ=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=aHvaAQoi66MQre51zEv5esh32hD0EUigBhEgWw4Eq/yfnzH/lYsbj7CEqdPrjaund
	 NeuHdRdA536znI0Sk79rNreaylud6ew9EP4uDlqfGAyXqRgkke7V869hXvtIcgxwYQ
	 Hv5T+1iFAhRbJHAA4FfXS6McfQY9HWm0tIo6VlRc=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v3 0/3] Early serial on Power
Date: Thu,  6 Jul 2023 14:04:38 -0500
Message-Id: <cover.1688670018.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Hello all,

This series adds support for early serial printing on Power, as well as
a simple CI smoke test modeled after the riscv one.

The first patch is responsible for setting up a basic C environment with
an initial stack while the second sets up an Open Firmware serial console
and primitive early_printk infrastructure.

This will currently only run on QEMU pseries VMs, since the firmware
interface on bare metal differs significantly. Support for bare metal
will be added in a future series.

Thanks,
Shawn

--
Changes in v3:
  - Set up r2 TOC pointer in start
  - Change indirect call to start_xen to a direct one
  - Use 32-bit constant loads for stack pointer, etc. in start
      - Our load address is < 4GB so this works fine
      - In a future series we'll get -fPIC working and change all of
        these immediate address loads to TOC-relative ones.
  - Move .bss initialization to patch 2
  - Move cpu0_boot_stack declaration to setup.c
  - Bump stack size down to one page (64k), previous was way overkill.
  - Remove unnecessary STACK_FRAME_OVERHEAD component from of-call.S
    stack frame size calculation
  - Add assertion that `struct cpu_user_regs` is stack-aligned
  - Move magic `or 31,31,31` to appropriately-named macro
  - Fix formatting of loop in setup.c
  - Add newline in arch/ppc/Makefile to preserve alphabetical ordering
    per group
  - Rebase on staging, including the final version of
    'xen/types: Rework stdint vs __{u,s}$N types'

Changes in v2:
  - Split main patch into two - one for basic C environment setup and
    one for serial
  - Mark OpenFirmware functions and early_printk functions as __init and
    change boot-of.o to boot-of.init.o in Makefile
  - Change <xen/lib.h> include to <xen/stdarg.h> and drop skeleton
    headers that are no longer necessary for build as a result
  - Add loop to clear .bss before jumping to C environment that was
    accidentally excluded from the first series
  - Move common asm macros from processor.h to asm-defns.h
  - Change note in head.S about preserved registers to a multi-line
    comment so it's more noticeable
  - Drop reg-defs.h and use '%'-prefixed register names in assembly
      - This is necessary since -mregnames, which allows standard
        non-prefixed register names without manual macro definitions,
        is not supported by LLVM's assembler.
  - Drop inline asm swab routines in favor of __builtin_bswap family
  - Fix up types.h in accordance with (as of now, unmerged)
    'xen/types: Rework stdint vs __{u,s}$N types'
  - Remove unnecessary braces for single-line statements
  - Remove unnecessary license text when SPDX header is present
  - Fix alphabetical ordering of object declarations in Makefile
  - Drop 'extern' from enter_of prototype, ensure prototypes have
    argument names

Shawn Anastasio (3):
  xen/ppc: Set up a basic C environment
  xen/ppc: Implement early serial printk on pseries
  automation: Add smoke test for ppc64le

 automation/gitlab-ci/test.yaml           |  20 ++++
 automation/scripts/qemu-smoke-ppc64le.sh |  27 +++++
 xen/arch/ppc/Kconfig.debug               |   5 +
 xen/arch/ppc/Makefile                    |   4 +
 xen/arch/ppc/boot-of.c                   | 100 ++++++++++++++++
 xen/arch/ppc/configs/ppc64_defconfig     |   1 +
 xen/arch/ppc/early_printk.c              |  28 +++++
 xen/arch/ppc/include/asm/asm-defns.h     |  57 ++++++++++
 xen/arch/ppc/include/asm/boot.h          |  23 ++++
 xen/arch/ppc/include/asm/byteorder.h     |  12 ++
 xen/arch/ppc/include/asm/config.h        |   5 +-
 xen/arch/ppc/include/asm/early_printk.h  |  15 +++
 xen/arch/ppc/include/asm/msr.h           |  51 +++++++++
 xen/arch/ppc/include/asm/processor.h     | 139 +++++++++++++++++++++++
 xen/arch/ppc/include/asm/types.h         |  21 ++++
 xen/arch/ppc/ppc64/Makefile              |   1 +
 xen/arch/ppc/ppc64/asm-offsets.c         |  59 ++++++++++
 xen/arch/ppc/ppc64/head.S                |  49 ++++----
 xen/arch/ppc/ppc64/of-call.S             |  83 ++++++++++++++
 xen/arch/ppc/setup.c                     |  32 ++++++
 20 files changed, 711 insertions(+), 21 deletions(-)
 create mode 100755 automation/scripts/qemu-smoke-ppc64le.sh
 create mode 100644 xen/arch/ppc/boot-of.c
 create mode 100644 xen/arch/ppc/early_printk.c
 create mode 100644 xen/arch/ppc/include/asm/asm-defns.h
 create mode 100644 xen/arch/ppc/include/asm/boot.h
 create mode 100644 xen/arch/ppc/include/asm/byteorder.h
 create mode 100644 xen/arch/ppc/include/asm/early_printk.h
 create mode 100644 xen/arch/ppc/include/asm/msr.h
 create mode 100644 xen/arch/ppc/include/asm/processor.h
 create mode 100644 xen/arch/ppc/include/asm/types.h
 create mode 100644 xen/arch/ppc/ppc64/of-call.S
 create mode 100644 xen/arch/ppc/setup.c

--
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 06 20:07:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 20:07:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560063.875655 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHVGM-0005Kq-3D; Thu, 06 Jul 2023 20:07:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560063.875655; Thu, 06 Jul 2023 20:07:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHVGL-0005Kj-VR; Thu, 06 Jul 2023 20:07:37 +0000
Received: by outflank-mailman (input) for mailman id 560063;
 Thu, 06 Jul 2023 20:07:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHVGK-0005KY-5Q; Thu, 06 Jul 2023 20:07:36 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHVGJ-0003c8-Ub; Thu, 06 Jul 2023 20:07:35 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHVGJ-0001HY-IX; Thu, 06 Jul 2023 20:07:35 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qHVGJ-0007Mx-Hn; Thu, 06 Jul 2023 20:07:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ou1hZpMK5ioAM0VUsJmXWDFWr004bArMbkQYE/1ZEb4=; b=cicU2JlLUUHPjNfKC/yvSrtwBb
	ZflMcYguTsAo8UDdH19S8kBcv3uRioRKmei0enweZfAuD9czB+/V8laBkZB+aZ/fANv8n/4K20peS
	ofQnj+DrsgvaoIgNvb/JDteXf8pQB2gUFDn7iretSjU0UhMlSl/VOxybTnIn7eyFpfhQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181719-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181719: regressions - FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:regression
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=1c139701ebaef5072ccfa5fdafc3bc60c650bb7e
X-Osstest-Versions-That:
    xen=dc5e6082f5b36c4a4008c158b53320699025f895
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 06 Jul 2023 20:07:35 +0000

flight 181719 xen-unstable real [real]
flight 181725 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181719/
http://logs.test-lab.xenproject.org/osstest/logs/181725/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail REGR. vs. 181715

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181715
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181715
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181715
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181715
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181715
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181715
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181715
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181715
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181715
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181715
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181715
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181715
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  1c139701ebaef5072ccfa5fdafc3bc60c650bb7e
baseline version:
 xen                  dc5e6082f5b36c4a4008c158b53320699025f895

Last test of basis   181715  2023-07-05 20:38:52 Z    0 days
Testing same since   181719  2023-07-06 06:54:41 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Julien Grall <jgrall@amazon.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 1c139701ebaef5072ccfa5fdafc3bc60c650bb7e
Author: Andrew Cooper <andrew.cooper3@citrix.com>
Date:   Wed Jun 21 21:44:37 2023 +0100

    xen/types: Rework stdint vs __{u,s}$N types
    
    Xen uses the stdint types.  Rearrange the types headers to define the
    compatibility __{u,s}$N types in terms of the stdint types, not the other way
    around.
    
    All supported compilers on architectures other than x86 support the stdint
    __*_TYPE__ macros.  Move these into a new xen/stdint.h to avoid them being
    duplicated in each architecture.  For the very old x86 compilers, synthesize
    suitable types using GCC internals.
    
    This cleanup has the side effect of removing all use of the undocumented
    __signed__ GCC keyword.  This is a vestigial remnant of `gcc -traditional`
    mode for dialetcs of C prior to the introduction of the signed keyword.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>

commit fe9e78dbd369f52d92e6535b1cf8c84d8d9d28a6
Author: Andrew Cooper <andrew.cooper3@citrix.com>
Date:   Mon Jun 26 16:36:36 2023 +0100

    treewide: Avoid including asm/types.h
    
    We're about to rearrange the common and arch types.h split.  While most
    users already include <xen/types.h>, a few do not and some files fail to
    compile as a result.
    
    Almost all logic is going to have types very early in the include chain.  Drop
    the include entirely from C files, and swap to the common types.h in headers.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>

commit b2e688730a17e3d2af72d7f1f1729047054b0e83
Author: Andrew Cooper <andrew.cooper3@citrix.com>
Date:   Wed Jun 21 21:36:54 2023 +0100

    xen/types: Drop #ifdefary for __{SIZE,PTRDIFF}_TYPE__
    
    All supported compilers have these types.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

commit 8720e7f3a482580cabddfb3126351da56a4c9690
Author: Andrew Cooper <andrew.cooper3@citrix.com>
Date:   Fri Jun 30 16:11:40 2023 +0100

    x86/asm: Introduce a tailcall pseduo-op
    
    It was previously noted that CALL/BUG is a weird combination, but there is
    good reason to use this pattern.
    
    Introduce an explicit tailcall macro make it clearer in context.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 21:17:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 21:17:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560070.875668 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHWLR-0004FR-1v; Thu, 06 Jul 2023 21:16:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560070.875668; Thu, 06 Jul 2023 21:16:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHWLQ-0004FK-V1; Thu, 06 Jul 2023 21:16:56 +0000
Received: by outflank-mailman (input) for mailman id 560070;
 Thu, 06 Jul 2023 21:16:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qHWLQ-0004FE-2P
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 21:16:56 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHWLH-0005Ci-PE; Thu, 06 Jul 2023 21:16:47 +0000
Received: from [54.239.6.185] (helo=[192.168.30.29])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHWLH-00067N-GZ; Thu, 06 Jul 2023 21:16:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=vGxvLNh2zcm8SoKqsav3VybWB/G6vNxWOJYJjJjNikg=; b=XVCFyDetj75Oj0s3SDaH8uKqax
	PsITiHDyGgZxBlFB3LS7OG6CrGakqzTsyfsxJxwpOhPXbTMVaXJijop19ddWhvlzgpmplAWXJB2N2
	253CiYj4hsL4R1KxNVdybsrU6Rip7E2gk1OhWhuMC+jTQI3DHnVxSj3zCcNrC7zN0mpg=;
Message-ID: <38817030-c342-c45c-2374-086f565de5ba@xen.org>
Date: Thu, 6 Jul 2023 22:16:44 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
Content-Language: en-US
To: Luca Fancellu <Luca.Fancellu@arm.com>
Cc: George Dunlap <george.dunlap@cloud.com>,
 Stefano Stabellini <stefano.stabellini@amd.com>, P S <pairspace@gmail.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 Christopher Clark <christopher.w.clark@gmail.com>,
 Andrew Cooper <Andrew.Cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Henry Wang <Henry.Wang@arm.com>,
 Community Manager <community.manager@xenproject.org>,
 Doug Goldstein <cardoe@cardoe.com>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Anthony PERARD <anthony.perard@citrix.com>
References: <8601CDD7-87F7-4FD0-A6E6-BAEAB12E7956@arm.com>
 <234199F8-DBB1-42B6-9A4C-8800EEF60997@gmail.com>
 <CA+zSX=Y3_g_aq4+sDK7CuZajywVqQ4xOrq7hKZ80eUT3uSxzuQ@mail.gmail.com>
 <alpine.DEB.2.22.394.2307051436120.761183@ubuntu-linux-20-04-desktop>
 <CA+zSX=ashTi590+cVss_3zyLESC8S=zVSMLjTKD00s6xfjZbJA@mail.gmail.com>
 <A89C2FC7-999E-4FCE-8A05-4F4B86573DBA@arm.com>
 <4aec2aca-e2e6-d9e4-1f73-b5f98245033a@xen.org>
 <4717B214-33FF-4B8B-B213-E6C0767D69C6@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <4717B214-33FF-4B8B-B213-E6C0767D69C6@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 06/07/2023 14:04, Luca Fancellu wrote:
> 
>>>>>
>>>>> The "start VMs from Xen on boot" functionality is the *only* thing that a big chunk of the users of this functionality want;  referring to
>>>>> it as "Hyperlaunch Lite" or "Hyperlaunch -1" will undermine the value of the functionality.
>>>>>
>>>>> What if we use "Measured Hyperlaunch", or "Hyperlaunch Measured Boot" to refer to the full measured boot functionality?
>>>>
>>>> I think this is the best way.
>>>>
>>>>
>>>>> Or, "Hyperlaunch DT" for "Booting VMs from Xen using Device Tree" (without the involvement of a domB), "Hyperlaunch Boot Domain /
>>>>> Hyperlaunch domB" for a more general "domB" functionality, and "Hyperlaunch Measured Boot" for the full functionality (assuming there's
>>>>> more to this than simply having a domB involved)?
>>>>
>>>>
>>>> We need an overarching name to cover the feature "start VMs from Xen on
>>>> boot" on both ARM and x86. From my understanding and from the original
>>>> emails on the subject, the name "hyperlaunch" was it.
>>>>
>>>> Sure; but think "guitar" vs "acoustic guitar" vs "electric guitar".  "Electric guitar" is new, "guitar" covers them both, but you sometimes need a way to specify "acoustic".  Right now target configurations we're talking about include:
>>>>
>>>> 1. Booting all your domains directly from Xen using DT configurations
>>>> 2. Booting a domB, which then executes some more complicated programmatic configuration to launch VMs before disappearing
>>>> 3. Doing full measured boot on the whole system using a domB.
>>>>
>>>> If "Hyperlaunch" means 1-3, we not only need a way to specify that you're talking about 3, but *also* a way to specify that you're talking about 1.  In the vast majority of cases for the foreseeable future are going to be 1.  Additionally, we want to make sure that "Hyperlaunch" *actually* turns out to mean 1-3, and not just 1.
>>>>
>>>> The thing I like about "Hyperlaunch DT" is that to me it sounds pretty cool but also is very descriptive: I haven't talked to people building these systems, but it seems like saying, "The hypervisor launches VMs based on a Device Tree passed to it at boot" will be immediately understood, and stick in people's minds.
>>> Personally, I like the name â€œHyperlaunch DTâ€, because it tells me that we are launching VMs and the DT is involved, if I understood correctly the design,
>>> it would be the same also on x86 (and in every architecture that will come later) so being â€œHyperlaunch DTâ€ an arch agnostic name makes it a good
>>> candidate for phase out dom0less name and for the future when a common code will use the DT to launch VMs at Xen boot.
>>
>> I assume that DT means Device-Tree here. If so, I find a name a bit misleading because we are talking about the way to pass the configuration rather than what the feature is doing.
>>
>> My assumption here is that a DomB solution would still use the Device-Tree to describe the domains.
> 
> The sentence below makes sense to me, â€œDTâ€, â€œdomB/Boot/Boot Domain/BDâ€, â€œMeasured Boot/MBâ€ can do the work of distinguish the functionalities, even if the Device tree is involved in all of them.

Throwing another name we discussed today at the pub. How about: 
"Hyperlaunch static"

This would indicate the domains have been statically configured whereas 
I guess the one from DomB may be more dynamic?

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 21:39:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 21:39:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560076.875677 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHWhC-0006n9-RY; Thu, 06 Jul 2023 21:39:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560076.875677; Thu, 06 Jul 2023 21:39:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHWhC-0006n2-Ot; Thu, 06 Jul 2023 21:39:26 +0000
Received: by outflank-mailman (input) for mailman id 560076;
 Thu, 06 Jul 2023 21:39:25 +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
 <SRS0=v06Q=CY=amd.com=stefano.stabellini@srs-se1.protection.inumbo.net>)
 id 1qHWhB-0006me-Cz
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 21:39:25 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on20622.outbound.protection.outlook.com
 [2a01:111:f400:fe59::622])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 900ee93c-1c45-11ee-8611-37d641c3527e;
 Thu, 06 Jul 2023 23:39:21 +0200 (CEST)
Received: from MW3PR05CA0011.namprd05.prod.outlook.com (2603:10b6:303:2b::16)
 by MW4PR12MB7381.namprd12.prod.outlook.com (2603:10b6:303:219::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24; Thu, 6 Jul
 2023 21:39:10 +0000
Received: from CO1NAM11FT008.eop-nam11.prod.protection.outlook.com
 (2603:10b6:303:2b:cafe::f6) by MW3PR05CA0011.outlook.office365.com
 (2603:10b6:303:2b::16) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.12 via Frontend
 Transport; Thu, 6 Jul 2023 21:39:10 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CO1NAM11FT008.mail.protection.outlook.com (10.13.175.191) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6521.45 via Frontend Transport; Thu, 6 Jul 2023 21:39:10 +0000
Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Jul
 2023 16:39:09 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB08.amd.com
 (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Jul
 2023 14:39:09 -0700
Received: from ubuntu-20.04.2-arm64.shared (10.180.168.240) by
 SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.23 via Frontend Transport; Thu, 6 Jul 2023 16:39:08 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 900ee93c-1c45-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Me8fKvXe5W0oJwBbro+CEeE08+VTxBJgz8g9mwsqcfALRXlwZJZ9+bLkIQ/i9F3O4LuDfFz492OFkp9lo2ILUzDa607Htjy7MK29no2WsHF3xvwRRHi+ngneblFRqcdf+uvGrwOPNicsSQCx5tsvmFzbg1ixCNWt6S+oUnKPQjplnk6G/PnEGi0DW4kn5QT+cgVV3SqfmAuNBkWn19sjDFEJ2KsSDmwbCmqe479Fk9STYCltmilyX2g4FrRip0jcb87RPz0/M+K1uGo/hUVKYsdCppcTqVhX58jp0GYAzoxqNC05RgK1YvsyKrQ3sXrf7eFRDoFCMEhiBat4HIP45A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=l644wlFuQviuTt5zK+sx8fbek8CBGpm8B/UjQ2SWsts=;
 b=B9b0sWujK4f8it/znPD2TYoyVfIxqSLxDBR3HoQl9pdQhnqqcmVUPUXCs1t0j3in4gWISaeMhwG6mVoe3KfPPzdfdaqrNz2L3dY7/A8Zlbg4RxFl7f1B7tLgdez+ub0l5Lvnux47+B7ANMF2gEM8rGTlhLq8Y+RjjFWl2VURv/vAG8kGiPGeKlQxA9hdf6yqNWd+9ErgX509nR5sroVWexd/u8JoybjujuAeFIEO2VuRIP41gSxpYgTs1QFP2JusbSq6WP6pepZs1TuSRXAmrVIa2LlgVIsojQbuu2HKy9IsvxA0LWItma9bJw2XPen9L4amL0OaUQ8oGUGG6OAz7g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=cloud.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=l644wlFuQviuTt5zK+sx8fbek8CBGpm8B/UjQ2SWsts=;
 b=C88IdGWAtucCvOY4vqrZXYbFlqck+Pkor22YHXhFi/Y8IGnDgmlUxXWzNxxh4Z/Z1IuBCcFApDOW3WKcstYfuWKZy+5M2KYn1iaHyeQHMrSAnUwVkI6GJOG7yybXGBRf074Iludi4kfiYCVv5EgYzety1iDl91b/ewq9hfSu/Y4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Date: Thu, 6 Jul 2023 14:39:01 -0700
From: Stefano Stabellini <stefano.stabellini@amd.com>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: George Dunlap <george.dunlap@cloud.com>
CC: Stefano Stabellini <stefano.stabellini@amd.com>, P S
	<pairspace@gmail.com>, Luca Fancellu <luca.fancellu@arm.com>, "Stefano
 Stabellini" <sstabellini@kernel.org>, "Daniel P. Smith"
	<dpsmith@apertussolutions.com>, Christopher Clark
	<christopher.w.clark@gmail.com>, Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>,
	George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, Henry Wang
	<Henry.Wang@arm.com>, Community Manager <community.manager@xenproject.org>,
	Doug Goldstein <cardoe@cardoe.com>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
In-Reply-To: <CA+zSX=ashTi590+cVss_3zyLESC8S=zVSMLjTKD00s6xfjZbJA@mail.gmail.com>
Message-ID: <alpine.DEB.2.22.394.2307061328540.761183@ubuntu-linux-20-04-desktop>
References: <8601CDD7-87F7-4FD0-A6E6-BAEAB12E7956@arm.com> <234199F8-DBB1-42B6-9A4C-8800EEF60997@gmail.com> <CA+zSX=Y3_g_aq4+sDK7CuZajywVqQ4xOrq7hKZ80eUT3uSxzuQ@mail.gmail.com> <alpine.DEB.2.22.394.2307051436120.761183@ubuntu-linux-20-04-desktop>
 <CA+zSX=ashTi590+cVss_3zyLESC8S=zVSMLjTKD00s6xfjZbJA@mail.gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="8323329-1226463232-1688675744=:761183"
Content-ID: <alpine.DEB.2.22.394.2307061335480.761183@ubuntu-linux-20-04-desktop>
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1NAM11FT008:EE_|MW4PR12MB7381:EE_
X-MS-Office365-Filtering-Correlation-Id: 9cbc4504-53b1-4fb6-e715-08db7e696f5f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	0YEBRSfFLhtGXbAwaMIaEXiL8WDYFsBsUBo76AH10iQo6hipwn7QemyNk6c+bGwlZktoVBML9DJtgLBfV5f4giFch1Y7W/6hWRPjy0Fx6oRLSfonmCUgBAS3yNXPCPe62a2M0t+EMYlBR+iH8amdlbB2Q8zdf/zgFCOAKQ349hl4jb6rOvilaRazx7j82FDQpCuBxWmSb/HO//OoVKAyQcMoF4If7RdpopQg9DW8nM6pZJLG4xeqEI9AudUmF2bUc++xRKE8n6AZiinvMuCzf2D7N4+FHY6QV6W3wRNFij9a2RAOGzhgSYAdEiXjS8ghS/3wOAAcNtWTHEhZ41yvZgW/MKrI7vNnEHIP/3lqnFxfURnz8mCnCHJ8V14m8y8WbrV/+aMgcXpDXTSmeAlfiFemYvudlal/z+y5zDEl3Lkjv4sFz5ToRcTBUbbVu1apOYsnilj2QwlvsMvpDnlhb24lCX6fGYI2F+8YvM/4yBJve80uamy9dhuZa/6FWSd9r5xO2znlv8DAiP/dWi0Rp63OY5GLqvVUknIcXc7jwHlKWP7GJiAf9bEHdQDZ7b8LVyx4VEZKs7zdvfnYOoqx5EWVctYC95nC1JnlzzABVAVfpE+4sC8OMu/T5vtmqH9n0MQpfCMFl2E8DiwrOqWFI4kgscr9qB9y7j6eSUq3b/TTjSM+/YosM5abOeYY4mFqQlJltjhDteyHFQpBHF0nqW62DCD8siMuxHtD04EuD2DeuU7528Ruue/9mqZqxLVnza9EfC60L7SYlcMwpWh2KNkiPcFC6toZeQ/iuxJHo80=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(7916004)(4636009)(396003)(346002)(376002)(39860400002)(136003)(451199021)(46966006)(40470700004)(36840700001)(70206006)(5660300002)(7416002)(6916009)(4326008)(44832011)(70586007)(41300700001)(316002)(8936002)(8676002)(40460700003)(86362001)(33716001)(82310400005)(40480700001)(30864003)(2906002)(33964004)(426003)(6666004)(83380400001)(26005)(53546011)(336012)(186003)(9686003)(36860700001)(82740400003)(356005)(81166007)(54906003)(47076005)(478600001)(32563001)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 21:39:10.6560
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 9cbc4504-53b1-4fb6-e715-08db7e696f5f
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1NAM11FT008.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7381

--8323329-1226463232-1688675744=:761183
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8BIT
Content-ID: <alpine.DEB.2.22.394.2307061335481.761183@ubuntu-linux-20-04-desktop>

On Thu, 6 Jul 2023, George Dunlap wrote:
> On Wed, Jul 5, 2023 at 11:14â€¯PM Stefano Stabellini <stefano.stabellini@amd.com> wrote:
>       On Wed, 5 Jul 2023, George Dunlap wrote:
>       > On Mon, Jul 3, 2023 at 9:55â€¯PM P S <pairspace@gmail.com> wrote:
>       >Â  Â  Â  Â > On Jul 3, 2023, at 15:45, Luca Fancellu <luca.fancellu@arm.com> wrote:
>       >Â  Â  Â  Â ï»¿>
>       >Â  Â  Â  Â >> On 3 Jul 2023, at 18:48, Stefano Stabellini <sstabellini@kernel.org> wrote:
>       >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >>> On Mon, 3 Jul 2023, Daniel P. Smith wrote:
>       >Â  Â  Â  Â >>> On 7/1/23 11:13, Luca Fancellu wrote:
>       >Â  Â  Â  Â >>>>> On 1 Jul 2023, at 08:53, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>       >Â  Â  Â  Â >>>>>
>       >Â  Â  Â  Â >>>>> On 30/06/2023 10:12 am, Luca Fancellu wrote:
>       >Â  Â  Â  Â >>>>>> The "dom0less" feature was intended to be the feature where a domU
>       >Â  Â  Â  Â >>>>>> domain could be launched without the control domain (Dom0)
>       >Â  Â  Â  Â >>>>>> intervention, however the name seems to suggest that Dom0 cannot
>       >Â  Â  Â  Â >>>>>> be part of the configuration, while instead it's a possible use case.
>       >Â  Â  Â  Â >>>>>>
>       >Â  Â  Â  Â >>>>>> To avoid that, rename the "dom0less" configuration with the name
>       >Â  Â  Â  Â >>>>>> "hyperlaunch", that is less misleading.
>       >Â  Â  Â  Â >>>>>>
>       >Â  Â  Â  Â >>>>>> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
>       >Â  Â  Â  Â >>>>>> ---
>       >Â  Â  Â  Â >>>>>> This is an RFC to get the feeling of the community about the name
>       >Â  Â  Â  Â >>>>>> change, for now it's everything in one patch just to see how it
>       >Â  Â  Â  Â >>>>>> will look like, if there is interest on proceeding into it, I can
>       >Â  Â  Â  Â >>>>>> split in more commit.
>       >Â  Â  Â  Â >>>>>
>       >Â  Â  Â  Â >>>>> Have you discussed this with Dan and Chris at all?Â  You haven't even
>       >Â  Â  Â  Â >>>>> CC'd them.
>       >Â  Â  Â  Â >>>>
>       >Â  Â  Â  Â >>>> No, this rename idea started from a chat during the summit, anyway Julien
>       >Â  Â  Â  Â >>>> promptly add them to the CC, because I forgot.
>       >Â  Â  Â  Â >>>
>       >Â  Â  Â  Â >>> No worries and thank you for considering and taking the time to do this RFC.
>       >Â  Â  Â  Â >>> It is greatly appreciated that there is a strong willingness to have dom0less
>       >Â  Â  Â  Â >>> and hyperlaunch merged.
>       >Â  Â  Â  Â >>>
>       >Â  Â  Â  Â >>>>>
>       >Â  Â  Â  Â >>>>> While there is a lot of end-goal in common between the dom0less and
>       >Â  Â  Â  Â >>>>> hyperlaunch, and that the name dom0less is deeply misleading,
>       >Â  Â  Â  Â >>>>> hyperlaunch is specifically not this.
>       >Â  Â  Â  Â >>>>
>       >Â  Â  Â  Â >>>> Yes Hyperlaunch is more than this, however as I said, with this RFC I would
>       >Â  Â  Â  Â >>>> like
>       >Â  Â  Â  Â >>>> to ear opinions, @Daniel @Christopher could it be a proper name for the
>       >Â  Â  Â  Â >>>> dom0less
>       >Â  Â  Â  Â >>>> feature?
>       >Â  Â  Â  Â >>>
>       >Â  Â  Â  Â >>> As Andy has alluded, hyperlaunch is meant to provide a flexible means to
>       >Â  Â  Â  Â >>> handle domain construction at boot to meet a wide range of possible use cases.
>       >Â  Â  Â  Â >>> One of those use cases is dom0less, so yes, ultimately what dom0less does
>       >Â  Â  Â  Â >>> today will be achievable under hyperlaunch. Our intended approach to align the
>       >Â  Â  Â  Â >>> two implementations is one that is meant to be minimally disruptive, since
>       >Â  Â  Â  Â >>> dom0less is considered a supported (SUPPORT.md) capability. As mentioned, we
>       >Â  Â  Â  Â >>> are greatly appreciative to the openness to adopt the name,
>       >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >> Thanks Daniel!
>       >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >>> but a big concern
>       >Â  Â  Â  Â >>> I personally have is the confusion it could cause a general user. A blanket
>       >Â  Â  Â  Â >>> rename would end up with two documents in the docs tree that provide two
>       >Â  Â  Â  Â >>> different explanations of hyperlaunch and two different device tree
>       >Â  Â  Â  Â >>> definitions. So I think a more measured approach should be considered here.
>       >Â  Â  Â  Â >>>
>       >Â  Â  Â  Â >>>> If this patch makes things more difficult for the Hyperlunch serie, Iâ€™m ok
>       >Â  Â  Â  Â >>>> to drop it,
>       >Â  Â  Â  Â >>>> my only aim was just to find a less misleading name for the feature.
>       >Â  Â  Â  Â >>>
>       >Â  Â  Â  Â >>> What I would like to suggest as a good first step would be an update to the
>       >Â  Â  Â  Â >>> dom0less document. Provide a note at the beginning that points to the
>       >Â  Â  Â  Â >>> hyperlaunch design doc as a more general approach that will eventually subsume
>       >Â  Â  Â  Â >>> dom0less. This would provide a gentler transition for exist users of dom0less.
>       >Â  Â  Â  Â >>>
>       >Â  Â  Â  Â >>> If it is not too much, I would also ask, please have a look at the design for
>       >Â  Â  Â  Â >>> boot modules in the series Christopher just posted. The design pulls from the
>       >Â  Â  Â  Â >>> work done by dom0less and expanded upon it. I major step into merging the two
>       >Â  Â  Â  Â >>> capabilities will be to have a common set of structures. Once those are in
>       >Â  Â  Â  Â >>> place, we can move to a common device tree representation, and at that point
>       >Â  Â  Â  Â >>> we would be fairly close, if not at the point of a formal merger of between
>       >Â  Â  Â  Â >>> the two.
>       >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >> At the moment we have a concrete problem with explaining dom0less and
>       >Â  Â  Â  Â >> hyperlaunch to potential new users. Using two different names for a
>       >Â  Â  Â  Â >> similar feature on arm and x86 causes confusion. It is hurting Xen as a
>       >Â  Â  Â  Â >> solution. Personally I already had to switch to use the word
>       >Â  Â  Â  Â >> "hyperlaunch" for everything in my users-facing presentations.
>       >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >> At the summit, we discussed that it would be a good idea to use a single
>       >Â  Â  Â  Â >> name to refer to both features on arm and x86. Given that "dom0less"
>       >Â  Â  Â  Â >> causes additional issues because it makes people think that there is no
>       >Â  Â  Â  Â >> Dom0, the suggestion was to use "hyperlaunch" to refer to both features.
>       >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >> We don't need to 100% align the two implementations and data structures.
>       >Â  Â  Â  Â >> This is not for engineers that are going to look at the specifications
>       >Â  Â  Â  Â >> and improve them. This is for users/customers of Xen that are trying to
>       >Â  Â  Â  Â >> understand what the hypervisor enables them to do. We need to be able to
>       >Â  Â  Â  Â >> show users architecture slides with the same name and explanation on
>       >Â  Â  Â  Â >> both ARM and x86.
>       >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >> I am sure that Daniel and Christopher remember, but for the others on
>       >Â  Â  Â  Â >> this email thread, the name "hyperlaunch" was born exactly to be that:
>       >Â  Â  Â  Â >> the one name to cover both features on ARM and x86 even if they have a
>       >Â  Â  Â  Â >> different implementation. Appended an old email for reference.
>       >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >> Also I agree with Daniel that we need to be careful about the two docs
>       >Â  Â  Â  Â >> under docs/. I think he is right we need to add a paragraph explaining
>       >Â  Â  Â  Â >> the history and a pointer to the other document. Something like:
>       >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >> "Dom0less is the name that was used when initially introducing the
>       >Â  Â  Â  Â >> feature on ARM. Then, the "dom0less" name was retired in favor of
>       >Â  Â  Â  Â >> "hyperlaunch" to avoid confusion (a Dom0 might still be present) and to
>       >Â  Â  Â  Â >> align with x86 (where a similar feature was called hyperlaunch from the
>       >Â  Â  Â  Â >> start)."
>       >Â  Â  Â  Â >
>       >Â  Â  Â  Â > Iâ€™m fully ok to add a section like this pointing to the Hyperlaunch design.
>       >
>       >Â  Â  Â  Â _If_ this text is added, please include links/references to the Hyperlaunch wiki page and Hyperlaunch design docs.
>       >
>       >Â  Â  Â  Â > @Daniel and @Christopher would it be ok for you or the changes in the serie
>       >Â  Â  Â  Â > are going to be problematic for your future work? In the end itâ€™s just a mechanical
>       >Â  Â  Â  Â > rename, so I guess we just need to agree on naming conventions.
>       >
>       >Â  Â  Â  Â Please see the history of trademark litigation about the use of symbolic names to reference similar-but-different
>       artifacts.Â 
>       >Â  Â  Â  Â It is much easier to use the same name to refer to entirely different objects. Historically, confusion arises when a
>       name is
>       >Â  Â  Â  Â used in similar contexts.
>       >
>       >Â  Â  Â  Â There is also versioning.Â  Could we refer to dom0less as "Hyperlaunch Version -1"?
>       >
>       >Â  Â  Â  Â How about renaming dom0less to "Hyperlaunch Lite"?
>       >
>       >
>       > Perhaps it would be helpful if you could explain more clearly your concerns.Â  I take it that you want a name which can be
>       used specifically
>       > to indicate the full "domB measured boot" functionality that was Daniel and Christopher's original goal, and that you're
>       afraid that using
>       > plain "Hyperlaunch" for only the "start VMs from Xen on boot" functionality will dilute that?
>       >
>       > The "start VMs from Xen on boot" functionality is the *only* thing that a big chunk of the users of this functionality want;Â 
>       referring to
>       > it as "Hyperlaunch Lite" or "Hyperlaunch -1" will undermine the value of the functionality.
>       >
>       > What if we use "Measured Hyperlaunch", or "Hyperlaunch Measured Boot" to refer to the full measured boot functionality?
> 
>       I think this is the best way.
> 
> 
>       > Or, "Hyperlaunch DT" for "Booting VMs from Xen using Device Tree" (without the involvement of a domB), "Hyperlaunch Boot
>       Domain /
>       > Hyperlaunch domB" for a more general "domB" functionality, and "Hyperlaunch Measured Boot" for the full functionality
>       (assuming there's
>       > more to this than simply having a domB involved)?
> 
> 
>       We need an overarching name to cover the feature "start VMs from Xen on
>       boot" on both ARM and x86. From my understanding and from the original
>       emails on the subject, the name "hyperlaunch" was it.
> 
> 
> Sure; but think "guitar" vs "acoustic guitar" vs "electric guitar".Â  "Electric guitar" is new, "guitar" covers them both, but you sometimes
> need a way to specify "acoustic".Â  Right now target configurations we're talking about include:
> 
> 1. Booting all your domains directly from Xen using DT configurations
> 2. Booting a domB, which then executes some more complicated programmatic configuration to launch VMs before disappearing
> 3. Doing full measured boot on the whole system using a domB.
> 
> If "Hyperlaunch" means 1-3, we not only need a way to specify that you're talking about 3, but *also* a way to specify that you're talking
> about 1.Â  In the vast majority of cases for the foreseeable future areÂ going to be 1.Â  Additionally, we want to make sure that
> "Hyperlaunch" *actually* turns out to mean 1-3, and not just 1.
> 
> The thing I like about "Hyperlaunch DT" is that to me it sounds pretty cool but also is very descriptive: I haven't talked to people
> building these systems, but it seems like saying, "The hypervisor launches VMs based on a Device Tree passed to it at boot" will be
> immediately understood, and stick in people's minds.
> 
> So maybe informally, or in "short usage" use "Hyperlaunch", but in documentation or reference systems, when talking specifically about #1,
> try to use "Hyperlaunch DT", just to reinforce the idea that there's more to Hyperlaunch that's coming down the road?

"Hyperlaunch DT" would refer to both the x86 and ARM implementations
because they are both based on DT.

I think it is better than "Hyperlaunch Lite" but I am not a fan of
either of these two names because "DT" and "Lite" get easily lost in
presentations and discussions. For the next few years many will talk
about HyperLaunch just to refer to what is Dom0less today. So if the
goal when we say "HyperLaunch" is to bring Measure Boot or XSM to
people's minds, I don't think this will work well.

If we want to keep "Hyperlaunch" to mean 1-3 above, highlighting Measure
Boot or XSM, then I think we should consider using "Dom0less" for 1.
Yes, it is misleding, but at least it is unique, and a google search for
"dom0less" leads the user to the right results.

If we do that, we should rename "Hyperlaunch" with "Dom0less" in
docs/designs/launch/hyperlaunch.rst. That's because "Hyperlaunch" is
defined as "the ability of a hypervisor to construct and start one or
more virtual machines at system launch in a specific way", which falls
under Dom0less in this discussion.

In my opinion, it is better to have specific names for specific
features. So I would use "HyperLaunch" to mean "the ability of a
hypervisor to construct and start one or more virtual machines at system
launch in a specific way" as it is defined today.

When we add Measure Boot or XSM or other security/safety features, I
would call them out specifically. For instance, "HyperLaunch with XSM".
It is more descriptive and highlights each feature.

Note that at AMD we'll need HyperLaunch without an all-powerful Dom0,
probably with XSM. So I am not writing this because I don't think the
other features 2-3 are not important. They definitely are important.
--8323329-1226463232-1688675744=:761183--


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 21:49:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 21:49:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560081.875691 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHWqv-0008If-QG; Thu, 06 Jul 2023 21:49:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560081.875691; Thu, 06 Jul 2023 21:49:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHWqv-0008IY-M6; Thu, 06 Jul 2023 21:49:29 +0000
Received: by outflank-mailman (input) for mailman id 560081;
 Thu, 06 Jul 2023 21:49:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=9JNo=CY=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHWqt-0008IS-L8
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 21:49:27 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f9217954-1c46-11ee-b237-6b7b168915f2;
 Thu, 06 Jul 2023 23:49:25 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 67A6A61347;
 Thu,  6 Jul 2023 21:49:24 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 878D3C433C8;
 Thu,  6 Jul 2023 21:49:22 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f9217954-1c46-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688680163;
	bh=6nr9Df/SLX875a6ZfuEptghy0rbv4s3pkVdYz+vBJIg=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=VR9mnRcHMHfP3au1WeXeEnCB5LmMzYnVRE0CDvXHPF+mpw0sQeuYZR0GxyzJ29n/S
	 mhB7NYIaY9sa0KUwwfrWZdxzXVW7WYav5YLYkfJaRRMv9cAePDZRGcQi97ix791me9
	 /D1O+/eKz0lWlSn7lECbkVbhWWgZicUs+IvxFKMgkk1OmNWvp7NIytKkeGjEeMJlHs
	 ZnCnxjE/b9iotycllAIlkbw9Dv3kvFlvJHLpxA1IyMJ26Pf4+cmrXfZKuHaAjv6Lqw
	 BCq67Sw0eTOdYChqXVlLJkWTed73DCRYpezTyc18OpiE8aI4LfBZm4pgnCCbopEx9O
	 k+4hMTkBIFf5g==
Date: Thu, 6 Jul 2023 14:49:20 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    Oleksandr Tyshchenko <olekstysh@gmail.com>, 
    Juergen Gross <jgross@suse.com>, 
    =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>, 
    Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>, 
    Petr Pavlu <petr.pavlu@suse.com>, 
    "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
    "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, 
    vikram.garhwal@amd.com
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
In-Reply-To: <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
Message-ID: <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>
References: <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop> <b21398eb-2fb2-4fca-dd90-d2c81d8df1c4@epam.com> <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop> <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>
 <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com> <ZKQF8qq8Oh5E+Fxx@mail-itl> <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local> <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com> <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop> <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; BOUNDARY="8323329-507063870-1688680118=:761183"
Content-ID: <alpine.DEB.2.22.394.2307061448420.761183@ubuntu-linux-20-04-desktop>

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-507063870-1688680118=:761183
Content-Type: text/plain; CHARSET=UTF-8
Content-Transfer-Encoding: 8BIT
Content-ID: <alpine.DEB.2.22.394.2307061448421.761183@ubuntu-linux-20-04-desktop>

On Thu, 6 Jul 2023, Roger Pau MonnÃ© wrote:
> On Wed, Jul 05, 2023 at 03:41:10PM -0700, Stefano Stabellini wrote:
> > On Wed, 5 Jul 2023, Roger Pau MonnÃ© wrote:
> > > On Tue, Jul 04, 2023 at 08:14:59PM +0300, Oleksandr Tyshchenko wrote:
> > > > **********
> > > > 
> > > > Part 1 (intro):
> > > > 
> > > > We could reuse a PCI config space register to expose the backend id.
> > > > However this solution requires a backend change (QEMU) to expose the
> > > > backend id via an emulated register for each emulated device.
> > > > 
> > > > To avoid having to introduce a special config space register in all
> > > > emulated PCI devices (virtio-net, virtio-block, etc) I wonder if we
> > > > could add a special PCI config space register at the emulated PCI Root
> > > > Complex level.
> > > > 
> > > > Basically the workflow would be as follow:
> > > > 
> > > > - Linux recognizes the PCI Root Complex as a Xen PCI Root Complex
> > > > - Linux writes to special PCI config space register of the Xen PCI Root
> > > >   Complex the PCI device id (basically the BDF)
> > > > - The Xen PCI Root Complex emulated by Xen answers by writing back to
> > > >   the same location the backend id (domid of the backend)
> > > > - Linux reads back the same PCI config space register of the Xen PCI
> > > >   Root Complex and learn the relevant domid
> > > 
> > > IMO this seems awfully complex.  I'm not familiar with the VirtIO
> > > spec, but I see there's a Vendor data capability, could we possibly
> > > expose Xen-specific information on that capability?
> > 
> > That is also a possibility too. Also we could use a PCI conf register
> > which is known to be unused in the Virtio spec to expose the grant
> > capability and backend domid.
> 
> Capabilities don't have a fixed config space register, they are a
> linked list, and so capabilities end up at different positions
> depending on the specific device layout.  The only fixed part is the
> range from [0, 0x3F), and that's fully defined in the specification.
> 
> Trying to define a fixed address for Xen use after the 3f boundary
> seems like a bad idea, as it's going to be hard to make sure that such
> address is not used on all possible devices.  IMO the only way is to
> place such information in a capability, whether that's an existing
> capability or a new one I don't really know.

That seems like a good idea
 
 
> > > > Part 2 (clarification):
> > > > 
> > > > I think using a special config space register in the root complex would
> > > > not be terrible in terms of guest changes because it is easy to
> > > > introduce a new root complex driver in Linux and other OSes. The root
> > > > complex would still be ECAM compatible so the regular ECAM driver would
> > > > still work. A new driver would only be necessary if you want to be able
> > > > to access the special config space register.
> > > 
> > > I'm slightly worry of this approach, we end up modifying a root
> > > complex emulation in order to avoid modifying a PCI device emulation
> > > on QEMU, not sure that's a good trade off.
> > > 
> > > Note also that different architectures will likely have different root
> > > complex, and so you might need to modify several of them, plus then
> > > arrange the PCI layout correctly in order to have the proper hierarchy
> > > so that devices belonging to different driver domains are assigned to
> > > different bridges.
> > 
> > I do think that adding something to the PCI conf register somewhere is
> > the best option because it is not dependent on ACPI and it is not
> > dependent on xenstore both of which are very undesirable.
> > 
> > I am not sure where specifically is the best place. These are 3 ideas
> > we came up with:
> > 1. PCI root complex
> > 2. a register on the device itself
> > 3. a new capability of the device
> > 4. add one extra dummy PCI device for the sole purpose of exposing the
> >    grants capability
> > 
> > 
> > Looking at the spec, there is a way to add a vendor-specific capability
> > (cap_vndr = 0x9). Could we use that? It doesn't look like it is used
> > today, Linux doesn't parse it.
> 
> I did wonder the same from a quick look at the spec.  There's however
> a text in the specification that says:
> 
> "The driver SHOULD NOT use the Vendor data capability except for
> debugging and reporting purposes."
> 
> So we would at least need to change that because the capability would
> then be used by other purposes different than debugging and reporting.
> 
> Seems like a minor adjustment, so might we worth asking upstream about
> their opinion, and to get a conversation started.

Wait, wouldn't this use-case fall under "reporting" ? It is exactly what
we are doing, right?

 
> > > > 
> > > > 
> > > > **********
> > > > What do you think about it? Are there any pitfalls, etc? This also requires
> > > > system changes, but at least without virtio spec changes.
> > > 
> > > Why are we so reluctant to add spec changes?  I understand this might
> > > take time an effort, but it's the only way IMO to build a sustainable
> > > VirtIO Xen implementation.  Did we already attempt to negotiate with
> > > Oasis Xen related spec changes and those where refused?
> > 
> > That's because spec changes can be very slow. This is a bug that we need
> > a relatively quick solution for and waiting 12-24 months for a spec
> > update is not realistic.
> > 
> > I think a spec change would be best as a long term solution. We also
> > need a short term solution. The short term solution doesn't have to be
> > ideal but it has to work now.
> 
> My fear with such approach is that once a bodge is in place people
> move on to other stuff and this never gets properly fixed.
> 
> I know this might not be a well received opinion, but it would be
> better if such bodge is kept in each interested party patchqueue for
> the time being, until a proper solution is implemented.  That way
> there's an interest from parties into properly fixing it upstream.

Unfortunately we are in the situation where we have an outstanding
upstream bug, so we have to take action one way or the other.
--8323329-507063870-1688680118=:761183--


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 22:05:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 22:05:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560088.875704 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHX6Z-0002NC-9N; Thu, 06 Jul 2023 22:05:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560088.875704; Thu, 06 Jul 2023 22:05:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHX6Z-0002N5-6Y; Thu, 06 Jul 2023 22:05:39 +0000
Received: by outflank-mailman (input) for mailman id 560088;
 Thu, 06 Jul 2023 22:05:38 +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
 <SRS0=9JNo=CY=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHX6Y-0002Mz-Ma
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 22:05:38 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3b517880-1c49-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 00:05:35 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 70BAD6132C;
 Thu,  6 Jul 2023 22:05:34 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 345ABC433C7;
 Thu,  6 Jul 2023 22:05:31 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3b517880-1c49-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688681133;
	bh=dbV5LKGfu3VZZjOXJh0NwH/tFvvVOQnoDjeA8F5+7Kk=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=F8le/+YPr2gg6MeHnQvTKhnhgAmdXSdm59CIww0sYIdRTsS8ndgc1/iwc096YIlMq
	 54d9UQQD/NxfEoXJKszj11ia2Z+ej3M8wfO5dGHkf1KJRRK/K1iEHrbw9bAMFWkwMG
	 qk1CalQB5ODGdt0rVSKJhKKYxkA/X0bnaSeVhpRXUUljjZuKHrvtwNMgmffr57Cg7R
	 FCtV+VTyQ1QvjZoZh0ylkHns5yNxCqC7bYubraxCpQ5M9D3ELyA2KU6GQPWMU1EJJt
	 GnUPij1r7RVEdjIUjHqwKg9VURGspnUHYzKdSMaxGKOmQ6ekxQkV21dFp8BbswvRYm
	 ti9/hu+PTMIlA==
Date: Thu, 6 Jul 2023 15:05:29 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    Federico Serafini <federico.serafini@bugseng.com>, 
    xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <xenia.ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH 4/5] x86/x86_emulate: change parameter name from 's'
 to 'state'
In-Reply-To: <c2a52a88-a8bf-3e14-f3f5-616177c3d807@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307061450530.761183@ubuntu-linux-20-04-desktop>
References: <cover.1688049494.git.federico.serafini@bugseng.com> <8c8bc96b96a1111a4651f970f506d304809ea40d.1688049495.git.federico.serafini@bugseng.com> <alpine.DEB.2.22.394.2306291230500.3936094@ubuntu-linux-20-04-desktop> <e7af3c85-92ec-7d0f-0e63-3a1e5d65877e@suse.com>
 <alpine.DEB.2.22.394.2307051544340.761183@ubuntu-linux-20-04-desktop> <c2a52a88-a8bf-3e14-f3f5-616177c3d807@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 6 Jul 2023, Jan Beulich wrote:
> On 06.07.2023 00:49, Stefano Stabellini wrote:
> > On Tue, 4 Jul 2023, Jan Beulich wrote:
> >> On 29.06.2023 21:31, Stefano Stabellini wrote:
> >>> On Thu, 29 Jun 2023, Federico Serafini wrote:
> >>>> Change parameter name from 's' to 'state' in function definitions in
> >>>> order to:
> >>>> 1) keep consistency with the parameter names used in the corresponding
> >>>>    declarations;
> >>>> 2) keep consistency with parameter names used within x86_emulate.h;
> >>>> 3) fix violations of MISRA C:2012 Rule 8.3.
> >>>>
> >>>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> >>>
> >>> You could use x86emul: as tag in the title. I'll let Jan choose the tag
> >>> he prefers.
> >>
> >> x86emul: or x86/emul: is what we commonly use. That said, I don't like
> >> this change. The files touched are pretty new, and it was deliberate
> >> that I used s, not state, for the names. This is shorthand much like
> >> (globally) we use v (instead of vcpu) and d (instead of domain).
> > 
> > Are you suggesting that the functions changed in this patch should be
> > adapted in the other direction instead?  Meaning that the declaration is
> > changed to match the definition instead of the opposite?
> > 
> > If so, are you referring to all the functions changed in this patch? Or
> > only some?
> 
> All of the files touched here are ones which were recently introduced,
> and which are deliberately the way they are. This "deliberately" really
> goes as far as declarations and definitions disagreeing in names: For
> the former, what matters are adjacent declarations in the header. For
> the latter what matters is code readability. I'm sorry, I think the
> Misra rule simply gets in the way of the original intentions here (and
> I continue to disagree with there being any confusion from name
> mismatches between declarations and definitions, the more that in the
> case here it would be easy to avoid by simply omitting names in
> declarations, but that is violating yet another rule I don't fully
> agree with either, as voiced when discussing it).
> 
> My preferred course of action here would be to simply drop the patch.
> The least bad adjustment, if one is absolutely necessary, would be to
> change the declarations, but then in a way that all adjacent ones
> remain consistent (which may in turn require some _other_ definitions
> to change). The mid- to long-term goal certainly is to use "s" more
> where "state" may be used right now.


If we drop this patch then we have the problem that Eclair and other
scanners will detect these as violations. Also this source file would
not be consistent with the rest of the codebase causing issues in the
future. Any patch updating this file would trigger new MISRA C
violations in the scanners.

So I don't think we can drop this patch but we could add deviations. I
think your suggestion of "changing the declaration in a way that all
adjacent ones remain consistent" is better, but let me also provide this
option.

Basically, we would keep these declarations/definitions as is, and add
a one-line in-code comment for each deviation. Such as:

/* SAF-2-safe R8.3 */
bool cf_check
x86_insn_is_mem_write(const struct x86_emulate_state *state,
                      const struct x86_emulate_ctxt *ctxt);

Your suggestion of changing the declaration is better in my opinion. Do
you agree?


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 22:15:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 22:15:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560092.875714 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHXFZ-0003pw-59; Thu, 06 Jul 2023 22:14:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560092.875714; Thu, 06 Jul 2023 22:14:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHXFZ-0003pp-1n; Thu, 06 Jul 2023 22:14:57 +0000
Received: by outflank-mailman (input) for mailman id 560092;
 Thu, 06 Jul 2023 22:14:56 +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
 <SRS0=9JNo=CY=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHXFY-0003pj-DN
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 22:14:56 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 88478d98-1c4a-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 00:14:54 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 06C1961208;
 Thu,  6 Jul 2023 22:14:53 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F12FC433C9;
 Thu,  6 Jul 2023 22:14:51 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 88478d98-1c4a-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688681692;
	bh=khrFNB2+FuKCOJkw8BykPudE62eIod6DDUux4sMwCMw=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=N1Jyeft+3FaAIwz+vubqhBymAPsH7vnGr5GzgjtnSvvbF6qkpvCzTeeQW5hm1ApXg
	 BFEqsgIVM1ZHEbdZj7UtKaCPDgu7JG+KP/X3dahYWUno8kV7Y96EDVLGADS4IjzxHc
	 Z7dtcj794UV+M7qf0cJIHVINZz1LgS9Vp3AW765iQtIC58AC175dpw6dIK+d+ikSKi
	 zpUdEWs8EWtqrJqD15KaDNkpziTUuo9vnz6k/IxTeffoXnAaOptAHhWvvL99Y52EKD
	 k3d0H6A+AYFjSIeGvuwdomh4ZbQVgguH6j94MW+2SdDwrpDVMC00sWkkNpINTxo1zU
	 MS7enR6qpXhYQ==
Date: Thu, 6 Jul 2023 15:14:49 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Gianluca Luparini <gianluca.luparini@bugseng.com>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>, 
    Simone Ballarin <simone.ballarin@bugseng.com>
Subject: Re: [XEN PATCH v2 06/13] xen/efi: fix violations of MISRA C:2012
 Rule 7.2
In-Reply-To: <45dad847-7d0e-c2e5-62a2-f640d9879676@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307061514070.761183@ubuntu-linux-20-04-desktop>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com> <9a791b84be74d7ca575eb94e070aae7294d95bbf.1688559115.git.gianluca.luparini@bugseng.com> <alpine.DEB.2.22.394.2307051635170.761183@ubuntu-linux-20-04-desktop>
 <45dad847-7d0e-c2e5-62a2-f640d9879676@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 6 Jul 2023, Jan Beulich wrote:
> On 06.07.2023 01:37, Stefano Stabellini wrote:
> > On Wed, 5 Jul 2023, Simone Ballarin wrote:
> >> --- a/xen/common/efi/boot.c
> >> +++ b/xen/common/efi/boot.c
> >> @@ -34,13 +34,13 @@
> >>  #define EFI_REVISION(major, minor) (((major) << 16) | (minor))
> >>  
> >>  #define SMBIOS3_TABLE_GUID \
> >> -  { 0xf2fd1544, 0x9794, 0x4a2c, {0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94} }
> >> +  { 0xf2fd1544U, 0x9794U, 0x4a2cU, {0x99U, 0x2eU, 0xe5U, 0xbbU, 0xcfU, 0x20U, 0xe3U, 0x94U} }
> >>  #define SHIM_LOCK_PROTOCOL_GUID \
> >> -  { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} }
> >> +  { 0x605dab50U, 0xe046U, 0x4300U, {0xabU, 0xb6U, 0x3dU, 0xd8U, 0x10U, 0xddU, 0x8bU, 0x23U} }
> >>  #define APPLE_PROPERTIES_PROTOCOL_GUID \
> >> -  { 0x91bd12fe, 0xf6c3, 0x44fb, { 0xa5, 0xb7, 0x51, 0x22, 0xab, 0x30, 0x3a, 0xe0} }
> >> +  { 0x91bd12feU, 0xf6c3U, 0x44fbU, { 0xa5U, 0xb7U, 0x51U, 0x22U, 0xabU, 0x30U, 0x3aU, 0xe0U} }
> >>  #define EFI_SYSTEM_RESOURCE_TABLE_GUID    \
> >> -  { 0xb122a263, 0x3661, 0x4f68, {0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80} }
> >> +  { 0xb122a263U, 0x3661U, 0x4f68U, {0x99U, 0x29U, 0x78U, 0xf8U, 0xb0U, 0xd6U, 0x21U, 0x80U} }
> >>  #define EFI_SYSTEM_RESOURCE_TABLE_FIRMWARE_RESOURCE_VERSION 1
> > 
> > To be honest in these case I don't know if this is better or if it is
> > better to add U only to the first numbers (0xf2fd1544U, 0x605dab50U,
> > 0x91bd12feU, 0xb122a263U).
> 
> I'd prefer the latter, but I wonder whether that's in the spirit of Misra.

My understanding is that MISRA only requests U to be added where
actually needed. Everything else is up to us and our desire (or not) for
consistency.


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 22:17:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 22:17:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560096.875723 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHXHt-0004Ps-GS; Thu, 06 Jul 2023 22:17:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560096.875723; Thu, 06 Jul 2023 22:17:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHXHt-0004Pl-Dk; Thu, 06 Jul 2023 22:17:21 +0000
Received: by outflank-mailman (input) for mailman id 560096;
 Thu, 06 Jul 2023 22:17:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=9JNo=CY=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHXHs-0004Pf-IH
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 22:17:20 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id de660dff-1c4a-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 00:17:18 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id A5AC7613F8;
 Thu,  6 Jul 2023 22:17:17 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48475C433C7;
 Thu,  6 Jul 2023 22:17:15 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: de660dff-1c4a-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688681837;
	bh=xKU78W4M7sg7q53K6fQXPkXMe0pKuJ2AIIDXFlFtnwc=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=M79WLVw643TqZ3UtMJVT5MHpK588qSfg9MjjB2F3l/1gWYPym+7oOzuD1b3s/KKvm
	 M0drkBvW1G3ZhsAed68+VslfmeSuiouADpmJJti5n4grikqDsTu+oQ6hyhSwTbHnsR
	 Y/ogFEfGS5IsTCFSY2Y1/EgGZKUYsxIUKBG2xyQ99+bQsV+uuEwF1d4iWyQKCpzCT8
	 ByuHmASAz2iHxhpWKa72FkTLMxRGGGwdX6OeIKieQPp75kvPfYF3papnxmc9udbi1r
	 eow21neUaKANvPg93HRbd1p1CQn0mc6QwKzLr8R3CnUpOqcuQRTXBo4HUgH51K47He
	 7rXjmTpo+JmKg==
Date: Thu, 6 Jul 2023 15:17:13 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Simone Ballarin <simone.ballarin@bugseng.com>, consulting@bugseng.com, 
    Gianluca Luparini <gianluca.luparini@bugseng.com>, 
    Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>, 
    xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v2 07/13] x86/vmx: fix violations of MISRA C:2012
 Rule 7.2
In-Reply-To: <f3b6170a-db0d-ef00-b3f8-7deba17b9fe2@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307061515100.761183@ubuntu-linux-20-04-desktop>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com> <f30ef7c2cda2516d9ef07bb79e5da5513cd90c6c.1688559115.git.gianluca.luparini@bugseng.com> <f3b6170a-db0d-ef00-b3f8-7deba17b9fe2@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 6 Jul 2023, Jan Beulich wrote:
> On 05.07.2023 17:26, Simone Ballarin wrote:
> > --- a/xen/arch/x86/hvm/vmx/vvmx.c
> > +++ b/xen/arch/x86/hvm/vmx/vvmx.c
> > @@ -257,14 +257,14 @@ uint64_t get_vvmcs_virtual(void *vvmcs, uint32_t vmcs_encoding)
> >  
> >      switch ( enc.width ) {
> >      case VVMCS_WIDTH_16:
> > -        res &= 0xffff;
> > +        res &= 0xffffU;
> 
> I don't think the suffix is needed in cases like this one, and ...
> 
> >          break;
> >     case VVMCS_WIDTH_64:
> >          if ( enc.access_type )
> >              res >>= 32;
> >          break;
> >      case VVMCS_WIDTH_32:
> > -        res &= 0xffffffff;
> > +        res &= 0xffffffffU;
> 
> ... while generally I'm suggesting to avoid casts I wonder whether
> casting to uint32_t here wouldn't make things more obviously match
> the purpose. (Same again further down then.)
> 
> > --- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
> > +++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
> > @@ -207,7 +207,7 @@ void vmx_vmcs_reload(struct vcpu *v);
> >  #define CPU_BASED_ACTIVATE_MSR_BITMAP         0x10000000
> >  #define CPU_BASED_MONITOR_EXITING             0x20000000
> >  #define CPU_BASED_PAUSE_EXITING               0x40000000
> > -#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000
> > +#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000U
> 
> Interesting - you don't change adjacent #define-s here, nor ...
> 
> > @@ -257,7 +257,7 @@ extern u32 vmx_vmentry_control;
> >  #define SECONDARY_EXEC_XSAVES                   0x00100000
> >  #define SECONDARY_EXEC_TSC_SCALING              0x02000000
> >  #define SECONDARY_EXEC_BUS_LOCK_DETECTION       0x40000000
> > -#define SECONDARY_EXEC_NOTIFY_VM_EXITING        0x80000000
> > +#define SECONDARY_EXEC_NOTIFY_VM_EXITING        0x80000000U
> 
> ... here. May I ask why that is? (I'm not opposed, but the
> description suggests otherwise.)

Like I wrote in the other email, the requirement is only to add U where
the top bit is set (0x80000000). Adding U to the other constant is
optional and for us to decide.


> > --- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
> > +++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
> > @@ -136,7 +136,7 @@ static inline void pi_clear_sn(struct pi_desc *pi_desc)
> >  /*
> >   * Exit Reasons
> >   */
> > -#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000
> > +#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000U
> >  #define VMX_EXIT_REASONS_BUS_LOCK       (1u << 26)
> 
> Along the lines of the latter, perhaps switch to 1u << 31?
> 
> > @@ -246,15 +246,15 @@ typedef union cr_access_qual {
> >  /*
> >   * Access Rights
> >   */
> > -#define X86_SEG_AR_SEG_TYPE     0xf        /* 3:0, segment type */
> > -#define X86_SEG_AR_DESC_TYPE    (1u << 4)  /* 4, descriptor type */
> > -#define X86_SEG_AR_DPL          0x60       /* 6:5, descriptor privilege level */
> > -#define X86_SEG_AR_SEG_PRESENT  (1u << 7)  /* 7, segment present */
> > -#define X86_SEG_AR_AVL          (1u << 12) /* 12, available for system software */
> > -#define X86_SEG_AR_CS_LM_ACTIVE (1u << 13) /* 13, long mode active (CS only) */
> > -#define X86_SEG_AR_DEF_OP_SIZE  (1u << 14) /* 14, default operation size */
> > -#define X86_SEG_AR_GRANULARITY  (1u << 15) /* 15, granularity */
> > -#define X86_SEG_AR_SEG_UNUSABLE (1u << 16) /* 16, segment unusable */
> > +#define X86_SEG_AR_SEG_TYPE     0xfU       /* 3:0, segment type */
> > +#define X86_SEG_AR_DESC_TYPE    (1U << 4)  /* 4, descriptor type */
> > +#define X86_SEG_AR_DPL          0x60U      /* 6:5, descriptor privilege level */
> > +#define X86_SEG_AR_SEG_PRESENT  (1U << 7)  /* 7, segment present */
> > +#define X86_SEG_AR_AVL          (1U << 12) /* 12, available for system software */
> > +#define X86_SEG_AR_CS_LM_ACTIVE (1U << 13) /* 13, long mode active (CS only) */
> > +#define X86_SEG_AR_DEF_OP_SIZE  (1U << 14) /* 14, default operation size */
> > +#define X86_SEG_AR_GRANULARITY  (1U << 15) /* 15, granularity */
> > +#define X86_SEG_AR_SEG_UNUSABLE (1U << 16) /* 16, segment unusable */
> 
> How is this change related to rule 7.2? There are u suffixes already where
> needed (and 0xf and 0x60 don't strictly need one), so there's no violation
> here afaict. A mere style change to switch from u to U imo doesn't belong
> here (and, as mentioned while discussing the rule, is imo hampering
> readability in cases like these ones).

My understanding is that these are not MISRA violations so could be
dropped


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 22:29:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 22:29:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560100.875734 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHXTR-0005y7-Jv; Thu, 06 Jul 2023 22:29:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560100.875734; Thu, 06 Jul 2023 22:29:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHXTR-0005y0-Fm; Thu, 06 Jul 2023 22:29:17 +0000
Received: by outflank-mailman (input) for mailman id 560100;
 Thu, 06 Jul 2023 22:29:15 +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
 <SRS0=9JNo=CY=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHXTP-0005xq-Rj
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 22:29:15 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 880a42ce-1c4c-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 00:29:13 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id A0AF760BFF;
 Thu,  6 Jul 2023 22:29:11 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id E069FC433C8;
 Thu,  6 Jul 2023 22:29:08 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 880a42ce-1c4c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688682551;
	bh=+uf76anGCBZSivnGkNEWo3vyGnxcFMzEqRtv0xv71oo=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=UsZdPeFJD7UdSR0Q2knfgoVQ0FOUCfwi+zJBX/j4uaJ4ABDQ97jQHRZyhIovRTJfO
	 1lBQrmgVpC5Bf2Aq35V+ZSFj9YM/4ii3HihpEho3F8g3nQe7bOrlcqb6WfH7qO+jQm
	 m7j8kvtyC9CG4ByZnjAJGlRnoF94KK893JnajQHA5Y1lfAWKmMj0fSY6TbWnK27qsj
	 cQ0wzURHLNeYHZEDqHjaJ0D6XmYFhjk0y6+5Rq3BmxlGeahZqFs2nQr781WvJ9q/gz
	 9sIHwMAIg8H2ocsTtZuWgYZlsd4HAvgtr44DOVJ1bvUY53AwppmKPT0MvCG01z32DJ
	 bCiwg1YXzAXow==
Date: Thu, 6 Jul 2023 15:29:07 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    Federico Serafini <federico.serafini@bugseng.com>, consulting@bugseng.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Paul Durrant <paul@xen.org>, 
    Tamas K Lengyel <tamas@tklengyel.com>, 
    Alexandru Isaila <aisaila@bitdefender.com>, 
    Petre Pircalabu <ppircalabu@bitdefender.com>, 
    Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <xenia.ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>, 
    xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v2] x86: make function declarations consistent with
 definitions
In-Reply-To: <2c7d71cb-067d-8dac-3ee4-3af42b2756f3@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307061506560.761183@ubuntu-linux-20-04-desktop>
References: <1b2d5be30c0e4f335e59dce6e7c001cb0805d702.1688465215.git.federico.serafini@bugseng.com> <a16cdb60-1307-636e-1473-e5388e8f79d9@suse.com> <alpine.DEB.2.22.394.2307051604380.761183@ubuntu-linux-20-04-desktop>
 <2c7d71cb-067d-8dac-3ee4-3af42b2756f3@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 6 Jul 2023, Jan Beulich wrote:
> On 06.07.2023 01:22, Stefano Stabellini wrote:
> > On Tue, 4 Jul 2023, Jan Beulich wrote:
> >> On 04.07.2023 12:23, Federico Serafini wrote:
> >>> Change mechanically the parameter names and types of function
> >>> declarations to be consistent with the ones used in the corresponding
> >>> definitions so as to fix violations of MISRA C:2012 Rule 8.3 ("All
> >>> declarations of an object or function shall use the same names and type
> >>> qualifiers") and MISRA C:2012 Rule 8.2 ("Function types shall be in
> >>> prototype form with named parameters").
> >>>
> >>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> >>
> >> On top of my earlier remark (when this was part of a series):
> > 
> > I am not addressing specifically this comment. I am trying to build a
> > common understanding on how to do things so that we can go faster in the
> > future.
> > 
> > In general, as discussed at Xen Summit, in order to successfully merge
> > large numbers of changes in the coming weeks we should try to keep
> > mechanical changes mechanical. Separate non-mechanical changes into
> > different patches.
> > 
> > This patch is large but mechanical. If I understand you correctly, you
> > are asking:
> > 1) to split the patch into smaller patches
> > 2) make a couple of non-mechanical changes described below
> > 
> > 
> > For 1), in my opinion it is not necessary as long as all changes remain
> > mechanical. If some changes are not mechanical they should be split out.
> > So if you are asking non-mechanical changes in 2), then 2) should be
> > split out but everything else could stay in the same patch.
> > 
> > If you'd still like the patch to be split, OK but then you might want to
> > suggest exactly how it should be split because it is not obvious: all
> > changes are similar, local, and mechanical. I for one wouldn't know how
> > you would like this patch to be split.
> 
> So I gave a clear reason and guideline how to split: To reduce the Cc
> list of (because of requiring fewer acks for) individual patches, and
> to separate (possibly) controversial from non-controversial changes.
> This then allows "easy" changes to go in quickly.
> 
> I realize that what may be controversial may not always be obvious,
> but if in doubt this can be addressed in a v2 by simply omitting such
> changes after a respective comment was given (see also below).

So the guideline is to separate by maintainership, e.g.
x86/arm/common/vpci

Also separate out anything controversial and/or that receives feedback
so it is not mechanical/straightforward anymore.


> > For 2), I would encourage you to consider the advantage of keeping the
> > changes as-is in this patch, then send out a patch on top the way you
> > prefer. That is because it costs you more time to describe how you
> > would like these lines to be changed in English and review the full
> > patch a second time, than change them yourself and anyone could ack them
> > (feel free to CC me).
> > 
> > For clarity: I think it is totally fine that you have better suggestions
> > on parameter names. I am only pointing out that providing those
> > suggestions as feedback in an email reply is not a very efficient way to
> > get it done.
> 
> What you suggest results in the same code being touched twice to
> achieve the overall goal (satisfy Misra while at the same time not
> making the code any worse than it already is). I'd like to avoid this
> whenever possible, so my preference would be that if the English
> description isn't clear, then the respective change would best be
> omitted (and left to be addressed separately).

Yes, I think that would work. Basically the process could look like
this:

- contributor sends out a patch with a number of mechanical changes
- reviewer spots a couple of things better done differently
- reviewer replies with "drop this change, I'll do it" no further
  explanation required
- in parallel: contributor sends out v2 without those changes for the
  reviewer to ack
- in parallel: reviewer sends out his favorite version of the changes
  for anyone to ack (assuming he is the maintainer)

This should work well with MISRA C because they are a large number of
changes but each of them very simple, so I really believe it will take
less time for the maintainer to write a patch than try to explain in
English and more back and forth.

I think this is less work for anyone involved. Let's give it a try!


From xen-devel-bounces@lists.xenproject.org Thu Jul 06 22:46:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Jul 2023 22:46:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560104.875744 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHXk4-0008SV-U4; Thu, 06 Jul 2023 22:46:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560104.875744; Thu, 06 Jul 2023 22:46:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHXk4-0008SO-Ra; Thu, 06 Jul 2023 22:46:28 +0000
Received: by outflank-mailman (input) for mailman id 560104;
 Thu, 06 Jul 2023 22:46:28 +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
 <SRS0=9JNo=CY=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHXk4-0008SG-6b
 for xen-devel@lists.xenproject.org; Thu, 06 Jul 2023 22:46:28 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id efa67aa6-1c4e-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 00:46:25 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 7A86260D2E;
 Thu,  6 Jul 2023 22:46:24 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6D52C433C7;
 Thu,  6 Jul 2023 22:46:22 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: efa67aa6-1c4e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688683583;
	bh=Vd2StGY3QLHbG5ajXmHSkNw/fN1H9V5IpfNUtQM6kgU=;
	h=From:To:Cc:Subject:Date:From;
	b=AydGXQcT2Z4I3TisHEC4uplAYU8S8tAiZ5UP2msFzmFTpSreLhZVy4d7c2rE0ZiO6
	 YODxqEG+bqMUtTV+47y02m60avcbl1n2eLD0KH2/b0TUSw3a6Idl221Aq/nH4iKkaY
	 TJCCYYHj1zptHdu2z7gLZ3FM7U45n0f7JJIQDlzuPcDgJekerih0ETmW8fRSDNUeUQ
	 hAgMzVZDTXGw+OZB2ZX6Xx08UCn/Oq0LLpyJceA7GcGWgRC/fcFWDXNNk+GavMGHLf
	 L7RcgxtzjY0dgYFG6EI+jcLwXBrWM68SA0H/U5UGaIwHAAZ6s5F5Gacw0FwPKJ5Gqd
	 Cgj9zu6yXQbNg==
From: Stefano Stabellini <sstabellini@kernel.org>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	julien@xen.org,
	sstabellini@kernel.org,
	george.dunlap@citrix.com,
	bertrand.marquis@arm.com,
	Stefano Stabellini <stefano.stabellini@amd.com>
Subject: [PATCH] docs/misra: add Rule 7.4 and 9.4
Date: Thu,  6 Jul 2023 15:46:19 -0700
Message-Id: <20230706224619.1092613-1-sstabellini@kernel.org>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Stefano Stabellini <stefano.stabellini@amd.com>

Rule 9.4 is non-controversial and we have no violations.

Rule 7.4 is considered a good idea with the caveat that assigning a
string literal to const void is allowed. I added a note to specify it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
 docs/misra/rules.rst | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 622f35410c..986d031786 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -203,6 +203,13 @@ maintainers if you want to suggest a change.
      - The lowercase character l shall not be used in a literal suffix
      -
 
+   * - `Rule 7.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_07_04.c>`_
+     - Required
+     - A string literal shall not be assigned to an object unless the
+       objects type is pointer to const-qualified char
+     - Assigning a string literal to any object with type
+       "pointer to const-qualified void" is allowed
+
    * - `Rule 8.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_08_01.c>`_
      - Required
      - Types shall be explicitly specified
@@ -275,6 +282,11 @@ maintainers if you want to suggest a change.
        braces
      -
 
+   * - `Rule 9.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_09_04.c>`_
+     - Required
+     - An element of an object shall not be initialized more than once
+     -
+
    * - `Rule 12.5 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_12_05.c>`_
      - Mandatory
      - The sizeof operator shall not have an operand which is a function
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 07 01:36:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 01:36:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560119.875757 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHaOi-0007Jq-EU; Fri, 07 Jul 2023 01:36:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560119.875757; Fri, 07 Jul 2023 01:36:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHaOi-0007Ji-7T; Fri, 07 Jul 2023 01:36:36 +0000
Received: by outflank-mailman (input) for mailman id 560119;
 Fri, 07 Jul 2023 01:36:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHaOh-0007JY-LM; Fri, 07 Jul 2023 01:36:35 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHaOh-0001VT-CY; Fri, 07 Jul 2023 01:36:35 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHaOg-0006Lt-Sv; Fri, 07 Jul 2023 01:36:35 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qHaOg-0007Zj-SP; Fri, 07 Jul 2023 01:36:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=PGNvLHuvIQ9ceo0L9KD0AHpWgaxXbsmXhoaogCv7K9k=; b=cbCtiDOZ/Sx6fc5tmKa8wth28a
	zKU1w9NO2c1cuY1JMVfvNRKl/wte1ZUsapcnnRukKfFI+5fx+i+bCc3J/NN4Y+vemF/eh+CsO4tWl
	tkr3nfmSTO9HlzSxPhSJU799y1Xj4rqMsVw20o9Llq5BVZHWYTk/VuOlZDyTT7tNQPSY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181721-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181721: regressions - trouble: broken/fail/pass
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-pair:<job status>:broken:regression
    linux-linus:test-amd64-amd64-pair:host-install/dst_host(7):broken:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pygrub:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:freebsd-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:debian-install:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:debian-install:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:leak-check/basis/dst_host(19):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:windows-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:leak-check/basis(11):fail:allowable
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:guest-localmigrate:fail:allowable
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=c17414a273b81fe4e34e11d69fc30cc8b1431614
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 07 Jul 2023 01:36:34 +0000

flight 181721 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181721/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-pair           <job status>                 broken
 test-amd64-amd64-pair       7 host-install/dst_host(7) broken REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-pygrub       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu 11 leak-check/basis(11)    fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl           8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64  8 xen-boot    fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2 11 leak-check/basis(11)   fail REGR. vs. 180278
 test-amd64-amd64-libvirt      8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64 12 freebsd-install      fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm      12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd 12 debian-hvm-install  fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 19 leak-check/basis/dst_host(19) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 12 windows-install  fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds     11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 16 guest-localmigrate fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                c17414a273b81fe4e34e11d69fc30cc8b1431614
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   81 days
Failing since        180281  2023-04-17 06:24:36 Z   80 days  158 attempts
Testing same since   181721  2023-07-06 12:35:08 Z    0 days    1 attempts

------------------------------------------------------------
3700 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        broken  
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-amd64-amd64-pair broken
broken-step test-amd64-amd64-pair host-install/dst_host(7)

Not pushing.

(No revision log; it would be 611914 lines long.)


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 01:42:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 01:42:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560125.875766 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHaTs-0000LA-V2; Fri, 07 Jul 2023 01:41:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560125.875766; Fri, 07 Jul 2023 01:41:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHaTs-0000L3-S7; Fri, 07 Jul 2023 01:41:56 +0000
Received: by outflank-mailman (input) for mailman id 560125;
 Fri, 07 Jul 2023 01:41:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=40UB=CZ=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1qHaTr-0000Kx-9U
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 01:41:55 +0000
Received: from NAM10-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam10on2060f.outbound.protection.outlook.com
 [2a01:111:f400:7e88::60f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 72453590-1c67-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 03:41:53 +0200 (CEST)
Received: from MW4PR03CA0314.namprd03.prod.outlook.com (2603:10b6:303:dd::19)
 by SJ2PR12MB8690.namprd12.prod.outlook.com (2603:10b6:a03:540::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24; Fri, 7 Jul
 2023 01:41:49 +0000
Received: from CO1NAM11FT052.eop-nam11.prod.protection.outlook.com
 (2603:10b6:303:dd:cafe::16) by MW4PR03CA0314.outlook.office365.com
 (2603:10b6:303:dd::19) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24 via Frontend
 Transport; Fri, 7 Jul 2023 01:41:49 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CO1NAM11FT052.mail.protection.outlook.com (10.13.174.225) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6521.45 via Frontend Transport; Fri, 7 Jul 2023 01:41:48 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Jul
 2023 20:41:47 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Jul
 2023 20:41:47 -0500
Received: from [192.168.137.15] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Thu, 6 Jul 2023 20:41:46 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 72453590-1c67-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=HP937TCENkxaD7CXTedAu74VM0GzWObrFJWFkNesG+t0SiivCRRZ2zeVbycDIHZc7cTKoiobKjfqSFVf/lSBTuulQFTcYSzbgZQGPhhOJ3d6qiBGXlmCoXwjF/UisykbyvgmCZ+22QpxMPRHlYwgTIEZ1LutiTCkIQv2Gk72uU+xPd2hwbEIK7Y1OU0yRVIwEaMV7872wwhzzd0ZB8SDXxrY1Thuw0089yPIhz5fVNp5zlEGFMIkyQ5N9dO7tKkxhXaV1uJjJnq871Sk9yrqDpWjrWwMhQY73aHgGtf31GMcfI1/dqMaJwh35LqRcmWEUpIyY8VWIj0GZh4gILwgsA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=eRVFESTWrB4pDmbWOURdcCtibQWmV9LAbZT42t5XQZ0=;
 b=gp4qy8eKzHzjSV4SFuiTDaqneb2M/etdcGXnBDYFkiCdOGVnwzCd72oLwilpY85ZlNuvRzEL3+iZl5u74i9VDUphv5KzQRtObf+9dgOKIx2pBg262TaoUMSUrdX8jjX7D4l9rygcjAJUbCogoHkgT96/3VzV1tM8IjuNTCpZsmquBrhBGt3aAIHzEYZ6wX/x+L41ZlGftoj2HpZDjJ1FOOHKxtUpmVRFErDxr9j1YPjT31IUyKVBTy1UNaac0+DfIo3rIVGYJJPM2yoV68BBAxR6+WpJrZ5cft/441/CAs7xVf5XL3svPwwLlXfyUEFiR64UGbX+uNtRRvpVjvZKmQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=eRVFESTWrB4pDmbWOURdcCtibQWmV9LAbZT42t5XQZ0=;
 b=AwDPPrkMEVvAx0ihc+p88ZbaaF9hqWXmsCwAo6oaWZXHohBaPWRWPFO5rAETZX/PKJUBddzxcXCa01JqzA6k22VerixLG9ywjjXWWzzz9hFkfJ4hvCxuUGzJGnY00TWvxgWj+4KAgQCbKo+t2GUOzBV4SqzM7pwznfpXY9bQBFE=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <d166447c-46af-79f6-87d9-7e8e922e5218@amd.com>
Date: Thu, 6 Jul 2023 21:41:45 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [PATCH v1 1/2] xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig
 option
Content-Language: en-US
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Rahul Singh <rahul.singh@arm.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	=?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Oleksandr Tyshchenko
	<oleksandr_tyshchenko@epam.com>, Artem Mygaiev <artem_mygaiev@epam.com>,
	Stefano Stabellini <stefano.stabellini@amd.com>
References: <20230620152924.23622-1-stewart.hildebrand@amd.com>
 <a5ef5d8d-5dd1-a535-77ec-458e1559a083@xen.org>
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
In-Reply-To: <a5ef5d8d-5dd1-a535-77ec-458e1559a083@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1NAM11FT052:EE_|SJ2PR12MB8690:EE_
X-MS-Office365-Filtering-Correlation-Id: c1ec5903-0118-4e0e-15ac-08db7e8b547c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	vwnjd2D2fX4KxrNneIVm2+FwrlXF36bzF5c8ri7FQoxmPld6I5L+yTaLnTbmd8cWbjN8QbhvlWowZer5cecLe1Ksw3uPu3saRaeuakwIgjl0Vg5QLNw5y5zvrgXkYziLXRdQf+L7SLJxn+lfRYfiXBHm81J0Fs+4VxWwGcC2TR/1QtEIhqpxbJcDWql5gNrgSTDGGEX3HjAlHJ+9KvBk/mantA1WwZtUjJLpEael1yUn3uIub4m4NKR+NP+vtVE1q6+6lLv3AusEmO+cb4EZiCJ45/tcpJoNHJoUGLs94MqEgHbOhCA2SES/jfiiy+eOKXF7H73+V/XgCmFhbtbIUrvT0qS1Fjk7Q7maYB6gsi763MAy2d6vOU4jFO7+F4caH5QLrZ5P96Bkgz58/pmZnV0QqGj+Nb+d7+EC8SXSJTtTc0cbvwypouwGCvGmqRqZ+3fTMHiPBIR/KLcQROpnuEm3SyVJzP9GF94JI8p5D/UBRM9QzDrR1H6tOjjvSNJogs7U+QW0hwVqsI9ztFnqdCuMaNFeLCq65CYLG2+c23BdADxd7I1AcSQLEdOU3fv1r2Zvp4MwebLxK7PLdlhq2zF9hqVjFVT56z+cjvhtInIrnGWjFRo3R1PJwpL2SNgi7oUvLdLvg+TkYFOrFRWfDGVAkm8XwRs/KK5jaoafsps8vJrc4aMW0GaEjvfDE2g/rWAyVwAdaaYQParvU97gdiRPKaroxB3TVzb0xreFMFCQSAxWMRI+SiWrK8AnA/K7ym8nAcIgpWZhNvOblHXQEbqsHqAX3mw7Cs5qYrneOYwI3+sVFJdA2/5zq91amVjHXqCaH/fAV3VHtt9fzd0G6w==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(136003)(39860400002)(376002)(451199021)(36840700001)(40470700004)(46966006)(356005)(31686004)(478600001)(16576012)(54906003)(110136005)(36860700001)(47076005)(336012)(2616005)(426003)(86362001)(40460700003)(36756003)(31696002)(40480700001)(2906002)(70206006)(82310400005)(53546011)(26005)(186003)(70586007)(966005)(82740400003)(316002)(81166007)(41300700001)(4326008)(8676002)(8936002)(5660300002)(44832011)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 01:41:48.4310
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: c1ec5903-0118-4e0e-15ac-08db7e8b547c
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1NAM11FT052.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8690

On 6/25/23 08:51, Julien Grall wrote:
> Hi,
> 
> On 20/06/2023 16:29, Stewart Hildebrand wrote:
>> From: Rahul Singh <rahul.singh@arm.com>
>>
>> Setting CONFIG_PCI_PASSTHROUGH=y will enable PCI passthrough on ARM, even though
>> the feature is not yet complete in the current upstream codebase. The purpose of
>> this is to make it easier to enable the necessary configs (HAS_PCI, HAS_VPCI) for
>> testing and development of PCI passthrough on ARM.
>>
>> Since PCI passthrough on ARM is still work in progress at this time, make it
>> depend on UNSUPPORTED.
>>
>> Signed-off-by: Rahul Singh <rahul.singh@arm.com>
>> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
>> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
>> ---
>> (cherry picked from commit 9a08f1f7ce28ec619640ba9ce11018bf443e9a0e from the
>> Â  downstream branch [1])
>>
>> Changes from downstream to v1:
>> * depends on ARM_64 (Stefano)
>> * Don't select HAS_VPCI_GUEST_SUPPORT since this config option is not currently
>> Â Â  used in the upstream codebase. This will want to be re-added here once the
>> Â Â  vpci series [2] is merged.
>> * Don't select ARM_SMMU_V3 since this option can already be selected
>> Â Â  independently. While PCI passthrough on ARM depends on an SMMU, it does not
>> Â Â  depend on a particular version or variant of an SMMU.
>> * Don't select HAS_ITS since this option can already be selected independently.
>> Â Â  HAS_ITS may want to be added here once the MSI series [1] is merged.
>> * Don't select LATE_HWDOM since this option is unrelated to PCI passthrough.
>>
>> [1] https://gitlab.com/xen-project/people/bmarquis/xen-arm-poc/-/commits/poc/pci-passthrough
>> [2] https://lists.xenproject.org/archives/html/xen-devel/2023-06/msg00863.html
>> ---
>> Â  xen/arch/arm/Kconfig | 9 +++++++++
>> Â  1 file changed, 9 insertions(+)
>>
>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>> index 61e581b8c2b0..3d22cd26a68c 100644
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -184,6 +184,15 @@ config STATIC_SHM
>> Â Â Â Â Â  help
>> Â Â Â Â Â Â Â  This option enables statically shared memory on a dom0less system.
>>
>> +config PCI_PASSTHROUGH
>> +Â Â Â Â  bool "PCI passthrough on ARM (UNSUPPORTED)" if UNSUPPORTED
> 
> The series is already under an Arm category. So I would drop "ARM" here.

OK

> NIT: Also, I think it should be EXPERT rather than UNSUPPORTED. I view
> the former as in more "experimental" than the latter.

OK

>> +Â Â Â Â  depends on ARM_64
>> +Â Â Â Â  select HAS_PCI
>> +Â Â Â Â  select HAS_VPCI
>> +Â Â Â Â  default n
>> +Â Â Â Â  help
>> +Â Â Â Â Â Â  PCI device passthrough on ARM (UNSUPPORTED)
> 
> Same.

OK


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 01:42:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 01:42:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560129.875776 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHaUE-0000ps-9j; Fri, 07 Jul 2023 01:42:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560129.875776; Fri, 07 Jul 2023 01:42:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHaUE-0000pl-72; Fri, 07 Jul 2023 01:42:18 +0000
Received: by outflank-mailman (input) for mailman id 560129;
 Fri, 07 Jul 2023 01:42:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=40UB=CZ=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1qHaUD-0000Kx-PJ
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 01:42:17 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on20600.outbound.protection.outlook.com
 [2a01:111:f400:7eae::600])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 81209d26-1c67-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 03:42:17 +0200 (CEST)
Received: from DS7PR03CA0025.namprd03.prod.outlook.com (2603:10b6:5:3b8::30)
 by DM6PR12MB4864.namprd12.prod.outlook.com (2603:10b6:5:209::22) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 01:42:13 +0000
Received: from DM6NAM11FT048.eop-nam11.prod.protection.outlook.com
 (2603:10b6:5:3b8:cafe::bf) by DS7PR03CA0025.outlook.office365.com
 (2603:10b6:5:3b8::30) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.25 via Frontend
 Transport; Fri, 7 Jul 2023 01:42:13 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 DM6NAM11FT048.mail.protection.outlook.com (10.13.173.114) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6521.45 via Frontend Transport; Fri, 7 Jul 2023 01:42:13 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Jul
 2023 20:42:12 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Jul
 2023 20:42:12 -0500
Received: from [192.168.137.15] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Thu, 6 Jul 2023 20:42:11 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 81209d26-1c67-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Ki/4+5mO85aM/ady5RLI37ocfaJVMiJ055wULKm6Tjyb6xFLg6g9HksipHOiccN9RL3aDCHbpPb7GiOzToSfoeGeRwTZO8NN2F7Py3rIiJvk00eXymnVXtvqiqAkn+EfHhH1Xo2tebhsKzaP33meNxxJiSezPxN3FpWictWtrAjS4hZLYooF1ahyLFuTDEzcgFF3t+w+3nnG+J0FBG/EWSjT8XeVcABrvYwVanTUOpsExvasBkPD+zC8YlKceBn2wbUDtcaHqfz7OFNf4fGEMRT8T2XeRwpbaXDxlE3991zqRz3tlK3TshVs+BDyjUkIDO6D4nOrvtcXLEk7z3vnBg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=wHRd2B9dspvC+e7lliTr4qvSfi94m+O6Y3GZ03Kdtug=;
 b=fMj0BWEE94rCm0NYAUwMWaqzqspeLoO2aTBYZ/s/D3EwI2R/NEXp96VeUPS1U0uPpWwL1X8XTFXW2zx/AAE7+xIKVEzLTUVXrdqBRIXfyzftV7zm9E8hlvTwBepsOFKJdFinSXcngNBtx5KUs4Cg7bt0qfgusZwh2n6qyDEy4kP4EyekIHsNRdoORy3/iRVW8qNDj8EZ3SaRzIWjoMkxd1bZ56gtuOFBrvQB7xLzfx9oEoDX49mQE+Cpy8rSj86EsshsvnJC8JlCDAudUSOkgi4QYXWefXhEONLIxWoWq3azjln0pb9KxMpiTjDU0C/KlbMnABgsnezy2nlJLach9Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=wHRd2B9dspvC+e7lliTr4qvSfi94m+O6Y3GZ03Kdtug=;
 b=TYBsvP1dEr6LnQmHDbpJcaHSlci+GKnRKaY6VnBWloIXlo57cIx0u40Df/QkB19IoeK8Ih4flvgSlbvRJJFT9Oat0ZgqtY76ZpP9xnw2CSUvRKXj+D0xU/Gt1PJMx7qtdPgpE3fYE8I6cUQhA41Fc+YHyE2o9jZdRUCmxynitX4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <0615eb21-0f05-012a-b8f5-3c94ddcf4eb7@amd.com>
Date: Thu, 6 Jul 2023 21:42:10 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [PATCH v1 2/2] xen/arm: Make has_vpci depend on CONFIG_HAS_VPCI
Content-Language: en-US
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, "Stefano
 Stabellini" <sstabellini@kernel.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	=?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Oleksandr Tyshchenko
	<oleksandr_tyshchenko@epam.com>, Artem Mygaiev <artem_mygaiev@epam.com>,
	Rahul Singh <rahul.singh@arm.com>
References: <20230620152924.23622-1-stewart.hildebrand@amd.com>
 <20230620152924.23622-2-stewart.hildebrand@amd.com>
 <102b31fb-0e47-cead-8555-5758531f13af@xen.org>
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
In-Reply-To: <102b31fb-0e47-cead-8555-5758531f13af@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DM6NAM11FT048:EE_|DM6PR12MB4864:EE_
X-MS-Office365-Filtering-Correlation-Id: 5c37168b-0bea-486b-b856-08db7e8b6343
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	isNoRu7zsyk8CX3t5tV9feSQ3UNEilO94VFzHvVI5vE67ZCrXq8fKuy7Vc9OAaudM/p15O+msso9jGBG93luhGImfhM0Eha2Iu28tDeJRKglRMpr8UvytetR6D2Ow9y2Voyd4H4tR7Q7fHuGDDwTFEI+O66L5UJwPxWxLpQ8lqJnc4Crh6A/5kW1/v+SeYleMQkgJvQpUow+zK22ETEzaJlxsMuSgvXRRtBNtMwGS0SOVi9c2YBtYp82JLJ/zhgUEmMmo7OIuHPhsnKgIgjy5bSFFYWYmIJ4JscqFgVhDvBqZcvuOOVOzEPSGGEdMCyryvG167Lgy87UNc+y8SUtDKECFJYobmqqaUVvOM6c37JIyKci3ZquaBUbxenw6Rg6XmHO6H+rmzPH/d/+ovYxlmY8aR9VX+pB0Hk1R5ABBgwRrGkxQMYn5ct3EzHHCvvqOcwjHjFFelHk/bs6MxRdk5NKwmmgKQRCInnCcGDFqywc70Z5+av1p0VOBdmvBGJ0o5mADhVLHsrxLv56w4Gbsv0AONZaTBX0TCGeNsaQXtToympmlbevWHSsJURZ+I/PnQg6DQHiwkPNvv2sQPJvcc80RGJtXDiEiS4P4qZnp2Hz1jz6MsbObSJH8lJHtoN/ZzossyoRSAIf+aBmhP+Zp4NDVaHddWM5QibJN58h4TsXbrfUjDSzGGHmUluSXCu9N99ayJucI8DPYGBH3UV5B+yrgWYDCPZMDUt0htpuSKr6GOTtLGbBLNTdl6TQ6Y4jg250x6zf+ndEoLv18vu+RjFT71KATWS+D8dpUXj9IYjZFIF7zyQtmJlMuItA/+a+R+f/T3xe2hbouM5q+7ZR6w==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(346002)(396003)(39860400002)(451199021)(40470700004)(46966006)(36840700001)(44832011)(5660300002)(8936002)(8676002)(41300700001)(70586007)(2906002)(7416002)(316002)(4326008)(70206006)(54906003)(110136005)(16576012)(966005)(2616005)(26005)(53546011)(186003)(31686004)(36860700001)(82740400003)(356005)(83380400001)(47076005)(336012)(426003)(478600001)(81166007)(40460700003)(82310400005)(40480700001)(86362001)(36756003)(31696002)(36900700001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 01:42:13.3212
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 5c37168b-0bea-486b-b856-08db7e8b6343
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DM6NAM11FT048.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4864

On 6/25/23 08:45, Julien Grall wrote:
> Hi,
> 
> On 20/06/2023 16:29, Stewart Hildebrand wrote:
>> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
>>
>> VPCI is disabled on ARM. Make it depend on CONFIG_HAS_VPCI to test the PCI
>> passthrough support.
>>
>> While here, remove the comment on the preceding line.
>>
>> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
>> Signed-off-by: Rahul Singh <rahul.singh@arm.com>
>> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
>> ---
>> There are two downstreams [1] [2] that have independently made a version this
>> change, each with different Signed-off-by's. I simply picked one at random for
>> the Author: field, and added both Signed-off-by lines. Please let me know if
>> there are any objections.
>>
>> downstream->v1:
>> * change to IS_ENABLED(CONFIG_HAS_VPCI) instead of hardcoded to true
>> * remove the comment on the preceding line
>>
>> [1] https://gitlab.com/xen-project/people/bmarquis/xen-arm-poc/-/commit/27be1729ce8128dbe37275ce7946b2fbd2e5a382
>> [2] https://github.com/xen-troops/xen/commit/bf12185e6fb2e31db0d8e6ea9ccd8a02abadec17
>> ---
>> Â  xen/arch/arm/include/asm/domain.h | 3 +--
>> Â  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
>> index 99e798ffff68..6e016b00bae1 100644
>> --- a/xen/arch/arm/include/asm/domain.h
>> +++ b/xen/arch/arm/include/asm/domain.h
>> @@ -298,8 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
>>
>> Â  #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag)
>>
>> -/* vPCI is not available on Arm */
>> -#define has_vpci(d)Â Â Â  ({ (void)(d); false; })
>> +#define has_vpci(d)Â Â Â  ({ (void)(d); IS_ENABLED(CONFIG_HAS_VPCI); })
> 
> This will enable vPCI for all the domains. However, in the cover letter,
> you seemed to suggest that guest support is not there. So shouldn't this
> be "is_harware_domain(d)"? Or d->arch.has_vcpi?

Right, I mentioned in the SMMU series discussion [3] that it will only work in dom0 / hardware domain (unless additional vPCI series [4] is applied).

So, making it depend on is_hardware_domain makes sense for now:

#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); })

However, the is_hardware_domain check should be removed when the vPCI series [4] is merged.

[3] https://lists.xenproject.org/archives/html/xen-devel/2023-06/msg01135.html
[4] https://lists.xenproject.org/archives/html/xen-devel/2023-06/msg00863.html


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 01:48:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 01:48:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560135.875787 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHaa8-0001ZL-W3; Fri, 07 Jul 2023 01:48:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560135.875787; Fri, 07 Jul 2023 01:48:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHaa8-0001ZE-TE; Fri, 07 Jul 2023 01:48:24 +0000
Received: by outflank-mailman (input) for mailman id 560135;
 Fri, 07 Jul 2023 01:48:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=40UB=CZ=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1qHaa7-0001Z8-Qz
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 01:48:23 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on2061d.outbound.protection.outlook.com
 [2a01:111:f400:7eab::61d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 59971f21-1c68-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 03:48:22 +0200 (CEST)
Received: from BN0PR04CA0045.namprd04.prod.outlook.com (2603:10b6:408:e8::20)
 by SN7PR12MB6982.namprd12.prod.outlook.com (2603:10b6:806:262::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24; Fri, 7 Jul
 2023 01:48:16 +0000
Received: from BN8NAM11FT042.eop-nam11.prod.protection.outlook.com
 (2603:10b6:408:e8:cafe::11) by BN0PR04CA0045.outlook.office365.com
 (2603:10b6:408:e8::20) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24 via Frontend
 Transport; Fri, 7 Jul 2023 01:48:16 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 BN8NAM11FT042.mail.protection.outlook.com (10.13.177.85) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6521.45 via Frontend Transport; Fri, 7 Jul 2023 01:48:15 +0000
Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Jul
 2023 20:48:15 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com
 (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.6; Thu, 6 Jul 2023
 18:48:15 -0700
Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Thu, 6 Jul 2023 20:48:14 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 59971f21-1c68-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Z2hgPdRw4yvgKiIhfGAMF9oMHRSh+t7OFJVHD+kY8zBz2K3Otc7689ikUptFA6io3R63BS8KMZGxVGYJunVfs7TzpWCadCfAovH3DAuWfPYKVadGqYwvMc4E+itT5ogAPE3yhDBo3s8SQVQDb+klVsJ/5vKg8UdkDoe79dsg5j+7fQdfq/w26chJwUB/PZbqp2Q1cqlEL3RdBpBLhEtBmitk3VxMDQ8KYJys9brMfjnVGKB/A/um+MVfeE5BFRUpYAZzdNJvHE/+SioYfCLLXHLrsLGMB5LdG0jPg0qS6M+Q38aZrH5OanESrrdOKqCn8exJojzw/mL6VsgGOoo4DQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=zgGLXbtA3xfE7ZCQQ92uKBOImtcSm/roRVOADpjeKok=;
 b=WDIODJG25+NFNRYZ1vF+7i2kHTRR85toi8UzudGRJSKRnEBuBUNJdpP4ZSQCMiG0hRJ4I3v1PFMs1AU/cnM9pv70h4HvuvfiKiiQDlJvszEtP/gAQ7itPedeYpb+l0gbhnZBHlEnVUo2iERiIm6IprsmSKQ4hXv701ePdkTvrR6gpd/Tp9KcMRY1muqUXiUDChxojmJO3px+8SMG4IAUWhBwLSElgr2mXYwb+XhDvUaqO/2XYTZQNaoXaUXixe8BCupbj1/vJ0oxJVr2L2EdCmIHmuP+YYtvr3CjdCqawACax1JkG1ILyUg1ykz9OvHqPJCdMLG/Gc/g3rwFihWU1Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=zgGLXbtA3xfE7ZCQQ92uKBOImtcSm/roRVOADpjeKok=;
 b=WwFlBsgfy6kfG9SotmKSYPjoZnafqJ+/K1x5fNCsF0+u3lbYxJfOuZPe2WXKt3598HUWbSGsZhY56Db6Ud5NslphtHXRqjAvCEaY8/J5UTLVo32kLRIIaUH8qt2CbfyZXnVlGO7Zs/KQM6nJrQpSO1ILRjk+qtbquff3xMYfMrc=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Stewart Hildebrand <stewart.hildebrand@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>, "Oleksandr
 Tyshchenko" <oleksandr_tyshchenko@epam.com>, Artem Mygaiev
	<artem_mygaiev@epam.com>
Subject: [PATCH v2 0/3] Kconfig for PCI passthrough on ARM
Date: Thu, 6 Jul 2023 21:47:47 -0400
Message-ID: <20230707014754.51333-1-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN8NAM11FT042:EE_|SN7PR12MB6982:EE_
X-MS-Office365-Filtering-Correlation-Id: 9820241f-df69-4e93-cca6-08db7e8c3b49
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	7ZO6CiqqeFsxATNl5/DKGrvZH8JKG3maQ/OwhjGJh5et6BdJO+g/2Jp1U8sJjXf9RWkE+G1GGHWUNbtSagSmX4jidUYKpEHeOPc4RpK+Y1NK9nFGtZLY2dBahB1jAFf/rfYA1J6MTk+Q0v/n/NEIMmMLOMzhvlvep3gb8/x4hAbXUojKOrxBCrlbI/ZyFoaECwMztlRfD8QbS3Ga2fxo97FXY0Bgr7NFYH6IDzs1lMSJqncJ7cSp8Hw3G3/svDl9KDdTCOQzN3n4JRvWTwo3fLIK3up0pvJ1y+3sifkJHu/A/SfO6cJ6aKm33Hbec8nbFDPsI1Jgaj5B5A70Uc3l6s0YgW03EyAB6biFSaO9QaQOFCzubX8etiGS24Su3oYeWkxIvmYQIomNonl45YvKDpgDVbJ/H7UOx2igSNaocfnYy/R1qvExnyNVJE9gfe2RvSOLVrw4OH7Qls0vVSSoZttC9vpa4t9RMzpKCLD1pLKmPFPPhOUWbhrbjpvnPXeYi4guftob18Ej7r6CzS59tWQyhDf/HVgi4HeajSOIQoUyewUkQ3JfPBY8uXyjtqWwHR0MYgQ3sZFAsESFdbIc1CvAibks5sftUb3KrilSp6f8gWVtfYLBjuyI1LOQ+4vYxV1EYNyG0+9N9J/KnT5JM/1dGdNUjIbL0M6T+vfF0yWLyf5EHDirOTplMz8GgfRw4vpqE/+4vtLBX/cfT7slQOYuW0M/El0CdSch52Isor82t0Jkf+ICvl7NTgOFvbXZd8uymf4ED2bnsogXW/8N4AyM+XlvAWgCE6ZU0O0aaSM=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(39860400002)(136003)(346002)(451199021)(36840700001)(40470700004)(46966006)(83380400001)(1076003)(26005)(186003)(336012)(426003)(6666004)(36860700001)(54906003)(47076005)(81166007)(356005)(82740400003)(478600001)(2616005)(966005)(8936002)(316002)(8676002)(41300700001)(40460700003)(5660300002)(70586007)(44832011)(70206006)(4326008)(6916009)(40480700001)(4744005)(2906002)(86362001)(36756003)(82310400005)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 01:48:15.7801
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 9820241f-df69-4e93-cca6-08db7e8c3b49
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN8NAM11FT042.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6982

There are multiple series in development/review [1], [2] that will benefit from
having a Kconfig option for PCI passthrough on ARM. Hence I have sent this
series independent from any other series.

[1] https://lists.xenproject.org/archives/html/xen-devel/2023-06/msg00863.html
[2] https://lists.xenproject.org/archives/html/xen-devel/2023-06/msg00353.html

Oleksandr Andrushchenko (1):
  xen/arm: make has_vpci depend on CONFIG_HAS_VPCI

Rahul Singh (1):
  xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig option

Stewart Hildebrand (1):
  [FUTURE] xen/arm: enable vPCI for domUs

 xen/arch/arm/Kconfig              | 10 ++++++++++
 xen/arch/arm/include/asm/domain.h |  3 +--
 2 files changed, 11 insertions(+), 2 deletions(-)

-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 07 01:48:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 01:48:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560137.875797 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHaaW-0001z1-83; Fri, 07 Jul 2023 01:48:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560137.875797; Fri, 07 Jul 2023 01:48:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHaaW-0001ys-55; Fri, 07 Jul 2023 01:48:48 +0000
Received: by outflank-mailman (input) for mailman id 560137;
 Fri, 07 Jul 2023 01:48:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=40UB=CZ=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1qHaaV-0001Z8-0G
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 01:48:47 +0000
Received: from NAM12-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam12on2060e.outbound.protection.outlook.com
 [2a01:111:f400:fe5a::60e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 68efa17a-1c68-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 03:48:46 +0200 (CEST)
Received: from DM6PR12CA0008.namprd12.prod.outlook.com (2603:10b6:5:1c0::21)
 by CH2PR12MB4924.namprd12.prod.outlook.com (2603:10b6:610:6b::19) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.25; Fri, 7 Jul
 2023 01:48:41 +0000
Received: from DM6NAM11FT113.eop-nam11.prod.protection.outlook.com
 (2603:10b6:5:1c0:cafe::c2) by DM6PR12CA0008.outlook.office365.com
 (2603:10b6:5:1c0::21) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24 via Frontend
 Transport; Fri, 7 Jul 2023 01:48:41 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 DM6NAM11FT113.mail.protection.outlook.com (10.13.173.5) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6521.45 via Frontend Transport; Fri, 7 Jul 2023 01:48:40 +0000
Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Jul
 2023 20:48:40 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com
 (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.6; Thu, 6 Jul 2023
 18:48:40 -0700
Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Thu, 6 Jul 2023 20:48:38 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 68efa17a-1c68-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=FwrDHSjpgab8eEyIQmL2noTteZUW/k+KJjSIc1Fx80w3/WBDJ2O6Dq5I9b1DEPntgvwAoJFRO1p4oQPQQtdVyPWaqtG52jKAH7fOcvbCjyXNogKaD2uZuMg7Ps6GN0RiQwm6WLx3cTjkcoWinHdSBck06PTGhUTUV9fF74I0sj0+rdZQgRpTAut4LkY14vwK2/EHsCwyIxH2Wpn8LtJbOWkxt/5mA+dx/vNZiwRNhurOH1nXU60aDujhUoba3aiAQl0yV2TaTx5u9QBpscJpwez/arVs/HvaEBRSHLCJIH7X3GnqfFqjpuVSqlSjBgBupl2LjenztgV1rH8IFa4njA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=a0rigZ++MbBuGufh9GmN/eA2TQY7krzeh8M2cqJ+47o=;
 b=jDOqKn0OOUvevYEDsBK2B0xYguJz4VLwFg7GHZi9CQXO4fgwUlnehNXF/oVbHb/M8z67evZI3ZeZNMKwEgy6t08KXveMlbrL+gQaTVEM/IUHG2E7M2hcBMDynCwYjc+XZnuiAtXSG6mygIsil4bJX/Q0EN3LNaxksUv+lBR3sF4NuqknW9z8TLnwQ9dfFV5g6nLPemv89Leir0h69lnhnjDVV6CXuANQGhscEJqCLeQ50ZbmXbzqIR3bY0HhCj9jv1XtKcheJOkYMk4bFO9zurlmVocOR60FHxmZD5FF1EWIxelLGZ/mwDPqHpCRxd8NV5X4nu9dHRU2EohPn5RFrw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=a0rigZ++MbBuGufh9GmN/eA2TQY7krzeh8M2cqJ+47o=;
 b=aaQWF0ydzLDaP2t/YDNkF57HjRTFioGZyj3qiPtJFvvO745Zdr6MfW7ReYPSC43IhcJFC8em283VTMESFK2bG2VjC4BKRReGfC1QAodLSfaNwwohxoHdVijpOOmbTjIVE/+0xJGzBL3ZdYDv9++LP13t4xeDzg630USisfQEVog=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Rahul Singh <rahul.singh@arm.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>, "Oleksandr
 Tyshchenko" <oleksandr_tyshchenko@epam.com>, Artem Mygaiev
	<artem_mygaiev@epam.com>, Stewart Hildebrand <stewart.hildebrand@amd.com>,
	Stefano Stabellini <stefano.stabellini@amd.com>
Subject: [PATCH v2 1/3] xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig option
Date: Thu, 6 Jul 2023 21:47:48 -0400
Message-ID: <20230707014754.51333-2-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230707014754.51333-1-stewart.hildebrand@amd.com>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DM6NAM11FT113:EE_|CH2PR12MB4924:EE_
X-MS-Office365-Filtering-Correlation-Id: 08e8f078-2347-45cd-0310-08db7e8c4a4b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	JWStyl0azENLkvX6rVue17JMZJmqIK8SUWLXigJ0PQuLe1cLlH5hjMnLj64WADpBEQ9S6Hv4K9+6bYmsdwYhL7FkgO2QbxI40g7pOd1+duYRexg9rFlaUTOJwyAKDO9fqgRkADyAM6f6Ew0S2+kFbfpPGB+xIZ1gghu4VmwwM1NShjuW3o9GzbRhDdskipOxdjPcNUvDYAV26enUn04QvCSbIly5gvOzdbTIF2Pxe1eh3AI/Khqb9PwKFNMjtGtatobTe25E0/dMf+UdkMo33OWRvxZ58S6CWKbCbyNf+6Ue5QAGO4gp0Z02U4Hr2+p7r0srZ0IEgjAIKgYl0N9Pr9doK09grL1Am+xfAnoxT0YvY/LISInAXq/e5zaU0pXlTQPHNe2GVeF8EbJKVRHTrEBAUNg5YZ0eOmi4tLfsgXcSq2OqlYwLP+WEfEZv/MlOvUId/yRku0lxGx9QRTOXMREYiROiSXATjuEhJa9+6ZpUrlcxFPXQjoTiXkA9RQOkq1Xm6qgL+pY0rO6TK+mQ3nbf4WMbgIjh5tJzNhWiRGbuJka0PC/lM3e+XpGxrnXNfkYPkIlSKfvXXeeGo1Wry5tx10Y1gJ5fwCAEpPbnVBKFv+vq6N0ymMjFjRFn4BKgIeBC7bFl1GsUJUki1XV1p8qrkhi2LfmM0kUt0l2q1EpH1n2roA/xg5SlcLJfB/8iiQSEl5skHi7aZGkpdjXzu/uT1aqaaTutRONQ1NsT89TZsOmGDIJfCzoSxWyPgdTIftXzK9fk+r39zqGt4FoYInPA6VsyfaP6E37NYE6wNaU=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(376002)(346002)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(6666004)(40460700003)(82740400003)(478600001)(54906003)(81166007)(356005)(5660300002)(8676002)(8936002)(2906002)(36756003)(82310400005)(44832011)(40480700001)(70586007)(4326008)(6916009)(70206006)(316002)(41300700001)(1076003)(26005)(86362001)(36860700001)(426003)(47076005)(186003)(336012)(2616005)(966005)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 01:48:40.9227
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 08e8f078-2347-45cd-0310-08db7e8c4a4b
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DM6NAM11FT113.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4924

From: Rahul Singh <rahul.singh@arm.com>

Setting CONFIG_PCI_PASSTHROUGH=y will enable PCI passthrough on ARM, even though
the feature is not yet complete in the current upstream codebase. The purpose of
this is to make it easier to enable the necessary configs (HAS_PCI, HAS_VPCI) for
testing and development of PCI passthrough on ARM.

Since PCI passthrough on ARM is still work in progress at this time, make it
depend on EXPERT.

Signed-off-by: Rahul Singh <rahul.singh@arm.com>
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
(cherry picked from commit 9a08f1f7ce28ec619640ba9ce11018bf443e9a0e from the
 downstream branch [1])

v1->v2:
* drop "ARM" naming since it is already in an ARM category
* depend on EXPERT instead of UNSUPPORTED

Changes from downstream to v1:
* depends on ARM_64 (Stefano)
* Don't select HAS_VPCI_GUEST_SUPPORT since this config option is not currently
  used in the upstream codebase. This will want to be re-added here once the
  vpci series [2] is merged.
* Don't select ARM_SMMU_V3 since this option can already be selected
  independently. While PCI passthrough on ARM depends on an SMMU, it does not
  depend on a particular version or variant of an SMMU.
* Don't select HAS_ITS since this option can already be selected independently.
  HAS_ITS may want to be added here once the MSI series [1] is merged.
* Don't select LATE_HWDOM since this option is unrelated to PCI passthrough.

[1] https://gitlab.com/xen-project/people/bmarquis/xen-arm-poc/-/commits/poc/pci-passthrough
[2] https://lists.xenproject.org/archives/html/xen-devel/2023-06/msg00863.html
---
 xen/arch/arm/Kconfig | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 439cc94f3344..4e0cc421ad48 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -190,6 +190,15 @@ config STATIC_SHM
 	help
 	  This option enables statically shared memory on a dom0less system.
 
+config PCI_PASSTHROUGH
+	bool "PCI passthrough" if EXPERT
+	depends on ARM_64
+	select HAS_PCI
+	select HAS_VPCI
+	default n
+	help
+	  This option enables PCI device passthrough
+
 endmenu
 
 menu "ARM errata workaround via the alternative framework"
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 07 01:49:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 01:49:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560144.875807 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHab0-0002dU-PA; Fri, 07 Jul 2023 01:49:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560144.875807; Fri, 07 Jul 2023 01:49:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHab0-0002dN-L0; Fri, 07 Jul 2023 01:49:18 +0000
Received: by outflank-mailman (input) for mailman id 560144;
 Fri, 07 Jul 2023 01:49:17 +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
 <SRS0=40UB=CZ=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1qHaaz-0001vF-KV
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 01:49:17 +0000
Received: from NAM02-SN1-obe.outbound.protection.outlook.com
 (mail-sn1nam02on2061d.outbound.protection.outlook.com
 [2a01:111:f400:7ea9::61d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7a515c76-1c68-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 03:49:15 +0200 (CEST)
Received: from DS7PR06CA0042.namprd06.prod.outlook.com (2603:10b6:8:54::23) by
 CH3PR12MB9455.namprd12.prod.outlook.com (2603:10b6:610:1c1::20) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24; Fri, 7 Jul
 2023 01:49:11 +0000
Received: from DM6NAM11FT075.eop-nam11.prod.protection.outlook.com
 (2603:10b6:8:54:cafe::d0) by DS7PR06CA0042.outlook.office365.com
 (2603:10b6:8:54::23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24 via Frontend
 Transport; Fri, 7 Jul 2023 01:49:11 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 DM6NAM11FT075.mail.protection.outlook.com (10.13.173.42) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6521.45 via Frontend Transport; Fri, 7 Jul 2023 01:49:10 +0000
Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Jul
 2023 20:49:09 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com
 (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Jul
 2023 18:49:09 -0700
Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Thu, 6 Jul 2023 20:49:07 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7a515c76-1c68-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=SnOZJns/niXhn3xR2a5/TYZGKfGzSLLfXme5c222SnTBpNxXpq1m/0G6WmOHgoFFZUH/45SQf6s/TMflukRHLvfflhZhxvFvcWiLawzBO3tvSC8UL1yeItmuA1DaCXDZIOZmSOXztP02brvu2CED2Q18GnaYmMf23UXMV3XSoeQoO93Hi/7Jp9F14P8ip0ySWd0R/pGudTDkt7XOPjhFaRN1CZoYSXIADCSTicRzpYgwzGvW6JwhRRg3CiRM3BnwVvcMXZG4tu3XEi9FoOEoBes38u/GySl3vpNjvzlqFfF9nwhMRIKIuyroo7aJ8Um6XVBoD5HufdcRzVeQw+oDHQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=J6Ah2WjT8kbxrdDWolhQZENd36EfFXTl5wpUnTMUypc=;
 b=QhXg62O01DFPZ6ae+JxAyo0+vGapmpDPeAeiPd3k/qU8XWqUocJd8ceNMgEbVFcLrwba7RVV7dNAzQ00nx4gC5eVyJNYRY71eUk9PjtRAJE1MJbywKLxuWVBFB9bkjycVI1utPQgUhTgxKFdY8CGpUsNU0jL7r7mj2NHn9n5er8VIbSP3HZ7HukgquaOJ7JIptCQLQdNSbnItz9HW5Y919vkv6UthnXRnUMwnEyLf+GxG/VYl9kweXWuxxpDIzJvxKhuv2oFn5N5ALN7pCnBXywuqcIBVZ4GXRy63Me3rgi3R68TGxxGZ0nh/J9PucOu98lEn477Q5GcpNeX4wxk2g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=J6Ah2WjT8kbxrdDWolhQZENd36EfFXTl5wpUnTMUypc=;
 b=cAEb0gNgU+74FUZ8FKXrA9GOiOlyesRWj4L9ktZbwXI7PHE/oFUY7LUk7WyuD2Ia/BfcF4fJfcyE70CH3V55Ytebl6fNyY8/KaVaQ/0O1dAp2P9cgKOaDPC0zS6KfvUicgEFtSQKnhb4I6fFydog+lFYHhSmzg6G2/3UQ6zPM74=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, "Stefano
 Stabellini" <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand
 Marquis <bertrand.marquis@arm.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Artem Mygaiev <artem_mygaiev@epam.com>, Rahul Singh <rahul.singh@arm.com>,
	Stewart Hildebrand <stewart.hildebrand@amd.com>
Subject: [PATCH v2 2/3] xen/arm: make has_vpci depend on CONFIG_HAS_VPCI
Date: Thu, 6 Jul 2023 21:47:49 -0400
Message-ID: <20230707014754.51333-3-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230707014754.51333-1-stewart.hildebrand@amd.com>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DM6NAM11FT075:EE_|CH3PR12MB9455:EE_
X-MS-Office365-Filtering-Correlation-Id: 934a342b-161a-41a8-5942-08db7e8c5bd3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	rkNcz9P1w3SriLHGQuEYLTzPIDJle+OS9sVSTpzXjRvH+QdnUEjl/Iwf0n6TIZfU2s2qmdE12G8nORjAkfvxebvu2ZBwB7eI1JdsE99SaJMQu3DXjGS9imFk3GsERnIm06FYtGFO2nlHosAnp7IbPC+KaOSBw7tk4sGptmJyler/i5yi5JLVmf+CNnyMLIdREx2diQw7bJGrgH/rko49hQezqaBO/IXFbP2vni1cWjADGjXlNf5PqYud0mx50mOWPQZ2bw6XeC2hZi5Cjx1wne6Ts39WPS6tR1hMhWUfXmyfg1G5QczXFy8flGePfodCdY9f/sNPiCS6CgANsBglUhALyN0L9gecysbrCz9Ub9Q+mLaKrsfnFMxswsa/SPyoAHAa1b78fx6/uKvfj+FGD2iK9uDBU86Nre5VcNzIb6np5/Pi3oP7qyHeBkqCU0MD0RH1YOC/QXaiEkqSM9Az/k4BO9U5pjwttKNxzTgBikpJeMnYsPi4PR2iETlj+OAI/CJgK8/7ozFAmn2JXKb3VGlJLJB8V2AI4doCS+ca4/Tdq2ueninUSwqI6Vogc5HrBxWjBwI9F+htbGR8N6owDWldeFG3V+DMdEP2SB9MEYKyEUKv6ZR8kgmG9r3A1NarOM3L+1Fxcmwjib29sidR1CT0tOW6a0daRMZDu7aVoP6BUDlCBoJmifyBH9znVhQDNWr+fyLF3U8hlVgVicoDa8ct5/NhTeTDVXoISf6Ao8LO/4EZoDBQG/pumgJn5xfjSDX/bTKUwz2bKNLeiUfHRbL7iY3en0gyJuqEBv0r8nQ=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(396003)(376002)(346002)(451199021)(46966006)(40470700004)(36840700001)(40480700001)(966005)(356005)(54906003)(70206006)(81166007)(6666004)(70586007)(36756003)(40460700003)(7416002)(44832011)(5660300002)(86362001)(8676002)(2906002)(82310400005)(316002)(8936002)(6916009)(4326008)(41300700001)(82740400003)(478600001)(36860700001)(83380400001)(426003)(47076005)(2616005)(336012)(186003)(26005)(1076003)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 01:49:10.3374
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 934a342b-161a-41a8-5942-08db7e8c5bd3
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DM6NAM11FT075.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9455

From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

VPCI is disabled on ARM. Make it depend on CONFIG_HAS_VPCI to test the PCI
passthrough support. Also make it depend on is_hardware_domain for now. The
is_hardware_domain check should be removed when vPCI is upstreamed.

While here, remove the comment on the preceding line.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Rahul Singh <rahul.singh@arm.com>
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
There are two downstreams [1] [2] that have independently made a version this
change, each with different Signed-off-by's. I simply picked one at random for
the Author: field, and added both Signed-off-by lines. Please let me know if
there are any objections.

v1->v2:
* add is_hardware_domain check. This will need to be removed after the vPCI
  series [3] is merged.

downstream->v1:
* change to IS_ENABLED(CONFIG_HAS_VPCI) instead of hardcoded to true
* remove the comment on the preceding line

[1] https://gitlab.com/xen-project/people/bmarquis/xen-arm-poc/-/commit/27be1729ce8128dbe37275ce7946b2fbd2e5a382
[2] https://github.com/xen-troops/xen/commit/bf12185e6fb2e31db0d8e6ea9ccd8a02abadec17
[3] https://lists.xenproject.org/archives/html/xen-devel/2023-06/msg00863.html
---
 xen/arch/arm/include/asm/domain.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
index 99e798ffff68..1a13965a26b8 100644
--- a/xen/arch/arm/include/asm/domain.h
+++ b/xen/arch/arm/include/asm/domain.h
@@ -298,8 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
 
 #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag)
 
-/* vPCI is not available on Arm */
-#define has_vpci(d)    ({ (void)(d); false; })
+#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); })
 
 struct arch_vcpu_io {
     struct instr_details dabt_instr; /* when the instruction is decoded */
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 07 01:49:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 01:49:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560148.875817 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHabV-0003CP-2K; Fri, 07 Jul 2023 01:49:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560148.875817; Fri, 07 Jul 2023 01:49:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHabU-0003CI-VF; Fri, 07 Jul 2023 01:49:48 +0000
Received: by outflank-mailman (input) for mailman id 560148;
 Fri, 07 Jul 2023 01:49:48 +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
 <SRS0=40UB=CZ=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1qHabU-0003C2-9k
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 01:49:48 +0000
Received: from NAM10-BN7-obe.outbound.protection.outlook.com
 (mail-bn7nam10on2060b.outbound.protection.outlook.com
 [2a01:111:f400:7e8a::60b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8bb89ff7-1c68-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 03:49:45 +0200 (CEST)
Received: from DM6PR08CA0045.namprd08.prod.outlook.com (2603:10b6:5:1e0::19)
 by PH7PR12MB6858.namprd12.prod.outlook.com (2603:10b6:510:1b4::20) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 01:49:42 +0000
Received: from DM6NAM11FT082.eop-nam11.prod.protection.outlook.com
 (2603:10b6:5:1e0:cafe::e2) by DM6PR08CA0045.outlook.office365.com
 (2603:10b6:5:1e0::19) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Fri, 7 Jul 2023 01:49:41 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 DM6NAM11FT082.mail.protection.outlook.com (10.13.173.107) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6521.45 via Frontend Transport; Fri, 7 Jul 2023 01:49:41 +0000
Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Jul
 2023 20:49:41 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com
 (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Jul
 2023 18:49:36 -0700
Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Thu, 6 Jul 2023 20:49:35 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8bb89ff7-1c68-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=B0o+3lXWQeqZudrKIF62XdbSLShHKLVTmY2T+HZ5DItGyIPq6tniV5ISp1ThQrde3Bwkpfbbj/XhXUd2O6rK3ujP+lEAm0yV6gPN3wh2LtokMUMOwtvq7I6Un1R4F9SWqQbJg9LW4Wc/3nhOOtSE5Sw4lp7PgLQ7xkifa5x80DDTnslp8VXZX3/qoySsBoE+ktVRP/TNCgf0NDMoFE5iCSZWgRcHhJOfZVhXYPb9okuwgB/n54DkYOuV9dCyp+xUvp1fqdGp7u1Pl+Nk2WcBKf47wp2EqGT5s0UHwl4rtjNk6diX5zsYVvnLCszJrJfcRVKl0foaS6+ycM1/hS1gFg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=jPCXqi/U65BB6VinNnJwgiyIk9hy9wUXqeK8zlTJAwY=;
 b=ax7iQYtkA+iEPNvKlrx+8RTlGPxMM4YF2RM8uz0FK238SmtAM1UorcJZVqBamTc4w26mP5Mg/vbl4mC4Whp+X+sH2f61vbF3xFrp+nVnLb5IO6+m1dftRVZRLssroWZaGkyEQQpQcDhs5Di7TWB2mmVixDP7eccxMFn2IkMQVnuFZobi+PS8cPBNNe1zpl339sDgC1cSGfWUN472WTFAnE//WysBESzCHmNC19D6IWvQakfzplJS6zNJ9X5K3FnqBXew3b35ztRkATQgvhaUQEfejkdzzPgG4ca9U5WGMbYNVVU+NpZ2i1xNzO7lWHSqXnVltghu2nSCnuLVE0qVFg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=jPCXqi/U65BB6VinNnJwgiyIk9hy9wUXqeK8zlTJAwY=;
 b=UsKuO10iXzNIGr31hH0Q7/o5L542UE4hGK50yN2sNewqHIHzD5JarJAQNjoZO9APUDBu4DTcYDAL41kT81BNSbDk8rA1QTn6WA6GiPntnE4eUsJdyjuol8DiP/zA6SUP7K9n4KlxW6WDBvVZBPvXX3ZmDmUb5iPJFo94zlEkBmk=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Stewart Hildebrand <stewart.hildebrand@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>, "Oleksandr
 Tyshchenko" <oleksandr_tyshchenko@epam.com>, Artem Mygaiev
	<artem_mygaiev@epam.com>
Subject: [PATCH v2 3/3] [FUTURE] xen/arm: enable vPCI for domUs
Date: Thu, 6 Jul 2023 21:47:50 -0400
Message-ID: <20230707014754.51333-4-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230707014754.51333-1-stewart.hildebrand@amd.com>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DM6NAM11FT082:EE_|PH7PR12MB6858:EE_
X-MS-Office365-Filtering-Correlation-Id: 3a0c01cc-2de7-442e-2f3d-08db7e8c6e84
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	fa3m/Y+/11O8fiTmtpMmA6moCdDqlq8uf7vfPz+lWLACpLr/ODwmXlX2kDTapRTTrPIJ8EO6Hn76IUWQym+g8nQ6juy0Awk+L96gGPGmwr7SMGmNf18nB9Wz2l/z6npc+Sf2HwGWt29q3OD3ZcdjTh9pjUXDFwTTI8dQjKaHklxRo2Td8J1Kda9/35qRGVIbtRcT2i2ljXCL5qQsVDPMR/5d5H2iB14eIc/O4BNDJ4jSC089hqlDzTjgU7cv0C9CkdKIc9L24W9Ixcjep+acvpOLmr1Nx6M7INMFNyCMsCJXKUf/9FADgjntyHhiBm6ERj46nOCIFtzk3HnjGmwKKzvNHHCyHh74sPwMfha0TCRoKaUp6MGzAbDIqkFe9V+qNEdrZ46vA1z2giDWZbioOgIOPyFVzDPtujZVqBosDQTDh14MkgUVhGq6/2DNZRcUEFxtAhV9xGuYs4ZZSVtiNmsavb84Mqzq4Dhj+cbItQTqH/6Vy7Irnt/vOQ6Puuo0H1KneyVvWwpLz6TxBgg94cJh1q5XfUwt12noi7kINswDZdD9DaCUa3diYGll7z1AjfeL3Jjfqlg3uJSz3Hnqnyus6wmv+h/xd4xDXBJfcfDZkFOospelipOBCqUgd7jQdFwdG1qKMxa3rFE3aHDvCrK4Lk/0KfTtmTzdU0tkzZF735V4STczqitUKjb3TKVBVH3qwNOE9rIH2+kIj6f0uYzmaEFDoXKM4HOGsN9WL/ueigHeZSqJqF1MLlTJG3kqgE6dSVk/Z7KOwjk52iipBw==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(136003)(396003)(39860400002)(451199021)(46966006)(36840700001)(40470700004)(5660300002)(2616005)(8676002)(40480700001)(86362001)(36860700001)(82740400003)(426003)(47076005)(83380400001)(40460700003)(8936002)(81166007)(54906003)(41300700001)(36756003)(316002)(6916009)(4326008)(70586007)(336012)(186003)(1076003)(6666004)(966005)(26005)(356005)(478600001)(2906002)(82310400005)(70206006)(44832011)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 01:49:41.6953
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 3a0c01cc-2de7-442e-2f3d-08db7e8c6e84
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DM6NAM11FT082.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6858

Remove is_hardware_domain check in has_vpci, and select HAS_VPCI_GUEST_SUPPORT
in Kconfig.

[1] https://lists.xenproject.org/archives/html/xen-devel/2023-06/msg00863.html

Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
As the tag implies, this patch is not intended to be merged (yet).

Note that CONFIG_HAS_VPCI_GUEST_SUPPORT is not currently used in the upstream
code base. It will be used by the vPCI series [1]. This patch is intended to be
merged as part of the vPCI series.

v1->v2:
* new patch
---
 xen/arch/arm/Kconfig              | 1 +
 xen/arch/arm/include/asm/domain.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 4e0cc421ad48..75dfa2f5a82d 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -195,6 +195,7 @@ config PCI_PASSTHROUGH
 	depends on ARM_64
 	select HAS_PCI
 	select HAS_VPCI
+	select HAS_VPCI_GUEST_SUPPORT
 	default n
 	help
 	  This option enables PCI device passthrough
diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
index 1a13965a26b8..6e016b00bae1 100644
--- a/xen/arch/arm/include/asm/domain.h
+++ b/xen/arch/arm/include/asm/domain.h
@@ -298,7 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
 
 #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag)
 
-#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); })
+#define has_vpci(d)    ({ (void)(d); IS_ENABLED(CONFIG_HAS_VPCI); })
 
 struct arch_vcpu_io {
     struct instr_details dabt_instr; /* when the instruction is decoded */
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 07 02:03:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 02:03:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560153.875827 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHaoM-00062I-6Z; Fri, 07 Jul 2023 02:03:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560153.875827; Fri, 07 Jul 2023 02:03:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHaoM-00062B-3t; Fri, 07 Jul 2023 02:03:06 +0000
Received: by outflank-mailman (input) for mailman id 560153;
 Fri, 07 Jul 2023 02:03:05 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=OIXD=CZ=epam.com=prvs=155258fc3f=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qHaoK-000625-Mx
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 02:03:04 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 670b9bb6-1c6a-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 04:03:03 +0200 (CEST)
Received: from pps.filterd (m0174676.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 366H7r22008884; Fri, 7 Jul 2023 02:02:58 GMT
Received: from eur02-vi1-obe.outbound.protection.outlook.com
 (mail-vi1eur02lp2044.outbound.protection.outlook.com [104.47.11.44])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rnum72yac-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Fri, 07 Jul 2023 02:02:57 +0000
Received: from AM0PR03MB3699.eurprd03.prod.outlook.com (2603:10a6:208:4b::31)
 by AS2PR03MB9646.eurprd03.prod.outlook.com (2603:10a6:20b:5ea::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 02:02:52 +0000
Received: from AM0PR03MB3699.eurprd03.prod.outlook.com
 ([fe80::3afc:a0ce:1e52:54]) by AM0PR03MB3699.eurprd03.prod.outlook.com
 ([fe80::3afc:a0ce:1e52:54%7]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 02:02:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 670b9bb6-1c6a-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=YcfhBYcHBvv5GKr+xtACBK6RnonRoM/cYy2inSoMV9vFgmiHhB3ub1ekkJeR6kAXaj+I0jIS9Kf8QSyhHlzfLBsIKbUSSplwwlIEZbwqH6xFo8HBUsuV7GcMH5R3TdA86ls98JkLdo9xTAHi0nuMIOR6KifC5wmlffML3oJAsyIeVC3lmyaMOnhIo4kZTHFG0e0iUGvc69QUgdCiItkd/Gk5sbbKRYEiGvfdpV3FrMWVPbEXwnNXNPQJMnJb5gGUfGkI1C2CIfV72EMVFjWxLgtBDluiO4XhPDCDmn1n8Ida5qNEuQ7aSt+2/VkxqIeXygxLCq0LCAjkFdohqOIiMA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=21W7mRXhPafIDi9LiL+vr2WALcOTea1NN1dG8a7Xoq4=;
 b=jM4rWILkYObEiVEqsv366+ye/Rn1rFy6RIL9OUGtKlZn2l43bN34pAzRje2pw4tQW19P7QpQKhhEtRhrzAtOjKrYjureHH2/6gtDaNjjuJD0kNPxtQ2ubt1RG4cbytnRLQLqaFmSWyTCxN1W7qLQs0sgKLRlfGuk90/SKVwEIKTn49z+SyMixPGmX+LKN4AyHFOUp4lfXF72kwLkuOImCGLiQ3TPvlcA/x/MjRYhvjtDuZcxn3sI9rlWv4Pr19ENs5SE8zQQJRKHD1JS7I5hh+RriCCoSMOJpkGcMQpqALlEF1VGfMMzmq1S6Bv5O7E/ETt36UT7AXPl24YSGF2O2g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=21W7mRXhPafIDi9LiL+vr2WALcOTea1NN1dG8a7Xoq4=;
 b=eHvrS0F2iU+G1F7YV83g1cF1+uSHP5weYKBOz98+yCC25PSirKAU0WDl0WPC9zj908q1j8bGDJFEyEoRCZYox7KfZZp7Ew2IrKaeUE3/gqSvBSLag/yiilsm4z94TGbbqr6Z+r2DkfKl8N4UucXXUo46UrD3UQoZ84eRtYOGE7KBbsy44Wg6dtAH+234knTOXiWvqn4/ANAsS1z+Ozq1HXSntDpwf/0lhyqWSfrQYWgjdKM3cjl+zJvEyNx+AHznzGSQjKCsmpTMf7VxQvlUk4ZAEKNGkZbwf4Li5nfHeNFfGTmMhKKe+1myYNlAQnsjbqR4C2yPSwQ267yugDzTmQ==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: Jan Beulich <jbeulich@suse.com>
CC: =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>,
        "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
        Oleksandr
 Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
        Andrew Cooper
	<andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
        George Dunlap
	<george.dunlap@citrix.com>,
        Julien Grall <julien@xen.org>,
        Stefano Stabellini
	<sstabellini@kernel.org>,
        Paul Durrant <paul@xen.org>
Subject: Re: [PATCH v7 01/12] vpci: introduce per-domain lock to protect vpci
 structure
Thread-Topic: [PATCH v7 01/12] vpci: introduce per-domain lock to protect vpci
 structure
Thread-Index: 
 AQHZneJZdDE+HOoSO0y6VB9l0x1hDq+No9OAgAgqUACAALl2AIAAzUWAgADPAYCAEhJlgIAArbcAgAAeJQCAAAPogIACp8SA
Date: Fri, 7 Jul 2023 02:02:52 +0000
Message-ID: <87mt08mqb9.fsf@epam.com>
References: <20230613103159.524763-1-volodymyr_babchuk@epam.com>
 <20230613103159.524763-2-volodymyr_babchuk@epam.com>
 <ZIyOCan//39V3bdy@MacBook-Air-de-Roger.local> <87352kpj04.fsf@epam.com>
 <ZJQDGOrP1I3hR5Jj@MacBook-Air-de-Roger.local> <87ilbfnqmo.fsf@epam.com>
 <ZJVc77SwvyKOEdnJ@MacBook-Air-de-Roger.local> <87wmzfmltd.fsf@epam.com>
 <ab79bcb6-6fc8-c68f-65bf-16ce7316c3ae@suse.com>
 <ZKUw2MPBhOSgG-Eg@MacBook-Air-de-Roger.local>
 <a964cffa-fb42-b0e0-e60a-1044d8794193@suse.com>
In-Reply-To: <a964cffa-fb42-b0e0-e60a-1044d8794193@suse.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: mu4e 1.8.9; emacs 28.2
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM0PR03MB3699:EE_|AS2PR03MB9646:EE_
x-ms-office365-filtering-correlation-id: 39c5f112-9ea1-43b6-41e5-08db7e8e45c1
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 sTl+f+6FdSpLEVev5EbVJdbAxZccxvaB45onGY1MSf4b7pWPazgg3nAZAPwEa2pmIA56LiQcF5ccyxKElePwW9K4zMBagqEGEF46idZdd/72iNp+ic8ncWq472wh+pH/I016TvWaBf1qyTphFQHb5vFBkmtRh5/jQx2dRb9vz1CF+q0g4gEVbg2Jxfe3ZPgsgksBB8mk55RQeUMl87Jy3zlfoUM75VJBWuRNXuTvrzbmDSXWYnLWLLICnY7wVO+i7MZHSnrC8t6am26QUsJBM8Sdb1zmWmFlm62viatlU3am+d5vacnHS2tgWQgbGJWjASeJJtNUnVyzmxWFL2jHdGH6jzoJKbujCHk8FHCFo9HMkrG3zPeG7ahAkeVqrlJOXZWOnq/NLZZjRiqbq3TLrmpR2HKxQngaO/2twqHhMEhrxukMz7aIwH55xkc19cZNa/dS6PSQKwttZjij0OPY3stYs8iq+6UeDXUGKNXMx7PXYaP5J3L4ULkrOFbhOfcWbgR52KFZmbkI+Rt2mE7Ovpo5xcOklfyseF4gVppsS+/gi5cS4JC/9MTsWql2IlwBW0etaF2TfpNeFALDQh6p4mGp3beVqi0P71n7/hfj42a8DBFCWNJUw6ppzEO5ZHH0
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR03MB3699.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(136003)(346002)(39860400002)(366004)(451199021)(122000001)(38100700002)(6916009)(2616005)(64756008)(66446008)(66476007)(66946007)(316002)(76116006)(91956017)(5660300002)(8676002)(4326008)(66556008)(86362001)(6486002)(41300700001)(38070700005)(36756003)(2906002)(186003)(8936002)(83380400001)(53546011)(54906003)(55236004)(6506007)(26005)(6512007)(71200400001)(478600001);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?ajhLU3dmNzgxSWtSYk1GeWZQN3kydGhpZXZkR3QzRkFsaDFlYmxRRFVqZkpP?=
 =?utf-8?B?SWNock42dVEyV2ZwUFNBcFhjU3NUKzJnQi96bWVvbkd5bkZKRnRJZVJJMUg5?=
 =?utf-8?B?N1JhMzRtSXFkTkhQaEZ1R2UwWE40U0ZXa3FUREJMQkFlL0FIZmdxajFNd3BJ?=
 =?utf-8?B?c0s0M1VhYS9LTkRZSEMwamc2QW9ZWWFOR0RSRTZ4aEwyZGx5bCtYR1M1TE9F?=
 =?utf-8?B?VWJrK1pzVVk3Z055WUExdmF0aWxiOGhZV0c2SXBFdVNwcE9qcE9YeW5QM1Vy?=
 =?utf-8?B?SFVvaE0rZXJyVG9qTU5JUmh5cko2RXlwUGcvVGtvZFh5ZTRIT2NaQzhGWFlN?=
 =?utf-8?B?dVh6SW1YVFhWWkxia2ZFeE96dTl1THNkQllhRGQxN1JUVzcrTkZtb2N3Q3RC?=
 =?utf-8?B?a3UzYk5vMEEvTjZpemdrR0daRUQ1ME1CQW9DMVk5TFMxbnEwaDZ2dVhmTG1V?=
 =?utf-8?B?SnA1SmxMWXlNN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.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AM0PR03MB3699.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 39c5f112-9ea1-43b6-41e5-08db7e8e45c1
X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jul 2023 02:02:52.3788
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: t5y6RRNgFbaBdxm6GptWn/zoldFERXaYXIYd4hmGVS0xtHj18c68k96zMwiRuS5GESYLvwp5bOpdHCompgxwGoyXOXD4c7/7IRi5Fj5bdxQ=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9646
X-Proofpoint-GUID: 2YZZPvosN1yKmQ6B5L7DHYtVjDJuzheU
X-Proofpoint-ORIG-GUID: 2YZZPvosN1yKmQ6B5L7DHYtVjDJuzheU
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-06_17,2023-07-06_02,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0
 priorityscore=1501 phishscore=0 spamscore=0 impostorscore=0 clxscore=1015
 mlxlogscore=999 adultscore=0 mlxscore=0 bulkscore=0 suspectscore=0
 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2305260000 definitions=main-2307070016

DQpIaSBKYW4sDQoNCkphbiBCZXVsaWNoIDxqYmV1bGljaEBzdXNlLmNvbT4gd3JpdGVzOg0KDQo+
IE9uIDA1LjA3LjIwMjMgMTA6NTksIFJvZ2VyIFBhdSBNb25uw6kgd3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YXNz
aWduX2RldmljZV9vd25lcnNoaXBbMjc3M10gaWYgKCAhaGFzX2FyY2hfcGRldnModGFyZ2V0KSAp
DQpyZWFzc2lnbl9kZXZpY2Vfb3duZXJzaGlwWzI4MDddIGlmICggIWhhc19hcmNoX3BkZXZzKHRh
cmdldCkgKQ0KcmVhc3NpZ25fZGV2aWNlX293bmVyc2hpcFsyODI1XSBpZiAoICFoYXNfYXJjaF9w
ZGV2cyhzb3VyY2UpICkNCg0KDQpoYXNfYXJjaF9wZGV2cygpIGJvdGhlcnMgbWUgbW9zdCwgYWN0
dWFsbHksIGJlY2F1c2UgaXQgaXMgbm90IGFsd2F5cw0Kb2J2aW91cyBob3cgdG8gYWRkIGxvY2tp
bmcgZm9yIHRoZSBjYWxsZXJzLiBJIGFtIHBsYW5uaW5nIHRvIHJld29yayBpdA0KaW4gdGhlIGZv
bGxvd2luZyB3YXk6DQoNCiNkZWZpbmUgaGFzX2FyY2hfcGRldnNfdW5sb2NrZWQoZCkgKCFsaXN0
X2VtcHR5KCYoZCktPnBkZXZfbGlzdCkpDQoNCnN0YXRpYyBpbmxpbmUgYm9vbCBoYXNfYXJjaF9w
ZGV2cyhzdHJ1Y3QgZG9tYWluICpkKQ0Kew0KICAgIGJvb2wgcmV0Ow0KDQogICAgcmVhZF9sb2Nr
KCZkLT5wY2lfbG9jayk7DQogICAgcmV0ID0gaGFzX2FyY2hfcGRldnNfdW5sb2NrZWQoZCk7DQog
ICAgcmVhZF91bmxvY2soJmQtPnBjaV9sb2NrKTsNCg0KICAgIHJldHVybiByZXQ7DQp9DQoNCkFu
ZCB0aGVuIHVzZSBhcHByb3ByaWF0ZSBtYWNyby9mdW5jdGlvbiBkZXBlbmRpbmcgb24gY2lyY3Vt
c3RhbmNlcy4NCg0KDQotLSANCldCUiwgVm9sb2R5bXly


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 02:18:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 02:18:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560159.875837 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHb2h-0007eO-Iw; Fri, 07 Jul 2023 02:17:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560159.875837; Fri, 07 Jul 2023 02:17:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHb2h-0007eH-Fg; Fri, 07 Jul 2023 02:17:55 +0000
Received: by outflank-mailman (input) for mailman id 560159;
 Fri, 07 Jul 2023 02:17:53 +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
 <SRS0=40UB=CZ=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1qHb2f-0007eB-OU
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 02:17:53 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on2060d.outbound.protection.outlook.com
 [2a01:111:f400:fe5b::60d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7895b532-1c6c-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 04:17:50 +0200 (CEST)
Received: from MW3PR05CA0005.namprd05.prod.outlook.com (2603:10b6:303:2b::10)
 by IA0PR12MB7749.namprd12.prod.outlook.com (2603:10b6:208:432::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24; Fri, 7 Jul
 2023 02:17:45 +0000
Received: from CO1NAM11FT028.eop-nam11.prod.protection.outlook.com
 (2603:10b6:303:2b:cafe::34) by MW3PR05CA0005.outlook.office365.com
 (2603:10b6:303:2b::10) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.12 via Frontend
 Transport; Fri, 7 Jul 2023 02:17:44 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1NAM11FT028.mail.protection.outlook.com (10.13.175.214) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6521.45 via Frontend Transport; Fri, 7 Jul 2023 02:17:44 +0000
Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Jul
 2023 21:17:39 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB07.amd.com
 (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.6; Thu, 6 Jul 2023
 19:17:37 -0700
Received: from [192.168.137.15] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Thu, 6 Jul 2023 21:17:36 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7895b532-1c6c-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JMQNMM4rmyzXtS5oRocjJihMDuYYjpH80gp34PM8m49gGrDQSahepdBwZJ5UNire5ymgIvU/MYZyeOQKIp2srDejBE8RUiQJSKcTBh+vXJVvUFJTCTyUP+wC8Wlv+Y9prr3r/Y32crpT2rxzX3xMIETm6VoW+wZJSujVfW7PjwLoywY5H869k9cb26Vl3/NEf37cHoByKUtMZGHffnkykRgl4bsmiXIYmiXxDyY2dH2VuBB89b6n04dWUYoPnPOcMO8u5ttflRo9/IjxHJAnb75DDf0feFPN8pETLgjo1odjkWds4MbjAC3oNRRXIiU3TXIl/A7fv93htSkWShpWXQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Laps7JFOLqZzyEb+PMJJMlJh89/v7ZERXiiKFYTSxsQ=;
 b=ft+c2YWeS/AHqE/cF7XGOjTSqKeIDNZGWmA1dREqXhreEy1EvT0TXC1r+A2jyW+OQoLM8ugL0w4jnWusr9a8xmyoEIuHHdpNFmNVedeGztkAfI++XdSHPN//ZDbG6BE9zW8AoVI2jCwFAKoYGu6hEG2CnglDAKpK1ruDCG+Iiywsg9I96zDfBafOg/z4hBjP/Favhk2CoYNRuv8k81eGOLBVXydrqU4+QO4lpyOdA2934TKTKV1aCt/OATp3mrp8ArYITH1DbBz2xrok8dymJWBzV4MMZnGvCGck/NTIIGsoAHgUdzrf79cHCgzyLwojCJBGts0AyEnegAzL+YLKFg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Laps7JFOLqZzyEb+PMJJMlJh89/v7ZERXiiKFYTSxsQ=;
 b=4bfoUGFYQqpDcBdnIqsIzLH2gswVWdbEAKg6kDRolYCTrxPKqoKBCD5yD/Hxxg5DcbacdKe+Oq4aZXDy/cM7s4XYP5sWkDxVytdg/rl59koKlsM6QaLmGnzQoh2WlDtnnyjkTW8gGst0Gu750XJVncIQ5OYnmVHAfoSJh5n+Kwk=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <fb47ccdb-1413-f38f-b4fa-8f537055bc86@amd.com>
Date: Thu, 6 Jul 2023 22:17:31 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [PATCH v4 1/7] xen/arm: Improve readability of check for
 registered devices
Content-Language: en-US
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Rahul Singh <rahul.singh@arm.com>, Bertrand Marquis
	<bertrand.marquis@arm.com>
References: <20230607030220.22698-1-stewart.hildebrand@amd.com>
 <20230607030220.22698-2-stewart.hildebrand@amd.com>
 <e56be8a0-58a1-bb00-3b3f-8f90434dd315@xen.org>
 <347c6352-83ed-bbd5-8569-97619fb4faf8@amd.com>
 <2503e5dc-66d7-2b6b-2de1-abe4cfd60e09@xen.org>
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
In-Reply-To: <2503e5dc-66d7-2b6b-2de1-abe4cfd60e09@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1NAM11FT028:EE_|IA0PR12MB7749:EE_
X-MS-Office365-Filtering-Correlation-Id: e12f722c-5d8f-44f0-472f-08db7e905963
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Ymy1xKpCT9/oLSezik8nHhwKsUm7a9R83moPwcUOJ+6stbDw1xFxYkyGUhsLy8tUXN/phUjRUBKBWsHBUM75FRStcqXDYu4dn7WRurPLDTpNPaB7fSL261zFKazCwOKB99FveELRWS0rchW9+IigUdPdsmKclDj4YHN6pdiypm1xd+8zJU6b3Nw4KDGPTOT1P1mjPPbBf/IbMsDsHBniRZXR9NNTHqZyAFqeynP7cKFXO6Knb1+wbDO+iq0dfUAK/a2JHgz+T8fyW0SW90NkL/t6cC5Vt+++R5ofZMTaFUFxiTe3OKUyimtKsodPqWzSjDc/BVb8ZV9DuT3s1t5nBGafhRgVA8Ae/JVzhpKAEvyT3+c5HKiqkmlO4tiauzvnVa267GbUQLdByiwCt4LRQocXHhASW4xA5WoiKbhiqEj/okZAoWKiWJ4j6RogkpzhVjum0wP6EGaMRflcCveeONWekq0ld3i6VVYwLI3Vhn4emfeg36UYgQsDuSWRcieygbJYmjzyxWWpg+dDqLrjW/LIttwdAixShtuOcCICcJ8RXvNE6EDis/+4VfcrBe9/Lrxu3aEI8rLsGVfc5wzjKTx+e9Fg0HkA0/JvCM7VMTJzJLiXqKKhXrYG1JlndiopF34ZtrczCMymZeUGcJYrqhEbxXtdRFgPmot2Mxjs49QFY6iFNxH6zMcMmfityZTuUexQdVq89stRSMsI488VMrPDJHrk9FmOGUW3tw4t3MingzE35o17mNfgIK/erG4BGT2hqRrGyVvIGZP74FIxDHhIfQ1n/CUJ525QU32fkQQ=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(346002)(136003)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(2906002)(82310400005)(966005)(82740400003)(40460700003)(356005)(81166007)(336012)(47076005)(53546011)(83380400001)(40480700001)(2616005)(26005)(36860700001)(86362001)(31696002)(426003)(8676002)(5660300002)(186003)(36756003)(44832011)(54906003)(16576012)(110136005)(6666004)(478600001)(41300700001)(8936002)(70586007)(4326008)(316002)(70206006)(31686004)(36900700001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 02:17:44.1719
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: e12f722c-5d8f-44f0-472f-08db7e905963
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1NAM11FT028.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7749

On 6/29/23 17:47, Julien Grall wrote:
> Hi,
> 
> Sorry for the late answer.
> 
> On 07/06/2023 14:41, Stewart Hildebrand wrote:
>> On 6/7/23 03:27, Julien Grall wrote:
>>> Hi Stewart,
>>>
>>> On 07/06/2023 04:02, Stewart Hildebrand wrote:
>>>> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>>>>
>>>> Improve readability of check for devices already registered with the SMMU with
>>>> legacy mmu-masters DT bindings by using is_protected.
>>>
>>> I am unconvinced with this change because...
>>>
>>>>
>>>> There are 2 device tree bindings for registering a device with the SMMU:
>>>> * mmu-masters (legacy, SMMUv1/2 only)
>>>> * iommus
>>>>
>>>> A device tree may include both mmu-masters and iommus properties (although it is
>>>> unnecessary to do so). When a device appears in the mmu-masters list,
>>>> np->is_protected and dev->iommu_fwspec both get set by the SMMUv1/2 driver. The
>>>> function iommu_add_dt_device() is subsequently invoked for devices that have an
>>>> iommus specification.
>>>>
>>>> The check as it was before this patch:
>>>>
>>>> Â Â Â  if ( dev_iommu_fwspec_get(dev) )
>>>> Â Â Â Â Â Â Â  return 0;
>>>>
>>>> and the new check:
>>>>
>>>> Â Â Â  if ( dt_device_is_protected(np) )
>>>> Â Â Â Â Â Â Â  return 0;
>>>>
>>>> are guarding against the same corner case: when a device has both mmu-masters
>>>> and iommus specifications in the device tree. The is_protected naming is more
>>>> descriptive.
>>>>
>>>> If np->is_protected is not set (i.e. false), but dev->iommu_fwspec is set, it is
>>>> an error condition, so return an error in this case.
>>>>
>>>> Expand the comment to further clarify the corner case.
>>>>
>>>> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>>>> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
>>>> ---
>>>> v3->v4:
>>>> * new patch: this change was split from ("xen/arm: Move is_protected flag to struct device")
>>>> ---
>>>> Â Â  xen/drivers/passthrough/device_tree.c | 11 ++++++++---
>>>> Â Â  1 file changed, 8 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/xen/drivers/passthrough/device_tree.c b/xen/drivers/passthrough/device_tree.c
>>>> index 1c32d7b50cce..d9b63da7260a 100644
>>>> --- a/xen/drivers/passthrough/device_tree.c
>>>> +++ b/xen/drivers/passthrough/device_tree.c
>>>> @@ -141,12 +141,17 @@ int iommu_add_dt_device(struct dt_device_node *np)
>>>> Â Â Â Â Â Â Â Â Â Â  return -EINVAL;
>>>>
>>>> Â Â Â Â Â Â  /*
>>>> -Â Â Â Â  * The device may already have been registered. As there is no harm in
>>>> -Â Â Â Â  * it just return success early.
>>>> +Â Â Â Â  * Devices that appear in the legacy mmu-masters list may have already been
>>>> +Â Â Â Â  * registered with the SMMU. In case a device has both a mmu-masters entry
>>>> +Â Â Â Â  * and iommus property, there is no need to register it again. In this case
>>>> +Â Â Â Â  * simply return success early.
>>>> Â Â Â Â Â Â Â  */
>>>> -Â Â Â  if ( dev_iommu_fwspec_get(dev) )
>>>> +Â Â Â  if ( dt_device_is_protected(np) )
>>> ... we now have two checks and it implies that it would be normal for
>>> dt_device_is_protected() to be false and ...
>>>
>>>> Â Â Â Â Â Â Â Â Â Â  return 0;
>>>>
>>>> +Â Â Â  if ( dev_iommu_fwspec_get(dev) )
>>>
>>> ... this returning a non-zero value. Is there any other benefits with
>>> adding the two checks?
>>
>> No, I can't think of any good rationale for the 2nd check. After splitting this change from the other patch ("xen/arm: Move is_protected flag to struct device"), I simply wanted to evaluate it on its own.
>>
>>> If the others agree with the double check, then I think this should gain
>>> an ASSERT_UNREACHABLE() because AFAIU this is a programming error.
>>
>> Right, if the 2nd check was justified, there should be an ASSERT_UNREACHABLE(), good point. But I don't think the 2nd check is justified.
>>
>> If the 2nd check is dropped (keeping only the is_protected check), then do you think the change is justified?
> 
> To be honest not with the current justification. I don't view the new
> check better than the other in term of readability.
> 
> Is this the only reason you want to switch to dt_device_is_protected()?

It was switched originally in the downstream I cherry-picked the patch ("xen/arm: Move is_protected flag to struct device") [1] from, where the rationale for the change wasn't explicitly written. Improving readability was the only rationale I could think of.

Anyway, I will drop this change for the next revision of this series. Hmm. The comment may still want to be expanded though... But I feel improving the comment alone should not be part of this series.

[1] https://gitlab.com/xen-project/people/bmarquis/xen-arm-poc/-/commit/59753aac77528a584d3950936b853ebf264b68e7#9e9e9f5f577b2b9fc19d92dcefe7580c7c3af744


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 04:39:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 04:39:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560163.875847 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHdF7-0005Dg-L2; Fri, 07 Jul 2023 04:38:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560163.875847; Fri, 07 Jul 2023 04:38:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHdF7-0005DZ-Hk; Fri, 07 Jul 2023 04:38:53 +0000
Received: by outflank-mailman (input) for mailman id 560163;
 Fri, 07 Jul 2023 04:38:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=VdXt=CZ=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qHdF6-0005DB-0M
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 04:38:52 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2b18343e-1c80-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 06:38:50 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 7A917227BF;
 Fri,  7 Jul 2023 04:38:49 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2D4BB1346D;
 Fri,  7 Jul 2023 04:38:49 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id ILemCdmWp2ScWAAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 07 Jul 2023 04:38:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2b18343e-1c80-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688704729; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=kd5Msn99kxjmQQ5xZ5RN/FB7LBiCBkjNrXvyP7HqpFY=;
	b=rhw8ZE+iJu0Boy1jwQ1apRceFShohgzVBpU3hDM19x8gBcziIwXd4mT+flh9VF/hEY6E5K
	N1M3B4AvsMVF0oi12o9gfutwrfp52gNZTeoWBOSTgfufELKKWFx8RT1TLKgBe8MIV6A8HI
	8cGAkD4FxEEiP7fgqEKR4jaD6x1BRB4=
Message-ID: <05341cac-ac75-a6e5-9c29-3caf83ea99fc@suse.com>
Date: Fri, 7 Jul 2023 06:38:48 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Oleksandr Tyshchenko <olekstysh@gmail.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 vikram.garhwal@amd.com
References: <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
 <b21398eb-2fb2-4fca-dd90-d2c81d8df1c4@epam.com>
 <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop>
 <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>
 <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com> <ZKQF8qq8Oh5E+Fxx@mail-itl>
 <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
 <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
 <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
 <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
In-Reply-To: <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------0zxCTWlRSlE359BNaPmE4m00"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------0zxCTWlRSlE359BNaPmE4m00
Content-Type: multipart/mixed; boundary="------------Asphqc9ReLTqJNRCJ1hcghNc";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Oleksandr Tyshchenko <olekstysh@gmail.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 vikram.garhwal@amd.com
Message-ID: <05341cac-ac75-a6e5-9c29-3caf83ea99fc@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
References: <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
 <b21398eb-2fb2-4fca-dd90-d2c81d8df1c4@epam.com>
 <alpine.DEB.2.22.394.2306291502150.3936094@ubuntu-linux-20-04-desktop>
 <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>
 <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com> <ZKQF8qq8Oh5E+Fxx@mail-itl>
 <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
 <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
 <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
 <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>

--------------Asphqc9ReLTqJNRCJ1hcghNc
Content-Type: multipart/mixed; boundary="------------j2xSVfZI8LfGeLTm6HMCHTsd"

--------------j2xSVfZI8LfGeLTm6HMCHTsd
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMDYuMDcuMjMgMjM6NDksIFN0ZWZhbm8gU3RhYmVsbGluaSB3cm90ZToNCj4gT24gVGh1
LCA2IEp1bCAyMDIzLCBSb2dlciBQYXUgTW9ubsOpIHdyb3RlOg0KPj4gT24gV2VkLCBKdWwg
MDUsIDIwMjMgYXQgMDM6NDE6MTBQTSAtMDcwMCwgU3RlZmFubyBTdGFiZWxsaW5pIHdyb3Rl
Og0KPj4+IE9uIFdlZCwgNSBKdWwgMjAyMywgUm9nZXIgUGF1IE1vbm7DqSB3cm90ZToNCj4+
Pj4gT24gVHVlLCBKdWwgMDQsIDIwMjMgYXQgMDg6MTQ6NTlQTSArMDMwMCwgT2xla3NhbmRy
IFR5c2hjaGVua28gd3JvdGU6DQo+Pj4+PiAqKioqKioqKioqDQo+Pj4+Pg0KPj4+Pj4gUGFy
dCAxIChpbnRybyk6DQo+Pj4+Pg0KPj4+Pj4gV2UgY291bGQgcmV1c2UgYSBQQ0kgY29uZmln
IHNwYWNlIHJlZ2lzdGVyIHRvIGV4cG9zZSB0aGUgYmFja2VuZCBpZC4NCj4+Pj4+IEhvd2V2
ZXIgdGhpcyBzb2x1dGlvbiByZXF1aXJlcyBhIGJhY2tlbmQgY2hhbmdlIChRRU1VKSB0byBl
eHBvc2UgdGhlDQo+Pj4+PiBiYWNrZW5kIGlkIHZpYSBhbiBlbXVsYXRlZCByZWdpc3RlciBm
b3IgZWFjaCBlbXVsYXRlZ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lYW0gYnVnLCBzbyB3ZSBoYXZlIHRvIHRha2UgYWN0aW9uIG9u
ZSB3YXkgb3IgdGhlIG90aGVyLg0KDQpUaGUgcmVxdWlyZWQgdmlydGlvIElPTU1VIGRldmlj
ZSBtb2RpZmljYXRpb24gd291bGQgYmUgcmF0aGVyIHNtYWxsLCBzbw0KYWRkaW5nIGl0IG1h
eWJlIHVuZGVyIGEgQ09ORklHIG9wdGlvbiBkZWZhdWx0aW5nIHRvIG9mZiBtaWdodCBiZQ0K
YWNjZXB0YWJsZS4NCg0KDQpKdWVyZ2VuDQo=
--------------j2xSVfZI8LfGeLTm6HMCHTsd
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYq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YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------j2xSVfZI8LfGeLTm6HMCHTsd--

--------------Asphqc9ReLTqJNRCJ1hcghNc--

--------------0zxCTWlRSlE359BNaPmE4m00
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSnltgFAwAAAAAACgkQsN6d1ii/Ey9g
ygf+NAZxeBtmbA89mNlh8hm2pIT18GiomgxioL76DcMi5PhrWYe/c9xJNaDkhlUws4VMIx5iRWzq
avbi/cCdM6LBkR7Upi3A6wivNx8tdZ9NXK2OooGrpQb7D/KR9kWusAZj4GZF4+JM69cAVDFMi0LE
lNy9UO5AuaWyshvvM5lshq+GdaqTmHCg9SWVhauFcPew69zmTNg8w2Jkyn5jHVRUmLpHPFEl9Ysm
DcLW9pvSAePtvTijjwlU/yyBCFw92mepstsfboYL6Tb+iDUxLLDV8kxvCp5ELEvufRUI2r6wpVlP
+FreYUinkQQ3TNOdDQpS4UrTmrM3LdvZz/X3SdJdDA==
=9eJw
-----END PGP SIGNATURE-----

--------------0zxCTWlRSlE359BNaPmE4m00--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 06:33:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 06:33:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560170.875857 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHf22-0000h9-VU; Fri, 07 Jul 2023 06:33:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560170.875857; Fri, 07 Jul 2023 06:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHf22-0000h2-Se; Fri, 07 Jul 2023 06:33:30 +0000
Received: by outflank-mailman (input) for mailman id 560170;
 Fri, 07 Jul 2023 06:33:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ruU0=CZ=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHf21-0000gw-IY
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 06:33:29 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2048.outbound.protection.outlook.com [40.107.13.48])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2e49b8cc-1c90-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 08:33:27 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB7913.eurprd04.prod.outlook.com (2603:10a6:10:1ee::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 06:32:57 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Fri, 7 Jul 2023
 06:32:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2e49b8cc-1c90-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=MVm6sU2tDJulPpjwo2GkZhPHpdSloum47QDVX6gUo6AGYmp7oIn1FSbYz3/SSnnurJoy+n/2tldsHkcj8MrQGQ2ykLqxVd/fOiM/gJDSnFylg0bX+/dZbF+M5T2U3mthOBFtV6SbYaiiJlqunL3ik43PUM0WjbweSQu91ei31S++L1xKOaPFej9cslehbdzyxLYTsf/P99e9X/NwK/NBWlMDC4iz0TBAAvxPkXHS7Z5zIfw2MHEzs3uw9sT16UzgeB8sGxdgKCjC4mwUKIQnH3o2bQ2yJW7fQ4nMoZTsS3HuNJEtcFTeBN2ibeCYFSz5KYEN0IM9foq2uG/LsBrw6Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=W5VxBTkIf+j4Tu2a5hY04lbMSs8PaSW52Z3IZ6PkoOs=;
 b=cO7xA3SwUVBpZ6EVGgFGA08br5dt0hno3fB5WmylnjtvN4SiTNo0ilXpNtQRovjte87nMi67dv5iiCWq6mcJacH7hUvLbo7MOgjd7HhGDXkhOKA2S+oqw1r7bsTdszcy61SO/rmYHqS5v/HR9uAGu1wsfTgnSVlX6jtENIuBrR05He4Ur2o/iJ5NOtyiTVqANKQ/nc7IWZ03hXoHyM+wKrfUlcYEo/jTRvHzRL+g70P/XXCyegxoFGyUy6ooIPdzgaI2nZB6R58NVQASllyQB7jSO8/6qST2XEhXxLEWXjljCa3HDhHEuOQx0jHYMcgwqHsQJFjrpIEipx+LAr0xZA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=W5VxBTkIf+j4Tu2a5hY04lbMSs8PaSW52Z3IZ6PkoOs=;
 b=J4Y1O9pj8Dj8mWL0sPugBm/gtjD8RdVFXzzg4tTHSiwWGkjsYdmiQz/OthWQtEHtSd/R+k8QHqsoJlCssGSt2JREnP/igOGduTCAsUi3XXXvyHisu9RztUfGApt77MM872VszJW4ItoxxSW2NOXjN2YOaS1hpTYYwNAviwVgOBWK4OaDFzRdJeUrf7nLb7PuERUZeyxM4NlFWF/g8febe2lYNguUNN+FFSD+L2w4IujP0dVFdbOPWcntlSNUclVWphJGDWrq0w2orQzS9ezNAmKe7dR2ybGBM6l1z1bLrWO5u9LW3BdCHGbhnQyFgO+bGwiAVhOuMa2aq2CmVBn2PQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e0c60476-ac03-cc6d-59f4-d317f1b4a7e8@suse.com>
Date: Fri, 7 Jul 2023 08:32:55 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v7 01/12] vpci: introduce per-domain lock to protect vpci
 structure
Content-Language: en-US
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Paul Durrant <paul@xen.org>
References: <20230613103159.524763-1-volodymyr_babchuk@epam.com>
 <20230613103159.524763-2-volodymyr_babchuk@epam.com>
 <ZIyOCan//39V3bdy@MacBook-Air-de-Roger.local> <87352kpj04.fsf@epam.com>
 <ZJQDGOrP1I3hR5Jj@MacBook-Air-de-Roger.local> <87ilbfnqmo.fsf@epam.com>
 <ZJVc77SwvyKOEdnJ@MacBook-Air-de-Roger.local> <87wmzfmltd.fsf@epam.com>
 <ab79bcb6-6fc8-c68f-65bf-16ce7316c3ae@suse.com>
 <ZKUw2MPBhOSgG-Eg@MacBook-Air-de-Roger.local>
 <a964cffa-fb42-b0e0-e60a-1044d8794193@suse.com> <87mt08mqb9.fsf@epam.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <87mt08mqb9.fsf@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0160.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:99::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB7913:EE_
X-MS-Office365-Filtering-Correlation-Id: 5e392dd4-abf9-4f37-eaf4-08db7eb40097
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	sPUrOC6lb5QLidrmOElwrALsUFYyObBJCYmTFGuc7An0Taaazt8XKNLCeGdYLp4OTb8rHqxXaqlv79x7KwniwpNYrIyWZB6YBSqeyGMZt4eeIE5pfgkm2cfTQr17aVmn5GxhYSSZFevJO2Ld6PhwcO8CSanKKGX4mjYMgyikNmPxrHFghOh5Jjy2rMGkt8rt3AeqhmRTlYPf1/Sta0Cs9rdH939CBdhAGO5uvrz4h+0gbdi9XbZtaEy6vIFlZCRek+aMVbDSvJkmTQBoZSSenqL38MkdQIO6TMFLTsk6wyDEK/4YNsUTTN1sl66plgo/BZCuaQkS22Afz3U/lUuou3K0IajgNomztJigzFjds/Iag9dO/7Q3O1BTtV5ROhgRUkZEukEjPs+Nl1Q46r/G6crygLR6AEpMy0jcs1RSB+0b8bGH5TetOdR72UecD5vFn0vwenRX27+Z0bNYDyl9zxomBKrLP4YDpNMC5ZE11ODdaqJC1r7V/Jz5709Wade7lfTlk660bgZU9jTtoqYOwUiKNrAE4nKp9nX99Gs0tyBzZwgi8YJiTUqDrwTLvp19bJ6jSEpMkDQX5RthONva9wZrqW1v4xWvyqKyWsogmB0dSR0OdMndzbZTgmqu/aNjArW6IxzXSlA8kq3xy/G8wQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(366004)(396003)(346002)(136003)(451199021)(316002)(36756003)(31686004)(86362001)(31696002)(7416002)(2906002)(5660300002)(6512007)(186003)(83380400001)(6506007)(53546011)(26005)(54906003)(66556008)(6486002)(66476007)(66946007)(4326008)(38100700002)(2616005)(6916009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=?utf-8?B?RGs2SVRocWJPWDNpOXg1Mi9hTnhvSm9vQWg0OFBOaUxqZE81VUQ0dXg1WC80?=
 =?utf-8?B?NUE4ZldEZ2FDWjlJR09DSjREYkFidXhhV0NMTGtaNVVIQlpMSWZxL0Z0TExR?=
 =?utf-8?B?VTJzRk9wUWk3c0drRVZZK0haZ2xncDBJOUk4MmhmRE5hR3hEUS9YVEF5ZGIr?=
 =?utf-8?B?UkJuYmpmMlJwSU0wK2Nha0VaYnZjQXB6ajFHRmZuVFBMRmp6SGFFanF1SnVE?=
 =?utf-8?B?czE5MWIxVE9jS2FtMSt2U1ZWbnRCMmpPQlhXaG9tWmx6UjhkcGxzYnB2YU93?=
 =?utf-8?B?bmJUL2IzM2tiY2IwdkJEWHdLcy8vckJYZkl4aDlJTmpxR1JJNmN6bGVyZ0ww?=
 =?utf-8?B?TUxMdDhnRU5hREgrV1lTNnloSjRiaXlZY25hcVhEWktyTlZJampCSVpPOHVL?=
 =?utf-8?B?TjZoc0NDMExOYWVJWDV5dVBiUCtZWEhpc2x3TWZnR0hTcU5kZzJWanJoOXEx?=
 =?utf-8?Q?tP6tHe9UpdUZgWrIN3bSsiW6S?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5e392dd4-abf9-4f37-eaf4-08db7eb40097
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 06:32:57.3565
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: vJkayOWvPzcPsO4KdhEYbbs08uIEIdeE9RFVksQS0mi7NPwN6OpZlkNqAPZYg5xLwn1WmApQa1xW4nXiro+sdA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7913

On 07.07.2023 04:02, Volodymyr Babchuk wrote:
> 
> Hi Jan,
> 
> Jan Beulich <jbeulich@suse.com> writes:
> 
>> On 05.07.2023 10:59, Roger Pau MonnÃ© wrote:
>>> On Wed, Jul 05, 2023 at 09:11:10AM +0200, Jan Beulich wrote:
>>>> On 04.07.2023 23:03, Volodymyr Babchuk wrote:
>>>>> I am currently implementing your proposal (along with Jan's
>>>>> suggestions), but I am facing ABBA deadlock with IOMMU's
>>>>> reassign_device() call, which has this piece of code:
>>>>>
>>>>>         list_move(&pdev->domain_list, &target->pdev_list);
>>>>>
>>>>> My immediate change was:
>>>>>
>>>>>         write_lock(&pdev->domain->pci_lock);
>>>>>         list_del(&pdev->domain_list);
>>>>>         write_unlock(&pdev->domain->pci_lock);
>>>>>
>>>>>         write_lock(&target->pci_lock);
>>>>>         list_add(&pdev->domain_list, &target->pdev_list);
>>>>>         write_unlock(&target->pci_lock);
>>>>>
>>>>> But this will not work because reassign_device is called from
>>>>> pci_release_devices() which iterates over d->pdev_list, so we need to
>>>>> take a d->pci_lock early.
>>>>>
>>>>> Any suggestions on how to fix this? My idea is to remove a device from a
>>>>> list one at time:
>>>>>
>>>>> int pci_release_devices(struct domain *d)
>>>>> {
>>>>>     struct pci_dev *pdev;
>>>>>     u8 bus, devfn;
>>>>>     int ret;
>>>>>
>>>>>     pcidevs_lock();
>>>>>     write_lock(&d->pci_lock);
>>>>>     ret = arch_pci_clean_pirqs(d);
>>>>>     if ( ret )
>>>>>     {
>>>>>         pcidevs_unlock();
>>>>>         write_unlock(&d->pci_lock);
>>>>>         return ret;
>>>>>     }
>>>>>
>>>>>     while ( !list_empty(&d->pdev_list) )
>>>>>     {
>>>>>         pdev = list_entry(&d->pdev_list, struct pci_dev, domain_list);
>>>>>         bus = pdev->bus;
>>>>>         devfn = pdev->devfn;
>>>>>         list_del(&pdev->domain_list);
>>>>>         write_unlock(&d->pci_lock);
>>>>>         ret = deassign_device(d, pdev->seg, bus, devfn) ?: ret;
>>>>>         write_lock(&d->pci_lock);
>>>>
>>>> I think it needs doing almost like this, but with two more tweaks and
>>>> no list_del() right here (first and foremost to avoid needing to
>>>> figure whether removing early isn't going to subtly break anything;
>>>> see below for an error case that would end up with changed behavior):
>>>>
>>>>     while ( !list_empty(&d->pdev_list) )
>>>>     {
>>>>         const struct pci_dev *pdev = list_first_entry(&d->pdev_list, struct pci_dev, domain_list);
>>>>         uint16_t seg = pdev->seg;
>>>>         uint8_t bus = pdev->bus;
>>>>         uint8_t devfn = pdev->devfn;
>>>>
>>>>         write_unlock(&d->pci_lock);
>>>
>>> I think you need to remove the device from the pdev_list before
>>> dropping the lock, or else release could race with other operations.
>>>
>>> That's unlikely, but still if the lock is dropped and the routine
>>> needs to operate on the device it is better remove such device from
>>> the domain so other operations cannot get a reference to it.
>>>
>>> Otherwise you could modify reassign_device() implementations so they
>>> require the caller to hold the source->pci_lock when calling the
>>> routine, but that's ugly because the lock would need to be dropped in
>>> order to reassign the device from source to target domains.
>>>
>>> Another option would be to move the whole d->pdev_list to a local
>>> variable (so that d->pdev_list would be empty) and then iterate over
>>> it without the d->pci_lock.  On failure you would take the lock and
>>> add the failing device back into d->pdev_list.
>>
>> Conceptually I like this last variant, but like the individual list_del()
>> it requires auditing code for no dependency on the device still being on
>> that list. In fact deassign_device()'s use of pci_get_pdev() does. The
>> function would then need changing to have struct pci_dev * passed in.
>> Yet who knows where else there are uses of pci_get_pdev() lurking.
> 
> Okay, so I changed deassign_device() signature and reworked the loop
> in pci_release_devices() in a such way:
> 
>     INIT_LIST_HEAD(&tmp_list);
>     /* Move all entries to tmp_list, so we can drop d->pci_lock */
>     list_splice_init(&d->pdev_list, &tmp_list);
>     write_unlock(&d->pci_lock);
> 
>     list_for_each_entry_safe ( pdev, tmp, &tmp_list, domain_list )
>     {
>         pdev = list_entry(&d->pdev_list, struct pci_dev, domain_list);
>         rc = deassign_device(d, pdev);
>         if ( rc )
>         {
>             /* Return device back to the domain list */
>             write_lock(&d->pci_lock);
>             list_add(&pdev->domain_list, &d->pdev_list);
>             write_unlock(&d->pci_lock);
>             func_ret = rc;
>         }
>     }
> 
> 
> Also, I checked for all pci_get_pdev() calls and found that struct
> domain (the first parameter) is passed only in handful of places:
> 
> *** xen/drivers/vpci/vpci.c:
> vpci_read[504]                 pdev = pci_get_pdev(d, sbdf);
> vpci_read[506]                 pdev = pci_get_pdev(dom_xen, sbdf);
> vpci_write[621]                pdev = pci_get_pdev(d, sbdf);
> vpci_write[623]                pdev = pci_get_pdev(dom_xen, sbdf);
> 
> *** xen/arch/x86/irq.c:
> map_domain_pirq[2166]          pdev = pci_get_pdev(d, msi->sbdf);
> 
> *** xen/drivers/passthrough/pci.c:
> XEN_GUEST_HANDLE_PARAM[1712]   pdev = pci_get_pdev(d, machine_sbdf);
> 
> The last one is due to my change to deassign_device() signature.

And which is going to continue to return NULL when earlier on you've
emptied the list. The purpose of passing in struct pdev * was to
eliminate this call. (Yet there may be further reasons why eliminating
this call actually isn't correct.)

> ==============================
> 
> d->pdev_list can be accessed there:
> 
> *** xen/drivers/passthrough/amd/pci_amd_iommu.c:
> reassign_device[489]           list_add(&pdev->domain_list, &target->pdev_list);
> 
> *** xen/drivers/passthrough/pci.c:
> _pci_hide_device[463]          list_add(&pdev->domain_list, &dom_xen->pdev_list);
> pci_get_pdev[561]              list_for_each_entry ( pdev, &d->pdev_list, domain_list )
> pci_add_device[759]            list_add(&pdev->domain_list, &hardware_domain->pdev_list);
> pci_release_devices[917]       list_splice_init(&d->pdev_list, &tmp_list);
> pci_release_devices[922]       pdev = list_entry(&d->pdev_list, struct pci_dev, domain_list);
> pci_release_devices[928]       list_add(&pdev->domain_list, &d->pdev_list);
> _setup_hwdom_pci_devices[1155] list_add(&pdev->domain_list, &ctxt->d->pdev_list);
> 
> *** xen/drivers/passthrough/vtd/iommu.c:
> reassign_device_ownership[2819] list_add(&pdev->domain_list, &target->pdev_list);
> 
> *** xen/include/xen/pci.h:
> for_each_pdev[149]             list_for_each_entry(pdev, &(domain)->pdev_list, domain_list)
> has_arch_pdevs[151]            #define has_arch_pdevs(d) (!list_empty(&(d)->pdev_list))
> 
> ==============================
> 
> And has_arch_pdevs() is used there:
> 
> *** xen/arch/x86/hvm/hvm.c:
> hvm_set_cr0[2388]              has_arch_pdevs(d)) )
> 
> *** xen/arch/x86/hvm/vmx/vmcs.c:
> vmx_do_resume[1892]            if ( has_arch_pdevs(v->domain) && !iommu_snoop
> 
> *** xen/arch/x86/mm.c:
> l1_disallow_mask[172]          !has_arch_pdevs(d) && \
> 
> *** xen/arch/x86/mm/p2m-pod.c:
> p2m_pod_set_mem_target[352]    if ( has_arch_pdevs(d) || cache_flush_permitted(d) )
> guest_physmap_mark_populate_on_demand[1404] if ( has_arch_pdevs(d) || cache_flush_permitted(d) )
> 
> *** xen/arch/x86/mm/paging.c:
> paging_log_dirty_enable[208]   if ( has_arch_pdevs(d) )
> 
> *** xen/drivers/passthrough/vtd/iommu.c:
> reassign_device_ownership[2773] if ( !has_arch_pdevs(target) )
> reassign_device_ownership[2807] if ( !has_arch_pdevs(target) )
> reassign_device_ownership[2825] if ( !has_arch_pdevs(source) )
> 
> 
> has_arch_pdevs() bothers me most, actually, because it is not always
> obvious how to add locking for the callers. I am planning to rework it
> in the following way:

Locking is only one aspect. As above, another is whether the function
might wrongly return "false" when you prematurely empty the list of
devices.

> #define has_arch_pdevs_unlocked(d) (!list_empty(&(d)->pdev_list))
> 
> static inline bool has_arch_pdevs(struct domain *d)
> {
>     bool ret;
> 
>     read_lock(&d->pci_lock);
>     ret = has_arch_pdevs_unlocked(d);
>     read_unlock(&d->pci_lock);
> 
>     return ret;
> }

No, this follows a pattern that earlier was said isn't acceptable:
The result of such a check is meaningless to the caller without holding
the lock past actually consuming the result. It simply is stale by the
time you return to the caller. (There may be special cases where other
constraints eliminate the concern, like maybe during domain
construction or domain cleanup, but such need carefully considering in
each individual case. Which in particular means there shouldn't be any
common-use helper functions doing what is unsafe in the general case.)

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 06:37:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 06:37:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560174.875866 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHf5b-0001H3-GB; Fri, 07 Jul 2023 06:37:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560174.875866; Fri, 07 Jul 2023 06:37:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHf5b-0001Gw-Cr; Fri, 07 Jul 2023 06:37:11 +0000
Received: by outflank-mailman (input) for mailman id 560174;
 Fri, 07 Jul 2023 06:37:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ruU0=CZ=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHf5Z-0001Gq-To
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 06:37:09 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0615.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::615])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b219d1ba-1c90-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 08:37:09 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB8135.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 06:37:06 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Fri, 7 Jul 2023
 06:37:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b219d1ba-1c90-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=G8oPKj1TdOZhcikhVTUdm96Ijc00FEewbmX07JXATTnQmNUcbsEetrCX2CZR8xLLH/542OpdEVPMkCUorGtmzrBBSIUNMivMhy7RoDm6TIZJAoYi0dTM1KEpDnot2vo854+a7mL7ejuUbRS3qqeyLmEeW5P2m2XvctuHnKTr0rcn9uFNNRHy6i2AtHPYhpJnu1S2zuKo0EgmMzlETUazMCDHK++Fj40Twi8UKIQjj1XOumWJOfrN/v4pAEeWxa5jRfxQVQFBwY5LqYhXij65FhjHxZbFYaUJ6Ei0C9beKHvuxGxduBG5TfmT8stLgc9lsa8F2PXw3XWL7DK4lAMdjw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=lIWLWx8dgHcsTEVqplza6+9naUviv7sCsC3PH2iOdg4=;
 b=IDjVwUilQVGvp58yznrK3W71BhnVxLmD+ef9vpyW7jUKJ/Fs95sFA2+sqsCW+ao0uw4e5RbuP26Ppjg+Kd38S/PQGzMffyCldqCOmwl/maaPpWZXLb6/Dnei5CmjDLI5jl7srUFJh6TEKjBCKetM7HW1feqHO3HhikFQ2CqdQw9QZpFcaxLlHxehZxQxtqCScwReSVe/+hu7w46EOZw9uhY68CXqz4uF3mfvK2wdyVvzOjN6FfkVcHrrWnal50xJ5evuNQCJwgbdpMrzbSUDFaoTqQWfVNHHgk5+JoD6isyBzFlLndTXY2g8qVGFGe1DfEAZ0aE+heiZuRwX06SE4w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=lIWLWx8dgHcsTEVqplza6+9naUviv7sCsC3PH2iOdg4=;
 b=iB1pEWhVqNsm5oKszNEmnvYhVX0pP+g1GknWBAyco2dqyAlSQPtR99te7qsMpKFjZy+dsJ2LZQBUdK99R2o1SxFgYUjvkTCN935LadVCR+L6ESq1ITBODP+2XgYnc2iEqBRqutzPuHKBYzu7YikcxPlzdThV1LxQO3wuj18HWfVgDtN0Q1Q8D2+1MSrSDn5Cqz5vf3kV0WoQSYuke2XNmxhgIfnJoXQALUAEx0iZhRcPH9aiMJ2i5wTot6h/ZjxHw1p99jjBh7Ox0JSY5oqhRcFbAQTtkPuZi41eoOJtj6ZOLyqPj2VlNvDS9tPBPf9IdFl1b18R4nHQRJeaszgyzg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <fe73f06e-76e2-cfd8-64ca-7117a3835818@suse.com>
Date: Fri, 7 Jul 2023 08:37:03 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH 4/5] x86/x86_emulate: change parameter name from 's'
 to 'state'
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Federico Serafini <federico.serafini@bugseng.com>,
 xen-devel@lists.xenproject.org, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
References: <cover.1688049494.git.federico.serafini@bugseng.com>
 <8c8bc96b96a1111a4651f970f506d304809ea40d.1688049495.git.federico.serafini@bugseng.com>
 <alpine.DEB.2.22.394.2306291230500.3936094@ubuntu-linux-20-04-desktop>
 <e7af3c85-92ec-7d0f-0e63-3a1e5d65877e@suse.com>
 <alpine.DEB.2.22.394.2307051544340.761183@ubuntu-linux-20-04-desktop>
 <c2a52a88-a8bf-3e14-f3f5-616177c3d807@suse.com>
 <alpine.DEB.2.22.394.2307061450530.761183@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307061450530.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0066.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:93::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB8135:EE_
X-MS-Office365-Filtering-Correlation-Id: 11f9c49c-a8d1-4cea-06c1-08db7eb494f9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	PR0VKHgfkQV4Eomgr3PL5Q4ngYqE9dfMJ21TWLTo+oKx4fGq4tUYM90YP+VHbdCgUbxM+bUs35R4lPBB2ZyidadqFznCa/U+pKWdBhG6o+zvQWgx2R6kGYWu1eNMrE0UUV7madsYWJFfWjSTmyGh4JH8RtTTzf05Fynasif/W0uEn1y2RYx09KX0qiCeT++Dn8IIMrLgfZUJ7ck9V4LZgydfqm9cJl0OUkbNW7i7cSqY4fhjkg0d27GNez2NzhXmiTHoDqL937A21lYELQGxlzJ9O/Zml4G6sjeqi7p3cvROEfWDRYlTBj5Ap6fR1vrUHlJklr982A6ZiJwmoq45tVdFcgbzB21svLGtD4l6tq3ZcptHdzJOzGyoRrm4XCe0ndGV+STWXHE6x9Lw23J+z5nSFrvkOF0rP00vU44Vi5c8M06DKG6gAYODgOlLjfNlbk6pIja2N5oE5WiQVj4h0ntnj8zKKtfi85VVmsYI9DR9bM0I4erYNU5/+KR6OCP0ffFxoHOJ64qCMmYMjVW2eWw+OxX5k2aP47w7bXOgPfT4s8OOWvko7hiUIuw88uT3V+qePjqrsJhLUnhsoOJ1OT6wDyagQkyGFnQ9XinMiR/v9V/qHZHedNk+YWqHbALac+QuiaUcf/MUZ2rVsu9vtQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(396003)(39860400002)(376002)(346002)(451199021)(6916009)(66946007)(4326008)(66476007)(66556008)(38100700002)(2616005)(186003)(6666004)(31696002)(6486002)(54906003)(36756003)(53546011)(478600001)(86362001)(6506007)(6512007)(7416002)(26005)(8676002)(31686004)(8936002)(5660300002)(316002)(2906002)(83380400001)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?M2I5NDBnY09EakF3RVVCMFovNVBkUmgrbkRPNnpKNFI0bmY5Si9qMG9CQmVJ?=
 =?utf-8?B?eGJOUWtiU015aHgvdzFqT25qRnNIMWhZZ2NuUENXb1hFaHFicjRCNVYwN1RC?=
 =?utf-8?B?YVlwSjRleW53MTBBTWZzUGFtMEFZeWtYUVhJNVpJcU82c1hPL0cwb1Zuc3VS?=
 =?utf-8?B?bk0zdG56MEc5SU1pZ1gvK0JCYnNodkZ5RjJyZW1pZ0dyV2ExVnhnMUVZVko4?=
 =?utf-8?B?M2NNQXliaDdmNWsvUUtZczBPblZ4WndSZHE1SEd2dmRWYXlxSnY2K0tzN0wx?=
 =?utf-8?B?NlZsemFla2VIaTZMdlhDR3BNQWpNN2x5QzRDenJ0RDl0aVFKbFFDdzhNYStF?=
 =?utf-8?B?Y0k2RnNJKzFoTXBQQldtdk9mZzVWaHFmUUhySnNibzI1VjNRZzNMR3ViVXZ2?=
 =?utf-8?B?cGRTaDU2K1BXL1lSRzlza2NpODE2K2FadVBUQzIydDRMS2E5OE03UFJzQ3VM?=
 =?utf-8?B?cG9JRGl1UEFoMVJqdmE4d1p2Zi9yWk5Jd1RDdWkrOUpWTGFqdTN5RzRoZFFy?=
 =?utf-8?B?K2xyZ0FhTGkxSVY4bmVpSzkvQzl5TTZ4aFFiVEJlZXN4YTZJRm5OS0ZOTkcv?=
 =?utf-8?B?YUJJQjhZbFF6TmNGcXFkYWo0WmJoS0dOQy9ZWmduMDBwQi9QOHJjR2tRMU53?=
 =?utf-8?B?NEtGNnIyK0Zjd3o0VHZ1cWVTZzI4WVgvM1hMWXladVRvVHVLVU5EOWdvNTVS?=
 =?utf-8?B?ZHU2cWlqVkVzc1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mck1qMk9IWjFFZ2VVTlF5VUo2?=
 =?utf-8?B?eGc3OGxjYlFzcGhJdXd1bWtkTXNJTUc5bHlJQjN2Tld6OTNRVzR2N2k4djRM?=
 =?utf-8?B?bG1Na2dsYzB4d0luNDBoUGV3eFRINVdudXlGQVc3cUtrSUliVVIyYk9rcXpM?=
 =?utf-8?B?OXUvMHdUemRBakgvbjByQXRyREVaTEQ4cGEyS1k0aE9qY1Q2UGFUL05EMVk1?=
 =?utf-8?B?M2FEMXdWRk5ESFN5aUZxT2VxMU1XMU91ZndFeXZ6YXMvQUlPTU1HaVZ0TzVR?=
 =?utf-8?B?dHJSa2V4THFYOFhFaTVRWWR6L3dEMkk1T0RKOXNWWE9hWENtaEZhbnU4cmhB?=
 =?utf-8?B?RWRpdU9xazJzYUtWOGpxVjV2dGhEN3p5ckJ4SkNxMDFXU2Jjdzd3WHhrRU1G?=
 =?utf-8?B?YmdHVnlFZ0h0ZmtDZUw2ZkxOWjRDTE5XRzVReGRtMEw1cDhhdk9pQUZObGpj?=
 =?utf-8?B?QUEzOU5BclNicUxGN2szSHhicCtaa1psYm11RkRxdkxrdkluVGVhRWUzZ1JB?=
 =?utf-8?Q?SYIUQ5Q9Njy60Tm2I5VfQjUPs?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 11f9c49c-a8d1-4cea-06c1-08db7eb494f9
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 06:37:06.2789
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: lAyJx5jDjM5+txuBjQaVQ8LMZCZdGUOnXR9DKtGF06c8wouwKaBMiij36PZE+TGByvgm6vm49UpESvLwHfrfPQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8135

On 07.07.2023 00:05, Stefano Stabellini wrote:
> On Thu, 6 Jul 2023, Jan Beulich wrote:
>> On 06.07.2023 00:49, Stefano Stabellini wrote:
>>> On Tue, 4 Jul 2023, Jan Beulich wrote:
>>>> On 29.06.2023 21:31, Stefano Stabellini wrote:
>>>>> On Thu, 29 Jun 2023, Federico Serafini wrote:
>>>>>> Change parameter name from 's' to 'state' in function definitions in
>>>>>> order to:
>>>>>> 1) keep consistency with the parameter names used in the corresponding
>>>>>>    declarations;
>>>>>> 2) keep consistency with parameter names used within x86_emulate.h;
>>>>>> 3) fix violations of MISRA C:2012 Rule 8.3.
>>>>>>
>>>>>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
>>>>>
>>>>> You could use x86emul: as tag in the title. I'll let Jan choose the tag
>>>>> he prefers.
>>>>
>>>> x86emul: or x86/emul: is what we commonly use. That said, I don't like
>>>> this change. The files touched are pretty new, and it was deliberate
>>>> that I used s, not state, for the names. This is shorthand much like
>>>> (globally) we use v (instead of vcpu) and d (instead of domain).
>>>
>>> Are you suggesting that the functions changed in this patch should be
>>> adapted in the other direction instead?  Meaning that the declaration is
>>> changed to match the definition instead of the opposite?
>>>
>>> If so, are you referring to all the functions changed in this patch? Or
>>> only some?
>>
>> All of the files touched here are ones which were recently introduced,
>> and which are deliberately the way they are. This "deliberately" really
>> goes as far as declarations and definitions disagreeing in names: For
>> the former, what matters are adjacent declarations in the header. For
>> the latter what matters is code readability. I'm sorry, I think the
>> Misra rule simply gets in the way of the original intentions here (and
>> I continue to disagree with there being any confusion from name
>> mismatches between declarations and definitions, the more that in the
>> case here it would be easy to avoid by simply omitting names in
>> declarations, but that is violating yet another rule I don't fully
>> agree with either, as voiced when discussing it).
>>
>> My preferred course of action here would be to simply drop the patch.
>> The least bad adjustment, if one is absolutely necessary, would be to
>> change the declarations, but then in a way that all adjacent ones
>> remain consistent (which may in turn require some _other_ definitions
>> to change). The mid- to long-term goal certainly is to use "s" more
>> where "state" may be used right now.
> 
> 
> If we drop this patch then we have the problem that Eclair and other
> scanners will detect these as violations. Also this source file would
> not be consistent with the rest of the codebase causing issues in the
> future. Any patch updating this file would trigger new MISRA C
> violations in the scanners.
> 
> So I don't think we can drop this patch but we could add deviations. I
> think your suggestion of "changing the declaration in a way that all
> adjacent ones remain consistent" is better, but let me also provide this
> option.
> 
> Basically, we would keep these declarations/definitions as is, and add
> a one-line in-code comment for each deviation. Such as:
> 
> /* SAF-2-safe R8.3 */
> bool cf_check
> x86_insn_is_mem_write(const struct x86_emulate_state *state,
>                       const struct x86_emulate_ctxt *ctxt);
> 
> Your suggestion of changing the declaration is better in my opinion. Do
> you agree?

Yes. I'm not really happy with any of the options resulting from us following
the various involved rules (also in particular 8.2), but this looks to be the
least bad of them.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 06:40:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 06:40:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560180.875877 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHf8w-0002lN-3R; Fri, 07 Jul 2023 06:40:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560180.875877; Fri, 07 Jul 2023 06:40:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHf8w-0002lG-0K; Fri, 07 Jul 2023 06:40:38 +0000
Received: by outflank-mailman (input) for mailman id 560180;
 Fri, 07 Jul 2023 06:40:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ruU0=CZ=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHf8v-0002l8-06
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 06:40:37 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on2062a.outbound.protection.outlook.com
 [2a01:111:f400:fe16::62a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2d849ad2-1c91-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 08:40:36 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB7625.eurprd04.prod.outlook.com (2603:10a6:10:202::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 06:40:33 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Fri, 7 Jul 2023
 06:40:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2d849ad2-1c91-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=c43F85XB/K6O+ktcIpCPrOCqfndyd6iwjwIpCp9x9EKk2h/q0X285Hm3l+rASCU8BfJKe7T6Ux/Wuwzg6NOcl48nVn0MSSvirqgLqql6ZVNv+lnqvbpuhAtFkNve+k1w72QM/Jt0K6e0jEL1q7am5Zm89WAzXB3RO7uElXAdKfOS71UTL9705ZsFHtrz+ZLJxDMzbO0ukzb/Y4wW/zNL0+chayw3jS0LaqdTupmdvm6RL2sGwsqUH5DbKynrMYG9Zf11zWvTo0DJ90B6Xv0QRpE4Hjv6H387qBFWYKe3En4yBNGeMQBuio0Bz9MeFsxxhMxfZqJUqlCLYAcP4kRifw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=jlzV2EmP1qtPhJ8DoYMKNaP1aQPvRPicklhflKj4VMQ=;
 b=HR9lpvqT+naM0Q5BzaTSPUMUBge0jOyY9awqcS4lMaSsJIqYGh+JkGAV+eYMi3g/cuIiSWlBSMh3rdEMkwsIaXbB5zbGlORO4Ke5tg7AGc4fejs80lYj53ZijOmFEL2QyPFhjGb14AVpH0kxcGL5ZTt24+23uo5S21XiK5TQAYeVtlN70Z4Hl5k2equgpd49UdDr9d+2yrhksFStbB3qIjW38C1D4uYaVY5jlqSDkT4os2kwgOXjyUHe63JVdqtXGTXT42CIg4w3fOjuTh0ekMySJsUD5S330+E+zVq3sOG7Hc3VL5JxE9AY/SIyp5ePMIrNVlLrOyQuk0LOQIcpJQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=jlzV2EmP1qtPhJ8DoYMKNaP1aQPvRPicklhflKj4VMQ=;
 b=aN31WeB7c1GWIP6V73lqEzITXYps60afzTJWxspqh1Z8yogBvW2uyIqLhrInpEzCcGzyufyTr81dqCysclcS5Zz1KV7N3Isc5Y7GJGzDIONkxKHdkytje8Lg7Y/ibOm2HPZ2uWBLhkk+iskMtuxEN8y+/Sb03QRRmLr5WWsH4ZAtNG1HdUAvMrehZj6cVrk83kaTeJIvpOIH4CRbtLF3F89tsPehG9u97Fxx6vy0aB7yKL6nGow0DBh2PoJiOKT+XJSIpVuewvr6T/5fVhu85xBEycN82frIArOqpFVKLp3WCkRtP22k5G61fA4HdPSKUMdlbsFWilFxRSJvwPSLhA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e6fb3b99-d59a-eceb-024a-8b791ef20129@suse.com>
Date: Fri, 7 Jul 2023 08:40:30 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2] x86: make function declarations consistent with
 definitions
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Federico Serafini <federico.serafini@bugseng.com>,
 consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Paul Durrant <paul@xen.org>,
 Tamas K Lengyel <tamas@tklengyel.com>,
 Alexandru Isaila <aisaila@bitdefender.com>,
 Petre Pircalabu <ppircalabu@bitdefender.com>,
 Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <1b2d5be30c0e4f335e59dce6e7c001cb0805d702.1688465215.git.federico.serafini@bugseng.com>
 <a16cdb60-1307-636e-1473-e5388e8f79d9@suse.com>
 <alpine.DEB.2.22.394.2307051604380.761183@ubuntu-linux-20-04-desktop>
 <2c7d71cb-067d-8dac-3ee4-3af42b2756f3@suse.com>
 <alpine.DEB.2.22.394.2307061506560.761183@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307061506560.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0079.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1e::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB7625:EE_
X-MS-Office365-Filtering-Correlation-Id: e4fc0e3d-d9dc-4ea1-8b4b-08db7eb51020
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	unmAbOcxn3RyJJDYgD2wUsdaDXkWF1hJTZwVb+lWBQm9yKGO+ctrdL3S3wWY2Q9KSFIHNqdb6kbY7yGeX64dfxYHCZgjfM9Il2zXEoZ2KzN73wyClYsTKUAw2Ly/k0qcgsOIqO9ofBq8Vt1uZHOFLg7uJpRoGge/j6/wQ54fMQSrdFxwm9374GDWVzvvWzVAKnm62PKnhto96Qv/IBszTiSOh7DOJwdY0WvXWk/Zghi6oganFBXp4YIJ04hW7GmCWn4Zb7Ovb8Fzwu3xIeaS/wsxHbeIuZ5CSPzak2ICGFeYmRTM8jZVjqA4PL7pQHediiruKjGSJUfsT4424oXEYxd6lpfITGKT71qVSJrvNvnvDtC+42SJJbjxi1QQoE0yI87snIYI2+pjZP72V/28Oy/vGLTmZAiATbJi5/PC0zoxZSrxW39Apn9PeUPjDg4qTpsvsS32WHbjhZ2eBWcsOldknAj1IPGfQibbY+alcPImTt2x+hqm8R/QNpooXAcM2QeguAiXy38wmUTcrJO9j63dM/5W3pEtG2o8BSHAM4zGCr/GBl2NMM+qvSUQ7pyAn5kihRXqwWTw+efImUjfS5XsSZESkT7nuIB1j2Qenrm5XvVfaS6+Pg1NXUKKs8WsXZkM028hLBdM0yUPhQxgzQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(396003)(346002)(39860400002)(366004)(376002)(451199021)(31686004)(6486002)(478600001)(54906003)(83380400001)(2616005)(86362001)(31696002)(36756003)(186003)(66946007)(2906002)(53546011)(6506007)(26005)(41300700001)(6512007)(6916009)(38100700002)(5660300002)(4326008)(8676002)(7416002)(8936002)(66556008)(66476007)(316002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TUtwbHpxT3JNbHFqR2xNV3MvcW1HUWZWNDU5OUd4aXZkWDZqaFZhNDhZY3pN?=
 =?utf-8?B?bjh4dU1PSWtSVE9ZYnRxRVRUUnJIZ05vemJYL1ZYRWxVdFA4TlFMZUNLM2pa?=
 =?utf-8?B?bldlaWQwbHRacG5SSWpNNVB6NUZUSVUvajdnOVEwb0JsdWNFWlJPWXo5M0Fw?=
 =?utf-8?B?SHR5a2JNakROaGNVb3owZTc2aFpPZUFDQ0VhWGtSaWt5UTR2V3FrUDh0Ui9C?=
 =?utf-8?B?RmpOSGZWZklwOHpzWU1oVjYvNS9pZjhpTlZwZk5PR2JIOFcyL1NGd1Ziby9R?=
 =?utf-8?B?WHJ4Q24wK09U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 =?utf-8?B?U1VHOEF4eWYveG5yUjVodi8rMXJDRVR5VFRhU1ZBWVdndVBrUUY2TVptWVhJ?=
 =?utf-8?Q?lK33CQMXBgcLKMkWeLe5dOQ5Q?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e4fc0e3d-d9dc-4ea1-8b4b-08db7eb51020
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 06:40:32.9628
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: VA+ZyMKXsf3CSM7b9E3L2MmFUOrCOsTvszJ3faWkQ1+iWpqb/qLvWbJPQILxFLWCooUIHCUA7e+sor71ZYRqaA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7625

On 07.07.2023 00:29, Stefano Stabellini wrote:
> On Thu, 6 Jul 2023, Jan Beulich wrote:
>> On 06.07.2023 01:22, Stefano Stabellini wrote:
>>> On Tue, 4 Jul 2023, Jan Beulich wrote:
>>>> On 04.07.2023 12:23, Federico Serafini wrote:
>>>>> Change mechanically the parameter names and types of function
>>>>> declarations to be consistent with the ones used in the corresponding
>>>>> definitions so as to fix violations of MISRA C:2012 Rule 8.3 ("All
>>>>> declarations of an object or function shall use the same names and type
>>>>> qualifiers") and MISRA C:2012 Rule 8.2 ("Function types shall be in
>>>>> prototype form with named parameters").
>>>>>
>>>>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
>>>>
>>>> On top of my earlier remark (when this was part of a series):
>>>
>>> I am not addressing specifically this comment. I am trying to build a
>>> common understanding on how to do things so that we can go faster in the
>>> future.
>>>
>>> In general, as discussed at Xen Summit, in order to successfully merge
>>> large numbers of changes in the coming weeks we should try to keep
>>> mechanical changes mechanical. Separate non-mechanical changes into
>>> different patches.
>>>
>>> This patch is large but mechanical. If I understand you correctly, you
>>> are asking:
>>> 1) to split the patch into smaller patches
>>> 2) make a couple of non-mechanical changes described below
>>>
>>>
>>> For 1), in my opinion it is not necessary as long as all changes remain
>>> mechanical. If some changes are not mechanical they should be split out.
>>> So if you are asking non-mechanical changes in 2), then 2) should be
>>> split out but everything else could stay in the same patch.
>>>
>>> If you'd still like the patch to be split, OK but then you might want to
>>> suggest exactly how it should be split because it is not obvious: all
>>> changes are similar, local, and mechanical. I for one wouldn't know how
>>> you would like this patch to be split.
>>
>> So I gave a clear reason and guideline how to split: To reduce the Cc
>> list of (because of requiring fewer acks for) individual patches, and
>> to separate (possibly) controversial from non-controversial changes.
>> This then allows "easy" changes to go in quickly.
>>
>> I realize that what may be controversial may not always be obvious,
>> but if in doubt this can be addressed in a v2 by simply omitting such
>> changes after a respective comment was given (see also below).
> 
> So the guideline is to separate by maintainership, e.g.
> x86/arm/common/vpci
> 
> Also separate out anything controversial and/or that receives feedback
> so it is not mechanical/straightforward anymore.
> 
> 
>>> For 2), I would encourage you to consider the advantage of keeping the
>>> changes as-is in this patch, then send out a patch on top the way you
>>> prefer. That is because it costs you more time to describe how you
>>> would like these lines to be changed in English and review the full
>>> patch a second time, than change them yourself and anyone could ack them
>>> (feel free to CC me).
>>>
>>> For clarity: I think it is totally fine that you have better suggestions
>>> on parameter names. I am only pointing out that providing those
>>> suggestions as feedback in an email reply is not a very efficient way to
>>> get it done.
>>
>> What you suggest results in the same code being touched twice to
>> achieve the overall goal (satisfy Misra while at the same time not
>> making the code any worse than it already is). I'd like to avoid this
>> whenever possible, so my preference would be that if the English
>> description isn't clear, then the respective change would best be
>> omitted (and left to be addressed separately).
> 
> Yes, I think that would work. Basically the process could look like
> this:
> 
> - contributor sends out a patch with a number of mechanical changes
> - reviewer spots a couple of things better done differently
> - reviewer replies with "drop this change, I'll do it" no further
>   explanation required
> - in parallel: contributor sends out v2 without those changes for the
>   reviewer to ack
> - in parallel: reviewer sends out his favorite version of the changes
>   for anyone to ack (assuming he is the maintainer)

For this last point, I don't see it needing to happen in parallel.
Reviewers may be busy with other things, and making less mechanical
changes can easily be done a little later. The overall count of
violations is still going to decrease.

Jan

> This should work well with MISRA C because they are a large number of
> changes but each of them very simple, so I really believe it will take
> less time for the maintainer to write a patch than try to explain in
> English and more back and forth.
> 
> I think this is less work for anyone involved. Let's give it a try!



From xen-devel-bounces@lists.xenproject.org Fri Jul 07 06:45:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 06:45:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560184.875887 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHfDI-0003Nu-LL; Fri, 07 Jul 2023 06:45:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560184.875887; Fri, 07 Jul 2023 06:45:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHfDI-0003Nn-Hl; Fri, 07 Jul 2023 06:45:08 +0000
Received: by outflank-mailman (input) for mailman id 560184;
 Fri, 07 Jul 2023 06:45:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ruU0=CZ=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHfDH-0003Mv-Fx
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 06:45:07 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2073.outbound.protection.outlook.com [40.107.7.73])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ceeded80-1c91-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 08:45:06 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8335.eurprd04.prod.outlook.com (2603:10a6:102:1c2::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 06:44:36 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Fri, 7 Jul 2023
 06:44:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ceeded80-1c91-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BipA2udUgxs7lHWnrnpbhY/7CclQICXkmKIZ0r+k8Kje+cE2o5qsmQcJ93YrgsiJPLHWmGcOGHAgcKy+jm/XK17wIOhGnainXEA0vYXmWt+s5IvQijgnAy6/lzbqB3/TgLOX0rPrSt77MkGKclPo+vis+79PpbdO2cy4iHQOBiZG1VgXLL1y2MZcxNp02CMeN52wuDl2zSj+dQz5cnXKfKpeMSMSoWd3+jXKkm6lGS4wmGFtzSORTeZ6Q8XFPEnW919z0IUoo2L13BglSx9ZktmZLk7qbKKPcLq7pmIJloK6lAqhG+8py7TzCVCfYX6GQwsYf84eZTMqKZhvosFvDQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=VZ79/PeRiZAXUpkz5BPKVLnJPRfqrgVQQWfTaOLvyz8=;
 b=HpQc0Etj/qt12e02rMUFh8bD8qR93v0zKjebSFrPvWgDe/qWaYOc1MIFMvMTyAWEr98l8unSElZjYonU2F2RgmcFds1d3l/RFAc/yHAXw/jf6/75vPHqRdTFssdAzdEdbXzpuRQSTeCQBeCBnLTXbrwk+ieVZsfxT2dyU48XvMs5cYChEAPR9uN1HzslW8SVDnBySOxM8xJKwAteac+GvJ4vfBlXT0rZRwYGPEANDDyOM5pzVPU6rjgklOzbd1HGMR4ySRPMDCERuDKrf40MoTIsylnG/f1NobvIJMQRmEJeMbKCiyQL2cc4hMpUI6D9YQ+UpESLKLo7ZQcEn6ZoHQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=VZ79/PeRiZAXUpkz5BPKVLnJPRfqrgVQQWfTaOLvyz8=;
 b=BV05FL65gMIUnEia4b02Zk8ComtkufVU2oUvbFkAEARGkSEVeFrbo7IIzwY9lxQJiyTEZkMy9UAdbXLcSQPVjNoypDRzHFENEQltE/haM7vQU4e9fQWKYDTKxjDdvTXtJn6HCbGwnJI5IX0/TlYP2UVtgs1Pbz7jo561GkR5LYvzrG/PvSmGJoD3U8npxBGPdRW9+z3qw/cHPVGNlfbZa5oZqbO3EgHFOusF2xQUArOGnebazHjd3vvwhaOrvuTQkNcIZnz2H+th/9KX3o0ZrNQe1irpmtd6vlKICNUwQPP9g/B/glJ/WmT7AlinYxZeqWqYmZR7IbHmZyLgC8IGxg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e2eb9324-82d6-a75f-0852-6af6edc92ab9@suse.com>
Date: Fri, 7 Jul 2023 08:44:33 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 07/13] x86/vmx: fix violations of MISRA C:2012 Rule
 7.2
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Simone Ballarin <simone.ballarin@bugseng.com>, consulting@bugseng.com,
 Gianluca Luparini <gianluca.luparini@bugseng.com>,
 Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <f30ef7c2cda2516d9ef07bb79e5da5513cd90c6c.1688559115.git.gianluca.luparini@bugseng.com>
 <f3b6170a-db0d-ef00-b3f8-7deba17b9fe2@suse.com>
 <alpine.DEB.2.22.394.2307061515100.761183@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307061515100.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0106.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9c::18) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8335:EE_
X-MS-Office365-Filtering-Correlation-Id: 1dac6576-9502-4e62-96f2-08db7eb5a0fc
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	T2BTB7TQSQHVCr3SFHeQansWw3f85Z0lePTu2vQLgqCdxsaBGJGbdVcOXqOFQ18yIDniAJrk1mkEtNdQCdzpTBy17cf3mmmgtGbDjYMOwCjzq13mCNNwWg36me8QWzAbNWzG/CzyfOmi9SsxJ1foZArseT30txKSDSF5DZZp8OO5AKoWnQ+HQ/1qpfm4jW+sbgQZYZPOA7Mm6gw/LxXV5pYMGwNsGjfeevmd1Nx8t13BS92a+tBXyXEGIXNMpvpX/SKFQcV5nRmmmspgey++7rbUHgb59hY0lt6JqTODfe54M+NqAMAeeGSJzHnpphOx7y0qK7g978NHzyaL7UooKBEq4R2qaHSdo8FpxuOvH3Kyh+GLiWqdjwN1fvOD3sJzdIM5Sy3L9Z+lq8oD/8A+FQPyh3PdBUtEUJihOf1tD/SNDSFDGClpTKKTz+0IxM7oa5XNz5VFkLOQo+jeJo+/clQLKx/Sr+EmEjU7Mm3Z5omOxXK+MPWqkTucN4nxHjGN7/TfxOe8y77CSvekakfMs1kKVy3P5oJGPePHZ0vZA+SN8Gy/6D18US0MXtQgn35XBHx2UMzSnf+p5VI+VlIJGYGWm1FSxhuAYbZAVNwKt0JDfIu6AQ5PaBCK2vFabgGHOgI+vkRyqLbHUc4+fbKpdw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(346002)(376002)(39860400002)(396003)(366004)(451199021)(54906003)(31696002)(6486002)(478600001)(6512007)(6506007)(26005)(186003)(66946007)(53546011)(2906002)(66476007)(66556008)(4326008)(6916009)(316002)(41300700001)(5660300002)(7416002)(8936002)(38100700002)(36756003)(83380400001)(86362001)(2616005)(8676002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TzQ0Umc5Tm5IWkgyQ0xjL2taa1NGeEo1cE5ZNVQ2bUtORjFETWJNWWxKaFJu?=
 =?utf-8?B?QjRIVS8rcFdwTi8vQktKKzNDSlR1eWZQcnNIV2FaMXY4N0tRaTNoMEF5RzVz?=
 =?utf-8?B?Vko2ME1kZ3o4azhuOEYwMjRIZzN2WThBeHI1K0VGRFlOOWtXeDBuUDl5eTZh?=
 =?utf-8?B?QlE2dGlGdmkwZlRSaUk3NlFYMXpSaUN6U1AxcjUyY3BnZnVhNTIwRkppWVYv?=
 =?utf-8?B?MWozaEg1V28wQXFOVTRLOXpPWE9UZjg1Tys4WXhlWXhwVFdmQzB6S1A4TVFz?=
 =?utf-8?B?OVVoZWJ4VlN1QlpYUzFkU0E2ZHQ3YTNxbytXQWxtS3J5cnVOZlBxNkRZUmVS?=
 =?utf-8?B?Wnk4ZzJRNWtVTTR6MjdhMzc2dHZNZHNEekVhTS80amQ3OVlHb0NUQ05LSUNp?=
 =?utf-8?B?Z2RXTlViUzZDUWFLVFlFb1RxbGVmREVGS3ZBdk9KVGtkazNsV2FaOG9UVTFz?=
 =?utf-8?B?UzgwNm5KaWc3cnhTTTI3Ujhyc1VmZVMwS213UjZpa0doSVRuOGR1aE55ZTU0?=
 =?utf-8?B?SUtSZnkrYTRJVmNB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SEJUUXNtMTBhMW1VUmhpTGxpS0ZM?=
 =?utf-8?B?cXNqOGc5M3VhMTdMK04yalhQdE5kTUJsRklKdnFNUUlmK3FSZG9ZMG9la2xw?=
 =?utf-8?B?MEYyUXJWUFcxbFAyQXppMXJrMnVLNXczNTl2WHVvd3I4ZVp0eG0zcncyUER6?=
 =?utf-8?B?K1hJK2VNOXkxVjFrWWxCeE81RmJjMGY1YmE5dWloQ0EwSmMwbmdUYW9hejQw?=
 =?utf-8?B?UmlSWGE0OUhoUDBnU1RvZ1NOSEdDRGUxV1g5L2h4M2ZUNUYwM0FlR0pGaDVI?=
 =?utf-8?B?OXpIZWEzMnE3RFJ4Y0ZEb0s5dDZkUnR0elFnTVJvazZpblpyeTdGUzVNejhn?=
 =?utf-8?B?cThRZFN1aHQ1ZllXVVBRdHNuSFk2WVBwclhkS1FYb3dSTXh6ZXBHTTJQeWl1?=
 =?utf-8?B?MVlFdlpjQVNOdEtUTVcrQTA5UTJWTTRUeDQ5SktJbVRYcUYyck54QWNidmV6?=
 =?utf-8?B?NndDdU9CS01CSUtNNDBIRDVGdlpoeUplVnQ1NWExeXNXbWVKOFdBb0JZM0s1?=
 =?utf-8?B?YWVvU1FKOGkrby8yZFVBa05TVzh2eUE1RU0wQ2pJNkdlR1NZSCtnR1JWVmxy?=
 =?utf-8?B?RHNSNk5FVFZxaTZZUHpEY3l0TndMVGtDbitCdmJFeEdqWkp3Ti9jNVVBMDhJ?=
 =?utf-8?B?ZE9rbjk4aW9DYTBETFkxNy9LOVh4aWtKVjQ3K3JrNnhUSjNZTU5MRXBqSld2?=
 =?utf-8?Q?KFmCU6Pv9HCGbTI2qNIIXmU5E?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1dac6576-9502-4e62-96f2-08db7eb5a0fc
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 06:44:35.9259
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: OnohQWzZ1P9ue162JMc/nY6/G5iLC4lZwiqYFLoRRxOxk1Wbl6BPTVoCk9bMSVzPGMis6vcmk+YDtFZZtqldZA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8335

On 07.07.2023 00:17, Stefano Stabellini wrote:
> On Thu, 6 Jul 2023, Jan Beulich wrote:
>> On 05.07.2023 17:26, Simone Ballarin wrote:
>>> --- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
>>> +++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
>>> @@ -207,7 +207,7 @@ void vmx_vmcs_reload(struct vcpu *v);
>>>  #define CPU_BASED_ACTIVATE_MSR_BITMAP         0x10000000
>>>  #define CPU_BASED_MONITOR_EXITING             0x20000000
>>>  #define CPU_BASED_PAUSE_EXITING               0x40000000
>>> -#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000
>>> +#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000U
>>
>> Interesting - you don't change adjacent #define-s here, nor ...
>>
>>> @@ -257,7 +257,7 @@ extern u32 vmx_vmentry_control;
>>>  #define SECONDARY_EXEC_XSAVES                   0x00100000
>>>  #define SECONDARY_EXEC_TSC_SCALING              0x02000000
>>>  #define SECONDARY_EXEC_BUS_LOCK_DETECTION       0x40000000
>>> -#define SECONDARY_EXEC_NOTIFY_VM_EXITING        0x80000000
>>> +#define SECONDARY_EXEC_NOTIFY_VM_EXITING        0x80000000U
>>
>> ... here. May I ask why that is? (I'm not opposed, but the
>> description suggests otherwise.)
> 
> Like I wrote in the other email, the requirement is only to add U where
> the top bit is set (0x80000000). Adding U to the other constant is
> optional and for us to decide.

Right, but as said then the description shouldn't suggest things are
being done consistently everywhere. (Likely this is going to become
easy when splitting by maintainership area, by then simply omitting
the respective sentence from the description.)

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 06:50:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 06:50:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560188.875896 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHfIW-0004p6-9Z; Fri, 07 Jul 2023 06:50:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560188.875896; Fri, 07 Jul 2023 06:50:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHfIW-0004oz-6b; Fri, 07 Jul 2023 06:50:32 +0000
Received: by outflank-mailman (input) for mailman id 560188;
 Fri, 07 Jul 2023 06:50:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kjyJ=CZ=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qHfIV-0004ot-Oo
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 06:50:31 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8feb7c99-1c92-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 08:50:30 +0200 (CEST)
Received: from mail-vs1-f47.google.com (mail-vs1-f47.google.com
 [209.85.217.47])
 by support.bugseng.com (Postfix) with ESMTPSA id C25094EE0C8A
 for <xen-devel@lists.xenproject.org>; Fri,  7 Jul 2023 08:50:29 +0200 (CEST)
Received: by mail-vs1-f47.google.com with SMTP id
 ada2fe7eead31-440d1ba5662so444368137.2
 for <xen-devel@lists.xenproject.org>; Thu, 06 Jul 2023 23:50:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8feb7c99-1c92-11ee-b237-6b7b168915f2
X-Gm-Message-State: ABy/qLa6TTUUk7lhm5Tkzw5bQSaor7onN2gw70to/QQkyj4TAq3r/Kku
	JFuDFfwirnX3I0btc4iKnqdS8O6424+skbaBFIk=
X-Google-Smtp-Source: APBJJlEUqloS7arAgvE4VvKY/f3qIKSNai+0lSuTslQ6l8PyeHrZUBWmHGZImZ0a6iZsuLCkJ7R3bVEDKbf6Fmux6rA=
X-Received: by 2002:a67:fdc7:0:b0:444:c7fa:15e6 with SMTP id
 l7-20020a67fdc7000000b00444c7fa15e6mr1633497vsq.9.1688712628641; Thu, 06 Jul
 2023 23:50:28 -0700 (PDT)
MIME-Version: 1.0
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <e414542d76d4a4a0df6ad969cc6332e355d6ef38.1688559115.git.gianluca.luparini@bugseng.com>
 <a343fc97-84df-48e6-1c91-cd933c6e5210@suse.com> <CAFHJcJu=S2JtFJy_XnMhrr0gP7+sPfvrS_1940qzL9rc_j60nA@mail.gmail.com>
 <f93f0561-abea-bdae-223e-d69932e435c4@suse.com>
In-Reply-To: <f93f0561-abea-bdae-223e-d69932e435c4@suse.com>
From: Simone Ballarin <simone.ballarin@bugseng.com>
Date: Fri, 7 Jul 2023 08:50:16 +0200
X-Gmail-Original-Message-ID: <CAFHJcJuP7hH01ZiwNe0HHBM=JpBtsF9sDD7fushyBxDQ9UZicw@mail.gmail.com>
Message-ID: <CAFHJcJuP7hH01ZiwNe0HHBM=JpBtsF9sDD7fushyBxDQ9UZicw@mail.gmail.com>
Subject: Re: [XEN PATCH v2 12/13] xen/x86: fix violations of MISRA C:2012 Rule 7.2
To: Jan Beulich <jbeulich@suse.com>
Cc: consulting@bugseng.com, Gianluca Luparini <gianluca.luparini@bugseng.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Wei Liu <wl@xen.org>, Paul Durrant <paul@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
	Michal Orzel <michal.orzel@amd.com>, Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, 
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="0000000000005ba44a05ffe00cc6"

--0000000000005ba44a05ffe00cc6
Content-Type: text/plain; charset="UTF-8"

Il giorno gio 6 lug 2023 alle ore 18:22 Jan Beulich <jbeulich@suse.com> ha
scritto:

> On 06.07.2023 18:08, Simone Ballarin wrote:
> > Il giorno gio 6 lug 2023 alle ore 10:26 Jan Beulich <jbeulich@suse.com>
> ha
> > scritto:
> >
> >> On 05.07.2023 17:26, Simone Ballarin wrote:
> >>> --- a/xen/arch/x86/apic.c
> >>> +++ b/xen/arch/x86/apic.c
> >>> @@ -1211,7 +1211,7 @@ static void __init calibrate_APIC_clock(void)
> >>>       * Setup the APIC counter to maximum. There is no way the lapic
> >>>       * can underflow in the 100ms detection time frame.
> >>>       */
> >>> -    __setup_APIC_LVTT(0xffffffff);
> >>> +    __setup_APIC_LVTT(0xffffffffU);
> >>
> >> While making the change less mechanical, we want to consider to switch
> >> to ~0 in this and similar cases.
> >>
> >
> > Changing ~0U is more than not mechanical: it is possibly dangerous.
> > The resulting value could be different depending on the architecture,
> > I prefer to not make such kind of changes in a MISRA-related patch.
>
> What do you mean by "depending on the architecture", when this is
> x86-only code _and_ you can check what type parameter the called
> function has?
>
> Jan
>

Ok, I will change these literals in ~0U in the next submission.
-- 
Simone Ballarin, M.Sc.

Field Application Engineer, BUGSENG (https://bugseng.com
<http://bugseng.com>)

--0000000000005ba44a05ffe00cc6
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div dir=3D"ltr"><br></div><br><div class=3D"gmail_qu=
ote"><div dir=3D"ltr" class=3D"gmail_attr">Il giorno gio 6 lug 2023 alle or=
e 18:22 Jan Beulich &lt;<a href=3D"mailto:jbeulich@suse.com">jbeulich@suse.=
com</a>&gt; ha scritto:<br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex">On 06.07.2023 18:08, Simone Ballarin wrote:<br>
&gt; Il giorno gio 6 lug 2023 alle ore 10:26 Jan Beulich &lt;<a href=3D"mai=
lto:jbeulich@suse.com" target=3D"_blank">jbeulich@suse.com</a>&gt; ha<br>
&gt; scritto:<br>
&gt; <br>
&gt;&gt; On 05.07.2023 17:26, Simone Ballarin wrote:<br>
&gt;&gt;&gt; --- a/xen/arch/x86/apic.c<br>
&gt;&gt;&gt; +++ b/xen/arch/x86/apic.c<br>
&gt;&gt;&gt; @@ -1211,7 +1211,7 @@ static void __init calibrate_APIC_clock(=
void)<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0* Setup the APIC counter to maximum.=
 There is no way the lapic<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0* can underflow in the 100ms detecti=
on time frame.<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0*/<br>
&gt;&gt;&gt; -=C2=A0 =C2=A0 __setup_APIC_LVTT(0xffffffff);<br>
&gt;&gt;&gt; +=C2=A0 =C2=A0 __setup_APIC_LVTT(0xffffffffU);<br>
&gt;&gt;<br>
&gt;&gt; While making the change less mechanical, we want to consider to sw=
itch<br>
&gt;&gt; to ~0 in this and similar cases.<br>
&gt;&gt;<br>
&gt; <br>
&gt; Changing ~0U is more than not mechanical: it is possibly dangerous.<br=
>
&gt; The resulting value could be different depending on the architecture,<=
br>
&gt; I prefer to not make such kind of changes in a MISRA-related patch.<br=
>
<br>
What do you mean by &quot;depending on the architecture&quot;, when this is=
<br>
x86-only code _and_ you can check what type parameter the called<br>
function has?<br>
<br>
Jan<br>
</blockquote></div><br clear=3D"all"></div>Ok, I will change these literals=
 in ~0U in the next submission.<br><div><span class=3D"gmail_signature_pref=
ix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"lt=
r">Simone Ballarin, M.Sc.<br><br><div>Field Application Engineer, BUGSENG (=
<a href=3D"http://bugseng.com" target=3D"_blank">https://bugseng.com</a>)</=
div></div></div></div></div>

--0000000000005ba44a05ffe00cc6--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 06:53:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 06:53:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560196.875907 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHfKx-0005Rb-QT; Fri, 07 Jul 2023 06:53:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560196.875907; Fri, 07 Jul 2023 06:53:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHfKx-0005RU-NE; Fri, 07 Jul 2023 06:53:03 +0000
Received: by outflank-mailman (input) for mailman id 560196;
 Fri, 07 Jul 2023 06:53:02 +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 <SRS0=ruU0=CZ=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHfKw-0005RO-Qs
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 06:53:02 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2079.outbound.protection.outlook.com [40.107.7.79])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e982ec46-1c92-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 08:53:00 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8438.eurprd04.prod.outlook.com (2603:10a6:20b:411::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.25; Fri, 7 Jul
 2023 06:52:31 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Fri, 7 Jul 2023
 06:52:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e982ec46-1c92-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=PpJfqU2LNVCzTiFFlOj2P2VMoXcXkIwF281J2Kjr1o7qRPQabobQoQonDvlrYTvkxc8jTBiSMzlUUKkaOv3a0zlDm+7irupnLwejUl9pEQ76eqBN2cXL4N04+HQD3yp+oF0mW2ljeLxSq3q5OTQCKXvqup3WCCOFwW9wU+NQ+kTRdu7KanzkIfT5IppMl/PzN0BnNd7xdg3LR4Sxu2uXyB+sWDyJHCDXJo5IHYo9g9ut9//S7JqbG1N61qN5VeB2hYAg0aVkxDZEsV7lgqUWVkbUkhOqIr9QDcYTKolLwsV++evQa3w3ctcus3CG1VclF+0EnVPnFwz2mstrJGYvaQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=2uasM40HRG7OgJnwBX5gG/lDzbEOH6AcY4QQKmPvDoY=;
 b=NV77b5ckSU7hltv29uQ7L3CGEQ5PbQb9KvZP5r5LzjtLbCI32UXvOju26iKOfuO5B8BQ88rqpywkgLAM+wxh3H435Kiixck+3VmbchfTMWDUQxep+MgGnZdjKJiv9RS9F0+UyCc3brWCgN3qNsKg8tsxgmO/zFZUpw/cO8gQr3gfN3g9bvj6D6r0IIjS7HE3JOQO1MARdIlug6QybKNwSKjbi9PoNRpDF4Slij1a+R2o1JEXTi3Oy+FhnYJM/+d9drwqFeBFLR6xesljnPiNOExUA2tPSWzo7+TignotzMtgENHBprsKdo9nO1zf665DTrwhKrRWkdzNcS2Kvsq6Yg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=2uasM40HRG7OgJnwBX5gG/lDzbEOH6AcY4QQKmPvDoY=;
 b=QdCfY4TWjssxi6/ISc5+m6ZQrtdqAoFhTJg/eAM2oCWphCiO84/1x/mCufOJM9VG8Azuk8n9yv+85txoO5HAdyQp6w2br8fQ3n8w44HzZFZDjbkNxa1dSeOPV3p+kYOd8P+aMbrp44EuzhMApL/pE1qHL5zHa7MNVXkEDZcQnoBCUFpAleqaaLq61YCB1em646yBl93nQQTVoG4V9q95nEdWoVb/9eUIfF6FMoB6nm6rCYqM8wmhJN6WJytqu1e2XnkiYsIXTYU+9o2skU5gRUd7jRmlP0u1/R80/1JKHEbO61BI2/0ayI2r5pM7SEtfTssw/qIArDfwQyQBhIMzEA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <9f2fc7fc-cab6-e14e-6fd3-a2e75d4becfa@suse.com>
Date: Fri, 7 Jul 2023 08:52:28 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH] docs/misra: add Rule 7.4 and 9.4
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: andrew.cooper3@citrix.com, roger.pau@citrix.com, julien@xen.org,
 george.dunlap@citrix.com, bertrand.marquis@arm.com,
 Stefano Stabellini <stefano.stabellini@amd.com>,
 xen-devel@lists.xenproject.org
References: <20230706224619.1092613-1-sstabellini@kernel.org>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230706224619.1092613-1-sstabellini@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0108.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a3::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8438:EE_
X-MS-Office365-Filtering-Correlation-Id: ac356a8e-e1e7-4acd-13e5-08db7eb6bc6e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	HOEN+x1kXsaROBbYEiyIpvmpu1l2kX9iaw2C8zw0nNwk6w720K3DgIxaZHd0vGASpmjGOJVIxc7CJLcq4pcbiuVdQmpPydwGlTA16am9YKWoHG0P9rs9lTInyPA/sj6/4eYmIOFd5MjRthDI77+KE2ZGFmyT3plJJ3DyPOfmK3Xl8Yxt8QaKx8JJ/SJWZuFadeoOFNXA9IXg2MOvkG3oaLSs+9wkU1io85cE+veN6HM6Xao2rl1SGhouEBPsrp9ZgzfSnKj9kPtWmJ66G6AqIfQYfnORN/WKJuyfjLtqB55UmHSXzgTwo5OwiWzy7u0AB5yatf1dk0jiGal52oIj44dkuYIN5L8ZkFq/nzZzzGpag6FT7t+wSvpEFErzVvmOrbcgpDz+bfZ24gaduZcNAAxi49/bMluIh3KhSz1nz57hHQMvpMWDjP2blTx0sx/bHHzM9Eq2hbDO4FgSwd5ZLcHyswlbWaFr1IQlVU5Dgk20EZu7yxgu4BOXcGlOBa6BBXjnISrXWvedckWWl6bR1HuVfOrzk8Xy7vWZcbapoAZ7UxmPdpMjbDE7zzCPOIyUUTiuXTEWQymEFpKVOZyEfBhtAiOJ0IGUGJsdWZZMAGZCBpTcV60Q3XgB3MRQWyMun6CG+Ns35E3VRlNAu4GlkQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(346002)(366004)(136003)(396003)(451199021)(31686004)(2906002)(478600001)(6666004)(6486002)(8676002)(36756003)(8936002)(41300700001)(316002)(6916009)(66946007)(4326008)(66556008)(66476007)(6512007)(83380400001)(38100700002)(31696002)(5660300002)(86362001)(26005)(186003)(2616005)(53546011)(6506007)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?enRGd3NPWmcvQnZHK29rMWlETWNlRmV1dG9VZldxYzIrNFFvRmMwMEZTalM4?=
 =?utf-8?B?aWNIRVRWMU5TUFIydXJhUE5pWGFqZ0dMWUNtUXhSNjd5b3p5WU5OZDRpeit0?=
 =?utf-8?B?QlBKRm9aVXUzYWN3a2RDaDNxbFFNOUQ2WTdGOGh0LzdJcnRvM0RObit0Q1lM?=
 =?utf-8?B?YXp2clVFcDRza2RsZzU0ZjNYaFZEcGNWNWRLREtXQ1VVQ0cxYWk1TmxOQzVE?=
 =?utf-8?B?N05SdzdnVnI3WmVMMjR6U1hLa1VCSWhNb1NsZDV6VmhnT3FkZ3JqSTRrakJG?=
 =?utf-8?B?WkYzZlhEekNRTDFKc0Y0QVhLVm1lcjZKaUt6c3J6bUxGUGttQW9EampYdDdI?=
 =?utf-8?B?dHFQYUhGeTdLV2FXeWNEMVBUbW5MT3d5aU1zeFpyemtLYXozbmpOUTVqaTAv?=
 =?utf-8?B?b2xUVjN6d3NiK213ZDNhd1dYaG1PMUE3MUhkR1BJK2xpY0xuMlBzRWpQNnVP?=
 =?utf-8?B?R2RFdmI3RmNDdFpqYU1veXRlaVY0TzFrQ3phN0txS0JQYy9EckRCN1prdmpQ?=
 =?utf-8?B?Qi9hQnR3YUtaWkJFUmlQb2JRUFV5UFlzZFBGQjlFeHRQd0RWSFkvZERhQS81?=
 =?utf-8?B?dDI5L0RTUno0OD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LzZNWFhad1FJKzZ5ODd4bi9PZ1hJR3pa?=
 =?utf-8?B?LzVCMGxFZVkzWWxFb3QyVE1sUG5JZUxNQ2xKMHNSM2p6MXRvQzBRc3hDbVkr?=
 =?utf-8?B?ZFlRWDFsRU9LMXpCTEFLSmc2Q29wL0V5c0l1MHBacFRDczRCQzJNUWtCR3Bp?=
 =?utf-8?B?WkZpUm8zYW9qMk1iU1FFanl6KzVjTks0WWJCUko1N1Izc2tJQUU1YXB5Q2Fy?=
 =?utf-8?B?RkZoQXRFSnBsL29KOHVyOWhka3hMTXJvVzkxVGVHT0RSbDJpMWFDN0lWU09P?=
 =?utf-8?B?U3NEckIyYjlpMmwxU3owakZ0cXFoQVRZS0h6ZFJ3Z0RzTCt6Q3V0VDFSbS8y?=
 =?utf-8?B?ZjYzMnRYQjdnbkgxSHNHL1RGWGNxRVFUay9QRlVVY2ZPcEhXSlhDK0xxZTRp?=
 =?utf-8?B?NUVwdEVrS3MrNVR3eXgyeG4vNnoxVkExVS9GNm56Q0tTdGlhSnhVY3M2bXAx?=
 =?utf-8?B?OW5iQmlOU0FwbkdVaFUwNnZYdEtWTW0za1ppUHZWQXJBT0g3QWwxWXEyWFBz?=
 =?utf-8?B?NXpyRUpMUHNPYXRCdFRDb2Z2Z0JVL3Z1R3hZZjNEV2JuRmMvQ2I5MWQ2OEFm?=
 =?utf-8?B?M3I1NnFpclhRc3FOMlZuMjVJS1Rrckh4K0Y3Z0M1Y0prTzZ0OGVxS0hzdnB0?=
 =?utf-8?Q?Lv+bmHHw5OoQg7/kgdA+VudQ2?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ac356a8e-e1e7-4acd-13e5-08db7eb6bc6e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 06:52:31.4532
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 58BWa4weSvpM3mpMKQlRo/qcSV04NnUM5EU+22AI/O8vpWhaE7MGFpjfHUZ2wvquRFSsJhcHqkFvvhzG4JL65g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8438

On 07.07.2023 00:46, Stefano Stabellini wrote:
> --- a/docs/misra/rules.rst
> +++ b/docs/misra/rules.rst
> @@ -203,6 +203,13 @@ maintainers if you want to suggest a change.
>       - The lowercase character l shall not be used in a literal suffix
>       -
>  
> +   * - `Rule 7.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_07_04.c>`_
> +     - Required
> +     - A string literal shall not be assigned to an object unless the
> +       objects type is pointer to const-qualified char
> +     - Assigning a string literal to any object with type
> +       "pointer to const-qualified void" is allowed

I guess this is relevant also in a few other cases: Considering the
significant difference between title and actual text of the rule, and
further assuming people looking here won't always pull out the full
doc (they may not even have a copy of it), I think it is important to
also mention in a remark that despite the title all "character types"
are permitted, as long as string element type and character type match.
Since the compiler won't allow mismatches when the lhs type isn't void,
mandating no use of casts to "satisfy" the rule may be a way to express
our intentions.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 06:55:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 06:55:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560200.875917 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHfNY-00062l-5h; Fri, 07 Jul 2023 06:55:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560200.875917; Fri, 07 Jul 2023 06:55:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHfNY-00062e-2z; Fri, 07 Jul 2023 06:55:44 +0000
Received: by outflank-mailman (input) for mailman id 560200;
 Fri, 07 Jul 2023 06:55:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ruU0=CZ=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHfNW-00062X-Na
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 06:55:42 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2081.outbound.protection.outlook.com [40.107.13.81])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 497e1775-1c93-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 08:55:41 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8438.eurprd04.prod.outlook.com (2603:10a6:20b:411::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.25; Fri, 7 Jul
 2023 06:55:13 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Fri, 7 Jul 2023
 06:55:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 497e1775-1c93-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=aCtmwm2qZUFdbmb1OXER85oXNZOLtYaAShYh2xWO857xFudKuAvU0ydd8NdHE+XAsBa2j9oIyIblSZDWg0967EpaabbR+Vtg7XLvQcsEJUT7xaO9kjShfFim3StHxIBXWgf+ZMMqHE1DK/6UWI7TCnxEfBVddeH+cOmicNokqkjpU49gprJtLcv84HncjBF4H9tWKipbZHapBMcV0A0E6p0+j+McH+pQMRR5fMShumOooMFY/FOzryvysNsBDyqQ/Pl9nW3RDevpHdxcCLxej7qEEh5PhxDyHiBB1ll1lIb/Rgwy0BcJ9XjckFAjuC8Oo4J38hocQjWyLgnLkrA18A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=RC9FUMPb8U9Jd2Y6LVs5c9vDP5pikuKs56K0UrSB1s0=;
 b=Tt7juuAb8M4cl+Qz9Fxht3Ghrr6wEqWWDeER9L1pW2IYt/Ozp7Q9Q2OCToFq/e4KvTf9wrOQ+e7WA/tBs6ASNb4cJz+r69eDsaM3lonm6p3Haqm18pO58CVG5jc6621YFrQgN53rLOm9wDs1ndHufJFrBbfvhOesosis450ziLFo4phpqgY4mqIilnFmJszKXd2fdqiAfPJff12ikF4HpmQrxIp5Xzo7RPcfp8PSIN5c8IjSCeypklfyZapmIN0KZOB2ds4KsCYKOjqWfJXUaSPCQVMx6iSXtgyuq5ptnTm0l62x7W7aO6MRkbOH3MVn5O1lXuJZsaf7cyOhLnbY2A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RC9FUMPb8U9Jd2Y6LVs5c9vDP5pikuKs56K0UrSB1s0=;
 b=0U+ufEH/eCW8st456DZ0mtct911b9p/r7erx3CdxYghpkjq1TV2GXbqjB6eUaXLp7d8Fbj2ucCBI4sXeG+ajicN+uNe69uh15FvhgRRBH/6XltR55vskDFMl6MvNxw5YaOYF/HzfkHhQhiFIy/0JqH9ccCXtH1L+lzcRnwHBE45Tf9QOnovYWj7WuLR5GAJT8+4bGOvSYke4wV8r+as6ZcN8Uo81MePhnUYdb4MIiv3L0hb4iZu12R/poe0/5v0EdOqz3qptzNfE9s5xqqexCTs0/8ohtz8HrNeymQQG07Aw+/JYcg1iBOkdARoKTBTUFeJAFmslFSuOkhYY5+qhUg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3ab542ff-9145-d989-2ec1-3d01168902a5@suse.com>
Date: Fri, 7 Jul 2023 08:55:10 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 1/3] xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig
 option
Content-Language: en-US
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: Rahul Singh <rahul.singh@arm.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Artem Mygaiev <artem_mygaiev@epam.com>,
 Stefano Stabellini <stefano.stabellini@amd.com>,
 xen-devel@lists.xenproject.org
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-2-stewart.hildebrand@amd.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230707014754.51333-2-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0142.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:98::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8438:EE_
X-MS-Office365-Filtering-Correlation-Id: f11a7b03-6084-4e9b-a395-08db7eb71cbf
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Suxgr35xsHXOzfPZ0AHKGmVqgKiiMJrYEoBm/X2Vnsi7MwZVOZwIV7Ne3x/5YfGsoREtA2a3zbhaqs/Rj71w7LZPEoF8o44rAqCt5hLFhTncbVY8Vom+S19HTrmzF8WadJGNv11SIo9saf6SqYKPhaGebnWYlNfM9NgxrTWDcFkNJYKncGVvhh0z5Tjjpacci+SFI3OwajVV1J2qYBGhFyD/Dxkpweb4ST4kjjxmuwqGg5gwf840EVv1imvDQhfjgbPpSirQd/1NIVtUo3aWO8S0UF8Wechr+JonAFMvRz1lY05klAXjvsiQ8SuTP1EUu3gkp4xfzlfmx8F6TfNmype/SNXHV0mrTFD2DwmG24rc7h7YxI4WIx0lMttD6KMGIVEfT+IYRWGdYqchPAoJBvpAnbfLP0leNp53OwFgYGLTTTdEd29WOUzmUBs3RuMFDcbKus7jq81xkKk7jE9icsgI+4YcVY7+kWGuNuAscpPpsz2ea9o7kXgYji8o15APuE3bXYw9FWML3Pw5ZNPBtuzizUftNZB/80R3v/vEjazk3dLZcTEI0FC/nzd+xu2/NHWdiPgUCu8z4WJ3bewttNY2a/0mQqkIWZc69VkDjfMbeDGrvJ6uslKPPdClxG13PAmGwGI1O8ahLcZ5+CsDmQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(346002)(366004)(136003)(396003)(451199021)(31686004)(2906002)(54906003)(478600001)(6486002)(8676002)(4744005)(36756003)(7416002)(8936002)(41300700001)(316002)(6916009)(66946007)(4326008)(66556008)(66476007)(6512007)(38100700002)(31696002)(5660300002)(86362001)(26005)(186003)(2616005)(53546011)(6506007)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NFdWUVVORmpWaWE1YTJhUk9ScE9Lbmd0SFRLdXZLK0orS1EreEtQOXQvVWRW?=
 =?utf-8?B?QkQyVVVnVDVHd2UzbHZRYzMzSlQycHJQVzlHVm91RHpycVhtREhwa1ljeXJ6?=
 =?utf-8?B?NjRqWC9WbTdtWnNzRFhOUkZweEtjSTcvejFQcVBpemxBRDRkd2dJMVBnVmI3?=
 =?utf-8?B?ZzdmTFhVRDJqalpWSWV3aUR4aXJ4U1pSckxZcmxKZm83bzFnaHMwcThLcURH?=
 =?utf-8?B?cUJ1c01xaW1tajdubHphV3Jna2xVTmVUOHVKS3oyd2RsSm9oOTBCM0lqQWxZ?=
 =?utf-8?B?bm9NRFNMZHhmZUl2VzY1dWlHejh1ODAzOE9acUw1VWYvbzRweHdmdllNd3hY?=
 =?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f-8?Q?DPDcZRcAF65iuhf233ooNIIrb?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f11a7b03-6084-4e9b-a395-08db7eb71cbf
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 06:55:13.2402
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: gxJCN5WhQk3ZmSp/my9rk0mn/pothlhUNsReN7BOwCmFAqzTpyECLlJD5LxL/fMs8S3tjIKTm+XHKaQn3Tbjkg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8438

On 07.07.2023 03:47, Stewart Hildebrand wrote:
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -190,6 +190,15 @@ config STATIC_SHM
>  	help
>  	  This option enables statically shared memory on a dom0less system.
>  
> +config PCI_PASSTHROUGH
> +	bool "PCI passthrough" if EXPERT
> +	depends on ARM_64
> +	select HAS_PCI
> +	select HAS_VPCI
> +	default n

No need for this line - that's what the tool does by default anyway.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 06:59:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 06:59:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560204.875927 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHfRL-0006dI-MR; Fri, 07 Jul 2023 06:59:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560204.875927; Fri, 07 Jul 2023 06:59:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHfRL-0006dB-II; Fri, 07 Jul 2023 06:59:39 +0000
Received: by outflank-mailman (input) for mailman id 560204;
 Fri, 07 Jul 2023 06:59:38 +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 <SRS0=ruU0=CZ=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHfRK-0006cx-HE
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 06:59:38 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20618.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::618])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d583b3d5-1c93-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 08:59:36 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DUZPR04MB9945.eurprd04.prod.outlook.com (2603:10a6:10:4d8::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 06:59:35 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Fri, 7 Jul 2023
 06:59:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d583b3d5-1c93-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Wg/rBwXiCwemsElsn7zM0B9WtWoNga+nMrPjo+tFzCFWVxpHQobm+SlGB3T+hpmcqy2FmLxEsPDaueVdMnD8sV+HCgxg8BHpHovl8l/mQZpCQmkTeq2c/qWLBDgmgoRD4wWnLEwLjmAD885RZOcHTeRJpEMECJsO7+5Ttdh3S67RNfZzhr95gY8FocctiPua0doX6x9aqd9tywGSPn66mCjC82ukVAiyxv1Dxfljl9UtOxp9Ya4JsgNRVwCXMTdajNin4N4bVsd4DGCSxSY2mAMJC1MhqFfMLJ+KjfLiYcVePAOaQcwQsJWw2ZqGq0KBQvav2RNP1RyLNL/vq+rCtw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0Fg3SKqBpgFnJHUM+u1c6ukisHCJk5yv3+LVL97goiE=;
 b=EYbgMcKhHIyFPxe4C54v9iMJAW1M5jKCwTGDd/s6MUf9vcvsYM05Ax8TOZBFGB9XCTtLLdcamH3GnwxzHl/EvIhBYvKqVLsSjpHtRgQpp5kuurCmqYtap8kID7XsEmYYKXKL4cmUUtBtF/Yt6f1/OBUs5LdloYYBN+dSP5k3Nxw/ZW9CijhAE8AXnY5nMgW8dJE6X9WcEaKIy8m5935DK0LQJLYwkwm+KZ/xxmq5EJzs/VFBp0Y3fnc3/bwbdiiFEA+UeZ/AyeeIMFfh9KxapKJFnojpXfHftWZpvpD2jzx4y4aw3IwcxFO2YLghJg84qW6lrvMlC4FHfDiLThXWBw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0Fg3SKqBpgFnJHUM+u1c6ukisHCJk5yv3+LVL97goiE=;
 b=UAQ+s0D2FJ6OMveARfzvfwmFwoxpVLZH/mFwmgkHRG38Cs3h6aRDcuEyo2XoT6AUGjp3ii3vtsTsO09q40kamYIPmvXjhfxnnNir2yaIT01l4uGbR+/Y7LX6wIPLuJ6Gd8sdkjUROWUswtsKEl5OkS9zKVA6BXK9zJTpa3U50NFkl70bWQFCzCocmEDmyht/Bnqt4Uf8FJv5I8QI3MjAXzxlE8K7w8clgm+1Y8H6y/8Kti/kQLnXE4UGWgD2eNknzPWG98Eyr3Q2H95efz4BIRMbc2sswUJuwQoNNUDyNqBUzfUzCSx2wPFsFx5xZ7Y9xLnIHGTGoQ3uKIHFXz5iOw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <0dcbc190-2719-6c1d-55d1-4b229dc32e05@suse.com>
Date: Fri, 7 Jul 2023 08:59:32 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 2/3] xen/arm: make has_vpci depend on CONFIG_HAS_VPCI
Content-Language: en-US
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Artem Mygaiev <artem_mygaiev@epam.com>, Rahul Singh <rahul.singh@arm.com>,
 xen-devel@lists.xenproject.org
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-3-stewart.hildebrand@amd.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230707014754.51333-3-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0002.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:15::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DUZPR04MB9945:EE_
X-MS-Office365-Filtering-Correlation-Id: cb1f2521-8474-44e2-6c54-08db7eb7b8e2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	qd3N1DGuBaJfX0FPKI8nK/fVZDaw6Qs25H1XMCvAFQmeVY1zQqN6gbzNN9PrbEFbLbKEtj8C023CgeqzBiRX/6HmmpS72cw2Q4x7XcZU0KYq/6Krw586ZHvFjUz6C3f6qdxrXZHpbSIxBsCUgwsQ+HWYSumZL3zextl4oDQ1pXrx1j+If5kssJvqau8X+vixUjTzm/lNtLOq+PZdOAk3q2ZcvxarTo8uV8X516C7fmQW5QLT+b3WtOv41UyRZXGPfg/lla7aDV/cHDfLdIrlf+j76E6vhA6n8MY3JfhLK0dMZ870jgpe2yKiAdpznRvVxi1z4aNJ5nRmSRX1fAyvmaEW/XDtlMa40lLmN/HRR6HT/EQaE6rQWc4sMlLM94s/n5OOIZupwMkUFAt+ugOu8pnjlmkzrXZsEk0sd5/ptdoyS0Nxqi5LfbXL1J+5BDzq8BqhufmWnhsblEBAE/INH3mi8z9oZZVqENB93hO2rDPL7bOuNDhSS+4ZkQEZ/wX+wqim5DuWx/ybahdDLfiyqc/d2MQ4vSzzguBaZRMa08T8bnDvvRwIQviVJCrnrJ2AMe7aAswIn5jR+KSUr5f7nwUajVZnmakptkDwyfpAXX4y3NYF+uws7T/j1GbQiYhkM4e3I2cgaKadYW/N1UZPcA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(136003)(366004)(39860400002)(376002)(451199021)(66476007)(41300700001)(4744005)(6512007)(478600001)(54906003)(86362001)(31696002)(38100700002)(6486002)(316002)(6666004)(66946007)(66556008)(4326008)(6916009)(83380400001)(36756003)(8676002)(2906002)(8936002)(2616005)(5660300002)(31686004)(7416002)(53546011)(186003)(6506007)(26005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NUEwOFkvNHFnRWxGQ2FZN05wZXU3VkhJUzZESmF4L29rcUVINFpmbEVwQVNs?=
 =?utf-8?B?dnhZcGs4Z2tweG9VSW5JaDFvMmE0K2VYU1RrOFlNdU1FSHdGRkhkVU11VVly?=
 =?utf-8?B?QmtYdHp0YjhvbDhDVFR4ekoweDFqYVUxMTk2ejB0QjNvOXRBSU5VUzdjcUlZ?=
 =?utf-8?B?ZDFlK0ZoblYweHQyUWloRkJPRGhIUlcxK1NqK2cvWWpYTGFsS2VhQjhWbWdX?=
 =?utf-8?B?bUZ1YThqc0JKcVpNcmtTUWtRcVgrd2tEc2g3Nm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y2FFOXVRUFB1OTNFRU9NWXlMNmUyaFRSUnRwZjdISTd0?=
 =?utf-8?B?dDdIYVhXVW1MS1BwL2ZkTTA0bk5jNWlsb0VscUZXTFBqK05BZWRGMnJzMGwv?=
 =?utf-8?Q?P9+qW08Mb00xjvonyi/J2bwTI?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: cb1f2521-8474-44e2-6c54-08db7eb7b8e2
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 06:59:34.9955
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Bs8MuUUvUm1b5BkX9CKaFp9p+CN3nJ9rb4fjBYG7fuUzGdTuN9sX//VS3iirDke6V3AqQ/pjEnlTm98t07YG/g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DUZPR04MB9945

On 07.07.2023 03:47, Stewart Hildebrand wrote:
> --- a/xen/arch/arm/include/asm/domain.h
> +++ b/xen/arch/arm/include/asm/domain.h
> @@ -298,8 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
>  
>  #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag)
>  
> -/* vPCI is not available on Arm */
> -#define has_vpci(d)    ({ (void)(d); false; })
> +#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); })

While likely not much of a problem here, I think we should strive to
write macros such that their arguments are evaluated exactly once in
all cases (for side effects to occur exactly once). When that's not
easily possible, so be it, but here it doesn't look problematic to
swap both sides of the &&.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 07:04:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 07:04:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560210.875937 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHfVj-0008Bo-Ax; Fri, 07 Jul 2023 07:04:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560210.875937; Fri, 07 Jul 2023 07:04:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHfVj-0008Bh-7x; Fri, 07 Jul 2023 07:04:11 +0000
Received: by outflank-mailman (input) for mailman id 560210;
 Fri, 07 Jul 2023 07:04:10 +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 <SRS0=VdXt=CZ=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qHfVi-0008Bb-Qg
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 07:04:10 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7781d64d-1c94-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 09:04:08 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id C05D322769;
 Fri,  7 Jul 2023 07:04:07 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8D7C11346D;
 Fri,  7 Jul 2023 07:04:07 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id Ce8BIee4p2RuEgAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 07 Jul 2023 07:04:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7781d64d-1c94-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688713447; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=IoXUdX2e04LIweNsF6ClZzH9OgFHRhsLNVP6tEmGsWw=;
	b=qgj18C6+XUBNbQSQicOsnWh+9bRj30U8erf+D3FpJUmC6PQnZMuGX03Iprb60qfdNmKKbS
	Smvsqboihr9JBPuxUmd8yi6XJmVitlEyqiE9PBRJbHVhUFm3VvTL9+9sQcCHP4skXuXTvz
	0yb11ddJKsxBDR+pPa19qjWHK8H0RIo=
Message-ID: <f1a81ac1-5b9a-6d19-1a11-b98685bd2430@suse.com>
Date: Fri, 7 Jul 2023 09:04:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
Cc: Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
In-Reply-To: <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------oFLmLR3jxUNfFSepkKTBAW4N"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------oFLmLR3jxUNfFSepkKTBAW4N
Content-Type: multipart/mixed; boundary="------------ztc028cfnLYtqIaXIzboLI09";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
Cc: Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Message-ID: <f1a81ac1-5b9a-6d19-1a11-b98685bd2430@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>

--------------ztc028cfnLYtqIaXIzboLI09
Content-Type: multipart/mixed; boundary="------------IZPK5gmaQ5zbpEG6t0uvm0MA"

--------------IZPK5gmaQ5zbpEG6t0uvm0MA
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

UmUtcmVhZGluZyB0aGUgd2hvbGUgdGhyZWFkIGFnYWluIC4uLg0KDQpPbiAyOS4wNi4yMyAw
MzowMCwgU3RlZmFubyBTdGFiZWxsaW5pIHdyb3RlOg0KPiBPbiBXZWQsIDIxIEp1biAyMDIz
LCBPbGVrc2FuZHIgVHlzaGNoZW5rbyB3cm90ZToNCj4+IE9uIDIxLjA2LjIzIDE2OjEyLCBQ
ZXRyIFBhdmx1IHdyb3RlOg0KPj4NCj4+DQo+PiBIZWxsbyBQZXRyDQo+Pg0KPj4NCj4+PiBX
aGVuIGF0dGVtcHRpbmcgdG8gcnVuIFhlbiBvbiBhIFFFTVUvS1ZNIHZpcnR1YWwgbWFjaGlu
ZSB3aXRoIHZpcnRpbw0KPj4+IGRldmljZXMgKGFsbCB4ODZfNjQpLCBkb20wIHRyaWVzIHRv
IGVzdGFibGlzaCBhIGdyYW50IGZvciBpdHNlbGYgd2hpY2gNCj4+PiBldmVudHVhbGx5IHJl
c3VsdHMgaW4gYSBoYW5nIGR1cmluZyB0aGUgYm9vdC4NCj4+Pg0KPj4+IFRoZSBiYWNrdHJh
Y2UgbG9va3MgYXMgZm9sbG93cywgdGhlIHdoaWxlIGxvb3AgaW4gX19zZW5kX2NvbnRyb2xf
bXNnKCkNCj4+PiBtYWtlcyBubyBwcm9ncmVzczoNCj4+Pg0KPj4+ICAgICAjMCAgdmlydHF1
ZXVlX2dldF9idWZfY3R4IChfdnE9X3ZxQGVudHJ5PTB4ZmZmZjg4OD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SB3YW50IHZpcnRpbyBkZXZpY2UgcGFzc3Rocm91Z2gsIHlvdSBzaG91bGRuJ3QgdXNlIGEg
a2VybmVsDQpidWlsdCB3aXRoIENPTkZJR19YRU5fVklSVElPX0ZPUkNFX0dSQU5ULg0KDQpB
bmQgc3VwcG9ydGluZyBwYXNzaW5nIHRocm91Z2ggdmlydGlvIGRldmljZXMgb2YgdGhlIGhv
c3QgdG8gcHYtZG9tVXMgaXMNCmEgc2VjdXJpdHkgcmlzayBhbnl3YXkuDQoNCldlIF9jb3Vs
ZF8gZHJvcCB0aGUgcmVxdWlyZW1lbnQgb2YgdGhlIGJhY2tlbmQgbmVlZGluZyB0byBzZXQN
ClZJUlRJT19GX0FDQ0VTU19QTEFURk9STSBmb3IgUFYgZ3Vlc3RzIGFuZCBhbGxvdyBncmFu
dC1sZXNzIHZpcnRpbw0KaGFuZGxpbmcgZm9yIGFsbCBndWVzdHMuIEZvciB0aGlzIHRvIHdv
cmsgeGVuX3ZpcnRpb19yZXN0cmljdGVkX21lbV9hY2MoKQ0Kd291bGQgbmVlZCB0byBjaGVj
ayBmb3IgVklSVElPX0ZfQUNDRVNTX1BMQVRGT1JNIGFuZCByZXR1cm4gdHJ1ZSBpZiBzZXQu
DQpNYXliZSB3ZSdkIHdhbnQgdG8gZW5hYmxlIHRoYXQgcG9zc2liaWxpdHkgdmlhIGEgYm9v
dCBwYXJhbWV0ZXI/DQoNCg0KSnVlcmdlbg0K
--------------IZPK5gmaQ5zbpEG6t0uvm0MA
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3o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5h88NEawQsaNRpNSrcfbFmAg987ATQRTjHAWAQgAyzH6
AOODMBjgfWE9VeCgsrwH3exNAU32gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------IZPK5gmaQ5zbpEG6t0uvm0MA--

--------------ztc028cfnLYtqIaXIzboLI09--

--------------oFLmLR3jxUNfFSepkKTBAW4N
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSnuOcFAwAAAAAACgkQsN6d1ii/Ey/X
8Af+NwPpz0TB3BM1z5Djv0L7plCw3hMXblF/noHfYWfPB22y0jQ7088bwHnCXHGL8nK/2uhttXlQ
fdBYuMX43o0c8pDbLdnSmRr2q55GUG0/30Ej6NoSocxVVjt5vbvXjzxrsA5w4CWI2y4YNzfsknc/
avK33PlfZnsVyfLYG6QTKhfQdiWZel394vy2uaBsw1r7k/gXPXZDOXBqL6VI3bc7m446bp5/MNFA
MiLYFAAsmmo3O91dS4hkV5rzvkjUDJmhGVbbH2p2FrvXZkTBGqBm8ZHHGyY/1U4Bua/uKrvyZBlZ
pKvJLWViGPiuH1gMRR+FTDgCNMx3lYEFDioav7Smng==
=/3nz
-----END PGP SIGNATURE-----

--------------oFLmLR3jxUNfFSepkKTBAW4N--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 07:04:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 07:04:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560211.875946 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHfW9-0000DO-Io; Fri, 07 Jul 2023 07:04:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560211.875946; Fri, 07 Jul 2023 07:04:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHfW9-0000DH-G4; Fri, 07 Jul 2023 07:04:37 +0000
Received: by outflank-mailman (input) for mailman id 560211;
 Fri, 07 Jul 2023 07:04:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ruU0=CZ=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHfW8-0000Bi-R0
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 07:04:36 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2087.outbound.protection.outlook.com [40.107.7.87])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 87d3e035-1c94-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 09:04:35 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DUZPR04MB9945.eurprd04.prod.outlook.com (2603:10a6:10:4d8::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 07:04:07 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Fri, 7 Jul 2023
 07:04:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 87d3e035-1c94-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=HoWf2a6FGDWTEcrvg5rJ4Fyan3EVxxIms/2yMBNxvWrIP4F0aW5x+T44ZTYvG7uGXvjvVUQivIjOmqXg3GJH33JVn1aaC1BcLpKaBEVTRXXcP5QXNEwADGVdSHC2np55z2miBSJj7UHcewh7T7wsGlUV4cH2EQxp9Xs72O5hdR6DB1dv9+0UxDeE7ZnP2CBoJ1jk5bar6yn+OwsnYguDgn3qjoMRqpAJNbWw3/qrgSlcwG7TMFOEyRPsRZVbYIICq+/ZZMq1ONrQdnJmJCHpsAt5gLWTrC+1a9g+UVU2tkKZWu6uH7IgXiejPgn6G5UGlcCeNlS4oOp9wtHXd1ci9w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ujUusuhvPdDFcgfLM/kUUf9W850npxb8SCXzCPUx2E8=;
 b=jitvkaAtY0MHyej+YmfkocWztzuR+/1szYyV/hK9H+v6i9f7w/JYayLsOOAvEyLiaFE3YMNzHcBZr8agIwe+aDURsX2GkM7HPG8ljK8hDoWLPAMn9YWrG5COjJhq9J1TF4GeFvdXBu6nNKzTQqb/q3MPOCkQUOdvOivdxP2LeibXq2LqV337xnoaig2NKC8i+SeBYaU24any+yAL0GSGtahzUwHef89D9J8Zr4IytQKIJ1C/4hkF1kYor9CvzoImYh7XIKT1Fq2NFsXtAEMSVD9ae76gure6CiHzagYPYnAWd9CeMXJVxBL+h7dahNsFxyYwNXRsRX/6kmdLLRBiwQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ujUusuhvPdDFcgfLM/kUUf9W850npxb8SCXzCPUx2E8=;
 b=VNWzbNy+HRV0rYW38wnJ6zgdwbAYR7o9iEGXLXqmd/oyxPZjiBuTg6S7F9/9DnUtTA+lakC0y9MlnGLNcKwFUGWoykUectkxTi5jzqnAo+weX6MzwZfvcNOWsLmF46F8Zvyf+bugmimXLmEFCQZzdiv5ehIS93K0mv6eoJzjgQy+k1ag4vwHVOrVH0wKOptsVnFLp04IBe+n6otTXgWYJFs7j2zATM/yQJjaeWAJMFjXur/9YfsgEbW+RoN12PMjxZnc7jduWjryLyaR1uP/TzO4VHZ13sKrtRA3I9e1fP29IPoCf5wVvaYuYM8pAYtPIWN7yObd7PmLsk+Qb84mjw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <fb29cca6-454c-82ed-b6a8-ac9814f81cfa@suse.com>
Date: Fri, 7 Jul 2023 09:04:04 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 12/13] xen/x86: fix violations of MISRA C:2012 Rule
 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Paul Durrant <paul@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <e414542d76d4a4a0df6ad969cc6332e355d6ef38.1688559115.git.gianluca.luparini@bugseng.com>
 <a343fc97-84df-48e6-1c91-cd933c6e5210@suse.com>
 <CAFHJcJu=S2JtFJy_XnMhrr0gP7+sPfvrS_1940qzL9rc_j60nA@mail.gmail.com>
 <f93f0561-abea-bdae-223e-d69932e435c4@suse.com>
 <CAFHJcJuP7hH01ZiwNe0HHBM=JpBtsF9sDD7fushyBxDQ9UZicw@mail.gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <CAFHJcJuP7hH01ZiwNe0HHBM=JpBtsF9sDD7fushyBxDQ9UZicw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0106.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a3::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DUZPR04MB9945:EE_
X-MS-Office365-Filtering-Correlation-Id: 378649de-1f3c-4796-2e8a-08db7eb85afd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	2sWdYZ3eXoUuNchD0vaBMo153+KriiIaUhnsyiETtXFynJdxFnvK6Ij5oRIMJELQR8URI1N7wJUj4CgXTefCODexcEzMwt7TKZ7phH7ROzrUGEBetOLdvBXpvMANNA2nXTHBcfcw5X2sMMXzwpqv7lGdwb5w6liyCLgQJ6wKAS793pksrvZqDzqIxsAPru+XIzZcHKtAMpZFbaP30ZjhAonG2KKiCEQrPfOwCyuHzrlApqJgRkxpnI4b5UwMw95nl48KHdiP/rmbeZ+h+zthoIII9kU0WITWZ/GsO4jb5olYBfxTFfiLl1XQj3sG8usSU0+sDTSYZPVuYSfv1m3gXU1sD53lViS+xGJxlZC4N6actFUTe21f6ThA0wRDtqtIc5bL9fRMDrqx7PkeSWCU6u3inyCoZSfmfT6kGDYtsHZnMkEAB0Jom5koUNURwUzAd0VY6yI6Ymm869MXOhy4XB7QSioxPOcDDt06ku5At5fQUbmzY4tC7hTQLujCFuR88niTrivFHp+F+uMAz7IXZOdT90ron1n8Yjm9Ex1hA9pOyPhyPsOl5dVqQ3cTcaHxStAJUr4JNL/bQVnLGYTXXVCYyRqEfvMAj3y2uPJ1LNnxMesdj611QT8xAjLfs2D2HhxQXjX6Yn1vDcW30MaTuQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(136003)(366004)(39860400002)(376002)(451199021)(66476007)(41300700001)(6512007)(478600001)(54906003)(86362001)(31696002)(38100700002)(6486002)(316002)(6666004)(66946007)(66556008)(4326008)(6916009)(83380400001)(36756003)(8676002)(2906002)(8936002)(2616005)(5660300002)(31686004)(7416002)(53546011)(186003)(6506007)(26005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YjVodlpRdGRBNS9NN0dZcllTTzYzSzVCVFZKSVdXeGhkY1dIajZ6dCtDdmJM?=
 =?utf-8?B?bE14ZnBiTVlzTE9obkY2MmVlS2c3djJrZi9xUFAyUTN0MjZweCtzbFIvRU4z?=
 =?utf-8?B?Qk9iSW1mQ1hqbGhPRXRHdndwWGtJbUlUdXRLanNKRkVnNWx0V0M5K2c4WXgv?=
 =?utf-8?B?SmgxUnhpdHdFeFJVSklkOUUvZWRNOHE3Q2U5cVlMQVo0OC9xb1BpUGYxRll5?=
 =?utf-8?B?OUVwZ1ZVMWhBd0hqQnVKbkxpNERveUpKbXFJcWNJSkZPR01jemxadENGelFo?=
 =?utf-8?B?NVpTODNvZHJOTlBLZ1IzbEg0T1FxZjZtTThVTFhXVWNaVG1sS3VackVEdUxq?=
 =?utf-8?B?NmRKTWVTMS9MZjdjYnRmS0JzSE1rc2lZd2hiMUtQVUp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EFFImHgRXN75GT5PhldNld6Xa?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 378649de-1f3c-4796-2e8a-08db7eb85afd
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 07:04:06.9670
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 0plDgPPIL4N/h7OdOlYqt+JeB8iw5Ow8/5FdEyoVLFYFB/C6FMs7ltpRrYe3q7dP1ixXRnQlqDfs3KIWaFUGGQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DUZPR04MB9945

On 07.07.2023 08:50, Simone Ballarin wrote:
> Il giorno gio 6 lug 2023 alle ore 18:22 Jan Beulich <jbeulich@suse.com> ha
> scritto:
> 
>> On 06.07.2023 18:08, Simone Ballarin wrote:
>>> Il giorno gio 6 lug 2023 alle ore 10:26 Jan Beulich <jbeulich@suse.com>
>> ha
>>> scritto:
>>>
>>>> On 05.07.2023 17:26, Simone Ballarin wrote:
>>>>> --- a/xen/arch/x86/apic.c
>>>>> +++ b/xen/arch/x86/apic.c
>>>>> @@ -1211,7 +1211,7 @@ static void __init calibrate_APIC_clock(void)
>>>>>       * Setup the APIC counter to maximum. There is no way the lapic
>>>>>       * can underflow in the 100ms detection time frame.
>>>>>       */
>>>>> -    __setup_APIC_LVTT(0xffffffff);
>>>>> +    __setup_APIC_LVTT(0xffffffffU);
>>>>
>>>> While making the change less mechanical, we want to consider to switch
>>>> to ~0 in this and similar cases.
>>>>
>>>
>>> Changing ~0U is more than not mechanical: it is possibly dangerous.
>>> The resulting value could be different depending on the architecture,
>>> I prefer to not make such kind of changes in a MISRA-related patch.
>>
>> What do you mean by "depending on the architecture", when this is
>> x86-only code _and_ you can check what type parameter the called
>> function has?
> 
> Ok, I will change these literals in ~0U in the next submission.

Except that I specifically meant ~0, not ~0U. We mean "maximum value"
here, and at the call site it doesn't matter how wide the function
parameter's type is. If it was 64-bit, ~0U would not do what is wanted.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 07:23:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 07:23:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560226.875980 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHfnx-00035k-C8; Fri, 07 Jul 2023 07:23:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560226.875980; Fri, 07 Jul 2023 07:23:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHfnx-00035d-99; Fri, 07 Jul 2023 07:23:01 +0000
Received: by outflank-mailman (input) for mailman id 560226;
 Fri, 07 Jul 2023 07:23:00 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHfnw-00035R-B1; Fri, 07 Jul 2023 07:23:00 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHfnw-00025B-8o; Fri, 07 Jul 2023 07:23:00 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHfnv-0007ZX-RA; Fri, 07 Jul 2023 07:22:59 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qHfnv-0003SZ-Qj; Fri, 07 Jul 2023 07:22:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=/Chu7DKbhUg09dvplE4r6XSloggleU+ufuNDIbZ/Ygo=; b=tfWqNw9yaYStGEZCMFjcwRIrM5
	BlDjOctiZODVNu70JtzDQL3DGeoPX0FGHSQHJeOocquEyUZMkClm21fbCzYvCHn5s4qTZgSa7L31u
	AFPnNhG4L9xe9Jr2UOA6SHGhJeFuzB/oqYGEw3mMjyzV1h719crH+/ttyWVi3R4raMG0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181727-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181727: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-qemut-rhel6hvm-amd:xen-install:fail:heisenbug
    xen-unstable:test-amd64-i386-xl-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=886c22f00c575199f7bb3dc5b7662dd09bf05146
X-Osstest-Versions-That:
    xen=dc5e6082f5b36c4a4008c158b53320699025f895
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 07 Jul 2023 07:22:59 +0000

flight 181727 xen-unstable real [real]
flight 181730 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181727/
http://logs.test-lab.xenproject.org/osstest/logs/181730/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-qemut-rhel6hvm-amd  7 xen-install   fail pass in 181730-retest
 test-amd64-i386-xl-vhd 21 guest-start/debian.repeat fail pass in 181730-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181715
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181715
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181715
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181715
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181715
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181715
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181715
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181715
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181715
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181715
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181715
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181715
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  886c22f00c575199f7bb3dc5b7662dd09bf05146
baseline version:
 xen                  dc5e6082f5b36c4a4008c158b53320699025f895

Last test of basis   181715  2023-07-05 20:38:52 Z    1 days
Failing since        181719  2023-07-06 06:54:41 Z    1 days    2 attempts
Testing same since   181727  2023-07-06 20:37:06 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alejandro Vallejo <alejandro.vallejo@cloud.com>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Julien Grall <jgrall@amazon.com>
  Shawn Anastasio <sanastasio@raptorengineering.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   dc5e6082f5..886c22f00c  886c22f00c575199f7bb3dc5b7662dd09bf05146 -> master


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 07:46:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 07:46:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560233.875994 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHgAX-0005el-82; Fri, 07 Jul 2023 07:46:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560233.875994; Fri, 07 Jul 2023 07:46:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHgAX-0005ee-5Q; Fri, 07 Jul 2023 07:46:21 +0000
Received: by outflank-mailman (input) for mailman id 560233;
 Fri, 07 Jul 2023 07:46:19 +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 <SRS0=VdXt=CZ=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qHgAV-0005eW-QI
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 07:46:19 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 59333e27-1c9a-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 09:46:14 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id D4F7D2279E;
 Fri,  7 Jul 2023 07:46:13 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A3FEC139E0;
 Fri,  7 Jul 2023 07:46:13 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id BaiHJsXCp2QXJgAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 07 Jul 2023 07:46:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 59333e27-1c9a-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688715973; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=Re48nnOP0rFJY+QyAtu3fiiB+DcqHGLNZij0w9041jg=;
	b=Vk8X8JKQWvKzzwnC9tk/h0Q2XXpt38rCNxYdW5Vqil2BMXlxcFXxyaKLRmNm2hg34UZDha
	vmmkmyp4ZLP23NAraiS6B/mbuOYReaUUOhXGVNePrlrk36OopdUEGvfF+llkJLPUfil7hi
	85TKv4hD4db0aOPKfzqr2I2DQxV/LoM=
Message-ID: <41893db4-cd66-a9f7-ffe5-d90fffb43657@suse.com>
Date: Fri, 7 Jul 2023 09:46:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: Petr Pavlu <petr.pavlu@suse.com>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 "sstabellini@kernel.org" <sstabellini@kernel.org>
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <551a1594-9c8b-d447-6bf3-a4a208d5550f@suse.com>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
In-Reply-To: <551a1594-9c8b-d447-6bf3-a4a208d5550f@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------jsXObnkNlf6I7A7Qe8ky0cRd"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------jsXObnkNlf6I7A7Qe8ky0cRd
Content-Type: multipart/mixed; boundary="------------9cgHzfhZcItFHAZOQ0DMtqQ7";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Petr Pavlu <petr.pavlu@suse.com>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 "sstabellini@kernel.org" <sstabellini@kernel.org>
Message-ID: <41893db4-cd66-a9f7-ffe5-d90fffb43657@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <551a1594-9c8b-d447-6bf3-a4a208d5550f@suse.com>
In-Reply-To: <551a1594-9c8b-d447-6bf3-a4a208d5550f@suse.com>

--------------9cgHzfhZcItFHAZOQ0DMtqQ7
Content-Type: multipart/mixed; boundary="------------pU2zdqtIoiz6W8rchmw1TzCg"

--------------pU2zdqtIoiz6W8rchmw1TzCg
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjYuMDYuMjMgMTU6MTcsIFBldHIgUGF2bHUgd3JvdGU6DQo+IE9uIDYvMjEvMjMgMTk6
NTgsIE9sZWtzYW5kciBUeXNoY2hlbmtvIHdyb3RlOg0KPj4gT24gMjEuMDYuMjMgMTY6MTIs
IFBldHIgUGF2bHUgd3JvdGU6DQo+Pj4gV2hlbiBhdHRlbXB0aW5nIHRvIHJ1biBYZW4gb24g
YSBRRU1VL0tWTSB2aXJ0dWFsIG1hY2hpbmUgd2l0aCB2aXJ0aW8NCj4+PiBkZXZpY2VzIChh
bGwgeDg2XzY0KSwgZG9tMCB0cmllcyB0byBlc3RhYmxpc2ggYSBncmFudCBmb3IgaXRzZWxm
IHdoaWNoDQo+Pj4gZXZlbnR1YWxseSByZXN1bHRzIGluIGEgaGFuZyBkdXJpbmcgdGhlIGJv
b3QuDQo+Pj4NCj4+PiBUaGUgYmFja3RyYWNlIGxvb2tzIGFzIGZvbGxvd3MsIHRoZSB3aGls
ZSBsb29wIGluIF9fc2VuZF9jb250cm9sX21zZygpDQo+Pj4gbWFrZXMgbm8gcHJvZ3Jlc3M6
DQo+Pj4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GhvdXQgaW50cm9k
dWNpbmcgYSByZWdyZXNzaW9uLg0KDQpBbnl0aGluZyBlbHNlIGNhbiBiZSBkb25lIGxhdGVy
Lg0KDQoNCkp1ZXJnZW4NCg==
--------------pU2zdqtIoiz6W8rchmw1TzCg
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5RnNVUJbvoPHZ8SlM4KWm8rG+lIkGurq
qu5gu8q8ZMKdsdGC4bBxdQKDKHEFExLJK/nRPFmAuGlId1E3fe10v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0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------pU2zdqtIoiz6W8rchmw1TzCg--

--------------9cgHzfhZcItFHAZOQ0DMtqQ7--

--------------jsXObnkNlf6I7A7Qe8ky0cRd
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSnwsUFAwAAAAAACgkQsN6d1ii/Ey/d
Vgf/VingAtLDJrq6HyMAe7N2oDCv6Ol+1mg1aaM1GORybX4idbxO4bYSnsO20jzksQAN20ZnjXhk
nlh2NjBBsLONDbhTbOYhoebwVK4BQuHBrVtqlpmxoa7obWf8LtRUQ+HvjQmXMe8Eea/hT4PR4j8h
pu2GuiHmpGbJHRPNra1VQblNQcqNGNjQvmV/elevtlpMbNd1e9xwaBONBz6XzVqM67d1ROaEvV2/
G7g3p4/6bG4BvXk1ZybaDMYhL2zSLl3EeH/WWCdlHwzYRWhi6mD+VoOD4X/qSf75jImi8RGF/Tyg
omVwE1p36r0WfY8FnYY/3G2PX7WQkA4/j8JaS8cJjw==
=tBuV
-----END PGP SIGNATURE-----

--------------jsXObnkNlf6I7A7Qe8ky0cRd--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 08:01:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 08:01:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560245.876004 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHgOU-0000Ey-2G; Fri, 07 Jul 2023 08:00:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560245.876004; Fri, 07 Jul 2023 08:00:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHgOT-0000Er-Vy; Fri, 07 Jul 2023 08:00:45 +0000
Received: by outflank-mailman (input) for mailman id 560245;
 Fri, 07 Jul 2023 08:00:45 +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 <SRS0=ruU0=CZ=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHgOT-0000El-6J
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 08:00:45 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20626.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::626])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5ea851ea-1c9c-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 10:00:42 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VE1PR04MB7438.eurprd04.prod.outlook.com (2603:10a6:800:1a0::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 08:00:39 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Fri, 7 Jul 2023
 08:00:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5ea851ea-1c9c-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=DLnp8pQ3REuO4We5Ov7TyzO6a2v6eTOW5OyMnhMSDaACeSa+wEDS3HGGVV2FXaTge8anCtLYLOdBD0SbXq+yBUMIMlY/Dsl1Jf4fMRLPlsiHRsXMl3skF38d8Z0Jr0MySUgRiW4fUgM/KkLRW2atDN8w81m3BFNxLQuY0x61ikRUzEYT7eUELX5n1de7nGPEWaQfYB8rChHudDjhA2QFA2z2RCiPn6ulI3YIrogU1L0rXvxIyMStxg7jKLhbu6XDIh+zKrwgSrOkkUdeb3Ko344PIGknv2yVhc+CmxGOF/dxrwYHQf8ZnLv7c2wS6Pq5WoM8pw4kgoIeT+7H2/Pcnw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=AZt9J95B1jLLg0VPXssmA4UNBei3fffftqFrh1L7WPQ=;
 b=IgZmkc6FTHFCS7SVdnSWr3zWt/D5cm7/+Gdt7h3IQ9nVi9Y8jumZUkXwDZVffkaXZ/zZgARmhueXsR0oDo2ST+kHeq/t9PcwiLgrE2Ww6tXqJObXquWxUIFH0si4n3p/E9WrFQYGxNts/duD0A2GYGPhlsUNwgAQI7aCn4AZiKK0WCLm/UZSBwZ/iWq6iW2Xo/r3sP2xeKcU4LJTT5lDXCydNHbZlgtcdpUuyfM/iJiGDROwgJzKB3XnyZGpo8VBm1Ux/WL/5qXSny2Vdvb1VLXfm0qgq3BasY887ASIgWEByYMe2gbUlLB3fRvQG9402NkK0Bj4biFZ8YSmx12Czg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=AZt9J95B1jLLg0VPXssmA4UNBei3fffftqFrh1L7WPQ=;
 b=b+VggsGLOC7Vg+t6wj6jse037np2QEXEo4AlKsKDsjeuEkXPcjC2/ZJ5WYtGHKWl4nsleN3TBCBiA411nf69kZu/lhmCFly+QJC5krYzZWmBwcvR+wS1i5RuXeUKZZW906ZpEJIqkhbgtBgSRPWF4+AC0J4F2oUdn6oju4HTFwwY6b9mtlSUdwo3j1IU/YXDIWkLG21DK1D3ICaHbzgUQxetOhwGUNRQwxTaZw6/tascmgNSBZizTFY/Wq5q++3EPFdoxI38qzJsYQizt6Dr+Fq3i2CGF5uHNuEBLRA2OSAQlwK/ZgDt+UkKOxEq1WeSpYxkZX+VpQDqcJBfm1ZLhw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <27a3e6a2-b150-1d75-c86f-dfa2b906b298@suse.com>
Date: Fri, 7 Jul 2023 10:00:37 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: Detecting whether dom0 is in a VM
Content-Language: en-US
To: zithro <slack@rabbit.lu>
Cc: George Dunlap <george.dunlap@cloud.com>, xen-devel@lists.xenproject.org
References: <CA+zSX=Y4MwsDSd9oSG1NQyt==YAw9SeRdh=eJxTUhhOx57ihWg@mail.gmail.com>
 <4ee01a0f-063e-ef93-ac24-da387d5b3438@rabbit.lu>
 <a680ae62-7765-aa51-1edd-9a1a7e39e449@suse.com>
 <20b1a79c-23c1-93bc-2090-8052f143422c@rabbit.lu>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20b1a79c-23c1-93bc-2090-8052f143422c@rabbit.lu>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0190.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ab::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VE1PR04MB7438:EE_
X-MS-Office365-Filtering-Correlation-Id: 4f6b1e43-c68d-4c22-4437-08db7ec0411c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	lkqJ24nnLVnIWEjrr+mOMcLDDZH33Df7l1dY4wIiEsVfd5FhWFsfQoOXSaUOxF4cNULJmxQMpI9b1HZeMB4twMOCYyPX8FjmEErOD96b+8cMCz5fUmdfM37rM2VCGTXH0sIaJUsDQ6ewltXhz+7HTwSKZcqDXuDL+hKHXwGWeXnyaHxuEC64wpO0VO3yOjNVWM3Zr9GW2+qV2kc0sO3ilW46kymnVeLol0VVqjGZRNp6VhhDJpRvkwqftG4SQ8vZQHZgxq2WXYUvBLHybF9wAFP7+JD1kyt01wNXwcq8dl5MgaYDi51/SlBcyRN4syXwaw9jgkYVgtHiovn3ngMoXPbZFq1L/4togSVDYwA+aH643dB7/EDA3XUfmTFIzcdTj8i1n1SlgJKG8Hqnsarz3/+cmNYZtAgGI0FvsUujPAnu2zOEXsqwJ0j9Fp9v83kHgM0TEb+fnC/97I7cnKrsGxyeoCoN9asNsN0qQqTpP2obybOu7dWTuvgOZIcUU7Qe1KOujNB2cUuJ2J0juwO97i2RwFt7p0bLX7mymOGYYa9YoHYMBFcnmfH6QHTfInLLAYZpLkxr8WN2H/bWVHOUFNO13FzAdeqgSQKxY1PMSKW8MZ+jgDCCQMox+QWM8DaDoIN07mXW8frQ2VJCTro8bQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(396003)(376002)(136003)(366004)(39860400002)(451199021)(41300700001)(966005)(6512007)(478600001)(31696002)(86362001)(38100700002)(6486002)(36756003)(66946007)(4326008)(83380400001)(6916009)(316002)(66476007)(2616005)(2906002)(8936002)(8676002)(5660300002)(66556008)(31686004)(186003)(6506007)(26005)(66899021)(53546011)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VUgwcnZNNGR0amMzc2ZvYzh4ZFB6OTMwdTZJWG9Gb2cvNVFaQ3ZZaGZGUXAy?=
 =?utf-8?B?U1dBOXR3TVFTUjF5aVg2WjlxeVRFSEh6dWI4K1g1K2dhRy9YUEZrQ292ckJh?=
 =?utf-8?B?Vm1nazVlK0F0blYyV2tURzdERHZiR3dUMElYOFpxeDB5S2xMY3paWm85K1pm?=
 =?utf-8?B?UE9PcUhqTy9RRWFpMHM0anNHaHNDSGFsTUZhKzJiVnFGZ1k4SHBLVkNoU240?=
 =?utf-8?B?c1RkQ2RvcU9TRTNKUFRkK3RCNi95bGxIT1ZOdWpiWXlIRUVua0VNYm9GejB1?=
 =?utf-8?B?S1Q5b0Y1TmhPZXJaM2hqN2VDOHA3UEszUm1aKzdSUHhPcXl1RmYzSnRWNDMy?=
 =?utf-8?B?NV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TXRq?=
 =?utf-8?Q?kaPIR6PhLetWCgP0nUs3F1/nu?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4f6b1e43-c68d-4c22-4437-08db7ec0411c
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 08:00:39.5170
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: FPvwiDxa2mirZPWNzBB6os+RYgTS8QeFsQhlc7R9U1cIfmtWJfGyByYdRKEZI90FMvRuWtAU+Qk77V7w88e2Vw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7438

On 06.07.2023 17:35, zithro wrote:
> On 06 Jul 2023 09:02, Jan Beulich wrote:
>> On 05.07.2023 18:20, zithro wrote:
>>> So I'm wondering, isn't that path enough for correct detection ?
>>> I mean, if "/sys/class/dmi/id/sys_vendor" reports Xen (or KVM, or any
>>> other known hypervisor), it's nested, otherwise it's on hardware ?
>>>
>>> Is that really mandatory to use CPUID leaves ?
>>
>> Let me ask the other way around: In user mode code under a non-nested
>> vs nested Xen, what would you be able to derive from CPUID? The
>> "hypervisor" bit is going to be set in both cases. (All assuming you
>> run on new enough hardware+Xen such that CPUID would be intercepted
>> even for PV.)
> 
> I'm a bit clueless about CPUID stuff, but if I understand correctly, 
> you're essentially saying that using CPUID may not be the perfect way ?
> Also, I don't get why the cpuid command returns two different values, 
> depending on the -k switch :
> # cpuid -l 0x40000000
> hypervisor_id (0x40000000) = "\0\0\0\0\0\0\0\0\0\0\0\0"
> # cpuid -k -l 0x40000000
> hypervisor_id (0x40000000) = "XenVMMXenVMM"

I'm afraid I can't comment on this without knowing what tool you're
taking about. Neither of the two systems I checked have one of this
name.

>> Yet relying on DMI is fragile, too: Along the lines of
>> https://lists.xen.org/archives/html/xen-devel/2022-01/msg00604.html
>> basically any value in there could be "inherited" from the host (i.e.
>> from the layer below, to be precise).
> 
> So using "/sys/class/dmi/id/sys_vendor", or simply doing "dmesg | grep 
> DMI:" is also not perfect, as values can be inherited/spoofed by 
> underneath hypervisor ?

That's my understanding, yes.

>> The only way to be reasonably
>> certain is to ask Xen about its view. The raw or host featuresets
>> should give you this information, in the "mirror" of said respective
>> CPUID leave's "hypervisor" bit. 
> 
> As said above, I'm clueless, can you expand please ?

Xen's public interface offers access to the featuresets known / found /
used by the hypervisor. See XEN_SYSCTL_get_cpu_featureset, accessible
via xc_get_cpu_featureset().

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 08:01:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 08:01:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560246.876014 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHgOb-0000Vp-Ar; Fri, 07 Jul 2023 08:00:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560246.876014; Fri, 07 Jul 2023 08:00:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHgOb-0000Vi-8G; Fri, 07 Jul 2023 08:00:53 +0000
Received: by outflank-mailman (input) for mailman id 560246;
 Fri, 07 Jul 2023 08:00:52 +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
 <SRS0=nfp+=CZ=epam.com=prvs=15521292a4=oleksandr_tyshchenko@srs-se1.protection.inumbo.net>)
 id 1qHgOa-0000El-A2
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 08:00:52 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 626b7b39-1c9c-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 10:00:49 +0200 (CEST)
Received: from pps.filterd (m0174682.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 366MUb22014628; Fri, 7 Jul 2023 08:00:45 GMT
Received: from eur05-am6-obe.outbound.protection.outlook.com
 (mail-am6eur05lp2109.outbound.protection.outlook.com [104.47.18.109])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3rp6fh93jw-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Fri, 07 Jul 2023 08:00:44 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com (2603:10a6:10:ed::15)
 by VI1PR0301MB6671.eurprd03.prod.outlook.com (2603:10a6:800:17d::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 08:00:41 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::11f9:615a:4d9a:a5d2]) by DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::11f9:615a:4d9a:a5d2%6]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 08:00:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 626b7b39-1c9c-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KqO5oKOlHtaZb8bjfX4GANMHKcnbDCKjDuDYHYbaV4DA2Ihc5Cu4PAIYQfZ6Da1pqodoyts0Jh/A1Hbq8Xd4Iu6cbv6QGyYsQ8k0HF+FBC1PUXvFd7vPW4EI/TgQ6ryZBpj/wn2YjIWRTf0lMhLoKc+mToUr+cMExTtCgGsvOHHvLRsEdlL+32vPlxSxImddkjh4rncrKF/r8H5HfYVmkhHFKF7yAGiYxZGrNTNXvI1MzijHR6JQr8nqzs04ErzAYgupX3qAxXZZi4exMlHFohhw/sQW1JAfXWgKCgb4OIPDwbmHR6zq1ola7xDLNNuvi/OsZ1c02PZcgxM/Afxc/w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0zgH9T+yLCN0URgEb7qKrkWpt1fvAqfJr5fCr9Mcznc=;
 b=aFDuNBKFVYIyRIKsx4r9zByVi0zQ3Y0d+EvM7ik0EZQSOF2ILhsaUTshaz2+W2bz8E1NZOMcugEVhVk+uUTPi52rtHDn3ewkrRmsybQGWFvSqDevbZDlFuhaxNo0fCLrRYUed1DSWSjXU0Xd5ALbdo7DPvWu+o92URlWvO2+i3nha8EX5kwyN+lnm503KEbIEAVhs5T+EzhJAlB1dai1BEpbsR8m+ejX4VXXoKo127C57hBhQgE9JeMTwcB/Q//N24Xcr/wGSnSuSY3ejby5OBJl/9jvLV3wpB/ikutfh8BybFgKUlJRz0Kua88qxctLYpNM5ussMGU0jLaFfcEaEw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0zgH9T+yLCN0URgEb7qKrkWpt1fvAqfJr5fCr9Mcznc=;
 b=RHLm1NX9RRf2C36E0fO9yB70zO3No3mH4Phu+CrAYmXPZN5zpGerxMSNYZptWjrsPnjj/kL8xPhB593w5HALxbrbUp3c56OAff6RQikr6d1JajIJW7ZdF4MIJdWDgdZ60Hvxa8DBDB3+zp7yE4UtegOcXNaRr91pzDUErylvt2saoZIleQo/Kttt9Ya9INzde1qypazZuvULSTGvFNfydIAlPS5HG0WTx9fBfgFAZuoIu3J++2hDeroPM9Qwx/m5wFeVPR3njoeK7VBx+N8QZxEQuL5ih6BUyQ8o6n2MtIkRrX0kn5ZBsEQNkaBU8cfd7f26T40PVHiCT6c4vq4uyg==
From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
To: Juergen Gross <jgross@suse.com>,
        Stefano Stabellini
	<sstabellini@kernel.org>
CC: Petr Pavlu <petr.pavlu@suse.com>,
        "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>,
        "linux-kernel@vger.kernel.org"
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
Thread-Topic: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
Thread-Index: AQHZpEL/jQILjif4TEa2QZqecjVVUK+Vi2cAgAt2NQCADPhOAIAAD7yA
Date: Fri, 7 Jul 2023 08:00:41 +0000
Message-ID: <d5d6caa5-6ca6-b4b8-5334-fc156eeeb21d@epam.com>
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
 <f1a81ac1-5b9a-6d19-1a11-b98685bd2430@suse.com>
In-Reply-To: <f1a81ac1-5b9a-6d19-1a11-b98685bd2430@suse.com>
Accept-Language: en-US, ru-RU
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DB8PR03MB6108:EE_|VI1PR0301MB6671:EE_
x-ms-office365-filtering-correlation-id: 3e833c3a-9945-4489-73d0-08db7ec04223
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 OtWKG88qQhs+0225kHNTpILhhZATKaiYEMerIhzcDHU9Yib6DBrN0b4lcAuP6XBjS4LMCoGTEjCMvTPNgQLB79igCrhul45JXEm3E/HsCfeHlXluwy2k961r3OMuxjK0z1yVgjsQjY12kNoQSBpVEVsky2MU0fsx4c7og4oERt+049afNP1rEye710zaRh4tltM9kjgeD6hhscPT3JrRox96ezwn9SPPYzx51Fq21S7grYFiVvd9l9d5uK5X6Nyn6hC5syfdHxNuoIYHtuMXMZR/2ogviRjF/p2sHyTDQtn1bxBPLBITNNgPTC3IXvyqWXnNCHzLQWuq5Xr4Y7zGzNVPn+p6YVBLRwm0BcnKuNJL8mhLyqoTv/4ZRsRGMThy3ooHJ+H1Y8xj8XyRLPqy6rPy/qhIloZp6gvLcnAML8slR8Q0hhbsEvjuruSBSp64XwVbo0VP+C2A2NqumEC6hLQwK9jUuyxN9vj9LfZfPQB4DjXV0Yp1xRGTGUacUkRq2y+3nSgI8jpvpHwnHCAwOR4m5Y0ZdB2cDiE4eirgq7ENs9Mgpt2H/FzrbY3d0RUh2qnVEhTdeYgtQiN9VmS1yex5yzrols89vScwiUae5u6uAMSP4fRtJtzuD4+SqHcKIGIDfPMMx67jq7WGOgrdMA==
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR03MB6108.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(366004)(376002)(346002)(136003)(451199021)(31686004)(6486002)(71200400001)(478600001)(110136005)(76116006)(91956017)(54906003)(38100700002)(122000001)(83380400001)(86362001)(38070700005)(36756003)(31696002)(2906002)(66946007)(6512007)(2616005)(53546011)(6506007)(186003)(4326008)(26005)(41300700001)(64756008)(66476007)(316002)(8936002)(66556008)(66446008)(8676002)(5660300002)(45980500001);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?S3RwcnVlMWFSTDdSQmtpMGFEWTQzK0tPbGp2MWJ1ZVdCeHZaaXRFK0drRWNU?=
 =?utf-8?B?R3VHajdjMWRGeVJjMmFUN3MvSjdMK0pjcjhZckd0M0NsVkJqcFE3a3hkbWFN?=
 =?utf-8?B?M3cwVGthOUF3bnZiZU1KQUs0NmVScWphZ3dvTkJkZDc4Tm8rV2I4azA3VVlL?=
 =?utf-8?B?dHNEaDAyak9tc0dwajlvakN5TC9DKzhwRmpmODR2aXZRWmo5aFBhMkdQNFlW?=
 =?utf-8?B?M1pPdVZISkp3cjNqTHFEOFJ1UmhxSTJUZHBpSC9EMG00T1dvUXdvVjcyZ0tq?=
 =?utf-8?B?ODhuOHFndVh6WkJNalNFc3lZNW95WkROQS8yYkU3NUhaN2VVVysvNGVTK05w?=
 =?utf-8?B?R28ybHdMKy92RkVuTjRKVnBLandXTGh4eVpZaVdEbExqK2NUeTQ4VHZPNFZp?=
 =?utf-8?B?N2pSMDduRXBrQUlDZ1dqVDZscFMvclVIZFhlZjQvWGt0Zm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pL7/pY=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <3BCF315D9A9057438AD01E0C5420B6A6@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DB8PR03MB6108.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3e833c3a-9945-4489-73d0-08db7ec04223
X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jul 2023 08:00:41.0922
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 4xxgs5KDDn2U2ICQfaZexbbCgMJs1yvmUMxKORqvIIIyZJdunQvD3OleZUafRiW4dvKaO2J1vrJSODWp0v2VtCdxyuYTMQQTy22XR9dj08o=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0301MB6671
X-Proofpoint-GUID: W9YIVk0_v9MoQVZkWpiXOf5r7fxfNIPt
X-Proofpoint-ORIG-GUID: W9YIVk0_v9MoQVZkWpiXOf5r7fxfNIPt
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-07_04,2023-07-06_02,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxscore=0
 mlxlogscore=999 impostorscore=0 priorityscore=1501 spamscore=0
 malwarescore=0 adultscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0
 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2305260000 definitions=main-2307070073

DQoNCk9uIDA3LjA3LjIzIDEwOjA0LCBKdWVyZ2VuIEdyb3NzIHdyb3R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XNrIGFueXdheS4NCj4gDQo+IFdlIF9jb3VsZF8gZHJvcCB0aGUgcmVxdWlyZW1lbnQgb2Yg
dGhlIGJhY2tlbmQgbmVlZGluZyB0byBzZXQNCj4gVklSVElPX0ZfQUNDRVNTX1BMQVRGT1JNIGZv
ciBQViBndWVzdHMgYW5kIGFsbG93IGdyYW50LWxlc3MgdmlydGlvDQo+IGhhbmRsaW5nIGZvciBh
bGwgZ3Vlc3RzLiBGb3IgdGhpcyB0byB3b3JrIHhlbl92aXJ0aW9fcmVzdHJpY3RlZF9tZW1fYWNj
KCkNCj4gd291bGQgbmVlZCB0byBjaGVjayBmb3IgVklSVElPX0ZfQUNDRVNTX1BMQVRGT1JNIGFu
ZCByZXR1cm4gdHJ1ZSBpZiBzZXQuDQo+IE1heWJlIHdlJ2Qgd2FudCB0byBlbmFibGUgdGhhdCBw
b3NzaWJpbGl0eSB2aWEgYSBib290IHBhcmFtZXRlcj8NCg0KDQpNYXliZSwgeWVzLiBJIGRvbid0
IHNlZSBhdCB0aGUgbW9tZW50IHdoeSB0aGlzIHdvbid0IHdvcmsuDQoNCkF0IHRoZSBzYW1lIHRp
bWUgSSB3b25kZXIsIGNvdWxkIHdlIGp1c3QgbW9kaWZ5IHhlbl9wdl9pbml0X3BsYXRmb3JtKCkg
DQp0byBjYWxsIHZpcnRpb19ub19yZXN0cmljdGVkX21lbV9hY2MoKSBpZiBmb3JjaWJseSBkaXNh
YmxlZCBieSBib290IA0KcGFyYW1ldGVyIGlycmVzcGVjdGl2ZSBvZiBWSVJUSU9fRl9BQ0NFU1Nf
UExBVEZPUk0gcHJlc2VuY2U/DQoNCg0KPiANCj4gDQo+IEp1ZXJnZW4=


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 08:04:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 08:04:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560256.876024 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHgS0-0001RA-Tx; Fri, 07 Jul 2023 08:04:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560256.876024; Fri, 07 Jul 2023 08:04:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHgS0-0001R3-RM; Fri, 07 Jul 2023 08:04:24 +0000
Received: by outflank-mailman (input) for mailman id 560256;
 Fri, 07 Jul 2023 08:04:23 +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
 <SRS0=kjyJ=CZ=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qHgRz-0001Qx-IV
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 08:04:23 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e0ecd79e-1c9c-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 10:04:21 +0200 (CEST)
Received: from mail-vs1-f43.google.com (mail-vs1-f43.google.com
 [209.85.217.43])
 by support.bugseng.com (Postfix) with ESMTPSA id D28C54EE0C81
 for <xen-devel@lists.xenproject.org>; Fri,  7 Jul 2023 10:04:20 +0200 (CEST)
Received: by mail-vs1-f43.google.com with SMTP id
 ada2fe7eead31-4435fa903f2so461218137.1
 for <xen-devel@lists.xenproject.org>; Fri, 07 Jul 2023 01:04:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e0ecd79e-1c9c-11ee-8611-37d641c3527e
X-Gm-Message-State: ABy/qLYOezixCXspRO7VZuj4cAb3CngAUx7xEbKseMHrMRaupj1Nulh0
	xaDVKwLb6rRcDU1U7ScrpE6weEc8jpGNN6pm9ss=
X-Google-Smtp-Source: APBJJlHJt/ErQDGaFXVOzwKh40ls2rwgzcKDTlwc65574Q5c4UNx7l3WZ6j2Bfz71WCQSWvnC+zS71ZUZQZLl+G+9OM=
X-Received: by 2002:a67:d095:0:b0:443:8a2a:9481 with SMTP id
 s21-20020a67d095000000b004438a2a9481mr1824643vsi.2.1688717059564; Fri, 07 Jul
 2023 01:04:19 -0700 (PDT)
MIME-Version: 1.0
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <e414542d76d4a4a0df6ad969cc6332e355d6ef38.1688559115.git.gianluca.luparini@bugseng.com>
 <a343fc97-84df-48e6-1c91-cd933c6e5210@suse.com> <CAFHJcJu=S2JtFJy_XnMhrr0gP7+sPfvrS_1940qzL9rc_j60nA@mail.gmail.com>
 <f93f0561-abea-bdae-223e-d69932e435c4@suse.com> <CAFHJcJuP7hH01ZiwNe0HHBM=JpBtsF9sDD7fushyBxDQ9UZicw@mail.gmail.com>
 <fb29cca6-454c-82ed-b6a8-ac9814f81cfa@suse.com>
In-Reply-To: <fb29cca6-454c-82ed-b6a8-ac9814f81cfa@suse.com>
From: Simone Ballarin <simone.ballarin@bugseng.com>
Date: Fri, 7 Jul 2023 10:04:08 +0200
X-Gmail-Original-Message-ID: <CAFHJcJuCddmwMAB=26tVBfgThQWLZb5kZU3GBdC0aTTcvJ4O1w@mail.gmail.com>
Message-ID: <CAFHJcJuCddmwMAB=26tVBfgThQWLZb5kZU3GBdC0aTTcvJ4O1w@mail.gmail.com>
Subject: Re: [XEN PATCH v2 12/13] xen/x86: fix violations of MISRA C:2012 Rule 7.2
To: Jan Beulich <jbeulich@suse.com>
Cc: consulting@bugseng.com, Gianluca Luparini <gianluca.luparini@bugseng.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Wei Liu <wl@xen.org>, Paul Durrant <paul@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
	Michal Orzel <michal.orzel@amd.com>, Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, 
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000762c8405ffe11458"

--000000000000762c8405ffe11458
Content-Type: text/plain; charset="UTF-8"

Il giorno ven 7 lug 2023 alle ore 09:04 Jan Beulich <jbeulich@suse.com> ha
scritto:

> On 07.07.2023 08:50, Simone Ballarin wrote:
> > Il giorno gio 6 lug 2023 alle ore 18:22 Jan Beulich <jbeulich@suse.com>
> ha
> > scritto:
> >
> >> On 06.07.2023 18:08, Simone Ballarin wrote:
> >>> Il giorno gio 6 lug 2023 alle ore 10:26 Jan Beulich <jbeulich@suse.com
> >
> >> ha
> >>> scritto:
> >>>
> >>>> On 05.07.2023 17:26, Simone Ballarin wrote:
> >>>>> --- a/xen/arch/x86/apic.c
> >>>>> +++ b/xen/arch/x86/apic.c
> >>>>> @@ -1211,7 +1211,7 @@ static void __init calibrate_APIC_clock(void)
> >>>>>       * Setup the APIC counter to maximum. There is no way the lapic
> >>>>>       * can underflow in the 100ms detection time frame.
> >>>>>       */
> >>>>> -    __setup_APIC_LVTT(0xffffffff);
> >>>>> +    __setup_APIC_LVTT(0xffffffffU);
> >>>>
> >>>> While making the change less mechanical, we want to consider to switch
> >>>> to ~0 in this and similar cases.
> >>>>
> >>>
> >>> Changing ~0U is more than not mechanical: it is possibly dangerous.
> >>> The resulting value could be different depending on the architecture,
> >>> I prefer to not make such kind of changes in a MISRA-related patch.
> >>
> >> What do you mean by "depending on the architecture", when this is
> >> x86-only code _and_ you can check what type parameter the called
> >> function has?
> >
> > Ok, I will change these literals in ~0U in the next submission.
>
> Except that I specifically meant ~0, not ~0U. We mean "maximum value"
> here, and at the call site it doesn't matter how wide the function
> parameter's type is. If it was 64-bit, ~0U would not do what is wanted.
>
> Jan
>

~0 is not a MISRA-compliant solution since bitwise operations on signed
integers have implementation-defined behavior. This solution definitively
violates Rule 10.1.
As you said ~0 is different than ~0U, 0xffffffffU, and 0xffffffff, so using
~0 means changing the semantics of the code: this is not the aim of the
patch.

-- 
Simone Ballarin, M.Sc.

Field Application Engineer, BUGSENG (https://bugseng.com
<http://bugseng.com>)

--000000000000762c8405ffe11458
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div dir=3D"ltr"><br></div><br><div class=3D"gmail_qu=
ote"><div dir=3D"ltr" class=3D"gmail_attr">Il giorno ven 7 lug 2023 alle or=
e 09:04 Jan Beulich &lt;<a href=3D"mailto:jbeulich@suse.com">jbeulich@suse.=
com</a>&gt; ha scritto:<br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex">On 07.07.2023 08:50, Simone Ballarin wrote:<br>
&gt; Il giorno gio 6 lug 2023 alle ore 18:22 Jan Beulich &lt;<a href=3D"mai=
lto:jbeulich@suse.com" target=3D"_blank">jbeulich@suse.com</a>&gt; ha<br>
&gt; scritto:<br>
&gt; <br>
&gt;&gt; On 06.07.2023 18:08, Simone Ballarin wrote:<br>
&gt;&gt;&gt; Il giorno gio 6 lug 2023 alle ore 10:26 Jan Beulich &lt;<a hre=
f=3D"mailto:jbeulich@suse.com" target=3D"_blank">jbeulich@suse.com</a>&gt;<=
br>
&gt;&gt; ha<br>
&gt;&gt;&gt; scritto:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On 05.07.2023 17:26, Simone Ballarin wrote:<br>
&gt;&gt;&gt;&gt;&gt; --- a/xen/arch/x86/apic.c<br>
&gt;&gt;&gt;&gt;&gt; +++ b/xen/arch/x86/apic.c<br>
&gt;&gt;&gt;&gt;&gt; @@ -1211,7 +1211,7 @@ static void __init calibrate_API=
C_clock(void)<br>
&gt;&gt;&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0* Setup the APIC counter to =
maximum. There is no way the lapic<br>
&gt;&gt;&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0* can underflow in the 100ms=
 detection time frame.<br>
&gt;&gt;&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0*/<br>
&gt;&gt;&gt;&gt;&gt; -=C2=A0 =C2=A0 __setup_APIC_LVTT(0xffffffff);<br>
&gt;&gt;&gt;&gt;&gt; +=C2=A0 =C2=A0 __setup_APIC_LVTT(0xffffffffU);<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; While making the change less mechanical, we want to consid=
er to switch<br>
&gt;&gt;&gt;&gt; to ~0 in this and similar cases.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Changing ~0U is more than not mechanical: it is possibly dange=
rous.<br>
&gt;&gt;&gt; The resulting value could be different depending on the archit=
ecture,<br>
&gt;&gt;&gt; I prefer to not make such kind of changes in a MISRA-related p=
atch.<br>
&gt;&gt;<br>
&gt;&gt; What do you mean by &quot;depending on the architecture&quot;, whe=
n this is<br>
&gt;&gt; x86-only code _and_ you can check what type parameter the called<b=
r>
&gt;&gt; function has?<br>
&gt; <br>
&gt; Ok, I will change these literals in ~0U in the next submission.<br>
<br>
Except that I specifically meant ~0, not ~0U. We mean &quot;maximum value&q=
uot;<br>
here, and at the call site it doesn&#39;t matter how wide the function<br>
parameter&#39;s type is. If it was 64-bit, ~0U would not do what is wanted.=
<br>
<br>
Jan<br>
</blockquote></div><br clear=3D"all"></div>~0 is not a MISRA-compliant solu=
tion since bitwise operations on signed integers have implementation-define=
d behavior. This solution definitively violates Rule 10.1. <br>As you said =
~0 is different than ~0U, 0xffffffffU, and 0xffffffff, so using ~0 means ch=
anging the semantics of the code: this is not the aim of the patch.<div><br=
></div><div><span class=3D"gmail_signature_prefix">-- </span><br><div dir=
=3D"ltr" class=3D"gmail_signature"><div dir=3D"ltr">Simone Ballarin, M.Sc.<=
br><br><div>Field Application Engineer, BUGSENG (<a href=3D"http://bugseng.=
com" target=3D"_blank">https://bugseng.com</a>)</div></div></div></div></di=
v>

--000000000000762c8405ffe11458--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 08:10:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 08:10:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560264.876035 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHgXt-0002vE-Ic; Fri, 07 Jul 2023 08:10:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560264.876035; Fri, 07 Jul 2023 08:10:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHgXt-0002v7-Fs; Fri, 07 Jul 2023 08:10:29 +0000
Received: by outflank-mailman (input) for mailman id 560264;
 Fri, 07 Jul 2023 08:10:28 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qHgXs-0002ux-2E
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 08:10:28 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHgXn-0003ij-9T; Fri, 07 Jul 2023 08:10:23 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHgXn-0002TC-35; Fri, 07 Jul 2023 08:10:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=vZGHCxYyKeO8Tk94yuxEuQ0JPM+BGHcOSxoKoMYi41M=; b=PBFpupzB/coAB1GyX63D749ZXG
	vn+oRTst7oO+VcaL/KLHscG9PjEjcK+K9vSOgeFNJskZiZ1kxbnEi1eRxLql1vI5Hl7MntdvvG1q/
	0F0VE8o4kS9DhSGS1gUttiRwoQ4lp4JQ4d5wodH1krFsfbwlNkNFY1HkrU1sk4ZFYbuE=;
Message-ID: <45169f0f-78f0-468f-0cdc-c1649fbd580b@xen.org>
Date: Fri, 7 Jul 2023 09:10:20 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 1/3] xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig
 option
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>,
 Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: Rahul Singh <rahul.singh@arm.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Artem Mygaiev <artem_mygaiev@epam.com>,
 Stefano Stabellini <stefano.stabellini@amd.com>,
 xen-devel@lists.xenproject.org
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-2-stewart.hildebrand@amd.com>
 <3ab542ff-9145-d989-2ec1-3d01168902a5@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <3ab542ff-9145-d989-2ec1-3d01168902a5@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Jan,

On 07/07/2023 07:55, Jan Beulich wrote:
> On 07.07.2023 03:47, Stewart Hildebrand wrote:
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -190,6 +190,15 @@ config STATIC_SHM
>>   	help
>>   	  This option enables statically shared memory on a dom0less system.
>>   
>> +config PCI_PASSTHROUGH
>> +	bool "PCI passthrough" if EXPERT
>> +	depends on ARM_64
>> +	select HAS_PCI
>> +	select HAS_VPCI
>> +	default n
> 
> No need for this line - that's what the tool does by default anyway.

I would rather keep. We are already using 'default n' and it is making 
more obvious the default value.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 08:11:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 08:11:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560268.876045 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHgYg-0003Qt-RJ; Fri, 07 Jul 2023 08:11:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560268.876045; Fri, 07 Jul 2023 08:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHgYg-0003Qm-Oj; Fri, 07 Jul 2023 08:11:18 +0000
Received: by outflank-mailman (input) for mailman id 560268;
 Fri, 07 Jul 2023 08:11:18 +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 <SRS0=VdXt=CZ=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qHgYf-0003NQ-SI
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 08:11:17 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d813dbbf-1c9d-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 10:11:15 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 622CD2237F;
 Fri,  7 Jul 2023 08:11:15 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 30DF6139E0;
 Fri,  7 Jul 2023 08:11:15 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id JF/7CaPIp2SnMgAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 07 Jul 2023 08:11:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d813dbbf-1c9d-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688717475; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=arIAW3OveDWr1GaHNZeCtrtLD9Pje9pa5DU23lYKgnE=;
	b=akqxqzaWpUxYBOkPhdHnx7NVUL6KokD8V1vWp7mJP3dcjCbg1zaNCHjCNryyS8NjVdX4Bz
	i5wGXPFfJ7c1Y9uuJez1CgMOqzza34PbA+oYeOL4u66OtOFS7JUY/NusPh4GgvaNOBvr+y
	dRQBGWI0vA+UZ34evXa9pzHRh9bcC3M=
Message-ID: <8b862919-296d-d0b6-d4c1-465b62cfa37f@suse.com>
Date: Fri, 7 Jul 2023 10:11:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
Content-Language: en-US
To: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Stefano Stabellini <sstabellini@kernel.org>
Cc: Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
 <f1a81ac1-5b9a-6d19-1a11-b98685bd2430@suse.com>
 <d5d6caa5-6ca6-b4b8-5334-fc156eeeb21d@epam.com>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <d5d6caa5-6ca6-b4b8-5334-fc156eeeb21d@epam.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------ZRTo4Ebpgwa47mR0WqohChe9"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------ZRTo4Ebpgwa47mR0WqohChe9
Content-Type: multipart/mixed; boundary="------------0p72qKVXEjc8Akettz9hL15p";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Stefano Stabellini <sstabellini@kernel.org>
Cc: Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Message-ID: <8b862919-296d-d0b6-d4c1-465b62cfa37f@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
 <f1a81ac1-5b9a-6d19-1a11-b98685bd2430@suse.com>
 <d5d6caa5-6ca6-b4b8-5334-fc156eeeb21d@epam.com>
In-Reply-To: <d5d6caa5-6ca6-b4b8-5334-fc156eeeb21d@epam.com>

--------------0p72qKVXEjc8Akettz9hL15p
Content-Type: multipart/mixed; boundary="------------kb0xkp33y6IjSL4ev99Cn3fp"

--------------kb0xkp33y6IjSL4ev99Cn3fp
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMDcuMDcuMjMgMTA6MDAsIE9sZWtzYW5kciBUeXNoY2hlbmtvIHdyb3RlOg0KPiANCj4g
DQo+IE9uIDA3LjA3LjIzIDEwOjA0LCBKdWVyZ2VuIEdyb3NzIHdyb3RlOg0KPiANCj4gSGVs
bG8gSnVlcmdlbg0KPiANCj4gDQo+PiBSZS1yZWFkaW5nIHRoZSB3aG9sZSB0aHJlYWQgYWdh
aW4gLi4uDQo+Pg0KPj4gT24gMjkuMDYuMjMgMDM6MDAsIFN0ZWZhbm8gU3RhYmVsbGluaSB3
cm90ZToNCj4+PiBPbiBXZWQsIDIxIEp1biAyMDIzLCBPbGVrc2FuZHIgVHlzaGNoZW5rbyB3
cm90ZToNCj4+Pj4gT24gMjEuMDYuMjMgMTY6MTIsIFBldHIgUGF2bHUgd3JvdGU6DQo+Pj4+
DQo+Pj4+DQo+Pj4+IEhlbGxvIFBldHINCj4+Pj4NCj4+Pj4NCj4+Pj4+IFdoZW4gYXR0ZW1w
dGluZyB0byBydW4gWGVuIG9uIGEgUUVNVS9LVk0gdmlydHVhbCBtYWNoaW5lIHdpdGggdmly
dGlvDQo+Pj4+PiBkZXZpY2VzIChhbGwgeDg2XzY0KSwgZG9tMCB0cmllcyB0byBlc3RhYmxp
c2ggYSBncmFudCBmb3IgaXRzZWxmIHdoaWNoDQo+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iCKvBOB/Cc+3EXE78XdlxLyOi/NrmSGRIov0karw2RzMNOu
5D+jLRZQd1Sv27AR+IP3I8U4aqnhLpwhK7MEy9oCILlgZ1QZe49kpcumcZKORmzB
TNh30FVKK1EvmV2xAKDoaEOgQB4iFQLhJCdP1I5aSgM5IVFdn7v5YgEYuJYx37Io
N1EblHI//x/e2AaIHpzK5h88NEawQsaNRpNSrcfbFmAg987ATQRTjHAWAQgAyzH6
AOODMBjgfWE9VeCgsrwH3exNAU32gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------kb0xkp33y6IjSL4ev99Cn3fp--

--------------0p72qKVXEjc8Akettz9hL15p--

--------------ZRTo4Ebpgwa47mR0WqohChe9
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSnyKIFAwAAAAAACgkQsN6d1ii/Ey8E
7Qf/dm40PExD3UqKQhXcgaO4Ovhc9Mu7fzOlT5fy0Iut6lsSOrp1C+fwqJgMlOnet29zuzOLMT9e
Z39TWsdq8gFKE72yOtg5Dvd8JQXTNDpAR50D2sd7VqzEDd5t3n7BI6wMxIw89z8vJOBpPbhLkOsg
bnskPBRjv5AemY+cq8TVYGxuU96OYIh+G6yT9PpxGqvTWpiE58bzIo7KfPwn5WtYAHOAOk6zKFlM
frA5oEDVsXyTtzR8G/87K7I3Rs1rG163Fs4bCl3y/5plVF9e7ZWfX8c119hCTfZj7OTNZ9ifU0eZ
FTDvAaBiXyNA5mr1uHcp8SaNPnT2qn+7/lhSSu8Vxw==
=e86j
-----END PGP SIGNATURE-----

--------------ZRTo4Ebpgwa47mR0WqohChe9--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 08:19:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 08:19:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560274.876054 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHggI-0004BO-Ng; Fri, 07 Jul 2023 08:19:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560274.876054; Fri, 07 Jul 2023 08:19:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHggI-0004BH-L0; Fri, 07 Jul 2023 08:19:10 +0000
Received: by outflank-mailman (input) for mailman id 560274;
 Fri, 07 Jul 2023 08:19:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kjyJ=CZ=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qHggH-0004BB-GH
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 08:19:09 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f1a8289b-1c9e-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 10:19:08 +0200 (CEST)
Received: from mail-vk1-f174.google.com (mail-vk1-f174.google.com
 [209.85.221.174])
 by support.bugseng.com (Postfix) with ESMTPSA id B90674EE0C87
 for <xen-devel@lists.xenproject.org>; Fri,  7 Jul 2023 10:19:07 +0200 (CEST)
Received: by mail-vk1-f174.google.com with SMTP id
 71dfb90a1353d-47e25709402so638590e0c.0
 for <xen-devel@lists.xenproject.org>; Fri, 07 Jul 2023 01:19:07 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f1a8289b-1c9e-11ee-b237-6b7b168915f2
X-Gm-Message-State: ABy/qLYMrwMRUtC4IDYyQ9PHbXPhK2P5CIM4cXhXkiE+t/KiXlBm/iUn
	Q/B3kpGMPFZ1VKyJ6+gV2fRg4aBt3ZEW31frPhY=
X-Google-Smtp-Source: APBJJlERXkLn4rnLZROi+wS0Kk5grHYNuCk9w2E3B1GGUIiH8XHCixQHB7c4QSlTaKg09pTO/orxpb3caKrhoNoCsks=
X-Received: by 2002:a05:6102:3a72:b0:443:695d:b91a with SMTP id
 bf18-20020a0561023a7200b00443695db91amr2889414vsb.28.1688717946615; Fri, 07
 Jul 2023 01:19:06 -0700 (PDT)
MIME-Version: 1.0
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <f30ef7c2cda2516d9ef07bb79e5da5513cd90c6c.1688559115.git.gianluca.luparini@bugseng.com>
 <f3b6170a-db0d-ef00-b3f8-7deba17b9fe2@suse.com>
In-Reply-To: <f3b6170a-db0d-ef00-b3f8-7deba17b9fe2@suse.com>
From: Simone Ballarin <simone.ballarin@bugseng.com>
Date: Fri, 7 Jul 2023 10:18:55 +0200
X-Gmail-Original-Message-ID: <CAFHJcJuSPHDUqVOw_VSu+vEQGEvgtz30ef78vU-Ona1EQnJaLQ@mail.gmail.com>
Message-ID: <CAFHJcJuSPHDUqVOw_VSu+vEQGEvgtz30ef78vU-Ona1EQnJaLQ@mail.gmail.com>
Subject: Re: [XEN PATCH v2 07/13] x86/vmx: fix violations of MISRA C:2012 Rule 7.2
To: Jan Beulich <jbeulich@suse.com>
Cc: consulting@bugseng.com, Gianluca Luparini <gianluca.luparini@bugseng.com>, 
	Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Michal Orzel <michal.orzel@amd.com>, 
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, Ayan Kumar Halder <ayan.kumar.halder@amd.com>, 
	xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="00000000000055832605ffe14911"

--00000000000055832605ffe14911
Content-Type: text/plain; charset="UTF-8"

Il giorno gio 6 lug 2023 alle ore 10:04 Jan Beulich <jbeulich@suse.com> ha
scritto:

> On 05.07.2023 17:26, Simone Ballarin wrote:
> > --- a/xen/arch/x86/hvm/vmx/vvmx.c
> > +++ b/xen/arch/x86/hvm/vmx/vvmx.c
> > @@ -257,14 +257,14 @@ uint64_t get_vvmcs_virtual(void *vvmcs, uint32_t
> vmcs_encoding)
> >
> >      switch ( enc.width ) {
> >      case VVMCS_WIDTH_16:
> > -        res &= 0xffff;
> > +        res &= 0xffffU;
>
> I don't think the suffix is needed in cases like this one, and ...
>

> >          break;
> >     case VVMCS_WIDTH_64:
> >          if ( enc.access_type )
> >              res >>= 32;
> >          break;
> >      case VVMCS_WIDTH_32:
> > -        res &= 0xffffffff;
> > +        res &= 0xffffffffU;
>
> ... while generally I'm suggesting to avoid casts I wonder whether
> casting to uint32_t here wouldn't make things more obviously match
> the purpose. (Same again further down then.)
>

Using the cast is fine. I will change the patch.

>
> > --- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
> > +++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
> > @@ -207,7 +207,7 @@ void vmx_vmcs_reload(struct vcpu *v);
> >  #define CPU_BASED_ACTIVATE_MSR_BITMAP         0x10000000
> >  #define CPU_BASED_MONITOR_EXITING             0x20000000
> >  #define CPU_BASED_PAUSE_EXITING               0x40000000
> > -#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000
> > +#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000U
>
> Interesting - you don't change adjacent #define-s here, nor ...
>
> > @@ -257,7 +257,7 @@ extern u32 vmx_vmentry_control;
> >  #define SECONDARY_EXEC_XSAVES                   0x00100000
> >  #define SECONDARY_EXEC_TSC_SCALING              0x02000000
> >  #define SECONDARY_EXEC_BUS_LOCK_DETECTION       0x40000000
> > -#define SECONDARY_EXEC_NOTIFY_VM_EXITING        0x80000000
> > +#define SECONDARY_EXEC_NOTIFY_VM_EXITING        0x80000000U
>
> ... here. May I ask why that is? (I'm not opposed, but the
> description suggests otherwise.)
>
> > --- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
> > +++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
> > @@ -136,7 +136,7 @@ static inline void pi_clear_sn(struct pi_desc
> *pi_desc)
> >  /*
> >   * Exit Reasons
> >   */
> > -#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000
> > +#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000U
> >  #define VMX_EXIT_REASONS_BUS_LOCK       (1u << 26)
>
> Along the lines of the latter, perhaps switch to 1u << 31?
>
> > @@ -246,15 +246,15 @@ typedef union cr_access_qual {
> >  /*
> >   * Access Rights
> >   */
> > -#define X86_SEG_AR_SEG_TYPE     0xf        /* 3:0, segment type */
> > -#define X86_SEG_AR_DESC_TYPE    (1u << 4)  /* 4, descriptor type */
> > -#define X86_SEG_AR_DPL          0x60       /* 6:5, descriptor privilege
> level */
> > -#define X86_SEG_AR_SEG_PRESENT  (1u << 7)  /* 7, segment present */
> > -#define X86_SEG_AR_AVL          (1u << 12) /* 12, available for system
> software */
> > -#define X86_SEG_AR_CS_LM_ACTIVE (1u << 13) /* 13, long mode active (CS
> only) */
> > -#define X86_SEG_AR_DEF_OP_SIZE  (1u << 14) /* 14, default operation
> size */
> > -#define X86_SEG_AR_GRANULARITY  (1u << 15) /* 15, granularity */
> > -#define X86_SEG_AR_SEG_UNUSABLE (1u << 16) /* 16, segment unusable */
> > +#define X86_SEG_AR_SEG_TYPE     0xfU       /* 3:0, segment type */
> > +#define X86_SEG_AR_DESC_TYPE    (1U << 4)  /* 4, descriptor type */
> > +#define X86_SEG_AR_DPL          0x60U      /* 6:5, descriptor privilege
> level */
> > +#define X86_SEG_AR_SEG_PRESENT  (1U << 7)  /* 7, segment present */
> > +#define X86_SEG_AR_AVL          (1U << 12) /* 12, available for system
> software */
> > +#define X86_SEG_AR_CS_LM_ACTIVE (1U << 13) /* 13, long mode active (CS
> only) */
> > +#define X86_SEG_AR_DEF_OP_SIZE  (1U << 14) /* 14, default operation
> size */
> > +#define X86_SEG_AR_GRANULARITY  (1U << 15) /* 15, granularity */
> > +#define X86_SEG_AR_SEG_UNUSABLE (1U << 16) /* 16, segment unusable */
>
> How is this change related to rule 7.2? There are u suffixes already where
> needed (and 0xf and 0x60 don't strictly need one), so there's no violation
> here afaict. A mere style change to switch from u to U imo doesn't belong
> here (and, as mentioned while discussing the rule, is imo hampering
> readability in cases like these ones).
>
> Jan
>

In general, I will remove all non-strictly required U's you have pointed
out.
I will also amend the commit messages in these cases.

-- 
Simone Ballarin, M.Sc.

Field Application Engineer, BUGSENG (https://bugseng.com
<http://bugseng.com>)

--00000000000055832605ffe14911
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">Il giorno gio 6 lug 2023 alle ore 10:=
04 Jan Beulich &lt;<a href=3D"mailto:jbeulich@suse.com" target=3D"_blank">j=
beulich@suse.com</a>&gt; ha scritto:<br></div><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20=
4);padding-left:1ex">On 05.07.2023 17:26, Simone Ballarin wrote:<br>
&gt; --- a/xen/arch/x86/hvm/vmx/vvmx.c<br>
&gt; +++ b/xen/arch/x86/hvm/vmx/vvmx.c<br>
&gt; @@ -257,14 +257,14 @@ uint64_t get_vvmcs_virtual(void *vvmcs, uint32_t=
 vmcs_encoding)<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 switch ( enc.width ) {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 case VVMCS_WIDTH_16:<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 res &amp;=3D 0xffff;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 res &amp;=3D 0xffffU;<br>
<br>
I don&#39;t think the suffix is needed in cases like this one, and ...<br><=
/blockquote><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
&gt;=C2=A0 =C2=A0 =C2=A0case VVMCS_WIDTH_64:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if ( enc.access_type )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 res &gt;&gt;=3D 32;<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 case VVMCS_WIDTH_32:<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 res &amp;=3D 0xffffffff;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 res &amp;=3D 0xffffffffU;<br>
<br>
... while generally I&#39;m suggesting to avoid casts I wonder whether<br>
casting to uint32_t here wouldn&#39;t make things more obviously match<br>
the purpose. (Same again further down then.)<br></blockquote><div><br></div=
><div>Using the cast is fine. I will change the patch.<br></div><blockquote=
 class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px so=
lid rgb(204,204,204);padding-left:1ex">
<br>
&gt; --- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h<br>
&gt; +++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h<br>
&gt; @@ -207,7 +207,7 @@ void vmx_vmcs_reload(struct vcpu *v);<br>
&gt;=C2=A0 #define CPU_BASED_ACTIVATE_MSR_BITMAP=C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A00x10000000<br>
&gt;=C2=A0 #define CPU_BASED_MONITOR_EXITING=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A00x20000000<br>
&gt;=C2=A0 #define CPU_BASED_PAUSE_EXITING=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A00x40000000<br>
&gt; -#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000<br>
&gt; +#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000U<br>
<br>
Interesting - you don&#39;t change adjacent #define-s here, nor ...<br>
<br></blockquote><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt; @@ -257,7 +257,7 @@ extern u32 vmx_vmentry_control;<br>
&gt;=C2=A0 #define SECONDARY_EXEC_XSAVES=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00x00100000<br>
&gt;=C2=A0 #define SECONDARY_EXEC_TSC_SCALING=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 0x02000000<br>
&gt;=C2=A0 #define SECONDARY_EXEC_BUS_LOCK_DETECTION=C2=A0 =C2=A0 =C2=A0 =
=C2=A00x40000000<br>
&gt; -#define SECONDARY_EXEC_NOTIFY_VM_EXITING=C2=A0 =C2=A0 =C2=A0 =C2=A0 0=
x80000000<br>
&gt; +#define SECONDARY_EXEC_NOTIFY_VM_EXITING=C2=A0 =C2=A0 =C2=A0 =C2=A0 0=
x80000000U<br>
<br>
... here. May I ask why that is? (I&#39;m not opposed, but the<br>
description suggests otherwise.)<br>
<br></blockquote><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt; --- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h<br>
&gt; +++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h<br>
&gt; @@ -136,7 +136,7 @@ static inline void pi_clear_sn(struct pi_desc *pi_=
desc)<br>
&gt;=C2=A0 /*<br>
&gt;=C2=A0 =C2=A0* Exit Reasons<br>
&gt;=C2=A0 =C2=A0*/<br>
&gt; -#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000<br>
&gt; +#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000U<br>
&gt;=C2=A0 #define VMX_EXIT_REASONS_BUS_LOCK=C2=A0 =C2=A0 =C2=A0 =C2=A0(1u =
&lt;&lt; 26)<br>
<br>
Along the lines of the latter, perhaps switch to 1u &lt;&lt; 31?<br>
<br>
&gt; @@ -246,15 +246,15 @@ typedef union cr_access_qual {<br>
&gt;=C2=A0 /*<br>
&gt;=C2=A0 =C2=A0* Access Rights<br>
&gt;=C2=A0 =C2=A0*/<br>
&gt; -#define X86_SEG_AR_SEG_TYPE=C2=A0 =C2=A0 =C2=A00xf=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 /* 3:0, segment type */<br>
&gt; -#define X86_SEG_AR_DESC_TYPE=C2=A0 =C2=A0 (1u &lt;&lt; 4)=C2=A0 /* 4,=
 descriptor type */<br>
&gt; -#define X86_SEG_AR_DPL=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0x60=C2=A0 =
=C2=A0 =C2=A0 =C2=A0/* 6:5, descriptor privilege level */<br>
&gt; -#define X86_SEG_AR_SEG_PRESENT=C2=A0 (1u &lt;&lt; 7)=C2=A0 /* 7, segm=
ent present */<br>
&gt; -#define X86_SEG_AR_AVL=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (1u &lt;&lt;=
 12) /* 12, available for system software */<br>
&gt; -#define X86_SEG_AR_CS_LM_ACTIVE (1u &lt;&lt; 13) /* 13, long mode act=
ive (CS only) */<br>
&gt; -#define X86_SEG_AR_DEF_OP_SIZE=C2=A0 (1u &lt;&lt; 14) /* 14, default =
operation size */<br>
&gt; -#define X86_SEG_AR_GRANULARITY=C2=A0 (1u &lt;&lt; 15) /* 15, granular=
ity */<br>
&gt; -#define X86_SEG_AR_SEG_UNUSABLE (1u &lt;&lt; 16) /* 16, segment unusa=
ble */<br>
&gt; +#define X86_SEG_AR_SEG_TYPE=C2=A0 =C2=A0 =C2=A00xfU=C2=A0 =C2=A0 =C2=
=A0 =C2=A0/* 3:0, segment type */<br>
&gt; +#define X86_SEG_AR_DESC_TYPE=C2=A0 =C2=A0 (1U &lt;&lt; 4)=C2=A0 /* 4,=
 descriptor type */<br>
&gt; +#define X86_SEG_AR_DPL=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0x60U=C2=A0 =
=C2=A0 =C2=A0 /* 6:5, descriptor privilege level */<br>
&gt; +#define X86_SEG_AR_SEG_PRESENT=C2=A0 (1U &lt;&lt; 7)=C2=A0 /* 7, segm=
ent present */<br>
&gt; +#define X86_SEG_AR_AVL=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (1U &lt;&lt;=
 12) /* 12, available for system software */<br>
&gt; +#define X86_SEG_AR_CS_LM_ACTIVE (1U &lt;&lt; 13) /* 13, long mode act=
ive (CS only) */<br>
&gt; +#define X86_SEG_AR_DEF_OP_SIZE=C2=A0 (1U &lt;&lt; 14) /* 14, default =
operation size */<br>
&gt; +#define X86_SEG_AR_GRANULARITY=C2=A0 (1U &lt;&lt; 15) /* 15, granular=
ity */<br>
&gt; +#define X86_SEG_AR_SEG_UNUSABLE (1U &lt;&lt; 16) /* 16, segment unusa=
ble */<br>
<br>
How is this change related to rule 7.2? There are u suffixes already where<=
br>
needed (and 0xf and 0x60 don&#39;t strictly need one), so there&#39;s no vi=
olation<br>
here afaict. A mere style change to switch from u to U imo doesn&#39;t belo=
ng<br>
here (and, as mentioned while discussing the rule, is imo hampering<br>
readability in cases like these ones).<br>
<br>
Jan<br>
</blockquote></div><br clear=3D"all"><div>In general, I will remove all non=
-strictly required U&#39;s you have pointed out.</div><div>I will also amen=
d the commit messages in these cases.</div><br><span class=3D"gmail_signatu=
re_prefix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><div di=
r=3D"ltr">Simone Ballarin, M.Sc.<br><br><div>Field Application Engineer, BU=
GSENG (<a href=3D"http://bugseng.com" target=3D"_blank">https://bugseng.com=
</a>)</div></div></div></div>

--00000000000055832605ffe14911--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 08:23:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 08:23:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560280.876065 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHgkj-0005cr-8v; Fri, 07 Jul 2023 08:23:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560280.876065; Fri, 07 Jul 2023 08:23:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHgkj-0005ck-5x; Fri, 07 Jul 2023 08:23:45 +0000
Received: by outflank-mailman (input) for mailman id 560280;
 Fri, 07 Jul 2023 08:23:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=nfp+=CZ=epam.com=prvs=15521292a4=oleksandr_tyshchenko@srs-se1.protection.inumbo.net>)
 id 1qHgki-0005ce-0e
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 08:23:44 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9480f47e-1c9f-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 10:23:42 +0200 (CEST)
Received: from pps.filterd (m0174683.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 366MMq8x016062;
 Fri, 7 Jul 2023 08:23:38 GMT
Received: from eur04-vi1-obe.outbound.protection.outlook.com
 (mail-vi1eur04lp2055.outbound.protection.outlook.com [104.47.14.55])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3rp6bt95xy-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Fri, 07 Jul 2023 08:23:37 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com (2603:10a6:10:ed::15)
 by GV2PR03MB8656.eurprd03.prod.outlook.com (2603:10a6:150:7a::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 08:23:33 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::11f9:615a:4d9a:a5d2]) by DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::11f9:615a:4d9a:a5d2%6]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 08:23:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9480f47e-1c9f-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=jWUl5vgKjG2DWqFh4H5CRQbiV2aeiaFT5R2vHaUnz1RGNdLceO2PHLz2mj8zwMjUMKntBAkOLWqE+Y9xMXWLhf25BQZ+LHsapxRALdPi5jDiiuE9aPpXgzvjwmDgM2OgvW2Sv/5z3ocDKgEz6ZrOMUODsdjSXY+2OdnsKjVOY86BNB7PopiCgWwu43ywMbqz/AvZ1Sd3nUJXHmVfxoSrydKm0mgZX7wIeKS10t9KtUqrZM1dRysYe0BoGnM6s4Mc7zuRZxMlVJ7K+R2n56V32PMCCyM45fcYA+eOSHuHUfwu71gpuAHIPgOJahLdVHZjPXFveoB+STVxH68j3G/r4w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=XKMoTf8p1qmzaVkkjvwmNs//SOoX8IBLt3MCIw4TjSo=;
 b=RKspt9iv808o1UT/tGb/iPjZWjUMEmTg6XVBgdfO0c8kS0XlcvvvuBqhoc5YgBd3JbNbbvbhfdtOSWijAY7xN+4HTeK2/CBN+uD/Dp6GGfxfaJXpWHM9A1dMjtXdhz7u9SValJi5aoWO3/TMgY68XeSEntaoFUbrbcM6uKmil7YtAC+9mwIZj1nMv+arWR45unkU+CZrAaYqBgxlr2mspyczKUBp3AIjbA0n+Gqn/EQwCQnn2PgjAumGYBpU9SBIU+ISYqtV4swutIwlQ88b5W6C/M6xfW1b+sceW45d986ErkdsfdINcEi9EnZCQLbaNwcKqVhHOmDoyrEKFCjtng==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XKMoTf8p1qmzaVkkjvwmNs//SOoX8IBLt3MCIw4TjSo=;
 b=CioxoyLJeC2Qz4hDz7lTZtCfqcv4oqq9fgeIsD1U7OoZci8tlezMPhP4/5VCKWM0tIXNCxOnTMqTHg1YSHs3P2lfI1g9OUPzQSPGRB7xDs6SSg08IEJyPVajhoNhDcIuqPzROTxAABKlbYuK6yP9sV6MRFKXtzuNiNLWZ+ku3GtJ20SQBTqggqcIakzuYeaDHMi6ulTiQvSf6nn7mqJiIR0ysys3oUTH0LsxhwB7S9xCQ5RUzkyeDawnJlAO6ZFYrxcwURteUKsmdWga+Otyq8FRqoGhLqjnBEEbfYfWlOWttOTZWhbQ9JkUqtlDL8/zYy5Sr2Iqz/mKUipCuF6cmw==
From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
To: Juergen Gross <jgross@suse.com>,
        Stefano Stabellini
	<sstabellini@kernel.org>
CC: Petr Pavlu <petr.pavlu@suse.com>,
        "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>,
        "linux-kernel@vger.kernel.org"
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
Thread-Topic: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
Thread-Index: 
 AQHZpEL/jQILjif4TEa2QZqecjVVUK+Vi2cAgAt2NQCADPhOAIAAD7yAgAADBQCAAANwAA==
Date: Fri, 7 Jul 2023 08:23:33 +0000
Message-ID: <6fd98d3d-a83f-100e-93c4-b45cf335708f@epam.com>
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <alpine.DEB.2.22.394.2306281745010.3936094@ubuntu-linux-20-04-desktop>
 <f1a81ac1-5b9a-6d19-1a11-b98685bd2430@suse.com>
 <d5d6caa5-6ca6-b4b8-5334-fc156eeeb21d@epam.com>
 <8b862919-296d-d0b6-d4c1-465b62cfa37f@suse.com>
In-Reply-To: <8b862919-296d-d0b6-d4c1-465b62cfa37f@suse.com>
Accept-Language: en-US, ru-RU
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DB8PR03MB6108:EE_|GV2PR03MB8656:EE_
x-ms-office365-filtering-correlation-id: e9a67b84-3dc6-44e9-143b-08db7ec37443
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 Xphmgt0BKFE7BJD/xTh/wuH6ET2KDClsXG/DgJD4ITL8aRZDiydMDY3zbuCr9xl9vBrJTHhMOMgqJ9bKtL8WlpjGL8BjfnN+5OLoRA3+eQG6dn5pKevaYraRZrfGjJ0QRfCU0APfoTPZ/LsWEbIQdQkQHS0A0c5oh4Qp8RIdx3jdUYVMcKYrL5TNdnoB7ZgEHzcbQcHV+dco3+KiPK5AINvhTAuYfzFQ/gU2hDKBr/Ggv0oZEkNM8AyUyjTfiVTrmy3C9OShEc3B5HyKoOmoqNCASJl3lNDUIpeAfZJfrBrUHMxiv18GqIJoajLy6fmw4V30Q44RPYv8IOLan+KQ7zLLqPKbTm8cny9qH5BYZLTnAMc55EwCThjLZNSWW4kYUS2U2li8gQ23ttAhLd8U7RcOFNET5fruIMLKS+c9eMGajNiUPIHNm94OZ8vA3D/JjaqWN0rZUw/yjz3pSLyQfdDLzeb9gjRZIPBh5DQdnop0ltbteVowtZa8jzDTjr2YK/lQi2dY1VB2wyC7XNl4/LcaeADFFeEJjqF21UeuXZQbUvXACxbFN1pl1QhA/FrO5zzMmNvcR36oBcv5OeDq/qXB8Z9hGf40sh/2h1VeBg/c1RN/9h7WNvBSv2AymlAZa+xpO6wJ4Caijf9HMxhHYA==
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR03MB6108.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(346002)(366004)(396003)(39860400002)(451199021)(6486002)(478600001)(71200400001)(91956017)(110136005)(76116006)(54906003)(6506007)(26005)(41300700001)(6512007)(53546011)(66946007)(2906002)(186003)(4326008)(316002)(66446008)(64756008)(8676002)(8936002)(5660300002)(38100700002)(122000001)(66556008)(66476007)(36756003)(86362001)(31696002)(38070700005)(2616005)(83380400001)(31686004)(45980500001);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?Q0RvMmo4Yk1obXdSTFNsbHNEbmhYeE9GUHM3Y1MxdllVb3E5UFE1QVhnQUZE?=
 =?utf-8?B?b1pWUzhCOW9oWExVZ0hHY0IvZWhJU29MYlltNWU5WW0rUTBMeUZzY3VQZ2tl?=
 =?utf-8?B?elBJd1dBbmt5eVp4cUx1S0ttcDlmVytLTzdhaUdseHRqNXdTRlhIRlpHQVV6?=
 =?utf-8?B?U0FyNExDYWtYNWcxd29xMW00MU5PaEg1NmI4MVlZeGJPSXdZK3M4NGh3bzMz?=
 =?utf-8?B?SlZpNnl2OHp0dzN5eHhDOGM4OVVXNHJhM3JkeHcyeEJyQnIrR2tsZGJnWXgr?=
 =?utf-8?B?OGNSU1pCMWpScnVTbytVVGQ0ZlpXNjlsNkdrY1BSVSs3ZGw4VEU3ZlFkdzBj?=
 =?utf-8?B?QXgvTFNjK2pTdUsvS25CYllkTmQxVWZzZVY3VSs5blVKQjltUnh0R2xSOHhp?=
 =?utf-8?B?OVBCcENpNjc1cjVoTXVlbEtpSE85T0ppTWdCaUpOQ29Sb003U2xWaG5acnlp?=
 =?utf-8?B?aFk5emNPZDZEZnNTNnpDLzk5aTNvY1hYWFRrNXBqSFBqWU5OTnlPdllNZHpj?=
 =?utf-8?B?K3lsYWdGMU9lVkhxa1pSMEw4TlFZV29qWUhaNm9NNnY3Tz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JSVpE?=
 =?utf-8?B?azFEN2J2bnhmc1NpSitkZ0loYXF6ZjFaS2FzUXlkblMyU3MybjBQcm9VTldr?=
 =?utf-8?B?aDJ3dDlkK2lFaFdMRDcwMHBJWDhCanhUYW9BWUIyUy9vb3R2THhCczIvZjhh?=
 =?utf-8?B?RXl1WUtGV1doeXQ5ckErL1VFNkVzcmsyOXFHYVA5cUpscDZ2WVNVOGJaNjJC?=
 =?utf-8?B?c0w2T1JOSDdib2RjbERCcjh1MC9vSUZnTEM3RWlZY1pOeTE2WlM1QkRLa2dB?=
 =?utf-8?B?Y2grbmVsTjB1cGFUTWYrR05yMUc3c253R3dDblVDcHBSdS82N1lRcER6aEoy?=
 =?utf-8?B?RGpnZUh0eWxOeHdIbWFHUlZqbkVFV1hPZFVnb01UeEEyOUtDWjRKRHZudFYy?=
 =?utf-8?B?QXk0U2wwWVRwNjVZZXRBSDdBd0VKQ0ZTaUp4Y2I4UWpTY1YvbUJMa2xPOTMv?=
 =?utf-8?B?aURDV2JHY2ZXNkdTbEVoa0RZRTBoSDN0TWh0ME9uYzkvT2UzVWVna2phbUhN?=
 =?utf-8?B?Skd3ZHpXVi9ZWm1IbWoyZ3F0NkFtRlRKdjQxNzB0aGlYMEtESFUzamYvWlU1?=
 =?utf-8?B?S1hnZ0VqclZQVFVlRXJkK25kdlhpWDJSdG5wTlQzMFFHNDZrVVFIOThvdkZa?=
 =?utf-8?B?cDNTTkJCTHZPK1dzYkVmNkJydWhxSy9VSFp6OFlJRy9QeUR4YXJBdW9yRzB0?=
 =?utf-8?B?Z0t5VXIyNXVUdWpmWGdzaGE0aHU1QmZjYnJzcXI2M1l5OXhaZEdOWXJQek1k?=
 =?utf-8?Q?fCiPhr0pcDID72smSXeq88I=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <68636962385E3D40AEE3D03739B907C7@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DB8PR03MB6108.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e9a67b84-3dc6-44e9-143b-08db7ec37443
X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jul 2023 08:23:33.7034
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: f+9u/+/xr4mWMc9W3iyzsHyzJ5jdw9Q/nO4z/8ycrQhxt4gjM3wgq06NMubQML1z9SOG6rsANIGrpNjx5pue9sfUKcwKunuWPaG/2uxtRjQ=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR03MB8656
X-Proofpoint-GUID: JvT80BseL972exYhQWvq8v_IMhm4sLAE
X-Proofpoint-ORIG-GUID: JvT80BseL972exYhQWvq8v_IMhm4sLAE
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-07_04,2023-07-06_02,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0
 impostorscore=0 adultscore=0 lowpriorityscore=0 spamscore=0 bulkscore=0
 malwarescore=0 phishscore=0 priorityscore=1501 clxscore=1015 mlxscore=0
 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2305260000 definitions=main-2307070077

DQoNCk9uIDA3LjA3LjIzIDExOjExLCBKdWVyZ2VuIEdyb3NzIHdyb3RlOg0KDQpIZWxsbyBKdWVy
Z2VuDQoNCg0KPiBPbiAwNy4wNy4yMyAxMDowMCwgT2xla3NhbmRyIFR5c2hjaGVua28gd3JvdGU6
DQo+Pg0KPj4NCj4+IE9uIDA3LjA3LjIzIDEwOjA0LCBKdWVyZ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uDQoNCg0KPiANCj4gDQo+
IEp1ZXJnZW4NCj4g


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 08:38:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 08:38:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560288.876074 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHgym-0007Gw-Ja; Fri, 07 Jul 2023 08:38:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560288.876074; Fri, 07 Jul 2023 08:38:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHgym-0007Gp-H1; Fri, 07 Jul 2023 08:38:16 +0000
Received: by outflank-mailman (input) for mailman id 560288;
 Fri, 07 Jul 2023 08:38:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qHgyl-0007Gj-Ay
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 08:38:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHgyk-0004DS-Gj; Fri, 07 Jul 2023 08:38:14 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHgyk-0003sQ-9W; Fri, 07 Jul 2023 08:38:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=Go+gRQINtb+8VfVbDmio/1Qi9ARkNncfJHDaDLH14eY=; b=aBwsz3hz8vkNxullu6tAUfOwEL
	ebyGqVbHgo7rO6sILGJANEHPMnoK+Wr5saNb+ps5cSqxsDrcYtI/YKOOdockEqh+0GCNy52Dk0XrG
	u4rEZnyLD4tI28UYcpFPrckLvFjg45zYjbz8goP8e8O7ohhmJKXPG2Ht26+IxU7fBSyU=;
Message-ID: <b6edce56-a7a9-9df2-0275-5a529fd4df5a@xen.org>
Date: Fri, 7 Jul 2023 09:38:12 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 1/3] xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig
 option
Content-Language: en-US
To: Stewart Hildebrand <stewart.hildebrand@amd.com>,
 xen-devel@lists.xenproject.org
Cc: Rahul Singh <rahul.singh@arm.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Artem Mygaiev <artem_mygaiev@epam.com>,
 Stefano Stabellini <stefano.stabellini@amd.com>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-2-stewart.hildebrand@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230707014754.51333-2-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 07/07/2023 02:47, Stewart Hildebrand wrote:
> From: Rahul Singh <rahul.singh@arm.com>
> 
> Setting CONFIG_PCI_PASSTHROUGH=y will enable PCI passthrough on ARM, even though
> the feature is not yet complete in the current upstream codebase. The purpose of
> this is to make it easier to enable the necessary configs (HAS_PCI, HAS_VPCI) for
> testing and development of PCI passthrough on ARM.
> 
> Since PCI passthrough on ARM is still work in progress at this time, make it
> depend on EXPERT.
> 
> Signed-off-by: Rahul Singh <rahul.singh@arm.com>
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 08:56:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 08:56:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560292.876087 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHhFp-0001Ix-3G; Fri, 07 Jul 2023 08:55:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560292.876087; Fri, 07 Jul 2023 08:55:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHhFp-0001Iq-0l; Fri, 07 Jul 2023 08:55:53 +0000
Received: by outflank-mailman (input) for mailman id 560292;
 Fri, 07 Jul 2023 08:55:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qHhFo-0001Ik-F6
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 08:55:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHhFn-0004hg-Pd; Fri, 07 Jul 2023 08:55:51 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHhFn-0004bK-KX; Fri, 07 Jul 2023 08:55:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=5ZAAbAQXVlujAsv+zONtr4yalme7diH22JQeb/wvX3U=; b=e70se+6OLsTEE7BFGE5ckNuUfu
	T8XjNGh/U8ubjA9+k0aGgwD2MF65TVpv9VVmeD6uaPcJc6MDd0evzl4ZxBQA9NlWIzzxYkSU2eEqK
	kJT2Yu9PKL8x0Gt4g2hkHbjDRhT2AEv/UhJX7OYhQzJDxvI3SLpUGWJCZUKXkn2aM9wE=;
Message-ID: <d7964e48-4461-2126-5570-3425cbe5ce24@xen.org>
Date: Fri, 7 Jul 2023 09:55:49 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 2/3] xen/arm: make has_vpci depend on CONFIG_HAS_VPCI
Content-Language: en-US
To: Stewart Hildebrand <stewart.hildebrand@amd.com>,
 xen-devel@lists.xenproject.org
Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Artem Mygaiev <artem_mygaiev@epam.com>, Rahul Singh <rahul.singh@arm.com>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-3-stewart.hildebrand@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230707014754.51333-3-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 07/07/2023 02:47, Stewart Hildebrand wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> 
> VPCI is disabled on ARM. Make it depend on CONFIG_HAS_VPCI to test the PCI
> passthrough support. Also make it depend on is_hardware_domain for now. The
> is_hardware_domain check should be removed when vPCI is upstreamed.
> 
> While here, remove the comment on the preceding line.
> 
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> Signed-off-by: Rahul Singh <rahul.singh@arm.com>
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
> ---
> There are two downstreams [1] [2] that have independently made a version this
> change, each with different Signed-off-by's. I simply picked one at random for
> the Author: field, and added both Signed-off-by lines. Please let me know if
> there are any objections.
> 
> v1->v2:
> * add is_hardware_domain check. This will need to be removed after the vPCI
>    series [3] is merged.
> 
> downstream->v1:
> * change to IS_ENABLED(CONFIG_HAS_VPCI) instead of hardcoded to true
> * remove the comment on the preceding line
> 
> [1] https://gitlab.com/xen-project/people/bmarquis/xen-arm-poc/-/commit/27be1729ce8128dbe37275ce7946b2fbd2e5a382
> [2] https://github.com/xen-troops/xen/commit/bf12185e6fb2e31db0d8e6ea9ccd8a02abadec17
> [3] https://lists.xenproject.org/archives/html/xen-devel/2023-06/msg00863.html
> ---
>   xen/arch/arm/include/asm/domain.h | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
> index 99e798ffff68..1a13965a26b8 100644
> --- a/xen/arch/arm/include/asm/domain.h
> +++ b/xen/arch/arm/include/asm/domain.h
> @@ -298,8 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
>   
>   #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag)
>   
> -/* vPCI is not available on Arm */
> -#define has_vpci(d)    ({ (void)(d); false; })
> +#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); })

So in v1, I asked whether we should use is_hardware_domain() or 
d->arch.pci. I see you went with the former, but wouldn't this mean that 
the vPCI is always enabled for dom0 when CONFIG_HAS_VPCI=y?

Shouldn't this instead be conditional to pci_passthrough_enabled?

So you could return d->arch.pci in has_vcpi(). The field would be set by 
domain_create() based on the flags passed by the caller. I would 
properly plumb to xen_domctl_createdomain and has a check in 
arch_sanitise_domain_config() to confirm the flag can be set.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 09:01:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 09:01:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560296.876097 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHhKh-0002mT-LF; Fri, 07 Jul 2023 09:00:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560296.876097; Fri, 07 Jul 2023 09:00:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHhKh-0002mM-Ii; Fri, 07 Jul 2023 09:00:55 +0000
Received: by outflank-mailman (input) for mailman id 560296;
 Fri, 07 Jul 2023 09:00:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qHhKg-0002m0-AW
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 09:00:54 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHhKf-0004pa-OI; Fri, 07 Jul 2023 09:00:53 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHhKf-0004qo-FI; Fri, 07 Jul 2023 09:00:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=I+JnvBLIaHDyCFrFRMos4NrcRhxmHidcaEWQHAa28IM=; b=GBmpRZn5Ptwq3BUuTGeH5M7uwI
	WPVL0e7AMWzbSAC84aK4LzwqASRG5XbBru0dFU3LtYbKVZi86RL3sbFZ6YGNlNSsPcUvhlmyuJ3CH
	45VUDwWXGYCDFrzswhqsJEiPf0rm7+P2XW56bcQZnM5WDQtnFWfeDpKzJwKC+WpL+Gio=;
Message-ID: <e5a0ed8a-d85b-fb60-609a-f46884433c60@xen.org>
Date: Fri, 7 Jul 2023 10:00:51 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 3/3] [FUTURE] xen/arm: enable vPCI for domUs
Content-Language: en-US
To: Stewart Hildebrand <stewart.hildebrand@amd.com>,
 xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Artem Mygaiev <artem_mygaiev@epam.com>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-4-stewart.hildebrand@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230707014754.51333-4-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 07/07/2023 02:47, Stewart Hildebrand wrote:
> Remove is_hardware_domain check in has_vpci, and select HAS_VPCI_GUEST_SUPPORT
> in Kconfig.
> 
> [1] https://lists.xenproject.org/archives/html/xen-devel/2023-06/msg00863.html
> 
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
> ---
> As the tag implies, this patch is not intended to be merged (yet).

Can this be included in the vPCI series or resent afterwards?

> 
> Note that CONFIG_HAS_VPCI_GUEST_SUPPORT is not currently used in the upstream
> code base. It will be used by the vPCI series [1]. This patch is intended to be
> merged as part of the vPCI series.
> 
> v1->v2:
> * new patch
> ---
>   xen/arch/arm/Kconfig              | 1 +
>   xen/arch/arm/include/asm/domain.h | 2 +-
>   2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> index 4e0cc421ad48..75dfa2f5a82d 100644
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -195,6 +195,7 @@ config PCI_PASSTHROUGH
>   	depends on ARM_64
>   	select HAS_PCI
>   	select HAS_VPCI
> +	select HAS_VPCI_GUEST_SUPPORT
>   	default n
>   	help
>   	  This option enables PCI device passthrough
> diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
> index 1a13965a26b8..6e016b00bae1 100644
> --- a/xen/arch/arm/include/asm/domain.h
> +++ b/xen/arch/arm/include/asm/domain.h
> @@ -298,7 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
>   
>   #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag)
>   
> -#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); })
> +#define has_vpci(d)    ({ (void)(d); IS_ENABLED(CONFIG_HAS_VPCI); })

As I mentioned in the previous patch, wouldn't this enable vPCI 
unconditionally for all the domain? Shouldn't this be instead an 
optional feature which would be selected by the toolstack?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 09:08:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 09:08:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560300.876108 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHhS3-0003PN-Dc; Fri, 07 Jul 2023 09:08:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560300.876108; Fri, 07 Jul 2023 09:08:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHhS3-0003PG-A7; Fri, 07 Jul 2023 09:08:31 +0000
Received: by outflank-mailman (input) for mailman id 560300;
 Fri, 07 Jul 2023 09:08:30 +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
 <SRS0=jcIV=CZ=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qHhS2-0003PA-A2
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 09:08:30 +0000
Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com
 [2a00:1450:4864:20::12d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d5c03290-1ca5-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 11:08:27 +0200 (CEST)
Received: by mail-lf1-x12d.google.com with SMTP id
 2adb3069b0e04-4fb96e2b573so2573403e87.3
 for <xen-devel@lists.xenproject.org>; Fri, 07 Jul 2023 02:08:27 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 k5-20020a2e2405000000b002b6ed0067c9sm677827ljk.116.2023.07.07.02.08.26
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 07 Jul 2023 02:08:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d5c03290-1ca5-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688720907; x=1691312907;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=l5iyUwA+ap5Ftmsa8KDclgqU099yAaHoaPEMIz8CkiY=;
        b=hskvuzitWLro3xz/eH9p/aMlwNpvhad9Gzc/el/6ol8LCISh+rUUUinfFjg9OvKWNw
         SzBd1dbLDKauy9NEZ3bjL01+IgOVdv0efqN7WT2CRPmtqoDlcni3qyFTzJcQGrhTba4r
         9TI4Sh4XOyBifcwXZivDbasRE5MUbdXTMdzMNNU5uOUbWu29eRdBVa/saXuvT+K6ww03
         WOAK4v2irp7Fn5FUT9CLRXPE/ZF4xtV/nMPUe0w4M9F1GvVFLZqhQg0PCY4JwxhhbB4t
         fO3wRG+5S1sq3X3FIG7f00/Rnqa4eq561wB6swP1ailw4XPzkDe+6yNXgREPleNVGlQJ
         HcyA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688720907; x=1691312907;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=l5iyUwA+ap5Ftmsa8KDclgqU099yAaHoaPEMIz8CkiY=;
        b=iCKKlazGJkM1JLsEs+icsjpk6LZ2pFWD/mP6vY2buTbC59Q+p1jRbtoWnFQyaJ1pvZ
         gkD6N23OjbBmuuz9CUOgzKI34uqguxeEWSq4vmRMJDMsrhw6R7yRKy7Lkz3ZWbi7dyY6
         3gDCkpG//zefD2JPaOeqngYQUe/oms6fDuJs+r0e69u1TaI4hRDug05HAPd7RTqYT+zN
         J+lXEmKvaI1bl5izM8/YItpQE4AOT2OGbwkzZr9gRQiArLyoVetDPmzw7z+5YMVQ26eZ
         BjH3/196dwIdWtuvGgSfFHTwZsNsHpiR3jssfCshUC+8ABPaX0CRc7x7yXrWvWd8QHDq
         atzw==
X-Gm-Message-State: ABy/qLbmXrunRdSo/JRXPgmUOYTOpHekt0V0B8ndTh6XAs7MNfNidPvf
	roHUw86vrSfpMzIY/9phnBo=
X-Google-Smtp-Source: APBJJlFtP5R0dgQ2G/YHxPMc6vDzjacxfRoc9VqmNGpw5Temq7ZYYNn6c7e1f0eJfFVvzZZQllJ+/w==
X-Received: by 2002:a2e:b6d4:0:b0:2b6:a85e:4c3d with SMTP id m20-20020a2eb6d4000000b002b6a85e4c3dmr3104305ljo.32.1688720906882;
        Fri, 07 Jul 2023 02:08:26 -0700 (PDT)
Message-ID: <ba2694c1e64b6bdf493170c72564ae72d701b700.camel@gmail.com>
Subject: Re: [PATCH v2 2/6] xen/riscv: introduce reset_stack() function
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall
 <julien@xen.org>,  Bob Eshleman <bobbyeshleman@gmail.com>, Alistair Francis
 <alistair.francis@wdc.com>, Connor Davis <connojdavis@gmail.com>,
 xen-devel@lists.xenproject.org
Date: Fri, 07 Jul 2023 12:08:26 +0300
In-Reply-To: <98f1cb38-673a-c66f-96be-ba2cb6ff242f@suse.com>
References: <cover.1687178053.git.oleksii.kurochko@gmail.com>
	 <6024617719467cd2da8ae03b81ddc899f2ba4311.1687178053.git.oleksii.kurochko@gmail.com>
	 <98f1cb38-673a-c66f-96be-ba2cb6ff242f@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: base64
User-Agent: Evolution 3.48.3 (3.48.3-1.fc38) 
MIME-Version: 1.0

T24gVGh1LCAyMDIzLTA3LTA2IGF0IDEzOjE3ICswMjAwLCBKYW4gQmV1bGljaCB3cm90ZToKPiBP
biAxOS4wNi4yMDIzIDE1OjM0LCBPbGVrc2lpIEt1cm9jaGtvIHdyb3RlOgo+ID4gLS0tIGEveGVu
L2FyY2gvcmlzY3YvcmlzY3Y2NC9oZWFkLlMKPiA+ICsrKyBiL3hlbi9hcmNoL3Jpc2N2L3Jpc2N2
NjQvaGVhZC5TCj4gPiBAQCAtMjcsOCArMjcsMTYgQEAgRU5UUlkoc3RhcnQpCj4gPiDCoMKgwqDC
oMKgwqDCoMKgIGFkZMKgwqDCoMKgIHQzLCB0MywgX19TSVpFT0ZfUE9JTlRFUl9fCj4gPiDCoMKg
wqDCoMKgwqDCoMKgIGJsdHXCoMKgwqAgdDMsIHQ0LCAuTF9jbGVhcl9ic3MKPiA+IMKgCj4gPiAr
wqDCoMKgwqDCoMKgwqAgamFswqDCoMKgwqAgcmVzZXRfc3RhY2sKPiA+ICsKPiA+ICvCoMKgwqDC
oMKgwqDCoCB0YWlswqDCoMKgIHN0YXJ0X3hlbgo+ID4gKwo+ID4gK8KgwqDCoMKgwqDCoMKgIC5z
ZWN0aW9uIC50ZXh0LCAiYXgiLCAlcHJvZ2JpdHMKPiA+ICsKPiA+ICtFTlRSWShyZXNldF9zdGFj
aykKPiA+IMKgwqDCoMKgwqDCoMKgwqAgbGHCoMKgwqDCoMKgIHNwLCBjcHUwX2Jvb3Rfc3RhY2sK
PiA+IMKgwqDCoMKgwqDCoMKgwqAgbGnCoMKgwqDCoMKgIHQwLCBTVEFDS19TSVpFCj4gPiDCoMKg
wqDCoMKgwqDCoMKgIGFkZMKgwqDCoMKgIHNwLCBzcCwgdDAKPiA+IMKgCj4gPiAtwqDCoMKgwqDC
oMKgwqAgdGFpbMKgwqDCoCBzdGFydF94ZW4KPiA+ICvCoMKgwqDCoMKgwqDCoCByZXQKPiA+ICsK
PiAKPiBMb29raW5nIGF0IHBhdGNoIDQgeW91IHdpbGwgd2FudCB0byBhZGQgYSBjb21tZW50IGhl
cmUgdG8gZW1waGFzaXplCj4gdGhhdCBhMCBhbmQgYTEgaGF2ZSB0byByZW1haW4gdW5jbG9iYmVy
ZWQuClRoYW5rcyBmb3IgYSBub3RlLiBJJ2xsIGFkZCBpdCBpbiB0aGUgbmV3IHBhdGNoIHZlcnNp
b24KCn4gT2xla3NpaQoK



From xen-devel-bounces@lists.xenproject.org Fri Jul 07 09:12:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 09:12:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560304.876117 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHhVa-0004pv-S4; Fri, 07 Jul 2023 09:12:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560304.876117; Fri, 07 Jul 2023 09:12:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHhVa-0004po-PP; Fri, 07 Jul 2023 09:12:10 +0000
Received: by outflank-mailman (input) for mailman id 560304;
 Fri, 07 Jul 2023 09:12:08 +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
 <SRS0=jcIV=CZ=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qHhVY-0004pi-U3
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 09:12:08 +0000
Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com
 [2a00:1450:4864:20::22c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5884c991-1ca6-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 11:12:07 +0200 (CEST)
Received: by mail-lj1-x22c.google.com with SMTP id
 38308e7fff4ca-2b703d7ed3aso25958251fa.1
 for <xen-devel@lists.xenproject.org>; Fri, 07 Jul 2023 02:12:07 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 v16-20020a2e9f50000000b002b6fe751b6esm679254ljk.124.2023.07.07.02.12.05
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 07 Jul 2023 02:12:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5884c991-1ca6-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688721127; x=1691313127;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=lrUZH5OPBvrM+ZE4I5B5tGUAEUpwhPul9K/44S93/jk=;
        b=mDuB1cMSZooDY2ancPe1ytrRLFC22Q2aDm8M+PBgGLRirf0zPTla17V26bLSFEs1Ma
         G6b9CaujRnpSrqYJEuwATMO7gbrMMMk8s7U+rD+ghwr+yVdPXLPzAhrc29o0fVMiqpSS
         YIuvZrjjOWHM3wxIprZ96eSlXMH7zchYSr0x4SZuGmmdZ680xtuWO/XKcbllnrOvX/Rx
         4vdT5p4oKz0Jh0oU5WFYrhsGu9XtzdbNIAtRSZtqr1llNxnEyyR05cl9j6eMN7Psdugi
         OIGvXj8AAlvrVVUM/oy/pAl95R0fC7Tu2o/5FB7QX9tBMPBd9dlihh6am9py9mJxqtVL
         5SRg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688721127; x=1691313127;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=lrUZH5OPBvrM+ZE4I5B5tGUAEUpwhPul9K/44S93/jk=;
        b=ceLeibnYK/OJnHXndGJO2IWbtmLow95P+nVRui1tDylDrAQdl7V8vEltNo8ZUsDn3O
         2xUzjf2OApyC2L28fnDUXQL3eEUMXM1yn4xuE+XeDv1yktRerBvOSFOmoLy/xjecdFM0
         dimH8q6ykiR3Qs6tDdi7ApPvwJyxXiiBWxFMCNQ4BgeTS8wVY7Jk+dSpZ7kRaBrNpjuK
         TrGRS0T9zoQ09tZFW4c1q+LGDrDc9Fp4fzDrphZSAbUEuKphNaEsSG3cZHaG/EMXg5DB
         9Y+wH+4Xu3szLlVnYUW6y5/0Kvd1+tk2+X+9U39un0bunYR+SeX36l939GGlGJI+X5Kn
         vmmg==
X-Gm-Message-State: ABy/qLYAoNnKe1RP+eKE+wE2rcpuLlc/a5lvjecUP9Anz7ssr+pC/S35
	L1+JCsmKT0JR8FiLemdpZjLPEcgrKxs=
X-Google-Smtp-Source: APBJJlGaBM+5N/3JkS9VWKmGAoNYXOdrOEP9FdT0RwRe1JJPMfX1gPCwdTufy+I8zZlUVt3yqeoZow==
X-Received: by 2002:a2e:9656:0:b0:2b5:1b80:264b with SMTP id z22-20020a2e9656000000b002b51b80264bmr3809272ljh.12.1688721126414;
        Fri, 07 Jul 2023 02:12:06 -0700 (PDT)
Message-ID: <29c4af7dcc95956c12818fd024416930f90e12f7.camel@gmail.com>
Subject: Re: [PATCH v2 3/6] xen/riscv: introduce function for physical
 offset calculation
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall
 <julien@xen.org>,  Bob Eshleman <bobbyeshleman@gmail.com>, Alistair Francis
 <alistair.francis@wdc.com>, Connor Davis <connojdavis@gmail.com>,
 xen-devel@lists.xenproject.org
Date: Fri, 07 Jul 2023 12:12:05 +0300
In-Reply-To: <c716120e-8228-826a-bb33-298aa47b94f7@suse.com>
References: <cover.1687178053.git.oleksii.kurochko@gmail.com>
	 <f84bdc5ad9f10f864d070f7581dce663ccc9cb53.1687178053.git.oleksii.kurochko@gmail.com>
	 <c716120e-8228-826a-bb33-298aa47b94f7@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.3 (3.48.3-1.fc38) 
MIME-Version: 1.0

On Thu, 2023-07-06 at 13:18 +0200, Jan Beulich wrote:
> On 19.06.2023 15:34, Oleksii Kurochko wrote:
> > --- a/xen/arch/riscv/riscv64/head.S
> > +++ b/xen/arch/riscv/riscv64/head.S
> > @@ -29,6 +29,8 @@ ENTRY(start)
> > =C2=A0
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 jal=C2=A0=C2=A0=C2=A0=
=C2=A0 reset_stack
> > =C2=A0
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 jal=C2=A0=C2=A0=C2=A0=C2=A0=
 calc_phys_offset
> > +
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tail=C2=A0=C2=A0=C2=A0=
 start_xen
> > =C2=A0
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .section .text, "ax", =
%progbits
>=20
> Since you call a C function, the code to save/restore a0/a1 needs to
> move here (from patch 4).
Thanks. It makes sense.
It would be better to move save/restore a0/a1 ( from patch 4 )code
here.

The only one reason I didn't do that before that calc_phys_offset
doesn't touch that and it is guaranteed that it will not ( as it
doesn't have arguments )

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Fri Jul 07 09:17:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 09:17:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560308.876128 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHhaV-0005TO-F6; Fri, 07 Jul 2023 09:17:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560308.876128; Fri, 07 Jul 2023 09:17:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHhaV-0005TH-Bq; Fri, 07 Jul 2023 09:17:15 +0000
Received: by outflank-mailman (input) for mailman id 560308;
 Fri, 07 Jul 2023 09:17:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qHhaT-0005TA-9w
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 09:17:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHhaP-0005GC-Gi; Fri, 07 Jul 2023 09:17:09 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHhaP-0005b0-BF; Fri, 07 Jul 2023 09:17:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=k5AzDJVMp4OMlcz81MhKeLLr7xa4A6nQoz6IDL90oP4=; b=s+X+dbDNJPPw2hqNlpF2xwtk7r
	I5lm3J4SUfLJ1IPzDK/p8KGtZGSsTqGOkXOjCQnZAYQKYIyXMdPAdaUX66mOn1zxMwOp00Vj2IhtJ
	aF9rkKymBDMDq/70CJDk+e08PA5oZE6jazY74tFSWe6JV6nSU9tM44hnLJrRVmhLfe64=;
Message-ID: <b4cdc12c-19e8-cc5a-a981-052800970d38@xen.org>
Date: Fri, 7 Jul 2023 10:17:07 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 3/6] xen/riscv: introduce function for physical offset
 calculation
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>, Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1687178053.git.oleksii.kurochko@gmail.com>
 <f84bdc5ad9f10f864d070f7581dce663ccc9cb53.1687178053.git.oleksii.kurochko@gmail.com>
 <c716120e-8228-826a-bb33-298aa47b94f7@suse.com>
 <29c4af7dcc95956c12818fd024416930f90e12f7.camel@gmail.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <29c4af7dcc95956c12818fd024416930f90e12f7.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 07/07/2023 10:12, Oleksii wrote:
> On Thu, 2023-07-06 at 13:18 +0200, Jan Beulich wrote:
>> On 19.06.2023 15:34, Oleksii Kurochko wrote:
>>> --- a/xen/arch/riscv/riscv64/head.S
>>> +++ b/xen/arch/riscv/riscv64/head.S
>>> @@ -29,6 +29,8 @@ ENTRY(start)
>>>   
>>>  Â Â Â Â Â Â Â Â  jalÂ Â Â Â  reset_stack
>>>   
>>> +Â Â Â Â Â Â Â  jalÂ Â Â Â  calc_phys_offset
>>> +
>>>  Â Â Â Â Â Â Â Â  tailÂ Â Â  start_xen
>>>   
>>>  Â Â Â Â Â Â Â Â  .section .text, "ax", %progbits
>>
>> Since you call a C function, the code to save/restore a0/a1 needs to
>> move here (from patch 4).
> Thanks. It makes sense.
> It would be better to move save/restore a0/a1 ( from patch 4 )code
> here.
> 
> The only one reason I didn't do that before that calc_phys_offset
> doesn't touch that and it is guaranteed that it will not ( as it
> doesn't have arguments )

IIUC, the calling convention requires a0/a1 to be caller saved. So even 
if they are not used for arguments, such callee is still free to use 
them for internal purpose.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 09:29:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 09:29:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560312.876137 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHhm8-00070n-Ek; Fri, 07 Jul 2023 09:29:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560312.876137; Fri, 07 Jul 2023 09:29:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHhm8-00070g-C5; Fri, 07 Jul 2023 09:29:16 +0000
Received: by outflank-mailman (input) for mailman id 560312;
 Fri, 07 Jul 2023 09:29:16 +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
 <SRS0=ZtcG=CZ=linuxfoundation.org=gregkh@srs-se1.protection.inumbo.net>)
 id 1qHhm7-00070a-Sw
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 09:29:15 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bb8d048b-1ca8-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 11:29:13 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id B726D617BD;
 Fri,  7 Jul 2023 09:29:11 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 469D0C433C7;
 Fri,  7 Jul 2023 09:29:09 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bb8d048b-1ca8-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org;
	s=korg; t=1688722151;
	bh=TiVqgBQxOT3C3TBkmM/c7nKqqaoif0rl2+UYbMz3sqA=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=LyuLd0FCJEQhqnrVpquSVLKc/9uI0i7rdMICm0QZElUzRmgl1WAypdZRf644WG5w6
	 wVwwOe7uTbd6a5um1d6z2qgLJrXKCpq1rXMHNpxh0jP21HzLgs6LU7p19zMbzFotb4
	 nJtjTSe2HVhiChBbqKoLsix3YSP7/IVd7wy0lWd4=
Date: Fri, 7 Jul 2023 10:29:00 +0100
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Michael Kelley (LINUX)" <mikelley@microsoft.com>
Cc: Petr Tesarik <petrtesarik@huaweicloud.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>, Jason Gunthorpe <jgg@ziepe.ca>,
	Kees Cook <keescook@chromium.org>,
	Saravana Kannan <saravanak@google.com>,
	"moderated list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>,
	"moderated list:ARM PORT" <linux-arm-kernel@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:MIPS" <linux-mips@vger.kernel.org>,
	"open list:XEN SWIOTLB SUBSYSTEM" <iommu@lists.linux.dev>,
	Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	"petr@tesarici.cz" <petr@tesarici.cz>
Subject: Re: [PATCH v3 4/7] swiotlb: if swiotlb is full, fall back to a
 transient memory pool
Message-ID: <2023070706-humbling-starfish-c68f@gregkh>
References: <cover.1687859323.git.petr.tesarik.ext@huawei.com>
 <34c2a1ba721a7bc496128aac5e20724e4077f1ab.1687859323.git.petr.tesarik.ext@huawei.com>
 <BYAPR21MB1688AAC65852E75764F53099D72CA@BYAPR21MB1688.namprd21.prod.outlook.com>
 <2023070626-boxcar-bubbly-471d@gregkh>
 <BYAPR21MB168802F691D3041C9B2F9F2DD72CA@BYAPR21MB1688.namprd21.prod.outlook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <BYAPR21MB168802F691D3041C9B2F9F2DD72CA@BYAPR21MB1688.namprd21.prod.outlook.com>

On Thu, Jul 06, 2023 at 02:22:50PM +0000, Michael Kelley (LINUX) wrote:
> From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Sent: Thursday, July 6, 2023 1:07 AM
> > 
> > On Thu, Jul 06, 2023 at 03:50:55AM +0000, Michael Kelley (LINUX) wrote:
> > > From: Petr Tesarik <petrtesarik@huaweicloud.com> Sent: Tuesday, June 27, 2023
> > 2:54 AM
> > > >
> > > > Try to allocate a transient memory pool if no suitable slots can be found,
> > > > except when allocating from a restricted pool. The transient pool is just
> > > > enough big for this one bounce buffer. It is inserted into a per-device
> > > > list of transient memory pools, and it is freed again when the bounce
> > > > buffer is unmapped.
> > > >
> > > > Transient memory pools are kept in an RCU list. A memory barrier is
> > > > required after adding a new entry, because any address within a transient
> > > > buffer must be immediately recognized as belonging to the SWIOTLB, even if
> > > > it is passed to another CPU.
> > > >
> > > > Deletion does not require any synchronization beyond RCU ordering
> > > > guarantees. After a buffer is unmapped, its physical addresses may no
> > > > longer be passed to the DMA API, so the memory range of the corresponding
> > > > stale entry in the RCU list never matches. If the memory range gets
> > > > allocated again, then it happens only after a RCU quiescent state.
> > > >
> > > > Since bounce buffers can now be allocated from different pools, add a
> > > > parameter to swiotlb_alloc_pool() to let the caller know which memory pool
> > > > is used. Add swiotlb_find_pool() to find the memory pool corresponding to
> > > > an address. This function is now also used by is_swiotlb_buffer(), because
> > > > a simple boundary check is no longer sufficient.
> > > >
> > > > The logic in swiotlb_alloc_tlb() is taken from __dma_direct_alloc_pages(),
> > > > simplified and enhanced to use coherent memory pools if needed.
> > > >
> > > > Note that this is not the most efficient way to provide a bounce buffer,
> > > > but when a DMA buffer can't be mapped, something may (and will) actually
> > > > break. At that point it is better to make an allocation, even if it may be
> > > > an expensive operation.
> > >
> > > I continue to think about swiotlb memory management from the standpoint
> > > of CoCo VMs that may be quite large with high network and storage loads.
> > > These VMs are often running mission-critical workloads that can't tolerate
> > > a bounce buffer allocation failure.  To prevent such failures, the swiotlb
> > > memory size must be overly large, which wastes memory.
> > 
> > If "mission critical workloads" are in a vm that allowes overcommit and
> > no control over other vms in that same system, then you have worse
> > problems, sorry.
> > 
> > Just don't do that.
> > 
> 
> No, the cases I'm concerned about don't involve memory overcommit.
> 
> CoCo VMs must use swiotlb bounce buffers to do DMA I/O.  Current swiotlb
> code in the Linux guest allocates a configurable, but fixed, amount of guest
> memory at boot time for this purpose.  But it's hard to know how much
> swiotlb bounce buffer memory will be needed to handle peak I/O loads.
> This patch set does dynamic allocation of swiotlb bounce buffer memory,
> which can help avoid needing to configure an overly large fixed size at boot.

But, as you point out, memory allocation can fail at runtime, so how can
you "guarantee" that this will work properly anymore if you are going to
make it dynamic?

confused,

greg k-h


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 09:33:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 09:33:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560318.876149 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHhpt-0008WE-2b; Fri, 07 Jul 2023 09:33:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560318.876149; Fri, 07 Jul 2023 09:33:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHhps-0008W7-UW; Fri, 07 Jul 2023 09:33:08 +0000
Received: by outflank-mailman (input) for mailman id 560318;
 Fri, 07 Jul 2023 09:33:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ruU0=CZ=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHhpr-0008Vz-9r
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 09:33:07 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on061e.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::61e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 46cb8965-1ca9-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 11:33:06 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8589.eurprd04.prod.outlook.com (2603:10a6:102:218::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Fri, 7 Jul
 2023 09:33:03 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Fri, 7 Jul 2023
 09:33:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 46cb8965-1ca9-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=D+vv7H8hizUgys2OGFUDwNXKeQfHa8aKApj5CuX1FAHmYJeHuKcdYoN9easNChqpfDC+gFsTLWR/iZENqtOhzcEtlGizJasvZo5IyFJ+AirUMP4nLEtPfID7GJq2gjzfSr2VhRHEjMe8TIi9ZcVydQfbP+L5MN43ZbuDepLeh2w32MZvASTUoNeTp0oA1PzUVEAbUpa0Bd1Aw8ugv3tWY5MyADoZh4YILkxOpTRJswtNVOWomUHT2QPbp1pYyOgYyOTfHmxKY62CPjdiRxd630lbww4pqddwSZMHHgPDppckfqONwpiSycQhU5zpjEcShU/kwv1wPC9e9MPC187yzg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Wz1crOwYzBFGsGkYUaPG69JYQEtQrUtNxrg74IC0P0U=;
 b=OqKgATJ7UuML5hQKidDlmm90tj4cgZc6t7lAwEWJskpG8gZhAZSmoS3gNxwQEXTgn+8aqzP8Dh43bmmCAEsK4PeSfcIs9yJ/o6P10MCpkijhqBqgeDTJTrp4g9jM7HnSwA05JBWKzu6e1ECoip0SgZ2z/DVKuUvryo6YMq16cQC4SVCa66dVuJXChApMV7BB/4PCntGvynMAn65cRudSoI5s81t4MXRKWbR7mH8BFooZJKqKf4UU6/KIY4dkrv3Z1WsfS0zMCXJlGL/vOVY0DLFGYjnicC3OOAFZWkX3GPYASMtBIuhtRahMasDIUWjL3HpypI4+GbP7bddPlc/SeQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Wz1crOwYzBFGsGkYUaPG69JYQEtQrUtNxrg74IC0P0U=;
 b=aNfkqsYdeggWCdk5guLg6SV98Onx6JaZYYY3P2fldGeJT6DEOb0PzWf5VyrbWhvyD5eFUi685KRzRMjPeiBUX8ugKa9cGM0gEr4Uoey9zdZwrmiSz/Y7CUklOFkdyzH42NHrx3C28b/EvJB61swbWBoQ3j2fE0yqpurbeoXgU3vfGm5t1QCirFox7vqrCT3cyKKbe5AURxwtwZKVso0A/IdU5qLXjlqDDA9F52lsLlZOys5Byicr4C4n0Yem9OYSZXoMqawuqLTxeCs9KkkhQDI0zCrMCXQCnVMP3l64V7XgICVPy94l3HUv0t5bbrxVJoz2PYMTH3HNVoO5bdAS/A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <be40e52e-454c-57ba-0ad1-6fae2b896332@suse.com>
Date: Fri, 7 Jul 2023 11:33:00 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 2/6] xen/riscv: introduce reset_stack() function
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1687178053.git.oleksii.kurochko@gmail.com>
 <6024617719467cd2da8ae03b81ddc899f2ba4311.1687178053.git.oleksii.kurochko@gmail.com>
 <98f1cb38-673a-c66f-96be-ba2cb6ff242f@suse.com>
 <ba2694c1e64b6bdf493170c72564ae72d701b700.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ba2694c1e64b6bdf493170c72564ae72d701b700.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0146.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:96::20) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8589:EE_
X-MS-Office365-Filtering-Correlation-Id: ab470c7b-d152-4698-b3ec-08db7ecd2970
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	cx138B5rgj38NLZojDIor9iWIbKWW/LJ2UKNitbEt3WROY2ElC83cx3jM7BqarQ6CbxP/BbG7qHiihWJk8JYXgJwsAdOIUho1St7uM3NgWsCgNGSo3JW/+qSPGLSymC2DimNHVPLUoDs1zbDNWISJOgwb9IkgFSK4m6CaHvDmq0RgIJFp/kzy+2DZff6A/QHvtSduBhwxL/BjYg1XQZ/90l9F/tzR6wDJEWZAltiGnEMJ+/4JdoRmKuG8VBCnR+Dy4M1mDBWBwWHOFnXZ6Y6KymJRNiHAAofZLYqfddxTeckzExANBLdxTWZ0gs8HsNgaMtKi1YIbku2l5+HbE4FVY5OHvRdFMjFnrQQ58eP5EBXIV2G+Fy31qkqRTNlT1qxT2kEKWttV/h0TcOc1QccY3x9SW5Vg4YzslktIpiXo1G7fW7kaRZlY8AIt/eMCwjIJZGx94zTMDr7q7NJx+21aqr7CVXnlXz4iURnGHxg2aK0QYwpXf9sR4GwwLXLAhGpP6CJNvaKoRUOU+p1CuZp9jIniukShrv42ughM77kbNFcPn+CLoxsYBQhZvhmCGCQBLn8fUhI1FBuP9azp1n/V2m8kiDYTqB1zpFMCNmn2AY9GDODbIBPE5HNekUTHk2P1YbuBGCYBjZxQLVhhKfj8g==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(39860400002)(346002)(376002)(396003)(136003)(451199021)(41300700001)(4744005)(186003)(38100700002)(2616005)(53546011)(6506007)(83380400001)(6486002)(26005)(6512007)(31696002)(86362001)(54906003)(478600001)(66556008)(36756003)(316002)(4326008)(2906002)(66476007)(66946007)(8676002)(8936002)(6916009)(31686004)(5660300002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RENDa3V0b0FSUHdma1hONXI4RlZLcjN4b2M0cU9ZZkNIM0VNcHJXNU5BVW9W?=
 =?utf-8?B?YTVaTTNkeFc2dllpalE1VmRFclY3L3pGeGo4TkJGYmZ3azFSai9tR3I5ZmJw?=
 =?utf-8?B?Qmw5ZENMM05qYWNOQVhsNTNNc0lkREpObHVZcGpOdmVGRndZOTBnRmxlY3RM?=
 =?utf-8?B?QmpDUlk0RW9WSEd1aFBBeXhlR0N5dllvV3dtdjB1bmJWUkp3VzNPemV5YmJa?=
 =?utf-8?B?ZXF4VU0vOE1KM1RyVjZpOUVnMlo1QTlKRFhmdzF1U2VqQkZXZFNEbkU1WjJJ?=
 =?utf-8?B?MEN0eWNxSGVRWjZxNHhYb3hZc0RWeEpyUWZoNUZPalVOTmIzZjhoZHk1U1Fa?=
 =?utf-8?B?b29QTDRqT3l5cENGaDJWbWpBTmprU1hVcWhKSXkzUGZwc0hHaWVqN2g0MlNP?=
 =?utf-8?B?TTlDcHVNRnBoUlorWCtiaHBzTDRlaGY5RzJYV0hvYUJ4U0hMK3Qzbi8yNVVy?=
 =?utf-8?B?NVl5OFlMc2drS2d3ZnZDWm5xMVdlYys5UlVOcHRkcnc1NlMwb2g3QUlVZDYy?=
 =?utf-8?B?K1dSUzA3WllMSkoyYkM5UUsxSk5PZFN6Q2E0dnFzS2xZLy9xT2l1cjAzWCt6?=
 =?utf-8?B?cGhGNXBtTVdDem94ejRkTVpidnNOckF0U28rbnY4c3YwZkJ5UE5IOXY4Y0d6?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HBmMHVRd1NzeExqUC9YR01Fb005UEdCQkI2M0F3cVdPQUVDbUZ0OWNJ?=
 =?utf-8?B?Z0I3QzY5WDdKYm1WNFVKVXRaeHluaHRMNUZyVi9nNVZBSk9tSHNkNTJEMG8r?=
 =?utf-8?B?SkNSa0VmRlllVHdHOE54endOTzU5MWNxcW1VM01SaWhLb0lTOVRuRWlLc0VR?=
 =?utf-8?B?amtWQXhWdUZFWXlCK3dnNm1jK3pHVmlYa3d5ZGdtczFSWmZhdWxvaEhlQkt2?=
 =?utf-8?B?QkwzUXZaTFo2aGlxVXFuVEpMUmlrSTJpWWp6NkFOTnJPWnJHT2ZKbkY2cnVI?=
 =?utf-8?B?YVJ6bGxLOWxCM0FMenl1VVl4TVk4SHVGZ0hHUE44ck9BNitoUUxnNUNYRjZp?=
 =?utf-8?B?YlZjTnMvUlI2Z0FDNFpXM3VtQzlQejN4RlhsaFRPY2RQem5oZ2pRaGVudDNs?=
 =?utf-8?B?RG5jaldscTY2NHdnTTMzMWU4VVUvSnBvc0daV0xZV0NrRDVReitnNUVWcmcz?=
 =?utf-8?B?TXpJUXVyQTZPc3RrQWIwak10ZGJOV1FXNitqMWZ5UEtGSWc4MHIvNkI1bjU4?=
 =?utf-8?B?QXA3YWd3RWUzVG9tMDBZVWRmVFBCdjZVMWl0VXh2WXlNcGFuSDd1bm1wbXA2?=
 =?utf-8?Q?bz1T6c0554Sq4YhkxfAWvFomP?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ab470c7b-d152-4698-b3ec-08db7ecd2970
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 09:33:03.3122
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: D+6UvzFVKE6O9xnDPEKqEQfh2wAJh6RTySuzXXTTB+w12nb1rOxiRP2HyPTXOz7YUOKF4VALGJC1I9PaEt9buQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8589

On 07.07.2023 11:08, Oleksii wrote:
> On Thu, 2023-07-06 at 13:17 +0200, Jan Beulich wrote:
>> On 19.06.2023 15:34, Oleksii Kurochko wrote:
>>> --- a/xen/arch/riscv/riscv64/head.S
>>> +++ b/xen/arch/riscv/riscv64/head.S
>>> @@ -27,8 +27,16 @@ ENTRY(start)
>>> Â Â Â Â Â Â Â Â  addÂ Â Â Â  t3, t3, __SIZEOF_POINTER__
>>> Â Â Â Â Â Â Â Â  bltuÂ Â Â  t3, t4, .L_clear_bss
>>> Â 
>>> +Â Â Â Â Â Â Â  jalÂ Â Â Â  reset_stack
>>> +
>>> +Â Â Â Â Â Â Â  tailÂ Â Â  start_xen
>>> +
>>> +Â Â Â Â Â Â Â  .section .text, "ax", %progbits
>>> +
>>> +ENTRY(reset_stack)
>>> Â Â Â Â Â Â Â Â  laÂ Â Â Â Â  sp, cpu0_boot_stack
>>> Â Â Â Â Â Â Â Â  liÂ Â Â Â Â  t0, STACK_SIZE
>>> Â Â Â Â Â Â Â Â  addÂ Â Â Â  sp, sp, t0
>>> Â 
>>> -Â Â Â Â Â Â Â  tailÂ Â Â  start_xen
>>> +Â Â Â Â Â Â Â  ret
>>> +
>>
>> Looking at patch 4 you will want to add a comment here to emphasize
>> that a0 and a1 have to remain unclobbered.
> Thanks for a note. I'll add it in the new patch version

Having seen how things end up by the end of the series, there's an
alternative: You could save a0 and a1 ahead of the 1st call to
reset_stack, rather than immediately afterwards.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 09:35:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 09:35:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560322.876158 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHhsD-0000fq-DN; Fri, 07 Jul 2023 09:35:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560322.876158; Fri, 07 Jul 2023 09:35:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHhsD-0000fj-AW; Fri, 07 Jul 2023 09:35:33 +0000
Received: by outflank-mailman (input) for mailman id 560322;
 Fri, 07 Jul 2023 09:35:32 +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 <SRS0=ruU0=CZ=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHhsC-0000fY-4V
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 09:35:32 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20609.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::609])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9c9e6d8c-1ca9-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 11:35:30 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS4PR04MB9338.eurprd04.prod.outlook.com (2603:10a6:20b:4e6::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 09:35:27 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Fri, 7 Jul 2023
 09:35:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9c9e6d8c-1ca9-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=U2NUg5NX4S57MYok1RuHEjQY6Z6+FVPcVIMKEeg4X6Hir+kboJtSGoinmg7bs1aCJfEgZ2q69rBxkVbVxRGWrwm6ser1GiViGyfcbWT4Www399sKu7iBOj4f3Qw3Wt1UFnO/+ePpEgKVu9sjmeXlcZMj3GtkxWtTjVgi+4EVX8rKLEL+teTdfdabmC/PEGrLVOORdjH1feE+gj16+Eh9m9489WLjE9+xN5VAAEBd4ExtOSPldpz7KWA4Cd64uiOtKDoIDDXI7jVQ8oFb2M2p40Sv0PMbfkCRxswX25UItK0LyXrK2dh98209bVP4Ju5u/VuWYVZAxNaW1oazdyN+xw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7oaUgK4GUfbYgKkoMx0K06KlPIwsg+CPjsQWPNp5oZs=;
 b=gVNUwE486qmQchZF1vZCBalekvq/DL2lM92hGuRUnLIAej9suPygKpLaNFsepyq328HW9jQF2N4qcOzc5tvPI2IVINi4wAtTLxtMZSkMaOfQcejDuEkOMJn2Zmi4yY+QiMbfvSO7AOdQz5v6j3RGugR5NlUX6CVo816HQes0mTpsZ7X5hDbBT4VCrQ1qnszIwzzZCrd5fiR6eSEh2QmvhvyjnV68ZbVjzi+63IRBPd/4ARCnbu1uQUHgkiV/dkCmnitwQXy7MvIeVSoFyVbGKkFdhHuBUq2+44ofLymEDIYGbnadIh9jN85VmThMvHfaTyuIGROQ3MoBvZZWvNLMWQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7oaUgK4GUfbYgKkoMx0K06KlPIwsg+CPjsQWPNp5oZs=;
 b=wyx+JXFdOmsNes+8HzE4LAluGAeGY+znFTtSaMXscQMzjtERGNw/pyoTKCEqtQOinM5/93MSEdSSzxTkopve4XRI6HWM45gFupvoyNAZdZmxg5L1TCH6r/xYZZZlb098UPggUXq1LHB1om3wdV2zCuEcYgWDpT6SwFpg0Z2bYC+SG4ctxYLQKqwh1ALbZU35ZngcVFyPxY03JEtC4+dsX90lqZiBGt2BkcacjM1D1d8Hcvx2aoO+UZ0CMVw5T5gG07zzgvNJVyRHuNjPhVZUKKFldRXHaZWeVBYffrhiZamQADKt6Co45c2iuQzcqdV02jneXd3TgXAAQkSUZyDhdQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <7ab29494-a74c-5a03-3a91-acf30e39884f@suse.com>
Date: Fri, 7 Jul 2023 11:35:25 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 3/6] xen/riscv: introduce function for physical offset
 calculation
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1687178053.git.oleksii.kurochko@gmail.com>
 <f84bdc5ad9f10f864d070f7581dce663ccc9cb53.1687178053.git.oleksii.kurochko@gmail.com>
 <c716120e-8228-826a-bb33-298aa47b94f7@suse.com>
 <29c4af7dcc95956c12818fd024416930f90e12f7.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <29c4af7dcc95956c12818fd024416930f90e12f7.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0141.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:95::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS4PR04MB9338:EE_
X-MS-Office365-Filtering-Correlation-Id: 02f414cd-395a-4c09-8452-08db7ecd7f67
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	QM5/1s2yp+pFxY+oY4DRd8Dwd7PnGv0dUdNhrqtZFJq3UML00Ovm11EVgHbHLsD2h7SIFLGwT3SKfpJiCvCTigBOviyJgtxzEAgTkxC8cmAwbrnDJu4BnG306aManeyOYmbLjgmq9WWT1p58vDUrfy5k1KPybpaKE7+l2/5lo7UBEErROh0IL8vklMtBOVElSLw7CBGDH5qqIixyURHXl+OiO2dxjdW4r4ot+zAvGTEvkizWNt31wR0pBn97SbEORh3aRXgcQg+YQq4McyH5DzyzYXRLUACKz/pQToBPoD0tgh8CR3RIdBquVeLSC/Hb+UNrg128B2Ms05k0MMzPxu/wm/2W56UycYf4AmfZjomUTJs111riT9V7tI1yF3AUeYYkNGh6KepeB4aK3vS7t/XcHV0ReXoMpiao4g8EO7Ub7d54QbkDQRMdJ7eYvsukI2yfylswnMvEi30BLWlAwqGK3M414vx8cym5xnCsudppPtGz7NDlJLHwxr/TqkjNfvxhXLnrHYu4l5ankuRCmBkUXPU0deYPeTrqQI0J8pmrecicXuJPIcPOUFMLifllttwCr0qhkSg5EFhT4b5HU9HX677BqtdwnP0t3D/tVVTcYW7a5VNjs/kVLJ0Qvt5byqcO3b2Gs+N+HAAklZnYww==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(346002)(136003)(39860400002)(376002)(451199021)(5660300002)(31686004)(6506007)(186003)(2616005)(2906002)(8676002)(53546011)(8936002)(26005)(41300700001)(66946007)(6916009)(6486002)(66476007)(83380400001)(4326008)(36756003)(66556008)(54906003)(478600001)(6512007)(38100700002)(31696002)(316002)(86362001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MEZGMTA5Y2RpUXRWYmtJUGFqTkptTXI0SzV1UzlmR09tcWk4M1Z4U3JEQWpE?=
 =?utf-8?B?QTIrdnlzL1A5UHpsNkhMeDh1YkZSVktpdEdyN1VDbTZPVTVFOGErUTVFcjV1?=
 =?utf-8?B?dUVvOWpUUHdXbWJsWDVOeGRCa3d0aFVTdnVpWkl3bmNQQktZTGg2QWNUOEdl?=
 =?utf-8?B?NHlpZzMvd2tXOUhpaTlqbzI3b0s5OV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
 =?utf-8?B?cFFkTnZwbVc3MlYxcno5VEQ0cUVTRC9PakJXa3ZSZ1dIM28vREJoRlhiUHlY?=
 =?utf-8?B?dXRJZjMrcmppQmdKQnNTSmFvYzNSQTU3R0FwWVNWRzNrOTNuSWhGYVdIT043?=
 =?utf-8?B?RzdtZ0RzV1lRK3VPaEU1d3pMZTZPcW9ZY01SblZydlcydklsRGhjL3pZV0pD?=
 =?utf-8?Q?G+cyG7JfHpbwbxHIwr/63EvGZ?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 02f414cd-395a-4c09-8452-08db7ecd7f67
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 09:35:27.4852
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 70pA42mUX0egrSwjIySmCHMAcWT8Y4VchqkXgq3Qlr2kpS3lT4XgCIS/smW7fo3gLv3YSqJf/MP00FxFGSNVBQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9338

On 07.07.2023 11:12, Oleksii wrote:
> On Thu, 2023-07-06 at 13:18 +0200, Jan Beulich wrote:
>> On 19.06.2023 15:34, Oleksii Kurochko wrote:
>>> --- a/xen/arch/riscv/riscv64/head.S
>>> +++ b/xen/arch/riscv/riscv64/head.S
>>> @@ -29,6 +29,8 @@ ENTRY(start)
>>> Â 
>>> Â Â Â Â Â Â Â Â  jalÂ Â Â Â  reset_stack
>>> Â 
>>> +Â Â Â Â Â Â Â  jalÂ Â Â Â  calc_phys_offset
>>> +
>>> Â Â Â Â Â Â Â Â  tailÂ Â Â  start_xen
>>> Â 
>>> Â Â Â Â Â Â Â Â  .section .text, "ax", %progbits
>>
>> Since you call a C function, the code to save/restore a0/a1 needs to
>> move here (from patch 4).
> Thanks. It makes sense.
> It would be better to move save/restore a0/a1 ( from patch 4 )code
> here.
> 
> The only one reason I didn't do that before that calc_phys_offset
> doesn't touch that and it is guaranteed that it will not ( as it
> doesn't have arguments )

How does a function not having parameters guarantee that registers
used for parameter passing aren't touched? Inside a function, the
compiler is free to use argument-passing registers just like other
temporary ones; their values don't need preserving, from all I know
(otherwise the RISC-V ABI would be different to all other ABIs I
know of).

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 09:47:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 09:47:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560326.876168 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHi3D-0002Cu-Eu; Fri, 07 Jul 2023 09:46:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560326.876168; Fri, 07 Jul 2023 09:46:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHi3D-0002CX-BR; Fri, 07 Jul 2023 09:46:55 +0000
Received: by outflank-mailman (input) for mailman id 560326;
 Fri, 07 Jul 2023 09:46:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ruU0=CZ=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHi3B-0002CR-EF
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 09:46:53 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2084.outbound.protection.outlook.com [40.107.7.84])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3324844d-1cab-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 11:46:52 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM0PR04MB7058.eurprd04.prod.outlook.com (2603:10a6:208:195::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.25; Fri, 7 Jul
 2023 09:46:22 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Fri, 7 Jul 2023
 09:46:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3324844d-1cab-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=g3sMOCiqhA+R9XyvcUw5qVGIhvGgdQ6sRL5NWJ4ikzVHnARrl6FM8+QgKUmyS8zlHVUjpYMga/orJqioWyC7vYfvN4b8C892x0VLBEHfPN+iYSJ20PKolFbM/XpdjnVkSfQLVEE4ynKzDB9p7b1dY5+01mNZUl/NxU0hQlXt3if7D3XwiK9w9B/n31mSyAKhSocoE27rHDxG2zlf3xxJG/Ll834W3o5HwVAzZzY8SISZ73AjoZkdmkziZ6gSi+Va3UKpFZRAC14ki5d4ub8YKOFmLliFc3kNBjO2brOtfgksn0FDq+XtvOypCUH6/1n44jzSN97j/2RfzoJZp4ghWA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=iovSgwMsl9qSueX0ei/pPybtYiazGAWYTp8thLiQ7z0=;
 b=IGuCy7ixwEHJz2xDsRvenUu856NNuFMcb4ViL4I0JfvBpEk2v+tDxP1ojDJ/SuBI9Xxh8TLNDg+R4HPDhoH8+9d1ed5z5rtHEBYjyQwkJd08KNDEVQ5UP59LAWKjn31XpAbiN25N8aWpM0pNfST69AZb76kvAJjAMaOnE3sGkw5MmiCNc1hSVL2Qmjd3UUhxKAxNz3CKqZSWEHpSr5HJ6PiayHUSadKyFzstj3TWa7QRniDF8wL7aTkZgLbLUw63tWD9NhzU6r5xpVZvqPzdJWzQvxMKJPCIPmG3dE/MskQg8+AaamMIG4UD8iEdez2MVVzW9O12D4RpsP3ewnYeUw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=iovSgwMsl9qSueX0ei/pPybtYiazGAWYTp8thLiQ7z0=;
 b=zodgklskigt3zToaSQ3v6KWTLLwQm2k9p2N3E3jFY4gjdSj6NaOFFw/d5Fp80nPJDkR0bngSPQv/MPQ3mA6ttF3P4Q9UVn6AmAXs2yWpNJWl4TRRuMdmmDKgZGxUf6/jp+ZFuebWuSAvTmmuZI/PFHmiNp96EDJUAgRvvqoYplEiKZRkIvwF5bJc/g5qSs8pFWybYC4hD8LwZwgLolZvPcoyf+jbDkhtHEFKAgnrndDnx5lCFG6vs639RosgDYmDjqp3TcubG/py/Twq1O4VYL/uVEBl0EZ9JtNnWpM4suUxlteEiEshKsH1KY/1JiJuqX3/JSW+b9CzPlJ3v5rEWQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <f6c16d46-5804-a838-cf61-71fc671e394b@suse.com>
Date: Fri, 7 Jul 2023 11:46:19 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v2 12/13] xen/x86: fix violations of MISRA C:2012 Rule
 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Paul Durrant <paul@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <e414542d76d4a4a0df6ad969cc6332e355d6ef38.1688559115.git.gianluca.luparini@bugseng.com>
 <a343fc97-84df-48e6-1c91-cd933c6e5210@suse.com>
 <CAFHJcJu=S2JtFJy_XnMhrr0gP7+sPfvrS_1940qzL9rc_j60nA@mail.gmail.com>
 <f93f0561-abea-bdae-223e-d69932e435c4@suse.com>
 <CAFHJcJuP7hH01ZiwNe0HHBM=JpBtsF9sDD7fushyBxDQ9UZicw@mail.gmail.com>
 <fb29cca6-454c-82ed-b6a8-ac9814f81cfa@suse.com>
 <CAFHJcJuCddmwMAB=26tVBfgThQWLZb5kZU3GBdC0aTTcvJ4O1w@mail.gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <CAFHJcJuCddmwMAB=26tVBfgThQWLZb5kZU3GBdC0aTTcvJ4O1w@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0150.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:98::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM0PR04MB7058:EE_
X-MS-Office365-Filtering-Correlation-Id: 9f8726f2-7f4d-4ca9-3602-08db7ecf05cf
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	vXBhRWLF5rQtZFlWkdUCg+ZL90t/FAxrf5cdphTxhXw9XqWDhCeFMlMJocY9nxSqsRc46xqAfp4r1SPeTjXR09o4UpT4DqPMgy06mPKc9ThFtxfNpQc6Q26B6jrQqLvqdL3hL/IEUGJkgNoI5FwBvTFgmTWN1xFKV+L6JIStFX0ttJZsKfnzixrsJRnNBw+jwj7DbSrdYFLR045b6ubqjw0wRqWJ2gOMraFycXf2aQlg+BMyp9aO83j5DiC1nZHB05KTXlKN4swgC6Mgqcsw1byQhfrp58S1lTZs7JbWfKVLp5b0wNq6E1yTgWxtp9iLTS53tPO8ZqBUy90dvLVaGpqwmfNg5eWmgmEPFj22tVK5WuVLnIdZDeAgXt9Pl2Nxq6CWcxEl+AA6nhy7RrjElwjsSUMelxXaLLGRulhb3tmw3RVYTtG8tFUG2DqYLB3xbdLKB4Ymreg8/Wy1pN7ke/Go/ys25Xq1NhVbMgFW7QB7Mkr0rgthDho3VetAbF7kmxpHx6rdNFqXz0mA+2uH1a9Ws2bFvBLIcus1F77RQim5Ny4AdzVBENaXCqFcj7Zc2bLlmi9Xgr+UgNZ0d8VpyMyuuILRAgQPHh6q2dBKprZ1+FfjtABB4pZuwVOPkoJNqcJFseDfa79jPtt3Yw9IVg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(136003)(366004)(396003)(39860400002)(451199021)(478600001)(6486002)(6666004)(54906003)(53546011)(6506007)(26005)(186003)(6512007)(66946007)(2906002)(41300700001)(316002)(66476007)(6916009)(4326008)(66556008)(5660300002)(7416002)(8936002)(8676002)(38100700002)(86362001)(31696002)(36756003)(2616005)(83380400001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WCs3cElpL0htaE55L2NISlE1Q1B2eWk2eTZ1aDZYdW00VnloeUhwb1h3aTBF?=
 =?utf-8?B?RGxIdk9tR3JzOGhHRFFLS1NZUlJRcG44U0RFSXlUSy9wWk1TakQ0YXJYWEVM?=
 =?utf-8?B?VmxBN1lJWStkUTZGMFNNbDhmT0lPYXhoMldOKy8xcHFTd2VqKzVXZTVsV3pJ?=
 =?utf-8?B?QWdNNEJKQyszTEIzTnh1aXBMajVXc2FwbnlPN1NYMUxzMm0xSGJZRGFPSi9D?=
 =?utf-8?B?WjJaNXRrMFYwamxJb1cwUXhUVnhDQW5sZk5pNUxiWlBzK2ZNdWJ0OFJMWjhu?=
 =?utf-8?B?aUZ6SVVSZDVYemlHZXMyY01UZjFZTWh1eEEzOHdhb0hoTU1pYUVVQTVDZEtQ?=
 =?utf-8?B?dms2ZjJoY3Zmcl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?=
 =?utf-8?Q?PyDxopSWyVfVVOg2xM7uKWl2d?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9f8726f2-7f4d-4ca9-3602-08db7ecf05cf
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 09:46:22.5217
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 11NwAtNSNJnRNFDDCMHcQLpnVOSGplpDA+NK0oVKS2xbmMq90Hopzq8eKjvtgtqqSUEPuuVPTCH+kVdarvIb7g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7058

On 07.07.2023 10:04, Simone Ballarin wrote:
> Il giorno ven 7 lug 2023 alle ore 09:04 Jan Beulich <jbeulich@suse.com> ha
> scritto:
> 
>> On 07.07.2023 08:50, Simone Ballarin wrote:
>>> Il giorno gio 6 lug 2023 alle ore 18:22 Jan Beulich <jbeulich@suse.com>
>> ha
>>> scritto:
>>>
>>>> On 06.07.2023 18:08, Simone Ballarin wrote:
>>>>> Il giorno gio 6 lug 2023 alle ore 10:26 Jan Beulich <jbeulich@suse.com
>>>
>>>> ha
>>>>> scritto:
>>>>>
>>>>>> On 05.07.2023 17:26, Simone Ballarin wrote:
>>>>>>> --- a/xen/arch/x86/apic.c
>>>>>>> +++ b/xen/arch/x86/apic.c
>>>>>>> @@ -1211,7 +1211,7 @@ static void __init calibrate_APIC_clock(void)
>>>>>>>       * Setup the APIC counter to maximum. There is no way the lapic
>>>>>>>       * can underflow in the 100ms detection time frame.
>>>>>>>       */
>>>>>>> -    __setup_APIC_LVTT(0xffffffff);
>>>>>>> +    __setup_APIC_LVTT(0xffffffffU);
>>>>>>
>>>>>> While making the change less mechanical, we want to consider to switch
>>>>>> to ~0 in this and similar cases.
>>>>>>
>>>>>
>>>>> Changing ~0U is more than not mechanical: it is possibly dangerous.
>>>>> The resulting value could be different depending on the architecture,
>>>>> I prefer to not make such kind of changes in a MISRA-related patch.
>>>>
>>>> What do you mean by "depending on the architecture", when this is
>>>> x86-only code _and_ you can check what type parameter the called
>>>> function has?
>>>
>>> Ok, I will change these literals in ~0U in the next submission.
>>
>> Except that I specifically meant ~0, not ~0U. We mean "maximum value"
>> here, and at the call site it doesn't matter how wide the function
>> parameter's type is. If it was 64-bit, ~0U would not do what is wanted.
> 
> ~0 is not a MISRA-compliant solution since bitwise operations on signed
> integers have implementation-defined behavior. This solution definitively
> violates Rule 10.1.

So if we adopted that rule (we didn't so far), we'd have to e.g. change
all literal number shift counts to have U suffixes, no matter that
without the suffix it is still entirely obvious that the numbers are
unsigned? I'm afraid that'll face my opposition ...

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 09:50:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 09:50:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560332.876178 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHi6d-0003gx-WD; Fri, 07 Jul 2023 09:50:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560332.876178; Fri, 07 Jul 2023 09:50:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHi6d-0003gq-TF; Fri, 07 Jul 2023 09:50:27 +0000
Received: by outflank-mailman (input) for mailman id 560332;
 Fri, 07 Jul 2023 09:50:26 +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
 <SRS0=GM+b=CZ=citrix.com=prvs=545203e5e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qHi6c-0003gk-F8
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 09:50:26 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b03ae819-1cab-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 11:50:23 +0200 (CEST)
Received: from mail-mw2nam10lp2109.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.109])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 07 Jul 2023 05:50:20 -0400
Received: from MW4PR03MB6428.namprd03.prod.outlook.com (2603:10b6:303:123::8)
 by BN8PR03MB4980.namprd03.prod.outlook.com (2603:10b6:408:7e::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24; Fri, 7 Jul
 2023 09:50:18 +0000
Received: from MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd]) by MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd%7]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 09:50:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b03ae819-1cab-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688723423;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=zePFT5XiLmd40NLg3plqqxO2fHljGl/Nzfc0ZkSQVJE=;
  b=Ms6uHK2gFcVJP47pPwFI3EwmW077ZXto1OsX+TojSJdQ50VnY2a+JMZM
   EDeqqWFLBAI58ZMejnfseiCbNeyVsfrhaEwbYNtrG25mcDaXX3u7QrTaL
   MSABSHe/rcdR+sWBYzpo4n3irT7FdwaKvqhEvahgsT8PxIUdB5oR2PUA2
   w=;
X-IronPort-RemoteIP: 104.47.55.109
X-IronPort-MID: 115479382
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:BGsT7KtZEYJMR6XhLBxYNs7zr+fnVB5eMUV32f8akzHdYApBsoF/q
 tZmKW3TMqnca2PwfY8gOoWw8E4G78OAztBnSQps+yoyFyNG+JbJXdiXEBz9bniYRiHhoOCLz
 O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQqIu
 Nfjy+XSI1bg0DNvWo4uw/vrRChH4rKq4Vv0gnRkPaoQ5ACGyCFMZH4iDfrZw0XQE9E88tGSH
 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9
 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG
 fMwFRYKYzmIisKP6buUTrlAiJ4YJZHnBdZK0p1g5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,187,1684814400"; 
   d="scan'208";a="115479382"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=EdwUEwUpkpyRqOGIStLkrIAVnHKwrLfx/tD2nk3jGV0PdvCViTObP9wTu9u4dB0AfSHyl1IIMYL9sriDi0tTNPZMogUG7IBeJRqOIf9mdVeJpfLwld1Ilz2pqMOlibmstTXQESmamEoZ9B6hstBSvQFWROMt9KIATXlRXowGN8MT9hMI4puFY24R3/D9NG4HSBBITfBmjoy7YmMaWSssD+QBYsou6kUoTrGg3E3CXZ0uPLOjbF4W0QkFSM5AZIHP5ewPFQyrqwMVWQJRkiGfpgtr+nXl1ljkdJCHdVMUIDw4tQC/K/7ZkS7ivmgaYQlflYUKMibo98flG4/S7me4cg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=FEN7c4/uKWPuDvJoEF95j+vvshfPei0q6oHxHAVw6pg=;
 b=ID1KNLntzfhjNAoLyHB2OLSftkgwmsIN1UdO8gF6k1tXUJeNrZTCUt0LszfowDLFYVVUoxDiAAEM/ULLMCn4GXwpQXZ+RLKqGCI2pDZRO7rilox/Em8lWHP/G585HsIvFGt3tejToKOWD5+ZPgMubKGTVD4vHe08jJtSITOjJt0yXRY3VjTp9EFuV2MfrWSONDmJetJsLqDn4Y6NC+lIqROZf7sdyisfAn2hVJKHr6cv8Afa8Y8UqpF+xlB37SYu51dU1tUXfClt7C/Azw3S3YK1thWagaG1i8H3E6QUAdpSfhaVUilTb79ir/Vew480TJmTqDrbpRzTHNjhN6xuGQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=FEN7c4/uKWPuDvJoEF95j+vvshfPei0q6oHxHAVw6pg=;
 b=vVhpynQGZ+VeJeTM83iJ85DVJrt4Znxy9H5+HDWbDrhIDk1UguGG04VhNE5E/J8LMkEmljl3Es686vCADjLh3xNbjJxxB9sjvmnrTIaTdHqresIsgbQTz3z1Hc8PCZryLXqxaFTNJnfG45wFlqeziq7pCwso46XYsEd+CuFNsoQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 7 Jul 2023 11:50:11 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <olekstysh@gmail.com>,
	Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
	Petr Pavlu <petr.pavlu@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	vikram.garhwal@amd.com
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
Message-ID: <ZKff0w2EpzX5r8vK@MacBook-Air-de-Roger.local>
References: <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>
 <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com>
 <ZKQF8qq8Oh5E+Fxx@mail-itl>
 <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
 <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
 <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
 <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>
 <05341cac-ac75-a6e5-9c29-3caf83ea99fc@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <05341cac-ac75-a6e5-9c29-3caf83ea99fc@suse.com>
X-ClientProxiedBy: LO4P123CA0694.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:37b::16) To MW4PR03MB6428.namprd03.prod.outlook.com
 (2603:10b6:303:123::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MW4PR03MB6428:EE_|BN8PR03MB4980:EE_
X-MS-Office365-Filtering-Correlation-Id: 4ad12349-2f80-480f-cd84-08db7ecf91fa
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	8tDTpj9dU8ePL3shRP5PshJ2WmRtYPMNMS3l73tX5/q+QmFInJLGpIM80KwmryJTQgu4BhxV1r1lwlFXag8sNk7vGklEQyvyQb0s897MRoNuNArqVN6d26EXrZd7VcxutSX6ChiXzK9EHHuC995TlxeHlpbsNojp8RYuYtzlvdAT4wQafIazu7J1/cXgPBOQIXnx8VfBWNvRCeTP3xZaGN/0eZzGPx6EhOt4Y9UEGp34wRMHBykoEfZdYYzy9b7+G/ZPowq/TSGkio6Bie2BbhiRUBEtETY4J+Mvhc0aCnb2fA8pYxflbLDJJbpvd0d8+8cwtU4L4ZYsOZ9wQv6zwl/GAmkcb/bnT3xCicRn/RnbRaQ3Eg1UiWhWW6RXrGm0GKoyZsVA9pss4pEidSXaCxWjtLLNSLtwkspP2F2/Msey3u4YmsMi7pIJJKjHxpuiDGgX7ARRccH+bvooaKxu06A5tzHw1DcFyARGkPpjokyRvcF0vkuT9UakKYY9nbEqrlnXqiBzilz09LftFw+rV8BmVuIcKR25qQ24ueAQ/1ByAijRFlTU1MiXzqQwPtH+
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR03MB6428.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(346002)(366004)(136003)(39860400002)(451199021)(478600001)(5660300002)(8936002)(316002)(8676002)(66946007)(66556008)(41300700001)(4326008)(66476007)(6916009)(2906002)(54906003)(6486002)(6666004)(6512007)(66899021)(26005)(6506007)(9686003)(186003)(53546011)(82960400001)(83380400001)(86362001)(85182001)(38100700002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bzhXcklsTFdBNDFNc1pEVXBKb0c3QlBQc3kxVUc1NG5NNUNIRkRaTXpYU05R?=
 =?utf-8?B?UzNRd1VWVDIrWFgrUnJCUWJsZm5LTFgvMEJ1MHNZeXBJeVJyNEY3MW1xbnlB?=
 =?utf-8?B?bzN0YW9JTE9jYmdCYmovU3RuOUo1bnNsRTBjTk01YWxQOWtUZ3BTRkZqU0J1?=
 =?utf-8?B?YWFMcVR4TjlOYmhhdlRQcXk1cElGM3dGZHc3dWZIL2RKcEtnck15bE1aWHV5?=
 =?utf-8?B?STI4UTh5dnFkYTE4T3dJR3VXWUU0ZitOUlRlL29XTERNSkdaOWNWYmN2TFp6?=
 =?utf-8?B?RWZKUXNVUDN5eG5zVnFoTVM4K3Z0UjdNdmtVcVdJNysrWWk0SGw0VUFOS1VL?=
 =?utf-8?B?Q0FQYWtOSVVjV3R6TjV1WXZUZ0lKTUdxSFArdzNaWk9RMm1TSWZaV1IxbVFn?=
 =?utf-8?B?WlNoc0xUdUhjd3F4NDBGZVZPO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RKzQwdjFJRCtX?=
 =?utf-8?B?ZVpWSVRZWlRwdmJ3U0c2NDFJVjNvRGRiWXh5NnQyYTlVaWkwZ2tJanBkaVBC?=
 =?utf-8?B?dE9ZQ3UvaU5lN1JVZUkvdTRqMzUwQkh1NmNWSkNad1VzTHBaQWpML3ovbXAv?=
 =?utf-8?B?aE4xMEVEY01rR3h4L05VcEQxYjdFejFLZFBWQ0lYU2JwQVZOTEsyNi9TSzVu?=
 =?utf-8?B?Y2VLZUdDVC9QMXpYOGhDYXc1Z1pmcUM4K3dVd1BxQTg4Nm5JTlVidTBDb0h3?=
 =?utf-8?B?ZmJBWEVFUEV2NTFNRlUvV2ZWUWM1MnJ3VXJiNDdzWnpzL0FvSjY2aVY3WFJ3?=
 =?utf-8?B?cDBDRHFjOEc3a0o2bWRvVERrZzF2RGk4bXMrUkJxbEZtMmg0SS9ObkVCWmhj?=
 =?utf-8?B?Q1pxQ21zNU1pQzJ6djMzNlVtMHhMRDdRZi9YTXFsc2tJVG04MFEzcDdvZXdX?=
 =?utf-8?B?L21YSGlKb2UwNkVCL3BubzJBQnlaMGtBT0FTQUpaWlRVOTMvWXAzVmQwaklj?=
 =?utf-8?Q?NnSJR1+Iu+/mFYAbCkFpEbNEQYVxMw4r/V?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4ad12349-2f80-480f-cd84-08db7ecf91fa
X-MS-Exchange-CrossTenant-AuthSource: MW4PR03MB6428.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 09:50:17.8443
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ksjrDWtqWcxejqMpGLIHPl7hsxmC1bMlJIeJxq6dQxfzYLW8WBSCUpQxArMx/4QnyGv+q2vRGwnLakoJ0G3V1w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR03MB4980

On Fri, Jul 07, 2023 at 06:38:48AM +0200, Juergen Gross wrote:
> On 06.07.23 23:49, Stefano Stabellini wrote:
> > On Thu, 6 Jul 2023, Roger Pau MonnÃ© wrote:
> > > On Wed, Jul 05, 2023 at 03:41:10PM -0700, Stefano Stabellini wrote:
> > > > On Wed, 5 Jul 2023, Roger Pau MonnÃ© wrote:
> > > > > On Tue, Jul 04, 2023 at 08:14:59PM +0300, Oleksandr Tyshchenko wrote:
> > > > > > Part 2 (clarification):
> > > > > > 
> > > > > > I think using a special config space register in the root complex would
> > > > > > not be terrible in terms of guest changes because it is easy to
> > > > > > introduce a new root complex driver in Linux and other OSes. The root
> > > > > > complex would still be ECAM compatible so the regular ECAM driver would
> > > > > > still work. A new driver would only be necessary if you want to be able
> > > > > > to access the special config space register.
> > > > > 
> > > > > I'm slightly worry of this approach, we end up modifying a root
> > > > > complex emulation in order to avoid modifying a PCI device emulation
> > > > > on QEMU, not sure that's a good trade off.
> > > > > 
> > > > > Note also that different architectures will likely have different root
> > > > > complex, and so you might need to modify several of them, plus then
> > > > > arrange the PCI layout correctly in order to have the proper hierarchy
> > > > > so that devices belonging to different driver domains are assigned to
> > > > > different bridges.
> > > > 
> > > > I do think that adding something to the PCI conf register somewhere is
> > > > the best option because it is not dependent on ACPI and it is not
> > > > dependent on xenstore both of which are very undesirable.
> > > > 
> > > > I am not sure where specifically is the best place. These are 3 ideas
> > > > we came up with:
> > > > 1. PCI root complex
> > > > 2. a register on the device itself
> > > > 3. a new capability of the device
> > > > 4. add one extra dummy PCI device for the sole purpose of exposing the
> > > >     grants capability
> > > > 
> > > > 
> > > > Looking at the spec, there is a way to add a vendor-specific capability
> > > > (cap_vndr = 0x9). Could we use that? It doesn't look like it is used
> > > > today, Linux doesn't parse it.
> > > 
> > > I did wonder the same from a quick look at the spec.  There's however
> > > a text in the specification that says:
> > > 
> > > "The driver SHOULD NOT use the Vendor data capability except for
> > > debugging and reporting purposes."
> > > 
> > > So we would at least need to change that because the capability would
> > > then be used by other purposes different than debugging and reporting.
> > > 
> > > Seems like a minor adjustment, so might we worth asking upstream about
> > > their opinion, and to get a conversation started.
> > 
> > Wait, wouldn't this use-case fall under "reporting" ? It is exactly what
> > we are doing, right?
> 
> I'd understand "reporting" as e.g. logging, transferring statistics, ...
> 
> We'd like to use it for configuration purposes.

I've also read it that way.

> Another idea would be to enhance the virtio IOMMU device to suit our needs:
> we could add the domid as another virtio IOMMU device capability and (for now)
> use bypass mode for all "productive" devices.

If we have to start adding capabilties, won't it be easier to just add
it to the each device instead of adding it to virtio IOMMU.  Or is the
parsing of capabilities device specific, and hence we would have to
implement such parsing for each device?  I would expect some
capabilities are shared between all devices, and a Xen capability could
be one of those.

> Later we could even add grant-V3 support to Xen and to the virtio IOMMU device
> (see my last year Xen Summit design session). This could be usable for
> disaggregated KVM setups, too, so I believe there is a chance to get this
> accepted.
> 
> > > > > > **********
> > > > > > What do you think about it? Are there any pitfalls, etc? This also requires
> > > > > > system changes, but at least without virtio spec changes.
> > > > > 
> > > > > Why are we so reluctant to add spec changes?  I understand this might
> > > > > take time an effort, but it's the only way IMO to build a sustainable
> > > > > VirtIO Xen implementation.  Did we already attempt to negotiate with
> > > > > Oasis Xen related spec changes and those where refused?
> > > > 
> > > > That's because spec changes can be very slow. This is a bug that we need
> > > > a relatively quick solution for and waiting 12-24 months for a spec
> > > > update is not realistic.
> > > > 
> > > > I think a spec change would be best as a long term solution. We also
> > > > need a short term solution. The short term solution doesn't have to be
> > > > ideal but it has to work now.
> > > 
> > > My fear with such approach is that once a bodge is in place people
> > > move on to other stuff and this never gets properly fixed.
> > > 
> > > I know this might not be a well received opinion, but it would be
> > > better if such bodge is kept in each interested party patchqueue for
> > > the time being, until a proper solution is implemented.  That way
> > > there's an interest from parties into properly fixing it upstream.
> > 
> > Unfortunately we are in the situation where we have an outstanding
> > upstream bug, so we have to take action one way or the other.
> 
> The required virtio IOMMU device modification would be rather small, so
> adding it maybe under a CONFIG option defaulting to off might be
> acceptable.

Would you then do the grant allocation as part of virtio IOMMU?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 09:53:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 09:53:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560337.876188 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHi99-0004Fv-D8; Fri, 07 Jul 2023 09:53:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560337.876188; Fri, 07 Jul 2023 09:53:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHi99-0004Fo-A0; Fri, 07 Jul 2023 09:53:03 +0000
Received: by outflank-mailman (input) for mailman id 560337;
 Fri, 07 Jul 2023 09:53:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6jVP=CZ=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qHi98-0004Fg-3l
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 09:53:02 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0f295d66-1cac-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 11:53:01 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-4fbbfaacfc1so2631245e87.1
 for <xen-devel@lists.xenproject.org>; Fri, 07 Jul 2023 02:53:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0f295d66-1cac-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1688723580; x=1691315580;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=k5SIxJJUaY8DfE7EQiJlAAncgJ/TBgj+FZMC18V2IAI=;
        b=gpHYzSLR9Vx5Vbg0f5rsXm47yJcMEncMEdGLb3+UxaS2RhpAM3gedYFxgsDnn9PDDF
         mF7+NZwCldq5NyO0txPFSrhG51hq+SzV2JSGZSxnLqVyrdpE+YY7z7B7OEOUP27nxlAj
         7zniFjwvIUi980p3ECIXNdiV2HGbzK7rcDZX4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688723580; x=1691315580;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=k5SIxJJUaY8DfE7EQiJlAAncgJ/TBgj+FZMC18V2IAI=;
        b=kX9gkiAKO3516YjqPiPw7pWcjW+eeBZe6IncvE2jbP4pdLZ3ziZcLgLeS57iiXvjdV
         OOulH4dPt43+d749r9d3wuEERBJabseZcTc8I+NMbdaWqwhwfh+94/GhdBfsyOR/LKKw
         iw/K6YHoxT6r8l+mZixrWyKgren7hAsN34D2jzYiZuJcEJKbDO0wQdr6piaNJluqrahZ
         5+ThI1WJdbeX8UEifw1womxzvC3WOcjR0f5alAboBVCimSImiRW+Xzmu5g/W75IEGxuj
         KSzMEHgpaElAbkGEy7skSzBabk4jDB4ou8HEZfXym7M4TrMt6biWyZoOcGzAWGBo8V0p
         2uRg==
X-Gm-Message-State: ABy/qLZ3ZNZJnNZZaI5vbSrPQSFFrqnf8UJMx1eQ/QbnwlcOnBu3mxK/
	62+Wbz+grvPrNSdyZlTWV2NvbgVB9ryWIoPwd8gMAg==
X-Google-Smtp-Source: APBJJlFB2o/BMnoc82X2y2ugLpp9sQVuGHTjS/JBQQDDApcMFn2pA4u+/nirSd43YuPyX+nLK6RfcPAgIO2Gz5fNQtw=
X-Received: by 2002:a05:6512:544:b0:4fb:73b5:e1cf with SMTP id
 h4-20020a056512054400b004fb73b5e1cfmr3427449lfl.64.1688723580467; Fri, 07 Jul
 2023 02:53:00 -0700 (PDT)
MIME-Version: 1.0
References: <CA+zSX=Y4MwsDSd9oSG1NQyt==YAw9SeRdh=eJxTUhhOx57ihWg@mail.gmail.com>
 <4ee01a0f-063e-ef93-ac24-da387d5b3438@rabbit.lu> <a680ae62-7765-aa51-1edd-9a1a7e39e449@suse.com>
 <20b1a79c-23c1-93bc-2090-8052f143422c@rabbit.lu> <27a3e6a2-b150-1d75-c86f-dfa2b906b298@suse.com>
In-Reply-To: <27a3e6a2-b150-1d75-c86f-dfa2b906b298@suse.com>
From: George Dunlap <george.dunlap@cloud.com>
Date: Fri, 7 Jul 2023 10:52:49 +0100
Message-ID: <CA+zSX=ZCmmKQX7acx-oK4nSki9ONscxLP7E8t8USjdjXJ9UDpA@mail.gmail.com>
Subject: Re: Detecting whether dom0 is in a VM
To: Jan Beulich <jbeulich@suse.com>
Cc: zithro <slack@rabbit.lu>, xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="00000000000023549705ffe299a8"

--00000000000023549705ffe299a8
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, Jul 7, 2023 at 9:00=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wrot=
e:

> On 06.07.2023 17:35, zithro wrote:
> > On 06 Jul 2023 09:02, Jan Beulich wrote:
> >> On 05.07.2023 18:20, zithro wrote:
> >>> So I'm wondering, isn't that path enough for correct detection ?
> >>> I mean, if "/sys/class/dmi/id/sys_vendor" reports Xen (or KVM, or any
> >>> other known hypervisor), it's nested, otherwise it's on hardware ?
> >>>
> >>> Is that really mandatory to use CPUID leaves ?
> >>
> >> Let me ask the other way around: In user mode code under a non-nested
> >> vs nested Xen, what would you be able to derive from CPUID? The
> >> "hypervisor" bit is going to be set in both cases. (All assuming you
> >> run on new enough hardware+Xen such that CPUID would be intercepted
> >> even for PV.)
> >
> > I'm a bit clueless about CPUID stuff, but if I understand correctly,
> > you're essentially saying that using CPUID may not be the perfect way ?
> > Also, I don't get why the cpuid command returns two different values,
> > depending on the -k switch :
> > # cpuid -l 0x40000000
> > hypervisor_id (0x40000000) =3D "\0\0\0\0\0\0\0\0\0\0\0\0"
> > # cpuid -k -l 0x40000000
> > hypervisor_id (0x40000000) =3D "XenVMMXenVMM"
>
> I'm afraid I can't comment on this without knowing what tool you're
> taking about. Neither of the two systems I checked have one of this
> name.
>
> >> Yet relying on DMI is fragile, too: Along the lines of
> >> https://lists.xen.org/archives/html/xen-devel/2022-01/msg00604.html
> >> basically any value in there could be "inherited" from the host (i.e.
> >> from the layer below, to be precise).
> >
> > So using "/sys/class/dmi/id/sys_vendor", or simply doing "dmesg | grep
> > DMI:" is also not perfect, as values can be inherited/spoofed by
> > underneath hypervisor ?
>
> That's my understanding, yes.
>
> >> The only way to be reasonably
> >> certain is to ask Xen about its view. The raw or host featuresets
> >> should give you this information, in the "mirror" of said respective
> >> CPUID leave's "hypervisor" bit.
> >
> > As said above, I'm clueless, can you expand please ?
>
> Xen's public interface offers access to the featuresets known / found /
> used by the hypervisor. See XEN_SYSCTL_get_cpu_featureset, accessible
> via xc_get_cpu_featureset().
>

Are any of these exposed in dom0 via sysctl, or hypfs?  SYSCTLs are
unfortunately not stable interfaces, correct?  So it wouldn't be practical
for systemd to use them.

 -George

--00000000000023549705ffe299a8
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jul 7, 2023 at 9:00=E2=80=AFA=
M Jan Beulich &lt;<a href=3D"mailto:jbeulich@suse.com">jbeulich@suse.com</a=
>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px=
 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On =
06.07.2023 17:35, zithro wrote:<br>
&gt; On 06 Jul 2023 09:02, Jan Beulich wrote:<br>
&gt;&gt; On 05.07.2023 18:20, zithro wrote:<br>
&gt;&gt;&gt; So I&#39;m wondering, isn&#39;t that path enough for correct d=
etection ?<br>
&gt;&gt;&gt; I mean, if &quot;/sys/class/dmi/id/sys_vendor&quot; reports Xe=
n (or KVM, or any<br>
&gt;&gt;&gt; other known hypervisor), it&#39;s nested, otherwise it&#39;s o=
n hardware ?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Is that really mandatory to use CPUID leaves ?<br>
&gt;&gt;<br>
&gt;&gt; Let me ask the other way around: In user mode code under a non-nes=
ted<br>
&gt;&gt; vs nested Xen, what would you be able to derive from CPUID? The<br=
>
&gt;&gt; &quot;hypervisor&quot; bit is going to be set in both cases. (All =
assuming you<br>
&gt;&gt; run on new enough hardware+Xen such that CPUID would be intercepte=
d<br>
&gt;&gt; even for PV.)<br>
&gt; <br>
&gt; I&#39;m a bit clueless about CPUID stuff, but if I understand correctl=
y, <br>
&gt; you&#39;re essentially saying that using CPUID may not be the perfect =
way ?<br>
&gt; Also, I don&#39;t get why the cpuid command returns two different valu=
es, <br>
&gt; depending on the -k switch :<br>
&gt; # cpuid -l 0x40000000<br>
&gt; hypervisor_id (0x40000000) =3D &quot;\0\0\0\0\0\0\0\0\0\0\0\0&quot;<br=
>
&gt; # cpuid -k -l 0x40000000<br>
&gt; hypervisor_id (0x40000000) =3D &quot;XenVMMXenVMM&quot;<br>
<br>
I&#39;m afraid I can&#39;t comment on this without knowing what tool you&#3=
9;re<br>
taking about. Neither of the two systems I checked have one of this<br>
name.<br>
<br>
&gt;&gt; Yet relying on DMI is fragile, too: Along the lines of<br>
&gt;&gt; <a href=3D"https://lists.xen.org/archives/html/xen-devel/2022-01/m=
sg00604.html" rel=3D"noreferrer" target=3D"_blank">https://lists.xen.org/ar=
chives/html/xen-devel/2022-01/msg00604.html</a><br>
&gt;&gt; basically any value in there could be &quot;inherited&quot; from t=
he host (i.e.<br>
&gt;&gt; from the layer below, to be precise).<br>
&gt; <br>
&gt; So using &quot;/sys/class/dmi/id/sys_vendor&quot;, or simply doing &qu=
ot;dmesg | grep <br>
&gt; DMI:&quot; is also not perfect, as values can be inherited/spoofed by =
<br>
&gt; underneath hypervisor ?<br>
<br>
That&#39;s my understanding, yes.<br>
<br>
&gt;&gt; The only way to be reasonably<br>
&gt;&gt; certain is to ask Xen about its view. The raw or host featuresets<=
br>
&gt;&gt; should give you this information, in the &quot;mirror&quot; of sai=
d respective<br>
&gt;&gt; CPUID leave&#39;s &quot;hypervisor&quot; bit. <br>
&gt; <br>
&gt; As said above, I&#39;m clueless, can you expand please ?<br>
<br>
Xen&#39;s public interface offers access to the featuresets known / found /=
<br>
used by the hypervisor. See XEN_SYSCTL_get_cpu_featureset, accessible<br>
via xc_get_cpu_featureset().<br></blockquote><div><br></div><div>Are any of=
 these exposed in dom0 via sysctl, or hypfs?=C2=A0 SYSCTLs are unfortunatel=
y not stable interfaces, correct?=C2=A0 So it wouldn&#39;t be practical for=
 systemd to use them.</div><div><br></div><div>=C2=A0-George</div></div></d=
iv>

--00000000000023549705ffe299a8--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 09:54:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 09:54:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560341.876198 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHiA8-0004n6-MP; Fri, 07 Jul 2023 09:54:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560341.876198; Fri, 07 Jul 2023 09:54:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHiA8-0004mz-JZ; Fri, 07 Jul 2023 09:54:04 +0000
Received: by outflank-mailman (input) for mailman id 560341;
 Fri, 07 Jul 2023 09:54:03 +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
 <SRS0=GM+b=CZ=citrix.com=prvs=545203e5e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qHiA7-0004kh-Cp
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 09:54:03 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 31de1598-1cac-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 11:54:00 +0200 (CEST)
Received: from mail-mw2nam10lp2101.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.101])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 07 Jul 2023 05:53:55 -0400
Received: from MW4PR03MB6428.namprd03.prod.outlook.com (2603:10b6:303:123::8)
 by BN8PR03MB4980.namprd03.prod.outlook.com (2603:10b6:408:7e::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24; Fri, 7 Jul
 2023 09:53:53 +0000
Received: from MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd]) by MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd%7]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 09:53:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 31de1598-1cac-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688723640;
  h=from:to:cc:subject:date:message-id:
   content-transfer-encoding:mime-version;
  bh=asRF1+hz4KxTVmQq5li0pcFQKwMSa6Mn05JdrKjAnOY=;
  b=RSTE7DglVbZ0rwry0mNUWDlWPEpbNMjw5gOvSEYEK2PPdL4e2s39ETkp
   zpN/LoUm0rfdDWI9E4Yk5XSX5rAs8xRtD1dWn7G0jhfR9kK5If5OLIG7Y
   sTn0SHLBVR0Y70NJffA7BncnNrH2yJkhvIhscFq5DYOrSUmLmp82ciHjg
   k=;
X-IronPort-RemoteIP: 104.47.55.101
X-IronPort-MID: 118037051
X-IronPort-Reputation: None
X-IronPort-Listener: O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96U
 9hGZIOcuEZDzJB/LvHCN/TKadd/DGFmprY+ts31x1WPGVXgzkL1XYANu6ceHcGIzVuNN4CO7
 e3wNFInDakcWR/VLXBOpFUN9KzweEijfjdEGc7OyI=
X-Talos-CUID: 9a23:0YkMxmzQqUirGn4KvS3qBgVLM+w6TH3azEyJfW2ICVlUYpK1eHW5rfY=
X-Talos-MUID: 9a23:Tyg8UAW7/oBOytXq/GawizJQc+lu36DwDWpXsrJBmNXaJQUlbg==
X-IronPort-AV: E=Sophos;i="6.01,187,1684814400"; 
   d="scan'208";a="118037051"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Ag+3bhmD/HSl3ucCIjeqBiw5FEveMRFMX9kVavI79noY3bA9CeAq1cZyoqpGB3NGpfbQ6HlfKR1BhkLK4zEB/NKx2i77edtdUfh9fme6pUV04nFCX7vx+IZGpCVMiezjGg1fDf/O5QErCwOozQpdy9wVv3deKC2hiYpkVHnthEWvwvQ0bQ/52ERs3UBfwOuThwtQdRvsHaiGsE8bWqAYD42oTD6jAuIOkXITEk/0HtJhnSoKn95BA7TKBGNdmgxP9lIDn8dNo5f3jJYM9DxIfG0R3tkMKlTWWbnyZTfxBp5AjhQt2jn9arrqyG+K+ywqjdvSEsoOQ8I/8XFABgKonA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=dGPpyzDhc8PLrf8fob5cnoRa3lgvkBZMKri/5Dme8TQ=;
 b=SCslcFkTdlyEjJQ8eQXU1lfsK+x7EToq7niCcCYqpuo+SDNQf8Nz1aiK19ZhiOE/dJ1i36tMxM/bpHurXSRiucJOAKjUQ5JLQV0iUx4T6I+dJGiHi2KFfVXx10neYjt3ud46GNT7bNS/fk9y2U1YMszW2jx73m1xg4Bv808+64eP0oEVtQib3vs1UbPnpg/ssRBm72SQEtr/k7K9Rw0jpqO50svbEUmDQiQD1q+8pVjJpSypXDhQnKOz8czjLxA9LQCNQzz1qxQ8RrzSsM3/S0ejMA62L8TAT4kX53rwre+VoSORyE8A+UfEPCXunU6i+dxOSN6EQJ5srOvDjptK0g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=dGPpyzDhc8PLrf8fob5cnoRa3lgvkBZMKri/5Dme8TQ=;
 b=InIWlT4JkA25xD5y6cBW4hOZAX0vOVT/lR9iFer784gCAP2OtMZEpPc/oRMQ/akKrthtb2/nIikTYkUJrL02sTduD6PoLLDD9SlMbj7L0lYYJ3uVWJTY9ps66TqjHowDBWojNbuFsdPdcVCMoFEDARnnKHSeVbtNWOdYtDur33s=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH] x86/ioapic: sanitize IO-APIC pins before enabling the local APIC
Date: Fri,  7 Jul 2023 11:53:38 +0200
Message-ID: <20230707095338.44244-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0410.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:189::19) To MW4PR03MB6428.namprd03.prod.outlook.com
 (2603:10b6:303:123::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MW4PR03MB6428:EE_|BN8PR03MB4980:EE_
X-MS-Office365-Filtering-Correlation-Id: 17dec429-fc89-46da-b66a-08db7ed0125b
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	lLjvEfpOlfj6VcnSVNJzQXtKP9OsOkARDcsUdOydmm1BncTY4Yp0aKE3+dXbYK+w63tKDAv7T1DI442Zjy9/s4El3JwRLWPy/F+jGCAOhs9dOJildd3cEY3RTRsBIZWDfbjphP73jOwMzSZc9gLd6YeHeaGjITBsSsNjVrKOXCnp5ocYfH+uuvnjMsdxLdl/QM95JdX8FhliXazwieJmhgOPYQiE1PZQyh0dgF+AypsTQ7Th6dEsX+kPgqXdVBgO4pR85QNKh9h62sTiEfD5b3o5ZHpEtxzpttVJ1ANpKoE0IyT+53mMGEFqrXumigQWkCNYsUZOMxxRGUD8HVXkH/mtuSNxK/CnzmGhkLVHZqhn376EhZTEThN3w9tEQxHy1BsiJ6XhjOBoB2J8fZMcZ3KJbiiehQd8J5db8nB8kXi6XTaCku/kxGMOfplBDdaWRcfRmRhHNHCVqPzDV/Hkc4kDnHiVI1dlCybgxxXYzSJsZgzaR0veJITkegV8qtxyydFp7Xos/JLaJ/RBfQeqJf/URb7jfjOa4bLvBu0RwJuBbrLcLr/Ix4HRM2hb6N6t
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR03MB6428.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(346002)(366004)(136003)(39860400002)(451199021)(478600001)(5660300002)(8936002)(316002)(8676002)(66946007)(66556008)(41300700001)(4326008)(66476007)(6916009)(2906002)(54906003)(6486002)(6666004)(6512007)(2616005)(26005)(1076003)(6506007)(186003)(82960400001)(83380400001)(86362001)(36756003)(38100700002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TCtHRG9BS1EweCtIZzdRMDFhRU9ZcEJOWTdkTHJvWmJ5S2J5RDY1VjJQWmdx?=
 =?utf-8?B?anhtS0ZpZEg2YXZyYWw3MWZFS01qOVduVHNXM2JyR3l5NXBxMHZKeWthYk5X?=
 =?utf-8?B?U3UzUWEvOVBaR1hrZGdZcGMybyt2TXRwYnJlV1VoSExTY1BpSGhOREtBajFY?=
 =?utf-8?B?OU9CaEJYMkxrUXoxRFpIQkFTZXRSckdVQ1R1WkZqRm9uRWY3MWdwaWoxZGov?=
 =?utf-8?B?bGNOVm9TcTR1ZTRLK01hSWtpbEJKTit4aFRCRjdRdllQVmFDWElYNUNlSWZI?=
 =?utf-8?B?UDZjUCt2dGxjVy9xak5UMERWd2F2cDFpTEZMelJJSXBTdFlqVFlKbDBCbDA2?=
 =?utf-8?B?T3NCU3ZvZWsyajhQNW1MYjI0bEl0dUNhbzEyOEk0dlIwLzdmSFB2NzRxbGlG?=
 =?utf-8?B?UEFCTUpOTFVsZW1sVksxNjJLczVpcllGMjVrbGtVdGd4Z09jNXBvanhHSFVu?=
 =?utf-8?B?NFJ5UjVEenZkUnpsWEhGdXR3V1BkTUk2UFYzMHNWdGVFV2FwNThHK1NoMGxK?=
 =?utf-8?B?YmYwK0lRZXc1QWhFaGdEb3VPYXFYRHRIR2RUSnpkZ3ZrY0tpRDhJR1FGZ0lr?=
 =?utf-8?B?clFNNHR2OVlPZjdtamJBU3RxMjJCaDhnT3BtcnpMcGZHaUNQNGJSSEhvK0p5?=
 =?utf-8?B?a1dBZ1FscDVMV0o3MzhHZVlSZzduRlF1MDRRRkEyT2V6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q6s64m79IU8iC3tZ4gvdg6yQyfp7tfUVIIHGnMAsJqeptwHGN+6ulj/xvZ3QPn3ERuaVFl/eIU9FQ0srBwNGbbNTnS73g/iKOI9iJUu+t5iAzWZrkhDueG1yxhMcHniYr+VV5KUBaOu8cXzYn8jcAAkcutiCN3Sdw2A9tQmM+t4NYpgdJNz5pO9eHPlxRt91nSKgkp+lCTW9906Bn/kuYwa2t4dbMTDHSXdCrNEdL0y6lYSr0u6Rfop1NmsDAlC7Ec98FpLSTcej2257MnepIpvV49a5wlauFUjQaZrMOmVbm1cOIvZqIsooSI7+u+txHOfDHRa2DXpWc353PwSdSQ7d3FDZFWhUYWGb3BGNmDblZBCzqOI1Vk9clWLvBP5VhKhaukYI7cuR+T9SFBz1e6ZBM6WKrz92DJedsYuE1NiXzwbfLPWUn0+IIC765JE801M+LN1XMTxkLbZ6ePEnLyFr1WgmHsJ1YeaNHnHHez+YhtanB6trNnWUTVlh9pkjnK0yx/CFXKXM7h+PSJxH3TCDQQ004zV6PbgpNRV5CF6dJUdQeLvKV4XQrdKyr+6X+Q9yAS7o9MuQLDK1VULHV+PIoBy2
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 17dec429-fc89-46da-b66a-08db7ed0125b
X-MS-Exchange-CrossTenant-AuthSource: MW4PR03MB6428.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 09:53:53.1695
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: J7XtngwYBjbVF6LEUaVY4DhhwkX8S57Gkqt19qWnH+kOA3l+iIf+ONflk5zZEe8RMqcdN1VtzsKLCsdiniei3A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR03MB4980

The current logic to init the local APIC and the IO-APIC does init the
former first before doing any kind of sanitation on the IO-APIC pin
configuration.  It's already noted on enable_IO_APIC() that Xen
shouldn't trust the IO-APIC being empty at bootup.

At XenServer we have a system where the IO-APIC 0 is handed to Xen
with pin 0 unmasked, set to Fixed delivery mode, edge triggered and
with a vector of 0 (all fields of the RTE are zeroed).  Once the local
APIC is enabled periodic injections from such pin cause a storm of
errors:

APIC error on CPU0: 00(40), Received illegal vector
APIC error on CPU0: 40(40), Received illegal vector
APIC error on CPU0: 40(40), Received illegal vector
APIC error on CPU0: 40(40), Received illegal vector
APIC error on CPU0: 40(40), Received illegal vector
APIC error on CPU0: 40(40), Received illegal vector

That prevents Xen from booting.

Fix this by moving the masking of IO-APIC pins ahead of the enabling
of the local APIC.  Note that before doing such masking Xen attempts
to detect the pin where the legacy i8259 is connected, and that logic
relies on the pin being unmasked, hence the logic is also moved ahead
of enabling the local APIC.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
I've placed the sanitize_IO_APIC() declaration in irq.h with the rest
of related IO-APIC setup functions declarations instead of placing it
in io_apic.h.
---
 xen/arch/x86/apic.c            | 4 ++++
 xen/arch/x86/include/asm/irq.h | 1 +
 xen/arch/x86/io_apic.c         | 4 +---
 xen/arch/x86/smpboot.c         | 4 ++++
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index f71474d47dd1..9197b9532480 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1476,6 +1476,10 @@ int __init APIC_init_uniprocessor (void)
         return -1;
     }
 
+    if ( smp_found_config && !skip_ioapic_setup && nr_ioapics )
+        /* Sanitize the IO-APIC pins before enabling the local APIC. */
+        sanitize_IO_APIC();
+
     verify_local_APIC();
 
     connect_bsp_APIC();
diff --git a/xen/arch/x86/include/asm/irq.h b/xen/arch/x86/include/asm/irq.h
index 424b0e1af8f4..dfa681846255 100644
--- a/xen/arch/x86/include/asm/irq.h
+++ b/xen/arch/x86/include/asm/irq.h
@@ -118,6 +118,7 @@ bool bogus_8259A_irq(unsigned int irq);
 int i8259A_suspend(void);
 int i8259A_resume(void);
 
+void sanitize_IO_APIC(void);
 void setup_IO_APIC(void);
 void disable_IO_APIC(void);
 void setup_ioapic_dest(void);
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 9b8a972cf570..120c231e0302 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1273,7 +1273,7 @@ static void cf_check _print_IO_APIC_keyhandler(unsigned char key)
     __print_IO_APIC(0);
 }
 
-static void __init enable_IO_APIC(void)
+void __init sanitize_IO_APIC(void)
 {
     int i8259_apic, i8259_pin;
     int i, apic;
@@ -2067,8 +2067,6 @@ static void __init ioapic_pm_state_alloc(void)
 
 void __init setup_IO_APIC(void)
 {
-    enable_IO_APIC();
-
     if (acpi_ioapic)
         io_apic_irqs = ~0;	/* all IRQs go through IOAPIC */
     else
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index cf9bb220f90d..f9e27a23d383 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -1221,6 +1221,10 @@ void __init smp_prepare_cpus(void)
         goto init_uniprocessor;
     }
 
+    if ( !skip_ioapic_setup && nr_ioapics )
+        /* Sanitize the IO-APIC pins before enabling the local APIC. */
+        sanitize_IO_APIC();
+
     verify_local_APIC();
 
     connect_bsp_APIC();
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 07 10:06:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 10:06:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560349.876208 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHiML-0006WS-U4; Fri, 07 Jul 2023 10:06:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560349.876208; Fri, 07 Jul 2023 10:06:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHiML-0006WL-Qn; Fri, 07 Jul 2023 10:06:41 +0000
Received: by outflank-mailman (input) for mailman id 560349;
 Fri, 07 Jul 2023 10:06:40 +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
 <SRS0=GM+b=CZ=citrix.com=prvs=545203e5e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qHiMK-0006WF-0p
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 10:06:40 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f43e49b3-1cad-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 12:06:36 +0200 (CEST)
Received: from mail-mw2nam12lp2046.outbound.protection.outlook.com (HELO
 NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.46])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 07 Jul 2023 06:06:33 -0400
Received: from MW4PR03MB6428.namprd03.prod.outlook.com (2603:10b6:303:123::8)
 by PH0PR03MB6268.namprd03.prod.outlook.com (2603:10b6:510:ea::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 10:06:31 +0000
Received: from MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd]) by MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd%7]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 10:06:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f43e49b3-1cad-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688724396;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=qIaN0alXvTfky71q+iqE80nS2UceBdciNaoi+nSMI8o=;
  b=Z+nrsHxLkjqpDtJ9sTQ4guGHIQ6QujnnQh9cIJC89CaJtwHeYahFML91
   m4AJ0YuJpY+waGqiOQq6z98qyAPvI8dutAeFH3CBL1WsUmY0280k0WtHh
   Eub2VV451HZQGCXHo7XZbNvtWLN0eNLRMnzRhmwbELn6a5mf38h3leTbL
   M=;
X-IronPort-RemoteIP: 104.47.66.46
X-IronPort-MID: 115344287
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:rY4xpaAAmm6hphVW/5jiw5YqxClBgxIJ4kV8jS/XYbTApD4m1GNTy
 mQdX22Ea66INmL1KYhwPN7k8EgE6pOAmIU3QQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h
 yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4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talos-CUID: =?us-ascii?q?9a23=3A5a1K1mrJcTLqsoIY1e/yalLmUcEbdlLD53zzGGS?=
 =?us-ascii?q?1EX9xZuS/YFyp8Yoxxg=3D=3D?=
X-Talos-MUID: 9a23:KC+klQXKzTqjD1nq/AXGmC9AG8JJ2ZSvKFEIl7MB4ZGZPyMlbg==
X-IronPort-AV: E=Sophos;i="6.01,187,1684814400"; 
   d="scan'208";a="115344287"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=iazWcKJ4r3SxCsJOolEP7ZD4ai4bT1iDo+S0MLK8W2yEKPE8+cKF07U7wTUkASsYVCKAPO8+goyNZbpWo4FuoxtL92lJuMM0snqNBUWyd2S9e8kPZfbumKuCCkp2Fg6Oik7uIMz4K9UgfL6kAkVneEnXWB9UacYPmCTt/mbYClpWYyi5Asv6UaktfR0ECvvpujPHkDuk8hbqU41UCrRg/78zKbQ3L/Py4glax3APBpipmqnvlMlmvgtiQYS0eylnSAcGzSZe7kFIWlQJIwkzxIjm54rVowJrXrZTCk+ReNPjVu5kY3XfcYb11KlUjcaWxDtLXfXgHv256n4rkGKqSA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=8134oXwS1+4R3dyIlkk4ALZOUXtg0vpV7F0J7j/S0ds=;
 b=bfiTl4lXP7dMJR/2rJ73dq3lPn+kb2hyImQujfNSxUeqFV8SG7b9YGTqEVAueJavkmyylV6721LbkdNjNan6ydL4agmflpMDc4K9XOUWUqQcmPsZykXuotiBCnYb78MxmrkHFDbQzhLGn+S6hTt0nVYM4CrK7HByKuQNJxKHK+/iYjyOe5DyuCOibwDBPQ2fI8muwLTberJsOQhNisfbMxcXl0P/aVYFewx3cMm7KCttvEpKi/ClS72R9xgHCng0btDv3OTB83fjSvUXaNN5K8NjA31cyqGexXgdFUd8loeHkc6FWSyQsL3tJy1Px7paklMDmtbOTv9nOSQ3lclTkg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=8134oXwS1+4R3dyIlkk4ALZOUXtg0vpV7F0J7j/S0ds=;
 b=BGY//JzjQjAY7qvHaK0cjZ5xsKX8QA4mkahB6uld7IjTVL1wNkr24Rz5mF1du9NDBvLKIESxWV/a9e+HSM15Rz20NqQT2Xahe2ahdEZM7u1rnYAKwvqcfJSh2HpHftlbchGldcAbJ3W8FX2ovdu5Nva9yxgZs7o81ZX6PHsHA4M=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 7 Jul 2023 12:06:25 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Julien Grall <julien@xen.org>
Cc: Stewart Hildebrand <stewart.hildebrand@amd.com>,
	xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Artem Mygaiev <artem_mygaiev@epam.com>
Subject: Re: [PATCH v2 3/3] [FUTURE] xen/arm: enable vPCI for domUs
Message-ID: <ZKfjoXqb6Kgav-vL@MacBook-Air-de-Roger.local>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-4-stewart.hildebrand@amd.com>
 <e5a0ed8a-d85b-fb60-609a-f46884433c60@xen.org>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <e5a0ed8a-d85b-fb60-609a-f46884433c60@xen.org>
X-ClientProxiedBy: LO4P123CA0182.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a4::7) To MW4PR03MB6428.namprd03.prod.outlook.com
 (2603:10b6:303:123::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MW4PR03MB6428:EE_|PH0PR03MB6268:EE_
X-MS-Office365-Filtering-Correlation-Id: ae64cbd4-6b99-49ac-a4ef-08db7ed1d66a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	YMhx7C+WdX+kIHnx7Bmi0fWvd5jkoZaacu+kltHUUVvl4HaWxkRk4uRWpf40CPA5FA/41WJ9Ma4kSzcY953gzK7gCgdSx88UiiiiuiRTCwM4Q6/eWY7FTRy3scGErZxltRjQECFkskhY+hKls8f08mKzMjFHkVGj1AXtLggnGk1l0Y7KAjTvBOZmrD5JNMD9XCohpV0R/EDQx2UHypVZbkWMKhm5HYxAby4NUZannKhbN1lcMEUCza/XPABOmD1JlLncZNLED51fxF6A+6nM2VzYlm5Fl1/bFDBMdh49PaQrQXi+Nbjx0SKlZIpcKnr2799emOBHC3RhH1Wca/+OJT/CwY3xmwEOygaT3UzOb5tfMX+stf9pbgT5k6RER2BIz1LKW/LMBh6hcreZOoby9bmxsgaeeM5xmAR+wpHEQ7KXEdWLUP6rSQZaG9itB7AsMm2ia16eorpl9CT45ldb2MoHHxk+nMtDzn/5JYUTodfHP9r2sgt1p17ZBd6f/rDs3wetGHHjI2TCAyRPxmlrV4hEOC5+dKNclJMKf9hul3M6esvgFK3hmLZqiALqzmjp
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR03MB6428.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(346002)(366004)(136003)(376002)(451199021)(478600001)(26005)(186003)(6512007)(82960400001)(6506007)(9686003)(53546011)(86362001)(6666004)(316002)(83380400001)(66476007)(66556008)(6486002)(54906003)(38100700002)(4326008)(6916009)(66946007)(5660300002)(8676002)(8936002)(66899021)(41300700001)(2906002)(85182001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QnNEYU1EbWhGZEUwTlAvQlZXNDFDNE1oZDVpajJmQ2RCV1hwaHJ2M1BOeCtl?=
 =?utf-8?B?ZU9WZnlVZXZ4VytscUlqKzlRY043Vk1sT0hyZjJjMEMvSytTS2F0eGoyRXpj?=
 =?utf-8?B?aUVkKy9ueEZBcGZoYS9nbkJuSXhIZG56NWZWZ3FBNE9ZVDVBaUZOQzlqZExh?=
 =?utf-8?B?WENpWmVlL2JNakVrSnRPZTU0bzJjR1B4NUpIRVJqUmVFVHIxN2NjRDV3K3V3?=
 =?utf-8?B?azJINUlub05tRW9FNXZVeW1iam02Zk9HSVkwY2tRTStjelhPbDRGVEZQM2ZL?=
 =?utf-8?B?RFM5NWNtZ3lLUFo2RzhKVW1qUUpLV1ZYMnFUS2Nzdk5WSXQ5aG1PTHo1WEdy?=
 =?utf-8?B?ejZRQUNBN1l1VHJqdzZvN1hWeUt6eHpMdVlLbXZCV20yeExQTkZNcElkMXpo?=
 =?utf-8?B?SUNXbG5uTU9jRlNiNUpseWF6ZlM1UExrYS9LU1N0QjQvSytnTnROdWp0YUtn?=
 =?utf-8?B?Slh4aUF1R2poUFl3VVVYQldxNjcwSkJUMXhqbVZUYjdycU1RSFFvQWdjanpR?=
 =?utf-8?B?dGE2dzVpTUttZmROOHB0dVNEMHVMcEhHZ21XR2c3RTFFSG4zK2g0NzVwT3B2?=
 =?utf-8?B?VmZZVTZ0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wq3JUa1xyWOVVytgA/4ZTWx/FzXJYXanDobj8+itwTWhII1VKl2OfPGHcJFnwC/ZAnwwgB1te5Ymu56JPVb7eKx+FIlg1Dj00RAc4FD8iPjZzyh2WdEXcjlzkZ7zAH2uNIl+X4GNfGI4l4IaWakgcum4wP/E3Zh1BxOeyCr0xNCtOKf6WgL7SIFsxtB2ObPTYQJaEKUFOYpYtw6oFWFHZ78b7QQJoUYBZ74KI73j2rwt7LqBn7It8RnMfBFI+6jAYfZTyeQ5op6sCCDFjdMl09U1aD7IbUVZTGsvbnnPfc2Dhd2zbalpuV3uGMN10fpJD/X8zS9uP89sheSw9Yz5ewpLw6UCfcLQmKI97nphiOnsBHoEkgZhMgtpzis49obYp65oO1CyHZDniPYqE5xVUPPBL1ycHJIqhYYViUgkx2qeivk00si8czxtF6cR8B4KtgANlFbj/9kEgBHcC5jGYGJMfHcE84K0Ih/5LjBUXhITl731ivicKv5nQ+euS/DBR7OaFivPM3TUx1lHtqUnI4LjsqZ1i6dZloA5gRKLb3FlYSCf78sxfXptwbw7bzWkko8v1pqwFGNaAxVZSVey/eh0Jbm+gKkMwMcTdOKgUccqn6qNPcHiOLbLvUT54XvOlsR+Zqd1TC3oAHJm69L0oHcmWbsarnvL/oHoaI2bkJUu7vY1n9e49QPvuC6dGs3RRaiVFim0Gxx8JKD0OzoL2gMcWolZ1FMd2nams82hLtYI5x1pQGevsE80GP0OpcgYIDnaZQVqFAV5snsXpHIqcYPAOZJI0l4Dmg==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ae64cbd4-6b99-49ac-a4ef-08db7ed1d66a
X-MS-Exchange-CrossTenant-AuthSource: MW4PR03MB6428.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 10:06:31.6000
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: chwWJMmjaHoNJ4+Twhh5wxwm4k0fPkpUOqlaSWGbyjOm4D0fKFje//oubLdSwgHoasnfhH/oe/eXJxvBkmpO0g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB6268

On Fri, Jul 07, 2023 at 10:00:51AM +0100, Julien Grall wrote:
> On 07/07/2023 02:47, Stewart Hildebrand wrote:
> > Note that CONFIG_HAS_VPCI_GUEST_SUPPORT is not currently used in the upstream
> > code base. It will be used by the vPCI series [1]. This patch is intended to be
> > merged as part of the vPCI series.
> > 
> > v1->v2:
> > * new patch
> > ---
> >   xen/arch/arm/Kconfig              | 1 +
> >   xen/arch/arm/include/asm/domain.h | 2 +-
> >   2 files changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> > index 4e0cc421ad48..75dfa2f5a82d 100644
> > --- a/xen/arch/arm/Kconfig
> > +++ b/xen/arch/arm/Kconfig
> > @@ -195,6 +195,7 @@ config PCI_PASSTHROUGH
> >   	depends on ARM_64
> >   	select HAS_PCI
> >   	select HAS_VPCI
> > +	select HAS_VPCI_GUEST_SUPPORT
> >   	default n
> >   	help
> >   	  This option enables PCI device passthrough
> > diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
> > index 1a13965a26b8..6e016b00bae1 100644
> > --- a/xen/arch/arm/include/asm/domain.h
> > +++ b/xen/arch/arm/include/asm/domain.h
> > @@ -298,7 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
> >   #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag)
> > -#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); })
> > +#define has_vpci(d)    ({ (void)(d); IS_ENABLED(CONFIG_HAS_VPCI); })
> 
> As I mentioned in the previous patch, wouldn't this enable vPCI
> unconditionally for all the domain? Shouldn't this be instead an optional
> feature which would be selected by the toolstack?

I do think so, at least on x86 we signal whether vPCI should be
enabled for a domain using xen_arch_domainconfig at domain creation.

Ideally we would like to do this on a per-device basis for domUs, so
we should consider adding a new flag to xen_domctl_assign_device in
order to signal whether the assigned device should use vPCI.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 10:13:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 10:13:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560354.876218 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHiSj-0007z8-KY; Fri, 07 Jul 2023 10:13:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560354.876218; Fri, 07 Jul 2023 10:13:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHiSj-0007z1-GV; Fri, 07 Jul 2023 10:13:17 +0000
Received: by outflank-mailman (input) for mailman id 560354;
 Fri, 07 Jul 2023 10:13:17 +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
 <SRS0=GM+b=CZ=citrix.com=prvs=545203e5e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qHiSi-0007yv-VU
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 10:13:17 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e17367a6-1cae-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 12:13:14 +0200 (CEST)
Received: from mail-co1nam11lp2172.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.172])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 07 Jul 2023 06:13:11 -0400
Received: from MW4PR03MB6428.namprd03.prod.outlook.com (2603:10b6:303:123::8)
 by BN8PR03MB4914.namprd03.prod.outlook.com (2603:10b6:408:7b::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24; Fri, 7 Jul
 2023 10:13:09 +0000
Received: from MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd]) by MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd%7]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 10:13:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e17367a6-1cae-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688724794;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=LlNAG92IgRgXTaIG9XMCkaoUYGTwRyEG2FPMAgwDcn0=;
  b=hvJDmi/WwJziHwCa78xKfrVIc1CQKn3YZAOV2Zz6JxAg7JwN9MnLzLkw
   9lIr/4n9LIO3Db0xuahwkzbLjP/VRiNL9PeyU5Wq173pNotrdxmGMqhLG
   YNE2WskB9U6u1dWljg/ycOZP29gBpeboaEpjdUS9wu96gAfr15J1OXk7d
   0=;
X-IronPort-RemoteIP: 104.47.56.172
X-IronPort-MID: 118038930
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:GSyoV6xII+5nRcPmWMd6t+cRxyrEfRIJ4+MujC+fZmUNrF6WrkVVz
 DAfXGrQO62La2DyLdAlYd7jp01XvZGHnIcxTAU+qSAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhPa8T5TcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KVtp9
 cQDCGkwVD2e2aXm4be5Z7BJ18t2eaEHPKtH0p1h5RfwKK9/BLvkGuDN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjaVlVMruFTuGIO9ltiiX8Jak1zev
 mvb12/4HgsbJJqUzj/tHneE37afxXirCdlKfFG+3vk0w2DKm2FNMR8TXATmgsOwq1+ldt0Kf
 iT4/QJr98De7neDTNPwQhm5q36spQMHVpxbFOhSwB6J4rrZ5UCeHGdsZi5MbpkqudE7QRQu1
 0SVhJX5CDp3qrqXRHmBsLCOoluP1TM9KGYDYWoPSlID6ty6+YUr1EuQFJBkDbK/icDzFXfo2
 TeWoSMihrIVy8kWy6G8+lOBiDWpznTUcjMICszsdjrNxmtEiESNPeRENXCzAS58Ebuk
IronPort-HdrOrdr: A9a23:ByNoGq8VFStOnvCelyVuk+AcI+orL9Y04lQ7vn2ZKSY5TiX4rb
 HKoB1/73XJYVkqN03I9ervBEDiewK/yXcW2+ks1N6ZNWGLhILBFupfBODZsl7d8kPFl9K01c
 1bAtJD4N+bNykGsS4tijPIb+rJw7O8gd+Vbf+19QYIcenzAZsQlzuQDGygYypLbTgDP7UVPr
 yG6PFKojKxEE5nFfhSVhE+Lo7+T8SgruOeXSI7
X-Talos-CUID: =?us-ascii?q?9a23=3A4X6joWgwKbpRHuXLysa40mdOcjJuSFrd9GzwenK?=
 =?us-ascii?q?CJHs3D+20TF29oYY1nJ87?=
X-Talos-MUID: =?us-ascii?q?9a23=3A3Fib5w2I/OAByb5FQPaXgJchOTUj5PrtNRlQnMs?=
 =?us-ascii?q?/ucyNanFTAT68nS+aTdpy?=
X-IronPort-AV: E=Sophos;i="6.01,187,1684814400"; 
   d="scan'208";a="118038930"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hnU7I47K+zC9rg2eyD+172j1OFTo5ArRtMoZElcydQ7O8CvQ0E9meBr+bBAP2X3LfLhkbFYOqxo54EFLYAOvOr5U5cgpqI5Xjta3wj5+X/j1W9DYAlSrsEYcBtj/tTeLzCz5h4ny18ahxnTO4EQP3hdFkF+c7xUaCOsq4wuBr2//BZcb/hqoloiZKIWu9T/G+v+swbDTHReBdgavpfagBth4YD/8LqUS2KjsY2z+xF3MyGwxHLdR4IXdEDOwuwXiBs4ruufGB5bkYnx0Jd6CXzA21LQoeWdtbWm4JmxboicP6X5EIzCU7tZUV0K/11OZgzoP0xxax0Bg1bTr0cJRyA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=f2MJi746uqlJ6b+1RZRliSvOO1N8aNgO8u9WMnxdxas=;
 b=Q6mKda38bsMjKXWZDe7r5kAfCkqshFQKeYbnJ0LwYbFwRQbogYo0pnC0SU3A+W/X8coHY4pWtsZL7Om+WJQHIT6dUMyALq0L2eM9YhLc6yOT5cN8Ovx5uPnrO4wplW86/N5yUQdc2C5vGf4uFLO80R19M9GJC1gWUof9W8T+EXvB+/l54jqd8qB1bHcIewwEM1G4C+apIn4hmx4f3hhOhxXVpu5ox5wuWh6BrDlGf3iFmoOEi3dLSttdBQQLMl5b5ZgbxXqz7auwBACSTeFlZ/IoZznNuXc0bnWagB7qNUX7yg7d29fcMlHc7R2C1fenN1KTtRc2IQVI2dyo8qwu2w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=f2MJi746uqlJ6b+1RZRliSvOO1N8aNgO8u9WMnxdxas=;
 b=LsJ0oXjP7mnZFb9YRg3aWGKHVpEHf2Dm1OvaSo0bKmPRbwoCnF4BLshNqSfm2DKiXJPKU0zvspL5+OYPooVlwpgGsCM5i8v+A2JOCsH9U8N71XrNcAvtikvlGOnXIhigVR/DXd2Ox1mipUPtRN8pnjvX9ReaSfxahLSrDxyxgc8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 7 Jul 2023 12:13:03 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 1/3] multiboot2: parse vga= option when setting GOP
 mode
Message-ID: <ZKflLxsh1AKyvPOT@MacBook-Air-de-Roger.local>
References: <20230705114741.11449-1-roger.pau@citrix.com>
 <20230705114741.11449-2-roger.pau@citrix.com>
 <47cc5f67-973a-2095-932f-6ebea2d3bd9e@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <47cc5f67-973a-2095-932f-6ebea2d3bd9e@suse.com>
X-ClientProxiedBy: LO2P265CA0494.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:13a::19) To MW4PR03MB6428.namprd03.prod.outlook.com
 (2603:10b6:303:123::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MW4PR03MB6428:EE_|BN8PR03MB4914:EE_
X-MS-Office365-Filtering-Correlation-Id: ea254808-07c8-4bf3-83b5-08db7ed2c34d
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	uaj2v3GsZj9g/80LrSnm+NBjbLDhjYgbcXeUN6SLRkb2W7pLykfxTVlSlGTUi1W8n443HRevQt+wefyYtchAD8ZJ45NlzYjcdY9lTfu4+VDzLhuUsO7lKl3JPVGXrSHlU3QUnLPUdDAOmghXJi2VXVufXtY9+5LSJryOqJF+MmNspPwmBJWZ4QPNac4hH77PFMW9hAehmg5c/mcm8Nu43Lj2BmUHH92xXRbEXnYFnbRoMsGQBLZC9PfYgOscjhtMWKZcIh/3cUgIUb7kbuanPB4SpPxQRQ4P1Lc4khodRU5F55gZJDojVl6y0KTF2xBGJZtpYMaQzpTeCfma5dO6o6jtixatSF4ZiAB5zLSGsI0cO1i/QTPa2K3Q/Ucj6+gIB5E8HdgYDu3A5dYgEkkquHinv/DbNfnj0jb3F9qhJI6gabs/HvcSlMB1oCJ6wawK0AKu63RwPvxHi3XIHqnMtbqp96g74pMKOjs8Xq3PbQ5DIGd01lhIn1lHhuZRt6kaZhTGl5AJtVapzTVZxjpq4ZOx+raC/pmi5yG6tRXxzWt3FWyDIAjDyJzUUSsb1+ZH
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR03MB6428.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(346002)(396003)(376002)(136003)(39860400002)(451199021)(83380400001)(82960400001)(85182001)(86362001)(38100700002)(54906003)(6512007)(6486002)(6666004)(41300700001)(478600001)(9686003)(8936002)(8676002)(5660300002)(316002)(2906002)(66556008)(4326008)(66946007)(66476007)(6916009)(186003)(53546011)(6506007)(26005);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QzFYcnVGRXlzckVxdVFXTTJCdU0yZjI2RXdTUExQM1J5ZFVNWDVYNnJwZTV3?=
 =?utf-8?B?WDMxSlRjaXcvRFpQT05PbytJd0d6TlcwbnFhWGVxR0hxQzhwMFQzK2JQNVY3?=
 =?utf-8?B?cGcwcVlycjJTSThmSEdvVE1rYzE5VmxJd3ZOOHl6SUJqM1dJd1RRbXRscVRF?=
 =?utf-8?B?NEtuSnhuSEIwaE5tVlhST3AzYkpnV3BwcllObW1GdFhmVE14UlZZN3NqYnQ0?=
 =?utf-8?B?NlVZY0tnVVc0TG02WFI5Qll2dkhveFdtcTF5S0p3NWxKcXovbTJiRjlkdUl6?=
 =?utf-8?B?YUl2YWtoZlhHUzR2R0JsRW1tR09BNURTSFRIOTdHOXhjTXJ2eXRCOXhmdEJQ?=
 =?utf-8?B?a2YxV056eXJrRGRIdmJJSkRJeDVpMHZSV043UVQreURobFR5N3RXRUFHT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R1JuNFpxUVU2dnpYeWVFNTBSOUs0?=
 =?utf-8?B?Vnc9PQ==?=
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	a4A0dSL9R4fjjbIKM+sxQ9eR0B/Ske7siNGVFJctSc4jhpCbwFM9wjg4oLMq/RoVU5WqLrahgD33mtTkTmRVsA5uBbWYDb3EvbwS+QpdZ4d5NMEQ5MuOseWI2bbwSyaRv/WAQhxCFHp7De8bZjBUYLbsYX/DMcga7GFodRjEyLJ0FvEteYHOkaf9Kg+Cf8ZGnjOKuueXdhK8c98GUYjXS6seZ4ojrbNpL+DW7JGwbav7QSYyg3I0DLhRJjSxhcN1luly4SCGBN5/fQ1C/mZy6VaNQ8Sxn9woZ1QWXbEl2mVYkSagReiChBLLRe+vwjvjLUYduJ5nwRd+LSiH3sIFYlf5CiT5TOsEHRmJgXAS+DgwUps/64oTpST2oYhYAj4cgMHJAI54JbJoXW1VuuzXqQJWP9aFCVOEYmsMoZKmj9haAve5VqFm6nVmfYZUr6woWwea37wgMptt5Y98XVAq3BuysEyGJuLw1bKJxpkdEk3i99EJFv5ECa5tGnQ1UB0R4U01+D2Z7OMCIn7ZqlQInUVha+4eL7w9Qv1FY7cAtZ8rLCkJ7QLhM32hXSwIdlpNYVS5EV09HrApPejJlAW8fXJHaLWdZIVRq97peV3vifURQmzPxrOeH98cSVozeF/VBpoJsgcpkONZgCS2vsxxj6dAFgV5egeB4omhprjfTCYJ4I5st0kIRACLab4yARs+93b0IhQZdc9dow1ZPe5IcVXKEjqlMPcOyxWiYRvL0Vv9iuhCUihp52y+M2kd1/q13t+G+CIgEdskhVczQaCJz3nP9+mwiKOlSB9MBgH8A0jxTxUWRcb4O7hTwv5YRJa2
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ea254808-07c8-4bf3-83b5-08db7ed2c34d
X-MS-Exchange-CrossTenant-AuthSource: MW4PR03MB6428.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 10:13:09.0472
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: LMesH1FySVbiWiCoov/n+IEPad6Cakq7AP6mkYJFqy+I9zMZ3sX5N/OS0aHSLPtS7scwgYqcarjFWaYb87bUGQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR03MB4914

On Thu, Jul 06, 2023 at 12:41:58PM +0200, Jan Beulich wrote:
> On 05.07.2023 13:47, Roger Pau Monne wrote:
> > --- a/xen/arch/x86/efi/efi-boot.h
> > +++ b/xen/arch/x86/efi/efi-boot.h
> > @@ -795,7 +795,30 @@ static bool __init efi_arch_use_config_file(EFI_SYSTEM_TABLE *SystemTable)
> >  
> >  static void __init efi_arch_flush_dcache_area(const void *vaddr, UINTN size) { }
> >  
> > -void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
> > +/* Return a pointer to the character after the first occurrence of opt in cmd */
> > +static const char __init *get_option(const char *cmd, const char *opt)
> 
> Nit: __init and * want to change places.

Hm, yes.  I assume that placing it before the return type is not OK?
(static const __init char ...)

> > @@ -816,7 +839,54 @@ void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable
> >  
> >      if ( gop )
> >      {
> > -        gop_mode = efi_find_gop_mode(gop, 0, 0, 0);
> > +        const char *cur = cmdline;
> > +        unsigned int width = 0, height = 0, depth = 0;
> > +        bool keep_current = false;
> > +
> > +        while ( (cur = get_option(cur, "vga=")) != NULL )
> > +        {
> > +#define VALID_TERMINATOR(c) \
> > +    (*(c) == ' ' || *(c) == '\t' || *(c) == '\0' || *(c) == ',')
> > +            if ( !strncmp(cur, "gfx-", 4) )
> > +            {
> > +                width = simple_strtoul(cur + 4, &cur, 10);
> > +
> > +                if ( *cur == 'x' )
> > +                    height = simple_strtoul(cur + 1, &cur, 10);
> > +                else
> > +                    goto error;
> > +
> > +                if ( *cur == 'x' )
> > +                    depth = simple_strtoul(cur + 1, &cur, 10);
> > +                else
> > +                    goto error;
> > +
> > +                if ( !VALID_TERMINATOR(cur) )
> > +                {
> > +error:
> 
> Nit: Labels want to be indented by at least one blank. Here I'm
> inclined to suggest indenting to the level of the enclosing curly
> braces.
> 
> > +                    PrintStr(L"Warning: Invalid gfx- option detected.\r\n");
> 
> Maybe better PrintErr() and no trailing full stop?

Yes, please adjust if you don't mind.

> 
> > +                    width = height = depth = 0;
> > +                }
> > +                keep_current = false;
> > +            }
> > +            else if ( !strncmp(cur, "current", 7) && VALID_TERMINATOR(cur + 7) )
> > +                keep_current = true;
> > +            else if ( !strncmp(cur, "keep", 4) && VALID_TERMINATOR(cur + 4) )
> > +            {
> > +                /* Ignore, handled in later vga= parsing. */
> > +            }
> > +            else
> > +            {
> > +                /* Fallback to defaults if unimplemented. */
> > +                width = height = depth = 0;
> > +                keep_current = false;
> > +                PrintStr(L"Warning: Cannot use selected vga option.\r\n");
> 
> Same here then?
> 
> With these addressed (which are all mechanical and hence can probably
> be done while committing, as long as we can reach agreement)
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

LGTM, please adjust if you don't mind, otherwise I can send an
adjusted version.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 10:14:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 10:14:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560360.876227 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHiTh-00007y-11; Fri, 07 Jul 2023 10:14:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560360.876227; Fri, 07 Jul 2023 10:14:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHiTg-00007r-UM; Fri, 07 Jul 2023 10:14:16 +0000
Received: by outflank-mailman (input) for mailman id 560360;
 Fri, 07 Jul 2023 10:14:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=GM+b=CZ=citrix.com=prvs=545203e5e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qHiTf-00007b-Dd
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 10:14:15 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0518334f-1caf-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 12:14:13 +0200 (CEST)
Received: from mail-dm6nam10lp2101.outbound.protection.outlook.com (HELO
 NAM10-DM6-obe.outbound.protection.outlook.com) ([104.47.58.101])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 07 Jul 2023 06:14:06 -0400
Received: from MW4PR03MB6428.namprd03.prod.outlook.com (2603:10b6:303:123::8)
 by BN8PR03MB4914.namprd03.prod.outlook.com (2603:10b6:408:7b::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24; Fri, 7 Jul
 2023 10:14:04 +0000
Received: from MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd]) by MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd%7]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 10:14:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0518334f-1caf-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688724853;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=LKzw3xHzR/4CC8l0mb7E0R2gIityAQmkHmBJnEzQJAo=;
  b=H6pokUE7IQ2nKuNnuBWVLeB2Ac5Uog5Sg8AsdQK9w0S/VGaywXln816b
   PNjBIRUuMSvEuhY1Y/Y5MKMSKnGSc6nkRCdOYaFqdrwxWVGph55rVhDkd
   qKjPkBu0UHrrP+jyCKdBppf5A7WCWbeyjZotq/1lB2jHXO6M9TpkIHuLK
   g=;
X-IronPort-RemoteIP: 104.47.58.101
X-IronPort-MID: 114179631
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:QKhezaK9KZfBtOtVFE+R95QlxSXFcZb7ZxGr2PjKsXjdYENS1DMAy
 GVMDWqHa6mPN2T0fNlxaYW2/BkFvZWGyIM1G1dlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphc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al: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=RbjIFjLBJvYDdi7l7xm5H6Ji6NmLlKr7Jisn0IwdUQ952IgXWOcNhfpBkPq6ICCCCKjgrDrHcWUByLFJi3foyJxzNHxgVUfibH/DM9p28rHaHqs+OaBTuZViYRn/YQrVnTYDzAdvzDN/qpKE9HFm/B0Ohh66WhikgsSAWpWcvfz20slIHw8ml87DMl2+mpR3AUlrsog0VmkbMCJOEwi8eL7efUzOekWiv1jZgWhw+1O8TEptBzItLbqXSV9MP0K95CygvolpCrBp6i+09sYdJxsue2Bx5umKYd8Kxe1NrAQBQ/5L4sn6mYOMbvIBxuxP9KY7tqVE21o8bq4U/slidg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ENTzTDoOFWECKo+jyH04E8Zqb0CNSQo4DQc0MGHkO1Q=;
 b=EqNxpkXsHbYOpT+UzKmndsSH2c75bG/FCTZceLMYW/u5olXQ2xXFQ0lmVFPCraNQmmKPTX7vb8hDMhTF0NCheiCBpydAFs+OOjnvy6CrgKlUIkrAU+CTkCu7hKyJe2iMXzQFQByy7iPHSzbTpaCJpB+Yd75ZDInyCjSbsXDp52rYwDyUpyXcN2JZW1sNrGIJmam463XkEVJV15zTl1aR4UyA40XjiMWZos6KUP8MRd/hUAbM+mCT9P6bb+VAoNNOMScAt7tZqq7q0YPTtRG3hMkyn7QyhX+brfHElU+fsWx0o5ReQINYN0M4hs5oewl4MOJ4n1gCdLZbgRm/EjyqNA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ENTzTDoOFWECKo+jyH04E8Zqb0CNSQo4DQc0MGHkO1Q=;
 b=FMEkYC8VBC6pdILReJA2qQ6Rk3mN6ZSYJrVxOarihQUZ2xoH3f3ErmZp+Cqh/CDMZjto5o32F8Wwu3fRMX46ux78Ncg7CGRrO3ffzSGmFIx7YNzsoc8CyK2fQAZmRaWzNUdu90tXk5sdZyrrLsy+UO5a+68I0pz51GuFLZy8H/Q=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 7 Jul 2023 12:13:59 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 3/3] cmdline: parse multiple instances of the vga
 option
Message-ID: <ZKflZxLSLGsmQwOU@MacBook-Air-de-Roger.local>
References: <20230705114741.11449-1-roger.pau@citrix.com>
 <20230705114741.11449-4-roger.pau@citrix.com>
 <111078b3-399a-40d8-b8ed-db80dbea3bc7@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <111078b3-399a-40d8-b8ed-db80dbea3bc7@suse.com>
X-ClientProxiedBy: LO4P123CA0491.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1ab::10) To MW4PR03MB6428.namprd03.prod.outlook.com
 (2603:10b6:303:123::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MW4PR03MB6428:EE_|BN8PR03MB4914:EE_
X-MS-Office365-Filtering-Correlation-Id: 69602e42-51f2-49ff-da49-08db7ed2e47a
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	x3WZ9RylYn2uqXxTCcaVAlli+As1la7uepL0XbLUC45O0GD6PEcvqXvqKRo+FHto/w0ieZNmlDZ4qsRDd8X+cOZ58CusgYnlmfsEJ9JQK9k+HjeJdMznBDKLvuOHSdqcgRAMkD/lY0xgZo291q/cgwASh5dtpeOif4X9VMdYuJgFWmG8b4d0B5HNQrZCdamIqJE/PKyz3Ld4OcmfBqnoAa3U1zMLZY9K4DIRjdIVN9KfXF+WOcicRxirr+MSoXXdbfjHSJE98d+RlqdX6gCmRIhMwaHoP5rXoPqVgbqHtFw41B9u9vTBEVMTNvArM6+rq3pT8/kO1j60/8r3nZORZtiu1x54KFdRuV/meQykvl7mcgGDe1GsFtXoUR9IygQTg+f/nWE9JwWx16FUslEtEYLEzH1eBaTkj21oZrMwbtqkrCIyJ8yu9IMLIMwa83npXuhU45cyZL2VvZyowrnLGKCoVm22IXb66zPm9dMqekqy1fAld14qcXFwvf2TvaK402SR4uqwv6fQFdVY1KTK6nJgKrWOBabPIKFJ0VG7EjO8SNS8+fIAovdQUJoXqoIW
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR03MB6428.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(346002)(396003)(376002)(136003)(39860400002)(451199021)(83380400001)(82960400001)(85182001)(86362001)(38100700002)(54906003)(6512007)(6486002)(6666004)(41300700001)(478600001)(9686003)(8936002)(8676002)(5660300002)(316002)(2906002)(66556008)(4326008)(66946007)(66476007)(6916009)(4744005)(186003)(53546011)(6506007)(26005);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-Anti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8pf9yhNhAG/iL+1yoL7JjoSpi0TctlcIMbV0JupMeYSp/Zqnm+Ps5Di9lboY3bFOPWX757JsQZDgzA/ciEOOX2G7ykSUJkhzokQdPvgbMaaNr2rjkY/kXWZuSrffm1TdOf1O/+qlm06hcGG8k2sOJaqBojZaJdtKE2FOs9izN+Z6ZztTuVohLG+y83dd5fBbpgq7lzwYtLGUT2d7UwyqsZrQwZRrnvyDit/LAJz4x8Sy/ogsH5x+uvR4v91gIdaqNWvACRQ9d+6cLC+pz+/ONOTJNjQ/ZF+cGIoQaZ5f/yZ6swpHwJthA91J1ubAayMHxkKONoWrSDpIiikSq+bjyRZpD9mA2cl/ALE7kWkyLgDNwoQW5213a8HgCV1qaH+/K9mLBlpluAZ
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 69602e42-51f2-49ff-da49-08db7ed2e47a
X-MS-Exchange-CrossTenant-AuthSource: MW4PR03MB6428.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 10:14:04.5663
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: BojUlR7C3EyZO6TY9pjh6tLDrLzbSs/WXSamBPa30+UXPYV0U6P+nq3ww/P3k5cq1KqX8eJdUWXdb1e0oS7kPw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR03MB4914

On Thu, Jul 06, 2023 at 12:45:41PM +0200, Jan Beulich wrote:
> On 05.07.2023 13:47, Roger Pau Monne wrote:
> > Parse all instances of the vga= option on the command line, in order
> > to always enforce the last selection on the command line.
> > 
> > Note that it's not safe to parse just the last occurrence of the vga=
> > option, as then a command line with `vga=current vga=keep` would
> > result in current being ignored.
> > 
> > Adjust the command line documentation to describe the new behavior.
> 
> This was likely meant to be dropped along with ...
> 
> > Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> > ---
> > Changes since v3:
> >  - Remove xen-command-line doc addition.
> 
> ... this? Beyond that (easy to adjust while committing)
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Oh, indeed, I've added the changelog and didn't adjust the commit
message.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 10:17:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 10:17:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560366.876237 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHiWQ-0000m1-E2; Fri, 07 Jul 2023 10:17:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560366.876237; Fri, 07 Jul 2023 10:17:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHiWQ-0000lu-Ac; Fri, 07 Jul 2023 10:17:06 +0000
Received: by outflank-mailman (input) for mailman id 560366;
 Fri, 07 Jul 2023 10:17:04 +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 <SRS0=ruU0=CZ=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHiWO-0000lo-Q2
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 10:17:04 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on2060d.outbound.protection.outlook.com
 [2a01:111:f400:7d00::60d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6a31adb1-1caf-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 12:17:02 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU0PR04MB9496.eurprd04.prod.outlook.com (2603:10a6:10:32d::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 10:16:59 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Fri, 7 Jul 2023
 10:16:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6a31adb1-1caf-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BvcKEtS9SfHkA6dC5dNRy8yT2FF+Y+QpF7tdtTVwFCwmcnxpFo4T5xy8OrWugiqiuJAMhxCBbqio0w3DubkWOKbmf9E5Tn9czEeZa8mt2z8D99VccH60Uh88Y6bfharDyS/GPSoydkx7s7lD/yhLSuTllPDok5aCIP4bloBMHACGIiQmVJR8nHMA+jFUpy2wejj7KOwjyB2FNaEDtYd6G+Ipr/Q1ndZZq5beE4OX+f3A4R92FgTMHZgbuRO9e675yeFxHfJxLIciyX5BAp7JO3UhuqXEe0dOxdcmfa+Y9z//FGAlpams2CEV0eJLt3zhLU5YYrDD6BIj4/aEaNtI0Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=G3bffg+VqPaPLCUztFTe3SBOuAsFr6E4z1VQ4ZYZQIQ=;
 b=Uv/aey8FG0xH5m4tYnuhUajgMDfwp6+Xu6PqlxpLb3nSVPaERdG6+n/g/MX0KOrFDF85BP0tMFufA7jOWyRSiosewwn/zsLzyGKoOYp9whl2RtZ7uOFdHC0D4Kcobutv+M65wIRB+AcZc0Amds499EHzwwh5mnN2EW2Gtv7a6bdnk88zIj0HA8IAX2LEx4cHL9N/k2L8X3i3AqS7RcgyGD49DWXCkVQiqoueuqHP6dXL4x6ivrtdTXkpVZ4LLpr8ZbwLnDUXTsPcp6YeGm9y0px6iMNYp5nLwLw1XEFGn2xuHA2Zk9U27nBjhY3sNWofLMGq59cOqAXKGBhvnqu1lg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=G3bffg+VqPaPLCUztFTe3SBOuAsFr6E4z1VQ4ZYZQIQ=;
 b=KzGvMZwJ5ryg1nxrzabUFntMv8uZeYiW1+eRRUklrGjODBqXeet65Pztl5tGmqOCVuXx1OMoABWIo/nF9kC2jCLHvB2EeEfsk4ZhqeqXBMWUiS5JBRzTUTYNHVaW4pnDyIPFOVPzRqSxpkkVrxhN4F4qGq7xpOOLTCGZc+O0ZKAjWJVpCiGb2oDhFr+7xLwss7y5GdqLhMEOK5OD2BGym08LrwW/MTUi5fjmBl89NV/SSddlRWn50P+xFFyovIOkAmnecUz2lJZIBDm0nZeNhifbNTjwHB9TG/QzVE+0ofA6ZX3opdzqcafrgorS3LPF105KFG6DV6zNC6CIaPYRvw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <495946e9-191f-22fe-9ecf-08eb5af833ba@suse.com>
Date: Fri, 7 Jul 2023 12:16:57 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: Detecting whether dom0 is in a VM
Content-Language: en-US
To: George Dunlap <george.dunlap@cloud.com>
Cc: zithro <slack@rabbit.lu>, xen-devel@lists.xenproject.org
References: <CA+zSX=Y4MwsDSd9oSG1NQyt==YAw9SeRdh=eJxTUhhOx57ihWg@mail.gmail.com>
 <4ee01a0f-063e-ef93-ac24-da387d5b3438@rabbit.lu>
 <a680ae62-7765-aa51-1edd-9a1a7e39e449@suse.com>
 <20b1a79c-23c1-93bc-2090-8052f143422c@rabbit.lu>
 <27a3e6a2-b150-1d75-c86f-dfa2b906b298@suse.com>
 <CA+zSX=ZCmmKQX7acx-oK4nSki9ONscxLP7E8t8USjdjXJ9UDpA@mail.gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <CA+zSX=ZCmmKQX7acx-oK4nSki9ONscxLP7E8t8USjdjXJ9UDpA@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0171.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b4::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU0PR04MB9496:EE_
X-MS-Office365-Filtering-Correlation-Id: 66e550a4-96a7-42bf-cf9a-08db7ed34cd3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	2sMrUhR65NmFCgJ+NFveyv0slvxrroLceros5cHw1rKCeJIMCSJG7dyuyQco3pZDNXbLMCO9Au5JKVKBbCQPeKLP1up7RQvKtZJP5ruLl0Jnlll+T7+mYahx6a6pLV5sOGw2l1a/A0bRb2iWOtzv+XFM2u4eMYR1G4Tzy93bb0V71UXDkm7WWJwGZKAiNryo/TWvnfLlq5GdSSCvOVrGIvkX9MokJPFCbk/ki+INbaRBgEACbODyn/HgJvKYal9sl53rXs5IJkX2JMB45lJ0MFarqOC6jXy1mga5m5o2VJoPqhDQTVpmjlAANmdaGnjQ/LA+cxuSQI/u+SJFSzI4YRpNfUmPRy3/W9vkLkG5MBfTP0gZn61xehBiAmU9jCkDOVKZWbna+h0jbk/LvyNa3T1QWC9SaTqzAHsNbqEGUq5mwlvAby0Fkqxyf6rKHIdb1Lma1x0mwwf1kpkE/siBfcDJfwCrXk45xVYixPh15K+SAhxCLavA+YqPkebKd0LpafbM7qb+3GbMLhj6v4J91PIjxdsKl4TvJkuNS6rSFethS2KD4Ep0IU/09ZLvKBNVdXuu2AB6lbtf8Cr4zBbNd45RX4qQxnho2gWpZJLMKN38Ia537movgcnlpXANpDC7KnUCmMxhe+VTRgl3QHBZEA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(136003)(376002)(39860400002)(366004)(396003)(451199021)(31686004)(8676002)(2616005)(2906002)(8936002)(5660300002)(26005)(66899021)(53546011)(6506007)(186003)(66556008)(41300700001)(66946007)(6486002)(4326008)(83380400001)(316002)(66476007)(6916009)(36756003)(478600001)(6512007)(966005)(38100700002)(86362001)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TXVDb0FpeVk4YXZONmpidGJGMitWY3hnMFY2OGIyWXA2US9PVWZ1ZVdqbW1y?=
 =?utf-8?B?KzdtRmtFN0MxMDlweHhMT1hSSzlLcU5mamY3bnJ2Y2JLa21YdSt4cmVIVXFR?=
 =?utf-8?B?T3NkTXlDekVvV01BbFd2cGY1cklCZUF0dnIweDlDREUvK2Via2lIYkhrV0pw?=
 =?utf-8?B?SUhvSFJZZ1pDQWJiaHpBRjR2UHA3OStjdHhOOTJLNE5LRGxEOEgvTFF6T1RY?=
 =?utf-8?B?SElIbkNiMjRzelYzb1lzQ1o2UUNyd3hGb1VGb0QrY0VKOW8rTjF2WmFnUnZt?=
 =?utf-8?B?OXZBZjBkM0I1QW9ERkRvdXI1K1dCK3ZyN0pBWlhYNEtqWko5cElGamNnR3FT?=
 =?utf-8?B?UlcwM1V5ekcxWDh3WjhrRjB1bXJ3VTJ0bFh1MzlyTUx6OE1rWjJ5bmlTbXlw?=
 =?utf-8?B?Rm13aGRsU3ZlR3M1bnQxcERuUVJpUDlNK1hzU1lsNm1leWZrUk0yKytvVHBX?=
 =?utf-8?B?UmdOUmZYc3d1M0lMMVRRei9uT0J0Z09GK3pjUUJiZllpeVFRTndZdE5PakI1?=
 =?utf-8?B?MlhaUHFsampGelE1SnpNYlF6NUtZekllMHUweDJvaWJVL3EwbEswOHlDSnda?=
 =?utf-8?B?NXVTdU5HUW9Gbmo4bFhUU1B5VVJaNGQ3ZXlZWFpxRXhpUVpLQzFMUktrWldk?=
 =?utf-8?B?eDhPY2JYa1orWEFBUU5NQ3RsZk1TWGJpK0NtRkRVVXVQcDVydTQvV01PbC9m?=
 =?utf-8?B?ZGVtSHJ4cTF3Q3drdEdaL3M4dGFaYUVnejVlYkdOY2JNMTZjVXZTNU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XhyOCtnVUxYUmlOUk1rd2laL3dXamJtVlEzdW5LcE50ZHc0aGpu?=
 =?utf-8?B?dnQyd1ArTGkveFh0QWkvMGd3d2ZrVVc3QUIxWlMzY21QblI2SUtjdUxHeXly?=
 =?utf-8?B?MHlqckZtREJtUXhENzUvWVkrZ2RxTkFDMDBnZWJSU0RsUDRWTjM4UmthV0dL?=
 =?utf-8?B?d1RUcjdBc29KOHRjVEI0SnNZTUpuZjIzaFlTeFNBbkRrSy9oWjFVQWMzMEdp?=
 =?utf-8?B?VDNBYVVEL1d5RHAraGcxYnFLQnNFMGNxdjR4MXV3c04rNTZydDhKVzVUNXh4?=
 =?utf-8?B?WkxCZXBNblhCQmhvb1dCWFZuK1FNeDl5cDJNMzhSaGhSOFg1RmM3UG93dlhm?=
 =?utf-8?B?bE9RWFRBb0VXTUZWZmZJcjkyalBxS0RaYzcvcitLQ2MzVllkOWlsa0d5c1Zj?=
 =?utf-8?B?aG5pQXFwOE5YSExpSVZNTmhGKyt0U2gxeUp2NE5JcHBtcVFya2FyMWI3V0to?=
 =?utf-8?Q?rFlWf+XE1KiNzn/mw2dFFKw3D?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 66e550a4-96a7-42bf-cf9a-08db7ed34cd3
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 10:16:59.6079
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: loIIhZjtGRyAvTk5ydyHJXIv9O+/Qura93D8Dj5faEx72dskYuGLInrN293gEBhMIemsiIwpeUYAbaspM8JdwQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9496

On 07.07.2023 11:52, George Dunlap wrote:
> On Fri, Jul 7, 2023 at 9:00â€¯AM Jan Beulich <jbeulich@suse.com> wrote:
> 
>> On 06.07.2023 17:35, zithro wrote:
>>> On 06 Jul 2023 09:02, Jan Beulich wrote:
>>>> On 05.07.2023 18:20, zithro wrote:
>>>>> So I'm wondering, isn't that path enough for correct detection ?
>>>>> I mean, if "/sys/class/dmi/id/sys_vendor" reports Xen (or KVM, or any
>>>>> other known hypervisor), it's nested, otherwise it's on hardware ?
>>>>>
>>>>> Is that really mandatory to use CPUID leaves ?
>>>>
>>>> Let me ask the other way around: In user mode code under a non-nested
>>>> vs nested Xen, what would you be able to derive from CPUID? The
>>>> "hypervisor" bit is going to be set in both cases. (All assuming you
>>>> run on new enough hardware+Xen such that CPUID would be intercepted
>>>> even for PV.)
>>>
>>> I'm a bit clueless about CPUID stuff, but if I understand correctly,
>>> you're essentially saying that using CPUID may not be the perfect way ?
>>> Also, I don't get why the cpuid command returns two different values,
>>> depending on the -k switch :
>>> # cpuid -l 0x40000000
>>> hypervisor_id (0x40000000) = "\0\0\0\0\0\0\0\0\0\0\0\0"
>>> # cpuid -k -l 0x40000000
>>> hypervisor_id (0x40000000) = "XenVMMXenVMM"
>>
>> I'm afraid I can't comment on this without knowing what tool you're
>> taking about. Neither of the two systems I checked have one of this
>> name.
>>
>>>> Yet relying on DMI is fragile, too: Along the lines of
>>>> https://lists.xen.org/archives/html/xen-devel/2022-01/msg00604.html
>>>> basically any value in there could be "inherited" from the host (i.e.
>>>> from the layer below, to be precise).
>>>
>>> So using "/sys/class/dmi/id/sys_vendor", or simply doing "dmesg | grep
>>> DMI:" is also not perfect, as values can be inherited/spoofed by
>>> underneath hypervisor ?
>>
>> That's my understanding, yes.
>>
>>>> The only way to be reasonably
>>>> certain is to ask Xen about its view. The raw or host featuresets
>>>> should give you this information, in the "mirror" of said respective
>>>> CPUID leave's "hypervisor" bit.
>>>
>>> As said above, I'm clueless, can you expand please ?
>>
>> Xen's public interface offers access to the featuresets known / found /
>> used by the hypervisor. See XEN_SYSCTL_get_cpu_featureset, accessible
>> via xc_get_cpu_featureset().
>>
> 
> Are any of these exposed in dom0 via sysctl, or hypfs?

sysctl - yes (as the quoted name also says). hypfs no, afaict.

>  SYSCTLs are
> unfortunately not stable interfaces, correct?  So it wouldn't be practical
> for systemd to use them.

Indeed, neither sysctl-s nor the libxc interfaces are stable.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 10:22:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 10:22:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560370.876248 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHibW-0002Dc-Vd; Fri, 07 Jul 2023 10:22:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560370.876248; Fri, 07 Jul 2023 10:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHibW-0002DV-Sw; Fri, 07 Jul 2023 10:22:22 +0000
Received: by outflank-mailman (input) for mailman id 560370;
 Fri, 07 Jul 2023 10:22:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=SeC+=CZ=tesarici.cz=petr@srs-se1.protection.inumbo.net>)
 id 1qHibU-0002DO-3B
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 10:22:21 +0000
Received: from bee.tesarici.cz (bee.tesarici.cz [2a03:3b40:fe:2d4::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 25aa6a0c-1cb0-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 12:22:18 +0200 (CEST)
Received: from meshulam.tesarici.cz
 (dynamic-2a00-1028-83b8-1e7a-4427-cc85-6706-c595.ipv6.o2.cz
 [IPv6:2a00:1028:83b8:1e7a:4427:cc85:6706:c595])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (No client certificate requested)
 by bee.tesarici.cz (Postfix) with ESMTPSA id 291D6EB4F0;
 Fri,  7 Jul 2023 12:22:15 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 25aa6a0c-1cb0-11ee-b237-6b7b168915f2
Authentication-Results: mail.tesarici.cz; dmarc=fail (p=none dis=none) header.from=tesarici.cz
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tesarici.cz; s=mail;
	t=1688725335; bh=R2JAn8dEc5t5IbxpMIYj+ROpC8mKUwi+oGPWhkhnmps=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
	b=hrw3hX5hun3YSXg/bR+StoUqmBtv5Sg4IUiJIG4MBvgSTT8nNjHLDBlwAxI/Bgus2
	 f++y7N3Z1Wa5LMZrneYAvSsBQ3NkH/xvR6QjWjMIveXWXfbNevXIqCBNV4YCOQjBAj
	 WECHj7caN3qm6AJ8He9i9tGPkhCGQg0Krp19h20yz99u5X+9BPg0Gdgz3R9hE7N5mn
	 ozvvrVEjkXoAMyYrINs49hiIRN1hd2XoGedS6hDK0kwmzglSNWF6XGZr8B7FmzvcZ4
	 80/N8K8H+Sxi8onYywDqbBt4L7jxPlco1/GoFG7/OVNeYT14QIYXOD4psk7JWBhyxJ
	 JNUUAHieg1MmQ==
Date: Fri, 7 Jul 2023 12:22:13 +0200
From: Petr =?UTF-8?B?VGVzYcWZw61r?= <petr@tesarici.cz>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Michael Kelley
 (LINUX)" <mikelley@microsoft.com>
Cc: Petr Tesarik <petrtesarik@huaweicloud.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>, "H.
 Peter Anvin" <hpa@zytor.com>, "Rafael J. Wysocki" <rafael@kernel.org>,
 Juergen Gross <jgross@suse.com>, Oleksandr Tyshchenko
 <oleksandr_tyshchenko@epam.com>, Christoph Hellwig <hch@lst.de>, Marek
 Szyprowski <m.szyprowski@samsung.com>, Robin Murphy <robin.murphy@arm.com>,
 Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Hans de Goede
 <hdegoede@redhat.com>, Jason Gunthorpe <jgg@ziepe.ca>, Kees Cook
 <keescook@chromium.org>, Saravana Kannan <saravanak@google.com>, "moderated
 list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>, "moderated
 list:ARM PORT" <linux-arm-kernel@lists.infradead.org>, open list
 <linux-kernel@vger.kernel.org>, "open list:MIPS"
 <linux-mips@vger.kernel.org>, "open list:XEN SWIOTLB SUBSYSTEM"
 <iommu@lists.linux.dev>, Roberto Sassu <roberto.sassu@huaweicloud.com>,
 Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH v3 4/7] swiotlb: if swiotlb is full, fall back to a
 transient memory pool
Message-ID: <20230707122213.3a7378b5@meshulam.tesarici.cz>
In-Reply-To: <2023070706-humbling-starfish-c68f@gregkh>
References: <cover.1687859323.git.petr.tesarik.ext@huawei.com>
	<34c2a1ba721a7bc496128aac5e20724e4077f1ab.1687859323.git.petr.tesarik.ext@huawei.com>
	<BYAPR21MB1688AAC65852E75764F53099D72CA@BYAPR21MB1688.namprd21.prod.outlook.com>
	<2023070626-boxcar-bubbly-471d@gregkh>
	<BYAPR21MB168802F691D3041C9B2F9F2DD72CA@BYAPR21MB1688.namprd21.prod.outlook.com>
	<2023070706-humbling-starfish-c68f@gregkh>
X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Fri, 7 Jul 2023 10:29:00 +0100
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> On Thu, Jul 06, 2023 at 02:22:50PM +0000, Michael Kelley (LINUX) wrote:
> > From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Sent: Thursday, July 6, 2023 1:07 AM  
> > > 
> > > On Thu, Jul 06, 2023 at 03:50:55AM +0000, Michael Kelley (LINUX) wrote:  
> > > > From: Petr Tesarik <petrtesarik@huaweicloud.com> Sent: Tuesday, June 27, 2023  
> > > 2:54 AM  
> > > > >
> > > > > Try to allocate a transient memory pool if no suitable slots can be found,
> > > > > except when allocating from a restricted pool. The transient pool is just
> > > > > enough big for this one bounce buffer. It is inserted into a per-device
> > > > > list of transient memory pools, and it is freed again when the bounce
> > > > > buffer is unmapped.
> > > > >
> > > > > Transient memory pools are kept in an RCU list. A memory barrier is
> > > > > required after adding a new entry, because any address within a transient
> > > > > buffer must be immediately recognized as belonging to the SWIOTLB, even if
> > > > > it is passed to another CPU.
> > > > >
> > > > > Deletion does not require any synchronization beyond RCU ordering
> > > > > guarantees. After a buffer is unmapped, its physical addresses may no
> > > > > longer be passed to the DMA API, so the memory range of the corresponding
> > > > > stale entry in the RCU list never matches. If the memory range gets
> > > > > allocated again, then it happens only after a RCU quiescent state.
> > > > >
> > > > > Since bounce buffers can now be allocated from different pools, add a
> > > > > parameter to swiotlb_alloc_pool() to let the caller know which memory pool
> > > > > is used. Add swiotlb_find_pool() to find the memory pool corresponding to
> > > > > an address. This function is now also used by is_swiotlb_buffer(), because
> > > > > a simple boundary check is no longer sufficient.
> > > > >
> > > > > The logic in swiotlb_alloc_tlb() is taken from __dma_direct_alloc_pages(),
> > > > > simplified and enhanced to use coherent memory pools if needed.
> > > > >
> > > > > Note that this is not the most efficient way to provide a bounce buffer,
> > > > > but when a DMA buffer can't be mapped, something may (and will) actually
> > > > > break. At that point it is better to make an allocation, even if it may be
> > > > > an expensive operation.  
> > > >
> > > > I continue to think about swiotlb memory management from the standpoint
> > > > of CoCo VMs that may be quite large with high network and storage loads.
> > > > These VMs are often running mission-critical workloads that can't tolerate
> > > > a bounce buffer allocation failure.  To prevent such failures, the swiotlb
> > > > memory size must be overly large, which wastes memory.  
> > > 
> > > If "mission critical workloads" are in a vm that allowes overcommit and
> > > no control over other vms in that same system, then you have worse
> > > problems, sorry.
> > > 
> > > Just don't do that.
> > >   
> > 
> > No, the cases I'm concerned about don't involve memory overcommit.
> > 
> > CoCo VMs must use swiotlb bounce buffers to do DMA I/O.  Current swiotlb
> > code in the Linux guest allocates a configurable, but fixed, amount of guest
> > memory at boot time for this purpose.  But it's hard to know how much
> > swiotlb bounce buffer memory will be needed to handle peak I/O loads.
> > This patch set does dynamic allocation of swiotlb bounce buffer memory,
> > which can help avoid needing to configure an overly large fixed size at boot.  
> 
> But, as you point out, memory allocation can fail at runtime, so how can
> you "guarantee" that this will work properly anymore if you are going to
> make it dynamic?

In general, there is no guarantee, of course, because bounce buffers
may be requested from interrupt context. I believe Michael is looking
for the SWIOTLB_MAY_SLEEP flag that was introduced in my v2 series, so
new pools can be allocated with GFP_KERNEL instead of GFP_NOWAIT if
possible, and then there is no need to dip into the coherent pool.

Well, I have deliberately removed all complexities from my v3 series,
but I have more WIP local topic branches in my local repo:

- allow blocking allocations if possible
- allocate a new pool before existing pools are full
- free unused memory pools

I can make a bigger series, or I can send another series as RFC if this
is desired. ATM I don't feel confident enough that my v3 series will be
accepted without major changes, so I haven't invested time into
finalizing the other topic branches.

@Michael: If you know that my plan is to introduce blocking allocations
with a follow-up patch series, is the present approach acceptable?

Petr T


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 10:24:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 10:24:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560376.876257 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHidM-0002pG-Fb; Fri, 07 Jul 2023 10:24:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560376.876257; Fri, 07 Jul 2023 10:24:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHidM-0002p9-D3; Fri, 07 Jul 2023 10:24:16 +0000
Received: by outflank-mailman (input) for mailman id 560376;
 Fri, 07 Jul 2023 10:24:16 +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 <SRS0=ruU0=CZ=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHidM-0002p3-2p
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 10:24:16 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on0618.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::618])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6b677bac-1cb0-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 12:24:14 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB7929.eurprd04.prod.outlook.com (2603:10a6:10:1ec::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 10:24:12 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Fri, 7 Jul 2023
 10:24:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6b677bac-1cb0-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=nVTiN6H5fNusdwKWpCeNqhZORqeoAvCpUI7eeZtPkQ+OKhs1Rfw9WZ/rxomYf4+UVWMmiUV274A5H8f4YBXNnGj5Gcz5p6Th9xW4VSoTZGCcxt/ldt3TrCyWUoVW43Kvt9mIQbIChPdHQDKEVA+aIonFKeJGGBQQ+LW+FWj6VqdFG50oueEJgnBGA9jU6RTLIZ80pK0pbOdKYdGd7GV6NmtUXA4mviklRWd66gcZ38f/2bKjkT3MFQjLKQIRnX2+QLs0oB17Q9lvfaXRoTYt6Bi6ahrpQQtO+kIGN4yRYZOx0pRcB3OfCSHPvTF2QVicjK2uN0RdKJkiocwai1e0qQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OrjzAScu81OJ8Z+g2rhrx2sRQ6XH9ehb3XynSCHFF8I=;
 b=fsAX4J1JEo/Uv0eQ48EA0AEK3WaIblIokz7zU/qdQ1BaPpturQoVEJw7GuRatORA3n3rsqMkM0jbycrrVh9Cyojk8ONminyaMfssiq96qb/jPBpk7Bo8rjf9IPlxCVjD8Cun3CE1Tt4dzemHsax9WSAouacWvRm0LVaVJODf9rFFP3yRp0ovB5M/8TdilpbkK8r2zCajxvAbg8flU2MFEScCA80T9Bf6LY1AHGm+vzplzymqUpcWABcylDO1N/pz04FlBA+0A9sNnx8yiIWvKruHV0aoltiNGca3joYVaMaxtbtkyNPfFCCcu4jQSSY/eSmbm3g6bITkETuLw+zUFQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OrjzAScu81OJ8Z+g2rhrx2sRQ6XH9ehb3XynSCHFF8I=;
 b=aSVYpyGM5RebXUNJI7mjLKsC2TXlDpKdT+T95F7v1RZJ7TWB/8mPk9TN9/je1HATw0w1gpA1I53TMtIR2pUM4FnpZfkgxqlQUBD2Iti95pXbpexUOsMiOya6A5gS3ypkR09BNGVKdu3MXQ3pCo72His95PJfwEPPOwIzC/a7XH4GzzQ6sPszZlw75nUekp5zzkTG05hEZcXzk5QH+jhPbTYx2L2IglcekLnL0XURIiTc7i/loUVsIf1JhXKuqSCl08dC8uZMgWAehotqaW6NxQiLqkoIy/A2oUjIvoHautLTeG7GzSMCg+xOXQDNJQViheNL9ixsHjDRQjTEbPuO9w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3bfd9a21-e4e7-2d9b-8a40-8b77c80e4fb7@suse.com>
Date: Fri, 7 Jul 2023 12:24:10 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v4 1/3] multiboot2: parse vga= option when setting GOP
 mode
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230705114741.11449-1-roger.pau@citrix.com>
 <20230705114741.11449-2-roger.pau@citrix.com>
 <47cc5f67-973a-2095-932f-6ebea2d3bd9e@suse.com>
 <ZKflLxsh1AKyvPOT@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZKflLxsh1AKyvPOT@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0065.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:93::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB7929:EE_
X-MS-Office365-Filtering-Correlation-Id: 8e5f1d14-bb8e-42a8-3a39-08db7ed44e99
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	K1MARHoNgHEWZV1wpzQXrIY0P+1ortP5Y5HMreHNn8PqHAgdU1umZ9Zb4d7WgjboKuc30sJeJhelfbSuXnwGOvV0gD+Iy1W+GPVG87uJKD5sPRKPtbrWylrvE5FJMQj+un4XEGT63Lb0JAvv0cFUOSFRjqCUpy1jGtIstACYxDk0qdgqHNSYM2GSVVs/0F3/ul68+BfBmLtRlGmXtI5ajWznehTtYsm61EjPc1GFtLLxeeFlGq3Dte/5YMiLif9QvGNmyYLxxJ/Xi/YjhR1iZQ7AlVwYKhRhCUGZkR68xPFeUdhu1tbXYVVVgYAVpcloo3JiXssu6cHFX5++gIbvBHSg7FNwYdPRUpCVLg3/mIilfzVhQBfDIXyObvoEgK6okS25xnHXStoIRMM/DqzUUUsPrm4gosOD2rta0lfdPIAld577KITR3Hk2SzJFEe122ode+NOLkKNUenei3F0qCcgmKY8GKzij52Eg8g/KypvO5lCkE7+JWVLQ4PZ3QZDuby27jZPG+Fpcs/U51AoYOlUGv8p0D1wYzpsB1+vCoMiCh59A2XPVWRcdK5KHiAjJ0Il5AEAmLhimO/EqYS1zDYmqroSX1rfme2comGoxI2dO9K5dJ/S4sUbauCRACiBrVcZRltnzTmSORAoJ0+UZJA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(136003)(366004)(39860400002)(376002)(451199021)(41300700001)(6512007)(478600001)(54906003)(31696002)(86362001)(38100700002)(6486002)(36756003)(4326008)(66946007)(83380400001)(6916009)(316002)(66476007)(2616005)(2906002)(8936002)(8676002)(5660300002)(66556008)(31686004)(186003)(6506007)(26005)(53546011)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-Ch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 =?utf-8?B?SjZ3YlE5cDlpTGFXR1V1c2pENWxXdm9GSkRvbTNXdjkvTUUxVDBiUnFGTWly?=
 =?utf-8?B?WVd4M09XdWxDUFlBNGROTENGeUYxOFowQ1kzZjl2TnpOdzNuSk42NDlpQmZv?=
 =?utf-8?B?WGw4N002ME5BVEFGdXBFUyt4OTZGSEc4blhkUTg1QTJMbUZGOXZMUmtQM2x3?=
 =?utf-8?B?OENBeEJKSWxNdDFJYXFTMFgrQ1l1NzA1SlEvNFk0YmE3UHhzUjdyc05nRDFn?=
 =?utf-8?B?emRERnpWQzFxMkR3eW5yN2FPeG4rRXFzd01EZWorSEZsNXJZajJnUFVDdGt0?=
 =?utf-8?B?YWVPQzYxcEFhM0JWZ3YrcURIYzdMWldDd3UxT1lVdERUWnFBYjRhZEZ6SGFt?=
 =?utf-8?B?S0ZwYnFEZUh1UVRZTk9jeXVaRWhGaFd1WDZ3YVF6V1VwWk1SMmc0ZHltd3lI?=
 =?utf-8?Q?tCxJdh3WCT7yX7FLpxrXHOUw/?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8e5f1d14-bb8e-42a8-3a39-08db7ed44e99
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 10:24:12.0846
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 46ittGHQMyxdl6LxrifO7dcnpD0cnRF1wAvHWbiS5MkNzFWWkLXGmy2c5bw+9PHvsxRYU33cVYcpBSpXrOKFaw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7929

On 07.07.2023 12:13, Roger Pau MonnÃ© wrote:
> On Thu, Jul 06, 2023 at 12:41:58PM +0200, Jan Beulich wrote:
>> On 05.07.2023 13:47, Roger Pau Monne wrote:
>>> --- a/xen/arch/x86/efi/efi-boot.h
>>> +++ b/xen/arch/x86/efi/efi-boot.h
>>> @@ -795,7 +795,30 @@ static bool __init efi_arch_use_config_file(EFI_SYSTEM_TABLE *SystemTable)
>>>  
>>>  static void __init efi_arch_flush_dcache_area(const void *vaddr, UINTN size) { }
>>>  
>>> -void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
>>> +/* Return a pointer to the character after the first occurrence of opt in cmd */
>>> +static const char __init *get_option(const char *cmd, const char *opt)
>>
>> Nit: __init and * want to change places.
> 
> Hm, yes.  I assume that placing it before the return type is not OK?
> (static const __init char ...)

That's still in the middle of the return type then. Technically gcc
accepts it being placed anywhere, but they reserve the right to change
meaning when not placed appropriately. Recall that you may alter both
attributes of a function (or variable) and attributes of types. Hence
to disambiguate both, proper placement may become necessary down the
road. And while it might be that

static __init const char *...

would also be okay-ish (albeit I'm not certain), that's still against
how we do things commonly (i.e. a not written down style aspect).

>>>[...]
> 
> LGTM, please adjust if you don't mind, otherwise I can send an
> adjusted version.

No need to send an update.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 10:33:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 10:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560381.876269 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHim7-0004KU-EQ; Fri, 07 Jul 2023 10:33:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560381.876269; Fri, 07 Jul 2023 10:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHim7-0004KL-8f; Fri, 07 Jul 2023 10:33:19 +0000
Received: by outflank-mailman (input) for mailman id 560381;
 Fri, 07 Jul 2023 10:33:18 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qHim6-0004KB-95
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 10:33:18 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHim5-0006uc-3E; Fri, 07 Jul 2023 10:33:17 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHim4-0000RD-TA; Fri, 07 Jul 2023 10:33:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=0YRqtWVdYci2R73J1tPjrpX4mWX9toYjmvA0fyyCETM=; b=i5paW+FTxXt3H/YpNW5/1gAdMY
	MivffIo+SPzF5zwGoOHAChAyMUaDdhye/fAgH8MOJ+7BrXRr4OW2/RsLQgLmP5saTAYjggTZxTgWY
	kgDWNBd1jiFIe0pKryK1Z2mRHOrzWkY2lnXQUUo1wqa14vXIKH08CShZxlbK6uV7vnJQ=;
Message-ID: <04c05db8-1e15-f2c1-ebc1-0563d442a808@xen.org>
Date: Fri, 7 Jul 2023 11:33:14 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 3/3] [FUTURE] xen/arm: enable vPCI for domUs
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Stewart Hildebrand <stewart.hildebrand@amd.com>,
 xen-devel@lists.xenproject.org, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Artem Mygaiev <artem_mygaiev@epam.com>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-4-stewart.hildebrand@amd.com>
 <e5a0ed8a-d85b-fb60-609a-f46884433c60@xen.org>
 <ZKfjoXqb6Kgav-vL@MacBook-Air-de-Roger.local>
From: Julien Grall <julien@xen.org>
In-Reply-To: <ZKfjoXqb6Kgav-vL@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 07/07/2023 11:06, Roger Pau MonnÃ© wrote:
> On Fri, Jul 07, 2023 at 10:00:51AM +0100, Julien Grall wrote:
>> On 07/07/2023 02:47, Stewart Hildebrand wrote:
>>> Note that CONFIG_HAS_VPCI_GUEST_SUPPORT is not currently used in the upstream
>>> code base. It will be used by the vPCI series [1]. This patch is intended to be
>>> merged as part of the vPCI series.
>>>
>>> v1->v2:
>>> * new patch
>>> ---
>>>    xen/arch/arm/Kconfig              | 1 +
>>>    xen/arch/arm/include/asm/domain.h | 2 +-
>>>    2 files changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>> index 4e0cc421ad48..75dfa2f5a82d 100644
>>> --- a/xen/arch/arm/Kconfig
>>> +++ b/xen/arch/arm/Kconfig
>>> @@ -195,6 +195,7 @@ config PCI_PASSTHROUGH
>>>    	depends on ARM_64
>>>    	select HAS_PCI
>>>    	select HAS_VPCI
>>> +	select HAS_VPCI_GUEST_SUPPORT
>>>    	default n
>>>    	help
>>>    	  This option enables PCI device passthrough
>>> diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
>>> index 1a13965a26b8..6e016b00bae1 100644
>>> --- a/xen/arch/arm/include/asm/domain.h
>>> +++ b/xen/arch/arm/include/asm/domain.h
>>> @@ -298,7 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
>>>    #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag)
>>> -#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); })
>>> +#define has_vpci(d)    ({ (void)(d); IS_ENABLED(CONFIG_HAS_VPCI); })
>>
>> As I mentioned in the previous patch, wouldn't this enable vPCI
>> unconditionally for all the domain? Shouldn't this be instead an optional
>> feature which would be selected by the toolstack?
> 
> I do think so, at least on x86 we signal whether vPCI should be
> enabled for a domain using xen_arch_domainconfig at domain creation.
> 
> Ideally we would like to do this on a per-device basis for domUs, so
> we should consider adding a new flag to xen_domctl_assign_device in
> order to signal whether the assigned device should use vPCI.

I am a bit confused with this paragraph. If the device is not using 
vPCI, how will it be exposed to the domain? Are you planning to support 
both vPCI and PV PCI passthrough for a same domain?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 10:37:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 10:37:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560385.876278 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHipl-0004x7-Rw; Fri, 07 Jul 2023 10:37:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560385.876278; Fri, 07 Jul 2023 10:37:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHipl-0004x0-Ok; Fri, 07 Jul 2023 10:37:05 +0000
Received: by outflank-mailman (input) for mailman id 560385;
 Fri, 07 Jul 2023 10:37:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jcIV=CZ=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qHipk-0004wu-Qz
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 10:37:04 +0000
Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com
 [2a00:1450:4864:20::12f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 364d2cf6-1cb2-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 12:37:03 +0200 (CEST)
Received: by mail-lf1-x12f.google.com with SMTP id
 2adb3069b0e04-4fbb281eec6so2597655e87.1
 for <xen-devel@lists.xenproject.org>; Fri, 07 Jul 2023 03:37:03 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 w7-20020ac24427000000b004f76a88dbcbsm629049lfl.176.2023.07.07.03.37.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 07 Jul 2023 03:37:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 364d2cf6-1cb2-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688726223; x=1691318223;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=Nk7NqYANnWZ6QHLF28Mg2hNcleSmLnmLQ6HMqzn0v+I=;
        b=McwZAhiwKuuLs8b9jO5EgTKuawLa1/E3Gv1Llckb9OVkRWbPDSIGYycfeI8ubdzBfC
         5AIMtrAgY2tuU+WuxVyCGiovabyOsel0PfLlpzdc6T4q1z7GNmh+97+fdNMwU7J1KrzN
         PY48edEx5wnjc6JKJXw+JIFFDfVJ71lH/pEJQ8k5N/Xyu1d8aXGT3yfQyVpSqAXNu6He
         Q604rvtYOho5J86G6IZwb0LcxJVwR+ppMSqYcLFMepPI7pX5tgoLROOTXCGasguPTZwi
         XvW9UdXi+r5xta42V18vhtCgeChG3RNH81IhQGxKnPHbghuiZ6+vaylFRchq0Ht6cCdj
         wTEw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688726223; x=1691318223;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=Nk7NqYANnWZ6QHLF28Mg2hNcleSmLnmLQ6HMqzn0v+I=;
        b=VkcocEK90Ohp+AG6pgWm3cUo5C+m0nnWdlDJZGgLEdmBfj1oM6rA+sqIQ7BsbyOehY
         kweJ9GkBX3bwyuH9uCPDb6rEZKxW0RAn2sTIvzk8e5dwoHOPfMUPicWmwpqls1Xv/4fa
         9OxF+TT9iigWvctm4D4/8ZG/SVwtTEEjGrinYj7qpxFdDVLXeVwhwcfhzVJUcN+6gPVB
         DSQJNAbatar3GlKBYHQ7/3C0H+ThhPdWk2U59pzUbhoCO4qxpAz/zoDvQxUPDe8Qc226
         EjlSTWGvOLlfO3LzY2pm+CpbcFjQEhP/suRDpJGftPj7vFVUfIcGjcL0dXE/S2DnlZ5O
         qFug==
X-Gm-Message-State: ABy/qLZaL78S9RQpGeK3tgiMY/rTnS9vNZ2wh9rf6Nk9STVbpnRupPCA
	0sGZ4N/MY6TuuHt+t6z54rI=
X-Google-Smtp-Source: APBJJlHfxxcrJICO4CW+7izLREQUYmLLrsET/+d22IvZ1srYsQtEKe0vc5L1ecRnWDAvkPbfqopihA==
X-Received: by 2002:ac2:4d9a:0:b0:4f8:6e1d:cf98 with SMTP id g26-20020ac24d9a000000b004f86e1dcf98mr3242092lfe.66.1688726222770;
        Fri, 07 Jul 2023 03:37:02 -0700 (PDT)
Message-ID: <1edb0c61a8ef64bb47809049252e9ad7b19f4bbe.camel@gmail.com>
Subject: Re: [PATCH v2 4/6] xen/riscv: introduce identity mapping
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall
 <julien@xen.org>,  Bob Eshleman <bobbyeshleman@gmail.com>, Alistair Francis
 <alistair.francis@wdc.com>, Connor Davis <connojdavis@gmail.com>,
 xen-devel@lists.xenproject.org
Date: Fri, 07 Jul 2023 13:37:01 +0300
In-Reply-To: <67df28ad-060e-07d5-acf2-02c3cd5f0b96@suse.com>
References: <cover.1687178053.git.oleksii.kurochko@gmail.com>
	 <21d8ce65f718bc10c2213688f79cf5f978bcaf16.1687178053.git.oleksii.kurochko@gmail.com>
	 <67df28ad-060e-07d5-acf2-02c3cd5f0b96@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.3 (3.48.3-1.fc38) 
MIME-Version: 1.0

On Thu, 2023-07-06 at 13:35 +0200, Jan Beulich wrote:
> On 19.06.2023 15:34, Oleksii Kurochko wrote:
> > Since it is not easy to keep track where the identity map was
> > mapped,
> > so we will look for the top-level entry exclusive to the identity
> > map and remove it.
>=20
> I think you mean "top-most" or some such, as it's not necessarily the
> top-level entry you zap.
Yeah, 'top-most' is more appropriate in this context.
>=20
> > --- a/xen/arch/riscv/include/asm/config.h
> > +++ b/xen/arch/riscv/include/asm/config.h
> > @@ -1,3 +1,5 @@
> > +/* SPDX-License-Identifier: GPL-2.0-only */
> > +
> > =C2=A0#ifndef __RISCV_CONFIG_H__
> > =C2=A0#define __RISCV_CONFIG_H__
> > =C2=A0
>=20
> Unrelated change?
It  should be part of [PATCH v2 5/6] xen/riscv: introduce identity
mapping.

>=20
> > --- a/xen/arch/riscv/mm.c
> > +++ b/xen/arch/riscv/mm.c
> > @@ -25,6 +25,12 @@ unsigned long __ro_after_init phys_offset;
> > =C2=A0#define LOAD_TO_LINK(addr) ((unsigned long)(addr) - phys_offset)
> > =C2=A0#define LINK_TO_LOAD(addr) ((unsigned long)(addr) + phys_offset)
> > =C2=A0
> > +/*
> > + * Should be removed as soon as enough headers will be merged for
> > inclusion of
> > + * <xen/lib.h>.
> > + */
> > +#define ARRAY_SIZE(arr)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(sizeof(arr) /
> > sizeof((arr)[0]))
> > +
> > =C2=A0/*
> > =C2=A0 * It is expected that Xen won't be more then 2 MB.
> > =C2=A0 * The check in xen.lds.S guarantees that.
> > @@ -35,8 +41,10 @@ unsigned long __ro_after_init phys_offset;
> > =C2=A0 *
> > =C2=A0 * It might be needed one more page table in case when Xen load
> > address
> > =C2=A0 * isn't 2 MB aligned.
> > + *
> > + * (CONFIG_PAGING_LEVELS - 1) page tables are needed for identity
> > mapping.
> > =C2=A0 */
> > -#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) + 1)
> > +#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) * 2 + 1)
>=20
> How come the extra page (see the comment sentence in context) isn't
> needed for the identity-mapping case?
It is needed to allocate no more than two 'nonroot' page tables (L0 and
L1 in case of Sv39 ) as page 'root' table ( L2 in case of Sv39 ) is
always re-used.

The same ( only 'nonroot' page tables might be needed to allocate )
works for any MMU mode.

>=20
> > @@ -255,25 +262,30 @@ void __init noreturn noinline enable_mmu()
> > =C2=A0=C2=A0=C2=A0=C2=A0 csr_write(CSR_SATP,
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 PFN_DOWN((unsigned long)stage1_pgtbl_root) |
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 RV_STAGE1_MODE << SATP_MODE_SHIFT);
> > +}
> > =C2=A0
> > -=C2=A0=C2=A0=C2=A0 asm volatile ( ".p2align 2" );
> > - mmu_is_enabled:
> > -=C2=A0=C2=A0=C2=A0 /*
> > -=C2=A0=C2=A0=C2=A0=C2=A0 * Stack should be re-inited as:
> > -=C2=A0=C2=A0=C2=A0=C2=A0 * 1. Right now an address of the stack is rel=
ative to load
> > time
> > -=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0=C2=A0 addresses what will cause=
 an issue in case of load start
> > address
> > -=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0=C2=A0 isn't equal to linker sta=
rt address.
> > -=C2=A0=C2=A0=C2=A0=C2=A0 * 2. Addresses in stack are all load time rel=
ative which can
> > be an
> > -=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0=C2=A0 issue in case when load s=
tart address isn't equal to
> > linker
> > -=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0=C2=A0 start address.
> > -=C2=A0=C2=A0=C2=A0=C2=A0 *
> > -=C2=A0=C2=A0=C2=A0=C2=A0 * We can't return to the caller because the s=
tack was reseted
> > -=C2=A0=C2=A0=C2=A0=C2=A0 * and it may have stash some variable on the =
stack.
> > -=C2=A0=C2=A0=C2=A0=C2=A0 * Jump to a brand new function as the stack w=
as reseted
> > -=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +void __init remove_identity_mapping(void)
> > +{
> > +=C2=A0=C2=A0=C2=A0 unsigned int i;
> > +=C2=A0=C2=A0=C2=A0 pte_t *pgtbl;
> > +=C2=A0=C2=A0=C2=A0 unsigned int index, xen_index;
> > +=C2=A0=C2=A0=C2=A0 unsigned long load_addr =3D LINK_TO_LOAD(_start);
> > =C2=A0
> > -=C2=A0=C2=A0=C2=A0 switch_stack_and_jump((unsigned long)cpu0_boot_stac=
k +
> > STACK_SIZE,
> > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 cont_after_mmu_is_enabled);
> > +=C2=A0=C2=A0=C2=A0 for ( pgtbl =3D stage1_pgtbl_root, i =3D 0;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 i <=3D (CONFIG_=
PAGING_LEVELS - 1);
>=20
> i < CONFIG_PAGING_LEVELS ? But maybe it would be easier for i to
> start
> at CONFIG_PAGING_LEVELS and be decremented, simplifying ...
>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 i++ )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 index =3D pt_index(CONFIG_P=
AGING_LEVELS - 1 - i, load_addr);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 xen_index =3D pt_index(CONF=
IG_PAGING_LEVELS - 1 - i,
> > XEN_VIRT_START);
>=20
> ... these two expressions?
It makes sense. I'll update this part of the code.

>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( index !=3D xen_index )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pgt=
bl[index].pte =3D 0;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bre=
ak;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
>=20
> Is this enough? When load and link address are pretty close (but not
> overlapping), can't they share a leaf table, in which case you need
> to clear more than just a single entry? The present overlap check
> looks to be 4k-granular, not 2M (in which case this couldn't happen;
> IOW adjusting the overlap check may also be a way out).
At the start of setup_initial_pagetables() there is a code which checks
that load and link address don't overlap:

    if ( (linker_start !=3D load_start) &&
         (linker_start <=3D load_end) && (load_start <=3D linker_end) )
    {
        early_printk("(XEN) linker and load address ranges overlap\n");
        die();
    }

So the closest difference between load and link address can be 4kb.
Otherwise load and link address ranges are equal ( as we can't map less
then 4kb).

Let's take concrete examples:
  Load address range is   0x8020_0000 - 0x8020_0FFF
  Linker address range is 0x8020_1000 - 0x8020_1FFF
  MMU mode: Sv39 ( so we have 3 page tables )

  So we have:
    * L2 index =3D 2, L1 index =3D 1, L0 index =3D 0 for load address
    * L2 index =3D 2, L1 index =3D 1, L0 index =3D 1 for linker address
  Thereby we have two different L0 tables for load and linker address=20
ranges.
  And it looks like it is pretty safe to remove only one L0 index that
was used for identity mapping.

Is it possible that I missed something?

~ Oleksii


 =20




From xen-devel-bounces@lists.xenproject.org Fri Jul 07 10:42:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 10:42:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560389.876288 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHivC-0006O1-GF; Fri, 07 Jul 2023 10:42:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560389.876288; Fri, 07 Jul 2023 10:42:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHivC-0006Nu-CX; Fri, 07 Jul 2023 10:42:42 +0000
Received: by outflank-mailman (input) for mailman id 560389;
 Fri, 07 Jul 2023 10:42:41 +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
 <SRS0=GM+b=CZ=citrix.com=prvs=545203e5e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qHivB-0006No-EF
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 10:42:41 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fd3b7742-1cb2-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 12:42:38 +0200 (CEST)
Received: from mail-dm6nam10lp2104.outbound.protection.outlook.com (HELO
 NAM10-DM6-obe.outbound.protection.outlook.com) ([104.47.58.104])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 07 Jul 2023 06:42:36 -0400
Received: from MW4PR03MB6428.namprd03.prod.outlook.com (2603:10b6:303:123::8)
 by SA0PR03MB5564.namprd03.prod.outlook.com (2603:10b6:806:b6::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 10:42:34 +0000
Received: from MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd]) by MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd%7]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 10:42:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fd3b7742-1cb2-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688726558;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=6lM6MWjgbJYRIedmI3NWFMD+CBeKc2Qq5H1BZDBbuaQ=;
  b=WPSdZoteGR11RxkGR0jy0musHwsBRfHB88GKADp8cTFeyILyIuyLMAVu
   lTp8To+SZM58RKqzomqQmu/WBTjfJPbBgiVW7R04LcE/3AeNpyQ4qd9ZN
   zESmQ+/tmniwATrALsvI93An4BcAtgjLJuemKaDXi6pDUCmgyL4C6IOKc
   I=;
X-IronPort-RemoteIP: 104.47.58.104
X-IronPort-MID: 115483587
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:DPka6KoTq/sKviCDI0P6c323/19eBmI+ZBIvgKrLsJaIsI4StFCzt
 garIBnTbP+CY2HzfNgkPNzkpklXuZ/SnddrSlM++SBgHngTpZuZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weBzyZNVfrzGInqR5fGatgMdgKFb
 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo
 OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay
 RAXAD1UMFeSpaH1+r+2evtvvMYxPNnCPpxK7xmMzRmBZRonabbqZvySoPN9gnI3jM0IGuvCb
 c0EbzYpdA7HfxBEJlYQDtQ5gfusgX78NTZfrTp5p4JuuzSVkFM3jeiraYKJEjCJbZw9ckKwv
 GXJ8n6/GhgHHNee1SCE4jSngeqncSbTAdtPSO3jq6416LGV7kAaKkVRFkOgm6iom0Tka90Ye
 gstxQN7+MDe82TuFLERRSaQonSJoxodUNp4CPAh5UeGza+8yxmdLngJSHhGctNOnN87Q3km2
 0GEm/vtBCdzq/uFRHSF7LCWoDiufy8PIgc/iTQsSAIE55zvpd81hxeWFtJ7Svft0pvyBC36x
 C2MoG4mnbIPgMUX1qK9u1fanzaroZuPRQkwjunKYl+YAspCTNbNT+SVBZLztJ6s8K7xooG9g
 UU5
IronPort-HdrOrdr: A9a23:kFG7U6qSilSytjsGCgWBI5EaV5oleYIsimQD101hICG9E/b1qy
 nKpp8mPHDP5wr5NEtPpTnjAsm9qALnlKKdiLN5Vd3OYOCMghrKEGgN1/qG/xTQXwH46+5Bxe
 NBXsFFebnN5IFB/KTH3DU=
X-Talos-CUID: 9a23:RZ7clW/oYS0ALXB7kPiVv0NNRIc0UD6e9nrdE127M2R7WK28S0DFrQ==
X-Talos-MUID: =?us-ascii?q?9a23=3AH+f3TQwmL71ym/NZUv1Rr+OFvu2aqIinKhhK0o0?=
 =?us-ascii?q?dgZiVJCYqCzja3XOOfaZyfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,187,1684814400"; 
   d="scan'208";a="115483587"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=T40JQgzmIeqs68Gww5ZZnKxP9HZEgIUSRtj6/LC1I2b1X4px7TSOGbGFNykrbB2BmYdYCK+XxYFfeKRpg2bcJpJQoRyjjWH5SOJEw/5SBeTH+YaGb2PvA9E3SlZUrGgn32EsJNXgkIqN/dzSqxSBeeOJKx+Toni/iAW0wBquLxzUt/lF7h6UGudvITMzIpxXkGcTTR3EeEl0LxzpHDctHr/5ir/eJVizAKndCrm8lE8t8TOp2UyY5ekZqUyDMj6zi1xMV7Gzo9GmHKkk807udXrehfj7lvyM2t0azlblxeFvINf6L2SF6tHHjzcDCCAJ1dPVWXFwc5PHPj39mWNvjg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=IZJKvhsg11+DsODq7tJU0EgDZ72sQ8MusxpZkfbhiK0=;
 b=GTnsmymz+A135UXF2MrGy4b/GaaJO4hgo+smrHud/l691n0mha5pIyEoURClQVqt30KYw3ja0/i47+pGfOgShN3pani3bxhg9sWx30rYcPuCaoedUobHmc4c4qsh99go47zicelpaLFsJn4k7QtLgcSXTlcSzTRGlfMjxzmEtHc+ahI1dEFOBF7mW5QsdfOmJoeZsDLc70piAXEiFm4ZOYF8CuhU//U6wG3B4bSuDSHUVWlqyb1513vSd1jmkhLlbTZf3O+hpkR4ov9l2lKHllGwhWEJ9GkxyiPE7uunNgYGE6eus3zNRdXaJ2GepFhJ81Phka7irnudnn9+Q3NoLg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IZJKvhsg11+DsODq7tJU0EgDZ72sQ8MusxpZkfbhiK0=;
 b=wrdS/GJk4KYymB1Vb7WaSvjMhb75M+J9Dt/XsTyR7yzZhFKK+iQ4qxdp69bZ/VxAIfqyPsIA0aV2UT4gQK98qorn5m6APO3CDKwWQmSSZ3jqp/emPD5RnnYmPM60zjQQlkU/33QYfOBeYDCbz0YijaCyxFo6O8NZikTwiiNqetM=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 7 Jul 2023 12:42:18 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 1/3] multiboot2: parse vga= option when setting GOP
 mode
Message-ID: <ZKfsChflOUtYQCpk@MacBook-Air-de-Roger.local>
References: <20230705114741.11449-1-roger.pau@citrix.com>
 <20230705114741.11449-2-roger.pau@citrix.com>
 <47cc5f67-973a-2095-932f-6ebea2d3bd9e@suse.com>
 <ZKflLxsh1AKyvPOT@MacBook-Air-de-Roger.local>
 <3bfd9a21-e4e7-2d9b-8a40-8b77c80e4fb7@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <3bfd9a21-e4e7-2d9b-8a40-8b77c80e4fb7@suse.com>
X-ClientProxiedBy: LO2P265CA0089.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:8::29) To MW4PR03MB6428.namprd03.prod.outlook.com
 (2603:10b6:303:123::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MW4PR03MB6428:EE_|SA0PR03MB5564:EE_
X-MS-Office365-Filtering-Correlation-Id: 5e2b3e9d-07b0-4784-f81a-08db7ed6df59
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	qeD+Gjw/ElIQcFzPiVtjZmUAEczyUhok+fSK57GIvVmFrgYj3X/0V6bGxVGDGCEsz21pLnyw3cm/0Q6LEn+j5MWLr87e0hJRXAOz4eFezX5N/3pPMre651TOedDsZiB+UR695nYtEDwK9RNTZpQJUeoYGqMGoeAv/z9e8pk+f5dIyt6eN55AU6MnYK6EXMFuWVfWQPXO1+jZ0m7K4/ZA4faPwBfsALDPldLC0cvBb0qcGEQhdw6INteEGDqjGGlnAj1ndQkvR8ZXUt87DYBPKBLwdW6Y9Lw8k5FHNGgkyTV5VNB9LjWYoQRGRMdeiiUywSk8xonfYTdQgDidrK/xvDJ4Wnc7Rd60EKHlLAu0vYRvHfJL9UFstU7fxPOp0JDU1niyP5+vSb9GamrTyGGjOeKpX4TAVfk3sWgVYY96l1oJOFGvDxe9sEbk4vaag1ezKkWzWCL60OWzEfTgT0ZdAG7FV5+uBgqYPuEQijCxOtXHz/uEhoRifM66wqlwOqo+O0jP9S5o17oWARAfW9V74j//kn0/wAR9IMWGSo9QbsZCDs6hgyXgiIQH9/QGJXm9
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR03MB6428.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(346002)(366004)(136003)(376002)(451199021)(478600001)(26005)(186003)(6512007)(82960400001)(6506007)(9686003)(53546011)(86362001)(6666004)(316002)(66476007)(66556008)(6486002)(54906003)(38100700002)(4326008)(6916009)(66946007)(5660300002)(8676002)(8936002)(41300700001)(2906002)(85182001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NXBpaDZMRXRyNHpocm5pMWVoWmZsVnoxcDU3MnM5TUJqNEkwMEFhdHNwNUtF?=
 =?utf-8?B?T05aNTVYSkZKSWRFUGFBMEUwbXhJMEh4Q3JaN0Rxb2RwUU5HRUI2cytmamZQ?=
 =?utf-8?B?aytmSDU4dUJyUytDVzhhdXFYWDA1VjZtKytsdFFndU1UN1ZlV21weTJGR0tS?=
 =?utf-8?B?NWRkbnFjQ1J3RHNnZWo0VFdYakZHbG5RczY5Q3RMYzVuNlRlbHA1bUd1TGdC?=
 =?utf-8?B?NGZjdTFkdkNRMlR5TjdiZVpabG1maGludkowRm1pdkk1NzBaTkNsMTFPakYy?=
 =?utf-8?B?ckFZLzlkV0FEa3dDeEsxbllSRGRKbnExbWd6YTNuNFFsUDlpOHNxeDVVeTFP?=
 =?utf-8?B?RTJ0Qjl6NnJtOWRmTVhKUWNn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 =?utf-8?B?U0lmQjNjUGhzMVo1Wkdkd1RqQlZncHhyTm5HT3ZDRVluaEFQNWZxUmx5RzFq?=
 =?utf-8?B?UUE9PQ==?=
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	Ql53PO+2/YxmgrgG6kKKP2EVi9+TpdkRCaMRuzR5wunA3zlNSznDPD6mDSxkNk0/OBePdj4tXvBaNkd3hsKq2DTrDbFpIEZKZlpVgfj6fe3p4ZK9ABTN2mZasXpZWPOr682GIoZbROvPfqt4luWMuMIadR2T8ImIaLIhjiHp3sJcu/pcNaCJJxxyz7SHVbSaTKlEfgQVBw+OuCdVtXh8LgSfFxwxt3le6ihDEbd68GtAA7szoGEFN4S1C88RlM+yAhEj7HZqRXmoaF5+X3N1F7umGobynIzsbaJIpFhY+qjX0+rbzuVP5zC9n+2bMPx0LUj2ybayJD4lqhsPT9WKQbebTInY1D+SlAClRswkf33JaeDDLX5zyru1H3H6vNtlzmZiqVuZfUC5vXtBwOHSxjLXL93UQ6ccp6NJ2J+l8OWFtOpHRGrE3d05rcaRXX12yIgttylf5pQilDatmjVXXHMGYTmZR3MH1/aKL/E+cAhRz9e5QGLTruwtfjnUKcePVCnsFiU0cvCeTyF7x1NSJa7RgsvE3jPOpoAG+cHLIXye3xVeAnplQ8Tq4APr0VnyA6NwpnY5UV3nbaIyb1qWpCNZFrEWlo20cBKe5s5eOSH2LNx8vF/HwRL6tyUFWX58YqAODtUgcBfZI9qA9FAH6qmbAog/h4co0SakZgfmELEg5/TUkSLQhFikrNuMLrRACSK31+1xB/t6CCSYO8qJFaSnzmFa4YEV/zju9AyYuC1ChlriS2uE+y532WcBL344gk+/IeMVwIkquB/NowrJ9w6twgoWSJcINTDJA+maY00NdkrQvxRFF/Bfn7+i+YD/
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5e2b3e9d-07b0-4784-f81a-08db7ed6df59
X-MS-Exchange-CrossTenant-AuthSource: MW4PR03MB6428.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 10:42:34.1171
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: cZL6GbVsqzUFOhueQkFYOpag6lRQaTth8RepUPMpj3kxXGv4yquGzu4Ojb1RgmpWERXff5gBKflK1Fdu4tpr7A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR03MB5564

On Fri, Jul 07, 2023 at 12:24:10PM +0200, Jan Beulich wrote:
> On 07.07.2023 12:13, Roger Pau MonnÃ© wrote:
> > On Thu, Jul 06, 2023 at 12:41:58PM +0200, Jan Beulich wrote:
> >> On 05.07.2023 13:47, Roger Pau Monne wrote:
> >>> --- a/xen/arch/x86/efi/efi-boot.h
> >>> +++ b/xen/arch/x86/efi/efi-boot.h
> >>> @@ -795,7 +795,30 @@ static bool __init efi_arch_use_config_file(EFI_SYSTEM_TABLE *SystemTable)
> >>>  
> >>>  static void __init efi_arch_flush_dcache_area(const void *vaddr, UINTN size) { }
> >>>  
> >>> -void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
> >>> +/* Return a pointer to the character after the first occurrence of opt in cmd */
> >>> +static const char __init *get_option(const char *cmd, const char *opt)
> >>
> >> Nit: __init and * want to change places.
> > 
> > Hm, yes.  I assume that placing it before the return type is not OK?
> > (static const __init char ...)
> 
> That's still in the middle of the return type then. Technically gcc
> accepts it being placed anywhere, but they reserve the right to change
> meaning when not placed appropriately. Recall that you may alter both
> attributes of a function (or variable) and attributes of types. Hence
> to disambiguate both, proper placement may become necessary down the
> road. And while it might be that
> 
> static __init const char *...
> 
> would also be okay-ish (albeit I'm not certain), that's still against
> how we do things commonly (i.e. a not written down style aspect).

Thanks for the explanation.

Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 10:47:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 10:47:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560396.876298 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHizn-00073Y-7n; Fri, 07 Jul 2023 10:47:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560396.876298; Fri, 07 Jul 2023 10:47:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHizn-00073R-4o; Fri, 07 Jul 2023 10:47:27 +0000
Received: by outflank-mailman (input) for mailman id 560396;
 Fri, 07 Jul 2023 10:47:26 +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
 <SRS0=GM+b=CZ=citrix.com=prvs=545203e5e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qHizm-00073L-5U
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 10:47:26 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a5b7bd35-1cb3-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 12:47:21 +0200 (CEST)
Received: from mail-dm6nam11lp2171.outbound.protection.outlook.com (HELO
 NAM11-DM6-obe.outbound.protection.outlook.com) ([104.47.57.171])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 07 Jul 2023 06:47:14 -0400
Received: from MW4PR03MB6428.namprd03.prod.outlook.com (2603:10b6:303:123::8)
 by BY5PR03MB5080.namprd03.prod.outlook.com (2603:10b6:a03:1ea::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.25; Fri, 7 Jul
 2023 10:47:13 +0000
Received: from MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd]) by MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd%7]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 10:47:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a5b7bd35-1cb3-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688726841;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=lgxhdogFgqufatXKVa1fXQGBLHfCZHklwMj7RCc+dRg=;
  b=hsVTGz1T+JjBbCcqwuREDvZeFpkgANthOvqPTROIqth+ZVjgcniVtadP
   DHczGxND4nfgzP31AuyE0dwkApbCk9OjSAfTNFZvsI2HncQViHM0vTb0a
   1HmCdUdhQ/B8p/XS85t+xJnAv6s8am636EFkAVJzAEEFbxzDiSwUTYTML
   Y=;
X-IronPort-RemoteIP: 104.47.57.171
X-IronPort-MID: 114770152
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:zQ/26q9dohbTtHo0xR/8DrUDMH+TJUtcMsCJ2f8bNWPcYEJGY0x3y
 2cdXm3Ua/uPZGCkLowlbN618h9XvZPQyYdjHgtlrSA8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s
 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk
 d7pqojUNUTNNwRcawr40Ird7ks21BjOkGlA5AdmOqgU5Aa2e0Q9V/rzG4ngdxMUfaEMdgKKb
 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk
 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklpx
 No2EAtKVimiuMPtnrTkRcZ1gfgseZyD0IM34hmMzBn/JNN/GNXvZvuP4tVVmjAtmspJAPDSI
 dIDbiZiZwjBZBsJPUoLDJU5n6GjgXyXnz9w8QrJ4/ZopTWMilUuidABM/KMEjCObd9SkUuC4
 HrP4kzyAw0ANczZwj2Amp6prraWwXykANtPTtVU8NZHvwzNmEdDASQmdhzmk9r6lxHhdstmf
 hl8Fi0G6PJaGFaQZtvgWxy1plaUsxhaXMBfe8Uh9AySw7DIpQaYAmQJRCRIbtAOvco6Azct0
 zehj97vQDBirrCRYXac7auP6yO/PzAPKm0PbjNCShEKi/H4u506hB/LStdlEYa2g8fzFDW2x
 CqFxAA0iq8Pl8cN2+O+9ErenjO3jpHTS0g+4QC/dlyi6gR1dYu0fbuC4FLQ7etDBIuBR1zHt
 38B8+CZ6O0NFpiLmDa6XPQWHLqp6vCGNxXRmVdqWZIm8lyF8mS/cIVn5SBxLUZkLO4JYTbsJ
 kTUvGtsCIR7OXKraep7Zty3AsFzlKz4T426D7bTc8ZEZYV3eEmf5iZyaEWM3mfr1k8xjaU4P
 pTdesGpZZoHNZlaIPONb791+dcWKuoWnAs/mbiTI8yb7Iej
IronPort-HdrOrdr: A9a23:N/sUnKEVvXZbM4dRpLqE5seALOsnbusQ8zAXPiFKOHlomq7xra
 qTdZEguCMc5wx8ZJhNo7+90cq7MBHhHPxOgbX57Y3SOzUO0VHAROpfBO3ZrQEIcBeOldK1u5
 0AT0EEMqyVMWRH
X-Talos-CUID: 9a23:/e2/qm/UD5nkN1rAnm+Vv2klPO4dSTrl9VbvAhTmDzlmZ6SSdVDFrQ==
X-Talos-MUID: 9a23:PghtHgidYWKQJ94hVm0bmcMpGfg5vfqFWEk0obZB5vundjEvZBqEtWHi
X-IronPort-AV: E=Sophos;i="6.01,187,1684814400"; 
   d="scan'208";a="114770152"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Vsp540F7bPzO1mq+4jcPkbjodLsgbBmOx7jsdhy7Jxi8oaYQJCB5xN+1xcV0IGZCgpTntVTgf0locAxmcRb1vr9ri6JR9g6SNYOr4uqrqWsXPv15nNIWWVJ23L21KVfRfLZsGwKhaUq7gzvQeQlP/Ehbhhk0bgZ0Os1J+LtUt8fRzGX+v8j4s296giWmv6t6iH0rz1cBRhxlEx61mUkcMMESPujYxxe+Wq20ug2mAy9dfLs+ULXD+aZytnA/SVKZcOFpRP+abwYClxSkp4kDs6uHETX14oImw5P2laTpv3Z0221hiIA6JiAwRBBX8yfhql7HWAi3Eum5QeOtSVBUxQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=YS4YKMMBa4P7oygcmdaFuVE2nUEbBul3XPI341IHlmg=;
 b=PPGF9bh/3B7VcJNXRvFEjYgBmZuyI0z1hXVxbM9f9WwWxFGukS0PX56PZbpA4s/MAGZSV/r+N4pLKzzylnghSnRRCJmYscbZ16YS54fi8rPt1hREL2AsCdkUQ92XpaZLxw1ZGayGS9tsg9KJrgbyk1crq1kNa1p3dlZjHHWJhfJnOIC6wBal+SiHiJvKlbj8Sd/8QrDQGsTptTP4OFiClasc9QtAzHzavaiuusskL0WNxYKz0T0AbMbSDYtz11i/h+tpez4ZNX7ho10su7q9b6nAKN4XcEdTZHU1vXPsNlweYRiTUrT2dcVX7ic75+2RRBZ8x3WjjATuPtYQ2w71Cw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=YS4YKMMBa4P7oygcmdaFuVE2nUEbBul3XPI341IHlmg=;
 b=X9z3nNqcwxFpqu3BQhcs7D/V9jJEuiPK1M3ly9cri87d4ZQ+d4xwckz8qMp2Fwklebu8bYacmCk1vU+FQIwbJsjv6c/yk7lk058iZbBn3KDESLFW5xsWvWMBdRwlspxim+YNjxWQpgqPbJhLkGvmMDepzvCjJKEkRRTckf6JO4U=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 7 Jul 2023 12:47:06 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Julien Grall <julien@xen.org>
Cc: Stewart Hildebrand <stewart.hildebrand@amd.com>,
	xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Artem Mygaiev <artem_mygaiev@epam.com>
Subject: Re: [PATCH v2 3/3] [FUTURE] xen/arm: enable vPCI for domUs
Message-ID: <ZKftKtkjgFLWaW_x@MacBook-Air-de-Roger.local>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-4-stewart.hildebrand@amd.com>
 <e5a0ed8a-d85b-fb60-609a-f46884433c60@xen.org>
 <ZKfjoXqb6Kgav-vL@MacBook-Air-de-Roger.local>
 <04c05db8-1e15-f2c1-ebc1-0563d442a808@xen.org>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <04c05db8-1e15-f2c1-ebc1-0563d442a808@xen.org>
X-ClientProxiedBy: LO6P123CA0059.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:310::17) To MW4PR03MB6428.namprd03.prod.outlook.com
 (2603:10b6:303:123::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MW4PR03MB6428:EE_|BY5PR03MB5080:EE_
X-MS-Office365-Filtering-Correlation-Id: 89afdb08-5152-4f08-80ce-08db7ed78554
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	QpYk8BbrF79AR9PPG8mqBCVSQt0u6uwgzAjVSD4oaz2DaUQQs016TQmcoWUaj14fn5KLaMJx9VxMsR2abRyefBbD/4chjyUYpUR1ZyDvLSXeXgZzlPF3WwlBL2yrgZfKY/PhBIvkkBOPU2I4RHCYmE1lfF/j1dg90pxdqL+3q1d9G1cBuhkgaKjZbzuKHczEzaXZuVhosiv24cyQ4noKXfDwn8wrF7b0FVenrn7zPEQrpGChH8lcNHvZN1dOcDS0rYdHiNAHU3Nrvb6z3/s5IfVCB9Y9ArI98aX8VKL0qcBFxGBC9VY83R+avwXJidiy6ZY/ZKs1/znBbAu3lCdC+1jOIaOqywgQB9998d7qLWtJCOMy5uIVQz1LWTwxbblGXHL0XGjhcRhP2C7/+3PjGGi/9QO6rkmEA8BE+mC10Rnmf+uG3oPHtbE+Ecm0HYk/ldFv9adYKy2v/dqpv1HSi2K39HS2bYX1/BLcHsLLTHEy/jiUcXqdLZRA42x0LRRMIBAZQDB6OwudddMa5INFNtUhKhTODSgpI5XbG6TqulnX1moYmTO1eS2Z/zWVMHM6
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR03MB6428.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(366004)(346002)(39860400002)(376002)(451199021)(66946007)(66556008)(6916009)(66476007)(4326008)(38100700002)(186003)(86362001)(26005)(6506007)(53546011)(6666004)(82960400001)(83380400001)(9686003)(85182001)(478600001)(6512007)(6486002)(54906003)(41300700001)(5660300002)(8936002)(8676002)(66899021)(2906002)(316002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SUdPSldSbUNpM01OYmFHbDNTZDQ2eE13RTdPRFZaS0liamxibk5xM2pnMTVX?=
 =?utf-8?B?Y0g3K1dxamxDTjloNXBPRjhSbG5hVFZXNGNGNDdNdzMzUWFjQlJLUzUvMU92?=
 =?utf-8?B?QVpRalFwT2lDTWdOSWtxbklaN0lhSUdVajFRM1RXWURkcmc4cFBFS0xMeFV3?=
 =?utf-8?B?KzhHam1tc0Zva1kreWpTREpWMS9xanl1NHRkK1piaVhhTTF6UmViOXFNR21t?=
 =?utf-8?B?MXNoRlo0eDlLSUVNZFRVcEo3WExQNDgrcFc5bXJQZ0hsSFhmTGFRakl0dGVh?=
 =?utf-8?B?RTVnU1c2a1RXWDZSOXdDR1hFMDVTU29zTzZOR2hMdlQwK2VIbkxuK082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8Lba3l+C3T/PjyNVFyaUFgwvyOgTfQ9heTDzw4O4ID211T7cwotsgQ==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 89afdb08-5152-4f08-80ce-08db7ed78554
X-MS-Exchange-CrossTenant-AuthSource: MW4PR03MB6428.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 10:47:12.4744
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: zdX4FS+48PNcba82vUFLiULISibZJVXk3Khz60jS3alOuf2crfOw1q5lgnIBt4h22/eQWvbNWnNOpCzbuT1/gg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR03MB5080

On Fri, Jul 07, 2023 at 11:33:14AM +0100, Julien Grall wrote:
> Hi,
> 
> On 07/07/2023 11:06, Roger Pau MonnÃ© wrote:
> > On Fri, Jul 07, 2023 at 10:00:51AM +0100, Julien Grall wrote:
> > > On 07/07/2023 02:47, Stewart Hildebrand wrote:
> > > > Note that CONFIG_HAS_VPCI_GUEST_SUPPORT is not currently used in the upstream
> > > > code base. It will be used by the vPCI series [1]. This patch is intended to be
> > > > merged as part of the vPCI series.
> > > > 
> > > > v1->v2:
> > > > * new patch
> > > > ---
> > > >    xen/arch/arm/Kconfig              | 1 +
> > > >    xen/arch/arm/include/asm/domain.h | 2 +-
> > > >    2 files changed, 2 insertions(+), 1 deletion(-)
> > > > 
> > > > diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> > > > index 4e0cc421ad48..75dfa2f5a82d 100644
> > > > --- a/xen/arch/arm/Kconfig
> > > > +++ b/xen/arch/arm/Kconfig
> > > > @@ -195,6 +195,7 @@ config PCI_PASSTHROUGH
> > > >    	depends on ARM_64
> > > >    	select HAS_PCI
> > > >    	select HAS_VPCI
> > > > +	select HAS_VPCI_GUEST_SUPPORT
> > > >    	default n
> > > >    	help
> > > >    	  This option enables PCI device passthrough
> > > > diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
> > > > index 1a13965a26b8..6e016b00bae1 100644
> > > > --- a/xen/arch/arm/include/asm/domain.h
> > > > +++ b/xen/arch/arm/include/asm/domain.h
> > > > @@ -298,7 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
> > > >    #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag)
> > > > -#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); })
> > > > +#define has_vpci(d)    ({ (void)(d); IS_ENABLED(CONFIG_HAS_VPCI); })
> > > 
> > > As I mentioned in the previous patch, wouldn't this enable vPCI
> > > unconditionally for all the domain? Shouldn't this be instead an optional
> > > feature which would be selected by the toolstack?
> > 
> > I do think so, at least on x86 we signal whether vPCI should be
> > enabled for a domain using xen_arch_domainconfig at domain creation.
> > 
> > Ideally we would like to do this on a per-device basis for domUs, so
> > we should consider adding a new flag to xen_domctl_assign_device in
> > order to signal whether the assigned device should use vPCI.
> 
> I am a bit confused with this paragraph. If the device is not using vPCI,
> how will it be exposed to the domain? Are you planning to support both vPCI
> and PV PCI passthrough for a same domain?

You could have an external device model handling it using the ioreq
interface, like we currently do passthrough for HVM guests.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 10:52:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 10:52:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560401.876308 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHj4H-0008VQ-Oj; Fri, 07 Jul 2023 10:52:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560401.876308; Fri, 07 Jul 2023 10:52:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHj4H-0008VJ-Lr; Fri, 07 Jul 2023 10:52:05 +0000
Received: by outflank-mailman (input) for mailman id 560401;
 Fri, 07 Jul 2023 10:52:05 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ruU0=CZ=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHj4G-0008VD-Td
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 10:52:05 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on2061f.outbound.protection.outlook.com
 [2a01:111:f400:fe12::61f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4e83a534-1cb4-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 12:52:03 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB9644.eurprd04.prod.outlook.com (2603:10a6:102:242::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 10:52:01 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Fri, 7 Jul 2023
 10:52:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4e83a534-1cb4-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=C8+fgSBTVTQmsNEGwzZUN5tGeFfy4d4bibOGItuEQ854L1Iqe8dHlWf7dUD6m43ORpOAD/X0vNhzfCf9CU4DOPiGomuMA4bXRYXGL7EARsV3jiE2saniQCRxvTIOf1PK27r1LN8qRE9WZQEOnArcMRvfYq4cUN3WkiCWOSujoxY6jjBkmlVxamnE2rBRM7oDk3iGhdrJrCMV+AN6uUWQW6dTUnUNT64NBss7H+pKfHvAC8HLaugeJP99IoGwQBHhCoY1jlwsY2WQXr3Xh6nMKpyFBpqBMnrM2+VY5bV3L8W8ax/1q9Y6IyGvahVgUZ22HxTLzcM9GbqY4x6VNZ+ZBg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BL9+aXTPNJDOZDtEI32Z7FIa/ntG4R26DDAHnoR5PAc=;
 b=IIBSAmboGSK66Q4c9gD6CK+N2KME8Gh12+H0Wa3CIhfrYtQqLvR0TLT3F5TbkKBKPHGUOMXXAbRU/lLtQKUbSjf5ip4QkSYHcibVomm1OXtlhIC8VItJhnaOEA3AHNAuKO8sHZm/R4CqMcb/4PiG8bSW2F6mqk8e7UwJsDJJ2wPYQkKlh4eTeeWqQzz90uTt5rSxX4jNt7c9jYyE+w2ufYmHaQ4fEp/ywukXnF+EFIDSPRkbkT3a0ZRZQ3HXR/R0SLVHcn6Hkt2K+hnz2qTH3r3wnn1xBYPhoU7so0YboEecF5BvwHJLBLJu2Dgpl9hmJjzzifbWGbduyPzndo44ig==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BL9+aXTPNJDOZDtEI32Z7FIa/ntG4R26DDAHnoR5PAc=;
 b=ejJKLAAC5PjxK+Pl+ZpjsAy5aEekA1PWPlPPBnQCuTk+1c+ehIeNP87u5VD3RT0FJc+RFwl0IbfJ8myEPW4+T4Biy5kRtykE1nawvUnUpe64Wxdy1GX2CWHM9OqbvBmcxQtdFXNA/1Q/+XrdXgEhaFBtZxFKFsK2KY2yhx46AVXwmq8r3ygI9pcNTTbYUGLagLGE5kSIGYgGVR2goXNzTgVJ8CYSi4xHwwFzl+v4tNeA08T683t1hTX7F4g/S14Ved0SfRq2YAwEfDY6VZ0YHR0DgI8+Gv8XUiCwrNM4MDxOBcrufHNM3ExWGJ8q/CUyVJqnci9gamw4KH/MgKWF+Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <69699edb-78b2-336c-15f5-2b243257852e@suse.com>
Date: Fri, 7 Jul 2023 12:51:59 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 4/6] xen/riscv: introduce identity mapping
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1687178053.git.oleksii.kurochko@gmail.com>
 <21d8ce65f718bc10c2213688f79cf5f978bcaf16.1687178053.git.oleksii.kurochko@gmail.com>
 <67df28ad-060e-07d5-acf2-02c3cd5f0b96@suse.com>
 <1edb0c61a8ef64bb47809049252e9ad7b19f4bbe.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <1edb0c61a8ef64bb47809049252e9ad7b19f4bbe.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0115.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9d::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB9644:EE_
X-MS-Office365-Filtering-Correlation-Id: a2e59888-081e-496a-ed0c-08db7ed831a5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	wL7zdzW7sSA5i7YFLG2X5Te0EihZJ2TYeFXyf9aMOiMqlkuX5ZwT4+bLd+7aHrUYbnI/1PWClzq/LgczIaUqldhT6yl1LwATfjLRSdTlHNGul3LSNn7MECoPJ4oNFOGmLaDaskn//s1s0OUSOJ7KQ7yfGwdWEYYcFp25X7wOvJPq7Uz6JWSUJNT4E6rjm4n+KSEGFuuhsH0gDzpLJo61rQzdV/Crmn7r3QK5KZKdBUO+DyqW3QNKXOByDoJ+NOOztwx6i/MNxORxb7Z0zsJRiPQ2vioizbv3CgAK0yJ4IvvEYNknTbv4wjT3v3JNBrEFVY2ws9NjqTGCxZlh763s9OKBV8iLb4TcK38eQO5Oc0ZEGEf9FrtkEwe9DPOhHytxCSyEg2sDwtj7M2KuAye1/cFLKXGGpkiM0OqQM1rWMyx3G0QhQLIZMeh2uzbr7W/88fADOrEz0tL7kMn6FaGN+CKuiV3moutz3RRVAmiPU08Cje0H8M74GWrN2RB5Fofab65MqP3Zi5pWcBNbQGy2Uun+lkCztt9ARhqUqfSdRS7qyty1W0Ugoxd8SlujZUWiQULC7AlnyEp+/JqvsAmB/Ci+j7py5GZQpQVc7MBp5h6jx8kusso1DqW2nL2N/IKHaxFLNIAEMJKN2l0XwVMBqQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(136003)(396003)(346002)(366004)(39860400002)(451199021)(38100700002)(36756003)(31696002)(6512007)(86362001)(6486002)(6506007)(478600001)(186003)(53546011)(26005)(8676002)(8936002)(41300700001)(5660300002)(31686004)(54906003)(66476007)(66556008)(66946007)(4326008)(6916009)(2906002)(316002)(2616005)(83380400001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VjZlM3J6WWoyaUY3Y0hLTU5kbjYyOWVQQmpqeHAzMkx2b2kyU0hHWnRiWktw?=
 =?utf-8?B?dGZ3WW41djRzUncxdmkxdVlpeWRoVEE2Nkc4R1R0U2hNT0xzWVQ1ZVF1dzA2?=
 =?utf-8?B?dGdyd1lxRzl6QjlXaG5obUtpdmkrTGtsN0ZuU05GSmFmMGpRek42b0VCNG85?=
 =?utf-8?B?WjlrNmZja2ZIaER0NkFnMG1IaTF5NHJUUFhta2lOelBzU1NrZVZMb0haZmV2?=
 =?utf-8?B?OUJZeE50REkxUWFOUytjTnA1LzdiTUViS25GRGw2W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?WDE4NmNYTWVCYnRvVTZXcGVkS1g5Ym9Fc0o3QXBuVXhjakJqNU5UUE8xYTJh?=
 =?utf-8?B?NkluTjRZaktNcFd3RklUUU8yeEE3MnY5Nk1RcVBCYTc5WmRKelJCTFNKbDAx?=
 =?utf-8?Q?Q7AWZSMRL7B1uKwX2jg48vYiz?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a2e59888-081e-496a-ed0c-08db7ed831a5
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 10:52:01.5427
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 98Xa2VK8f6Va/UsBEwXx7HrhfwUklul9GN2n75ie6ezkFA8wxJzSxWDMapJZY5MlC9xet7pjSLuzY427ezat+Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9644

On 07.07.2023 12:37, Oleksii wrote:
> On Thu, 2023-07-06 at 13:35 +0200, Jan Beulich wrote:
>> On 19.06.2023 15:34, Oleksii Kurochko wrote:
>>> --- a/xen/arch/riscv/include/asm/config.h
>>> +++ b/xen/arch/riscv/include/asm/config.h
>>> @@ -1,3 +1,5 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-only */
>>> +
>>> Â #ifndef __RISCV_CONFIG_H__
>>> Â #define __RISCV_CONFIG_H__
>>> Â 
>>
>> Unrelated change?
> It  should be part of [PATCH v2 5/6] xen/riscv: introduce identity
> mapping.

Hmm, here we're discussing "[PATCH v2 4/6] xen/riscv: introduce identity
mapping". I'm confused, I guess.

>>> --- a/xen/arch/riscv/mm.c
>>> +++ b/xen/arch/riscv/mm.c
>>> @@ -25,6 +25,12 @@ unsigned long __ro_after_init phys_offset;
>>> Â #define LOAD_TO_LINK(addr) ((unsigned long)(addr) - phys_offset)
>>> Â #define LINK_TO_LOAD(addr) ((unsigned long)(addr) + phys_offset)
>>> Â 
>>> +/*
>>> + * Should be removed as soon as enough headers will be merged for
>>> inclusion of
>>> + * <xen/lib.h>.
>>> + */
>>> +#define ARRAY_SIZE(arr)Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (sizeof(arr) /
>>> sizeof((arr)[0]))
>>> +
>>> Â /*
>>> Â  * It is expected that Xen won't be more then 2 MB.
>>> Â  * The check in xen.lds.S guarantees that.
>>> @@ -35,8 +41,10 @@ unsigned long __ro_after_init phys_offset;
>>> Â  *
>>> Â  * It might be needed one more page table in case when Xen load
>>> address
>>> Â  * isn't 2 MB aligned.
>>> + *
>>> + * (CONFIG_PAGING_LEVELS - 1) page tables are needed for identity
>>> mapping.
>>> Â  */
>>> -#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) + 1)
>>> +#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) * 2 + 1)
>>
>> How come the extra page (see the comment sentence in context) isn't
>> needed for the identity-mapping case?
> It is needed to allocate no more than two 'nonroot' page tables (L0 and
> L1 in case of Sv39 ) as page 'root' table ( L2 in case of Sv39 ) is
> always re-used.
> 
> The same ( only 'nonroot' page tables might be needed to allocate )
> works for any MMU mode.

Of course, but if you cross a 2Mb boundary you'll need 2 L0 tables.

>>> @@ -255,25 +262,30 @@ void __init noreturn noinline enable_mmu()
>>> Â Â Â Â  csr_write(CSR_SATP,
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â  PFN_DOWN((unsigned long)stage1_pgtbl_root) |
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â  RV_STAGE1_MODE << SATP_MODE_SHIFT);
>>> +}
>>> Â 
>>> -Â Â Â  asm volatile ( ".p2align 2" );
>>> - mmu_is_enabled:
>>> -Â Â Â  /*
>>> -Â Â Â Â  * Stack should be re-inited as:
>>> -Â Â Â Â  * 1. Right now an address of the stack is relative to load
>>> time
>>> -Â Â Â Â  *Â Â Â  addresses what will cause an issue in case of load start
>>> address
>>> -Â Â Â Â  *Â Â Â  isn't equal to linker start address.
>>> -Â Â Â Â  * 2. Addresses in stack are all load time relative which can
>>> be an
>>> -Â Â Â Â  *Â Â Â  issue in case when load start address isn't equal to
>>> linker
>>> -Â Â Â Â  *Â Â Â  start address.
>>> -Â Â Â Â  *
>>> -Â Â Â Â  * We can't return to the caller because the stack was reseted
>>> -Â Â Â Â  * and it may have stash some variable on the stack.
>>> -Â Â Â Â  * Jump to a brand new function as the stack was reseted
>>> -Â Â Â Â  */
>>> +void __init remove_identity_mapping(void)
>>> +{
>>> +Â Â Â  unsigned int i;
>>> +Â Â Â  pte_t *pgtbl;
>>> +Â Â Â  unsigned int index, xen_index;
>>> +Â Â Â  unsigned long load_addr = LINK_TO_LOAD(_start);
>>> Â 
>>> -Â Â Â  switch_stack_and_jump((unsigned long)cpu0_boot_stack +
>>> STACK_SIZE,
>>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  cont_after_mmu_is_enabled);
>>> +Â Â Â  for ( pgtbl = stage1_pgtbl_root, i = 0;
>>> +Â Â Â Â Â Â Â Â Â  i <= (CONFIG_PAGING_LEVELS - 1);
>>
>> i < CONFIG_PAGING_LEVELS ? But maybe it would be easier for i to
>> start
>> at CONFIG_PAGING_LEVELS and be decremented, simplifying ...
>>
>>> +Â Â Â Â Â Â Â Â Â  i++ )
>>> +Â Â Â  {
>>> +Â Â Â Â Â Â Â  index = pt_index(CONFIG_PAGING_LEVELS - 1 - i, load_addr);
>>> +Â Â Â Â Â Â Â  xen_index = pt_index(CONFIG_PAGING_LEVELS - 1 - i,
>>> XEN_VIRT_START);
>>
>> ... these two expressions?
> It makes sense. I'll update this part of the code.
> 
>>
>>> +Â Â Â Â Â Â Â  if ( index != xen_index )
>>> +Â Â Â Â Â Â Â  {
>>> +Â Â Â Â Â Â Â Â Â Â Â  pgtbl[index].pte = 0;
>>> +Â Â Â Â Â Â Â Â Â Â Â  break;
>>> +Â Â Â Â Â Â Â  }
>>
>> Is this enough? When load and link address are pretty close (but not
>> overlapping), can't they share a leaf table, in which case you need
>> to clear more than just a single entry? The present overlap check
>> looks to be 4k-granular, not 2M (in which case this couldn't happen;
>> IOW adjusting the overlap check may also be a way out).
> At the start of setup_initial_pagetables() there is a code which checks
> that load and link address don't overlap:
> 
>     if ( (linker_start != load_start) &&
>          (linker_start <= load_end) && (load_start <= linker_end) )
>     {
>         early_printk("(XEN) linker and load address ranges overlap\n");
>         die();
>     }
> 
> So the closest difference between load and link address can be 4kb.
> Otherwise load and link address ranges are equal ( as we can't map less
> then 4kb).
> 
> Let's take concrete examples:
>   Load address range is   0x8020_0000 - 0x8020_0FFF
>   Linker address range is 0x8020_1000 - 0x8020_1FFF
>   MMU mode: Sv39 ( so we have 3 page tables )
> 
>   So we have:
>     * L2 index = 2, L1 index = 1, L0 index = 0 for load address
>     * L2 index = 2, L1 index = 1, L0 index = 1 for linker address
>   Thereby we have two different L0 tables for load and linker address 
> ranges.
>   And it looks like it is pretty safe to remove only one L0 index that
> was used for identity mapping.
> 
> Is it possible that I missed something?

Looks as if you are thinking of only a Xen which fits in 4k. The code
here wants to cope with Xen getting quite a bit bigger.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 11:02:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 11:02:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560407.876317 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHjEE-0001fE-O0; Fri, 07 Jul 2023 11:02:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560407.876317; Fri, 07 Jul 2023 11:02:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHjEE-0001f7-LO; Fri, 07 Jul 2023 11:02:22 +0000
Received: by outflank-mailman (input) for mailman id 560407;
 Fri, 07 Jul 2023 11:02:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=3LXA=CZ=invisiblethingslab.com=marmarek@srs-se1.protection.inumbo.net>)
 id 1qHjED-0001f1-HT
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 11:02:21 +0000
Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com
 [64.147.123.25]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bc668bb7-1cb5-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 13:02:19 +0200 (CEST)
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailout.west.internal (Postfix) with ESMTP id 54AEE3200914;
 Fri,  7 Jul 2023 07:02:15 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute6.internal (MEProxy); Fri, 07 Jul 2023 07:02:15 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
 7 Jul 2023 07:02:13 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bc668bb7-1cb5-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm2; t=
	1688727734; x=1688814134; bh=2JQhjxKyml7irJHr5y4i+kR5NB0VbxX81e8
	nVB6UkMY=; b=MtkHcl9zK76gSt147cAhfus7vEtSPtpsHLRC9F29WwVFMy2CUoW
	1OEQAIDV1BaG7MAZlS8yLmyh6lnmkRZontWBYt3redfjR2o38iRUABq/S4xHKhjg
	EBga80SmmBFaHdry0YN4qds2IldQ9/X7jv7s8B7WmPnl3dzAQOzC5DM0OTKzq2x9
	rZS+U7nELcEHD/YF4Ix7ceKVigcH8XKaq40bAPuLqw74Vgr9yRA7PK+obBlayLq5
	3lPLcgDoDsBDkt4pO8IawfxC5GIt8KmuLmXmz2Zppw0J2/BCm0aFEjehTL0CbZK+
	NMDXNRa5mXY5zhJ2D+Sk2Jar6WfwIgT49hw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm2; t=1688727734; x=1688814134; bh=2JQhjxKyml7ir
	JHr5y4i+kR5NB0VbxX81e8nVB6UkMY=; b=N1J0dO5KZq7kWaFRtU7EwMyH/frqe
	ot2dwClYR+g6pnZIH5wXU9vtVoJMIVh88ybE8U1twuIMaXS2lH/BWM+cy0kaijo2
	A5nXS1sceE1Iv9rL/24VCkQcKQrJg0BG9cwRRMAlerWoBFKNg3q4QhRaOhxLMfLj
	yC1hpg/wgwipes9ldaltEP0/U4e4XZE3oU8CkjwNRfX2kg5PWhGppmQXzIyqZ2aD
	NCapEt47Ht0b6BKz47X6jg+q5RZAKuCcoCT7AAV3ybST1sz7s93x26r7y1FHVNZP
	tfPQbJGMYDTRZKSO5GStMdljVxjg2Zhmlq1/33veWiTa0ivSVr1FCavQA==
X-ME-Sender: <xms:tvCnZOsXexGsJVEQ6eNYpEsWR_eiLfjLkUIu4j29UFuhvs3Q-RTwIQ>
    <xme:tvCnZDdtgCdXoi2sQAPtz9138T7RnVbUkiM-4QTQ9sH8FI_vKsTM0NTln4PS9_O-1
    GYFsm1YntVU1A>
X-ME-Received: <xmr:tvCnZJxC4ovZxBF7L6zbzosh_3_qThz399iw20OcPrlRTUw6EXBWWbAlcictABagp0gdxBIyoXIWCd612Skxy80ATNIvJJR6j1o>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrvddugdefhecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpeffhffvvefukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpeforghrvghk
    ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh
    hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpefgudel
    teefvefhfeehieetleeihfejhfeludevteetkeevtedtvdegueetfeejudenucevlhhush
    htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhes
    ihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm
X-ME-Proxy: <xmx:tvCnZJPw4cuNJ9GSOcu4LMPB1mQ_v40zBbQEPQsPNAOxeMiHMf_7yQ>
    <xmx:tvCnZO9EH0s6vVQdLWiHTfTNvdudie9Pn0Jd1i-ACtf3ZCdNhpN9Gw>
    <xmx:tvCnZBWweWNHEeO7oh8OK90QQLT9pAMum10zHnLzZh4gx4-3ubBc8g>
    <xmx:tvCnZFYjvsphxvBY2SdinnwKbjUpPm9TUqmSvh8Wr_KV0fVstIDsMQ>
Feedback-ID: i1568416f:Fastmail
Date: Fri, 7 Jul 2023 13:02:10 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Paul Durrant <paul@xen.org>, Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 1/2] x86/mm: add API for marking only part of a MMIO
 page read only
Message-ID: <ZKfwsvFmwEo+gzh9@mail-itl>
References: <cover.dd82aca339854e90ffe12e7bc4298254a6caaf0d.1683321183.git-series.marmarek@invisiblethingslab.com>
 <def382a6481a9d1bcc106200b971cd5b0f3d19c1.1683321183.git-series.marmarek@invisiblethingslab.com>
 <f3531050-fb31-2d9e-f3dd-2d310dc7c5ec@suse.com>
 <ZJ9XFdGhxyKLY3fm@mail-itl>
 <3773dc6e-9d36-ba80-2a0a-bb1589c9993f@suse.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="9xpvJaW4i3iau5pz"
Content-Disposition: inline
In-Reply-To: <3773dc6e-9d36-ba80-2a0a-bb1589c9993f@suse.com>


--9xpvJaW4i3iau5pz
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Fri, 7 Jul 2023 13:02:10 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Paul Durrant <paul@xen.org>, Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 1/2] x86/mm: add API for marking only part of a MMIO
 page read only

On Wed, Jul 05, 2023 at 10:23:53AM +0200, Jan Beulich wrote:
> On 01.07.2023 00:28, Marek Marczykowski-G=C3=B3recki wrote:
> > On Tue, May 30, 2023 at 01:56:34PM +0200, Jan Beulich wrote:
> >> On 05.05.2023 23:25, Marek Marczykowski-G=C3=B3recki wrote:
> >>> --- a/xen/arch/x86/hvm/hvm.c
> >>> +++ b/xen/arch/x86/hvm/hvm.c
> >>> @@ -1990,6 +1990,14 @@ int hvm_hap_nested_page_fault(paddr_t gpa, uns=
igned long gla,
> >>>          goto out_put_gfn;
> >>>      }
> >>> =20
> >>> +    if ( (p2mt =3D=3D p2m_mmio_direct) && npfec.write_access && npfe=
c.present &&
> >>> +         subpage_mmio_write_accept(mfn, gla) &&
> >>> +         (hvm_emulate_one_mmio(mfn_x(mfn), gla) =3D=3D X86EMUL_OKAY)=
 )
> >>> +    {
> >>> +        rc =3D 1;
> >>> +        goto out_put_gfn;
> >>> +    }
> >>
> >> But npfec.write_access set doesn't mean it was a write permission
> >> violation, does it?=20
> >=20
> > Doesn't it? IIUC it means it was a write attempt, to a mapped page
> > (npfec.present), and since we've got EPT violation, it got denied.=20
>=20
> But the denial may have been for reasons other than the W bit being
> clear, at least in principle? Abusing the bit now, even if in
> practice there was no other possible reason on existing hardware
> with the features we presently use, might lead to hard to locate
> issues in case a different reason appears down the road.

Ok, so how do you propose to check if it was a write violation?

(...)

> >> Since you mark the qwords which are to be protected, how is one to set
> >> up safely two discontiguous ranges on the same page? I think I had
> >> asked for v1 already why you don't do things the other way around:
> >> Initially the entire page is protected, and then writable regions are
> >> carved out.
> >=20
> > Because that's not how the API is used. This API is for those how want
> > to write-protect some specific ranges (to be written exclusively by
> > Xen). They don't need to even know what is else is on the same page.
> > Take XHCI case as an example: it gets the range to write-protect by
> > enumerating XHCI extended capabilities, which is a linked list. The
> > driver gets info where XHCI console registers are.  Things before/after
> > them on that page may not even be XHCI extended caps at all.
> > This in fact is very similar approach to already existing
> > mmio_ro_ranges.
>=20
> While I agree there's a similarity, multiple entities caring about the
> same MFN isn't an expected scenario there. Whereas here you explicitly
> add support for such.
>=20
> Furthermore you sub-divide pages covered by mmio_ro_ranges here, so
> defaulting to "full page protected" and then carving out sub-regions
> would be the more natural approach imo.

But then the API would be awkward to use. Instead of "mark this (smaller
than a page) region as read-only" so Xen can use it safely, you would
(likely) need marking _two_ regions as writable, after marking a page as
read-only. So, either you'd need separate (3?) calls, array of ranges or
something similar.

> >> I guess I shouldn't further ask about overlapping r/o ranges and their
> >> cleaning up. But at least a comment towards the restriction would be
> >> nice. Perhaps even check upon registration that no part of the range
> >> is already marked r/o.
> >=20
> > Yes, this is a good suggestion, I'll add that.
>=20
> As long as all restrictions are properly spelled out, this may be
> sufficient. But please don't be surprised if I ask again on a
> subsequent version.

(...)

> >>> +static void subpage_mmio_write_emulate(
> >>> +    mfn_t mfn,
> >>> +    unsigned int offset,
> >>> +    const void *data,
> >>> +    unsigned int len)
> >>> +{
> >>> +    struct subpage_ro_range *entry;
> >>> +    void __iomem *addr;
> >>> +
> >>> +    rcu_read_lock(&subpage_ro_rcu);
> >>> +
> >>> +    list_for_each_entry_rcu(entry, &subpage_ro_ranges, list)
> >>> +    {
> >>> +        if ( mfn_eq(entry->mfn, mfn) )
> >>> +        {
> >>> +            if ( test_bit(offset / SUBPAGE_MMIO_RO_ALIGN, entry->ro_=
qwords) )
> >>> +                goto write_ignored;
> >>
> >> I think you can get away with just a single "goto" by putting the gpri=
ntk()
> >> (and its label) here.
> >=20
> > write_ignored label is used also below in "default" case (which should
> > be unreachable, but still).
>=20
> Right, which is why I said 'just a single "goto"' (implying a label would
> still be needed).
>=20
> > Do you suggest jumping from default case into here?
>=20
> Yes, that would be one way of structuring things.

IMO jumping into a middle of some nested conditional/loop is harder to
follow, I'd prefer to avoid such practice. Furthermore, if moving the
gprintk here, it still needs "goto out_unlock", so it isn't really
saving any "goto", just changing its target.

--=20
Best Regards,
Marek Marczykowski-G=C3=B3recki
Invisible Things Lab

--9xpvJaW4i3iau5pz
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmSn8LIACgkQ24/THMrX
1yx4gwf/eHlpAf5cam8pUZ4YggNwBd0X4vWyXFHzn3myrhHploaGC9WLZLU+if5d
4zhVi4K63+F2TuLw0QA7ejxtvO9n/g9PlqUWVbq/cCBeWI4mNsE87OphGySeLWE/
t22aKb/cMSgIS0Pfu5TTe7rB97FXftxBf/GGmrv5HXFgOlLHb4qdnyamFmOYzWRY
1C1XFDr4gsrFPpYb7AtGBWLaLkMECUr4/5CXpGkJMvWEJG07tdZlVRq/QWWBOMwx
Y4S2LZc1vACSgbsScluwdpvEONNPBAaZ5Y/fffS1qB13zn9AGW2RHOfw+tjJbuuJ
mf55mWS8Z8neK4EYoRFBtlM2erboFA==
=usiB
-----END PGP SIGNATURE-----

--9xpvJaW4i3iau5pz--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 11:05:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 11:05:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560413.876328 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHjHA-0002FY-7Q; Fri, 07 Jul 2023 11:05:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560413.876328; Fri, 07 Jul 2023 11:05:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHjHA-0002FR-3q; Fri, 07 Jul 2023 11:05:24 +0000
Received: by outflank-mailman (input) for mailman id 560413;
 Fri, 07 Jul 2023 11:05:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=FpoL=CZ=arm.com=Rahul.Singh@srs-se1.protection.inumbo.net>)
 id 1qHjH8-0002FL-KE
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 11:05:22 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on20612.outbound.protection.outlook.com
 [2a01:111:f400:fe16::612])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 293909ff-1cb6-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 13:05:20 +0200 (CEST)
Received: from AS4P250CA0021.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5e3::7)
 by GV2PR08MB8146.eurprd08.prod.outlook.com (2603:10a6:150:74::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 11:05:09 +0000
Received: from AM7EUR03FT011.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:5e3:cafe::39) by AS4P250CA0021.outlook.office365.com
 (2603:10a6:20b:5e3::7) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.31 via Frontend
 Transport; Fri, 7 Jul 2023 11:05:09 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT011.mail.protection.outlook.com (100.127.140.81) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.25 via Frontend Transport; Fri, 7 Jul 2023 11:05:08 +0000
Received: ("Tessian outbound f1e964b3a9be:v145");
 Fri, 07 Jul 2023 11:05:08 +0000
Received: from b9cea94f3878.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 3C087312-A718-402B-B59A-70CF7CE69CA6.1; 
 Fri, 07 Jul 2023 11:04:56 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b9cea94f3878.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 07 Jul 2023 11:04:56 +0000
Received: from PAXPR08MB7154.eurprd08.prod.outlook.com (2603:10a6:102:207::17)
 by DU2PR08MB10229.eurprd08.prod.outlook.com (2603:10a6:10:496::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 11:04:54 +0000
Received: from PAXPR08MB7154.eurprd08.prod.outlook.com
 ([fe80::4f7f:b28a:8682:e119]) by PAXPR08MB7154.eurprd08.prod.outlook.com
 ([fe80::4f7f:b28a:8682:e119%3]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 11:04:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 293909ff-1cb6-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=r6qXJL39Qrg3MGaIMFTjX/7J4KbShQRpLDx1fSN7QfE=;
 b=DkDOUahs+ZJe6IhX8pD1wAVVn5JLSuC/mcZ4108jp3pyTEJXQN1o+aVfsuodKDxm8tP1lgWkBAdbxpp9d7QM4dQulpTxkAb0KLq+Sv3akvjpv9wPkutx3WkGo8u3LO7KYCI36KtNkB+SzoACiJ8dUPB5AwelvwJHetR1s5h4j0o=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 8c1dede190104745
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=GgAIoHFADNBjXMA7ypdh2FJZagRbFI2b9t1Dw1RHehq257zr5Sx1D04qHEosMAogyhb55rzkTPHHlF/SXrO9LQSie7FYnSMIVnbw54NAJMFWqJWxQgjyq/qg1Vp6th/e80VAGKM0nnM0q/tq4ngF2hEx3FG334nDNsifBIDXbCTo69m8hKpopfuaPBy4BNpT4T7AkLVpyezvYfYL+DBs9dnSFoqb9uqHqJfYheyBDoE6c/MTVHV86uWPfY9WE04J4sT2016PHokSshA1Vipdti9DmE3pRQsC+mv8oaeR1Nz9Wlt3S6KGscaQcTNeyzyjSrV9sbsw+QkNtrPHRxZqzQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=r6qXJL39Qrg3MGaIMFTjX/7J4KbShQRpLDx1fSN7QfE=;
 b=kUDGa7/J57QsH7nUsNViZo//kyUdv1HZvl9F9kwjIldME2TdkXmtJeqaG0Hj3/da2v6aVcS6XjJBMSi78+d4F1W6LG1AmuNcZNvSxcsc8KesXKiQbrtx23FOP8rGg/MQ27L4WNVQhdao2cNOKixDa7TPgA1AAtLU7mof4NX0YTqOOQ5iRcB83+dRxzztTpV6qHKl5SH4YWj5q87/MUxGFqIrz/FM9diRBk3DOWCKPs0jq8bG9HaSNlss6gVe9rYEmcBUivVihrMMwz+AEz3oxPv5L9Hew39MgN6nqCpXDvdKBu6KU+BiWdSKyKKYJRc4YmN6USc+ZUKx6UQcFc/xGg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=r6qXJL39Qrg3MGaIMFTjX/7J4KbShQRpLDx1fSN7QfE=;
 b=DkDOUahs+ZJe6IhX8pD1wAVVn5JLSuC/mcZ4108jp3pyTEJXQN1o+aVfsuodKDxm8tP1lgWkBAdbxpp9d7QM4dQulpTxkAb0KLq+Sv3akvjpv9wPkutx3WkGo8u3LO7KYCI36KtNkB+SzoACiJ8dUPB5AwelvwJHetR1s5h4j0o=
From: Rahul Singh <Rahul.Singh@arm.com>
To: Stewart Hildebrand <Stewart.Hildebrand@amd.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>, Oleksandr
 Tyshchenko <oleksandr_tyshchenko@epam.com>, Artem Mygaiev
	<artem_mygaiev@epam.com>
Subject: Re: [PATCH v2 3/3] [FUTURE] xen/arm: enable vPCI for domUs
Thread-Topic: [PATCH v2 3/3] [FUTURE] xen/arm: enable vPCI for domUs
Thread-Index: AQHZsHVYKpTUBSn+mE6nlUwGgqsPJ6+uJKeA
Date: Fri, 7 Jul 2023 11:04:54 +0000
Message-ID: <9A14CA15-2706-4907-A3D3-9A670CF9BAED@arm.com>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-4-stewart.hildebrand@amd.com>
In-Reply-To: <20230707014754.51333-4-stewart.hildebrand@amd.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	PAXPR08MB7154:EE_|DU2PR08MB10229:EE_|AM7EUR03FT011:EE_|GV2PR08MB8146:EE_
X-MS-Office365-Filtering-Correlation-Id: f295a773-1b42-4611-99ec-08db7eda06c0
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 1rQwztPl6makt/KZLJuNdTyNp6cVuf4AHJORjNYobt0A+eQSZDKyaOFpj0cWJj2UQZ79VzMLaG9HzxlTtGhogHGzX7aeeVasPAj5rpuahVPiZ4a8U0W2zTSDi6YwDAE7HH/7o+z8nKknd5qB4gVjYPvaxTU+RC1lFiv971pjl4hW8+bS21AiG+6ySkQl63KLLMOY3Bs0vge9Fr6llyZWS0g1ZiqzDVCPQeuwaiVIH+qFiY78QEvTeyRyl07J+CYz2Z14kA8W3c80CH+PY2zqHf3/MCIfRwuPKzXPbSQQC2LAO/fUgrnEUWR3fydoTg2mZN8SPTABWZrXNRMqMUjdQD6QoxL+UUBdCrFUV85Jynwo+NFVakA75E9fQsu2SiWzMIV/+U35//zs5nYetfhVFoP2NpZR7z49yrUEDffg91OtOViR+cEoN2ln/zN1v+z4fNI6GlXHH1Kfq8NUXir3EcW7lwXzJNDvXqhfACoBecQME3EgQVubOYrJmZEkWoX8ArxhA4NqXl4OeJVEEgM/H+fqXGtqy78cX/0nrTG6m+lEqHCRDtF/Mn8ZXtCQR+idDOMN8pj0sgJyfGlVgPS6Oip9UGHmNm5Mq+ohcHMfnvDEcjBRMHqNwpkiDiPFseZszUXa38idvkOyJMTewGN6uA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR08MB7154.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(366004)(396003)(346002)(136003)(376002)(451199021)(166002)(54906003)(6486002)(71200400001)(478600001)(76116006)(91956017)(122000001)(83380400001)(86362001)(2616005)(36756003)(38070700005)(33656002)(8676002)(2906002)(53546011)(66946007)(966005)(6512007)(66476007)(66446008)(26005)(186003)(6506007)(38100700002)(99936003)(316002)(41300700001)(64756008)(6916009)(66556008)(4326008)(8936002)(5660300002)(21615005)(45980500001);DIR:OUT;SFP:1101;
Content-Type: multipart/mixed;
	boundary="_006_9A14CA1527064907A3D39A670CF9BAEDarmcom_"
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB10229
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT011.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	a3b40373-6051-4fb8-a1be-08db7ed9fe39
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	e8qVIQHaxRm9i2e4yktHrWU8AHIwxtderBfac6EjTQEFZl4HfL1MmV83pOMywnps5+L+l8EOSo6uar+Sis0pLV/XicEnuSYdBAFv4TMTw8ehv6KicvTaUoZNVpiqVxy1qubtf/dAOSLgdj96DOmCu+IIic+5aiHPMiHORrCH9u1X0mM0YKG9eBoWfoKaONgrpM2YBwfNbfL5SruruJr8ayN1LQWDRKa0gXbezLux4YC6WInmi2zlyWH5yCZZtqbK/KCCUgJ9vfx6ysYG3pdmudaHwbSujE8Z/WhKne0MXeq1zSWya1UCbDaR3xcS19lJ3fKzAXedVzw+hS87FcbLoWr2/vhY7/JVN/lUuB2TwYsxRZrVzZTjvMsY5hF+9Z0Rwj7ihZB63sIF0bZ/f79nNcQuN+du39lVjxUS3mEhiSQFtqSsbKfg4X0saIFqd4h1F99pVehgu9im1IfYUhYnjxA4z96rZah3ZZH6HyXV39KvDhNGRIBqgmAOiuoniGnZoF/l/syByOtHlHDAopBHu4VoeBPRLUlV+UC6IDP8DfpwnuUHZIUg+Ti5w+lYikMDIzcutKE0bXIgIYjIkud/iTY18VlCBrU8BX1tBzZ/saRcKyv03ebzjRVJ5nY9RJ2Xw7XLZjFeG0nHmMOO4jHGOCZR+y0MPmSzzm+n2skwLRhBjMmhNQHLc9HFuNirwzHdCFu+URMGYhDk3R8Bo+8nftYFl4kxrvca+8DRG7qv6GA=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(346002)(376002)(451199021)(40470700004)(36840700001)(46966006)(6486002)(45080400002)(478600001)(70206006)(54906003)(70586007)(33964004)(47076005)(83380400001)(86362001)(33656002)(36756003)(40480700001)(2616005)(2906002)(336012)(82310400005)(36860700001)(26005)(53546011)(40460700003)(186003)(966005)(107886003)(6506007)(6512007)(99936003)(81166007)(356005)(82740400003)(166002)(8676002)(4326008)(316002)(41300700001)(8936002)(235185007)(6862004)(5660300002)(21615005);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 11:05:08.3531
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: f295a773-1b42-4611-99ec-08db7eda06c0
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT011.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8146

--_006_9A14CA1527064907A3D39A670CF9BAEDarmcom_
Content-Type: multipart/alternative;
	boundary="_000_9A14CA1527064907A3D39A670CF9BAEDarmcom_"

--_000_9A14CA1527064907A3D39A670CF9BAEDarmcom_
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64

SGkgU3Rld2FydCwNCg0KPiBPbiA3IEp1bCAyMDIzLCBhdCAyOjQ3IGFtLCBTdGV3YXJ0IEhpbGRl
YnJhbmQgPFN0ZXdhcnQuSGlsZGVicmFuZEBhbWQuY29tPiB3cm90ZToNCj4NCj4gUmVtb3ZlIGlz
X2hhcmR3YXJlX2RvbWFpbiBjaGVjayBpbiBoYXNfdnBjaSwgYW5kIHNlbGVjdCBIQVNfVlBDSV9H
VUVTVF9TVVBQT1JUDQo+IGluIEtjb25maWcuDQo+DQo+IFsxXSBodHRwczovL2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SNkZWZpbmUgaGFzX3ZwY2koZCkgKHsgSVNfRU5B
QkxFRChDT05GSUdfSEFTX1ZQQ0kpICZhbXA7JmFtcDsgaXNfaGFyZHdhcmVfZG9tYWluKGQpOyB9
KTxicj4NCiZndDsgKyNkZWZpbmUgaGFzX3ZwY2koZCkmbmJzcDsmbmJzcDsmbmJzcDsgKHsgKHZv
aWQpKGQpOyBJU19FTkFCTEVEKENPTkZJR19IQVNfVlBDSSk7IH0pPGJyPg0KJmd0OyA8YnI+DQom
Z3Q7IHN0cnVjdCBhcmNoX3ZjcHVfaW8gezxicj4NCiZndDsmbmJzcDsmbmJzcDsmbmJzcDsmbmJz
cDsgc3RydWN0IGluc3RyX2RldGFpbHMgZGFidF9pbnN0cjsgLyogd2hlbiB0aGUgaW5zdHJ1Y3Rp
b24gaXMgZGVjb2RlZCAqLzxicj4NCiZndDsgLS0gPGJyPg0KJmd0OyAyLjQxLjA8YnI+DQomZ3Q7
IDxicj4NCiZndDsgPGJyPg0KPGJyPg0KPC9kaXY+DQo8L3NwYW4+PC9mb250PjwvZGl2Pg0KPC9i
b2R5Pg0KPC9odG1sPg0K

--_000_9A14CA1527064907A3D39A670CF9BAEDarmcom_--

--_006_9A14CA1527064907A3D39A670CF9BAEDarmcom_
Content-Type: application/octet-stream;
	name="0001-Revert-xen-arm-Add-cmdline-boot-option-pci-passthrou.patch"
Content-Description:
 0001-Revert-xen-arm-Add-cmdline-boot-option-pci-passthrou.patch
Content-Disposition: attachment;
	filename="0001-Revert-xen-arm-Add-cmdline-boot-option-pci-passthrou.patch";
	size=4578; creation-date="Fri, 07 Jul 2023 11:04:53 GMT";
	modification-date="Fri, 07 Jul 2023 11:04:53 GMT"
Content-ID: <E6190BE0203DAC4BA0663F6E770E7719@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64

RnJvbSAwMTMxMjRiNDk2NTc0YzFlZGExMGUwNGYxMTlkMmQyMjdmMTAxZTI1IE1vbiBTZXAgMTcg
MDA6MDA6MDAgM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lkX3Qgbm9kZSA9IE5VTUFfTk9fTk9ERTsK
IAotICAgICAgICBpZiAoICFpc19wY2lfcGFzc3Rocm91Z2hfZW5hYmxlZCgpICkKLSAgICAgICAg
ICAgIHJldHVybiAtRU9QTk9UU1VQUDsKLQogICAgICAgICByZXQgPSAtRUZBVUxUOwogICAgICAg
ICBpZiAoIGNvcHlfZnJvbV9ndWVzdCgmYWRkLCBhcmcsIDEpICE9IDAgKQogICAgICAgICAgICAg
YnJlYWs7CkBAIC01Niw5ICs1Myw2IEBAIHJldF90IHBjaV9waHlzZGV2X29wKGludCBjbWQsIFhF
Tl9HVUVTVF9IQU5ETEVfUEFSQU0odm9pZCkgYXJnKQogICAgIGNhc2UgUEhZU0RFVk9QX3BjaV9k
ZXZpY2VfcmVtb3ZlOiB7CiAgICAgICAgIHN0cnVjdCBwaHlzZGV2X3BjaV9kZXZpY2UgZGV2Owog
Ci0gICAgICAgIGlmICggIWlzX3BjaV9wYXNzdGhyb3VnaF9lbmFibGVkKCkgKQotICAgICAgICAg
ICAgcmV0dXJuIC1FT1BOT1RTVVBQOwotCiAgICAgICAgIHJldCA9IC1FRkFVTFQ7CiAgICAgICAg
IGlmICggY29weV9mcm9tX2d1ZXN0KCZkZXYsIGFyZywgMSkgIT0gMCApCiAgICAgICAgICAgICBi
cmVhazsKLS0gCjIuMjUuMQoK

--_006_9A14CA1527064907A3D39A670CF9BAEDarmcom_
Content-Type: application/octet-stream;
	name="0002-xen-arm-Fix-mapping-for-PCI-bridge-mmio-region.patch"
Content-Description: 0002-xen-arm-Fix-mapping-for-PCI-bridge-mmio-region.patch
Content-Disposition: attachment;
	filename="0002-xen-arm-Fix-mapping-for-PCI-bridge-mmio-region.patch";
	size=2083; creation-date="Fri, 07 Jul 2023 11:04:53 GMT";
	modification-date="Fri, 07 Jul 2023 11:04:53 GMT"
Content-ID: <3099B24DCF7E1948A8FE3188CABF294B@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64

RnJvbSA5NTI0Mz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gKCAhaXNfcGNpX3Bhc3N0
aHJvdWdoX2VuYWJsZWQoKSApCi0gICAgICAgIHJldHVybiAwOwotCiAgICAgaWYgKCAhZHRfZGV2
aWNlX3R5cGVfaXNfZXF1YWwobm9kZSwgInBjaSIpICkKICAgICAgICAgcmV0dXJuIDA7CiAKQEAg
LTI1MjQsNyArMjUyMSw3IEBAIHN0YXRpYyBpbnQgX19pbml0IGhhbmRsZV9kZXZpY2Uoc3RydWN0
IGRvbWFpbiAqZCwgc3RydWN0IGR0X2RldmljZV9ub2RlICpkZXYsCiAgICAgICAgIC5kID0gZCwK
ICAgICAgICAgLnAybXQgPSBwMm10LAogICAgICAgICAuc2tpcF9tYXBwaW5nID0gIW93bl9kZXZp
Y2UgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgIChpc19wY2lfcGFzc3Rocm91Z2hfZW5hYmxl
ZCgpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAoaGFzX3ZwY2koZCkgJiYKICAgICAgICAg
ICAgICAgICAgICAgICAgIChkZXZpY2VfZ2V0X2NsYXNzKGRldikgPT0gREVWSUNFX1BDSV9IT1NU
QlJJREdFKSkKICAgICB9OwogCi0tIAoyLjI1LjEKCg==

--_006_9A14CA1527064907A3D39A670CF9BAEDarmcom_
Content-Type: application/octet-stream;
	name="0003-xen-arm-Map-ITS-dorrbell-register-to-IOMMU-page-tabl.patch"
Content-Description:
 0003-xen-arm-Map-ITS-dorrbell-register-to-IOMMU-page-tabl.patch
Content-Disposition: attachment;
	filename="0003-xen-arm-Map-ITS-dorrbell-register-to-IOMMU-page-tabl.patch";
	size=1596; creation-date="Fri, 07 Jul 2023 11:04:53 GMT";
	modification-date="Fri, 07 Jul 2023 11:04:53 GMT"
Content-ID: <BB19F46D9C269F40BD4544DED7A697D7@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64

RnJvbSA0NDYxMGE1NWE0M2MxYWRiNGUyZDRkYWUwNzk0M2VmOGU4MzVmZGI5IE1vbiBTZXAgMTcg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2FybS92Z2ljLXYzLWl0cy5j
CkBAIC02ODIsNiArNjgyLDE4IEBAIHN0YXRpYyBpbnQgaXRzX2hhbmRsZV9tYXBkKHN0cnVjdCB2
aXJ0X2l0cyAqaXRzLCB1aW50NjRfdCAqY21kcHRyKQogICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICBCSVQoc2l6ZSwgVUwpLCB2YWxpZCk7CiAgICAgICAgIGlmICggcmV0
ICYmIHZhbGlkICkKICAgICAgICAgICAgIHJldHVybiByZXQ7CisKKyAgICAgICAgaWYgKCBpc19p
b21tdV9lbmFibGVkKGl0cy0+ZCkgKSB7CisgICAgICAgICAgICByZXQgPSBtYXBfbW1pb19yZWdp
b25zKGl0cy0+ZCwgZ2FkZHJfdG9fZ2ZuKGl0cy0+ZG9vcmJlbGxfYWRkcmVzcyksCisgICAgICAg
ICAgICAgICAgICAgICAgICAgICBQRk5fVVAoSVRTX0RPT1JCRUxMX09GRlNFVCksCisgICAgICAg
ICAgICAgICAgICAgICAgICAgICBtYWRkcl90b19tZm4oaXRzLT5kb29yYmVsbF9hZGRyZXNzKSk7
CisgICAgICAgICAgICBpZiAoIHJldCA8IDAgKQorICAgICAgICAgICAgeworICAgICAgICAgICAg
ICAgIHByaW50ayhYRU5MT0dfRVJSICJHSUN2MzogTWFwIElUUyB0cmFuc2xhdGlvbiByZWdpc3Rl
ciBkJWQgZmFpbGVkLlxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGl0cy0+ZC0+ZG9tYWlu
X2lkKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gcmV0OworICAgICAgICAgICAgfQorICAgICAg
ICB9CiAgICAgfQogCiAgICAgc3Bpbl9sb2NrKCZpdHMtPml0c19sb2NrKTsKLS0gCjIuMjUuMQoK

--_006_9A14CA1527064907A3D39A670CF9BAEDarmcom_--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 11:17:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 11:17:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560419.876338 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHjSF-0003pN-BS; Fri, 07 Jul 2023 11:16:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560419.876338; Fri, 07 Jul 2023 11:16:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHjSF-0003pG-8l; Fri, 07 Jul 2023 11:16:51 +0000
Received: by outflank-mailman (input) for mailman id 560419;
 Fri, 07 Jul 2023 11:16:50 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qHjSE-0003pA-Rv
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 11:16:50 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHjSC-00085b-Kf; Fri, 07 Jul 2023 11:16:48 +0000
Received: from 54-240-197-233.amazon.com ([54.240.197.233]
 helo=[192.168.10.48]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHjSC-0002C2-ET; Fri, 07 Jul 2023 11:16:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=Vcgc35YhzH8xHKYXv2MOXHhuIFNryBkOC3PAhajBxwU=; b=hFeIprxoen0asxzReE5bzs9TQV
	0m5U6ilb+MbiCuEn1yWBqk/L2FAYfBfCghjWUI2OMOJmmI8D2LyzKHz5i39Yh7nna4cymDuOPNR+3
	Tio/a1aRQ4hsuyt25dA5MPHskSqYnHqMRnYggln8BIK6jjbkSh9H+/qB/iw94X20TW2k=;
Message-ID: <7f89a925-6c4e-7840-041b-2e0816ed7b71@xen.org>
Date: Fri, 7 Jul 2023 12:16:46 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 3/3] [FUTURE] xen/arm: enable vPCI for domUs
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Stewart Hildebrand <stewart.hildebrand@amd.com>,
 xen-devel@lists.xenproject.org, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Artem Mygaiev <artem_mygaiev@epam.com>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-4-stewart.hildebrand@amd.com>
 <e5a0ed8a-d85b-fb60-609a-f46884433c60@xen.org>
 <ZKfjoXqb6Kgav-vL@MacBook-Air-de-Roger.local>
 <04c05db8-1e15-f2c1-ebc1-0563d442a808@xen.org>
 <ZKftKtkjgFLWaW_x@MacBook-Air-de-Roger.local>
From: Julien Grall <julien@xen.org>
In-Reply-To: <ZKftKtkjgFLWaW_x@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 07/07/2023 11:47, Roger Pau MonnÃ© wrote:
> On Fri, Jul 07, 2023 at 11:33:14AM +0100, Julien Grall wrote:
>> Hi,
>>
>> On 07/07/2023 11:06, Roger Pau MonnÃ© wrote:
>>> On Fri, Jul 07, 2023 at 10:00:51AM +0100, Julien Grall wrote:
>>>> On 07/07/2023 02:47, Stewart Hildebrand wrote:
>>>>> Note that CONFIG_HAS_VPCI_GUEST_SUPPORT is not currently used in the upstream
>>>>> code base. It will be used by the vPCI series [1]. This patch is intended to be
>>>>> merged as part of the vPCI series.
>>>>>
>>>>> v1->v2:
>>>>> * new patch
>>>>> ---
>>>>>     xen/arch/arm/Kconfig              | 1 +
>>>>>     xen/arch/arm/include/asm/domain.h | 2 +-
>>>>>     2 files changed, 2 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>>>> index 4e0cc421ad48..75dfa2f5a82d 100644
>>>>> --- a/xen/arch/arm/Kconfig
>>>>> +++ b/xen/arch/arm/Kconfig
>>>>> @@ -195,6 +195,7 @@ config PCI_PASSTHROUGH
>>>>>     	depends on ARM_64
>>>>>     	select HAS_PCI
>>>>>     	select HAS_VPCI
>>>>> +	select HAS_VPCI_GUEST_SUPPORT
>>>>>     	default n
>>>>>     	help
>>>>>     	  This option enables PCI device passthrough
>>>>> diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
>>>>> index 1a13965a26b8..6e016b00bae1 100644
>>>>> --- a/xen/arch/arm/include/asm/domain.h
>>>>> +++ b/xen/arch/arm/include/asm/domain.h
>>>>> @@ -298,7 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
>>>>>     #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag)
>>>>> -#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); })
>>>>> +#define has_vpci(d)    ({ (void)(d); IS_ENABLED(CONFIG_HAS_VPCI); })
>>>>
>>>> As I mentioned in the previous patch, wouldn't this enable vPCI
>>>> unconditionally for all the domain? Shouldn't this be instead an optional
>>>> feature which would be selected by the toolstack?
>>>
>>> I do think so, at least on x86 we signal whether vPCI should be
>>> enabled for a domain using xen_arch_domainconfig at domain creation.
>>>
>>> Ideally we would like to do this on a per-device basis for domUs, so
>>> we should consider adding a new flag to xen_domctl_assign_device in
>>> order to signal whether the assigned device should use vPCI.
>>
>> I am a bit confused with this paragraph. If the device is not using vPCI,
>> how will it be exposed to the domain? Are you planning to support both vPCI
>> and PV PCI passthrough for a same domain?
> 
> You could have an external device model handling it using the ioreq
> interface, like we currently do passthrough for HVM guests.

IMHO, if one decide to use QEMU for emulating the host bridge, then 
there is limited point to also ask Xen to emulate the hostbridge for 
some other device. So what would be the use case where you would want to 
be a per-device basis decision?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 11:29:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 11:29:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560447.876360 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHjeN-0005bO-JQ; Fri, 07 Jul 2023 11:29:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560447.876360; Fri, 07 Jul 2023 11:29:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHjeN-0005bH-Fq; Fri, 07 Jul 2023 11:29:23 +0000
Received: by outflank-mailman (input) for mailman id 560447;
 Fri, 07 Jul 2023 11:29:22 +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
 <SRS0=ujok=CZ=bombadil.srs.infradead.org=BATV+5a4ca43f00c3395d7048+7257+infradead.org+hch@srs-se1.protection.inumbo.net>)
 id 1qHjeK-0005bB-JA
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 11:29:22 +0000
Received: from bombadil.infradead.org (bombadil.infradead.org
 [2607:7c80:54:3::133])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 81c998c1-1cb9-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 13:29:18 +0200 (CEST)
Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat
 Linux)) id 1qHjdh-004Vpz-0w; Fri, 07 Jul 2023 11:28:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 81c998c1-1cb9-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version
	:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=RUfYUy8/J6JDn9FoGNDP036sYhvQ7qr7NPrif4Grdk0=; b=W8BupQP6fTnw1maVtPw7n0FTsE
	YYE/luqofOMT0IhbP2TwnItjey780Gaej+IMiW55ud+2XaULxiO0l44TVjXxHDze0xRAuH+mluyhr
	7ui49FHiGFXBu/ov7yuPVdyKZ6eJKL+3QsdTV3Gb1KlNN/rv7nlB69UacHrPvm/XuXzbJNEgBM50m
	lj+5xIDBkcqtRkKNokX0ONlo/QTCRQkdYA2xSwzuGzgo4ax7OTAfgkKR0gXaMSjd0fblhIFZkcy3O
	uLWO9DupcrKt+pDlGpSx+Miz6qpzw/HtoMbVHr58WOYYIaYLstJnc/oPaBlHCJkaDsT5H35KaxEXD
	vOIi6ADg==;
Date: Fri, 7 Jul 2023 04:28:41 -0700
From: Christoph Hellwig <hch@infradead.org>
To: Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@infradead.org>, linux-block@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Alasdair Kergon <agk@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anna Schumaker <anna@kernel.org>, Chao Yu <chao@kernel.org>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Dave Kleikamp <shaggy@kernel.org>, David Sterba <dsterba@suse.com>,
	dm-devel@redhat.com, drbd-dev@lists.linbit.com,
	Gao Xiang <xiang@kernel.org>, Jack Wang <jinpu.wang@ionos.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	Joern Engel <joern@lazybastard.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	linux-bcache@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org,
	linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org,
	linux-nilfs@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-pm@vger.kernel.org, linux-raid@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	"Md. Haris Iqbal" <haris.iqbal@ionos.com>,
	Mike Snitzer <snitzer@kernel.org>, Minchan Kim <minchan@kernel.org>,
	ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Song Liu <song@kernel.org>, Sven Schnelle <svens@linux.ibm.com>,
	target-devel@vger.kernel.org, Ted Tso <tytso@mit.edu>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions
Message-ID: <ZKf26fYMDHnTCb29@infradead.org>
References: <20230629165206.383-1-jack@suse.cz>
 <20230704122224.16257-1-jack@suse.cz>
 <ZKbgAG5OoHVyUKOG@infradead.org>
 <20230706161433.lj4apushiwguzvdd@quack3>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20230706161433.lj4apushiwguzvdd@quack3>
X-SRS-Rewrite: SMTP reverse-path rewritten from <hch@infradead.org> by bombadil.infradead.org. See http://www.infradead.org/rpr.html

On Thu, Jul 06, 2023 at 06:14:33PM +0200, Jan Kara wrote:
> > struct bdev_handle *bdev_open_by_path(dev_t dev, blk_mode_t mode,
> > 		void *holder, const struct blk_holder_ops *hops);
> > void bdev_release(struct bdev_handle *handle);
> 
> I'd maybe use bdev_close() instead of bdev_release() but otherwise I like
> the new naming.

We're using release everywhese else, but if Jens is fine with that I
can live with close.


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 11:34:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 11:34:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560452.876370 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHjjQ-00073O-5J; Fri, 07 Jul 2023 11:34:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560452.876370; Fri, 07 Jul 2023 11:34:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHjjQ-00073H-1p; Fri, 07 Jul 2023 11:34:36 +0000
Received: by outflank-mailman (input) for mailman id 560452;
 Fri, 07 Jul 2023 11:34:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=GM+b=CZ=citrix.com=prvs=545203e5e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qHjjO-00073B-UV
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 11:34:35 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3d28be6f-1cba-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 13:34:32 +0200 (CEST)
Received: from mail-mw2nam10lp2101.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.101])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 07 Jul 2023 07:34:29 -0400
Received: from MW4PR03MB6428.namprd03.prod.outlook.com (2603:10b6:303:123::8)
 by SA1PR03MB7099.namprd03.prod.outlook.com (2603:10b6:806:330::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 11:34:27 +0000
Received: from MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd]) by MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd%7]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 11:34:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3d28be6f-1cba-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688729672;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=GR5IYdmh6TQOjMrLF8R0lJMgoI+VtFW/s9rKqCaPGVQ=;
  b=AI0/G9+Vnfus0MZmtjBdMVF2JchvYfkJ9uh6ttFlZGiJ5k4cxSp227XA
   lHnCfoVU3IQJB2wSoQ6rugn69dig/fawyjXcV2SeGuVsJjCfgDr3xGYJC
   rsA+IFpqcJYHW+A4bw38vp7Mhz+DFI4glt8S5qpLoodxzaDWyJXp1KPHD
   c=;
X-IronPort-RemoteIP: 104.47.55.101
X-IronPort-MID: 115351495
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:QLX7L6xdJKTzeIJ3apx6t+eHxyrEfRIJ4+M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FG/Fw8P
 re5cjztCWE7gr5PUtKpTnuAsa9qB/nm6KdgrNhXotKPjOGhILAFugLh+aP/9SKIU3DH4BmpM
 NdWpk7JNrsDUVryebWiTPIdOrIGeP3kpxAU92uqktQcQ==
X-Talos-CUID: =?us-ascii?q?9a23=3AljqeYmiy2XuldI1E4VeNXTDzNDJuaHn5zUvBAR6?=
 =?us-ascii?q?DK284UbLSQ3Wp8phljJ87?=
X-Talos-MUID: =?us-ascii?q?9a23=3AEytDfwzMU/718l9S+XU6MA7VasCaqJioGlgsq5B?=
 =?us-ascii?q?BgfbeLzZBHjKtk2mrY4Byfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,187,1684814400"; 
   d="scan'208";a="115351495"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=d1DvLGLQmrK1kzGnEoCTq6Pi2r78R9jzJwwEGwQ4lFQdfpOhriOtxSotvafSOf3MGzd9PYm4kOWRCzwLwuazRpl+HgqMmAMXnXJ/4B7+C/S4jOkT9+qWeOe0yOFFeyVaXH8fbjTfvzSatgHIElaXLhaK7QUbfgGp2SxvehDCR7rywuX+RRKvMEY+RM5mtyGR33jz9Qsep+3DYiH7tTnApj+0gmp0cPVubxTtq+csNDgqTmSocpgF5tzAa5Sg1/pjsa+UQ4sngR5Fz+O7wD8XOnwdOssD/b92Us8aItwDgUrYdrhmGRCAJ/N11eqg7jq262MY/RpwTqb8oKvTntmBKQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=DurWbeeyEKMpKvrrR82mtF34tYjFqnwVfv5vmBT6u2k=;
 b=aZxDfAk5Y5hugShgIJixlLZpLcU5aWexSpVlkcXugr0Qt1Oy8tBy4ccYXVNnuWMx/vEa3jNAROEStb+zA1ku2CqR4ylQ8yhZJLQhiKQGkdvHl21J3n4ecnYQ0P3PSsLCgthch6/EkFDBr7rNHUaTgxTPXn6e1hRXR5FHVb9NsYaRVvadoMzbEETzzpV51q3hjyq4UYE0+/K/E/5HyM6tlxwFWj8SHBkG4QdioYuyHnh4s7lERSQt0Ct+ZW6ZOyoWgdSLEo9t1tU8pbo97bePu39GM3Myhjbb3rPaP1KA5R649lbXjRHMb6BLoXzHyDNYXjxY+NJpCeAJEEtIjzhc7w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=DurWbeeyEKMpKvrrR82mtF34tYjFqnwVfv5vmBT6u2k=;
 b=wlhsvRrkxatw6b7QLu6LMKFI/AUd8xn3xQuyFfM3SOaQBrFCu4gsnXy5K6VWigBf8z+nVgezxPW7AwrcvZ3RghEQYTYQAi3VJe+n3sZzow7u2DdOuTsSBPVGsQ9PE6oGkkHwB8I17mP9W5Fi/zaBwZwAF2Id3iYE8oXGUVkTuO0=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 7 Jul 2023 13:34:20 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Julien Grall <julien@xen.org>
Cc: Stewart Hildebrand <stewart.hildebrand@amd.com>,
	xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Artem Mygaiev <artem_mygaiev@epam.com>
Subject: Re: [PATCH v2 3/3] [FUTURE] xen/arm: enable vPCI for domUs
Message-ID: <ZKf4PMkKF3x2VwXl@MacBook-Air-de-Roger.local>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-4-stewart.hildebrand@amd.com>
 <e5a0ed8a-d85b-fb60-609a-f46884433c60@xen.org>
 <ZKfjoXqb6Kgav-vL@MacBook-Air-de-Roger.local>
 <04c05db8-1e15-f2c1-ebc1-0563d442a808@xen.org>
 <ZKftKtkjgFLWaW_x@MacBook-Air-de-Roger.local>
 <7f89a925-6c4e-7840-041b-2e0816ed7b71@xen.org>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <7f89a925-6c4e-7840-041b-2e0816ed7b71@xen.org>
X-ClientProxiedBy: LO4P265CA0295.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:38f::8) To MW4PR03MB6428.namprd03.prod.outlook.com
 (2603:10b6:303:123::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MW4PR03MB6428:EE_|SA1PR03MB7099:EE_
X-MS-Office365-Filtering-Correlation-Id: 91db85cb-2269-4172-32c7-08db7ede1ec6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	yPrhxE5fdgti9+6rhhHAls/thDng8q5TXttnJPAX7dTNsRqEk12SGvLbHyDCa9tX+cNiaX2waJpOYUaIAiChqxtMWxAMXAJVNoVWKPx4udqDQEGwak0E+b5Eof1AMllSmIyHkRg2bNuQDCSjCZekB2hScDfkliJmRhqtQMVvEfPVI7fgPPxL7ge5RwVBmDKk7ketzUBwfUbZO2mejaDn32SJ+10kVMqfSNSsq4I+Geox/GNATHLIIW/HYkuyIIUYsVZMaCakXkLEwWWEfy9yXBkXbH8eP1rIxSvdW58oCgkiso8p+qM5eRRDoaNPVCipTsVEGznVzNhNZA7WpRhBqxJMHxAsabwTAD8otXGgFKwsLImOISM+ZXU958a6XgIDKAqBfRbeXuKms30gKeDiSmXg2oorcsFrT2notpmc44oI/eSULGa4J3wNfIBCQxJY8wP/OzZPP9ybDukietJJkVSy++k7niTcy2zbMahGh8QWkeqiN4RVahpsIQ9D5gHf0n07TioEZ6IqkfDerIusaqOxzWNWcR6KTdB6qGFOxiLelC6fYxPj+uyEQAgjQX8R
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR03MB6428.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(366004)(346002)(396003)(39860400002)(451199021)(66899021)(2906002)(41300700001)(5660300002)(8936002)(8676002)(85182001)(86362001)(6666004)(82960400001)(478600001)(6486002)(53546011)(9686003)(6506007)(26005)(186003)(6512007)(66476007)(4326008)(6916009)(66946007)(66556008)(316002)(54906003)(38100700002)(83380400001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VTRiUnhXaFdtMy9UblBnU05oMVE5K0NYZ1JQc0grbVNWeFhJTTZRcDdEenUr?=
 =?utf-8?B?TUFzbEFUY0ZsUWs3WE92dFh3bE9mdm9oM3YwbDZaUnFKbkNHbGVWVHhQbGo5?=
 =?utf-8?B?VGhUSUNURG1maTVhNWRTT2tuYXJ2dTF5VmViY2JxN1NQc21NWXo3RmNqQS9O?=
 =?utf-8?B?Y2hZbXN4cFFjc1JyTTJMMXpqL3ZZTFRiNEtLSWJjQTIyVzdBZjl2TWNHTVU1?=
 =?utf-8?B?R2lWYnJRbU5uMTJONVh5MkNwckZ3ZmdZNVpFcFVYZDd4c1Z0VzNZejZtTDB0?=
 =?utf-8?B?M2pwSitwZ3ZWdkxBRm84VjZNSGZyTFJNUT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EvxMQHH3pIhEr7wgipzHtrpLuyPm6OOC+9smpfitsV2GcRx5d4fNG19xMIzp6bwEKIE+zp4RpzM0K6fMNHGQ==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 91db85cb-2269-4172-32c7-08db7ede1ec6
X-MS-Exchange-CrossTenant-AuthSource: MW4PR03MB6428.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 11:34:26.9872
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: RIFx78VWbkHmPUEFTwP5RlEX9euxcmJIwE02dcUUOhtXg+lkFbTr7XzcMQdZqvwUow7R9evNPq36/HDRdsPMOQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB7099

On Fri, Jul 07, 2023 at 12:16:46PM +0100, Julien Grall wrote:
> 
> 
> On 07/07/2023 11:47, Roger Pau MonnÃ© wrote:
> > On Fri, Jul 07, 2023 at 11:33:14AM +0100, Julien Grall wrote:
> > > Hi,
> > > 
> > > On 07/07/2023 11:06, Roger Pau MonnÃ© wrote:
> > > > On Fri, Jul 07, 2023 at 10:00:51AM +0100, Julien Grall wrote:
> > > > > On 07/07/2023 02:47, Stewart Hildebrand wrote:
> > > > > > Note that CONFIG_HAS_VPCI_GUEST_SUPPORT is not currently used in the upstream
> > > > > > code base. It will be used by the vPCI series [1]. This patch is intended to be
> > > > > > merged as part of the vPCI series.
> > > > > > 
> > > > > > v1->v2:
> > > > > > * new patch
> > > > > > ---
> > > > > >     xen/arch/arm/Kconfig              | 1 +
> > > > > >     xen/arch/arm/include/asm/domain.h | 2 +-
> > > > > >     2 files changed, 2 insertions(+), 1 deletion(-)
> > > > > > 
> > > > > > diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> > > > > > index 4e0cc421ad48..75dfa2f5a82d 100644
> > > > > > --- a/xen/arch/arm/Kconfig
> > > > > > +++ b/xen/arch/arm/Kconfig
> > > > > > @@ -195,6 +195,7 @@ config PCI_PASSTHROUGH
> > > > > >     	depends on ARM_64
> > > > > >     	select HAS_PCI
> > > > > >     	select HAS_VPCI
> > > > > > +	select HAS_VPCI_GUEST_SUPPORT
> > > > > >     	default n
> > > > > >     	help
> > > > > >     	  This option enables PCI device passthrough
> > > > > > diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
> > > > > > index 1a13965a26b8..6e016b00bae1 100644
> > > > > > --- a/xen/arch/arm/include/asm/domain.h
> > > > > > +++ b/xen/arch/arm/include/asm/domain.h
> > > > > > @@ -298,7 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
> > > > > >     #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag)
> > > > > > -#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); })
> > > > > > +#define has_vpci(d)    ({ (void)(d); IS_ENABLED(CONFIG_HAS_VPCI); })
> > > > > 
> > > > > As I mentioned in the previous patch, wouldn't this enable vPCI
> > > > > unconditionally for all the domain? Shouldn't this be instead an optional
> > > > > feature which would be selected by the toolstack?
> > > > 
> > > > I do think so, at least on x86 we signal whether vPCI should be
> > > > enabled for a domain using xen_arch_domainconfig at domain creation.
> > > > 
> > > > Ideally we would like to do this on a per-device basis for domUs, so
> > > > we should consider adding a new flag to xen_domctl_assign_device in
> > > > order to signal whether the assigned device should use vPCI.
> > > 
> > > I am a bit confused with this paragraph. If the device is not using vPCI,
> > > how will it be exposed to the domain? Are you planning to support both vPCI
> > > and PV PCI passthrough for a same domain?
> > 
> > You could have an external device model handling it using the ioreq
> > interface, like we currently do passthrough for HVM guests.
> 
> IMHO, if one decide to use QEMU for emulating the host bridge, then there is
> limited point to also ask Xen to emulate the hostbridge for some other
> device. So what would be the use case where you would want to be a
> per-device basis decision?

You could also emulate the bridge in Xen and then have QEMU and
vPCI handle accesses to the PCI config space for different devices.
The ioreq interface already allows registering for config space
accesses on a per SBDF basis.

XenServer currently has a use-case where generic PCI device
passthrough is handled by QEMU, while some GPUs are passed through
using a custom emulator.  So some domains effectively end with a QEMU
instance and a custom emulator, I don't see why you couldn't
technically replace QEMU with vPCI in this scenario.

The PCI root complex might be emulated by QEMU, or ideally by Xen.
That shouldn't prevent other device models from handling accesses for
devices, as long as accesses to the ECAM region(s) are trapped and
decoded by Xen.  IOW: if we want bridges to be emulated by ioreq
servers we need to introduce an hypercall to register ECAM regions
with Xen so that it can decode accesses and forward them
appropriately.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 11:35:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 11:35:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560456.876379 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHjkK-0007bU-DP; Fri, 07 Jul 2023 11:35:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560456.876379; Fri, 07 Jul 2023 11:35:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHjkK-0007bN-AS; Fri, 07 Jul 2023 11:35:32 +0000
Received: by outflank-mailman (input) for mailman id 560456;
 Fri, 07 Jul 2023 11:35:31 +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
 <SRS0=pfgb=CZ=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qHjkI-0007b9-SP
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 11:35:31 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on2061b.outbound.protection.outlook.com
 [2a01:111:f400:fe5b::61b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5e816511-1cba-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 13:35:28 +0200 (CEST)
Received: from DM6PR02CA0147.namprd02.prod.outlook.com (2603:10b6:5:332::14)
 by DS0PR12MB9274.namprd12.prod.outlook.com (2603:10b6:8:1a9::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.25; Fri, 7 Jul
 2023 11:35:24 +0000
Received: from DM6NAM11FT062.eop-nam11.prod.protection.outlook.com
 (2603:10b6:5:332:cafe::50) by DM6PR02CA0147.outlook.office365.com
 (2603:10b6:5:332::14) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.25 via Frontend
 Transport; Fri, 7 Jul 2023 11:35:24 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 DM6NAM11FT062.mail.protection.outlook.com (10.13.173.40) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6521.45 via Frontend Transport; Fri, 7 Jul 2023 11:35:23 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 7 Jul
 2023 06:35:22 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.23 via
 Frontend Transport; Fri, 7 Jul 2023 06:35:21 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5e816511-1cba-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=SxfzvCKG+Zx440jCHSSo0SbU6Xb615XwCPLyQvWDqLMIPGwpDQv2z7IV7TBfwcQHQebULrNSKtGaZuw5JEcTtUtpBMyfKeiYSIebhEiRNlGPYO9vU3MS0xhIiqwJ8CJE2ty7T2ZrSTB8DPLRUStqDHuv3LKOtTyt4e5CxJSirWEPmFmRPs42QF3HfIfX2o3RwaIFf6y4h2n5fDPIamJwFKinIpvD36PQfiIm0TlTqo5yRlLqoHoEzL4XXD28bVFMqAL0u5CJU5UikwWqESsjzMB0HffB4KtOIqTxP+6KmHUDKSPaRLk25mKys8l344l0zfkUoGRUANLgWLHgRvjupQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+toFDaRSBfCS38slBFO2OskFD6oNPXp01PvW1Wj0lNU=;
 b=jkzUihk9dvtwyRgF2w4Ue9dMNT7C2tL93qGhokz8C5/Hi9n7EgR4fAehouir0msu23PFfawSCDD6MVHybBLqJyqPS0LOR/NStNBMBRdVCrRryQ7AHDM7WM0yKmXcmZi2cwP+BxdYDrjsDKELxIb8Pla5iZtzcPmwqS60gRC7TTV6Aymf6jjLVCZ5O8pvbpwvykV2QtTIu382fQ0Crg/ZJzLWoPKmMZrcgPZP/shFIkG1pOxxHttqDDJdXhycv/cGjRw42U5o/CBXmRdWq7kMX7CzOJpzc/h7unqMMYm2CcaLDjNdtWRidh9xoT6NcQTTSqJEGs9expDZpfK9Nhcq4Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+toFDaRSBfCS38slBFO2OskFD6oNPXp01PvW1Wj0lNU=;
 b=l2NCqxCSWV5o8je7BtiakAjR2QoYlEQWDdtn9cIGFbso7dC1qijaXBLwZ62T3BTqLh5ArdzqHzppLCV5/qfW0WYXDxJml+Np4Xy8OWoygQG3Sl/5Rx71UTluKZ5/2e/N4A3IbvFEBWiij1iJK1fEFVDsK+lzF2QX4gvMf604vjI=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: <sstabellini@kernel.org>, <stefano.stabellini@amd.com>,
	<andrew.cooper3@citrix.com>, <george.dunlap@citrix.com>, <jbeulich@suse.com>,
	<julien@xen.org>, <wl@xen.org>, Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: [PATCH v1] xen/drivers: ns16550: Fix the return logic for pci_uart_config()
Date: Fri, 7 Jul 2023 12:35:18 +0100
Message-ID: <20230707113518.141489-1-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DM6NAM11FT062:EE_|DS0PR12MB9274:EE_
X-MS-Office365-Filtering-Correlation-Id: 2342386b-ed0e-4ff2-670c-08db7ede4064
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	6Onc2pSqnChgPLpXOFQlV+smTkTCgjALAe61F7MqRkkU2HLCAh38nEfRZxeVZM5c/tLJn9NkuV9LWX1ZnIT7h7iqW/F9NFS1TpVJ9S30cPkx8/2efEo/DgAT3k9tsZwdSlmoWD4r5wbXogQ7F5t0fh+yA6IfmST+uKggjVMf/yyYBh47aomXBbKZ/dhw3QKbmEi9Tn7tRnXT7u79oiMrqCsEbKSRHLWnDOZnwhjcyk7Wvj0zY62qmwOOSpx6IS5N+Ux2LhZFRYkRu12n1w46tSfL2vorsuqeNdRhcBVulu350l3pSZKo48XCZ+owLjzgoOMJUH9C62Djo14qCj+CcsKuRFrW8oPnqLf35hiUG3E/lGSCZ+8VBoeTxP5LoYFiK0CtacETkawpVgIbpaNQEfRrf2PMxHrhp+bL35zjFbeoWsb0lrDI3rmC/bTBrn2lre76/FNuizkUHPssCYordxahY+O8cLYHZ7imilgqRb+sIM5B/4fpJ372lvdy76J67lDQEP9RiCI3ahDpfwumXfnVxijlvvtTXdp4sshbVtuJal2YhW2Thm9GQKADKaryUE63je8A2aZZBsuYI82+7C8le/Z4/jTtoHfvHMPx6qUZuJKJkyFppZwfU/mJ4CtOtQe/hr4Zs+xWzvckUK0yH+plbQNxNvNYXR6SmjIVZTfeBkjmLPA66Ne+4ASU+GpX3jvnv5TVJAXQgNIHA8RDTugXRKmbeBHbysSMJPJnj27lR5s00wMorlipirS6eKns
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(396003)(39860400002)(136003)(451199021)(46966006)(40470700004)(36840700001)(6666004)(478600001)(70586007)(54906003)(1076003)(26005)(186003)(966005)(70206006)(336012)(2906002)(82310400005)(41300700001)(316002)(6916009)(4326008)(5660300002)(8936002)(8676002)(81166007)(356005)(82740400003)(86362001)(36756003)(103116003)(47076005)(36860700001)(2616005)(83380400001)(426003)(40480700001)(40460700003)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 11:35:23.0437
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 2342386b-ed0e-4ff2-670c-08db7ede4064
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DM6NAM11FT062.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9274

pci_uart_config() should return 0 when it probes the correct uart device and
sets the properties of "struct ns16550". Else, it should return -ENODEV.
Also before returning -ENODEV, it should restore the value of uart->io_base.

The callers should check if pci_uart_config() has returned 0 (for success) or
not.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
This was based on a discussion "[XEN v4 04/11] xen/drivers: ns16550: Use paddr_t for io_base/io_size"

https://patchew.org/Xen/20230321140357.24094-1-ayan.kumar.halder@amd.com/20230321140357.24094-5-ayan.kumar.halder@amd.com/

 xen/drivers/char/ns16550.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 212a9c49ae..5a35498a06 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1342,13 +1342,9 @@ pci_uart_config(struct ns16550 *uart, bool_t skip_amt, unsigned int idx)
         }
     }
 
-    if ( !skip_amt )
-        return -1;
-
-    /* No AMT found, fallback to the defaults. */
     uart->io_base = orig_base;
 
-    return 0;
+    return -ENODEV;
 }
 
 static void enable_exar_enhanced_bits(const struct ns16550 *uart)
@@ -1527,13 +1523,13 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
 #ifdef CONFIG_HAS_PCI
         if ( strncmp(conf, "pci", 3) == 0 )
         {
-            if ( pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com) )
+            if ( !pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com) )
                 return true;
             conf += 3;
         }
         else if ( strncmp(conf, "amt", 3) == 0 )
         {
-            if ( pci_uart_config(uart, 0, uart - ns16550_com) )
+            if ( !pci_uart_config(uart, 0, uart - ns16550_com) )
                 return true;
             conf += 3;
         }
@@ -1642,13 +1638,17 @@ static bool __init parse_namevalue_pairs(char *str, struct ns16550 *uart)
         case device:
             if ( strncmp(param_value, "pci", 3) == 0 )
             {
-                pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com);
-                dev_set = true;
+                if ( !pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com) )
+                    dev_set = true;
+                else
+                    return false;
             }
             else if ( strncmp(param_value, "amt", 3) == 0 )
             {
-                pci_uart_config(uart, 0, uart - ns16550_com);
-                dev_set = true;
+                if ( !pci_uart_config(uart, 0, uart - ns16550_com) )
+                    dev_set = true;
+                else
+                    return false;
             }
             break;
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 07 11:37:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 11:37:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560463.876390 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHjmP-0008Gv-UX; Fri, 07 Jul 2023 11:37:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560463.876390; Fri, 07 Jul 2023 11:37:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHjmP-0008Go-Rg; Fri, 07 Jul 2023 11:37:41 +0000
Received: by outflank-mailman (input) for mailman id 560463;
 Fri, 07 Jul 2023 11:37:40 +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
 <SRS0=pfgb=CZ=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qHjmO-0008Gi-Rm
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 11:37:40 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on20631.outbound.protection.outlook.com
 [2a01:111:f400:7eaa::631])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ac3d26fc-1cba-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 13:37:38 +0200 (CEST)
Received: from SN6PR12MB2621.namprd12.prod.outlook.com (2603:10b6:805:73::15)
 by CH3PR12MB9021.namprd12.prod.outlook.com (2603:10b6:610:173::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 11:37:34 +0000
Received: from SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54]) by SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54%2]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 11:37:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ac3d26fc-1cba-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=VsDqrYMs3ISP2aj+niy5pl2U0yPKpvkSuRy2v0VsEmTq3qgrS+cuO6BM5MTp765X1zYIiT/lNjcYoXEbgm8jtTHupevhDaNVezwKgJlMxR8sg/9vcR4yTvvNR672ky/YCmHUKhjQ0dZPqldUE1gsqtwwLqVUc95EBYeK+2OyGMaXukU6rrE4cIcoBFcxwa5vbayKj8c3MmrJ7kVUko+rAn2SLO9HZnVPogMXtAefEKRBdmh/Dsx5PIJyJbsuBEFTQr24sVKMQJsqZt7psP2oyxvnEYQZTN++BixtdJOV9tXqxqkDLbofVACCVzxsiuhIMKdj2frQrRa7nicOlo4Sqw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ZhM+4wBjZJSY0wYbKlsb1O357a+vxR34+mTXCfmjACM=;
 b=KcqnozKYi/I92YcW8LJKkVxsSRmRj4/0qjb/i7b8if1lCxmbmJRy4MZBXeTn4lGbhdbMSQ1fLAR7Sa8H/AjBU8KPk39POAeb/JeY3McYmQJ5QIWaZ5UR5v18W94/NMDHsywEfhAt6wu0I5BUZLavpiiTEtKU1fX3zEUgnfFXm7q+J0anUGh3RtTMHo4vV6VBUeiBYVEY9d/Ts+EObvTR1HwkKax4+M8orwrsubyKgoDoLo4bibCnJ4Js/axy1tFSJdmeWI7KHXSXrLliXkjPnUpAmGzSfItmMNs5M3M1GdPHCClk+tbmZ0Ww1oOPaR/hsG1vMJ5IjjJp7WNx30OMgg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ZhM+4wBjZJSY0wYbKlsb1O357a+vxR34+mTXCfmjACM=;
 b=SjR7ae38ZjMf3ZonOk5WCLWm48ez6j/g9NrkoIVqn9PrZDCxFHYey3XdA86aQ693sfYnmkgLUUOTiQn/jrHJ6jC/9xgi81Iq91491mdifjZu8Ux0Auw4isRcAPsCKNZyTKF14/Wvd0uaZogFClGTjec+EKD+SdXshhHrGzS+Oek=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <915c6a26-f85c-7be6-85be-e8fe6a779347@amd.com>
Date: Fri, 7 Jul 2023 12:37:26 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [XEN v4 04/11] xen/drivers: ns16550: Use paddr_t for
 io_base/io_size
To: Jan Beulich <jbeulich@suse.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: sstabellini@kernel.org, stefano.stabellini@amd.com, julien@xen.org,
 Volodymyr_Babchuk@epam.com, bertrand.marquis@arm.com,
 andrew.cooper3@citrix.com, george.dunlap@citrix.com, wl@xen.org,
 rahul.singh@arm.com, xen-devel@lists.xenproject.org
References: <20230321140357.24094-1-ayan.kumar.halder@amd.com>
 <20230321140357.24094-5-ayan.kumar.halder@amd.com>
 <197973ce-2361-f3e4-fd38-40b4ad802acf@suse.com>
 <3e403b20-fa1a-5e0c-8e14-b89afbb10a0f@amd.com>
 <6196e90f-752e-e61a-45ce-37e46c22b812@suse.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <6196e90f-752e-e61a-45ce-37e46c22b812@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P265CA0181.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:a::25) To SN6PR12MB2621.namprd12.prod.outlook.com
 (2603:10b6:805:73::15)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN6PR12MB2621:EE_|CH3PR12MB9021:EE_
X-MS-Office365-Filtering-Correlation-Id: 83b136ad-87cf-46f1-c6dc-08db7ede8e4f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	N1rN/zfSY1Njq0NDDvv2qiEApBC6P975p22i80DAYl9LshQQbb7wW2Cxv2PkyBg8k7FzACX2j1whmBSYa40DRe/eB8HegNBer360+aggj7Eownorg3ZbSIUcziCaMosXbKR2qDF/AWkkXpvVHpABuTwPz8Um9xaqeb+XxjyTQjRdDzSt21rwy4f220NVIY8DLPBSbZCZoMEIQlU51HfAGwkfWuIf/RpPF0vWbO45yPtgWdP4flPD26Rh1qXfi8E12ebOLVWJtO9HACrXs7ZW3kaCUl5ngYmOBR7YIW2GvxSm+AQpV6W5MYWimTSv8GoGCwVOFYkP15SwNId7D9jxjstGRVohxkrqVoSvHVNdB8ojBGRF5Z8zCb3nI0PMpckwBTCs4yjvovmA4+jQqI6Eu6NCFloWxUgs0iGhhkfnOakWNNWPdzhvAaxj4S4O0DV4SPpXbBKptgV6ax0n6JQS+BdRdA1l0Ol570ON2ic7JGIcLSjonT8Tg32Kjp42ziKWj11tvXr5UC7/LTATskVSCf4fmFFcYTvEYf5jAc7goTrK/0UMp+sfJ36WfHd4JxAqE7L13CuLLhE474hrX0wkKR82HCbxWdXglRCQSeTw5wfgWV+6ueR8k+8SMWuffIS20s8/xW+KmtQmIg8JI7dEEg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2621.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(136003)(376002)(39860400002)(346002)(451199021)(41300700001)(5660300002)(110136005)(316002)(2906002)(8936002)(7416002)(8676002)(31686004)(6486002)(66476007)(6636002)(4326008)(66556008)(36756003)(6666004)(478600001)(83380400001)(186003)(31696002)(38100700002)(66946007)(2616005)(26005)(6512007)(6506007)(53546011)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UnQzcDI1VkozYnNEV3Q0MmNiRFM2bzJDOXpCYVM2eUd0WmxIUHNjWWdMVHZj?=
 =?utf-8?B?b1pQMXowVFpRdnl3VzV2a25EWUxzYUtWR0xVN2pSQ2xPOThJbTlMOGZlQkhx?=
 =?utf-8?B?NE93dk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
 =?utf-8?B?b3NTektnR2VGdkhaWmxXQzFycDR3d0pUTHZaYkE5M1hiQVhkTlpOMDA0eTly?=
 =?utf-8?B?ZFpTWCtOODhvUXBRYllmdG43M0p5ZFpRNzFCRXhwc2ZCaTlVZVlZUUdhYVhm?=
 =?utf-8?B?K3Qrd1dMWHhSTGpadCthK0FiQVFaQjdEMXR2YjQwRDdLTDJiVVdtNGFHeEs3?=
 =?utf-8?B?RUxBb3cwUmtwTTk5SkZQNEhPMEJLVVM5R2ZyZXNkNXU5cU5iQnQ1K0JEd08x?=
 =?utf-8?Q?9xUocVWRuQu1MkzGhT8Su3PaS?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 83b136ad-87cf-46f1-c6dc-08db7ede8e4f
X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2621.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 11:37:34.1107
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: denJIuUFc1Oo4Ypu20Bd0ZWlhyrrBXrVco/Ej9UqmZz8WqiZZRuN1XBHAd6Y7P5AD7ZnYUbhsI+N0qheQg86mg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9021

Hi Jan,

On 30/03/2023 07:55, Jan Beulich wrote:
> On 29.03.2023 16:35, Ayan Kumar Halder wrote:
>> Please let me know if the below patch looks fine.
> Apart from the comments below there may be formatting issues, which
> I can't sensibly comment on when the patch was mangled by your mailer
> anyway. (Which in turn is why it is generally better to properly send
> a new version, rather than replying with kind-of-a-new-version on an
> earlier thread.)
>
> Additionally, up front: I'm sorry for the extra requests, but I'm
> afraid to sensibly make the changes you want to make some things need
> sorting first, to avoid extending pre-existing clumsiness. This is
> irrespective of the present state of things clearly not being your
> fault.
>
>> @@ -1235,6 +1235,8 @@ pci_uart_config(struct ns16550 *uart, bool_t
>> skip_amt, unsigned int idx)
>>   Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  /* MMIO based */
>>   Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  if ( param->mmio && !(bar & PCI_BASE_ADDRESS_SPACE_IO) )
>>   Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  {
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  uint64_t pci_uart_io_base;
>> +
>>   Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  pci_conf_write32(PCI_SBDF(0, b, d, f),
>>   Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  PCI_BASE_ADDRESS_0 + bar_idx*4, ~0u);
>>   Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  len = pci_conf_read32(PCI_SBDF(0, b, d, f),
>> @@ -1259,8 +1261,17 @@ pci_uart_config(struct ns16550 *uart, bool_t
>> skip_amt, unsigned int idx)
>>   Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  else
>>   Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  size = len & PCI_BASE_ADDRESS_MEM_MASK;
>>
>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  uart->io_base = ((u64)bar_64 << 32) |
>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  (bar & PCI_BASE_ADDRESS_MEM_MASK);
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  pci_uart_io_base = ((uint64_t)bar_64 << 32) |
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  (bar & PCI_BASE_ADDRESS_MEM_MASK);
>> +
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  /* Truncation detected while converting to paddr_t */
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  if ( pci_uart_io_base != (paddr_t)pci_uart_io_base )
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  {
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  printk("ERROR: Truncation detected for io_base
>> address");
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  return -EINVAL;
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  }
> Further down the function returns -1, so here you assume EINVAL != 1.
> Such assumptions (and mixing of value spaces) is generally not a good
> idea. Since there are other issues (see below), maybe you really want
> to add a prereq patch addressing those? That would include changing the
> "return -1" to either "return 1" or making it use some sensible and
> properly distinguishable errno value.
>
>> @@ -1519,20 +1530,40 @@ static bool __init parse_positional(struct
>> ns16550 *uart, char **str)
>>   Â #ifdef CONFIG_HAS_PCI
>>   Â Â Â Â Â Â Â Â  if ( strncmp(conf, "pci", 3) == 0 )
>>   Â Â Â Â Â Â Â Â  {
>> -Â Â Â Â Â Â Â Â Â Â Â  if ( pci_uart_config(uart, 1/* skip AMT */, uart -
>> ns16550_com) )
>> +Â Â Â Â Â Â Â Â Â Â Â  int ret;
>> +
>> +Â Â Â Â Â Â Â Â Â Â Â  ret = pci_uart_config(uart, 1/* skip AMT */, uart -
>> ns16550_com);
>> +
>> +Â Â Â Â Â Â Â Â Â Â Â  if ( ret == -EINVAL )
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  return false;
>> +Â Â Â Â Â Â Â Â Â Â Â  else if ( ret )
>>   Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  return true;
> With skip_amt != 0 the function presently can only return 0. You're
> therefore converting pre-existing dead code to another form of dead
> code. Otoh (and as, I think, previously indicated) ...
>
>> +
>>   Â Â Â Â Â Â Â Â Â Â Â Â  conf += 3;
>>   Â Â Â Â Â Â Â Â  }
>>   Â Â Â Â Â Â Â Â  else if ( strncmp(conf, "amt", 3) == 0 )
>>   Â Â Â Â Â Â Â Â  {
>> -Â Â Â Â Â Â Â Â Â Â Â  if ( pci_uart_config(uart, 0, uart - ns16550_com) )
>> +Â Â Â Â Â Â Â Â Â Â Â  int ret = pci_uart_config(uart, 0, uart - ns16550_com);
>> +
>> +Â Â Â Â Â Â Â Â Â Â Â  if ( ret == -EINVAL )
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  return false;
>> +Â Â Â Â Â Â Â Â Â Â Â  else if ( ret )
>>   Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  return true;
> ... the equivalent of this in parse_namevalue_pairs() not checking
> the return value is bogus. But it is further bogus that the case
> where skip_amt has passed 1 for it sets dev_set to true
> unconditionally, i.e. even when no device was found. IOW I also
> question the correctness of the final "return 0" in pci_uart_config().
> I looks to me as if this wants to be a skip_amt-independent
> "return -ENODEV". skip_amt would only control whether uart->io_base is
> restored before returning (leaving aside the question of why that is).

I have sent out a patch to fix the return logic pci_uart_config()

[PATCH v1] xen/drivers: ns16550: Fix the return logic for pci_uart_config()

Let me know if I understood you correctly.

- Ayan

>
> Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 11:46:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 11:46:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560467.876400 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHjuE-0001M9-Nz; Fri, 07 Jul 2023 11:45:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560467.876400; Fri, 07 Jul 2023 11:45:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHjuE-0001M2-L7; Fri, 07 Jul 2023 11:45:46 +0000
Received: by outflank-mailman (input) for mailman id 560467;
 Fri, 07 Jul 2023 11:45:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ruU0=CZ=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qHjuD-0001Lw-Jz
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 11:45:45 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on20617.outbound.protection.outlook.com
 [2a01:111:f400:fe13::617])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ce3f046c-1cbb-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 13:45:44 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8320.eurprd04.prod.outlook.com (2603:10a6:102:1cf::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 11:45:41 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Fri, 7 Jul 2023
 11:45:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ce3f046c-1cbb-11ee-b237-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=XSzOvlE/IdgpWQKQ6hf++BsQVZBszl+nqJSDEHOiWsD0uTWjpMwOHH/LSbKzfvH3Gvs9GukwHZlSSkpSHkKDyCvU+4oM4wm4YHwYaeu7x2eTIbW2yptzHjDNsgY3fH/8rzgwfLtj2h3/gpeSOX3e1MoQxbqTkm9JNQQkUXo7rxfT2I3jrcWgn4f/ZwH43LedA5T27QXtJ63z6sfTop0NDvTdAR1MT6OEmLb6hrjpftwSxsnwWgXJ9EdfX80QoIf4Xxl6M1ZuaCwxNLD2Kuz6jfhr40LjLLEgiZ3/da0c1EwaHjj8rsHhribOcTUJAJEaeJRp4F11BefFbwc8B7jh+Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=xjLq5P5nC6V2RHzAV3Ba2MVBfctPT2FEJss+T23KNBE=;
 b=Vqk9pqcQ/trR+b/hYV95UReHCqfcucnbzl3SEJ/8W4YDxrlooBhWHqBpSIJJZU7STXECJ2bwgdaV/Q0roKleS+LpbKLeHap+VGCmD31UsbgsyayFSwU+Na+lqnb7ud1JxFoMzIRxmsoEhJXA0EkH+zTvOipla5LIdd9AgOhc40ccExSIKWIs8qdBz669WmDLu14emxkk/1SD6HGzXhIGYHiTSFTjIOaQnsDpgxv6H+0z2RrCOZvw5n4B8UyJjqu4HJokwZYYccxkdrMiCBimU4qB5CpvdcH3fo94pYCjnSMJ3soOfblttindZQoJKA2yCEnOGsT5NhQCQL1JLW17UQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=xjLq5P5nC6V2RHzAV3Ba2MVBfctPT2FEJss+T23KNBE=;
 b=k9MO/0erDt8g+pljmziMXYLKk7bmgm6tPjD4RPFiZrglNK3oOF3wypOf4cYbuLTWbEX0Mjt0CNYg0/yTkiLpmumkZ+UIMXy1EskpuFdHr0Kq2CH0EV0UaKsf0t0XDWZWca/mzDfnYKfnp2aYIpxPLVg6LuitBqZ7Fv70t1G8l6zlr0541NKBJlbppd4dxnNwDhGHNPFN3ofNQb/6hiT8lj7KGUogGUgHIBJe9E8iqru1qFAW2JLtuABsjwX/mxjZoTvR75hQ5kc5G/TPw3rlf8zVPPCfwKnswSoX2Ym20UJtQ8sPBPNW6a6Bg/E3at0gB2OJlVq5L2Ex8KzIz+Xl7g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <28e2fc47-aada-e394-35b3-252bd1c6d720@suse.com>
Date: Fri, 7 Jul 2023 13:45:39 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: Detecting whether dom0 is in a VM
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: George Dunlap <george.dunlap@cloud.com>
Cc: zithro <slack@rabbit.lu>, xen-devel@lists.xenproject.org
References: <CA+zSX=Y4MwsDSd9oSG1NQyt==YAw9SeRdh=eJxTUhhOx57ihWg@mail.gmail.com>
 <4ee01a0f-063e-ef93-ac24-da387d5b3438@rabbit.lu>
 <a680ae62-7765-aa51-1edd-9a1a7e39e449@suse.com>
 <20b1a79c-23c1-93bc-2090-8052f143422c@rabbit.lu>
 <27a3e6a2-b150-1d75-c86f-dfa2b906b298@suse.com>
 <CA+zSX=ZCmmKQX7acx-oK4nSki9ONscxLP7E8t8USjdjXJ9UDpA@mail.gmail.com>
 <495946e9-191f-22fe-9ecf-08eb5af833ba@suse.com>
In-Reply-To: <495946e9-191f-22fe-9ecf-08eb5af833ba@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0052.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:48::20) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8320:EE_
X-MS-Office365-Filtering-Correlation-Id: 5f7135a3-3472-4e83-c331-08db7edfb0f8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	ohQyEoxj69S0nCsQILVrtyGkA1RqIa/RigJLiMp6rT/fbFgmsab6TbAbyx89AOs5CwW9mnHtcmFb5BDbN+0qpfjgoWjZ/KBSYFTYNz3su/WKDgVtN1heOEymJ4HL6It3/k5iD02wR9YqDHbaWtfsGvAZhcAnS+SPF5ROF6QNEkLYlj1OFBxPRnuBGjvSuzU/18diHQ5bAwGv0jiyE+GyF0td0HSZb3rFPpH0WKs3v8DJjYgVPlqFK1KBM/1OgclTgGMAJlAA7miEhm1CG6DDMFHOTxuBDUxiRubt/ecp4DTPVD1KTU8cAX7hPR+cQMrWCNlZhWIr2pF3QnZYATnG+oyF2tqSh7WmY3m3iGOIYlgYPJuVFZUZ/5MKtYO1SZYYyHHyPqmg0QOXeIcF+TpXk7yQY0Ku9LKJIAy04Nn7F8TVF//vs3KfWg6HduFxxBTa9/TkuVBXh5y8qoqaw233JWVP1bkYwN7TMttqSdGsLcBk3nJK7HvWlgM0SxYFQa7ixUPSbEsdmz9FTCda6nxafVf0DzGkJTd+wBka7jAt65j39B/ThFAOGhw60gi1rlYPFm0mW0yXRkFMWiWo6beyYc8huwtOhfDuR8znP9i4p3qkZl/QbYK/jqRK6YN8tXuPuwKdE64+Fodwc3eaRFUzAw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(136003)(346002)(39860400002)(376002)(396003)(451199021)(66946007)(4326008)(66476007)(6916009)(31686004)(186003)(478600001)(26005)(86362001)(31696002)(66556008)(2616005)(53546011)(6506007)(5660300002)(83380400001)(36756003)(8936002)(8676002)(38100700002)(66899021)(316002)(6486002)(2906002)(41300700001)(6512007)(966005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NzRIY0Fncjg4dCsyK1hZWDBLVXU4WGQrM2lkbUljdS9oYm9QdUxmS1NJQzMv?=
 =?utf-8?B?RXkrS09xMktPSGoweEwvYUdTNXNjKzRBSWdodDlIcTM1ekx2WWtmcjZzaXg0?=
 =?utf-8?B?NXp4dFVIcE1wNm1IVmVuTkdaOVppMXE5ZUR3TzRtSy9jRW05a2pCTWNWYmtW?=
 =?utf-8?B?amszY1NodGxIZ2xGVzlTR2dwL2ZXYk5aSm5UZE5xSHYvYVRvVWx0V1FkR3o4?=
 =?utf-8?B?ZXBFQmpYVElUYlA4TVZwdzI4STBkVDNMamF3aENYTC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R4bFVuYy9TWXZWbzFxcGc2NTY5UkhoU3RQYmVvaDFNbFV1?=
 =?utf-8?B?WEcrZzE4eG9xWG16alMzVWl1RTg4L3JBTDE0dk0zTGtMNE5uR1B0TXN2eWhx?=
 =?utf-8?Q?haHDXZ4v2ht9eH0kB0TYEE1KD?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5f7135a3-3472-4e83-c331-08db7edfb0f8
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 11:45:41.6422
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: PLYTMChxIAAA+UHaNHJ6dx9uWD+IlgfrGXnziWC3XSgXUFFTqv5aR6/4zPTwEO9nQKtrvdExlPmM2xutDTh+Zg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8320

On 07.07.2023 12:16, Jan Beulich wrote:
> On 07.07.2023 11:52, George Dunlap wrote:
>> On Fri, Jul 7, 2023 at 9:00â€¯AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>>> On 06.07.2023 17:35, zithro wrote:
>>>> On 06 Jul 2023 09:02, Jan Beulich wrote:
>>>>> On 05.07.2023 18:20, zithro wrote:
>>>>>> So I'm wondering, isn't that path enough for correct detection ?
>>>>>> I mean, if "/sys/class/dmi/id/sys_vendor" reports Xen (or KVM, or any
>>>>>> other known hypervisor), it's nested, otherwise it's on hardware ?
>>>>>>
>>>>>> Is that really mandatory to use CPUID leaves ?
>>>>>
>>>>> Let me ask the other way around: In user mode code under a non-nested
>>>>> vs nested Xen, what would you be able to derive from CPUID? The
>>>>> "hypervisor" bit is going to be set in both cases. (All assuming you
>>>>> run on new enough hardware+Xen such that CPUID would be intercepted
>>>>> even for PV.)
>>>>
>>>> I'm a bit clueless about CPUID stuff, but if I understand correctly,
>>>> you're essentially saying that using CPUID may not be the perfect way ?
>>>> Also, I don't get why the cpuid command returns two different values,
>>>> depending on the -k switch :
>>>> # cpuid -l 0x40000000
>>>> hypervisor_id (0x40000000) = "\0\0\0\0\0\0\0\0\0\0\0\0"
>>>> # cpuid -k -l 0x40000000
>>>> hypervisor_id (0x40000000) = "XenVMMXenVMM"
>>>
>>> I'm afraid I can't comment on this without knowing what tool you're
>>> taking about. Neither of the two systems I checked have one of this
>>> name.
>>>
>>>>> Yet relying on DMI is fragile, too: Along the lines of
>>>>> https://lists.xen.org/archives/html/xen-devel/2022-01/msg00604.html
>>>>> basically any value in there could be "inherited" from the host (i.e.
>>>>> from the layer below, to be precise).
>>>>
>>>> So using "/sys/class/dmi/id/sys_vendor", or simply doing "dmesg | grep
>>>> DMI:" is also not perfect, as values can be inherited/spoofed by
>>>> underneath hypervisor ?
>>>
>>> That's my understanding, yes.
>>>
>>>>> The only way to be reasonably
>>>>> certain is to ask Xen about its view. The raw or host featuresets
>>>>> should give you this information, in the "mirror" of said respective
>>>>> CPUID leave's "hypervisor" bit.
>>>>
>>>> As said above, I'm clueless, can you expand please ?
>>>
>>> Xen's public interface offers access to the featuresets known / found /
>>> used by the hypervisor. See XEN_SYSCTL_get_cpu_featureset, accessible
>>> via xc_get_cpu_featureset().
>>>
>>
>> Are any of these exposed in dom0 via sysctl, or hypfs?
> 
> sysctl - yes (as the quoted name also says). hypfs no, afaict.
> 
>>  SYSCTLs are
>> unfortunately not stable interfaces, correct?  So it wouldn't be practical
>> for systemd to use them.
> 
> Indeed, neither sysctl-s nor the libxc interfaces are stable.

Thinking of it, xen-cpuid is a wrapper tool around those. They may want
to look at its output (and, if they want to use it, advise distros to
also package it), which I think we try to keep reasonably stable,
albeit without providing any guarantees.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 11:51:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 11:51:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560472.876409 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHjzd-0002oG-Bo; Fri, 07 Jul 2023 11:51:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560472.876409; Fri, 07 Jul 2023 11:51:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHjzd-0002o9-9F; Fri, 07 Jul 2023 11:51:21 +0000
Received: by outflank-mailman (input) for mailman id 560472;
 Fri, 07 Jul 2023 11:51:20 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHjzc-0002nz-Hc; Fri, 07 Jul 2023 11:51:20 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHjzc-0000QT-8B; Fri, 07 Jul 2023 11:51:20 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHjzb-0002nT-Rc; Fri, 07 Jul 2023 11:51:19 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qHjzb-0002Cg-R8; Fri, 07 Jul 2023 11:51:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=g+UOWZ+Bzo9OM+ZIY8G9o++rBHZCP3V7cmI50j/B46g=; b=QvlabNiAxyRBUYS2oEhXpmUskE
	In6aDVbV9gg2R0fQxlsQ0LcMQZtlMryOH+ZaZhgH5ehnweZjVX8fG9hx3VgzNKepvSic/e5NzDzAB
	7qDDJ3Chu+7cUH1bIUWdSH8x+Fp4aGKLe5NWhAggL0RqDTnSam5wPASiYXCjEp18+piE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181729-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181729: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pygrub:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:debian-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:debian-di-install:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:xen-boot:fail:allowable
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=a452483508d7b70b0f6c69e249ec0b3ea2330b5c
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 07 Jul 2023 11:51:19 +0000

flight 181729 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181729/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-pygrub       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl           8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64  8 xen-boot    fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-libvirt      8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu 12 debian-install          fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2  12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd 12 debian-hvm-install  fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 12 xen-boot/src_host       fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 13 xen-boot/dst_host       fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2 12 debian-di-install      fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds      8 xen-boot                 fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                a452483508d7b70b0f6c69e249ec0b3ea2330b5c
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   81 days
Failing since        180281  2023-04-17 06:24:36 Z   81 days  159 attempts
Testing same since   181729  2023-07-07 01:40:33 Z    0 days    1 attempts

------------------------------------------------------------
3707 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 613668 lines long.)


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 12:09:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 12:09:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560482.876419 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHkHS-0004V0-1t; Fri, 07 Jul 2023 12:09:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560482.876419; Fri, 07 Jul 2023 12:09:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHkHR-0004Ut-Vf; Fri, 07 Jul 2023 12:09:45 +0000
Received: by outflank-mailman (input) for mailman id 560482;
 Fri, 07 Jul 2023 12:09:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qHkHQ-0004Un-8G
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 12:09:44 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHkHO-0000j8-Mw; Fri, 07 Jul 2023 12:09:42 +0000
Received: from 54-240-197-233.amazon.com ([54.240.197.233]
 helo=[192.168.10.48]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHkHO-0004h7-Ce; Fri, 07 Jul 2023 12:09:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=tjRTW6MHvp6uRfBAvVGBMSmlrRbdRew7+gkDZhSENAU=; b=jdoytZ2e665g5xXPSeRdU2CAJj
	nbvFNeqB7AGZ4FJETMrmC5s6Ca8J8UVf488bJq2Je3YwzpNDtQ8ZmnPGxeb95OEHD0J+K65hwH4Y/
	2lnJ77itKGy00IHzj2DFAkXy/CCqzzpo1lfFdRYANheKVJvaJIeJ1MSUwWhUVeKxKUZI=;
Message-ID: <9ca3724c-6ee7-9853-524e-6f55b3702dc4@xen.org>
Date: Fri, 7 Jul 2023 13:09:40 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 3/3] [FUTURE] xen/arm: enable vPCI for domUs
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Stewart Hildebrand <stewart.hildebrand@amd.com>,
 xen-devel@lists.xenproject.org, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Artem Mygaiev <artem_mygaiev@epam.com>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-4-stewart.hildebrand@amd.com>
 <e5a0ed8a-d85b-fb60-609a-f46884433c60@xen.org>
 <ZKfjoXqb6Kgav-vL@MacBook-Air-de-Roger.local>
 <04c05db8-1e15-f2c1-ebc1-0563d442a808@xen.org>
 <ZKftKtkjgFLWaW_x@MacBook-Air-de-Roger.local>
 <7f89a925-6c4e-7840-041b-2e0816ed7b71@xen.org>
 <ZKf4PMkKF3x2VwXl@MacBook-Air-de-Roger.local>
From: Julien Grall <julien@xen.org>
In-Reply-To: <ZKf4PMkKF3x2VwXl@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 07/07/2023 12:34, Roger Pau MonnÃ© wrote:
> On Fri, Jul 07, 2023 at 12:16:46PM +0100, Julien Grall wrote:
>>
>>
>> On 07/07/2023 11:47, Roger Pau MonnÃ© wrote:
>>> On Fri, Jul 07, 2023 at 11:33:14AM +0100, Julien Grall wrote:
>>>> Hi,
>>>>
>>>> On 07/07/2023 11:06, Roger Pau MonnÃ© wrote:
>>>>> On Fri, Jul 07, 2023 at 10:00:51AM +0100, Julien Grall wrote:
>>>>>> On 07/07/2023 02:47, Stewart Hildebrand wrote:
>>>>>>> Note that CONFIG_HAS_VPCI_GUEST_SUPPORT is not currently used in the upstream
>>>>>>> code base. It will be used by the vPCI series [1]. This patch is intended to be
>>>>>>> merged as part of the vPCI series.
>>>>>>>
>>>>>>> v1->v2:
>>>>>>> * new patch
>>>>>>> ---
>>>>>>>      xen/arch/arm/Kconfig              | 1 +
>>>>>>>      xen/arch/arm/include/asm/domain.h | 2 +-
>>>>>>>      2 files changed, 2 insertions(+), 1 deletion(-)
>>>>>>>
>>>>>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>>>>>> index 4e0cc421ad48..75dfa2f5a82d 100644
>>>>>>> --- a/xen/arch/arm/Kconfig
>>>>>>> +++ b/xen/arch/arm/Kconfig
>>>>>>> @@ -195,6 +195,7 @@ config PCI_PASSTHROUGH
>>>>>>>      	depends on ARM_64
>>>>>>>      	select HAS_PCI
>>>>>>>      	select HAS_VPCI
>>>>>>> +	select HAS_VPCI_GUEST_SUPPORT
>>>>>>>      	default n
>>>>>>>      	help
>>>>>>>      	  This option enables PCI device passthrough
>>>>>>> diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
>>>>>>> index 1a13965a26b8..6e016b00bae1 100644
>>>>>>> --- a/xen/arch/arm/include/asm/domain.h
>>>>>>> +++ b/xen/arch/arm/include/asm/domain.h
>>>>>>> @@ -298,7 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
>>>>>>>      #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag)
>>>>>>> -#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); })
>>>>>>> +#define has_vpci(d)    ({ (void)(d); IS_ENABLED(CONFIG_HAS_VPCI); })
>>>>>>
>>>>>> As I mentioned in the previous patch, wouldn't this enable vPCI
>>>>>> unconditionally for all the domain? Shouldn't this be instead an optional
>>>>>> feature which would be selected by the toolstack?
>>>>>
>>>>> I do think so, at least on x86 we signal whether vPCI should be
>>>>> enabled for a domain using xen_arch_domainconfig at domain creation.
>>>>>
>>>>> Ideally we would like to do this on a per-device basis for domUs, so
>>>>> we should consider adding a new flag to xen_domctl_assign_device in
>>>>> order to signal whether the assigned device should use vPCI.
>>>>
>>>> I am a bit confused with this paragraph. If the device is not using vPCI,
>>>> how will it be exposed to the domain? Are you planning to support both vPCI
>>>> and PV PCI passthrough for a same domain?
>>>
>>> You could have an external device model handling it using the ioreq
>>> interface, like we currently do passthrough for HVM guests.
>>
>> IMHO, if one decide to use QEMU for emulating the host bridge, then there is
>> limited point to also ask Xen to emulate the hostbridge for some other
>> device. So what would be the use case where you would want to be a
>> per-device basis decision?
> 
> You could also emulate the bridge in Xen and then have QEMU and
> vPCI handle accesses to the PCI config space for different devices.
> The ioreq interface already allows registering for config space
> accesses on a per SBDF basis.
> 
> XenServer currently has a use-case where generic PCI device
> passthrough is handled by QEMU, while some GPUs are passed through
> using a custom emulator.  So some domains effectively end with a QEMU
> instance and a custom emulator, I don't see why you couldn't
> technically replace QEMU with vPCI in this scenario.
> 
> The PCI root complex might be emulated by QEMU, or ideally by Xen.
> That shouldn't prevent other device models from handling accesses for
> devices, as long as accesses to the ECAM region(s) are trapped and
> decoded by Xen.  IOW: if we want bridges to be emulated by ioreq
> servers we need to introduce an hypercall to register ECAM regions
> with Xen so that it can decode accesses and forward them
> appropriately.

Thanks for the clarification. Going back to the original discussion. 
Even with this setup, I think we still need to tell at domain creation 
whether vPCI will be used (think PCI hotplug).

After that, the device assignment hypercall could have a way to say 
whether the device will be emulated by vPCI. But I don't think this is 
necessary to have from day one as the ABI will be not stable (this is a 
DOMCTL).


Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 12:24:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 12:24:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560487.876430 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHkVs-0006rf-BW; Fri, 07 Jul 2023 12:24:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560487.876430; Fri, 07 Jul 2023 12:24:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHkVs-0006rY-7W; Fri, 07 Jul 2023 12:24:40 +0000
Received: by outflank-mailman (input) for mailman id 560487;
 Fri, 07 Jul 2023 12:24:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=AlIE=CZ=suse.cz=jack@srs-se1.protection.inumbo.net>)
 id 1qHkVq-0006rS-LI
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 12:24:38 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3bf22e9f-1cc1-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 14:24:35 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id F0C8D1FDB5;
 Fri,  7 Jul 2023 12:24:34 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D97F7139E0;
 Fri,  7 Jul 2023 12:24:34 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id rMQMNQIEqGT9NgAAMHmgww
 (envelope-from <jack@suse.cz>); Fri, 07 Jul 2023 12:24:34 +0000
Received: by quack3.suse.cz (Postfix, from userid 1000)
 id 6AC15A0717; Fri,  7 Jul 2023 14:24:34 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3bf22e9f-1cc1-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa;
	t=1688732675; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=v97Z4h87RrabL7WLNBXHFysNCdL5KIt8mtxxyrwI0lE=;
	b=LqFRs1c1G67BsNNDLuNq3gTOMo8UAqFT+ZgX0/ce2GYyjoNTkNY3JvymPyQUIIgvdCfdfA
	wvYabjfbqON86k1PsUxAyhGKf+BANbZ0orxg0fUOS7bjyZ5ddpTiVyICESJEtA4U8iKIIb
	0Zu9Qq9rWpT0jHo3EjIE5diazY1476M=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;
	s=susede2_ed25519; t=1688732675;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=v97Z4h87RrabL7WLNBXHFysNCdL5KIt8mtxxyrwI0lE=;
	b=WsVzOxtNAjI8cmGR5IMHwFDPJM5ZBawTTSTtFHjjnpb4nomNuwaP8lcoennzww9M9DfIc5
	k35MoJGFDmLh3vBw==
Date: Fri, 7 Jul 2023 14:24:34 +0200
From: Jan Kara <jack@suse.cz>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jan Kara <jack@suse.cz>, linux-block@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Alasdair Kergon <agk@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anna Schumaker <anna@kernel.org>, Chao Yu <chao@kernel.org>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Dave Kleikamp <shaggy@kernel.org>, David Sterba <dsterba@suse.com>,
	dm-devel@redhat.com, drbd-dev@lists.linbit.com,
	Gao Xiang <xiang@kernel.org>, Jack Wang <jinpu.wang@ionos.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	Joern Engel <joern@lazybastard.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	linux-bcache@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org,
	linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org,
	linux-nilfs@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-pm@vger.kernel.org, linux-raid@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	"Md. Haris Iqbal" <haris.iqbal@ionos.com>,
	Mike Snitzer <snitzer@kernel.org>, Minchan Kim <minchan@kernel.org>,
	ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Song Liu <song@kernel.org>, Sven Schnelle <svens@linux.ibm.com>,
	target-devel@vger.kernel.org, Ted Tso <tytso@mit.edu>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions
Message-ID: <20230707122434.s46ytxpne42hecni@quack3>
References: <20230629165206.383-1-jack@suse.cz>
 <20230704122224.16257-1-jack@suse.cz>
 <ZKbgAG5OoHVyUKOG@infradead.org>
 <20230706161433.lj4apushiwguzvdd@quack3>
 <ZKf26fYMDHnTCb29@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <ZKf26fYMDHnTCb29@infradead.org>

On Fri 07-07-23 04:28:41, Christoph Hellwig wrote:
> On Thu, Jul 06, 2023 at 06:14:33PM +0200, Jan Kara wrote:
> > > struct bdev_handle *bdev_open_by_path(dev_t dev, blk_mode_t mode,
> > > 		void *holder, const struct blk_holder_ops *hops);
> > > void bdev_release(struct bdev_handle *handle);
> > 
> > I'd maybe use bdev_close() instead of bdev_release() but otherwise I like
> > the new naming.
> 
> We're using release everywhese else, but if Jens is fine with that I
> can live with close.

Dunno, to me words pair like open-close, get-put, acquire-release.
Furthermore e.g. ->release() (and thus blkdev_release()) is called only
when the last file reference is dropped, not when each reference is
dropped, so that's why bdev_release() seems a bit confusing to me.

								Honza

-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 13:10:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 13:10:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560492.876440 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHlDp-0003bz-Mq; Fri, 07 Jul 2023 13:10:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560492.876440; Fri, 07 Jul 2023 13:10:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHlDp-0003bs-Jo; Fri, 07 Jul 2023 13:10:05 +0000
Received: by outflank-mailman (input) for mailman id 560492;
 Fri, 07 Jul 2023 13:10:04 +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 <SRS0=6jVP=CZ=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qHlDo-0003KT-C4
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 13:10:04 +0000
Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com
 [2a00:1450:4864:20::236])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 94d4175c-1cc7-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 15:10:01 +0200 (CEST)
Received: by mail-lj1-x236.google.com with SMTP id
 38308e7fff4ca-2b6fdaf6eefso28725081fa.0
 for <xen-devel@lists.xenproject.org>; Fri, 07 Jul 2023 06:10:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 94d4175c-1cc7-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1688735401; x=1691327401;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=V+VJNI43NdR8+7vGNe1olqB6vdFbiPzrBn9hniTaJAg=;
        b=gBcnWYYr5/+EvZCUYkQPay+egjVtHhayY00j6LwQzvDE6AnMu5bhK75W4cvr1tp60p
         ARBGqKqxh4i0EHkfJcSfKyhR8lETLt26kSY4IJMj4DBvC91NnA4/4foM2Cgf86IB1QK5
         ocEBwZCKLdq3JSZoDc56tHEOqLP+Mt1LhPVjQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688735401; x=1691327401;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=V+VJNI43NdR8+7vGNe1olqB6vdFbiPzrBn9hniTaJAg=;
        b=XboadwKwZ9yXnLKfbAsuZPP6Mhk0VhDn8ZeFIwNt94tMgOaoTQjGRIWi5ESxmNaP3a
         FU3ZEW7Y/LjZR5PartanxWFNvEWVd+DzDkuD6Pjmgok//AH3dqLnQp+X5gXLB3fkVSJ9
         Eqiu/ja97Xo3faxfGrO+6RxgpY17oB5h07luo/ukgqxLHl9vLLTR0rYL8jdItNMzQz4K
         SQlX2lo7KOydnmIBII6soSN5XoZO7MrN7A4VloW3J6GQAoCGcNyiD56nZS+T3XO1+GIz
         RXNPsLj5sKLoFNu/4A1/nkslvuAgbCUv/I7kM9rk4MOwqhrNoZKVkluK4pEAh4ewp0mT
         K4Ag==
X-Gm-Message-State: ABy/qLaqi+muYej7Ytv/ippdYRQMdyVA9ZkKOnDewxwVkc7J5c195TD6
	Qn6+gG7fGSiMlEx5AckyazXoEg5kV/Xg7AE9EPXMcw==
X-Google-Smtp-Source: APBJJlHeB1ejxRKDnVgK8ew8Qc7Vi1/PH9ZBiYj5tYKtE/sG8LCteq3iD9qoqtGMo/SJMhSE0cueiYWbqTPuRzGPLNM=
X-Received: by 2002:a05:6512:252c:b0:4fb:820a:f87f with SMTP id
 be44-20020a056512252c00b004fb820af87fmr4429759lfb.10.1688735401146; Fri, 07
 Jul 2023 06:10:01 -0700 (PDT)
MIME-Version: 1.0
References: <CA+zSX=Y4MwsDSd9oSG1NQyt==YAw9SeRdh=eJxTUhhOx57ihWg@mail.gmail.com>
 <4ee01a0f-063e-ef93-ac24-da387d5b3438@rabbit.lu> <a680ae62-7765-aa51-1edd-9a1a7e39e449@suse.com>
 <20b1a79c-23c1-93bc-2090-8052f143422c@rabbit.lu> <27a3e6a2-b150-1d75-c86f-dfa2b906b298@suse.com>
 <CA+zSX=ZCmmKQX7acx-oK4nSki9ONscxLP7E8t8USjdjXJ9UDpA@mail.gmail.com> <495946e9-191f-22fe-9ecf-08eb5af833ba@suse.com>
In-Reply-To: <495946e9-191f-22fe-9ecf-08eb5af833ba@suse.com>
From: George Dunlap <george.dunlap@cloud.com>
Date: Fri, 7 Jul 2023 14:09:50 +0100
Message-ID: <CA+zSX=bEZ8LHmjZ2bBJAqpN4g02ayiB-a7zpL9NT8=1zd=FQZw@mail.gmail.com>
Subject: Re: Detecting whether dom0 is in a VM
To: Jan Beulich <jbeulich@suse.com>
Cc: zithro <slack@rabbit.lu>, xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000b48efe05ffe5599c"

--000000000000b48efe05ffe5599c
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, Jul 7, 2023 at 11:17=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wro=
te:

> On 07.07.2023 11:52, George Dunlap wrote:
> > On Fri, Jul 7, 2023 at 9:00=E2=80=AFAM Jan Beulich <jbeulich@suse.com> =
wrote:
> >
> >> On 06.07.2023 17:35, zithro wrote:
> >>> On 06 Jul 2023 09:02, Jan Beulich wrote:
> >>>> On 05.07.2023 18:20, zithro wrote:
> >>>>> So I'm wondering, isn't that path enough for correct detection ?
> >>>>> I mean, if "/sys/class/dmi/id/sys_vendor" reports Xen (or KVM, or a=
ny
> >>>>> other known hypervisor), it's nested, otherwise it's on hardware ?
> >>>>>
> >>>>> Is that really mandatory to use CPUID leaves ?
> >>>>
> >>>> Let me ask the other way around: In user mode code under a non-neste=
d
> >>>> vs nested Xen, what would you be able to derive from CPUID? The
> >>>> "hypervisor" bit is going to be set in both cases. (All assuming you
> >>>> run on new enough hardware+Xen such that CPUID would be intercepted
> >>>> even for PV.)
> >>>
> >>> I'm a bit clueless about CPUID stuff, but if I understand correctly,
> >>> you're essentially saying that using CPUID may not be the perfect way=
 ?
> >>> Also, I don't get why the cpuid command returns two different values,
> >>> depending on the -k switch :
> >>> # cpuid -l 0x40000000
> >>> hypervisor_id (0x40000000) =3D "\0\0\0\0\0\0\0\0\0\0\0\0"
> >>> # cpuid -k -l 0x40000000
> >>> hypervisor_id (0x40000000) =3D "XenVMMXenVMM"
> >>
> >> I'm afraid I can't comment on this without knowing what tool you're
> >> taking about. Neither of the two systems I checked have one of this
> >> name.
> >>
> >>>> Yet relying on DMI is fragile, too: Along the lines of
> >>>> https://lists.xen.org/archives/html/xen-devel/2022-01/msg00604.html
> >>>> basically any value in there could be "inherited" from the host (i.e=
.
> >>>> from the layer below, to be precise).
> >>>
> >>> So using "/sys/class/dmi/id/sys_vendor", or simply doing "dmesg | gre=
p
> >>> DMI:" is also not perfect, as values can be inherited/spoofed by
> >>> underneath hypervisor ?
> >>
> >> That's my understanding, yes.
> >>
> >>>> The only way to be reasonably
> >>>> certain is to ask Xen about its view. The raw or host featuresets
> >>>> should give you this information, in the "mirror" of said respective
> >>>> CPUID leave's "hypervisor" bit.
> >>>
> >>> As said above, I'm clueless, can you expand please ?
> >>
> >> Xen's public interface offers access to the featuresets known / found =
/
> >> used by the hypervisor. See XEN_SYSCTL_get_cpu_featureset, accessible
> >> via xc_get_cpu_featureset().
> >>
> >
> > Are any of these exposed in dom0 via sysctl, or hypfs?
>
> sysctl - yes (as the quoted name also says). hypfs no, afaict.
>

Sorry, that was a typo; I meant Linux's sysfs.  But of course if it's a
sysctl, I expect that to be a "no".

 -George

--000000000000b48efe05ffe5599c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jul 7, 2023 at 11:17=E2=80=AF=
AM Jan Beulich &lt;<a href=3D"mailto:jbeulich@suse.com" target=3D"_blank">j=
beulich@suse.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" =
style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa=
dding-left:1ex">On 07.07.2023 11:52, George Dunlap wrote:<br>
&gt; On Fri, Jul 7, 2023 at 9:00=E2=80=AFAM Jan Beulich &lt;<a href=3D"mail=
to:jbeulich@suse.com" target=3D"_blank">jbeulich@suse.com</a>&gt; wrote:<br=
>
&gt; <br>
&gt;&gt; On 06.07.2023 17:35, zithro wrote:<br>
&gt;&gt;&gt; On 06 Jul 2023 09:02, Jan Beulich wrote:<br>
&gt;&gt;&gt;&gt; On 05.07.2023 18:20, zithro wrote:<br>
&gt;&gt;&gt;&gt;&gt; So I&#39;m wondering, isn&#39;t that path enough for c=
orrect detection ?<br>
&gt;&gt;&gt;&gt;&gt; I mean, if &quot;/sys/class/dmi/id/sys_vendor&quot; re=
ports Xen (or KVM, or any<br>
&gt;&gt;&gt;&gt;&gt; other known hypervisor), it&#39;s nested, otherwise it=
&#39;s on hardware ?<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Is that really mandatory to use CPUID leaves ?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Let me ask the other way around: In user mode code under a=
 non-nested<br>
&gt;&gt;&gt;&gt; vs nested Xen, what would you be able to derive from CPUID=
? The<br>
&gt;&gt;&gt;&gt; &quot;hypervisor&quot; bit is going to be set in both case=
s. (All assuming you<br>
&gt;&gt;&gt;&gt; run on new enough hardware+Xen such that CPUID would be in=
tercepted<br>
&gt;&gt;&gt;&gt; even for PV.)<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I&#39;m a bit clueless about CPUID stuff, but if I understand =
correctly,<br>
&gt;&gt;&gt; you&#39;re essentially saying that using CPUID may not be the =
perfect way ?<br>
&gt;&gt;&gt; Also, I don&#39;t get why the cpuid command returns two differ=
ent values,<br>
&gt;&gt;&gt; depending on the -k switch :<br>
&gt;&gt;&gt; # cpuid -l 0x40000000<br>
&gt;&gt;&gt; hypervisor_id (0x40000000) =3D &quot;\0\0\0\0\0\0\0\0\0\0\0\0&=
quot;<br>
&gt;&gt;&gt; # cpuid -k -l 0x40000000<br>
&gt;&gt;&gt; hypervisor_id (0x40000000) =3D &quot;XenVMMXenVMM&quot;<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m afraid I can&#39;t comment on this without knowing what to=
ol you&#39;re<br>
&gt;&gt; taking about. Neither of the two systems I checked have one of thi=
s<br>
&gt;&gt; name.<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt; Yet relying on DMI is fragile, too: Along the lines of<br>
&gt;&gt;&gt;&gt; <a href=3D"https://lists.xen.org/archives/html/xen-devel/2=
022-01/msg00604.html" rel=3D"noreferrer" target=3D"_blank">https://lists.xe=
n.org/archives/html/xen-devel/2022-01/msg00604.html</a><br>
&gt;&gt;&gt;&gt; basically any value in there could be &quot;inherited&quot=
; from the host (i.e.<br>
&gt;&gt;&gt;&gt; from the layer below, to be precise).<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; So using &quot;/sys/class/dmi/id/sys_vendor&quot;, or simply d=
oing &quot;dmesg | grep<br>
&gt;&gt;&gt; DMI:&quot; is also not perfect, as values can be inherited/spo=
ofed by<br>
&gt;&gt;&gt; underneath hypervisor ?<br>
&gt;&gt;<br>
&gt;&gt; That&#39;s my understanding, yes.<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt; The only way to be reasonably<br>
&gt;&gt;&gt;&gt; certain is to ask Xen about its view. The raw or host feat=
uresets<br>
&gt;&gt;&gt;&gt; should give you this information, in the &quot;mirror&quot=
; of said respective<br>
&gt;&gt;&gt;&gt; CPUID leave&#39;s &quot;hypervisor&quot; bit.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; As said above, I&#39;m clueless, can you expand please ?<br>
&gt;&gt;<br>
&gt;&gt; Xen&#39;s public interface offers access to the featuresets known =
/ found /<br>
&gt;&gt; used by the hypervisor. See XEN_SYSCTL_get_cpu_featureset, accessi=
ble<br>
&gt;&gt; via xc_get_cpu_featureset().<br>
&gt;&gt;<br>
&gt; <br>
&gt; Are any of these exposed in dom0 via sysctl, or hypfs?<br>
<br>
sysctl - yes (as the quoted name also says). hypfs no, afaict.<br></blockqu=
ote><div><br></div><div>Sorry, that was a typo; I meant Linux&#39;s sysfs.=
=C2=A0 But of course if it&#39;s a sysctl, I expect that to be a &quot;no&q=
uot;.</div><div><br></div><div>=C2=A0-George</div><div>=C2=A0</div></div></=
div>

--000000000000b48efe05ffe5599c--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 13:13:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 13:13:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560496.876450 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHlH8-0004H3-4y; Fri, 07 Jul 2023 13:13:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560496.876450; Fri, 07 Jul 2023 13:13:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHlH8-0004Gw-23; Fri, 07 Jul 2023 13:13:30 +0000
Received: by outflank-mailman (input) for mailman id 560496;
 Fri, 07 Jul 2023 13:13:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=GM+b=CZ=citrix.com=prvs=545203e5e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qHlH7-0004Gq-4a
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 13:13:29 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0e5df52f-1cc8-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 15:13:27 +0200 (CEST)
Received: from mail-dm6nam12lp2169.outbound.protection.outlook.com (HELO
 NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.169])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 07 Jul 2023 09:13:21 -0400
Received: from MW4PR03MB6428.namprd03.prod.outlook.com (2603:10b6:303:123::8)
 by DS7PR03MB5621.namprd03.prod.outlook.com (2603:10b6:5:2c8::21) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 13:13:16 +0000
Received: from MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd]) by MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd%7]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 13:13:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0e5df52f-1cc8-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688735607;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=SYqBHFTh4RNARwcUc0iS8nKLsc3UA1K1eLEP3zNIAHM=;
  b=ddp6TS8UNaWHbKAUKC+L9WUiAZkRSHJtp54xAa1G8ogl9bLNUCUZ6s9Q
   KOj5QQzccLatkGeu5rIAvmG9jDahqfWhoXjFiOfGwFY/Gdx7v12KkGDSs
   gMthv/f8gXFXk4mgc1nWtHVWUP0nrAAYXOdinb2PBTQhierHoNZBol8jr
   s=;
X-IronPort-RemoteIP: 104.47.59.169
X-IronPort-MID: 114782644
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:cbo+bavsjgjX3JuIZaFfYhjHOOfnVOZfMUV32f8akzHdYApBsoF/q
 tZmKWmObvuLM2L2L4gjPN+/p0sBvpSEnYNrSAs5/Hw2RS0X+JbJXdiXEBz9bniYRiHhoOCLz
 O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKi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exQveVu88qT9JvjJ28Gd3APV0n5hT0JcjpyFCdNNW577cpQLu
 v72iJfzQDQAEgqUg==
X-Talos-CUID: 9a23:IlPbe2+nlv1XL4WNZCSVv2JPQ5k1aEHR8FHrBEaUDEBVZO2LZVDFrQ==
X-Talos-MUID: =?us-ascii?q?9a23=3Ajt7KHQ+h/T2rDDLh4snslmuQf904+aTzUBgIqrE?=
 =?us-ascii?q?blvXeJHYsCzqativiFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,187,1684814400"; 
   d="scan'208";a="114782644"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=UWogiS5v1/JTZfk+z1LRq6euaJeSOID+GcLRn/5fHHAziIMdg/mzYkpc0vMc1GtrjvRW4zAi4BDuuWRcID2/q9QkRacQiAxRk1h3AZf27ABRiTDwFi93Y3/id0feTN1QaHei2m/Vbk4RbmQw+Sq9om4irBBMc+4RTHQcEAGjjPE8ERHMDZlztPqLLQrTq67B6gcrWARKHw8Jj1Iqs+KmuxQyX+o8mIJXgYvqakAlr4BzJKEHrD5vs+njvn5QHct+GFF4qT3XNiBSVh13gm+DmJ5WBJ75xoWK+hf8UV3oWQ5OYtfyHtltuBwTMLvrvzPr2bxAh/RrRPhQhq0CaPDC5w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=RQ+o5mY7M1XiBRfnC5QMqr9tUX6O/qoN4fcud89xSAA=;
 b=li/5eqkEqwKqKomiaiLz92u5amA6ru6V1ST+/5wjpmkOv++BNZbXXSgr2F2ZkompG0MR9yIBqBJH/COCaLdLycKsghuYaHqO1czvGWzmm9nYJfn+MHJNUqFFNz+UaCxL68eUtt5KjdZCA9MbokYRnBhKixK+sxiGZBUH0REYWxUTNOlUiptCIwMLvFUTy6+LfxoXmuFkdWUiYV/JAJ0DEplPyq/IVXL2QpNyNs7rA8kbK+8Hwo0tJziHP1mZtXFmWnPxEygVgdh88FIDK2YDShXqd0kU2wEQTkBWtLUJ7oK+4ojlCKWn7IST6srE5QZq2DbnuXxYWDuK6V4KwRAUDg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RQ+o5mY7M1XiBRfnC5QMqr9tUX6O/qoN4fcud89xSAA=;
 b=i9lz5x+HD7IKldvcUJm6gLoQfUO/MQixkit+f0V954aOEHU4COPgKfu0beW+AZqhm9/61ngOEpqGIqEeELLwfcjuJ00LeTgvKRGr6h0bP92wfPXKtO326jEkxYqGRwnkSIBnEsGyTKiqjH892KEIQTXE1ywSMXigOiCuAhZoVfU=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 7 Jul 2023 15:13:08 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Julien Grall <julien@xen.org>
Cc: Stewart Hildebrand <stewart.hildebrand@amd.com>,
	xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Artem Mygaiev <artem_mygaiev@epam.com>
Subject: Re: [PATCH v2 3/3] [FUTURE] xen/arm: enable vPCI for domUs
Message-ID: <ZKgPZGXY7dkDLnQR@MacBook-Air-de-Roger.local>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-4-stewart.hildebrand@amd.com>
 <e5a0ed8a-d85b-fb60-609a-f46884433c60@xen.org>
 <ZKfjoXqb6Kgav-vL@MacBook-Air-de-Roger.local>
 <04c05db8-1e15-f2c1-ebc1-0563d442a808@xen.org>
 <ZKftKtkjgFLWaW_x@MacBook-Air-de-Roger.local>
 <7f89a925-6c4e-7840-041b-2e0816ed7b71@xen.org>
 <ZKf4PMkKF3x2VwXl@MacBook-Air-de-Roger.local>
 <9ca3724c-6ee7-9853-524e-6f55b3702dc4@xen.org>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <9ca3724c-6ee7-9853-524e-6f55b3702dc4@xen.org>
X-ClientProxiedBy: LO3P123CA0030.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:388::13) To MW4PR03MB6428.namprd03.prod.outlook.com
 (2603:10b6:303:123::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MW4PR03MB6428:EE_|DS7PR03MB5621:EE_
X-MS-Office365-Filtering-Correlation-Id: 2bf95b4c-de1b-4dac-f261-08db7eebec85
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	arb1W1/D3mbwwGmeH3wzg/KBTWbySdosrjU21xr03O8/22A/AMKR/wcN3xGF1iVMoHOsN4GDrMXTeu96hf9t5YlDJRfSdh1U6qNgHqWIYlLSVFjYo+pIi9gve+U+TLfBeKEdpHMlHA/5JamFpCT38m79ra/5pxPFTmsK0xyOUHcIbatZz7+BuWW0CxVfLarRgIopqvhNSZogSjKyqEIuDBfyjdp4hzldhhD4hPgi3/YCxMNVb6uj/QmHqs1WYUZ6maYY653msz14ktPCsnvt/QKISwLZSq50kO9I8Hj5H2FGaLpSP5IFGggL1IyO6WmNtHKWbtU6dntUB9iNA3Z6T8z5xfhLM4VDWkSyMYs2Z13XskZOLI096N8tgXR6zn/H7iUt4q15JcxhLSp2ZlruRrqYH8CCVUVs2LPp6wX87PYRiaxayCf+VEwjff6PGL4iR3c35ZVFgNCCiPMJ40R3z/xvkUsejJUsnRJ5BrwOk6DRlx4nImmKazOaZMYxLjJ57zMpGEZGxPYRXeLGbLFHSVgwvCsKCPeAXFt4Tt0KFdAH243Dv5gNuHkMEHvsMfmP
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR03MB6428.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(366004)(39860400002)(136003)(346002)(451199021)(8676002)(6486002)(478600001)(4326008)(6666004)(6506007)(53546011)(83380400001)(66556008)(6512007)(26005)(186003)(5660300002)(2906002)(6916009)(8936002)(66476007)(9686003)(316002)(41300700001)(86362001)(85182001)(38100700002)(54906003)(66946007)(82960400001)(66899021);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?enVyZ2Qwcjc1cExEaWdrUjN3R0FCZTdhdTVvTStNSVFOUVVVU2ZSVmRWMjBi?=
 =?utf-8?B?aEIzT3BLdXNsenR4RFUzRTFiSXRBKzI0OHRtNlpSaEsxcHJuaEpHYk1rK21m?=
 =?utf-8?B?ZmttN3I1cFdVb0ZrbXF1TFgzZ0tQTFk2UURGRENWbk1FOVlXL1lIWnhPcmdX?=
 =?utf-8?B?WXhOYnovUUx2NE8yTE40YVhYb2dCRGdhYktJSnhLdnF3dHR6cXVjSG4xRU9D?=
 =?utf-8?B?NTNESklTNnE5c0NWQnRUOERhSUdSRzUrT21tZ3h5MGFoSzBKdzBCaTBYbFVC?=
 =?utf-8?B?Y1N4NU54MXJpQUxCcE40a2s1TEZNRGZLOWJ0clhTczdKZU1UVVhEOEJx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-MS-Exchange-CrossTenant-Network-Message-Id: 2bf95b4c-de1b-4dac-f261-08db7eebec85
X-MS-Exchange-CrossTenant-AuthSource: MW4PR03MB6428.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 13:13:15.6351
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: mpwRjuCYYzSQa7HOHygsPxtSsSWsltn0JkGH3tTXlQjYpYHwYeks08skWw0XPYCWlvcISskrAh1xX0x/+GfXUg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR03MB5621

On Fri, Jul 07, 2023 at 01:09:40PM +0100, Julien Grall wrote:
> Hi,
> 
> On 07/07/2023 12:34, Roger Pau MonnÃ© wrote:
> > On Fri, Jul 07, 2023 at 12:16:46PM +0100, Julien Grall wrote:
> > > 
> > > 
> > > On 07/07/2023 11:47, Roger Pau MonnÃ© wrote:
> > > > On Fri, Jul 07, 2023 at 11:33:14AM +0100, Julien Grall wrote:
> > > > > Hi,
> > > > > 
> > > > > On 07/07/2023 11:06, Roger Pau MonnÃ© wrote:
> > > > > > On Fri, Jul 07, 2023 at 10:00:51AM +0100, Julien Grall wrote:
> > > > > > > On 07/07/2023 02:47, Stewart Hildebrand wrote:
> > > > > > > > Note that CONFIG_HAS_VPCI_GUEST_SUPPORT is not currently used in the upstream
> > > > > > > > code base. It will be used by the vPCI series [1]. This patch is intended to be
> > > > > > > > merged as part of the vPCI series.
> > > > > > > > 
> > > > > > > > v1->v2:
> > > > > > > > * new patch
> > > > > > > > ---
> > > > > > > >      xen/arch/arm/Kconfig              | 1 +
> > > > > > > >      xen/arch/arm/include/asm/domain.h | 2 +-
> > > > > > > >      2 files changed, 2 insertions(+), 1 deletion(-)
> > > > > > > > 
> > > > > > > > diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> > > > > > > > index 4e0cc421ad48..75dfa2f5a82d 100644
> > > > > > > > --- a/xen/arch/arm/Kconfig
> > > > > > > > +++ b/xen/arch/arm/Kconfig
> > > > > > > > @@ -195,6 +195,7 @@ config PCI_PASSTHROUGH
> > > > > > > >      	depends on ARM_64
> > > > > > > >      	select HAS_PCI
> > > > > > > >      	select HAS_VPCI
> > > > > > > > +	select HAS_VPCI_GUEST_SUPPORT
> > > > > > > >      	default n
> > > > > > > >      	help
> > > > > > > >      	  This option enables PCI device passthrough
> > > > > > > > diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
> > > > > > > > index 1a13965a26b8..6e016b00bae1 100644
> > > > > > > > --- a/xen/arch/arm/include/asm/domain.h
> > > > > > > > +++ b/xen/arch/arm/include/asm/domain.h
> > > > > > > > @@ -298,7 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
> > > > > > > >      #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag)
> > > > > > > > -#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); })
> > > > > > > > +#define has_vpci(d)    ({ (void)(d); IS_ENABLED(CONFIG_HAS_VPCI); })
> > > > > > > 
> > > > > > > As I mentioned in the previous patch, wouldn't this enable vPCI
> > > > > > > unconditionally for all the domain? Shouldn't this be instead an optional
> > > > > > > feature which would be selected by the toolstack?
> > > > > > 
> > > > > > I do think so, at least on x86 we signal whether vPCI should be
> > > > > > enabled for a domain using xen_arch_domainconfig at domain creation.
> > > > > > 
> > > > > > Ideally we would like to do this on a per-device basis for domUs, so
> > > > > > we should consider adding a new flag to xen_domctl_assign_device in
> > > > > > order to signal whether the assigned device should use vPCI.
> > > > > 
> > > > > I am a bit confused with this paragraph. If the device is not using vPCI,
> > > > > how will it be exposed to the domain? Are you planning to support both vPCI
> > > > > and PV PCI passthrough for a same domain?
> > > > 
> > > > You could have an external device model handling it using the ioreq
> > > > interface, like we currently do passthrough for HVM guests.
> > > 
> > > IMHO, if one decide to use QEMU for emulating the host bridge, then there is
> > > limited point to also ask Xen to emulate the hostbridge for some other
> > > device. So what would be the use case where you would want to be a
> > > per-device basis decision?
> > 
> > You could also emulate the bridge in Xen and then have QEMU and
> > vPCI handle accesses to the PCI config space for different devices.
> > The ioreq interface already allows registering for config space
> > accesses on a per SBDF basis.
> > 
> > XenServer currently has a use-case where generic PCI device
> > passthrough is handled by QEMU, while some GPUs are passed through
> > using a custom emulator.  So some domains effectively end with a QEMU
> > instance and a custom emulator, I don't see why you couldn't
> > technically replace QEMU with vPCI in this scenario.
> > 
> > The PCI root complex might be emulated by QEMU, or ideally by Xen.
> > That shouldn't prevent other device models from handling accesses for
> > devices, as long as accesses to the ECAM region(s) are trapped and
> > decoded by Xen.  IOW: if we want bridges to be emulated by ioreq
> > servers we need to introduce an hypercall to register ECAM regions
> > with Xen so that it can decode accesses and forward them
> > appropriately.
> 
> Thanks for the clarification. Going back to the original discussion. Even
> with this setup, I think we still need to tell at domain creation whether
> vPCI will be used (think PCI hotplug).

Well, for PCI hotplug you will still need to execute a
XEN_DOMCTL_assign_device hypercall in order to assign the device, at
which point you could pass the vPCI flag.

What you likely want at domain create is whether the IOMMU should be
enabled or not, as we no longer allow late enabling of the IOMMU once
the domain has been created.

One question I have is whether Arm plans to allow exposing fully
emulated devices on the PCI config space, or that would be limited to
PCI device passthrough?

IOW: should an emulated PCI root complex be unconditionally exposed to
guests so that random ioreq servers can register for SBDF slots?

> After that, the device assignment hypercall could have a way to say whether
> the device will be emulated by vPCI. But I don't think this is necessary to
> have from day one as the ABI will be not stable (this is a DOMCTL).

Indeed, it's not a stable interface, but we might as well get
something sane if we have to plumb it through the tools.  Either if
it's a domain create flag or a device attach flag you will need some
plumbing to do at the toolstack level, at which point we might as well
use an interface that doesn't have arbitrary limits.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 13:27:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 13:27:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560503.876460 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHlUY-0005uN-HQ; Fri, 07 Jul 2023 13:27:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560503.876460; Fri, 07 Jul 2023 13:27:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHlUY-0005uG-E1; Fri, 07 Jul 2023 13:27:22 +0000
Received: by outflank-mailman (input) for mailman id 560503;
 Fri, 07 Jul 2023 13:27:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qHlUX-0005u8-2z
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 13:27:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHlUV-0002c9-DD; Fri, 07 Jul 2023 13:27:19 +0000
Received: from 54-240-197-233.amazon.com ([54.240.197.233]
 helo=[192.168.10.48]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qHlUV-0007uB-5j; Fri, 07 Jul 2023 13:27:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=NGovNhW5c54n3jKqEzG21UXSNLBuCoyK+u8u4I8jLUg=; b=q5lRbxibSxkC/Jypxz6RXLzx8c
	L3QekdswMB5ev6aZtDEYGzs5fH+yZzFZSJMghQ9JhHA74yrN7U5kmODw3Zz4dmzzsfUU8OhNJ75JO
	Nq16kVYMxNLFA07hfl97jqKbrje1M2Z92Ek+mDCEfhee/xar72Lo1wsGGUGN1WTyOfwE=;
Message-ID: <78c0f004-4bdb-6f86-e42c-ec3f64d25dd3@xen.org>
Date: Fri, 7 Jul 2023 14:27:17 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 3/3] [FUTURE] xen/arm: enable vPCI for domUs
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Stewart Hildebrand <stewart.hildebrand@amd.com>,
 xen-devel@lists.xenproject.org, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Artem Mygaiev <artem_mygaiev@epam.com>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-4-stewart.hildebrand@amd.com>
 <e5a0ed8a-d85b-fb60-609a-f46884433c60@xen.org>
 <ZKfjoXqb6Kgav-vL@MacBook-Air-de-Roger.local>
 <04c05db8-1e15-f2c1-ebc1-0563d442a808@xen.org>
 <ZKftKtkjgFLWaW_x@MacBook-Air-de-Roger.local>
 <7f89a925-6c4e-7840-041b-2e0816ed7b71@xen.org>
 <ZKf4PMkKF3x2VwXl@MacBook-Air-de-Roger.local>
 <9ca3724c-6ee7-9853-524e-6f55b3702dc4@xen.org>
 <ZKgPZGXY7dkDLnQR@MacBook-Air-de-Roger.local>
From: Julien Grall <julien@xen.org>
In-Reply-To: <ZKgPZGXY7dkDLnQR@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 07/07/2023 14:13, Roger Pau MonnÃ© wrote:
> On Fri, Jul 07, 2023 at 01:09:40PM +0100, Julien Grall wrote:
>> Hi,
>>
>> On 07/07/2023 12:34, Roger Pau MonnÃ© wrote:
>>> On Fri, Jul 07, 2023 at 12:16:46PM +0100, Julien Grall wrote:
>>>>
>>>>
>>>> On 07/07/2023 11:47, Roger Pau MonnÃ© wrote:
>>>>> On Fri, Jul 07, 2023 at 11:33:14AM +0100, Julien Grall wrote:
>>>>>> Hi,
>>>>>>
>>>>>> On 07/07/2023 11:06, Roger Pau MonnÃ© wrote:
>>>>>>> On Fri, Jul 07, 2023 at 10:00:51AM +0100, Julien Grall wrote:
>>>>>>>> On 07/07/2023 02:47, Stewart Hildebrand wrote:
>>>>>>>>> Note that CONFIG_HAS_VPCI_GUEST_SUPPORT is not currently used in the upstream
>>>>>>>>> code base. It will be used by the vPCI series [1]. This patch is intended to be
>>>>>>>>> merged as part of the vPCI series.
>>>>>>>>>
>>>>>>>>> v1->v2:
>>>>>>>>> * new patch
>>>>>>>>> ---
>>>>>>>>>       xen/arch/arm/Kconfig              | 1 +
>>>>>>>>>       xen/arch/arm/include/asm/domain.h | 2 +-
>>>>>>>>>       2 files changed, 2 insertions(+), 1 deletion(-)
>>>>>>>>>
>>>>>>>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>>>>>>>> index 4e0cc421ad48..75dfa2f5a82d 100644
>>>>>>>>> --- a/xen/arch/arm/Kconfig
>>>>>>>>> +++ b/xen/arch/arm/Kconfig
>>>>>>>>> @@ -195,6 +195,7 @@ config PCI_PASSTHROUGH
>>>>>>>>>       	depends on ARM_64
>>>>>>>>>       	select HAS_PCI
>>>>>>>>>       	select HAS_VPCI
>>>>>>>>> +	select HAS_VPCI_GUEST_SUPPORT
>>>>>>>>>       	default n
>>>>>>>>>       	help
>>>>>>>>>       	  This option enables PCI device passthrough
>>>>>>>>> diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
>>>>>>>>> index 1a13965a26b8..6e016b00bae1 100644
>>>>>>>>> --- a/xen/arch/arm/include/asm/domain.h
>>>>>>>>> +++ b/xen/arch/arm/include/asm/domain.h
>>>>>>>>> @@ -298,7 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
>>>>>>>>>       #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag)
>>>>>>>>> -#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); })
>>>>>>>>> +#define has_vpci(d)    ({ (void)(d); IS_ENABLED(CONFIG_HAS_VPCI); })
>>>>>>>>
>>>>>>>> As I mentioned in the previous patch, wouldn't this enable vPCI
>>>>>>>> unconditionally for all the domain? Shouldn't this be instead an optional
>>>>>>>> feature which would be selected by the toolstack?
>>>>>>>
>>>>>>> I do think so, at least on x86 we signal whether vPCI should be
>>>>>>> enabled for a domain using xen_arch_domainconfig at domain creation.
>>>>>>>
>>>>>>> Ideally we would like to do this on a per-device basis for domUs, so
>>>>>>> we should consider adding a new flag to xen_domctl_assign_device in
>>>>>>> order to signal whether the assigned device should use vPCI.
>>>>>>
>>>>>> I am a bit confused with this paragraph. If the device is not using vPCI,
>>>>>> how will it be exposed to the domain? Are you planning to support both vPCI
>>>>>> and PV PCI passthrough for a same domain?
>>>>>
>>>>> You could have an external device model handling it using the ioreq
>>>>> interface, like we currently do passthrough for HVM guests.
>>>>
>>>> IMHO, if one decide to use QEMU for emulating the host bridge, then there is
>>>> limited point to also ask Xen to emulate the hostbridge for some other
>>>> device. So what would be the use case where you would want to be a
>>>> per-device basis decision?
>>>
>>> You could also emulate the bridge in Xen and then have QEMU and
>>> vPCI handle accesses to the PCI config space for different devices.
>>> The ioreq interface already allows registering for config space
>>> accesses on a per SBDF basis.
>>>
>>> XenServer currently has a use-case where generic PCI device
>>> passthrough is handled by QEMU, while some GPUs are passed through
>>> using a custom emulator.  So some domains effectively end with a QEMU
>>> instance and a custom emulator, I don't see why you couldn't
>>> technically replace QEMU with vPCI in this scenario.
>>>
>>> The PCI root complex might be emulated by QEMU, or ideally by Xen.
>>> That shouldn't prevent other device models from handling accesses for
>>> devices, as long as accesses to the ECAM region(s) are trapped and
>>> decoded by Xen.  IOW: if we want bridges to be emulated by ioreq
>>> servers we need to introduce an hypercall to register ECAM regions
>>> with Xen so that it can decode accesses and forward them
>>> appropriately.
>>
>> Thanks for the clarification. Going back to the original discussion. Even
>> with this setup, I think we still need to tell at domain creation whether
>> vPCI will be used (think PCI hotplug).
> 
> Well, for PCI hotplug you will still need to execute a
> XEN_DOMCTL_assign_device hypercall in order to assign the device, at
> which point you could pass the vPCI flag.

I am probably missing something here. If you don't pass the vPCI flag at 
domain creation, wouldn't it mean that hostbridge would not be created 
until later? Are you thinking to make it unconditionally or hotplug it 
(even that's even possible)?

> 
> What you likely want at domain create is whether the IOMMU should be
> enabled or not, as we no longer allow late enabling of the IOMMU once
> the domain has been created.
> 
> One question I have is whether Arm plans to allow exposing fully
> emulated devices on the PCI config space, or that would be limited to
> PCI device passthrough?

In the longer term, I would expect to have a mix of physical and 
emulated device (e.g. virtio).

> 
> IOW: should an emulated PCI root complex be unconditionally exposed to
> guests so that random ioreq servers can register for SBDF slots?

I would say no. The vPCI should only be added when the configuration 
requested it. This is to avoid exposing unnecessary emulation to a 
domain (not everyone will want to use a PCI hostbridge).

> 
>> After that, the device assignment hypercall could have a way to say whether
>> the device will be emulated by vPCI. But I don't think this is necessary to
>> have from day one as the ABI will be not stable (this is a DOMCTL).
> 
> Indeed, it's not a stable interface, but we might as well get
> something sane if we have to plumb it through the tools.  Either if
> it's a domain create flag or a device attach flag you will need some
> plumbing to do at the toolstack level, at which point we might as well
> use an interface that doesn't have arbitrary limits.

I think we need both flags. In your approach you seem to want to either 
have the hostbridge created unconditionally or hotplug it (if that's 
even possible).

However, I don't think we should have the vPCI unconditionally created 
and we should still allow the toolstack to say at domain creation that 
PCI will be used.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 13:41:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 13:41:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560507.876470 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHlhj-0008Iv-NC; Fri, 07 Jul 2023 13:40:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560507.876470; Fri, 07 Jul 2023 13:40:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHlhj-0008Io-JN; Fri, 07 Jul 2023 13:40:59 +0000
Received: by outflank-mailman (input) for mailman id 560507;
 Fri, 07 Jul 2023 13:40:58 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=GM+b=CZ=citrix.com=prvs=545203e5e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qHlhi-0008IP-0u
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 13:40:58 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e50a52f3-1ccb-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 15:40:55 +0200 (CEST)
Received: from mail-bn8nam12lp2177.outbound.protection.outlook.com (HELO
 NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.177])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 07 Jul 2023 09:40:52 -0400
Received: from MW4PR03MB6428.namprd03.prod.outlook.com (2603:10b6:303:123::8)
 by SA1PR03MB7056.namprd03.prod.outlook.com (2603:10b6:806:325::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Fri, 7 Jul
 2023 13:40:49 +0000
Received: from MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd]) by MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd%7]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 13:40:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e50a52f3-1ccb-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688737255;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=fi0xmYWFRve/QS7cMINJGq5J3kU0Bi/DzYoFjpwMOVA=;
  b=U5+NxTazkwQTS91a7gRdMYH9k3IeP+f1ScgmAPSDbGm5qA0VMcZh1KUB
   6H7kNlJEYZm9V5qsEmtWwRF/BXG0+5tpSA7DfvUDpgJB8rZHLbAPXYcae
   iqrHftNA7w1oEtoZqaXUMfPN9GDuxzYu5LbMCNMrkbT/DeNU/vbc2LpJJ
   s=;
X-IronPort-RemoteIP: 104.47.55.177
X-IronPort-MID: 115500002
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:fLObt6v5FQNWXq+PQlPZWup+7efnVOZfMUV32f8akzHdYApBsoF/q
 tZmKWGGM/mDZDT2L4tzaY+1pBwDupDRxoQ2HQM9/y43Qi1H+JbJXdiXEBz9bniYRiHhoOCLz
 O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQqIu
 Nfjy+XSI1bg0DNvWo4uw/vrRChH4rKq4Vv0gnRkPaoQ5ACGyCFMZH4iDfrZw0XQE9E88tGSH
 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9
 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG
 fMwdgFRQB+furyN7YmKQ89Xmpt6Cuq7BdZK0p1g5Wmx4fcOZ7nmGv+Pz/kImTA6i4ZJAOrUY
 NcfZXx3dhPcbhZTO1ARTpUjgOOvgXq5eDpdwL6XjfNvvy6Pk0osjf60b4W9lt+iHK25m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N46
 DePr1vj6wmdL5gUUtRPpZ1fSKMMB24fTvcdGaJZVj3HqAOPHzA75bx/bUu/emvPJgF1oE7lp
 jNWE5R8TdaQTOmNeSemJlQthzdSmS0WjrgjslY+phio7X5AL7mKzeKRlwim9ap5/8fHsrYUf
 CuP48+OY6UEUL+XYJSmwHuUZhbLncTFMUTp9YgQlqL5tnGL4X739arAso75ICdYgrMdlmPc0
 frBgKDW/moxnrbJEPQkVzWR27nfFD58NZ5DLXaltJjuLQwCg==
X-Talos-CUID: =?us-ascii?q?9a23=3AYKHWjGuw1sDuC5tFvXkjDFts6It7QyHzw2vtfXS?=
 =?us-ascii?q?VMldgboaJFga22/Ndxp8=3D?=
X-Talos-MUID: 9a23:lCX2Dgv2lAo4aUoCyc2nhTA4LdYz2fyXNXszj7Ijouu9ajxyAmLI
X-IronPort-AV: E=Sophos;i="6.01,187,1684814400"; 
   d="scan'208";a="115500002"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=lmgAIoeOyoc71H9AlzPwN87V2yF/f4sHQ5DWDf6YkSFTlUy6zXt6Pc/53jpKBU8gzTE/TB0egBetGjaumdyo/De+TI3uqdHMadW3tS+0McZlPBll/6AmWkeH5zG/5Us3DbQ9YIrYt8U5fQcby+ZjX8jQ7olI8JU/zv/3PF4V/IVYDEdrIUiuAmDeESUPWZLwSi4AJ5JAgiljt8PTRAThTGScWzIM8Xupnw/bKRZMAt9+RjaiC0VTE0879ROFxrG4IgCzr2I6oW2IiqaH2scLieUYOC1b8iHewKEFOZFYIz5ZMl+7JM2+8YY9ZWNJnCQNe2aqaJmkAFfm7Ham04xuFQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=mKqHOiBRlhA6MKR5OwHg83eo+1ILFlGtOUD75klLS/g=;
 b=VkExaI0mD/vF74fu+mnByZGz4jymdkzE2p2uuXCyD4G2wbKQuXxxc9W5IoOr3zFS59GBmU7R+BiUucz7CYX84I3W5j/lkzSWR8aDWrwFtAzzVh7uAzq+DnGcK+YI4FZ1ZzRyE+/i+0VDdjeKyfD0C12jQkWWDSQ9QIDt+Q3aWw/ljBqJd7JECqkD3Ly+IXwsbn2cIaJjam0xYOChOEqqWqod0cVrPc2cf/ydm2WPCIiK+F5OepdXxaSg7JPeHk/7MmPCKlK3sZ4I0/T1vlRNo2ofslFKBYmDB4sp/ULJrTo+CQWrNp1fOm7DWw0PRq0o2QzfAraPZ50Y7+4UwIfXYg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=mKqHOiBRlhA6MKR5OwHg83eo+1ILFlGtOUD75klLS/g=;
 b=MnBa2g+80zp5KFf6lVPhbu2USOG4XmizOylx129us5vG3ZGurMqV3gP9RsyAN+Mpxt9fOk6gGCVAWlLpMGPv5u61rJReyRbEwV8F4PsvmcRH2+yHWLJbPOApc4ChywI43M4YDYCZKhRfS7TOk5HDCHe2rNeqQ35qLP/dbANxG4Y=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 7 Jul 2023 15:40:43 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Julien Grall <julien@xen.org>
Cc: Stewart Hildebrand <stewart.hildebrand@amd.com>,
	xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Artem Mygaiev <artem_mygaiev@epam.com>
Subject: Re: [PATCH v2 3/3] [FUTURE] xen/arm: enable vPCI for domUs
Message-ID: <ZKgV2x3PqUJUHdic@MacBook-Air-de-Roger.local>
References: <20230707014754.51333-4-stewart.hildebrand@amd.com>
 <e5a0ed8a-d85b-fb60-609a-f46884433c60@xen.org>
 <ZKfjoXqb6Kgav-vL@MacBook-Air-de-Roger.local>
 <04c05db8-1e15-f2c1-ebc1-0563d442a808@xen.org>
 <ZKftKtkjgFLWaW_x@MacBook-Air-de-Roger.local>
 <7f89a925-6c4e-7840-041b-2e0816ed7b71@xen.org>
 <ZKf4PMkKF3x2VwXl@MacBook-Air-de-Roger.local>
 <9ca3724c-6ee7-9853-524e-6f55b3702dc4@xen.org>
 <ZKgPZGXY7dkDLnQR@MacBook-Air-de-Roger.local>
 <78c0f004-4bdb-6f86-e42c-ec3f64d25dd3@xen.org>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <78c0f004-4bdb-6f86-e42c-ec3f64d25dd3@xen.org>
X-ClientProxiedBy: LO2P265CA0451.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:e::31) To MW4PR03MB6428.namprd03.prod.outlook.com
 (2603:10b6:303:123::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MW4PR03MB6428:EE_|SA1PR03MB7056:EE_
X-MS-Office365-Filtering-Correlation-Id: 4a0a1486-4766-4a7b-aac0-08db7eefc65f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	eqRX1hHMl0Xdz7FSNi8FEfnqNjK246gxBuy0HDV5k3DSrvUAjQW0lOSUWA2SdWnu49HMlDt4OCbcFkpI6RFqqEUgt696h/7VXta8ewqt7ZuEYcLqoglT2QVcFNDRaLHBEH4cgKBMNdCmo+o3FXqTWRW6kX/vMAvCGDrQ03br5aBJAsfwNA/SFbaH89NzHzfmVbIscyjndoMI3Ecgc5EkmkpMrhkimrhz07vUDeWcV62O4yaa1PJgrgt0Uj146rF4gcPKWfjW0vgSghnkPCazIYTC1HLDFa0VEtRORXg1t7N7vV8WAB4Z4mkGscEjgdtT3BTPaIufAJsjVHIU8sDdOMh3weijflqe/ZAIck4m2EK3lCSUxVtwmwGUSDMyyMjjiJ/CGjpgtidRDODPrrsYub3zJeFPJW4BImothk6WKJkpSSZXwHtBSwM51bpOHYyupFAg+EcDQ+X2bNpMQB8nupl/AGAkhT1JIPeB7+iNwV+iKDA9xgaMssYPrU2XMDw8Hp/JcdJfj46hkzerSoL9Ol03vei+E4/7u2FvawworUAp9F7ZGqC+2sjtirfMDy2L
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR03MB6428.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(366004)(136003)(39860400002)(396003)(376002)(451199021)(5660300002)(8936002)(8676002)(6916009)(4326008)(66556008)(66946007)(66476007)(41300700001)(316002)(54906003)(478600001)(6666004)(6486002)(6506007)(53546011)(6512007)(26005)(9686003)(2906002)(186003)(66899021)(82960400001)(38100700002)(83380400001)(85182001)(86362001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YWxnVFhjMkdLdk42S1VodUFDRlk0L3JLd3Z0SWRpb1FXSGt3d2s0djV1V0p6?=
 =?utf-8?B?NUg5OGJienR2bzNWbzNkN3BlRjZDclFTS2RRZG43dXR6c3MzSWVoeDZsd3pF?=
 =?utf-8?B?WmtLQ2djcWJVRnRqelQ1L040T1p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pVFQaw7nOn27EgvE5oAC+O8Kk8jObDsu8+5P2BGs0QGtIOhCq5Fi+nClMBpCdXw/1fdYn/MJ75S2g3Jieh+gY2Fn9ZOSyR+uvZ+sqE/fiS3rxK4la+yV57VQEdelOZrVrFeJowQrdkPOmQmwfWx8pxA5u8Ta0l8k+/2nJK333KWpV3IFR4WG9zy9eBl6rfE5tytRuJIbOU4PHkukW4Dfm4BNaHkepr8j5RHndBrUW27i+UMydKjerj0kv6PJvwUyTMx/26uGLpSfAk/MiFwnJSIBJ4XNGn5uaEm9+eJTqjhhzWQ==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4a0a1486-4766-4a7b-aac0-08db7eefc65f
X-MS-Exchange-CrossTenant-AuthSource: MW4PR03MB6428.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 13:40:49.5883
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: H2UjKLxwx6n+ErT9SEQO4n6KfCPaLsVdoL6Pq6r4P/AjT/J2xMSowxC5WMC34nrHfs80KwWvtqSXedUc3jqCzw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB7056

On Fri, Jul 07, 2023 at 02:27:17PM +0100, Julien Grall wrote:
> Hi,
> 
> On 07/07/2023 14:13, Roger Pau MonnÃ© wrote:
> > On Fri, Jul 07, 2023 at 01:09:40PM +0100, Julien Grall wrote:
> > > Hi,
> > > 
> > > On 07/07/2023 12:34, Roger Pau MonnÃ© wrote:
> > > > On Fri, Jul 07, 2023 at 12:16:46PM +0100, Julien Grall wrote:
> > > > > 
> > > > > 
> > > > > On 07/07/2023 11:47, Roger Pau MonnÃ© wrote:
> > > > > > On Fri, Jul 07, 2023 at 11:33:14AM +0100, Julien Grall wrote:
> > > > > > > Hi,
> > > > > > > 
> > > > > > > On 07/07/2023 11:06, Roger Pau MonnÃ© wrote:
> > > > > > > > On Fri, Jul 07, 2023 at 10:00:51AM +0100, Julien Grall wrote:
> > > > > > > > > On 07/07/2023 02:47, Stewart Hildebrand wrote:
> > > > > > > > > > Note that CONFIG_HAS_VPCI_GUEST_SUPPORT is not currently used in the upstream
> > > > > > > > > > code base. It will be used by the vPCI series [1]. This patch is intended to be
> > > > > > > > > > merged as part of the vPCI series.
> > > > > > > > > > 
> > > > > > > > > > v1->v2:
> > > > > > > > > > * new patch
> > > > > > > > > > ---
> > > > > > > > > >       xen/arch/arm/Kconfig              | 1 +
> > > > > > > > > >       xen/arch/arm/include/asm/domain.h | 2 +-
> > > > > > > > > >       2 files changed, 2 insertions(+), 1 deletion(-)
> > > > > > > > > > 
> > > > > > > > > > diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> > > > > > > > > > index 4e0cc421ad48..75dfa2f5a82d 100644
> > > > > > > > > > --- a/xen/arch/arm/Kconfig
> > > > > > > > > > +++ b/xen/arch/arm/Kconfig
> > > > > > > > > > @@ -195,6 +195,7 @@ config PCI_PASSTHROUGH
> > > > > > > > > >       	depends on ARM_64
> > > > > > > > > >       	select HAS_PCI
> > > > > > > > > >       	select HAS_VPCI
> > > > > > > > > > +	select HAS_VPCI_GUEST_SUPPORT
> > > > > > > > > >       	default n
> > > > > > > > > >       	help
> > > > > > > > > >       	  This option enables PCI device passthrough
> > > > > > > > > > diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
> > > > > > > > > > index 1a13965a26b8..6e016b00bae1 100644
> > > > > > > > > > --- a/xen/arch/arm/include/asm/domain.h
> > > > > > > > > > +++ b/xen/arch/arm/include/asm/domain.h
> > > > > > > > > > @@ -298,7 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
> > > > > > > > > >       #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag)
> > > > > > > > > > -#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); })
> > > > > > > > > > +#define has_vpci(d)    ({ (void)(d); IS_ENABLED(CONFIG_HAS_VPCI); })
> > > > > > > > > 
> > > > > > > > > As I mentioned in the previous patch, wouldn't this enable vPCI
> > > > > > > > > unconditionally for all the domain? Shouldn't this be instead an optional
> > > > > > > > > feature which would be selected by the toolstack?
> > > > > > > > 
> > > > > > > > I do think so, at least on x86 we signal whether vPCI should be
> > > > > > > > enabled for a domain using xen_arch_domainconfig at domain creation.
> > > > > > > > 
> > > > > > > > Ideally we would like to do this on a per-device basis for domUs, so
> > > > > > > > we should consider adding a new flag to xen_domctl_assign_device in
> > > > > > > > order to signal whether the assigned device should use vPCI.
> > > > > > > 
> > > > > > > I am a bit confused with this paragraph. If the device is not using vPCI,
> > > > > > > how will it be exposed to the domain? Are you planning to support both vPCI
> > > > > > > and PV PCI passthrough for a same domain?
> > > > > > 
> > > > > > You could have an external device model handling it using the ioreq
> > > > > > interface, like we currently do passthrough for HVM guests.
> > > > > 
> > > > > IMHO, if one decide to use QEMU for emulating the host bridge, then there is
> > > > > limited point to also ask Xen to emulate the hostbridge for some other
> > > > > device. So what would be the use case where you would want to be a
> > > > > per-device basis decision?
> > > > 
> > > > You could also emulate the bridge in Xen and then have QEMU and
> > > > vPCI handle accesses to the PCI config space for different devices.
> > > > The ioreq interface already allows registering for config space
> > > > accesses on a per SBDF basis.
> > > > 
> > > > XenServer currently has a use-case where generic PCI device
> > > > passthrough is handled by QEMU, while some GPUs are passed through
> > > > using a custom emulator.  So some domains effectively end with a QEMU
> > > > instance and a custom emulator, I don't see why you couldn't
> > > > technically replace QEMU with vPCI in this scenario.
> > > > 
> > > > The PCI root complex might be emulated by QEMU, or ideally by Xen.
> > > > That shouldn't prevent other device models from handling accesses for
> > > > devices, as long as accesses to the ECAM region(s) are trapped and
> > > > decoded by Xen.  IOW: if we want bridges to be emulated by ioreq
> > > > servers we need to introduce an hypercall to register ECAM regions
> > > > with Xen so that it can decode accesses and forward them
> > > > appropriately.
> > > 
> > > Thanks for the clarification. Going back to the original discussion. Even
> > > with this setup, I think we still need to tell at domain creation whether
> > > vPCI will be used (think PCI hotplug).
> > 
> > Well, for PCI hotplug you will still need to execute a
> > XEN_DOMCTL_assign_device hypercall in order to assign the device, at
> > which point you could pass the vPCI flag.
> 
> I am probably missing something here. If you don't pass the vPCI flag at
> domain creation, wouldn't it mean that hostbridge would not be created until
> later? Are you thinking to make it unconditionally or hotplug it (even
> that's even possible)?

I think at domain creation more than a vPCI flag you want an 'emulate a
PCI bridge' flag.  Such flag will also be needed if in the future you
want to support virtio-pci devices for example, and those have nothing
do to do with vPCI.

> > 
> > What you likely want at domain create is whether the IOMMU should be
> > enabled or not, as we no longer allow late enabling of the IOMMU once
> > the domain has been created.
> > 
> > One question I have is whether Arm plans to allow exposing fully
> > emulated devices on the PCI config space, or that would be limited to
> > PCI device passthrough?
> 
> In the longer term, I would expect to have a mix of physical and emulated
> device (e.g. virtio).

That's what I would expect.

> > 
> > IOW: should an emulated PCI root complex be unconditionally exposed to
> > guests so that random ioreq servers can register for SBDF slots?
> 
> I would say no. The vPCI should only be added when the configuration
> requested it. This is to avoid exposing unnecessary emulation to a domain
> (not everyone will want to use a PCI hostbridge).

Right, then as replied above you might want a domain create flag to
signal whether to emulate a PCI bridge for the domain.

> > 
> > > After that, the device assignment hypercall could have a way to say whether
> > > the device will be emulated by vPCI. But I don't think this is necessary to
> > > have from day one as the ABI will be not stable (this is a DOMCTL).
> > 
> > Indeed, it's not a stable interface, but we might as well get
> > something sane if we have to plumb it through the tools.  Either if
> > it's a domain create flag or a device attach flag you will need some
> > plumbing to do at the toolstack level, at which point we might as well
> > use an interface that doesn't have arbitrary limits.
> 
> I think we need both flags. In your approach you seem to want to either have
> the hostbridge created unconditionally or hotplug it (if that's even
> possible).

You could in theory have hotplug MCFG (ECAM) regions in ACPI, but I'm
unsure how many OSes support that, but no, I don't think we should try
to hotplug PCI bridges.

I was thinking that for x86 PVH we might want to unconditionally
expose a PCI bridge, but it might be better to signal that from the
domain configuration and not make it mandatory.

> However, I don't think we should have the vPCI unconditionally created and
> we should still allow the toolstack to say at domain creation that PCI will
> be used.

Indeed.  I think a domain create emulate a PCI bridge flag and a vPCI
flag for XEN_DOMCTL_assign_device are required.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 13:59:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 13:59:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560514.876479 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHlzo-0001Wu-8D; Fri, 07 Jul 2023 13:59:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560514.876479; Fri, 07 Jul 2023 13:59:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHlzo-0001Wn-5b; Fri, 07 Jul 2023 13:59:40 +0000
Received: by outflank-mailman (input) for mailman id 560514;
 Fri, 07 Jul 2023 13:59:39 +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
 <SRS0=GM+b=CZ=citrix.com=prvs=545203e5e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qHlzn-0001Wh-Ja
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 13:59:39 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 81b6edb6-1cce-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 15:59:37 +0200 (CEST)
Received: from mail-bn7nam10lp2103.outbound.protection.outlook.com (HELO
 NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.103])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 07 Jul 2023 09:59:26 -0400
Received: from MW4PR03MB6428.namprd03.prod.outlook.com (2603:10b6:303:123::8)
 by SA3PR03MB7347.namprd03.prod.outlook.com (2603:10b6:806:394::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 13:59:24 +0000
Received: from MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd]) by MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd%7]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 13:59:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 81b6edb6-1cce-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688738377;
  h=from:to:cc:subject:date:message-id:
   content-transfer-encoding:mime-version;
  bh=fCTC2wQivQP2l8kHphqtNQX9bYdmJIumQq5GXrUxd0o=;
  b=gyw3tQ8INjEAJWpNlCnHhLETVeADHLqZvQrZ/0am2RUaDByvp41TWVbm
   IXPbJrGxz3S+gK7mUl2DCLo+9M80DvubLaL6l41IHbaxMZv0CT/+YGQdB
   e8DFu35xzZkeyX5WXo6XdrOi6poUTgAjxOqjrFBi/ju/CNVQhYPGRSLDu
   0=;
X-IronPort-RemoteIP: 104.47.70.103
X-IronPort-MID: 114787854
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:UD3lOKIiO7Ho63G1FE+Rw5QlxSXFcZb7ZxGr2PjKsXjdYENS1DUAn
 zMYXG+Ga/ncNDOkLYtwaNi/8B9V68fWnNJiHgNlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws
 Jb5rta31GWNglaYCUpKrfrawP9TlK6q4mhA4QRhPaojUGL2zBH5MrpOfcldEFOgKmVkNrbSb
 /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/
 jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c54HH9oq
 KMSNQkpf1O7m+js5aOxS+Vj05FLwMnDZOvzu1lG5BSAVbMMZ8+GRK/Ho9hFwD03m8ZCW+7EY
 NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/VvpTGLl2Sd05C0WDbRUsaNSshP2F6Ru
 0rN/njjAwFcP9uaodaA2iv12rCfwnOmBOr+EpWb/OM13XLJgVVQMw0XDUOShb67lm6hDoc3x
 0s8v3BGQbIJ3FymSJzxUgO1pFaAvwUAQJxAHusi8gaPx6HIpQGDCQAsTDRMddgnv88eXiEx2
 xmCmNaBONB0mLicSHbY/LHLqzq3YHARNTVbPXRCShYZ6d7+po11lgjIUttoDK+yiJvyBC30x
 DeJ6iM5gt3/kPI26klyxnif6xrEm3QDZlddCtn/No590j5EWQ==
IronPort-HdrOrdr: A9a23:OpxbdKpHUBYYX9Lb5VKJP0oaV5v5L9V00zEX/kB9WHVpm5Oj+v
 xGzc5w6farsl0ssRAb6La90cy7LU80mqQFhbX5UY3SPjUO21HYT72Kj7GSugEIcheWnoEytZ
 uIG5IOcOEYZmIK6voSjjPIdurI9OP3i5xAyN2uvEtFfEVPUeVN/g15AgGUHglfQxRHP4MwEN
 656tBcrzStVHwLZoDjb0N1KtTrlpnurtbLcBQGDxko5E2nii6p0qfzF1y90g0FWz1C7L8++S
 zukhD/5I+kr/anoyWspVP73tBzop/M29FDDMuDhow8LSjtsB+hYMBbV7iLrFkO0Z+SAAJBqr
 jxiiZlG/42x2Laf2mzrxeo8RLnyiwS53jrzkLdqWf/oOTiLQhKQfZptMZ8SF/0+kAgtNZz3O
 ZgxGSCradaChvGgWDU+8XIbRd3jUC5yEBS2tL7t0YvHLf2VYUh5LD3vXklZqvoJRiKn7zPxd
 MeRP01555tACynhj7izyVSKeeXLwgO9ye9MzU/U/OuokJrdVBCvjolLZ8k7wc9HdQGOu1529
 g=
X-Talos-CUID: 9a23:WRTfaGCpnNukgSj6EyZ66mhJRco4S1nMj0/MKRWdGGxoRLLAHA==
X-Talos-MUID: 9a23:hpS+lQqdrUWXG0ahOHMezxJoKZg1zP7pMQM2gZReo+Cgci5sGyjI2Q==
X-IronPort-AV: E=Sophos;i="6.01,189,1684814400"; 
   d="scan'208";a="114787854"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=MMJ0Pjxuy7bQDEOuWZfG8QNft/LjhYJwlbcx0Aw/zfmGWiwuR15aQk7furwZKfOOBEvsSN6plgx4vJCPfM9vaVZnd/OQrVe1eS/zgqDv52RY+Oe176GYg72S7Xr7NauP9f8WHsCVNEAG+haPH6Mlr9MYQVS8IB4EpFdJFlVM7bB3q5+tjSoYhht+W3UtApkG8IZp4BuwTfN3LYLPLwxE2hfectEN3WJJqU2JKnmlfWBp5YCtKIpsuYz8UYtaFD4UJN1GqgutgQRfaTCVs2h9d9RXflzh1LadZf0ojXOHW1Uwuvr+My3Ow+xCRGQ0Suz3Sn0Jq0QQdK4Axg3I8wXrnA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=gauybQdT91IQj1nb0helNPZvmZ3xxIn2FZDVAC7JLK0=;
 b=Ve3hD8ZpzvcMoo0TKAipfORBQqozuVsA4i4Td4lMxtRmCMbwTVmjpCxve9t4stiZwrl1c7vrwvjAQTLHJPaAdkg7ecU5G4k4iyPGgCe1LrADRG2ZTwZFz9Ponkvubvk/H96eAJHw/I2ekS7RQijb3nMEXfVex5y5W7RGUd08U1VlmGLrqoT4A+F2AOjBpW6d8VPcpjbgzbRpgA4Ialth+y4muUnhTsxm8VSwyJFqa3gJnizBFephqFy+yzGl+tMg2QKK8OKyp+KA4iGMbt/ULzHilrUkI96A82d1MrXxlTrxaYsSfJswG5MATcEHxrN57NUioJz1kROghR+xpEav2g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=gauybQdT91IQj1nb0helNPZvmZ3xxIn2FZDVAC7JLK0=;
 b=exlCuSC8EyDdZO4tYI+hT6Ysjk4b0lGZA1GeIy88RPuO4LdhjQqhJSb5WLodQ7TdiRZTfZRYR6mWDP8rynGKdE2y/L2k02ZfFSjR6yYIX1VpS67/PA/hw/hcd23hoAO9yIsRNzRvXlqaT7GW4rhwN0+0xpRdWXLK2kU9ze9Sopc=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH] iommu/amd-vi: avoid pointless flushes in invalidate_all_domain_pages()
Date: Fri,  7 Jul 2023 15:59:15 +0200
Message-ID: <20230707135915.47359-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0083.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2bd::20) To MW4PR03MB6428.namprd03.prod.outlook.com
 (2603:10b6:303:123::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MW4PR03MB6428:EE_|SA3PR03MB7347:EE_
X-MS-Office365-Filtering-Correlation-Id: 7db37886-2243-4080-2128-08db7ef25eae
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	VbyRhPUGgKX9QMR1+yMsc/PE7U6SpPvtZSfkT3/1pQnbMtLZmHRvWaOM4YMQJUd3Gu3azvcrAghDTht5RiYaVc6gnyeLm63lmgvLx/MHYtGtBwg4ZYKVuXYreXZGJZa9lqMlYzHSw6Xv9mFX0OxYccniia/D94knmBm/uZ7Fvo+J7P5cAlrk6U661Pz4LHyvzfd87QpxyBbVgArP8XPPQ7CGp7wY9OnWKbh+yotG6vU3YMjODe9UJ1xrx9yTd4aTzzk0LoYZKfLLef6nOcaq7YpV4K+5wUEMiRYDKTYEXJXtbCJXCm7K0htn2teZpZwdPSDP6B4gFWvlrzjcmiJRbtmFPc85utfT3uM+qSc5UhEy9NZhP32AJNJCDV8SsL0LXxsNbtm2qMSNSGMyUe01SjP0IyUUfSY9qEWrZH5cH04Gpd6a40q9HARh8lKF6/gg+91OvDKfxw2WxrTwMHjyO9RpSwwCk07Dju2tNGmaw1zqROq2yDMTT/+hPg6R0LQYgMW7ReHmSRgr6LvBlYwG2uaDbjrpTflxScw9LRjg4JkQVJXG88n9HjjNBJsbKPXC
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR03MB6428.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(136003)(376002)(366004)(396003)(451199021)(8936002)(8676002)(478600001)(5660300002)(41300700001)(66476007)(6916009)(2906002)(316002)(66556008)(4326008)(66946007)(54906003)(6666004)(6486002)(6512007)(2616005)(26005)(107886003)(6506007)(1076003)(186003)(4744005)(82960400001)(83380400001)(36756003)(86362001)(38100700002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cGI3amdYTlFuRHFzU3EyMjluOGdOZWtWT3hhVjJkeWFIanZXZGRNMnBLVC9U?=
 =?utf-8?B?SHBCWVd3ZjZzRHBOV2NZSTM1M0dVY01ZVElDK1VXQzZWUVhxTUY3ZlA4NUd1?=
 =?utf-8?B?QytIMFVIYXQrYjY4dnc1cXlBdnhKT0lyT2hWTkh0d3FvQVpKUnpkcDFEc2dw?=
 =?utf-8?B?bUZuQm9zcDB5aytGNnJhU2tSV0ZXTkg4aTJEbWIyYUhMSkZGbStuK3E2WEQr?=
 =?utf-8?B?dG9BNGQzd3FLVzkwSksxcG93aXB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=
 =?utf-8?B?TjlBN21yMWExWE5LQnowYUU3UGpDOFhlLzZkMWJmWkMyVHB5ZzQ5WVVXOVFh?=
 =?utf-8?B?Tlc3TWQvWWowdm05RmZKRUJUdWFkbklLWkVHQW1XeVEyS0VOUytwSzc5dndm?=
 =?utf-8?B?Vlh0N2ZBSGJxeGNQdG80M2dka3ErZHd5UGIvUUlqSGRtdWxrRGN1K0FNVkZH?=
 =?utf-8?B?dGc9PQ==?=
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	xQ/9Su95xQQN/+yLezUrynno1DwQzrW45XqN23W+3S6xfBMzl+4N67ehPvWRyfWGAxBQjksBTj+jtl9j2Fgz7IcGa3DqSRqWfPz/RpojsHlcF1HPyu/yET7xR7CC4exQ86R78Helk+1DuIRhULpTTkBMEGXKTwQV3gAPL6xLj8ZHHkG+1jhvx1geihhngKFbREOfECvs5MdabfNDllLTdnxjcqMJYAhqjy8EKx8rAflCBwPrXWV6ofOpS/6HOsYFfUWSo1PrKCYgroFPTn8y/9xJrt8P3qUuakvAoYnXENxNvYqL5EzVVto4dISrItWQnw4I7FeIxxPcPLI+iY3eOUbeZbYChNC8MNViES9lhAemBCPTu/X1MBm/X7WvBbjHQx8K1mn0IJduTLNCXCuQZx+aYFcLMepoKtBEUyJswgQ+A1uq5R68DwZeh85cTnVmG2gicunsisPTTpRrYDzZ37RaN+wJViCXuwPtbL4Qe7UbY0evq3VTqvyhJSN9Odn+xY5vxoGqEx1fHa2PMJzy46Tep4avipIgmXPNr87+mk6eeutfp/dkHsRztxp/pT8mxuaYcPdhziIcKGv2BQecSxKVlWq4MOXsvfK1lFZ9Zh+D8VcR0EiOr/m7Gug7VBhVamp+suQlAET0otEPQjzYRp1yTEUmL8ebjz5at2jt8esbLBPXyydSdy+HCTqqhfWXcRH1475UqpJE6XQAIXMjaG6BmmiIK7A9DzI9MfXea14KD9CiMYZPg98WmdOYcsD19xQwiN7uWQcRv0eAoVeENeWS+ICnmvdDbwxNbLApShk=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7db37886-2243-4080-2128-08db7ef25eae
X-MS-Exchange-CrossTenant-AuthSource: MW4PR03MB6428.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 13:59:24.0448
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: M9N7H4y5lqiUKJRZzimw7tZSWxh68FaUELP2UjyygiJoYhgAY1tAX1Bu2kKhVn1SdgTTd1g4AFd1bwjCYL4Tqw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR03MB7347

Fix invalidate_all_domain_pages() to only attempt to flush the domains
that have IOMMU enabled, otherwise the flush is pointless.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
 xen/drivers/passthrough/amd/iommu_init.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index 7dbd7e7d094a..af6713d2fc02 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -1532,8 +1532,10 @@ int __init amd_iommu_init_late(void)
 static void invalidate_all_domain_pages(void)
 {
     struct domain *d;
+
     for_each_domain( d )
-        amd_iommu_flush_all_pages(d);
+        if ( is_iommu_enabled(d) )
+            amd_iommu_flush_all_pages(d);
 }
 
 static int cf_check _invalidate_all_devices(
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 07 14:10:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 14:10:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560519.876490 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHmA7-0003y0-6L; Fri, 07 Jul 2023 14:10:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560519.876490; Fri, 07 Jul 2023 14:10:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHmA7-0003xt-3I; Fri, 07 Jul 2023 14:10:19 +0000
Received: by outflank-mailman (input) for mailman id 560519;
 Fri, 07 Jul 2023 14:10:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=VdXt=CZ=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qHmA5-0003xk-RC
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 14:10:18 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ff33992a-1ccf-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 16:10:16 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id B01CD2275C;
 Fri,  7 Jul 2023 14:10:15 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 61AC01346D;
 Fri,  7 Jul 2023 14:10:15 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id LmRFFsccqGQMbQAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 07 Jul 2023 14:10:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ff33992a-1ccf-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688739015; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=iHOxAAF00A30k/+j6nHhWMpnOAG7uUYP/V8Vk7LQupw=;
	b=oabo90RBI7k5CoA4kvwPKUm7FmAFf16m85vdVif2oCddAaZ4shY0dAEoUUU1ZUTBPckQzi
	HHckCnco570z7qciDuAp9D5UL+op/RwvSDhIj7NK3Rzba9Shrz2hIChhw2buxM0034UiGB
	vZwnYKi8i+zQ6KlsPi0oDwLuKDD3zZE=
Message-ID: <74493ba6-48c5-6326-b027-0b6761ef4836@suse.com>
Date: Fri, 7 Jul 2023 16:10:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <olekstysh@gmail.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 vikram.garhwal@amd.com
References: <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>
 <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com> <ZKQF8qq8Oh5E+Fxx@mail-itl>
 <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
 <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
 <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
 <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>
 <05341cac-ac75-a6e5-9c29-3caf83ea99fc@suse.com>
 <ZKff0w2EpzX5r8vK@MacBook-Air-de-Roger.local>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
In-Reply-To: <ZKff0w2EpzX5r8vK@MacBook-Air-de-Roger.local>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------0YWzv9r376Qj34YgvQLmAgcL"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------0YWzv9r376Qj34YgvQLmAgcL
Content-Type: multipart/mixed; boundary="------------Z0NhCYu4dYSsTtrATMQiKS1o";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <olekstysh@gmail.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 vikram.garhwal@amd.com
Message-ID: <74493ba6-48c5-6326-b027-0b6761ef4836@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
References: <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>
 <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com> <ZKQF8qq8Oh5E+Fxx@mail-itl>
 <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
 <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
 <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
 <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>
 <05341cac-ac75-a6e5-9c29-3caf83ea99fc@suse.com>
 <ZKff0w2EpzX5r8vK@MacBook-Air-de-Roger.local>
In-Reply-To: <ZKff0w2EpzX5r8vK@MacBook-Air-de-Roger.local>

--------------Z0NhCYu4dYSsTtrATMQiKS1o
Content-Type: multipart/mixed; boundary="------------MXYfnUjLHQcYPbl2eTMn8Q9N"

--------------MXYfnUjLHQcYPb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QpiYWNrZW5kLCBvZiBjb3Vy
c2UpLg0KDQoNCkp1ZXJnZW4NCg0KWzFdOiANCmh0dHA6Ly9kb2NzLm9hc2lzLW9wZW4ub3Jn
L3ZpcnRpby92aXJ0aW8vdjEuMi92aXJ0aW8tdjEuMi5wZGYjc3Vic3Vic2VjdGlvbi40LjEu
NC4zDQo=
--------------MXYfnUjLHQcYPbl2eTMn8Q9N
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5RnNVUJbvoPH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5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------MXYfnUjLHQcYPbl2eTMn8Q9N--

--------------Z0NhCYu4dYSsTtrATMQiKS1o--

--------------0YWzv9r376Qj34YgvQLmAgcL
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSoHMYFAwAAAAAACgkQsN6d1ii/Ey/+
Mgf9EPOtq/i+HhpVcnzN9udysPk9Q7bQCvOrbl83vg5vsgVNq+NQPhFjl43g2vOxP6uSaZc784hl
xX71ZVJRNyICsZ1rxt3Ex0We5E1e5fgdizic1Q9IhvFaiYhRgch6NyxpxH7c6lwwu/Kdb2QCjXuw
+v1EirflHDirShhGJ2sqG6gDKnFoBoZZWkSZB54zR2+Ee42a8pUxespliXNW0mncR6dGPNf08uRa
0P7NeOpACLCJLpJl6BdP1tDc6xGwFbKHhp7wPNqC+xL4B4+NxLDeVrpR9kFlPKdpqc48JtNFbw3M
AbCIa6wGs+Si6QS4+RVyQbvkhosHmeK0Bo1cZaduHQ==
=Jots
-----END PGP SIGNATURE-----

--------------0YWzv9r376Qj34YgvQLmAgcL--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 14:28:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 14:28:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560525.876500 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHmRI-0005bi-RI; Fri, 07 Jul 2023 14:28:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560525.876500; Fri, 07 Jul 2023 14:28:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHmRI-0005bb-Mh; Fri, 07 Jul 2023 14:28:04 +0000
Received: by outflank-mailman (input) for mailman id 560525;
 Fri, 07 Jul 2023 14:28:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=VdXt=CZ=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qHmRH-0005bV-JN
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 14:28:03 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7a1318d6-1cd2-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 16:28:01 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id D4B811FDA8;
 Fri,  7 Jul 2023 14:28:00 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7E144139E0;
 Fri,  7 Jul 2023 14:28:00 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id q6ZFHfAgqGS0dQAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 07 Jul 2023 14:28:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7a1318d6-1cd2-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688740080; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=GDaG49MjZZ9m6rAsgdhSgUWt0nb0O6bInSa3AoannsE=;
	b=fZOF2qUCjwV+xQr8V7MSqKPKHfuznzo01lfvFBPGCGfpXBYBdI6I4gvOXxtmW94JmZap5L
	CVePKAPRJgYQPmu/VMKwDm+Xt5cFfUjeN5F2uFHisCE9J2ZsKI2Hq5gJ65D+Ze0lm30E9j
	jL3K/xOKH244Oqsiyn1Zm5E77YQYZRc=
Message-ID: <00f2ae75-b3cd-6c6d-c1c5-b2e9d6a974b6@suse.com>
Date: Fri, 7 Jul 2023 16:27:59 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <olekstysh@gmail.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 vikram.garhwal@amd.com
References: <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>
 <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com> <ZKQF8qq8Oh5E+Fxx@mail-itl>
 <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
 <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
 <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
 <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>
 <05341cac-ac75-a6e5-9c29-3caf83ea99fc@suse.com>
 <ZKff0w2EpzX5r8vK@MacBook-Air-de-Roger.local>
 <74493ba6-48c5-6326-b027-0b6761ef4836@suse.com>
In-Reply-To: <74493ba6-48c5-6326-b027-0b6761ef4836@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------Rn6WLhPRazTf0w0yBOa9MskN"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------Rn6WLhPRazTf0w0yBOa9MskN
Content-Type: multipart/mixed; boundary="------------0aHEKMBKGLFCUAXrXu1i8iGv";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <olekstysh@gmail.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 vikram.garhwal@amd.com
Message-ID: <00f2ae75-b3cd-6c6d-c1c5-b2e9d6a974b6@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
References: <ZKPO5WbFGblXU5hX@MacBook-Air-de-Roger.local>
 <e5eda26f-9a31-dc3a-d97f-33d2efa20efa@suse.com> <ZKQF8qq8Oh5E+Fxx@mail-itl>
 <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
 <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
 <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
 <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>
 <05341cac-ac75-a6e5-9c29-3caf83ea99fc@suse.com>
 <ZKff0w2EpzX5r8vK@MacBook-Air-de-Roger.local>
 <74493ba6-48c5-6326-b027-0b6761ef4836@suse.com>
In-Reply-To: <74493ba6-48c5-6326-b027-0b6761ef4836@suse.com>

--------------0aHEKMBKGLFCUAXrXu1i8iGv
Content-Type: multipart/mixed; boundary="------------XUZAguPkyzrC4lcfNeo16yqk"

--------------XUZAguPkyzr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9mIHRob3NlLg0KPiANCj4gSGF2ZSBhIGxvb2sgYXQgWzFd
LCB3aGljaCBpcyBkZXNjcmliaW5nIHRoZSBjb21tb24gZGV2aWNlIGNvbmZpZyBsYXlvdXQu
DQo+IFRoZSBwcm9ibGVtIGhlcmUgaXMgdGhhdCB3ZSdkIG5lZWQgdG8gYWRkIHRoZSBkb21p
ZCBhZnRlciB0aGUgcXVldWUgc3BlY2lmaWMNCj4gZGF0YSwgcmVzdWx0aW5nIGluIGEgbWVz
cyBpZiBmdXJ0aGVyIHF1ZXVlIGZpZWxkcyB3b3VsZCBiZSBhZGRlZCBsYXRlci4NCj4gDQo+
IFdlIGNvdWxkIHRyeSB0aGF0LCBvZiBjb3Vyc2UuDQoNClRoaW5raW5nIG1vcmUgYWJvdXQg
aXQsIHRoZSB2aXJ0aW8gSU9NTVUgZGV2aWNlIHNlZW1zIHRvIGJlIGEgYmV0dGVyIGZpdDoN
Cg0KSW4gY2FzZSB3ZSdkIGFkZCB0aGUgZG9taWQgdG8gdGhlIGRldmljZSdzIFBDSSBjb25m
aWcgc3BhY2UsIHRoZSB2YWx1ZSB3b3VsZA0KYmUgY29udHJvbGxlZCBieSB0aGUgYmFja2Vu
ZCBkb21haW4uIElNTyB0aGUgZG9taWQgcGFzc2VkIHRvIHRoZSBmcm9udGVuZA0Kc2hvdWxk
IGJlIGNvbnRyb2xsZWQgYnkgYSB0cnVzdGVkIGVudGl0eSAoZG9tMCBvciB0aGUgaHlwZXJ2
aXNvciksIHdoaWNoDQp3b3VsZCBiZSB0aGUgbmF0dXJhbCBiYWNrZW5kIG9mIHRoZSB2aXJ0
aW8gSU9NTVUgZGV2aWNlLg0KDQoNCkp1ZXJnZW4NCg==
--------------XUZAguPkyzrC4lcfNeo16yqk
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable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v27AR+IP3I8U4aqnhLpwhK7MEy9oCILlgZ1QZe49kpcumcZKORmzB
TNh30FVKK1EvmV2xAKDoaEOgQB4iFQLhJCdP1I5aSgM5IVFdn7v5YgEYuJYx37Io
N1EblHI//x/e2AaIHpzK5h88NEawQsaNRpNSrcfbFmAg987ATQRTjHAWAQgAyzH6
AOODMBjgfWE9VeCgsrwH3exNAU32gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------XUZAguPkyzrC4lcfNeo16yqk--

--------------0aHEKMBKGLFCUAXrXu1i8iGv--

--------------Rn6WLhPRazTf0w0yBOa9MskN
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSoIO8FAwAAAAAACgkQsN6d1ii/Ey8+
igf/YjozvDjTT9kxQ8QX9wWc53sCrD4GUm+mbOU7Vs1u8mv7lXghI9FV4AWSfh9ivTooCmyCHHzn
+ReSltsXL2RA8g/WPMzkOlHuNc+XnQ7IXqULbo2YmnMbfHRRpUJnVQIgsvw2vwvAG3aNYGCqGimC
E7JI0B7NJbTzpq9wdK0rIlpjoVkPtMOXLBGGMkzK4V0KMNCra/x76GnQocoOUzoULTqlvxLpkctR
/Uifpaa0D4+5fdT+GXW6YLs8WudbanEadyHPZk3FBa6a5wfeHbMFUKi6YOvz6X6bzV/L6LYbYm4I
42d/xj0+NwTw3Mh3/c2Xn2j2PrW5EmPkTic1fEDT9A==
=T4SZ
-----END PGP SIGNATURE-----

--------------Rn6WLhPRazTf0w0yBOa9MskN--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 14:43:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 14:43:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560529.876509 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHmfw-0007zj-23; Fri, 07 Jul 2023 14:43:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560529.876509; Fri, 07 Jul 2023 14:43:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHmfv-0007zc-VZ; Fri, 07 Jul 2023 14:43:11 +0000
Received: by outflank-mailman (input) for mailman id 560529;
 Fri, 07 Jul 2023 14:43:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=GM+b=CZ=citrix.com=prvs=545203e5e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qHmfu-0007zW-Bu
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 14:43:10 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9571d56e-1cd4-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 16:43:07 +0200 (CEST)
Received: from mail-bn7nam10lp2101.outbound.protection.outlook.com (HELO
 NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.101])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 07 Jul 2023 10:42:57 -0400
Received: from MW4PR03MB6428.namprd03.prod.outlook.com (2603:10b6:303:123::8)
 by MN2PR03MB5118.namprd03.prod.outlook.com (2603:10b6:208:1af::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.25; Fri, 7 Jul
 2023 14:42:46 +0000
Received: from MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd]) by MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd%7]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 14:42:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9571d56e-1cd4-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688740987;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=df+/rVJMYWXW1GBljmz9n57ywdi33sqr7imjf2Q7/Ic=;
  b=FA+TZLnb75uFqP0jUuNT5MXW+Qsa2aKjndw9qVhQ0Cen1SU+8ChNdVoA
   xwIBgcwFr77iKNQE3lXaUekuugECJ5YIzmqWHe+eGAzmmyqX8J18KAg/+
   TUpn6mgqH0zGq9sRLNjMu9lhPCnbmI6xek58QMHp2spSpZrp0hDFO82LH
   8=;
X-IronPort-RemoteIP: 104.47.70.101
X-IronPort-MID: 118064505
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:aHZxcqMcx87yyELvrR3tl8FynXyQoLVcMsEvi/4bfWQNrUp21DACx
 mcfXTjVMv7bNzD9e912PY+xpB4DuZSHzIMxTwto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v
 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/
 Nj/uKUzAnf8s9JPGjxSs/vrRC9H5qyo42tH5gNmP5ingXeF/5UrJMNHTU2OByOQrrl8RoaSW
 +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ
 HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0spQMV9O5
 aY0ER4qQQydgeyf0JiZFPY506zPLOG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E=Sophos;i="6.01,189,1684814400"; 
   d="scan'208";a="118064505"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ORqETL8Af23G67UQJ9qz1OE5dhvTV3D8lZfNIauT8FbutI/l226+NtLCDbwl8ATHxyUfbNovWacE/7phLPYqTfZZ9EWPb7080ebmjsUfoVsHxC1knjhv5EjVoymjvToa7IXQinsabMSK/fLfI5RuZ4VWg5Wps2P8965XqfDB4mVZr1YJwV1JJFAOx8iqbE/H0Pdp8owfCeyHH++mZbFhRjAsgKHc9gMJONWmKWpLWINNVGIy5weM9WI6TptCDgLgrVGMt7Y0RUnYtfd/HGYDLNyGPIrxKNzxY7EOIkwChk7YEgv1UyzIMjFsL+mRR6VeBXKVo2ffswqxZpvkp+higA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yflHwoduI6GXqH85ABFTPEmbWuDt3ZiTPT/VoKcCoVY=;
 b=AUgFasKH5HHGNDh3xkbZACsxXCu+IWAZpfT5H8R/0mRm0vDoHrM12hjgxR7kBArW2hodIyECgNvkXMvzTWq/q4fLK4Rq/pV+5X0hit/Nnzrh9uy4Xr+lBwG+5wSw1245wfy0YMTFnYMi5DFVGOwI0M2by2IPTzdWpbYR3N3QSyt2tT2LcPkluMfcw023xgD26ciSUgjCbFebgzPFH/K7DOH16alcZpj7tUDA7KB9aD/p8zNXai9LH4DZO4aqBxD+lSjVlTaIObkgJXEEheBS/0aWU2ulRnhEH2Lcqwm8MhabW96ZkU7k3GFvc+d3kyn+pxS/Cp94p1Lx14ubSIuEHQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yflHwoduI6GXqH85ABFTPEmbWuDt3ZiTPT/VoKcCoVY=;
 b=MZ4Hxrs8vc0o0dfqarBRjWVDzBOjffyFZwrNyXHqfMNUxE/C9PLCBRnruzSuHwXbT/XvqPomuYmjgwLfZC1rOfOyP74v/Oegtp5gGsM5g+uuLkYPkEmoz2nmD8CodJ+WMsKAKFdzLDqPcNcxn6oXea7lY7c6DeUh49kNBE1JA5o=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 7 Jul 2023 16:42:40 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <olekstysh@gmail.com>,
	Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
	Petr Pavlu <petr.pavlu@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	vikram.garhwal@amd.com
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
Message-ID: <ZKgkYKG11AWIUXuv@MacBook-Air-de-Roger.local>
References: <ZKQF8qq8Oh5E+Fxx@mail-itl>
 <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
 <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
 <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
 <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>
 <05341cac-ac75-a6e5-9c29-3caf83ea99fc@suse.com>
 <ZKff0w2EpzX5r8vK@MacBook-Air-de-Roger.local>
 <74493ba6-48c5-6326-b027-0b6761ef4836@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <74493ba6-48c5-6326-b027-0b6761ef4836@suse.com>
X-ClientProxiedBy: LNXP123CA0008.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:d2::20) To MW4PR03MB6428.namprd03.prod.outlook.com
 (2603:10b6:303:123::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MW4PR03MB6428:EE_|MN2PR03MB5118:EE_
X-MS-Office365-Filtering-Correlation-Id: a7f5f080-a5b5-4a96-3ed4-08db7ef86db7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	SYDwjhE9GQo4adxLGZCw1M6GtoR9J7zJ/QMWhvXBUmLOvt0nEKC77hC9fvjP0nH+qwgpJ4mOlNK+gvV7VLPlTxk5yPWotqPYU/hHOD5caaZ/SPwA4SiANGAwwFlNfuHeOUmy/xHno3htwyVViyLtiXx2/QCUXnG9T2ehvlXV/5N0/uicKC+fOdVu7R+eqbQwpXGBHjszHQXPa8OZhUDAg8+aD7Uc45XJ6diiJsh3qtxqAFjJ9YuQkSDuCCew7uVLxMmaXwLncFiNsP7MpqHTY71MCxr13fFMj+g7qqK+E4PDkLMxid+fFptP5bNM8p4YW+e7vt9xlFd+wWO9D9lOH9IrxYy/MqyUP6XoibAhtpWaRwh1Lb5gN4NQPYGFjzfLdlvNh2UGf2piK/TuDKSnyor8Pce2txZN+PzuqRSGFw0bT2j2kyOz8HS3ZBvMmpyeWEfZlPvQMg/ocro93DL2OTdCfwkAli32L5GClruQqOjjcJy0hpGqJ1S/wRgsXeuLFOukiQEwiJyI5MnfPuBdSBYSKaNN+wUjJqSieCmWAsYceF0PbOSkKkQihPemnT+0
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR03MB6428.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(136003)(39860400002)(366004)(376002)(451199021)(6666004)(478600001)(6486002)(54906003)(53546011)(9686003)(6506007)(26005)(186003)(6512007)(2906002)(41300700001)(316002)(6916009)(4326008)(66556008)(66946007)(66476007)(5660300002)(8936002)(8676002)(38100700002)(82960400001)(86362001)(85182001)(83380400001)(66899021);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?azlLVXBKL09qRTNBcnNReFJhU0hXaURheXpiRzZIemJxRkQwS1pFcjFHRGJt?=
 =?utf-8?B?Z010R1h4M2phSXlKMTZCank0eVZ4Mk43TmR3aHNNOVNnWTZVTDFKOUVWSVM0?=
 =?utf-8?B?SkZ6STh6aVFRTm1YK0R3QzIvRy9IeVZsQVltcXVqOWxQRktyZ3VHRFQvbVh0?=
 =?utf-8?B?YzVQL3pacGZuTFF0TGZFU0k3YytUZHN2VzVkRUVXZFFKK0ExdGZYbUtMZFJK?=
 =?utf-8?B?cENMS0VqSGhtcTJDRmJTQUw1eGVjYUZ1d1ZHa0JZNU5Cb1Z5WmZBRlJYT3N6?=
 =?utf-8?B?SzY1OXRSL0ZZeFhYV3k3WmxjMEh4bGw2UUREdlJocE55Q25zZ2tIWGFRY2Rz?=
 =?utf-8?B?aUZBcXk3a3RDRldCMUZlenpUVSt6TGVXcnBnYTVNRS9qMlM5aE5Sd0hKNDkr?=
 =?utf-8?B?SEluT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NzRWTVhhajRGZVR1ZCtZbWpiZ0craEFnUjlKMXlRL09RU2VLWThY?=
 =?utf-8?B?bjBTRmNoa1Fpa2lFc1VPYnlRZWw1Ynd5dG8zVWE5NnNON09BWFp6b1BVNGZF?=
 =?utf-8?B?amJvQWk1TXZPUHFvclgrM0VvalV0N1p5azAvbGdmcDlHL0M1RzRxUkFVZ2lx?=
 =?utf-8?B?Ujg3L2lFZ0R1ekxuMGxPNGhQcjdWeXFvMVp1dG9GOHpGcnYzNTU4VEw4NDRi?=
 =?utf-8?B?bWV5RGZVb1ZNKytoWXZwYWluak9UakxiR3hOMTBNcTRxR2lQM0xWc3QyTjNI?=
 =?utf-8?B?b1NldDl3SzR2dUlmc3V5R0J1elFhMHUybWdXbytqamZ3dFR2akg5bmdrK0Zl?=
 =?utf-8?B?cVR4UmZYcy8xREZsRHQyc3k5NWpvQWhpSUdLVkpqRlYvZjVxVHpLbVE3R0hw?=
 =?utf-8?B?TFR1a3FqVDVlMHYvTW0vUmgvNmR6U1VTT1lQTVY1N25hRXBXN0d1aWhlbnJt?=
 =?utf-8?B?MWUycjB1RGZSbDFhTmljSjVSR1RlU09DT2RiNjFYcXVEeG5TRFVEOFJGamlY?=
 =?utf-8?Q?J6i8LjEYMvQLLGwKFIF458jNR34buDTqEO?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a7f5f080-a5b5-4a96-3ed4-08db7ef86db7
X-MS-Exchange-CrossTenant-AuthSource: MW4PR03MB6428.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 14:42:46.2970
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: DCnctZIdTddcqOnLQVmWVlZ+yoQbukY4aERZZeWN5JK5D+eir88x23pMHyeBKwnwYhMxauILSEq3ROfGR383FQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR03MB5118

On Fri, Jul 07, 2023 at 04:10:14PM +0200, Juergen Gross wrote:
> On 07.07.23 11:50, Roger Pau MonnÃ© wrote:
> > On Fri, Jul 07, 2023 at 06:38:48AM +0200, Juergen Gross wrote:
> > > On 06.07.23 23:49, Stefano Stabellini wrote:
> > > > On Thu, 6 Jul 2023, Roger Pau MonnÃ© wrote:
> > > > > On Wed, Jul 05, 2023 at 03:41:10PM -0700, Stefano Stabellini wrote:
> > > > > > On Wed, 5 Jul 2023, Roger Pau MonnÃ© wrote:
> > > > > > > On Tue, Jul 04, 2023 at 08:14:59PM +0300, Oleksandr Tyshchenko wrote:
> > > > > > > > Part 2 (clarification):
> > > > > > > > 
> > > > > > > > I think using a special config space register in the root complex would
> > > > > > > > not be terrible in terms of guest changes because it is easy to
> > > > > > > > introduce a new root complex driver in Linux and other OSes. The root
> > > > > > > > complex would still be ECAM compatible so the regular ECAM driver would
> > > > > > > > still work. A new driver would only be necessary if you want to be able
> > > > > > > > to access the special config space register.
> > > > > > > 
> > > > > > > I'm slightly worry of this approach, we end up modifying a root
> > > > > > > complex emulation in order to avoid modifying a PCI device emulation
> > > > > > > on QEMU, not sure that's a good trade off.
> > > > > > > 
> > > > > > > Note also that different architectures will likely have different root
> > > > > > > complex, and so you might need to modify several of them, plus then
> > > > > > > arrange the PCI layout correctly in order to have the proper hierarchy
> > > > > > > so that devices belonging to different driver domains are assigned to
> > > > > > > different bridges.
> > > > > > 
> > > > > > I do think that adding something to the PCI conf register somewhere is
> > > > > > the best option because it is not dependent on ACPI and it is not
> > > > > > dependent on xenstore both of which are very undesirable.
> > > > > > 
> > > > > > I am not sure where specifically is the best place. These are 3 ideas
> > > > > > we came up with:
> > > > > > 1. PCI root complex
> > > > > > 2. a register on the device itself
> > > > > > 3. a new capability of the device
> > > > > > 4. add one extra dummy PCI device for the sole purpose of exposing the
> > > > > >      grants capability
> > > > > > 
> > > > > > 
> > > > > > Looking at the spec, there is a way to add a vendor-specific capability
> > > > > > (cap_vndr = 0x9). Could we use that? It doesn't look like it is used
> > > > > > today, Linux doesn't parse it.
> > > > > 
> > > > > I did wonder the same from a quick look at the spec.  There's however
> > > > > a text in the specification that says:
> > > > > 
> > > > > "The driver SHOULD NOT use the Vendor data capability except for
> > > > > debugging and reporting purposes."
> > > > > 
> > > > > So we would at least need to change that because the capability would
> > > > > then be used by other purposes different than debugging and reporting.
> > > > > 
> > > > > Seems like a minor adjustment, so might we worth asking upstream about
> > > > > their opinion, and to get a conversation started.
> > > > 
> > > > Wait, wouldn't this use-case fall under "reporting" ? It is exactly what
> > > > we are doing, right?
> > > 
> > > I'd understand "reporting" as e.g. logging, transferring statistics, ...
> > > 
> > > We'd like to use it for configuration purposes.
> > 
> > I've also read it that way.
> > 
> > > Another idea would be to enhance the virtio IOMMU device to suit our needs:
> > > we could add the domid as another virtio IOMMU device capability and (for now)
> > > use bypass mode for all "productive" devices.
> > 
> > If we have to start adding capabilties, won't it be easier to just add
> > it to the each device instead of adding it to virtio IOMMU.  Or is the
> > parsing of capabilities device specific, and hence we would have to
> > implement such parsing for each device?  I would expect some
> > capabilities are shared between all devices, and a Xen capability could
> > be one of those.
> 
> Have a look at [1], which is describing the common device config layout.
> The problem here is that we'd need to add the domid after the queue specific
> data, resulting in a mess if further queue fields would be added later.
> 
> We could try that, of course.

Right, we must make it part of the standard if we modify
virtio_pci_common_cfg, or else newly added fields would overlap the
Xen specific one.

Would it be possible to signal Xen-grants support in the
`device_feature` field, and then expose it from a vendor capability?
IOW, would it be possible to add a Xen-specific hook in the parsing of
virtio_pci_common_cfg that would then fetch additional data from a
capability?

That would likely be less intrusive than adding a new Xen-specific
field to virtio_pci_common_cfg while still allowing us to do Xen
specific configuration for all VirtIO devices.

> > 
> > > Later we could even add grant-V3 support to Xen and to the virtio IOMMU device
> > > (see my last year Xen Summit design session). This could be usable for
> > > disaggregated KVM setups, too, so I believe there is a chance to get this
> > > accepted.
> > > 
> > > > > > > > **********
> > > > > > > > What do you think about it? Are there any pitfalls, etc? This also requires
> > > > > > > > system changes, but at least without virtio spec changes.
> > > > > > > 
> > > > > > > Why are we so reluctant to add spec changes?  I understand this might
> > > > > > > take time an effort, but it's the only way IMO to build a sustainable
> > > > > > > VirtIO Xen implementation.  Did we already attempt to negotiate with
> > > > > > > Oasis Xen related spec changes and those where refused?
> > > > > > 
> > > > > > That's because spec changes can be very slow. This is a bug that we need
> > > > > > a relatively quick solution for and waiting 12-24 months for a spec
> > > > > > update is not realistic.
> > > > > > 
> > > > > > I think a spec change would be best as a long term solution. We also
> > > > > > need a short term solution. The short term solution doesn't have to be
> > > > > > ideal but it has to work now.
> > > > > 
> > > > > My fear with such approach is that once a bodge is in place people
> > > > > move on to other stuff and this never gets properly fixed.
> > > > > 
> > > > > I know this might not be a well received opinion, but it would be
> > > > > better if such bodge is kept in each interested party patchqueue for
> > > > > the time being, until a proper solution is implemented.  That way
> > > > > there's an interest from parties into properly fixing it upstream.
> > > > 
> > > > Unfortunately we are in the situation where we have an outstanding
> > > > upstream bug, so we have to take action one way or the other.
> > > 
> > > The required virtio IOMMU device modification would be rather small, so
> > > adding it maybe under a CONFIG option defaulting to off might be
> > > acceptable.
> > 
> > Would you then do the grant allocation as part of virtio IOMMU?
> 
> Long term, maybe. Do you remember my Grant-V3 design session last year? Being
> able to reuse the same layout for virtio IOMMU was one of the basic ideas for
> that layout (this would need some heavy work on the virtio IOMMU frontend and
> backend, of course).

While this might well be the best option, do we have anyone with the
time and expertise to work on this?  I might be wrong, but it seems
like a huge task.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 14:49:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 14:49:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560536.876520 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHmlX-0000En-Qf; Fri, 07 Jul 2023 14:48:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560536.876520; Fri, 07 Jul 2023 14:48:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHmlX-0000Eg-Nn; Fri, 07 Jul 2023 14:48:59 +0000
Received: by outflank-mailman (input) for mailman id 560536;
 Fri, 07 Jul 2023 14:48:59 +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
 <SRS0=GM+b=CZ=citrix.com=prvs=545203e5e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qHmlW-0000EK-Ta
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 14:48:59 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 64cade5b-1cd5-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 16:48:55 +0200 (CEST)
Received: from mail-sn1nam02lp2042.outbound.protection.outlook.com (HELO
 NAM02-SN1-obe.outbound.protection.outlook.com) ([104.47.57.42])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 07 Jul 2023 10:48:52 -0400
Received: from MW4PR03MB6428.namprd03.prod.outlook.com (2603:10b6:303:123::8)
 by SA2PR03MB5689.namprd03.prod.outlook.com (2603:10b6:806:119::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.25; Fri, 7 Jul
 2023 14:48:50 +0000
Received: from MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd]) by MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd%7]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 14:48:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 64cade5b-1cd5-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688741335;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=62/FswiQFDWcghTlfWsBb5f/aPgx3KmTIU08CKLH4wg=;
  b=YuSsQDrkZIhg4k87EK2bvkb7gTpoz6Ovq0tCZFx5pgpOS+51RJ1wJRtI
   1tItKNjRt34KNgvtoCa7K1Ixtera5kFki1KcXFEH+gZApxieIXs8H5YAB
   Y+60pJegw/X1fUiE4cV+dMUkclbFrhirDiJy6LWjbGxjoAzp7fc+lGa4Y
   4=;
X-IronPort-RemoteIP: 104.47.57.42
X-IronPort-MID: 118064942
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:mvO33KCzbMtJRxVW/2Djw5YqxClBgxIJ4kV8jS/XYbTApDomgTcEm
 mQdCG/XaP6OMGP8KNAlbY6w/UoC78fRm9ZhQ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
 WV9sjzuiWatN98Yh8dcLO7Scy9qBHnhP1ICOAqVN/PYOCBggqVxelZhrcKqAeQeREWmNQ86U
 4aSdkYNDXxZ2IK8foT4mODYqkdKA/sytHXuQ/cpU0dPD2Dc8tbnmFE4p7wKDwNeOFBb6BJba
 a01458iBeLX28YVci/DmltZZm/mzWa/KiWGSLvHnQcmXKzsQ8=
X-Talos-CUID: 9a23:2Jbi/GHMr3cmAH5PqmJoyw0sAp4hfET+yVPgKWzoBmgzC4OaHAo=
X-Talos-MUID: =?us-ascii?q?9a23=3A5u9mlQ77i3y/DbZICeSro/S0xoxC5qCDMEcTza8?=
 =?us-ascii?q?EotKCZC1MaimBgmSoF9o=3D?=
X-IronPort-AV: E=Sophos;i="6.01,189,1684814400"; 
   d="scan'208";a="118064942"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=D8Eq2Xk46k/1xZ91oVlblDkNnTIe2edzYsHk8CykfhT2Y1RRF1e189OA1pbxfc+uX6wf7TaZjdgDV91Qk9ty2G4OI92IgWAQnzHzasR8k4DbGeP4mFQBhGZlDlwpJ1ShHuqSSgg+lciVTFuMKVKX9PwgeiAB050ExE3gUCb7FqtdEfFwubZ1QcZabiCX0iy0yBUcIo2t+ihQRz6k1+BQ/jf1P6eGrlHwPP8vfpFBGu+w1W3MQTpIpFB96kmn8iMtKibybAlkLX1GbPEpDK7QGhyMLBJttWMnPhI0UdwMOEH9hjsaSssKR46M74Xxk+0L/U2I+yaU8m+WjKAPUUVqYQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=p2tsQNXpWd5IU/s4iz6MwpCQnaYnQ6BMZkEvquP1dN4=;
 b=LiYm5OQcPAlI5IkjEXozl1o2EC4RzrCgVA/0CgcXzoLND/OJpnNSgFF0Ie9PU0PT9W0y4L6HxGJ5dY5GLp+U9vNSbOnkMIxn+UCiwbxz5ykBTxiGR55BjnwFAGI2AfpscyA0l1beokcxwAVusdrSeyN1OJ0PcyMCC7zuMfnaoNo8nR8P2hZehojIopTXxzeY7hfUdTb6ngkybq5hM1Y/MajoNkD4friPckpjTzol+5g4bfwHf+rlBF0PTx1M/n76ygPdxrCxHWkjQz8eztr+C382edLBoslG1FcV2OfDXjMqWeBK9ekpCNA8nzIL0UZTQHxosPmnOoHjUZNbcMonBg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=p2tsQNXpWd5IU/s4iz6MwpCQnaYnQ6BMZkEvquP1dN4=;
 b=vR8VnN407xjTIusekGwFzg5PqUejeFidseasZ/ne6knDXT8y/BfKz9hHt8Sp9NaikQhRb4awHfU64+VI6tBl7bPPPoQUgYEngJgIUcGrVazLuYQ7VlyCPaeO78j7t8QlcF3BV4j/SfWa/n0xQd+Kw4smzgLhsxGobUpNtHiXeqs=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 7 Jul 2023 16:48:44 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <olekstysh@gmail.com>,
	Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
	Petr Pavlu <petr.pavlu@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	vikram.garhwal@amd.com
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
Message-ID: <ZKglzGG6PeRPPtbT@MacBook-Air-de-Roger.local>
References: <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
 <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
 <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
 <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>
 <05341cac-ac75-a6e5-9c29-3caf83ea99fc@suse.com>
 <ZKff0w2EpzX5r8vK@MacBook-Air-de-Roger.local>
 <74493ba6-48c5-6326-b027-0b6761ef4836@suse.com>
 <00f2ae75-b3cd-6c6d-c1c5-b2e9d6a974b6@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <00f2ae75-b3cd-6c6d-c1c5-b2e9d6a974b6@suse.com>
X-ClientProxiedBy: LO4P265CA0163.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:312::7) To MW4PR03MB6428.namprd03.prod.outlook.com
 (2603:10b6:303:123::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MW4PR03MB6428:EE_|SA2PR03MB5689:EE_
X-MS-Office365-Filtering-Correlation-Id: ef3aba4e-7a68-4c17-a248-08db7ef94692
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	w3eYE/187LgpPM0Tka7lze/gWcHGv7xGGqmxzBzx7Tx0yZHoA5FRE7FSLaVIB67y5YR/ir3Gogpx3eeBlUMB30Lj4J7LO2V486/wY7liNdTy/pForcpxmbp20CzqhTeMb/kbi+Jn9LS8KDt6F7+2W1/xXEQw0713jGE9fmwhuShi579N1ec7Vc08gZql5h6zRq9JeVHPzH7VwARF+wubuJMl6w64YwOO+pKa7Q/A9aNUNUhskpFrOroU5XhWaWgREdiYazh96Tug78NQwfj9rqePGboUMrnmB1wWvTmLmKst8PS0+3auKS0fIhtCa6sUVyGupUp2R42qGDa7vs+Tfh9DgixYA6PhKcrIinFfrcjTYKTMn/lS1LEA997WeBRRLJnF+9qrRsRjsI51xtmxinUVV/N2CPjujPC3PDcT6Uq55lCjd1xs2IPF7ow2k9mIMLLfawwA4tVgAzqXrPjfOvisIQaPoE8ZRm1iYO+djuU8VUstztIYFV29K+CZ1TCoLzlz+FUk5DDxaIzKiQww3L782Zi6C1mpZO74YsQNlP6jTOwA35u1WTvDl/mRAgvR
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR03MB6428.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(366004)(376002)(39860400002)(396003)(451199021)(83380400001)(2906002)(66476007)(66556008)(6916009)(4326008)(6486002)(66946007)(6666004)(316002)(54906003)(478600001)(8676002)(5660300002)(26005)(6512007)(186003)(6506007)(9686003)(53546011)(41300700001)(8936002)(38100700002)(82960400001)(85182001)(86362001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?R1BiamQ4QkRSa05oUWVlblBadmtNNmgyU1FlUE9MOE51Wmt0ZTU3Q3N2T2F4?=
 =?utf-8?B?VUhGa2kyRVJwUm52VlFnbW9QelFtTHozQ2pMcGRmUytKdlNUY21SbGVsTGpu?=
 =?utf-8?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NoQeiJY3lHOEx40G5hSR/i3hirU?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ef3aba4e-7a68-4c17-a248-08db7ef94692
X-MS-Exchange-CrossTenant-AuthSource: MW4PR03MB6428.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 14:48:50.1677
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: vdfC2w+0to9KS59JSpIo+c+mPQQ2mWneX+Z7aCHt77KdQbbutMsVShlCj45A2MhBuXMvxj7ZbRi4GAmbr0AQfA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR03MB5689

On Fri, Jul 07, 2023 at 04:27:59PM +0200, Juergen Gross wrote:
> On 07.07.23 16:10, Juergen Gross wrote:
> > On 07.07.23 11:50, Roger Pau MonnÃ© wrote:
> > > On Fri, Jul 07, 2023 at 06:38:48AM +0200, Juergen Gross wrote:
> > > > On 06.07.23 23:49, Stefano Stabellini wrote:
> > > > > On Thu, 6 Jul 2023, Roger Pau MonnÃ© wrote:
> > > > > > On Wed, Jul 05, 2023 at 03:41:10PM -0700, Stefano Stabellini wrote:
> > > > > > > On Wed, 5 Jul 2023, Roger Pau MonnÃ© wrote:
> > > > > > > > On Tue, Jul 04, 2023 at 08:14:59PM +0300, Oleksandr Tyshchenko wrote:
> > > > > > > > > Part 2 (clarification):
> > > > > > > > > 
> > > > > > > > > I think using a special config space register in the root complex would
> > > > > > > > > not be terrible in terms of guest changes because it is easy to
> > > > > > > > > introduce a new root complex driver in Linux and other OSes. The root
> > > > > > > > > complex would still be ECAM compatible so the regular ECAM driver would
> > > > > > > > > still work. A new driver would only be necessary if you want to be able
> > > > > > > > > to access the special config space register.
> > > > > > > > 
> > > > > > > > I'm slightly worry of this approach, we end up modifying a root
> > > > > > > > complex emulation in order to avoid modifying a PCI device emulation
> > > > > > > > on QEMU, not sure that's a good trade off.
> > > > > > > > 
> > > > > > > > Note also that different architectures will likely have different root
> > > > > > > > complex, and so you might need to modify several of them, plus then
> > > > > > > > arrange the PCI layout correctly in order to have the proper hierarchy
> > > > > > > > so that devices belonging to different driver domains are assigned to
> > > > > > > > different bridges.
> > > > > > > 
> > > > > > > I do think that adding something to the PCI conf register somewhere is
> > > > > > > the best option because it is not dependent on ACPI and it is not
> > > > > > > dependent on xenstore both of which are very undesirable.
> > > > > > > 
> > > > > > > I am not sure where specifically is the best place. These are 3 ideas
> > > > > > > we came up with:
> > > > > > > 1. PCI root complex
> > > > > > > 2. a register on the device itself
> > > > > > > 3. a new capability of the device
> > > > > > > 4. add one extra dummy PCI device for the sole purpose of exposing the
> > > > > > > Â Â Â Â  grants capability
> > > > > > > 
> > > > > > > 
> > > > > > > Looking at the spec, there is a way to add a vendor-specific capability
> > > > > > > (cap_vndr = 0x9). Could we use that? It doesn't look like it is used
> > > > > > > today, Linux doesn't parse it.
> > > > > > 
> > > > > > I did wonder the same from a quick look at the spec.Â  There's however
> > > > > > a text in the specification that says:
> > > > > > 
> > > > > > "The driver SHOULD NOT use the Vendor data capability except for
> > > > > > debugging and reporting purposes."
> > > > > > 
> > > > > > So we would at least need to change that because the capability would
> > > > > > then be used by other purposes different than debugging and reporting.
> > > > > > 
> > > > > > Seems like a minor adjustment, so might we worth asking upstream about
> > > > > > their opinion, and to get a conversation started.
> > > > > 
> > > > > Wait, wouldn't this use-case fall under "reporting" ? It is exactly what
> > > > > we are doing, right?
> > > > 
> > > > I'd understand "reporting" as e.g. logging, transferring statistics, ...
> > > > 
> > > > We'd like to use it for configuration purposes.
> > > 
> > > I've also read it that way.
> > > 
> > > > Another idea would be to enhance the virtio IOMMU device to suit our needs:
> > > > we could add the domid as another virtio IOMMU device capability and (for now)
> > > > use bypass mode for all "productive" devices.
> > > 
> > > If we have to start adding capabilties, won't it be easier to just add
> > > it to the each device instead of adding it to virtio IOMMU.Â  Or is the
> > > parsing of capabilities device specific, and hence we would have to
> > > implement such parsing for each device?Â  I would expect some
> > > capabilities are shared between all devices, and a Xen capability could
> > > be one of those.
> > 
> > Have a look at [1], which is describing the common device config layout.
> > The problem here is that we'd need to add the domid after the queue specific
> > data, resulting in a mess if further queue fields would be added later.
> > 
> > We could try that, of course.
> 
> Thinking more about it, the virtio IOMMU device seems to be a better fit:
> 
> In case we'd add the domid to the device's PCI config space, the value would
> be controlled by the backend domain. IMO the domid passed to the frontend
> should be controlled by a trusted entity (dom0 or the hypervisor), which
> would be the natural backend of the virtio IOMMU device.

Hm, yes.  I'm however failing to see how a backed could exploit that.

The guest would be granting memory to a different domain than the one
running the backend, but otherwise that memory would be granted to the
backend domain, which could then also make it available to other
domains (without having to play with the reported backend domid).

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 14:57:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 14:57:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560541.876529 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHmtI-0001jI-JC; Fri, 07 Jul 2023 14:57:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560541.876529; Fri, 07 Jul 2023 14:57:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHmtI-0001jB-GE; Fri, 07 Jul 2023 14:57:00 +0000
Received: by outflank-mailman (input) for mailman id 560541;
 Fri, 07 Jul 2023 14:56:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6jVP=CZ=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qHmtH-0001j5-Jt
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 14:56:59 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 85745510-1cd6-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 16:56:58 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-4fb761efa7aso3079375e87.0
 for <xen-devel@lists.xenproject.org>; Fri, 07 Jul 2023 07:56:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 85745510-1cd6-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1688741818; x=1691333818;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=ENT77DCi7Bc/endKOwtZAmoKVPICn79foL+YGOOThFo=;
        b=NR0wOoBW2yXFtSt4YmIrJn7MWVGK///qysUvtTkiiMKvuR8NCZetjtPKJpnQ55J24u
         YJrIWIU9ShzfKCL/iUdHUEtzqw6QZJ4WN4yv0vN0SVTGo/s+ZO/M4tICIv9987Jh/IT6
         wMnCEZ7V51ObClZJW73zh+WjNjYyWZVpDZ7eI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688741818; x=1691333818;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=ENT77DCi7Bc/endKOwtZAmoKVPICn79foL+YGOOThFo=;
        b=YccmM6Z7EwEz46afJGKuziNIuFjXyMUPMNkxsEKK5uCaNFnpcU0JmeUrlGlwwSMGPD
         2eRGva/kJ7OzfAHuIV9EHZrbVeLTBlOHDET+cL5kwh3JP9rf08ao4LRA9V3XSsttCFRY
         PR1n6sKtGEdpRBF0nHYZbWOmUe3+Z57zWggKsn8w+k/VUJgdV4DK0Co9Fyqqel4auBpp
         3//6l2v4bhoKKZUpCxESrxUUUlV2tUyBRadUQdmx1xLDyuCvHoYbqHuDvKEUuXvPcwo9
         Zqczno9QeYPMIb+LK6e1LlMzaYXyt7Y8AnGKzc56PgG9BHzh5hsD/MOnWpEuwnI2tgc/
         xc0g==
X-Gm-Message-State: ABy/qLYS91/kwzJfNxir801cQo3OJmuzDfI7/gxcwQZtsXV28tO+niO2
	l837HmT5HG0zn5EbD8fdOvk9x1cuMXvN7c+Bnu1Rgr6yD8kI4wy6
X-Google-Smtp-Source: APBJJlHmHaVqTji7KmGtx+yH7cE5FpqtxBSu/U6uKKogS0970IQdwZ2n/d7w7b6YAbqS+6v5gOHhde/dhIYVqIF3MQ4=
X-Received: by 2002:ac2:4f0d:0:b0:4f8:5717:e421 with SMTP id
 k13-20020ac24f0d000000b004f85717e421mr4840953lfr.40.1688741817737; Fri, 07
 Jul 2023 07:56:57 -0700 (PDT)
MIME-Version: 1.0
References: <CA+zSX=Y4MwsDSd9oSG1NQyt==YAw9SeRdh=eJxTUhhOx57ihWg@mail.gmail.com>
 <4ee01a0f-063e-ef93-ac24-da387d5b3438@rabbit.lu> <a680ae62-7765-aa51-1edd-9a1a7e39e449@suse.com>
 <20b1a79c-23c1-93bc-2090-8052f143422c@rabbit.lu> <27a3e6a2-b150-1d75-c86f-dfa2b906b298@suse.com>
 <CA+zSX=ZCmmKQX7acx-oK4nSki9ONscxLP7E8t8USjdjXJ9UDpA@mail.gmail.com>
 <495946e9-191f-22fe-9ecf-08eb5af833ba@suse.com> <28e2fc47-aada-e394-35b3-252bd1c6d720@suse.com>
In-Reply-To: <28e2fc47-aada-e394-35b3-252bd1c6d720@suse.com>
From: George Dunlap <george.dunlap@cloud.com>
Date: Fri, 7 Jul 2023 15:56:46 +0100
Message-ID: <CA+zSX=bCC8A06t_gSpYCjxG1BZoC2EWnHhYAQtTM6b0WyzyZNA@mail.gmail.com>
Subject: Re: Detecting whether dom0 is in a VM
To: Jan Beulich <jbeulich@suse.com>
Cc: zithro <slack@rabbit.lu>, xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="00000000000029f6f505ffe6d8da"

--00000000000029f6f505ffe6d8da
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, Jul 7, 2023 at 12:45=E2=80=AFPM Jan Beulich <jbeulich@suse.com> wro=
te:

> On 07.07.2023 12:16, Jan Beulich wrote:
> > On 07.07.2023 11:52, George Dunlap wrote:
> >> On Fri, Jul 7, 2023 at 9:00=E2=80=AFAM Jan Beulich <jbeulich@suse.com>=
 wrote:
> >>
> >>> On 06.07.2023 17:35, zithro wrote:
> >>>> On 06 Jul 2023 09:02, Jan Beulich wrote:
> >>>>> On 05.07.2023 18:20, zithro wrote:
> >>>>>> So I'm wondering, isn't that path enough for correct detection ?
> >>>>>> I mean, if "/sys/class/dmi/id/sys_vendor" reports Xen (or KVM, or
> any
> >>>>>> other known hypervisor), it's nested, otherwise it's on hardware ?
> >>>>>>
> >>>>>> Is that really mandatory to use CPUID leaves ?
> >>>>>
> >>>>> Let me ask the other way around: In user mode code under a non-nest=
ed
> >>>>> vs nested Xen, what would you be able to derive from CPUID? The
> >>>>> "hypervisor" bit is going to be set in both cases. (All assuming yo=
u
> >>>>> run on new enough hardware+Xen such that CPUID would be intercepted
> >>>>> even for PV.)
> >>>>
> >>>> I'm a bit clueless about CPUID stuff, but if I understand correctly,
> >>>> you're essentially saying that using CPUID may not be the perfect wa=
y
> ?
> >>>> Also, I don't get why the cpuid command returns two different values=
,
> >>>> depending on the -k switch :
> >>>> # cpuid -l 0x40000000
> >>>> hypervisor_id (0x40000000) =3D "\0\0\0\0\0\0\0\0\0\0\0\0"
> >>>> # cpuid -k -l 0x40000000
> >>>> hypervisor_id (0x40000000) =3D "XenVMMXenVMM"
> >>>
> >>> I'm afraid I can't comment on this without knowing what tool you're
> >>> taking about. Neither of the two systems I checked have one of this
> >>> name.
> >>>
> >>>>> Yet relying on DMI is fragile, too: Along the lines of
> >>>>> https://lists.xen.org/archives/html/xen-devel/2022-01/msg00604.html
> >>>>> basically any value in there could be "inherited" from the host (i.=
e.
> >>>>> from the layer below, to be precise).
> >>>>
> >>>> So using "/sys/class/dmi/id/sys_vendor", or simply doing "dmesg | gr=
ep
> >>>> DMI:" is also not perfect, as values can be inherited/spoofed by
> >>>> underneath hypervisor ?
> >>>
> >>> That's my understanding, yes.
> >>>
> >>>>> The only way to be reasonably
> >>>>> certain is to ask Xen about its view. The raw or host featuresets
> >>>>> should give you this information, in the "mirror" of said respectiv=
e
> >>>>> CPUID leave's "hypervisor" bit.
> >>>>
> >>>> As said above, I'm clueless, can you expand please ?
> >>>
> >>> Xen's public interface offers access to the featuresets known / found=
 /
> >>> used by the hypervisor. See XEN_SYSCTL_get_cpu_featureset, accessible
> >>> via xc_get_cpu_featureset().
> >>>
> >>
> >> Are any of these exposed in dom0 via sysctl, or hypfs?
> >
> > sysctl - yes (as the quoted name also says). hypfs no, afaict.
> >
> >>  SYSCTLs are
> >> unfortunately not stable interfaces, correct?  So it wouldn't be
> practical
> >> for systemd to use them.
> >
> > Indeed, neither sysctl-s nor the libxc interfaces are stable.
>
> Thinking of it, xen-cpuid is a wrapper tool around those. They may want
> to look at its output (and, if they want to use it, advise distros to
> also package it), which I think we try to keep reasonably stable,
> albeit without providing any guarantees.
>

We haven't had any clear guidance yet on what the systemd team want in the
<xen in a VM, systemd in a dom0> question; I just sort of assumed they
wanted the L-1 virtualization *if possible*.  It sounds like `vm-other`
would be acceptable, particularly as a fall-back output if there's no way
to get Xen's picture of the cpuid.

It looks like xen-cpuid is available on Fedora, Debian, Ubuntu, and the old
Virt SIG CentOS packages; so I'd expect most packages to follow suit.
That's a place to start.

Just to take the discussion all the way to its conclusion:

- Supposing xen-cpuid isn't available, is there any other way to tell if
Xen is running in a VM from dom0?

- Would it make sense to expose that information somewhere, either in sysfs
or in hypfs (or both?), so that eventually even systems which may not get
the memo about packaging xen-cpuid will get support (or if the systemd guys
would rather avoid executing another process if possible)?

 -George

--00000000000029f6f505ffe6d8da
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jul 7, 2023 at 12:45=E2=80=AF=
PM Jan Beulich &lt;<a href=3D"mailto:jbeulich@suse.com">jbeulich@suse.com</=
a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0p=
x 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On=
 07.07.2023 12:16, Jan Beulich wrote:<br>
&gt; On 07.07.2023 11:52, George Dunlap wrote:<br>
&gt;&gt; On Fri, Jul 7, 2023 at 9:00=E2=80=AFAM Jan Beulich &lt;<a href=3D"=
mailto:jbeulich@suse.com" target=3D"_blank">jbeulich@suse.com</a>&gt; wrote=
:<br>
&gt;&gt;<br>
&gt;&gt;&gt; On 06.07.2023 17:35, zithro wrote:<br>
&gt;&gt;&gt;&gt; On 06 Jul 2023 09:02, Jan Beulich wrote:<br>
&gt;&gt;&gt;&gt;&gt; On 05.07.2023 18:20, zithro wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt; So I&#39;m wondering, isn&#39;t that path enough f=
or correct detection ?<br>
&gt;&gt;&gt;&gt;&gt;&gt; I mean, if &quot;/sys/class/dmi/id/sys_vendor&quot=
; reports Xen (or KVM, or any<br>
&gt;&gt;&gt;&gt;&gt;&gt; other known hypervisor), it&#39;s nested, otherwis=
e it&#39;s on hardware ?<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Is that really mandatory to use CPUID leaves ?<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Let me ask the other way around: In user mode code und=
er a non-nested<br>
&gt;&gt;&gt;&gt;&gt; vs nested Xen, what would you be able to derive from C=
PUID? The<br>
&gt;&gt;&gt;&gt;&gt; &quot;hypervisor&quot; bit is going to be set in both =
cases. (All assuming you<br>
&gt;&gt;&gt;&gt;&gt; run on new enough hardware+Xen such that CPUID would b=
e intercepted<br>
&gt;&gt;&gt;&gt;&gt; even for PV.)<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I&#39;m a bit clueless about CPUID stuff, but if I underst=
and correctly,<br>
&gt;&gt;&gt;&gt; you&#39;re essentially saying that using CPUID may not be =
the perfect way ?<br>
&gt;&gt;&gt;&gt; Also, I don&#39;t get why the cpuid command returns two di=
fferent values,<br>
&gt;&gt;&gt;&gt; depending on the -k switch :<br>
&gt;&gt;&gt;&gt; # cpuid -l 0x40000000<br>
&gt;&gt;&gt;&gt; hypervisor_id (0x40000000) =3D &quot;\0\0\0\0\0\0\0\0\0\0\=
0\0&quot;<br>
&gt;&gt;&gt;&gt; # cpuid -k -l 0x40000000<br>
&gt;&gt;&gt;&gt; hypervisor_id (0x40000000) =3D &quot;XenVMMXenVMM&quot;<br=
>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I&#39;m afraid I can&#39;t comment on this without knowing wha=
t tool you&#39;re<br>
&gt;&gt;&gt; taking about. Neither of the two systems I checked have one of=
 this<br>
&gt;&gt;&gt; name.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Yet relying on DMI is fragile, too: Along the lines of=
<br>
&gt;&gt;&gt;&gt;&gt; <a href=3D"https://lists.xen.org/archives/html/xen-dev=
el/2022-01/msg00604.html" rel=3D"noreferrer" target=3D"_blank">https://list=
s.xen.org/archives/html/xen-devel/2022-01/msg00604.html</a><br>
&gt;&gt;&gt;&gt;&gt; basically any value in there could be &quot;inherited&=
quot; from the host (i.e.<br>
&gt;&gt;&gt;&gt;&gt; from the layer below, to be precise).<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; So using &quot;/sys/class/dmi/id/sys_vendor&quot;, or simp=
ly doing &quot;dmesg | grep<br>
&gt;&gt;&gt;&gt; DMI:&quot; is also not perfect, as values can be inherited=
/spoofed by<br>
&gt;&gt;&gt;&gt; underneath hypervisor ?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; That&#39;s my understanding, yes.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; The only way to be reasonably<br>
&gt;&gt;&gt;&gt;&gt; certain is to ask Xen about its view. The raw or host =
featuresets<br>
&gt;&gt;&gt;&gt;&gt; should give you this information, in the &quot;mirror&=
quot; of said respective<br>
&gt;&gt;&gt;&gt;&gt; CPUID leave&#39;s &quot;hypervisor&quot; bit.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; As said above, I&#39;m clueless, can you expand please ?<b=
r>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Xen&#39;s public interface offers access to the featuresets kn=
own / found /<br>
&gt;&gt;&gt; used by the hypervisor. See XEN_SYSCTL_get_cpu_featureset, acc=
essible<br>
&gt;&gt;&gt; via xc_get_cpu_featureset().<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Are any of these exposed in dom0 via sysctl, or hypfs?<br>
&gt; <br>
&gt; sysctl - yes (as the quoted name also says). hypfs no, afaict.<br>
&gt; <br>
&gt;&gt;=C2=A0 SYSCTLs are<br>
&gt;&gt; unfortunately not stable interfaces, correct?=C2=A0 So it wouldn&#=
39;t be practical<br>
&gt;&gt; for systemd to use them.<br>
&gt; <br>
&gt; Indeed, neither sysctl-s nor the libxc interfaces are stable.<br>
<br>
Thinking of it, xen-cpuid is a wrapper tool around those. They may want<br>
to look at its output (and, if they want to use it, advise distros to<br>
also package it), which I think we try to keep reasonably stable,<br>
albeit without providing any guarantees.<br></blockquote><div><br></div><di=
v>We haven&#39;t had any clear guidance yet on what the systemd team want i=
n the &lt;xen in a VM, systemd in a dom0&gt; question; I just sort of assum=
ed they wanted the L-1 virtualization *if possible*.=C2=A0 It sounds like `=
vm-other` would be acceptable, particularly as a fall-back output if there&=
#39;s no way to get Xen&#39;s picture of the cpuid.<br></div><div><br></div=
><div>It looks like xen-cpuid is available on Fedora, Debian, Ubuntu, and t=
he old Virt SIG CentOS packages; so I&#39;d expect most packages to follow =
suit.=C2=A0 That&#39;s a place to start.</div><div><br></div><div>Just to t=
ake the discussion all the way to its conclusion:</div><div><br></div><div>=
- Supposing xen-cpuid isn&#39;t available, is there any other way to tell i=
f Xen is running in a VM from dom0?</div><div><br></div><div>- Would it mak=
e sense to expose that information somewhere, either in sysfs or in hypfs (=
or both?), so that eventually even systems which may not get the memo about=
 packaging xen-cpuid will get support (or if the systemd guys would rather =
avoid executing another process if possible)?<br></div><div><br></div><div>=
=C2=A0-George</div><div><br></div><div><br></div></div></div>

--00000000000029f6f505ffe6d8da--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 15:01:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 15:01:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560547.876540 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHmxr-0003FE-95; Fri, 07 Jul 2023 15:01:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560547.876540; Fri, 07 Jul 2023 15:01:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHmxr-0003F7-4t; Fri, 07 Jul 2023 15:01:43 +0000
Received: by outflank-mailman (input) for mailman id 560547;
 Fri, 07 Jul 2023 15:01:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=VdXt=CZ=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qHmxp-0003F1-Hw
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 15:01:41 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [2001:67c:2178:6::1c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2d5dd5f7-1cd7-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 17:01:40 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 8DC7D21FDA;
 Fri,  7 Jul 2023 15:01:39 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 39306139E0;
 Fri,  7 Jul 2023 15:01:39 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id q+x6DNMoqGRHBwAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 07 Jul 2023 15:01:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2d5dd5f7-1cd7-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688742099; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=J4EqfZJRTxbQuGVjSPLr63ME7XafOxIVx9aKgPnt0iI=;
	b=QXlUv1AZALz90FOznmXs8QKIXIDubSQJY04EbTEGaOkzZYseGoib0SbW9zHsctuNHP7FkZ
	B4/ns5qVWwbM6nZ1l9m+HGDXZRZLwVi2n1n3Nt6MuGslE2Fob01PViRH7agJPt6xewg5Vl
	39v8diqI3T+guS0mnJraQtMBzt7un3c=
Message-ID: <106781fe-992b-8609-fe37-17619b699353@suse.com>
Date: Fri, 7 Jul 2023 17:01:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <olekstysh@gmail.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 vikram.garhwal@amd.com
References: <ZKQF8qq8Oh5E+Fxx@mail-itl>
 <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
 <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
 <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
 <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>
 <05341cac-ac75-a6e5-9c29-3caf83ea99fc@suse.com>
 <ZKff0w2EpzX5r8vK@MacBook-Air-de-Roger.local>
 <74493ba6-48c5-6326-b027-0b6761ef4836@suse.com>
 <ZKgkYKG11AWIUXuv@MacBook-Air-de-Roger.local>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
In-Reply-To: <ZKgkYKG11AWIUXuv@MacBook-Air-de-Roger.local>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------nhuD3mfs5ESRhYQN0JOgqySB"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------nhuD3mfs5ESRhYQN0JOgqySB
Content-Type: multipart/mixed; boundary="------------8xnNKwnpjYsQU5Wv6RIpCTmH";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <olekstysh@gmail.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 vikram.garhwal@amd.com
Message-ID: <106781fe-992b-8609-fe37-17619b699353@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
References: <ZKQF8qq8Oh5E+Fxx@mail-itl>
 <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
 <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
 <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
 <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>
 <05341cac-ac75-a6e5-9c29-3caf83ea99fc@suse.com>
 <ZKff0w2EpzX5r8vK@MacBook-Air-de-Roger.local>
 <74493ba6-48c5-6326-b027-0b6761ef4836@suse.com>
 <ZKgkYKG11AWIUXuv@MacBook-Air-de-Roger.local>
In-Reply-To: <ZKgkYKG11AWIUXuv@MacBook-Air-de-Roger.local>

--------------8xnNKwnpjYsQU5Wv6RIpCTmH
Content-Type: multipart/mixed; boundary="------------Th0Hc0gn0HmlyNGGZo5YwJr6"

--------------Th0Hc0gn0HmlyNGGZo5YwJr6
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMDcuMDcuMjMgMTY6NDIsIFJvZ2VyIFBhdSBNb25uw6kgd3JvdGU6DQo+IE9uIEZyaSwg
S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NCg0KSnVlcmdl
bg0K
--------------Th0Hc0gn0HmlyNGGZo5YwJr6
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5RnNVUJbvoPHZ8SlM4KWm8rG+lIkGurq
qu5gu8q8ZMKdsdGC4bBxdQKDKHEFExLJK/nRPFmAuGlId1E3fe10v5QL+qHI3EIP
tyfE7i9Hz6rVwi7lWKgh7pe0ZvatAudZ+JNIlBKptb64FaiIOAWDCx1SzR9KdWVy
Z2VuIEdyb3NzI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BDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------Th0Hc0gn0HmlyNGGZo5YwJr6--

--------------8xnNKwnpjYsQU5Wv6RIpCTmH--

--------------nhuD3mfs5ESRhYQN0JOgqySB
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSoKNIFAwAAAAAACgkQsN6d1ii/Ey/+
sgf/bIDj/f2TsUiA0LwTt5HHGfbfb4BwgYPX7umelulWnIU/2321JCzJWm/z7GpXPHYPBK0bZQ+I
fQxQZZizGXxBIElXxlh6GX3Tiu9Nl+sveQVtSRezpof6I3mrGTajc3ixX+P8RGhwUWR4TOtU7fwW
7+ukLuOZ6DVGr65yGFDpjPE8cxQgeUwwJ8Qum4i5sXb+3lKWZc9A9Sa8ypOQeRu0IRsQVhaHvfVu
nid8sZkzJzA2iHfTvwH9gLOM7a9yGCBr/fzTOl397Aw73eQgzM5xt1t/yjrFQEKBT559R4eW7ATz
uyl9pbUXmzuvVKcczOO/+yyWkQMCf8MBhJqR+a2VsA==
=ITor
-----END PGP SIGNATURE-----

--------------nhuD3mfs5ESRhYQN0JOgqySB--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 15:14:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 15:14:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560551.876550 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHnAF-0004ko-Au; Fri, 07 Jul 2023 15:14:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560551.876550; Fri, 07 Jul 2023 15:14:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHnAF-0004kh-7m; Fri, 07 Jul 2023 15:14:31 +0000
Received: by outflank-mailman (input) for mailman id 560551;
 Fri, 07 Jul 2023 15:14:29 +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
 <SRS0=GM+b=CZ=citrix.com=prvs=545203e5e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qHnAD-0004kb-Gr
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 15:14:29 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f55ab118-1cd8-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 17:14:26 +0200 (CEST)
Received: from mail-bn8nam12lp2177.outbound.protection.outlook.com (HELO
 NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.177])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 07 Jul 2023 11:14:18 -0400
Received: from MW4PR03MB6428.namprd03.prod.outlook.com (2603:10b6:303:123::8)
 by PH0PR03MB6937.namprd03.prod.outlook.com (2603:10b6:510:16b::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul
 2023 15:14:16 +0000
Received: from MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd]) by MW4PR03MB6428.namprd03.prod.outlook.com
 ([fe80::95db:33e0:ebe2:13dd%7]) with mapi id 15.20.6565.016; Fri, 7 Jul 2023
 15:14:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f55ab118-1cd8-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688742866;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=qMmaHZjeSn3gIhXj7nl8zW5R+QKswSWkuB3tB4ciZMI=;
  b=DrT9KzisLRsZd0XxXzHkPl3TQrP13FSvvwDMh9slgl127Orarhx0D2zY
   FnKhvsqENiVNeBZj4Cz51Vdph3iTjddUrBJlwpp1FVNlm0Ev6kjuB/Q/D
   o7dk0nMn9UVD0UlV0w2h0tzWwUFGXBgLE5jFUeqri2nwVt8Sr1gMfklVD
   Q=;
X-IronPort-RemoteIP: 104.47.55.177
X-IronPort-MID: 114210122
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:K7sck6loUzYqcsYAR0M/AqPo5gzJJkRdPkR7XQ2eYbSJt1+Wr1Gzt
 xIcWGiPO/eOMTfxKtggbY6/908PucXWytJmQFNq+HpnEiMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5ACGzRH5MbpETU2PByqgKmVrNrbSq
 9brl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=
X-Talos-CUID: 9a23:EH6ITWOve+ofRe5DUi5OrmASQf4cK2yaw1niM0DpNU13R+jA
X-Talos-MUID: 9a23:qS23OQSRd316clYFRXT9thpGDtlx6J2iUgM9s5tat8aWCHJvbmI=
X-IronPort-AV: E=Sophos;i="6.01,189,1684814400"; 
   d="scan'208";a="114210122"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=bBRMyDbKR1t8ao1WctEcOvNjYH+cnp5YfoUAOrY4Er8w+NaMWB+yCx3/K4oBKl37j0II4Mjgw0rsQJVmaoPJbXDzw6C+RfFVMazNV8rrKqV8Yx1VzWlLiqpmiLSFvgrZIZ1RIjKpgbtfIitlHEizbhi4hAGFZaul6/T0vyZ4K1VBvQCJ+qSQJaW3jWTANjwLK8e4Mo1f+nBnc5RPoJriXfL/uisA4BD+dbmzEudR0gUiEjJjb+ZaCKVuUwBn+dlgFDBLIsA2CWz+C6/pOwlG7pqVopsueLRibvkcdH5+vpjX7InF/uOoMeIdfAGx6GAcIMeSF0s9OYA1yVDDYJ6WlA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=rdPMt4uy6NJ1nQkjCoRwZgEtfPGszj97mY8dwBvcVV4=;
 b=Y7+AIOqFoSAuHd0q5Pp3FInEiFQO5ppsMV53DxXADnOJgE6R5u+F7ADa05SNhPOsIPwyIACm1DAjmZ9SQsxBIoOVBWRwfMLOewGxGelgZsfDAoApioUfn8+ixbgTJxFUBqUkuADNoucgLDASJXTqmmzYPNBWN1aKBqHGZjfK3EGnqOBdTTvKNvYqAZ+6wMRS24Bp2tsWqU7ONT0+UNQPSznpJMthFao0hWyA8SLwP5rfrySQMquDyAIMpu54g1JQYBWapokfrr7gc/sXLFF3F/svHCM+EmVsxdPlgd9COMco57utK8hF6qqwgxD5jWXsQR9uE4LoZWKK2KdgGnW6Hg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=rdPMt4uy6NJ1nQkjCoRwZgEtfPGszj97mY8dwBvcVV4=;
 b=Zu0XCHfKTFiwAGvr7RTy5iq7INwDbVECkJS0PWWn3KMiJjvoFTeEbPriPJ7l5dab2ZrXlVBpO6szLwPwY11a75qdRhVaUOriuVH3SgLmAS7o0l/tidmGnP/tFnKGl2XTMZXhMuGLx/mI+1FFIqrJOMIfbNf1vJKy3h5kE6WtFgI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 7 Jul 2023 17:14:10 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <olekstysh@gmail.com>,
	Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
	Petr Pavlu <petr.pavlu@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	vikram.garhwal@amd.com
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
Message-ID: <ZKgrwvSO9MgLqXTn@MacBook-Air-de-Roger.local>
References: <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
 <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
 <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>
 <05341cac-ac75-a6e5-9c29-3caf83ea99fc@suse.com>
 <ZKff0w2EpzX5r8vK@MacBook-Air-de-Roger.local>
 <74493ba6-48c5-6326-b027-0b6761ef4836@suse.com>
 <ZKgkYKG11AWIUXuv@MacBook-Air-de-Roger.local>
 <106781fe-992b-8609-fe37-17619b699353@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <106781fe-992b-8609-fe37-17619b699353@suse.com>
X-ClientProxiedBy: LO4P302CA0031.GBRP302.PROD.OUTLOOK.COM
 (2603:10a6:600:317::18) To MW4PR03MB6428.namprd03.prod.outlook.com
 (2603:10b6:303:123::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MW4PR03MB6428:EE_|PH0PR03MB6937:EE_
X-MS-Office365-Filtering-Correlation-Id: 33ff5869-e419-4f72-b99e-08db7efcd422
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	yTAWx+/t0F3Yj++4lqSkmZ80AXyaVnhuxrVsPxw35qmbVkhqhhHOBCaYqNBgO/QGNeRBxLOEvqdRLgi0uzGBxQdMhReo8OkdxpL/tQkKya74XG3ZmG54ceNTb/fH4rEl795hByig1h0W93F14wsBj8jF9+hqxVCCTVPL94CzA9TL63fH3LbZmvqcPMVjCI3hCOLBMRnmT3+E+nkVfPK9aho75yfWXOGvCXCwQGLQCfNZlIPF7l3wXcJWYhban65wS1ZJvoK/cFjvArcWt4gRQy7KQtU871momKi993XBD671KGuwmQApLsVkAUfnhcTNWrzVRJzryZH3X2aLhqRDJRJM/ryyc2+KrI/tBAEk0HOVS3KOgUBB22ahKibOEXGrGpOsrjBeysZf/GDrx8aZiIpDgVifk9O6QGpq56YVKIM9iWikVUR+qrDU3obc9hELyHhuag85pp4WOOIB++bs+sJgb2zuq9OtbJyAj3ahWk+BDn+n/AB9IarEdZMLVwAqg+bMaPSvlrgUhANhf61ezNfv8v6edCQ+/8Zx0+Xd4hc1QHXJkEzzYD99zutQ5lBZ
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR03MB6428.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(396003)(376002)(366004)(346002)(451199021)(6486002)(6666004)(478600001)(54906003)(83380400001)(85182001)(86362001)(2906002)(26005)(9686003)(6506007)(53546011)(6512007)(186003)(38100700002)(4326008)(66556008)(66946007)(82960400001)(316002)(6916009)(66476007)(41300700001)(8676002)(5660300002)(8936002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?akZYR3lnVzlndzBZdlMvWGFBY0pFNzFLaTlPQjR1YWlxRHJzMytvTTd0eFJH?=
 =?utf-8?B?ZEQ0VmhpRlVwV3Y5QVVXSC9odGhxMld5ZUxsNzI4L0x4Uy81a0NtSmxvQnBD?=
 =?utf-8?B?aVFmUE55RUEwaEdMdnVtbGxvYjFwb2JVbVhiSWF3TXd6ay85bEx2dnRkb3B1?=
 =?utf-8?B?WnZ5dmlESnFnUkYraUNOR3RMNHl1TWNpT3dxbHNlVlIxM0piVkhaK3BaRVZN?=
 =?utf-8?B?RWE0cmVJRGxJQ0h5Y3dENUg1Mk5aaXM2Q0xjMVZnbk9HSkxyYlUzK1lUUTc4?=
 =?utf-8?B?L3NHaHhXbU1uMkpWdFZsd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-8?B?WEZFSkZFYmxvdU5mRmk3anJadlUvSC9TZkNkTWpteFRqTmY1WGNiREo5dk5r?=
 =?utf-8?B?OWNpR0NKY0VndllxSVEzdVUrajdHQytsNDgrTTlzdWtid0M1VlJxRC9kUzlO?=
 =?utf-8?B?akJxbUdydkx6aWxURmdmalZuRFpERjRUc05weWhCN2gyYTdJZ0ZMVmlCejF1?=
 =?utf-8?B?OXYzR2tON2VuZ21JbVJlNFZqblE2NWJERVVNUmNLcVQ2R2w2RUFDQVFhQ2Nk?=
 =?utf-8?B?NXJ3YjJBUFpxcWtBYWM1S3puKzZqUkZHcG5lbDlLSWthTnkwTUNGd3NWY0Q2?=
 =?utf-8?B?QmhveXVEQ2tua0VoWGZGL0lVVnlqWm9OdklwZHA5bWJuK2d5UG5TemNmdDBl?=
 =?utf-8?B?NXNwUHpaVDF0S05XK215U2N4eTRjU3EwN3JLSSsxWmhwY2pnZUZrV2FJRVho?=
 =?utf-8?B?bUpBOWtOWXAxZi9mTkJxM1c0OEhMUmZwWTNmQmtJTm9oMEo3L09Mc3ZhWlBI?=
 =?utf-8?B?T1dhK0pWUU5aL01vaUJyMnhreTg4amcvVC9yYXBIb2pQMkRvb1VYVGpUVERM?=
 =?utf-8?B?ZGNVM3NVbUhkMDZrbCszK21WZm5KeTluTGd0cEZCSUkwRVprOTQ2R0VNLzZQ?=
 =?utf-8?B?dEV0NEp1QnA1MTNVYnVPWFR2VXQ5MUI3VGFrQ3dXdEk5Njd2TGl4NDBIQUlQ?=
 =?utf-8?Q?v22UEVbphZBLGhkxRcpV0w8gry3tmDujtV?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 33ff5869-e419-4f72-b99e-08db7efcd422
X-MS-Exchange-CrossTenant-AuthSource: MW4PR03MB6428.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 15:14:16.1417
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: unHBp5QmQr/eicm1eRnj/v6xBLQVik+DYDxt0PxItnrGf1F6fPMCWLUNJ2EPf68uGw9TtY9EzdJNxcDW/fv7hw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB6937

On Fri, Jul 07, 2023 at 05:01:38PM +0200, Juergen Gross wrote:
> On 07.07.23 16:42, Roger Pau MonnÃ© wrote:
> > On Fri, Jul 07, 2023 at 04:10:14PM +0200, Juergen Gross wrote:
> > > On 07.07.23 11:50, Roger Pau MonnÃ© wrote:
> > > > On Fri, Jul 07, 2023 at 06:38:48AM +0200, Juergen Gross wrote:
> > > > > On 06.07.23 23:49, Stefano Stabellini wrote:
> > > > > > On Thu, 6 Jul 2023, Roger Pau MonnÃ© wrote:
> > > > > > > On Wed, Jul 05, 2023 at 03:41:10PM -0700, Stefano Stabellini wrote:
> > > > > > > > On Wed, 5 Jul 2023, Roger Pau MonnÃ© wrote:
> > > > > > > > > On Tue, Jul 04, 2023 at 08:14:59PM +0300, Oleksandr Tyshchenko wrote:
> > > > > > > > > > Part 2 (clarification):
> > > > > > > > > > 
> > > > > > > > > > I think using a special config space register in the root complex would
> > > > > > > > > > not be terrible in terms of guest changes because it is easy to
> > > > > > > > > > introduce a new root complex driver in Linux and other OSes. The root
> > > > > > > > > > complex would still be ECAM compatible so the regular ECAM driver would
> > > > > > > > > > still work. A new driver would only be necessary if you want to be able
> > > > > > > > > > to access the special config space register.
> > > > > > > > > 
> > > > > > > > > I'm slightly worry of this approach, we end up modifying a root
> > > > > > > > > complex emulation in order to avoid modifying a PCI device emulation
> > > > > > > > > on QEMU, not sure that's a good trade off.
> > > > > > > > > 
> > > > > > > > > Note also that different architectures will likely have different root
> > > > > > > > > complex, and so you might need to modify several of them, plus then
> > > > > > > > > arrange the PCI layout correctly in order to have the proper hierarchy
> > > > > > > > > so that devices belonging to different driver domains are assigned to
> > > > > > > > > different bridges.
> > > > > > > > 
> > > > > > > > I do think that adding something to the PCI conf register somewhere is
> > > > > > > > the best option because it is not dependent on ACPI and it is not
> > > > > > > > dependent on xenstore both of which are very undesirable.
> > > > > > > > 
> > > > > > > > I am not sure where specifically is the best place. These are 3 ideas
> > > > > > > > we came up with:
> > > > > > > > 1. PCI root complex
> > > > > > > > 2. a register on the device itself
> > > > > > > > 3. a new capability of the device
> > > > > > > > 4. add one extra dummy PCI device for the sole purpose of exposing the
> > > > > > > >       grants capability
> > > > > > > > 
> > > > > > > > 
> > > > > > > > Looking at the spec, there is a way to add a vendor-specific capability
> > > > > > > > (cap_vndr = 0x9). Could we use that? It doesn't look like it is used
> > > > > > > > today, Linux doesn't parse it.
> > > > > > > 
> > > > > > > I did wonder the same from a quick look at the spec.  There's however
> > > > > > > a text in the specification that says:
> > > > > > > 
> > > > > > > "The driver SHOULD NOT use the Vendor data capability except for
> > > > > > > debugging and reporting purposes."
> > > > > > > 
> > > > > > > So we would at least need to change that because the capability would
> > > > > > > then be used by other purposes different than debugging and reporting.
> > > > > > > 
> > > > > > > Seems like a minor adjustment, so might we worth asking upstream about
> > > > > > > their opinion, and to get a conversation started.
> > > > > > 
> > > > > > Wait, wouldn't this use-case fall under "reporting" ? It is exactly what
> > > > > > we are doing, right?
> > > > > 
> > > > > I'd understand "reporting" as e.g. logging, transferring statistics, ...
> > > > > 
> > > > > We'd like to use it for configuration purposes.
> > > > 
> > > > I've also read it that way.
> > > > 
> > > > > Another idea would be to enhance the virtio IOMMU device to suit our needs:
> > > > > we could add the domid as another virtio IOMMU device capability and (for now)
> > > > > use bypass mode for all "productive" devices.
> > > > 
> > > > If we have to start adding capabilties, won't it be easier to just add
> > > > it to the each device instead of adding it to virtio IOMMU.  Or is the
> > > > parsing of capabilities device specific, and hence we would have to
> > > > implement such parsing for each device?  I would expect some
> > > > capabilities are shared between all devices, and a Xen capability could
> > > > be one of those.
> > > 
> > > Have a look at [1], which is describing the common device config layout.
> > > The problem here is that we'd need to add the domid after the queue specific
> > > data, resulting in a mess if further queue fields would be added later.
> > > 
> > > We could try that, of course.
> > 
> > Right, we must make it part of the standard if we modify
> > virtio_pci_common_cfg, or else newly added fields would overlap the
> > Xen specific one.
> > 
> > Would it be possible to signal Xen-grants support in the
> > `device_feature` field, and then expose it from a vendor capability?
> > IOW, would it be possible to add a Xen-specific hook in the parsing of
> > virtio_pci_common_cfg that would then fetch additional data from a
> > capability?
> 
> TBH, I don't know. It might require some changes in the central parsing
> logic, but this shouldn't be too hard to do.
> 
> > That would likely be less intrusive than adding a new Xen-specific
> > field to virtio_pci_common_cfg while still allowing us to do Xen
> > specific configuration for all VirtIO devices.
> 
> In case we want to go that route, this should be in a new "platform config"
> capability, which might be just another form of a vendor capability.

I think telling people that they will need to implement grants-v3 in
order to solve this might be too much.  I would rather prefer a more
concrete solution that doesn't have so many loose ends.

Anyway, it's up to the person doing the job, but starting with "you
will have to implement grants-v3" is quite likely to deter anyone from
attempting to solve this I'm afraid.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 15:14:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 15:14:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560553.876560 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHnAO-00052H-NE; Fri, 07 Jul 2023 15:14:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560553.876560; Fri, 07 Jul 2023 15:14:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHnAO-00052A-J4; Fri, 07 Jul 2023 15:14:40 +0000
Received: by outflank-mailman (input) for mailman id 560553;
 Fri, 07 Jul 2023 15:14:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=VdXt=CZ=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qHnAO-00051n-7e
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 15:14:40 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [2001:67c:2178:6::1c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fd9eccbd-1cd8-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 17:14:39 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 875862222A;
 Fri,  7 Jul 2023 15:14:38 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 38C2D139E0;
 Fri,  7 Jul 2023 15:14:38 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id mv5cDN4rqGQNDQAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 07 Jul 2023 15:14:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fd9eccbd-1cd8-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688742878; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=IRTwrQger58FyJYzRjbRsv7XvEfRLUd+URadp+f150A=;
	b=raVSZgC1GBmI7GCoFBK6ta8mMU1GfnPkaoHFXs8dRpSKyKhpIeXWmWb9Bht4ptdFoflcqm
	8x0jJ8rtjMIV8ZwlgK0L3gC5sic5jDrbrT1kpj7giVY0O++R6wU+JUJjhEAX5BexeNdbmh
	SH1d7Xq/kH8frRtMT96UcNhA+ye9Q+k=
Message-ID: <49666f77-9a09-c7ae-14aa-69abc283466f@suse.com>
Date: Fri, 7 Jul 2023 17:14:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <olekstysh@gmail.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 vikram.garhwal@amd.com
References: <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
 <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
 <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
 <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>
 <05341cac-ac75-a6e5-9c29-3caf83ea99fc@suse.com>
 <ZKff0w2EpzX5r8vK@MacBook-Air-de-Roger.local>
 <74493ba6-48c5-6326-b027-0b6761ef4836@suse.com>
 <00f2ae75-b3cd-6c6d-c1c5-b2e9d6a974b6@suse.com>
 <ZKglzGG6PeRPPtbT@MacBook-Air-de-Roger.local>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
In-Reply-To: <ZKglzGG6PeRPPtbT@MacBook-Air-de-Roger.local>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------ocmhIf09ae6ZTIuu00mZXwXx"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------ocmhIf09ae6ZTIuu00mZXwXx
Content-Type: multipart/mixed; boundary="------------WRdXqhg3WHnAK1RheeAQ0XId";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <olekstysh@gmail.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 vikram.garhwal@amd.com
Message-ID: <49666f77-9a09-c7ae-14aa-69abc283466f@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
References: <ZKQxZY03x30rjdoF@MacBook-Air-de-Roger.local>
 <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
 <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
 <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>
 <05341cac-ac75-a6e5-9c29-3caf83ea99fc@suse.com>
 <ZKff0w2EpzX5r8vK@MacBook-Air-de-Roger.local>
 <74493ba6-48c5-6326-b027-0b6761ef4836@suse.com>
 <00f2ae75-b3cd-6c6d-c1c5-b2e9d6a974b6@suse.com>
 <ZKglzGG6PeRPPtbT@MacBook-Air-de-Roger.local>
In-Reply-To: <ZKglzGG6PeRPPtbT@MacBook-Air-de-Roger.local>

--------------WRdXqhg3WHnAK1RheeAQ0XId
Content-Type: multipart/mixed; boundary="------------BY9u42az07NLvopR7if6bw0b"

--------------BY9u42az07NLvopR7if6bw0b
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMDcuMDcuMjMgMTY6NDgsIFJvZ2VyIFBhdSBNb25uw6kgd3JvdGU6DQo+IE9uIEZyaSwg
SnVsIDA3LCAyMDIzIGF0IDA0OjI3OjU5UE0gKzAyMDAsIEp1ZXJnZW4gR3Jvc3Mgd3JvdGU6
DQo+PiBPbiAwNy4wNy4yMyAxNjoxMCwgSnVlcmdlbiBHcm9zcyB3cm90ZToNCj4+PiBPbiAw
Ny4wNy4yMyAxMTo1MCwgUm9nZXIgUGF1IE1vbm7DqSB3cm90ZToNCj4+Pj4gT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sb2l0
IHRoYXQuDQo+IA0KPiBUaGUgZ3Vlc3Qgd291bGQgYmUgZ3JhbnRpbmcgbWVtb3J5IHRvIGEg
ZGlmZmVyZW50IGRvbWFpbiB0aGFuIHRoZSBvbmUNCj4gcnVubmluZyB0aGUgYmFja2VuZCwg
YnV0IG90aGVyd2lzZSB0aGF0IG1lbW9yeSB3b3VsZCBiZSBncmFudGVkIHRvIHRoZQ0KPiBi
YWNrZW5kIGRvbWFpbiwgd2hpY2ggY291bGQgdGhlbiBhbHNvIG1ha2UgaXQgYXZhaWxhYmxl
IHRvIG90aGVyDQo+IGRvbWFpbnMgKHdpdGhvdXQgaGF2aW5nIHRvIHBsYXkgd2l0aCB0aGUg
cmVwb3J0ZWQgYmFja2VuZCBkb21pZCkuDQoNCkkgYWdyZWUgdGhhdCBhbiBleHBsb2l0IGlz
IGF0IGxlYXN0IG5vdCBvYnZpb3VzLg0KDQpJdCBpcyBzdGlsbCBub3QgYSBjbGVhbiBzb2x1
dGlvbiwgdGhvdWdoLg0KDQpHaXZpbmcgdGhlIHdyb25nIGRvbWFpbiBkaXJlY3QgYWNjZXNz
IHRvIHNvbWUgb2YgdGhlIGd1ZXN0J3MgbWVtb3J5IGlzIHdvcnNlDQp0aGFuIHRoZSBhYmls
aXR5IHRvIHBhc3MgdGhlIGNvbnRlbnRzIGluZGlyZWN0bHkgdG8gdGhlIHdyb25nIGRvbWFp
biBJTUhPLg0KDQoNCkp1ZXJnZW4NCg==
--------------BY9u42az07NLvopR7if6bw0b
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGi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HpzK5h88NEawQsaNRpNSrcfbFmAg987ATQRTjHAWAQgAyzH6
AOODMBjgfWE9VeCgsrwH3exNAU32gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------BY9u42az07NLvopR7if6bw0b--

--------------WRdXqhg3WHnAK1RheeAQ0XId--

--------------ocmhIf09ae6ZTIuu00mZXwXx
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSoK90FAwAAAAAACgkQsN6d1ii/Ey+p
Dgf/Um3UHSq2Is8ZwWA00WlHPw/TPUeCfGx3vdzGlvOMAULR9ln3FRgrZNqJ75C2WJLatRG3CkiW
YKqrbkFUtin1cSDIgfTsdA8BAkpAJAXqy/gPKGnkz3va5NbI+UNgatr60st4a2EaX6DHzg0WCGST
/bfenmKSdcemtonoI6PvACtjbpmbjmJbnCHyCESy1PM5vxF8ADE3MhsnLyETwAFeYqf9qthcPg1M
s4Ev4ROtzd4c4JGDwCi8vHc75FgjpHQZ6E+4LOxLY69DjK5N03knKppToBkVhUD0wIVTNciVjsQb
azjvdEDSHch9aBU1RERfu4tBZ7ZiGsBqlfED1di8SA==
=EDmY
-----END PGP SIGNATURE-----

--------------ocmhIf09ae6ZTIuu00mZXwXx--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 15:15:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 15:15:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560561.876570 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHnBL-0005sJ-0Q; Fri, 07 Jul 2023 15:15:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560561.876570; Fri, 07 Jul 2023 15:15:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHnBK-0005sC-T0; Fri, 07 Jul 2023 15:15:38 +0000
Received: by outflank-mailman (input) for mailman id 560561;
 Fri, 07 Jul 2023 15:15:37 +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 <SRS0=VdXt=CZ=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qHnBJ-0004kb-QN
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 15:15:37 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [2001:67c:2178:6::1c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1f5098ac-1cd9-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 17:15:36 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 3C6C822366;
 Fri,  7 Jul 2023 15:15:35 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E2FC7139E0;
 Fri,  7 Jul 2023 15:15:34 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id XxK8NRYsqGSNDQAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 07 Jul 2023 15:15:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1f5098ac-1cd9-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688742935; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=cZncDOKZ9x+kpnlS7bBEnKGfdCqfhcrTh2UKs90bTUE=;
	b=ZODyVr89B9bQ/GIAu+X0tgi8UQMKOy6NVDlObFNpxH8eZ+6ytVYu98Eu31mrpvk8JcKptc
	poVQTlg0yo1LWYJHrO52KX2XozK3YCQWuL7LKlFWaD2qvxwAmXgtxrCDUD6ErGdz2UYmfY
	PGqrbhAwWzR4bG7qTBIIADJhjKahrXE=
Message-ID: <90a9ef87-b5e7-63fb-49c1-3606cefef8a4@suse.com>
Date: Fri, 7 Jul 2023 17:15:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <olekstysh@gmail.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 vikram.garhwal@amd.com
References: <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
 <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
 <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>
 <05341cac-ac75-a6e5-9c29-3caf83ea99fc@suse.com>
 <ZKff0w2EpzX5r8vK@MacBook-Air-de-Roger.local>
 <74493ba6-48c5-6326-b027-0b6761ef4836@suse.com>
 <ZKgkYKG11AWIUXuv@MacBook-Air-de-Roger.local>
 <106781fe-992b-8609-fe37-17619b699353@suse.com>
 <ZKgrwvSO9MgLqXTn@MacBook-Air-de-Roger.local>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <ZKgrwvSO9MgLqXTn@MacBook-Air-de-Roger.local>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------gBQZQQLufC3OxQcZ7IVdlfQH"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------gBQZQQLufC3OxQcZ7IVdlfQH
Content-Type: multipart/mixed; boundary="------------90Ooqz7cF1y4zzZJzl5mQrRx";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <olekstysh@gmail.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Petr Pavlu <petr.pavlu@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 vikram.garhwal@amd.com
Message-ID: <90a9ef87-b5e7-63fb-49c1-3606cefef8a4@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
References: <CAPD2p-nG8SbNYF6Ob262bP71qXNGmWLZcYTLO-DnnmTQX2VHvw@mail.gmail.com>
 <ZKUqomfCfjrQUt6u@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307051540590.761183@ubuntu-linux-20-04-desktop>
 <ZKZ4fAfbKsVEO_xo@MacBook-Air-de-Roger.local>
 <alpine.DEB.2.22.394.2307061449160.761183@ubuntu-linux-20-04-desktop>
 <05341cac-ac75-a6e5-9c29-3caf83ea99fc@suse.com>
 <ZKff0w2EpzX5r8vK@MacBook-Air-de-Roger.local>
 <74493ba6-48c5-6326-b027-0b6761ef4836@suse.com>
 <ZKgkYKG11AWIUXuv@MacBook-Air-de-Roger.local>
 <106781fe-992b-8609-fe37-17619b699353@suse.com>
 <ZKgrwvSO9MgLqXTn@MacBook-Air-de-Roger.local>
In-Reply-To: <ZKgrwvSO9MgLqXTn@MacBook-Air-de-Roger.local>

--------------90Ooqz7cF1y4zzZJzl5mQrRx
Content-Type: multipart/mixed; boundary="------------ahTK0ozz3fzdSsZPePPRJ5hg"

--------------ahTK0ozz3fzdSsZPePPRJ5hg
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMDcuMDcuMjMgMTc6MTQsIFJvZ2VyIFBhdSBNb25uw6kgd3JvdGU6DQo+IE9uIEZyaSwg
SnVsIDA3LCAyMDIzIGF0IDA1OjAxOjM4UE0gKzAyMDAsIEp1ZXJnZW4gR3Jvc3Mgd3JvdGU6
DQo+PiBPbiAwNy4wNy4yMyAxNjo0MiwgUm9nZXIgUGF1IE1vbm7DqSB3cm90ZToNCj4+PiBP
biBGcmksIEp1bCAwNywgMjAyMyBhdCAwNDoxMDoxNFBNICswMjAwLCBKdWVyZ2VuIEdyb3Nz
IHdyb3RlOg0KPj4+PiBPbiAwNy4wNy4yMyAxMTo1MCwgUm9nZXIgUGF1IE1vbm7DqSB3cm90
ZToNCj4+Pj4+IE9uIEZyaSwgSnVsIDA3LCAyMDIzIGF0IDA2OjM4OjQ4QU0gKzAyMDAsIEp1
ZXJnZW4gR3Jvc3Mgd3JvdGU6DQo+Pj4+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GRvaW5nIHRoZSBqb2IsIGJ1dCBzdGFydGluZyB3
aXRoICJ5b3UNCj4gd2lsbCBoYXZlIHRvIGltcGxlbWVudCBncmFudHMtdjMiIGlzIHF1aXRl
IGxpa2VseSB0byBkZXRlciBhbnlvbmUgZnJvbQ0KPiBhdHRlbXB0aW5nIHRvIHNvbHZlIHRo
aXMgSSdtIGFmcmFpZC4NCg0KRmFpciBlbm91Z2guIDotKQ0KDQoNCkp1ZXJnZW4NCg0K
--------------ahTK0ozz3fzdSsZPePPRJ5hg
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4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gkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------ahTK0ozz3fzdSsZPePPRJ5hg--

--------------90Ooqz7cF1y4zzZJzl5mQrRx--

--------------gBQZQQLufC3OxQcZ7IVdlfQH
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSoLBYFAwAAAAAACgkQsN6d1ii/Ey8m
CQf/Z/StDpMFgi/fp17fOXWy3N1Nw+0JUd0bXFmwdSy3rGPwfnmTPIxiIJyDxsOrfwejFFcqkrx4
YHf9THAOrfG+fUMlUYgFuEgLTPwwMWW9dEYpaDdadHS0c/CZDVozQoAMn80qJqfepz0QYKc7StmN
U0tEr4ZeZkhwOwnv63zGCKWdPS9T6sE1WCQk7QmaTFEYvCamy+HvPDb5UdTxVE0lnr8IewhrPFDD
iEgWVKHTp3HFjgQZPHOumQFwMNjqSCpdu4HQC8h4NX20HQxWQ9om0v0JkoYMWsQ5Dc1vrPk/9YWN
rrZr9s5cQz05zzyTAHBTtow3yEM1PrHOPHG0SMP1Cw==
=8fHh
-----END PGP SIGNATURE-----

--------------gBQZQQLufC3OxQcZ7IVdlfQH--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 15:56:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 15:56:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560568.876579 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHno5-0001yI-1M; Fri, 07 Jul 2023 15:55:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560568.876579; Fri, 07 Jul 2023 15:55:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHno4-0001yB-Uk; Fri, 07 Jul 2023 15:55:40 +0000
Received: by outflank-mailman (input) for mailman id 560568;
 Fri, 07 Jul 2023 15:55:39 +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
 <SRS0=X2dY=CZ=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qHno3-0001y2-DQ
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 15:55:39 +0000
Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com
 [2a00:1450:4864:20::631])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b512a91a-1cde-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 17:55:36 +0200 (CEST)
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-977e0fbd742so254768366b.2
 for <xen-devel@lists.xenproject.org>; Fri, 07 Jul 2023 08:55:34 -0700 (PDT)
Received: from EMEAENGAAD19049. (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 g3-20020a1709063b0300b009786ae9ed50sm2332013ejf.194.2023.07.07.08.55.32
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 07 Jul 2023 08:55:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b512a91a-1cde-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1688745334; x=1691337334;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=l65fIxU7PQPm2QeYAxinf04OLcyj1bHcNGD7tCg11BA=;
        b=c+kn5V3GJk0pRblbAZYRuQj1wG2f8SrpZ+MIN7fe2uqL76sQNebzCwf4091s12PXVH
         KZLTXTZD8zf157qZSxInyPeNi7JEXg1Ex04bOjuo9TSYvR6K2CBnv9aaDPx8+QnfRilU
         Ss73dsypdT4w3F7OaYqQLxNxUe55rjrZ8ybOI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688745334; x=1691337334;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=l65fIxU7PQPm2QeYAxinf04OLcyj1bHcNGD7tCg11BA=;
        b=NVTa1/7uiw0oajYx0BMhjfLHP2WyG/hxa/W/08zKbaQYg54ztKyrOp1ELoQdgvr/Gl
         B3oTpkwYAaf3JFPeEw/1iSc6KlwO4IjmQJAMPg5HlmPNnqGx8Xrp289beUOMmgrrNSLG
         cl1U5IIhlGumpCGzauMY17w2hc+6r9Wi/mBGYalpVvXdAy1NJ9GmocDcvZTMoJWuVUH1
         42sd4BIAzDr034sG5KmjmMxNA/Gu4Mclcy8kq1KvMP+0Ngx4r0D5hTFjXx8donOZGkOg
         kX8hIupuX7pwIv4kg0xAwst27pSouuBELZ/8cjCnyeVyw172qQNO5Tri4Vs4KCRdfALR
         57Bg==
X-Gm-Message-State: ABy/qLY4DEg/8wfpF3e3y2lBgVvBHoDsSBx4m0WqW1TTVUiZJPo5CQAn
	1/cimYvGE3691d9DAqEvtnqf7Q==
X-Google-Smtp-Source: APBJJlGOv/EBi7cIX94zSa9hHsbeSufxIl5kxtUUoFzxA7RSh7e3uvGIPmrN8t3uB9BE8lapIrSQlA==
X-Received: by 2002:a17:906:259:b0:993:d5bd:a757 with SMTP id 25-20020a170906025900b00993d5bda757mr1632745ejl.19.1688745333629;
        Fri, 07 Jul 2023 08:55:33 -0700 (PDT)
Message-ID: <64a83575.170a0220.2c96.8158@mx.google.com>
X-Google-Original-Message-ID: <ZKg1cgevZIfvwfQ6@EMEAENGAAD19049.>
Date: Fri, 7 Jul 2023 16:55:30 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2] mm/pdx: Add comments throughout the codebase for pdx
References: <20230622140237.8996-1-alejandro.vallejo@cloud.com>
 <e7d3daa3-7d5b-1c36-51f1-453bf11b55d2@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <e7d3daa3-7d5b-1c36-51f1-453bf11b55d2@suse.com>

On Thu, Jul 06, 2023 at 11:50:58AM +0200, Jan Beulich wrote:
> On 22.06.2023 16:02, Alejandro Vallejo wrote:
> > @@ -57,9 +100,25 @@ uint64_t __init pdx_init_mask(uint64_t base_addr)
> >                           (uint64_t)1 << (MAX_ORDER + PAGE_SHIFT)) - 1);
> >  }
> >  
> > -u64 __init pdx_region_mask(u64 base, u64 len)
> > +uint64_t __init pdx_region_mask(uint64_t base, uint64_t len)
> >  {
> > -    return fill_mask(base ^ (base + len - 1));
> > +    uint64_t last = base + len - 1;
> > +    /*
> > +     * The only bit that matters in base^last is the MSB. There are 2 cases.
> > +     *
> > +     * case msb(base) < msb(last):
> > +     *     then msb(fill_mask(base^last)) == msb(last). This is non
> > +     *     compressible.
> > +     * case msb(base) == msb(last):
> > +     *     This means that there _may_ be a sequence of compressible zeroes
> > +     *     for all addresses between `base` and `last` iff `base` has enough
> > +     *     trailing zeroes. That is, it's compressible when
> 
> Why trailing zeros? [100000f000,10ffffffff] has compressible bits
> 32-35, but the low bits of base don't matter at all.
Ugh, I was thinking about the zeroes in the hole, but those are hardly
trailing indeed. Look below for the revamped comment though, as this simply
goes away.

> 
> > +     *     msb(fill_mask(base^last)) < msb(last)
> 
> No caller uses the result this way, so I'm unconvinced it is helpful
> to explain it here this way. This is also why I'm still not convinced
> of the introduction of "last" (as a real variable and in the comment).
> It's only the invariant bits in the range that we're after, as you
> say ...
> > +     * The resulting mask is effectively the moving bits between `base` and
> > +     * `last`.
> 
> ... here (where things could be expressed without "last").
> 
I've given it a go rephrashing it in terms of the logical operations being
applied rather than the relationship between the inputs. If you're still
unsatisfied I'm happy to hear other suggestions. It's just a complicated
thing to put into words.

With this definition I'm happy to remove the `last` auxiliary variable from
the patch because it's unnecessary.

```
     * We say a bit "moves" in a range if there exist 2 addresses in that
     * range that have that bit both set and cleared respectively. We want
     * to create a mask of _all_ moving bits in this range. We do this by
     * comparing the first and last addresses in the range, discarding the
     * bits that remain the same (this is logically an XOR operation). The
     * MSB of the resulting expression is the most significant moving bit
     * in the range. Then it's a matter of setting every bit in lower
     * positions in order to get the mask of moving bits.
```

> > --- a/xen/include/xen/mm.h
> > +++ b/xen/include/xen/mm.h
> > @@ -31,6 +31,16 @@
> >   *   (i.e. all devices assigned to) a guest share a single DMA address space
> >   *   and, by default, Xen will ensure dfn == pfn.
> >   *
> > + * pdx: Page InDeX
> > + *   Indices into the frame table holding the per-page's book-keeping
> > + *   metadata. A compression scheme is used and there's a possibly non
> 
> s/is/may be/ ?
Ack. The scheme is used even if it can yield no gains, but I do plan on
making it optional, so this comment can preemptively already reflect that.

> 
> Also as said earlier at least on x86 pdx-es are also used as direct map
> indices. I think this wants mentioning irrespective of what Arm does.
This is a common header. If the warping of the directmap due to pdx
compression is mentioned one has to talk about the common aspects of it,
and at least give a heads up that each port is free to apply further warps.
I'll mention the notion of it, but it must be vague in the spirit of
describing common behaviour and not x86 in particular.

> 
> > --- a/xen/include/xen/pdx.h
> > +++ b/xen/include/xen/pdx.h
> > @@ -1,6 +1,67 @@
> >  #ifndef __XEN_PDX_H__
> >  #define __XEN_PDX_H__
> >  
> > +/*
> > + * PDX (Page inDeX)
> > + *
> > + * This file deals with optimisations pertaining frame table indexing,
> 
> Nit: Missing "to"?
Indeed
> 
> > + * A pdx is an index into the frame table. However, having an identity
> > + * relationship between mfn and pdx could waste copious amounts of memory
> > + * in empty frame table entries. There are some techniques to bring memory
> > + * wastage down.
> 
> Like above the direct map wants mentioning here as well, I think.
I can add another paragraph mentioning that warp. Like I mentioned before,
we should be careful not to leave the ARM port (or others) outside the
scope of these definitions as they aren't x86-specific.

> > + * ## PDX compression
> > + *
> > + * This is a technique to avoid wasting memory on machines known to have
> > + * split their machine address space in several big discontinuous and highly
> > + * disjoint chunks.
> > + *
> > + * In its uncompressed form the frame table must have book-keeping metadata
> > + * structures for every page between [0, max_mfn) (whether they are backed
> > + * by RAM or not), and a similar condition exists for the direct map. We
> > + * know some systems, however, that have some sparsity in their address
> > + * space, leading to a lot of wastage in the form of unused frame table
> > + * entries.
> > + *
> > + * This is where compression becomes useful. The idea is to note that if
> > + * you have several big chunks of memory sufficiently far apart you can
> > + * ignore the middle part of the address because it will always contain
> > + * zeroes as long as the base address is sufficiently well aligned and the
> > + * length of the region is much smaller than the base address.
> 
> As per above alignment of the base address doesn't really matter.
Where above? As far as I understand you need enough alignment to cover the
hole or you won't have zeroes to compress. Point in case:

  * region1: [0x0000000000000000 -
              0x00000000FFFFFFFF]

  * region2: [0x0001FFFFFFFFF000 -
              0x00020000FFFFFFFF]

I can agree this configuration is beyond dumb and statistically unlikely to
exist in the wild, but it should (IMO) still be covered by that comment.

> 
> > + * i.e:
> > + *   Consider 2 regions of memory. One starts at 0 while the other starts
> > + *   at offset 2^off_h. Furthermore, let's assume both regions are smaller
> > + *   than 2^off_l. This means that all addresses between [2^off_l, 2^off_h)
> > + *   are invalid and we can assume them to be zero on all valid addresses.
> > + *
> > + *                 off_h     off_l
> > + *                 |         |
> > + *                 V         V
> > + *         --------------------------
> > + *         |HHHHHHH|000000000|LLLLLL| <--- mfn
> > + *         --------------------------
> > + *           ^ |
> > + *           | | (de)compression by adding/removing "useless" zeroes
> > + *           | V
> > + *         ---------------
> > + *         |HHHHHHHLLLLLL| <--- pdx
> > + *         ---------------
> > + *
> > + * This scheme also holds for multiple regions, where HHHHHHH acts as
> > + * the region identifier and LLLLLL fully contains the span of every
> > + * region involved. Consider the following 3 regions.
> > + */
> > +
> >  #ifdef CONFIG_HAS_PDX
> 
> Stray last sentence in the comment?
Oops, yes. I had more, but it was inconsequential and I ended up removing
it. I'll remove that last sentence too.

> 
> > @@ -13,22 +74,81 @@ extern unsigned long pfn_top_mask, ma_top_mask;
> >                           (sizeof(*frame_table) & -sizeof(*frame_table)))
> >  extern unsigned long pdx_group_valid[];
> >  
> > -extern uint64_t pdx_init_mask(u64 base_addr);
> > -extern u64 pdx_region_mask(u64 base, u64 len);
> > +/**
> > + * Calculates a mask covering "moving" bits of all addresses of a region
> > + *
> > + * The i-th bit of the mask must be set if there's 2 different addresses
> > + * in the region that have different j-th bits. where j >= i.
> > + *
> > + * e.g:
> > + *       base=0x1B00000000
> > + *   len+base=0x1B00082000
> > + *
> > + *   ought to return 0x00000FFFFF, which implies that every bit position
> > + *   with a zero in the mask remains unchanged in every address of the
> > + *   region.
> 
> Maybe the example would look "more generic" if the resulting mask didn't
> consist of just 0s and Fs, e.g.
> 
>  *       base=0x1B00000000
>  *   len+base=0x1B00042000
>  *
>  *   ought to return 0x000007FFFF, ...
Good idea, sure.

> 
> > + * @param base Base address of the region
> > + * @param len  Size in octets of the region
> > + * @return Mask of moving bits at the bottom of all the region addresses
> > + */
> > +uint64_t pdx_region_mask(uint64_t base, uint64_t len);
> >  
> > -extern void set_pdx_range(unsigned long smfn, unsigned long emfn);
> > +/**
> > + * Creates a basic pdx mask
> 
> What is "basic" trying to describe here? "The mask to start from" would
> look more to the point to me, plus saying that this is the (up front)
> companion to pdx_region_mask().
I'm honestly on the fence on whether this function should exist at all. One
could always integrate this mask in pdx_region_mask() and have the
callers start with a zero mask. I won't do this on this patch, but I'll try
to get rid of it on the follow-up series to these docs.

> 
> > + * This mask is used to determine non-compressible bits. No address in the
> > + * system shall have compressible bits covered by this initial mask.
> > + *
> > + * It's the larger of:
> > + *   - A mask of MAX_ORDER + PAGESHIFT 1s
> > + *   - base_addr rounded up to the nearest `2^n - 1`
> 
> I'm having trouble with this mathematically: Rounding always means
> going to some proper multiple of some base number (granularity).
I'm not sure about that definition, but regardless I can just remove that
"larger of" and ignore the problem. It's basically telling what the code
does and not adding content.

> This doesn't fit with the value being 2^n-1. Maybe "padded"?
Padding the number would be adding zeroes or ones, but we're mutating it.
IMO, that would add more confusion than it would solve.

> 
> > + * @param base_addr Address of the first maddr in the system
> > + * @return An integer of the form 2^n - 1
> > + */
> > +uint64_t pdx_init_mask(uint64_t base_addr);
> > +
> > +/**
> > + * Mark [smfn, emfn) as allocatable in the frame table
> 
> What does "allocatable" mean here?
> 
> Jan
Accesible, which is probably what it should say instead.

Thanks,

Alejandro


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 16:08:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 16:08:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560571.876590 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHo07-000449-4W; Fri, 07 Jul 2023 16:08:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560571.876590; Fri, 07 Jul 2023 16:08:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHo07-000442-1P; Fri, 07 Jul 2023 16:08:07 +0000
Received: by outflank-mailman (input) for mailman id 560571;
 Fri, 07 Jul 2023 16:08:05 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X2dY=CZ=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qHo05-00043w-Dz
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 16:08:05 +0000
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
 [2a00:1450:4864:20::535])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 73d86aa2-1ce0-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 18:08:03 +0200 (CEST)
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-51d80d81d6eso2782859a12.1
 for <xen-devel@lists.xenproject.org>; Fri, 07 Jul 2023 09:08:03 -0700 (PDT)
Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 r20-20020aa7d594000000b0051e166f342asm2192094edq.66.2023.07.07.09.08.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 07 Jul 2023 09:08:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 73d86aa2-1ce0-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1688746083; x=1691338083;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=MGIFba9dcTnwZYyj5Ocyv8eJoh5iiQBvZlW6yEveKKg=;
        b=dpDhbws6+DHOhDWCAFHCXTJouhZ+nECYr6tdqqM/tQNEwhwdL1CoPPm8ze/KhLyRoz
         giiLguqT5+T+MWWcyqRVM+k2jmHX4FAleUOocUDsqZrAT724cbL4IFp977ZEm/RKhS6o
         SDDTpugh6tulYrd/hXLO6NfObA0SHZgWc2OdY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688746083; x=1691338083;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=MGIFba9dcTnwZYyj5Ocyv8eJoh5iiQBvZlW6yEveKKg=;
        b=cdR6SIOGv1ybb2FsE9kfuAtMnPB7k3o0PUusYLy9OWLS07i1kA18S9Dmaoj6+pehH/
         eu2xBCBNd7JNLizIx3IgoWRd/DFyClOspwveQQm9q2nd+ndyXSxsnFNe/nBKfRW8wIdO
         DtfnTOhM2YpJw8/h6wEum+imZHu9lQp+BClfdx7yMdAdrQGdtMfeqTxdMociI5s6KDg6
         XrIZ+3VksFKGyXwVGb5N4WvY+seiJngQr1cAv4Yoq2ABopvBy4ZELGRBPXGnIXVcbf8V
         IIFuQO6HbUDrIadsvHexH+pGLNpxgDSfF9ohUMe0iMJvGCKFIkRC0IujBjBK8eK7dEfm
         YziQ==
X-Gm-Message-State: ABy/qLa1mgSEYnrM3wtQHgVkzkKOkBramO2iJbdu63pXsDao3k9jThrO
	8PFGZ11f313D4kq9OH/Dk2gC1Rfmh6krVfpFMSA=
X-Google-Smtp-Source: APBJJlFXK30YnTOKSE1ZENZ+/rZ6fNt+eW1c5o6ikzDuLbeIszt+nNJuywBl8fMVNeACT357faj9KA==
X-Received: by 2002:a05:6402:892:b0:51d:96d2:6578 with SMTP id e18-20020a056402089200b0051d96d26578mr4280733edy.28.1688746083031;
        Fri, 07 Jul 2023 09:08:03 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v3] mm/pdx: Add comments throughout the codebase for pdx
Date: Fri,  7 Jul 2023 17:07:59 +0100
Message-Id: <20230707160759.12132-1-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Document the behaviour of the pdx machinery in Xen. Some logic is fairly
opaque and hard to follow without it being documented anywhere. This
explains the rationale behind compression and its relationship to
frametable indexing and directmap management.

While modifying the file:
  * Convert u64 -> uint64_t
  * Remove extern keyword from function prototypes

No functional change.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v3:
  * Exended the pdx=frametableindex definition also cover the directmap (to
    the extent that it still applies to every port)
  * [pdx.c] Removed auxiliary variable and turned the case analysis comment
            into a full paragraph.
  * [pdx.h] Removed stray sentence in pdx.h
  * [pdx.h] Made example in pdx_region_mask() clearer
  * [pdx.h] Clarified set_pdx_range() and pdx_init_mask()
---
 xen/common/pdx.c      |  59 +++++++++++++++++-
 xen/include/xen/mm.h  |  11 ++++
 xen/include/xen/pdx.h | 140 ++++++++++++++++++++++++++++++++++++++++--
 3 files changed, 203 insertions(+), 7 deletions(-)

diff --git a/xen/common/pdx.c b/xen/common/pdx.c
index c91875fabe..ec64d3d2ef 100644
--- a/xen/common/pdx.c
+++ b/xen/common/pdx.c
@@ -20,13 +20,56 @@
 #include <xen/bitops.h>
 #include <xen/nospec.h>
 
-/* Parameters for PFN/MADDR compression. */
+/*
+ * Diagram to make sense of the following variables. The masks and shifts
+ * are done on mfn values in order to convert to/from pdx:
+ *
+ *                      pfn_hole_mask
+ *                      pfn_pdx_hole_shift (mask bitsize)
+ *                      |
+ *                 |---------|
+ *                 |         |
+ *                 V         V
+ *         --------------------------
+ *         |HHHHHHH|000000000|LLLLLL| <--- mfn
+ *         --------------------------
+ *         ^       ^         ^      ^
+ *         |       |         |------|
+ *         |       |             |
+ *         |       |             pfn_pdx_bottom_mask
+ *         |       |
+ *         |-------|
+ *             |
+ *             pfn_top_mask
+ *
+ * ma_{top,va_bottom}_mask is simply a shifted pfn_{top,pdx_bottom}_mask,
+ * where ma_top_mask has zeroes shifted in while ma_va_bottom_mask has
+ * ones.
+ */
+
+/** Maximum (non-inclusive) usable pdx */
 unsigned long __read_mostly max_pdx;
+
+/** Mask for the lower non-compressible bits of an mfn */
 unsigned long __read_mostly pfn_pdx_bottom_mask = ~0UL;
+
+/** Mask for the lower non-compressible bits of an maddr or vaddr */
 unsigned long __read_mostly ma_va_bottom_mask = ~0UL;
+
+/** Mask for the higher non-compressible bits of an mfn */
 unsigned long __read_mostly pfn_top_mask = 0;
+
+/** Mask for the higher non-compressible bits of an maddr or vaddr */
 unsigned long __read_mostly ma_top_mask = 0;
+
+/**
+ * Mask for a pdx compression bit slice.
+ *
+ *  Invariant: valid(mfn) implies (mfn & pfn_hole_mask) == 0
+ */
 unsigned long __read_mostly pfn_hole_mask = 0;
+
+/** Number of bits of the "compressible" bit slice of an mfn */
 unsigned int __read_mostly pfn_pdx_hole_shift = 0;
 
 unsigned long __read_mostly pdx_group_valid[BITS_TO_LONGS(
@@ -42,7 +85,7 @@ bool __mfn_valid(unsigned long mfn)
 }
 
 /* Sets all bits from the most-significant 1-bit down to the LSB */
-static u64 __init fill_mask(u64 mask)
+static uint64_t __init fill_mask(uint64_t mask)
 {
     while (mask & (mask + 1))
         mask |= mask + 1;
@@ -57,8 +100,18 @@ uint64_t __init pdx_init_mask(uint64_t base_addr)
                          (uint64_t)1 << (MAX_ORDER + PAGE_SHIFT)) - 1);
 }
 
-u64 __init pdx_region_mask(u64 base, u64 len)
+uint64_t __init pdx_region_mask(uint64_t base, uint64_t len)
 {
+    /*
+     * We say a bit "moves" in a range if there exist 2 addresses in that
+     * range that have that bit both set and cleared respectively. We want
+     * to create a mask of _all_ moving bits in this range. We do this by
+     * comparing the first and last addresses in the range, discarding the
+     * bits that remain the same (this is logically an XOR operation). The
+     * MSB of the resulting expression is the most significant moving bit
+     * in the range. Then it's a matter of setting every bit in lower
+     * positions in order to get the mask of moving bits.
+     */
     return fill_mask(base ^ (base + len - 1));
 }
 
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index b0dc3ba9c9..f23aff3af2 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -31,6 +31,17 @@
  *   (i.e. all devices assigned to) a guest share a single DMA address space
  *   and, by default, Xen will ensure dfn == pfn.
  *
+ * pdx: Page InDeX
+ *   Indices into the frame table holding the per-page's book-keeping
+ *   metadata. A compression scheme may be used, so there's a possibly non
+ *   identity mapping between valid(mfn) <-> valid(pdx). See the comments
+ *   in pdx.c for an in-depth explanation of that mapping. This also has a
+ *   knock-on effect on the directmap, as "compressed" pfns have no
+ *   corresponding mapped frames.
+ *
+ * maddr: Machine Address
+ *   The physical address that corresponds to an mfn
+ *
  * WARNING: Some of these terms have changed over time while others have been
  * used inconsistently, meaning that a lot of existing code does not match the
  * definitions above.  New code should use these terms as described here, and
diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h
index 9fcfb0ce52..cc4fce71b1 100644
--- a/xen/include/xen/pdx.h
+++ b/xen/include/xen/pdx.h
@@ -1,6 +1,73 @@
 #ifndef __XEN_PDX_H__
 #define __XEN_PDX_H__
 
+/*
+ * PDX (Page inDeX)
+ *
+ * This file deals with optimisations pertaining to frame table and
+ * directmap indexing, A pdx is an index into the frame table, which
+ * typically also means an index into the directmap[1]. However, having an
+ * identity relationship between mfn and pdx could waste copious amounts of
+ * memory in empty frame table entries and page tables. There are some
+ * techniques to bring memory wastage down.
+ *
+ * [1] Some ports apply further modifications to a pdx before indexing the
+ *     directmap. This doesn't change the fact that the same compression
+ *     present in the frame table is also present in the directmap
+ *     whenever said map is present.
+ *
+ * ## PDX grouping
+ *
+ * The frame table may have some sparsity even on systems where the memory
+ * banks are tightly packed. This is due to system quirks (like the PCI
+ * hole) which might introduce several GiB of unused page frame numbers
+ * that uselessly waste memory in the frame table. PDX grouping addresses
+ * this by keeping a bitmap of the ranges in the frame table containing
+ * invalid entries and not allocating backing memory for them.
+ *
+ * ## PDX compression
+ *
+ * This is a technique to avoid wasting memory on machines known to have
+ * split their machine address space in several big discontinuous and highly
+ * disjoint chunks.
+ *
+ * In its uncompressed form the frame table must have book-keeping metadata
+ * structures for every page between [0, max_mfn) (whether they are backed
+ * by RAM or not), and a similar condition exists for the direct map. We
+ * know some systems, however, that have some sparsity in their address
+ * space, leading to a lot of wastage in the form of unused frame table
+ * entries.
+ *
+ * This is where compression becomes useful. The idea is to note that if
+ * you have several big chunks of memory sufficiently far apart you can
+ * ignore the middle part of the address because it will always contain
+ * zeroes as long as the base address is sufficiently well aligned and the
+ * length of the region is much smaller than the base address.
+ *
+ * i.e:
+ *   Consider 2 regions of memory. One starts at 0 while the other starts
+ *   at offset 2^off_h. Furthermore, let's assume both regions are smaller
+ *   than 2^off_l. This means that all addresses between [2^off_l, 2^off_h)
+ *   are invalid and we can assume them to be zero on all valid addresses.
+ *
+ *                 off_h     off_l
+ *                 |         |
+ *                 V         V
+ *         --------------------------
+ *         |HHHHHHH|000000000|LLLLLL| <--- mfn
+ *         --------------------------
+ *           ^ |
+ *           | | (de)compression by adding/removing "useless" zeroes
+ *           | V
+ *         ---------------
+ *         |HHHHHHHLLLLLL| <--- pdx
+ *         ---------------
+ *
+ * This scheme also holds for multiple regions, where HHHHHHH acts as
+ * the region identifier and LLLLLL fully contains the span of every
+ * region involved.
+ */
+
 #ifdef CONFIG_HAS_PDX
 
 extern unsigned long max_pdx;
@@ -13,22 +80,78 @@ extern unsigned long pfn_top_mask, ma_top_mask;
                          (sizeof(*frame_table) & -sizeof(*frame_table)))
 extern unsigned long pdx_group_valid[];
 
-extern uint64_t pdx_init_mask(u64 base_addr);
-extern u64 pdx_region_mask(u64 base, u64 len);
+/**
+ * Calculates a mask covering "moving" bits of all addresses of a region
+ *
+ * The i-th bit of the mask must be set if there's 2 different addresses
+ * in the region that have different j-th bits. where j >= i.
+ *
+ * e.g:
+ *       base=0x1B00000000
+ *   len+base=0x1B00042000
+ *
+ *   ought to return 0x000007FFFF, which implies that every bit position
+ *   with a zero in the mask remains unchanged in every address of the
+ *   region.
+ *
+ * @param base Base address of the region
+ * @param len  Size in octets of the region
+ * @return Mask of moving bits at the bottom of all the region addresses
+ */
+uint64_t pdx_region_mask(uint64_t base, uint64_t len);
 
-extern void set_pdx_range(unsigned long smfn, unsigned long emfn);
+/**
+ * Creates the mask to start from when calculating non-compressible bits
+ *
+ * This function is intimately related to pdx_region_mask(), and together
+ * they are meant to calculate the mask of non-compressible bits given the
+ * current memory map.
+ *
+ * @param base_addr Address of the first maddr in the system
+ * @return An integer of the form 2^n - 1
+ */
+uint64_t pdx_init_mask(uint64_t base_addr);
+
+/**
+ * Mark [smfn, emfn) as accesible in the frame table
+ *
+ * @param smfn Start mfn
+ * @param emfn End mfn
+ */
+void set_pdx_range(unsigned long smfn, unsigned long emfn);
 
 #define page_to_pdx(pg)  ((pg) - frame_table)
 #define pdx_to_page(pdx) gcc11_wrap(frame_table + (pdx))
 
+/**
+ * Invoked to determine if an mfn has an associated valid frame table entry
+ *
+ * In order for it to be legal it must pass bounds, grouping and
+ * compression sanity checks.
+ *
+ * @param mfn To-be-checked mfn
+ * @return True iff all checks pass
+ */
 bool __mfn_valid(unsigned long mfn);
 
+/**
+ * Map pfn to its corresponding pdx
+ *
+ * @param pfn Frame number
+ * @return Obtained pdx after compressing the pfn
+ */
 static inline unsigned long pfn_to_pdx(unsigned long pfn)
 {
     return (pfn & pfn_pdx_bottom_mask) |
            ((pfn & pfn_top_mask) >> pfn_pdx_hole_shift);
 }
 
+/**
+ * Map a pdx to its corresponding pfn
+ *
+ * @param pdx Page index
+ * @return Obtained pfn after decompressing the pdx
+ */
 static inline unsigned long pdx_to_pfn(unsigned long pdx)
 {
     return (pdx & pfn_pdx_bottom_mask) |
@@ -38,7 +161,16 @@ static inline unsigned long pdx_to_pfn(unsigned long pdx)
 #define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
 #define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
 
-extern void pfn_pdx_hole_setup(unsigned long);
+/**
+ * Initializes global variables with information about the compressible
+ * range of the current memory regions.
+ *
+ * @param mask This mask is the biggest pdx_mask of every region in the
+ *             system ORed with all base addresses of every region in the
+ *             system. This results in a mask where every zero in a bit
+ *             position marks a potentially compressible bit.
+ */
+void pfn_pdx_hole_setup(unsigned long mask);
 
 #endif /* HAS_PDX */
 #endif /* __XEN_PDX_H__ */
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 07 16:13:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 16:13:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560574.876600 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHo4p-0005Wy-Nn; Fri, 07 Jul 2023 16:12:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560574.876600; Fri, 07 Jul 2023 16:12:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHo4p-0005Wc-Io; Fri, 07 Jul 2023 16:12:59 +0000
Received: by outflank-mailman (input) for mailman id 560574;
 Fri, 07 Jul 2023 16:12:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHo4o-0005WS-FO; Fri, 07 Jul 2023 16:12:58 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHo4o-0007AN-8h; Fri, 07 Jul 2023 16:12:58 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHo4n-0001r6-Uv; Fri, 07 Jul 2023 16:12:58 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qHo4n-0001nb-UX; Fri, 07 Jul 2023 16:12:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=G7chfzINKPb4tT1V3fMkf6ILxeoeI8b4jytv+2XEKPI=; b=43/iZwbdOxW8yl9ODDT0leJAPk
	OK7o8EinE/cUAhlpagp/lEgF/aTexCCnDt4QiQ9DNRYT2txcQmj8X4Plo5Hd16VK+vsJsAAKZofof
	0xpr1Oud6gxcKIjeAm7N+4sL9s+3SVofY3UheG7I0SjRnZJKOWaX2CHxOUDMVDw4c9Ho=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181731-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181731: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-qemut-rhel6hvm-amd:xen-install:fail:heisenbug
    xen-unstable:test-amd64-i386-xl-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-amd64-i386-migrupgrade:xen-install/src_host:fail:heisenbug
    xen-unstable:test-armhf-armhf-xl:xen-boot:fail:heisenbug
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=886c22f00c575199f7bb3dc5b7662dd09bf05146
X-Osstest-Versions-That:
    xen=886c22f00c575199f7bb3dc5b7662dd09bf05146
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 07 Jul 2023 16:12:57 +0000

flight 181731 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181731/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-qemut-rhel6hvm-amd 7 xen-install fail in 181727 pass in 181731
 test-amd64-i386-xl-vhd 21 guest-start/debian.repeat fail in 181727 pass in 181731
 test-amd64-i386-migrupgrade  10 xen-install/src_host       fail pass in 181727
 test-armhf-armhf-xl           8 xen-boot                   fail pass in 181727

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl         15 migrate-support-check fail in 181727 never pass
 test-armhf-armhf-xl     16 saverestore-support-check fail in 181727 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181727
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181727
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181727
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181727
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181727
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181727
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181727
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181727
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181727
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181727
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181727
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181727
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  886c22f00c575199f7bb3dc5b7662dd09bf05146
baseline version:
 xen                  886c22f00c575199f7bb3dc5b7662dd09bf05146

Last test of basis   181731  2023-07-07 07:25:19 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Fri Jul 07 16:45:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 16:45:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560590.876614 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHoa7-0000fw-B1; Fri, 07 Jul 2023 16:45:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560590.876614; Fri, 07 Jul 2023 16:45:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHoa7-0000fp-8S; Fri, 07 Jul 2023 16:45:19 +0000
Received: by outflank-mailman (input) for mailman id 560590;
 Fri, 07 Jul 2023 16:45:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zEh2=CZ=gmail.com=olekstysh@srs-se1.protection.inumbo.net>)
 id 1qHoa5-0000fg-TB
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 16:45:17 +0000
Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com
 [2a00:1450:4864:20::22d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a6b23f43-1ce5-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 18:45:16 +0200 (CEST)
Received: by mail-lj1-x22d.google.com with SMTP id
 38308e7fff4ca-2b5c231c23aso34431131fa.0
 for <xen-devel@lists.xenproject.org>; Fri, 07 Jul 2023 09:45:16 -0700 (PDT)
Received: from [192.168.0.106] ([91.123.150.167])
 by smtp.gmail.com with ESMTPSA id
 a9-20020ac25209000000b004fbc6a8ad08sm742351lfl.306.2023.07.07.09.45.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 07 Jul 2023 09:45:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a6b23f43-1ce5-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688748316; x=1691340316;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=mLkW/hgt/ozYBGOqiaEtaZHsC+ZmrsXvgu2nxUx2jm4=;
        b=ibMKfHQVzVqX94+UXQsj1P+n+g7rP7MgX5YDQhU8KaSYAQTtbnlJtU/d0dh9xe6gkB
         P32oa8MUKng8AstW3AOXOf8NnFNgmbcox+slxmqDdqn8rnJfMJVfCJGjxUi2VXxZZuPp
         hDn6GYqeXHBmqKVqdfl20Qboq9LyPnM6F9bIw4qLW7bgbUuLGR3tUFVa9/2C/nL2l7l4
         DPw7fBj+Q7gIeBwQjUD4+m9ldmcNoZYmsxG4EUVIIC+1ImewPWpck2qjawxXVRMBl/5y
         a/6RzLTSLunnZyr2paBeJ/5GKNet8c5uF/rRJe7NKyyq76tG8C8qt1k4M8h1WOVEtFWP
         bu2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688748316; x=1691340316;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=mLkW/hgt/ozYBGOqiaEtaZHsC+ZmrsXvgu2nxUx2jm4=;
        b=agv8px0RVAjnqBW0+3UwkadpLkIHn6kZSiWO1xCfaDnfw8fjssdH+Wwz7wDhczr0WE
         umRSSEYatN6kTOU2y3HwKQUlPGCRD9V1B983cZLEaRZtDo7JmZ7kROWfyE8UmdSv5M4B
         AXdsYw6BL1RrhyDwYAyl5TDu2+5xiVaoCUp/ZZ9RkMPFIf3OUfSjdJ4SBz34rXUFYAAB
         XpPHM6gVVr/oI4c5xn3FdcZLeA8Y+epm0yOmrEjJ79msRON4+/TaGiSAvRG7MOH8Ex4t
         Z1ccvMO8kOOjEDYQk/nyRx58BE485TTrcv8Uxm3bmp69vCHy5mJ3GEqel21Nr0C6Ogxw
         pDXw==
X-Gm-Message-State: ABy/qLY1woieyzkfJnVdU2ZVXZgx/kSK/ClGO0S6YyaEbCP7mNpvX4xf
	Bfo4mwl0o5/PXbUJNq00M4E=
X-Google-Smtp-Source: APBJJlEMA8a25b1JAS0jkbMZ61puIL9z7YkwgN44MGfRoPJAQBUQoDsUiZlihYjV+tzLY2Dqvl/iRQ==
X-Received: by 2002:ac2:4db5:0:b0:4fb:9469:d65f with SMTP id h21-20020ac24db5000000b004fb9469d65fmr4016168lfe.37.1688748315707;
        Fri, 07 Jul 2023 09:45:15 -0700 (PDT)
Message-ID: <828f5936-3bdf-2bbd-158b-d29350a72e14@gmail.com>
Date: Fri, 7 Jul 2023 19:45:13 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [PATCH v7 10/12] vpci: add initial support for virtual PCI bus
 topology
To: Jan Beulich <jbeulich@suse.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20230613103159.524763-1-volodymyr_babchuk@epam.com>
 <20230613103159.524763-11-volodymyr_babchuk@epam.com>
 <f368e425-157f-ea1c-2123-be8a374c328d@suse.com>
Content-Language: en-US
From: Oleksandr Tyshchenko <olekstysh@gmail.com>
In-Reply-To: <f368e425-157f-ea1c-2123-be8a374c328d@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 21.06.23 15:06, Jan Beulich wrote:

Hello all


> On 13.06.2023 12:32, Volodymyr Babchuk wrote:
>> @@ -121,6 +124,62 @@ int vpci_add_handlers(struct pci_dev *pdev)
>>   }
>>   
>>   #ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
>> +static int add_virtual_device(struct pci_dev *pdev)
>> +{
>> +    struct domain *d = pdev->domain;
>> +    pci_sbdf_t sbdf = { 0 };
>> +    unsigned long new_dev_number;
>> +
>> +    if ( is_hardware_domain(d) )
>> +        return 0;
>> +
>> +    ASSERT(pcidevs_locked());
>> +
>> +    /*
>> +     * Each PCI bus supports 32 devices/slots at max or up to 256 when
>> +     * there are multi-function ones which are not yet supported.
>> +     */
>> +    if ( pdev->info.is_extfn )
>> +    {
>> +        gdprintk(XENLOG_ERR, "%pp: only function 0 passthrough supported\n",
>> +                 &pdev->sbdf);
>> +        return -EOPNOTSUPP;
>> +    }
>> +
>> +    new_dev_number = find_first_zero_bit(d->vpci_dev_assigned_map,
>> +                                         VPCI_MAX_VIRT_DEV);
>> +    if ( new_dev_number >= VPCI_MAX_VIRT_DEV )
>> +        return -ENOSPC;
>> +
>> +    __set_bit(new_dev_number, &d->vpci_dev_assigned_map);
> 
> Since the find-and-set can't easily be atomic, the lock used here (
> asserted to be held above) needs to be the same as ...
> 
>> +    /*
>> +     * Both segment and bus number are 0:
>> +     *  - we emulate a single host bridge for the guest, e.g. segment 0
>> +     *  - with bus 0 the virtual devices are seen as embedded
>> +     *    endpoints behind the root complex
>> +     *
>> +     * TODO: add support for multi-function devices.
>> +     */
>> +    sbdf.devfn = PCI_DEVFN(new_dev_number, 0);
>> +    pdev->vpci->guest_sbdf = sbdf;
>> +
>> +    return 0;
>> +
>> +}
>> +
>> +static void vpci_remove_virtual_device(const struct pci_dev *pdev)
>> +{
>> +    write_lock(&pdev->domain->vpci_rwlock);
>> +    if ( pdev->vpci )
>> +    {
>> +        __clear_bit(pdev->vpci->guest_sbdf.dev,
>> +                    &pdev->domain->vpci_dev_assigned_map);
>> +        pdev->vpci->guest_sbdf.sbdf = ~0;
>> +    }
>> +    write_unlock(&pdev->domain->vpci_rwlock);
> 
> ... the one used here.


I think, it makes sense, yes.

***

There is one more thing. As far as I remember, there were some requests 
provided for the previous version (also v7) [1]. At least one of them, I 
assume, is still applicable here. I am speaking about a request to 
consider moving "cleaning up guest_sbdf / vpci_dev_assigned_map" into 
vpci_remove_device() here and aliasing of vpci_deassign_device() to 
vpci_remove_device() in commit #03/12.

The diff below (to be applied on top of current patch) is my 
understanding (not even build tested):

diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index a61282cc5b..c3e6c153bc 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -51,6 +51,15 @@ void vpci_remove_device(struct pci_dev *pdev)
          return;
      }

+#ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
+    if ( pdev->vpci->guest_sbdf.sbdf != ~0 )
+    {
+        __clear_bit(pdev->vpci->guest_sbdf.dev,
+                    &pdev->domain->vpci_dev_assigned_map);
+        pdev->vpci->guest_sbdf.sbdf = ~0;
+    }
+#endif
+
      vpci = pdev->vpci;
      pdev->vpci = NULL;
      write_unlock(&pdev->domain->vpci_rwlock);
@@ -152,10 +161,14 @@ static int add_virtual_device(struct pci_dev *pdev)
          return -EOPNOTSUPP;
      }

+    write_lock(&pdev->domain->vpci_rwlock);
      new_dev_number = find_first_zero_bit(d->vpci_dev_assigned_map,
                                           VPCI_MAX_VIRT_DEV);
      if ( new_dev_number >= VPCI_MAX_VIRT_DEV )
+    {
+        write_unlock(&pdev->domain->vpci_rwlock);
          return -ENOSPC;
+    }

      __set_bit(new_dev_number, &d->vpci_dev_assigned_map);

@@ -169,23 +182,12 @@ static int add_virtual_device(struct pci_dev *pdev)
       */
      sbdf.devfn = PCI_DEVFN(new_dev_number, 0);
      pdev->vpci->guest_sbdf = sbdf;
+    write_unlock(&pdev->domain->vpci_rwlock);

      return 0;

  }

-static void vpci_remove_virtual_device(const struct pci_dev *pdev)
-{
-    write_lock(&pdev->domain->vpci_rwlock);
-    if ( pdev->vpci )
-    {
-        __clear_bit(pdev->vpci->guest_sbdf.dev,
-                    &pdev->domain->vpci_dev_assigned_map);
-        pdev->vpci->guest_sbdf.sbdf = ~0;
-    }
-    write_unlock(&pdev->domain->vpci_rwlock);
-}
-
  /* Notify vPCI that device is assigned to guest. */
  int vpci_assign_device(struct pci_dev *pdev)
  {
@@ -215,7 +217,6 @@ void vpci_deassign_device(struct pci_dev *pdev)
      if ( !has_vpci(pdev->domain) )
          return;

-    vpci_remove_virtual_device(pdev);
      vpci_remove_device(pdev);
  }
  #endif /* CONFIG_HAS_VPCI_GUEST_SUPPORT */
(END)



[1] 
https://lore.kernel.org/xen-devel/20220719174253.541965-10-olekstysh@gmail.com/
https://lore.kernel.org/xen-devel/20220719174253.541965-3-olekstysh@gmail.com/

> 
> Jan
> 


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 20:51:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 20:51:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560594.876623 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHsQL-0008L4-KZ; Fri, 07 Jul 2023 20:51:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560594.876623; Fri, 07 Jul 2023 20:51:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHsQL-0008Kx-HV; Fri, 07 Jul 2023 20:51:29 +0000
Received: by outflank-mailman (input) for mailman id 560594;
 Fri, 07 Jul 2023 20:51:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=RURV=CZ=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHsQK-0008Kr-5e
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 20:51:28 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 093be36d-1d08-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 22:51:25 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 44C79617C2;
 Fri,  7 Jul 2023 20:51:24 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4AF2AC433C7;
 Fri,  7 Jul 2023 20:51:22 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 093be36d-1d08-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688763083;
	bh=GkXa8NYTqsjiWmtWF+qgPMdkxGiHi2MVtxO2Vakv29A=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=WK1csyYveOTFWsizvszDMo8qCgo1qc0k2DanpwjXjN1D+dSiyEbnoQZJhKjUhCva4
	 s+3GqsRvhPqwOIyZFbUEjUd/4q71D63u8xUUCobHPmbLJ3o6KfipfkhiexKduTlW/Q
	 DxhBaruLd9jB+Xv6F1MIjySBwgr6JRrYYn6z7YVlxxWh2vSRZIcBRUNnTjoATlHURb
	 d1GwybmKL6/1bvbdfWZGNlWaBfNeduJE7DjiXWSy1rzVkTR3X9kjenThs/W9qwDU+K
	 54N+7USxbT8r3yxoBj5aXOMFvf+kCOaoiN501guP/01T98fifkhwYyhAw9ZfyzFaFg
	 70VtWOtLzX9EQ==
Date: Fri, 7 Jul 2023 13:51:20 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: jgross@suse.com
cc: roger.pau@citrix.com, sstabellini@kernel.org, olekstysh@gmail.com, 
    marmarek@invisiblethingslab.com, Oleksandr_Tyshchenko@epam.com, 
    petr.pavlu@suse.com, xen-devel@lists.xenproject.org, 
    xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, 
    vikram.garhwal@amd.com
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
In-Reply-To: <100177f8fec144ac96d91de226f76ebe@posteo.net>
Message-ID: <alpine.DEB.2.22.394.2307071347160.761183@ubuntu-linux-20-04-desktop>
References: <100177f8fec144ac96d91de226f76ebe@posteo.net>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="8323329-55874677-1688763083=:761183"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-55874677-1688763083=:761183
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT

On Fri, 7 Jul 2023:
> On 07.07.23 16:42, Roger Pau MonnÃ© wrote:
> > On Fri, Jul 07, 2023 at 04:10:14PM +0200, Juergen Gross wrote:
> > > On 07.07.23 11:50, Roger Pau MonnÃ© wrote:
> > > > On Fri, Jul 07, 2023 at 06:38:48AM +0200, Juergen Gross wrote:
> > > > > On 06.07.23 23:49, Stefano Stabellini wrote:
> > > > > > On Thu, 6 Jul 2023, Roger Pau MonnÃ© wrote:
> > > > > > > On Wed, Jul 05, 2023 at 03:41:10PM -0700, Stefano Stabellini
> > > > > > > wrote:
> > > > > > > > On Wed, 5 Jul 2023, Roger Pau MonnÃ© wrote:
> > > > > > > > > On Tue, Jul 04, 2023 at 08:14:59PM +0300, Oleksandr Tyshchenko
> > > > > > > > > wrote:
> > > > > > > > > > Part 2 (clarification):
> > > > > > > > > > 
> > > > > > > > > > I think using a special config space register in the root
> > > > > > > > > > complex would
> > > > > > > > > > not be terrible in terms of guest changes because it is easy
> > > > > > > > > > to
> > > > > > > > > > introduce a new root complex driver in Linux and other OSes.
> > > > > > > > > > The root
> > > > > > > > > > complex would still be ECAM compatible so the regular ECAM
> > > > > > > > > > driver would
> > > > > > > > > > still work. A new driver would only be necessary if you want
> > > > > > > > > > to be able
> > > > > > > > > > to access the special config space register.
> > > > > > > > > 
> > > > > > > > > I'm slightly worry of this approach, we end up modifying a
> > > > > > > > > root
> > > > > > > > > complex emulation in order to avoid modifying a PCI device
> > > > > > > > > emulation
> > > > > > > > > on QEMU, not sure that's a good trade off.
> > > > > > > > > 
> > > > > > > > > Note also that different architectures will likely have
> > > > > > > > > different root
> > > > > > > > > complex, and so you might need to modify several of them, plus
> > > > > > > > > then
> > > > > > > > > arrange the PCI layout correctly in order to have the proper
> > > > > > > > > hierarchy
> > > > > > > > > so that devices belonging to different driver domains are
> > > > > > > > > assigned to
> > > > > > > > > different bridges.
> > > > > > > > 
> > > > > > > > I do think that adding something to the PCI conf register
> > > > > > > > somewhere is
> > > > > > > > the best option because it is not dependent on ACPI and it is
> > > > > > > > not
> > > > > > > > dependent on xenstore both of which are very undesirable.
> > > > > > > > 
> > > > > > > > I am not sure where specifically is the best place. These are 3
> > > > > > > > ideas
> > > > > > > > we came up with:
> > > > > > > > 1. PCI root complex
> > > > > > > > 2. a register on the device itself
> > > > > > > > 3. a new capability of the device
> > > > > > > > 4. add one extra dummy PCI device for the sole purpose of
> > > > > > > > exposing the
> > > > > > > >       grants capability
> > > > > > > > 
> > > > > > > > 
> > > > > > > > Looking at the spec, there is a way to add a vendor-specific
> > > > > > > > capability
> > > > > > > > (cap_vndr = 0x9). Could we use that? It doesn't look like it is
> > > > > > > > used
> > > > > > > > today, Linux doesn't parse it.
> > > > > > > 
> > > > > > > I did wonder the same from a quick look at the spec.  There's
> > > > > > > however
> > > > > > > a text in the specification that says:
> > > > > > > 
> > > > > > > "The driver SHOULD NOT use the Vendor data capability except for
> > > > > > > debugging and reporting purposes."
> > > > > > > 
> > > > > > > So we would at least need to change that because the capability
> > > > > > > would
> > > > > > > then be used by other purposes different than debugging and
> > > > > > > reporting.
> > > > > > > 
> > > > > > > Seems like a minor adjustment, so might we worth asking upstream
> > > > > > > about
> > > > > > > their opinion, and to get a conversation started.
> > > > > > 
> > > > > > Wait, wouldn't this use-case fall under "reporting" ? It is exactly
> > > > > > what
> > > > > > we are doing, right?
> > > > > 
> > > > > I'd understand "reporting" as e.g. logging, transferring statistics,
> > > > > ...
> > > > > 
> > > > > We'd like to use it for configuration purposes.
> > > > 
> > > > I've also read it that way.
> > > > 
> > > > > Another idea would be to enhance the virtio IOMMU device to suit our
> > > > > needs:
> > > > > we could add the domid as another virtio IOMMU device capability and
> > > > > (for now)
> > > > > use bypass mode for all "productive" devices.
> > > > 
> > > > If we have to start adding capabilties, won't it be easier to just add
> > > > it to the each device instead of adding it to virtio IOMMU.  Or is the
> > > > parsing of capabilities device specific, and hence we would have to
> > > > implement such parsing for each device?  I would expect some
> > > > capabilities are shared between all devices, and a Xen capability could
> > > > be one of those.
> > > 
> > > Have a look at [1], which is describing the common device config layout.
> > > The problem here is that we'd need to add the domid after the queue
> > > specific
> > > data, resulting in a mess if further queue fields would be added later.
> > > 
> > > We could try that, of course.
> > 
> > Right, we must make it part of the standard if we modify
> > virtio_pci_common_cfg, or else newly added fields would overlap the
> > Xen specific one.
> > 
> > Would it be possible to signal Xen-grants support in the
> > `device_feature` field, and then expose it from a vendor capability?
> > IOW, would it be possible to add a Xen-specific hook in the parsing of
> > virtio_pci_common_cfg that would then fetch additional data from a
> > capability?
> 
> TBH, I don't know. It might require some changes in the central parsing
> logic, but this shouldn't be too hard to do.
> 
> > That would likely be less intrusive than adding a new Xen-specific
> > field to virtio_pci_common_cfg while still allowing us to do Xen
> > specific configuration for all VirtIO devices.
> 
> In case we want to go that route, this should be in a new "platform config"
> capability, which might be just another form of a vendor capability.
 
I think this is the best idea. We should look into this.


> > > > > Later we could even add grant-V3 support to Xen and to the virtio
> > > > > IOMMU device
> > > > > (see my last year Xen Summit design session). This could be usable for
> > > > > disaggregated KVM setups, too, so I believe there is a chance to get
> > > > > this
> > > > > accepted.
> > > > > 
> > > > > > > > > > **********
> > > > > > > > > > What do you think about it? Are there any pitfalls, etc?
> > > > > > > > > > This also requires
> > > > > > > > > > system changes, but at least without virtio spec changes.
> > > > > > > > > 
> > > > > > > > > Why are we so reluctant to add spec changes?  I understand
> > > > > > > > > this might
> > > > > > > > > take time an effort, but it's the only way IMO to build a
> > > > > > > > > sustainable
> > > > > > > > > VirtIO Xen implementation.  Did we already attempt to
> > > > > > > > > negotiate with
> > > > > > > > > Oasis Xen related spec changes and those where refused?
> > > > > > > > 
> > > > > > > > That's because spec changes can be very slow. This is a bug that
> > > > > > > > we need
> > > > > > > > a relatively quick solution for and waiting 12-24 months for a
> > > > > > > > spec
> > > > > > > > update is not realistic.
> > > > > > > > 
> > > > > > > > I think a spec change would be best as a long term solution. We
> > > > > > > > also
> > > > > > > > need a short term solution. The short term solution doesn't have
> > > > > > > > to be
> > > > > > > > ideal but it has to work now.
> > > > > > > 
> > > > > > > My fear with such approach is that once a bodge is in place people
> > > > > > > move on to other stuff and this never gets properly fixed.
> > > > > > > 
> > > > > > > I know this might not be a well received opinion, but it would be
> > > > > > > better if such bodge is kept in each interested party patchqueue
> > > > > > > for
> > > > > > > the time being, until a proper solution is implemented.  That way
> > > > > > > there's an interest from parties into properly fixing it upstream.
> > > > > > 
> > > > > > Unfortunately we are in the situation where we have an outstanding
> > > > > > upstream bug, so we have to take action one way or the other.
> > > > > 
> > > > > The required virtio IOMMU device modification would be rather small,
> > > > > so
> > > > > adding it maybe under a CONFIG option defaulting to off might be
> > > > > acceptable.
> > > > 
> > > > Would you then do the grant allocation as part of virtio IOMMU?
> > > 
> > > Long term, maybe. Do you remember my Grant-V3 design session last year?
> > > Being
> > > able to reuse the same layout for virtio IOMMU was one of the basic ideas
> > > for
> > > that layout (this would need some heavy work on the virtio IOMMU frontend
> > > and
> > > backend, of course).
> > 
> > While this might well be the best option, do we have anyone with the
> > time and expertise to work on this?  I might be wrong, but it seems
> > like a huge task.
> 
> As a background project I'd like to pursue it. OTOH I'm not sure how much time
> I could spend on it.

Not only it is complex but also has severe implications in terms of
security, safety, and needs to interact with potential virtual IOMMUs in
the guest (virtual IOMMUs to expose another IOMMU stage of translation
in the guest.)

This is definitely not simple.

At that point I would feel more confident in a solution that uses ACPI
tables to add the necessary information the same way we use Device Tree
to do it on ARM. Keep in mind that if an existing ACPI table doesn't
have the fields that we need, we can introduce a new ACPI table.
--8323329-55874677-1688763083=:761183--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 20:53:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 20:53:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560598.876634 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHsRp-0000QS-Vh; Fri, 07 Jul 2023 20:53:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560598.876634; Fri, 07 Jul 2023 20:53:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHsRp-0000QL-SO; Fri, 07 Jul 2023 20:53:01 +0000
Received: by outflank-mailman (input) for mailman id 560598;
 Fri, 07 Jul 2023 20:53:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHsRp-0000Q8-0B; Fri, 07 Jul 2023 20:53:01 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHsRo-0004uP-RG; Fri, 07 Jul 2023 20:53:00 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHsRo-00088d-CW; Fri, 07 Jul 2023 20:53:00 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qHsRo-0005QN-C1; Fri, 07 Jul 2023 20:53:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=XSjofqbZiGDCjpXXzNI0tEcVqaBEC9H9tP27PWZVyiw=; b=3Wmrn76R9qBQRBQ91oyNIx1Ysj
	3X3CDW3MSIc70mA7It1sX8x2kPzc//QAIlbYCIiz1OH2z8hZtrohzQQjNeHret2h56Bkad5X4DNGO
	ymHeyPurZx8oqkDH77vwNL4NsE/kYFUJ+1G0hZiONCvgh0U95BP9NXgcEfBuKlmJY/tQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181732-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181732: regressions - trouble: broken/fail/pass
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-pvshim:<job status>:broken:regression
    linux-linus:test-amd64-amd64-xl-pvshim:host-install(5):broken:regression
    linux-linus:test-amd64-amd64-pygrub:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:freebsd-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:debian-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:debian-hvm-install:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:xen-boot:fail:allowable
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=5133c9e51de41bfa902153888e11add3342ede18
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 07 Jul 2023 20:53:00 +0000

flight 181732 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181732/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-pvshim      <job status>                 broken
 test-amd64-amd64-xl-pvshim    5 host-install(5)        broken REGR. vs. 180278
 test-amd64-amd64-pygrub       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl          11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2  8 xen-boot               fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd 11 leak-check/basis(11)    fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64  8 xen-boot    fail REGR. vs. 180278
 test-amd64-amd64-libvirt      8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64 12 freebsd-install      fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu 12 debian-install          fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd 12 debian-hvm-install  fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 12 xen-boot/src_host       fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds      8 xen-boot                 fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                5133c9e51de41bfa902153888e11add3342ede18
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   82 days
Failing since        180281  2023-04-17 06:24:36 Z   81 days  160 attempts
Testing same since   181732  2023-07-07 11:54:08 Z    0 days    1 attempts

------------------------------------------------------------
3720 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   broken  
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-amd64-amd64-xl-pvshim broken
broken-step test-amd64-amd64-xl-pvshim host-install(5)

Not pushing.

(No revision log; it would be 615894 lines long.)


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 21:02:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 21:02:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560606.876644 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHsae-00023V-UB; Fri, 07 Jul 2023 21:02:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560606.876644; Fri, 07 Jul 2023 21:02:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHsae-00023O-QY; Fri, 07 Jul 2023 21:02:08 +0000
Received: by outflank-mailman (input) for mailman id 560606;
 Fri, 07 Jul 2023 21:02:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=RURV=CZ=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHsad-00023I-5s
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 21:02:07 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 86b3d2e1-1d09-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 23:02:05 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 5739E61A66;
 Fri,  7 Jul 2023 21:02:04 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE6F2C433C7;
 Fri,  7 Jul 2023 21:02:02 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 86b3d2e1-1d09-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688763723;
	bh=GJvLW/gqfLJM73MfMfqaOwxiWr3qqT/j+wGcRCsHktM=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=C2uhRmFr5uKr64PBiZQ44mPEB+R1YgAQc8trIwUa5SZdzSt24CpW/cIC4+rUkfvz9
	 38YpjG8HpYxrYTdw7j8uC8YQ4FHKuxmao4Jhddwv/FDDXlvL6dzQaQCP9x1ECu1mNg
	 vW9i4oxCId88KuWtcGpHg4A6ywC0vFQwMTArDVww/WFrHEbrEZcOE/8NgHd93xDLTB
	 vZODprhFr4o6YXrebfrW//AGbKhhsKWipg023iGDrFXFuB1d/xt7Lry/qSETjbBG0J
	 Pw6u9GX4lA8QkZH/HuugKtT7tjnr8YM9YwcNAvlGRKTT3hdyFcCLJjiMSWbLthbPw8
	 fYmCmMhtu3jkg==
Date: Fri, 7 Jul 2023 14:02:01 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Juergen Gross <jgross@suse.com>
cc: Petr Pavlu <petr.pavlu@suse.com>, 
    Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>, 
    "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
    "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, 
    "sstabellini@kernel.org" <sstabellini@kernel.org>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
In-Reply-To: <41893db4-cd66-a9f7-ffe5-d90fffb43657@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307071351530.761183@ubuntu-linux-20-04-desktop>
References: <20230621131214.9398-1-petr.pavlu@suse.com> <20230621131214.9398-3-petr.pavlu@suse.com> <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com> <551a1594-9c8b-d447-6bf3-a4a208d5550f@suse.com> <41893db4-cd66-a9f7-ffe5-d90fffb43657@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 7 Jul 2023, Juergen Gross wrote:
> On 26.06.23 15:17, Petr Pavlu wrote:
> > On 6/21/23 19:58, Oleksandr Tyshchenko wrote:
> > > On 21.06.23 16:12, Petr Pavlu wrote:
> > > > When attempting to run Xen on a QEMU/KVM virtual machine with virtio
> > > > devices (all x86_64), dom0 tries to establish a grant for itself which
> > > > eventually results in a hang during the boot.
> > > > 
> > > > The backtrace looks as follows, the while loop in __send_control_msg()
> > > > makes no progress:
> > > > 
> > > >     #0  virtqueue_get_buf_ctx (_vq=_vq@entry=0xffff8880074a8400,
> > > > len=len@entry=0xffffc90000413c94, ctx=ctx@entry=0x0 <fixed_percpu_data>)
> > > > at ../drivers/virtio/virtio_ring.c:2326
> > > >     #1  0xffffffff817086b7 in virtqueue_get_buf
> > > > (_vq=_vq@entry=0xffff8880074a8400, len=len@entry=0xffffc90000413c94) at
> > > > ../drivers/virtio/virtio_ring.c:2333
> > > >     #2  0xffffffff8175f6b2 in __send_control_msg (portdev=<optimized
> > > > out>, port_id=0xffffffff, event=0x0, value=0x1) at
> > > > ../drivers/char/virtio_console.c:562
> > > >     #3  0xffffffff8175f6ee in __send_control_msg (portdev=<optimized
> > > > out>, port_id=<optimized out>, event=<optimized out>, value=<optimized
> > > > out>) at ../drivers/char/virtio_console.c:569
> > > >     #4  0xffffffff817618b1 in virtcons_probe (vdev=0xffff88800585e800)
> > > > at ../drivers/char/virtio_console.c:2098
> > > >     #5  0xffffffff81707117 in virtio_dev_probe (_d=0xffff88800585e810)
> > > > at ../drivers/virtio/virtio.c:305
> > > >     #6  0xffffffff8198e348 in call_driver_probe (drv=0xffffffff82be40c0
> > > > <virtio_console>, drv=0xffffffff82be40c0 <virtio_console>,
> > > > dev=0xffff88800585e810) at ../drivers/base/dd.c:579
> > > >     #7  really_probe (dev=dev@entry=0xffff88800585e810,
> > > > drv=drv@entry=0xffffffff82be40c0 <virtio_console>) at
> > > > ../drivers/base/dd.c:658
> > > >     #8  0xffffffff8198e58f in __driver_probe_device
> > > > (drv=drv@entry=0xffffffff82be40c0 <virtio_console>,
> > > > dev=dev@entry=0xffff88800585e810) at ../drivers/base/dd.c:800
> > > >     #9  0xffffffff8198e65a in driver_probe_device
> > > > (drv=drv@entry=0xffffffff82be40c0 <virtio_console>,
> > > > dev=dev@entry=0xffff88800585e810) at ../drivers/base/dd.c:830
> > > >     #10 0xffffffff8198e832 in __driver_attach (dev=0xffff88800585e810,
> > > > data=0xffffffff82be40c0 <virtio_console>) at ../drivers/base/dd.c:1216
> > > >     #11 0xffffffff8198bfb2 in bus_for_each_dev (bus=<optimized out>,
> > > > start=start@entry=0x0 <fixed_percpu_data>,
> > > > data=data@entry=0xffffffff82be40c0 <virtio_console>,
> > > >         fn=fn@entry=0xffffffff8198e7b0 <__driver_attach>) at
> > > > ../drivers/base/bus.c:368
> > > >     #12 0xffffffff8198db65 in driver_attach
> > > > (drv=drv@entry=0xffffffff82be40c0 <virtio_console>) at
> > > > ../drivers/base/dd.c:1233
> > > >     #13 0xffffffff8198d207 in bus_add_driver
> > > > (drv=drv@entry=0xffffffff82be40c0 <virtio_console>) at
> > > > ../drivers/base/bus.c:673
> > > >     #14 0xffffffff8198f550 in driver_register
> > > > (drv=drv@entry=0xffffffff82be40c0 <virtio_console>) at
> > > > ../drivers/base/driver.c:246
> > > >     #15 0xffffffff81706b47 in register_virtio_driver
> > > > (driver=driver@entry=0xffffffff82be40c0 <virtio_console>) at
> > > > ../drivers/virtio/virtio.c:357
> > > >     #16 0xffffffff832cd34b in virtio_console_init () at
> > > > ../drivers/char/virtio_console.c:2258
> > > >     #17 0xffffffff8100105c in do_one_initcall (fn=0xffffffff832cd2e0
> > > > <virtio_console_init>) at ../init/main.c:1246
> > > >     #18 0xffffffff83277293 in do_initcall_level
> > > > (command_line=0xffff888003e2f900 "root", level=0x6) at
> > > > ../init/main.c:1319
> > > >     #19 do_initcalls () at ../init/main.c:1335
> > > >     #20 do_basic_setup () at ../init/main.c:1354
> > > >     #21 kernel_init_freeable () at ../init/main.c:1571
> > > >     #22 0xffffffff81f64be1 in kernel_init (unused=<optimized out>) at
> > > > ../init/main.c:1462
> > > >     #23 0xffffffff81001f49 in ret_from_fork () at
> > > > ../arch/x86/entry/entry_64.S:308
> > > >     #24 0x0000000000000000 in ?? ()
> > > > 
> > > > Fix the problem by preventing xen_grant_init_backend_domid() from
> > > > setting dom0 as a backend when running in dom0.
> > > > 
> > > > Fixes: 035e3a4321f7 ("xen/virtio: Optimize the setup of "xen-grant-dma"
> > > > devices")
> > > 
> > > 
> > > I am not 100% sure whether the Fixes tag points to precise commit. If I
> > > am not mistaken, the said commit just moves the code in the context
> > > without changing the logic of CONFIG_XEN_VIRTIO_FORCE_GRANT, this was
> > > introduced before.
> > 
> > I see, the tag should better point to 7228113d1fa0 ("xen/virtio: use
> > dom0 as default backend for CONFIG_XEN_VIRTIO_FORCE_GRANT") which
> > introduced the original logic to use dom0 as backend.
> > 
> > Commit 035e3a4321f7 ("xen/virtio: Optimize the setup of "xen-grant-dma"
> > devices") is relevant in sense that it extended when this logic is
> > active by adding an OR check for xen_pv_domain().
> > 
> > > 
> > > 
> > > > Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
> > > > ---
> > > >    drivers/xen/grant-dma-ops.c | 4 +++-
> > > >    1 file changed, 3 insertions(+), 1 deletion(-)
> > > > 
> > > > diff --git a/drivers/xen/grant-dma-ops.c b/drivers/xen/grant-dma-ops.c
> > > > index 76f6f26265a3..29ed27ac450e 100644
> > > > --- a/drivers/xen/grant-dma-ops.c
> > > > +++ b/drivers/xen/grant-dma-ops.c
> > > > @@ -362,7 +362,9 @@ static int xen_grant_init_backend_domid(struct
> > > > device *dev,
> > > >    	if (np) {
> > > >    		ret = xen_dt_grant_init_backend_domid(dev, np,
> > > > backend_domid);
> > > >    		of_node_put(np);
> > > > -	} else if (IS_ENABLED(CONFIG_XEN_VIRTIO_FORCE_GRANT) ||
> > > > xen_pv_domain()) {
> > > > +	} else if ((IS_ENABLED(CONFIG_XEN_VIRTIO_FORCE_GRANT) ||
> > > > +		    xen_pv_domain()) &&
> > > > +		   !xen_initial_domain()) {
> > > 
> > > The commit lgtm, just one note:
> > > 
> > > 
> > > I would even bail out early in xen_virtio_restricted_mem_acc() instead,
> > > as I assume the same issue could happen on Arm with DT (although there
> > > we don't guess the backend's domid, we read it from DT and quite
> > > unlikely we get Dom0 being in Dom0 with correct DT).
> > > 
> > > Something like:
> > > 
> > > @@ -416,6 +421,10 @@ bool xen_virtio_restricted_mem_acc(struct
> > > virtio_device *dev)
> > >    {
> > >           domid_t backend_domid;
> > > 
> > > +       /* Xen grant DMA ops are not used when running as initial domain
> > > */
> > > +       if (xen_initial_domain())
> > > +               return false;
> > > +
> > >           if (!xen_grant_init_backend_domid(dev->dev.parent,
> > > &backend_domid)) {
> > >                   xen_grant_setup_dma_ops(dev->dev.parent, backend_domid);
> > >                   return true;
> > > (END)
> > > 
> > > 
> > > 
> > > If so, that commit subject would need to be updated accordingly.
> > > 
> > > Let's see what other reviewers will say.
> > 
> > Ok, makes sense.
> 
> I think this is okay for a fix of the current problem.
> 
> Passing through virtio devices to a PV domU is not covered by this fix, but
> this
> should be a rather rare configuration, which doesn't work today either. So the
> suggested patch would fix the current issue without introducing a regression.
> 
> Anything else can be done later.

Why do you say that passing through virtio devices to a PV domU doesn't
work today anyway? Also, as you know many people use Xen outside of
datacenter deployments (laptops, embedded etc.) where drivers domains
and device assignment are very common. You could assign a virtio network
card to a domU and use PV network to share the network with other
guests. Physical virtio devices, especially virtio-net devices, exist. I
could probably repro this problem today in a domU just installing
QubesOS inside QEMU. QubesOS uses network driver domains and if QEMU
provides a virtio-net network card, this would break even with this
patch.


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 21:06:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 21:06:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560610.876654 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHsej-0002ep-Dp; Fri, 07 Jul 2023 21:06:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560610.876654; Fri, 07 Jul 2023 21:06:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHsej-0002ei-B7; Fri, 07 Jul 2023 21:06:21 +0000
Received: by outflank-mailman (input) for mailman id 560610;
 Fri, 07 Jul 2023 21:06:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=3yVI=CZ=gmail.com=christopher.w.clark@srs-se1.protection.inumbo.net>)
 id 1qHseh-0002ec-Gm
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 21:06:19 +0000
Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com
 [2a00:1450:4864:20::534])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1cf8789c-1d0a-11ee-b237-6b7b168915f2;
 Fri, 07 Jul 2023 23:06:17 +0200 (CEST)
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-51d805cb33aso3161190a12.3
 for <xen-devel@lists.xenproject.org>; Fri, 07 Jul 2023 14:06:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1cf8789c-1d0a-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688763976; x=1691355976;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=lgpXDeomX2C4DQsqREcoBJ4MX1DkqRGCmhODLKLIp4Y=;
        b=KN/TP2q4FcSe+75cXZz8Yf76RWO1czq7bAM6KcaRb/f2LT/4Q/39odVJz0X/tw1Xv2
         s1+oQ+NhRsBy+1hCjZNGoh+58WzBZwXtevYnRRfj49OwfE02yNH8TPVkSGtsnr1GO4Ar
         p1bF9qfculsymXr6Cuby8FB7G3ul44u6L3Q+grR6G3o0ohWhZo06LbxXcpx0TVUhaeXp
         /8O8oPDjAHKaRjvUovPhpyaDLsFdp2X1DGWfUWUGicXvvO9cm/v+luBoQrp7oKnT0/vl
         asOA9uTqTdedoEYiHEhFL2t2LdkE3YBuRb+4nCPGSInLeRNm9CN0MIJSsdIByzyEv6e+
         +u7Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688763976; x=1691355976;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=lgpXDeomX2C4DQsqREcoBJ4MX1DkqRGCmhODLKLIp4Y=;
        b=hS+98J9Cnmv2yDQimlVnyQBDvdd3RhlBhlY/XTrtGByY1+pshHXGshiF2Q13JD5fHx
         z8FvCjukMguzqcpLInCXUBTtMf+5RnlTLYMbbhXfbeKx3B+54alcGwO+1/q+SwQgCQlo
         7nYUQrIsQ2tuwddWQ0OqNt7FjywMmma3nqxaG+cHD3Qmyqd5k6nWySkKZM5OJs9Uk5Zl
         ph5CIl50rSC0VQgeaYqbfXAgPZ69oAVkVNYqJvZzT7cYV9+yGxi7FzuDrmMWLAtK8XpP
         hQOmsfla8SXLQgKeWsXCX24HYi00vW33+qD7v47SmZrJql9Lkjnbgo0Fggg9LAMh5f7U
         qFPw==
X-Gm-Message-State: ABy/qLY3lj8d0Bus7PA99NJT5E/DKcu7LnM/ua64Fvwx8YrRr0HF+uKH
	uG6vQoo9qGe2foEcbIVNrw1kguf/3oY9gf8cjV8=
X-Google-Smtp-Source: APBJJlFd54N8wUbO9vk+N6Wz9zQDRvVnhYzzPeXJJtvT2XQUGccf9tY3gcjUYXupb5RsnuBfm/pwTMrjA4PpCJk3PJM=
X-Received: by 2002:a05:6402:890:b0:51d:f37b:1b4e with SMTP id
 e16-20020a056402089000b0051df37b1b4emr4951797edy.19.1688763976024; Fri, 07
 Jul 2023 14:06:16 -0700 (PDT)
MIME-Version: 1.0
References: <8601CDD7-87F7-4FD0-A6E6-BAEAB12E7956@arm.com> <234199F8-DBB1-42B6-9A4C-8800EEF60997@gmail.com>
 <CA+zSX=Y3_g_aq4+sDK7CuZajywVqQ4xOrq7hKZ80eUT3uSxzuQ@mail.gmail.com>
 <alpine.DEB.2.22.394.2307051436120.761183@ubuntu-linux-20-04-desktop>
 <CA+zSX=ashTi590+cVss_3zyLESC8S=zVSMLjTKD00s6xfjZbJA@mail.gmail.com> <alpine.DEB.2.22.394.2307061328540.761183@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2307061328540.761183@ubuntu-linux-20-04-desktop>
From: Christopher Clark <christopher.w.clark@gmail.com>
Date: Fri, 7 Jul 2023 14:06:04 -0700
Message-ID: <CACMJ4GYWoyCQMWX8VtpwChk7hHxL-u0Mo-kKX8Qmr1oKf91Hyg@mail.gmail.com>
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
To: Stefano Stabellini <stefano.stabellini@amd.com>
Cc: George Dunlap <george.dunlap@cloud.com>, P S <pairspace@gmail.com>, 
	Luca Fancellu <luca.fancellu@arm.com>, Stefano Stabellini <sstabellini@kernel.org>, 
	"Daniel P. Smith" <dpsmith@apertussolutions.com>, Andrew Cooper <Andrew.Cooper3@citrix.com>, 
	Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>, 
	George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
	Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, Henry Wang <Henry.Wang@arm.com>, 
	Community Manager <community.manager@xenproject.org>, Doug Goldstein <cardoe@cardoe.com>, 
	Bertrand Marquis <bertrand.marquis@arm.com>, Volodymyr Babchuk <volodymyr_babchuk@epam.com>, 
	Anthony PERARD <anthony.perard@citrix.com>, Rian Quinn <rianquinn@gmail.com>, 
	Ian Jackson <iwj@xenproject.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Scott Davis <scott.davis@starlab.io>, Adam Fraser <adam@starlab.io>, Paul Durrant <paul@xen.org>, 
	rsmith@riversideresearch.org, 
	"m.a.young@durham.ac.uk" <m.a.young@durham.ac.uk>, Elliott Mitchell <ehem+xen@m5p.com>
Content-Type: multipart/alternative; boundary="000000000000e689b605ffec00f6"

--000000000000e689b605ffec00f6
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

+CC members of the Hyperlaunch Working Group + participants on earlier
Hyperlaunch threads

On Thu, Jul 6, 2023 at 2:39=E2=80=AFPM Stefano Stabellini <
stefano.stabellini@amd.com> wrote:

> On Thu, 6 Jul 2023, George Dunlap wrote:
> > On Wed, Jul 5, 2023 at 11:14=E2=80=AFPM Stefano Stabellini <
> stefano.stabellini@amd.com> wrote:
> >       On Wed, 5 Jul 2023, George Dunlap wrote:
> >       > On Mon, Jul 3, 2023 at 9:55=E2=80=AFPM P S <pairspace@gmail.com=
> wrote:
> >       >       > On Jul 3, 2023, at 15:45, Luca Fancellu <
> luca.fancellu@arm.com> wrote:
> >       >       =EF=BB=BF>
> >       >       >> On 3 Jul 2023, at 18:48, Stefano Stabellini <
> sstabellini@kernel.org> wrote:
> >       >       >>
> >       >       >>> On Mon, 3 Jul 2023, Daniel P. Smith wrote:
> >       >       >>> On 7/1/23 11:13, Luca Fancellu wrote:
> >       >       >>>>> On 1 Jul 2023, at 08:53, Andrew Cooper <
> andrew.cooper3@citrix.com> wrote:
> >       >       >>>>>
> >       >       >>>>> On 30/06/2023 10:12 am, Luca Fancellu wrote:
> >       >       >>>>>> The "dom0less" feature was intended to be the
> feature where a domU
> >       >       >>>>>> domain could be launched without the control domai=
n
> (Dom0)
> >       >       >>>>>> intervention, however the name seems to suggest
> that Dom0 cannot
> >       >       >>>>>> be part of the configuration, while instead it's a
> possible use case.
> >       >       >>>>>>
> >       >       >>>>>> To avoid that, rename the "dom0less" configuration
> with the name
> >       >       >>>>>> "hyperlaunch", that is less misleading.
> >       >       >>>>>>
> >       >       >>>>>> Signed-off-by: Luca Fancellu <luca.fancellu@arm.co=
m
> >
> >       >       >>>>>> ---
> >       >       >>>>>> This is an RFC to get the feeling of the community
> about the name
> >       >       >>>>>> change, for now it's everything in one patch just
> to see how it
> >       >       >>>>>> will look like, if there is interest on proceeding
> into it, I can
> >       >       >>>>>> split in more commit.
> >       >       >>>>>
> >       >       >>>>> Have you discussed this with Dan and Chris at all?
> You haven't even
> >       >       >>>>> CC'd them.
> >       >       >>>>
> >       >       >>>> No, this rename idea started from a chat during the
> summit, anyway Julien
> >       >       >>>> promptly add them to the CC, because I forgot.
> >       >       >>>
> >       >       >>> No worries and thank you for considering and taking
> the time to do this RFC.
> >       >       >>> It is greatly appreciated that there is a strong
> willingness to have dom0less
> >       >       >>> and hyperlaunch merged.
> >       >       >>>
> >       >       >>>>>
> >       >       >>>>> While there is a lot of end-goal in common between
> the dom0less and
> >       >       >>>>> hyperlaunch, and that the name dom0less is deeply
> misleading,
> >       >       >>>>> hyperlaunch is specifically not this.
> >       >       >>>>
> >       >       >>>> Yes Hyperlaunch is more than this, however as I said=
,
> with this RFC I would
> >       >       >>>> like
> >       >       >>>> to ear opinions, @Daniel @Christopher could it be a
> proper name for the
> >       >       >>>> dom0less
> >       >       >>>> feature?
> >       >       >>>
> >       >       >>> As Andy has alluded, hyperlaunch is meant to provide =
a
> flexible means to
> >       >       >>> handle domain construction at boot to meet a wide
> range of possible use cases.
> >       >       >>> One of those use cases is dom0less, so yes, ultimatel=
y
> what dom0less does
> >       >       >>> today will be achievable under hyperlaunch. Our
> intended approach to align the
> >       >       >>> two implementations is one that is meant to be
> minimally disruptive, since
> >       >       >>> dom0less is considered a supported (SUPPORT.md)
> capability. As mentioned, we
> >       >       >>> are greatly appreciative to the openness to adopt the
> name,
> >       >       >>
> >       >       >> Thanks Daniel!
> >       >       >>
> >       >       >>
> >       >       >>> but a big concern
> >       >       >>> I personally have is the confusion it could cause a
> general user. A blanket
> >       >       >>> rename would end up with two documents in the docs
> tree that provide two
> >       >       >>> different explanations of hyperlaunch and two
> different device tree
> >       >       >>> definitions. So I think a more measured approach
> should be considered here.
> >       >       >>>
> >       >       >>>> If this patch makes things more difficult for the
> Hyperlunch serie, I=E2=80=99m ok
> >       >       >>>> to drop it,
> >       >       >>>> my only aim was just to find a less misleading name
> for the feature.
> >       >       >>>
> >       >       >>> What I would like to suggest as a good first step
> would be an update to the
> >       >       >>> dom0less document. Provide a note at the beginning
> that points to the
> >       >       >>> hyperlaunch design doc as a more general approach tha=
t
> will eventually subsume
> >       >       >>> dom0less. This would provide a gentler transition for
> exist users of dom0less.
> >       >       >>>
> >       >       >>> If it is not too much, I would also ask, please have =
a
> look at the design for
> >       >       >>> boot modules in the series Christopher just posted.
> The design pulls from the
> >       >       >>> work done by dom0less and expanded upon it. I major
> step into merging the two
> >       >       >>> capabilities will be to have a common set of
> structures. Once those are in
> >       >       >>> place, we can move to a common device tree
> representation, and at that point
> >       >       >>> we would be fairly close, if not at the point of a
> formal merger of between
> >       >       >>> the two.
> >       >       >>
> >       >       >> At the moment we have a concrete problem with
> explaining dom0less and
> >       >       >> hyperlaunch to potential new users. Using two differen=
t
> names for a
> >       >       >> similar feature on arm and x86 causes confusion. It is
> hurting Xen as a
> >       >       >> solution. Personally I already had to switch to use th=
e
> word
> >       >       >> "hyperlaunch" for everything in my users-facing
> presentations.
> >       >       >>
> >       >       >> At the summit, we discussed that it would be a good
> idea to use a single
> >       >       >> name to refer to both features on arm and x86. Given
> that "dom0less"
> >       >       >> causes additional issues because it makes people think
> that there is no
> >       >       >> Dom0, the suggestion was to use "hyperlaunch" to refer
> to both features.
> >       >       >>
> >       >       >> We don't need to 100% align the two implementations an=
d
> data structures.
> >       >       >> This is not for engineers that are going to look at th=
e
> specifications
> >       >       >> and improve them. This is for users/customers of Xen
> that are trying to
> >       >       >> understand what the hypervisor enables them to do. We
> need to be able to
> >       >       >> show users architecture slides with the same name and
> explanation on
> >       >       >> both ARM and x86.
> >       >       >>
> >       >       >> I am sure that Daniel and Christopher remember, but fo=
r
> the others on
> >       >       >> this email thread, the name "hyperlaunch" was born
> exactly to be that:
> >       >       >> the one name to cover both features on ARM and x86 eve=
n
> if they have a
> >       >       >> different implementation. Appended an old email for
> reference.
> >       >       >>
> >       >       >> Also I agree with Daniel that we need to be careful
> about the two docs
> >       >       >> under docs/. I think he is right we need to add a
> paragraph explaining
> >       >       >> the history and a pointer to the other document.
> Something like:
> >       >       >>
> >       >       >> "Dom0less is the name that was used when initially
> introducing the
> >       >       >> feature on ARM. Then, the "dom0less" name was retired
> in favor of
> >       >       >> "hyperlaunch" to avoid confusion (a Dom0 might still b=
e
> present) and to
> >       >       >> align with x86 (where a similar feature was called
> hyperlaunch from the
> >       >       >> start)."
> >       >       >
> >       >       > I=E2=80=99m fully ok to add a section like this pointin=
g to the
> Hyperlaunch design.
> >       >
> >       >       _If_ this text is added, please include links/references
> to the Hyperlaunch wiki page and Hyperlaunch design docs.
> >       >
> >       >       > @Daniel and @Christopher would it be ok for you or the
> changes in the serie
> >       >       > are going to be problematic for your future work? In th=
e
> end it=E2=80=99s just a mechanical
> >       >       > rename, so I guess we just need to agree on naming
> conventions.
> >       >
> >       >       Please see the history of trademark litigation about the
> use of symbolic names to reference similar-but-different
> >       artifacts.
> >       >       It is much easier to use the same name to refer to
> entirely different objects. Historically, confusion arises when a
> >       name is
> >       >       used in similar contexts.
> >       >
> >       >       There is also versioning.  Could we refer to dom0less as
> "Hyperlaunch Version -1"?
> >       >
> >       >       How about renaming dom0less to "Hyperlaunch Lite"?
> >       >
> >       >
> >       > Perhaps it would be helpful if you could explain more clearly
> your concerns.  I take it that you want a name which can be
> >       used specifically
> >       > to indicate the full "domB measured boot" functionality that wa=
s
> Daniel and Christopher's original goal, and that you're
> >       afraid that using
> >       > plain "Hyperlaunch" for only the "start VMs from Xen on boot"
> functionality will dilute that?
> >       >
> >       > The "start VMs from Xen on boot" functionality is the *only*
> thing that a big chunk of the users of this functionality want;
> >       referring to
> >       > it as "Hyperlaunch Lite" or "Hyperlaunch -1" will undermine the
> value of the functionality.
> >       >
> >       > What if we use "Measured Hyperlaunch", or "Hyperlaunch Measured
> Boot" to refer to the full measured boot functionality?
> >
> >       I think this is the best way.
> >
> >
> >       > Or, "Hyperlaunch DT" for "Booting VMs from Xen using Device
> Tree" (without the involvement of a domB), "Hyperlaunch Boot
> >       Domain /
> >       > Hyperlaunch domB" for a more general "domB" functionality, and
> "Hyperlaunch Measured Boot" for the full functionality
> >       (assuming there's
> >       > more to this than simply having a domB involved)?
> >
> >
> >       We need an overarching name to cover the feature "start VMs from
> Xen on
> >       boot" on both ARM and x86. From my understanding and from the
> original
> >       emails on the subject, the name "hyperlaunch" was it.
> >
> >
> > Sure; but think "guitar" vs "acoustic guitar" vs "electric guitar".
> "Electric guitar" is new, "guitar" covers them both, but you sometimes
> > need a way to specify "acoustic".  Right now target configurations we'r=
e
> talking about include:
> >
> > 1. Booting all your domains directly from Xen using DT configurations
> > 2. Booting a domB, which then executes some more complicated
> programmatic configuration to launch VMs before disappearing
> > 3. Doing full measured boot on the whole system using a domB.
> >
> > If "Hyperlaunch" means 1-3, we not only need a way to specify that
> you're talking about 3, but *also* a way to specify that you're talking
> > about 1.  In the vast majority of cases for the foreseeable future
> are going to be 1.  Additionally, we want to make sure that
> > "Hyperlaunch" *actually* turns out to mean 1-3, and not just 1.
> >
> > The thing I like about "Hyperlaunch DT" is that to me it sounds pretty
> cool but also is very descriptive: I haven't talked to people
> > building these systems, but it seems like saying, "The hypervisor
> launches VMs based on a Device Tree passed to it at boot" will be
> > immediately understood, and stick in people's minds.
> >
> > So maybe informally, or in "short usage" use "Hyperlaunch", but in
> documentation or reference systems, when talking specifically about #1,
> > try to use "Hyperlaunch DT", just to reinforce the idea that there's
> more to Hyperlaunch that's coming down the road?
>
> "Hyperlaunch DT" would refer to both the x86 and ARM implementations
> because they are both based on DT.
>
> I think it is better than "Hyperlaunch Lite" but I am not a fan of
> either of these two names because "DT" and "Lite" get easily lost in
> presentations and discussions. For the next few years many will talk
> about HyperLaunch just to refer to what is Dom0less today. So if the
> goal when we say "HyperLaunch" is to bring Measure Boot or XSM to
> people's minds, I don't think this will work well.
>
> If we want to keep "Hyperlaunch" to mean 1-3 above, highlighting Measure
> Boot or XSM, then I think we should consider using "Dom0less" for 1.
> Yes, it is misleding, but at least it is unique, and a google search for
> "dom0less" leads the user to the right results.
>
> If we do that, we should rename "Hyperlaunch" with "Dom0less" in
> docs/designs/launch/hyperlaunch.rst. That's because "Hyperlaunch" is
> defined as "the ability of a hypervisor to construct and start one or
> more virtual machines at system launch in a specific way", which falls
> under Dom0less in this discussion.
>
> In my opinion, it is better to have specific names for specific
> features. So I would use "HyperLaunch" to mean "the ability of a
> hypervisor to construct and start one or more virtual machines at system
> launch in a specific way" as it is defined today.
>
> When we add Measure Boot or XSM or other security/safety features, I
> would call them out specifically. For instance, "HyperLaunch with XSM".
> It is more descriptive and highlights each feature.
>
> Note that at AMD we'll need HyperLaunch without an all-powerful Dom0,
> probably with XSM. So I am not writing this because I don't think the
> other features 2-3 are not important. They definitely are important.



Thanks to all the participants in this thread for the interest in
Hyperlaunch and
the support for enabling common advanced boot functionality for Xen across
architectures.

I'm aiming to provide here a hopefully-fairly-objective overview of the
issues
being raised so that we can ensure that these are covered, and then I will
also
give my views afterwards.

------------------------------------------------------------
=3D Naming and communication

- Ensuring expectations are set correctly for the Hyperlaunch name
    - communicating the value of it, differentiation for Xen
    - avoiding sub-branding it for feature subsets, use cases, technologies

- Retiring the term 'dom0less'

- How to describe the "starting multiple VMs at host boot" functionality

    - How to describe further Hyperlaunch functionality beyond this
        - eg. isolation properties and relevance to critical systems
        - eg. running without a classic dom0

    - How Hyperlaunch relates to other boot functionalities and
technologies,
      including:
        - architecture-specific aspects and architecture-neutral aspects
        - Device Tree
        - boot domain
        - control domain, hardware domain, dom0
        - domain builder
        - system measurement
        - XSM
        - DRTM
        - etc.


=3D Migration

- Providing a forward path for existing users of dom0less functionality
across the technical changes for Hyperlaunch cross-architecture
implementation
    - document compatibility
    - support a "dom0less mode" with existing Device Tree structure
    - documentation updates to be paired with progress on code
implementation


=3D Community resourcing

- Supporting code review and merge of Hyperlaunch changes into Xen
    - transitioning existing Arm logic into common, including FDT

- Provision of accurate, consistent documentation materials to support
effective communication to existing and prospective users, developers and
other
stakeholders
     - Ensuring that the document structure supports ongoing maintenance:
        - Multiple use cases, structure docs accordingly: eg.
            - use case: static partitioning, critical + non-critical VMs
            - use case: measured launch with a boot domain
            - use case: fast VM start for embedded systems
        - Architecture of Hyperlaunch, relevance to other hypervisors
            - nested systems

- Design, review and agreement for common cross-architecture and
  arch-extensible interfaces, including:
    - common boot data structures
    - Device Tree structure
    - hypfs entries
    - introspection to determine hyperlaunched system status

- Development of test cases

- CI of Hyperlaunch interfaces, to ensure that it stays working

------------------------------------------------------------

Views arrived at in discussion with Rich and Daniel, and after reading the
thread contributions, follow this point.

"Hyperlaunch" is to be the common name across architectures for a flexible,
configurable boot system for coordinating the launch of multiple VMs by the
hypervisor, with a common implementation, pooling resources and development
risk across the Xen community. The interfaces are core to it.

>From the Hyperlaunch design document (reviewed + committed to the tree):

"The design enables seamless transition for existing systems that require a
dom0, and provides a new general capability to build and launch alternative
configurations of virtual machines, including support for static
partitioning and accelerated start of VMs during host boot, while adhering
to the principles of least privilege. It incorporates the existing dom0less
functionality, extended to fold in the new developments from the
Hyperlaunch project, with support for both x86 and Arm platform
architectures, building upon and replacing the earlier 'late hardware
domain' feature for disaggregation of dom0.

Hyperlaunch is designed to be flexible and reusable across multiple use
cases, and our aim is to ensure that it is capable, widely exercised,
comprehensively tested, and well understood by the Xen community."

https://xenbits.xen.org/docs/4.17-testing/designs/launch/hyperlaunch.html

ie.  Hyperlaunch was created to move away from point solutions that
hard-code
specific launch configurations, isolation properties and threat models. It
isn't just about starting domains -- it is about enabling the construction
of
complex use cases runtimes for Xen. It is the result of iterative design
starting with the disaggregation for the late hardware domain, through
dom0less development and then with the comprehensive hyperlaunch design and
implementation that builds upon them both.

The current interest and investment in Hyperlaunch is driven by its
relevance
to Safety Critical systems due to the isolation properties and improvement
in the ability to certify the software -- this is closely related to but
slightly different from starting multiple VMs at host boot.

To encourage commonality and allow for future development, we should not
use architecture-specific or vendor-specific name variations, and also avoi=
d
technology-specific name variations (eg. Device Tree or "DT").

Instead, the use case configurations should themselves be describable.

Thanks again,

Christopher

--000000000000e689b605ffec00f6
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>+CC members of the Hyperlaunch Working Group=C2=A0+ p=
articipants on earlier Hyperlaunch threads<br></div><br><div class=3D"gmail=
_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jul 6, 2023 at 2:39=
=E2=80=AFPM Stefano Stabellini &lt;<a href=3D"mailto:stefano.stabellini@amd=
.com">stefano.stabellini@amd.com</a>&gt; wrote:<br></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex">On Thu, 6 Jul 2023, George Dunlap wrote:<b=
r>
&gt; On Wed, Jul 5, 2023 at 11:14=E2=80=AFPM Stefano Stabellini &lt;<a href=
=3D"mailto:stefano.stabellini@amd.com" target=3D"_blank">stefano.stabellini=
@amd.com</a>&gt; wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0On Wed, 5 Jul 2023, George Dunlap wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; On Mon, Jul 3, 2023 at 9:55=E2=80=AFPM =
P S &lt;<a href=3D"mailto:pairspace@gmail.com" target=3D"_blank">pairspace@=
gmail.com</a>&gt; wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; On Jul 3=
, 2023, at 15:45, Luca Fancellu &lt;<a href=3D"mailto:luca.fancellu@arm.com=
" target=3D"_blank">luca.fancellu@arm.com</a>&gt; wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0=EF=BB=BF&gt;=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; On 3=
 Jul 2023, at 18:48, Stefano Stabellini &lt;<a href=3D"mailto:sstabellini@k=
ernel.org" target=3D"_blank">sstabellini@kernel.org</a>&gt; wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
On Mon, 3 Jul 2023, Daniel P. Smith wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
On 7/1/23 11:13, Luca Fancellu wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt; On 1 Jul 2023, at 08:53, Andrew Cooper &lt;<a href=3D"mailto:andrew=
.cooper3@citrix.com" target=3D"_blank">andrew.cooper3@citrix.com</a>&gt; wr=
ote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt; On 30/06/2023 10:12 am, Luca Fancellu wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; The &quot;dom0less&quot; feature was intended to be the feature=
 where a domU<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; domain could be launched without the control domain (Dom0)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; intervention, however the name seems to suggest that Dom0 canno=
t<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; be part of the configuration, while instead it&#39;s a possible=
 use case.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; To avoid that, rename the &quot;dom0less&quot; configuration wi=
th the name<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; &quot;hyperlaunch&quot;, that is less misleading.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; Signed-off-by: Luca Fancellu &lt;<a href=3D"mailto:luca.fancell=
u@arm.com" target=3D"_blank">luca.fancellu@arm.com</a>&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; ---<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; This is an RFC to get the feeling of the community about the na=
me<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; change, for now it&#39;s everything in one patch just to see ho=
w it<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; will look like, if there is interest on proceeding into it, I c=
an<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; split in more commit.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt; Have you discussed this with Dan and Chris at all?=C2=A0 You haven&=
#39;t even<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt; CC&#39;d them.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; No, this rename idea started from a chat during the summit, anyway Juli=
en<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; promptly add them to the CC, because I forgot.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
No worries and thank you for considering and taking the time to do this RFC=
.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
It is greatly appreciated that there is a strong willingness to have dom0le=
ss<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
and hyperlaunch merged.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt; While there is a lot of end-goal in common between the dom0less and=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt; hyperlaunch, and that the name dom0less is deeply misleading,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt; hyperlaunch is specifically not this.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; Yes Hyperlaunch is more than this, however as I said, with this RFC I w=
ould<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; like<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; to ear opinions, @Daniel @Christopher could it be a proper name for the=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; dom0less<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; feature?<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
As Andy has alluded, hyperlaunch is meant to provide a flexible means to<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
handle domain construction at boot to meet a wide range of possible use cas=
es.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
One of those use cases is dom0less, so yes, ultimately what dom0less does<b=
r>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
today will be achievable under hyperlaunch. Our intended approach to align =
the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
two implementations is one that is meant to be minimally disruptive, since<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
dom0less is considered a supported (SUPPORT.md) capability. As mentioned, w=
e<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
are greatly appreciative to the openness to adopt the name,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; Than=
ks Daniel!<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
but a big concern<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
I personally have is the confusion it could cause a general user. A blanket=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
rename would end up with two documents in the docs tree that provide two<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
different explanations of hyperlaunch and two different device tree<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
definitions. So I think a more measured approach should be considered here.=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; If this patch makes things more difficult for the Hyperlunch serie, I=
=E2=80=99m ok<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; to drop it,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; my only aim was just to find a less misleading name for the feature.<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
What I would like to suggest as a good first step would be an update to the=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
dom0less document. Provide a note at the beginning that points to the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
hyperlaunch design doc as a more general approach that will eventually subs=
ume<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
dom0less. This would provide a gentler transition for exist users of dom0le=
ss.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
If it is not too much, I would also ask, please have a look at the design f=
or<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
boot modules in the series Christopher just posted. The design pulls from t=
he<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
work done by dom0less and expanded upon it. I major step into merging the t=
wo<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
capabilities will be to have a common set of structures. Once those are in<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
place, we can move to a common device tree representation, and at that poin=
t<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
we would be fairly close, if not at the point of a formal merger of between=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
the two.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; At t=
he moment we have a concrete problem with explaining dom0less and<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; hype=
rlaunch to potential new users. Using two different names for a<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; simi=
lar feature on arm and x86 causes confusion. It is hurting Xen as a<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; solu=
tion. Personally I already had to switch to use the word<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; &quo=
t;hyperlaunch&quot; for everything in my users-facing presentations.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; At t=
he summit, we discussed that it would be a good idea to use a single<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; name=
 to refer to both features on arm and x86. Given that &quot;dom0less&quot;<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; caus=
es additional issues because it makes people think that there is no<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; Dom0=
, the suggestion was to use &quot;hyperlaunch&quot; to refer to both featur=
es.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; We d=
on&#39;t need to 100% align the two implementations and data structures.<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; This=
 is not for engineers that are going to look at the specifications<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; and =
improve them. This is for users/customers of Xen that are trying to<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; unde=
rstand what the hypervisor enables them to do. We need to be able to<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; show=
 users architecture slides with the same name and explanation on<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; both=
 ARM and x86.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; I am=
 sure that Daniel and Christopher remember, but for the others on<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; this=
 email thread, the name &quot;hyperlaunch&quot; was born exactly to be that=
:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; the =
one name to cover both features on ARM and x86 even if they have a<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; diff=
erent implementation. Appended an old email for reference.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; Also=
 I agree with Daniel that we need to be careful about the two docs<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; unde=
r docs/. I think he is right we need to add a paragraph explaining<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; the =
history and a pointer to the other document. Something like:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; &quo=
t;Dom0less is the name that was used when initially introducing the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; feat=
ure on ARM. Then, the &quot;dom0less&quot; name was retired in favor of<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; &quo=
t;hyperlaunch&quot; to avoid confusion (a Dom0 might still be present) and =
to<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; alig=
n with x86 (where a similar feature was called hyperlaunch from the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; star=
t).&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; I=E2=80=
=99m fully ok to add a section like this pointing to the Hyperlaunch design=
.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0_If_ this tex=
t is added, please include links/references to the Hyperlaunch wiki page an=
d Hyperlaunch design docs.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; @Daniel =
and @Christopher would it be ok for you or the changes in the serie<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; are goin=
g to be problematic for your future work? In the end it=E2=80=99s just a me=
chanical<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; rename, =
so I guess we just need to agree on naming conventions.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Please see th=
e history of trademark litigation about the use of symbolic names to refere=
nce similar-but-different<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0artifacts.=C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0It is much ea=
sier to use the same name to refer to entirely different objects. Historica=
lly, confusion arises when a<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0name is<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0used in simil=
ar contexts.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0There is also=
 versioning.=C2=A0 Could we refer to dom0less as &quot;Hyperlaunch Version =
-1&quot;?<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0How about ren=
aming dom0less to &quot;Hyperlaunch Lite&quot;?<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; Perhaps it would be helpful if you coul=
d explain more clearly your concerns.=C2=A0 I take it that you want a name =
which can be<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0used specifically<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; to indicate the full &quot;domB measure=
d boot&quot; functionality that was Daniel and Christopher&#39;s original g=
oal, and that you&#39;re<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0afraid that using<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; plain &quot;Hyperlaunch&quot; for only =
the &quot;start VMs from Xen on boot&quot; functionality will dilute that?<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; The &quot;start VMs from Xen on boot&qu=
ot; functionality is the *only* thing that a big chunk of the users of this=
 functionality want;=C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0referring to<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; it as &quot;Hyperlaunch Lite&quot; or &=
quot;Hyperlaunch -1&quot; will undermine the value of the functionality.<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; What if we use &quot;Measured Hyperlaun=
ch&quot;, or &quot;Hyperlaunch Measured Boot&quot; to refer to the full mea=
sured boot functionality?<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0I think this is the best way.<br>
&gt; <br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; Or, &quot;Hyperlaunch DT&quot; for &quo=
t;Booting VMs from Xen using Device Tree&quot; (without the involvement of =
a domB), &quot;Hyperlaunch Boot<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Domain /<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; Hyperlaunch domB&quot; for a more gener=
al &quot;domB&quot; functionality, and &quot;Hyperlaunch Measured Boot&quot=
; for the full functionality<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0(assuming there&#39;s<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; more to this than simply having a domB =
involved)?<br>
&gt; <br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0We need an overarching name to cover the fea=
ture &quot;start VMs from Xen on<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0boot&quot; on both ARM and x86. From my unde=
rstanding and from the original<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0emails on the subject, the name &quot;hyperl=
aunch&quot; was it.<br>
&gt; <br>
&gt; <br>
&gt; Sure; but think &quot;guitar&quot; vs &quot;acoustic guitar&quot; vs &=
quot;electric guitar&quot;.=C2=A0 &quot;Electric guitar&quot; is new, &quot=
;guitar&quot; covers them both, but you sometimes<br>
&gt; need a way to specify &quot;acoustic&quot;.=C2=A0 Right now target con=
figurations we&#39;re talking about include:<br>
&gt; <br>
&gt; 1. Booting all your domains directly from Xen using DT configurations<=
br>
&gt; 2. Booting a domB, which then executes some more complicated programma=
tic configuration to launch VMs before disappearing<br>
&gt; 3. Doing full measured boot on the whole system using a domB.<br>
&gt; <br>
&gt; If &quot;Hyperlaunch&quot; means 1-3, we not only need a way to specif=
y that you&#39;re talking about 3, but *also* a way to specify that you&#39=
;re talking<br>
&gt; about 1.=C2=A0 In the vast majority of cases for the foreseeable futur=
e are=C2=A0going to be 1.=C2=A0 Additionally, we want to make sure that<br>
&gt; &quot;Hyperlaunch&quot; *actually* turns out to mean 1-3, and not just=
 1.<br>
&gt; <br>
&gt; The thing I like about &quot;Hyperlaunch DT&quot; is that to me it sou=
nds pretty cool but also is very descriptive: I haven&#39;t talked to peopl=
e<br>
&gt; building these systems, but it seems like saying, &quot;The hypervisor=
 launches VMs based on a Device Tree passed to it at boot&quot; will be<br>
&gt; immediately understood, and stick in people&#39;s minds.<br>
&gt; <br>
&gt; So maybe informally, or in &quot;short usage&quot; use &quot;Hyperlaun=
ch&quot;, but in documentation or reference systems, when talking specifica=
lly about #1,<br>
&gt; try to use &quot;Hyperlaunch DT&quot;, just to reinforce the idea that=
 there&#39;s more to Hyperlaunch that&#39;s coming down the road?<br>
<br>
&quot;Hyperlaunch DT&quot; would refer to both the x86 and ARM implementati=
ons<br>
because they are both based on DT.<br>
<br>
I think it is better than &quot;Hyperlaunch Lite&quot; but I am not a fan o=
f<br>
either of these two names because &quot;DT&quot; and &quot;Lite&quot; get e=
asily lost in<br>
presentations and discussions. For the next few years many will talk<br>
about HyperLaunch just to refer to what is Dom0less today. So if the<br>
goal when we say &quot;HyperLaunch&quot; is to bring Measure Boot or XSM to=
<br>
people&#39;s minds, I don&#39;t think this will work well.<br>
<br>
If we want to keep &quot;Hyperlaunch&quot; to mean 1-3 above, highlighting =
Measure<br>
Boot or XSM, then I think we should consider using &quot;Dom0less&quot; for=
 1.<br>
Yes, it is misleding, but at least it is unique, and a google search for<br=
>
&quot;dom0less&quot; leads the user to the right results.<br>
<br>
If we do that, we should rename &quot;Hyperlaunch&quot; with &quot;Dom0less=
&quot; in<br>
docs/designs/launch/hyperlaunch.rst. That&#39;s because &quot;Hyperlaunch&q=
uot; is<br>
defined as &quot;the ability of a hypervisor to construct and start one or<=
br>
more virtual machines at system launch in a specific way&quot;, which falls=
<br>
under Dom0less in this discussion.<br>
<br>
In my opinion, it is better to have specific names for specific<br>
features. So I would use &quot;HyperLaunch&quot; to mean &quot;the ability =
of a<br>
hypervisor to construct and start one or more virtual machines at system<br=
>
launch in a specific way&quot; as it is defined today.<br>
<br>
When we add Measure Boot or XSM or other security/safety features, I<br>
would call them out specifically. For instance, &quot;HyperLaunch with XSM&=
quot;.<br>
It is more descriptive and highlights each feature.<br>
<br>
Note that at AMD we&#39;ll need HyperLaunch without an all-powerful Dom0,<b=
r>
probably with XSM. So I am not writing this because I don&#39;t think the<b=
r>
other features 2-3 are not important. They definitely are important.</block=
quote><div><br></div><div><br>Thanks to all the participants in this thread=
 for the interest in Hyperlaunch and<br>the support for enabling common adv=
anced boot functionality for Xen across<br>architectures.<br><br>I&#39;m ai=
ming to provide here a hopefully-fairly-objective overview of the issues<br=
>being raised so that we can ensure that these are covered, and then I will=
 also<br>give my views afterwards.<br><br>---------------------------------=
---------------------------<br>=3D Naming and communication<br><br>- Ensuri=
ng expectations are set correctly for the Hyperlaunch name<br>=C2=A0 =C2=A0=
 - communicating the value of it, differentiation for Xen<br>=C2=A0 =C2=A0 =
- avoiding sub-branding it for feature subsets, use cases, technologies<br>=
<br>- Retiring the term &#39;dom0less&#39;<br><br>- How to describe the &qu=
ot;starting multiple VMs at host boot&quot; functionality<br><br>=C2=A0 =C2=
=A0 - How to describe further Hyperlaunch functionality beyond this<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 - eg. isolation properties and relevance to critic=
al systems<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 - eg. running without a classic d=
om0<br><br>=C2=A0 =C2=A0 - How Hyperlaunch relates to other boot functional=
ities and technologies,<br>=C2=A0 =C2=A0 =C2=A0 including:<br>=C2=A0 =C2=A0=
 =C2=A0 =C2=A0 - architecture-specific aspects and architecture-neutral asp=
ects<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 - Device Tree<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 - boot domain<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 - control domain, hardw=
are domain, dom0<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 - domain builder<br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 - system measurement<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 - =
XSM<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 - DRTM<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 - =
etc.<br><br><br>=3D Migration<br><br>- Providing a forward path for existin=
g users of dom0less functionality<br>across the technical changes for Hyper=
launch cross-architecture implementation<br>=C2=A0 =C2=A0 - document compat=
ibility<br>=C2=A0 =C2=A0 - support a &quot;dom0less mode&quot; with existin=
g Device Tree structure<br>=C2=A0 =C2=A0 - documentation updates to be pair=
ed with progress on code implementation<br><br><br>=3D Community resourcing=
<br><br>- Supporting code review and merge of Hyperlaunch changes into Xen<=
br>=C2=A0 =C2=A0 - transitioning existing Arm logic into common, including =
FDT<br><br>- Provision of accurate, consistent documentation materials to s=
upport<br>effective communication to existing and prospective users, develo=
pers and other<br>stakeholders<br>=C2=A0 =C2=A0 =C2=A0- Ensuring that the d=
ocument structure supports ongoing maintenance:<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 - Multiple use cases, structure docs accordingly: eg.<br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 - use case: static partitioning, critical + non=
-critical VMs<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 - use case: meas=
ured launch with a boot domain<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 - use case: fast VM start for embedded systems<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 - Architecture of Hyperlaunch, relevance to other hypervisors<br>=C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 - nested systems<br><br>- Design, revie=
w and agreement for common cross-architecture and<br>=C2=A0 arch-extensible=
 interfaces, including:<br>=C2=A0 =C2=A0 - common boot data structures<br>=
=C2=A0 =C2=A0 - Device Tree structure<br>=C2=A0 =C2=A0 - hypfs entries<br>=
=C2=A0 =C2=A0 - introspection to determine hyperlaunched system status<br><=
br>- Development of test cases<br><br>- CI of Hyperlaunch interfaces, to en=
sure that it stays working<br>=C2=A0 <br>----------------------------------=
--------------------------<br><br>Views arrived at in discussion with Rich =
and Daniel, and after reading the<br>thread contributions, follow this poin=
t.<br><br>&quot;Hyperlaunch&quot; is to be the common name across architect=
ures for a flexible,<br>configurable boot system for coordinating the launc=
h of multiple VMs by the<br>hypervisor, with a common implementation, pooli=
ng resources and development<br>risk across the Xen community. The interfac=
es are core to it.<br><br>From the Hyperlaunch design document (reviewed + =
committed to the tree):<br><br>&quot;The design enables seamless transition=
 for existing systems that require a dom0, and provides a new general capab=
ility to build and launch alternative configurations of virtual machines, i=
ncluding support for static partitioning and accelerated start of VMs durin=
g host boot, while adhering to the principles of least privilege. It incorp=
orates the existing dom0less functionality, extended to fold in the new dev=
elopments from the Hyperlaunch project, with support for both x86 and Arm p=
latform architectures, building upon and replacing the earlier &#39;late ha=
rdware domain&#39; feature for disaggregation of dom0.<br><br>Hyperlaunch i=
s designed to be flexible and reusable across multiple use cases, and our a=
im is to ensure that it is capable, widely exercised, comprehensively teste=
d, and well understood by the Xen community.&quot;<br><br><a href=3D"https:=
//xenbits.xen.org/docs/4.17-testing/designs/launch/hyperlaunch.html">https:=
//xenbits.xen.org/docs/4.17-testing/designs/launch/hyperlaunch.html</a><br>=
<br>ie.=C2=A0 Hyperlaunch was created to move away from point solutions tha=
t hard-code<br>specific launch configurations, isolation properties and thr=
eat models. It<br>isn&#39;t just about starting domains -- it is about enab=
ling the construction of<br>complex use cases runtimes for Xen. It is the r=
esult of iterative design<br>starting with the disaggregation for the late =
hardware domain, through<br>dom0less development and then with the comprehe=
nsive hyperlaunch design and<br>implementation that builds upon them both.<=
br><br>The current interest and investment in Hyperlaunch is driven by its =
relevance<br>to Safety Critical systems due to the isolation properties and=
 improvement<br>in the ability to certify the software -- this is closely r=
elated to but<br>slightly different from starting multiple VMs at host boot=
.<br><br>To encourage commonality and allow for future development, we shou=
ld not<br>use architecture-specific or vendor-specific name variations, and=
 also avoid<br>technology-specific name variations (eg. Device Tree or &quo=
t;DT&quot;).<br><br>Instead, the use case configurations should themselves =
be describable.<br><br>Thanks again,<br><br>Christopher<br></div><div>=C2=
=A0</div></div></div>

--000000000000e689b605ffec00f6--


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 21:11:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 21:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560616.876663 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHsj6-000491-Vr; Fri, 07 Jul 2023 21:10:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560616.876663; Fri, 07 Jul 2023 21:10:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHsj6-00048u-TG; Fri, 07 Jul 2023 21:10:52 +0000
Received: by outflank-mailman (input) for mailman id 560616;
 Fri, 07 Jul 2023 21:10:51 +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
 <SRS0=RURV=CZ=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHsj5-00048o-St
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 21:10:51 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bef8250b-1d0a-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 23:10:49 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 44BDE61A3C;
 Fri,  7 Jul 2023 21:10:48 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 716FEC433C8;
 Fri,  7 Jul 2023 21:10:46 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bef8250b-1d0a-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688764247;
	bh=esMBw5EmTwtKXn2xuMq+vmasP3tTn/e8UFfxp4juhRs=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=Sl8r30lt2kkFePYvnaXzXFjA9NMLVtQ+G7cTS/OIljXZIpGy+HOAn0oZeT3UXpDuV
	 thaN/RTHBBxMl0/++s2G5O1sHzz4LPePYRcO+HL9a4OejjlrRRPvmwKpXKrgevOfPd
	 HjAkIVURnZ4XUogqfUHNVknlVySXTQOAmWjhQ02t+ImwWvxtFIfI836uVfdIywTiX9
	 FlZd1Vm3a8X1eqAdouTocD6KAE85K8qwxDjz3IgWP17sCMtrNOoiLDlIOivWf6czxo
	 gpq1hKdQDvr6LO9FVMj/uRSRFtKA41Vp1jEBTuB1QqPyJ1SAa7pqf0mpEHQhiass2j
	 TYO/LoOlU6xRg==
Date: Fri, 7 Jul 2023 14:10:44 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, andrew.cooper3@citrix.com, 
    roger.pau@citrix.com, julien@xen.org, george.dunlap@citrix.com, 
    bertrand.marquis@arm.com, Stefano Stabellini <stefano.stabellini@amd.com>, 
    xen-devel@lists.xenproject.org
Subject: Re: [PATCH] docs/misra: add Rule 7.4 and 9.4
In-Reply-To: <9f2fc7fc-cab6-e14e-6fd3-a2e75d4becfa@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307071406480.761183@ubuntu-linux-20-04-desktop>
References: <20230706224619.1092613-1-sstabellini@kernel.org> <9f2fc7fc-cab6-e14e-6fd3-a2e75d4becfa@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 7 Jul 2023, Jan Beulich wrote:
> On 07.07.2023 00:46, Stefano Stabellini wrote:
> > --- a/docs/misra/rules.rst
> > +++ b/docs/misra/rules.rst
> > @@ -203,6 +203,13 @@ maintainers if you want to suggest a change.
> >       - The lowercase character l shall not be used in a literal suffix
> >       -
> >  
> > +   * - `Rule 7.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_07_04.c>`_
> > +     - Required
> > +     - A string literal shall not be assigned to an object unless the
> > +       objects type is pointer to const-qualified char
> > +     - Assigning a string literal to any object with type
> > +       "pointer to const-qualified void" is allowed
> 
> I guess this is relevant also in a few other cases: Considering the
> significant difference between title and actual text of the rule, and
> further assuming people looking here won't always pull out the full
> doc (they may not even have a copy of it), I think it is important to
> also mention in a remark that despite the title all "character types"
> are permitted, as long as string element type and character type match.
> Since the compiler won't allow mismatches when the lhs type isn't void,
> mandating no use of casts to "satisfy" the rule may be a way to express
> our intentions.

What about:

   * - `Rule 7.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_07_04.c>`_
     - Required
     - A string literal shall not be assigned to an object unless the
       objects type is pointer to const-qualified char
     - All "character types" are permitted, as long as the string
       element type and the character type match. (There should be no
       casts.) Assigning a string literal to any object with type
       "pointer to const-qualified void" is allowed.


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 21:29:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 21:29:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560620.876674 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHt0n-0005if-EH; Fri, 07 Jul 2023 21:29:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560620.876674; Fri, 07 Jul 2023 21:29:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHt0n-0005iY-Aq; Fri, 07 Jul 2023 21:29:09 +0000
Received: by outflank-mailman (input) for mailman id 560620;
 Fri, 07 Jul 2023 21:29:08 +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
 <SRS0=RURV=CZ=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHt0l-0005iS-Vy
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 21:29:07 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4bfe0948-1d0d-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 23:29:05 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id AF01061A6A;
 Fri,  7 Jul 2023 21:29:03 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDA6AC433C7;
 Fri,  7 Jul 2023 21:29:00 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4bfe0948-1d0d-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688765343;
	bh=d5NOVVaDpDJCqUoxq7NTfcFqX3hnalLCUq9tajdQa5w=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=ZCY7Eb8AAccCy4pQGfOqTN/Yl0n7Sw099sJOWjHAz9eaMlF1V9rU5spkWj7SJ1i0f
	 9N3joq9l5Tb7sdkl0t9QaSZHg6x/hcpfaz+U13hvAkQ3lDdjgWnlBc4/I0Wr5iTJED
	 hSC6LEoVJjQdzkr6xz2sw7PptAeJD12mZD9H9+UVw69JYNPp/hCdAQDbRh81KwjNVT
	 jiZlFok/wJkGLjIrADC6IDOyX7iUrcBjNZ1s5VkJE8Z3RsLhIP6cnGHM/OUc0gIe6u
	 Ga84HJMhlQOyXNqg6EJO+eIRn51uyMUUcRD2j969xFE8RUT2tUlXBLT7xgCOkIk2OT
	 0+75S3dJAfwcA==
Date: Fri, 7 Jul 2023 14:28:59 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    Federico Serafini <federico.serafini@bugseng.com>, consulting@bugseng.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Paul Durrant <paul@xen.org>, 
    Tamas K Lengyel <tamas@tklengyel.com>, 
    Alexandru Isaila <aisaila@bitdefender.com>, 
    Petre Pircalabu <ppircalabu@bitdefender.com>, 
    Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <xenia.ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>, 
    xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v2] x86: make function declarations consistent with
 definitions
In-Reply-To: <e6fb3b99-d59a-eceb-024a-8b791ef20129@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307071425040.761183@ubuntu-linux-20-04-desktop>
References: <1b2d5be30c0e4f335e59dce6e7c001cb0805d702.1688465215.git.federico.serafini@bugseng.com> <a16cdb60-1307-636e-1473-e5388e8f79d9@suse.com> <alpine.DEB.2.22.394.2307051604380.761183@ubuntu-linux-20-04-desktop> <2c7d71cb-067d-8dac-3ee4-3af42b2756f3@suse.com>
 <alpine.DEB.2.22.394.2307061506560.761183@ubuntu-linux-20-04-desktop> <e6fb3b99-d59a-eceb-024a-8b791ef20129@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 7 Jul 2023, Jan Beulich wrote:
> On 07.07.2023 00:29, Stefano Stabellini wrote:
> > On Thu, 6 Jul 2023, Jan Beulich wrote:
> >> On 06.07.2023 01:22, Stefano Stabellini wrote:
> >>> On Tue, 4 Jul 2023, Jan Beulich wrote:
> >>>> On 04.07.2023 12:23, Federico Serafini wrote:
> >>>>> Change mechanically the parameter names and types of function
> >>>>> declarations to be consistent with the ones used in the corresponding
> >>>>> definitions so as to fix violations of MISRA C:2012 Rule 8.3 ("All
> >>>>> declarations of an object or function shall use the same names and type
> >>>>> qualifiers") and MISRA C:2012 Rule 8.2 ("Function types shall be in
> >>>>> prototype form with named parameters").
> >>>>>
> >>>>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> >>>>
> >>>> On top of my earlier remark (when this was part of a series):
> >>>
> >>> I am not addressing specifically this comment. I am trying to build a
> >>> common understanding on how to do things so that we can go faster in the
> >>> future.
> >>>
> >>> In general, as discussed at Xen Summit, in order to successfully merge
> >>> large numbers of changes in the coming weeks we should try to keep
> >>> mechanical changes mechanical. Separate non-mechanical changes into
> >>> different patches.
> >>>
> >>> This patch is large but mechanical. If I understand you correctly, you
> >>> are asking:
> >>> 1) to split the patch into smaller patches
> >>> 2) make a couple of non-mechanical changes described below
> >>>
> >>>
> >>> For 1), in my opinion it is not necessary as long as all changes remain
> >>> mechanical. If some changes are not mechanical they should be split out.
> >>> So if you are asking non-mechanical changes in 2), then 2) should be
> >>> split out but everything else could stay in the same patch.
> >>>
> >>> If you'd still like the patch to be split, OK but then you might want to
> >>> suggest exactly how it should be split because it is not obvious: all
> >>> changes are similar, local, and mechanical. I for one wouldn't know how
> >>> you would like this patch to be split.
> >>
> >> So I gave a clear reason and guideline how to split: To reduce the Cc
> >> list of (because of requiring fewer acks for) individual patches, and
> >> to separate (possibly) controversial from non-controversial changes.
> >> This then allows "easy" changes to go in quickly.
> >>
> >> I realize that what may be controversial may not always be obvious,
> >> but if in doubt this can be addressed in a v2 by simply omitting such
> >> changes after a respective comment was given (see also below).
> > 
> > So the guideline is to separate by maintainership, e.g.
> > x86/arm/common/vpci
> > 
> > Also separate out anything controversial and/or that receives feedback
> > so it is not mechanical/straightforward anymore.
> > 
> > 
> >>> For 2), I would encourage you to consider the advantage of keeping the
> >>> changes as-is in this patch, then send out a patch on top the way you
> >>> prefer. That is because it costs you more time to describe how you
> >>> would like these lines to be changed in English and review the full
> >>> patch a second time, than change them yourself and anyone could ack them
> >>> (feel free to CC me).
> >>>
> >>> For clarity: I think it is totally fine that you have better suggestions
> >>> on parameter names. I am only pointing out that providing those
> >>> suggestions as feedback in an email reply is not a very efficient way to
> >>> get it done.
> >>
> >> What you suggest results in the same code being touched twice to
> >> achieve the overall goal (satisfy Misra while at the same time not
> >> making the code any worse than it already is). I'd like to avoid this
> >> whenever possible, so my preference would be that if the English
> >> description isn't clear, then the respective change would best be
> >> omitted (and left to be addressed separately).
> > 
> > Yes, I think that would work. Basically the process could look like
> > this:
> > 
> > - contributor sends out a patch with a number of mechanical changes
> > - reviewer spots a couple of things better done differently
> > - reviewer replies with "drop this change, I'll do it" no further
> >   explanation required
> > - in parallel: contributor sends out v2 without those changes for the
> >   reviewer to ack
> > - in parallel: reviewer sends out his favorite version of the changes
> >   for anyone to ack (assuming he is the maintainer)
> 
> For this last point, I don't see it needing to happen in parallel.
> Reviewers may be busy with other things, and making less mechanical
> changes can easily be done a little later. The overall count of
> violations is still going to decrease.

OK. Another suggestion along these lines is that if a revision of a
patch is OK except for 2 changes, those 2 changes could be removed on
commit to avoid another re-submit and re-review.

E.g. a patch has 50 fixes. 2 of these fixes are wrong, the rest are OK.
The maintainer/committer commits the patch with 48 fixes, removing the 2
unwanted fixes.

Keep in mind that resubmissions of these MISRA C patches also cause more
work for the reviewers/maintainers. I think we should try to find ways
to decrease the overall workload of everyone involved.


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 21:54:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 21:54:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560624.876684 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHtOm-0000bu-BA; Fri, 07 Jul 2023 21:53:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560624.876684; Fri, 07 Jul 2023 21:53:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHtOm-0000bn-7u; Fri, 07 Jul 2023 21:53:56 +0000
Received: by outflank-mailman (input) for mailman id 560624;
 Fri, 07 Jul 2023 21:53:54 +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
 <SRS0=RURV=CZ=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qHtOk-0000bg-Bh
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 21:53:54 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c12b0ab5-1d10-11ee-8611-37d641c3527e;
 Fri, 07 Jul 2023 23:53:50 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id D963861A8A;
 Fri,  7 Jul 2023 21:53:48 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F3BEC433C7;
 Fri,  7 Jul 2023 21:53:46 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c12b0ab5-1d10-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688766828;
	bh=k/+e0BWi3gX9F1S1IBS6aojJc9k/vUACTYADyTfduqo=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=s4Iy39WozA7wUOM/DuLT0e3iwDaTq10X1yw8ocBvgDZwrUu84RvVZ80TAHe8tSPF/
	 uW1KkLkupBGFNtU8lnsrMG6ZdEFAxhFo1XYJR9+WIaRxKuOtAfDNjDb9etYfrk/2RR
	 2Du5gyQyb0F8ALTqmAKqgiG2vQFu+lBlVNRdPY8Ftj5yoORyMc5JZhjAK0mQDQf2SQ
	 WDlZuzZHpKaaOMvqkTIfezXMhmM8rJ8BRq/AHfquAu+huBZ71/7WwpHARjN3Et3Ali
	 DtmQuWgrilnycxpK8cIRk0DF/JqRei0sw4NZS2WV354JntB9XetCWXLHiBeiVWV6T5
	 xFFfVIxYlqxbg==
Date: Fri, 7 Jul 2023 14:53:45 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Simone Ballarin <simone.ballarin@bugseng.com>, consulting@bugseng.com, 
    Gianluca Luparini <gianluca.luparini@bugseng.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Paul Durrant <paul@xen.org>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>, 
    xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v2 12/13] xen/x86: fix violations of MISRA C:2012
 Rule 7.2
In-Reply-To: <f6c16d46-5804-a838-cf61-71fc671e394b@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307071432200.761183@ubuntu-linux-20-04-desktop>
References: <cover.1688559115.git.gianluca.luparini@bugseng.com> <e414542d76d4a4a0df6ad969cc6332e355d6ef38.1688559115.git.gianluca.luparini@bugseng.com> <a343fc97-84df-48e6-1c91-cd933c6e5210@suse.com> <CAFHJcJu=S2JtFJy_XnMhrr0gP7+sPfvrS_1940qzL9rc_j60nA@mail.gmail.com>
 <f93f0561-abea-bdae-223e-d69932e435c4@suse.com> <CAFHJcJuP7hH01ZiwNe0HHBM=JpBtsF9sDD7fushyBxDQ9UZicw@mail.gmail.com> <fb29cca6-454c-82ed-b6a8-ac9814f81cfa@suse.com> <CAFHJcJuCddmwMAB=26tVBfgThQWLZb5kZU3GBdC0aTTcvJ4O1w@mail.gmail.com>
 <f6c16d46-5804-a838-cf61-71fc671e394b@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 7 Jul 2023, Jan Beulich wrote:
> On 07.07.2023 10:04, Simone Ballarin wrote:
> > Il giorno ven 7 lug 2023 alle ore 09:04 Jan Beulich <jbeulich@suse.com> ha
> > scritto:
> > 
> >> On 07.07.2023 08:50, Simone Ballarin wrote:
> >>> Il giorno gio 6 lug 2023 alle ore 18:22 Jan Beulich <jbeulich@suse.com>
> >> ha
> >>> scritto:
> >>>
> >>>> On 06.07.2023 18:08, Simone Ballarin wrote:
> >>>>> Il giorno gio 6 lug 2023 alle ore 10:26 Jan Beulich <jbeulich@suse.com
> >>>
> >>>> ha
> >>>>> scritto:
> >>>>>
> >>>>>> On 05.07.2023 17:26, Simone Ballarin wrote:
> >>>>>>> --- a/xen/arch/x86/apic.c
> >>>>>>> +++ b/xen/arch/x86/apic.c
> >>>>>>> @@ -1211,7 +1211,7 @@ static void __init calibrate_APIC_clock(void)
> >>>>>>>       * Setup the APIC counter to maximum. There is no way the lapic
> >>>>>>>       * can underflow in the 100ms detection time frame.
> >>>>>>>       */
> >>>>>>> -    __setup_APIC_LVTT(0xffffffff);
> >>>>>>> +    __setup_APIC_LVTT(0xffffffffU);
> >>>>>>
> >>>>>> While making the change less mechanical, we want to consider to switch
> >>>>>> to ~0 in this and similar cases.
> >>>>>>
> >>>>>
> >>>>> Changing ~0U is more than not mechanical: it is possibly dangerous.
> >>>>> The resulting value could be different depending on the architecture,
> >>>>> I prefer to not make such kind of changes in a MISRA-related patch.
> >>>>
> >>>> What do you mean by "depending on the architecture", when this is
> >>>> x86-only code _and_ you can check what type parameter the called
> >>>> function has?
> >>>
> >>> Ok, I will change these literals in ~0U in the next submission.
> >>
> >> Except that I specifically meant ~0, not ~0U. We mean "maximum value"
> >> here, and at the call site it doesn't matter how wide the function
> >> parameter's type is. If it was 64-bit, ~0U would not do what is wanted.
> > 
> > ~0 is not a MISRA-compliant solution since bitwise operations on signed
> > integers have implementation-defined behavior. This solution definitively
> > violates Rule 10.1.
> 
> So if we adopted that rule (we didn't so far), we'd have to e.g. change
> all literal number shift counts to have U suffixes, no matter that
> without the suffix it is still entirely obvious that the numbers are
> unsigned? I'm afraid that'll face my opposition ...

Indeed we have not adopted Rule 10.1. However, may I suggest that we
don't make things potentially worse, just in case we end up deciding in
favor of 10.1? We might not adopt 10.1 at all, but still... The code is
already 0xffffffff, let's make things easier for all of us and just do
0xffffffffU ?

Let's put Rule 10.1 and the whole of MISRA C aside for a second.


Jan, let's say that you prefer ~0 or a different function parameter name
or something else on any of these patches. You do realize that you don't
need Simone or Federico or anyone else to make that change for you? You
can make the change, submit a patch, and in your case anyone can ack
it. Roger, Andrew, me, Bertrand, Julien, and almost anyone else could
ack it and it would go in. As I wrote yesterday, feel free to CC me and
I'll help you get in all the changes that you want.

If you submitted that patch to switch to ~0 it might already be
committed by now.

I am trying to highlight that suggesting changes on these mechanical
patches end up with more work for both the contributor and also the
maintainer compared to do the change yourself.

I think we should try to accept these patches as
mechanical-changes-only. This is the only way to scale up this effort.
If you spot something that you'd rather be done differently, do one of
the following:

a) Accept the patch as-is and submit a patch afterwards. Yes the line
   gets changed twice but it is the easiest solution.

b) Ask the contribitor to drop the single change you would rather do
   differently, or even better drop it yourself on commit. Then submit a
   patch with the change that you prefer.

c) For trivial things, like code style changes, do the change directly
   on commit.


I know emails encourage English replies, but to make this work we need
to do more code changes together and less English.


From xen-devel-bounces@lists.xenproject.org Fri Jul 07 22:13:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 22:13:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560628.876694 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHthr-00034U-TS; Fri, 07 Jul 2023 22:13:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560628.876694; Fri, 07 Jul 2023 22:13:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHthr-00034N-QY; Fri, 07 Jul 2023 22:13:39 +0000
Received: by outflank-mailman (input) for mailman id 560628;
 Fri, 07 Jul 2023 22:13:38 +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 <SRS0=7rlb=CZ=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qHthq-00034H-G0
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 22:13:38 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 833d7b01-1d13-11ee-8611-37d641c3527e;
 Sat, 08 Jul 2023 00:13:35 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 367MD7H7068848
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Fri, 7 Jul 2023 18:13:13 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 367MD7tF068847;
 Fri, 7 Jul 2023 15:13:07 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 833d7b01-1d13-11ee-8611-37d641c3527e
Date: Fri, 7 Jul 2023 15:13:07 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: iwj@xenproject.org, wl@xen.org, Anthony PERARD <anthony.perard@citrix.com>,
        Juergen Gross <jgross@suse.com>,
        Marek =?iso-8859-1?Q?Marczykowski-G=F3recki?= <marmarek@invisiblethingslab.com>
Subject: Python in Domain Configurations
Message-ID: <ZKiN80e08QIojRSL@mattapan.m5p.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Spam-Status: No, score=0.4 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

There is a distinct weakness in Xen which ends up dragging in domain
configuration limitations.  I was thinking of using Python for parsing
extra data out of domain configuration files.  Only to find sample domain
configuration files were in fact fully valid Python.

Having experimented, it appears entirely feasible to use libpython to
parse current domain configuration files.  Looking further it appears
Python was in fact used in the past to handle domain configuration files.

Why was this removed?

The only context I could find was 54fbaf446b and
https://wiki.xenproject.org/wiki/PythonInXlConfig which don't explain
the reasoning.

Would the maintainers be amenable to revisiting the decision to remove
support for full Python in domain configuration files?

The obvious reason is having full Python would increase the size of `xl`.
In most cases I'm unsure this would be too problematic.  The case where
it would matter is the daemon process.  Issue here is plenty of other
extra libraries are also bloating the runtime size of `xl`.  I suspect
the daemon process really needs to be split into a separate executable to
reduce overhead anyway.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Fri Jul 07 23:19:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 07 Jul 2023 23:19:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560634.876704 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHuje-0000w7-NY; Fri, 07 Jul 2023 23:19:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560634.876704; Fri, 07 Jul 2023 23:19:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHuje-0000w0-Kt; Fri, 07 Jul 2023 23:19:34 +0000
Received: by outflank-mailman (input) for mailman id 560634;
 Fri, 07 Jul 2023 23:19:33 +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
 <SRS0=3yVI=CZ=gmail.com=christopher.w.clark@srs-se1.protection.inumbo.net>)
 id 1qHujd-0000vu-3B
 for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 23:19:33 +0000
Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com
 [2a00:1450:4864:20::22b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b8ae44b3-1d1c-11ee-8611-37d641c3527e;
 Sat, 08 Jul 2023 01:19:29 +0200 (CEST)
Received: by mail-lj1-x22b.google.com with SMTP id
 38308e7fff4ca-2b6b98ac328so37539271fa.0
 for <xen-devel@lists.xenproject.org>; Fri, 07 Jul 2023 16:19:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b8ae44b3-1d1c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688771968; x=1691363968;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=6HOYQ3SBbubGyQS3Wbh+33n2mUYKRGutetNFuLaA4o0=;
        b=PFPTMAdVKx1170SeB3u/DWQPfQPH+YG+6Vb6tKXdqMrSfXeAOZmJypuibM1PMWx5dR
         JyMCmpAjby3xJcwkVTkDm+A7W16n1eLO9pVe0fQjVMHLk3rFbCVk5qtFIxmaz0uKBvHM
         kowoAQIc45d9N2Gmyz9rXKihq+hv1YMcTa6CF+OW28NT/VmLjfGgE88LzOCaecSGqsg6
         B2N7LuhcKtl8uyPXUQjrhAVPFtA2Pw6dD3Z5qPZvLU8rH3/9LMduALMMtuZsMcyT+Njp
         aIJFnx102fr2AloBk/B0g+PnKQyZLjElaEAjLCPAtOQc4Cy/GCA6Cwox3Ge3kyjmtYeR
         iZXg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688771968; x=1691363968;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=6HOYQ3SBbubGyQS3Wbh+33n2mUYKRGutetNFuLaA4o0=;
        b=iojVjoM88RsUODFD3hJGHi+9pDh9+fyZ015HAXDP0Wd4M2jHOBIotukTCsQnDJq9GB
         JNml4WX5psJ9hrd0gRGdprlPXAL5CZO6iZnv1sdUtDeoQqKxdrXDYulaupalEPTid0El
         FOhg9PFoRePBw22OvoiYJNVfHk8XqZrfzuWS6muXCwtBz+fWgUkqSAYeyNx7pi2RRzLL
         Qv3y91FjSfR37KFQnr6syGXsrgNImYkeBHVxwrZOT9JdjM763oBMLCzF4buNhke6nEvM
         WWU+rF4esVsVpfUVuKJS+5ZUI3liTM9wyt2k+wdH6HLboIlLtARn7Gac3GW+wx6PQwzP
         jfOw==
X-Gm-Message-State: ABy/qLYzpO6edtzflfzR0FrnIvnhdfFiGvN+48zk2d/PxdhXM2spaO5s
	PMkEoCfYX9GK6SeRA5HI8BczHD6L+umP6Pq6w1w=
X-Google-Smtp-Source: APBJJlEn7yYrig9w3IcPb5e9fgu4gAHrC+JHlSozeg7qSLY2/SfGbt/JE2KJ8iDL9GX9kSHb8CiafFCWQeiUill/XkY=
X-Received: by 2002:a05:6512:60f:b0:4ed:cc6d:61fe with SMTP id
 b15-20020a056512060f00b004edcc6d61femr4478469lfe.24.1688771967959; Fri, 07
 Jul 2023 16:19:27 -0700 (PDT)
MIME-Version: 1.0
References: <8601CDD7-87F7-4FD0-A6E6-BAEAB12E7956@arm.com> <234199F8-DBB1-42B6-9A4C-8800EEF60997@gmail.com>
 <CA+zSX=Y3_g_aq4+sDK7CuZajywVqQ4xOrq7hKZ80eUT3uSxzuQ@mail.gmail.com>
 <alpine.DEB.2.22.394.2307051436120.761183@ubuntu-linux-20-04-desktop>
 <CA+zSX=ashTi590+cVss_3zyLESC8S=zVSMLjTKD00s6xfjZbJA@mail.gmail.com>
 <alpine.DEB.2.22.394.2307061328540.761183@ubuntu-linux-20-04-desktop> <CACMJ4GYWoyCQMWX8VtpwChk7hHxL-u0Mo-kKX8Qmr1oKf91Hyg@mail.gmail.com>
In-Reply-To: <CACMJ4GYWoyCQMWX8VtpwChk7hHxL-u0Mo-kKX8Qmr1oKf91Hyg@mail.gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
Date: Fri, 7 Jul 2023 16:19:16 -0700
Message-ID: <CACMJ4GZSRp9R7EUVy4hp__uzy0E-L=X1Qt_ud-2VmcyXT3b6hg@mail.gmail.com>
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
To: Stefano Stabellini <stefano.stabellini@amd.com>
Cc: George Dunlap <george.dunlap@cloud.com>, P S <pairspace@gmail.com>, 
	Luca Fancellu <luca.fancellu@arm.com>, Stefano Stabellini <sstabellini@kernel.org>, 
	"Daniel P. Smith" <dpsmith@apertussolutions.com>, Andrew Cooper <Andrew.Cooper3@citrix.com>, 
	Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>, 
	George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
	Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, Henry Wang <Henry.Wang@arm.com>, 
	Community Manager <community.manager@xenproject.org>, Doug Goldstein <cardoe@cardoe.com>, 
	Bertrand Marquis <bertrand.marquis@arm.com>, Volodymyr Babchuk <volodymyr_babchuk@epam.com>, 
	Anthony PERARD <anthony.perard@citrix.com>, Rian Quinn <rianquinn@gmail.com>, 
	Ian Jackson <iwj@xenproject.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Scott Davis <scott.davis@starlab.io>, Adam Fraser <adam@starlab.io>, Paul Durrant <paul@xen.org>, 
	rsmith@riversideresearch.org, 
	"m.a.young@durham.ac.uk" <m.a.young@durham.ac.uk>, Elliott Mitchell <ehem+xen@m5p.com>, 
	openxt <openxt@googlegroups.com>, Jason Andryuk <jandryuk@gmail.com>, 
	=?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>
Content-Type: multipart/alternative; boundary="00000000000041c81b05ffeddd75"

--00000000000041c81b05ffeddd75
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

+CC openxt, Jason, Marek

On Fri, Jul 7, 2023 at 2:06=E2=80=AFPM Christopher Clark <
christopher.w.clark@gmail.com> wrote:

> +CC members of the Hyperlaunch Working Group + participants on earlier
> Hyperlaunch threads
>
> On Thu, Jul 6, 2023 at 2:39=E2=80=AFPM Stefano Stabellini <
> stefano.stabellini@amd.com> wrote:
>
>> On Thu, 6 Jul 2023, George Dunlap wrote:
>> > On Wed, Jul 5, 2023 at 11:14=E2=80=AFPM Stefano Stabellini <
>> stefano.stabellini@amd.com> wrote:
>> >       On Wed, 5 Jul 2023, George Dunlap wrote:
>> >       > On Mon, Jul 3, 2023 at 9:55=E2=80=AFPM P S <pairspace@gmail.co=
m> wrote:
>> >       >       > On Jul 3, 2023, at 15:45, Luca Fancellu <
>> luca.fancellu@arm.com> wrote:
>> >       >       =EF=BB=BF>
>> >       >       >> On 3 Jul 2023, at 18:48, Stefano Stabellini <
>> sstabellini@kernel.org> wrote:
>> >       >       >>
>> >       >       >>> On Mon, 3 Jul 2023, Daniel P. Smith wrote:
>> >       >       >>> On 7/1/23 11:13, Luca Fancellu wrote:
>> >       >       >>>>> On 1 Jul 2023, at 08:53, Andrew Cooper <
>> andrew.cooper3@citrix.com> wrote:
>> >       >       >>>>>
>> >       >       >>>>> On 30/06/2023 10:12 am, Luca Fancellu wrote:
>> >       >       >>>>>> The "dom0less" feature was intended to be the
>> feature where a domU
>> >       >       >>>>>> domain could be launched without the control
>> domain (Dom0)
>> >       >       >>>>>> intervention, however the name seems to suggest
>> that Dom0 cannot
>> >       >       >>>>>> be part of the configuration, while instead it's =
a
>> possible use case.
>> >       >       >>>>>>
>> >       >       >>>>>> To avoid that, rename the "dom0less" configuratio=
n
>> with the name
>> >       >       >>>>>> "hyperlaunch", that is less misleading.
>> >       >       >>>>>>
>> >       >       >>>>>> Signed-off-by: Luca Fancellu <
>> luca.fancellu@arm.com>
>> >       >       >>>>>> ---
>> >       >       >>>>>> This is an RFC to get the feeling of the communit=
y
>> about the name
>> >       >       >>>>>> change, for now it's everything in one patch just
>> to see how it
>> >       >       >>>>>> will look like, if there is interest on proceedin=
g
>> into it, I can
>> >       >       >>>>>> split in more commit.
>> >       >       >>>>>
>> >       >       >>>>> Have you discussed this with Dan and Chris at all?
>> You haven't even
>> >       >       >>>>> CC'd them.
>> >       >       >>>>
>> >       >       >>>> No, this rename idea started from a chat during the
>> summit, anyway Julien
>> >       >       >>>> promptly add them to the CC, because I forgot.
>> >       >       >>>
>> >       >       >>> No worries and thank you for considering and taking
>> the time to do this RFC.
>> >       >       >>> It is greatly appreciated that there is a strong
>> willingness to have dom0less
>> >       >       >>> and hyperlaunch merged.
>> >       >       >>>
>> >       >       >>>>>
>> >       >       >>>>> While there is a lot of end-goal in common between
>> the dom0less and
>> >       >       >>>>> hyperlaunch, and that the name dom0less is deeply
>> misleading,
>> >       >       >>>>> hyperlaunch is specifically not this.
>> >       >       >>>>
>> >       >       >>>> Yes Hyperlaunch is more than this, however as I
>> said, with this RFC I would
>> >       >       >>>> like
>> >       >       >>>> to ear opinions, @Daniel @Christopher could it be a
>> proper name for the
>> >       >       >>>> dom0less
>> >       >       >>>> feature?
>> >       >       >>>
>> >       >       >>> As Andy has alluded, hyperlaunch is meant to provide
>> a flexible means to
>> >       >       >>> handle domain construction at boot to meet a wide
>> range of possible use cases.
>> >       >       >>> One of those use cases is dom0less, so yes,
>> ultimately what dom0less does
>> >       >       >>> today will be achievable under hyperlaunch. Our
>> intended approach to align the
>> >       >       >>> two implementations is one that is meant to be
>> minimally disruptive, since
>> >       >       >>> dom0less is considered a supported (SUPPORT.md)
>> capability. As mentioned, we
>> >       >       >>> are greatly appreciative to the openness to adopt th=
e
>> name,
>> >       >       >>
>> >       >       >> Thanks Daniel!
>> >       >       >>
>> >       >       >>
>> >       >       >>> but a big concern
>> >       >       >>> I personally have is the confusion it could cause a
>> general user. A blanket
>> >       >       >>> rename would end up with two documents in the docs
>> tree that provide two
>> >       >       >>> different explanations of hyperlaunch and two
>> different device tree
>> >       >       >>> definitions. So I think a more measured approach
>> should be considered here.
>> >       >       >>>
>> >       >       >>>> If this patch makes things more difficult for the
>> Hyperlunch serie, I=E2=80=99m ok
>> >       >       >>>> to drop it,
>> >       >       >>>> my only aim was just to find a less misleading name
>> for the feature.
>> >       >       >>>
>> >       >       >>> What I would like to suggest as a good first step
>> would be an update to the
>> >       >       >>> dom0less document. Provide a note at the beginning
>> that points to the
>> >       >       >>> hyperlaunch design doc as a more general approach
>> that will eventually subsume
>> >       >       >>> dom0less. This would provide a gentler transition fo=
r
>> exist users of dom0less.
>> >       >       >>>
>> >       >       >>> If it is not too much, I would also ask, please have
>> a look at the design for
>> >       >       >>> boot modules in the series Christopher just posted.
>> The design pulls from the
>> >       >       >>> work done by dom0less and expanded upon it. I major
>> step into merging the two
>> >       >       >>> capabilities will be to have a common set of
>> structures. Once those are in
>> >       >       >>> place, we can move to a common device tree
>> representation, and at that point
>> >       >       >>> we would be fairly close, if not at the point of a
>> formal merger of between
>> >       >       >>> the two.
>> >       >       >>
>> >       >       >> At the moment we have a concrete problem with
>> explaining dom0less and
>> >       >       >> hyperlaunch to potential new users. Using two
>> different names for a
>> >       >       >> similar feature on arm and x86 causes confusion. It i=
s
>> hurting Xen as a
>> >       >       >> solution. Personally I already had to switch to use
>> the word
>> >       >       >> "hyperlaunch" for everything in my users-facing
>> presentations.
>> >       >       >>
>> >       >       >> At the summit, we discussed that it would be a good
>> idea to use a single
>> >       >       >> name to refer to both features on arm and x86. Given
>> that "dom0less"
>> >       >       >> causes additional issues because it makes people thin=
k
>> that there is no
>> >       >       >> Dom0, the suggestion was to use "hyperlaunch" to refe=
r
>> to both features.
>> >       >       >>
>> >       >       >> We don't need to 100% align the two implementations
>> and data structures.
>> >       >       >> This is not for engineers that are going to look at
>> the specifications
>> >       >       >> and improve them. This is for users/customers of Xen
>> that are trying to
>> >       >       >> understand what the hypervisor enables them to do. We
>> need to be able to
>> >       >       >> show users architecture slides with the same name and
>> explanation on
>> >       >       >> both ARM and x86.
>> >       >       >>
>> >       >       >> I am sure that Daniel and Christopher remember, but
>> for the others on
>> >       >       >> this email thread, the name "hyperlaunch" was born
>> exactly to be that:
>> >       >       >> the one name to cover both features on ARM and x86
>> even if they have a
>> >       >       >> different implementation. Appended an old email for
>> reference.
>> >       >       >>
>> >       >       >> Also I agree with Daniel that we need to be careful
>> about the two docs
>> >       >       >> under docs/. I think he is right we need to add a
>> paragraph explaining
>> >       >       >> the history and a pointer to the other document.
>> Something like:
>> >       >       >>
>> >       >       >> "Dom0less is the name that was used when initially
>> introducing the
>> >       >       >> feature on ARM. Then, the "dom0less" name was retired
>> in favor of
>> >       >       >> "hyperlaunch" to avoid confusion (a Dom0 might still
>> be present) and to
>> >       >       >> align with x86 (where a similar feature was called
>> hyperlaunch from the
>> >       >       >> start)."
>> >       >       >
>> >       >       > I=E2=80=99m fully ok to add a section like this pointi=
ng to the
>> Hyperlaunch design.
>> >       >
>> >       >       _If_ this text is added, please include links/references
>> to the Hyperlaunch wiki page and Hyperlaunch design docs.
>> >       >
>> >       >       > @Daniel and @Christopher would it be ok for you or the
>> changes in the serie
>> >       >       > are going to be problematic for your future work? In
>> the end it=E2=80=99s just a mechanical
>> >       >       > rename, so I guess we just need to agree on naming
>> conventions.
>> >       >
>> >       >       Please see the history of trademark litigation about the
>> use of symbolic names to reference similar-but-different
>> >       artifacts.
>> >       >       It is much easier to use the same name to refer to
>> entirely different objects. Historically, confusion arises when a
>> >       name is
>> >       >       used in similar contexts.
>> >       >
>> >       >       There is also versioning.  Could we refer to dom0less as
>> "Hyperlaunch Version -1"?
>> >       >
>> >       >       How about renaming dom0less to "Hyperlaunch Lite"?
>> >       >
>> >       >
>> >       > Perhaps it would be helpful if you could explain more clearly
>> your concerns.  I take it that you want a name which can be
>> >       used specifically
>> >       > to indicate the full "domB measured boot" functionality that
>> was Daniel and Christopher's original goal, and that you're
>> >       afraid that using
>> >       > plain "Hyperlaunch" for only the "start VMs from Xen on boot"
>> functionality will dilute that?
>> >       >
>> >       > The "start VMs from Xen on boot" functionality is the *only*
>> thing that a big chunk of the users of this functionality want;
>> >       referring to
>> >       > it as "Hyperlaunch Lite" or "Hyperlaunch -1" will undermine th=
e
>> value of the functionality.
>> >       >
>> >       > What if we use "Measured Hyperlaunch", or "Hyperlaunch Measure=
d
>> Boot" to refer to the full measured boot functionality?
>> >
>> >       I think this is the best way.
>> >
>> >
>> >       > Or, "Hyperlaunch DT" for "Booting VMs from Xen using Device
>> Tree" (without the involvement of a domB), "Hyperlaunch Boot
>> >       Domain /
>> >       > Hyperlaunch domB" for a more general "domB" functionality, and
>> "Hyperlaunch Measured Boot" for the full functionality
>> >       (assuming there's
>> >       > more to this than simply having a domB involved)?
>> >
>> >
>> >       We need an overarching name to cover the feature "start VMs from
>> Xen on
>> >       boot" on both ARM and x86. From my understanding and from the
>> original
>> >       emails on the subject, the name "hyperlaunch" was it.
>> >
>> >
>> > Sure; but think "guitar" vs "acoustic guitar" vs "electric guitar".
>> "Electric guitar" is new, "guitar" covers them both, but you sometimes
>> > need a way to specify "acoustic".  Right now target configurations
>> we're talking about include:
>> >
>> > 1. Booting all your domains directly from Xen using DT configurations
>> > 2. Booting a domB, which then executes some more complicated
>> programmatic configuration to launch VMs before disappearing
>> > 3. Doing full measured boot on the whole system using a domB.
>> >
>> > If "Hyperlaunch" means 1-3, we not only need a way to specify that
>> you're talking about 3, but *also* a way to specify that you're talking
>> > about 1.  In the vast majority of cases for the foreseeable future
>> are going to be 1.  Additionally, we want to make sure that
>> > "Hyperlaunch" *actually* turns out to mean 1-3, and not just 1.
>> >
>> > The thing I like about "Hyperlaunch DT" is that to me it sounds pretty
>> cool but also is very descriptive: I haven't talked to people
>> > building these systems, but it seems like saying, "The hypervisor
>> launches VMs based on a Device Tree passed to it at boot" will be
>> > immediately understood, and stick in people's minds.
>> >
>> > So maybe informally, or in "short usage" use "Hyperlaunch", but in
>> documentation or reference systems, when talking specifically about #1,
>> > try to use "Hyperlaunch DT", just to reinforce the idea that there's
>> more to Hyperlaunch that's coming down the road?
>>
>> "Hyperlaunch DT" would refer to both the x86 and ARM implementations
>> because they are both based on DT.
>>
>> I think it is better than "Hyperlaunch Lite" but I am not a fan of
>> either of these two names because "DT" and "Lite" get easily lost in
>> presentations and discussions. For the next few years many will talk
>> about HyperLaunch just to refer to what is Dom0less today. So if the
>> goal when we say "HyperLaunch" is to bring Measure Boot or XSM to
>> people's minds, I don't think this will work well.
>>
>> If we want to keep "Hyperlaunch" to mean 1-3 above, highlighting Measure
>> Boot or XSM, then I think we should consider using "Dom0less" for 1.
>> Yes, it is misleding, but at least it is unique, and a google search for
>> "dom0less" leads the user to the right results.
>>
>> If we do that, we should rename "Hyperlaunch" with "Dom0less" in
>> docs/designs/launch/hyperlaunch.rst. That's because "Hyperlaunch" is
>> defined as "the ability of a hypervisor to construct and start one or
>> more virtual machines at system launch in a specific way", which falls
>> under Dom0less in this discussion.
>>
>> In my opinion, it is better to have specific names for specific
>> features. So I would use "HyperLaunch" to mean "the ability of a
>> hypervisor to construct and start one or more virtual machines at system
>> launch in a specific way" as it is defined today.
>>
>> When we add Measure Boot or XSM or other security/safety features, I
>> would call them out specifically. For instance, "HyperLaunch with XSM".
>> It is more descriptive and highlights each feature.
>>
>> Note that at AMD we'll need HyperLaunch without an all-powerful Dom0,
>> probably with XSM. So I am not writing this because I don't think the
>> other features 2-3 are not important. They definitely are important.
>
>
>
> Thanks to all the participants in this thread for the interest in
> Hyperlaunch and
> the support for enabling common advanced boot functionality for Xen acros=
s
> architectures.
>
> I'm aiming to provide here a hopefully-fairly-objective overview of the
> issues
> being raised so that we can ensure that these are covered, and then I wil=
l
> also
> give my views afterwards.
>
> ------------------------------------------------------------
> =3D Naming and communication
>
> - Ensuring expectations are set correctly for the Hyperlaunch name
>     - communicating the value of it, differentiation for Xen
>     - avoiding sub-branding it for feature subsets, use cases, technologi=
es
>
> - Retiring the term 'dom0less'
>
> - How to describe the "starting multiple VMs at host boot" functionality
>
>     - How to describe further Hyperlaunch functionality beyond this
>         - eg. isolation properties and relevance to critical systems
>         - eg. running without a classic dom0
>
>     - How Hyperlaunch relates to other boot functionalities and
> technologies,
>       including:
>         - architecture-specific aspects and architecture-neutral aspects
>         - Device Tree
>         - boot domain
>         - control domain, hardware domain, dom0
>         - domain builder
>         - system measurement
>         - XSM
>         - DRTM
>         - etc.
>
>
> =3D Migration
>
> - Providing a forward path for existing users of dom0less functionality
> across the technical changes for Hyperlaunch cross-architecture
> implementation
>     - document compatibility
>     - support a "dom0less mode" with existing Device Tree structure
>     - documentation updates to be paired with progress on code
> implementation
>
>
> =3D Community resourcing
>
> - Supporting code review and merge of Hyperlaunch changes into Xen
>     - transitioning existing Arm logic into common, including FDT
>
> - Provision of accurate, consistent documentation materials to support
> effective communication to existing and prospective users, developers and
> other
> stakeholders
>      - Ensuring that the document structure supports ongoing maintenance:
>         - Multiple use cases, structure docs accordingly: eg.
>             - use case: static partitioning, critical + non-critical VMs
>             - use case: measured launch with a boot domain
>             - use case: fast VM start for embedded systems
>         - Architecture of Hyperlaunch, relevance to other hypervisors
>             - nested systems
>
> - Design, review and agreement for common cross-architecture and
>   arch-extensible interfaces, including:
>     - common boot data structures
>     - Device Tree structure
>     - hypfs entries
>     - introspection to determine hyperlaunched system status
>
> - Development of test cases
>
> - CI of Hyperlaunch interfaces, to ensure that it stays working
>
> ------------------------------------------------------------
>
> Views arrived at in discussion with Rich and Daniel, and after reading th=
e
> thread contributions, follow this point.
>
> "Hyperlaunch" is to be the common name across architectures for a flexibl=
e,
> configurable boot system for coordinating the launch of multiple VMs by t=
he
> hypervisor, with a common implementation, pooling resources and developme=
nt
> risk across the Xen community. The interfaces are core to it.
>
> From the Hyperlaunch design document (reviewed + committed to the tree):
>
> "The design enables seamless transition for existing systems that require
> a dom0, and provides a new general capability to build and launch
> alternative configurations of virtual machines, including support for
> static partitioning and accelerated start of VMs during host boot, while
> adhering to the principles of least privilege. It incorporates the existi=
ng
> dom0less functionality, extended to fold in the new developments from the
> Hyperlaunch project, with support for both x86 and Arm platform
> architectures, building upon and replacing the earlier 'late hardware
> domain' feature for disaggregation of dom0.
>
> Hyperlaunch is designed to be flexible and reusable across multiple use
> cases, and our aim is to ensure that it is capable, widely exercised,
> comprehensively tested, and well understood by the Xen community."
>
> https://xenbits.xen.org/docs/4.17-testing/designs/launch/hyperlaunch.html
>
> ie.  Hyperlaunch was created to move away from point solutions that
> hard-code
> specific launch configurations, isolation properties and threat models. I=
t
> isn't just about starting domains -- it is about enabling the constructio=
n
> of
> complex use cases runtimes for Xen. It is the result of iterative design
> starting with the disaggregation for the late hardware domain, through
> dom0less development and then with the comprehensive hyperlaunch design a=
nd
> implementation that builds upon them both.
>
> The current interest and investment in Hyperlaunch is driven by its
> relevance
> to Safety Critical systems due to the isolation properties and improvemen=
t
> in the ability to certify the software -- this is closely related to but
> slightly different from starting multiple VMs at host boot.
>
> To encourage commonality and allow for future development, we should not
> use architecture-specific or vendor-specific name variations, and also
> avoid
> technology-specific name variations (eg. Device Tree or "DT").
>
> Instead, the use case configurations should themselves be describable.
>
> Thanks again,
>
> Christopher
>
>

--00000000000041c81b05ffeddd75
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>+CC openxt, Jason, Marek<br></div><br><div class=3D"g=
mail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jul 7, 2023 at 2:=
06=E2=80=AFPM Christopher Clark &lt;<a href=3D"mailto:christopher.w.clark@g=
mail.com">christopher.w.clark@gmail.com</a>&gt; wrote:<br></div><blockquote=
 class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px so=
lid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div>+CC members of=
 the Hyperlaunch Working Group=C2=A0+ participants on earlier Hyperlaunch t=
hreads<br></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gm=
ail_attr">On Thu, Jul 6, 2023 at 2:39=E2=80=AFPM Stefano Stabellini &lt;<a =
href=3D"mailto:stefano.stabellini@amd.com" target=3D"_blank">stefano.stabel=
lini@amd.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddin=
g-left:1ex">On Thu, 6 Jul 2023, George Dunlap wrote:<br>
&gt; On Wed, Jul 5, 2023 at 11:14=E2=80=AFPM Stefano Stabellini &lt;<a href=
=3D"mailto:stefano.stabellini@amd.com" target=3D"_blank">stefano.stabellini=
@amd.com</a>&gt; wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0On Wed, 5 Jul 2023, George Dunlap wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; On Mon, Jul 3, 2023 at 9:55=E2=80=AFPM =
P S &lt;<a href=3D"mailto:pairspace@gmail.com" target=3D"_blank">pairspace@=
gmail.com</a>&gt; wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; On Jul 3=
, 2023, at 15:45, Luca Fancellu &lt;<a href=3D"mailto:luca.fancellu@arm.com=
" target=3D"_blank">luca.fancellu@arm.com</a>&gt; wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0=EF=BB=BF&gt;=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; On 3=
 Jul 2023, at 18:48, Stefano Stabellini &lt;<a href=3D"mailto:sstabellini@k=
ernel.org" target=3D"_blank">sstabellini@kernel.org</a>&gt; wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
On Mon, 3 Jul 2023, Daniel P. Smith wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
On 7/1/23 11:13, Luca Fancellu wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt; On 1 Jul 2023, at 08:53, Andrew Cooper &lt;<a href=3D"mailto:andrew=
.cooper3@citrix.com" target=3D"_blank">andrew.cooper3@citrix.com</a>&gt; wr=
ote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt; On 30/06/2023 10:12 am, Luca Fancellu wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; The &quot;dom0less&quot; feature was intended to be the feature=
 where a domU<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; domain could be launched without the control domain (Dom0)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; intervention, however the name seems to suggest that Dom0 canno=
t<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; be part of the configuration, while instead it&#39;s a possible=
 use case.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; To avoid that, rename the &quot;dom0less&quot; configuration wi=
th the name<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; &quot;hyperlaunch&quot;, that is less misleading.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; Signed-off-by: Luca Fancellu &lt;<a href=3D"mailto:luca.fancell=
u@arm.com" target=3D"_blank">luca.fancellu@arm.com</a>&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; ---<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; This is an RFC to get the feeling of the community about the na=
me<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; change, for now it&#39;s everything in one patch just to see ho=
w it<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; will look like, if there is interest on proceeding into it, I c=
an<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;&gt; split in more commit.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt; Have you discussed this with Dan and Chris at all?=C2=A0 You haven&=
#39;t even<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt; CC&#39;d them.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; No, this rename idea started from a chat during the summit, anyway Juli=
en<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; promptly add them to the CC, because I forgot.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
No worries and thank you for considering and taking the time to do this RFC=
.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
It is greatly appreciated that there is a strong willingness to have dom0le=
ss<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
and hyperlaunch merged.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt; While there is a lot of end-goal in common between the dom0less and=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt; hyperlaunch, and that the name dom0less is deeply misleading,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;&gt; hyperlaunch is specifically not this.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; Yes Hyperlaunch is more than this, however as I said, with this RFC I w=
ould<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; like<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; to ear opinions, @Daniel @Christopher could it be a proper name for the=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; dom0less<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; feature?<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
As Andy has alluded, hyperlaunch is meant to provide a flexible means to<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
handle domain construction at boot to meet a wide range of possible use cas=
es.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
One of those use cases is dom0less, so yes, ultimately what dom0less does<b=
r>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
today will be achievable under hyperlaunch. Our intended approach to align =
the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
two implementations is one that is meant to be minimally disruptive, since<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
dom0less is considered a supported (SUPPORT.md) capability. As mentioned, w=
e<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
are greatly appreciative to the openness to adopt the name,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; Than=
ks Daniel!<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
but a big concern<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
I personally have is the confusion it could cause a general user. A blanket=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
rename would end up with two documents in the docs tree that provide two<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
different explanations of hyperlaunch and two different device tree<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
definitions. So I think a more measured approach should be considered here.=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; If this patch makes things more difficult for the Hyperlunch serie, I=
=E2=80=99m ok<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; to drop it,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;&=
gt; my only aim was just to find a less misleading name for the feature.<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
What I would like to suggest as a good first step would be an update to the=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
dom0less document. Provide a note at the beginning that points to the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
hyperlaunch design doc as a more general approach that will eventually subs=
ume<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
dom0less. This would provide a gentler transition for exist users of dom0le=
ss.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt;<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
If it is not too much, I would also ask, please have a look at the design f=
or<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
boot modules in the series Christopher just posted. The design pulls from t=
he<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
work done by dom0less and expanded upon it. I major step into merging the t=
wo<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
capabilities will be to have a common set of structures. Once those are in<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
place, we can move to a common device tree representation, and at that poin=
t<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
we would be fairly close, if not at the point of a formal merger of between=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;&gt; =
the two.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; At t=
he moment we have a concrete problem with explaining dom0less and<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; hype=
rlaunch to potential new users. Using two different names for a<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; simi=
lar feature on arm and x86 causes confusion. It is hurting Xen as a<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; solu=
tion. Personally I already had to switch to use the word<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; &quo=
t;hyperlaunch&quot; for everything in my users-facing presentations.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; At t=
he summit, we discussed that it would be a good idea to use a single<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; name=
 to refer to both features on arm and x86. Given that &quot;dom0less&quot;<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; caus=
es additional issues because it makes people think that there is no<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; Dom0=
, the suggestion was to use &quot;hyperlaunch&quot; to refer to both featur=
es.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; We d=
on&#39;t need to 100% align the two implementations and data structures.<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; This=
 is not for engineers that are going to look at the specifications<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; and =
improve them. This is for users/customers of Xen that are trying to<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; unde=
rstand what the hypervisor enables them to do. We need to be able to<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; show=
 users architecture slides with the same name and explanation on<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; both=
 ARM and x86.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; I am=
 sure that Daniel and Christopher remember, but for the others on<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; this=
 email thread, the name &quot;hyperlaunch&quot; was born exactly to be that=
:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; the =
one name to cover both features on ARM and x86 even if they have a<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; diff=
erent implementation. Appended an old email for reference.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; Also=
 I agree with Daniel that we need to be careful about the two docs<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; unde=
r docs/. I think he is right we need to add a paragraph explaining<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; the =
history and a pointer to the other document. Something like:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; &quo=
t;Dom0less is the name that was used when initially introducing the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; feat=
ure on ARM. Then, the &quot;dom0less&quot; name was retired in favor of<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; &quo=
t;hyperlaunch&quot; to avoid confusion (a Dom0 might still be present) and =
to<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; alig=
n with x86 (where a similar feature was called hyperlaunch from the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;&gt; star=
t).&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; I=E2=80=
=99m fully ok to add a section like this pointing to the Hyperlaunch design=
.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0_If_ this tex=
t is added, please include links/references to the Hyperlaunch wiki page an=
d Hyperlaunch design docs.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; @Daniel =
and @Christopher would it be ok for you or the changes in the serie<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; are goin=
g to be problematic for your future work? In the end it=E2=80=99s just a me=
chanical<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; rename, =
so I guess we just need to agree on naming conventions.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Please see th=
e history of trademark litigation about the use of symbolic names to refere=
nce similar-but-different<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0artifacts.=C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0It is much ea=
sier to use the same name to refer to entirely different objects. Historica=
lly, confusion arises when a<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0name is<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0used in simil=
ar contexts.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0There is also=
 versioning.=C2=A0 Could we refer to dom0less as &quot;Hyperlaunch Version =
-1&quot;?<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0How about ren=
aming dom0less to &quot;Hyperlaunch Lite&quot;?<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; Perhaps it would be helpful if you coul=
d explain more clearly your concerns.=C2=A0 I take it that you want a name =
which can be<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0used specifically<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; to indicate the full &quot;domB measure=
d boot&quot; functionality that was Daniel and Christopher&#39;s original g=
oal, and that you&#39;re<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0afraid that using<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; plain &quot;Hyperlaunch&quot; for only =
the &quot;start VMs from Xen on boot&quot; functionality will dilute that?<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; The &quot;start VMs from Xen on boot&qu=
ot; functionality is the *only* thing that a big chunk of the users of this=
 functionality want;=C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0referring to<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; it as &quot;Hyperlaunch Lite&quot; or &=
quot;Hyperlaunch -1&quot; will undermine the value of the functionality.<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; What if we use &quot;Measured Hyperlaun=
ch&quot;, or &quot;Hyperlaunch Measured Boot&quot; to refer to the full mea=
sured boot functionality?<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0I think this is the best way.<br>
&gt; <br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; Or, &quot;Hyperlaunch DT&quot; for &quo=
t;Booting VMs from Xen using Device Tree&quot; (without the involvement of =
a domB), &quot;Hyperlaunch Boot<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Domain /<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; Hyperlaunch domB&quot; for a more gener=
al &quot;domB&quot; functionality, and &quot;Hyperlaunch Measured Boot&quot=
; for the full functionality<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0(assuming there&#39;s<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&gt; more to this than simply having a domB =
involved)?<br>
&gt; <br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0We need an overarching name to cover the fea=
ture &quot;start VMs from Xen on<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0boot&quot; on both ARM and x86. From my unde=
rstanding and from the original<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0emails on the subject, the name &quot;hyperl=
aunch&quot; was it.<br>
&gt; <br>
&gt; <br>
&gt; Sure; but think &quot;guitar&quot; vs &quot;acoustic guitar&quot; vs &=
quot;electric guitar&quot;.=C2=A0 &quot;Electric guitar&quot; is new, &quot=
;guitar&quot; covers them both, but you sometimes<br>
&gt; need a way to specify &quot;acoustic&quot;.=C2=A0 Right now target con=
figurations we&#39;re talking about include:<br>
&gt; <br>
&gt; 1. Booting all your domains directly from Xen using DT configurations<=
br>
&gt; 2. Booting a domB, which then executes some more complicated programma=
tic configuration to launch VMs before disappearing<br>
&gt; 3. Doing full measured boot on the whole system using a domB.<br>
&gt; <br>
&gt; If &quot;Hyperlaunch&quot; means 1-3, we not only need a way to specif=
y that you&#39;re talking about 3, but *also* a way to specify that you&#39=
;re talking<br>
&gt; about 1.=C2=A0 In the vast majority of cases for the foreseeable futur=
e are=C2=A0going to be 1.=C2=A0 Additionally, we want to make sure that<br>
&gt; &quot;Hyperlaunch&quot; *actually* turns out to mean 1-3, and not just=
 1.<br>
&gt; <br>
&gt; The thing I like about &quot;Hyperlaunch DT&quot; is that to me it sou=
nds pretty cool but also is very descriptive: I haven&#39;t talked to peopl=
e<br>
&gt; building these systems, but it seems like saying, &quot;The hypervisor=
 launches VMs based on a Device Tree passed to it at boot&quot; will be<br>
&gt; immediately understood, and stick in people&#39;s minds.<br>
&gt; <br>
&gt; So maybe informally, or in &quot;short usage&quot; use &quot;Hyperlaun=
ch&quot;, but in documentation or reference systems, when talking specifica=
lly about #1,<br>
&gt; try to use &quot;Hyperlaunch DT&quot;, just to reinforce the idea that=
 there&#39;s more to Hyperlaunch that&#39;s coming down the road?<br>
<br>
&quot;Hyperlaunch DT&quot; would refer to both the x86 and ARM implementati=
ons<br>
because they are both based on DT.<br>
<br>
I think it is better than &quot;Hyperlaunch Lite&quot; but I am not a fan o=
f<br>
either of these two names because &quot;DT&quot; and &quot;Lite&quot; get e=
asily lost in<br>
presentations and discussions. For the next few years many will talk<br>
about HyperLaunch just to refer to what is Dom0less today. So if the<br>
goal when we say &quot;HyperLaunch&quot; is to bring Measure Boot or XSM to=
<br>
people&#39;s minds, I don&#39;t think this will work well.<br>
<br>
If we want to keep &quot;Hyperlaunch&quot; to mean 1-3 above, highlighting =
Measure<br>
Boot or XSM, then I think we should consider using &quot;Dom0less&quot; for=
 1.<br>
Yes, it is misleding, but at least it is unique, and a google search for<br=
>
&quot;dom0less&quot; leads the user to the right results.<br>
<br>
If we do that, we should rename &quot;Hyperlaunch&quot; with &quot;Dom0less=
&quot; in<br>
docs/designs/launch/hyperlaunch.rst. That&#39;s because &quot;Hyperlaunch&q=
uot; is<br>
defined as &quot;the ability of a hypervisor to construct and start one or<=
br>
more virtual machines at system launch in a specific way&quot;, which falls=
<br>
under Dom0less in this discussion.<br>
<br>
In my opinion, it is better to have specific names for specific<br>
features. So I would use &quot;HyperLaunch&quot; to mean &quot;the ability =
of a<br>
hypervisor to construct and start one or more virtual machines at system<br=
>
launch in a specific way&quot; as it is defined today.<br>
<br>
When we add Measure Boot or XSM or other security/safety features, I<br>
would call them out specifically. For instance, &quot;HyperLaunch with XSM&=
quot;.<br>
It is more descriptive and highlights each feature.<br>
<br>
Note that at AMD we&#39;ll need HyperLaunch without an all-powerful Dom0,<b=
r>
probably with XSM. So I am not writing this because I don&#39;t think the<b=
r>
other features 2-3 are not important. They definitely are important.</block=
quote><div><br></div><div><br>Thanks to all the participants in this thread=
 for the interest in Hyperlaunch and<br>the support for enabling common adv=
anced boot functionality for Xen across<br>architectures.<br><br>I&#39;m ai=
ming to provide here a hopefully-fairly-objective overview of the issues<br=
>being raised so that we can ensure that these are covered, and then I will=
 also<br>give my views afterwards.<br><br>---------------------------------=
---------------------------<br>=3D Naming and communication<br><br>- Ensuri=
ng expectations are set correctly for the Hyperlaunch name<br>=C2=A0 =C2=A0=
 - communicating the value of it, differentiation for Xen<br>=C2=A0 =C2=A0 =
- avoiding sub-branding it for feature subsets, use cases, technologies<br>=
<br>- Retiring the term &#39;dom0less&#39;<br><br>- How to describe the &qu=
ot;starting multiple VMs at host boot&quot; functionality<br><br>=C2=A0 =C2=
=A0 - How to describe further Hyperlaunch functionality beyond this<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 - eg. isolation properties and relevance to critic=
al systems<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 - eg. running without a classic d=
om0<br><br>=C2=A0 =C2=A0 - How Hyperlaunch relates to other boot functional=
ities and technologies,<br>=C2=A0 =C2=A0 =C2=A0 including:<br>=C2=A0 =C2=A0=
 =C2=A0 =C2=A0 - architecture-specific aspects and architecture-neutral asp=
ects<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 - Device Tree<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 - boot domain<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 - control domain, hardw=
are domain, dom0<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 - domain builder<br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 - system measurement<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 - =
XSM<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 - DRTM<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 - =
etc.<br><br><br>=3D Migration<br><br>- Providing a forward path for existin=
g users of dom0less functionality<br>across the technical changes for Hyper=
launch cross-architecture implementation<br>=C2=A0 =C2=A0 - document compat=
ibility<br>=C2=A0 =C2=A0 - support a &quot;dom0less mode&quot; with existin=
g Device Tree structure<br>=C2=A0 =C2=A0 - documentation updates to be pair=
ed with progress on code implementation<br><br><br>=3D Community resourcing=
<br><br>- Supporting code review and merge of Hyperlaunch changes into Xen<=
br>=C2=A0 =C2=A0 - transitioning existing Arm logic into common, including =
FDT<br><br>- Provision of accurate, consistent documentation materials to s=
upport<br>effective communication to existing and prospective users, develo=
pers and other<br>stakeholders<br>=C2=A0 =C2=A0 =C2=A0- Ensuring that the d=
ocument structure supports ongoing maintenance:<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 - Multiple use cases, structure docs accordingly: eg.<br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 - use case: static partitioning, critical + non=
-critical VMs<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 - use case: meas=
ured launch with a boot domain<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 - use case: fast VM start for embedded systems<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 - Architecture of Hyperlaunch, relevance to other hypervisors<br>=C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 - nested systems<br><br>- Design, revie=
w and agreement for common cross-architecture and<br>=C2=A0 arch-extensible=
 interfaces, including:<br>=C2=A0 =C2=A0 - common boot data structures<br>=
=C2=A0 =C2=A0 - Device Tree structure<br>=C2=A0 =C2=A0 - hypfs entries<br>=
=C2=A0 =C2=A0 - introspection to determine hyperlaunched system status<br><=
br>- Development of test cases<br><br>- CI of Hyperlaunch interfaces, to en=
sure that it stays working<br>=C2=A0 <br>----------------------------------=
--------------------------<br><br>Views arrived at in discussion with Rich =
and Daniel, and after reading the<br>thread contributions, follow this poin=
t.<br><br>&quot;Hyperlaunch&quot; is to be the common name across architect=
ures for a flexible,<br>configurable boot system for coordinating the launc=
h of multiple VMs by the<br>hypervisor, with a common implementation, pooli=
ng resources and development<br>risk across the Xen community. The interfac=
es are core to it.<br><br>From the Hyperlaunch design document (reviewed + =
committed to the tree):<br><br>&quot;The design enables seamless transition=
 for existing systems that require a dom0, and provides a new general capab=
ility to build and launch alternative configurations of virtual machines, i=
ncluding support for static partitioning and accelerated start of VMs durin=
g host boot, while adhering to the principles of least privilege. It incorp=
orates the existing dom0less functionality, extended to fold in the new dev=
elopments from the Hyperlaunch project, with support for both x86 and Arm p=
latform architectures, building upon and replacing the earlier &#39;late ha=
rdware domain&#39; feature for disaggregation of dom0.<br><br>Hyperlaunch i=
s designed to be flexible and reusable across multiple use cases, and our a=
im is to ensure that it is capable, widely exercised, comprehensively teste=
d, and well understood by the Xen community.&quot;<br><br><a href=3D"https:=
//xenbits.xen.org/docs/4.17-testing/designs/launch/hyperlaunch.html" target=
=3D"_blank">https://xenbits.xen.org/docs/4.17-testing/designs/launch/hyperl=
aunch.html</a><br><br>ie.=C2=A0 Hyperlaunch was created to move away from p=
oint solutions that hard-code<br>specific launch configurations, isolation =
properties and threat models. It<br>isn&#39;t just about starting domains -=
- it is about enabling the construction of<br>complex use cases runtimes fo=
r Xen. It is the result of iterative design<br>starting with the disaggrega=
tion for the late hardware domain, through<br>dom0less development and then=
 with the comprehensive hyperlaunch design and<br>implementation that build=
s upon them both.<br><br>The current interest and investment in Hyperlaunch=
 is driven by its relevance<br>to Safety Critical systems due to the isolat=
ion properties and improvement<br>in the ability to certify the software --=
 this is closely related to but<br>slightly different from starting multipl=
e VMs at host boot.<br><br>To encourage commonality and allow for future de=
velopment, we should not<br>use architecture-specific or vendor-specific na=
me variations, and also avoid<br>technology-specific name variations (eg. D=
evice Tree or &quot;DT&quot;).<br><br>Instead, the use case configurations =
should themselves be describable.<br><br>Thanks again,<br><br>Christopher<b=
r></div><div>=C2=A0</div></div></div>
</blockquote></div></div>

--00000000000041c81b05ffeddd75--


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 01:17:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 01:17:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560640.876714 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHwZb-0003iW-O0; Sat, 08 Jul 2023 01:17:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560640.876714; Sat, 08 Jul 2023 01:17:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHwZb-0003iP-KK; Sat, 08 Jul 2023 01:17:19 +0000
Received: by outflank-mailman (input) for mailman id 560640;
 Sat, 08 Jul 2023 01:17:19 +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
 <SRS0=t/Rp=C2=amd.com=stefano.stabellini@srs-se1.protection.inumbo.net>)
 id 1qHwZa-0003iJ-JF
 for xen-devel@lists.xenproject.org; Sat, 08 Jul 2023 01:17:18 +0000
Received: from NAM04-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam04on2060d.outbound.protection.outlook.com
 [2a01:111:f400:7e8c::60d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 29c42f1b-1d2d-11ee-8611-37d641c3527e;
 Sat, 08 Jul 2023 03:17:12 +0200 (CEST)
Received: from DS7PR03CA0121.namprd03.prod.outlook.com (2603:10b6:5:3b4::6) by
 DM4PR12MB5165.namprd12.prod.outlook.com (2603:10b6:5:394::9) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6565.26; Sat, 8 Jul 2023 01:17:06 +0000
Received: from DM6NAM11FT105.eop-nam11.prod.protection.outlook.com
 (2603:10b6:5:3b4:cafe::e4) by DS7PR03CA0121.outlook.office365.com
 (2603:10b6:5:3b4::6) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.25 via Frontend
 Transport; Sat, 8 Jul 2023 01:17:06 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 DM6NAM11FT105.mail.protection.outlook.com (10.13.173.164) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6521.45 via Frontend Transport; Sat, 8 Jul 2023 01:17:06 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 7 Jul
 2023 20:17:05 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 7 Jul
 2023 20:17:05 -0500
Received: from ubuntu-20.04.2-arm64.shared (10.180.168.240) by
 SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.23 via Frontend Transport; Fri, 7 Jul 2023 20:17:03 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 29c42f1b-1d2d-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=YpWoCWrjiZXt12eK8VSIS/kahYT5WX08TmisrmSMUppJ/nXIMfR5+gOp8ayqwQiZwK+7MLRX3Uk9p3ZB8bHQGL5PwLhWTkczV1ONe9RBUrc8i3dqJ8ySJnFMSCLCJP9V2w5sqkn16g/V9FymXl1yT5rTvIA+d420WeScTHm+8cltwYAns1jnzpdiarK+jWkbOOkIDtKNbKZMPYz2Tymwt3aMaTMovoC4WghajF4ATs8FAErtezUwGwDefV2yA7FTF2Qfm09olKIPHzq2FA7SBmNAb0F2DpPElJ63ZI6EJcFFTpr0g1c8siMa3i5/t4/noNZa4EcGxxLEmc7XXp6MpQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=fLR9Q4mQs9KL8Xrz/4djMQJidsGyBOU6DXhcGqvsxhk=;
 b=K+z9V312udb7Ey0vPPwnKxuMWGOvjerJi2Pz6D+MGNJbE2KTkOKv+5XYnHtvYEdTBdeTyfthWNBdOOsJJ8fv+49sfOsU90l7tK1QQtcViFj/h2vvHJnBlcE3iSa3AlprR0X+5BtpiAQ9INUJrs4x9ZOEUCUi+s6bMfojUL/bVaLJvGjE8OU3h8IahHt4H5uGe6e768qFRPkYG/RmVhWQADmepPbgG8OAsluloa3+GzUTOc5i7TI6nQoeCneUI/4sxQFUs5vYFM8iuErVUTsfMykWVJ2MSKWCmsVKKMr0n1wks78mQvwgFPunjMpszd12ZtKQIN30ZJ2j02W7VIqJxQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fLR9Q4mQs9KL8Xrz/4djMQJidsGyBOU6DXhcGqvsxhk=;
 b=BsmCm5qsPfl7fS/lA9VUDa7AX73XTvOCvpaob5l7kqlL2YPYURsHqKiGJ2ljLYWsTG7fGBUeiM416RM4feUBY0MLkNSEKyjyHc7NEcx4+8CDNGBvyFNriSaP7OktNzigdbOYKp4IPxdd6+F6jbwujGYlXePQYCdDeECQnTtdEbM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Date: Fri, 7 Jul 2023 18:17:02 -0700
From: Stefano Stabellini <stefano.stabellini@amd.com>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Christopher Clark <christopher.w.clark@gmail.com>
CC: Stefano Stabellini <stefano.stabellini@amd.com>, George Dunlap
	<george.dunlap@cloud.com>, P S <pairspace@gmail.com>, Luca Fancellu
	<luca.fancellu@arm.com>, Stefano Stabellini <sstabellini@kernel.org>, "Daniel
 P. Smith" <dpsmith@apertussolutions.com>, Andrew Cooper
	<Andrew.Cooper3@citrix.com>, Xen-devel <xen-devel@lists.xenproject.org>, "Wei
 Chen" <Wei.Chen@arm.com>, George Dunlap <george.dunlap@citrix.com>, "Jan
 Beulich" <jbeulich@suse.com>, Julien Grall <julien@xen.org>, Wei Liu
	<wl@xen.org>, Henry Wang <Henry.Wang@arm.com>, Community Manager
	<community.manager@xenproject.org>, Doug Goldstein <cardoe@cardoe.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>, Volodymyr Babchuk
	<volodymyr_babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Rian Quinn <rianquinn@gmail.com>, Ian Jackson <iwj@xenproject.org>,
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, Scott Davis
	<scott.davis@starlab.io>, Adam Fraser <adam@starlab.io>, Paul Durrant
	<paul@xen.org>, <rsmith@riversideresearch.org>, "m.a.young@durham.ac.uk"
	<m.a.young@durham.ac.uk>, Elliott Mitchell <ehem+xen@m5p.com>, openxt
	<openxt@googlegroups.com>, Jason Andryuk <jandryuk@gmail.com>,
	=?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
In-Reply-To: <CACMJ4GZSRp9R7EUVy4hp__uzy0E-L=X1Qt_ud-2VmcyXT3b6hg@mail.gmail.com>
Message-ID: <alpine.DEB.2.22.394.2307071814070.761183@ubuntu-linux-20-04-desktop>
References: <8601CDD7-87F7-4FD0-A6E6-BAEAB12E7956@arm.com> <234199F8-DBB1-42B6-9A4C-8800EEF60997@gmail.com> <CA+zSX=Y3_g_aq4+sDK7CuZajywVqQ4xOrq7hKZ80eUT3uSxzuQ@mail.gmail.com> <alpine.DEB.2.22.394.2307051436120.761183@ubuntu-linux-20-04-desktop>
 <CA+zSX=ashTi590+cVss_3zyLESC8S=zVSMLjTKD00s6xfjZbJA@mail.gmail.com> <alpine.DEB.2.22.394.2307061328540.761183@ubuntu-linux-20-04-desktop> <CACMJ4GYWoyCQMWX8VtpwChk7hHxL-u0Mo-kKX8Qmr1oKf91Hyg@mail.gmail.com>
 <CACMJ4GZSRp9R7EUVy4hp__uzy0E-L=X1Qt_ud-2VmcyXT3b6hg@mail.gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="8323329-1124996708-1688779020=:761183"
Content-ID: <alpine.DEB.2.22.394.2307071817010.761183@ubuntu-linux-20-04-desktop>
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DM6NAM11FT105:EE_|DM4PR12MB5165:EE_
X-MS-Office365-Filtering-Correlation-Id: 9a2e68cd-ccc8-4152-ca86-08db7f510b7f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	aspPf9sFM+YkUwLUAWwrATON3+fUox0E3LQT9OiFXiYc06GPaUqH2BBMis6UxkENLd11T91/W/8T0awH5pS+QcDD1ZfB+scmZxvYvjjCWXChepIaxUY/kAwvQ5mlpFma4WynMBwk9h9galuM+/CfLTggIIHWmCRXMS5REdrgKHTpU6cGEjDuQc/YqIFeD15/lgcXOgUC4mpkoy69BpucGAuyxLlFmk3F1M8OLLE6IKrqvdPRfD+nFioi6YIqO+0FswSUdA13D+hR0Q1U/MzKBYJ8o6CdLainX+0xmr848CaP/7yR3TWziqR6P8UfPb7C2ybrII83mDlTC3+ZL58nvUI2zHMLXfgMv18//iu1izE1OgXUFmJwdwIW5A4Jval3QFG+b8jRkxPuqINJdUauGkuOTyVyuQbqs3W2ZYUM2HuUck1ysBvgRkZyFlzQmxaF9NYJNKSbVSq/J5zRyWo947VCyKt4MNi455Qe1VVRRxEE9fOQYB2PiikjPA2bC8S8T1IQCwIqIRBk1a0av0k6dZoZiWXFkRw1tMAjPLckZ06bAfZ5DpIwetVhnau0sHaoKj9mSXqyZXJeIXBw4rW1/333IXc9QN/QiQCeBAKe++TtqwNPh90+Gopvo1oIDnwwCjf08OG3Ax8Z/k5KEd6mfZ9X4mnl8AL7nAzYyZKPDWKP5Kbc07nsA9RrhGsnRE9ROiMCMQBvEbRJAI/7+SFMbDT7Rux2SoOfStoIrF3M8czIh+Scr6lI4L820PDu+O0ycQp0pbxDP7T/RSpoaOAkSEQ7I/VUdoFsDR3uAXA76LY=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(7916004)(4636009)(39860400002)(396003)(136003)(346002)(376002)(451199021)(40470700004)(46966006)(36840700001)(478600001)(33964004)(70586007)(54906003)(70206006)(53546011)(26005)(336012)(9686003)(966005)(186003)(30864003)(2906002)(33716001)(82310400005)(41300700001)(6916009)(4326008)(316002)(44832011)(7406005)(7416002)(5660300002)(8936002)(8676002)(81166007)(82740400003)(356005)(86362001)(47076005)(36860700001)(83380400001)(426003)(40460700003)(40480700001)(32563001)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2023 01:17:06.4278
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 9a2e68cd-ccc8-4152-ca86-08db7f510b7f
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DM6NAM11FT105.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5165

--8323329-1124996708-1688779020=:761183
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8BIT
Content-ID: <alpine.DEB.2.22.394.2307071817011.761183@ubuntu-linux-20-04-desktop>

On Fri, 7 Jul 2023, Christopher Clark wrote:
> +CC openxt, Jason, Marek
> 
> On Fri, Jul 7, 2023 at 2:06â€¯PM Christopher Clark <christopher.w.clark@gmail.com> wrote:
>       +CC members of the Hyperlaunch Working GroupÂ + participants on earlier Hyperlaunch threads
> 
> On Thu, Jul 6, 2023 at 2:39â€¯PM Stefano Stabellini <stefano.stabellini@amd.com> wrote:
>       On Thu, 6 Jul 2023, George Dunlap wrote:
>       > On Wed, Jul 5, 2023 at 11:14â€¯PM Stefano Stabellini <stefano.stabellini@amd.com> wrote:
>       >Â  Â  Â  Â On Wed, 5 Jul 2023, George Dunlap wrote:
>       >Â  Â  Â  Â > On Mon, Jul 3, 2023 at 9:55â€¯PM P S <pairspace@gmail.com> wrote:
>       >Â  Â  Â  Â >Â  Â  Â  Â > On Jul 3, 2023, at 15:45, Luca Fancellu <luca.fancellu@arm.com> wrote:
>       >Â  Â  Â  Â >Â  Â  Â  Â ï»¿>
>       >Â  Â  Â  Â >Â  Â  Â  Â >> On 3 Jul 2023, at 18:48, Stefano Stabellini <sstabellini@kernel.org> wrote:
>       >Â  Â  Â  Â >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> On Mon, 3 Jul 2023, Daniel P. Smith wrote:
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> On 7/1/23 11:13, Luca Fancellu wrote:
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>> On 1 Jul 2023, at 08:53, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>>
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>> On 30/06/2023 10:12 am, Luca Fancellu wrote:
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>>> The "dom0less" feature was intended to be the feature where a domU
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>>> domain could be launched without the control domain (Dom0)
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>>> intervention, however the name seems to suggest that Dom0 cannot
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>>> be part of the configuration, while instead it's a possible use case.
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>>>
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>>> To avoid that, rename the "dom0less" configuration with the name
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>>> "hyperlaunch", that is less misleading.
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>>>
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>>> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>>> ---
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>>> This is an RFC to get the feeling of the community about the name
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>>> change, for now it's everything in one patch just to see how it
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>>> will look like, if there is interest on proceeding into it, I can
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>>> split in more commit.
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>>
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>> Have you discussed this with Dan and Chris at all?Â  You haven't even
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>> CC'd them.
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>> No, this rename idea started from a chat during the summit, anyway Julien
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>> promptly add them to the CC, because I forgot.
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> No worries and thank you for considering and taking the time to do this RFC.
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> It is greatly appreciated that there is a strong willingness to have dom0less
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> and hyperlaunch merged.
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>>
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>> While there is a lot of end-goal in common between the dom0less and
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>> hyperlaunch, and that the name dom0less is deeply misleading,
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>> hyperlaunch is specifically not this.
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>>
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>> Yes Hyperlaunch is more than this, however as I said, with this RFC I would
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>> like
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>> to ear opinions, @Daniel @Christopher could it be a proper name for the
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>> dom0less
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>> feature?
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> As Andy has alluded, hyperlaunch is meant to provide a flexible means to
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> handle domain construction at boot to meet a wide range of possible use cases.
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> One of those use cases is dom0less, so yes, ultimately what dom0less does
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> today will be achievable under hyperlaunch. Our intended approach to align the
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> two implementations is one that is meant to be minimally disruptive, since
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> dom0less is considered a supported (SUPPORT.md) capability. As mentioned, we
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> are greatly appreciative to the openness to adopt the name,
>       >Â  Â  Â  Â >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >Â  Â  Â  Â >> Thanks Daniel!
>       >Â  Â  Â  Â >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> but a big concern
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> I personally have is the confusion it could cause a general user. A blanket
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> rename would end up with two documents in the docs tree that provide two
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> different explanations of hyperlaunch and two different device tree
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> definitions. So I think a more measured approach should be considered here.
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>> If this patch makes things more difficult for the Hyperlunch serie, Iâ€™m ok
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>> to drop it,
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>> my only aim was just to find a less misleading name for the feature.
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> What I would like to suggest as a good first step would be an update to the
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> dom0less document. Provide a note at the beginning that points to the
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> hyperlaunch design doc as a more general approach that will eventually subsume
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> dom0less. This would provide a gentler transition for exist users of dom0less.
>       >Â  Â  Â  Â >Â  Â  Â  Â >>>
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> If it is not too much, I would also ask, please have a look at the design for
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> boot modules in the series Christopher just posted. The design pulls from the
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> work done by dom0less and expanded upon it. I major step into merging the two
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> capabilities will be to have a common set of structures. Once those are in
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> place, we can move to a common device tree representation, and at that point
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> we would be fairly close, if not at the point of a formal merger of between
>       >Â  Â  Â  Â >Â  Â  Â  Â >>> the two.
>       >Â  Â  Â  Â >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >Â  Â  Â  Â >> At the moment we have a concrete problem with explaining dom0less and
>       >Â  Â  Â  Â >Â  Â  Â  Â >> hyperlaunch to potential new users. Using two different names for a
>       >Â  Â  Â  Â >Â  Â  Â  Â >> similar feature on arm and x86 causes confusion. It is hurting Xen as a
>       >Â  Â  Â  Â >Â  Â  Â  Â >> solution. Personally I already had to switch to use the word
>       >Â  Â  Â  Â >Â  Â  Â  Â >> "hyperlaunch" for everything in my users-facing presentations.
>       >Â  Â  Â  Â >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >Â  Â  Â  Â >> At the summit, we discussed that it would be a good idea to use a single
>       >Â  Â  Â  Â >Â  Â  Â  Â >> name to refer to both features on arm and x86. Given that "dom0less"
>       >Â  Â  Â  Â >Â  Â  Â  Â >> causes additional issues because it makes people think that there is no
>       >Â  Â  Â  Â >Â  Â  Â  Â >> Dom0, the suggestion was to use "hyperlaunch" to refer to both features.
>       >Â  Â  Â  Â >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >Â  Â  Â  Â >> We don't need to 100% align the two implementations and data structures.
>       >Â  Â  Â  Â >Â  Â  Â  Â >> This is not for engineers that are going to look at the specifications
>       >Â  Â  Â  Â >Â  Â  Â  Â >> and improve them. This is for users/customers of Xen that are trying to
>       >Â  Â  Â  Â >Â  Â  Â  Â >> understand what the hypervisor enables them to do. We need to be able to
>       >Â  Â  Â  Â >Â  Â  Â  Â >> show users architecture slides with the same name and explanation on
>       >Â  Â  Â  Â >Â  Â  Â  Â >> both ARM and x86.
>       >Â  Â  Â  Â >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >Â  Â  Â  Â >> I am sure that Daniel and Christopher remember, but for the others on
>       >Â  Â  Â  Â >Â  Â  Â  Â >> this email thread, the name "hyperlaunch" was born exactly to be that:
>       >Â  Â  Â  Â >Â  Â  Â  Â >> the one name to cover both features on ARM and x86 even if they have a
>       >Â  Â  Â  Â >Â  Â  Â  Â >> different implementation. Appended an old email for reference.
>       >Â  Â  Â  Â >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >Â  Â  Â  Â >> Also I agree with Daniel that we need to be careful about the two docs
>       >Â  Â  Â  Â >Â  Â  Â  Â >> under docs/. I think he is right we need to add a paragraph explaining
>       >Â  Â  Â  Â >Â  Â  Â  Â >> the history and a pointer to the other document. Something like:
>       >Â  Â  Â  Â >Â  Â  Â  Â >>
>       >Â  Â  Â  Â >Â  Â  Â  Â >> "Dom0less is the name that was used when initially introducing the
>       >Â  Â  Â  Â >Â  Â  Â  Â >> feature on ARM. Then, the "dom0less" name was retired in favor of
>       >Â  Â  Â  Â >Â  Â  Â  Â >> "hyperlaunch" to avoid confusion (a Dom0 might still be present) and to
>       >Â  Â  Â  Â >Â  Â  Â  Â >> align with x86 (where a similar feature was called hyperlaunch from the
>       >Â  Â  Â  Â >Â  Â  Â  Â >> start)."
>       >Â  Â  Â  Â >Â  Â  Â  Â >
>       >Â  Â  Â  Â >Â  Â  Â  Â > Iâ€™m fully ok to add a section like this pointing to the Hyperlaunch design.
>       >Â  Â  Â  Â >
>       >Â  Â  Â  Â >Â  Â  Â  Â _If_ this text is added, please include links/references to the Hyperlaunch wiki page and Hyperlaunch
>       design docs.
>       >Â  Â  Â  Â >
>       >Â  Â  Â  Â >Â  Â  Â  Â > @Daniel and @Christopher would it be ok for you or the changes in the serie
>       >Â  Â  Â  Â >Â  Â  Â  Â > are going to be problematic for your future work? In the end itâ€™s just a mechanical
>       >Â  Â  Â  Â >Â  Â  Â  Â > rename, so I guess we just need to agree on naming conventions.
>       >Â  Â  Â  Â >
>       >Â  Â  Â  Â >Â  Â  Â  Â Please see the history of trademark litigation about the use of symbolic names to reference
>       similar-but-different
>       >Â  Â  Â  Â artifacts.Â 
>       >Â  Â  Â  Â >Â  Â  Â  Â It is much easier to use the same name to refer to entirely different objects. Historically, confusion
>       arises when a
>       >Â  Â  Â  Â name is
>       >Â  Â  Â  Â >Â  Â  Â  Â used in similar contexts.
>       >Â  Â  Â  Â >
>       >Â  Â  Â  Â >Â  Â  Â  Â There is also versioning.Â  Could we refer to dom0less as "Hyperlaunch Version -1"?
>       >Â  Â  Â  Â >
>       >Â  Â  Â  Â >Â  Â  Â  Â How about renaming dom0less to "Hyperlaunch Lite"?
>       >Â  Â  Â  Â >
>       >Â  Â  Â  Â >
>       >Â  Â  Â  Â > Perhaps it would be helpful if you could explain more clearly your concerns.Â  I take it that you want a name
>       which can be
>       >Â  Â  Â  Â used specifically
>       >Â  Â  Â  Â > to indicate the full "domB measured boot" functionality that was Daniel and Christopher's original goal, and
>       that you're
>       >Â  Â  Â  Â afraid that using
>       >Â  Â  Â  Â > plain "Hyperlaunch" for only the "start VMs from Xen on boot" functionality will dilute that?
>       >Â  Â  Â  Â >
>       >Â  Â  Â  Â > The "start VMs from Xen on boot" functionality is the *only* thing that a big chunk of the users of this
>       functionality want;Â 
>       >Â  Â  Â  Â referring to
>       >Â  Â  Â  Â > it as "Hyperlaunch Lite" or "Hyperlaunch -1" will undermine the value of the functionality.
>       >Â  Â  Â  Â >
>       >Â  Â  Â  Â > What if we use "Measured Hyperlaunch", or "Hyperlaunch Measured Boot" to refer to the full measured boot
>       functionality?
>       >
>       >Â  Â  Â  Â I think this is the best way.
>       >
>       >
>       >Â  Â  Â  Â > Or, "Hyperlaunch DT" for "Booting VMs from Xen using Device Tree" (without the involvement of a domB),
>       "Hyperlaunch Boot
>       >Â  Â  Â  Â Domain /
>       >Â  Â  Â  Â > Hyperlaunch domB" for a more general "domB" functionality, and "Hyperlaunch Measured Boot" for the full
>       functionality
>       >Â  Â  Â  Â (assuming there's
>       >Â  Â  Â  Â > more to this than simply having a domB involved)?
>       >
>       >
>       >Â  Â  Â  Â We need an overarching name to cover the feature "start VMs from Xen on
>       >Â  Â  Â  Â boot" on both ARM and x86. From my understanding and from the original
>       >Â  Â  Â  Â emails on the subject, the name "hyperlaunch" was it.
>       >
>       >
>       > Sure; but think "guitar" vs "acoustic guitar" vs "electric guitar".Â  "Electric guitar" is new, "guitar" covers them
>       both, but you sometimes
>       > need a way to specify "acoustic".Â  Right now target configurations we're talking about include:
>       >
>       > 1. Booting all your domains directly from Xen using DT configurations
>       > 2. Booting a domB, which then executes some more complicated programmatic configuration to launch VMs before
>       disappearing
>       > 3. Doing full measured boot on the whole system using a domB.
>       >
>       > If "Hyperlaunch" means 1-3, we not only need a way to specify that you're talking about 3, but *also* a way to specify
>       that you're talking
>       > about 1.Â  In the vast majority of cases for the foreseeable future areÂ going to be 1.Â  Additionally, we want to make
>       sure that
>       > "Hyperlaunch" *actually* turns out to mean 1-3, and not just 1.
>       >
>       > The thing I like about "Hyperlaunch DT" is that to me it sounds pretty cool but also is very descriptive: I haven't
>       talked to people
>       > building these systems, but it seems like saying, "The hypervisor launches VMs based on a Device Tree passed to it at
>       boot" will be
>       > immediately understood, and stick in people's minds.
>       >
>       > So maybe informally, or in "short usage" use "Hyperlaunch", but in documentation or reference systems, when talking
>       specifically about #1,
>       > try to use "Hyperlaunch DT", just to reinforce the idea that there's more to Hyperlaunch that's coming down the road?
> 
>       "Hyperlaunch DT" would refer to both the x86 and ARM implementations
>       because they are both based on DT.
> 
>       I think it is better than "Hyperlaunch Lite" but I am not a fan of
>       either of these two names because "DT" and "Lite" get easily lost in
>       presentations and discussions. For the next few years many will talk
>       about HyperLaunch just to refer to what is Dom0less today. So if the
>       goal when we say "HyperLaunch" is to bring Measure Boot or XSM to
>       people's minds, I don't think this will work well.
> 
>       If we want to keep "Hyperlaunch" to mean 1-3 above, highlighting Measure
>       Boot or XSM, then I think we should consider using "Dom0less" for 1.
>       Yes, it is misleding, but at least it is unique, and a google search for
>       "dom0less" leads the user to the right results.
> 
>       If we do that, we should rename "Hyperlaunch" with "Dom0less" in
>       docs/designs/launch/hyperlaunch.rst. That's because "Hyperlaunch" is
>       defined as "the ability of a hypervisor to construct and start one or
>       more virtual machines at system launch in a specific way", which falls
>       under Dom0less in this discussion.
> 
>       In my opinion, it is better to have specific names for specific
>       features. So I would use "HyperLaunch" to mean "the ability of a
>       hypervisor to construct and start one or more virtual machines at system
>       launch in a specific way" as it is defined today.
> 
>       When we add Measure Boot or XSM or other security/safety features, I
>       would call them out specifically. For instance, "HyperLaunch with XSM".
>       It is more descriptive and highlights each feature.
> 
>       Note that at AMD we'll need HyperLaunch without an all-powerful Dom0,
>       probably with XSM. So I am not writing this because I don't think the
>       other features 2-3 are not important. They definitely are important.
> 
> 
> 
> Thanks to all the participants in this thread for the interest in Hyperlaunch and
> the support for enabling common advanced boot functionality for Xen across
> architectures.
> 
> I'm aiming to provide here a hopefully-fairly-objective overview of the issues
> being raised so that we can ensure that these are covered, and then I will also
> give my views afterwards.
> 
> ------------------------------------------------------------
> = Naming and communication
> 
> - Ensuring expectations are set correctly for the Hyperlaunch name
> Â  Â  - communicating the value of it, differentiation for Xen
> Â  Â  - avoiding sub-branding it for feature subsets, use cases, technologies
> 
> - Retiring the term 'dom0less'
> 
> - How to describe the "starting multiple VMs at host boot" functionality
> 
> Â  Â  - How to describe further Hyperlaunch functionality beyond this
> Â  Â  Â  Â  - eg. isolation properties and relevance to critical systems
> Â  Â  Â  Â  - eg. running without a classic dom0
> 
> Â  Â  - How Hyperlaunch relates to other boot functionalities and technologies,
> Â  Â  Â  including:
> Â  Â  Â  Â  - architecture-specific aspects and architecture-neutral aspects
> Â  Â  Â  Â  - Device Tree
> Â  Â  Â  Â  - boot domain
> Â  Â  Â  Â  - control domain, hardware domain, dom0
> Â  Â  Â  Â  - domain builder
> Â  Â  Â  Â  - system measurement
> Â  Â  Â  Â  - XSM
> Â  Â  Â  Â  - DRTM
> Â  Â  Â  Â  - etc.
> 
> 
> = Migration
> 
> - Providing a forward path for existing users of dom0less functionality
> across the technical changes for Hyperlaunch cross-architecture implementation
> Â  Â  - document compatibility
> Â  Â  - support a "dom0less mode" with existing Device Tree structure
> Â  Â  - documentation updates to be paired with progress on code implementation
> 
> 
> = Community resourcing
> 
> - Supporting code review and merge of Hyperlaunch changes into Xen
> Â  Â  - transitioning existing Arm logic into common, including FDT
> 
> - Provision of accurate, consistent documentation materials to support
> effective communication to existing and prospective users, developers and other
> stakeholders
> Â  Â  Â - Ensuring that the document structure supports ongoing maintenance:
> Â  Â  Â  Â  - Multiple use cases, structure docs accordingly: eg.
> Â  Â  Â  Â  Â  Â  - use case: static partitioning, critical + non-critical VMs
> Â  Â  Â  Â  Â  Â  - use case: measured launch with a boot domain
> Â  Â  Â  Â  Â  Â  - use case: fast VM start for embedded systems
> Â  Â  Â  Â  - Architecture of Hyperlaunch, relevance to other hypervisors
> Â  Â  Â  Â  Â  Â  - nested systems
> 
> - Design, review and agreement for common cross-architecture and
> Â  arch-extensible interfaces, including:
> Â  Â  - common boot data structures
> Â  Â  - Device Tree structure
> Â  Â  - hypfs entries
> Â  Â  - introspection to determine hyperlaunched system status
> 
> - Development of test cases
> 
> - CI of Hyperlaunch interfaces, to ensure that it stays working
> Â 
> ------------------------------------------------------------
> 
> Views arrived at in discussion with Rich and Daniel, and after reading the
> thread contributions, follow this point.
> 
> "Hyperlaunch" is to be the common name across architectures for a flexible,
> configurable boot system for coordinating the launch of multiple VMs by the
> hypervisor, with a common implementation, pooling resources and development
> risk across the Xen community. The interfaces are core to it.
> 
> From the Hyperlaunch design document (reviewed + committed to the tree):
> 
> "The design enables seamless transition for existing systems that require a dom0, and provides a new general capability to build and
> launch alternative configurations of virtual machines, including support for static partitioning and accelerated start of VMs during
> host boot, while adhering to the principles of least privilege. It incorporates the existing dom0less functionality, extended to fold
> in the new developments from the Hyperlaunch project, with support for both x86 and Arm platform architectures, building upon and
> replacing the earlier 'late hardware domain' feature for disaggregation of dom0.
> 
> Hyperlaunch is designed to be flexible and reusable across multiple use cases, and our aim is to ensure that it is capable, widely
> exercised, comprehensively tested, and well understood by the Xen community."
> 
> https://xenbits.xen.org/docs/4.17-testing/designs/launch/hyperlaunch.html
> 
> ie.Â  Hyperlaunch was created to move away from point solutions that hard-code
> specific launch configurations, isolation properties and threat models. It
> isn't just about starting domains -- it is about enabling the construction of
> complex use cases runtimes for Xen. It is the result of iterative design
> starting with the disaggregation for the late hardware domain, through
> dom0less development and then with the comprehensive hyperlaunch design and
> implementation that builds upon them both.
> 
> The current interest and investment in Hyperlaunch is driven by its relevance
> to Safety Critical systems due to the isolation properties and improvement
> in the ability to certify the software -- this is closely related to but
> slightly different from starting multiple VMs at host boot.
> 
> To encourage commonality and allow for future development, we should not
> use architecture-specific or vendor-specific name variations, and also avoid
> technology-specific name variations (eg. Device Tree or "DT").
> 
> Instead, the use case configurations should themselves be describable.

Thanks Christopher, Daniel and all!

So if I understand correctly, you are in favor if renaming Dom0less to
Hyperlaunch throughout the Xen codebase? And we need a clarification of
the docs/, especially docs/features/dom0less.pandoc?
--8323329-1124996708-1688779020=:761183--


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 02:03:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 02:03:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560646.876724 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHxIP-0000yt-6p; Sat, 08 Jul 2023 02:03:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560646.876724; Sat, 08 Jul 2023 02:03:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHxIP-0000ym-3b; Sat, 08 Jul 2023 02:03:37 +0000
Received: by outflank-mailman (input) for mailman id 560646;
 Sat, 08 Jul 2023 02:03:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NYjS=C2=gmail.com=persaur@srs-se1.protection.inumbo.net>)
 id 1qHxIN-0000yg-S0
 for xen-devel@lists.xenproject.org; Sat, 08 Jul 2023 02:03:36 +0000
Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com
 [2607:f8b0:4864:20::b29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a344e42a-1d33-11ee-b237-6b7b168915f2;
 Sat, 08 Jul 2023 04:03:32 +0200 (CEST)
Received: by mail-yb1-xb29.google.com with SMTP id
 3f1490d57ef6-bad0c4f6f50so3762692276.1
 for <xen-devel@lists.xenproject.org>; Fri, 07 Jul 2023 19:03:32 -0700 (PDT)
Received: from smtpclient.apple (static-198-54-130-88.cust.tzulo.com.
 [198.54.130.88]) by smtp.gmail.com with ESMTPSA id
 x37-20020a25a028000000b00c3ad527cba0sm1305242ybh.36.2023.07.07.19.03.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 07 Jul 2023 19:03:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a344e42a-1d33-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688781811; x=1691373811;
        h=to:in-reply-to:cc:references:message-id:date:subject:mime-version
         :from:content-transfer-encoding:from:to:cc:subject:date:message-id
         :reply-to;
        bh=S72pRScCJOdQzkJRWgbfet9M/DX2uLOf6TSuLy2sGLY=;
        b=aqBQ5c/syZzD9lboMwfTSFN8eCb3dizgNsw+GsMyb57acZLimI+o/KTRjiFNf/w7uv
         9r78HOpSMGuofnpfPaA/hwIQ6CgvBbYaU0Gu5PrgK0+6D8GKcGMTcsrtIwYorXBfhR35
         xoCr8cJ+uU+X/LnQ5nszQDc3yWPjrcKwIAwF7osOVMqG2ZUGb+txfdoK8HftEl6p44XR
         cHLQMzvkBJDiPe+T39oPzQg/N7NpyKcB35FFDrqrljfrPpKtvajdSb+TKizbpJlttCgy
         Wvc2NKa1zC1SduYpv3pJFqrloLvc7jQHRZE2Hz/ETT82sCIe8dym/Tr+opSTCWo12HUE
         kUVg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688781811; x=1691373811;
        h=to:in-reply-to:cc:references:message-id:date:subject:mime-version
         :from:content-transfer-encoding:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=S72pRScCJOdQzkJRWgbfet9M/DX2uLOf6TSuLy2sGLY=;
        b=mGxecuZ/V6iRdfr062ejXjBiTA9UVsttZE0P/7yhSyOrTVqrf5+bxFdLOMJD9NhI6d
         kpM5/16NDSZf+sxWu35gZ7d0rBL993tQOOjbFVj1wNOdVRBdZPwia8oowazUnIApPg3H
         dsWymH2qsEK1qKIONxBLd9Duya043wbGMp40IB3Srhufr7CnlWd3aJCQvyZiAbpG+XFs
         5cAXzy3zmiK+yR3mY5OChnith0bVRZXQh37cJIj/9OTuSJ43jutjknwyH7z3ZmnDX7Hb
         HmoajmXGy7OsTlGkdhHBPiIwrRzG7DS0bJNc+g0fIrRu+FsRsaceCGY//4UixId/RHvm
         t0/g==
X-Gm-Message-State: ABy/qLa+6/EJuWGPrLKZ1XUEKUUe/cM+4Epk/iBv2a8+LOCsqANDhRRn
	kGFepLvBIvo9XWftQzfGxIY=
X-Google-Smtp-Source: APBJJlFVCCXVv+aAfNV7Fy5Hs7Kdw4gvS06e8DquAU1ZBtudKS9g/k8OCRIsx0NdruYOyuoXh3Ymuw==
X-Received: by 2002:a25:e753:0:b0:c6e:a92c:70e3 with SMTP id e80-20020a25e753000000b00c6ea92c70e3mr1926128ybh.31.1688781810691;
        Fri, 07 Jul 2023 19:03:30 -0700 (PDT)
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
From: Rich Persaud <persaur@gmail.com>
Mime-Version: 1.0 (1.0)
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
Date: Fri, 7 Jul 2023 22:03:18 -0400
Message-Id: <7486398B-AEAE-4199-8DF1-B713FEECD672@gmail.com>
References: <alpine.DEB.2.22.394.2307071814070.761183@ubuntu-linux-20-04-desktop>
Cc: Christopher Clark <christopher.w.clark@gmail.com>,
 George Dunlap <george.dunlap@cloud.com>,
 Luca Fancellu <luca.fancellu@arm.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 Andrew Cooper <Andrew.Cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
 Henry Wang <Henry.Wang@arm.com>,
 Community Manager <community.manager@xenproject.org>,
 Doug Goldstein <cardoe@cardoe.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Anthony PERARD <anthony.perard@citrix.com>,
 Rian Quinn <rianquinn@gmail.com>, Ian Jackson <iwj@xenproject.org>,
 =?utf-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Scott Davis <scott.davis@starlab.io>, Adam Fraser <adam@starlab.io>,
 Paul Durrant <paul@xen.org>, rsmith@riversideresearch.org,
 m.a.young@durham.ac.uk, Elliott Mitchell <ehem+xen@m5p.com>,
 openxt <openxt@googlegroups.com>, Jason Andryuk <jandryuk@gmail.com>,
 =?utf-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
In-Reply-To: <alpine.DEB.2.22.394.2307071814070.761183@ubuntu-linux-20-04-desktop>
To: Stefano Stabellini <stefano.stabellini@amd.com>
X-Mailer: iPad Mail (20F75)

On Jul 7, 2023, at 21:17, Stefano Stabellini <stefano.stabellini@amd.com> wr=
ote:
>=20
> =EF=BB=BFOn Fri, 7 Jul 2023, Christopher Clark wrote:
>> +CC openxt, Jason, Marek
>>=20
>> On Fri, Jul 7, 2023 at 2:06=E2=80=AFPM Christopher Clark <christopher.w.c=
lark@gmail.com> wrote:
>>      +CC members of the Hyperlaunch Working Group + participants on earli=
er Hyperlaunch threads
>>=20
>> On Thu, Jul 6, 2023 at 2:39=E2=80=AFPM Stefano Stabellini <stefano.stabel=
lini@amd.com> wrote:
>>>      On Thu, 6 Jul 2023, George Dunlap wrote:
>>>> On Wed, Jul 5, 2023 at 11:14=E2=80=AFPM Stefano Stabellini <stefano.sta=
bellini@amd.com> wrote:
>>>>        On Wed, 5 Jul 2023, George Dunlap wrote:
>>>        > On Mon, Jul 3, 2023 at 9:55=E2=80=AFPM P S <pairspace@gmail.com=
> wrote:
>>>        >       > On Jul 3, 2023, at 15:45, Luca Fancellu <luca.fancellu@=
arm.com> wrote:
>>>        >       =EF=BB=BF>
>>>        >       >> On 3 Jul 2023, at 18:48, Stefano Stabellini <sstabelli=
ni@kernel.org> wrote:
>>>        >       >>
>>>        >       >>> On Mon, 3 Jul 2023, Daniel P. Smith wrote:
>>>        >       >>> On 7/1/23 11:13, Luca Fancellu wrote:
>>>        >       >>>>> On 1 Jul 2023, at 08:53, Andrew Cooper <andrew.coop=
er3@citrix.com> wrote:
>>>        >       >>>>>
>>>        >       >>>>> On 30/06/2023 10:12 am, Luca Fancellu wrote:
>>>        >       >>>>>> The "dom0less" feature was intended to be the feat=
ure where a domU
>>>        >       >>>>>> domain could be launched without the control domai=
n (Dom0)
>>>        >       >>>>>> intervention, however the name seems to suggest th=
at Dom0 cannot
>>>        >       >>>>>> be part of the configuration, while instead it's a=
 possible use case.
>>>        >       >>>>>>
>>>        >       >>>>>> To avoid that, rename the "dom0less" configuration=
 with the name
>>>        >       >>>>>> "hyperlaunch", that is less misleading.
>>>        >       >>>>>>
>>>        >       >>>>>> Signed-off-by: Luca Fancellu <luca.fancellu@arm.co=
m>
>>>        >       >>>>>> ---
>>>        >       >>>>>> This is an RFC to get the feeling of the community=
 about the name
>>>        >       >>>>>> change, for now it's everything in one patch just t=
o see how it
>>>        >       >>>>>> will look like, if there is interest on proceeding=
 into it, I can
>>>        >       >>>>>> split in more commit.
>>>        >       >>>>>
>>>        >       >>>>> Have you discussed this with Dan and Chris at all? =
 You haven't even
>>>        >       >>>>> CC'd them.
>>>        >       >>>>
>>>        >       >>>> No, this rename idea started from a chat during the s=
ummit, anyway Julien
>>>        >       >>>> promptly add them to the CC, because I forgot.
>>>        >       >>>
>>>        >       >>> No worries and thank you for considering and taking t=
he time to do this RFC.
>>>        >       >>> It is greatly appreciated that there is a strong will=
ingness to have dom0less
>>>        >       >>> and hyperlaunch merged.
>>>        >       >>>
>>>        >       >>>>>
>>>        >       >>>>> While there is a lot of end-goal in common between t=
he dom0less and
>>>        >       >>>>> hyperlaunch, and that the name dom0less is deeply m=
isleading,
>>>        >       >>>>> hyperlaunch is specifically not this.
>>>        >       >>>>
>>>        >       >>>> Yes Hyperlaunch is more than this, however as I said=
, with this RFC I would
>>>        >       >>>> like
>>>        >       >>>> to ear opinions, @Daniel @Christopher could it be a p=
roper name for the
>>>        >       >>>> dom0less
>>>        >       >>>> feature?
>>>        >       >>>
>>>        >       >>> As Andy has alluded, hyperlaunch is meant to provide a=
 flexible means to
>>>        >       >>> handle domain construction at boot to meet a wide ran=
ge of possible use cases.
>>>        >       >>> One of those use cases is dom0less, so yes, ultimatel=
y what dom0less does
>>>        >       >>> today will be achievable under hyperlaunch. Our inten=
ded approach to align the
>>>        >       >>> two implementations is one that is meant to be minima=
lly disruptive, since
>>>        >       >>> dom0less is considered a supported (SUPPORT.md) capab=
ility. As mentioned, we
>>>        >       >>> are greatly appreciative to the openness to adopt the=
 name,
>>>        >       >>
>>>        >       >> Thanks Daniel!
>>>        >       >>
>>>        >       >>
>>>        >       >>> but a big concern
>>>        >       >>> I personally have is the confusion it could cause a g=
eneral user. A blanket
>>>        >       >>> rename would end up with two documents in the docs tr=
ee that provide two
>>>        >       >>> different explanations of hyperlaunch and two differe=
nt device tree
>>>        >       >>> definitions. So I think a more measured approach shou=
ld be considered here.
>>>        >       >>>
>>>        >       >>>> If this patch makes things more difficult for the Hy=
perlunch serie, I=E2=80=99m ok
>>>        >       >>>> to drop it,
>>>        >       >>>> my only aim was just to find a less misleading name f=
or the feature.
>>>        >       >>>
>>>        >       >>> What I would like to suggest as a good first step wou=
ld be an update to the
>>>        >       >>> dom0less document. Provide a note at the beginning th=
at points to the
>>>        >       >>> hyperlaunch design doc as a more general approach tha=
t will eventually subsume
>>>        >       >>> dom0less. This would provide a gentler transition for=
 exist users of dom0less.
>>>        >       >>>
>>>        >       >>> If it is not too much, I would also ask, please have a=
 look at the design for
>>>        >       >>> boot modules in the series Christopher just posted. T=
he design pulls from the
>>>        >       >>> work done by dom0less and expanded upon it. I major s=
tep into merging the two
>>>        >       >>> capabilities will be to have a common set of structur=
es. Once those are in
>>>        >       >>> place, we can move to a common device tree representa=
tion, and at that point
>>>        >       >>> we would be fairly close, if not at the point of a fo=
rmal merger of between
>>>        >       >>> the two.
>>>        >       >>
>>>        >       >> At the moment we have a concrete problem with explaini=
ng dom0less and
>>>        >       >> hyperlaunch to potential new users. Using two differen=
t names for a
>>>        >       >> similar feature on arm and x86 causes confusion. It is=
 hurting Xen as a
>>>        >       >> solution. Personally I already had to switch to use th=
e word
>>>        >       >> "hyperlaunch" for everything in my users-facing presen=
tations.
>>>        >       >>
>>>        >       >> At the summit, we discussed that it would be a good id=
ea to use a single
>>>        >       >> name to refer to both features on arm and x86. Given t=
hat "dom0less"
>>>        >       >> causes additional issues because it makes people think=
 that there is no
>>>        >       >> Dom0, the suggestion was to use "hyperlaunch" to refer=
 to both features.
>>>        >       >>
>>>        >       >> We don't need to 100% align the two implementations an=
d data structures.
>>>        >       >> This is not for engineers that are going to look at th=
e specifications
>>>        >       >> and improve them. This is for users/customers of Xen t=
hat are trying to
>>>        >       >> understand what the hypervisor enables them to do. We n=
eed to be able to
>>>        >       >> show users architecture slides with the same name and e=
xplanation on
>>>        >       >> both ARM and x86.
>>>        >       >>
>>>        >       >> I am sure that Daniel and Christopher remember, but fo=
r the others on
>>>        >       >> this email thread, the name "hyperlaunch" was born exa=
ctly to be that:
>>>        >       >> the one name to cover both features on ARM and x86 eve=
n if they have a
>>>        >       >> different implementation. Appended an old email for re=
ference.
>>>        >       >>
>>>        >       >> Also I agree with Daniel that we need to be careful ab=
out the two docs
>>>        >       >> under docs/. I think he is right we need to add a para=
graph explaining
>>>        >       >> the history and a pointer to the other document. Somet=
hing like:
>>>        >       >>
>>>        >       >> "Dom0less is the name that was used when initially int=
roducing the
>>>        >       >> feature on ARM. Then, the "dom0less" name was retired i=
n favor of
>>>        >       >> "hyperlaunch" to avoid confusion (a Dom0 might still b=
e present) and to
>>>        >       >> align with x86 (where a similar feature was called hyp=
erlaunch from the
>>>        >       >> start)."
>>>        >       >
>>>        >       > I=E2=80=99m fully ok to add a section like this pointin=
g to the Hyperlaunch design.
>>>        >
>>>        >       _If_ this text is added, please include links/references t=
o the Hyperlaunch wiki page and Hyperlaunch
>>      design docs.
>>>        >
>>>        >       > @Daniel and @Christopher would it be ok for you or the c=
hanges in the serie
>>>        >       > are going to be problematic for your future work? In th=
e end it=E2=80=99s just a mechanical
>>>        >       > rename, so I guess we just need to agree on naming conv=
entions.
>>>        >
>>>        >       Please see the history of trademark litigation about the u=
se of symbolic names to reference
>>      similar-but-different
>>>        artifacts.=20
>>>        >       It is much easier to use the same name to refer to entire=
ly different objects. Historically, confusion
>>      arises when a
>>>        name is
>>>        >       used in similar contexts.
>>>        >
>>>        >       There is also versioning.  Could we refer to dom0less as "=
Hyperlaunch Version -1"?
>>>        >
>>>        >       How about renaming dom0less to "Hyperlaunch Lite"?
>>>        >
>>>        >
>>>        > Perhaps it would be helpful if you could explain more clearly y=
our concerns.  I take it that you want a name
>>      which can be
>>>        used specifically
>>>        > to indicate the full "domB measured boot" functionality that wa=
s Daniel and Christopher's original goal, and
>>      that you're
>>>        afraid that using
>>>        > plain "Hyperlaunch" for only the "start VMs from Xen on boot" f=
unctionality will dilute that?
>>>        >
>>>        > The "start VMs from Xen on boot" functionality is the *only* th=
ing that a big chunk of the users of this
>>      functionality want;=20
>>>        referring to
>>>        > it as "Hyperlaunch Lite" or "Hyperlaunch -1" will undermine the=
 value of the functionality.
>>>        >
>>>        > What if we use "Measured Hyperlaunch", or "Hyperlaunch Measured=
 Boot" to refer to the full measured boot
>>      functionality?
>>>=20
>>>        I think this is the best way.
>>>=20
>>>=20
>>>        > Or, "Hyperlaunch DT" for "Booting VMs from Xen using Device Tre=
e" (without the involvement of a domB),
>>      "Hyperlaunch Boot
>>>        Domain /
>>>        > Hyperlaunch domB" for a more general "domB" functionality, and "=
Hyperlaunch Measured Boot" for the full
>>      functionality
>>>        (assuming there's
>>>        > more to this than simply having a domB involved)?
>>>=20
>>>=20
>>>        We need an overarching name to cover the feature "start VMs from X=
en on
>>>        boot" on both ARM and x86. =46rom my understanding and from the o=
riginal
>>>        emails on the subject, the name "hyperlaunch" was it.
>>>=20
>>>=20
>>> Sure; but think "guitar" vs "acoustic guitar" vs "electric guitar".  "El=
ectric guitar" is new, "guitar" covers them
>>      both, but you sometimes
>>> need a way to specify "acoustic".  Right now target configurations we're=
 talking about include:
>>>=20
>>> 1. Booting all your domains directly from Xen using DT configurations
>>> 2. Booting a domB, which then executes some more complicated programmati=
c configuration to launch VMs before
>>      disappearing
>>> 3. Doing full measured boot on the whole system using a domB.
>>>=20
>>> If "Hyperlaunch" means 1-3, we not only need a way to specify that you'r=
e talking about 3, but *also* a way to specify
>>      that you're talking
>>> about 1.  In the vast majority of cases for the foreseeable future are g=
oing to be 1.  Additionally, we want to make
>>      sure that
>>> "Hyperlaunch" *actually* turns out to mean 1-3, and not just 1.
>>>=20
>>> The thing I like about "Hyperlaunch DT" is that to me it sounds pretty c=
ool but also is very descriptive: I haven't
>>      talked to people
>>> building these systems, but it seems like saying, "The hypervisor launch=
es VMs based on a Device Tree passed to it at
>>      boot" will be
>>> immediately understood, and stick in people's minds.
>>>=20
>>> So maybe informally, or in "short usage" use "Hyperlaunch", but in docum=
entation or reference systems, when talking
>>      specifically about #1,
>>> try to use "Hyperlaunch DT", just to reinforce the idea that there's mor=
e to Hyperlaunch that's coming down the road?
>>=20
>>      "Hyperlaunch DT" would refer to both the x86 and ARM implementations=

>>      because they are both based on DT.
>>=20
>>      I think it is better than "Hyperlaunch Lite" but I am not a fan of
>>      either of these two names because "DT" and "Lite" get easily lost in=

>>      presentations and discussions. For the next few years many will talk=

>>      about HyperLaunch just to refer to what is Dom0less today. So if the=

>>      goal when we say "HyperLaunch" is to bring Measure Boot or XSM to
>>      people's minds, I don't think this will work well.
>>=20
>>      If we want to keep "Hyperlaunch" to mean 1-3 above, highlighting Mea=
sure
>>      Boot or XSM, then I think we should consider using "Dom0less" for 1.=

>>      Yes, it is misleding, but at least it is unique, and a google search=
 for
>>      "dom0less" leads the user to the right results.
>>=20
>>      If we do that, we should rename "Hyperlaunch" with "Dom0less" in
>>      docs/designs/launch/hyperlaunch.rst. That's because "Hyperlaunch" is=

>>      defined as "the ability of a hypervisor to construct and start one o=
r
>>      more virtual machines at system launch in a specific way", which fal=
ls
>>      under Dom0less in this discussion.
>>=20
>>      In my opinion, it is better to have specific names for specific
>>      features. So I would use "HyperLaunch" to mean "the ability of a
>>      hypervisor to construct and start one or more virtual machines at sy=
stem
>>      launch in a specific way" as it is defined today.
>>=20
>>      When we add Measure Boot or XSM or other security/safety features, I=

>>      would call them out specifically. For instance, "HyperLaunch with XS=
M".
>>      It is more descriptive and highlights each feature.
>>=20
>>      Note that at AMD we'll need HyperLaunch without an all-powerful Dom0=
,
>>      probably with XSM. So I am not writing this because I don't think th=
e
>>      other features 2-3 are not important. They definitely are important.=

>>=20
>>=20
>>=20
>> Thanks to all the participants in this thread for the interest in Hyperla=
unch and
>> the support for enabling common advanced boot functionality for Xen acros=
s
>> architectures.
>>=20
>> I'm aiming to provide here a hopefully-fairly-objective overview of the i=
ssues
>> being raised so that we can ensure that these are covered, and then I wil=
l also
>> give my views afterwards.
>>=20
>> ------------------------------------------------------------
>> =3D Naming and communication
>>=20
>> - Ensuring expectations are set correctly for the Hyperlaunch name
>>     - communicating the value of it, differentiation for Xen
>>     - avoiding sub-branding it for feature subsets, use cases, technologi=
es
>>=20
>> - Retiring the term 'dom0less'
>>=20
>> - How to describe the "starting multiple VMs at host boot" functionality
>>=20
>>     - How to describe further Hyperlaunch functionality beyond this
>>         - eg. isolation properties and relevance to critical systems
>>         - eg. running without a classic dom0
>>=20
>>     - How Hyperlaunch relates to other boot functionalities and technolog=
ies,
>>       including:
>>         - architecture-specific aspects and architecture-neutral aspects
>>         - Device Tree
>>         - boot domain
>>         - control domain, hardware domain, dom0
>>         - domain builder
>>         - system measurement
>>         - XSM
>>         - DRTM
>>         - etc.
>>=20
>>=20
>> =3D Migration
>>=20
>> - Providing a forward path for existing users of dom0less functionality
>> across the technical changes for Hyperlaunch cross-architecture implement=
ation
>>     - document compatibility
>>     - support a "dom0less mode" with existing Device Tree structure
>>     - documentation updates to be paired with progress on code implementa=
tion
>>=20
>>=20
>> =3D Community resourcing
>>=20
>> - Supporting code review and merge of Hyperlaunch changes into Xen
>>     - transitioning existing Arm logic into common, including FDT
>>=20
>> - Provision of accurate, consistent documentation materials to support
>> effective communication to existing and prospective users, developers and=
 other
>> stakeholders
>>      - Ensuring that the document structure supports ongoing maintenance:=

>>         - Multiple use cases, structure docs accordingly: eg.
>>             - use case: static partitioning, critical + non-critical VMs
>>             - use case: measured launch with a boot domain
>>             - use case: fast VM start for embedded systems
>>         - Architecture of Hyperlaunch, relevance to other hypervisors
>>             - nested systems
>>=20
>> - Design, review and agreement for common cross-architecture and
>>   arch-extensible interfaces, including:
>>     - common boot data structures
>>     - Device Tree structure
>>     - hypfs entries
>>     - introspection to determine hyperlaunched system status
>>=20
>> - Development of test cases
>>=20
>> - CI of Hyperlaunch interfaces, to ensure that it stays working
>> =20
>> ------------------------------------------------------------
>>=20
>> Views arrived at in discussion with Rich and Daniel, and after reading th=
e
>> thread contributions, follow this point.
>>=20
>> "Hyperlaunch" is to be the common name across architectures for a flexibl=
e,
>> configurable boot system for coordinating the launch of multiple VMs by t=
he
>> hypervisor, with a common implementation, pooling resources and developme=
nt
>> risk across the Xen community. The interfaces are core to it.
>>=20
>> =46rom the Hyperlaunch design document (reviewed + committed to the tree)=
:
>>=20
>> "The design enables seamless transition for existing systems that require=
 a dom0, and provides a new general capability to build and
>> launch alternative configurations of virtual machines, including support f=
or static partitioning and accelerated start of VMs during
>> host boot, while adhering to the principles of least privilege. It incorp=
orates the existing dom0less functionality, extended to fold
>> in the new developments from the Hyperlaunch project, with support for bo=
th x86 and Arm platform architectures, building upon and
>> replacing the earlier 'late hardware domain' feature for disaggregation o=
f dom0.
>>=20
>> Hyperlaunch is designed to be flexible and reusable across multiple use c=
ases, and our aim is to ensure that it is capable, widely
>> exercised, comprehensively tested, and well understood by the Xen communi=
ty."
>>=20
>> https://xenbits.xen.org/docs/4.17-testing/designs/launch/hyperlaunch.html=

>>=20
>> ie.  Hyperlaunch was created to move away from point solutions that hard-=
code
>> specific launch configurations, isolation properties and threat models. I=
t
>> isn't just about starting domains -- it is about enabling the constructio=
n of
>> complex use cases runtimes for Xen. It is the result of iterative design
>> starting with the disaggregation for the late hardware domain, through
>> dom0less development and then with the comprehensive hyperlaunch design a=
nd
>> implementation that builds upon them both.
>>=20
>> The current interest and investment in Hyperlaunch is driven by its relev=
ance
>> to Safety Critical systems due to the isolation properties and improvemen=
t
>> in the ability to certify the software -- this is closely related to but
>> slightly different from starting multiple VMs at host boot.
>>=20
>> To encourage commonality and allow for future development, we should not
>> use architecture-specific or vendor-specific name variations, and also av=
oid
>> technology-specific name variations (eg. Device Tree or "DT").
>>=20
>> Instead, the use case configurations should themselves be describable.
>=20
> Thanks Christopher, Daniel and all!
>=20
> So if I understand correctly, you are in favor if renaming Dom0less to
> Hyperlaunch throughout the Xen codebase? And we need a clarification of
> the docs/, especially docs/features/dom0less.pandoc?

Christopher wrote:
>> =3D Community resourcing

Note the pre-requisite work items for upstream Xen, listed under "Community R=
esourcing", to merge code for Hyperlaunch common interfaces and test cases, w=
ith docs on configuration of Hyperlaunch to deliver functionality for dom0le=
ss use cases.

Thanks,
Rich=


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 03:24:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 03:24:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560650.876733 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHyYO-0000jm-Uh; Sat, 08 Jul 2023 03:24:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560650.876733; Sat, 08 Jul 2023 03:24:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qHyYO-0000jf-S5; Sat, 08 Jul 2023 03:24:12 +0000
Received: by outflank-mailman (input) for mailman id 560650;
 Sat, 08 Jul 2023 03:24:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHyYN-0000jV-BT; Sat, 08 Jul 2023 03:24:11 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHyYN-0004yw-4r; Sat, 08 Jul 2023 03:24:11 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qHyYM-0000Ch-Ot; Sat, 08 Jul 2023 03:24:10 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qHyYM-00059X-Ll; Sat, 08 Jul 2023 03:24:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=tRdDUI2Pkbsa6AEfhi3pLaKthkom89Q59+bwiMTAqy8=; b=I12TjE/QMyKUVn4g7FALtItNoP
	TYe6SmTWDXk+kKswEgnh4U0pq99FMWWfvEimxRyplDkJ6PHqwlGIjbArhmZ1uF+4p3bJIVjvoSJ13
	5epMAFCAbZw/X1CFnGbvVFrNjNmVdPym655kksS87SeKFXarZqpud2JNY1GdLwuZXTak=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181735-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181735: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pygrub:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/src_host:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:leak-check/basis(11):fail:allowable
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=4f6b6c2b2f86b7878a770736bf478d8a263ff0bc
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 08 Jul 2023 03:24:10 +0000

flight 181735 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181735/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-pygrub       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2 11 leak-check/basis(11)   fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64  8 xen-boot    fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd  8 xen-boot            fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-libvirt     12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd 12 debian-install          fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu 14 guest-start             fail REGR. vs. 180278
 test-amd64-amd64-xl          12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 12 xen-boot/src_host       fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds     11 leak-check/basis(11)     fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                4f6b6c2b2f86b7878a770736bf478d8a263ff0bc
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   82 days
Failing since        180281  2023-04-17 06:24:36 Z   81 days  161 attempts
Testing same since   181735  2023-07-07 21:13:13 Z    0 days    1 attempts

------------------------------------------------------------
3724 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 617013 lines long.)


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 07:29:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 07:29:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560660.876743 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qI2NU-0008GN-Nk; Sat, 08 Jul 2023 07:29:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560660.876743; Sat, 08 Jul 2023 07:29:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qI2NU-0008GG-Kw; Sat, 08 Jul 2023 07:29:12 +0000
Received: by outflank-mailman (input) for mailman id 560660;
 Sat, 08 Jul 2023 07:29:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=afvC=C2=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qI2NT-0008GA-Cx
 for xen-devel@lists.xenproject.org; Sat, 08 Jul 2023 07:29:11 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2045.outbound.protection.outlook.com [40.107.7.45])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 21191f13-1d61-11ee-b237-6b7b168915f2;
 Sat, 08 Jul 2023 09:29:10 +0200 (CEST)
Received: from AS9PR06CA0627.eurprd06.prod.outlook.com (2603:10a6:20b:46e::31)
 by DB9PR08MB9780.eurprd08.prod.outlook.com (2603:10a6:10:45f::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.26; Sat, 8 Jul
 2023 07:28:34 +0000
Received: from AM7EUR03FT039.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:46e:cafe::5d) by AS9PR06CA0627.outlook.office365.com
 (2603:10a6:20b:46e::31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.26 via Frontend
 Transport; Sat, 8 Jul 2023 07:28:34 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT039.mail.protection.outlook.com (100.127.140.224) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.14 via Frontend Transport; Sat, 8 Jul 2023 07:28:34 +0000
Received: ("Tessian outbound d7adc65d10b4:v145");
 Sat, 08 Jul 2023 07:28:33 +0000
Received: from d79d782ba4de.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 B2FE43CB-714B-494B-A855-6575057B04D5.1; 
 Sat, 08 Jul 2023 07:28:23 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d79d782ba4de.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Sat, 08 Jul 2023 07:28:23 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by VI1PR08MB5439.eurprd08.prod.outlook.com (2603:10a6:803:13b::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.26; Sat, 8 Jul
 2023 07:28:19 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::3861:64c:eb82:afa1]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::3861:64c:eb82:afa1%4]) with mapi id 15.20.6565.016; Sat, 8 Jul 2023
 07:28:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 21191f13-1d61-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=hdjDcwYdAtqlEmgSVd0m6HjrI0mcTrgniRl056C3big=;
 b=JFULIt8E/RSWoxzO32YqFj02v4UzljvkKwYj0j2z3lfS6BtoxE7c8BnN6090mrmEywvFg9n7rdKu4OE33EUzz6l0eWe2H0MuHg4sjI1v0Mf8StFFmsNTWiFsciO4UZsNnuOxxx3dO8E2DHcN1BzKdsyemib+iA9uasSk+yZRueI=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 747db35e17dbd82b
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=M586TXhpXoGcBXuwRU8f8DT0wMHJPb/wXoyxYCo1LPoh6zHGoUg5ajSj6ufLxZr6jNaXtCWBeUBrRKpisYMoPydKU/EpC/dmpX7gwREU2oHxqZMSKpmkqc39LlZF0svwDqTtz8hS0G6oO18ltPyr7JLPto4pr5hUDvJYaNgiCHGChed2ObNIxzqGPfbPSW0VhWXOzPVXEDTtPAmU7VFWHKpRAlRZePrrELwE7azp0f/l/jJfdWk5xRrwqkncZ3Ywx0kotUREDg84ZMC3OBeO0fBbHRBouBJs3GJNFTbG3tfykR0uJTM4t1ZAZmx5pMu3BE2boDxosb+Sl53XPTJFQQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=hdjDcwYdAtqlEmgSVd0m6HjrI0mcTrgniRl056C3big=;
 b=XObwFi632XMDJXSKbDmagk6+CTQRujNY3UJ028p/AkFqW3Yjq0QeOjv74NffC8Y/1m16ICHNlSIGOfjcmP8ppVbg9PgSagdhKJjQBDLenXMXZ0tPWPYIymijHL/g0yfKcDHOuJeGu/0C1MRNnWOf0qqozEo9InA4Frm6AkrOQrJeJoNd7fTrqLEtYIfJpvgjQ/t5Cx6+BuScjxQnjn+dzM7ffQuxvchmV2d4XXGLsblIeOwXNlAqgQxd5OBmSZZvx2sO2qklxwoqZQDq/o46SKdBzCPnv1z2DZpGALsndpiJoNLByoZ2dIVPv2gZLwvB+EQ74pJnBXUoC3V5ErvDCA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=hdjDcwYdAtqlEmgSVd0m6HjrI0mcTrgniRl056C3big=;
 b=JFULIt8E/RSWoxzO32YqFj02v4UzljvkKwYj0j2z3lfS6BtoxE7c8BnN6090mrmEywvFg9n7rdKu4OE33EUzz6l0eWe2H0MuHg4sjI1v0Mf8StFFmsNTWiFsciO4UZsNnuOxxx3dO8E2DHcN1BzKdsyemib+iA9uasSk+yZRueI=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Rich Persaud <persaur@gmail.com>
CC: Stefano Stabellini <stefano.stabellini@amd.com>, Christopher Clark
	<christopher.w.clark@gmail.com>, George Dunlap <george.dunlap@cloud.com>,
	Stefano Stabellini <sstabellini@kernel.org>, "Daniel P. Smith"
	<dpsmith@apertussolutions.com>, Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>,
	George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, Henry Wang
	<Henry.Wang@arm.com>, Community Manager <community.manager@xenproject.org>,
	Doug Goldstein <cardoe@cardoe.com>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Anthony PERARD <anthony.perard@citrix.com>, Rian Quinn <rianquinn@gmail.com>,
	Ian Jackson <iwj@xenproject.org>, =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?=
	<roger.pau@citrix.com>, Scott Davis <scott.davis@starlab.io>, Adam Fraser
	<adam@starlab.io>, Paul Durrant <paul@xen.org>,
	"rsmith@riversideresearch.org" <rsmith@riversideresearch.org>,
	"m.a.young@durham.ac.uk" <m.a.young@durham.ac.uk>, Elliott Mitchell
	<ehem+xen@m5p.com>, openxt <openxt@googlegroups.com>, Jason Andryuk
	<jandryuk@gmail.com>, =?utf-8?B?TWFyZWsgTWFyY3p5a293c2tpLUfDs3JlY2tp?=
	<marmarek@invisiblethingslab.com>
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
Thread-Topic: [RFC PATCH] xen/arm: Rebranding dom0less feature
Thread-Index:
 AQHZqzMUKP6yBnvUfEC1egkdxmuozK+ki8cAgAB66ACAAukxgIAAZuEAgAAgQQCAABPDAIACuauAgACBNoCAAMWkAIAAwt2AgAGJIQCAACU3AIAAIOcAgAAM7QCAAFrAAA==
Date: Sat, 8 Jul 2023 07:28:16 +0000
Message-ID: <4CAC8F69-ABE0-47D7-9421-77F0719B9BDE@arm.com>
References:
 <alpine.DEB.2.22.394.2307071814070.761183@ubuntu-linux-20-04-desktop>
 <7486398B-AEAE-4199-8DF1-B713FEECD672@gmail.com>
In-Reply-To: <7486398B-AEAE-4199-8DF1-B713FEECD672@gmail.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|VI1PR08MB5439:EE_|AM7EUR03FT039:EE_|DB9PR08MB9780:EE_
X-MS-Office365-Filtering-Correlation-Id: 1b801f24-c2ea-4101-237d-08db7f84f014
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 DF3DRwL9EHp2G6sQRziKoPt4h755OdugsmPnMIlEQD3lTC8yFh4yRTYi2quYXNA444UeFmPhdy3hIN3rNpY4CwgFg/QbxcRTjzW1i5746R2oDgcLJc65+NoWxCE1rei7KdkC52us0Z+io2YQXaqhAut+LhhxDfyjnn7RpH2nA8MNFX+K4aTu2sTyIOphaaJquLvH2CClDkBXI8XlDZgWsEfR46tYKplTpNlkiVDEJiWxq6K0OSNhlYrJE/EeeZTsr5GV5yt2W12f+ua0ifwDG5TIeeET0WhV0rxfoUNgbBtNFe4cyfyQFKmQf4EYjE7EDivDxbiKv5KTO9fnc4iBkTdcUVCbiYYnLjCEiXjoloLrbBV3XEe06mEf0IV05Svnl+GrCWnTyvRByPVfEPPfp475Ps9kT4Ki59lSn0FVhS1o9AcMgxQ0aehlAfgbm0/nSSjt0gid7INGlirgQ51CQrv/PQFNXsbI4uED9BXjE3To4oaGHsMIh34ntIDNCv6DWzWsUdJziQ/jzIGgL4kLut0DepERtwqo2cUK1tRq7RSQ5iP3+OKPt+8rjJ7cwG0icpxIBxrOri4lFx9V7EE6MggQkZj6Os9kL4KvDf1qYDTT/4FEQ0ug4oldsnhZbpYMMezpEX5zcU5N1xfCYBhX3HHA4d6wzsTYlQ6hk1jnQmg=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(346002)(136003)(39860400002)(396003)(451199021)(66556008)(66446008)(66476007)(64756008)(66946007)(7416002)(86362001)(4326008)(38070700005)(4744005)(316002)(2906002)(91956017)(6916009)(76116006)(41300700001)(478600001)(54906003)(5660300002)(8936002)(8676002)(38100700002)(71200400001)(6666004)(122000001)(6486002)(6512007)(6506007)(26005)(2616005)(36756003)(33656002)(186003)(32563001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <3EE1D8823EB27D43B94D36DDE9F4DE0B@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5439
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT039.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	2f809147-729b-4d05-e854-08db7f84e5b0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Y2ixfb1B7ND1W9guGsu2OGArdnc5RRF5qMzW7ABctjsiwTJsKi05Odklb/TBOqPNVhgp73ioiQTD3/T+mdRoiVOSPq6PWkIJnWESmNXMwULhW8wjiwMkR9Zuau+Mq3dmk9NQ/1XNuNKAA3vXFE9RMfxLAGB4gCU4yb29i5d/3qgrGSK18P9cnbdB67KS/lzVROGyWCE05w6lDHdSDm3/YP1hZHZ8osR3u/bePlBJXNNf7AChtWj9lTh2CDwqLAPJXgJPRqLumIoC1IkDEPK39aS6ByeRJ60udrZeRASibfjGiTDAGMdPeua+KfEB3wur+faufx8FjXeIKDnfeAMFrO0nwpNzsZvNnRTRKMDUXkcLcVj7PristOegOfUz9xHxTVGc3YxBkdLD0LSRFSEhwl5DfY+ULi3WEc4GkxNC2tsOx7uWRR+c3AXc33uC3ZFXJGWLr1Mqa1HqcIIG02OE46RB5D1mtyqZKZ/brTx8K46NETR1SkdmJv84Cc7/uxwGF0XF4+CST4xXdVxkwPlmOMuSnGeMHi59N8b1cdf0d5Do0EIMrX4b6nQyuuelY5vB7jT3Qq4EVS+AFelAiyqMybfyo5HrO70zcEaeqmGUd1RWtpN7euEH7kwl1u1faXHrkDVpuGWgg5kRFIeqWw9RfcJVUw7DgkHQ51MGiFpwATTrSjS86dgFbp2YG9Ig29rAIgHK8pVKDrR+kCPjAA44E5QtyVkX8lA64BbJGDCCA6uqxIFJAqAFgRDbx/uqC/P7n/d0Vi/OH9AVGrldMEBWPw==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(136003)(396003)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(86362001)(82310400005)(40460700003)(40480700001)(36756003)(33656002)(54906003)(6666004)(478600001)(70586007)(6486002)(70206006)(81166007)(356005)(82740400003)(107886003)(5660300002)(36860700001)(6506007)(6512007)(26005)(186003)(316002)(8936002)(8676002)(2906002)(6862004)(2616005)(336012)(41300700001)(47076005)(4744005)(4326008)(32563001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2023 07:28:34.2538
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 1b801f24-c2ea-4101-237d-08db7f84f014
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT039.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB9780

Pj4+IA0KPj4+IEluc3RlYWQsIHRoZSB1c2UgY2FzZSBjb25maWd1cmF0aW9ucyBzaG91bGQgdGhl
bXNlbHZlcyBiZSBkZXNjcmliYWJsZS4NCj4+IA0KPj4gVGhhbmtzIENocmlzdG9waGVyLCBEYW5p
ZWwgYW5kIGFsbCENCj4+IA0KPj4gU28gaWYgSSB1bmRlcnN0YW5kIGNvcnJlY3RseSwgeW91IGFy
ZSBpbiBmYXZvciBpZiByZW5hbWluZyBEb20wbGVzcyB0bw0KPj4gSHlwZXJsYXVuY2ggdGhyb3Vn
aG91dCB0aGUgWGVuIGNvZGViYXNlPyBBbmQgd2UgbmVlZCBhIGNsYXJpZmljYXRpb24gb2YNCj4+
IHRoZSBkb2NzLywgZXNwZWNpYWxseSBkb2NzL2ZlYXR1cmVzL2RvbTBsZXNzLnBhbmRvYz8NCj4g
DQo+IENocmlzdG9waGVyIHdyb3RlOg0KPj4+ID0gQ29tbXVuaXR5IHJlc291cmNpbmcNCj4gDQo+
IE5vdGUgdGhlIHByZS1yZXF1aXNpdGUgd29yayBpdGVtcyBmb3IgdXBzdHJlYW0gWGVuLCBsaXN0
ZWQgdW5kZXIgIkNvbW11bml0eSBSZXNvdXJjaW5nIiwgdG8gbWVyZ2UgY29kZSBmb3IgSHlwZXJs
YXVuY2ggY29tbW9uIGludGVyZmFjZXMgYW5kIHRlc3QgY2FzZXMsIHdpdGggZG9jcyBvbiBjb25m
aWd1cmF0aW9uIG9mIEh5cGVybGF1bmNoIHRvIGRlbGl2ZXIgZnVuY3Rpb25hbGl0eSBmb3IgZG9t
MGxlc3MgdXNlIGNhc2VzLg0KDQpBcmUgeW91IHNheWluZyB0aGF0IGJlZm9yZSByZW5hbWluZyB0
aGUg4oCcZG9tMGxlc3PigJ0gZmVhdHVyZSwgd2Ugc2hvdWxkIHdhaXQgZm9yIGl0IHRvIGJlIHBv
cnRlZCB0byB0aGUgY29tbW9uIGNvZGU/DQoNCj4gDQo+IFRoYW5rcywNCj4gUmljaA0KDQoNCg==


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 08:36:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 08:36:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560670.876754 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qI3Q9-0007jO-2T; Sat, 08 Jul 2023 08:36:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560670.876754; Sat, 08 Jul 2023 08:36:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qI3Q8-0007jH-Vp; Sat, 08 Jul 2023 08:36:00 +0000
Received: by outflank-mailman (input) for mailman id 560670;
 Sat, 08 Jul 2023 08:35:59 +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 <SRS0=NYjS=C2=gmail.com=persaur@srs-se1.protection.inumbo.net>)
 id 1qI3Q7-0007j8-So
 for xen-devel@lists.xenproject.org; Sat, 08 Jul 2023 08:35:59 +0000
Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com
 [2607:f8b0:4864:20::b2f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 74dcae7b-1d6a-11ee-8611-37d641c3527e;
 Sat, 08 Jul 2023 10:35:56 +0200 (CEST)
Received: by mail-yb1-xb2f.google.com with SMTP id
 3f1490d57ef6-c5ce57836b8so2999353276.1
 for <xen-devel@lists.xenproject.org>; Sat, 08 Jul 2023 01:35:56 -0700 (PDT)
Received: from smtpclient.apple (static-198-54-130-120.cust.tzulo.com.
 [198.54.130.120]) by smtp.gmail.com with ESMTPSA id
 e10-20020a25e70a000000b00c60a6b38427sm1464731ybh.26.2023.07.08.01.35.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 08 Jul 2023 01:35:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 74dcae7b-1d6a-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688805355; x=1691397355;
        h=to:in-reply-to:cc:references:message-id:date:subject:mime-version
         :from:content-transfer-encoding:from:to:cc:subject:date:message-id
         :reply-to;
        bh=4S330Y1ApVNWThsngzKZa4UmS/ppCsmaZ5//4lF6HWE=;
        b=AQVIHbRUmazKH/8K1LQ48gxN8v7jYXf/KIveAkPxy+56XjDcXcGYtdQ9pLgcE7dgVo
         +OxJHT8YR/OjaqHpOKBjPcZ52uY32S9Iffe8gi+i3H8MchS44AkGhuEc9mFO7m8hjY6t
         heKM9ChmaihdSpt3crX1LCm3lNvXsuu/llaZpTSTZVwXsjUu89F+HJsZ+SwVmH0Ljvp5
         8MBduhsrNBeNWl53SMy+nzS9ZbC0ORtqaTz+8BFWNJHmBb/fCo3TvV2MrXDFewugIusC
         An6fM0wcu1SKZE999PbaQQkFOP1R1WvKfPRg/K+kiIzvxZPhi9sVQsRino96BX5fkD5l
         fJzw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688805355; x=1691397355;
        h=to:in-reply-to:cc:references:message-id:date:subject:mime-version
         :from:content-transfer-encoding:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=4S330Y1ApVNWThsngzKZa4UmS/ppCsmaZ5//4lF6HWE=;
        b=OMR3XxLj/vvbfh8g9EnGY0FrCluntmHnN8JYr9o26pFdir3TVEqd+n9h6Nr6SpP2JJ
         /WPuruf9DfjSBClyNdOq16xSQGXHcF4wIWgxGDcYloJbnBl50VN+N+umOl9hVg+NuT84
         nEp7zOFGLlTzoGvjzvrf6LVuDWdStlcJrt2SkaVl2EyQxu7QwqfJjabw8ZFRDQp+bTnO
         rGFSSqcZpJ7PvDVXGxjxojZiu5LwM74yaUns/tD2tVZpxRd4wZtn0b5IE/nOZaMdRHlq
         perBH+Zmtc7/+XEifhdtAhgcOHTcpxj0SYbsRT6OcBwCluYT1STjuZ+lc6msJhMDNcrD
         gclg==
X-Gm-Message-State: ABy/qLYUN/NNikoQFWjkR1rJH1WwM5ZWZ46NzDcySlpQE2MGP6YJzo7t
	wWtd5Xm+9xG05o8WSPGe8hc=
X-Google-Smtp-Source: APBJJlFW8cjPGbbpspi40P44RWxWeKltA8tzwgvQBcsVjitAYdcvPCFCAaBNXXYRQ5PED0RhYTQBHg==
X-Received: by 2002:a25:6e0b:0:b0:c69:ba82:c335 with SMTP id j11-20020a256e0b000000b00c69ba82c335mr5475670ybc.21.1688805355428;
        Sat, 08 Jul 2023 01:35:55 -0700 (PDT)
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
From: Rich Persaud <persaur@gmail.com>
Mime-Version: 1.0 (1.0)
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
Date: Sat, 8 Jul 2023 04:35:43 -0400
Message-Id: <7C4F691F-1C60-48EF-A1B6-B358DF16B13B@gmail.com>
References: <4CAC8F69-ABE0-47D7-9421-77F0719B9BDE@arm.com>
Cc: Stefano Stabellini <stefano.stabellini@amd.com>,
 Christopher Clark <christopher.w.clark@gmail.com>,
 George Dunlap <george.dunlap@cloud.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 Andrew Cooper <Andrew.Cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
 Henry Wang <Henry.Wang@arm.com>,
 Community Manager <community.manager@xenproject.org>,
 Doug Goldstein <cardoe@cardoe.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Anthony PERARD <anthony.perard@citrix.com>,
 Rian Quinn <rianquinn@gmail.com>, Ian Jackson <iwj@xenproject.org>,
 =?utf-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Scott Davis <scott.davis@starlab.io>, Adam Fraser <adam@starlab.io>,
 Paul Durrant <paul@xen.org>, rsmith@riversideresearch.org,
 m.a.young@durham.ac.uk, Elliott Mitchell <ehem+xen@m5p.com>,
 openxt <openxt@googlegroups.com>, Jason Andryuk <jandryuk@gmail.com>,
 =?utf-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
In-Reply-To: <4CAC8F69-ABE0-47D7-9421-77F0719B9BDE@arm.com>
To: Luca Fancellu <luca.fancellu@arm.com>
X-Mailer: iPad Mail (20F75)

On Jul 8, 2023, at 03:29, Luca Fancellu <luca.fancellu@arm.com> wrote:
> =EF=BB=BF
>>>>=20
>>>> Instead, the use case configurations should themselves be describable.
>>>=20
>>> Thanks Christopher, Daniel and all!
>>>=20
>>> So if I understand correctly, you are in favor if renaming Dom0less to
>>> Hyperlaunch throughout the Xen codebase? And we need a clarification of
>>> the docs/, especially docs/features/dom0less.pandoc?
>>=20
>> Christopher wrote:
>>>> =3D Community resourcing
>>=20
>> Note the pre-requisite work items for upstream Xen, listed under "Communi=
ty Resourcing", to merge code for Hyperlaunch common interfaces and test cas=
es, with docs on configuration of Hyperlaunch to deliver functionality for d=
om0less use cases.
>=20
> Are you saying that before renaming the =E2=80=9Cdom0less=E2=80=9D feature=
, we should wait for it to be ported to the common code?

Why "wait"? In what timeframe do you expect dom0less to use Hyperlaunch code=
?

Can kernel component foo adopt the name of kernel component bar without code=
 change?

Can dom0less stakeholders derive Hyperlaunch benefits without using Hyperlau=
nch code?

Rich


P.S. An intellectual property story from Cambridge, UK
https://en.wikipedia.org/wiki/Leibniz=E2=80=93Newton_calculus_controversy
https://www.smithsonianmag.com/history/ten-famous-intellectual-property-disp=
utes-18521880/

"By the early 18th century, many credited the German mathematician and philo=
sopher Gottfried Wilhelm Leibniz with inventing the study of calculus. Leibn=
iz had, after all, been the first to publish papers on the topic in 1684 and=
 1686. But when Englishman Isaac Newton published a book called Opticks in 1=
704, in which he asserted himself as the father of calculus, a debate arose.=
 Each of the thinkers=E2=80=99 respective countries wanted to stake a claim i=
n what was one of the biggest advances in mathematics."



From xen-devel-bounces@lists.xenproject.org Sat Jul 08 10:38:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 10:38:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560675.876764 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qI5KD-00039t-Vd; Sat, 08 Jul 2023 10:38:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560675.876764; Sat, 08 Jul 2023 10:38:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qI5KD-00039m-Rg; Sat, 08 Jul 2023 10:38:01 +0000
Received: by outflank-mailman (input) for mailman id 560675;
 Sat, 08 Jul 2023 10:38:00 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qI5KC-00039c-Jy; Sat, 08 Jul 2023 10:38:00 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qI5KC-0007Py-Ah; Sat, 08 Jul 2023 10:38:00 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qI5KB-0001Bz-V4; Sat, 08 Jul 2023 10:38:00 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qI5KB-0005nS-UV; Sat, 08 Jul 2023 10:37:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=4buCEKsXEs9rtVss9KCnPjhXNvx1eLOinXmIjUBv6Y4=; b=ZBbbWfIvoiZ1ezO5HAXsY40b9N
	pCBeg221jgAv1tigXHm6VWh9XT+lhl24VICEWvdZxmakChb5NsX+oJ0PP6r4hNt88jsiIjYNYDiYV
	oBpFQ2wl325rAJEigHsa64AJHv+xTOPIQQBuVL5EX9oaD/b4LVbC2BOGnx9+6pNJ7Fnw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181736-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181736: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-migrupgrade:xen-install/src_host:fail:heisenbug
    xen-unstable:test-armhf-armhf-xl:xen-boot:fail:heisenbug
    xen-unstable:test-amd64-i386-migrupgrade:xen-install/dst_host:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qcow2:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-amd64-i386-xl-vhd:guest-start/debian.repeat:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=886c22f00c575199f7bb3dc5b7662dd09bf05146
X-Osstest-Versions-That:
    xen=886c22f00c575199f7bb3dc5b7662dd09bf05146
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 08 Jul 2023 10:37:59 +0000

flight 181736 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181736/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-migrupgrade 10 xen-install/src_host fail in 181731 pass in 181736
 test-armhf-armhf-xl           8 xen-boot         fail in 181731 pass in 181736
 test-amd64-i386-migrupgrade  11 xen-install/dst_host       fail pass in 181731
 test-amd64-amd64-xl-qcow2    21 guest-start/debian.repeat  fail pass in 181731

Tests which did not succeed, but are not blocking:
 test-amd64-i386-xl-vhd       21 guest-start/debian.repeat    fail  like 181727
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181731
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181731
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181731
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181731
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181731
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181731
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181731
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181731
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181731
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181731
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181731
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181731
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  886c22f00c575199f7bb3dc5b7662dd09bf05146
baseline version:
 xen                  886c22f00c575199f7bb3dc5b7662dd09bf05146

Last test of basis   181736  2023-07-08 01:53:32 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    fail    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Sat Jul 08 10:54:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 10:54:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560683.876774 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qI5aH-0005cs-EE; Sat, 08 Jul 2023 10:54:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560683.876774; Sat, 08 Jul 2023 10:54:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qI5aH-0005cl-Bc; Sat, 08 Jul 2023 10:54:37 +0000
Received: by outflank-mailman (input) for mailman id 560683;
 Sat, 08 Jul 2023 10:54:36 +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 <SRS0=3K40=C2=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qI5aG-0005cf-5i
 for xen-devel@lists.xenproject.org; Sat, 08 Jul 2023 10:54:36 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d2a2cbb3-1d7d-11ee-8611-37d641c3527e;
 Sat, 08 Jul 2023 12:54:34 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 2BFEE1F37E;
 Sat,  8 Jul 2023 10:54:33 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id EDE00134BA;
 Sat,  8 Jul 2023 10:54:32 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id GMMXOGhAqWTePgAAMHmgww
 (envelope-from <jgross@suse.com>); Sat, 08 Jul 2023 10:54:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d2a2cbb3-1d7d-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688813673; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=HxLicN1rT/Su3jbILv79MhV7rGLRLfJ+PIxlmM6KDyE=;
	b=Xs8r3g6LwCd1Uts4P25ZCzKABzY5FOmQHGC1XN9/Pa4l4Z/YWOLXMO3Ms2hKydnOooNcDG
	CLHC5Fl7lpcRt3yWT972SotIZIxwQzVcl0ANM2RWGyFHYFmhqupop2Ozp9MVuu6ATLE1OY
	AwGHGfsCx1bihG9WOulzIOxtCqsKBBA=
Message-ID: <bd194479-3799-58cb-7e4a-8619818cd03a@suse.com>
Date: Sat, 8 Jul 2023 12:54:32 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Petr Pavlu <petr.pavlu@suse.com>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <551a1594-9c8b-d447-6bf3-a4a208d5550f@suse.com>
 <41893db4-cd66-a9f7-ffe5-d90fffb43657@suse.com>
 <alpine.DEB.2.22.394.2307071351530.761183@ubuntu-linux-20-04-desktop>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307071351530.761183@ubuntu-linux-20-04-desktop>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------Ylu0Ea877tbUcsC0rz2xMXGX"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------Ylu0Ea877tbUcsC0rz2xMXGX
Content-Type: multipart/mixed; boundary="------------MuHoh4bB3Z5967cGl5AyCaV8";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Petr Pavlu <petr.pavlu@suse.com>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Message-ID: <bd194479-3799-58cb-7e4a-8619818cd03a@suse.com>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
References: <20230621131214.9398-1-petr.pavlu@suse.com>
 <20230621131214.9398-3-petr.pavlu@suse.com>
 <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com>
 <551a1594-9c8b-d447-6bf3-a4a208d5550f@suse.com>
 <41893db4-cd66-a9f7-ffe5-d90fffb43657@suse.com>
 <alpine.DEB.2.22.394.2307071351530.761183@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2307071351530.761183@ubuntu-linux-20-04-desktop>

--------------MuHoh4bB3Z5967cGl5AyCaV8
Content-Type: multipart/mixed; boundary="------------cBzbmcZKbZtOh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yZ2UgSS9PIGJ1ZmZlcnMuIFRoZSBzYW1lIGdvZXMgZm9yIG11bHRpLXBhZ2Ugdmly
dGlvIHJpbmcgcGFnZXMuDQoNCg0KSnVlcmdlbg0K
--------------cBzbmcZKbZtOhYVPg88sWULc
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5RnNVUJbvoPHZ8SlM4KWm8rG+lIkGurq
qu5gu8q8ZMKdsdGC4bBxdQKDKHEFExLJK/nRPFmAuGlId1E3fe10v5Q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au47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------cBzbmcZKbZtOhYVPg88sWULc--

--------------MuHoh4bB3Z5967cGl5AyCaV8--

--------------Ylu0Ea877tbUcsC0rz2xMXGX
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSpQGgFAwAAAAAACgkQsN6d1ii/Ey8R
dAgAn47nMBuqYqQzHsT1q5Tx8a9QsoYx6IwjqZ06IrE7FopxaXueWEOiBlhyzhCpedSMnH9lmuzH
ku6BecBHOn5oXGhpakNgZzuvTi8nynniQ4J4vm/LJh9HJw9pFqE2Zd56LHAGBceKiSH9BlqmoQIP
OcCPl38LMRiEOezZ0YrVEqTftW8/eVplxYNhMjWYR3P60ZwC/NbrbNHUMeudKp6rMkla5e6CdrQP
nNSv2sXq/X2WWDV/D38NhfHXBu/rEbyAhRbiR9YQPF++eaG67XhM4u9zRjYvXgogGUP65oelhTCW
MhNHeQQXGclsrRrqFYBa+WbgDr2L8NLW5v/2LQTkeQ==
=yF+l
-----END PGP SIGNATURE-----

--------------Ylu0Ea877tbUcsC0rz2xMXGX--


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 13:32:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 13:32:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560693.876784 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qI82i-0004iz-8J; Sat, 08 Jul 2023 13:32:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560693.876784; Sat, 08 Jul 2023 13:32:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qI82i-0004is-59; Sat, 08 Jul 2023 13:32:08 +0000
Received: by outflank-mailman (input) for mailman id 560693;
 Sat, 08 Jul 2023 13:32:06 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qI82g-0004ii-Dv; Sat, 08 Jul 2023 13:32:06 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qI82g-0002l0-7i; Sat, 08 Jul 2023 13:32:06 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qI82f-0005D0-Rm; Sat, 08 Jul 2023 13:32:05 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qI82f-0004mq-RM; Sat, 08 Jul 2023 13:32:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=tDeUtveP58uIkSY5EUu9tQGGgMhtvsHkDoE0HZ4a65o=; b=pEGBUn5ty+VcDSDf6mjVHCVTwv
	VL2W9Jf3CBZnmQvKKR9hPXa/jbrYAEwT9qgXycmth8Oad71Vj4Y6/ZJZuWAueTfqTZuMOuASvjAYA
	ypycq4/TMuJU8sFSsFogdY+rWLSU59ErrUXDd3k3Ufp9FJQgjFwClnX6/Oc2+foOf2BY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181737-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181737: regressions - trouble: broken/fail/pass
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-vhd:<job status>:broken:regression
    linux-linus:test-amd64-amd64-xl-vhd:host-install(5):broken:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:xen-boot:fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:debian-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-pygrub:debian-di-install:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:xen-boot:fail:allowable
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=8689f4f2ea561dd080118eeb05c0255ac9542905
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 08 Jul 2023 13:32:05 +0000

flight 181737 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181737/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-vhd         <job status>                 broken
 test-amd64-amd64-xl-vhd       5 host-install(5)        broken REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2  8 xen-boot               fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl          11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow   11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd 11 leak-check/basis(11)    fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64  8 xen-boot    fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-libvirt     12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm      12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 13 xen-boot/dst_host       fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-pygrub      12 debian-di-install        fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds      8 xen-boot                 fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                8689f4f2ea561dd080118eeb05c0255ac9542905
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   82 days
Failing since        180281  2023-04-17 06:24:36 Z   82 days  162 attempts
Testing same since   181737  2023-07-08 03:26:47 Z    0 days    1 attempts

------------------------------------------------------------
3728 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      broken  
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-amd64-amd64-xl-vhd broken
broken-step test-amd64-amd64-xl-vhd host-install(5)

Not pushing.

(No revision log; it would be 618053 lines long.)


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 15:19:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 15:19:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560700.876793 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qI9iH-0006i3-M4; Sat, 08 Jul 2023 15:19:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560700.876793; Sat, 08 Jul 2023 15:19:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qI9iH-0006hw-JK; Sat, 08 Jul 2023 15:19:09 +0000
Received: by outflank-mailman (input) for mailman id 560700;
 Sat, 08 Jul 2023 15:19:08 +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
 <SRS0=zILM=C2=microsoft.com=mikelley@srs-se1.protection.inumbo.net>)
 id 1qI9iG-0006hq-8N
 for xen-devel@lists.xenproject.org; Sat, 08 Jul 2023 15:19:08 +0000
Received: from BN6PR00CU002.outbound.protection.outlook.com
 (mail-eastus2azon11021014.outbound.protection.outlook.com [52.101.57.14])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c5cf8300-1da2-11ee-8611-37d641c3527e;
 Sat, 08 Jul 2023 17:19:04 +0200 (CEST)
Received: from BYAPR21MB1688.namprd21.prod.outlook.com (2603:10b6:a02:bf::26)
 by MN2PR21MB1520.namprd21.prod.outlook.com (2603:10b6:208:209::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.0; Sat, 8 Jul
 2023 15:18:33 +0000
Received: from BYAPR21MB1688.namprd21.prod.outlook.com
 ([fe80::733d:6263:4482:ba25]) by BYAPR21MB1688.namprd21.prod.outlook.com
 ([fe80::733d:6263:4482:ba25%4]) with mapi id 15.20.6609.000; Sat, 8 Jul 2023
 15:18:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c5cf8300-1da2-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=TTT631oSQyKgiGbnsDELKgrQrqAbPfLnV3dYSCm2vv80VnoUZs3DUg5Fan3ohvkw2FXoyX4xP/GTihISc2SHFTqVy1U2O3JQR56+uvr39qhCXdos+Gy6MlxKrtnSdlK4G1bk6Bc7FcBh1Em9YMy6sSCsZBveEJh9FSVG/zwFLMpk/g0qd8qo2O99Bk7OTWmYO/V+OouewYinKdx+yiNmCb0RPnx2qeO4gKNXxQ0lWHTbNn7qZENW4YhX/RRaTkT6126Ohu5I3/An+F6hcv+CioLyM8DazVn5B64jt5n0Wv8DplQGblty29+TEe+P84oCnujPcygsRoBgVK3KY7Yq9g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=GTJcv+2jASq2Rdi44amqr3eQks4yE0wbhzlh4aW8TPY=;
 b=MtO5IUUdg7Il6G73sCQP1O6Ur5pvAiBJnpcOpVydyfvo0KgHjjnThdye+j50xUzKm5egnrIVgJilljGADziY40KbjDszaPEIfhWuT8nKgSjQ4KDvtHf+DX/fEc3CQKf+kW25YUrvlwVQY+EX9IcPQ+x1QNbCkHMFUBiUp/cqa8EYDeCp3OQTOL1cJ5t0LaZ6WpOmFJIHp7+VcebtJl3z7M945yLA444fdZOugWRWf2fEwlnL53A5x78SfU0Hbw9IfKDILG0lbB1IFz5jEMx50ttEn8tenI3nsxdO/ZOxtqN7abUfD5urJFewu0+efDYSHHq27k7kD1e0wbz2tOkdoQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=microsoft.com; dmarc=pass action=none
 header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=GTJcv+2jASq2Rdi44amqr3eQks4yE0wbhzlh4aW8TPY=;
 b=G7buebqiAzy2OTzgNF6ArFzjCK2MopYmADW2VWlI1pHmH8O6HuciMEI2pxQnHg7cs4Xkh2kbrYI2FFfIbnpEkBCQqu383E2SkRDIkJzTl3AhWBZdHMMGFQQ8gu0fqhtYujIrLxc+E8KrLR4SZ9ewLFjpHmPvuceJQudWYYPElQU=
From: "Michael Kelley (LINUX)" <mikelley@microsoft.com>
To: =?iso-8859-2?Q?Petr_Tesa=F8=EDk?= <petr@tesarici.cz>, Greg Kroah-Hartman
	<gregkh@linuxfoundation.org>
CC: Petr Tesarik <petrtesarik@huaweicloud.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>, "H. Peter
 Anvin" <hpa@zytor.com>, "Rafael J. Wysocki" <rafael@kernel.org>, Juergen
 Gross <jgross@suse.com>, Oleksandr Tyshchenko
	<oleksandr_tyshchenko@epam.com>, Christoph Hellwig <hch@lst.de>, Marek
 Szyprowski <m.szyprowski@samsung.com>, Robin Murphy <robin.murphy@arm.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Hans de Goede
	<hdegoede@redhat.com>, Jason Gunthorpe <jgg@ziepe.ca>, Kees Cook
	<keescook@chromium.org>, Saravana Kannan <saravanak@google.com>, "moderated
 list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>, "moderated
 list:ARM PORT" <linux-arm-kernel@lists.infradead.org>, open list
	<linux-kernel@vger.kernel.org>, "open list:MIPS"
	<linux-mips@vger.kernel.org>, "open list:XEN SWIOTLB SUBSYSTEM"
	<iommu@lists.linux.dev>, Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: RE: [PATCH v3 4/7] swiotlb: if swiotlb is full, fall back to a
 transient memory pool
Thread-Topic: [PATCH v3 4/7] swiotlb: if swiotlb is full, fall back to a
 transient memory pool
Thread-Index:
 AQHZqN4Es6xs27E7q0W1vSuhepPC1q+p0aJAgAKeXgCAAGWX4IABQ5kAgAAO3oCAAduRkA==
Date: Sat, 8 Jul 2023 15:18:32 +0000
Message-ID:
 <BYAPR21MB1688D3AC0C094420733717C4D732A@BYAPR21MB1688.namprd21.prod.outlook.com>
References: <cover.1687859323.git.petr.tesarik.ext@huawei.com>
	<34c2a1ba721a7bc496128aac5e20724e4077f1ab.1687859323.git.petr.tesarik.ext@huawei.com>
	<BYAPR21MB1688AAC65852E75764F53099D72CA@BYAPR21MB1688.namprd21.prod.outlook.com>
	<2023070626-boxcar-bubbly-471d@gregkh>
	<BYAPR21MB168802F691D3041C9B2F9F2DD72CA@BYAPR21MB1688.namprd21.prod.outlook.com>
	<2023070706-humbling-starfish-c68f@gregkh>
 <20230707122213.3a7378b5@meshulam.tesarici.cz>
In-Reply-To: <20230707122213.3a7378b5@meshulam.tesarici.cz>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
 MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=bbfda968-88bd-4966-b7bb-df0951631493;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2023-07-08T14:44:20Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=microsoft.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BYAPR21MB1688:EE_|MN2PR21MB1520:EE_
x-ms-office365-filtering-correlation-id: 0b1cf401-deec-4f43-9e7b-08db7fc6975a
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info:
 +agW1rQigQAp0KS7pjnBDE7R65k8Q6YXCTDWBpZVB/njPapJrrAG0GMjhKx+59QaWGDPwiv+zXcp64+XdZX0WsZ5S+mIvVfgDn+Fm+SQ+rvXjqxZCMBrVUPtA59hNM8xDfo0sk7HzbVSLdXr45//0fQZe9qYCYPuiJapPATGDrWgvojr23vLFAC5eJGSW+6c0de9fUHpzgyP5iWVt06KPS4rsi5ZCM1QqTuffDq34LZrSNiB3mh91pkV9BjKwPvi6CzKQ0YV1BqbF47T1/2i8IFK07NBfwyvOK/SKMUVM8bE7V1jHCA+Bs830hODbQZ3ET5anqwEEI/VB0S73250RiHqu6x+4gLhzM85LswKAC1mj73dcDp7BXFn+flFVPPiS9Rc+Mwxt39UMQzQe4//SJJvHrq/kz5s48EWZHkBaOJCgxTWtf01nQWD/BYOE/N0JkLiLyfODAaKn+6SlwZDv0r0TZ6qfWP6mijgv1kvtf3k2kRRf/AwPcVW/EWWRnKQwp77cyrwB8HAeg12LYsCd3ft3ZIMCsJQNrnYUErUP6sV+D+LzoorQZbPRx7ljgOhVkS/h4xtsC7R5BEBo00AI3jW7Jt+l3ITszt0dQ4ajaq6MMfql0+OVqjnjjt423Kqw0rhMZWgJ3FQdUf/8T+0+QUg40s1Zrfw8+e7YiWKpmE=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR21MB1688.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(136003)(39860400002)(396003)(376002)(346002)(451199021)(10290500003)(478600001)(7696005)(71200400001)(76116006)(110136005)(54906003)(6506007)(26005)(186003)(9686003)(8990500004)(2906002)(66946007)(41300700001)(316002)(66556008)(66476007)(66446008)(64756008)(4326008)(5660300002)(52536014)(7416002)(8936002)(8676002)(38100700002)(122000001)(82960400001)(82950400001)(86362001)(33656002)(38070700005)(83380400001)(55016003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-2?Q?17kObggti0B8dMM183+rdgXqPuGvJXCnSzDP6Q49zaYWei9fuUM/GGASJb?=
 =?iso-8859-2?Q?FX/yxa3Z1v8CWfDgZSaH9LEyrYxSX9YiofROXoE5R/24OvJ4x7I21jEnEn?=
 =?iso-8859-2?Q?jpWDwbFWoFZmsYO9YZ/RVMKD98AKXfzPZiwfRqhjqx9B+j236GIxkQSeVG?=
 =?iso-8859-2?Q?FIZrUUebOIOYV4QcMixUCU9o04SS40JJfC/EO7SPdo3uCSK2+8HiMacxeD?=
 =?iso-8859-2?Q?PE9oB0B46F0gR2DY7OM3xBUmK9auaYhTum70zRYsR7s3gT/XQMn+5G1FN/?=
 =?iso-8859-2?Q?LcmphXdF4JVwaDBkwxJXU1tKCz33xBI0YxzDWFfxRu2xs3+QSm5o4loM14?=
 =?iso-8859-2?Q?PNu45zk8JoQNe2qGu9PPomb9JWF+xBJrHXb8w0rpTXgMOrQk7yru9tjLh4?=
 =?iso-8859-2?Q?1WBqbsf4JO9gKPbcZQlsXhAAGh3C9iG+7imc2mzUvnUkhfLfDk5sTQ/KmT?=
 =?iso-8859-2?Q?Wu5Kg+ArpfYNCTwztJJRD0SciNyj4dJhQVVNj5d2BitlAkiHekq4z769AJ?=
 =?iso-8859-2?Q?/agchMF0JHHhpLwUJg8DZ5W0vBkvlwsskwekQyOsExnWhE3V7FZPumRwpq?=
 =?iso-8859-2?Q?FTnekxBe/xln8zWicvA5VeOTJ+yHJIpKohHUWpTXXhNC2L9s8+AkvBlf1C?=
 =?iso-8859-2?Q?mdRFVm5pXto2xCg/Sipq/zHb6olSbq6QMgWwWZitiDcUidENHdnfP10jN+?=
 =?iso-8859-2?Q?Zyp+uPLzHocTw8irYYw0kOgA88Dw4JVm5PF1ToRcEr2ggVmnvEo7dN1OQJ?=
 =?iso-8859-2?Q?Gdt9T0ys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GEO2XwahltVXGZpSGuMVcY0B793UVDTuvO6vYdbCYYQ?=
 =?iso-8859-2?Q?=3D=3D?=
Content-Type: text/plain; charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BYAPR21MB1688.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0b1cf401-deec-4f43-9e7b-08db7fc6975a
X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2023 15:18:32.2356
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: Q4ycpb8hogLp8SWH+CGtF4ANdZx8MLZ3CFoPq+sQ0yX9A+2mMNmP7lHiP0fIoNnHI99eTUolK/qPcR6GTh0EKu062oWJ1cVv3WV2qu8Awt4=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR21MB1520

From: Petr Tesa=F8=EDk <petr@tesarici.cz> Sent: Friday, July 7, 2023 3:22 A=
M
>=20
> On Fri, 7 Jul 2023 10:29:00 +0100
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>=20
> > On Thu, Jul 06, 2023 at 02:22:50PM +0000, Michael Kelley (LINUX) wrote:
> > > From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Sent: Thursday,=
 July 6,
> 2023 1:07 AM
> > > >
> > > > On Thu, Jul 06, 2023 at 03:50:55AM +0000, Michael Kelley (LINUX) wr=
ote:
> > > > > From: Petr Tesarik <petrtesarik@huaweicloud.com> Sent: Tuesday, J=
une 27, 2023
> > > > 2:54 AM
> > > > > >
> > > > > > Try to allocate a transient memory pool if no suitable slots ca=
n be found,
> > > > > > except when allocating from a restricted pool. The transient po=
ol is just
> > > > > > enough big for this one bounce buffer. It is inserted into a pe=
r-device
> > > > > > list of transient memory pools, and it is freed again when the =
bounce
> > > > > > buffer is unmapped.
> > > > > >
> > > > > > Transient memory pools are kept in an RCU list. A memory barrie=
r is
> > > > > > required after adding a new entry, because any address within a=
 transient
> > > > > > buffer must be immediately recognized as belonging to the SWIOT=
LB, even if
> > > > > > it is passed to another CPU.
> > > > > >
> > > > > > Deletion does not require any synchronization beyond RCU orderi=
ng
> > > > > > guarantees. After a buffer is unmapped, its physical addresses =
may no
> > > > > > longer be passed to the DMA API, so the memory range of the cor=
responding
> > > > > > stale entry in the RCU list never matches. If the memory range =
gets
> > > > > > allocated again, then it happens only after a RCU quiescent sta=
te.
> > > > > >
> > > > > > Since bounce buffers can now be allocated from different pools,=
 add a
> > > > > > parameter to swiotlb_alloc_pool() to let the caller know which =
memory pool
> > > > > > is used. Add swiotlb_find_pool() to find the memory pool corres=
ponding to
> > > > > > an address. This function is now also used by is_swiotlb_buffer=
(), because
> > > > > > a simple boundary check is no longer sufficient.
> > > > > >
> > > > > > The logic in swiotlb_alloc_tlb() is taken from __dma_direct_all=
oc_pages(),
> > > > > > simplified and enhanced to use coherent memory pools if needed.
> > > > > >
> > > > > > Note that this is not the most efficient way to provide a bounc=
e buffer,
> > > > > > but when a DMA buffer can't be mapped, something may (and will)=
 actually
> > > > > > break. At that point it is better to make an allocation, even i=
f it may be
> > > > > > an expensive operation.
> > > > >
> > > > > I continue to think about swiotlb memory management from the stan=
dpoint
> > > > > of CoCo VMs that may be quite large with high network and storage=
 loads.
> > > > > These VMs are often running mission-critical workloads that can't=
 tolerate
> > > > > a bounce buffer allocation failure.  To prevent such failures, th=
e swiotlb
> > > > > memory size must be overly large, which wastes memory.
> > > >
> > > > If "mission critical workloads" are in a vm that allowes overcommit=
 and
> > > > no control over other vms in that same system, then you have worse
> > > > problems, sorry.
> > > >
> > > > Just don't do that.
> > > >
> > >
> > > No, the cases I'm concerned about don't involve memory overcommit.
> > >
> > > CoCo VMs must use swiotlb bounce buffers to do DMA I/O.  Current swio=
tlb
> > > code in the Linux guest allocates a configurable, but fixed, amount o=
f guest
> > > memory at boot time for this purpose.  But it's hard to know how much
> > > swiotlb bounce buffer memory will be needed to handle peak I/O loads.
> > > This patch set does dynamic allocation of swiotlb bounce buffer memor=
y,
> > > which can help avoid needing to configure an overly large fixed size =
at boot.
> >
> > But, as you point out, memory allocation can fail at runtime, so how ca=
n
> > you "guarantee" that this will work properly anymore if you are going t=
o
> > make it dynamic?
>=20
> In general, there is no guarantee, of course, because bounce buffers
> may be requested from interrupt context. I believe Michael is looking
> for the SWIOTLB_MAY_SLEEP flag that was introduced in my v2 series, so
> new pools can be allocated with GFP_KERNEL instead of GFP_NOWAIT if
> possible, and then there is no need to dip into the coherent pool.
>=20
> Well, I have deliberately removed all complexities from my v3 series,
> but I have more WIP local topic branches in my local repo:
>=20
> - allow blocking allocations if possible
> - allocate a new pool before existing pools are full
> - free unused memory pools
>=20
> I can make a bigger series, or I can send another series as RFC if this
> is desired. ATM I don't feel confident enough that my v3 series will be
> accepted without major changes, so I haven't invested time into
> finalizing the other topic branches.
>=20
> @Michael: If you know that my plan is to introduce blocking allocations
> with a follow-up patch series, is the present approach acceptable?
>=20

Yes, I think the present approach is acceptable as a first step.  But
let me elaborate a bit on my thinking.

I was originally wondering if it is possible for swiotlb_map() to detect
whether it is called from a context that allows sleeping, without the use
of SWIOTLB_MAY_SLEEP.   This would get the benefits without having to
explicitly update drivers to add the flag.  But maybe that's too risky.  Fo=
r
the CoCo VM scenario that I'm most interested in, being a VM implicitly
reduces the set of drivers that are being used, and so it's not that hard
to add the flag in the key drivers that generate most of the bounce
buffer traffic.

Then I was thinking about a slightly different usage for the flag than what
you implemented in v2 of the series.   In the case where swiotlb_map()
can't allocate slots because of the swiotlb pool being full (or mostly full=
),
kick the background thread (if it is not already awake) to allocate a
dynamic pool and grow the total size of the swiotlb.  Then if
SWIOTLB_MAY_SLEEP is *not* set, allocate a transient pool just as you
have implemented in this v3 of the series.  But if SWIOTLB_MAY_SLEEP
*is* set, swiotlb_map() should sleep until the background thread has
completed the memory allocation and grown the size of the swiotlb.
After the sleep, retry the slot allocation.  Maybe what I'm describing
is what you mean by "allow blocking allocations".  :-)

This approach effectively throttles incoming swiotlb requests when space
is exhausted, and gives the dynamic sizing mechanism a chance to catch
up in an efficient fashion.  Limiting transient pools to requests that can'=
t
sleep will reduce the likelihood of exhausting the coherent memory
pools.  And as you mentioned above, kicking the background thread at the
90% full mark (or some such heuristic) also helps the dynamic sizing
mechanism keep up with demand.

Michael






From xen-devel-bounces@lists.xenproject.org Sat Jul 08 15:23:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 15:23:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560707.876803 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qI9mK-0008Ce-BN; Sat, 08 Jul 2023 15:23:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560707.876803; Sat, 08 Jul 2023 15:23:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qI9mK-0008CX-8I; Sat, 08 Jul 2023 15:23:20 +0000
Received: by outflank-mailman (input) for mailman id 560707;
 Sat, 08 Jul 2023 15:23:18 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qI9mI-0008CH-Q7; Sat, 08 Jul 2023 15:23:18 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qI9mI-0005ES-F9; Sat, 08 Jul 2023 15:23:18 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qI9mI-0007og-4O; Sat, 08 Jul 2023 15:23:18 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qI9mI-0001vo-42; Sat, 08 Jul 2023 15:23:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=3it2lp5/9iBIPpDP54eqmqnh0xOuS9UJ4mNcenJTTY0=; b=Sfw2EFlirE1DoFlHxGIDKTu2kn
	ln2mWqXr9ZpgCD9IBlwNN4hNhZT7inzT+7IZ2zbJvu1PxArGcl9AjOs6gmO1qLB/CAg30wb4pXe+k
	8Np2VKoz4POvyYQkM+XKMtmID3MZx/CM8BO1OnNyvZi1B4nN9WtrGd4BW59csIvAk2tA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181738-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 181738: tolerable FAIL - PUSHED
X-Osstest-Failures:
    libvirt:test-amd64-amd64-libvirt-vhd:guest-start.2:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=5f7f6ceb47b8bec3f8ad93599f95b755e00e439a
X-Osstest-Versions-That:
    libvirt=00cd7d2b1a9bd5a0d2f7555b7f54a6197af3c00f
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 08 Jul 2023 15:23:18 +0000

flight 181738 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181738/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt-vhd 20 guest-start.2           fail blocked in 181717
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181717
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181717
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181717
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 libvirt              5f7f6ceb47b8bec3f8ad93599f95b755e00e439a
baseline version:
 libvirt              00cd7d2b1a9bd5a0d2f7555b7f54a6197af3c00f

Last test of basis   181717  2023-07-06 04:18:48 Z    2 days
Testing same since   181738  2023-07-08 04:18:54 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jim Fehlig <jfehlig@suse.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-libvirt-vhd                                 fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   00cd7d2b1a..5f7f6ceb47  5f7f6ceb47b8bec3f8ad93599f95b755e00e439a -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 18:09:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 18:09:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560713.876814 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qICMe-0007yi-Tr; Sat, 08 Jul 2023 18:09:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560713.876814; Sat, 08 Jul 2023 18:09:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qICMe-0007yZ-Qn; Sat, 08 Jul 2023 18:09:00 +0000
Received: by outflank-mailman (input) for mailman id 560713;
 Sat, 08 Jul 2023 18:09:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=QfqP=C2=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qICMd-0007yT-Uq
 for xen-devel@lists.xenproject.org; Sat, 08 Jul 2023 18:09:00 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 813f839b-1dba-11ee-b237-6b7b168915f2;
 Sat, 08 Jul 2023 20:08:57 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id F1B0A601D9;
 Sat,  8 Jul 2023 18:08:55 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64D67C433C7;
 Sat,  8 Jul 2023 18:08:51 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 813f839b-1dba-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688839735;
	bh=HIy8KMbQOvDbOJR7WWjTx2K8cRdpxvsiNzLUY6jEL/4=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=XEsuJXmZs8oEwO1MYI6joeDr2hwqFTxRv/0I/WE74P2QT1PiR7Ku5amhXep+DPF9N
	 KTTyysZUHQH2aue0KTfONKNP/NLGt30D6aXLmXT2aUmxbBfgzXeIB+943iZcORlETw
	 e3b58q5jRq9jdYImMwIc6tmgOodLSypmDFbMbLvMMT0RVlAyMlWICFE725ugop4r8A
	 yGckpPEvcPKexupVAieX7vaJEtTpcGHKG8PZoXlqd37kzzF8j20Qmb0WBqX27qj5Ii
	 IlFZ8p4furvHFdpca2KRQfjWWiRTEBkGEPM7A7P4t90zmwJr+b+4MlIEH5HE3IbNz7
	 u7z2QC5OXtWuw==
Date: Sat, 8 Jul 2023 11:08:49 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Rich Persaud <persaur@gmail.com>
cc: Luca Fancellu <luca.fancellu@arm.com>, 
    Stefano Stabellini <stefano.stabellini@amd.com>, 
    Christopher Clark <christopher.w.clark@gmail.com>, 
    George Dunlap <george.dunlap@cloud.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    "Daniel P. Smith" <dpsmith@apertussolutions.com>, 
    Andrew Cooper <Andrew.Cooper3@citrix.com>, 
    Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, 
    Henry Wang <Henry.Wang@arm.com>, 
    Community Manager <community.manager@xenproject.org>, 
    Doug Goldstein <cardoe@cardoe.com>, 
    Bertrand Marquis <bertrand.marquis@arm.com>, 
    Volodymyr Babchuk <volodymyr_babchuk@epam.com>, 
    Anthony PERARD <anthony.perard@citrix.com>, 
    Rian Quinn <rianquinn@gmail.com>, Ian Jackson <iwj@xenproject.org>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Scott Davis <scott.davis@starlab.io>, Adam Fraser <adam@starlab.io>, 
    Paul Durrant <paul@xen.org>, rsmith@riversideresearch.org, 
    m.a.young@durham.ac.uk, Elliott Mitchell <ehem+xen@m5p.com>, 
    openxt <openxt@googlegroups.com>, Jason Andryuk <jandryuk@gmail.com>, 
    =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
In-Reply-To: <7C4F691F-1C60-48EF-A1B6-B358DF16B13B@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2307081108440.761183@ubuntu-linux-20-04-desktop>
References: <4CAC8F69-ABE0-47D7-9421-77F0719B9BDE@arm.com> <7C4F691F-1C60-48EF-A1B6-B358DF16B13B@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; BOUNDARY="8323329-1385878080-1688838543=:761183"
Content-ID: <alpine.DEB.2.22.394.2307081049060.761183@ubuntu-linux-20-04-desktop>

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-1385878080-1688838543=:761183
Content-Type: text/plain; CHARSET=UTF-8
Content-Transfer-Encoding: 8BIT
Content-ID: <alpine.DEB.2.22.394.2307081049061.761183@ubuntu-linux-20-04-desktop>

On Sat, 8 Jul 2023, Rich Persaud wrote:
> On Jul 8, 2023, at 03:29, Luca Fancellu <luca.fancellu@arm.com> wrote:
> > ï»¿
> >>>> 
> >>>> Instead, the use case configurations should themselves be describable.
> >>> 
> >>> Thanks Christopher, Daniel and all!
> >>> 
> >>> So if I understand correctly, you are in favor if renaming Dom0less to
> >>> Hyperlaunch throughout the Xen codebase? And we need a clarification of
> >>> the docs/, especially docs/features/dom0less.pandoc?
> >> 
> >> Christopher wrote:
> >>>> = Community resourcing
> >> 
> >> Note the pre-requisite work items for upstream Xen, listed under "Community Resourcing", to merge code for Hyperlaunch common interfaces and test cases, with docs on configuration of Hyperlaunch to deliver functionality for dom0less use cases.
> > 
> > Are you saying that before renaming the â€œdom0lessâ€ feature, we should wait for it to be ported to the common code?
> 
> Why "wait"? In what timeframe do you expect dom0less to use Hyperlaunch code?
> 
> Can kernel component foo adopt the name of kernel component bar without code change?
> 
> Can dom0less stakeholders derive Hyperlaunch benefits without using Hyperlaunch code?


I think Rich is saying that before using the same name we should make
sure that the interfaces and features are actually comparable and maybe
even "compatible". I think that is very reasonable. Rich, did I
understand correctly?


The Hyperlaunch (x86) code is not yet upstream, but the design document
that describes the device tree interface shows an interface that is very
similar, almost compatible, with today's dom0less (ARM) device tree
interface.

The structure of the device tree information is the same. Going through
it I could only spot only tiny differences:
- top level node is "hypervisor" instead of "chosen"
- "module-addr" instead of "reg"
- "module,kernel" instead of "multiboot,kernel"
- "module,ramdisk" instead of "multiboot,ramdisk" 

The rest is the same. If we sort out these small differences one way or
the other then the resulting interface should actually be fully
compatible and we could reuse the existing Dom0less (ARM) code to parse
an HyperLaunch (x86) configuration.

The top level node is not a problem. We could easily deal with both
"hypervisor" and also "chosen". Or we could pick a third different name
for both: "domains" which is the one used by System Device Tree.

I think we should rename "module-addr" to "reg" in the hyperlaunch
design document. I don't think it would have any effect on the existing
hyperlaunch (x86) code and usage because direct addresses are typically
not used on x86.

"module,kernel" and "module,ramdisk": we could either get rid of them in
favor of "multiboot,kernel" and "multiboot,ramdisk", or we could add
"module,kernel" and "module,ramdisk" as alternative aliases in the
existing dom0less (ARM) code. We already have "xen,linux-zimage" and
"xen,linux-initrd" as aliases so it is not a problem.


Also, I do think that Dom0less stakeholders would benefit from
Hyperlaunch code such as Dom0's reduction of privilege. Things like
"permissions" and "functions" of the Hyperlauch device tree interface
design document.


So, my opinion is that we should go ahead with dom0less->hyperlaunch
rename but we should also try to make the two device tree interfaces
compatible, sorting out the small differences above. That would help a
lot in terms of documentation and tooling. It would be ideal if things
like ImageBuilder worked equally well for Hyperlaunch (x86) and Dom0less
(ARM).


P.S.
Note that I only added (ARM) and (x86) for extra clarity in this
discussion, and I don't want to keep using them going forward.
--8323329-1385878080-1688838543=:761183--


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 18:13:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 18:13:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560717.876824 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qICRR-00012B-DC; Sat, 08 Jul 2023 18:13:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560717.876824; Sat, 08 Jul 2023 18:13:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qICRR-000124-AB; Sat, 08 Jul 2023 18:13:57 +0000
Received: by outflank-mailman (input) for mailman id 560717;
 Sat, 08 Jul 2023 18:13:56 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=QfqP=C2=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qICRQ-00011w-DU
 for xen-devel@lists.xenproject.org; Sat, 08 Jul 2023 18:13:56 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 32ba6df5-1dbb-11ee-b237-6b7b168915f2;
 Sat, 08 Jul 2023 20:13:55 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id CE80060A27;
 Sat,  8 Jul 2023 18:13:53 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 409C7C433C8;
 Sat,  8 Jul 2023 18:13:52 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 32ba6df5-1dbb-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688840033;
	bh=dPx7yoq7RWueE8zj6BgOSb2UpY0VYuZbcx6HPyZZ4tk=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=aEa8wqoZ/pthXhAxBpbAzqdv/JJDQziz/vEw8Wjp46MMAgZdq8aqUq17JPsRKk6DC
	 e5O/m31LubAhswJGJZ5RWZCcib3jNxZHcG/i/D7ZFsdUlZAxKWepSmlNFJmC3xOGmu
	 OluQQaH3W1Db2v+mtK2z7MUDzMFFGU/w15WQKcgCojxWhWb1hX38e7J7HE4X8cjkXf
	 RO4uOh3us5uT/53VyXc1RwoERmdHwcZrHFxL+7VNYTC3tjDON+jOWcPa3FvVw8Ern7
	 fDA6aVGZvmOCWR7dEzxBWXUyUiFhVJ1dCdV5bOoqet7p2WV6GDLhlLRioXLESQcD5e
	 ThbhKTDWTzySg==
Date: Sat, 8 Jul 2023 11:13:50 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Juergen Gross <jgross@suse.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    Petr Pavlu <petr.pavlu@suse.com>, 
    Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>, 
    "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
    "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0
In-Reply-To: <bd194479-3799-58cb-7e4a-8619818cd03a@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307081110220.761183@ubuntu-linux-20-04-desktop>
References: <20230621131214.9398-1-petr.pavlu@suse.com> <20230621131214.9398-3-petr.pavlu@suse.com> <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com> <551a1594-9c8b-d447-6bf3-a4a208d5550f@suse.com> <41893db4-cd66-a9f7-ffe5-d90fffb43657@suse.com>
 <alpine.DEB.2.22.394.2307071351530.761183@ubuntu-linux-20-04-desktop> <bd194479-3799-58cb-7e4a-8619818cd03a@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Sat, 8 Jul 2023, Juergen Gross wrote:
> On 07.07.23 23:02, Stefano Stabellini wrote:
> > On Fri, 7 Jul 2023, Juergen Gross wrote:
> > > On 26.06.23 15:17, Petr Pavlu wrote:
> > > > On 6/21/23 19:58, Oleksandr Tyshchenko wrote:
> > > > > On 21.06.23 16:12, Petr Pavlu wrote:
> > > > > > When attempting to run Xen on a QEMU/KVM virtual machine with virtio
> > > > > > devices (all x86_64), dom0 tries to establish a grant for itself
> > > > > > which
> > > > > > eventually results in a hang during the boot.
> > > > > > 
> > > > > > The backtrace looks as follows, the while loop in
> > > > > > __send_control_msg()
> > > > > > makes no progress:
> > > > > > 
> > > > > >      #0  virtqueue_get_buf_ctx (_vq=_vq@entry=0xffff8880074a8400,
> > > > > > len=len@entry=0xffffc90000413c94, ctx=ctx@entry=0x0
> > > > > > <fixed_percpu_data>)
> > > > > > at ../drivers/virtio/virtio_ring.c:2326
> > > > > >      #1  0xffffffff817086b7 in virtqueue_get_buf
> > > > > > (_vq=_vq@entry=0xffff8880074a8400, len=len@entry=0xffffc90000413c94)
> > > > > > at
> > > > > > ../drivers/virtio/virtio_ring.c:2333
> > > > > >      #2  0xffffffff8175f6b2 in __send_control_msg
> > > > > > (portdev=<optimized
> > > > > > out>, port_id=0xffffffff, event=0x0, value=0x1) at
> > > > > > ../drivers/char/virtio_console.c:562
> > > > > >      #3  0xffffffff8175f6ee in __send_control_msg
> > > > > > (portdev=<optimized
> > > > > > out>, port_id=<optimized out>, event=<optimized out>,
> > > > > > value=<optimized
> > > > > > out>) at ../drivers/char/virtio_console.c:569
> > > > > >      #4  0xffffffff817618b1 in virtcons_probe
> > > > > > (vdev=0xffff88800585e800)
> > > > > > at ../drivers/char/virtio_console.c:2098
> > > > > >      #5  0xffffffff81707117 in virtio_dev_probe
> > > > > > (_d=0xffff88800585e810)
> > > > > > at ../drivers/virtio/virtio.c:305
> > > > > >      #6  0xffffffff8198e348 in call_driver_probe
> > > > > > (drv=0xffffffff82be40c0
> > > > > > <virtio_console>, drv=0xffffffff82be40c0 <virtio_console>,
> > > > > > dev=0xffff88800585e810) at ../drivers/base/dd.c:579
> > > > > >      #7  really_probe (dev=dev@entry=0xffff88800585e810,
> > > > > > drv=drv@entry=0xffffffff82be40c0 <virtio_console>) at
> > > > > > ../drivers/base/dd.c:658
> > > > > >      #8  0xffffffff8198e58f in __driver_probe_device
> > > > > > (drv=drv@entry=0xffffffff82be40c0 <virtio_console>,
> > > > > > dev=dev@entry=0xffff88800585e810) at ../drivers/base/dd.c:800
> > > > > >      #9  0xffffffff8198e65a in driver_probe_device
> > > > > > (drv=drv@entry=0xffffffff82be40c0 <virtio_console>,
> > > > > > dev=dev@entry=0xffff88800585e810) at ../drivers/base/dd.c:830
> > > > > >      #10 0xffffffff8198e832 in __driver_attach
> > > > > > (dev=0xffff88800585e810,
> > > > > > data=0xffffffff82be40c0 <virtio_console>) at
> > > > > > ../drivers/base/dd.c:1216
> > > > > >      #11 0xffffffff8198bfb2 in bus_for_each_dev (bus=<optimized
> > > > > > out>,
> > > > > > start=start@entry=0x0 <fixed_percpu_data>,
> > > > > > data=data@entry=0xffffffff82be40c0 <virtio_console>,
> > > > > >          fn=fn@entry=0xffffffff8198e7b0 <__driver_attach>) at
> > > > > > ../drivers/base/bus.c:368
> > > > > >      #12 0xffffffff8198db65 in driver_attach
> > > > > > (drv=drv@entry=0xffffffff82be40c0 <virtio_console>) at
> > > > > > ../drivers/base/dd.c:1233
> > > > > >      #13 0xffffffff8198d207 in bus_add_driver
> > > > > > (drv=drv@entry=0xffffffff82be40c0 <virtio_console>) at
> > > > > > ../drivers/base/bus.c:673
> > > > > >      #14 0xffffffff8198f550 in driver_register
> > > > > > (drv=drv@entry=0xffffffff82be40c0 <virtio_console>) at
> > > > > > ../drivers/base/driver.c:246
> > > > > >      #15 0xffffffff81706b47 in register_virtio_driver
> > > > > > (driver=driver@entry=0xffffffff82be40c0 <virtio_console>) at
> > > > > > ../drivers/virtio/virtio.c:357
> > > > > >      #16 0xffffffff832cd34b in virtio_console_init () at
> > > > > > ../drivers/char/virtio_console.c:2258
> > > > > >      #17 0xffffffff8100105c in do_one_initcall
> > > > > > (fn=0xffffffff832cd2e0
> > > > > > <virtio_console_init>) at ../init/main.c:1246
> > > > > >      #18 0xffffffff83277293 in do_initcall_level
> > > > > > (command_line=0xffff888003e2f900 "root", level=0x6) at
> > > > > > ../init/main.c:1319
> > > > > >      #19 do_initcalls () at ../init/main.c:1335
> > > > > >      #20 do_basic_setup () at ../init/main.c:1354
> > > > > >      #21 kernel_init_freeable () at ../init/main.c:1571
> > > > > >      #22 0xffffffff81f64be1 in kernel_init (unused=<optimized out>)
> > > > > > at
> > > > > > ../init/main.c:1462
> > > > > >      #23 0xffffffff81001f49 in ret_from_fork () at
> > > > > > ../arch/x86/entry/entry_64.S:308
> > > > > >      #24 0x0000000000000000 in ?? ()
> > > > > > 
> > > > > > Fix the problem by preventing xen_grant_init_backend_domid() from
> > > > > > setting dom0 as a backend when running in dom0.
> > > > > > 
> > > > > > Fixes: 035e3a4321f7 ("xen/virtio: Optimize the setup of
> > > > > > "xen-grant-dma"
> > > > > > devices")
> > > > > 
> > > > > 
> > > > > I am not 100% sure whether the Fixes tag points to precise commit. If
> > > > > I
> > > > > am not mistaken, the said commit just moves the code in the context
> > > > > without changing the logic of CONFIG_XEN_VIRTIO_FORCE_GRANT, this was
> > > > > introduced before.
> > > > 
> > > > I see, the tag should better point to 7228113d1fa0 ("xen/virtio: use
> > > > dom0 as default backend for CONFIG_XEN_VIRTIO_FORCE_GRANT") which
> > > > introduced the original logic to use dom0 as backend.
> > > > 
> > > > Commit 035e3a4321f7 ("xen/virtio: Optimize the setup of "xen-grant-dma"
> > > > devices") is relevant in sense that it extended when this logic is
> > > > active by adding an OR check for xen_pv_domain().
> > > > 
> > > > > 
> > > > > 
> > > > > > Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
> > > > > > ---
> > > > > >     drivers/xen/grant-dma-ops.c | 4 +++-
> > > > > >     1 file changed, 3 insertions(+), 1 deletion(-)
> > > > > > 
> > > > > > diff --git a/drivers/xen/grant-dma-ops.c
> > > > > > b/drivers/xen/grant-dma-ops.c
> > > > > > index 76f6f26265a3..29ed27ac450e 100644
> > > > > > --- a/drivers/xen/grant-dma-ops.c
> > > > > > +++ b/drivers/xen/grant-dma-ops.c
> > > > > > @@ -362,7 +362,9 @@ static int xen_grant_init_backend_domid(struct
> > > > > > device *dev,
> > > > > >     	if (np) {
> > > > > >     		ret = xen_dt_grant_init_backend_domid(dev, np,
> > > > > > backend_domid);
> > > > > >     		of_node_put(np);
> > > > > > -	} else if (IS_ENABLED(CONFIG_XEN_VIRTIO_FORCE_GRANT) ||
> > > > > > xen_pv_domain()) {
> > > > > > +	} else if ((IS_ENABLED(CONFIG_XEN_VIRTIO_FORCE_GRANT) ||
> > > > > > +		    xen_pv_domain()) &&
> > > > > > +		   !xen_initial_domain()) {
> > > > > 
> > > > > The commit lgtm, just one note:
> > > > > 
> > > > > 
> > > > > I would even bail out early in xen_virtio_restricted_mem_acc()
> > > > > instead,
> > > > > as I assume the same issue could happen on Arm with DT (although there
> > > > > we don't guess the backend's domid, we read it from DT and quite
> > > > > unlikely we get Dom0 being in Dom0 with correct DT).
> > > > > 
> > > > > Something like:
> > > > > 
> > > > > @@ -416,6 +421,10 @@ bool xen_virtio_restricted_mem_acc(struct
> > > > > virtio_device *dev)
> > > > >     {
> > > > >            domid_t backend_domid;
> > > > > 
> > > > > +       /* Xen grant DMA ops are not used when running as initial
> > > > > domain
> > > > > */
> > > > > +       if (xen_initial_domain())
> > > > > +               return false;
> > > > > +
> > > > >            if (!xen_grant_init_backend_domid(dev->dev.parent,
> > > > > &backend_domid)) {
> > > > >                    xen_grant_setup_dma_ops(dev->dev.parent,
> > > > > backend_domid);
> > > > >                    return true;
> > > > > (END)
> > > > > 
> > > > > 
> > > > > 
> > > > > If so, that commit subject would need to be updated accordingly.
> > > > > 
> > > > > Let's see what other reviewers will say.
> > > > 
> > > > Ok, makes sense.
> > > 
> > > I think this is okay for a fix of the current problem.
> > > 
> > > Passing through virtio devices to a PV domU is not covered by this fix,
> > > but
> > > this
> > > should be a rather rare configuration, which doesn't work today either. So
> > > the
> > > suggested patch would fix the current issue without introducing a
> > > regression.
> > > 
> > > Anything else can be done later.
> > 
> > Why do you say that passing through virtio devices to a PV domU doesn't
> > work today anyway? Also, as you know many people use Xen outside of
> > datacenter deployments (laptops, embedded etc.) where drivers domains
> > and device assignment are very common. You could assign a virtio network
> > card to a domU and use PV network to share the network with other
> > guests. Physical virtio devices, especially virtio-net devices, exist. I
> > could probably repro this problem today in a domU just installing
> > QubesOS inside QEMU. QubesOS uses network driver domains and if QEMU
> > provides a virtio-net network card, this would break even with this
> > patch.
> 
> I might be wrong, but I don't think all virtio frontends will work in that
> scenario. The main reason is the PFN/MFN difference: a frontend using guest
> consecutive memory for doing large I/Os will fail miserably. This was the
> main reason why I had to add the functionality of consecutive grants for
> large I/O buffers. The same goes for multi-page virtio ring pages.

I think for PV guests the virtio frontends would work but they might be
slow as they would have to bounce over swiotlb-xen every multi-page
buffer. But the virtio frontends should work OK for PVH and HVM guests.


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 18:30:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 18:30:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560724.876834 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIChZ-0003jd-SX; Sat, 08 Jul 2023 18:30:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560724.876834; Sat, 08 Jul 2023 18:30:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIChZ-0003jW-PF; Sat, 08 Jul 2023 18:30:37 +0000
Received: by outflank-mailman (input) for mailman id 560724;
 Sat, 08 Jul 2023 18:30:36 +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
 <SRS0=QfqP=C2=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qIChY-0003jM-3j
 for xen-devel@lists.xenproject.org; Sat, 08 Jul 2023 18:30:36 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 85a5d381-1dbd-11ee-8611-37d641c3527e;
 Sat, 08 Jul 2023 20:30:33 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id EED6F60E92;
 Sat,  8 Jul 2023 18:30:31 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AFA9C433C8;
 Sat,  8 Jul 2023 18:30:29 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 85a5d381-1dbd-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688841031;
	bh=N5NuL+AHQ0zfDCRFirOIkkjVd2gz7xl8FKT/3eqh4VU=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=mlp2f9/31AQtyVEXnY6Vr+26ZtjsvlSFMY6ss/+scj9C7tNKhJLvfUFmgJKkk+mzX
	 NoSzk2OGhyRlgynWTqPLZFBSiyYMd69jQOjCoh5hJRZHUoMT4+/xQTpo2j5OfqDzlH
	 RFt2+e0lQ5Fr5eAnhOLWqWizct/ADWxbH0JnHOAYf72Tr1PB4ytJ8IKmxKG9z85bMX
	 AZH0SRG6/ZVTCLUpI+lwgegsJuMW09Gv7FjdBTLS70WZ2f2XVBKjQ/H8KnbsC5zttU
	 y47+XKF3Fwzq/tYnf8NFPye09LBNNVlVnRMSm+a5KWQNsJ/+YR2NbbSv1SbWWjzacZ
	 DQsiHZdoIeYlg==
Date: Sat, 8 Jul 2023 11:30:27 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Christopher Clark <christopher.w.clark@gmail.com>
cc: xen-devel@lists.xenproject.org, 
    Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, 
    Luca Fancellu <luca.fancellu@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Rich Persaud <persaur@gmail.com>
Subject: Re: [PATCH 01/10] x86 setup: move x86 boot module counting into a
 new boot_info struct
In-Reply-To: <20230701071835.41599-2-christopher.w.clark@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2307081124250.761183@ubuntu-linux-20-04-desktop>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com> <20230701071835.41599-2-christopher.w.clark@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Sat, 1 Jul 2023, Christopher Clark wrote:
> An initial step towards a non-multiboot internal representation of boot
> modules for common code, starting with x86 setup and converting the
> fields that are accessed for the startup calculations.
> 
> Introduce a new header, <xen/bootinfo.h>, and populate it with a new
> boot_info structure initially containing a count of the number of boot
> modules.
> 
> The naming of the header, structure and fields is intended to respect
> the boot structures on Arm -- see arm/include/asm/setup.h -- as part of
> work towards aligning common architecture-neutral boot logic and
> structures.

Thanks for aligning the two archs. At some point we should also have ARM
use the common headers.


> No functional change intended.
> 
> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
> 
> ---
> Changes since v1: patch is a subset of v1 series patches 2 and 3.
> 
>  xen/arch/x86/setup.c       | 58 +++++++++++++++++++++++---------------
>  xen/include/xen/bootinfo.h | 20 +++++++++++++
>  2 files changed, 55 insertions(+), 23 deletions(-)
>  create mode 100644 xen/include/xen/bootinfo.h
> 
> diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
> index 74e3915a4d..708639b236 100644
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -1,3 +1,4 @@
> +#include <xen/bootinfo.h>
>  #include <xen/init.h>
>  #include <xen/lib.h>
>  #include <xen/err.h>
> @@ -268,7 +269,16 @@ static int __init cf_check parse_acpi_param(const char *s)
>  custom_param("acpi", parse_acpi_param);
>  
>  static const module_t *__initdata initial_images;
> -static unsigned int __initdata nr_initial_images;
> +static struct boot_info __initdata *boot_info;

Why can't this be not a pointer?


> +static void __init multiboot_to_bootinfo(multiboot_info_t *mbi)
> +{
> +    static struct boot_info __initdata info;

Then we don't need this


> +    info.nr_mods = mbi->mods_count;
> +
> +    boot_info = &info;

And we could just do:

  boot_info.nr_mods = mbi->mods_count;

?


> +}
>  
>  unsigned long __init initial_images_nrpages(nodeid_t node)
>  {
> @@ -277,7 +287,7 @@ unsigned long __init initial_images_nrpages(nodeid_t node)
>      unsigned long nr;
>      unsigned int i;
>  
> -    for ( nr = i = 0; i < nr_initial_images; ++i )
> +    for ( nr = i = 0; i < boot_info->nr_mods; ++i )
>      {
>          unsigned long start = initial_images[i].mod_start;
>          unsigned long end = start + PFN_UP(initial_images[i].mod_end);
> @@ -293,7 +303,7 @@ void __init discard_initial_images(void)
>  {
>      unsigned int i;
>  
> -    for ( i = 0; i < nr_initial_images; ++i )
> +    for ( i = 0; i < boot_info->nr_mods; ++i )
>      {
>          uint64_t start = (uint64_t)initial_images[i].mod_start << PAGE_SHIFT;
>  
> @@ -301,7 +311,7 @@ void __init discard_initial_images(void)
>                             start + PAGE_ALIGN(initial_images[i].mod_end));
>      }
>  
> -    nr_initial_images = 0;
> +    boot_info->nr_mods = 0;
>      initial_images = NULL;
>  }
>  
> @@ -1020,6 +1030,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>          mod = __va(mbi->mods_addr);
>      }
>  
> +    multiboot_to_bootinfo(mbi);
> +
>      loader = (mbi->flags & MBI_LOADERNAME)
>          ? (char *)__va(mbi->boot_loader_name) : "unknown";
>  
> @@ -1127,18 +1139,18 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>             bootsym(boot_edd_info_nr));
>  
>      /* Check that we have at least one Multiboot module. */
> -    if ( !(mbi->flags & MBI_MODULES) || (mbi->mods_count == 0) )
> +    if ( !(mbi->flags & MBI_MODULES) || (boot_info->nr_mods == 0) )
>          panic("dom0 kernel not specified. Check bootloader configuration\n");
>  
>      /* Check that we don't have a silly number of modules. */
> -    if ( mbi->mods_count > sizeof(module_map) * 8 )
> +    if ( boot_info->nr_mods > sizeof(module_map) * 8 )
>      {
> -        mbi->mods_count = sizeof(module_map) * 8;
> +        boot_info->nr_mods = sizeof(module_map) * 8;
>          printk("Excessive multiboot modules - using the first %u only\n",
> -               mbi->mods_count);
> +               boot_info->nr_mods);
>      }
>  
> -    bitmap_fill(module_map, mbi->mods_count);
> +    bitmap_fill(module_map, boot_info->nr_mods);
>      __clear_bit(0, module_map); /* Dom0 kernel is always first */
>  
>      if ( pvh_boot )
> @@ -1311,9 +1323,9 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>      kexec_reserve_area(&boot_e820);
>  
>      initial_images = mod;
> -    nr_initial_images = mbi->mods_count;
> +    boot_info->nr_mods = boot_info->nr_mods;
>  
> -    for ( i = 0; !efi_enabled(EFI_LOADER) && i < mbi->mods_count; i++ )
> +    for ( i = 0; !efi_enabled(EFI_LOADER) && i < boot_info->nr_mods; i++ )
>      {
>          if ( mod[i].mod_start & (PAGE_SIZE - 1) )
>              panic("Bootloader didn't honor module alignment request\n");
> @@ -1337,8 +1349,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>           * respective reserve_e820_ram() invocation below. No need to
>           * query efi_boot_mem_unused() here, though.
>           */
> -        mod[mbi->mods_count].mod_start = virt_to_mfn(_stext);
> -        mod[mbi->mods_count].mod_end = __2M_rwdata_end - _stext;
> +        mod[boot_info->nr_mods].mod_start = virt_to_mfn(_stext);
> +        mod[boot_info->nr_mods].mod_end = __2M_rwdata_end - _stext;
>      }
>  
>      modules_headroom = bzimage_headroom(bootstrap_map(mod), mod->mod_end);
> @@ -1398,7 +1410,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>          {
>              /* Don't overlap with modules. */
>              end = consider_modules(s, e, reloc_size + mask,
> -                                   mod, mbi->mods_count, -1);
> +                                   mod, boot_info->nr_mods, -1);
>              end &= ~mask;
>          }
>          else
> @@ -1419,7 +1431,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>          }
>  
>          /* Is the region suitable for relocating the multiboot modules? */
> -        for ( j = mbi->mods_count - 1; j >= 0; j-- )
> +        for ( j = boot_info->nr_mods - 1; j >= 0; j-- )
>          {
>              unsigned long headroom = j ? 0 : modules_headroom;
>              unsigned long size = PAGE_ALIGN(headroom + mod[j].mod_end);
> @@ -1429,7 +1441,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>  
>              /* Don't overlap with other modules (or Xen itself). */
>              end = consider_modules(s, e, size, mod,
> -                                   mbi->mods_count + relocated, j);
> +                                   boot_info->nr_mods + relocated, j);
>  
>              if ( highmem_start && end > highmem_start )
>                  continue;
> @@ -1456,7 +1468,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>          {
>              /* Don't overlap with modules (or Xen itself). */
>              e = consider_modules(s, e, PAGE_ALIGN(kexec_crash_area.size), mod,
> -                                 mbi->mods_count + relocated, -1);
> +                                 boot_info->nr_mods + relocated, -1);
>              if ( s >= e )
>                  break;
>              if ( e > kexec_crash_area_limit )
> @@ -1471,7 +1483,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>  
>      if ( modules_headroom && !mod->reserved )
>          panic("Not enough memory to relocate the dom0 kernel image\n");
> -    for ( i = 0; i < mbi->mods_count; ++i )
> +    for ( i = 0; i < boot_info->nr_mods; ++i )
>      {
>          uint64_t s = (uint64_t)mod[i].mod_start << PAGE_SHIFT;
>  
> @@ -1540,7 +1552,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>                      ASSERT(j);
>                  }
>                  map_e = boot_e820.map[j].addr + boot_e820.map[j].size;
> -                for ( j = 0; j < mbi->mods_count; ++j )
> +                for ( j = 0; j < boot_info->nr_mods; ++j )
>                  {
>                      uint64_t end = pfn_to_paddr(mod[j].mod_start) +
>                                     mod[j].mod_end;
> @@ -1616,7 +1628,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>          }
>      }
>  
> -    for ( i = 0; i < mbi->mods_count; ++i )
> +    for ( i = 0; i < boot_info->nr_mods; ++i )
>      {
>          set_pdx_range(mod[i].mod_start,
>                        mod[i].mod_start + PFN_UP(mod[i].mod_end));
> @@ -1999,8 +2011,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>             cpu_has_nx ? XENLOG_INFO : XENLOG_WARNING "Warning: ",
>             cpu_has_nx ? "" : "not ");
>  
> -    initrdidx = find_first_bit(module_map, mbi->mods_count);
> -    if ( bitmap_weight(module_map, mbi->mods_count) > 1 )
> +    initrdidx = find_first_bit(module_map, boot_info->nr_mods);
> +    if ( bitmap_weight(module_map, boot_info->nr_mods) > 1 )
>          printk(XENLOG_WARNING
>                 "Multiple initrd candidates, picking module #%u\n",
>                 initrdidx);
> @@ -2010,7 +2022,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>       * above our heap. The second module, if present, is an initrd ramdisk.
>       */
>      dom0 = create_dom0(mod, modules_headroom,
> -                       initrdidx < mbi->mods_count ? mod + initrdidx : NULL,
> +                       initrdidx < boot_info->nr_mods ? mod + initrdidx : NULL,
>                         kextra, loader);
>      if ( !dom0 )
>          panic("Could not set up DOM0 guest OS\n");
> diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
> new file mode 100644
> index 0000000000..6a7d55d20e
> --- /dev/null
> +++ b/xen/include/xen/bootinfo.h
> @@ -0,0 +1,20 @@
> +#ifndef __XEN_BOOTINFO_H__
> +#define __XEN_BOOTINFO_H__
> +
> +#include <xen/types.h>

I don't think you need types.h right now


> +struct boot_info {

This is what we call struct bootmodules on ARM right? Would it help if
we used the same name?

I am not asking to make the ARM code common because I think that would
probably be a lot more work.


> +    unsigned int nr_mods;
> +};
> +
> +#endif
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * tab-width: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> -- 
> 2.25.1
> 
> 


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 18:48:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 18:48:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560728.876844 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qICyL-0005NQ-A6; Sat, 08 Jul 2023 18:47:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560728.876844; Sat, 08 Jul 2023 18:47:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qICyL-0005NJ-7C; Sat, 08 Jul 2023 18:47:57 +0000
Received: by outflank-mailman (input) for mailman id 560728;
 Sat, 08 Jul 2023 18:47:55 +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
 <SRS0=QfqP=C2=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qICyJ-0005ND-LT
 for xen-devel@lists.xenproject.org; Sat, 08 Jul 2023 18:47:55 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f1686be8-1dbf-11ee-8611-37d641c3527e;
 Sat, 08 Jul 2023 20:47:53 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id AD21D6023E;
 Sat,  8 Jul 2023 18:47:51 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37FB5C433C7;
 Sat,  8 Jul 2023 18:47:49 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f1686be8-1dbf-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688842071;
	bh=uGNpRYjkC7KKec7r8ahS6k9himldGTYn0LcZ+4dQtEY=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=R0oVVK3qz2WpK9jhqfxzmKn128GbRBZFaFoVFuiQZZnYbFtx/RHLEnTtGIpJihbxd
	 MYwmdKEgCWFriOIOez1FFuITbqgFZVkNhWEx5UmQ+gZMsKjY6OBM6IQyY57sGjycmz
	 GAxJRxQ6EkFa8EKgN5KFthqEf9QE+3TIqEz3bXg76Wi4yB0QU1Xa2ypy2tYXMZPeQ6
	 nBgphtMZDoZtCqiOiObK3dhQn6oTIRlkchRK4nwk5n0kX1zV+IGf/MXkRC+MZ2zt6l
	 yPR8TkQqF/ggyzqbBo6srgiuDlrngfOgXhMtdM6BzposqP23VsYtnObfTmba3f4RaK
	 6YpTG3UGAv9Uw==
Date: Sat, 8 Jul 2023 11:47:47 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Christopher Clark <christopher.w.clark@gmail.com>
cc: xen-devel@lists.xenproject.org, 
    Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, 
    Luca Fancellu <luca.fancellu@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Rich Persaud <persaur@gmail.com>
Subject: Re: [PATCH 03/10] x86 setup: change bootstrap map to accept new boot
 module structures
In-Reply-To: <20230701071835.41599-4-christopher.w.clark@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2307081144340.761183@ubuntu-linux-20-04-desktop>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com> <20230701071835.41599-4-christopher.w.clark@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Sat, 1 Jul 2023, Christopher Clark wrote:
> To convert the x86 boot logic from multiboot to boot module structures,
> change the bootstrap map function to accept a boot module parameter.
> 
> To allow incremental change from multiboot to boot modules across all
> x86 setup logic, provide a temporary inline wrapper that still accepts a
> multiboot module parameter and use it where necessary. The wrapper is
> placed in a new arch/x86 header <asm/boot.h> to avoid putting a static
> inline function into an existing header that has no such functions
> already. This new header will be expanded with additional functions in
> subsequent patches in this series.
> 
> No functional change intended.
> 
> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
> 

[...]

> diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
> index b72ae31a66..eb93cc3439 100644
> --- a/xen/include/xen/bootinfo.h
> +++ b/xen/include/xen/bootinfo.h
> @@ -10,6 +10,9 @@
>  #endif
>  
>  struct boot_module {
> +    paddr_t start;
> +    size_t size;

I think size should be paddr_t (instead of size_t) to make sure it is
the right size on both 64-bit and 32-bit architectures that support
64-bit addresses.


>      struct arch_bootmodule *arch;
>  };


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 19:15:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 19:15:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560732.876854 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIDOn-0000Lk-EF; Sat, 08 Jul 2023 19:15:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560732.876854; Sat, 08 Jul 2023 19:15:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIDOn-0000Ld-Aw; Sat, 08 Jul 2023 19:15:17 +0000
Received: by outflank-mailman (input) for mailman id 560732;
 Sat, 08 Jul 2023 19:15:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=QfqP=C2=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qIDOl-0000LH-I6
 for xen-devel@lists.xenproject.org; Sat, 08 Jul 2023 19:15:15 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c28bbd24-1dc3-11ee-b237-6b7b168915f2;
 Sat, 08 Jul 2023 21:15:12 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id E72A860A66;
 Sat,  8 Jul 2023 19:15:10 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71C57C433C8;
 Sat,  8 Jul 2023 19:15:08 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c28bbd24-1dc3-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688843710;
	bh=lgbMCP0AFezAYeuRLr2ojoWv50nBejHsVAiwT4u9Ef8=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=eSYDgbINI2T9B9wV4XVMYww7Kb2WF8CDPihq+BysF7y229sDgLLHPWzo72+M9UrAN
	 LQzFfI2LTbGuwGWfCPqCgQhTKrHCp6hY67TNRXwtor1G7QGdydupbc9KzFj7R3Kery
	 9mtx2jwC4LqFVxFVEviyyYq6/ouVvUqlniugAQ3NIG41eCRaz69UfzViaaN/UEYp8F
	 Vy07O8O30isKLLIHaO7jc7XHRnmxgEqjEEEl34rELW3BzebsWWaBDtHsbnqYkkqKPK
	 m6LQDK0SCZfuHlZ+cVkiizYYvti4M0ACadVx/OPgETrj6VeJM3Gm8Bsez+lhiNCDrA
	 7Bzirb1rvBlWg==
Date: Sat, 8 Jul 2023 12:15:06 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Christopher Clark <christopher.w.clark@gmail.com>
cc: xen-devel@lists.xenproject.org, 
    Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, 
    Luca Fancellu <luca.fancellu@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Rich Persaud <persaur@gmail.com>
Subject: Re: [PATCH 04/10] x86 setup: porting dom0 construction logic to boot
 module structures
In-Reply-To: <20230701071835.41599-5-christopher.w.clark@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2307081149090.761183@ubuntu-linux-20-04-desktop>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com> <20230701071835.41599-5-christopher.w.clark@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Sat, 1 Jul 2023, Christopher Clark wrote:
> Adjust the PV and PVH dom0 construction entry points to take boot module
> structures as parameters, and add further fields to the boot module
> structures to plumb the data needed to support this use. Populate these
> from the multiboot module data.
> 
> This change removes multiboot from the PV and PVH dom0 construction logic.
> 
> Introduce and use new inline accessor functions for navigating the boot
> module structures.
> 
> The per-boot-module arrays are expanded from singletons to accommodate
> all modules, up to a static maximum of 64 modules including Xen that can
> be accepted from a bootloader to match the previous value from the
> module map check.
> 
> The field that identifies the type of a boot module (kernel, ramdisk,
> etc) is introduced to the common boot module structure and declared as a
> non-enum integer type to allow the field to be of a known-size and so
> structure can be packed in a subsequent patch in the series, and it will
> then be reconciled with the equivalent Arm boot field type.
> 
> The command line provided by multiboot for each boot module is added
> directly to the boot_module structure, which is appropriate for this
> logic just replacing multiboot.
> 
> The maximum number of boot modules that a bootloader can provide in
> addition to the Xen hypervisor is preserved from prior logic with the
> module_map at 63.
> 
> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
> 
> ---
> Changes since v1: patch is a subset of v1 series patches 2 and 3.
> - The module_map is kept for now since still in use.
> - Move the static inline functions into a separate dedicated header.
> - <mm-frame.h> and <compiler.h> replace prior inclusion of <mm.h>
>   for simpler dependencies.
> 
>  xen/arch/x86/dom0_build.c             |  10 +-
>  xen/arch/x86/hvm/dom0_build.c         |  43 +++---
>  xen/arch/x86/include/asm/boot.h       |  36 +++++
>  xen/arch/x86/include/asm/bootinfo.h   |  24 +++
>  xen/arch/x86/include/asm/dom0_build.h |  13 +-
>  xen/arch/x86/include/asm/setup.h      |   4 +-
>  xen/arch/x86/pv/dom0_build.c          |  32 ++--
>  xen/arch/x86/setup.c                  | 206 +++++++++++++++-----------
>  xen/include/xen/bootinfo.h            |  27 ++++
>  9 files changed, 254 insertions(+), 141 deletions(-)
> 
> diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
> index 9f5300a3ef..42310202a2 100644
> --- a/xen/arch/x86/dom0_build.c
> +++ b/xen/arch/x86/dom0_build.c
> @@ -4,6 +4,7 @@
>   * Copyright (c) 2002-2005, K A Fraser
>   */
>  
> +#include <xen/bootinfo.h>
>  #include <xen/init.h>
>  #include <xen/iocap.h>
>  #include <xen/libelf.h>
> @@ -562,9 +563,8 @@ int __init dom0_setup_permissions(struct domain *d)
>      return rc;
>  }
>  
> -int __init construct_dom0(struct domain *d, const module_t *image,
> -                          unsigned long image_headroom, module_t *initrd,
> -                          char *cmdline)
> +int __init construct_dom0(struct domain *d, const struct boot_module *image,
> +    struct boot_module *initrd, char *cmdline)
>  {
>      int rc;
>  
> @@ -576,9 +576,9 @@ int __init construct_dom0(struct domain *d, const module_t *image,
>      process_pending_softirqs();
>  
>      if ( is_hvm_domain(d) )
> -        rc = dom0_construct_pvh(d, image, image_headroom, initrd, cmdline);
> +        rc = dom0_construct_pvh(d, image, initrd, cmdline);
>      else if ( is_pv_domain(d) )
> -        rc = dom0_construct_pv(d, image, image_headroom, initrd, cmdline);
> +        rc = dom0_construct_pv(d, image, initrd, cmdline);
>      else
>          panic("Cannot construct Dom0. No guest interface available\n");
>  
> diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
> index 56fe89632b..c094863bb8 100644
> --- a/xen/arch/x86/hvm/dom0_build.c
> +++ b/xen/arch/x86/hvm/dom0_build.c
> @@ -8,9 +8,9 @@
>   */
>  
>  #include <xen/acpi.h>
> +#include <xen/bootinfo.h>
>  #include <xen/init.h>
>  #include <xen/libelf.h>
> -#include <xen/multiboot.h>
>  #include <xen/pci.h>
>  #include <xen/softirq.h>
>  
> @@ -530,14 +530,13 @@ static paddr_t __init find_memory(
>      return INVALID_PADDR;
>  }
>  
> -static int __init pvh_load_kernel(struct domain *d, const module_t *image,
> -                                  unsigned long image_headroom,
> -                                  module_t *initrd, void *image_base,
> -                                  char *cmdline, paddr_t *entry,
> -                                  paddr_t *start_info_addr)
> +static int __init pvh_load_kernel(
> +    struct domain *d, const struct boot_module *image,
> +    struct boot_module *initrd, void *image_base, char *cmdline, paddr_t *entry,
> +    paddr_t *start_info_addr)
>  {
> -    void *image_start = image_base + image_headroom;
> -    unsigned long image_len = image->mod_end;
> +    void *image_start = image_base + image->arch->headroom;
> +    unsigned long image_len = image->size;
>      struct elf_binary elf;
>      struct elf_dom_parms parms;
>      paddr_t last_addr;
> @@ -546,7 +545,7 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
>      struct vcpu *v = d->vcpu[0];
>      int rc;
>  
> -    if ( (rc = bzimage_parse(image_base, &image_start, image_headroom,
> +    if ( (rc = bzimage_parse(image_base, &image_start, image->arch->headroom,
>                               &image_len)) != 0 )
>      {
>          printk("Error trying to detect bz compressed kernel\n");
> @@ -594,7 +593,7 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
>       * simplify it.
>       */
>      last_addr = find_memory(d, &elf, sizeof(start_info) +
> -                            (initrd ? ROUNDUP(initrd->mod_end, PAGE_SIZE) +
> +                            (initrd ? ROUNDUP(initrd->size, PAGE_SIZE) +
>                                        sizeof(mod)
>                                      : 0) +
>                              (cmdline ? ROUNDUP(strlen(cmdline) + 1,
> @@ -608,8 +607,8 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
>  
>      if ( initrd != NULL )
>      {
> -        rc = hvm_copy_to_guest_phys(last_addr, mfn_to_virt(initrd->mod_start),
> -                                    initrd->mod_end, v);
> +        rc = hvm_copy_to_guest_phys(last_addr, maddr_to_virt(initrd->start),
> +                                    initrd->size, v);
>          if ( rc )
>          {
>              printk("Unable to copy initrd to guest\n");
> @@ -617,11 +616,11 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
>          }
>  
>          mod.paddr = last_addr;
> -        mod.size = initrd->mod_end;
> -        last_addr += ROUNDUP(initrd->mod_end, elf_64bit(&elf) ? 8 : 4);
> -        if ( initrd->string )
> +        mod.size = initrd->size;
> +        last_addr += ROUNDUP(initrd->size, elf_64bit(&elf) ? 8 : 4);
> +        if ( initrd->string.len )
>          {
> -            char *str = __va(initrd->string);
> +            char *str = initrd->string.bytes;
>              size_t len = strlen(str) + 1;
>  
>              rc = hvm_copy_to_guest_phys(last_addr, str, len, v);
> @@ -1176,10 +1175,9 @@ static void __hwdom_init pvh_setup_mmcfg(struct domain *d)
>      }
>  }
>  
> -int __init dom0_construct_pvh(struct domain *d, const module_t *image,
> -                              unsigned long image_headroom,
> -                              module_t *initrd,
> -                              char *cmdline)
> +int __init dom0_construct_pvh(
> +    struct domain *d, const struct boot_module *image,
> +    struct boot_module *initrd, char *cmdline)
>  {
>      paddr_t entry, start_info;
>      int rc;
> @@ -1209,9 +1207,8 @@ int __init dom0_construct_pvh(struct domain *d, const module_t *image,
>          return rc;
>      }
>  
> -    rc = pvh_load_kernel(d, image, image_headroom, initrd,
> -                         bootstrap_map_multiboot(image),
> -                         cmdline, &entry, &start_info);
> +    rc = pvh_load_kernel(d, image, initrd, bootstrap_map(image), cmdline,
> +                         &entry, &start_info);
>      if ( rc )
>      {
>          printk("Failed to load Dom0 kernel\n");
> diff --git a/xen/arch/x86/include/asm/boot.h b/xen/arch/x86/include/asm/boot.h
> index 10b17f12b2..bcf4f2e2e3 100644
> --- a/xen/arch/x86/include/asm/boot.h
> +++ b/xen/arch/x86/include/asm/boot.h
> @@ -19,6 +19,42 @@ static inline void *bootstrap_map_multiboot(const module_t *mod)
>      return bootstrap_map(&bm);
>  }
>  
> +static inline unsigned long bootmodule_index(
> +    const struct boot_info *info, bootmod_type_t bootmod_type,
> +    unsigned long start)
> +{
> +    for ( ; start < info->nr_mods; start++ )
> +        if ( info->mods[start].bootmod_type == bootmod_type )
> +            return start;
> +
> +    return info->nr_mods + 1;
> +}
> +
> +static inline struct boot_module *bootmodule_next(
> +    const struct boot_info *info, bootmod_type_t bootmod_type)
> +{
> +    unsigned long i;
> +
> +    for ( i = 0; i < info->nr_mods; i++ )
> +        if ( info->mods[i].bootmod_type == bootmod_type )
> +            return &info->mods[i];
> +
> +    return NULL;
> +}
> +
> +static inline void bootmodule_update_start(struct boot_module *bm,
> +    paddr_t new_start)
> +{
> +    bm->start = new_start;
> +    bm->mfn = maddr_to_mfn(new_start);
> +}
> +
> +static inline void bootmodule_update_mfn(struct boot_module *bm, mfn_t new_mfn)
> +{
> +    bm->mfn = new_mfn;
> +    bm->start = mfn_to_maddr(new_mfn);
> +}
> +
>  #endif
>  
>  /*
> diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
> index a25054f372..30c27980e0 100644
> --- a/xen/arch/x86/include/asm/bootinfo.h
> +++ b/xen/arch/x86/include/asm/bootinfo.h
> @@ -2,9 +2,33 @@
>  #define __ARCH_X86_BOOTINFO_H__
>  
>  struct arch_bootmodule {
> +#define BOOTMOD_FLAG_X86_RELOCATED     1U << 0
> +    uint32_t flags;
>      unsigned headroom;
>  };
>  
> +struct arch_boot_info {
> +    uint32_t flags;
> +#define BOOTINFO_FLAG_X86_CMDLINE      1U << 2

Is this to indicate the presence of the Xen cmdline?


> +#define BOOTINFO_FLAG_X86_MODULES      1U << 3
> +#define BOOTINFO_FLAG_X86_MEMMAP       1U << 6
> +#define BOOTINFO_FLAG_X86_LOADERNAME   1U << 9
> +
> +    char *boot_loader_name;
> +
> +    uint32_t mmap_length;
> +    paddr_t mmap_addr;
> +};
> +
> +struct __packed mb_memmap {
> +    uint32_t size;
> +    uint32_t base_addr_low;
> +    uint32_t base_addr_high;
> +    uint32_t length_low;
> +    uint32_t length_high;
> +    uint32_t type;
> +};
> +
>  #endif
>  
>  /*
> diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
> index 3b623a4149..f9b04daebd 100644
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -37,6 +37,7 @@
>  #include <asm/processor.h>
>  #include <asm/mpspec.h>
>  #include <asm/apic.h>
> +#include <asm/boot.h>
>  #include <asm/msi.h>
>  #include <asm/desc.h>
>  #include <asm/paging.h>
> @@ -59,6 +60,9 @@
>  #include <asm/prot-key.h>
>  #include <asm/pv/domain.h>
>  
> +/* Max number of boot modules a bootloader can provide in addition to Xen */
> +#define MAX_NR_BOOTMODS 63

Call it MAX_MODULES ?
Like I wrote in the past, you already did the hard work of aligning the
interfaces, we might as well also use the same names.

[...]

> @@ -1357,12 +1382,14 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>           * respective reserve_e820_ram() invocation below. No need to
>           * query efi_boot_mem_unused() here, though.
>           */
> -        mod[boot_info->nr_mods].mod_start = virt_to_mfn(_stext);
> -        mod[boot_info->nr_mods].mod_end = __2M_rwdata_end - _stext;
> +        bootmodule_update_start(&boot_info->mods[boot_info->nr_mods],
> +                                virt_to_maddr(_stext));
> +        boot_info->mods[boot_info->nr_mods].size = __2M_rwdata_end - _stext;
>      }

The original code had the end address as "__2M_rwdata_end - _stext"
while now we have the size as "__2M_rwdata_end - _stext" which is not
the same?



>      boot_info->mods[0].arch->headroom =
> -        bzimage_headroom(bootstrap_map_multiboot(mod), mod->mod_end);
> +        bzimage_headroom(bootstrap_map(&boot_info->mods[0]),
> +                         boot_info->mods[0].size);
>  
>      bootstrap_map(NULL);
>  

[...]


> diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
> index eb93cc3439..2f4284a91f 100644
> --- a/xen/include/xen/bootinfo.h
> +++ b/xen/include/xen/bootinfo.h
> @@ -2,23 +2,50 @@
>  #define __XEN_BOOTINFO_H__
>  
>  #include <xen/types.h>
> +#include <xen/compiler.h>
> +#include <xen/mm-frame.h>
>  
>  #ifdef CONFIG_X86
>  #include <asm/bootinfo.h>
>  #else
>      struct arch_bootmodule { };
> +    struct arch_boot_info { };
>  #endif
>  
> +/* Boot module binary type / purpose */
> +#define BOOTMOD_UNKNOWN     0
> +#define BOOTMOD_XEN         1
> +#define BOOTMOD_FDT         2
> +#define BOOTMOD_KERNEL      3
> +#define BOOTMOD_RAMDISK     4
> +#define BOOTMOD_XSM         5
> +#define BOOTMOD_UCODE       6
> +#define BOOTMOD_GUEST_DTB   7
> +typedef unsigned int bootmod_type_t;
> +
> +#define BOOTMOD_STRING_MAX_LEN 1024

BOOTMOD_MAX_CMDLINE ?


> +struct boot_string {

struct bootcmdline ?


> +    char bytes[BOOTMOD_STRING_MAX_LEN];

cmdline?

If the string is \0 terminated we don't need len?


> +    size_t len;
> +};
> +
>  struct boot_module {
> +    bootmod_type_t bootmod_type;

Why not use a good old enum?


>      paddr_t start;
> +    mfn_t mfn;

I think mfn should be in arch_bootmodule


>      size_t size;
>  
>      struct arch_bootmodule *arch;
> +    struct boot_string string;
>  };
>  
>  struct boot_info {
> +    char *cmdline;

Is this for Xen cmdline? While all the other cmdline are in the various
struct boot_string? Is there any benefit in using the BOOTMOD_XEN for it?
BOOTMOD_XEN is not used so far, so if you don't end up using it,
probably not, otherwise it could be considered.




>      unsigned int nr_mods;
>      struct boot_module *mods;
> +
> +    struct arch_boot_info *arch;
>  };
>  
>  #endif
> -- 
> 2.25.1
> 
> 


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 19:15:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 19:15:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560734.876864 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIDP4-0000gn-Qb; Sat, 08 Jul 2023 19:15:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560734.876864; Sat, 08 Jul 2023 19:15:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIDP4-0000ge-NL; Sat, 08 Jul 2023 19:15:34 +0000
Received: by outflank-mailman (input) for mailman id 560734;
 Sat, 08 Jul 2023 19:15:33 +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
 <SRS0=QfqP=C2=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qIDP3-0000dy-8z
 for xen-devel@lists.xenproject.org; Sat, 08 Jul 2023 19:15:33 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cc5a5fd0-1dc3-11ee-8611-37d641c3527e;
 Sat, 08 Jul 2023 21:15:28 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 9FC2E60ADE;
 Sat,  8 Jul 2023 19:15:27 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C7B6C433C7;
 Sat,  8 Jul 2023 19:15:25 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cc5a5fd0-1dc3-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688843727;
	bh=P+jUqxCIKRZAn+cyLKPsfy3kw6aAismJpOKg1hmwQUs=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=ue7EwihpcxBmCiIthkleyNFEPj9aHsEtllqS9QxYvMxbV1boe8dP1YP6QGMlEl9v2
	 xnPz0PtOe0cF5i3kN7E0PhqQ5YTFquDur4sI+uB7VyKwvmciw3XM2Tbu6y0303PCek
	 u7WXTuRf0MLUWnt86Zhqf+GQ365anfSpkTzB8UGzqcddtVa5pIxwyfKDwQRtJBFmYN
	 6MoTfppchmiSXXKe2MO3ZuwyqfQR+AKiUDsRirz6hmj14w9KwJtD3cwvF9lpPDJH8u
	 F18D8POkzN8iQx6hhBInkItK6L7zUv7CK6Y6iuDKCDeB6HxPykIwMI8awT2BrQnBse
	 GcZWzElbRCIfw==
Date: Sat, 8 Jul 2023 12:15:23 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Christopher Clark <christopher.w.clark@gmail.com>
cc: xen-devel@lists.xenproject.org, 
    Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, 
    Luca Fancellu <luca.fancellu@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Rich Persaud <persaur@gmail.com>
Subject: Re: [PATCH 02/10] x86 setup: per-arch bootmodule structure, headroom
 field
In-Reply-To: <20230701071835.41599-3-christopher.w.clark@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2307081134270.761183@ubuntu-linux-20-04-desktop>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com> <20230701071835.41599-3-christopher.w.clark@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Sat, 1 Jul 2023, Christopher Clark wrote:
> Next step in incremental work towards adding a non-multiboot internal
> representation of boot modules, converting the fields being accessed for
> the startup calculations.
> 
> Add a new array of structs for per-boot-module state, though only
> allocate space for a single array entry in this change since that is all
> that is required for functionality modified in this patch: moving the
> headroom field for the image decompression calculation into a new
> per-arch boot module struct and then using it in x86 dom0 construction.
> 
> Introduces a per-arch header for x86 for arch-specific boot module
> structures, and add a member to the common boot module structure for
> access to it.
> 
> No functional change intended.
> 
> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
 
[...]


> diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
> new file mode 100644
> index 0000000000..a25054f372
> --- /dev/null
> +++ b/xen/arch/x86/include/asm/bootinfo.h
> @@ -0,0 +1,18 @@
> +#ifndef __ARCH_X86_BOOTINFO_H__
> +#define __ARCH_X86_BOOTINFO_H__
> +
> +struct arch_bootmodule {
> +    unsigned headroom;
> +};
> +
> +#endif
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * tab-width: 4
> + * indent-tabs-mode: nil
> + * End:
> + */

[...]

> diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
> index 6a7d55d20e..b72ae31a66 100644
> --- a/xen/include/xen/bootinfo.h
> +++ b/xen/include/xen/bootinfo.h
> @@ -3,8 +3,19 @@
>  
>  #include <xen/types.h>
>  
> +#ifdef CONFIG_X86
> +#include <asm/bootinfo.h>
> +#else
> +    struct arch_bootmodule { };
> +#endif
> +
> +struct boot_module {
> +    struct arch_bootmodule *arch;
> +};
> +
>  struct boot_info {
>      unsigned int nr_mods;
> +    struct boot_module *mods;

Also here you already made the effort of using the same data structures
we use on ARM, you might as well use the same names too. Otherwise when
we try to use them on ARM it will require a rename somewhere.


>  };
>  
>  #endif
> -- 
> 2.25.1
> 
> 


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 21:32:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 21:32:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560744.876874 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIFXN-0006RH-Kc; Sat, 08 Jul 2023 21:32:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560744.876874; Sat, 08 Jul 2023 21:32:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIFXN-0006RA-HM; Sat, 08 Jul 2023 21:32:17 +0000
Received: by outflank-mailman (input) for mailman id 560744;
 Sat, 08 Jul 2023 21:32:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=QfqP=C2=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qIFXL-0006R4-VJ
 for xen-devel@lists.xenproject.org; Sat, 08 Jul 2023 21:32:16 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e6456c6b-1dd6-11ee-b237-6b7b168915f2;
 Sat, 08 Jul 2023 23:32:13 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 5D47B60B09;
 Sat,  8 Jul 2023 21:32:11 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id E09CBC433C8;
 Sat,  8 Jul 2023 21:32:08 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e6456c6b-1dd6-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688851930;
	bh=vYp3vfup5A2v31lpnAWkGkQ4u+okIigHvdLtYXYkP6I=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=r0oK2TiKS9T2pSu55quFMV4qtkQlleBdsaXD+j6/EBktHdl4i+h4gQvXTOGde0jUA
	 l/nXs179dN7NpBgwN8tvjdy3tXJ4dJ/7bQ8wFnQ4AMH6Bied2B9r+sh3blqHvrmmdR
	 wBk44fiTQLdeJYeCDP5mFb4d6mNgq0E8vGkSqD0G8jQJ56x907L//8J6AgHa7gnG1J
	 /laieC1DMjAXfu6Jm6R3LxsHkxIdqkgrelO9Fe4LW943qa1TCvp2rd+Q1PzT7+9rgu
	 7y4qYKTiva5Zu6uLu8VrM9V3Yy/u2qg3bQ/WR2APVgTquf/VmMdyD13WGiH1YWKY+0
	 v0060e3eWPEDQ==
Date: Sat, 8 Jul 2023 14:32:06 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Christopher Clark <christopher.w.clark@gmail.com>
cc: xen-devel@lists.xenproject.org, 
    Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, 
    Luca Fancellu <luca.fancellu@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Rich Persaud <persaur@gmail.com>
Subject: Re: [PATCH 05/10] xsm: switch XSM init to boot info structures
In-Reply-To: <20230701071835.41599-6-christopher.w.clark@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2307081424120.761183@ubuntu-linux-20-04-desktop>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com> <20230701071835.41599-6-christopher.w.clark@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Sat, 1 Jul 2023, Christopher Clark wrote:
> Change the XSM implementation to use the boot info structure instead of
> the multiboot module_map.
> 
> Drops a dependency on CONFIG_MULTIBOOT, so boot module logic is now
> used whenever the DEVICE_TREE specific logic (for Arm) is not, with the
> bootinfo header conditionally included to ensure no change on Arm.

Given that device tree is used for ARM but also for the Hyperlaunch
configuration, I think this is very confusing.

Ideally I think we should use struct bootinfo (ideally the same version
currently under xen/arch/arm/include/asm/setup.h) for both ARM and x86,
getting rid of any need of any #ifdefs. We should be able to get
xsm_dt_policy_init to work with Hyperlaunch x86 pretty easily?

If that is too much work, then please use #ifdef CONFIG_ARM so at least
it is clear what the difference is.


> Adds a multiboot header inclusion into guest/xen/pvh-boot.c
> since it is no longer provided via transitive inclusion and the source
> in that file uses multiboot structures.
> 
> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
> 
> ---
> Changes since v1: patch is a subset of v1 series patches 2 and 3.
> - Added the <xen/multiboot.h> inclusion to pvh-boot.c
> - Use conditional inclusion for <xen/bootinfo.h>
> 
>  xen/arch/x86/guest/xen/pvh-boot.c |  1 +
>  xen/arch/x86/setup.c              |  2 +-
>  xen/include/xsm/xsm.h             | 28 +++++++--------
>  xen/xsm/xsm_core.c                | 47 +++++++++++++++---------
>  xen/xsm/xsm_policy.c              | 59 ++++++++++++++++---------------
>  5 files changed, 77 insertions(+), 60 deletions(-)
> 
> diff --git a/xen/arch/x86/guest/xen/pvh-boot.c b/xen/arch/x86/guest/xen/pvh-boot.c
> index 9cbe87b61b..1ed04d035c 100644
> --- a/xen/arch/x86/guest/xen/pvh-boot.c
> +++ b/xen/arch/x86/guest/xen/pvh-boot.c
> @@ -9,6 +9,7 @@
>  #include <xen/init.h>
>  #include <xen/lib.h>
>  #include <xen/mm.h>
> +#include <xen/multiboot.h>
>  
>  #include <asm/e820.h>
>  #include <asm/guest.h>
> diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
> index f9b04daebd..a616ccc0a8 100644
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -1835,7 +1835,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>      mmio_ro_ranges = rangeset_new(NULL, "r/o mmio ranges",
>                                    RANGESETF_prettyprint_hex);
>  
> -    xsm_multiboot_init(module_map, mbi);
> +    xsm_bootmodule_init(boot_info);
>  
>      /*
>       * IOMMU-related ACPI table parsing may require some of the system domains
> diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
> index 8dad03fd3d..d409c30be6 100644
> --- a/xen/include/xsm/xsm.h
> +++ b/xen/include/xsm/xsm.h
> @@ -16,8 +16,10 @@
>  #define __XSM_H__
>  
>  #include <xen/alternative-call.h>
> +#ifndef CONFIG_HAS_DEVICE_TREE
> +# include <xen/bootinfo.h>
> +#endif
>  #include <xen/sched.h>
> -#include <xen/multiboot.h>
>  
>  /* policy magic number (defined by XSM_MAGIC) */
>  typedef uint32_t xsm_magic_t;
> @@ -776,15 +778,14 @@ static inline int xsm_argo_send(const struct domain *d, const struct domain *t)
>  
>  #endif /* XSM_NO_WRAPPERS */
>  
> -#ifdef CONFIG_MULTIBOOT
> -int xsm_multiboot_init(
> -    unsigned long *module_map, const multiboot_info_t *mbi);
> -int xsm_multiboot_policy_init(
> -    unsigned long *module_map, const multiboot_info_t *mbi,
> -    void **policy_buffer, size_t *policy_size);
> -#endif
> +#ifndef CONFIG_HAS_DEVICE_TREE
> +int xsm_bootmodule_init(const struct boot_info *info);
> +int xsm_bootmodule_policy_init(
> +    const struct boot_info *info, const unsigned char **policy_buffer,
> +    size_t *policy_size);
> +
> +#else
>  
> -#ifdef CONFIG_HAS_DEVICE_TREE
>  /*
>   * Initialize XSM
>   *
> @@ -826,15 +827,14 @@ static const inline struct xsm_ops *silo_init(void)
>  
>  #include <xsm/dummy.h>
>  
> -#ifdef CONFIG_MULTIBOOT
> -static inline int xsm_multiboot_init (
> -    unsigned long *module_map, const multiboot_info_t *mbi)
> +#ifndef CONFIG_HAS_DEVICE_TREE
> +static inline int xsm_bootmodule_init(const struct boot_info *info)
>  {
>      return 0;
>  }
> -#endif
>  
> -#ifdef CONFIG_HAS_DEVICE_TREE
> +#else
> +
>  static inline int xsm_dt_init(void)
>  {
>      return 0;
> diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
> index eaa028109b..301ae4dc8b 100644
> --- a/xen/xsm/xsm_core.c
> +++ b/xen/xsm/xsm_core.c
> @@ -10,8 +10,12 @@
>   *  as published by the Free Software Foundation.
>   */
>  
> -#include <xen/init.h>
> +#ifndef CONFIG_HAS_DEVICE_TREE
> +# include <xen/bootinfo.h>
> +#endif
>  #include <xen/errno.h>
> +#include <xen/hypercall.h>
> +#include <xen/init.h>
>  #include <xen/lib.h>
>  #include <xen/param.h>
>  
> @@ -138,26 +142,35 @@ static int __init xsm_core_init(const void *policy_buffer, size_t policy_size)
>      return 0;
>  }
>  
> -#ifdef CONFIG_MULTIBOOT
> -int __init xsm_multiboot_init(
> -    unsigned long *module_map, const multiboot_info_t *mbi)
> +/*
> + * ifdef'ing this against multiboot is no longer valid as the boot module
> + * is agnostic and it will be possible to dropped the ifndef should Arm
> + * adopt boot info
> + */
> +#ifndef CONFIG_HAS_DEVICE_TREE
> +int __init xsm_bootmodule_init(const struct boot_info *bootinfo)
>  {
>      int ret = 0;
> -    void *policy_buffer = NULL;
> +    const unsigned char *policy_buffer = NULL;
>      size_t policy_size = 0;
>  
>      printk("XSM Framework v" XSM_FRAMEWORK_VERSION " initialized\n");
>  
>      if ( XSM_MAGIC )
>      {
> -        ret = xsm_multiboot_policy_init(module_map, mbi, &policy_buffer,
> -                                        &policy_size);
> -        if ( ret )
> -        {
> -            bootstrap_map(NULL);
> -            printk(XENLOG_ERR "Error %d initializing XSM policy\n", ret);
> -            return -EINVAL;
> -        }
> +        int ret = xsm_bootmodule_policy_init(bootinfo, &policy_buffer,
> +                                             &policy_size);
> +        bootstrap_map(NULL);
> +
> +        if ( ret == -ENOENT )
> +            /*
> +             * The XSM module needs a policy file but one was not located.
> +             * Report as a warning and continue as the XSM module may late
> +             * load a policy file.
> +             */
> +            printk(XENLOG_WARNING "xsm: starting without a policy loaded!\n");
> +        else if ( ret )
> +            panic("Error %d initializing XSM policy\n", ret);
>      }
>  
>      ret = xsm_core_init(policy_buffer, policy_size);
> @@ -165,9 +178,9 @@ int __init xsm_multiboot_init(
>  
>      return 0;
>  }
> -#endif
>  
> -#ifdef CONFIG_HAS_DEVICE_TREE
> +#else
> +
>  int __init xsm_dt_init(void)
>  {
>      int ret = 0;
> @@ -215,9 +228,9 @@ bool __init has_xsm_magic(paddr_t start)
>  
>      return false;
>  }
> -#endif
> +#endif /* CONFIG_HAS_DEVICE_TREE */
>  
> -#endif
> +#endif /* CONFIG_XSM */
>  
>  long do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
>  {
> diff --git a/xen/xsm/xsm_policy.c b/xen/xsm/xsm_policy.c
> index c6df8c6e06..f1970c8964 100644
> --- a/xen/xsm/xsm_policy.c
> +++ b/xen/xsm/xsm_policy.c
> @@ -18,62 +18,65 @@
>   *
>   */
>  
> -#include <xsm/xsm.h>
> -#ifdef CONFIG_MULTIBOOT
> -#include <asm/boot.h>
> -#include <xen/multiboot.h>
> -#include <asm/setup.h>
> -#endif
>  #include <xen/bitops.h>
> +#ifndef CONFIG_HAS_DEVICE_TREE
> +# include <xen/bootinfo.h>
> +#endif
> +#include <xsm/xsm.h>
>  #ifdef CONFIG_HAS_DEVICE_TREE
> -# include <asm/setup.h>
>  # include <xen/device_tree.h>
> +#else
> +#include <asm/boot.h>
>  #endif
>  
> -#ifdef CONFIG_MULTIBOOT
> -int __init xsm_multiboot_policy_init(
> -    unsigned long *module_map, const multiboot_info_t *mbi,
> -    void **policy_buffer, size_t *policy_size)
> +#include <asm/setup.h>
> +
> +#ifndef CONFIG_HAS_DEVICE_TREE
> +int __init xsm_bootmodule_policy_init(
> +    const struct boot_info *bootinfo, const unsigned char **policy_buffer,
> +    size_t *policy_size)
>  {
> -    int i;
> -    module_t *mod = (module_t *)__va(mbi->mods_addr);
> -    int rc = 0;
> +    unsigned long i;
> +    int rc = -ENOENT;
>      u32 *_policy_start;
>      unsigned long _policy_len;
>  
> -    /*
> -     * Try all modules and see whichever could be the binary policy.
> -     * Adjust module_map for the module that is the binary policy.
> -     */
> -    for ( i = mbi->mods_count-1; i >= 1; i-- )
> -    {
> -        if ( !test_bit(i, module_map) )
> -            continue;
> +#ifdef CONFIG_XSM_FLASK_POLICY
> +    /* Initially set to builtin policy, overriden if boot module is found. */
> +    *policy_buffer = xsm_flask_init_policy;
> +    *policy_size = xsm_flask_init_policy_size;
> +    rc = 0;
> +#endif
>  
> -        _policy_start = bootstrap_map_multiboot(mod + i);
> -        _policy_len   = mod[i].mod_end;
> +    i = bootmodule_index(bootinfo, BOOTMOD_UNKNOWN, 0);
> +    while ( i < bootinfo->nr_mods )
> +    {
> +        _policy_start = bootstrap_map(&bootinfo->mods[i]);
> +        _policy_len   = bootinfo->mods[i].size;
>  
>          if ( (xsm_magic_t)(*_policy_start) == XSM_MAGIC )
>          {
> -            *policy_buffer = _policy_start;
> +            *policy_buffer = (unsigned char *)_policy_start;
>              *policy_size = _policy_len;
>  
>              printk("Policy len %#lx, start at %p.\n",
>                     _policy_len,_policy_start);
>  
> -            __clear_bit(i, module_map);
> +            bootinfo->mods[i].bootmod_type = BOOTMOD_XSM;
> +            rc = 0;
>              break;
>  
>          }
>  
>          bootstrap_map(NULL);
> +        i = bootmodule_index(bootinfo, BOOTMOD_UNKNOWN, ++i);
>      }
>  
>      return rc;
>  }
> -#endif
>  
> -#ifdef CONFIG_HAS_DEVICE_TREE
> +#else
> +
>  int __init xsm_dt_policy_init(void **policy_buffer, size_t *policy_size)
>  {
>      struct bootmodule *mod = boot_module_find_by_kind(BOOTMOD_XSM);
> -- 
> 2.25.1
> 
> 


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 21:44:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 21:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560748.876884 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIFih-0007wY-LQ; Sat, 08 Jul 2023 21:43:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560748.876884; Sat, 08 Jul 2023 21:43:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIFih-0007wR-Ha; Sat, 08 Jul 2023 21:43:59 +0000
Received: by outflank-mailman (input) for mailman id 560748;
 Sat, 08 Jul 2023 21:43:59 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIFig-0007wH-V8; Sat, 08 Jul 2023 21:43:58 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIFig-0005o4-Ir; Sat, 08 Jul 2023 21:43:58 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIFig-0007ry-42; Sat, 08 Jul 2023 21:43:58 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qIFig-0003tb-3N; Sat, 08 Jul 2023 21:43:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=aaGIk+dvUj4HAOLd/Os/23N6sdw2a2X6FojwlHuXWEE=; b=AUw1SgCpuixYdpEY530V0tj/I+
	M4JDyLljZhTZ3E9Wr1/5UaqfBdzDGqp8N2tTFE8B/suZyrFm+LHLKHdyBBNE6kMYgGD8RD3Grjjj5
	i5sjvYufiOcyhpxsGmqPcsmlXPlMZ5nwx8etZkgjQ/LqCxLkX8QgV03kF9aTFkNjF6cg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181739-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181739: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-vhd:<job status>:broken:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:xen-boot:fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:debian-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:debian-install:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:debian-hvm-install:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-pygrub:debian-di-install:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:host-install(5):broken:heisenbug
    linux-linus:test-amd64-amd64-qemuu-nested-amd:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-multivcpu:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-credit2:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-rtds:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/dst_host:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-pygrub:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-xsm:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/src_host:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-rtds:leak-check/basis(11):fail:allowable
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=8689f4f2ea561dd080118eeb05c0255ac9542905
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 08 Jul 2023 21:43:58 +0000

flight 181739 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181739/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-vhd         <job status>                 broken  in 181737
 test-amd64-amd64-xl-qemut-ws16-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2  8 xen-boot               fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl          11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu 12 debian-install          fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2  12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd 12 debian-install          fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd 12 debian-hvm-install  fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 12 debian-hvm-install fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 11 leak-check/basis(11) fail in 181737 REGR. vs. 180278
 test-amd64-amd64-xl-shadow 11 leak-check/basis(11) fail in 181737 REGR. vs. 180278
 test-amd64-amd64-libvirt     12 debian-install fail in 181737 REGR. vs. 180278
 test-amd64-amd64-xl-xsm      12 debian-install fail in 181737 REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 12 debian-hvm-install fail in 181737 REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 12 debian-hvm-install fail in 181737 REGR. vs. 180278
 test-amd64-amd64-pygrub   12 debian-di-install fail in 181737 REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-vhd      5 host-install(5) broken in 181737 pass in 181739
 test-amd64-amd64-qemuu-nested-amd 11 leak-check/basis(11) fail in 181737 pass in 181739
 test-amd64-amd64-xl-multivcpu  8 xen-boot        fail in 181737 pass in 181739
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 8 xen-boot fail in 181737 pass in 181739
 test-amd64-amd64-xl-credit2   8 xen-boot         fail in 181737 pass in 181739
 test-amd64-amd64-xl-pvhv2-amd 11 leak-check/basis(11) fail in 181737 pass in 181739
 test-amd64-amd64-xl-qemut-debianhvm-amd64 8 xen-boot fail in 181737 pass in 181739
 test-amd64-amd64-xl-rtds      8 xen-boot         fail in 181737 pass in 181739
 test-amd64-amd64-xl-qemut-ws16-amd64  8 xen-boot fail in 181737 pass in 181739
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 8 xen-boot fail in 181737 pass in 181739
 test-amd64-amd64-libvirt-pair 13 xen-boot/dst_host fail in 181737 pass in 181739
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 8 xen-boot fail pass in 181737
 test-amd64-amd64-pygrub       8 xen-boot                   fail pass in 181737
 test-amd64-amd64-xl-qemuu-ovmf-amd64 11 leak-check/basis(11) fail pass in 181737
 test-amd64-amd64-xl-qemuu-debianhvm-amd64  8 xen-boot      fail pass in 181737
 test-amd64-amd64-xl-xsm       8 xen-boot                   fail pass in 181737
 test-amd64-amd64-xl-shadow    8 xen-boot                   fail pass in 181737
 test-amd64-amd64-libvirt      8 xen-boot                   fail pass in 181737
 test-amd64-amd64-libvirt-pair 12 xen-boot/src_host         fail pass in 181737

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds     11 leak-check/basis(11)     fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                8689f4f2ea561dd080118eeb05c0255ac9542905
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   83 days
Failing since        180281  2023-04-17 06:24:36 Z   82 days  163 attempts
Testing same since   181737  2023-07-08 03:26:47 Z    0 days    2 attempts

------------------------------------------------------------
3728 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-amd64-amd64-xl-vhd broken

Not pushing.

(No revision log; it would be 618053 lines long.)


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 21:48:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 21:48:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560756.876893 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIFmQ-0000AR-82; Sat, 08 Jul 2023 21:47:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560756.876893; Sat, 08 Jul 2023 21:47:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIFmQ-0000AJ-5N; Sat, 08 Jul 2023 21:47:50 +0000
Received: by outflank-mailman (input) for mailman id 560756;
 Sat, 08 Jul 2023 21:47:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=QfqP=C2=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qIFmP-0000A8-73
 for xen-devel@lists.xenproject.org; Sat, 08 Jul 2023 21:47:49 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 12f19d25-1dd9-11ee-b237-6b7b168915f2;
 Sat, 08 Jul 2023 23:47:47 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 50D8E60B37;
 Sat,  8 Jul 2023 21:47:45 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9510C433C7;
 Sat,  8 Jul 2023 21:47:42 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 12f19d25-1dd9-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688852864;
	bh=5BaYDv86Gvij20JJJcSSU8FHi19D4iMdfEtinUNQjQ0=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=BAFc1eoTRcHQL5Jhn8kR0h1eTQONm5RwE/HLPBw+5XUOJh7sRNezSEESTFmJdasmE
	 txK7v0cI6oKU3f+R8qKmokaTeEye17mcK26/8wB/0TRmxSrdNN0tUaUken00qNHLRZ
	 b5o8BKaDo7szUGWMojZZUQPO7sBESiKlRJ6FFVt7oQpGZTN0qhRqjgG/lFTmn0j5/W
	 Cq0HuwRe220Fn/Iiopi0T0hS5UCr0klGyaYC1fp15VsiO7fuBTMyEINXLAXThNo1hI
	 x1pfpQgIYEc6xe4yC2nxqhsptSu9Isl7MEZuuMDiAlf2GoZ/UC1E5jTTokjPE128LQ
	 +pooEIPJIbp+g==
Date: Sat, 8 Jul 2023 14:47:41 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Stefano Stabellini <sstabellini@kernel.org>
cc: Christopher Clark <christopher.w.clark@gmail.com>, 
    xen-devel@lists.xenproject.org, 
    Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, 
    Bertrand Marquis <bertrand.marquis@arm.com>, 
    Luca Fancellu <luca.fancellu@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Rich Persaud <persaur@gmail.com>
Subject: Re: [PATCH 05/10] xsm: switch XSM init to boot info structures
In-Reply-To: <alpine.DEB.2.22.394.2307081424120.761183@ubuntu-linux-20-04-desktop>
Message-ID: <alpine.DEB.2.22.394.2307081443570.761183@ubuntu-linux-20-04-desktop>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com> <20230701071835.41599-6-christopher.w.clark@gmail.com> <alpine.DEB.2.22.394.2307081424120.761183@ubuntu-linux-20-04-desktop>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Sat, 8 Jul 2023, Stefano Stabellini wrote:
> On Sat, 1 Jul 2023, Christopher Clark wrote:
> > Change the XSM implementation to use the boot info structure instead of
> > the multiboot module_map.
> > 
> > Drops a dependency on CONFIG_MULTIBOOT, so boot module logic is now
> > used whenever the DEVICE_TREE specific logic (for Arm) is not, with the
> > bootinfo header conditionally included to ensure no change on Arm.
> 
> Given that device tree is used for ARM but also for the Hyperlaunch
> configuration, I think this is very confusing.
> 
> Ideally I think we should use struct bootinfo (ideally the same version
> currently under xen/arch/arm/include/asm/setup.h) for both ARM and x86,
> getting rid of any need of any #ifdefs. We should be able to get
> xsm_dt_policy_init to work with Hyperlaunch x86 pretty easily?
> 
> If that is too much work, then please use #ifdef CONFIG_ARM so at least
> it is clear what the difference is.

Wait, is it the case that xsm_bootmodule_init is for the old grub
multiboot protocol? And xsm_dt_init will be used by both Dom0less ARM
and Hyperlaunch x86?

Wouldn't it be better to have a "detect" or "pre-init" function per
module-type (one for xsm, one for microcode, etc.) that configure the
bootinfo and bootmodules correctly and then we can reuse a single xsm
init function in all cases:
- dom0less arm
- hyperlaunch x86
- legacy grub multiboot x86

 
> > Adds a multiboot header inclusion into guest/xen/pvh-boot.c
> > since it is no longer provided via transitive inclusion and the source
> > in that file uses multiboot structures.
> > 
> > Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
> > Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
> > 
> > ---
> > Changes since v1: patch is a subset of v1 series patches 2 and 3.
> > - Added the <xen/multiboot.h> inclusion to pvh-boot.c
> > - Use conditional inclusion for <xen/bootinfo.h>
> > 
> >  xen/arch/x86/guest/xen/pvh-boot.c |  1 +
> >  xen/arch/x86/setup.c              |  2 +-
> >  xen/include/xsm/xsm.h             | 28 +++++++--------
> >  xen/xsm/xsm_core.c                | 47 +++++++++++++++---------
> >  xen/xsm/xsm_policy.c              | 59 ++++++++++++++++---------------
> >  5 files changed, 77 insertions(+), 60 deletions(-)
> > 
> > diff --git a/xen/arch/x86/guest/xen/pvh-boot.c b/xen/arch/x86/guest/xen/pvh-boot.c
> > index 9cbe87b61b..1ed04d035c 100644
> > --- a/xen/arch/x86/guest/xen/pvh-boot.c
> > +++ b/xen/arch/x86/guest/xen/pvh-boot.c
> > @@ -9,6 +9,7 @@
> >  #include <xen/init.h>
> >  #include <xen/lib.h>
> >  #include <xen/mm.h>
> > +#include <xen/multiboot.h>
> >  
> >  #include <asm/e820.h>
> >  #include <asm/guest.h>
> > diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
> > index f9b04daebd..a616ccc0a8 100644
> > --- a/xen/arch/x86/setup.c
> > +++ b/xen/arch/x86/setup.c
> > @@ -1835,7 +1835,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
> >      mmio_ro_ranges = rangeset_new(NULL, "r/o mmio ranges",
> >                                    RANGESETF_prettyprint_hex);
> >  
> > -    xsm_multiboot_init(module_map, mbi);
> > +    xsm_bootmodule_init(boot_info);
> >  
> >      /*
> >       * IOMMU-related ACPI table parsing may require some of the system domains
> > diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
> > index 8dad03fd3d..d409c30be6 100644
> > --- a/xen/include/xsm/xsm.h
> > +++ b/xen/include/xsm/xsm.h
> > @@ -16,8 +16,10 @@
> >  #define __XSM_H__
> >  
> >  #include <xen/alternative-call.h>
> > +#ifndef CONFIG_HAS_DEVICE_TREE
> > +# include <xen/bootinfo.h>
> > +#endif
> >  #include <xen/sched.h>
> > -#include <xen/multiboot.h>
> >  
> >  /* policy magic number (defined by XSM_MAGIC) */
> >  typedef uint32_t xsm_magic_t;
> > @@ -776,15 +778,14 @@ static inline int xsm_argo_send(const struct domain *d, const struct domain *t)
> >  
> >  #endif /* XSM_NO_WRAPPERS */
> >  
> > -#ifdef CONFIG_MULTIBOOT
> > -int xsm_multiboot_init(
> > -    unsigned long *module_map, const multiboot_info_t *mbi);
> > -int xsm_multiboot_policy_init(
> > -    unsigned long *module_map, const multiboot_info_t *mbi,
> > -    void **policy_buffer, size_t *policy_size);
> > -#endif
> > +#ifndef CONFIG_HAS_DEVICE_TREE
> > +int xsm_bootmodule_init(const struct boot_info *info);
> > +int xsm_bootmodule_policy_init(
> > +    const struct boot_info *info, const unsigned char **policy_buffer,
> > +    size_t *policy_size);
> > +
> > +#else
> >  
> > -#ifdef CONFIG_HAS_DEVICE_TREE
> >  /*
> >   * Initialize XSM
> >   *
> > @@ -826,15 +827,14 @@ static const inline struct xsm_ops *silo_init(void)
> >  
> >  #include <xsm/dummy.h>
> >  
> > -#ifdef CONFIG_MULTIBOOT
> > -static inline int xsm_multiboot_init (
> > -    unsigned long *module_map, const multiboot_info_t *mbi)
> > +#ifndef CONFIG_HAS_DEVICE_TREE
> > +static inline int xsm_bootmodule_init(const struct boot_info *info)
> >  {
> >      return 0;
> >  }
> > -#endif
> >  
> > -#ifdef CONFIG_HAS_DEVICE_TREE
> > +#else
> > +
> >  static inline int xsm_dt_init(void)
> >  {
> >      return 0;
> > diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
> > index eaa028109b..301ae4dc8b 100644
> > --- a/xen/xsm/xsm_core.c
> > +++ b/xen/xsm/xsm_core.c
> > @@ -10,8 +10,12 @@
> >   *  as published by the Free Software Foundation.
> >   */
> >  
> > -#include <xen/init.h>
> > +#ifndef CONFIG_HAS_DEVICE_TREE
> > +# include <xen/bootinfo.h>
> > +#endif
> >  #include <xen/errno.h>
> > +#include <xen/hypercall.h>
> > +#include <xen/init.h>
> >  #include <xen/lib.h>
> >  #include <xen/param.h>
> >  
> > @@ -138,26 +142,35 @@ static int __init xsm_core_init(const void *policy_buffer, size_t policy_size)
> >      return 0;
> >  }
> >  
> > -#ifdef CONFIG_MULTIBOOT
> > -int __init xsm_multiboot_init(
> > -    unsigned long *module_map, const multiboot_info_t *mbi)
> > +/*
> > + * ifdef'ing this against multiboot is no longer valid as the boot module
> > + * is agnostic and it will be possible to dropped the ifndef should Arm
> > + * adopt boot info
> > + */
> > +#ifndef CONFIG_HAS_DEVICE_TREE
> > +int __init xsm_bootmodule_init(const struct boot_info *bootinfo)
> >  {
> >      int ret = 0;
> > -    void *policy_buffer = NULL;
> > +    const unsigned char *policy_buffer = NULL;
> >      size_t policy_size = 0;
> >  
> >      printk("XSM Framework v" XSM_FRAMEWORK_VERSION " initialized\n");
> >  
> >      if ( XSM_MAGIC )
> >      {
> > -        ret = xsm_multiboot_policy_init(module_map, mbi, &policy_buffer,
> > -                                        &policy_size);
> > -        if ( ret )
> > -        {
> > -            bootstrap_map(NULL);
> > -            printk(XENLOG_ERR "Error %d initializing XSM policy\n", ret);
> > -            return -EINVAL;
> > -        }
> > +        int ret = xsm_bootmodule_policy_init(bootinfo, &policy_buffer,
> > +                                             &policy_size);
> > +        bootstrap_map(NULL);
> > +
> > +        if ( ret == -ENOENT )
> > +            /*
> > +             * The XSM module needs a policy file but one was not located.
> > +             * Report as a warning and continue as the XSM module may late
> > +             * load a policy file.
> > +             */
> > +            printk(XENLOG_WARNING "xsm: starting without a policy loaded!\n");
> > +        else if ( ret )
> > +            panic("Error %d initializing XSM policy\n", ret);
> >      }
> >  
> >      ret = xsm_core_init(policy_buffer, policy_size);
> > @@ -165,9 +178,9 @@ int __init xsm_multiboot_init(
> >  
> >      return 0;
> >  }
> > -#endif
> >  
> > -#ifdef CONFIG_HAS_DEVICE_TREE
> > +#else
> > +
> >  int __init xsm_dt_init(void)
> >  {
> >      int ret = 0;
> > @@ -215,9 +228,9 @@ bool __init has_xsm_magic(paddr_t start)
> >  
> >      return false;
> >  }
> > -#endif
> > +#endif /* CONFIG_HAS_DEVICE_TREE */
> >  
> > -#endif
> > +#endif /* CONFIG_XSM */
> >  
> >  long do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
> >  {
> > diff --git a/xen/xsm/xsm_policy.c b/xen/xsm/xsm_policy.c
> > index c6df8c6e06..f1970c8964 100644
> > --- a/xen/xsm/xsm_policy.c
> > +++ b/xen/xsm/xsm_policy.c
> > @@ -18,62 +18,65 @@
> >   *
> >   */
> >  
> > -#include <xsm/xsm.h>
> > -#ifdef CONFIG_MULTIBOOT
> > -#include <asm/boot.h>
> > -#include <xen/multiboot.h>
> > -#include <asm/setup.h>
> > -#endif
> >  #include <xen/bitops.h>
> > +#ifndef CONFIG_HAS_DEVICE_TREE
> > +# include <xen/bootinfo.h>
> > +#endif
> > +#include <xsm/xsm.h>
> >  #ifdef CONFIG_HAS_DEVICE_TREE
> > -# include <asm/setup.h>
> >  # include <xen/device_tree.h>
> > +#else
> > +#include <asm/boot.h>
> >  #endif
> >  
> > -#ifdef CONFIG_MULTIBOOT
> > -int __init xsm_multiboot_policy_init(
> > -    unsigned long *module_map, const multiboot_info_t *mbi,
> > -    void **policy_buffer, size_t *policy_size)
> > +#include <asm/setup.h>
> > +
> > +#ifndef CONFIG_HAS_DEVICE_TREE
> > +int __init xsm_bootmodule_policy_init(
> > +    const struct boot_info *bootinfo, const unsigned char **policy_buffer,
> > +    size_t *policy_size)
> >  {
> > -    int i;
> > -    module_t *mod = (module_t *)__va(mbi->mods_addr);
> > -    int rc = 0;
> > +    unsigned long i;
> > +    int rc = -ENOENT;
> >      u32 *_policy_start;
> >      unsigned long _policy_len;
> >  
> > -    /*
> > -     * Try all modules and see whichever could be the binary policy.
> > -     * Adjust module_map for the module that is the binary policy.
> > -     */
> > -    for ( i = mbi->mods_count-1; i >= 1; i-- )
> > -    {
> > -        if ( !test_bit(i, module_map) )
> > -            continue;
> > +#ifdef CONFIG_XSM_FLASK_POLICY
> > +    /* Initially set to builtin policy, overriden if boot module is found. */
> > +    *policy_buffer = xsm_flask_init_policy;
> > +    *policy_size = xsm_flask_init_policy_size;
> > +    rc = 0;
> > +#endif
> >  
> > -        _policy_start = bootstrap_map_multiboot(mod + i);
> > -        _policy_len   = mod[i].mod_end;
> > +    i = bootmodule_index(bootinfo, BOOTMOD_UNKNOWN, 0);
> > +    while ( i < bootinfo->nr_mods )
> > +    {
> > +        _policy_start = bootstrap_map(&bootinfo->mods[i]);
> > +        _policy_len   = bootinfo->mods[i].size;
> >  
> >          if ( (xsm_magic_t)(*_policy_start) == XSM_MAGIC )
> >          {
> > -            *policy_buffer = _policy_start;
> > +            *policy_buffer = (unsigned char *)_policy_start;
> >              *policy_size = _policy_len;
> >  
> >              printk("Policy len %#lx, start at %p.\n",
> >                     _policy_len,_policy_start);
> >  
> > -            __clear_bit(i, module_map);
> > +            bootinfo->mods[i].bootmod_type = BOOTMOD_XSM;
> > +            rc = 0;
> >              break;
> >  
> >          }
> >  
> >          bootstrap_map(NULL);
> > +        i = bootmodule_index(bootinfo, BOOTMOD_UNKNOWN, ++i);
> >      }
> >  
> >      return rc;
> >  }
> > -#endif
> >  
> > -#ifdef CONFIG_HAS_DEVICE_TREE
> > +#else
> > +
> >  int __init xsm_dt_policy_init(void **policy_buffer, size_t *policy_size)
> >  {
> >      struct bootmodule *mod = boot_module_find_by_kind(BOOTMOD_XSM);
> > -- 
> > 2.25.1
> > 
> > 
> 


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 22:05:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 22:05:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560762.876904 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIG3L-0002dR-Qs; Sat, 08 Jul 2023 22:05:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560762.876904; Sat, 08 Jul 2023 22:05:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIG3L-0002dK-Mx; Sat, 08 Jul 2023 22:05:19 +0000
Received: by outflank-mailman (input) for mailman id 560762;
 Sat, 08 Jul 2023 22:05:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=QfqP=C2=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qIG3K-0002cy-Rz
 for xen-devel@lists.xenproject.org; Sat, 08 Jul 2023 22:05:18 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 84f6b73f-1ddb-11ee-b237-6b7b168915f2;
 Sun, 09 Jul 2023 00:05:17 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 8BD4E601E3;
 Sat,  8 Jul 2023 22:05:15 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BC69C433C8;
 Sat,  8 Jul 2023 22:05:13 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 84f6b73f-1ddb-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688853915;
	bh=tk6NiLg0G8rJdo0LEiJDKRFlptneY3zXAxuDJOdpjPM=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=oQoU4pcCdGyfKGj8RunJtkq3Moj5GDiKCtFPdf5MO/ap7hLQpqXhUAcGwC+i3B689
	 0+aRR0JTdBW9H9VrNvB6ON/c9W5BrNtqCHd/1sP+id+mBD0ozJaCudMB/zZ3ioHAF7
	 Bdrb1LuEHMbxTnIOVnsuKU6O2jPBOSRYWZQ+mTWIW42G5tzWdu5t6Q9TjgBaffZOR3
	 cNcKsmmqBhGlkpuGtqzunqy1SEsu49laq4ESEGFgBo/nqQ1OFQG5CYF3pvAk8XH0SP
	 7Jgn2fQ6CohBRYTw4YLrJsKwARjHEsJbO/CBBlfbtyDecUEzWZ4EkPAZ2ip9WV6Hjx
	 fJCdg48K/ZNxA==
Date: Sat, 8 Jul 2023 15:05:11 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Christopher Clark <christopher.w.clark@gmail.com>
cc: xen-devel@lists.xenproject.org, 
    Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, 
    Luca Fancellu <luca.fancellu@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Rich Persaud <persaur@gmail.com>
Subject: Re: [PATCH 06/10] x86 setup, microcode: switch to the new bootinfo
 structures
In-Reply-To: <20230701071835.41599-7-christopher.w.clark@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2307081459000.761183@ubuntu-linux-20-04-desktop>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com> <20230701071835.41599-7-christopher.w.clark@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Sat, 1 Jul 2023, Christopher Clark wrote:
> Next step in incremental work towards adding a non-multiboot internal
> representation of boot modules, converting the fields being accessed for
> the startup calculations.
> 
> Move the per-module scan logic into a dedicated function from the
> iteration loop and set the BOOTMOD_UCODE module type when microcode is found.
> 
> Completes the conversion from the module_map bitmap in x86 setup so it
> can be removed, along with the temporary bootstrap_map multiboot wrapper
> since the last code that uses it is removed in this change.
> 
> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes since v1: patch is a subset of v1 series patches 2 and 3.
> - Added the removal of the temporary bootstrap map function
> 
>  xen/arch/x86/cpu/microcode/core.c    | 148 +++++++++++++++------------
>  xen/arch/x86/include/asm/boot.h      |  13 ---
>  xen/arch/x86/include/asm/microcode.h |   7 +-
>  xen/arch/x86/setup.c                 |   8 +-
>  4 files changed, 89 insertions(+), 87 deletions(-)
> 
> diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
> index ce3c8042a2..d2cae9b6b4 100644
> --- a/xen/arch/x86/cpu/microcode/core.c
> +++ b/xen/arch/x86/cpu/microcode/core.c
> @@ -22,12 +22,12 @@
>   */
>  
>  #include <xen/alternative-call.h>
> +#include <xen/bootinfo.h>
>  #include <xen/cpu.h>
>  #include <xen/earlycpio.h>
>  #include <xen/err.h>
>  #include <xen/guest_access.h>
>  #include <xen/init.h>
> -#include <xen/multiboot.h>
>  #include <xen/param.h>
>  #include <xen/spinlock.h>
>  #include <xen/stop_machine.h>
> @@ -57,7 +57,6 @@
>   */
>  #define MICROCODE_UPDATE_TIMEOUT_US 1000000
>  
> -static module_t __initdata ucode_mod;
>  static signed int __initdata ucode_mod_idx;
>  static bool_t __initdata ucode_mod_forced;
>  static unsigned int nr_cores;
> @@ -150,75 +149,109 @@ static int __init cf_check parse_ucode(const char *s)
>  }
>  custom_param("ucode", parse_ucode);
>  
> -void __init microcode_scan_module(
> -    unsigned long *module_map,
> -    const multiboot_info_t *mbi)
> +#define MICROCODE_MODULE_MATCH 1
> +#define MICROCODE_MODULE_NONMATCH 0
> +
> +static int __init microcode_check_module(struct boot_module *mod)
>  {
> -    module_t *mod = (module_t *)__va(mbi->mods_addr);
>      uint64_t *_blob_start;
>      unsigned long _blob_size;
> -    struct cpio_data cd;
> +    struct cpio_data cd = { NULL, 0 };
>      long offset;
>      const char *p = NULL;
> -    int i;
> -
> -    ucode_blob.size = 0;
> -    if ( !ucode_scan )
> -        return;
>  
>      if ( boot_cpu_data.x86_vendor == X86_VENDOR_AMD )
>          p = "kernel/x86/microcode/AuthenticAMD.bin";
>      else if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
>          p = "kernel/x86/microcode/GenuineIntel.bin";
>      else
> +        return -EFAULT;
> +
> +    _blob_start = bootstrap_map(mod);
> +    _blob_size = mod->size;
> +    if ( !_blob_start )
> +    {
> +        printk("Could not map multiboot module (0x%lx) (size: %ld)\n",
> +               mod->start, _blob_size);
> +        /* Non-fatal error, so just say no match */
> +        return MICROCODE_MODULE_NONMATCH;
> +    }
> +
> +    cd = find_cpio_data(p, _blob_start, _blob_size, &offset /* ignore */);
> +
> +    if ( cd.data )
> +    {
> +        ucode_blob.size = cd.size;
> +        ucode_blob.data = cd.data;
> +
> +        mod->bootmod_type = BOOTMOD_UCODE;
> +        return MICROCODE_MODULE_MATCH;
> +    }
> +
> +    bootstrap_map(NULL);
> +
> +    return MICROCODE_MODULE_NONMATCH;
> +}
> +
> +void __init microcode_scan_module(struct boot_info *bootinfo)
> +{
> +    int i;
> +
> +    if ( !ucode_scan )
>          return;
>  
> -    /*
> -     * Try all modules and see whichever could be the microcode blob.
> -     */
> -    for ( i = 1 /* Ignore dom0 kernel */; i < mbi->mods_count; i++ )
> +    i = bootmodule_index(bootinfo, BOOTMOD_UNKNOWN, 0);
> +    while ( i < bootinfo->nr_mods )
>      {
> -        if ( !test_bit(i, module_map) )
> -            continue;
> +        int ret = microcode_check_module(&bootinfo->mods[i]);
>  
> -        _blob_start = bootstrap_map_multiboot(&mod[i]);
> -        _blob_size = mod[i].mod_end;
> -        if ( !_blob_start )
> +        switch ( ret )
>          {
> -            printk("Could not map multiboot module #%d (size: %ld)\n",
> -                   i, _blob_size);
> +        case MICROCODE_MODULE_MATCH:
> +            return;
> +        case MICROCODE_MODULE_NONMATCH:
> +            i = bootmodule_index(bootinfo, BOOTMOD_UNKNOWN, ++i);
>              continue;
> +        default:
> +            printk("%s: (err: %d) unable to check microcode\n",
> +                   __func__, ret);
> +            return;
>          }
> -        cd.data = NULL;
> -        cd.size = 0;
> -        cd = find_cpio_data(p, _blob_start, _blob_size, &offset /* ignore */);
> -        if ( cd.data )
> -        {
> -            ucode_blob.size = cd.size;
> -            ucode_blob.data = cd.data;
> -            break;
> -        }
> -        bootstrap_map(NULL);
>      }
>  }
>  
> -static void __init microcode_grab_module(
> -    unsigned long *module_map,
> -    const multiboot_info_t *mbi)
> +static void __init microcode_grab_module(struct boot_info *bootinfo)
>  {
> -    module_t *mod = (module_t *)__va(mbi->mods_addr);
> +    ucode_blob.size = 0;
>  
>      if ( ucode_mod_idx < 0 )
> -        ucode_mod_idx += mbi->mods_count;
> -    if ( ucode_mod_idx <= 0 || ucode_mod_idx >= mbi->mods_count ||
> -         !__test_and_clear_bit(ucode_mod_idx, module_map) )
> -        goto scan;
> -    ucode_mod = mod[ucode_mod_idx];
> -scan:
> +        ucode_mod_idx += bootinfo->nr_mods;
> +    if ( ucode_mod_idx >= 0 &&  ucode_mod_idx <= bootinfo->nr_mods &&
> +         bootinfo->mods[ucode_mod_idx].bootmod_type == BOOTMOD_UNKNOWN )
> +    {
> +        int ret = microcode_check_module(&bootinfo->mods[ucode_mod_idx]);
> +
> +        switch ( ret )
> +        {
> +        case MICROCODE_MODULE_MATCH:
> +            return;
> +        case MICROCODE_MODULE_NONMATCH:
> +            break;
> +        default:
> +            printk("%s: (err: %d) unable to check microcode\n",
> +                   __func__, ret);
> +            return;
> +        }
> +    }
> +
>      if ( ucode_scan )
> -        microcode_scan_module(module_map, mbi);
> +        microcode_scan_module(bootinfo);
>  }
>  
> +/* Undefining as they are not needed anymore */
> +#undef MICROCODE_MODULE_MATCH
> +#undef MICROCODE_MODULE_NONMATCH
> +
>  static struct microcode_ops __ro_after_init ucode_ops;
>  
>  static DEFINE_SPINLOCK(microcode_mutex);
> @@ -738,11 +771,6 @@ static int __init cf_check microcode_init(void)
>          ucode_blob.size = 0;
>          ucode_blob.data = NULL;
>      }
> -    else if ( ucode_mod.mod_end )
> -    {
> -        bootstrap_map(NULL);
> -        ucode_mod.mod_end = 0;
> -    }
>  
>      return 0;
>  }
> @@ -786,8 +814,7 @@ static int __init early_update_cache(const void *data, size_t len)
>      return rc;
>  }
>  
> -int __init microcode_init_cache(unsigned long *module_map,
> -                                const struct multiboot_info *mbi)
> +int __init microcode_init_cache(struct boot_info *bootinfo)
>  {
>      int rc = 0;
>  
> @@ -796,12 +823,9 @@ int __init microcode_init_cache(unsigned long *module_map,
>  
>      if ( ucode_scan )
>          /* Need to rescan the modules because they might have been relocated */
> -        microcode_scan_module(module_map, mbi);
> +        microcode_scan_module(bootinfo);
>  
> -    if ( ucode_mod.mod_end )
> -        rc = early_update_cache(bootstrap_map_multiboot(&ucode_mod),
> -                                ucode_mod.mod_end);
> -    else if ( ucode_blob.size )
> +    if ( ucode_blob.size )
>          rc = early_update_cache(ucode_blob.data, ucode_blob.size);
>  
>      return rc;
> @@ -819,11 +843,6 @@ static int __init early_microcode_update_cpu(void)
>          len = ucode_blob.size;
>          data = ucode_blob.data;
>      }
> -    else if ( ucode_mod.mod_end )
> -    {
> -        len = ucode_mod.mod_end;
> -        data = bootstrap_map_multiboot(&ucode_mod);
> -    }
>  
>      if ( !data )
>          return -ENOMEM;
> @@ -842,8 +861,7 @@ static int __init early_microcode_update_cpu(void)
>      return microcode_update_cpu(patch);
>  }
>  
> -int __init early_microcode_init(unsigned long *module_map,
> -                                const struct multiboot_info *mbi)
> +int __init early_microcode_init(struct boot_info *bootinfo)
>  {
>      const struct cpuinfo_x86 *c = &boot_cpu_data;
>      int rc = 0;
> @@ -867,11 +885,11 @@ int __init early_microcode_init(unsigned long *module_map,
>          return -ENODEV;
>      }
>  
> -    microcode_grab_module(module_map, mbi);
> +    microcode_grab_module(bootinfo);
>  
>      ucode_ops.collect_cpu_info();
>  
> -    if ( ucode_mod.mod_end || ucode_blob.size )
> +    if ( ucode_blob.size )
>          rc = early_microcode_update_cpu();
>  
>      return rc;
> diff --git a/xen/arch/x86/include/asm/boot.h b/xen/arch/x86/include/asm/boot.h
> index bcf4f2e2e3..e51fd32280 100644
> --- a/xen/arch/x86/include/asm/boot.h
> +++ b/xen/arch/x86/include/asm/boot.h
> @@ -6,19 +6,6 @@
>  
>  #include <asm/setup.h>
>  
> -static inline void *bootstrap_map_multiboot(const module_t *mod)
> -{
> -    struct boot_module bm;
> -
> -    if ( !mod )
> -        return bootstrap_map(NULL);
> -
> -    bm.start = mod->mod_start << PAGE_SHIFT;
> -    bm.size = mod->mod_end;
> -
> -    return bootstrap_map(&bm);
> -}
> -
>  static inline unsigned long bootmodule_index(
>      const struct boot_info *info, bootmod_type_t bootmod_type,
>      unsigned long start)
> diff --git a/xen/arch/x86/include/asm/microcode.h b/xen/arch/x86/include/asm/microcode.h
> index 62ce3418f7..803fbbb270 100644
> --- a/xen/arch/x86/include/asm/microcode.h
> +++ b/xen/arch/x86/include/asm/microcode.h
> @@ -1,6 +1,7 @@
>  #ifndef ASM_X86__MICROCODE_H
>  #define ASM_X86__MICROCODE_H
>  
> +#include <xen/bootinfo.h>
>  #include <xen/types.h>
>  #include <xen/percpu.h>
>  
> @@ -23,10 +24,8 @@ DECLARE_PER_CPU(struct cpu_signature, cpu_sig);
>  
>  void microcode_set_module(unsigned int idx);
>  int microcode_update(XEN_GUEST_HANDLE(const_void), unsigned long len);
> -int early_microcode_init(unsigned long *module_map,
> -                         const struct multiboot_info *mbi);
> -int microcode_init_cache(unsigned long *module_map,
> -                         const struct multiboot_info *mbi);
> +int early_microcode_init(struct boot_info *bootinfo);
> +int microcode_init_cache(struct boot_info *bootinfo);
>  int microcode_update_one(void);
>  
>  #endif /* ASM_X86__MICROCODE_H */
> diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
> index a616ccc0a8..50a1a124b0 100644
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -1023,7 +1023,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>      unsigned int initrdidx, num_parked = 0;
>      multiboot_info_t *mbi;
>      module_t *mod;
> -    unsigned long nr_pages, raw_max_page, module_map[1];
> +    unsigned long nr_pages, raw_max_page;
>      int i, j, e820_warn = 0, bytes = 0;
>      unsigned long eb_start, eb_end;
>      bool acpi_boot_table_init_done = false, relocated = false;
> @@ -1190,8 +1190,6 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>      }
>  
>      /* Dom0 kernel is the first boot module */
> -    bitmap_fill(module_map, mbi->mods_count);
> -    __clear_bit(0, module_map); /* Dom0 kernel is always first */
>      boot_info->mods[0].bootmod_type = BOOTMOD_KERNEL;
>  
>      if ( pvh_boot )
> @@ -1371,7 +1369,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>       * TODO: load ucode earlier once multiboot modules become accessible
>       * at an earlier stage.
>       */
> -    early_microcode_init(module_map, mbi);
> +    early_microcode_init(boot_info);
>  
>      if ( xen_phys_start )
>      {
> @@ -1906,7 +1904,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>  
>      timer_init();
>  
> -    microcode_init_cache(module_map, mbi); /* Needs xmalloc() */
> +    microcode_init_cache(boot_info); /* Needs xmalloc() */
>  
>      tsx_init(); /* Needs microcode.  May change HLE/RTM feature bits. */
>  
> -- 
> 2.25.1
> 
> 


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 22:22:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 22:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560768.876913 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIGJc-00051K-5v; Sat, 08 Jul 2023 22:22:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560768.876913; Sat, 08 Jul 2023 22:22:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIGJc-00051D-3H; Sat, 08 Jul 2023 22:22:08 +0000
Received: by outflank-mailman (input) for mailman id 560768;
 Sat, 08 Jul 2023 22:22:06 +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
 <SRS0=QfqP=C2=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qIGJa-000517-EA
 for xen-devel@lists.xenproject.org; Sat, 08 Jul 2023 22:22:06 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dd55a512-1ddd-11ee-8611-37d641c3527e;
 Sun, 09 Jul 2023 00:22:04 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id DBE5860010;
 Sat,  8 Jul 2023 22:22:02 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46A55C433C7;
 Sat,  8 Jul 2023 22:22:00 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dd55a512-1ddd-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688854922;
	bh=mpcSDCe7cA9qf5IpRPz5wsMn/rrfPc44mPMZsAQO1ng=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=h018IwqD05IFmoYgr7UGrEG6MJSDHhTT8KxTQracoNzewQ/WUdatkmcpwBZvJytEw
	 0mUrKt3rZu8kY/UmKVIk6Q9sxkuPzMEmtBUt48jyN9Pect+Jp0wSf4iygefYEm4IaX
	 StOqsb7enbDnIK9Bj8Q8c3VXn/7oCqmUS3LfW7qDAbbkGRIa+sbNNXdPviQXe1BJHr
	 RbFaGC/5hNS9G336YA5E/sz6v2O6aizQpPp++gwRXWhHin2gbCU3PesauokBcN1wsA
	 VRkMcFhDF969Uchu4rErZdfwbAt/x9d6Z/9ucgoXklV65CTLqSi79kFnTkwKzIROzu
	 7jV5e7B/CPQiw==
Date: Sat, 8 Jul 2023 15:21:58 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Christopher Clark <christopher.w.clark@gmail.com>
cc: xen-devel@lists.xenproject.org, 
    Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, 
    Luca Fancellu <luca.fancellu@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Rich Persaud <persaur@gmail.com>
Subject: Re: [PATCH 09/10] arm setup: use common integer-typed bootmod
 definition
In-Reply-To: <20230701071835.41599-10-christopher.w.clark@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2307081519090.761183@ubuntu-linux-20-04-desktop>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com> <20230701071835.41599-10-christopher.w.clark@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Sat, 1 Jul 2023, Christopher Clark wrote:
> This change enables inclusion of <xen/bootinfo.h> in Arm builds,
> required for subsequent patches in this series.
> 
> It replaces the enum definition of bootmodule_kind with bootmod_type_t
> as enums are not fixed size as needed for packed structs which are
> needed for boot structures in subsequent changes.
> 
> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
> 
> ---
> New for v2 series.
> 
>  xen/arch/arm/include/asm/setup.h | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
> index 19dc637d55..7e0598217a 100644
> --- a/xen/arch/arm/include/asm/setup.h
> +++ b/xen/arch/arm/include/asm/setup.h
> @@ -3,6 +3,7 @@
>  
>  #include <public/version.h>
>  #include <asm/p2m.h>
> +#include <xen/bootinfo.h>

I see this as very positive, but then I do think we should use a single
definition of struct bootmodule, struct bootinfo and struct bootcmdline.

I don't think it is a good idea to have struct bootinfo here and struct
boot_info in xen/include/xen/bootinfo.h with a similar definition and
purpose.

I think we should have a single definition of struct bootinfo and struct
bootmodule that works everywhere.


>  #include <xen/device_tree.h>
>  
>  #define MIN_FDT_ALIGN 8
> @@ -12,15 +13,7 @@
>  
>  #define MAX_MODULES 32 /* Current maximum useful modules */
>  
> -typedef enum {
> -    BOOTMOD_XEN,
> -    BOOTMOD_FDT,
> -    BOOTMOD_KERNEL,
> -    BOOTMOD_RAMDISK,
> -    BOOTMOD_XSM,
> -    BOOTMOD_GUEST_DTB,
> -    BOOTMOD_UNKNOWN
> -}  bootmodule_kind;
> +typedef bootmod_type_t bootmodule_kind;

Why can't we use an enum for it?


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 22:22:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 22:22:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560773.876924 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIGKB-0005ZJ-Js; Sat, 08 Jul 2023 22:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560773.876924; Sat, 08 Jul 2023 22:22:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIGKB-0005ZC-Gi; Sat, 08 Jul 2023 22:22:43 +0000
Received: by outflank-mailman (input) for mailman id 560773;
 Sat, 08 Jul 2023 22:22:42 +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
 <SRS0=QfqP=C2=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qIGK9-000517-VW
 for xen-devel@lists.xenproject.org; Sat, 08 Jul 2023 22:22:41 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f2c3e4d9-1ddd-11ee-8611-37d641c3527e;
 Sun, 09 Jul 2023 00:22:40 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id D905260010;
 Sat,  8 Jul 2023 22:22:38 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 856B2C433C7;
 Sat,  8 Jul 2023 22:22:36 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f2c3e4d9-1ddd-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688854958;
	bh=eY0cOWD3nJddZmtYCGjKmZRXpteaQG62tae8NiGIonw=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=WDyvlTCgzud/Px2NYuDSWjCAWiH3w6e1NJKEdZb+rGvMC8O+0W7HU63BstR5mOYlp
	 P8zjJRBI6b+Q584QRPt5wbcmj6u4E/U7jkBKyQXweSz8GutsPEN2AGqp1nIKH7krmu
	 Wg3rDHtE95IUQNTWbZ38x/T0ytISEpUErm8xZ3PtEDV5zbm12Mc5q5rBW6hx/CQmGp
	 fKhxv7ilpW5Jrl9dX9VeE+OrbnrC+K5MVrrkSM88MxaoQq7wcbhqu3Ijsqt1jJwSmx
	 FowSD6fuUZxl1WYjEGL2Wut0YI39QmOm0BeDwLWQ2MLnuSI2rKptUV+ihbM8UOqyoK
	 KsIaqoYEHRl/A==
Date: Sat, 8 Jul 2023 15:22:34 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Christopher Clark <christopher.w.clark@gmail.com>
cc: xen-devel@lists.xenproject.org, 
    Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, 
    Luca Fancellu <luca.fancellu@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Rich Persaud <persaur@gmail.com>
Subject: Re: [PATCH 08/10] x86, arm, riscv: add per-arch bootinfo headers
In-Reply-To: <20230701071835.41599-9-christopher.w.clark@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2307081522180.761183@ubuntu-linux-20-04-desktop>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com> <20230701071835.41599-9-christopher.w.clark@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Sat, 1 Jul 2023, Christopher Clark wrote:
> Changes to ensure that inclusion of <xen/bootinfo.h> succeeds in each
> of the main archtecture builds and in the 32-bit early x86 boot build.
> 
> The <xen/bootinfo.h> header contains structures that will be used in efi
> logic prior to the main start of Xen, so it needs to be suitable for
> inclusion in Arm source files.
> 
> The same header will also be included in early x86 boot logic, where
> asm/* headers are not reachable, and so they cannot be transitively
> included, so a ifdef condition is needed to prevent an attempt to
> include <asm/bootinfo.h> from within <xen/bootinfo.h> in that case.
> 
> The early x86 boot logic can then directly include <asm/bootinfo.h> via
> a specified directory path where it can be included successfully.
> 
> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>

I think this is fine.


> ---
> New for v2 series.
> 
>  xen/arch/arm/include/asm/bootinfo.h   | 20 ++++++++++++++++++++
>  xen/arch/riscv/include/asm/bootinfo.h | 20 ++++++++++++++++++++
>  xen/include/xen/bootinfo.h            |  7 ++-----
>  3 files changed, 42 insertions(+), 5 deletions(-)
>  create mode 100644 xen/arch/arm/include/asm/bootinfo.h
>  create mode 100644 xen/arch/riscv/include/asm/bootinfo.h
> 
> diff --git a/xen/arch/arm/include/asm/bootinfo.h b/xen/arch/arm/include/asm/bootinfo.h
> new file mode 100644
> index 0000000000..5316c87a3d
> --- /dev/null
> +++ b/xen/arch/arm/include/asm/bootinfo.h
> @@ -0,0 +1,20 @@
> +#ifndef __ARCH_ARM_BOOTINFO_H__
> +#define __ARCH_ARM_BOOTINFO_H__
> +
> +struct __packed arch_bootmodule { };
> +DEFINE_STRUCT_PTR_TYPE(arch_bootmodule);
> +
> +struct __packed arch_boot_info { };
> +DEFINE_STRUCT_PTR_TYPE(arch_boot_info);
> +
> +#endif
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * tab-width: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> diff --git a/xen/arch/riscv/include/asm/bootinfo.h b/xen/arch/riscv/include/asm/bootinfo.h
> new file mode 100644
> index 0000000000..5316c87a3d
> --- /dev/null
> +++ b/xen/arch/riscv/include/asm/bootinfo.h
> @@ -0,0 +1,20 @@
> +#ifndef __ARCH_ARM_BOOTINFO_H__
> +#define __ARCH_ARM_BOOTINFO_H__
> +
> +struct __packed arch_bootmodule { };
> +DEFINE_STRUCT_PTR_TYPE(arch_bootmodule);
> +
> +struct __packed arch_boot_info { };
> +DEFINE_STRUCT_PTR_TYPE(arch_boot_info);
> +
> +#endif
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * tab-width: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
> index 8389da4f72..bf5586a76b 100644
> --- a/xen/include/xen/bootinfo.h
> +++ b/xen/include/xen/bootinfo.h
> @@ -5,11 +5,8 @@
>  #include <xen/compiler.h>
>  #include <xen/mm-frame.h>
>  
> -#ifdef CONFIG_X86
> -#include <asm/bootinfo.h>
> -#else
> -    struct arch_bootmodule { };
> -    struct arch_boot_info { };
> +#if defined CONFIG_X86 || CONFIG_ARM || CONFIG_RISCV
> +# include <asm/bootinfo.h>
>  #endif
>  
>  /* Boot module binary type / purpose */
> -- 
> 2.25.1
> 
> 


From xen-devel-bounces@lists.xenproject.org Sat Jul 08 22:24:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 08 Jul 2023 22:24:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560778.876934 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIGLl-0006AR-Te; Sat, 08 Jul 2023 22:24:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560778.876934; Sat, 08 Jul 2023 22:24:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIGLl-0006AK-Qf; Sat, 08 Jul 2023 22:24:21 +0000
Received: by outflank-mailman (input) for mailman id 560778;
 Sat, 08 Jul 2023 22:24:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=QfqP=C2=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qIGLl-0006AC-G6
 for xen-devel@lists.xenproject.org; Sat, 08 Jul 2023 22:24:21 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2e703fbc-1dde-11ee-b237-6b7b168915f2;
 Sun, 09 Jul 2023 00:24:20 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id F0C926023F;
 Sat,  8 Jul 2023 22:24:18 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97977C433C8;
 Sat,  8 Jul 2023 22:24:16 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2e703fbc-1dde-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688855058;
	bh=gve7EL/o01er41M/hJovg8UNy+5NeOpVbO08ligNgIM=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=MHgOXUC/V3f3ubnd7KmVMYT1LLVISx5s6MHB1jQyOOjf4sZeBFnr2j37x/FQZ681x
	 zyo71irGMS2Im0LVLZALv6d60R/5V4Wzd8FubOZpQzf+hC4lU3Uoleuj+Fu5thsr6z
	 /+UOLcuQXoCbpOEmVAiwsBQRQc8yMPRFBejI5PppXB7tG7lMtTz9HbquUPMJpIkG1V
	 Pt/Zi2lCaZ1MiS9HKRSnMz2Tjw+GXnTqG47eJZGdW8xg3qtdZ3ky+fRlGZe2zzml75
	 2KgO0TnMRI4jTqc96TwDWpM52zEcd6wyFoEDhtqG23hzWzsiW95LihuH9exxDk8913
	 AANqlpBD/HU1w==
Date: Sat, 8 Jul 2023 15:24:14 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Christopher Clark <christopher.w.clark@gmail.com>
cc: xen-devel@lists.xenproject.org, 
    Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, 
    Luca Fancellu <luca.fancellu@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Rich Persaud <persaur@gmail.com>
Subject: Re: [PATCH 07/10] x86 boot: define paddr_t and add macros for
 typedefing struct pointers
In-Reply-To: <20230701071835.41599-8-christopher.w.clark@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2307081522410.761183@ubuntu-linux-20-04-desktop>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com> <20230701071835.41599-8-christopher.w.clark@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Sat, 1 Jul 2023, Christopher Clark wrote:
> Pointer fields within structs need to be defined as fixed size types in
> the x86 boot build environment. Using a typedef for the field type
> rather than a struct pointer type enables the type definition to
> be changed in the 32-bit boot build and the main hypervisor build,
> allowing for a single common structure definition and a common header file.

Sorry for my ignorance, but why?

struct boot_module is not used as part of any ABI, right? It is
populated by Xen at boot by hand. Why do we need a specific memory
layout for it?



> Introduces DEFINE_STRUCT_PTR_TYPE and DEFINE_PTR_TYPE which will
> generate typedefs with a _ptr_t suffix for pointers to the specified
> type. This is then used in <xen/bootinfo.h> for pointers within structs
> as preparation for using these headers in the x86 boot build.
> 
> The 32-bit behaviour is obtained by inclusion of "defs.h" first with a
> check for such an existing definition on the <xen/types.h> version.
> 
> paddr_t is used in <xen/bootinfo.h> so a definition is added here to
> the x86 boot environment defs.h header.
> 
> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>


> ---
> Changes since v2: This is two v2 patches merged into one for v3.
> Changes since v1: New in v2 of series.
> 
>  xen/arch/x86/boot/defs.h            |  9 +++++++++
>  xen/arch/x86/include/asm/bootinfo.h |  4 +++-
>  xen/include/xen/bootinfo.h          |  9 +++++----
>  xen/include/xen/types.h             | 11 +++++++++++
>  4 files changed, 28 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/arch/x86/boot/defs.h b/xen/arch/x86/boot/defs.h
> index f9840044ec..bc0f1b5cf8 100644
> --- a/xen/arch/x86/boot/defs.h
> +++ b/xen/arch/x86/boot/defs.h
> @@ -60,4 +60,13 @@ typedef u64 uint64_t;
>  #define U16_MAX		((u16)(~0U))
>  #define UINT_MAX	(~0U)
>  
> +typedef unsigned long long paddr_t;
> +
> +#define DEFINE_STRUCT_PTR_TYPE(struct_name) \
> +    typedef uint64_t struct_name ## _ptr_t;
> +
> +#define DEFINE_PTR_TYPE(type) \
> +    typedef uint64_t type ## _ptr_t;
> +DEFINE_PTR_TYPE(char);
> +
>  #endif /* __BOOT_DEFS_H__ */
> diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
> index 30c27980e0..989fb7a1da 100644
> --- a/xen/arch/x86/include/asm/bootinfo.h
> +++ b/xen/arch/x86/include/asm/bootinfo.h
> @@ -6,6 +6,7 @@ struct arch_bootmodule {
>      uint32_t flags;
>      unsigned headroom;
>  };
> +DEFINE_STRUCT_PTR_TYPE(arch_bootmodule);
>  
>  struct arch_boot_info {
>      uint32_t flags;
> @@ -14,11 +15,12 @@ struct arch_boot_info {
>  #define BOOTINFO_FLAG_X86_MEMMAP       1U << 6
>  #define BOOTINFO_FLAG_X86_LOADERNAME   1U << 9
>  
> -    char *boot_loader_name;
> +    char_ptr_t boot_loader_name;
>  
>      uint32_t mmap_length;
>      paddr_t mmap_addr;
>  };
> +DEFINE_STRUCT_PTR_TYPE(arch_boot_info);
>  
>  struct __packed mb_memmap {
>      uint32_t size;
> diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
> index 2f4284a91f..8389da4f72 100644
> --- a/xen/include/xen/bootinfo.h
> +++ b/xen/include/xen/bootinfo.h
> @@ -35,17 +35,18 @@ struct boot_module {
>      mfn_t mfn;
>      size_t size;
>  
> -    struct arch_bootmodule *arch;
> +    arch_bootmodule_ptr_t arch;
>      struct boot_string string;
>  };
> +DEFINE_STRUCT_PTR_TYPE(boot_module);
>  
>  struct boot_info {
> -    char *cmdline;
> +    char_ptr_t cmdline;
>  
>      unsigned int nr_mods;
> -    struct boot_module *mods;
> +    boot_module_ptr_t mods;
>  
> -    struct arch_boot_info *arch;
> +    arch_boot_info_ptr_t arch;
>  };
>  
>  #endif
> diff --git a/xen/include/xen/types.h b/xen/include/xen/types.h
> index 6aba80500a..e807ffe255 100644
> --- a/xen/include/xen/types.h
> +++ b/xen/include/xen/types.h
> @@ -71,4 +71,15 @@ typedef bool bool_t;
>  #define test_and_set_bool(b)   xchg(&(b), true)
>  #define test_and_clear_bool(b) xchg(&(b), false)
>  
> +#ifndef DEFINE_STRUCT_PTR_TYPE
> +#define DEFINE_STRUCT_PTR_TYPE(struct_name) \
> +    typedef struct struct_name * struct_name ## _ptr_t;
> +#endif
> +
> +#ifndef DEFINE_PTR_TYPE
> +#define DEFINE_PTR_TYPE(type) \
> +    typedef type * type ## _ptr_t;
> +DEFINE_PTR_TYPE(char);
> +#endif
> +
>  #endif /* __TYPES_H__ */
> -- 
> 2.25.1
> 
> 


From xen-devel-bounces@lists.xenproject.org Sun Jul 09 00:00:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 09 Jul 2023 00:00:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560782.876943 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIHqN-0007hp-PT; Sun, 09 Jul 2023 00:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560782.876943; Sun, 09 Jul 2023 00:00:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIHqN-0007h3-Mm; Sun, 09 Jul 2023 00:00:03 +0000
Received: by outflank-mailman (input) for mailman id 560782;
 Sun, 09 Jul 2023 00:00:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BqnH=C3=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qIHqM-0006yQ-44
 for xen-devel@lists.xenproject.org; Sun, 09 Jul 2023 00:00:02 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8b5b3d35-1deb-11ee-b237-6b7b168915f2;
 Sun, 09 Jul 2023 02:00:00 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 5BD7A60B3C;
 Sat,  8 Jul 2023 23:59:58 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5196C433C7;
 Sat,  8 Jul 2023 23:59:56 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8b5b3d35-1deb-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688860797;
	bh=WC+yJU+KAuLbcUiFIRKOOKm3qK3FbcCY7ckACZkrILs=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=PH9oJdzfJ/Z8KEP448j1h7oROLZF3SphvS5QTuijRHG1W10PpeGvQff0ibA5Be2ux
	 wScxJ/jv3djsYsEpdruZ86sMDYQz4ky1O8BOYG/bFQkAHgRxBYlbWVTfcB9THhRA/b
	 4xx2PdYR/+qqkGLfE/hm165gdIWknBc0meR1f66A7YLMrutDJ/6nvqlLf3UshlvTcq
	 0C9jfkcA54RPY6HdmEe8hxVlE/WCbLlLSR3uF5m89eCaojHO7inmlmxFfUd65ogp/p
	 5oCHXkOlB1md0oYi0ajpXHHEaohrF1kKFTbutkpIc3UV66yi3CSRuXFNcsgjtMn0gR
	 H6kkWIl3U62IQ==
Date: Sat, 8 Jul 2023 16:59:54 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Christoph Hellwig <hch@lst.de>
cc: jgross@suse.com, sstabellini@kernel.org, oleksandr_tyshchenko@epam.com, 
    xen-devel@lists.xenproject.org, iommu@lists.linux.dev
Subject: Re: [PATCH, RFC] swiotlb-xen: fix dma to physical address translation
 for cache operations
In-Reply-To: <20230607132518.15381-1-hch@lst.de>
Message-ID: <alpine.DEB.2.22.394.2307081650460.761183@ubuntu-linux-20-04-desktop>
References: <20230607132518.15381-1-hch@lst.de>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 7 Jun 2023, Christoph Hellwig wrote:
> All other places in swiotlb-xen got from PFN to BFN and then call
> phys_to_dma on the result or vice versa, but the reverse mapping used
> for cache maintenance skips the BFN to PFN mapping.
> 
> [Note: only found by code inspection, please review very carefully!]
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Hi Christoph,

No, these checks are done on purpose differently. Let me explain.


xen_phys_to_dma does 2 translations:
1) guest physical to real physical (also called mfn in Xen)
2) real physical to dma

2) is not interesting in this discussion, 1) is.

Dom0 is mapped 1:1 guest physical == real physical by default on ARM.

For any Dom0 memory page:
- guest physical == real physical

Dom0 sometimes maps memory of other domains. By definitions, those are
not 1:1 mapped. For those:
- guest physical != real physical

Linux normally only knows about guest physical addresses, not real
physical addresses.


The checks below are meant to check if a given page is a regular Dom0
page, or a page of another domain. The check relies on the fact that if
it is a local Dom0 page then (guest physical == real physical) and
pfn_valid return true, otherwise if it not a local Dom0 page then (guest
physical != real physical) and pfn_valid return false.

Basically the check is doing:

  pfn_valid(real phys address)

In the local case:

  pfn_valid(real phys address) == pfn_valid(guest phys address) => true

In the foreign case:

  pfn_valid(real phys address) != pfn_valid(guest phys address) => false


Note that pfn_valid(guest phys address) would return true in both cases
because the foreign page is mapped over a valid Dom0 guest physical
address.


In short, it is a simple trick to detect if the address corresponds to a
regular Dom0 memory page or not.

Cheers,

Stefano

> ---
>  drivers/xen/swiotlb-xen.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
> index 67aa74d201627d..e4620303138b4d 100644
> --- a/drivers/xen/swiotlb-xen.c
> +++ b/drivers/xen/swiotlb-xen.c
> @@ -234,7 +234,7 @@ static dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page,
>  
>  done:
>  	if (!dev_is_dma_coherent(dev) && !(attrs & DMA_ATTR_SKIP_CPU_SYNC)) {
> -		if (pfn_valid(PFN_DOWN(dma_to_phys(dev, dev_addr))))
> +		if (pfn_valid(PFN_DOWN(phys)))
>  			arch_sync_dma_for_device(phys, size, dir);
>  		else
>  			xen_dma_sync_for_device(dev, dev_addr, size, dir);
> @@ -258,7 +258,7 @@ static void xen_swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr,
>  	BUG_ON(dir == DMA_NONE);
>  
>  	if (!dev_is_dma_coherent(hwdev) && !(attrs & DMA_ATTR_SKIP_CPU_SYNC)) {
> -		if (pfn_valid(PFN_DOWN(dma_to_phys(hwdev, dev_addr))))
> +		if (pfn_valid(PFN_DOWN(paddr)))
>  			arch_sync_dma_for_cpu(paddr, size, dir);
>  		else
>  			xen_dma_sync_for_cpu(hwdev, dev_addr, size, dir);
> @@ -276,7 +276,7 @@ xen_swiotlb_sync_single_for_cpu(struct device *dev, dma_addr_t dma_addr,
>  	phys_addr_t paddr = xen_dma_to_phys(dev, dma_addr);
>  
>  	if (!dev_is_dma_coherent(dev)) {
> -		if (pfn_valid(PFN_DOWN(dma_to_phys(dev, dma_addr))))
> +		if (pfn_valid(PFN_DOWN(paddr)))
>  			arch_sync_dma_for_cpu(paddr, size, dir);
>  		else
>  			xen_dma_sync_for_cpu(dev, dma_addr, size, dir);
> @@ -296,7 +296,7 @@ xen_swiotlb_sync_single_for_device(struct device *dev, dma_addr_t dma_addr,
>  		swiotlb_sync_single_for_device(dev, paddr, size, dir);
>  
>  	if (!dev_is_dma_coherent(dev)) {
> -		if (pfn_valid(PFN_DOWN(dma_to_phys(dev, dma_addr))))
> +		if (pfn_valid(PFN_DOWN(paddr)))
>  			arch_sync_dma_for_device(paddr, size, dir);
>  		else
>  			xen_dma_sync_for_device(dev, dma_addr, size, dir);
> -- 
> 2.39.2
> 


From xen-devel-bounces@lists.xenproject.org Sun Jul 09 00:10:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 09 Jul 2023 00:10:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560786.876954 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qII0q-0001WT-3z; Sun, 09 Jul 2023 00:10:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560786.876954; Sun, 09 Jul 2023 00:10:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qII0q-0001WM-0p; Sun, 09 Jul 2023 00:10:52 +0000
Received: by outflank-mailman (input) for mailman id 560786;
 Sun, 09 Jul 2023 00:10:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BqnH=C3=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qII0o-0001WG-A1
 for xen-devel@lists.xenproject.org; Sun, 09 Jul 2023 00:10:50 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0e34df1c-1ded-11ee-b237-6b7b168915f2;
 Sun, 09 Jul 2023 02:10:48 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 5403B60B23;
 Sun,  9 Jul 2023 00:10:47 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61703C433C7;
 Sun,  9 Jul 2023 00:10:45 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0e34df1c-1ded-11ee-b237-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1688861446;
	bh=jX6wUeiIgGiJfEHuDBGSpvZCdyiNO4CdZ3loW3fl8m8=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=H67A4+Rcrql9SNp94g1HITqejrttPjk5/EZuoIVraA9oi3Ez3YaryntlzQTFpJBcB
	 jjBHfzmHNy2CUCl+yrSnWmWToKGiSZqiydwNWY/RSOS4FwOfhK/vIXJrcLrwEELcLH
	 kvV7968IO9EIGzjuYvoYcpMyQt1zzHufi2vseHBnxzmjKN31gsblulXnMBZ4P76D93
	 OKm6FYj9kXumMJ+TqKekWTPo1x9UVjyrMW2BXZtVXou1fcEA1WTkNkef4tzr8x6QR7
	 mZXUC/1frqHjHqQkC4z/c1MBCQ6DiSkBFfCegv+9zskmIuQfkrjbCFVS2o5WkmS4Ye
	 /9cUQEwNGeiHA==
Date: Sat, 8 Jul 2023 17:10:43 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Rahul Singh <Rahul.Singh@arm.com>
cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, 
    Juergen Gross <jgross@suse.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, 
    Samuel Holland <samuel@sholland.org>, David Woodhouse <dwmw@amazon.co.uk>, 
    Jane Malalane <jane.malalane@citrix.com>, 
    "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2] xen/evtchn: Introduce new IOCTL to bind static
 evtchn
In-Reply-To: <156827AA-3DFB-4DA2-BC82-7A27E77C2092@arm.com>
Message-ID: <alpine.DEB.2.22.394.2307081710210.761183@ubuntu-linux-20-04-desktop>
References: <764d561e3aecb7e63e8601dc50aaef9fc40834e4.1688051342.git.rahul.singh@arm.com> <90c961d4-9d10-6fbc-b5f7-84d231264289@epam.com> <156827AA-3DFB-4DA2-BC82-7A27E77C2092@arm.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="8323329-1772280971-1688861446=:761183"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-1772280971-1688861446=:761183
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT

On Fri, 30 Jun 2023, Rahul Singh wrote:
> Hi Oleksandr,
> 
> Thanks for reviewing the code.
> 
> > On 29 Jun 2023, at 7:06 pm, Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com> wrote:
> > 
> > 
> > 
> > On 29.06.23 18:46, Rahul Singh wrote:
> > 
> > Hello Rahul
> > 
> > 
> >> Xen 4.17 supports the creation of static evtchns. To allow user space
> >> application to bind static evtchns introduce new ioctl
> >> "IOCTL_EVTCHN_BIND_STATIC". Existing IOCTL doing more than binding
> >> thatâ€™s why we need to introduce the new IOCTL to only bind the static
> >> event channels.
> >> 
> >> Also, static evtchns to be available for use during the lifetime of the
> >> guest. When the application exits, __unbind_from_irq() ends up being
> >> called from release() file operations because of that static evtchns
> >> are getting closed. To avoid closing the static event channel, add the
> >> new bool variable "is_static" in "struct irq_info" to mark the event
> >> channel static when creating the event channel to avoid closing the
> >> static evtchn.
> >> 
> >> Signed-off-by: Rahul Singh <rahul.singh@arm.com>
> >> ---
> >> v2:
> >>  * Use bool in place u8 to define is_static variable.
> >>  * Avoid closing the static evtchns in error path.
> > 
> > 
> > Patch looks good to me, just a nit (question) below.
> > 
> > 
> >> ---
> >>  drivers/xen/events/events_base.c |  7 +++++--
> >>  drivers/xen/evtchn.c             | 30 ++++++++++++++++++++++--------
> >>  include/uapi/xen/evtchn.h        |  9 +++++++++
> >>  include/xen/events.h             |  2 +-
> >>  4 files changed, 37 insertions(+), 11 deletions(-)
> >> 
> >> diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
> >> index c7715f8bd452..5d3b5c7cfe64 100644
> >> --- a/drivers/xen/events/events_base.c
> >> +++ b/drivers/xen/events/events_base.c
> >> @@ -112,6 +112,7 @@ struct irq_info {
> >>   unsigned int irq_epoch; /* If eoi_cpu valid: irq_epoch of event */
> >>   u64 eoi_time;           /* Time in jiffies when to EOI. */
> >>   raw_spinlock_t lock;
> >> + bool is_static;           /* Is event channel static */
> >> 
> >>   union {
> >>   unsigned short virq;
> >> @@ -982,7 +983,8 @@ static void __unbind_from_irq(unsigned int irq)
> >>   unsigned int cpu = cpu_from_irq(irq);
> >>   struct xenbus_device *dev;
> >> 
> >> - xen_evtchn_close(evtchn);
> >> + if (!info->is_static)
> >> + xen_evtchn_close(evtchn);
> >> 
> >>   switch (type_from_irq(irq)) {
> >>   case IRQT_VIRQ:
> >> @@ -1574,7 +1576,7 @@ int xen_set_irq_priority(unsigned irq, unsigned priority)
> >>  }
> >>  EXPORT_SYMBOL_GPL(xen_set_irq_priority);
> >> 
> >> -int evtchn_make_refcounted(evtchn_port_t evtchn)
> >> +int evtchn_make_refcounted(evtchn_port_t evtchn, bool is_static)
> >>  {
> >>   int irq = get_evtchn_to_irq(evtchn);
> >>   struct irq_info *info;
> >> @@ -1590,6 +1592,7 @@ int evtchn_make_refcounted(evtchn_port_t evtchn)
> >>   WARN_ON(info->refcnt != -1);
> >> 
> >>   info->refcnt = 1;
> >> + info->is_static = is_static;
> >> 
> >>   return 0;
> >>  }
> >> diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c
> >> index c99415a70051..e6d2303478b2 100644
> >> --- a/drivers/xen/evtchn.c
> >> +++ b/drivers/xen/evtchn.c
> >> @@ -366,7 +366,8 @@ static int evtchn_resize_ring(struct per_user_data *u)
> >>   return 0;
> >>  }
> >> 
> >> -static int evtchn_bind_to_user(struct per_user_data *u, evtchn_port_t port)
> >> +static int evtchn_bind_to_user(struct per_user_data *u, evtchn_port_t port,
> >> + bool is_static)
> >>  {
> >>   struct user_evtchn *evtchn;
> >>   struct evtchn_close close;
> >> @@ -402,14 +403,16 @@ static int evtchn_bind_to_user(struct per_user_data *u, evtchn_port_t port)
> >>   if (rc < 0)
> >>   goto err;
> >> 
> >> - rc = evtchn_make_refcounted(port);
> >> + rc = evtchn_make_refcounted(port, is_static);
> >>   return rc;
> >> 
> >>  err:
> >>   /* bind failed, should close the port now */
> >> - close.port = port;
> >> - if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close) != 0)
> >> - BUG();
> >> + if (!is_static) {
> > 
> > 
> > I think now "struct evtchn_close close;" can be placed here as it is not 
> > used outside of this block.
> > 
> > Also this block looks like an open-coded version of xen_evtchn_close()
> > defined at events_base.c, so maybe it is worth making xen_evtchn_close() 
> > static inline and placing it into events.h, then calling helper here?
> > Please note, I will be ok either way.
> 
> Make sense. I will modify the patch as per your request in the next version.
> I will wait for other maintainers to review the patch before sending the
> next version.

I don't have any further comments.
--8323329-1772280971-1688861446=:761183--


From xen-devel-bounces@lists.xenproject.org Sun Jul 09 05:13:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 09 Jul 2023 05:13:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560792.876964 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIMjI-0004nN-Ff; Sun, 09 Jul 2023 05:13:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560792.876964; Sun, 09 Jul 2023 05:13:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIMjI-0004nF-Av; Sun, 09 Jul 2023 05:13:04 +0000
Received: by outflank-mailman (input) for mailman id 560792;
 Sun, 09 Jul 2023 05:13:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIMjH-0004n5-F7; Sun, 09 Jul 2023 05:13:03 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIMjH-0007XF-3w; Sun, 09 Jul 2023 05:13:03 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIMjG-0004oX-OV; Sun, 09 Jul 2023 05:13:02 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qIMjG-00071U-O1; Sun, 09 Jul 2023 05:13:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=EhpRXopPRjpxF9sPGyR7+Y8rWQGHckyomPXVi4ySm8w=; b=Y0MfDd2GmgaA4ss7VLqIChk52H
	bkGQ2WiXqZurEUcy9A23Pzabh+NTs0pu6sTgm/BFeOM+Msp1w8wMsGGh6IE6Wor564EtS6abfFbIr
	mfuU4MS9xDBhZs2RIbkA96406cPqL8hLLvDaWDAHqu+QcmAeElMwX9Adl6ho24TllFXM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181740-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181740: regressions - trouble: broken/fail/pass
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-pair:<job status>:broken:regression
    linux-linus:test-amd64-amd64-pair:host-install/src_host(6):broken:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:leak-check/basis/dst_host(19):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-pygrub:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:debian-di-install:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:leak-check/basis(11):fail:allowable
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=946c6b59c56dc6e7d8364a8959cb36bf6d10bc37
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 09 Jul 2023 05:13:02 +0000

flight 181740 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181740/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-pair           <job status>                 broken
 test-amd64-amd64-pair       6 host-install/src_host(6) broken REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 19 leak-check/basis/dst_host(19) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-pygrub      11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-libvirt     11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu 14 guest-start             fail REGR. vs. 180278
 test-amd64-amd64-xl          12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2 12 debian-di-install      fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds     11 leak-check/basis(11)     fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                946c6b59c56dc6e7d8364a8959cb36bf6d10bc37
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   83 days
Failing since        180281  2023-04-17 06:24:36 Z   82 days  164 attempts
Testing same since   181740  2023-07-08 22:13:02 Z    0 days    1 attempts

------------------------------------------------------------
3734 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        broken  
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-amd64-amd64-pair broken
broken-step test-amd64-amd64-pair host-install/src_host(6)

Not pushing.

(No revision log; it would be 621036 lines long.)


From xen-devel-bounces@lists.xenproject.org Sun Jul 09 09:57:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 09 Jul 2023 09:57:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560837.876993 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIR9p-00008F-7d; Sun, 09 Jul 2023 09:56:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560837.876993; Sun, 09 Jul 2023 09:56:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIR9p-000088-4a; Sun, 09 Jul 2023 09:56:45 +0000
Received: by outflank-mailman (input) for mailman id 560837;
 Sun, 09 Jul 2023 09:56:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIR9o-00007y-Je; Sun, 09 Jul 2023 09:56:44 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIR9o-0005r7-HG; Sun, 09 Jul 2023 09:56:44 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIR9o-00073n-63; Sun, 09 Jul 2023 09:56:44 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qIR9o-0000wc-5a; Sun, 09 Jul 2023 09:56:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=9AfzlVxZvcGfcucXC3fVNFu//MKytae2a8YZGkNK7U8=; b=Rc4TOCruAiJvwnVKbr/LrCyrvq
	7Ajv3teWPbuQTqpG8VbjThESkizqgF/JNeJj13AFugX+z6HrQbuK2FqRBLrzfLqmX/Eb2uOsLq1nh
	1IWmQzQ+LvbC7ZxrYvMdabD29aVXXl+dISYo8I/+uxnMUGRDgc2T/RxKazk2/O+Ayuq4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181741-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181741: regressions - FAIL
X-Osstest-Failures:
    xen-unstable:build-arm64-xsm:xen-build:fail:regression
    xen-unstable:build-arm64-pvops:kernel-build:fail:regression
    xen-unstable:test-amd64-i386-migrupgrade:xen-install/dst_host:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qcow2:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-amd64-i386-libvirt-raw:xen-install:fail:heisenbug
    xen-unstable:test-armhf-armhf-xl-vhd:guest-start:fail:heisenbug
    xen-unstable:test-amd64-amd64-libvirt-vhd:guest-start.2:fail:heisenbug
    xen-unstable:test-arm64-arm64-examine:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-vhd:guest-start/debian.repeat:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=886c22f00c575199f7bb3dc5b7662dd09bf05146
X-Osstest-Versions-That:
    xen=886c22f00c575199f7bb3dc5b7662dd09bf05146
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 09 Jul 2023 09:56:44 +0000

flight 181741 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181741/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-arm64-xsm               6 xen-build                fail REGR. vs. 181736
 build-arm64-pvops             6 kernel-build             fail REGR. vs. 181736

Tests which are failing intermittently (not blocking):
 test-amd64-i386-migrupgrade 11 xen-install/dst_host fail in 181736 pass in 181741
 test-amd64-amd64-xl-qcow2 21 guest-start/debian.repeat fail in 181736 pass in 181741
 test-amd64-i386-libvirt-raw   7 xen-install                fail pass in 181736
 test-armhf-armhf-xl-vhd      13 guest-start                fail pass in 181736
 test-amd64-amd64-libvirt-vhd 20 guest-start.2              fail pass in 181736

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-examine      1 build-check(1)               blocked  n/a
 test-arm64-arm64-libvirt-raw  1 build-check(1)               blocked  n/a
 test-arm64-arm64-libvirt-xsm  1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl           1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-credit1   1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-credit2   1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-thunderx  1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-vhd       1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-xsm       1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-thunderx 15 migrate-support-check fail in 181736 never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check fail in 181736 never pass
 test-arm64-arm64-xl-credit1 15 migrate-support-check fail in 181736 never pass
 test-arm64-arm64-xl-credit1 16 saverestore-support-check fail in 181736 never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check fail in 181736 never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check fail in 181736 never pass
 test-arm64-arm64-xl-credit2 15 migrate-support-check fail in 181736 never pass
 test-arm64-arm64-xl-credit2 16 saverestore-support-check fail in 181736 never pass
 test-arm64-arm64-xl-xsm     15 migrate-support-check fail in 181736 never pass
 test-arm64-arm64-xl-xsm 16 saverestore-support-check fail in 181736 never pass
 test-arm64-arm64-xl         15 migrate-support-check fail in 181736 never pass
 test-arm64-arm64-xl     16 saverestore-support-check fail in 181736 never pass
 test-amd64-i386-libvirt-raw 14 migrate-support-check fail in 181736 never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check fail in 181736 never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check fail in 181736 never pass
 test-arm64-arm64-xl-vhd     14 migrate-support-check fail in 181736 never pass
 test-arm64-arm64-xl-vhd 15 saverestore-support-check fail in 181736 never pass
 test-armhf-armhf-xl-vhd     14 migrate-support-check fail in 181736 never pass
 test-armhf-armhf-xl-vhd 15 saverestore-support-check fail in 181736 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181736
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181736
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181736
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181736
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181736
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181736
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181736
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181736
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181736
 test-amd64-i386-xl-vhd       21 guest-start/debian.repeat    fail  like 181736
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181736
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181736
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181736
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  886c22f00c575199f7bb3dc5b7662dd09bf05146
baseline version:
 xen                  886c22f00c575199f7bb3dc5b7662dd09bf05146

Last test of basis   181741  2023-07-09 01:53:31 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              fail    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            fail    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          blocked 
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 blocked 
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      blocked 
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  blocked 
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  blocked 
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     blocked 
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 blocked 
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 blocked 
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-arm64-arm64-xl-vhd                                      blocked 
 test-armhf-armhf-xl-vhd                                      fail    
 test-amd64-i386-xl-vhd                                       fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Sun Jul 09 11:42:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 09 Jul 2023 11:42:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560845.877006 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qISnm-0002xJ-Qa; Sun, 09 Jul 2023 11:42:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560845.877006; Sun, 09 Jul 2023 11:42:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qISnm-0002xC-NR; Sun, 09 Jul 2023 11:42:06 +0000
Received: by outflank-mailman (input) for mailman id 560845;
 Sun, 09 Jul 2023 11:42:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qISnl-0002x2-Eg; Sun, 09 Jul 2023 11:42:05 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qISnl-0008Sy-3i; Sun, 09 Jul 2023 11:42:05 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qISnk-0000zK-Jc; Sun, 09 Jul 2023 11:42:04 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qISnk-000268-J7; Sun, 09 Jul 2023 11:42:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=BeAf7nyKbDTHZNVC2oDW0Rc81vYe3K6N3CHoD/65U3I=; b=w3k9aiitdNxaxYuVyglqVW3dti
	1fYulk2W8DTNjk6Wyc1HTsBVnFE3UPOq03hacSfZBn6OVTygGr6XqmP76MA9nhtx6SAtKJXX1ZzyH
	PByqxCmJqCLBRLYQCCPjeebmh9hkKcj+/g8EXYsUNf7RTMbT1vbnZuSaxJNqcSeWyUrg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181742-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181742: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-pygrub:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:debian-di-install:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:leak-check/basis(11):fail:allowable
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=1c7873e3364570ec89343ff4877e0f27a7b21a61
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 09 Jul 2023 11:42:04 +0000

flight 181742 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181742/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-pygrub       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 12 xen-boot/src_host       fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 13 xen-boot/dst_host       fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl          11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-libvirt     11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd 11 leak-check/basis(11)    fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-xsm      12 debian-install           fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2 12 debian-di-install      fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds     11 leak-check/basis(11)     fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                1c7873e3364570ec89343ff4877e0f27a7b21a61
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   83 days
Failing since        180281  2023-04-17 06:24:36 Z   83 days  165 attempts
Testing same since   181742  2023-07-09 05:17:52 Z    0 days    1 attempts

------------------------------------------------------------
3734 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   fail    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 621056 lines long.)


From xen-devel-bounces@lists.xenproject.org Sun Jul 09 18:41:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 09 Jul 2023 18:41:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560861.877017 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIZLQ-0002RD-Cd; Sun, 09 Jul 2023 18:41:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560861.877017; Sun, 09 Jul 2023 18:41:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIZLQ-0002R6-7P; Sun, 09 Jul 2023 18:41:16 +0000
Received: by outflank-mailman (input) for mailman id 560861;
 Sun, 09 Jul 2023 18:41:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIZLP-0002Qw-Nf; Sun, 09 Jul 2023 18:41:15 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIZLP-0001PZ-BZ; Sun, 09 Jul 2023 18:41:15 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIZLO-0001xk-Vb; Sun, 09 Jul 2023 18:41:15 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qIZLO-0006ff-VA; Sun, 09 Jul 2023 18:41:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=urJXa07P3Ns2RzyYQKydoiIP1nDg95vYjdslETpO7q4=; b=i2TdA5ObEYKWgMPVFCxFlNV3pl
	zBfq8vM10O/P9Re39Grdat10na5jbhO/OqhhO+KON4ok6AYQZ6x6+nFg1jfvLJ4PRMzKiDINeDo0t
	dJqurPRxNjml7D87pjVRFTtFvr1jJYHLCbTmpAhkl5ZHOxAdyNw3Hv1oM10mgdskmq1k=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181745-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181745: regressions - trouble: broken/fail/pass
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-pvshim:<job status>:broken:regression
    linux-linus:test-amd64-amd64-pygrub:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/src_host:fail:regression
    linux-linus:test-amd64-amd64-pair:xen-boot/dst_host:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-examine-uefi:reboot:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-examine-bios:reboot:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-libvirt:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:leak-check/basis(11):fail:regression
    linux-linus:test-amd64-amd64-xl-xsm:debian-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt-qcow2:debian-di-install:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvshim:host-install(5):broken:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-multivcpu:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt-pair:xen-boot/src_host:fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt-qcow2:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:leak-check/basis(11):fail:heisenbug
    linux-linus:test-amd64-amd64-xl-xsm:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-freebsd11-amd64:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-rtds:leak-check/basis(11):fail:allowable
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=1c7873e3364570ec89343ff4877e0f27a7b21a61
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 09 Jul 2023 18:41:14 +0000

flight 181745 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181745/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-pvshim      <job status>                 broken
 test-amd64-amd64-pygrub       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 11 leak-check/basis(11) fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2  11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-shadow    8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-pair 13 xen-boot/dst_host       fail REGR. vs. 180278
 test-amd64-coresched-amd64-xl  8 xen-boot                fail REGR. vs. 180278
 test-amd64-amd64-xl          11 leak-check/basis(11)     fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-win7-amd64  8 xen-boot         fail REGR. vs. 180278
 test-amd64-amd64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-libvirt-raw  8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-multivcpu 14 guest-start             fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd       8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-pair        12 xen-boot/src_host        fail REGR. vs. 180278
 test-amd64-amd64-pair        13 xen-boot/dst_host        fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64  8 xen-boot             fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-intel  8 xen-boot          fail REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-intel  8 xen-boot              fail REGR. vs. 180278
 test-amd64-amd64-examine      8 reboot                   fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-examine-uefi  8 reboot                  fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-examine-bios  8 reboot                  fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64 11 leak-check/basis(11) fail in 181742 REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 11 leak-check/basis(11) fail in 181742 REGR. vs. 180278
 test-amd64-amd64-libvirt 11 leak-check/basis(11) fail in 181742 REGR. vs. 180278
 test-amd64-amd64-xl-pvhv2-amd 11 leak-check/basis(11) fail in 181742 REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64 11 leak-check/basis(11) fail in 181742 REGR. vs. 180278
 test-amd64-amd64-xl-xsm      12 debian-install fail in 181742 REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 12 debian-hvm-install fail in 181742 REGR. vs. 180278
 test-amd64-amd64-libvirt-qcow2 12 debian-di-install fail in 181742 REGR. vs. 180278
 test-amd64-amd64-xl-pvshim    8 xen-boot       fail in 181742 REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-pvshim    5 host-install(5)          broken pass in 181742
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 11 leak-check/basis(11) fail in 181742 pass in 181745
 test-amd64-amd64-xl-multivcpu  8 xen-boot        fail in 181742 pass in 181745
 test-amd64-amd64-libvirt-pair 12 xen-boot/src_host fail in 181742 pass in 181745
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 8 xen-boot fail in 181742 pass in 181745
 test-amd64-amd64-xl-qemut-ws16-amd64  8 xen-boot fail in 181742 pass in 181745
 test-amd64-amd64-libvirt-qcow2 11 leak-check/basis(11)     fail pass in 181742
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 11 leak-check/basis(11) fail pass in 181742
 test-amd64-amd64-xl-xsm       8 xen-boot                   fail pass in 181742
 test-amd64-amd64-xl-pvhv2-amd  8 xen-boot                  fail pass in 181742
 test-amd64-amd64-xl-qemut-debianhvm-amd64  8 xen-boot      fail pass in 181742
 test-amd64-amd64-freebsd11-amd64  8 xen-boot               fail pass in 181742
 test-amd64-amd64-libvirt      8 xen-boot                   fail pass in 181742
 test-amd64-amd64-xl-qemuu-ovmf-amd64  8 xen-boot           fail pass in 181742

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds     11 leak-check/basis(11)     fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                1c7873e3364570ec89343ff4877e0f27a7b21a61
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   83 days
Failing since        180281  2023-04-17 06:24:36 Z   83 days  166 attempts
Testing same since   181742  2023-07-09 05:17:52 Z    0 days    2 attempts

------------------------------------------------------------
3734 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 fail    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          fail    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        fail    
 test-amd64-amd64-libvirt-pair                                fail    
 test-amd64-amd64-xl-pvshim                                   broken  
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 fail    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-amd64-amd64-xl-pvshim broken
broken-step test-amd64-amd64-xl-pvshim host-install(5)

Not pushing.

(No revision log; it would be 621056 lines long.)


From xen-devel-bounces@lists.xenproject.org Sun Jul 09 22:42:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 09 Jul 2023 22:42:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560894.877044 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qId6N-0001xD-4U; Sun, 09 Jul 2023 22:41:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560894.877044; Sun, 09 Jul 2023 22:41:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qId6N-0001x6-1t; Sun, 09 Jul 2023 22:41:59 +0000
Received: by outflank-mailman (input) for mailman id 560894;
 Sun, 09 Jul 2023 22:41:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ju4y=C3=epam.com=prvs=15548f96ac=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qId6L-0001x0-AD
 for xen-devel@lists.xenproject.org; Sun, 09 Jul 2023 22:41:57 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ccd284e6-1ea9-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 00:41:54 +0200 (CEST)
Received: from pps.filterd (m0174676.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 3698k7eb020285; Sun, 9 Jul 2023 22:41:42 GMT
Received: from eur04-vi1-obe.outbound.protection.outlook.com
 (mail-vi1eur04lp2055.outbound.protection.outlook.com [104.47.14.55])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rqsnw0vcx-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Sun, 09 Jul 2023 22:41:42 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AM9PR03MB7332.eurprd03.prod.outlook.com (2603:10a6:20b:265::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.29; Sun, 9 Jul
 2023 22:41:36 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::c192:26de:9053:ab05]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::c192:26de:9053:ab05%6]) with mapi id 15.20.6565.026; Sun, 9 Jul 2023
 22:41:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ccd284e6-1ea9-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ZYdRKwNmKTRwOJkBUYA896IQRLc1T1kpA2lrTW3hB+0bW565NDMno9bEueM+taMq6wcyLdXzk/punzL1sGBCgJmSKKUQcwBRmtzhGV9nhgb8a4tFejwPN9FzWY2132FRWMtbtTmhzhOOGEPc4g2y4MmZLsd4RbuwYbsir9qkRdkQpzsovJQs2a+boJxn0Hx62faTtpD34hmMHG+g5ALRVX7VTgmJXbq6+SYCkEYQh+dzbpEAJJriqzr2W6/AXqvYMXviCdeAhvrQjCgpT/7C6vEEQeiXKJ0oVyCQOs/LAzhKVn+zttPtfXC79YxbQ90ZKMtQMVKiHyt4SmUcnKTdIw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=6aVYmq3QfeoquBHeNsvcVznrvM5fa/h/ux57WUL+Zb4=;
 b=Hanas4I0pCJBg4in52sPLMBMwoP6nN6BDacnaiASrktDnG37jvea4WvDNwOR6Uh5OGLIRPK8s5zYmpSB4D8oxiWAsHTgzHpp/3PXXEAiG1LAUShNfUSyaegsk8s4mAecq7RHqsE+5+pn0eT7jbGbqQkMFNBgL7G77CropG7nthSLEbCSTpN+KL+TAUz0WCFvotxQz66HrZ0QIQrFHx6n4+LPxI8VUGOtcdhWg3ioeTmIRRHRyCJD4VWeP9wy1/sbPGNOjRAAiSg2En/Lviadc1I2QiahwHfoUfy9V2RnnRiXDdhNcOqnwvzYS5Jw7RQ3fYqlIUn4xQDQrWkt339vQQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=6aVYmq3QfeoquBHeNsvcVznrvM5fa/h/ux57WUL+Zb4=;
 b=ab/0r8WIyfy7/gqby3tYsF3r6P2eclkpmGrUtnB6CxQueH/5nrpWNS/6K9fNSUTTHYnbkm7bKdRf7PtwlsnVfmfJVxOFTjMXoAhA3tH2ohvM8np0Rn6BHjRDLMquJTSiJw1ZHMG0bWDJaPujuTEVJ9saoFAh1EYsaVDE9d/Du1HJUl2Ilgy4MNj42Gw1Pn1MsspEz4ofW5JecRjn/qGEmRIUdecQUKGD3PGR8zkfWFv00InBrj60taO/tPmh8ymM8ZPcJp7lmmDIBmVgln7S4IpZP9f3Ip2UjNX8N12zORIh3deSNmKNk2aKpkTbpDd9DvD485C9JW0/udOPYHUn4w==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: Jan Beulich <jbeulich@suse.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
        Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
        Andrew Cooper
	<andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
        George Dunlap
	<george.dunlap@citrix.com>,
        Julien Grall <julien@xen.org>,
        Stefano Stabellini
	<sstabellini@kernel.org>,
        Paul Durrant <paul@xen.org>,
        =?iso-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
Subject: Re: [PATCH v7 01/12] vpci: introduce per-domain lock to protect vpci
 structure
Thread-Topic: [PATCH v7 01/12] vpci: introduce per-domain lock to protect vpci
 structure
Thread-Index: 
 AQHZneJZdDE+HOoSO0y6VB9l0x1hDq+No9OAgAgqUACAALl2AIAAzUWAgADPAYCAEhJlgIAArbcAgAdCCQA=
Date: Sun, 9 Jul 2023 22:41:35 +0000
Message-ID: <87h6qchfn4.fsf@epam.com>
References: <20230613103159.524763-1-volodymyr_babchuk@epam.com>
 <20230613103159.524763-2-volodymyr_babchuk@epam.com>
 <ZIyOCan//39V3bdy@MacBook-Air-de-Roger.local> <87352kpj04.fsf@epam.com>
 <ZJQDGOrP1I3hR5Jj@MacBook-Air-de-Roger.local> <87ilbfnqmo.fsf@epam.com>
 <ZJVc77SwvyKOEdnJ@MacBook-Air-de-Roger.local> <87wmzfmltd.fsf@epam.com>
 <ab79bcb6-6fc8-c68f-65bf-16ce7316c3ae@suse.com>
In-Reply-To: <ab79bcb6-6fc8-c68f-65bf-16ce7316c3ae@suse.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: mu4e 1.8.9; emacs 28.2
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AM9PR03MB7332:EE_
x-ms-office365-filtering-correlation-id: 695d0b31-2111-4a53-dcb8-08db80cda6f7
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 dAt5Snm56mDKA5B+1N9UU9+j+yttnAMcgqwgc6N7xfXxY4Djg6pkYMR4eJH9xlF5Sq4vDjmD2yeioOCgPKIKMGuz0IlfUzgPVnRiVSZ2DwNUSS1s2nJbXppdthvOeblIXRmRjYfV33g4KuY2saFWu9jxQQMvS3/XQBG+IlggZT/onhZDeAvAt/woLDG61APIXOwLtPtHuBHX42Cn483oF8iAxMyX+2C91tk01fNEG2gkn6d5BiIeBzXJrk5c+F7HPB7PMNbjul6a+WJzq5ond/I3Cdvl94q831DEpeuffonsaXIF6xHgOAIZQVWBJlKJPvKYjgc+ztbJ0dYkDF634dUgY8f0QUpfhtjJXjhT/Jrc/+gRxOuzqjQeAk5GXbeLA2Axe+tujpX5c2Bhsj+8tjb2X251rQH+ecAa4/8XA3rnRrpctms+rejVBnJu6tQqJwaOy/9x2S3G2jCF5+xw9uNa5oXqcj58cfjy2Y4h6wO9/c4JVmYXdrwW9pvGKVsZ0Tnoq4eX6pyvGrSWUhdoA3fNfxaWdd8HE07TpkROFtojsuCzyN+NJMy+iESMijsmv3OfJcwEDXJr8HLopRxJ7+yjwZsskcElYDD4RKKH80BcOIP/2doDb6lLm8FUwPZb
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(39860400002)(366004)(346002)(376002)(451199021)(86362001)(38100700002)(38070700005)(36756003)(71200400001)(6486002)(54906003)(76116006)(91956017)(122000001)(26005)(6506007)(53546011)(186003)(55236004)(6512007)(2616005)(5660300002)(316002)(2906002)(66556008)(66946007)(478600001)(8676002)(8936002)(66476007)(83380400001)(4326008)(6916009)(64756008)(66446008)(41300700001);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?i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Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 695d0b31-2111-4a53-dcb8-08db80cda6f7
X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2023 22:41:36.0840
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: YSbjr8LyM/NiODWxLGkvGAfC1ZRbQEG6+39BL+Zuaj2m/cjknutpsuejGGT86CZlbT5ja4J+/uoqtu+bXJsRxvPGzn6lFw0vrEhk3moNwn0=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7332
X-Proofpoint-GUID: jQncOV4S2-MJrKwUXSpEzi3OPPMc9eia
X-Proofpoint-ORIG-GUID: jQncOV4S2-MJrKwUXSpEzi3OPPMc9eia
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-09_16,2023-07-06_02,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015
 impostorscore=0 bulkscore=0 spamscore=0 malwarescore=0 adultscore=0
 mlxscore=0 mlxlogscore=990 priorityscore=1501 suspectscore=0
 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2305260000 definitions=main-2307090214


Hi Jan,

Jan Beulich <jbeulich@suse.com> writes:

> On 04.07.2023 23:03, Volodymyr Babchuk wrote:
>> I am currently implementing your proposal (along with Jan's
>> suggestions), but I am facing ABBA deadlock with IOMMU's
>> reassign_device() call, which has this piece of code:
>>=20
>>         list_move(&pdev->domain_list, &target->pdev_list);
>>=20
>> My immediate change was:
>>=20
>>         write_lock(&pdev->domain->pci_lock);
>>         list_del(&pdev->domain_list);
>>         write_unlock(&pdev->domain->pci_lock);
>>=20
>>         write_lock(&target->pci_lock);
>>         list_add(&pdev->domain_list, &target->pdev_list);
>>         write_unlock(&target->pci_lock);
>>=20
>> But this will not work because reassign_device is called from
>> pci_release_devices() which iterates over d->pdev_list, so we need to
>> take a d->pci_lock early.
>>=20
>> Any suggestions on how to fix this? My idea is to remove a device from a
>> list one at time:
>>=20
>> int pci_release_devices(struct domain *d)
>> {
>>     struct pci_dev *pdev;
>>     u8 bus, devfn;
>>     int ret;
>>=20
>>     pcidevs_lock();
>>     write_lock(&d->pci_lock);
>>     ret =3D arch_pci_clean_pirqs(d);
>>     if ( ret )
>>     {
>>         pcidevs_unlock();
>>         write_unlock(&d->pci_lock);
>>         return ret;
>>     }
>>=20
>>     while ( !list_empty(&d->pdev_list) )
>>     {
>>         pdev =3D list_entry(&d->pdev_list, struct pci_dev, domain_list);
>>         bus =3D pdev->bus;
>>         devfn =3D pdev->devfn;
>>         list_del(&pdev->domain_list);
>>         write_unlock(&d->pci_lock);
>>         ret =3D deassign_device(d, pdev->seg, bus, devfn) ?: ret;
>>         write_lock(&d->pci_lock);
>
> I think it needs doing almost like this, but with two more tweaks and
> no list_del() right here (first and foremost to avoid needing to
> figure whether removing early isn't going to subtly break anything;
> see below for an error case that would end up with changed behavior):
>
>     while ( !list_empty(&d->pdev_list) )
>     {
>         const struct pci_dev *pdev =3D list_first_entry(&d->pdev_list, st=
ruct pci_dev, domain_list);
>         uint16_t seg =3D pdev->seg;
>         uint8_t bus =3D pdev->bus;
>         uint8_t devfn =3D pdev->devfn;
>
>         write_unlock(&d->pci_lock);
>         ret =3D deassign_device(d, seg, bus, devfn) ?: ret;
>         write_lock(&d->pci_lock);
>     }
>
> One caveat though: The original list_for_each_entry_safe() guarantees
> the loop to complete; your use of list_del() would guarantee that too,
> but then the device wouldn't be on the list anymore if deassign_device()
> failed. Therefore I guess you will need another local list where you
> (temporarily) put all the devices which deassign_device() left on the
> list, and which you would then move back to d->pdev_list after the loop
> has finished.

Okay, taking into the account all that you wrote, I came with this
implementation:

int pci_release_devices(struct domain *d)
{
    int combined_ret;
    LIST_HEAD(failed_pdevs);

    pcidevs_lock();
    write_lock(&d->pci_lock);
    combined_ret =3D arch_pci_clean_pirqs(d);
    if ( combined_ret )
    {
        pcidevs_unlock();
        write_unlock(&d->pci_lock);
        return combined_ret;
    }

    while ( !list_empty(&d->pdev_list) )
    {
        struct pci_dev *pdev =3D list_first_entry(&d->pdev_list,
                                                struct pci_dev,
                                                domain_list);
        uint16_t seg =3D pdev->seg;
        uint8_t bus =3D pdev->bus;
        uint8_t devfn =3D pdev->devfn;
        int ret;

        write_unlock(&d->pci_lock);
        ret =3D deassign_device(d, seg, bus, devfn);
        write_lock(&d->pci_lock);
        if ( ret )
        {
            bool still_present =3D false;
            const struct pci_dev *tmp;

            for_each_pdev ( d, tmp )
            {
                if ( tmp =3D=3D (const struct pci_dev*)pdev )
                {
                    still_present =3D true;
                    break;
                }
            }
            if ( still_present )
                list_move(&pdev->domain_list, &failed_pdevs);
            combined_ret =3D ret;
        }
    }

    list_splice(&failed_pdevs, &d->pdev_list);
    write_unlock(&d->pci_lock);
    pcidevs_unlock();

    return combined_ret;
}


> (Whether it is sufficient to inspect the list head to
> determine whether the pdev is still on the list needs careful checking.)

I am not sure that this is enough. We dropped d->pci_lock so we can
expect that the list was permutated in a random way.


--=20
WBR, Volodymyr=


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 05:33:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 05:33:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560901.877054 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIjVv-00005i-0G; Mon, 10 Jul 2023 05:32:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560901.877054; Mon, 10 Jul 2023 05:32:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIjVu-00005a-RI; Mon, 10 Jul 2023 05:32:46 +0000
Received: by outflank-mailman (input) for mailman id 560901;
 Mon, 10 Jul 2023 05:32:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIjVt-00005Q-Ep; Mon, 10 Jul 2023 05:32:45 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIjVt-0007dZ-5g; Mon, 10 Jul 2023 05:32:45 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIjVs-000762-Or; Mon, 10 Jul 2023 05:32:44 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qIjVs-0007S6-OT; Mon, 10 Jul 2023 05:32:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=jOmIolcmHW/quqwEP0UsZJIlH98nVsmUhEoPohu9kuI=; b=3l7dcpQtWrcJktfo+Sj+aG/eHJ
	OTwuHpHJQTIAflYKrl+0KO5YZUAyUY5ORv4c7gUQdbCJBvVB5JzVSfi5GHg8/r5C36HiCbTW3H08m
	r9pj1Lpy2bSmm+wq6uFoa+Naz0zoEhHcl+NmehBtHRhD4QKUW3pmUhMR5jEh2nSWDpwI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181746-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181746: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=c192ac7357683f78c2e6d6e75adfcc29deb8c4ae
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 10 Jul 2023 05:32:44 +0000

flight 181746 linux-linus real [real]
flight 181748 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181746/
http://logs.test-lab.xenproject.org/osstest/logs/181748/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-ovmf-amd64 18 guest-localmigrate/x10 fail pass in 181748-retest
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 18 guest-localmigrate/x10 fail pass in 181748-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                c192ac7357683f78c2e6d6e75adfcc29deb8c4ae
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   84 days
Failing since        180281  2023-04-17 06:24:36 Z   83 days  167 attempts
Testing same since   181746  2023-07-09 19:12:48 Z    0 days    1 attempts

------------------------------------------------------------
3735 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 621888 lines long.)


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 06:20:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 06:20:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560907.877063 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIkFt-0005aI-Ds; Mon, 10 Jul 2023 06:20:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560907.877063; Mon, 10 Jul 2023 06:20:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIkFt-0005aB-BD; Mon, 10 Jul 2023 06:20:17 +0000
Received: by outflank-mailman (input) for mailman id 560907;
 Mon, 10 Jul 2023 06:20:15 +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 <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qIkFr-0005a3-9k
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 06:20:15 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0627.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::627])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d2fe04c7-1ee9-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 08:20:12 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS8PR04MB8563.eurprd04.prod.outlook.com (2603:10a6:20b:422::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 10 Jul
 2023 06:20:09 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 06:20:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d2fe04c7-1ee9-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ObGjFPmS1yPE28LRMECfuqOHnX2J4Ousxx1q0Ya+pljHGE9au2QKvh+MBh4yquOc0qEzdKeHYAxquYsuwOaAfexwNXFSLjGDQBBRbhpjx9PIEbjVGrguGWJVOg1Zc3ij/84vKrPzo6K314l4d331X76YAV5kUExrzzJ5n0XpYgFc8+fm6TNu1S6VaNRhKY33cdq/Ynccq5SF6+osuDUeTrLsl6z7IEd2wc1Yilua5Pc54cOuS+OnQUavqrrm0R1lyUzdoj5jVepOrlKX9i2lLu2DPGFGAy0UshZ/9cLN0pDPgqIPhLEMqTWOu34urNt8NGu5GHAlEPBAO7RJok4F0w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=iPH02SSkTDOpBwnH7L7MImm6UfRFH1sdvzqPO8HquIk=;
 b=H9H17r/+nmDpjNixwG671ZON6HHlag7Jle9i/m33NZJNJew9+Qp1CF6PazjNPHuZ05c67tzWHIeKp6TF32WsCn9623jGlYJ5LDzrFc/s0PPGcdwH0lRggTYclFMuhwnMyzROVeSnUoDkuy44zli9QJZPbtHntmLEKBSUeLfIBkiUazmU5cRtdwLdzFyeSSThbslrr8vecjIGgM2aXweGomd7ufP5Y4DnH8z4b/iloJmBnqaUiIT0cAp1wP9IfO/OriiM+SL9w7v9j7iR0Bf5g9E+HgsUo6R077r5qT+K+nr8XkClWcD5ZwNLVU67CPmeTKQwVbmC9rNzQzE0OLZBfA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=iPH02SSkTDOpBwnH7L7MImm6UfRFH1sdvzqPO8HquIk=;
 b=hxMWHRCywZMZ/v2A84H9ZkWgEaDTupBg9t6x9MTyUF+lT320ttpc6ESgH1lbAF72+k8HcQo5Yp7JHR8qX1wuUAz79T2seCvyVrY5JQpbH7p9BbxEtgQBPZUAndv1afoVjXpCmszhxNy5GF/2Co05BCKaOOHmcmtaybl32qDZLUqBBSkR76qe4tSYHLRhHHv2we8D2C3l1dGkAkEvRBMdXJ2BprE9EsfxeRV09OOIw8BBTeamAy1dOT6XOrnW3YiCTObzng//H0XrQlhwO6PP8ccyvDnN3g+B1mEfamRdwRC/vbR15cxvBZ0HAyLGAGw/hl7oaDD03shTplLOw/bqUw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <04738efb-d74c-8151-9b75-8c30335f2b30@suse.com>
Date: Mon, 10 Jul 2023 08:20:08 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v7 01/12] vpci: introduce per-domain lock to protect vpci
 structure
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Paul Durrant <paul@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <20230613103159.524763-1-volodymyr_babchuk@epam.com>
 <20230613103159.524763-2-volodymyr_babchuk@epam.com>
 <ZIyOCan//39V3bdy@MacBook-Air-de-Roger.local> <87352kpj04.fsf@epam.com>
 <ZJQDGOrP1I3hR5Jj@MacBook-Air-de-Roger.local> <87ilbfnqmo.fsf@epam.com>
 <ZJVc77SwvyKOEdnJ@MacBook-Air-de-Roger.local> <87wmzfmltd.fsf@epam.com>
 <ab79bcb6-6fc8-c68f-65bf-16ce7316c3ae@suse.com> <87h6qchfn4.fsf@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <87h6qchfn4.fsf@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0138.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:96::7) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS8PR04MB8563:EE_
X-MS-Office365-Filtering-Correlation-Id: fd89f318-b3e3-4697-b2ac-08db810db5cf
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	WUtYBu3AHXJlhsd6DwBhZHK+b7EpVPAMrRRExCvAeoKbKS+ZcwJO6IBuc2N8C2TK5+BPpenGB/2cfSGmLhIm7tu7sHDzovYQeSM3I+j2obgQ3mkX3vi0g5eeiBKvNCNUPenJie6qMdZ2K6hgcKgwxfPFVu7eoQFZf/g2KmEx/odUr2TVLumg4gkyJmcSFwsM5aitpzwlZ/Qv0n1JMrEWOkSxW6PkQCBO466O6nTsxNPc6ZeMVy1g+xn/x5ya2Mr2O9iI8KeZJVpPDbU/iV+0y4yX16JyFD62kcr6MRFJ5pdTK3J+mT6h+mP+zvRJn253xmeYvMOOyqqVkSRVHuBataPDC/L8sIRtKgixhIOYBcPbutlJsiHU742URo5J8ubzah42u9qjVRt5h4sMgTxoRaCyFD4i+pyYO9gegJkvHZuEuosOKlIoZ+FjuUWchQCq+wdAjhwYNQAYESyyzd/DJunYzpty9pB1IU9Oyuc3y8b3N2RuTPSCOZHJVOokbSyquqKxv7Pg57ziFC2Uvj0IJD70GMCLBFJAtoyl5Viezto1eb8V63BIhOoGGLNJ5UWYQp+ob5sTpkBX+B0D+wrymR4oskfJin+ZgWGKxfAwn2LtXmsaKTRek4iKVASwTFV+fh6uNyD/7vF3k7SI/S6WxQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(376002)(366004)(136003)(39860400002)(346002)(451199021)(41300700001)(2906002)(5660300002)(8936002)(7416002)(8676002)(36756003)(478600001)(2616005)(31686004)(26005)(6506007)(6512007)(186003)(6486002)(86362001)(6916009)(66556008)(4326008)(66946007)(66476007)(54906003)(83380400001)(38100700002)(31696002)(316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iQ3kzYk5XUVFQOVRjZStEL3UwbUgrTzlaVVNK?=
 =?utf-8?B?T0c3Z28yVTBmZFZvWEVNenhzMUY4eWVxMlBscGRnYUZmejNvbEpRYy9zN3BV?=
 =?utf-8?B?SjdPbzNKNHFIZU9CclgxVklEQWdvQ0kvQ1NsSjNYWWUvYnB5dDdFVzJ6MkJk?=
 =?utf-8?B?cEkxaXF4dGJPcnNaSnB6TDhTNlFBZ1JDdnpUWjRjVGdDdlZxSitNbzh1cnNF?=
 =?utf-8?B?Q0JhamNhRkU1WTVhdTNXejVIRlFMN3FWZS9QZ1VRTmxHRWNna3ZRRzBQMlpI?=
 =?utf-8?B?bmUxVDhCVVVBU095QkVGd1I3ZFdLbUp6TDY0QzEyUms2UEt6bmNlcUtpcGI3?=
 =?utf-8?B?c3hDdlBzalNlSDF3RW1JRTNlSkZ6bnowYmFqa3VyVUxCRStJMG5XdCt6MFFF?=
 =?utf-8?B?VndaZnR5NHM0VC91Y04yQy9BWklOVDBVYnhlTytobXlSUVg2dmJHZVBRcnZE?=
 =?utf-8?Q?Ew+ZxwTjhPVllLZBVPY2HyFGc?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: fd89f318-b3e3-4697-b2ac-08db810db5cf
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 06:20:09.1078
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: NoFSahnjWofqn5+cNqH+psosSd6FCBfR7tig80erAgGwv3mrjX/bsEfs2ZzGHt8lJKSMgSxIhhxZnJb56Lch+g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8563

On 10.07.2023 00:41, Volodymyr Babchuk wrote:
> 
> Hi Jan,
> 
> Jan Beulich <jbeulich@suse.com> writes:
> 
>> On 04.07.2023 23:03, Volodymyr Babchuk wrote:
>>> I am currently implementing your proposal (along with Jan's
>>> suggestions), but I am facing ABBA deadlock with IOMMU's
>>> reassign_device() call, which has this piece of code:
>>>
>>>         list_move(&pdev->domain_list, &target->pdev_list);
>>>
>>> My immediate change was:
>>>
>>>         write_lock(&pdev->domain->pci_lock);
>>>         list_del(&pdev->domain_list);
>>>         write_unlock(&pdev->domain->pci_lock);
>>>
>>>         write_lock(&target->pci_lock);
>>>         list_add(&pdev->domain_list, &target->pdev_list);
>>>         write_unlock(&target->pci_lock);
>>>
>>> But this will not work because reassign_device is called from
>>> pci_release_devices() which iterates over d->pdev_list, so we need to
>>> take a d->pci_lock early.
>>>
>>> Any suggestions on how to fix this? My idea is to remove a device from a
>>> list one at time:
>>>
>>> int pci_release_devices(struct domain *d)
>>> {
>>>     struct pci_dev *pdev;
>>>     u8 bus, devfn;
>>>     int ret;
>>>
>>>     pcidevs_lock();
>>>     write_lock(&d->pci_lock);
>>>     ret = arch_pci_clean_pirqs(d);
>>>     if ( ret )
>>>     {
>>>         pcidevs_unlock();
>>>         write_unlock(&d->pci_lock);
>>>         return ret;
>>>     }
>>>
>>>     while ( !list_empty(&d->pdev_list) )
>>>     {
>>>         pdev = list_entry(&d->pdev_list, struct pci_dev, domain_list);
>>>         bus = pdev->bus;
>>>         devfn = pdev->devfn;
>>>         list_del(&pdev->domain_list);
>>>         write_unlock(&d->pci_lock);
>>>         ret = deassign_device(d, pdev->seg, bus, devfn) ?: ret;
>>>         write_lock(&d->pci_lock);
>>
>> I think it needs doing almost like this, but with two more tweaks and
>> no list_del() right here (first and foremost to avoid needing to
>> figure whether removing early isn't going to subtly break anything;
>> see below for an error case that would end up with changed behavior):
>>
>>     while ( !list_empty(&d->pdev_list) )
>>     {
>>         const struct pci_dev *pdev = list_first_entry(&d->pdev_list, struct pci_dev, domain_list);
>>         uint16_t seg = pdev->seg;
>>         uint8_t bus = pdev->bus;
>>         uint8_t devfn = pdev->devfn;
>>
>>         write_unlock(&d->pci_lock);
>>         ret = deassign_device(d, seg, bus, devfn) ?: ret;
>>         write_lock(&d->pci_lock);
>>     }
>>
>> One caveat though: The original list_for_each_entry_safe() guarantees
>> the loop to complete; your use of list_del() would guarantee that too,
>> but then the device wouldn't be on the list anymore if deassign_device()
>> failed. Therefore I guess you will need another local list where you
>> (temporarily) put all the devices which deassign_device() left on the
>> list, and which you would then move back to d->pdev_list after the loop
>> has finished.
> 
> Okay, taking into the account all that you wrote, I came with this
> implementation:

Looks plausible at the first glance, but will of course need looking at
in more detail in the context of the full patch. Just one (largely)
cosmetic remark right away:

> int pci_release_devices(struct domain *d)
> {
>     int combined_ret;
>     LIST_HEAD(failed_pdevs);
> 
>     pcidevs_lock();
>     write_lock(&d->pci_lock);
>     combined_ret = arch_pci_clean_pirqs(d);
>     if ( combined_ret )
>     {
>         pcidevs_unlock();
>         write_unlock(&d->pci_lock);
>         return combined_ret;
>     }
> 
>     while ( !list_empty(&d->pdev_list) )
>     {
>         struct pci_dev *pdev = list_first_entry(&d->pdev_list,
>                                                 struct pci_dev,
>                                                 domain_list);
>         uint16_t seg = pdev->seg;
>         uint8_t bus = pdev->bus;
>         uint8_t devfn = pdev->devfn;
>         int ret;
> 
>         write_unlock(&d->pci_lock);
>         ret = deassign_device(d, seg, bus, devfn);
>         write_lock(&d->pci_lock);
>         if ( ret )
>         {
>             bool still_present = false;
>             const struct pci_dev *tmp;
> 
>             for_each_pdev ( d, tmp )
>             {
>                 if ( tmp == (const struct pci_dev*)pdev )

As I'm sure I expressed earlier, casts should be avoided whenever
possible. I see no reason for one here: Comparing pointer-to-
const-<type> with pointer-to-<type> is permitted by the language.

>                 {
>                     still_present = true;
>                     break;
>                 }
>             }
>             if ( still_present )
>                 list_move(&pdev->domain_list, &failed_pdevs);
>             combined_ret = ret;
>         }
>     }
> 
>     list_splice(&failed_pdevs, &d->pdev_list);
>     write_unlock(&d->pci_lock);
>     pcidevs_unlock();
> 
>     return combined_ret;
> }
> 
> 
>> (Whether it is sufficient to inspect the list head to
>> determine whether the pdev is still on the list needs careful checking.)
> 
> I am not sure that this is enough. We dropped d->pci_lock so we can
> expect that the list was permutated in a random way.

Right, if that cannot be excluded for sure, then better stay on the safe
side for now. A code comment would be nice though ahead of the
for_each_pdev().

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 06:21:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 06:21:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560913.877074 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIkHK-0006C2-U3; Mon, 10 Jul 2023 06:21:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560913.877074; Mon, 10 Jul 2023 06:21:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIkHK-0006Bt-R8; Mon, 10 Jul 2023 06:21:46 +0000
Received: by outflank-mailman (input) for mailman id 560913;
 Mon, 10 Jul 2023 06:21:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qIkHJ-0006Bn-JJ
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 06:21:45 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20610.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::610])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0a9cd083-1eea-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 08:21:44 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by DB9PR04MB8464.eurprd04.prod.outlook.com (2603:10a6:10:2c1::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul
 2023 06:21:42 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 06:21:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0a9cd083-1eea-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JJDA/w2eGeYYDUzO55He5fPNfUxZPFh8nwH3R+mZiWVnChVc94NFXvwT5jwOmBOfe609thc8jzrjTaguJcBJS3wuhuDqmk/ybyFEYXj/2Rlhw+NsFm/QBple9gnmvYr2jEvyAluyECkdydVswA3z+plORc87lfEPYPHZUFaeR9qipMlYb8S7QNyEheo8Vo/5mNbGTc3jPr6/dyt+/euextyY0VZRsBCS71TnV84N8pay1QC8+JppVd8duoWycVEO4ob99hGVb89cwHnCPdJOt+nZT3mElJLOz2yWaaoeZYO7k1zoqgf25z67T+N7abgF68ERAjV8ee+UF1fsmaOJyw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Ozj+ldin6Zd4u8amLEQvs/aJ5J70foMberS7POJ0u1U=;
 b=R81ffrog/zoOKz36RoVDHJKkeOiNGomhMFt24V8g2lCctOlQuNHEZ6LKJautiWvUjItiu551hszVbYVvHrPxuBOSL6tyIuq1eGyWRXvmI9zsv2IB3N9mbopbNjbvrmw33lmToFpq+mjsA/ulYHugZ26K/z0nfGMka+xTxEqbTh9E2lCKj4wntMCExoUxnRd0aA3C9qgt2A+7GXLiJJijKD4IQXLB9u3RRD+sYtmTPmy8pf2P6mQMW+0bY3exoULwizlrogMUT/o+rI8BysVfJvI59iRCXjff/sEPsVEKdzkGGjW0TQPVk2QB5TYASFevQWlxKiGVY5JcySwIlG1egA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Ozj+ldin6Zd4u8amLEQvs/aJ5J70foMberS7POJ0u1U=;
 b=fu6IA5Co8RbTQo9911/dHpvO76cNpLBKIYtAQ5/M2Wmb+u82o4pTlHkHjrRPELGmpKLwL+UKw7frJEQ1vTi3N+VQ2uYJyG8mj1MlqtJZ+puaUXnCG8xV5kGo9fwQLJGhlAgs2vVI+t6ycVx9wr5N2NicwcjQbbAdzVL3jbhFcT1vc1W8Nx3FEtCj0oeC517WE+ZlI9VtMaxDcsNn04ZGrJP26vDCcTnHuITWbaOgsvUkqHGoFV3Ksx9lqkJO9rGj+nIdSM90NatM7JWinPkN7qEK3RXkpVmowWmdy5+Rg1LkZyYKJ2jC0IgQkin+TKfKrGLJGG/4m69+J3jEBWqBNw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <b69c2133-c34c-62d7-f2d1-289432be50c3@suse.com>
Date: Mon, 10 Jul 2023 08:21:41 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] docs/misra: add Rule 7.4 and 9.4
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: andrew.cooper3@citrix.com, roger.pau@citrix.com, julien@xen.org,
 george.dunlap@citrix.com, bertrand.marquis@arm.com,
 Stefano Stabellini <stefano.stabellini@amd.com>,
 xen-devel@lists.xenproject.org
References: <20230706224619.1092613-1-sstabellini@kernel.org>
 <9f2fc7fc-cab6-e14e-6fd3-a2e75d4becfa@suse.com>
 <alpine.DEB.2.22.394.2307071406480.761183@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307071406480.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0200.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ad::11) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DB9PR04MB8464:EE_
X-MS-Office365-Filtering-Correlation-Id: 063e7402-0a6b-4d3c-a728-08db810ded85
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	sqeFgWAO09Xht3b9d3aHw9ZNFEbbD8KksVE2yKGITLuLNnTLgBQ11yg9FI177zzjyn5ldNaq+MA80zsrfmdgERDWsh/TLZfdjTV0c4t1vKybriG9nS2vCVN0u4H/Akg3fWeubPOk0W4f4/UzEqhYGE88mBN7Oo3pKvC3a+s/5ERm6AvAVeMPDwwP5BlP2shTUzUcjspltU6ZdpptgLqY21exhdSbZ+TT3lVintznbmDH91NKk+seSffyAB9lXIn28KquNhh/Ru4XADMahMP7i1D5NXuQLjna0k2RrWwzDszAaOzouIBMlZ3p3GyFO94K3Kfq4c6I3t2h13cKNRcStrwll0br+FHiCg1r16iR+oFnJLGb+BJKh9B/q6DU7wpoM4ES62Jm9gCoJV/shfgZqt33rQxHQNdTB4NNwr96hQMMSU2p/32XurkuWP5jNnzSyKf9+9Tp8+sEvaT2NWx1RBq/dsMvaFhGQJr2yJczViQhed95OS6upewykh4ZjuY8qWjwrEbsEMKchahQbfgguVGYo/HxXWqEIjJBk4cCJzpLzPej7LL26Q03MBahkaa/bDg7jTniJl0Un9DbEgsREq3N52VXYVrcNnEG/iv6DLfm7sTLoxxlJ16ocoFLIFIrdQLu6/Qysn2gjICuGxTZ1A==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(376002)(346002)(39860400002)(136003)(451199021)(86362001)(31696002)(38100700002)(31686004)(36756003)(6486002)(53546011)(26005)(6506007)(186003)(6512007)(2616005)(5660300002)(2906002)(66556008)(316002)(478600001)(66946007)(8936002)(66476007)(8676002)(83380400001)(4326008)(6916009)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?ut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nNp?=
 =?utf-8?B?anU3eGxrMXB6UXhmU2I2NVBIOTVINkE1ei9JSytJWE9pRUg3cGYwV0laSlVM?=
 =?utf-8?B?aERHNkVmL0tscUpPK3JjS2tuRVUvekk0NWF2NXh5cm5RSmwwNTE1eGQrYU1y?=
 =?utf-8?B?ZmF1RUJnVlo1UUlWa3VjcHJoUDhtS3FKaUlHSEt5TmY5N2VKWWZPZnJrclFL?=
 =?utf-8?B?Qk9SaUc3YXE1MFo1SzZ5d29EZDI0TjBmMTl1RjRVTHVlR3ltVGw0VnhRcGhx?=
 =?utf-8?B?bjFZb3M1L0NJekwycXhnYmFrNGl6UGY0YjN6OFNDN1Q4Nm9RK3ZmYkVTNEZO?=
 =?utf-8?B?R1ExQ1Q3Y1haQm9zNC9iRThsWXdQd1JKd2RPdlZxc3pZYjFDbTlDb0ZnRkNx?=
 =?utf-8?Q?FnwPMyyIDW/k2hwlpxC6GmESP?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 063e7402-0a6b-4d3c-a728-08db810ded85
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 06:21:42.3578
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: CUhLrcSwOWlaJHu2zZSaxr4IOYXPGtQbH9jBUhJ581NFgpLgJu8qfafU2RNkaLgpEHyIq1gO5SRqnlVSmMfzKw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8464

On 07.07.2023 23:10, Stefano Stabellini wrote:
> On Fri, 7 Jul 2023, Jan Beulich wrote:
>> On 07.07.2023 00:46, Stefano Stabellini wrote:
>>> --- a/docs/misra/rules.rst
>>> +++ b/docs/misra/rules.rst
>>> @@ -203,6 +203,13 @@ maintainers if you want to suggest a change.
>>>       - The lowercase character l shall not be used in a literal suffix
>>>       -
>>>  
>>> +   * - `Rule 7.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_07_04.c>`_
>>> +     - Required
>>> +     - A string literal shall not be assigned to an object unless the
>>> +       objects type is pointer to const-qualified char
>>> +     - Assigning a string literal to any object with type
>>> +       "pointer to const-qualified void" is allowed
>>
>> I guess this is relevant also in a few other cases: Considering the
>> significant difference between title and actual text of the rule, and
>> further assuming people looking here won't always pull out the full
>> doc (they may not even have a copy of it), I think it is important to
>> also mention in a remark that despite the title all "character types"
>> are permitted, as long as string element type and character type match.
>> Since the compiler won't allow mismatches when the lhs type isn't void,
>> mandating no use of casts to "satisfy" the rule may be a way to express
>> our intentions.
> 
> What about:
> 
>    * - `Rule 7.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_07_04.c>`_
>      - Required
>      - A string literal shall not be assigned to an object unless the
>        objects type is pointer to const-qualified char
>      - All "character types" are permitted, as long as the string
>        element type and the character type match. (There should be no
>        casts.) Assigning a string literal to any object with type
>        "pointer to const-qualified void" is allowed.

SGTM.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 06:22:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 06:22:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560917.877084 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIkIR-0006k2-9C; Mon, 10 Jul 2023 06:22:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560917.877084; Mon, 10 Jul 2023 06:22:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIkIR-0006jv-5f; Mon, 10 Jul 2023 06:22:55 +0000
Received: by outflank-mailman (input) for mailman id 560917;
 Mon, 10 Jul 2023 06:22:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qIkIP-0006jn-JE
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 06:22:53 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20603.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::603])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 32f41698-1eea-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 08:22:52 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PAXPR04MB8733.eurprd04.prod.outlook.com (2603:10a6:102:21d::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 10 Jul
 2023 06:22:50 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 06:22:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 32f41698-1eea-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JIsejwIZ2WYvW9PYXgaKkxwJI6loXxjm5WRbdX4iF4q6WndiW3o6j65phpLhdOUdipOysw1O1VwViSzsL3BEGvVl/s7M+C/djtAkE8v0SRewZkzyY1ZLHei3uJQqCPmplJB21iLDstypyKeG+ssrNgvHJPJHcrUzK06IxN7lleKjjMfuQXr8Gb+QApnYoMp1L2kgi5aGGFzHgg5PpNU8vXjiMaVjRXsVUDnZf4O1LHPeZhWlYlHIsOhBijpRLbRZ8Ir/iVr5Vvwc2o4XKJToTZMgjM1Yfof1+B5mhIW4hXvvZeTEwieGu2u9K2olRATGYoPJGBYDph5XYs0pWGgjWg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=zPg0p2XJ4w47nEbh++4J8FpBJq0K82oHesJLvIjo3uA=;
 b=T9Gn1/TYRkPYsH4fPn68oBHEIA6tuJ1xfdTRgKCW6ojOcIH4Jsv6kRWztQGrbpAakDiibXXebIHSpyZCEs4WiEta25+LS4loRaYJ606BtByXqtb05QaAa9+QSn0DwINsHxHb+BFP9cuOy+fbNVp/FtJbVsS24ANE7TqFGz7BlpAGrdd/+Es9xOZh2ok2MofO1T75VT6VZ0b+Jc4DiyxlbTaVHCbh4K9zLWHZBjL5WpbpmhSpJZvoz3+1UFg1zYZtpFIfet5Ug5pFx5vfTULGu9En6U1ATFDhcpwgqXflSEj34qmPVSxEPKdcLAT2fARg2e4/p9U8rS4waWm4WegLuQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=zPg0p2XJ4w47nEbh++4J8FpBJq0K82oHesJLvIjo3uA=;
 b=fBBWL811NJegGyOJ+CTkKnImhgohlDeknh+Euw9pZOelJRnfooocbZ+p8RQ6iOg9udGl7PP1qbQR4lXT6M4eryLXXXdzEfybls5vtukn3T7Z/WEt7zCwPCnIsf/Q0C6u++ty0P8aJxv2vPXjPBcScm7Mi7yWdtarJ1wFAAxVzTVDocMJZljYmL5z04ztwmjhGdpi40g4CaLz+b+0gEf6g9f2tOg3YnssXs5NOH0CGRBgSAPR2dLF3aE9u0DBoAi99tM5rY+fOsaAdK1pRdiSwcZqAezNcDL7QtYfCa/fmu4LkYphwbZ+PfSxSNnOaYUke9kqdhD5OH0xaHbBRFx5Nw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <754b3015-d3e5-b734-bda6-266c599625a2@suse.com>
Date: Mon, 10 Jul 2023 08:22:47 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v2] x86: make function declarations consistent with
 definitions
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Federico Serafini <federico.serafini@bugseng.com>,
 consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Paul Durrant <paul@xen.org>,
 Tamas K Lengyel <tamas@tklengyel.com>,
 Alexandru Isaila <aisaila@bitdefender.com>,
 Petre Pircalabu <ppircalabu@bitdefender.com>,
 Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <1b2d5be30c0e4f335e59dce6e7c001cb0805d702.1688465215.git.federico.serafini@bugseng.com>
 <a16cdb60-1307-636e-1473-e5388e8f79d9@suse.com>
 <alpine.DEB.2.22.394.2307051604380.761183@ubuntu-linux-20-04-desktop>
 <2c7d71cb-067d-8dac-3ee4-3af42b2756f3@suse.com>
 <alpine.DEB.2.22.394.2307061506560.761183@ubuntu-linux-20-04-desktop>
 <e6fb3b99-d59a-eceb-024a-8b791ef20129@suse.com>
 <alpine.DEB.2.22.394.2307071425040.761183@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307071425040.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0182.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a4::17) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAXPR04MB8733:EE_
X-MS-Office365-Filtering-Correlation-Id: b8e11212-c717-4a90-1f7c-08db810e1503
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	XnSYCh7EuNRIc9+atYw9wKYYBp/aQKEgmIh4tqwdZZpnSCs6fWH+u4xPSIkGEP6gAbiWv0mgZwzQB+sVKxg6AgjeoDZ66rFuYIBAPaodPN9KC3X+Dh3V/UUR68IJSh9EJYBkeKof2jOJ76CF9v1+fU42+DOuc4FIVpvuT7KSlRuD4fa8C5IIzM42gq2XEz77rtEq31QPqcdEimOghO+HqF/uGxkWrmhBpAy080Xd66GfcPF6ukFTbD1RuDNkzZPmBAnPLvawsbEw/UHqM02YdSEis6ssJyYB5Weh7Q/gwYUt3+cz+LNEz4hiwGahQGdU8T2UmJrYMROaV54jopl5zkbNdG9mYxpw/CHSjSTZpDfW63U3qRgtOHorfQGJ+q7a5LbXn+q35AwL0LCkYC1/IccoaPyYHX7IyxWFW8gS7DdrDziTdXae2Ygq7WYz79FGITHjMM59eyQbL9TNgAkXk+oFFBv460zULw8hWOx8H2QDIDgRO3cvDTc2VzZYTlwIiD8iaqFeWqPnp+gEu4EMa2HmJrB4vVMv4fXQiLpifikZN4p0V2GMH2gGMEjIj/ku6ExfXBGwQL0kARo/xtdmWL+13kM6+njTMg87cW/MI8uugPFg/E56UtfEqUKfoHvrE+XFTzcyJzYw374JUTBBXA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(346002)(396003)(366004)(39860400002)(376002)(451199021)(2906002)(41300700001)(8936002)(8676002)(36756003)(7416002)(5660300002)(31696002)(86362001)(6512007)(6486002)(478600001)(83380400001)(186003)(53546011)(4326008)(2616005)(6916009)(54906003)(66476007)(31686004)(66556008)(66946007)(6506007)(26005)(38100700002)(316002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?R3VXVkNEMEFaS1BYakhzWEZoeEwrZWljL3F1SGhQRGRiOW4vNy8zTjlta29t?=
 =?utf-8?B?dW16b0NDTkJWdnJYeHNJbjNwS1F4c3JNTUxHK3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cGJ2UHVEb2YvVHNDbnVZdG5PaUU4cVRIQmF1MWZ4VGZrQmQ3?=
 =?utf-8?B?MXBUcHN6ckozelAyTWpIdm9pRFpYZU1YYkwxcDFjUE9WMFBRNU5GbDRNZHc0?=
 =?utf-8?B?RHBaODUzWWgva1NRRUcrUGpDVVdXdWRkTnRScUl3Y0N1d2owUEN4dmhuR1d4?=
 =?utf-8?B?NzhnQ1ZUVTdQVTg4aml6WG41aUszSzY5T041MFJ4dDcwUmJZYjNzWkhIZEpL?=
 =?utf-8?B?ZkdaV2FkbG9xRnh6Q0xoelRBYzFFS1ZvdjFkK2RETlc4emV2SDcrVm5SOTZ1?=
 =?utf-8?Q?1F8Z2+oaDCEcEzJBwFtw7X3c6?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b8e11212-c717-4a90-1f7c-08db810e1503
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 06:22:48.6084
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: CLbyr9CksBDfWMXIb69umV24FfaB7oHMXTUO5tv7RDeS3VzGurz3BVVuUl8h+YlWgKTcMeWRefopY3V5AcjlTA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8733

On 07.07.2023 23:28, Stefano Stabellini wrote:
> On Fri, 7 Jul 2023, Jan Beulich wrote:
>> On 07.07.2023 00:29, Stefano Stabellini wrote:
>>> On Thu, 6 Jul 2023, Jan Beulich wrote:
>>>> On 06.07.2023 01:22, Stefano Stabellini wrote:
>>>>> On Tue, 4 Jul 2023, Jan Beulich wrote:
>>>>>> On 04.07.2023 12:23, Federico Serafini wrote:
>>>>>>> Change mechanically the parameter names and types of function
>>>>>>> declarations to be consistent with the ones used in the corresponding
>>>>>>> definitions so as to fix violations of MISRA C:2012 Rule 8.3 ("All
>>>>>>> declarations of an object or function shall use the same names and type
>>>>>>> qualifiers") and MISRA C:2012 Rule 8.2 ("Function types shall be in
>>>>>>> prototype form with named parameters").
>>>>>>>
>>>>>>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
>>>>>>
>>>>>> On top of my earlier remark (when this was part of a series):
>>>>>
>>>>> I am not addressing specifically this comment. I am trying to build a
>>>>> common understanding on how to do things so that we can go faster in the
>>>>> future.
>>>>>
>>>>> In general, as discussed at Xen Summit, in order to successfully merge
>>>>> large numbers of changes in the coming weeks we should try to keep
>>>>> mechanical changes mechanical. Separate non-mechanical changes into
>>>>> different patches.
>>>>>
>>>>> This patch is large but mechanical. If I understand you correctly, you
>>>>> are asking:
>>>>> 1) to split the patch into smaller patches
>>>>> 2) make a couple of non-mechanical changes described below
>>>>>
>>>>>
>>>>> For 1), in my opinion it is not necessary as long as all changes remain
>>>>> mechanical. If some changes are not mechanical they should be split out.
>>>>> So if you are asking non-mechanical changes in 2), then 2) should be
>>>>> split out but everything else could stay in the same patch.
>>>>>
>>>>> If you'd still like the patch to be split, OK but then you might want to
>>>>> suggest exactly how it should be split because it is not obvious: all
>>>>> changes are similar, local, and mechanical. I for one wouldn't know how
>>>>> you would like this patch to be split.
>>>>
>>>> So I gave a clear reason and guideline how to split: To reduce the Cc
>>>> list of (because of requiring fewer acks for) individual patches, and
>>>> to separate (possibly) controversial from non-controversial changes.
>>>> This then allows "easy" changes to go in quickly.
>>>>
>>>> I realize that what may be controversial may not always be obvious,
>>>> but if in doubt this can be addressed in a v2 by simply omitting such
>>>> changes after a respective comment was given (see also below).
>>>
>>> So the guideline is to separate by maintainership, e.g.
>>> x86/arm/common/vpci
>>>
>>> Also separate out anything controversial and/or that receives feedback
>>> so it is not mechanical/straightforward anymore.
>>>
>>>
>>>>> For 2), I would encourage you to consider the advantage of keeping the
>>>>> changes as-is in this patch, then send out a patch on top the way you
>>>>> prefer. That is because it costs you more time to describe how you
>>>>> would like these lines to be changed in English and review the full
>>>>> patch a second time, than change them yourself and anyone could ack them
>>>>> (feel free to CC me).
>>>>>
>>>>> For clarity: I think it is totally fine that you have better suggestions
>>>>> on parameter names. I am only pointing out that providing those
>>>>> suggestions as feedback in an email reply is not a very efficient way to
>>>>> get it done.
>>>>
>>>> What you suggest results in the same code being touched twice to
>>>> achieve the overall goal (satisfy Misra while at the same time not
>>>> making the code any worse than it already is). I'd like to avoid this
>>>> whenever possible, so my preference would be that if the English
>>>> description isn't clear, then the respective change would best be
>>>> omitted (and left to be addressed separately).
>>>
>>> Yes, I think that would work. Basically the process could look like
>>> this:
>>>
>>> - contributor sends out a patch with a number of mechanical changes
>>> - reviewer spots a couple of things better done differently
>>> - reviewer replies with "drop this change, I'll do it" no further
>>>   explanation required
>>> - in parallel: contributor sends out v2 without those changes for the
>>>   reviewer to ack
>>> - in parallel: reviewer sends out his favorite version of the changes
>>>   for anyone to ack (assuming he is the maintainer)
>>
>> For this last point, I don't see it needing to happen in parallel.
>> Reviewers may be busy with other things, and making less mechanical
>> changes can easily be done a little later. The overall count of
>> violations is still going to decrease.
> 
> OK. Another suggestion along these lines is that if a revision of a
> patch is OK except for 2 changes, those 2 changes could be removed on
> commit to avoid another re-submit and re-review.
> 
> E.g. a patch has 50 fixes. 2 of these fixes are wrong, the rest are OK.
> The maintainer/committer commits the patch with 48 fixes, removing the 2
> unwanted fixes.

Sure, no concern in this regard from my side.

Jan

> Keep in mind that resubmissions of these MISRA C patches also cause more
> work for the reviewers/maintainers. I think we should try to find ways
> to decrease the overall workload of everyone involved.



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:00:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:00:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560944.877110 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIksE-0002ht-97; Mon, 10 Jul 2023 06:59:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560944.877110; Mon, 10 Jul 2023 06:59:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIksE-0002hm-61; Mon, 10 Jul 2023 06:59:54 +0000
Received: by outflank-mailman (input) for mailman id 560944;
 Mon, 10 Jul 2023 06:59:52 +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 <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIksC-0002bQ-Ip
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 06:59:52 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5d4881e2-1eef-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 08:59:50 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 4AE4E1F38D;
 Mon, 10 Jul 2023 06:59:50 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1B5811361C;
 Mon, 10 Jul 2023 06:59:50 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id PTQrBWasq2RZYgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 06:59:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5d4881e2-1eef-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972390; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:  content-transfer-encoding:content-transfer-encoding;
	bh=F4puyu1BswEV6Vw6vcv/7pys51yNvY/2hWRwamK9TBg=;
	b=ZW0LiOn712hAR3YKocaUBKvsk/ejYT0Jl2kcJDehsSDOWx9Wcqt5XrXp14g3sAS7yVxbu7
	w5RpdHQAhHzyhXXiSts9x5Slg9hwZLMr0WY8Ln6+YR/EITM/rBenronzdudvwYBfJUlltt
	sqRE3A6b3q4gJN2THAWy5t8ViV5Fa68=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 00/18] tools/xenstore: drop TDB
Date: Mon, 10 Jul 2023 08:59:29 +0200
Message-Id: <20230710065947.4201-1-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Using TDB for storing the Xenstore nodes is adding more complexity
instead of removing it. With keeping the data in memory only, the main
reason for using TDB has disappeared.

This series is replacing TDB with a hashlist referencing directly
individually allocated Xenstore nodes.

This in turn allows to use references of the stored nodes instead of
copying them in case only read access is needed. Some simple tests
using the test-xenstore utility have shown no single test being slower
with this series applied, but some tests experienced up to 10% better
performance.

Changes in V2:
- addressed comments
- split former patch 9 into 2 patches
- added patches 13-18

Juergen Gross (18):
  tools/xenstore: explicitly specify create or modify for tdb_store()
  tools/xenstore: replace key in struct node with data base name
  tools/xenstore: let transaction_prepend() return the name for access
  tools/xenstore: rename do_tdb_delete() and change parameter type
  tools/xenstore: rename do_tdb_write() and change parameter type
  tools/xenstore: switch get_acc_data() to use name instead of key
  tools/xenstore: add wrapper for tdb_fetch()
  tools/xenstore: make hashtable key and value parameters const
  tools/xenstore: let hashtable_add() fail in case of existing entry
  tools/xenstore: add hashtable_replace() function
  tools/xenstore: drop use of tdb
  tools/xenstore: remove tdb code
  tools/xenstore: let db_delete() return void
  tools/xenstore: move copying of node data out of db_fetch()
  tools/xenstore: rework struct xs_tdb_record_hdr
  tools/xenstore: don't use struct node_perms in struct node
  tools/xenstore: use struct node_hdr in struct node
  tools/xenstore: add nocopy flag to node read functions

 tools/xenstore/Makefile.common         |    2 +-
 tools/xenstore/hashtable.c             |   60 +-
 tools/xenstore/hashtable.h             |   20 +-
 tools/xenstore/tdb.c                   | 1748 ------------------------
 tools/xenstore/tdb.h                   |  132 --
 tools/xenstore/utils.h                 |    9 -
 tools/xenstore/xenstored_core.c        |  498 ++++---
 tools/xenstore/xenstored_core.h        |   81 +-
 tools/xenstore/xenstored_domain.c      |   20 +-
 tools/xenstore/xenstored_transaction.c |   95 +-
 tools/xenstore/xenstored_transaction.h |    5 +-
 tools/xenstore/xenstored_watch.c       |   11 +-
 12 files changed, 427 insertions(+), 2254 deletions(-)
 delete mode 100644 tools/xenstore/tdb.c
 delete mode 100644 tools/xenstore/tdb.h

-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:00:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:00:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560945.877121 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIksI-0002yx-Jm; Mon, 10 Jul 2023 06:59:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560945.877121; Mon, 10 Jul 2023 06:59:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIksI-0002ym-GV; Mon, 10 Jul 2023 06:59:58 +0000
Received: by outflank-mailman (input) for mailman id 560945;
 Mon, 10 Jul 2023 06:59:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIksH-0002xd-6F
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 06:59:57 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 607964b0-1eef-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 08:59:56 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id DDBA021E97;
 Mon, 10 Jul 2023 06:59:55 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id AB8E01361C;
 Mon, 10 Jul 2023 06:59:55 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id hH1xKGusq2RmYgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 06:59:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 607964b0-1eef-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972395; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=RHidA/DT+UzUPB1UMUSx12c63/zw1jPxU6Hc1TI8NHE=;
	b=sOc8dJ7YeDIG6wYvixIVMq5a9LyD8ATvLQm0JWcdufmdoZ9rExKz1/2QoR/1cam1NUEcbm
	UsGvUWBjcPPTEj+tDZcI39vyExUEHVYlSloU5Z1UZupMzTJfyHJyHAIjXEfHZH80YEjXs7
	vxdk4Zx+OZq/wrhyEbBvHHwVyF2Ic0U=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 01/18] tools/xenstore: explicitly specify create or modify for tdb_store()
Date: Mon, 10 Jul 2023 08:59:30 +0200
Message-Id: <20230710065947.4201-2-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230710065947.4201-1-jgross@suse.com>
References: <20230710065947.4201-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Instead of using TDB_REPLACE for either creating or modifying a TDB
entry, use either TDB_INSERT or TDB_MODIFY when calling tdb_store().

At higher function levels use the abstract flag values NODE_CREATE
and NODE_MODIFY.

This is for preparing to get rid of TDB, even if it is beneficial
while using TDB, too.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- use an enum for the new "flag" parameter of do_tdb_write()
  (Julien Grall)
- add comment to read_state_node() (Julien Grall)
---
 tools/xenstore/xenstored_core.c        | 32 +++++++++++++++-----------
 tools/xenstore/xenstored_core.h        | 10 ++++++--
 tools/xenstore/xenstored_domain.c      |  2 +-
 tools/xenstore/xenstored_transaction.c |  8 +++++--
 4 files changed, 34 insertions(+), 18 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 31a862b715..71a8a899db 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -601,7 +601,8 @@ static unsigned int get_acc_domid(struct connection *conn, TDB_DATA *key,
 }
 
 int do_tdb_write(struct connection *conn, TDB_DATA *key, TDB_DATA *data,
-		 struct node_account_data *acc, bool no_quota_check)
+		 struct node_account_data *acc, enum write_node_mode mode,
+		 bool no_quota_check)
 {
 	struct xs_tdb_record_hdr *hdr = (void *)data->dptr;
 	struct node_account_data old_acc = {};
@@ -635,7 +636,8 @@ int do_tdb_write(struct connection *conn, TDB_DATA *key, TDB_DATA *data,
 	}
 
 	/* TDB should set errno, but doesn't even set ecode AFAICT. */
-	if (tdb_store(tdb_ctx, *key, *data, TDB_REPLACE) != 0) {
+	if (tdb_store(tdb_ctx, *key, *data,
+		      (mode == NODE_CREATE) ? TDB_INSERT : TDB_MODIFY) != 0) {
 		domain_memory_add_nochk(conn, new_domid,
 					-data->dsize - key->dsize);
 		/* Error path, so no quota check. */
@@ -774,7 +776,7 @@ static bool read_node_can_propagate_errno(void)
 }
 
 int write_node_raw(struct connection *conn, TDB_DATA *key, struct node *node,
-		   bool no_quota_check)
+		   enum write_node_mode mode, bool no_quota_check)
 {
 	TDB_DATA data;
 	void *p;
@@ -812,7 +814,7 @@ int write_node_raw(struct connection *conn, TDB_DATA *key, struct node *node,
 	p += node->datalen;
 	memcpy(p, node->children, node->childlen);
 
-	if (do_tdb_write(conn, key, &data, &node->acc, no_quota_check))
+	if (do_tdb_write(conn, key, &data, &node->acc, mode, no_quota_check))
 		return EIO;
 
 	return 0;
@@ -823,14 +825,14 @@ int write_node_raw(struct connection *conn, TDB_DATA *key, struct node *node,
  * node->key. This can later be used if the change needs to be reverted.
  */
 static int write_node(struct connection *conn, struct node *node,
-		      bool no_quota_check)
+		      enum write_node_mode mode, bool no_quota_check)
 {
 	int ret;
 
 	if (access_node(conn, node, NODE_ACCESS_WRITE, &node->key))
 		return errno;
 
-	ret = write_node_raw(conn, &node->key, node, no_quota_check);
+	ret = write_node_raw(conn, &node->key, node, mode, no_quota_check);
 	if (ret && conn && conn->transaction) {
 		/*
 		 * Reverting access_node() is hard, so just fail the
@@ -1496,7 +1498,8 @@ static struct node *create_node(struct connection *conn, const void *ctx,
 			goto err;
 		}
 
-		ret = write_node(conn, i, false);
+		ret = write_node(conn, i, i->parent ? NODE_CREATE : NODE_MODIFY,
+				 false);
 		if (ret)
 			goto err;
 
@@ -1560,7 +1563,7 @@ static int do_write(const void *ctx, struct connection *conn,
 	} else {
 		node->data = in->buffer + offset;
 		node->datalen = datalen;
-		if (write_node(conn, node, false))
+		if (write_node(conn, node, NODE_MODIFY, false))
 			return errno;
 	}
 
@@ -1610,7 +1613,7 @@ static int remove_child_entry(struct connection *conn, struct node *node,
 	memdel(node->children, offset, childlen + 1, node->childlen);
 	node->childlen -= childlen + 1;
 
-	return write_node(conn, node, true);
+	return write_node(conn, node, NODE_MODIFY, true);
 }
 
 static int delete_child(struct connection *conn,
@@ -1807,7 +1810,7 @@ static int do_set_perms(const void *ctx, struct connection *conn,
 	if (domain_nbentry_inc(conn, get_node_owner(node)))
 		return ENOMEM;
 
-	if (write_node(conn, node, false))
+	if (write_node(conn, node, NODE_MODIFY, false))
 		return errno;
 
 	fire_watches(conn, ctx, name, node, false, &old_perms);
@@ -2321,7 +2324,7 @@ static void manual_node(const char *name, const char *child)
 	if (child)
 		node->childlen = strlen(child) + 1;
 
-	if (write_node(NULL, node, false))
+	if (write_node(NULL, node, NODE_CREATE, false))
 		barf_perror("Could not create initial node %s", name);
 	talloc_free(node);
 }
@@ -3469,12 +3472,15 @@ void read_state_node(const void *ctx, const void *state)
 			barf("allocation error restoring node");
 
 		set_tdb_key(parentname, &key);
-		if (write_node_raw(NULL, &key, parent, true))
+		if (write_node_raw(NULL, &key, parent, NODE_MODIFY, true))
 			barf("write parent error restoring node");
 	}
 
 	set_tdb_key(name, &key);
-	if (write_node_raw(NULL, &key, node, true))
+
+	/* The "/" node is already existing, so it can only be modified here. */
+	if (write_node_raw(NULL, &key, node,
+			   strcmp(name, "/") ? NODE_CREATE : NODE_MODIFY, true))
 		barf("write node error restoring node");
 
 	if (domain_nbentry_inc(&conn, get_node_owner(node)))
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 84a611cbb5..8130993184 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -237,8 +237,13 @@ static inline unsigned int get_node_owner(const struct node *node)
 }
 
 /* Write a node to the tdb data base. */
+enum write_node_mode {
+	NODE_CREATE,
+	NODE_MODIFY
+};
+
 int write_node_raw(struct connection *conn, TDB_DATA *key, struct node *node,
-		   bool no_quota_check);
+		   enum write_node_mode mode, bool no_quota_check);
 
 /* Get a node from the tdb data base. */
 struct node *read_node(struct connection *conn, const void *ctx,
@@ -358,7 +363,8 @@ int remember_string(struct hashtable *hash, const char *str);
 
 void set_tdb_key(const char *name, TDB_DATA *key);
 int do_tdb_write(struct connection *conn, TDB_DATA *key, TDB_DATA *data,
-		 struct node_account_data *acc, bool no_quota_check);
+		 struct node_account_data *acc, enum write_node_mode mode,
+		 bool no_quota_check);
 int do_tdb_delete(struct connection *conn, TDB_DATA *key,
 		  struct node_account_data *acc);
 
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index 632ddb5efc..ac0e109654 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -523,7 +523,7 @@ static int domain_tree_remove_sub(const void *ctx, struct connection *conn,
 		node->perms.p[0].id = priv_domid;
 		node->acc.memory = 0;
 		domain_nbentry_inc(NULL, priv_domid);
-		if (write_node_raw(NULL, &key, node, true)) {
+		if (write_node_raw(NULL, &key, node, NODE_MODIFY, true)) {
 			/* That's unfortunate. We only can try to continue. */
 			syslog(LOG_ERR,
 			       "error when moving orphaned node %s to dom0\n",
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 334f1609f1..0655073de7 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -290,7 +290,8 @@ int access_node(struct connection *conn, struct node *node,
 			i->check_gen = true;
 			if (node->generation != NO_GENERATION) {
 				set_tdb_key(i->trans_name, &local_key);
-				ret = write_node_raw(conn, &local_key, node, true);
+				ret = write_node_raw(conn, &local_key, node,
+						     NODE_CREATE, true);
 				if (ret)
 					goto err;
 				i->ta_node = true;
@@ -363,6 +364,7 @@ static int finalize_transaction(struct connection *conn,
 	TDB_DATA key, ta_key, data;
 	struct xs_tdb_record_hdr *hdr;
 	uint64_t gen;
+	int flag;
 
 	list_for_each_entry_safe(i, n, &trans->accessed, list) {
 		if (i->check_gen) {
@@ -405,8 +407,10 @@ static int finalize_transaction(struct connection *conn,
 					  ta_key.dsize + data.dsize);
 				hdr = (void *)data.dptr;
 				hdr->generation = ++generation;
+				flag = (i->generation == NO_GENERATION)
+				       ? NODE_CREATE : NODE_MODIFY;
 				*is_corrupt |= do_tdb_write(conn, &key, &data,
-							    NULL, true);
+							    NULL, flag, true);
 				talloc_free(data.dptr);
 				if (do_tdb_delete(conn, &ta_key, NULL))
 					*is_corrupt = true;
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:00:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:00:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560947.877131 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIksP-00043r-U3; Mon, 10 Jul 2023 07:00:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560947.877131; Mon, 10 Jul 2023 07:00:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIksP-00043i-Ob; Mon, 10 Jul 2023 07:00:05 +0000
Received: by outflank-mailman (input) for mailman id 560947;
 Mon, 10 Jul 2023 07:00:04 +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 <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIksO-0002bQ-EP
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:00:04 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 63d8a21d-1eef-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 09:00:02 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 7DC571F88C;
 Mon, 10 Jul 2023 07:00:01 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 492EA1361C;
 Mon, 10 Jul 2023 07:00:01 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id YueMEHGsq2R7YgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 07:00:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 63d8a21d-1eef-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972401; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=KFmpVFU+h7qc5u0FKx+I037y6Jj0Yy07AlxSMLRNjII=;
	b=Xec4XyY7Y5NLn+3prjqMdyguvB+VbJS9VgiQScRNIzCfvTlYviSQlYaxQ6pWRzxS8eR6zP
	pSIczuesx+RXE5BtbrCT5rpo0y9el8YRKLpzTalQIlNIZNYmUPoGfx8DIBjPZ2TGLNnUtL
	gj4aSpsLQjLBFoxOOAr5ercDoudU9E4=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [PATCH v2 02/18] tools/xenstore: replace key in struct node with data base name
Date: Mon, 10 Jul 2023 08:59:31 +0200
Message-Id: <20230710065947.4201-3-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230710065947.4201-1-jgross@suse.com>
References: <20230710065947.4201-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Instead of storing the TDB key in struct node, only store the name of
the node used to access it in the data base.

Associated with that change replace the key parameter of access_node()
with the equivalent db_name.

This is in preparation to replace TDB with a more simple data storage.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 tools/xenstore/xenstored_core.c        | 19 +++++++++++++------
 tools/xenstore/xenstored_core.h        |  4 ++--
 tools/xenstore/xenstored_transaction.c | 10 +++++-----
 tools/xenstore/xenstored_transaction.h |  2 +-
 4 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 71a8a899db..521ce1a70e 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -821,18 +821,20 @@ int write_node_raw(struct connection *conn, TDB_DATA *key, struct node *node,
 }
 
 /*
- * Write the node. If the node is written, caller can find the key used in
- * node->key. This can later be used if the change needs to be reverted.
+ * Write the node. If the node is written, caller can find the DB name used in
+ * node->db_name. This can later be used if the change needs to be reverted.
  */
 static int write_node(struct connection *conn, struct node *node,
 		      enum write_node_mode mode, bool no_quota_check)
 {
 	int ret;
+	TDB_DATA key;
 
-	if (access_node(conn, node, NODE_ACCESS_WRITE, &node->key))
+	if (access_node(conn, node, NODE_ACCESS_WRITE, &node->db_name))
 		return errno;
 
-	ret = write_node_raw(conn, &node->key, node, mode, no_quota_check);
+	set_tdb_key(node->db_name, &key);
+	ret = write_node_raw(conn, &key, node, mode, no_quota_check);
 	if (ret && conn && conn->transaction) {
 		/*
 		 * Reverting access_node() is hard, so just fail the
@@ -1446,10 +1448,13 @@ nomem:
 
 static void destroy_node_rm(struct connection *conn, struct node *node)
 {
+	TDB_DATA key;
+
 	if (streq(node->name, "/"))
 		corrupt(NULL, "Destroying root node!");
 
-	do_tdb_delete(conn, &node->key, &node->acc);
+	set_tdb_key(node->db_name, &key);
+	do_tdb_delete(conn, &key, &node->acc);
 }
 
 static int destroy_node(struct connection *conn, struct node *node)
@@ -1639,10 +1644,11 @@ static int delnode_sub(const void *ctx, struct connection *conn,
 	const char *root = arg;
 	bool watch_exact;
 	int ret;
+	const char *db_name;
 	TDB_DATA key;
 
 	/* Any error here will probably be repeated for all following calls. */
-	ret = access_node(conn, node, NODE_ACCESS_DELETE, &key);
+	ret = access_node(conn, node, NODE_ACCESS_DELETE, &db_name);
 	if (ret > 0)
 		return WALK_TREE_SUCCESS_STOP;
 
@@ -1650,6 +1656,7 @@ static int delnode_sub(const void *ctx, struct connection *conn,
 		return WALK_TREE_ERROR_STOP;
 
 	/* In case of error stop the walk. */
+	set_tdb_key(db_name, &key);
 	if (!ret && do_tdb_delete(conn, &key, &node->acc))
 		return WALK_TREE_ERROR_STOP;
 
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 8130993184..2cfc01f200 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -181,8 +181,8 @@ struct node_account_data {
 
 struct node {
 	const char *name;
-	/* Key used to update TDB */
-	TDB_DATA key;
+	/* Name used to access data base. */
+	const char *db_name;
 
 	/* Parent (optional) */
 	struct node *parent;
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 0655073de7..9dab0cd165 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -227,7 +227,7 @@ void transaction_prepend(struct connection *conn, const char *name,
  * to be accessed in the data base.
  */
 int access_node(struct connection *conn, struct node *node,
-		enum node_access_type type, TDB_DATA *key)
+		enum node_access_type type, const char **db_name)
 {
 	struct accessed_node *i = NULL;
 	struct transaction *trans;
@@ -243,8 +243,8 @@ int access_node(struct connection *conn, struct node *node,
 
 	if (!conn || !conn->transaction) {
 		/* They're changing the global database. */
-		if (key)
-			set_tdb_key(node->name, key);
+		if (db_name)
+			*db_name = node->name;
 		return 0;
 	}
 
@@ -308,8 +308,8 @@ int access_node(struct connection *conn, struct node *node,
 		/* Nothing to delete. */
 		return -1;
 
-	if (key) {
-		set_tdb_key(i->trans_name, key);
+	if (db_name) {
+		*db_name = i->trans_name;
 		if (type == NODE_ACCESS_WRITE)
 			i->ta_node = true;
 		if (type == NODE_ACCESS_DELETE)
diff --git a/tools/xenstore/xenstored_transaction.h b/tools/xenstore/xenstored_transaction.h
index 883145163f..f6a2e2f7f5 100644
--- a/tools/xenstore/xenstored_transaction.h
+++ b/tools/xenstore/xenstored_transaction.h
@@ -41,7 +41,7 @@ void ta_node_created(struct transaction *trans);
 
 /* This node was accessed. */
 int __must_check access_node(struct connection *conn, struct node *node,
-                             enum node_access_type type, TDB_DATA *key);
+                             enum node_access_type type, const char **db_name);
 
 /* Queue watches for a modified node. */
 void queue_watches(struct connection *conn, const char *name, bool watch_exact);
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:00:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:00:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560948.877141 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIksT-0004SZ-4Q; Mon, 10 Jul 2023 07:00:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560948.877141; Mon, 10 Jul 2023 07:00:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIksT-0004SM-15; Mon, 10 Jul 2023 07:00:09 +0000
Received: by outflank-mailman (input) for mailman id 560948;
 Mon, 10 Jul 2023 07:00:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIksS-0002xd-CK
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:00:08 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 676f134e-1eef-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 09:00:07 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 904E921E97;
 Mon, 10 Jul 2023 07:00:07 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 537C71361C;
 Mon, 10 Jul 2023 07:00:07 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id Afj2Enesq2StYgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 07:00:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 676f134e-1eef-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972407; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=OZ3QkIbfe9/RFlUdF2rbK/pn4dQLdQYEQ838CQ5c7JM=;
	b=jpqktDvbyx541fU5KQztWpDkZnrOt8ulOrNzkJjycn8dGFTtVOEoIXGoP/IjzJ3/RLznTj
	eqrOeGhP/o4nhBF0CSYSA86iJbOoX4Dp+jyCENU8V1RwRKcTKfSage9dE5BCNP2guHZrrl
	nIvA/wbfBnfNZDm/MxsRIWCtlIeDewA=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [PATCH v2 03/18] tools/xenstore: let transaction_prepend() return the name for access
Date: Mon, 10 Jul 2023 08:59:32 +0200
Message-Id: <20230710065947.4201-4-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230710065947.4201-1-jgross@suse.com>
References: <20230710065947.4201-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Instead of setting the TDB key for accessing the node in the data base,
let transaction_prepend() return the associated name instead.

This is in preparation to replace TDB with a more simple data storage.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 tools/xenstore/xenstored_core.c        |  4 +++-
 tools/xenstore/xenstored_transaction.c | 11 ++++-------
 tools/xenstore/xenstored_transaction.h |  3 +--
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 521ce1a70e..6d7f002b54 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -695,6 +695,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	TDB_DATA key, data;
 	struct xs_tdb_record_hdr *hdr;
 	struct node *node;
+	const char *db_name;
 	int err;
 
 	node = talloc(ctx, struct node);
@@ -709,7 +710,8 @@ struct node *read_node(struct connection *conn, const void *ctx,
 		return NULL;
 	}
 
-	transaction_prepend(conn, name, &key);
+	db_name = transaction_prepend(conn, name);
+	set_tdb_key(db_name, &key);
 
 	data = tdb_fetch(tdb_ctx, key);
 
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 9dab0cd165..1646c07040 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -196,20 +196,17 @@ static char *transaction_get_node_name(void *ctx, struct transaction *trans,
  * Prepend the transaction to name if node has been modified in the current
  * transaction.
  */
-void transaction_prepend(struct connection *conn, const char *name,
-			 TDB_DATA *key)
+const char *transaction_prepend(struct connection *conn, const char *name)
 {
 	struct accessed_node *i;
 
 	if (conn && conn->transaction) {
 		i = find_accessed_node(conn->transaction, name);
-		if (i) {
-			set_tdb_key(i->trans_name, key);
-			return;
-		}
+		if (i)
+			return i->trans_name;
 	}
 
-	set_tdb_key(name, key);
+	return name;
 }
 
 /*
diff --git a/tools/xenstore/xenstored_transaction.h b/tools/xenstore/xenstored_transaction.h
index f6a2e2f7f5..b196b1ab07 100644
--- a/tools/xenstore/xenstored_transaction.h
+++ b/tools/xenstore/xenstored_transaction.h
@@ -47,8 +47,7 @@ int __must_check access_node(struct connection *conn, struct node *node,
 void queue_watches(struct connection *conn, const char *name, bool watch_exact);
 
 /* Prepend the transaction to name if appropriate. */
-void transaction_prepend(struct connection *conn, const char *name,
-                         TDB_DATA *key);
+const char *transaction_prepend(struct connection *conn, const char *name);
 
 /* Mark the transaction as failed. This will prevent it to be committed. */
 void fail_transaction(struct transaction *trans);
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:00:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:00:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560949.877150 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIksZ-0004vD-Bj; Mon, 10 Jul 2023 07:00:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560949.877150; Mon, 10 Jul 2023 07:00:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIksZ-0004v4-8s; Mon, 10 Jul 2023 07:00:15 +0000
Received: by outflank-mailman (input) for mailman id 560949;
 Mon, 10 Jul 2023 07:00:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIksY-0002xd-1Z
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:00:14 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6ac82313-1eef-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 09:00:13 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 3471E1F88C;
 Mon, 10 Jul 2023 07:00:13 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0550B1361C;
 Mon, 10 Jul 2023 07:00:12 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id nq9lO3ysq2S+YgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 07:00:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6ac82313-1eef-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972413; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=xsZdRFZMlmJYeC+b7NSvfoHA0euYyIWBUyMoe8hvlNs=;
	b=ZQSfrQxPzu/T/Z7GKVK63Kdow34xvGdxXu8rbjOxQmAocIztptxeCAc2QV34vMBkiEuw8N
	qucIICs3OqcVA8HzhfMxxwPC92ehoi1cZzQvexj3QUtw0UTYMY5HvRiveVvaxxzT79fdF5
	yo2T2qusOoucVUJvRfqwVN+hXNp6Xuo=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 04/18] tools/xenstore: rename do_tdb_delete() and change parameter type
Date: Mon, 10 Jul 2023 08:59:33 +0200
Message-Id: <20230710065947.4201-5-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230710065947.4201-1-jgross@suse.com>
References: <20230710065947.4201-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rename do_tdb_delete() to db_delete() and replace the key parameter
with db_name specifying the name of the node in the data base.

This is in preparation to replace TDB with a more simple data storage.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- remove unrelated change (Julien Grall)
---
 tools/xenstore/xenstored_core.c        | 31 ++++++++++++--------------
 tools/xenstore/xenstored_core.h        |  5 +++--
 tools/xenstore/xenstored_transaction.c | 16 +++++--------
 3 files changed, 23 insertions(+), 29 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 6d7f002b54..5e83c412ad 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -658,28 +658,31 @@ int do_tdb_write(struct connection *conn, TDB_DATA *key, TDB_DATA *data,
 	return 0;
 }
 
-int do_tdb_delete(struct connection *conn, TDB_DATA *key,
-		  struct node_account_data *acc)
+int db_delete(struct connection *conn, const char *name,
+	      struct node_account_data *acc)
 {
 	struct node_account_data tmp_acc;
 	unsigned int domid;
+	TDB_DATA key;
+
+	set_tdb_key(name, &key);
 
 	if (!acc) {
 		acc = &tmp_acc;
 		acc->memory = -1;
 	}
 
-	get_acc_data(key, acc);
+	get_acc_data(&key, acc);
 
-	if (tdb_delete(tdb_ctx, *key)) {
+	if (tdb_delete(tdb_ctx, key)) {
 		errno = EIO;
 		return errno;
 	}
-	trace_tdb("delete %s\n", key->dptr);
+	trace_tdb("delete %s\n", name);
 
 	if (acc->memory) {
-		domid = get_acc_domid(conn, key, acc->domid);
-		domain_memory_add_nochk(conn, domid, -acc->memory - key->dsize);
+		domid = get_acc_domid(conn, &key, acc->domid);
+		domain_memory_add_nochk(conn, domid, -acc->memory - key.dsize);
 	}
 
 	return 0;
@@ -1450,13 +1453,10 @@ nomem:
 
 static void destroy_node_rm(struct connection *conn, struct node *node)
 {
-	TDB_DATA key;
-
 	if (streq(node->name, "/"))
 		corrupt(NULL, "Destroying root node!");
 
-	set_tdb_key(node->db_name, &key);
-	do_tdb_delete(conn, &key, &node->acc);
+	db_delete(conn, node->db_name, &node->acc);
 }
 
 static int destroy_node(struct connection *conn, struct node *node)
@@ -1647,7 +1647,6 @@ static int delnode_sub(const void *ctx, struct connection *conn,
 	bool watch_exact;
 	int ret;
 	const char *db_name;
-	TDB_DATA key;
 
 	/* Any error here will probably be repeated for all following calls. */
 	ret = access_node(conn, node, NODE_ACCESS_DELETE, &db_name);
@@ -1658,8 +1657,7 @@ static int delnode_sub(const void *ctx, struct connection *conn,
 		return WALK_TREE_ERROR_STOP;
 
 	/* In case of error stop the walk. */
-	set_tdb_key(db_name, &key);
-	if (!ret && do_tdb_delete(conn, &key, &node->acc))
+	if (!ret && db_delete(conn, db_name, &node->acc))
 		return WALK_TREE_ERROR_STOP;
 
 	/*
@@ -2484,9 +2482,8 @@ static int clean_store_(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA val,
 	}
 	if (!hashtable_search(reachable, name)) {
 		log("clean_store: '%s' is orphaned!", name);
-		if (recovery) {
-			do_tdb_delete(NULL, &key, NULL);
-		}
+		if (recovery)
+			db_delete(NULL, name, NULL);
 	}
 
 	talloc_free(name);
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 2cfc01f200..7bc1f68532 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -361,12 +361,13 @@ extern xengnttab_handle **xgt_handle;
 
 int remember_string(struct hashtable *hash, const char *str);
 
+/* Data base access functions. */
 void set_tdb_key(const char *name, TDB_DATA *key);
 int do_tdb_write(struct connection *conn, TDB_DATA *key, TDB_DATA *data,
 		 struct node_account_data *acc, enum write_node_mode mode,
 		 bool no_quota_check);
-int do_tdb_delete(struct connection *conn, TDB_DATA *key,
-		  struct node_account_data *acc);
+int db_delete(struct connection *conn, const char *name,
+	      struct node_account_data *acc);
 
 void conn_free_buffered_data(struct connection *conn);
 
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 1646c07040..a4f9d40e9a 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -385,8 +385,7 @@ static int finalize_transaction(struct connection *conn,
 		/* Entries for unmodified nodes can be removed early. */
 		if (!i->modified) {
 			if (i->ta_node) {
-				set_tdb_key(i->trans_name, &ta_key);
-				if (do_tdb_delete(conn, &ta_key, NULL))
+				if (db_delete(conn, i->trans_name, NULL))
 					return EIO;
 			}
 			list_del(&i->list);
@@ -395,7 +394,6 @@ static int finalize_transaction(struct connection *conn,
 	}
 
 	while ((i = list_top(&trans->accessed, struct accessed_node, list))) {
-		set_tdb_key(i->node, &key);
 		if (i->ta_node) {
 			set_tdb_key(i->trans_name, &ta_key);
 			data = tdb_fetch(tdb_ctx, ta_key);
@@ -406,10 +404,11 @@ static int finalize_transaction(struct connection *conn,
 				hdr->generation = ++generation;
 				flag = (i->generation == NO_GENERATION)
 				       ? NODE_CREATE : NODE_MODIFY;
+				set_tdb_key(i->node, &key);
 				*is_corrupt |= do_tdb_write(conn, &key, &data,
 							    NULL, flag, true);
 				talloc_free(data.dptr);
-				if (do_tdb_delete(conn, &ta_key, NULL))
+				if (db_delete(conn, i->trans_name, NULL))
 					*is_corrupt = true;
 			} else {
 				*is_corrupt = true;
@@ -422,7 +421,7 @@ static int finalize_transaction(struct connection *conn,
 			 */
 			*is_corrupt |= (i->generation == NO_GENERATION)
 				       ? false
-				       : do_tdb_delete(conn, &key, NULL);
+				       : db_delete(conn, i->node, NULL);
 		}
 		if (i->fire_watch)
 			fire_watches(conn, trans, i->node, NULL, i->watch_exact,
@@ -439,15 +438,12 @@ static int destroy_transaction(void *_transaction)
 {
 	struct transaction *trans = _transaction;
 	struct accessed_node *i;
-	TDB_DATA key;
 
 	wrl_ntransactions--;
 	trace_destroy(trans, "transaction");
 	while ((i = list_top(&trans->accessed, struct accessed_node, list))) {
-		if (i->ta_node) {
-			set_tdb_key(i->trans_name, &key);
-			do_tdb_delete(trans->conn, &key, NULL);
-		}
+		if (i->ta_node)
+			db_delete(trans->conn, i->trans_name, NULL);
 		list_del(&i->list);
 		talloc_free(i);
 	}
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:00:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:00:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560953.877161 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIksg-0005Xp-Ow; Mon, 10 Jul 2023 07:00:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560953.877161; Mon, 10 Jul 2023 07:00:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIksg-0005XU-LE; Mon, 10 Jul 2023 07:00:22 +0000
Received: by outflank-mailman (input) for mailman id 560953;
 Mon, 10 Jul 2023 07:00:20 +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 <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIkse-0002bQ-SY
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:00:20 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6e2136f2-1eef-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 09:00:19 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id C53431F88C;
 Mon, 10 Jul 2023 07:00:18 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 950D01361C;
 Mon, 10 Jul 2023 07:00:18 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id JnAbI4Ksq2TMYgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 07:00:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6e2136f2-1eef-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972418; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=oOCZz1yrYGWpW3fZFR3xBPsNc3NZAwTDmSc4zNEaUAQ=;
	b=e51PHjHle8yZ5gWMJUyng+zpG3SfaeLnvBX+EJ48AxLwpeO7NkHrM8sxoehieikpmLmI9d
	VgbdOrO8eKgrrzcPjEqtHmk2HE6fXI+dPj5QivZ/+Ycf5muS5obG7tuiwknZ5I6QUZw4BB
	i+ORwBahg+5D/YgYvSb6TUjM54ri20A=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 05/18] tools/xenstore: rename do_tdb_write() and change parameter type
Date: Mon, 10 Jul 2023 08:59:34 +0200
Message-Id: <20230710065947.4201-6-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230710065947.4201-1-jgross@suse.com>
References: <20230710065947.4201-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rename do_tdb_write() to db_write() and replace the key parameter with
db_name specifying the name of the node in the data base, and the data
parameter with a data pointer and a length.

Do the same key parameter type change for write_node_raw(), too.

This is in preparation to replace TDB with a more simple data storage.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- keep ta_key in finalize_transaction() (Julien Grall)
---
 tools/xenstore/xenstored_core.c        | 70 +++++++++++++-------------
 tools/xenstore/xenstored_core.h        | 11 ++--
 tools/xenstore/xenstored_domain.c      |  4 +-
 tools/xenstore/xenstored_transaction.c | 10 ++--
 4 files changed, 46 insertions(+), 49 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 5e83c412ad..9bcff43e21 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -600,23 +600,27 @@ static unsigned int get_acc_domid(struct connection *conn, TDB_DATA *key,
 	       ? domid : conn->id;
 }
 
-int do_tdb_write(struct connection *conn, TDB_DATA *key, TDB_DATA *data,
-		 struct node_account_data *acc, enum write_node_mode mode,
-		 bool no_quota_check)
+int db_write(struct connection *conn, const char *db_name, void *data,
+	     size_t size, struct node_account_data *acc,
+	     enum write_node_mode mode, bool no_quota_check)
 {
-	struct xs_tdb_record_hdr *hdr = (void *)data->dptr;
+	struct xs_tdb_record_hdr *hdr = data;
 	struct node_account_data old_acc = {};
 	unsigned int old_domid, new_domid;
 	int ret;
+	TDB_DATA key, dat;
 
+	set_tdb_key(db_name, &key);
+	dat.dptr = data;
+	dat.dsize = size;
 	if (!acc)
 		old_acc.memory = -1;
 	else
 		old_acc = *acc;
 
-	get_acc_data(key, &old_acc);
-	old_domid = get_acc_domid(conn, key, old_acc.domid);
-	new_domid = get_acc_domid(conn, key, hdr->perms[0].id);
+	get_acc_data(&key, &old_acc);
+	old_domid = get_acc_domid(conn, &key, old_acc.domid);
+	new_domid = get_acc_domid(conn, &key, hdr->perms[0].id);
 
 	/*
 	 * Don't check for ENOENT, as we want to be able to switch orphaned
@@ -624,35 +628,34 @@ int do_tdb_write(struct connection *conn, TDB_DATA *key, TDB_DATA *data,
 	 */
 	if (old_acc.memory)
 		domain_memory_add_nochk(conn, old_domid,
-					-old_acc.memory - key->dsize);
-	ret = domain_memory_add(conn, new_domid,
-				data->dsize + key->dsize, no_quota_check);
+					-old_acc.memory - key.dsize);
+	ret = domain_memory_add(conn, new_domid, size + key.dsize,
+				no_quota_check);
 	if (ret) {
 		/* Error path, so no quota check. */
 		if (old_acc.memory)
 			domain_memory_add_nochk(conn, old_domid,
-						old_acc.memory + key->dsize);
+						old_acc.memory + key.dsize);
 		return ret;
 	}
 
 	/* TDB should set errno, but doesn't even set ecode AFAICT. */
-	if (tdb_store(tdb_ctx, *key, *data,
+	if (tdb_store(tdb_ctx, key, dat,
 		      (mode == NODE_CREATE) ? TDB_INSERT : TDB_MODIFY) != 0) {
-		domain_memory_add_nochk(conn, new_domid,
-					-data->dsize - key->dsize);
+		domain_memory_add_nochk(conn, new_domid, -size - key.dsize);
 		/* Error path, so no quota check. */
 		if (old_acc.memory)
 			domain_memory_add_nochk(conn, old_domid,
-						old_acc.memory + key->dsize);
+						old_acc.memory + key.dsize);
 		errno = EIO;
 		return errno;
 	}
-	trace_tdb("store %s size %zu\n", key->dptr, data->dsize + key->dsize);
+	trace_tdb("store %s size %zu\n", db_name, size + key.dsize);
 
 	if (acc) {
 		/* Don't use new_domid, as it might be a transaction node. */
 		acc->domid = hdr->perms[0].id;
-		acc->memory = data->dsize;
+		acc->memory = size;
 	}
 
 	return 0;
@@ -780,33 +783,35 @@ static bool read_node_can_propagate_errno(void)
 	return errno == ENOMEM || errno == ENOSPC;
 }
 
-int write_node_raw(struct connection *conn, TDB_DATA *key, struct node *node,
-		   enum write_node_mode mode, bool no_quota_check)
+int write_node_raw(struct connection *conn, const char *db_name,
+		   struct node *node, enum write_node_mode mode,
+		   bool no_quota_check)
 {
-	TDB_DATA data;
+	void *data;
+	size_t size;
 	void *p;
 	struct xs_tdb_record_hdr *hdr;
 
 	if (domain_adjust_node_perms(node))
 		return errno;
 
-	data.dsize = sizeof(*hdr)
+	size = sizeof(*hdr)
 		+ node->perms.num * sizeof(node->perms.p[0])
 		+ node->datalen + node->childlen;
 
 	/* Call domain_max_chk() in any case in order to record max values. */
-	if (domain_max_chk(conn, ACC_NODESZ, data.dsize) && !no_quota_check) {
+	if (domain_max_chk(conn, ACC_NODESZ, size) && !no_quota_check) {
 		errno = ENOSPC;
 		return errno;
 	}
 
-	data.dptr = talloc_size(node, data.dsize);
-	if (!data.dptr) {
+	data = talloc_size(node, size);
+	if (!data) {
 		errno = ENOMEM;
 		return errno;
 	}
 
-	hdr = (void *)data.dptr;
+	hdr = data;
 	hdr->generation = node->generation;
 	hdr->num_perms = node->perms.num;
 	hdr->datalen = node->datalen;
@@ -819,7 +824,8 @@ int write_node_raw(struct connection *conn, TDB_DATA *key, struct node *node,
 	p += node->datalen;
 	memcpy(p, node->children, node->childlen);
 
-	if (do_tdb_write(conn, key, &data, &node->acc, mode, no_quota_check))
+	if (db_write(conn, db_name, data, size, &node->acc, mode,
+		     no_quota_check))
 		return EIO;
 
 	return 0;
@@ -833,13 +839,11 @@ static int write_node(struct connection *conn, struct node *node,
 		      enum write_node_mode mode, bool no_quota_check)
 {
 	int ret;
-	TDB_DATA key;
 
 	if (access_node(conn, node, NODE_ACCESS_WRITE, &node->db_name))
 		return errno;
 
-	set_tdb_key(node->db_name, &key);
-	ret = write_node_raw(conn, &key, node, mode, no_quota_check);
+	ret = write_node_raw(conn, node->db_name, node, mode, no_quota_check);
 	if (ret && conn && conn->transaction) {
 		/*
 		 * Reverting access_node() is hard, so just fail the
@@ -3424,7 +3428,6 @@ void read_state_node(const void *ctx, const void *state)
 {
 	const struct xs_state_node *sn = state;
 	struct node *node, *parent;
-	TDB_DATA key;
 	char *name, *parentname;
 	unsigned int i;
 	struct connection conn = { .id = priv_domid };
@@ -3477,15 +3480,12 @@ void read_state_node(const void *ctx, const void *state)
 		if (add_child(node, parent, name))
 			barf("allocation error restoring node");
 
-		set_tdb_key(parentname, &key);
-		if (write_node_raw(NULL, &key, parent, NODE_MODIFY, true))
+		if (write_node_raw(NULL, parentname, parent, NODE_MODIFY, true))
 			barf("write parent error restoring node");
 	}
 
-	set_tdb_key(name, &key);
-
 	/* The "/" node is already existing, so it can only be modified here. */
-	if (write_node_raw(NULL, &key, node,
+	if (write_node_raw(NULL, name, node,
 			   strcmp(name, "/") ? NODE_CREATE : NODE_MODIFY, true))
 		barf("write node error restoring node");
 
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 7bc1f68532..3074f14511 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -242,8 +242,9 @@ enum write_node_mode {
 	NODE_MODIFY
 };
 
-int write_node_raw(struct connection *conn, TDB_DATA *key, struct node *node,
-		   enum write_node_mode mode, bool no_quota_check);
+int write_node_raw(struct connection *conn, const char *db_name,
+		   struct node *node, enum write_node_mode mode,
+		   bool no_quota_check);
 
 /* Get a node from the tdb data base. */
 struct node *read_node(struct connection *conn, const void *ctx,
@@ -363,9 +364,9 @@ int remember_string(struct hashtable *hash, const char *str);
 
 /* Data base access functions. */
 void set_tdb_key(const char *name, TDB_DATA *key);
-int do_tdb_write(struct connection *conn, TDB_DATA *key, TDB_DATA *data,
-		 struct node_account_data *acc, enum write_node_mode mode,
-		 bool no_quota_check);
+int db_write(struct connection *conn, const char *db_name, void *data,
+	     size_t size, struct node_account_data *acc,
+	     enum write_node_mode mode, bool no_quota_check);
 int db_delete(struct connection *conn, const char *name,
 	      struct node_account_data *acc);
 
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index ac0e109654..d8810fa353 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -511,19 +511,17 @@ static int domain_tree_remove_sub(const void *ctx, struct connection *conn,
 				  struct node *node, void *arg)
 {
 	struct domain *domain = arg;
-	TDB_DATA key;
 	int ret = WALK_TREE_OK;
 
 	if (node->perms.p[0].id != domain->domid)
 		return WALK_TREE_OK;
 
 	if (keep_orphans) {
-		set_tdb_key(node->name, &key);
 		domain_nbentry_dec(NULL, domain->domid);
 		node->perms.p[0].id = priv_domid;
 		node->acc.memory = 0;
 		domain_nbentry_inc(NULL, priv_domid);
-		if (write_node_raw(NULL, &key, node, NODE_MODIFY, true)) {
+		if (write_node_raw(NULL, node->name, node, NODE_MODIFY, true)) {
 			/* That's unfortunate. We only can try to continue. */
 			syslog(LOG_ERR,
 			       "error when moving orphaned node %s to dom0\n",
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index a4f9d40e9a..6e06634807 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -228,7 +228,6 @@ int access_node(struct connection *conn, struct node *node,
 {
 	struct accessed_node *i = NULL;
 	struct transaction *trans;
-	TDB_DATA local_key;
 	int ret;
 	bool introduce = false;
 
@@ -286,8 +285,7 @@ int access_node(struct connection *conn, struct node *node,
 			i->generation = node->generation;
 			i->check_gen = true;
 			if (node->generation != NO_GENERATION) {
-				set_tdb_key(i->trans_name, &local_key);
-				ret = write_node_raw(conn, &local_key, node,
+				ret = write_node_raw(conn, i->trans_name, node,
 						     NODE_CREATE, true);
 				if (ret)
 					goto err;
@@ -404,9 +402,9 @@ static int finalize_transaction(struct connection *conn,
 				hdr->generation = ++generation;
 				flag = (i->generation == NO_GENERATION)
 				       ? NODE_CREATE : NODE_MODIFY;
-				set_tdb_key(i->node, &key);
-				*is_corrupt |= do_tdb_write(conn, &key, &data,
-							    NULL, flag, true);
+				*is_corrupt |= db_write(conn, i->node,
+							data.dptr, data.dsize,
+							NULL, flag, true);
 				talloc_free(data.dptr);
 				if (db_delete(conn, i->trans_name, NULL))
 					*is_corrupt = true;
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:00:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:00:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560958.877171 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIksk-0005yu-Vg; Mon, 10 Jul 2023 07:00:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560958.877171; Mon, 10 Jul 2023 07:00:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIksk-0005yh-Sc; Mon, 10 Jul 2023 07:00:26 +0000
Received: by outflank-mailman (input) for mailman id 560958;
 Mon, 10 Jul 2023 07:00:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIksj-0002xd-Uu
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:00:25 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 717eb1f8-1eef-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 09:00:24 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 747381F747;
 Mon, 10 Jul 2023 07:00:24 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3BC6D1361C;
 Mon, 10 Jul 2023 07:00:24 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 2sUrDYisq2TdYgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 07:00:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 717eb1f8-1eef-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972424; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=EzvJEgIn/rZaTJd+/fCRGx2LuqccSDVwxNp6blv09EQ=;
	b=p2ykWYe6hEf9TmuI1G2oXvEdrA7uNc8uVO1XMXXjWbuLNvdDTcOWoU5ipYscRN2LRiAK+v
	6vu3n557Odvyk6M9ZVXfrYsCdj7Sxhqh03wFAohGrE5JneZx7xmvbKbayzNxMvMhXSplgN
	8c0U45JwzDdbKHh/lvrQKcljDxb+zO4=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [PATCH v2 06/18] tools/xenstore: switch get_acc_data() to use name instead of key
Date: Mon, 10 Jul 2023 08:59:35 +0200
Message-Id: <20230710065947.4201-7-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230710065947.4201-1-jgross@suse.com>
References: <20230710065947.4201-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Eliminate further TDB_DATA usage by switching get_acc_data() and
get_acc_domid() from a TDB key to the name of the node in the data base
as a parameter.

This is in preparation to replace TDB with a more simple data storage.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 tools/xenstore/xenstored_core.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 9bcff43e21..170181d8e6 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -566,19 +566,20 @@ void set_tdb_key(const char *name, TDB_DATA *key)
 	key->dsize = strlen(name);
 }
 
-static void get_acc_data(TDB_DATA *key, struct node_account_data *acc)
+static void get_acc_data(const char *name, struct node_account_data *acc)
 {
-	TDB_DATA old_data;
+	TDB_DATA key, old_data;
 	struct xs_tdb_record_hdr *hdr;
 
 	if (acc->memory < 0) {
-		old_data = tdb_fetch(tdb_ctx, *key);
+		set_tdb_key(name, &key);
+		old_data = tdb_fetch(tdb_ctx, key);
 		/* No check for error, as the node might not exist. */
 		if (old_data.dptr == NULL) {
 			acc->memory = 0;
 		} else {
-			trace_tdb("read %s size %zu\n", key->dptr,
-				  old_data.dsize + key->dsize);
+			trace_tdb("read %s size %zu\n", name,
+				  old_data.dsize + key.dsize);
 			hdr = (void *)old_data.dptr;
 			acc->memory = old_data.dsize;
 			acc->domid = hdr->perms[0].id;
@@ -593,11 +594,10 @@ static void get_acc_data(TDB_DATA *key, struct node_account_data *acc)
  * count prepended (e.g. 123/local/domain/...). So testing for the node's
  * key not to start with "/" or "@" is sufficient.
  */
-static unsigned int get_acc_domid(struct connection *conn, TDB_DATA *key,
+static unsigned int get_acc_domid(struct connection *conn, const char *name,
 				  unsigned int domid)
 {
-	return (!conn || key->dptr[0] == '/' || key->dptr[0] == '@')
-	       ? domid : conn->id;
+	return (!conn || name[0] == '/' || name[0] == '@') ? domid : conn->id;
 }
 
 int db_write(struct connection *conn, const char *db_name, void *data,
@@ -618,9 +618,9 @@ int db_write(struct connection *conn, const char *db_name, void *data,
 	else
 		old_acc = *acc;
 
-	get_acc_data(&key, &old_acc);
-	old_domid = get_acc_domid(conn, &key, old_acc.domid);
-	new_domid = get_acc_domid(conn, &key, hdr->perms[0].id);
+	get_acc_data(db_name, &old_acc);
+	old_domid = get_acc_domid(conn, db_name, old_acc.domid);
+	new_domid = get_acc_domid(conn, db_name, hdr->perms[0].id);
 
 	/*
 	 * Don't check for ENOENT, as we want to be able to switch orphaned
@@ -675,7 +675,7 @@ int db_delete(struct connection *conn, const char *name,
 		acc->memory = -1;
 	}
 
-	get_acc_data(&key, acc);
+	get_acc_data(name, acc);
 
 	if (tdb_delete(tdb_ctx, key)) {
 		errno = EIO;
@@ -684,7 +684,7 @@ int db_delete(struct connection *conn, const char *name,
 	trace_tdb("delete %s\n", name);
 
 	if (acc->memory) {
-		domid = get_acc_domid(conn, &key, acc->domid);
+		domid = get_acc_domid(conn, name, acc->domid);
 		domain_memory_add_nochk(conn, domid, -acc->memory - key.dsize);
 	}
 
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:00:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:00:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560962.877181 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIksr-0006bj-7J; Mon, 10 Jul 2023 07:00:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560962.877181; Mon, 10 Jul 2023 07:00:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIksr-0006bX-3q; Mon, 10 Jul 2023 07:00:33 +0000
Received: by outflank-mailman (input) for mailman id 560962;
 Mon, 10 Jul 2023 07:00:32 +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 <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIksq-0002bQ-3L
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:00:32 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 74d63d78-1eef-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 09:00:30 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 104881F747;
 Mon, 10 Jul 2023 07:00:30 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D6DDE1361C;
 Mon, 10 Jul 2023 07:00:29 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id zMM6M42sq2TnYgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 07:00:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 74d63d78-1eef-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972430; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=0jDDQbH7ZP8QG4hsBPScQ20jL+mh1ooDHQWIzAcF2AQ=;
	b=OOfQkWaCgOPCZkzImRXiB+7rsMJucSnNcQJPs6F1i0bhau/JiSA0vaa03Z1j32p3p9bcpg
	v0ZOX5/Da6UNXd8rrdmfrn6Jo0T4fD1J4TIJB0RFYXuPOpW7MDBN0IY2ICjkDaKv+9XaTd
	ZsGuxuci8ts52ogiwEhf+u6Ib050zZw=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 07/18] tools/xenstore: add wrapper for tdb_fetch()
Date: Mon, 10 Jul 2023 08:59:36 +0200
Message-Id: <20230710065947.4201-8-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230710065947.4201-1-jgross@suse.com>
References: <20230710065947.4201-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add a wrapper function for tdb_fetch taking the name of the node in
the data base as a parameter. Let it return a data pointer and the
length of the data via a length pointer provided as additional
parameter.

Move logging of the TDB access from the callers into the wrapper.

This enables to make set_tdb_key() and tdb_ctx static.

This is in preparation to replace TDB with a more simple data storage.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- always set *size in db_fetch() (Julien Grall)
- change db_fetch() return type (Julien Grall)
- move logging
---
 tools/xenstore/xenstored_core.c        | 55 +++++++++++++++-----------
 tools/xenstore/xenstored_core.h        |  3 +-
 tools/xenstore/xenstored_transaction.c | 31 ++++++---------
 3 files changed, 44 insertions(+), 45 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 170181d8e6..70db5265ad 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -85,7 +85,7 @@ bool keep_orphans = false;
 static int reopen_log_pipe[2];
 static int reopen_log_pipe0_pollfd_idx = -1;
 char *tracefile = NULL;
-TDB_CONTEXT *tdb_ctx = NULL;
+static TDB_CONTEXT *tdb_ctx = NULL;
 unsigned int trace_flags = TRACE_OBJ | TRACE_IO;
 
 static const char *sockmsg_string(enum xsd_sockmsg_type type);
@@ -556,7 +556,7 @@ static void initialize_fds(int *p_sock_pollfd_idx, int *ptimeout)
 	}
 }
 
-void set_tdb_key(const char *name, TDB_DATA *key)
+static void set_tdb_key(const char *name, TDB_DATA *key)
 {
 	/*
 	 * Dropping const is fine here, as the key will never be modified
@@ -566,25 +566,39 @@ void set_tdb_key(const char *name, TDB_DATA *key)
 	key->dsize = strlen(name);
 }
 
+struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
+{
+	TDB_DATA key, data;
+
+	set_tdb_key(db_name, &key);
+	data = tdb_fetch(tdb_ctx, key);
+	if (!data.dptr) {
+		errno = (tdb_error(tdb_ctx) == TDB_ERR_NOEXIST) ? ENOENT : EIO;
+		*size = 0;
+	} else {
+		*size = data.dsize;
+		trace_tdb("read %s size %zu\n", db_name,
+			  *size + strlen(db_name));
+	}
+
+	return (struct xs_tdb_record_hdr *)data.dptr;
+}
+
 static void get_acc_data(const char *name, struct node_account_data *acc)
 {
-	TDB_DATA key, old_data;
+	size_t size;
 	struct xs_tdb_record_hdr *hdr;
 
 	if (acc->memory < 0) {
-		set_tdb_key(name, &key);
-		old_data = tdb_fetch(tdb_ctx, key);
+		hdr = db_fetch(name, &size);
 		/* No check for error, as the node might not exist. */
-		if (old_data.dptr == NULL) {
+		if (hdr == NULL) {
 			acc->memory = 0;
 		} else {
-			trace_tdb("read %s size %zu\n", name,
-				  old_data.dsize + key.dsize);
-			hdr = (void *)old_data.dptr;
-			acc->memory = old_data.dsize;
+			acc->memory = size;
 			acc->domid = hdr->perms[0].id;
 		}
-		talloc_free(old_data.dptr);
+		talloc_free(hdr);
 	}
 }
 
@@ -698,7 +712,7 @@ int db_delete(struct connection *conn, const char *name,
 struct node *read_node(struct connection *conn, const void *ctx,
 		       const char *name)
 {
-	TDB_DATA key, data;
+	size_t size;
 	struct xs_tdb_record_hdr *hdr;
 	struct node *node;
 	const char *db_name;
@@ -717,29 +731,24 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	}
 
 	db_name = transaction_prepend(conn, name);
-	set_tdb_key(db_name, &key);
+	hdr = db_fetch(db_name, &size);
 
-	data = tdb_fetch(tdb_ctx, key);
-
-	if (data.dptr == NULL) {
-		if (tdb_error(tdb_ctx) == TDB_ERR_NOEXIST) {
+	if (hdr == NULL) {
+		if (errno == ENOENT) {
 			node->generation = NO_GENERATION;
 			err = access_node(conn, node, NODE_ACCESS_READ, NULL);
 			errno = err ? : ENOENT;
 		} else {
-			log("TDB error on read: %s", tdb_errorstr(tdb_ctx));
+			log("DB error on read: %s", strerror(errno));
 			errno = EIO;
 		}
 		goto error;
 	}
 
-	trace_tdb("read %s size %zu\n", key.dptr, data.dsize + key.dsize);
-
 	node->parent = NULL;
-	talloc_steal(node, data.dptr);
+	talloc_steal(node, hdr);
 
 	/* Datalen, childlen, number of permissions */
-	hdr = (void *)data.dptr;
 	node->generation = hdr->generation;
 	node->perms.num = hdr->num_perms;
 	node->datalen = hdr->datalen;
@@ -748,7 +757,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	/* Permissions are struct xs_permissions. */
 	node->perms.p = hdr->perms;
 	node->acc.domid = get_node_owner(node);
-	node->acc.memory = data.dsize;
+	node->acc.memory = size;
 	if (domain_adjust_node_perms(node))
 		goto error;
 
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 3074f14511..590d1b0a1f 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -314,7 +314,6 @@ do {						\
 		trace("tdb: " __VA_ARGS__);	\
 } while (0)
 
-extern TDB_CONTEXT *tdb_ctx;
 extern int dom0_domid;
 extern int dom0_event;
 extern int priv_domid;
@@ -363,7 +362,7 @@ extern xengnttab_handle **xgt_handle;
 int remember_string(struct hashtable *hash, const char *str);
 
 /* Data base access functions. */
-void set_tdb_key(const char *name, TDB_DATA *key);
+struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size);
 int db_write(struct connection *conn, const char *db_name, void *data,
 	     size_t size, struct node_account_data *acc,
 	     enum write_node_mode mode, bool no_quota_check);
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 6e06634807..7d8c0afc6a 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -356,26 +356,22 @@ static int finalize_transaction(struct connection *conn,
 				struct transaction *trans, bool *is_corrupt)
 {
 	struct accessed_node *i, *n;
-	TDB_DATA key, ta_key, data;
+	size_t size;
 	struct xs_tdb_record_hdr *hdr;
 	uint64_t gen;
 	int flag;
 
 	list_for_each_entry_safe(i, n, &trans->accessed, list) {
 		if (i->check_gen) {
-			set_tdb_key(i->node, &key);
-			data = tdb_fetch(tdb_ctx, key);
-			hdr = (void *)data.dptr;
-			if (!data.dptr) {
-				if (tdb_error(tdb_ctx) != TDB_ERR_NOEXIST)
-					return EIO;
+			hdr = db_fetch(i->node, &size);
+			if (!hdr) {
+				if (errno != ENOENT)
+					return errno;
 				gen = NO_GENERATION;
 			} else {
-				trace_tdb("read %s size %zu\n", key.dptr,
-					  key.dsize + data.dsize);
 				gen = hdr->generation;
 			}
-			talloc_free(data.dptr);
+			talloc_free(hdr);
 			if (i->generation != gen)
 				return EAGAIN;
 		}
@@ -393,19 +389,14 @@ static int finalize_transaction(struct connection *conn,
 
 	while ((i = list_top(&trans->accessed, struct accessed_node, list))) {
 		if (i->ta_node) {
-			set_tdb_key(i->trans_name, &ta_key);
-			data = tdb_fetch(tdb_ctx, ta_key);
-			if (data.dptr) {
-				trace_tdb("read %s size %zu\n", ta_key.dptr,
-					  ta_key.dsize + data.dsize);
-				hdr = (void *)data.dptr;
+			hdr = db_fetch(i->trans_name, &size);
+			if (hdr) {
 				hdr->generation = ++generation;
 				flag = (i->generation == NO_GENERATION)
 				       ? NODE_CREATE : NODE_MODIFY;
-				*is_corrupt |= db_write(conn, i->node,
-							data.dptr, data.dsize,
-							NULL, flag, true);
-				talloc_free(data.dptr);
+				*is_corrupt |= db_write(conn, i->node, hdr,
+							size, NULL, flag, true);
+				talloc_free(hdr);
 				if (db_delete(conn, i->trans_name, NULL))
 					*is_corrupt = true;
 			} else {
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:00:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:00:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560965.877191 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIksv-00072Q-Fc; Mon, 10 Jul 2023 07:00:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560965.877191; Mon, 10 Jul 2023 07:00:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIksv-00072D-Bp; Mon, 10 Jul 2023 07:00:37 +0000
Received: by outflank-mailman (input) for mailman id 560965;
 Mon, 10 Jul 2023 07:00:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIksu-0002xd-DS
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:00:36 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 782b6cab-1eef-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 09:00:35 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id A47761F88C;
 Mon, 10 Jul 2023 07:00:35 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 729FE1361C;
 Mon, 10 Jul 2023 07:00:35 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id hJ2OGpOsq2T3YgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 07:00:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 782b6cab-1eef-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972435; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=uX1UtLDeHIuSncID7ztx+3m5/A25DEYmNmT0JgfiUNQ=;
	b=RG1r3QY6qqWMTTwHNomt9UbriFqZ9RasnX1HCWxp2EaIpb3ej32ug23RE7FJeCSD5KC2ok
	IxeuEL0zn9SlA/F5I/Hgfa2EwftmL3B7yBGU5euAyt+27vTaqbygBdN5ttclA+MXi2sd55
	kr+fA3fvd1Obh7T1f2VVjIqJav1Oeqg=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [PATCH v2 08/18] tools/xenstore: make hashtable key and value parameters const
Date: Mon, 10 Jul 2023 08:59:37 +0200
Message-Id: <20230710065947.4201-9-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230710065947.4201-1-jgross@suse.com>
References: <20230710065947.4201-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The key is never modified by hashtable code, so it should be marked
as const.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 tools/xenstore/hashtable.c | 5 +++--
 tools/xenstore/hashtable.h | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c
index 11f6bf8f15..9daddd9782 100644
--- a/tools/xenstore/hashtable.c
+++ b/tools/xenstore/hashtable.c
@@ -11,7 +11,8 @@
 
 struct entry
 {
-    void *k, *v;
+    const void *k;
+    void *v;
     unsigned int h;
     struct entry *next;
 };
@@ -140,7 +141,7 @@ static int hashtable_expand(struct hashtable *h)
     return 0;
 }
 
-int hashtable_add(struct hashtable *h, void *k, void *v)
+int hashtable_add(struct hashtable *h, const void *k, void *v)
 {
     /* This method allows duplicate keys - but they shouldn't be used */
     unsigned int index;
diff --git a/tools/xenstore/hashtable.h b/tools/xenstore/hashtable.h
index 5a2cc4a4be..792f6cda7b 100644
--- a/tools/xenstore/hashtable.h
+++ b/tools/xenstore/hashtable.h
@@ -48,8 +48,8 @@ create_hashtable(const void *ctx, const char *name,
  * If in doubt, remove before insert.
  */
 
-int 
-hashtable_add(struct hashtable *h, void *k, void *v);
+int
+hashtable_add(struct hashtable *h, const void *k, void *v);
 
 /*****************************************************************************
  * hashtable_search
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:05:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:05:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560974.877201 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIkxA-0000RG-6K; Mon, 10 Jul 2023 07:05:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560974.877201; Mon, 10 Jul 2023 07:05:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIkxA-0000R9-3W; Mon, 10 Jul 2023 07:05:00 +0000
Received: by outflank-mailman (input) for mailman id 560974;
 Mon, 10 Jul 2023 07:04: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 <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qIkx8-0000R3-Nz
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:04:58 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on062c.outbound.protection.outlook.com
 [2a01:111:f400:fe02::62c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 137cfde8-1ef0-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 09:04:56 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM9PR04MB7601.eurprd04.prod.outlook.com (2603:10a6:20b:285::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Mon, 10 Jul
 2023 07:04:53 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 07:04:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 137cfde8-1ef0-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=PofhZU5CJdCtpOFc6tt5FIL7pg45kPxY+tx21NsaVuWS2g6ebRtbDl9mfJGK+27YW2fYwXap95+0Yv+eQvA9p0Q/QomEJXcljsqxItl9PS4jZcmAbQ3Pwb8z2rMCSihmWNxvuBY/pdT5Jd+gFJ8SVABiXZ/16JpjDFy+qX6tocNFtTl9+byLB43ggOAhsqCKEvij1aekzCTc9yGYDHgsOrMfk2M/SsEzFlqKtADxzr00LVsLsWDydXzOnqnQ2Uw002T2JoguT7p/u3fzrqqvm9S9sP0crYUW8Sc6vaZWuELTQQUoLK9T/4pG8uuazpl03JQhJVB0+SikFW8hdXOE8w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ZDs25XemFfOM1SAvRnePHIamijZCHmsmmSpXwXJ78Ms=;
 b=HCE9gPkR5xy7RkNbB1JUnDdHOTygqhHSUWm+oMrRxo+x4sS6mhkuCtaZvtu4yqZ2qnzGsKB4UZSRVHF0NOwRNx/6NBVY6fa01SPkI2Y2Fne1QFrpGaZ1GS945ZaHkz/gybOrOv+LzTmUqUDZTQq3a8aoKDTNF2zm4IFvqkmc9Bk4fM6vqictN3Bc2f6eNNAaSbCsMOpGCdCimzAsiCwRAkMPEs9Fau3gisOxBt5ivV1a+xXpNjdSfd9apIql4qqz+gYrxhqezGCJ+KZSGn1gHF6n5v778PiKiLU0jIB5L7a8U/WGu5/qcqHraiEgr7H9og0pvkIvF/mbfdHCxRn2pw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ZDs25XemFfOM1SAvRnePHIamijZCHmsmmSpXwXJ78Ms=;
 b=pE1n9GtfcgAxvyGp4/xR+K9CAt7oFltC/WtSJiE1bls4lXLya4PNeQyNmDpulXLGQ6PlTbu0JNgM1qYZvxFPsIWzS/OMPGVGuZ87Bk0FO8nAIeB/vGP/MyqbqVT2x6+LQdoK9boEbjgt49IEPGLTmpoGViW0AwaNNqMsMBWmr00g8/McskKyPTfiHnRfBOJgK8iTvoL71ldlLDEAcQVx1ZPq7ga1EPl3SsTvD/iv0ZF8hOo2u2mqhqjTEOMeijbrKjs8xaxJrRO2z8yQ1CGFipy9U0bvKx8U/USgAO8zUaBKcJ6NlaK08jlvN8wPTV9CelgP5T4DOOaM6PVG+tNhmQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <272b20f4-e45d-d0db-2dec-785e15025c64@suse.com>
Date: Mon, 10 Jul 2023 09:04:52 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 1/2] x86/mm: add API for marking only part of a MMIO
 page read only
Content-Language: en-US
To: =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>
Cc: Paul Durrant <paul@xen.org>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.dd82aca339854e90ffe12e7bc4298254a6caaf0d.1683321183.git-series.marmarek@invisiblethingslab.com>
 <def382a6481a9d1bcc106200b971cd5b0f3d19c1.1683321183.git-series.marmarek@invisiblethingslab.com>
 <f3531050-fb31-2d9e-f3dd-2d310dc7c5ec@suse.com> <ZJ9XFdGhxyKLY3fm@mail-itl>
 <3773dc6e-9d36-ba80-2a0a-bb1589c9993f@suse.com> <ZKfwsvFmwEo+gzh9@mail-itl>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZKfwsvFmwEo+gzh9@mail-itl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0181.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9f::17) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM9PR04MB7601:EE_
X-MS-Office365-Filtering-Correlation-Id: 9fc12517-1cf8-4ee3-db1b-08db8113f5b6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	nBzohlw+SA3cHCx4C8JbIqRiGDPckle2ksU/PfeDx7rGRGkKgzCYXcWrqpbT61wCN8hKdHH/OT/+qbvpsbPIJfIaPDvJ7xyaR2+uCFUV0UkWPmGe4RN0EyWZlQr8g6OmXROOu54+9Wt84pg5rzzbYZ3wMH/zHJuw5x8azyTgpD12unNoef9OJp14JoKxDx/maBshd3c3iwFUlb3exM6SZX7dZMy4VOdCvfJUsMguxq4RXcUUcOfo7PLpXZ/osm0JNKGLg2yWrIupL0rD6Wa45Omdcf8xNFTfQmEZ1vvmEfgSYZOUdunEIxLFO76VniG2ZKkiPaUED9U5JbK3jUXCpbm/xM1Tmjzv32uA4/jb3iZYQrR0NXOJGlHBAGXLBisjgjrcw4PbAUcQWgoP384dEkJ0eHjIENa7yri7bqlQa24JSxcEBHJpIjXF8A3pvbhTj0Hepw2ZueXULrkaDiCw4igcUGEN6XMhVotE1KwRmJe2GAC+teZ18J8qUwenN0sAbCuoyPBKdR85zrJyKHvAky20o3hFHYzf0ODNm8CmDJ+2er3JtrIu7VLVb3WvOBs+uuNWjWFgoKELckFq8H2IFR54DY+oedpAARqrBzyIBXgiakwVKX7aiAJAYIJjlXmt+UI6s6Lqqr6W+VY7zlzJOg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(346002)(136003)(39860400002)(396003)(451199021)(53546011)(66574015)(6506007)(186003)(26005)(86362001)(8676002)(8936002)(2616005)(31696002)(31686004)(83380400001)(5660300002)(6512007)(6486002)(41300700001)(66476007)(66556008)(66946007)(2906002)(36756003)(478600001)(54906003)(38100700002)(4326008)(6916009)(316002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aDJKZ2FzZHd4U3IwNnhsbWZxMmhram1zNlBDQU1CRU1iU0FlQUhOVFNGSWNx?=
 =?utf-8?B?S2I1ZTdXbDBNZUc4ZHo5bkl0VEJWeGRIYS9hU1JlSjVOek1vOWZoMHoycS83?=
 =?utf-8?B?UjF2eTJBcHUvM3I3VjYrNllJcnEvZEk2bHk0bVJ2L1ovdlVLK09SMGFwRlc1?=
 =?utf-8?B?MkY2RjB2SE5yc1gxL0o3akxpUGtkZVNpTVQ1Z083T20zMjJ5NnRDWHQ4bTNP?=
 =?utf-8?B?YjVSdklVdUZCbWcvWHZRNkMrUnphc1B6aUNUSlE5Q1p4NWR5VWI0QnFIcEpl?=
 =?utf-8?B?TWxhdVM1bnJON0Vvd0tKdW5PYVFHS1AvVm1ic1BmRURBN0tvckxqOTdCdmZz?=
 =?utf-8?B?QUEzQjhZbS9ZK1hPbC8xY3pmZmpMby9tTWx2NTVVMXpCZ2pLL3R6Mld2cFhL?=
 =?utf-8?B?ZHRNSHFYbEFQcUI2Tk0xRVVOaTJ1YytFYVN6QVZjUDhXN1M0T1hzWGgwVnF6?=
 =?utf-8?B?dXUrMHRoM2IrR1ZTOVV4RVNGM2ZpaXBoN28zWjNDN0N2c3JGNUh0bTJOdEU3?=
 =?utf-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c2Nzh0dzNEOVV3SmhvNUhBY1VpamNuam9RbFVYYnNTTGlj?=
 =?utf-8?B?cnYyQ3c5QVA5WEs3ZmFWUHp6b3pIaC9oQTc4UnlJWDA5RXRWSUt4Q2tDNWdr?=
 =?utf-8?B?M1VXUzJrKzZpUkQwYW9KaW1FekV3UE1TTlB5RUtGODZtTGhXbWZlT2NPcStN?=
 =?utf-8?B?bWtDbzFMOElCMFQ5bEM5YVZvMDhROHBqV21pQTBkRml1RDVhKzBpRVlLVGph?=
 =?utf-8?B?azNWMFk1cXBPa2JXR2VjQXZ4alhGNWEwQVNMRmVjLzdJdU5IS1Q2bmhzVWV1?=
 =?utf-8?B?dHJFVjk4Q0U4WXNQZElSQStzRXo5Z3ZFWWp3cFp3VHNlTVYrWmpLVE9mOUtj?=
 =?utf-8?B?SFFINHZWbTZ2NzdkWDEyTThTQlJmVzVJY0NOMytkWDh4cTg3eld3SmJQUy9h?=
 =?utf-8?B?YzNhNlM2TitqYjkzRHYwd3B6N2dGLzZib3hIdTFZSmZFeVozQkk2eDBidTRx?=
 =?utf-8?B?NFY1MWVrUmpPelNsaEJuRGwyV29jUmFpVVhyczZQL3JiZThtTGdvZ0xsamx0?=
 =?utf-8?B?ODlzTy9QdXdBeGI5NDZCM2ZpK0FSaFRLOWFpUU94SEl3NGtaOXgvSmVqQzdW?=
 =?utf-8?B?STduV1Q2U2RLbDl2QUFCQjBjUFhvMmZaSzhEMkltdXV1WWFvd2ljVzdFM2xO?=
 =?utf-8?B?elhBU2pVY1B3NEM2VUdyMW1mR2pEWWtLaXlvWHVLUzd3dHhEcENMRmpSLzJ1?=
 =?utf-8?Q?q1Zmp/6IPE3609y7S3rMuzvWi?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9fc12517-1cf8-4ee3-db1b-08db8113f5b6
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 07:04:53.1045
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: h6tSkQvIKLszxqABEzRYVzlpHhkwj2020oN1O7USqRzmJ2UYtoblF863vAvO1NPPrDuSl500hCosq8X5LkYdMg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7601

On 07.07.2023 13:02, Marek Marczykowski-GÃ³recki wrote:
> On Wed, Jul 05, 2023 at 10:23:53AM +0200, Jan Beulich wrote:
>> On 01.07.2023 00:28, Marek Marczykowski-GÃ³recki wrote:
>>> On Tue, May 30, 2023 at 01:56:34PM +0200, Jan Beulich wrote:
>>>> On 05.05.2023 23:25, Marek Marczykowski-GÃ³recki wrote:
>>>>> --- a/xen/arch/x86/hvm/hvm.c
>>>>> +++ b/xen/arch/x86/hvm/hvm.c
>>>>> @@ -1990,6 +1990,14 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
>>>>>          goto out_put_gfn;
>>>>>      }
>>>>>  
>>>>> +    if ( (p2mt == p2m_mmio_direct) && npfec.write_access && npfec.present &&
>>>>> +         subpage_mmio_write_accept(mfn, gla) &&
>>>>> +         (hvm_emulate_one_mmio(mfn_x(mfn), gla) == X86EMUL_OKAY) )
>>>>> +    {
>>>>> +        rc = 1;
>>>>> +        goto out_put_gfn;
>>>>> +    }
>>>>
>>>> But npfec.write_access set doesn't mean it was a write permission
>>>> violation, does it? 
>>>
>>> Doesn't it? IIUC it means it was a write attempt, to a mapped page
>>> (npfec.present), and since we've got EPT violation, it got denied. 
>>
>> But the denial may have been for reasons other than the W bit being
>> clear, at least in principle? Abusing the bit now, even if in
>> practice there was no other possible reason on existing hardware
>> with the features we presently use, might lead to hard to locate
>> issues in case a different reason appears down the road.
> 
> Ok, so how do you propose to check if it was a write violation?
> 
> (...)

Well, that's the thing - even on VMX, where more state is provided by
hardware than is conveyed here, this can't be done reliably (afaict).
Hence any "approximation" will have its safety towards false positives
or negatives justified.

>>>> Since you mark the qwords which are to be protected, how is one to set
>>>> up safely two discontiguous ranges on the same page? I think I had
>>>> asked for v1 already why you don't do things the other way around:
>>>> Initially the entire page is protected, and then writable regions are
>>>> carved out.
>>>
>>> Because that's not how the API is used. This API is for those how want
>>> to write-protect some specific ranges (to be written exclusively by
>>> Xen). They don't need to even know what is else is on the same page.
>>> Take XHCI case as an example: it gets the range to write-protect by
>>> enumerating XHCI extended capabilities, which is a linked list. The
>>> driver gets info where XHCI console registers are.  Things before/after
>>> them on that page may not even be XHCI extended caps at all.
>>> This in fact is very similar approach to already existing
>>> mmio_ro_ranges.
>>
>> While I agree there's a similarity, multiple entities caring about the
>> same MFN isn't an expected scenario there. Whereas here you explicitly
>> add support for such.
>>
>> Furthermore you sub-divide pages covered by mmio_ro_ranges here, so
>> defaulting to "full page protected" and then carving out sub-regions
>> would be the more natural approach imo.
> 
> But then the API would be awkward to use. Instead of "mark this (smaller
> than a page) region as read-only" so Xen can use it safely, you would
> (likely) need marking _two_ regions as writable, after marking a page as
> read-only. So, either you'd need separate (3?) calls, array of ranges or
> something similar.

I understand that, and hence I'm willing to accept it provided ...

>>>> I guess I shouldn't further ask about overlapping r/o ranges and their
>>>> cleaning up. But at least a comment towards the restriction would be
>>>> nice. Perhaps even check upon registration that no part of the range
>>>> is already marked r/o.
>>>
>>> Yes, this is a good suggestion, I'll add that.
>>
>> As long as all restrictions are properly spelled out, this may be
>> sufficient. But please don't be surprised if I ask again on a
>> subsequent version.

... it's all spelled out (including the multi-subrange limitation
mentioned earlier, and left purposefully in context).

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:09:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:09:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560984.877220 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl1d-0001IK-0K; Mon, 10 Jul 2023 07:09:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560984.877220; Mon, 10 Jul 2023 07:09:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl1c-0001ID-Tp; Mon, 10 Jul 2023 07:09:36 +0000
Received: by outflank-mailman (input) for mailman id 560984;
 Mon, 10 Jul 2023 07:09:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIkto-0002xd-WC
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:01:33 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 99a2c6e0-1eef-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 09:01:32 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id C6C5A1F38D;
 Mon, 10 Jul 2023 07:01:31 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9A10C1361C;
 Mon, 10 Jul 2023 07:01:31 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 3sRVJMusq2RyYwAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 07:01:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 99a2c6e0-1eef-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972491; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=UK04J9dErimDKqoXrosnGNBdXEpxv+Xoy6piXu//+Go=;
	b=L6vcRSYbCCaE/luqflnMc+4AEs3JIpmMPnN2bu8sfKaeQCNEqv2wyZB4UQZB9XHGXuDqfn
	9Qm7jcvaMfrL8g+0YGIjC1xspfJtt556FaB5DQEkitGuij4yG849KJBR/A0bvAoCsOfcUs
	SXwbqF851v6mUhpOJa/XG4ea30w0oNA=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 18/18] tools/xenstore: add nocopy flag to node read functions
Date: Mon, 10 Jul 2023 08:59:47 +0200
Message-Id: <20230710065947.4201-19-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230710065947.4201-1-jgross@suse.com>
References: <20230710065947.4201-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Today when reading a node from the data base through read_node(), the
node data is copied in order to avoid modifying the data base when
preparing a node update, as otherwise an error might result in an
inconsistent state.

There are, however, many cases where such a copy operation isn't
needed, as the node isn't modified.

Add a "nocopy" flag to read_node() and get_node*() functions for making
those cases less memory consuming and more performant.

Note that there is one modification of the node data left, which is not
problematic: domain_adjust_node_perms() might set the "ignore" flag of
a permission. This does no harm, as such an update of the permissions
doesn't need to be undone in case of a later processing error.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- new patch
---
 tools/xenstore/xenstored_core.c   | 68 +++++++++++++++++--------------
 tools/xenstore/xenstored_core.h   |  2 +-
 tools/xenstore/xenstored_domain.c |  2 +-
 tools/xenstore/xenstored_watch.c  |  4 +-
 4 files changed, 41 insertions(+), 35 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 7495747d76..8041a6a1c6 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -706,7 +706,7 @@ void db_delete(struct connection *conn, const char *name,
  * Temporary memory allocations will be done with ctx.
  */
 struct node *read_node(struct connection *conn, const void *ctx,
-		       const char *name)
+		       const char *name, bool nocopy)
 {
 	size_t size;
 	struct node_hdr *hdr;
@@ -743,14 +743,18 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	node->acc.domid = perms_from_node_hdr(hdr)->id;
 	node->acc.memory = size;
 
-	/* Copy node data to new memory area, starting with permissions. */
-	size -= sizeof(*hdr);
-	node->perms = talloc_size(node, size);
-	if (node->perms == NULL) {
-		errno = ENOMEM;
-		goto error;
+	if (nocopy) {
+		node->perms = (struct xs_permissions *)(hdr + 1);
+	} else {
+		/* Copy node data to new area, starting with permissions. */
+		size -= sizeof(*hdr);
+		node->perms = talloc_size(node, size);
+		if (node->perms == NULL) {
+			errno = ENOMEM;
+			goto error;
+		}
+		memcpy(node->perms, perms_from_node_hdr(hdr), size);
 	}
-	memcpy(node->perms, perms_from_node_hdr(hdr), size);
 
 	/* Permissions are struct xs_permissions. */
 	if (domain_adjust_node_perms(node))
@@ -905,7 +909,7 @@ static int ask_parents(struct connection *conn, const void *ctx,
 		name = get_parent(ctx, name);
 		if (!name)
 			return errno;
-		node = read_node(conn, ctx, name);
+		node = read_node(conn, ctx, name, true);
 		if (node)
 			break;
 		if (read_node_can_propagate_errno())
@@ -954,12 +958,12 @@ static int errno_from_parents(struct connection *conn, const void *ctx,
 static struct node *get_node(struct connection *conn,
 			     const void *ctx,
 			     const char *name,
-			     unsigned int perm)
+			     unsigned int perm, bool nocopy)
 {
 	struct node *node;
 	struct node_perms perms;
 
-	node = read_node(conn, ctx, name);
+	node = read_node(conn, ctx, name, nocopy);
 	/* If we don't have permission, we don't have node. */
 	if (node) {
 		node_to_node_perms(node, &perms);
@@ -1248,7 +1252,7 @@ static struct node *get_node_canonicalized(struct connection *conn,
 					   const void *ctx,
 					   const char *name,
 					   char **canonical_name,
-					   unsigned int perm)
+					   unsigned int perm, bool nocopy)
 {
 	char *tmp_name;
 
@@ -1261,17 +1265,18 @@ static struct node *get_node_canonicalized(struct connection *conn,
 		errno = EINVAL;
 		return NULL;
 	}
-	return get_node(conn, ctx, *canonical_name, perm);
+	return get_node(conn, ctx, *canonical_name, perm, nocopy);
 }
 
 static struct node *get_spec_node(struct connection *conn, const void *ctx,
 				  const char *name, char **canonical_name,
-				  unsigned int perm)
+				  unsigned int perm, bool nocopy)
 {
 	if (name[0] == '@')
-		return get_node(conn, ctx, name, perm);
+		return get_node(conn, ctx, name, perm, nocopy);
 
-	return get_node_canonicalized(conn, ctx, name, canonical_name, perm);
+	return get_node_canonicalized(conn, ctx, name, canonical_name, perm,
+				      nocopy);
 }
 
 static int send_directory(const void *ctx, struct connection *conn,
@@ -1280,7 +1285,7 @@ static int send_directory(const void *ctx, struct connection *conn,
 	struct node *node;
 
 	node = get_node_canonicalized(conn, ctx, onearg(in), NULL,
-				      XS_PERM_READ);
+				      XS_PERM_READ, true);
 	if (!node)
 		return errno;
 
@@ -1302,7 +1307,7 @@ static int send_directory_part(const void *ctx, struct connection *conn,
 
 	/* First arg is node name. */
 	node = get_node_canonicalized(conn, ctx, in->buffer, NULL,
-				      XS_PERM_READ);
+				      XS_PERM_READ, true);
 	if (!node)
 		return errno;
 
@@ -1352,7 +1357,7 @@ static int do_read(const void *ctx, struct connection *conn,
 	struct node *node;
 
 	node = get_node_canonicalized(conn, ctx, onearg(in), NULL,
-				      XS_PERM_READ);
+				      XS_PERM_READ, true);
 	if (!node)
 		return errno;
 
@@ -1414,7 +1419,7 @@ static struct node *construct_node(struct connection *conn, const void *ctx,
 			return NULL;
 
 		/* Try to read parent node until we found an existing one. */
-		parent = read_node(conn, ctx, parentname);
+		parent = read_node(conn, ctx, parentname, false);
 		if (!parent && (errno != ENOENT || !strcmp(parentname, "/")))
 			return NULL;
 
@@ -1566,7 +1571,8 @@ static int do_write(const void *ctx, struct connection *conn,
 	offset = strlen(vec[0]) + 1;
 	datalen = in->used - offset;
 
-	node = get_node_canonicalized(conn, ctx, vec[0], &name, XS_PERM_WRITE);
+	node = get_node_canonicalized(conn, ctx, vec[0], &name, XS_PERM_WRITE,
+				      false);
 	if (!node) {
 		/* No permissions, invalid input? */
 		if (errno != ENOENT)
@@ -1595,7 +1601,7 @@ static int do_mkdir(const void *ctx, struct connection *conn,
 	char *name;
 
 	node = get_node_canonicalized(conn, ctx, onearg(in), &name,
-				      XS_PERM_WRITE);
+				      XS_PERM_WRITE, false);
 
 	/* If it already exists, fine. */
 	if (!node) {
@@ -1689,7 +1695,7 @@ int rm_node(struct connection *conn, const void *ctx, const char *name)
 	if (!parentname)
 		return errno;
 
-	parent = read_node(conn, ctx, parentname);
+	parent = read_node(conn, ctx, parentname, false);
 	if (!parent)
 		return read_node_can_propagate_errno() ? errno : EINVAL;
 
@@ -1725,7 +1731,7 @@ static int do_rm(const void *ctx, struct connection *conn,
 	char *parentname;
 
 	node = get_node_canonicalized(conn, ctx, onearg(in), &name,
-				      XS_PERM_WRITE);
+				      XS_PERM_WRITE, false);
 	if (!node) {
 		/* Didn't exist already?  Fine, if parent exists. */
 		if (errno == ENOENT) {
@@ -1734,7 +1740,7 @@ static int do_rm(const void *ctx, struct connection *conn,
 			parentname = get_parent(ctx, name);
 			if (!parentname)
 				return errno;
-			node = read_node(conn, ctx, parentname);
+			node = read_node(conn, ctx, parentname, false);
 			if (node) {
 				send_ack(conn, XS_RM);
 				return 0;
@@ -1767,7 +1773,7 @@ static int do_get_perms(const void *ctx, struct connection *conn,
 	unsigned int len;
 	struct node_perms perms;
 
-	node = get_spec_node(conn, ctx, onearg(in), NULL, XS_PERM_READ);
+	node = get_spec_node(conn, ctx, onearg(in), NULL, XS_PERM_READ, true);
 	if (!node)
 		return errno;
 
@@ -1811,7 +1817,7 @@ static int do_set_perms(const void *ctx, struct connection *conn,
 
 	/* We must own node to do this (tools can do this too). */
 	node = get_spec_node(conn, ctx, in->buffer, &name,
-			     XS_PERM_WRITE | XS_PERM_OWNER);
+			     XS_PERM_WRITE | XS_PERM_OWNER, false);
 	if (!node)
 		return errno;
 
@@ -1933,7 +1939,7 @@ int walk_node_tree(const void *ctx, struct connection *conn, const char *root,
 			parent = node;
 		}
 		/* Read next node (root node or next child). */
-		node = read_node(conn, tmpctx, name);
+		node = read_node(conn, tmpctx, name, false);
 		if (!node) {
 			/* Child not found - should not happen! */
 			/* ENOENT case can be handled by supplied function. */
@@ -2483,7 +2489,7 @@ int check_store_path(const char *name, struct check_store_data *data)
 {
 	struct node *node;
 
-	node = read_node(NULL, NULL, name);
+	node = read_node(NULL, NULL, name, false);
 	if (!node) {
 		log("check_store: error %d reading special node '%s'", errno,
 		    name);
@@ -3245,7 +3251,7 @@ static int dump_state_special_node(FILE *fp, const void *ctx,
 	struct node *node;
 	int ret;
 
-	node = read_node(NULL, ctx, name);
+	node = read_node(NULL, ctx, name, true);
 	if (!node)
 		return dump_state_node_err(data, "Dump node read node error");
 
@@ -3447,7 +3453,7 @@ void read_state_node(const void *ctx, const void *state)
 		parentname = get_parent(node, name);
 		if (!parentname)
 			barf("allocation error restoring node");
-		parent = read_node(NULL, node, parentname);
+		parent = read_node(NULL, node, parentname, false);
 		if (!parent)
 			barf("read parent error restoring node");
 
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 79b2a699fd..a4cd3e503a 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -280,7 +280,7 @@ int write_node_raw(struct connection *conn, const char *db_name,
 
 /* Get a node from the data base. */
 struct node *read_node(struct connection *conn, const void *ctx,
-		       const char *name);
+		       const char *name, bool nocopy);
 
 /* Remove a node and its children. */
 int rm_node(struct connection *conn, const void *ctx, const char *name);
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index 4d66dc91ce..b8fd7469d0 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -568,7 +568,7 @@ static void fire_special_watches(const char *name)
 	if (!ctx)
 		return;
 
-	node = read_node(NULL, ctx, name);
+	node = read_node(NULL, ctx, name, true);
 
 	if (node)
 		fire_watches(NULL, ctx, name, node, true, NULL);
diff --git a/tools/xenstore/xenstored_watch.c b/tools/xenstore/xenstored_watch.c
index 10645f762d..54a9468090 100644
--- a/tools/xenstore/xenstored_watch.c
+++ b/tools/xenstore/xenstored_watch.c
@@ -88,7 +88,7 @@ static bool watch_permitted(struct connection *conn, const void *ctx,
 	}
 
 	if (!node) {
-		node = read_node(conn, ctx, name);
+		node = read_node(conn, ctx, name, true);
 		if (!node)
 			return false;
 	}
@@ -103,7 +103,7 @@ static bool watch_permitted(struct connection *conn, const void *ctx,
 		parent_name = get_parent(ctx, node->name);
 		if (!parent_name)
 			return false;
-		parent = read_node(conn, ctx, parent_name);
+		parent = read_node(conn, ctx, parent_name, true);
 		if (!parent)
 			return false;
 	}
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:09:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:09:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560980.877211 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl1b-000130-Re; Mon, 10 Jul 2023 07:09:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560980.877211; Mon, 10 Jul 2023 07:09:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl1b-00012n-Mf; Mon, 10 Jul 2023 07:09:35 +0000
Received: by outflank-mailman (input) for mailman id 560980;
 Mon, 10 Jul 2023 07:09:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIktM-0002xd-SD
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:01:04 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [2001:67c:2178:6::1c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 88f144bf-1eef-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 09:01:04 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id C756821E91;
 Mon, 10 Jul 2023 07:01:03 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9ABAF1361C;
 Mon, 10 Jul 2023 07:01:03 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id FedZJK+sq2Q7YwAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 07:01:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 88f144bf-1eef-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972463; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=LL0mYNGCcpz3qPsiYMb2y3kfqsUKSB/ihslfEA9JXv8=;
	b=Xul1CLsaspdPVpUllNlHt6JrzfdN/vPldpEgH7u5zH3TrVsd8FSVF5nSORYEOcErX+hu2C
	oOuTHLrD6aAE94vdsk3nQWYOx3CKRbsMV5vkjxZQgP4gfRUOWcopoxsPirfDyk7fNWRzuc
	yy2aAkH43VF5CzQWU1uGNOKSSp8hI0Y=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 13/18] tools/xenstore: let db_delete() return void
Date: Mon, 10 Jul 2023 08:59:42 +0200
Message-Id: <20230710065947.4201-14-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230710065947.4201-1-jgross@suse.com>
References: <20230710065947.4201-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

db_delete() only ever is returning 0. Switch it to return void and
remove all the error handling dealing wit a non-zero return value.

Suggested-by: Julien Grall <julien@xen.org>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- new patch
---
 tools/xenstore/xenstored_core.c        | 11 ++++-------
 tools/xenstore/xenstored_core.h        |  4 ++--
 tools/xenstore/xenstored_transaction.c | 14 +++++---------
 3 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index ff10659e65..11da470b20 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -679,8 +679,8 @@ int db_write(struct connection *conn, const char *db_name, void *data,
 	return 0;
 }
 
-int db_delete(struct connection *conn, const char *name,
-	      struct node_account_data *acc)
+void db_delete(struct connection *conn, const char *name,
+	       struct node_account_data *acc)
 {
 	struct node_account_data tmp_acc;
 	unsigned int domid;
@@ -700,8 +700,6 @@ int db_delete(struct connection *conn, const char *name,
 		domain_memory_add_nochk(conn, domid,
 					-acc->memory - strlen(name));
 	}
-
-	return 0;
 }
 
 /*
@@ -1668,9 +1666,8 @@ static int delnode_sub(const void *ctx, struct connection *conn,
 	if (domain_nbentry_dec(conn, get_node_owner(node)))
 		return WALK_TREE_ERROR_STOP;
 
-	/* In case of error stop the walk. */
-	if (!ret && db_delete(conn, db_name, &node->acc))
-		return WALK_TREE_ERROR_STOP;
+	if (!ret)
+		db_delete(conn, db_name, &node->acc);
 
 	/*
 	 * Fire the watches now, when we can still see the node permissions.
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 5d96799c60..3c0dd40dfb 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -365,8 +365,8 @@ struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size);
 int db_write(struct connection *conn, const char *db_name, void *data,
 	     size_t size, struct node_account_data *acc,
 	     enum write_node_mode mode, bool no_quota_check);
-int db_delete(struct connection *conn, const char *name,
-	      struct node_account_data *acc);
+void db_delete(struct connection *conn, const char *name,
+	       struct node_account_data *acc);
 
 void conn_free_buffered_data(struct connection *conn);
 
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 420645e55d..5d7da82aad 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -378,10 +378,8 @@ static int finalize_transaction(struct connection *conn,
 
 		/* Entries for unmodified nodes can be removed early. */
 		if (!i->modified) {
-			if (i->ta_node) {
-				if (db_delete(conn, i->trans_name, NULL))
-					return EIO;
-			}
+			if (i->ta_node)
+				db_delete(conn, i->trans_name, NULL);
 			list_del(&i->list);
 			talloc_free(i);
 		}
@@ -396,8 +394,7 @@ static int finalize_transaction(struct connection *conn,
 				       ? NODE_CREATE : NODE_MODIFY;
 				*is_corrupt |= db_write(conn, i->node, hdr,
 							size, NULL, flag, true);
-				if (db_delete(conn, i->trans_name, NULL))
-					*is_corrupt = true;
+				db_delete(conn, i->trans_name, NULL);
 			} else {
 				*is_corrupt = true;
 			}
@@ -407,9 +404,8 @@ static int finalize_transaction(struct connection *conn,
 			 * in this transaction will have no generation
 			 * information stored.
 			 */
-			*is_corrupt |= (i->generation == NO_GENERATION)
-				       ? false
-				       : db_delete(conn, i->node, NULL);
+			if (i->generation != NO_GENERATION)
+				db_delete(conn, i->node, NULL);
 		}
 		if (i->fire_watch)
 			fire_watches(conn, trans, i->node, NULL, i->watch_exact,
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:09:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:09:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560987.877231 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl1o-0001jw-CK; Mon, 10 Jul 2023 07:09:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560987.877231; Mon, 10 Jul 2023 07:09:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl1o-0001jp-90; Mon, 10 Jul 2023 07:09:48 +0000
Received: by outflank-mailman (input) for mailman id 560987;
 Mon, 10 Jul 2023 07:09:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIktj-0002xd-Dj
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:01:27 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 964fa27c-1eef-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 09:01:26 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 39A6A1F38D;
 Mon, 10 Jul 2023 07:01:26 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 08D201361C;
 Mon, 10 Jul 2023 07:01:26 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id /abeAMasq2RqYwAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 07:01:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 964fa27c-1eef-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972486; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=oJsbcuHqSaGcFxvtX6uJ+xBRX6S90Qjkd1Nn8k3REng=;
	b=iyzKqaCpi6cQsXUB1OgL0Rq1Ksvd/n/9Atg9gaA2+P3cXF1i+6fcchLvVyt8I3cgz2O3N/
	MiqUzetzlNiO1ImY/SUiD/KAmU84EqmVy+7y0suK/YuCaX4BT8aIc/TCcvxFo700nsrSjP
	ObYkLnff1E1hNUkl4dyV07u3800hpFw=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 17/18] tools/xenstore: use struct node_hdr in struct node
Date: Mon, 10 Jul 2023 08:59:46 +0200
Message-Id: <20230710065947.4201-18-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230710065947.4201-1-jgross@suse.com>
References: <20230710065947.4201-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Replace some individual fields in struct node with struct node_hdr.

This allows to add a helper for calculating the accounted memory size
of a node.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- new patch
---
 tools/xenstore/xenstored_core.c        | 108 ++++++++++++-------------
 tools/xenstore/xenstored_core.h        |  16 ++--
 tools/xenstore/xenstored_domain.c      |   5 +-
 tools/xenstore/xenstored_transaction.c |  13 +--
 4 files changed, 71 insertions(+), 71 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 9f0e56a149..7495747d76 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -555,6 +555,12 @@ static void initialize_fds(int *p_sock_pollfd_idx, int *ptimeout)
 	}
 }
 
+static size_t calc_node_acc_size(struct node_hdr *hdr)
+{
+	return sizeof(*hdr) + hdr->num_perms * sizeof(struct xs_permissions) +
+	       hdr->datalen + hdr->childlen;
+}
+
 struct node_hdr *db_fetch(const char *db_name, size_t *size)
 {
 	struct node_hdr *hdr;
@@ -565,8 +571,7 @@ struct node_hdr *db_fetch(const char *db_name, size_t *size)
 		return NULL;
 	}
 
-	*size = sizeof(*hdr) + hdr->num_perms * sizeof(struct xs_permissions) +
-		hdr->datalen + hdr->childlen;
+	*size = calc_node_acc_size(hdr);
 
 	trace_tdb("read %s size %zu\n", db_name, *size + strlen(db_name));
 
@@ -725,7 +730,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	hdr = db_fetch(db_name, &size);
 
 	if (hdr == NULL) {
-		node->generation = NO_GENERATION;
+		node->hdr.generation = NO_GENERATION;
 		err = access_node(conn, node, NODE_ACCESS_READ, NULL);
 		errno = err ? : ENOENT;
 		goto error;
@@ -734,10 +739,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	node->parent = NULL;
 
 	/* Datalen, childlen, number of permissions */
-	node->generation = hdr->generation;
-	node->num_perms = hdr->num_perms;
-	node->datalen = hdr->datalen;
-	node->childlen = hdr->childlen;
+	node->hdr = *hdr;
 	node->acc.domid = perms_from_node_hdr(hdr)->id;
 	node->acc.memory = size;
 
@@ -761,7 +763,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	/* Data is binary blob (usually ascii, no nul). */
 	node->data = node->perms + hdr->num_perms;
 	/* Children is strings, nul separated. */
-	node->children = node->data + node->datalen;
+	node->children = node->data + node->hdr.datalen;
 
 	if (access_node(conn, node, NODE_ACCESS_READ, NULL))
 		goto error;
@@ -797,9 +799,7 @@ int write_node_raw(struct connection *conn, const char *db_name,
 	if (domain_adjust_node_perms(node))
 		return errno;
 
-	size = sizeof(*hdr)
-		+ node->num_perms * sizeof(node->perms[0])
-		+ node->datalen + node->childlen;
+	size = calc_node_acc_size(&node->hdr);
 
 	/* Call domain_max_chk() in any case in order to record max values. */
 	if (domain_max_chk(conn, ACC_NODESZ, size) && !no_quota_check) {
@@ -814,17 +814,14 @@ int write_node_raw(struct connection *conn, const char *db_name,
 	}
 
 	hdr = data;
-	hdr->generation = node->generation;
-	hdr->num_perms = node->num_perms;
-	hdr->datalen = node->datalen;
-	hdr->childlen = node->childlen;
+	*hdr = node->hdr;
 
 	p = perms_from_node_hdr(hdr);
-	memcpy(p, node->perms, node->num_perms * sizeof(*node->perms));
-	p += node->num_perms * sizeof(*node->perms);
-	memcpy(p, node->data, node->datalen);
-	p += node->datalen;
-	memcpy(p, node->children, node->childlen);
+	memcpy(p, node->perms, node->hdr.num_perms * sizeof(*node->perms));
+	p += node->hdr.num_perms * sizeof(*node->perms);
+	memcpy(p, node->data, node->hdr.datalen);
+	p += node->hdr.datalen;
+	memcpy(p, node->children, node->hdr.childlen);
 
 	if (db_write(conn, db_name, data, size, &node->acc, mode,
 		     no_quota_check))
@@ -1287,7 +1284,7 @@ static int send_directory(const void *ctx, struct connection *conn,
 	if (!node)
 		return errno;
 
-	send_reply(conn, XS_DIRECTORY, node->children, node->childlen);
+	send_reply(conn, XS_DIRECTORY, node->children, node->hdr.childlen);
 
 	return 0;
 }
@@ -1312,10 +1309,11 @@ static int send_directory_part(const void *ctx, struct connection *conn,
 	/* Second arg is childlist offset. */
 	off = atoi(in->buffer + strlen(in->buffer) + 1);
 
-	genlen = snprintf(gen, sizeof(gen), "%"PRIu64, node->generation) + 1;
+	genlen = snprintf(gen, sizeof(gen), "%"PRIu64, node->hdr.generation) +
+		 1;
 
 	/* Offset behind list: just return a list with an empty string. */
-	if (off >= node->childlen) {
+	if (off >= node->hdr.childlen) {
 		gen[genlen] = 0;
 		send_reply(conn, XS_DIRECTORY_PART, gen, genlen + 1);
 		return 0;
@@ -1328,7 +1326,7 @@ static int send_directory_part(const void *ctx, struct connection *conn,
 	while (len + strlen(child) < maxlen) {
 		len += strlen(child) + 1;
 		child += strlen(child) + 1;
-		if (off + len == node->childlen)
+		if (off + len == node->hdr.childlen)
 			break;
 	}
 
@@ -1338,7 +1336,7 @@ static int send_directory_part(const void *ctx, struct connection *conn,
 
 	memcpy(data, gen, genlen);
 	memcpy(data + genlen, node->children + off, len);
-	if (off + len == node->childlen) {
+	if (off + len == node->hdr.childlen) {
 		data[genlen + len] = 0;
 		len++;
 	}
@@ -1358,7 +1356,7 @@ static int do_read(const void *ctx, struct connection *conn,
 	if (!node)
 		return errno;
 
-	send_reply(conn, XS_READ, node->data, node->datalen);
+	send_reply(conn, XS_READ, node->data, node->hdr.datalen);
 
 	return 0;
 }
@@ -1377,13 +1375,13 @@ static int add_child(const void *ctx, struct node *parent, const char *name)
 
 	base = basename(name);
 	baselen = strlen(base) + 1;
-	children = talloc_array(ctx, char, parent->childlen + baselen);
+	children = talloc_array(ctx, char, parent->hdr.childlen + baselen);
 	if (!children)
 		return ENOMEM;
-	memcpy(children, parent->children, parent->childlen);
-	memcpy(children + parent->childlen, base, baselen);
+	memcpy(children, parent->children, parent->hdr.childlen);
+	memcpy(children + parent->hdr.childlen, base, baselen);
 	parent->children = children;
-	parent->childlen += baselen;
+	parent->hdr.childlen += baselen;
 
 	return 0;
 }
@@ -1436,9 +1434,9 @@ static struct node *construct_node(struct connection *conn, const void *ctx,
 		node->name = talloc_steal(node, names[levels - 1]);
 
 		/* Inherit permissions, unpriv domains own what they create. */
-		node->num_perms = parent->num_perms;
+		node->hdr.num_perms = parent->hdr.num_perms;
 		node->perms = talloc_memdup(node, parent->perms,
-					    node->num_perms *
+					    node->hdr.num_perms *
 					    sizeof(*node->perms));
 		if (!node->perms)
 			goto nomem;
@@ -1447,7 +1445,7 @@ static struct node *construct_node(struct connection *conn, const void *ctx,
 
 		/* No children, no data */
 		node->children = node->data = NULL;
-		node->childlen = node->datalen = 0;
+		node->hdr.childlen = node->hdr.datalen = 0;
 		node->acc.memory = 0;
 		node->parent = parent;
 
@@ -1499,7 +1497,7 @@ static struct node *create_node(struct connection *conn, const void *ctx,
 		ta_node_created(conn->transaction);
 
 	node->data = data;
-	node->datalen = datalen;
+	node->hdr.datalen = datalen;
 
 	/*
 	 * We write out the nodes bottom up.
@@ -1579,7 +1577,7 @@ static int do_write(const void *ctx, struct connection *conn,
 			return errno;
 	} else {
 		node->data = in->buffer + offset;
-		node->datalen = datalen;
+		node->hdr.datalen = datalen;
 		if (write_node(conn, node, NODE_MODIFY, false))
 			return errno;
 	}
@@ -1627,8 +1625,8 @@ static int remove_child_entry(struct connection *conn, struct node *node,
 {
 	size_t childlen = strlen(node->children + offset);
 
-	memdel(node->children, offset, childlen + 1, node->childlen);
-	node->childlen -= childlen + 1;
+	memdel(node->children, offset, childlen + 1, node->hdr.childlen);
+	node->hdr.childlen -= childlen + 1;
 
 	return write_node(conn, node, NODE_MODIFY, true);
 }
@@ -1638,8 +1636,9 @@ static int delete_child(struct connection *conn,
 {
 	unsigned int i;
 
-	for (i = 0; i < node->childlen; i += strlen(node->children+i) + 1) {
-		if (streq(node->children+i, childname)) {
+	for (i = 0; i < node->hdr.childlen;
+	     i += strlen(node->children + i) + 1) {
+		if (streq(node->children + i, childname)) {
 			errno = remove_child_entry(conn, node, i) ? EIO : 0;
 			return errno;
 		}
@@ -1907,7 +1906,7 @@ int walk_node_tree(const void *ctx, struct connection *conn, const char *root,
 		/* node == NULL possible only for the initial loop iteration. */
 		if (node) {
 			/* Go one step up if ret or if last child finished. */
-			if (ret || node->childoff >= node->childlen) {
+			if (ret || node->childoff >= node->hdr.childlen) {
 				parent = node->parent;
 				/* Call function AFTER processing a node. */
 				ret = walk_call_func(ctx, conn, node, parent,
@@ -2337,10 +2336,10 @@ static void manual_node(const char *name, const char *child)
 
 	node->name = name;
 	node->perms = &perms;
-	node->num_perms = 1;
+	node->hdr.num_perms = 1;
 	node->children = (char *)child;
 	if (child)
-		node->childlen = strlen(child) + 1;
+		node->hdr.childlen = strlen(child) + 1;
 
 	if (write_node(NULL, node, NODE_CREATE, false))
 		barf_perror("Could not create initial node %s", name);
@@ -3208,12 +3207,12 @@ static int dump_state_node(const void *ctx, struct connection *conn,
 	sn.conn_id = 0;
 	sn.ta_id = 0;
 	sn.ta_access = 0;
-	sn.perm_n = node->num_perms;
+	sn.perm_n = node->hdr.num_perms;
 	sn.path_len = pathlen;
-	sn.data_len = node->datalen;
-	head.length += node->num_perms * sizeof(*sn.perms);
+	sn.data_len = node->hdr.datalen;
+	head.length += node->hdr.num_perms * sizeof(*sn.perms);
 	head.length += pathlen;
-	head.length += node->datalen;
+	head.length += node->hdr.datalen;
 	head.length = ROUNDUP(head.length, 3);
 
 	if (fwrite(&head, sizeof(head), 1, fp) != 1)
@@ -3221,14 +3220,15 @@ static int dump_state_node(const void *ctx, struct connection *conn,
 	if (fwrite(&sn, sizeof(sn), 1, fp) != 1)
 		return dump_state_node_err(data, "Dump node state error");
 
-	ret = dump_state_node_perms(fp, node->perms, node->num_perms);
+	ret = dump_state_node_perms(fp, node->perms, node->hdr.num_perms);
 	if (ret)
 		return dump_state_node_err(data, ret);
 
 	if (fwrite(node->name, pathlen, 1, fp) != 1)
 		return dump_state_node_err(data, "Dump node path error");
 
-	if (node->datalen && fwrite(node->data, node->datalen, 1, fp) != 1)
+	if (node->hdr.datalen &&
+	    fwrite(node->data, node->hdr.datalen, 1, fp) != 1)
 		return dump_state_node_err(data, "Dump node data error");
 
 	ret = dump_state_align(fp);
@@ -3413,17 +3413,17 @@ void read_state_node(const void *ctx, const void *state)
 
 	node->acc.memory = 0;
 	node->name = name;
-	node->generation = ++generation;
-	node->datalen = sn->data_len;
+	node->hdr.generation = ++generation;
+	node->hdr.datalen = sn->data_len;
 	node->data = name + sn->path_len;
-	node->childlen = 0;
+	node->hdr.childlen = 0;
 	node->children = NULL;
-	node->num_perms = sn->perm_n;
+	node->hdr.num_perms = sn->perm_n;
 	node->perms = talloc_array(node, struct xs_permissions,
-				   node->num_perms);
+				   node->hdr.num_perms);
 	if (!node->perms)
 		barf("allocation error restoring node");
-	for (i = 0; i < node->num_perms; i++) {
+	for (i = 0; i < node->hdr.num_perms; i++) {
 		switch (sn->perms[i].access) {
 		case 'r':
 			node->perms[i].perms = XS_PERM_READ;
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index c706d30b63..79b2a699fd 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -181,6 +181,7 @@ extern struct list_head connections;
  */
 struct node_hdr {
 	uint64_t generation;
+#define NO_GENERATION ~((uint64_t)0)
 	uint16_t num_perms;
 	uint16_t datalen;
 	uint32_t childlen;
@@ -197,6 +198,10 @@ struct node_account_data {
 };
 
 struct node {
+	/* Data direct for data base. */
+	struct node_hdr hdr;
+
+	/* Xenstore path. */
 	const char *name;
 	/* Name used to access data base. */
 	const char *db_name;
@@ -204,20 +209,13 @@ struct node {
 	/* Parent (optional) */
 	struct node *parent;
 
-	/* Generation count. */
-	uint64_t generation;
-#define NO_GENERATION ~((uint64_t)0)
-
 	/* Permissions. */
-	unsigned int num_perms;
 	struct xs_permissions *perms;
 
 	/* Contents. */
-	unsigned int datalen;
 	void *data;
 
 	/* Children, each nul-terminated. */
-	unsigned int childlen;
 	unsigned int childoff;	/* Used by walk_node_tree() internally. */
 	char *children;
 
@@ -258,7 +256,7 @@ static inline unsigned int get_node_owner(const struct node *node)
 static inline void node_to_node_perms(const struct node *node,
 				      struct node_perms *perms)
 {
-	perms->num = node->num_perms;
+	perms->num = node->hdr.num_perms;
 	perms->p = node->perms;
 }
 
@@ -266,7 +264,7 @@ static inline void node_to_node_perms(const struct node *node,
 static inline void node_perms_to_node(const struct node_perms *perms,
 				      struct node *node)
 {
-	node->num_perms = perms->num;
+	node->hdr.num_perms = perms->num;
 	node->perms = perms->p;
 }
 
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index b17402fe11..4d66dc91ce 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -1335,10 +1335,11 @@ int domain_adjust_node_perms(struct node *node)
 {
 	unsigned int i;
 
-	for (i = 1; i < node->num_perms; i++) {
+	for (i = 1; i < node->hdr.num_perms; i++) {
 		if (node->perms[i].perms & XS_PERM_IGNORE)
 			continue;
-		if (!chk_domain_generation(node->perms[i].id, node->generation))
+		if (!chk_domain_generation(node->perms[i].id,
+					   node->hdr.generation))
 			node->perms[i].perms |= XS_PERM_IGNORE;
 	}
 
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index e39df3a82d..acea4761e7 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -232,7 +232,7 @@ int access_node(struct connection *conn, struct node *node,
 	bool introduce = false;
 
 	if (type != NODE_ACCESS_READ) {
-		node->generation = ++generation;
+		node->hdr.generation = ++generation;
 		if (conn && !conn->transaction)
 			wrl_apply_debit_direct(conn);
 	}
@@ -259,12 +259,13 @@ int access_node(struct connection *conn, struct node *node,
 		if (!i->trans_name)
 			goto nomem;
 		i->node = strchr(i->trans_name, '/') + 1;
-		if (node->generation != NO_GENERATION && node->num_perms) {
+		if (node->hdr.generation != NO_GENERATION &&
+		    node->hdr.num_perms) {
 			i->perms.p = talloc_array(i, struct xs_permissions,
-						  node->num_perms);
+						  node->hdr.num_perms);
 			if (!i->perms.p)
 				goto nomem;
-			i->perms.num = node->num_perms;
+			i->perms.num = node->hdr.num_perms;
 			memcpy(i->perms.p, node->perms,
 			       i->perms.num * sizeof(*i->perms.p));
 		}
@@ -282,9 +283,9 @@ int access_node(struct connection *conn, struct node *node,
 		 * from the write types.
 		 */
 		if (type == NODE_ACCESS_READ) {
-			i->generation = node->generation;
+			i->generation = node->hdr.generation;
 			i->check_gen = true;
-			if (node->generation != NO_GENERATION) {
+			if (node->hdr.generation != NO_GENERATION) {
 				ret = write_node_raw(conn, i->trans_name, node,
 						     NODE_CREATE, true);
 				if (ret)
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:09:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:09:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560990.877237 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl1o-0001nm-PP; Mon, 10 Jul 2023 07:09:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560990.877237; Mon, 10 Jul 2023 07:09:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl1o-0001mx-J8; Mon, 10 Jul 2023 07:09:48 +0000
Received: by outflank-mailman (input) for mailman id 560990;
 Mon, 10 Jul 2023 07:09:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIktY-0002xd-0g
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:01:16 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8f9d425b-1eef-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 09:01:15 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id F40C31F747;
 Mon, 10 Jul 2023 07:01:14 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C4F0D1361C;
 Mon, 10 Jul 2023 07:01:14 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id nLWnLrqsq2RUYwAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 07:01:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8f9d425b-1eef-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972475; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=OUlZCgcfMFoaDJtRix0rUMJGM+xPeYzeESQio/4zXx4=;
	b=nUjPnBcxWCITCjiO0/Vt9IoK260qimgK0ZXxcQDcR+merh0aRdbYG0PuwElBiEPUTE8hOT
	3JcTleEFF/eArrG90EXCBRFevUi9BUOQPA+iYtjtgejLJmDl2NX9JCZK08RH0jtS4K6Wgt
	TIh8ZN+MUodPy2hT1Gk4/eWdwwXUHMg=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 15/18] tools/xenstore: rework struct xs_tdb_record_hdr
Date: Mon, 10 Jul 2023 08:59:44 +0200
Message-Id: <20230710065947.4201-16-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230710065947.4201-1-jgross@suse.com>
References: <20230710065947.4201-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Struct xs_tdb_record_hdr is used for nodes stored in the data base.
When working on a node, struct node is being used, which is including
the same information as struct xs_tdb_record_hdr, but in a different
format. Rework struct xs_tdb_record_hdr in order to prepare including
it in struct node.

Do the following modifications:

- move its definition to xenstored_core.h, as the reason to put it into
  utils.h are no longer existing

- rename it to struct node_hdr, as the "tdb" in its name has only
  historical reasons

- replace the empty permission array at the end with a comment about
  the layout of data in the data base (concatenation of header,
  permissions, node contents, and children list)

- use narrower types for num_perms and datalen, as those are naturally
  limited to XENSTORE_PAYLOAD_MAX (childlen is different here, as it is
  in theory basically unlimited)

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- new patch
---
 tools/xenstore/utils.h                 |  9 -------
 tools/xenstore/xenstored_core.c        | 35 +++++++++++++++-----------
 tools/xenstore/xenstored_core.h        | 20 ++++++++++++++-
 tools/xenstore/xenstored_transaction.c |  2 +-
 4 files changed, 40 insertions(+), 26 deletions(-)

diff --git a/tools/xenstore/utils.h b/tools/xenstore/utils.h
index 028ecb9d7a..405d662ea2 100644
--- a/tools/xenstore/utils.h
+++ b/tools/xenstore/utils.h
@@ -9,15 +9,6 @@
 
 #include "xenstore_lib.h"
 
-/* Header of the node record in tdb. */
-struct xs_tdb_record_hdr {
-	uint64_t generation;
-	uint32_t num_perms;
-	uint32_t datalen;
-	uint32_t childlen;
-	struct xs_permissions perms[0];
-};
-
 /* Is A == B ? */
 #define streq(a,b) (strcmp((a),(b)) == 0)
 
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index d5c9054fe9..d886d66dd6 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -555,9 +555,9 @@ static void initialize_fds(int *p_sock_pollfd_idx, int *ptimeout)
 	}
 }
 
-struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
+struct node_hdr *db_fetch(const char *db_name, size_t *size)
 {
-	struct xs_tdb_record_hdr *hdr;
+	struct node_hdr *hdr;
 
 	hdr = hashtable_search(nodes, db_name);
 	if (!hdr) {
@@ -565,7 +565,7 @@ struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
 		return NULL;
 	}
 
-	*size = sizeof(*hdr) + hdr->num_perms * sizeof(hdr->perms[0]) +
+	*size = sizeof(*hdr) + hdr->num_perms * sizeof(struct xs_permissions) +
 		hdr->datalen + hdr->childlen;
 
 	trace_tdb("read %s size %zu\n", db_name, *size + strlen(db_name));
@@ -573,10 +573,15 @@ struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
 	return hdr;
 }
 
+static struct xs_permissions *perms_from_node_hdr(struct node_hdr *hdr)
+{
+	return (struct xs_permissions *)(hdr + 1);
+}
+
 static void get_acc_data(const char *name, struct node_account_data *acc)
 {
 	size_t size;
-	struct xs_tdb_record_hdr *hdr;
+	struct node_hdr *hdr;
 
 	if (acc->memory < 0) {
 		hdr = db_fetch(name, &size);
@@ -585,7 +590,7 @@ static void get_acc_data(const char *name, struct node_account_data *acc)
 			acc->memory = 0;
 		} else {
 			acc->memory = size;
-			acc->domid = hdr->perms[0].id;
+			acc->domid = perms_from_node_hdr(hdr)->id;
 		}
 	}
 }
@@ -606,7 +611,7 @@ int db_write(struct connection *conn, const char *db_name, void *data,
 	     size_t size, struct node_account_data *acc,
 	     enum write_node_mode mode, bool no_quota_check)
 {
-	struct xs_tdb_record_hdr *hdr = data;
+	struct node_hdr *hdr = data;
 	struct node_account_data old_acc = {};
 	unsigned int old_domid, new_domid;
 	size_t name_len = strlen(db_name);
@@ -620,7 +625,7 @@ int db_write(struct connection *conn, const char *db_name, void *data,
 
 	get_acc_data(db_name, &old_acc);
 	old_domid = get_acc_domid(conn, db_name, old_acc.domid);
-	new_domid = get_acc_domid(conn, db_name, hdr->perms[0].id);
+	new_domid = get_acc_domid(conn, db_name, perms_from_node_hdr(hdr)->id);
 
 	/*
 	 * Don't check for ENOENT, as we want to be able to switch orphaned
@@ -661,7 +666,7 @@ int db_write(struct connection *conn, const char *db_name, void *data,
 
 	if (acc) {
 		/* Don't use new_domid, as it might be a transaction node. */
-		acc->domid = hdr->perms[0].id;
+		acc->domid = perms_from_node_hdr(hdr)->id;
 		acc->memory = size;
 	}
 
@@ -699,7 +704,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 		       const char *name)
 {
 	size_t size;
-	struct xs_tdb_record_hdr *hdr;
+	struct node_hdr *hdr;
 	struct node *node;
 	const char *db_name;
 	int err;
@@ -733,7 +738,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	node->perms.num = hdr->num_perms;
 	node->datalen = hdr->datalen;
 	node->childlen = hdr->childlen;
-	node->acc.domid = hdr->perms[0].id;
+	node->acc.domid = perms_from_node_hdr(hdr)->id;
 	node->acc.memory = size;
 
 	/* Copy node data to new memory area, starting with permissions. */
@@ -743,7 +748,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 		errno = ENOMEM;
 		goto error;
 	}
-	memcpy(node->perms.p, hdr->perms, size);
+	memcpy(node->perms.p, perms_from_node_hdr(hdr), size);
 
 	/* Permissions are struct xs_permissions. */
 	if (domain_adjust_node_perms(node))
@@ -787,7 +792,7 @@ int write_node_raw(struct connection *conn, const char *db_name,
 	void *data;
 	size_t size;
 	void *p;
-	struct xs_tdb_record_hdr *hdr;
+	struct node_hdr *hdr;
 
 	if (domain_adjust_node_perms(node))
 		return errno;
@@ -814,9 +819,9 @@ int write_node_raw(struct connection *conn, const char *db_name,
 	hdr->datalen = node->datalen;
 	hdr->childlen = node->childlen;
 
-	memcpy(hdr->perms, node->perms.p,
-	       node->perms.num * sizeof(*node->perms.p));
-	p = hdr->perms + node->perms.num;
+	p = perms_from_node_hdr(hdr);
+	memcpy(p, node->perms.p, node->perms.num * sizeof(*node->perms.p));
+	p += node->perms.num * sizeof(*node->perms.p);
 	memcpy(p, node->data, node->datalen);
 	p += node->datalen;
 	memcpy(p, node->children, node->childlen);
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 3c0dd40dfb..968b6f843c 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -168,6 +168,24 @@ struct connection
 };
 extern struct list_head connections;
 
+/*
+ * Header of the node record in the data base.
+ * In the data base the memory of the node is a single memory chunk with the
+ * following format:
+ * struct {
+ *     node_hdr hdr;
+ *     struct xs_permissions perms[hdr.num_perms];
+ *     char data[hdr.datalen];
+ *     char children[hdr.childlen];
+ * };
+ */
+struct node_hdr {
+	uint64_t generation;
+	uint16_t num_perms;
+	uint16_t datalen;
+	uint32_t childlen;
+};
+
 struct node_perms {
 	unsigned int num;
 	struct xs_permissions *p;
@@ -361,7 +379,7 @@ extern xengnttab_handle **xgt_handle;
 int remember_string(struct hashtable *hash, const char *str);
 
 /* Data base access functions. */
-struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size);
+struct node_hdr *db_fetch(const char *db_name, size_t *size);
 int db_write(struct connection *conn, const char *db_name, void *data,
 	     size_t size, struct node_account_data *acc,
 	     enum write_node_mode mode, bool no_quota_check);
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index e3e05a1d84..77c14f4c24 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -357,7 +357,7 @@ static int finalize_transaction(struct connection *conn,
 {
 	struct accessed_node *i, *n;
 	size_t size;
-	struct xs_tdb_record_hdr *hdr;
+	struct node_hdr *hdr;
 	uint64_t gen;
 	int flag;
 
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:09:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:09:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560992.877243 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl1p-0001x1-6P; Mon, 10 Jul 2023 07:09:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560992.877243; Mon, 10 Jul 2023 07:09:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl1o-0001u6-VR; Mon, 10 Jul 2023 07:09:48 +0000
Received: by outflank-mailman (input) for mailman id 560992;
 Mon, 10 Jul 2023 07:09:47 +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 <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIkt6-0002bQ-M1
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:00:48 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7edcca85-1eef-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 09:00:47 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id D7A701F8BF;
 Mon, 10 Jul 2023 07:00:46 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A8C6F1361C;
 Mon, 10 Jul 2023 07:00:46 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id V8aIJ56sq2QSYwAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 07:00:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7edcca85-1eef-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972446; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=/yrCEroex0VDLTJaLozI/wdv3DQR1vU/0IqPsVNjH/o=;
	b=BOyRa5SL2Gwy3BOMkd+QiMZB2KdhnkXLwkqhM5TPBXNArSJku6OTyfSgSkX58p4TPbXb4i
	0E8APxRrO/gUIu5hmW46j/gWSkMjnZR2xhR32jck5pUuCHwoq9U4ko9KccVNmYDGuxJLE5
	S/RtZDstzWzSonwoiolhrmv9arB7B+s=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 10/18] tools/xenstore: add hashtable_replace() function
Date: Mon, 10 Jul 2023 08:59:39 +0200
Message-Id: <20230710065947.4201-11-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230710065947.4201-1-jgross@suse.com>
References: <20230710065947.4201-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

For an effective way to replace a hashtable entry add a new function
hashtable_replace().

While at it let hashtable_add() fail if an entry with the specified
key does already exist.

This is in preparation to replace TDB with a more simple data storage.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstore/hashtable.c | 20 ++++++++++++++++++++
 tools/xenstore/hashtable.h | 16 ++++++++++++++++
 2 files changed, 36 insertions(+)

diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c
index 29c247f918..0c26a09567 100644
--- a/tools/xenstore/hashtable.c
+++ b/tools/xenstore/hashtable.c
@@ -160,6 +160,7 @@ static struct entry *hashtable_search_entry(const struct hashtable *h,
 
     return NULL;
 }
+
 int hashtable_add(struct hashtable *h, const void *k, void *v)
 {
     unsigned int index;
@@ -204,6 +205,25 @@ void *hashtable_search(const struct hashtable *h, const void *k)
     return e ? e->v : NULL;
 }
 
+int hashtable_replace(struct hashtable *h, const void *k, void *v)
+{
+    struct entry *e;
+
+    e = hashtable_search_entry(h, k);
+    if (!e)
+        return ENOENT;
+
+    if (h->flags & HASHTABLE_FREE_VALUE)
+    {
+        talloc_free(e->v);
+        talloc_steal(e, v);
+    }
+
+    e->v = v;
+
+    return 0;
+}
+
 void
 hashtable_remove(struct hashtable *h, const void *k)
 {
diff --git a/tools/xenstore/hashtable.h b/tools/xenstore/hashtable.h
index 792f6cda7b..214aea1b3d 100644
--- a/tools/xenstore/hashtable.h
+++ b/tools/xenstore/hashtable.h
@@ -51,6 +51,22 @@ create_hashtable(const void *ctx, const char *name,
 int
 hashtable_add(struct hashtable *h, const void *k, void *v);
 
+/*****************************************************************************
+ * hashtable_replace
+
+ * @name        hashtable_nsert
+ * @param   h   the hashtable to insert into
+ * @param   k   the key - hashtable claims ownership and will free on removal
+ * @param   v   the value - does not claim ownership
+ * @return      zero for successful insertion
+ *
+ * This function does check for an entry being present before replacing it
+ * with a new value.
+ */
+
+int
+hashtable_replace(struct hashtable *h, const void *k, void *v);
+
 /*****************************************************************************
  * hashtable_search
    
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:09:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:09:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560993.877251 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl1p-00023E-JX; Mon, 10 Jul 2023 07:09:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560993.877251; Mon, 10 Jul 2023 07:09:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl1p-00021i-AB; Mon, 10 Jul 2023 07:09:49 +0000
Received: by outflank-mailman (input) for mailman id 560993;
 Mon, 10 Jul 2023 07:09:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIkte-0002xd-1M
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:01:22 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 92f97648-1eef-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 09:01:20 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 9A30D1F747;
 Mon, 10 Jul 2023 07:01:20 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 70D2D1361C;
 Mon, 10 Jul 2023 07:01:20 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id x54CGsCsq2RcYwAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 07:01:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 92f97648-1eef-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972480; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=WtP2Hvcsee1BM5wHnt6iDRDNOfzjthZIJA5g4uTEXwA=;
	b=gVkW1LejfaGi0WjC/p5Rk+dFanCqsWn8urSWKbp5Bg8l6768qjVvSt+8IyUgFE36IUjsIe
	ffpyBQlBN8Qp98Kopy1BOXhJKrWRCjt7TDEEWdkUOp7yZAQ3ZU/6IQzht+gF7FNdZ6m0+p
	d7f2rpN1XBml1SXnDnKvdf0lKgUnB5A=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 16/18] tools/xenstore: don't use struct node_perms in struct node
Date: Mon, 10 Jul 2023 08:59:45 +0200
Message-Id: <20230710065947.4201-17-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230710065947.4201-1-jgross@suse.com>
References: <20230710065947.4201-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Open code struct node_perms in struct node in order to prepare using
struct node_hdr in struct node.

Add two helpers to transfer permissions between struct node and struct
node_perms.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- new patch
---
 tools/xenstore/xenstored_core.c        | 78 ++++++++++++++------------
 tools/xenstore/xenstored_core.h        | 21 ++++++-
 tools/xenstore/xenstored_domain.c      | 13 ++---
 tools/xenstore/xenstored_transaction.c |  8 +--
 tools/xenstore/xenstored_watch.c       |  7 ++-
 5 files changed, 76 insertions(+), 51 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index d886d66dd6..9f0e56a149 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -735,7 +735,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 
 	/* Datalen, childlen, number of permissions */
 	node->generation = hdr->generation;
-	node->perms.num = hdr->num_perms;
+	node->num_perms = hdr->num_perms;
 	node->datalen = hdr->datalen;
 	node->childlen = hdr->childlen;
 	node->acc.domid = perms_from_node_hdr(hdr)->id;
@@ -743,12 +743,12 @@ struct node *read_node(struct connection *conn, const void *ctx,
 
 	/* Copy node data to new memory area, starting with permissions. */
 	size -= sizeof(*hdr);
-	node->perms.p = talloc_size(node, size);
-	if (node->perms.p == NULL) {
+	node->perms = talloc_size(node, size);
+	if (node->perms == NULL) {
 		errno = ENOMEM;
 		goto error;
 	}
-	memcpy(node->perms.p, perms_from_node_hdr(hdr), size);
+	memcpy(node->perms, perms_from_node_hdr(hdr), size);
 
 	/* Permissions are struct xs_permissions. */
 	if (domain_adjust_node_perms(node))
@@ -759,7 +759,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 		node->acc.memory = 0;
 
 	/* Data is binary blob (usually ascii, no nul). */
-	node->data = node->perms.p + hdr->num_perms;
+	node->data = node->perms + hdr->num_perms;
 	/* Children is strings, nul separated. */
 	node->children = node->data + node->datalen;
 
@@ -798,7 +798,7 @@ int write_node_raw(struct connection *conn, const char *db_name,
 		return errno;
 
 	size = sizeof(*hdr)
-		+ node->perms.num * sizeof(node->perms.p[0])
+		+ node->num_perms * sizeof(node->perms[0])
 		+ node->datalen + node->childlen;
 
 	/* Call domain_max_chk() in any case in order to record max values. */
@@ -815,13 +815,13 @@ int write_node_raw(struct connection *conn, const char *db_name,
 
 	hdr = data;
 	hdr->generation = node->generation;
-	hdr->num_perms = node->perms.num;
+	hdr->num_perms = node->num_perms;
 	hdr->datalen = node->datalen;
 	hdr->childlen = node->childlen;
 
 	p = perms_from_node_hdr(hdr);
-	memcpy(p, node->perms.p, node->perms.num * sizeof(*node->perms.p));
-	p += node->perms.num * sizeof(*node->perms.p);
+	memcpy(p, node->perms, node->num_perms * sizeof(*node->perms));
+	p += node->num_perms * sizeof(*node->perms);
 	memcpy(p, node->data, node->datalen);
 	p += node->datalen;
 	memcpy(p, node->children, node->childlen);
@@ -902,6 +902,7 @@ static int ask_parents(struct connection *conn, const void *ctx,
 		       const char *name, unsigned int *perm)
 {
 	struct node *node;
+	struct node_perms perms;
 
 	do {
 		name = get_parent(ctx, name);
@@ -921,7 +922,8 @@ static int ask_parents(struct connection *conn, const void *ctx,
 		return 0;
 	}
 
-	*perm = perm_for_conn(conn, &node->perms);
+	node_to_node_perms(node, &perms);
+	*perm = perm_for_conn(conn, &perms);
 	return 0;
 }
 
@@ -958,11 +960,13 @@ static struct node *get_node(struct connection *conn,
 			     unsigned int perm)
 {
 	struct node *node;
+	struct node_perms perms;
 
 	node = read_node(conn, ctx, name);
 	/* If we don't have permission, we don't have node. */
 	if (node) {
-		if ((perm_for_conn(conn, &node->perms) & perm) != perm) {
+		node_to_node_perms(node, &perms);
+		if ((perm_for_conn(conn, &perms) & perm) != perm) {
 			errno = EACCES;
 			node = NULL;
 		}
@@ -1432,14 +1436,14 @@ static struct node *construct_node(struct connection *conn, const void *ctx,
 		node->name = talloc_steal(node, names[levels - 1]);
 
 		/* Inherit permissions, unpriv domains own what they create. */
-		node->perms.num = parent->perms.num;
-		node->perms.p = talloc_memdup(node, parent->perms.p,
-					      node->perms.num *
-					      sizeof(*node->perms.p));
-		if (!node->perms.p)
+		node->num_perms = parent->num_perms;
+		node->perms = talloc_memdup(node, parent->perms,
+					    node->num_perms *
+					    sizeof(*node->perms));
+		if (!node->perms)
 			goto nomem;
 		if (domain_is_unprivileged(conn))
-			node->perms.p[0].id = conn->id;
+			node->perms[0].id = conn->id;
 
 		/* No children, no data */
 		node->children = node->data = NULL;
@@ -1762,12 +1766,14 @@ static int do_get_perms(const void *ctx, struct connection *conn,
 	struct node *node;
 	char *strings;
 	unsigned int len;
+	struct node_perms perms;
 
 	node = get_spec_node(conn, ctx, onearg(in), NULL, XS_PERM_READ);
 	if (!node)
 		return errno;
 
-	strings = perms_to_strings(node, &node->perms, &len);
+	node_to_node_perms(node, &perms);
+	strings = perms_to_strings(node, &perms, &len);
 	if (!strings)
 		return errno;
 
@@ -1815,10 +1821,10 @@ static int do_set_perms(const void *ctx, struct connection *conn,
 	    perms.p[0].id != get_node_owner(node))
 		return EPERM;
 
-	old_perms = node->perms;
+	node_to_node_perms(node, &old_perms);
 	if (domain_nbentry_dec(conn, get_node_owner(node)))
 		return ENOMEM;
-	node->perms = perms;
+	node_perms_to_node(&perms, node);
 	if (domain_nbentry_inc(conn, get_node_owner(node)))
 		return ENOMEM;
 
@@ -2330,8 +2336,8 @@ static void manual_node(const char *name, const char *child)
 		barf_perror("Could not allocate initial node %s", name);
 
 	node->name = name;
-	node->perms.p = &perms;
-	node->perms.num = 1;
+	node->perms = &perms;
+	node->num_perms = 1;
 	node->children = (char *)child;
 	if (child)
 		node->childlen = strlen(child) + 1;
@@ -3202,10 +3208,10 @@ static int dump_state_node(const void *ctx, struct connection *conn,
 	sn.conn_id = 0;
 	sn.ta_id = 0;
 	sn.ta_access = 0;
-	sn.perm_n = node->perms.num;
+	sn.perm_n = node->num_perms;
 	sn.path_len = pathlen;
 	sn.data_len = node->datalen;
-	head.length += node->perms.num * sizeof(*sn.perms);
+	head.length += node->num_perms * sizeof(*sn.perms);
 	head.length += pathlen;
 	head.length += node->datalen;
 	head.length = ROUNDUP(head.length, 3);
@@ -3215,7 +3221,7 @@ static int dump_state_node(const void *ctx, struct connection *conn,
 	if (fwrite(&sn, sizeof(sn), 1, fp) != 1)
 		return dump_state_node_err(data, "Dump node state error");
 
-	ret = dump_state_node_perms(fp, node->perms.p, node->perms.num);
+	ret = dump_state_node_perms(fp, node->perms, node->num_perms);
 	if (ret)
 		return dump_state_node_err(data, ret);
 
@@ -3412,29 +3418,29 @@ void read_state_node(const void *ctx, const void *state)
 	node->data = name + sn->path_len;
 	node->childlen = 0;
 	node->children = NULL;
-	node->perms.num = sn->perm_n;
-	node->perms.p = talloc_array(node, struct xs_permissions,
-				     node->perms.num);
-	if (!node->perms.p)
+	node->num_perms = sn->perm_n;
+	node->perms = talloc_array(node, struct xs_permissions,
+				   node->num_perms);
+	if (!node->perms)
 		barf("allocation error restoring node");
-	for (i = 0; i < node->perms.num; i++) {
+	for (i = 0; i < node->num_perms; i++) {
 		switch (sn->perms[i].access) {
 		case 'r':
-			node->perms.p[i].perms = XS_PERM_READ;
+			node->perms[i].perms = XS_PERM_READ;
 			break;
 		case 'w':
-			node->perms.p[i].perms = XS_PERM_WRITE;
+			node->perms[i].perms = XS_PERM_WRITE;
 			break;
 		case 'b':
-			node->perms.p[i].perms = XS_PERM_READ | XS_PERM_WRITE;
+			node->perms[i].perms = XS_PERM_READ | XS_PERM_WRITE;
 			break;
 		default:
-			node->perms.p[i].perms = XS_PERM_NONE;
+			node->perms[i].perms = XS_PERM_NONE;
 			break;
 		}
 		if (sn->perms[i].flags & XS_STATE_NODE_PERM_IGNORE)
-			node->perms.p[i].perms |= XS_PERM_IGNORE;
-		node->perms.p[i].id = sn->perms[i].domid;
+			node->perms[i].perms |= XS_PERM_IGNORE;
+		node->perms[i].id = sn->perms[i].domid;
 	}
 
 	if (!strstarts(name, "@")) {
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 968b6f843c..c706d30b63 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -209,7 +209,8 @@ struct node {
 #define NO_GENERATION ~((uint64_t)0)
 
 	/* Permissions. */
-	struct node_perms perms;
+	unsigned int num_perms;
+	struct xs_permissions *perms;
 
 	/* Contents. */
 	unsigned int datalen;
@@ -250,7 +251,23 @@ unsigned int perm_for_conn(struct connection *conn,
 /* Get owner of a node. */
 static inline unsigned int get_node_owner(const struct node *node)
 {
-	return node->perms.p[0].id;
+	return node->perms[0].id;
+}
+
+/* Transfer permissions from node to struct node_perms. */
+static inline void node_to_node_perms(const struct node *node,
+				      struct node_perms *perms)
+{
+	perms->num = node->num_perms;
+	perms->p = node->perms;
+}
+
+/* Transfer permissions from struct node_perms to node. */
+static inline void node_perms_to_node(const struct node_perms *perms,
+				      struct node *node)
+{
+	node->num_perms = perms->num;
+	node->perms = perms->p;
 }
 
 /* Write a node to the data base. */
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index d8810fa353..b17402fe11 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -513,12 +513,12 @@ static int domain_tree_remove_sub(const void *ctx, struct connection *conn,
 	struct domain *domain = arg;
 	int ret = WALK_TREE_OK;
 
-	if (node->perms.p[0].id != domain->domid)
+	if (node->perms[0].id != domain->domid)
 		return WALK_TREE_OK;
 
 	if (keep_orphans) {
 		domain_nbentry_dec(NULL, domain->domid);
-		node->perms.p[0].id = priv_domid;
+		node->perms[0].id = priv_domid;
 		node->acc.memory = 0;
 		domain_nbentry_inc(NULL, priv_domid);
 		if (write_node_raw(NULL, node->name, node, NODE_MODIFY, true)) {
@@ -1335,12 +1335,11 @@ int domain_adjust_node_perms(struct node *node)
 {
 	unsigned int i;
 
-	for (i = 1; i < node->perms.num; i++) {
-		if (node->perms.p[i].perms & XS_PERM_IGNORE)
+	for (i = 1; i < node->num_perms; i++) {
+		if (node->perms[i].perms & XS_PERM_IGNORE)
 			continue;
-		if (!chk_domain_generation(node->perms.p[i].id,
-					   node->generation))
-			node->perms.p[i].perms |= XS_PERM_IGNORE;
+		if (!chk_domain_generation(node->perms[i].id, node->generation))
+			node->perms[i].perms |= XS_PERM_IGNORE;
 	}
 
 	return 0;
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 77c14f4c24..e39df3a82d 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -259,13 +259,13 @@ int access_node(struct connection *conn, struct node *node,
 		if (!i->trans_name)
 			goto nomem;
 		i->node = strchr(i->trans_name, '/') + 1;
-		if (node->generation != NO_GENERATION && node->perms.num) {
+		if (node->generation != NO_GENERATION && node->num_perms) {
 			i->perms.p = talloc_array(i, struct xs_permissions,
-						  node->perms.num);
+						  node->num_perms);
 			if (!i->perms.p)
 				goto nomem;
-			i->perms.num = node->perms.num;
-			memcpy(i->perms.p, node->perms.p,
+			i->perms.num = node->num_perms;
+			memcpy(i->perms.p, node->perms,
 			       i->perms.num * sizeof(*i->perms.p));
 		}
 
diff --git a/tools/xenstore/xenstored_watch.c b/tools/xenstore/xenstored_watch.c
index 4195c59e17..10645f762d 100644
--- a/tools/xenstore/xenstored_watch.c
+++ b/tools/xenstore/xenstored_watch.c
@@ -79,6 +79,7 @@ static bool watch_permitted(struct connection *conn, const void *ctx,
 	unsigned int perm;
 	struct node *parent;
 	char *parent_name;
+	struct node_perms node_perms;
 
 	if (perms) {
 		perm = perm_for_conn(conn, perms);
@@ -92,7 +93,8 @@ static bool watch_permitted(struct connection *conn, const void *ctx,
 			return false;
 	}
 
-	perm = perm_for_conn(conn, &node->perms);
+	node_to_node_perms(node, &node_perms);
+	perm = perm_for_conn(conn, &node_perms);
 	if (perm & XS_PERM_READ)
 		return true;
 
@@ -106,7 +108,8 @@ static bool watch_permitted(struct connection *conn, const void *ctx,
 			return false;
 	}
 
-	perm = perm_for_conn(conn, &parent->perms);
+	node_to_node_perms(parent, &node_perms);
+	perm = perm_for_conn(conn, &node_perms);
 
 	return perm & XS_PERM_READ;
 }
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:10:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:10:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.560995.877271 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl1s-0002yI-Uw; Mon, 10 Jul 2023 07:09:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 560995.877271; Mon, 10 Jul 2023 07:09:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl1s-0002y5-S4; Mon, 10 Jul 2023 07:09:52 +0000
Received: by outflank-mailman (input) for mailman id 560995;
 Mon, 10 Jul 2023 07:09:52 +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 <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIkt1-0002bQ-0o
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:00:43 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7b82f9d1-1eef-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 09:00:41 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 419821F747;
 Mon, 10 Jul 2023 07:00:41 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 14BA41361C;
 Mon, 10 Jul 2023 07:00:41 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 0DKOA5msq2QGYwAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 07:00:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7b82f9d1-1eef-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972441; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=HISzN7bRVjI3VR79BWGkvbZ0+p8FLjRndAnfEz4SFQg=;
	b=OM+Tbvc9TedBnMetKo/FIcOn6GO0WQ85CUvpTwDI12eRgoiK9cjz54V1lSh3gQnWTZv0+p
	GmeokX41MdR/LxXWG4tAcXakn3a8PklZNoMDWjedjfxNpBpNgXFFY4kke01CpVt1UINvt2
	dx8fSc6C/1PWR2uVj2hfMTQfc6sselA=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 09/18] tools/xenstore: let hashtable_add() fail in case of existing entry
Date: Mon, 10 Jul 2023 08:59:38 +0200
Message-Id: <20230710065947.4201-10-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230710065947.4201-1-jgross@suse.com>
References: <20230710065947.4201-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Silently adding another entry with the same key to a hashtable is a
perfect receipt for later failure with hard to diagnose symptoms.

Let hashtable_add() fail in case another entry with the same key is
already existing.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- split off from next patch (Julien Grall)
- fix coding style (Julien Grall)
- use for () loop (Julien Grall)
---
 tools/xenstore/hashtable.c | 39 ++++++++++++++++++++++++++------------
 1 file changed, 27 insertions(+), 12 deletions(-)

diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c
index 9daddd9782..29c247f918 100644
--- a/tools/xenstore/hashtable.c
+++ b/tools/xenstore/hashtable.c
@@ -141,11 +141,33 @@ static int hashtable_expand(struct hashtable *h)
     return 0;
 }
 
+static struct entry *hashtable_search_entry(const struct hashtable *h,
+                                            const void *k)
+{
+    struct entry *e;
+    unsigned int hashvalue, index;
+
+    hashvalue = hash(h, k);
+    index = indexFor(h->tablelength, hashvalue);
+    e = h->table[index];
+
+    for (e = h->table[index]; e; e = e->next)
+    {
+        /* Check hash value to short circuit heavier comparison */
+        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
+            return e;
+    }
+
+    return NULL;
+}
 int hashtable_add(struct hashtable *h, const void *k, void *v)
 {
-    /* This method allows duplicate keys - but they shouldn't be used */
     unsigned int index;
     struct entry *e;
+
+    if (hashtable_search_entry(h, k))
+        return EEXIST;
+
     if (++(h->entrycount) > h->loadlimit)
     {
         /* Ignore the return value. If expand fails, we should
@@ -176,17 +198,10 @@ int hashtable_add(struct hashtable *h, const void *k, void *v)
 void *hashtable_search(const struct hashtable *h, const void *k)
 {
     struct entry *e;
-    unsigned int hashvalue, index;
-    hashvalue = hash(h,k);
-    index = indexFor(h->tablelength,hashvalue);
-    e = h->table[index];
-    while (NULL != e)
-    {
-        /* Check hash value to short circuit heavier comparison */
-        if ((hashvalue == e->h) && (h->eqfn(k, e->k))) return e->v;
-        e = e->next;
-    }
-    return NULL;
+
+    e = hashtable_search_entry(h, k);
+
+    return e ? e->v : NULL;
 }
 
 void
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:10:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:10:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561004.877286 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl23-0004Hs-OO; Mon, 10 Jul 2023 07:10:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561004.877286; Mon, 10 Jul 2023 07:10:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl23-0004Gb-G0; Mon, 10 Jul 2023 07:10:03 +0000
Received: by outflank-mailman (input) for mailman id 561004;
 Mon, 10 Jul 2023 07:10:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIktB-0002xd-Un
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:00:53 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8235cea3-1eef-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 09:00:52 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 7E48421E91;
 Mon, 10 Jul 2023 07:00:52 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4CA0B1361C;
 Mon, 10 Jul 2023 07:00:52 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id pTM4EaSsq2QgYwAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 07:00:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8235cea3-1eef-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972452; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=L9wkqTCyOjGjiu/WtVNnaatoSAz4S33Tyi60lW8cADE=;
	b=vXZvqyklLjIhkBkbKZ5EF4zNFYmCqZpjYoeGcJ14N7NFil/lzVSLDOmKAlUlFo30zU77Ah
	IESp0RORqr+USuB9SMnROHq1uwRCAZwUg8PlRa4FHh9KkJJMQCM/6q+FwPL18RIlvfWXgD
	Um3wQAYfNoztBzclilwiFVgOokMWIL8=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 11/18] tools/xenstore: drop use of tdb
Date: Mon, 10 Jul 2023 08:59:40 +0200
Message-Id: <20230710065947.4201-12-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230710065947.4201-1-jgross@suse.com>
References: <20230710065947.4201-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Today all Xenstore nodes are stored in a TDB data base. This data base
has several disadvantages:

- It is using a fixed sized hash table, resulting in high memory
  overhead for small installations with only very few VMs, and a rather
  large performance hit for systems with lots of VMs due to many
  collisions.
  The hash table size today is 7919 entries. This means that e.g. in
  case of a simple desktop use case with 2 or 3 VMs probably far less
  than 10% of the entries will be used (assuming roughly 100 nodes per
  VM). OTOH a setup on a large server with 500 VMs would result in
  heavy conflicts in the hash list with 5-10 nodes per hash table entry.

- TDB is using a single large memory area for storing the nodes. It
  only ever increases this area and will never shrink it afterwards.
  This will result in more memory usage than necessary after a peak of
  Xenstore usage.

- Xenstore is only single-threaded, while TDB is designed to be fit
  for multi-threaded use cases, resulting in much higher code
  complexity than needed.

- Special use cases of Xenstore are not possible to implement with TDB
  in an effective way, while an implementation of a data base tailored
  for Xenstore could simplify some handling (e.g. transactions) a lot.

So drop using TDB and store the nodes directly in memory making them
easily accessible. Use a hash-based lookup mechanism for fast lookup
of nodes by their full path.

For now only replace TDB keeping the current access functions.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- add const (Julien Grall)
- use specific pointer type instead of void * (Julien Grall)
- add comment to db_fetch() (Julien Grall)
---
 tools/xenstore/xenstored_core.c        | 158 ++++++++++---------------
 tools/xenstore/xenstored_core.h        |   5 +-
 tools/xenstore/xenstored_transaction.c |   1 -
 3 files changed, 64 insertions(+), 100 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 70db5265ad..ff10659e65 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -53,7 +53,6 @@
 #include "xenstored_domain.h"
 #include "xenstored_control.h"
 #include "xenstored_lu.h"
-#include "tdb.h"
 
 #ifndef NO_SOCKETS
 #if defined(HAVE_SYSTEMD)
@@ -85,7 +84,7 @@ bool keep_orphans = false;
 static int reopen_log_pipe[2];
 static int reopen_log_pipe0_pollfd_idx = -1;
 char *tracefile = NULL;
-static TDB_CONTEXT *tdb_ctx = NULL;
+static struct hashtable *nodes;
 unsigned int trace_flags = TRACE_OBJ | TRACE_IO;
 
 static const char *sockmsg_string(enum xsd_sockmsg_type type);
@@ -556,32 +555,32 @@ static void initialize_fds(int *p_sock_pollfd_idx, int *ptimeout)
 	}
 }
 
-static void set_tdb_key(const char *name, TDB_DATA *key)
-{
-	/*
-	 * Dropping const is fine here, as the key will never be modified
-	 * by TDB.
-	 */
-	key->dptr = (char *)name;
-	key->dsize = strlen(name);
-}
-
 struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
 {
-	TDB_DATA key, data;
+	const struct xs_tdb_record_hdr *hdr;
+	struct xs_tdb_record_hdr *p;
 
-	set_tdb_key(db_name, &key);
-	data = tdb_fetch(tdb_ctx, key);
-	if (!data.dptr) {
-		errno = (tdb_error(tdb_ctx) == TDB_ERR_NOEXIST) ? ENOENT : EIO;
-		*size = 0;
-	} else {
-		*size = data.dsize;
-		trace_tdb("read %s size %zu\n", db_name,
-			  *size + strlen(db_name));
+	hdr = hashtable_search(nodes, db_name);
+	if (!hdr) {
+		errno = ENOENT;
+		return NULL;
 	}
 
-	return (struct xs_tdb_record_hdr *)data.dptr;
+	*size = sizeof(*hdr) + hdr->num_perms * sizeof(hdr->perms[0]) +
+		hdr->datalen + hdr->childlen;
+
+	p = talloc_size(NULL, *size);
+	if (!p) {
+		errno = ENOMEM;
+		return NULL;
+	}
+
+	trace_tdb("read %s size %zu\n", db_name, *size + strlen(db_name));
+
+	/* Return a copy, avoiding a potential modification in the DB. */
+	memcpy(p, hdr, *size);
+
+	return p;
 }
 
 static void get_acc_data(const char *name, struct node_account_data *acc)
@@ -621,12 +620,10 @@ int db_write(struct connection *conn, const char *db_name, void *data,
 	struct xs_tdb_record_hdr *hdr = data;
 	struct node_account_data old_acc = {};
 	unsigned int old_domid, new_domid;
+	size_t name_len = strlen(db_name);
+	const char *name;
 	int ret;
-	TDB_DATA key, dat;
 
-	set_tdb_key(db_name, &key);
-	dat.dptr = data;
-	dat.dsize = size;
 	if (!acc)
 		old_acc.memory = -1;
 	else
@@ -642,29 +639,36 @@ int db_write(struct connection *conn, const char *db_name, void *data,
 	 */
 	if (old_acc.memory)
 		domain_memory_add_nochk(conn, old_domid,
-					-old_acc.memory - key.dsize);
-	ret = domain_memory_add(conn, new_domid, size + key.dsize,
+					-old_acc.memory - name_len);
+	ret = domain_memory_add(conn, new_domid, size + name_len,
 				no_quota_check);
 	if (ret) {
 		/* Error path, so no quota check. */
 		if (old_acc.memory)
 			domain_memory_add_nochk(conn, old_domid,
-						old_acc.memory + key.dsize);
+						old_acc.memory + name_len);
 		return ret;
 	}
 
-	/* TDB should set errno, but doesn't even set ecode AFAICT. */
-	if (tdb_store(tdb_ctx, key, dat,
-		      (mode == NODE_CREATE) ? TDB_INSERT : TDB_MODIFY) != 0) {
-		domain_memory_add_nochk(conn, new_domid, -size - key.dsize);
+	if (mode == NODE_CREATE) {
+		/* db_name could be modified later, so allocate a copy. */
+		name = talloc_strdup(data, db_name);
+		ret = name ? hashtable_add(nodes, name, data) : ENOMEM;
+	} else
+		ret = hashtable_replace(nodes, db_name, data);
+
+	if (ret) {
+		/* Free data, as it isn't owned by hashtable now. */
+		talloc_free(data);
+		domain_memory_add_nochk(conn, new_domid, -size - name_len);
 		/* Error path, so no quota check. */
 		if (old_acc.memory)
 			domain_memory_add_nochk(conn, old_domid,
-						old_acc.memory + key.dsize);
-		errno = EIO;
+						old_acc.memory + name_len);
+		errno = ret;
 		return errno;
 	}
-	trace_tdb("store %s size %zu\n", db_name, size + key.dsize);
+	trace_tdb("store %s size %zu\n", db_name, size + name_len);
 
 	if (acc) {
 		/* Don't use new_domid, as it might be a transaction node. */
@@ -680,9 +684,6 @@ int db_delete(struct connection *conn, const char *name,
 {
 	struct node_account_data tmp_acc;
 	unsigned int domid;
-	TDB_DATA key;
-
-	set_tdb_key(name, &key);
 
 	if (!acc) {
 		acc = &tmp_acc;
@@ -691,15 +692,13 @@ int db_delete(struct connection *conn, const char *name,
 
 	get_acc_data(name, acc);
 
-	if (tdb_delete(tdb_ctx, key)) {
-		errno = EIO;
-		return errno;
-	}
+	hashtable_remove(nodes, name);
 	trace_tdb("delete %s\n", name);
 
 	if (acc->memory) {
 		domid = get_acc_domid(conn, name, acc->domid);
-		domain_memory_add_nochk(conn, domid, -acc->memory - key.dsize);
+		domain_memory_add_nochk(conn, domid,
+					-acc->memory - strlen(name));
 	}
 
 	return 0;
@@ -2349,43 +2348,29 @@ static void manual_node(const char *name, const char *child)
 	talloc_free(node);
 }
 
-static void tdb_logger(TDB_CONTEXT *tdb, int level, const char * fmt, ...)
+static unsigned int hash_from_key_fn(const void *k)
 {
-	va_list ap;
-	char *s;
-	int saved_errno = errno;
+	const char *str = k;
+	unsigned int hash = 5381;
+	char c;
 
-	va_start(ap, fmt);
-	s = talloc_vasprintf(NULL, fmt, ap);
-	va_end(ap);
+	while ((c = *str++))
+		hash = ((hash << 5) + hash) + (unsigned int)c;
 
-	if (s) {
-		trace("TDB: %s\n", s);
-		syslog(LOG_ERR, "TDB: %s",  s);
-		if (verbose)
-			xprintf("TDB: %s", s);
-		talloc_free(s);
-	} else {
-		trace("talloc failure during logging\n");
-		syslog(LOG_ERR, "talloc failure during logging\n");
-	}
+	return hash;
+}
 
-	errno = saved_errno;
+static int keys_equal_fn(const void *key1, const void *key2)
+{
+	return 0 == strcmp(key1, key2);
 }
 
 void setup_structure(bool live_update)
 {
-	char *tdbname;
-
-	tdbname = talloc_strdup(talloc_autofree_context(), "/dev/mem");
-	if (!tdbname)
-		barf_perror("Could not create tdbname");
-
-	tdb_ctx = tdb_open_ex(tdbname, 7919, TDB_INTERNAL | TDB_NOLOCK,
-			      O_RDWR | O_CREAT | O_EXCL | O_CLOEXEC,
-			      0640, &tdb_logger, NULL);
-	if (!tdb_ctx)
-		barf_perror("Could not create tdb file %s", tdbname);
+	nodes = create_hashtable(NULL, "nodes", hash_from_key_fn, keys_equal_fn,
+				 HASHTABLE_FREE_KEY | HASHTABLE_FREE_VALUE);
+	if (!nodes)
+		barf_perror("Could not create nodes hashtable");
 
 	if (live_update)
 		manual_node("/", NULL);
@@ -2399,24 +2384,6 @@ void setup_structure(bool live_update)
 	}
 }
 
-static unsigned int hash_from_key_fn(const void *k)
-{
-	const char *str = k;
-	unsigned int hash = 5381;
-	char c;
-
-	while ((c = *str++))
-		hash = ((hash << 5) + hash) + (unsigned int)c;
-
-	return hash;
-}
-
-
-static int keys_equal_fn(const void *key1, const void *key2)
-{
-	return 0 == strcmp(key1, key2);
-}
-
 int remember_string(struct hashtable *hash, const char *str)
 {
 	char *k = talloc_strdup(NULL, str);
@@ -2476,12 +2443,11 @@ static int check_store_enoent(const void *ctx, struct connection *conn,
 /**
  * Helper to clean_store below.
  */
-static int clean_store_(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA val,
-			void *private)
+static int clean_store_(const void *key, void *val, void *private)
 {
 	struct hashtable *reachable = private;
 	char *slash;
-	char * name = talloc_strndup(NULL, key.dptr, key.dsize);
+	char *name = talloc_strdup(NULL, key);
 
 	if (!name) {
 		log("clean_store: ENOMEM");
@@ -2511,7 +2477,7 @@ static int clean_store_(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA val,
  */
 static void clean_store(struct check_store_data *data)
 {
-	tdb_traverse(tdb_ctx, &clean_store_, data->reachable);
+	hashtable_iterate(nodes, clean_store_, data->reachable);
 	domain_check_acc(data->domains);
 }
 
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 590d1b0a1f..5d96799c60 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -33,7 +33,6 @@
 #include "xenstore_lib.h"
 #include "xenstore_state.h"
 #include "list.h"
-#include "tdb.h"
 #include "hashtable.h"
 
 #ifndef O_CLOEXEC
@@ -236,7 +235,7 @@ static inline unsigned int get_node_owner(const struct node *node)
 	return node->perms.p[0].id;
 }
 
-/* Write a node to the tdb data base. */
+/* Write a node to the data base. */
 enum write_node_mode {
 	NODE_CREATE,
 	NODE_MODIFY
@@ -246,7 +245,7 @@ int write_node_raw(struct connection *conn, const char *db_name,
 		   struct node *node, enum write_node_mode mode,
 		   bool no_quota_check);
 
-/* Get a node from the tdb data base. */
+/* Get a node from the data base. */
 struct node *read_node(struct connection *conn, const void *ctx,
 		       const char *name);
 
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 7d8c0afc6a..420645e55d 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -396,7 +396,6 @@ static int finalize_transaction(struct connection *conn,
 				       ? NODE_CREATE : NODE_MODIFY;
 				*is_corrupt |= db_write(conn, i->node, hdr,
 							size, NULL, flag, true);
-				talloc_free(hdr);
 				if (db_delete(conn, i->trans_name, NULL))
 					*is_corrupt = true;
 			} else {
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:10:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:10:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561006.877301 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl25-0004xV-G3; Mon, 10 Jul 2023 07:10:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561006.877301; Mon, 10 Jul 2023 07:10:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl25-0004vO-6i; Mon, 10 Jul 2023 07:10:05 +0000
Received: by outflank-mailman (input) for mailman id 561006;
 Mon, 10 Jul 2023 07:10:02 +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 <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIktK-0002bQ-Hh
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:01:02 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 859fe2fc-1eef-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 09:00:58 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 34E801F747;
 Mon, 10 Jul 2023 07:00:58 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E7F4E1361C;
 Mon, 10 Jul 2023 07:00:57 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id /6E7N6msq2QqYwAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 07:00:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 859fe2fc-1eef-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972458; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=f8c0WZkiA2sRwo/5ZKpm9mv0MPjHkD48eHCwmRexE5o=;
	b=Ylx++L9vpm8CgsdBVFklANbENhjCQ0VFfIzVSgni7cyX9IraSCLoQilBGSxL17MQudhtWU
	o6BSnUW8U77i7HE2pHdOru27QajH693UNuhDmW3QIVQMEoVK5CyqCQgccOIs9xf63cpAIT
	6447waMLYcV9b3fmcbXR/mI6eo2NLfI=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [PATCH v2 12/18] tools/xenstore: remove tdb code
Date: Mon, 10 Jul 2023 08:59:41 +0200
Message-Id: <20230710065947.4201-13-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230710065947.4201-1-jgross@suse.com>
References: <20230710065947.4201-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Now that TDB isn't used anymore, remove it.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 tools/xenstore/Makefile.common |    2 +-
 tools/xenstore/tdb.c           | 1748 --------------------------------
 tools/xenstore/tdb.h           |  132 ---
 3 files changed, 1 insertion(+), 1881 deletions(-)
 delete mode 100644 tools/xenstore/tdb.c
 delete mode 100644 tools/xenstore/tdb.h

diff --git a/tools/xenstore/Makefile.common b/tools/xenstore/Makefile.common
index 657a16849e..3259ab51e6 100644
--- a/tools/xenstore/Makefile.common
+++ b/tools/xenstore/Makefile.common
@@ -2,7 +2,7 @@
 
 XENSTORED_OBJS-y := xenstored_core.o xenstored_watch.o xenstored_domain.o
 XENSTORED_OBJS-y += xenstored_transaction.o xenstored_control.o xenstored_lu.o
-XENSTORED_OBJS-y += talloc.o utils.o tdb.o hashtable.o
+XENSTORED_OBJS-y += talloc.o utils.o hashtable.o
 
 XENSTORED_OBJS-$(CONFIG_Linux) += xenstored_posix.o xenstored_lu_daemon.o
 XENSTORED_OBJS-$(CONFIG_NetBSD) += xenstored_posix.o xenstored_lu_daemon.o
diff --git a/tools/xenstore/tdb.c b/tools/xenstore/tdb.c
deleted file mode 100644
index 29593b76c3..0000000000
--- a/tools/xenstore/tdb.c
+++ /dev/null
@@ -1,1748 +0,0 @@
- /* 
-   Unix SMB/CIFS implementation.
-
-   trivial database library
-
-   Copyright (C) Andrew Tridgell              1999-2004
-   Copyright (C) Paul `Rusty' Russell		   2000
-   Copyright (C) Jeremy Allison			   2000-2003
-   
-     ** NOTE! The following LGPL license applies to the tdb
-     ** library. This does NOT imply that all of Samba is released
-     ** under the LGPL
-   
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; If not, see <http://www.gnu.org/licenses/>.
-*/
-
-
-#ifndef _SAMBA_BUILD_
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include "tdb.h"
-#include <stdarg.h>
-#include "talloc.h"
-#undef HAVE_MMAP
-#else
-#include "includes.h"
-#include "lib/tdb/include/tdb.h"
-#include "system/time.h"
-#include "system/shmem.h"
-#include "system/filesys.h"
-#endif
-
-#define TDB_MAGIC_FOOD "TDB file\n"
-#define TDB_VERSION (0x26011967 + 7)
-#define TDB_MAGIC (0x26011999U)
-#define TDB_FREE_MAGIC (~TDB_MAGIC)
-#define TDB_DEAD_MAGIC (0xFEE1DEAD)
-#define TDB_ALIGNMENT 4
-#define MIN_REC_SIZE (2*sizeof(struct list_struct) + TDB_ALIGNMENT)
-#define DEFAULT_HASH_SIZE 131
-#define TDB_PAGE_SIZE 0x2000
-#define FREELIST_TOP (sizeof(struct tdb_header))
-#define TDB_ALIGN(x,a) (((x) + (a)-1) & ~((a)-1))
-#define TDB_BYTEREV(x) (((((x)&0xff)<<24)|((x)&0xFF00)<<8)|(((x)>>8)&0xFF00)|((x)>>24))
-#define TDB_DEAD(r) ((r)->magic == TDB_DEAD_MAGIC)
-#define TDB_BAD_MAGIC(r) ((r)->magic != TDB_MAGIC && !TDB_DEAD(r))
-#define TDB_HASH_TOP(hash) (FREELIST_TOP + (BUCKET(hash)+1)*sizeof(tdb_off))
-#define TDB_DATA_START(hash_size) (TDB_HASH_TOP(hash_size-1))
-
-
-/* NB assumes there is a local variable called "tdb" that is the
- * current context, also takes doubly-parenthesized print-style
- * argument. */
-#define TDB_LOG(x) tdb->log_fn x
-
-/* lock offsets */
-#define GLOBAL_LOCK 0
-#define ACTIVE_LOCK 4
-
-#ifndef MAP_FILE
-#define MAP_FILE 0
-#endif
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-#ifndef discard_const_p
-# if defined(__intptr_t_defined) || defined(HAVE_INTPTR_T)
-#  define discard_const(ptr) ((void *)((intptr_t)(ptr)))
-# else
-#  define discard_const(ptr) ((void *)(ptr))
-# endif
-# define discard_const_p(type, ptr) ((type *)discard_const(ptr))
-#endif
-
-/* free memory if the pointer is valid and zero the pointer */
-#ifndef SAFE_FREE
-#define SAFE_FREE(x) do { if ((x) != NULL) {talloc_free(discard_const_p(void *, (x))); (x)=NULL;} } while(0)
-#endif
-
-#define BUCKET(hash) ((hash) % tdb->header.hash_size)
-static TDB_DATA tdb_null;
-
-/* all contexts, to ensure no double-opens (fcntl locks don't nest!) */
-static TDB_CONTEXT *tdbs = NULL;
-
-static int tdb_munmap(TDB_CONTEXT *tdb)
-{
-	if (tdb->flags & TDB_INTERNAL)
-		return 0;
-
-#ifdef HAVE_MMAP
-	if (tdb->map_ptr) {
-		int ret = munmap(tdb->map_ptr, tdb->map_size);
-		if (ret != 0)
-			return ret;
-	}
-#endif
-	tdb->map_ptr = NULL;
-	return 0;
-}
-
-static void tdb_mmap(TDB_CONTEXT *tdb)
-{
-	if (tdb->flags & TDB_INTERNAL)
-		return;
-
-#ifdef HAVE_MMAP
-	if (!(tdb->flags & TDB_NOMMAP)) {
-		tdb->map_ptr = mmap(NULL, tdb->map_size, 
-				    PROT_READ|(tdb->read_only? 0:PROT_WRITE), 
-				    MAP_SHARED|MAP_FILE, tdb->fd, 0);
-
-		/*
-		 * NB. When mmap fails it returns MAP_FAILED *NOT* NULL !!!!
-		 */
-
-		if (tdb->map_ptr == MAP_FAILED) {
-			tdb->map_ptr = NULL;
-			TDB_LOG((tdb, 2, "tdb_mmap failed for size %d (%s)\n", 
-				 tdb->map_size, strerror(errno)));
-		}
-	} else {
-		tdb->map_ptr = NULL;
-	}
-#else
-	tdb->map_ptr = NULL;
-#endif
-}
-
-/* Endian conversion: we only ever deal with 4 byte quantities */
-static void *convert(void *buf, uint32_t size)
-{
-	uint32_t i, *p = buf;
-	for (i = 0; i < size / 4; i++)
-		p[i] = TDB_BYTEREV(p[i]);
-	return buf;
-}
-#define DOCONV() (tdb->flags & TDB_CONVERT)
-#define CONVERT(x) (DOCONV() ? convert(&x, sizeof(x)) : &x)
-
-/* the body of the database is made of one list_struct for the free space
-   plus a separate data list for each hash value */
-struct list_struct {
-	tdb_off next; /* offset of the next record in the list */
-	tdb_len rec_len; /* total byte length of record */
-	tdb_len key_len; /* byte length of key */
-	tdb_len data_len; /* byte length of data */
-	uint32_t full_hash; /* the full 32 bit hash of the key */
-	uint32_t magic;   /* try to catch errors */
-	/* the following union is implied:
-		union {
-			char record[rec_len];
-			struct {
-				char key[key_len];
-				char data[data_len];
-			}
-			uint32_t totalsize; (tailer)
-		}
-	*/
-};
-
-/* a byte range locking function - return 0 on success
-   this functions locks/unlocks 1 byte at the specified offset.
-
-   On error, errno is also set so that errors are passed back properly
-   through tdb_open(). */
-static int tdb_brlock(TDB_CONTEXT *tdb, tdb_off offset, 
-		      int rw_type, int lck_type, int probe)
-{
-	struct flock fl;
-	int ret;
-
-	if (tdb->flags & TDB_NOLOCK)
-		return 0;
-	if ((rw_type == F_WRLCK) && (tdb->read_only)) {
-		errno = EACCES;
-		return -1;
-	}
-
-	fl.l_type = rw_type;
-	fl.l_whence = SEEK_SET;
-	fl.l_start = offset;
-	fl.l_len = 1;
-	fl.l_pid = 0;
-
-	do {
-		ret = fcntl(tdb->fd,lck_type,&fl);
-	} while (ret == -1 && errno == EINTR);
-
-	if (ret == -1) {
-		if (!probe && lck_type != F_SETLK) {
-			/* Ensure error code is set for log fun to examine. */
-			tdb->ecode = TDB_ERR_LOCK;
-			TDB_LOG((tdb, 5,"tdb_brlock failed (fd=%d) at offset %d rw_type=%d lck_type=%d\n", 
-				 tdb->fd, offset, rw_type, lck_type));
-		}
-		/* Generic lock error. errno set by fcntl.
-		 * EAGAIN is an expected return from non-blocking
-		 * locks. */
-		if (errno != EAGAIN) {
-		TDB_LOG((tdb, 5, "tdb_brlock failed (fd=%d) at offset %d rw_type=%d lck_type=%d: %s\n", 
-				 tdb->fd, offset, rw_type, lck_type, 
-				 strerror(errno)));
-		}
-		return TDB_ERRCODE(TDB_ERR_LOCK, -1);
-	}
-	return 0;
-}
-
-/* lock a list in the database. list -1 is the alloc list */
-static int tdb_lock(TDB_CONTEXT *tdb, int list, int ltype)
-{
-	if (list < -1 || list >= (int)tdb->header.hash_size) {
-		TDB_LOG((tdb, 0,"tdb_lock: invalid list %d for ltype=%d\n", 
-			   list, ltype));
-		return -1;
-	}
-	if (tdb->flags & TDB_NOLOCK)
-		return 0;
-
-	/* Since fcntl locks don't nest, we do a lock for the first one,
-	   and simply bump the count for future ones */
-	if (tdb->locked[list+1].count == 0) {
-		if (tdb_brlock(tdb,FREELIST_TOP+4*list,ltype,F_SETLKW, 0)) {
-			TDB_LOG((tdb, 0,"tdb_lock failed on list %d ltype=%d (%s)\n", 
-					   list, ltype, strerror(errno)));
-			return -1;
-		}
-		tdb->locked[list+1].ltype = ltype;
-	}
-	tdb->locked[list+1].count++;
-	return 0;
-}
-
-/* unlock the database: returns void because it's too late for errors. */
-	/* changed to return int it may be interesting to know there
-	   has been an error  --simo */
-static int tdb_unlock(TDB_CONTEXT *tdb, int list,
-		      int ltype __attribute__((unused)))
-{
-	int ret = -1;
-
-	if (tdb->flags & TDB_NOLOCK)
-		return 0;
-
-	/* Sanity checks */
-	if (list < -1 || list >= (int)tdb->header.hash_size) {
-		TDB_LOG((tdb, 0, "tdb_unlock: list %d invalid (%d)\n", list, tdb->header.hash_size));
-		return ret;
-	}
-
-	if (tdb->locked[list+1].count==0) {
-		TDB_LOG((tdb, 0, "tdb_unlock: count is 0\n"));
-		return ret;
-	}
-
-	if (tdb->locked[list+1].count == 1) {
-		/* Down to last nested lock: unlock underneath */
-		ret = tdb_brlock(tdb, FREELIST_TOP+4*list, F_UNLCK, F_SETLKW, 0);
-	} else {
-		ret = 0;
-	}
-	tdb->locked[list+1].count--;
-
-	if (ret)
-		TDB_LOG((tdb, 0,"tdb_unlock: An error occurred unlocking!\n")); 
-	return ret;
-}
-
-/* This is based on the hash algorithm from gdbm */
-static uint32_t default_tdb_hash(TDB_DATA *key)
-{
-	uint32_t value;	/* Used to compute the hash value.  */
-	uint32_t   i;	/* Used to cycle through random values. */
-
-	/* Set the initial value from the key size. */
-	for (value = 0x238F13AF * key->dsize, i=0; i < key->dsize; i++)
-		value = (value + (key->dptr[i] << (i*5 % 24)));
-
-	return (1103515243 * value + 12345);  
-}
-
-/* check for an out of bounds access - if it is out of bounds then
-   see if the database has been expanded by someone else and expand
-   if necessary 
-   note that "len" is the minimum length needed for the db
-*/
-static int tdb_oob(TDB_CONTEXT *tdb, tdb_off len, int probe)
-{
-	struct stat st;
-	if (len <= tdb->map_size)
-		return 0;
-	if (tdb->flags & TDB_INTERNAL) {
-		if (!probe) {
-			/* Ensure ecode is set for log fn. */
-			tdb->ecode = TDB_ERR_IO;
-			TDB_LOG((tdb, 0,"tdb_oob len %d beyond internal malloc size %d\n",
-				 (int)len, (int)tdb->map_size));
-		}
-		return TDB_ERRCODE(TDB_ERR_IO, -1);
-	}
-
-	if (fstat(tdb->fd, &st) == -1)
-		return TDB_ERRCODE(TDB_ERR_IO, -1);
-
-	if (st.st_size < (off_t)len) {
-		if (!probe) {
-			/* Ensure ecode is set for log fn. */
-			tdb->ecode = TDB_ERR_IO;
-			TDB_LOG((tdb, 0,"tdb_oob len %d beyond eof at %d\n",
-				 (int)len, (int)st.st_size));
-		}
-		return TDB_ERRCODE(TDB_ERR_IO, -1);
-	}
-
-	/* Unmap, update size, remap */
-	if (tdb_munmap(tdb) == -1)
-		return TDB_ERRCODE(TDB_ERR_IO, -1);
-	tdb->map_size = st.st_size;
-	tdb_mmap(tdb);
-	return 0;
-}
-
-/* write a lump of data at a specified offset */
-static int tdb_write(TDB_CONTEXT *tdb, tdb_off off, void *buf, tdb_len len)
-{
-	if (tdb_oob(tdb, off + len, 0) != 0)
-		return -1;
-
-	if (tdb->map_ptr)
-		memcpy(off + (char *)tdb->map_ptr, buf, len);
-#ifdef HAVE_PWRITE
-	else if (pwrite(tdb->fd, buf, len, off) != (ssize_t)len) {
-#else
-	else if (lseek(tdb->fd, off, SEEK_SET) != (off_t)off
-		 || write(tdb->fd, buf, len) != (off_t)len) {
-#endif
-		/* Ensure ecode is set for log fn. */
-		tdb->ecode = TDB_ERR_IO;
-		TDB_LOG((tdb, 0,"tdb_write failed at %d len=%d (%s)\n",
-			   off, len, strerror(errno)));
-		return TDB_ERRCODE(TDB_ERR_IO, -1);
-	}
-	return 0;
-}
-
-/* read a lump of data at a specified offset, maybe convert */
-static int tdb_read(TDB_CONTEXT *tdb,tdb_off off,void *buf,tdb_len len,int cv)
-{
-	if (tdb_oob(tdb, off + len, 0) != 0)
-		return -1;
-
-	if (tdb->map_ptr)
-		memcpy(buf, off + (char *)tdb->map_ptr, len);
-#ifdef HAVE_PREAD
-	else if (pread(tdb->fd, buf, len, off) != (off_t)len) {
-#else
-	else if (lseek(tdb->fd, off, SEEK_SET) != (off_t)off
-		 || read(tdb->fd, buf, len) != (off_t)len) {
-#endif
-		/* Ensure ecode is set for log fn. */
-		tdb->ecode = TDB_ERR_IO;
-		TDB_LOG((tdb, 0,"tdb_read failed at %d len=%d (%s)\n",
-			   off, len, strerror(errno)));
-		return TDB_ERRCODE(TDB_ERR_IO, -1);
-	}
-	if (cv)
-		convert(buf, len);
-	return 0;
-}
-
-/* don't allocate memory: used in tdb_delete path. */
-static int tdb_key_eq(TDB_CONTEXT *tdb, tdb_off off, TDB_DATA key)
-{
-	char buf[64];
-	uint32_t len;
-
-	if (tdb_oob(tdb, off + key.dsize, 0) != 0)
-		return -1;
-
-	if (tdb->map_ptr)
-		return !memcmp(off + (char*)tdb->map_ptr, key.dptr, key.dsize);
-
-	while (key.dsize) {
-		len = key.dsize;
-		if (len > sizeof(buf))
-			len = sizeof(buf);
-		if (tdb_read(tdb, off, buf, len, 0) != 0)
-			return -1;
-		if (memcmp(buf, key.dptr, len) != 0)
-			return 0;
-		key.dptr += len;
-		key.dsize -= len;
-		off += len;
-	}
-	return 1;
-}
-
-/* read a lump of data, allocating the space for it */
-static char *tdb_alloc_read(TDB_CONTEXT *tdb, tdb_off offset, tdb_len len)
-{
-	char *buf;
-
-	if (!(buf = talloc_size(tdb, len))) {
-		/* Ensure ecode is set for log fn. */
-		tdb->ecode = TDB_ERR_OOM;
-		TDB_LOG((tdb, 0,"tdb_alloc_read malloc failed len=%d (%s)\n",
-			   len, strerror(errno)));
-		return TDB_ERRCODE(TDB_ERR_OOM, buf);
-	}
-	if (tdb_read(tdb, offset, buf, len, 0) == -1) {
-		SAFE_FREE(buf);
-		return NULL;
-	}
-	return buf;
-}
-
-/* read/write a tdb_off */
-static int ofs_read(TDB_CONTEXT *tdb, tdb_off offset, tdb_off *d)
-{
-	return tdb_read(tdb, offset, (char*)d, sizeof(*d), DOCONV());
-}
-static int ofs_write(TDB_CONTEXT *tdb, tdb_off offset, tdb_off *d)
-{
-	tdb_off off = *d;
-	return tdb_write(tdb, offset, CONVERT(off), sizeof(*d));
-}
-
-/* read/write a record */
-static int rec_read(TDB_CONTEXT *tdb, tdb_off offset, struct list_struct *rec)
-{
-	if (tdb_read(tdb, offset, rec, sizeof(*rec),DOCONV()) == -1)
-		return -1;
-	if (TDB_BAD_MAGIC(rec)) {
-		/* Ensure ecode is set for log fn. */
-		tdb->ecode = TDB_ERR_CORRUPT;
-		TDB_LOG((tdb, 0,"rec_read bad magic 0x%x at offset=%d\n", rec->magic, offset));
-		return TDB_ERRCODE(TDB_ERR_CORRUPT, -1);
-	}
-	return tdb_oob(tdb, rec->next+sizeof(*rec), 0);
-}
-static int rec_write(TDB_CONTEXT *tdb, tdb_off offset, struct list_struct *rec)
-{
-	struct list_struct r = *rec;
-	return tdb_write(tdb, offset, CONVERT(r), sizeof(r));
-}
-
-/* read a freelist record and check for simple errors */
-static int rec_free_read(TDB_CONTEXT *tdb, tdb_off off, struct list_struct *rec)
-{
-	if (tdb_read(tdb, off, rec, sizeof(*rec),DOCONV()) == -1)
-		return -1;
-
-	if (rec->magic == TDB_MAGIC) {
-		/* this happens when a app is showdown while deleting a record - we should
-		   not completely fail when this happens */
-		TDB_LOG((tdb, 0,"rec_free_read non-free magic 0x%x at offset=%d - fixing\n", 
-			 rec->magic, off));
-		rec->magic = TDB_FREE_MAGIC;
-		if (tdb_write(tdb, off, rec, sizeof(*rec)) == -1)
-			return -1;
-	}
-
-	if (rec->magic != TDB_FREE_MAGIC) {
-		/* Ensure ecode is set for log fn. */
-		tdb->ecode = TDB_ERR_CORRUPT;
-		TDB_LOG((tdb, 0,"rec_free_read bad magic 0x%x at offset=%d\n", 
-			   rec->magic, off));
-		return TDB_ERRCODE(TDB_ERR_CORRUPT, -1);
-	}
-	if (tdb_oob(tdb, rec->next+sizeof(*rec), 0) != 0)
-		return -1;
-	return 0;
-}
-
-/* update a record tailer (must hold allocation lock) */
-static int update_tailer(TDB_CONTEXT *tdb, tdb_off offset,
-			 const struct list_struct *rec)
-{
-	tdb_off totalsize;
-
-	/* Offset of tailer from record header */
-	totalsize = sizeof(*rec) + rec->rec_len;
-	return ofs_write(tdb, offset + totalsize - sizeof(tdb_off),
-			 &totalsize);
-}
-
-/* Remove an element from the freelist.  Must have alloc lock. */
-static int remove_from_freelist(TDB_CONTEXT *tdb, tdb_off off, tdb_off next)
-{
-	tdb_off last_ptr, i;
-
-	/* read in the freelist top */
-	last_ptr = FREELIST_TOP;
-	while (ofs_read(tdb, last_ptr, &i) != -1 && i != 0) {
-		if (i == off) {
-			/* We've found it! */
-			return ofs_write(tdb, last_ptr, &next);
-		}
-		/* Follow chain (next offset is at start of record) */
-		last_ptr = i;
-	}
-	TDB_LOG((tdb, 0,"remove_from_freelist: not on list at off=%d\n", off));
-	return TDB_ERRCODE(TDB_ERR_CORRUPT, -1);
-}
-
-/* Add an element into the freelist. Merge adjacent records if
-   neccessary. */
-static int tdb_free(TDB_CONTEXT *tdb, tdb_off offset, struct list_struct *rec)
-{
-	tdb_off right, left;
-
-	/* Allocation and tailer lock */
-	if (tdb_lock(tdb, -1, F_WRLCK) != 0)
-		return -1;
-
-	/* set an initial tailer, so if we fail we don't leave a bogus record */
-	if (update_tailer(tdb, offset, rec) != 0) {
-		TDB_LOG((tdb, 0, "tdb_free: upfate_tailer failed!\n"));
-		goto fail;
-	}
-
-	/* Look right first (I'm an Australian, dammit) */
-	right = offset + sizeof(*rec) + rec->rec_len;
-	if (right + sizeof(*rec) <= tdb->map_size) {
-		struct list_struct r;
-
-		if (tdb_read(tdb, right, &r, sizeof(r), DOCONV()) == -1) {
-			TDB_LOG((tdb, 0, "tdb_free: right read failed at %u\n", right));
-			goto left;
-		}
-
-		/* If it's free, expand to include it. */
-		if (r.magic == TDB_FREE_MAGIC) {
-			if (remove_from_freelist(tdb, right, r.next) == -1) {
-				TDB_LOG((tdb, 0, "tdb_free: right free failed at %u\n", right));
-				goto left;
-			}
-			rec->rec_len += sizeof(r) + r.rec_len;
-		}
-	}
-
-left:
-	/* Look left */
-	left = offset - sizeof(tdb_off);
-	if (left > TDB_DATA_START(tdb->header.hash_size)) {
-		struct list_struct l;
-		tdb_off leftsize;
-		
-		/* Read in tailer and jump back to header */
-		if (ofs_read(tdb, left, &leftsize) == -1) {
-			TDB_LOG((tdb, 0, "tdb_free: left offset read failed at %u\n", left));
-			goto update;
-		}
-		left = offset - leftsize;
-
-		/* Now read in record */
-		if (tdb_read(tdb, left, &l, sizeof(l), DOCONV()) == -1) {
-			TDB_LOG((tdb, 0, "tdb_free: left read failed at %u (%u)\n", left, leftsize));
-			goto update;
-		}
-
-		/* If it's free, expand to include it. */
-		if (l.magic == TDB_FREE_MAGIC) {
-			if (remove_from_freelist(tdb, left, l.next) == -1) {
-				TDB_LOG((tdb, 0, "tdb_free: left free failed at %u\n", left));
-				goto update;
-			} else {
-				offset = left;
-				rec->rec_len += leftsize;
-			}
-		}
-	}
-
-update:
-	if (update_tailer(tdb, offset, rec) == -1) {
-		TDB_LOG((tdb, 0, "tdb_free: update_tailer failed at %u\n", offset));
-		goto fail;
-	}
-
-	/* Now, prepend to free list */
-	rec->magic = TDB_FREE_MAGIC;
-
-	if (ofs_read(tdb, FREELIST_TOP, &rec->next) == -1 ||
-	    rec_write(tdb, offset, rec) == -1 ||
-	    ofs_write(tdb, FREELIST_TOP, &offset) == -1) {
-		TDB_LOG((tdb, 0, "tdb_free record write failed at offset=%d\n", offset));
-		goto fail;
-	}
-
-	/* And we're done. */
-	tdb_unlock(tdb, -1, F_WRLCK);
-	return 0;
-
- fail:
-	tdb_unlock(tdb, -1, F_WRLCK);
-	return -1;
-}
-
-
-/* expand a file.  we prefer to use ftruncate, as that is what posix
-  says to use for mmap expansion */
-static int expand_file(TDB_CONTEXT *tdb, tdb_off size, tdb_off addition)
-{
-	char buf[1024];
-#ifdef HAVE_FTRUNCATE_EXTEND
-	if (ftruncate(tdb->fd, size+addition) != 0) {
-		TDB_LOG((tdb, 0, "expand_file ftruncate to %d failed (%s)\n", 
-			   size+addition, strerror(errno)));
-		return -1;
-	}
-#else
-	char b = 0;
-
-#ifdef HAVE_PWRITE
-	if (pwrite(tdb->fd,  &b, 1, (size+addition) - 1) != 1) {
-#else
-	if (lseek(tdb->fd, (size+addition) - 1, SEEK_SET) != (off_t)(size+addition) - 1 || 
-	    write(tdb->fd, &b, 1) != 1) {
-#endif
-		TDB_LOG((tdb, 0, "expand_file to %d failed (%s)\n", 
-			   size+addition, strerror(errno)));
-		return -1;
-	}
-#endif
-
-	/* now fill the file with something. This ensures that the file isn't sparse, which would be
-	   very bad if we ran out of disk. This must be done with write, not via mmap */
-	memset(buf, 0x42, sizeof(buf));
-	while (addition) {
-		int n = addition>sizeof(buf)?sizeof(buf):addition;
-#ifdef HAVE_PWRITE
-		int ret = pwrite(tdb->fd, buf, n, size);
-#else
-		int ret;
-		if (lseek(tdb->fd, size, SEEK_SET) != (off_t)size)
-			return -1;
-		ret = write(tdb->fd, buf, n);
-#endif
-		if (ret != n) {
-			TDB_LOG((tdb, 0, "expand_file write of %d failed (%s)\n", 
-				   n, strerror(errno)));
-			return -1;
-		}
-		addition -= n;
-		size += n;
-	}
-	return 0;
-}
-
-
-/* expand the database at least size bytes by expanding the underlying
-   file and doing the mmap again if necessary */
-static int tdb_expand(TDB_CONTEXT *tdb, tdb_off size)
-{
-	struct list_struct rec;
-	tdb_off offset;
-
-	if (tdb_lock(tdb, -1, F_WRLCK) == -1) {
-		TDB_LOG((tdb, 0, "lock failed in tdb_expand\n"));
-		return -1;
-	}
-
-	/* must know about any previous expansions by another process */
-	tdb_oob(tdb, tdb->map_size + 1, 1);
-
-	/* always make room for at least 10 more records, and round
-           the database up to a multiple of TDB_PAGE_SIZE */
-	size = TDB_ALIGN(tdb->map_size + size*10, TDB_PAGE_SIZE) - tdb->map_size;
-
-	if (!(tdb->flags & TDB_INTERNAL))
-		tdb_munmap(tdb);
-
-	/*
-	 * We must ensure the file is unmapped before doing this
-	 * to ensure consistency with systems like OpenBSD where
-	 * writes and mmaps are not consistent.
-	 */
-
-	/* expand the file itself */
-	if (!(tdb->flags & TDB_INTERNAL)) {
-		if (expand_file(tdb, tdb->map_size, size) != 0)
-			goto fail;
-	}
-
-	tdb->map_size += size;
-
-	if (tdb->flags & TDB_INTERNAL) {
-		char *new_map_ptr = talloc_realloc_size(tdb, tdb->map_ptr,
-							tdb->map_size);
-		if (!new_map_ptr) {
-			tdb->map_size -= size;
-			goto fail;
-		}
-		tdb->map_ptr = new_map_ptr;
-	} else {
-		/*
-		 * We must ensure the file is remapped before adding the space
-		 * to ensure consistency with systems like OpenBSD where
-		 * writes and mmaps are not consistent.
-		 */
-
-		/* We're ok if the mmap fails as we'll fallback to read/write */
-		tdb_mmap(tdb);
-	}
-
-	/* form a new freelist record */
-	memset(&rec,'\0',sizeof(rec));
-	rec.rec_len = size - sizeof(rec);
-
-	/* link it into the free list */
-	offset = tdb->map_size - size;
-	if (tdb_free(tdb, offset, &rec) == -1)
-		goto fail;
-
-	tdb_unlock(tdb, -1, F_WRLCK);
-	return 0;
- fail:
-	tdb_unlock(tdb, -1, F_WRLCK);
-	return -1;
-}
-
-
-/* 
-   the core of tdb_allocate - called when we have decided which
-   free list entry to use
- */
-static tdb_off tdb_allocate_ofs(TDB_CONTEXT *tdb, tdb_len length, tdb_off rec_ptr,
-				struct list_struct *rec, tdb_off last_ptr)
-{
-	struct list_struct newrec;
-	tdb_off newrec_ptr;
-
-	memset(&newrec, '\0', sizeof(newrec));
-
-	/* found it - now possibly split it up  */
-	if (rec->rec_len > length + MIN_REC_SIZE) {
-		/* Length of left piece */
-		length = TDB_ALIGN(length, TDB_ALIGNMENT);
-		
-		/* Right piece to go on free list */
-		newrec.rec_len = rec->rec_len - (sizeof(*rec) + length);
-		newrec_ptr = rec_ptr + sizeof(*rec) + length;
-		
-		/* And left record is shortened */
-		rec->rec_len = length;
-	} else {
-		newrec_ptr = 0;
-	}
-	
-	/* Remove allocated record from the free list */
-	if (ofs_write(tdb, last_ptr, &rec->next) == -1) {
-		return 0;
-	}
-	
-	/* Update header: do this before we drop alloc
-	   lock, otherwise tdb_free() might try to
-	   merge with us, thinking we're free.
-	   (Thanks Jeremy Allison). */
-	rec->magic = TDB_MAGIC;
-	if (rec_write(tdb, rec_ptr, rec) == -1) {
-		return 0;
-	}
-	
-	/* Did we create new block? */
-	if (newrec_ptr) {
-		/* Update allocated record tailer (we
-		   shortened it). */
-		if (update_tailer(tdb, rec_ptr, rec) == -1) {
-			return 0;
-		}
-		
-		/* Free new record */
-		if (tdb_free(tdb, newrec_ptr, &newrec) == -1) {
-			return 0;
-		}
-	}
-	
-	/* all done - return the new record offset */
-	return rec_ptr;
-}
-
-/* allocate some space from the free list. The offset returned points
-   to a unconnected list_struct within the database with room for at
-   least length bytes of total data
-
-   0 is returned if the space could not be allocated
- */
-static tdb_off tdb_allocate(TDB_CONTEXT *tdb, tdb_len length,
-			    struct list_struct *rec)
-{
-	tdb_off rec_ptr, last_ptr, newrec_ptr;
-	struct {
-		tdb_off rec_ptr, last_ptr;
-		tdb_len rec_len;
-	} bestfit = { 0, 0, 0 };
-
-	if (tdb_lock(tdb, -1, F_WRLCK) == -1)
-		return 0;
-
-	/* Extra bytes required for tailer */
-	length += sizeof(tdb_off);
-
- again:
-	last_ptr = FREELIST_TOP;
-
-	/* read in the freelist top */
-	if (ofs_read(tdb, FREELIST_TOP, &rec_ptr) == -1)
-		goto fail;
-
-	bestfit.rec_ptr = 0;
-
-	/* 
-	   this is a best fit allocation strategy. Originally we used
-	   a first fit strategy, but it suffered from massive fragmentation
-	   issues when faced with a slowly increasing record size.
-	 */
-	while (rec_ptr) {
-		if (rec_free_read(tdb, rec_ptr, rec) == -1) {
-			goto fail;
-		}
-
-		if (rec->rec_len >= length) {
-			if (bestfit.rec_ptr == 0 ||
-			    rec->rec_len < bestfit.rec_len) {
-				bestfit.rec_len = rec->rec_len;
-				bestfit.rec_ptr = rec_ptr;
-				bestfit.last_ptr = last_ptr;
-				/* consider a fit to be good enough if we aren't wasting more than half the space */
-				if (bestfit.rec_len < 2*length) {
-					break;
-				}
-			}
-		}
-
-		/* move to the next record */
-		last_ptr = rec_ptr;
-		rec_ptr = rec->next;
-	}
-
-	if (bestfit.rec_ptr != 0) {
-		if (rec_free_read(tdb, bestfit.rec_ptr, rec) == -1) {
-			goto fail;
-		}
-
-		newrec_ptr = tdb_allocate_ofs(tdb, length, bestfit.rec_ptr, rec, bestfit.last_ptr);
-		tdb_unlock(tdb, -1, F_WRLCK);
-		return newrec_ptr;
-	}
-
-	/* we didn't find enough space. See if we can expand the
-	   database and if we can then try again */
-	if (tdb_expand(tdb, length + sizeof(*rec)) == 0)
-		goto again;
- fail:
-	tdb_unlock(tdb, -1, F_WRLCK);
-	return 0;
-}
-
-/* initialise a new database with a specified hash size */
-static int tdb_new_database(TDB_CONTEXT *tdb, int hash_size)
-{
-	struct tdb_header *newdb;
-	int size, ret = -1;
-
-	/* We make it up in memory, then write it out if not internal */
-	size = sizeof(struct tdb_header) + (hash_size+1)*sizeof(tdb_off);
-	if (!(newdb = talloc_zero_size(tdb, size)))
-		return TDB_ERRCODE(TDB_ERR_OOM, -1);
-
-	/* Fill in the header */
-	newdb->version = TDB_VERSION;
-	newdb->hash_size = hash_size;
-	if (tdb->flags & TDB_INTERNAL) {
-		tdb->map_size = size;
-		tdb->map_ptr = (char *)newdb;
-		memcpy(&tdb->header, newdb, sizeof(tdb->header));
-		/* Convert the `ondisk' version if asked. */
-		CONVERT(*newdb);
-		return 0;
-	}
-	if (lseek(tdb->fd, 0, SEEK_SET) == -1)
-		goto fail;
-
-	if (ftruncate(tdb->fd, 0) == -1)
-		goto fail;
-
-	/* This creates an endian-converted header, as if read from disk */
-	CONVERT(*newdb);
-	memcpy(&tdb->header, newdb, sizeof(tdb->header));
-	/* Don't endian-convert the magic food! */
-	memcpy(newdb->magic_food, TDB_MAGIC_FOOD, strlen(TDB_MAGIC_FOOD)+1);
-	if (write(tdb->fd, newdb, size) != size)
-		ret = -1;
-	else
-		ret = 0;
-
-  fail:
-	SAFE_FREE(newdb);
-	return ret;
-}
-
-/* Returns 0 on fail.  On success, return offset of record, and fills
-   in rec */
-static tdb_off tdb_find(TDB_CONTEXT *tdb, TDB_DATA key, uint32_t hash,
-			struct list_struct *r)
-{
-	tdb_off rec_ptr;
-	
-	/* read in the hash top */
-	if (ofs_read(tdb, TDB_HASH_TOP(hash), &rec_ptr) == -1)
-		return 0;
-
-	/* keep looking until we find the right record */
-	while (rec_ptr) {
-		if (rec_read(tdb, rec_ptr, r) == -1)
-			return 0;
-
-		if (!TDB_DEAD(r) && hash==r->full_hash && key.dsize==r->key_len) {
-			/* a very likely hit - read the key */
-			int cmp = tdb_key_eq(tdb, rec_ptr + sizeof(*r), key);
-			if (cmp < 0)
-				return 0;
-			else if (cmp > 0)
-				return rec_ptr;
-		}
-		rec_ptr = r->next;
-	}
-	return TDB_ERRCODE(TDB_ERR_NOEXIST, 0);
-}
-
-/* As tdb_find, but if you succeed, keep the lock */
-static tdb_off tdb_find_lock_hash(TDB_CONTEXT *tdb, TDB_DATA key, uint32_t hash, int locktype,
-			     struct list_struct *rec)
-{
-	uint32_t rec_ptr;
-
-	if (tdb_lock(tdb, BUCKET(hash), locktype) == -1)
-		return 0;
-	if (!(rec_ptr = tdb_find(tdb, key, hash, rec)))
-		tdb_unlock(tdb, BUCKET(hash), locktype);
-	return rec_ptr;
-}
-
-enum TDB_ERROR tdb_error(TDB_CONTEXT *tdb)
-{
-	return tdb->ecode;
-}
-
-static struct tdb_errname {
-	enum TDB_ERROR ecode; const char *estring;
-} emap[] = { {TDB_SUCCESS, "Success"},
-	     {TDB_ERR_CORRUPT, "Corrupt database"},
-	     {TDB_ERR_IO, "IO Error"},
-	     {TDB_ERR_LOCK, "Locking error"},
-	     {TDB_ERR_OOM, "Out of memory"},
-	     {TDB_ERR_EXISTS, "Record exists"},
-	     {TDB_ERR_NOLOCK, "Lock exists on other keys"},
-	     {TDB_ERR_NOEXIST, "Record does not exist"} };
-
-/* Error string for the last tdb error */
-const char *tdb_errorstr(TDB_CONTEXT *tdb)
-{
-	uint32_t i;
-	for (i = 0; i < sizeof(emap) / sizeof(struct tdb_errname); i++)
-		if (tdb->ecode == emap[i].ecode)
-			return emap[i].estring;
-	return "Invalid error code";
-}
-
-/* update an entry in place - this only works if the new data size
-   is <= the old data size and the key exists.
-   on failure return -1.
-*/
-
-static int tdb_update_hash(TDB_CONTEXT *tdb, TDB_DATA key, uint32_t hash, TDB_DATA dbuf)
-{
-	struct list_struct rec;
-	tdb_off rec_ptr;
-
-	/* find entry */
-	if (!(rec_ptr = tdb_find(tdb, key, hash, &rec)))
-		return -1;
-
-	/* must be long enough key, data and tailer */
-	if (rec.rec_len < key.dsize + dbuf.dsize + sizeof(tdb_off)) {
-		tdb->ecode = TDB_SUCCESS; /* Not really an error */
-		return -1;
-	}
-
-	if (tdb_write(tdb, rec_ptr + sizeof(rec) + rec.key_len,
-		      dbuf.dptr, dbuf.dsize) == -1)
-		return -1;
-
-	if (dbuf.dsize != rec.data_len) {
-		/* update size */
-		rec.data_len = dbuf.dsize;
-		return rec_write(tdb, rec_ptr, &rec);
-	}
- 
-	return 0;
-}
-
-/* find an entry in the database given a key */
-/* If an entry doesn't exist tdb_err will be set to
- * TDB_ERR_NOEXIST. If a key has no data attached
- * then the TDB_DATA will have zero length but
- * a non-zero pointer
- */
-
-TDB_DATA tdb_fetch(TDB_CONTEXT *tdb, TDB_DATA key)
-{
-	tdb_off rec_ptr;
-	struct list_struct rec;
-	TDB_DATA ret;
-	uint32_t hash;
-
-	/* find which hash bucket it is in */
-	hash = tdb->hash_fn(&key);
-	if (!(rec_ptr = tdb_find_lock_hash(tdb,key,hash,F_RDLCK,&rec)))
-		return tdb_null;
-
-	ret.dptr = tdb_alloc_read(tdb, rec_ptr + sizeof(rec) + rec.key_len,
-				  rec.data_len);
-	ret.dsize = rec.data_len;
-	tdb_unlock(tdb, BUCKET(rec.full_hash), F_RDLCK);
-	return ret;
-}
-
-/* check if an entry in the database exists 
-
-   note that 1 is returned if the key is found and 0 is returned if not found
-   this doesn't match the conventions in the rest of this module, but is
-   compatible with gdbm
-*/
-static int tdb_exists_hash(TDB_CONTEXT *tdb, TDB_DATA key, uint32_t hash)
-{
-	struct list_struct rec;
-	
-	if (tdb_find_lock_hash(tdb, key, hash, F_RDLCK, &rec) == 0)
-		return 0;
-	tdb_unlock(tdb, BUCKET(rec.full_hash), F_RDLCK);
-	return 1;
-}
-
-/* record lock stops delete underneath */
-static int lock_record(TDB_CONTEXT *tdb, tdb_off off)
-{
-	return off ? tdb_brlock(tdb, off, F_RDLCK, F_SETLKW, 0) : 0;
-}
-/*
-  Write locks override our own fcntl readlocks, so check it here.
-  Note this is meant to be F_SETLK, *not* F_SETLKW, as it's not
-  an error to fail to get the lock here.
-*/
- 
-static int write_lock_record(TDB_CONTEXT *tdb, tdb_off off)
-{
-	struct tdb_traverse_lock *i;
-	for (i = &tdb->travlocks; i; i = i->next)
-		if (i->off == off)
-			return -1;
-	return tdb_brlock(tdb, off, F_WRLCK, F_SETLK, 1);
-}
-
-/*
-  Note this is meant to be F_SETLK, *not* F_SETLKW, as it's not
-  an error to fail to get the lock here.
-*/
-
-static int write_unlock_record(TDB_CONTEXT *tdb, tdb_off off)
-{
-	return tdb_brlock(tdb, off, F_UNLCK, F_SETLK, 0);
-}
-/* fcntl locks don't stack: avoid unlocking someone else's */
-static int unlock_record(TDB_CONTEXT *tdb, tdb_off off)
-{
-	struct tdb_traverse_lock *i;
-	uint32_t count = 0;
-
-	if (off == 0)
-		return 0;
-	for (i = &tdb->travlocks; i; i = i->next)
-		if (i->off == off)
-			count++;
-	return (count == 1 ? tdb_brlock(tdb, off, F_UNLCK, F_SETLKW, 0) : 0);
-}
-
-/* actually delete an entry in the database given the offset */
-static int do_delete(TDB_CONTEXT *tdb, tdb_off rec_ptr, struct list_struct*rec)
-{
-	tdb_off last_ptr, i;
-	struct list_struct lastrec;
-
-	if (tdb->read_only) return -1;
-
-	if (write_lock_record(tdb, rec_ptr) == -1) {
-		/* Someone traversing here: mark it as dead */
-		rec->magic = TDB_DEAD_MAGIC;
-		return rec_write(tdb, rec_ptr, rec);
-	}
-	if (write_unlock_record(tdb, rec_ptr) != 0)
-		return -1;
-
-	/* find previous record in hash chain */
-	if (ofs_read(tdb, TDB_HASH_TOP(rec->full_hash), &i) == -1)
-		return -1;
-	for (last_ptr = 0; i != rec_ptr; last_ptr = i, i = lastrec.next)
-		if (rec_read(tdb, i, &lastrec) == -1)
-			return -1;
-
-	/* unlink it: next ptr is at start of record. */
-	if (last_ptr == 0)
-		last_ptr = TDB_HASH_TOP(rec->full_hash);
-	if (ofs_write(tdb, last_ptr, &rec->next) == -1)
-		return -1;
-
-	/* recover the space */
-	if (tdb_free(tdb, rec_ptr, rec) == -1)
-		return -1;
-	return 0;
-}
-
-/* Uses traverse lock: 0 = finish, -1 = error, other = record offset */
-static int tdb_next_lock(TDB_CONTEXT *tdb, struct tdb_traverse_lock *tlock,
-			 struct list_struct *rec)
-{
-	int want_next = (tlock->off != 0);
-
-	/* Lock each chain from the start one. */
-	for (; tlock->hash < tdb->header.hash_size; tlock->hash++) {
-
-		/* this is an optimisation for the common case where
-		   the hash chain is empty, which is particularly
-		   common for the use of tdb with ldb, where large
-		   hashes are used. In that case we spend most of our
-		   time in tdb_brlock(), locking empty hash chains.
-
-		   To avoid this, we do an unlocked pre-check to see
-		   if the hash chain is empty before starting to look
-		   inside it. If it is empty then we can avoid that
-		   hash chain. If it isn't empty then we can't believe
-		   the value we get back, as we read it without a
-		   lock, so instead we get the lock and re-fetch the
-		   value below.
-
-		   Notice that not doing this optimisation on the
-		   first hash chain is critical. We must guarantee
-		   that we have done at least one fcntl lock at the
-		   start of a search to guarantee that memory is
-		   coherent on SMP systems. If records are added by
-		   others during the search then thats OK, and we
-		   could possibly miss those with this trick, but we
-		   could miss them anyway without this trick, so the
-		   semantics don't change.
-
-		   With a non-indexed ldb search this trick gains us a
-		   factor of around 80 in speed on a linux 2.6.x
-		   system (testing using ldbtest).
-		 */
-		if (!tlock->off && tlock->hash != 0) {
-			uint32_t off;
-			if (tdb->map_ptr) {
-				for (;tlock->hash < tdb->header.hash_size;tlock->hash++) {
-					if (0 != *(uint32_t *)(TDB_HASH_TOP(tlock->hash) + (unsigned char *)tdb->map_ptr)) {
-						break;
-					}
-				}
-				if (tlock->hash == tdb->header.hash_size) {
-					continue;
-				}
-			} else {
-				if (ofs_read(tdb, TDB_HASH_TOP(tlock->hash), &off) == 0 &&
-				    off == 0) {
-					continue;
-				}
-			}
-		}
-
-		if (tdb_lock(tdb, tlock->hash, F_WRLCK) == -1)
-			return -1;
-
-		/* No previous record?  Start at top of chain. */
-		if (!tlock->off) {
-			if (ofs_read(tdb, TDB_HASH_TOP(tlock->hash),
-				     &tlock->off) == -1)
-				goto fail;
-		} else {
-			/* Otherwise unlock the previous record. */
-			if (unlock_record(tdb, tlock->off) != 0)
-				goto fail;
-		}
-
-		if (want_next) {
-			/* We have offset of old record: grab next */
-			if (rec_read(tdb, tlock->off, rec) == -1)
-				goto fail;
-			tlock->off = rec->next;
-		}
-
-		/* Iterate through chain */
-		while( tlock->off) {
-			tdb_off current;
-			if (rec_read(tdb, tlock->off, rec) == -1)
-				goto fail;
-
-			/* Detect infinite loops. From "Shlomi Yaakobovich" <Shlomi@exanet.com>. */
-			if (tlock->off == rec->next) {
-				TDB_LOG((tdb, 0, "tdb_next_lock: loop detected.\n"));
-				goto fail;
-			}
-
-			if (!TDB_DEAD(rec)) {
-				/* Woohoo: we found one! */
-				if (lock_record(tdb, tlock->off) != 0)
-					goto fail;
-				return tlock->off;
-			}
-
-			/* Try to clean dead ones from old traverses */
-			current = tlock->off;
-			tlock->off = rec->next;
-			if (!tdb->read_only && 
-			    do_delete(tdb, current, rec) != 0)
-				goto fail;
-		}
-		tdb_unlock(tdb, tlock->hash, F_WRLCK);
-		want_next = 0;
-	}
-	/* We finished iteration without finding anything */
-	return TDB_ERRCODE(TDB_SUCCESS, 0);
-
- fail:
-	tlock->off = 0;
-	if (tdb_unlock(tdb, tlock->hash, F_WRLCK) != 0)
-		TDB_LOG((tdb, 0, "tdb_next_lock: On error unlock failed!\n"));
-	return -1;
-}
-
-/* traverse the entire database - calling fn(tdb, key, data) on each element.
-   return -1 on error or the record count traversed
-   if fn is NULL then it is not called
-   a non-zero return value from fn() indicates that the traversal should stop
-  */
-int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *private)
-{
-	TDB_DATA key, dbuf;
-	struct list_struct rec;
-	struct tdb_traverse_lock tl = { NULL, 0, 0 };
-	int ret, count = 0;
-
-	/* This was in the initializaton, above, but the IRIX compiler
-	 * did not like it.  crh
-	 */
-	tl.next = tdb->travlocks.next;
-
-	/* fcntl locks don't stack: beware traverse inside traverse */
-	tdb->travlocks.next = &tl;
-
-	/* tdb_next_lock places locks on the record returned, and its chain */
-	while ((ret = tdb_next_lock(tdb, &tl, &rec)) > 0) {
-		count++;
-		/* now read the full record */
-		key.dptr = tdb_alloc_read(tdb, tl.off + sizeof(rec), 
-					  rec.key_len + rec.data_len);
-		if (!key.dptr) {
-			ret = -1;
-			if (tdb_unlock(tdb, tl.hash, F_WRLCK) != 0)
-				goto out;
-			if (unlock_record(tdb, tl.off) != 0)
-				TDB_LOG((tdb, 0, "tdb_traverse: key.dptr == NULL and unlock_record failed!\n"));
-			goto out;
-		}
-		key.dsize = rec.key_len;
-		dbuf.dptr = key.dptr + rec.key_len;
-		dbuf.dsize = rec.data_len;
-
-		/* Drop chain lock, call out */
-		if (tdb_unlock(tdb, tl.hash, F_WRLCK) != 0) {
-			ret = -1;
-			goto out;
-		}
-		if (fn && fn(tdb, key, dbuf, private)) {
-			/* They want us to terminate traversal */
-			ret = count;
-			if (unlock_record(tdb, tl.off) != 0) {
-				TDB_LOG((tdb, 0, "tdb_traverse: unlock_record failed!\n"));
-				ret = -1;
-			}
-			tdb->travlocks.next = tl.next;
-			SAFE_FREE(key.dptr);
-			return count;
-		}
-		SAFE_FREE(key.dptr);
-	}
-out:
-	tdb->travlocks.next = tl.next;
-	if (ret < 0)
-		return -1;
-	else
-		return count;
-}
-
-/* find the first entry in the database and return its key */
-TDB_DATA tdb_firstkey(TDB_CONTEXT *tdb)
-{
-	TDB_DATA key;
-	struct list_struct rec;
-
-	/* release any old lock */
-	if (unlock_record(tdb, tdb->travlocks.off) != 0)
-		return tdb_null;
-	tdb->travlocks.off = tdb->travlocks.hash = 0;
-
-	if (tdb_next_lock(tdb, &tdb->travlocks, &rec) <= 0)
-		return tdb_null;
-	/* now read the key */
-	key.dsize = rec.key_len;
-	key.dptr =tdb_alloc_read(tdb,tdb->travlocks.off+sizeof(rec),key.dsize);
-	if (tdb_unlock(tdb, BUCKET(tdb->travlocks.hash), F_WRLCK) != 0)
-		TDB_LOG((tdb, 0, "tdb_firstkey: error occurred while tdb_unlocking!\n"));
-	return key;
-}
-
-/* find the next entry in the database, returning its key */
-TDB_DATA tdb_nextkey(TDB_CONTEXT *tdb, TDB_DATA oldkey)
-{
-	uint32_t oldhash;
-	TDB_DATA key = tdb_null;
-	struct list_struct rec;
-	char *k = NULL;
-
-	/* Is locked key the old key?  If so, traverse will be reliable. */
-	if (tdb->travlocks.off) {
-		if (tdb_lock(tdb,tdb->travlocks.hash,F_WRLCK))
-			return tdb_null;
-		if (rec_read(tdb, tdb->travlocks.off, &rec) == -1
-		    || !(k = tdb_alloc_read(tdb,tdb->travlocks.off+sizeof(rec),
-					    rec.key_len))
-		    || memcmp(k, oldkey.dptr, oldkey.dsize) != 0) {
-			/* No, it wasn't: unlock it and start from scratch */
-			if (unlock_record(tdb, tdb->travlocks.off) != 0)
-				return tdb_null;
-			if (tdb_unlock(tdb, tdb->travlocks.hash, F_WRLCK) != 0)
-				return tdb_null;
-			tdb->travlocks.off = 0;
-		}
-
-		SAFE_FREE(k);
-	}
-
-	if (!tdb->travlocks.off) {
-		/* No previous element: do normal find, and lock record */
-		tdb->travlocks.off = tdb_find_lock_hash(tdb, oldkey, tdb->hash_fn(&oldkey), F_WRLCK, &rec);
-		if (!tdb->travlocks.off)
-			return tdb_null;
-		tdb->travlocks.hash = BUCKET(rec.full_hash);
-		if (lock_record(tdb, tdb->travlocks.off) != 0) {
-			TDB_LOG((tdb, 0, "tdb_nextkey: lock_record failed (%s)!\n", strerror(errno)));
-			return tdb_null;
-		}
-	}
-	oldhash = tdb->travlocks.hash;
-
-	/* Grab next record: locks chain and returned record,
-	   unlocks old record */
-	if (tdb_next_lock(tdb, &tdb->travlocks, &rec) > 0) {
-		key.dsize = rec.key_len;
-		key.dptr = tdb_alloc_read(tdb, tdb->travlocks.off+sizeof(rec),
-					  key.dsize);
-		/* Unlock the chain of this new record */
-		if (tdb_unlock(tdb, tdb->travlocks.hash, F_WRLCK) != 0)
-			TDB_LOG((tdb, 0, "tdb_nextkey: WARNING tdb_unlock failed!\n"));
-	}
-	/* Unlock the chain of old record */
-	if (tdb_unlock(tdb, BUCKET(oldhash), F_WRLCK) != 0)
-		TDB_LOG((tdb, 0, "tdb_nextkey: WARNING tdb_unlock failed!\n"));
-	return key;
-}
-
-/* delete an entry in the database given a key */
-static int tdb_delete_hash(TDB_CONTEXT *tdb, TDB_DATA key, uint32_t hash)
-{
-	tdb_off rec_ptr;
-	struct list_struct rec;
-	int ret;
-
-	if (!(rec_ptr = tdb_find_lock_hash(tdb, key, hash, F_WRLCK, &rec)))
-		return -1;
-	ret = do_delete(tdb, rec_ptr, &rec);
-	if (tdb_unlock(tdb, BUCKET(rec.full_hash), F_WRLCK) != 0)
-		TDB_LOG((tdb, 0, "tdb_delete: WARNING tdb_unlock failed!\n"));
-	return ret;
-}
-
-int tdb_delete(TDB_CONTEXT *tdb, TDB_DATA key)
-{
-	uint32_t hash = tdb->hash_fn(&key);
-	return tdb_delete_hash(tdb, key, hash);
-}
-
-/* store an element in the database, replacing any existing element
-   with the same key 
-
-   return 0 on success, -1 on failure
-*/
-int tdb_store(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, int flag)
-{
-	struct list_struct rec;
-	uint32_t hash;
-	tdb_off rec_ptr;
-	char *p = NULL;
-	int ret = 0;
-
-	/* find which hash bucket it is in */
-	hash = tdb->hash_fn(&key);
-	if (tdb_lock(tdb, BUCKET(hash), F_WRLCK) == -1)
-		return -1;
-
-	/* check for it existing, on insert. */
-	if (flag == TDB_INSERT) {
-		if (tdb_exists_hash(tdb, key, hash)) {
-			tdb->ecode = TDB_ERR_EXISTS;
-			goto fail;
-		}
-	} else {
-		/* first try in-place update, on modify or replace. */
-		if (tdb_update_hash(tdb, key, hash, dbuf) == 0)
-			goto out;
-		if (tdb->ecode == TDB_ERR_NOEXIST &&
-		    flag == TDB_MODIFY) {
-			/* if the record doesn't exist and we are in TDB_MODIFY mode then
-			 we should fail the store */
-			goto fail;
-		}
-	}
-	/* reset the error code potentially set by the tdb_update() */
-	tdb->ecode = TDB_SUCCESS;
-
-	/* delete any existing record - if it doesn't exist we don't
-           care.  Doing this first reduces fragmentation, and avoids
-           coalescing with `allocated' block before it's updated. */
-	if (flag != TDB_INSERT)
-		tdb_delete_hash(tdb, key, hash);
-
-	/* Copy key+value *before* allocating free space in case malloc
-	   fails and we are left with a dead spot in the tdb. */
-
-	if (!(p = (char *)talloc_size(tdb, key.dsize + dbuf.dsize))) {
-		tdb->ecode = TDB_ERR_OOM;
-		goto fail;
-	}
-
-	memcpy(p, key.dptr, key.dsize);
-	if (dbuf.dsize)
-		memcpy(p+key.dsize, dbuf.dptr, dbuf.dsize);
-
-	/* we have to allocate some space */
-	if (!(rec_ptr = tdb_allocate(tdb, key.dsize + dbuf.dsize, &rec)))
-		goto fail;
-
-	/* Read hash top into next ptr */
-	if (ofs_read(tdb, TDB_HASH_TOP(hash), &rec.next) == -1)
-		goto fail;
-
-	rec.key_len = key.dsize;
-	rec.data_len = dbuf.dsize;
-	rec.full_hash = hash;
-	rec.magic = TDB_MAGIC;
-
-	/* write out and point the top of the hash chain at it */
-	if (rec_write(tdb, rec_ptr, &rec) == -1
-	    || tdb_write(tdb, rec_ptr+sizeof(rec), p, key.dsize+dbuf.dsize)==-1
-	    || ofs_write(tdb, TDB_HASH_TOP(hash), &rec_ptr) == -1) {
-		/* Need to tdb_unallocate() here */
-		goto fail;
-	}
- out:
-	SAFE_FREE(p); 
-	tdb_unlock(tdb, BUCKET(hash), F_WRLCK);
-	return ret;
-fail:
-	ret = -1;
-	goto out;
-}
-
-static int tdb_already_open(dev_t device,
-			    ino_t ino)
-{
-	TDB_CONTEXT *i;
-	
-	for (i = tdbs; i; i = i->next) {
-		if (i->device == device && i->inode == ino) {
-			return 1;
-		}
-	}
-
-	return 0;
-}
-
-/* a default logging function */
-static void null_log_fn(TDB_CONTEXT *tdb __attribute__((unused)),
-			int level __attribute__((unused)),
-			const char *fmt __attribute__((unused)), ...)
-{
-}
-
-
-TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
-			 int open_flags, mode_t mode,
-			 tdb_log_func log_fn,
-			 tdb_hash_func hash_fn)
-{
-	TDB_CONTEXT *tdb;
-	struct stat st;
-	int rev = 0, locked = 0;
-	uint8_t *vp;
-	uint32_t vertest;
-
-	if (!(tdb = talloc_zero(name, TDB_CONTEXT))) {
-		/* Can't log this */
-		errno = ENOMEM;
-		goto fail;
-	}
-	tdb->fd = -1;
-	tdb->name = NULL;
-	tdb->map_ptr = NULL;
-	tdb->flags = tdb_flags;
-	tdb->open_flags = open_flags;
-	tdb->log_fn = log_fn?log_fn:null_log_fn;
-	tdb->hash_fn = hash_fn ? hash_fn : default_tdb_hash;
-
-	if ((open_flags & O_ACCMODE) == O_WRONLY) {
-		TDB_LOG((tdb, 0, "tdb_open_ex: can't open tdb %s write-only\n",
-			 name));
-		errno = EINVAL;
-		goto fail;
-	}
-	
-	if (hash_size == 0)
-		hash_size = DEFAULT_HASH_SIZE;
-	if ((open_flags & O_ACCMODE) == O_RDONLY) {
-		tdb->read_only = 1;
-		/* read only databases don't do locking or clear if first */
-		tdb->flags |= TDB_NOLOCK;
-		tdb->flags &= ~TDB_CLEAR_IF_FIRST;
-	}
-
-	/* internal databases don't mmap or lock, and start off cleared */
-	if (tdb->flags & TDB_INTERNAL) {
-		tdb->flags |= (TDB_NOLOCK | TDB_NOMMAP);
-		tdb->flags &= ~TDB_CLEAR_IF_FIRST;
-		if (tdb_new_database(tdb, hash_size) != 0) {
-			TDB_LOG((tdb, 0, "tdb_open_ex: tdb_new_database failed!"));
-			goto fail;
-		}
-		goto internal;
-	}
-
-	if ((tdb->fd = open(name, open_flags, mode)) == -1) {
-		TDB_LOG((tdb, 5, "tdb_open_ex: could not open file %s: %s\n",
-			 name, strerror(errno)));
-		goto fail;	/* errno set by open(2) */
-	}
-
-	/* ensure there is only one process initialising at once */
-	if (tdb_brlock(tdb, GLOBAL_LOCK, F_WRLCK, F_SETLKW, 0) == -1) {
-		TDB_LOG((tdb, 0, "tdb_open_ex: failed to get global lock on %s: %s\n",
-			 name, strerror(errno)));
-		goto fail;	/* errno set by tdb_brlock */
-	}
-
-	/* we need to zero database if we are the only one with it open */
-	if ((tdb_flags & TDB_CLEAR_IF_FIRST) &&
-		(locked = (tdb_brlock(tdb, ACTIVE_LOCK, F_WRLCK, F_SETLK, 0) == 0))) {
-		open_flags |= O_CREAT;
-		if (ftruncate(tdb->fd, 0) == -1) {
-			TDB_LOG((tdb, 0, "tdb_open_ex: "
-				 "failed to truncate %s: %s\n",
-				 name, strerror(errno)));
-			goto fail; /* errno set by ftruncate */
-		}
-	}
-
-	if (read(tdb->fd, &tdb->header, sizeof(tdb->header)) != sizeof(tdb->header)
-	    || strcmp(tdb->header.magic_food, TDB_MAGIC_FOOD) != 0
-	    || (tdb->header.version != TDB_VERSION
-		&& !(rev = (tdb->header.version==TDB_BYTEREV(TDB_VERSION))))) {
-		/* its not a valid database - possibly initialise it */
-		if (!(open_flags & O_CREAT) || tdb_new_database(tdb, hash_size) == -1) {
-			errno = EIO; /* ie bad format or something */
-			goto fail;
-		}
-		rev = (tdb->flags & TDB_CONVERT);
-	}
-	vp = (uint8_t *)&tdb->header.version;
-	vertest = (((uint32_t)vp[0]) << 24) | (((uint32_t)vp[1]) << 16) |
-		  (((uint32_t)vp[2]) << 8) | (uint32_t)vp[3];
-	tdb->flags |= (vertest==TDB_VERSION) ? TDB_BIGENDIAN : 0;
-	if (!rev)
-		tdb->flags &= ~TDB_CONVERT;
-	else {
-		tdb->flags |= TDB_CONVERT;
-		convert(&tdb->header, sizeof(tdb->header));
-	}
-	if (fstat(tdb->fd, &st) == -1)
-		goto fail;
-
-	/* Is it already in the open list?  If so, fail. */
-	if (tdb_already_open(st.st_dev, st.st_ino)) {
-		TDB_LOG((tdb, 2, "tdb_open_ex: "
-			 "%s (%d,%d) is already open in this process\n",
-			 name, (int)st.st_dev, (int)st.st_ino));
-		errno = EBUSY;
-		goto fail;
-	}
-
-	if (!(tdb->name = (char *)talloc_strdup(tdb, name))) {
-		errno = ENOMEM;
-		goto fail;
-	}
-
-	tdb->map_size = st.st_size;
-	tdb->device = st.st_dev;
-	tdb->inode = st.st_ino;
-	tdb->locked = talloc_zero_array(tdb, struct tdb_lock_type,
-					tdb->header.hash_size+1);
-	if (!tdb->locked) {
-		TDB_LOG((tdb, 2, "tdb_open_ex: "
-			 "failed to allocate lock structure for %s\n",
-			 name));
-		errno = ENOMEM;
-		goto fail;
-	}
-	tdb_mmap(tdb);
-	if (locked) {
-		if (tdb_brlock(tdb, ACTIVE_LOCK, F_UNLCK, F_SETLK, 0) == -1) {
-			TDB_LOG((tdb, 0, "tdb_open_ex: "
-				 "failed to take ACTIVE_LOCK on %s: %s\n",
-				 name, strerror(errno)));
-			goto fail;
-		}
-
-	}
-
-	/* We always need to do this if the CLEAR_IF_FIRST flag is set, even if
-	   we didn't get the initial exclusive lock as we need to let all other
-	   users know we're using it. */
-
-	if (tdb_flags & TDB_CLEAR_IF_FIRST) {
-	/* leave this lock in place to indicate it's in use */
-	if (tdb_brlock(tdb, ACTIVE_LOCK, F_RDLCK, F_SETLKW, 0) == -1)
-		goto fail;
-	}
-
-
- internal:
-	/* Internal (memory-only) databases skip all the code above to
-	 * do with disk files, and resume here by releasing their
-	 * global lock and hooking into the active list. */
-	if (tdb_brlock(tdb, GLOBAL_LOCK, F_UNLCK, F_SETLKW, 0) == -1)
-		goto fail;
-	tdb->next = tdbs;
-	tdbs = tdb;
-	return tdb;
-
- fail:
-	{ int save_errno = errno;
-
-	if (!tdb)
-		return NULL;
-	
-	if (tdb->map_ptr) {
-		if (tdb->flags & TDB_INTERNAL)
-			SAFE_FREE(tdb->map_ptr);
-		else
-			tdb_munmap(tdb);
-	}
-	SAFE_FREE(tdb->name);
-	if (tdb->fd != -1)
-		if (close(tdb->fd) != 0)
-			TDB_LOG((tdb, 5, "tdb_open_ex: failed to close tdb->fd on error!\n"));
-	SAFE_FREE(tdb->locked);
-	SAFE_FREE(tdb);
-	errno = save_errno;
-	return NULL;
-	}
-}
-
-/**
- * Close a database.
- *
- * @returns -1 for error; 0 for success.
- **/
-int tdb_close(TDB_CONTEXT *tdb)
-{
-	TDB_CONTEXT **i;
-	int ret = 0;
-
-	if (tdb->map_ptr) {
-		if (tdb->flags & TDB_INTERNAL)
-			SAFE_FREE(tdb->map_ptr);
-		else
-			tdb_munmap(tdb);
-	}
-	SAFE_FREE(tdb->name);
-	if (tdb->fd != -1)
-		ret = close(tdb->fd);
-	SAFE_FREE(tdb->locked);
-
-	/* Remove from contexts list */
-	for (i = &tdbs; *i; i = &(*i)->next) {
-		if (*i == tdb) {
-			*i = tdb->next;
-			break;
-		}
-	}
-
-	memset(tdb, 0, sizeof(*tdb));
-	SAFE_FREE(tdb);
-
-	return ret;
-}
diff --git a/tools/xenstore/tdb.h b/tools/xenstore/tdb.h
deleted file mode 100644
index ce3c7339f8..0000000000
--- a/tools/xenstore/tdb.h
+++ /dev/null
@@ -1,132 +0,0 @@
-#ifndef __TDB_H__
-#define __TDB_H__
-
-#include "utils.h"
-
-/* 
-   Unix SMB/CIFS implementation.
-
-   trivial database library
-
-   Copyright (C) Andrew Tridgell 1999-2004
-   
-     ** NOTE! The following LGPL license applies to the tdb
-     ** library. This does NOT imply that all of Samba is released
-     ** under the LGPL
-   
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-
-/* flags to tdb_store() */
-#define TDB_REPLACE 1
-#define TDB_INSERT 2
-#define TDB_MODIFY 3
-
-/* flags for tdb_open() */
-#define TDB_DEFAULT 0 /* just a readability place holder */
-#define TDB_CLEAR_IF_FIRST 1
-#define TDB_INTERNAL 2 /* don't store on disk */
-#define TDB_NOLOCK   4 /* don't do any locking */
-#define TDB_NOMMAP   8 /* don't use mmap */
-#define TDB_CONVERT 16 /* convert endian (internal use) */
-#define TDB_BIGENDIAN 32 /* header is big-endian (internal use) */
-
-#define TDB_ERRCODE(code, ret) ((tdb->ecode = (code)), ret)
-
-/* error codes */
-enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK, 
-		TDB_ERR_OOM, TDB_ERR_EXISTS, TDB_ERR_NOLOCK, TDB_ERR_LOCK_TIMEOUT,
-		TDB_ERR_NOEXIST};
-
-#ifndef uint32_t
-#define uint32_t unsigned
-#endif
-
-typedef struct TDB_DATA {
-	char *dptr;
-	size_t dsize;
-} TDB_DATA;
-
-typedef uint32_t tdb_len;
-typedef uint32_t tdb_off;
-
-/* this is stored at the front of every database */
-struct tdb_header {
-	char magic_food[32]; /* for /etc/magic */
-	uint32_t version; /* version of the code */
-	uint32_t hash_size; /* number of hash entries */
-	tdb_off rwlocks;
-	tdb_off reserved[31];
-};
-
-struct tdb_lock_type {
-	uint32_t count;
-	uint32_t ltype;
-};
-
-struct tdb_traverse_lock {
-	struct tdb_traverse_lock *next;
-	uint32_t off;
-	uint32_t hash;
-};
-
-/* this is the context structure that is returned from a db open */
-typedef struct tdb_context {
-	char *name; /* the name of the database */
-	void *map_ptr; /* where it is currently mapped */
-	int fd; /* open file descriptor for the database */
-	tdb_len map_size; /* how much space has been mapped */
-	int read_only; /* opened read-only */
-	struct tdb_lock_type *locked; /* array of chain locks */
-	enum TDB_ERROR ecode; /* error code for last tdb error */
-	struct tdb_header header; /* a cached copy of the header */
-	uint32_t flags; /* the flags passed to tdb_open */
-	struct tdb_traverse_lock travlocks; /* current traversal locks */
-	struct tdb_context *next; /* all tdbs to avoid multiple opens */
-	dev_t device;	/* uniquely identifies this tdb */
-	ino_t inode;	/* uniquely identifies this tdb */
-	void (*log_fn)(struct tdb_context *tdb, int level, const char *, ...) PRINTF_ATTRIBUTE(3,4); /* logging function */
-	uint32_t (*hash_fn)(TDB_DATA *key);
-	int open_flags; /* flags used in the open - needed by reopen */
-} TDB_CONTEXT;
-
-typedef int (*tdb_traverse_func)(TDB_CONTEXT *, TDB_DATA, TDB_DATA, void *);
-typedef void (*tdb_log_func)(TDB_CONTEXT *, int , const char *, ...);
-typedef uint32_t (*tdb_hash_func)(TDB_DATA *key);
-
-TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
-			 int open_flags, mode_t mode,
-			 tdb_log_func log_fn,
-			 tdb_hash_func hash_fn);
-
-enum TDB_ERROR tdb_error(TDB_CONTEXT *tdb);
-const char *tdb_errorstr(TDB_CONTEXT *tdb);
-TDB_DATA tdb_fetch(TDB_CONTEXT *tdb, TDB_DATA key);
-int tdb_delete(TDB_CONTEXT *tdb, TDB_DATA key);
-int tdb_store(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, int flag);
-int tdb_close(TDB_CONTEXT *tdb);
-TDB_DATA tdb_firstkey(TDB_CONTEXT *tdb);
-TDB_DATA tdb_nextkey(TDB_CONTEXT *tdb, TDB_DATA key);
-int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *);
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif /* tdb.h */
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:10:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:10:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561003.877280 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl23-0004E0-8d; Mon, 10 Jul 2023 07:10:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561003.877280; Mon, 10 Jul 2023 07:10:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl23-0004DX-5b; Mon, 10 Jul 2023 07:10:03 +0000
Received: by outflank-mailman (input) for mailman id 561003;
 Mon, 10 Jul 2023 07:10:02 +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 <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIktU-0002bQ-03
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:01:12 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [2001:67c:2178:6::1c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8c40cad7-1eef-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 09:01:09 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 62BBE21E99;
 Mon, 10 Jul 2023 07:01:09 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 34C9B1361C;
 Mon, 10 Jul 2023 07:01:09 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id VsZ+C7Wsq2RKYwAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 07:01:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8c40cad7-1eef-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688972469; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=zEHQOByY3/G0AhnrW+dmrcu8r5Zv08ynjvJcMWugCDE=;
	b=TIxbIpTALW117ziwWgjeA6zE6IA9D9ZCSEKqeClrHlcJ04hNaghAsnsK43/WJy3P60OJUU
	OxidPEaPbG9/3KCcyGTQO2AjXfGAfVRDLh/OTbyMWUTBJ/bxePyItcFNKmplpl32YOy5nj
	hwB/GjIMi4w4PVuu0prQ2czj/Zov9VY=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 14/18] tools/xenstore: move copying of node data out of db_fetch()
Date: Mon, 10 Jul 2023 08:59:43 +0200
Message-Id: <20230710065947.4201-15-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230710065947.4201-1-jgross@suse.com>
References: <20230710065947.4201-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Today the node data is copied in db_fetch() on each data base read in
order to avoid accidental data base modifications when working on a
node.

read_node() is the only caller of db_fetch() which isn't freeing the
returned data area immediately after using it. The other callers don't
modify the returned data, so they don't need the data to be copied.

Move copying of the data into read_node(), resulting in a speedup of
the other callers due to no memory allocation and no copying being
needed anymore.

As db_fetch() can't return any error other than ENOENT now, error
handling for the callers can be simplified.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- new patch
---
 tools/xenstore/xenstored_core.c        | 41 ++++++++++----------------
 tools/xenstore/xenstored_transaction.c |  3 --
 2 files changed, 16 insertions(+), 28 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 11da470b20..d5c9054fe9 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -557,8 +557,7 @@ static void initialize_fds(int *p_sock_pollfd_idx, int *ptimeout)
 
 struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
 {
-	const struct xs_tdb_record_hdr *hdr;
-	struct xs_tdb_record_hdr *p;
+	struct xs_tdb_record_hdr *hdr;
 
 	hdr = hashtable_search(nodes, db_name);
 	if (!hdr) {
@@ -569,18 +568,9 @@ struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
 	*size = sizeof(*hdr) + hdr->num_perms * sizeof(hdr->perms[0]) +
 		hdr->datalen + hdr->childlen;
 
-	p = talloc_size(NULL, *size);
-	if (!p) {
-		errno = ENOMEM;
-		return NULL;
-	}
-
 	trace_tdb("read %s size %zu\n", db_name, *size + strlen(db_name));
 
-	/* Return a copy, avoiding a potential modification in the DB. */
-	memcpy(p, hdr, *size);
-
-	return p;
+	return hdr;
 }
 
 static void get_acc_data(const char *name, struct node_account_data *acc)
@@ -597,7 +587,6 @@ static void get_acc_data(const char *name, struct node_account_data *acc)
 			acc->memory = size;
 			acc->domid = hdr->perms[0].id;
 		}
-		talloc_free(hdr);
 	}
 }
 
@@ -731,30 +720,32 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	hdr = db_fetch(db_name, &size);
 
 	if (hdr == NULL) {
-		if (errno == ENOENT) {
-			node->generation = NO_GENERATION;
-			err = access_node(conn, node, NODE_ACCESS_READ, NULL);
-			errno = err ? : ENOENT;
-		} else {
-			log("DB error on read: %s", strerror(errno));
-			errno = EIO;
-		}
+		node->generation = NO_GENERATION;
+		err = access_node(conn, node, NODE_ACCESS_READ, NULL);
+		errno = err ? : ENOENT;
 		goto error;
 	}
 
 	node->parent = NULL;
-	talloc_steal(node, hdr);
 
 	/* Datalen, childlen, number of permissions */
 	node->generation = hdr->generation;
 	node->perms.num = hdr->num_perms;
 	node->datalen = hdr->datalen;
 	node->childlen = hdr->childlen;
+	node->acc.domid = hdr->perms[0].id;
+	node->acc.memory = size;
+
+	/* Copy node data to new memory area, starting with permissions. */
+	size -= sizeof(*hdr);
+	node->perms.p = talloc_size(node, size);
+	if (node->perms.p == NULL) {
+		errno = ENOMEM;
+		goto error;
+	}
+	memcpy(node->perms.p, hdr->perms, size);
 
 	/* Permissions are struct xs_permissions. */
-	node->perms.p = hdr->perms;
-	node->acc.domid = get_node_owner(node);
-	node->acc.memory = size;
 	if (domain_adjust_node_perms(node))
 		goto error;
 
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 5d7da82aad..e3e05a1d84 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -365,13 +365,10 @@ static int finalize_transaction(struct connection *conn,
 		if (i->check_gen) {
 			hdr = db_fetch(i->node, &size);
 			if (!hdr) {
-				if (errno != ENOENT)
-					return errno;
 				gen = NO_GENERATION;
 			} else {
 				gen = hdr->generation;
 			}
-			talloc_free(hdr);
 			if (i->generation != gen)
 				return EAGAIN;
 		}
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:13:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:13:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561039.877310 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl5b-0007h9-3e; Mon, 10 Jul 2023 07:13:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561039.877310; Mon, 10 Jul 2023 07:13:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIl5b-0007h2-0x; Mon, 10 Jul 2023 07:13:43 +0000
Received: by outflank-mailman (input) for mailman id 561039;
 Mon, 10 Jul 2023 07:13:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qIl5Z-0007gw-Ug
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:13:41 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2089.outbound.protection.outlook.com [40.107.7.89])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4b6d5e19-1ef1-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 09:13:41 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by DB8PR04MB6921.eurprd04.prod.outlook.com (2603:10a6:10:119::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul
 2023 07:13:10 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 07:13:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4b6d5e19-1ef1-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=QxHTCuyMLNU42ij08/WrToDdE+CVSMV0XxO7p9gkiBAWXZOM8ztCI2KeUWocBMBZsJ+34Wjp0Ke1tNjUgXCkfJUJdmkBp30Y3BIgeta9s/x9iFIYASwXxGHdzqu3jwayYhFB8lk9gZtTeC0p7b1ffbX2nqVCdKls/kdP2pvovVks+i0gu6H7PjoKGUks0vShRR3K+slYWx3jjrZ5D7C91naRU/St1skWSRnrB+GJG/hN9ZXfcuOwjy4BR99fY1yX2cGfbTvKHEq4bO6Afov25Nk1b+VKWudp5TgP5M0KhimKIHPLG+1Iq+khXVASv5H4k0bqjlGbNd58HINcsEPE4w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=iPNBskzHs7SRyoPRZBVHjLPpnZiUNce5R+6Eqo9ZqE0=;
 b=Foi+pwFcAZ/hCX7xyuc4F27CbLPj1yzBkJLBSSOreqI3Hl/es7lVkTRE7faGN0MNySUuHvmtit9JV7VWa3rNxitC0l+G4rdgmgIv3WGdWX/oTVhGqN8IG9D/WQIXzhrPOn75UBNgNagOk9xdgQMjsVguuneOX3a9OcUG6IzEUvJWwEgyYZgfSlmq+xmwy6n3fzhebAG64RpPoY3wGQEdDnNBEzwNPTyRh6NDEg3UCS8k4opP1lQ4ybKEs9iL0spg93DZYp5LiRZIxvHbuzlHlpBtC2te04awK1xU711nhr8bQUddwKsMmE1R2gzDzJQ/VhD6JZwda6LFMsXLXfhzfA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=iPNBskzHs7SRyoPRZBVHjLPpnZiUNce5R+6Eqo9ZqE0=;
 b=2B9s46JuqJ0SbNCk8W+CpONW1/h+eYmkj8oJqmqvtsNH/fJTy6y0f5k3XoW7tebxGvkn3DTALAuaxL7SJTuItT3kJ+vOtACXKF51h2IeEtmlLQ9fh5lUsCNL90lbDg8LcQszDH6hLGGGl4PsiQA0Kauu/YXh+VQXtsIbOcFXX9CR1QoWn7oq74xSelf5ESMAIRXaipualZML/IvQDmar8M/+kJLaInNJ8l/e8wSqEWgnY/blPXxD9Diy/FM9Dv2AU6wH5TR8Wctlk/+6F8MilnyRbdGj7Vengu/too8Bkro97vghNQSf2sUS0n5LfLhtQ69uYQZQESWFjosSjKZlWQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <643b2df8-e3c6-8bee-dba7-141324198791@suse.com>
Date: Mon, 10 Jul 2023 09:13:10 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 04/10] x86 setup: porting dom0 construction logic to boot
 module structures
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org,
 Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Luca Fancellu <luca.fancellu@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Rich Persaud <persaur@gmail.com>,
 Christopher Clark <christopher.w.clark@gmail.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
 <20230701071835.41599-5-christopher.w.clark@gmail.com>
 <alpine.DEB.2.22.394.2307081149090.761183@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307081149090.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0143.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:96::17) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DB8PR04MB6921:EE_
X-MS-Office365-Filtering-Correlation-Id: 21acd519-159c-43d5-0cfd-08db81151e42
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	InknVlxjFgiZ7DlQrX83UaRD2YHvDsAUN4tmyh9+2JuOXWKA8hnqFVx8LTrTbpSWSR4dOMBpmLBl3m/J7BTQBetYfqW2xWG1hWablJKCuKySy/HIw5k5DdBJvoM24fxZmSy+XIRZRNfscNFnbSuftp3E4B04UM3+5rBmnZliIQ+3pzME0MZu9590fcNfU3KiWzowJxpV7qqjHFBj73CI4UxhmoiJdjTRIxwQGdDyTPfHgLp4R7W9CV20krEAqJ8+Vy7lZGpSkaCWUEOyfehvqSAAD4zFE5akxuZNmtD21DjK//CzBJaC62CNjkKFk1XgP1VOFSb/KgpIxP+z6VHMKS557Nwxddcx51nvxQ9TQ2Ro7h4mLQBuuqNSNinYt4Mr24ovDfcsVEoQvwn8NmH1q/Rc02RUI/qImKIXEfP6tu+vXXkkyXB3X6dPkT36ocnSh471XIb2Z12NQgc8BAU5axc07xkQiikqdJUt9rNuAgyAqKpbdhZxhUWjaFZOYlzPp5J9Yk1KIbRaK6sRuMptZVPC23mtbGDfaiuC0SfGm3JwEEeWz96sAwWRxSXrnF0H11wejodJbV77gXcjTkwnI9KAUt1PQxhu3AzWilDBzfADcVUbPM/N8QHyKp3zupmQegQVx2IoxGqBEJeeemjiIQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(376002)(346002)(39860400002)(136003)(451199021)(86362001)(31696002)(38100700002)(31686004)(36756003)(6486002)(54906003)(53546011)(26005)(6506007)(186003)(6512007)(2616005)(7416002)(5660300002)(2906002)(66556008)(316002)(478600001)(66946007)(8936002)(66476007)(8676002)(83380400001)(4326008)(6916009)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?OUphTHFTMDE5ZXVESkxoUENwdUNi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LMnBLdTZ4cjc5SHZLb252UTJaWkRoM3hsQVVJWmlrTU15aWVi?=
 =?utf-8?B?TkdNUW01OG9SNzd5NG5Qb0pxSExIZjd6S2VEZFdOUkdENndEbFhIQ2tYaVNF?=
 =?utf-8?B?S0VOSnI2YnlMQXZ2U1BXc1NDbkZXUEpKRlByWXdCSCs5QzV5TDFMNGp4dmdK?=
 =?utf-8?B?TndnQ2pYUnlQaS9oRTBYemdMd3dZbEF3dVE5Tk02TzRycTlIaDBtdkR2MjZp?=
 =?utf-8?B?YUVWak1obkk4WjNoaDNiNFZmRkI1LzBJcWdMcnAvME42ZW1VU2JyczFRTGli?=
 =?utf-8?B?dkd0a0dubGs0Q1ZuL0o0ZzFsMHNwOXdEUXlTNUYzY0FhNVE4OGd1bExGOEFK?=
 =?utf-8?Q?tSl077s8GjmrgceQrSbik+UUV?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 21acd519-159c-43d5-0cfd-08db81151e42
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 07:13:10.5753
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: XacT9hcypJgSO4OeeHjuhCMxLcq3x7r4ut7WbSvCWmcbCtKunxPiBnFBHWvsazKl/aI3BHNNxefHS07ANNOuTw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6921

On 08.07.2023 21:15, Stefano Stabellini wrote:
> On Sat, 1 Jul 2023, Christopher Clark wrote:
>> @@ -1357,12 +1382,14 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>>           * respective reserve_e820_ram() invocation below. No need to
>>           * query efi_boot_mem_unused() here, though.
>>           */
>> -        mod[boot_info->nr_mods].mod_start = virt_to_mfn(_stext);
>> -        mod[boot_info->nr_mods].mod_end = __2M_rwdata_end - _stext;
>> +        bootmodule_update_start(&boot_info->mods[boot_info->nr_mods],
>> +                                virt_to_maddr(_stext));
>> +        boot_info->mods[boot_info->nr_mods].size = __2M_rwdata_end - _stext;
>>      }
> 
> The original code had the end address as "__2M_rwdata_end - _stext"
> while now we have the size as "__2M_rwdata_end - _stext" which is not
> the same?

A few lines up from here you'll find code adjusting what .mod_end holds:
We use it as a size field in most places (along with using page-granular
.mod_start; page-granular .mod_end wouldn't work as an address, as
modules may be any number of bytes).

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:33:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:33:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561047.877321 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIlOn-0001kE-N7; Mon, 10 Jul 2023 07:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561047.877321; Mon, 10 Jul 2023 07:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIlOn-0001k7-K1; Mon, 10 Jul 2023 07:33:33 +0000
Received: by outflank-mailman (input) for mailman id 561047;
 Mon, 10 Jul 2023 07:33:31 +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 <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qIlOl-0001k1-IH
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:33:31 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on2062a.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::62a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 10053a04-1ef4-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 09:33:28 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PA4PR04MB9413.eurprd04.prod.outlook.com (2603:10a6:102:2a8::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul
 2023 07:33:26 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 07:33:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 10053a04-1ef4-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=b8nygh5oHe1ub2iTHMPf9WEhFoy2Mzb+IKCwPPcVa6q6+zWSnZGPrJwdcs+NZan7KzF50rB/8/1BfzB994ZzfVixX6HO00QL34kXgQBxZtFEYxhpdzhFEuAqSYSSEvo3bD6BsFVRmJoF4C6kbqgXXPcKyyDFDxfXxAi3rlWGfl2IZ1nHV74AfgJIFWaqoD6f6UcxrLotm5giPZSACLCYMtcs/cms4VvRfMPcdpPG0Lo0+XsUs7YgWVuWc5Y9yRKsiXC1xSADL9NeBuJ+TlpxX1JaWwkAIdgRpd45Me9/D/04JkTzlM/oEFczUSlFgIqgj2ETe84axHexzV18dE9ddg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Xm+lrVZeMJ3eGT2eY8a2I4+9B9hujaEBFZgmi1nftno=;
 b=NFA5R8ScPqdzCmWLxn8DNdZHUIeR1z0rLXZOsN6DnufFZD7f8riUbne5T7JPmtYJ2SqCuqJDgJqzEJbygen6l5D7TuiO5cgDA6gXNeM3oJSQLx3Wj/4/1DAfItavXbtmOx9a/d7dmXj2JV/bfOxa50jTFpLCixFIwXHwtEH/qC2NPenffYML6w2Y5hnroc0soBF9fIQg/VGF+s+rET6eKN6+p9Rtbb4TOoYmvS0Bg4X8a95H246zbUDe1CEzO1SmskOtwCdrF7ZwPmorP0zNBYGY9ijoDtjXM1Wfox6WXb0Hp5v093eLybFWajG+k+5Z2kJ2ltElEjOQgJ74JUJsdA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Xm+lrVZeMJ3eGT2eY8a2I4+9B9hujaEBFZgmi1nftno=;
 b=FihqyAdhJPzrgKO7F0t1G1ImdhGkXT3KGIbKifs26Sn+/ej+WX68UvhOYam+jI8yBYlxQMe71F0U4+RnGYONitN/ijWRv1GIPONwfXX5VOAPlobnYwB/Z9W8NjBTcQYJgINHeiVujhPy3WmyAPnRJPgMNR9sY2UQkpwaojV/bD04/Y9+Rb3DGY8FoHaVlJLHAAqu8Xx0JtKplgPaFOijYghgb2hjyCyLH4F8m/Q7B7imkKApGEWZlDi0rquBqBq/zMFYzU0I1cpGyByNfGabsznph1HFRqtgF44e6TjqxRRcbQPTYX9yH9VGYC+FzsJ1auWxm6tdGiedgPKl/tO16w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e14fdd8e-692b-bb19-627a-0462cce45de5@suse.com>
Date: Mon, 10 Jul 2023 09:33:26 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Ping: [PATCH v2 0/2] new CONFIG_HAS_PIRQ and extra_guest_irqs
 adjustment
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <85e59fd5-9a06-48b4-ba7e-81865d44e332@suse.com>
In-Reply-To: <85e59fd5-9a06-48b4-ba7e-81865d44e332@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0090.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1f::6) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PA4PR04MB9413:EE_
X-MS-Office365-Filtering-Correlation-Id: 8edc0b37-fbc1-442d-6c29-08db8117f307
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	hYC7nY1hn9s/AQn+eU86AgpkPZ40A2vlduLCwIzGHBICQORidmAXCIRn8vpwZ2kgJkzvnGBZPQztxA1BVdsdqW5TWCthj4FKujQKEEPWSs28AeD9OsFEZ+BfLtPpfBWkj5l6b1d6Uw6i8ETueCxMdpG+ZNGNE6umAtK8JWM/evqGmrTxkDVT0l7SVsgL1YLVEwgWiHRlOc3qt3kjnYKurpj7F1Xt30oyVObCQRgaszGo8qa+v+/GbTgGV4AnKJtpSDUVA7TXBz+plfwQGQAU59XS55lrl3BeqmHVzcFB5nQxXjW+h8ra36KVGsU1J7KfHOtOc1ggB0tXRRmDn90Fr7InoCzAZ+xYWvHU9zrb4jzjoo4667llxXpMFuhLUGUqLPxzuwGuq319kJKop967p6sJ9bvq8TSoNOF3TtdsO5hYJVIrSOjf9OMKV9UmtXLMg/aVJJ/pl/8EmC4mztOUzwZYJXzWPbfX0xOQ1KxZYPH8lK8Eq65XvZ/ZUC7fgkUknAkroBtRqm4Rg0YJUS8etRLFseR51Tk0r0pjN5iYaTj5ye2AaCD4hwLdmU/YOSubzV9XzaACZYMVhLSwQxRFF9mCw77Zu5sE+Mr43yLDoxWbuVfF0dhFf/m4HeyDbpqpyx9U6qOyUdAJOQLOCmMPug==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(376002)(136003)(39860400002)(366004)(451199021)(6486002)(478600001)(110136005)(54906003)(6506007)(26005)(53546011)(186003)(6512007)(66946007)(4744005)(2906002)(41300700001)(66476007)(4326008)(316002)(5660300002)(66556008)(8936002)(8676002)(38100700002)(2616005)(86362001)(31696002)(36756003)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Z05FS3kzVHNPazRQcDZJeVZwdGZVWG5sRGdxa0QvN1hvYmlvWGV3Tk1MbDNE?=
 =?utf-8?B?aEZ3UnBNYmFjak9NVFZvZUpQNjdQMUVEZktBdW51Mi9ZN1VSNWg1QUFOeE9t?=
 =?utf-8?B?WXM1MjhQeVVZVjJFVDVsVFZScGhUMGY4bENPVVFEZ2RyZllBUllSSkpGcWQv?=
 =?utf-8?B?VEtUaVd0VncrTS9XeDBUa0plUEFRZ2pXSEVYSjBMS2UzeEJRaW9HV01pZ2Rw?=
 =?utf-8?B?TkJldldEWlQ3YnJGYjJQa2FvRnNrSXhGRHQrTWlwWTFLRUQvdHdmMU81QUpN?=
 =?utf-8?B?Y29CMHNSSWRxQS95M1FXaU5XSytWbGt1NHV6dERxYm5PUlNvNXRlc2FPUFZI?=
 =?utf-8?B?NWVpcnpmelFhenN4ZFJIbGxiSnNMdHgyeWVSV1ozdUk0YWVMODlUS2cvWEJ2?=
 =?utf-8?B?NXk4N0ZLaHBQQjB1UUJOL3daNVVLUlhzREpiWllvZmJsd29wVXNQTVVzVGp1?=
 =?utf-8?B?N2RqY2VZdmlUQm5jKy81Q2Q5YVFRYkNlcEVjSjh2S1RHRFdJRFVWQXhrZHBp?=
 =?utf-8?B?YXRPd2Z5MDdEUVRQRWxzT1RPR0d6NldUbDNZaG1XV0dmRnVPSEZDOHVOazdO?=
 =?utf-8?B?YlhxZlhsMHdveEpRaDFvSkVoYWlmT2dUcThnaE14Y3RVTVVzS0dxY3QyMlVL?=
 =?utf-8?B?TVlCZEN0OHNuMjA1M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WZHWlZkNkUvWU5sdlNtaHpETHIvYWl4?=
 =?utf-8?B?am5oSGpoLzhCZGt5Y1BXSHRhajRIZ3BCQy9pM2Q0WDVmWnNpa3NBb3FyUFQz?=
 =?utf-8?B?RWhiRFJXQXlRTWMwRlNMa0tVUytzc2F2eUdyLzh0dzJoSEVFZHowYjZ5bjY4?=
 =?utf-8?B?SGIzeVlQM1BvQ2UzaHJZNGVtdFJzS2s5TjI0TEQrUWdPZ21NUUpxanpvNkNz?=
 =?utf-8?B?VEJkeWxMNjd1ckNMVWx5UjdBd0tDUUpkaDU0ODA4NExqWWgzWWo1YWtpdTdt?=
 =?utf-8?B?Z29RZVFscHE1VGE3ZktHbG1ranRRS05pNHhqS2ZXS1puMEtlbWhkVnJla0Vh?=
 =?utf-8?B?c0VJSGpsb2dMcmhVVUUvTzhEalJaT2daSmFwZjA5SjJOMGwyMm9mTC84eWdu?=
 =?utf-8?B?dkRjYXdYMDdTQUliVVhLNUtyc0ptY3E2OWxNbVVrVy9xMWdsa1BBYkNyZ2or?=
 =?utf-8?B?emZINVRycGtKTjJvdU4wUndzbnBUT0g1WW5YZUsxc1AwQXhid0JSeUVYSUZL?=
 =?utf-8?B?M2trRUxWQlFuamZkcmZBWGlHWnJpRWVoMDRUeWQ1cjF5SmdUTkNmWFVvblpS?=
 =?utf-8?Q?3f8xvjrsuStNAWl+GFAXIanWC?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8edc0b37-fbc1-442d-6c29-08db8117f307
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 07:33:26.5978
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: XE7strx9H9nfmk1i/XeZ8AxxBA2BD0TdDGmeHTmVHvdkI1YnjTNoHQbdzzQVNvjmRGYVOARMVsEnNty4UGmEnQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9413

On 03.05.2023 17:31, Jan Beulich wrote:
> The 1st patch (new in v2) has the effect of the 2nd one no longer
> affecting Arm.
> 
> 1: restrict concept of pIRQ to x86
> 2: cmdline: document and enforce "extra_guest_irqs" upper bounds

REST- and Arm-maintainers,

may I please ask for some feedback here? Roger did supply some, resulting
in me considering to revert back to the earlier version (i.e. patch 1
dropped again and patch 2 minimally adjusted to address feedback there),
but which route to go wants input from other maintainers. What I think is
unacceptable is that we continue to not document and enforce the upper
bound, leading to people needlessly running into issues on big enough
systems.

Just to clarify, "the earlier version" was mistakenly not tagged v2, so
what is meant is the 2nd submission ('cmdline: document and enforce
"extra_guest_irqs" upper bounds'), not the 1st one ('cmdline: document
"extra_guest_irqs" upper bound').

Jan



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 07:43:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 07:43:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561051.877331 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIlYY-0003G8-Ji; Mon, 10 Jul 2023 07:43:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561051.877331; Mon, 10 Jul 2023 07:43:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIlYY-0003G1-H6; Mon, 10 Jul 2023 07:43:38 +0000
Received: by outflank-mailman (input) for mailman id 561051;
 Mon, 10 Jul 2023 07:43:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qIlYX-0003Fv-M9
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 07:43:37 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on0624.outbound.protection.outlook.com
 [2a01:111:f400:fe02::624])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7a6454ab-1ef5-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 09:43:36 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM8PR04MB8003.eurprd04.prod.outlook.com (2603:10a6:20b:240::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul
 2023 07:43:35 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 07:43:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7a6454ab-1ef5-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LMIucmI7C/V8wOWwfDf33NFBbrVN1O4RoMBeTLegEk8/mPpZeg/GOWeVc3DmHzIDwnFwtyZhbqivRCcxp0ZqNedCN+lj8/O2JuVLRGWnbV8g+tPQrKhpk5BrTPNPyD5ZuehmCQHitdmG4Wg+7BW8IPXESMyXIdoEguYiaeFOGhYOubL+8ZbBu2cqkBZllOtcF7+k58NG0XVZCeE3n5XG9INMhVgFmXLk0TrNfUgF4C/WS0rHj7A5eQdQRRbFFTsrr03ZoqHRecoMFNyTBhi6nMMMjqpO9E3YgiOLCklPY3A0bDiXW9YT2rkLYI6AEwMQD5/dKsJUMhqZXXkCgbdjmg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=PQt1i772a/8IewftbY+2LpHC5OCoBLspVSVdblgVqlE=;
 b=j+4vsBVME41J0zhPAGsj6/W66JsDvVvbxTL4LCz2+W6sRP1+uxgw9HDzYIQr0HPIzJqmcZ+e82PnF37lObueSj9t6gSvtIV4S7gu58YV0AUxgk1osxpz0V/NJzz1T0pKYHbNWDmuZOJQJIByXqYVcNSM0SVeq43wWtfVcWS5sbZAbQ8edE5yIpy3FikYil0EHugaMAd7WNRMskwkTFpnFk99JAwzXSL+6+BL9P9J1/LzUT93J+gt2RtBfLovYwOsNK8KTz3wxKLSqq4E5LmhqewKOtMBH76win+x/DJhkGLg2Wx1nAW2DaUkX7PaB51MUg7RAkHzzWlrVsaa8e0qbw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=PQt1i772a/8IewftbY+2LpHC5OCoBLspVSVdblgVqlE=;
 b=lTkkSc4SgILIPcpPTD/4Qkv5KaTCf9Ou7zornYi94kzWONbsqIiPSuh0H6Uu0XzaVJ0Sa+h0USPp+7X5tN3XlR5Ub1VsjLoK/UafeQe2qdyd9gMLM5THuFpfNCWDbsD/i8YvUvrUYrzqtpWIpnybqtQyAZhQ8u7VB6/cOMhz0UX+vQiDcBVY43u9RJGcE2quQ3nhED78Gqm4MxcDCN8bDJtv/DEJPAk96Rq3zhRik6CV/qrpD5mb4hO/uvZN2HjpbOczgur9Vb4De8r+1gKSdG+Rqp6nunlB9YbEy+4LhuKnZdFR2vqUGQDiHjJzS540paBQ2ifzCmYYHzXdGc8UwQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <03e5e1a7-2c04-c991-e3b7-cea6916ec59b@suse.com>
Date: Mon, 10 Jul 2023 09:43:34 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2] mm/pdx: Add comments throughout the codebase for pdx
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230622140237.8996-1-alejandro.vallejo@cloud.com>
 <e7d3daa3-7d5b-1c36-51f1-453bf11b55d2@suse.com>
 <64a83575.170a0220.2c96.8158@mx.google.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <64a83575.170a0220.2c96.8158@mx.google.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0191.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ab::14) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM8PR04MB8003:EE_
X-MS-Office365-Filtering-Correlation-Id: 3799f7f1-2296-4d1f-a0f3-08db81195d9e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Ap0JqGtuR24Fh4phCrXvA+IHtAaIiIbHIULNXUcZ6bcIv1ZGVFQ3Vw1EvNVU1BSMtaLjLg4r+GndTv57InLg8j2P0POxXZ+nl5Ywc2RGVR3XrYNb48RMu0JktlQZVJCMjVbfdqye0haxEciJBtGf/VfhEB/5GmPBGs6iPMzQHRlhHSmolgkVo9Qp3RzWb9+FHqcdiCaXSEyJQRQp/jU296HEFU9wtLCNfXy6JNJeiDD/e6nCRSfMu2Oy5f2m0W6R+quTZS0r/x/IEwJHLP8WdYqnhr+3ZY+LjMGdSLGrnrP9/9Bnnnku6UJtORRrKiHW2G+QywGEtd9Z/ZewPjq2iYnct0hvzOy6EVMNhwUcvl2HA9arm9OJjZYVDADzVaj9KZDA+ZCoOLd0fBzBUYFVmWxlFp2WwnG4QWACoScr8TGaidqZKLD5UYOjRWXB34O0vmZBaDOwI6gMzqJ31d0UwAYBa5oDwMbBXeRxc7PQfLczmpbz9lv0nmGmTE2OQEs29MJN/N0HIgEJIXV/cHC5QYfcssgyuly+ax62MXuP0HTcNuxuIANZ60z1J8CsrhSe4oDY/33rZ+GCyjy/6lwmHGs/gunazMdeKY7CbrO3bmlz7kHsjFqK4ncdUj/+YP6scVOG830hvjmqjLsF0+oZTg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(136003)(366004)(376002)(39860400002)(451199021)(86362001)(38100700002)(31696002)(31686004)(36756003)(6486002)(54906003)(53546011)(26005)(186003)(6506007)(6512007)(2616005)(5660300002)(2906002)(66556008)(316002)(478600001)(66946007)(8936002)(66476007)(8676002)(83380400001)(4326008)(6916009)(41300700001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SytOaFJaTThDZmxseEpMUVNNQ3UwdzFFWDZCZThMUmF5VGcyUERCMUhLcWd4?=
 =?utf-8?B?aW5YMXNNV3ZHYjBsRkZHa2VWSEdobHV5QXkxWW9TWEJFK2NIL29uYVVuUE1K?=
 =?utf-8?B?cGppU2lzLzFWY0dDU2FNZmNQVS9ZREFqZU84RjI4MFVrMVVHZEc3b1VZR01I?=
 =?utf-8?B?eDJaMWpnWHRzMitCM1ptb08xa0w2blRqTnFFSGxMaForK0IwNnIrNC8rcU5M?=
 =?utf-8?B?OWRIVHNFS2hrQVZLTVpUL2JDR01ob1dsd092ZGgrRGlXT0FhN3NWSTZvaUNO?=
 =?utf-8?B?Q3FRbFlFMERkSzlMNEh3cHlwRGQwQzlWYWU2cGdLanFuZi9PckhRYmNJL05Y?=
 =?utf-8?B?OE9hb2ZpTmpNV1hDbkViekVCV2dnVkMwSnV2L09vR3hHUnJtVTFWaWRWbVB5?=
 =?utf-8?B?RzF4VlFyZVp5R29YdzNGVTZWUmh6NmNGKy93MlVzU1ZKVlVyai8zaDBmUFY0?=
 =?utf-8?B?anJyV2tOSFNzYWh1OElrQVl3SEZYclEza3BvdDU5cTB6SnlrZ3dYR3lKWms2?=
 =?utf-8?B?VE9kWkVhUnNyNWhnbVJCcDNXMzczb09CenlETzR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DUzb3dV?=
 =?utf-8?B?MjhKVlpVYUlNMUdHSTdQTHN6b211THRkdnNvZW5SYUVXbDhSdkV1MUV6RGo3?=
 =?utf-8?B?MVlsVjlheFYyN1FIeXNlQ0h3c2FRUno5dXZ5bHVZUXIrZzJ5MUdINEtKckQ0?=
 =?utf-8?B?bUVTSFA3RG9WWGNtVTdneVNJYUNFRmkzekRsbGZFeXJwemVyTzQ5ckpFVDVM?=
 =?utf-8?B?TmVjOHZyUmZrTHN4WXN4T0tJV3EzdDVSc1Bha1JqbTRRckRzTk0xUFVxM2VI?=
 =?utf-8?B?eUdjZ2QwYXJZV25ma0R3WFRZWWQvZlNzWnZFZE1ZWEM0a1I0SWJZRlRDYlFP?=
 =?utf-8?B?MEMwb1BXTTNvSXozK04wWFFXcjlzcElIZjlHbytyeHFQcDZTeThjbmJnRkY3?=
 =?utf-8?B?c1JEeDE4RXV3RlR6WTJlUTgwZ0lNRFp2b1R1NEhMMmJhRUIxZXllSXNwbzFh?=
 =?utf-8?B?eS91RStYQ21kL3FiSmdrNitReTF1OS9Hem9RY0hBQ0FJMkwvMGJWUG4zTjlQ?=
 =?utf-8?B?YnZpTDQ0ZmYwWVJZSjR0Q0dZQmxUU05OcmFPcHVNQUk2ejBKV1lTY3NaZmJ2?=
 =?utf-8?B?MkVsajZueWFoUlBtVVNDZDUwbFE2KzkxVW1VblBzWldlVnlEbHErRmlhWFJN?=
 =?utf-8?B?VHhUbHdoYlB2VFIxVHJxakFRbXNzbVFIZFprYVlIQlN6Nis4NjZpZHROSXBo?=
 =?utf-8?Q?rEJfPklP3V2OIo6WaHEYtAc/Z?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3799f7f1-2296-4d1f-a0f3-08db81195d9e
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 07:43:34.8962
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 5xvXbegFCI11FryMkUgUvK2Pi8uPxoyeKkjVbWTqGd0EmEigdmAPT53zpj3kZdInFz5Byr39m2ol9nBzPSsAEg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB8003

On 07.07.2023 17:55, Alejandro Vallejo wrote:
> On Thu, Jul 06, 2023 at 11:50:58AM +0200, Jan Beulich wrote:
>> On 22.06.2023 16:02, Alejandro Vallejo wrote:
>>> @@ -57,9 +100,25 @@ uint64_t __init pdx_init_mask(uint64_t base_addr)
>>>                           (uint64_t)1 << (MAX_ORDER + PAGE_SHIFT)) - 1);
>>>  }
>>>  
>>> -u64 __init pdx_region_mask(u64 base, u64 len)
>>> +uint64_t __init pdx_region_mask(uint64_t base, uint64_t len)
>>>  {
>>> -    return fill_mask(base ^ (base + len - 1));
>>> +    uint64_t last = base + len - 1;
>>> +    /*
>>> +     * The only bit that matters in base^last is the MSB. There are 2 cases.
>>> +     *
>>> +     * case msb(base) < msb(last):
>>> +     *     then msb(fill_mask(base^last)) == msb(last). This is non
>>> +     *     compressible.
>>> +     * case msb(base) == msb(last):
>>> +     *     This means that there _may_ be a sequence of compressible zeroes
>>> +     *     for all addresses between `base` and `last` iff `base` has enough
>>> +     *     trailing zeroes. That is, it's compressible when
>>
>> Why trailing zeros? [100000f000,10ffffffff] has compressible bits
>> 32-35, but the low bits of base don't matter at all.

This is ...

>>> + * ## PDX compression
>>> + *
>>> + * This is a technique to avoid wasting memory on machines known to have
>>> + * split their machine address space in several big discontinuous and highly
>>> + * disjoint chunks.
>>> + *
>>> + * In its uncompressed form the frame table must have book-keeping metadata
>>> + * structures for every page between [0, max_mfn) (whether they are backed
>>> + * by RAM or not), and a similar condition exists for the direct map. We
>>> + * know some systems, however, that have some sparsity in their address
>>> + * space, leading to a lot of wastage in the form of unused frame table
>>> + * entries.
>>> + *
>>> + * This is where compression becomes useful. The idea is to note that if
>>> + * you have several big chunks of memory sufficiently far apart you can
>>> + * ignore the middle part of the address because it will always contain
>>> + * zeroes as long as the base address is sufficiently well aligned and the
>>> + * length of the region is much smaller than the base address.
>>
>> As per above alignment of the base address doesn't really matter.
> Where above?

... what "above" here meant.

> As far as I understand you need enough alignment to cover the
> hole or you won't have zeroes to compress. Point in case:
> 
>   * region1: [0x0000000000000000 -
>               0x00000000FFFFFFFF]
> 
>   * region2: [0x0001FFFFFFFFF000 -
>               0x00020000FFFFFFFF]
> 
> I can agree this configuration is beyond dumb and statistically unlikely to
> exist in the wild, but it should (IMO) still be covered by that comment.

Right, but this isn't relevant here - in such a case no compression
can occur, yes, but not (just) because of missing alignment. See the
example I gave above (in the earlier reply) for where alignment
clearly doesn't matter for compression to be possible.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 08:09:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 08:09:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561063.877341 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIlxd-0006TF-6Q; Mon, 10 Jul 2023 08:09:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561063.877341; Mon, 10 Jul 2023 08:09:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIlxd-0006T8-2b; Mon, 10 Jul 2023 08:09:33 +0000
Received: by outflank-mailman (input) for mailman id 561063;
 Mon, 10 Jul 2023 08:09:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gbMe=C4=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qIlxb-0006T2-D1
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:09:31 +0000
Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com
 [2a00:1450:4864:20::236])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1863b348-1ef9-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 10:09:30 +0200 (CEST)
Received: by mail-lj1-x236.google.com with SMTP id
 38308e7fff4ca-2b700e85950so60942331fa.3
 for <xen-devel@lists.xenproject.org>; Mon, 10 Jul 2023 01:09:30 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 l23-20020a2ea317000000b002b1b92910c8sm1892323lje.86.2023.07.10.01.09.28
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 10 Jul 2023 01:09:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1863b348-1ef9-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688976569; x=1691568569;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=rQ3YaondrW5LA+gOinnTfEk+gHMn0xC/EdwUREwUx2E=;
        b=IrBTY+tX3Rwu6xUjE+rIPsddknJKAo4xRdatLv84FMyG33rJ9rXWR4rw0ojyU0eAWF
         6beQ45gxVjb9foTr8IpAfWd/E2M/7v/PPxOuXcMxE99FQ6F9edBFSvHgCxKLlnBe2BoP
         5uNIIg+q29JD1rX2mRSz9BPONBfx+TeJINyxQR070AjcnsfOK7fo+6jTbP22OuzUvDYw
         LiOf3/UTTi3v8ZmZ0JmAwOpqeLb/TkqDSt1ef4B5cgzyreRKJl2NqNOc9DZ9C3qXnuOb
         lTnPkvzSdvn4baO6/c9Bcjj8A1yUnxfwBgXkeeIrV1qo9h+tTm2PCUf5s46ye5SvPpDg
         vIDw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688976569; x=1691568569;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=rQ3YaondrW5LA+gOinnTfEk+gHMn0xC/EdwUREwUx2E=;
        b=B6Wze+cFPsOmfAyBQJ70slz228R2ZIPy6dsRPSJ7mT7mndCiBRhQaB1whGLZEY/BSH
         QzI4BZn9bpAZ+g1O0f/yyZL+Ut/RDeZAFjTYf3Pfs5Yva0fOM9u3TcO+N0AMYY+e5jSX
         yOo/4Y6xy1yfTnUhLKPzoRKe0nBrOoRXA6Oz3w3GkQfPvFKD6+dviyj47QatZnrWJK6h
         BMUOQj5MOg1ux0MYHu59uewJ0YY8eb8+KvZbs4UQjQoryiNG+NyYPS29SoeXaAIU9pZn
         PnC1JowKEqUfBudr2ufRHe/nuJ2rnRh1SkXyWtNmuOBKWm0OFGzuOIxwkPbU5RrxWjNW
         MkmQ==
X-Gm-Message-State: ABy/qLZv0lrD2UzcDZ1pnwrNMBfd8rovuLEIGYgWcLHpkR6UhGD8TXhO
	kIoQb9vuAWKst899XKeC9p0=
X-Google-Smtp-Source: APBJJlGixzxtZqbEqSBbXT9ylEeUqPzdDtaiIvSDbxrQoj9CTLJEMOsaiQgDjG36J5SQ/uN5+gbiDQ==
X-Received: by 2002:a2e:924e:0:b0:2b1:b4e9:4c3 with SMTP id v14-20020a2e924e000000b002b1b4e904c3mr9402861ljg.2.1688976569327;
        Mon, 10 Jul 2023 01:09:29 -0700 (PDT)
Message-ID: <886888f6a47973c84485d554e0fd71c331dcc35b.camel@gmail.com>
Subject: Re: [PATCH v2 2/6] xen/riscv: introduce reset_stack() function
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall
 <julien@xen.org>,  Bob Eshleman <bobbyeshleman@gmail.com>, Alistair Francis
 <alistair.francis@wdc.com>, Connor Davis <connojdavis@gmail.com>,
 xen-devel@lists.xenproject.org
Date: Mon, 10 Jul 2023 11:09:28 +0300
In-Reply-To: <be40e52e-454c-57ba-0ad1-6fae2b896332@suse.com>
References: <cover.1687178053.git.oleksii.kurochko@gmail.com>
	 <6024617719467cd2da8ae03b81ddc899f2ba4311.1687178053.git.oleksii.kurochko@gmail.com>
	 <98f1cb38-673a-c66f-96be-ba2cb6ff242f@suse.com>
	 <ba2694c1e64b6bdf493170c72564ae72d701b700.camel@gmail.com>
	 <be40e52e-454c-57ba-0ad1-6fae2b896332@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Fri, 2023-07-07 at 11:33 +0200, Jan Beulich wrote:
> On 07.07.2023 11:08, Oleksii wrote:
> > On Thu, 2023-07-06 at 13:17 +0200, Jan Beulich wrote:
> > > On 19.06.2023 15:34, Oleksii Kurochko wrote:
> > > > --- a/xen/arch/riscv/riscv64/head.S
> > > > +++ b/xen/arch/riscv/riscv64/head.S
> > > > @@ -27,8 +27,16 @@ ENTRY(start)
> > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 add=C2=A0=C2=A0=C2=
=A0=C2=A0 t3, t3, __SIZEOF_POINTER__
> > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bltu=C2=A0=C2=A0=
=C2=A0 t3, t4, .L_clear_bss
> > > > =C2=A0
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 jal=C2=A0=C2=A0=C2=A0=
=C2=A0 reset_stack
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tail=C2=A0=C2=A0=C2=A0 =
start_xen
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .section .text, "ax", %=
progbits
> > > > +
> > > > +ENTRY(reset_stack)
> > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 la=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 sp, cpu0_boot_stack
> > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 li=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 t0, STACK_SIZE
> > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 add=C2=A0=C2=A0=C2=
=A0=C2=A0 sp, sp, t0
> > > > =C2=A0
> > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tail=C2=A0=C2=A0=C2=A0 =
start_xen
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret
> > > > +
> > >=20
> > > Looking at patch 4 you will want to add a comment here to
> > > emphasize
> > > that a0 and a1 have to remain unclobbered.
> > Thanks for a note. I'll add it in the new patch version
>=20
> Having seen how things end up by the end of the series, there's an
> alternative: You could save a0 and a1 ahead of the 1st call to
> reset_stack, rather than immediately afterwards.
It makes sense. So lets stick to saving of a0 and a1 before 1st call of
reset_stack().

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 08:11:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 08:11:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561068.877351 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIlzf-0007s3-Hn; Mon, 10 Jul 2023 08:11:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561068.877351; Mon, 10 Jul 2023 08:11:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIlzf-0007rw-EI; Mon, 10 Jul 2023 08:11:39 +0000
Received: by outflank-mailman (input) for mailman id 561068;
 Mon, 10 Jul 2023 08:11:38 +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
 <SRS0=gbMe=C4=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qIlze-0007rk-7S
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:11:38 +0000
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com
 [2a00:1450:4864:20::132])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 637ca87f-1ef9-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 10:11:36 +0200 (CEST)
Received: by mail-lf1-x132.google.com with SMTP id
 2adb3069b0e04-4fb863edcb6so6300694e87.0
 for <xen-devel@lists.xenproject.org>; Mon, 10 Jul 2023 01:11:36 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 d3-20020a2eb043000000b002b6da1b49c6sm1893155ljl.52.2023.07.10.01.11.35
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 10 Jul 2023 01:11:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 637ca87f-1ef9-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688976696; x=1691568696;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=sCvhrMfb/s4X4KvWNxZ3ivyanu/BY6rkZ7GVWUy41Kw=;
        b=JfBMDy5HC631wskRFnT/V0ZjmfdZC/NMttDVofgzXr98fp1Jgbud9kcLgvSyxOBhL0
         5FLlXFuqXWG4etNVhPm8rwvXbcsIQ1exgnBZgYj20zKMoCDXWug7e/B0bO5hGVzddlrw
         MU+ZiKokw8j0UeA5FJ4YY5tUi4b1V1DdrOjZUC8/YbchAR8tccBbbbdxUhdKA3SZxRoF
         FXx9UR7Vu/BVWk4YSR1VtQ8d/7N4ZnK7JLgz/+KfWHdNKft1SKPchAGh/giYQeM558rm
         nwZk1sc+cc7EeCZH7DvKw479Ifjsivko6rUEI16HmgYp4NjccjO8VoSIpCL1eZxf5PR1
         MKLA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688976696; x=1691568696;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=sCvhrMfb/s4X4KvWNxZ3ivyanu/BY6rkZ7GVWUy41Kw=;
        b=a0OkUveQ2SCY5xibXMrSKc3QERHfNPfWnJrfGgLFr027FwftaJYRS7FAWItw2SgNc9
         asorYLSTVMzUP7ODYMx314AR+DokcsglkF/eHOljxvA5oRQvhvJ7KwyVhAxg8hp+bfJz
         L1zblJFVNXR4ZFvE9zLqKC+qA09wmr/FBEpJkn2Hnbm6NVluvBVT3qUG6MzUro1U4uCp
         2k+ndpwy97Kf/HzqQo2/LgdX6XTGSEgDBewZCSNx05TPXJdN8Dx4EhXr8JNu1MnsDxhW
         TZ4ucWpQF2pjBCuuPTg2mCYuibdu/JlxPgI8r5E5Sk+1FnMBaDM/DJIbRRKkfIGMTFZ4
         nS8A==
X-Gm-Message-State: ABy/qLZnM7o7dCukxbq5BC8PLYDFtPFjGxQfvQsrvh2gOb5Cj2qkVdC4
	NFnlUfA3NYOMXmXS/nykHTM=
X-Google-Smtp-Source: APBJJlF9NPYGNY6I87LGk1UvZyawvpecsePdcnDbe6DuWm1MW3hsIyAj2XhcpUk5AX3Qzj7bNhiTRg==
X-Received: by 2002:a2e:9104:0:b0:2b6:e7c7:b039 with SMTP id m4-20020a2e9104000000b002b6e7c7b039mr9075385ljg.28.1688976695620;
        Mon, 10 Jul 2023 01:11:35 -0700 (PDT)
Message-ID: <57e367737e0ef40a584587d0f4dcc4bc23a70fbd.camel@gmail.com>
Subject: Re: [PATCH v2 3/6] xen/riscv: introduce function for physical
 offset calculation
From: Oleksii <oleksii.kurochko@gmail.com>
To: Julien Grall <julien@xen.org>, Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Bob Eshleman
	 <bobbyeshleman@gmail.com>, Alistair Francis <alistair.francis@wdc.com>, 
	Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
Date: Mon, 10 Jul 2023 11:11:34 +0300
In-Reply-To: <b4cdc12c-19e8-cc5a-a981-052800970d38@xen.org>
References: <cover.1687178053.git.oleksii.kurochko@gmail.com>
	 <f84bdc5ad9f10f864d070f7581dce663ccc9cb53.1687178053.git.oleksii.kurochko@gmail.com>
	 <c716120e-8228-826a-bb33-298aa47b94f7@suse.com>
	 <29c4af7dcc95956c12818fd024416930f90e12f7.camel@gmail.com>
	 <b4cdc12c-19e8-cc5a-a981-052800970d38@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Fri, 2023-07-07 at 10:17 +0100, Julien Grall wrote:
>=20
>=20
> On 07/07/2023 10:12, Oleksii wrote:
> > On Thu, 2023-07-06 at 13:18 +0200, Jan Beulich wrote:
> > > On 19.06.2023 15:34, Oleksii Kurochko wrote:
> > > > --- a/xen/arch/riscv/riscv64/head.S
> > > > +++ b/xen/arch/riscv/riscv64/head.S
> > > > @@ -29,6 +29,8 @@ ENTRY(start)
> > > > =C2=A0=20
> > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 jal=C2=A0=C2=
=A0=C2=A0=C2=A0 reset_stack
> > > > =C2=A0=20
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 jal=C2=A0=C2=A0=C2=A0=
=C2=A0 calc_phys_offset
> > > > +
> > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tail=C2=A0=
=C2=A0=C2=A0 start_xen
> > > > =C2=A0=20
> > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .section .te=
xt, "ax", %progbits
> > >=20
> > > Since you call a C function, the code to save/restore a0/a1 needs
> > > to
> > > move here (from patch 4).
> > Thanks. It makes sense.
> > It would be better to move save/restore a0/a1 ( from patch 4 )code
> > here.
> >=20
> > The only one reason I didn't do that before that calc_phys_offset
> > doesn't touch that and it is guaranteed that it will not ( as it
> > doesn't have arguments )
>=20
> IIUC, the calling convention requires a0/a1 to be caller saved. So
> even=20
> if they are not used for arguments, such callee is still free to use=20
> them for internal purpose.
You are right.

I haven't seen that compiler use them if 'void' is passed to function
as an argument. But I agree that we have to follow the calling
convention to be sure that all is fine.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 08:15:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 08:15:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561072.877361 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIm3m-0000GY-1a; Mon, 10 Jul 2023 08:15:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561072.877361; Mon, 10 Jul 2023 08:15:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIm3l-0000GR-VB; Mon, 10 Jul 2023 08:15:53 +0000
Received: by outflank-mailman (input) for mailman id 561072;
 Mon, 10 Jul 2023 08:15:53 +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
 <SRS0=gbMe=C4=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qIm3l-0000GL-CP
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:15:53 +0000
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com
 [2a00:1450:4864:20::132])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fb8ddb62-1ef9-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 10:15:51 +0200 (CEST)
Received: by mail-lf1-x132.google.com with SMTP id
 2adb3069b0e04-4fbbfaacfc1so6411432e87.1
 for <xen-devel@lists.xenproject.org>; Mon, 10 Jul 2023 01:15:51 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 x23-20020ac25dd7000000b004faf6a87d63sm1608147lfq.38.2023.07.10.01.15.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 10 Jul 2023 01:15:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fb8ddb62-1ef9-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688976951; x=1691568951;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=lKUHGa5/11cgHeI5dBycIE5wsCZp3knTuOZ8P58dfJg=;
        b=K99sQT3TXi4ivuKhRP+VQ3S8tz+NtkCQ9uYLBxhhBz/OsRdtouNgKYgiTQKDp+8Hu6
         Znp7J5+iQ5MPCCyLR5KOXAg1EXhjfaQaoj9phBp7/yCRNwF6wa3EMaxc/Q5SFjYa0kdi
         asbO6C2b1cdWe2/eJILEFQaxm4oE3gbcRbcr8CR/syqQD0xWcqSbuW6mm8UBMAEZUuXg
         F2IlaPgb+HWUAvXOb+umrqI+GOFZpbWcczg77XxVrTLxPG1Q1KxyD3P418mL0rdfaGin
         PF5yWM0iWC54EYKJg9DxWxJIvV0U9MyPrqW6vXr05LkxA18McqhuUi/Q2LoSbi3Up11k
         YZMA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688976951; x=1691568951;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=lKUHGa5/11cgHeI5dBycIE5wsCZp3knTuOZ8P58dfJg=;
        b=KMHdnZpHno2K2hA0x4vzMot1tSuLTyIMQRxVEUHmVjpBHJhJq/1JW6bVLNpwU4qUCA
         lLj4S5Q6N1qawv8WjycVUx1lkWqs/FC0cHNOqkm5+fT1/Leq7qZYRhzQXmGl/6fKeotK
         9Qy4pM+bcbTX4FVEh0RxhM/Dk3ZJIQ0O2P3PciClRXzcF79dHKtMZRXlHc3oPluWEGVu
         XzyL0Bk47af6FzsqNPi1mnFOrNufX4w3S+Iux9AiLQpY/5UX67JcSb2f1iMxn15mAs/K
         odhdLd4F3HlvjZlNVZCz1xGeEei80QzOy8IrhuxEi/uiad+82/xD6RFmsaznEry29goH
         dCNw==
X-Gm-Message-State: ABy/qLaks4pOkTQCGC/6Ir5q8b6tSdn0Sg9BwLH+aNGo2q/Gj+tNH8F/
	LtUrjYhmbK9G/5WbjyYFOGg=
X-Google-Smtp-Source: APBJJlH3kHi3y+7Cs3dvnNROg+d2nQvAo338PrKA3UcQSzfaLVsZmNLla8yJkWM6rdtT1IyZ4VVs6g==
X-Received: by 2002:a19:645e:0:b0:4fb:8948:2b2b with SMTP id b30-20020a19645e000000b004fb89482b2bmr8374841lfj.48.1688976950717;
        Mon, 10 Jul 2023 01:15:50 -0700 (PDT)
Message-ID: <dcf0130ac1c6332b341a892730c9857e328e62a0.camel@gmail.com>
Subject: Re: [PATCH v2 3/6] xen/riscv: introduce function for physical
 offset calculation
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall
 <julien@xen.org>,  Bob Eshleman <bobbyeshleman@gmail.com>, Alistair Francis
 <alistair.francis@wdc.com>, Connor Davis <connojdavis@gmail.com>,
 xen-devel@lists.xenproject.org
Date: Mon, 10 Jul 2023 11:15:49 +0300
In-Reply-To: <7ab29494-a74c-5a03-3a91-acf30e39884f@suse.com>
References: <cover.1687178053.git.oleksii.kurochko@gmail.com>
	 <f84bdc5ad9f10f864d070f7581dce663ccc9cb53.1687178053.git.oleksii.kurochko@gmail.com>
	 <c716120e-8228-826a-bb33-298aa47b94f7@suse.com>
	 <29c4af7dcc95956c12818fd024416930f90e12f7.camel@gmail.com>
	 <7ab29494-a74c-5a03-3a91-acf30e39884f@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Fri, 2023-07-07 at 11:35 +0200, Jan Beulich wrote:
> On 07.07.2023 11:12, Oleksii wrote:
> > On Thu, 2023-07-06 at 13:18 +0200, Jan Beulich wrote:
> > > On 19.06.2023 15:34, Oleksii Kurochko wrote:
> > > > --- a/xen/arch/riscv/riscv64/head.S
> > > > +++ b/xen/arch/riscv/riscv64/head.S
> > > > @@ -29,6 +29,8 @@ ENTRY(start)
> > > > =C2=A0
> > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 jal=C2=A0=C2=A0=C2=
=A0=C2=A0 reset_stack
> > > > =C2=A0
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 jal=C2=A0=C2=A0=C2=A0=
=C2=A0 calc_phys_offset
> > > > +
> > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tail=C2=A0=C2=A0=
=C2=A0 start_xen
> > > > =C2=A0
> > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .section .text, "a=
x", %progbits
> > >=20
> > > Since you call a C function, the code to save/restore a0/a1 needs
> > > to
> > > move here (from patch 4).
> > Thanks. It makes sense.
> > It would be better to move save/restore a0/a1 ( from patch 4 )code
> > here.
> >=20
> > The only one reason I didn't do that before that calc_phys_offset
> > doesn't touch that and it is guaranteed that it will not ( as it
> > doesn't have arguments )
>=20
> How does a function not having parameters guarantee that registers
> used for parameter passing aren't touched? Inside a function, the
> compiler is free to use argument-passing registers just like other
> temporary ones; their values don't need preserving, from all I know
> (otherwise the RISC-V ABI would be different to all other ABIs I
> know of).
Well, you are right that it doesn't guarantee and the calling
convention tells that arg registers should be saved/restored
before/after function call.

But I haven't seen yet that compiler touch arg registers if function
accepts 'void' as an function argument. So 'guarantee' isn't correct
word.

Thanks for the note.

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 08:31:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 08:31:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561076.877371 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImI9-0002FS-S6; Mon, 10 Jul 2023 08:30:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561076.877371; Mon, 10 Jul 2023 08:30:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImI9-0002FK-Nw; Mon, 10 Jul 2023 08:30:45 +0000
Received: by outflank-mailman (input) for mailman id 561076;
 Mon, 10 Jul 2023 08:30:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qImI8-0002FA-6E; Mon, 10 Jul 2023 08:30:44 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qImI8-0000hE-3b; Mon, 10 Jul 2023 08:30:44 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qImI7-0001fk-Nn; Mon, 10 Jul 2023 08:30:43 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qImI7-00065f-NL; Mon, 10 Jul 2023 08:30:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=B7Vso+zDIb6PvlIlV8c7RcM2MNAAT6q+3coBxSMTxrk=; b=nPmFUjPQ713D/Fc9m6vDkfgWUi
	5JgvXDrGajwda1LKXGRwG76uI+rkky6dF8uZ5MK9cD4uI1VAK/NSYN8SsOgKdSi1Qd6MW6TVobHoj
	XFXfhdRE5KEAsR1annwhD6j7qpM4+XneSc3XWCZkGfTm4Id7A6tND6zV31sjO1Hr2mG4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181747-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181747: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-libvirt-raw:xen-install:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=886c22f00c575199f7bb3dc5b7662dd09bf05146
X-Osstest-Versions-That:
    xen=886c22f00c575199f7bb3dc5b7662dd09bf05146
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 10 Jul 2023 08:30:43 +0000

flight 181747 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181747/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-i386-libvirt-raw   7 xen-install                  fail  like 181741
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181741
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181741
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181741
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181741
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181741
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181741
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181741
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181741
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181741
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181741
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181741
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181741
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  886c22f00c575199f7bb3dc5b7662dd09bf05146
baseline version:
 xen                  886c22f00c575199f7bb3dc5b7662dd09bf05146

Last test of basis   181747  2023-07-10 01:53:29 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 08:50:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 08:50:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561084.877381 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImb4-0004mD-Dm; Mon, 10 Jul 2023 08:50:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561084.877381; Mon, 10 Jul 2023 08:50:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImb4-0004m6-AH; Mon, 10 Jul 2023 08:50:18 +0000
Received: by outflank-mailman (input) for mailman id 561084;
 Mon, 10 Jul 2023 08:50:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qImb2-0004lj-6s
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:50:16 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on2060f.outbound.protection.outlook.com
 [2a01:111:f400:fe12::60f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c9815b39-1efe-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 10:50:15 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by DU2PR04MB9051.eurprd04.prod.outlook.com (2603:10a6:10:2e6::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul
 2023 08:50:12 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 08:50:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c9815b39-1efe-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LaO1xj4JoHLku5CYQbUS123Ny7IqPD2UHr6tBo4c/mYDzYnJEY5/0BLJmLcOi/bjv1EYOXLjpmYuVU9vpkw+bxc+oh0bpfX9GM3bwtuUzrOhIrk8z8GRkVJiHytcEjlqBs8lijIMOrgOBhWwlcPMcvzn6MwAvYYNa2AaLV0G+AEizk7yuxoo+tvT4D+G0/r1j4Yj9nNnZ8htVmSRpyqb6VSmMHfXkvVmFYxDhneah1kifEhldf3Hr4W4P1Xy8O9zI1i8W+3WpRdUXCoCmKgTs8xj0tUciZ54dxf+QWiWge4/LFhHgM9ISQ+QqG0RJt0kXzmOTIj2UKaUst8yUiaKsA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=vxmprdSxQ7NzIrnBHDl/E2ygyuGSmIFpCgkPRy/wVPs=;
 b=ocdOS/mYJydWNbpgmhvToUx0WOHSZBkOWEHTfwB0zCfsi0m/yo0ZmWUgUS8U4l5pwE6qd31/SmL+imjc/u0V5vXmY9HCZiRqPruiiBXSqNZnxfswAWFjdyw66vuI1TUeQfh5MD/lSax8lAatzRkGjAjxmqSGB7Qt7ryzXR0TTDTE+64GTlX2WR9UQ7XucD5SDsuJNAk4N3UBdv1dg3nWVgitDiQLVkia7QO8F1OhhhlpPS+nDy7ztRFJDDpw1BSqswq/fPpqUtWV6tBzJXDgcSPGsk/QBzWhN62ky6nbPYR1xEpuoQ5nKF5br+LSbQ1oHtiy+NfkzWM8j6C8XAlrnA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=vxmprdSxQ7NzIrnBHDl/E2ygyuGSmIFpCgkPRy/wVPs=;
 b=V7YLnALy+5m1in+N7mYRbH6pX0N//s1jUEza6vpl65mJ8C7JjD8cjq445eUnaa29mb7sM4n04LIIzzjU5qWW5YN3KqV/tS8p2ce75fqDLpTMqNotWDlDncIM0yi2YPEDyYm8egADF6qMd2wxY/QZVh/7Qj22BcAfpCSFFhazn47kKZrO85wyPBj+13VKxKR7OkeU/GOmx+qcdHmmPkMNPvsn80UuxwTzCEi8m9QIA0CEr3QvhulGyFbjnFG1DbB0U22xzB6oE9M3eaiCobNGK3BR3sqMwORO/86HyiIF/enishXs4CEhxxiSCiUhomaOOIRahZKkot/vT+EcTT33yQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
Date: Mon, 10 Jul 2023 10:50:10 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v3 0/8] annotate entry points with type and size
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Bobby Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
Content-Language: en-US
In-Reply-To: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0061.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:93::18) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DU2PR04MB9051:EE_
X-MS-Office365-Filtering-Correlation-Id: e984f691-b1b4-4e21-4402-08db8122ac09
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	sWCqke3SW9FeyZrW2mtp0wRG8E5/TP5sKLS0Nszo3oa92EZhi7GkiTBR8pakxPzWjpOxHad4C3M+2jOYUMlfykHqGEPN8LxfQc6DBlgI0aevkaecqqlPGYXT02QYqQCAqJ877Ltx++0fm4fxFDUFwUPcPnh6j/kJepGm/dyh9V3xsDYUa40k1mSt1v6kBYLxB4qXRKae+DifId1nPZ194qsiuMcDxD/CMxGLPQBqonqEM1vXMFHxt4ojDtr4GDnsEi88/orzRRbci2ZYq7QcdeA7+VkHqIf9PWKEXdb5ZxjSmKLs4N4ZP8tHEW9OYvsQWdYMoEE/BaG5KwSDW0sKpIORPkSPLOxSc+htRxM7Q96XW7gjZ9wq5Dn4qVubeDPbHwhusL0Cyj0K7f9Hbr+R97MtdU/tjuCnHOP8/rSmwB/2UjB5vVJ99HiWyd/VxfSdARqehMerKyd70S5qeuIcCboiG/sNoePEoKpVsF9yUyhsx0+hEb/r1gdp7LfHwvYQCdUdVBYd3MMxF9bcut52NLEhj+9gV/soM1BAagMiNPVxMdEMaWhmcOfEz4x2XCajCV7lWcRSMZeOuzMJBlj6Djj4zITC7fZZefC3pkUANjFKzVx6QdiIPEOrjWlJMQ2AnSpKmJ4pPsK08WS9QOflMA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39850400004)(376002)(136003)(346002)(396003)(366004)(451199021)(186003)(26005)(6506007)(2616005)(6512007)(41300700001)(4326008)(6916009)(4744005)(2906002)(66556008)(316002)(7416002)(5660300002)(66476007)(8676002)(8936002)(478600001)(66946007)(6486002)(54906003)(36756003)(38100700002)(31696002)(86362001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szc3NVpzRW5xcFE1V0oyWDF0L0kwek1xa281bDZPaXlM?=
 =?utf-8?B?R2JiTGQyekRLLy90bnkycnZES3BBekpHY25XMXVNN01jTkJEOGNtMi9Vekl0?=
 =?utf-8?B?MFB1amN5OHVmNUtDMmZzeXFFNkdqS3hGelVsM1BNREtRaW8vZEl1aUwxb0pk?=
 =?utf-8?B?OUJ0bFhqNm43NFlFcUJLZDBPa1hqOVVmMmRiUnJJeUo5YnJFRUR5K2phNlYx?=
 =?utf-8?B?eEF5TElIMHZsbFdZbzlZdlFyRS9YUlB5aHhMN2R3ZG9KRXg1azlrWHZ5aWVB?=
 =?utf-8?B?VFpJWVpIcFRWeFBNL2VpUjNGa0N1RGNEc1c4NUJUZEg0M2R1RTRmREVmRXZ1?=
 =?utf-8?B?SktRVUhCZ0lVeXlMRjBwNGgrS0h1Mm5RZlpMMmFlT2JSd0hyL3JDOUlhUHZ3?=
 =?utf-8?B?dTRiSnBoaWtlcHNGOHdGcUFzN2lmZS9JbjY2ZzhubHhFVlkzYldJYmszMXZm?=
 =?utf-8?Q?msUyYbW34FGbIL2X9gCzfEb0m?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e984f691-b1b4-4e21-4402-08db8122ac09
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 08:50:11.9994
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 5JnsAA/h9D/ui3wAYLIgX3PL/kX6DE7ZsGOo/leoKBl9vhC15fcY6F9ZZ+yxyyih+Vt619pGqvSUuCi9vzbghg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9051

The model introduced in patch 2 is now arch-agnostic, and all arch-es
are being switched at least partly (to at least give examples of how
things will look like).

1: common: move a few macros out of xen/lib.h
2: common: assembly entry point type/size annotations
3: x86: annotate entry points with type and size
4: x86: also mark assembler globals hidden
5: Arm: annotate entry points with type and size
6: RISC-V: annotate entry points with type and size
7: PPC: switch entry point annotations to common model
8: tools/binfile: switch to common annotations model

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 08:51:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 08:51:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561088.877391 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImcY-0005JL-Q4; Mon, 10 Jul 2023 08:51:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561088.877391; Mon, 10 Jul 2023 08:51:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImcY-0005JC-Lz; Mon, 10 Jul 2023 08:51:50 +0000
Received: by outflank-mailman (input) for mailman id 561088;
 Mon, 10 Jul 2023 08:51:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qImcX-0005Iv-Qk
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:51:49 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0616.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::616])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 01668577-1eff-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 10:51:48 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS4PR04MB9315.eurprd04.prod.outlook.com (2603:10a6:20b:4e6::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.29; Mon, 10 Jul
 2023 08:51:46 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 08:51:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 01668577-1eff-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=boDeWuly+CArVxcmaeYsFzKsPDXCvc5MRTx6r1Ccapry0XZHNmgdMumajk9xRITRvNAHB1GnWOnxzrGpLzs0XJvyw3sjw9vdYYtbTrNJP7gqIfKlojLsFJLqGJbc81qoAaQWLzE/MShv2YsKTysxKY6VaYd36HkBPTpbxiwNkDoAxl61wQhsmBILzGfZcJxFVkjd2GbhYh8gI6v/G9qrzdCIiL0VIKFw3wg8rfSynRsDtphc591zU6ja5+rHoDxS9vzKn7bCK/r69X3/3TYS0YeKJ3Dafb1yLBGYL+Fz8YqAY4Sq1CsjC3rR735bbLa+L4+IRRai+mK4SZzcI9BtXg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=tEZqfEecVCoAUXwOun3bnx9/68WK0/jJ2cWnhbpIMB4=;
 b=PF6xwndGerjT8tw/LkfWcGZvKVmwzQie0114bTUZj1VOlqH/bmAz7HYgWW7hMmiBgFgU0tIkO/yjTtQ358Zn+CRzKjKolvGvcG6PDMhB6uHp5sttfM2YB/uZXhq81+H2Z+Ng6uoBIs35PfnmcFN9js25yqRz09qpkkOKW2IZEgUvl1mDLUtzE8XOnvjZTsNUZMOrOQEXe9W1EzZ8ZnbwAjchIlOuKuAEH0lt+LMl0tcKWlku9TWSADxgD5TDfU7LNeHUKpYADYQfTWgjx5ME+SeN9pYypJlLYTBlWpvrzuJc84bwCSdHAt6LOyhRzmke56Hl14N9XNRjYs7gwdmXuQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=tEZqfEecVCoAUXwOun3bnx9/68WK0/jJ2cWnhbpIMB4=;
 b=r4HjOhRjApcM5FmymXKsMvObQOvyu9f13oaaqCEnXaLo12sIz4mFmAUwqcut376jyD2Zef5UFdeyWArb5fAdMj0mZusmkCyWV8sBHj8rAALwvcu4wXRdKR4u//uyIjLiqgaYThrsefLdsToNTJ7sfWDivXD5bd4/hdJpQHK9N6MaiKV0bngpY7sahg7kMBgRlb0W3ZUJECrAMG8hDcoUB2NbvM5i56zRKkpNYdjUANl66vAl+idvrLu4xzf4aO9zZJpHqMzusu2K9Eu18UKdwWvn6iFjSsIhLM86PNBE7Bv5r4ZQ06CSWyeUzkRZYhNkPqI39iMlOy3Lv6fhZFcG+w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <109efb43-a519-73f6-2a26-2b420090ab2b@suse.com>
Date: Mon, 10 Jul 2023 10:51:45 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v3 1/8] common: move a few macros out of xen/lib.h
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 George Dunlap <george.dunlap@citrix.com>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
 <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
In-Reply-To: <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0117.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9d::7) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS4PR04MB9315:EE_
X-MS-Office365-Filtering-Correlation-Id: 29d5f7fb-262d-4b15-2534-08db8122e498
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	6vWreUL6Zd5iA+zK4pxxSyIOGGKfsuQt5MUGif/pKDea0KefKenLB8eieNCWIa9MK2fUTQTWvYrWtY2OByGhlxs8dqr0gjcI93WO0GArl6nC4/gYTo6RXrIHDiGTmqQGNaZkGXUv+3ztpXA77ADopESSgC2mVy0AzxKXuI4WJLUrmW5aDvFQ/Q33twwyq6CPGFfyLZXJ1GxhNY29jMu1y03RO+X8Rm/x/G6XiIU5FN+CUc9oed2PFrD2Vzm06Sg1HhyHDE3l8fEZu06rIW2o4kVvBnoa5D+KF3STwT9s8YBCvNY5ftAs5oDUwSTisiPcoFNtyeWJR+9zGQmc/31EjWmdyGYwBisVAORtCt/6TT6PIHDT/38RbvivDqq3FSHBAmVubZhU8q+DDbtfboIYJkI5cpoNL0jDDfR5HFZlcZge6DODQJU8LHpyLITqOb5W7D62Cp8F4+ljq9xp7qJBNaKeVyOqbbVAtYe7Xnu6AtTY0NPQAzs49m+b6brlYmRGqMAkaNbWKzt4VWKmUW8nVxBklw3ZLqYgQp/reqjhuhZmjThahQRQLjxsMPCrhrixzTMzfuzR0KySJ/xai5PzvVJc+9TbH3kXA+I7avtyM1Nga3cVxJtF3e3SUC0UiohHhVySUs+bD2/D5IcNf4Y6UA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(346002)(39860400002)(136003)(376002)(451199021)(31686004)(478600001)(4326008)(54906003)(2616005)(86362001)(31696002)(36756003)(2906002)(26005)(6512007)(6506007)(6486002)(186003)(38100700002)(66556008)(5660300002)(316002)(41300700001)(8936002)(66476007)(66946007)(8676002)(6916009)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TEhxZ2UwMW1WVnBDVFl2Z3FxNTBGTTk4Nm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ycDgyQ3p5ZTRvUDF3ckdPU09MY3o5dnIycHVoMmFY?=
 =?utf-8?B?RllRR1grV3Y2dnBnZ3BhS29Tc0ZEc2puc3ZYUGRVUm1XKzJWUmZ0WklOUGdK?=
 =?utf-8?B?Q0RadWRzZmprT2FveGFELzdGc2EraktmUkcyZjRuZkpzZWJUQU1vWUtXMDNX?=
 =?utf-8?B?ZzEwT0NIRk96dE16QXhOSVQrRkdGait6bEYyV2ZWMnNnc0ZMMnR3WFUrSm5N?=
 =?utf-8?B?cXN2OEIydk1XcUJwdDlnM1J1Nk5CVmxBSDVzZGp5K0NsV01saFR0UmhsR3Iv?=
 =?utf-8?B?cXEzd0hURkppWnhjcE9ZV0NtOTA5RnBCV3gvazhZaVd3ZTQzOUlZd2Zvb2VH?=
 =?utf-8?Q?5QVs45ZtjnzMd9r7XRju62ZQT?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 29d5f7fb-262d-4b15-2534-08db8122e498
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 08:51:46.7935
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: U4v3w9ptASt+7jWppW4uYPuHow5qQtkVuzmJ5TMXeVoUFksc8KOPnyma5aa8aDjk/EQoc2H4YtJ4+1aHvsiMoA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9315

Introduce xen/macros.h for this purpose. For now xen/lib.h simply
includes xen/macro.h, until consumers can be suitable cleaned up.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v3: New.

--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -1,26 +1,7 @@
 #ifndef __LIB_H__
 #define __LIB_H__
 
-#define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
-
-#define IS_ALIGNED(val, align) (!((val) & ((align) - 1)))
-
-#define DIV_ROUND(n, d) (((n) + (d) / 2) / (d))
-#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
-
-#define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m)))
-#define MASK_INSR(v, m) (((v) * ((m) & -(m))) & (m))
-
-#define count_args_(dot, a1, a2, a3, a4, a5, a6, a7, a8, x, ...) x
-#define count_args(args...) \
-    count_args_(., ## args, 8, 7, 6, 5, 4, 3, 2, 1, 0)
-
-/* Indirect macros required for expanded argument pasting. */
-#define PASTE_(a, b) a ## b
-#define PASTE(a, b) PASTE_(a, b)
-
-#define __STR(...) #__VA_ARGS__
-#define STR(...) __STR(__VA_ARGS__)
+#include <xen/macros.h>
 
 #ifndef __ASSEMBLY__
 
--- /dev/null
+++ b/xen/include/xen/macros.h
@@ -0,0 +1,34 @@
+#ifndef __MACROS_H__
+#define __MACROS_H__
+
+#define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
+
+#define IS_ALIGNED(val, align) (!((val) & ((align) - 1)))
+
+#define DIV_ROUND(n, d) (((n) + (d) / 2) / (d))
+#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
+
+#define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m)))
+#define MASK_INSR(v, m) (((v) * ((m) & -(m))) & (m))
+
+#define count_args_(dot, a1, a2, a3, a4, a5, a6, a7, a8, x, ...) x
+#define count_args(args...) \
+    count_args_(., ## args, 8, 7, 6, 5, 4, 3, 2, 1, 0)
+
+/* Indirect macros required for expanded argument pasting. */
+#define PASTE_(a, b) a ## b
+#define PASTE(a, b) PASTE_(a, b)
+
+#define __STR(...) #__VA_ARGS__
+#define STR(...) __STR(__VA_ARGS__)
+
+#endif /* __MACROS_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 08:52:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 08:52:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561092.877400 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImdM-0005q1-2c; Mon, 10 Jul 2023 08:52:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561092.877400; Mon, 10 Jul 2023 08:52:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImdL-0005pu-Vx; Mon, 10 Jul 2023 08:52:39 +0000
Received: by outflank-mailman (input) for mailman id 561092;
 Mon, 10 Jul 2023 08:52:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qImdK-0005pm-RI
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:52:38 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on060d.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::60d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1eb69bf3-1eff-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 10:52:38 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS4PR04MB9315.eurprd04.prod.outlook.com (2603:10a6:20b:4e6::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.29; Mon, 10 Jul
 2023 08:52:36 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 08:52:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1eb69bf3-1eff-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=L+En57oQQSPTZAqHAmSxPyhTAHgvj17DALtgge4jIsYs6oA2IL+4Mqriy9EKO9rPZ3Otd2WnA634fC1SvBKAb+jkpL4GELtqRm56l7CSqGY2Ydj+ayewcjU7iZrWpbfEKhHocy/k3LM1birIGrA5BkTYHlGrk9abiZXpKwRFgI1QbVm2Ci4CTz78iD7cFJ0g0DHosjeixbbeIXJ+FzkOAfZq++vz6cT+NdTIr0RIzbtsLokkUnx0l5NO1X2XXqvQ9hIO1ias5bgD2HOIccvBDRi3JxKU4niSeiTn7paZpchhrbeFbWxzMZgTMq+bLcVpdAs7O2DYJrXS8gEBaFLxZw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Njshz39xQXWzUhA0rIyJzlUroK26ZOgCP1y5HqVWGkc=;
 b=l9N+oSAPoI4ar5xQtsr3s7vg3AHX3vuVeTjz4JjVXGsBhu5UJ3TMzGcpxCygkCVD56071oeo8Js0MG1e6BrRVVOrf+axH+nE/unX2F4JrhGBHn1umbLCnkh24tEW+vejH6MF6/V3ohtK0WvxayFLf65HqCdKxcfdtD0XUbhX6fUfLjsu8hmmlNyeVBzK18buwMNKl8hg2oGiav2hyCaxKGmu94Zx2DTADJ5mLZiWZY0ToaA8HlT0jBeMSEx8XElpnhfRkzI5wTj8hN+0OuocHzTauecCGEBCybohp5+Gjk6Z8MMsgnwO6HYJyXKA15pLHkWhB7db48n3C7naG0ptIQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Njshz39xQXWzUhA0rIyJzlUroK26ZOgCP1y5HqVWGkc=;
 b=PpHfwbxubi50Zze7hViJybvADhiYC0wPvmGdysQQ2ZpjEVlci1DuXu5pCclt2GTY9bRH7yrjcTd5HEXnxdrYHlMQYx32/p4nQwGQbRok/KTcUeJ28VbT0TDM9LOEJ9di29/zqHj7Y9rNi77v7Cr2wB60voJVfYO7eQjiFhDt5sRy20zmdNkxPwsFdOex9zcQ1Ub0a5cVQBJYz5N+EIJAH7/YJQHqLCMFy1aZZ6j9q6UdVJvT7pVNClwo9RtNIPVYCjM9yHfOrnvYrQvxpuDOcEnOjW8ah8dBJvBbHbyn1s8gNFQKWNfVa0x2uEy7nfLWdQRg2V4JgTJ5ylIhiSR+hg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e685d0d4-72a0-e628-c0af-75849fbdab67@suse.com>
Date: Mon, 10 Jul 2023 10:52:34 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v3 2/8] common: assembly entry point type/size annotations
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 George Dunlap <george.dunlap@citrix.com>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
 <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
In-Reply-To: <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0125.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9d::19) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS4PR04MB9315:EE_
X-MS-Office365-Filtering-Correlation-Id: 74920813-a889-4af5-2e54-08db812301e8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	WvBd+tBkx6BccUgQIQNEALAMP8Q53U+xgUI7QJG/S/jahPI4Iqamyabdo52axjc3aeYpN9fvjskEIlsBMJcR/SlwmJ1AQ3ffvaBtWrczsOs1c084by4kvst/3CdvgiqjUzZGqxAuswcAusokCF6tFi2AnaG5DE/ZdDLfjezheV2vPlrHmQ7lhLg2TYBvZxyTs80SVecBTySzxo4VDWHfUr2ZggWAsNrNU3ShwMti95eOjtdh9gBI12fzauh9SJaVx2L5lk97x5TCW6vCrsVR79oaqrbaqsH0cvrlsnKKer2HLD1KiX06ZIgGdrLk9RdxBD8XjnH/PPTiupAdknjN2Uhjeg+JaNKI65QeCqrf6uHIPUDB6UO/Y14yCC12dvpxWO17OnQymiv1yChlXwANvmn1WRqUpJySWp7c0lGzyMPsXYlKdStV0NggIlz25fqcUiK2HzqxlVXtnA+I+vbs9zyu//RAWmtuFL7Dnf1Z4J2S/CWdiV7N1UzEHN3g2rqmz9u8cciVArEWhTuj1za1vMAjalYxHVigkE2OgZHh4JgYUZSmQgFWZv5sEG0iImzUwqxy0vFqgh3JRhm29CyyUl5fCqODtwzArdoPuAff1Mg1mE/Ke32x7I5pdLX68ZZLldg7qBTTj/MDZQu5OrE48A==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(346002)(39860400002)(136003)(376002)(451199021)(31686004)(478600001)(4326008)(54906003)(2616005)(86362001)(31696002)(36756003)(2906002)(966005)(26005)(6512007)(6506007)(6486002)(186003)(38100700002)(66556008)(5660300002)(316002)(41300700001)(8936002)(66476007)(66946007)(8676002)(6916009)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WjFuZWREOU1OeFNIb1hreFNpd0NZdGE0Y0FPZis3V1NFMEErbGtuS1g4ZnRm?=
 =?utf-8?B?R2ViZFl4eTZ3SDB6YlNCZWpzY1h2eWUzVVdHdE5XZ01WdnFucVFSclMvQ01o?=
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QWluMktVMnlqL0dLcEF3VGVXTFJMRnVyU2F2aFYwSVVS?=
 =?utf-8?B?bDNBMWNkVDJwaHFFQmk5VlM0NFRMVnRaRUNrcENRY3JSSk50d1RyWnZKMklJ?=
 =?utf-8?B?MmFvQTR0b2ZCQ0tkK0VDUjFHQWJUQnkxQXlaVk1SelVyVDIwQkxaRHpjWkZq?=
 =?utf-8?B?NlQrYWtzanoxYmk1d0dMdkNEVFpvS1d1WWZkczU4aDZTRXViSG9aTkp0bC9M?=
 =?utf-8?B?dEVBY21hYW1Gc25GWUloV3dsMDlDSkVnTE9yb3pIbm1JaXBSaURQckM0S2NZ?=
 =?utf-8?Q?viZuIClV7rEb1mSfBAw1qvCcz?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 74920813-a889-4af5-2e54-08db812301e8
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 08:52:35.9723
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 28CeclLfKUPr5AFGA+2dmN3r2sss919lvKYpuYPIJV1Kze1UqCoTEA/6hMTp4ksFSFAeup1hqtZ1r5X8kwwaRg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9315

Recent gas versions generate minimalistic Dwarf debug info for items
annotated as functions and having their sizes specified [1]. Furthermore
generating live patches wants items properly annotated. "Borrow" Arm's
END() and (remotely) derive other annotation infrastructure from
Linux'es, for all architectures to use.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

[1] https://sourceware.org/git?p=binutils-gdb.git;a=commitdiff;h=591cc9fbbfd6d51131c0f1d4a92e7893edcc7a28
---
v3: New, generalized from earlier x86-only version. LAST() (now
    LASTARG()) moved to macros.h.
---
TBD: What to set CODE_ALIGN to by default? Or should we requires arch-es
     to define that in all cases?

TBD: {CODE,DATA}_ALIGN are byte granular, such that a value of 0 can be
     specified (in case this has some special meaning on an arch;
     conceivably it could mean to use some kind of arch default). We may
     not strictly need that, and hence we could also make these power-of
     -2 values (using .p2align).

Note that we can't use ALIGN() (in place of SYM_ALIGN()) as long as we
still have ALIGN.

Note further that FUNC()'s etc "algn" parameter is intended to allow for
only no or a single argument. If we wanted to also make the fill value
customizable per call site, the constructs would need re-doing to some
degree.

--- /dev/null
+++ b/xen/include/xen/linkage.h
@@ -0,0 +1,56 @@
+#ifndef __LINKAGE_H__
+#define __LINKAGE_H__
+
+#ifdef __ASSEMBLY__
+
+#include <xen/macros.h>
+
+#ifndef CODE_ALIGN
+# define CODE_ALIGN ??
+#endif
+#ifndef CODE_FILL
+# define CODE_FILL ~0
+#endif
+
+#ifndef DATA_ALIGN
+# define DATA_ALIGN 0
+#endif
+#ifndef DATA_FILL
+# define DATA_FILL ~0
+#endif
+
+#define SYM_ALIGN(algn...) .balign algn
+
+#define SYM_L_GLOBAL(name) .globl name
+#define SYM_L_WEAK(name)   .weak name
+#define SYM_L_LOCAL(name)  /* nothing */
+
+#define SYM_T_FUNC         STT_FUNC
+#define SYM_T_DATA         STT_OBJECT
+#define SYM_T_NONE         STT_NOTYPE
+
+#define SYM(name, typ, linkage, algn...)          \
+        .type name, SYM_T_ ## typ;                \
+        SYM_L_ ## linkage(name);                  \
+        SYM_ALIGN(algn);                          \
+        name:
+
+#define END(name) .size name, . - name
+
+#define FUNC(name, algn...) \
+        SYM(name, FUNC, GLOBAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL)
+#define LABEL(name, algn...) \
+        SYM(name, NONE, GLOBAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL)
+#define DATA(name, algn...) \
+        SYM(name, DATA, GLOBAL, LASTARG(DATA_ALIGN, ## algn), DATA_FILL)
+
+#define FUNC_LOCAL(name, algn...) \
+        SYM(name, FUNC, LOCAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL)
+#define LABEL_LOCAL(name, algn...) \
+        SYM(name, NONE, LOCAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL)
+#define DATA_LOCAL(name, algn...) \
+        SYM(name, DATA, LOCAL, LASTARG(DATA_ALIGN, ## algn), DATA_FILL)
+
+#endif /*  __ASSEMBLY__ */
+
+#endif /* __LINKAGE_H__ */
--- a/xen/include/xen/macros.h
+++ b/xen/include/xen/macros.h
@@ -15,6 +15,15 @@
 #define count_args(args...) \
     count_args_(., ## args, 8, 7, 6, 5, 4, 3, 2, 1, 0)
 
+#define ARG1_(x, y...) (x)
+#define ARG2_(x, y...) ARG1_(y)
+#define ARG3_(x, y...) ARG2_(y)
+#define ARG4_(x, y...) ARG3_(y)
+
+#define ARG__(nr) ARG ## nr ## _
+#define ARG_(nr)  ARG__(nr)
+#define LASTARG(x, y...) ARG_(count_args(x, ## y))(x, ## y)
+
 /* Indirect macros required for expanded argument pasting. */
 #define PASTE_(a, b) a ## b
 #define PASTE(a, b) PASTE_(a, b)



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 08:53:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 08:53:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561098.877411 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImeL-0006T3-GQ; Mon, 10 Jul 2023 08:53:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561098.877411; Mon, 10 Jul 2023 08:53:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImeL-0006Sw-DL; Mon, 10 Jul 2023 08:53:41 +0000
Received: by outflank-mailman (input) for mailman id 561098;
 Mon, 10 Jul 2023 08:53:40 +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
 <SRS0=gbMe=C4=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qImeK-0006Sk-EY
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:53:40 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 42b3db50-1eff-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 10:53:38 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-4fba86f069bso6458425e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 10 Jul 2023 01:53:38 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 b11-20020a056512024b00b004fb76751156sm1611076lfo.157.2023.07.10.01.53.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 10 Jul 2023 01:53:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 42b3db50-1eff-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1688979217; x=1691571217;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=8A25Ofh6EHiYPaglhgbe/Nue8Bthl09YvlTGHT+WidQ=;
        b=r3cL5DrBW4wyLMJm62QRRWASPNN4j1SSrtf8CyyhhMewqDZeON2nWfQEiFFeHH0I99
         Zn9s51RND+fY0J7SqoeH3O6d+zPYwqVIy0BCvwtKHJpZbpf19hUE8wVYLd4QQdM6gXob
         +T+nCUBgXfnR11rINI/o1PGJzV112hkkqUMbvF42W0W+ZI4DrpmWTGksMAJcQg3u/ulr
         fqXOyt49erKENcSgOKdjI91kFLdpANelBZQdzLHYSYqJwImnW/naLiekA4dJbVCJI/xJ
         L6XlBWO1/0wR+BB+xi0kCT9wJ09hnKuy5YjEttpTfZ68ZCkV5SlaX5l6mok3ZeICIKO3
         A8eg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1688979217; x=1691571217;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=8A25Ofh6EHiYPaglhgbe/Nue8Bthl09YvlTGHT+WidQ=;
        b=djzeJISoLevX+qoa56d/n5p9Gy8sKO97nLPtE6XRN42OQquUPK8jq8rXxXoW9gggn6
         pkB0wDqzBW8DytOZ9VkrRBHhO6c7fwrIk2Ku3susqLUaq0WAvaC16ER3s5X/qYE/jb8J
         KjPfyEl2ON3QDqXPfihHjgkoIrl8U1P7R8PQX7Raw0M2vj/7achtMwOupaMuhJj6IpKL
         jO9fzdH9YxKdZ0ivbS1R72FYrIvGtJhkNKxtzuRQr5MEUIlt92EcmqdK4Ih/MrmLtxjI
         hNMijlyVH+vkAKVIlQ9Cco6HVzqwTGQ4TO7u7ta3/oGe8Fkye/p2R4W+2QCHIsAz0pYp
         6KwQ==
X-Gm-Message-State: ABy/qLZVx6aVFKqlgeP0ERw0zYDwuWt4UVsoRgehh6RE819I78Yuvhb0
	I/HfPs5mdvhwA27r4VPSvBzzqHcMacI=
X-Google-Smtp-Source: APBJJlH4zg1sJNwuNMQo06FaGv+koEmh/bMz9qR+toc7LsD87NpEhQceFbx7QEcohn8MF/JyiLmhag==
X-Received: by 2002:a19:691e:0:b0:4f9:5718:70b0 with SMTP id e30-20020a19691e000000b004f9571870b0mr8359227lfc.41.1688979217439;
        Mon, 10 Jul 2023 01:53:37 -0700 (PDT)
Message-ID: <9e6fdb4f946b804ae102069825b0f56a3997a4dc.camel@gmail.com>
Subject: Re: [PATCH v2 4/6] xen/riscv: introduce identity mapping
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall
 <julien@xen.org>,  Bob Eshleman <bobbyeshleman@gmail.com>, Alistair Francis
 <alistair.francis@wdc.com>, Connor Davis <connojdavis@gmail.com>,
 xen-devel@lists.xenproject.org
Date: Mon, 10 Jul 2023 11:53:36 +0300
In-Reply-To: <69699edb-78b2-336c-15f5-2b243257852e@suse.com>
References: <cover.1687178053.git.oleksii.kurochko@gmail.com>
	 <21d8ce65f718bc10c2213688f79cf5f978bcaf16.1687178053.git.oleksii.kurochko@gmail.com>
	 <67df28ad-060e-07d5-acf2-02c3cd5f0b96@suse.com>
	 <1edb0c61a8ef64bb47809049252e9ad7b19f4bbe.camel@gmail.com>
	 <69699edb-78b2-336c-15f5-2b243257852e@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Fri, 2023-07-07 at 12:51 +0200, Jan Beulich wrote:
> On 07.07.2023 12:37, Oleksii wrote:
> > On Thu, 2023-07-06 at 13:35 +0200, Jan Beulich wrote:
> > > On 19.06.2023 15:34, Oleksii Kurochko wrote:
> > > > --- a/xen/arch/riscv/include/asm/config.h
> > > > +++ b/xen/arch/riscv/include/asm/config.h
> > > > @@ -1,3 +1,5 @@
> > > > +/* SPDX-License-Identifier: GPL-2.0-only */
> > > > +
> > > > =C2=A0#ifndef __RISCV_CONFIG_H__
> > > > =C2=A0#define __RISCV_CONFIG_H__
> > > > =C2=A0
> > >=20
> > > Unrelated change?
> > It=C2=A0 should be part of [PATCH v2 5/6] xen/riscv: introduce identity
> > mapping.
>=20
> Hmm, here we're discussing "[PATCH v2 4/6] xen/riscv: introduce
> identity
> mapping". I'm confused, I guess.
Sorry for confusion. i meant the patch: [PATCH v2 5/6] xen/riscv: add
SPDX tags.

>=20
> > > > --- a/xen/arch/riscv/mm.c
> > > > +++ b/xen/arch/riscv/mm.c
> > > > @@ -25,6 +25,12 @@ unsigned long __ro_after_init phys_offset;
> > > > =C2=A0#define LOAD_TO_LINK(addr) ((unsigned long)(addr) -
> > > > phys_offset)
> > > > =C2=A0#define LINK_TO_LOAD(addr) ((unsigned long)(addr) +
> > > > phys_offset)
> > > > =C2=A0
> > > > +/*
> > > > + * Should be removed as soon as enough headers will be merged
> > > > for
> > > > inclusion of
> > > > + * <xen/lib.h>.
> > > > + */
> > > > +#define ARRAY_SIZE(arr)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(sizeof(arr) /
> > > > sizeof((arr)[0]))
> > > > +
> > > > =C2=A0/*
> > > > =C2=A0 * It is expected that Xen won't be more then 2 MB.
> > > > =C2=A0 * The check in xen.lds.S guarantees that.
> > > > @@ -35,8 +41,10 @@ unsigned long __ro_after_init phys_offset;
> > > > =C2=A0 *
> > > > =C2=A0 * It might be needed one more page table in case when Xen
> > > > load
> > > > address
> > > > =C2=A0 * isn't 2 MB aligned.
> > > > + *
> > > > + * (CONFIG_PAGING_LEVELS - 1) page tables are needed for
> > > > identity
> > > > mapping.
> > > > =C2=A0 */
> > > > -#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) + 1)
> > > > +#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) * 2 +
> > > > 1)
> > >=20
> > > How come the extra page (see the comment sentence in context)
> > > isn't
> > > needed for the identity-mapping case?
> > It is needed to allocate no more than two 'nonroot' page tables (L0
> > and
> > L1 in case of Sv39 ) as page 'root' table ( L2 in case of Sv39 ) is
> > always re-used.
> >=20
> > The same ( only 'nonroot' page tables might be needed to allocate )
> > works for any MMU mode.
>=20
> Of course, but if you cross a 2Mb boundary you'll need 2 L0 tables.
Yes, in the case of crossing a 2Mb boundary, it will require 2 L0
tables.

Then, the number of required page tables is needed depending on Xen
size and load address alignment. Because for each 2Mb, we need a new L0
table.

Sure, this is not needed now ( as in xen.lds.S, we have a Xen size
check ), but if someone increases Xen size binary to 4Mb, then the
amount of page tables should be updated too.
Should we take into account that?

>=20
> > > > @@ -255,25 +262,30 @@ void __init noreturn noinline
> > > > enable_mmu()
> > > > =C2=A0=C2=A0=C2=A0=C2=A0 csr_write(CSR_SATP,
> > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 PFN_DOWN((unsigned long)stage1_pgtbl_root) |
> > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 RV_STAGE1_MODE << SATP_MODE_SHIFT);
> > > > +}
> > > > =C2=A0
> > > > -=C2=A0=C2=A0=C2=A0 asm volatile ( ".p2align 2" );
> > > > - mmu_is_enabled:
> > > > -=C2=A0=C2=A0=C2=A0 /*
> > > > -=C2=A0=C2=A0=C2=A0=C2=A0 * Stack should be re-inited as:
> > > > -=C2=A0=C2=A0=C2=A0=C2=A0 * 1. Right now an address of the stack is=
 relative to
> > > > load
> > > > time
> > > > -=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0=C2=A0 addresses what will c=
ause an issue in case of load
> > > > start
> > > > address
> > > > -=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0=C2=A0 isn't equal to linker=
 start address.
> > > > -=C2=A0=C2=A0=C2=A0=C2=A0 * 2. Addresses in stack are all load time=
 relative which
> > > > can
> > > > be an
> > > > -=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0=C2=A0 issue in case when lo=
ad start address isn't equal to
> > > > linker
> > > > -=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0=C2=A0 start address.
> > > > -=C2=A0=C2=A0=C2=A0=C2=A0 *
> > > > -=C2=A0=C2=A0=C2=A0=C2=A0 * We can't return to the caller because t=
he stack was
> > > > reseted
> > > > -=C2=A0=C2=A0=C2=A0=C2=A0 * and it may have stash some variable on =
the stack.
> > > > -=C2=A0=C2=A0=C2=A0=C2=A0 * Jump to a brand new function as the sta=
ck was reseted
> > > > -=C2=A0=C2=A0=C2=A0=C2=A0 */
> > > > +void __init remove_identity_mapping(void)
> > > > +{
> > > > +=C2=A0=C2=A0=C2=A0 unsigned int i;
> > > > +=C2=A0=C2=A0=C2=A0 pte_t *pgtbl;
> > > > +=C2=A0=C2=A0=C2=A0 unsigned int index, xen_index;
> > > > +=C2=A0=C2=A0=C2=A0 unsigned long load_addr =3D LINK_TO_LOAD(_start=
);
> > > > =C2=A0
> > > > -=C2=A0=C2=A0=C2=A0 switch_stack_and_jump((unsigned long)cpu0_boot_=
stack +
> > > > STACK_SIZE,
> > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 cont_after_mmu_is_enabled);
> > > > +=C2=A0=C2=A0=C2=A0 for ( pgtbl =3D stage1_pgtbl_root, i =3D 0;
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 i <=3D (CON=
FIG_PAGING_LEVELS - 1);
> > >=20
> > > i < CONFIG_PAGING_LEVELS ? But maybe it would be easier for i to
> > > start
> > > at CONFIG_PAGING_LEVELS and be decremented, simplifying ...
> > >=20
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 i++ )
> > > > +=C2=A0=C2=A0=C2=A0 {
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 index =3D pt_index(CONF=
IG_PAGING_LEVELS - 1 - i,
> > > > load_addr);
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 xen_index =3D pt_index(=
CONFIG_PAGING_LEVELS - 1 - i,
> > > > XEN_VIRT_START);
> > >=20
> > > ... these two expressions?
> > It makes sense. I'll update this part of the code.
> >=20
> > >=20
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( index !=3D xen_ind=
ex )
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 pgtbl[index].pte =3D 0;
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 break;
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > >=20
> > > Is this enough? When load and link address are pretty close (but
> > > not
> > > overlapping), can't they share a leaf table, in which case you
> > > need
> > > to clear more than just a single entry? The present overlap check
> > > looks to be 4k-granular, not 2M (in which case this couldn't
> > > happen;
> > > IOW adjusting the overlap check may also be a way out).
> > At the start of setup_initial_pagetables() there is a code which
> > checks
> > that load and link address don't overlap:
> >=20
> > =C2=A0=C2=A0=C2=A0 if ( (linker_start !=3D load_start) &&
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (linker_start <=3D loa=
d_end) && (load_start <=3D linker_end) )
> > =C2=A0=C2=A0=C2=A0 {
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 early_printk("(XEN) linker a=
nd load address ranges
> > overlap\n");
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 die();
> > =C2=A0=C2=A0=C2=A0 }
> >=20
> > So the closest difference between load and link address can be 4kb.
> > Otherwise load and link address ranges are equal ( as we can't map
> > less
> > then 4kb).
> >=20
> > Let's take concrete examples:
> > =C2=A0 Load address range is=C2=A0=C2=A0 0x8020_0000 - 0x8020_0FFF
> > =C2=A0 Linker address range is 0x8020_1000 - 0x8020_1FFF
> > =C2=A0 MMU mode: Sv39 ( so we have 3 page tables )
> >=20
> > =C2=A0 So we have:
> > =C2=A0=C2=A0=C2=A0 * L2 index =3D 2, L1 index =3D 1, L0 index =3D 0 for=
 load address
> > =C2=A0=C2=A0=C2=A0 * L2 index =3D 2, L1 index =3D 1, L0 index =3D 1 for=
 linker address
> > =C2=A0 Thereby we have two different L0 tables for load and linker
> > address=20
> > ranges.
> > =C2=A0 And it looks like it is pretty safe to remove only one L0 index
> > that
> > was used for identity mapping.
> >=20
> > Is it possible that I missed something?
>=20
> Looks as if you are thinking of only a Xen which fits in 4k. The code
> here wants to cope with Xen getting quite a bit bigger.

Yeah, I missed that when I tried to come up with an example.

So it will probably be more universal if we recursively go through the
whole identity mapping and unmap each pte individually.


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 08:54:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 08:54:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561099.877421 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImed-0006tm-OM; Mon, 10 Jul 2023 08:53:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561099.877421; Mon, 10 Jul 2023 08:53:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImed-0006tf-Lc; Mon, 10 Jul 2023 08:53:59 +0000
Received: by outflank-mailman (input) for mailman id 561099;
 Mon, 10 Jul 2023 08:53:58 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qImec-0006t6-AK
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:53:58 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on0617.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::617])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4dd87f37-1eff-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 10:53:57 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by DU2PR04MB9051.eurprd04.prod.outlook.com (2603:10a6:10:2e6::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul
 2023 08:53:54 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 08:53:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4dd87f37-1eff-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BKcM6lj5xgrKkCGO/e1BI5hhk93ZzWSVDp6J0acdonOzXnKUJn6EFVTkv8IHxHYkNNQo157/Ws3SfXva3HPe8fkuubN1L0E5ghtRpCFFcIXiUDePGig2Nd07xarI3Fuybk9QuvdKpKT3EtVoXQTwIWhhvEvjseTMXgOjOxYB7Ww5Z5OuDPVbLcvuDMzgewtITqLQdDdiXoVJ9LR5rHW6HRebePHv2w9SdSZJljj/tc3Gf+s2U7zEO2HOF548ZtWedwtNK31IfznZM/23tU6wzh2JNqRqLsq4n6YAIf2BJn0K8eCK0QvzUshy3Wym+eHmRmXo0wRZgnuRDsMj5dc/bg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=DwE2DaHJIT8yUh1v7GuvfaHzm8FBrIyxUnyTwmDfL0E=;
 b=OXcZDMCtRc1NDCuEG/G+RGHseDhYwrki6Y6qDc7Yq3UyFZMK20rVxvOzrd854hM74PLZrU8/B7MO+/ztdYEW9pCIj+eSOCmucVau+YhU/QvNIqFsRoDNT/D5Kh0/4JQI/gaVBFLZti3Yqhst4uHVQjPajHVMXB8np5SfaaM6gQ32D/tIhQeTU/UNo69kYxB6/IXbGE6DSIcWwCjhLRuzULGPVOATgIn2oktPhubRjOnNSUHgW/t06yQrpUynnLoYklfPVf0ZhV7pO+gYkzy+Od2fu3sfd65m45TVKpoxIMjpUWdcuWjrXbciazm3VbEt+WEQs6vKJSS4g/qqHsEKwQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=DwE2DaHJIT8yUh1v7GuvfaHzm8FBrIyxUnyTwmDfL0E=;
 b=bZlxfdQnvYYyqm370ANX9c+7xrp6+VTU39DWjdM0eXJH01VOU/89+MZtEOFcZFv5julM2UrpK/+c+MIn0EcUOjRFrd/exyCYMC6TG4QGMdjc4rfRyK5ECLpIHQu2DzOQNv17dZfU4YDwhC8G0bI/ESy4RLzj9znEWVgkacvJghfTCyeGXe+H3Crd3toB1fRCln0lxAmNTR8XshSV+xuPvIpC/bg8o8S4GMGWqcJJJGa5e/z004KIXn7zF7IwF176MM8gYNMPmQIrCtV/1oGiWY13pT95XngYrckOTUQdIQx+XsefFpyBXBqLpdO3G2CFTaQIMQJPv5TOt3IY4xFd+w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <fcca07b2-8af3-625f-54b4-763532afec50@suse.com>
Date: Mon, 10 Jul 2023 10:53:53 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v3 3/8] x86: annotate entry points with type and size
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
 <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
In-Reply-To: <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FRYP281CA0002.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::12)
 To AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DU2PR04MB9051:EE_
X-MS-Office365-Filtering-Correlation-Id: 58ac6bcd-6d4e-4aed-f69e-08db812330c7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	gepJeBp3vSConBujNck6eS4elbRpcimWZXgDLG8GIUebYd768+v6UPASyv+4smgrFyf81S4EEmpjEjnC7Ru/CmtqSyINPYIqeJL65bgZTdi2JnyahUbLIbJoSnHjOvvcBXydYtR9pTE6ElYLClDIa9a2rNPyEUPAdTADlO+l4ddw3Ixy5Cgpn3Ghlpf37V11le+wl3jpRnpvn7w1RhMfwC5kMxiGNShJugKb3h8kCQktL3hqzwfR+259JV4knQbSkCQLurDF/kh5g/05BLxqmsMiqLf2gerhcAKte20MXfslrRXHlDLU0Z/t0+Hz4D1ksTJAyTFXYmDhg1hIkkks0gs0bMwrfuGWkMbxqnp6WNBhk2GE+44tbukhUh+9EtBAERNyG8ZrLtzLaSQWO1SHZ1iM3RGQhlLWkl8cEdmzOvtO5Lgpa0vAudZCvtYnJbKV0/nSFrizjeUvy5P2mY6N1G1HO8HOAlmEDmvxHz2L/U6+ZLcKbK0SGGHPNUasEOkn3LnjPlX8Trn1N1FROAA06OPAgjPemptqfHFyO/z3lp8LIAFKcL8gjL2ecHqI9qb/cbG8sqEvLgTuP1PXqyi2Lp6FSF65yB++WSAI7ITTA9eoBkBkQ10oi0oB6U8wEmAA5+6R0SJUs9yQQxuYGmdq9w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39850400004)(376002)(136003)(346002)(396003)(366004)(451199021)(186003)(26005)(6506007)(2616005)(6512007)(83380400001)(41300700001)(30864003)(4326008)(6916009)(2906002)(66556008)(316002)(5660300002)(66476007)(8676002)(8936002)(478600001)(66946007)(6486002)(54906003)(36756003)(38100700002)(31696002)(86362001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?K0NqV3BpejZhSlRURmhvdGg4UE9RQjF6a0xZQWF5UHAxRHFrTlV1eGJtM0ty?=
 =?utf-8?B?bWEwTHdKU2tHc0dMVzhNNjIyRjNBUW11RWFzaHRTWGIxWFJFM0JlZll1VkQ2?=
 =?utf-8?B?WHZsMUJCN1JLK1Qyb3NTclhFMkNRck12b3VEcTBZanMvTHlUUGt3bmYycFV4?=
 =?utf-8?B?U3hReEpNNmhTWThOa0xTVElJbDNXbko0RGFockxjTFJ1TmUyVnJWb3g2bHJz?=
 =?utf-8?B?UUhrSVFHdFN2eEVvSHhLSHNMT3plVm1DOVVVMTVFRExWeGVKSGtRTU5pcjdB?=
 =?ut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l1QzVmNGlraG12aTJI?=
 =?utf-8?B?eFN1VjIwa0ErZXVhbENRemp2VC9IVWZFMXRFK2FWYzFaNzRsUWMralcweE9O?=
 =?utf-8?Q?BVjiZcOuV4F3WDkU0QqYdFXhz?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 58ac6bcd-6d4e-4aed-f69e-08db812330c7
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 08:53:54.6463
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 28zBy9h3pnI9bjrTnkleCuiZqEekbw2ZFukAiTRfQfPqBQFgrfqfdbFiJwohlFs3iKdNdrpX+3Kiddeor1dO5w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9051

Use the generic framework in xen/linkage.h.

For switch_to_kernel() and restore_all_guest() so far implicit alignment
(from being first in their respective sections) is being made explicit
(as in: using FUNC() without 2nd argument). Whereas for
{,compat}create_bounce_frame() and autogen_entrypoints[] alignment is
newly arranged for.

Except for the added/adjusted alignment padding (including their
knock-on effects) no change in generated code/data. Note that the basis
for support of weak definitions is added despite them not having any use
right now.

Note that ASM_INT() is switched to DATA(), not DATA_LOCAL(), as the only
use site wants the symbol global anyway.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v3: !PV variant of ret_from_intr is local. Introduction of macros split
    off to separate patch. Also adjust ASM_INT(). Re-base.
v2: Full rework.
---
Only two of the assembly files are being converted for now. More could
be done right here or as follow-on in separate patches.

Note that the FB-label in autogen_stubs() cannot be converted just yet:
Such labels cannot be used with .type. We could further diverge from
Linux'es model and avoid setting STT_NOTYPE explicitly (that's the type
labels get by default anyway).

The ASM_INT() redundancy of .global will be eliminated by a subsequent
patch.

I didn't think that I should make CODE_FILL evaluate to 0xCC right here;
IMO that wants to be a separate patch.

--- a/xen/arch/x86/include/asm/asm_defns.h
+++ b/xen/arch/x86/include/asm/asm_defns.h
@@ -13,6 +13,7 @@
 #include <asm/alternative.h>
 
 #ifdef __ASSEMBLY__
+#include <xen/linkage.h>
 #include <asm/asm-defns.h>
 #ifndef CONFIG_INDIRECT_THUNK
 .equ CONFIG_INDIRECT_THUNK, 0
@@ -343,10 +344,7 @@ static always_inline void stac(void)
     .popsection
 
 #define ASM_INT(label, val)                 \
-    .p2align 2;                             \
-label: .long (val);                         \
-    .size label, . - label;                 \
-    .type label, @object
+    DATA(label, 4) .long (val); END(label)
 
 #define ASM_CONSTANT(name, value)                \
     asm ( ".equ " #name ", %P0; .global " #name  \
--- a/xen/arch/x86/include/asm/config.h
+++ b/xen/arch/x86/include/asm/config.h
@@ -43,7 +43,9 @@
 
 /* Linkage for x86 */
 #ifdef __ASSEMBLY__
-#define ALIGN .align 16,0x90
+#define CODE_ALIGN 16
+#define CODE_FILL 0x90
+#define ALIGN .align CODE_ALIGN, CODE_FILL
 #define ENTRY(name)                             \
   .globl name;                                  \
   ALIGN;                                        \
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -11,7 +11,7 @@
 #include <public/xen.h>
 #include <irq_vectors.h>
 
-ENTRY(entry_int82)
+FUNC(entry_int82)
         ENDBR64
         ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP
         pushq $0
@@ -27,9 +27,10 @@ ENTRY(entry_int82)
 
         mov   %rsp, %rdi
         call  do_entry_int82
+END(entry_int82)
 
 /* %rbx: struct vcpu */
-ENTRY(compat_test_all_events)
+FUNC(compat_test_all_events)
         ASSERT_NOT_IN_ATOMIC
         cli                             # tests must not race interrupts
 /*compat_test_softirqs:*/
@@ -66,24 +67,21 @@ compat_test_guest_events:
         call  compat_create_bounce_frame
         jmp   compat_test_all_events
 
-        ALIGN
 /* %rbx: struct vcpu */
-compat_process_softirqs:
+LABEL_LOCAL(compat_process_softirqs)
         sti
         call  do_softirq
         jmp   compat_test_all_events
 
-        ALIGN
 /* %rbx: struct vcpu, %rdx: struct trap_bounce */
-.Lcompat_process_trapbounce:
+LABEL_LOCAL(.Lcompat_process_trapbounce)
         sti
 .Lcompat_bounce_exception:
         call  compat_create_bounce_frame
         jmp   compat_test_all_events
 
-	ALIGN
 /* %rbx: struct vcpu */
-compat_process_mce:
+LABEL_LOCAL(compat_process_mce)
         testb $1 << VCPU_TRAP_MCE,VCPU_async_exception_mask(%rbx)
         jnz   .Lcompat_test_guest_nmi
         sti
@@ -97,9 +95,8 @@ compat_process_mce:
         movb %dl,VCPU_async_exception_mask(%rbx)
         jmp   compat_process_trap
 
-	ALIGN
 /* %rbx: struct vcpu */
-compat_process_nmi:
+LABEL_LOCAL(compat_process_nmi)
         testb $1 << VCPU_TRAP_NMI,VCPU_async_exception_mask(%rbx)
         jnz   compat_test_guest_events
         sti
@@ -116,9 +113,10 @@ compat_process_trap:
         leaq  VCPU_trap_bounce(%rbx),%rdx
         call  compat_create_bounce_frame
         jmp   compat_test_all_events
+END(compat_test_all_events)
 
 /* %rbx: struct vcpu, interrupts disabled */
-ENTRY(compat_restore_all_guest)
+FUNC(compat_restore_all_guest)
         ASSERT_INTERRUPTS_DISABLED
         mov   $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), %r11d
         and   UREGS_eflags(%rsp),%r11d
@@ -161,9 +159,10 @@ ENTRY(compat_restore_all_guest)
         RESTORE_ALL adj=8 compat=1
 .Lft0:  iretq
         _ASM_PRE_EXTABLE(.Lft0, handle_exception)
+END(compat_restore_all_guest)
 
 /* This mustn't modify registers other than %rax. */
-ENTRY(cr4_pv32_restore)
+FUNC(cr4_pv32_restore)
         push  %rdx
         GET_CPUINFO_FIELD(cr4, dx)
         mov   (%rdx), %rax
@@ -193,8 +192,9 @@ ENTRY(cr4_pv32_restore)
         pop   %rdx
         xor   %eax, %eax
         ret
+END(cr4_pv32_restore)
 
-ENTRY(compat_syscall)
+FUNC(compat_syscall)
         /* Fix up reported %cs/%ss for compat domains. */
         movl  $FLAT_COMPAT_USER_SS, UREGS_ss(%rsp)
         movl  $FLAT_COMPAT_USER_CS, UREGS_cs(%rsp)
@@ -222,8 +222,9 @@ UNLIKELY_END(compat_syscall_gpf)
         movw  %si,TRAPBOUNCE_cs(%rdx)
         movb  %cl,TRAPBOUNCE_flags(%rdx)
         jmp   .Lcompat_bounce_exception
+END(compat_syscall)
 
-ENTRY(compat_sysenter)
+FUNC(compat_sysenter)
         CR4_PV32_RESTORE
         movq  VCPU_trap_ctxt(%rbx),%rcx
         cmpb  $X86_EXC_GP, UREGS_entry_vector(%rsp)
@@ -236,17 +237,19 @@ ENTRY(compat_sysenter)
         movw  %ax,TRAPBOUNCE_cs(%rdx)
         call  compat_create_bounce_frame
         jmp   compat_test_all_events
+END(compat_sysenter)
 
-ENTRY(compat_int80_direct_trap)
+FUNC(compat_int80_direct_trap)
         CR4_PV32_RESTORE
         call  compat_create_bounce_frame
         jmp   compat_test_all_events
+END(compat_int80_direct_trap)
 
 /* CREATE A BASIC EXCEPTION FRAME ON GUEST OS (RING-1) STACK:            */
 /*   {[ERRCODE,] EIP, CS, EFLAGS, [ESP, SS]}                             */
 /* %rdx: trap_bounce, %rbx: struct vcpu                                  */
 /* On return only %rbx and %rdx are guaranteed non-clobbered.            */
-compat_create_bounce_frame:
+FUNC_LOCAL(compat_create_bounce_frame)
         ASSERT_INTERRUPTS_ENABLED
         mov   %fs,%edi
         ALTERNATIVE "", stac, X86_FEATURE_XEN_SMAP
@@ -352,3 +355,4 @@ compat_crash_page_fault:
         jmp   .Lft14
 .previous
         _ASM_EXTABLE(.Lft14, .Lfx14)
+END(compat_create_bounce_frame)
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -24,7 +24,7 @@
 
 #ifdef CONFIG_PV
 /* %rbx: struct vcpu */
-switch_to_kernel:
+FUNC_LOCAL(switch_to_kernel)
         leaq  VCPU_trap_bounce(%rbx),%rdx
 
         /* TB_eip = 32-bit syscall ? syscall32_addr : syscall_addr */
@@ -89,24 +89,21 @@ test_guest_events:
         call  create_bounce_frame
         jmp   test_all_events
 
-        ALIGN
 /* %rbx: struct vcpu */
-process_softirqs:
+LABEL_LOCAL(process_softirqs)
         sti
         call do_softirq
         jmp  test_all_events
 
-        ALIGN
 /* %rbx: struct vcpu, %rdx struct trap_bounce */
-.Lprocess_trapbounce:
+LABEL_LOCAL(.Lprocess_trapbounce)
         sti
 .Lbounce_exception:
         call  create_bounce_frame
         jmp   test_all_events
 
-        ALIGN
 /* %rbx: struct vcpu */
-process_mce:
+LABEL_LOCAL(process_mce)
         testb $1 << VCPU_TRAP_MCE, VCPU_async_exception_mask(%rbx)
         jnz  .Ltest_guest_nmi
         sti
@@ -120,9 +117,8 @@ process_mce:
         movb %dl, VCPU_async_exception_mask(%rbx)
         jmp  process_trap
 
-        ALIGN
 /* %rbx: struct vcpu */
-process_nmi:
+LABEL_LOCAL(process_nmi)
         testb $1 << VCPU_TRAP_NMI, VCPU_async_exception_mask(%rbx)
         jnz  test_guest_events
         sti
@@ -139,11 +135,12 @@ process_trap:
         leaq VCPU_trap_bounce(%rbx), %rdx
         call create_bounce_frame
         jmp  test_all_events
+END(switch_to_kernel)
 
         .section .text.entry, "ax", @progbits
 
 /* %rbx: struct vcpu, interrupts disabled */
-restore_all_guest:
+FUNC_LOCAL(restore_all_guest)
         ASSERT_INTERRUPTS_DISABLED
 
         /* Stash guest SPEC_CTRL value while we can read struct vcpu. */
@@ -220,8 +217,7 @@ restore_all_guest:
         sysretq
 1:      sysretl
 
-        ALIGN
-.Lrestore_rcx_iret_exit_to_guest:
+LABEL_LOCAL(.Lrestore_rcx_iret_exit_to_guest)
         movq  8(%rsp), %rcx           # RIP
 /* No special register assumptions. */
 iret_exit_to_guest:
@@ -230,6 +226,7 @@ iret_exit_to_guest:
         addq  $8,%rsp
 .Lft0:  iretq
         _ASM_PRE_EXTABLE(.Lft0, handle_exception)
+END(restore_all_guest)
 
 /*
  * When entering SYSCALL from kernel mode:
@@ -246,7 +243,7 @@ iret_exit_to_guest:
  *  - Guest %rsp stored in %rax
  *  - Xen stack loaded, pointing at the %ss slot
  */
-ENTRY(lstar_enter)
+FUNC(lstar_enter)
 #ifdef CONFIG_XEN_SHSTK
         ALTERNATIVE "", "setssbsy", X86_FEATURE_XEN_SHSTK
 #endif
@@ -281,9 +278,10 @@ ENTRY(lstar_enter)
         mov   %rsp, %rdi
         call  pv_hypercall
         jmp   test_all_events
+END(lstar_enter)
 
 /* See lstar_enter for entry register state. */
-ENTRY(cstar_enter)
+FUNC(cstar_enter)
 #ifdef CONFIG_XEN_SHSTK
         ALTERNATIVE "", "setssbsy", X86_FEATURE_XEN_SHSTK
 #endif
@@ -321,8 +319,9 @@ ENTRY(cstar_enter)
         jne   compat_syscall
 #endif
         jmp   switch_to_kernel
+END(cstar_enter)
 
-ENTRY(sysenter_entry)
+FUNC(sysenter_entry)
         ENDBR64
 #ifdef CONFIG_XEN_SHSTK
         ALTERNATIVE "", "setssbsy", X86_FEATURE_XEN_SHSTK
@@ -331,7 +330,7 @@ ENTRY(sysenter_entry)
         pushq $FLAT_USER_SS
         pushq $0
         pushfq
-GLOBAL(sysenter_eflags_saved)
+LABEL(sysenter_eflags_saved, 0)
         ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP
         pushq $3 /* ring 3 null cs */
         pushq $0 /* null rip */
@@ -385,8 +384,9 @@ UNLIKELY_END(sysenter_gpf)
         jne   compat_sysenter
 #endif
         jmp   .Lbounce_exception
+END(sysenter_entry)
 
-ENTRY(int80_direct_trap)
+FUNC(int80_direct_trap)
         ENDBR64
         ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP
         pushq $0
@@ -474,6 +474,7 @@ int80_slow_path:
          */
         GET_STACK_END(14)
         jmp   handle_exception_saved
+END(int80_direct_trap)
 
         /* create_bounce_frame & helpers don't need to be in .text.entry */
         .text
@@ -482,7 +483,7 @@ int80_slow_path:
 /*   { RCX, R11, [ERRCODE,] RIP, CS, RFLAGS, RSP, SS }                   */
 /* %rdx: trap_bounce, %rbx: struct vcpu                                  */
 /* On return only %rbx and %rdx are guaranteed non-clobbered.            */
-create_bounce_frame:
+FUNC_LOCAL(create_bounce_frame)
         ASSERT_INTERRUPTS_ENABLED
         testb $TF_kernel_mode,VCPU_thread_flags(%rbx)
         jnz   1f
@@ -618,6 +619,7 @@ ENTRY(dom_crash_sync_extable)
         xorl  %edi,%edi
         jmp   asm_domain_crash_synchronous /* Does not return */
         .popsection
+END(create_bounce_frame)
 #endif /* CONFIG_PV */
 
 /* --- CODE BELOW THIS LINE (MOSTLY) NOT GUEST RELATED --- */
@@ -626,7 +628,7 @@ ENTRY(dom_crash_sync_extable)
 
 /* No special register assumptions. */
 #ifdef CONFIG_PV
-ENTRY(continue_pv_domain)
+FUNC(continue_pv_domain)
         ENDBR64
         call  check_wakeup_from_wait
 ret_from_intr:
@@ -641,26 +643,28 @@ ret_from_intr:
 #else
         jmp   test_all_events
 #endif
+END(continue_pv_domain)
 #else
-ret_from_intr:
+FUNC_LOCAL(ret_from_intr, 0)
         ASSERT_CONTEXT_IS_XEN
         jmp   restore_all_xen
+END(ret_from_intr)
 #endif
 
         .section .init.text, "ax", @progbits
-ENTRY(early_page_fault)
+FUNC(early_page_fault)
         ENDBR64
         movl  $X86_EXC_PF, 4(%rsp)
         SAVE_ALL
         movq  %rsp, %rdi
         call  do_early_page_fault
         jmp   restore_all_xen
+END(early_page_fault)
 
         .section .text.entry, "ax", @progbits
 
-        ALIGN
 /* No special register assumptions. */
-restore_all_xen:
+FUNC_LOCAL(restore_all_xen)
         /*
          * Check whether we need to switch to the per-CPU page tables, in
          * case we return to late PV exit code (from an NMI or #MC).
@@ -677,8 +681,9 @@ UNLIKELY_END(exit_cr3)
 
         RESTORE_ALL adj=8
         iretq
+END(restore_all_xen)
 
-ENTRY(common_interrupt)
+FUNC(common_interrupt)
         ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP
         SAVE_ALL
 
@@ -707,12 +712,14 @@ ENTRY(common_interrupt)
         mov   %r15, STACK_CPUINFO_FIELD(xen_cr3)(%r14)
         mov   %bl, STACK_CPUINFO_FIELD(use_pv_cr3)(%r14)
         jmp ret_from_intr
+END(common_interrupt)
 
-ENTRY(page_fault)
+FUNC(page_fault)
         ENDBR64
         movl  $X86_EXC_PF, 4(%rsp)
+END(page_fault)
 /* No special register assumptions. */
-GLOBAL(handle_exception)
+FUNC(handle_exception, 0)
         ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP
         SAVE_ALL
 
@@ -880,92 +887,108 @@ FATAL_exception_with_ints_disabled:
         xorl  %esi,%esi
         movq  %rsp,%rdi
         tailcall fatal_trap
+END(handle_exception)
 
-ENTRY(divide_error)
+FUNC(divide_error)
         ENDBR64
         pushq $0
         movl  $X86_EXC_DE, 4(%rsp)
         jmp   handle_exception
+END(divide_error)
 
-ENTRY(coprocessor_error)
+FUNC(coprocessor_error)
         ENDBR64
         pushq $0
         movl  $X86_EXC_MF, 4(%rsp)
         jmp   handle_exception
+END(coprocessor_error)
 
-ENTRY(simd_coprocessor_error)
+FUNC(simd_coprocessor_error)
         ENDBR64
         pushq $0
         movl  $X86_EXC_XM, 4(%rsp)
         jmp   handle_exception
+END(coprocessor_error)
 
-ENTRY(device_not_available)
+FUNC(device_not_available)
         ENDBR64
         pushq $0
         movl  $X86_EXC_NM, 4(%rsp)
         jmp   handle_exception
+END(device_not_available)
 
-ENTRY(debug)
+FUNC(debug)
         ENDBR64
         pushq $0
         movl  $X86_EXC_DB, 4(%rsp)
         jmp   handle_ist_exception
+END(debug)
 
-ENTRY(int3)
+FUNC(int3)
         ENDBR64
         pushq $0
         movl  $X86_EXC_BP, 4(%rsp)
         jmp   handle_exception
+END(int3)
 
-ENTRY(overflow)
+FUNC(overflow)
         ENDBR64
         pushq $0
         movl  $X86_EXC_OF, 4(%rsp)
         jmp   handle_exception
+END(overflow)
 
-ENTRY(bounds)
+FUNC(bounds)
         ENDBR64
         pushq $0
         movl  $X86_EXC_BR, 4(%rsp)
         jmp   handle_exception
+END(bounds)
 
-ENTRY(invalid_op)
+FUNC(invalid_op)
         ENDBR64
         pushq $0
         movl  $X86_EXC_UD, 4(%rsp)
         jmp   handle_exception
+END(invalid_op)
 
-ENTRY(invalid_TSS)
+FUNC(invalid_TSS)
         ENDBR64
         movl  $X86_EXC_TS, 4(%rsp)
         jmp   handle_exception
+END(invalid_TSS)
 
-ENTRY(segment_not_present)
+FUNC(segment_not_present)
         ENDBR64
         movl  $X86_EXC_NP, 4(%rsp)
         jmp   handle_exception
+END(segment_not_present)
 
-ENTRY(stack_segment)
+FUNC(stack_segment)
         ENDBR64
         movl  $X86_EXC_SS, 4(%rsp)
         jmp   handle_exception
+END(stack_segment)
 
-ENTRY(general_protection)
+FUNC(general_protection)
         ENDBR64
         movl  $X86_EXC_GP, 4(%rsp)
         jmp   handle_exception
+END(general_protection)
 
-ENTRY(alignment_check)
+FUNC(alignment_check)
         ENDBR64
         movl  $X86_EXC_AC, 4(%rsp)
         jmp   handle_exception
+END(alignment_check)
 
-ENTRY(entry_CP)
+FUNC(entry_CP)
         ENDBR64
         movl  $X86_EXC_CP, 4(%rsp)
         jmp   handle_exception
+END(entry_CP)
 
-ENTRY(double_fault)
+FUNC(double_fault)
         ENDBR64
         movl  $X86_EXC_DF, 4(%rsp)
         /* Set AC to reduce chance of further SMAP faults */
@@ -988,8 +1011,9 @@ ENTRY(double_fault)
 
         movq  %rsp,%rdi
         tailcall do_double_fault
+END(double_fault)
 
-ENTRY(nmi)
+FUNC(nmi)
         ENDBR64
         pushq $0
         movl  $X86_EXC_NMI, 4(%rsp)
@@ -1116,21 +1140,24 @@ handle_ist_exception:
         ASSERT_CONTEXT_IS_XEN
         jmp   restore_all_xen
 #endif
+END(nmi)
 
-ENTRY(machine_check)
+FUNC(machine_check)
         ENDBR64
         pushq $0
         movl  $X86_EXC_MC, 4(%rsp)
         jmp   handle_ist_exception
+END(machine_check)
 
 /* No op trap handler.  Required for kexec crash path. */
-GLOBAL(trap_nop)
+FUNC(trap_nop, 0)
         ENDBR64
         iretq
+END(trap_nop)
 
 /* Table of automatically generated entry points.  One per vector. */
         .pushsection .init.rodata, "a", @progbits
-GLOBAL(autogen_entrypoints)
+DATA(autogen_entrypoints, 8)
         /* pop into the .init.rodata section and record an entry point. */
         .macro entrypoint ent
         .pushsection .init.rodata, "a", @progbits
@@ -1139,7 +1166,7 @@ GLOBAL(autogen_entrypoints)
         .endm
 
         .popsection
-autogen_stubs: /* Automatically generated stubs. */
+FUNC_LOCAL(autogen_stubs, 0) /* Automatically generated stubs. */
 
         vec = 0
         .rept X86_NR_VECTORS
@@ -1183,6 +1210,7 @@ autogen_stubs: /* Automatically generate
 
         vec = vec + 1
         .endr
+END(autogen_stubs)
 
         .section .init.rodata, "a", @progbits
-        .size autogen_entrypoints, . - autogen_entrypoints
+END(autogen_entrypoints)



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 08:54:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 08:54:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561108.877431 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImfD-0007a3-4x; Mon, 10 Jul 2023 08:54:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561108.877431; Mon, 10 Jul 2023 08:54:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImfD-0007Zw-29; Mon, 10 Jul 2023 08:54:35 +0000
Received: by outflank-mailman (input) for mailman id 561108;
 Mon, 10 Jul 2023 08:54:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qImfC-0006t6-1q
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:54:34 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on0629.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::629])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 63a90027-1eff-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 10:54:33 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by DU2PR04MB9051.eurprd04.prod.outlook.com (2603:10a6:10:2e6::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul
 2023 08:54:32 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 08:54:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 63a90027-1eff-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=bp25ct+6Dnx6fYLb/4Niw5AR8CDyB9SDE32sSvRAhBVxklJfR5L5jrOAntIxHV4KjKOVjpwQZEdmMaDWjmz7QlXnjiQbtS+eZ/BHSw/nGRLRlP6hcxK9RAQFGqE0u+HkUprGaXI6ndjD0Djqo6Myf2aB4EczR4yrqlgadp6lCcMX61PL5it1K6Y0zixPC4C+5+8h/lLVDB8f3RkwX0ZW9/t1XcqwBcVKWwZ0ExUhwnURkpajPjKd1TtJY4qlC3k8m0Cmq4JzuY5bfH+l2agAWyXawMF0eoAs5FOr9naGf2r3OT9GOHX/k4G1XH9XLZ2h8vfKg0itXajkZtvx6mNrFg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=bxqTYAMqHDtwTsaXt5W2izXbr1PoTAZ70AuZ6hPpGqA=;
 b=LCbJERBr5cTIVelRRPx1rC/Q/EUP6VoSWbj+zFwt3qI4QPwyvqye+/bQVAUWc+n5UXXet9mQWWrmxXU2/QYQKJCR7+Qmtti1K6mKE0P3fJ5d6PtLUKByTjsZt8PJGYQl3i2MUWUvpSJjvd3NlCsjXZ0kbVK9ToWRDGo6DoEZLbggq9dNpSNBEuI3Zh8x92XGi4EYYijxmpkGru2yvhNf7vsbm/cFSc6njrNwn2A/KTGL1P73mcM8w6+qJ2Hy9LejKnoDiwClFUstjvV+FPjEqAj5bfgu197GIYDz0VdsqUU51Chvim3gLq0BIbJsIiBo5AFzOSqmE0bro4BmPxts6w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=bxqTYAMqHDtwTsaXt5W2izXbr1PoTAZ70AuZ6hPpGqA=;
 b=4pFBTGTp63DTqFOVXMOsI06QPZ7d2QL+kzE/m1y2tbBy8BTIe5+kPvRsDQhyoHASLpeLpkRzOW+YS6x0a4fcruGNrhwM0DNXeTdBQJuxADWP3cSBpwkOZMquLw2icWCUJUQlNZ/VMhrQ3P+L7IVNR5L2V57Ad4CygftXP4nL2U4sfgheF6MnvSOEsi5sH13X6tSZ8v/J8QEmB23YxTR3f/5lCxzdFcptmrDKoqdWLMk5Wv0cWRfc4/ZTiDt2DfyI5GqZOhqW/UxNrZzId+3MkDZJOWR6Vdx2UxgCJ44OGSXXM2CwNL0Ica8+o9HwRKiTiPsyEESP+saNaZgVy+nkLg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <0bf03d56-d59d-7c71-c6da-d44de31e4711@suse.com>
Date: Mon, 10 Jul 2023 10:54:30 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v3 4/8] x86: also mark assembler globals hidden
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 George Dunlap <george.dunlap@citrix.com>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
 <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
In-Reply-To: <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FRYP281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::28)
 To AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DU2PR04MB9051:EE_
X-MS-Office365-Filtering-Correlation-Id: 49ddcea6-d4ee-4a04-06b4-08db81234734
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	smMA5YoXsAMj6jQdwfFijixLcl9Aaf3ci4ym76AW8FcoCr2rnvL72emOKUSSPvWyQkWsZiryv40lo4G5k0O/Q7QH5yUow4RRMGt5RLNXU6Hl5wzUlV98vFKBbwWI3xvOWxzn5pFQ12QNhcQHnM2xLS4auzUeNfOnxkErQVtTItKRm4fcqgq4Lozpxu6WNK+Dm6g4oEOuU0A/0HWEL7alrQvkPbCqcjlA1htKqP17l6wHhMmeKSLMtDNf/DOm8/u7sUTF15bDdjKINlsR7fThCvrb7JPHUcGNJTOO3dotRl6puoiBhVRC3hJABXMV4AbDT/1D//gSjC0g5OWuaBbgL6PWr6bWeypT3rDqcJiDv18aOcjmSOvc1x/s1sMUYsmeKqjzWuM84YQPgjs6X7dww95QOT5c6Iq5pSTWmxH9Ms7V65jj7d94uKnqOFTetGDGrrjmD77bYMPCyUgsl0r784f6tVXAMPFtsjPRLwQOT6XQ6WDV0PgNNTKRcdphfHdtZ7p4U9vjDN5sdJEuPEU1kzz/fIRShC38nRAbIXY5YYMVF09+vNEZ3xuRO/A4L0KUbvm4hCLDtlsnfDR0N/SBisgfLKgSj0rHD5WNgt/5TeZuSf1r87Tsm2UNyNEkJK9ZXVnemvLymfQjL1UWbInIfQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39850400004)(376002)(136003)(346002)(396003)(366004)(451199021)(186003)(26005)(6506007)(2616005)(6512007)(41300700001)(4326008)(6916009)(2906002)(66556008)(316002)(5660300002)(66476007)(8676002)(8936002)(478600001)(66946007)(6486002)(54906003)(36756003)(38100700002)(31696002)(86362001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Q2tEbGFmbWo1UTIva2JBaTNPNHp6VndIOCs5U1VDT0syWXBOMTJiclVVL25F?=
 =?utf-8?B?MFdVMngzNG50citYekZUSjJabDdMamM5MVpveWd1Y21XSStHZWF0NnNXdUU1?=
 =?utf-8?B?VnZmeFZhWE43VERDcU8zTHN6MG1kOC9yZ05RZXlZWWU3Z3dLa0lQcjFINDln?=
 =?utf-8?B?VUZ6YkdKRmlXK2dqaHRYNjNEdkEreXdoVHNiZ2hxVXg0VWtUcEVrVlMzcy9T?=
 =?utf-8?B?MFVLRFpFSWxGYUFZT0w1c09ucldYdE5VK0JhS0ZmRzVyMDZ1ZUlMZlFoNFdC?=
 =?utf-8?B?TXBwOU5OYmVHMS9GbklZSFFMaTVxeGZtZVFNNkhVdEpyWHZQODcycTVyR3l6?=
 =?utf-8?B?dThFcDliU0VTUGV5KzhJcTRWS2ZlS2RBMXJxUmp1Q1Y5WE9lRG1Od0F1bVMr?=
 =?utf-8?B?R0lkRWxibGhxMUh1UFpEU2NPSlprZHpoNkFma2tLN0ZDTitwRXZCQWFZLzVl?=
 =?utf-8?B?QWppOWdnRExlY3pSVWxXT3dCVTQ3OTlUWDhPSDFUUTAweS96NWMvcXdVeEx6?=
 =?utf-8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ER0ZXo4bTZGRmhPaDYrcHIxNlFPcGtUSnZ5aTJBdnVEcjZR?=
 =?utf-8?B?Mm9EU1hEWTJmMTJxL3lTdFdpVWpZQzdDQ1BseHlVdXUwQklYdUtsYUFXTkRT?=
 =?utf-8?B?QVhhNlpsbGxQTjgrRmVsUVRQYk9CMEhuYXRlZmFhN3NtS0o3S0s2T20weGF1?=
 =?utf-8?B?TW5rMnFLTi9DUytSVG1oWUhnTGlxTDQrK0dTWFdDYTVEaTgraDVlR2NYZU0v?=
 =?utf-8?B?MXFRUGoxalEyb3RZallTQUJ4SkUrUU5uS013M25OWVZxblB5L3YyL1ZyR29t?=
 =?utf-8?B?enU3QmY2SzdEcFNnUGhRaTFuVWRUdG9TV3RWS3VlR3JaVllRcnlOT0dBRk5X?=
 =?utf-8?B?ZW1WU1N2OWl3MlhDaUV5UDNYZXc1d1pZTmErZEdORWhFckFETkt4TTJtUFpj?=
 =?utf-8?B?Sml3amh3Skp1QnhsdThnbC9HdW9uSlhwZlBIUWQxbUhXcEVZaVNFRmxNZTNN?=
 =?utf-8?B?ZlRkRGtJeENZMGJ6QlVYcXNTNUs4MW11N1dMdGtuUXAwTTFPQ25iek5tNEVF?=
 =?utf-8?B?dkpkWXVLVzVPMDY0UVFuSlpId2ZrUGZ4VzR0MUUxaThPV0tCVjJhUGhYQ2px?=
 =?utf-8?B?ZjVkL09taS9OSVpTa2hrQ3FUbzVIaVdoUjEweVlMNG5TSTlFV3UrZXhzVnBF?=
 =?utf-8?B?YWFleG5ZV2JvTHV3VFFWaDFtUyswN1lRbEZsWGg3QkVlL3RnQ2RzTGdSUDV4?=
 =?utf-8?Q?tdQJ4umtHLUgWI3WCzooIdWB6?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 49ddcea6-d4ee-4a04-06b4-08db81234734
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 08:54:32.2569
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 3Orx4S5XLHhaAaSH4C/fzhNVz0NkiTAs9h99+2BqBa+MdYj/uYqdOyWXAdorvaNyGS5fUt3+lfzJSzH/X5nj2Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9051

Let's have assembler symbols be consistent with C ones. In principle
there are (a few) cases where gas can produce smaller code this way,
just that for now there's a gas bug causing smaller code to be emitted
even when that shouldn't be the case.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
v3: Re-base over generalization of the annotations.
v2: New.

--- a/xen/arch/x86/include/asm/config.h
+++ b/xen/arch/x86/include/asm/config.h
@@ -47,11 +47,11 @@
 #define CODE_FILL 0x90
 #define ALIGN .align CODE_ALIGN, CODE_FILL
 #define ENTRY(name)                             \
-  .globl name;                                  \
   ALIGN;                                        \
-  name:
+  GLOBAL(name)
 #define GLOBAL(name)                            \
   .globl name;                                  \
+  .hidden name;                                 \
   name:
 #endif
 
--- a/xen/include/xen/linkage.h
+++ b/xen/include/xen/linkage.h
@@ -21,7 +21,7 @@
 
 #define SYM_ALIGN(algn...) .balign algn
 
-#define SYM_L_GLOBAL(name) .globl name
+#define SYM_L_GLOBAL(name) .globl name; .hidden name
 #define SYM_L_WEAK(name)   .weak name
 #define SYM_L_LOCAL(name)  /* nothing */
 



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 08:55:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 08:55:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561112.877441 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImg3-0008C2-EI; Mon, 10 Jul 2023 08:55:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561112.877441; Mon, 10 Jul 2023 08:55:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImg3-0008Bv-BZ; Mon, 10 Jul 2023 08:55:27 +0000
Received: by outflank-mailman (input) for mailman id 561112;
 Mon, 10 Jul 2023 08:55:26 +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 <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qImg2-000866-Js
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:55:26 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on062e.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::62e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8215b0f2-1eff-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 10:55:24 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by DU2PR04MB9051.eurprd04.prod.outlook.com (2603:10a6:10:2e6::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul
 2023 08:55:23 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 08:55:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8215b0f2-1eff-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=cddsQu99PE3DyMrHn0ulLf8nGqW6C09RoivrLbVe0a3Y1NDs/j62GYLBotRUInhy8I5ZMHEYIJfAqdElpiMOEvMV7sPZojUTshZooJavtkaDMvHulAzj43MmgDgPydfswynY56K96/bqzJ+tqFeDG7SZJE4hhRA/OQ98yWtscue4jEmyM0j70sBRiy5fVXLnyEaIXZCyx8vRKEJKR5vFh7Yd5MSIt8oJSJdsyG9BkGCHzeUpR6FxzaLdPMCYSx3icNuIiWGPCFf3uTPT3rsmjuOJpJuN8IBQEyVw+mFv36CCXMkss59bAHKE3aNhmSfonW2g2SYyJ2zAuQ/gMUR0BQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=bblEvpBVoD14a8jtWBS2FnTxPcXC/Rz9Fz+d/NPUWJs=;
 b=LTPsxPpR2Wh6a90cPeFLRoDTVuxYoOuT/Wym1HcURMoF7Qcj8eMNogKFbZvRELbAyi2So+5vgRTxEnjQzvttUSaXm/ErPNDcS0y6BU1gERzl8Mp0Rx8rdgrY9TDHTjZLmy378o7XFrmjOZKKJr0BvemgtdHy4bEn8evQjUISFaUA7bvEw6kVF/10k2EUx8f/JsG/0+LIJqqr2qQcqOu3AkKUFVVTf5GpGAkXQWJ7c3Zoc2/MLpHuzo2B3YWil3OW3QDf0Ml2XxobevDgP0uuWcrvG6Ur1TRIdkQnarhO/wCtc+G2G+jqL1nldC0DpLQB4fc/SUj/3VK9waCzDxhNEw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=bblEvpBVoD14a8jtWBS2FnTxPcXC/Rz9Fz+d/NPUWJs=;
 b=orM39li9zOSpCCIiK+vrjYXWgWtdt7bMkxewQ9LCbykRS0zauZYq2boFhhOyusSrP2vmdlWDBbfnp1HR5iatBESiDPp10EEvd0GkY9O2vQpGn/xAOw7ipDahglc7nDiX96CTBVfcPtuwVWr8JHmPZpHM9hjmZNtJzqWjEYuOHhAtxdkEczYncZu8JQQ0/RHxxf4nRF+1Y1IBH2raAmfVQiTstLGYzeVjlbrZwq6pD1Ny9RkWnpSVnUtvxFUnXlMvIzx3M8dDLg1tXWq9WT1smOZGeTJdQsjxFftQWW2iSxJ4YUG4BZa/jSVrqG5n2HXS7mSXqp5zldC61qXobvd0dQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <36977cd0-37ae-d164-1a69-cf2161d08c4c@suse.com>
Date: Mon, 10 Jul 2023 10:55:21 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v3 5/8] Arm: annotate entry points with type and size
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Julien Grall <julien@xen.org>, Stefano Stabellini
 <sstabellini@kernel.org>, Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
 <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
In-Reply-To: <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0068.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:49::13) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DU2PR04MB9051:EE_
X-MS-Office365-Filtering-Correlation-Id: 5f072aff-1c96-4237-c120-08db81236561
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	rZyX7Wq8xgWGvDtI4nZ4wSMVMZVKYXPBnV3M9vcQHjHzQms+5FYeX6KmK7IJExbWUkNjtfqgkJdxleZ3rRg5ipQCbg+kXN8/H2/zboN1n5g6dFLkK4kHcOxYZWqXCFugSWgpT9vKnQOX57Q2H+wf73h2sWGQKVTfRDK6tjYqevhgQgadWcx0mg86YPLlUoufiSWQHgJYKhS7qQN67ECDJcIR2ny+tJZsQig4PxVlCNbAqKVGQH2T0zTwCMmFFM8Q2tuwFU/Y2IdD0ueQYGwTwuRDXL3ujzP+jEgatk1WrIu2+zaJX9eqDLUQaRQLQbm4Umj7YJQ1vDuvZfE9xV6mV++8yHdF1WLHqi1k/eH1fHdBIemNIctqiFuaL0QDFzU/hjBQqP9BcbFAjfbE6XKsEAoofEAwMmWgfUkg4VkWJ8XeWSl48Ng0vEPSnS9vK7wZ9KnkStlX/qh4Y1SyqFW5XmMc+0/affrsSP4CKbQh+iaVQvaesH4hKQc45C2h9RH+jnDyjbEuZRCsq5jXGw+OZplwg8t3wOM3WhIy1hWhQdLN8bQ9W9oo4gayT8DG8as2JjypdcJ9t+2Im8RMHLmciAlmTkbnsDPaFN9VoaDfm6jlitlPL/6nG82ls8RB2aLkhrSwY7+1cMD3mEgezSGU5g==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39850400004)(376002)(136003)(346002)(396003)(366004)(451199021)(186003)(26005)(6506007)(2616005)(6512007)(41300700001)(4326008)(6916009)(2906002)(66556008)(316002)(5660300002)(66476007)(8676002)(8936002)(478600001)(66946007)(6486002)(54906003)(36756003)(38100700002)(31696002)(86362001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SUQzcGNjay9wSGR1aW4reStUdFNvRThqOC8yK0l5V21PRjN6b1pOMUN2bTZm?=
 =?utf-8?B?SzZFeWlNVVVlVW1scC84UU1rcTNBZHlaYWk4VWxlNU5GWElLdGljblUwUGNl?=
 =?utf-8?B?L29kblg0L1RwOGVXWmJMc0RrY3k5Mm9rWlFQL3RhaklPQ3VBRFJSRWkrWFho?=
 =?utf-8?B?dnY4TWVKN3Q5RklRTjQ2Qi9MeXF6Ri94eDFZSlZ3RzRrYnRTWkZoS3hHaE1R?=
 =?utf-8?B?T0NiWnAyRkRoSlFJRmNuaUxXbUN4eTYzUlo4eGdIMFRWWmhQWmcyRHBiN3Yv?=
 =?utf-8?B?dUdac3FFQ0Z5aFdHQkxKRlVRYlN5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2x3TkZJRVpDSzAxRnNFankzZVR5UFJGT3J4NXNVeGhGY0NMZnpNdWptbXFU?=
 =?utf-8?Q?QtTYq8ns2HT1d0Ar1R9vHFcW8?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5f072aff-1c96-4237-c120-08db81236561
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 08:55:22.8893
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: TFRaJRulX5d3K8HnzyvOQEQhlUM1UBvBVIg6jZ/zlvJYGgpbevJ7leIPBiHukmAFw8oum5gNf2F/JqOG+HTQmw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9051

Use the generic framework in xen/linkage.h. No change in generated code
except for the changed padding value (noticable when config.gz isn't a
multiple of 4 in size). Plus of course the converted symbols change to
be hidden ones.

Note that ASM_INT() is switched to DATA(), not DATA_LOCAL(), as the only
use site wants the symbol global anyway.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Only one each of the assembly files is being converted for now. More
could be done right here or as follow-on in separate patches.

The ASM_INT() redundancy of .global will be eliminated by a subsequent
patch.
---
v3: New.

--- a/xen/arch/arm/arm32/lib/div64.S
+++ b/xen/arch/arm/arm32/lib/div64.S
@@ -42,7 +42,7 @@
  * Clobbered regs: xl, ip
  */
 
-ENTRY(__do_div64)
+FUNC(__do_div64)
 UNWIND(.fnstart)
 
 	@ Test for easy paths first.
@@ -206,4 +206,4 @@ Ldiv0_64:
 	ldr	pc, [sp], #8
 
 UNWIND(.fnend)
-ENDPROC(__do_div64)
+END(__do_div64)
--- a/xen/arch/arm/arm64/lib/clear_page.S
+++ b/xen/arch/arm/arm64/lib/clear_page.S
@@ -22,7 +22,7 @@
  * Parameters:
  *	x0 - dest
  */
-ENTRY(clear_page)
+FUNC(clear_page)
 	mrs	x1, dczid_el0
 	and	w1, w1, #0xf
 	mov	x2, #4
@@ -33,4 +33,4 @@ ENTRY(clear_page)
 	tst	x0, #(PAGE_SIZE - 1)
 	b.ne	1b
 	ret
-ENDPROC(clear_page)
+END(clear_page)
--- a/xen/arch/arm/include/asm/asm_defns.h
+++ b/xen/arch/arm/include/asm/asm_defns.h
@@ -5,6 +5,7 @@
 /* NB. Auto-generated from arch/.../asm-offsets.c */
 #include <asm/asm-offsets.h>
 #endif
+#include <xen/linkage.h>
 #include <asm/processor.h>
 
 /* Macros for generic assembly code */
@@ -28,10 +29,7 @@ label:  .asciz msg;
 .popsection
 
 #define ASM_INT(label, val)                 \
-    .p2align 2;                             \
-label: .long (val);                         \
-    .size label, . - label;                 \
-    .type label, %object
+    DATA(label, 4) .long (val); END(label)
 
 #endif /* __ARM_ASM_DEFNS_H__ */
 /*
--- a/xen/arch/arm/include/asm/config.h
+++ b/xen/arch/arm/include/asm/config.h
@@ -53,7 +53,8 @@
 
 /* Linkage for ARM */
 #ifdef __ASSEMBLY__
-#define ALIGN .align 2
+#define CODE_ALIGN 4
+#define ALIGN .balign CODE_ALIGN
 #define ENTRY(name)                             \
   .globl name;                                  \
   ALIGN;                                        \
@@ -61,8 +62,6 @@
 #define GLOBAL(name)                            \
   .globl name;                                  \
   name:
-#define END(name) \
-  .size name, .-name
 #define ENDPROC(name) \
   .type name, %function; \
   END(name)



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 08:56:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 08:56:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561116.877451 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImgj-0000Jh-Me; Mon, 10 Jul 2023 08:56:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561116.877451; Mon, 10 Jul 2023 08:56:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImgj-0000Ja-Jn; Mon, 10 Jul 2023 08:56:09 +0000
Received: by outflank-mailman (input) for mailman id 561116;
 Mon, 10 Jul 2023 08:56:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qImgi-000090-9D
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:56:08 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on2062b.outbound.protection.outlook.com
 [2a01:111:f400:fe16::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9b9c966c-1eff-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 10:56:07 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PAXPR04MB8255.eurprd04.prod.outlook.com (2603:10a6:102:1ce::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul
 2023 08:56:05 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 08:56:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9b9c966c-1eff-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=lu0A/DS2UuzAyO2gdshBxW9ulJ+lmqn+PP7QeW/O0+GICA6KebbCL4u2LhgihvjaJl3u0UDVtUeD0JOcHp6WbC3Esd54xz3Ws0xnFbn+Z8hW7NGg+fOuEIVxvrEtzcSSTteAmLxgMbEKGF6x70XLp09yRbf39XN1wuWSfuTohXG0eA82WVrv32tyyBaKIufWvZvtoL040oAiOviYGe5yHpi47zN2XA/xmc+6PY+VobHXMKtEw1fyFNYpuQ5+Y25ba3fs8644zeS7s+jtg0bUTHo+gA1pXRNGVA2zb9S97Z1O8rmC7bnBYptbETcbNUFjo/SmNTVhf6B6nQOsYkXWnQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=W7i9WRYxlNMflX/ncFgxWicqWWe8SycnajyCIM9YTRY=;
 b=BMikcid4xc6P45j3l2dXGtWiB9vl36OKquvs9ULvJx/pGgmgHukhSXgAKfkx9HHehIBMy56lczKEw7MgYzLk6C4wXk7JZMlNmtB4zh6N/I8KvocLSzdZYZx0aLfM+hzM78LTDclo6MyiT7rkdIVCkTg0VK2OLEcDR8rl1Dt088ksimwJ4rvjz2bb74vXIizgBjTz/ka3HigS2KeBzKoieTcJ3p4BOwLAgY1l7YHcZsJa4KPYfdM44annuWu2fikeuesH4CaRBr30OfgBj/F5nrTLmhrSVPSSW+mKqtnP2akcu2IMPpzWJKr/rQ/ztmhVcWPzhmBOum51gX0kRD7dog==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=W7i9WRYxlNMflX/ncFgxWicqWWe8SycnajyCIM9YTRY=;
 b=xtYT4B+bfFN9JQrd7+S3seghRxOP/R01o1oclF//cslzEaj5aGW7hFOYWW8Q7jHGRUNhgR0rFE30IDF+Otqg080PJAcZwR7Cqh3TR3aSLWGkvJZM3jqEnCwuAAGCkdKRxuWcm86nRF7LecAfU1uVApfmW1l1xvMTwZtl+QUzZZp4wPPoWF2qyxCiE/n8BHTjt+rqrRw5b0SZltIyanNa12biotmSBGFkBrUYSRvCBaDTBqDSUmxLC5KS0U3CzYjZWr4uZo+DT0mhgF0FOtx3TSUmxaGKbwsnYmcgpsqnquJAohBLjW3hMbxVPDHOqbyOwORY8RzWOIB6YA6+BIx2xQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <959bdb6d-9b6c-cde0-9459-c83cd3f58b18@suse.com>
Date: Mon, 10 Jul 2023 10:56:04 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v3 6/8] RISC-V: annotate entry points with type and size
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Bobby Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
 <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
In-Reply-To: <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0018.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:15::23) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAXPR04MB8255:EE_
X-MS-Office365-Filtering-Correlation-Id: 1c50e6d3-b4d1-4f23-05b1-08db81237e8d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	mELQuRq6AIoL0lK2AYNEJd09J7mfWNrkvpET1TlNP7J9IwUAL1L012SCb0UnHfRbIRlFQPkgWtJaMiU+U1ooSbVgZshJaiMrhqA13HT2OYdADn75P7rZ1nNNPa2jU72xm1M/g2ZH5N2/BQ0NjgHLvOUTpWIixnwQVfXTXbJTFV4F50nPh9HzHPOeLXJCYtI2uYW99cKGbHN0g6kDOCvFnuDkSDexTg6DmuWEGUEVztlYZsgx8Kgj5UuHj+2D+QzDYZnz6IeRFx271in4AfIbOTdqV1iSwx6tEN5O02m7bgxKsjRPAUxY4WSAlnaRKCtT1Oy4/+0nA9XV9v+CDw+lpoxyK8GclWjrJRA3xJOz/EmI4sgwEBhkP8pX4rMCV7R6nwx+uYGj4X7VJlz8oQOeA4s8tDfIpcW92MVatsGJ0SCzv6/tUgoV1dLirIddA4T/eqcSTUdo+Jd44wqHlAHD9yI6VdAmfCNAFLFtbdo0Veou87Mj+vMaex+o+pDyYPB/zboIfID6BxhJU7aELPDtYOLJ5mEU0D8/Cr0srrA0XuDy80FTtKxfcHSMMPr6RejwjsiXS4kg/sR9Z3yGb+aKF01ftBjtapaVpPdGnhNhoBHjNpUKVga2Ul5Pm2hN8cTIyOIngHxZJachYQCsX8hwkQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(136003)(346002)(396003)(366004)(451199021)(186003)(26005)(6506007)(2616005)(6512007)(83380400001)(41300700001)(4326008)(6916009)(2906002)(66556008)(316002)(5660300002)(66476007)(8676002)(8936002)(478600001)(66946007)(6486002)(54906003)(36756003)(38100700002)(31696002)(86362001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SE5VdGtWb1ViN0NVbVZkckR3RmxHUkx4M0JzTGZYRVJhNGgyZHY4QjN6K2RX?=
 =?utf-8?B?TUtBZUVpSHRyaUpCVXdQZ2lrSDNwRkoxZHBGVThJRzRDMHdoRU9hZGFvSWFV?=
 =?utf-8?B?OHNETGdlTDAyR0lIcXBZYUpUOUhHVk5PNUhaVE1aZC9xR2w1WElIeFBVMnND?=
 =?utf-8?B?WWtjTjlpWU5rd2E3QWJWNFlOUmZLUys1TDRWMFcwc3NqdEZSZmc0OXpVZDN4?=
 =?utf-8?B?ZXh0WEQ2U3gwcm56QUFNOEQzVzFRQnpLUTVkaElWWW1XYlhLVXkyeWlTV1cy?=
 =?utf-8?B?UUNnOXZxVG9kYi9uQXdvaVdQV0R2ZkJ6TFBjalcxS3pHQnJ6ck50TDVwL3JQ?=
 =?utf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M3M3bmla?=
 =?utf-8?Q?fT4yQox7lDqEv8UNxxjsDBMCI?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1c50e6d3-b4d1-4f23-05b1-08db81237e8d
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 08:56:05.0735
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: PDV9hGOBbjs+pxBkgaKQ815Ahe4uZvjC2MrjQjZhN6gaw323Vn9PZ41ZpyeTz/P3XhPxMW2aZHs2OnrCZpPOEg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8255

Use the generic framework in xen/linkage.h. No change in generated code
except of course the converted symbols change to be hidden ones and gain
a valid size.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Probably count_args_exp() should move to macros.h, but I first wanted to
see whether anyone can suggest any better approach for checking whether
a defined macro expands to nothing.
---
v3: New.

--- a/xen/arch/riscv/entry.S
+++ b/xen/arch/riscv/entry.S
@@ -5,7 +5,7 @@
 #include <asm/traps.h>
 
 /* WIP: only works while interrupting Xen context */
-ENTRY(handle_trap)
+FUNC(handle_trap)
 
     /* Exceptions from xen */
 save_to_stack:
@@ -92,3 +92,4 @@ restore_registers:
         REG_L   sp, CPU_USER_REGS_SP(sp)
 
         sret
+END(handle_trap)
--- a/xen/arch/riscv/include/asm/asm.h
+++ b/xen/arch/riscv/include/asm/asm.h
@@ -7,6 +7,7 @@
 #define _ASM_RISCV_ASM_H
 
 #ifdef __ASSEMBLY__
+#include <xen/linkage.h>
 #define __ASM_STR(x)	x
 #else
 #define __ASM_STR(x)	#x
--- a/xen/arch/riscv/include/asm/config.h
+++ b/xen/arch/riscv/include/asm/config.h
@@ -67,12 +67,8 @@
 
 /* Linkage for RISCV */
 #ifdef __ASSEMBLY__
-#define ALIGN .align 4
-
-#define ENTRY(name)                                \
-  .globl name;                                     \
-  ALIGN;                                           \
-  name:
+#define CODE_ALIGN 16
+#define CODE_FILL /* empty */
 #endif
 
 #ifdef CONFIG_RISCV_64
--- a/xen/arch/riscv/riscv64/head.S
+++ b/xen/arch/riscv/riscv64/head.S
@@ -8,7 +8,7 @@
          *   a0 -> hart_id ( bootcpu_id )
          *   a1 -> dtb_base 
          */
-ENTRY(start)
+FUNC(start)
         /* Mask all interrupts */
         csrw    CSR_SIE, zero
 
@@ -30,13 +30,14 @@ ENTRY(start)
         jal     reset_stack
 
         tail    start_xen
+END(start)
 
         .section .text, "ax", %progbits
 
-ENTRY(reset_stack)
+FUNC(reset_stack)
         la      sp, cpu0_boot_stack
         li      t0, STACK_SIZE
         add     sp, sp, t0
 
         ret
-
+END(reset_stack)
--- a/xen/include/xen/linkage.h
+++ b/xen/include/xen/linkage.h
@@ -37,17 +37,28 @@
 
 #define END(name) .size name, . - name
 
+/*
+ * CODE_FILL in particular may need to expand to nothing (e.g. for RISC-V), in
+ * which case we also need to get rid of the comma in the .balign directive.
+ */
+#define count_args_exp(args...) count_args(args)
+#if count_args_exp(CODE_FILL)
+# define DO_CODE_ALIGN(algn...) LASTARG(CODE_ALIGN, ## algn), CODE_FILL
+#else
+# define DO_CODE_ALIGN(algn...) LASTARG(CODE_ALIGN, ## algn)
+#endif
+
 #define FUNC(name, algn...) \
-        SYM(name, FUNC, GLOBAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL)
+        SYM(name, FUNC, GLOBAL, DO_CODE_ALIGN(algn))
 #define LABEL(name, algn...) \
-        SYM(name, NONE, GLOBAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL)
+        SYM(name, NONE, GLOBAL, DO_CODE_ALIGN(algn))
 #define DATA(name, algn...) \
         SYM(name, DATA, GLOBAL, LASTARG(DATA_ALIGN, ## algn), DATA_FILL)
 
 #define FUNC_LOCAL(name, algn...) \
-        SYM(name, FUNC, LOCAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL)
+        SYM(name, FUNC, LOCAL, DO_CODE_ALIGN(algn))
 #define LABEL_LOCAL(name, algn...) \
-        SYM(name, NONE, LOCAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL)
+        SYM(name, NONE, LOCAL, DO_CODE_ALIGN(algn))
 #define DATA_LOCAL(name, algn...) \
         SYM(name, DATA, LOCAL, LASTARG(DATA_ALIGN, ## algn), DATA_FILL)
 



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 08:56:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 08:56:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561122.877460 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImhK-0000vN-1T; Mon, 10 Jul 2023 08:56:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561122.877460; Mon, 10 Jul 2023 08:56:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImhJ-0000vG-V3; Mon, 10 Jul 2023 08:56:45 +0000
Received: by outflank-mailman (input) for mailman id 561122;
 Mon, 10 Jul 2023 08:56:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qImhI-000090-FT
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:56:44 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20615.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::615])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b15cb6d7-1eff-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 10:56:44 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PAXPR04MB8255.eurprd04.prod.outlook.com (2603:10a6:102:1ce::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul
 2023 08:56:42 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 08:56:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b15cb6d7-1eff-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=kbc1KKsKJgEyrBjg5ntpwXl0dwQGj2DHkhDarLkIpZ2CDX5KWgxtpjt87qob0R1GJ3D6abnIB9rPJIHBC8KDbaCuV5NtKZcZ84qcyackOQKYtMaEDDcABVT1+mQjexXIYZCfyoA0v+5XYlp24o8UCFn0tcPnANFVk5Iv7gZ1EQS/mWJAUqYd5LPv+Y80CbzySPo6F9nk1jemXJCFbtIBuPL30qENHemBWxFtt0iocWZ50oA4yVflaP7mgf20PL8VuvRUcLgtlbIiOfT29569ERWvwGP5mVKdZ+GnQH7ldHEuyPviSIkap2gqcqom+LVqPxL/Dqkg9fTNOOy4ClB7xw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=c/xR6YkWfKWV2eWIcLISE9nlBCFQDkrQgA4AhpXFs/s=;
 b=lwMzKG62PzYz2I4EwF3zFqhFpADK0C7AwcfJVIPCXPO0JENLH3ok024POdCuoE9DWgWr7RchKlyuw3Mfch7/kpMva7AgqW+cPfEDP5kRoyDjHeR5Hi4/qEG6zGqCjSZ5ex7j4TrZsFJeGVBim9VPxh7dARcdHlf0al49/IMVIlb5PqIFNLQPFbPQ6S8aL6bTR8/a+3PTv2Tdb1yvjAxBKp+VNyRWG7FZbiMwRdr/ukPwXvYdJci4SOUNyZQyL0rEtDIU177trmN7DozW6mb0GkCMrA9D6w0a/vM+2eFBt+Z4C0FZ8UAPbTksSgq2rrWEknlFWsJB4WBN+lQrhX3j5g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=c/xR6YkWfKWV2eWIcLISE9nlBCFQDkrQgA4AhpXFs/s=;
 b=iE3+MhXgnraMQ/sMwPAF1lQOq030esL6uo6gN3W7PECx+PD8N/UAqpwALoCo6Fj07Mzpj9qdLcmNzr+D497hscgLoHOaKq5GTrf7TObMktUfZgGYOAYYj6YcwLqT2v2zegqNiau8Gbll7pTjVM1VSsqoCwiqwz0weLcVdwju8bo0TlykGsuLmCE6yX8Y25rPIHxm4FZD8/quPXtEDDvZRFNiPT4bmv7FLKE/R1xmjXe90RGmlmW2tBSpf0XjR5Et1AUotAarSxagqc275psq4IaHK4MUWjOIa4612E2C7mGwZlhQrDIp/WMjvtgoDf7GOwLV1Sgf2aRz3zeOdfFsGA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <283fbba2-4d96-2ed0-4e0b-8d432c612667@suse.com>
Date: Mon, 10 Jul 2023 10:56:40 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v3 7/8] PPC: switch entry point annotations to common model
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Shawn Anastasio <sanastasio@raptorengineering.com>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
 <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
In-Reply-To: <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0161.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b3::8) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAXPR04MB8255:EE_
X-MS-Office365-Filtering-Correlation-Id: acd97017-f6ca-4644-3057-08db812394af
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	jb1qfUgs4w1fY90Z1rsvsG/1iOWdHl2Vsdm7UhKZSmXimcUWPPqAdhR/vU9Kk0BUwmEsaVYrmrjPgnuueVKUhJimFOsBHFrfnG3xeKztpT/7OAufstyPZd/R23jxbhAkZZwkWsvqCQEzeBd8iEiCgAKVx2s84Pmt5Lq5/BRaSk+lX7oS4qug8SuvNrLmFbZKSWsMBybMWGqF7zn2GkyyTgR1vWHeddXdjnO0fYQ7qi2rixPNIYXiuv2OZgF2vJIpjSW5J2P7N0EiPgXaRqj83a2Sp2kCwgxf57MRAHNEYrDt0vyvYoHU6D+yPImPiEwfLJ+anY+/P3iZQOeljHTWDw6W73hIArDIPim7zhryhcNKz8j5f0WmpElvejvZcJIe2fpIXKjSrcFDiYYoT40BqaT9AG6TaHNt+Vv8HUWNWcJQhQAg6aS1KoWKnGCa8b0F83cnEaNoKmIs12E+enxfD/l06VSZOIrPg/LtQ/ab53TK67ccyUiaYS6NujSKfV/eWRcmeameik+sias/2YagaLBMwHLt8+dyLsDUXGQVHsjr/mmBws6U1l/G0IzYKSGtQz9I1uY+xrFTYzbHc/QE7+XbxC7itLumPkBsnbxKd3hgOsWJ+AM+G8IUVRryvepjwEOSqZ3SaiNXF26vqPwIRQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(136003)(346002)(396003)(366004)(451199021)(186003)(26005)(6506007)(2616005)(6512007)(83380400001)(41300700001)(4326008)(6916009)(2906002)(66556008)(316002)(5660300002)(66476007)(8676002)(8936002)(478600001)(66946007)(6486002)(36756003)(38100700002)(31696002)(86362001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	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n?=
 =?utf-8?B?MGFycEkvY0cvaG03YWRtN3hNMEozWmpNelYzbDhZV0g5RU96R2lWdW1wQzJk?=
 =?utf-8?B?Z0RJdytaYWE2c2JCSE1oaXgvSnliVlFFak15N0ZZWGpaR2I0TlJYTmZWYjla?=
 =?utf-8?B?SkN0Vkp6em8zOWFUd0xvTW5PdG5ETDdCR3Z1WjkrZGg4V1ZUTGx6YWJCbm5L?=
 =?utf-8?B?VmNhdGZIT2E5TWxHdDVBYktOeHNwMnJaODFrUjd0ajBXS3B6aGwvaUJ4bEVJ?=
 =?utf-8?B?TllBcW5TSkpPMzQ0UXFsVFNOVWNWbEVremRxT1M5YWlCYTN6Z3J1UWxrNVpP?=
 =?utf-8?B?bWxQS3RKNm1uUTY0NmRmWjhOcElzVno4TFJpN0hoOEhCZW1IU2VZM3hOa3lL?=
 =?utf-8?Q?5BnIWm+QNj2RmGY+8Dftoz40h?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: acd97017-f6ca-4644-3057-08db812394af
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 08:56:42.2309
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: prxM7UAnXhvqIVNjvipszabTyUjWP4EhDwOecgCAO4acjTgmtkzQ/db2VQ4SvaoC+uE9MJQYv7Cgikm8dDRiRQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8255

Use the generic framework in xen/linkage.h. No change in generated code
except of course the converted symbol changes to be a hidden one.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v3: New.

--- a/xen/arch/ppc/include/asm/config.h
+++ b/xen/arch/ppc/include/asm/config.h
@@ -31,12 +31,7 @@
 
 /* Linkage for PPC */
 #ifdef __ASSEMBLY__
-#define ALIGN .p2align 2
-
-#define ENTRY(name)                                                            \
-    .globl name;                                                               \
-    ALIGN;                                                                     \
-    name:
+#define CODE_ALIGN 4
 #endif
 
 #define XEN_VIRT_START _AT(UL, 0x400000)
--- a/xen/arch/ppc/ppc64/head.S
+++ b/xen/arch/ppc/ppc64/head.S
@@ -1,8 +1,10 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
+#include <xen/linkage.h>
+
     .section .text.header, "ax", %progbits
 
-ENTRY(start)
+FUNC(start)
     /*
      * Depending on how we were booted, the CPU could be running in either
      * Little Endian or Big Endian mode. The following trampoline from Linux
@@ -25,6 +27,4 @@ ENTRY(start)
 
     /* Now that the endianness is confirmed, continue */
 1:  b 1b
-
-    .size start, . - start
-    .type start, %function
+END(start)



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 08:57:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 08:57:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561126.877470 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImi4-0001Uf-B1; Mon, 10 Jul 2023 08:57:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561126.877470; Mon, 10 Jul 2023 08:57:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImi4-0001UY-7q; Mon, 10 Jul 2023 08:57:32 +0000
Received: by outflank-mailman (input) for mailman id 561126;
 Mon, 10 Jul 2023 08:57:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qImi2-000090-Bw
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:57:30 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2062a.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::62a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cca8e8f3-1eff-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 10:57:29 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PAXPR04MB8960.eurprd04.prod.outlook.com (2603:10a6:102:20f::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 10 Jul
 2023 08:57:28 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 08:57:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cca8e8f3-1eff-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KqhmvAiGahJ8duQQHzJmRnOJ3n1Rg6hvRNaMtJ8e2iXR1VLHaGml/ujHjFsFYkDQeHyTK8ttM6N/3QuAfZGkGfjNkTylhhXuIvzGI9PcFRivFO3y964qABLn9SuRTpKQeR7VvqI3+Rfh0vhMBJE2RjWEtoxiL7Q9zAfuFiLgNIZqMiKBl7TdY3tm6plNcUtTIObxx47j4/EcdqIuG5UfLrnrOjW+2t+qcpztXpsTbpD59ZpZiQiZzbqfJV6S+T1QkGSsEt9pbYLE9dEM47RE9MH0yq1wIPQhlQ3J6OeYHoU8dDYQnuOLSho1ous+ETXgiOv+tCj/t9ZxBA0m6s/sGA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=NsniVDfE1jEbPDiRAa4YFhSNPmca1KwD931ycm8eIt0=;
 b=BYM3j4R0yhxRcPdJs5jjgo1tuCpsz6cv/Z+wtREnDZActYTjScJp102wu6W05lMUd9WTD8CTA773wYAkRaZ7mbU0dykYQWnXMSKqTdp86i6jKxCohR1gXxZfBiFAnDCy0hqMSt+re6WQ0QLs6Tep3AQzTaD/bx0ikF+Ab0fA6uOPXc+xaok+9hyhKu4t3cEk2z4kRh+P0VL63U+XHB8WVw6NsUpyGcnOK68IAcwDwv12bzkv48UwiLVjZ6Bu9IoxgTR5qlYQ0AIIzM8rPtWDGx6O0UnEgT7caX7794luGnS7vv/wFTDvD8wKXgnHedqqEzCUt1EEcW4ty8e5WNbTuw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=NsniVDfE1jEbPDiRAa4YFhSNPmca1KwD931ycm8eIt0=;
 b=bpEg4BDpgkgaIbGeGiYYBpwWRnrxzUb93VPtufmn9qSO7dh2Iu5rO8/9RJlcpGwKd4yj4jDStuBJS5IlPNZ6I3yzSCuq3Y5XbFAdHaaYUBFcufAuclE5yDSy8QvYqNj+OHxpEz4SOGuKBVbKTYV4XwtLZaH/1xlxzK2BmT8lUWmrh9INwLHhiqKW7D8SKr1RbweRmV3haPqE+egQg92AcFnWZSHfwVC4qufBYLjp7peaTrwd2d67gNHSXnP6EKx1jRg2V+IzNhHHe5dJhQE9e+P7KREVmS0KgPCrJA89P7zPW9Q/BZ5gJ+akvcCFvxhrElxunqbB7R6Tjhy6iQhinA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <84b2fd88-d852-b1e6-0f4c-cecdcb8c7943@suse.com>
Date: Mon, 10 Jul 2023 10:57:26 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v3 8/8] tools/binfile: switch to common annotations model
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 George Dunlap <george.dunlap@citrix.com>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
 <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
In-Reply-To: <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0221.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ac::17) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAXPR04MB8960:EE_
X-MS-Office365-Filtering-Correlation-Id: 91d91873-9b3f-4a8a-2c2b-08db8123b014
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	yVhn8w4nJwd6URS7uBN1XHBU7MT9ohHrk1AVYuHvAoIuhlRg+Q1NQXmT0bs8LQ22bXtTUavYfHxSxm8qyk9sR/hoffg7mfiEEkpmrSsUE9MEtVFCUoMGbmq0eN57xnUZ53QJnKYNI7t8+sjQcu7YQ5W9ydQKI7FT628kJ/T94eYbV/HPkkDtSdfCCOBQ66c1QQ4hZRWkWfiQ6vY6WmrujGQ9HPXGWfjG3v4fKxDFE1ZA4YWJ9rvMop5OupipH8eFMHLsOz+jMSEEPvLGitE8ioNrQtWY6hFkkKTl+1xVSgsLpLXwVKx+DpDbn8W3RbspAdk17BNQb/KQNd9T10NlWasfVDL6aF4800tDjt9AYFT0FftDgN/qbb+CcLxWIxTY0SS/p2ABKeynXc1cavgzguXqJpHIbcj5RMndQ9nuOAL2yJQyOnhlRpEZkKlrGQkcHgh0krUu8hsUc3THW7tlzaoL1fenrlsECidJX7JRAAR+re/8aA6pgFuDWZ3ukNaUumNqDNLAlxYV8S9//63FHueYscrvl9z2q16j0Vq31eLzFrsnGsg5CClRmNVHOaWUSmlyEum1yRbHSPjlClz97Td0tcubaSo/+5J/KfaG3r/kU5x0rF1Bh2Fmz00yUN7mOEdCd9l6LIox6u4TemJXpg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(136003)(346002)(39860400002)(396003)(451199021)(66556008)(6506007)(66946007)(4326008)(66476007)(6916009)(38100700002)(41300700001)(478600001)(316002)(2616005)(6512007)(186003)(26005)(36756003)(6486002)(2906002)(8936002)(4744005)(5660300002)(31686004)(54906003)(86362001)(8676002)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZjJ5aUcyMWdvanFBYVNuWjB0NHpEWTBibVJzMmpScHdXWDVHM016cXpuMWJk?=
 =?utf-8?B?SkhMUVNtcWVLd3ZMZXV5SUdkaHM5VzZldWZ3R3NQdGY0UU1pS1J6TWVjOEgz?=
 =?utf-8?B?WnpaNmNxNndUc2NTYTFqa3RHblhiRE9NUEovbUg2Z0YrVHRma0UzVkxNemlW?=
 =?utf-8?B?Y3NFMVZqL01yV3FzejVibDF6d3VtTnc2UTJObjVtL3R6WktvZUZLV1VkY29E?=
 =?utf-8?B?MHJuODU3c0JrN0tLZTFmcGhJMHpadmMwcVY0M3UvYmhmcHFEVWk1Z3c0WHU2?=
 =?utf-8?B?ZG4xTWJJZnJmMks3V1JBbWU4Nitpem5HNFN5UlUzZ3paOENhT1JxcE5XOFJR?=
 =?utf-8?B?TWY3M2dDZkMzc0RvM0VRMlpybjRSeWdWRXczV2FUNmRVUUVmdnQ2cTlNM01w?=
 =?utf-8?B?bTMwN0tTcnQxdHJMdTRLU1A1TWVSQzQ4RUhxUitMejFrYjA2ZHpPSVVGUG1h?=
 =?utf-8?B?QWMrcFVxdXlzTjl4WEt1b3V6aUNBaHcwcUpvRW1YRC9QNnBkNzlHUnVVRjBz?=
 =?utf-8?B?MENjaWVvZEU1OTNJb1NjVVlvcC9NcXFrNWtWa2IzVFhDUUNDZUpwdkNjWnBt?=
 =?utf-8?B?U3l5TXBNNXZxUG9oY1pZVHNRdTByVUV1QWJvZ1dHQ1dtL0VWSjY2dEt4c21v?=
 =?utf-8?B?QjQ1KzdodEFlVjFmdTVha0hEbHhGaHZVbm9XVmdKKzhDYVZsdVdxeUgrMitX?=
 =?utf-8?B?bjJVbHNOakFQ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iK1FiVEU0OTR2WnFX?=
 =?utf-8?B?YWZ5WndRQ1VFMEROWEdjMCtEM0NCK3dVMFNSS1MzYURCT0hibHdvcUZHUGlv?=
 =?utf-8?B?ckI5TGRHOHk5YlQ0bnR3eVhVRUUzbHFkaUJoaHQvQlMrcG9OaGFTQ0N0Q1k5?=
 =?utf-8?B?M2V1K21ZVkkrNk0yYXRUVW15c09FZkhTdXBRK1JOR01sT0xXclJEcFNtSDl1?=
 =?utf-8?B?TG5PM0k5Q3Y3YUxZZEZmU3FMbEwyQnBIckZwUndMZkF0VEVpZlZPQkxZU29W?=
 =?utf-8?B?VTBxcis1ZmhWNWptSFN0MnFFQXhZS00zUWxHL1V6Y2RZeGdtZll6dVZxVS8z?=
 =?utf-8?B?VStsU1J1THZXeTBKNDlBVmU5WDR5TldPUUtHTDRCc1QyQitQWllEbXZpdFNW?=
 =?utf-8?B?aW1jU3FvNTFkOFVRYlpPUWJVdkU3WmJWRzMvbXlHRDMxdTAyUlcrN1ZyMStx?=
 =?utf-8?B?OXE5LzVtRkNTZEV5WHFGeUhuZUFLbDVQU1g0YThrNUhxR3hKTzFvVTl0WjZE?=
 =?utf-8?Q?4MOYaNzgPk8jOLZwh5iiVa08U?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 91d91873-9b3f-4a8a-2c2b-08db8123b014
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 08:57:28.1738
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: X5S4axufVpW961kvUMGkkfhygwRLCpBkOUwJdd2cMyPI3I3e+EyQIKiBChmm2T7aBdn8x7JqHxeDGj1k0DIfZg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8960

Use DATA() / END() and drop the now redundant .global. No change in
generated data; of course the two symbols now properly gain "hidden"
binding.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v3: New.

--- a/xen/tools/binfile
+++ b/xen/tools/binfile
@@ -29,15 +29,10 @@ cat <<EOF >$target
 
         .section $section.rodata, "a", %progbits
 
-        .p2align $align
-        .global $varname
-$varname:
+DATA($varname, 1 << $align)
         .incbin "$binsource"
 .Lend:
+END($varname)
 
-        .type $varname, %object
-        .size $varname, .Lend - $varname
-
-        .global ${varname}_size
         ASM_INT(${varname}_size, .Lend - $varname)
 EOF



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 08:59:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 08:59:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561130.877482 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImjs-00027U-OU; Mon, 10 Jul 2023 08:59:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561130.877482; Mon, 10 Jul 2023 08:59:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qImjs-00027N-JR; Mon, 10 Jul 2023 08:59:24 +0000
Received: by outflank-mailman (input) for mailman id 561130;
 Mon, 10 Jul 2023 08:59:23 +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 <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qImjr-00027H-F3
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 08:59:23 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2077.outbound.protection.outlook.com [40.107.7.77])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0ef391ac-1f00-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 10:59:21 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS8PR04MB8246.eurprd04.prod.outlook.com (2603:10a6:20b:3f6::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul
 2023 08:58:52 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 08:58:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0ef391ac-1f00-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hKarVCWOTRdGwwEcOpE5MJP74wVFvmn1Bk2lDBFDpCUvc7jEuVSy7sIeGuDEDDoh9J0La0y/CsvHx72/P4riW4DEjdRhmjHNljjzpqFh4AnFZgO72BwKzoZF2NPfwLQIQD8CTb8Tz0HZNVPhsTjeMh0kRKxdIUQ8ywtmr49v3x2MkR2PLPrgMfwzKwv6qk64yIPHwUpeAnjqER03WnHSXrBGgixt/7ad6PqKK7wJfJBn8VQ2esXSsNPSr41FD3n6BiEmCijed66t1lo8dvxkwZHteKpdVye78gj/ODriGUhuItyRa62CfsClKI+VRBmv8DrkH9cg8/SZ7FD7wumtrg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=h811xvasPtVt7HU8DbIZ6kPfEgVZiU2VhfJhpHl8PoE=;
 b=h+J4J5qPi07d1ExMqYMKLTquMPuGvPHIW/HdEnYRAyQLlUBOdAwx/JIZ8LuYG9kHQc30DrlL21ykxHd8LSWzR6UIz6HcbdLCD3YupdVc8LhUx2jUuEu/7xbi3RWWnG3AiBHA1MkmrdWekFq5vXakyVd7/ZHdI2VbOeDTwD6UDs+ox2YwKS1O3v7+qrQGPNUy7qAz9lQleSWxkJnLOKl0UZvVr4eAI1SOhuVCWdlM/Ga2KXYcYZ/+XzrdyfRJlvaaCxio1Zx9ymWxMbbKSiPKszLFsyNX1yozxmEvZuxUg5ftSFxZKHhewiuk08FUbEIuW64pgdPprrxziAaPcJyFsA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=h811xvasPtVt7HU8DbIZ6kPfEgVZiU2VhfJhpHl8PoE=;
 b=dbnIDKxqGNjo/pFJSAJc8P2gjNKnIN4EnxmBkcgq1FSGw+8gQcpttG0PHQUOydt/DuCCrjDRUtUu8SS8PqaQfuCpomUZj9jNb9H7R0EpHBZnqJF5B5HlBHD9XWbrFxqRDNbENIb90CZbdROXrBngPpUSlcqComqMSMD1tKoy521XjH9ZmuTokeoB0xYTygJRwMLmA3HxyDkllpNohMsvdB0InshznqyDzjIuUGaCoidGjHwe1Ep5jf0feAUorGh9chGdQiqLDVP8lQPEHdYDb3bUvpCYEj36vP8bGTyMLHe/+KGJc8iq2BWhF6JtHMUlkibvWmGHukrYFhw3nZMcow==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <60e57a9b-8091-0e6a-6066-2364d7d5441a@suse.com>
Date: Mon, 10 Jul 2023 10:58:51 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 6/8] RISC-V: annotate entry points with type and size
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Bobby Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
 <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
 <959bdb6d-9b6c-cde0-9459-c83cd3f58b18@suse.com>
In-Reply-To: <959bdb6d-9b6c-cde0-9459-c83cd3f58b18@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0054.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:48::16) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS8PR04MB8246:EE_
X-MS-Office365-Filtering-Correlation-Id: 621c4fd7-5486-46bb-14d1-08db8123e28c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	G7eXVxPSzcjxRBqaCe/yEAnDOkxwyWzac5/PEtmiYW/imrSmhE919mQNE6ksZauF6VGzTFLzhY2seyy09CHQLkxrqUcRJ+udLn0W6lPcVCG9fRaGpEJI2zzHbAUJ4XTgr6/fi0Fm9mcjQ6IPLRyDb970+r317daZojVg1gunrLDNVChNCTANGfHZDyZvkWluZpyJ4PIp/Hx3kWmykAVI28DQ8a4aKEI2XAXcV61hTTcEddEWST6EYVPc+Dld3c8F4v/8ucUPhQUfIxhQe8HIACCI6eHtUGlMfWyigOqMHS7g/cqQs5x8iO4/ga9SesQVbd4DFuWVOWnCZDEQ7n77YKLpD76TO7f3fALvIJbveWLMgzAeM9Pvl3MzbkpVPeLSa7Tcbo1VwAMMyJqW8wF432Uypasr4Rr8GxJtRPp/DXe+4fCju+gJCaILpuOiaTIBBwyJz5CdD0M6mI8Nq5T8jPNig5On7W+FLTns1Xkpd4EHN6CPnUR/mN3UoIgdCNG0UJrFJSNi+xycPej4kSsGt08VlgsgwHwrOaflWP/fLd/Ftk4jpKU4pdElQX6CO35vCDR5TaHycRrPcvAAfNE85Cf6Y9ewYzik4jSm310tpBiOZIEEJYH+n5LHyMVo+ZLnlk03fqdm4yXWnTTATafR9w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(366004)(376002)(396003)(136003)(346002)(451199021)(86362001)(31696002)(38100700002)(31686004)(36756003)(54906003)(6486002)(53546011)(26005)(6506007)(186003)(6512007)(2616005)(66556008)(316002)(2906002)(478600001)(66946007)(8676002)(8936002)(66476007)(5660300002)(83380400001)(4326008)(6916009)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WlJQdXkyTXdCSm5PblFqU1hXVGR6YUo2UWRvNnVtU25PTlg4dyt3bTRxRVRG?=
 =?utf-8?B?S3N6RU9nVlZQSjd3ZlQrekM5ZGdEN3RMcW9tT2JqRUNUS1p2cFNtbTZQZ2xv?=
 =?utf-8?B?bWc3TmlRcnhBb3FxR3c5cEY3Qy9NaCt0Q00zQzJUK2VEbE9PZldPMlB2dWZM?=
 =?utf-8?B?MDJTK1JVWVo0cDBxWlRRZGtlajEvZDBUdGo0WGE0d1h4VVUzVi9BRTRGWEJy?=
 =?utf-8?B?UEZ1STNQR2MwM2RxUTdFUGR3UkhOVlJDdTdnNVlpOFZDMDAvcHpYR1pWcVRW?=
 =?utf-8?B?cXpzVGt3K1kxelhYK2h6c293RzduTjMrdzBaZmRvSWJRNGdTZFRnN2EwT0hE?=
 =?utf-8?B?djNXSm1haWJQVmgxMjB4Q0tZS1JRSzBkc1ZmRmFRRHdsaGUzWUk0QmkvbVh3?=
 =?utf-8?B?ZDMwNWx4TTJWd1l3TUdSVTRIUERBZDIxR2ZPRHJZVlQ1Tyt3ckZKN0JhV3A4?=
 =?utf-8?B?NnN0cW1SaUduOTJFT2RPczYrZHJVZHdxVE5IMlo0eWsvdEszRnZBYWlrNkg4?=
 =?utf-8?B?Skg0N2tNYVppMVNKNjdDQ0JHMFhOSGdyblhKYjRvb2VtbHZtMDB1cWF0dGFq?=
 =?utf-8?B?NFZzU1lRZGFxYml5dEdQTU0vN1R5Q0N0OGdsZUFVUU1LVmkyZktZb004dUlj?=
 =?utf-8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XaS82MHBjSHpQbGp6ODRlb3o5?=
 =?utf-8?B?eVhGUnhXZ2RsVytHU1VyL29Xekg3bXd3bDc3Zm9KYk5oK2wvTVdoWUllVTc1?=
 =?utf-8?B?RWNFYkZUNTBOVnNyOGIzMFpEd0dmVFJxU2RNWk5ReVpna1Y2RDVjeDFoRE42?=
 =?utf-8?B?R3E4MSthS3FTOHVmaFFSSjlqS1BTS05keW1uSFBDaHUzRGx3eGw5Q3JUdEpK?=
 =?utf-8?B?Z1RKN21SYTBrTjdqanBiMzdIVExIMFdSMVA0OTV6cUpPSzlKbkZ0YXJra3l0?=
 =?utf-8?B?YjF0bERXVHNtRjZic3pEMlUyNkRPVzRlNW9NYk8wWE1sWmFuR2IxOFUxOFk4?=
 =?utf-8?B?ckVRQ1U3Q0UrczdiZXpralczaXpPM1F2YmFFNTJsSnM3SmxjS1Z5NjdzV2FM?=
 =?utf-8?B?RWdLWVpwSkFIeUtvUHlnUEp5M3lsYTdDMnEwUzA3QnFLN1l6eFZmSFZId2dN?=
 =?utf-8?B?bStIOExUdFhWa3RSUmNKaW14Mk5NQ2NkNlRhUFBXOEkwSUpqYy94SVAyb21o?=
 =?utf-8?B?YzA5QUMvekJ6TU9GcWNtS3hFbGo5WGwwclJrTGpYclVxbW5wMXYwcEZOdGJs?=
 =?utf-8?Q?7ETbEs9zRTSSlTDEo7nTkQFq8?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 621c4fd7-5486-46bb-14d1-08db8123e28c
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 08:58:52.8524
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Rmgahp+JM6WRy07vUN79RJoOgJvxGIp9DkVJHxU2KHinOJRQsaw9XYA+dNAPDnVC+u/RpnIzkoEcj1jZrGrkHQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8246

On 10.07.2023 10:56, Jan Beulich wrote:
> Use the generic framework in xen/linkage.h. No change in generated code
> except of course the converted symbols change to be hidden ones and gain
> a valid size.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

I'm sorry, the Cc list was incomplete here. Adding back the remaining REST
maintainers.

Jan

> ---
> Probably count_args_exp() should move to macros.h, but I first wanted to
> see whether anyone can suggest any better approach for checking whether
> a defined macro expands to nothing.
> ---
> v3: New.
> 
> --- a/xen/arch/riscv/entry.S
> +++ b/xen/arch/riscv/entry.S
> @@ -5,7 +5,7 @@
>  #include <asm/traps.h>
>  
>  /* WIP: only works while interrupting Xen context */
> -ENTRY(handle_trap)
> +FUNC(handle_trap)
>  
>      /* Exceptions from xen */
>  save_to_stack:
> @@ -92,3 +92,4 @@ restore_registers:
>          REG_L   sp, CPU_USER_REGS_SP(sp)
>  
>          sret
> +END(handle_trap)
> --- a/xen/arch/riscv/include/asm/asm.h
> +++ b/xen/arch/riscv/include/asm/asm.h
> @@ -7,6 +7,7 @@
>  #define _ASM_RISCV_ASM_H
>  
>  #ifdef __ASSEMBLY__
> +#include <xen/linkage.h>
>  #define __ASM_STR(x)	x
>  #else
>  #define __ASM_STR(x)	#x
> --- a/xen/arch/riscv/include/asm/config.h
> +++ b/xen/arch/riscv/include/asm/config.h
> @@ -67,12 +67,8 @@
>  
>  /* Linkage for RISCV */
>  #ifdef __ASSEMBLY__
> -#define ALIGN .align 4
> -
> -#define ENTRY(name)                                \
> -  .globl name;                                     \
> -  ALIGN;                                           \
> -  name:
> +#define CODE_ALIGN 16
> +#define CODE_FILL /* empty */
>  #endif
>  
>  #ifdef CONFIG_RISCV_64
> --- a/xen/arch/riscv/riscv64/head.S
> +++ b/xen/arch/riscv/riscv64/head.S
> @@ -8,7 +8,7 @@
>           *   a0 -> hart_id ( bootcpu_id )
>           *   a1 -> dtb_base 
>           */
> -ENTRY(start)
> +FUNC(start)
>          /* Mask all interrupts */
>          csrw    CSR_SIE, zero
>  
> @@ -30,13 +30,14 @@ ENTRY(start)
>          jal     reset_stack
>  
>          tail    start_xen
> +END(start)
>  
>          .section .text, "ax", %progbits
>  
> -ENTRY(reset_stack)
> +FUNC(reset_stack)
>          la      sp, cpu0_boot_stack
>          li      t0, STACK_SIZE
>          add     sp, sp, t0
>  
>          ret
> -
> +END(reset_stack)
> --- a/xen/include/xen/linkage.h
> +++ b/xen/include/xen/linkage.h
> @@ -37,17 +37,28 @@
>  
>  #define END(name) .size name, . - name
>  
> +/*
> + * CODE_FILL in particular may need to expand to nothing (e.g. for RISC-V), in
> + * which case we also need to get rid of the comma in the .balign directive.
> + */
> +#define count_args_exp(args...) count_args(args)
> +#if count_args_exp(CODE_FILL)
> +# define DO_CODE_ALIGN(algn...) LASTARG(CODE_ALIGN, ## algn), CODE_FILL
> +#else
> +# define DO_CODE_ALIGN(algn...) LASTARG(CODE_ALIGN, ## algn)
> +#endif
> +
>  #define FUNC(name, algn...) \
> -        SYM(name, FUNC, GLOBAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL)
> +        SYM(name, FUNC, GLOBAL, DO_CODE_ALIGN(algn))
>  #define LABEL(name, algn...) \
> -        SYM(name, NONE, GLOBAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL)
> +        SYM(name, NONE, GLOBAL, DO_CODE_ALIGN(algn))
>  #define DATA(name, algn...) \
>          SYM(name, DATA, GLOBAL, LASTARG(DATA_ALIGN, ## algn), DATA_FILL)
>  
>  #define FUNC_LOCAL(name, algn...) \
> -        SYM(name, FUNC, LOCAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL)
> +        SYM(name, FUNC, LOCAL, DO_CODE_ALIGN(algn))
>  #define LABEL_LOCAL(name, algn...) \
> -        SYM(name, NONE, LOCAL, LASTARG(CODE_ALIGN, ## algn), CODE_FILL)
> +        SYM(name, NONE, LOCAL, DO_CODE_ALIGN(algn))
>  #define DATA_LOCAL(name, algn...) \
>          SYM(name, DATA, LOCAL, LASTARG(DATA_ALIGN, ## algn), DATA_FILL)
>  
> 
> 



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 09:28:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 09:28:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561137.877491 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qInBl-0005aJ-2W; Mon, 10 Jul 2023 09:28:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561137.877491; Mon, 10 Jul 2023 09:28:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qInBk-0005aC-W4; Mon, 10 Jul 2023 09:28:12 +0000
Received: by outflank-mailman (input) for mailman id 561137;
 Mon, 10 Jul 2023 09:28:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qInBj-0005a6-LM
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 09:28:11 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20623.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::623])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 15b77a5e-1f04-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 11:28:10 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by VI1PR04MB7152.eurprd04.prod.outlook.com (2603:10a6:800:12b::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul
 2023 09:28:04 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 09:28:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 15b77a5e-1f04-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ARLk4+zNhBSyir56a1aQYkT2rSp8qbQhsE9XLQdTMYHKMUwgSEtDdMu/f4K7/IwrR6PSm9J6gzHQpMXew1aefDdlmzrxNkvIhXvS6U6yNg7RKtP+V/8Ii/TmjuHC8ZwwqXC4z/HKLrgrkf5JPw0DKRGABpUunVAgamNO2vZkCDDqInCK3jkd0AzMLxs3o+VDlgVcdtkPW+xzi6wrx/Y933h3SLxMpLjOztsEG2P0NWz7EJTsU+463CzlEqKUGyVpTLwibMUPjYcftSxwdJtNxIiW6cM6NDKmpsQWLNoToKXboT2YI+RYVLyogXiNwoM83B1SLSazq3fV7d98FvjzTw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=qmzfiCX7uDWW8xlqM2WZN/jP3jlHIPnTueprN3WrKiU=;
 b=oFjQ1bJ2+y/euNP2h3xDOzz4USuZXjJfcBaVIXCPoa2U/mzpUL/j9nexwKiR73TDpW2kQYZ3CGUkgGHVFNbHCWWRGH+IcbUvXwi3SQNNKRaFfeUiWlk8aHl4e/KKvovdpya+9lAz9jPV0/DLeje0R+nJodAjWkBKZkHCr45oTM++HGxR9UUPCEO5Cmtmmt5dQAgaUI1e+QdNH67gCLQuzR2vmRmn1gwmmsgZj+SRPfAXUB13Kajnel1PhnHLU4sKDvVp5TvXJdd4FuaP2ZdK7EOoR4ODDgtBe2yM4FJ7jZfp3Y1yJgw/UzY9mFjYzSIoGrn4nUaQzp+XMBWk6FGBcg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=qmzfiCX7uDWW8xlqM2WZN/jP3jlHIPnTueprN3WrKiU=;
 b=mqfAcFn39Fk8t4PUSSz9GBP5UrognNnOnSW+90yRc8mLBJ0xFUycnIeb+LhfwiGsXUejY71gA4pPJt+TrxmqFAn2MS5dYh8p20xqW/3uMGPY8qgjZEr+9TuHrVbN5QIAI6oZzqBopOdwAkKfqPiZFA6pkAxq9HQUrojFLBYiaFvBlJHHLmsiOjIRmWaH/U9qqHFiZlx/YXTE6fJdGMnjh/9f0WqextMgK0gNgDQz8qQiUaJrtsii70fIQjCtMyudyP8bBT5uqoVJgaeXfvm0nSRw6ZReaNJMd+YpGDzOjiZaSMMnYCMwAJCBapkd8T1jzhhut/UBPd5uiAtVRMYeHA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <41e03f85-2916-d220-8d6c-b20c424d409d@suse.com>
Date: Mon, 10 Jul 2023 11:28:03 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 2/8] common: assembly entry point type/size annotations
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 George Dunlap <george.dunlap@citrix.com>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
 <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
 <e685d0d4-72a0-e628-c0af-75849fbdab67@suse.com>
In-Reply-To: <e685d0d4-72a0-e628-c0af-75849fbdab67@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0124.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9d::18) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|VI1PR04MB7152:EE_
X-MS-Office365-Filtering-Correlation-Id: 527aab16-ec49-4b8f-4f90-08db8127f6b6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	+L7zP6gWpvcr80s9GlhS6jhCPBAD1NNIIE0gzRgtg7dTWN1v/JBRIWqEJm/g1+v2BlwMPobw0fE9gmEOVZckQ6QfX85TDUq80g6apge53HxD9oVPtfZfg8dVkDrrJHH8GYzR0wB9hoo26WfOffUMk7Bh4kqOcNlDtA+ysDZEIdOAe9qVnYMPJgkN8Zet0o691y05ds3KtsNM+jLvld2wgHmfgLRq3nyQOnMded0wtJ+RZQlqLd+Y0VJUwlmWx9Fen4UtAVNo51+JtU96s3GZqH4Jh/QpQcCgeC1fu1WvacN5vZc+pSbdo8cVX8/NfRmaBO5xaWBloKdSU73syQOhJ9+D5wixGJwJFcTrGQ6S/eyYzxj/7xq/dYCsiCHUgZcTPlVbqt36o3wcbxSpIIvbIODI9RQX84fRm7pTwuw0nggyb7AjfF6mGfK1OG0Qa1hj8cLnmwApxVd0rK8gUJG//7K+vGG2juilmwM2fZh1LMoMdlq50ChK8THhNobgipeqhzHgmlH65PnUHf14nBzgY8AJ68qvFDGXzZJrlyFNOiuzidNp+6ZrFDnDnaiv5brOtfSpIZH0evG60JRkFR7BrnGwZmTQy3pw2Ud6jgwAaaKB4EHHo9sqY72o77jsaHNPrPSPNFcXFQWfAefVEx+g7w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39850400004)(376002)(366004)(136003)(396003)(346002)(451199021)(31686004)(6486002)(478600001)(54906003)(83380400001)(36756003)(31696002)(86362001)(2616005)(2906002)(4744005)(66946007)(26005)(53546011)(6506007)(186003)(6512007)(38100700002)(8676002)(4326008)(5660300002)(316002)(6916009)(66556008)(66476007)(41300700001)(8936002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-A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2VPODFhMDB2bTRROHF6MVpRL3JJUzhLY3hiZy8vVUJTeWliaEgzRm1n?=
 =?utf-8?B?V1pSN3NuOWhmQnlrZEFLNGNQY0tZelNXT0Q2WlpnVzJ0NWQvU3E1QjVWMzBr?=
 =?utf-8?B?SGFiRjBaQUhkVXNXNVRMaFNFaWVzV2lIcy9qQ3k3bG5UbmY0KzF5dGZpVzNz?=
 =?utf-8?B?NTVoaVQ1Z0d6Ym80YXBKcWcwY0hJVjBIYXh4bklaMmlQTVRmVDJJS2pja3Fq?=
 =?utf-8?B?OFJ2aDI3M3pxcmtNcklraExBVGpPaTBCRHlOVTZyS1hGL1JrU0ZNZ3VVR3pa?=
 =?utf-8?B?UlVLOUFWcmRGa1NKbVZKdGRqS2pBOUJ3UEZGMCtrb08zY1VhQjQ3ejNGQW9V?=
 =?utf-8?B?RVJELzEvc21wMFVQbTFaclAySkxsWjYxZG5EWmNsRE01a3Azakw4ZTR1Lzgw?=
 =?utf-8?Q?SHdfnHf1eS+Q1pWQBbe4mraZy?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 527aab16-ec49-4b8f-4f90-08db8127f6b6
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 09:28:04.7008
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: +7cKK1gVfgjMxUNTs3L7TMGW7PiwujLqeq8RTeOYD23SlVjfr8sW4ahv5s9I0KpYtfy3WyLPkb5VXm1tJABqkw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7152

On 10.07.2023 10:52, Jan Beulich wrote:
> Recent gas versions generate minimalistic Dwarf debug info for items
> annotated as functions and having their sizes specified [1]. Furthermore
> generating live patches wants items properly annotated. "Borrow" Arm's
> END() and (remotely) derive other annotation infrastructure from
> Linux'es, for all architectures to use.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Looking over my action items from Prague I notice that I forgot one
aspect here that was asked for by Andrew: To have the new framework
also respect CONFIG_CC_SPLIT_SECTIONS. I'll work on that next, but
perhaps better as in incremental patch on top.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 09:34:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 09:34:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561141.877501 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qInHu-00072p-OW; Mon, 10 Jul 2023 09:34:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561141.877501; Mon, 10 Jul 2023 09:34:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qInHu-00072i-Kj; Mon, 10 Jul 2023 09:34:34 +0000
Received: by outflank-mailman (input) for mailman id 561141;
 Mon, 10 Jul 2023 09:34:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qInHt-00072c-EQ
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 09:34:33 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20602.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::602])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f9204926-1f04-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 11:34:32 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by VI1PR04MB6943.eurprd04.prod.outlook.com (2603:10a6:803:13a::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul
 2023 09:34:29 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 09:34:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f9204926-1f04-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ixT5vTUQloQ9lGa9w76abYJFGER6vu9+bDz96deebjGHZ17SpV/RgH1j/L1fvofwSj3YDN/9QQMtJFbWrB3equSv3acb5XufQQv8q7c0bavAHmGDchJ0AdF0AqFqLL7KWYO++e95fDAs0iqEsUJ7REeyspkkPpO3QDBfAb3KbmFut8k5VcsTQlbb7zG7Ysi5Rcyqil3sopeOxbhn2fUO7GyKui0sr6+KtwAb6WGS5iG2tOvbz3AXsEywZD1ceW4YRy8VqKDGtLV7uQd3MQRWsmMV3P9+3085vYRl6Pjli7svBuTeIbNqiAuVp1aaDMxzfyRu3DMmU9mKZvuT5uo20Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=xEpEnnv2nY6+zi0bMarC87Ru1A3Qf3tdd5iWCpdpVVk=;
 b=RCS8xA9kZL/BGdhhInDigl4EgHGO5eV111dyxNH3sjXs6Hh8tTcnj3kCmGwA9c26ffpt6TRL7OnC/Rw6IXv8Cr1+cQFTmHgUJmw6q9YyN7MgygGqhpAOexTRv1/qTdqxFKSfp3o3b6n9WQpUdXz8KjD7p70s9SRGs0ngVl++AUEaT8IL1sXKZNZl0hDe3UWLdVu16zHk2+88I7++JeBakVCIstJnP29oGjnGZJTedAVtBnPibsm1EoeJV1kQcOZeOFjwnDpPeVrKCGzVXJ5+MzHLholCDEMho8GKQjIeKLJEr9djku5tcmjormcil7LUnQqNP3uVr15Or9Vh9AdIWg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=xEpEnnv2nY6+zi0bMarC87Ru1A3Qf3tdd5iWCpdpVVk=;
 b=X6B1oL6gRC/o3Zc7dR2SpZa9iKy50fE7I2y5Td1zP6dZlLdGIihIkSKcGHOgujEYVRDi3YkSWn+m4H6kyMKcMHFgZ74FrMoZcWiYVWD+3n09bvu6RNFAAapbrmkggrnsefwUsFIaarZ89Vfd958NOMff+EIrOO5yEKwA4j2FeTUXEmn5UqdCQUmCULP9JuvKver3W571eG1SVf2aN6bRU9IO0AGyZ6+SJdT2aiu4/EWDuOyzjr9KZR8cqFs95LzQyZCMVldy7IegsU+hdwkDQJhTLyEiVTtMQS3yvO5k1LrXXpGWqO8bxjpPChVHUZVtNQZGlz+xtHP/TKkqwJPRRw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <4ee19f92-85d9-2905-eed7-fd806c7abc0e@suse.com>
Date: Mon, 10 Jul 2023 11:34:28 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 4/6] xen/riscv: introduce identity mapping
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1687178053.git.oleksii.kurochko@gmail.com>
 <21d8ce65f718bc10c2213688f79cf5f978bcaf16.1687178053.git.oleksii.kurochko@gmail.com>
 <67df28ad-060e-07d5-acf2-02c3cd5f0b96@suse.com>
 <1edb0c61a8ef64bb47809049252e9ad7b19f4bbe.camel@gmail.com>
 <69699edb-78b2-336c-15f5-2b243257852e@suse.com>
 <9e6fdb4f946b804ae102069825b0f56a3997a4dc.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <9e6fdb4f946b804ae102069825b0f56a3997a4dc.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0058.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:93::9) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|VI1PR04MB6943:EE_
X-MS-Office365-Filtering-Correlation-Id: 95c1e9be-fad3-41ab-5dd2-08db8128dc2f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	oJ9xdeaXC0hYZzmW0CKhGP2CiXuZ1e875VoA2VtYfuC4JQ3MxHsp7D2iFogDA6yrXBfRsFhUr3Wf7CGVOy7QR1nmAJoMrO/j8O151jlEPvR2n6t1UmROMJCPMJvOpTuuibqQoidkvsgljY9HdJjNhqkKGJI4LcJBR35lZqSOVuEVVznoMBzMzCI7NmrTiNdhvV2W1+dQnnqhwbdV7iMskJ2M+Ic+0pyYk4upY3eb2h0B4NWG1EI8rtWKLcGLO5z2UXT14kL9vcQmmeo5AYkN7ak5PcOLuALc9jzZGDp079dO0N23BY1XZH2IJWovWzw+9t7uFb2ZnTH8qNjlx7gAUt7IXr2wExo2oEnqvTEkbJoG615GtytO0m/UiX/KjR3kE7kP8LtOKCefmcKfqV9OKKJc8PyoF3QUJf4yE2sULxVvHf0nW4GhQQ09Ml/UkwA+7ZgiUfCnwbuVqmJE/FJKCnCbMLz0h3DpkyXtxaGBFjj7X7wtxjWHhb9dUU96j1ynqfHz8CKWgqJXVHHw0ZsavsPWXDOywZRESu3oFtDbvkhrUdPJUQT2TC4LDBzBbpN2RocIUU/SAF6MEu0Yrhp3T/T8bkgIt4zKPsKP04yNPSB2DCXJR+JdPt0WIh/sB71r08hHMM61GnEGmFDJEe3V8g==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(396003)(376002)(39850400004)(366004)(136003)(451199021)(38100700002)(86362001)(31696002)(31686004)(36756003)(6486002)(54906003)(53546011)(26005)(186003)(6506007)(6512007)(2616005)(5660300002)(2906002)(66556008)(316002)(478600001)(66946007)(8936002)(66476007)(8676002)(83380400001)(4326008)(6916009)(41300700001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZVBRcHBaVCtiWWxIZGxRekQzTktWY2RIYkExdGI3dEM1aTRJWEhoVFdQanli?=
 =?utf-8?B?cHBHL2R3RXlad3VmUUhDUmVKUEs1VFpTekgwcUo2RjJRcEJTcmNpTlRXanNY?=
 =?utf-8?B?bDF3Qnphdnl3aHg0V1JFS3FpMHYvRUpkWU5KcXZjY2wrZnB3R1ZFdVJmeEdC?=
 =?utf-8?B?K0R6eUVHeEFkVnM0ZjZQbkxpd0NxTTNjT0VWZVBrVytxa3pxbS93UTRBRnVz?=
 =?utf-8?B?a3ltVy9tR1N5ZkRXcVBhNkZzL3ZUQ0RNeW14Z2xPMkpTaE1UaVFzTjNyYW1l?=
 =?utf-8?B?MFNoczhrNnFFWGFMT243dEpIS0tpRWt4eFBRSjh1VjE3Und6MFVZZUFESXJ1?=
 =?utf-8?B?Q3pmYVVyRzJYUE03dWM3Snk0cXZxSkEvQzlaaDhCV1BIVmlSbTNSR0RabzFx?=
 =?utf-8?B?VDZrL3JoS293UGQySXIzTlRBN0R6ZzFJcHNaZFl5dzlEMnNxRGY3a2dJbEhU?=
 =?utf-8?B?WmRiSTFzWXVPU3JVV0IxZE5waWdiY1F0aDlYQkNTZ1RiWkxKbEl0QXZvaFNW?=
 =?utf-8?B?OG55LzYrRVY4T2d6Szh6aHdsdHA5MGpSalVwNkwvdmk4Tnd1TFI4NVk3NFZ4?=
 =?utf-8?B?eXFTUkI1T3lIVTY4VmJvd2NZdHFJVjhpZjl5M1NCVVNLd0RWb2NmSlJMdzZl?=
 =?utf-8?B?V3BLNkdoRDkrVklyc1c1K0cvMktKL1JLZVpaUnk5Uk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OVBQV2tRQ1hMcnA4a1ZqcWpRZEl4U0Y2Y0MvMHJDdHQxbTZFaGFDNGlVcWxq?=
 =?utf-8?B?b2R2aFBlOTlLS2NRaDRGSkg3N1FZREdSQkptNUYrMFJsRTRmUmo1TUM2T0FU?=
 =?utf-8?B?aEFwcGRtb1piVW5pZDk5emtVS3NqMEE1eGZrSXpYTjdyQ2RNSW1Vd3ZmZHoz?=
 =?utf-8?B?c1NtZFp2YTRHZU1ZVjB5Y0hLTVpXR1cwby9RbHdQcEJaNndvY0FOVXNIeERN?=
 =?utf-8?B?K0k5ZFZqVnAxaUpXSUFuTzVjZ2w0RWl6R0hHNXVrTUl1bjBOaUFSQmNLRHh5?=
 =?utf-8?B?VWwvT0FHck5NckQ3a1ZaUjB4ZkFkWGJ5b3pHVEthaUtLaXBvWXEwWDlYN1BU?=
 =?utf-8?B?RXZta2dqdVRwTnA5cnc0ODRjZ05SQ2kzTWJvRVJxRTZOK1ZNeWlvTEoxcXNY?=
 =?utf-8?B?Mm5YVTU0ZE5sVUZDblVuNzllNWZvOGNYN09NMjg0RW5qZUg4VlZIWTl5Tmcx?=
 =?utf-8?B?RmRsbDFvUDF2Sk5CZzJ4SGFXM0Fna3Z4VmlXM3lLRjFWalk2ai9uRjhZR3Ix?=
 =?utf-8?Q?1OiJZO3GAp1s+D+o9eSigwEs2?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 95c1e9be-fad3-41ab-5dd2-08db8128dc2f
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 09:34:29.8075
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: EFD1kWQXSVOJe7KwY2cgfkbr38USjVaKVOzDimc3MjSnekAGAuc967zQAtbdVCKYPfw+0LDBAPOfx788VITymw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6943

On 10.07.2023 10:53, Oleksii wrote:
> On Fri, 2023-07-07 at 12:51 +0200, Jan Beulich wrote:
>> On 07.07.2023 12:37, Oleksii wrote:
>>> On Thu, 2023-07-06 at 13:35 +0200, Jan Beulich wrote:
>>>> On 19.06.2023 15:34, Oleksii Kurochko wrote:
>>>>> --- a/xen/arch/riscv/mm.c
>>>>> +++ b/xen/arch/riscv/mm.c
>>>>> @@ -25,6 +25,12 @@ unsigned long __ro_after_init phys_offset;
>>>>> Â #define LOAD_TO_LINK(addr) ((unsigned long)(addr) -
>>>>> phys_offset)
>>>>> Â #define LINK_TO_LOAD(addr) ((unsigned long)(addr) +
>>>>> phys_offset)
>>>>> Â 
>>>>> +/*
>>>>> + * Should be removed as soon as enough headers will be merged
>>>>> for
>>>>> inclusion of
>>>>> + * <xen/lib.h>.
>>>>> + */
>>>>> +#define ARRAY_SIZE(arr)Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (sizeof(arr) /
>>>>> sizeof((arr)[0]))
>>>>> +
>>>>> Â /*
>>>>> Â  * It is expected that Xen won't be more then 2 MB.
>>>>> Â  * The check in xen.lds.S guarantees that.
>>>>> @@ -35,8 +41,10 @@ unsigned long __ro_after_init phys_offset;
>>>>> Â  *
>>>>> Â  * It might be needed one more page table in case when Xen
>>>>> load
>>>>> address
>>>>> Â  * isn't 2 MB aligned.
>>>>> + *
>>>>> + * (CONFIG_PAGING_LEVELS - 1) page tables are needed for
>>>>> identity
>>>>> mapping.
>>>>> Â  */
>>>>> -#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) + 1)
>>>>> +#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) * 2 +
>>>>> 1)
>>>>
>>>> How come the extra page (see the comment sentence in context)
>>>> isn't
>>>> needed for the identity-mapping case?
>>> It is needed to allocate no more than two 'nonroot' page tables (L0
>>> and
>>> L1 in case of Sv39 ) as page 'root' table ( L2 in case of Sv39 ) is
>>> always re-used.
>>>
>>> The same ( only 'nonroot' page tables might be needed to allocate )
>>> works for any MMU mode.
>>
>> Of course, but if you cross a 2Mb boundary you'll need 2 L0 tables.
> Yes, in the case of crossing a 2Mb boundary, it will require 2 L0
> tables.
> 
> Then, the number of required page tables is needed depending on Xen
> size and load address alignment. Because for each 2Mb, we need a new L0
> table.
> 
> Sure, this is not needed now ( as in xen.lds.S, we have a Xen size
> check ), but if someone increases Xen size binary to 4Mb, then the
> amount of page tables should be updated too.
> Should we take into account that?

Perhaps by way of a BUILD_BUG_ON(), yes. We want to avoid setting up
a (runtime) trap for someone to fall into.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 09:36:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 09:36:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561145.877510 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qInJk-0007co-2x; Mon, 10 Jul 2023 09:36:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561145.877510; Mon, 10 Jul 2023 09:36:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qInJk-0007ch-0L; Mon, 10 Jul 2023 09:36:28 +0000
Received: by outflank-mailman (input) for mailman id 561145;
 Mon, 10 Jul 2023 09:36:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=IIU9=C4=tesarici.cz=petr@srs-se1.protection.inumbo.net>)
 id 1qInJg-0007cV-NA
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 09:36:25 +0000
Received: from bee.tesarici.cz (bee.tesarici.cz [77.93.223.253])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3b4ffbea-1f05-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 11:36:23 +0200 (CEST)
Received: from meshulam.tesarici.cz
 (dynamic-2a00-1028-83b8-1e7a-4427-cc85-6706-c595.ipv6.o2.cz
 [IPv6:2a00:1028:83b8:1e7a:4427:cc85:6706:c595])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (No client certificate requested)
 by bee.tesarici.cz (Postfix) with ESMTPSA id E30F414808A;
 Mon, 10 Jul 2023 11:36:19 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3b4ffbea-1f05-11ee-b239-6b7b168915f2
Authentication-Results: mail.tesarici.cz; dmarc=fail (p=none dis=none) header.from=tesarici.cz
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tesarici.cz; s=mail;
	t=1688981780; bh=cEGhRoXPGRpwdgEcYnOlQCfMzy6z9NfW6eHFlWupbSY=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
	b=XABk4b2xj/95NSII8KdLFD9UXbqReOD/JSMT78/awbRfpUBqfGBkx8UaOP7uLhMBC
	 3ilozKe2ETT4f5Fu81wNHDCN07rfMRv27v/9Xz75qERHzeG33+YIPLfvMTvoepShXB
	 bp2X4b8fPNU/Y7K2HLpKLrrq+yf2U2JAokof6WBFlaoG05B6pU1H78/xgPW15MdaqE
	 BfIGVqnvqysxdQ4LOZdewoT61n6Z6aso0jS/C+m9Ibd4l2WgvIliFFmHeTIN46rnAB
	 VG7cMrMlXNhKuXURvWmxWocykbHhVETgX2QSYY2w6dFYQnLEHCYsWEc7f2hvRbUR7/
	 o2NH4pbmYxXYQ==
Date: Mon, 10 Jul 2023 11:36:18 +0200
From: Petr =?UTF-8?B?VGVzYcWZw61r?= <petr@tesarici.cz>
To: "Michael Kelley (LINUX)" <mikelley@microsoft.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Petr Tesarik
 <petrtesarik@huaweicloud.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Thomas Gleixner
 <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov
 <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "maintainer:X86
 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>, "H. Peter Anvin"
 <hpa@zytor.com>, "Rafael J. Wysocki" <rafael@kernel.org>, Juergen Gross
 <jgross@suse.com>, Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Christoph Hellwig <hch@lst.de>, Marek Szyprowski
 <m.szyprowski@samsung.com>, Robin Murphy <robin.murphy@arm.com>, Andy
 Shevchenko <andriy.shevchenko@linux.intel.com>, Hans de Goede
 <hdegoede@redhat.com>, Jason Gunthorpe <jgg@ziepe.ca>, Kees Cook
 <keescook@chromium.org>, Saravana Kannan <saravanak@google.com>, "moderated
 list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>, "moderated
 list:ARM PORT" <linux-arm-kernel@lists.infradead.org>, open list
 <linux-kernel@vger.kernel.org>, "open list:MIPS"
 <linux-mips@vger.kernel.org>, "open list:XEN SWIOTLB SUBSYSTEM"
 <iommu@lists.linux.dev>, Roberto Sassu <roberto.sassu@huaweicloud.com>,
 Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH v3 4/7] swiotlb: if swiotlb is full, fall back to a
 transient memory pool
Message-ID: <20230710113618.2038e033@meshulam.tesarici.cz>
In-Reply-To: <BYAPR21MB1688D3AC0C094420733717C4D732A@BYAPR21MB1688.namprd21.prod.outlook.com>
References: <cover.1687859323.git.petr.tesarik.ext@huawei.com>
	<34c2a1ba721a7bc496128aac5e20724e4077f1ab.1687859323.git.petr.tesarik.ext@huawei.com>
	<BYAPR21MB1688AAC65852E75764F53099D72CA@BYAPR21MB1688.namprd21.prod.outlook.com>
	<2023070626-boxcar-bubbly-471d@gregkh>
	<BYAPR21MB168802F691D3041C9B2F9F2DD72CA@BYAPR21MB1688.namprd21.prod.outlook.com>
	<2023070706-humbling-starfish-c68f@gregkh>
	<20230707122213.3a7378b5@meshulam.tesarici.cz>
	<BYAPR21MB1688D3AC0C094420733717C4D732A@BYAPR21MB1688.namprd21.prod.outlook.com>
X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Sat, 8 Jul 2023 15:18:32 +0000
"Michael Kelley (LINUX)" <mikelley@microsoft.com> wrote:

> From: Petr Tesa=C5=99=C3=ADk <petr@tesarici.cz> Sent: Friday, July 7, 202=
3 3:22 AM
> >=20
> > On Fri, 7 Jul 2023 10:29:00 +0100
> > Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> >  =20
> > > On Thu, Jul 06, 2023 at 02:22:50PM +0000, Michael Kelley (LINUX) wrot=
e: =20
> > > > From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Sent: Thursda=
y, July 6, =20
> > 2023 1:07 AM =20
> > > > >
> > > > > On Thu, Jul 06, 2023 at 03:50:55AM +0000, Michael Kelley (LINUX) =
wrote: =20
> > > > > > From: Petr Tesarik <petrtesarik@huaweicloud.com> Sent: Tuesday,=
 June 27, 2023 =20
> > > > > 2:54 AM =20
> > > > > > >
> > > > > > > Try to allocate a transient memory pool if no suitable slots =
can be found,
> > > > > > > except when allocating from a restricted pool. The transient =
pool is just
> > > > > > > enough big for this one bounce buffer. It is inserted into a =
per-device
> > > > > > > list of transient memory pools, and it is freed again when th=
e bounce
> > > > > > > buffer is unmapped.
> > > > > > >
> > > > > > > Transient memory pools are kept in an RCU list. A memory barr=
ier is
> > > > > > > required after adding a new entry, because any address within=
 a transient
> > > > > > > buffer must be immediately recognized as belonging to the SWI=
OTLB, even if
> > > > > > > it is passed to another CPU.
> > > > > > >
> > > > > > > Deletion does not require any synchronization beyond RCU orde=
ring
> > > > > > > guarantees. After a buffer is unmapped, its physical addresse=
s may no
> > > > > > > longer be passed to the DMA API, so the memory range of the c=
orresponding
> > > > > > > stale entry in the RCU list never matches. If the memory rang=
e gets
> > > > > > > allocated again, then it happens only after a RCU quiescent s=
tate.
> > > > > > >
> > > > > > > Since bounce buffers can now be allocated from different pool=
s, add a
> > > > > > > parameter to swiotlb_alloc_pool() to let the caller know whic=
h memory pool
> > > > > > > is used. Add swiotlb_find_pool() to find the memory pool corr=
esponding to
> > > > > > > an address. This function is now also used by is_swiotlb_buff=
er(), because
> > > > > > > a simple boundary check is no longer sufficient.
> > > > > > >
> > > > > > > The logic in swiotlb_alloc_tlb() is taken from __dma_direct_a=
lloc_pages(),
> > > > > > > simplified and enhanced to use coherent memory pools if neede=
d.
> > > > > > >
> > > > > > > Note that this is not the most efficient way to provide a bou=
nce buffer,
> > > > > > > but when a DMA buffer can't be mapped, something may (and wil=
l) actually
> > > > > > > break. At that point it is better to make an allocation, even=
 if it may be
> > > > > > > an expensive operation. =20
> > > > > >
> > > > > > I continue to think about swiotlb memory management from the st=
andpoint
> > > > > > of CoCo VMs that may be quite large with high network and stora=
ge loads.
> > > > > > These VMs are often running mission-critical workloads that can=
't tolerate
> > > > > > a bounce buffer allocation failure.  To prevent such failures, =
the swiotlb
> > > > > > memory size must be overly large, which wastes memory. =20
> > > > >
> > > > > If "mission critical workloads" are in a vm that allowes overcomm=
it and
> > > > > no control over other vms in that same system, then you have worse
> > > > > problems, sorry.
> > > > >
> > > > > Just don't do that.
> > > > > =20
> > > >
> > > > No, the cases I'm concerned about don't involve memory overcommit.
> > > >
> > > > CoCo VMs must use swiotlb bounce buffers to do DMA I/O.  Current sw=
iotlb
> > > > code in the Linux guest allocates a configurable, but fixed, amount=
 of guest
> > > > memory at boot time for this purpose.  But it's hard to know how mu=
ch
> > > > swiotlb bounce buffer memory will be needed to handle peak I/O load=
s.
> > > > This patch set does dynamic allocation of swiotlb bounce buffer mem=
ory,
> > > > which can help avoid needing to configure an overly large fixed siz=
e at boot. =20
> > >
> > > But, as you point out, memory allocation can fail at runtime, so how =
can
> > > you "guarantee" that this will work properly anymore if you are going=
 to
> > > make it dynamic? =20
> >=20
> > In general, there is no guarantee, of course, because bounce buffers
> > may be requested from interrupt context. I believe Michael is looking
> > for the SWIOTLB_MAY_SLEEP flag that was introduced in my v2 series, so
> > new pools can be allocated with GFP_KERNEL instead of GFP_NOWAIT if
> > possible, and then there is no need to dip into the coherent pool.
> >=20
> > Well, I have deliberately removed all complexities from my v3 series,
> > but I have more WIP local topic branches in my local repo:
> >=20
> > - allow blocking allocations if possible
> > - allocate a new pool before existing pools are full
> > - free unused memory pools
> >=20
> > I can make a bigger series, or I can send another series as RFC if this
> > is desired. ATM I don't feel confident enough that my v3 series will be
> > accepted without major changes, so I haven't invested time into
> > finalizing the other topic branches.
> >=20
> > @Michael: If you know that my plan is to introduce blocking allocations
> > with a follow-up patch series, is the present approach acceptable?
> >  =20
>=20
> Yes, I think the present approach is acceptable as a first step.  But
> let me elaborate a bit on my thinking.
>=20
> I was originally wondering if it is possible for swiotlb_map() to detect
> whether it is called from a context that allows sleeping, without the use
> of SWIOTLB_MAY_SLEEP.   This would get the benefits without having to
> explicitly update drivers to add the flag.  But maybe that's too risky.

This is a recurring topic and it has been discussed several times in
the mailing lists. If you ask me, the best answer is this one by Andrew
Morton, albeit a bit dated:

https://lore.kernel.org/lkml/20080320201723.b87b3732.akpm@linux-foundation.=
org/

> For
> the CoCo VM scenario that I'm most interested in, being a VM implicitly
> reduces the set of drivers that are being used, and so it's not that hard
> to add the flag in the key drivers that generate most of the bounce
> buffer traffic.

Yes, that's my thinking as well.

> Then I was thinking about a slightly different usage for the flag than wh=
at
> you implemented in v2 of the series.   In the case where swiotlb_map()
> can't allocate slots because of the swiotlb pool being full (or mostly fu=
ll),
> kick the background thread (if it is not already awake) to allocate a
> dynamic pool and grow the total size of the swiotlb.  Then if
> SWIOTLB_MAY_SLEEP is *not* set, allocate a transient pool just as you
> have implemented in this v3 of the series.  But if SWIOTLB_MAY_SLEEP
> *is* set, swiotlb_map() should sleep until the background thread has
> completed the memory allocation and grown the size of the swiotlb.
> After the sleep, retry the slot allocation.  Maybe what I'm describing
> is what you mean by "allow blocking allocations".  :-)

Not really, but I like the idea. After all, the only reason to have
transient pools is when something is needed immediately while the
background allocation is running.

> This approach effectively throttles incoming swiotlb requests when space
> is exhausted, and gives the dynamic sizing mechanism a chance to catch
> up in an efficient fashion.  Limiting transient pools to requests that ca=
n't
> sleep will reduce the likelihood of exhausting the coherent memory
> pools.  And as you mentioned above, kicking the background thread at the
> 90% full mark (or some such heuristic) also helps the dynamic sizing
> mechanism keep up with demand.

FWIW I did some testing, and my systems were not able to survive a
sudden I/O peak without transient pools, no matter how low I set the
threshold for kicking a background. OTOH I always tested with the
smallest possible SWIOTLB (256 KiB * rounded up number of CPUs, e.g. 16
MiB on my VM with 48 CPUs). Other sizes may lead to different results.

As a matter of fact, the size of the initial SWIOTLB memory pool and the
size(s) of additional pool(s) sound like interesting tunable parameters
that I haven't explored in depth yet.

Petr T


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 09:48:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 09:48:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561153.877520 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qInVA-0000rd-8X; Mon, 10 Jul 2023 09:48:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561153.877520; Mon, 10 Jul 2023 09:48:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qInVA-0000rW-5d; Mon, 10 Jul 2023 09:48:16 +0000
Received: by outflank-mailman (input) for mailman id 561153;
 Mon, 10 Jul 2023 09:48:15 +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 <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qInV9-0000rQ-2z
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 09:48:15 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20604.outbound.protection.outlook.com
 [2a01:111:f400:7d00::604])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e28612e0-1f06-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 11:48:13 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS8PR04MB8738.eurprd04.prod.outlook.com (2603:10a6:20b:42b::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 10 Jul
 2023 09:48:10 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 09:48:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e28612e0-1f06-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ECjbLPSn/96FMEL1Q1U06RHz22LMKG8phVWjPNplJrMgEuSjUYlpTc5yKsZLQ9MHmDss6+3mDJAqad4F5mha/acDVfqsoacm4OfpIb4UQHwxoG7DywE9KfJIZG49i1fwuUviqUgREfsFP9JpvQQ96PjKmj7eY30KniLF99IT5yt3/vJZpPysy7SE4sbS/hkVSZAz09jtzu8cUh+Vsmi4XzYRiUud7UnFHxOHEXyadbJak36oQ1TNB/gqcrxeU9K6y/oa51d7zPTqHCEeGR9IEmY5yVSaBSNd/xqIhxqc/bJzAlIMArmH7UsJKYC/96BB2KdeAP/j2D16LzDVX36+kQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=9NiTw2ecYw7wSXcIiRXU2ocxqscz82Bs1Osjze34n8w=;
 b=AWvBLxFhE4KXBaHSXU88r8Q/6nWmECGG9zsDpZHj7iAGWoe5S0vl9hhymSYMp8gIYSCmF8yqtg/v1D189hJqSH/+aU9sINnJR2W5lQFDcQ+jp6PZNjShuJESMvdgkXA8mS0dM/wGJkzZ6N2zlWdej08YWKwk3RwfUqK6GTffDT/WKnVy4AGNpnqtyJSleX93eS6kQE+/tAE+v774mvk6wbCxBfeLaABKw8L/6RGLH30DS2IFfeahq3IqhmZ+lzoE+coObqdjCWSMsOJ/wi0owHwF9dOI+QlTKNy5DmJHMozj7W2F/k9XZoWNiUi1k1WgVEOrDLt2LiDvvyGH/yY/8w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=9NiTw2ecYw7wSXcIiRXU2ocxqscz82Bs1Osjze34n8w=;
 b=4ktaA1WlnTm8sFr22Mj+OJx2Z/aNKdGiNx40r3kBGN65kQJZlKJcfEdxLqjsVQ7733yfrbGRmmjUTXK8KngyXQB96zdTC80yPyJjUkYdtNmJaJUtzoaYJc+iF1fGspnISu0uWVqojJmJmj0sDa0mrdNsbEpZLkgEylfJYWyWcPClbURTuhPNm03313VegL9NvN4xTmJ6isMbUz0Mm2ZMLAeLNlGRr6LakPYkaFGLc5xPcO1rJBdNKwIhwenUnXAJx0ZlRwm98CqRgkDhEECJuYgYPviVdxlbd+SaO0wB+6SDho11dI+iHA9tjITKY8nvuynkSGHh/szsWs9jsg2Ghw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e3034416-0c34-322b-732a-02008be514b3@suse.com>
Date: Mon, 10 Jul 2023 11:48:09 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] xenoprof: default to off
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0250.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:af::20) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS8PR04MB8738:EE_
X-MS-Office365-Filtering-Correlation-Id: 70d19d7c-4e30-4f53-bee7-08db812ac577
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	HFGwfka+49Gdc/O80XWhm7Sxw1UFXX7n9jByQOqPtZpRSENHrSBsC617+yTxlJee0QC+2IhrjiGzGOW08dyE9D/GH0F5UYzES9+2S97fsd4+xuLbQZG/BbL46FI1H8+Zo7LKnbN2FA3ts4Pffp+9gCe5YaFHRqgpKsmR63Zt+TSIkkbxtlkRq1T9p9XTmKSHb8iBClR3pzzLpRlXS0KVIsJsVqkU6rfsOQ9Qw5/qphg6H58Iy5PV1ih+v3+tUKKTq6042hyTtREG6j0Q5UuLAlrDUohS/Bx18LWFZlBc9HWQ9KhlS3VbcZPXaMw58mGjvb3pI77Ry3/cZOET/f2SsBSRx9dE7IhnfFIXY9txOuVGA8kpJxMdSwc07qlmBe/ZJsUmaHJvsV0+D5M2gPeDlOjybtC3DmHeKcNSasFpOojwd5+X+kHum9h1t4DhJON5GH+NRDz5bmwTEptMVlYsKT5qoRhWs3IFWYq00rBRChks8hC/Sg51xiQFGdUt1gT9UN4cEY+ZEmhHMjEa35nsiDI7NpSuVvAwFhpGTL3n/vIxXfLY7jtGuz2JzUSm+3D/EfJB+uCubnYHXi99f4H6rYwJ+vRlfHzbG+4AYApdtGIHsvjKr6EqNei/ZUXAIIdjI/Fv6x57uLygpnZazA7new==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(39860400002)(366004)(396003)(376002)(346002)(451199021)(26005)(6506007)(66476007)(316002)(66556008)(66946007)(4326008)(38100700002)(6916009)(2616005)(6512007)(186003)(478600001)(2906002)(54906003)(31686004)(8936002)(36756003)(5660300002)(31696002)(8676002)(41300700001)(86362001)(6486002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bFphdkJmWXFKMDRtaUFEb2d0aFBJOHhRUSt6K0xiSy9iajBKbisrZDVMY05r?=
 =?utf-8?B?eHcxRGJJWTk4alNOeURXRHBOVWFMZm8xNkdtRFRYdE05WElYby81dmpnMkFp?=
 =?utf-8?B?MXJ2dXIrWUxxQ0hjeUdwVkNFU01LMldvd2ZScmFXNzdtREpZZVhYUjdOSzZD?=
 =?utf-8?B?V2M3Yk1KNzIzSUJ6SHRLSHRoMWpwem96OE53YWhaZHBSN0xkOVFEMzVUMmRZ?=
 =?utf-8?B?RW1VV0NreEJKVjFQZ3Q2amFJcFZnUDJTak1rOFQ3Z1BTYkh0YzYveH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bkN0eFM1aHcwaFJKdUhIY044TFY4cU9L?=
 =?utf-8?B?Mkh0V2dGQXFEcFprb0NrOHA2MFVaaXRMaGRhV2FUdmtlWTI0WlNJUElXcnBS?=
 =?utf-8?Q?2X4u5WLy/AjhhVMEQ7NCPuonp?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 70d19d7c-4e30-4f53-bee7-08db812ac577
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 09:48:10.5517
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: PUst1aGmu8kEqBX9VHcqBxd4cbB3DAEnDKD3WKqv5bPrdikmJ+lzHNJfb8/ayaByEsA4YXoUbSy3Rtxv4UtG4A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8738

This being x86-only right now, and its x86 bits being heavily outdated,
let's no longer enable this by default.

While there also adjust the "help" keyword spelling.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
The adjustment to pvshim_defconfig of course isn't strictly necessary,
but I think the file would better have overrides for things that need a
non-default setting. (Visible in context, BIGMEM would then probably
also want dropping.) Yet if this causes concerns, I can certainly drop
again this part of the change.

--- a/xen/arch/x86/configs/pvshim_defconfig
+++ b/xen/arch/x86/configs/pvshim_defconfig
@@ -13,7 +13,6 @@ CONFIG_EXPERT=y
 # CONFIG_HYPFS is not set
 # CONFIG_BIGMEM is not set
 # CONFIG_KEXEC is not set
-# CONFIG_XENOPROF is not set
 # CONFIG_XSM is not set
 # CONFIG_UNSUPPORTED is not set
 # CONFIG_SCHED_CREDIT is not set
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -229,10 +229,9 @@ config EFI_SET_VIRTUAL_ADDRESS_MAP
       If unsure, say N.
 
 config XENOPROF
-	def_bool y
-	prompt "Xen Oprofile Support" if EXPERT
+	bool "Xen Oprofile Support" if EXPERT
 	depends on X86
-	---help---
+	help
 	  Xen OProfile (Xenoprof) is a system-wide profiler for Xen virtual
 	  machine environments, capable of profiling the Xen virtual machine
 	  monitor, multiple Linux guest operating systems, and applications


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 10:09:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 10:09:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561166.877535 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qInpU-0003Sz-0G; Mon, 10 Jul 2023 10:09:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561166.877535; Mon, 10 Jul 2023 10:09:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qInpT-0003Ss-TM; Mon, 10 Jul 2023 10:09:15 +0000
Received: by outflank-mailman (input) for mailman id 561166;
 Mon, 10 Jul 2023 10:09:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qInpS-0003Sm-DN
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 10:09:14 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2050.outbound.protection.outlook.com [40.107.7.50])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d1a11f2e-1f09-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 12:09:13 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM7PR04MB6872.eurprd04.prod.outlook.com (2603:10a6:20b:106::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul
 2023 10:08:43 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 10:08:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d1a11f2e-1f09-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=SDghcSdhjCp5ZGDqf+7cwlSNmYaV3D7imRYKeoNS2WWKEtIp+6ItRuCn5ni4d2H40pI2k8cn6yEwigq/CcpEyJQFGM/yAcuLM5NG4dOrnDFLBDEuGl3q/P8pw8G5d2n6fnXlZOkv6xY/95YnkhWa8YzwLJegjySpy78u0CyIKu22BaYrrTFkHpcdvlEHyl5gsquXB36wtGYoBnhmNLtWB+9PDh7tpN9wuSGs3oEqmF1IRbQCcsyj04QiQBqadt/JZu/D3cQad906G601k0fUV/Px6zAZvRaFAeqaajH17eHqxXxKJclp5fzq33SkRq5sPu7N/JFqAWyj+9ChEE/4cw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LB3pa+0hjhdpuk0rRtwyUkBWJUSgGFGf7Ox7cm0ARUE=;
 b=huQao8OM0EFYa0OhgwrRkz+f8T4mkKk400nLtoRZjlQ+GavyY4mGYdv9CQ/kKJMfB0iaFVQ8YF6fpKR8tq+bKIA4A5R5QHz3I6E6kBPxce3JpXvXRF5ocdU5G0GhAJwFX9CAjUE7c1ogSIUkdS9GzQNZoM0mK+2NrHRDVXy6e34F/diEaBfg5FTgZN2XWlUgD08i1/jnj8B6Y78X+bY/oVMIZZqeoU5/uOonmFzDZ4z8z9jONyWEhgIGmkTdFdheyYw+lSiueClAgCZJc92qeh4wJMoMYnylrcF6XDmBBKVv+q92WryRUaPKkAcsg00PoPdFxC1hW2UwcCAxT44W3Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LB3pa+0hjhdpuk0rRtwyUkBWJUSgGFGf7Ox7cm0ARUE=;
 b=xQ/EtMuck08NrWcd1IrJl6mqIQ71dMahby55QWbTuXSNo7US3JLxvJas1HLfsLNCdHIWqI2E6Qppg1SsgDtHkQQziCtD12f93kVW3jY4qOvuYXgbQRgyQS7ueC+kcyDaXee3pBkhjWJ3M759CAebnnmRF6RsytAA7s/D8qUYy4VkDNEwNBNnDOjtE9RBSH9sFX6TDJ6jIeWHiikUgsuqx6585sdOmicMM4ie4KEs/zab4l9VOLfpsx6HbUetqQ6PnwVKH+wzUN0QcPekGIxWn7xCl/7Hwqhlbxm3tdXfb2dAbMyYtq747AJhcbH7HeIMmPFR0WDlDclume4ydgcUdQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <6717701f-76c3-94f6-241b-743b4828ad6e@suse.com>
Date: Mon, 10 Jul 2023 12:08:40 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v1] xen/drivers: ns16550: Fix the return logic for
 pci_uart_config()
Content-Language: en-US
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: sstabellini@kernel.org, stefano.stabellini@amd.com,
 andrew.cooper3@citrix.com, george.dunlap@citrix.com, julien@xen.org,
 wl@xen.org, xen-devel@lists.xenproject.org
References: <20230707113518.141489-1-ayan.kumar.halder@amd.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230707113518.141489-1-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0103.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9c::13) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM7PR04MB6872:EE_
X-MS-Office365-Filtering-Correlation-Id: a41b07d0-f6d8-4bd1-a123-08db812da425
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	dvsFp6d3/VDZ0MMXNyhXIGmmNWtuRx2furbf0EQlYnIUEnmZw1vENxOM89TlXipt5b7sNcfDeG9vj7SHrqTQq+9hzSB8VIdcaLzGq5SAkeKE5mmuald9rJqpazQXfreoLk67WMSPW++ppmSnWTCzep4gGeKx3Al9TkQLVdli/AArW9xmN+AoL9ru6hwYuJbQ3u1AS+P4PNo4ePvjJlLwEdtu5eEd0LbavRoqa0J776FRqyxZwb0q+DxGbnviQZPebrfcuUDDojLM3X52EUSFMZwAbyhsZRN8xweG7PO9Axq9zBqHIAQAMv1l11Jvn09c2ClhlCsUhdusOt0WVm7wFt8W33PiJ2OIvZ+vM56TuwLR9pzFHbQ17dbu5kBepHq6gxpqf7Ui3vghFKxBUwUQe3LYTxfgFakDTKKLl5GxALfV8O/1ZBrIdhJq4lkxC0tw/vyY7ZSFYgnwOU8T3d5AIkHByWBnHm8HmOVs7HEcTSKSoFvpvt6J7+clMq04cq/46ACLFE2x4OCS4OrhDc+d76PnHRCQmPIA2E+HvULGj7eJdKZ0CiQJ6KqPDKpq2khkHkqy9PpFny5XjcJ7NIsHX5LZbVDArLq9EGX9IvoD+rCQTqJ5zkFNB9adw0pw7EQwE7tJg7z3ou/nlvE5KQBOdQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(366004)(396003)(376002)(39850400004)(136003)(451199021)(86362001)(31696002)(38100700002)(31686004)(36756003)(6486002)(53546011)(26005)(6506007)(186003)(6512007)(2616005)(5660300002)(2906002)(66556008)(316002)(478600001)(66946007)(8936002)(66476007)(8676002)(4326008)(6916009)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZUNPM2c2SDRHeEtCaHdCZW1vNlVLR2JMQnN0ODVJelA4blc5V0p6TFduc0cy?=
 =?utf-8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kTVRVMS9ialVHbERB?=
 =?utf-8?B?amlML09YMzB2VDZWM1JleUUvSzNPNHQ0aFp4SnZhMTNzbmpmL0p2ckgvY2RU?=
 =?utf-8?B?VmRLSmdiV0xYcHBYOEJ0ZU1sallxU2hjdVhyaWhPUzNMcE1TQjZIVjJCb0t1?=
 =?utf-8?B?TUk1dnArRVE1eWtsM2wxU3kxVFZVd0hiWjlxeEFLVFA0bVNZcVpEek9Da2pa?=
 =?utf-8?B?ZHkwL0htZHpvYmxTbzErT1pSU2w3SnFaakluc2NCWlZJM0MzNEhoS29xSnlW?=
 =?utf-8?B?WExEMGI4enRFV2wvTHdyVmo0M2RLdzRmZUpBOVYzUHZQWnR3bFZHcUxFOHVv?=
 =?utf-8?Q?UsY/yuEw/pFUt2q5ZBuur4enJ?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a41b07d0-f6d8-4bd1-a123-08db812da425
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 10:08:43.1271
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: HmiuXUeui0OPlcLMBfcQOwHqeQ7l3a7KBLF0ZvobellQ6lD2tZYx0aEVq0lT3CdpWqBMTQulelS3pHdo+3RQ6Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6872

On 07.07.2023 13:35, Ayan Kumar Halder wrote:
> --- a/xen/drivers/char/ns16550.c
> +++ b/xen/drivers/char/ns16550.c
> @@ -1342,13 +1342,9 @@ pci_uart_config(struct ns16550 *uart, bool_t skip_amt, unsigned int idx)
>          }
>      }
>  
> -    if ( !skip_amt )
> -        return -1;

This special case probably needs retaining in the new model (with an
altered return value), such that ...

> -    /* No AMT found, fallback to the defaults. */
>      uart->io_base = orig_base;
>  
> -    return 0;
> +    return -ENODEV;
>  }
>  
>  static void enable_exar_enhanced_bits(const struct ns16550 *uart)
> @@ -1527,13 +1523,13 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
>  #ifdef CONFIG_HAS_PCI
>          if ( strncmp(conf, "pci", 3) == 0 )
>          {
> -            if ( pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com) )
> +            if ( !pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com) )
>                  return true;
>              conf += 3;
>          }
>          else if ( strncmp(conf, "amt", 3) == 0 )
>          {
> -            if ( pci_uart_config(uart, 0, uart - ns16550_com) )
> +            if ( !pci_uart_config(uart, 0, uart - ns16550_com) )
>                  return true;
>              conf += 3;
>          }

... e.g. here you don't suddenly change behavior in unintended ways.
Prior to your change the earlier of the return paths was impossible
to be taken. That's likely wrong, but you now returning in the success
case can't be correct either: Further items may need parsing, first
and foremost the IRQ to use.

Jan

> @@ -1642,13 +1638,17 @@ static bool __init parse_namevalue_pairs(char *str, struct ns16550 *uart)
>          case device:
>              if ( strncmp(param_value, "pci", 3) == 0 )
>              {
> -                pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com);
> -                dev_set = true;
> +                if ( !pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com) )
> +                    dev_set = true;
> +                else
> +                    return false;
>              }
>              else if ( strncmp(param_value, "amt", 3) == 0 )
>              {
> -                pci_uart_config(uart, 0, uart - ns16550_com);
> -                dev_set = true;
> +                if ( !pci_uart_config(uart, 0, uart - ns16550_com) )
> +                    dev_set = true;
> +                else
> +                    return false;
>              }
>              break;
>  



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 10:10:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 10:10:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561170.877545 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qInqX-0004ow-9d; Mon, 10 Jul 2023 10:10:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561170.877545; Mon, 10 Jul 2023 10:10:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qInqX-0004op-71; Mon, 10 Jul 2023 10:10:21 +0000
Received: by outflank-mailman (input) for mailman id 561170;
 Mon, 10 Jul 2023 10:10:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qInqW-0003v7-5a
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 10:10:20 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on20622.outbound.protection.outlook.com
 [2a01:111:f400:fe12::622])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f9330990-1f09-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 12:10:19 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS4PR04MB9575.eurprd04.prod.outlook.com (2603:10a6:20b:4fd::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul
 2023 10:10:17 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 10:10:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f9330990-1f09-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=YktbkkMuyqsPIbRdW5nCdERkP8+jf2bP2/gPvQ5FZAd1cND1dDeZ0zeMNGBGJ7GANfSkuymu+XfCx+3kE9HhITgtmS9bcazN9lE+QTzexIkobruS+I6whiz4Lvz2DnAHlBTiSHpLOQt8HWIOmBYQHE3Q2edIplAuN5eJWSpirywbBezM2LdJwXEB3bZRuoSop16vgUv5XlmbmkWSw5o99r7Hl386oddrQxn41YUvbBDLmdPv+ZonLJIoMAUXJaKqEyuMmasN5odYJZZSpvRwII87akl5qHF2b8UaS8AHHEwiGKd8ELxy6+rblsfGGuwQS1b4p+HY/h7FrAagtrtl9Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=qYSTzTrbpZqImYfCCDAkUt1tf5uvXuFJAcsU0uWsR5E=;
 b=b+8nebXFtag4VRKfk9qA8ZFW+wxb3BNqcX2bWI4o7SELQr+fAGIcPrenYTHvFmUGSll616sxUS1drLNI2WDvuWucZoQNygWGS7OxARUOmdBa4lQvJp6ysQCsYRnA7BpFzqUpC+GXo3i1dAbmX2BAe9Nv3WNsq7wFzO5vb6ny7eGXKfcGCfZQHw8eN1BSlJtqtF1FRwjzrZ3lgyzzjY28n1nI9ekiuLvlVzvPc64t5SUXiShsaS5uaRM04gUGY80Mq3q3Qw9fS5Jzcic6tftRUTrOcfg/bsSxbVPwUKP71Cir+RGdaKtcATk8rWXDJg3U8bUoLs177/2r5Qgc5OKNeQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=qYSTzTrbpZqImYfCCDAkUt1tf5uvXuFJAcsU0uWsR5E=;
 b=iwfz+cWZ1iqw3QDsaXk/1DcZBjD7S14XEPVpq5vd0bzxkzDpTt9y8dZUpqQotW1bC8xjyOEI3LWkyT/11cyuMRUCsT64wvEPlcZmNi2e+QabyEsWrIE88wY3EqHASMJ4GsgypI/RmWrFq0d5KOoGPhua2gohfQVWt80L+WoG/7tdF3TzhMd5+oEHhFZNqmICgEjNknhHkhMxGdUrDBTmPQnCYtcxFoTue8N7Um2UGFJrkW9DkSdSRFk+MPRUYI5bZ9AVLiVg2HF2sSFLmOcjGrDjseMD4x/xx4uSpqBOq+/oZvbKJhE8w4Lm1BHLuuDT1Igl/pUqnBSQKgnJbKyaGQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <8457afbf-8161-32fe-27b3-c46c0302b22e@suse.com>
Date: Mon, 10 Jul 2023 12:10:15 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] iommu/amd-vi: avoid pointless flushes in
 invalidate_all_domain_pages()
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <20230707135915.47359-1-roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230707135915.47359-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0015.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a::25) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS4PR04MB9575:EE_
X-MS-Office365-Filtering-Correlation-Id: 3a81f955-cbaf-4bff-5603-08db812ddc1e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	yyNPUlY+8H3fZLd4RuKaM7OF/Ib0el154VtvRKjDor+Pfsp9yw7QXpCUhi++JqYuvbdjHPA8FeBtrVQakE+q3wQBe/y0pon5uPd4xSb9GptgDSWOaMsKP3Ao6c9nx8HERSdM7c+QPQmO8opMXs/wE6zjYDvAveTBlo2RRmQDSNQNgyz74aklSeSVCbZbh3AWj7Ph7/cmRDNcIrhVOa9IaFmWcjkTlerP4+w3/ihRuufWzZTGjRB/3XNFPZsUERCXS7mOwokvCO0BQN1u85XcJyKKFsolUJZ4Gxi7LLKTqgn1NkmWOYm7RWtOKqQapgJgO4/RELMGbH1CWsf5lYtXEZh+xFTVEyx82xvFOeEdU6oXO8CYiI+dWpSxIRgRMhz+B7FLN5jcjqz2xqwdoSNLNY3MFwrRSJbMVqEX38u8UwB81RwpMRdGJ5WEHpKvgAcNeNKwK/VP5I4cxcodauxMZ4HOftm5v4jgPwSEvQ8cTqTUQ5Hjq8Qkzr4vRuEX4VH7Ztegz/pHFWrQESHku9NpxiuCJbz1f4WG7fGjBBoLjNgH+Q8niu25z9blipaToJuvpJW3iZDLtRwqIH2bVwZqNxat24krG7rg4N0fA8eE+BTC36Kc4akvdd/3uzJNWKqkVJk2Pd2N4CJbzzH5EtBchw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(39860400002)(136003)(396003)(346002)(451199021)(31686004)(6486002)(478600001)(83380400001)(36756003)(31696002)(86362001)(558084003)(2616005)(2906002)(66946007)(26005)(53546011)(6506007)(186003)(6512007)(38100700002)(8676002)(4326008)(5660300002)(316002)(6916009)(66556008)(66476007)(41300700001)(8936002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Vm9ONHUrRC9tcG4xN3MzVTVzM3EwSCtxbGc5ZEw1TE9YUStzeW5sdml5aDhD?=
 =?utf-8?B?YnQxK2UwdFlERGFzeVZPTm1QTVVmMnNDdkZMUmovejhYd0J0ZEVyN2ZmckFq?=
 =?utf-8?B?emxGU3hHRnFHaXRrK1FKZmFsVXBXbGszaXJ3WldGZ1YwK29pU2NKbGxHWWpT?=
 =?utf-8?B?UWdiSWloK3ZNZkJyNzJCK2VxSllMaTRDVFRNRFdrY0oybkRCQlZEL0lENkt1?=
 =?utf-8?B?Z29LdldseGZlemQxbS9vUzB3azc4ODllek9HSktLdlpUMXRQdTF5ODZwZjhJ?=
 =?utf-8?B?Mm5CMUtuV2UvV2VzclNvNzl1a3B4anQ3eHZqQTR3RGpWdlpiaWFlVml4SUwz?=
 =?utf-8?B?OCtnbDBHM0ZDdHR5eGkwWGtBb3RqYTVZWVhVS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5pI0DzJM6E9l0MrpE9Mk?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3a81f955-cbaf-4bff-5603-08db812ddc1e
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 10:10:17.0502
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: zQ2Rlg0NqZFFVy3KsBjZenT9H+ZbANFyz65Z6M5vRFN2xVNE6pL4kOUwNrYRX1f2u+lQABprACNC1VY5mKm0Hg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9575

On 07.07.2023 15:59, Roger Pau Monne wrote:
> Fix invalidate_all_domain_pages() to only attempt to flush the domains
> that have IOMMU enabled, otherwise the flush is pointless.
> 
> Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 10:56:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 10:56:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561177.877554 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIoZG-000105-Pl; Mon, 10 Jul 2023 10:56:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561177.877554; Mon, 10 Jul 2023 10:56:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIoZG-0000zy-Mv; Mon, 10 Jul 2023 10:56:34 +0000
Received: by outflank-mailman (input) for mailman id 561177;
 Mon, 10 Jul 2023 10:56:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qIoZF-0000zs-BT
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 10:56:33 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on2062c.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::62c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6d81f9b0-1f10-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 12:56:31 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PAWPR04MB9862.eurprd04.prod.outlook.com (2603:10a6:102:391::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul
 2023 10:56:29 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 10:56:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6d81f9b0-1f10-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=QTdWwhYKxUi7Kt2PSn9XSuulNe8g+yRwlnJIRK/CsKdNs0b+wLzS514TH2u7zYfZbNYthdND1j6Gkc3lyezka2af+2f7YlFm/Hx5Tv99IhV5HMs8Y558yHmbB8gO45SoeRKFGzoHaXpgd28EVLYHyewiCH9lR9yjgISJiZzRed5eokF4Qc8Nqzqx2n3ntsFYyBv/1u6O8SMosG5pFQGLYzyTxGv7TFbqA+WiRbxZcaKEMEJFC4g1J/zNlnc9YLCt6XC4yVg/ztegrPT1wuuqDcD1RKAdm0Wt4hoLUUkddfCLH7mZHFEBBGtCySND3Wd+ndbTJNCSXu3cLsvdYtjJhg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=mQvb+1kLVWdEgkiCAJ3I7xIPXIljQ4Ub1kVaTTH+OFA=;
 b=ZP4YLxdWQ3qwBn8/C04OpSVSeNRaS1PIPNehOyq7ByVcGaslGkqgmUzjKRIkVWMlfaIUh1rQC2DrELSF/2PcoVXpxAeEkuBYB/LOLLEZokbMGAwCBI9hT2ncCpnh5qxCk+RKMVBPEv33XhAtTMSfGOZdBa+Ibv7MSvS4oZQwtbdmZAwIJv/93L58rayZ+bRIsh1GMxdE3VkpyIaXmshNcrm2zaTFOGX69Di9zJ90rVqY9JU9ZTFyqATwB5Q60iRKWbKMLiPhrI6LoOcW+rva3DYAmMJp6Jy1Y8oecCmnhMrmJRRukYfPtvX0oSWnCeN9t06r3yXMVKgUvoRtD7RhDg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=mQvb+1kLVWdEgkiCAJ3I7xIPXIljQ4Ub1kVaTTH+OFA=;
 b=Np7W4cdg41H0JjKylhNqx+XpPJh5JWvLtROspEpWB52HJfTcw4BfEZ3o+RJ1etsMYhTQSIPnz+jMAekvPILuG+joVxh+MyjCjxBZLTrXWRK26WxN5OGQvADHGQWoNmHWtGbLC+sQA5iPt/QEzYIOJRIrQQfJj4wnn788cv4lPmGoR4K1VhOKac/MNG0FuOMvdlS6VCAlOP+T/KlDRyaq/vma8UcPki+a/OTHOqFuHF/67raHXLXH9LnF2VCA6uHuMM0vfek771PnjcXKgqI4cRJqe6t6BuL7/NoBBAOrWZPgheJ5OtTmdUMlWVckvCiVN6/udZ3jqu2cFqoSxyBPlQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <92d16012-ff9f-693b-07c6-d45fe07a00a0@suse.com>
Date: Mon, 10 Jul 2023 12:56:27 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] x86/ioapic: sanitize IO-APIC pins before enabling the
 local APIC
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230707095338.44244-1-roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230707095338.44244-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0222.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ac::18) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAWPR04MB9862:EE_
X-MS-Office365-Filtering-Correlation-Id: 562f8d13-4a25-4a23-8053-08db8134501a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	px4w/gLpu33SQW1oq4Qs04BVaKx+FnhzkFF6lcY/6WpQhLdgTGeoGzibHSKN2chnbqLPymti7sD9sLSRWalLvNdwgofzsJmOerYHgXeR73DixbLtj8oqcXIph27TweIAfKXBvf0E20lAKJ/CMdfwOsfpxXBmjxQNAlQao4xBpxZn/1r9AKSC7RGF3mpxqC4ehAl6WYpjx5jBMUm8Vqyc5b23I1bkhBigumWIMESiO3wkgqwAoqgOcUBhnCxyBqlHXOQfddWM1/MkYyWfuFbeKOf7wQOXfxqtV5thN8ErjJJyTLmub79QZWGQvgfctS/EpUejAtiT7MUhJTL0vPhnLLfB7oXxbltHlgHhMV3tWwmijOILFzHTsBqszXaXboe77S+vJOdGPydGZlrkbbLIRv0cvlQQCcq9tgEc2uJ1Od+Ti9Mcb8Xg0DPsiFTBHqbzN2lmjEcDdA8k8vnX995P6MbuNEFe2plGbdHAU26gBq/+eQ9cf82/oWOijA6zJ7M1zXXTZeu3DIbcTGc7CpC0rYjgkp381OmrikqZSYF3snLiM59cS1d5QUiXHoE78pXgHaqLHRcBVIKwOZdru+DCh6XTcxVBxw5Gnuu4HKH0I0veuxjZfM7nB/ujVGx8do5TnK2DbdfwdKuzUEk7Bhv1yA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(396003)(136003)(39860400002)(366004)(376002)(451199021)(6486002)(478600001)(54906003)(6506007)(26005)(53546011)(186003)(6512007)(66946007)(2906002)(66476007)(41300700001)(6916009)(4326008)(316002)(5660300002)(66556008)(8936002)(8676002)(38100700002)(2616005)(86362001)(31696002)(36756003)(83380400001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bi9SQVVSbmRLNWJBWmMzYzRPZFJ0dTRVRXJqSWlCRk93dlQwcjkva2UyZ0V1?=
 =?utf-8?B?bjRrcGtiT1FpTUlrU3BXZ0lzeXlVTTM5S3J5VnpWKzZnaVdGZWphU09ZT2wr?=
 =?utf-8?B?eXczeFNxNFY3KzRDSTdtSDkwcDJwamZQM2lBYlJrOGpxM2tWamZqM1R0cXpT?=
 =?utf-8?B?OGREbytLZ3d2anM5T0ZqQ0tseWVYNkdGSC9teEFUU05KQzJ2bVNETmt2K0ZB?=
 =?utf-8?B?T08vZ25CTVFGWFVvcGU4cnYrWWJnOXp4NXVmN2RmU0poaGlISE0yeTRyb0s0?=
 =?utf-8?B?NXFJcWF3RlRPdzhUcnMzZ0lRcXNFcmE1SllZVFdnejFsMFkrMHdyMW1NZ0JZ?=
 =?utf-8?B?S0loVU5mZ2ZhanowK0ZadmI3cXdzTko4cno3bmlmc0FYekhNU0o5QXFYbTNR?=
 =?utf-8?B?U2xtY2gzdi9SZDBlMkR0SFRxM0RwSlRmMWg1amJ3NnJyVS9xQXZEODd0cE9Y?=
 =?utf-8?B?WEM3c1VGRnZFbE00cWNYUjd1ZktrWGQ1azVQTVJVQUNNRzlid3hGN0RCUEpm?=
 =?utf-8?B?R3lOQ2s2UWk5R0hDazRPb1AvcXBxcjRGVlBUNXo1cVAxOFdwR3R4M2g0Z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ZlYzaWhEeDRsNU5kWHA4SUZvWVpuc1VrZ2QrNHF3cWJlTkdDajlMWjlFZG1B?=
 =?utf-8?B?dkNxN1B2OFI5T3NrekxMQ3pPbTRmZm1kTE5FRnJaV2ZZbFZ6ZGdqQXZvMkZF?=
 =?utf-8?B?RTN3U3o3NVFUREZXcWw3QWwzQVhMbWlZaXAwOTFsWHl6bFl6TWZxeVJpZmxZ?=
 =?utf-8?B?Qk8vcGRiMWM4ZDFTSUg0RGdJTUxZa1FacEhtWXFiQUhBeVhTVFJ2YitpOTZw?=
 =?utf-8?B?dHlCcU1OZ0xSbFA3ZkJRRWQ0ZlQzL3pxdTJYcDlYWVZnMVRUcHJxcFN6TU11?=
 =?utf-8?B?R0RHWHlxcGMyRVBiOWFtZ0xWL0poWG1uYVJ0UEd3YWFHSCtRZ1g5NXgxUC9o?=
 =?utf-8?B?WitmRHZoaDlBTVN0am82UzIxQ1BOakJLbm9nV3M3SWhnTGpkMXVhSU9EOTl6?=
 =?utf-8?B?T1lCSTFJTENETGZoNTR6M3lSeTJPcmRXOHJzK1BqVXJld1R0ZnNiOCtSZ0tw?=
 =?utf-8?B?UGt2SmZ2aTBpYjg5NUN3Z3prTjBNTmhRd28yR0FFT09qcVh0Nm1maGtpa0M3?=
 =?utf-8?B?dkNLbCtseG9UUFoxV3NyREZjZjhFd2NubUNtelRqYjVtbk5IUWR3MTJUS2NC?=
 =?utf-8?B?WkRxM2UvNWx2SkF4TUZBZVFycDRHbXduaFpLMjZucW4yWjYreEk3NHg0RGd4?=
 =?utf-8?Q?SEIlPKAZmr5MUeGM0x6xKNyW1?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 562f8d13-4a25-4a23-8053-08db8134501a
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 10:56:28.6526
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: BfqD06iCljxoN/gR60etM/ihj+zppE9ayit5khO+Xr+I34ELvTvcGYKDdt4TlwnPCPSi2yqYqueNHqXlkg7pyg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9862

On 07.07.2023 11:53, Roger Pau Monne wrote:
> The current logic to init the local APIC and the IO-APIC does init the
> former first before doing any kind of sanitation on the IO-APIC pin
> configuration.  It's already noted on enable_IO_APIC() that Xen
> shouldn't trust the IO-APIC being empty at bootup.
> 
> At XenServer we have a system where the IO-APIC 0 is handed to Xen
> with pin 0 unmasked, set to Fixed delivery mode, edge triggered and
> with a vector of 0 (all fields of the RTE are zeroed).  Once the local
> APIC is enabled periodic injections from such pin cause a storm of
> errors:
> 
> APIC error on CPU0: 00(40), Received illegal vector
> APIC error on CPU0: 40(40), Received illegal vector
> APIC error on CPU0: 40(40), Received illegal vector
> APIC error on CPU0: 40(40), Received illegal vector
> APIC error on CPU0: 40(40), Received illegal vector
> APIC error on CPU0: 40(40), Received illegal vector
> 
> That prevents Xen from booting.

And I expect no RTE is in ExtInt mode, so one might conclude that
firmware meant to set up RTE 0 that way. Mainly as a remark, albeit
of course there's then the question whether to change the RTE
rather than masking it. What do ACPI tables say?

> Fix this by moving the masking of IO-APIC pins ahead of the enabling
> of the local APIC.  Note that before doing such masking Xen attempts
> to detect the pin where the legacy i8259 is connected, and that logic
> relies on the pin being unmasked, hence the logic is also moved ahead
> of enabling the local APIC.

A comma after "masking" might help readers here.

> --- a/xen/arch/x86/apic.c
> +++ b/xen/arch/x86/apic.c
> @@ -1476,6 +1476,10 @@ int __init APIC_init_uniprocessor (void)
>          return -1;
>      }
>  
> +    if ( smp_found_config && !skip_ioapic_setup && nr_ioapics )
> +        /* Sanitize the IO-APIC pins before enabling the local APIC. */
> +        sanitize_IO_APIC();

I'm a little puzzled by the smp_found_config part of the check here,
but not in smp_prepare_cpus(). What's the reason for (a) the check
and (b) the difference? Isn't checking nr_ioapics sufficient in this
regard? (b) probably could be addressed by moving the code to the
beginning of verify_local_APIC(), immediately ahead of which you
insert both call sites. (At which point the function may want naming
verify_IO_APIC() for consistency, but that's surely minor.)

As to also checking skip_ioapic_setup - wouldn't the unmasked pin be
similarly troublesome in that case? Aiui it would not hurt only if
the LAPIC also isn't (going to be) set up. Then again the flag,
among other things, signals a zero base address found in the ACPI or
MP tables, so I guess this is a (largely) separate issue anyway.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 11:42:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 11:42:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561181.877565 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIpHI-0006F1-2C; Mon, 10 Jul 2023 11:42:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561181.877565; Mon, 10 Jul 2023 11:42:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIpHH-0006Eu-V4; Mon, 10 Jul 2023 11:42:03 +0000
Received: by outflank-mailman (input) for mailman id 561181;
 Mon, 10 Jul 2023 11:42:02 +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 <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qIpHG-0006Eo-LI
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 11:42:02 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20627.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::627])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c7f1bd96-1f16-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 13:42:00 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM8PR04MB7954.eurprd04.prod.outlook.com (2603:10a6:20b:237::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Mon, 10 Jul
 2023 11:41:56 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 11:41:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c7f1bd96-1f16-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Jydgb0r15t4QzF3JFKXNqvmrH49YzT5HgkH25qmObzJIoDiY+e1f+6jDla6XdJ1TH17MXlNK48eytBGAfmDTs1sSzu6LUEnJYTSHrAu0BZx/mrdMD8tvO3JMIOgVCRkRd6HICkQHVx1vchULQmHCsTXUywpxhVVtG/2MlDqnf6nR7CFv3UQZrKM/NQdGpFt2rpxW+go7X1JuWGrsNh3aDuoNH0pJ9+h+v5ej251vgbIJ2vrE2BHrGi0c9UoG7xxCK23rUmhaCBCQ44a0e0yu2xx6XLuVA4oFbXNXtg9GweN3MrGaG0lEstD9qgubUdt/wsDNGKzeCV/nC3DKRcwdzg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=J4ChUr3+yTXCGAely9Zb2mn+pPQKiUfYt0OutNbQLEk=;
 b=NESaHzVriVU+U1PRHLUQoIC7ymLYKRN9YpzCPu4pZ4kWzK3qGsvyyeXLvMSjptuOg7XpH6/UDKC+ykPazWuzw6c8EbusANntVzulo+V7smW0MzoWisce4Eisb0/m2NM3Wp2TWAeDhevkIKt/fm/ltobX2hBMGS7ky7J9zNIwT9+yF0tlJ6m2m0c/+xJKtigW5kDHkGWcs9wFn/qbecSbHexlnVf9Wl43uQ+EcwHXOR9E4vBZ38fedEbi7D4Ke3iksdXzDGtrzNhdAE9iw7Yy1ggyLSjxs53trOaLFc+36rVjeEr2Yd9jQ6rmf+OxKnoAa4VDi7+WOIr//V0VnhemwA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=J4ChUr3+yTXCGAely9Zb2mn+pPQKiUfYt0OutNbQLEk=;
 b=zhyBL78Vzab8y1cDEvfDVuO6G+xrD5tHFcAgF8dGqjtzu6QqtZjsFhNBalRnQCDixG+dpk/Kz/2M/Zhe6+mO2UHhDYD7tpBfPj1kQUrhfwHw7BSCP2hPQzJBzQMFtvw4S4zKVvkrJRh23GxvJpYWQyHYTeAAvA4tqfUTW6/xOJaWuVSqyFKqcP6zXNWZi6g515GNSSHpfEOHurBHOlq0rsfbCSMdWwp1QAFfZbdXEJ1R80dSJu6EAXQCuztiTydsJwiJCGoUbzNHwojd2BmkmlpewzVdg2V40RkdM+RpE1D2IevZm9/2zYZzI4WhGqbu3TUb19n6Il2TKXGntNJJnA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <d89a2ccd-bb76-cf0e-687c-e4f2e333b1e7@suse.com>
Date: Mon, 10 Jul 2023 13:41:54 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v5 01/15] cpufreq: Allow restricting to internal governors
 only
Content-Language: en-US
To: Jason Andryuk <jandryuk@gmail.com>
References: <20230706185440.48333-1-jandryuk@gmail.com>
 <20230706185440.48333-2-jandryuk@gmail.com>
Cc: xen-devel@lists.xenproject.org
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230706185440.48333-2-jandryuk@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0084.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9b::11) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM8PR04MB7954:EE_
X-MS-Office365-Filtering-Correlation-Id: f1012461-824a-4ee6-ea37-08db813aa9cf
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	tLq6O6JOuQOS/RmvNKDr5t3oqaE0QAt/s0bjHtToui/ph4DcUC8M6KPvT+/APK++NDUjtAA/CJ74Ir5PdLTEMEw2wKITqklQvCixdepVKxBTswD41PH/VcghyaHabKc6zF808LDUWlHjjReEUwiJMzWNyC0ly4DuxZxxJt4yGPzIpuO+ZIdMkwVRZZedJASSmRpKY3h5XTcu04VJEDfbVRX/1wqwgKnJXZdiYXx6Lwok8xJhwzVqZe5Vs5+JU+p6jUIJeUHoWt1qUPVwry2es82Bbrmo9VTQZBqBl+hkx8aUjTGRSg3B7l13BFwBDZgFf9JE8VlT9Sz/qDs9UHJPvQLBHWM8oJbyi8zApfCV/lnwThFbrl8zhK+KcY4qtp1ssJwIiQj2KLdS4mt7vky42jyhMriydpD1GTri2AOPQEp2VC3cyOYgkhYGNB3SFGZAimec5Tc0bUQkeiF6vrAvcfopnqu2472QRSZLQSoW50N/KkMDUkm7uPCYeLk9mGsb61lbyxWFh6A905O1kd9peBqUeh9Za+YJdbUV007ovSb7YiBUbuRdX11hC+LRo1YoUg3qfJ6I3SxIamE69/YptjvBdBn3mJrKIbQN/gnuCBBuyX6WdGb4NibdgA8XFekIcOjs5grM7yJILO80jQ5H6g==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(136003)(346002)(396003)(39850400004)(451199021)(53546011)(6506007)(186003)(26005)(86362001)(8676002)(8936002)(2616005)(31696002)(31686004)(5660300002)(6512007)(6486002)(41300700001)(66476007)(66556008)(66946007)(2906002)(36756003)(478600001)(4744005)(38100700002)(4326008)(6916009)(316002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Nkc4UUxxZlFqMGNNR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WpVbWtLRUk5bk1saWZKR3g3UkxqRXRkQzAxVDdTZTZVY0JUazQ4aGlq?=
 =?utf-8?B?cnpFSE1SY3d6RE5QWUFPZnpxR0F1REgwZDQwRnY3MC9IZUgrdGpBL2lrc3J0?=
 =?utf-8?B?Y3pnNDhzN0dZbGlkN25GQWtIT2ZBMjV4Um11R2hBRGtzSzBRSVV0dHFaS2hr?=
 =?utf-8?B?WTR2bGRkTzZiNTJIUjBSSm9OMnlCaW1tZUhWczJjUEpNVHdkL2xUcytXZzZF?=
 =?utf-8?B?OFkwZ3Q0Q2N5R3ZvVWdRbHA2ZHNlcXF6cHRoNGZpbEJUK3NqUngzc1dqSGdB?=
 =?utf-8?B?cVlLOU1ia1c1aDBNaXJFaHJ3YWMwbWVRb3JKRHA2QWJ1cFBocEZkaGdWbWNx?=
 =?utf-8?Q?SEDPEpzur2Jd3PsUyrJCni32N?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f1012461-824a-4ee6-ea37-08db813aa9cf
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 11:41:56.1819
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 4kOwuDyoyAqPuCfnzZLcp4Id0mJFiXC80X1Ur17Qsgn4r4SDEfB04Ry7VgQuBu/c0Wuhg2mcQ5RbxZWmfeUBIw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7954

On 06.07.2023 20:54, Jason Andryuk wrote:
> For hwp, the standard governors are not usable, and only the internal
> one is applicable.  Add the cpufreq_governor_internal boolean to
> indicate when an internal governor, like hwp, will be used.  This is set
> during presmp_initcall, and governor registration can be skipped when
> called during initcall.
> 
> This way unusable governors are not registered, and only compatible
> governors are advertised to userspace.
> 
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Mon Jul 10 11:52:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 11:52:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561185.877575 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIpQv-0007j8-W6; Mon, 10 Jul 2023 11:52:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561185.877575; Mon, 10 Jul 2023 11:52:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIpQv-0007j1-SK; Mon, 10 Jul 2023 11:52:01 +0000
Received: by outflank-mailman (input) for mailman id 561185;
 Mon, 10 Jul 2023 11:52:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qIpQu-0007iv-Ai
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 11:52:00 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on0616.outbound.protection.outlook.com
 [2a01:111:f400:fe02::616])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2cb97f93-1f18-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 13:51:59 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS4PR04MB9621.eurprd04.prod.outlook.com (2603:10a6:20b:4ff::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.29; Mon, 10 Jul
 2023 11:51:56 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 11:51:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2cb97f93-1f18-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=MUp1vnPT7Gzw2pffk/oqFMDwfBBHsDupRaOHBAFmjes7++UpwA75OB6SwobokqDGT3C9QmH54CsBonXSiPxJNSfBWHj5+6Y/KG6SW1NcdPlRg6ZbzcAzadW9hu4BzyzhtuczIBYF0qbvWm8S+po/aYUBk4a4sWXOhR+t3WBWAJftJH3V0kvj6plLP+LQWf9fplVde6a/L8YBFWAxa7tSC+tfrfVhLBlwoYggGhgS0Odv6rV7Aay0YY9ltmsMWvnnvNlLdBXWySr7LBaUxHdluHj/GFDQGM5c90zBqZwdXNrkfcbUZGBkoInZiKP7t4XMc3qVDMwIZNjibWzQfF3sYA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=YXqRSPuEn9NmTOcM5BTOAkkX6gjPDFKMEUFikV9xPoA=;
 b=CZwUgcAnhoTZW2vgUnzzl5HNptjDMDh0yY2T9j/GF3JFtUcgPHLaYgtHaOuUP2/FsSX8MLbiV3TMRMGKAxkP87vOzX6F1HgGARmwtZfLV3kqzsmMT+a/u8LggayhVtj6m8ThvKGSSJddC1mNQXN7tv9QBtLM+y/uWBRSvIfjzKFksVEwlEm3U+wIKK5213T7uTUGTYMw9znfINc7S1YHe9Bqj3gwRx1gPXH7FUBUw7lg9RKUxWgpGnWBagKY59g0BiO2m4C6te0++WkcASkdRrE6xjJiXvC/zYY37jbDPl9g7PLQV/SiSZ4zNF3BB78KEvjqBzr3BZN9VAklVQdvsA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=YXqRSPuEn9NmTOcM5BTOAkkX6gjPDFKMEUFikV9xPoA=;
 b=PkLb9OhKRr4/pCOrtFkwij6Ym8yvVjiZUC/UErFXNEniYRA0SzetnQFHs5YX5D+1ncVM0sAHGwM0glnJDA/7oOWkMYT7651R4F3reOQhSyyLuZzdOVVDc1JQTVWrmnxHdKddtSXH1Iu3m/WxU1yV060uRm1MVyQuSv7jk/XDoGsjPsWBZtqK3+kI66+JA8+lcTiJsrkm6iAdTZnN9Ehr9yjkHUrjhch675m0UsvxShquYYs4fn/W40ybQcYCa4uZ2ojXunV6uy9BNqmEtXZolQvh4pL3lryU/KuwKafjz6cGTr2ozftYztp6ytG4Sg6vuSoTQ0eD89it/JyVvaLesw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3695b109-f082-7612-f9c9-fae8143f46e3@suse.com>
Date: Mon, 10 Jul 2023 13:51:55 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v5 04/15] xen/sysctl: Nest cpufreq scaling options
Content-Language: en-US
To: Jason Andryuk <jandryuk@gmail.com>
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>,
 Juergen Gross <jgross@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20230706185440.48333-1-jandryuk@gmail.com>
 <20230706185440.48333-5-jandryuk@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230706185440.48333-5-jandryuk@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0111.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a8::12) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS4PR04MB9621:EE_
X-MS-Office365-Filtering-Correlation-Id: c3e41f69-cfd2-4943-3b99-08db813c0fde
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	aO0mZmGH96kj10bxTc7GUVt49GUFd8VePLHN2Cwy0Er2gFjGOWgEdJOeBT15huUsJ4TOJkEG3KD5kWaPvWhYNUozYlyQw75o2dfZaD9gmBq99qJkrUmSyTgIgukerDlBvSowZCijnz9gDqYUd5GXLOMyQEpQiDumQ7Fv8P8SXN8hYaG6R53zS/Lfubd4Q6c4ldBprkxPnyMlg+90G+dGkkbLuV4L9WWuosxreCUN8Goqd8xQLVcdIFeyCNgaCeSuASKyUrHNuUTfsAqh8rTNglqoeN2EwRFPAA+pR7t0guJfbbAoFMDmiBVjDD96PVxTIxN9z7AkzQ85Cuwssn0xWNeQfFQVldWXdGU7yKL/tROQ44CGZHQMvjUu3GGuY3wY3/yzPxsaezmVdEwP81Eglkacgb0VeAAWqSGs/2zB7R2wprWu7kEOkga0KkekbJakxpwRkUsAHIH2pRb04q4IGmbXYgmUMELAqP//ty8knjJ8EWaaJjO18JN+6sprqo/VV9YGhtGlDwOXF2KiJ8A6+gz3z/K/sibOlyoJ5LS9r25+q2iY8riqCmFWpbl1i05KQTU12rzq0ZfYdo3FZ2IbA/jS/vmewA/9VB2JRkqMVwbgCnaq/a7cTR7l3BFP4rnZWD3F1L0FxBZ69CEhv3yPwA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(396003)(136003)(39860400002)(366004)(376002)(451199021)(6486002)(478600001)(54906003)(6506007)(26005)(53546011)(186003)(6512007)(66946007)(2906002)(66476007)(41300700001)(6916009)(4326008)(316002)(5660300002)(66556008)(8936002)(8676002)(38100700002)(2616005)(86362001)(31696002)(36756003)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QTFLZHB3VUthVGhEYXlNVDlXMmJFRy9xeGhUSUVH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QVUlUL01haTZudFNGa1JmM2QyNW16NFhq?=
 =?utf-8?B?LzU2ZlNma01abklsRmFybmdnTm9xa2NmVEYvSjgraTVUbEpYQTNPVnBraElM?=
 =?utf-8?B?aml6T3kwUDgxQjhRUndmdUxNRy9uN01FQXFVbUsxajc1a2JVZXlSR0w4c0N0?=
 =?utf-8?B?Z0ZUY0dOMXRnaldJenZkdlRQUTRhRldhV3hMWmVSK2l6bEd3cUVqNDVHdE8v?=
 =?utf-8?B?eWxUbWJVd1VjOTVMNDdNWjY2M1dIeEd3S1VXSkl2OVlZSG12VWZIZHlKOGVn?=
 =?utf-8?B?YWFJQmZPckV3dWxpZEpYbmtNcGFLODJTTzc5aFJseHAvQkN2MXZmaWNGTnJj?=
 =?utf-8?Q?jXJ8ReAjeEb3YYlvhdc1HPE+A?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c3e41f69-cfd2-4943-3b99-08db813c0fde
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 11:51:56.8176
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 1NKjI2hKzEronkVOl5oi4PUY6fYhVnJZ4eYqwSvjeoMJXsNpZvfJSxpO8jHviIYRexBHPapCLbWEcsz5231N0g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9621

On 06.07.2023 20:54, Jason Andryuk wrote:
> Add a union and struct so that most of the scaling variables of struct
> xen_get_cpufreq_para are within in a binary-compatible layout.  This
> allows cppc_para to live in the larger union and use uint32_ts - struct
> xen_cppc_para will be 10 uint32_t's.
> 
> The new scaling struct is 3 * uint32_t + 16 bytes CPUFREQ_NAME_LEN + 4 *
> uint32_t for xen_ondemand = 11 uint32_t.  That means the old size is
> retained, int32_t turbo_enabled doesn't move and it's binary compatible.
> 
> The out-of-context memcpy() in xc_get_cpufreq_para() now handles the
> copying of the fields removed there.
> 
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

Nevertheless I continue to be uncertain about ...

> --- a/tools/include/xenctrl.h
> +++ b/tools/include/xenctrl.h
> @@ -1909,16 +1909,20 @@ struct xc_get_cpufreq_para {
>      uint32_t cpuinfo_cur_freq;
>      uint32_t cpuinfo_max_freq;
>      uint32_t cpuinfo_min_freq;
> -    uint32_t scaling_cur_freq;
> -
> -    char scaling_governor[CPUFREQ_NAME_LEN];
> -    uint32_t scaling_max_freq;
> -    uint32_t scaling_min_freq;
> -
> -    /* for specific governor */
>      union {
> -        xc_userspace_t userspace;
> -        xc_ondemand_t ondemand;
> +        struct {
> +            uint32_t scaling_cur_freq;
> +
> +            char scaling_governor[CPUFREQ_NAME_LEN];
> +            uint32_t scaling_max_freq;
> +            uint32_t scaling_min_freq;
> +
> +            /* for specific governor */
> +            union {
> +                xc_userspace_t userspace;
> +                xc_ondemand_t ondemand;
> +            } u;
> +        } s;
>      } u;
>  
>      int32_t turbo_enabled;

... all of this: Parts of the struct can apparently go out of sync with
the sysctl struct, but other parts have to remain in sync without there
being an appropriate build-time check (checking merely sizes clearly
isn't enough). Therefore I'd really like to have a toolstack side
review / ack here as well.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 12:10:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 12:10:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561201.877585 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIpiN-0001h8-OA; Mon, 10 Jul 2023 12:10:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561201.877585; Mon, 10 Jul 2023 12:10:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIpiN-0001gX-LV; Mon, 10 Jul 2023 12:10:03 +0000
Received: by outflank-mailman (input) for mailman id 561201;
 Mon, 10 Jul 2023 12:10:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qIpiN-0001Wc-3A
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 12:10:03 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20608.outbound.protection.outlook.com
 [2a01:111:f400:7d00::608])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b2532c2e-1f1a-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 14:10:02 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PAXPR04MB8094.eurprd04.prod.outlook.com (2603:10a6:102:1c1::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul
 2023 12:09:57 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 12:09:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b2532c2e-1f1a-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=UiaJQFZqpc3T7T6/kKZHyBPqP0C5A3poo1hoh2aKehk9TNx8O3avfynaKuYlr+kSokfOs/RKA+Z+rT7osnAPqOSOpXZWPbH3Pb5YpURSuG68aCZv18XPlKwmFqDM7suUqUwnJty+7ciLmB/c5f70MVzt4CPAD1s/0zvRkB2hdQ9E3c8hgyaeu57M8SRaHcnxh5RzNG9Wh3B4mD5u+wArZHYxjasKBa831hgLbvDLxz+JYbzVlj1qMp3bXrl8ADzX4mJ07vrgEV7HHTRsa7wXAtLYQftBiy3azhCjqXRMECvfUbgc3j7O0iFyqcYrlgQ78sxlLJTjoYdN2SkY5uZ5dA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=QF3cSdk6rYS+BzEnzl8gS/3nPiFhCHZ6zpoXcZV0KUc=;
 b=XIvmSYR1t7a4TfvLVVJlLsGJIAjMXZPBesxXPh+K4xXPZWFhqKBYAXCZYHjSzH3ksu7l4QWfn1N4PGHkhYIbyArg/Z/dCM+8yNOfpKxomybuPaaeGraZER+cd0sDRX6HFQnHyIHhWejf/8nIRpvZ+R9JzPtMvUgRsu5O8OHSQSBxM8JlI3zmPmZjJaOUV8/L8oalF94DXNVCYFUOjYvA0TBCB8GeKDjjn9R9+aX1SrmH08B/Zs8hUUDdh5HRrqtcODhmuWRkGYx9uM/4rN68U8NxGJ7RLiWIumCq7ZOhfQOdbZTRjjUQvrlyyszlcYG0Lo9BtYr1DlwWX+JfjPQ2oA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QF3cSdk6rYS+BzEnzl8gS/3nPiFhCHZ6zpoXcZV0KUc=;
 b=eDUZiBtlMcNDWtlWrg3vo0dPOm6kVAeua5+BijmLyB6sAQUGPcvyPlV1o4X1QoOLyDSHhwMl0VLjzi5h/pEzFubgTmYDy/RzWQ7TeX9Tg/58eof77JUZj7fRngtJxMyiiSR0jyK9rTft+KDhUbltVpTFJfAu0gsYQWxSKJJ96k6k/Ogu1tfNyquhg3BARfgh3xs079MvDS+qH8jMMnOFTpIYjvtmROBiGLsLKAXhWQTEJI1z25D5Sx8l0f0v+9UNep50P64bWYABntpWfRaoAOXIei1s/E55+CQlkjd1IijmNZQJ+cG6K8vROBO+R4NUuWGgCJBO30NUHwr/LXDoNQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <898f7edd-0134-c147-57ee-f01cca105bcd@suse.com>
Date: Mon, 10 Jul 2023 14:09:55 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v5 05/15] pmstat&xenpm: Re-arrage for cpufreq union
Content-Language: en-US
To: Jason Andryuk <jandryuk@gmail.com>
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>,
 Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
References: <20230706185440.48333-1-jandryuk@gmail.com>
 <20230706185440.48333-6-jandryuk@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230706185440.48333-6-jandryuk@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0004.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1d::23) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAXPR04MB8094:EE_
X-MS-Office365-Filtering-Correlation-Id: 6a12e4f3-7a2e-4c10-cde4-08db813e93ef
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	kk9KMY1+pXPxuhc0KY4tpvI8xzVvf2ppouRrttGL4jbdTCgzjhdmppXfKAdzd1WO/8Qv31zPJxFRCrTuvWgorPKmovIjJzvgYlE6KwVj4AwTF5W3GoI/uXukGLVR+sOHqjhzQqcWhT2REIjZDJYTzKeygbFuw/4Pl7//pjnjI7vFoehfkFo96mOVOo68+VNpIYblbWtJQ5s/IT+LTLDynarLVxT4FXUmTv4jrTCaxYhP1lc0Yh0XIan9bXXwp0Efae2KYKWhW8vLWOKmbePbZGCto5EeN5BWolabsULsn2ks1hdnvnLsvBFGhbvufQK2HN62yAI8pnQwANfGlY8VzubtFy7OX8cKYjaUBhvcA2W7nt82qNjZaaMcT9bichbpMw/qarmSRHptK/F7D3l6rkeNdi8BJg4dPoSCcZeSnu90NZkW8zll7QM9e+jyAkLUycOtS9apS8Efj/VxzOy1DztpZIVaKFRDj+UaerZG+EVZ5sTwAgpzHKIHPoX7w0lSTyCGqj3c4nEhCd4RJL0YsmPWPebSUpta9Mk34vjxclmB45HT8EzrNVazUj8menrZr3UEAKP4Rne/C1apiLMLVWhvklz/zUbAxheox06lp6iWt6DYw7wnrAKZuh5Tzvi+sKe89Qpq61tHFydtqMGMVg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(366004)(396003)(376002)(39860400002)(136003)(451199021)(86362001)(31696002)(38100700002)(31686004)(36756003)(6486002)(54906003)(53546011)(26005)(6506007)(186003)(6512007)(2616005)(5660300002)(2906002)(66556008)(316002)(478600001)(66946007)(8936002)(66476007)(8676002)(4326008)(6916009)(4744005)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QTNkQWRScENsTUJiOEtiaDNRVnNOSmFteEhzTnJjZHJLUE5JQzdKT3BKcUFQ?=
 =?utf-8?B?Wmk5UWg5YVEyQ3pQS2l2WVc1RUl0Mk9rTGJLMTR3MXQxUC8rMStRbVUyQkpL?=
 =?utf-8?B?Tkp0dUh5b3FFZG9MVGRWeEdyYWtoQTVjcmNZMTA5T3pWRU02akgyMThlTWZJ?=
 =?utf-8?B?bnYwRUc5Y0dIMStzUWNUQTdid1MyR1NCR3V5UzFxWk1rT25yRHkrNU5HSGZL?=
 =?utf-8?B?QTFyUVFyZTIxYlNUcFRVTE83ajRQRWs4YjBWbmNNMS9sUGIySjBLcEhGdFhs?=
 =?utf-8?B?MTlsa0ZPVTEwRzRnWWJ2ZTFwLzArN0NtK2hPTFdYWU1kaFZidmNXSDZLTmho?=
 =?utf-8?B?M0tSaDRkY09LUWJqek5IUENTYXVXVVZoN2NKZWlMNndWZ2dh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0LP57zeq21fzpQ?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6a12e4f3-7a2e-4c10-cde4-08db813e93ef
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 12:09:57.3812
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: zk8D63HOeaVyYEWiPReV3n1KplQbNmeFNXKayz49820iOQ4uGLYe76+O9tPUdQzFsAgrRp4ocUvHfPU+ABtCvQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8094

On 06.07.2023 20:54, Jason Andryuk wrote:
> Rearrange code now that xen_sysctl_pm_op's get_para fields has the
> nested union and struct.  In particular, the scaling governor
> information like scaling_available_governors is inside the union, so it
> is not always available.  Move those fields (op->u.get_para.u.s.u.*)
> together as well as the common fields (ones outside the union like
> op->u.get_para.turbo_enabled).
> 
> With that, gov_num may be 0, so bounce buffer handling needs
> to be modified.
> 
> scaling_governor and other fields inside op->u.get_para.u.s.u.* won't be
> used for hwp, so this will simplify the change when hwp support is
> introduced and re-indents these lines all together.
> 
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Mon Jul 10 12:29:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 12:29:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561206.877594 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIq1F-0003j2-9h; Mon, 10 Jul 2023 12:29:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561206.877594; Mon, 10 Jul 2023 12:29:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIq1F-0003iv-6X; Mon, 10 Jul 2023 12:29:33 +0000
Received: by outflank-mailman (input) for mailman id 561206;
 Mon, 10 Jul 2023 12:29:32 +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 <SRS0=Xcmr=C4=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qIq1E-0003ip-Em
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 12:29:32 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6ac77390-1f1d-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 14:29:30 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id B23191FF2F;
 Mon, 10 Jul 2023 12:29:29 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 37E1F13A05;
 Mon, 10 Jul 2023 12:29:29 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id CvAmDKn5q2REAgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 10 Jul 2023 12:29:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6ac77390-1f1d-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1688992169; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=MZLkluv/6AIU//IIXEFXPkZ4djC4dKJZJnHAbR0i6pk=;
	b=JG5+ERTkzAQOeVmd6vOM39GiJh3EAB+8yxS5Rf9WPiIEloosOhiTyzlrUyo+DNozK13Jy9
	+hS/sZmXsGOoRU7Rszus8GXPfIQFmYimrZbGO8VaaTB6gM8hbcZttx5Eql00VSSIuBQTZ4
	d+c+N+dhgdi33rQJVKrx8yuOdfL2xDw=
Message-ID: <acda7276-234b-9036-c178-ca2b441f3998@suse.com>
Date: Mon, 10 Jul 2023 14:29:28 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [RFC PATCH 0/3] x86/paravirt: Get rid of paravirt patching
To: linux-kernel@vger.kernel.org, x86@kernel.org,
 virtualization@lists.linux-foundation.org, kvm@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>,
 "Srivatsa S. Bhat (VMware)" <srivatsa@csail.mit.edu>,
 Alexey Makhalov <amakhalov@vmware.com>,
 VMware PV-Drivers Reviewers <pv-drivers@vmware.com>,
 Paolo Bonzini <pbonzini@redhat.com>, Wanpeng Li <wanpengli@tencent.com>,
 Vitaly Kuznetsov <vkuznets@redhat.com>,
 Boris Ostrovsky <boris.ostrovsky@oracle.com>, xen-devel@lists.xenproject.org
References: <20230608140333.4083-1-jgross@suse.com>
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <20230608140333.4083-1-jgross@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------IvHaIO3XNlEm8DU31AArNzOS"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------IvHaIO3XNlEm8DU31AArNzOS
Content-Type: multipart/mixed; boundary="------------ZR3DgzkYsvFZdf0BczSBdOFl";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org, x86@kernel.org,
 virtualization@lists.linux-foundation.org, kvm@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>,
 "Srivatsa S. Bhat (VMware)" <srivatsa@csail.mit.edu>,
 Alexey Makhalov <amakhalov@vmware.com>,
 VMware PV-Drivers Reviewers <pv-drivers@vmware.com>,
 Paolo Bonzini <pbonzini@redhat.com>, Wanpeng Li <wanpengli@tencent.com>,
 Vitaly Kuznetsov <vkuznets@redhat.com>,
 Boris Ostrovsky <boris.ostrovsky@oracle.com>, xen-devel@lists.xenproject.org
Message-ID: <acda7276-234b-9036-c178-ca2b441f3998@suse.com>
Subject: Re: [RFC PATCH 0/3] x86/paravirt: Get rid of paravirt patching
References: <20230608140333.4083-1-jgross@suse.com>
In-Reply-To: <20230608140333.4083-1-jgross@suse.com>

--------------ZR3DgzkYsvFZdf0BczSBdOFl
Content-Type: multipart/mixed; boundary="------------XavUypI85MKZWCdNgx90L6n0"

--------------XavUypI85MKZWCdNgx90L6n0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

QW55IGNvbW1lbnRzPw0KDQpPbiAwOC4wNi4yMyAxNjowMywgSnVlcmdlbiBHcm9zcyB3cm90
ZToNCj4gVGhpcyBpcyBhIHNtYWxsIHNlcmllcyBnZXR0aW5nIHJpZCBvZiBwYXJhdmlydCBw
YXRjaGluZyBieSBzd2l0Y2hpbmcNCj4gY29tcGxldGVseSB0byBhbHRlcm5hdGl2ZSBwYXRj
aGluZyBmb3IgdGhlIHNhbWUgZnVuY3Rpb25hbGl0eS4NCj4gDQo+IFRoZSBiYXNpYyBpZGVh
IGlzIHRvIGFkZCB0aGUgY2FwYWJpbGl0eSB0byBzd2l0Y2ggZnJvbSBpbmRpcmVjdCB0bw0K
PiBkaXJlY3QgY2FsbHMgdmlhIGEgc3BlY2lhbCBhbHRlcm5hdGl2ZSBwYXRjaGluZyBvcHRp
b24uDQo+IA0KPiBUaGlzIHJlbW92ZXMgX3NvbWVfIG9mIHRoZSBwYXJhdmlydCBtYWNybyBt
YXplLCBidXQgbW9zdCBvZiBpdCBuZWVkcw0KPiB0byBzdGF5IGR1ZSB0byB0aGUgbmVlZCBv
ZiBoaWRpbmcgdGhlIGNhbGwgaW5zdHJ1Y3Rpb25zIGZyb20gdGhlDQo+IGNvbXBpbGVyIGlu
IG9yZGVyIHRvIGF2b2lkIG5lZWRsZXNzIHJlZ2lzdGVyIHNhdmUvcmVzdG9yZS4NCj4gDQo+
IFdoYXQgaXMgZ29pbmcgYXdheSBpcyB0aGUgbmFzdHkgc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vY2tfcGFy
YXZpcnQuaCB8ICA0ICstDQo+ICAgYXJjaC94ODYvaW5jbHVkZS9hc20vdGV4dC1wYXRjaGlu
Zy5oICAgICAgfCAxMiAtLS0NCj4gICBhcmNoL3g4Ni9rZXJuZWwvYWx0ZXJuYXRpdmUuYyAg
ICAgICAgICAgICB8IDk5ICsrKysrKysrKysrLS0tLS0tLS0tLS0tDQo+ICAgYXJjaC94ODYv
a2VybmVsL2NhbGx0aHVua3MuYyAgICAgICAgICAgICAgfCAxNyArKy0tDQo+ICAgYXJjaC94
ODYva2VybmVsL2t2bS5jICAgICAgICAgICAgICAgICAgICAgfCAgNCArLQ0KPiAgIGFyY2gv
eDg2L2tlcm5lbC9tb2R1bGUuYyAgICAgICAgICAgICAgICAgIHwgMjAgKystLS0NCj4gICBh
cmNoL3g4Ni9rZXJuZWwvcGFyYXZpcnQuYyAgICAgICAgICAgICAgICB8IDU0ICsrLS0tLS0t
LS0tLS0NCj4gICBhcmNoL3g4Ni9rZXJuZWwvdm1saW51eC5sZHMuUyAgICAgICAgICAgICB8
IDEzIC0tLQ0KPiAgIGFyY2gveDg2L3Rvb2xzL3JlbG9jcy5jICAgICAgICAgICAgICAgICAg
IHwgIDIgKy0NCj4gICBhcmNoL3g4Ni94ZW4vaXJxLmMgICAgICAgICAgICAgICAgICAgICAg
ICB8ICAyICstDQo+ICAgMTMgZmlsZXMgY2hhbmdlZCwgMTExIGluc2VydGlvbnMoKyksIDI0
OSBkZWxldGlvbnMoLSkNCj4gDQoNCg==
--------------XavUypI85MKZWCdNgx90L6n0
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3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YgEYuJYx37Io
N1EblHI//x/e2AaIHpzK5h88NEawQsaNRpNSrcfbFmAg987ATQRTjHAWAQgAyzH6
AOODMBjgfWE9VeCgsrwH3exNAU32gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------XavUypI85MKZWCdNgx90L6n0--

--------------ZR3DgzkYsvFZdf0BczSBdOFl--

--------------IvHaIO3XNlEm8DU31AArNzOS
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSr+agFAwAAAAAACgkQsN6d1ii/Ey/t
GAf+PlDTj1lgofSxQ5KcWOBwEvtHpmSz2yX2+b71GPNP+EuwtH/phyc/lp4O2P/0nSbDx+4kStS8
iFWp0JVIje2K+ExMi5drxA3JZ26i6o2Xt/OpnPp+WULBrJaUOzIAoGU6Mo9rdHp6G0a5/kJesp7R
jI/sKpmZtm9Y5GWHb7oV7aRw1wwarUHgJw8mVnh7isDkQ8PpvKJssS7jrbBGURxhfviYtmV5wcqY
KaR5yFz97/9d042TFkPwtUMlgIFfWCIwZeKxB83CCRnmgBk+RP/TMQqqdky3VNE2zUbZCXQuippD
YCS91d0eFmCgRKI96MpgM3/thFOaIOr3uVPwE3rWcw==
=YrNk
-----END PGP SIGNATURE-----

--------------IvHaIO3XNlEm8DU31AArNzOS--


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 13:14:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 13:14:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561210.877604 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIqiA-0000XL-Gk; Mon, 10 Jul 2023 13:13:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561210.877604; Mon, 10 Jul 2023 13:13:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIqiA-0000XE-E3; Mon, 10 Jul 2023 13:13:54 +0000
Received: by outflank-mailman (input) for mailman id 561210;
 Mon, 10 Jul 2023 13:13:52 +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 <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qIqi8-0000X8-NA
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 13:13:52 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on060c.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::60c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9bc15345-1f23-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 15:13:49 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM9PR04MB8955.eurprd04.prod.outlook.com (2603:10a6:20b:40a::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Mon, 10 Jul
 2023 13:13:47 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 13:13:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9bc15345-1f23-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=n94vPFM8ZcQKXdops7kfEeep60W9yqzcn1gsWw2NSdDFqH+R2E9BSBOA8xSdSrpzRDgvHmSEiYTrt0vdKiUjHTDbqlL0mFhQ6l91TVD/1bml7fXrwe8eABTJF8YWJzLfHpQAtlJH/7BtHNIloIzp7BUkAEfUUL74enjLpVDUaBevwB4BF2/QPkyS7PNJ0kqurn8KODUEnqhI2//c/+oVbIEy1iwM6KVjTY6CH7t0NzLP8FgfKuZOJOMF5H8epNKytlrfse2O0Ein2301VFSKTXShNDj4UQE4LCloPeNZBU/TEAXprYymrWatJmg8VEmK1Lpx8W5/o5Jb4EANvj8EOA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=PxdJdiCEPgMDtV3+5TKaW6K4PuBqE49IsjTzpPtdLpY=;
 b=jTrQUaek+gAkOCWW/TcX/O43rbwoOdjpGHE3RFKIGogUVaJihUdbCN3CgVRznL5so0GP7P4QaGTaqkcVGscf/PxXzmWuL9woEvTQMZ5E4g6NsM6/dlgraqQOhY43spTcCEh5MnmUh/0vDNourMro7hjXygwjC7GHazDMWSguXS5PVE35qZm1TShIlIwEOR0LChwqYWRve7n7lWwlARcN5OX7ZUyj/Fp5ffMmydCNOnn34Dw+pE5Fr6Fz+U3DLamZULKRPVxhe7/Jc3ooe7EZTY5o86d7dakE+qITmqJRvG8PxysugqqWe46G1ZVOWmZub9i4Jxs9vY/LVkk+y33OsA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=PxdJdiCEPgMDtV3+5TKaW6K4PuBqE49IsjTzpPtdLpY=;
 b=LT4dvVO0bvUgzWhdMDvPxnEZD9+tWx/uDuQR2tFYRRylmiLOiweOWbZE2g9ivE6JppvVc6Vqk0xvAVs0E5PZ6aAaueXWZbLytQSDj0dW2iBb032BpKezFcArClqQsXiUd74vqYkehpOcV6w5oQNXJSsdfBh8uShHqng3qY7N8VR224o1/mad1GjuLujRZQIlWrYnnsrwHxfdJqe9SAex9K0su3agM/QEXtBmoHAa6sqr6BTxjb2yDOBLVdG0JromN6D9a5HNj7SkgxPt4I6oXAkNMt6L1Z0QSgTAVwUuA+rD96r0rf5HYrMg+gg77BPlmmLrPAjkkW5H7PjT3okhnQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <eeeb032f-a21b-5eb2-e3d5-63357a04a500@suse.com>
Date: Mon, 10 Jul 2023 15:13:45 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v5 06/15] cpufreq: Add Hardware P-State (HWP) driver
Content-Language: en-US
To: Jason Andryuk <jandryuk@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20230706185440.48333-1-jandryuk@gmail.com>
 <20230706185440.48333-7-jandryuk@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230706185440.48333-7-jandryuk@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0145.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:98::17) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM9PR04MB8955:EE_
X-MS-Office365-Filtering-Correlation-Id: 65d96753-3483-4952-78d7-08db81477e99
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Vz+Il+L3pmB4AHlNrViZ/7y04qUPRR5u0IjWi1kEKoqJnzmse3VC+k33TEzSQOZ5JcausQzL7tzZIYf5N9EXoLVSfoAlKznjPDfMra731/zheqTiAgLgk5M66KJqNawe4I0Qh9OSOAgZKosA4ZOV/Zi+z2jKtPMfME311DHmou6rWPvc8UFjk4Bjr2X+/QNX8SqPFngZsIVpr8gLQAo73o9F87hfOHty/cppKYtIgMxFn0f3zS4alV04T0B2VDyivwgSNV5Zq9O6PzKNgBUCCY6rfvqXPrAF/QltJXjzJwqLsznahdqLGPjxsHPfexPOnooSm2ze3HQucmU1xYtk2RsbDjdNetsK/36YncVd+rimuAekza4nXJ4vroizVE+gIutqMNLNyIdrAXP48G5Mj4ek9tiSfvGuTzoNLqfr+iE9sQC27C//wigc9jbHU4PESKvwG+HFpjzmUBKU3B5Vqu81ct3mcY88qIOCCzyCVRRzriv7f65LL2CH1pywuyEmclmB+gaLUE2A/zVsFbdzEjM8LHAFQ9A748RPp/HORiPqy9Scwsc90fdgL0xcuZTeP3yS4JB79ROkwAZa66Dw1R4bbazehif+wRHwWxBZr0ifesgtf+R/UPXctiz6VF06B4oabQyobgSEHwNOO091mg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(396003)(39850400004)(376002)(346002)(451199021)(6916009)(38100700002)(66556008)(66476007)(66946007)(4326008)(2616005)(6486002)(31696002)(186003)(86362001)(53546011)(36756003)(6512007)(6506007)(478600001)(26005)(54906003)(31686004)(8936002)(8676002)(5660300002)(2906002)(316002)(83380400001)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UmF0SGNUOEZScFg2c1puemgxN0lnRnV3UXJLQWdNbU9KTyt3a2hUVnBsbDlZ?=
 =?utf-8?B?UFJXYy9pVjA3dkE1QjhrR0tqZXljNWgxQk5Ha2VxYjFJbHhyNEUwbXA5YnZq?=
 =?utf-8?B?Vi8yckM2dXVhQTRVZ3NUc0hISk05UmV4dEFRUFpVZm9hM2wveTZ1SDZDVkNo?=
 =?utf-8?B?TjhMVVR1Rm80cEgrSXdNUVN6M0orOWVha1NxNVNwckpabmpPTy9mYTNQZTFm?=
 =?utf-8?B?ZFkxdXh3REphK2p6Tm1la2planF1NVJmRlRuUUZIOUhYSngyMXdIbkx3NGpW?=
 =?utf-8?B?aVVDaWVPQ0RYK3RieXlMdVNJRDg3M2w3ZWppWlVkc2xEQmxEaUpqcXZIcWRv?=
 =?utf-8?B?SENRcUdyNGt5T0ZsYk1XbU1Zbm1xUnNWc2dyTUpRT2l3Z2lRVUQ5OHBsMXY4?=
 =?utf-8?B?eVBEWHdmVERNb3dqYzVzZ20zOEExK1JMa3Jkdk9tT2xtS2tXdXprR1pnZ2lk?=
 =?utf-8?B?T3o3cG44R2U0Rm54ZWg4c3NUZGd1dlNJUUpuTkNKRDdoeEltRXBKeVVsZjI3?=
 =?utf-8?B?TFBENVZ0b3NzeVBHeE9DeTgzVVlYSWFVNmhITFpZQTNRazlYZ2RKMllSb3JN?=
 =?utf-8?B?RGQ4bGVBYWk3T3Z1eHNlOGtCRW1kd2M1TWFpU0pjSlpyR0hRNWZDQ2JoTjQv?=
 =?utf-8?B?bE5kNmtaRU8vOHNtRVlpdUg3UkFJRTRTVzNpOTNtTFRXK254SWNGZnBP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Wo2RTVnODMwR2VPcWYveXFnMGJYQjRsN205Uk85ODM1Zm8xQTZtSU16U3dR?=
 =?utf-8?B?U2FzeVMybG9wbGpoc1ZaQWUrYWk3UGNyOEpRaTNPVS9DcTVGcXY2R1ZNc3Uy?=
 =?utf-8?B?WTZOOXNXUmQxazMwVDhKWkR1ZFkxUW11bmxqdVloTnNONmlSY24xK2lGdUt5?=
 =?utf-8?B?YisrN3M2cXZWMk5GT2RYVXBkWHBCSi9oZHlUN2NDdWk5NDM4aTh6MUN6MFQz?=
 =?utf-8?B?YXFkU1RVakVQY0VXdm83UThJZFh1OWp4OUJ4eE9oWkFRUVJMM0J2TE9qMjg0?=
 =?utf-8?B?QUhFeHhuQ2ZlOWs0T2FaK0FCeTBkL1RIWUtoaFNxVnh0bysyKzZYUGVMR0Va?=
 =?utf-8?B?N01jSUlOcERpaXFBSWx2QmFHWjJLbis2bXZRcUZpU2h3SUxxbkpVa0lzeUtz?=
 =?utf-8?B?NXZ0bzArWTFwcDF1aDdtbW85Y0VyT1RRUmhnVTg3eE56OWRGY3ppVEZIV3Ix?=
 =?utf-8?B?MHMxS0NUOWVDSVhBdDlKUkZKajRaM0FGNy9sWTNrcmNYRkREQkdKQUZUc3VJ?=
 =?utf-8?Q?k/0VzdwltkGRbxFCwLCytiyJI?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 65d96753-3483-4952-78d7-08db81477e99
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 13:13:47.1683
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: TWFa8wW5cbYVbRR9au78JzMDVkz7YJwf7ScKoXfuzRazlqPX3Z8QBCqKEPVN2Enai+Ix6qdnkW+wJBl4w6igxg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8955

On 06.07.2023 20:54, Jason Andryuk wrote:
> @@ -510,6 +510,22 @@ choice of `dom0-kernel` is deprecated and not supported by all Dom0 kernels.
>  * `<maxfreq>` and `<minfreq>` are integers which represent max and min processor frequencies
>    respectively.
>  * `verbose` option can be included as a string or also as `verbose=<integer>`
> +  for `xen`.  It is a boolean for `hwp`.
> +* `hwp` selects Hardware-Controlled Performance States (HWP) on supported Intel
> +  hardware.  HWP is a Skylake+ feature which provides better CPU power
> +  management.  The default is disabled.  If `hwp` is selected, but hardware
> +  support is not available, Xen will fallback to cpufreq=xen.
> +* `<hdc>` is a boolean to enable Hardware Duty Cycling (HDC).  HDC enables the
> +  processor to autonomously force physical package components into idle state.
> +  The default is enabled, but the option only applies when `hwp` is enabled.
> +
> +There is also support for `;`-separated fallback options:
> +`cpufreq=hwp,verbose;xen`.  This first tries `hwp` and falls back to `xen`
> +if unavailable.

In the given example, does "verbose" also apply to the fallback case? If so,
perhaps better "cpufreq=hwp;xen,verbose", to eliminate that ambiguity?

> --- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
> +++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
> @@ -642,7 +642,24 @@ static int __init cf_check cpufreq_driver_init(void)
>          switch ( boot_cpu_data.x86_vendor )
>          {
>          case X86_VENDOR_INTEL:
> -            ret = cpufreq_register_driver(&acpi_cpufreq_driver);
> +            unsigned int i;

At the moment we still don't mix declarations and statements, i.e. all
declarations have to be at the top of a block/scope. What iirc we do use
in a couple of places (and what hence you may want to do here as well) is
...

> +            ret = -ENOENT;
> +
> +            for ( i = 0; i < cpufreq_xen_cnt; i++ )

... declare the induction variable inside the loop header.

> +            {
> +                switch ( cpufreq_xen_opts[i] )
> +                {
> +                case CPUFREQ_xen:
> +                    ret = cpufreq_register_driver(&acpi_cpufreq_driver);
> +                    break;
> +                case CPUFREQ_hwp:
> +                    ret = hwp_register_driver();
> +                    break;
> +                }
> +
> +                if ( ret == 0 )
> +                    break;
> +            }
>              break;

In this model any kind of failure results in the fallback to be tried
(and the fallback's error to be returned to the caller rather than
the primary one). This may or may not be what we actually want;
personally I would have expected

                if ( ret != -ENODEV )
                    break;

or some such instead.

> +static bool hwp_handle_option(const char *s, const char *end)
> +{
> +    int ret;
> +
> +    ret = parse_boolean("verbose", s, end);
> +    if ( ret >= 0 ) {

Nit: Style (brace placement).

> +        cpufreq_verbose = ret;
> +        return true;
> +    }
> +
> +    ret = parse_boolean("hdc", s, end);
> +    if ( ret >= 0 ) {

Same here.

> +        opt_cpufreq_hdc = ret;
> +        return true;
> +    }
> +
> +    return false;
> +}
> +
> +int __init hwp_cmdline_parse(const char *s, const char *e)
> +{
> +    do
> +    {
> +        const char *end = strpbrk(s, ",;");
> +
> +        if ( s && !hwp_handle_option(s, end) )

This check of s not being NULL comes too late, as strpbrk() would have
de-referenced it already. Considering ...

> +        {
> +            printk(XENLOG_WARNING "cpufreq/hwp: option '%s' not recognized\n",
> +                   s);
> +
> +            return -1;
> +        }
> +
> +        s = end ? ++end : end;
> +    } while ( s && s < e );

... this it probably wants to move even ahead of the loop.

> +static int hdc_set_pkg_hdc_ctl(unsigned int cpu, bool val)
> +{
> +    uint64_t msr;
> +
> +    if ( rdmsr_safe(MSR_PKG_HDC_CTL, msr) )
> +    {
> +        hwp_err(cpu, "rdmsr_safe(MSR_PKG_HDC_CTL)\n");
> +        return -1;
> +    }
> +
> +    if ( val )
> +        msr |= PKG_HDC_CTL_HDC_PKG_ENABLE;
> +    else
> +        msr &= ~PKG_HDC_CTL_HDC_PKG_ENABLE;
> +
> +    if ( wrmsr_safe(MSR_PKG_HDC_CTL, msr) )
> +    {
> +        hwp_err(cpu, "wrmsr_safe(MSR_PKG_HDC_CTL): %016lx\n", msr);
> +        return -1;
> +    }
> +
> +    return 0;
> +}

Please can you use either boolean return values or proper 0 / -errno
ones? (Same again then in the subsequent function.)

> +static void cf_check hwp_init_msrs(void *info)
> +{
> +    struct cpufreq_policy *policy = info;
> +    struct hwp_drv_data *data = this_cpu(hwp_drv_data);
> +    uint64_t val;
> +
> +    /*
> +     * Package level MSR, but we don't have a good idea of packages here, so
> +     * just do it everytime.
> +     */
> +    if ( rdmsr_safe(MSR_PM_ENABLE, val) )
> +    {
> +        hwp_err(policy->cpu, "rdmsr_safe(MSR_PM_ENABLE)\n");
> +        data->curr_req.raw = -1;
> +        return;
> +    }
> +
> +    /* Ensure we don't generate interrupts */
> +    if ( feature_hwp_notification )
> +        wrmsr_safe(MSR_HWP_INTERRUPT, 0);
> +
> +    hwp_verbose("CPU%u: MSR_PM_ENABLE: %016lx\n", policy->cpu, val);
> +    if ( !(val & PM_ENABLE_HWP_ENABLE) )
> +    {
> +        val |= PM_ENABLE_HWP_ENABLE;
> +        if ( wrmsr_safe(MSR_PM_ENABLE, val) )
> +        {
> +            hwp_err(policy->cpu, "wrmsr_safe(MSR_PM_ENABLE, %lx)\n", val);
> +            data->curr_req.raw = -1;
> +            return;
> +        }
> +    }
> +
> +    if ( rdmsr_safe(MSR_HWP_CAPABILITIES, data->hwp_caps) )
> +    {
> +        hwp_err(policy->cpu, "rdmsr_safe(MSR_HWP_CAPABILITIES)\n");
> +        goto error;
> +    }
> +
> +    if ( rdmsr_safe(MSR_HWP_REQUEST, data->curr_req.raw) )
> +    {
> +        hwp_err(policy->cpu, "rdmsr_safe(MSR_HWP_REQUEST)\n");
> +        goto error;
> +    }
> +
> +    /*
> +     * Check for APERF/MPERF support in hardware
> +     * also check for boost/turbo support
> +     */
> +    intel_feature_detect(policy);
> +
> +    if ( feature_hdc )
> +    {
> +        if ( hdc_set_pkg_hdc_ctl(policy->cpu, opt_cpufreq_hdc) ||
> +             hdc_set_pm_ctl1(policy->cpu, opt_cpufreq_hdc) ) {

Please can these two if()s be joined and the well-placed brace be
retained?

> +            hwp_err(policy->cpu, "Disabling HDC support\n");
> +            feature_hdc = false;
> +            goto error;

Why? Can't you continue just with HDC turned off?

> +static void cf_check hwp_write_request(void *info)
> +{
> +    const struct cpufreq_policy *policy = info;
> +    struct hwp_drv_data *data = this_cpu(hwp_drv_data);
> +    union hwp_request hwp_req = data->curr_req;
> +
> +    data->ret = 0;
> +
> +    BUILD_BUG_ON(sizeof(union hwp_request) != sizeof(hwp_req.raw));

You changed only the right side to not be sizeof(<type>).

> +static int cf_check hwp_cpufreq_cpu_init(struct cpufreq_policy *policy)
> +{
> +    unsigned int cpu = policy->cpu;
> +    struct hwp_drv_data *data;
> +
> +    data = xzalloc(struct hwp_drv_data);
> +    if ( !data )
> +        return -ENOMEM;
> +
> +    policy->governor = &cpufreq_gov_hwp;
> +
> +    per_cpu(hwp_drv_data, cpu) = data;
> +
> +    on_selected_cpus(cpumask_of(cpu), hwp_init_msrs, policy, 1);

Could I talk you into moving the helper function immediately ahead of
this (sole) one using it, much like you have it for hwp_cpufreq_target()
and hwp_write_request()?

> +    if ( data->curr_req.raw == -1 )
> +    {
> +        hwp_err(cpu, "Could not initialize HWP properly\n");
> +        per_cpu(hwp_drv_data, cpu) = NULL;
> +        xfree(data);
> +        return -ENODEV;
> +    }
> +
> +    data->minimum = data->curr_req.min_perf;
> +    data->maximum = data->curr_req.max_perf;
> +    data->desired = data->curr_req.desired;
> +    data->energy_perf = data->curr_req.energy_perf;
> +    data->activity_window = data->curr_req.activity_window;
> +
> +    if ( cpu == 0 )
> +        hwp_verbose("CPU%u: HWP_CAPABILITIES: %016lx\n", cpu, data->hwp_caps);

While I'm fine with this (perhaps apart from you using "cpu == 0",
which is an idiom we're trying to get rid of), ...

> +    hwp_verbose("CPU%u: rdmsr HWP_REQUEST %016lx\n", cpu, data->curr_req.raw);

... this once-per-CPU message still looks to verbose to me. Perhaps
for both:
- print for the BSP,
- print when AP value differs from BSP (albeit I don't know how
[un]likely that is)?

> +static int cf_check hwp_cpufreq_cpu_exit(struct cpufreq_policy *policy)
> +{
> +    struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
> +    per_cpu(hwp_drv_data, policy->cpu) = NULL;
> +    xfree(data);

Nit: Style (blank line between declaration(s) and statement(s) please.
(Also at least once again below.)

> --- a/xen/drivers/cpufreq/cpufreq.c
> +++ b/xen/drivers/cpufreq/cpufreq.c
> @@ -63,12 +63,18 @@ LIST_HEAD_READ_MOSTLY(cpufreq_governor_list);
>  /* set xen as default cpufreq */
>  enum cpufreq_controller cpufreq_controller = FREQCTL_xen;
>  
> -static int __init cpufreq_cmdline_parse(const char *s);
> +enum cpufreq_xen_opt cpufreq_xen_opts[2] = { CPUFREQ_xen, };
> +unsigned int cpufreq_xen_cnt = 1;

Looks like both can be __initdata?

As to the array initializer: For one Misra won't like the 2nd slot not
initialized. Plus the implicit 0 there is nothing else than CPUFREQ_xen,
which also ends up a little fragile. Perhaps 0 wants to stand for
CPUFREQ_none (or whatever name you deem appropriate)?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 13:51:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 13:51:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561216.877615 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIrIO-0004t6-CR; Mon, 10 Jul 2023 13:51:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561216.877615; Mon, 10 Jul 2023 13:51:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIrIO-0004sz-9r; Mon, 10 Jul 2023 13:51:20 +0000
Received: by outflank-mailman (input) for mailman id 561216;
 Mon, 10 Jul 2023 13:51:19 +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
 <SRS0=GfHP=C4=citrix.com=prvs=5481289c3=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qIrIN-0004sa-KQ
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 13:51:19 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d6c83b95-1f28-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 15:51:17 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d6c83b95-1f28-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688997077;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=iiACUOUu7fIuxgLUtMMhtGHPmApMR/pDsULP0BTcWo0=;
  b=duYdibjCH1voyB3nUCOs4gZai0kxk4lWgjWh/j02N+14IlWny629EOYN
   uZtPgpDRLwUof9NQqyAKqeNofzBDYaaeZymQ8Zad32w8NjMU2izYWuBGH
   KmHeR74d+m/vfb5+j1hi3vwgz5RciDa75ejhStrk3ELnwEVAZrn143Dtr
   g=;
Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 118279729
X-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
 M7AIa5A4Zv3YJmLLQZapM9Hi9fHPghkmQvuqWnTlnxLK4a2an+PUqsiO1CTdO0/567siFyLo
 4YObZTUlU8DC7GWjszrHWk7dABiEJTGLcqu95w/mhCrf2KK513N+9eOmOh8KuSJboxel/vS/
 2HVZ6Or4AOXuJEzEi3TMioLQOq2Df5CQYcTYXRE0aCAhyJyPu5CLc43K/MKQFXQ3LA6nKQsE
 ahYIZTo7zYmYm2vxgnxpKLV9ORKHClHTyrXV8Z5SFDTp6JdejE=
IronPort-HdrOrdr: A9a23:1GCRWKBJcDYu7GzlHelo55DYdb4zR+YMi2TDt3oddfU1SL38qy
 nKpp4mPHDP5wr5NEtPpTniAtjjfZq/z/5ICOAqVN/PYOCPggCVxepZnOjfKlPbehEX9oRmpN
 1dm6oVMqyMMbCt5/yKnDVRELwbsaa6GLjDv5a785/0JzsaE52J6W1Ce2GmO3wzfiZqL7wjGq
 GR48JWzgDQAkj+PqyAdx84t/GonayzqK7b
X-Talos-CUID: 9a23:9L2lJGFuYVheHIyWqmJk6wkbC+d8WEbXj3DbExCkWDxJFe2sHAo=
X-Talos-MUID: 9a23:VR1epgtc1aRr7HdDXs2nnAN6MYBrzP2SGRoRiKwsheenBAwqNGLI
X-IronPort-AV: E=Sophos;i="6.01,194,1684814400"; 
   d="scan'208";a="118279729"
Date: Mon, 10 Jul 2023 14:50:51 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Peter Hoyes <peter.hoyes@arm.com>
CC: <xen-devel@lists.xenproject.org>, <bertrand.marquis@arm.com>,
	<wei.chen@arm.com>, <luca.fancellu@arm.com>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH v3 1/2] tools/console: Add escape argument to configure
 escape character
Message-ID: <965c66df-1423-4784-aba4-e7df6c097c9a@perard>
References: <20230622141248.459133-1-peter.hoyes@arm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230622141248.459133-1-peter.hoyes@arm.com>

On Thu, Jun 22, 2023 at 03:12:47PM +0100, Peter Hoyes wrote:
> From: Peter Hoyes <Peter.Hoyes@arm.com>
> 
> Dom0 may be accessed via telnet, meaning the default escape character
> (which is the same as telnet's) cannot be directly used to exit the
> console. It would be helpful to make the escape character customizable
> in such use cases.
> 
> Add --escape argument to console tool for this purpose.
> 
> Create parse_escape_character static function to convert a character
> string (which may include a '^' modifier) into an ANSI integer.
> 
> Add argument to getopt options, parse escape character and pass value
> to console_loop.
> 
> If --escape is not specified, it falls back to the existing behavior
> using DEFAULT_ESCAPE_SEQUENCE.
> 
> Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
> Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
> ---
>  tools/console/client/main.c | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/console/client/main.c b/tools/console/client/main.c
> index 6775006488..fb7cfb04b5 100644
> --- a/tools/console/client/main.c
> +++ b/tools/console/client/main.c
> @@ -42,7 +42,7 @@
>  #include <xenstore.h>
>  #include "xenctrl.h"
>  
> -#define ESCAPE_CHARACTER 0x1d
> +#define DEFAULT_ESCAPE_CHARACTER 0x1d
>  
>  static volatile sig_atomic_t received_signal = 0;
>  static char lockfile[sizeof (XEN_LOCK_DIR "/xenconsole.") + 8] = { 0 };
> @@ -77,6 +77,7 @@ static void usage(const char *program) {
>  	       "  -n, --num N      use console number N\n"
>  	       "  --type TYPE      console type. must be 'pv', 'serial' or 'vuart'\n"
>  	       "  --start-notify-fd N file descriptor used to notify parent\n"
> +	       "  --escape E       escape sequence to exit console\n"
>  	       , program);
>  }
>  
> @@ -174,7 +175,7 @@ static void restore_term(int fd, struct termios *old)
>  }
>  
>  static int console_loop(int fd, struct xs_handle *xs, char *pty_path,
> -		        bool interactive)
> +			bool interactive, char escape_character)
>  {
>  	int ret, xs_fd = xs_fileno(xs), max_fd = -1;
>  
> @@ -215,7 +216,7 @@ static int console_loop(int fd, struct xs_handle *xs, char *pty_path,
>  			char msg[60];
>  
>  			len = read(STDIN_FILENO, msg, sizeof(msg));
> -			if (len == 1 && msg[0] == ESCAPE_CHARACTER) {
> +			if (len == 1 && msg[0] == escape_character) {
>  				return 0;
>  			} 
>  
> @@ -335,6 +336,7 @@ int main(int argc, char **argv)
>  		{ "help",    0, 0, 'h' },
>  		{ "start-notify-fd", 1, 0, 's' },
>  		{ "interactive", 0, 0, 'i' },
> +		{ "escape",  1, 0, 'e' },
>  		{ 0 },
>  
>  	};
> @@ -345,6 +347,7 @@ int main(int argc, char **argv)
>  	console_type type = CONSOLE_INVAL;
>  	bool interactive = 0;
>  	const char *console_names = "serial, pv, vuart";
> +	char escape_character = DEFAULT_ESCAPE_CHARACTER;
>  
>  	while((ch = getopt_long(argc, argv, sopt, lopt, &opt_ind)) != -1) {
>  		switch(ch) {
> @@ -375,6 +378,12 @@ int main(int argc, char **argv)
>  		case 'i':
>  			interactive = 1;
>  			break;
> +		case 'e':
> +			if (optarg[0] == '^')
> +				escape_character = optarg[1] & 0x1f;
> +			else
> +				escape_character = optarg[0];
> +			break;

Could you check that `optarg` actually contains a valid escape
character sequence? Either only 1 character, or '^' followed by only one
char.

(If one want to use the NUL char to escape, it should set ^@, not '' or
'^'.)

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 14:13:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 14:13:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561221.877624 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIrdP-0007Pm-U8; Mon, 10 Jul 2023 14:13:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561221.877624; Mon, 10 Jul 2023 14:13:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIrdP-0007Pf-Rd; Mon, 10 Jul 2023 14:13:03 +0000
Received: by outflank-mailman (input) for mailman id 561221;
 Mon, 10 Jul 2023 14:13:03 +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
 <SRS0=n6vR=C4=citrix.com=prvs=54822c203=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qIrdP-0007PZ-Cv
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 14:13:03 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dfe2185a-1f2b-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 16:13:00 +0200 (CEST)
Received: from mail-mw2nam12lp2045.outbound.protection.outlook.com (HELO
 NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.45])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 10 Jul 2023 10:12:50 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by PH0PR03MB7114.namprd03.prod.outlook.com (2603:10b6:510:291::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Mon, 10 Jul
 2023 14:12:46 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2%5]) with mapi id 15.20.6565.028; Mon, 10 Jul 2023
 14:12:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dfe2185a-1f2b-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1688998380;
  h=from:to:cc:subject:date:message-id:
   content-transfer-encoding:mime-version;
  bh=Y6oh3zp3Z/2dIERwBPNGl0nWCaJMPxQkTE54A1X6tLY=;
  b=HKE8hNI8xEbSz1lN3ahQhIzRikmb+69f6fAGaG0pEqQcsfhxPa+cNgLg
   NoktkeH+kksOzSXprY7tEtcUGTGU/A8R+rfMNj+JXfpGW/KwvfO+LmwiY
   y0aZbrUwSWcaqDUifnNSc+Tnq4jdLpwAdRPpdPqyGc7Ir5rmaHzo1Gp9R
   o=;
X-IronPort-RemoteIP: 104.47.66.45
X-IronPort-MID: 114419237
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:TFAbs6Cv7GNM+RVW/w7iw5YqxClBgxIJ4kV8jS/XYbTApDN21mMDn
 GMbDDrVaa7bYzGgett0YYXk9U8CsJCAm4VrQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h
 yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs
 t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GxB5gRnDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS
 uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada
 jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIwyKVuP0hA9
 +0iDh9QPjq43+Kd+JunY7w57igjBJGD0II3nFhFlGucKMl8BJfJTuPN+MNS2yo2ioZWB/HCa
 sEFaD1pKhPdfxlIPVRRA5U79AuqriCnL3sE9xTL++xrvgA/zyQouFTpGMDSddGQA91cg26Tp
 37c/nS/CRYfXDCa4WPcri7117WUwksXXqo5NKKxx6410GSo130NWQwpWnqHmv+Q3xvWt9V3b
 hZ8FjAVhbg/8gmnQ8fwWzW8oWWYpVgMVtxICeo45QqRjK3O7G6xBGIJUzpAY9wOr9ItSHoh0
 Vrht8ztLSxitvuSU331y1uPhTa7OCxQKHBYYyYBFFEB+4O7/Nx1iQ/TRNF+FqLzlsfyBTz73
 zGNqm45mqkXiskIka68+Dgrng6Rm3QAdSZtji2/Y45vxloRiFKND2Bw1WXm0A==
IronPort-HdrOrdr: A9a23:e0gTrKEa+1/TMLiepLqE7MeALOsnbusQ8zAXPhZKOHhom62j9/
 xG885x6faZslwssRIb+OxoWpPufZqGz+8R3WB5B97LYOCBggaVxepZg7cKrQeNJ8VQnNQtsp
 uJ38JFeb7N5fkRt7eZ3DWF
X-Talos-CUID: =?us-ascii?q?9a23=3ALjvXT2vb/04AVLsBlt2vVJxd6IsXMWTj5XnSMnW?=
 =?us-ascii?q?eJjs5YobNSXSo0b9Nxp8=3D?=
X-Talos-MUID: 9a23:JQH3WgkOWaoXUQ1OQBrudnpJFNhh0vTxWHk2gIQY6ti7Og1MADG02WE=
X-IronPort-AV: E=Sophos;i="6.01,194,1684814400"; 
   d="scan'208";a="114419237"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=c9VMYI3zTBK7T3vPn2Y+Bqg0OgCkuvx8ZI9UMH9HPykGvdtMihm4OZNpEFZKPI4PaSrA7d9ymGSaIq8k6q3XZn73IHMnht/xp9bSwy9s4yFj6PMp/bl/aMi1rx36g0UjADpsdcEwDclmmE9TZb619f4l6kHI8TjAcpc6Q6x3n+8TyQJBUMJL0X/pMa9LreohUwMAUIAl20flLRjpgIxugJ+MA2B9DmNE1bvIFcOTbfovaXVq80cST2ACZ1UCj70kt1Z5bnqWW73Pnkb94CqLJEmhNsLdjZH2y8XBHNQrtmv9L7r/82jQ2bIAjCbQNck/xnnaL8RGFHNLu5G1OaKK3w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=IlsLkyE9EbE83jCQDjjMDNyDHqXyyQDGqmf1ljap4rs=;
 b=VLaMlJrBh4Q6R67ga9cFDypNE1ef3IYv0VHD50PyCOFXgLjUJTsZr8q82SD88NDjbgaj24QqG4wNM5ui0IQ0GKwcbfA8eJZ5N0tDQ2LzUoLViLeN7Rfck14Hqgqa/V1afXKu2/tt3UjUMVd1IxCzI51N6P068DtY8iST9CTyBFAq+IzkgIeZnpyHmcvMdoGb5FcyGHf+26EoLHNw9yjFwummfCCN1vPgV5ufHB/ePrj32t+TdEF/pizGx7JuiU9kO195XUaE2M27Y5rrCfrkvQP/wDHFjg1H4Uqb16mUriGiH0tclpj6CkKT2B0u5TfEWnb8y04z1Jupq8hcVsHtXA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IlsLkyE9EbE83jCQDjjMDNyDHqXyyQDGqmf1ljap4rs=;
 b=J1LKqlY2FBr9SUh+nJ54glr8p7OZqIsn2PDFez/9nZL/0WdsQyftp2jumZYtlgAc0w3cRSryozO0iMX+T6Ka0NZ615dxhh9hLZaqLEIBozk0zTjxrMMz2h3gdYhwamVZi0V3T7TLDrKyFntL/MWwm2/2Ifws7gBFf6jWd3Przu0=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH] cmdline: only set ask mode if vga= is present
Date: Mon, 10 Jul 2023 16:12:38 +0200
Message-ID: <20230710141238.375-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P123CA0024.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:a6::36) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|PH0PR03MB7114:EE_
X-MS-Office365-Filtering-Correlation-Id: fdd642fd-49fd-45a9-ae39-08db814fbc01
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	1Qvb6+L6KGcjTctk6RXWh0dKP6ZjTLBq9A72n+ts5RNEun4/IMfsQHgBHpQUxwp7hX7Edcd9FZKHygkhYixv96odZlzcUxlzE80rtVlYHgosLg2GFOduaH2vMu1ciWayIOXV5T5fSe4kNEaQhI4zObDJlbrmY7XlORsO0QE8WivcKljvSfl5X3FSO3OcfLb9jv9DxW6+dsm0gPoOZXSmlAKu6LvdN5OXzRpKszvp5xGD3rNFUZc2nxYG0Lnp9gPOCnKQEbcN8POUsa7ydCKUpP7YgvDoMh/AXI7YLIaeea5aBSq+qifBewnK1p5KNGW6b0LSTFYBu56YQ4w802sdN7u6W3bTr8EVBbCFpBWMZY4FaGtYJsXWdvp2OHmOeFuuWZ6Q/MdTAAA6MStVW5NP5CkroXhghaRIBZNGWdx3mFVHkz/tdZOa83IoNJqVkncXvZZE3KytB6Ds7lgX2DlOuVzhZE+6W1++qQ1KDSsIa4Pgrm+fJ6mXh/xnAw6O9xl/NamUEXYgAs/nIKA7AZ5zP32HcYRblguRcMHeC25cCRo=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(396003)(366004)(346002)(376002)(451199021)(6666004)(6486002)(478600001)(83380400001)(1076003)(26005)(2616005)(6506007)(186003)(36756003)(966005)(6512007)(316002)(2906002)(41300700001)(38100700002)(82960400001)(66476007)(66946007)(66556008)(6916009)(4326008)(86362001)(8676002)(8936002)(5660300002)(54906003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cmR0aysyZ2FrNG5remd2dUsrN0JJM1c2RjVDcnNFTUJYSUJxN2F5bmdVdnRu?=
 =?utf-8?B?eHpsZVo4N3RlZlFON29uQlVVWGJYeFIyQzhvbmNNVDQ1KzBvMEpQamFGZUcx?=
 =?utf-8?B?Z3dRSEtmcndRRFhHWDZvVy9NUUVKUlF1aWZvWlNCVVMzdkJrOGhtVVNwR0gr?=
 =?utf-8?B?bVVYU1BiY3NXeTZZM3FMempLZ3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oIVOBdH8aoaLIBom/x4xu4L3JapOVIXODHnUUO0X7yJCniuFDCsXcGlGvv5OsXKfB18iz/Si2Q/VSF/pzWHZx5H5
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: fdd642fd-49fd-45a9-ae39-08db814fbc01
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 14:12:46.2539
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: r2Cmq1bI6kSesaFh7xVGXqw8VU7FGSLjNaas1/Vs/rwLEwhpMJDBnJvDwpXBjsrtRb/Ca5qlACUmkZH6LDmoMg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB7114

Commit 9473d9a24182 set the ASK mode without checking if there was a
`vga` option provided in the command line.  This breaks existing
behavior, so exit early without changes if `vga` is not present in the
command line.

Fixes: 9473d9a24182 ('cmdline: parse multiple instances of the vga option')
Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
Does seem to fix the broken gitlab tests:

https://gitlab.com/xen-project/people/royger/xen/-/pipelines/926397265
---
 xen/arch/x86/boot/cmdline.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/boot/cmdline.c b/xen/arch/x86/boot/cmdline.c
index 10dcc6142c85..74997703b31e 100644
--- a/xen/arch/x86/boot/cmdline.c
+++ b/xen/arch/x86/boot/cmdline.c
@@ -279,9 +279,13 @@ static void vga_parse(const char *cmdline, early_boot_opts_t *ebo)
 {
     const char *c = cmdline;
 
+    c = find_opt(c, "vga=", true);
+    if ( !c )
+        return;
+
     ebo->boot_vid_mode = ASK_VGA;
 
-    while ( (c = find_opt(c, "vga=", true)) != NULL )
+    do
     {
         unsigned int tmp, vesa_depth, vesa_height, vesa_width;
 
@@ -332,6 +336,7 @@ static void vga_parse(const char *cmdline, early_boot_opts_t *ebo)
         else if ( !strmaxcmp(c, "ask", delim_chars_comma) )
             ebo->boot_vid_mode = ASK_VGA;
     }
+    while ( (c = find_opt(c, "vga=", true)) != NULL );
 }
 #endif
 
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 14:15:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 14:15:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561225.877635 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIrfP-0007zA-CI; Mon, 10 Jul 2023 14:15:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561225.877635; Mon, 10 Jul 2023 14:15:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIrfP-0007z3-80; Mon, 10 Jul 2023 14:15:07 +0000
Received: by outflank-mailman (input) for mailman id 561225;
 Mon, 10 Jul 2023 14:15:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIrfN-0007yt-Ta; Mon, 10 Jul 2023 14:15:05 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIrfN-0008TE-SU; Mon, 10 Jul 2023 14:15:05 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIrfN-0001R5-Kc; Mon, 10 Jul 2023 14:15:05 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qIrfN-0005yh-KB; Mon, 10 Jul 2023 14:15:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=yuEcN4ugB62U77bXHFwjUaxlb+R+siy2drFspmj8/2s=; b=c5pAjfE85SL3fD3xLti+oeDlgi
	IQ2w8ADdjc2+hvFo9TcjfzwY8+hcv4Eddq8CwYIytZkFH0atl3DH5AMxHaH0EJmrdSsuC8JoZc51u
	uqivTYde3sS2yr32G9fMFET4HKGsndJBN3sX2xAkIVZ+4z9gRzbtV7gZhJh8zRknoJ0k=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181750-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181750: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=fd62986f6b776876f3028a755c859d02e55dc262
X-Osstest-Versions-That:
    xen=886c22f00c575199f7bb3dc5b7662dd09bf05146
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 10 Jul 2023 14:15:05 +0000

flight 181750 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181750/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  fd62986f6b776876f3028a755c859d02e55dc262
baseline version:
 xen                  886c22f00c575199f7bb3dc5b7662dd09bf05146

Last test of basis   181720  2023-07-06 08:00:30 Z    4 days
Testing same since   181750  2023-07-10 11:03:28 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   886c22f00c..fd62986f6b  fd62986f6b776876f3028a755c859d02e55dc262 -> smoke


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 14:16:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 14:16:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561232.877645 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIrga-00005n-Km; Mon, 10 Jul 2023 14:16:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561232.877645; Mon, 10 Jul 2023 14:16:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIrga-00005f-I9; Mon, 10 Jul 2023 14:16:20 +0000
Received: by outflank-mailman (input) for mailman id 561232;
 Mon, 10 Jul 2023 14:16:19 +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
 <SRS0=G7OO=C4=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qIrgZ-000055-EV
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 14:16:19 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 55797c73-1f2c-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 16:16:17 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.163.22.220])
 by support.bugseng.com (Postfix) with ESMTPSA id 86C7D4EE0737;
 Mon, 10 Jul 2023 16:16:15 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 55797c73-1f2c-11ee-8611-37d641c3527e
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: [XEN PATCH] x86/emul: fix violations of MISRA C:2012 Rule 8.3 on parameter names
Date: Mon, 10 Jul 2023 16:15:59 +0200
Message-Id: <149e5516d0db712916912fce8ab9c8285023e7c8.1688997768.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The headline of MISRA C:2012 Rule 8.3 states that:
"All declarations of an object or function shall use the same names and
type qualifiers".

Change parameter names to meet the following requirements:
1) keep consistency between declarations and the corresponding
   definitions thus fixing violations of the Rule 8.3;
2) use the globally-adopted shorthands (e.g., 's' to denote a 'state');
3) keep adjacent declarations consistent with respect to the parameter
   names that are used.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 54 +++++++++++++-------------
 xen/arch/x86/x86_emulate/x86_emulate.h | 26 ++++++-------
 2 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index be2e3c6b11..2de1be7996 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -8446,12 +8446,12 @@ int x86_emul_rmw(
     void *ptr,
     unsigned int bytes,
     uint32_t *eflags,
-    struct x86_emulate_state *state,
+    struct x86_emulate_state *s,
     struct x86_emulate_ctxt *ctxt)
 {
     unsigned long *dst = ptr;
 
-    ASSERT(bytes == state->op_bytes);
+    ASSERT(bytes == s->op_bytes);
 
 /*
  * We cannot use Jcc below, as this code executes with the guest status flags
@@ -8469,23 +8469,23 @@ int x86_emul_rmw(
     ".L" #op "%=:\n\t" \
     #op
 
-    switch ( state->rmw )
+    switch ( s->rmw )
     {
 #define UNOP(op) \
     case rmw_##op: \
         _emulate_1op(COND_LOCK(op), dst, bytes, *eflags, \
-                     "c" ((long)state->lock_prefix) ); \
+                     "c" ((long)s->lock_prefix) ); \
         break
 #define BINOP(op, sfx) \
     case rmw_##op: \
         _emulate_2op_SrcV##sfx(COND_LOCK(op), \
-                               state->ea.val, dst, bytes, *eflags, \
-                               "c" ((long)state->lock_prefix) ); \
+                               s->ea.val, dst, bytes, *eflags, \
+                               "c" ((long)s->lock_prefix) ); \
         break
 #define SHIFT(op) \
     case rmw_##op: \
-        ASSERT(!state->lock_prefix); \
-        _emulate_2op_SrcB(#op, state->ea.val, dst, bytes, *eflags); \
+        ASSERT(!s->lock_prefix); \
+        _emulate_2op_SrcB(#op, s->ea.val, dst, bytes, *eflags); \
         break
 
     BINOP(adc, );
@@ -8514,46 +8514,46 @@ int x86_emul_rmw(
 #undef SHIFT
 
     case rmw_not:
-        switch ( state->op_bytes )
+        switch ( s->op_bytes )
         {
         case 1:
             asm ( COND_LOCK(notb) " %0"
-                  : "+m" (*dst) : "c" ((long)state->lock_prefix) );
+                  : "+m" (*dst) : "c" ((long)s->lock_prefix) );
             break;
         case 2:
             asm ( COND_LOCK(notw) " %0"
-                  : "+m" (*dst) : "c" ((long)state->lock_prefix) );
+                  : "+m" (*dst) : "c" ((long)s->lock_prefix) );
             break;
         case 4:
             asm ( COND_LOCK(notl) " %0"
-                  : "+m" (*dst) : "c" ((long)state->lock_prefix) );
+                  : "+m" (*dst) : "c" ((long)s->lock_prefix) );
             break;
 #ifdef __x86_64__
         case 8:
             asm ( COND_LOCK(notq) " %0"
-                  : "+m" (*dst) : "c" ((long)state->lock_prefix) );
+                  : "+m" (*dst) : "c" ((long)s->lock_prefix) );
             break;
 #endif
         }
         break;
 
     case rmw_shld:
-        ASSERT(!state->lock_prefix);
+        ASSERT(!s->lock_prefix);
         _emulate_2op_SrcV_nobyte("shld",
-                                 state->ea.val, dst, bytes, *eflags,
-                                 "c" (state->ea.orig_val) );
+                                 s->ea.val, dst, bytes, *eflags,
+                                 "c" (s->ea.orig_val) );
         break;
 
     case rmw_shrd:
-        ASSERT(!state->lock_prefix);
+        ASSERT(!s->lock_prefix);
         _emulate_2op_SrcV_nobyte("shrd",
-                                 state->ea.val, dst, bytes, *eflags,
-                                 "c" (state->ea.orig_val) );
+                                 s->ea.val, dst, bytes, *eflags,
+                                 "c" (s->ea.orig_val) );
         break;
 
     case rmw_xadd:
         *eflags &= ~EFLAGS_MASK;
-        switch ( state->op_bytes )
+        switch ( s->op_bytes )
         {
             unsigned long dummy;
 
@@ -8562,11 +8562,11 @@ int x86_emul_rmw(
             asm ( "" \
                   COND_LOCK(xadd) " %"#mod"[reg], %[mem]; " \
                   _POST_EFLAGS("[efl]", "[msk]", "[tmp]") \
-                  : [reg] "+" #cst (state->ea.val), \
+                  : [reg] "+" #cst (s->ea.val), \
                     [mem] "+m" (*dst), \
                     [efl] "+g" (*eflags), \
                     [tmp] "=&r" (dummy) \
-                  : "c" ((long)state->lock_prefix), \
+                  : "c" ((long)s->lock_prefix), \
                     [msk] "i" (EFLAGS_MASK) ); \
             break
         XADD(1, q, b);
@@ -8580,21 +8580,21 @@ int x86_emul_rmw(
         break;
 
     case rmw_xchg:
-        switch ( state->op_bytes )
+        switch ( s->op_bytes )
         {
         case 1:
-            asm ( "xchg %b0, %b1" : "+q" (state->ea.val), "+m" (*dst) );
+            asm ( "xchg %b0, %b1" : "+q" (s->ea.val), "+m" (*dst) );
             break;
         case 2:
-            asm ( "xchg %w0, %w1" : "+r" (state->ea.val), "+m" (*dst) );
+            asm ( "xchg %w0, %w1" : "+r" (s->ea.val), "+m" (*dst) );
             break;
         case 4:
 #ifdef __x86_64__
-            asm ( "xchg %k0, %k1" : "+r" (state->ea.val), "+m" (*dst) );
+            asm ( "xchg %k0, %k1" : "+r" (s->ea.val), "+m" (*dst) );
             break;
         case 8:
 #endif
-            asm ( "xchg %0, %1" : "+r" (state->ea.val), "+m" (*dst) );
+            asm ( "xchg %0, %1" : "+r" (s->ea.val), "+m" (*dst) );
             break;
         }
         break;
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h
index 40d5054fb7..698750267a 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.h
+++ b/xen/arch/x86/x86_emulate/x86_emulate.h
@@ -746,36 +746,36 @@ x86_decode_insn(
         struct x86_emulate_ctxt *ctxt));
 
 unsigned int
-x86_insn_opsize(const struct x86_emulate_state *state);
+x86_insn_opsize(const struct x86_emulate_state *s);
 int
-x86_insn_modrm(const struct x86_emulate_state *state,
+x86_insn_modrm(const struct x86_emulate_state *s,
                unsigned int *rm, unsigned int *reg);
 unsigned long
-x86_insn_operand_ea(const struct x86_emulate_state *state,
+x86_insn_operand_ea(const struct x86_emulate_state *s,
                     enum x86_segment *seg);
 unsigned long
-x86_insn_immediate(const struct x86_emulate_state *state,
+x86_insn_immediate(const struct x86_emulate_state *s,
                    unsigned int nr);
 unsigned int
-x86_insn_length(const struct x86_emulate_state *state,
+x86_insn_length(const struct x86_emulate_state *s,
                 const struct x86_emulate_ctxt *ctxt);
 bool cf_check
-x86_insn_is_mem_access(const struct x86_emulate_state *state,
+x86_insn_is_mem_access(const struct x86_emulate_state *s,
                        const struct x86_emulate_ctxt *ctxt);
 bool cf_check
-x86_insn_is_mem_write(const struct x86_emulate_state *state,
+x86_insn_is_mem_write(const struct x86_emulate_state *s,
                       const struct x86_emulate_ctxt *ctxt);
 bool cf_check
-x86_insn_is_portio(const struct x86_emulate_state *state,
+x86_insn_is_portio(const struct x86_emulate_state *s,
                    const struct x86_emulate_ctxt *ctxt);
 bool cf_check
-x86_insn_is_cr_access(const struct x86_emulate_state *state,
+x86_insn_is_cr_access(const struct x86_emulate_state *s,
                       const struct x86_emulate_ctxt *ctxt);
 
 #if !defined(__XEN__) || defined(NDEBUG)
-static inline void x86_emulate_free_state(struct x86_emulate_state *state) {}
+static inline void x86_emulate_free_state(struct x86_emulate_state *s) {}
 #else
-void x86_emulate_free_state(struct x86_emulate_state *state);
+void x86_emulate_free_state(struct x86_emulate_state *s);
 #endif
 
 #ifdef __XEN__
@@ -800,7 +800,7 @@ x86_emul_rmw(
     void *ptr,
     unsigned int bytes,
     uint32_t *eflags,
-    struct x86_emulate_state *state,
+    struct x86_emulate_state *s,
     struct x86_emulate_ctxt *ctxt);
 int
 x86_emul_blk(
@@ -808,7 +808,7 @@ x86_emul_blk(
     void *data,
     unsigned int bytes,
     uint32_t *eflags,
-    struct x86_emulate_state *state,
+    struct x86_emulate_state *s,
     struct x86_emulate_ctxt *ctxt);
 
 static inline void x86_emul_hw_exception(
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 14:32:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 14:32:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561241.877655 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIrwR-0002cr-5g; Mon, 10 Jul 2023 14:32:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561241.877655; Mon, 10 Jul 2023 14:32:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIrwR-0002ck-2u; Mon, 10 Jul 2023 14:32:43 +0000
Received: by outflank-mailman (input) for mailman id 561241;
 Mon, 10 Jul 2023 14:32:41 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIrwP-0002ca-CH; Mon, 10 Jul 2023 14:32:41 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIrwP-0000Tm-9e; Mon, 10 Jul 2023 14:32:41 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIrwO-0001qm-TV; Mon, 10 Jul 2023 14:32:40 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qIrwO-0002Aa-T4; Mon, 10 Jul 2023 14:32:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=LNoQYllVfdAfyBnjHmN69p5SUnaAhlstW+Gymurp0ug=; b=rlhzh7l2t2zsALtZyrFib/Euy3
	IOXs+08FzkqBrhzhRzUIhUnmBfpe4yHkr5/MCbK9mcd4YGJkr9MpAd61dXnYAGdXq7DrwUaGtc0VE
	M+wUPOBLeXgoTuu3zIa/3lhYea64rZkHSVsxyNagVO1LUt3xkcoI1ojsiSDXln7di2LA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181751-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181751: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=63923a5642e86f386a5c719a90cfc6a929ea9cb0
X-Osstest-Versions-That:
    ovmf=96d691166f07b7ed422f9536832edadc0aea35c9
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 10 Jul 2023 14:32:40 +0000

flight 181751 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181751/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 63923a5642e86f386a5c719a90cfc6a929ea9cb0
baseline version:
 ovmf                 96d691166f07b7ed422f9536832edadc0aea35c9

Last test of basis   181724  2023-07-06 16:42:07 Z    3 days
Testing same since   181751  2023-07-10 12:40:43 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Abhi Singh <Abhi.Singh@arm.com>
  Michael Kubacki <michael.kubacki@microsoft.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   96d691166f..63923a5642  63923a5642e86f386a5c719a90cfc6a929ea9cb0 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 14:44:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 14:44:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561247.877665 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIs7M-00047s-2X; Mon, 10 Jul 2023 14:44:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561247.877665; Mon, 10 Jul 2023 14:44:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIs7L-00047l-Vw; Mon, 10 Jul 2023 14:43:59 +0000
Received: by outflank-mailman (input) for mailman id 561247;
 Mon, 10 Jul 2023 14:43: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
 <SRS0=n6vR=C4=citrix.com=prvs=54822c203=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qIs7K-00047f-6T
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 14:43:58 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 30797bcc-1f30-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 16:43:55 +0200 (CEST)
Received: from mail-dm6nam12lp2172.outbound.protection.outlook.com (HELO
 NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.172])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 10 Jul 2023 10:43:34 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by BLAPR03MB5604.namprd03.prod.outlook.com (2603:10b6:208:29a::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.26; Mon, 10 Jul
 2023 14:43:23 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2%5]) with mapi id 15.20.6565.028; Mon, 10 Jul 2023
 14:43:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 30797bcc-1f30-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689000235;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=tFbvcgh74os31cUrWj0pkXUolfB4HFEMmZRNKupogrc=;
  b=YR3VYM1V/76dA4+lxXRNqhn1XoMPjMnyfvA3PbaLzIsV85pkCFx1xQrS
   QEmLO/oRk2cqwWmOcLJlweSjG6Ohioa/6riRGD90v9Weceaaa+q+k84zc
   gBDoUQPVfBlnmoet4hnnd6fUqR4saIM5T0xLLZcqIXEW4JeeQxPuOihAu
   M=;
X-IronPort-RemoteIP: 104.47.59.172
X-IronPort-MID: 116133184
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:ZRlsDqn9KZbMYdba42fRV5To5gygJ0RdPkR7XQ2eYbSJt1+Wr1Gzt
 xJOCmqOMqzfNGP9fYtyat+z/UsFvsPWnNc1TgBspHhjEiMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5QeGzhH5MbpETU2PByqgKmVrNrbSq
 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/
 f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3
 dtbBhMNRDeRu/iVmq6mQcBnjP8Kdsa+aevzulk4pd3YJdAPZMmZBonvu5pf1jp2gd1SF/HDY
 cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVkV03iee3WDbWUoXiqcF9hEGXq
 3iA523kKhobKMae2XyO9XfEaurnxHqlAdlJTe3knhJsqH/MxnBOJUI7b0qyuNOzm2vhUOJcM
 WVBr0LCqoB3riRHVOLVXRe1vXqFtR40QMdLHqsx7wTl4rXQyxaUAC4DVDEpQMwrsoo6SCIn0
 neNnsj1Hnp/vbuNU3Wf+7yI6zSoNkAowXQqYCYFSU4J5oflqYRq1BbXFI88Suiyk8H/Hiz2z
 3aSti8iir4PjMkNkaKm4VTAhDHqrZ/MJuIo2jjqsquexlsRTOaYi0aAsgazASpoRGpBcmS8g
 Q==
IronPort-HdrOrdr: A9a23:THWblagHuOv53mDXs/6jor7+TnBQXuAji2hC6mlwRA09TyX+ra
 yTdZUguiMc7Qx7ZJhOo7690cW7IE80l6QFgrX5TI3DYOCOggLBRuxfBODZsl/d8kPFh4lg/J
 YlX69iCMDhSXhW5PyKhjVQyuxQpeVvJprY4dvj8w==
X-Talos-CUID: 9a23:SMWduG3j93iNHWujhj+wPrxfPYMLUX3362XsOWziFXtiYbafcnbK9/Yx
X-Talos-MUID: 9a23:KSGTXAt89iWNL075sc2npm5iKJpFvImUGUkUu58XnpaPBS9qEmLI
X-IronPort-AV: E=Sophos;i="6.01,194,1684814400"; 
   d="scan'208";a="116133184"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ZI94pnTqwwAo6/PEcJMtNQJ3VJ3ap37k6Y4quwK8LY1F+/nhV8BTpYKxYEiBEixq22AMd1+pYrqtwrx522SlurVzJ+HqCboihNwWdPIT1c+33Uwo3tXozmuy4FZWiRJoTr24vSUaWi2QL0yM6/QXH9KGg9ni1HK8gtRq3p3/QD+79bn/ChOUx3yawqMWYrmC/nsVVjcJZeQNmYeowQ6lkONccu6d/jnNvqUF0kK2XgrMk8Ohq0fNO7NlAfB9JDeJ0HyTYwhBqALj7hSR66dNrBrf3Ntzvt6meeZwtKRQklQ2ys1KOQIQMh77xAX8kPhPMj48DSrrOu6bWFXBmj2fMQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=P+Om8Az9LxQaT164FstBhBo5DJ8kmbPInUPpxTaDWlk=;
 b=lLRp98bt7Kno3z6ckzxQs0sleFhyMW3OSIqnHbc5ah3w4ECR/+55CbQPjiaOcCi4PntEIq1wHrbI98Wd1A2YaoGrNod9svPkavfrTxqfLlzoIA7DjsC9+T3tHMZGfHCEAvC2I/5CqA6dAE/jzHRJV4nD7rzbU98Q5VDsMLFMW6RS4eXzR0CBHE7oaknwLSdjeiS+xxdaJs5KgIzg8nJoSt7XTNBLPyoiKX/WR18fTsoe8xpqY6XzWsI6VrXoYsUjsImdMCMdxrwvYHSEMHSSvc1wh8/lAZ/m2ePFilyySZ0tk968EVB/i+lY0HURkJq23GjuuxI9OF83EsWnRIDQKw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=P+Om8Az9LxQaT164FstBhBo5DJ8kmbPInUPpxTaDWlk=;
 b=t0Lu7/cCjtAWoBIu+frUtjVLkHY2rCOgVfy97znzHU2iW1mAruAvH7UnS6MIbbll3KCtWE90jd8WQX/BalLll0UeryqFrTkgJoEqfmuzYJ5aClaBoi6W0xLdaZQpIMha406n8+0zCEFJeVua3JlzpgRXOJhiV8vrgwCyLix9Hzs=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Mon, 10 Jul 2023 16:43:17 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] x86/ioapic: sanitize IO-APIC pins before enabling the
 local APIC
Message-ID: <ZKwZBQ_0Z2c7NJNL@MacBook-Air-de-Roger.local>
References: <20230707095338.44244-1-roger.pau@citrix.com>
 <92d16012-ff9f-693b-07c6-d45fe07a00a0@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <92d16012-ff9f-693b-07c6-d45fe07a00a0@suse.com>
X-ClientProxiedBy: LO6P123CA0036.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:2fe::10) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|BLAPR03MB5604:EE_
X-MS-Office365-Filtering-Correlation-Id: 0eca592f-7f83-4968-de15-08db8154031d
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	mK+N9GB22pxuss/QvaU7Qt/IL0EX2CGPP9gUrbs9cHkY7Cb1DlStMDqwCHCZ0+xD2xbyrzfxt3B1gg4WWF4W0e80zSJmhnhqnqkpWYW3O1E/l33B3h+n4RPpa0GdB4vCIi3+iX3ZD0EnCBFnjGoyz5IFxbl5lPayYavRKhzgRoRgG3U8TKy+FIBpm1tZMX3g21s+jXfsrtPVYa5Bzm0pV13sZ5eRU0DbYxpQzevWoKe1nI32tdJ3c1m0BoIritUanvkuYUBKi6LjVxNrCAZMhwb5JM6iC0ZqB27xe8s/L/FnHwuUCNxK1kusfLQ+TJUkZ2TVMjdN2QOsMCZw2DJvHoih4QJGDFIxIm1zMO/ceXr5pSR7dLNI32N5vebeqS19tYksAP9HXs6wmsKyjDxTftI6MIBw1M5N388FKL1ZmgYFV4cm9YIxo4gMdiNvm62KWccR4jVd4oiBQQNMXZ68QGkL54t6HUH/81yAYDi60QotdRfxGZD1xGGgydAbbrD5nkbiTqXVPKOVSR/3T96+A0JpayuSN7Jrz3ha+2D1pM+VKS3uj6VqX3u4O3bL7fkg
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(366004)(136003)(346002)(396003)(376002)(451199021)(6512007)(6486002)(9686003)(6666004)(478600001)(54906003)(53546011)(186003)(6506007)(26005)(2906002)(6916009)(4326008)(66476007)(66556008)(8676002)(41300700001)(66946007)(8936002)(82960400001)(5660300002)(38100700002)(85182001)(316002)(86362001)(83380400001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RUdVUWNKMktUQnFoangxdFExcEhnVmoxaEVxMURyUnpUL0orSi84dnBmRmlS?=
 =?utf-8?B?eWlWc3paeXVWT0NySGFLRVJtVXg1eFRRYTBJa3E4Y1JGN0pGcWtkZUJsOU41?=
 =?utf-8?B?djVsY2txTFBjdUpkck5pMzVzbTJvM0NoMkpCNHhqRU5hc2dYaXpsT2tqQXNI?=
 =?utf-8?B?ZU5UK0JQNGFrQVdDSUN3YVh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rvB0bw3Fw5BBDsvtj5SX5xoe4VbgWw22LagSuauTf5sJL2J+29BIXeyyt54JtKQ0C
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0eca592f-7f83-4968-de15-08db8154031d
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 14:43:23.5453
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: oHcn6MryDI734cgMtV/P7UYVGEOJo4S/wkhc9mfWdDNBtq0+LluLKinhdyuP5dMDl0kKifGPUXFNUND5AAv5Pw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR03MB5604

On Mon, Jul 10, 2023 at 12:56:27PM +0200, Jan Beulich wrote:
> On 07.07.2023 11:53, Roger Pau Monne wrote:
> > The current logic to init the local APIC and the IO-APIC does init the
> > former first before doing any kind of sanitation on the IO-APIC pin
> > configuration.  It's already noted on enable_IO_APIC() that Xen
> > shouldn't trust the IO-APIC being empty at bootup.
> > 
> > At XenServer we have a system where the IO-APIC 0 is handed to Xen
> > with pin 0 unmasked, set to Fixed delivery mode, edge triggered and
> > with a vector of 0 (all fields of the RTE are zeroed).  Once the local
> > APIC is enabled periodic injections from such pin cause a storm of
> > errors:
> > 
> > APIC error on CPU0: 00(40), Received illegal vector
> > APIC error on CPU0: 40(40), Received illegal vector
> > APIC error on CPU0: 40(40), Received illegal vector
> > APIC error on CPU0: 40(40), Received illegal vector
> > APIC error on CPU0: 40(40), Received illegal vector
> > APIC error on CPU0: 40(40), Received illegal vector
> > 
> > That prevents Xen from booting.
> 
> And I expect no RTE is in ExtInt mode, so one might conclude that
> firmware meant to set up RTE 0 that way. Mainly as a remark, albeit
> of course there's then the question whether to change the RTE
> rather than masking it. What do ACPI tables say?

There's one relevant override:

[668h 1640   1]                Subtable Type : 02 [Interrupt Source Override]
[669h 1641   1]                       Length : 0A
[66Ah 1642   1]                          Bus : 00
[66Bh 1643   1]                       Source : 00
[66Ch 1644   4]                    Interrupt : 00000002
[670h 1648   2]        Flags (decoded below) : 0000
                                    Polarity : 0
                                Trigger Mode : 0

So IRQ 0 -> GSI 2, so it's likely pin 0 is the one the i8259 is
connected to.

> > Fix this by moving the masking of IO-APIC pins ahead of the enabling
> > of the local APIC.  Note that before doing such masking Xen attempts
> > to detect the pin where the legacy i8259 is connected, and that logic
> > relies on the pin being unmasked, hence the logic is also moved ahead
> > of enabling the local APIC.
> 
> A comma after "masking" might help readers here.
> 
> > --- a/xen/arch/x86/apic.c
> > +++ b/xen/arch/x86/apic.c
> > @@ -1476,6 +1476,10 @@ int __init APIC_init_uniprocessor (void)
> >          return -1;
> >      }
> >  
> > +    if ( smp_found_config && !skip_ioapic_setup && nr_ioapics )
> > +        /* Sanitize the IO-APIC pins before enabling the local APIC. */
> > +        sanitize_IO_APIC();
> 
> I'm a little puzzled by the smp_found_config part of the check here,
> but not in smp_prepare_cpus(). What's the reason for (a) the check
> and (b) the difference?

This just mimics what gates the call to setup_IO_APIC() in that same
function.  It makes no sense to call sanitize_IO_APIC() if
setup_IO_APIC() is not called, and I wasn't planning on changing the
logic that gates the call setup_IO_APIC() in this patch.

I did note the difference with smp_prepare_cpus(), and I think we
should look at unifying those paths, but didn't want to do it as part
of this fix.

> Isn't checking nr_ioapics sufficient in this
> regard? (b) probably could be addressed by moving the code to the
> beginning of verify_local_APIC(), immediately ahead of which you
> insert both call sites. (At which point the function may want naming
> verify_IO_APIC() for consistency, but that's surely minor.)

I wanted the call to sanitize_IO_APIC() to be done at the same level
where the call to setup_IO_APIC() is done, because it makes the logic
clearer.

> As to also checking skip_ioapic_setup - wouldn't the unmasked pin be
> similarly troublesome in that case?

skip_ioapic_setup is set when the IO-APIC address in the MADT is
invalid, so in that case attempting to access IO-APIC registers in
that case won't lead to anything good.

> Aiui it would not hurt only if
> the LAPIC also isn't (going to be) set up. Then again the flag,
> among other things, signals a zero base address found in the ACPI or
> MP tables, so I guess this is a (largely) separate issue anyway.

Oh, yes, indeed.  See my reply above.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 14:44:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 14:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561248.877674 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIs7k-0004YE-AL; Mon, 10 Jul 2023 14:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561248.877674; Mon, 10 Jul 2023 14:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIs7k-0004Y7-7M; Mon, 10 Jul 2023 14:44:24 +0000
Received: by outflank-mailman (input) for mailman id 561248;
 Mon, 10 Jul 2023 14:44:22 +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
 <SRS0=GfHP=C4=citrix.com=prvs=5481289c3=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qIs7i-00047f-Nz
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 14:44:22 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3f8b1b0f-1f30-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 16:44:20 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3f8b1b0f-1f30-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689000260;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=+EK84p46jC8k7/l1l8jwQdVOxR0UvOyZam0nXNphh5I=;
  b=M2T7/4a4lvQx6Aj6at2mTRM7VwtAZkyj6hM1tHpr8LY1dx/bd2Ljtjjq
   n9kEmCNuD2QiSsZudJIaTJsCW4v3zEKbZ6i8ZGMkFRItyYHP4rikzKhBW
   axEwQRUl25yhKs+hOsqogXXKHep0XNbPVtv16pkCTu4AvEiSDayopf2wa
   A=;
Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 115725821
X-Ironport-Server: esa3.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:9JmjMq25zls9majHEPbD5T9xkn2cJEfYwER7XKvMYLTBsI5bp2EEy
 TQYCGqAOq6MZGunf4p0aY+0oB4G7ZTXn9NqHgU/pC1hF35El5HIVI+TRqvS04F+DeWYFR46s
 J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo
 tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5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nMXWMheKiA==
IronPort-HdrOrdr: A9a23:wU6goKnT9y0wSUytAfgGHizvPP7pDfLc3DAbv31ZSRFFG/Fw9/
 rCoB17726StN91YhsdcL+7V5VoLUmzyXcx2/hzAV7AZniDhILLFuFfBOLZqlWNJ8S9zJ8+6U
 4JScND4bbLfD1HZKjBgTVRE7wbsaW6GKLDv5ag85+6JzsaFZ2J7G1Ce3em+lUdfnghOXKgfq
 DsnPauoVCbCA0qR/X+PFYpdc7ZqebGkZr3CCR2eiLOuGG1/EuVAKeRKWni4isj
X-Talos-CUID: =?us-ascii?q?9a23=3AhPC0mGryQ2RsdlmSzxQ6kwbmUdEBQFCCj2jUGE6?=
 =?us-ascii?q?5JUFEVp7EZ1as2rwxxg=3D=3D?=
X-Talos-MUID: 9a23:+9peAgk2z2/MCeE+e1ARdnp+Dd5M/I68InsPgLpf4oquNTFMIzaS2WE=
X-IronPort-AV: E=Sophos;i="6.01,194,1684814400"; 
   d="scan'208";a="115725821"
Date: Mon, 10 Jul 2023 15:43:43 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Peter Hoyes <peter.hoyes@arm.com>
CC: <xen-devel@lists.xenproject.org>, <bertrand.marquis@arm.com>,
	<wei.chen@arm.com>, <luca.fancellu@arm.com>, Wei Liu <wl@xen.org>, Juergen
 Gross <jgross@suse.com>
Subject: Re: [PATCH v3 2/2] xl: Add escape character argument to xl console
Message-ID: <3c1a169b-3d3b-43e5-8f90-f8c09a5ac82d@perard>
References: <20230622141248.459133-1-peter.hoyes@arm.com>
 <20230622141248.459133-2-peter.hoyes@arm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230622141248.459133-2-peter.hoyes@arm.com>

On Thu, Jun 22, 2023 at 03:12:48PM +0100, Peter Hoyes wrote:
> diff --git a/tools/include/libxl.h b/tools/include/libxl.h
> index cac641a7eb..c513c39483 100644
> --- a/tools/include/libxl.h
> +++ b/tools/include/libxl.h
> @@ -1958,7 +1958,8 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass);
>   * the caller that it has connected to the guest console.
>   */
>  int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
> -                       libxl_console_type type, int notify_fd);
> +                       libxl_console_type type, int notify_fd,
> +                       char* escape_character);

So, this is changing the libxl API, it's possible, but it's going to be
a bit more complicated than that.

You'll need to:

- Increment LIBXL_API_VERSION, well more like allow a new api version.
  That's adding 0x041800 to the list of allowed value for
  LIBXL_API_VERSION, at around line 793 in "libxl.h", just before
  "#error Unknown LIBXL_API_VERSION".

- Introduce API compatible caller for earlier API version.
  A good example of this done would be
  libxl_retrieve_domain_configuration_0x041200().
  Actually, there's already some changed been made in the past to
  libxl_console_exec() and libxl_primary_console_exec(), so those are
  probably better example and need to modified.

- Introduce LIBXL_HAVE_* macro in libxl.h to advertise the new arg.
  There's already LIBXL_HAVE_CONSOLE_NOTIFY_FD, so I guess the new macro
  could be named LIBXL_HAVE_CONSOLE_ESCAPE_CHARACTER.


>  /* libxl_primary_console_exec finds the domid and console number
>   * corresponding to the primary console of the given vm, then calls
>   * libxl_console_exec with the right arguments (domid might be different
> @@ -1968,9 +1969,12 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
>   * guests using pygrub.
>   * If notify_fd is not -1, xenconsole will write 0x00 to it to nofity
>   * the caller that it has connected to the guest console.
> + * If escape_character is not NULL, the provided value is used to exit
> + * the guest console.
>   */
>  int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm,
> -                               int notify_fd);
> +                               int notify_fd,
> +                               char* escape_character);
>  
>  #if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040800
>  
> diff --git a/tools/libs/light/libxl_console.c b/tools/libs/light/libxl_console.c
> index f497be141b..0b7293fe71 100644
> --- a/tools/libs/light/libxl_console.c
> +++ b/tools/libs/light/libxl_console.c
> @@ -75,15 +76,26 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
>          goto out;
>      }
>  
> +    char *args[] = {
> +        p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
> +        NULL, NULL, NULL, NULL, // start-notify-fd, escape
> +        NULL, // list terminator - do not use
> +    };
> +    char **args_extra = args + 6;
> +
>      if (notify_fd != -1) {
>          notify_fd_s = GCSPRINTF("%d", notify_fd);
> -        execl(p, p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
> -              "--start-notify-fd", notify_fd_s, (void *)NULL);
> -    } else {
> -        execl(p, p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
> -              (void *)NULL);
> +        *args_extra++ = "--start-notify-fd";
> +        *args_extra++ = notify_fd_s;
>      }
>  
> +    if (escape_character) {
> +        *args_extra++ = "--escape";
> +        *args_extra++ = escape_character;
> +    }

There is flexarray_* that could be use, but I guess a preset `*args`
kind of work here.

> +
> +    execv(p, args);
> +
>  out:
>      GC_FREE;
>      return ERROR_FAIL;
> diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
> index ccf4d83584..67604e9536 100644
> --- a/tools/xl/xl_cmdtable.c
> +++ b/tools/xl/xl_cmdtable.c
> @@ -141,7 +141,8 @@ const struct cmd_spec cmd_table[] = {
>        "Attach to domain's console",
>        "[options] <Domain>\n"
>        "-t <type>       console type, pv , serial or vuart\n"
> -      "-n <number>     console number"
> +      "-n <number>     console number\n"
> +      "-e <escape>     escape character"

Could you also update "docs/man/xl.1.pod.in" with this new option?

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 15:23:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 15:23:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561257.877685 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIsj6-0000bS-7x; Mon, 10 Jul 2023 15:23:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561257.877685; Mon, 10 Jul 2023 15:23:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIsj6-0000bL-4d; Mon, 10 Jul 2023 15:23:00 +0000
Received: by outflank-mailman (input) for mailman id 561257;
 Mon, 10 Jul 2023 15:22:59 +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
 <SRS0=ppwN=C4=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qIsj5-0000bF-6T
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 15:22:59 +0000
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com
 [2a00:1450:4864:20::134])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a47f1e9d-1f35-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 17:22:55 +0200 (CEST)
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-4fafe87c6fbso7159990e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 10 Jul 2023 08:22:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a47f1e9d-1f35-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689002574; x=1691594574;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Yu4f3oYsFCpzKIzOIndWgEiO2yGPNwpVmsrVjHpIEWQ=;
        b=T0cmE2+lD7R4oWkjFSczmQHMi7cUWTdr8T7Jn59II55r0ruEWNmflpCgtL8esybEPl
         qiF3Iw7dnoX33Ads5Y+hNVnXiFmnPvbfQHzjSJqpm6sKT7GxdT32bQggX5HSa12LkNxY
         ykWolqTjiGcAEpuFjpxKmAW4LWDVPSvWOGp8TEVVAgL0/gxIsTPoQ8SYJoQv2y/TrC2W
         Wpmw77tWhph3ROcsEX/rr++c0THxXyo/JIRpqhoHpWv8R2+wUTi2W4SCNwZxQTcFpEbc
         P1UPlnB6X+ZftHMY7SNBdy7ngxzEdoFedc4/yVbIf86RlbNKOrLoRjWgxoDY/dCGGbbY
         z8OQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689002574; x=1691594574;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=Yu4f3oYsFCpzKIzOIndWgEiO2yGPNwpVmsrVjHpIEWQ=;
        b=WrLUDrNJ22eZiT/B2y25XPP9QoNwrMBT6FRYb+xRr59ZtlIHJ3JIxIu76tssPRLAlZ
         1H33+usQTL4dxEYjpWAFEs52+rgcTjNN+cVu+eLvrvscjKAA9JqfTQZp/bVhK6WixbUt
         9j1/uqdU+KS2+kAE/gd6Qc0pmsw6F1OL1ldIDb1UNz6OqaGP+rymB76KHnpaYO3dw3Aa
         /RqPM8NPhib71ReSEPSSFgJmVpW9neHrKIBMaGMigcxqaGQQ5pRzjQSvtltlbXfvm+tE
         dUKa+CmBQGKLTZ/SiHWoWZenuCvCCAEahjSUrQETqiM5DD0URxDxDHYqloM5aZdMnl0b
         m/mQ==
X-Gm-Message-State: ABy/qLbftJzUQM94M41AiEecKaBV8rmnsHXMgEzl8JYgM63vN/5yYiXR
	o4gsy973jvjRbBmTEaeMZPkAlELc8oWaqjgQZ00=
X-Google-Smtp-Source: APBJJlHdR5/ez3Rx8xhwx6sklaPbkz7SlJ27Xvj0MvKHZYhpF3B9zgX0EB28wn6jUSSpQxn+ZKZdOASU6EFGw4tGAYQ=
X-Received: by 2002:a05:6512:10cf:b0:4f3:d682:7b1c with SMTP id
 k15-20020a05651210cf00b004f3d6827b1cmr11897289lfg.45.1689002573838; Mon, 10
 Jul 2023 08:22:53 -0700 (PDT)
MIME-Version: 1.0
References: <20230706185440.48333-1-jandryuk@gmail.com> <20230706185440.48333-7-jandryuk@gmail.com>
 <eeeb032f-a21b-5eb2-e3d5-63357a04a500@suse.com>
In-Reply-To: <eeeb032f-a21b-5eb2-e3d5-63357a04a500@suse.com>
From: Jason Andryuk <jandryuk@gmail.com>
Date: Mon, 10 Jul 2023 11:22:41 -0400
Message-ID: <CAKf6xptn0OL0qz+DW9qrwU=sFSKSp-O3S7z6vFbZp9RstFanbw@mail.gmail.com>
Subject: Re: [PATCH v5 06/15] cpufreq: Add Hardware P-State (HWP) driver
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, 
	Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Jul 10, 2023 at 9:13=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wro=
te:
>
> On 06.07.2023 20:54, Jason Andryuk wrote:
> > @@ -510,6 +510,22 @@ choice of `dom0-kernel` is deprecated and not supp=
orted by all Dom0 kernels.
> >  * `<maxfreq>` and `<minfreq>` are integers which represent max and min=
 processor frequencies
> >    respectively.
> >  * `verbose` option can be included as a string or also as `verbose=3D<=
integer>`
> > +  for `xen`.  It is a boolean for `hwp`.
> > +* `hwp` selects Hardware-Controlled Performance States (HWP) on suppor=
ted Intel
> > +  hardware.  HWP is a Skylake+ feature which provides better CPU power
> > +  management.  The default is disabled.  If `hwp` is selected, but har=
dware
> > +  support is not available, Xen will fallback to cpufreq=3Dxen.
> > +* `<hdc>` is a boolean to enable Hardware Duty Cycling (HDC).  HDC ena=
bles the
> > +  processor to autonomously force physical package components into idl=
e state.
> > +  The default is enabled, but the option only applies when `hwp` is en=
abled.
> > +
> > +There is also support for `;`-separated fallback options:
> > +`cpufreq=3Dhwp,verbose;xen`.  This first tries `hwp` and falls back to=
 `xen`
> > +if unavailable.
>
> In the given example, does "verbose" also apply to the fallback case? If =
so,
> perhaps better "cpufreq=3Dhwp;xen,verbose", to eliminate that ambiguity?

Yes, "verbose" is applied to both.  I can make the change.  I
mentioned it in the commit message, but I'll mention it here as well.

> > --- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
> > +++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
> > @@ -642,7 +642,24 @@ static int __init cf_check cpufreq_driver_init(voi=
d)
> >          switch ( boot_cpu_data.x86_vendor )
> >          {
> >          case X86_VENDOR_INTEL:
> > -            ret =3D cpufreq_register_driver(&acpi_cpufreq_driver);
> > +            unsigned int i;
>
> At the moment we still don't mix declarations and statements, i.e. all
> declarations have to be at the top of a block/scope. What iirc we do use
> in a couple of places (and what hence you may want to do here as well) is
> ...
>
> > +            ret =3D -ENOENT;
> > +
> > +            for ( i =3D 0; i < cpufreq_xen_cnt; i++ )
>
> ... declare the induction variable inside the loop header.

Sounds good, thanks.

> > +            {
> > +                switch ( cpufreq_xen_opts[i] )
> > +                {
> > +                case CPUFREQ_xen:
> > +                    ret =3D cpufreq_register_driver(&acpi_cpufreq_driv=
er);
> > +                    break;
> > +                case CPUFREQ_hwp:
> > +                    ret =3D hwp_register_driver();
> > +                    break;
> > +                }
> > +
> > +                if ( ret =3D=3D 0 )
> > +                    break;
> > +            }
> >              break;
>
> In this model any kind of failure results in the fallback to be tried
> (and the fallback's error to be returned to the caller rather than
> the primary one). This may or may not be what we actually want;
> personally I would have expected
>
>                 if ( ret !=3D -ENODEV )
>                     break;
>
> or some such instead.

I guess this comes back to our fruit preferences. :)

I can switch it around like that, and make hwp_register_driver()
return -ENODEV for hwp_available() returning false.

> > +static bool hwp_handle_option(const char *s, const char *end)
> > +{
> > +    int ret;
> > +
> > +    ret =3D parse_boolean("verbose", s, end);
> > +    if ( ret >=3D 0 ) {
>
> Nit: Style (brace placement).
>
> > +        cpufreq_verbose =3D ret;
> > +        return true;
> > +    }
> > +
> > +    ret =3D parse_boolean("hdc", s, end);
> > +    if ( ret >=3D 0 ) {
>
> Same here.

Thanks.  Sorry about those.

> > +        opt_cpufreq_hdc =3D ret;
> > +        return true;
> > +    }
> > +
> > +    return false;
> > +}
> > +
> > +int __init hwp_cmdline_parse(const char *s, const char *e)
> > +{
> > +    do
> > +    {
> > +        const char *end =3D strpbrk(s, ",;");
> > +
> > +        if ( s && !hwp_handle_option(s, end) )
>
> This check of s not being NULL comes too late, as strpbrk() would have
> de-referenced it already. Considering ...
>
> > +        {
> > +            printk(XENLOG_WARNING "cpufreq/hwp: option '%s' not recogn=
ized\n",
> > +                   s);
> > +
> > +            return -1;
> > +        }
> > +
> > +        s =3D end ? ++end : end;
> > +    } while ( s && s < e );
>
> ... this it probably wants to move even ahead of the loop.

I'll switch from do/while to just while and then the NULL check will
be covered.  In practice, this function is never called with s =3D=3D
NULL.

> > +static int hdc_set_pkg_hdc_ctl(unsigned int cpu, bool val)
> > +{
> > +    uint64_t msr;
> > +
> > +    if ( rdmsr_safe(MSR_PKG_HDC_CTL, msr) )
> > +    {
> > +        hwp_err(cpu, "rdmsr_safe(MSR_PKG_HDC_CTL)\n");
> > +        return -1;
> > +    }
> > +
> > +    if ( val )
> > +        msr |=3D PKG_HDC_CTL_HDC_PKG_ENABLE;
> > +    else
> > +        msr &=3D ~PKG_HDC_CTL_HDC_PKG_ENABLE;
> > +
> > +    if ( wrmsr_safe(MSR_PKG_HDC_CTL, msr) )
> > +    {
> > +        hwp_err(cpu, "wrmsr_safe(MSR_PKG_HDC_CTL): %016lx\n", msr);
> > +        return -1;
> > +    }
> > +
> > +    return 0;
> > +}
>
> Please can you use either boolean return values or proper 0 / -errno
> ones? (Same again then in the subsequent function.)

Sure, I'll use booleans.

> > +static void cf_check hwp_init_msrs(void *info)
> > +{
> > +    struct cpufreq_policy *policy =3D info;
> > +    struct hwp_drv_data *data =3D this_cpu(hwp_drv_data);
> > +    uint64_t val;
> > +
> > +    /*
> > +     * Package level MSR, but we don't have a good idea of packages he=
re, so
> > +     * just do it everytime.
> > +     */
> > +    if ( rdmsr_safe(MSR_PM_ENABLE, val) )
> > +    {
> > +        hwp_err(policy->cpu, "rdmsr_safe(MSR_PM_ENABLE)\n");
> > +        data->curr_req.raw =3D -1;
> > +        return;
> > +    }
> > +
> > +    /* Ensure we don't generate interrupts */
> > +    if ( feature_hwp_notification )
> > +        wrmsr_safe(MSR_HWP_INTERRUPT, 0);
> > +
> > +    hwp_verbose("CPU%u: MSR_PM_ENABLE: %016lx\n", policy->cpu, val);
> > +    if ( !(val & PM_ENABLE_HWP_ENABLE) )
> > +    {
> > +        val |=3D PM_ENABLE_HWP_ENABLE;
> > +        if ( wrmsr_safe(MSR_PM_ENABLE, val) )
> > +        {
> > +            hwp_err(policy->cpu, "wrmsr_safe(MSR_PM_ENABLE, %lx)\n", v=
al);
> > +            data->curr_req.raw =3D -1;
> > +            return;
> > +        }
> > +    }
> > +
> > +    if ( rdmsr_safe(MSR_HWP_CAPABILITIES, data->hwp_caps) )
> > +    {
> > +        hwp_err(policy->cpu, "rdmsr_safe(MSR_HWP_CAPABILITIES)\n");
> > +        goto error;
> > +    }
> > +
> > +    if ( rdmsr_safe(MSR_HWP_REQUEST, data->curr_req.raw) )
> > +    {
> > +        hwp_err(policy->cpu, "rdmsr_safe(MSR_HWP_REQUEST)\n");
> > +        goto error;
> > +    }
> > +
> > +    /*
> > +     * Check for APERF/MPERF support in hardware
> > +     * also check for boost/turbo support
> > +     */
> > +    intel_feature_detect(policy);
> > +
> > +    if ( feature_hdc )
> > +    {
> > +        if ( hdc_set_pkg_hdc_ctl(policy->cpu, opt_cpufreq_hdc) ||
> > +             hdc_set_pm_ctl1(policy->cpu, opt_cpufreq_hdc) ) {
>
> Please can these two if()s be joined and the well-placed brace be
> retained?

Sure.

> > +            hwp_err(policy->cpu, "Disabling HDC support\n");
> > +            feature_hdc =3D false;
> > +            goto error;
>
> Why? Can't you continue just with HDC turned off?

Yes, that is what I intended to implement after your earlier review,
but I failed to actually delete the goto.

> > +static void cf_check hwp_write_request(void *info)
> > +{
> > +    const struct cpufreq_policy *policy =3D info;
> > +    struct hwp_drv_data *data =3D this_cpu(hwp_drv_data);
> > +    union hwp_request hwp_req =3D data->curr_req;
> > +
> > +    data->ret =3D 0;
> > +
> > +    BUILD_BUG_ON(sizeof(union hwp_request) !=3D sizeof(hwp_req.raw));
>
> You changed only the right side to not be sizeof(<type>).

Updated.  I was just focused on removing the uint64_t from your earlier com=
ment.

> > +static int cf_check hwp_cpufreq_cpu_init(struct cpufreq_policy *policy=
)
> > +{
> > +    unsigned int cpu =3D policy->cpu;
> > +    struct hwp_drv_data *data;
> > +
> > +    data =3D xzalloc(struct hwp_drv_data);
> > +    if ( !data )
> > +        return -ENOMEM;
> > +
> > +    policy->governor =3D &cpufreq_gov_hwp;
> > +
> > +    per_cpu(hwp_drv_data, cpu) =3D data;
> > +
> > +    on_selected_cpus(cpumask_of(cpu), hwp_init_msrs, policy, 1);
>
> Could I talk you into moving the helper function immediately ahead of
> this (sole) one using it, much like you have it for hwp_cpufreq_target()
> and hwp_write_request()?

Yes. sounds good.  I'll move hdc_set_pkg_hdc_ctl(), hdc_set_pm_ctl1(),
hwp_get_cpu_speeds() as well since they are all called by
hwp_init_msrs().

> > +    if ( data->curr_req.raw =3D=3D -1 )
> > +    {
> > +        hwp_err(cpu, "Could not initialize HWP properly\n");
> > +        per_cpu(hwp_drv_data, cpu) =3D NULL;
> > +        xfree(data);
> > +        return -ENODEV;
> > +    }
> > +
> > +    data->minimum =3D data->curr_req.min_perf;
> > +    data->maximum =3D data->curr_req.max_perf;
> > +    data->desired =3D data->curr_req.desired;
> > +    data->energy_perf =3D data->curr_req.energy_perf;
> > +    data->activity_window =3D data->curr_req.activity_window;
> > +
> > +    if ( cpu =3D=3D 0 )
> > +        hwp_verbose("CPU%u: HWP_CAPABILITIES: %016lx\n", cpu, data->hw=
p_caps);
>
> While I'm fine with this (perhaps apart from you using "cpu =3D=3D 0",
> which is an idiom we're trying to get rid of), ...

Oh, I didn't know that.  What is the preferred way to identify the
BSP?  This doesn't necessarily run on the BSP, so "cpu"/"policy->cpu"
is all we have to make a determination.

> > +    hwp_verbose("CPU%u: rdmsr HWP_REQUEST %016lx\n", cpu, data->curr_r=
eq.raw);
>
> ... this once-per-CPU message still looks to verbose to me. Perhaps
> for both:
> - print for the BSP,
> - print when AP value differs from BSP (albeit I don't know how
> [un]likely that is)?

On my test systems, the values have all been identical.  But your
differing values idea seems good.

> > +static int cf_check hwp_cpufreq_cpu_exit(struct cpufreq_policy *policy=
)
> > +{
> > +    struct hwp_drv_data *data =3D per_cpu(hwp_drv_data, policy->cpu);
> > +    per_cpu(hwp_drv_data, policy->cpu) =3D NULL;
> > +    xfree(data);
>
> Nit: Style (blank line between declaration(s) and statement(s) please.
> (Also at least once again below.)
>
> > --- a/xen/drivers/cpufreq/cpufreq.c
> > +++ b/xen/drivers/cpufreq/cpufreq.c
> > @@ -63,12 +63,18 @@ LIST_HEAD_READ_MOSTLY(cpufreq_governor_list);
> >  /* set xen as default cpufreq */
> >  enum cpufreq_controller cpufreq_controller =3D FREQCTL_xen;
> >
> > -static int __init cpufreq_cmdline_parse(const char *s);
> > +enum cpufreq_xen_opt cpufreq_xen_opts[2] =3D { CPUFREQ_xen, };
> > +unsigned int cpufreq_xen_cnt =3D 1;
>
> Looks like both can be __initdata?

Yes, thanks.

> As to the array initializer: For one Misra won't like the 2nd slot not
> initialized. Plus the implicit 0 there is nothing else than CPUFREQ_xen,
> which also ends up a little fragile. Perhaps 0 wants to stand for
> CPUFREQ_none (or whatever name you deem appropriate)?

:) I had a CPUFREQ_none originally, but dropped it as there was no
need for one with cpufreq_xen_cnt controlling the iteration.  I'll add
it back.  (gcc 12 at least complains that the switch in
cpufreq_driver_init() needs to handle CPUFREQ_none, so I'll just have
it return 0 in that case.)

Thanks for the review.

Regards,
Jason


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 15:53:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 15:53:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561263.877695 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qItC3-00042P-ID; Mon, 10 Jul 2023 15:52:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561263.877695; Mon, 10 Jul 2023 15:52:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qItC3-00042I-FA; Mon, 10 Jul 2023 15:52:55 +0000
Received: by outflank-mailman (input) for mailman id 561263;
 Mon, 10 Jul 2023 15:52:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=n6vR=C4=citrix.com=prvs=54822c203=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qItC2-00042C-6f
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 15:52:54 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d244f86c-1f39-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 17:52:51 +0200 (CEST)
Received: from mail-dm6nam12lp2169.outbound.protection.outlook.com (HELO
 NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.169])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 10 Jul 2023 11:52:48 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by DM6PR03MB5131.namprd03.prod.outlook.com (2603:10b6:5:1f0::23) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.26; Mon, 10 Jul
 2023 15:52:45 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2%5]) with mapi id 15.20.6565.028; Mon, 10 Jul 2023
 15:52:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d244f86c-1f39-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689004371;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=vLj48icegD92MXj4YOa2t4mytEyYDbc8fWB4ylwxFn0=;
  b=KUzq35e1FFEyxlhJBvxXbsgI+tGn3qgk6uC4kg6MUqq6ENugfFwvnjS3
   GSIOXPx0QajL47pgiVeC9opFLmm7SgWCIOq43VPVBP+aYn0z/IOBKs55Y
   D4MrHYwG1Tea6bS6cmLM0qJnYr/LUBQQVLS4x7fxHLbMG/Hq/atvIAIRM
   k=;
X-IronPort-RemoteIP: 104.47.59.169
X-IronPort-MID: 115735407
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:gDBd9axOr0FAnxFO+oZ6t+f5xyrEfRIJ4+MujC+fZmUNrF6WrkUBy
 WcfUWiHP6qKYGOhKI8gaNzi9x8H7ZeAz9BlTwo4pSAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhPKgT5TcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KVoR+
 +4iCmEiVDmSleayn5ahEvdD3u12eaEHPKtH0p1h5RfwKK98BLzmHeDN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjmVlVIguFTuGIO9ltiiX8Jak1zev
 mvb12/4HgsbJJqUzj/tHneE37aSwnimBNpNfFG+3qNhjAWKy2gZNDMXUgvlu9Dpi2WBf90Kf
 iT4/QJr98De7neDTNPwQhm5q36spQMHVpxbFOhSwBGAzO/Y7hiUAkAATyVdc5o2uckuXzso2
 1SV2dTzClRHsqCRSH+b3qeZq3W1Iyd9BXQZeSYOQA8B4t/iiII+lBTCSpBkCqHdpsLxMSH9x
 XaNtidWulkIpcsC1qH+8VWZhTup/8LNVlRsuFSRWX+55ARkYoLjf5av9VXQ8fdHKsCeU0WFu
 38H3cOZ6YjiEK2wqcBEe81VdJnB2hpPGGS0bYJHd3X5ywmQxg==
IronPort-HdrOrdr: A9a23:eBKIaaBRVDg69+vlHemf55DYdb4zR+YMi2TDj3oBKyC9Afbo8v
 xG/c5rrCMc5wx+ZJhNo7u90ey7MBDhHP1OkPEs1NWZPTUO0VHARL2Kr7GD/9SKIUDDH5tmup
 uIBJITNDSfNzJHZI3BkW2F+p4bsb66GY6T9IHj80s=
X-Talos-CUID: 9a23:a7JZWmCSgCaYMXT6ExI4+lwuOJEKSFTM3nPUfGuiUXhGEJTAHA==
X-Talos-MUID: 9a23:V4pW7wS/T2Azi32ORXSxjz06Lcps6ZiACUddz48v68ivCgh/bmI=
X-IronPort-AV: E=Sophos;i="6.01,194,1684814400"; 
   d="scan'208";a="115735407"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BZrifusf+M+8CsC6zXQXq7pa5xXnk7K5KPkunh4MPrjOGy1lKSPEd8EJX56sZ52kDH7Jzhwt30Daat2fDuYS4vP5WnRapaf22YXh3QuOwPHZMvDGHlmkVqHJrjPGpMc+oOKGWkwggdsB9cvB2VJFqtxdwq/wyqLQ7hOvdwwhzL9VzXRLAbcfkOZFo/jDv91EpJRIrbWLLVuehalpxx6Qvo7tDd0eNAPMAtE5YWBN4PKlMXi5q1cC++CP6bGFH+KoZJmTXxOzwa6FxGwAAzV1gXsBm17CoWWXLT8FVaXkwni5iTAPu3rsE18yPiW+ojY02+O0W0vf5iKz7bSSGCyxyw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=HFDnNf31r7Xqt8jqbnsePXZ5QIlJ+QZx9C6FqEtB/kE=;
 b=Of3u+5tYbuiV0anr0nY6Y/1JUByteQwxRLrq4LORdOWKQ1AnQhb6oBNb9sB+EE1i9hHcOzSxJ/Jo7i9FFGE1EThXVaa6X1VP3tbLEBNwvYll4WhcX3EU670JeE0dbWSeHLH9KHXJwfeeHH0jj0TTqmt94Ni0GI5J0E373s0K8x6beUhsOezRCrk8MsEelNIvh3BuRLhpYLdUa/8yANsPHVzHlJgY7YTu7RtjJP2ym3bExM8UA2XIUIjO5jolPMaTLW4xEzVOCJoz5aszmMGlklarZiT4BWhKkpzEAAmvZe6/eeE0IzhqxgnxAy+s6KSsx51fBPYaS0sqNrAbNFEhgQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=HFDnNf31r7Xqt8jqbnsePXZ5QIlJ+QZx9C6FqEtB/kE=;
 b=YmWNSipuOz4co7zFGzioobKDra9BcStdU6gcPodsiarp4uPv3Qh/XVYQQNgGkQ5/NaC4TzZXo4ahfHSeveGXPmEriDMkwxeyNr2igL1Jore9GsS1GeKREttHSxC8j42Mj8vXPUsEde5Pd1e0F4bfcIwaCWafC40mMmAYb0n+Nn4=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Mon, 10 Jul 2023 17:52:38 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH] xenoprof: default to off
Message-ID: <ZKwpRrHyP0RN97nB@MacBook-Air-de-Roger.local>
References: <e3034416-0c34-322b-732a-02008be514b3@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <e3034416-0c34-322b-732a-02008be514b3@suse.com>
X-ClientProxiedBy: LO2P265CA0175.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:a::19) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|DM6PR03MB5131:EE_
X-MS-Office365-Filtering-Correlation-Id: 3d4b47e4-f04a-402e-d3f4-08db815db379
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	A4zAe0UKgr2J3Hwfiq+2Dy1oSzNZjv3kavRg8/rxbR7NslomOKPHuPpg4iOEYPsyWaksz9Vfut55wzIefvUyzxBqD2LjR/2O3+CZauOLgmaiFIrSbshJZg1/hXSRN/5uX1+JoToqggeK0Mm6JEGbd9D5hg3haWZwEsCDwA0PE7KHneMrtN/qhxampjHmz13PHoZDGc2R5VWRrVhoRn2x/mHiBlNfr+DqlV8tMXstpV8lSpddQpJ6dKp9ic0P/NTuMOBjRTQaTLSM4YeY5xTUjeRiQDR48/3hlsAe5ZF04KB9zzkfVPcuSOspl+VHLxV6CIZw+pzh9AVp0sEVA8NivGqDbwUNV+u2e18z1ITQnxbTyiZXNdhhYra/1KZLERrSJCg65W975/WvU6TaGe02ElmMX4H9uHXjCbwtKJ7gf6gheLf7nmvQCNr5QG8A7Yhu5LX8kYl1nuHL0EWRY3RN5PGYEwU9ki7Ckjc9kmJxD2TjtM/7ULSFu+ILIPefh2hoT5HEF5BXcKxrl4HM8jSy9WBIvMuKQ63rGC/CQs0hUBoV0V6iMVMycqWCUm4yBq7W
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(376002)(366004)(39860400002)(346002)(451199021)(6486002)(6666004)(478600001)(54906003)(38100700002)(85182001)(26005)(9686003)(86362001)(4744005)(2906002)(6506007)(6512007)(186003)(82960400001)(66946007)(316002)(66476007)(6916009)(66556008)(41300700001)(4326008)(8676002)(5660300002)(8936002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?d3NoejR0RlNoUlY5OUFNUmtkeVZ3TUlJdDhMKy8wSFlBT2IwVWN3R2ROdkR2?=
 =?utf-8?B?T3JWQy9jaFMwZUwrTXBReDM3RjQ3OU84ZGxVSzhhTElibW1oTnpFVHpxT0Z4?=
 =?utf-8?B?VENHZnU3Y05XTXQwKzJJMmQyRVErbk9LS1VuWnpTK2ZLUm5UMGdUb1FtRTFn?=
 =?utf-8?B?STlDSUpTQ3JkWXhwVEZuU2dKL3FubGcwL1JaTXNONnFkZnJjVHpsN29tOUVt?=
 =?utf-8?B?eWNGSzJKV3RlQXNVVFB6Z0QvM1hPUHlWbXhDVUltRF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VADxAdRuextiZ/E1MN3yQPCwm5gjBFFgbMo=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3d4b47e4-f04a-402e-d3f4-08db815db379
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 15:52:44.7937
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: HbbV0bU3NL6LBLduxsDZtZpJz7Eaj1HwrSGXq0Kqdu4rnFMTk9WY7LxWmEw9R+FtFxo1vt9mWVyhL0Wx9M9ikg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB5131

On Mon, Jul 10, 2023 at 11:48:09AM +0200, Jan Beulich wrote:
> This being x86-only right now, and its x86 bits being heavily outdated,
> let's no longer enable this by default.
> 
> While there also adjust the "help" keyword spelling.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 16:10:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 16:10:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561268.877705 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qItSQ-00069B-0h; Mon, 10 Jul 2023 16:09:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561268.877705; Mon, 10 Jul 2023 16:09:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qItSP-000694-Tk; Mon, 10 Jul 2023 16:09:49 +0000
Received: by outflank-mailman (input) for mailman id 561268;
 Mon, 10 Jul 2023 16:09:48 +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
 <SRS0=Xd0D=C4=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qItSO-00068y-6Q
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 16:09:48 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2faa4689-1f3c-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 18:09:45 +0200 (CEST)
Received: from mail-ua1-f44.google.com (mail-ua1-f44.google.com
 [209.85.222.44])
 by support.bugseng.com (Postfix) with ESMTPSA id 1652F4EE0739
 for <xen-devel@lists.xenproject.org>; Mon, 10 Jul 2023 18:09:45 +0200 (CEST)
Received: by mail-ua1-f44.google.com with SMTP id
 a1e0cc1a2514c-79470b88d88so1419505241.0
 for <xen-devel@lists.xenproject.org>; Mon, 10 Jul 2023 09:09:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2faa4689-1f3c-11ee-8611-37d641c3527e
X-Gm-Message-State: ABy/qLbRj/MaoRZ9Qm/TX3ySAxUd4iqVe2OKzan1oiH+EMDEZZSTMa7e
	SoaRgUrw6DspsRbANvKk9sj2FyaDYE0QYn1vs1I=
X-Google-Smtp-Source: APBJJlFHFi5N7AKYfgsu825M+dmLjxz6FDVJZuUgKwo4YPUmKzGt+1oZJ84Ci5Ys5WTI417Byu85FHP4DbugKAS9o40=
X-Received: by 2002:a67:eb0d:0:b0:443:6b64:aed4 with SMTP id
 a13-20020a67eb0d000000b004436b64aed4mr4920776vso.26.1689005383901; Mon, 10
 Jul 2023 09:09:43 -0700 (PDT)
MIME-Version: 1.0
References: <cover.1688559115.git.gianluca.luparini@bugseng.com>
 <e414542d76d4a4a0df6ad969cc6332e355d6ef38.1688559115.git.gianluca.luparini@bugseng.com>
 <a343fc97-84df-48e6-1c91-cd933c6e5210@suse.com> <CAFHJcJu=S2JtFJy_XnMhrr0gP7+sPfvrS_1940qzL9rc_j60nA@mail.gmail.com>
 <f93f0561-abea-bdae-223e-d69932e435c4@suse.com> <CAFHJcJuP7hH01ZiwNe0HHBM=JpBtsF9sDD7fushyBxDQ9UZicw@mail.gmail.com>
 <fb29cca6-454c-82ed-b6a8-ac9814f81cfa@suse.com> <CAFHJcJuCddmwMAB=26tVBfgThQWLZb5kZU3GBdC0aTTcvJ4O1w@mail.gmail.com>
 <f6c16d46-5804-a838-cf61-71fc671e394b@suse.com> <alpine.DEB.2.22.394.2307071432200.761183@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2307071432200.761183@ubuntu-linux-20-04-desktop>
From: Simone Ballarin <simone.ballarin@bugseng.com>
Date: Mon, 10 Jul 2023 18:09:32 +0200
X-Gmail-Original-Message-ID: <CAFHJcJsBP=_Lki=JMyzS=gr3kSMZJisJZmAWYX8H1cDHtWweFA@mail.gmail.com>
Message-ID: <CAFHJcJsBP=_Lki=JMyzS=gr3kSMZJisJZmAWYX8H1cDHtWweFA@mail.gmail.com>
Subject: Re: [XEN PATCH v2 12/13] xen/x86: fix violations of MISRA C:2012 Rule 7.2
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Jan Beulich <jbeulich@suse.com>, consulting@bugseng.com, 
	Gianluca Luparini <gianluca.luparini@bugseng.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, Wei Liu <wl@xen.org>, 
	Paul Durrant <paul@xen.org>, Michal Orzel <michal.orzel@amd.com>, 
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, Ayan Kumar Halder <ayan.kumar.halder@amd.com>, 
	xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000ee679806002435c1"

--000000000000ee679806002435c1
Content-Type: text/plain; charset="UTF-8"

Il giorno ven 7 lug 2023 alle ore 23:53 Stefano Stabellini <
sstabellini@kernel.org> ha scritto:

> On Fri, 7 Jul 2023, Jan Beulich wrote:
> > On 07.07.2023 10:04, Simone Ballarin wrote:
> > > Il giorno ven 7 lug 2023 alle ore 09:04 Jan Beulich <jbeulich@suse.com>
> ha
> > > scritto:
> > >
> > >> On 07.07.2023 08:50, Simone Ballarin wrote:
> > >>> Il giorno gio 6 lug 2023 alle ore 18:22 Jan Beulich <
> jbeulich@suse.com>
> > >> ha
> > >>> scritto:
> > >>>
> > >>>> On 06.07.2023 18:08, Simone Ballarin wrote:
> > >>>>> Il giorno gio 6 lug 2023 alle ore 10:26 Jan Beulich <
> jbeulich@suse.com
> > >>>
> > >>>> ha
> > >>>>> scritto:
> > >>>>>
> > >>>>>> On 05.07.2023 17:26, Simone Ballarin wrote:
> > >>>>>>> --- a/xen/arch/x86/apic.c
> > >>>>>>> +++ b/xen/arch/x86/apic.c
> > >>>>>>> @@ -1211,7 +1211,7 @@ static void __init
> calibrate_APIC_clock(void)
> > >>>>>>>       * Setup the APIC counter to maximum. There is no way the
> lapic
> > >>>>>>>       * can underflow in the 100ms detection time frame.
> > >>>>>>>       */
> > >>>>>>> -    __setup_APIC_LVTT(0xffffffff);
> > >>>>>>> +    __setup_APIC_LVTT(0xffffffffU);
> > >>>>>>
> > >>>>>> While making the change less mechanical, we want to consider to
> switch
> > >>>>>> to ~0 in this and similar cases.
> > >>>>>>
> > >>>>>
> > >>>>> Changing ~0U is more than not mechanical: it is possibly dangerous.
> > >>>>> The resulting value could be different depending on the
> architecture,
> > >>>>> I prefer to not make such kind of changes in a MISRA-related patch.
> > >>>>
> > >>>> What do you mean by "depending on the architecture", when this is
> > >>>> x86-only code _and_ you can check what type parameter the called
> > >>>> function has?
> > >>>
> > >>> Ok, I will change these literals in ~0U in the next submission.
> > >>
> > >> Except that I specifically meant ~0, not ~0U. We mean "maximum value"
> > >> here, and at the call site it doesn't matter how wide the function
> > >> parameter's type is. If it was 64-bit, ~0U would not do what is
> wanted.
> > >
> > > ~0 is not a MISRA-compliant solution since bitwise operations on signed
> > > integers have implementation-defined behavior. This solution
> definitively
> > > violates Rule 10.1.
> >
> > So if we adopted that rule (we didn't so far), we'd have to e.g. change
> > all literal number shift counts to have U suffixes, no matter that
> > without the suffix it is still entirely obvious that the numbers are
> > unsigned? I'm afraid that'll face my opposition ...
>
> Indeed we have not adopted Rule 10.1. However, may I suggest that we
> don't make things potentially worse, just in case we end up deciding in
> favor of 10.1? We might not adopt 10.1 at all, but still... The code is
> already 0xffffffff, let's make things easier for all of us and just do
> 0xffffffffU ?
>
> Let's put Rule 10.1 and the whole of MISRA C aside for a second.
>
>
> Jan, let's say that you prefer ~0 or a different function parameter name
> or something else on any of these patches. You do realize that you don't
> need Simone or Federico or anyone else to make that change for you? You
> can make the change, submit a patch, and in your case anyone can ack
> it. Roger, Andrew, me, Bertrand, Julien, and almost anyone else could
> ack it and it would go in. As I wrote yesterday, feel free to CC me and
> I'll help you get in all the changes that you want.
>
> If you submitted that patch to switch to ~0 it might already be
> committed by now.
>
> I am trying to highlight that suggesting changes on these mechanical
> patches end up with more work for both the contributor and also the
> maintainer compared to do the change yourself.
>
> I think we should try to accept these patches as
> mechanical-changes-only. This is the only way to scale up this effort.
> If you spot something that you'd rather be done differently, do one of
> the following:
>
> a) Accept the patch as-is and submit a patch afterwards. Yes the line
>    gets changed twice but it is the easiest solution.
>
> b) Ask the contribitor to drop the single change you would rather do
>    differently, or even better drop it yourself on commit. Then submit a
>    patch with the change that you prefer.
>
> c) For trivial things, like code style changes, do the change directly
>    on commit.
>
>
> I know emails encourage English replies, but to make this work we need
> to do more code changes together and less English.
>


I agree.

-- 
Simone Ballarin, M.Sc.

Field Application Engineer, BUGSENG (https://bugseng.com
<http://bugseng.com>)

--000000000000ee679806002435c1
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"></div><br><div class=3D"gmail_quote"><div=
 dir=3D"ltr" class=3D"gmail_attr">Il giorno ven 7 lug 2023 alle ore 23:53 S=
tefano Stabellini &lt;<a href=3D"mailto:sstabellini@kernel.org">sstabellini=
@kernel.org</a>&gt; ha scritto:<br></div><blockquote class=3D"gmail_quote" =
style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa=
dding-left:1ex">On Fri, 7 Jul 2023, Jan Beulich wrote:<br>
&gt; On 07.07.2023 10:04, Simone Ballarin wrote:<br>
&gt; &gt; Il giorno ven 7 lug 2023 alle ore 09:04 Jan Beulich &lt;<a href=
=3D"mailto:jbeulich@suse.com" target=3D"_blank">jbeulich@suse.com</a>&gt; h=
a<br>
&gt; &gt; scritto:<br>
&gt; &gt; <br>
&gt; &gt;&gt; On 07.07.2023 08:50, Simone Ballarin wrote:<br>
&gt; &gt;&gt;&gt; Il giorno gio 6 lug 2023 alle ore 18:22 Jan Beulich &lt;<=
a href=3D"mailto:jbeulich@suse.com" target=3D"_blank">jbeulich@suse.com</a>=
&gt;<br>
&gt; &gt;&gt; ha<br>
&gt; &gt;&gt;&gt; scritto:<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; On 06.07.2023 18:08, Simone Ballarin wrote:<br>
&gt; &gt;&gt;&gt;&gt;&gt; Il giorno gio 6 lug 2023 alle ore 10:26 Jan Beuli=
ch &lt;<a href=3D"mailto:jbeulich@suse.com" target=3D"_blank">jbeulich@suse=
.com</a><br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; ha<br>
&gt; &gt;&gt;&gt;&gt;&gt; scritto:<br>
&gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; On 05.07.2023 17:26, Simone Ballarin wrote:<b=
r>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt; --- a/xen/arch/x86/apic.c<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt; +++ b/xen/arch/x86/apic.c<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt; @@ -1211,7 +1211,7 @@ static void __init =
calibrate_APIC_clock(void)<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0* Setup the API=
C counter to maximum. There is no way the lapic<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0* can underflow=
 in the 100ms detection time frame.<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0*/<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt; -=C2=A0 =C2=A0 __setup_APIC_LVTT(0xffffff=
ff);<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;&gt; +=C2=A0 =C2=A0 __setup_APIC_LVTT(0xffffff=
ffU);<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; While making the change less mechanical, we w=
ant to consider to switch<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; to ~0 in this and similar cases.<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt; Changing ~0U is more than not mechanical: it is p=
ossibly dangerous.<br>
&gt; &gt;&gt;&gt;&gt;&gt; The resulting value could be different depending =
on the architecture,<br>
&gt; &gt;&gt;&gt;&gt;&gt; I prefer to not make such kind of changes in a MI=
SRA-related patch.<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; What do you mean by &quot;depending on the architectu=
re&quot;, when this is<br>
&gt; &gt;&gt;&gt;&gt; x86-only code _and_ you can check what type parameter=
 the called<br>
&gt; &gt;&gt;&gt;&gt; function has?<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; Ok, I will change these literals in ~0U in the next submi=
ssion.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Except that I specifically meant ~0, not ~0U. We mean &quot;m=
aximum value&quot;<br>
&gt; &gt;&gt; here, and at the call site it doesn&#39;t matter how wide the=
 function<br>
&gt; &gt;&gt; parameter&#39;s type is. If it was 64-bit, ~0U would not do w=
hat is wanted.<br>
&gt; &gt; <br>
&gt; &gt; ~0 is not a MISRA-compliant solution since bitwise operations on =
signed<br>
&gt; &gt; integers have implementation-defined behavior. This solution defi=
nitively<br>
&gt; &gt; violates Rule 10.1.<br>
&gt; <br>
&gt; So if we adopted that rule (we didn&#39;t so far), we&#39;d have to e.=
g. change<br>
&gt; all literal number shift counts to have U suffixes, no matter that<br>
&gt; without the suffix it is still entirely obvious that the numbers are<b=
r>
&gt; unsigned? I&#39;m afraid that&#39;ll face my opposition ...<br>
<br>
Indeed we have not adopted Rule 10.1. However, may I suggest that we<br>
don&#39;t make things potentially worse, just in case we end up deciding in=
<br>
favor of 10.1? We might not adopt 10.1 at all, but still... The code is<br>
already 0xffffffff, let&#39;s make things easier for all of us and just do<=
br>
0xffffffffU ?<br>
<br>
Let&#39;s put Rule 10.1 and the whole of MISRA C aside for a second.<br>
<br>
<br>
Jan, let&#39;s say that you prefer ~0 or a different function parameter nam=
e<br>
or something else on any of these patches. You do realize that you don&#39;=
t<br>
need Simone or Federico or anyone else to make that change for you? You<br>
can make the change, submit a patch, and in your case anyone can ack<br>
it. Roger, Andrew, me, Bertrand, Julien, and almost anyone else could<br>
ack it and it would go in. As I wrote yesterday, feel free to CC me and<br>
I&#39;ll help you get in all the changes that you want.<br>
<br>
If you submitted that patch to switch to ~0 it might already be<br>
committed by now.<br>
<br>
I am trying to highlight that suggesting changes on these mechanical<br>
patches end up with more work for both the contributor and also the<br>
maintainer compared to do the change yourself.<br>
<br>
I think we should try to accept these patches as<br>
mechanical-changes-only. This is the only way to scale up this effort.<br>
If you spot something that you&#39;d rather be done differently, do one of<=
br>
the following:<br>
<br>
a) Accept the patch as-is and submit a patch afterwards. Yes the line<br>
=C2=A0 =C2=A0gets changed twice but it is the easiest solution.<br>
<br>
b) Ask the contribitor to drop the single change you would rather do<br>
=C2=A0 =C2=A0differently, or even better drop it yourself on commit. Then s=
ubmit a<br>
=C2=A0 =C2=A0patch with the change that you prefer.<br>
<br>
c) For trivial things, like code style changes, do the change directly<br>
=C2=A0 =C2=A0on commit.<br>
<br>
<br>
I know emails encourage English replies, but to make this work we need<br>
to do more code changes together and less English.<br>
</blockquote></div><br clear=3D"all"><div><br></div><div><div>I agree.<br><=
/div></div><div><br></div><span class=3D"gmail_signature_prefix">-- </span>=
<br><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"ltr">Simone Ball=
arin, M.Sc.<br><br><div>Field Application Engineer, BUGSENG (<a href=3D"htt=
p://bugseng.com" target=3D"_blank">https://bugseng.com</a>)</div></div></di=
v></div>

--000000000000ee679806002435c1--


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 16:12:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 16:12:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561274.877714 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qItV9-0007Y8-DH; Mon, 10 Jul 2023 16:12:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561274.877714; Mon, 10 Jul 2023 16:12:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qItV9-0007Y1-AM; Mon, 10 Jul 2023 16:12:39 +0000
Received: by outflank-mailman (input) for mailman id 561274;
 Mon, 10 Jul 2023 16:12:37 +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
 <SRS0=BpzE=C4=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qItV7-0007Xt-PI
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 16:12:37 +0000
Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com
 [2a00:1450:4864:20::62d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 95081cdb-1f3c-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 18:12:35 +0200 (CEST)
Received: by mail-ej1-x62d.google.com with SMTP id
 a640c23a62f3a-98de21518fbso617750566b.0
 for <xen-devel@lists.xenproject.org>; Mon, 10 Jul 2023 09:12:35 -0700 (PDT)
Received: from EMEAENGAAD19049. (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 u23-20020a1709063b9700b009928b4e3b9fsm6316203ejf.114.2023.07.10.09.12.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 10 Jul 2023 09:12:34 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 95081cdb-1f3c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689005555; x=1691597555;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=xvrS+NlRYiI1/TssB4upQewQ7NHaAJZxe0HLhNdDpPU=;
        b=k56f4YHifztlTTRopeQ9BswevtpJ9n5PNQWvWVHyDfjmZq6tz7BnWJ9ywyYDDac0na
         0VW7mnEg9T7Ef38Lq/vLttCwi5DE9cMyK6T7fw0SjWIdqEPI95Os/vV3SbEC/x2JCbM3
         w3Dg/QEdZk9gFVKoICi2Ibxw0lZBDYhEBp4Jg=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689005555; x=1691597555;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=xvrS+NlRYiI1/TssB4upQewQ7NHaAJZxe0HLhNdDpPU=;
        b=ZZMJmNUUoB6cpEadWmHD0+r73pHIIQdpdrXJIYc+gCdwYWXZ5U1fKg4Dd8kvOOTN31
         1t0hnQwOjf9NMdzrvKKyooQINSbs2cys1RDs/bDEAfWlerquP1ZYKqif8sI8XdDP71vR
         bYbUr2msoQltW/gUBy2os0xjjXhgRmktmQqGRjaQP7r+1DnB/0m1Umbyxs2i0NTfdTE6
         dMh0gnobqPJIHKv0c3RwqYHkcqCC9gc0cU3dHNDUtYfEnpf/mU4DRFs6pwTH417BRLjn
         4dj+Z1UHzpcTpQqPLI7m9vG0jXzgnUVQtzCg/PYVdn3htfiSb3HjtsdaOwtp6wLvU5ib
         8Odw==
X-Gm-Message-State: ABy/qLYqafJ49lMtB4aVEtsi0V14giaW0RpA6m4sYO39cqN5tFnm7uSK
	gmb4vDlkcSvsTpGhlZs9mSTU8Q==
X-Google-Smtp-Source: APBJJlEKLYxeiK1UDZdZO5Cx0p604K5h9SLw8bWRK5HiCVta85xVE3Nw8/Rhmq1/xGvbtEGrz3Vk+w==
X-Received: by 2002:a17:907:2a08:b0:993:22a2:8158 with SMTP id fd8-20020a1709072a0800b0099322a28158mr12964280ejc.61.1689005555009;
        Mon, 10 Jul 2023 09:12:35 -0700 (PDT)
Message-ID: <64ac2df2.170a0220.87102.74de@mx.google.com>
X-Google-Original-Message-ID: <ZKwt78kQAMcyXTO8@EMEAENGAAD19049.>
Date: Mon, 10 Jul 2023 17:12:31 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2] mm/pdx: Add comments throughout the codebase for pdx
References: <20230622140237.8996-1-alejandro.vallejo@cloud.com>
 <e7d3daa3-7d5b-1c36-51f1-453bf11b55d2@suse.com>
 <64a83575.170a0220.2c96.8158@mx.google.com>
 <03e5e1a7-2c04-c991-e3b7-cea6916ec59b@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <03e5e1a7-2c04-c991-e3b7-cea6916ec59b@suse.com>

On Mon, Jul 10, 2023 at 09:43:34AM +0200, Jan Beulich wrote:
> This is ...
> >>> [snip]
> >>> + * This is where compression becomes useful. The idea is to note that if
> >>> + * you have several big chunks of memory sufficiently far apart you can
> >>> + * ignore the middle part of the address because it will always contain
> >>> + * zeroes as long as the base address is sufficiently well aligned and the
> >>> + * length of the region is much smaller than the base address.
> >>
> >> As per above alignment of the base address doesn't really matter.
> > Where above?
> 
> ... what "above" here meant.
> 
> > As far as I understand you need enough alignment to cover the
> > hole or you won't have zeroes to compress. Point in case:
> > 
> >   * region1: [0x0000000000000000 -
> >               0x00000000FFFFFFFF]
> > 
> >   * region2: [0x0001FFFFFFFFF000 -
> >               0x00020000FFFFFFFF]
> > 
> > I can agree this configuration is beyond dumb and statistically unlikely to
> > exist in the wild, but it should (IMO) still be covered by that comment.
> 
> Right, but this isn't relevant here - in such a case no compression
> can occur, yes, but not (just) because of missing alignment. See the
> example I gave above (in the earlier reply) for where alignment
> clearly doesn't matter for compression to be possible.
> 
> Jan
Fair enough. Then I think we can simply drop the last sentence and be done
with it.

So the paragraph becomes:
```
   * This is where compression becomes useful. The idea is to note that if
   * you have several big chunks of memory sufficiently far apart you can
   * ignore the middle part of the address because it will always contain
   * zeroes.
```
The details on when or how compression is possible are implicit in the
following example anyway.

Would that, combined with v3, take care of everything? If not, I'll just
merge further patches with the pdx series I have on hold and send
everything together.

Thanks,

Alejandro


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 16:27:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 16:27:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561279.877725 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qItjG-0000lu-RO; Mon, 10 Jul 2023 16:27:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561279.877725; Mon, 10 Jul 2023 16:27:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qItjG-0000ln-Nt; Mon, 10 Jul 2023 16:27:14 +0000
Received: by outflank-mailman (input) for mailman id 561279;
 Mon, 10 Jul 2023 16:27:13 +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 <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qItjF-0000lh-9K
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 16:27:13 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2061b.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::61b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9e4a39e5-1f3e-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 18:27:10 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS8PR04MB8642.eurprd04.prod.outlook.com (2603:10a6:20b:429::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 10 Jul
 2023 16:27:08 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 16:27:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9e4a39e5-1f3e-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BrAhFqAjnWyqSBaTHOOKfwqYia9Ua++C44SAcV5lPnAseExDQTgLl4q32elATUNcLrlmLlMU2XQJ9XM5kR5doZ3LeWlFxsnUWFlShliJqkeHeJ6jAlqw2hN8CFqe5FnidfGlGGTq1cBx8hfbJdYmc8+S73eU+SI0/aXUqKroNo3k+52qKdAt+rQYK0iULra4HiG4vlEqoE9eTjV3WFbqONF0f2JfQxNrGvEWVfSu3LkprqYI1WtMeWHydanPZaz8xVZR6ui6h9dDQigbI1H9dTaW/FyvjRNtzSt7zz+y1yM8BarP1wX5sa9oMHNWRaKUT3Q01pDbBuNae/GSUsycTA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=hzBtm0/T/QzvcYKk3AIn+WHZc+OO+e7mpprAfPqkIXM=;
 b=Wt/ESUofCX4d5Ghfs4dv36c/knTCcHw6XkiBNRH6to3S6xqxTVWWGlfEp5DAz89ng4uF8x1j8gUzJAvLTc3r9xuF8ocl38biXH0QsrIg7ecm7AQkNfbah7SkA03kaMQ8tQfPBnHpahdHzjkyEbfYmJBP6YShhRokGusa3SPhlkl4E/HwtV9QUd9CW9XsicvuVbMbq9LPDRkc1z9XC5ah2iAWbKF+Y/uDLzQyGhbFOiE0prQFvEgtI11RyyPNPEawOktVsN9E13Xjg8tlWKWhZ+2Tu75PW13rK2kyyaVEfvxDvnIKJoj/7xS1ORiTCkLwmDegE5pAVhV0ZUWfm+hfNA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=hzBtm0/T/QzvcYKk3AIn+WHZc+OO+e7mpprAfPqkIXM=;
 b=AZi7r/qur70H/ivsI3a4IwqUiqwH6uRYOYkmYE82GIgncLDsPuyedFyJtAIAHlV3suoJ9OqrILoSpeW+Nsnov50cJ++d6GMkqAqBm+43FKzpa3/6lDcsOICQE2gXv9DRLSLI0XD7cypU2Zif6d8u+lhqwIHw2yxrm227dARRDoqVQp9bWbPwwIUSFT4l1WtFEAh2l0wCnKwLcix2M37dcTOGiF4kz44g694pRM3UZZ3hjC3b60WJ9otFfuVbFoODORKploeu2oMZ4lsuALbO8hILr1qv27xDrFRxrMnouU8lpNRoA9P1UH6SZz8oC7FTOriNvjxG7yLJms4agaU4fw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <9827433d-54dd-47e6-1f74-53612da21c14@suse.com>
Date: Mon, 10 Jul 2023 18:27:06 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] cmdline: only set ask mode if vga= is present
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230710141238.375-1-roger.pau@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230710141238.375-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0270.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b5::16) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS8PR04MB8642:EE_
X-MS-Office365-Filtering-Correlation-Id: 7391e6be-7538-4353-ba5d-08db81628136
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	cyzEVUN3EJJvSNqLoK45R7Uij4/k3e3C2KqtLnUOnvr2gijfATIMrTEr89/Zn1wSrOA65rLet930vg/T2B8CVbYJa3UPpsqmq/Y9aATBToIYTln6OKNoVN6n/GeciT/j3cNeDKxpPEtStQruQ5+rzjgIoY4CbVU42RZbXNbF1jQinW1za0IMnp7wfxGAFeJW6lyU9coNDlkiLomudHZG/1nMhXVHkm2UilmnS5WYtsai4WlylX13kohr+W43Y38jTWl/0viiX3Yo0pm1P9r5SwLM/RCOIyI//X2qCdcwXeVDIJ7gNB1dergniGmpDxig9w7GMhXFeVZiUoHfgQ77e3Kppwtpm33W+gTBJ0jKBHM9BE6ozbTARQjVHVe3a/atmnkgn95Bj/wx3/h6CYdkHuxfnCu+F3xOixgrWF9ZNENsPl+rPTOKhvXaD1Ab+A8FcUuyNNQYONHLV6yypUilBwsf6MSxL2MkMDzooMqp4MbFxNh5BSF+41xV0zdqYVQz40z5f75yypMp/R42cF/t1vuHKzHNiEw6QfbgN0WHsTQ6EzBWL4SmGQpP0zAkvfmvpLTaXGXlgdvzkn1ta342Vxtc9dNJZvbYgWGli38i5FxeDqaZky778mF+0oOKtP7/3zHi4XfqB3LmdsYKuXgqQA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(136003)(346002)(396003)(39860400002)(451199021)(31696002)(6916009)(54906003)(478600001)(5660300002)(8676002)(36756003)(8936002)(86362001)(2906002)(66556008)(38100700002)(66476007)(66946007)(4326008)(316002)(41300700001)(53546011)(26005)(31686004)(186003)(2616005)(6506007)(6486002)(6512007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dk5Vb3R6a0NTRXBGR00waEFCUTNudTAwV0tkbmw0Nk9wL25jMk5IUnNVSWRQ?=
 =?utf-8?B?MUNML1NuNDIwN2ZwdHQ2MFY2ekVHZFZ5TldNSTEwUzFoeHRMbzhDVmpqUWFZ?=
 =?utf-8?B?S0t1a1BLUnI0VHJHY2l1OVVVcFRFdUNPV0hhOWlkbnNhdjBjalFidlpNMjZZ?=
 =?utf-8?B?eGJyL3haeWdobjNVMTFWUlI3NXkzN2RpTG1QdVJWdHBCWmJKL201N1RrTFpS?=
 =?utf-8?B?NzBtdDhCV1JPaTg1NkRsVmdrVkErdVpQVEQwTEhWM2J4YmE3REhyL0RQY1NN?=
 =?utf-8?B?d1pzcUNkMDhYc3JzNFM0c1Y0NjA4c2ppZlJpLzhodGlFTWx2T3RQejBxSitm?=
 =?utf-8?B?N3VXOTYyTlltVFBKQ1RFcTUyYXF0WnBTMkJCNFN2M0NqWTlBNUFmdnNudlhs?=
 =?utf-8?B?dUtjbVFQNXpUQkNBRCt2aEgxUVNZbnFwQW9xT2E5VjB0bTB2d01JOXZlU0I5?=
 =?utf-8?B?WjY0OVg5NW9vTTNHcFh3UWhRTENvQzNpSDRMemZaRTFpT0wxeHMyWk95YkhJ?=
 =?utf-8?B?clNKSmhjejFXYXBkYTBFT2FHOTUzYlBzKzZOcCswN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poNTJCY0I3Zm1IK1NrNERpT3g0elJBaDMyQWFic1hBaEhnMis4NjRB?=
 =?utf-8?B?MURYaXRtcGJSYkNRc1BwL2VOUXdKK25lZTF0SHE0RVdWcnpXUlR6QUNIdVJF?=
 =?utf-8?B?Qm4yR1BNbjIyTWVHVUx1LzZGOVJxUlVWSjBNTnFGMkhJVmhGRlVEQlNGSTg4?=
 =?utf-8?B?bVR4Tjd1MjlQcEJxYUxiR0cxR21nUTdjTWdXODBHVjZPREMydERRckNTZzVu?=
 =?utf-8?B?ekFyU3NqZjRXMkcwM2Z6V3k1cGtPNC9ENzYybmswRDQ3OWJiRHVIVjFZVTB3?=
 =?utf-8?B?Ujd4SVlwMXRmYVI5bDhGSWorYWNFSlRTNGhoRXV4SzdXUXpGSWpyYTRuYnpH?=
 =?utf-8?B?U0VwUUNzMzdTdDhLbVVab1FieENob1BXUFJyaTIvTmIrU2o4TmM3MDZyR1FP?=
 =?utf-8?B?ZlNkbCtEb040ZityeE92eHRpQWg2RldDOGNjZUJYS0hscjJ2eXdmYS8vcVp6?=
 =?utf-8?B?WUphREtQQ3pzQUNpL09XL3pNZzhmVE1HWmdKMVVseEhSUVJ1bFczZjBFMHhj?=
 =?utf-8?B?K1NaUm5nd1gzOGY2ak1yT2M3MDl3ZnBPZFhVUWZlOTF1ZzlmN0h1RElTbUVq?=
 =?utf-8?B?NzJZM3lmVG01VTRaMUhsTmltUExtNCtkQ0JMQXoxbmVSYzQwZlZXTGRDaTlP?=
 =?utf-8?Q?K5HtcLcpQHJRE8Wjivh1+UeeK?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7391e6be-7538-4353-ba5d-08db81628136
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 16:27:07.8859
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: d6N7fAKrh16O4INxtHiIfSw9m81O8A3KBXhYpTCRRvl6Qu8kdnus+splPZoC9u3FJixeU9KzRo6i/zdfdG+DHw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8642

On 10.07.2023 16:12, Roger Pau Monne wrote:
> Commit 9473d9a24182 set the ASK mode without checking if there was a
> `vga` option provided in the command line.  This breaks existing
> behavior, so exit early without changes if `vga` is not present in the
> command line.
> 
> Fixes: 9473d9a24182 ('cmdline: parse multiple instances of the vga option')
> Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

Should have spotted this during review; effectively you're (almost) undoing
part of the earlier change, just that ...

> --- a/xen/arch/x86/boot/cmdline.c
> +++ b/xen/arch/x86/boot/cmdline.c
> @@ -279,9 +279,13 @@ static void vga_parse(const char *cmdline, early_boot_opts_t *ebo)
>  {
>      const char *c = cmdline;
>  
> +    c = find_opt(c, "vga=", true);

... you use c instead of cmdline here (and I'm heavily tempted to actually
make this the initializer of c).

Jan

> +    if ( !c )
> +        return;
> +
>      ebo->boot_vid_mode = ASK_VGA;
>  
> -    while ( (c = find_opt(c, "vga=", true)) != NULL )
> +    do
>      {
>          unsigned int tmp, vesa_depth, vesa_height, vesa_width;
>  
> @@ -332,6 +336,7 @@ static void vga_parse(const char *cmdline, early_boot_opts_t *ebo)
>          else if ( !strmaxcmp(c, "ask", delim_chars_comma) )
>              ebo->boot_vid_mode = ASK_VGA;
>      }
> +    while ( (c = find_opt(c, "vga=", true)) != NULL );
>  }
>  #endif
>  



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 16:32:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 16:32:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561283.877735 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qItoN-0002DF-Cs; Mon, 10 Jul 2023 16:32:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561283.877735; Mon, 10 Jul 2023 16:32:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qItoN-0002D8-9S; Mon, 10 Jul 2023 16:32:31 +0000
Received: by outflank-mailman (input) for mailman id 561283;
 Mon, 10 Jul 2023 16:32:30 +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 <SRS0=72qR=C4=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qItoM-0002Ct-AP
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 16:32:30 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20617.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::617])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5bd8fd78-1f3f-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 18:32:28 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS8PR04MB8642.eurprd04.prod.outlook.com (2603:10a6:20b:429::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 10 Jul
 2023 16:32:26 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Mon, 10 Jul 2023
 16:32:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5bd8fd78-1f3f-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=REwBkaAuAmlh9Zxeiih8UVPbZ331zPoLWFYU5H972waroBsP+Yk6bLD9LfONEAnQjUVzELcBjOepjOx+bcEZztZm8Ef9iT1NA2l8B7TOinshh7+onZWHASmNhV5VO7GVrKAxoHJiJboxoM1rEXMRJtO3Q+J5ge2gE1AKv3TlO9hAqz90v4a9ECVqvdMVIWKEAB+f38J+UxXh5G8By6HaK/0JHp+GXI7NVcvLgLkiShxS8wKGzQWqGqLzdRsHTP/QgdiHdHfWbkmWf7oHKwZR11rOhvXVsIVUKUMIPUY64GRnmOQ6wu1Z++sH4E2xXmiHwGvIwSJ9ZdOFwG9u3rU7Bw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=vmJE5VhmAD3QWhYPKSl6KezIAwPCVORINXgmdeRzYG8=;
 b=dzxpJSZCzWYYwZ2jDmHM1Gu9p2YM6FBc4+yQvKhBmtTy8Tds9CP56gqfBvrFiGyJ3IMMqovkBrL/VsF++AJQmg259UHiYdd1tT5k4vG0BIJI1MrE33Z3Q3D6/ScHHHcsAQPC1UIuGe+N3787Sc5rNVrqHxU8cd2/h4HXKAZA7HBC4kIl03vd7flGPhrVLl/8Rn66JEe5RZhGfdpj8pCe3p01jNCe1Xnqt+U9yRx5QmUHpdE2y8F661y6L9JEIWpf1zAPsn1C2vI6p24H4yGH+4GtMwSHpTNWGTgtbVo/bppTPY4/s0shQGiaxLDUyqXDrKdZeq0btC6V18+gxDWzNw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=vmJE5VhmAD3QWhYPKSl6KezIAwPCVORINXgmdeRzYG8=;
 b=4ApaKR7CkrfLMSIUrE+nyMnjuug0rFpCNg3XirBUkSJcU4EACOkneE8tyYGt5PgrZahw3Sa7RVyPu6XdPHUsVrjK+h4lOFg0Xlp3EA7rqKnFcEgz3kQxbz7wdMHZrsYlBIDEA4Xb/NxJehq74wWkp7E07UvxpkjzpWcbg44Y4MXb0zxzythSY1Y4tjvTZWoviz/k6XIzLykIlLIU+hJsHAFZGrNOS4+ySp9pV1vWPiSlkjTwAVaT6B+QJVTUEnI+EzFYarI5TKIQctkMfAWyWA6DzzYr/FmJveRFhAH7mMueRfKxpNGBUNjJPJyuzra9nD3D6fKiTIiybNnmRcSXZw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <45c3a2e1-b3ef-55ea-7729-99f4ef4bb804@suse.com>
Date: Mon, 10 Jul 2023 18:32:24 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2] mm/pdx: Add comments throughout the codebase for pdx
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230622140237.8996-1-alejandro.vallejo@cloud.com>
 <e7d3daa3-7d5b-1c36-51f1-453bf11b55d2@suse.com>
 <64a83575.170a0220.2c96.8158@mx.google.com>
 <03e5e1a7-2c04-c991-e3b7-cea6916ec59b@suse.com>
 <64ac2df2.170a0220.87102.74de@mx.google.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <64ac2df2.170a0220.87102.74de@mx.google.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0051.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:92::8) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS8PR04MB8642:EE_
X-MS-Office365-Filtering-Correlation-Id: 62593995-0eb1-4917-fee8-08db81633f2a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	zfXUTaO3sKnRxLv90xCnZazECWSu2n0wBHBzvSVPnlPQV9MZ8Xp7/sFKOYnZ7mVSEGT96SQXhimsqnIPQfVZ7o1SPy/FvrPR/MCcH05TLDbl90PnX7N1tEyh84/l4qo3nkO2XJBnmeHcfsOk1cxH9+NjiKUY1OeT89Hq6eYOA2nBNa4CY1LTykieHIdDayyHVB/of5yBU4UslZ3534cfkPB4awyspa8rVqqfCW3z5EmC37bHKYKO50TorEsGmUfy0TjVFLmEDfVZJkeAFJrN8XRW3gwEWC/d6Fm/smW142nEd0DbA5uBKi75VTpO5uliFtYnyKkWYQubWOz306k0Y8dlKZSsZF2guav4HftvFirnjO1OGzdx6HhZVr8DoTAtJMdcaIMd9SCFKC1H50e5FS9My5vhw/BNiHraYf4VfCFfsPoDsNWM7bnuiMmmwGNhO257uVgCDkpqXDmpX58SiFBMQEhpCxeGuDrRv5MR0rfROvARh1tgjgWtSS6u2Dpoi9tkCmm722k0Gt6k+fWsBUoxT/oolYqZh2dk4PJ+7nBNgUthopTsPjTU2s+IdOfAmZpA8oYbxlLyhYJZkBGu9s7M0DWCI0u0ixyq4zlKPFUmgPdJl6W333sHx8ueu4a3/0zqoR3ncD7Mc48ytvvGjA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(136003)(346002)(396003)(39860400002)(451199021)(31696002)(6916009)(54906003)(478600001)(5660300002)(8676002)(36756003)(8936002)(86362001)(2906002)(66556008)(38100700002)(66476007)(66946007)(4326008)(316002)(41300700001)(83380400001)(53546011)(26005)(31686004)(186003)(2616005)(6506007)(6486002)(6512007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bmZPYkQreG9nL3FoVTdnWTVVZlRVWUYxYlFyQ2xCQXJBK1FvcG1NMExFeUZy?=
 =?utf-8?B?THNJamFHUlVOVkc3TnpCUjkvRFN2S0JMcWhVSUU1emNRYUVtNUxDTzJUZzQ0?=
 =?utf-8?B?OWgwR1doZXRkcDE5eUd2UlpIL3ZPK1pwNkVrRUJOVkJQV2dLMTlvSldLZUl5?=
 =?utf-8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E3WnBk?=
 =?utf-8?B?TWl3ZVBxMElNNE0yYmcySHRIa1pIcFZxaTJJQmhueWFxQ2ZNUGtJVGJRYkVX?=
 =?utf-8?B?OEhvMzV2MzRHWVBORjZlR3BGaVNzbFZ0U2IrMHRJRExrOEFWTGFReUtXSmtv?=
 =?utf-8?B?OU9nbkdEZGc0SVV5Ti91emJNOXd5c3lOSVB3bzJCWkRJcVFmc3F2MzBkMTlP?=
 =?utf-8?Q?3AbxBST2IENI4y6ZZ7Oe+JFxt?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 62593995-0eb1-4917-fee8-08db81633f2a
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 16:32:26.5280
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: V7cKi6OzMKDAfCzAFwzKqdOhnm72H0HrVNgSsbNnlZ32l3OAYow/yNnmt19hWnTNdKEbshjPuwh07IyCMNXV7w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8642

On 10.07.2023 18:12, Alejandro Vallejo wrote:
> On Mon, Jul 10, 2023 at 09:43:34AM +0200, Jan Beulich wrote:
>> This is ...
>>>>> [snip]
>>>>> + * This is where compression becomes useful. The idea is to note that if
>>>>> + * you have several big chunks of memory sufficiently far apart you can
>>>>> + * ignore the middle part of the address because it will always contain
>>>>> + * zeroes as long as the base address is sufficiently well aligned and the
>>>>> + * length of the region is much smaller than the base address.
>>>>
>>>> As per above alignment of the base address doesn't really matter.
>>> Where above?
>>
>> ... what "above" here meant.
>>
>>> As far as I understand you need enough alignment to cover the
>>> hole or you won't have zeroes to compress. Point in case:
>>>
>>>   * region1: [0x0000000000000000 -
>>>               0x00000000FFFFFFFF]
>>>
>>>   * region2: [0x0001FFFFFFFFF000 -
>>>               0x00020000FFFFFFFF]
>>>
>>> I can agree this configuration is beyond dumb and statistically unlikely to
>>> exist in the wild, but it should (IMO) still be covered by that comment.
>>
>> Right, but this isn't relevant here - in such a case no compression
>> can occur, yes, but not (just) because of missing alignment. See the
>> example I gave above (in the earlier reply) for where alignment
>> clearly doesn't matter for compression to be possible.
>>
>> Jan
> Fair enough. Then I think we can simply drop the last sentence and be done
> with it.
> 
> So the paragraph becomes:
> ```
>    * This is where compression becomes useful. The idea is to note that if
>    * you have several big chunks of memory sufficiently far apart you can
>    * ignore the middle part of the address because it will always contain
>    * zeroes.
> ```
> The details on when or how compression is possible are implicit in the
> following example anyway.
> 
> Would that, combined with v3, take care of everything?

I'm yet to look at v3. Sorry, too many things going on / pending.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 16:59:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 16:59:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561314.877761 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIuEn-0005l2-PR; Mon, 10 Jul 2023 16:59:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561314.877761; Mon, 10 Jul 2023 16:59:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIuEn-0005kv-My; Mon, 10 Jul 2023 16:59:49 +0000
Received: by outflank-mailman (input) for mailman id 561314;
 Mon, 10 Jul 2023 16:59:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=wLvp=C4=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qIuEm-0005kp-ON
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 16:59:48 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2b8fda60-1f43-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 18:59:46 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36AGxX62081751
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Mon, 10 Jul 2023 12:59:39 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36AGxWqn081750;
 Mon, 10 Jul 2023 09:59:32 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2b8fda60-1f43-11ee-b239-6b7b168915f2
Message-Id: <96726e1f51811a95b96adc029a7d573d8c254361.1689008310.git.ehem+xen@m5p.com>
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Cc: Juergen Gross <jgross@suse.com>
Date: Sun, 9 Jul 2023 16:06:30 -0700
Subject: [PATCH] tools/utils: move XLU_Operation to libxlu_internal.h
X-Spam-Status: No, score=1.2 required=10.0 tests=DATE_IN_PAST_12_24,
	KHOP_HELO_FCRDNS autolearn=no autolearn_force=no version=3.4.6
X-Spam-Level: *
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

This enumerated value is never used outside of the configuration parser.
As such, move to the internal header.

Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
 tools/include/libxlutil.h         | 5 -----
 tools/libs/util/libxlu_internal.h | 5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/include/libxlutil.h b/tools/include/libxlutil.h
index 4dd3c5e92b..24c31744ae 100644
--- a/tools/include/libxlutil.h
+++ b/tools/include/libxlutil.h
@@ -25,11 +25,6 @@ enum XLU_ConfigValueType {
     XLU_LIST,
 };
 
-enum XLU_Operation {
-    XLU_OP_ASSIGNMENT = 0,
-    XLU_OP_ADDITION,
-};
-
 /* Unless otherwise stated, all functions return an errno value. */
 typedef struct XLU_Config XLU_Config;
 typedef struct XLU_ConfigList XLU_ConfigList;
diff --git a/tools/libs/util/libxlu_internal.h b/tools/libs/util/libxlu_internal.h
index 1f7559ecd9..68bacdc384 100644
--- a/tools/libs/util/libxlu_internal.h
+++ b/tools/libs/util/libxlu_internal.h
@@ -25,6 +25,11 @@
 
 #include "libxlutil.h"
 
+enum XLU_Operation {
+    XLU_OP_ASSIGNMENT = 0,
+    XLU_OP_ADDITION,
+};
+
 struct XLU_ConfigList {
     int avalues; /* available slots */
     int nvalues; /* actual occupied slots */
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 17:28:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 17:28:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561368.877789 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIugi-0001nV-CT; Mon, 10 Jul 2023 17:28:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561368.877789; Mon, 10 Jul 2023 17:28:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIugi-0001nO-8m; Mon, 10 Jul 2023 17:28:40 +0000
Received: by outflank-mailman (input) for mailman id 561368;
 Mon, 10 Jul 2023 17:28:39 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIugh-0001nE-6z; Mon, 10 Jul 2023 17:28:39 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIugh-00059Z-43; Mon, 10 Jul 2023 17:28:39 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIugg-0001lh-Pa; Mon, 10 Jul 2023 17:28:38 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qIugg-000828-P7; Mon, 10 Jul 2023 17:28:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=LyXrNHUn1fKsbsF5MDS2kHF0IKwTnssbSBvxFZ6HX8Q=; b=odvCYaTNaN/MwHd3i6nQBmHDhf
	cD/ChPmEGM0NOdyfb1ow4df/8pRpD6A2n+fok4KhjGYv2uZvSh6DFtz8lsyQ1IYNAUWzYlm1hlPhG
	ApR3Lj5iUJpLRuyTpvWud0gVfINImkA3V+8s7iCmJFyQxajjUGzLiijb1jDWVYO7iCsM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181749-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181749: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 10 Jul 2023 17:28:38 +0000

flight 181749 linux-linus real [real]
flight 181753 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181749/
http://logs.test-lab.xenproject.org/osstest/logs/181753/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-ovmf-amd64 18 guest-localmigrate/x10 fail pass in 181753-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   84 days
Failing since        180281  2023-04-17 06:24:36 Z   84 days  168 attempts
Testing same since   181749  2023-07-10 05:37:47 Z    0 days    1 attempts

------------------------------------------------------------
3735 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 621894 lines long.)


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 19:44:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 19:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561384.877798 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIwnv-0007Xb-Lf; Mon, 10 Jul 2023 19:44:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561384.877798; Mon, 10 Jul 2023 19:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIwnv-0007XU-Ij; Mon, 10 Jul 2023 19:44:15 +0000
Received: by outflank-mailman (input) for mailman id 561384;
 Mon, 10 Jul 2023 19:44:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIwnu-0007XK-If; Mon, 10 Jul 2023 19:44:14 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIwnu-0008Rb-GS; Mon, 10 Jul 2023 19:44:14 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIwnu-0000hc-5T; Mon, 10 Jul 2023 19:44:14 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qIwnu-0001RV-4y; Mon, 10 Jul 2023 19:44:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=RUqdpo0yLl+mn31TSZSWYkJHq9BMXoi/CACWOGGgLYs=; b=EDBvMdKsvUaV4lfNR1GFS3Ol6M
	lrWeoCL/Wwgzs0OB3Kj1ddrF1HVmUSmvVJdO8GgQk0KIk10GM3fshbG/wHBqEPqotdYgZGFwRKjsC
	0Owqi2fcmcsbUDpp2xsJxaLnl9So0/ZRbWEq2sCiVVVac2PvRP6jktEHhCnswbwMbq8E=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181754-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181754: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=b831326ee2f9ed94523b3d8b0fb2da2a82113e9e
X-Osstest-Versions-That:
    xen=fd62986f6b776876f3028a755c859d02e55dc262
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 10 Jul 2023 19:44:14 +0000

flight 181754 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181754/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  b831326ee2f9ed94523b3d8b0fb2da2a82113e9e
baseline version:
 xen                  fd62986f6b776876f3028a755c859d02e55dc262

Last test of basis   181750  2023-07-10 11:03:28 Z    0 days
Testing same since   181754  2023-07-10 17:02:02 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   fd62986f6b..b831326ee2  b831326ee2f9ed94523b3d8b0fb2da2a82113e9e -> smoke


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 20:28:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 20:28:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561392.877808 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIxUg-0003eu-TJ; Mon, 10 Jul 2023 20:28:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561392.877808; Mon, 10 Jul 2023 20:28:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIxUg-0003en-QO; Mon, 10 Jul 2023 20:28:26 +0000
Received: by outflank-mailman (input) for mailman id 561392;
 Mon, 10 Jul 2023 20:28:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=c7NE=C4=redhat.com=mst@srs-se1.protection.inumbo.net>)
 id 1qIxUf-0003ef-Rh
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 20:28:25 +0000
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [170.10.129.124])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 508c6358-1f60-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 22:28:23 +0200 (CEST)
Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com
 [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-553-WRs3s3g_O-6JV55ZazwumA-1; Mon, 10 Jul 2023 16:28:20 -0400
Received: by mail-wm1-f69.google.com with SMTP id
 5b1f17b1804b1-3f41a04a297so28054505e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 10 Jul 2023 13:28:20 -0700 (PDT)
Received: from redhat.com ([2.52.3.112]) by smtp.gmail.com with ESMTPSA id
 12-20020a05600c020c00b003f819faff24sm11271958wmi.40.2023.07.10.13.28.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 10 Jul 2023 13:28:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 508c6358-1f60-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1689020902;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=jkwGuIFG1SK+UCnr46kX8hPtrp2iQsEAiNCq9TRDIhw=;
	b=eUNu67+Th9yBeskfA3tX5FMsgAnMFgJFpYndF5hCdtaqXWLTBduWzcaeC6wjNWIcQJGfxB
	xJQbjpTJcWZHn37AwrI/0UiE7r8o9oU7d/40IGxEnoO1JQLv0g8IlR/t+0+lwpoKGdLWGx
	TyG6PFgBKAdSTMIt1KCNxPEyiTQLm10=
X-MC-Unique: WRs3s3g_O-6JV55ZazwumA-1
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689020899; x=1691612899;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=jkwGuIFG1SK+UCnr46kX8hPtrp2iQsEAiNCq9TRDIhw=;
        b=SfiUDmCxLaKWKA8M4AttERu7wf5o/rpWBYFNQy6ErpDvDMAUCN9PJet4/htzbRHWv7
         xYZ6L0kxieKnbji/v17+aPKAHj7StanTcBu/OWqBiBT/xQr8jTtLEktZr+16S/KZCagT
         bTQIOjjfAEaTGmhVhf3WPYJpj1cBJyQDYT29fB+EzroI0MA5Q7wURwecK7g5HovrUyaj
         D5xwFm+UGz9LOqtJBaO5Zj1wnURL9tUeYxRUwW5UuhJ7PFLWt6vbldl/IuHF89D7qXim
         7ENZMpJ3ELauX7ulkEKtmf+WrNQqjrGWbNITYp/x5QbCjiNm9/02uTl6tUoFF2S8qEjS
         9IIA==
X-Gm-Message-State: ABy/qLZYywFQLbZzoxPDA2FYyzJvNcYVsJ43Gv1RL6Bppg0sySXiwvLk
	99liWoVY4r2uv8CYMkqGpOaNun51Fbk9Q1QHVkX1tz2XnTdRTZiQTVoEjLRJJPohRVp5UVezkWI
	irnpxQkE384tq2fyECbHpir93K1w=
X-Received: by 2002:a7b:ca56:0:b0:3f9:b7cc:723 with SMTP id m22-20020a7bca56000000b003f9b7cc0723mr12503525wml.21.1689020899672;
        Mon, 10 Jul 2023 13:28:19 -0700 (PDT)
X-Google-Smtp-Source: APBJJlFn9MJIGZ5J7zvoOUSlngeHqYdlX4r3C3gtIWEX/wGiS84dSbvt+bv7qqt7jwtSoAbn/5mCyA==
X-Received: by 2002:a7b:ca56:0:b0:3f9:b7cc:723 with SMTP id m22-20020a7bca56000000b003f9b7cc0723mr12503501wml.21.1689020899294;
        Mon, 10 Jul 2023 13:28:19 -0700 (PDT)
Date: Mon, 10 Jul 2023 16:28:14 -0400
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jiqian Chen <Jiqian.Chen@amd.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>,
	=?iso-8859-1?Q?Marc-Andr=E9?= Lureau <marcandre.lureau@gmail.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	Robert Beckett <bob.beckett@collabora.com>, qemu-devel@nongnu.org,
	xen-devel@lists.xenproject.org,
	Alex Deucher <Alexander.Deucher@amd.com>,
	Christian Koenig <Christian.Koenig@amd.com>,
	Stewart Hildebrand <Stewart.Hildebrand@amd.com>,
	Xenia Ragiadakou <burzalodowa@gmail.com>,
	Honglei Huang <Honglei1.Huang@amd.com>,
	Julia Zhang <Julia.Zhang@amd.com>, Huang Rui <Ray.Huang@amd.com>
Subject: Re: [QEMU PATCH v2 1/1] virtgpu: do not destroy resources when guest
 suspend
Message-ID: <20230710162702-mutt-send-email-mst@kernel.org>
References: <20230630070016.841459-1-Jiqian.Chen@amd.com>
 <20230630070016.841459-2-Jiqian.Chen@amd.com>
MIME-Version: 1.0
In-Reply-To: <20230630070016.841459-2-Jiqian.Chen@amd.com>
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri, Jun 30, 2023 at 03:00:16PM +0800, Jiqian Chen wrote:
> After suspending and resuming guest VM, you will get
> a black screen, and the display can't come back.
> 
> This is because when guest did suspending, it called
> into qemu to call virtio_gpu_gl_reset. In function
> virtio_gpu_gl_reset, it destroyed resources and reset
> renderer, which were used for display. As a result,
> guest's screen can't come back to the time when it was
> suspended and only showed black.
> 
> So, this patch adds a new ctrl message
> VIRTIO_GPU_CMD_STATUS_FREEZING to get notification from
> guest. If guest is during suspending, it sets freezing
> status of virtgpu to true, this will prevent destroying
> resources and resetting renderer when guest calls into
> virtio_gpu_gl_reset. If guest is during resuming, it sets
> freezing to false, and then virtio_gpu_gl_reset will keep
> its origin actions and has no other impaction.
> 
> Due to this implemention needs cooperation with guest, so
> it added a new feature flag VIRTIO_GPU_F_FREEZING, so
> that guest and host can negotiate whenever freezing is
> supported or not.
> 
> Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
> ---
>  hw/display/virtio-gpu-base.c                |  3 ++
>  hw/display/virtio-gpu-gl.c                  |  9 +++-
>  hw/display/virtio-gpu-virgl.c               |  7 +++
>  hw/display/virtio-gpu.c                     | 52 ++++++++++++++++++++-
>  hw/virtio/virtio.c                          |  3 ++
>  include/hw/virtio/virtio-gpu.h              |  6 +++
>  include/standard-headers/linux/virtio_gpu.h | 15 ++++++
>  7 files changed, 92 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c
> index a29f191aa8..d55dc8fdfc 100644
> --- a/hw/display/virtio-gpu-base.c
> +++ b/hw/display/virtio-gpu-base.c
> @@ -215,6 +215,9 @@ virtio_gpu_base_get_features(VirtIODevice *vdev, uint64_t features,
>      if (virtio_gpu_blob_enabled(g->conf)) {
>          features |= (1 << VIRTIO_GPU_F_RESOURCE_BLOB);
>      }
> +    if (virtio_gpu_freezing_enabled(g->conf)) {
> +        features |= (1 << VIRTIO_GPU_F_FREEZING);
> +    }
>  
>      return features;
>  }
> diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c
> index e06be60dfb..de108f1502 100644
> --- a/hw/display/virtio-gpu-gl.c
> +++ b/hw/display/virtio-gpu-gl.c
> @@ -100,7 +100,14 @@ static void virtio_gpu_gl_reset(VirtIODevice *vdev)
>       */
>      if (gl->renderer_inited && !gl->renderer_reset) {
>          virtio_gpu_virgl_reset_scanout(g);
> -        gl->renderer_reset = true;
> +        /*
> +         * If guest is suspending, we shouldn't reset renderer,
> +         * otherwise, the display can't come back to the time when
> +         * it was suspended after guest resumed.
> +         */
> +        if (!virtio_gpu_freezing_enabled(g->parent_obj.conf) || !g->freezing) {
> +            gl->renderer_reset = true;
> +        }
>      }
>  }
>  
> diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c
> index 73cb92c8d5..547c4d98ad 100644
> --- a/hw/display/virtio-gpu-virgl.c
> +++ b/hw/display/virtio-gpu-virgl.c
> @@ -464,6 +464,13 @@ void virtio_gpu_virgl_process_cmd(VirtIOGPU *g,
>      case VIRTIO_GPU_CMD_GET_EDID:
>          virtio_gpu_get_edid(g, cmd);
>          break;
> +    case VIRTIO_GPU_CMD_STATUS_FREEZING:
> +        if (virtio_gpu_freezing_enabled(g->parent_obj.conf)) {
> +            virtio_gpu_cmd_status_freezing(g, cmd);
> +        } else {
> +            cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER;
> +        }
> +        break;
>      default:
>          cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
>          break;
> diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
> index 5e15c79b94..54a5e2e57c 100644
> --- a/hw/display/virtio-gpu.c
> +++ b/hw/display/virtio-gpu.c
> @@ -373,6 +373,16 @@ static void virtio_gpu_resource_create_blob(VirtIOGPU *g,
>      QTAILQ_INSERT_HEAD(&g->reslist, res, next);
>  }
>  
> +void virtio_gpu_cmd_status_freezing(VirtIOGPU *g,
> +                         struct virtio_gpu_ctrl_command *cmd)
> +{
> +    struct virtio_gpu_status_freezing sf;
> +
> +    VIRTIO_GPU_FILL_CMD(sf);
> +    virtio_gpu_bswap_32(&sf, sizeof(sf));
> +    g->freezing = sf.freezing;
> +}
> +
>  static void virtio_gpu_disable_scanout(VirtIOGPU *g, int scanout_id)
>  {
>      struct virtio_gpu_scanout *scanout = &g->parent_obj.scanout[scanout_id];
> @@ -986,6 +996,13 @@ void virtio_gpu_simple_process_cmd(VirtIOGPU *g,
>      case VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING:
>          virtio_gpu_resource_detach_backing(g, cmd);
>          break;
> +    case VIRTIO_GPU_CMD_STATUS_FREEZING:
> +        if (virtio_gpu_freezing_enabled(g->parent_obj.conf)) {
> +            virtio_gpu_cmd_status_freezing(g, cmd);
> +        } else {
> +            cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER;
> +        }
> +        break;
>      default:
>          cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
>          break;
> @@ -1344,6 +1361,27 @@ void virtio_gpu_device_realize(DeviceState *qdev, Error **errp)
>      QTAILQ_INIT(&g->reslist);
>      QTAILQ_INIT(&g->cmdq);
>      QTAILQ_INIT(&g->fenceq);
> +
> +    g->freezing = false;
> +}
> +
> +static void virtio_gpu_device_unrealize(DeviceState *qdev)
> +{
> +    VirtIOGPU *g = VIRTIO_GPU(qdev);
> +    struct virtio_gpu_simple_resource *res, *tmp;
> +
> +    /*
> +     * This is to prevent memory leak in the situation that qemu is
> +     * destroyed when guest is suspended. This also need hot-plug
> +     * support.
> +     */
> +    if (virtio_gpu_freezing_enabled(g->parent_obj.conf) && g->freezing) {
> +        QTAILQ_FOREACH_SAFE(res, &g->reslist, next, tmp) {
> +            virtio_gpu_resource_destroy(g, res);
> +        }
> +        virtio_gpu_virgl_reset(g);
> +    }
> +
>  }
>  
>  void virtio_gpu_reset(VirtIODevice *vdev)
> @@ -1352,8 +1390,15 @@ void virtio_gpu_reset(VirtIODevice *vdev)
>      struct virtio_gpu_simple_resource *res, *tmp;
>      struct virtio_gpu_ctrl_command *cmd;
>  
> -    QTAILQ_FOREACH_SAFE(res, &g->reslist, next, tmp) {
> -        virtio_gpu_resource_destroy(g, res);
> +    /*
> +     * If guest is suspending, we shouldn't destroy resources,
> +     * otherwise, the display can't come back to the time when
> +     * it was suspended after guest resumed.
> +     */
> +    if (!virtio_gpu_freezing_enabled(g->parent_obj.conf) || !g->freezing) {
> +        QTAILQ_FOREACH_SAFE(res, &g->reslist, next, tmp) {
> +            virtio_gpu_resource_destroy(g, res);
> +        }
>      }
>  
>      while (!QTAILQ_EMPTY(&g->cmdq)) {
> @@ -1425,6 +1470,8 @@ static Property virtio_gpu_properties[] = {
>                       256 * MiB),
>      DEFINE_PROP_BIT("blob", VirtIOGPU, parent_obj.conf.flags,
>                      VIRTIO_GPU_FLAG_BLOB_ENABLED, false),
> +    DEFINE_PROP_BIT("freezing", VirtIOGPU, parent_obj.conf.flags,
> +                    VIRTIO_GPU_FLAG_FREEZING_ENABLED, false),
>      DEFINE_PROP_END_OF_LIST(),
>  };
>  
> @@ -1441,6 +1488,7 @@ static void virtio_gpu_class_init(ObjectClass *klass, void *data)
>      vgbc->gl_flushed = virtio_gpu_handle_gl_flushed;
>  
>      vdc->realize = virtio_gpu_device_realize;
> +    vdc->unrealize = virtio_gpu_device_unrealize;
>      vdc->reset = virtio_gpu_reset;
>      vdc->get_config = virtio_gpu_get_config;
>      vdc->set_config = virtio_gpu_set_config;
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index eb6347ab5d..e2ccf50a9e 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -240,6 +240,9 @@ qmp_virtio_feature_map_t virtio_gpu_feature_map[] = {
>      FEATURE_ENTRY(VIRTIO_GPU_F_CONTEXT_INIT, \
>              "VIRTIO_GPU_F_CONTEXT_INIT: Context types and synchronization "
>              "timelines supported"),
> +    FEATURE_ENTRY(VIRTIO_GPU_F_FREEZING, \
> +            "VIRTIO_GPU_F_FREEZING: Freezing virtio-gpu and keeping resources"
> +            "alive is supported."),
>      FEATURE_ENTRY(VHOST_F_LOG_ALL, \
>              "VHOST_F_LOG_ALL: Logging write descriptors supported"),
>      FEATURE_ENTRY(VHOST_USER_F_PROTOCOL_FEATURES, \
> diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
> index 2e28507efe..53e06e47cb 100644
> --- a/include/hw/virtio/virtio-gpu.h
> +++ b/include/hw/virtio/virtio-gpu.h
> @@ -90,6 +90,7 @@ enum virtio_gpu_base_conf_flags {
>      VIRTIO_GPU_FLAG_EDID_ENABLED,
>      VIRTIO_GPU_FLAG_DMABUF_ENABLED,
>      VIRTIO_GPU_FLAG_BLOB_ENABLED,
> +    VIRTIO_GPU_FLAG_FREEZING_ENABLED,
>  };
>  
>  #define virtio_gpu_virgl_enabled(_cfg) \
> @@ -102,6 +103,8 @@ enum virtio_gpu_base_conf_flags {
>      (_cfg.flags & (1 << VIRTIO_GPU_FLAG_DMABUF_ENABLED))
>  #define virtio_gpu_blob_enabled(_cfg) \
>      (_cfg.flags & (1 << VIRTIO_GPU_FLAG_BLOB_ENABLED))
> +#define virtio_gpu_freezing_enabled(_cfg) \
> +    (_cfg.flags & (1 << VIRTIO_GPU_FLAG_FREEZING_ENABLED))
>  
>  struct virtio_gpu_base_conf {
>      uint32_t max_outputs;
> @@ -173,6 +176,7 @@ struct VirtIOGPU {
>  
>      uint64_t hostmem;
>  
> +    bool freezing;
>      bool processing_cmdq;
>      QEMUTimer *fence_poll;
>      QEMUTimer *print_stats;
> @@ -284,5 +288,7 @@ void virtio_gpu_virgl_reset_scanout(VirtIOGPU *g);
>  void virtio_gpu_virgl_reset(VirtIOGPU *g);
>  int virtio_gpu_virgl_init(VirtIOGPU *g);
>  int virtio_gpu_virgl_get_num_capsets(VirtIOGPU *g);
> +void virtio_gpu_cmd_status_freezing(VirtIOGPU *g,
> +                         struct virtio_gpu_ctrl_command *cmd);
>  
>  #endif
> diff --git a/include/standard-headers/linux/virtio_gpu.h b/include/standard-headers/linux/virtio_gpu.h
> index 2da48d3d4c..cc9286b30e 100644
> --- a/include/standard-headers/linux/virtio_gpu.h
> +++ b/include/standard-headers/linux/virtio_gpu.h
> @@ -65,6 +65,11 @@
>   */
>  #define VIRTIO_GPU_F_CONTEXT_INIT        4
>  
> +/*
> + * VIRTIO_GPU_CMD_STATUS_FREEZING
> + */
> +#define VIRTIO_GPU_F_FREEZING            5
> +
>  enum virtio_gpu_ctrl_type {
>  	VIRTIO_GPU_UNDEFINED = 0,
>  
> @@ -100,6 +105,9 @@ enum virtio_gpu_ctrl_type {
>  	VIRTIO_GPU_CMD_UPDATE_CURSOR = 0x0300,
>  	VIRTIO_GPU_CMD_MOVE_CURSOR,
>  
> +	/* status */
> +	VIRTIO_GPU_CMD_STATUS_FREEZING = 0x0400,
> +
>  	/* success responses */
>  	VIRTIO_GPU_RESP_OK_NODATA = 0x1100,
>  	VIRTIO_GPU_RESP_OK_DISPLAY_INFO,
> @@ -116,6 +124,7 @@ enum virtio_gpu_ctrl_type {
>  	VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID,
>  	VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID,
>  	VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER,
> +
>  };
>  


???

>  enum virtio_gpu_shm_id {
> @@ -453,4 +462,10 @@ struct virtio_gpu_resource_unmap_blob {
>  	uint32_t padding;
>  };
>  
> +/* VIRTIO_GPU_CMD_STATUS_FREEZING */
> +struct virtio_gpu_status_freezing {
> +	struct virtio_gpu_ctrl_hdr hdr;
> +	__u32 freezing;
> +};
> +


Fails build on mingw:

/scm/qemu/include/standard-headers/linux/virtio_gpu.h:468:9: error: unknown type name '__u32'
  468 |         __u32 freezing;
      |         ^~~~~


Reason is you are not supposed to edit this directly: it has to be edited
in linux then we import it.




>  #endif
> -- 
> 2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 20:28:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 20:28:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561393.877818 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIxV2-00040z-4T; Mon, 10 Jul 2023 20:28:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561393.877818; Mon, 10 Jul 2023 20:28:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIxV2-00040j-1Z; Mon, 10 Jul 2023 20:28:48 +0000
Received: by outflank-mailman (input) for mailman id 561393;
 Mon, 10 Jul 2023 20:28:46 +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
 <SRS0=atS4=C4=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qIxV0-0003xp-1v
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 20:28:46 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5b45be5a-1f60-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 22:28:41 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id F057D611C0;
 Mon, 10 Jul 2023 20:28:39 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FD6BC433C7;
 Mon, 10 Jul 2023 20:28:38 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5b45be5a-1f60-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689020919;
	bh=axyZZQcYXEYTlxOxAA7ForY8wuep7GAcbh9SoRg9mZo=;
	h=From:To:Cc:Subject:Date:From;
	b=Ss3QI9eEJVaJSQjEO2UqkrEhgCZvMkqFE57MOrujvpfBFfz/sRLeWLEcwLn9vHfk9
	 YTcjMUKjE5jInBZwX98TlYi7RuGhFmCwEWt34efW+8UwJUenQrBy4h+Xolr6uQLLnm
	 AjGfFfxAJaNp/jIRB6UrjV/rYS0teUShmLD7OAP7SBiDwkL33jfklIcDsAHaTAH9f1
	 pNgzcnfWgYlPeZXibS5K2R9Wu75BB1VfbF4XPJIub5xc8xYhHW/CwZ2GwiiQ8vvWRB
	 BixjtQe2ctiDN+xF4igFEQ+U2ES8r2b1YX4DME3xy+4ITbRK5E/I0pp3H1KDpux8X4
	 Kdy0SJw3HquuQ==
From: Stefano Stabellini <sstabellini@kernel.org>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	julien@xen.org,
	sstabellini@kernel.org,
	george.dunlap@citrix.com,
	bertrand.marquis@arm.com,
	Stefano Stabellini <stefano.stabellini@amd.com>
Subject: [PATCH v2] docs/misra: add Rule 7.4 and 9.4
Date: Mon, 10 Jul 2023 13:28:35 -0700
Message-Id: <20230710202835.2052428-1-sstabellini@kernel.org>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Stefano Stabellini <stefano.stabellini@amd.com>

Rule 9.4 is non-controversial and we have no violations.

Rule 7.4 is considered a good idea with the caveat that assigning a
string literal to const void is allowed. I added a note to specify it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
Changes in v2:
- improve rule 7.4 note
---
 docs/misra/rules.rst | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 622f35410c..67ee8c029e 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -203,6 +203,15 @@ maintainers if you want to suggest a change.
      - The lowercase character l shall not be used in a literal suffix
      -
 
+   * - `Rule 7.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_07_04.c>`_
+     - Required
+     - A string literal shall not be assigned to an object unless the
+       objects type is pointer to const-qualified char
+     - All "character types" are permitted, as long as the string
+       element type and the character type match. (There should be no
+       casts.) Assigning a string literal to any object with type
+       "pointer to const-qualified void" is allowed.
+
    * - `Rule 8.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_08_01.c>`_
      - Required
      - Types shall be explicitly specified
@@ -275,6 +284,11 @@ maintainers if you want to suggest a change.
        braces
      -
 
+   * - `Rule 9.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_09_04.c>`_
+     - Required
+     - An element of an object shall not be initialized more than once
+     -
+
    * - `Rule 12.5 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_12_05.c>`_
      - Mandatory
      - The sizeof operator shall not have an operand which is a function
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 10 20:46:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 20:46:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561401.877828 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIxmB-0006e1-Hj; Mon, 10 Jul 2023 20:46:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561401.877828; Mon, 10 Jul 2023 20:46:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIxmB-0006du-F0; Mon, 10 Jul 2023 20:46:31 +0000
Received: by outflank-mailman (input) for mailman id 561401;
 Mon, 10 Jul 2023 20:46:30 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qIxmA-0006do-Fa
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 20:46:30 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qIxm8-0001Tf-Sw; Mon, 10 Jul 2023 20:46:28 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qIxm8-00041T-Kn; Mon, 10 Jul 2023 20:46:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=D8mFncSuiOb0SNdC84qMjnH1owlFYEwJJzFDGKB9AUQ=; b=sbgMsnwYHj1psGl99B+TPDPLxS
	8sOCkceN85tv0CgBjGmgeO+f77hIPiULjv7w8i1LCMG/SU5HivlZbXofxlUGU0Mk+lI1K+e07HAUk
	fM9vILlyT8wYJFAYC4G0am4/9K5BVeS1289GT8A4H9Jw8EikKw4iH+nfeEUQ4dUpD27c=;
Message-ID: <4ea37c25-c4b0-7cc7-725b-4ea10c727743@xen.org>
Date: Mon, 10 Jul 2023 21:46:26 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 1/2] restrict concept of pIRQ to x86
To: Jan Beulich <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>
References: <85e59fd5-9a06-48b4-ba7e-81865d44e332@suse.com>
 <98f51b96-8a1c-7f33-b4d3-1744174df465@suse.com>
 <ZFNiS8oxfozlxCz6@Air-de-Roger>
 <2a46c7df-b380-cc41-5582-70b4829d7f47@suse.com>
 <ZFNpI929Zk61sZ5X@Air-de-Roger>
 <cf8bb56f-8fc5-77a6-40c1-a2f10970a094@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <cf8bb56f-8fc5-77a6-40c1-a2f10970a094@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 04/05/2023 09:21, Jan Beulich wrote:
> On 04.05.2023 10:13, Roger Pau MonnÃ© wrote:
>> On Thu, May 04, 2023 at 09:50:27AM +0200, Jan Beulich wrote:
>>> On 04.05.2023 09:44, Roger Pau MonnÃ© wrote:
>>>> On Wed, May 03, 2023 at 05:33:05PM +0200, Jan Beulich wrote:
>>>>> --- a/xen/include/xen/sched.h
>>>>> +++ b/xen/include/xen/sched.h
>>>>> @@ -438,12 +438,14 @@ struct domain
>>>>>   
>>>>>       struct grant_table *grant_table;
>>>>>   
>>>>> +#ifdef CONFIG_HAS_PIRQ
>>>>>       /*
>>>>>        * Interrupt to event-channel mappings and other per-guest-pirq data.
>>>>>        * Protected by the domain's event-channel spinlock.
>>>>>        */
>>>>>       struct radix_tree_root pirq_tree;
>>>>>       unsigned int     nr_pirqs;
>>>>> +#endif
>>>>
>>>> Won't it be cleaner to just move this into arch_domain and avoid a
>>>> bunch of the ifdefary? As the initialization of the fields would be
>>>> moved to arch_domain_create() also.
>>>
>>> That's hard to decide without knowing what e.g. RISC-V is going to
>>> want. Taking (past) IA-64 into consideration - that would likely
>>> have wanted to select this new HAS_PIRQ, and hence keeping these
>>> pieces where they are imo makes sense.
>>
>> I'm kind of confused, what does Arm do here?  AFAICT the pirq_tree is
>> used by both PV and HVM guests in order to store the native interrupt
>> -> guest interrupt translation, doesn't Arm also need something
>> similar?
> 
> According to [1] they don't, hence the (new in v2) change here. Aiui
> they simply map IRQ to pIRQ 1:1.

The vGIC is able to cope with vIRQ != pIRQ. But so far, we only allow a 
domain to map 1:1.

For that we are storing the pIRQ to vIRQ mapping in the IRQ desc and 
have a pointer to the desc in the vIRQ information.

So no need to a PIRQ tree on the Arm side.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 20:59:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 20:59:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561407.877838 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIxyP-0008Er-MR; Mon, 10 Jul 2023 20:59:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561407.877838; Mon, 10 Jul 2023 20:59:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIxyP-0008Ek-Jp; Mon, 10 Jul 2023 20:59:09 +0000
Received: by outflank-mailman (input) for mailman id 561407;
 Mon, 10 Jul 2023 20:59:08 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qIxyO-0008Eb-4P
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 20:59:08 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qIxyN-0001qE-0K; Mon, 10 Jul 2023 20:59:07 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qIxyM-0004Sr-Pz; Mon, 10 Jul 2023 20:59:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:Subject:
	From:References:Cc:To:MIME-Version:Date:Message-ID;
	bh=jQhlamo0auyjYn+di/qoY4T1dB+rjc/i+EUateFuE6A=; b=M07OgVp/IRO91SSGVqpcI5L/3j
	09DFgI/u9iiVYiOFHArE7kyHJODRxxPRcz0DNQ9OtDl8Nf9sWOTRBTTRwSAtlmCD79BcydLqVc0mR
	5E63/KvcNTZuMJW438N1Ea3vgeiotFcv2UlP/6vtZPDfUQN03lbBgyNhUp9rwMlX3YpE=;
Message-ID: <0cd9d94b-0a8d-a3e1-d683-04fac1572750@xen.org>
Date: Mon, 10 Jul 2023 21:59:04 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>
References: <85e59fd5-9a06-48b4-ba7e-81865d44e332@suse.com>
 <98f51b96-8a1c-7f33-b4d3-1744174df465@suse.com>
From: Julien Grall <julien@xen.org>
Subject: Re: [PATCH v2 1/2] restrict concept of pIRQ to x86
In-Reply-To: <98f51b96-8a1c-7f33-b4d3-1744174df465@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Jan,

On 03/05/2023 16:33, Jan Beulich wrote:
> ... by way of a new arch-selectable Kconfig control.
> 
> Note that some smaller pieces of code are left without #ifdef, to keep
> things better readable. Hence items like ECS_PIRQ, nr_static_irqs, or
> domain_pirq_to_irq() remain uniformly.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> I'm not really certain about XEN_DOMCTL_irq_permission: With pIRQ-s not
> used, the prior pIRQ -> IRQ translation cannot have succeeded on Arm, so
> quite possibly the entire domctl is unused there? Yet then how is access
> to particular device IRQs being granted/revoked?
> ---
> v2: New.
> 
> --- a/docs/misc/xen-command-line.pandoc
> +++ b/docs/misc/xen-command-line.pandoc
> @@ -1120,7 +1120,7 @@ introduced with the Nehalem architecture
>         intended as an emergency option for people who first chose fast, then
>         change their minds to secure, and wish not to reboot.**
>   
> -### extra_guest_irqs
> +### extra_guest_irqs (x86)
>   > `= [<domU number>][,<dom0 number>]`
>   
>   > Default: `32,<variable>`
> --- a/xen/arch/arm/include/asm/irq.h
> +++ b/xen/arch/arm/include/asm/irq.h
> @@ -52,7 +52,6 @@ struct arch_irq_desc {
>   
>   extern const unsigned int nr_irqs;
>   #define nr_static_irqs NR_IRQS
> -#define arch_hwdom_irqs(domid) NR_IRQS
>   
>   struct irq_desc;
>   struct irqaction;
> --- a/xen/arch/x86/Kconfig
> +++ b/xen/arch/x86/Kconfig
> @@ -25,6 +25,7 @@ config X86
>   	select HAS_PCI
>   	select HAS_PCI_MSI
>   	select HAS_PDX
> +	select HAS_PIRQ
>   	select HAS_SCHED_GRANULARITY
>   	select HAS_UBSAN
>   	select HAS_VPCI if HVM
> --- a/xen/common/Kconfig
> +++ b/xen/common/Kconfig
> @@ -56,6 +56,9 @@ config HAS_KEXEC
>   config HAS_PDX
>   	bool
>   
> +config HAS_PIRQ
> +	bool
> +
>   config HAS_PMAP
>   	bool
>   
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -350,6 +350,8 @@ static int late_hwdom_init(struct domain
>   #endif
>   }
>   
> +#ifdef CONFIG_HAS_PIRQ
> +
>   static unsigned int __read_mostly extra_hwdom_irqs;
>   static unsigned int __read_mostly extra_domU_irqs = 32;
>   
> @@ -364,6 +366,8 @@ static int __init cf_check parse_extra_g
>   }
>   custom_param("extra_guest_irqs", parse_extra_guest_irqs);
>   
> +#endif /* CONFIG_HAS_PIRQ */

NIT: I would suggest create a file pirq.c and move anything PIRQ 
specific there. This should reduce the number of #ifdef in the code.

> +
>   /*
>    * Release resources held by a domain.  There may or may not be live
>    * references to the domain, and it may or may not be fully constructed.
> @@ -653,6 +657,7 @@ struct domain *domain_create(domid_t dom
>       if ( is_system_domain(d) && !is_idle_domain(d) )
>           return d;
>   
> +#ifdef CONFIG_HAS_PIRQ
>       if ( !is_idle_domain(d) )
>       {
>           if ( !is_hardware_domain(d) )
> @@ -664,6 +669,7 @@ struct domain *domain_create(domid_t dom
>   
>           radix_tree_init(&d->pirq_tree);
>       }
> +#endif
>   
>       if ( (err = arch_domain_create(d, config, flags)) != 0 )
>           goto fail;
> @@ -755,7 +761,9 @@ struct domain *domain_create(domid_t dom
>       {
>           evtchn_destroy(d);
>           evtchn_destroy_final(d);
> +#ifdef CONFIG_HAS_PIRQ
>           radix_tree_destroy(&d->pirq_tree, free_pirq_struct);
> +#endif
>       }
>       if ( init_status & INIT_watchdog )
>           watchdog_domain_destroy(d);
> @@ -1151,7 +1159,9 @@ static void cf_check complete_domain_des
>   
>       evtchn_destroy_final(d);
>   
> +#ifdef CONFIG_HAS_PIRQ
>       radix_tree_destroy(&d->pirq_tree, free_pirq_struct);
> +#endif
>   
>       xfree(d->vcpu);
>   
> @@ -1864,6 +1874,8 @@ long do_vm_assist(unsigned int cmd, unsi
>   }
>   #endif
>   
> +#ifdef CONFIG_HAS_PIRQ
> +

With this change and some others, we probably can remove 
alloc_pirq_struct() & co. I will have a look to send a clean-up patch 
after this goes in.

>   struct pirq *pirq_get_info(struct domain *d, int pirq)
>   {
>       struct pirq *info = pirq_info(d, pirq);
> @@ -1893,6 +1905,8 @@ void cf_check free_pirq_struct(void *ptr
>       call_rcu(&pirq->rcu_head, _free_pirq_struct);
>   }
>   
> +#endif /* CONFIG_HAS_PIRQ */
> +
>   struct migrate_info {
>       long (*func)(void *data);
>       void *data;
> --- a/xen/common/domctl.c
> +++ b/xen/common/domctl.c
> @@ -683,11 +683,13 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
>           unsigned int pirq = op->u.irq_permission.pirq, irq;
>           int allow = op->u.irq_permission.allow_access;
>   
> +#ifdef CONFIG_HAS_PIRQ
>           if ( pirq >= current->domain->nr_pirqs )
>           {
>               ret = -EINVAL;
>               break;
>           }
> +#endif

This #ifdef reads a little bit strange. If we can get away with the 
check for Arm, then why can't when CONFIG_HAS_PIRQ=y? Overall, a comment 
would be helpful.

>           irq = pirq_access_permitted(current->domain, pirq);
>           if ( !irq || xsm_irq_permission(XSM_HOOK, d, irq, allow) )
>               ret = -EPERM;

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 21:09:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 21:09:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561411.877849 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIy7s-0001Ly-Hl; Mon, 10 Jul 2023 21:08:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561411.877849; Mon, 10 Jul 2023 21:08:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIy7s-0001Lr-FB; Mon, 10 Jul 2023 21:08:56 +0000
Received: by outflank-mailman (input) for mailman id 561411;
 Mon, 10 Jul 2023 21:08:55 +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
 <SRS0=atS4=C4=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qIy7q-0001Ll-VY
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 21:08:54 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f86650c5-1f65-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 23:08:52 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 0B8DD611FE;
 Mon, 10 Jul 2023 21:08:51 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0033C433C8;
 Mon, 10 Jul 2023 21:08:48 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f86650c5-1f65-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689023330;
	bh=1RigCnDsZjZm2CJMHPZcxT1GYO4ucMyFDXXUYEdpraY=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=WRFP8dZS6HfUhys4FzGFR9EO173OuuuMYD2bQsDbxGOzpsfREr8/xTDLJsDgEL2jp
	 QrplQtMckL3M890SkTfAdf3Xy81MkdlLwlz06UF2Y5wybL7B3JLYf0DkS1JSpGUX8w
	 0jCc3DscevAjzMXaczrIKaFq1kPI/mGSmjgFFw0PN1NkzanBqLVS6Bj515yay/BvyD
	 1JEcBh0JuAtWL/+w8d9Szt24vXaJBjr7YiBHastp4fHwbpChVa3ysuzGQ94jFEk1Jv
	 cYU6FVlQke8Mo53R4Ss08j0iuYZv1vVB0GmJ7NIut20POs3GZcXtZ2LSbtQrgZ5hz2
	 hJVM2m+3hJlOg==
Date: Mon, 10 Jul 2023 14:08:47 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <xenia.ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH] x86/emul: fix violations of MISRA C:2012 Rule 8.3
 on parameter names
In-Reply-To: <149e5516d0db712916912fce8ab9c8285023e7c8.1688997768.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307101408390.761183@ubuntu-linux-20-04-desktop>
References: <149e5516d0db712916912fce8ab9c8285023e7c8.1688997768.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 10 Jul 2023, Federico Serafini wrote:
> The headline of MISRA C:2012 Rule 8.3 states that:
> "All declarations of an object or function shall use the same names and
> type qualifiers".
> 
> Change parameter names to meet the following requirements:
> 1) keep consistency between declarations and the corresponding
>    definitions thus fixing violations of the Rule 8.3;
> 2) use the globally-adopted shorthands (e.g., 's' to denote a 'state');
> 3) keep adjacent declarations consistent with respect to the parameter
>    names that are used.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  xen/arch/x86/x86_emulate/x86_emulate.c | 54 +++++++++++++-------------
>  xen/arch/x86/x86_emulate/x86_emulate.h | 26 ++++++-------
>  2 files changed, 40 insertions(+), 40 deletions(-)
> 
> diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
> index be2e3c6b11..2de1be7996 100644
> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
> @@ -8446,12 +8446,12 @@ int x86_emul_rmw(
>      void *ptr,
>      unsigned int bytes,
>      uint32_t *eflags,
> -    struct x86_emulate_state *state,
> +    struct x86_emulate_state *s,
>      struct x86_emulate_ctxt *ctxt)
>  {
>      unsigned long *dst = ptr;
>  
> -    ASSERT(bytes == state->op_bytes);
> +    ASSERT(bytes == s->op_bytes);
>  
>  /*
>   * We cannot use Jcc below, as this code executes with the guest status flags
> @@ -8469,23 +8469,23 @@ int x86_emul_rmw(
>      ".L" #op "%=:\n\t" \
>      #op
>  
> -    switch ( state->rmw )
> +    switch ( s->rmw )
>      {
>  #define UNOP(op) \
>      case rmw_##op: \
>          _emulate_1op(COND_LOCK(op), dst, bytes, *eflags, \
> -                     "c" ((long)state->lock_prefix) ); \
> +                     "c" ((long)s->lock_prefix) ); \
>          break
>  #define BINOP(op, sfx) \
>      case rmw_##op: \
>          _emulate_2op_SrcV##sfx(COND_LOCK(op), \
> -                               state->ea.val, dst, bytes, *eflags, \
> -                               "c" ((long)state->lock_prefix) ); \
> +                               s->ea.val, dst, bytes, *eflags, \
> +                               "c" ((long)s->lock_prefix) ); \
>          break
>  #define SHIFT(op) \
>      case rmw_##op: \
> -        ASSERT(!state->lock_prefix); \
> -        _emulate_2op_SrcB(#op, state->ea.val, dst, bytes, *eflags); \
> +        ASSERT(!s->lock_prefix); \
> +        _emulate_2op_SrcB(#op, s->ea.val, dst, bytes, *eflags); \
>          break
>  
>      BINOP(adc, );
> @@ -8514,46 +8514,46 @@ int x86_emul_rmw(
>  #undef SHIFT
>  
>      case rmw_not:
> -        switch ( state->op_bytes )
> +        switch ( s->op_bytes )
>          {
>          case 1:
>              asm ( COND_LOCK(notb) " %0"
> -                  : "+m" (*dst) : "c" ((long)state->lock_prefix) );
> +                  : "+m" (*dst) : "c" ((long)s->lock_prefix) );
>              break;
>          case 2:
>              asm ( COND_LOCK(notw) " %0"
> -                  : "+m" (*dst) : "c" ((long)state->lock_prefix) );
> +                  : "+m" (*dst) : "c" ((long)s->lock_prefix) );
>              break;
>          case 4:
>              asm ( COND_LOCK(notl) " %0"
> -                  : "+m" (*dst) : "c" ((long)state->lock_prefix) );
> +                  : "+m" (*dst) : "c" ((long)s->lock_prefix) );
>              break;
>  #ifdef __x86_64__
>          case 8:
>              asm ( COND_LOCK(notq) " %0"
> -                  : "+m" (*dst) : "c" ((long)state->lock_prefix) );
> +                  : "+m" (*dst) : "c" ((long)s->lock_prefix) );
>              break;
>  #endif
>          }
>          break;
>  
>      case rmw_shld:
> -        ASSERT(!state->lock_prefix);
> +        ASSERT(!s->lock_prefix);
>          _emulate_2op_SrcV_nobyte("shld",
> -                                 state->ea.val, dst, bytes, *eflags,
> -                                 "c" (state->ea.orig_val) );
> +                                 s->ea.val, dst, bytes, *eflags,
> +                                 "c" (s->ea.orig_val) );
>          break;
>  
>      case rmw_shrd:
> -        ASSERT(!state->lock_prefix);
> +        ASSERT(!s->lock_prefix);
>          _emulate_2op_SrcV_nobyte("shrd",
> -                                 state->ea.val, dst, bytes, *eflags,
> -                                 "c" (state->ea.orig_val) );
> +                                 s->ea.val, dst, bytes, *eflags,
> +                                 "c" (s->ea.orig_val) );
>          break;
>  
>      case rmw_xadd:
>          *eflags &= ~EFLAGS_MASK;
> -        switch ( state->op_bytes )
> +        switch ( s->op_bytes )
>          {
>              unsigned long dummy;
>  
> @@ -8562,11 +8562,11 @@ int x86_emul_rmw(
>              asm ( "" \
>                    COND_LOCK(xadd) " %"#mod"[reg], %[mem]; " \
>                    _POST_EFLAGS("[efl]", "[msk]", "[tmp]") \
> -                  : [reg] "+" #cst (state->ea.val), \
> +                  : [reg] "+" #cst (s->ea.val), \
>                      [mem] "+m" (*dst), \
>                      [efl] "+g" (*eflags), \
>                      [tmp] "=&r" (dummy) \
> -                  : "c" ((long)state->lock_prefix), \
> +                  : "c" ((long)s->lock_prefix), \
>                      [msk] "i" (EFLAGS_MASK) ); \
>              break
>          XADD(1, q, b);
> @@ -8580,21 +8580,21 @@ int x86_emul_rmw(
>          break;
>  
>      case rmw_xchg:
> -        switch ( state->op_bytes )
> +        switch ( s->op_bytes )
>          {
>          case 1:
> -            asm ( "xchg %b0, %b1" : "+q" (state->ea.val), "+m" (*dst) );
> +            asm ( "xchg %b0, %b1" : "+q" (s->ea.val), "+m" (*dst) );
>              break;
>          case 2:
> -            asm ( "xchg %w0, %w1" : "+r" (state->ea.val), "+m" (*dst) );
> +            asm ( "xchg %w0, %w1" : "+r" (s->ea.val), "+m" (*dst) );
>              break;
>          case 4:
>  #ifdef __x86_64__
> -            asm ( "xchg %k0, %k1" : "+r" (state->ea.val), "+m" (*dst) );
> +            asm ( "xchg %k0, %k1" : "+r" (s->ea.val), "+m" (*dst) );
>              break;
>          case 8:
>  #endif
> -            asm ( "xchg %0, %1" : "+r" (state->ea.val), "+m" (*dst) );
> +            asm ( "xchg %0, %1" : "+r" (s->ea.val), "+m" (*dst) );
>              break;
>          }
>          break;
> diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h
> index 40d5054fb7..698750267a 100644
> --- a/xen/arch/x86/x86_emulate/x86_emulate.h
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.h
> @@ -746,36 +746,36 @@ x86_decode_insn(
>          struct x86_emulate_ctxt *ctxt));
>  
>  unsigned int
> -x86_insn_opsize(const struct x86_emulate_state *state);
> +x86_insn_opsize(const struct x86_emulate_state *s);
>  int
> -x86_insn_modrm(const struct x86_emulate_state *state,
> +x86_insn_modrm(const struct x86_emulate_state *s,
>                 unsigned int *rm, unsigned int *reg);
>  unsigned long
> -x86_insn_operand_ea(const struct x86_emulate_state *state,
> +x86_insn_operand_ea(const struct x86_emulate_state *s,
>                      enum x86_segment *seg);
>  unsigned long
> -x86_insn_immediate(const struct x86_emulate_state *state,
> +x86_insn_immediate(const struct x86_emulate_state *s,
>                     unsigned int nr);
>  unsigned int
> -x86_insn_length(const struct x86_emulate_state *state,
> +x86_insn_length(const struct x86_emulate_state *s,
>                  const struct x86_emulate_ctxt *ctxt);
>  bool cf_check
> -x86_insn_is_mem_access(const struct x86_emulate_state *state,
> +x86_insn_is_mem_access(const struct x86_emulate_state *s,
>                         const struct x86_emulate_ctxt *ctxt);
>  bool cf_check
> -x86_insn_is_mem_write(const struct x86_emulate_state *state,
> +x86_insn_is_mem_write(const struct x86_emulate_state *s,
>                        const struct x86_emulate_ctxt *ctxt);
>  bool cf_check
> -x86_insn_is_portio(const struct x86_emulate_state *state,
> +x86_insn_is_portio(const struct x86_emulate_state *s,
>                     const struct x86_emulate_ctxt *ctxt);
>  bool cf_check
> -x86_insn_is_cr_access(const struct x86_emulate_state *state,
> +x86_insn_is_cr_access(const struct x86_emulate_state *s,
>                        const struct x86_emulate_ctxt *ctxt);
>  
>  #if !defined(__XEN__) || defined(NDEBUG)
> -static inline void x86_emulate_free_state(struct x86_emulate_state *state) {}
> +static inline void x86_emulate_free_state(struct x86_emulate_state *s) {}
>  #else
> -void x86_emulate_free_state(struct x86_emulate_state *state);
> +void x86_emulate_free_state(struct x86_emulate_state *s);
>  #endif
>  
>  #ifdef __XEN__
> @@ -800,7 +800,7 @@ x86_emul_rmw(
>      void *ptr,
>      unsigned int bytes,
>      uint32_t *eflags,
> -    struct x86_emulate_state *state,
> +    struct x86_emulate_state *s,
>      struct x86_emulate_ctxt *ctxt);
>  int
>  x86_emul_blk(
> @@ -808,7 +808,7 @@ x86_emul_blk(
>      void *data,
>      unsigned int bytes,
>      uint32_t *eflags,
> -    struct x86_emulate_state *state,
> +    struct x86_emulate_state *s,
>      struct x86_emulate_ctxt *ctxt);
>  
>  static inline void x86_emul_hw_exception(
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 22:29:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 22:29:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561416.877858 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIzNH-0001Bv-0H; Mon, 10 Jul 2023 22:28:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561416.877858; Mon, 10 Jul 2023 22:28:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIzNG-0001Bo-To; Mon, 10 Jul 2023 22:28:54 +0000
Received: by outflank-mailman (input) for mailman id 561416;
 Mon, 10 Jul 2023 22:28:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIzNE-0001Be-Tz; Mon, 10 Jul 2023 22:28:52 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIzNE-0003ss-Ou; Mon, 10 Jul 2023 22:28:52 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qIzNE-0007qh-AW; Mon, 10 Jul 2023 22:28:52 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qIzNE-0008Tl-AC; Mon, 10 Jul 2023 22:28:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=LrbN5WX7H45GfcXOugvSmJuyL0YQGfxXTXmqSniUyls=; b=mvGan2ZB1ohPZnWi++0/1hi/Nl
	JYUJPaEkHSb3Yls43EhYtNnhGIsz6QBh+FhJUYwOlbvciTLSJwqpSUI4Tm2HlFoUesxdUusilgiQk
	bE6G16XMrphUVuu5sA7n6oeFEgeqZXyLAb0Gc33Gnx+4TgIJ4v1XSYFbV9IakksIk358=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181752-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181752: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-qemut-rhel6hvm-amd:xen-install:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qcow2:guest-start/debian.repeat:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=fd62986f6b776876f3028a755c859d02e55dc262
X-Osstest-Versions-That:
    xen=886c22f00c575199f7bb3dc5b7662dd09bf05146
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 10 Jul 2023 22:28:52 +0000

flight 181752 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181752/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-i386-qemut-rhel6hvm-amd  7 xen-install             fail like 181727
 test-amd64-amd64-xl-qcow2    21 guest-start/debian.repeat    fail  like 181736
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181747
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181747
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181747
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181747
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181747
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181747
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181747
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181747
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181747
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181747
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181747
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181747
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass

version targeted for testing:
 xen                  fd62986f6b776876f3028a755c859d02e55dc262
baseline version:
 xen                  886c22f00c575199f7bb3dc5b7662dd09bf05146

Last test of basis   181747  2023-07-10 01:53:29 Z    0 days
Testing same since   181752  2023-07-10 14:37:02 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    fail    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   886c22f00c..fd62986f6b  fd62986f6b776876f3028a755c859d02e55dc262 -> master


From xen-devel-bounces@lists.xenproject.org Mon Jul 10 22:39:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Jul 2023 22:39:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561428.877884 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIzXM-0002uZ-6w; Mon, 10 Jul 2023 22:39:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561428.877884; Mon, 10 Jul 2023 22:39:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qIzXM-0002uS-4N; Mon, 10 Jul 2023 22:39:20 +0000
Received: by outflank-mailman (input) for mailman id 561428;
 Mon, 10 Jul 2023 22:39:19 +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 <SRS0=wLvp=C4=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qIzXL-0002uM-9T
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 22:39:19 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 98fbbfad-1f72-11ee-8611-37d641c3527e;
 Tue, 11 Jul 2023 00:39:16 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36AMd52c082631
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Mon, 10 Jul 2023 18:39:10 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36AMd4o5082630;
 Mon, 10 Jul 2023 15:39:04 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 98fbbfad-1f72-11ee-8611-37d641c3527e
Date: Mon, 10 Jul 2023 15:39:04 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: George Dunlap <george.dunlap@citrix.com>
Subject: Branch name transition plan?
Message-ID: <ZKyIiFPTKKIK4c8Z@mattapan.m5p.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Spam-Status: No, score=0.4 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

Is there any sort of plan to move to an alternative name for the "master"
branch?

I am not personally offended, but enough people are that this really
should get some attention.  I am concerned about potential for
reputational harm from associating with a project which has been sluggish
in moving away from the "master" naming.

Though when it comes down to it, "main" has overwhelmingly taken over to
a point where switching back to "master" is causing enough dissonance to
slow down development.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Tue Jul 11 00:46:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 00:46:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561504.877929 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ1WK-0001ld-C6; Tue, 11 Jul 2023 00:46:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561504.877929; Tue, 11 Jul 2023 00:46:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ1WK-0001lW-9F; Tue, 11 Jul 2023 00:46:24 +0000
Received: by outflank-mailman (input) for mailman id 561504;
 Tue, 11 Jul 2023 00:46:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DOJ8=C5=epam.com=prvs=15563ed9c2=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qJ1WI-0001lQ-Tx
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 00:46:23 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 59e3902f-1f84-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 02:46:20 +0200 (CEST)
Received: from pps.filterd (m0174681.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36AG006M009547; Tue, 11 Jul 2023 00:46:09 GMT
Received: from eur05-am6-obe.outbound.protection.outlook.com
 (mail-am6eur05lp2111.outbound.protection.outlook.com [104.47.18.111])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3rrbn9unxr-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Tue, 11 Jul 2023 00:46:08 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by DB9PR03MB7193.eurprd03.prod.outlook.com (2603:10a6:10:227::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul
 2023 00:46:05 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::c192:26de:9053:ab05]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::c192:26de:9053:ab05%6]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023
 00:46:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 59e3902f-1f84-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=bJPJYcqxTCFVvHGHGvIiaYFGlyRS5xWVzdFnALeaLMbYD2O2wuJGP+H8axavqMQE9w2jX0H9P1UpwHA6k/EGVWd52lA5pQKnA4sFS2sp/tBjSG/ZHJ7A2dRjXHIdjyNAwqHBldROZhG4nlbhJULfSXGO+tFYcvAO3mtHdvp9rp47kJfVHKfrLxspCXyZYF7YaNW016UHM+6Y7fAtdqFYH365ogdL2qtLvJ9CojGbvAIsT5PhP9cdYfW0wgWoHW9fhooOXmWRdESuwOZD4v0azCI6DUj62OVcHg7HSMoOkNnel4Y9iwukNMQP/P6WOlkvBLYWVaeNGN4qDdsQ50WNvg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Oq7MAyYNyIyiERDgN5/HwhrVdFHh73QKIalzw9eg63s=;
 b=JeNcy17B76YEwFSEQ5yGmEVQ77ujrMtzJCLKHmathUF/GJsTe9ZBVK0/K9qGGZjaaHlmh4fUfFLWf8tyaZCUOOmR9DauLBvbQ9hMFEl967gf63xqDJr7yGJHBIdl9E20MFA3ZRtVdNpeqRzvXtJKRL0gTYxNFFKFmjY8H0y2lXiQBaBeA0LaySSygy/MeTsojMGzrP4zuNrOaIljTPNkOQNWPZty1+b2NTJ0P2GheUHJo89tk44/v5Xvz9UvJWqo1eIh+Cfalx/yLzcmw4abBlfCpnov5YDM3KsL06PCSZm6NSDDZN3gfL+JgOnMUX+9ODPlifEQksqayU9QlPAplA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Oq7MAyYNyIyiERDgN5/HwhrVdFHh73QKIalzw9eg63s=;
 b=cdRPTxIbiEFWjM19eB/RGnpHpGCkWp5sFnRhMZaUeP+8ACqLbHbQKcHcOLYPiPt1GuSj46knPBd5Ut9FerGsIi8wOW5/g9vWoMB5Re1J+VW1FQkZqSFrjQZ8ArQs/RWXTkRjP/iPljZvWiqWQLzOMEnJotPbHzhfgyGb1iyU3gQbdWwS7GCe4MW+qJLKxrSRGfVl0KFwkT28Ype9TrY8BWMLwQbl6hqOFUoTwhdSt5sluZGbHVd8IV3wFeTq4pDh6n+pustIG3epBFzDfgDG1QtMd3PAbFc60YuPo5aTRaZ6ka0/OjRZK52T2Y3NzHL+OaPatKhGTsgZdxW6lzMT1Q==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
        Jan Beulich
	<jbeulich@suse.com>,
        Andrew Cooper <andrew.cooper3@citrix.com>,
        =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>,
        Wei Liu
	<wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
        Julien Grall
	<julien@xen.org>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Jun Nakajima
	<jun.nakajima@intel.com>,
        Kevin Tian <kevin.tian@intel.com>, Paul Durrant
	<paul@xen.org>,
        Oleksandr Tyshchenko <olekstysh@gmail.com>,
        Oleksandr
 Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: [RFC PATCH] pci: introduce per-domain PCI rwlock
Thread-Topic: [RFC PATCH] pci: introduce per-domain PCI rwlock
Thread-Index: AQHZs5ESsjHhLtlMU0qzCbDGds6cOw==
Date: Tue, 11 Jul 2023 00:46:04 +0000
Message-ID: <20230711004537.888185-1-volodymyr_babchuk@epam.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-mailer: git-send-email 2.41.0
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|DB9PR03MB7193:EE_
x-ms-office365-filtering-correlation-id: e1b96924-a563-4e8f-98b6-08db81a834bf
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 YjVXgUF16h9tQ7lIrxSeOcM5UsWLVJjSUAj/NpbRA56uzyLSkUMxV/9w96lVcQpEgyQDWtdBYlFSDlMpRUteib71etnsyD5Hegmkboe7gUwMjsSs0/zamG/cRDcpuoonqzqKtSSpoDHk6hohx2UkyJcp7GAdhB/X11ZxIcsRJDQfMzqI+9f/Nibi8bTJYGaN3DMhbYMDweqzA4umDCcT1RQQlWvc0c/sRi/9HPfzUybbIF0SW4xqpGxHuG0QzH0FPk5ygfQWgzbsd8PrmQEp+IpYGOgu2u13cd5WK0rfIbEFKGb4d8iOXVDvgRMbFsGw3I+W5g1NVGe3SoLFHUfwK2JOFVgEt2YTGGgZLIBmfRqbsjaKkRrGxYqqZof4tSGCkGDX6OgpuAQSeggLQPYBb0gMj5RWZrhJf9EUnxowku3yu5exWPtL52/kMbEW/R4sePpBY5OJSD6+s7etOJAfQtlkcCqVRq+fI6Gzwe7kuytcFlwHeLsNLjMthSeXRPpPaoUXUjoEGDDTY6s5IUby1snKaXwtIgu/YKWoLBiPA9xDlLBS6SqzajaQyqUUfh/AJcLW78QjOHDuUdxNM/ot5s9aqOKmgRFNYzdmrGIcEdJJwbAoK/NlRXTptwmUtuskwfe+WMB6gNHDDeFkdw5Itw==
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(39860400002)(366004)(396003)(136003)(451199021)(186003)(6506007)(26005)(1076003)(55236004)(2616005)(6512007)(107886003)(83380400001)(64756008)(41300700001)(4326008)(30864003)(66446008)(66556008)(5660300002)(2906002)(7416002)(316002)(8936002)(8676002)(66476007)(6916009)(66946007)(478600001)(6486002)(76116006)(71200400001)(91956017)(54906003)(36756003)(122000001)(38070700005)(38100700002)(86362001)(357404004);DIR:OUT;SFP:1101;
x-ms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hU1JPQXVaazdMYjFDblhkaHVUbWpFazBLNGRjYlJOME44?=
 =?utf-8?B?cUlZb3dFS0tsTGkrckVtb0VNa1Z5RWpTQWU3YllSMXltc1V4dEhwUW13bncz?=
 =?utf-8?B?dENiZG9QNlZzZTg2OHlpRnhOTVJRcXJSanFLNVdRN1Y2OHRJcE14R0lmMUFB?=
 =?utf-8?B?U1U4UVFmcjF6NEZMSzdNMlFYTVlNRU80OXZCaUVvLzBBSzdBNC9OVm1Eek5z?=
 =?utf-8?B?Rkg0cUs1ckNXSUxsSnY0dG8rQS85NHBwMFcvMW1tTFV0OU1aN01MSHFyMy9B?=
 =?utf-8?B?a1dJMHFKVHdQUnBPd2UrVGxOWjNxYjNhWFhLOHAzNStYQmlSREJBWUJydmda?=
 =?utf-8?B?eG0rREhtckZ5V2RBZ0dTdVJwa3FoY2FHTnlMTmFma0s0SDBhMVFFSlZFRGc5?=
 =?utf-8?B?cUZ6NXFodGFiNTQwTG82VFV5b3pBYkNrY1hwNGNaSElvU2EzSGZDSlBaeXp4?=
 =?utf-8?B?VFE9PQ==?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <C6AD6B9C91CF1F40B74094AFB835197A@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e1b96924-a563-4e8f-98b6-08db81a834bf
X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jul 2023 00:46:04.2340
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: +kA99Zyl2wv0zTc3ulwJ8f7iYlYWVzQdeBTQQZXhTo/nWgg85Ea7Mm4PIRiSlMg14JDxg5lotw5ELHSTDRKngAVk3X0ww94qK25I4p1P69Q=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR03MB7193
X-Proofpoint-ORIG-GUID: Kj1vvoxhZxKhCnqne2mzUBrbrS5hpoVo
X-Proofpoint-GUID: Kj1vvoxhZxKhCnqne2mzUBrbrS5hpoVo
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-10_18,2023-07-06_02,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0
 impostorscore=0 mlxlogscore=999 priorityscore=1501 mlxscore=0
 lowpriorityscore=0 malwarescore=0 clxscore=1011 suspectscore=0
 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2305260000 definitions=main-2307110004

QWRkIHBlci1kb21haW4gZC0+cGNpX2xvY2sgdGhhdCBwcm90ZWN0cyBhY2Nlc3MgdG8NCmQtPnBk
ZXZfbGlzdC4gUHVycG9zZSBvZiB0aGlzIGxvY2sgaXMgdG8gZ2l2ZSBndWFyYW50ZWVzIHRvIFZQ
Q0kgY29kZQ0KdGhhdCB1bmRlcmx5aW5nIHBkZXYgd2lsbCBub3QgZGlzYXBwZWFyIHVuZGVyIGZl
ZXQuIExhdGVyIGl0IHdpbGwgYWxzbw0KcHJvdGVjdCBwZGV2LT52cGNpIHN0cnVjdHVyZSBhbmQg
cGRldiBhY2Nlc3MgaW4gbW9kaWZ5X2JhcnMoKS4NCg0KU3VnZ2VzdGVkLWJ5OiBSb2dlciBQYXUg
TW9ubsOpIDxyb2dlci5wYXVAY2l0cml4LmNvbT4NClN1Z2dlc3RlZC1ieTogSmFuIEJldWxpY2gg
PGpiZXVsaWNoQHN1c2UuY29tPg0KU2lnbmVkLW9mZi1ieTogVm9sb2R5bXlyIEJhYmNodWsgP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oZCk7DQorICAgIGlmICggY29tYmluZWRfcmV0ICkNCiAg
ICAgew0KICAgICAgICAgcGNpZGV2c191bmxvY2soKTsNCi0gICAgICAgIHJldHVybiByZXQ7DQor
ICAgICAgICB3cml0ZV91bmxvY2soJmQtPnBjaV9sb2NrKTsNCisgICAgICAgIHJldHVybiBjb21i
aW5lZF9yZXQ7DQogICAgIH0NCi0gICAgbGlzdF9mb3JfZWFjaF9lbnRyeV9zYWZlICggcGRldiwg
dG1wLCAmZC0+cGRldl9saXN0LCBkb21haW5fbGlzdCApDQorDQorICAgIHdoaWxlICggIWxpc3Rf
ZW1wdHkoJmQtPnBkZXZfbGlzdCkgKQ0KICAgICB7DQotICAgICAgICBidXMgPSBwZGV2LT5idXM7
DQotICAgICAgICBkZXZmbiA9IHBkZXYtPmRldmZuOw0KLSAgICAgICAgcmV0ID0gZGVhc3NpZ25f
ZGV2aWNlKGQsIHBkZXYtPnNlZywgYnVzLCBkZXZmbikgPzogcmV0Ow0KKyAgICAgICAgc3RydWN0
IHBjaV9kZXYgKnBkZXYgPSBsaXN0X2ZpcnN0X2VudHJ5KCZkLT5wZGV2X2xpc3QsDQorICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHBjaV9kZXYs
DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9tYWlu
X2xpc3QpOw0KKyAgICAgICAgdWludDE2X3Qgc2VnID0gcGRldi0+c2VnOw0KKyAgICAgICAgdWlu
dDhfdCBidXMgPSBwZGV2LT5idXM7DQorICAgICAgICB1aW50OF90IGRldmZuID0gcGRldi0+ZGV2
Zm47DQorICAgICAgICBpbnQgcmV0Ow0KKw0KKyAgICAgICAgd3JpdGVfdW5sb2NrKCZkLT5wY2lf
bG9jayk7DQorICAgICAgICByZXQgPSBkZWFzc2lnbl9kZXZpY2UoZCwgc2VnLCBidXMsIGRldmZu
KTsNCisgICAgICAgIHdyaXRlX2xvY2soJmQtPnBjaV9sb2NrKTsNCisgICAgICAgIGlmICggcmV0
ICkNCisgICAgICAgIHsNCisgICAgICAgICAgICBib29sIHN0aWxsX3ByZXNlbnQgPSBmYWxzZTsN
CisgICAgICAgICAgICBjb25zdCBzdHJ1Y3QgcGNpX2RldiAqdG1wOw0KKw0KKyAgICAgICAgICAg
IC8qDQorICAgICAgICAgICAgICogV2UgbmVlZCB0byBjaGVjayBpZiBkZWFzc2lnbl9kZXZpY2Uo
KSBsZWZ0IG91ciBwZGV2IGluDQorICAgICAgICAgICAgICogZG9tYWluJ3MgbGlzdC4gQXMgd2Ug
ZHJvcHBlZCB0aGUgbG9jaywgd2UgY2FuJ3QgYmUgc3VyZQ0KKyAgICAgICAgICAgICAqIHRoYXQg
bGlzdCB3YXNuJ3QgcGVybXV0YXRlZCBpbiBzb21lIHJhbmRvbSB3YXksIHNvIHdlDQorICAgICAg
ICAgICAgICogbmVlZCB0byB0cmF2ZXJzZSB0aGUgd2hvbGUgbGlzdC4NCisgICAgICAgICAgICAg
Ki8NCisgICAgICAgICAgICBmb3JfZWFjaF9wZGV2ICggZCwgdG1wICkNCisgICAgICAgICAgICB7
DQorICAgICAgICAgICAgICAgIGlmICggdG1wID09IHBkZXYgKQ0KKyAgICAgICAgICAgICAgICB7
DQorICAgICAgICAgICAgICAgICAgICBzdGlsbF9wcmVzZW50ID0gdHJ1ZTsNCisgICAgICAgICAg
ICAgICAgICAgIGJyZWFrOw0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgfQ0KKyAg
ICAgICAgICAgIGlmICggc3RpbGxfcHJlc2VudCApDQorICAgICAgICAgICAgICAgIGxpc3RfbW92
ZSgmcGRldi0+ZG9tYWluX2xpc3QsICZmYWlsZWRfcGRldnMpOw0KKyAgICAgICAgICAgIGNvbWJp
bmVkX3JldCA9IHJldDsNCisgICAgICAgIH0NCiAgICAgfQ0KKw0KKyAgICBsaXN0X3NwbGljZSgm
ZmFpbGVkX3BkZXZzLCA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orKysgYi94ZW4vaW5jbHVkZS94ZW4vc2NoZWQuaA0KQEAgLTQ2
MCw2ICs0NjAsNyBAQCBzdHJ1Y3QgZG9tYWluDQogDQogI2lmZGVmIENPTkZJR19IQVNfUENJDQog
ICAgIHN0cnVjdCBsaXN0X2hlYWQgcGRldl9saXN0Ow0KKyAgICByd2xvY2tfdCBwY2lfbG9jazsN
CiAjZW5kaWYNCiANCiAjaWZkZWYgQ09ORklHX0hBU19QQVNTVEhST1VHSA0KLS0gDQoyLjQxLjAN
Cg==


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 01:46:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 01:46:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561512.877939 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ2Rr-0006WR-NQ; Tue, 11 Jul 2023 01:45:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561512.877939; Tue, 11 Jul 2023 01:45:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ2Rr-0006WK-Jx; Tue, 11 Jul 2023 01:45:51 +0000
Received: by outflank-mailman (input) for mailman id 561512;
 Tue, 11 Jul 2023 01:45:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=j4z7=C5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1qJ2Rq-0006WE-7j
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 01:45:50 +0000
Received: from sender4-of-o50.zoho.com (sender4-of-o50.zoho.com
 [136.143.188.50]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a72cef40-1f8c-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 03:45:47 +0200 (CEST)
Received: from [10.10.1.138] (static-72-81-132-2.bltmmd.fios.verizon.net
 [72.81.132.2]) by mx.zohomail.com
 with SMTPS id 1689039917513486.26483575552004;
 Mon, 10 Jul 2023 18:45:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a72cef40-1f8c-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; t=1689039919; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=LNbMXlFZdC9QLvkSATM6pvc1piDdQtr3Cod9bZ+I4VRe6jTdtd48u25IWrBfqV4W75ibM75QVabS6QMjD96TcSQ0pn8y9Tz6StW6hh9Mn04GzJaPhYZhbnhNAW2KVjIovuInFzU4u9zzhR4ZPni/pK8zXK6xau3xxHKk1GWusoM=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1689039919; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; 
	bh=kgHWB+JIkTCLQZb1jJOehzu38V5z1VYek2Z9IqxNwGM=; 
	b=grkn9vLonR5IOVY8on2mk1rti5pKVOsiZb/847LTRyg8hWFzFShZik3+mQ9FGfwzC8qi677bpn9pEGOWViGdV8LSwFR86YZLTlokuaCPl9dloaHnLP40imCGRZaDyHIOgqDcmDluiog5TiIssAP1OtUjYpX/71VT8THGDkgtmaY=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1689039919;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To;
	bh=kgHWB+JIkTCLQZb1jJOehzu38V5z1VYek2Z9IqxNwGM=;
	b=ZFBc8gtq+BtYqcmQ6qtiXnplpWbKKc5sCtQ5KcSIn8RBPyZ1J0PiK2iCs9QoaT4b
	YuK5rexIynvJM+0FDUQBJkJMwEbDNDNbLAP1SL8KWeZtf1UcDkRU+9dKVAv4OapDuWQ
	FASriQ4brL5epsQ8L7Fgc/ZxIiOoSyLZVuHq7+N4=
Message-ID: <8ec3da55-b0ca-3b4e-d3b3-8f5560074c99@apertussolutions.com>
Date: Mon, 10 Jul 2023 21:45:13 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [RFC PATCH] xen/arm: Rebranding dom0less feature
To: Stefano Stabellini <sstabellini@kernel.org>,
 Rich Persaud <persaur@gmail.com>
Cc: Luca Fancellu <luca.fancellu@arm.com>,
 Stefano Stabellini <stefano.stabellini@amd.com>,
 Christopher Clark <christopher.w.clark@gmail.com>,
 George Dunlap <george.dunlap@cloud.com>,
 Andrew Cooper <Andrew.Cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
 Henry Wang <Henry.Wang@arm.com>,
 Community Manager <community.manager@xenproject.org>,
 Doug Goldstein <cardoe@cardoe.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Anthony PERARD <anthony.perard@citrix.com>, Rian Quinn
 <rianquinn@gmail.com>, Ian Jackson <iwj@xenproject.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Scott Davis <scott.davis@starlab.io>, Adam Fraser <adam@starlab.io>,
 Paul Durrant <paul@xen.org>, rsmith@riversideresearch.org,
 m.a.young@durham.ac.uk, Elliott Mitchell <ehem+xen@m5p.com>,
 openxt <openxt@googlegroups.com>, Jason Andryuk <jandryuk@gmail.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= <marmarek@invisiblethingslab.com>
References: <4CAC8F69-ABE0-47D7-9421-77F0719B9BDE@arm.com>
 <7C4F691F-1C60-48EF-A1B6-B358DF16B13B@gmail.com>
 <alpine.DEB.2.22.394.2307081108440.761183@ubuntu-linux-20-04-desktop>
Content-Language: en-US
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
In-Reply-To: <alpine.DEB.2.22.394.2307081108440.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

On 7/8/23 14:08, Stefano Stabellini wrote:
 > On Sat, 8 Jul 2023, Rich Persaud wrote:
 >> On Jul 8, 2023, at 03:29, Luca Fancellu <luca.fancellu@arm.com> wrote:
 >>> ï»¿
 >>>>>>
 >>>>>> Instead, the use case configurations should themselves be 
describable.
 >>>>>
 >>>>> Thanks Christopher, Daniel and all!
 >>>>>
 >>>>> So if I understand correctly, you are in favor if renaming 
Dom0less to
 >>>>> Hyperlaunch throughout the Xen codebase? And we need a 
clarification of
 >>>>> the docs/, especially docs/features/dom0less.pandoc?
 >>>>
 >>>> Christopher wrote:
 >>>>>> = Community resourcing
 >>>>
 >>>> Note the pre-requisite work items for upstream Xen, listed under 
"Community Resourcing", to merge code for Hyperlaunch common interfaces 
and test cases, with docs on configuration of Hyperlaunch to deliver 
functionality for dom0less use cases.
 >>>
 >>> Are you saying that before renaming the â€œdom0lessâ€ feature, we 
should wait for it to be ported to the common code?
 >>
 >> Why "wait"? In what timeframe do you expect dom0less to use 
Hyperlaunch code?
 >>
 >> Can kernel component foo adopt the name of kernel component bar 
without code change?
 >>
 >> Can dom0less stakeholders derive Hyperlaunch benefits without using 
Hyperlaunch code?
 >
 >
 > I think Rich is saying that before using the same name we should make
 > sure that the interfaces and features are actually comparable and maybe
 > even "compatible". I think that is very reasonable. Rich, did I
 > understand correctly?

Essentially, yes this is what is being sought here. This does not mean 
that the full capability has to be present for the adoption of the 
common name, but that it can be accomplished through a path of integration.

 > The Hyperlaunch (x86) code is not yet upstream, but the design document
 > that describes the device tree interface shows an interface that is very
 > similar, almost compatible, with today's dom0less (ARM) device tree
 > interface.

I would caution the use of the current in-tree document as it is today, 
it was posted under the design folder as it was only the design and not 
burdened with the realities of implementation. Along the path of v1 
implementation, recent PVH expansion, and roles update, each have 
required updates to the design which are not yet included in the in-tree 
docs.

To address, this the plan below starts with the documentation patch 
posted in v1 of the hyperlaunch series:

 
https://lists.xenproject.org/archives/html/xen-devel/2022-07/msg00353.html

and will contain updates for community feedback received:

 
https://lists.xenproject.org/archives/html/xen-devel/2022-07/msg01015.html

and development work that has been done for PVH and roles.

 > The structure of the device tree information is the same. Going through
 > it I could only spot only tiny differences:
 > - top level node is "hypervisor" instead of "chosen"
 > - "module-addr" instead of "reg"
 > - "module,kernel" instead of "multiboot,kernel"
 > - "module,ramdisk" instead of "multiboot,ramdisk"
 >
 > The rest is the same. If we sort out these small differences one way or
 > the other then the resulting interface should actually be fully
 > compatible and we could reuse the existing Dom0less (ARM) code to parse
 > an HyperLaunch (x86) configuration.
 >
 > The top level node is not a problem. We could easily deal with both
 > "hypervisor" and also "chosen". Or we could pick a third different name
 > for both: "domains" which is the one used by System Device Tree.
 >
 > I think we should rename "module-addr" to "reg" in the hyperlaunch
 > design document. I don't think it would have any effect on the existing
 > hyperlaunch (x86) code and usage because direct addresses are typically
 > not used on x86.
 >
 > "module,kernel" and "module,ramdisk": we could either get rid of them in
 > favor of "multiboot,kernel" and "multiboot,ramdisk", or we could add
 > "module,kernel" and "module,ramdisk" as alternative aliases in the
 > existing dom0less (ARM) code. We already have "xen,linux-zimage" and
 > "xen,linux-initrd" as aliases so it is not a problem.
 >
 >
 > Also, I do think that Dom0less stakeholders would benefit from
 > Hyperlaunch code such as Dom0's reduction of privilege. Things like
 > "permissions" and "functions" of the Hyperlauch device tree interface
 > design document.

The roles work takes that to its final conclusion, from which everyone 
will benefit.

 > So, my opinion is that we should go ahead with dom0less->hyperlaunch
 > rename but we should also try to make the two device tree interfaces
 > compatible, sorting out the small differences above. That would help a
 > lot in terms of documentation and tooling. It would be ideal if things
 > like ImageBuilder worked equally well for Hyperlaunch (x86) and Dom0less
 > (ARM).

Let me build on the plan laid out by Christopher, that detailed arriving 
at the completion for hyperlaunch, and provide a set of steps to arrive 
at a new short-term milestone to a larger roadmap. The intent being to 
arrive at the immediate desire of the community to see dom0less renamed. 
For the longer term, as Christopher was alluding, there is still a 
significant amount of work to be done to deliver one of the biggest 
market differentiating capabilities for Xen in some time.

As Stefano has acknowledged, hyperlaunch is a concept that is beyond 
domain construction and that is, or will be, embodied by a set of 
interfaces and capabilities. Considering dom0less as it is implemented 
today, does not meet the former and in spirit meets the latter. 
Compounding this is that dom0less is a supported feature today, with its 
own defined interface, and a user base that is using that interface, at 
least to some degree AIUI.

We have a responsibility to the dom0less user base and future 
hyperlaunch users with requirements based on hyperlaunch design docs and 
presentations.  As such, any action taken should be done so under a 
larger roadmap of adding the complete hyperlaunch capability to Xen.

With the initial funding by AMD, the first milestone was to be moving 
Xen on to a common representation of boot material provided to the 
hypervisor. As a result of this discussion, I would like to put forth a 
new nearer term milestone of incorporating dom0less under hyperlaunch.

The naming suggestions by the community are greatly appreciated, and I 
do not want to seem dismissive of clear offers of help and assistance. 
This area is something Christopher and I discussed at length during the 
drafting of the hyperlaunch design. Something we arrived at is that 
there is only a single top level feature, which is hyperlaunch. The 
hyperlaunch feature itself will provide multiple means to configure how 
a launch will occur, one could even consider them modes of operation.

Reviewing the design doc, you will see that an initial attempt to 
categorize them was done, splitting them into a dynamic mode and static 
mode. Under these modes were multiple use cases. With that, we did not 
mean to limit the hyperlaunch modes to strictly those two, and thus 
other modes are more than reasonable to add. As such, my suggestion 
would be the introduction of the dom0less compatibility mode for 
hyperlaunch. Its very definition is a mode of hyperlaunch that supports 
the "legacy" dom0less configuration interface. This approach allows 
dom0less to effectively become hyperlaunch, deconflicts the fact that 
hyperlaunch proper has a different interface than dom0less, and provides 
a clean roadmap for migration to existing dom0less users.

To provide a concrete, measurable set of steps to achieve the dom0less 
merging milestone, I will lay out the approach as three patch series 
that will be a collaboration by the community. Each will need to be 
submitted, reviewed and merged into the tree, with the end being the 
existing dom0less becoming hyperlaunch's dom0less compatibility mode.

== Patch Series 1 (Resourced by Apertus)

The goal of this series is to properly introduce the hyperlaunch 
"feature" in to Xen. This series would be submitted by myself and will 
consist of two patches derived from the original hyperlaunch v1 series. 
The first patch is the docs patch that updates the hyperlaunch device 
tree design to reflect review feedback and updates for PVH and roles, 
mentioned above.

The second patch will start with the v1 series patch that moved the fdt 
parsing helpers into common:
https://lists.xenproject.org/archives/html/xen-devel/2022-07/msg00352.html

The patch currently moves common FDT parsing to common/fdt.c, it will be 
updated to add this path to DEVICE TREE in MAINTAINERS. As part of 
updating MAINTAINERS, there will be the addition of HYPERLAUNCH, which 
will own common/domain-builder/ and doc/design/launch paths. As such, 
this will effectively be a declaration of the top level hyperlaunch 
feature, with this as an interface, and establish the maintainers of the 
feature.

== Patch Series 2 (Requesting resourcing by Arm)

The goal of this series would be to move the dom0less device tree 
parsing under hyperlaunch. We would respectfully request a member of the 
Arm community to volunteer to take ownership and steward the series 
through submission and review process.

The implementation of this series would see dom0less device tree parsing 
to use, and expand if necessary, the common/fdt parsing helpers. I 
personally would see this logic move under common/domain-builder using a 
file name that would not collide with the files from the hyperlaunch v1 
series, e.g.  a suggestion would be fdt-dom0less.c.

As for ownership of that file, I would suggest the addition of a 
HYPERLAUNCH DOM0LESS COMPATIBILITY be added to MAINTAINERS with the 
appropriate Arm community members, but understand and willing to 
consider the position that it falls under HYPERLAUNCH. The purpose of 
using HYPERLAUNCH DOM0LESS COMPATIBILITY will be to provide a means to 
signal the retirement of dom0less compatibility mode at some future point.

== Patch Series 3 (Resourced by Apertus)

The goal of this series will be to formalize hyperlaunch dom0less 
compatibility mode. The series would be submitted by myself and/or 
Christopher. It will consist of documentation patches that will add a 
doc/features/hyperlaunch.rst and a 
doc/features/hyperlaunch/dom0less-compatiblilty.rst. The hyperlaunch.rst 
path will fall under HYPERLAUNCH, while dom0less-compatiblilty.rst will 
fall under HYPERLAUNCH DOM0LESS COMPATIBILITY. This will also see 
DOM0LESS in SUPPORTED.md be renamed to HYPERLAUNCH.

In summary, I would like to reiterate points made by Rich and 
Christopher. The motivation and concept of the hypervisor 
differentiating capability that is hyperlaunch goes back to the 2012 
domain builder work that was a companion to the hardware domain work.

Since then, there have been a few of us in the OpenXT community that 
desired to make this an integral part of Xen. Internal OpenXT 
discussions in 2017-2018 along with the announcement of dom0less 
inspired confidence there were in fact other uses cases and interest in 
Xen gaining such an integrated capability.

A fact that should not go overlooked or undervalued is that hyperlauch 
would not exist today without the extremely generous support StarLab 
provided to sponsor Christopher and I to do the R&D, proof of viability, 
and a full working prototype that provided the basis for the v1 series. 
This was not a minor investment on their part, and taking the design to 
completion requires further substantial investment. Due to an 
acquisition imposed shift in market focus, StarLab has since stepped away.

Fortunately, and for which we are immensely appreciative, AMD has 
recently stepped up to fund some hyperlaunch work items. With a growing 
number of hyperlaunch use cases, I would be happy to help those with 
budgetary influence to communicate the business benefits of investment 
in open work items, targeting specific launch configurations, safety and 
security properties.

The amount of work to be done goes beyond just parallel domain 
construction, there are tangential capabilities that need updating and 
incorporation. For instance, a topic discussed during the summit, VPCI 
and device assignment at/during hypervisor startup. Anyone looking or 
willing to provide purely financial support, feel free to reach out 
directly to Christopher and me, as we have a few avenues to enable the 
flow of funds.

Attached are candidate work items for funding and resourcing of 
hyperlaunch integration, building upon the proposed Apertus and Arm 
patch series for dom0less rename and migration to hyperlaunch common 
interfaces.

Lastly, thank you to everyone who has taken the time to engage and 
collaborate on how to resolve the task at hand!

V/r,
Daniel P. Smith

===

Here are outlines for the next development items appropriate for funding 
for progress on hyperlaunch integration, following on from the three 
series described above.

== Work Item: initial x86 Hyperlaunch SUPPORT and launch of dom0 
(Resourcing TBD)

The goal is to enable initial hyperlaunch SUPPORT on x86, building upon 
from the work in the posted v3 series of hyperlaunch.

Development proceeds from patches 9-12 of the v1 hyperlaunch series, to 
add boot with minimal construction of a classic dom0 from a device tree 
configuration. The Hyperlaunch SUPPORT statement would add x86 and Xen 
nightly CI and release-gating test configurations would be extended to 
include hyperlaunch on x86.


== Work Item: Hyperlaunch XSM policy for guests (Resourcing TBD)

The goal is to ensure that security policies of guests started via 
hyperlaunch are accurately aligned with the configured functions of each 
guest, which would allow for reduction of privilege of the dom0 in 
dom0less systems.

A new XSM policy with granular permissions for domain functions, aligned 
with the roles work, would be integrated into the hypervisor.  It would 
define new domain security labels appropriate for assigning to domUs, 
matching privileges for the domain functions that can be assigned with 
hyperlaunch, and allowing for more expressive policy control than is 
expressible with dom0less.


== Work Item: Hyperlaunch of Arm guests SUPPORT (Resourcing TBD)

The goal of this effort is to enable hyperlaunch of Arm guests.

It would enable use of the architecture-common Hyperlaunch Device Tree 
format on Arm, providing the forward migration path from the Dom0less 
format, to the new format with additional flexibility for guest 
construction, including control over console privilege assignment and 
XSM label control.

It would achieve the objective of using common cross-architecture boot 
structures and community-maintained common code.

Development would proceed from patches 9-10 of the v1 hyperlaunch 
series, to add boot with construction of dom0 and domU guests from a 
hyperlaunch device tree configuration.

Xen nightly CI and release-gating test configurations would be extended 
to include hyperlaunch with guests on Arm.


== Work Item: Hyperlaunch of x86 PV and PVH guests (Resourcing TBD)

The goal of this effort is to enable Hyperlaunch of x86 PV and PVH guests.

This builds upon the initial x86 Hyperlaunch support to add domain 
construction of PV and PVH guests.

Xen nightly CI and release-gating test configurations would be extended 
to include hyperlaunch with guests on x86.


== Work Item: XSM-enforced FuSA (Resourcing TBD)

Hyperlaunch enables disaggregation, and XSM enables granular policy.

The goal of this work is to design and implement new modular, 
fine-grained policy to integrate into Xen for control for 
safety-critical VMs and isolation from non-safety-critical VMs.


== Work Item: Design for Hyperlaunch of x86 HVM guests (Resourcing TBD)

The goal of this effort is to research, prototype and produce design 
documentation for enabling hyperlaunch of x86 HVM guests, ie. with 
support for a device emulator.

This would build upon the x86 Hyperlaunch support for PVH guests.

Investigation to consider:
- launch alongside a classic dom0 domain
- launch on a static partitioned system without a dom0
- stub domains for device emulator isolation
- boot domain integration
- device assignment


-- Thanks for your consideration!



From xen-devel-bounces@lists.xenproject.org Tue Jul 11 02:59:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 02:59:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561518.877949 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ3aN-0005mh-Rt; Tue, 11 Jul 2023 02:58:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561518.877949; Tue, 11 Jul 2023 02:58:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ3aN-0005ma-P4; Tue, 11 Jul 2023 02:58:43 +0000
Received: by outflank-mailman (input) for mailman id 561518;
 Tue, 11 Jul 2023 02:58:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=wJh2=C5=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1qJ3aM-0005mU-Au
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 02:58:42 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on20600.outbound.protection.outlook.com
 [2a01:111:f400:7eae::600])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d59ea47e-1f96-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 04:58:40 +0200 (CEST)
Received: from BL1PR12MB5849.namprd12.prod.outlook.com (2603:10b6:208:384::18)
 by MN2PR12MB4333.namprd12.prod.outlook.com (2603:10b6:208:1d3::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul
 2023 02:58:35 +0000
Received: from BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::4ef5:2244:743b:9989]) by BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::4ef5:2244:743b:9989%4]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023
 02:58:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d59ea47e-1f96-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=VGBnhfx3ZUOu/lP4+pOv+vfw4GWaguW078uQiXDr67OW7ssLEonW0Z47tqZnvJC+gg55NQcRymQXJ/0of9yYJAiqjDJ+pZ/lXrJUn96i1vfLos3bMdWv5/8Qx+Ef+SyF4JzQezMX28zHntp6ksXI/PGtBkGqkFAHI2s4C843Pt2tMMsFR2nmX5as/XaWftVIgXjm2dTDwJnAJxkeONxG7yJcCRqE5OBHIJbq+fbLr+VmvQZOTUCZLeB54uumzGEE6g2xXQct1fAtwpnCtc5T9l/qJCxv0647UHN28xF+rzmfqPu88MA8WzZQCvhK+sPXm+/bB2E8c5igPDQjRkBbNA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=nxOyPIX38iuAfl5orWXNu7iU6kXCAdRWVOdrPb9dl0Y=;
 b=AJeEyXq1wQbjKbUfhUn53erk4GPRI0uFw2KsKs/rHAQSUAR7GDQBqL5fgjekSUfG/FC20WDHJsGTLSPA4TdE33/a1wJ9MeEPl3Bb5RlCFHPV4X8fDHyCAnZmhljmsX2TW9vMrSD/e48DyZh7g2hrwSFGoBl8kwjSWxeV8wI21J1F3Hv349bn8eDJvLM4tBUgth9MJjBonFv/8Sy4eNG/lCFYubn9SKCScseD9VSZxst2ZA76swxAbXJLo64V/4JKmS7kvUyADd/oOjiEOI2tv9SkiV8gKffRuWu/Q3PANhGGJ3o5xTdx6fckXMxJvEkMalw5zMyhSYVD3UkUvArQCA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=nxOyPIX38iuAfl5orWXNu7iU6kXCAdRWVOdrPb9dl0Y=;
 b=bfkvUl85zWR9+xsoDfvJY2sFz77w4K1kHg1Yj5oKslHPal77mXXOqJuxgF4fYL0RpLtu+lX8XzZI7lmMPWov0IxhaVIb61GGCupnxl6uoQLiIqe29rC2y8EfrKqbcKjLPKA7VTPGO5yD7meKy/3JWldQNgvAWy+WkBJaiNr4L6A=
From: "Chen, Jiqian" <Jiqian.Chen@amd.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
CC: Gerd Hoffmann <kraxel@redhat.com>, =?utf-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?=
	<marcandre.lureau@gmail.com>, Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>, "Dr . David Alan
 Gilbert" <dgilbert@redhat.com>, Robert Beckett <bob.beckett@collabora.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, "Deucher,
 Alexander" <Alexander.Deucher@amd.com>, "Koenig, Christian"
	<Christian.Koenig@amd.com>, "Hildebrand, Stewart"
	<Stewart.Hildebrand@amd.com>, Xenia Ragiadakou <burzalodowa@gmail.com>,
	"Huang, Honglei1" <Honglei1.Huang@amd.com>, "Zhang, Julia"
	<Julia.Zhang@amd.com>, "Huang, Ray" <Ray.Huang@amd.com>, "Chen, Jiqian"
	<Jiqian.Chen@amd.com>
Subject: Re: [QEMU PATCH v2 1/1] virtgpu: do not destroy resources when guest
 suspend
Thread-Topic: [QEMU PATCH v2 1/1] virtgpu: do not destroy resources when guest
 suspend
Thread-Index: AQHZqyDgLuQMqtv+XkGvKc59y1uIiK+zg9gAgADt5AA=
Date: Tue, 11 Jul 2023 02:58:34 +0000
Message-ID:
 <BL1PR12MB58497266E30BE94217B0B96FE731A@BL1PR12MB5849.namprd12.prod.outlook.com>
References: <20230630070016.841459-1-Jiqian.Chen@amd.com>
 <20230630070016.841459-2-Jiqian.Chen@amd.com>
 <20230710162702-mutt-send-email-mst@kernel.org>
In-Reply-To: <20230710162702-mutt-send-email-mst@kernel.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-imapappendstamp: IA1PR12MB8239.namprd12.prod.outlook.com
 (15.20.6588.007)
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BL1PR12MB5849:EE_|MN2PR12MB4333:EE_
x-ms-office365-filtering-correlation-id: a87fdba8-6566-4987-f749-08db81bab737
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info:
 DCzaUmCNo+9SBm8PoedEuvofvBSAUZA6JSQ6l1nOLSbWh7I/xovO/30/hgTdgyBqVTd2KJZeRRvk/nRDPbFLCJDf8UnWBKP0Y3modIuP0+/LIbVjyIyfILpV5rjlcItqcEi+iTJX3mPyVSNef3kW8cmrFLNWd+UzG6+s2PXjHrev9WY6MRhpwruW8GOGKYh3EuCqEyV/QydODKQodfssUspl3Sz+2aN0JlAIzq9wDF2WPZBfdJ1LEFJIkPODKVhq1qd2bH3ikA9TSaD+/10S119VwWuBLxELCDrhtw8FZL3QPddfbkTD57JPveaAtxH2kHzK4pviJ3LkwbnwaSErrcGColWZWH7tfMBQzpGy3s5Cj6RpMwBbWsb626H+4SKxz1cJ5YA/rD5UManU0QKpK+Eg4/XYrbrlh0aSHkdwFC9doEmYioWL5koIl/oAicId+xjKFrL9E7qfGvCZPtItipgCXONdKnC8ly0XqGoHR7XOo5ApMXvh7ghXtv6vB4MMj6LFyMJIMcfkOK1pBJkdo9/U6OYPoTfSs+GAUMzdiSwtjJYcFJ4mKNTLJDbc1TO4CEgLQGTNyW1fh7tJezNQ+POzw5W2KmyQ5smezqd3Yk+SOK61MYYMn1Q7l8u1nyiD
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(376002)(396003)(366004)(39860400002)(451199021)(38100700002)(38070700005)(33656002)(55016003)(76116006)(7696005)(54906003)(71200400001)(122000001)(478600001)(6506007)(186003)(53546011)(9686003)(7416002)(316002)(2906002)(66556008)(5660300002)(6916009)(15650500001)(66946007)(66476007)(8936002)(8676002)(52536014)(66446008)(64756008)(83380400001)(4326008)(30864003)(41300700001);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?akJRdm1WemhXRkRYV00vRmhoYUQyWjlNMlRxSVlKS1huNGpRUnhSbEdHQnFL?=
 =?utf-8?B?QnAxQlRKeG52dzRNb216SzEzMDlSS1Z3cjJDZkNySDQrUGNWL3pBcFBHT0hi?=
 =?utf-8?B?WU9QQUtMZUZPWWNpcDVNV2w2SUpjNTRzNUZ2alNXQm91QVl2ZTdDallvdXht?=
 =?utf-8?B?Szlmb0IwNFkweGFOSnFzMHJweEJ5V1pldHZjRDhRbEw3QUphWWZFTTdhUGRs?=
 =?utf-8?B?Y0ZNWHlINExTYUk1R3d5RW1TWEluNlB6dVlwUmJpQlhQWjFMM3NoYXQ5Y1l2?=
 =?utf-8?B?MVBFaHVxSTNHVlhISUd5N3dnTVZjNXNzU20vVFIyby95ZEkyd0I1S1FiWnpo?=
 =?utf-8?B?NWxDb1dZUzVpMnJmbFFRTj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CA0C596C57BB1@amdcloud.onmicrosoft.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5849.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a87fdba8-6566-4987-f749-08db81bab737
X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jul 2023 02:58:34.0487
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: +Oe6ynyxwEUFXMvgn/GswAfH92aWJPTjaahN0vM8nmejkGTxY7jqNHtfM7J6wBeBCAzZHwNLhRdbiSB29/jV1g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4333

SGksDQoNCk9uIDIwMjMvNy8xMSAwNDoyOCwgTWljaGFlbCBTLiBUc2lya2luIHdyb3RlOg0KPiBP
biBGcmksIEp1biAzMCwgMjAyMyBhdCAwMzowMDoxNlBNICswODAwLCBKaXFpYW4gQ2hlbiB3cm90
ZToNCj4+IEFmdGVyIHN1c3BlbmRpbmcgYW5kIHJlc3VtaW5nIGd1ZXN0IFZNLCB5b3Ugd2lsbCBn
ZXQNCj4+IGEgYmxhY2sgc2NyZWVuLCBhbmQgdGhlIGRpc3BsYXkgY2FuJ3QgY29tZSBiYWNrLg0K
Pj4NCj4+IFRoaXMgaXMgYmVjYXVzZSB3aGVuIGd1ZXN0IGRpZCBzdXNwZW5kaW5nLCBpdCBjYWxs
ZWQNCj4+IGludG8gcWVtdSB0byBjYWxsIHZpcnRpb19ncHVfZ2xfcmVzZXQuIEluIGZ1bmN0aW9u
DQo+PiB2aXJ0aW9fZ3B1X2dsX3Jlc2V0LCBpdCBkZXN0cm95ZWQgcmVzb3VyY2VzIGF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sZCBvbiBtaW5ndzoNCj4gDQo+IC9z
Y20vcWVtdS9pbmNsdWRlL3N0YW5kYXJkLWhlYWRlcnMvbGludXgvdmlydGlvX2dwdS5oOjQ2ODo5
OiBlcnJvcjogdW5rbm93biB0eXBlIG5hbWUgJ19fdTMyJw0KPiAgIDQ2OCB8ICAgICAgICAgX191
MzIgZnJlZXppbmc7DQo+ICAgICAgIHwgICAgICAgICBefn5+fg0KPiANCj4gDQo+IFJlYXNvbiBp
cyB5b3UgYXJlIG5vdCBzdXBwb3NlZCB0byBlZGl0IHRoaXMgZGlyZWN0bHk6IGl0IGhhcyB0byBi
ZSBlZGl0ZWQNCj4gaW4gbGludXggdGhlbiB3ZSBpbXBvcnQgaXQuDQo+IA0KSSBhbSBzb3JyeSwg
YWx0aG91Z2ggSSBjYW4gY29tcGlsZSBhbmQgcnVuIGxvY2FsbHkuDQpTbywgbmVlZG4ndCBJIHRv
IGFkZCB0aGlzIHBhcnQgaW4gbXkgUWVtdSBwYXRjaD8gQW5kIHlvdSB3aWxsIGltcG9ydCBpdCBh
ZnRlciBteSBtb2RpZmljYXRpb24gb2Yga2VybmVsIGlzIG1lcmdlZD8NCk9yIGRvIEkgbW9kaWZ5
IGl0IHRvIHVpbnQzMl90LCBqdXN0IGxpa2UgdGhlIG90aGVyIHBsYWNlIG9mIHRoaXMgZmlsZT8N
Cg0KPiANCj4gDQo+IA0KPj4gICNlbmRpZg0KPj4gLS0gDQo+PiAyLjM0LjENCj4gDQoNCi0tIA0K
QmVzdCByZWdhcmRzLA0KSmlxaWFuIENoZW4uDQo=


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 04:20:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 04:20:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561379.877965 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ4rN-0006nD-JJ; Tue, 11 Jul 2023 04:20:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561379.877965; Tue, 11 Jul 2023 04:20:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ4rN-0006m3-EW; Tue, 11 Jul 2023 04:20:21 +0000
Received: by outflank-mailman (input) for mailman id 561379;
 Mon, 10 Jul 2023 19:25:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6PHc=C4=gmail.com=ubizjak@srs-se1.protection.inumbo.net>)
 id 1qIwVJ-0005bW-3T
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 19:25:01 +0000
Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com
 [2a00:1450:4864:20::634])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 75dd6d1f-1f57-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 21:24:59 +0200 (CEST)
Received: by mail-ej1-x634.google.com with SMTP id
 a640c23a62f3a-99364ae9596so627397366b.1
 for <xen-devel@lists.xenproject.org>; Mon, 10 Jul 2023 12:24:59 -0700 (PDT)
Received: from localhost.localdomain ([46.248.82.114])
 by smtp.gmail.com with ESMTPSA id
 w15-20020a170906480f00b0096a6be0b66dsm110076ejq.208.2023.07.10.12.24.58
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 10 Jul 2023 12:24:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 75dd6d1f-1f57-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689017099; x=1691609099;
        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=8jAJrLaj81nDh4wW1pP27vJFmY8UiJKSEaQ+/Hb04Nc=;
        b=hnX3o4peRysHE4PlLHbB9M+JugRMzR7VVp6giACiIXm0TS66MpvDNrmpEM20fnHH2A
         oSFUd0VYZ/MdWgmzGsmXue6dq2b+VMz3GxtLT1LjmN2vOJPTyB1MlJVUP4Zg1582I7Ih
         bvByd4d2/2KrUOhapdZ5gYfpSGWLMwWzS/Wj/NbCJxGevCFI9QeDcs9Auy4zAcVQ/Tf8
         inx384WtL7/fUnA4qAcq/gmiQWcOE2I+2JT4Su/1IT5W/UTbkLOtSMHLNoEqNw2olwUV
         YBlaAEf7Uv05hM5H6jTxldHdo0TkB+So0trN2HA+X0Z1MAsWYaG52b6cC+vifMgd8TY2
         hLeg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689017099; x=1691609099;
        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=8jAJrLaj81nDh4wW1pP27vJFmY8UiJKSEaQ+/Hb04Nc=;
        b=RRtbJCctKJmNo0eKgvj1WDRPlq+xdKEl+H8XbAYhmYSeReeiS4KMZoatnLrpU7l6/z
         ux94NcTHCjBC6FUCwx4TsallS7KHZMr4bzT/gm+15e8gQB1gsYSviI4RQP3qoLOom/YZ
         5bqmWAxDEKQHgkhlZaLjyewgYtpSFYG+m1JtXn5WySCLzWY9J7+K7GvjijUZfAF3W4FA
         A3P8UsWpWThHCG1J7Ko2w7tw576M0Rf8As7CyzJv5iU3VhYi5WkggAF7rsOi5uYfR+AU
         mxHxyGAJFQgxxeYVl1smHhodXXs0g8VvQFjpY/wVmnNhNQYm1eDKSfi2YSP6DvhVJIh1
         w2nQ==
X-Gm-Message-State: ABy/qLaqg4WIvLUwVSVipAj6v2k4lGmOm23bTpnNdJPUQIzbV+yVj5aN
	aXoPt4Mb8mP6NIhD88HHrBE=
X-Google-Smtp-Source: APBJJlHwVT5frp02REiaP08Tw2FykEOwGxdLWWsPCiw5aMtj6jXyTUwf06D5IHzSoxQJfVL+VWOmXA==
X-Received: by 2002:a17:906:5307:b0:993:f996:52d3 with SMTP id h7-20020a170906530700b00993f99652d3mr6394846ejo.25.1689017099074;
        Mon, 10 Jul 2023 12:24:59 -0700 (PDT)
From: Uros Bizjak <ubizjak@gmail.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org,
	xen-devel@lists.xenproject.org
Cc: Uros Bizjak <ubizjak@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Subject: [PATCH 3/3] xen: Illustrate the transition to sync_try_cmpxchg
Date: Mon, 10 Jul 2023 21:21:56 +0200
Message-ID: <20230710192440.47140-3-ubizjak@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230710192440.47140-1-ubizjak@gmail.com>
References: <20230710192440.47140-1-ubizjak@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This patch illustrates the transition to sync_try_cmpxchg.
It is not intended to be merged as-is.

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
---
 drivers/xen/events/events_fifo.c | 26 ++++++++++++--------------
 drivers/xen/grant-table.c        | 10 ++++------
 2 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/drivers/xen/events/events_fifo.c b/drivers/xen/events/events_fifo.c
index ad9fe51d3fb3..655775db7caf 100644
--- a/drivers/xen/events/events_fifo.c
+++ b/drivers/xen/events/events_fifo.c
@@ -226,21 +226,20 @@ static bool evtchn_fifo_is_masked(evtchn_port_t port)
  */
 static bool clear_masked_cond(volatile event_word_t *word)
 {
-	event_word_t new, old, w;
+	event_word_t new, old;
 
-	w = *word;
+	old = *word;
 
 	do {
-		if (!(w & (1 << EVTCHN_FIFO_MASKED)))
+		if (!(old & (1 << EVTCHN_FIFO_MASKED)))
 			return true;
 
-		if (w & (1 << EVTCHN_FIFO_PENDING))
+		if (old & (1 << EVTCHN_FIFO_PENDING))
 			return false;
 
-		old = w & ~(1 << EVTCHN_FIFO_BUSY);
+		old = old & ~(1 << EVTCHN_FIFO_BUSY);
 		new = old & ~(1 << EVTCHN_FIFO_MASKED);
-		w = sync_cmpxchg(word, old, new);
-	} while (w != old);
+	} while (!sync_try_cmpxchg(word, &old, new));
 
 	return true;
 }
@@ -259,17 +258,16 @@ static void evtchn_fifo_unmask(evtchn_port_t port)
 
 static uint32_t clear_linked(volatile event_word_t *word)
 {
-	event_word_t new, old, w;
+	event_word_t new, old;
 
-	w = *word;
+	old = *word;
 
 	do {
-		old = w;
-		new = (w & ~((1 << EVTCHN_FIFO_LINKED)
-			     | EVTCHN_FIFO_LINK_MASK));
-	} while ((w = sync_cmpxchg(word, old, new)) != old);
+		new = (old & ~((1 << EVTCHN_FIFO_LINKED)
+			       | EVTCHN_FIFO_LINK_MASK));
+	} while (!sync_try_cmpxchg(word, &old, new));
 
-	return w & EVTCHN_FIFO_LINK_MASK;
+	return old & EVTCHN_FIFO_LINK_MASK;
 }
 
 static void consume_one_event(unsigned cpu, struct evtchn_loop_ctrl *ctrl,
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index e1ec725c2819..211d083d4fbe 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -427,16 +427,14 @@ EXPORT_SYMBOL_GPL(gnttab_grant_foreign_access);
 
 static int gnttab_end_foreign_access_ref_v1(grant_ref_t ref)
 {
-	u16 flags, nflags;
-	u16 *pflags;
+	u16 *pflags = &gnttab_shared.v1[ref].flags;
+	u16 flags;
 
-	pflags = &gnttab_shared.v1[ref].flags;
-	nflags = *pflags;
+	flags = *pflags;
 	do {
-		flags = nflags;
 		if (flags & (GTF_reading|GTF_writing))
 			return 0;
-	} while ((nflags = sync_cmpxchg(pflags, flags, 0)) != flags);
+	} while (!sync_try_cmpxchg(pflags, &flags, 0));
 
 	return 1;
 }
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 11 04:20:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 04:20:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561378.877958 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ4rN-0006jq-Ap; Tue, 11 Jul 2023 04:20:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561378.877958; Tue, 11 Jul 2023 04:20:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ4rN-0006jj-8A; Tue, 11 Jul 2023 04:20:21 +0000
Received: by outflank-mailman (input) for mailman id 561378;
 Mon, 10 Jul 2023 19:25:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6PHc=C4=gmail.com=ubizjak@srs-se1.protection.inumbo.net>)
 id 1qIwVI-0005bW-Qk
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 19:25:00 +0000
Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com
 [2a00:1450:4864:20::630])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 755fe682-1f57-11ee-b239-6b7b168915f2;
 Mon, 10 Jul 2023 21:24:59 +0200 (CEST)
Received: by mail-ej1-x630.google.com with SMTP id
 a640c23a62f3a-9891c73e0fbso967871366b.1
 for <xen-devel@lists.xenproject.org>; Mon, 10 Jul 2023 12:24:59 -0700 (PDT)
Received: from localhost.localdomain ([46.248.82.114])
 by smtp.gmail.com with ESMTPSA id
 w15-20020a170906480f00b0096a6be0b66dsm110076ejq.208.2023.07.10.12.24.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 10 Jul 2023 12:24:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 755fe682-1f57-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689017098; x=1691609098;
        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=Z71M3kv4pOhHERmm48IRm9ZZKlLgpwDQJ/Fo9wvNP5c=;
        b=ASZ3K3ti6Bg/EbHuGo8ohRbr1fAme2CHAabDjiV/uN16VxosIlNQ6g9LHfm3xurH/c
         lnEZhyrQ5BpkOGbo0OVMsFbLSGtiKDrFdhS6Ct/trK1XyUBMl1sIPlDvaueYOklhMhBH
         LsVtQTFSqIldpa1nRu8firvs9QmQG5792VyW0EmunqskCC0IpXzSYyeRT0PPVsQJGoxM
         fDsla/SjoRdP5k4jl7hEMhe59+kRMbneOuStHbBmghQORD9WGjdtlwlFWnQ00Cj2jwFa
         DOLb86EDnRYJ+z6nA8mxVcwoLtAeiY1TLcjNh7CVzxtevL1YQ+y9jdX23HC5SvWfanjW
         Hhsw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689017098; x=1691609098;
        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=Z71M3kv4pOhHERmm48IRm9ZZKlLgpwDQJ/Fo9wvNP5c=;
        b=fsc/aTCW0yehx1jvWedpGi3eafptN6m/YcPxsXaIV90e3x6ZMV7OGJ4T2CNdlIuPpg
         v6L7Ee7FM2ovnDfrZ9RRdlZO0iSpphpsEnlApthb8x90UI21kmIunV9W6POglcRhRZNM
         jlSMzKVpxXkWni7j3lB3k5+cG9goL+q+vKgc2Y8EccdWWboJ1L0oy2Ac5BqnzAb9/x9G
         UryyrUL/VBR4dg1FzL8vPYvSO2FmPt99CCCMJ5meZqZaiMbHwQVeD+SU6FGPBbNHsKVe
         ylGqYZf8/FkwyzC37GO90HHBNww2g84PW8wOn1+MncqK/E2Gd1Srcopa+Z/SIM0t8roc
         LDKQ==
X-Gm-Message-State: ABy/qLbwH3ScH3H7G8o+B9txfNCNe89Ml1ySaICquSsqjY4isoaaAkv3
	dTvvgSJ6YoOenQgFaA/yyjU=
X-Google-Smtp-Source: APBJJlGthri1wuPEMGs27pEajcM7hryhEfxctXKvA699qawtyhyGJ5wNksSwjTUqpLoTCr/9vPqPrw==
X-Received: by 2002:a17:907:3c0a:b0:98e:370c:be69 with SMTP id gh10-20020a1709073c0a00b0098e370cbe69mr15702590ejc.6.1689017098266;
        Mon, 10 Jul 2023 12:24:58 -0700 (PDT)
From: Uros Bizjak <ubizjak@gmail.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org,
	xen-devel@lists.xenproject.org
Cc: Uros Bizjak <ubizjak@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: [PATCH 2/3] locking/x86: Wire up sync_try_cmpxchg
Date: Mon, 10 Jul 2023 21:21:55 +0200
Message-ID: <20230710192440.47140-2-ubizjak@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230710192440.47140-1-ubizjak@gmail.com>
References: <20230710192440.47140-1-ubizjak@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Implement target specific support for sync_try_cmpxchg.

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
---
 arch/x86/include/asm/cmpxchg.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h
index d53636506134..5612648b0202 100644
--- a/arch/x86/include/asm/cmpxchg.h
+++ b/arch/x86/include/asm/cmpxchg.h
@@ -221,12 +221,18 @@ extern void __add_wrong_size(void)
 #define __try_cmpxchg(ptr, pold, new, size)				\
 	__raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
 
+#define __sync_try_cmpxchg(ptr, pold, new, size)			\
+	__raw_try_cmpxchg((ptr), (pold), (new), (size), "lock; ")
+
 #define __try_cmpxchg_local(ptr, pold, new, size)			\
 	__raw_try_cmpxchg((ptr), (pold), (new), (size), "")
 
 #define arch_try_cmpxchg(ptr, pold, new) 				\
 	__try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
 
+#define arch_sync_try_cmpxchg(ptr, pold, new) 				\
+	__sync_try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
+
 #define arch_try_cmpxchg_local(ptr, pold, new)				\
 	__try_cmpxchg_local((ptr), (pold), (new), sizeof(*(ptr)))
 
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 11 04:20:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 04:20:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561380.877970 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ4rN-0006uQ-S4; Tue, 11 Jul 2023 04:20:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561380.877970; Tue, 11 Jul 2023 04:20:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ4rN-0006tR-OB; Tue, 11 Jul 2023 04:20:21 +0000
Received: by outflank-mailman (input) for mailman id 561380;
 Mon, 10 Jul 2023 19:25:01 +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 <SRS0=6PHc=C4=gmail.com=ubizjak@srs-se1.protection.inumbo.net>)
 id 1qIwVJ-0005bX-56
 for xen-devel@lists.xenproject.org; Mon, 10 Jul 2023 19:25:01 +0000
Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com
 [2a00:1450:4864:20::635])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 74e96e22-1f57-11ee-8611-37d641c3527e;
 Mon, 10 Jul 2023 21:24:58 +0200 (CEST)
Received: by mail-ej1-x635.google.com with SMTP id
 a640c23a62f3a-991da766865so621284266b.0
 for <xen-devel@lists.xenproject.org>; Mon, 10 Jul 2023 12:24:58 -0700 (PDT)
Received: from localhost.localdomain ([46.248.82.114])
 by smtp.gmail.com with ESMTPSA id
 w15-20020a170906480f00b0096a6be0b66dsm110076ejq.208.2023.07.10.12.24.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 10 Jul 2023 12:24:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 74e96e22-1f57-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689017097; x=1691609097;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=jftu1XapvOLMzEYkqywXgUEUxuMrQszDRi+r4S9T/B8=;
        b=jFKS0dDJt25TajexlB3hdj0BfuVDTTR2cNBPmf6qukrN+1LWfsXoV1T2h3hMn11QA7
         PVdUNSGV8fNwqYlSRRmyhqaLM4ctHU2vDoVaOjgmxwQ1mTesI4qIpka4EGOuxewv/777
         HUwt1q2YZucKXu8Ew9w2AGcbpraL2lrANBy/H87nIkET4S/EVNiN5FxqKhHDkTHIr0AH
         ZRhGfVbts058LX9BW6ssPRYfynYgC9yAmNQ1V5Lu/Nsg0plw43AjSQyyQFRI7RPTBjD9
         VR9T8R8SOgbdiqHefLbmNbw0rrKfrtzs1LNjqjFnJNkDbwm/R0EED27L2yKFN9S4KtaW
         2i7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689017097; x=1691609097;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=jftu1XapvOLMzEYkqywXgUEUxuMrQszDRi+r4S9T/B8=;
        b=kjCILL+ufzxy6O0Qf6zXTpiug4sB36ZEGCsgyyZRnyqhSqJVRSfTy3vpDQkAxT2PQz
         HhMJ/Z+I93eDm/LVz6ozgQ7cqj/QwsxzQjlYcDgw/9WBNhXzZK4xMa5Cvoxj/cQKVGGm
         M97p0Dbr0LO5AcCWBaApf2hcbQzSKkrZTC7C92VCDQ7SzbAH3kwW2J6Vqr/5+gwIKpLB
         rCu/P1wB7TCJcqZTtp1tfJXLbDiDRB+35PDb3bS+YSeh+81NzXeyr78eKoXu5qvk4v1I
         EFKPxMsdHQQzit4LvB3uRqI/wrTC16Sj6PYNuWHfc9vmNgKqYfmni6Qjx0LqkJtNrRrw
         FTgA==
X-Gm-Message-State: ABy/qLZqWhUV6xQyILKlErINmleBWQfI8KIMq33OZbVmteUH4YuKcRts
	53uGpiIocN40oIRu/0nleEQ=
X-Google-Smtp-Source: APBJJlH5IVyTpedE5IkFA68q07QVykSKpgW8fZffI7YRGbCbmTiXrGVpLLobb4Cs4f1LpCQFV5itgQ==
X-Received: by 2002:a17:906:edbb:b0:98d:63c5:d135 with SMTP id sa27-20020a170906edbb00b0098d63c5d135mr750873ejb.54.1689017097267;
        Mon, 10 Jul 2023 12:24:57 -0700 (PDT)
From: Uros Bizjak <ubizjak@gmail.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org,
	xen-devel@lists.xenproject.org
Cc: Uros Bizjak <ubizjak@gmail.com>,
	Will Deacon <will@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	Mark Rutland <mark.rutland@arm.com>
Subject: [PATCH 1/3] locking/generic: Add generic support for sync_try_cmpxchg and its falback
Date: Mon, 10 Jul 2023 21:21:54 +0200
Message-ID: <20230710192440.47140-1-ubizjak@gmail.com>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Provide the generic sync_try_cmpxchg function from the
raw_ prefixed version, also adding explicit instrumentation.

Cc: Will Deacon <will@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
---
 include/linux/atomic/atomic-arch-fallback.h | 15 +++++++++-
 include/linux/atomic/atomic-instrumented.h  | 10 ++++++-
 scripts/atomic/gen-atomic-fallback.sh       | 33 +++++++++++----------
 scripts/atomic/gen-atomic-instrumented.sh   |  3 +-
 4 files changed, 43 insertions(+), 18 deletions(-)

diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h
index 18f5744dfb5d..037742c9f97d 100644
--- a/include/linux/atomic/atomic-arch-fallback.h
+++ b/include/linux/atomic/atomic-arch-fallback.h
@@ -428,6 +428,19 @@ extern void raw_cmpxchg128_relaxed_not_implemented(void);
 
 #define raw_sync_cmpxchg arch_sync_cmpxchg
 
+#ifdef arch_sync_try_cmpxchg
+#define raw_sync_try_cmpxchg arch_sync_try_cmpxchg
+#else
+#define raw_sync_try_cmpxchg(_ptr, _oldp, _new) \
+({ \
+	typeof(*(_ptr)) *___op = (_oldp), ___o = *___op, ___r; \
+	___r = raw_sync_cmpxchg((_ptr), ___o, (_new)); \
+	if (unlikely(___r != ___o)) \
+		*___op = ___r; \
+	likely(___r == ___o); \
+})
+#endif
+
 /**
  * raw_atomic_read() - atomic load with relaxed ordering
  * @v: pointer to atomic_t
@@ -4657,4 +4670,4 @@ raw_atomic64_dec_if_positive(atomic64_t *v)
 }
 
 #endif /* _LINUX_ATOMIC_FALLBACK_H */
-// 202b45c7db600ce36198eb1f1fc2c2d5268ace2d
+// 2eb1fe994b6dcab645bbb5a642a4aaa9374c5600
diff --git a/include/linux/atomic/atomic-instrumented.h b/include/linux/atomic/atomic-instrumented.h
index d401b406ef7c..54d7bbe0aeaa 100644
--- a/include/linux/atomic/atomic-instrumented.h
+++ b/include/linux/atomic/atomic-instrumented.h
@@ -4998,6 +4998,14 @@ atomic_long_dec_if_positive(atomic_long_t *v)
 	raw_try_cmpxchg128_local(__ai_ptr, __ai_oldp, __VA_ARGS__); \
 })
 
+#define sync_try_cmpxchg(ptr, ...) \
+({ \
+	typeof(ptr) __ai_ptr = (ptr); \
+	kcsan_mb(); \
+	instrument_atomic_read_write(__ai_ptr, sizeof(*__ai_ptr)); \
+	raw_sync_try_cmpxchg(__ai_ptr, __VA_ARGS__); \
+})
+
 
 #endif /* _LINUX_ATOMIC_INSTRUMENTED_H */
-// 1568f875fef72097413caab8339120c065a39aa4
+// 2cc4bc990fef44d3836ec108f11b610f3f438184
diff --git a/scripts/atomic/gen-atomic-fallback.sh b/scripts/atomic/gen-atomic-fallback.sh
index c0c8a85d7c81..d87148d6e588 100755
--- a/scripts/atomic/gen-atomic-fallback.sh
+++ b/scripts/atomic/gen-atomic-fallback.sh
@@ -223,14 +223,15 @@ gen_xchg_fallbacks()
 
 gen_try_cmpxchg_fallback()
 {
+	local prefix="$1"; shift
 	local cmpxchg="$1"; shift;
-	local order="$1"; shift;
+	local suffix="$1"; shift;
 
 cat <<EOF
-#define raw_try_${cmpxchg}${order}(_ptr, _oldp, _new) \\
+#define raw_${prefix}try_${cmpxchg}${suffix}(_ptr, _oldp, _new) \\
 ({ \\
 	typeof(*(_ptr)) *___op = (_oldp), ___o = *___op, ___r; \\
-	___r = raw_${cmpxchg}${order}((_ptr), ___o, (_new)); \\
+	___r = raw_${prefix}${cmpxchg}${suffix}((_ptr), ___o, (_new)); \\
 	if (unlikely(___r != ___o)) \\
 		*___op = ___r; \\
 	likely(___r == ___o); \\
@@ -259,11 +260,11 @@ gen_try_cmpxchg_order_fallback()
 	fi
 
 	printf "#else\n"
-	gen_try_cmpxchg_fallback "${cmpxchg}" "${order}"
+	gen_try_cmpxchg_fallback "" "${cmpxchg}" "${order}"
 	printf "#endif\n\n"
 }
 
-gen_try_cmpxchg_fallbacks()
+gen_try_cmpxchg_order_fallbacks()
 {
 	local cmpxchg="$1"; shift;
 
@@ -272,15 +273,17 @@ gen_try_cmpxchg_fallbacks()
 	done
 }
 
-gen_cmpxchg_local_fallbacks()
+gen_def_and_try_cmpxchg_fallback()
 {
+	local prefix="$1"; shift
 	local cmpxchg="$1"; shift
+	local suffix="$1"; shift
 
-	printf "#define raw_${cmpxchg} arch_${cmpxchg}\n\n"
-	printf "#ifdef arch_try_${cmpxchg}\n"
-	printf "#define raw_try_${cmpxchg} arch_try_${cmpxchg}\n"
+	printf "#define raw_${prefix}${cmpxchg}${suffix} arch_${prefix}${cmpxchg}${suffix}\n\n"
+	printf "#ifdef arch_${prefix}try_${cmpxchg}${suffix}\n"
+	printf "#define raw_${prefix}try_${cmpxchg}${suffix} arch_${prefix}try_${cmpxchg}${suffix}\n"
 	printf "#else\n"
-	gen_try_cmpxchg_fallback "${cmpxchg}" ""
+	gen_try_cmpxchg_fallback "${prefix}" "${cmpxchg}" "${suffix}"
 	printf "#endif\n\n"
 }
 
@@ -302,15 +305,15 @@ for xchg in "xchg" "cmpxchg" "cmpxchg64" "cmpxchg128"; do
 done
 
 for cmpxchg in "cmpxchg" "cmpxchg64" "cmpxchg128"; do
-	gen_try_cmpxchg_fallbacks "${cmpxchg}"
+	gen_try_cmpxchg_order_fallbacks "${cmpxchg}"
 done
 
-for cmpxchg in "cmpxchg_local" "cmpxchg64_local" "cmpxchg128_local"; do
-	gen_cmpxchg_local_fallbacks "${cmpxchg}" ""
+for cmpxchg in "cmpxchg" "cmpxchg64" "cmpxchg128"; do
+	gen_def_and_try_cmpxchg_fallback "" "${cmpxchg}" "_local"
 done
 
-for cmpxchg in "sync_cmpxchg"; do
-	printf "#define raw_${cmpxchg} arch_${cmpxchg}\n\n"
+for cmpxchg in "cmpxchg"; do
+	gen_def_and_try_cmpxchg_fallback "sync_" "${cmpxchg}" ""
 done
 
 grep '^[a-z]' "$1" | while read name meta args; do
diff --git a/scripts/atomic/gen-atomic-instrumented.sh b/scripts/atomic/gen-atomic-instrumented.sh
index 8f8f8e3b20f9..592f3ec89b5f 100755
--- a/scripts/atomic/gen-atomic-instrumented.sh
+++ b/scripts/atomic/gen-atomic-instrumented.sh
@@ -169,7 +169,8 @@ for xchg in "xchg" "cmpxchg" "cmpxchg64" "cmpxchg128" "try_cmpxchg" "try_cmpxchg
 	done
 done
 
-for xchg in "cmpxchg_local" "cmpxchg64_local" "cmpxchg128_local" "sync_cmpxchg" "try_cmpxchg_local" "try_cmpxchg64_local" "try_cmpxchg128_local"; do
+for xchg in "cmpxchg_local" "cmpxchg64_local" "cmpxchg128_local" "sync_cmpxchg" \
+	    "try_cmpxchg_local" "try_cmpxchg64_local" "try_cmpxchg128_local" "sync_try_cmpxchg"; do
 	gen_xchg "${xchg}" ""
 	printf "\n"
 done
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 11 05:13:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 05:13:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561536.877988 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ5gg-000557-Qx; Tue, 11 Jul 2023 05:13:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561536.877988; Tue, 11 Jul 2023 05:13:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ5gg-000550-OM; Tue, 11 Jul 2023 05:13:22 +0000
Received: by outflank-mailman (input) for mailman id 561536;
 Tue, 11 Jul 2023 05:13:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJ5gf-00054q-7v; Tue, 11 Jul 2023 05:13:21 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJ5gf-0004EB-68; Tue, 11 Jul 2023 05:13:21 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJ5ge-0008U1-Sr; Tue, 11 Jul 2023 05:13:20 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJ5ge-00021o-SK; Tue, 11 Jul 2023 05:13:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Y+zGYVCJH41xS6aBeKkrKZKsFO2m9wiZL78gcSilbMs=; b=0Q3YJFAnhW8A3CtnYqvWIada51
	R3+fwp1dkH/Tgr6WfN9vzvAe4xMemVrg8e7VisjDf0sR+PesVtq4xndJp+TkIRxbPvIhHeh/86/b2
	r30sAmyt3Mm/Zq9TFgZ7sG970PMQ7aPByWSa5flzzht/rFe53bqYbNnvmBeATRkJsVRM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181757-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181757: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=964a4f032dcd15d7b0d9246625b13b71182e4eae
X-Osstest-Versions-That:
    ovmf=63923a5642e86f386a5c719a90cfc6a929ea9cb0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 11 Jul 2023 05:13:20 +0000

flight 181757 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181757/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 964a4f032dcd15d7b0d9246625b13b71182e4eae
baseline version:
 ovmf                 63923a5642e86f386a5c719a90cfc6a929ea9cb0

Last test of basis   181751  2023-07-10 12:40:43 Z    0 days
Testing same since   181757  2023-07-11 03:12:21 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Gerd Hoffmann <kraxel@redhat.com>
  Xie, Yuanhao <yuanhao.xie@intel.com>
  Yuanhao Xie <yuanhao.xie@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   63923a5642..964a4f032d  964a4f032dcd15d7b0d9246625b13b71182e4eae -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 06:47:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 06:47:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561547.877998 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ79e-0005tq-49; Tue, 11 Jul 2023 06:47:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561547.877998; Tue, 11 Jul 2023 06:47:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ79e-0005tj-1f; Tue, 11 Jul 2023 06:47:22 +0000
Received: by outflank-mailman (input) for mailman id 561547;
 Tue, 11 Jul 2023 06:47:20 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJ79c-0005tZ-TP; Tue, 11 Jul 2023 06:47:20 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJ79c-0006Oc-P1; Tue, 11 Jul 2023 06:47:20 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJ79c-0002f5-Fd; Tue, 11 Jul 2023 06:47:20 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJ79c-0006d4-F5; Tue, 11 Jul 2023 06:47:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=EXGZWyOYB8TexiyHU9c+438NCILyixuktJnetsy3pnM=; b=BjHbFT7lNvSKsgSL3auGIXujtx
	XTf85NdzixIKETtKFu4txAfAJqyy0JS9hjlVdqRvbMcW7PxwsMEWXC83Kznh/W2+Tv8bCO7dq6fph
	UXWdmGCPBRBVo9s510FH+n+F+n+4QHx5ib4jZ+vXn861w6biFp3L0y3gsUDkRY3eAtgQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181755-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181755: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-freebsd11-amd64:guest-localmigrate/x10:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-pygrub:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=3f01e9fed8454dcd89727016c3e5b2fbb8f8e50c
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 11 Jul 2023 06:47:20 +0000

flight 181755 linux-linus real [real]
flight 181758 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181755/
http://logs.test-lab.xenproject.org/osstest/logs/181758/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-freebsd11-amd64 19 guest-localmigrate/x10 fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-shadow 22 guest-start/debian.repeat fail pass in 181758-retest
 test-amd64-amd64-pygrub   19 guest-localmigrate/x10 fail pass in 181758-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                3f01e9fed8454dcd89727016c3e5b2fbb8f8e50c
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   85 days
Failing since        180281  2023-04-17 06:24:36 Z   85 days  169 attempts
Testing same since   181755  2023-07-10 17:42:07 Z    0 days    1 attempts

------------------------------------------------------------
3736 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      fail    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 622011 lines long.)


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 07:28:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 07:28:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561562.878009 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ7mz-0001yE-3z; Tue, 11 Jul 2023 07:28:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561562.878009; Tue, 11 Jul 2023 07:28:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ7my-0001y7-W2; Tue, 11 Jul 2023 07:28:00 +0000
Received: by outflank-mailman (input) for mailman id 561562;
 Tue, 11 Jul 2023 07:27:59 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qJ7mx-0001y1-L3
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 07:27:59 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJ7ms-0007Mo-Qb; Tue, 11 Jul 2023 07:27:54 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJ7ms-0006PT-K2; Tue, 11 Jul 2023 07:27:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=boiCSDtKzeZhz1YSrweThGV4k4qKZI4njnOKBX/9ePw=; b=STET8AQt4U4eU5g08r2RspjwiF
	KGmvDZutGPDTaZSIDbSpr1L3UA01mx3TFt2171dXMEAquOQFuMVfcW5adtHFlxEnegeHnSic/M5tE
	ErJjDxS7+1MTVPqNxMeqrorpW+ztTvHzF8hhlOodRsM8u1ORgRZP5lQ9pcQkp/Z9wihI=;
Message-ID: <1c0ff25f-e3bd-e852-1836-c240d9273bc9@xen.org>
Date: Tue, 11 Jul 2023 08:27:52 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: Ping: [PATCH v2 0/2] new CONFIG_HAS_PIRQ and extra_guest_irqs
 adjustment
To: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <85e59fd5-9a06-48b4-ba7e-81865d44e332@suse.com>
 <e14fdd8e-692b-bb19-627a-0462cce45de5@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <e14fdd8e-692b-bb19-627a-0462cce45de5@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Jan,

On 10/07/2023 08:33, Jan Beulich wrote:
> On 03.05.2023 17:31, Jan Beulich wrote:
>> The 1st patch (new in v2) has the effect of the 2nd one no longer
>> affecting Arm.
>>
>> 1: restrict concept of pIRQ to x86
>> 2: cmdline: document and enforce "extra_guest_irqs" upper bounds
> 
> REST- and Arm-maintainers,
> 
> may I please ask for some feedback here? Roger did supply some, resulting
> in me considering to revert back to the earlier version (i.e. patch 1
> dropped again and patch 2 minimally adjusted to address feedback there),
> but which route to go wants input from other maintainers. What I think is
> unacceptable is that we continue to not document and enforce the upper
> bound, leading to people needlessly running into issues on big enough
> systems.

I looked at patch #1, I think this the right approach for Arm. Do you 
need further input?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 08:18:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 08:18:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561588.878019 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ8Zd-0007v9-6y; Tue, 11 Jul 2023 08:18:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561588.878019; Tue, 11 Jul 2023 08:18:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ8Zd-0007v2-35; Tue, 11 Jul 2023 08:18:17 +0000
Received: by outflank-mailman (input) for mailman id 561588;
 Tue, 11 Jul 2023 08:18:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Lw5p=C5=arm.com=Rahul.Singh@srs-se1.protection.inumbo.net>)
 id 1qJ8Zb-0007uu-PI
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 08:18:16 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0627.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::627])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7aba1ae1-1fc3-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 10:18:13 +0200 (CEST)
Received: from DUZPR01CA0066.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:3c2::14) by AS4PR08MB8119.eurprd08.prod.outlook.com
 (2603:10a6:20b:58b::9) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Tue, 11 Jul
 2023 08:18:01 +0000
Received: from DBAEUR03FT007.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:3c2:cafe::66) by DUZPR01CA0066.outlook.office365.com
 (2603:10a6:10:3c2::14) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32 via Frontend
 Transport; Tue, 11 Jul 2023 08:18:01 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT007.mail.protection.outlook.com (100.127.142.161) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.19 via Frontend Transport; Tue, 11 Jul 2023 08:18:00 +0000
Received: ("Tessian outbound 95df046a2e2c:v145");
 Tue, 11 Jul 2023 08:18:00 +0000
Received: from 4264739d99c1.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 28642A04-4A4D-4BB6-ABAB-9BB6D4AB4345.1; 
 Tue, 11 Jul 2023 08:17:54 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4264739d99c1.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 11 Jul 2023 08:17:54 +0000
Received: from AM9PR08MB7165.eurprd08.prod.outlook.com (2603:10a6:20b:41f::23)
 by PA4PR08MB5920.eurprd08.prod.outlook.com (2603:10a6:102:ea::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul
 2023 08:17:52 +0000
Received: from AM9PR08MB7165.eurprd08.prod.outlook.com
 ([fe80::a4db:63a3:ef32:ffd3]) by AM9PR08MB7165.eurprd08.prod.outlook.com
 ([fe80::a4db:63a3:ef32:ffd3%4]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023
 08:17:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7aba1ae1-1fc3-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=UccfmIKgRvQ5c22KsMfYtgaMV1HHwHF39bAJoiFCgUU=;
 b=BbjAA5yBUicxfFmMol9gpzAnZ8X93b72NLEHipO9bYJlnpuxdCVO4qCJMqPg+poC6OLl+yWWUwCIEQolI3vh0PjfXEnV5tot3ub/nBSGZ9WD2kYxXSzh2/128JPp67dU8h9GHkzwsnK1X+Aitk1Kx14VLFe+YK0Gxkn63/AUM28=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 6e701e5c6388ae21
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=HXiRwiMFEeujdKMMLL5/qMnY0HyHXb754h2QhEYZqzvVA0xwmhPjLmRkE59H7t1bqwllMd2+Vu80Aq7kyf7Rim1nEpO9JLIq1BFMQn+Sy5pPXHMmq27oEE+vxvPyFwQjMM046NV3Mhy2wOyLt2SpnC/3/Be8dgduNQOXBiMRRnKL6gfCUO70zR+4cL1T15r0xVoAS30++pRz3K+tBvidExJPCYDthibckv8MvDUtrn7qBMSzU0ZKxkanggKf955j2CRwxdlvI82i9xL8TUdylETsmorUMy22fzsTeIsVNgM+GivZW6CPDH/rkFT7Zh9Q2DxANdsAx0NMNyA4DLWPSA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=UccfmIKgRvQ5c22KsMfYtgaMV1HHwHF39bAJoiFCgUU=;
 b=h4dl/eU8j13Bhidsbt/1bXjFFsPGeqeMM0n9xrapR/oIKeZyzMDCAdMjm884vonHgp5CwKsOY2OTUjd15A2pRjXoJPU/J5HgZDz3Kz/WLOxThC96fv+aMoSb1fzeQ8C8xajI44k6tR+dpGxU88uWaQDgH/1fqQQnM6DTE/xhg27gq41QUhQZ79Z9L0EKuvlKuWD8o66O0gFwxAiao6SkheGiQLEaokAiKGsuKC6A2AlHyAiTAYw0qIC/huEbJIR0IRlbS18JYN0SQmkfEBf5t+61ch52X3CNHVLRJLlbThMGGLKO0uheYYkXK+pPCevx0GUs52f2j4FA1aOot8VcWg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=UccfmIKgRvQ5c22KsMfYtgaMV1HHwHF39bAJoiFCgUU=;
 b=BbjAA5yBUicxfFmMol9gpzAnZ8X93b72NLEHipO9bYJlnpuxdCVO4qCJMqPg+poC6OLl+yWWUwCIEQolI3vh0PjfXEnV5tot3ub/nBSGZ9WD2kYxXSzh2/128JPp67dU8h9GHkzwsnK1X+Aitk1Kx14VLFe+YK0Gxkn63/AUM28=
From: Rahul Singh <Rahul.Singh@arm.com>
To: Stefano Stabellini <sstabellini@kernel.org>
CC: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, Juergen Gross
	<jgross@suse.com>, "linux-kernel@vger.kernel.org"
	<linux-kernel@vger.kernel.org>, Samuel Holland <samuel@sholland.org>, David
 Woodhouse <dwmw@amazon.co.uk>, Jane Malalane <jane.malalane@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2] xen/evtchn: Introduce new IOCTL to bind static evtchn
Thread-Topic: [PATCH v2] xen/evtchn: Introduce new IOCTL to bind static evtchn
Thread-Index: AQHZqqDrFlYPmniBzkyAFz9id20VH6+iE7EAgAE9TgCADU1ZgIADrKEA
Date: Tue, 11 Jul 2023 08:17:52 +0000
Message-ID: <13058DBB-CF04-4549-B1EF-E9FD870E63D2@arm.com>
References:
 <764d561e3aecb7e63e8601dc50aaef9fc40834e4.1688051342.git.rahul.singh@arm.com>
 <90c961d4-9d10-6fbc-b5f7-84d231264289@epam.com>
 <156827AA-3DFB-4DA2-BC82-7A27E77C2092@arm.com>
 <alpine.DEB.2.22.394.2307081710210.761183@ubuntu-linux-20-04-desktop>
In-Reply-To:
 <alpine.DEB.2.22.394.2307081710210.761183@ubuntu-linux-20-04-desktop>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM9PR08MB7165:EE_|PA4PR08MB5920:EE_|DBAEUR03FT007:EE_|AS4PR08MB8119:EE_
X-MS-Office365-Filtering-Correlation-Id: 06b8cf90-bd04-41a1-5b00-08db81e75774
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 ALpK8/RhWLyPG78MgGWHEfMmxChTR3SICx15wD0cSgFbXQ9tUEVHj/csagrX4YfB2/xcKVfpZzYvu5Ivity1BnqlWqqP1QlzfGwJIws3RGD/uvKqOC8kNbB3f/ac4ICGqRTVt8OX0AqeN+arDiDDxQemhGXorkeXuKcQppTY91FyXNC6VCyUmEALSEGFv+IeZ50VyvTKjR7NWwxTmXVm2NilI6CF+1nF7Tb4easjlF3QvOr1WRRIgXXvyiL/OG6ukLtCr25N8Isy6ld6dWXfXk7lYiFxrXMkY49VfTDlYINONDL9s4wHiOdFRkGPxoa2+tWdOEij5CEgIQjNjcRzj5tsiNOloNWI+fttCqKdjiES8KNZIj5l/joUSJ1eFF0pe3AqL57cDdCJCMxs3y3yW+Igg1kA9glnhvYttHj/nucOgaeHyZyFrmLzIis+sJRfPhN3K9iC6cZkbj396qFXCJ3Vr82uckz1wwlEWcEbcocwVoj92byUCrwRV+hH+tL/qwol1VuokGrUYZmoaMUEa6LjSIJMeWvQqEdkNgKyU7mur6SFD7ZyLz17QSrHNe4ilnWlIh6ZOcoG8LZcVbJqMJyXBE2XNJCTSJjO8RWWW3V8XKGXO0+FtAc4GVhAogPgOMoQW75TNL4x9yzxJ6HhsA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR08MB7165.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(346002)(39860400002)(136003)(376002)(451199021)(6486002)(71200400001)(478600001)(122000001)(54906003)(38070700005)(8936002)(5660300002)(36756003)(2906002)(8676002)(33656002)(86362001)(4326008)(6916009)(316002)(91956017)(76116006)(38100700002)(66446008)(66476007)(64756008)(66556008)(66946007)(41300700001)(6506007)(26005)(53546011)(2616005)(6512007)(83380400001)(186003)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <7A6D9404D720854AB2F45796C2FD8807@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB5920
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT007.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	ce36e78f-e7f4-4b24-c890-08db81e75286
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	MoVNCDZseaCYClZqs+r3kaaArWu4jEEA59VT8CvJLMkjuaGPOt9ub71XbxsxN8TxmwHFtlF7HBhTkH/tsd1JHOGt1ENpw1O3Hi7cl3TGAU9Xv5/cW6uwekJjGlXwFufQFqGq7/1ruqODeiXfxJBno/LFt3LvISkGooFPm853EeG4jMbYBmCMemmxIOCek3+Bnww+02t4QU1Dycjw9tcSgShSCklpLCKN7UMah3nLnJY780bCoz66NG5xl4E/CuSFdnzCAEej6jkQruV9z08Sd0O/WNBwwvgadYtjtjl3e/HrpuZh6VMMLSHwcxOcJ/N/l6wWb0pAXfDYZRus+a1YLiOyEyOBzhSmeQ+fpBmnk469YC5KQBfbNNO6W0kjSJHmEKl+65qzgaC3t4K6TdAH4YXJbuftCjalgK28IUsYlaWc+TWfbL+RtFwc0n4otwizxAsjgIQ4/f38MoyFIzBy1I06IdrzcWaAHGAbnni+QD4jUfDRoP32t/AaRww8SC+oc4S7asMR4UHQpYLgiugtjJp1wVvmb9Y6uHRzRJaDi0bUUcqEBrrVhicweXIheCA9ERb+u+C8aq62T4OYQRRe7qVp5x7WAfsrgEyts2iNL4YA001pya+GueI18zzMt6KYbiDyXY3+Fb7A8dRcE5toTBPOS2VWf930q1Vp3xjUlKy8OpThxPMrMsoca5aq9wqAt5zVpmagZgZ1w+CsYiHmL3dzWHtlEdJUYuibYCg7xEm1XLx/oaMbRVYpaSH5re4p
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(396003)(346002)(376002)(451199021)(40470700004)(36840700001)(46966006)(478600001)(6486002)(54906003)(36860700001)(47076005)(2616005)(83380400001)(36756003)(33656002)(86362001)(40460700003)(40480700001)(2906002)(70206006)(82310400005)(6506007)(70586007)(26005)(53546011)(186003)(6512007)(336012)(81166007)(82740400003)(356005)(8936002)(316002)(41300700001)(6862004)(5660300002)(8676002)(4326008);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 08:18:00.7728
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 06b8cf90-bd04-41a1-5b00-08db81e75774
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT007.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB8119

SGkgLA0KDQo+IE9uIDkgSnVsIDIwMjMsIGF0IDE6MTAgYW0sIFN0ZWZhbm8gU3RhYmVsbGluaSA8
c3N0YWJlbGxpbmlAa2VybmVsLm9yZz4gd3JvdGU6DQo+IA0KPiBPbiBGcmksIDMwIEp1biAyMDIz
LCBSYWh1bCBTaW5naCB3cm90ZToNCj4+IEhpIE9sZWtzYW5kciwNCj4+IA0KPj4gVGhhbmtzIGZv
ciByZXZpZXdpbmcgdGhlIGNvZGUuDQo+PiANCj4+PiBPbiAyOSBKdW4gMjAyMywgYXQgNzowNiBw
bSwgT2xla3NhbmRyIFR5c2hjaGVua28gPG9sZWtzYW5kcl90eXNoY2hlbmtvQGVwYW0uY29tPiB3
cm90ZToNCj4+PiANCj4+PiANCj4+PiANCj4+PiBPbiAyOS4wNi4yMyAxODo0NiwgUmFodWwgU2lu
Z2ggd3JvdGU6DQo+Pj4gDQo+Pj4gSGVsbG8gUmFodWwNCj4+PiANCj4+PiANCj4+Pj4gWGVuIDQu
MTcgc3VwcG9ydHMgdGhlIGNyZWF0aW9uIG9mIHN0YXRpYyBldnRjaG5zLiBUbyBhbGxvdyB1c2Vy
IHNwYWNlDQo+Pj4+IGFwcGxpY2F0aW9uIHRvIGJpbmQgc3RhdGljIGV2dGNobnMgaW50cm9kdWN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cyBs
aWtlIGFuIG9wZW4tY29kZWQgdmVyc2lvbiBvZiB4ZW5fZXZ0Y2huX2Nsb3NlKCkNCj4+PiBkZWZp
bmVkIGF0IGV2ZW50c19iYXNlLmMsIHNvIG1heWJlIGl0IGlzIHdvcnRoIG1ha2luZyB4ZW5fZXZ0
Y2huX2Nsb3NlKCkgDQo+Pj4gc3RhdGljIGlubGluZSBhbmQgcGxhY2luZyBpdCBpbnRvIGV2ZW50
cy5oLCB0aGVuIGNhbGxpbmcgaGVscGVyIGhlcmU/DQo+Pj4gUGxlYXNlIG5vdGUsIEkgd2lsbCBi
ZSBvayBlaXRoZXIgd2F5Lg0KPj4gDQo+PiBNYWtlIHNlbnNlLiBJIHdpbGwgbW9kaWZ5IHRoZSBw
YXRjaCBhcyBwZXIgeW91ciByZXF1ZXN0IGluIHRoZSBuZXh0IHZlcnNpb24uDQo+PiBJIHdpbGwg
d2FpdCBmb3Igb3RoZXIgbWFpbnRhaW5lcnMgdG8gcmV2aWV3IHRoZSBwYXRjaCBiZWZvcmUgc2Vu
ZGluZyB0aGUNCj4+IG5leHQgdmVyc2lvbi4NCj4gDQo+IEkgZG9uJ3QgaGF2ZSBhbnkgZnVydGhl
ciBjb21tZW50cy4NCg0KVGhhbmtzIGZvciB0aGUgdXBkYXRlLiBJIHdpbGwgc2VuZCB0aGUgbmV4
dCB2ZXJzaW9uLg0KDQoNClJlZ2FyZHMsDQpSYWh1bA0KDQoNCg==


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 08:18:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 08:18:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561589.878029 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ8Zu-0008DG-G1; Tue, 11 Jul 2023 08:18:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561589.878029; Tue, 11 Jul 2023 08:18:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ8Zu-0008D9-Bq; Tue, 11 Jul 2023 08:18:34 +0000
Received: by outflank-mailman (input) for mailman id 561589;
 Tue, 11 Jul 2023 08:18:33 +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 <SRS0=B4LE=C5=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJ8Zt-0008Cq-FE
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 08:18:33 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20626.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::626])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 853cb7cc-1fc3-11ee-8611-37d641c3527e;
 Tue, 11 Jul 2023 10:18:31 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM9PR04MB7620.eurprd04.prod.outlook.com (2603:10a6:20b:2d9::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul
 2023 08:18:28 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Tue, 11 Jul 2023
 08:18:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 853cb7cc-1fc3-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=l8CcOPMbyvfMfdiJ6y5Qhu0ZuXcfsAm/U7hBy05AJhAP+xLhUN9V8czFhrClSBJKMRDgqCi0aJXKOIaM1pDlK0luiNOtxC5BB0lRv2AjOKeiwkbfp+TvUI+UFAIdBjgXT8bQ4al+QQaywNIljWuPikCLsrEk03Og5oqG9O88Ykm6W8SCpla9sPc4JPXbPtxXn9FbCISdSuCHDU/QSJCgX2fk62zn854e127MXna7SX+ol4LVutA+7XV7XREX1TKNSRKIKzwfXUFcECq2bmJI6YnN+s44AzrUpSgFKvvnCVIIP+a/cMg3IR6YBhR39GVVh6BdbSQd7sFkqOvxu6SAuA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=S3ZF2lWzKynvoNwmRY986rlw0ClMfqHtRt6TzMZ9ZTI=;
 b=UfLC3NEz/UWsngz7GBHkW3fYzzffbN9bjpiCalFZ2tG7GaUdoYlK8JEs1PD4qUyMQ9Zjth8fAdA30P1TPNJo3w1taO7gDcYVIQa2ot09wTT5tmxDepFjO6sGqNfZU4uvuEuCpEstxFzyZ6ONZwJHsJjOaeYcRTmdyXtD0uqt+DUTOTAfg8J5Y1nEqfIv/Q94iJsJYn1vRWW7AxcllaWBjAeMfOJ3d1wbdzhNXZDaaRq/gs4UwsdZvK7vKBUij9KVpnbN610P/xe1eh44j3gzlcQAKXa/OXPH4Wt0mQOeJZucR0I+LQuQAuqyZE+3nmV6NUzip4Y5SEKEG0u7olejbQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=S3ZF2lWzKynvoNwmRY986rlw0ClMfqHtRt6TzMZ9ZTI=;
 b=z8YlJIaz3m2sM6bJyD23u+n8M/FbAxVJUOGQyhBpkAppa7J/lqTXwewD00u7O1TXsLoasEo+CgQGqBJ8dM4cg2wj0VOvYM+gO2GiC6Jo1j4T0WJLm7grWuFnyFhsOYe8K87sMFp+Ah9Dr37/Q8yEO5G26f3aGfNm+VhPvAgozWwms8nvexAXKsEdXbUhhPr5ZOQHU/p3S/ZsfbkE6hXoeBTXyamu41uT9QXLXCMFTASVTre1QvMF4CoqulTLtSIt+QzCLmARuCzPHCN0FhvrnbJbfaAYw/kcNXl2tMTR1XJv61BtE+Ltq4wTkIV532ufGOANrnylQKKjHVR/pHw98w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <bfacee48-f640-f2eb-7fd7-f440ad03e612@suse.com>
Date: Tue, 11 Jul 2023 10:18:15 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v5 06/15] cpufreq: Add Hardware P-State (HWP) driver
Content-Language: en-US
To: Jason Andryuk <jandryuk@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20230706185440.48333-1-jandryuk@gmail.com>
 <20230706185440.48333-7-jandryuk@gmail.com>
 <eeeb032f-a21b-5eb2-e3d5-63357a04a500@suse.com>
 <CAKf6xptn0OL0qz+DW9qrwU=sFSKSp-O3S7z6vFbZp9RstFanbw@mail.gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <CAKf6xptn0OL0qz+DW9qrwU=sFSKSp-O3S7z6vFbZp9RstFanbw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: JN3P275CA0013.ZAFP275.PROD.OUTLOOK.COM (2603:1086:0:70::18)
 To AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM9PR04MB7620:EE_
X-MS-Office365-Filtering-Correlation-Id: af676e52-808b-4571-95c3-08db81e767c5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	OQ83FrxAXjWdqRiDITaTvZt8DUJIplBpicg6UL7o8r/ODszNbEColG9LWOyw17SEoYRvuVbhwbKvZWiAMdOZrT1iPRwTzRICb/hHEd0wTEd9VCSn0GpWk2RdLVLE6RmjlU8s/W8kpIWUVbMAQgolNXNNz1vNYSApLS51RIDKKW66peKOZAz7BRLO/e/qDuHJa8SJzp/56bjBTJqcPimOgxmXzw5SQY/QyJIbWakphGokIdmJwEIydKa3qWX3Nn40/+vm8uyO8Znt6/wtV4ssfPvkgOAmNpryBrhut9Be2LBO6ktl0kpRA9wHKUKunksbAzWRJ1MMbqenxnDdOUOFB4+qQqidPE+0zB5qdAYFGj38OjCHR9yafmPd+aueQGJMjDXliY3JXdFMsvpU//pUbLWPbmCuxR1BVaKmLFbg+5Ynsfc6HKnV3Sd9KD2KF3V/ji/7b5iZpL/iTFe6a5zVcKJA1HK2Ml9xaZBX0ioat/zHT9F3hb/FFY98/g3jK1tb40xoswbvYKQ/f2xcTpTQuEg/cexhLsIB2BhVn563qppidEJ3t3IgWJV47NncUx7pTSqZN6Pa4xinUC/dUoctQ+rjbteV+sZcmTmIlEueWnYho0PMtp1dM+xYqmEmWtFgZftGuvFKp7Hrf8gUncdvIA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(346002)(396003)(39860400002)(136003)(451199021)(186003)(2616005)(6512007)(26005)(53546011)(6506007)(478600001)(83380400001)(41300700001)(4326008)(66556008)(5660300002)(2906002)(316002)(8936002)(8676002)(6916009)(66946007)(66476007)(6486002)(6666004)(54906003)(36756003)(38100700002)(86362001)(31696002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eUZndVpPN2t4WmUvUnFveU9rYjU2ZFppcjErWkJReFozZzBWVW9STUVMN2pw?=
 =?utf-8?B?dnRUMktULzZnekh6SmgwSkVTKyswU0x5c2dUbmF0QlMwM016WklHYS9MQ3B5?=
 =?utf-8?B?dGlLNDdnZ2w4akd6VXNwWXovOUhYZTFia2FaWWVHdnVIUnBqR0o2SURwU1cw?=
 =?utf-8?B?MUpMdzJ5Nm50Qi9IcWV3Ym81REs1eDN2ZVdhVDY2clcya1RWc3lHZkxqRm5K?=
 =?utf-8?B?YzM4enJGTWpyQVo1Tkd1OER2Q0w2dUgrbHNZVzFaTkxKWVho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ZCVnpQWFdpeFlxeFNZdXhiRzlYcTd3YjdBL3h0?=
 =?utf-8?B?Ny9nUE9rOWhlTktsWi9lM2FPemtpREFTdXR2dGllTFdEa1FKcFpHY3BsV2Rl?=
 =?utf-8?Q?X8uZtBi69VaT1k2w5Frx8xDoy?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: af676e52-808b-4571-95c3-08db81e767c5
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 08:18:28.4546
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: RfnBWgsJM10ZQ+uzo+cg/kIaa2+ybJMZze4Nnfdi8IvGnOVqjvE/IVHk0j5ULJa09iJ5Wbl9dJ388ooH3u+JwA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7620

On 10.07.2023 17:22, Jason Andryuk wrote:
> On Mon, Jul 10, 2023 at 9:13â€¯AM Jan Beulich <jbeulich@suse.com> wrote:
>> On 06.07.2023 20:54, Jason Andryuk wrote:
>>> @@ -510,6 +510,22 @@ choice of `dom0-kernel` is deprecated and not supported by all Dom0 kernels.
>>>  * `<maxfreq>` and `<minfreq>` are integers which represent max and min processor frequencies
>>>    respectively.
>>>  * `verbose` option can be included as a string or also as `verbose=<integer>`
>>> +  for `xen`.  It is a boolean for `hwp`.
>>> +* `hwp` selects Hardware-Controlled Performance States (HWP) on supported Intel
>>> +  hardware.  HWP is a Skylake+ feature which provides better CPU power
>>> +  management.  The default is disabled.  If `hwp` is selected, but hardware
>>> +  support is not available, Xen will fallback to cpufreq=xen.
>>> +* `<hdc>` is a boolean to enable Hardware Duty Cycling (HDC).  HDC enables the
>>> +  processor to autonomously force physical package components into idle state.
>>> +  The default is enabled, but the option only applies when `hwp` is enabled.
>>> +
>>> +There is also support for `;`-separated fallback options:
>>> +`cpufreq=hwp,verbose;xen`.  This first tries `hwp` and falls back to `xen`
>>> +if unavailable.
>>
>> In the given example, does "verbose" also apply to the fallback case? If so,
>> perhaps better "cpufreq=hwp;xen,verbose", to eliminate that ambiguity?
> 
> Yes, "verbose" is applied to both.  I can make the change.  I
> mentioned it in the commit message, but I'll mention it here as well.

FTAOD my earlier comment implied that the spelling form you use above
should not even be accepted when parsing. I.e. it was not just about
the doc aspect.

>>> +            {
>>> +                switch ( cpufreq_xen_opts[i] )
>>> +                {
>>> +                case CPUFREQ_xen:
>>> +                    ret = cpufreq_register_driver(&acpi_cpufreq_driver);
>>> +                    break;
>>> +                case CPUFREQ_hwp:
>>> +                    ret = hwp_register_driver();
>>> +                    break;
>>> +                }
>>> +
>>> +                if ( ret == 0 )
>>> +                    break;
>>> +            }
>>>              break;
>>
>> In this model any kind of failure results in the fallback to be tried
>> (and the fallback's error to be returned to the caller rather than
>> the primary one). This may or may not be what we actually want;
>> personally I would have expected
>>
>>                 if ( ret != -ENODEV )
>>                     break;
>>
>> or some such instead.
> 
> I guess this comes back to our fruit preferences. :)

Does it? It's not just a style question here, but one of when / whether
to use the fallback.

> I can switch it around like that, and make hwp_register_driver()
> return -ENODEV for hwp_available() returning false.

Thanks.

>>> +int __init hwp_cmdline_parse(const char *s, const char *e)
>>> +{
>>> +    do
>>> +    {
>>> +        const char *end = strpbrk(s, ",;");
>>> +
>>> +        if ( s && !hwp_handle_option(s, end) )
>>
>> This check of s not being NULL comes too late, as strpbrk() would have
>> de-referenced it already. Considering ...
>>
>>> +        {
>>> +            printk(XENLOG_WARNING "cpufreq/hwp: option '%s' not recognized\n",
>>> +                   s);
>>> +
>>> +            return -1;
>>> +        }
>>> +
>>> +        s = end ? ++end : end;
>>> +    } while ( s && s < e );
>>
>> ... this it probably wants to move even ahead of the loop.
> 
> I'll switch from do/while to just while and then the NULL check will
> be covered.  In practice, this function is never called with s ==
> NULL.

In which case - why not leave things largely as they are, simply dropping
the odd check of s?

>>> +    if ( data->curr_req.raw == -1 )
>>> +    {
>>> +        hwp_err(cpu, "Could not initialize HWP properly\n");
>>> +        per_cpu(hwp_drv_data, cpu) = NULL;
>>> +        xfree(data);
>>> +        return -ENODEV;
>>> +    }
>>> +
>>> +    data->minimum = data->curr_req.min_perf;
>>> +    data->maximum = data->curr_req.max_perf;
>>> +    data->desired = data->curr_req.desired;
>>> +    data->energy_perf = data->curr_req.energy_perf;
>>> +    data->activity_window = data->curr_req.activity_window;
>>> +
>>> +    if ( cpu == 0 )
>>> +        hwp_verbose("CPU%u: HWP_CAPABILITIES: %016lx\n", cpu, data->hwp_caps);
>>
>> While I'm fine with this (perhaps apart from you using "cpu == 0",
>> which is an idiom we're trying to get rid of), ...
> 
> Oh, I didn't know that.  What is the preferred way to identify the
> BSP?

Sometimes we pass a separate boolean to functions, in other cases we
check whether a struct cpuinfo_x86 * equals &boot_cpu_info. The
latter clearly can't be used here, and the former doesn't look to be
a good fit either. However, ...

>  This doesn't necessarily run on the BSP, so "cpu"/"policy->cpu"
> is all we have to make a determination.

... isn't it, conversely, the case that the function only ever runs
on "cpu" when it is the BSP? In which case "cpu == smp_processor_id()"
ought to do the trick.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 08:29:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 08:29:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561602.878039 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ8kk-0001d2-HW; Tue, 11 Jul 2023 08:29:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561602.878039; Tue, 11 Jul 2023 08:29:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ8kk-0001cv-DZ; Tue, 11 Jul 2023 08:29:46 +0000
Received: by outflank-mailman (input) for mailman id 561602;
 Tue, 11 Jul 2023 08:29:44 +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
 <SRS0=mGx4=C5=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1qJ8ki-0001cj-IF
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 08:29:44 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on20623.outbound.protection.outlook.com
 [2a01:111:f400:7eaa::623])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 14662140-1fc5-11ee-8611-37d641c3527e;
 Tue, 11 Jul 2023 10:29:41 +0200 (CEST)
Received: from BN0PR04CA0172.namprd04.prod.outlook.com (2603:10b6:408:eb::27)
 by CYXPR12MB9443.namprd12.prod.outlook.com (2603:10b6:930:db::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Tue, 11 Jul
 2023 08:29:37 +0000
Received: from BN8NAM11FT089.eop-nam11.prod.protection.outlook.com
 (2603:10b6:408:eb:cafe::f0) by BN0PR04CA0172.outlook.office365.com
 (2603:10b6:408:eb::27) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32 via Frontend
 Transport; Tue, 11 Jul 2023 08:29:36 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 BN8NAM11FT089.mail.protection.outlook.com (10.13.176.105) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.20 via Frontend Transport; Tue, 11 Jul 2023 08:29:36 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 11 Jul
 2023 03:29:35 -0500
Received: from XIR-MICHALO-L1.xilinx.com (10.180.168.240) by
 SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23
 via Frontend Transport; Tue, 11 Jul 2023 03:29:34 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 14662140-1fc5-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LSjTlZtlRBcNVhF8pjgSZll1sCsjqtcBc58lVZSdnFwa4CvcBk3wpFZxZTC7tqcO+B979IV3izeGdEoeDkNCgYYvfVlG+w1Yafp+RLxCtmjBCiC1aKf9g4cprg9avawZVxwjuMTDSkY6iHKLD8N7zSLlp+tKmB2wzQKD+L7nIe3iSkkvpBPAXchynP6B20nZAQZywkthHru/KvavPLUoHgXUZKUU91vo6DmzhvOI7w4KEheoUe3rz5/kdYxOgdvzwbE/f7TJSvA7n5BLLFURa1jEvkjQ5LOuB7EFjSCRcAoPNUFykpfd9x9nDMLuUQZn4CcuYGMJ66KqWGdfT3dasA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=myHZUIRXbht0/I9oaq8R1oWGSnjo01WXF/m1o3C9/VY=;
 b=XJLhsZBYpBz9Ha4IG1JSDfjibPC/IZ69Vdd0OswIhG2Kh7E8T1co9aAEzKF+S+/HH6NXTPwN4A26j+XW5kZsKlTeg411DWGMB7IZbS/OnrESCvz/wrEIwcuPNADsgTEeNU1ePt3bTgYFqNl1rWoRbVwLczB6oJZw3S6HqZohUOXSsiveXWElECbeyspV0NyzHdp7CHziMYUQNG9VypbEWRwt8bkl37l2nGjZHjLpJlY7QtPJvQhv92kjXyhuoCoP+RR3rqxP6eBs3dm35llKYolwEivGGDAv00AwOAlNpwMnexyKR/EE58GOi9KEeSUnzp0oT77RBjV9AWetAP1tzg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=myHZUIRXbht0/I9oaq8R1oWGSnjo01WXF/m1o3C9/VY=;
 b=yhCyXw6j67nohET7IBG5Fo9h9u4rt+4N/XVfRPfjbPTA8a0B2dpd+U18T7J3GFW6pficWh25s21+faCwjg3hf61TJk1/Q4ILomOrFg4/3lfBbjalgjMuOZ4qQJjonLg7tGWaqkt9klYg5WuHXK/VM+LcExph/T3M+EZjvJGaPZU=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Michal Orzel <michal.orzel@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Michal Orzel <michal.orzel@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH 0/2] xen/arm: Support for bigger domU passthrough dtbs
Date: Tue, 11 Jul 2023 10:29:29 +0200
Message-ID: <20230711082931.5402-1-michal.orzel@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN8NAM11FT089:EE_|CYXPR12MB9443:EE_
X-MS-Office365-Filtering-Correlation-Id: 8e868db1-dbdd-458f-3ebc-08db81e8f62b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	U/WwtYyJHvPAwvYfcH5Ss7BfUmOwYj29ki3gk8OYpanmKAv0geAAn2sVwh1exkMZGbPChIwDWy5NYqUt6hpyxenEhZ8etsKg4VUpHwH1cxvi2HPc+NoE9rh18frHttmMcR2jSHA3oXphrd8ORWFP0Lp+YSjjKEf0RJH6YyvHjMucRaeH6skoLyRBnCenlpYtT0RnJqzTz9QV4u7Uf5l3xRgIF/AQJdvEdsJyEbrojWjL47AECCIliYYIr3hsN4a91IddtKXu17nEI3VQoVfY2Hvwu797DdwDLWO0HgeAZBGstec/wV1SHIGAyByOXcPT0JqO16zZmL2MA5p9FmrxbdUTY3KOXZOGTe4DSqMsSNbooSQzk4bYXG9vJSFo/wPLdGpGOmuumw2IuTxr8qx6t2WZlKgo6jkYf9Y7sSYKfOTeIJuzGvSrJ1PKIo5BpMl2zOE95Ikojiv7jU9J5VMUxWtWecSlm7Gh+esgj+8d0/c3nhqKzB13VB38VN7iv7ckslvqpTDKegAFLgmggWNb0MXLmQrSSPzbtPsYXJxk6e7IwRE/LVdOv1zlFMrBlI/An+giHOGNF4ydKliM1ljypV15AekXKMYmVUUmX0AqcUaSWZKaOkcR8b/mTWrlDmujMH8PCRw0oKHhpscn5a9UmSnpiOVyPU2RAbY0yfUFFnuWFsyUmZNUpsA+8vb7kN90+G2dTpHqpnXEbP9KEKuLOEmh7dync1YzItpPFCJbq93uFMfsVedgfJ4tfTt3VsifMNSkkloDV/corcuX2r0Rn7xz8UumarUKSfeCLU8+PRs=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(376002)(396003)(136003)(451199021)(40470700004)(36840700001)(46966006)(5660300002)(44832011)(316002)(70586007)(70206006)(41300700001)(8936002)(2906002)(6916009)(4326008)(8676002)(6666004)(54906003)(47076005)(26005)(1076003)(186003)(83380400001)(4744005)(2616005)(426003)(336012)(36860700001)(40460700003)(478600001)(82740400003)(81166007)(356005)(82310400005)(36756003)(86362001)(40480700001)(135533001)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 08:29:36.5013
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 8e868db1-dbdd-458f-3ebc-08db81e8f62b
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN8NAM11FT089.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYXPR12MB9443

First patch with a fix (more for a logic than a bug) added to series for
ease of merging.

Michal Orzel (2):
  xen/arm: Fix domain_handle_dtb_bootmodule() error path
  xen/arm: Account for domU dtb bootmodule size separately

 xen/arch/arm/domain_build.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)


base-commit: b831326ee2f9ed94523b3d8b0fb2da2a82113e9e
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 11 08:29:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 08:29:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561604.878060 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ8kx-0002DJ-1r; Tue, 11 Jul 2023 08:29:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561604.878060; Tue, 11 Jul 2023 08:29:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ8kw-0002D6-T7; Tue, 11 Jul 2023 08:29:58 +0000
Received: by outflank-mailman (input) for mailman id 561604;
 Tue, 11 Jul 2023 08:29:56 +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
 <SRS0=mGx4=C5=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1qJ8ku-0001cj-Rh
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 08:29:56 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on2060a.outbound.protection.outlook.com
 [2a01:111:f400:fe5b::60a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1c64cfa5-1fc5-11ee-8611-37d641c3527e;
 Tue, 11 Jul 2023 10:29:55 +0200 (CEST)
Received: from MW4PR03CA0125.namprd03.prod.outlook.com (2603:10b6:303:8c::10)
 by PH7PR12MB7870.namprd12.prod.outlook.com (2603:10b6:510:27b::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Tue, 11 Jul
 2023 08:29:50 +0000
Received: from CO1NAM11FT063.eop-nam11.prod.protection.outlook.com
 (2603:10b6:303:8c:cafe::89) by MW4PR03CA0125.outlook.office365.com
 (2603:10b6:303:8c::10) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31 via Frontend
 Transport; Tue, 11 Jul 2023 08:29:50 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1NAM11FT063.mail.protection.outlook.com (10.13.175.37) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.18 via Frontend Transport; Tue, 11 Jul 2023 08:29:49 +0000
Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 11 Jul
 2023 03:29:46 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com
 (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.6; Tue, 11 Jul
 2023 01:29:39 -0700
Received: from XIR-MICHALO-L1.xilinx.com (10.180.168.240) by
 SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23
 via Frontend Transport; Tue, 11 Jul 2023 03:29:37 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1c64cfa5-1fc5-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=m7ZQwkn5k2R8LG32eKvVujZx/LGb923XsnbaztCxw8t7AwbkprxLwx6YfGtJXTBv4dcflHq/iVmYHD82EdExKZp6QFqgYRlPBElfnuzmKHldRWFWtXhrjUo4u+U7s066Ai3v8c0eyRD0Dmhat+uBBD2EWDkloChOV9y7GX4TQBsft/vOOkCqjYvhno2aMQTRtlSk1sYXDi3KIaFFs5KRNIHQFizfRI5xu9R17nOqw5H48IhE+S0uFqtVzsf+GjWGjdUVzCnmrjj9lp1Pm25dUXD/mJoH2r8WFbrIqMMVrQdRYRvFcBfBhdM93G/lW0Ja34aEcHWYDNvScAvfKVx4Fw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=RFJtVBokWQOgsGyRuqtzu1MVYHpDtHoyB0Kjiu13Ozg=;
 b=H2aC1leHpsENWD3DMzmY2gldE0D8fCymfO/jnrpDaCGfszgUpwwzzgmuzEHQO0o7dRYuRjA9zti09zrJHLHe4EJSZkXaba4PTRwyBu9iFY8912BnRWJbhTnRpSVtBi95GXKgNMgtYLmDseeUpyBceCVeeE8p7F7xADyDr/yz+eK/zy3EbBisbm1IBQysemkCobWL9xNFBIhC0pmB8HnwjpSnP9kibM9ZpPnxKf1IUgh13HCPFokEw+X3kB4fKIDgsYVHL3YJ8yslQT6G/dBimdgcxrMQ9vZPzRI/fCJHLSJ/Vlx1dY7hRS0B0UX+Hv6bxeqtVztXYcWPP6Crj1JfOg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RFJtVBokWQOgsGyRuqtzu1MVYHpDtHoyB0Kjiu13Ozg=;
 b=gaGBgKgq7IteaQFjm56EFQu9aDxWLyU96zL56+hbdkXj/Es6XifOlxvGKbhqpU1Y59fXUxrO/QqCPI12xWUFdqTjM62w4oUpo9lsXjjKjkHwwELes9uVXl8X1Bhon1sgkmKkncbTPue/AvGTPuluuJc1+0CAjWmlP0Ru+db6o4g=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Michal Orzel <michal.orzel@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Michal Orzel <michal.orzel@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH 2/2] xen/arm: Account for domU dtb bootmodule size separately
Date: Tue, 11 Jul 2023 10:29:31 +0200
Message-ID: <20230711082931.5402-3-michal.orzel@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230711082931.5402-1-michal.orzel@amd.com>
References: <20230711082931.5402-1-michal.orzel@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1NAM11FT063:EE_|PH7PR12MB7870:EE_
X-MS-Office365-Filtering-Correlation-Id: b4d2e356-099a-468b-e17f-08db81e8fde3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	32N8AXTmIXJCkHIn7MtqV/g/Pn+cFwEFd8wL01It2PleCqijOx2jAwGUXN9fDWPO6lrJP513NRlk+pWYoNEPsP3aHhFWDiGNWs75QC3CqR0Vgy77fLJYasu/wwspVWw9Wa7Mxi9lZfGVZgpbJkqEgPmBmfoNcMJOkE9+63Sk4APULuiZw9r2dvbbdOHatXtHp0Pj1oglsn+Lt6e+5c67hQ8/cNSBXi5JdyAgtjXbyrEa7pDIcIILLvMFnrJZV4Kpg8VGesm+dA/j2lVLZX+YHXyMnUcEQiDMLsDcN7ZfG9SgPvHh7lFescsqXYJwcXex3HjCWbqhiAeTIwxwPblWrCxDeDurUIT/4tUrd6ahXhl2ymVwlttUCOUcIFmKLXpoXU3cPcCH0HNK5Xvqg1QRNG/j8Q1OS7HfFvY7yQdCw24WdRZCA0IcQfFxAWTfVdW+npzQ+SFku70pZ1HmVHtkBSBT+hXc/Sn9GUdbmpZ01Ep0UepiR7aC+008G8tqSUj+Xsg1D3aXrGhJcoO+rqyNQtvk86dNlZmqZXFS3WktXrSLTlJPnsC6ctlo56kM7rqUHjDHRiKjZ4SNliosFjYVplNWuel08qOXO11T5x9qXRaTmBQht8UtGgvVU9S6ClqevPL3gdNvPyl+TDecgA97C36zwJeXjqNlgIz+CzFfvAqOH1IWiuQzfSvHzSR9+6i1mIc1TqPIhZGB297+xj1acRLO2Ja287AxuQ3EzJ02MBSLzHHErkMvHjJhnWeaHDGZbFs2eC+3v0vungBn3ar8yA==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(396003)(39860400002)(346002)(451199021)(46966006)(40470700004)(36840700001)(70206006)(6916009)(70586007)(2616005)(356005)(81166007)(86362001)(316002)(26005)(54906003)(1076003)(40480700001)(186003)(36756003)(40460700003)(82310400005)(4326008)(82740400003)(15650500001)(47076005)(8676002)(2906002)(8936002)(6666004)(44832011)(5660300002)(36860700001)(83380400001)(426003)(336012)(478600001)(41300700001)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 08:29:49.3616
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b4d2e356-099a-468b-e17f-08db81e8fde3
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1NAM11FT063.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7870

At the moment, we limit the allocation size when creating a domU dtb to
4KB, which is not enough when using a passthrough dtb with several nodes.
Improve the handling by accounting for a dtb bootmodule (if present)
size separately, while keeping 4KB for the Xen generated nodes (still
plenty of space for new nodes). Also, cap the allocation size to 2MB,
which is the max dtb size allowed.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
Note for the future:
As discussed with Julien, really the best way would be to generate dtb directly
in the guest memory, where no allocation would be necessary. This of course
requires some rework. The solution in this patch is good enough for now and
can be treated as an intermediated step to support dtb creation of various
sizes.
---
 xen/arch/arm/domain_build.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index f2134f24b971..1dc0eca37bd6 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -3257,14 +3257,15 @@ static int __init domain_handle_dtb_bootmodule(struct domain *d,
 }
 
 /*
- * The max size for DT is 2MB. However, the generated DT is small, 4KB
- * are enough for now, but we might have to increase it in the future.
+ * The max size for DT is 2MB. However, the generated DT is small (not including
+ * domU passthrough DT nodes whose size we account separately), 4KB are enough
+ * for now, but we might have to increase it in the future.
  */
 #define DOMU_DTB_SIZE 4096
 static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
 {
     int addrcells, sizecells;
-    int ret;
+    int ret, fdt_size = DOMU_DTB_SIZE;
 
     kinfo->phandle_gic = GUEST_PHANDLE_GIC;
     kinfo->gnttab_start = GUEST_GNTTAB_BASE;
@@ -3273,11 +3274,18 @@ static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
     addrcells = GUEST_ROOT_ADDRESS_CELLS;
     sizecells = GUEST_ROOT_SIZE_CELLS;
 
-    kinfo->fdt = xmalloc_bytes(DOMU_DTB_SIZE);
+    /* Account for domU passthrough DT size */
+    if ( kinfo->dtb_bootmodule )
+        fdt_size += kinfo->dtb_bootmodule->size;
+
+    /* Cap to max DT size if needed */
+    fdt_size = min(fdt_size, SZ_2M);
+
+    kinfo->fdt = xmalloc_bytes(fdt_size);
     if ( kinfo->fdt == NULL )
         return -ENOMEM;
 
-    ret = fdt_create(kinfo->fdt, DOMU_DTB_SIZE);
+    ret = fdt_create(kinfo->fdt, fdt_size);
     if ( ret < 0 )
         goto err;
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 11 08:29:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 08:29:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561603.878044 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ8kk-0001gQ-P9; Tue, 11 Jul 2023 08:29:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561603.878044; Tue, 11 Jul 2023 08:29:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ8kk-0001ff-Kz; Tue, 11 Jul 2023 08:29:46 +0000
Received: by outflank-mailman (input) for mailman id 561603;
 Tue, 11 Jul 2023 08:29:45 +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
 <SRS0=mGx4=C5=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1qJ8kj-0001cj-8H
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 08:29:45 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on20601.outbound.protection.outlook.com
 [2a01:111:f400:7eae::601])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 159936a3-1fc5-11ee-8611-37d641c3527e;
 Tue, 11 Jul 2023 10:29:42 +0200 (CEST)
Received: from BN9PR03CA0349.namprd03.prod.outlook.com (2603:10b6:408:f6::24)
 by MW3PR12MB4459.namprd12.prod.outlook.com (2603:10b6:303:56::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Tue, 11 Jul
 2023 08:29:39 +0000
Received: from BN8NAM11FT058.eop-nam11.prod.protection.outlook.com
 (2603:10b6:408:f6:cafe::61) by BN9PR03CA0349.outlook.office365.com
 (2603:10b6:408:f6::24) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32 via Frontend
 Transport; Tue, 11 Jul 2023 08:29:38 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 BN8NAM11FT058.mail.protection.outlook.com (10.13.177.58) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.19 via Frontend Transport; Tue, 11 Jul 2023 08:29:38 +0000
Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 11 Jul
 2023 03:29:37 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com
 (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.6; Tue, 11 Jul
 2023 01:29:37 -0700
Received: from XIR-MICHALO-L1.xilinx.com (10.180.168.240) by
 SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23
 via Frontend Transport; Tue, 11 Jul 2023 03:29:36 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 159936a3-1fc5-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JhNCSmuNj52GxjfeSx4MF9ZlobOGcqD+ZANrfmmnsStJjICkdhx46OFSnQ+f1Y+xhJmRbwmi8kon/ejOsp/Ws4Nt117+kzC72inXFDavjUaXuBTxS2DeF5nHqI06W5F/5pVbn63waNK+acZVEkR0iA/4xPfHn3vkbZTRjxkSMkQmwbP6ujgBjmz+AmKtM6OXJfgJlL0ccOhNmabwYcT6H3t5R5vlABbBmJZ3M+lycep3oGOPFQpYwKoLtPtYY21yB7G4blO7ANVZwXP9YtAPdEjZWXAf8iSRJ1Cyc0VazPpJg7ZlmrS6rs5c1cciUgfNWFG0wVBTjh6RGjlnILNf+w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Dk3lg1kmifrQv5WMidBKQfd64VXe9Ntgkfwp5vhYxrY=;
 b=l8xePGT4laCgPZk5GHjg4HGin0pnz0wpx30VMUMPfShLvqLr6bXBay9951p3PiK/oaaSxPQMTDeCx9K+bFGDX723t35O5v8YsEjqQm5giw2HWdKIYAHhJHKP+3fgWGxPLBbYie/Jd5yxroWcD8sO8/a2R1aN+ngPqGO6Vr9O4tz081RYnlcvAyOStEhlX39ZZRMyW5+0zZAMrr1tcpeFr8iRusSGxqP8B9le/JdALeq4C3/OdiKY/Ly++nLKuH1nd9B6sI8Ba7SJu04sJMkQiLKgxp0bnLvSzlGae/zix0xbBzPaWVSEvuhEuKX+hNJ7KFlyaH1NGUJKdmLRxifAOg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Dk3lg1kmifrQv5WMidBKQfd64VXe9Ntgkfwp5vhYxrY=;
 b=QdrvXWhjednhsfhd2GVUjZYlpPNCY+Y3Xm7DBmk4yjbsjWtwx/eZGI/eW2E7yr8ikw4BsfqEpnpPeFyjJf77wttdhaCWN3dvfBsC/Jkcdqb0ERPR7/0OvAg5k5HlsiRpwlHe6mGs3QWvUA8QkLEmE+LyVJeb8i9/w4KlyHCN0pI=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Michal Orzel <michal.orzel@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Michal Orzel <michal.orzel@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH 1/2] xen/arm: Fix domain_handle_dtb_bootmodule() error path
Date: Tue, 11 Jul 2023 10:29:30 +0200
Message-ID: <20230711082931.5402-2-michal.orzel@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230711082931.5402-1-michal.orzel@amd.com>
References: <20230711082931.5402-1-michal.orzel@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN8NAM11FT058:EE_|MW3PR12MB4459:EE_
X-MS-Office365-Filtering-Correlation-Id: 4e52833c-9f40-459f-fc3f-08db81e8f71e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	RfwkPY8KkBo/zyKRfFJJDTXT7PQUwAiwRgHIIyTFecYcmUWyBGTtvbm4OMglbfyojSD4h0AZLEdi+lBjx+U6FytmLbXvIHFBpVYSmQ1DkZK8b2IOgp8kRJNpkzCiz85TS4zft68d5PN6X7dyJU3O3Vys4nZsJGLNJl2GQ+5Aq9YFl8m3Oe6JtLQVlKsA/ypkUM575+V2+izep9836Xsh4gkB3rhAKA/URkKldoIv3O0KOCC10o/UnFLhoNccRnqWEMdQwOnsY6U+VtkInyFr26GJShOX4+tj+bNAR3MQChs2PQDevJwM89urhONw6scMJjODumV3ZAksV2hGgM0V9t9RnJXK9UQLgE6MIrdkybY/0i0BYL7WeUugWA1dJm7anTBd9aq2gObAbWSVTYJErhvw4FaWAvWF0VIRURfxZBfCtoGrPneCZc8SRRLfviQinWjvaOV6X5AdBcLTut7BjpgMT9KVFlMahjWk6DaBn/xeO41BadJXkvyGQRH8A5tAk0XRBs/rVjrG3kmWTd6CJdv9EgWpAZKYpWpmjLUCBbBkqGpom8xBME5mXgkCR0vFsw5rmk2RvD2nkw6lYX9535V9OJEr+To0Z3gqj1USvrzCptCMpmO1eVU91oG1aTVp4z2FY03duuvMROTHmV2jMhuotmGLeup+BoGXg9uZ1iudJUXsM7SNcfnNBRvgQah5jlGQpRQWSN97bEhcYiFy1wEl7MxA48lTywQlB+VIfg1Mm2MiDsJLinL11GGyR7Jd4YbwezhzuPfPOBYL470+8g==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(376002)(346002)(451199021)(40470700004)(36840700001)(46966006)(186003)(336012)(1076003)(44832011)(8936002)(8676002)(26005)(5660300002)(40460700003)(41300700001)(86362001)(54906003)(2616005)(40480700001)(81166007)(316002)(426003)(2906002)(82740400003)(6916009)(356005)(4326008)(83380400001)(6666004)(47076005)(70586007)(70206006)(36756003)(36860700001)(478600001)(82310400005)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 08:29:38.0987
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 4e52833c-9f40-459f-fc3f-08db81e8f71e
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN8NAM11FT058.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4459

Fix the error path in domain_handle_dtb_bootmodule(), so that the memory
previously mapped is unmapped before returning the error code. This is
because the function shall not make assumptions on the way of handling
its error code in the callers. Today we call panic in case of domU
creation failure, so having memory not unmapped is not a bug, but it can
change.

Similarly, fix prepare_dtb_domU() so that the memory allocated is freed
before returning the error code from domain_handle_dtb_bootmodule().

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/domain_build.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index d0d6be922db1..f2134f24b971 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -3204,7 +3204,7 @@ static int __init domain_handle_dtb_bootmodule(struct domain *d,
 
     res = check_partial_fdt(pfdt, kinfo->dtb_bootmodule->size);
     if ( res < 0 )
-        return res;
+        goto out;
 
     for ( node_next = fdt_first_subnode(pfdt, 0); 
           node_next > 0;
@@ -3235,7 +3235,7 @@ static int __init domain_handle_dtb_bootmodule(struct domain *d,
                                  DT_ROOT_NODE_SIZE_CELLS_DEFAULT,
                                  false);
             if ( res )
-                return res;
+                goto out;
             continue;
         }
         if ( dt_node_cmp(name, "passthrough") == 0 )
@@ -3245,11 +3245,12 @@ static int __init domain_handle_dtb_bootmodule(struct domain *d,
                                  DT_ROOT_NODE_SIZE_CELLS_DEFAULT,
                                  true);
             if ( res )
-                return res;
+                goto out;
             continue;
         }
     }
 
+ out:
     iounmap(pfdt);
 
     return res;
@@ -3326,7 +3327,7 @@ static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
     {
         ret = domain_handle_dtb_bootmodule(d, kinfo);
         if ( ret )
-            return ret;
+            goto err;
     }
 
     ret = make_gic_domU_node(kinfo);
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 11 08:49:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 08:49:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561617.878068 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ93i-0005CR-G9; Tue, 11 Jul 2023 08:49:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561617.878068; Tue, 11 Jul 2023 08:49:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ93i-0005CJ-Da; Tue, 11 Jul 2023 08:49:22 +0000
Received: by outflank-mailman (input) for mailman id 561617;
 Tue, 11 Jul 2023 08:49:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJ93i-0005CA-3i; Tue, 11 Jul 2023 08:49:22 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJ93i-0001qe-0K; Tue, 11 Jul 2023 08:49:22 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJ93h-0008Cd-JK; Tue, 11 Jul 2023 08:49:21 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJ93h-0006zq-Im; Tue, 11 Jul 2023 08:49:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=yYBxpm20Fx1MLzv++v6c+PbvH0TOseSsd+VcVJnmiHQ=; b=IY3Y0zGrJQr0o07ECJ2zoxbycs
	f9qdyLLWVodIrhBtXHFxWUWbXBLNoqWriGlf2APvN2utE1ab28Q5ANT2zQ1lVkUvy+zkUEnLUzcC+
	iNkEh15A5pCKrjp87bo38I8b71PhOX1w1LRjUY8K/nLE9c4Vy1cw4N60OUSIxSnVTESY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181760-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181760: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=8dab4eebe435fc28cae329867a74cee45d040d3e
X-Osstest-Versions-That:
    ovmf=964a4f032dcd15d7b0d9246625b13b71182e4eae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 11 Jul 2023 08:49:21 +0000

flight 181760 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181760/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 8dab4eebe435fc28cae329867a74cee45d040d3e
baseline version:
 ovmf                 964a4f032dcd15d7b0d9246625b13b71182e4eae

Last test of basis   181757  2023-07-11 03:12:21 Z    0 days
Testing same since   181760  2023-07-11 06:42:24 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  MarsX Lin <marsx.lin@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   964a4f032d..8dab4eebe4  8dab4eebe435fc28cae329867a74cee45d040d3e -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 09:14:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 09:14:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561630.878078 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9SG-0000IE-MJ; Tue, 11 Jul 2023 09:14:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561630.878078; Tue, 11 Jul 2023 09:14:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9SG-0000Hu-Jf; Tue, 11 Jul 2023 09:14:44 +0000
Received: by outflank-mailman (input) for mailman id 561630;
 Tue, 11 Jul 2023 09:14:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=rRYD=C5=citrix.com=prvs=54940d4e9=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qJ9SE-0000Hl-UJ
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 09:14:42 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5c697210-1fcb-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 11:14:40 +0200 (CEST)
Received: from mail-co1nam11lp2168.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.168])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 11 Jul 2023 05:14:37 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by BLAPR03MB5476.namprd03.prod.outlook.com (2603:10b6:208:29b::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Tue, 11 Jul
 2023 09:14:36 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2%5]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023
 09:14:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5c697210-1fcb-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689066880;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=IO4p+DLQDhuJT3ucqtr4Iw7ZVOPThfHcZM1+E10P38k=;
  b=grkrj1VLEpkEqQWmrv4WIAlD/CcIQl434CKEMncsuYDphAg8cIV8Nq8p
   KBFEtNtnocD4ASlCdM4I2pUegiwfymZBSBApMDRfqsZ8OKIWCUIewM0PT
   kq+XDTnFowh+Yz+vZLBAceU7fWH/9g8Vc1ejhEFrdxG+pdYmg9AtmnHUf
   M=;
X-IronPort-RemoteIP: 104.47.56.168
X-IronPort-MID: 115820306
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:5ahtmazYJVjg/Njjpal6t+cRxyrEfRIJ4+MujC+fZmUNrF6WrkUDy
 2ZODW+DbP3fYWCje4p/aITnoExQvJPXzIA3SQQ5qSAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhPKkT5TcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KWhz9
 u4SMTY9VxOGisLv7JGkQ8ZKqNt2eaEHPKtH0p1h5RfwKK9/BLvkGuDN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjaVlVIhuFTuGIO9ltiiX8Jak1zev
 mvb12/4HgsbJJqUzj/tHneE37aSzXmjA9pMfFG+3t87hlSdyDIzMx0bSleX5r6210iPZvsKf
 iT4/QJr98De7neDTNPwQhm5q36spQMHVpxbFOhSwB6J4rrZ5UCeHGdsZi5MbpkqudE7QRQu1
 0SVhJX5CDp3qrqXRHmBsLCOoluP1TM9KGYDYWoPSlID6ty6+YUr1EuRHpBkDbK/icDzFXfo2
 TeWoSMihrIVy8kWy6G8+lOBiDWpznTUcjMICszsdjrNxmtEiESNPeRENXCzAS58Ebuk
IronPort-HdrOrdr: A9a23:67idF64ROz7DM+Dn9APXwAzXdLJyesId70hD6qkQc3Fom62j5q
 WTdZEgvyMc5wx/ZJhNo7690cq7MBHhHPxOgbX5VI3KNGXbUQOTR72KhrGSoAEIdReeygZcv5
 0QCZSXCrfLfCVHZRCR2njFLz4iquP3j5xBnY3lvhNQpZkBUdAZ0+9+YDzrdXFedU19KrcSMo
 GT3cZDryrIQwVtUizqbkN1OdQqvrfw5evbXSI=
X-Talos-CUID: 9a23:5AC3VWF35q51Jz+UqmJuyU0GENkjQkTeyXrwemObFm9GbpOKHAo=
X-Talos-MUID: 9a23:dIsn/Qn06KrbWtMi5Is+dnpDZcFh7arwKHsNnIoKl47DOnF2Cgq02WE=
X-IronPort-AV: E=Sophos;i="6.01,196,1684814400"; 
   d="scan'208";a="115820306"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ejjRm69GjpF9tMGNB+ZxkyEFBkemt+JlU9GhVE0N+XU6u3zyGWIF3uWLdhIzQmk6mS560FULlWo0ordXcN+9FG+4qcdOOOekRCO61+UKVztDUmLTBWqdHI941C1K2DzevGx5hnRGFhPFb9RD2L9zsPu/BFPcFeostCoPOGf2yGbbLkB0h9WvFE5muttCDbDZKi765jG4KFcpECZGlQPxSJGzi9qKmfYWUPbYRCzlyLoLY9D0/r7BLwb6hZFPAbBFJF9PgjLnOPXKqjR6Nk0vfd6P1NCGIjojSB+O9AUIrJkFruMNr5VE7DoZLe8baKO1qr9wddFr2ULKDJzp2GS/nQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=x+waXIC4Ec0IEes6IKMtmlXuM00CRnZGiWTjMJ49sBE=;
 b=V1NjPm+mBe58aHCDY24vKI5a9Qflrr2t8Ymu42jgTBRkv2egpg1m9WEEO6IbgzDN3YvosbUt9YEDXvarIEMHJRi6h0r6hli3FoIuxHVqfpYF9HvGN2F/iXHJCvE3lESiyrD/lgTga72tbDmI8UkZxx+6RI8hM53O3tLKlZhwUdMEn22eR2rfw7QrAF0E6G+37aDhzWTNyCN54L/JEVB5Xs6HzUsOAAaXplxHC8Oh2oPXocwZUcTVd+uMgTakmY/BjBOVyrGWhWzVHmrekZSmSj3iEAgBOlS+kc/g764jr0lc99jvElBgtfaygliPak5vgfzbGA+q2zVP+3Oi4FWqRg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=x+waXIC4Ec0IEes6IKMtmlXuM00CRnZGiWTjMJ49sBE=;
 b=jvYEuk3nukIxU60b+nr5hPlbq1V+gQ1seQQ7Ux1KvW77ZOHIekdzphNKW6UzEue1raJfhCi7kyoTA1M6S5NGJZiE1JMV+w6nB1oQ7bEtj5g8R611eRD6+sNj1AbvS5kY1TlBEEuw/s3VRsAuCQAsfZxaXcewrSaAvvVRJlWZIDk=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Tue, 11 Jul 2023 11:14:28 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] cmdline: only set ask mode if vga= is present
Message-ID: <ZK0ddKXx13fu1yfX@MacBook-Air-de-Roger.local>
References: <20230710141238.375-1-roger.pau@citrix.com>
 <9827433d-54dd-47e6-1f74-53612da21c14@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <9827433d-54dd-47e6-1f74-53612da21c14@suse.com>
X-ClientProxiedBy: LO4P123CA0318.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:197::17) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|BLAPR03MB5476:EE_
X-MS-Office365-Filtering-Correlation-Id: 44be8f40-3e56-4f25-fdbf-08db81ef3eab
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	YdTd3l4QFxvi7rzO1EokdSenYS134y1s8O27+Z6Dwh4myzSFWIeHVxj5kZLruKO1SzFP6iisCa0oqF4AciP8adyIyJX0X8Blq36jOH4ZCJ2flZsfJOwbeUKHA886v/ippZ5yRsIFwDziZ9hTY+UvfpeX5urVmN+CGXY7IswpDdONlGmzwOflqTV8U0hJY7XiD9Z03U6um9xMvvXBmCfUV+I3BdYO6NpcMhxSV1nCzdNODv/ZgcBBEtul/QVOhAOF6PgVsL3lUvHXdUCd+gEcXpy7O+fhBlxdeWlDBGik1En0a6FxkHmngRO+p4wVcTKk2LtIqNRnBjJRR1jN29MP823FTS5JcWqt4H5FIcRCqfcOj6jsndu4gEqdhxu4Kg4ZyMcJpE7WYRAhiuCmNVqNqGyu9wiW0xZHRPCIojgrNbr8hjMSHzjChQpJjFHg2p1MmHOG95pVrEesOqKKp2BFHY7CErYwvxwcbuMg+bawOJcl2PbvxdyZlJAlbPXKla+VdHff9K+tW3LxWO/PiJFbFSOuG2cbIFrKQvg/KOnzfdXR+4RD1PHPllma+sw+BHuE
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(39860400002)(376002)(366004)(346002)(451199021)(6666004)(6486002)(478600001)(26005)(6506007)(186003)(53546011)(85182001)(9686003)(6512007)(316002)(2906002)(41300700001)(38100700002)(82960400001)(66946007)(66476007)(66556008)(6916009)(4326008)(86362001)(8676002)(8936002)(5660300002)(54906003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?T1JCTUJFN2ZPaVpVN0JvY0RPZnlKWFRDL3FyQ1hDZ2RyR2tyWU1tZUJwZEtq?=
 =?utf-8?B?cENrUHU1b3V3djRpWGk2T0hTSFhIWjV5MCtwSFJvUTFoNG9DQXRlZUgxUTRj?=
 =?utf-8?B?Qkkva012azNYTDBTM09vNVpVNytTd0t1U2o5WWRvR3psSTlRUEx4eHpTd3pV?=
 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ZFGuzd66ITnJS8jn2dr+C8VmWgpIMY04j8wiHlfsGo7iKePFSqpfTGUE6G/RPW3Ach2SGW7KZvyUgMQu5JxLDIRUqWs9l45zcV+F5RAqo//KIn16OCaP4Z1
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 44be8f40-3e56-4f25-fdbf-08db81ef3eab
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 09:14:35.3340
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Vz8nqblZaeCONVB6SgBTOGRa7Uxj4qKF3X5Ryv5A9b44zR4kreKUfV8T3mgMPacE4z1kTtk0bAeMYd/+j17bWQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR03MB5476

On Mon, Jul 10, 2023 at 06:27:06PM +0200, Jan Beulich wrote:
> On 10.07.2023 16:12, Roger Pau Monne wrote:
> > Commit 9473d9a24182 set the ASK mode without checking if there was a
> > `vga` option provided in the command line.  This breaks existing
> > behavior, so exit early without changes if `vga` is not present in the
> > command line.
> > 
> > Fixes: 9473d9a24182 ('cmdline: parse multiple instances of the vga option')
> > Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> 
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> 
> Should have spotted this during review; effectively you're (almost) undoing
> part of the earlier change, just that ...
> 
> > --- a/xen/arch/x86/boot/cmdline.c
> > +++ b/xen/arch/x86/boot/cmdline.c
> > @@ -279,9 +279,13 @@ static void vga_parse(const char *cmdline, early_boot_opts_t *ebo)
> >  {
> >      const char *c = cmdline;
> >  
> > +    c = find_opt(c, "vga=", true);
> 
> ... you use c instead of cmdline here (and I'm heavily tempted to actually
> make this the initializer of c).

I see, yes, please do.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 09:15:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 09:15:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561632.878090 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9So-0000k3-0V; Tue, 11 Jul 2023 09:15:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561632.878090; Tue, 11 Jul 2023 09:15:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9Sn-0000jw-S7; Tue, 11 Jul 2023 09:15:17 +0000
Received: by outflank-mailman (input) for mailman id 561632;
 Tue, 11 Jul 2023 09:15:16 +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
 <SRS0=pXgh=C5=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qJ9Sm-0000jb-N4
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 09:15:16 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2060a.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::60a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 716857a3-1fcb-11ee-8611-37d641c3527e;
 Tue, 11 Jul 2023 11:15:14 +0200 (CEST)
Received: from AS9PR05CA0040.eurprd05.prod.outlook.com (2603:10a6:20b:489::23)
 by AS8PR08MB6199.eurprd08.prod.outlook.com (2603:10a6:20b:296::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Tue, 11 Jul
 2023 09:15:11 +0000
Received: from AM7EUR03FT040.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:489:cafe::ac) by AS9PR05CA0040.outlook.office365.com
 (2603:10a6:20b:489::23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32 via Frontend
 Transport; Tue, 11 Jul 2023 09:15:11 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT040.mail.protection.outlook.com (100.127.140.128) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.19 via Frontend Transport; Tue, 11 Jul 2023 09:15:11 +0000
Received: ("Tessian outbound f5de790fcf89:v145");
 Tue, 11 Jul 2023 09:15:10 +0000
Received: from d3b7c04aee46.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 4F3B9CD6-762B-487F-BE33-DA14131ADABF.1; 
 Tue, 11 Jul 2023 09:15:04 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d3b7c04aee46.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 11 Jul 2023 09:15:04 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by DU0PR08MB8954.eurprd08.prod.outlook.com (2603:10a6:10:465::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul
 2023 09:15:01 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::eaec:5611:c427:57f7]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::eaec:5611:c427:57f7%4]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023
 09:15:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 716857a3-1fcb-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=btFhdzdGVwQJ4TZosIBJIEqkkmb25IwEuFAikTUp4P4=;
 b=Gr33cbi4g7qwzXYvC/+GKszNEJn/mZlIcNxkSyOLG3bBScl65e0p6aRE5puAWOtIXDA4+9kRp1C8CMiCDSA70RQEoCUN1qB9rycjkRtur9IkXfnUxsQq3NnJdqvWdl+IzZ45/e8eNwskQn5CaYOxP6ZBPzY9r4cA5aMfc6kAscc=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 44786e71955f96b3
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=bsPMYqMqwQHQ+CUU4w4mLd+dJuH/zi7dbDyN5NMrMbaBSVu0zPqlRQkIyxW4SPea5X4f8Dd1vKMgTEn+6rEYFV3JkjpoajrMwOpsPJN6sTZivRFOhCqDJ+fKSXqiuLskXixM5gL6dYet5ZAosZmzFtFoZpl6BAkcMXyuT2dIKfPfqS+grSra0pOoSUOX6muefx48GnFBAz5vOdXmm9mKcHIYrupN8g6BPKStwmI4H9vRWNVnStRbUcHMqwN0B/vY59MJpdiWtecsQa9Nz3nRypyoexUSx6sEN4+QpMBD+CuwIIERzD65awpP87kdnPJA/scT9G8sDzj+hXNZdvslRw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=btFhdzdGVwQJ4TZosIBJIEqkkmb25IwEuFAikTUp4P4=;
 b=FiP2v/zVYE5I3wQZY1vG7yJNdDiVfDksYD2JAHOdhG6u58egXMSmSM+uEnwBnKLZ1nrhttVrZv8qQ3kC9S19flmxPqSoGKedfdS2w2RK0KDBHpju3EZDbBFksyfISqb8JiU3/AQtdcJ75BBsyaMwOL73567JJOh/BJEeH6gSN3pZUuxXNoYyo3QG8FU//Si5Ywif5V15sG7bA7jotk1yTIRLGQRbF5bKAhldAitpjC3wAK4dlP582xLqAs3c3OaDbbtAVzH/pN7Rf945zBge7yomneJrCe70MJt0qxYuqJTDw59MUCAikU6J1NmGdvrYqsDPKtUZrOeWHoLAstqV1Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=btFhdzdGVwQJ4TZosIBJIEqkkmb25IwEuFAikTUp4P4=;
 b=Gr33cbi4g7qwzXYvC/+GKszNEJn/mZlIcNxkSyOLG3bBScl65e0p6aRE5puAWOtIXDA4+9kRp1C8CMiCDSA70RQEoCUN1qB9rycjkRtur9IkXfnUxsQq3NnJdqvWdl+IzZ45/e8eNwskQn5CaYOxP6ZBPzY9r4cA5aMfc6kAscc=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Michal Orzel <michal.orzel@amd.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH 1/2] xen/arm: Fix domain_handle_dtb_bootmodule() error
 path
Thread-Topic: [PATCH 1/2] xen/arm: Fix domain_handle_dtb_bootmodule() error
 path
Thread-Index: AQHZs9HrmE32Z8KSv0SIoy8VDf7goa+0SKYA
Date: Tue, 11 Jul 2023 09:15:01 +0000
Message-ID: <5B7AB94D-613C-4B78-938F-81F843A7101F@arm.com>
References: <20230711082931.5402-1-michal.orzel@amd.com>
 <20230711082931.5402-2-michal.orzel@amd.com>
In-Reply-To: <20230711082931.5402-2-michal.orzel@amd.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|DU0PR08MB8954:EE_|AM7EUR03FT040:EE_|AS8PR08MB6199:EE_
X-MS-Office365-Filtering-Correlation-Id: 57744546-b9a7-4e44-c9ec-08db81ef5421
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 5T5u/EQ8Lq5lW6Vk7kSNVWYyk+eBoQvKLy0diSs4wuwHlkHMSHNJpvA1nGMyg85KU/fHXBsmdeZyUwY2ar2FEAO3ZbdjIDYOXfyjXPk78F1WjxyUCpvwj+2R9aroMJRJY3mjyQayAZtGro3qqY1nI3xjKYK4W8bHS7xcHKuEHFW2iO25m5Y/TPxwV49DKDxYtxYntUtUy/0RZfRIWGsgD0FxUkNknrcIy74t5EvqYZZywyNwvCAYKDJwknOFKnYVEScQevWF6OIgnRHvZuLmqCvMSTRDYA8eI6wGl94jDwHejiZo0OQFte85OGNpoKpB2mwqu+6GY9ncXLQ/XIkZ4IgfL9e+lZx15HHCVfA88rmYAXwtQylPIWl/F/c0DlKpEoTtmuboK0eDeRcsE38GZMB/ywJHmmEhXotbrP4vvoshmu+WjpfILNQ28tTFBvxeI9QaaD1MByDQRnaZ7OPf9VXNykZ5if5mGVLcMPHn5FFuT92az3Vskwt4rf4Kt+MIgwzxJhNXOtp0eO7JPb29euhMFuL55te+oZWzrY0x5thOTNA+ugcgzqCYpYHkKs+Qtd/Y1D+p++/EjvJ1pRHdqzNKPD312OCvR4oVlvcNsMt8Efpfz94+ozwuOwgzR5xUOm2tEdDoITxYwCqvMJii7w==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(366004)(376002)(346002)(396003)(451199021)(76116006)(6486002)(478600001)(71200400001)(91956017)(54906003)(83380400001)(33656002)(36756003)(86362001)(38070700005)(2616005)(4744005)(2906002)(66946007)(186003)(6506007)(26005)(53546011)(6512007)(64756008)(122000001)(38100700002)(6916009)(8676002)(4326008)(316002)(5660300002)(41300700001)(66476007)(8936002)(66556008)(66446008)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <69C7656B976A7947A88501C0BDB9FD0F@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8954
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT040.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	aaff823c-4538-432a-a0de-08db81ef4e65
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	BXo5X3Z7ugpDtD77FFcTuDGqrZHdDUNlPtX7o8l2RIcG59hpRp3gNrzemlJbZdtRcVK/bD5Jhtnyqlr7BV96gaek4rUWC7f8a6Bfapux99x/3i4XOXN529GnbeJpSvm16rrFWq2A3dVZjaXdalRkf5sQsbHv2N8oYHTS5lZpwggku8Vvy6ay3jod00HF9BmHDZrPE+PrB4I2wCsAiGFaL4xPXkC64aOFuTvQKsU9ATqK/LuYtVq/P1XwadcthScjBSghODhf+6tRQf/0XezqXvd+1Pj85VZYtHk32F1nOPXASc/MmNhuOx1EwAAiuXr+VIfYMInK+3biDZPLzrpo0fuTz82Q71WBGag7fgfFzSqugD9EG3o0LaJuah2jpplI/oVnOk1EDMDPt9PvPvVkInfX5yXvA/sPm0AcPpjY4751vBy3DVzo51XhYOk03QUBFWovV1eXEPQoEopAaDQe34Xj3LZ8ZZ8qjBfagt3TIYzrnVdG+6PLVZyvJNalEZVNHg2cw/OOIvFdoRoRmhZC8NlsvygLMDxh98G5NNvjERJtOwITKBTwW4xPgPfrzBmx+fJVhtXeNDo/XoXJDfyr1HkT3j+5QFHxD6wktTwStKz4rU8jNQnxCOO4MpG1oSozFPuFjEPnrdW//cUyGWe5ZEIJXp/pVmNeKZeDkXPfTrBnnblkMVXYVxYZbEDNa1mgxAzL3DhF800BdK3crR+vCOfhm5EOoAiL06Esd0OV49Sn97zV7DuRLmnNdxL9XyMF
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(376002)(396003)(346002)(451199021)(46966006)(40470700004)(36840700001)(36860700001)(2616005)(4744005)(2906002)(47076005)(83380400001)(40460700003)(336012)(36756003)(33656002)(82310400005)(86362001)(356005)(82740400003)(81166007)(40480700001)(41300700001)(4326008)(6486002)(6512007)(316002)(5660300002)(107886003)(8676002)(8936002)(6862004)(478600001)(70206006)(70586007)(54906003)(186003)(53546011)(26005)(6506007);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 09:15:11.1099
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 57744546-b9a7-4e44-c9ec-08db81ef5421
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT040.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6199



> On 11 Jul 2023, at 09:29, Michal Orzel <michal.orzel@amd.com> wrote:
>=20
> Fix the error path in domain_handle_dtb_bootmodule(), so that the memory
> previously mapped is unmapped before returning the error code. This is
> because the function shall not make assumptions on the way of handling
> its error code in the callers. Today we call panic in case of domU
> creation failure, so having memory not unmapped is not a bug, but it can
> change.
>=20
> Similarly, fix prepare_dtb_domU() so that the memory allocated is freed
> before returning the error code from domain_handle_dtb_bootmodule().
>=20
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>

Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>




From xen-devel-bounces@lists.xenproject.org Tue Jul 11 09:20:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 09:20:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561640.878099 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9Y0-0002OK-Hm; Tue, 11 Jul 2023 09:20:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561640.878099; Tue, 11 Jul 2023 09:20:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9Y0-0002OD-F1; Tue, 11 Jul 2023 09:20:40 +0000
Received: by outflank-mailman (input) for mailman id 561640;
 Tue, 11 Jul 2023 09:20:38 +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
 <SRS0=pXgh=C5=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qJ9Xy-0002O4-Nq
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 09:20:38 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on2061c.outbound.protection.outlook.com
 [2a01:111:f400:fe13::61c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3192cfa6-1fcc-11ee-8611-37d641c3527e;
 Tue, 11 Jul 2023 11:20:36 +0200 (CEST)
Received: from DB7PR05CA0052.eurprd05.prod.outlook.com (2603:10a6:10:2e::29)
 by VE1PR08MB5584.eurprd08.prod.outlook.com (2603:10a6:800:1a4::10) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul
 2023 09:20:33 +0000
Received: from DBAEUR03FT062.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:2e:cafe::3e) by DB7PR05CA0052.outlook.office365.com
 (2603:10a6:10:2e::29) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32 via Frontend
 Transport; Tue, 11 Jul 2023 09:20:33 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT062.mail.protection.outlook.com (100.127.142.64) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.19 via Frontend Transport; Tue, 11 Jul 2023 09:20:32 +0000
Received: ("Tessian outbound f5de790fcf89:v145");
 Tue, 11 Jul 2023 09:20:32 +0000
Received: from 16eb10e1ceba.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 9F439925-1CDA-4B0F-A7BD-C5948D314B7E.1; 
 Tue, 11 Jul 2023 09:20:22 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 16eb10e1ceba.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 11 Jul 2023 09:20:22 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by GV1PR08MB8449.eurprd08.prod.outlook.com (2603:10a6:150:81::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.26; Tue, 11 Jul
 2023 09:20:11 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::eaec:5611:c427:57f7]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::eaec:5611:c427:57f7%4]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023
 09:20:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3192cfa6-1fcc-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+Xg82GYLftfnYo90G4mlxEZRxddvRh/BcVLFO9jcQr4=;
 b=urUW1Ra3KymW6JLR15gsZEpUKiGvwqrqiMuRH9SXkaKUyewSHRgFK0vAS348MABlRLY64S5BlR9VZIUKAnpOAakQ5NqhiCA4ndw72YCHCjs1Kq9MZ+HDMf/eIu1MTrx7ugkyhwCnv5VEAKDmttBEODhiyyY91+Tf+VG5U8LhiXA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: aae796f89b4a8226
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=IkVmjIQ1ptSSqMC3o7wTARKGYTd/LoFLhNX8TU+XPj+wy8tha6xsLw10eykp2yyi/qwgYzDTqn4BtOvm1bhNQdgTmqcUUrtwXdgJ/7AE8ME8EJN7ff1f+H5dqUtzYo5PpIp6McdrYZYTDUlTkV6pGs+m06OB8nnck33O8sVTcWprYKpR/A9X5+xweBB8L77eFMDi8gGaftBjq8CS6kkMl1DaskA+97CB8MTA5jDShOvMAYbs9qrr75NNkN0aMR2YpvxV7GufLpGEgQSX08zltDVRh11YvWo1+1cKj0ZqSowo5k+/+APgR/nJMynwPkWlIDcf3zvExuXEvDgvQi4t1w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+Xg82GYLftfnYo90G4mlxEZRxddvRh/BcVLFO9jcQr4=;
 b=eaOsXZiFBR1RwJNtxKFXmPn+0WOrpFnglk4wpUeORnfdadeXWUu65crwgsJ8hx4ompSRju4eJSd8bdhjVMLCg9elvoinNXjMAYzsU7w0XYdr9SwmbPmeaMJleJ6HQCgK9Bi9oF0GkEEgrFkNpikELdfnVux/OtYGPFn8JXQShzc8A0XO50ZaY9ZWUqISVcn82m3wIMMam/RLxcwUugwsGLC+Lb9TRa6OsivX24GYlHv8KFRRYRu3LnEjs76oo3nebX6uHhncItlS8+8XJo5AF/PRfIK0Tb5MF3ryUj91yUC/09AWqhUoCHYNAYaQTiIPcJjgL0kTm5mT2NCSGVKltQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+Xg82GYLftfnYo90G4mlxEZRxddvRh/BcVLFO9jcQr4=;
 b=urUW1Ra3KymW6JLR15gsZEpUKiGvwqrqiMuRH9SXkaKUyewSHRgFK0vAS348MABlRLY64S5BlR9VZIUKAnpOAakQ5NqhiCA4ndw72YCHCjs1Kq9MZ+HDMf/eIu1MTrx7ugkyhwCnv5VEAKDmttBEODhiyyY91+Tf+VG5U8LhiXA=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Michal Orzel <michal.orzel@amd.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH 2/2] xen/arm: Account for domU dtb bootmodule size
 separately
Thread-Topic: [PATCH 2/2] xen/arm: Account for domU dtb bootmodule size
 separately
Thread-Index: AQHZs9Hujc48aRyGZk6yzyef9j5Sia+0ShiA
Date: Tue, 11 Jul 2023 09:20:11 +0000
Message-ID: <FF0724DB-6975-469F-998C-A22D0990E7F4@arm.com>
References: <20230711082931.5402-1-michal.orzel@amd.com>
 <20230711082931.5402-3-michal.orzel@amd.com>
In-Reply-To: <20230711082931.5402-3-michal.orzel@amd.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|GV1PR08MB8449:EE_|DBAEUR03FT062:EE_|VE1PR08MB5584:EE_
X-MS-Office365-Filtering-Correlation-Id: 4b41694e-8da2-4251-c635-08db81f013e8
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 6gcDc5f2tLFuUKn784SKGS10dXr9nEpy00U+T6i6zrDg3Ctel/rAB7Qg+6NB0UIRHijA6MI0oNMCPR7LM34+qt/02eM+FmfsfkXzCLaRjX/cyhAuX8qgqV1beF91IpnAZ/U2APDCT50VPjE58S1m1pXgTwp6V1SkEBoDgSb+LQYvY8dVpR+GMPhfqFBC55nIIM8r3X73xL2YJSaf/70K0X17LaNCzYfBcVLMz9400rm/2PyC0N6FnwxBMwWYUgeM/UNOkrL513BqK+pWKV95GDGJOjnyHGb4pdqBx/nFza5kY4II5nyzxTvPQys8Vd5Ei/IeM3MjomrzXiqH4V2SHgB3n4/DowXw9aCVsK/dwMml0PGz9os22rnTS7/8fd2qZ+AScSWE7xXkAIeazDuhTZ9cNe2/pc6RcrBny4/ZkEsb3duJphSREi0a2sZ+kfLqiYMOmZAlyBvFsNFaIOHFfNvyKa3gej1I6bpbLTz7mCpUBU9W4HMNt1LJjONobWouJRlnV6eauZH5E2cfJ6BLYxm/gVZyr4J/iXVUv0GXckr1UWs8y84xh5T9jWMaDKSjUoh56eSbV/gInvtwkm/lYmvPTHA7OIB1T3R+z3In7jNad1ulp+lwXy+wtV+gGmPoXpXXqPquENCur5tW4cIKnw==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(396003)(346002)(366004)(376002)(451199021)(76116006)(6486002)(478600001)(54906003)(71200400001)(91956017)(2616005)(83380400001)(36756003)(86362001)(33656002)(38070700005)(15650500001)(4744005)(2906002)(66946007)(6506007)(186003)(53546011)(26005)(6512007)(66446008)(38100700002)(122000001)(66476007)(66556008)(316002)(41300700001)(4326008)(8936002)(8676002)(64756008)(5660300002)(6916009)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <C1AD5ACF7ED1EF4785E38F4CAA0C1871@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8449
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT062.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	bb68dae1-0a87-4b23-25dd-08db81f0074f
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	sRwltAwShH9a8toeWmhSGKh75yOijD5OVgSeqJD8S31wxAgl0j0mijjU6MJms9Vnc63rlyfH38QtBzzdCPM0Q39SMhVCQnHcUOSkXnY0DWPAiOs59LEatMheiF5akKsx98WztWE7kmHLUAyZcR5xEmA3x6PHlM9LzEPQ1URZjzHMwoszVAh5wlYZ7jKtarqEZrne28CgHsmeqncBspRvMdWlls72ALTKQ7CWCUntuY4mxubhvQ/4fVrwBhrAjRHKIvOnpS3Dye8SSCRmhqSk1ehk54VtATLHpjodngPZPCvtARJFaSP0K7CkOjgKkAyFquvzE30vkzn7ZBInIDcEDM6DGx/ZZkRp4DqrLr8tGsMnomnVrNYba1pyW3wh7+ahTVW4oOZ1f6NqjS5ezIodCRu8QaHdlaCZShdMDKtefjZMD19Ucw4vupX0WLIz2vZdbduftQkmke2L+69GhR7qXNmxZo5z6yqQitx5sQPOk2A5dBMOcjTmvMPpVbxIQxy/JwydBghi83uRk2L6lUk5CLDRROjVb+dtkt4HSUFbYsoe/HPIQDCxu+hpveeSpl1thaeHagO7Y9ZGN8hdwRYrv/gUpvPpiuB0ObKm6auKKk8PMuY3SVfIzRqAcT/VVC77RUiBn70yR1cVVZ5tai3ET+Ijg32Kx8/AfbAEJdtiDgPw7WWYCiMeCYrvAQWxH8+ZeEebw1pMSDoVppu3PlcuN53YR8OlEeGvFnQ+xl+BoSULVJ7TV4WjhygJsOB6G90C
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(376002)(39860400002)(136003)(451199021)(36840700001)(40470700004)(46966006)(54906003)(6486002)(478600001)(26005)(6506007)(336012)(53546011)(70586007)(6512007)(107886003)(186003)(70206006)(4744005)(2906002)(82310400005)(15650500001)(41300700001)(5660300002)(316002)(4326008)(8936002)(6862004)(81166007)(8676002)(82740400003)(356005)(33656002)(40460700003)(86362001)(36756003)(47076005)(36860700001)(83380400001)(40480700001)(2616005);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 09:20:32.9057
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 4b41694e-8da2-4251-c635-08db81f013e8
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT062.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5584



> On 11 Jul 2023, at 09:29, Michal Orzel <michal.orzel@amd.com> wrote:
>=20
> At the moment, we limit the allocation size when creating a domU dtb to
> 4KB, which is not enough when using a passthrough dtb with several nodes.
> Improve the handling by accounting for a dtb bootmodule (if present)
> size separately, while keeping 4KB for the Xen generated nodes (still
> plenty of space for new nodes). Also, cap the allocation size to 2MB,
> which is the max dtb size allowed.
>=20
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>

Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>




From xen-devel-bounces@lists.xenproject.org Tue Jul 11 09:22:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 09:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561646.878108 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9ZU-0002z6-Vz; Tue, 11 Jul 2023 09:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561646.878108; Tue, 11 Jul 2023 09:22:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9ZU-0002yz-TQ; Tue, 11 Jul 2023 09:22:12 +0000
Received: by outflank-mailman (input) for mailman id 561646;
 Tue, 11 Jul 2023 09:22:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=B4LE=C5=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJ9ZU-0002yt-BN
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 09:22:12 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20624.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::624])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 699204dd-1fcc-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 11:22:10 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS1PR04MB9405.eurprd04.prod.outlook.com (2603:10a6:20b:4db::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Tue, 11 Jul
 2023 09:22:08 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Tue, 11 Jul 2023
 09:22:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 699204dd-1fcc-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=f+iflW3Ob9NyYT8Zy7U7gaOJLHOGpNM9G8uXookoBxEtlCzxLB9uXmpSyBdn/vs5vgm30FuASg+88fx1XaEjjNpwjPximOOVRplFy367FaS2BbGx+5dTQmSVKC73ZrsOjLFYxmlIci0on6h/tLKFkGmC8rnSh1j4u6RS26OatMqGCZ6ZzKCT4bG5D1LQwAsqAXpIMF5bGNcfPV70fA+/9SuOwvxFANPL/9yUHSWC8faf5XiL0Oi3CgwBpoW3jEetSSMb95mJTqWAa1wpV7znTAJRsKIjqd73c+rVSlxpI7hgDHV9AEr1TluPCynvvNpEyM70uV5u64cbHLsRRJcMBQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=eneYnmw8OFnTcSt4TBJrewbBjJ8xuxAtO1SujSR2UCI=;
 b=fmHyHIylNCS8WBTKp+AXA+sra8M+dTz8vvI+XZ8nU2ST/9fPfB19WsD8JezMeoQSFY2uSU/9S30eknIknldenz8vCsDIiCEzn/ybhkub/pJkEIfYtOEIhDcIr+osVKtKlazFKK2Tga0iaHcaY0MQuQFsLccSCPjJWKEc59a3ppTlUmYbqsXIxJYKmQ3HzZJSv3kPnwxp53cCqK5v3wszYq1kMrD6M0IDJWEZYvnA78MKJ0hS8FnOaXZlwPTr1pSGK3txRf68eF69SyDKcnwASDVim3q4Z74rnGpU3XHWnbI6WAwoWkHvo+9TwPbMzZXr0A6kOHhgfgGNzIudqNXhmg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=eneYnmw8OFnTcSt4TBJrewbBjJ8xuxAtO1SujSR2UCI=;
 b=BUWmGo0OYlqy198H99sRvaQHmK5c6+sOSQaU1BQ//o7Dm+i6iSlbwrWH0SqInMOyIkYCZ6KUwZe/z7kt/Hxv98VertfId+HD0yzM6aIGy+6+tl5tBNnl/rquX9Hrxr09le57+6I3r/mXtuz+vWqv6vayXO/wEm1ixPg45dw0C85g9pVjJ/Oqoaa1C9e36+m+iXbi47WmocfeYTPr51KS0Xfhlv0RiknPwumxKetXqVcHiWubToP+B+ePOA52EJ+qIUoF9LioanQTJVDKV2pDXEfvOUHPxhz7gje8wvgI6PTMQaiG3EkNFqtJ0HAHbguxqtkyDolSX6GeAgpVGgqxQg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <a0833649-fa80-9cf4-26f1-152859fd57ba@suse.com>
Date: Tue, 11 Jul 2023 11:22:05 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2] docs/misra: add Rule 7.4 and 9.4
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: andrew.cooper3@citrix.com, roger.pau@citrix.com, julien@xen.org,
 george.dunlap@citrix.com, bertrand.marquis@arm.com,
 Stefano Stabellini <stefano.stabellini@amd.com>,
 xen-devel@lists.xenproject.org
References: <20230710202835.2052428-1-sstabellini@kernel.org>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230710202835.2052428-1-sstabellini@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0217.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ac::9) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS1PR04MB9405:EE_
X-MS-Office365-Filtering-Correlation-Id: 4ea5174a-3b58-452c-1584-08db81f04cba
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Yh3ErQcOCYSBwGQOeb2yVm3+rOU9yf/dbryNLO1laHigSvDdlau1bQfZIF4xyoYK7rRNPr0PYwavE+1FaeHCy9eksCRGDbAQC3kD89oXGGMWI5eXZNamuwAuqeoW7P/X+6taa8lnCmOyipoxnBII7d3Z8qS08PDMXdxLeyw7AbQylAyOpcmd59rX66OumwPboItCjYtiNIxYY1YssuuTU3V4VJ8QTVifOPWMPARmMKrI70v6DeUSL9R+pZ3JheDOoU7SaaOkCytCowhkmadbI1s7VpkEgkawkAGswM2JkKNO8Dh+NzyTXrOswYez6F0t1vlYBGWKolKGAUHJMeJvvkNhcIKJ3IgBAy1xgsFCONuKQaQGB/7NP9ezQY46+k2x2WmAqvwz5Uo3W+uCr1lkpxddE6G2ymNXenLiwk3/IJtM604A76r7nAdaGgIRZy0CKDGvniUhslRYO6mLsu/7X3ge6Z6OUGH3O0Fi2Rt/FQYm1d5DQ0UkOli0caWb2ItHyNIjJjABllxL800v5qrQz4RiTjaiy/B7dj1nLKz2cMki64XqeyYidUto0ADiViKLc+NTJo55qSG3vQ6tqwFFRuUh/0jYBFJCUgtJ7dKTIKldEP+CTuD9W4+KnZKaTpZnu1313kC02o4ej1hYfl2bwg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(376002)(136003)(39860400002)(346002)(366004)(451199021)(66946007)(66476007)(6916009)(66556008)(31696002)(2616005)(86362001)(316002)(6512007)(26005)(6506007)(53546011)(186003)(36756003)(38100700002)(4326008)(4744005)(6486002)(2906002)(8676002)(8936002)(6666004)(31686004)(5660300002)(83380400001)(478600001)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aE8wVEw3SXVkOHZZb3AyTlc2M21jakRGWUxJSGxsdStQV1crZTFqOFJtRVRW?=
 =?utf-8?B?T1c3VUYrN1BDTWMyUFN6QWhQcjFUdytqekxqRUROK2llRldxMDEwRU1KNUpE?=
 =?utf-8?B?NjdXWFIvWnpsalNOVXdZbGRTdm9GaDA2Mk9leXZKaGlUZXpGOEYrT2VwT1pS?=
 =?utf-8?B?eFdrQ3RJdEJyZEY5S2xoQVdnczZNSkR1WGtGMEJKdWdRSzVhdmxXNnBUY2lF?=
 =?utf-8?B?Z1FJblg4WDN6dFJ2Qlc5Y0w2N2I4QmZCeXdjdzhOREU1TVpJQmQ4M0VuWUlh?=
 =?utf-8?B?S3I3dFBBRFFjLzBvdU1Ub25ZcFVpRDFkaVZKZFBkcEp0Z1hja09SSWh1MFJW?=
 =?utf-8?B?U0Y3QllEL0JpYjF4MG4vZTJXRFhoSWh5eW1HdlJYdW1IMnR2NFppV01IZWt6?=
 =?utf-8?B?OU5aN0pvSlpDbG5OV3gxMTgyZWhWMmFSb1RTL3ZVbThQZ05ITmxmejFBdEZX?=
 =?utf-8?B?OXdkNFdlWkVWZERzYWQ2eW0xOHJCSktZOElyaHF5T3NYQmQ2cWhYWEJUQWVs?=
 =?utf-8?B?M0g4WWZwOFdsMklvM3E4RThydXlUSUllZFVURWtDcERvTHdjMHF5YlZjR0Q4?=
 =?utf-8?B?VnJlSFJxRWZDR09VZnNlcFV1ZXZHcFo0K0ZhUFJQc3NTTCtVYVBmUzJ2c2tW?=
 =?utf-8?B?eG54TklYOGZKL3Z5Q2VmZk5QeTdQVWlLRmhMa1hqOVJkbWl2akVEc3gxTU43?=
 =?utf-8?B?ekJoVHd1TkNkRUhiMlpF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lVRlBkWGlleTMzdVNEaWdT?=
 =?utf-8?B?dGx6ejdGVDFZV1hoZHFvZXcvTSs0cWZUVVgwc3RGcmFzREVaYUplaU5OdGNo?=
 =?utf-8?B?aTBhWUpMRHZZc25QVmU1UHNyMU5Zam94Z1RkNDRvcVVjUzVXays1Z3NsV1Av?=
 =?utf-8?B?ZS9PYjZoeW9PdlJ5aUx4cHdrWTM3REVKaXFLUHZKVExlZTNTSGJhdlBocnJU?=
 =?utf-8?B?Q2Y0UXdqbFN3RUZsNlZUOHVsbTJSQXM1MFBUMnB0eUJhTk1IUy95b1h3OFQy?=
 =?utf-8?B?c2ZRVVdrMXA5aDRHVy9teTVZWHVtR1B3UTVkS1JveUd3UTdsMFQ1UG42RUJX?=
 =?utf-8?B?UEpnU3hpTm1jL2xpdEtaZU85dkwxSm14UFM3LytxS1NSQ3JHK1YrVkkyeEhU?=
 =?utf-8?B?bkxGamFZN29SekFHcmFZQzE1NlJMVE1VK2FjbTVoY0dKZXg2TkpOVElXZ2ZK?=
 =?utf-8?B?RXQ4S1NueFJPa09FVEhsWDduMDlWMGVhS3FXT1hOL0dRM0oydGhtajE1T2xy?=
 =?utf-8?Q?d0Xbw4jS6Y1wQM4nEFa9Qx2PY?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4ea5174a-3b58-452c-1584-08db81f04cba
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 09:22:08.5247
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: rNxRAjDVSBhdJvW5VSq60bDsNJPwLpK2gvEUFKHhLIbPJrsvIpw/eNrIpbEEneDvnFqSTKSs9cJDVzBsnK6jWA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9405

On 10.07.2023 22:28, Stefano Stabellini wrote:
> From: Stefano Stabellini <stefano.stabellini@amd.com>
> 
> Rule 9.4 is non-controversial and we have no violations.
> 
> Rule 7.4 is considered a good idea with the caveat that assigning a
> string literal to const void is allowed. I added a note to specify it.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Tue Jul 11 09:24:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 09:24:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561650.878119 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9by-0003bV-DZ; Tue, 11 Jul 2023 09:24:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561650.878119; Tue, 11 Jul 2023 09:24:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9by-0003bO-AU; Tue, 11 Jul 2023 09:24:46 +0000
Received: by outflank-mailman (input) for mailman id 561650;
 Tue, 11 Jul 2023 09:24:45 +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
 <SRS0=rRYD=C5=citrix.com=prvs=54940d4e9=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qJ9bx-0003bI-Aa
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 09:24:45 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c387c023-1fcc-11ee-8611-37d641c3527e;
 Tue, 11 Jul 2023 11:24:42 +0200 (CEST)
Received: from mail-bn7nam10lp2104.outbound.protection.outlook.com (HELO
 NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.104])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 11 Jul 2023 05:24:39 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB5920.namprd03.prod.outlook.com (2603:10b6:a03:2d6::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul
 2023 09:24:37 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2%5]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023
 09:24:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c387c023-1fcc-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689067482;
  h=from:to:cc:subject:date:message-id:
   content-transfer-encoding:mime-version;
  bh=TJ2vuEfb9tAO1Ive6q9zAHTkikNNg5ee8eHipxfIPR8=;
  b=HQYYPJ/MI5D9ChB5GPh3ZPSOd1J7Z7GocqJBqMnMa4CFWuAML2Ssijuq
   9rIZYHEgHIT09eh1qqH1ZZgwbL8Wq2O23wQMRxuhxkvbBD/SYq1NztMIL
   AgncrhmOZEPBxMrq16KW3xhe6Z0tgEr9u5ABbBMXwRcwnpZxRsb6svpS9
   g=;
X-IronPort-RemoteIP: 104.47.70.104
X-IronPort-MID: 115682816
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:FOrXaqr4doLFkQz1cnsh9SujbcteBmI8ZBIvgKrLsJaIsI4StFCzt
 garIBnVO/mKN2XyLYh1bd7k8xkPuMPVnYQwHgFv+ypjRSgTpZuZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weBziBNVfrzGInqR5fGatgMdgKFb
 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo
 OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay
 RAXAGBWbSKDovyy+rGYbMRttPR6d9LNNpxK7xmMzRmBZRonabbqZvySoPV+g3I3jM0IGuvCb
 c0EbzYpdA7HfxBEJlYQDtQ5gfusgX78NTZfrTp5p4JuuzSVkFM3j+CraYKJEjCJbZw9ckKwv
 GXJ8n6/GhgHHNee1SCE4jSngeqncSbTAdtPSu3ipqc06LGV7n0CNR5NVkqEmueGp2ScfY5VN
 Fcx5gN7+MDe82TuFLERRSaQsHOC+xIRRddUO+k78x2WjLrZ5R6DAWoJRSIHb8Yp3OcpQRQ62
 1nPmMnmbRRtv6eSUmm17aqPoHW5Pi19EIMZTSoNTA9A6d+8pog210rLVow6SPLzicDpEzbtx
 TzMtDI5m7gYkc8M0eO84EzDhDWv4JPOS2bZ+znqY45s1SshDKbNWmBiwQGzASpoRGpBcmS8g
 Q==
IronPort-HdrOrdr: A9a23:TD+1aKHhPmK6U+NipLqEHseALOsnbusQ8zAXPiBKJCC9vPb5qy
 nOpoV86faQslwssR4b9uxoVJPvfZqYz+8W3WBzB8bEYOCFghrKEGgK1+KLrwEIWReOk9K1vZ
 0KT0EUMqyVMbEVt6fHCAnTKade/DGEmprY+9s3GR1WPHBXg6IL1XYINu6CeHcGPTWvnfACZe
 ehDswsnUvZRV0nKv6VK1MiROb5q9jChPvdEGI7705O0nj0sduwgoSKaSSl4g==
X-Talos-CUID: 9a23:3VmnaGNw+o45kO5DCHJkxk4xBMQfcV774XbiExbjEkBjV+jA
X-Talos-MUID: 9a23:OR9C6wiYfYNC+0bUY8IH/sMpJdZV4P+tGX82j6orkeuiaSZvIBKBpWHi
X-IronPort-AV: E=Sophos;i="6.01,196,1684814400"; 
   d="scan'208";a="115682816"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Mhge1MEJYkuCJ19p1H1FzDebXaZjdMLd7U/y3WvMsqsKc9VBu3rRdAaiBtyDaYiGP/yI9zXY2kTKz97O5FcTOqM96N5mIEXbG8HZ8NaBtwYSB3+U5Zeb+UHOl8kCXrzs3/a4HF5A2y3C4v5h1X6EeILw5v1QKXRAkN8X+geYXzDjL/2jJT2tM3VSMDGUwOOMqPdASRQAZPNr1mBVZUG1liyEF0vnnKC+6fZMeDji8YYoyh1uhUFlEgR07m/hBV4ffNSR5jWMB8FBfBJy6mKfM68gtC74yLIwA0u+Tw8n/q6n4naNPxxHJnCYlut39TRcHIZiIq9febZsv0uOAh9uxg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MxySi3AYc7WCYZJHKYBqiMjANBvcoeZT761nqseVDCY=;
 b=Y4bpWIWBrTOT55zlk+1dE/6Zgtvj5dVZZXs1L9Wm1dalqgTT8S8jn74lfIYwSyP32HjYeZkmI0nZyCL8qRbb5nsIf9yi1ujy/mtuj6a2+YU+UkNdIXph7V7tEt18gA8g+U38QKvmlCY58nbWqPpmz8d/dwlEBa65/B1TzE7BlymuYY1R+2xUitXOE77kFO+JQu+okQc797y3JwUfcobkIa64l5oJoySJpfuWa7lzYH2/q/XvPCRlJSWLrPYy0rm7eXhRk97gr38O50ElxSzrWVGy0IRsv+tzFdBy5WbZc9B+JoRuqCMv/mpGrliu4g3IKa7NLdPpF2IQ8ui8EAXvTg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MxySi3AYc7WCYZJHKYBqiMjANBvcoeZT761nqseVDCY=;
 b=bUjcdsD7jR7s1GmciRTCQKy3TdP520VDeVYzGfILMqLOdPvsS7yfiYnZsSqMhSUNfUgT5XND9x9WCMNYBsVSa8pYMWuR4/Enlch29+PQVTuwFcKqZAxaSlMGyNroXOEfv0rwWPqv+o9AfJV121BvBDKav6BooH3lnkASne62LUM=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v2 0/6] lib{xc,xl}: support for guest MSR features
Date: Tue, 11 Jul 2023 11:22:24 +0200
Message-ID: <20230711092230.15408-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0495.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1ab::14) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5920:EE_
X-MS-Office365-Filtering-Correlation-Id: ee4311af-481c-448f-075d-08db81f0a5a4
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	3akRgaS4AAfByyCZzhjt4CS51ZSWWiQPiZNDrb6i1eboAyRL2PCYQGPQQpBVWmaFrMAg/T/sBVENWoPtV2xI2AHvJRHzi+3898k6/wafeV7OTEt6D5x06ygAtYIZLYDrPL8y8EoRuuFxu1IsCRQ2SsRZvOcdtpmydodMiCqvDL6I/+S8nSfZCFn6F+aVyrcJWhBSA8c+3oRmi6L81NOIxTTDX1fa7UBbbAZTTK5yB9eCPiXrPrh0t7YWZjebcG/5Ptrg27VP5AeNlNE3A4h+9+rEcHU7YpcutkbHepQAVUVX64vxo/Nr1CxS64hkPPRvBM+MhoBU6pSTuSorQKoR+sLq6zTh6wfqEFGm6xqut1FVESbhvRV76gfq0uRVK1Kab/ohEFMuDbvlnBMIxYY8yuuswh4ClBM4hsw+xbrt9HTWQ1FwQGiU2GGKTWQ7azdk9qpjnwkfWwroHAPxY1sYQz04XpDJis5Xmjd+g5k81gyv1vynrxT71yxTSAlP5oStNG7q8qguHDWkaxa+hdc38Snpnbs/l/dRrwc6XBpwQYz1Jb+NmJQQyhwPYL3cgzw1
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(376002)(39860400002)(136003)(366004)(451199021)(54906003)(6486002)(6666004)(478600001)(26005)(6506007)(1076003)(6512007)(66946007)(186003)(2906002)(6916009)(66556008)(41300700001)(66476007)(5660300002)(316002)(4326008)(8936002)(8676002)(82960400001)(38100700002)(86362001)(36756003)(83380400001)(2616005);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aEFqeWVVV3lRaWtnSmdQMjN0YzVobyt1U3NKcC9pd082dVB5N0grVjdpa3N5?=
 =?utf-8?B?Vm1qdzA2cCtPK1hDbTFoMFBjWUVaYjVkZGZKUmZYbUQ4UEZMVGl4dTRxa0hB?=
 =?utf-8?B?TVZObWdKQ3E4elRFUWw3WjVlcXkwMTRVaFFxQnRUNzR6V21vUzRSTERDVzFI?=
 =?utf-8?B?OHhzQjl4ZXM1RUpVQXBIUENFTzVhbDFndW42Y1VHeEJ0Q2R1bURhbUVvdlRD?=
 =?utf-8?B?OTdnbUVSc091a0VsR1hhUDJXWU05SDljZThuczVJN0s1eEhCUGtCQW55U3gz?=
 =?utf-8?B?SjU1SkdsdVc1STRRczV1NHY1N21UczRObGZVbjNUSzFLa21CWVlVT2Q4cmN1?=
 =?utf-8?B?NGxTZ3NKWUZ0MDQrd0o3b3ZNeCtJbUhteHNvRVk4ZjBHa0I5aXpNeUhvS25h?=
 =?utf-8?B?ekR3bFN4dElxZGlnVW9mczdDbzRFdjNOcEYxaUtNV216VWI0Z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
	knTW3GObwH/xQyL/pGllyCjFDDTy7SQl/7QrJjB1+vTyzQ6ecaLQUnlqiDqZ81llxwHfaUt7Ncldujj/PC6Lfy4/oHHtzbwXSXmGIFgvlk+uPKD6IpPn/glKQlNr6yZ1WffOJ4yO+NSlkU+iVafglZG/zkvmJaKCarCV7iKjg5mBEnBBqtYoQ82urw49D1duJvm84ncUkSNpDPaUt+9QLTtCp0JON88Jyrd6GHvvRV6NgBCwo2yggXv48IugygWl8/k0sgBDmwosJK0AQlgpKb6cKtfB4Cs12FvMSP7OsmWYbwNlqMfXJXPSrgBBHQsV1ENl9GAFzmtBlZ6LjF/OclKz2jGe8B6AghoSrpvfF69TIfH04FxVx+JlUNftzM6Tsvzo1wvBn1Q1/pgGpkwGsO19koipdiqmr9UAkIA2aVh8X8x1z7yK16ua+/bqCJgWK9Mtx9qy6T6q7K/l3tZ0ZcaXNQM1DTSAgCB2rsHLZMBYNN6amtYzuucgtxbz5QAiWOaBXFT0QcqBPqVX3PgqCAE796hiAuPV0DuQaOBnYMjFC7BPUB44i6rpIY30IYJ1wy3zJu1v7DuJR7/ggZDKT521Xuk7i2/gTVyovt8YmkSn/57yW6+Zwkyy+Y9znqEF87hD+MciypgccU3hxrujkw8jEXx6cQRQSzfRJmoMXN/ZLjcSuzjx8dE2bOMU5LJLhX1XOx5v6fGGVvB/TKnnmpVHiYYYgkCfnZljFfz37yDov1x1yl8Tgq0XHhy7uiV3NFUoOUrZRcTtwsbWD1JDbFSqeBTTneDFUybGvBh7JMicg3i7inDoqv38Ga207DeD
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ee4311af-481c-448f-075d-08db81f0a5a4
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 09:24:37.5190
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: x/bFddXszMz/fH+rGEJg2rJc/ijXtrZMcE3kqUUzvvCfwYrqNAZ7oHRXLKasfyRpbxplrLeR57yU8JxmiugftA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5920

Hello,

The following series adds support for handling guest MSR features as
defined in arch-x86/cpufeatureset.h.

The end result is the user being able to use such features with the
xl.cfg(5) cpuid option.  This also involves adding support to all the
underlying layers, so both libxl and libxc also get new functionality in
order to properly parse those.

Thanks, Roger.

Roger Pau Monne (6):
  libs/guest: introduce support for setting guest MSRs
  libxl: change the type of libxl_cpuid_policy_list
  libxl: introduce MSR data in libxl_cpuid_policy
  libxl: split logic to parse user provided CPUID features
  libxl: use the cpuid feature names from cpufeatureset.h
  libxl: add support for parsing MSR features

 docs/man/xl.cfg.5.pod.in          |  24 +-
 tools/include/libxl.h             |   8 +-
 tools/include/xenctrl.h           |  21 +-
 tools/libs/guest/xg_cpuid_x86.c   | 168 +++++++++-
 tools/libs/light/libxl_cpuid.c    | 527 ++++++++++++++++--------------
 tools/libs/light/libxl_internal.h |   5 +
 tools/xl/xl_parse.c               |   3 +
 7 files changed, 479 insertions(+), 277 deletions(-)

-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 11 09:25:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 09:25:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561652.878135 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9c8-0003wz-VS; Tue, 11 Jul 2023 09:24:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561652.878135; Tue, 11 Jul 2023 09:24:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9c8-0003wA-R4; Tue, 11 Jul 2023 09:24:56 +0000
Received: by outflank-mailman (input) for mailman id 561652;
 Tue, 11 Jul 2023 09:24:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=rRYD=C5=citrix.com=prvs=54940d4e9=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qJ9c7-0003sM-Iu
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 09:24:55 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cb0617a5-1fcc-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 11:24:53 +0200 (CEST)
Received: from mail-mw2nam10lp2104.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.104])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 11 Jul 2023 05:24:50 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB5920.namprd03.prod.outlook.com (2603:10b6:a03:2d6::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul
 2023 09:24:48 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2%5]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023
 09:24:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cb0617a5-1fcc-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689067494;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=VKmbY/AfEIQ8x2rbtfbq3gFHjE/7qQyOIwEMp8b6cTM=;
  b=NXPjKEVAMCB72GbOYi0TxDpgR7t2fDWvr5H6Pl/nALVoIKmBEse4LYfu
   SAapkesRp1b4jGrGadVLOWpD5VLXUfp+uTWjBnAuYOAEz5MxAo4NgNUtU
   6uMa8Md0D/4jaoLMPGtpkLT2u7QaNk/p2IAj19DNOM8KVjh5WZSxaeEFp
   s=;
X-IronPort-RemoteIP: 104.47.55.104
X-IronPort-MID: 115102749
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:CPu5EKr/Q0cqE5sPvH1Zbumf5l5eBmI8ZBIvgKrLsJaIsI4StFCzt
 garIBmCPveMYDenKdhxYN/k9ENUusXUz95kGQo5qClgQnhDpZuZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 NL2sqX3NUSsnjV5KQr40YrawP9UlKq04Gp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X-IronPort-AV: E=Sophos;i="6.01,196,1684814400"; 
   d="scan'208";a="115102749"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=DERKzIAU5+7kwWP0nDi9nhAfUGq+49P5GrJ7uSCu4flEz7xuNgUIhKwA1QvHFZGbzpwXyIN/Tsq1XoOxPmR5KvJAuEqYgX9mcwwmVJBfQLV6TMZgjmZQl+z7MqhrS8KckfI9oMKyczl8NWdv444aj2VMg/1/vuR+tgVMXoWSDQkcyj6vlN62atgWfO7CI83l3feJvlnmOqwbN24yreWiDIrTJMttry04E67xgXfsp6IJlEOBB0av20qRh26F0JOsYcBgPEMqcjLjui6mAW9SNi/3kGwloecRYuLz/DEq5pNMAyQkqDo27tCdNtBpCouxoiKbbAlhwfNM7/wUW2yVbA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=cR4uH4w+OQdrCDXWnd3VMjBEW6KojALchWf8cN+0MNs=;
 b=f3MKofGUseIErO/s5ntEswZwH9QmRpsiEx2EkeIgrG7lOzqxWm4rUoIX0E/wxK/wqVr8LxjQaI/SI5PH0DAgJ+U35L//Y+obJFlpnzY/Dat3bkQo8gA53UH1Z4C0maYFjDM2lYzSnzB2vXs39KwkCUaWIzEHqxkuj7y7Ua7zV//6SlCm2+fwIHO7PnP6cXm4khrc5EzQ46byRQu/FJ72ghtdgnCVlDa47EKxQ6p6AZWis8/E63CTkYDow5TTi1DlvFiBp0AEJXLQg3h0poDSF7NI13x3CG9JmtX4wZmGJ7tmM+kzMnR4ZQmPeilQEvY3FPan2bLbQXQP/Sx6Kt1HhA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=cR4uH4w+OQdrCDXWnd3VMjBEW6KojALchWf8cN+0MNs=;
 b=LhFtiKruTqptiV5+oY53aJUQyU0rTLlHyma5d6wna0/hCpkIay7bSyioGPYhrRAPYSaWpSALIGxDLUL+eg+9wdEXHSmpSD+XUeZAJ3g8zg7BDKwCFfGokqSyc35mX5A3EbmPipoU91JZwuKDGBdBrGPFQVWacc7ywrgzHT3fZ24=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v2 2/6] libxl: change the type of libxl_cpuid_policy_list
Date: Tue, 11 Jul 2023 11:22:26 +0200
Message-ID: <20230711092230.15408-3-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230711092230.15408-1-roger.pau@citrix.com>
References: <20230711092230.15408-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LNXP265CA0054.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:5d::18) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5920:EE_
X-MS-Office365-Filtering-Correlation-Id: 6411ae18-4c03-4c04-a4b8-08db81f0ac47
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	rA/hB5qA56df9qRQA2HnaLU0CNC+q7pF6duZWNtI0ALR7DVawnn6na4fv/aY3dNSZWqYVLAZfTrpmHFmj/EMSjzZDqLyxrBvoiNhZxWDnC9/QzanGy/ESwiR8yXvy0YRLvwRtHiywUqPSYnA3/e2awoM3laysa0pX9hsDTggCFH5F/GhbuEiHbzIiA4pXa68AUeZbKSLZsf6hcrk4UeTq4WALAU4Vt9TwJ2IZdAS/BQnpQqj0agndHcN1vXBLYsJMYJ2ksNQtJKB0XqTwxg/TfLc+Y8eInGbGjmsH+9c0V7QAgcf4qJ9ZRHSO1kMjizJLYxji47Dizx+dXtjNzubTx19Ind/s5/xiuJQcXDlmoYR2wgnmpITEzOveqIarQpdFP70+0swM0hNeIgSN1gDJCBf5nFkyDPRwp4255wQCsWU+ODP3ngNbr/QvAQ+24JI4NLbOiDF7Fle87hfAzzMDTw5nI+1qv3bggXQzwa+U7ieVeMIocLWwtTljfdmlg7mTXxc0vOZ0MZ3ATr1duxxzqweTzG2QYwV5fbUL0ayJckGBeOUVLC3CTenUZ56WCjc
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(376002)(39860400002)(136003)(366004)(451199021)(54906003)(6486002)(6666004)(478600001)(26005)(6506007)(1076003)(6512007)(66946007)(186003)(2906002)(6916009)(66556008)(41300700001)(66476007)(5660300002)(316002)(4326008)(8936002)(8676002)(82960400001)(38100700002)(86362001)(36756003)(83380400001)(2616005);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?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Pi2zoLIdTM0q5wOa1f7BJ/makExx5MJGiYHYGG+3V+4h/0kLRyxVwCY++B0/r0HZ3B68T/LqlMtt8mpopfMK4m3sfVKV97W32weTMxz6XRvEvd2PLdfFEr+/IZS2Z9WNbiWSL9t06ClvDHG3FcHxu3+LV1VLoSdlni6gtbWCBpSumEUJKK96d7hkANQ1DgCQuji1/SYVCzBXpiMzt7ahMlNUOtuPhmRUfwb8nn5srsSpEicHOMhTks6fF2Dff0CJdjo8Mkzlp5qX6GoM2s88AyUMXrTDDXpnWklYtrtAXluzORUVGP1qA2GYuedaqMom21tbulqxUvqzTMJr3+BUMQ5M4mDU7FY/u4G5p6/SuSBzz6MbxRcD275NR
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6411ae18-4c03-4c04-a4b8-08db81f0ac47
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 09:24:48.8299
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 7EsrjNE+JJGORscdvlCzaIscX8B0aPGLV9IJ7/EirMr0r8No0WFBsGGOcn/YbAqdzk6edTlkOjZYPP84QzJ06A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5920

Currently libxl_cpuid_policy_list is an opaque type to the users of
libxl, and internally it's an array of xc_xend_cpuid objects.

Change the type to instead be a structure that contains one array for
CPUID policies, in preparation for it also holding another array for
MSR policies.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
 tools/include/libxl.h             |  8 +--
 tools/libs/light/libxl_cpuid.c    | 89 ++++++++++++++++++++-----------
 tools/libs/light/libxl_internal.h |  4 ++
 3 files changed, 65 insertions(+), 36 deletions(-)

diff --git a/tools/include/libxl.h b/tools/include/libxl.h
index cac641a7eba2..f3975ecc021f 100644
--- a/tools/include/libxl.h
+++ b/tools/include/libxl.h
@@ -1455,12 +1455,8 @@ typedef struct {
 void libxl_bitmap_init(libxl_bitmap *map);
 void libxl_bitmap_dispose(libxl_bitmap *map);
 
-/*
- * libxl_cpuid_policy is opaque in the libxl ABI.  Users of both libxl and
- * libxc may not make assumptions about xc_xend_cpuid.
- */
-typedef struct xc_xend_cpuid libxl_cpuid_policy;
-typedef libxl_cpuid_policy * libxl_cpuid_policy_list;
+struct libxl__cpu_policy;
+typedef struct libxl__cpu_policy *libxl_cpuid_policy_list;
 void libxl_cpuid_dispose(libxl_cpuid_policy_list *cpuid_list);
 int libxl_cpuid_policy_list_length(const libxl_cpuid_policy_list *l);
 void libxl_cpuid_policy_list_copy(libxl_ctx *ctx,
diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index c96aeb3bce46..724cb4f182d4 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -19,22 +19,29 @@ int libxl__cpuid_policy_is_empty(libxl_cpuid_policy_list *pl)
     return !libxl_cpuid_policy_list_length(pl);
 }
 
-void libxl_cpuid_dispose(libxl_cpuid_policy_list *p_cpuid_list)
+void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl)
 {
-    int i, j;
-    libxl_cpuid_policy_list cpuid_list = *p_cpuid_list;
+    libxl_cpuid_policy_list policy = *pl;
 
-    if (cpuid_list == NULL)
+    if (policy == NULL)
         return;
-    for (i = 0; cpuid_list[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
-        for (j = 0; j < 4; j++)
-            if (cpuid_list[i].policy[j] != NULL) {
-                free(cpuid_list[i].policy[j]);
-                cpuid_list[i].policy[j] = NULL;
-            }
+
+    if (policy->cpuid) {
+        unsigned int i, j;
+        struct xc_xend_cpuid *cpuid_list = policy->cpuid;
+
+        for (i = 0; cpuid_list[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
+            for (j = 0; j < 4; j++)
+                if (cpuid_list[i].policy[j] != NULL) {
+                    free(cpuid_list[i].policy[j]);
+                    cpuid_list[i].policy[j] = NULL;
+                }
+        }
+        free(policy->cpuid);
     }
-    free(cpuid_list);
-    *p_cpuid_list = NULL;
+
+    free(policy);
+    *pl = NULL;
     return;
 }
 
@@ -62,11 +69,17 @@ struct cpuid_flags {
 /* go through the dynamic array finding the entry for a specified leaf.
  * if no entry exists, allocate one and return that.
  */
-static libxl_cpuid_policy_list cpuid_find_match(libxl_cpuid_policy_list *list,
-                                          uint32_t leaf, uint32_t subleaf)
+static struct xc_xend_cpuid *cpuid_find_match(libxl_cpuid_policy_list *pl,
+                                              uint32_t leaf, uint32_t subleaf)
 {
+    libxl_cpuid_policy_list policy = *pl;
+    struct xc_xend_cpuid **list;
     int i = 0;
 
+    if (policy == NULL)
+        policy = *pl = calloc(1, sizeof(*policy));
+
+    list = &policy->cpuid;
     if (*list != NULL) {
         for (i = 0; (*list)[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
             if ((*list)[i].input[0] == leaf && (*list)[i].input[1] == subleaf)
@@ -86,7 +99,7 @@ static libxl_cpuid_policy_list cpuid_find_match(libxl_cpuid_policy_list *list,
  * Will overwrite earlier entries and thus can be called multiple
  * times.
  */
-int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
+int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
 {
 #define NA XEN_CPUID_INPUT_UNUSED
     static const struct cpuid_flags cpuid_flags[] = {
@@ -345,7 +358,7 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
     if (flag->name == NULL) {
         return 2;
     }
-    entry = cpuid_find_match(cpuid, flag->leaf, flag->subleaf);
+    entry = cpuid_find_match(policy, flag->leaf, flag->subleaf);
     resstr = entry->policy[flag->reg - 1];
     num = strtoull(val, &endptr, 0);
     flags[flag->length] = 0;
@@ -400,7 +413,7 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
  * the strings for each register were directly exposed to the user.
  * Used for maintaining compatibility with older config files
  */
-int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *cpuid,
+int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *policy,
                                   const char* str)
 {
     char *endptr;
@@ -427,7 +440,7 @@ int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *cpuid,
         return 3;
     }
     str = endptr + 1;
-    entry = cpuid_find_match(cpuid, leaf, subleaf);
+    entry = cpuid_find_match(policy, leaf, subleaf);
     for (str = endptr + 1; *str != 0;) {
         if (str[0] != 'e' || str[2] != 'x') {
             return 4;
@@ -502,7 +515,8 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
             info->tsc_mode == LIBXL_TSC_MODE_ALWAYS_EMULATE);
 
     r = xc_cpuid_apply_policy(ctx->xch, domid, restore, NULL, 0,
-                              pae, itsc, nested_virt, info->cpuid, NULL);
+                              pae, itsc, nested_virt,
+                              info->cpuid ? info->cpuid->cpuid : NULL, NULL);
     if (r)
         LOGEVD(ERROR, -r, domid, "Failed to apply CPUID policy");
 
@@ -527,15 +541,19 @@ static const char *policy_names[4] = { "eax", "ebx", "ecx", "edx" };
  */
 
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
-                                libxl_cpuid_policy_list *pcpuid)
+                                libxl_cpuid_policy_list *pl)
 {
-    libxl_cpuid_policy_list cpuid = *pcpuid;
+    libxl_cpuid_policy_list policy = *pl;
+    struct xc_xend_cpuid *cpuid;
     yajl_gen_status s;
     int i, j;
 
+    if (policy == NULL) goto empty;
+
     s = yajl_gen_array_open(hand);
     if (s != yajl_gen_status_ok) goto out;
 
+    cpuid = policy->cpuid;
     if (cpuid == NULL) goto empty;
 
     for (i = 0; cpuid[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
@@ -575,7 +593,7 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
                                         libxl_cpuid_policy_list *p)
 {
     int i, size;
-    libxl_cpuid_policy_list l;
+    struct xc_xend_cpuid *l;
     flexarray_t *array;
 
     if (!libxl__json_object_is_array(o))
@@ -586,8 +604,10 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
         return 0;
 
     size = array->count;
+    *p = libxl__calloc(NOGC, 1, sizeof(*p));
     /* need one extra slot as sentinel */
-    l = *p = libxl__calloc(NOGC, size + 1, sizeof(libxl_cpuid_policy));
+    l = (*p)->cpuid = libxl__calloc(NOGC, size + 1,
+                                    sizeof(struct xc_xend_cpuid));
 
     l[size].input[0] = XEN_CPUID_INPUT_UNUSED;
     l[size].input[1] = XEN_CPUID_INPUT_UNUSED;
@@ -630,8 +650,12 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
 int libxl_cpuid_policy_list_length(const libxl_cpuid_policy_list *pl)
 {
     int i = 0;
-    libxl_cpuid_policy_list l = *pl;
+    const struct xc_xend_cpuid *l;
+
+    if (*pl == NULL)
+        return 0;
 
+    l = (*pl)->cpuid;
     if (l) {
         while (l[i].input[0] != XEN_CPUID_INPUT_UNUSED)
             i++;
@@ -641,20 +665,25 @@ int libxl_cpuid_policy_list_length(const libxl_cpuid_policy_list *pl)
 }
 
 void libxl_cpuid_policy_list_copy(libxl_ctx *ctx,
-                                  libxl_cpuid_policy_list *dst,
-                                  const libxl_cpuid_policy_list *src)
+                                  libxl_cpuid_policy_list *pdst,
+                                  const libxl_cpuid_policy_list *psrc)
 {
+    struct xc_xend_cpuid **dst;
+    struct xc_xend_cpuid *const *src;
     GC_INIT(ctx);
     int i, j, len;
 
-    if (*src == NULL) {
-        *dst = NULL;
+    if (*psrc == NULL || (*psrc)->cpuid == NULL) {
+        *pdst = NULL;
         goto out;
     }
 
-    len = libxl_cpuid_policy_list_length(src);
+    *pdst = libxl__calloc(NOGC, 1, sizeof(**pdst));
+    dst = &(*pdst)->cpuid;
+    src = &(*psrc)->cpuid;
+    len = libxl_cpuid_policy_list_length(psrc);
     /* one extra slot for sentinel */
-    *dst = libxl__calloc(NOGC, len + 1, sizeof(libxl_cpuid_policy));
+    *dst = libxl__calloc(NOGC, len + 1, sizeof(struct xc_xend_cpuid));
     (*dst)[len].input[0] = XEN_CPUID_INPUT_UNUSED;
     (*dst)[len].input[1] = XEN_CPUID_INPUT_UNUSED;
 
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index 1cf3d400bfce..ef882cff3912 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -4869,6 +4869,10 @@ int libxl__setresuid(uid_t ruid, uid_t euid, uid_t suid);
 _hidden int libxl__domain_set_paging_mempool_size(
     libxl__gc *gc, libxl_domain_config *d_config, uint32_t domid);
 
+struct libxl__cpu_policy {
+    struct xc_xend_cpuid *cpuid;
+};
+
 #endif
 
 /*
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 11 09:25:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 09:25:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561651.878129 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9c8-0003tK-LW; Tue, 11 Jul 2023 09:24:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561651.878129; Tue, 11 Jul 2023 09:24:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9c8-0003t8-Ie; Tue, 11 Jul 2023 09:24:56 +0000
Received: by outflank-mailman (input) for mailman id 561651;
 Tue, 11 Jul 2023 09:24:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=rRYD=C5=citrix.com=prvs=54940d4e9=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qJ9c6-0003sM-TD
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 09:24:55 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c953b4e2-1fcc-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 11:24:52 +0200 (CEST)
Received: from mail-mw2nam10lp2100.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.100])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 11 Jul 2023 05:24:46 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB5920.namprd03.prod.outlook.com (2603:10b6:a03:2d6::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul
 2023 09:24:43 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2%5]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023
 09:24:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c953b4e2-1fcc-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689067492;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=2zFSU1NQw4rgon58Pm5xe6yK2q9FL3yuwXrnL/1XCis=;
  b=M2Tkxq0eB/WXGc8sW4P22hWFOMY3nqgbCQTvpenIywr6PaWMDwo8mPxC
   YQYcFrYuTqUCZiNrbEvt6TAB2MXce88tOj0gW+k8SwW/E0VRyMn4LmwxE
   Q1vz0ustyUm4W0JOyPywbkxsfCp9gzFVebhQCMe3OGnJJcuWi0ZEmyJ23
   c=;
X-IronPort-RemoteIP: 104.47.55.100
X-IronPort-MID: 115102737
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:K+OHratb5/WhONSHINQUDpcIYufnVHJfMUV32f8akzHdYApBsoF/q
 tZmKTuDM/yKYmfze4h/b4vn8h4Bv57Sz4NrGVc5/3xhFy8R+JbJXdiXEBz9bniYRiHhoOCLz
 O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQqIu
 Nfjy+XSI1bg0DNvWo4uw/vrRChH4rKq4Vv0gnRkPaoQ5ACHziFMZH4iDfrZw0XQE9E88tGSH
 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9
 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG
 fMwBQI8aky41v6P/7OhTMJvtPYYLNXXBdZK0p1g5Wmx4fcOZ7nmGv2PwOACmTA6i4ZJAOrUY
 NcfZXx3dhPcbhZTO1ARTpUjgOOvgXq5eDpdwL6XjfNvvy6Pk0osjf60aIK9lt+iHK25mm6Co
 W3L5SLhCwwyP92D0zuVtHmrg4cjmAuiAd9LTOfnraECbFu7/UBPVkJRFkCBhLqphF6DUNtce
 1Uqw397xUQ13AnxJjXnZDWorXjBshMCVt54F+wh9BrL2qfS+xyeBGUPUnhGctNOnNAybSwn0
 BmOhdyBLT5gqrqOUlqG66yZ6zi1PEAowXQqYCYFSU4A/IPlqYRq1hbXFI87SOiyk8H/Hiz2z
 3aSti8iir4PjMkNkaKm4VTAhDHqrZ/MJuIo2jjqsquexlsRTOaYi0aAsDA3Md4owF6lc2S8
IronPort-HdrOrdr: A9a23:nOu3Hapr9mINGcOHHOIUrJ0aV5oReYIsimQD101hICG9JPbo8P
 xG+85rtiMc6QxwZJhOo7u90cW7K080lqQV3WByB9iftVLdyQ+VxehZhOPfKlvbdhEWndQy6U
 4PScRD4HKbNykdsS5XijPIcerJYbO8gcWVuds=
X-Talos-CUID: 9a23:x/qSQWzN/qUMwajPHLeqBgU5KPEhLkaM0E7vIlW+ImVbeoaVVWOprfY=
X-Talos-MUID: 9a23:BNlR5wbIL1IWoeBTjBOw2m4ld9xSxue+BlAwmpwF69C6DHkl
X-IronPort-AV: E=Sophos;i="6.01,196,1684814400"; 
   d="scan'208";a="115102737"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=lcDb6quwfOHhdQ0scFD6XCzWRFoLrSYV8QN7s2Nu44SoWB1AYrTA80iRk1IP9LeJhyKVMvZO6DYGblUp7o16WRJR4DIiN/FFHcsIJ9tdP5uTpR2YPqGV1o0BNDzjmv/4UcMaudPdTbqpqMVcdV89PUoh8zARmruWTIAouynI1OQXvK09hrPfw9kbTFUa0lTYpqOopEWfJNXwQhOgnSCqUkOcPbYhArSCACy0D8LLk9SKipSc2qxonHQzQk8FLKAsbOvW+S0xYUk2nCoroCd+K2GgJmP+pMANVxcjVGhXvJyw6Do7+/zajgDygjYRgadKO6lERV8Brp1z/CF5fmMyJg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=jRL0W8aP44by/dndi4GGpftsE4Jc9SeBVmoFs1PldXY=;
 b=Wr7C7D/6tMPEeOKS/OdK803ypTQDor88I81a+KK/o7RY1NXMiNSKr2gLGT6uEIpRwWMHyYERiHlYb2DD0x3GgZu4bcywXYHEI+kZIZWA/cvysgVti8KJAwA2SiW/Kdnbzgv9e9wM3u+m0D8UtFLaxqIRtxrptFhXV18wnvTuXD0V8u4weDToRJtrSW+wQuOOkkbGtvfrTUTFsN1Bpy9wKekaI+TvK3kC27xl7MmJ6c9nzUfLnz/mvW0OiGRBm5v7/jNaWJ0BVHxrRBRCVLB9XxEgbkhIx2El6Mr61PXzcJG4uM8DdgswqmdROLosBqs7t5xsDFA8h3uOxZRwk5tulg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=jRL0W8aP44by/dndi4GGpftsE4Jc9SeBVmoFs1PldXY=;
 b=auSghe+nd01hCKif3cAhNWyP9ZiMF0YWwuabA8AV55GrcrAKK3h/9nW4nkQ3JWol2bF7igw6wYdrDKW3pSr/Dk3s0GnzF/z6qGuY5UeAHL8u1velADvcONjcC2wHzm7DUgNjp1lSZLlTFky5sZGOKkMhfNDyQWqY/WBnt6PAWLc=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v2 1/6] libs/guest: introduce support for setting guest MSRs
Date: Tue, 11 Jul 2023 11:22:25 +0200
Message-ID: <20230711092230.15408-2-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230711092230.15408-1-roger.pau@citrix.com>
References: <20230711092230.15408-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0583.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:276::13) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5920:EE_
X-MS-Office365-Filtering-Correlation-Id: 3c9e8d34-5108-41d8-2cd5-08db81f0a91d
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	m7sWODGmuyAyrBI+qCnQhoLMMsS5/ULJk9z3KqzS/fZtLsXWEcYKRnLrHf3C/7rgpNQ/cnZy6fEp4rAkrM7lzKp2KPIPVxN3EQjHtXZ0V3NmiQ2oHA1KcCfDBWs3/sjRqbld3gyIEiH+JUC1fBuHTYZ0AA0QpU7SllhdQXDwZuhdlaysZ3iLbpywQd4WdXYlCLckeMoiV0HL6HAwIYBM4dPORpEKjkwWsQA1lv3SC6beZryn8ChJrOSiFZB5YzOJSzaGJ1s+ShzMct3P9mkla3aomjKUxgxMkz5+kiCVke3dJc9giNGAxqLIY7Mlle9zdMoAr7r4zVV69I1XEQRgXt2ucD4q2i630q5/l4xDcPtBgWkEFM4WvaxRiWBA6f+xfCXMsuDpYeF9yTPmlfxKJXUN5TMBZJC3qFGtHNvXnZoTp+limEp1a6+09ctVoEC+a90tg8tgooNWRCdQKHdwYufvznxqYnlLyZe7AJUjBsJujVGu8BbZtxWwp79VGgH4kyK/dXXSkwfUdI6IuhcQCMv2J8fm3ZnlvvJXA4ve2dgxVkOWPxLWZt/oNciscyrn
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(376002)(39860400002)(136003)(366004)(451199021)(54906003)(6486002)(6666004)(478600001)(26005)(6506007)(1076003)(6512007)(66946007)(186003)(2906002)(6916009)(66556008)(41300700001)(66476007)(5660300002)(316002)(4326008)(8936002)(8676002)(82960400001)(38100700002)(86362001)(36756003)(83380400001)(2616005);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aktVaFIxd1NSaThSK1NkMHNsVDlJeStFVkZndGJSOEhDOXR2VkVldWc4NCts?=
 =?utf-8?B?bVFsbjdGcVZRbW5EeDdUL2JScXBoYWtNRThkOHFpMGwzVktCWmZBL3ByVHVL?=
 =?utf-8?B?eFVMa09EQS8rMDZKK3dSV2lwN2JGdWx6ZHdHRUduaEFOelN3OWRpNW1tRW95?=
 =?utf-8?B?ZXh3RVB5Ym81eXV1RDVYRnRZR2UrbEQzUjNQMXpzNnhLbk0xbk9wVituOGhz?=
 =?utf-8?B?NS8xaVgzQUtjNStSZVI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Lr1VjD9HdwPx93O5+2QU+VxbRRV2Kkw+GIEs/QR5l33DVLWY28gyp3317/P8o5ddCEqTaqYECwQP/ghk1YNsJcYs
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3c9e8d34-5108-41d8-2cd5-08db81f0a91d
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 09:24:43.4983
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 40qMHV5O72IwD+B6bOpV+id0VvT3LbEIil7uacVmxuwZ/AFWNKBXEvmUuqlM/k4hrloYsBh9FkAqFnH1vOd6mQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5920

Like it's done with CPUID, introduce support for passing MSR values to
xc_cpuid_apply_policy().  The chosen format for expressing MSR policy
data matches the current one used for CPUID.  Note that existing
callers of xc_cpuid_apply_policy() can pass NULL as the value for the
newly introduced 'msr' parameter in order to preserve the same
functionality, and in fact that's done in libxl on this patch.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
 tools/include/xenctrl.h         |  21 +++-
 tools/libs/guest/xg_cpuid_x86.c | 168 +++++++++++++++++++++++++++++++-
 tools/libs/light/libxl_cpuid.c  |   2 +-
 3 files changed, 187 insertions(+), 4 deletions(-)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index dba33d5d0f39..faec1dd82453 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1822,6 +1822,21 @@ struct xc_xend_cpuid {
     char *policy[4];
 };
 
+/*
+ * MSR policy data.
+ *
+ * The format of the policy string is the following:
+ *   '1' -> force to 1
+ *   '0' -> force to 0
+ *   'x' -> we don't care (use default)
+ *   'k' -> pass through host value
+ */
+struct xc_msr {
+    uint32_t index;
+    char policy[65];
+};
+#define XC_MSR_INPUT_UNUSED 0xffffffffu
+
 /*
  * Make adjustments to the CPUID settings for a domain.
  *
@@ -1833,13 +1848,15 @@ struct xc_xend_cpuid {
  * Either pass a full new @featureset (and @nr_features), or adjust individual
  * features (@pae, @itsc, @nested_virt).
  *
- * Then (optionally) apply legacy XEND overrides (@xend) to the result.
+ * Then (optionally) apply legacy XEND CPUID overrides (@xend) or MSR (@msr)
+ * to the result.
  */
 int xc_cpuid_apply_policy(xc_interface *xch,
                           uint32_t domid, bool restore,
                           const uint32_t *featureset,
                           unsigned int nr_features, bool pae, bool itsc,
-                          bool nested_virt, const struct xc_xend_cpuid *xend);
+                          bool nested_virt, const struct xc_xend_cpuid *xend,
+                          const struct xc_msr *msr);
 int xc_mca_op(xc_interface *xch, struct xen_mc *mc);
 int xc_mca_op_inject_v2(xc_interface *xch, unsigned int flags,
                         xc_cpumap_t cpumap, unsigned int nr_cpus);
diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c
index 5b035223f4f5..5e5c8124dd74 100644
--- a/tools/libs/guest/xg_cpuid_x86.c
+++ b/tools/libs/guest/xg_cpuid_x86.c
@@ -423,10 +423,169 @@ static int xc_cpuid_xend_policy(
     return rc;
 }
 
+static int compare_msr(const void *l, const void *r)
+{
+    const xen_msr_entry_t *lhs = l;
+    const xen_msr_entry_t *rhs = r;
+
+    if ( lhs->idx == rhs->idx )
+        return 0;
+
+    return lhs->idx < rhs->idx ? -1 : 1;
+}
+
+static xen_msr_entry_t *find_msr(
+    xen_msr_entry_t *msrs, unsigned int nr_msrs,
+    uint32_t index)
+{
+    const xen_msr_entry_t key = { .idx = index };
+
+    return bsearch(&key, msrs, nr_msrs, sizeof(*msrs), compare_msr);
+}
+
+
+static int xc_msr_policy(xc_interface *xch, domid_t domid,
+                         const struct xc_msr *msr)
+{
+    int rc;
+    bool hvm;
+    xc_domaininfo_t di;
+    unsigned int nr_leaves, nr_msrs;
+    uint32_t err_leaf = -1, err_subleaf = -1, err_msr = -1;
+    /*
+     * Three full policies.  The host, default for the domain type,
+     * and domain current.
+     */
+    xen_msr_entry_t *host = NULL, *def = NULL, *cur = NULL;
+    unsigned int nr_host, nr_def, nr_cur;
+
+    if ( (rc = xc_domain_getinfo_single(xch, domid, &di)) < 0 )
+    {
+        PERROR("Failed to obtain d%d info", domid);
+        rc = -errno;
+        goto fail;
+    }
+    hvm = di.flags & XEN_DOMINF_hvm_guest;
+
+    rc = xc_cpu_policy_get_size(xch, &nr_leaves, &nr_msrs);
+    if ( rc )
+    {
+        PERROR("Failed to obtain policy info size");
+        rc = -errno;
+        goto fail;
+    }
+
+    rc = -ENOMEM;
+    if ( (host = calloc(nr_msrs, sizeof(*host))) == NULL ||
+         (def  = calloc(nr_msrs, sizeof(*def)))  == NULL ||
+         (cur  = calloc(nr_msrs, sizeof(*cur)))  == NULL )
+    {
+        ERROR("Unable to allocate memory for %u CPUID leaves", nr_leaves);
+        goto fail;
+    }
+
+    /* Get the domain's current policy. */
+    nr_leaves = 0;
+    nr_cur = nr_msrs;
+    rc = get_domain_cpu_policy(xch, domid, &nr_leaves, NULL, &nr_cur, cur);
+    if ( rc )
+    {
+        PERROR("Failed to obtain d%d current policy", domid);
+        rc = -errno;
+        goto fail;
+    }
+
+    /* Get the domain type's default policy. */
+    nr_leaves = 0;
+    nr_def = nr_msrs;
+    rc = get_system_cpu_policy(xch, hvm ? XEN_SYSCTL_cpu_policy_hvm_default
+                                        : XEN_SYSCTL_cpu_policy_pv_default,
+                               &nr_leaves, NULL, &nr_def, def);
+    if ( rc )
+    {
+        PERROR("Failed to obtain %s def policy", hvm ? "hvm" : "pv");
+        rc = -errno;
+        goto fail;
+    }
+
+    /* Get the host policy. */
+    nr_leaves = 0;
+    nr_host = nr_msrs;
+    rc = get_system_cpu_policy(xch, XEN_SYSCTL_cpu_policy_host,
+                               &nr_leaves, NULL, &nr_host, host);
+    if ( rc )
+    {
+        PERROR("Failed to obtain host policy");
+        rc = -errno;
+        goto fail;
+    }
+
+    for ( ; msr->index != XC_MSR_INPUT_UNUSED; ++msr )
+    {
+        xen_msr_entry_t *cur_msr = find_msr(cur, nr_cur, msr->index);
+        const xen_msr_entry_t *def_msr = find_msr(def, nr_def, msr->index);
+        const xen_msr_entry_t *host_msr = find_msr(host, nr_host, msr->index);
+        unsigned int i;
+
+        if ( cur_msr == NULL || def_msr == NULL || host_msr == NULL )
+        {
+            ERROR("Missing MSR %#x", msr->index);
+            rc = -ENOENT;
+            goto fail;
+        }
+
+        for ( i = 0; i < ARRAY_SIZE(msr->policy) - 1; i++ )
+        {
+            bool val;
+
+            if ( msr->policy[i] == '1' )
+                val = true;
+            else if ( msr->policy[i] == '0' )
+                val = false;
+            else if ( msr->policy[i] == 'x' )
+                val = test_bit(63 - i, &def_msr->val);
+            else if ( msr->policy[i] == 'k' )
+                val = test_bit(63 - i, &host_msr->val);
+            else
+            {
+                ERROR("Bad character '%c' in policy string '%s'",
+                      msr->policy[i], msr->policy);
+                rc = -EINVAL;
+                goto fail;
+            }
+
+            clear_bit(63 - i, &cur_msr->val);
+            if ( val )
+                set_bit(63 - i, &cur_msr->val);
+        }
+    }
+
+    /* Feed the transformed policy back up to Xen. */
+    rc = xc_set_domain_cpu_policy(xch, domid, 0, NULL, nr_cur, cur,
+                                  &err_leaf, &err_subleaf, &err_msr);
+    if ( rc )
+    {
+        PERROR("Failed to set d%d's policy (err leaf %#x, subleaf %#x, msr %#x)",
+               domid, err_leaf, err_subleaf, err_msr);
+        rc = -errno;
+        goto fail;
+    }
+
+    /* Success! */
+
+ fail:
+    free(cur);
+    free(def);
+    free(host);
+
+    return rc;
+}
+
 int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
                           const uint32_t *featureset, unsigned int nr_features,
                           bool pae, bool itsc, bool nested_virt,
-                          const struct xc_xend_cpuid *xend)
+                          const struct xc_xend_cpuid *xend,
+                          const struct xc_msr *msr)
 {
     int rc;
     bool hvm;
@@ -663,6 +822,13 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
     if ( xend && (rc = xc_cpuid_xend_policy(xch, domid, xend)) )
         goto out;
 
+    if ( msr )
+    {
+        rc = xc_msr_policy(xch, domid, msr);
+        if ( rc )
+            goto out;
+    }
+
     rc = 0;
 
 out:
diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index f5ce9f97959c..c96aeb3bce46 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -502,7 +502,7 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
             info->tsc_mode == LIBXL_TSC_MODE_ALWAYS_EMULATE);
 
     r = xc_cpuid_apply_policy(ctx->xch, domid, restore, NULL, 0,
-                              pae, itsc, nested_virt, info->cpuid);
+                              pae, itsc, nested_virt, info->cpuid, NULL);
     if (r)
         LOGEVD(ERROR, -r, domid, "Failed to apply CPUID policy");
 
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 11 09:25:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 09:25:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561653.878149 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9cA-0004Pb-D9; Tue, 11 Jul 2023 09:24:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561653.878149; Tue, 11 Jul 2023 09:24:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9cA-0004PU-9m; Tue, 11 Jul 2023 09:24:58 +0000
Received: by outflank-mailman (input) for mailman id 561653;
 Tue, 11 Jul 2023 09:24:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=rRYD=C5=citrix.com=prvs=54940d4e9=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qJ9c9-0003sM-Pd
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 09:24:57 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cc530944-1fcc-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 11:24:55 +0200 (CEST)
Received: from mail-mw2nam10lp2107.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.107])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 11 Jul 2023 05:24:55 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB5920.namprd03.prod.outlook.com (2603:10b6:a03:2d6::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul
 2023 09:24:54 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2%5]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023
 09:24:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cc530944-1fcc-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689067496;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=tfUAR7LtcqUvrJvKJ650F7u8kbPSqfT9jS7QFyjj3Ug=;
  b=FtA2bJfLxA+6LXfxOaANViFRBAHS+slCN0qtC+fG5Nzw2vErFUQ03jya
   mCerVV8QZje9y/5R+DgBtTg/2UU39o0lnCrxpzm4TEhXlIDcsbUwbwbGi
   /CF4A3MzU0RjeB2tS5PZs9RsKqhVb3RiwnlvzZfl/h/rF9BiMQHoRck6I
   8=;
X-IronPort-RemoteIP: 104.47.55.107
X-IronPort-MID: 115102759
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:gEvsFqoXWdgrZnmQ8+CmExTf/VFeBmI8ZBIvgKrLsJaIsI4StFCzt
 garIBnSbq6LZmrzfYhxatuwp0pQ6JLWmN5iTgNqr3w9ESgS+ZuZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weBziBNVfrzGInqR5fGatgMdgKFb
 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo
 OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay
 RAXADcJZDWin/uk+oiAErBUjfwRCsTaA7pK7xmMzRmBZRonabbqZvySoPpnhnI3jM0IGuvCb
 c0EbzYpdA7HfxBEJlYQDtQ5gfusgX78NTZfrTp5p4JuuzSVkFM3jeWraYKKEjCJbZw9ckKwv
 GXJ8n6/GhgHHNee1SCE4jSngeqncSbTAdtPTeXiqaM76LGV7jUIAz02fBiqm9KGrRSPBMJjF
 m4ppiV7+MDe82TuFLERRSaQsHOC+xIRRddUO+k78x2WjLrZ5R6DAWoJRSIHb8Yp3OcpQRQ62
 1nPmMnmbRRtv6eSUmm17aqPoHW5Pi19EIMZTSoNTA9A5sa5pog210rLVow6SPHzicDpEzbtx
 TzMtDI5m7gYkc8M0eO84EzDhDWv4JPOS2bZ+znqY45s1SshDKbNWmBiwQKzASpoRGpBcmS8g
 Q==
IronPort-HdrOrdr: A9a23:hYnFh6uaaaf+DLLu1w3go/ep7skDgNV00zEX/kB9WHVpm6yj+v
 xGUs566faUskd2ZJhEo7q90ca7Lk80maQa3WBVB8bBYOCEghrOEGgB1/qA/9SIIUSXmtK1l5
 0QFpSWYOeaMbEQt7ef3ODXKbcdKNnsytHWuQ/dpU0dMz2DvctbnnZE4gXwKDwHeOFfb6BJba
 Z1fqB81kedkXJ8VLXCOlA1G9Ltivfsj5zcbRsPF3ccmXWzZWPB0s+AL/CAtC1uKQ9y/Q==
X-Talos-CUID: =?us-ascii?q?9a23=3Ay/S+ZmjXaDmKlNX2hdVakE1USDJudXnX6VbIOl2?=
 =?us-ascii?q?CM10xEYWecW229ZJbqp87?=
X-Talos-MUID: =?us-ascii?q?9a23=3As1DJfg+7lZT8/x4VqGfKstKQf55z6ISOIQMcq74?=
 =?us-ascii?q?5nJO1ajxMBhWg0DviFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,196,1684814400"; 
   d="scan'208";a="115102759"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=e6ZH0UMnDMM1lo1hQHJSHul4dxbmkz+GjFFcZD8G4dRoN99lNOiaFN9D4pEpzr3Jb8/8RaX/D8efEu9jenwv2eZ5GdnSFt+YRmGVa6idnRcp4NfXguSDyEiTFneV54mbFle5xxEavf0gX96bUS+tyWM8Bv9p0tXP1T6TD/fPZjWkcAQlih/8ey0wkI3z2wL5w8g4R6QUARKFEh/AjdGt1dKtjbJ6E0jupHWOntafQbQFygGRyBUEdw/x/aysDbf/HcwH992TsR9ighWRka9uf00/hNQMZ6skGfbuhgCFWd8SI34Snakl3KFWvasNYtPhy+UVmJdafW+0dyQrRS7O3Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7k1rS/yaURpqaZoQyG8Rolc9cmYKV1qsI38rLc/fzbI=;
 b=ZLeRCOPIGgzT1dKkVFoO8tsqeQATq4Z3m1A3/XR5ifqPA5sjwf+Nfa953Gn7I/hRROwbqIjXvUqJgTSwo75WsaQ+Ef/oazXQU7rKvlzbmdFiHINY7cZt2ci+q+cYFokgwhSaLLK7n7YtNCL0Qyj2Ry30bug0DfB10kMNY9HgLez4xgl8KEQR7Ew5MjjvNssRjs0fTFlSfECcHgbYtUNHIIDwSvSdqBSFnl6DoDLNCDQfzGw2KBcrBuLN45rNWiu9Cy6uhX+Lz8Qod6cyetdeHn8BuUtdcG15lZUcV4dwKY/UbLLkPqNTfVS+HqTlP4p90iroU3eCsns7lMhLQ0PQ+Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7k1rS/yaURpqaZoQyG8Rolc9cmYKV1qsI38rLc/fzbI=;
 b=PpLbDqx23OSwGywQa9TzTzIJsV0tPnKSKG9965zkVVsaZmY4nsjSSw5RFp2xYkRmOY4LHn7faFaH+a6HaFfVcW/+97juuGKHmA82PdSBZKwb+JprErsl8u05f5joTM31SgJ2NBU0HPEYApLz7NLAHp98USLCSSxM0rFMdlEBGfc=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v2 3/6] libxl: introduce MSR data in libxl_cpuid_policy
Date: Tue, 11 Jul 2023 11:22:27 +0200
Message-ID: <20230711092230.15408-4-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230711092230.15408-1-roger.pau@citrix.com>
References: <20230711092230.15408-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0153.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:188::14) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5920:EE_
X-MS-Office365-Filtering-Correlation-Id: 4f38e971-1c79-4505-84ad-08db81f0af74
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	/OT8RyQMPdBlZ/BpVvif7h3Y10MLxa8iAMwX5lwqJ6UxemidizqtrYTUuqlE38MxtpvdIphCg+8uldWZQDFEUZKTxdqFsWD1qWaZGVgI4BBCgy/inFWwOTv27cpSOdMD7YosRqxWJRdeqaPCNrJeO/se9KDffiCAlJ+XGvJV1pxa+RZxs3cn+jTH82OQMh0wR4T8jjOD4Mpeir55t7Cacsj8UnwiBGq+p+ZfG7ZWbjr3P8yOohn/eBFYPs06YATczWwXQ2LO2Mu9w2gAkK734BNzI57rSsD52R96uKzmWb5bRCMYk/5uHgnn9ySyZ3bLeKofPZ3xYdJV9xqGk67fwqdIS0Z5pxbUdr7gIvDBfi8T6q0gBQOpibzNcpu1oVx9H4ogV+NuTrmaH0mq9wGfAh/q/KoMDpM1VSJvBNxuhfLE7GUkqnalYeh+WaY0f+xRYfHEiR6/2g+bDyPd5o33hZSxNtLNN3N8RSMskU2sxZSYzbHBQiLEUTTCGVWXJcv3yZbWZMjIAlqaKNVSu1Znbpd84iFGkOkE2ApmpqkSyopDsjDz7wnFDpWMMh7MRQbJ
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(376002)(39860400002)(136003)(366004)(451199021)(54906003)(6486002)(6666004)(478600001)(26005)(6506007)(1076003)(6512007)(66946007)(186003)(2906002)(6916009)(66556008)(41300700001)(66476007)(5660300002)(316002)(4326008)(8936002)(8676002)(82960400001)(38100700002)(86362001)(36756003)(83380400001)(2616005)(66899021);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?a3VuVVdyT2JSWmZHOUI2RVNvTlJ6QWR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xKCr+7NwYFnAaRngJFy4SuLBdcmYn1hpvq1M2/6RRG9unHvAz1DOXuu+2p2/XFFcLdVIi5KLgJpg4/qXLNH889jIovgplbIpoktANFzGRwPU8s54vkUvS/ddE2/bUKAQ8Ab+JzzYaNNgMPq+X4So3UH5ffafYoQqosp3iRNh+kDvSGbzTYbujckC3vvITLMhgEbFfo3mlcm+886pMg6h6onsFkNTYKXeRAxcPoKXGp+y/KdbUWvNcBjjHqW0yYtxdAS+iI4egsAb6BWn4hTJKCsAaU7C4gmQfM2WL0nkOb5wA8+stoEzTwvWh6+2e6ilwBphtWgqJE0Y+fbG2UD0RY2BVvJL1+91X2VM7Qc2PMkJCvZDobFuZmnt/Z8
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4f38e971-1c79-4505-84ad-08db81f0af74
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 09:24:54.1192
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: aSDvqEGHDHxwKDf2shMHY9nP27etJWo0Rzc7A7Zt18ZDVAw5+mIZLWPbkjFP/H5mwZ2sgqmAV+4ffaZRmc2dRw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5920

Add a new array field to libxl_cpuid_policy in order to store the MSR
policies.

Note that libxl_cpuid_policy_list_{copy,length,parse_json,gen_json}
are not adjusted to deal with the new MSR array now part of
libxl_cpuid_policy_list.

Adding the MSR data in the libxl_cpuid_policy_list type is done so
that existing users can seamlessly pass MSR features as part of the
CPUID data, without requiring the introduction of a separate
domain_build_info field, and a new set of handlers functions.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
 tools/libs/light/libxl_cpuid.c    | 6 +++++-
 tools/libs/light/libxl_internal.h | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index 724cb4f182d4..65cad28c3ef0 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -40,6 +40,9 @@ void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl)
         free(policy->cpuid);
     }
 
+    if (policy->msr)
+        free(policy->msr);
+
     free(policy);
     *pl = NULL;
     return;
@@ -516,7 +519,8 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
 
     r = xc_cpuid_apply_policy(ctx->xch, domid, restore, NULL, 0,
                               pae, itsc, nested_virt,
-                              info->cpuid ? info->cpuid->cpuid : NULL, NULL);
+                              info->cpuid ? info->cpuid->cpuid : NULL,
+                              info->cpuid ? info->cpuid->msr : NULL);
     if (r)
         LOGEVD(ERROR, -r, domid, "Failed to apply CPUID policy");
 
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index ef882cff3912..b1a7cd9f615b 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -4871,6 +4871,7 @@ _hidden int libxl__domain_set_paging_mempool_size(
 
 struct libxl__cpu_policy {
     struct xc_xend_cpuid *cpuid;
+    struct xc_msr *msr;
 };
 
 #endif
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 11 09:25:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 09:25:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561657.878159 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9cJ-0004zo-Se; Tue, 11 Jul 2023 09:25:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561657.878159; Tue, 11 Jul 2023 09:25:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9cJ-0004zX-PH; Tue, 11 Jul 2023 09:25:07 +0000
Received: by outflank-mailman (input) for mailman id 561657;
 Tue, 11 Jul 2023 09:25:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=rRYD=C5=citrix.com=prvs=54940d4e9=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qJ9cI-0003sM-MQ
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 09:25:06 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d06f4972-1fcc-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 11:25:03 +0200 (CEST)
Received: from mail-co1nam11lp2176.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.176])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 11 Jul 2023 05:25:02 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SA3PR03MB7465.namprd03.prod.outlook.com (2603:10b6:806:39d::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul
 2023 09:24:59 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2%5]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023
 09:24:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d06f4972-1fcc-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689067504;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=8+Sl3H+wuO6OVjhm1WdnZ0irrqzFxLxnse2I2rwpE20=;
  b=BbiVLyUzmb6HvawruLMjvSgQby6DWXjDjZ2Gym1XHt/e8ZOTa0kTQRWz
   wfErWyYCsyGbBNkskt83GxiBR/rwHhLr9jHwSYRYT8F4nQDH/Rm3YN1Yj
   saXs5f3BVm+Ck0kxBzP5gY19dMa1O563cY/b94y1xAR4uG5N4DuSXg/qs
   c=;
X-IronPort-RemoteIP: 104.47.56.176
X-IronPort-MID: 115102774
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:hNdzOKLvd1zNBLMTFE+R9ZQlxSXFcZb7ZxGr2PjKsXjdYENShWRVn
 DcWXmiGOavZamP9eNAgYI/k8R4B6J7WzNZnSAdlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU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 =?us-ascii?q?6ovamLGt0Am28szS7a9py?=
X-IronPort-AV: E=Sophos;i="6.01,196,1684814400"; 
   d="scan'208";a="115102774"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=mKGd7xRA2+5+DPnpQECHCyu1PZgkvPOXlNMnM/b7WSyDy0zC1lBMPhDPIPO8AYv6avLb+Tcpm3IbpDPSejIYHx4yg+AiTdPvOldQNZOyyz2TySYrjgpmm9HguwIkQ4X5/6VyqHELZCQwnC0JqUi3M6CfwL6QRZWfg1j7kknGO44um/cOzfu4xlDCQKFgdLN7MY0WhitqWq8+Cy/h0u1WtZA1t70FCt0hvMGrwmXdWb0dnOf77LvtHHL8CkZLW71tjNW+qdq97sadf5oltC2ZeZCMo4RgSFM0DU18J5CANGxh9hCdFIhlWw0x+7KBBSAXNnD2FTCdKGYPaS5MDhLG3Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0JBJAb8OYXFMhUt2Wfrjf4RzfJzF4XKtInaUKwrNQWE=;
 b=LHD65IAVARXCl1KgibSWkT4CiCqyqxPO8Esqnp6+fF3aoKhHwcQFPYPA0x1hPQlohLOWyzbArz2i3kQZzNyRQB7rRYJobdNtHTa8LZOb1EeQ4l2xDc6D2QSHIYUewMAq+TunuVat1bDeaCemH+3/P9W6CKkPzFSxm3+EnGOJFq9KSyd7sz1mkTRzJTkMv49dZISQPXP9pO+ICnA5EgJS+IQ+e5VYSUF2sY80KbnCYyJZgz29Jkpud4OnVJGb77C2vWTo7sYkhQiOHyamNshhEXjlBZsFgo74u8kd8NrbcV6fB5OBUo6l3clmBCU8DXBmFbSLuoY8BlRYLO9PBhM5Xg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0JBJAb8OYXFMhUt2Wfrjf4RzfJzF4XKtInaUKwrNQWE=;
 b=PuOLk2ZXfWAuoCLqLNxjlq5VfE1lgnxMSOMo2MAmXKWsX8wLHp5kpQGwWaEj3/fl85OMKw8Ew1vab8ALKG9eefCpEhdSui7qpkrq/HEDNo1PcJyWW4PhuSGyDsZbFFjuUXUToPMiqiiQsLknLntDEH07mdo8cjteZDkKdfAUoIs=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v2 4/6] libxl: split logic to parse user provided CPUID features
Date: Tue, 11 Jul 2023 11:22:28 +0200
Message-ID: <20230711092230.15408-5-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230711092230.15408-1-roger.pau@citrix.com>
References: <20230711092230.15408-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P265CA0391.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:f::19) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA3PR03MB7465:EE_
X-MS-Office365-Filtering-Correlation-Id: 0502cf19-beeb-4311-8550-08db81f0b2a8
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	T6Lkgzl7zecqMty/g1FqPHkG10n556apvSJS6EYQLDzf0PRjOhN6ezB8xCRQBxumrT99YRTZMKiBydlXGBig8xtg7rkCyr3rqYMc+1f0/kGyKFANCNHFkONvpY0O+CBN7PCHb900QnFZqUHAWt2yhQytSU/C618/btdBOCqQ5ikd3+RIVVEU2O7qrUJ74a/cr6Lzf85gBXOmns8lALWHCsuJjwosyXzvtqIaSHWCyanHg6+UVniaYohspenjWWYjyssYU3kNvt/DP3s3ZZJTLzvJNbu4+OAXN6IzWBfZZg9fTCvcwnOAua2C4F6WR3DYBPxZGQl7QbBAZ1km5u2t9FzIPk8Q5XL4OIziOD76PDGe+O3VJAUz7dRcHqchewsBqNoZVR26Z5yjr+MamcvyzUfrfMxaTADwQTbCEXAWxBjz5JkGXepNfdVAJTRerq+KDQd6IyjatiR/Xt5zYm+cJ58/Thn1cxxA+Tq4MZ+SwuN/oTod4XE97dvjRbCGx7AOSLHYDMqb8cWIaJTd5u8blcQrokVDP98Sq6B9Qf9awyzscYLaeKn5+jnEzlpb5b+M
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(136003)(366004)(39860400002)(376002)(451199021)(38100700002)(86362001)(36756003)(6666004)(6486002)(54906003)(82960400001)(2616005)(26005)(1076003)(186003)(6506007)(6512007)(478600001)(316002)(66556008)(5660300002)(6916009)(66946007)(66476007)(8936002)(8676002)(2906002)(83380400001)(4326008)(41300700001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkC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hGv8xiF8ljA1SS9F82MA1kBVgw7Q0+o6C8Kuho3/1+3s95cKPv038NVzIQCQrm0FLV+sJXRSm1TlLcR69u7AT53BRnXwm/MrnODUekcwNP05W2UQuz4EZuZhy+YfHJg0OqnUb/rLUpXoy1j4Z2MuOnhkDWw8N7yjj0/gPZ0O2CYitLaRuZ+a4NzeUzhhUsAgFV8ZfzgvtQ8DW5J6dKuqvxt6LmUgKhV/Ual8jI/JsGA1s8HgrwN27MYdVuNp2ewyXg3goZTNr/2RJHlUGJqwfRNI5pxHvQS4lpybPLmABrawuJqgFabEIe20sqpep7NKiOIe7Kjo4rFcF3IxELv4H+WQftjLiMSuuExydziwI1yJwRm7DVQComN6qrRq6MiSlECjwn2JJgUhg
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0502cf19-beeb-4311-8550-08db81f0b2a8
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 09:24:59.4023
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ZjMYJpdBkzXyCjpHRuxELP72Mp2LE4ekPD5q6a3g3Kl/+i0vXCepaNTJPy52h9tQS5N1VLBp+pcX+qHR2TLGpg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR03MB7465

Move the CPUID value parsers out of libxl_cpuid_parse_config() into a
newly created cpuid_add() local helper.  This is in preparation for
also adding MSR feature parsing support.

No functional change intended.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
 tools/libs/light/libxl_cpuid.c | 120 +++++++++++++++++----------------
 1 file changed, 63 insertions(+), 57 deletions(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index 65cad28c3ef0..52e21de81fc7 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -97,6 +97,66 @@ static struct xc_xend_cpuid *cpuid_find_match(libxl_cpuid_policy_list *pl,
     return *list + i;
 }
 
+static int cpuid_add(libxl_cpuid_policy_list *policy,
+                     const struct cpuid_flags *flag, const char *val)
+{
+    struct xc_xend_cpuid *entry = cpuid_find_match(policy, flag->leaf,
+                                                   flag->subleaf);
+    unsigned long num;
+    char flags[33], *resstr, *endptr;
+    unsigned int i;
+
+    resstr = entry->policy[flag->reg - 1];
+    num = strtoull(val, &endptr, 0);
+    flags[flag->length] = 0;
+    if (endptr != val) {
+        /* if this was a valid number, write the binary form into the string */
+        for (i = 0; i < flag->length; i++) {
+            flags[flag->length - 1 - i] = "01"[!!(num & (1 << i))];
+        }
+    } else {
+        switch(val[0]) {
+        case 'x': case 'k': case 's':
+            memset(flags, val[0], flag->length);
+            break;
+        default:
+            return 3;
+        }
+    }
+
+    if (resstr == NULL) {
+        resstr = strdup("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
+    }
+
+    /* the family and model entry is potentially split up across
+     * two fields in Fn0000_0001_EAX, so handle them here separately.
+     */
+    if (!strcmp(flag->name, "family")) {
+        if (num < 16) {
+            memcpy(resstr + (32 - 4) - flag->bit, flags + 4, 4);
+            memcpy(resstr + (32 - 8) - 20, "00000000", 8);
+        } else {
+            num -= 15;
+            memcpy(resstr + (32 - 4) - flag->bit, "1111", 4);
+            for (i = 0; i < 7; i++) {
+                flags[7 - i] = "01"[num & 1];
+                num >>= 1;
+            }
+            memcpy(resstr + (32 - 8) - 20, flags, 8);
+        }
+    } else if (!strcmp(flag->name, "model")) {
+        memcpy(resstr + (32 - 4) - 16, flags, 4);
+        memcpy(resstr + (32 - 4) - flag->bit, flags + 4, 4);
+    } else {
+        memcpy(resstr + (32 - flag->length) - flag->bit, flags,
+               flag->length);
+    }
+    entry->policy[flag->reg - 1] = resstr;
+
+    return 0;
+
+}
+
 /* parse a single key=value pair and translate it into the libxc
  * used interface using 32-characters strings for each register.
  * Will overwrite earlier entries and thus can be called multiple
@@ -341,12 +401,8 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
         {NULL, 0, NA, CPUID_REG_INV, 0, 0}
     };
 #undef NA
-    char *sep, *val, *endptr;
-    int i;
+    const char *sep, *val;
     const struct cpuid_flags *flag;
-    struct xc_xend_cpuid *entry;
-    unsigned long num;
-    char flags[33], *resstr;
 
     sep = strchr(str, '=');
     if (sep == NULL) {
@@ -356,60 +412,10 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
     }
     for (flag = cpuid_flags; flag->name != NULL; flag++) {
         if(!strncmp(str, flag->name, sep - str) && flag->name[sep - str] == 0)
-            break;
-    }
-    if (flag->name == NULL) {
-        return 2;
-    }
-    entry = cpuid_find_match(policy, flag->leaf, flag->subleaf);
-    resstr = entry->policy[flag->reg - 1];
-    num = strtoull(val, &endptr, 0);
-    flags[flag->length] = 0;
-    if (endptr != val) {
-        /* if this was a valid number, write the binary form into the string */
-        for (i = 0; i < flag->length; i++) {
-            flags[flag->length - 1 - i] = "01"[!!(num & (1 << i))];
-        }
-    } else {
-        switch(val[0]) {
-        case 'x': case 'k': case 's':
-            memset(flags, val[0], flag->length);
-            break;
-        default:
-            return 3;
-        }
-    }
-
-    if (resstr == NULL) {
-        resstr = strdup("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
+            return cpuid_add(policy, flag, val);
     }
 
-    /* the family and model entry is potentially split up across
-     * two fields in Fn0000_0001_EAX, so handle them here separately.
-     */
-    if (!strncmp(str, "family", sep - str)) {
-        if (num < 16) {
-            memcpy(resstr + (32 - 4) - flag->bit, flags + 4, 4);
-            memcpy(resstr + (32 - 8) - 20, "00000000", 8);
-        } else {
-            num -= 15;
-            memcpy(resstr + (32 - 4) - flag->bit, "1111", 4);
-            for (i = 0; i < 7; i++) {
-                flags[7 - i] = "01"[num & 1];
-                num >>= 1;
-            }
-            memcpy(resstr + (32 - 8) - 20, flags, 8);
-        }
-    } else if (!strncmp(str, "model", sep - str)) {
-        memcpy(resstr + (32 - 4) - 16, flags, 4);
-        memcpy(resstr + (32 - 4) - flag->bit, flags + 4, 4);
-    } else {
-        memcpy(resstr + (32 - flag->length) - flag->bit, flags,
-               flag->length);
-    }
-    entry->policy[flag->reg - 1] = resstr;
-
-    return 0;
+    return 2;
 }
 
 /* parse a single list item from the legacy Python xend syntax, where
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 11 09:25:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 09:25:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561661.878169 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9cR-0005lW-88; Tue, 11 Jul 2023 09:25:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561661.878169; Tue, 11 Jul 2023 09:25:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9cR-0005lN-3n; Tue, 11 Jul 2023 09:25:15 +0000
Received: by outflank-mailman (input) for mailman id 561661;
 Tue, 11 Jul 2023 09:25:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=rRYD=C5=citrix.com=prvs=54940d4e9=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qJ9cP-0003sM-Ub
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 09:25:14 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d49ac06f-1fcc-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 11:25:11 +0200 (CEST)
Received: from mail-bn8nam04lp2041.outbound.protection.outlook.com (HELO
 NAM04-BN8-obe.outbound.protection.outlook.com) ([104.47.74.41])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 11 Jul 2023 05:25:08 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SA3PR03MB7465.namprd03.prod.outlook.com (2603:10b6:806:39d::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul
 2023 09:25:05 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2%5]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023
 09:25:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d49ac06f-1fcc-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689067511;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=EKORR818BvAQ8NM1Q8PjcPTPakvjfGrsZhV8oVVgJcs=;
  b=I/m8oUOAn2Kr6iIjmJWZvFIAwRAX5wmvKxIFKft9Thj/XBL5AISzt/PT
   m5gQTjvpsG+RQcab9Zv8wExVo04se0hlg08+lpwkAd/poMJ8W5yS+XyOt
   1h8mJ+FiA3sVXsWufsmHmIuUcuonj9RhCeYG5COcknl0bwwW1JwWARi8h
   0=;
X-IronPort-RemoteIP: 104.47.74.41
X-IronPort-MID: 116231404
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:bQYj1K/1dH0fCPXPFl1LDrUDpX+TJUtcMsCJ2f8bNWPcYEJGY0x3z
 mcdUDuHOPmJYmuhfNx/YNvg9UMAuJbUmNRiHQBsqXg8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s
 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk
 d7pqojUNUTNNwRcawr40Ird7ks21BjOkGlA5AdmOqkS5Aa2e0Q9V/rzG4ngdxMUfaEMdgKKb
 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk
 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklH7
 a0GDiAiNiuBit+b6YqrUNFWhNYKeZyD0IM34hmMzBn/JNN+HdXpZfWP4tVVmjAtmspJAPDSI
 dIDbiZiZwjBZBsJPUoLDJU5n6GjgXyXnz9w8QrJ4/ZopTePilAouFTuGIO9ltiiX8Jak1zev
 mvb12/4HgsbJJqUzj/tHneE37aRx3iiBNpOfFG+3tlHj0OY2k9LMyYbf3yjufvgl3aVGN0Kf
 iT4/QJr98De7neDXtT7GhG1vnOAlhodQMZLVf037hmXzajZ6BrfAXILJhZebPQ2uclwQiYlv
 neLkMnuHidHq6CORDSW8bL8kN+pES0cLGtHbylUSwIAu4XnuNtr0kuJSct/GqmoiNGzASv33
 z2BsCk5gfMUkNIP0KK4u1vAhlpAu6T0c+L83S2PNkrN0++zTNTNi1CAgbQD0ct9EQ==
IronPort-HdrOrdr: A9a23:gLQPo6Fp7RROOfWwpLqEHseALOsnbusQ8zAXPiBKJCC9vPb5qy
 nOpoV86faQslwssR4b9uxoVJPvfZqYz+8W3WBzB8bEYOCFghrKEGgK1+KLrwEIWReOk9K1vZ
 0KT0EUMqyVMbEVt6fHCAnTKade/DGEmprY+9s3GR1WPHBXg6IL1XYINu6CeHcGPTWvnfACZe
 ehDswsnUvZRV0nKv6VK1MiROb5q9jChPvdEGI7705O0nj0sduwgoSKaSSl4g==
X-Talos-CUID: =?us-ascii?q?9a23=3AkfAa+2iSeqRB5Ue2/GOYh3MoszJue2WM0lHADBe?=
 =?us-ascii?q?DC2tUZZStWUWowqF2up87?=
X-Talos-MUID: 9a23:HclhsgbR4YPtUOBTkBLjmjp+F59T2KmEL1gVk8wbg+LHOnkl
X-IronPort-AV: E=Sophos;i="6.01,196,1684814400"; 
   d="scan'208";a="116231404"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=fP9SHOzJVJ8z+O5sg41C0TPtUBcMU1VAlxqGdCvQGLn0aS8pCmJao+mG7ngiTSG9M1zcXFWSLLhAs1Bb0fGNPzG3Se5E/QYDGC83pi1yZZoI78hAb5IFfrdjhv+A2KkiS2dlhTHp6N2duutA9+0PIqBNPwE5JR2lHTSGfFiKOBLlVmC76Xlo6S7FoTc2xxj+UkOyP6fefyOO/JG5KZuS3u2IS0UsC85fwSlH/lojG0FYilJ9jOb3CAB8N6enN4IbvJGWT2Py7IjgRo4WoF76oKq+gFcy9gc4bU9fxfNjDBad0xcr0Hq2+EBaA+tSEIIgHGlp2NndScCu5nnj/hvTNw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=y9MqF37yhxfStVG5/mzICSzNPnqlgbtuAxZ3VZTvJSY=;
 b=UZwyl9EMXnzHdn7X6g/sj8BccO+U+UXxglHL1/NkQeiLA8UQ29yW0xelEQq5oC+Ii8D0ca5ZU5pFQKIpHjuy4ei+od4GrBsMg6oRnhCuHHZRhIgS6zsbzhr3bA8Yw8uw3nEt7317PJTrK4GMxDJP59g4sILjwyce0jyI0okXHPt7rWwNhmCbRMs1zhcKF43ky2Dsyg8UtYAlpM2ItgGtuDDGYE4FnK/PMtC0p2PW6Z73GUyGyPcQJNGLfPaL3J3AMSOykvgvg6Uo5W69i+4fu/i16WY9ifix6x04AX5/J/VEy1IZ57a1rbPtRqWnekTLCDa/ZlnnvnQX5MrhsmK4IA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=y9MqF37yhxfStVG5/mzICSzNPnqlgbtuAxZ3VZTvJSY=;
 b=JkyvdnuywDgeFPRQAaRAaHNFUtDIX/amBZNQyNLQv5KW2QsFZVpRH5xdQqBVl5i7n12ub7IOvDRNt/dLsENXlgxj9wlhU21gP+KJ2Wilps6A+ek9kjKKk2bsogJFKaAMViCap0Dx7yl1V4MnJIiTzeiD3ccIlI3ZxZEGnVwKZqs=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v2 5/6] libxl: use the cpuid feature names from cpufeatureset.h
Date: Tue, 11 Jul 2023 11:22:29 +0200
Message-ID: <20230711092230.15408-6-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230711092230.15408-1-roger.pau@citrix.com>
References: <20230711092230.15408-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0362.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:18e::7) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA3PR03MB7465:EE_
X-MS-Office365-Filtering-Correlation-Id: 7e8d3ebb-9875-4274-de9f-08db81f0b65a
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	qHfk8f3aQvNjn4Rc/jwrxSPE8KWHWv2iKkfuNyES7rIIFCcT2FYrj5lH6M7zba3n+TvPib4+AtV8XV9MQJ7hSDo1Pa9CRcKHf2B7yAVZWSydTw/cECIwsJlD8xLcjbLZlny/mIN+MtsynpRpUzPdYhwjctNt+DKKbTJNntITgOfMvAIYLwEfk88V4Taxq5mADobpE8DrjNB8dTxQGTOfSF4GEoF1uBP+Dk3VywS8wmbQHEEU/R3sYcnGlHDzWD6d4vxBh4xrpoYnK2DMBd4rG+iqzl5jeU5x+b4dsnFJ0WH4Vw9oQPl58ZX5kFKshNnx6kmpevFxjNyElSwGFkUBz//WK4ImW3cvq6jNPAYKq1xmUeRNR6U7i/az3eEBXspXh7ZeA/kTvTLi3qRpt/cuf9rSOaaB02rcyEV7qFnPEt7IfpXO4tQuSQYyhHM7NJDahJHYl86Tys8I949UB5+djVL8cIiR8L8ANqBSXmHf+Ss0qKMeASeHUyJoDZfWGivKTSoakNDgvj/ZYDt+tLT7rjRMwZzfNPDjLAHhKCyH32PWZ50k9sdHIXNWZeY883QdODzofTB7FCD88qvMIYYEZieXUjLadk7AMHQxc/7yp2o=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(136003)(366004)(39860400002)(376002)(451199021)(38100700002)(86362001)(36756003)(6666004)(6486002)(54906003)(82960400001)(2616005)(26005)(1076003)(186003)(6506007)(6512007)(478600001)(316002)(66556008)(5660300002)(6916009)(66946007)(66476007)(8936002)(8676002)(2906002)(66574015)(83380400001)(4326008)(30864003)(41300700001)(473944003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?OXB3U3dCR0YvVHQ4R09DRkErSHlxT2NhRHFRUFBNY05PbnhFU0hwKzRRU0R3?=
 =?utf-8?B?NmxpS1VtNkt1cEhqdkNYaGI0WnZIZjlzWlZNT2JKbll2WGpwSDFXYk41RnhX?=
 =?utf-8?B?b3ZxcjhBbG42dktjUXAzOHFMVXU3a2Y4aEJtR3Y3TDVlZ3ErelZhM0U2bzlx?=
 =?utf-8?B?K042anN4Mldwc3BLWndwTGU2RDlScFRPTmU5V05LUVFnMDFWWHBPSmdOd3Zh?=
 =?utf-8?B?M3FXWDlaSVoybkhtcmVUYTY2VC9qSlpLTXpnb0FrSGkxTnNWOTlKWTN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S-Exchange-CrossTenant-Network-Message-Id: 7e8d3ebb-9875-4274-de9f-08db81f0b65a
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 09:25:05.6940
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: pnavnJrVSvGXQkZp8DQVix7hkDJfs7b1r9tjVlMWiXkIsFw9kLTwzDkoIM9uKKR8w1ZYtowZ1nWm5mHwF6+iiw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR03MB7465

The current implementation in libxl_cpuid_parse_config() requires
keeping a list of cpuid feature bits that should be mostly in sync
with the contents of cpufeatureset.h.

Avoid such duplication by using the automatically generated list of
cpuid features in INIT_FEATURE_NAMES in order to map feature names to
featureset bits, and then translate from featureset bits into cpuid
leaf, subleaf, register tuple.

Note that the full contents of the previous cpuid translation table
can't be removed.  That's because some feature names allowed by libxl
are not described in the featuresets, or because naming has diverged
and the previous nomenclature is preserved for compatibility reasons.

Should result in no functional change observed by callers, albeit some
new cpuid features will be available as a result of the change.

While there constify cpuid_flags name field.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
Changes since v1:
 - const unnamed structure cast.
 - Declare struct feature_name outside the function.
 - Use strcmp.
 - Fix indentation.
 - Add back missing feature name options.
 - Return ERROR_NOMEM if allocation fails.
 - Improve xl.cfg documentation about how to reference the features
   described in the public header.
---
 docs/man/xl.cfg.5.pod.in       |  24 +--
 tools/libs/light/libxl_cpuid.c | 267 ++++++++++++---------------------
 tools/xl/xl_parse.c            |   3 +
 3 files changed, 107 insertions(+), 187 deletions(-)

diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index 3979be2a590a..55161856f4c7 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -2010,24 +2010,16 @@ proccount procpkg stepping
 
 =back
 
-List of keys taking a character:
+List of keys taking a character can be found in the public header file
+L<arch-x86/cpufeatureset.h|https://xenbits.xen.org/docs/unstable/hypercall/x86_64/include,public,arch-x86,cpufeatureset.h.html>
 
-=over 4
-
-3dnow 3dnowext 3dnowprefetch abm acpi adx aes altmovcr8 apic arat avx avx2
-avx512-4fmaps avx512-4vnniw avx512bw avx512cd avx512dq avx512er avx512f
-avx512ifma avx512pf avx512vbmi avx512vl bmi1 bmi2 clflushopt clfsh clwb cmov
-cmplegacy cmpxchg16 cmpxchg8 cmt cntxid dca de ds dscpl dtes64 erms est extapic
-f16c ffxsr fma fma4 fpu fsgsbase fxsr hle htt hypervisor ia64 ibs invpcid
-invtsc lahfsahf lm lwp mca mce misalignsse mmx mmxext monitor movbe mpx msr
-mtrr nodeid nx ospke osvw osxsave pae page1gb pat pbe pcid pclmulqdq pdcm
-perfctr_core perfctr_nb pge pku popcnt pse pse36 psn rdrand rdseed rdtscp rtm
-sha skinit smap smep smx ss sse sse2 sse3 sse4.1 sse4.2 sse4_1 sse4_2 sse4a
-ssse3 svm svm_decode svm_lbrv svm_npt svm_nrips svm_pausefilt svm_tscrate
-svm_vmcbclean syscall sysenter tbm tm tm2 topoext tsc tsc-deadline tsc_adjust
-umip vme vmx wdt x2apic xop xsave xtpr
+The feature names described in C<cpufeatureset.h> should be specified in all
+lowercase letters, and with underscores converted to hyphens.  For example in
+order to reference feature C<LAHF_LM> the string C<lahf-lm> should be used.
 
-=back
+Note that C<clflush> is described as an option that takes a value, and that
+takes precedence over the C<clflush> flag in C<cpufeatureset.h>.  The feature
+flag must be referenced as C<clfsh>.
 
 =back
 
diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index 52e21de81fc7..b1c4f8f2f45b 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -14,6 +14,8 @@
 
 #include "libxl_internal.h"
 
+#include <xen/lib/x86/cpu-policy.h>
+
 int libxl__cpuid_policy_is_empty(libxl_cpuid_policy_list *pl)
 {
     return !libxl_cpuid_policy_list_length(pl);
@@ -61,7 +63,7 @@ void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl)
  * Used for the static structure describing all features.
  */
 struct cpuid_flags {
-    char* name;
+    const char *name;
     uint32_t leaf;
     uint32_t subleaf;
     int reg;
@@ -154,7 +156,19 @@ static int cpuid_add(libxl_cpuid_policy_list *policy,
     entry->policy[flag->reg - 1] = resstr;
 
     return 0;
+}
+
+struct feature_name {
+    const char *name;
+    unsigned int bit;
+};
+
+static int search_feature(const void *a, const void *b)
+{
+    const char *key = a;
+    const char *feat = ((const struct feature_name *)b)->name;
 
+    return strcmp(key, feat);
 }
 
 /* parse a single key=value pair and translate it into the libxc
@@ -177,208 +191,42 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
         {"proccount",    0x00000001, NA, CPUID_REG_EBX, 16,  8},
         {"localapicid",  0x00000001, NA, CPUID_REG_EBX, 24,  8},
 
-        {"sse3",         0x00000001, NA, CPUID_REG_ECX,  0,  1},
-        {"pclmulqdq",    0x00000001, NA, CPUID_REG_ECX,  1,  1},
-        {"dtes64",       0x00000001, NA, CPUID_REG_ECX,  2,  1},
-        {"monitor",      0x00000001, NA, CPUID_REG_ECX,  3,  1},
-        {"dscpl",        0x00000001, NA, CPUID_REG_ECX,  4,  1},
-        {"vmx",          0x00000001, NA, CPUID_REG_ECX,  5,  1},
-        {"smx",          0x00000001, NA, CPUID_REG_ECX,  6,  1},
         {"est",          0x00000001, NA, CPUID_REG_ECX,  7,  1},
-        {"tm2",          0x00000001, NA, CPUID_REG_ECX,  8,  1},
-        {"ssse3",        0x00000001, NA, CPUID_REG_ECX,  9,  1},
         {"cntxid",       0x00000001, NA, CPUID_REG_ECX, 10,  1},
-        {"fma",          0x00000001, NA, CPUID_REG_ECX, 12,  1},
         {"cmpxchg16",    0x00000001, NA, CPUID_REG_ECX, 13,  1},
-        {"xtpr",         0x00000001, NA, CPUID_REG_ECX, 14,  1},
-        {"pdcm",         0x00000001, NA, CPUID_REG_ECX, 15,  1},
-        {"pcid",         0x00000001, NA, CPUID_REG_ECX, 17,  1},
-        {"dca",          0x00000001, NA, CPUID_REG_ECX, 18,  1},
         /* Linux uses sse4_{1,2}.  Keep sse4.{1,2} for compatibility */
         {"sse4_1",       0x00000001, NA, CPUID_REG_ECX, 19,  1},
         {"sse4.1",       0x00000001, NA, CPUID_REG_ECX, 19,  1},
         {"sse4_2",       0x00000001, NA, CPUID_REG_ECX, 20,  1},
         {"sse4.2",       0x00000001, NA, CPUID_REG_ECX, 20,  1},
-        {"x2apic",       0x00000001, NA, CPUID_REG_ECX, 21,  1},
-        {"movbe",        0x00000001, NA, CPUID_REG_ECX, 22,  1},
-        {"popcnt",       0x00000001, NA, CPUID_REG_ECX, 23,  1},
-        {"tsc-deadline", 0x00000001, NA, CPUID_REG_ECX, 24,  1},
         {"aes",          0x00000001, NA, CPUID_REG_ECX, 25,  1},
-        {"xsave",        0x00000001, NA, CPUID_REG_ECX, 26,  1},
-        {"osxsave",      0x00000001, NA, CPUID_REG_ECX, 27,  1},
-        {"avx",          0x00000001, NA, CPUID_REG_ECX, 28,  1},
-        {"f16c",         0x00000001, NA, CPUID_REG_ECX, 29,  1},
-        {"rdrand",       0x00000001, NA, CPUID_REG_ECX, 30,  1},
-        {"hypervisor",   0x00000001, NA, CPUID_REG_ECX, 31,  1},
-
-        {"fpu",          0x00000001, NA, CPUID_REG_EDX,  0,  1},
-        {"vme",          0x00000001, NA, CPUID_REG_EDX,  1,  1},
-        {"de",           0x00000001, NA, CPUID_REG_EDX,  2,  1},
-        {"pse",          0x00000001, NA, CPUID_REG_EDX,  3,  1},
-        {"tsc",          0x00000001, NA, CPUID_REG_EDX,  4,  1},
-        {"msr",          0x00000001, NA, CPUID_REG_EDX,  5,  1},
-        {"pae",          0x00000001, NA, CPUID_REG_EDX,  6,  1},
-        {"mce",          0x00000001, NA, CPUID_REG_EDX,  7,  1},
+
         {"cmpxchg8",     0x00000001, NA, CPUID_REG_EDX,  8,  1},
-        {"apic",         0x00000001, NA, CPUID_REG_EDX,  9,  1},
         {"sysenter",     0x00000001, NA, CPUID_REG_EDX, 11,  1},
-        {"mtrr",         0x00000001, NA, CPUID_REG_EDX, 12,  1},
-        {"pge",          0x00000001, NA, CPUID_REG_EDX, 13,  1},
-        {"mca",          0x00000001, NA, CPUID_REG_EDX, 14,  1},
-        {"cmov",         0x00000001, NA, CPUID_REG_EDX, 15,  1},
-        {"pat",          0x00000001, NA, CPUID_REG_EDX, 16,  1},
-        {"pse36",        0x00000001, NA, CPUID_REG_EDX, 17,  1},
         {"psn",          0x00000001, NA, CPUID_REG_EDX, 18,  1},
         {"clfsh",        0x00000001, NA, CPUID_REG_EDX, 19,  1},
-        {"ds",           0x00000001, NA, CPUID_REG_EDX, 21,  1},
-        {"acpi",         0x00000001, NA, CPUID_REG_EDX, 22,  1},
-        {"mmx",          0x00000001, NA, CPUID_REG_EDX, 23,  1},
-        {"fxsr",         0x00000001, NA, CPUID_REG_EDX, 24,  1},
-        {"sse",          0x00000001, NA, CPUID_REG_EDX, 25,  1},
-        {"sse2",         0x00000001, NA, CPUID_REG_EDX, 26,  1},
-        {"ss",           0x00000001, NA, CPUID_REG_EDX, 27,  1},
-        {"htt",          0x00000001, NA, CPUID_REG_EDX, 28,  1},
         {"tm",           0x00000001, NA, CPUID_REG_EDX, 29,  1},
         {"ia64",         0x00000001, NA, CPUID_REG_EDX, 30,  1},
         {"pbe",          0x00000001, NA, CPUID_REG_EDX, 31,  1},
 
         {"arat",         0x00000006, NA, CPUID_REG_EAX,  2,  1},
 
-        {"fsgsbase",     0x00000007,  0, CPUID_REG_EBX,  0,  1},
         {"tsc_adjust",   0x00000007,  0, CPUID_REG_EBX,  1,  1},
-        {"bmi1",         0x00000007,  0, CPUID_REG_EBX,  3,  1},
-        {"hle",          0x00000007,  0, CPUID_REG_EBX,  4,  1},
-        {"avx2",         0x00000007,  0, CPUID_REG_EBX,  5,  1},
-        {"smep",         0x00000007,  0, CPUID_REG_EBX,  7,  1},
-        {"bmi2",         0x00000007,  0, CPUID_REG_EBX,  8,  1},
-        {"erms",         0x00000007,  0, CPUID_REG_EBX,  9,  1},
-        {"invpcid",      0x00000007,  0, CPUID_REG_EBX, 10,  1},
-        {"rtm",          0x00000007,  0, CPUID_REG_EBX, 11,  1},
         {"cmt",          0x00000007,  0, CPUID_REG_EBX, 12,  1},
-        {"mpx",          0x00000007,  0, CPUID_REG_EBX, 14,  1},
-        {"avx512f",      0x00000007,  0, CPUID_REG_EBX, 16,  1},
-        {"avx512dq",     0x00000007,  0, CPUID_REG_EBX, 17,  1},
-        {"rdseed",       0x00000007,  0, CPUID_REG_EBX, 18,  1},
-        {"adx",          0x00000007,  0, CPUID_REG_EBX, 19,  1},
-        {"smap",         0x00000007,  0, CPUID_REG_EBX, 20,  1},
-        {"avx512-ifma",  0x00000007,  0, CPUID_REG_EBX, 21,  1},
-        {"clflushopt",   0x00000007,  0, CPUID_REG_EBX, 23,  1},
-        {"clwb",         0x00000007,  0, CPUID_REG_EBX, 24,  1},
-        {"proc-trace",   0x00000007,  0, CPUID_REG_EBX, 25,  1},
-        {"avx512pf",     0x00000007,  0, CPUID_REG_EBX, 26,  1},
-        {"avx512er",     0x00000007,  0, CPUID_REG_EBX, 27,  1},
-        {"avx512cd",     0x00000007,  0, CPUID_REG_EBX, 28,  1},
-        {"sha",          0x00000007,  0, CPUID_REG_EBX, 29,  1},
-        {"avx512bw",     0x00000007,  0, CPUID_REG_EBX, 30,  1},
-        {"avx512vl",     0x00000007,  0, CPUID_REG_EBX, 31,  1},
-
-        {"prefetchwt1",  0x00000007,  0, CPUID_REG_ECX,  0,  1},
-        {"avx512-vbmi",  0x00000007,  0, CPUID_REG_ECX,  1,  1},
-        {"umip",         0x00000007,  0, CPUID_REG_ECX,  2,  1},
-        {"pku",          0x00000007,  0, CPUID_REG_ECX,  3,  1},
-        {"ospke",        0x00000007,  0, CPUID_REG_ECX,  4,  1},
-        {"avx512-vbmi2", 0x00000007,  0, CPUID_REG_ECX,  6,  1},
-        {"cet-ss",       0x00000007,  0, CPUID_REG_ECX,  7,  1},
-        {"gfni",         0x00000007,  0, CPUID_REG_ECX,  8,  1},
-        {"vaes",         0x00000007,  0, CPUID_REG_ECX,  9,  1},
-        {"vpclmulqdq",   0x00000007,  0, CPUID_REG_ECX, 10,  1},
-        {"avx512-vnni",  0x00000007,  0, CPUID_REG_ECX, 11,  1},
-        {"avx512-bitalg",0x00000007,  0, CPUID_REG_ECX, 12,  1},
-        {"avx512-vpopcntdq",0x00000007,0,CPUID_REG_ECX, 14,  1},
-        {"rdpid",        0x00000007,  0, CPUID_REG_ECX, 22,  1},
-        {"cldemote",     0x00000007,  0, CPUID_REG_ECX, 25,  1},
-        {"pks",          0x00000007,  0, CPUID_REG_ECX, 31,  1},
-
-        {"avx512-4vnniw",0x00000007,  0, CPUID_REG_EDX,  2,  1},
-        {"avx512-4fmaps",0x00000007,  0, CPUID_REG_EDX,  3,  1},
-        {"fsrm",         0x00000007,  0, CPUID_REG_EDX,  4,  1},
-        {"avx512-vp2intersect",0x00000007,0,CPUID_REG_EDX,8, 1},
-        {"srbds-ctrl",   0x00000007,  0, CPUID_REG_EDX,  9,  1},
-        {"md-clear",     0x00000007,  0, CPUID_REG_EDX, 10,  1},
-        {"serialize",    0x00000007,  0, CPUID_REG_EDX, 14,  1},
-        {"tsxldtrk",     0x00000007,  0, CPUID_REG_EDX, 16,  1},
-        {"cet-ibt",      0x00000007,  0, CPUID_REG_EDX, 20,  1},
-        {"avx512-fp16",  0x00000007,  0, CPUID_REG_EDX, 23,  1},
-        {"ibrsb",        0x00000007,  0, CPUID_REG_EDX, 26,  1},
-        {"stibp",        0x00000007,  0, CPUID_REG_EDX, 27,  1},
-        {"l1d-flush",    0x00000007,  0, CPUID_REG_EDX, 28,  1},
-        {"arch-caps",    0x00000007,  0, CPUID_REG_EDX, 29,  1},
-        {"core-caps",    0x00000007,  0, CPUID_REG_EDX, 30,  1},
-        {"ssbd",         0x00000007,  0, CPUID_REG_EDX, 31,  1},
-
-        {"avx-vnni",     0x00000007,  1, CPUID_REG_EAX,  4,  1},
-        {"avx512-bf16",  0x00000007,  1, CPUID_REG_EAX,  5,  1},
-        {"fzrm",         0x00000007,  1, CPUID_REG_EAX, 10,  1},
-        {"fsrs",         0x00000007,  1, CPUID_REG_EAX, 11,  1},
-        {"fsrcs",        0x00000007,  1, CPUID_REG_EAX, 12,  1},
-        {"wrmsrns",      0x00000007,  1, CPUID_REG_EAX, 19,  1},
-        {"avx-ifma",     0x00000007,  1, CPUID_REG_EAX, 23,  1},
-
-        {"avx-vnni-int8",0x00000007,  1, CPUID_REG_EDX,  4,  1},
-        {"avx-ne-convert",0x00000007, 1, CPUID_REG_EDX,  5,  1},
-        {"cet-sss",      0x00000007,  1, CPUID_REG_EDX, 18,  1},
-
-        {"intel-psfd",   0x00000007,  2, CPUID_REG_EDX,  0,  1},
-        {"ipred-ctrl",   0x00000007,  2, CPUID_REG_EDX,  1,  1},
-        {"rrsba-ctrl",   0x00000007,  2, CPUID_REG_EDX,  2,  1},
-        {"ddp-ctrl",     0x00000007,  2, CPUID_REG_EDX,  3,  1},
-        {"bhi-ctrl",     0x00000007,  2, CPUID_REG_EDX,  4,  1},
-        {"mcdt-no",      0x00000007,  2, CPUID_REG_EDX,  5,  1},
 
         {"lahfsahf",     0x80000001, NA, CPUID_REG_ECX,  0,  1},
         {"cmplegacy",    0x80000001, NA, CPUID_REG_ECX,  1,  1},
-        {"svm",          0x80000001, NA, CPUID_REG_ECX,  2,  1},
-        {"extapic",      0x80000001, NA, CPUID_REG_ECX,  3,  1},
         {"altmovcr8",    0x80000001, NA, CPUID_REG_ECX,  4,  1},
-        {"abm",          0x80000001, NA, CPUID_REG_ECX,  5,  1},
-        {"sse4a",        0x80000001, NA, CPUID_REG_ECX,  6,  1},
-        {"misalignsse",  0x80000001, NA, CPUID_REG_ECX,  7,  1},
-        {"3dnowprefetch",0x80000001, NA, CPUID_REG_ECX,  8,  1},
-        {"osvw",         0x80000001, NA, CPUID_REG_ECX,  9,  1},
-        {"ibs",          0x80000001, NA, CPUID_REG_ECX, 10,  1},
-        {"xop",          0x80000001, NA, CPUID_REG_ECX, 11,  1},
-        {"skinit",       0x80000001, NA, CPUID_REG_ECX, 12,  1},
-        {"wdt",          0x80000001, NA, CPUID_REG_ECX, 13,  1},
-        {"lwp",          0x80000001, NA, CPUID_REG_ECX, 15,  1},
-        {"fma4",         0x80000001, NA, CPUID_REG_ECX, 16,  1},
         {"nodeid",       0x80000001, NA, CPUID_REG_ECX, 19,  1},
-        {"tbm",          0x80000001, NA, CPUID_REG_ECX, 21,  1},
-        {"topoext",      0x80000001, NA, CPUID_REG_ECX, 22,  1},
         {"perfctr_core", 0x80000001, NA, CPUID_REG_ECX, 23,  1},
         {"perfctr_nb",   0x80000001, NA, CPUID_REG_ECX, 24,  1},
 
-        {"syscall",      0x80000001, NA, CPUID_REG_EDX, 11,  1},
-        {"nx",           0x80000001, NA, CPUID_REG_EDX, 20,  1},
-        {"mmxext",       0x80000001, NA, CPUID_REG_EDX, 22,  1},
-        {"ffxsr",        0x80000001, NA, CPUID_REG_EDX, 25,  1},
-        {"page1gb",      0x80000001, NA, CPUID_REG_EDX, 26,  1},
-        {"rdtscp",       0x80000001, NA, CPUID_REG_EDX, 27,  1},
-        {"lm",           0x80000001, NA, CPUID_REG_EDX, 29,  1},
-        {"3dnowext",     0x80000001, NA, CPUID_REG_EDX, 30,  1},
-        {"3dnow",        0x80000001, NA, CPUID_REG_EDX, 31,  1},
-
         {"procpkg",      0x00000004,  0, CPUID_REG_EAX, 26,  6},
 
         {"invtsc",       0x80000007, NA, CPUID_REG_EDX,  8,  1},
 
-        {"clzero",       0x80000008, NA, CPUID_REG_EBX,  0,  1},
-        {"rstr-fp-err-ptrs", 0x80000008, NA, CPUID_REG_EBX, 2, 1},
-        {"wbnoinvd",     0x80000008, NA, CPUID_REG_EBX,  9,  1},
-        {"ibpb",         0x80000008, NA, CPUID_REG_EBX, 12,  1},
-        {"ibrs",         0x80000008, NA, CPUID_REG_EBX, 14,  1},
-        {"amd-stibp",    0x80000008, NA, CPUID_REG_EBX, 15,  1},
-        {"ibrs-always",  0x80000008, NA, CPUID_REG_EBX, 16,  1},
-        {"stibp-always", 0x80000008, NA, CPUID_REG_EBX, 17,  1},
-        {"ibrs-fast",    0x80000008, NA, CPUID_REG_EBX, 18,  1},
-        {"ibrs-same-mode", 0x80000008, NA, CPUID_REG_EBX, 19,  1},
-        {"no-lmsl",      0x80000008, NA, CPUID_REG_EBX, 20,  1},
         {"ppin",         0x80000008, NA, CPUID_REG_EBX, 23,  1},
-        {"amd-ssbd",     0x80000008, NA, CPUID_REG_EBX, 24,  1},
-        {"virt-ssbd",    0x80000008, NA, CPUID_REG_EBX, 25,  1},
-        {"ssb-no",       0x80000008, NA, CPUID_REG_EBX, 26,  1},
-        {"psfd",         0x80000008, NA, CPUID_REG_EBX, 28,  1},
         {"btc-no",       0x80000008, NA, CPUID_REG_EBX, 29,  1},
-        {"ibpb-ret",     0x80000008, NA, CPUID_REG_EBX, 30,  1},
 
         {"nc",           0x80000008, NA, CPUID_REG_ECX,  0,  8},
         {"apicidsize",   0x80000008, NA, CPUID_REG_ECX, 12,  4},
@@ -392,17 +240,63 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
         {"svm_pausefilt",0x8000000a, NA, CPUID_REG_EDX, 10,  1},
 
         {"lfence+",      0x80000021, NA, CPUID_REG_EAX,  2,  1},
-        {"nscb",         0x80000021, NA, CPUID_REG_EAX,  6,  1},
-        {"auto-ibrs",    0x80000021, NA, CPUID_REG_EAX,  8,  1},
-        {"cpuid-user-dis", 0x80000021, NA, CPUID_REG_EAX, 17, 1},
 
         {"maxhvleaf",    0x40000000, NA, CPUID_REG_EAX,  0,  8},
 
         {NULL, 0, NA, CPUID_REG_INV, 0, 0}
     };
+    static const struct feature_name features[] = INIT_FEATURE_NAMES;
+    /*
+     * NB: if we switch to using a cpu_policy derived object instead of a
+     * libxl_cpuid_policy_list we could get rid of the featureset -> cpuid leaf
+     * conversion table and use a featureset directly as we have conversions
+     * to/from featureset and cpu_policy.
+     */
+    static const struct {
+        enum { FEAT_CPUID, FEAT_MSR } type;
+        union {
+            struct {
+                uint32_t leaf, subleaf;
+                unsigned int reg;
+            } cpuid;
+            struct {
+                uint32_t index;
+                unsigned int reg;
+            } msr;
+        };
+    } feature_to_policy[] = {
+#define CPUID_ENTRY(l, s, r) \
+    { .type = FEAT_CPUID, .cpuid.leaf = l, .cpuid.subleaf = s, .cpuid.reg = r }
+#define MSR_ENTRY(i, r) \
+    { .type = FEAT_MSR, .msr.index = i, .msr.reg = r }
+        CPUID_ENTRY(0x00000001, NA, CPUID_REG_EDX),
+        CPUID_ENTRY(0x00000001, NA, CPUID_REG_ECX),
+        CPUID_ENTRY(0x80000001, NA, CPUID_REG_EDX),
+        CPUID_ENTRY(0x80000001, NA, CPUID_REG_ECX),
+        CPUID_ENTRY(0x0000000D,  1, CPUID_REG_EAX),
+        CPUID_ENTRY(0x00000007,  0, CPUID_REG_EBX),
+        CPUID_ENTRY(0x00000007,  0, CPUID_REG_ECX),
+        CPUID_ENTRY(0x80000007, NA, CPUID_REG_EDX),
+        CPUID_ENTRY(0x80000008, NA, CPUID_REG_EBX),
+        CPUID_ENTRY(0x00000007,  0, CPUID_REG_EDX),
+        CPUID_ENTRY(0x00000007,  1, CPUID_REG_EAX),
+        CPUID_ENTRY(0x80000021, NA, CPUID_REG_EAX),
+        CPUID_ENTRY(0x00000007,  1, CPUID_REG_EBX),
+        CPUID_ENTRY(0x00000007,  2, CPUID_REG_EDX),
+        CPUID_ENTRY(0x00000007,  1, CPUID_REG_ECX),
+        CPUID_ENTRY(0x00000007,  1, CPUID_REG_EDX),
+        MSR_ENTRY(0x10a, CPUID_REG_EAX),
+        MSR_ENTRY(0x10a, CPUID_REG_EDX),
+#undef MSR_ENTRY
+#undef CPUID_ENTRY
+    };
 #undef NA
     const char *sep, *val;
+    char *name;
     const struct cpuid_flags *flag;
+    const struct feature_name *feat;
+
+    BUILD_BUG_ON(ARRAY_SIZE(feature_to_policy) != FEATURESET_NR_ENTRIES);
 
     sep = strchr(str, '=');
     if (sep == NULL) {
@@ -415,6 +309,37 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
             return cpuid_add(policy, flag, val);
     }
 
+    /* Provide a NUL terminated feature name to the search helper. */
+    name = strndup(str, sep - str);
+    if (name == NULL)
+        return ERROR_NOMEM;
+
+    feat = bsearch(name, features, ARRAY_SIZE(features), sizeof(features[0]),
+                   search_feature);
+    free(name);
+
+    if (feat == NULL)
+        return 2;
+
+    switch (feature_to_policy[feat->bit / 32].type) {
+    case FEAT_CPUID:
+    {
+        struct cpuid_flags f;
+
+        f.name = feat->name;
+        f.leaf = feature_to_policy[feat->bit / 32].cpuid.leaf;
+        f.subleaf = feature_to_policy[feat->bit / 32].cpuid.subleaf;
+        f.reg = feature_to_policy[feat->bit / 32].cpuid.reg;
+        f.bit = feat->bit % 32;
+        f.length = 1;
+
+        return cpuid_add(policy, &f, val);
+    }
+
+    case FEAT_MSR:
+        return 2;
+    }
+
     return 2;
 }
 
diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index f036e56fc239..7bf587455d08 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -2620,6 +2620,9 @@ skip_usbdev:
                 case 3:
                     errstr = "illegal CPUID value (must be: [0|1|x|k|s])";
                     break;
+                case ERROR_NOMEM:
+                    errstr = "out of memory";
+                    break;
                 default:
                     errstr = "unknown error";
                     break;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 11 09:25:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 09:25:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561670.878179 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9cY-0006KV-LW; Tue, 11 Jul 2023 09:25:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561670.878179; Tue, 11 Jul 2023 09:25:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9cY-0006KO-Hx; Tue, 11 Jul 2023 09:25:22 +0000
Received: by outflank-mailman (input) for mailman id 561670;
 Tue, 11 Jul 2023 09:25:21 +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
 <SRS0=rRYD=C5=citrix.com=prvs=54940d4e9=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qJ9cX-0005tR-4D
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 09:25:21 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d9930b5e-1fcc-11ee-8611-37d641c3527e;
 Tue, 11 Jul 2023 11:25:19 +0200 (CEST)
Received: from mail-dm6nam12lp2173.outbound.protection.outlook.com (HELO
 NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.173])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 11 Jul 2023 05:25:13 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SA3PR03MB7465.namprd03.prod.outlook.com (2603:10b6:806:39d::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul
 2023 09:25:11 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2%5]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023
 09:25:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d9930b5e-1fcc-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689067519;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=zcBQQHuX69ZClb6ynraVcgSiCzPG8VCSbHtg2XmHXBM=;
  b=UVCW8ESbpVxrUPQvxtMFVAG30+U0zuxnISB4qpN4HPZyMhIfOXLcaNza
   +aCI1dQnVbTHMsGpQVH8GfsKZ5RfRKhD3s/n5ir1V9g78GrDAVwlaotCW
   28eDa7QGdnU6SMJXlLUVtFhZaMtcJHJm3Caeh8qCyKEIp89NKFcSZIMAt
   0=;
X-IronPort-RemoteIP: 104.47.59.173
X-IronPort-MID: 118383217
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELA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bOrJwrO8gd6VbTG19QYdceloAZsQnzuQEmygYzRLrJEtP+tFKH
 KbjPA33waISDAsQemQIGIKZOTHr82jruObXfZXbyRXkzVnlFmTmcTHLyQ=
X-Talos-CUID: =?us-ascii?q?9a23=3AUeHprGgErCFVQs3SnRrSqHzDLTJuX1vh8VXXCFa?=
 =?us-ascii?q?ECkV1ZabNR3StprNCqp87?=
X-Talos-MUID: 9a23:hv29Hgbiag4ElOBTj2HdhR49DoRT24uMLUAKkMUE+OSnOnkl
X-IronPort-AV: E=Sophos;i="6.01,196,1684814400"; 
   d="scan'208";a="118383217"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=V9je+inFL8aJOQP1MpEy2u8Nulzg2ND7kkchoNN5ipebuf0nsrNqUWsYhWe6bajWTEoQ8s7X7SZ5G1hIJ4wK5+B3YLhahIf1+KhlOmhV9/Jb+GS9L/Hiu7H5MqTW3OK3eBEXXvmvXdaOXz3EoA6+PqQEVMHhm38Hd9MBYxZLLRzh/MKQjvFDA0xw4rdetVlVhIZDry+vHjz99fu5QgcrLsmyBJRZ+BjkA3gKtAk2hPeeB9IZQZAFgW+skx0zorfItoSHQV9Zo8bvkBJ5vUResYUHbodVHWXHGFhw5sByC1x4Z1PuCkXUKA5jFm5DG+yajvvceASPUZQYWl/Xro4www==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4uHuVNwA5xpYjOyrRWFL+DwpVoS0En8vtpwS2o709gg=;
 b=BH4W3RvOsH3yoJlC6r1zDDrqUt3uZ8ltUeSw3uB6hPVAvL41hki+pw3y07nHz2Jegbd5ZamZZyFOTUAq7Spk6fPIy7n1paqibw/zBkX2s4AD57yJ2Z86Y5nyP/Mi/3uZFNZTzVEFq55n/2H0KyuZhRf7MYGctQvpsugsDU2uDIruBjVRMwWB6kXMerI+8bZueIY0Qmkg2TCBCT9SmkvWuUzus28+MzvGit3vCccBP+KIQfCFGE1Ms3su8EoBfG7nV/e5d8iI68dM4ILwpMAuswQU05JUeeYKjUYTOQb+MgZf+mdfAcXniwMt568tfZDsHf8oYSoY5IoEUpsxtd3q3Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4uHuVNwA5xpYjOyrRWFL+DwpVoS0En8vtpwS2o709gg=;
 b=HsNWrxQv6ABUDYI3neD1u7SwfvL48Q+PRWvxUmivNAnxfqLRgZ1W9H7nELRSawsj99WI94QPnKa7KFegYGn3VDlchroCL0WiHiDLBXg/dbDxve6OCz/b9bgTqIbPzq1Rx21BGmFu0LHH5ky6Ao5IWwkYtiRIyuIgQ/JrmBv1Ang=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v2 6/6] libxl: add support for parsing MSR features
Date: Tue, 11 Jul 2023 11:22:30 +0200
Message-ID: <20230711092230.15408-7-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230711092230.15408-1-roger.pau@citrix.com>
References: <20230711092230.15408-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P265CA0255.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:8a::27) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA3PR03MB7465:EE_
X-MS-Office365-Filtering-Correlation-Id: 4f4bfbb4-e930-4c7a-4de7-08db81f0b9e2
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	+vFeM/qHTEkffKKEdmWTh8k1WVMoumP7dsf34LxaHCpWKMAK/RxPEDRmlsjmoRMyGW1JKsUcjFAKxIY3LRZMvfm152N8tNsfNnsP4NcpR0CKaFiz6aARvL8j6IPbz9W/E1yvKIcg/3YymCktX6J5RWY7nNxxXHgbXKFtkJSLwBqjGFuGu/Y4+CTs6AtWBvvFSUhXV7yncoyL1c9ZbbwM7gwQxRouvsiN1rZjs8fbjS1Ct7puONpci9G75qdIQtAjvH+38KXfiLgXa/js/uweB/cF5GJphzKepyMK1wyFZvIXGyR4YnRrZ4leQSTCD/cKRufGcQPKa6n0USld84DtVJQ+2HBCoSOCwgBqjePlJDBG04nNGZKmpJTcAKfKxhTmEDo/lmd+9y/nVkqowE+/TzUZOl+YoPEFKnLUtpmDoJr+1jBY6GP85VyYKMihfYXOL4MNDjCwHyNjwYIx2G8q1fayBNBItTqORSLjsex8yPXtnIQCYaqoSCU0mhacC+b3fSJvHPD73JaQ2HIuy1bHgwdwkgSj2KU49Rz9xzopF81BBujNB8r2kiZ/e6rjVAo5
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(136003)(366004)(39860400002)(376002)(451199021)(38100700002)(86362001)(36756003)(6666004)(6486002)(54906003)(82960400001)(2616005)(26005)(1076003)(186003)(6506007)(6512007)(478600001)(316002)(66556008)(5660300002)(6916009)(66946007)(66476007)(8936002)(8676002)(2906002)(83380400001)(4326008)(41300700001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VjJmd0NMTHJmVUg2RHRERTFzT1F0ZjBJbGhRdnhZVHAwUXQrWm5sWHBOQlEz?=
 =?utf-8?B?ZGdVeXdabHBUSUZYOEdjbStodmZKQkF2SGM0QkdHcTdCWnNjcC9FYlYrd3l5?=
 =?utf-8?B?M0JYSTVpVDFNRTBCTWJnd3p0RVd4czlRbVRUNkxuWUpXQ1M5TmhQaEVwbXg1?=
 =?utf-8?B?NnFEUHA1RG10VlV5bi96YTVuWWpyTy9oN2N0b2sxRGVjNVRGOFgxejJMejBh?=
 =?utf-8?B?MUp3Tm1IYnVWVUo0dHUreitPNjlTeDJIcjZuQ1FobGJMNzZOcXhXTWNURGhu?=
 =?utf-8?B?SEh4clptVGR3YStaMk1NWWxNT2szWFZjbUw2dUIrQ3hna2x5YjlSQ3VKZWJX?=
 =?utf-8?B?VnZxaWErTVJMWmNNSkw4c3h6R3RjRWtYRjlKaSt3WWplUVdOUFkrUUlITVpv?=
 =?utf-8?B?N0VBbHJjdWdJRXpRTm5qWGVxWDFYYTRXaVdYOSttZmx2S21wa0VtNXdhM2hs?=
 =?utf-8?B?TEJlZnNJUEVJVkFhTzZEd2MrR3RJV3hoclZudkF2UExlQ2VDa0szdGdybEhD?=
 =?utf-8?B?U2RSUHZ1QjVkRTJGdzJmajE0a1pEc3VENytrN0l6UXpCYXdOOFBnQ29OME9n?=
 =?utf-8?B?bk11dVdtL2tuV0h3OWtXZzd5VDI5MWNsdDU5b092N2c5S1NhM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GC5esfhpGmkIb21YIA2LVrWu03moH6vRvbGI2T0YOsdL9SgYyL2EIRC9r9IW1YQ3EvNDQP+3r9UqUEAS7ai5/m5bLHdv6qINREWI4PMK0yJZiz7CAis7mFkK/I+kF5bk/K05lHiAbhXDy2hzE5IFd15nCxFZywhP+LTqMFDOzcxRX4HMb/9KpXG1g8AjdZb7RdBwjNUUKhRYuMwcWVK3PgMOygZpMXhjKEAg0YSWxN13VgdFSxTiKJkPNJDV/ls45g2pSj2AlPiVrwzkjCIqgYKA9Zr6R/0V+dUM/cCN4dO3+w6ofTpZqGzBGqDqATujEDxKx6w1wh9mxPj34FFSU/7d3g4vfEmCPMAV2fhM4N1WxMJermOCHYTnt6ARH118gwq30vgrMKE8jkqZ2SvI3VR+5+X/8i6zajKHK1+yV8nhliX8tVplXbKVVUDznTpIBce17st+hY+8l6ZCPqD8HTYFuTZBmEtXqPOqDLCPZ2NTCyb58WA1mEc5Zv8LqZu4mi/0gHL78EJJqNRl1TkIjBo/DojERSHRxuwswISy0Zur+G+2JTByEa3puOgKUWtgqH/xZ+NBepJeKrAUtyFCwru3CbVJggshLAvypLSkIg+094xAkBmeQgVeQL2sCOicXYL5hIStlKGeaFbk
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4f4bfbb4-e930-4c7a-4de7-08db81f0b9e2
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 09:25:11.6152
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 963P+Oblz+m//J6WELeVkKneosEKZCyPiIfnF8tAnJ5IFdukcoUl0ODEi9LT3i7FYBkwcPT3PMONFN9Y6v1KQg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR03MB7465

Introduce support for handling MSR features in
libxl_cpuid_parse_config().  The MSR policies are added to the
libxl_cpuid_policy like the CPUID one, which gets passed to
xc_cpuid_apply_policy().

This allows existing users of libxl to provide MSR related features as
key=value pairs to libxl_cpuid_parse_config() without requiring the
usage of a different API.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
 tools/libs/light/libxl_cpuid.c | 61 +++++++++++++++++++++++++++++++++-
 1 file changed, 60 insertions(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index b1c4f8f2f45b..86a08f29a19c 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -158,6 +158,57 @@ static int cpuid_add(libxl_cpuid_policy_list *policy,
     return 0;
 }
 
+static struct xc_msr *msr_find_match(libxl_cpuid_policy_list *pl, uint32_t index)
+{
+    unsigned int i = 0;
+    libxl_cpuid_policy_list policy = *pl;
+
+    if (policy == NULL)
+        policy = *pl = calloc(1, sizeof(*policy));
+
+    if (policy->msr != NULL)
+        for (i = 0; policy->msr[i].index != XC_MSR_INPUT_UNUSED; i++)
+            if (policy->msr[i].index == index)
+                return &policy->msr[i];
+
+    policy->msr = realloc(policy->msr, sizeof(struct xc_msr) * (i + 2));
+    policy->msr[i].index = index;
+    memset(policy->msr[i].policy, 'x', ARRAY_SIZE(policy->msr[0].policy) - 1);
+    policy->msr[i].policy[ARRAY_SIZE(policy->msr[0].policy) - 1] = '\0';
+    policy->msr[i + 1].index = XC_MSR_INPUT_UNUSED;
+
+    return &policy->msr[i];
+}
+
+static int msr_add(libxl_cpuid_policy_list *policy, uint32_t index, unsigned int bit,
+                   const char *val)
+{
+    struct xc_msr *entry = msr_find_match(policy, index);
+
+    /* Only allow options taking a character for MSRs, no values allowed. */
+    if (strlen(val) != 1)
+        return 3;
+
+    switch (val[0]) {
+    case '0':
+    case '1':
+    case 'x':
+    case 'k':
+        entry->policy[63 - bit] = val[0];
+        break;
+
+    case 's':
+        /* Translate s -> k as xc_msr doesn't support the deprecated 's'. */
+        entry->policy[63 - bit] = 'k';
+        break;
+
+    default:
+        return 3;
+    }
+
+    return 0;
+}
+
 struct feature_name {
     const char *name;
     unsigned int bit;
@@ -337,7 +388,15 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
     }
 
     case FEAT_MSR:
-        return 2;
+    {
+        unsigned int bit = feat->bit % 32;
+
+        if (feature_to_policy[feat->bit / 32].msr.reg == CPUID_REG_EDX)
+            bit += 32;
+
+        return msr_add(policy, feature_to_policy[feat->bit / 32].msr.index,
+                       bit, val);
+    }
     }
 
     return 2;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 11 09:27:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 09:27:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561683.878189 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9e8-0007dR-0x; Tue, 11 Jul 2023 09:27:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561683.878189; Tue, 11 Jul 2023 09:27:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9e7-0007dK-UU; Tue, 11 Jul 2023 09:26:59 +0000
Received: by outflank-mailman (input) for mailman id 561683;
 Tue, 11 Jul 2023 09:26:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pXgh=C5=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qJ9e7-0007bz-3B
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 09:26:59 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0622.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::622])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1466df2a-1fcd-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 11:26:57 +0200 (CEST)
Received: from DUZPR01CA0308.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4ba::19) by AS8PR08MB9266.eurprd08.prod.outlook.com
 (2603:10a6:20b:5a2::16) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul
 2023 09:26:54 +0000
Received: from DBAEUR03FT059.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4ba:cafe::83) by DUZPR01CA0308.outlook.office365.com
 (2603:10a6:10:4ba::19) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31 via Frontend
 Transport; Tue, 11 Jul 2023 09:26:54 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT059.mail.protection.outlook.com (100.127.142.102) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.20 via Frontend Transport; Tue, 11 Jul 2023 09:26:54 +0000
Received: ("Tessian outbound f5de790fcf89:v145");
 Tue, 11 Jul 2023 09:26:54 +0000
Received: from 7a6bdbe08651.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 22117FDF-E9C1-4611-9283-0CD70D59C634.1; 
 Tue, 11 Jul 2023 09:26:42 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 7a6bdbe08651.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 11 Jul 2023 09:26:42 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by DU0PR08MB8709.eurprd08.prod.outlook.com (2603:10a6:10:403::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul
 2023 09:26:41 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::eaec:5611:c427:57f7]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::eaec:5611:c427:57f7%4]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023
 09:26:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1466df2a-1fcd-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=CmPrWpP8E0VQmsh7J62o3XXi9X7B1nKDIKnDqgD7U18=;
 b=dRevk73drZWE+9s0HwQaj9XazORuBpqspXpZlb49wUpHzZWkNDBBaF1PSp13HyxixEsGUJJS7Bqd/PxI6/5tNYoqXBg524VRvS/jPlZQODieAQw55VLLpD6Md836X2FcJO1TMEdt6tEGsxsJzCVmoMiozF5k4NAI/KrEmFpaeFY=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 16dd457d6eaf25bc
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=SGTjlpARXJkYqYDmy5ny8ldXDz0b0/Wiw/Xf2/anIeZLhQ+w+d1CYJdomf8pCHoTR31cYgzT3RDFeDFOMF7HtwfLLySTFq36PZZdlR0U3q4e+XOY0inCzSW9Bmqj8aGOGrlCoNfuqkNue8Bb/OuGw7mpg1EvSVD3965BcucUVzMKLFue9eHBiGetjcJRcyJSCSJ0qrwEqZJAdIpZlMJouI0o0rxBM3b4aONSv7oBTCjbH3V83VUNYfbqBw0sECcq+PDnITo/3iLf97Y0A3f8Q+Rrny6nw3mCT6t73V50oNNDzqieJuyvQy2W6DYU9Sgxpu/hupi01vAchRw3mA9XOQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=CmPrWpP8E0VQmsh7J62o3XXi9X7B1nKDIKnDqgD7U18=;
 b=kMoj3PmMECQ3YUlmnzOuuHxP868G/kUuNy1QLItAcwE7P/+RRF810CYFAEp86fW+QbRg9jTbxw/ryiGZUYtPr+0EAKF6cZT8BwRGpAmlVzA+0zQbb4F2Rs5E+AzCFFgmR0HkOMKlS2NaaVn96WwNwK7dzCRqNKNIL7VDkFjP8KpOSsdepbEczFYBIDjhfxtSL6lJEO4y77hL6T7BW2VeJmqQMXWjPAvPsFMOB8kDaWUN/ox49IfgLceZ2Nwau8fL0Tf8CJ4bnuEVhLhcMMxVe9XY31imsYczBV2eFdRvby4JmA7amZelLmYT+/SllvCNmR+IsPYzQiwslAt+Vi5yzQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=CmPrWpP8E0VQmsh7J62o3XXi9X7B1nKDIKnDqgD7U18=;
 b=dRevk73drZWE+9s0HwQaj9XazORuBpqspXpZlb49wUpHzZWkNDBBaF1PSp13HyxixEsGUJJS7Bqd/PxI6/5tNYoqXBg524VRvS/jPlZQODieAQw55VLLpD6Md836X2FcJO1TMEdt6tEGsxsJzCVmoMiozF5k4NAI/KrEmFpaeFY=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Stefano Stabellini <sstabellini@kernel.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Jan Beulich
	<jbeulich@suse.com>, "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
	"roger.pau@citrix.com" <roger.pau@citrix.com>, "julien@xen.org"
	<julien@xen.org>, "george.dunlap@citrix.com" <george.dunlap@citrix.com>,
	Bertrand Marquis <Bertrand.Marquis@arm.com>, Stefano Stabellini
	<stefano.stabellini@amd.com>
Subject: Re: [PATCH v2] docs/misra: add Rule 7.4 and 9.4
Thread-Topic: [PATCH v2] docs/misra: add Rule 7.4 and 9.4
Thread-Index: AQHZs20uf0QgTgVHRk6JBQcFLVos0a+0TLIA
Date: Tue, 11 Jul 2023 09:26:40 +0000
Message-ID: <C67A4472-E79B-4902-879D-29E3E86D6305@arm.com>
References: <20230710202835.2052428-1-sstabellini@kernel.org>
In-Reply-To: <20230710202835.2052428-1-sstabellini@kernel.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|DU0PR08MB8709:EE_|DBAEUR03FT059:EE_|AS8PR08MB9266:EE_
X-MS-Office365-Filtering-Correlation-Id: 78640724-054a-4f44-5390-08db81f0f749
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 59tQ7U9QKesImr/avDNA6NBoQk5rM0D2lKkQyQAVuBIJjL6fzoKpPzTBB3D81wD4SK8Sx+oPfajA91zdy4l1oNvml3fG8W2ii4KWQxXu38T/BKvU/htZS0YoF9km3r85TwkFYlQuWDu57D7d+A4idyzE8kvSlQAGTTKH1x/+E+NQUlls+4jnVL9dCiBAM/cd9RRSynBMkY7iEVdm+fUeT7zcQHaTcG4iIC+MeB9WLZWvjd6wZeVIzI5fz8Cgl/4SOdNOvrd2gykUQAIX+4bhLOvDFryg8oYkbYzDRONDFJVxOhoxAY+qmc9Bh9g0NnG18s0vtWkyuPJQRCqwJXGuNBEuVfrSPo1xag5B2uKM/YUxMsnUaWxOE+XvSRjXo47ep/Vg5WNYN2cZerZiDdM0xf/sz/PRQnoDX/ia6NXTOAJgC3/ISLf6dTUZAZKonQhlkUE/LXhQJe/OnvB181AMBPvRUmN8xT67UkCOPwysLdfmMRVedOUjbQVGrhbUKfxOimF4zflVdUQq+5DaT25avAeoCCLBSlm3ISD3Nc53vvRFK1R2A1S5bUFXxAzYFEmc3fxmYfbi5/uoRQWlRqrA6joWkwBWvWHVcHVznp8oaLKbOGjnOK7bn3NhqwEjlZFzDU8sl2Un3o3JjahgsmxhI+RN/BfsYYU13eU50Oo5iFgJONq3ftw8E+RrcWuUJUiy
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(136003)(346002)(396003)(366004)(451199021)(186003)(6506007)(26005)(2616005)(53546011)(6512007)(83380400001)(64756008)(66446008)(41300700001)(4326008)(6916009)(478600001)(66556008)(316002)(2906002)(5660300002)(8676002)(66476007)(66946007)(8936002)(6486002)(54906003)(76116006)(91956017)(71200400001)(33656002)(36756003)(122000001)(38100700002)(86362001)(38070700005)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <24441FEFFC0C87448C9BD4150F23BFD8@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8709
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT059.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	c6483fc7-4b12-4064-9644-08db81f0ef31
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	eN1Z5ZDLtrtg0HT6vJS2oODINk5AyP0xwvX/vPJd1cNMQx/1BkmZQuMB8UX3PESjq48ruOo/E1RXj3UAS4m87NXmmKbXtsGpVknDMEgWrdbyKG83ZwDmedqXWrK539cB8wVsulFKmocpTgjhS1lypOb7DaTUnmbsOcQ7Ux+hwQ6YveLqHAMuDEEmWDr/WE7tzvl2hAW+CPc4IzwBZ382XNxVIgyhfXFOl3djUym94EUyoFccBGAcA9Z+vp8npZlOATWOOJPaBK3XoVdF5D2AfgKK4pY40DT1A+GJh0TS6hfMGiZVb5zi4gkH9gF3OhZX6KoR7oVySRq7WNCvOMa+Xfm+W0j7CWU6QtHgxnvjx1MTHrhUQbOMh/xlHoMjOGbubyLtFEhrOtO0cGdEF6sM/7fTFfK/CzelWhu2vZOcOdVFbr1gBhp0rA41472j1fLL//MNJVMtnPwjno32kv1gWhBxR95fbLPOC1zpW7uj27hGZoAGdlCRRiWQbm5GZEH5+onGPfYKrNPBGj7UdL768dtaneEdeTUip5Tz6JXhiDHNqPox95/oBiFfVVEizBASLkfLPnlhiDpnwu77rji1CTgg17eHCa9CADKg+6WrQgxYSU1lVSNn79LNmT0HnttWj5n2jJuWrLML8o5H9zs/TvGxqxmQaq1DEWuAw8DP4BNOPxe5yye3bkDa8BhAMaXCSluNNJkzfBIAw1RBEm5UfB3qml8+NLfCLJGH57vjKU5JwzKwZtlDiumG9T0RkZUqb0PSNzxmIW8KFFzyTjFrLw==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(136003)(376002)(396003)(451199021)(40470700004)(36840700001)(46966006)(53546011)(6506007)(336012)(36860700001)(41300700001)(26005)(6512007)(83380400001)(47076005)(186003)(2616005)(478600001)(81166007)(356005)(82740400003)(54906003)(6486002)(40460700003)(4326008)(40480700001)(70206006)(70586007)(316002)(86362001)(33656002)(82310400005)(8936002)(5660300002)(8676002)(6862004)(2906002)(36756003);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 09:26:54.3500
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 78640724-054a-4f44-5390-08db81f0f749
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT059.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9266

DQoNCj4gT24gMTAgSnVsIDIwMjMsIGF0IDIxOjI4LCBTdGVmYW5vIFN0YWJlbGxpbmkgPHNzdGFi
ZWxsaW5pQGtlcm5lbC5vcmc+IHdyb3RlOg0KPiANCj4gRnJvbTogU3RlZmFubyBTdGFiZWxsaW5p
IDxzdGVmYW5vLnN0YWJlbGxpbmlAYW1kLmNvbT4NCj4gDQo+IFJ1bGUgOS40IGlzIG5vbi1jb250
cm92ZXJzaWFsIGFuZCB3ZSBoYXZlIG5vIHZpb2xhdGlvbnMuDQo+IA0KPiBSdWxlIDcuNCBpcyBj
b25zaWRlcmVkIGEgZ29vZCBpZGVhIHdpdGggdGhlIGNhdmVhdCB0aGF0IGFzc2lnbmluZyBhDQo+
IHN0cmluZyBsaXRlcmFsIHRvIGNvbnN0IHZvaWQgaXMgYWxsb3dlZC4gSSBhZGRlZCBhIG5vdGUg
dG8gc3BlY2lmeSBpdC4NCj4gDQo+IFNpZ25lZC1vZmYtYnk6IFN0ZWZhbm8gU3RhYmVsbGluaSA8
c3RlZmFuby5zdGFiZWxsaW5pQGFtZC5jb20+DQo+IC0tLQ0KPiBDaGFuZ2VzIGluIHYyOg0KPiAt
IGltcHJvdmUgcnVsZ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l0ZS8tL2Jsb2IvbWFz
dGVyL1JfMTJfMDUuYz5gXw0KPiAgICAgIC0gTWFuZGF0b3J5DQo+ICAgICAgLSBUaGUgc2l6ZW9m
IG9wZXJhdG9yIHNoYWxsIG5vdCBoYXZlIGFuIG9wZXJhbmQgd2hpY2ggaXMgYSBmdW5jdGlvbg0K
PiAtLSANCj4gMi4yNS4xDQo+IA0KPiANCg0KQXBhcnQgZnJvbSB0aGF0LCBJ4oCZdmUgdXNlZCB0
aGUgZmlsZSB3aXRoIG91ciBzY3JpcHQgdG8gaW1wb3J0IHRoZSBydWxlcyBhbmQgaXQgd29ya2Vk
Lg0KDQpSZXZpZXdlZC1ieTogTHVjYSBGYW5jZWxsdSA8bHVjYS5mYW5jZWxsdUBhcm0uY29tPg0K
DQoNCg0K


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 09:36:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 09:36:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561697.878199 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9mf-0000qh-SO; Tue, 11 Jul 2023 09:35:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561697.878199; Tue, 11 Jul 2023 09:35:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9mf-0000qa-P5; Tue, 11 Jul 2023 09:35:49 +0000
Received: by outflank-mailman (input) for mailman id 561697;
 Tue, 11 Jul 2023 09:35:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=B4LE=C5=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJ9me-0000qU-Gk
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 09:35:48 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2062d.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::62d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5089fd09-1fce-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 11:35:47 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS5PR04MB9771.eurprd04.prod.outlook.com (2603:10a6:20b:650::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Tue, 11 Jul
 2023 09:35:45 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Tue, 11 Jul 2023
 09:35:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5089fd09-1fce-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=DziXQ+Vctnn3LkJ8lGZErz2d/mQcoMzzT0gSpS02/PIbjCFO1WO+LBBCsNI7/a+7cGE5IaeVJgkzy5BK1LNLxu04reb/6Jqr7Kg997dzsPaclbup++7VRHDLFvqPoEseYW8K9WWq3SO0vNMpehYPwjMi0o+TQDOIelBwsUXayKXmBg8N40MwOiY9kLz6VMXLcRVg5R1UTM2ciWuPpaTyawpJKN3nMD0zEMcc04gFHCZrtdgL0W/3iu5vjp/LEr8TCAAW+cCXr2C7ZMSpXGE5RfOPbzPuZshrUCiEbO6owsZCwhxKAFN092Dxd5b9kVjiUnai8y5h3YV0/6B283If5A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5uTfHd6IFNTWnFw2xxzravZEVHJIH7EqQR9Z0POfHU4=;
 b=fU5IeuoIqVZrmo7m/1Msjw7IBPPA/60SajxYrbDEpMoyiwBXyRFwvdnfi53tMoHk9wJwgrEyROjfuMFitWYtoprDUmJ9WvrxigZj0TMcrarEuTeAUdr6kRuXaNjF9LPAtDyjg9d9J6wZ17TVuGCnNPPSl5ADRDfRjpmXyzH3Zayhif0nBkuGWRyyjtgqyWUc+eFYVN5pD+AZvFrz2zf26WYoPOVDsafsJO1PlQ4o64CHUQ5uIWXYLUI1NXgEAefoQ4AU1O42zXABtSLMvuYvx/X1NqXuZL3/+jA4Exis2fD2jYVfVzL/EDiUc2JE1c7hFV0ye+sdseUuCac/pdbVAQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5uTfHd6IFNTWnFw2xxzravZEVHJIH7EqQR9Z0POfHU4=;
 b=MVqHcyR98+8LWiKfRuCyamZhgp1t0hbaLQlrOxX1sPkKMViOHe6RUvhRDH6S3WB2EoF6GccOxD9veF2pIgHNF5ahmRY9QvGLLqCbiPN1tKP/MbmZJTMFTYxoZDBGAnrnhbb6J3whMp451Ar1L26rOUisoSysfc/9A1cFQzj1glu2bUAJcR4aB1gvcYmHWiBH2xKj4lgEARZof7DLjNWNo9ZELCC7FZnjAJ7pAmz9sKgp8BzZ66KEMPD+pFrI5CnnYKRGXdXIJd6iEHlyq/I/0tt2KhU8VVqyhuGnI4Wr1L1gNvSL4eW/leVBvE8eA8uSpHvCoeuy9pZbnHeU9JxCkw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <40fbc253-745e-4c0e-4f2c-702eb007bbe9@suse.com>
Date: Tue, 11 Jul 2023 11:35:43 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] x86/emul: fix violations of MISRA C:2012 Rule 8.3 on
 parameter names
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <149e5516d0db712916912fce8ab9c8285023e7c8.1688997768.git.federico.serafini@bugseng.com>
 <alpine.DEB.2.22.394.2307101408390.761183@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307101408390.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0048.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:92::19) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS5PR04MB9771:EE_
X-MS-Office365-Filtering-Correlation-Id: 87a5b20b-fd36-4396-755d-08db81f233c6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	668HCM/syeX2gTPhRxblESanFiU//Io6w/FW8fDGPovUON/+bAqlrr1XHezNjWBXBJwNGBR5ch64nxwhRhlredKfQMqy9a15ei1uSlkz805Q+56gp7P8AmVSXz5vcTM88T+F8P5ftgMCI+9J3/AizriiRqMPC0Ln9SVIthf1goTNxhaYgRSuxKS45xC+p0Z2+K4XW2yhawsRlt7akeeU1+U7bCvY6KIz+2qysVpnERvbMOXN1QdDe/PGey0nv+IrYFhPvDCA7gyO7J8Qq/MtE5xIDPx56gHuX27B9gKqOk1ZeGqF7rCeHpZXniCv6Yt33ueCl9JMIWTIdgm8qdyGKvHV616xy5jC0R1SB9QA2ZZUZpJDRCS1JMcb8XDn/FTLIOj4GOT/QOTNAaTaKB2+yWT4oQv7yFmXLX+/u/O5SxV1qdpMWwnJQnzUoLtMGtLmKbyMf+bKOTp8fojI65IK4neoMpw9nfuG4rBgsf6Kj7CDjWubmoWAPfT/XKwVLV/fYg8RTjMGG8Ipewi3BD/5jlRHdvMHapeZKv89s2xUNm2bN42vwL1EeWawTnVJnwwVCM7v9Ju4rnVDdTf81Hj+RzkovOu+3a+PHETZFFa0z9Y3IWgtzPxe4uCawRHnMApWfxeIoQfjhg0WXnzB7PU8qQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(39860400002)(376002)(366004)(396003)(136003)(451199021)(31696002)(53546011)(6506007)(41300700001)(26005)(6512007)(31686004)(186003)(2616005)(478600001)(54906003)(6486002)(4326008)(6916009)(66556008)(66476007)(38100700002)(66946007)(316002)(7416002)(86362001)(5660300002)(8676002)(8936002)(4744005)(36756003)(2906002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YXFwUjNWb1NLdDRyaWJwcTNOdEZmNXJFczZjNUhJcGRjc0hlQUZUSENLWGhr?=
 =?utf-8?B?OGJyOE1CT2hGcG5vVnVMQzd4elI3WTk5cnoweDJxNUQydFRRZUxnY0o3R2sv?=
 =?utf-8?B?eDJNK2gxOFRHbVJhVnV4TlBVTDRiYkNhaWtac0hwNUlJYnEzL0VhT09NWldn?=
 =?utf-8?B?clJ2SWRDQUdlZWMrY3dmU2UzODBGY3JSdHIrajhmV3FxS1pEUzN0Q09XMFk2?=
 =?utf-8?B?cFhab3NsdE43SUZ5MUQ3cG0zYXhzdW5SODFvbUt3dWlmREdXeVdKRWJ5WW9S?=
 =?utf-8?B?RTJRelhRN3lwa1YvYncwU0tUM0p1Z1J5RVJVdC9zbjhzc3dlcTZ5Q2I0R1pP?=
 =?utf-8?B?ejh5c2h6SVFUaUoxTld1YUlsY1A2K2Y3OTg1cEJqOHBMaEJKK1A0ZElDYkdm?=
 =?utf-8?B?R3JNQTR5b1JXYUR6WFdsbnRqWnZUdTd4bmlDVFZ0NmZHdWhYcGcrZDYwM2xH?=
 =?utf-8?B?VmVYOUpIY3JDY2ZsWGc0RGlzeE9KV082N2lsRDREekh6cDJpbG9aeExUSks0?=
 =?utf-8?B?OUcyc25QVVhQRjNiM1pUanc5VkYxTUV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J?=
 =?utf-8?B?a1RlSFJCaWNuekdxTDEzVUMrNkkwMlJ0U1kyMTZhQmJFeFloaWNBRTFZWFJP?=
 =?utf-8?B?cTVNdDgwV0g5WGNQRDM1YWxWZTd6Tktyb3JOVGdQeS9uRUxMZ2R5TFRSWG0z?=
 =?utf-8?B?ZGI3VHU3d25nMzBKZnF4bHhjS2NMenRMQkJ4NERtTGZSancrWWx3Y1FWNXpO?=
 =?utf-8?B?bzBiVTN5MXRsVElBTWI3RlhWaWszR3J6N0NrNVFtU1J0Uk9YRUd0cjkzMVlR?=
 =?utf-8?B?ZWQ5S2xUWm5vZlhySVdkYkZXSjBzRFg0bFJXQlVrQzVnNmd2ZFpRdVA4QWNE?=
 =?utf-8?B?a2w3b09OaHk0aEpUN0kvN3dsWVA2VlRiUi9NTzBOQ3dBNmQ2MTAwVEV0RS9O?=
 =?utf-8?B?QjRpL2YvNk5vSjdmalBEMy9CYjd4dE1xOXlOL2VtcDZpLzJYb3dJSzBQTDdu?=
 =?utf-8?B?YSsrZFAzbWRuSGhxTnZKaWFKWWdNcjY3NTlvd01IT0pvd0plM3pYRTdlR3hW?=
 =?utf-8?B?MHR2MXBUTE81c2QxNWdZdVNYYyt2S3pXVW84UnBpbmFZV1lISWhUekFGOWRW?=
 =?utf-8?B?bHhIRlg2YVkvaDJFdTgrMmNiNTllV0VqWlRubnRpdUZPRFFkMmQ2eGdnVmhm?=
 =?utf-8?B?cFRRN2NuWG8xem56cTBSRHh3b3hoREZ6eVdVZ2tJay9PWDMzeHlXajFjMGVa?=
 =?utf-8?Q?X87ISUKiJBTUmLxr3PkTpKCij?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 87a5b20b-fd36-4396-755d-08db81f233c6
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 09:35:45.4736
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: wVt3X/IVrqK14v+LfDid6/dv4TIX4oBgPmVjzcVK+U4rx+B3xLbtbY2MTX5i06inCcwqKEbPdVN4tWUx5tYN7Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB9771

On 10.07.2023 23:08, Stefano Stabellini wrote:
> On Mon, 10 Jul 2023, Federico Serafini wrote:
>> The headline of MISRA C:2012 Rule 8.3 states that:
>> "All declarations of an object or function shall use the same names and
>> type qualifiers".
>>
>> Change parameter names to meet the following requirements:
>> 1) keep consistency between declarations and the corresponding
>>    definitions thus fixing violations of the Rule 8.3;
>> 2) use the globally-adopted shorthands (e.g., 's' to denote a 'state');
>> 3) keep adjacent declarations consistent with respect to the parameter
>>    names that are used.
>>
>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Tue Jul 11 09:41:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 09:41:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561703.878209 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9sG-0002Nq-Jz; Tue, 11 Jul 2023 09:41:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561703.878209; Tue, 11 Jul 2023 09:41:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJ9sG-0002Nj-Gs; Tue, 11 Jul 2023 09:41:36 +0000
Received: by outflank-mailman (input) for mailman id 561703;
 Tue, 11 Jul 2023 09:41:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJ9sE-0002NY-N2; Tue, 11 Jul 2023 09:41:34 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJ9sE-000327-Ho; Tue, 11 Jul 2023 09:41:34 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJ9sE-0001k6-7V; Tue, 11 Jul 2023 09:41:34 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJ9sE-0002OS-73; Tue, 11 Jul 2023 09:41:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=qy3tAqdSUumeXX3EdO+LdO4RD9Ova7s6agZvF0K7HB8=; b=ibnW6lO7bNb6Pb1m3sRmxB5Qtt
	MKCMKq1OicYSHI97TF3Qzr7HVpUxiz5e1BVSSHlp+S0yfFYH7jEfMSlL4Ig11CTUS202xr6kJS1+H
	C/kdY+NUvcZvsLUqaOM+o5TKiDkjJf2cpXkF1XmxP8okt6szFKso9B7MSnmSNkHnhCmA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181756-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181756: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-pair:xen-install/dst_host:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=b831326ee2f9ed94523b3d8b0fb2da2a82113e9e
X-Osstest-Versions-That:
    xen=fd62986f6b776876f3028a755c859d02e55dc262
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 11 Jul 2023 09:41:34 +0000

flight 181756 xen-unstable real [real]
flight 181762 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181756/
http://logs.test-lab.xenproject.org/osstest/logs/181762/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-pair        11 xen-install/dst_host fail pass in 181762-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181752
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181752
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181752
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181752
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181752
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181752
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181752
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181752
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181752
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181752
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181752
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181752
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass

version targeted for testing:
 xen                  b831326ee2f9ed94523b3d8b0fb2da2a82113e9e
baseline version:
 xen                  fd62986f6b776876f3028a755c859d02e55dc262

Last test of basis   181752  2023-07-10 14:37:02 Z    0 days
Testing same since   181756  2023-07-10 22:40:04 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   fd62986f6b..b831326ee2  b831326ee2f9ed94523b3d8b0fb2da2a82113e9e -> master


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 10:25:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 10:25:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561712.878223 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJAYB-0006uS-T6; Tue, 11 Jul 2023 10:24:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561712.878223; Tue, 11 Jul 2023 10:24:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJAYB-0006uL-Pn; Tue, 11 Jul 2023 10:24:55 +0000
Received: by outflank-mailman (input) for mailman id 561712;
 Tue, 11 Jul 2023 10:24:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=B4LE=C5=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJAYA-0006uF-UG
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 10:24:55 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on060a.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::60a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2c719595-1fd5-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 12:24:53 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Tue, 11 Jul
 2023 10:24:51 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Tue, 11 Jul 2023
 10:24:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2c719595-1fd5-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=mliOuvzK08WKWdEOPGDiRb62/WwOZX+dkY9fsrWRccQYE/eFXkUm3vYakd+EKExa2DrbJOnBZdmVjU2anfiDTVsoZpQjHCWvCqLvUD2iEE9vk26Yr2TajJoSl5DpfCkEmFN5eTgEFDc9Us1vgAZ/KOhzBQgPzH61K5LYPxOzSdY1p0GMTZ+qdJ8vSFjh1guA0Dv9l7pFixb/BPdW/vRQVJUh1yJQHy4WpPBLGYBdZXvaIptoaTQl1ibLz7JkP6NZ6jTTuK5ZhrsWNLTqq3VEvrTidxp2gcluXeRdN0v/v/ztkHwa7r6Lh69Y0y6dlfVt56JsUUoavNhFdGMr1uzEgQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=GSwtxfn4Df1/CjsGH7f5Pj53/pUlgvyEjgWxiLx7wFA=;
 b=O3OpMAK/+0XUc0MSMVeQLCWRwmYWmfuX0pJMe+2x/ILLowxJl6puemd7Nwfq4Hb8l9AHs7dVoTmaNGKnqYRkjeWBX03AWfyxQt5wq/G5i6bxNNYnpNjRYEyRE/A4toAV6axncimf4Me0Ht1fB7Pcn1BTSdqZRpJlrwBiW3fT/lqp5o+S6x6FdKqd3HN4VY9wqS+WYYeIiBSU8TtKBkS+aR6FLO1vUJPBtp20sB783X0rko5f/9fch0vS1w1YcRW4Oj/GODpp8JQs+F0dsIqbEi9Y6fSezxDcoHONpZ6F/83wa6VRqdWNFq6r6IT0oIn6LFuB/bTXKvN60aeidf9u5A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=GSwtxfn4Df1/CjsGH7f5Pj53/pUlgvyEjgWxiLx7wFA=;
 b=3gFubLym0oYX8TeialJxanSMso8YhdMt29GVRH5uqSAks1v7yUJUoTsXHE9sGT3Fjf4l1yUVcrGQIhX0qVma0BsYkoayqrKdfolRrDUFSdj9lS9XRJ5ugjlgHbnsS3vCB2C7FKOCd+ATnrcVPT0E1se6haH5+LPUcl76mQ2Iwf8HBTDK9dAetKwGH5h3XqvUBov8rPheCRDmWffFUW4faO4w70KoEUR/w1gM4HLJgIMseggWRFn31t/Aw0ziE/ju1xOkoZEyIktJeH7tVajtyXc5Wm57hEJbOxRSopNwOa9pYzh0Ckn50kkKKJmZwi2jky4uHo59TtW1H9K4FcUO8g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e6ca0ef1-fb66-d923-388f-79cfc20d1626@suse.com>
Date: Tue, 11 Jul 2023 12:24:48 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH] pci: introduce per-domain PCI rwlock
Content-Language: en-US
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>,
 Paul Durrant <paul@xen.org>, Oleksandr Tyshchenko <olekstysh@gmail.com>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20230711004537.888185-1-volodymyr_babchuk@epam.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230711004537.888185-1-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0097.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9c::12) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM7PR04MB7157:EE_
X-MS-Office365-Filtering-Correlation-Id: a380b239-0173-407f-c881-08db81f90f65
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	wPvpjqbSjEenGTqaqpx3kqbeMiM3EmJgKoxWfAy2da0qJi29BfRmNVZKcfI/qaQp8eSVUdhp2k+r+M9eRMOOVdoffUArpV0GzJrETwjf0jw83A3TLWR23Sey6+zr1DhfFPnvLSSRSDlqMLSJk/T3UKVGSV+nw6ce+kC3NygntkDnVjqvfoE6iFM5NFryngogXJMh/Kbne29DFEBegwYMr7x9dYnZacAVA73KBuQf5bz6g8oIBSwxb1JguN9StpwlZRakQEfqj5f6gPgVw9tTOEbBl1eQrEhCQdAqoX7Wb6EUfGhInIXV3Uh9Rs/cFQplI+NcnxeyRY7wLAwhJxF4nmYae3mPwa2P+7in8Hoc/OZG0xNIpK+IgLeHIjoIfxzleMkMEaNJy21Y2CHSUXMACm67EYZcRfbJek05t7nnUtve8DvyaqQRzltlqxe09g/KJLLUi/PEJV73BgatM9skxHzcccsa2b5ith1BWDZOnhT5EoMddnemDfdDZ1HGmn63neospO14FrKZZVpZ2poYckrBfxTqDN3OG9hjhLHWEW4nffZoo7uGYJ6qgqF2bbIV/4SXxxH+3JgJUcNojw6VF3PUq8N3Fvli6kUr4OO/M5nImuojkd9Ord2EGXqlPAonvOp4fy8p710LL1v0okOyZQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(136003)(396003)(366004)(39860400002)(451199021)(8676002)(8936002)(5660300002)(478600001)(41300700001)(6486002)(6512007)(316002)(4326008)(6916009)(53546011)(7416002)(186003)(6506007)(26005)(6666004)(54906003)(66946007)(66556008)(31686004)(66476007)(2906002)(2616005)(83380400001)(38100700002)(31696002)(86362001)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?b3I0NGdCeXJpZm1JbFBYdkJkMTliVkI0eDI2VE5QVWdJQ3JIQVVFRjRFWWZw?=
 =?utf-8?B?ck56eWlTTHRBRWl3emFlb3hRYUwrY21hWXM5eDlXK1BYYkwwQUVVYzk2Tmsz?=
 =?utf-8?B?a2cwOXA0VzZRei9WdGQrdHhSYzNYTWpBdEhLcjQwWmxvQjhxWkFXT1haRWc3?=
 =?utf-8?B?ZkNrYlp6WTlRSmhVZGovcnU5azVHT1NwTVlyRnMvT1VEcWlmUTJ2WjhtMjBZ?=
 =?utf-8?B?aG9zZWUwMUY1bmxqSUoycy8vb1FRaEZMVGlyVHExRmRYRDJHbTVEYlJ5dXBv?=
 =?utf-8?B?V29Mc3V4Rng4QlBjNyt4cGlqSUZtQzIybk1KbWF6V05QckptMmxYR0hlalVp?=
 =?utf-8?B?WXYvcHo5a3pRdEwzcDZQcEtRWnFrb1dTTC9pa2NKb29hREdCUllMOUZhZzFL?=
 =?utf-8?B?Wkk2NjBTYjFUM1NpeVZha2Q1dzJUVFZKQk05MU5pd21peGpsczdrakJDSlFY?=
 =?utf-8?B?TnFFcDFLOFFGMmtoM0RpNEhnUnFrUmJJT1MzZEpCeGtqWGQyUysrdit3SW1a?=
 =?utf-8?B?VVFkNTI2SnEvU3d1cXQvS2k2eDJmamdTYmg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TlVakVz?=
 =?utf-8?B?eDNsYjFXVGhrMVdsNS9oa1VDRVFkREhDSHZjemxJWWM1bUdxcmJVM0hwVTFk?=
 =?utf-8?B?S09RZ1NLKzNhbzdBV1BJYXQraW9rL2YwbTFoSGoxTkZLNUltdzhDSnE4UzFD?=
 =?utf-8?B?SkZlNytMSGxzQXcxUW5sQi9yakdZTDZKQmpyanl5NVRYT1VmS0xTLytodmVi?=
 =?utf-8?B?bUM4eVBrNHlodE1Hd2gzcjRSb1RkS1B4S0c5dEt1WmdiRVQ1SXlMUDkxRXUw?=
 =?utf-8?B?RytCT09QREpQTkUwbFpSR2FhZHdxVW9ta1Q2UldEckRRangvNkY1WVAxUFhF?=
 =?utf-8?B?RFlCVDh2eDRMOU9CZXFxRmFVemI0a2plYmRCdWpKS2JrbzdYbGRidHFMNGlv?=
 =?utf-8?B?c0JTVWUwdjM0L25QRWVVaGEyMXpNeFFYZEdrRXNWL0pveFpReGh2emp1NXo2?=
 =?utf-8?B?ZVoxVTFicnVLM2llZlNMSlJEOFVnV1lwTmNDQk1nWVczVTc2Wjc0cVdOY1Vs?=
 =?utf-8?B?dTMyc0ZsV0VTa3RseXZBV2F1TWdQTThSSnBCcG1LTnlYUkZoNURIejFNdUVT?=
 =?utf-8?B?UDVQNngwUm92MjNRcXVzZlNlK294TEM3SGQ1T0t1Rnh5bXNBZHFYaVlUTURE?=
 =?utf-8?B?aFRwTUR1alpMYlMreUR0N1IwOTJ3M2V2N2hwL0QyWXhKbDhOcmVLRVIvaHBL?=
 =?utf-8?Q?/RP8Z4jNgWd/De+8ZJIEQjkol?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a380b239-0173-407f-c881-08db81f90f65
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 10:24:50.9234
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: f3HF1exy2Ulqz2iTB7qzsZLdvzxAwaHCF8xif8/hLlGkrzMq6wtMNJnqYrugTj08awaVZ8fFrcgFrDPGdW4PTg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB7157

On 11.07.2023 02:46, Volodymyr Babchuk wrote:
> Add per-domain d->pci_lock that protects access to
> d->pdev_list. Purpose of this lock is to give guarantees to VPCI code
> that underlying pdev will not disappear under feet. Later it will also
> protect pdev->vpci structure and pdev access in modify_bars().
> 
> Suggested-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> Suggested-by: Jan Beulich <jbeulich@suse.com>
> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> 
> ---
> 
> This patch should be part of VPCI series, but I am posting it as a
> sinle-patch RFC to discuss changes to x86 MM and IOMMU code.

To aid review / judgement extending the commit message would help, to
outline around which function invocations (and for what reason) the
lock now needs to be held. Furthermore lock nesting rules want writing
down (perhaps next to the declaration of the lock). Therefore comments
below are merely preliminary and likely incomplete.

> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -2381,12 +2381,14 @@ int hvm_set_cr0(unsigned long value, bool may_defer)
>          }
>      }
>  
> +    read_lock(&d->pci_lock);
>      if ( ((value ^ old_value) & X86_CR0_CD) &&
>           is_iommu_enabled(d) && hvm_funcs.handle_cd &&
>           (!rangeset_is_empty(d->iomem_caps) ||
>            !rangeset_is_empty(d->arch.ioport_caps) ||
>            has_arch_pdevs(d)) )
>          alternative_vcall(hvm_funcs.handle_cd, v, value);
> +    read_unlock(&d->pci_lock);

handle_cd() is non-trivial - did you you audit it for safety of
holding a lock around it?

> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -858,12 +858,15 @@ get_page_from_l1e(
>          return 0;
>      }
>  
> +    read_lock(&l1e_owner->pci_lock);
>      if ( unlikely(l1f & l1_disallow_mask(l1e_owner)) )
>      {
>          gdprintk(XENLOG_WARNING, "Bad L1 flags %x\n",
>                   l1f & l1_disallow_mask(l1e_owner));
> +        read_unlock(&l1e_owner->pci_lock);

In cases like this one I think you want to avoid holding the lock
across the printk(). This can easily be arranged for by latching
l1_disallow_mask()'s return value into a new local variable.

> --- a/xen/arch/x86/mm/p2m-pod.c
> +++ b/xen/arch/x86/mm/p2m-pod.c
> @@ -349,10 +349,12 @@ p2m_pod_set_mem_target(struct domain *d, unsigned long target)
>  
>      ASSERT( pod_target >= p2m->pod.count );
>  
> +    read_lock(&d->pci_lock);
>      if ( has_arch_pdevs(d) || cache_flush_permitted(d) )
>          ret = -ENOTEMPTY;
>      else
>          ret = p2m_pod_set_cache_target(p2m, pod_target, 1/*preemptible*/);
> +    read_unlock(&d->pci_lock);

Hmm, is it necessary to hold the lock across the function call?

> --- a/xen/arch/x86/mm/paging.c
> +++ b/xen/arch/x86/mm/paging.c
> @@ -205,21 +205,27 @@ static int paging_log_dirty_enable(struct domain *d)
>  {
>      int ret;
>  
> +    read_lock(&d->pci_lock);
>      if ( has_arch_pdevs(d) )
>      {
>          /*
>           * Refuse to turn on global log-dirty mode
>           * if the domain is sharing the P2M with the IOMMU.
>           */
> +        read_unlock(&d->pci_lock);
>          return -EINVAL;
>      }
>  
>      if ( paging_mode_log_dirty(d) )
> +    {
> +        read_unlock(&d->pci_lock);
>          return -EINVAL;
> +    }
>  
>      domain_pause(d);
>      ret = d->arch.paging.log_dirty.ops->enable(d);
>      domain_unpause(d);
> +    read_unlock(&d->pci_lock);

This means a relatively long potential lock holding time. I wonder
whether lock release shouldn't be delegated to the ->enable() hook,
as it could do so immediately after setting the flag that would
then prevent assignment of devices.

> --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
> +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
> @@ -102,6 +102,8 @@ static bool any_pdev_behind_iommu(const struct domain *d,
>  {
>      const struct pci_dev *pdev;
>  
> +    ASSERT(rw_is_locked(&d->pci_lock));
> +
>      for_each_pdev ( d, pdev )
>      {
>          if ( pdev == exclude )
> @@ -467,17 +469,24 @@ static int cf_check reassign_device(
>  
>      if ( !QUARANTINE_SKIP(target, pdev) )
>      {
> +	read_lock(&target->pci_lock);
>          rc = amd_iommu_setup_domain_device(target, iommu, devfn, pdev);
>          if ( rc )
>              return rc;
> +	read_unlock(&target->pci_lock);

You need to drop the lock before the if().

Also nit: No hard tabs here please.

>      }
>      else
>          amd_iommu_disable_domain_device(source, iommu, devfn, pdev);

Related to my initial comment at the top: It wants clarifying for example
why "setup" needs to lock held, but "disable" doesn't.

>      if ( devfn == pdev->devfn && pdev->domain != target )
>      {
> -        list_move(&pdev->domain_list, &target->pdev_list);
> -        pdev->domain = target;
> +        write_lock(&pdev->domain->pci_lock);

Shorter as write_lock(&source->pci_lock)? (Also in the VT-d counterpart
then.)

> @@ -748,7 +750,9 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>      if ( !pdev->domain )
>      {
>          pdev->domain = hardware_domain;
> +        write_lock(&hardware_domain->pci_lock);
>          list_add(&pdev->domain_list, &hardware_domain->pdev_list);
> +        write_unlock(&hardware_domain->pci_lock);

What about the companion pci_remove_device()?

> @@ -887,26 +891,62 @@ static int deassign_device(struct domain *d, uint16_t seg, uint8_t bus,
>  
>  int pci_release_devices(struct domain *d)
>  {
> -    struct pci_dev *pdev, *tmp;
> -    u8 bus, devfn;
> -    int ret;
> +    int combined_ret;
> +    LIST_HEAD(failed_pdevs);
>  
>      pcidevs_lock();
> -    ret = arch_pci_clean_pirqs(d);
> -    if ( ret )
> +    write_lock(&d->pci_lock);
> +    combined_ret = arch_pci_clean_pirqs(d);
> +    if ( combined_ret )
>      {
>          pcidevs_unlock();
> -        return ret;
> +        write_unlock(&d->pci_lock);
> +        return combined_ret;
>      }
> -    list_for_each_entry_safe ( pdev, tmp, &d->pdev_list, domain_list )
> +
> +    while ( !list_empty(&d->pdev_list) )
>      {
> -        bus = pdev->bus;
> -        devfn = pdev->devfn;
> -        ret = deassign_device(d, pdev->seg, bus, devfn) ?: ret;
> +        struct pci_dev *pdev = list_first_entry(&d->pdev_list,
> +                                                struct pci_dev,
> +                                                domain_list);
> +        uint16_t seg = pdev->seg;
> +        uint8_t bus = pdev->bus;
> +        uint8_t devfn = pdev->devfn;
> +        int ret;
> +
> +        write_unlock(&d->pci_lock);
> +        ret = deassign_device(d, seg, bus, devfn);
> +        write_lock(&d->pci_lock);
> +        if ( ret )
> +        {
> +            bool still_present = false;
> +            const struct pci_dev *tmp;
> +
> +            /*
> +             * We need to check if deassign_device() left our pdev in
> +             * domain's list. As we dropped the lock, we can't be sure
> +             * that list wasn't permutated in some random way, so we
> +             * need to traverse the whole list.
> +             */
> +            for_each_pdev ( d, tmp )
> +            {
> +                if ( tmp == pdev )
> +                {
> +                    still_present = true;
> +                    break;
> +                }
> +            }
> +            if ( still_present )
> +                list_move(&pdev->domain_list, &failed_pdevs);
> +            combined_ret = ret;

Elsewhere we aim at returning the first error that was encountered, not
the last one.

> @@ -2765,6 +2767,7 @@ static int cf_check reassign_device_ownership(
>  
>      if ( !QUARANTINE_SKIP(target, pdev->arch.vtd.pgd_maddr) )
>      {
> +        read_lock(&target->pci_lock);
>          if ( !has_arch_pdevs(target) )
>              vmx_pi_hooks_assign(target);

I'm afraid this and the unhook side locking isn't sufficient to guarantee
no races. Things still depend on the domctl and/or pcidevs lock being
held around this. As which points acquiring the lock here (and below) is
of questionable value. In any event I think this warrants code comments.

Possibly the same also applies to check_cleanup_domid_map() and friends.

> @@ -2780,21 +2783,26 @@ static int cf_check reassign_device_ownership(
>  #endif
>  
>          ret = domain_context_mapping(target, devfn, pdev);
> +        read_unlock(&target->pci_lock);

Other calls to domain_context_mapping() aren't wrapped like this. Same
for domain_context_unmap(), wrapped exactly once below.

>          if ( !ret && pdev->devfn == devfn &&
>               !QUARANTINE_SKIP(source, pdev->arch.vtd.pgd_maddr) )
>          {
>              const struct acpi_drhd_unit *drhd = acpi_find_matched_drhd_unit(pdev);
>  
> +            read_lock(&source->pci_lock);
>              if ( drhd )
>                  check_cleanup_domid_map(source, pdev, drhd->iommu);
> +            read_unlock(&source->pci_lock);

Acquiring the lock inside the if() ought to suffice here.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 10:27:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 10:27:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561717.878233 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJAaI-0007Wy-GM; Tue, 11 Jul 2023 10:27:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561717.878233; Tue, 11 Jul 2023 10:27:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJAaI-0007Wr-CN; Tue, 11 Jul 2023 10:27:06 +0000
Received: by outflank-mailman (input) for mailman id 561717;
 Tue, 11 Jul 2023 10:27:05 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=B4LE=C5=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJAaH-0007Wh-Fo
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 10:27:05 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2060a.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::60a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7ad44b3f-1fd5-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 12:27:04 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM9PR04MB8307.eurprd04.prod.outlook.com (2603:10a6:20b:3e6::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Tue, 11 Jul
 2023 10:27:02 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Tue, 11 Jul 2023
 10:27:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7ad44b3f-1fd5-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=WWOMNNSAjNOfWOx4LrUhwG6JBohPR9JLo3aZMAumxcWx09emzPT+HEnG4EfPdhV4KV4pZP5jRz9SlYFCaEfnC6C2IVLQQIXK6fLqeZSzb3xfkqQF1AIu7cSDG2ME6RLA0A+56AcdUuEVTbM76UOH+2EbFFUwuvTHv5jaCPCoFXq1r4h1r8qgjfHEY0QVHjj+/CCULvOGBRE/vm1OyVKHtMP9vs+l4ptz16a7fPuUd+7YXQUbXpYKjLZxSNvv9/PdmYS2IxXzS/FI+tv5fdbI17rWxzAA0sjtLE+FAYuMnhki7jEQFRKM4SCV4JqAHEKzSFgwoHirhzhFp+8PPQASvg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=t/TVrBzVsIwR96YK41lnB70vLndn90VY8LjQ0zG8wNk=;
 b=dkF3AsdpNIkIB3XxYlLIOcVpQ0O1BFiVD0o33K9zB8JuVANcNw9B8ho+vakpiAHogCnJhjGcbLq25Tp2EblVPPKUjLf4RL+5AVOXNQrgKkOcw4zn6zBt4I0CE/4v8eMxutA/sFdNaY6PC5sN5AbAOfT2Cr9VLuma5HTFddPfQisuP94YkwUIGrDbzIbETbDZ0tbxh43EUuzXDBhC6D6fcYYbmuLZ0J9R29H/1npjjpscR66RyclFbiurdEZ5lHvwIB+eJmJU+07QesQo1g9M8B3xqy92HgKI/exoh6mEUon0kzY6nLuJCnRaphBNARnUeGLVcMyFGUvglqgDSfmH2Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=t/TVrBzVsIwR96YK41lnB70vLndn90VY8LjQ0zG8wNk=;
 b=ddKn4mMLznysh5778hl/LuYz34AssSef6oOIx6VtHn0tKu5DkR/E18DNwDdESeAzOeEF2Ge36huABLAg10nG7E7fpGBLjfDG39FAa8jUJXy85GrJV8WjEKrBPytauhJSpLSuKViOAKS5W92Axq/9haOJT8iys3HM/5MDYRtRAB7XrdgYhx1xIk/DY2vhyX6js5nfuJS++tLMHHYQ6SxZ5Zgq+gv1FlWLJ6hFO8DpOv/UOkrImvGMBlbTO4ebVW7A8rtyvbwwSFft4XdQQA4GcT0WDghUUrtQXTmhJ9IJCgvjNepupbiJQwWBuyVOWtQq0VHv6ltU7jGW1/vQy+3Kdw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <2ae95ea5-1e41-e655-afdd-d9da764c6a90@suse.com>
Date: Tue, 11 Jul 2023 12:27:00 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] cmdline: only set ask mode if vga= is present
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230710141238.375-1-roger.pau@citrix.com>
 <9827433d-54dd-47e6-1f74-53612da21c14@suse.com>
 <ZK0ddKXx13fu1yfX@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZK0ddKXx13fu1yfX@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0081.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9a::8) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM9PR04MB8307:EE_
X-MS-Office365-Filtering-Correlation-Id: 08983ff1-88d4-47cc-ccdc-08db81f95d93
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	kngTjZBsC9whx0PFakXxhXSCKPjBCyRR52eCx6WLfOSGzKMYM0GanOfH9Is0HqyRVdEp13xq2wNtjLbCw5fwg85EMA7IwFv5xe+dcNmA9bShvLmiRpLO5SpH5H+YvB3DXF3qmDVrPMeKQwz3xMzphoPJBMtjEPOQag60CFNAxu/QRXgasQ/5LlNRM6l3QWA9jF1u/1V1CYvxpMA8UwrJgQnARemf1vArM3lOO2bZvkyamliFHJ2uGCeuIlMxRUk9XGFosB5w9Br5+lCbMt1NgKE2BVGic6xyq075MNlbMPNKJIuDMfXmvWqvIaTlYCLehbSTvmxuW08lhnvTkDplZu61wws/IkolfDParB/ya9mAcJGdMsTGtuJ3x4tu+nzK60yrct6hcL2XQfM6u7ox0euR3C/o6GoRmPQD4kvR1ttLoN5FCh2/Aou+LurrJBTvHEnScd3n8NZVeksZXATubB836yN1xCoyF/p0/+Rb33LqX+bQt9P2KCBpzOhIM6CU5hHG8jJEtSwnx7wUP6ZScb8TN7zjeigCLZ6nKjNZqisLJZhNlh4ZhntK0EfVYTwYx12L3RyYNranGgiCZfrEnGUFwSfTEdt2QCF5/oHIny98CpvTKzeK1amefRXlaM8HaW+1iEl6zIR8PdEieYT8JA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(136003)(346002)(366004)(39860400002)(396003)(451199021)(6506007)(26005)(53546011)(186003)(86362001)(8676002)(8936002)(2616005)(31696002)(31686004)(5660300002)(6512007)(478600001)(6486002)(41300700001)(66476007)(66946007)(66556008)(2906002)(36756003)(54906003)(38100700002)(4326008)(6916009)(316002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ekd1akZ6OEdFdHlLTlJLajluQkdGTVF0U3ZHMEYyMVcxbUozZX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VmQ1REQm8rdXpSM0hBQ3pDSGhtcGJMUW5mcXVxQkRHbmJZ?=
 =?utf-8?B?OUZEUjZZeTdtQ1hkSENEQ25oOWRNTTNIeTVzaGF2R0I4c3VsUkh1UHZydkhQ?=
 =?utf-8?B?bHVlZWNybXVDY2lWVy9VNDV0N0gwQTF1b1RCa0pNQmkyb082Qm84ODdhUGVC?=
 =?utf-8?B?aU5ZTlZrNjV1bngyaFhRcmxQUG4zNFBYMEhVSmtiRm1EODBLWllORDNZWUJv?=
 =?utf-8?B?Rm9KV3lVWDFqeVJJNmNjNEsyU2NvTFlvZWdVa21jck9hZ0ZCZlY2SU5lS1Jp?=
 =?utf-8?B?OU9LK1RYMkFJc0hyOFk2Vlg0eHduT1hxcm9HQTZJbEREbFJKTGZtLzhYSUJi?=
 =?utf-8?Q?77MkS4xXYw3suKyKXEeJjFSAv?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 08983ff1-88d4-47cc-ccdc-08db81f95d93
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 10:27:02.0975
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: L9BaV6fV34zlcdzAYVcAxckVnbn2z63uyWlUAGwblly08MfWhnW+a+l9SBMKahki/0TjPkwHlJ8vnxx07dm4Eg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8307

On 11.07.2023 11:14, Roger Pau MonnÃ© wrote:
> On Mon, Jul 10, 2023 at 06:27:06PM +0200, Jan Beulich wrote:
>> On 10.07.2023 16:12, Roger Pau Monne wrote:
>>> Commit 9473d9a24182 set the ASK mode without checking if there was a
>>> `vga` option provided in the command line.  This breaks existing
>>> behavior, so exit early without changes if `vga` is not present in the
>>> command line.
>>>
>>> Fixes: 9473d9a24182 ('cmdline: parse multiple instances of the vga option')
>>> Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
>>
>> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>>
>> Should have spotted this during review; effectively you're (almost) undoing
>> part of the earlier change, just that ...
>>
>>> --- a/xen/arch/x86/boot/cmdline.c
>>> +++ b/xen/arch/x86/boot/cmdline.c
>>> @@ -279,9 +279,13 @@ static void vga_parse(const char *cmdline, early_boot_opts_t *ebo)
>>>  {
>>>      const char *c = cmdline;
>>>  
>>> +    c = find_opt(c, "vga=", true);
>>
>> ... you use c instead of cmdline here (and I'm heavily tempted to actually
>> make this the initializer of c).
> 
> I see, yes, please do.

Well, no, I didn't (without your consent), and I wanted to get the patch
in yesterday before leaving.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 10:53:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 10:53:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561723.878242 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJB00-0002VL-EK; Tue, 11 Jul 2023 10:53:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561723.878242; Tue, 11 Jul 2023 10:53:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJB00-0002VE-BO; Tue, 11 Jul 2023 10:53:40 +0000
Received: by outflank-mailman (input) for mailman id 561723;
 Tue, 11 Jul 2023 10:53:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=B4LE=C5=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJAzy-0002V8-LW
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 10:53:38 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0608.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::608])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3040cb71-1fd9-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 12:53:37 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by GVXPR04MB9778.eurprd04.prod.outlook.com (2603:10a6:150:110::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul
 2023 10:53:33 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Tue, 11 Jul 2023
 10:53:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3040cb71-1fd9-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=m70MZORQ7vmNWOs7a6YkT+UFirL/+Bcb5byIXnN4ix1L2LXbrVfcYmQ+Ug2aXxW/w2ua2WsY8fkPIvj7sDl098Yo3ju76CusMsi/CRpQnmU0NQWEqljRF4ek0KXpHxkjhkRygrGj5QQ/pVq4OJtcIFR//6rWSt7EESXIQ5YSA2MM6y0jhUWDCKUnS52vHf2fEcSKhIELhYBS6dK28hzab1eYalmPYAQiQCtmuX5gEdaHctgWpZ3u9lvdipzsjzJ4s++B5mwIt219SsrzNUFlV180d/xet0AwUCAe6ZfDP2iXKSONlgwbrPB0PHG7kHSZnqKtQtLGEK4SFhwiOmx55Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ImXypYEyu21H6p1qvG+zOAwXIJTL6QMd7oYEe+O8FCE=;
 b=DDtKSjg0VzBvEj15ko47Vbz1ZhWkKaHw5lYt+kRsYFjXbJXE80RZcD0BuJiFegsz2Aj6ftjJ7HJmofF1zxw3FTTcbDaI7TEiUxNCLE772ywyuYCHRJ6VsoQw65AVW/dtqpZvRVNiFcMXlkUsUYP7LqmJMmh8eRHDOkg/sXEoUwO6grQSYZd6Cm/gn+rEeqe3ZGBp2bnCNZ/YdRtl4rQCKoO4okQfj9KRoSUrrHk4JVRxU6FPS5sVNkK8REN/ePJVmYbcSz2bz5ZwlGhHnNQHB2fKm3CVdYyXXUUxBJvtPKBu4BE+yn9kImbjAnuVlWogqDanWETIVZ4wp9n1+eaapg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ImXypYEyu21H6p1qvG+zOAwXIJTL6QMd7oYEe+O8FCE=;
 b=oNbzFleaWAUrmQUcmrZfJGayaQp00MiBOMwzrevN8farliyQ7hHvjc1+YHI/HH3oykOaXcA+qr4Qno6NIq6dtM668Y1QsByXlWLo/WWoI8gxZNbbs1rOnMr6Y0LU51K5CuV4Nu4mQ/eORUGRvLByxKHFfmWtcWGExFBijntySi2nt/Z1DENXTZIADKMDUYTHJcUnJNnfnTIYDyVzpItP4Tgf8JxzHvEomy2ZdbJxABgKHoKit5vopw80jbPlJP5flHIdI55gtUYlKiCXTMnHU4I10zDRARybc7oPvlmCXHmLY+fnEILLRWk/Kpi+Z9ZLHaVnta4rUk0GCjTh2Yx9tQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <1f79491a-46f5-5293-e92f-0e2b0b3efb62@suse.com>
Date: Tue, 11 Jul 2023 12:53:31 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] x86/ioapic: sanitize IO-APIC pins before enabling the
 local APIC
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230707095338.44244-1-roger.pau@citrix.com>
 <92d16012-ff9f-693b-07c6-d45fe07a00a0@suse.com>
 <ZKwZBQ_0Z2c7NJNL@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZKwZBQ_0Z2c7NJNL@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0095.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a9::12) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|GVXPR04MB9778:EE_
X-MS-Office365-Filtering-Correlation-Id: f430c91d-709b-41c9-67c3-08db81fd11f2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	4zQMlJOoQd2vigtNqsM7SZ8ekvpHO+LeVXIAA9yWRRh1AjKR3l+Ehf0MwuXMScDwOgIm8TXmbV7Ac1Rmjponw+ddFh7XkIt6uZD0qTqUzP9fBJOoa6RH0QIex9B57K1GNt4NUSF2zxAVQRBSvchAhVfb8SiFu5bm44KZ6761E3F7OP9FRhUlGly3OC/U6xgWyfWCMb8k4eixX+7ZLxGpKcoyKX9UjDxKOR4y5GNtcuJjVK7UtmE6L+OLMhChU+ZOLafaRWDIyPEeXI0edPki8cUczFJY8KUADTHP8hX0zhLWF7Avv/TrmlcfV7AnsLznQiqKO5071J+a1IH1AyvZ3KTwA7vVPnbvnwwGB2Q+30rLDQGgyWUEz1nunSfWZmePOfia/n1FcUzjzE4Pl0hPux7jwHn71StZyDQkXd1/RxDH78C2UI/nIZhfG/FzQBh7Wvj3CZ8Yn0ytwu9CCUP5Cznlkf6PW6wQIWjMlk6aQ4hAjJl8edI/VuLAIIVFp8leYTQUNqzPWdHOzj94WTLvzV1nWCSovnpmSxryIomNB+FRHZK6L0Fw2yFgSMQSIDJ87InZGgZu01zQi3DbV3VOyRNGh1uIJ032vWOTEoYAwh2pzmhkIY6RYwqt/LQoGwNehKwBc+5Tes8Z2Vy+DHO7Tw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(366004)(136003)(376002)(346002)(396003)(451199021)(31686004)(66899021)(478600001)(6486002)(54906003)(83380400001)(36756003)(86362001)(31696002)(2616005)(2906002)(53546011)(26005)(6506007)(66946007)(186003)(6512007)(8676002)(38100700002)(5660300002)(316002)(6916009)(66556008)(41300700001)(66476007)(8936002)(4326008)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cDlTdkdCbnhLVWFsUjdwUVFSTHVFeFBBc2tmdUErdWtNNGJ2MXVwVHdTMjNB?=
 =?utf-8?B?Mk5OK2R0cGhGYXJUYVRBa0YwTkk0ckJMSmNjZ0EvYXVGU3U5cERRSmc4M0Uz?=
 =?utf-8?B?QnQ5VEtVdVdKUVlsZ1BJZEhkdG1Nb01PM0NoS2ZMeGYwWWJRdTdLZUdxcERS?=
 =?utf-8?B?NkJaMG5MQkFiNUh3RGNRcUQraUl2bmt4Z1RZRFlyS2tUQWExcGJnWkh6b1ZG?=
 =?utf-8?B?eUhJS1NVTXZlcU5aSitGYWtkNTJ4L0d1bTdaaWMvY0NQU1FKUGlrNFQ0RVZr?=
 =?utf-8?B?dkZZNjRDaGRvc2VlQVQ0MGVLb25xU2lWRnEvdXpOK01rVklLV1kxOVpXL3RY?=
 =?utf-8?B?Nk51RVBMR2lzRUw4R1dpT1NPamEzRjlMSHlVMWVUb1V1RnVzRGtLT2REQzVI?=
 =?utf-8?B?VmZ0UDlETW9aYW1TdUhiZkFGQldkNHE4N2JBdTVESjlocnB6bEJJb3Z4WjVn?=
 =?utf-8?B?TGJoN3JKQkhoZ1JGVXc4RmNOMkh5aE00cWNJV2Q0OXE1RmVOQm9kLzhiYk5C?=
 =?utf-8?B?emVuSnhpanFhL2wxT1JqcWZNVXNIS1huZXpTelNIbWQyNS9WMHNaY3dleDk5?=
 =?utf-8?B?dDMvVXIza0lvOXhVQ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T1ljeGtvRnI3SEdPRzU5?=
 =?utf-8?B?eStWbVZFMEVCaFRkLzN6YVg4Q2s0V1FRMHdSdHdwd1l0RXJhYlp0T3NBZjl3?=
 =?utf-8?B?MUNVVFlOeUF1SGhXT0ZRTzl0VnFveW5QVzBxVy9US0JVSUpBdUlNTWllZEsz?=
 =?utf-8?B?OFNaMXcwVVkwdWxKYnFZd3BoUUpFYVpKNjk4UldtS3E4UmVISXBTeDB3TXdP?=
 =?utf-8?B?OEdLT0RxU0h5cm9KMWxRc3hYMk40eW1ONlN6NzhYaHgxbTZzcnBSdTR5ODd1?=
 =?utf-8?B?cFdyV0F0OFdsd2pKOUJ5K014NjB2TzZIN2VCc3dKQVJPc1hIQncvUU9OSmFQ?=
 =?utf-8?B?cGc1NjFQVVBnMFY0NGFSc0NBYkhiL1lPWmMxY3BsWmh6SHIrb0VIbG1PdGEv?=
 =?utf-8?B?NmIxak1oSExJRE5TZmRwazdpYWdvOXl3Wk1lL3Y4bjc4cTNLQzJURnFLN1lz?=
 =?utf-8?B?eExWbG14R2tkc28zUnRtNFhXK3VNWXlwMmdFQmxqVHFaT3ViUHJod3M1d3Z2?=
 =?utf-8?B?ZnhhYnJpdk4yay83UjFUZS9SL2VmWVhwdDRtUzR3K1I0OTZhSW02UTNRSmxI?=
 =?utf-8?B?bm9nNTFGZzR3QlN5U3VqTFNNejRlb004elA3VTZYZW5Wcmx3cG1BTWhOYzJB?=
 =?utf-8?Q?t8gDthgv4pG/fQYtjMGoOOl0m?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f430c91d-709b-41c9-67c3-08db81fd11f2
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 10:53:33.1703
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: P2afEehFV8pZptisQlZPmqffdcniPZBM/4psm79xhMM0Ktq0/IcEXEFnpT7lBQHMPLBTbYIyyNyhyyvRjf9jkA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9778

On 10.07.2023 16:43, Roger Pau MonnÃ© wrote:
> On Mon, Jul 10, 2023 at 12:56:27PM +0200, Jan Beulich wrote:
>> On 07.07.2023 11:53, Roger Pau Monne wrote:
>>> The current logic to init the local APIC and the IO-APIC does init the
>>> former first before doing any kind of sanitation on the IO-APIC pin
>>> configuration.  It's already noted on enable_IO_APIC() that Xen
>>> shouldn't trust the IO-APIC being empty at bootup.
>>>
>>> At XenServer we have a system where the IO-APIC 0 is handed to Xen
>>> with pin 0 unmasked, set to Fixed delivery mode, edge triggered and
>>> with a vector of 0 (all fields of the RTE are zeroed).  Once the local
>>> APIC is enabled periodic injections from such pin cause a storm of
>>> errors:
>>>
>>> APIC error on CPU0: 00(40), Received illegal vector
>>> APIC error on CPU0: 40(40), Received illegal vector
>>> APIC error on CPU0: 40(40), Received illegal vector
>>> APIC error on CPU0: 40(40), Received illegal vector
>>> APIC error on CPU0: 40(40), Received illegal vector
>>> APIC error on CPU0: 40(40), Received illegal vector
>>>
>>> That prevents Xen from booting.
>>
>> And I expect no RTE is in ExtInt mode, so one might conclude that
>> firmware meant to set up RTE 0 that way. Mainly as a remark, albeit
>> of course there's then the question whether to change the RTE
>> rather than masking it. What do ACPI tables say?
> 
> There's one relevant override:
> 
> [668h 1640   1]                Subtable Type : 02 [Interrupt Source Override]
> [669h 1641   1]                       Length : 0A
> [66Ah 1642   1]                          Bus : 00
> [66Bh 1643   1]                       Source : 00
> [66Ch 1644   4]                    Interrupt : 00000002
> [670h 1648   2]        Flags (decoded below) : 0000
>                                     Polarity : 0
>                                 Trigger Mode : 0
> 
> So IRQ 0 -> GSI 2, so it's likely pin 0 is the one the i8259 is
> connected to.

Then wouldn't we be better off converting that RTE to ExtInt? That
would allow PIC IRQs (not likely to exist, but still) to work
(without undue other side effects afaics), whereas masking this RTE
would not.

>>> --- a/xen/arch/x86/apic.c
>>> +++ b/xen/arch/x86/apic.c
>>> @@ -1476,6 +1476,10 @@ int __init APIC_init_uniprocessor (void)
>>>          return -1;
>>>      }
>>>  
>>> +    if ( smp_found_config && !skip_ioapic_setup && nr_ioapics )
>>> +        /* Sanitize the IO-APIC pins before enabling the local APIC. */
>>> +        sanitize_IO_APIC();
>>
>> I'm a little puzzled by the smp_found_config part of the check here,
>> but not in smp_prepare_cpus(). What's the reason for (a) the check
>> and (b) the difference?
> 
> This just mimics what gates the call to setup_IO_APIC() in that same
> function.  It makes no sense to call sanitize_IO_APIC() if
> setup_IO_APIC() is not called, and I wasn't planning on changing the
> logic that gates the call setup_IO_APIC() in this patch.
> 
> I did note the difference with smp_prepare_cpus(), and I think we
> should look at unifying those paths, but didn't want to do it as part
> of this fix.

Well, consistency is one valid goal. But masking RTEs may need to be
done more aggressively than setting up the IO-APICs. In particular
if we're not to use them, we still want to mask all RTEs. Otherwise
we're likely to observe each IRQ to arrive via two separate routes
(once through the 8259 and once from an unmasked IO-APIC pin).

>> Isn't checking nr_ioapics sufficient in this
>> regard? (b) probably could be addressed by moving the code to the
>> beginning of verify_local_APIC(), immediately ahead of which you
>> insert both call sites. (At which point the function may want naming
>> verify_IO_APIC() for consistency, but that's surely minor.)
> 
> I wanted the call to sanitize_IO_APIC() to be done at the same level
> where the call to setup_IO_APIC() is done, because it makes the logic
> clearer.

Hmm, I see.

>> As to also checking skip_ioapic_setup - wouldn't the unmasked pin be
>> similarly troublesome in that case?
> 
> skip_ioapic_setup is set when the IO-APIC address in the MADT is
> invalid, so in that case attempting to access IO-APIC registers in
> that case won't lead to anything good.

Of course, as I did say as well. Still if for some IO-APICs we know
their addresses, we would still be able to deal with those (if we
were to stick to this mask-all-RTEs-early model).

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 12:20:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 12:20:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561749.878254 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJCLW-0002ys-Vj; Tue, 11 Jul 2023 12:19:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561749.878254; Tue, 11 Jul 2023 12:19:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJCLW-0002yl-QF; Tue, 11 Jul 2023 12:19:58 +0000
Received: by outflank-mailman (input) for mailman id 561749;
 Tue, 11 Jul 2023 12:19:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=B4LE=C5=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJCLV-0002xM-6s
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 12:19:57 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20623.outbound.protection.outlook.com
 [2a01:111:f400:7d00::623])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3ebe4a8d-1fe5-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 14:19:55 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PAXPR04MB9595.eurprd04.prod.outlook.com (2603:10a6:102:23d::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul
 2023 12:19:54 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Tue, 11 Jul 2023
 12:19:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3ebe4a8d-1fe5-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=gVIbtFfAB0jWFmUbq5z4tqmG4HYVJVRqrgn7+58a1jbnVw6pqcOsDunkNZg2QZRS0RCw4gDsI/091U0BL+0YcyNF3LX687tjcMJ+a/lvNvgaWtr/0QPH6klWjboKWiEnJdNMbzoYswnM69JJBOSYFH65JxRPAF7M37ZjFt5CA96upPUVwYLbNdxaGInS2Y6pPR8ODUKinwQ6ou5dqm1QVlA/b/7WKpy2GC0LlhiEWoNoGIUiBZSxR2bGL1+I4BqcoJk3NVVM4+qR9Tvm8dlM6rUSGF9R6+RrdMBpV6KtG1SWeO4ivFY4SzYvvuXh90M9/YsYE15UJqvlhFQDnMCY/g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=KgSpG3/MCI5jpAoxrVGYqtnC9VjoxBr5nKP7YldgBbo=;
 b=ghFVWTightlKT25VIdi7UeXgGMrxAFg7ru7GsHP5E9MW0Rndhjm6MApd1innPu0Rbo3a27q0xYemCQ++B4y1pcV92uK7vMwIwAjCZGEV04UBeXhWU+bkgyT9vP0nPZdIZJfw91E/l452jjol3W51QkaymOgp1Vff9T/PkRvenhijw34HPGotPawsuUlad2o5P1fafIk+b+4nMwTVbhTpX3cUV+K1Wl88luXxMO90bza/nZpSVpB2UzUcreb/q3LkJVW5S58XQLr3Pa0QMFkIIpcMzA+b0H4/1JsTbgcWeRJvkoc/j8HIaD2ghb5nv2m5qoHVoiBQtQ0DeOfF5MAI6A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KgSpG3/MCI5jpAoxrVGYqtnC9VjoxBr5nKP7YldgBbo=;
 b=sAuD8sMdteyo/3PAI24rVJVMSdvM0p3CvHr1/3PXaxhBj6zm3PZyeN0LShdwm6SkjRwocraUryWIOP9yuQK/40JWHacI/JnhaqeB2xf36d23I1uuPvtCg6K9xRdGc+/va3SgCBRaZL+bkzJIPfh3HZDLVfipoGq43LhktSsxdhaP5KPHf1SwIEg4FoVEUeCdEX67WWIMfOMEUWmWnOOEFSwkoQYg96NNMkecJL/EZEpeUFouNO8uYLoN9bcWdpcDTTjemDGz9Y7LO+inPiVCVgDJJRx2xnfH6+m6o+03vKXSdfK1IWG5socohTFjoyzgaoILdM5lJCOb+rN+V7HQVg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <470b02cd-b98c-1819-ac99-d7a37f33b901@suse.com>
Date: Tue, 11 Jul 2023 14:19:52 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: Ping: [PATCH v2 0/2] new CONFIG_HAS_PIRQ and extra_guest_irqs
 adjustment
Content-Language: en-US
To: Julien Grall <julien@xen.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>
References: <85e59fd5-9a06-48b4-ba7e-81865d44e332@suse.com>
 <e14fdd8e-692b-bb19-627a-0462cce45de5@suse.com>
 <1c0ff25f-e3bd-e852-1836-c240d9273bc9@xen.org>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <1c0ff25f-e3bd-e852-1836-c240d9273bc9@xen.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0215.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ac::19) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAXPR04MB9595:EE_
X-MS-Office365-Filtering-Correlation-Id: cac68d42-a474-43f0-7625-08db820921ef
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	usEaQ4iY9QXhqyX0L0D7vPvpM8blotVYTb/hekdxSjEif9pTmnqLWcw22RCIYOEnMxPHk9OGV9Q/Z2xOMe6bT6Nw3vzcFZIyrtBpbDMngKNWHKSN6IvDIJqIt4lOvaK7C3xFMFHfIthOXSzomvsOB+1FXCeIsRkyKQKpt4bvp/HUpm9w3YbBCep91Jv8+WlDOVZd8EX18ABrTtXrsFnylUMzPk6N+FS8t5ft40tBMGr7Yd8L+zt9rARdwCVswkJVHSpdij/m/JKE+BRLW3kmSMeJlY/7DwsDabnbq6fIvZIE7bTSwXMBxPZ5PeiyzeBZ6S8qnlXViSyqtvScprkYAtHDf4Mp+u0ONlcQ5WdzpG+vdAXdCl/ubmpNBM+w9MiSZ1C7C/+0gYvQ6T93YtEZQzaqnLo7Emt4QuFTAgRNf7aA7WHCXLPhBH1FMEqCXgi+LwGMLrwS1oRVuLwVhBdj859dJP/rlUhJz9v2a/etGI6WhZTNAvUSEO4suM01sfUkp/82Qhhfs/azeMllGzpPi2+/T+BoA5Po95UKTmxkkN4mULCQO3dBgHXPNkGgnv+cey7YKc6mK83OQ/G/+ceBwx3yS/eEvh3lmOHyu9+c+LAts6b/TpM3PkeVPFwSGTDR7UVFcAa2u6XtBW/ZtKRaQA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(346002)(396003)(39860400002)(376002)(451199021)(36756003)(31696002)(86362001)(38100700002)(478600001)(54906003)(6486002)(6512007)(8676002)(5660300002)(316002)(2906002)(6916009)(66946007)(4326008)(66476007)(31686004)(66556008)(8936002)(41300700001)(2616005)(26005)(53546011)(6506007)(186003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SWtsb2ZuQXZsN2ZIUnRTWE1ERm1GRXA4QmRZeWZXRkNhN08zT0VrdkJR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NqemMzbDlTVWRNWGw5?=
 =?utf-8?B?bk96S1o4eWFrZnhRcGRHQURqSndLU1kxcWlOUmVDVXBGTzAzOFdSQUJQSVJ5?=
 =?utf-8?B?RjI1YTdBbFRiSFo0WTE1cU4xamFRV2FncmlTclNsd240bkRNVFRVYnJZY2hj?=
 =?utf-8?B?RUdNNm1qMzQ1VU9jWDRsbEFTZDkwY01LcVl4bC9UNmMzTnNxODRWWWJhMDFu?=
 =?utf-8?B?cDJac1NyNW40QWt3NVgrRkpDbElXVHpxTzVabXB4YzlTME5za1hLT3VvNlFi?=
 =?utf-8?B?akxOc0FOZjljdHhjSXN2OGVBNjdTSS9laTFkaWJaZTNrTSthdHJIaWNrWW91?=
 =?utf-8?Q?vljBAq4VbevLqTh56y6GmfPIr?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: cac68d42-a474-43f0-7625-08db820921ef
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 12:19:53.9777
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: TsQVEHwwfB0TkphXDYpiSz21+VZuz9FOTm4L9Kzlae15ovtU98+IDvmNJA98YJAyVmf/1+FZZOX7szJFVVhoGQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9595

On 11.07.2023 09:27, Julien Grall wrote:
> On 10/07/2023 08:33, Jan Beulich wrote:
>> On 03.05.2023 17:31, Jan Beulich wrote:
>>> The 1st patch (new in v2) has the effect of the 2nd one no longer
>>> affecting Arm.
>>>
>>> 1: restrict concept of pIRQ to x86
>>> 2: cmdline: document and enforce "extra_guest_irqs" upper bounds
>>
>> REST- and Arm-maintainers,
>>
>> may I please ask for some feedback here? Roger did supply some, resulting
>> in me considering to revert back to the earlier version (i.e. patch 1
>> dropped again and patch 2 minimally adjusted to address feedback there),
>> but which route to go wants input from other maintainers. What I think is
>> unacceptable is that we continue to not document and enforce the upper
>> bound, leading to people needlessly running into issues on big enough
>> systems.
> 
> I looked at patch #1, I think this the right approach for Arm. Do you 
> need further input?

I guess I'll reply to your comments on the patch itself. Feedback
there was what I was pinging for. So thanks for getting back.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 12:29:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 12:29:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561753.878263 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJCV1-0004SE-PM; Tue, 11 Jul 2023 12:29:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561753.878263; Tue, 11 Jul 2023 12:29:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJCV1-0004S7-M6; Tue, 11 Jul 2023 12:29:47 +0000
Received: by outflank-mailman (input) for mailman id 561753;
 Tue, 11 Jul 2023 12:29:46 +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 <SRS0=B4LE=C5=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJCV0-0004S1-Dk
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 12:29:46 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20617.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::617])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9c48d1c8-1fe6-11ee-8611-37d641c3527e;
 Tue, 11 Jul 2023 14:29:42 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PAXPR04MB8702.eurprd04.prod.outlook.com (2603:10a6:102:21d::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 11 Jul
 2023 12:29:38 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Tue, 11 Jul 2023
 12:29:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9c48d1c8-1fe6-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KzojWCzNAN48CUvcxGTjnOA2SG3Z9dhXLYcXyiVyhLm14Qi7cYDDDudrS60Nt9QX9yYswAVljOHV2tDOY+u/0yeevttDE00sHx7hSGgiV1rT/KmQlUTyIBR6FzSLzvFJT+RnIoYFgZwzZrdea63+mPybmx+EDFqJW3n4uvS6DzPY89MbGIFDMf0xVz80XCG9RI/CnJqh87sqxjglVueGTaMkydssLwMabniFMeSpChaTtW2Ik54581SE8sPFydsSCSi49st8FFPXB5zBU9RgGjm8aIUPw5/dGwehkO5WJRw0cCCQ0KncRee+Ovw+/kuAzIpzN7QwbNWLvUaKdc8PXA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=syXStTI23O0+gCg0sti8utaiolLVGzGb5ZTsLDaYJrE=;
 b=lRRChI6etqlRmJtS/K38Fg3e3SqDPPPWSNukBdaRt3t7GGgfjzIh9O76wvs/axRZVcBfJmas9mCYVN4OtfQAFO6dL2gJ49NX2BtB8gS9gCEnWu81i+Z62Z6mzjHORGq16S3LkGSaJ3wTmwyFEnA4nD7wOLLYc5403dpBbpZ5rrpEkn8OTotvXIDEJeU6vTBiTzpgqCghrkJ52O8tVhro21dmuKuXiToIUg4Qm/eSQ+e27BvNj3QY3NjQ627zv+ZOtY2fx0vHB5hfJUrNxGcuKYQBBxGBOVbsh3MGfiTaOISIkzQgCBUGBQjjzh3n7MsBj9LT1JX5sf1tVFZaWa9eEw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=syXStTI23O0+gCg0sti8utaiolLVGzGb5ZTsLDaYJrE=;
 b=nt8XB4GIOIIZ6Ox+/ZpEJgRxo3coI4Au2qqgixeSqdu9dpsGPK6IPpbZ4Iw+0dRTxgaKbn4/F19jfYDRQ9uWkIKhlFE6c87MD9fPtJNIZ9Gr/7AZuzuZh+xmcmDsagiOrfx8fDo0EAYbsv66RdnTfLNVd/5smRXWVNXoCg91L8V1BI38Ysm00qtuXxLQrL4mR9FRamKUgiEA3SZ54qr40Jf/p1RK/qqq4fkd/U2qDYcaaLBNSmNhNmux8XpIMRpOnKhLE3vHyMGa3cVzWoQmr+QaYguuLfYQS4RLCEZ9BncTsYoUfJYvNZlbwrm6o1vvC6Q8TJQpe0ewoMcvlT0ruw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <8cdf9179-7b3f-5a52-ff02-8ededbe03e0c@suse.com>
Date: Tue, 11 Jul 2023 14:29:37 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 1/2] restrict concept of pIRQ to x86
Content-Language: en-US
To: Julien Grall <julien@xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <85e59fd5-9a06-48b4-ba7e-81865d44e332@suse.com>
 <98f51b96-8a1c-7f33-b4d3-1744174df465@suse.com>
 <0cd9d94b-0a8d-a3e1-d683-04fac1572750@xen.org>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <0cd9d94b-0a8d-a3e1-d683-04fac1572750@xen.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0145.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:98::17) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAXPR04MB8702:EE_
X-MS-Office365-Filtering-Correlation-Id: 2d666d7c-89a4-48e0-07e9-08db820a7e8f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	C3Fh6WMvFxDwx0dG231K1lMyORKMYr2+x/zB6btsC+8iBOkfVhXTloqvoOSUZdJaxPDSrUTh0oGrc6p+YS7mswJOyV3c2pFEPrydtArp2CTiIFdidOZksB+bBusXb8oqtORs7qLrASw1pqgXyzrtpLqx600Cz3e/ipnOhDG6RI8imasqfqzCAkfRH/IJhuSpPriqxn8HZ58Zp/Anez+YjAM2uhAaAEfuVccHWR0muyUb6rKtZMlrIGhmVjVHN/0iPdXFyR9GqfBV50w9lLSbkW77aJmp43By7qdSXcNumPqQpvpSGlgYtmA/DhZgqniBoE+BTqtAv8Qi4lSkNWFbohH9RgyIJNuLzSD2kOrzcKMAZdImJA+NM+Bhdj74XAbwCemGJpmkrQ9yZPBmCqFMIYwc2ZL5xg+n5zy9nGJgzVgiwHUmYd/VD+iZNHRWyiDndXvCrG+yceO3novq9kqNtMZXwYOn3pXcCKmcKl7ayqDPsm9VXB2EHbKXgh7GMv5ENMameDS2Vazy1nBowDPxeF1gxKz1pDfYo8x5FSDmlLgEnBIgbzLN2hqi0BQ0DZVMZ2anxiI3J2/yo3S3ffPZMdoostJySZrLdFHz9FH5QpQIM2iHKNpZSOKdXyMqQqz22ss0KMZoN1M3XM4G/QBRLA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(136003)(376002)(366004)(346002)(39860400002)(451199021)(41300700001)(2906002)(5660300002)(8936002)(8676002)(36756003)(478600001)(2616005)(31686004)(26005)(6512007)(6506007)(186003)(6486002)(86362001)(6916009)(4326008)(66556008)(66946007)(66476007)(54906003)(38100700002)(31696002)(83380400001)(316002)(53546011)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?V1dhYy9rQnZRR3dURERzR2cwNHo4Ty9CczFQMmtDLzRBQ1hoMDJxTlF4Qkxj?=
 =?utf-8?B?c1JxMGZVN2xtQ0kwelBXZTAzTDk0ejBnNFQ4S2JDV0UyQko2QXdmSUZqWkQ5?=
 =?utf-8?B?a1ZBcnk0eXozazVVUjZRd2FleFloREVySTRPRm45UE9nNkVocnVYelYwUFVi?=
 =?utf-8?B?OUNOcVpNcjhCY1NXYUdINlB2T2kyWGgwSGlSUGxuVGk0dEVrZEhFck9CL05p?=
 =?utf-8?B?bnlyN3VqV1I5UmZTV20wNG53dmdVN2ZSL2FMaUxSMWZUejNOT3FIcm4xYW9S?=
 =?utf-8?B?ZkFlZXNpRGJ4U1RjK0NVV25sWlZIbEdTanpmODV5MTJEa2pEWTh4Z2JjaFVR?=
 =?utf-8?B?RzF6N3M3d25UQmVTaG5RWnZhL01zeExKQU1aR1VuOW1pQ1JwZjBRWWY5OU9t?=
 =?utf-8?B?Y01zVGVWMHNXNmY3NGlvS002MitBMDNwWks0Zk8yVTd3MjNvQUdEVXBlOXNU?=
 =?utf-8?B?dXFSRTkxaGpsYWRQQkhSZmp6VnZUV1FpeGxOd3hITnBnaTdEMXN2K0VtNTZo?=
 =?utf-8?B?QVptRVhUcmllRTV2NG1IMEdkQzdaTXN5ekcxSnA5dlM2ckxxdFVJSitNTFcx?=
 =?utf-8?B?bGlpUVRmYXZrRjEvQnNtVWN4cHIrTVJqVWgyclNOUVY2dzdyamJ2Ylp3S3hu?=
 =?utf-8?B?RisvVUVGbjlFZmplaTVhV09ZRU5SMU93TTYzTFJPejdpRXJYaER4QVZD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Zk5zVXlaTVhoQ1JZNUYwTmR5VWpYQ2trYlBCaFYzU1dESW14c0dN?=
 =?utf-8?B?Z2pFTml5dzB2NUR4YXJpQlhxeUJiMnJXck8zMkFYQmhBMU41a05abDRtbWxp?=
 =?utf-8?B?YTVFVXpsV0lneFF0QmJualJzTGludGhCRUFqY2hUQTkzY1VMVXY3c2xZMkdv?=
 =?utf-8?B?SG5rY05RR3E2U09sNDl0U0Q5d2pGa1VBNlVhbXJrNVgzSm9FT2ZjUUVxSjZh?=
 =?utf-8?B?T0hCYWROSG1WR2hDK1V4QjVXSkZ2bWpRNWFPK2hncElEeDFKVHVNV0EzeW54?=
 =?utf-8?B?dFZGazEzRllGcHNGYVY0SU5Lb0NoVi9ORkJ3NGxQNi8veWZiNlhKVXhhZE52?=
 =?utf-8?B?blEzRnE2Z3dsMUdIMWdBaFNjbzhBb0cwYjF2NXJza3BrcVYzSXVyMnVSb3ZW?=
 =?utf-8?B?YjQwMVY4YXVmdUZVWkNNSHloSGhuZGtuYzFOSm1jUHh0SXhJNDJ6b205ZnFW?=
 =?utf-8?B?RmsvWUlrWkdRNzdFb2pmeUgrWlRuSEtINUY0Q1lwdnEzWHJYb0F4TTNFcUxW?=
 =?utf-8?Q?SqU+aXk5afSywKdnbSlzki+pZ?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2d666d7c-89a4-48e0-07e9-08db820a7e8f
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 12:29:38.8542
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 6FqU6+v7kmY0mirzJGgilZ0aeXeiMlx64W7K6OlfODL+IRETQzGP9tx8+/09NvQdTyNCZ4eW1lq1q3aJzLjBmg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8702

On 10.07.2023 22:59, Julien Grall wrote:
>> ---
>> I'm not really certain about XEN_DOMCTL_irq_permission: With pIRQ-s not
>> used, the prior pIRQ -> IRQ translation cannot have succeeded on Arm, so
>> quite possibly the entire domctl is unused there? Yet then how is access
>> to particular device IRQs being granted/revoked?

(Leaving this in context, as it'll be relevant for the last comment you
gave.)

>> --- a/xen/common/domain.c
>> +++ b/xen/common/domain.c
>> @@ -350,6 +350,8 @@ static int late_hwdom_init(struct domain
>>   #endif
>>   }
>>   
>> +#ifdef CONFIG_HAS_PIRQ
>> +
>>   static unsigned int __read_mostly extra_hwdom_irqs;
>>   static unsigned int __read_mostly extra_domU_irqs = 32;
>>   
>> @@ -364,6 +366,8 @@ static int __init cf_check parse_extra_g
>>   }
>>   custom_param("extra_guest_irqs", parse_extra_guest_irqs);
>>   
>> +#endif /* CONFIG_HAS_PIRQ */
> 
> NIT: I would suggest create a file pirq.c and move anything PIRQ 
> specific there. This should reduce the number of #ifdef in the code.

I did consider that, but it looked quite a bit more intrusive to
me than the few #ifdef-s added to this file. (The ones in other
files would be yet uglier to eliminate, if that was to be implied
from your remark.)

>> @@ -1864,6 +1874,8 @@ long do_vm_assist(unsigned int cmd, unsi
>>   }
>>   #endif
>>   
>> +#ifdef CONFIG_HAS_PIRQ
>> +
> 
> With this change and some others, we probably can remove 
> alloc_pirq_struct() & co. I will have a look to send a clean-up patch 
> after this goes in.

Right, there's likely further cleanup possible.

>> --- a/xen/common/domctl.c
>> +++ b/xen/common/domctl.c
>> @@ -683,11 +683,13 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
>>           unsigned int pirq = op->u.irq_permission.pirq, irq;
>>           int allow = op->u.irq_permission.allow_access;
>>   
>> +#ifdef CONFIG_HAS_PIRQ
>>           if ( pirq >= current->domain->nr_pirqs )
>>           {
>>               ret = -EINVAL;
>>               break;
>>           }
>> +#endif
> 
> This #ifdef reads a little bit strange. If we can get away with the 
> check for Arm, then why can't when CONFIG_HAS_PIRQ=y? Overall, a comment 
> would be helpful.

As per the post-commit-message remark first of all I need to understand
why things were the way they were, and why (whether) that was correct
(or at least entirely benign) for Arm in the first place. Only then I'll
(hopefully) be in the position of putting a sensible comment here.

One thing is clear, I suppose: Without the #ifdef the code wouldn't
build. Yet imo if things all matched up, it should have been buildable
either way already in the past. Hence the questions.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 13:02:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 13:02:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561760.878273 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJD0p-0000Jn-7s; Tue, 11 Jul 2023 13:02:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561760.878273; Tue, 11 Jul 2023 13:02:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJD0p-0000Jg-4y; Tue, 11 Jul 2023 13:02:39 +0000
Received: by outflank-mailman (input) for mailman id 561760;
 Tue, 11 Jul 2023 13:02:37 +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
 <SRS0=rRYD=C5=citrix.com=prvs=54940d4e9=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qJD0n-0000Ja-Jk
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 13:02:37 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 32f1bf32-1feb-11ee-8611-37d641c3527e;
 Tue, 11 Jul 2023 15:02:34 +0200 (CEST)
Received: from mail-bn8nam12lp2169.outbound.protection.outlook.com (HELO
 NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.169])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 11 Jul 2023 09:02:23 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by CH0PR03MB5969.namprd03.prod.outlook.com (2603:10b6:610:e0::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Tue, 11 Jul
 2023 13:02:20 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2%5]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023
 13:02:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 32f1bf32-1feb-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689080554;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=GbzrxSEQN5Nktv2P0azVvj9xFD78cTllJWv+xgoLEWY=;
  b=PizUfnO+Pz4NyLoYtaGRGAPZnEQvMOn0xtAcDVcSbZGJSnGtgmEHpXJ8
   iVh5Iz6PWGUWFVLnvlSm+E48gNFAuOfuA5bpaBgw1SSqQP2lBQVb1Ym9Q
   Rkf2X3SN/HazjHliwN/OiDVfkXEnqyTqnFasQZIWqV2MWsAbGrlbg/3eT
   s=;
X-IronPort-RemoteIP: 104.47.55.169
X-IronPort-MID: 115123952
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:OCFDEaDjQiuahBVW/w/iw5YqxClBgxIJ4kV8jS/XYbTApG8mhjwDx
 2ZMCmCGP62IajOmfop+Oo+18R5VuJbdnNBiQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h
 yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs
 t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GxB5wRnDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS
 uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada
 jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIw27tvDkMQp
 NskFCkqbUCHqseK5p6iRbw57igjBJGD0II3nFhFlGucJ9B2BJfJTuPN+MNS2yo2ioZWB/HCa
 sEFaD1pKhPdfxlIPVRRA5U79AuqriCnL3sE9xTI+OxuvTm7IA9ZidABNPLPfdOHX4NNl1uwr
 WPa5WXpRBodMbRzzBLcqy/13LSewHmTtIQ6BKaI68dv2wWo220TFRkRUkOd+fy5hRvrMz5YA
 wlOksY0loAw/kG2Stj2XzWjvWWJ+BUbXrJ4DOkS+AyLjK3O7G6xFmUCCzJMdtEinMs3XiAxk
 E+EmcvzAj5iu6HTTmiSnop4thu3MCkRaGUENSkNSFJf58G5+d9iyBXSUtxkDai5yMXvHi39y
 CyLqy54gKgPickM1OOw+lWvby+Qm6UlhzUdvm3/Nl9JJCsgDGJ5T+REMWTm0Ms=
IronPort-HdrOrdr: A9a23:V1eNCKpxOjDkXps7HENaaHQaV5oMeYIsimQD101hICG9E/bo7/
 xG+c5x6faaslgssR0b9OxpFsG7IE80tqQFhLX5Xo3SPzUO2lHYVb2KhLGKq1fd8kvFh4xgPM
 xbHJSWZuedMbE0t7ef3OAUKadG/PCXtIqTraP1yXN1SAFjbKttqz1+Fh2QHiRNJDWuQaBJcq
 ah2g==
X-Talos-CUID: =?us-ascii?q?9a23=3A4zydoWuCsp8f/wOcQjFX3RP06IsEL2XS7imBBHO?=
 =?us-ascii?q?EEEFqGLm4bGO21Lprxp8=3D?=
X-Talos-MUID: =?us-ascii?q?9a23=3A0tLERw9FOzbNEsbgt7XNceKQf9dz07mXDRtVqog?=
 =?us-ascii?q?Hu9SAMitoHW+YjDviFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,196,1684814400"; 
   d="scan'208";a="115123952"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Y61AyWRNiHKmeNeZv7qLw/O7cnPbIlf3wp/J6mVxJDur+D91Sn6u1foPsaZKjenwVKsYuZH1oEAzMmasfJfKVpLvFcN/g/7TCcrpGLAyDE9KKrdIvjVknyMERoWBcEFX2dhrzdLz0pL9AybyjUg22X76uuGEkJyQkMV8mBEvZJpCqlmWpMpG7WJf7I90NX+Ishr8uIyncKdeSWYajfnWy73Qn7HcWOP9Ir5BayLjQHQy6r0WvVRwTQu6vJtoMByqtKF7BpHSin5EUMXv+C3cwXaWloHTzf0F3jU5ygCG0LmsTmDDsZNiTxLoddkhphLCaszmbMgUvL1pJj9IlAxYug==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3U/MC3s1bATOC1m3p28D0fmyspNQvfKwMStXKvWIuSY=;
 b=B43fnfCDAuUcdg4TIciSiVd/y6TkK39kPOwyd2TRvqiSQ/iYIFSP6P0xD6lbZvI1PfbMoBAwfiSU2eRMrCPlrcC+vNcS04WK3/mk0m8sWY2Il4GQungh1pjOcaw7nFgMdIsGB4Hbf5JiPH7Psdq7cybFtki0dMaTQf9MDBxM32iAoWSEuC/jZ1pjFB9aQ6kNzSNjP9714N+ThCh1rkQ464I5zDwR/crnf+C0SM5OyAaN5jX15Kr2KzHrSOnJNxzNlFY41pfqAZn5gImCmv/24Hf/sI5UslSBrnBK4P2sbAL6JlMxchzqxH/whP0XiMw3/o/xemNIH21guZdQM8UIzA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3U/MC3s1bATOC1m3p28D0fmyspNQvfKwMStXKvWIuSY=;
 b=ucOgXjGC7Zc6vj1nvpoTqf3sGxgT2qLjJZ3U3ogFbXW9Rze/Swl4hRCsRLNQkfI6PWmRBub57FUWMyUvGhiW8v8SBWJDrNh+tSUVifJP3GApJfNTH4YhuYhmc8N8ARp028Puu+6aoZLziTycrjP1UZqv8EGOD7BSQTHzgNQb0JY=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Tue, 11 Jul 2023 15:02:13 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] x86/ioapic: sanitize IO-APIC pins before enabling the
 local APIC
Message-ID: <ZK1S1V71ZUIPjKqZ@MacBook-Air-de-Roger.local>
References: <20230707095338.44244-1-roger.pau@citrix.com>
 <92d16012-ff9f-693b-07c6-d45fe07a00a0@suse.com>
 <ZKwZBQ_0Z2c7NJNL@MacBook-Air-de-Roger.local>
 <1f79491a-46f5-5293-e92f-0e2b0b3efb62@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <1f79491a-46f5-5293-e92f-0e2b0b3efb62@suse.com>
X-ClientProxiedBy: LO6P123CA0036.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:2fe::10) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|CH0PR03MB5969:EE_
X-MS-Office365-Filtering-Correlation-Id: fa9ec487-c22c-4be6-80c1-08db820f0f36
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	34PLRaZf86PX2xvATS1ag+4whZsWMxh9bny0FFKX6nb0on+B6rQ6pSLSUApmhRdH7bx7bVuSvzADl8XQa2v5g4G60LeW+NF/CF4Fw8xm+s/+CRzw8YojTMDjrKWusONtjVjMtTmWnKkPQq6gqmSy+KlgAMunExLgV5gOYQi2S5+BpiRxnQ11qF0az8TubpO5GIZubuZp+rfUlBAvKk+3JoFAljQdTBojKxmGK2skH4Wrf+Tjlg/Qwv24N2xf47vole7syYA0/WXhWkCuXWDlKMwFt8dTNA/O2peJPVb1q5brKpZ2T2aDcqcmPMGf8UqXY3XgYrdAbVM2XOabW52uN4Byr9OsVEsYffxwwj/RwdjwX9/QG2hpE3QBQOrRHdfSY+XYJIOJHgKmRIRs8mbi65zNlFlwKX40TziEEiRkTj94yliwYUbC0zzmtU4jCtAajj6kKQR2XLwiSyKoSNzUkAii03/OF2WiZcvEkzkv/+HPUMKac1uWZLNp2+MPeM6kkT8C/Xp/YWAX35eKMF8E615oatDFhOxfEUuQh1AhMbzBkvv7ZSr0pPVFovSVYPW0
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(39860400002)(396003)(366004)(346002)(451199021)(8676002)(8936002)(5660300002)(83380400001)(186003)(26005)(53546011)(6506007)(86362001)(41300700001)(66899021)(6666004)(6486002)(316002)(6512007)(9686003)(66476007)(66556008)(2906002)(66946007)(82960400001)(6916009)(85182001)(4326008)(54906003)(478600001)(38100700002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?amtPQjBid0NNS0JnZ0cvNHFZV3dnc2E3cHc0OENtWlNwL1pHTmtlaDZENUhR?=
 =?utf-8?B?NVRjYXV5cjFNU2JLcDIycTdXTmRxcHRHTjNrVy90c1JSNUxTWFhnU3BORHpQ?=
 =?utf-8?B?NEVwcHQ3T2tpS3AyY3pBNU9QZVlCYUg3SmxQTXRyNVBiUFMyMFlnc1BlVDF6?=
 =?utf-8?B?dmxHN0hrbmFYUklqcjFReFhxd2JKOXE3Q0EwZGRNMjFYTXJGOTZnUm51YXRs?=
 =?utf-8?B?cmFBUXNSYUdqRlorUGc3S0kwSU5VOExxOVNEaENPMXZiZG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wLUVa//SsoC
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: fa9ec487-c22c-4be6-80c1-08db820f0f36
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 13:02:19.7391
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 0aolR2M1YJzskoF6rvLrhmpG7nJIYJRIExHNNBqNPjpFrNfWzrCxstVUk+1Bntg8jQfVwM3jX7mH4YzqjnsH0A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR03MB5969

On Tue, Jul 11, 2023 at 12:53:31PM +0200, Jan Beulich wrote:
> On 10.07.2023 16:43, Roger Pau MonnÃ© wrote:
> > On Mon, Jul 10, 2023 at 12:56:27PM +0200, Jan Beulich wrote:
> >> On 07.07.2023 11:53, Roger Pau Monne wrote:
> >>> The current logic to init the local APIC and the IO-APIC does init the
> >>> former first before doing any kind of sanitation on the IO-APIC pin
> >>> configuration.  It's already noted on enable_IO_APIC() that Xen
> >>> shouldn't trust the IO-APIC being empty at bootup.
> >>>
> >>> At XenServer we have a system where the IO-APIC 0 is handed to Xen
> >>> with pin 0 unmasked, set to Fixed delivery mode, edge triggered and
> >>> with a vector of 0 (all fields of the RTE are zeroed).  Once the local
> >>> APIC is enabled periodic injections from such pin cause a storm of
> >>> errors:
> >>>
> >>> APIC error on CPU0: 00(40), Received illegal vector
> >>> APIC error on CPU0: 40(40), Received illegal vector
> >>> APIC error on CPU0: 40(40), Received illegal vector
> >>> APIC error on CPU0: 40(40), Received illegal vector
> >>> APIC error on CPU0: 40(40), Received illegal vector
> >>> APIC error on CPU0: 40(40), Received illegal vector
> >>>
> >>> That prevents Xen from booting.
> >>
> >> And I expect no RTE is in ExtInt mode, so one might conclude that
> >> firmware meant to set up RTE 0 that way. Mainly as a remark, albeit
> >> of course there's then the question whether to change the RTE
> >> rather than masking it. What do ACPI tables say?
> > 
> > There's one relevant override:
> > 
> > [668h 1640   1]                Subtable Type : 02 [Interrupt Source Override]
> > [669h 1641   1]                       Length : 0A
> > [66Ah 1642   1]                          Bus : 00
> > [66Bh 1643   1]                       Source : 00
> > [66Ch 1644   4]                    Interrupt : 00000002
> > [670h 1648   2]        Flags (decoded below) : 0000
> >                                     Polarity : 0
> >                                 Trigger Mode : 0
> > 
> > So IRQ 0 -> GSI 2, so it's likely pin 0 is the one the i8259 is
> > connected to.
> 
> Then wouldn't we be better off converting that RTE to ExtInt? That
> would allow PIC IRQs (not likely to exist, but still) to work
> (without undue other side effects afaics), whereas masking this RTE
> would not.

I'm kind of worry of trying to automate this logic.  Should we always
convert pin 0 to ExtInt if it's found unmasked, with and invalid
vector and there's a source override entry for the IRQ?

It seems weird to infer this just from the fact that pin 0 is all
zeroed out.

> >>> --- a/xen/arch/x86/apic.c
> >>> +++ b/xen/arch/x86/apic.c
> >>> @@ -1476,6 +1476,10 @@ int __init APIC_init_uniprocessor (void)
> >>>          return -1;
> >>>      }
> >>>  
> >>> +    if ( smp_found_config && !skip_ioapic_setup && nr_ioapics )
> >>> +        /* Sanitize the IO-APIC pins before enabling the local APIC. */
> >>> +        sanitize_IO_APIC();
> >>
> >> I'm a little puzzled by the smp_found_config part of the check here,
> >> but not in smp_prepare_cpus(). What's the reason for (a) the check
> >> and (b) the difference?
> > 
> > This just mimics what gates the call to setup_IO_APIC() in that same
> > function.  It makes no sense to call sanitize_IO_APIC() if
> > setup_IO_APIC() is not called, and I wasn't planning on changing the
> > logic that gates the call setup_IO_APIC() in this patch.
> > 
> > I did note the difference with smp_prepare_cpus(), and I think we
> > should look at unifying those paths, but didn't want to do it as part
> > of this fix.
> 
> Well, consistency is one valid goal. But masking RTEs may need to be
> done more aggressively than setting up the IO-APICs. In particular
> if we're not to use them, we still want to mask all RTEs. Otherwise
> we're likely to observe each IRQ to arrive via two separate routes
> (once through the 8259 and once from an unmasked IO-APIC pin).

So avoid the smp_found_config check here and use the same condition as in
smp_prepare_cpus(), I will adjust the patch to that effect.

I do wonder why we don't simply mandate IO-APIC usage and get rid of
the code to handle the 8259.  Is it only to cope with systems that
have a broken IO-APIC configuration?  Because I don't think there are
x86 64bit systems without an IO-APIC?

> >> Isn't checking nr_ioapics sufficient in this
> >> regard? (b) probably could be addressed by moving the code to the
> >> beginning of verify_local_APIC(), immediately ahead of which you
> >> insert both call sites. (At which point the function may want naming
> >> verify_IO_APIC() for consistency, but that's surely minor.)
> > 
> > I wanted the call to sanitize_IO_APIC() to be done at the same level
> > where the call to setup_IO_APIC() is done, because it makes the logic
> > clearer.
> 
> Hmm, I see.
> 
> >> As to also checking skip_ioapic_setup - wouldn't the unmasked pin be
> >> similarly troublesome in that case?
> > 
> > skip_ioapic_setup is set when the IO-APIC address in the MADT is
> > invalid, so in that case attempting to access IO-APIC registers in
> > that case won't lead to anything good.
> 
> Of course, as I did say as well. Still if for some IO-APICs we know
> their addresses, we would still be able to deal with those (if we
> were to stick to this mask-all-RTEs-early model).

The issue is that ioapic_init_mappings() will refuse to process
further IO-APIC entries once an entry with address 0 is found.  We
could change that, but I would likely do it as an improvement rather
than tie it to this change.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 14:16:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 14:16:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561768.878283 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJE9b-0007mS-KX; Tue, 11 Jul 2023 14:15:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561768.878283; Tue, 11 Jul 2023 14:15:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJE9b-0007mL-GD; Tue, 11 Jul 2023 14:15:47 +0000
Received: by outflank-mailman (input) for mailman id 561768;
 Tue, 11 Jul 2023 14:15:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJE9Z-0007mB-Hf; Tue, 11 Jul 2023 14:15:45 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJE9Z-0000p9-FA; Tue, 11 Jul 2023 14:15:45 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJE9Z-00060d-5m; Tue, 11 Jul 2023 14:15:45 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJE9Z-0001zH-5O; Tue, 11 Jul 2023 14:15:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=aEPWmulPUjg6S84d7zNDi7vp1c/BKf66DBa+TcyC3FY=; b=yEJDEi7BI13EwwtzHAgkDqlBWp
	kz+KbRvzu5ANfVCQy86b7KHJDz1JK7r/SNe/+v+l1aA6gAV0lw4Jd73Kk7QRHqbqMZKsN3s9nlAOc
	qpgCAzR0vBWiEfBJJ8zFawUZw8AnCaVHC2s+waSNWbJIMGkw7+xshbX5f1vzEmZ+iFVA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181759-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 181759: tolerable FAIL - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt-qcow2:guest-start:fail:heisenbug
    libvirt:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=3bf02acdc5446b2c4a3078f99d8f5232acff9043
X-Osstest-Versions-That:
    libvirt=5f7f6ceb47b8bec3f8ad93599f95b755e00e439a
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 11 Jul 2023 14:15:45 +0000

flight 181759 libvirt real [real]
flight 181764 libvirt real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181759/
http://logs.test-lab.xenproject.org/osstest/logs/181764/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-libvirt-qcow2 13 guest-start       fail pass in 181764-retest
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail pass in 181764-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check fail in 181764 like 181738
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check fail in 181764 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181738
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181738
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 libvirt              3bf02acdc5446b2c4a3078f99d8f5232acff9043
baseline version:
 libvirt              5f7f6ceb47b8bec3f8ad93599f95b755e00e439a

Last test of basis   181738  2023-07-08 04:18:54 Z    3 days
Testing same since   181759  2023-07-11 04:18:51 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Boris Fiuczynski <fiuczy@linux.ibm.com>
  Han Han <hhan@redhat.com>
  Michal Privoznik <mprivozn@redhat.com>
  Shalini Chellathurai Saroja <shalini@linux.ibm.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-libvirt-vhd                                 fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   5f7f6ceb47..3bf02acdc5  3bf02acdc5446b2c4a3078f99d8f5232acff9043 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 14:16:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 14:16:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561771.878293 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJEAC-0008DT-TF; Tue, 11 Jul 2023 14:16:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561771.878293; Tue, 11 Jul 2023 14:16:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJEAC-0008DM-Pr; Tue, 11 Jul 2023 14:16:24 +0000
Received: by outflank-mailman (input) for mailman id 561771;
 Tue, 11 Jul 2023 14:16:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=cjKM=C5=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qJEAB-0008Bn-12
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 14:16:23 +0000
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
 [2a00:1450:4864:20::535])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8185fc47-1ff5-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 16:16:21 +0200 (CEST)
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-51e99584adaso987545a12.0
 for <xen-devel@lists.xenproject.org>; Tue, 11 Jul 2023 07:16:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8185fc47-1ff5-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689084979; x=1691676979;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=n3t8MOjTESHetojE5fepGdnt7zMEWWqb4KmlEDKAmrw=;
        b=lLPy8qQdQeVZlUsxKQYaJLJW/pRKVT3RgzV3onHlXD9XGicpVghKdWDR7Qca8Ldx8Q
         OnDO3DMSzqvfMIiP+Zb7CxDqb65f2nfivrjrkJ/Gj2tTTMhmoe3ZPLprOEGyHZf60CVx
         B3YutWTQcJ4fxKDbvoxslude/QIxSYvb/oRhglyshFABS9C8eDxCtOMVucCr6xnGcQJM
         7Mq/UQvC1ryWZyKb/w0Erdiep3ZlMxnC6eZ5h2DjXa3zdG9OdDnLKUKYKvo4a0yayoMA
         RyYYK8LSmmYZfeD7cMKx/9NpUdSGmCkLlmmMiRLggVpm+ezfdaEa8iTxk01w4b2ZUbYn
         /JWw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689084979; x=1691676979;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=n3t8MOjTESHetojE5fepGdnt7zMEWWqb4KmlEDKAmrw=;
        b=HOYBTcKMNF2CCXz+l+ilGGkyysc7hjS6mqQY3JzzeP7DRcDKsGYxywvAewDLqNs/hD
         99ffHZ2q9Fg4kMPGgL9lADvXlIATrErDtMY+9qV1yT4/7w15VtNwiAqmXFo+I99LIosO
         mtc/g6MmxXg1i3d5NZUqlceYp6DVum0YWuh0GBAd/B5NiCtuzQx9xiZkCGu7AmdfbHKA
         MzqoVuEjv8COtg0MP/ljc+Ab60fKMAfQf7t5zccwLXaDJZmgxyE14xfR5U9PiVeT/WQE
         vmoRM/uFzuwmHTPVidoNYirDHdjMzn5ASVAmaT7tZg2hj7mKEwVl3uFvN4owkfUDzyWG
         xb8w==
X-Gm-Message-State: ABy/qLbWzNhmQSBH0ScsFqAAfAmI1TMHq99l/3qhiUmvNB43zpjCqX/W
	stBKTTisMLCyp6fQ/YvxPbnoETvX4+tGJkD8W4JKfMpduv4=
X-Google-Smtp-Source: APBJJlGOIp5rwlECl7uk8jJAujph+1MLuxYpGT+85R80mQBnZI4aUUZfjp5N0o/SUQ41INgJfHTAej8bL60SfwmKrPw=
X-Received: by 2002:aa7:c042:0:b0:51e:be0:d2ea with SMTP id
 k2-20020aa7c042000000b0051e0be0d2eamr15091559edo.9.1689084978963; Tue, 11 Jul
 2023 07:16:18 -0700 (PDT)
MIME-Version: 1.0
References: <20230706185440.48333-1-jandryuk@gmail.com> <20230706185440.48333-7-jandryuk@gmail.com>
 <eeeb032f-a21b-5eb2-e3d5-63357a04a500@suse.com> <CAKf6xptn0OL0qz+DW9qrwU=sFSKSp-O3S7z6vFbZp9RstFanbw@mail.gmail.com>
 <bfacee48-f640-f2eb-7fd7-f440ad03e612@suse.com>
In-Reply-To: <bfacee48-f640-f2eb-7fd7-f440ad03e612@suse.com>
From: Jason Andryuk <jandryuk@gmail.com>
Date: Tue, 11 Jul 2023 10:16:05 -0400
Message-ID: <CAKf6xpvVd49dx=CtGyPMt+NMuOfhJ4a1fiZb-O4e-guq9BwcFw@mail.gmail.com>
Subject: Re: [PATCH v5 06/15] cpufreq: Add Hardware P-State (HWP) driver
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, 
	Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 11, 2023 at 4:18=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wro=
te:
>
> On 10.07.2023 17:22, Jason Andryuk wrote:
> > On Mon, Jul 10, 2023 at 9:13=E2=80=AFAM Jan Beulich <jbeulich@suse.com>=
 wrote:
> >> On 06.07.2023 20:54, Jason Andryuk wrote:
> >>> @@ -510,6 +510,22 @@ choice of `dom0-kernel` is deprecated and not su=
pported by all Dom0 kernels.
> >>>  * `<maxfreq>` and `<minfreq>` are integers which represent max and m=
in processor frequencies
> >>>    respectively.
> >>>  * `verbose` option can be included as a string or also as `verbose=
=3D<integer>`
> >>> +  for `xen`.  It is a boolean for `hwp`.
> >>> +* `hwp` selects Hardware-Controlled Performance States (HWP) on supp=
orted Intel
> >>> +  hardware.  HWP is a Skylake+ feature which provides better CPU pow=
er
> >>> +  management.  The default is disabled.  If `hwp` is selected, but h=
ardware
> >>> +  support is not available, Xen will fallback to cpufreq=3Dxen.
> >>> +* `<hdc>` is a boolean to enable Hardware Duty Cycling (HDC).  HDC e=
nables the
> >>> +  processor to autonomously force physical package components into i=
dle state.
> >>> +  The default is enabled, but the option only applies when `hwp` is =
enabled.
> >>> +
> >>> +There is also support for `;`-separated fallback options:
> >>> +`cpufreq=3Dhwp,verbose;xen`.  This first tries `hwp` and falls back =
to `xen`
> >>> +if unavailable.
> >>
> >> In the given example, does "verbose" also apply to the fallback case? =
If so,
> >> perhaps better "cpufreq=3Dhwp;xen,verbose", to eliminate that ambiguit=
y?
> >
> > Yes, "verbose" is applied to both.  I can make the change.  I
> > mentioned it in the commit message, but I'll mention it here as well.
>
> FTAOD my earlier comment implied that the spelling form you use above
> should not even be accepted when parsing. I.e. it was not just about
> the doc aspect.

Oh.  So what exactly do you want then?

There is a single cpufreq_verbose variable today that is set by either
cpufreq=3Dhwp,verbose or cpufreq=3Dxen,verbose.  Is that okay, or should
the "xen" and "hwp" each get a separate variable?

Do you only want to allow a single trailing "verbose" to apply to all
of cpufreq (cpufreq=3D$foo,verbose)?  Or do you want "verbose" to be
only valid for "xen"?  Both cpufreq_cmdline_parse() and
hwp_cmdline_parse() just loop over their options and don't care about
order, even though the documentation lists verbose last.  Would you
want "cpufreq=3Dhwp,verbose,hdc" to fail to parse?

All parsing is done upfront before knowing whether "xen" or "hwp" will
be used as the cpufreq driver, so there is a trickiness for
implementing "verbose" only for one option.  Similarly,
"cpufreq=3Dhwp,invalid;xen" will try "hwp" (but not "xen")  since the
live variables are updated.  Even without this patch, cpufreq will be
configured up to an invalid parameter.

FYI, cpufreq=3Dxen;hwp will be accepted.  "xen" shouldn't fail, so it
doesn't make sense to specify that.  But it didn't seem necessary to
prevent it.

> >>> +            {
> >>> +                switch ( cpufreq_xen_opts[i] )
> >>> +                {
> >>> +                case CPUFREQ_xen:
> >>> +                    ret =3D cpufreq_register_driver(&acpi_cpufreq_dr=
iver);
> >>> +                    break;
> >>> +                case CPUFREQ_hwp:
> >>> +                    ret =3D hwp_register_driver();
> >>> +                    break;
> >>> +                }
> >>> +
> >>> +                if ( ret =3D=3D 0 )
> >>> +                    break;
> >>> +            }
> >>>              break;
> >>
> >> In this model any kind of failure results in the fallback to be tried
> >> (and the fallback's error to be returned to the caller rather than
> >> the primary one). This may or may not be what we actually want;
> >> personally I would have expected
> >>
> >>                 if ( ret !=3D -ENODEV )
> >>                     break;
> >>
> >> or some such instead.
> >
> > I guess this comes back to our fruit preferences. :)
>
> Does it? It's not just a style question here, but one of when / whether
> to use the fallback.

Indeed.  I was trying to allude back to the earlier conversation.  Do
we try the pears only when there are no apples or also when the apples
are "bad"?  Only falling back for no apples is fine.

> > I can switch it around like that, and make hwp_register_driver()
> > return -ENODEV for hwp_available() returning false.
>
> Thanks.
>
> >>> +int __init hwp_cmdline_parse(const char *s, const char *e)
> >>> +{
> >>> +    do
> >>> +    {
> >>> +        const char *end =3D strpbrk(s, ",;");
> >>> +
> >>> +        if ( s && !hwp_handle_option(s, end) )
> >>
> >> This check of s not being NULL comes too late, as strpbrk() would have
> >> de-referenced it already. Considering ...
> >>
> >>> +        {
> >>> +            printk(XENLOG_WARNING "cpufreq/hwp: option '%s' not reco=
gnized\n",
> >>> +                   s);
> >>> +
> >>> +            return -1;

I should change this to -EINVAL.

> >>> +        }
> >>> +
> >>> +        s =3D end ? ++end : end;
> >>> +    } while ( s && s < e );
> >>
> >> ... this it probably wants to move even ahead of the loop.
> >
> > I'll switch from do/while to just while and then the NULL check will
> > be covered.  In practice, this function is never called with s =3D=3D
> > NULL.
>
> In which case - why not leave things largely as they are, simply dropping
> the odd check of s?

Sure.

> >>> +    if ( data->curr_req.raw =3D=3D -1 )
> >>> +    {
> >>> +        hwp_err(cpu, "Could not initialize HWP properly\n");
> >>> +        per_cpu(hwp_drv_data, cpu) =3D NULL;
> >>> +        xfree(data);
> >>> +        return -ENODEV;
> >>> +    }
> >>> +
> >>> +    data->minimum =3D data->curr_req.min_perf;
> >>> +    data->maximum =3D data->curr_req.max_perf;
> >>> +    data->desired =3D data->curr_req.desired;
> >>> +    data->energy_perf =3D data->curr_req.energy_perf;
> >>> +    data->activity_window =3D data->curr_req.activity_window;
> >>> +
> >>> +    if ( cpu =3D=3D 0 )
> >>> +        hwp_verbose("CPU%u: HWP_CAPABILITIES: %016lx\n", cpu, data->=
hwp_caps);
> >>
> >> While I'm fine with this (perhaps apart from you using "cpu =3D=3D 0",
> >> which is an idiom we're trying to get rid of), ...
> >
> > Oh, I didn't know that.  What is the preferred way to identify the
> > BSP?
>
> Sometimes we pass a separate boolean to functions, in other cases we
> check whether a struct cpuinfo_x86 * equals &boot_cpu_info. The
> latter clearly can't be used here, and the former doesn't look to be
> a good fit either. However, ...
>
> >  This doesn't necessarily run on the BSP, so "cpu"/"policy->cpu"
> > is all we have to make a determination.
>
> ... isn't it, conversely, the case that the function only ever runs
> on "cpu" when it is the BSP? In which case "cpu =3D=3D smp_processor_id()=
"
> ought to do the trick.

The calls do not necessarily run from the BSP.  The cpufreq init
callbacks run later when dom0 uploads the ACPI processor data.  If you
don't want "cpu =3D=3D 0", maybe just print for the first CPU regardless
of number, and then print differences from that?

Regards,
Jason


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 14:41:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 14:41:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561779.878302 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJEY5-0003Fd-Mp; Tue, 11 Jul 2023 14:41:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561779.878302; Tue, 11 Jul 2023 14:41:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJEY5-0003FW-Jb; Tue, 11 Jul 2023 14:41:05 +0000
Received: by outflank-mailman (input) for mailman id 561779;
 Tue, 11 Jul 2023 14:41:04 +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 <SRS0=B4LE=C5=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJEY4-0003FQ-LN
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 14:41:04 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on2061b.outbound.protection.outlook.com
 [2a01:111:f400:fe13::61b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f53a528b-1ff8-11ee-8611-37d641c3527e;
 Tue, 11 Jul 2023 16:41:02 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by DB9PR04MB8316.eurprd04.prod.outlook.com (2603:10a6:10:246::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul
 2023 14:41:00 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Tue, 11 Jul 2023
 14:41:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f53a528b-1ff8-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CdZ8vHYtQVvmz593Ayc/1mRsem48QQmUACU71+fhNX7Tr7gvitIonSnOiXNDg5Es6LD4V10z3dZEVwXjwqfreYW3YIftQCZcT9vvjQ9v/g7jZf3dl5JkJLFVFPQAfgQakUSP8xNRE0kUIBW320bz4omx0NWb0nG453zwFUIx8GwoTD4/gI88bd79KzjVXfBHee9KhQxHqAoBt9T5kFlsB76qGuff3r/iHndsp2uLF5O3DhPwXbNY2K7Bd2dlgwiXeYJnUP0SsP4Sirc8Dp8unQZ3Lq15NS6AdLBgoUEwXpYZm5RIp+JiU9U5/zk9H+Vb2smDwAaBnGTKBE8x5/XTjw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3eCMYDj8YVuWQ5O9a/ggtOvR1J3EVo9UBfTkFfcnpJw=;
 b=N9HiKWfl4OcnsAruIm9rzNRAC4DGJzUMZDXJyK2Xm4jzivqtxwR+IvpxxtoViBgQDrpNY1vsHzGgGA6fzfPh4nnB553KueZs+VLJqg9a0bDqRuYxSR5aa5AlZAID+2tM9WKfK0wExJ1s+gcQlnw14kDbnC1+XfmNuO1av+44/GUvnrJeBoPVG+0mFh55ytCJKofsf/hOCN7vnHPo1iBALBwVpDkhiu04x+B6rCkXevGkS/CXl0oEPiTIdPXc8O+zbPf4BC04F8x0yWe1b2RIvQpis23pXUtB1ME/R8Mwbrf5W7W2VLsgc30+pjNnEjeCITsTp40yU1mwZDb9tpw1+Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3eCMYDj8YVuWQ5O9a/ggtOvR1J3EVo9UBfTkFfcnpJw=;
 b=M1ZzvReeeOUtklWc0hJGWvX5717jImTsrZS/xak5+f5xGxGFvMQ4m1x+pw08SNLFllvGXQpWh+Ur8uDQyYOyZCov0K2dbbB0GTb3peKK+7XF9mjTc4FbDHp5mx7C7/gwPhLfX5txq7A845Un4ile02Skvojgk4XrY8JLFTWONyhW2GFcsvy5BgkoBgIhS8RB2XVfdqfITUD2yR4rPJKqCuOBGWKgasLJJCC7i/8rl0VS02NvxJ2hwUQUl0QKgBFDobpxsV4lmJsxgTaCsHtrGB9d4oy0+15AplRRTbLFTFEUs1m8v0JKiOxW90fQtA6X9lyHDK6pJTnny2jgyZaxKg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <cdbaec77-9112-7b18-e9eb-fa12a16d2ccf@suse.com>
Date: Tue, 11 Jul 2023 16:40:58 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v5 06/15] cpufreq: Add Hardware P-State (HWP) driver
Content-Language: en-US
To: Jason Andryuk <jandryuk@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20230706185440.48333-1-jandryuk@gmail.com>
 <20230706185440.48333-7-jandryuk@gmail.com>
 <eeeb032f-a21b-5eb2-e3d5-63357a04a500@suse.com>
 <CAKf6xptn0OL0qz+DW9qrwU=sFSKSp-O3S7z6vFbZp9RstFanbw@mail.gmail.com>
 <bfacee48-f640-f2eb-7fd7-f440ad03e612@suse.com>
 <CAKf6xpvVd49dx=CtGyPMt+NMuOfhJ4a1fiZb-O4e-guq9BwcFw@mail.gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <CAKf6xpvVd49dx=CtGyPMt+NMuOfhJ4a1fiZb-O4e-guq9BwcFw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0265.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b5::14) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DB9PR04MB8316:EE_
X-MS-Office365-Filtering-Correlation-Id: 1fb7ae33-2c90-43d9-2ca6-08db821cd81e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	E4EzkhSDTlZzLBlpdGPZKYbIeh4y4j8xVQTDny+WPyEJCFkaaI2lQY83bjnL0/NFNDu8qsqmrBIuItBc2IVZ754LWJysZXmUzj7YK+RI/z0TmIo9b8Xd582DyTC58HvXQ2kJV7t00oiIzAN8Sq8iRMdfSP3gyxKCjHPBWCOXRXSH43c7CqG32fQjO2HDGc+N3eDzsChbSorDtl2FItBOPoTgQQiN4oy7M69BjCPcEtFl0I+K8EImohTCNGBty+0mYmPCXw40q8Y4gDxQnQ02bNue+kxdK4fgGanKqlIYRt3cr+xL9QclKBxMlq92DWo5fJm0EmyKvJWSf6UOUQMo7XSR8Ysnodga39zoRxbV46Zp23gTGj9knvYD3A6IBHtPi/17xQFXY/4rb83QGUaEsWUEhnkTCAdh6ipKgyTcJo8NK4fcM13xUKlkHozjQdbXHDPm0/3kjdI4mFQtt05d52/DfAbHs90G7Jd+hVenzIhGqy+rmS5LPxUd0arkxJcnLMIpaqL4cbqqocGRNy/++22c8kfoXJ9hBg6zLIulKJJE+j23wyFKXnYv7j38fybVvXsSz1TvJd79JeHgepvd5HpRHzNWlMKNBuvNX8wIm5LE/RJKIkwMeWPhmu06y7bVFClQ2BA70jfS5WiYeVSyWQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(39860400002)(376002)(396003)(346002)(136003)(451199021)(2616005)(41300700001)(53546011)(26005)(6506007)(83380400001)(31686004)(186003)(6512007)(478600001)(54906003)(6486002)(4326008)(6916009)(316002)(66556008)(66946007)(38100700002)(66476007)(86362001)(31696002)(8936002)(5660300002)(8676002)(2906002)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dHF6RHM0aUgxTEl3ZUZDamVEVTJ3RCsxQ3Y0dUhWOEdsRGpkSTZQbnRSWVpO?=
 =?utf-8?B?cGN2Sk83Q05waW05RlNCcWtyN3dtSWRoQlhQRFplVkFZUFFlUXViaWg1cS9j?=
 =?utf-8?B?WHBEVnB1Z0VYVUxkSSt4UFNzV0JoVXlmanBPbGYxNDBjOWZOeG5CUDJYZC9P?=
 =?utf-8?B?eUREWVlZdDhtUWI0Zm5EVVdLMHBGWkxFM0l5UHdpdVBGdFVFU1dHaWs5THQz?=
 =?utf-8?B?QUhMMVoveDF6L21maWdzNzB1MHUvWDdVRXVURlBGNVloOUxQN3dHQlBUelV0?=
 =?utf-8?B?Z2l3UVhCK1hIVk12MENUMS9qOUJwMFg0TlV4WHRhM0tKdzNNWUhCQ24rSUsy?=
 =?utf-8?B?djVwdkJ2c2dnVDdDQXZpcnIzT3N0SW9Wd0RxTm1YaE40SDgzK0cyVk5FRHg5?=
 =?utf-8?B?UDZqaEV3eU8yR3dmSDBkU1JEREVKZ290bkgzc21qVEJZUGRMV0s5aVp0OVFu?=
 =?utf-8?B?K3pmRGNTdzBvWmNsZDI0eXFTdkhDVXNFY1puRWJ2M3NzUEduekpvL0hHVThW?=
 =?utf-8?B?dkhFZTJVVTRtRmlNb3NvWWVsZDZHTE14OEJ6OFh0N1lnaHdnbGRYTXFVSjBq?=
 =?utf-8?B?VnVhb0JBanNQWDRmZHFGQUtXUXAvdldQNkpJT3BSdTErTFg0UXZrRExQeWc4?=
 =?utf-8?B?b0g0a1VRaVNoejBqbDlsTS9aS2k3ajcyVkxZQ0Urb3VRVWJPdjFKc250RUk1?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Z2NqWnIrL29BcmdoQk8yeWRScm1jdzY5NzBheHhmSE42aENKNk8x?=
 =?utf-8?B?VWd0YmxHcFhyZ1hBbGdmMmp1QmZtaWFJbTNZeVlIOHpaRTluWkIvNUtodWZP?=
 =?utf-8?B?ZmFZcUZyMGVNYkZqY2VwMkk4M0dWdFg0dGJadVk4aEJ2M3VlOGtQYklHbk1j?=
 =?utf-8?B?NDNBd2ZKTkhuZytKVnBXczBaNlNaeCtyd21JZ1IvQ3NndXNOenVzSnpRd0dZ?=
 =?utf-8?B?aVJWRWIzMXlwa2ZIZlh5WGZxQjVNZTVsa05xbE40RmozWFQ4R0RwR0FQbWZZ?=
 =?utf-8?B?RVIvT2dUcTZIdC9zNVFxQUkzZldUSG1LVGtZbnBhdUVaTzNDUUJwMVN4RFdm?=
 =?utf-8?B?VWFMUU80QWdQMVdUSll4YkpJSHg3R2Q4SzZPR2NFMjNONXFCODVoS1phQWox?=
 =?utf-8?B?a0RhZjI0dG9iZ2Y5em9keGtES1lRNXNsWWVENE14SzJobUtJKzhRVHluZWQv?=
 =?utf-8?B?NkpuMnNrTzIvMUlEL09aMWRlRlYyVUhpY2lJQzBqU0hWbGN3Ly90TkhaaTAw?=
 =?utf-8?Q?p/FjdmZV5zEH2VD8vLGpVhyNt?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1fb7ae33-2c90-43d9-2ca6-08db821cd81e
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 14:41:00.0890
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ZwPaj6sTB9nItUXfHmSsXLRrWRY3vUTrDLzukt+WTf7HJ9l7vfRrku6bBu8JWkKlFhh+lR3ViD1RTOiF83rqKw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8316

On 11.07.2023 16:16, Jason Andryuk wrote:
> On Tue, Jul 11, 2023 at 4:18â€¯AM Jan Beulich <jbeulich@suse.com> wrote:
>> On 10.07.2023 17:22, Jason Andryuk wrote:
>>> On Mon, Jul 10, 2023 at 9:13â€¯AM Jan Beulich <jbeulich@suse.com> wrote:
>>>> On 06.07.2023 20:54, Jason Andryuk wrote:
>>>>> @@ -510,6 +510,22 @@ choice of `dom0-kernel` is deprecated and not supported by all Dom0 kernels.
>>>>>  * `<maxfreq>` and `<minfreq>` are integers which represent max and min processor frequencies
>>>>>    respectively.
>>>>>  * `verbose` option can be included as a string or also as `verbose=<integer>`
>>>>> +  for `xen`.  It is a boolean for `hwp`.
>>>>> +* `hwp` selects Hardware-Controlled Performance States (HWP) on supported Intel
>>>>> +  hardware.  HWP is a Skylake+ feature which provides better CPU power
>>>>> +  management.  The default is disabled.  If `hwp` is selected, but hardware
>>>>> +  support is not available, Xen will fallback to cpufreq=xen.
>>>>> +* `<hdc>` is a boolean to enable Hardware Duty Cycling (HDC).  HDC enables the
>>>>> +  processor to autonomously force physical package components into idle state.
>>>>> +  The default is enabled, but the option only applies when `hwp` is enabled.
>>>>> +
>>>>> +There is also support for `;`-separated fallback options:
>>>>> +`cpufreq=hwp,verbose;xen`.  This first tries `hwp` and falls back to `xen`
>>>>> +if unavailable.
>>>>
>>>> In the given example, does "verbose" also apply to the fallback case? If so,
>>>> perhaps better "cpufreq=hwp;xen,verbose", to eliminate that ambiguity?
>>>
>>> Yes, "verbose" is applied to both.  I can make the change.  I
>>> mentioned it in the commit message, but I'll mention it here as well.
>>
>> FTAOD my earlier comment implied that the spelling form you use above
>> should not even be accepted when parsing. I.e. it was not just about
>> the doc aspect.
> 
> Oh.  So what exactly do you want then?
> 
> There is a single cpufreq_verbose variable today that is set by either
> cpufreq=hwp,verbose or cpufreq=xen,verbose.  Is that okay, or should
> the "xen" and "hwp" each get a separate variable?
> 
> Do you only want to allow a single trailing "verbose" to apply to all
> of cpufreq (cpufreq=$foo,verbose)?  Or do you want "verbose" to be
> only valid for "xen"?  Both cpufreq_cmdline_parse() and
> hwp_cmdline_parse() just loop over their options and don't care about
> order, even though the documentation lists verbose last.  Would you
> want "cpufreq=hwp,verbose,hdc" to fail to parse?
> 
> All parsing is done upfront before knowing whether "xen" or "hwp" will
> be used as the cpufreq driver, so there is a trickiness for
> implementing "verbose" only for one option.  Similarly,
> "cpufreq=hwp,invalid;xen" will try "hwp" (but not "xen")  since the
> live variables are updated.  Even without this patch, cpufreq will be
> configured up to an invalid parameter.

Right, and I'd like to see "hwp;xen" to be treated as a "unit", with
",verbose" applying to whichever succeeds initializing. I don't think
there is much point to have separate verbosity variables.

> FYI, cpufreq=xen;hwp will be accepted.  "xen" shouldn't fail, so it
> doesn't make sense to specify that.  But it didn't seem necessary to
> prevent it.

Sure, that's fine.

>>>>> +    if ( data->curr_req.raw == -1 )
>>>>> +    {
>>>>> +        hwp_err(cpu, "Could not initialize HWP properly\n");
>>>>> +        per_cpu(hwp_drv_data, cpu) = NULL;
>>>>> +        xfree(data);
>>>>> +        return -ENODEV;
>>>>> +    }
>>>>> +
>>>>> +    data->minimum = data->curr_req.min_perf;
>>>>> +    data->maximum = data->curr_req.max_perf;
>>>>> +    data->desired = data->curr_req.desired;
>>>>> +    data->energy_perf = data->curr_req.energy_perf;
>>>>> +    data->activity_window = data->curr_req.activity_window;
>>>>> +
>>>>> +    if ( cpu == 0 )
>>>>> +        hwp_verbose("CPU%u: HWP_CAPABILITIES: %016lx\n", cpu, data->hwp_caps);
>>>>
>>>> While I'm fine with this (perhaps apart from you using "cpu == 0",
>>>> which is an idiom we're trying to get rid of), ...
>>>
>>> Oh, I didn't know that.  What is the preferred way to identify the
>>> BSP?
>>
>> Sometimes we pass a separate boolean to functions, in other cases we
>> check whether a struct cpuinfo_x86 * equals &boot_cpu_info. The
>> latter clearly can't be used here, and the former doesn't look to be
>> a good fit either. However, ...
>>
>>>  This doesn't necessarily run on the BSP, so "cpu"/"policy->cpu"
>>> is all we have to make a determination.
>>
>> ... isn't it, conversely, the case that the function only ever runs
>> on "cpu" when it is the BSP? In which case "cpu == smp_processor_id()"
>> ought to do the trick.
> 
> The calls do not necessarily run from the BSP.  The cpufreq init
> callbacks run later when dom0 uploads the ACPI processor data.

Oh, of course. How did I manage to forget?

>  If you
> don't want "cpu == 0", maybe just print for the first CPU regardless
> of number, and then print differences from that?

Perhaps best then.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 15:43:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 15:43:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561787.878314 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJFWY-0001Cf-1Y; Tue, 11 Jul 2023 15:43:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561787.878314; Tue, 11 Jul 2023 15:43:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJFWX-0001CY-TA; Tue, 11 Jul 2023 15:43:33 +0000
Received: by outflank-mailman (input) for mailman id 561787;
 Tue, 11 Jul 2023 15:43:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7wqX=C5=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qJFWV-0001CS-UT
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 15:43:32 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on20600.outbound.protection.outlook.com
 [2a01:111:f400:7eab::600])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ae1d1a19-2001-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 17:43:30 +0200 (CEST)
Received: from SN6PR12MB2621.namprd12.prod.outlook.com (2603:10b6:805:73::15)
 by BL3PR12MB6476.namprd12.prod.outlook.com (2603:10b6:208:3bc::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Tue, 11 Jul
 2023 15:43:25 +0000
Received: from SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54]) by SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::8018:78f7:1b08:7a54%2]) with mapi id 15.20.6588.017; Tue, 11 Jul 2023
 15:43:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ae1d1a19-2001-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=iqLqpXGfZV1XnOOZb4Vhc5TuFvnaXGMzBv46IsDQdp6FX9o9TwbW6WOEK/Kc5Ae1cX54vKMo+9LTl35oyEr3CZi3TakBz+lIC4YCC1UbmeRmWrhAwL589uC1QVRwTf1EA3mXOEFj62DvFc1pl14P4Ub94yw/GvHgxaaS8lTqTLHV8aQZVi89HOsL5BKpcENHkpL8dsKRhO7Ot3YsXogbh4xlEUJXX4B5aLsb1OoBpzY43IzLXpOLhmZeQjqabMjYO74dDYkN7uAIfinB6kfgIiK2El+LGAoBaWHuk4ZeYME0lCeBQuctssDxpeCGmqtEGGQE3tqoTyXqpSGrCR8wvQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=toprCbtRqWWEFm51huvlokYccBkGzouj7gEFp/QXEYA=;
 b=XcGzXMRH8Lq06OObPfI/f0DKr2TY29H0PlQNYOfENx0CBSw3eqFyLO/fuZrgvGf4+DIM9rpTcDlzSs+L/f2gan+bxboa8/KSj/+uQT2HjwAQ1rqwjGVXKaPZWWk1L4wzl6mdc53ffc9PbEg4SiUiL/moWoYqGE6qZLOQTwjw72ZzdSQIS06d5hT/V17ZX/Tk9eU4upMDL0Ty5Cq1SJi6yXX+XsrqTILUfn0eGvtHSXPmt28vAxY1P9LFdrnCD5EI8uiYX6QkGMcgAjFhXcTEJc/H+NldyGE6dFVEybHTyz/EOIziMoDN5qZkZt9Z4IACkOwm1dp2eyL8VeDWs9oC/w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=toprCbtRqWWEFm51huvlokYccBkGzouj7gEFp/QXEYA=;
 b=t2gvKkpaYp0mccuOj0PGAWm7/K88lIFP5PpbHHQJ19IBhhHKwE/vZCVZY/nrV6mtIT7Z/mAku7lEskrYDFwg9Tg0QrCLtzJUlnPGBM7ynfGnustl4PUhNEfGt0+h9hB74GoLVJeYDRLEpSSqa3DkQEynMJzjafmd6jTj+xFlBQU=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <b6ec25a2-e1fd-bbff-6f66-55172a5f5ed8@amd.com>
Date: Tue, 11 Jul 2023 16:43:17 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v1] xen/drivers: ns16550: Fix the return logic for
 pci_uart_config()
To: Jan Beulich <jbeulich@suse.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: sstabellini@kernel.org, stefano.stabellini@amd.com,
 andrew.cooper3@citrix.com, george.dunlap@citrix.com, julien@xen.org,
 wl@xen.org, xen-devel@lists.xenproject.org
References: <20230707113518.141489-1-ayan.kumar.halder@amd.com>
 <6717701f-76c3-94f6-241b-743b4828ad6e@suse.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <6717701f-76c3-94f6-241b-743b4828ad6e@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P302CA0014.GBRP302.PROD.OUTLOOK.COM
 (2603:10a6:600:2c2::15) To SN6PR12MB2621.namprd12.prod.outlook.com
 (2603:10b6:805:73::15)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN6PR12MB2621:EE_|BL3PR12MB6476:EE_
X-MS-Office365-Filtering-Correlation-Id: c92e288c-b7ce-4359-2b00-08db8225900d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	2wBeZzBH08oDFR/Wd8fu5UlCvAraQjuwBPo1aYmaIHCeLGOUeUaJI1WAs+TnMJG4soGr/HQmSYjrnlIYamXvdhn3ERsKUkxdws7HE/AOBUQn8PiRcIH8JFUPxvC35RlPY9yVdDUkW+iqCHSM5K8s8rXETEHSx2liXPldtJQDEFuGJStjdNUWjvZUUQAKexo0j9+EqrwOKZGJmZE3JRZspB7+GAyMvlZjaRuZMlkRxQo/5O9Ed9EUncK9InJ56e9GiWSys2zOC+EVlvGubn5tylhW4MM+g7V4XDaLJ/gCAjGjRM7wRq0GmGcZC1QcIgdO1y6o3syf4cx7d1TmSpb0OB45RZJEdEP4CuB3bMApRdI6myI+HEpoAu105fFz4GxJqJ6NePa2/r5PPHpdF9Psg66XC84qZycxKYSjC5lesmcopo3I1QkZwl+sG/Se3wZGkwQz9k3SgjGeEHp2XSGDStRqrzK/G6nXr918rIuktyMtY3II8hihaH8vvSmQ8SERjk5+mZGN98740A0rZl4SjuERYBKdNLF+QmJs9D1RvKTX5sKQGaSkL4rfRxCs0g1A66J71TISKgeT4zaFtKnh+U4SkXst4pb1cVPxZ+xdSYJiGgKun+7LPHbc+P5sl+ugOwVvN8PzxqSUV18tnTdWwg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2621.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(346002)(136003)(376002)(366004)(451199021)(31696002)(38100700002)(6666004)(6512007)(6486002)(966005)(110136005)(31686004)(2906002)(2616005)(36756003)(6636002)(4326008)(316002)(66556008)(66476007)(66946007)(8676002)(8936002)(6506007)(53546011)(478600001)(26005)(186003)(41300700001)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?S0VDQ1R6bFR1UDgzemF4TXA3YzJTSURKU0xNN0F0Q0ZlYm9acGhmWXpIUkh0?=
 =?utf-8?B?bUZ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SXVTZi9r?=
 =?utf-8?B?azBWTHhhSUZjY2FUNlE0Yi9ZVzNIR1ZNWi9VRTVjV2p6Sjl4Q2tnU2dHa3dD?=
 =?utf-8?B?dDArNEVMUWxNcUxtTjZJeEJ6N0Y3dVpROXRIUEdIeXRqdld4a3pWQ0ozVi9r?=
 =?utf-8?B?UEw0WGNBL0hmYzhTRVNrTWxlY0pId0E0Y2M1NTU3cWtvem5Gajd0WVQrMDdF?=
 =?utf-8?B?MGszOWVxQWYxRUY5RXYzTEQ5TDQxcUdRM2ZpR21KK3ZuVEl4U0dINHpibWxv?=
 =?utf-8?B?ZzJIeEc2TXFWaGxGYTlob1M4ejkvOUI0UEZPYnB5NWRyR0wvMGF6dUgwd2pL?=
 =?utf-8?Q?PFvn1q8E9Mi2eeWL8Zd+Y7hv4?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c92e288c-b7ce-4359-2b00-08db8225900d
X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2621.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 15:43:24.7967
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: vEYKkSm3oi/3rX4mwmMaMLqaEyOVKkhrnD8mCiAjmWXocqXlTYeCqMNkBWksWTySHPdeT/HzQZuVjlTRdeqGBw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6476

Hi Jan,

On 10/07/2023 11:08, Jan Beulich wrote:
> On 07.07.2023 13:35, Ayan Kumar Halder wrote:
>> --- a/xen/drivers/char/ns16550.c
>> +++ b/xen/drivers/char/ns16550.c
>> @@ -1342,13 +1342,9 @@ pci_uart_config(struct ns16550 *uart, bool_t skip_amt, unsigned int idx)
>>           }
>>       }
>>   
>> -    if ( !skip_amt )
>> -        return -1;
> This special case probably needs retaining in the new model (with an
> altered return value), such that ...

Does this look correct ?

 Â Â Â Â  if ( !skip_amt )
-Â Â Â Â Â Â Â  return -1;
+Â Â Â Â Â Â Â  return -EINVAL;

>
>> -    /* No AMT found, fallback to the defaults. */
>>       uart->io_base = orig_base;
>>   
>> -    return 0;
>> +    return -ENODEV;
>>   }
>>   
>>   static void enable_exar_enhanced_bits(const struct ns16550 *uart)
>> @@ -1527,13 +1523,13 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
>>   #ifdef CONFIG_HAS_PCI
>>           if ( strncmp(conf, "pci", 3) == 0 )
>>           {
>> -            if ( pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com) )
>> +            if ( !pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com) )
>>                   return true;
>>               conf += 3;
>>           }
>>           else if ( strncmp(conf, "amt", 3) == 0 )
>>           {
>> -            if ( pci_uart_config(uart, 0, uart - ns16550_com) )
>> +            if ( !pci_uart_config(uart, 0, uart - ns16550_com) )
>>                   return true;
>>               conf += 3;
>>           }
> ... e.g. here you don't suddenly change behavior in unintended ways.
> Prior to your change the earlier of the return paths was impossible
> to be taken. That's likely wrong, but you now returning in the success
> case can't be correct either:
I am afraid I don't follow your comments very well.

pci_uart_config() returns 0 for success. So we need to check "!(pci_uart_config(...)" to return true.

> Further items may need parsing, first
> and foremost the IRQ to use.

I see the irq is parsed here 
https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/drivers/char/ns16550.c;h=212a9c49ae8e5c40dc6cd05da07a6652c8405935;hb=refs/heads/master#l1558 
.

Do we need to do something more ?

- Ayan

>
> Jan
>
>> @@ -1642,13 +1638,17 @@ static bool __init parse_namevalue_pairs(char *str, struct ns16550 *uart)
>>           case device:
>>               if ( strncmp(param_value, "pci", 3) == 0 )
>>               {
>> -                pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com);
>> -                dev_set = true;
>> +                if ( !pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com) )
>> +                    dev_set = true;
>> +                else
>> +                    return false;
>>               }
>>               else if ( strncmp(param_value, "amt", 3) == 0 )
>>               {
>> -                pci_uart_config(uart, 0, uart - ns16550_com);
>> -                dev_set = true;
>> +                if ( !pci_uart_config(uart, 0, uart - ns16550_com) )
>> +                    dev_set = true;
>> +                else
>> +                    return false;
>>               }
>>               break;
>>   


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 15:47:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 15:47:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561792.878323 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJFZx-0001mP-GQ; Tue, 11 Jul 2023 15:47:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561792.878323; Tue, 11 Jul 2023 15:47:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJFZx-0001mI-Cu; Tue, 11 Jul 2023 15:47:05 +0000
Received: by outflank-mailman (input) for mailman id 561792;
 Tue, 11 Jul 2023 15:47:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=e9Pp=C5=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1qJFZw-0001mC-Tt
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 15:47:04 +0000
Received: from NAM04-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam04on20607.outbound.protection.outlook.com
 [2a01:111:f400:7e8b::607])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2e1abbee-2002-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 17:47:03 +0200 (CEST)
Received: from MWH0EPF00056D0F.namprd21.prod.outlook.com
 (2603:10b6:30f:fff2:0:1:0:11) by CY8PR12MB7731.namprd12.prod.outlook.com
 (2603:10b6:930:86::16) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Tue, 11 Jul
 2023 15:47:00 +0000
Received: from CO1NAM11FT090.eop-nam11.prod.protection.outlook.com
 (2a01:111:f400:7eab::203) by MWH0EPF00056D0F.outlook.office365.com
 (2603:1036:d20::b) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.5 via Frontend
 Transport; Tue, 11 Jul 2023 15:46:59 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CO1NAM11FT090.mail.protection.outlook.com (10.13.175.152) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.20 via Frontend Transport; Tue, 11 Jul 2023 15:46:59 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 11 Jul
 2023 10:46:58 -0500
Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Tue, 11 Jul 2023 10:46:56 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2e1abbee-2002-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=EuwP71lsQ8G3P/KMgRtEhku2J+hxPMVUwyyRHdDHJmi6CGMdH1FM2SB1fMcA77eGickuZmEaCtcIV6WtGDwZjFbUudVomC89NMSOFXUGnYdAwo1ml+iRWSZUYJfJCoJy17XKc2hEkrP0/a07ufaW7bvr2yZOrIbdWL8Pp8YID1+MHt0aCEVbLnMNQNbjxNk2jJ2dw5nNXdkfhLVu/zUBEU9FtUuinM6apszXRCgIKsKcEl846PhsQqpQwJHprvGE4/sMvGOh/qqcDMh7hdGcT2nbYM5NbB9EERYsGA5BzrkN5K0WxCv4M5SbCXLXpe6fVwfRyeKpZkVY0QUdSLzp/w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BDDZwL1ASjyPqenwXuqG6HJNX/FSDxegFg/UU6wCrVA=;
 b=WQ+M8AZCBaYfniOrxEwJGcIYuI/2skWBTYFQmga0ZU0k9OkMkuT70iq1COR8EKCZrGon0XGekj8CP1yoT4ycyRbut8asygDFeDK6IZwy3SbZ7yYh1d1wRjvnAGUWdqjWrBq0gv7ygMFKbJzpV8WKKPlhXH0ue4TQPjrhcA6gE3u99wuLpp9vYR8o57yVlTzTzZu4WJDSmO4WbTe2uuT62zXGwRNeU9oLzweZXjdwSbpfr11MMyqJwvosx1EO020QLfEr4dF3UXhc7wTyrCSP85/zeM5hRFa4BEPTbin84+AfZMJLWmVZx1VDlEEKO3wHB5hxMocNHtEmQFSQUcOV5w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BDDZwL1ASjyPqenwXuqG6HJNX/FSDxegFg/UU6wCrVA=;
 b=JCWVfZk0Sr/rQ+Jt+Aa5OkSuPOgxW+LdKxuOFSUW5VzOw0oP4khlPBPJq1mhqCMQm6u56jpRH26wY3Otv6brxG/7+gWR7F9f7FPmFT/Nm+8rIPnICM8XENvFeg7uK1MeAGx+rOTXoy7dzAhkX7VHcsiZCEXxTNL7szkjdtKkHFo=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Stewart Hildebrand <stewart.hildebrand@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rahul Singh <rahul.singh@arm.com>
Subject: [PATCH] xen/arm: pci: fix check in pci_check_bar()
Date: Tue, 11 Jul 2023 11:46:47 -0400
Message-ID: <20230711154648.729567-1-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1NAM11FT090:EE_|CY8PR12MB7731:EE_
X-MS-Office365-Filtering-Correlation-Id: 9617cba2-14c8-44c6-5084-08db82261036
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	cWnniUDrknxbIpkvY7EhQMRQxHn+LS+cjhD86qbZ1AER0bzccNpeGSsYvOSXxfOHkC35DwEB4oOzIlemTlNUT8Ul22Ip70mpCnJXAHp7VD9r48ofbJLkLZbs4ANdBKjSQ3WsxoROFLCtlWUDr/xR52/rDwizYwCuqBxPmden3lZt5hCi5DgZfCgLF06rqpKCbJHqvrO0PiVsTHdIMqm69M4mrDz4SxxZK/0cnQ/DwCwDEDVaFKYsGxrMghDQfWPo3Pg05qLmuUG0FjjJfVWJZ5qexkaAUkEeKeSoxyEHwCnTOY/eCm4X+y54kQVAIFiJr5hOI64oKd7ibt/g/+fe0ksch/kPkDQgw2PX+CayVFdZyTxAROjUf4KAR8dPzamk8vkqwHOrNmoYkaY3tXMltZBAMsZ9TERauduDe7Io1JnjYH5IiDvyrqMfTOE74qpfbAKfCPynLO/ugNJtLqpK9evXTh/wV/7uEgvrp5ZaqBixl5Hindq3cv3gj4GgUC1PgHWVVcuaOn2wfFCZvtx6XKtLEKnLAoJz3H9kOKsHLDYcNMPGwJoO5hPQb73iAXEMrocFj6KHHWkDOEznYaoKwtZwMlbR6bTHbRgJU7+r2vB+keWxO5uWNWe00A5bfDARmjvDQ34OgREzW5Xru23LOUqQkdaXuYPY6KyqJjWB3mwpq2pqS4hw7hoUNAL/esDwztOL8n9FSFY1C5LvQCaXfPiJs2v9NOl+5LeyAMvtJiOj5kS7QRwqHY9Ikt8TJC2wdOqxv0fSokv5P/nRkHzZug==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(39860400002)(396003)(346002)(451199021)(36840700001)(40470700004)(46966006)(426003)(8676002)(8936002)(36860700001)(5660300002)(47076005)(2616005)(83380400001)(186003)(26005)(1076003)(86362001)(41300700001)(6666004)(44832011)(82310400005)(336012)(316002)(356005)(36756003)(40460700003)(2906002)(70586007)(70206006)(6916009)(82740400003)(40480700001)(4326008)(81166007)(54906003)(478600001)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 15:46:59.4014
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 9617cba2-14c8-44c6-5084-08db82261036
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1NAM11FT090.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7731

When mapping BARs for vPCI, it's valid for a BAR start address to equal the BAR
end address (i.e. s == e). However, pci_check_bar() currently returns false in
this case, which results in Xen not mapping the BAR. In this example boot log,
Linux has mapped the BARs, but since Xen did not map them, Linux encounters a
data abort and panics:

[    2.593300] pci 0000:00:00.0: BAR 0: assigned [mem 0x50008000-0x50008fff]
[    2.593682] pci 0000:00:00.0: BAR 2: assigned [mem 0x50009000-0x50009fff]
[    2.594066] pci 0000:00:00.0: BAR 4: assigned [mem 0x5000a000-0x5000afff]
...
[    2.810502] virtio-pci 0000:00:00.0: enabling device (0000 -> 0002)
(XEN) 0000:00:00.0: not mapping BAR [50008, 50008] invalid position
(XEN) 0000:00:00.0: not mapping BAR [50009, 50009] invalid position
(XEN) 0000:00:00.0: not mapping BAR [5000a, 5000a] invalid position
[    2.817502] virtio-pci 0000:00:00.0: virtio_pci: leaving for legacy driver
[    2.817853] virtio-pci 0000:00:00.0: enabling bus mastering
(XEN) arch/arm/traps.c:1992:d0v0 HSR=0x00000093010045 pc=0xffff8000089507d4 gva=0xffff80000c46d012 gpa=0x00000050008012
[    2.818397] Unable to handle kernel ttbr address size fault at virtual address ffff80000c46d012
...

Fix this by changing the condition in pci_check_bar().

Fixes: cc80e2bab0d0 ("xen/pci: replace call to is_memory_hole to pci_check_bar")
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 xen/arch/arm/pci/pci-host-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/pci/pci-host-common.c b/xen/arch/arm/pci/pci-host-common.c
index 7cdfc89e5211..e0ec526f9776 100644
--- a/xen/arch/arm/pci/pci-host-common.c
+++ b/xen/arch/arm/pci/pci-host-common.c
@@ -406,7 +406,7 @@ bool pci_check_bar(const struct pci_dev *pdev, mfn_t start, mfn_t end)
         .is_valid = false
     };
 
-    if ( s >= e )
+    if ( s > e )
         return false;
 
     dt_node = pci_find_host_bridge_node(pdev);

base-commit: b831326ee2f9ed94523b3d8b0fb2da2a82113e9e
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 11 15:54:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 15:54:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561796.878333 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJFhG-0003He-8c; Tue, 11 Jul 2023 15:54:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561796.878333; Tue, 11 Jul 2023 15:54:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJFhG-0003HX-5V; Tue, 11 Jul 2023 15:54:38 +0000
Received: by outflank-mailman (input) for mailman id 561796;
 Tue, 11 Jul 2023 15:54:37 +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
 <SRS0=mpZR=C5=microsoft.com=mikelley@srs-se1.protection.inumbo.net>)
 id 1qJFhE-0003HP-UX
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 15:54:37 +0000
Received: from DM5PR00CU002.outbound.protection.outlook.com
 (mail-cusazlp170110003.outbound.protection.outlook.com
 [2a01:111:f403:c111::3])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 397960c1-2003-11ee-8611-37d641c3527e;
 Tue, 11 Jul 2023 17:54:33 +0200 (CEST)
Received: from BYAPR21MB1688.namprd21.prod.outlook.com (2603:10b6:a02:bf::26)
 by PH7PR21MB4042.namprd21.prod.outlook.com (2603:10b6:510:207::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.6; Tue, 11 Jul
 2023 15:54:27 +0000
Received: from BYAPR21MB1688.namprd21.prod.outlook.com
 ([fe80::275c:198b:4685:accd]) by BYAPR21MB1688.namprd21.prod.outlook.com
 ([fe80::275c:198b:4685:accd%5]) with mapi id 15.20.6609.003; Tue, 11 Jul 2023
 15:54:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 397960c1-2003-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=gDY7dstcW/pUMeSilzAqSGlJiur2gzOd3bNysGulqTP40jc+RngStsoFPuzJA7TFrCosrv8Ien1aIqTt4rRgHV7gMsBOEeddBorBXwG0Ynd3Ht7rF8QKs6iqhi/gGAjV/tOOHv4n/NGKNkI62R2jjM2GziqZDus3FaOWSvTOQxm9Va163xZuP3S0bC39qhHf9O0JgEhVXVGrsNrEIVjwPf+hSaC/Q5CM+vECzeRyN0OLQyqOuX/Tc3FwSb+MqIkGpAxprBgVqplmZBxUJpdLLG3034oz7MiIyBbL6ilc/7FbhrlaJFR2ank4vO4tTHZpTztaiqy1Fuhs0SFwShmirQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=znrz4HIQxt2oszuYbbT9CbSrKWMeRoRJhvOteUxVFFE=;
 b=m+3C93Ka45bbclviXEZFu1UilTrGkDDcQ0Y8gQ9H07pp8lMQt/98WWRDkQ34qMOZk11dVTRk8a4Debiy0qRtY4LZWqF1SSPFVtrSiGt5Gou1iQq5IMWQKP7xN02pijWh0aVyK7BfMl87/jOSfguYibzAIkZeO4DA+OEU8d3LjNs6vfwTzVMauViPb8W7UcQCaB++rTbNJk/MgCHJeBebwV3IhMjoicQg21L1NXj5WCDG1PDseg+wiAR5PP2zHwyP8dAF3Mw3O8yVrGAHNTC9UzFM9VxsBFzg3/xaTzMSddIACWkelq9aP1XP+o46NVXUzGvTaidNL/OQg3Xu87nF+g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=microsoft.com; dmarc=pass action=none
 header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=znrz4HIQxt2oszuYbbT9CbSrKWMeRoRJhvOteUxVFFE=;
 b=SMJamC8hMDbs4VhFv2XOlOMr/zw+Rvrh4PUYPT7/Xpek/rODe0ahd7lzQNdjLiCV2AJwrxnzOjh7nNGKP91BrvWTuZ66odhQx+lUUSsfA3Yubys+XctRPtk0QWqYHrQ4dNIMtPQX1QnFVfpOHoyX3o1DM12x9rTPGP/okzFj+e4=
From: "Michael Kelley (LINUX)" <mikelley@microsoft.com>
To: =?iso-8859-2?Q?Petr_Tesa=F8=EDk?= <petr@tesarici.cz>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Petr Tesarik
	<petrtesarik@huaweicloud.com>, Stefano Stabellini <sstabellini@kernel.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Thomas Gleixner
	<tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov
	<bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "maintainer:X86
 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>, "H. Peter Anvin"
	<hpa@zytor.com>, "Rafael J. Wysocki" <rafael@kernel.org>, Juergen Gross
	<jgross@suse.com>, Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>, Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>, Andy Shevchenko
	<andriy.shevchenko@linux.intel.com>, Hans de Goede <hdegoede@redhat.com>,
	Jason Gunthorpe <jgg@ziepe.ca>, Kees Cook <keescook@chromium.org>, Saravana
 Kannan <saravanak@google.com>, "moderated list:XEN HYPERVISOR ARM"
	<xen-devel@lists.xenproject.org>, "moderated list:ARM PORT"
	<linux-arm-kernel@lists.infradead.org>, open list
	<linux-kernel@vger.kernel.org>, "open list:MIPS"
	<linux-mips@vger.kernel.org>, "open list:XEN SWIOTLB SUBSYSTEM"
	<iommu@lists.linux.dev>, Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: RE: [PATCH v3 4/7] swiotlb: if swiotlb is full, fall back to a
 transient memory pool
Thread-Topic: [PATCH v3 4/7] swiotlb: if swiotlb is full, fall back to a
 transient memory pool
Thread-Index:
 AQHZqN4Es6xs27E7q0W1vSuhepPC1q+p0aJAgAKeXgCAAGWX4IABQ5kAgAAO3oCAAduRkIACzpkAgAH5cQA=
Date: Tue, 11 Jul 2023 15:54:27 +0000
Message-ID:
 <BYAPR21MB16886DBD419EFF6D16E05477D731A@BYAPR21MB1688.namprd21.prod.outlook.com>
References: <cover.1687859323.git.petr.tesarik.ext@huawei.com>
	<34c2a1ba721a7bc496128aac5e20724e4077f1ab.1687859323.git.petr.tesarik.ext@huawei.com>
	<BYAPR21MB1688AAC65852E75764F53099D72CA@BYAPR21MB1688.namprd21.prod.outlook.com>
	<2023070626-boxcar-bubbly-471d@gregkh>
	<BYAPR21MB168802F691D3041C9B2F9F2DD72CA@BYAPR21MB1688.namprd21.prod.outlook.com>
	<2023070706-humbling-starfish-c68f@gregkh>
	<20230707122213.3a7378b5@meshulam.tesarici.cz>
	<BYAPR21MB1688D3AC0C094420733717C4D732A@BYAPR21MB1688.namprd21.prod.outlook.com>
 <20230710113618.2038e033@meshulam.tesarici.cz>
In-Reply-To: <20230710113618.2038e033@meshulam.tesarici.cz>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
 MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=4fe17a3a-44f9-4ee2-847b-6be77321446b;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2023-07-11T15:45:20Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=microsoft.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BYAPR21MB1688:EE_|PH7PR21MB4042:EE_
x-ms-office365-filtering-correlation-id: ad1fcb6d-8fbd-4cd9-1489-08db82271b46
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info:
 SUnwiDdXEay51yrfY3ijdJ+NR2hnIGskLhzhza3h4MzpZu1yWZizIOcxBp70Cr/sy4FLGGdTgp14YQjevcPz2SAmYE/6dRUjgJhYtbmi0NTEuOA6uTDAv9j+P52loN9x5JDfE7RKr1ELN0rmbh6K4EqsHEpg3XhnJaNb2aRQTrVupnOhRebuN1WM6qCZERdcZLIgLrv88vIqRYGxM4U8n0wyJpnyf0k9NQXp0ESibttfW3JLu6TktXmEs125kYYK3pDsnv72s6eODiB0k1hFH5lPqvzCWufZ/vnIxQWNCDMeASpuGf4FNsg7p4yxFE3aZT/VNSgQZvWYIFvcHUwO6vXladPrqZ/1fT/y3Jwj7VKWpRwHrxhnRqywori55V1xx2PrxkbRwgW7Or9Gq2w7kU7CIfWgl4LLAkYmM0Hshx1/Uk/G6uQSgt1wf+AL0cAWPIjlfJF/mmR1hdeQxPSOl4oFCTNWiyR6j1iCF65zt4E28fGcamJxyRLpP8r8x8KXuuJqYZ1RrXBB2Tt1rKsrgrY+vuAcytmLxPcLkREnINA1q8xFM7ENPKqhq0LesohT/EMkpE7E+poo/x+prLdl8bTToDYfAQmYXWo/YfXolCWLmsq2dWgxJQX/Au3qzDr6z7JRgCLk+zjEBH33ucw/kQ==
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR21MB1688.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(396003)(376002)(39860400002)(366004)(451199021)(6916009)(4326008)(64756008)(66476007)(66446008)(66556008)(76116006)(66946007)(38100700002)(122000001)(86362001)(186003)(38070700005)(6506007)(26005)(83380400001)(82960400001)(82950400001)(10290500003)(33656002)(478600001)(9686003)(966005)(7696005)(8990500004)(54906003)(71200400001)(7416002)(55016003)(41300700001)(8676002)(8936002)(5660300002)(52536014)(316002)(2906002);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-2?Q?DpmrLS+gaMw2CjFaOZce4l0z2b2Krn/u2YYH3rcdpVo7SQk2r5Eu5nOgy0?=
 =?iso-8859-2?Q?xDY2v5vQ2jWEfgHB7ZRtspI/SJN8dyvls8CrpzQ8csJvY5kRs2U4fvcG7I?=
 =?iso-8859-2?Q?kt1LM/d5P3Plc5KWY9+6YNZki0PBBSKtvQkB8M62Ab5fUTveRmcFNV8haD?=
 =?iso-8859-2?Q?m5MreUSn/DxE2zRCpCbsqJalYxLNDLOsHo6umpwioJUnRXLCWR2JdifFh0?=
 =?iso-8859-2?Q?flHBZDuQM8Skab8N+wkzL7sktZ5SOXNyzF4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IGIm?=
 =?iso-8859-2?Q?U1Z0OKxFEargiRkkqEyp2ISWAEecY5IBPPtPSAQ52xESmu7nhZPo1bvfDC?=
 =?iso-8859-2?Q?3GK46c0LqsJRE/dJW3K2WZIaoLAxeVay0nnNIfzFLOArHtBz1HoecCnddO?=
 =?iso-8859-2?Q?OTnwoT/6pcDPkoxboNs6bJgJ0tW1OAWnBsH94PYIFeYj5pYJWxdRve2heR?=
 =?iso-8859-2?Q?erSqYi8jJJKCjKXFJvKzg6UuHvYyYIUSz+UFc3K884Vsny9glEL8NxYUow?=
 =?iso-8859-2?Q?mwK7xewi/XSiYugo/YXcc5mhA2wQWzUrIo0z2vLoMSBCI+tg8fVmmaqPrJ?=
 =?iso-8859-2?Q?T6gisz3OnSysbFX1+a1qKBI/NMEbhu3m1ORDRjCUimDf7JYs2o5dRYk+HU?=
 =?iso-8859-2?Q?+cHkl/DK91aRfQuSp4TpPVo1H5IWmPzjEtibj+spjiTSGnFLmvqnsSWFFR?=
 =?iso-8859-2?Q?ly6/qOWE30uFM7cJr2AF/ZCzuOIYT/F4SQfWeqa6jjKgU0UXTtxlgXTFXc?=
 =?iso-8859-2?Q?0W6yV8HbNLz1vG57vvyPB79mliLS8A9iigOZOtJJ84Vcks9yMvMoNrig?=
 =?iso-8859-2?Q?=3D=3D?=
Content-Type: text/plain; charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BYAPR21MB1688.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ad1fcb6d-8fbd-4cd9-1489-08db82271b46
X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jul 2023 15:54:27.5620
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 6rcT/mx8AI1N/qgQmkIse7rnaczRnduqikxVREcs9Opuektrxry4sSBk1AvL52MsvS/t4ClDE1zqo8yU6GZ/qXSjCLlutG9UdkD5gUBiVp4=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR21MB4042

From: Petr Tesa=F8=EDk <petr@tesarici.cz> Sent: Monday, July 10, 2023 2:36 =
AM
>=20
> On Sat, 8 Jul 2023 15:18:32 +0000
> "Michael Kelley (LINUX)" <mikelley@microsoft.com> wrote:
>=20
> > From: Petr Tesa=F8=EDk <petr@tesarici.cz> Sent: Friday, July 7, 2023 3:=
22 AM
> > >
> > > On Fri, 7 Jul 2023 10:29:00 +0100
> > > Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> > >
> > > > On Thu, Jul 06, 2023 at 02:22:50PM +0000, Michael Kelley (LINUX) wr=
ote:
> > > > > From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Sent: Thurs=
day, July 6,
> > > 2023 1:07 AM
> > > > > >
> > > > > > On Thu, Jul 06, 2023 at 03:50:55AM +0000, Michael Kelley (LINUX=
) wrote:
> > > > > > > From: Petr Tesarik <petrtesarik@huaweicloud.com> Sent: Tuesda=
y, June 27, 2023
> > > > > > 2:54 AM
> > > > > > > >
> > > > > > > > Try to allocate a transient memory pool if no suitable slot=
s can be found,
> > > > > > > > except when allocating from a restricted pool. The transien=
t pool is just
> > > > > > > > enough big for this one bounce buffer. It is inserted into =
a per-device
> > > > > > > > list of transient memory pools, and it is freed again when =
the bounce
> > > > > > > > buffer is unmapped.
> > > > > > > >
> > > > > > > > Transient memory pools are kept in an RCU list. A memory ba=
rrier is
> > > > > > > > required after adding a new entry, because any address with=
in a transient
> > > > > > > > buffer must be immediately recognized as belonging to the S=
WIOTLB, even if
> > > > > > > > it is passed to another CPU.
> > > > > > > >
> > > > > > > > Deletion does not require any synchronization beyond RCU or=
dering
> > > > > > > > guarantees. After a buffer is unmapped, its physical addres=
ses may no
> > > > > > > > longer be passed to the DMA API, so the memory range of the=
 corresponding
> > > > > > > > stale entry in the RCU list never matches. If the memory ra=
nge gets
> > > > > > > > allocated again, then it happens only after a RCU quiescent=
 state.
> > > > > > > >
> > > > > > > > Since bounce buffers can now be allocated from different po=
ols, add a
> > > > > > > > parameter to swiotlb_alloc_pool() to let the caller know wh=
ich memory pool
> > > > > > > > is used. Add swiotlb_find_pool() to find the memory pool co=
rresponding to
> > > > > > > > an address. This function is now also used by is_swiotlb_bu=
ffer(), because
> > > > > > > > a simple boundary check is no longer sufficient.
> > > > > > > >
> > > > > > > > The logic in swiotlb_alloc_tlb() is taken from __dma_direct=
_alloc_pages(),
> > > > > > > > simplified and enhanced to use coherent memory pools if nee=
ded.
> > > > > > > >
> > > > > > > > Note that this is not the most efficient way to provide a b=
ounce buffer,
> > > > > > > > but when a DMA buffer can't be mapped, something may (and w=
ill) actually
> > > > > > > > break. At that point it is better to make an allocation, ev=
en if it may be
> > > > > > > > an expensive operation.
> > > > > > >
> > > > > > > I continue to think about swiotlb memory management from the =
standpoint
> > > > > > > of CoCo VMs that may be quite large with high network and sto=
rage loads.
> > > > > > > These VMs are often running mission-critical workloads that c=
an't tolerate
> > > > > > > a bounce buffer allocation failure.  To prevent such failures=
, the swiotlb
> > > > > > > memory size must be overly large, which wastes memory.
> > > > > >
> > > > > > If "mission critical workloads" are in a vm that allowes overco=
mmit and
> > > > > > no control over other vms in that same system, then you have wo=
rse
> > > > > > problems, sorry.
> > > > > >
> > > > > > Just don't do that.
> > > > > >
> > > > >
> > > > > No, the cases I'm concerned about don't involve memory overcommit=
.
> > > > >
> > > > > CoCo VMs must use swiotlb bounce buffers to do DMA I/O.  Current =
swiotlb
> > > > > code in the Linux guest allocates a configurable, but fixed, amou=
nt of guest
> > > > > memory at boot time for this purpose.  But it's hard to know how =
much
> > > > > swiotlb bounce buffer memory will be needed to handle peak I/O lo=
ads.
> > > > > This patch set does dynamic allocation of swiotlb bounce buffer m=
emory,
> > > > > which can help avoid needing to configure an overly large fixed s=
ize at boot.
> > > >
> > > > But, as you point out, memory allocation can fail at runtime, so ho=
w can
> > > > you "guarantee" that this will work properly anymore if you are goi=
ng to
> > > > make it dynamic?
> > >
> > > In general, there is no guarantee, of course, because bounce buffers
> > > may be requested from interrupt context. I believe Michael is looking
> > > for the SWIOTLB_MAY_SLEEP flag that was introduced in my v2 series, s=
o
> > > new pools can be allocated with GFP_KERNEL instead of GFP_NOWAIT if
> > > possible, and then there is no need to dip into the coherent pool.
> > >
> > > Well, I have deliberately removed all complexities from my v3 series,
> > > but I have more WIP local topic branches in my local repo:
> > >
> > > - allow blocking allocations if possible
> > > - allocate a new pool before existing pools are full
> > > - free unused memory pools
> > >
> > > I can make a bigger series, or I can send another series as RFC if th=
is
> > > is desired. ATM I don't feel confident enough that my v3 series will =
be
> > > accepted without major changes, so I haven't invested time into
> > > finalizing the other topic branches.
> > >
> > > @Michael: If you know that my plan is to introduce blocking allocatio=
ns
> > > with a follow-up patch series, is the present approach acceptable?
> > >
> >
> > Yes, I think the present approach is acceptable as a first step.  But
> > let me elaborate a bit on my thinking.
> >
> > I was originally wondering if it is possible for swiotlb_map() to detec=
t
> > whether it is called from a context that allows sleeping, without the u=
se
> > of SWIOTLB_MAY_SLEEP.   This would get the benefits without having to
> > explicitly update drivers to add the flag.  But maybe that's too risky.
>=20
> This is a recurring topic and it has been discussed several times in
> the mailing lists. If you ask me, the best answer is this one by Andrew
> Morton, albeit a bit dated:
>=20
> https://lore.kernel.org/lkml/20080320201723.b87b3732.akpm@linux-foundatio=
n.org/

Thanks.  That's useful context.

>=20
> > For
> > the CoCo VM scenario that I'm most interested in, being a VM implicitly
> > reduces the set of drivers that are being used, and so it's not that ha=
rd
> > to add the flag in the key drivers that generate most of the bounce
> > buffer traffic.
>=20
> Yes, that's my thinking as well.
>=20
> > Then I was thinking about a slightly different usage for the flag than =
what
> > you implemented in v2 of the series.   In the case where swiotlb_map()
> > can't allocate slots because of the swiotlb pool being full (or mostly =
full),
> > kick the background thread (if it is not already awake) to allocate a
> > dynamic pool and grow the total size of the swiotlb.  Then if
> > SWIOTLB_MAY_SLEEP is *not* set, allocate a transient pool just as you
> > have implemented in this v3 of the series.  But if SWIOTLB_MAY_SLEEP
> > *is* set, swiotlb_map() should sleep until the background thread has
> > completed the memory allocation and grown the size of the swiotlb.
> > After the sleep, retry the slot allocation.  Maybe what I'm describing
> > is what you mean by "allow blocking allocations".  :-)
>=20
> Not really, but I like the idea. After all, the only reason to have
> transient pools is when something is needed immediately while the
> background allocation is running.

You can also take the thinking one step further:  For bounce buffer
requests that allow blocking, you could decide not to grow the pool
above a specified maximum.  If the max has been reached and space
is not available, sleep until space is released by some other in-progress
request.  This could be a valid way to handle peak demand while
capping the memory allocated to the bounce buffer pool.  There
would be a latency hit because of the waiting, but that could
be a valid tradeoff for rare peaks.  Of course, for requests that can't
block, you'd still need to allocate a transient pool.

Michael

>=20
> > This approach effectively throttles incoming swiotlb requests when spac=
e
> > is exhausted, and gives the dynamic sizing mechanism a chance to catch
> > up in an efficient fashion.  Limiting transient pools to requests that =
can't
> > sleep will reduce the likelihood of exhausting the coherent memory
> > pools.  And as you mentioned above, kicking the background thread at th=
e
> > 90% full mark (or some such heuristic) also helps the dynamic sizing
> > mechanism keep up with demand.
>=20
> FWIW I did some testing, and my systems were not able to survive a
> sudden I/O peak without transient pools, no matter how low I set the
> threshold for kicking a background. OTOH I always tested with the
> smallest possible SWIOTLB (256 KiB * rounded up number of CPUs, e.g. 16
> MiB on my VM with 48 CPUs). Other sizes may lead to different results.
>=20
> As a matter of fact, the size of the initial SWIOTLB memory pool and the
> size(s) of additional pool(s) sound like interesting tunable parameters
> that I haven't explored in depth yet.
>=20
> Petr T


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 16:04:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 16:04:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561806.878352 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJFqr-0005gT-GF; Tue, 11 Jul 2023 16:04:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561806.878352; Tue, 11 Jul 2023 16:04:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJFqr-0005gK-DR; Tue, 11 Jul 2023 16:04:33 +0000
Received: by outflank-mailman (input) for mailman id 561806;
 Tue, 11 Jul 2023 16:04:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=rRYD=C5=citrix.com=prvs=54940d4e9=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qJFqq-0005fl-0B
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 16:04:32 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9d63f95e-2004-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 18:04:30 +0200 (CEST)
Received: from mail-dm6nam10lp2102.outbound.protection.outlook.com (HELO
 NAM10-DM6-obe.outbound.protection.outlook.com) ([104.47.58.102])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 11 Jul 2023 12:04:23 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by BY5PR03MB5233.namprd03.prod.outlook.com (2603:10b6:a03:22c::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Tue, 11 Jul
 2023 16:04:20 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2%5]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023
 16:04:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9d63f95e-2004-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689091470;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=EG3wrjbRsczjgbQBhj3L+m/pELl8SwVkEpHOpIHGi5g=;
  b=Svqms9wB8h1dpoYM6UXCF+2BjI3CkFxrHJi5RJjE5moDimtqv/77tcC5
   C5eJ2Rh8FrHEk0RJ9qakO+uS2f7FWkyQ765E34u8OCb+vIPZELYvy5Ie8
   Im5LyF4Pw1qFoAvgG+QXCqV5pyPKqHlfx/YNvIEg7r0jp92Kym614KQVs
   M=;
X-IronPort-RemoteIP: 104.47.58.102
X-IronPort-MID: 114567044
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:qufqI6DUH9eSERVW/7/iw5YqxClBgxIJ4kV8jS/XYbTApD8j3jQAz
 TYcUDrVOf+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OfZslnd8k7Fh6NgPM
 VbAtJD4bTLZDAQ4KqUkWvIdurIq+P3lpxA8N2ut0uFOjsaEp2IgT0JbTqzIwlTfk1rFJA5HJ
 2T6o5uoCehQ20eaoCWF2QIRO/KovzMjdbDbQQdDxAqxQGShXfwgYSKXCSw71M7aXdi0L0i+W
 /Kn0jQ4biiieiyzlvxxnLe9JNfnfrm059mCNaXgsYYBz3wgkKDZZhnWZeFoDcpydvfpGoCoZ
 3pmVMNLs5z43TeciWeuh32wTTt1z4o9jvL1UKYqWGLm725eBsKT+56wa5JeBrQ7EQt+Ptm1r
 hQ4m6fv51LSTvdgSXG4cTSXR0CrDv1nZNiq59Rs5Vsa/paVFZjl/1awKqTKuZGIMvO0vFkLA
 CpNrCb2B8ZSyLCU5mThBgR/DXlZAVMIv7BeDlNhuWllwFMmnZ31k0Zw9FasEsh2fsGOsN5zt
 WBC79vkr5WSM8QcOZaP8cuBeWKKkGle2OQDIq1SW6XT53v/0i986Ie7NgOlZCXUY1Nw50olJ
 vbVlRE8WY0ZkL1EMWLmIZG6xbXXQyGLH3QI+xllu9EU4fHNczWGDzGTEprn9qrov0ZDMGeU/
 GvOIhOC/umKWf1A45G0wD3RpEXcBAlIYYok8d+X0jLrtPAK4XsuOCeePHPJKD1GTJhXm/kGH
 MMUDX6Oc0F5EG2XX3zhgTXRhrWCwTC1IM1FLKf8/kYyYALOIEJug8JiU6h7sXOMjFGurxeRj
 oLHFomqNLPmYCbxxe704wyAGssMq982sSSb093
X-Talos-CUID: 9a23:EC7+aGHvyo2tkRXyqmI5/n86HsAdI0bsyVyBeWabKmxxWZisHAo=
X-Talos-MUID: 9a23:rSO43wZaHXPb/+BTqzvvuB5ZMuRR+Z+DInoRwL5ZsciuDHkl
X-IronPort-AV: E=Sophos;i="6.01,196,1684814400"; 
   d="scan'208";a="114567044"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=J523z6dsO4o9ugZR/q8i9IfaecgDlnuXMocbUs+b59sykLInhyF6qsYtI6RiGAScY+ocOIsfRbSAdM03eMBYQc0MB8JTMHH4TZfOkSpR1R8bcWbJNMEnK7+rlgCXj1K/hna+PK3L5TG5o9IGIyb7F6/p4cjtEds1YQHRwkdH2G0NevPOQiKDGJrdULSfDmPSb5BF5tfzREiDYG6ee74Lurvj0zpbL2ypyDS+tQ7PqqY3B9N+881xxZROEUAR4XFz8GcsyB2SQ+Twf+oMlyvXvP3iHqg99DT4CBwbrq41I/VwrZKJa7KCOxzCQHT27y1N94CP5A7khLwu6r5e9/LCiQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=48chY0xPaSgtH4igxXtcrcXiKgeKOLWf++UqDMpz7t0=;
 b=XMJjSyUuDFULHMJAtBJ5i3OdEQzmPPE6wSBG3SU4DdmvkDvifF3QifQ1ziIFxHIgrRFseRiNZzCC9fheYsqASuflRcCvDW5JrsDLjtBegLZ+jkKikdlChp1Xz0uB3T6PakoPXsv+JKUIX7m0/PX/OuevTxawGwo4yzuAbTOtjeE1aJY+hrGgDjqW9e6qc9CGIr1yvExO51BzlVuqn05MckKDXI74NsQfKXTGUtkYvWTc5R343BzukFpEsE8apzljG7imJDbQ4+xMcCr9zmerNCEagi73WOeWY6I+LHroP8wm2hd8e0qHIOxJWoRTqSiQgikxDIiwm9ig4HZtVfbnbQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=48chY0xPaSgtH4igxXtcrcXiKgeKOLWf++UqDMpz7t0=;
 b=ihAWeKkq6KRrVDzhOGVQftn4fBj4qoylwFN6HjEZ+80DT65ER6NZuVC4OR3/B7gVA7jHIqtCGpBz8OG7HHuSbBgdmBl16wpJIuexNdATr6OKXwK93PraZoLJeBT0soj/EnZD4p3SuzCk1bcHT/e+hcmH22uZ4WBxbXRi2s0qma4=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Tue, 11 Jul 2023 18:04:12 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rahul Singh <rahul.singh@arm.com>
Subject: Re: [PATCH] xen/arm: pci: fix check in pci_check_bar()
Message-ID: <ZK19fKfVCH4Od6B1@MacBook-Air-de-Roger.local>
References: <20230711154648.729567-1-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20230711154648.729567-1-stewart.hildebrand@amd.com>
X-ClientProxiedBy: LO0P123CA0001.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:354::10) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|BY5PR03MB5233:EE_
X-MS-Office365-Filtering-Correlation-Id: 6dc51131-9ac0-49d0-7d48-08db82287b54
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	vWGZSkgp+FZGXJ2qWXrtNkBSsIuiLOPqBgyYyAUKzfEtg0bhD4siY9Z5CKSsm+HxahADj/t+Ub+0kb6ahdPWpYBa59jjVwfTm7CzAJZ/QNkpYV0vRmnGTg1E0QaOlkNo/cKMFDZ1i6gzt2qCfGSgtbe2cSBZHHOgqlrdqJsOC0EW9j0beYBH+fTHkKCZUAxs9GE7ZtkWPInW1CHGtohbwk697i+wdcK+jsaE03r1uaU3SY2uKt4y37C+Y99HgN7EPYOtoW9oLMcS2/x4SMnOQvCPBRR7uOm7GFvZwd/owh4cu9WLT8zplfuurxP9wK3i71dOjmc5ehgKbYwPJiFOOWP+TfevOAaoxPjYEpp4khRdTdDkloj33JXwjLg70AyJdJGr03EpW0/aX1RiFUo+UwBUKh/0IlHr66jtp1yF4K23ygSB9OBD5n5U1AX2OLmF9/VBFaxw47j1ylCFXMZnwX3vUaRyfH3oiKoTEFbUjHS4893YRPN+5M22PyiffVPBiocLZ+r3jLF5SVlXg7s4u0ZZhkujjjp8ssNBlN6WWWB/+msF4iXgqqhvmfqOhfku
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(366004)(136003)(346002)(396003)(451199021)(86362001)(8676002)(8936002)(186003)(85182001)(2906002)(83380400001)(5660300002)(26005)(9686003)(6506007)(82960400001)(6666004)(54906003)(38100700002)(66946007)(66476007)(66556008)(6916009)(6486002)(4326008)(478600001)(316002)(41300700001)(6512007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aUw4UytsdzkyRWttd3lBekNSTk4vQ0VzZXlWcWJsTnNieDR3WEc5R09mSzhm?=
 =?utf-8?B?UjlFVjROSWN2MmV1UUNpK2RwYkNDVExML0cxc2lHbnJyNHVPN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3yxO+m73h2MM3uPAQcMRIEOZW5yNR7U3uTYYpl6gI2Hx5NgKieO4FkkuCKuW26VKMp3xcz0frBwhHd280Y9IgEJAeb2nCeS2JZnmtyQTwwr32IAYbKtrU4yYRd3uc1WDM1nVdG201bGRqBqc6YfDNlRQIufF7ZqCkBho+N1E5nHUXaVrx2vmBOhU/JIPJf2jIAwAfNHiZwuq6CgbhgbhHWIlQcuYhLvAlQvGDzNjhjDV7q6ePpetNtP6nihrYc2U6sxh+3EP8GOx7lF9yklHUlOaLBJiShFuytNVKL5OTzzfzSXRxdq8AyTgFMZ1jOVPma4Rtc9P+T6GPAzOuKY3l0dnnHiSbXvM04gLjs4jFBHg==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6dc51131-9ac0-49d0-7d48-08db82287b54
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 16:04:19.0339
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: UNs1mJLuBEKCkkduerk3k/Xu9qLs94SQhjqdEqsuxx6trVhU/DnTI4HRZKDglLWUxVT41F1QKzecNgEJx3/1Ow==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR03MB5233

On Tue, Jul 11, 2023 at 11:46:47AM -0400, Stewart Hildebrand wrote:
> When mapping BARs for vPCI, it's valid for a BAR start address to equal the BAR
> end address (i.e. s == e). However, pci_check_bar() currently returns false in
> this case, which results in Xen not mapping the BAR. In this example boot log,
> Linux has mapped the BARs, but since Xen did not map them, Linux encounters a
> data abort and panics:
> 
> [    2.593300] pci 0000:00:00.0: BAR 0: assigned [mem 0x50008000-0x50008fff]
> [    2.593682] pci 0000:00:00.0: BAR 2: assigned [mem 0x50009000-0x50009fff]
> [    2.594066] pci 0000:00:00.0: BAR 4: assigned [mem 0x5000a000-0x5000afff]
> ...
> [    2.810502] virtio-pci 0000:00:00.0: enabling device (0000 -> 0002)
> (XEN) 0000:00:00.0: not mapping BAR [50008, 50008] invalid position
> (XEN) 0000:00:00.0: not mapping BAR [50009, 50009] invalid position
> (XEN) 0000:00:00.0: not mapping BAR [5000a, 5000a] invalid position
> [    2.817502] virtio-pci 0000:00:00.0: virtio_pci: leaving for legacy driver
> [    2.817853] virtio-pci 0000:00:00.0: enabling bus mastering
> (XEN) arch/arm/traps.c:1992:d0v0 HSR=0x00000093010045 pc=0xffff8000089507d4 gva=0xffff80000c46d012 gpa=0x00000050008012
> [    2.818397] Unable to handle kernel ttbr address size fault at virtual address ffff80000c46d012
> ...
> 
> Fix this by changing the condition in pci_check_bar().
> 
> Fixes: cc80e2bab0d0 ("xen/pci: replace call to is_memory_hole to pci_check_bar")
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
> ---
>  xen/arch/arm/pci/pci-host-common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/pci/pci-host-common.c b/xen/arch/arm/pci/pci-host-common.c
> index 7cdfc89e5211..e0ec526f9776 100644
> --- a/xen/arch/arm/pci/pci-host-common.c
> +++ b/xen/arch/arm/pci/pci-host-common.c
> @@ -406,7 +406,7 @@ bool pci_check_bar(const struct pci_dev *pdev, mfn_t start, mfn_t end)
>          .is_valid = false
>      };
>  
> -    if ( s >= e )
> +    if ( s > e )

I think you want to adjust e to include the full page, ie:

paddr_t e = mfn_to_maddr(end + 1) - 1;

As passing start == end should be assumed to cover a full page, and s
== e won't be possible anymore.  Adjusting the check to drop the equal
is still good IMO.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 16:04:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 16:04:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561805.878342 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJFqn-0005R1-9L; Tue, 11 Jul 2023 16:04:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561805.878342; Tue, 11 Jul 2023 16:04:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJFqn-0005Qu-6i; Tue, 11 Jul 2023 16:04:29 +0000
Received: by outflank-mailman (input) for mailman id 561805;
 Tue, 11 Jul 2023 16:04:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qJFql-0005Qn-T0
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 16:04:27 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJFql-0003oE-Ba; Tue, 11 Jul 2023 16:04:27 +0000
Received: from 54-240-197-228.amazon.com ([54.240.197.228]
 helo=[192.168.8.176]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJFql-0002UA-4P; Tue, 11 Jul 2023 16:04:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=mTMzeUH/vjDkXQ3rq5/RXgpxVovuxvloKnoFCrbT9ig=; b=EacNWT/s2sO39WjjJ4PfDyhByP
	2aE4rrjSPQcXjimotM0lAwJyUjnW1OGgKdBQiX8NxUr7w8jrFYxbXlmSe9F5ozlEuswPNgK+ju1rE
	bARFBm8CbY23ZAZv6X6YgbuVCjZ1HdnJza8tK5WeHHQ+HGWRJz0jStjlxryr/3s4kWg0=;
Message-ID: <3636dbc0-cb9f-69c5-3252-33997943d356@xen.org>
Date: Tue, 11 Jul 2023 17:04:25 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH 1/2] xen/arm: Fix domain_handle_dtb_bootmodule() error
 path
Content-Language: en-US
To: Luca Fancellu <Luca.Fancellu@arm.com>, Michal Orzel <michal.orzel@amd.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230711082931.5402-1-michal.orzel@amd.com>
 <20230711082931.5402-2-michal.orzel@amd.com>
 <5B7AB94D-613C-4B78-938F-81F843A7101F@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <5B7AB94D-613C-4B78-938F-81F843A7101F@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 11/07/2023 10:15, Luca Fancellu wrote:
> 
> 
>> On 11 Jul 2023, at 09:29, Michal Orzel <michal.orzel@amd.com> wrote:
>>
>> Fix the error path in domain_handle_dtb_bootmodule(), so that the memory
>> previously mapped is unmapped before returning the error code. This is
>> because the function shall not make assumptions on the way of handling
>> its error code in the callers. Today we call panic in case of domU
>> creation failure, so having memory not unmapped is not a bug, but it can
>> change.
>>
>> Similarly, fix prepare_dtb_domU() so that the memory allocated is freed
>> before returning the error code from domain_handle_dtb_bootmodule().
>>
>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> 
> Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 16:07:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 16:07:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561813.878362 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJFtR-0006ZS-Se; Tue, 11 Jul 2023 16:07:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561813.878362; Tue, 11 Jul 2023 16:07:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJFtR-0006ZL-Pk; Tue, 11 Jul 2023 16:07:13 +0000
Received: by outflank-mailman (input) for mailman id 561813;
 Tue, 11 Jul 2023 16:07:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qJFtQ-0006ZD-Eo
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 16:07:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJFtQ-0003qc-7D; Tue, 11 Jul 2023 16:07:12 +0000
Received: from 54-240-197-228.amazon.com ([54.240.197.228]
 helo=[192.168.8.176]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJFtQ-0002g0-1u; Tue, 11 Jul 2023 16:07:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=chJsI1+lhv1ic8+ehGMrs///auMfQgYravMo+4ot6xE=; b=4kEICu7cAsfmi3hJeQ72qjUhb9
	M1+yFj1OewrgQwBAbCOXrOTe8PJkkrUf00uMidq+ihZ5G8+cW4NE0FhGKPhbilZHx4I7LBwucGcZb
	AuFTysctmWQFFPn16xyR8yEwAPL0YGtbQ/RAbCrdwqeSbPuqxMgXlIbK4st3hval5OJk=;
Message-ID: <8bc1ed0e-3ad6-2243-4dd6-a88dd0ee00f8@xen.org>
Date: Tue, 11 Jul 2023 17:07:10 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH 2/2] xen/arm: Account for domU dtb bootmodule size
 separately
Content-Language: en-US
To: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230711082931.5402-1-michal.orzel@amd.com>
 <20230711082931.5402-3-michal.orzel@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230711082931.5402-3-michal.orzel@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Michal,

On 11/07/2023 09:29, Michal Orzel wrote:
> At the moment, we limit the allocation size when creating a domU dtb to
> 4KB, which is not enough when using a passthrough dtb with several nodes.
> Improve the handling by accounting for a dtb bootmodule (if present)
> size separately, while keeping 4KB for the Xen generated nodes (still
> plenty of space for new nodes). Also, cap the allocation size to 2MB,
> which is the max dtb size allowed.
> 
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> ---
> Note for the future:
> As discussed with Julien, really the best way would be to generate dtb directly
> in the guest memory, where no allocation would be necessary. This of course
> requires some rework. The solution in this patch is good enough for now and
> can be treated as an intermediated step to support dtb creation of various
> sizes.

Thanks for summarizing our discussion :).

> ---
>   xen/arch/arm/domain_build.c | 18 +++++++++++++-----
>   1 file changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index f2134f24b971..1dc0eca37bd6 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -3257,14 +3257,15 @@ static int __init domain_handle_dtb_bootmodule(struct domain *d,
>   }
>   
>   /*
> - * The max size for DT is 2MB. However, the generated DT is small, 4KB
> - * are enough for now, but we might have to increase it in the future.
> + * The max size for DT is 2MB. However, the generated DT is small (not including
> + * domU passthrough DT nodes whose size we account separately), 4KB are enough
> + * for now, but we might have to increase it in the future.
>    */
>   #define DOMU_DTB_SIZE 4096
>   static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
>   {
>       int addrcells, sizecells;
> -    int ret;
> +    int ret, fdt_size = DOMU_DTB_SIZE;

Can fdt_size be unsigned?

>   
>       kinfo->phandle_gic = GUEST_PHANDLE_GIC;
>       kinfo->gnttab_start = GUEST_GNTTAB_BASE;
> @@ -3273,11 +3274,18 @@ static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
>       addrcells = GUEST_ROOT_ADDRESS_CELLS;
>       sizecells = GUEST_ROOT_SIZE_CELLS;
>   
> -    kinfo->fdt = xmalloc_bytes(DOMU_DTB_SIZE);
> +    /* Account for domU passthrough DT size */
> +    if ( kinfo->dtb_bootmodule )
> +        fdt_size += kinfo->dtb_bootmodule->size;
> +
> +    /* Cap to max DT size if needed */
> +    fdt_size = min(fdt_size, SZ_2M);
> +
> +    kinfo->fdt = xmalloc_bytes(fdt_size);
>       if ( kinfo->fdt == NULL )
>           return -ENOMEM;
>   
> -    ret = fdt_create(kinfo->fdt, DOMU_DTB_SIZE);
> +    ret = fdt_create(kinfo->fdt, fdt_size);
>       if ( ret < 0 )
>           goto err;
>   

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 16:11:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 16:11:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561818.878372 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJFx1-00082u-Bg; Tue, 11 Jul 2023 16:10:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561818.878372; Tue, 11 Jul 2023 16:10:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJFx1-00082n-92; Tue, 11 Jul 2023 16:10:55 +0000
Received: by outflank-mailman (input) for mailman id 561818;
 Tue, 11 Jul 2023 16:10:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qJFx0-00082h-K1
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 16:10:54 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJFx0-0003vG-8T; Tue, 11 Jul 2023 16:10:54 +0000
Received: from 54-240-197-236.amazon.com ([54.240.197.236]
 helo=[192.168.8.176]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJFx0-0002o7-2j; Tue, 11 Jul 2023 16:10:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=8v0c/AtjzRiHbX0M2NJojbYKCAkvwv13WWD0LQ5dIYk=; b=cBFgumKbiDixijx5drrtNNGf2O
	gNjzq1pQY1OJ1iUZdGCKt7AvsV6XF212N741exMPlKqQXQrnk2gt6ze+VdqHNO/kz6s7BMGYG+99D
	kWJcmBfOuulX6AkKG8HMcONbPN+Owr4/KtgctB4489thXdVtIXs4lskamRTwxGhPORvI=;
Message-ID: <da7a0268-57d6-74ad-4f22-80ca8a0a5f3c@xen.org>
Date: Tue, 11 Jul 2023 17:10:52 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH] xen/arm: pci: fix check in pci_check_bar()
Content-Language: en-US
To: Stewart Hildebrand <stewart.hildebrand@amd.com>,
 xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Rahul Singh <rahul.singh@arm.com>
References: <20230711154648.729567-1-stewart.hildebrand@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230711154648.729567-1-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 11/07/2023 16:46, Stewart Hildebrand wrote:
> When mapping BARs for vPCI, it's valid for a BAR start address to equal the BAR
> end address (i.e. s == e). However, pci_check_bar() currently returns false in
> this case, which results in Xen not mapping the BAR. In this example boot log,
> Linux has mapped the BARs, but since Xen did not map them, Linux encounters a
> data abort and panics:
> 
> [    2.593300] pci 0000:00:00.0: BAR 0: assigned [mem 0x50008000-0x50008fff]
> [    2.593682] pci 0000:00:00.0: BAR 2: assigned [mem 0x50009000-0x50009fff]
> [    2.594066] pci 0000:00:00.0: BAR 4: assigned [mem 0x5000a000-0x5000afff]
> ...
> [    2.810502] virtio-pci 0000:00:00.0: enabling device (0000 -> 0002)
> (XEN) 0000:00:00.0: not mapping BAR [50008, 50008] invalid position
> (XEN) 0000:00:00.0: not mapping BAR [50009, 50009] invalid position
> (XEN) 0000:00:00.0: not mapping BAR [5000a, 5000a] invalid position
> [    2.817502] virtio-pci 0000:00:00.0: virtio_pci: leaving for legacy driver
> [    2.817853] virtio-pci 0000:00:00.0: enabling bus mastering
> (XEN) arch/arm/traps.c:1992:d0v0 HSR=0x00000093010045 pc=0xffff8000089507d4 gva=0xffff80000c46d012 gpa=0x00000050008012
> [    2.818397] Unable to handle kernel ttbr address size fault at virtual address ffff80000c46d012
> ...
> 
> Fix this by changing the condition in pci_check_bar().
> 
> Fixes: cc80e2bab0d0 ("xen/pci: replace call to is_memory_hole to pci_check_bar")
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
> ---
>   xen/arch/arm/pci/pci-host-common.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/pci/pci-host-common.c b/xen/arch/arm/pci/pci-host-common.c
> index 7cdfc89e5211..e0ec526f9776 100644
> --- a/xen/arch/arm/pci/pci-host-common.c
> +++ b/xen/arch/arm/pci/pci-host-common.c
> @@ -406,7 +406,7 @@ bool pci_check_bar(const struct pci_dev *pdev, mfn_t start, mfn_t end)
>           .is_valid = false
>       };
>   
> -    if ( s >= e )
> +    if ( s > e )
>           return false;

This is yet another example why using start/end in parameters are a bad 
idea :). I am OK if you want to keep the same interface, but can we at 
least document on top of the function whether we are expecting 'end' to 
be excluded or included?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 16:16:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 16:16:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561822.878382 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJG2g-0000Ef-VO; Tue, 11 Jul 2023 16:16:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561822.878382; Tue, 11 Jul 2023 16:16:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJG2g-0000EY-Si; Tue, 11 Jul 2023 16:16:46 +0000
Received: by outflank-mailman (input) for mailman id 561822;
 Tue, 11 Jul 2023 16:16:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=B4LE=C5=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJG2f-0000ES-MY
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 16:16:45 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2061d.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::61d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5381aba0-2006-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 18:16:44 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by DB8PR04MB6809.eurprd04.prod.outlook.com (2603:10a6:10:11b::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Tue, 11 Jul
 2023 16:16:39 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Tue, 11 Jul 2023
 16:16:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5381aba0-2006-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Wsd0hh14K4JpzKQy3zu1MDxZvaKb6iGmemXPfnY1hBShli2u8DdKEr2NTuJRFrDcCRyue9j9foG5jngzV0l7VA+rcGVIkIyw7d3vfqBzvuTLFTkP0DJVLXtHIS3lOxMfiKDTw4OCrMAN09F6z5cUwXCH8Me7z496oCX3TcKZen8p3ACFTL7Fl2J7iEwK34TWUjmIA1ad7A3SOkE1dItgLjKjlzJaccBdMIz4i7ONfhJ9d4/bfSjP7DAuJCdtv05TsvfVlwxEshv0pvIu5wx9m7wmTN/dwT9GD8OwP9nE5F+opy3WyEOuOB6tfAo0cmqApCZVP9FrfAzxSiakfJg2Yg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=N4dg9Szd5vVdHhz2bL9kxNl27QPYC3Gkivg4U6lpTrg=;
 b=FmSDk3Sz/jeEzRSuj4+UU7h+ciGAGuIip70Ehxu5t+awkZDmhrs6R8Jgis7Jh0NPXdM9b2i3SAqS5E+v09uZQrD84PXJFf0OK/lqjmfrgooPHcCseivu+h8D7+1dJevbHRXuKqLNufzEf/BSx/Q0Rlj0pV972/P+ENrPDH/sX1Pw+iFzK0eHkK7iWOtxqeJ6mGiEwoNmXV5UIsfYVFfRhvleowoaV+WMHMJqzRoo884ljEkGt4gF8Qvz0v8EgcsfGFhcItDg9NfEV00A5PyLfSeKZS66C1jVG7eq90cXFi0KXqnqL3LhlNazDs62Lu+udFoljYj9F4uqbwTssAs53A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=N4dg9Szd5vVdHhz2bL9kxNl27QPYC3Gkivg4U6lpTrg=;
 b=aPUSLSCeg7AuLyQjh9Zio9l+UwQT0PArRHUUdKH0UfLOvP39Sw5THDF1/nU72VzDe0TyjRGpytIP0OJaZ3T21o+leGslJblKC1YvIkplsB0fzwRscmvSeD83vGEVM3OZBM+MAwsJpMRWvCwdX1lHHjA4jla4zxr3E2bOMOnsdAgGH5PBahebZjMfC2Zui7CP7ElA7IIbRQFtN69OsP07l9cJQ5FqJdNNghIg192Si+josF4SOg7UnxmkkB2AEPFB4ajhD5OS8V7cDJlLXahK9KeVq8FjybQkpz578D4si3Y6kBp1s3GXPHIXVJh+b2wY6x90Izek+8iZOsjzzWvxVw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <d89193fc-f295-d7cd-686a-33363088cb68@suse.com>
Date: Tue, 11 Jul 2023 18:16:37 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v1] xen/drivers: ns16550: Fix the return logic for
 pci_uart_config()
Content-Language: en-US
To: Ayan Kumar Halder <ayankuma@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: sstabellini@kernel.org, stefano.stabellini@amd.com,
 andrew.cooper3@citrix.com, george.dunlap@citrix.com, julien@xen.org,
 wl@xen.org, xen-devel@lists.xenproject.org
References: <20230707113518.141489-1-ayan.kumar.halder@amd.com>
 <6717701f-76c3-94f6-241b-743b4828ad6e@suse.com>
 <b6ec25a2-e1fd-bbff-6f66-55172a5f5ed8@amd.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <b6ec25a2-e1fd-bbff-6f66-55172a5f5ed8@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0130.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:97::17) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DB8PR04MB6809:EE_
X-MS-Office365-Filtering-Correlation-Id: ab6eacd4-4b27-4bee-c459-08db822a350e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	t/eeNXu87RcKuB5iB/jnO9HpLwQXKfe+b9q2Q4p2WGLPtcfLbq8nSFzTU+n8krohMT/ZPD3BTAQ2DhtQZeKPjflD7HZBi9qxibqBVRbLS66eQ3eLF/IxMNYF5mO4iZQCl0Z241W67bsFb7+z/LKxM184rQoM6b6wRICS04AfWUSCDJ/rrfCBuj/F4pD8gPIfZtVD2wS+8HPUXZR8ThOgeD5MeSi5sQ225GkV/GI77leBfiwKrAxkZzy8ZHo4ANPaxU5hygI3zxnJBRCpR8a2XTR+DC92NVfmhumBRWfkzQ0A7sDhUcebQlJKoYF4PkwA3dWgx4yyHh2QSNSKC7KITsl+S/kG2V+eRBWit0A+83y1ZMoG5xDMW4UQSvEOvbkTBUrD/J/bNx+fdBqmkMJGbvgmUnkpHczpQMdR9zoZqu3aLbsks6FhbY7MUmlOxiYVwQb9TgxgsuDthr0gOQ9ifS0n5eQHF49mGxYn2EzcU3xTYqj0lOpXKCvDn456yPBHnDqtKULjVDOWy1EGQ0+ZJLooBS0bHzAHu7qoRtUtc+NTFPvGy8I34U0MeGrbNd3WAGrVsldxMBQoa+j0TgBXbGn398qQaD9bPo3c6bOHGbFKKq820dI/8Xu4eGEGoHLaZ+UjHgrx9KFyFRsIrmkO3Q==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(396003)(376002)(39860400002)(346002)(366004)(451199021)(53546011)(186003)(26005)(6506007)(6512007)(2616005)(41300700001)(316002)(2906002)(66476007)(66556008)(5660300002)(83380400001)(8936002)(8676002)(4326008)(478600001)(6486002)(66946007)(110136005)(36756003)(38100700002)(31696002)(86362001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?d0xHZG51MGExNG42NXhic01sN3NvTnFoc3BRcFJPaWdTaXYvM0xSdEp3bVNx?=
 =?utf-8?B?MzNCWFlBTWZFZE5QVzVQT1ZXZGg4WE13cVNQS2JLdnNBbzJQY09QOWZaWTA4?=
 =?utf-8?B?c0hSSEI1K0l6eSttZGNLbE14dmZBbDZEdFVHaUlUaGN4WEoxWGcxamlhWVBj?=
 =?utf-8?B?K3dzZFZ4OUtkQVVCeTB1ZXVrY3FjNkZEeVl4VytOUW1HSklxVlhqMjk4eUcr?=
 =?utf-8?B?VmtLUGtyY2UzSDMrZFRUd01VeVRRT1VYbjRqNlpNT2lTR012bDAzUHlCLytI?=
 =?utf-8?B?TXBZbTNBQlFiZUtmUnk3VlBMT09uZVFMWHZSSnlzQzIxTDRTSUI2dmFwT0xT?=
 =?utf-8?B?Z2JxS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8?Q?YmkKL8rDksGyRTONOje6JbaSk?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ab6eacd4-4b27-4bee-c459-08db822a350e
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 16:16:39.4470
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: JIU4TIlI0gmbpYmH75sNr1jgAfy2q2L17gkNK/BA+sRL/D2lD1RWCXQlnhc39GthtviFa5NvN+60oIpecRObfQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6809

On 11.07.2023 17:43, Ayan Kumar Halder wrote:
> On 10/07/2023 11:08, Jan Beulich wrote:
>> On 07.07.2023 13:35, Ayan Kumar Halder wrote:
>>> --- a/xen/drivers/char/ns16550.c
>>> +++ b/xen/drivers/char/ns16550.c
>>> @@ -1342,13 +1342,9 @@ pci_uart_config(struct ns16550 *uart, bool_t skip_amt, unsigned int idx)
>>>           }
>>>       }
>>>   
>>> -    if ( !skip_amt )
>>> -        return -1;
>> This special case probably needs retaining in the new model (with an
>> altered return value), such that ...
> 
> Does this look correct ?
> 
>  Â Â Â Â  if ( !skip_amt )
> -Â Â Â Â Â Â Â  return -1;
> +Â Â Â Â Â Â Â  return -EINVAL;

It's hard to say without seeing what else changes are done to the patch,
but at the first glance this looks wrong. If you change the function
along the lines of the initial patch, then likely this wants to be a
positive return value (to tell "failure" from "success" as well as from
this special case).

>>> @@ -1527,13 +1523,13 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
>>>   #ifdef CONFIG_HAS_PCI
>>>           if ( strncmp(conf, "pci", 3) == 0 )
>>>           {
>>> -            if ( pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com) )
>>> +            if ( !pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com) )
>>>                   return true;
>>>               conf += 3;
>>>           }
>>>           else if ( strncmp(conf, "amt", 3) == 0 )
>>>           {
>>> -            if ( pci_uart_config(uart, 0, uart - ns16550_com) )
>>> +            if ( !pci_uart_config(uart, 0, uart - ns16550_com) )
>>>                   return true;
>>>               conf += 3;
>>>           }
>> ... e.g. here you don't suddenly change behavior in unintended ways.
>> Prior to your change the earlier of the return paths was impossible
>> to be taken. That's likely wrong, but you now returning in the success
>> case can't be correct either:
> I am afraid I don't follow your comments very well.
> 
> pci_uart_config() returns 0 for success. So we need to check "!(pci_uart_config(...)" to return true.

But you cannot return here in the success case. You need to acknowledge
that in the original code a kind-of-error indication from the function
is converted to a success return here (which was impossible to happen
in one of the two cases, in turn causing extra confusion). So changing
this is a two-step process: First it needs to be understood what the
behavior ought to be at each of the four call sites. That behavior
likely isn't going to be the same in all four cases. And then this
needs transforming into the intended code change.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 16:24:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 16:24:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561830.878393 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJGA0-0001m7-RI; Tue, 11 Jul 2023 16:24:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561830.878393; Tue, 11 Jul 2023 16:24:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJGA0-0001m0-O9; Tue, 11 Jul 2023 16:24:20 +0000
Received: by outflank-mailman (input) for mailman id 561830;
 Tue, 11 Jul 2023 16:24:19 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJG9z-0001lq-5t; Tue, 11 Jul 2023 16:24:19 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJG9z-0004Jt-0q; Tue, 11 Jul 2023 16:24:19 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJG9y-0002Dn-Oe; Tue, 11 Jul 2023 16:24:18 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJG9y-0006u3-O8; Tue, 11 Jul 2023 16:24:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=l9EN1GOV3yOigbrjGsWW3pwXP10Uo6yuU9GaF9qixdQ=; b=4hZXklhqxnZOKmzksD/4nD2UBu
	n1LCGo+r8O5598N0HaZsPJG5Vazg1wdUa6MzHMQsRnzv1pxF2Ahg/IBBdulUsnKBKKOZZM5JxM7cN
	jsSyp8xb5j7NkSY5L/Mft0Ww4iDESBTsKJ/UiYJrp2j7Wexr2wjL5L310JIhx/1gf0AU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181761-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181761: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-shadow:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-pygrub:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-rtds:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:guest-start/debianhvm.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:guest-start/debianhvm.repeat:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=3f01e9fed8454dcd89727016c3e5b2fbb8f8e50c
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 11 Jul 2023 16:24:18 +0000

flight 181761 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181761/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-freebsd11-amd64 19 guest-localmigrate/x10 fail in 181755 pass in 181761
 test-amd64-amd64-xl-shadow 22 guest-start/debian.repeat fail in 181755 pass in 181761
 test-amd64-amd64-pygrub 19 guest-localmigrate/x10 fail in 181755 pass in 181761
 test-amd64-amd64-xl-rtds     22 guest-start/debian.repeat  fail pass in 181755
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 20 guest-start/debianhvm.repeat fail pass in 181755
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 18 guest-localmigrate/x10 fail pass in 181755
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 20 guest-start/debianhvm.repeat fail pass in 181755

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                3f01e9fed8454dcd89727016c3e5b2fbb8f8e50c
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   85 days
Failing since        180281  2023-04-17 06:24:36 Z   85 days  170 attempts
Testing same since   181755  2023-07-10 17:42:07 Z    0 days    2 attempts

------------------------------------------------------------
3736 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 622011 lines long.)


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 16:41:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 16:41:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561839.878403 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJGQ9-0004Ct-6Y; Tue, 11 Jul 2023 16:41:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561839.878403; Tue, 11 Jul 2023 16:41:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJGQ9-0004Cm-3l; Tue, 11 Jul 2023 16:41:01 +0000
Received: by outflank-mailman (input) for mailman id 561839;
 Tue, 11 Jul 2023 16:40:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=t7q7=C5=bugseng.com=roberto.bagnara@srs-se1.protection.inumbo.net>)
 id 1qJGQ7-0004Cg-NS
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 16:40:59 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b62573bc-2009-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 18:40:58 +0200 (CEST)
Received: from [192.168.1.48] (unknown [151.29.134.109])
 by support.bugseng.com (Postfix) with ESMTPSA id 624D04EE0737
 for <xen-devel@lists.xenproject.org>; Tue, 11 Jul 2023 18:40:57 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b62573bc-2009-11ee-b239-6b7b168915f2
Message-ID: <fa2bc5da-b866-05ac-409f-c26e025428c3@bugseng.com>
Date: Tue, 11 Jul 2023 18:40:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050929
 Thunderbird/1.0.7 Fedora/1.0.7-1.1.fc4 Mnenhy/0.7.3.0
To: xen-devel@lists.xenproject.org
Content-Language: en-US
From: Roberto Bagnara <roberto.bagnara@bugseng.com>
Subject: Violations of mandatory MISRA C:2012 Rule 19.1 in X86_64 build
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit


Hi there.

Mandatory Rule 19.1 (An object shall not be assigned or copied to an
overlapping object) is directly targeted at two undefined behaviors,
one of which is the subject of 6.5.16.1p3, namely:

   If the value being stored in an object is read from another object
   that overlaps in any way the storage of the first object, then the
   overlap shall be exact and the two objects shall have qualified or
   unqualified versions of a compatible type; otherwise, the behavior
   is undefined.

You can see a number of definite violations in the X86_64 build
at this link:

   https://saas.eclairit.com:3787/fs/var/local/eclair/XEN.ecdf/ECLAIR_normal/origin/staging/X86_64-Set1/149/PROJECT.ecd;/by_service/MC3R1.R19.1.html

As the rule is mandatory, it cannot be deviated.
Kind regards,

    Roberto


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 17:50:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 17:50:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561847.878413 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJHV2-00034w-9L; Tue, 11 Jul 2023 17:50:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561847.878413; Tue, 11 Jul 2023 17:50:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJHV2-00034p-5c; Tue, 11 Jul 2023 17:50:08 +0000
Received: by outflank-mailman (input) for mailman id 561847;
 Tue, 11 Jul 2023 17:50:07 +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
 <SRS0=cjKM=C5=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qJHV1-00034f-0z
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 17:50:07 +0000
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com
 [2a00:1450:4864:20::134])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5de4d970-2013-11ee-8611-37d641c3527e;
 Tue, 11 Jul 2023 19:50:04 +0200 (CEST)
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-4faaaa476a9so9810651e87.2
 for <xen-devel@lists.xenproject.org>; Tue, 11 Jul 2023 10:50:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5de4d970-2013-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689097804; x=1691689804;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=VUN8KD9tNvZb3y3+8dxnWQJeVLSAh3t75kfY9QrgH2k=;
        b=bHi7PUi2I6I2oIk3UgsJIhjETDMcTKwdoicNEc0jhbWX49lwBa2O74rnYfvwqPBSwn
         CELp9WFakiZDoMjgiReoxljpMCmjMuFsPk/nVfJRESvzkyd/hbbq8DAPklU596f/5Obi
         jcYMFnyPOwJ6hUGgEOY2y7IzqPWdgLLA6axuJYICbgvRaQE0OL/x0hKSuS2d+slgm4FI
         mlS1aJAHIqkf0S2eNXkPv78Wpw7Cwha302TQrE4uj+2Y8U3de8N57omLw2AbYsRtKtnm
         lT+e6nnvJzDvbyvfwkPYKdRKdarTyDVgwGmWauO26nlJVe7mcOQFe2qisVakF15LAod5
         WZyA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689097804; x=1691689804;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=VUN8KD9tNvZb3y3+8dxnWQJeVLSAh3t75kfY9QrgH2k=;
        b=VulmB6/SWiAVDHhNugR5BvofF2qISrdkDtCz1NLEd3gdmn052XqzQgV5z9qV0kOCjf
         qLa8oTlGQS/izh6wIAW0ScsLdfk0bKEpsgR0dtE2VGDjLpZAXsVmAa9qxkjXS974HrgI
         9btMyxQoO+W4o00iYy7UsuQHm0ZIflp1NoWrbaNxmBzVe67lYv9GB+Ax31Thv8IqMCbD
         /xD30pqII5eOcPNmoEKCmMfg+ZOwMbzR4wtHDgRYHfv+HgfE8w527OEGVzo1xyIN1H9h
         flfTWFkZpCfhkcJzxYWZYVlEQYwJdgx4WRNMIzijpgg+SyHRNnXaB7JXcDg77ErqvmOX
         hJeg==
X-Gm-Message-State: ABy/qLYQcevIzz4ryCvm14PihRyVKO3iXS1rOg6qmV+FwW9T42sNisL1
	CA4QyBEW59bmlmvgIHQjnEheSv1fvZosYTBn08mL0zjr
X-Google-Smtp-Source: APBJJlEn46nXPlwtaHk44qlRraM1wbmWIgjX5liWpikmIs3LCtU93Y8Awj7xACjKgBeFM9aHmuDJyN4K9PVHjX6N7uU=
X-Received: by 2002:a05:6512:1595:b0:4fb:52a3:e809 with SMTP id
 bp21-20020a056512159500b004fb52a3e809mr15336922lfb.28.1689097803825; Tue, 11
 Jul 2023 10:50:03 -0700 (PDT)
MIME-Version: 1.0
References: <20230706185440.48333-1-jandryuk@gmail.com> <20230706185440.48333-7-jandryuk@gmail.com>
 <eeeb032f-a21b-5eb2-e3d5-63357a04a500@suse.com> <CAKf6xptn0OL0qz+DW9qrwU=sFSKSp-O3S7z6vFbZp9RstFanbw@mail.gmail.com>
 <bfacee48-f640-f2eb-7fd7-f440ad03e612@suse.com> <CAKf6xpvVd49dx=CtGyPMt+NMuOfhJ4a1fiZb-O4e-guq9BwcFw@mail.gmail.com>
 <cdbaec77-9112-7b18-e9eb-fa12a16d2ccf@suse.com>
In-Reply-To: <cdbaec77-9112-7b18-e9eb-fa12a16d2ccf@suse.com>
From: Jason Andryuk <jandryuk@gmail.com>
Date: Tue, 11 Jul 2023 13:49:51 -0400
Message-ID: <CAKf6xpspsyShp2O8SLK+=VQvxd=Uaewg-JHYAFPqEPmEWvDRAg@mail.gmail.com>
Subject: Re: [PATCH v5 06/15] cpufreq: Add Hardware P-State (HWP) driver
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, 
	Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 11, 2023 at 10:41=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wr=
ote:
>
> On 11.07.2023 16:16, Jason Andryuk wrote:
> > On Tue, Jul 11, 2023 at 4:18=E2=80=AFAM Jan Beulich <jbeulich@suse.com>=
 wrote:
> >> On 10.07.2023 17:22, Jason Andryuk wrote:
> >>> On Mon, Jul 10, 2023 at 9:13=E2=80=AFAM Jan Beulich <jbeulich@suse.co=
m> wrote:
> >>>> On 06.07.2023 20:54, Jason Andryuk wrote:
> >>>>> @@ -510,6 +510,22 @@ choice of `dom0-kernel` is deprecated and not =
supported by all Dom0 kernels.
> >>>>>  * `<maxfreq>` and `<minfreq>` are integers which represent max and=
 min processor frequencies
> >>>>>    respectively.
> >>>>>  * `verbose` option can be included as a string or also as `verbose=
=3D<integer>`
> >>>>> +  for `xen`.  It is a boolean for `hwp`.
> >>>>> +* `hwp` selects Hardware-Controlled Performance States (HWP) on su=
pported Intel
> >>>>> +  hardware.  HWP is a Skylake+ feature which provides better CPU p=
ower
> >>>>> +  management.  The default is disabled.  If `hwp` is selected, but=
 hardware
> >>>>> +  support is not available, Xen will fallback to cpufreq=3Dxen.
> >>>>> +* `<hdc>` is a boolean to enable Hardware Duty Cycling (HDC).  HDC=
 enables the
> >>>>> +  processor to autonomously force physical package components into=
 idle state.
> >>>>> +  The default is enabled, but the option only applies when `hwp` i=
s enabled.
> >>>>> +
> >>>>> +There is also support for `;`-separated fallback options:
> >>>>> +`cpufreq=3Dhwp,verbose;xen`.  This first tries `hwp` and falls bac=
k to `xen`
> >>>>> +if unavailable.
> >>>>
> >>>> In the given example, does "verbose" also apply to the fallback case=
? If so,
> >>>> perhaps better "cpufreq=3Dhwp;xen,verbose", to eliminate that ambigu=
ity?
> >>>
> >>> Yes, "verbose" is applied to both.  I can make the change.  I
> >>> mentioned it in the commit message, but I'll mention it here as well.
> >>
> >> FTAOD my earlier comment implied that the spelling form you use above
> >> should not even be accepted when parsing. I.e. it was not just about
> >> the doc aspect.
> >
> > Oh.  So what exactly do you want then?
> >
> > There is a single cpufreq_verbose variable today that is set by either
> > cpufreq=3Dhwp,verbose or cpufreq=3Dxen,verbose.  Is that okay, or shoul=
d
> > the "xen" and "hwp" each get a separate variable?
> >
> > Do you only want to allow a single trailing "verbose" to apply to all
> > of cpufreq (cpufreq=3D$foo,verbose)?  Or do you want "verbose" to be
> > only valid for "xen"?  Both cpufreq_cmdline_parse() and
> > hwp_cmdline_parse() just loop over their options and don't care about
> > order, even though the documentation lists verbose last.  Would you
> > want "cpufreq=3Dhwp,verbose,hdc" to fail to parse?
> >
> > All parsing is done upfront before knowing whether "xen" or "hwp" will
> > be used as the cpufreq driver, so there is a trickiness for
> > implementing "verbose" only for one option.  Similarly,
> > "cpufreq=3Dhwp,invalid;xen" will try "hwp" (but not "xen")  since the
> > live variables are updated.  Even without this patch, cpufreq will be
> > configured up to an invalid parameter.
>
> Right, and I'd like to see "hwp;xen" to be treated as a "unit", with
> ",verbose" applying to whichever succeeds initializing. I don't think
> there is much point to have separate verbosity variables.

When you say "hwp;xen" as a unit, you don't mean to intermix all the
options like:
cpufreq=3Dhwp;xen:ondemand,hdc,maxfreq=3D42
do you?

Because of the suboptions, I don't treat "hwp;xen" as a unit, but as
strings separated by ';'.
That allows the full selection of parameters like:
cpufreq=3Dhwc,no-hdc;xen:ondemand,maxfreq=3D42,minfreq=3D0

This lets each respective parser handle the options it knows about.
This does duplicate "verbose" handling.  cpufreq_cmdline_parse() and
hwp_cmdline_parse() are also usable when only one of "hwp" or "xen" is
specified.

These all work:
cpufreq=3Dxen:ondemand,verbose
cpufreq=3Dhwp,hdc,verbose
cpurfre=3Dhwp,hdc;xen:ondemand,verbose

To disallow "verbose" in "cpufreq=3Dhwp,verbose;xen" would require extra
code, and setup_cpufreq_option() is already rather complicated IMO.
It's a corner case, but doesn't seem harmful to me.   Hmmm, making the
above fail parsing may be worse since it would only try "hwp" without
a fallback to "xen".

I just want to be clear on exactly what I need to implement.

Regards,
Jason


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 18:40:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 18:40:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561852.878424 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJIHL-0008JN-Tc; Tue, 11 Jul 2023 18:40:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561852.878424; Tue, 11 Jul 2023 18:40:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJIHL-0008JG-OT; Tue, 11 Jul 2023 18:40:03 +0000
Received: by outflank-mailman (input) for mailman id 561852;
 Tue, 11 Jul 2023 18:40:02 +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
 <SRS0=e9Pp=C5=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1qJIHK-0007qT-F4
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 18:40:02 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on2062f.outbound.protection.outlook.com
 [2a01:111:f400:7e89::62f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 56829af1-201a-11ee-8611-37d641c3527e;
 Tue, 11 Jul 2023 20:39:59 +0200 (CEST)
Received: from MW4P223CA0002.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::7) by
 BY5PR12MB4084.namprd12.prod.outlook.com (2603:10b6:a03:205::14) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Tue, 11 Jul
 2023 18:39:54 +0000
Received: from CO1NAM11FT031.eop-nam11.prod.protection.outlook.com
 (2603:10b6:303:80:cafe::65) by MW4P223CA0002.outlook.office365.com
 (2603:10b6:303:80::7) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20 via Frontend
 Transport; Tue, 11 Jul 2023 18:39:54 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CO1NAM11FT031.mail.protection.outlook.com (10.13.174.118) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.20 via Frontend Transport; Tue, 11 Jul 2023 18:39:53 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 11 Jul
 2023 13:39:52 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 11 Jul
 2023 13:39:52 -0500
Received: from [192.168.137.15] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Tue, 11 Jul 2023 13:39:51 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 56829af1-201a-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=c+G17aqSaUlumij63/FZ+tbsK1ve9YfIxEP+00AN4GNqkdgYWw9deyaqwanOiLiFZaRjs3oGMvYd7ah7owxwtYbNR4HHhcDd09h0verKzcV0c4Pa6T1HhNDhBPY/hQV/WYMsys8IvJT8WVbPxpbIiSljQMDYCby3ut42ZG05EI5LbgLrTlNoELf6ix4k1KZj6gJ1ErRn5/eZISE9D8Wet5HvqQpbPl08EHLIKo+ugnDY0nlN6jTVI0JeCUoIbQCfTnHUzcKB/IPDEFey//K56MMrtPgyTLLTJZH3Opka0G6CZjdwDzdr/feb1x5NQkjz6uqaafjx9LDECOX0maq8xA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=sx8DOHT2p5MU8kS/X9RGeA2+Wmz1iLb+nZoRNiHb5d8=;
 b=RiW9kwOZXf64M73QMvn1NFiL8jaFYhfSt7alTh+7hmEhZ1ByeWyCpODdQVeItPeELuqt2FGmSDadIylLGJq2DYw1bcijFPhpnlERzBnHCfA5eUOb3ksftL8+JfBPmxS38SuxtqeLQSTflyYWvtna7mHhOe6NwAnlfiet/lJXfx2W9zWJazoquLVngUqaMmnpUqqHa/qyJ8BTVCrSq3OOn5UzPduC7wXPekAJGSQJD1nTvo7Mz/j+6ZdE2Rr0vziegAkPF2lak566DeyxtsX1gXC0FSjUYcq2OK+d+i4IStenrqOWaGbPy/xmk38rK+DxaY2H1BwCV6qSwsqtbLQAAA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=sx8DOHT2p5MU8kS/X9RGeA2+Wmz1iLb+nZoRNiHb5d8=;
 b=D85UwZhrVib9zooTChcK4GR9YZe8b1XIx9T52p+/Tw/1SQtA1/xBJrzKXT30w2XRVWm/O4qJDCYMkBoJMHyjqfRljlnpShm+CT2ORqOXO8aLAO0cL7o+RogM0HBcNinC1KLVGLSWHl1r/0WEfmXtr3p69Vfp36h7pDcfqKtvPXQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <911710f3-8462-1178-9ae6-3e71df228f18@amd.com>
Date: Tue, 11 Jul 2023 14:39:50 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [PATCH] xen/arm: pci: fix check in pci_check_bar()
Content-Language: en-US
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rahul Singh <rahul.singh@arm.com>
References: <20230711154648.729567-1-stewart.hildebrand@amd.com>
 <da7a0268-57d6-74ad-4f22-80ca8a0a5f3c@xen.org>
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
In-Reply-To: <da7a0268-57d6-74ad-4f22-80ca8a0a5f3c@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1NAM11FT031:EE_|BY5PR12MB4084:EE_
X-MS-Office365-Filtering-Correlation-Id: c065e295-6978-47a1-3864-08db823e37a8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	hBhSUU17sOGHmtP9bZaAiy39lxaIQbegRGc4XwxcBU4kfG+eVx9ARHxu+L7AsCVWKsq4mEzMPeuO8zfUgK5TMWFa8MeKkSAFjBKQw+sATOTJ7kxDW3BWyCY59XDO5rs2JT3E9vhrYw42KdGpMUYU/Eq96bTIJipuX7HpxpHAUUw2M5HCkrfw6PN7QY+KhB4uUTUR9bLz8BCd7OCcsXEFoCTQTxeYmlvAlvH0MhoEIXQOKFzyMYUGTEheZ0qoP1Dcak9nugzLMlErifCNitr+JeiccGSeuS1mQMHykgvn9+rYNzUsuW3/DGW5gJFr7FRew6qRTSfqVh6vcAaPOcymo/fPvWkCz15nm98suPzwrgwppDN+h/NWS+/s7w+H1bHzvYMgpNtJpMPUxwrNqPZ6GBdozTawbUoqt567LvLwgIQs8KZMoJU3wsa6hnd5JfBd2TqewU0aYVIOQGiwnsyf1jFAfGfxZgKG3avZfBQrLHdMMpPd031cZB95n+ddbIq7XE47+QV7iFB/KSSRx/8NakzNHDXaZuXbNDCihQc6KhmgikoFlynVUyQWzssJ7ppGrSqlrk3wPMPMXFt/2b9Zb0m0gyuuEIeTQVatnr/oLnTOF+3fVlMqLlHGk/tJtcWqkbl0cO3eh+go77EDXk+Twsml3IV82UOi59QcQmjSiUdITs6xcht1U7l7IdcOVaC5G6aYYBdnQ5E/xTjcnhDqL1DVwwfVf8I8uyXX+bf1iLctpNCQ5NKAMxmiAvXH/vHo0GIw37Rwwr58abV8tr9P3nabaTCQwfJCY0sEuXFo4dOzS5S6KqYN9WDONE5HMicK
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(136003)(346002)(396003)(451199021)(40470700004)(36840700001)(46966006)(86362001)(40460700003)(82310400005)(8676002)(8936002)(186003)(426003)(47076005)(336012)(36860700001)(2616005)(2906002)(83380400001)(36756003)(5660300002)(44832011)(26005)(53546011)(40480700001)(356005)(81166007)(82740400003)(54906003)(16576012)(110136005)(70206006)(70586007)(4326008)(478600001)(31686004)(31696002)(41300700001)(316002)(36900700001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 18:39:53.4693
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: c065e295-6978-47a1-3864-08db823e37a8
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1NAM11FT031.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4084

On 7/11/23 12:10, Julien Grall wrote:
> Hi,
> 
> On 11/07/2023 16:46, Stewart Hildebrand wrote:
>> When mapping BARs for vPCI, it's valid for a BAR start address to equal the BAR
>> end address (i.e. s == e). However, pci_check_bar() currently returns false in
>> this case, which results in Xen not mapping the BAR. In this example boot log,
>> Linux has mapped the BARs, but since Xen did not map them, Linux encounters a
>> data abort and panics:
>>
>> [Â Â Â  2.593300] pci 0000:00:00.0: BAR 0: assigned [mem 0x50008000-0x50008fff]
>> [Â Â Â  2.593682] pci 0000:00:00.0: BAR 2: assigned [mem 0x50009000-0x50009fff]
>> [Â Â Â  2.594066] pci 0000:00:00.0: BAR 4: assigned [mem 0x5000a000-0x5000afff]
>> ...
>> [Â Â Â  2.810502] virtio-pci 0000:00:00.0: enabling device (0000 -> 0002)
>> (XEN) 0000:00:00.0: not mapping BAR [50008, 50008] invalid position
>> (XEN) 0000:00:00.0: not mapping BAR [50009, 50009] invalid position
>> (XEN) 0000:00:00.0: not mapping BAR [5000a, 5000a] invalid position
>> [Â Â Â  2.817502] virtio-pci 0000:00:00.0: virtio_pci: leaving for legacy driver
>> [Â Â Â  2.817853] virtio-pci 0000:00:00.0: enabling bus mastering
>> (XEN) arch/arm/traps.c:1992:d0v0 HSR=0x00000093010045 pc=0xffff8000089507d4 gva=0xffff80000c46d012 gpa=0x00000050008012
>> [Â Â Â  2.818397] Unable to handle kernel ttbr address size fault at virtual address ffff80000c46d012
>> ...
>>
>> Fix this by changing the condition in pci_check_bar().
>>
>> Fixes: cc80e2bab0d0 ("xen/pci: replace call to is_memory_hole to pci_check_bar")
>> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
>> ---
>> Â  xen/arch/arm/pci/pci-host-common.c | 2 +-
>> Â  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/pci/pci-host-common.c b/xen/arch/arm/pci/pci-host-common.c
>> index 7cdfc89e5211..e0ec526f9776 100644
>> --- a/xen/arch/arm/pci/pci-host-common.c
>> +++ b/xen/arch/arm/pci/pci-host-common.c
>> @@ -406,7 +406,7 @@ bool pci_check_bar(const struct pci_dev *pdev, mfn_t start, mfn_t end)
>> Â Â Â Â Â Â Â Â Â  .is_valid = false
>> Â Â Â Â Â  };
>>
>> -Â Â Â  if ( s >= e )
>> +Â Â Â  if ( s > e )
>> Â Â Â Â Â Â Â Â Â  return false;
> 
> This is yet another example why using start/end in parameters are a bad
> idea :). I am OK if you want to keep the same interface, but can we at
> least document on top of the function whether we are expecting 'end' to
> be excluded or included?

Yes, will do. I will send a v2 that also addresses Roger's comments. For clarity's sake, e is inclusive.


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 18:40:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 18:40:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561856.878433 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJIHy-0000kR-AA; Tue, 11 Jul 2023 18:40:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561856.878433; Tue, 11 Jul 2023 18:40:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJIHy-0000kI-7I; Tue, 11 Jul 2023 18:40:42 +0000
Received: by outflank-mailman (input) for mailman id 561856;
 Tue, 11 Jul 2023 18:40:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DOJ8=C5=epam.com=prvs=15563ed9c2=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qJIHx-0000k5-Ex
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 18:40:41 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6df57a1c-201a-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 20:40:39 +0200 (CEST)
Received: from pps.filterd (m0174678.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36BHQjLO020092; Tue, 11 Jul 2023 18:40:17 GMT
Received: from eur05-db8-obe.outbound.protection.outlook.com
 (mail-db8eur05lp2105.outbound.protection.outlook.com [104.47.17.105])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rs9d0gm6a-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Tue, 11 Jul 2023 18:40:17 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by DBBPR03MB6793.eurprd03.prod.outlook.com (2603:10a6:10:20d::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Tue, 11 Jul
 2023 18:40:12 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::c192:26de:9053:ab05]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::c192:26de:9053:ab05%6]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023
 18:40:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6df57a1c-201a-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=FpzFL60U6RCuOXJnV1NuAoKOHpcPjNzJjkUeOkVdgW6kz5pTJ5jgkzdvafiUda1IkZms6Yw+hzK4nZIALQCa2IM8Z6vP8iC3vJsEE1gSapZKv+mFHxPS50daCJNWXdsJFPjXJNuVNpFeOk6rfYjLSFd2spURW4lv3ThcH5i/Fmse+OwspNSUbt9Tm/lA/XTk+eH6XzVIhkYBAR9bs4z5pCZ9DTKUEF6VVRGwfaBuTLFZ5X6G8T0dMJxPa5Mb7XnrpvvnwcSbstlh6nNFdjSk7gYQyBAvf9nsT23GZ/EeVXrmOSlIGQ4KsWP2UzgAihe47J51UQksMhmrd7+HILBiag==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/p+MxtRDwvtYjlUJxdd/9xXXLDc+sRhmhaimPrYvPIQ=;
 b=FZ3Fr2uuYjq77ppXsQkmhVKKChEJ0kUM6xZ1QuY2KVMJKzyT+Do3X3TWJtmtM2W4YEFLAjXPSrbnvcNd+70/05gFduvNin7JLhGtaqK6ul2IwxzFrs+8Uwntmx7YVT0SdQzMVAewmq/0fzl+c1XFOaVZ7meg1vULasvdlDKFsHl8HFG6y9DFZnv8/l1NIj63aC1p9N6haNeZ8HWK0Zncu+grZ9UdUAMdWgRRNnYqH3oxPBY09xZ6m/c0M9DLB+KZZJhtS0cfJQyYHMTi0D8w6KTeJvLyZKDsB4xZmWh8xMbo9W3ZjxwK7EMre9KAIJbLwOuQ7mIX5iEpjeijID0WLA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/p+MxtRDwvtYjlUJxdd/9xXXLDc+sRhmhaimPrYvPIQ=;
 b=Ijhcb64Ii9FfGclz9eE0MWnl5sQ07R2rVlKZ12IQr5mH/VJkXsqZr6tONYkuLgoA9JBXGfiBGVT4+Y8NXb3zJu7Ov5d6XF0xAcvn5tpUliQwzGxt9SFwcYD4BRNq9z3C+bZqq32eO0JYR/Cc4zUHZAcYB8CUnv5igPlpJ1ftP52I4CoEVN4MmW9B3Z6TJJiOaK0wB/HsdhA1ZzzGLTYd8Jz+JYr9GTLJlVczC3M48w+jBKVriOgB4VQb70rASxLnQUZ7epV36ny11MUZNBUrwUkXSHz+oIDA4SC/y+mrDyDJR7sItxIPy/sxbPFsz9GJbDdh8GA+SicWTidTWp1ZWg==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>,
        =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>,
        Wei Liu
	<wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
        Julien Grall
	<julien@xen.org>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Jun Nakajima
	<jun.nakajima@intel.com>,
        Kevin Tian <kevin.tian@intel.com>, Paul Durrant
	<paul@xen.org>,
        Oleksandr Tyshchenko <olekstysh@gmail.com>,
        Oleksandr
 Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
        "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [RFC PATCH] pci: introduce per-domain PCI rwlock
Thread-Topic: [RFC PATCH] pci: introduce per-domain PCI rwlock
Thread-Index: AQHZs5ESsjHhLtlMU0qzCbDGds6cO6+0XLQAgABxyYA=
Date: Tue, 11 Jul 2023 18:40:11 +0000
Message-ID: <874jmagulx.fsf@epam.com>
References: <20230711004537.888185-1-volodymyr_babchuk@epam.com>
 <e6ca0ef1-fb66-d923-388f-79cfc20d1626@suse.com>
In-Reply-To: <e6ca0ef1-fb66-d923-388f-79cfc20d1626@suse.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: mu4e 1.8.9; emacs 28.2
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|DBBPR03MB6793:EE_
x-ms-office365-filtering-correlation-id: 79010c29-d39b-4bc4-a705-08db823e4292
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 8b8ioz8DBp7Ha/ZTikB891zU3Y9MOjq8CMwfLrNrxHghEhwpOCdNXrK8YlPfMB7IDF3wmSzcsfwfrxCzRFXm9ZBFYpPzo5n1C2ERXvQiavOxwukP0xXHtHaMdRe4zAXjC/HNbpkAe5Jq50fsks68DRFkLGiM0nvv40DLz0BVQceYAAlVV3b6BAoHVlfuv0qDN+WtKRxdyC+rHlNIJV7k/J6uZTbkQ2qiewBZ7yXEY8eeKGb2OfhK2loMxlDo9UgjfwD0rEbcvTeU32V+c+MRTkrjqpU13WCVijRj1lUuWdrnhTmH39Y1/u9/nukK4nN4jm8iZ17pWiD3Z8putatrAI8G4JEwsWf9EFnWweXZeRwctdfwOHFzRHmssk9+fcElCwJWY1pGsb+QEcSIbsaA81AORNAit09rs/ALk781FNXby3XQC0n6xRLyWhYl9h2tiQ4bxh+WUNSH2Lk++3CUarlg75QF0iuPDmHDOBDs3chocEl9WyckHojpWBPzl/0d1jo0MaosZ4GkvVOBw+o+igVi/N/6RfvPy+/CofMn6qJbYBV1R1p0IoJyMgKb+6l6pni9qjeeqUwvB8W2RC0XdrHdDalqltaKTAt2EWGMMvwySGcQV7vFnY9I09TPbDAI
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(366004)(346002)(376002)(39860400002)(451199021)(6486002)(6512007)(71200400001)(186003)(6506007)(26005)(55236004)(53546011)(83380400001)(36756003)(2616005)(38070700005)(86362001)(38100700002)(122000001)(76116006)(91956017)(6916009)(4326008)(66946007)(66556008)(66476007)(66446008)(64756008)(41300700001)(2906002)(316002)(7416002)(5660300002)(8676002)(8936002)(54906003)(478600001)(66899021);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?N1NESzhmNFRKT3BaUFdUSUtZMWVJSFR4em9OVmhXenJnb0NqdmIxemFKYXZi?=
 =?utf-8?B?MStJT05YL1QwYWJuTjJWK3NrYjUyMWR3MThPR2dSSDdwL1FqUXlpd0YwT3JY?=
 =?utf-8?B?OE5KVTg3QXdrd01wVWVWZ2tTcFY0M2thVW1DZUNTVjM3N1AzVThwQnR4bVdW?=
 =?utf-8?B?OUNTZGtmaWZMaGNOV0JVL0hPSU10aXBZb1g2U3ZXeE43T2RIODF2enE0WDQr?=
 =?utf-8?B?c1NrWTR3aFJyV3ZhTExOSm54MVN0VXAyaTRUb3JvYmdva1dicEJYYVp3b2Fh?=
 =?utf-8?B?dk9oM0FtRzduQjJla0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9UdnVN?=
 =?utf-8?B?bTI1VE0vYkRka0FBVkxTbEZiSTR4QklDTk40RjkzQ0JaaUVhdlhOYnR1eWla?=
 =?utf-8?B?QUd5c2VERWo5NCtLRW8vMWFmb2FpeVV2dGEzOC8ramVhbDViKzlFRkptVnlm?=
 =?utf-8?B?Q2c9PQ==?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <0FDC9C7D8C31874F9D098726E80D1AD5@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 79010c29-d39b-4bc4-a705-08db823e4292
X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jul 2023 18:40:11.8968
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: VC4ztsW7+bPU3QLI8O8tYC/HfP2Hunv4EnHWZjTHNTM/NkM1XHi/1MPKxM25wGkZBnaItTAJRIdtjUwrllkFYJb/TZsovBJrqFTnQFCgccg=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR03MB6793
X-Proofpoint-GUID: OHCaULJYrNcLGS0BZqDwIdD4mCbQl0rG
X-Proofpoint-ORIG-GUID: OHCaULJYrNcLGS0BZqDwIdD4mCbQl0rG
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-11_10,2023-07-11_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0
 priorityscore=1501 mlxlogscore=999 lowpriorityscore=0 phishscore=0
 mlxscore=0 bulkscore=0 spamscore=0 suspectscore=0 impostorscore=0
 adultscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2305260000 definitions=main-2307110168

DQpIaSBKYW4sDQoNCkphbiBCZXVsaWNoIDxqYmV1bGljaEBzdXNlLmNvbT4gd3JpdGVzOg0KDQo+
IE9uIDExLjA3LjIwMjMgMDI6NDYsIFZvbG9keW15ciBCYWJjaHVrIHdyb3RlOg0KPj4gQWRkIHBl
ci1kb21haW4gZC0+cGNpX2xvY2sgdGhhdCBwcm90ZWN0cyBhY2Nlc3MgdG8NCj4+IGQtPnBkZXZf
bGlzdC4gUHVycG9zZSBvZiB0aGlzIGxvY2sgaXMgdG8gZ2l2ZSBndWFyYW50ZWVzIHRvIFZQQ0kg
Y29kZQ0KPj4gdGhhdCB1bmRlcmx5aW5nIHBkZXYgd2lsbCBub3QgZGlzYXBwZWFyIHVuZGVyIGZl
ZXQuIExhdGVyIGl0IHdpbGwgYWxzbw0KPj4gcHJvdGVjdCBwZGV2LT52cGNpIHN0cnVjdHVyZSBh
bmQgcGRldiBhY2Nlc3MgaW4gbW9kaWZ5X2JhcnMoKS4NCj4+IA0KPj4gU3VnZ2VzdGVkLWJ5OiBS
b2dlciBQYXUgTW9ubsOpIDxyb2dlci5wYXVAY2l0cml4LmNvbT4NCj4+IFN1Z2dlc3RlZC1ieTog
SmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPg0KPj4gU2lnbmVkLW9mZi1ieTogVm9sb2R5
bXlyIEJhYmNodWsgPHZvbG9keW15cl9iYWJjaHVrQGVwYW0uY29tPg0KPj4gDQo+PiAtLS0NCj4+
IA0KPj4gVGhpcyBwYXRjaCBzaG91bGQgYmUgcGFydCBvZiBWUENJIHNlcmllcywgYnV0IEkgYW0g
cG9zdGluZyBpdCBhcyBhDQo+PiBzaW5sZS1wYXRjaCBSRkMgdG8gZGlzY3VzcyBjaGFuZ2VzIHRv
IHg4NiBNTSBhbmQgS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
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 18:54:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561862.878443 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJIUg-0002OM-FZ; Tue, 11 Jul 2023 18:53:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561862.878443; Tue, 11 Jul 2023 18:53:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJIUg-0002OF-BT; Tue, 11 Jul 2023 18:53:50 +0000
Received: by outflank-mailman (input) for mailman id 561862;
 Tue, 11 Jul 2023 18:53:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=e9Pp=C5=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1qJIUf-0002O9-NY
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 18:53:49 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on2062f.outbound.protection.outlook.com
 [2a01:111:f400:7eaa::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 43fbb3d7-201c-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 20:53:47 +0200 (CEST)
Received: from MW4PR04CA0208.namprd04.prod.outlook.com (2603:10b6:303:86::33)
 by CH2PR12MB4280.namprd12.prod.outlook.com (2603:10b6:610:ac::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Tue, 11 Jul
 2023 18:53:44 +0000
Received: from CO1NAM11FT042.eop-nam11.prod.protection.outlook.com
 (2603:10b6:303:86:cafe::47) by MW4PR04CA0208.outlook.office365.com
 (2603:10b6:303:86::33) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32 via Frontend
 Transport; Tue, 11 Jul 2023 18:53:44 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CO1NAM11FT042.mail.protection.outlook.com (10.13.174.250) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6521.44 via Frontend Transport; Tue, 11 Jul 2023 18:53:43 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 11 Jul
 2023 13:53:42 -0500
Received: from [192.168.137.15] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Tue, 11 Jul 2023 13:53:41 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 43fbb3d7-201c-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hAxJ1AFu+fLKtlTYYczF1KEIosAnsqDhRrmT8EdXpneSo9vUtOcSHcQljsrqKJB4tNY4YD7jy09f2d7FZthTX42dzUBZie/kxAo2MqQKdQLcav7Zk4xWwPWXuS+28Cp/QxF8NYdn1fvnbBBZUGQOALCed9Ez4SQNX8VtW2CpEkCt/ielfNTYddyz4S30sSUXG3U6+KgF8u8J7IXgGfCmpNzbrUcq713Ml1THzNkdmSKuSv+P+P68+QFXhGL9xa1TgWkWkTMWh2D6T0bLYNLvFj/FFjEFuO8/GL0jUPakXHVuFzs8G8dwxnJfE5bkTFmrKlYTsGtGbLvewTmBooNNmA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4H3bOjTKZb5489DnRXo1iL//HFnO6Y4ttyhtW93iCPc=;
 b=MFHSXuOSS1NkNp0UcO1WwWVxQM9o06tS0XX2MU3JLULLEcglso11QuAqmdHN6OaHPhHjSJk1Vw9poSBIXhsgWaSxsAdoSlfVZmPNzynd5fcHgRfkwjdc0nTKZsGlszCTW+CmuN5AKK6vI2damNzyV3crPoidI7tyPXbUvAjt1sB26zg8Ncq10bLxjr+1Jd5iX9veDK9lefJ58ejghuIVR6jl/QeQj3CMFq5qPuDuU9XkAK0CkYhcso2jNtZRXk+PNGeO6T+eIxrQdnpQSJINiV0BssInK5sLNOkwl2PCcfzbFZK3JyTbkPE+zvwsHTWvNyZRfvIFdbq53UnQweD/EQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=citrix.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4H3bOjTKZb5489DnRXo1iL//HFnO6Y4ttyhtW93iCPc=;
 b=h3YhoTKRcMgkeS/cgfaXfDo9/PTdd6cmDQbmBup115H61bQAk2DEKbUP6jxeFcuuIgxvW0n2G92hZMlGCqEGXJDvcTw0Vj2NLMjuUGONCVdp3BUjWA0b+m+kz9QZd1VmElUzWLP3jzSh9VWryvJVEs1oCChEAgO1xJvb/eNr4G0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <9c152ef0-9264-4034-344d-10d535a06c13@amd.com>
Date: Tue, 11 Jul 2023 14:53:41 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [PATCH] xen/arm: pci: fix check in pci_check_bar()
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
CC: <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rahul Singh <rahul.singh@arm.com>
References: <20230711154648.729567-1-stewart.hildebrand@amd.com>
 <ZK19fKfVCH4Od6B1@MacBook-Air-de-Roger.local>
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
In-Reply-To: <ZK19fKfVCH4Od6B1@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1NAM11FT042:EE_|CH2PR12MB4280:EE_
X-MS-Office365-Filtering-Correlation-Id: 3e68123f-82f3-478b-def5-08db82402690
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	5PlRZjLSyOhKAJ1ykjFQBZ2elgidvlw1+fcHS1u5QYlVa123a9mrGtEvyO7Woaf7WR8Ji2LlEHDgwXbSU83xp936XjfC8SboZJp1HQmA9b9BmRW3rHbqFFVDYcGAelL/lfSj5qZfDZIpWGJNXhloWzdJq3BxLyrrwKM8nrjexmSRL0Vx8boAxsDzh7Ti+3GF3yD5OuaclHbi2f8WPYgeyWaacpU6VBdYVhaFTb3mgmLB18mAGiqAAz1C3YcV9QPm5Mpk1waUmLDXdtQKJOCoqewo0FUcdu9/Epi+KYZGam/UUaeVjrnzhJEmU5nY4IA3nhAoeZ2tnu5P444u4aBqKBlubs10AIrVJc4EL8XBRttPdIDiB0N69pIFMUuk0j5EkO0o2jm0pY+mHyzwoPWzqfmGl9PHkfBWn7Mne1bvoM3lpMrtcT6Li/ibbPawjmeQ4uD/DkO830L46AMEbtwgB7WfSGLE2EjFLHnmSm5dlzOOzMFnZU6C5sR8JMZhgXbGwLe5Q+f2nXrBK/AqqWlSSQ+ob5vuVE3lvhaB6Z4NDCZcTPBc95eL7IKTCGfOwteSPwlmLMiTaJTq3g0l9RqZwJKpYlMhCfVouzS1Lmo+0DIQcf5uk3VjJw483DnNgarUrARQZDBfB/7Pvhkq9OPlNnQBaHFcugJyIfckDJbuSkREKqRUNx+uBWgynXs1myGmhwznUlBWgVIJZmpMmheS5HZHImOqKhMxfQwG7YsCGRN5UcVXTKc59pncHBUrITJbJPLAeBY2d5+MwlAd1XL2rCpdL4HE9rISvhxNLAdgZw1AWztTfZWOP4R1oNDMcmQs
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(376002)(136003)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(31686004)(82310400005)(4326008)(6916009)(478600001)(36756003)(70586007)(41300700001)(16576012)(54906003)(316002)(70206006)(86362001)(31696002)(2616005)(83380400001)(53546011)(47076005)(26005)(426003)(336012)(40480700001)(186003)(82740400003)(356005)(81166007)(8936002)(2906002)(8676002)(5660300002)(40460700003)(44832011)(36860700001)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 18:53:43.7884
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 3e68123f-82f3-478b-def5-08db82402690
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1NAM11FT042.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4280

On 7/11/23 12:04, Roger Pau MonnÃ© wrote:
> On Tue, Jul 11, 2023 at 11:46:47AM -0400, Stewart Hildebrand wrote:
>> When mapping BARs for vPCI, it's valid for a BAR start address to equal the BAR
>> end address (i.e. s == e). However, pci_check_bar() currently returns false in
>> this case, which results in Xen not mapping the BAR. In this example boot log,
>> Linux has mapped the BARs, but since Xen did not map them, Linux encounters a
>> data abort and panics:
>>
>> [    2.593300] pci 0000:00:00.0: BAR 0: assigned [mem 0x50008000-0x50008fff]
>> [    2.593682] pci 0000:00:00.0: BAR 2: assigned [mem 0x50009000-0x50009fff]
>> [    2.594066] pci 0000:00:00.0: BAR 4: assigned [mem 0x5000a000-0x5000afff]
>> ...
>> [    2.810502] virtio-pci 0000:00:00.0: enabling device (0000 -> 0002)
>> (XEN) 0000:00:00.0: not mapping BAR [50008, 50008] invalid position
>> (XEN) 0000:00:00.0: not mapping BAR [50009, 50009] invalid position
>> (XEN) 0000:00:00.0: not mapping BAR [5000a, 5000a] invalid position
>> [    2.817502] virtio-pci 0000:00:00.0: virtio_pci: leaving for legacy driver
>> [    2.817853] virtio-pci 0000:00:00.0: enabling bus mastering
>> (XEN) arch/arm/traps.c:1992:d0v0 HSR=0x00000093010045 pc=0xffff8000089507d4 gva=0xffff80000c46d012 gpa=0x00000050008012
>> [    2.818397] Unable to handle kernel ttbr address size fault at virtual address ffff80000c46d012
>> ...
>>
>> Fix this by changing the condition in pci_check_bar().
>>
>> Fixes: cc80e2bab0d0 ("xen/pci: replace call to is_memory_hole to pci_check_bar")
>> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
>> ---
>>  xen/arch/arm/pci/pci-host-common.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/pci/pci-host-common.c b/xen/arch/arm/pci/pci-host-common.c
>> index 7cdfc89e5211..e0ec526f9776 100644
>> --- a/xen/arch/arm/pci/pci-host-common.c
>> +++ b/xen/arch/arm/pci/pci-host-common.c
>> @@ -406,7 +406,7 @@ bool pci_check_bar(const struct pci_dev *pdev, mfn_t start, mfn_t end)
>>          .is_valid = false
>>      };
>>
>> -    if ( s >= e )
>> +    if ( s > e )
> 
> I think you want to adjust e to include the full page, ie:
> 
> paddr_t e = mfn_to_maddr(end + 1) - 1;
> 
> As passing start == end should be assumed to cover a full page, and s
> == e won't be possible anymore.

Yes, I will do this. This will also increase the accuracy of the subsequent is_bar_valid check. Since can't add directly to a mfn_t, it will actually look like this:

paddr_t e = mfn_to_maddr(mfn_add(end, 1)) - 1;

> Adjusting the check to drop the equal is still good IMO.

Agreed, since e is still inclusive after applying your suggested math.


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 19:29:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 19:29:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561888.878452 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJJ35-000652-2j; Tue, 11 Jul 2023 19:29:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561888.878452; Tue, 11 Jul 2023 19:29:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJJ34-00064v-WF; Tue, 11 Jul 2023 19:29:23 +0000
Received: by outflank-mailman (input) for mailman id 561888;
 Tue, 11 Jul 2023 19:29:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=e9Pp=C5=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1qJJ33-00064p-UQ
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 19:29:21 +0000
Received: from NAM02-SN1-obe.outbound.protection.outlook.com
 (mail-sn1nam02on20619.outbound.protection.outlook.com
 [2a01:111:f400:7ea9::619])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3af8b399-2021-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 21:29:20 +0200 (CEST)
Received: from BN0PR03CA0048.namprd03.prod.outlook.com (2603:10b6:408:e7::23)
 by BL1PR12MB5972.namprd12.prod.outlook.com (2603:10b6:208:39b::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Tue, 11 Jul
 2023 19:29:16 +0000
Received: from BN8NAM11FT077.eop-nam11.prod.protection.outlook.com
 (2603:10b6:408:e7:cafe::a4) by BN0PR03CA0048.outlook.office365.com
 (2603:10b6:408:e7::23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32 via Frontend
 Transport; Tue, 11 Jul 2023 19:29:16 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BN8NAM11FT077.mail.protection.outlook.com (10.13.177.232) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.20 via Frontend Transport; Tue, 11 Jul 2023 19:29:16 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 11 Jul
 2023 14:29:15 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 11 Jul
 2023 14:29:03 -0500
Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Tue, 11 Jul 2023 14:29:02 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3af8b399-2021-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=SkYnv/mXBIjl1mroWrqDwgdcI8y7DFzhHNuQC7eacmDiXiwCJeawdqGC4dwlmK7DQDawG74a8T+/8V0We6KdYCzgtXQG0sMZZSrHVUAFKdrwoSr7ry2JqucHg1CGCp5aBkUgWQm4fO8E1sTiZU7UUnEvEYH9l0AxaSRW0v/uvTpa2wRBR6CJ+rI+/zSRmu46PreLzEOBVig/jvwBOJu+kHMJgH0eO4P+0B/M0w5TkcjHCfN+Mps8xS33ELLr6hr7O7Fss9oHFDwhg8x0cdgZ5obSyktCiOH0OXAwGFgFcfiF/+002Jv41wRmC/y1vEpRvC7KaL3GjSPl2FGMNNRLuw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=G4fZ5AYV++e461XBJf/ibPXTzm5SJu83StErzueTYbM=;
 b=DYu4Xajj7NjdjE0DqUZl3Rx8oke0H3d4kT2isYQ9ixgBKe1mcz4n61l1h5o9D0JUTL3Gdz7/xO3p/hkOgrbgOwywxLMUZhwQ3fhyqoAI+qMyMZyFH+qJQFryxCb3kxflEtTF2OsJNvJ0KeHODsx6fVju90ORueg3Rdy12FuAy41IEIVZlwRwGF34Cv40jfJXWAY4EPLqPIJs+GydS3LVnYaiYGrLOADsFwied/rUganhLmebxbNycOVuyLEKuIsZcEhwHIuG3YlEpGUrKou5yygntbbLfwK6hFe8rGGKoeUSkKj0x6Y4aQcxVYNd3GRz9UcMnaglPT9aX3i2/ILU3A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=G4fZ5AYV++e461XBJf/ibPXTzm5SJu83StErzueTYbM=;
 b=Aag5wmTqip065jD1gNdtJjbJ7PRp//N6Q2HLpgwx9VVcnVp7tO6xSATkRHog8nZB41jZh89ZMt6LQfx072k71wjV0PJBTWNgcyZoXcaOGn4yrHiVIwhcK+UBQJvGaly6op/cveUQmdUN6HYVQVSS7CBj5M+UdI6DpTCBNGNhF6Q=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Stewart Hildebrand <stewart.hildebrand@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rahul Singh <rahul.singh@arm.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>
Subject: [PATCH v2] xen/arm: pci: fix check in pci_check_bar()
Date: Tue, 11 Jul 2023 15:28:28 -0400
Message-ID: <20230711192829.744077-1-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN8NAM11FT077:EE_|BL1PR12MB5972:EE_
X-MS-Office365-Filtering-Correlation-Id: 0a9d66d2-8b56-495e-d2fd-08db82451d8e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	J7/46Sw5PO1TdwakgO2VDpqlQMeyX0ehOOuQbQMLKZb+A6UN1N3Aa7ZeqxOzQ3Er5SHaAz9OpUrHueIeHd66hjX3Jrr4jM9whvIgO018ebHI+cIPNtm15uRb/xhVTOf3ZLT85rf7SH+OzUS1Kh795SEt6TGgJU9KyaDt37oXPnfNksqrMULaFMioJe02K8vP95edQoMS/4sI8xPpjJB5hJf+pkNaHbrkLdLiXyDUaYYH/bWPjMh8w7y+JcHoZfVaQGJAiAEG8IGJV8Vhv8BMeOh8vYzJo8BhMfjSNKkQcGkZAthkfQGQZhPdZ3lAa7Ng9PQEU9slVaS+sIxwSd9VsBQMQw/dWwzkraCfCFWUncBIGlClSi/25r9FFKq/2koPt7y7gmrYbUCvwR/N2dfm7UTgeZrwn7iVlaGs19gaEWWSEMVPAndPdpPExGe9t69gre/w4RCth2s2Mgf8aZ2IoIyjNsjo74QtDm6Kc3xOsfoTS3j1CctJkjrVyYSzKh7UfHgTTEaWt7hZMsuzf6LFGAS85eYKpvb2awdXiLv+6KZDLq/j1k0xwK7WN+dOz2CyplTX1ZEN8c0mtuN3iysWVYYy3Bfnw2UULAK7xMUfl7yy83KBwiBL+b55B2/z8YMsiT9agnjWWz/xqa6dfTyc73+HgY/Z0nCWdz8g6AZ0SNanO1WNf6Hfom4t2n3mA9dU6FzDJbzkBSeRMilo+Bs0DhIjmJGvxsRfHyoms4eyvsJydyKVysNt0PJObwQ/LyXV8wegXI3dAruh4X483T9+zw==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(396003)(136003)(346002)(451199021)(46966006)(40470700004)(36840700001)(44832011)(86362001)(5660300002)(8936002)(8676002)(41300700001)(316002)(82310400005)(2906002)(70586007)(4326008)(70206006)(6916009)(82740400003)(81166007)(356005)(54906003)(83380400001)(6666004)(478600001)(36860700001)(26005)(186003)(2616005)(1076003)(47076005)(36756003)(40460700003)(336012)(426003)(40480700001)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 19:29:16.2842
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 0a9d66d2-8b56-495e-d2fd-08db82451d8e
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN8NAM11FT077.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5972

When mapping BARs for vPCI, it's valid for a BAR start address to equal the BAR
end address (i.e. s == e) since e is inclusive. However, pci_check_bar()
currently returns false in this case, which results in Xen not mapping the BAR.
In this example boot log, Linux has mapped the BARs, but since Xen did not map
them, Linux encounters a data abort and panics:

[    2.593300] pci 0000:00:00.0: BAR 0: assigned [mem 0x50008000-0x50008fff]
[    2.593682] pci 0000:00:00.0: BAR 2: assigned [mem 0x50009000-0x50009fff]
[    2.594066] pci 0000:00:00.0: BAR 4: assigned [mem 0x5000a000-0x5000afff]
...
[    2.810502] virtio-pci 0000:00:00.0: enabling device (0000 -> 0002)
(XEN) 0000:00:00.0: not mapping BAR [50008, 50008] invalid position
(XEN) 0000:00:00.0: not mapping BAR [50009, 50009] invalid position
(XEN) 0000:00:00.0: not mapping BAR [5000a, 5000a] invalid position
[    2.817502] virtio-pci 0000:00:00.0: virtio_pci: leaving for legacy driver
[    2.817853] virtio-pci 0000:00:00.0: enabling bus mastering
(XEN) arch/arm/traps.c:1992:d0v0 HSR=0x00000093010045 pc=0xffff8000089507d4 gva=0xffff80000c46d012 gpa=0x00000050008012
[    2.818397] Unable to handle kernel ttbr address size fault at virtual address ffff80000c46d012
...

Since e is inclusive, drop the equality check.

Also, adjust e to include the whole page. This increases the accuracy of the
subsequent is_bar_valid check.

Fixes: cc80e2bab0d0 ("xen/pci: replace call to is_memory_hole to pci_check_bar")
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
v1->v2:
* adjust e to include full page (e is still inclusive)
* add comment at the top of the function to document that end is inclusive
---
 xen/arch/arm/pci/pci-host-common.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/pci/pci-host-common.c b/xen/arch/arm/pci/pci-host-common.c
index 7cdfc89e5211..c0faf0f43675 100644
--- a/xen/arch/arm/pci/pci-host-common.c
+++ b/xen/arch/arm/pci/pci-host-common.c
@@ -393,20 +393,24 @@ static int is_bar_valid(const struct dt_device_node *dev,
     return 0;
 }
 
-/* TODO: Revisit this function when ACPI PCI passthrough support is added. */
+/*
+ * The MFN range [start, end] is inclusive.
+ *
+ * TODO: Revisit this function when ACPI PCI passthrough support is added.
+ */
 bool pci_check_bar(const struct pci_dev *pdev, mfn_t start, mfn_t end)
 {
     int ret;
     const struct dt_device_node *dt_node;
     paddr_t s = mfn_to_maddr(start);
-    paddr_t e = mfn_to_maddr(end);
+    paddr_t e = mfn_to_maddr(mfn_add(end, 1)) - 1; /* inclusive */
     struct pdev_bar_check bar_data =  {
         .start = s,
         .end = e,
         .is_valid = false
     };
 
-    if ( s >= e )
+    if ( s > e )
         return false;
 
     dt_node = pci_find_host_bridge_node(pdev);

base-commit: b831326ee2f9ed94523b3d8b0fb2da2a82113e9e
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 11 20:22:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 20:22:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561893.878463 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJJrv-00041M-0U; Tue, 11 Jul 2023 20:21:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561893.878463; Tue, 11 Jul 2023 20:21:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJJru-00041F-Ss; Tue, 11 Jul 2023 20:21:54 +0000
Received: by outflank-mailman (input) for mailman id 561893;
 Tue, 11 Jul 2023 20:21:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Y2eC=C5=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qJJrs-000419-SH
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 20:21:53 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 918493c9-2028-11ee-b239-6b7b168915f2;
 Tue, 11 Jul 2023 22:21:51 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 4BC54615DD;
 Tue, 11 Jul 2023 20:21:50 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B41FC433C8;
 Tue, 11 Jul 2023 20:21:48 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 918493c9-2028-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689106909;
	bh=s5cOSymdjcLQwXjedQSQ4b1V0Qqbv9IUkI9Uizo+ch8=;
	h=From:To:Cc:Subject:Date:From;
	b=nDwxLhL46DE0Ve3L1akBgukj4QROHHZjTLpma/qddHwhqCHxerYWCuFpoSpF2D1+/
	 maKToYmTehb+RTvOlynBSvJgRnNhJ7LbPMD6usjWLvNqgt8aAixDYE/n8gOJ/bhrmd
	 r71wAdACvizaBFBXSZ3q4cHXOY23tyf2ZuWE9VWNonXjtoKspQ/g4j+TwLWIhmdTz2
	 FhVY/1uSQWXeqc34qSa6+bJUtxWinSE+W/6SP7TI5KmniT/u8kynghc421NqfVvb9a
	 goOFrCjqExgL0f0kixNAA1iKce2dxF9bJ49WTKbN1iFql8XAMqsyrxlPKmnlQ3uXK/
	 Nq7h90O9bmAmg==
From: Stefano Stabellini <sstabellini@kernel.org>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	julien@xen.org,
	sstabellini@kernel.org,
	george.dunlap@citrix.com,
	bertrand.marquis@arm.com,
	Stefano Stabellini <stefano.stabellini@amd.com>
Subject: [PATCH] docs/misra: add Rule 9.3
Date: Tue, 11 Jul 2023 13:21:45 -0700
Message-Id: <20230711202145.2334563-1-sstabellini@kernel.org>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Stefano Stabellini <stefano.stabellini@amd.com>

Specify that {} is allowed for zero-initialization.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
 docs/misra/rules.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 72aa986bce..29a777938a 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -284,6 +284,11 @@ maintainers if you want to suggest a change.
        braces
      -
 
+   * - `Rule 9.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_09_03.c>`_
+     - Required
+     - Arrays shall not be partially initialized
+     - {} is also allowed to specify explicit zero-initialization
+
    * - `Rule 9.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_09_04.c>`_
      - Required
      - An element of an object shall not be initialized more than once
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 11 20:22:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 20:22:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561894.878473 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJJs5-0004Hl-9M; Tue, 11 Jul 2023 20:22:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561894.878473; Tue, 11 Jul 2023 20:22:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJJs5-0004He-6E; Tue, 11 Jul 2023 20:22:05 +0000
Received: by outflank-mailman (input) for mailman id 561894;
 Tue, 11 Jul 2023 20:22:04 +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
 <SRS0=Y2eC=C5=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qJJs4-0004HQ-E8
 for xen-devel@lists.xenproject.org; Tue, 11 Jul 2023 20:22:04 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 97094129-2028-11ee-8611-37d641c3527e;
 Tue, 11 Jul 2023 22:22:01 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id AF209615DD;
 Tue, 11 Jul 2023 20:21:59 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id C19C0C433C7;
 Tue, 11 Jul 2023 20:21:57 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 97094129-2028-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689106919;
	bh=r4KvtknxjEgU9877fnlBP56JiN2iE8RjT2N8EO/YIqQ=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=mdnASDEyKyvoKXrvCillevUmEXwUNfqcghzUlhdUKKbq7wSGoGkc6wFdy5Mf9D6dV
	 kvwwSyjeyVwTZz+AkdL6P5LZt/PoZIa3p6b6X1HKdGV3Dxk1q20HznQY6D2XXDkJYl
	 tHoKjawEyHCbhxdlC7Ty7fG94+AxaFFuUvZ56XGOCGnI/pLdVbGr9qF2wX61ANLDx0
	 zvGizsEgDkqgP+49xguK68XnIyHUxuwsW4xcdVfYeN6BSZKAigJvwbGy/OX70tT52x
	 SBqhFpYrXX/cAXquZ84sl7HhmMFjRXKxw8RFHNDtE6ctWADKV9uciB0bxPyinjbib0
	 G4ZFL3Vpt38fA==
Date: Tue, 11 Jul 2023 13:21:56 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Luca Fancellu <Luca.Fancellu@arm.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    Xen-devel <xen-devel@lists.xenproject.org>, 
    Jan Beulich <jbeulich@suse.com>, 
    "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>, 
    "roger.pau@citrix.com" <roger.pau@citrix.com>, 
    "julien@xen.org" <julien@xen.org>, 
    "george.dunlap@citrix.com" <george.dunlap@citrix.com>, 
    Bertrand Marquis <Bertrand.Marquis@arm.com>, 
    Stefano Stabellini <stefano.stabellini@amd.com>
Subject: Re: [PATCH v2] docs/misra: add Rule 7.4 and 9.4
In-Reply-To: <C67A4472-E79B-4902-879D-29E3E86D6305@arm.com>
Message-ID: <alpine.DEB.2.22.394.2307111314170.761183@ubuntu-linux-20-04-desktop>
References: <20230710202835.2052428-1-sstabellini@kernel.org> <C67A4472-E79B-4902-879D-29E3E86D6305@arm.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; BOUNDARY="8323329-1302662958-1689106469=:761183"
Content-ID: <alpine.DEB.2.22.394.2307111321520.761183@ubuntu-linux-20-04-desktop>

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-1302662958-1689106469=:761183
Content-Type: text/plain; CHARSET=UTF-8
Content-Transfer-Encoding: 8BIT
Content-ID: <alpine.DEB.2.22.394.2307111321521.761183@ubuntu-linux-20-04-desktop>

On Tue, 11 Jul 2023, Luca Fancellu wrote:
> > On 10 Jul 2023, at 21:28, Stefano Stabellini <sstabellini@kernel.org> wrote:
> > 
> > From: Stefano Stabellini <stefano.stabellini@amd.com>
> > 
> > Rule 9.4 is non-controversial and we have no violations.
> > 
> > Rule 7.4 is considered a good idea with the caveat that assigning a
> > string literal to const void is allowed. I added a note to specify it.
> > 
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
> > ---
> > Changes in v2:
> > - improve rule 7.4 note
> > ---
> > docs/misra/rules.rst | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> > 
> > diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
> > index 622f35410c..67ee8c029e 100644
> > --- a/docs/misra/rules.rst
> > +++ b/docs/misra/rules.rst
> > @@ -203,6 +203,15 @@ maintainers if you want to suggest a change.
> >      - The lowercase character l shall not be used in a literal suffix
> >      -
> > 
> > +   * - `Rule 7.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_07_04.c>`_
> > +     - Required
> > +     - A string literal shall not be assigned to an object unless the
> > +       objects type is pointer to const-qualified char
> 
> NIT: Should it be s/objects/object/ ?
> 
> > +     - All "character types" are permitted, as long as the string
> > +       element type and the character type match. (There should be no
> > +       casts.) Assigning a string literal to any object with type
> > +       "pointer to const-qualified void" is allowed.
> > +
> >    * - `Rule 8.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_08_01.c>`_
> >      - Required
> >      - Types shall be explicitly specified
> > @@ -275,6 +284,11 @@ maintainers if you want to suggest a change.
> >        braces
> >      -
> > 
> > +   * - `Rule 9.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_09_04.c>`_
> > +     - Required
> > +     - An element of an object shall not be initialized more than once
> > +     -
> > +
> >    * - `Rule 12.5 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_12_05.c>`_
> >      - Mandatory
> >      - The sizeof operator shall not have an operand which is a function
> > -- 
> > 2.25.1
> > 
> > 
> 
> Apart from that, Iâ€™ve used the file with our script to import the rules and it worked.
> 
> Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
 
Thanks! I fixed the typo on commit
--8323329-1302662958-1689106469=:761183--


From xen-devel-bounces@lists.xenproject.org Tue Jul 11 21:00:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 21:00:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561902.878483 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJKT6-0000Zc-5e; Tue, 11 Jul 2023 21:00:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561902.878483; Tue, 11 Jul 2023 21:00:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJKT6-0000ZV-1O; Tue, 11 Jul 2023 21:00:20 +0000
Received: by outflank-mailman (input) for mailman id 561902;
 Tue, 11 Jul 2023 21:00:18 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJKT4-0000ZL-K3; Tue, 11 Jul 2023 21:00:18 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJKT4-0002He-GZ; Tue, 11 Jul 2023 21:00:18 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJKT4-0003M1-8i; Tue, 11 Jul 2023 21:00:18 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJKT4-0004l2-8G; Tue, 11 Jul 2023 21:00:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=WbgtHCnRALFu/VbWNyJt/qZni+jvufkHUf5rbEl5aSw=; b=CpMLiA6ge/MmMAJBiHHkcbv8cs
	znIfgmYjvj/KlG3fasrQweLlQKSYfpOzpEv24C7HgHKb3Bo5uust+vyJ9bnC2vFu5YNQEJbQ7Duv+
	rd2kLw+Og3JfgE9eLT++wp90Y88kvdU65No48rACzmVpr7LBaZyKhXbLaT1kmlfOs+R0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181763-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181763: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-pair:xen-install/src_host:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    xen-unstable:test-amd64-i386-xl-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-amd64-i386-pair:xen-install/dst_host:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=b831326ee2f9ed94523b3d8b0fb2da2a82113e9e
X-Osstest-Versions-That:
    xen=b831326ee2f9ed94523b3d8b0fb2da2a82113e9e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 11 Jul 2023 21:00:18 +0000

flight 181763 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181763/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-pair         10 xen-install/src_host       fail pass in 181756
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 181756
 test-amd64-i386-xl-vhd       21 guest-start/debian.repeat  fail pass in 181756

Tests which did not succeed, but are not blocking:
 test-amd64-i386-pair         11 xen-install/dst_host         fail  like 181756
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181756
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181756
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181756
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181756
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181756
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181756
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181756
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181756
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181756
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181756
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181756
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181756
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass

version targeted for testing:
 xen                  b831326ee2f9ed94523b3d8b0fb2da2a82113e9e
baseline version:
 xen                  b831326ee2f9ed94523b3d8b0fb2da2a82113e9e

Last test of basis   181763  2023-07-11 09:44:15 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Tue Jul 11 23:25:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Jul 2023 23:25:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561918.878493 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJMje-0006FB-VA; Tue, 11 Jul 2023 23:25:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561918.878493; Tue, 11 Jul 2023 23:25:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJMje-0006F4-Rn; Tue, 11 Jul 2023 23:25:34 +0000
Received: by outflank-mailman (input) for mailman id 561918;
 Tue, 11 Jul 2023 23:25:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJMjd-0006Eu-Iu; Tue, 11 Jul 2023 23:25:33 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJMjd-0005V1-Ff; Tue, 11 Jul 2023 23:25:33 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJMjd-0006g0-3y; Tue, 11 Jul 2023 23:25:33 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJMjd-0000F2-3V; Tue, 11 Jul 2023 23:25:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=gMnjZwv/hwGsLKqYT/+lkChdNGlT4ryY8xvNAVhEMgc=; b=UhCg0D6gd+z3KhJk5H7Pepw/k1
	4PJoZxtabT/nA4D6byyRbOYYZT6wRq3PPh2+7LsabaZ5Y7zcT2r+InDD6BbRITcWlprAgFbLij39f
	VzuNLresukG3rd0w535nFI5XpLvcvd+2Dyba64d41z/iPvPv88d+9FwIX2RHNAt38oec=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181766-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181766: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=3c911be55f1c4e0063e690fb61223df21511b5bb
X-Osstest-Versions-That:
    xen=b831326ee2f9ed94523b3d8b0fb2da2a82113e9e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 11 Jul 2023 23:25:33 +0000

flight 181766 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181766/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  3c911be55f1c4e0063e690fb61223df21511b5bb
baseline version:
 xen                  b831326ee2f9ed94523b3d8b0fb2da2a82113e9e

Last test of basis   181754  2023-07-10 17:02:02 Z    1 days
Testing same since   181766  2023-07-11 21:02:08 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Federico Serafini <federico.serafini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Roberto Bagnara <roberto.bagnara@bugseng.com>
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   b831326ee2..3c911be55f  3c911be55f1c4e0063e690fb61223df21511b5bb -> smoke


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 02:53:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 02:53:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561942.878503 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJPyx-0001wP-Fg; Wed, 12 Jul 2023 02:53:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561942.878503; Wed, 12 Jul 2023 02:53:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJPyx-0001wF-Ai; Wed, 12 Jul 2023 02:53:35 +0000
Received: by outflank-mailman (input) for mailman id 561942;
 Wed, 12 Jul 2023 02:53:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJPyv-0001w1-Ty; Wed, 12 Jul 2023 02:53:33 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJPyv-00013V-Qq; Wed, 12 Jul 2023 02:53:33 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJPyv-00080D-Fq; Wed, 12 Jul 2023 02:53:33 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJPyv-0002kl-FL; Wed, 12 Jul 2023 02:53:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=XxH8DOjeG82GAcLiPLiWq0UFpzC4C91xl16tUv3xRNo=; b=DkqhsfwNgtyqtiy+Eu9P5dB/2P
	pCEcsSvNFdmVrYfEFL3NIB0FbekyNiGlXdxbNroORweE/yAyR12d0EmWPGeleIEvP40c017EN7cCb
	h4XUgZrqoogccBp5ZsY31A1o9OUXC5BGeKeiIKcnzUov1EHBmaxrXjFyz3S3BLHdf8rQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181765-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181765: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-shadow:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-pygrub:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:guest-start/debianhvm.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-rtds:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:guest-start/debianhvm.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:guest-saverestore.2:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-credit1:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:guest-localmigrate:fail:heisenbug
    linux-linus:test-amd64-amd64-dom0pvh-xl-amd:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-freebsd11-amd64:guest-start/freebsd.repeat:fail:heisenbug
    linux-linus:test-arm64-arm64-xl-credit2:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=3f01e9fed8454dcd89727016c3e5b2fbb8f8e50c
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 12 Jul 2023 02:53:33 +0000

flight 181765 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181765/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-freebsd11-amd64 19 guest-localmigrate/x10 fail in 181755 pass in 181765
 test-amd64-amd64-xl-shadow 22 guest-start/debian.repeat fail in 181755 pass in 181765
 test-amd64-amd64-pygrub 19 guest-localmigrate/x10 fail in 181755 pass in 181765
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 20 guest-start/debianhvm.repeat fail in 181761 pass in 181755
 test-amd64-amd64-xl-rtds 22 guest-start/debian.repeat fail in 181761 pass in 181765
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 20 guest-start/debianhvm.repeat fail in 181761 pass in 181765
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 18 guest-localmigrate/x10 fail pass in 181755
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 17 guest-saverestore.2 fail pass in 181761
 test-amd64-amd64-xl-credit1  20 guest-localmigrate/x10     fail pass in 181761
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 16 guest-localmigrate fail pass in 181761
 test-amd64-amd64-dom0pvh-xl-amd 22 guest-start/debian.repeat fail pass in 181761
 test-amd64-amd64-freebsd11-amd64 21 guest-start/freebsd.repeat fail pass in 181761
 test-arm64-arm64-xl-credit2  18 guest-start/debian.repeat  fail pass in 181761
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 18 guest-localmigrate/x10 fail pass in 181761

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                3f01e9fed8454dcd89727016c3e5b2fbb8f8e50c
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   86 days
Failing since        180281  2023-04-17 06:24:36 Z   85 days  171 attempts
Testing same since   181755  2023-07-10 17:42:07 Z    1 days    3 attempts

------------------------------------------------------------
3736 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              fail    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  fail    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 622011 lines long.)


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 07:01:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 07:01:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561960.878513 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJTqf-0002kk-Py; Wed, 12 Jul 2023 07:01:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561960.878513; Wed, 12 Jul 2023 07:01:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJTqf-0002kd-NB; Wed, 12 Jul 2023 07:01:17 +0000
Received: by outflank-mailman (input) for mailman id 561960;
 Wed, 12 Jul 2023 07:01:17 +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
 <SRS0=gKGC=C6=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1qJTqf-0002kX-4p
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 07:01:17 +0000
Received: from NAM12-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam12on20603.outbound.protection.outlook.com
 [2a01:111:f400:fe5a::603])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e397729f-2081-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 09:01:13 +0200 (CEST)
Received: from BN9PR03CA0594.namprd03.prod.outlook.com (2603:10b6:408:10d::29)
 by PH8PR12MB7448.namprd12.prod.outlook.com (2603:10b6:510:214::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Wed, 12 Jul
 2023 07:01:10 +0000
Received: from BN8NAM11FT102.eop-nam11.prod.protection.outlook.com
 (2603:10b6:408:10d:cafe::e2) by BN9PR03CA0594.outlook.office365.com
 (2603:10b6:408:10d::29) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.22 via Frontend
 Transport; Wed, 12 Jul 2023 07:01:09 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BN8NAM11FT102.mail.protection.outlook.com (10.13.177.27) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.20 via Frontend Transport; Wed, 12 Jul 2023 07:01:09 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 12 Jul
 2023 02:01:08 -0500
Received: from [10.71.193.39] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Wed, 12 Jul 2023 02:01:07 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e397729f-2081-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=HGitMiXkQpr+6WMzuHAZc3X9whUKLFGZ8nydRTbfPDBRenppNQQuzCtPmOKtmtWfEE0YXeXvmy3rpwW49AcpxUtOq7X7euWzEHg1rPpmViMjjAnYuXvzmXfycBlgVIhHZ88Zgi0qCE2F9+0cX+wZG/WRMUb6pAbITg80dpD4IXpf6Pn7PTtEOlxsDo9epjJPPJqN8d7V7O3E3bZXpIPzIA50uaNPpT+rUijQTbvkicjgFsF8z0hsaKYfBmdowCfRqgY1R7ZFv8ojwZEIl9RSzN8DqL7baWL6v5IzTI/smaqaKX2GswaHTwDqa7yW0TNPYse5/+bLun0DoF7wcaYyJg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=NHHZezyovWasCDgNKi6aRPkoRqWOzpdBcBdB+sV3az0=;
 b=lTVs1u6KDoysGajyoGuhLQbkBbCib6+IMZ3/we2ccymKO+dWbiOWaKkYQ6hfA+VZ6Ru4ux1sjhTAi52GCnwtHgwf33tTOB0FVuBhAyBJb/7/I6WMUIHanJEN66kRFpkHo+Wer8FMq9H+BFtL8gyyk7jol6sps8v/2kSI2WlI1bOjjwo53k2pCw/Q9TWPPmZEUteo+L/vZWHBeoCVIhzOg8ZYMMy4pgr3BZTzVYOUR+d5X8F+Okoa5MR30Qd/rrJM5AmVfGjLr3rKRPpNPF9UBFrrxee6+W0bJ8L/7F18pWAAo4UcJ/edUSD3OjqzgFECbeQgDLjanK4aDHM4xfSCFw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=NHHZezyovWasCDgNKi6aRPkoRqWOzpdBcBdB+sV3az0=;
 b=Axl4VRBs7ND7n0yQFdwr28hoVlJUosqDhdaKJhIYf+cQUo466m45WvAI2FMsWZGs58P9aEZRA4oS/NtEiR4T66idYyGEMaU3f2whSFOCHvxdOr1XwUrYL1fJglC74erJhNlEnFmcVPA2a1i+NIUOCkpCoWm2veEcAWFfG+7tY8Y=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <b39b19a4-9649-173b-bb05-518702d05873@amd.com>
Date: Wed, 12 Jul 2023 09:01:07 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 2/2] xen/arm: Account for domU dtb bootmodule size
 separately
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230711082931.5402-1-michal.orzel@amd.com>
 <20230711082931.5402-3-michal.orzel@amd.com>
 <8bc1ed0e-3ad6-2243-4dd6-a88dd0ee00f8@xen.org>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <8bc1ed0e-3ad6-2243-4dd6-a88dd0ee00f8@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN8NAM11FT102:EE_|PH8PR12MB7448:EE_
X-MS-Office365-Filtering-Correlation-Id: cdc82743-4116-43b1-d913-08db82a5c570
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	iraFMMky+TKr0uKnS7fcUyDD9k5HTd9kn+ZEYauySURooJlAw83BqWsyq8ChWZwzDytTY/i8hJWNDe3FalMqW0XO79CMUdyQhHd1u8XvGxXai7uF7FT6Rjv+OqIExC0I1F2bpPlczQfYf6+ICFbKq3WSl+NZpsDDZnouT9jkiK8Mg2VjPK+q5UNJQ550wYtE1QPYTWlY4hbmW9iiZrMG/E+i91/7YNyvFgi6OeYFPFUQRaVBH+dJm4zIGt+j/WUvWxV9Fqpz8nnBEf/PDFdHCD+v5bxSWaYGOpQ0czzwxdNk3KFVUS3v1QKbX3pEzm1i+gtocyKiBdvcD/Rr5MxOmHOTzR8fCfNn+gcMvyaiZqlGPJzln0jbXgEROSbvMDMz8EpSozwBdgtpoIbj0PQ46MZcU7uxL5VXCBdYtV6B+GgtjsjP+nN/J0AVRSGXI1lnAoCv5ecvqG4qmcsprmmwQmFKMvHfQOxadO4JX/Y6lv/+YOxrQW6L/MShYkn8pZIGSKBnwvoIYKr2YifZoTj/EbavGrjnnpFbAJTeVTSkaQjn9KJAYt6mHHBW49G++pDHx9CNLpCj5AJ8nTufbhpPdLt3iJ3bmZVbWY5pXEhLVjCLCYlPwTluKdOtjI79XdFohz4Hl1gQBDc+GoRoH4fbotBuNb0ZQbFj3F3v4csSiJarSUcn8ZqVhP613QGHnEhkXiRb3rLvCe75CGcMotGHF70aQKy00UDpDte8yv2/lA7cntJi/qxJfQH1xPUUVIdiH67w9fDYpuVGQTDWHK5UfLkz0m4csa8wPKLactLKV8RGmM2fXSaQbBLQEeBvN/C7
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(346002)(396003)(39860400002)(451199021)(46966006)(36840700001)(40470700004)(40460700003)(82740400003)(81166007)(478600001)(110136005)(16576012)(54906003)(356005)(5660300002)(8676002)(36756003)(2906002)(86362001)(15650500001)(8936002)(82310400005)(44832011)(4326008)(316002)(70206006)(40480700001)(70586007)(41300700001)(36860700001)(26005)(53546011)(31696002)(336012)(426003)(47076005)(31686004)(83380400001)(186003)(2616005)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 07:01:09.6310
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: cdc82743-4116-43b1-d913-08db82a5c570
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN8NAM11FT102.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7448

Hi Julien,

On 11/07/2023 18:07, Julien Grall wrote:
> 
> 
> Hi Michal,
> 
> On 11/07/2023 09:29, Michal Orzel wrote:
>> At the moment, we limit the allocation size when creating a domU dtb to
>> 4KB, which is not enough when using a passthrough dtb with several nodes.
>> Improve the handling by accounting for a dtb bootmodule (if present)
>> size separately, while keeping 4KB for the Xen generated nodes (still
>> plenty of space for new nodes). Also, cap the allocation size to 2MB,
>> which is the max dtb size allowed.
>>
>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
>> ---
>> Note for the future:
>> As discussed with Julien, really the best way would be to generate dtb directly
>> in the guest memory, where no allocation would be necessary. This of course
>> requires some rework. The solution in this patch is good enough for now and
>> can be treated as an intermediated step to support dtb creation of various
>> sizes.
> 
> Thanks for summarizing our discussion :).
> 
>> ---
>>   xen/arch/arm/domain_build.c | 18 +++++++++++++-----
>>   1 file changed, 13 insertions(+), 5 deletions(-)
>>
>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>> index f2134f24b971..1dc0eca37bd6 100644
>> --- a/xen/arch/arm/domain_build.c
>> +++ b/xen/arch/arm/domain_build.c
>> @@ -3257,14 +3257,15 @@ static int __init domain_handle_dtb_bootmodule(struct domain *d,
>>   }
>>
>>   /*
>> - * The max size for DT is 2MB. However, the generated DT is small, 4KB
>> - * are enough for now, but we might have to increase it in the future.
>> + * The max size for DT is 2MB. However, the generated DT is small (not including
>> + * domU passthrough DT nodes whose size we account separately), 4KB are enough
>> + * for now, but we might have to increase it in the future.
>>    */
>>   #define DOMU_DTB_SIZE 4096
>>   static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
>>   {
>>       int addrcells, sizecells;
>> -    int ret;
>> +    int ret, fdt_size = DOMU_DTB_SIZE;
> 
> Can fdt_size be unsigned?
I used int because by looking at all the fdt_create() calls in our codebase
we seem to use int and not unsigned. Also, I used min() that does strict type checking
and SZ_2M is int. So if you want, I can use unsigned int but will also have to use
MIN() macro instead not to do type checking (I cannot use MB(2) as it has ULL type
and do not want to use min() with cast).

Also, are you OK with the rest of the code?

~Michal



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 07:13:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 07:13:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561969.878523 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJU22-0004Ph-1M; Wed, 12 Jul 2023 07:13:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561969.878523; Wed, 12 Jul 2023 07:13:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJU21-0004Pa-Uc; Wed, 12 Jul 2023 07:13:01 +0000
Received: by outflank-mailman (input) for mailman id 561969;
 Wed, 12 Jul 2023 07:13:01 +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
 <SRS0=65J3=C6=citrix.com=prvs=55084c2ea=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qJU20-0004PR-SZ
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 07:13:01 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 86848a48-2083-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 09:12:57 +0200 (CEST)
Received: from mail-mw2nam12lp2040.outbound.protection.outlook.com (HELO
 NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.40])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 12 Jul 2023 03:12:50 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SA2PR03MB5707.namprd03.prod.outlook.com (2603:10b6:806:11f::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 07:12:43 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2%5]) with mapi id 15.20.6565.028; Wed, 12 Jul 2023
 07:12:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 86848a48-2083-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689145978;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=gDtEYOIVKkNM8DHlF4QgEvQxuEse3ErTQWeE7PHdo8Y=;
  b=McreOtAznpcX1P7rcD1/LqwAEW0dDUutz3ofa7Tj3sQRNrWchql5C/3h
   2BVpxu9aX0Bu96bi/kCGSaWGKG9BG8PlgwTKQimfrnCcg8I+7nWAnLGm+
   1OUxzA0oP/JcoCv4cpOGDiAJyXYNz3lBLuFmJF/eKtG0k4vv7kHugljrA
   k=;
X-IronPort-RemoteIP: 104.47.66.40
X-IronPort-MID: 118506904
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:gOaWLKr7Cr4n2BYd6t8WEIiBLWJeBmKPZBIvgKrLsJaIsI4StFCzt
 garIBnTb6mJMDD9et50bIy0pEtU7JTcytRkQAA4qiswECIS9puZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weBziNNVvrzGInqR5fGatgMdgKFb
 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo
 OihgLTr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n4UOEgEHkvdfySFsBeox8bLpiA0PkAncbzZVBOe
 NwriekXqNsfFH9dfHGlp/1vxIDrDv5nZNtq59Js5UVa/pqVFZrl/1TwKpkKuZKIMuz0vFSLA
 BQNrCX2B93SyLVU5mLhBgv/DXrZAVxIj62BnEYvMqbyj5Xm2084Xc56aUk7yo93aN4coJD4e
 vcNKRuifVpde85KYxAJMppe7rsNoXie2O6DF6v
X-Talos-CUID: =?us-ascii?q?9a23=3ANF+hf2nq39sRVkWzWMR9yYkGvSXXOSKe7lXsMn+?=
 =?us-ascii?q?VMzZwc+SuVECC9f9m0OM7zg=3D=3D?=
X-Talos-MUID: =?us-ascii?q?9a23=3AqGm/Rg0JtnoquG64Gih81zyj2DUjzZv3CRFd1rA?=
 =?us-ascii?q?9vfLYci1TFwqm1Xfra9py?=
X-IronPort-AV: E=Sophos;i="6.01,199,1684814400"; 
   d="scan'208";a="118506904"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=FsLsnH6LWQajf5iCXiSDyZvxfrQGNAGBZ3N02ejzqGcbqKkwmuW5qiYUVyRw2fPWrnkRv/PLffdXVt6JrxOJvhVHUH3N7jruYmELb28E2CulcbfeMhm1Eea2B+N7pgVVkjQrLaWvkTdr8w4YbBrzt0kat2vuFRZPEx10fIhJJiueeCyxNBPfyM8sFSYqrb3aQ34qFzH90xcCQtUNyazhY99UQegd8F/uy7CiA+yNKj4DB8gITckYT2/RdDcQjGW93KpEvP8MNLwZWs8zd4nMSswnDxwrevlClOp5YDqYCJY1XDXorhrQF3o2IMV+bM9lwPAvQRyHrAo0VyxgpWdG/Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=iZDuUCeOei3et9f1Pwy3Ob68Ck5ILt6WMR/7aoeuyHo=;
 b=YpNvcyPVTwikOoRZIBe24xpZHfmKC1tcV5Us6koetV2wuLG4vvImVZxjrQdCYNwut/H5F3cfn4xXSt7yaYk9gD/An/jYfw6zH27eAIC+dy7Fv5guNiyJT+f9t51JYwjnlld+RILq3fhfOGr0vslT7WDY1wHg5w8p3hX7rMEkSegzBMkjV0PUb22wuJoLgvaw0IsF3wyMDDpDXhH0rln4sYGkLqV3G83ePqf8oBY+5r0UD84Vxc5gaNujvWp/9K4gKRs+uTjzR93Kd9c7Rhv5NOktURuInE3dZrXwPefE909XlZmDYLtV04aYb5SYu+Xe3yy9jUeQuM2aNtwMpi57eA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=iZDuUCeOei3et9f1Pwy3Ob68Ck5ILt6WMR/7aoeuyHo=;
 b=xMucyxNMjGdn5XjcKq4K1l4eaPKy2qzitknvuE5GabuIeJ+OXXof4B3tVMaikxG2tCb5ZQf68Ye2cooNcNU/ipXxfu+05bwsXxQMrE9Octjq46YRw9NgG4trE1MVUbE8bINgXsX0SlLk4Q9mRTQ10GrWFoHVaIVBN+EpbOfQylI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Wed, 12 Jul 2023 09:12:36 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rahul Singh <rahul.singh@arm.com>
Subject: Re: [PATCH v2] xen/arm: pci: fix check in pci_check_bar()
Message-ID: <ZK5SZGLBDGWFvo9m@MacBook-Air-de-Roger.local>
References: <20230711192829.744077-1-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230711192829.744077-1-stewart.hildebrand@amd.com>
X-ClientProxiedBy: LO4P123CA0238.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a7::9) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA2PR03MB5707:EE_
X-MS-Office365-Filtering-Correlation-Id: bdb414be-7f1f-4de2-628e-08db82a7628b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	RnicJqbqKFbD7zHr7x0R9tCd1vHSE/lPDG2z5gi5WfpImT9RtPPDsfcgIoUbmcRSb7Lr9QPMDc979tpM08salEfM4HiXqGTgrWgwzU9b1HVBH1Q+4RMIz9jjYwwgmUDFjMSvbQtAzi/zNj9UWry4xJVQRdrSjJEo0m55L5Aog/xLXMLxJ6zmYrL10vrMu4lL+IkA/pk17WhVe4hYQQg5sneK0S+rVBMEmUIL9sbh9ioNgi8A5iWOljixO3tMoLd6hFuJ5slUKdir0WFPVnaFDe8e8jDuzhTnhPtxIdvhpRl1dOuYzdD87fuHFGYQlC11aLiIUfweKkJ6sk3U0aRqqNoAtR5YgFAhATI2EGMFcCXkwcEyZTlvT24D2A/bdum4BkQfjEKqBhdXNp+xXcqunnyayjDi37+l27ffl6R7b+ay3D5VnMpy4P7mF6HHv4x5arwAoFCpHpmjJzyDIp8rGVtZIJgL5Xevd4jFbqZJaQ47VqGJ4ptBzNDQphG/h9QglQ0iv91vFoX/LghU6FfKxMKXGD+NRvx7F5CpnTyXiT7/qR1tp7emAfBzNS7AET1S
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(366004)(376002)(39860400002)(136003)(451199021)(41300700001)(8676002)(8936002)(6512007)(316002)(478600001)(54906003)(4326008)(6486002)(6916009)(66556008)(66476007)(66946007)(83380400001)(6506007)(9686003)(6666004)(38100700002)(82960400001)(86362001)(85182001)(5660300002)(26005)(2906002)(186003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cC9peUJzT2JpOTFCUzhTeFdVSUNHc29Rell4YXJBZ1hlOFNKSnVxUlhFVTB0?=
 =?utf-8?B?bFNtOFVBOXIrdjJzd25tY0RDUlZvQ2k1SzhVYS9qaXlsT1RIYUxpR1dSRXdu?=
 =?utf-8?B?V3A2TGw2VGtvTnROVFZ3a0hQOVMxcWgvMmV5MTVzYjFaSFBjYndMQnlWdTM1?=
 =?utf-8?B?OEVnenYrVi8vYkxEdmNiNUNhS1ViVjlJbXg4R3NiY0RYZzhOdE1VNmRpc2R5?=
 =?utf-8?B?cHV2bnAyTXFPbVNjVHMvd3RzZU1jTUhGUS9FWVY2Yy9wVnpGTVVBbnNzYUFU?=
 =?utf-8?B?eTlqQllpOWtSUXdIRjk2ZXRiRjUxN2dnYWhtS1VXMGhMeURQS2pNN3Q0Rll0?=
 =?utf-8?B?eVhiYXN6Tyt2dWluTUwrMlpwVTJTYXQrYS81QmJDeDhVeDlBZjZoczhEQzZI?=
 =?utf-8?B?OUNRNmRFbGkvWVMwek0vaEhjUDlER1FDaXZaRXZvVzdoREx3Sk9vdXNEZ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ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	Az3di03d3l6pooRX/AurW1f7vnL+nX0ISvTy3u4/emLv0fIe/XocihG3MVc8JdpWM/I4dgXIxQ7KJpJ+gJ8PJ53KpANPrJO3rWFM11ZUzWXNeM3M2jxuvlMcL8RGokT2D2qSwX+hTpbqzwzdVHBzlIc+0lTnB63AfdC/MumGiYryVMMpbrwggR4w+0CqSGy3vE4o+5d+lDXeMyNKv0kvagk50tYUSZ2ullYntVjLllq6NC3HsOs393L4UDjTwcrcNkmfsHDvUahFAm49bQxrJiAXuPRMqcwv0u6Ib+zjfANM81lo2nWdRCd07WqQ3KzqoTd3BRvnNziEWK/9KqdR7zEBH40xaLU1nC60BJJvZiN1cg3OUkJCFOpHMuAQ4jylsjVf/XVnoDYLy3sdSY+BPDobviIb+6JqcYnXCkdxat84CYMO3r36U7/c3ZogMYHNplu8ZD2Jh9ttDCV+mQO4uN1nD4K4o3gps7qdc6zUbn6CoEd9S6dvoKkYw1yqu+CidoW+r8oF5UhlQeAWOviksQeNvBIQX2wvA2cFNa/xKmjuIoEXAp5qvMbNjJMcs0ME/MckF/HfFd6v1Mxhq3jYV9YyalQwt2vkfQWqU30RiZh7ac3R3hs0VT6M1/E48QUIjfDo5Rnz0SGjorYuTVnmxsPz/VcOtf048ELnnbL1UJ1Il0mQ2pYPrQkI717zmu5VfdY1mq6Y1fYyZ6a17Pu67LwXJ8QuN/V47EBSQUim4P4dcC3zEw14cxsv6Yj6eyA7r4A9UdQ8FIc8CPeycWyUGomy2/uTmGRZhvvDrNvlujLqrn1Q2aL4lWWF82A0fr/UsKq4oSc6nOJZk6BQmZXyX9oOhxHCDlEMQJYtYY7i2pL6m+GD6gy1gahTN62MYb9mG94UQ7zFIKMj4Rcrk9ykSg==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bdb414be-7f1f-4de2-628e-08db82a7628b
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 07:12:43.1240
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 9UyoOy8cNoBB9UJ+9BFcSApnddFnUSV9vPTyWHX7NaMkL8JRjpCTLBqJNn2E9F14p93cujUEYbYFFWuvx4l4Yw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR03MB5707

On Tue, Jul 11, 2023 at 03:28:28PM -0400, Stewart Hildebrand wrote:
> When mapping BARs for vPCI, it's valid for a BAR start address to equal the BAR
> end address (i.e. s == e) since e is inclusive. However, pci_check_bar()
> currently returns false in this case, which results in Xen not mapping the BAR.
> In this example boot log, Linux has mapped the BARs, but since Xen did not map
> them, Linux encounters a data abort and panics:

I would maybe reword this a bit to clarify that Xen has not mapped the
BARs in the guest second stage page tables, 'Xen is not mapping the
BAR' is IMO too vague.

> 
> [    2.593300] pci 0000:00:00.0: BAR 0: assigned [mem 0x50008000-0x50008fff]
> [    2.593682] pci 0000:00:00.0: BAR 2: assigned [mem 0x50009000-0x50009fff]
> [    2.594066] pci 0000:00:00.0: BAR 4: assigned [mem 0x5000a000-0x5000afff]
> ...
> [    2.810502] virtio-pci 0000:00:00.0: enabling device (0000 -> 0002)
> (XEN) 0000:00:00.0: not mapping BAR [50008, 50008] invalid position
> (XEN) 0000:00:00.0: not mapping BAR [50009, 50009] invalid position
> (XEN) 0000:00:00.0: not mapping BAR [5000a, 5000a] invalid position
> [    2.817502] virtio-pci 0000:00:00.0: virtio_pci: leaving for legacy driver
> [    2.817853] virtio-pci 0000:00:00.0: enabling bus mastering
> (XEN) arch/arm/traps.c:1992:d0v0 HSR=0x00000093010045 pc=0xffff8000089507d4 gva=0xffff80000c46d012 gpa=0x00000050008012
> [    2.818397] Unable to handle kernel ttbr address size fault at virtual address ffff80000c46d012
> ...
> 
> Since e is inclusive, drop the equality check.
> 
> Also, adjust e to include the whole page. This increases the accuracy of the
> subsequent is_bar_valid check.

I think you want to reorder those sentences, when e is adjusted to
account for the full page s == e is actually impossible, hence the =
part of the check can be dropped:

"Adjust the end physical address to account for the full page when
converting from mfn, at which point start and end cannot be equal, so
drop the equal check in the condition."

Or something similar.

The rest LGTM.

> 
> Fixes: cc80e2bab0d0 ("xen/pci: replace call to is_memory_hole to pci_check_bar")
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>

With the above adjusted:

Reviewed-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 07:36:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 07:36:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561992.878533 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJUOr-00076E-4k; Wed, 12 Jul 2023 07:36:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561992.878533; Wed, 12 Jul 2023 07:36:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJUOr-000767-1v; Wed, 12 Jul 2023 07:36:37 +0000
Received: by outflank-mailman (input) for mailman id 561992;
 Wed, 12 Jul 2023 07:36:35 +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
 <SRS0=I1v4=C6=arm.com=peter.hoyes@srs-se1.protection.inumbo.net>)
 id 1qJUOp-00075l-9r
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 07:36:35 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTP
 id d2700252-2086-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 09:36:32 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1D76D2F4;
 Wed, 12 Jul 2023 00:37:14 -0700 (PDT)
Received: from e125920.cambridge.arm.com (unknown [10.1.199.64])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A97C33F67D;
 Wed, 12 Jul 2023 00:36:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d2700252-2086-11ee-8611-37d641c3527e
From: Peter Hoyes <peter.hoyes@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com,
	wei.chen@arm.com,
	luca.fancellu@arm.com,
	Peter Hoyes <Peter.Hoyes@arm.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v4 0/2] Add escape character argument to Xen console
Date: Wed, 12 Jul 2023 08:35:54 +0100
Message-Id: <20230712073556.14719-1-peter.hoyes@arm.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Peter Hoyes <Peter.Hoyes@arm.com>

Dom0 may be accessed via telnet, meaning the default escape character
(which is the same as telnet's) cannot be directly used to exit the
console. It would be helpful to make the escape character customizable
in such use cases, falling back to the existing 

Make the necessary changes to the console client, libxl and the xl
console sub-command to support this.

Changes in v4:
 * Update xl docs
 * Add necessary changes for libxl API version compatibility
 * Improve escape sequence argument validation

Peter Hoyes (2):
  tools/console: Add escape argument to configure escape character
  xl: Add escape character argument to xl console

 docs/man/xl.1.pod.in             |  8 ++++++-
 tools/console/client/main.c      | 21 +++++++++++++----
 tools/include/libxl.h            | 39 +++++++++++++++++++++++++++++---
 tools/libs/light/libxl_console.c | 30 +++++++++++++++++-------
 tools/xl/xl_cmdtable.c           |  3 ++-
 tools/xl/xl_console.c            | 10 +++++---
 tools/xl/xl_vmcontrol.c          |  2 +-
 7 files changed, 92 insertions(+), 21 deletions(-)

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 07:37:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 07:37:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561994.878542 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJUP5-0007Ni-BH; Wed, 12 Jul 2023 07:36:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561994.878542; Wed, 12 Jul 2023 07:36:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJUP5-0007Nb-8M; Wed, 12 Jul 2023 07:36:51 +0000
Received: by outflank-mailman (input) for mailman id 561994;
 Wed, 12 Jul 2023 07:36:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=I1v4=C6=arm.com=peter.hoyes@srs-se1.protection.inumbo.net>)
 id 1qJUP3-0007NH-LY
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 07:36:49 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTP
 id dba223d9-2086-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 09:36:48 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A1E1E2F4;
 Wed, 12 Jul 2023 00:37:29 -0700 (PDT)
Received: from e125920.cambridge.arm.com (unknown [10.1.199.64])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5434F3F67D;
 Wed, 12 Jul 2023 00:36:46 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dba223d9-2086-11ee-b239-6b7b168915f2
From: Peter Hoyes <peter.hoyes@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com,
	wei.chen@arm.com,
	luca.fancellu@arm.com,
	Peter Hoyes <Peter.Hoyes@arm.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v4 1/2] tools/console: Add escape argument to configure escape character
Date: Wed, 12 Jul 2023 08:35:55 +0100
Message-Id: <20230712073556.14719-2-peter.hoyes@arm.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230712073556.14719-1-peter.hoyes@arm.com>
References: <20230712073556.14719-1-peter.hoyes@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Peter Hoyes <Peter.Hoyes@arm.com>

Dom0 may be accessed via telnet, meaning the default escape character
(which is the same as telnet's) cannot be directly used to exit the
console. It would be helpful to make the escape character customizable
in such use cases.

Add --escape argument to console tool for this purpose.

Add argument to getopt options, parse and validate the escape character
and pass value to console_loop.

If --escape is not specified, it falls back to the existing behavior
using DEFAULT_ESCAPE_SEQUENCE.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
---
 tools/console/client/main.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 6775006488..d2dcc3ddca 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -42,7 +42,7 @@
 #include <xenstore.h>
 #include "xenctrl.h"
 
-#define ESCAPE_CHARACTER 0x1d
+#define DEFAULT_ESCAPE_CHARACTER 0x1d
 
 static volatile sig_atomic_t received_signal = 0;
 static char lockfile[sizeof (XEN_LOCK_DIR "/xenconsole.") + 8] = { 0 };
@@ -77,6 +77,7 @@ static void usage(const char *program) {
 	       "  -n, --num N      use console number N\n"
 	       "  --type TYPE      console type. must be 'pv', 'serial' or 'vuart'\n"
 	       "  --start-notify-fd N file descriptor used to notify parent\n"
+	       "  --escape E       escape sequence to exit console\n"
 	       , program);
 }
 
@@ -174,7 +175,7 @@ static void restore_term(int fd, struct termios *old)
 }
 
 static int console_loop(int fd, struct xs_handle *xs, char *pty_path,
-		        bool interactive)
+			bool interactive, char escape_character)
 {
 	int ret, xs_fd = xs_fileno(xs), max_fd = -1;
 
@@ -215,7 +216,7 @@ static int console_loop(int fd, struct xs_handle *xs, char *pty_path,
 			char msg[60];
 
 			len = read(STDIN_FILENO, msg, sizeof(msg));
-			if (len == 1 && msg[0] == ESCAPE_CHARACTER) {
+			if (len == 1 && msg[0] == escape_character) {
 				return 0;
 			} 
 
@@ -335,6 +336,7 @@ int main(int argc, char **argv)
 		{ "help",    0, 0, 'h' },
 		{ "start-notify-fd", 1, 0, 's' },
 		{ "interactive", 0, 0, 'i' },
+		{ "escape",  1, 0, 'e' },
 		{ 0 },
 
 	};
@@ -345,6 +347,7 @@ int main(int argc, char **argv)
 	console_type type = CONSOLE_INVAL;
 	bool interactive = 0;
 	const char *console_names = "serial, pv, vuart";
+	char escape_character = DEFAULT_ESCAPE_CHARACTER;
 
 	while((ch = getopt_long(argc, argv, sopt, lopt, &opt_ind)) != -1) {
 		switch(ch) {
@@ -375,6 +378,16 @@ int main(int argc, char **argv)
 		case 'i':
 			interactive = 1;
 			break;
+		case 'e':
+			if (optarg[0] == '^' && optarg[1] && optarg[2] == '\0')
+				escape_character = optarg[1] & 0x1f;
+			else if (optarg[0] && optarg[1] == '\0')
+				escape_character = optarg[0];
+			else {
+				fprintf(stderr, "Invalid escape argument\n");
+				exit(EINVAL);
+			}
+			break;
 		default:
 			fprintf(stderr, "Invalid argument\n");
 			fprintf(stderr, "Try `%s --help' for more information.\n", 
@@ -493,7 +506,7 @@ int main(int argc, char **argv)
 		close(start_notify_fd);
 	}
 
-	console_loop(spty, xs, path, interactive);
+	console_loop(spty, xs, path, interactive, escape_character);
 
 	free(path);
 	free(dom_path);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 07:37:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 07:37:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.561995.878553 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJUP7-0007dp-In; Wed, 12 Jul 2023 07:36:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 561995.878553; Wed, 12 Jul 2023 07:36:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJUP7-0007dc-FP; Wed, 12 Jul 2023 07:36:53 +0000
Received: by outflank-mailman (input) for mailman id 561995;
 Wed, 12 Jul 2023 07:36:52 +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
 <SRS0=I1v4=C6=arm.com=peter.hoyes@srs-se1.protection.inumbo.net>)
 id 1qJUP6-00075l-4H
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 07:36:52 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTP
 id dcda4d88-2086-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 09:36:50 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9BAE8D75;
 Wed, 12 Jul 2023 00:37:31 -0700 (PDT)
Received: from e125920.cambridge.arm.com (unknown [10.1.199.64])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 19E4C3F67D;
 Wed, 12 Jul 2023 00:36:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dcda4d88-2086-11ee-8611-37d641c3527e
From: Peter Hoyes <peter.hoyes@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com,
	wei.chen@arm.com,
	luca.fancellu@arm.com,
	Peter Hoyes <Peter.Hoyes@arm.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v4 2/2] xl: Add escape character argument to xl console
Date: Wed, 12 Jul 2023 08:35:56 +0100
Message-Id: <20230712073556.14719-3-peter.hoyes@arm.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230712073556.14719-1-peter.hoyes@arm.com>
References: <20230712073556.14719-1-peter.hoyes@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Peter Hoyes <Peter.Hoyes@arm.com>

Add -e argument to xl console and pass to new escape_character argument
of libxl_console_exec.

Introduce a new API version to support this new argument and advertise
the new functionality in libxl.h

In libxl_console_exec, there are currently two call sites to execl,
which uses varargs, in order to support optionally passing
'start-notify-fd' to the console client. In order to support passing
the 'escape' argument optionally too, refactor to instead have a single
call site to execv, which has the same behavior but takes an array of
arguments.

If -e is not specified, --escape is not passed to the console client and
the existing value (^]) is used as a default.

Update the xl docs.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
---
 docs/man/xl.1.pod.in             |  8 ++++++-
 tools/include/libxl.h            | 39 +++++++++++++++++++++++++++++---
 tools/libs/light/libxl_console.c | 30 +++++++++++++++++-------
 tools/xl/xl_cmdtable.c           |  3 ++-
 tools/xl/xl_console.c            | 10 +++++---
 tools/xl/xl_vmcontrol.c          |  2 +-
 6 files changed, 75 insertions(+), 17 deletions(-)

diff --git a/docs/man/xl.1.pod.in b/docs/man/xl.1.pod.in
index 101e14241d..9ba22a8fa2 100644
--- a/docs/man/xl.1.pod.in
+++ b/docs/man/xl.1.pod.in
@@ -222,7 +222,8 @@ Attach to the console of a domain specified by I<domain-id>.  If you've set up
 your domains to have a traditional login console this will look much like a
 normal text login screen.
 
-Use the key combination Ctrl+] to detach from the domain console.
+Use the escape character key combination (default Ctrl+]) to detach from the
+domain console.
 
 B<OPTIONS>
 
@@ -239,6 +240,11 @@ emulated serial for HVM guests and PV console for PV guests.
 
 Connect to console number I<NUM>. Console numbers start from 0.
 
+=item I<-e escapechar>
+
+Customize the escape sequence used to detach from the domain console to
+I<escapechar>. If not specified, the value "^]" is used.
+
 =back
 
 =item B<destroy> [I<OPTIONS>] I<domain-id>
diff --git a/tools/include/libxl.h b/tools/include/libxl.h
index cac641a7eb..21e43cc839 100644
--- a/tools/include/libxl.h
+++ b/tools/include/libxl.h
@@ -81,6 +81,15 @@
  */
 #define LIBXL_HAVE_CONSOLE_NOTIFY_FD 1
 
+/* LIBXL_HAVE_CONSOLE_ESCAPE_CHARACTER
+ *
+ * If this is defined, libxl_console_exec and
+ * libxl_primary_console_exe take an escape_character parameter. That
+ * parameter will be used to modify the escape sequence used to exit the
+ * console.
+ */
+#define LIBXL_HAVE_CONSOLE_ESCAPE_CHARACTER 1
+
 /* LIBXL_HAVE_CONST_COPY_AND_LENGTH_FUNCTIONS
  *
  * If this is defined, the copy functions have constified src parameter and the
@@ -790,7 +799,8 @@ typedef struct libxl__ctx libxl_ctx;
 #if LIBXL_API_VERSION != 0x040200 && LIBXL_API_VERSION != 0x040300 && \
     LIBXL_API_VERSION != 0x040400 && LIBXL_API_VERSION != 0x040500 && \
     LIBXL_API_VERSION != 0x040700 && LIBXL_API_VERSION != 0x040800 && \
-    LIBXL_API_VERSION != 0x041300 && LIBXL_API_VERSION != 0x041400
+    LIBXL_API_VERSION != 0x041300 && LIBXL_API_VERSION != 0x041400 && \
+    LIBXL_API_VERSION != 0x041800
 #error Unknown LIBXL_API_VERSION
 #endif
 #endif
@@ -1958,7 +1968,8 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass);
  * the caller that it has connected to the guest console.
  */
 int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
-                       libxl_console_type type, int notify_fd);
+                       libxl_console_type type, int notify_fd,
+                       char* escape_character);
 /* libxl_primary_console_exec finds the domid and console number
  * corresponding to the primary console of the given vm, then calls
  * libxl_console_exec with the right arguments (domid might be different
@@ -1968,9 +1979,12 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
  * guests using pygrub.
  * If notify_fd is not -1, xenconsole will write 0x00 to it to nofity
  * the caller that it has connected to the guest console.
+ * If escape_character is not NULL, the provided value is used to exit
+ * the guest console.
  */
 int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm,
-                               int notify_fd);
+                               int notify_fd,
+                               char* escape_character);
 
 #if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040800
 
@@ -1989,6 +2003,25 @@ static inline int libxl_primary_console_exec_0x040700(libxl_ctx *ctx,
 }
 #define libxl_primary_console_exec libxl_primary_console_exec_0x040700
 
+#elif defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x041800
+
+static inline int libxl_console_exec_0x041800(libxl_ctx *ctx, uint32_t domid,
+                                              int cons_num,
+                                              libxl_console_type type,
+                                              int notify_fd)
+{
+    return libxl_console_exec(ctx, domid, cons_num, type, notify_fd, NULL);
+}
+#define libxl_console_exec libxl_console_exec_0x041800
+
+static inline int libxl_primary_console_exec_0x041800(libxl_ctx *ctx,
+                                                      uint32_t domid_vm,
+                                                      int notify_fd)
+{
+    return libxl_primary_console_exec(ctx, domid_vm, notify_fd, NULL);
+}
+#define libxl_primary_console_exec libxl_primary_console_exec_0x041800
+
 #endif
 
 /* libxl_console_get_tty retrieves the specified domain's console tty path
diff --git a/tools/libs/light/libxl_console.c b/tools/libs/light/libxl_console.c
index f497be141b..0b7293fe71 100644
--- a/tools/libs/light/libxl_console.c
+++ b/tools/libs/light/libxl_console.c
@@ -52,7 +52,8 @@ out:
 }
 
 int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
-                       libxl_console_type type, int notify_fd)
+                       libxl_console_type type, int notify_fd,
+                       char* escape_character)
 {
     GC_INIT(ctx);
     char *p = GCSPRINTF("%s/xenconsole", libxl__private_bindir_path());
@@ -75,15 +76,26 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
         goto out;
     }
 
+    char *args[] = {
+        p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
+        NULL, NULL, NULL, NULL, // start-notify-fd, escape
+        NULL, // list terminator - do not use
+    };
+    char **args_extra = args + 6;
+
     if (notify_fd != -1) {
         notify_fd_s = GCSPRINTF("%d", notify_fd);
-        execl(p, p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
-              "--start-notify-fd", notify_fd_s, (void *)NULL);
-    } else {
-        execl(p, p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
-              (void *)NULL);
+        *args_extra++ = "--start-notify-fd";
+        *args_extra++ = notify_fd_s;
     }
 
+    if (escape_character) {
+        *args_extra++ = "--escape";
+        *args_extra++ = escape_character;
+    }
+
+    execv(p, args);
+
 out:
     GC_FREE;
     return ERROR_FAIL;
@@ -156,7 +168,8 @@ out:
     return rc;
 }
 
-int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm, int notify_fd)
+int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm, int notify_fd,
+                               char* escape_character)
 {
     uint32_t domid;
     int cons_num;
@@ -165,7 +178,8 @@ int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm, int notify_fd)
 
     rc = libxl__primary_console_find(ctx, domid_vm, &domid, &cons_num, &type);
     if ( rc ) return rc;
-    return libxl_console_exec(ctx, domid, cons_num, type, notify_fd);
+    return libxl_console_exec(ctx, domid, cons_num, type, notify_fd,
+                              escape_character);
 }
 
 int libxl_primary_console_get_tty(libxl_ctx *ctx, uint32_t domid_vm,
diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
index ccf4d83584..67604e9536 100644
--- a/tools/xl/xl_cmdtable.c
+++ b/tools/xl/xl_cmdtable.c
@@ -141,7 +141,8 @@ const struct cmd_spec cmd_table[] = {
       "Attach to domain's console",
       "[options] <Domain>\n"
       "-t <type>       console type, pv , serial or vuart\n"
-      "-n <number>     console number"
+      "-n <number>     console number\n"
+      "-e <escape>     escape character"
     },
     { "vncviewer",
       &main_vncviewer, 0, 0,
diff --git a/tools/xl/xl_console.c b/tools/xl/xl_console.c
index b27f9e0136..5633c6f6f7 100644
--- a/tools/xl/xl_console.c
+++ b/tools/xl/xl_console.c
@@ -28,8 +28,9 @@ int main_console(int argc, char **argv)
     int opt = 0, num = 0;
     libxl_console_type type = 0;
     const char *console_names = "pv, serial, vuart";
+    char* escape_character = NULL;
 
-    SWITCH_FOREACH_OPT(opt, "n:t:", NULL, "console", 1) {
+    SWITCH_FOREACH_OPT(opt, "n:t:e:", NULL, "console", 1) {
     case 't':
         if (!strcmp(optarg, "pv"))
             type = LIBXL_CONSOLE_TYPE_PV;
@@ -45,13 +46,16 @@ int main_console(int argc, char **argv)
     case 'n':
         num = atoi(optarg);
         break;
+    case 'e':
+        escape_character = optarg;
+        break;
     }
 
     domid = find_domain(argv[optind]);
     if (!type)
-        libxl_primary_console_exec(ctx, domid, -1);
+        libxl_primary_console_exec(ctx, domid, -1, escape_character);
     else
-        libxl_console_exec(ctx, domid, num, type, -1);
+        libxl_console_exec(ctx, domid, num, type, -1, escape_character);
     fprintf(stderr, "Unable to attach console\n");
     return EXIT_FAILURE;
 }
diff --git a/tools/xl/xl_vmcontrol.c b/tools/xl/xl_vmcontrol.c
index 5518c78dc6..03971927e9 100644
--- a/tools/xl/xl_vmcontrol.c
+++ b/tools/xl/xl_vmcontrol.c
@@ -643,7 +643,7 @@ static void autoconnect_console(libxl_ctx *ctx_ignored,
     postfork();
 
     sleep(1);
-    libxl_primary_console_exec(ctx, bldomid, notify_fd);
+    libxl_primary_console_exec(ctx, bldomid, notify_fd, NULL);
     /* Do not return. xl continued in child process */
     perror("xl: unable to exec console client");
     _exit(1);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 07:41:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 07:41:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562014.878562 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJUT6-0001Ia-86; Wed, 12 Jul 2023 07:41:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562014.878562; Wed, 12 Jul 2023 07:41:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJUT6-0001IT-5V; Wed, 12 Jul 2023 07:41:00 +0000
Received: by outflank-mailman (input) for mailman id 562014;
 Wed, 12 Jul 2023 07:40:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=I1v4=C6=arm.com=Peter.Hoyes@srs-se1.protection.inumbo.net>)
 id 1qJUT5-0001IM-5U
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 07:40:59 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTP
 id 70ca96a5-2087-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 09:40:58 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D7A6D2F4;
 Wed, 12 Jul 2023 00:41:39 -0700 (PDT)
Received: from [10.1.199.64] (unknown [10.1.199.64])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A16F23F67D;
 Wed, 12 Jul 2023 00:40:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 70ca96a5-2087-11ee-b239-6b7b168915f2
Message-ID: <2754aaab-922a-347d-7598-f246388ff56f@arm.com>
Date: Wed, 12 Jul 2023 08:40:50 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [PATCH v3 2/2] xl: Add escape character argument to xl console
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: xen-devel@lists.xenproject.org, bertrand.marquis@arm.com,
 wei.chen@arm.com, luca.fancellu@arm.com, Wei Liu <wl@xen.org>,
 Juergen Gross <jgross@suse.com>
References: <20230622141248.459133-1-peter.hoyes@arm.com>
 <20230622141248.459133-2-peter.hoyes@arm.com>
 <3c1a169b-3d3b-43e5-8f90-f8c09a5ac82d@perard>
Content-Language: en-US
From: Peter Hoyes <Peter.Hoyes@arm.com>
In-Reply-To: <3c1a169b-3d3b-43e5-8f90-f8c09a5ac82d@perard>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Thanks for the feedback.

On 10/07/2023 15:43, Anthony PERARD wrote:
> On Thu, Jun 22, 2023 at 03:12:48PM +0100, Peter Hoyes wrote:
>>   /* libxl_primary_console_exec finds the domid and console number
>>    * corresponding to the primary console of the given vm, then calls
>>    * libxl_console_exec with the right arguments (domid might be different
>> @@ -1968,9 +1969,12 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
>>    * guests using pygrub.
>>    * If notify_fd is not -1, xenconsole will write 0x00 to it to nofity
>>    * the caller that it has connected to the guest console.
>> + * If escape_character is not NULL, the provided value is used to exit
>> + * the guest console.
>>    */
>>   int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm,
>> -                               int notify_fd);
>> +                               int notify_fd,
>> +                               char* escape_character);
>>   
>>   #if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040800
>>   
>> diff --git a/tools/libs/light/libxl_console.c b/tools/libs/light/libxl_console.c
>> index f497be141b..0b7293fe71 100644
>> --- a/tools/libs/light/libxl_console.c
>> +++ b/tools/libs/light/libxl_console.c
>> @@ -75,15 +76,26 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
>>           goto out;
>>       }
>>   
>> +    char *args[] = {
>> +        p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
>> +        NULL, NULL, NULL, NULL, // start-notify-fd, escape
>> +        NULL, // list terminator - do not use
>> +    };
>> +    char **args_extra = args + 6;
>> +
>>       if (notify_fd != -1) {
>>           notify_fd_s = GCSPRINTF("%d", notify_fd);
>> -        execl(p, p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
>> -              "--start-notify-fd", notify_fd_s, (void *)NULL);
>> -    } else {
>> -        execl(p, p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
>> -              (void *)NULL);
>> +        *args_extra++ = "--start-notify-fd";
>> +        *args_extra++ = notify_fd_s;
>>       }
>>   
>> +    if (escape_character) {
>> +        *args_extra++ = "--escape";
>> +        *args_extra++ = escape_character;
>> +    }
> There is flexarray_* that could be use, but I guess a preset `*args`
> kind of work here.
>
I looked into flexarray but didn't implement in v4 - as it stands, 
libxl_console_exec and libxl_vncviewer_exec are using the same pattern.

Peter



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 07:54:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 07:54:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562023.878573 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJUgB-0002sn-DZ; Wed, 12 Jul 2023 07:54:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562023.878573; Wed, 12 Jul 2023 07:54:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJUgB-0002sg-B1; Wed, 12 Jul 2023 07:54:31 +0000
Received: by outflank-mailman (input) for mailman id 562023;
 Wed, 12 Jul 2023 07:54:30 +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
 <SRS0=Mhes=C6=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qJUg9-0002sa-Ve
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 07:54:30 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20602.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::602])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 52db6c40-2089-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 09:54:27 +0200 (CEST)
Received: from AS9PR06CA0511.eurprd06.prod.outlook.com (2603:10a6:20b:49d::6)
 by DBAPR08MB5688.eurprd08.prod.outlook.com (2603:10a6:10:1a0::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Wed, 12 Jul
 2023 07:54:24 +0000
Received: from AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:49d:cafe::7) by AS9PR06CA0511.outlook.office365.com
 (2603:10a6:20b:49d::6) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32 via Frontend
 Transport; Wed, 12 Jul 2023 07:54:24 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT013.mail.protection.outlook.com (100.127.140.191) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.20 via Frontend Transport; Wed, 12 Jul 2023 07:54:23 +0000
Received: ("Tessian outbound e1fdbe8a48d3:v145");
 Wed, 12 Jul 2023 07:54:23 +0000
Received: from 628d3ca79134.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 A5866A66-DBA0-4B49-915C-E0BD451859EB.1; 
 Wed, 12 Jul 2023 07:54:12 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 628d3ca79134.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 12 Jul 2023 07:54:12 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by AS2PR08MB8287.eurprd08.prod.outlook.com (2603:10a6:20b:556::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Wed, 12 Jul
 2023 07:54:08 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::488c:5182:718d:7759]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::488c:5182:718d:7759%4]) with mapi id 15.20.6588.017; Wed, 12 Jul 2023
 07:54:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 52db6c40-2089-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MnlctAjr5Jvm4SoPjOjsnN6dP+IB7PYrJf0H4xTjeeE=;
 b=4pXRxhBUTbUK9LI5zuYnrYK6TPTuix+Zd+bNLWFF0VagQ1xxFbYdgiCWOVKQVDH3gy5tPESA0qukDh8Pq+R933vANtfE8YCFqfDsbs0stgBiJYLNWXebKdsBnYU9zFxVBZke9mTeyhB2MRD2MCXBAdV7IShqqlotXWVmYw3kx68=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 3d0a0b0df6e182c5
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=OoMZ9cxmYXeY4i4+bKtvtgFjaWbh1s85jZ4h2vg94e6b0O0G0rMmzpbFmuiwsU3RF8ld0jW4jfaZgdiEIkQxKj8wSGKyhJ2x7SuwqfLi/3sjEMg6YOUTdRPH8OMFKozE6Cz5UPf3/Pb7iRRUEctkXK6rEZ/iICXf9kL2fpIqiRzv9sU4EmpjyHiHIONovtkqUchG92gYAi+ol+FrRdtgqpBZ2EIaHki7nljAB1w0zmCSkSK2NPqTXoPICc55AkuXe4zMxWuj2O4lI2/no+LtFx8TxR6eEkwjg6sG7n44dJBKhPHNcICXyfkF/VqfmrhCs2Kpxealcq1nOHa/teHCpA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MnlctAjr5Jvm4SoPjOjsnN6dP+IB7PYrJf0H4xTjeeE=;
 b=KkEDKZuWoi2x4sXTW0EvoCj9NfC62liR59Yc7EwK5C+uKIkKRZDCLLO73KeR0gKVIsKEEz8/8C0bpO4D+y3W3WhBJVcl5nHVj76Uei6LgP2zGZirG03orfkNGQvS+ljGksEmpyr/gAr7HVeBxWI273eL3PVVHvoIKmaRw7+Y/lamTqzIprDQ9375W+Cm2QRkETUMYj0B5cws19mZmKZzD/1KlYyJMxlQnw9b3qb6qZg5a50LczZieP8hdWXUcq7ktzxBrJxwkTEWc8mQw/micmsz5KFuRxuZR4ermRpAsqYdPtkMqTGGI3LotSXkAeEuGMwGATvLekWGYg6DUwXFgw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MnlctAjr5Jvm4SoPjOjsnN6dP+IB7PYrJf0H4xTjeeE=;
 b=4pXRxhBUTbUK9LI5zuYnrYK6TPTuix+Zd+bNLWFF0VagQ1xxFbYdgiCWOVKQVDH3gy5tPESA0qukDh8Pq+R933vANtfE8YCFqfDsbs0stgBiJYLNWXebKdsBnYU9zFxVBZke9mTeyhB2MRD2MCXBAdV7IShqqlotXWVmYw3kx68=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>, Jan Beulich
	<JBeulich@suse.com>
Subject: Re: [XEN PATCH v9 01/24] xen: Introduce arch_domain_teardown()
Thread-Topic: [XEN PATCH v9 01/24] xen: Introduce arch_domain_teardown()
Thread-Index: AQHZryQJ2IQLjJDZP0Styerrsqvhxa+1zb2A
Date: Wed, 12 Jul 2023 07:54:08 +0000
Message-ID: <96CCDC08-9CC2-4449-AD3B-CD96BAEE57D0@arm.com>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
 <20230705093433.2514898-2-jens.wiklander@linaro.org>
In-Reply-To: <20230705093433.2514898-2-jens.wiklander@linaro.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|AS2PR08MB8287:EE_|AM7EUR03FT013:EE_|DBAPR08MB5688:EE_
X-MS-Office365-Filtering-Correlation-Id: dded81c4-69b8-4813-142e-08db82ad3561
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 1p8hu57tqGOEFKmXRO2433kuOxqNE1S9QWgmmTbys5qjjkiZJjymJWfPWAQXcV5AczTDt36YMQNYjllvGNzp1tLIt8m/lirRxwveJlaWLalLj+RN+6zSCgWptBGmsUz9J+e8JxVJr6yBk7RUFO2hKj7ydkYgHBfaPhpWQAdg1SWYwlOigimbrkCJNiOGJR4LIDi+vHRFqMPFWPwxMXQxSo81csvW7XjeWsf0e5gRFVKlHrzmuQJkVEz5d35Rf/4uahFA+KIJJCOeIzKGnntA5nAoRyyo8TSCDmjrvrb9/kbOBKUwQxx+hU7YcOsjf8VRIJBtHqtRSkNrKJ06e5nMt0LmLzgOwklxy1Wfd7Zudeuqn8PI4C+6AZVaofDY4Gy2tj1u7jRUISdyYdwT97i3rMogPpkvmLxuCxmoh/G1ChdR4pbquq3ySGMRbRVJCoNwnmLUuCCFEomgRwmeaK94KG+gQoOtg1uaFzLJru746JSnG22yfcaV2NL90keQz50PvoTDwzzDddC1tpywwRGVlDUDsiji+O7VoomCoiOPeDvsDHCbyTnQp75hdckAfLsZfy1VCramf/ydktLNSbW5xqezi0GTBk8xd/8V+aGHz/hkH96WDjOXDlaPw+FYGHhm90hdh3NEy/JgmZMSUnwqFA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(346002)(39860400002)(136003)(376002)(451199021)(76116006)(6486002)(478600001)(91956017)(71200400001)(54906003)(6506007)(53546011)(186003)(66946007)(2906002)(6512007)(8676002)(41300700001)(7416002)(6916009)(66476007)(5660300002)(66446008)(4326008)(8936002)(316002)(64756008)(38100700002)(66556008)(122000001)(86362001)(33656002)(38070700005)(2616005)(36756003)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <3787300095C7E2488A2EA7F6C970B7EE@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8287
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	e8374a21-e91f-4c1a-3704-08db82ad2c15
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	WnPMSt6cv9ldWLvklibwRZVORK+SJD5242c07XgLghOts86rYTGythQsPrAmH5toEg4GHIe/L80IU4mxqhrLJC+zRyORZ7HvMKj89z1sHjR8yYdye5j4Vg58LxHcHj9SbJ3U/Cbq2X4Tsguf8tbrTpu4/sDz6VLfve5Jzzp2NbRMVPfcNw5Kycw+vRFL+wL/08jIWkvkzkRnjsdZk0T3sW3hTctmtPXOOTTRdYGJ3rFcQNn04S4OBNB+XwFlTyLnT90DrUR7vX3ctknG5R1poHyGdqkg5Rt2CcMuZlh+hE1FDVIsyUt9zr4EXhb/uQNbsk6pvSExdmoogJVLHG0OMWDVaNNn7CQCsI2yUmgtBMoIXw5bmAfqHFNID4u/mq70Y6jHKjMPGA5YWFeSEyaA25kJjR5imRmTJ60YjZ0P6RyHNHd5eh53xNA610PzwW0Do2B7q8Mr3Qgjkt5QyQ8f1opEYulDnqGcUfJhZc8EfqznFcBgIzrRxMjBmjvyFZQ3h4WW78SHYIM+qdNvAmF4d9c1v8dFmHBaAWDrVaLujQIzB5FQibdMpHGQFZrWWC+KgqgmMwyufR0vfLzB7sDMU/Sj2GhEsC3e5SEKw/z0MvVLYZeTgQ91GroC/YAq4azUne180g1H6/pbhRUe8qMEadUdCX7L015cJ9dB5NDVITnuevRNtE3WaOgRNLa7xHSNkri9dA93e1eWI4ldmKrlYjogMWTcy9omOtIiOtA/fNXM3lm1k/3SGvn72wNNrB7U
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(396003)(346002)(376002)(451199021)(46966006)(40470700004)(36840700001)(86362001)(82310400005)(70206006)(33656002)(54906003)(36860700001)(356005)(47076005)(336012)(82740400003)(81166007)(2906002)(2616005)(36756003)(4326008)(70586007)(6486002)(316002)(6512007)(41300700001)(186003)(40480700001)(6862004)(53546011)(8936002)(8676002)(40460700003)(107886003)(6506007)(26005)(5660300002)(478600001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 07:54:23.8783
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: dded81c4-69b8-4813-142e-08db82ad3561
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5688

SGkgSmVucywNCg0KPiBPbiA1IEp1bCAyMDIzLCBhdCAxMTozNCwgSmVucyBXaWtsYW5kZXIgPGpl
bnMud2lrbGFuZGVyQGxpbmFyby5vcmc+IHdyb3RlOg0KPiANCj4gRnJvbTogQW5kcmV3IENvb3Bl
ciA8YW5kcmV3LmNvb3BlcjNAY2l0cml4LmNvbT4NCj4gDQo+IFBsdW1iIGl0IGludG8gZG9tYWlu
X3RlYXJkb3duKCkuICBQcm92aWRlIGFyY2hfdmFsIGluIHRoZSB0ZWFyZG93bg0KPiBjb250aW51
YXRpb24gaW5mb3JtYXRpb24gZm9yIHVzZSBieSBhcmNoX2RvbWFpbl90ZWFyZG93bigpLg0KPiAN
Cj4gTm8gcHJhY3RpY2FsIGNoYW5nZS4NCj4gDQo+IFNpZ25lZC1vZmYtYnk6IEFuZHJldyBDb29w
ZXIgPGFuZHJldy5jb29wZXIzQGNpdHJpeC5jb20+DQo+IFNpZ25lZC1vZmYtYnk6IEplbnMgV2lr
bGFuZGVyIDxqZW5zLndpa2xhbmRlckBsaW5hcm8ub3JnPg0KDQpSZXZpZXdlZC1ieTogQmVydHJh
bmQgTWFycXVpcyA8YmVydHJhbmQubWFycXVpc0Bhcm0uY29tPg0KDQpDaGVlcnMNCkJlcnRyYW5k
DQoNCj4gLS0tDQo+IENDOiBKYW4gQmV1bGljaCA8SkJldWxpY2hAc3VzZS5jb20+DQo+IENDOiBS
b2dlciBQYXUgTW9ubsOpIDxyb2dlci5wYXVAY2l0cml4LmNvbT4NCj4gQ0M6IFdlaSBMaXUgPHds
QHhlbi5vcmc+DQo+IENDOiBTdGVmYW5vIFN0YWJlbGxpbmkgPHNzdGFiZWxsa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95
KHN0cnVjdCBkb21haW4gKmQpOw0KPiANCj4gdm9pZCBhcmNoX2RvbWFpbl9zaHV0ZG93bihzdHJ1
Y3QgZG9tYWluICpkKTsNCj4gZGlmZiAtLWdpdCBhL3hlbi9pbmNsdWRlL3hlbi9zY2hlZC5oIGIv
eGVuL2luY2x1ZGUveGVuL3NjaGVkLmgNCj4gaW5kZXggODUyNDJhNzNkMzc0Li44NTRmM2UzMmMw
MGUgMTAwNjQ0DQo+IC0tLSBhL3hlbi9pbmNsdWRlL3hlbi9zY2hlZC5oDQo+ICsrKyBiL3hlbi9p
bmNsdWRlL3hlbi9zY2hlZC5oDQo+IEBAIC01ODksNiArNTg5LDcgQEAgc3RydWN0IGRvbWFpbg0K
PiAgICAgICovDQo+ICAgICBzdHJ1Y3Qgew0KPiAgICAgICAgIHVuc2lnbmVkIGludCB2YWw7DQo+
ICsgICAgICAgIHVuc2lnbmVkIGludCBhcmNoX3ZhbDsNCj4gICAgICAgICBzdHJ1Y3QgdmNwdSAq
dmNwdTsNCj4gICAgIH0gdGVhcmRvd247DQo+IA0KPiAtLSANCj4gMi4zNC4xDQo+IA0KDQo=


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 07:58:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 07:58:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562027.878583 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJUja-0003Uk-UE; Wed, 12 Jul 2023 07:58:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562027.878583; Wed, 12 Jul 2023 07:58:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJUja-0003Ud-Pz; Wed, 12 Jul 2023 07:58:02 +0000
Received: by outflank-mailman (input) for mailman id 562027;
 Wed, 12 Jul 2023 07:58:01 +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
 <SRS0=Mhes=C6=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qJUjY-0003UT-Tx
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 07:58:01 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on2060c.outbound.protection.outlook.com
 [2a01:111:f400:7d00::60c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d10e150f-2089-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 09:57:58 +0200 (CEST)
Received: from DB6PR0301CA0082.eurprd03.prod.outlook.com (2603:10a6:6:30::29)
 by DU0PR08MB8020.eurprd08.prod.outlook.com (2603:10a6:10:3e7::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 07:57:45 +0000
Received: from DBAEUR03FT019.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:6:30:cafe::e1) by DB6PR0301CA0082.outlook.office365.com
 (2603:10a6:6:30::29) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20 via Frontend
 Transport; Wed, 12 Jul 2023 07:57:45 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT019.mail.protection.outlook.com (100.127.142.129) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.20 via Frontend Transport; Wed, 12 Jul 2023 07:57:45 +0000
Received: ("Tessian outbound 997ae1cc9f47:v145");
 Wed, 12 Jul 2023 07:57:45 +0000
Received: from 5e870411b807.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 B77E8EFC-1BE0-4BB8-9825-B131B84B8EBF.1; 
 Wed, 12 Jul 2023 07:57:38 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5e870411b807.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 12 Jul 2023 07:57:38 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by AS2PR08MB9499.eurprd08.prod.outlook.com (2603:10a6:20b:60d::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Wed, 12 Jul
 2023 07:57:36 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::488c:5182:718d:7759]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::488c:5182:718d:7759%4]) with mapi id 15.20.6588.017; Wed, 12 Jul 2023
 07:57:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d10e150f-2089-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=YnnKBZQZxUkEz5UVFz6ZTc8ezpNMUjVqaz3fAmrMhIE=;
 b=UvT9UWL16sgxM4XixrThfKJrZh5Ub1r01VeD0608fzbTPFJbEevg42B0j8PB3Ma0D6cT+E87T+80rfT1PGOpmNTqtRpfmSVqe8L5gA9ySkcCLqlFHwvFFSoD4V70i/JAhGgNv2ZQ1iHnRT8P27NIUX4AbPkDZygfSMCfp0x/0Z4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: ea5eb9677861b59f
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ZSG1K+Ph1OMICipd6NR2n8qAacHLpjlCnGl8OtreitGxJmRNW8J25goQHUpTwfYejh2FL64Htky0w8QCB9TkwfoNU17T5YXGst74EsbX9xXrMzwVVNeQLQ2zejvAR25R0gth4Q1lvFr/W6MsxYkGhxqgWTYE27uW/Pi+G9LcGSnDxW/Rn8AgeV5M6HwzTn2f+6SOFIEQPB08RmIQgUpbpn2+G13JgpCbqPV/pquWNUldM9WO6uqdkSrMbdSoma/7tZwPACZ0lwg1JNgCKEJrOAI+KN/5tyhYi11tYHmh0It/iu5apPhrwlUyJKvHc1MkvqwpEb23t4mnwVpWPgQJxw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=YnnKBZQZxUkEz5UVFz6ZTc8ezpNMUjVqaz3fAmrMhIE=;
 b=VzQ8zPWeYRPZrYkXkCi9wR0bQ4RojGzaZUwXytJIT/FPskdOzvt6CrhDnN5XbYLyNy4+BiISyqh5mOUK8/l5jatiEeOBONOmD4pLUpc7Hjv1j644EjFvbX4xGbP2ixCY0dN9Yj8kueVaDUkFjPKHQqrjQL7C0srOuBo+6+ljbQCUl/B3nhEuo7WCyAPSGpT6qJ6ehvUaIht7/JHyNWcQg+NyMOYRsscuBR+cr6f8lEbGosaM+X7v0l3CyldqaoHqpaKYfqay6HmVAoncqcrf/FcvVVAQIVwGYPJL1GYSA0dsXUv+qWi+JssbaWWTrdEc76EF1d5tp/vbAbAwvidcdw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=YnnKBZQZxUkEz5UVFz6ZTc8ezpNMUjVqaz3fAmrMhIE=;
 b=UvT9UWL16sgxM4XixrThfKJrZh5Ub1r01VeD0608fzbTPFJbEevg42B0j8PB3Ma0D6cT+E87T+80rfT1PGOpmNTqtRpfmSVqe8L5gA9ySkcCLqlFHwvFFSoD4V70i/JAhGgNv2ZQ1iHnRT8P27NIUX4AbPkDZygfSMCfp0x/0Z4=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>
Subject: Re: [XEN PATCH v9 02/24] xen/arm: add TEE teardown to
 arch_domain_teardown()
Thread-Topic: [XEN PATCH v9 02/24] xen/arm: add TEE teardown to
 arch_domain_teardown()
Thread-Index: AQHZryQNhqeVJwRMkEqOYe/pkcUwVq+1zrYA
Date: Wed, 12 Jul 2023 07:57:36 +0000
Message-ID: <390DD2B7-0C48-4875-888D-4B319001E8EE@arm.com>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
 <20230705093433.2514898-3-jens.wiklander@linaro.org>
In-Reply-To: <20230705093433.2514898-3-jens.wiklander@linaro.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|AS2PR08MB9499:EE_|DBAEUR03FT019:EE_|DU0PR08MB8020:EE_
X-MS-Office365-Filtering-Correlation-Id: cb70819c-bf00-453d-af3a-08db82adad62
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 o/Hpj5cXee+mmsbJdw6wDIjuGdQlKcChkba+YsLkNyWl+s6LSWGx/1PUTiLyZCTXAOoIhi9hwUTeF8XM4nP4Pcqu8sDSclv35+K+OXeGEE1M6bztxYdcJYZxEL3pXL1qggbxuLQ+Zy6B8v9j3zgLAvaiAF9DvqRbC1FuC+K1p85MPtb1DINBeDYW/uOkhrV9icNwulWWupUi3dTvNRiIe7PkeEiuB/7d+MuENNcLMcpivdf8bKUwk1arWBnMPd5foxEyIuMT1G9paAS9brPZRdho0rCXnZloh7Ff6P10J44M+S2hLdCoZ4WTSRVBdb3YHpok/1yG4/lMx1P8BlSg9dw//QVepWv0DJKkoq6pu+RBPzX7Ro1q2EkupSdgLa44cLgaCgZ4MCpToX2eN6kJsztPW+m9sVAwCXuXcfDornltW4emWTTsPPQ3l7yj8eDJ0AgocXPYcAqcyFVlVGrynVNdS5vgCR8R+yN4sGObJXNPJOSyiN+o/XV3xcik4dy7QGVX2n2zpI6qdaI8b/VOx+EeuD2Q2eL+eMwdLtgva5BGjc+IyRhf6NWm5H+6zvRAod/meIxCXxa9kyc5Wno0Su57wKKxeyw7m5NAxFIqefH+EPVMGDzOFLo4N8BjFM0aL8AtlVROTmCuGdbofzUkaQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(366004)(396003)(376002)(39860400002)(451199021)(6486002)(6916009)(4326008)(66476007)(66946007)(76116006)(91956017)(66556008)(64756008)(66446008)(478600001)(6506007)(53546011)(122000001)(38100700002)(54906003)(71200400001)(316002)(41300700001)(6512007)(38070700005)(8936002)(8676002)(86362001)(5660300002)(186003)(33656002)(2906002)(2616005)(36756003)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <30B2659762F6F64BB770A2ADE6974766@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9499
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT019.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	10376211-af4f-4731-34f8-08db82ada821
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	GpbVsE5fCFumlMJwv/WLr1fTciYQWdCvFm1vcJMlNnH2dwcAgkiCc2UIb5Jx1EDk2dz7vHCxW99obHDMzDSSYsgUWR74zTH0PQq/M17gGT1trZk1zad6oyAEG1e6jzXzchnTyxhtRp8efO0P+RMEKmBPVx/BwdhHFl7yyOiPx+0L1GOp9O5LFmu0Shw5CtE9ni+hFoRMZtgvlTw74sQuCBgEHAJ6OxVIb4ABdKaGOyJZD2fWoHOut/HslKbDEDt95rUpb9piIg9ERAYsk/R12QiwEGhIpRclyei1yqNBYK2p/2AnEaaVWdop4tTLTJkju6AKBdckfc7xk8k6qoxFc4v/lmjQNft45EUGo+tsS6nRz17TibNMezyRts3TuxxJxyPhwRsaVwjFj/bWM8myakcQ2J0WfDvJusJE0FFTzsbAqQ6Bqw6VD0Na2UlOirk1Eoo+wkCyUAk4FtgN76U/QY/7bsRm/0Z8qRH760kob8TJDEE3kpS1rY/xOwjg8QllAP4C5cGUOOixInlUceSQQAwZKmTfmyelrAz8xC6vJEVwryONMzhK7n+UUlRtPAJpA9xR3loruSifxcySeTXpd6XaiLxZop73MfcCvaNshIMQ+pSxmiWFNOOP4eVM0vOUUOLfoBvxWJWAZ55vluhFVR//RUk23oOzyfJWxCLbJ64rruSYhGR4Xh1bLFE5vZm6hbv0hDC2OBYKPSgNGqjGMg+1gmhQ82fu7pjXDlZ6h5MSWxOMp42VSzztPeeO5msY
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(39860400002)(136003)(346002)(451199021)(36840700001)(40470700004)(46966006)(70586007)(70206006)(4326008)(36860700001)(40460700003)(478600001)(36756003)(54906003)(86362001)(40480700001)(107886003)(26005)(186003)(336012)(6506007)(53546011)(33656002)(6512007)(6486002)(47076005)(82310400005)(82740400003)(81166007)(356005)(2616005)(41300700001)(8936002)(8676002)(6862004)(5660300002)(2906002)(316002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 07:57:45.2779
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: cb70819c-bf00-453d-af3a-08db82adad62
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT019.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8020

Hi Jens,

> On 5 Jul 2023, at 11:34, Jens Wiklander <jens.wiklander@linaro.org> wrote=
:
>=20
> Adds a progress state for tee_domain_teardown() to be called from
> arch_domain_teardown(). tee_domain_teardown() calls the new callback
> domain_teardown() in struct tee_mediator_ops.
>=20
> An empty domain_teardown() callback is added to the OP-TEE mediator.
>=20
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Co-developed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

>=20
> ---
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Julien Grall <julien@xen.org>
> CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
> CC: Bertrand Marquis <bertrand.marquis@arm.com>
> CC: Jens Wiklander <jens.wiklander@linaro.org>
> ---
> xen/arch/arm/domain.c              | 36 ++++++++++++++++++++++++++++++
> xen/arch/arm/include/asm/tee/tee.h |  7 ++++++
> xen/arch/arm/tee/optee.c           |  6 +++++
> xen/arch/arm/tee/tee.c             |  8 +++++++
> 4 files changed, 57 insertions(+)
>=20
> diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> index 15d9709a97d2..18171decdc66 100644
> --- a/xen/arch/arm/domain.c
> +++ b/xen/arch/arm/domain.c
> @@ -795,6 +795,42 @@ fail:
>=20
> int arch_domain_teardown(struct domain *d)
> {
> +    int ret =3D 0;
> +
> +    BUG_ON(!d->is_dying);
> +
> +    /* See domain_teardown() for an explanation of all of this magic. */
> +    switch ( d->teardown.arch_val )
> +    {
> +#define PROGRESS(x)                             \
> +        d->teardown.arch_val =3D PROG_ ## x;      \
> +        fallthrough;                            \
> +    case PROG_ ## x
> +
> +        enum {
> +            PROG_none,
> +            PROG_tee,
> +            PROG_done,
> +        };
> +
> +    case PROG_none:
> +        BUILD_BUG_ON(PROG_none !=3D 0);
> +
> +    PROGRESS(tee):
> +        ret =3D tee_domain_teardown(d);
> +        if ( ret )
> +            return ret;
> +        break;
> +
> +    PROGRESS(done):
> +        break;
> +
> +#undef PROGRESS
> +
> +    default:
> +        BUG();
> +    }
> +
>     return 0;
> }
>=20
> diff --git a/xen/arch/arm/include/asm/tee/tee.h b/xen/arch/arm/include/as=
m/tee/tee.h
> index f483986385c8..da324467e130 100644
> --- a/xen/arch/arm/include/asm/tee/tee.h
> +++ b/xen/arch/arm/include/asm/tee/tee.h
> @@ -34,6 +34,7 @@ struct tee_mediator_ops {
>      * guest and create own structures for the new domain.
>      */
>     int (*domain_init)(struct domain *d);
> +    int (*domain_teardown)(struct domain *d);
>=20
>     /*
>      * Called during domain destruction to relinquish resources used
> @@ -62,6 +63,7 @@ struct tee_mediator_desc {
>=20
> bool tee_handle_call(struct cpu_user_regs *regs);
> int tee_domain_init(struct domain *d, uint16_t tee_type);
> +int tee_domain_teardown(struct domain *d);
> int tee_relinquish_resources(struct domain *d);
> uint16_t tee_get_type(void);
>=20
> @@ -93,6 +95,11 @@ static inline int tee_relinquish_resources(struct doma=
in *d)
>     return 0;
> }
>=20
> +static inline int tee_domain_teardown(struct domain *d)
> +{
> +    return 0;
> +}
> +
> static inline uint16_t tee_get_type(void)
> {
>     return XEN_DOMCTL_CONFIG_TEE_NONE;
> diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
> index 301d205a36c5..c91bd7d5ac25 100644
> --- a/xen/arch/arm/tee/optee.c
> +++ b/xen/arch/arm/tee/optee.c
> @@ -268,6 +268,11 @@ static int optee_domain_init(struct domain *d)
>     return 0;
> }
>=20
> +static int optee_domain_teardown(struct domain *d)
> +{
> +    return 0;
> +}
> +
> static uint64_t regpair_to_uint64(register_t reg0, register_t reg1)
> {
>     return ((uint64_t)reg0 << 32) | (uint32_t)reg1;
> @@ -1732,6 +1737,7 @@ static const struct tee_mediator_ops optee_ops =3D
> {
>     .probe =3D optee_probe,
>     .domain_init =3D optee_domain_init,
> +    .domain_teardown =3D optee_domain_teardown,
>     .relinquish_resources =3D optee_relinquish_resources,
>     .handle_call =3D optee_handle_call,
> };
> diff --git a/xen/arch/arm/tee/tee.c b/xen/arch/arm/tee/tee.c
> index 3964a8a5cddf..ddd17506a9ff 100644
> --- a/xen/arch/arm/tee/tee.c
> +++ b/xen/arch/arm/tee/tee.c
> @@ -52,6 +52,14 @@ int tee_domain_init(struct domain *d, uint16_t tee_typ=
e)
>     return cur_mediator->ops->domain_init(d);
> }
>=20
> +int tee_domain_teardown(struct domain *d)
> +{
> +    if ( !cur_mediator )
> +        return 0;
> +
> +    return cur_mediator->ops->domain_teardown(d);
> +}
> +
> int tee_relinquish_resources(struct domain *d)
> {
>     if ( !cur_mediator )
> --=20
> 2.34.1
>=20



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 08:22:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 08:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562046.878593 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJV6n-0007V1-CF; Wed, 12 Jul 2023 08:22:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562046.878593; Wed, 12 Jul 2023 08:22:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJV6n-0007Uu-9A; Wed, 12 Jul 2023 08:22:01 +0000
Received: by outflank-mailman (input) for mailman id 562046;
 Wed, 12 Jul 2023 08:22:00 +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
 <SRS0=V3yk=C6=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qJV6l-0007Uo-Va
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 08:21:59 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2071.outbound.protection.outlook.com [40.107.7.71])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2a8d50d7-208d-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 10:21:57 +0200 (CEST)
Received: from DB9PR05CA0005.eurprd05.prod.outlook.com (2603:10a6:10:1da::10)
 by AS1PR08MB7513.eurprd08.prod.outlook.com (2603:10a6:20b:480::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Wed, 12 Jul
 2023 08:21:20 +0000
Received: from DBAEUR03FT009.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:1da:cafe::4d) by DB9PR05CA0005.outlook.office365.com
 (2603:10a6:10:1da::10) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20 via Frontend
 Transport; Wed, 12 Jul 2023 08:21:20 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT009.mail.protection.outlook.com (100.127.143.21) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.20 via Frontend Transport; Wed, 12 Jul 2023 08:21:20 +0000
Received: ("Tessian outbound ba2f3d95109c:v145");
 Wed, 12 Jul 2023 08:21:19 +0000
Received: from bb0a64eb8c33.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 E6F5E07E-8195-47A9-80DC-D7DEFE30E95F.1; 
 Wed, 12 Jul 2023 08:21:09 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id bb0a64eb8c33.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 12 Jul 2023 08:21:09 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by DU0PR08MB7485.eurprd08.prod.outlook.com (2603:10a6:10:355::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 08:21:01 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::eaec:5611:c427:57f7]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::eaec:5611:c427:57f7%4]) with mapi id 15.20.6565.028; Wed, 12 Jul 2023
 08:21:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2a8d50d7-208d-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=1BQLtuBQVS06nZf24d35MEfKsKWAB7NLQOm90mslWl4=;
 b=8rZiu6qKuz3k7Jcs82azTVL5jltJI5ZZQ+LQFXQMsENInH6m9R5owejKK6Cm92PYurkyh+csuPUDTP+tk8ogyghIQNZ2sMKXT6+l+DvvH6y2GDkStwV+1nN9u/+S9RHj2/JzOrNPSK/P8aSsonqXpQhl5A+9APHcMoPcjpCCAFQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 7d78cf0a40bea129
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hixYCzYVsmQUeTB9NXDAstK+CMCA8L+O+FyxQXkOZtZ2CRJrbJ8VvGIOzjxvKOXdiz7XSqeTSbM11qipJ5N0ZBDiSsEFUPk2PzPWuPME8M7UQ5YREDyM1HSI/Eda0VMrIG/vCC/F4dJZvwIG7sFGkxLCkLgVPMz6uxkvBGk+xVGkHRMCV/GUYsikTkcEYKuOaHd4H+6Qr7NmFUWNZBKoEtVbq7k1V07Ne/ydmrM+UI8zToGzXLJmmR5qvjRIBVD6v6eGcBNgRfet1cFSUyXPXwAzwLEjni+YAWB7dj2kho0/9dP2BjbTQhPuHmMPT75CZeGwjuVG+7yuDb9/DIzFPw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=1BQLtuBQVS06nZf24d35MEfKsKWAB7NLQOm90mslWl4=;
 b=CvqyB6qd0IV0y857b/6TzVRNnp9gCabQKlNrk1nV+U0aBYH3OCpCa26Hbh1AhQY8vulz9rFbMU50JKshK3HFjROmmENIGcLpfpt0PmoUo5CHRdC7Q1ob0W7MRrLV1U2y8qNzbG/dxNcTZAjTisI8y5rq3f8ydN3GPpT++wFexy+IItbvzhRcRNLQg90+FA7GDyWG15ghpPLoQfacYIPDXrpHW1JXz4A+xYxqM4ATFqgESRRp7aZ3eyj0blReeMhoRhJkMzZuBBNWrMU1hr7MUPo4YTSTOH6FkFWsIyYGMJTvHZXDdZAvmTsWW9wkA+6Fe3lvJi4H0SlW6jz/OmF56A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=1BQLtuBQVS06nZf24d35MEfKsKWAB7NLQOm90mslWl4=;
 b=8rZiu6qKuz3k7Jcs82azTVL5jltJI5ZZQ+LQFXQMsENInH6m9R5owejKK6Cm92PYurkyh+csuPUDTP+tk8ogyghIQNZ2sMKXT6+l+DvvH6y2GDkStwV+1nN9u/+S9RHj2/JzOrNPSK/P8aSsonqXpQhl5A+9APHcMoPcjpCCAFQ=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Stefano Stabellini <sstabellini@kernel.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Jan Beulich
	<jbeulich@suse.com>, "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
	"roger.pau@citrix.com" <roger.pau@citrix.com>, "julien@xen.org"
	<julien@xen.org>, "george.dunlap@citrix.com" <george.dunlap@citrix.com>,
	Bertrand Marquis <Bertrand.Marquis@arm.com>, Stefano Stabellini
	<stefano.stabellini@amd.com>
Subject: Re: [PATCH] docs/misra: add Rule 9.3
Thread-Topic: [PATCH] docs/misra: add Rule 9.3
Thread-Index: AQHZtDVnm2uoBPIrqkmByEz++gKzmq+1yx6A
Date: Wed, 12 Jul 2023 08:21:01 +0000
Message-ID: <AD59BC9A-B2A4-47D7-A010-2FBF08DA3840@arm.com>
References: <20230711202145.2334563-1-sstabellini@kernel.org>
In-Reply-To: <20230711202145.2334563-1-sstabellini@kernel.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|DU0PR08MB7485:EE_|DBAEUR03FT009:EE_|AS1PR08MB7513:EE_
X-MS-Office365-Filtering-Correlation-Id: a34aa621-1ebc-4a77-208d-08db82b0f8b4
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 Pck7B0wbI7K5SNifbo5SSX3NVR9wGZFWC5Z/dURdErM4ydFTj12vxstLWvOwpok7vPYQhFxFm8RA/O63mJ4Ccde1aifFv2YMvZwEIuw4iZdfNwMTbehBaENfF1tdOLjUQFgXJCPoDSoxoavr0bUT53rf/YxSaYyt9HN368RJuBUInjINIs1DDgWQIH9dLXFnQwq4VVad6Zd+wVNiPBf3x1ZZDxQN2YL+vKXAlNS1492VL97iae2Q880EJuHRJI2kXgwmpgX1Fc4R8wl86jpr42eqQAZrKx6l2wWBY8FusiPfpX7zWrZ3Kofl/2m47Frn2z4uzkHFi9pQm5okvhvQr4Bs4hVDBktuJInX3y4PmV9dZFS9ELDMBkWwiIUDBLd5T3pviGwZsjW0o4E91vkC7JhkgSHbWTfb6FxsIqHbNvmWjE/vo1yOc68usy2uZ1SVH3KetoVKOTru/F98GCgjPc7W7kb6ZOfNToiYO69tQ4HPETd9wFHPf2fAGwCyav8mOs1+m3lvKdtjLwEamehQjPrkoL9Luu56XreTgE9QpQqNWPAsd9eDiJK/APtqTkT96Xfa97hZ0/K9JDnkHtC/8hqC0nqBYdEw/XMtQL3p31mF0XjA+zK192Zf56CT8bN4fUmcvV4OLM8i14afdJaFry9asUeixZl59VXLrk1Cca2dTCelq/Tr2tZ8FNXG9B9t
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(136003)(396003)(346002)(376002)(39860400002)(451199021)(6486002)(6512007)(71200400001)(33656002)(26005)(53546011)(6506007)(36756003)(186003)(2616005)(38070700005)(86362001)(38100700002)(122000001)(6916009)(76116006)(91956017)(4326008)(66946007)(66556008)(66476007)(66446008)(64756008)(41300700001)(4744005)(2906002)(316002)(8676002)(8936002)(5660300002)(54906003)(478600001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <527F2F4B96AB4D4895037BFD34784AB1@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7485
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT009.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	b09dd652-082f-4158-c5fb-08db82b0edb1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	8h72ZvGySpmg6f3zGpQhU75PypAF+qjFb/1sZ4yBGoK0hdZeWT15A9IVtF8JX0V0Hwi0w3UR14gMGnrl3wcZPvlay3jlYL1tar61/lD05tPlPEE6einW1TnSO1pp1ZGPLGlTztV2RReKVjBkePT0kx8+1Hl7bhbWGSbrWyaJRt+v9bs04WOd5+1uU7Yh6gBjmTjwmDD3COcYRIjSJvO5OlOk46zTcAUEA4BjwwafS/m8qoAiR85NOE+kOmMl576FgMTJ4JFeV8+2VMpWezG2ZyyBSuBlWmEDPg/j7kIidXg+KNBHJB5wz855noiQbVlT19lZ9V9gEL2W/mnjQInDQTggIwKsA1tcpL7DsZ+a8Nc8bbHpo6qbRa940h3FBBpu+meqAKAmt/zvQyTYyhNzk/uu1FirD/bOgWeGWPQZjD57QduZ38QBoCaCpOnwUZEf8feO8x5uspFrBjP3e8TiQ9DYm79Mp68+qLnLEQ4XH7ms6Y0Xa0YNdocTDAH2uu84hMBMERiA4h/FujenJrb2MSYU9OrJg6qgO3K3W5bkUWB2BhGfBope1PLg7f9at8z0e0eG2+3abSSwuvC06QczXbTjnYX4S0NqJfx3tldr2Rqp9iiU2Al5Sai778LifbBRFu9FLEPX299Ai6Xc92c+eromQK8osJwxWEDTpIQoU+wQmbkomPq8RNCqgRqLZlcP3W8ce+PL1gzORHrfMZHeAY5Gm8Xkn/cMLIQowv2aUxKC5f7ECvAwFAGtWobaWmqaDj0oHEcNY+Se8k1h9aEHfQ==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(396003)(346002)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(6486002)(40460700003)(478600001)(81166007)(54906003)(356005)(82740400003)(8936002)(8676002)(36756003)(2906002)(6862004)(5660300002)(33656002)(86362001)(82310400005)(4326008)(70206006)(40480700001)(316002)(70586007)(41300700001)(36860700001)(26005)(53546011)(6506007)(336012)(47076005)(186003)(2616005)(6512007);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 08:21:20.1466
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: a34aa621-1ebc-4a77-208d-08db82b0f8b4
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT009.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR08MB7513

DQoNCj4gT24gMTEgSnVsIDIwMjMsIGF0IDIxOjIxLCBTdGVmYW5vIFN0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JyYXlzIHNoYWxsIG5vdCBiZSBwYXJ0aWFsbHkgaW5pdGlhbGl6ZWQNCj4g
KyAgICAgLSB7fSBpcyBhbHNvIGFsbG93ZWQgdG8gc3BlY2lmeSBleHBsaWNpdCB6ZXJvLWluaXRp
YWxpemF0aW9uDQoNCk5vdCByZWxhdGVkIHRvIHRoaXMgcGF0Y2gsIGJ1dCBob3cgaXMgdGhlIGNv
ZGluZyBzdHlsZSBmb3IgdGhpcz8gSXMgaXQge30gd2l0aG91dCBzcGFjZXMgb3IgeyB9IHdpdGgg
b25lIHNwYWNlPw0KSXTigJlzIG5vdCBzcGVjaWZpZWQgaW4gdGhlIGNvZGluZyBzdHlsZQ0KDQoN
Cj4gKw0KPiAgICAqIC0gYFJ1bGUgOS40IDxodHRwczovL2dpdGxhYi5jb20vTUlTUkEvTUlTUkEt
Qy9NSVNSQS1DLTIwMTIvRXhhbXBsZS1TdWl0ZS8tL2Jsb2IvbWFzdGVyL1JfMDlfMDQuYz5gXw0K
PiAgICAgIC0gUmVxdWlyZWQNCj4gICAgICAtIEFuIGVsZW1lbnQgb2YgYW4gb2JqZWN0IHNoYWxs
IG5vdCBiZSBpbml0aWFsaXplZCBtb3JlIHRoYW4gb25jZQ0KPiAtLSANCj4gMi4yNS4xDQo+IA0K
PiANCg0K


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 08:26:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 08:26:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562050.878602 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJVBU-00088Y-Vu; Wed, 12 Jul 2023 08:26:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562050.878602; Wed, 12 Jul 2023 08:26:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJVBU-00088R-Sb; Wed, 12 Jul 2023 08:26:52 +0000
Received: by outflank-mailman (input) for mailman id 562050;
 Wed, 12 Jul 2023 08:26:51 +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
 <SRS0=Mhes=C6=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qJVBT-00088L-Lr
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 08:26:51 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0617.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::617])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d856e161-208d-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 10:26:49 +0200 (CEST)
Received: from DB3PR08CA0033.eurprd08.prod.outlook.com (2603:10a6:8::46) by
 PR3PR08MB5740.eurprd08.prod.outlook.com (2603:10a6:102:87::5) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.20; Wed, 12 Jul 2023 08:26:43 +0000
Received: from DBAEUR03FT050.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:8:0:cafe::e8) by DB3PR08CA0033.outlook.office365.com
 (2603:10a6:8::46) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.22 via Frontend
 Transport; Wed, 12 Jul 2023 08:26:43 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT050.mail.protection.outlook.com (100.127.142.250) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.20 via Frontend Transport; Wed, 12 Jul 2023 08:26:42 +0000
Received: ("Tessian outbound d7adc65d10b4:v145");
 Wed, 12 Jul 2023 08:26:42 +0000
Received: from e93874af4946.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 F1AB98FE-B333-490D-A544-764E0D3058E0.1; 
 Wed, 12 Jul 2023 08:26:36 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e93874af4946.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 12 Jul 2023 08:26:36 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by PAWPR08MB9736.eurprd08.prod.outlook.com (2603:10a6:102:2ea::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Wed, 12 Jul
 2023 08:26:32 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::488c:5182:718d:7759]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::488c:5182:718d:7759%4]) with mapi id 15.20.6588.017; Wed, 12 Jul 2023
 08:26:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d856e161-208d-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/fdltWaRaZ3Qd0pr9Pl71uUsm0vggxSmJCiXLHjsZOE=;
 b=uVa+MgTyINWUhLK1R6Z74mI22+EGbVYYTSbHBW0cWyHWR1SSYnXxBrSKYOEVWzzZSQj+RguwQn/30Iq9E7DDtejRvY493wJdBFrqc9B6DuH3hUdq1GivNwrqMxvDs8MmmlmyVIKXX/38M9EtxDu2IT4JY7czIMU+60wq/tIYWBI=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 23ed87bb55ad49c9
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=imr9aj5WcY+HdeDTt0vfkcz15RKo6/87Pmy+K5aJltwOU6XZuGJ8u1newIq/e82HFvXbXKNGMx4ODBi6wJAC08BqETJoQowOaAJG/7mwB9VnTC5ir+mvkkVoru8cfBqfYKNLSti5OeiZh/YTKVEU4bLxpYiof9N3TaxtWGbRsieFP4kMjYmuKHc3+7KC3EUsH7QLJcF2jg8PtmbBeTNE9dP7K2NDDcin1M3xdcuHIr2nfJrZmevwbSc/3TyZBxxUkwcKgs1gT28boqsv1sM2/mlkEph3RSSgktcBT52kKVWZMHK99h7AWWLjaJbda3NAE/+VC/EwRvHMJ18Fr/JAOw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/fdltWaRaZ3Qd0pr9Pl71uUsm0vggxSmJCiXLHjsZOE=;
 b=CPdcICXt7aAKQ3+01FbFUVVVjAZcPA0w9w+Ojwxz7zPx9YAgDTgCU7A98GlNIfvJsUARIIm/af00mttcnt61ozyXHPqzhkXZ44zmZ59yA9vA3Lrfk9lqMpaV3HnlhXJEUDDMlt7HgXcRBAfnzaoosVUlIHWlLclt0pJvIuCuHEcJLFJRDZtuPd9k11ghE/SoYj40UhlbFzVeIaOF3kSEg/wEqdeaGbreqJcyuFWK2ik0bwFy4PLv9Gw0mz9jqhPpQcw917n8T1DpS4PngtFUijDudJBDNw+l5u6lw9FtqY3DIk22rIHw1On6uSciaeeUkANWpiFcRJpi8W/r5U1bow==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/fdltWaRaZ3Qd0pr9Pl71uUsm0vggxSmJCiXLHjsZOE=;
 b=uVa+MgTyINWUhLK1R6Z74mI22+EGbVYYTSbHBW0cWyHWR1SSYnXxBrSKYOEVWzzZSQj+RguwQn/30Iq9E7DDtejRvY493wJdBFrqc9B6DuH3hUdq1GivNwrqMxvDs8MmmlmyVIKXX/38M9EtxDu2IT4JY7czIMU+60wq/tIYWBI=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Peter Hoyes <Peter.Hoyes@arm.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Wei Chen <Wei.Chen@arm.com>,
	Luca Fancellu <Luca.Fancellu@arm.com>, Wei Liu <wl@xen.org>, Anthony PERARD
	<anthony.perard@citrix.com>, Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v4 0/2] Add escape character argument to Xen console
Thread-Topic: [PATCH v4 0/2] Add escape character argument to Xen console
Thread-Index: AQHZtJOZfmsm6IPK4UC9HWuyh33zD6+1y+0A
Date: Wed, 12 Jul 2023 08:26:32 +0000
Message-ID: <9CDCE950-D826-424C-8BBD-ED2B8630DF61@arm.com>
References: <20230712073556.14719-1-peter.hoyes@arm.com>
In-Reply-To: <20230712073556.14719-1-peter.hoyes@arm.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|PAWPR08MB9736:EE_|DBAEUR03FT050:EE_|PR3PR08MB5740:EE_
X-MS-Office365-Filtering-Correlation-Id: d24e1ebb-48e7-49b8-1746-08db82b1b913
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 fqgSCEXCb1UOoX9l6sG9zUbyKUaSoaxtIQBvAgttcG+iB200/sHjoD94jGy2RhE1nnEuxsNlZKlR3EMBfpILKtu5TF7q1htVUTp4rCgYUtOp9EJRT99xyCDQoEOlnfUEoKbDx0ZKdWUCRWMJ3WoQ4tQSIXGtJHzPM2M5kgSgJJGEHx6Zy22MxGJOMznQ5BwseBLEjX9jEOodxO4IQiwkdPCCfvRBFGnYgsYB5NnnimzuIEasKoNmSsdjBTmPRll1hFMUlAx4tizyXebNjQIhaS9mT2RO4nH1ywPbdveRnK/8NYbV3XNyjT0Tp9gzevhxltinZcucJHNEGhxc/b1NKXtil8/DxDTUIJZWfgZQdRMmeUj+HkvQrIQLWoVmfAdjVwULveMbxo9cdxhWTLD8XHf1DKyPH/MmEkArUHXcppN1IEUY0V56f2UsH+Kd//iQCHw1zVRApbCGa8AC5RZm6AlScNWFEdB9YU/iMA9Twtk8wfNN7JX4pc9wmqew6Vx/49mvZ1YwN/7MhRNHa2uiETFRnF1otVPmVH1VlHBmjJyfUGUmV5wDDFoOG5hnWuZbB56qutYkglxTj2noGkTkN2p1iGivpECxQv3sJTNC7haUrDp/pnv3H+AmRVLEzCwWRECZNPYUiWvkaXNaVyGK5UzCyyeDYJLBSSGdBhAKGXY=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(366004)(376002)(136003)(396003)(346002)(451199021)(38100700002)(38070700005)(86362001)(36756003)(71200400001)(6486002)(76116006)(54906003)(37006003)(91956017)(66946007)(33656002)(122000001)(2616005)(6506007)(186003)(6512007)(53546011)(2906002)(66476007)(5660300002)(64756008)(66446008)(66556008)(8676002)(6862004)(8936002)(478600001)(4326008)(83380400001)(6636002)(316002)(41300700001)(21314003)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <BBFC81F235C99443AA80C76C888E2EB7@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9736
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT050.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	83d8d7ea-ba45-4bf7-b816-08db82b1b2ff
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	0f4Oywd3iLPzhAYqsVH2tegdEjlsqoR8Ag61ldA00rpOzYtMVZKuO6k5v8tHBa0ogwyHNfpwA0f3K/0tgeyAeNiyUDjqCPUz8W14bpcX6pCxxJgKBcCiB7pChDmRQ7TH3lEvv0azQDmqOZQPQFay5yFRSe0eHW1QDrH38t+2Spuxkj0u7gmiMcBRRs2/Tzcu3b2SLAGNRNvQ8s7WJC/my4US2xKUkEWeUFuTSWpEHtTWOv7NbwzQycj43XFiNu8370GAJ2YMop2pA/avTABhLpUKk37alClc21ibldMaT+P5ZbqafDI1czq6ziMFF5uoQhiPl9tAYCfYN5Ct5K+xCxRLhL6pkfw+FyYCT/FUgl5Fs7dqWJVDgUXl1tPuMaXNb+ubG8uvh9KIy9FFlN73xMGM9Tv6+DtH4YtNVt8h2+d6jUnaPJo79jKNsoP2jc8OtICLDQFkPWTTZekIVF458Kw1dYwvnX9eawBFAAUrQMNJk1TmtmA/TEruDYOG5JAZYEaex6YSiJcxQw5GaKgFFHSmR0LCEKdFakgMnWfGFePFvKtaTWkbWHXkYQmJBrcguiYLNbSS2adJIx4NKbk3DLQAzHLIIDtmnEiUYkH6DA+IgDCEY1pUuQoWR75cm+AGlxY1f2nvRDFTssxU1G8At+Wq82+unQGpJgA0CV7gtBAZrDjeFQzgjeQbIpCQP39GIWLVTy0ce5eiwAKwGZLUe40NEX9Ir1dRV/MXphknfW58oDtsqbnB7KPTZMYg5mYaEi3fuirLIBk/sz0lIlFzFg==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(396003)(136003)(346002)(451199021)(40470700004)(46966006)(36840700001)(70206006)(70586007)(6636002)(4326008)(36860700001)(40460700003)(478600001)(36756003)(37006003)(54906003)(40480700001)(86362001)(336012)(107886003)(26005)(6506007)(186003)(53546011)(33656002)(6512007)(6486002)(47076005)(83380400001)(82310400005)(82740400003)(81166007)(356005)(41300700001)(2616005)(6862004)(8936002)(8676002)(316002)(2906002)(5660300002)(21314003);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 08:26:42.8915
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d24e1ebb-48e7-49b8-1746-08db82b1b913
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT050.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5740

Hi Peter,

> On 12 Jul 2023, at 09:35, Peter Hoyes <Peter.Hoyes@arm.com> wrote:
>=20
> From: Peter Hoyes <Peter.Hoyes@arm.com>
>=20
> Dom0 may be accessed via telnet, meaning the default escape character
> (which is the same as telnet's) cannot be directly used to exit the
> console. It would be helpful to make the escape character customizable
> in such use cases, falling back to the existing=20
>=20
> Make the necessary changes to the console client, libxl and the xl
> console sub-command to support this.
>=20
> Changes in v4:
> * Update xl docs
> * Add necessary changes for libxl API version compatibility
> * Improve escape sequence argument validation
>=20
> Peter Hoyes (2):
>  tools/console: Add escape argument to configure escape character
>  xl: Add escape character argument to xl console

In the patches you did not add a change log to get what has been modified
between versions of the serie.
This is making it a bit harder to diff review.

Could you resent your serie and add a change log:
--
Changes in v4:
- xxx
- xxx

Changes in v3:
- xxx

...etc

Thanks

Cheers
Bertrand

>=20
> docs/man/xl.1.pod.in             |  8 ++++++-
> tools/console/client/main.c      | 21 +++++++++++++----
> tools/include/libxl.h            | 39 +++++++++++++++++++++++++++++---
> tools/libs/light/libxl_console.c | 30 +++++++++++++++++-------
> tools/xl/xl_cmdtable.c           |  3 ++-
> tools/xl/xl_console.c            | 10 +++++---
> tools/xl/xl_vmcontrol.c          |  2 +-
> 7 files changed, 92 insertions(+), 21 deletions(-)
>=20
> --=20
> 2.34.1
>=20



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 08:32:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 08:32:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562061.878613 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJVGN-00019u-IW; Wed, 12 Jul 2023 08:31:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562061.878613; Wed, 12 Jul 2023 08:31:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJVGN-00019n-Fq; Wed, 12 Jul 2023 08:31:55 +0000
Received: by outflank-mailman (input) for mailman id 562061;
 Wed, 12 Jul 2023 08:31:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=EdEw=C6=citrix.com=prvs=550563963=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qJVGM-000192-Ps
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 08:31:54 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8b56e35d-208e-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 10:31:53 +0200 (CEST)
Received: from mail-dm6nam12lp2169.outbound.protection.outlook.com (HELO
 NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.169])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 12 Jul 2023 04:31:45 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by MW4PR03MB6537.namprd03.prod.outlook.com (2603:10b6:303:124::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.19; Wed, 12 Jul
 2023 08:31:42 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::f3c4:948d:a70a:de2a]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::f3c4:948d:a70a:de2a%5]) with mapi id 15.20.6565.028; Wed, 12 Jul 2023
 08:31:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8b56e35d-208e-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689150712;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=YKGLG1iV3KvOHMAwM/lp/+QBoeezRlpFqOrsq0LKU8U=;
  b=ZdRl9bV2AaY2EBEheGISEYT/PhE9J2J7YU2RoRnJdLbWz1IGjBhs43Zs
   DHGR9xGsK9x+fdHkLyRqBnq0WQr2KFcz/pZ4qBLruqkkS87eTSfguRuCB
   3d9KhF4DyryplnU9AHGT3q/lPJhU8miNh0kQ5EnUpjTV2mw72OtIQSXZN
   8=;
X-IronPort-RemoteIP: 104.47.59.169
X-IronPort-MID: 115811936
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:bYsrgKLiX49OClTTFE+RnpUlxSXFcZb7ZxGr2PjKsXjdYENShWBTx
 mQaC2iFOv3Za2anLYpza9yz/UtSsJPcnYcwSAZlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws
 Jb5rta31GWNglaYCUpKrfrawP9TlK6q4mhA4QVkPaojUGL2zBH5MrpOfcldEFOgKmVkNrbSb
 /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/
 jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5+WE8W+
 +U0dAsUTT+8q8G6zLKLaOxF05FLwMnDZOvzu1lG5BSAV7MKZM6GRK/Ho9hFwD03m8ZCW+7EY
 NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/dmpTGNnWSd05C0WDbRUvWMSd9YgQCzo
 WXe8n6iKhobKMae2XyO9XfEaurnxHqmCNtLRebmnhJsqFed2UUrU0c3bgaypcO9sXO1Cvt5d
 kNBr0LCqoB3riRHVOLVXRC+uzibvx0YUtxcHvcS7ACLw7DTpQGDCQAsXjNHLdArqsIybTgrz
 UOS2cPkAyR1t7+YQm7b8a2bxRupIjQcJ2IGYS4CTCMG7sPlrYV1iQjAJv5hDaq0g9vdCTz2h
 TeQo0AWubIXisIa0rShynrOiTmsu5vhQxY840PcWWfNxil0fpK/boqkr33S9+9dLZ2xR0OE+
 nMDnqC27u8UCoqWvDeQW+hLF7asj96aNBXMjFgpGIMunxyo8mSoO4pX5jd/L0ZBO9wBPzTuZ
 Sf7sAhR5ZkVM2aycaZfapi0Tc8tyMDd+c/NU/nVap9CZ8Z3fQrepiV2PxfOjibqjVQmlrw5N
 dGDa8GwAH0GCKNhij2rW+Ma1rxtzSc7rY/Oea3GI92c+eL2TBaopX0tYDNisshRAHu4nTjo
IronPort-HdrOrdr: A9a23:efhKEaHAaDAJPZlCpLqELseALOsnbusQ8zAXP0AYc20yTiW9rb
 HToB17726ItN91Yh0dcL+7Scy9qB/nhPpICMwqTMiftUrdyRiVxeJZnPHfKl/balXDH7VmpN
 ddmsFFYbWaZzUb/KWKgjVQUexQu+Vvm5rY/Ns2oU0dKj2CjZsA0+5/MGim+0tNKzVuNN4cHJ
 qY5s1I4x+hY2l/VLXIOpAcZZmzmzTUruOZXSI7
X-Talos-CUID: 9a23:TxWxA299q/tcYzod9TeVv0dNNJgra1GB927zDHCUKmplSI23THbFrQ==
X-Talos-MUID: =?us-ascii?q?9a23=3AeNty0w0bxmnrIlsIif2TMply1zUj6aqxIXhWy7Q?=
 =?us-ascii?q?95sCADyhLBjzMpRLqTdpy?=
X-IronPort-AV: E=Sophos;i="6.01,199,1684814400"; 
   d="scan'208";a="115811936"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=nesiVjjz9T67/8sL+qW+m1QuqEg/SpbagNCOiX2OnNn7lGRPBBU6BKDBq2WzUp8pN+GNKnbGBBqaCdPxcbZmtu9fSQlZVJPNuBj/wd4yZtpammseqd1OGZ0sJCkD9GzUu5gKAeV4FKvq64935zimekMEBEZ0Fg4rEPEIlJeNzWVR8v5uPxbPPECMPEkeVD9oCMw1ickAI8b0go1BB0d3cpInT53rgmSKdCj2OKivqy2GvwRoqRlnP2GzKr6B1LS4shtplxJjBNFWPMG9x/jhyFkngP6/baMywsWqtM1LrHKGZjK99t/MZZJ1rT0JHKdzYgW/1I3quixzXaqiAotViA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yiHAcxPrPiVdJ2KScPsOSAUGvxMRX9irUEVSjSMsD5Q=;
 b=ltOnyxAz/Fz85C1w/y2/iO1xiDJuUJjDLYyS8EnlKDzgK20jgu+tIvvSx7N8K/RuZhj+uAsM9sU8CXuqena5Ip+9xfYesoi4DrATqFa4fITWOjUybYmu6V2B6SmeXnhloGLn4wr1SYL3oGkcbgpUs/GJKgYCX7b6bKTDlQd0Db48tt0sdfgJEKCUTRe3AaIP7oI/2oNvFwbLMV29OLwHqdEack6FNrWhIBAxwqyIlDJkFUBagRX9fn82QZCyOoUupF7MBVxmEtBEqDwThWJyNBjiPYE+09RAdtM7fp1EomNW5qC9yHDjk33aQDwywh/YCqYUvlz/F4/2MGn6urtPmQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yiHAcxPrPiVdJ2KScPsOSAUGvxMRX9irUEVSjSMsD5Q=;
 b=Lc4H6vuXldNj8phNZQrZEeH8Oiou4B+0rZzGPnCd6QVuZ+Bx41K7n7WQMsK5a9dAtO5XMX7dcoHqF1Us8bnKpLFukM04nC+UFR6Su8k+S5kF1bqc5UKu5f3EMorbXaeOgmc4zmbQHJM3hSKB908endApxofqzlqbknT/w6n762o=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <826c2ff0-79d3-9544-5ce3-7f49905a353c@citrix.com>
Date: Wed, 12 Jul 2023 09:31:35 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [XEN PATCH v9 02/24] xen/arm: add TEE teardown to
 arch_domain_teardown()
Content-Language: en-GB
To: Jens Wiklander <jens.wiklander@linaro.org>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand.Marquis@arm.com, Anthony PERARD <anthony.perard@citrix.com>,
 Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>,
 Marc Bonnici <marc.bonnici@arm.com>, Achin Gupta <achin.gupta@arm.com>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
 <20230705093433.2514898-3-jens.wiklander@linaro.org>
In-Reply-To: <20230705093433.2514898-3-jens.wiklander@linaro.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0630.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:294::13) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|MW4PR03MB6537:EE_
X-MS-Office365-Filtering-Correlation-Id: a7746e58-443e-4ec6-6154-08db82b26b0e
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	OgSBwl99MR4nNNf+lFGblmfVfCZk7E1C/H6GTFwmc2L5HYUBALN9szkeH7Bw9PqiFG/hFX8DNTZ7OgOm2qQhXTmTot7L5DzXn4qCapWpwl3eQswUtgZOmjwQOf0MeGwZdfms8bXDhCiLY8bmAPdG0q3IwR2XDqVrKo7bTszld7uar0NAjj0T13va9RGi/HMy1PVv7FCTMobEV8xSC7JeL6+rpbNPT/vryTAorblR0i7N/npyxTVOi9/hv0P3BjTgWy7C0Ts36VDnjn8I6rFkJY7XWN1RNJFEiyl80IenafGO8L3wZgnLDTV8BT4sESIjy6MFW7dqGTlN+bg9nHfnv0yMPSTDx1qi0SxaUFmWsWR9/rBJ6o8j+9bHopzB3WKuYr2JCy4LXI34Xs7pU7lYATYeQ/pXOzeAARmfeRu1AxK5WjjG1PrpUC5+F/per1/OR6z+i0iEJPM/ATvWq0M5caoRHvwTMJ5Kxr3BZ3TF9LxqMbUl6YYKHxrS5QTKHqORnIE1qrYdlAiXDom6fiuGlYGwa1vT3zFh+9E3a+dVHw/URk1vSEQ2/eyBSyyv8enG2rbpGoRdUeaImUT7jYG7GZlvOaCQ8zPa7eEYnXRiCETSXoOf2p7dzqhwgi81a3U3szCHDYkpfds/f+XuCJ5aag==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(136003)(39860400002)(346002)(366004)(451199021)(86362001)(53546011)(82960400001)(31686004)(54906003)(8936002)(8676002)(7416002)(5660300002)(31696002)(478600001)(6506007)(66476007)(26005)(4326008)(66946007)(316002)(41300700001)(6666004)(66556008)(6486002)(186003)(6512007)(2616005)(2906002)(36756003)(38100700002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Ex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IRBQ0Y8/YtgHeIi33yrsy6rOkQfcJgPA4YDxJC3QVoiWsNghI9D6LNrtcx0RwNZeHxLXNBt2PaqQ29GjOgRbxF7EFZY8NZqq9axazkpe0+pz6xGm9UTAH2iI/KYXG7SQix22uT/qfMaA0cogMRiudpZ4wcaAjGfP5v7EHPgCbqA1M0OynHQpH9LdsMA1vFUz/SlUbq08k78cYGUhdWIoi1g0GwBI1fRLdRPqlmYVWTEakbi6a87eBNPQ32Ph9UUJ/lb801RX+Unjz1RyqySmVybNvhXBt/VapJs0TwTNPhtV15M5AKqu8WnzSENm1JWAiLDXZgj2hWpmFtjFdSw/EGdGoCR1FpYG5sDw6o52Z1ECvYzinG8rOlTnH1bXF8e49L2IgRc+C4sD22qfu+/FLdj9KW7maieP3fOFPNyokApW5tSAwzebLAENewaP7ZpdVOw1d7745S7BJ0izs1ILqksGhbn+JIx3vLCVfSukfgI0Zkf2ab3SbPUt9ZTA8B7nmwvD3gacvTHC/qYJKpgrCzjfIRugy0no+XocnU3+o3+rp/h0d99jyxqk=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a7746e58-443e-4ec6-6154-08db82b26b0e
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 08:31:41.8528
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: +ReHYMYs3UAVldQmmh3YgDoPt6JutFnrfEwQ+083Vuw+WdQYRwZ4qbKxM+AEpzF0nF18+Gl3AKQl7iYX0nNnkialE5Q6OuzTT+73UaMy7bU=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR03MB6537

On 05/07/2023 10:34 am, Jens Wiklander wrote:
> diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> index 15d9709a97d2..18171decdc66 100644
> --- a/xen/arch/arm/domain.c
> +++ b/xen/arch/arm/domain.c
> @@ -795,6 +795,42 @@ fail:
>  
>  int arch_domain_teardown(struct domain *d)
>  {
> +    int ret = 0;
> +
> +    BUG_ON(!d->is_dying);
> +
> +    /* See domain_teardown() for an explanation of all of this magic. */
> +    switch ( d->teardown.arch_val )
> +    {
> +#define PROGRESS(x)                             \
> +        d->teardown.arch_val = PROG_ ## x;      \
> +        fallthrough;                            \
> +    case PROG_ ## x
> +
> +        enum {
> +            PROG_none,
> +            PROG_tee,
> +            PROG_done,
> +        };
> +
> +    case PROG_none:
> +        BUILD_BUG_ON(PROG_none != 0);
> +
> +    PROGRESS(tee):
> +        ret = tee_domain_teardown(d);
> +        if ( ret )
> +            return ret;
> +        break;

This unconditional break isn't correct.

The logic functions right now (because upon hitting return 0, you don't
re-enter this function), but will cease working when you add a new
PROG_*, or when the calling code gets more complicated.

> +
> +    PROGRESS(done):
> +        break;

This needs to be the only break in the switch statement, for it to
behave in the intended manner.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 08:43:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 08:43:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562071.878622 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJVRc-0002kE-NG; Wed, 12 Jul 2023 08:43:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562071.878622; Wed, 12 Jul 2023 08:43:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJVRc-0002k7-KG; Wed, 12 Jul 2023 08:43:32 +0000
Received: by outflank-mailman (input) for mailman id 562071;
 Wed, 12 Jul 2023 08:43:31 +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 <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJVRb-0002k1-2E
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 08:43:31 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0627.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::627])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2c1b5743-2090-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 10:43:28 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by DB9PR04MB8252.eurprd04.prod.outlook.com (2603:10a6:10:24d::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 08:43:26 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 08:43:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2c1b5743-2090-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=EyLQR8Y23mGC8cxZ43TIgdK3tQP3bauws+rE4oABL65GoHy13QSy/EiEwjceKsUFvQbmFswhZIMaNgDJyn2x3ZetF1hMd+V8iyL3+OHFYP/q3nIQcqx0UgQ3FhFDcvT281CY9ri768W42CDm2z9zaLIb7LN5ahUGpKhaEFog5ZTQjvlN8sc6pQ4QBuxShkS4IX+ux4L3dg1wl3aaUSgiTJy6WB/8GKOnnBx4I2eqRqQOktAK6TJDC995vQW48fYMpyqY8dUWhKXwCaOdCO6M+3/nGWi9eoSQpiO1KjIpHnhcI89hchQEmfbsRF//HiE5HeqZW2MWc6aCtTfa0nHObQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=lEwDvcaOCnm9UrqJ8PkCJ38bVXRW5ABFzclgOM4IOzo=;
 b=m/GBOeXUjMfYUzh8jpQwtj1VKipNka2jOusGGON118RiYIyBMy0ZFihSZHzRCvmE2ATEwsBPndE+w1Zfk1gdYV2bvLd9rSdadOXC6QUAOcGJ355W40LtH7DJpEnNHAR2WVBW6rGS+Y8ViR1zV+dQeI8q1e6PMV7dfrLdiuKqJlqJ6EYfYgwI6itFkz7qPF2lVw8pA1R98bOGKaoVO0c8jUemR6poeEKOJpw8Th93GOeA9Fxy716EO2l5LOAKgmVyCfDPzhi1db4xPZ1UCrovuhXQfALVt2yNMvdo3v9wWLcp9haBoS8zCLjryjuFug7zLQgJyHGrLPCHJya0LsgmtA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=lEwDvcaOCnm9UrqJ8PkCJ38bVXRW5ABFzclgOM4IOzo=;
 b=zCS/CHL+f88dUEjxvd+zNoPniAEbjJeYookHqKL0xSS4lmtVTAtwcv5VpSpcoIdfddejFDIsVqq+xlLmvFNb8fxMiQYWYRzX9NAR4pikTuAIHSRg7pioeGTtOyDKe6CHs/cDcCBxSZ7mtBt8SvYyynEH6EzbA36lj8eAtECrlDAubcM7jNLWxoS+kSQk7XSnZC43TP2Hk9/LPLb84ldA4hpZ7mb1izFCf09MoS0StyAp/O9fWzwuL1jcBfkrZAXsUyBWo1MZprCLWFU0OO31YCKQfd1gta8ErXBxwYeVzlLvtShi5wTjN3f04aPqSohOmhblxvLDe4tO0y3npTZCzg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <f768b046-4e14-30b3-479b-bdcdebb4d397@suse.com>
Date: Wed, 12 Jul 2023 10:43:23 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v5 06/15] cpufreq: Add Hardware P-State (HWP) driver
Content-Language: en-US
To: Jason Andryuk <jandryuk@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20230706185440.48333-1-jandryuk@gmail.com>
 <20230706185440.48333-7-jandryuk@gmail.com>
 <eeeb032f-a21b-5eb2-e3d5-63357a04a500@suse.com>
 <CAKf6xptn0OL0qz+DW9qrwU=sFSKSp-O3S7z6vFbZp9RstFanbw@mail.gmail.com>
 <bfacee48-f640-f2eb-7fd7-f440ad03e612@suse.com>
 <CAKf6xpvVd49dx=CtGyPMt+NMuOfhJ4a1fiZb-O4e-guq9BwcFw@mail.gmail.com>
 <cdbaec77-9112-7b18-e9eb-fa12a16d2ccf@suse.com>
 <CAKf6xpspsyShp2O8SLK+=VQvxd=Uaewg-JHYAFPqEPmEWvDRAg@mail.gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <CAKf6xpspsyShp2O8SLK+=VQvxd=Uaewg-JHYAFPqEPmEWvDRAg@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0028.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:14::15) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DB9PR04MB8252:EE_
X-MS-Office365-Filtering-Correlation-Id: e60f0809-2987-408d-e25e-08db82b40eb2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	e/ZB0ujrkY38kvxVsBwewU/2aSasD2Od6C6M2E6qBcjSj2YN4o1V0pdIA1gNgWk6qqgUTL57BWk0UIqgKHiglXrw0EG9D6NkIsAPvwNGxCkcxZrX0aAnNH3zDBBZRliTslRrxE9XSAYm1gRzVUAmY72YUxVQ3Iq92nlOaWCA5SdMAa0zWVYApmeE3P9Lwo8kt4/KzMLzkzDU1d8br3LNCPXYlgK0BSxg67Ts/VvDRA/k3zrYETVFm+NVdk/hBU38m5y423Lpk2og1QrAj52Q0JG1DgnnIivsGMmzkxn4th616mlZFtfnrE0vRN6pVYzLT6vH2HwcWe5UQQJFcq9PUjvuS6HtD8TtyJIufIV7fz0ElAPO2uheZMdV+FQIkyo4B4/Ya1mGR4fw5hdnUhA2qv2J/amK22uQaJF9t7/rIsjbir1vQwboDK1Nv2Hx9yVYKC57w2IvUbE4jXdWOrryOqexqXM6xQq4IbF65IA/64ZcTDdK+u6p5vgljNMMRL2i6avSXkItT+gI52lqYaXKPYTI70+4dmbtjNsh1y45yWkEMTw5e1WLnA4uT5UfLhHsXYQ92ecnuwRg6lSioxXpd54DT2oFincPaTGgyAEFuNPvfkH2CeW1n8N1NTsEQVohFPjX4SoP4iGo639HyG8RSw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(136003)(376002)(366004)(396003)(39860400002)(451199021)(8936002)(8676002)(2616005)(38100700002)(41300700001)(2906002)(316002)(5660300002)(31686004)(66476007)(4326008)(6916009)(66556008)(66946007)(6486002)(6512007)(83380400001)(478600001)(36756003)(54906003)(6506007)(31696002)(53546011)(186003)(26005)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cDFzUU8vc3M3ZFVCY09PWGtvSXpxZDV6K1l1cmJ4b3pHRW1XanpBRC9qVWg4?=
 =?utf-8?B?NXhIek1kTVVJSERWTVVldUZFekxoUTVkY0Z0Y0ljTllHSlFDenA3ZVl1eXpG?=
 =?utf-8?B?YlovNC81bWtEVmN6YlhiWThDYVdmbzhxZG95NVJkOVQvL01XeFkvNEs4cU94?=
 =?utf-8?B?YTRJVXlYeVBSN2ZPUDR1M1dRRFp5MWQyVERKenBWNlIrUmd1WlNDcE1kenFD?=
 =?utf-8?B?Sjhwdzl2dHB3WWkxMFJ0S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TIrdjdMYU1wdWZiYlhhSytGQkhlYjRENHM4bkNhVm1KUTRua1BLSDZndnpS?=
 =?utf-8?B?NjVYTTN5ZW5vSFFNWnFSME5WTHhjR21YT0Erc3UzYVU0RG5rZXh1QmQwYXZw?=
 =?utf-8?Q?ZtarkWHmgaSaQZca/vZLZ3n8J?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e60f0809-2987-408d-e25e-08db82b40eb2
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 08:43:25.6389
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: CMC4X1hMJT7niZnp/jyrw0j/BoWDBr7VpCiVs5nvXpLHPaf9bhK9U+s3bhmbUSVjiYY/4CM0o3DPoDOqV3ombA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8252

On 11.07.2023 19:49, Jason Andryuk wrote:
> On Tue, Jul 11, 2023 at 10:41â€¯AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 11.07.2023 16:16, Jason Andryuk wrote:
>>> On Tue, Jul 11, 2023 at 4:18â€¯AM Jan Beulich <jbeulich@suse.com> wrote:
>>>> On 10.07.2023 17:22, Jason Andryuk wrote:
>>>>> On Mon, Jul 10, 2023 at 9:13â€¯AM Jan Beulich <jbeulich@suse.com> wrote:
>>>>>> On 06.07.2023 20:54, Jason Andryuk wrote:
>>>>>>> @@ -510,6 +510,22 @@ choice of `dom0-kernel` is deprecated and not supported by all Dom0 kernels.
>>>>>>>  * `<maxfreq>` and `<minfreq>` are integers which represent max and min processor frequencies
>>>>>>>    respectively.
>>>>>>>  * `verbose` option can be included as a string or also as `verbose=<integer>`
>>>>>>> +  for `xen`.  It is a boolean for `hwp`.
>>>>>>> +* `hwp` selects Hardware-Controlled Performance States (HWP) on supported Intel
>>>>>>> +  hardware.  HWP is a Skylake+ feature which provides better CPU power
>>>>>>> +  management.  The default is disabled.  If `hwp` is selected, but hardware
>>>>>>> +  support is not available, Xen will fallback to cpufreq=xen.
>>>>>>> +* `<hdc>` is a boolean to enable Hardware Duty Cycling (HDC).  HDC enables the
>>>>>>> +  processor to autonomously force physical package components into idle state.
>>>>>>> +  The default is enabled, but the option only applies when `hwp` is enabled.
>>>>>>> +
>>>>>>> +There is also support for `;`-separated fallback options:
>>>>>>> +`cpufreq=hwp,verbose;xen`.  This first tries `hwp` and falls back to `xen`
>>>>>>> +if unavailable.
>>>>>>
>>>>>> In the given example, does "verbose" also apply to the fallback case? If so,
>>>>>> perhaps better "cpufreq=hwp;xen,verbose", to eliminate that ambiguity?
>>>>>
>>>>> Yes, "verbose" is applied to both.  I can make the change.  I
>>>>> mentioned it in the commit message, but I'll mention it here as well.
>>>>
>>>> FTAOD my earlier comment implied that the spelling form you use above
>>>> should not even be accepted when parsing. I.e. it was not just about
>>>> the doc aspect.
>>>
>>> Oh.  So what exactly do you want then?
>>>
>>> There is a single cpufreq_verbose variable today that is set by either
>>> cpufreq=hwp,verbose or cpufreq=xen,verbose.  Is that okay, or should
>>> the "xen" and "hwp" each get a separate variable?
>>>
>>> Do you only want to allow a single trailing "verbose" to apply to all
>>> of cpufreq (cpufreq=$foo,verbose)?  Or do you want "verbose" to be
>>> only valid for "xen"?  Both cpufreq_cmdline_parse() and
>>> hwp_cmdline_parse() just loop over their options and don't care about
>>> order, even though the documentation lists verbose last.  Would you
>>> want "cpufreq=hwp,verbose,hdc" to fail to parse?
>>>
>>> All parsing is done upfront before knowing whether "xen" or "hwp" will
>>> be used as the cpufreq driver, so there is a trickiness for
>>> implementing "verbose" only for one option.  Similarly,
>>> "cpufreq=hwp,invalid;xen" will try "hwp" (but not "xen")  since the
>>> live variables are updated.  Even without this patch, cpufreq will be
>>> configured up to an invalid parameter.
>>
>> Right, and I'd like to see "hwp;xen" to be treated as a "unit", with
>> ",verbose" applying to whichever succeeds initializing. I don't think
>> there is much point to have separate verbosity variables.
> 
> When you say "hwp;xen" as a unit, you don't mean to intermix all the
> options like:
> cpufreq=hwp;xen:ondemand,hdc,maxfreq=42
> do you?
> 
> Because of the suboptions, I don't treat "hwp;xen" as a unit, but as
> strings separated by ';'.
> That allows the full selection of parameters like:
> cpufreq=hwc,no-hdc;xen:ondemand,maxfreq=42,minfreq=0
> 
> This lets each respective parser handle the options it knows about.
> This does duplicate "verbose" handling.  cpufreq_cmdline_parse() and
> hwp_cmdline_parse() are also usable when only one of "hwp" or "xen" is
> specified.
> 
> These all work:
> cpufreq=xen:ondemand,verbose
> cpufreq=hwp,hdc,verbose
> cpurfre=hwp,hdc;xen:ondemand,verbose
> 
> To disallow "verbose" in "cpufreq=hwp,verbose;xen" would require extra
> code, and setup_cpufreq_option() is already rather complicated IMO.
> It's a corner case, but doesn't seem harmful to me.   Hmmm, making the
> above fail parsing may be worse since it would only try "hwp" without
> a fallback to "xen".
> 
> I just want to be clear on exactly what I need to implement.

Maybe we need to take a step back a revisit what option forms actually
make sense to express. Part of the problem may be that we permit (but
not require afaics) the use of colon as a separator after the "main"
option ("xen", "none", "dom0-kernel", and perhaps now "hwp"). Such a
colon suggests that what follows are sub-options applicable to that
specific "main" option, especially since what follows "xen:" can be
more than just the governor name (and in fact no governor name is
required - I've been using cpufreq=xen:up_threshold=40 on some of my
systems, for example). I have to admit that I don't see a clean way
of (largely) retaining existing behavior while at the same time
avoiding ambiguity with your additions (and it may well be that there
is pre-existing ambiguity as well, but the introduction of yet
another separator [semicolon] clearly makes things worse in this
regard, as it suggests strong grouping).

Maybe we want to consider an alternative form of expressing the
fallback. What about e.g. "cpufreq=hwp:hdc(xen:ondemand),verbose"
(and its possible variations)?

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 08:49:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 08:49:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562078.878633 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJVWm-0003NX-AF; Wed, 12 Jul 2023 08:48:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562078.878633; Wed, 12 Jul 2023 08:48:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJVWm-0003NQ-7l; Wed, 12 Jul 2023 08:48:52 +0000
Received: by outflank-mailman (input) for mailman id 562078;
 Wed, 12 Jul 2023 08:48:51 +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
 <SRS0=rG2x=C6=linaro.org=viresh.kumar@srs-se1.protection.inumbo.net>)
 id 1qJVWl-0003NI-2e
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 08:48:51 +0000
Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com
 [2607:f8b0:4864:20::32c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e8d8e6bf-2090-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 10:48:45 +0200 (CEST)
Received: by mail-ot1-x32c.google.com with SMTP id
 46e09a7af769-6b8decf09e1so5894752a34.0
 for <xen-devel@lists.xenproject.org>; Wed, 12 Jul 2023 01:48:45 -0700 (PDT)
Received: from localhost ([122.172.87.195]) by smtp.gmail.com with ESMTPSA id
 z8-20020a17090ab10800b0025bf9e02e1bsm3117272pjq.51.2023.07.12.01.48.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 12 Jul 2023 01:48:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e8d8e6bf-2090-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689151724; x=1691743724;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=l4HOn91Gg0fSa/oaz9zR2150f7cgWOzRjLYl9EntuWs=;
        b=Nt41aEQ0KCvwe36xWiqfnuYBuZdqOqU25Ox6yRmaE4+hEM8XnnKfFKceOWDHMQRNfH
         1eDnm+TcjvnL/6oJR+izR0ceZmfdVD/Vy0uF7ZOXIRAPZTu88JG2B0wlYjlbP/e7izaQ
         f3liXqfKta7S23SYZ55iLmH/ykTRnvrb4e6/hk2rCqshYmo84ySbxZEWoSqZWXdE05ix
         83G5T2T0w0bekA/jjNkfbgeKsKVPD2L0n4DyLSkPq3rvwGWWm6/28BjjP9Cg/xIF31jW
         qCVH7cesYJAxzELIhyGKA8CmFIoMJolDx2Cr/MIU4c0T9drLMAFvYdauelaBUY4q1R1J
         EYag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689151724; x=1691743724;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=l4HOn91Gg0fSa/oaz9zR2150f7cgWOzRjLYl9EntuWs=;
        b=X7vXqAkrhOfV3b7oL5cXM+q6IKvs66Z6Xc1GhNeXIqVCmsYGxWj7RG6GbaUCXlOpm5
         lYq3wMZfW0azkRUOZIf/sFtYX7u9XckQAdwko0EyCfl5A9HueUD0nHqxXfzfnxA6ufsE
         5feeLLLQheSKHXQQ8b6EhQ7Gtd1Vx+pW0GlbA727XGP4c/Q3r4gC0gzhbimPRnQ+32gn
         yo+ZoVLrBQlLPbK4SnJEc8tAhRWweqY6igatsF+Z0/esl7J9UC6jr3OORwnymuFRFNc5
         rA1/FcRu702sAdvzmlo5AIznNCTCDXYKN/fmpBWtCyWG/Glr6xpnAxJSfgNN1kHLHNjM
         1TwQ==
X-Gm-Message-State: ABy/qLbefzQpG8sCNgoLNkRumKGS5DWAaBY5T9o+WBzcyYbUW/RoQrhG
	e+ZObY3QpuWezk6wq8rcX07/AA==
X-Google-Smtp-Source: APBJJlHfkBG47mx/uRxjQ46qhJBOJ2TibMQxQT3ZBpTh/lzn91h7cfAB4hBjo6t7UvuZwzAvvY4SQQ==
X-Received: by 2002:a05:6830:114:b0:6b9:862a:f308 with SMTP id i20-20020a056830011400b006b9862af308mr4974861otp.37.1689151724266;
        Wed, 12 Jul 2023 01:48:44 -0700 (PDT)
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	=?UTF-8?q?Alex=20Benn=C3=A9e?= <alex.bennee@linaro.org>,
	stratos-dev@op-lists.linaro.org,
	Erik Schilling <erik.schilling@linaro.org>,
	Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	xen-devel@lists.xenproject.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] xen: privcmd: Add support for irqfd
Date: Wed, 12 Jul 2023 14:18:33 +0530
Message-Id: <d4e0233524b8c7c48614b09cae4d23f2cdf10988.1689150266.git.viresh.kumar@linaro.org>
X-Mailer: git-send-email 2.31.1.272.g89b43f80a514
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Xen provides support for injecting interrupts to the guests via the
HYPERVISOR_dm_op() hypercall. The same is used by the Virtio based
device backend implementations, in an inefficient manner currently.

Generally, the Virtio backends are implemented to work with the Eventfd
based mechanism. In order to make such backends work with Xen, another
software layer needs to poll the Eventfds and raise an interrupt to the
guest using the Xen based mechanism. This results in an extra context
switch.

This is not a new problem in Linux though. It is present with other
hypervisors like KVM, etc. as well. The generic solution implemented in
the kernel for them is to provide an IOCTL call to pass the interrupt
details and eventfd, which lets the kernel take care of polling the
eventfd and raising of the interrupt, instead of handling this in user
space (which involves an extra context switch).

This patch adds support to inject a specific interrupt to guest using
the eventfd mechanism, by preventing the extra context switch.

Inspired by existing implementations for KVM, etc..

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/xen/privcmd.c      | 285 ++++++++++++++++++++++++++++++++++++-
 include/uapi/xen/privcmd.h |  14 ++
 2 files changed, 297 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index e2f580e30a86..e8096b09c113 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -9,11 +9,16 @@
 
 #define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt
 
+#include <linux/eventfd.h>
+#include <linux/file.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/poll.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/string.h>
+#include <linux/workqueue.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
@@ -833,6 +838,266 @@ static long privcmd_ioctl_mmap_resource(struct file *file,
 	return rc;
 }
 
+/* Irqfd support */
+static struct workqueue_struct *irqfd_cleanup_wq;
+static DEFINE_MUTEX(irqfds_lock);
+static LIST_HEAD(irqfds_list);
+
+struct privcmd_kernel_irqfd {
+	domid_t dom;
+	u8 level;
+	u32 irq;
+	struct eventfd_ctx *eventfd;
+	struct work_struct shutdown;
+	wait_queue_entry_t wait;
+	struct list_head list;
+	poll_table pt;
+};
+
+/* From xen/include/public/hvm/dm_op.h */
+#define XEN_DMOP_set_irq_level 19
+
+struct xen_dm_op_set_irq_level {
+	u32 irq;
+	/* IN - Level: 0 -> deasserted, 1 -> asserted */
+	u8 level;
+	u8 pad[3];
+};
+
+struct xen_dm_op {
+	u32 op;
+	u32 pad;
+	union {
+		/*
+		 * There are more structures here, we won't be using them, so
+		 * can skip adding them here.
+		 */
+		struct xen_dm_op_set_irq_level set_irq_level;
+	} u;
+};
+
+static void irqfd_deactivate(struct privcmd_kernel_irqfd *kirqfd)
+{
+	lockdep_assert_held(&irqfds_lock);
+
+	list_del_init(&kirqfd->list);
+	queue_work(irqfd_cleanup_wq, &kirqfd->shutdown);
+}
+
+static void irqfd_shutdown(struct work_struct *work)
+{
+	struct privcmd_kernel_irqfd *kirqfd =
+		container_of(work, struct privcmd_kernel_irqfd, shutdown);
+	u64 cnt;
+
+	eventfd_ctx_remove_wait_queue(kirqfd->eventfd, &kirqfd->wait, &cnt);
+	eventfd_ctx_put(kirqfd->eventfd);
+	kfree(kirqfd);
+}
+
+static void irqfd_inject(struct privcmd_kernel_irqfd *kirqfd)
+{
+	struct xen_dm_op dm_op = {
+		.op = XEN_DMOP_set_irq_level,
+		.u.set_irq_level.irq = kirqfd->irq,
+		.u.set_irq_level.level = kirqfd->level,
+	};
+	struct xen_dm_op_buf xbufs = {
+		.size = sizeof(dm_op),
+	};
+	u64 cnt;
+
+	eventfd_ctx_do_read(kirqfd->eventfd, &cnt);
+	set_xen_guest_handle(xbufs.h, &dm_op);
+
+	xen_preemptible_hcall_begin();
+	HYPERVISOR_dm_op(kirqfd->dom, 1, &xbufs);
+	xen_preemptible_hcall_end();
+}
+
+static int
+irqfd_wakeup(wait_queue_entry_t *wait, unsigned mode, int sync, void *key)
+{
+	struct privcmd_kernel_irqfd *kirqfd =
+		container_of(wait, struct privcmd_kernel_irqfd, wait);
+	__poll_t flags = key_to_poll(key);
+
+	if (flags & EPOLLIN)
+		irqfd_inject(kirqfd);
+
+	if (flags & EPOLLHUP) {
+		mutex_lock(&irqfds_lock);
+		irqfd_deactivate(kirqfd);
+		mutex_unlock(&irqfds_lock);
+	}
+
+	return 0;
+}
+
+static void
+irqfd_poll_func(struct file *file, wait_queue_head_t *wqh, poll_table *pt)
+{
+	struct privcmd_kernel_irqfd *kirqfd =
+		container_of(pt, struct privcmd_kernel_irqfd, pt);
+
+	add_wait_queue_priority(wqh, &kirqfd->wait);
+}
+
+static int privcmd_irqfd_assign(struct privcmd_irqfd *irqfd)
+{
+	struct privcmd_kernel_irqfd *kirqfd, *tmp;
+	struct eventfd_ctx *eventfd;
+	__poll_t events;
+	struct fd f;
+	int ret;
+
+	kirqfd = kzalloc(sizeof(*kirqfd), GFP_KERNEL);
+	if (!kirqfd)
+		return -ENOMEM;
+
+	kirqfd->irq = irqfd->irq;
+	kirqfd->dom = irqfd->dom;
+	kirqfd->level = irqfd->level;
+	INIT_LIST_HEAD(&kirqfd->list);
+	INIT_WORK(&kirqfd->shutdown, irqfd_shutdown);
+
+	f = fdget(irqfd->fd);
+	if (!f.file) {
+		ret = -EBADF;
+		goto error_kfree;
+	}
+
+	eventfd = eventfd_ctx_fileget(f.file);
+	if (IS_ERR(eventfd)) {
+		ret = PTR_ERR(eventfd);
+		goto error_fd_put;
+	}
+
+	kirqfd->eventfd = eventfd;
+
+	/*
+	 * Install our own custom wake-up handling so we are notified via a
+	 * callback whenever someone signals the underlying eventfd.
+	 */
+	init_waitqueue_func_entry(&kirqfd->wait, irqfd_wakeup);
+	init_poll_funcptr(&kirqfd->pt, irqfd_poll_func);
+
+	mutex_lock(&irqfds_lock);
+
+	list_for_each_entry(tmp, &irqfds_list, list) {
+		if (kirqfd->eventfd == tmp->eventfd) {
+			ret = -EBUSY;
+			mutex_unlock(&irqfds_lock);
+			goto error_eventfd;
+		}
+	}
+
+	list_add_tail(&kirqfd->list, &irqfds_list);
+	mutex_unlock(&irqfds_lock);
+
+	/*
+	 * Check if there was an event already pending on the eventfd before we
+	 * registered, and trigger it as if we didn't miss it.
+	 */
+	events = vfs_poll(f.file, &kirqfd->pt);
+	if (events & EPOLLIN)
+		irqfd_inject(kirqfd);
+
+	/*
+	 * Do not drop the file until the kirqfd is fully initialized, otherwise
+	 * we might race against the EPOLLHUP.
+	 */
+	fdput(f);
+	return 0;
+
+error_eventfd:
+	eventfd_ctx_put(eventfd);
+
+error_fd_put:
+	fdput(f);
+
+error_kfree:
+	kfree(kirqfd);
+	return ret;
+}
+
+static int privcmd_irqfd_deassign(struct privcmd_irqfd *irqfd)
+{
+	struct privcmd_kernel_irqfd *kirqfd, *tmp;
+	struct eventfd_ctx *eventfd;
+
+	eventfd = eventfd_ctx_fdget(irqfd->fd);
+	if (IS_ERR(eventfd))
+		return PTR_ERR(eventfd);
+
+	mutex_lock(&irqfds_lock);
+
+	list_for_each_entry_safe(kirqfd, tmp, &irqfds_list, list) {
+		if (kirqfd->eventfd == eventfd) {
+			irqfd_deactivate(kirqfd);
+			break;
+		}
+	}
+
+	mutex_unlock(&irqfds_lock);
+
+	eventfd_ctx_put(eventfd);
+
+	/*
+	 * Block until we know all outstanding shutdown jobs have completed so
+	 * that we guarantee there will not be any more interrupts once this
+	 * deassign function returns.
+	 */
+	flush_workqueue(irqfd_cleanup_wq);
+
+	return 0;
+}
+
+static long privcmd_ioctl_irqfd(struct file *file, void __user *udata)
+{
+	struct privcmd_data *data = file->private_data;
+	struct privcmd_irqfd irqfd;
+
+	if (copy_from_user(&irqfd, udata, sizeof(irqfd)))
+		return -EFAULT;
+
+	/* No other flags should be set */
+	if (irqfd.flags & ~PRIVCMD_IRQFD_FLAG_DEASSIGN)
+		return -EINVAL;
+
+	/* If restriction is in place, check the domid matches */
+	if (data->domid != DOMID_INVALID && data->domid != irqfd.dom)
+		return -EPERM;
+
+	if (irqfd.flags & PRIVCMD_IRQFD_FLAG_DEASSIGN)
+		return privcmd_irqfd_deassign(&irqfd);
+
+	return privcmd_irqfd_assign(&irqfd);
+}
+
+static int privcmd_irqfd_init(void)
+{
+	irqfd_cleanup_wq = alloc_workqueue("privcmd-irqfd-cleanup", 0, 0);
+	if (!irqfd_cleanup_wq)
+		return -ENOMEM;
+
+	return 0;
+}
+
+static void privcmd_irqfd_exit(void)
+{
+	struct privcmd_kernel_irqfd *kirqfd, *tmp;
+
+	mutex_lock(&irqfds_lock);
+
+	list_for_each_entry_safe(kirqfd, tmp, &irqfds_list, list)
+		irqfd_deactivate(kirqfd);
+
+	mutex_unlock(&irqfds_lock);
+
+	destroy_workqueue(irqfd_cleanup_wq);
+}
+
 static long privcmd_ioctl(struct file *file,
 			  unsigned int cmd, unsigned long data)
 {
@@ -868,6 +1133,10 @@ static long privcmd_ioctl(struct file *file,
 		ret = privcmd_ioctl_mmap_resource(file, udata);
 		break;
 
+	case IOCTL_PRIVCMD_IRQFD:
+		ret = privcmd_ioctl_irqfd(file, udata);
+		break;
+
 	default:
 		break;
 	}
@@ -992,15 +1261,27 @@ static int __init privcmd_init(void)
 	err = misc_register(&xen_privcmdbuf_dev);
 	if (err != 0) {
 		pr_err("Could not register Xen hypercall-buf device\n");
-		misc_deregister(&privcmd_dev);
-		return err;
+		goto err_privcmdbuf;
+	}
+
+	err = privcmd_irqfd_init();
+	if (err != 0) {
+		pr_err("irqfd init failed\n");
+		goto err_irqfd;
 	}
 
 	return 0;
+
+err_irqfd:
+	misc_deregister(&xen_privcmdbuf_dev);
+err_privcmdbuf:
+	misc_deregister(&privcmd_dev);
+	return err;
 }
 
 static void __exit privcmd_exit(void)
 {
+	privcmd_irqfd_exit();
 	misc_deregister(&privcmd_dev);
 	misc_deregister(&xen_privcmdbuf_dev);
 }
diff --git a/include/uapi/xen/privcmd.h b/include/uapi/xen/privcmd.h
index d2029556083e..47334bb91a09 100644
--- a/include/uapi/xen/privcmd.h
+++ b/include/uapi/xen/privcmd.h
@@ -98,6 +98,18 @@ struct privcmd_mmap_resource {
 	__u64 addr;
 };
 
+/* For privcmd_irqfd::flags */
+#define PRIVCMD_IRQFD_FLAG_DEASSIGN (1 << 0)
+
+struct privcmd_irqfd {
+	__u32 fd;
+	__u32 flags;
+	__u32 irq;
+	domid_t dom;
+	__u8 level;
+	__u8 pad;
+};
+
 /*
  * @cmd: IOCTL_PRIVCMD_HYPERCALL
  * @arg: &privcmd_hypercall_t
@@ -125,5 +137,7 @@ struct privcmd_mmap_resource {
 	_IOC(_IOC_NONE, 'P', 6, sizeof(domid_t))
 #define IOCTL_PRIVCMD_MMAP_RESOURCE				\
 	_IOC(_IOC_NONE, 'P', 7, sizeof(struct privcmd_mmap_resource))
+#define IOCTL_PRIVCMD_IRQFD					\
+	_IOC(_IOC_NONE, 'P', 8, sizeof(struct privcmd_irqfd))
 
 #endif /* __LINUX_PUBLIC_PRIVCMD_H__ */
-- 
2.31.1.272.g89b43f80a514



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 09:11:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 09:11:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562086.878646 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJVsx-0006vt-4s; Wed, 12 Jul 2023 09:11:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562086.878646; Wed, 12 Jul 2023 09:11:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJVsx-0006vm-2L; Wed, 12 Jul 2023 09:11:47 +0000
Received: by outflank-mailman (input) for mailman id 562086;
 Wed, 12 Jul 2023 09:11:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJVsv-0006vc-Kh; Wed, 12 Jul 2023 09:11:45 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJVsv-0002Tk-II; Wed, 12 Jul 2023 09:11:45 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJVsv-00064X-64; Wed, 12 Jul 2023 09:11:45 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJVsv-0002BO-5d; Wed, 12 Jul 2023 09:11:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=4ECw7yYLMX9S75K3OAqKBUWsqw5+XEwHDN3h/ExtzuE=; b=TcMozHS29zeAyvUBmG2rEd294o
	IE6bD8wfqV4s+QnCUZYOeZnpJTx89ndp3sRp2XaPAP9lvNnP71hAbeZk1lg1B1iRhRkhEf9VpGynj
	RW2U6L/+CVm5RYVifdODj6kyV9h51BQ2zwwuTcHPNq1lAROWX60p6GaIcKrCJE1NPNFM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181767-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181767: regressions - FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-libvirt-vhd:guest-start.2:fail:regression
    xen-unstable:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:debian-hvm-install:fail:heisenbug
    xen-unstable:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qcow2:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-amd64-i386-pair:xen-install/src_host:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=3c911be55f1c4e0063e690fb61223df21511b5bb
X-Osstest-Versions-That:
    xen=b831326ee2f9ed94523b3d8b0fb2da2a82113e9e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 12 Jul 2023 09:11:45 +0000

flight 181767 xen-unstable real [real]
flight 181770 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181767/
http://logs.test-lab.xenproject.org/osstest/logs/181770/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-libvirt-vhd 20 guest-start.2  fail in 181770 REGR. vs. 181763

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 12 debian-hvm-install fail pass in 181770-retest
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail pass in 181770-retest
 test-amd64-amd64-xl-qcow2 21 guest-start/debian.repeat fail pass in 181770-retest

Tests which did not succeed, but are not blocking:
 test-amd64-i386-pair         10 xen-install/src_host         fail  like 181763
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181763
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181763
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181763
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181763
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181763
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181763
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181763
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181763
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181763
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181763
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181763
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181763
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass

version targeted for testing:
 xen                  3c911be55f1c4e0063e690fb61223df21511b5bb
baseline version:
 xen                  b831326ee2f9ed94523b3d8b0fb2da2a82113e9e

Last test of basis   181763  2023-07-11 09:44:15 Z    0 days
Testing same since   181767  2023-07-11 23:38:29 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Federico Serafini <federico.serafini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Roberto Bagnara <roberto.bagnara@bugseng.com>
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    fail    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 3c911be55f1c4e0063e690fb61223df21511b5bb
Author: Roberto Bagnara <roberto.bagnara@bugseng.com>
Date:   Wed Jun 21 17:47:56 2023 +0200

    docs/misra: document the C dialect and translation toolchain assumptions.
    
    This document specifies the C language dialect used by Xen and
    the assumptions Xen makes on the translation toolchain.
    
    Signed-off-by: Roberto Bagnara <roberto.bagnara@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

commit 2402591437599489627a15dd75e85b970b98c150
Author: Federico Serafini <federico.serafini@bugseng.com>
Date:   Mon Jul 10 16:15:59 2023 +0200

    x86/emul: fix violations of MISRA C:2012 Rule 8.3 on parameter names
    
    The headline of MISRA C:2012 Rule 8.3 states that:
    "All declarations of an object or function shall use the same names and
    type qualifiers".
    
    Change parameter names to meet the following requirements:
    1) keep consistency between declarations and the corresponding
       definitions thus fixing violations of the Rule 8.3;
    2) use the globally-adopted shorthands (e.g., 's' to denote a 'state');
    3) keep adjacent declarations consistent with respect to the parameter
       names that are used.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>

commit 67f6063b1bf0a100b0ed9c98d80533fb712e6013
Author: Stefano Stabellini <stefano.stabellini@amd.com>
Date:   Mon Jul 10 13:28:35 2023 -0700

    docs/misra: add Rule 7.4 and 9.4
    
    Rule 9.4 is non-controversial and we have no violations.
    
    Rule 7.4 is considered a good idea with the caveat that assigning a
    string literal to const void is allowed. I added a note to specify it.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 09:15:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 09:15:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562094.878656 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJVwI-0007cC-Pw; Wed, 12 Jul 2023 09:15:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562094.878656; Wed, 12 Jul 2023 09:15:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJVwI-0007bz-L3; Wed, 12 Jul 2023 09:15:14 +0000
Received: by outflank-mailman (input) for mailman id 562094;
 Wed, 12 Jul 2023 09:15:12 +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 <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJVwG-0007bp-JN
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 09:15:12 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20624.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::624])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 995ff8f0-2094-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 11:15:10 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM7PR04MB6981.eurprd04.prod.outlook.com (2603:10a6:20b:103::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Wed, 12 Jul
 2023 09:15:06 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 09:15:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 995ff8f0-2094-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Cp87fV6KVPF87LjmSTFxVEPu7ZMshvERllRfhAO5HOALXsrNiqtRnIBSDb8u9VQ4L7HtEwmrP8QICAxpNuVLoRQVoma6zGbIYickcNSlI/DAQJO3ACtTApRlGo+SyGA0ngkEF9k4L+w1AprqX5u1nQiOa4J/lYg1Csiij2CqKVEtA9m+7lun6omXmk4sNxpnhadKGAt/v5YNYoE/uPBnWuaWB1XCgvnCiiaFS+MSIEzPuWL/gy6FrLWOkbjXTmbiwf2/+oE95fLOvgh0a2fHNzoKZjfY89iL3C+XHeAJlzWeQL63w/FLjFjSki6TnFhGvmQo0RDirAGlNc06prQqEA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ts4v3umcPW/luaRlyh4QjGIcut16SrfPkRDGRVu08Ck=;
 b=LdAj4sj4SRRVcOlinc/EeAMKeeGcFp7yyamHxy57tbvIBc4fyWSM7clTUZlx8FDbk/7RN6WcfLLbUhKpr5Q3Gv/Vrbq28tZOmb9gCGwt92CW/oHUOBShyXpErTMrStPJLPlK6gMFG+rd7q8sJvly1t2XDmPylXXHu9EEtvMwQyrUnSub+6e2UFdWD8Qc5SxZsSjHsCePqb+x+qhNCRR02p48JpDyVhbemO6GETZRyaiNCea5lJKutfnDZdhsRsQ8T+HZfAfoJ82XIyv9+AdhMcAexYZdoRUXl6gVCn6Ri6rv5Z0lCPRCeC3eojHHRcvQJh/iu6TIKbpit60pBdCPyw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ts4v3umcPW/luaRlyh4QjGIcut16SrfPkRDGRVu08Ck=;
 b=VCUuvwzW60kr6LbcOutLg/OApZFWPExf62hUHfEwlIhDsuZ6zbUiQtCusbbDzH2+yVt4rgLCi3XNynRQlZBmGh+3bEtoXjzoBisg7nUDH74tBzD5a9flV2UNzrbys4Hpcia7tjrHr92AWQPYSRy/HliKw745jqffOs2KpOrzbVm3SqqNQ4H75q3aDdc519ZBBFHFTAScAXJlqVEXhh1rjF9Qk0jh6IRVJWbfjFjsJIy97UQ8nmkcUI4pcGNKkOufaiUuA7lINJ8uurPIc20OS3rvw4aM09DuIWZplATrRnA2yDsNiIGeclXXhWs8QbSCWEd+B7vq1gDagzYrMMqeQw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <c0ba8144-3e3e-1f98-a719-ea03e9f29495@suse.com>
Date: Wed, 12 Jul 2023 11:15:04 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH] pci: introduce per-domain PCI rwlock
Content-Language: en-US
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>,
 Paul Durrant <paul@xen.org>, Oleksandr Tyshchenko <olekstysh@gmail.com>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20230711004537.888185-1-volodymyr_babchuk@epam.com>
 <e6ca0ef1-fb66-d923-388f-79cfc20d1626@suse.com> <874jmagulx.fsf@epam.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <874jmagulx.fsf@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0158.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:99::11) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM7PR04MB6981:EE_
X-MS-Office365-Filtering-Correlation-Id: 7382b5d9-b78b-4181-80a3-08db82b87bc7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	ahcWpndPex7X37P4bDSO+lOGvtBtDGn+SD+W2t1FsPBVGxYQ4HQL6VslekyTXm54bh5ENNcVqGSUr7W7gauMBOZE8zNJq+Wddx5LYqsRR9m2+qX4WiKRXF3OrQP4+3ATGYLIyiX+C2XlrpNRp1dJmEIrEoHTRtzdZ/ZQ0yDDJ2UKRxS2Jf4Jqf1S1YuwK30EwGtb4oeS+cKiTmtU+WZ/N658uq921JRnL/h/zSfDyjdbZobRxQcVTm82S+eI4z6sJEOdz0I6MHkDIdoGWO0sL4ECNXPN6WJlU9imNm+VbUTu2G3RiV7T2Z6bZtJBrdbqMz1fQgQcSe7aKw1TSzCfnb7Ek/eN/xQ2CAYtLo0BuCT6yOKE4Lep+bGqcLUi6N5QFMJVgvgfmqaqtNbeoFLURoHH2eyw9JmAFqB15HwybgFElHDUA/z3J+3cwYovRmu6Wm3Gl0hr8cwbECHxSYV90zFVrl/DNXzjSW5T1PIEGxubzViEr07ZXmR4iaJ/l+vzHzd94Fs2iLEK3888Ucs8oxZEgtKYzl9xXkogwNwWKhNXl6CPM6ejwl0VCjnA8aIlWxIe6DP4YOdj2ID+FyUQY4pJGA8JppxHntbReGf3xO2sxi+Jv6Ok2vZ1CCLZ4+rWSx2ZT8XWWd/iSZ+tBF+sFw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(39860400002)(346002)(376002)(366004)(396003)(451199021)(2616005)(53546011)(26005)(186003)(6506007)(66556008)(6486002)(316002)(4326008)(83380400001)(6916009)(6512007)(8936002)(8676002)(7416002)(66476007)(66946007)(5660300002)(41300700001)(2906002)(478600001)(54906003)(38100700002)(31696002)(36756003)(86362001)(31686004)(66899021)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cVJSZlplZi84dmFncGlaWkllVjZ6eHEyTXpQUWUycUROWFpBUkErRUZ6czgv?=
 =?utf-8?B?d1VTcjVtcUxMRlVNZmxuSm9HYnRDK1EwRFhhVExlYTFPVlZnejhJTFo3cHpW?=
 =?utf-8?B?ZnR1K294RmVTWmlPTGRmNnp3bFV3L1JKR296UmowZnR6ZTY4SVZRV24rRlZi?=
 =?utf-8?B?UVJmOFhudTJQMEcyNWRjTTdkK0g3elViZWtyR2IrdXYvZVhacjhoT1NEeVRx?=
 =?utf-8?B?UUZZSmVqemFNNjA3MHlVUjg4S2JheVBTTStaQmM0MmRiRW1UUkVwRmE4UHNJ?=
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XhTd1JSNEE4VzBXbGdST2hVRjhhMUtOeTFqQ2Mr?=
 =?utf-8?B?cmhlZ0VhSzVoQ1UyT05SWDB1RzB0dGt2RHFHc1pvcU96NHdQNk8waU52dHQ3?=
 =?utf-8?Q?B0IvSOYqHGzeqrMOt8HSFMQC2?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7382b5d9-b78b-4181-80a3-08db82b87bc7
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 09:15:06.6195
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ylDttuKhkiyBXDYGo2o6L2DrMpj3njfqNRbP+CplnPn9OJlM5Ywzjt1J52s6+Od9w2pNetH4yfSVG0LRh+6fTQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6981

Up front remark: I'm sorry for some possibly unhelpful replies below. I,
for one, am of the opinion that some of the issues you ask about are to
be looked into by whoever wants / needs to rework the locking model.
After all this (likely) is why nobody has dared to make an attempt before
the need became apparent.

On 11.07.2023 20:40, Volodymyr Babchuk wrote:
> Jan Beulich <jbeulich@suse.com> writes:
>> On 11.07.2023 02:46, Volodymyr Babchuk wrote:
>>> Add per-domain d->pci_lock that protects access to
>>> d->pdev_list. Purpose of this lock is to give guarantees to VPCI code
>>> that underlying pdev will not disappear under feet. Later it will also
>>> protect pdev->vpci structure and pdev access in modify_bars().
>>>
>>> Suggested-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
>>> Suggested-by: Jan Beulich <jbeulich@suse.com>
>>> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
>>>
>>> ---
>>>
>>> This patch should be part of VPCI series, but I am posting it as a
>>> sinle-patch RFC to discuss changes to x86 MM and IOMMU code.
>>
>> To aid review / judgement extending the commit message would help, to
>> outline around which function invocations (and for what reason) the
>> lock now needs to be held. Furthermore lock nesting rules want writing
>> down (perhaps next to the declaration of the lock). Therefore comments
>> below are merely preliminary and likely incomplete.
> 
> I added lock in places where underlying code touches d->pdev_list. My
> intention was to lock parts of code that might depend on list
> contents. This is straightforward in case we are traversing the list, but
> it is much more complicated (for me at least) in cases where
> has_arch_pdevs() macro is involved. Prior to my patch uses of
> has_arch_pdevs() weren't protected by pci lock at all. This begs
> question: do wee need to protect it now? And if we need, which portion
> of the code needs to be protected? I did my best trying to isolated the
> affected parts of the code.

Well, yes - these questions need answering. And since you're proposing
these code changes, your present understanding wants writing down, such
that (a) we can use that to make corrections to the (intended) model
and (b) we can match intentions with actual implementation.

>>> --- a/xen/arch/x86/hvm/hvm.c
>>> +++ b/xen/arch/x86/hvm/hvm.c
>>> @@ -2381,12 +2381,14 @@ int hvm_set_cr0(unsigned long value, bool may_defer)
>>>          }
>>>      }
>>>  
>>> +    read_lock(&d->pci_lock);
>>>      if ( ((value ^ old_value) & X86_CR0_CD) &&
>>>           is_iommu_enabled(d) && hvm_funcs.handle_cd &&
>>>           (!rangeset_is_empty(d->iomem_caps) ||
>>>            !rangeset_is_empty(d->arch.ioport_caps) ||
>>>            has_arch_pdevs(d)) )
>>>          alternative_vcall(hvm_funcs.handle_cd, v, value);
>>> +    read_unlock(&d->pci_lock);
>>
>> handle_cd() is non-trivial - did you you audit it for safety of
>> holding a lock around it?
> 
> Well, I only vmx_handle_cd() implements this call. I scanned through it
> and didn't found any other PCI-related things inside. It acquires
> v->arch.hvm.vmx.vmcs_lock, but I didn't found potential for dead locks.

What about overall lock-holding time, which may affect other CPUs and
hence other security contexts?

> On other hand - do we really need to call in under d->pci_lock? What bad
> will happen if has_arch_pdevs(d) will become false during handle_cd()
> execution?

Much like with log-dirty enabling, the main question is what existing
races there may be plus whether things are at least not being made worse.
(Ideally of course by introducing better locking, races would go away if
any exist.) IOW here it would certainly be better to drop the lock before
doing expensive work, but than guarantees are needed that
- the state checked can't change until after the operation is complete, or
- the state changing is benign.

>>> --- a/xen/arch/x86/mm/p2m-pod.c
>>> +++ b/xen/arch/x86/mm/p2m-pod.c
>>> @@ -349,10 +349,12 @@ p2m_pod_set_mem_target(struct domain *d, unsigned long target)
>>>  
>>>      ASSERT( pod_target >= p2m->pod.count );
>>>  
>>> +    read_lock(&d->pci_lock);
>>>      if ( has_arch_pdevs(d) || cache_flush_permitted(d) )
>>>          ret = -ENOTEMPTY;
>>>      else
>>>          ret = p2m_pod_set_cache_target(p2m, pod_target, 1/*preemptible*/);
>>> +    read_unlock(&d->pci_lock);
>>
>> Hmm, is it necessary to hold the lock across the function call?
> 
> Well, I am not sure. Will it be okay to just check has_arch_pdevs()
> while holding a lock? What if it would change it's result in the next
> instant?

PoD and pass-through are incompatible with one another (just like
global log-dirty tracking is). Therefore this and the other side
(like also above for handle_cd(), and like for log-dirty below) need
to make sure that a state change either can't occur or (not
applicable here afaict) is benign. As outlined for log-dirty in the
earlier reply, this may involve doing part of the operation under
lock, until it is safe to release the lock (and yes, below for
log-dirty you validly say this is somewhat fragile, but what do you
do).

>>> --- a/xen/arch/x86/mm/paging.c
>>> +++ b/xen/arch/x86/mm/paging.c
>>> @@ -205,21 +205,27 @@ static int paging_log_dirty_enable(struct domain *d)
>>>  {
>>>      int ret;
>>>  
>>> +    read_lock(&d->pci_lock);
>>>      if ( has_arch_pdevs(d) )
>>>      {
>>>          /*
>>>           * Refuse to turn on global log-dirty mode
>>>           * if the domain is sharing the P2M with the IOMMU.
>>>           */
>>> +        read_unlock(&d->pci_lock);
>>>          return -EINVAL;
>>>      }
>>>  
>>>      if ( paging_mode_log_dirty(d) )
>>> +    {
>>> +        read_unlock(&d->pci_lock);
>>>          return -EINVAL;
>>> +    }
>>>  
>>>      domain_pause(d);
>>>      ret = d->arch.paging.log_dirty.ops->enable(d);
>>>      domain_unpause(d);
>>> +    read_unlock(&d->pci_lock);
>>
>> This means a relatively long potential lock holding time. I wonder
>> whether lock release shouldn't be delegated to the ->enable() hook,
>> as it could do so immediately after setting the flag that would
>> then prevent assignment of devices.
> 
> For me it looks a bit fragile: we need to rely on some hook to release a
> lock, that wasn't acquired by the said hook. But I can do this. It
> should be released after setting PG_log_dirty, correct?

Yes (s/should/could/).

> BTW, I can see that hap_enable_log_dirty() uses
> read_atomic(&p2m->ioreq.entry_count), but p2m_entry_modify() does just
> p2m->ioreq.entry_count++ and p2m->ioreq.entry_count--;
> This looks inconsistent. Also, looks like hap_enable_log_dirty() does
> not hold &p2m->ioreq.lock while accessing entry_count, so its value can
> change right after read_atomic().

I'm afraid it you look closely you'll find many such inconsistencies.

>>> --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
>>> +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
>>> @@ -102,6 +102,8 @@ static bool any_pdev_behind_iommu(const struct domain *d,
>>>  {
>>>      const struct pci_dev *pdev;
>>>  
>>> +    ASSERT(rw_is_locked(&d->pci_lock));
>>> +
>>>      for_each_pdev ( d, pdev )
>>>      {
>>>          if ( pdev == exclude )
>>> @@ -467,17 +469,24 @@ static int cf_check reassign_device(
>>>  
>>>      if ( !QUARANTINE_SKIP(target, pdev) )
>>>      {
>>> +	read_lock(&target->pci_lock);
>>>          rc = amd_iommu_setup_domain_device(target, iommu, devfn, pdev);
>>>          if ( rc )
>>>              return rc;
>>> +	read_unlock(&target->pci_lock);
>>
>> You need to drop the lock before the if().
> 
> Yes, thanks.
> 
>>
>> Also nit: No hard tabs here please.
>>
>>>      }
>>>      else
>>>          amd_iommu_disable_domain_device(source, iommu, devfn, pdev);
>>
>> Related to my initial comment at the top: It wants clarifying for example
>> why "setup" needs to lock held, but "disable" doesn't.
>>
> 
> Because amd_iommu_disable_domain_device() does not access d->pdev_list,
> while amd_iommu_setup_domain_device() does.

I was guessing that might be the reason, but to be honest while looking
at the function I can't spot that access. I clearly must be overlooking
something, which may be that the access is in a called function. Yet as
soon as this isn't obvious, a code comment can make a significant
difference.

> Anyway, I am interested in AMD IOMMU's maintainer opinion there - what
> is the correct scope for lock?

To determine that (and to save readers like me from re-doing the work
you must have done already) is why I gave the earlier comment.

>>> @@ -2765,6 +2767,7 @@ static int cf_check reassign_device_ownership(
>>>  
>>>      if ( !QUARANTINE_SKIP(target, pdev->arch.vtd.pgd_maddr) )
>>>      {
>>> +        read_lock(&target->pci_lock);
>>>          if ( !has_arch_pdevs(target) )
>>>              vmx_pi_hooks_assign(target);
>>
>> I'm afraid this and the unhook side locking isn't sufficient to guarantee
>> no races. Things still depend on the domctl and/or pcidevs lock being
>> held around this.
> 
> I have no intention to drop pcidevs lock at this time. Honestly, I am
> not sure that we will be able to do this without major rework of IOMMU
> code.

Of course, and my remark wasn't intended to hint in such a direction.
Instead ...

>> As which points acquiring the lock here (and below) is
>> of questionable value. In any event I think this warrants code comments.
> 
> Well, it would be good to take the lock for the first half of the function
> where we deal with `target`, but we also accessing `source` at the same
> time. To prevent ABBA dead lock I opted to number of finer-grained lock
> acquisitions.
> 
> As for "questionable value", I am agree with you. But, if we want to
> protect/serialize access to d->pdev_list, we need to use lock there.

... I did ask to assess whether acquiring the lock (without other
locking changed) is useful, and to put down the result of this in a
comment - whether or not the lock acquire is retained here. IOW in
one case the comment may say "lock not acquired here because ..."
whereas in the other case the comment might be "lock acquired here
despite ..."

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 09:23:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 09:23:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562098.878665 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJW3n-0000fU-Hl; Wed, 12 Jul 2023 09:22:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562098.878665; Wed, 12 Jul 2023 09:22:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJW3n-0000fN-Et; Wed, 12 Jul 2023 09:22:59 +0000
Received: by outflank-mailman (input) for mailman id 562098;
 Wed, 12 Jul 2023 09:22: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 <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJW3l-0000fH-Vz
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 09:22:57 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20601.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::601])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id af476379-2095-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 11:22:55 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PAXPR04MB9217.eurprd04.prod.outlook.com (2603:10a6:102:232::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 09:22:53 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 09:22:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: af476379-2095-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=YwpH33Yj6xIZRmMPtkSbBwVriIndUHwslfvkyTgfiDo9H12id1fQsPGOHrGb5k9e9vFyRaUBhmsmcUxYiSWvTUyosTEHIZFe70rRjIryZ5jX2GSrP7PIn7+9cOWXUU3J4qzAc4iKTDte/CBuifmCz5w4/X3NKyTMeCBBkBARviH+3OehxBCx94MTk/8HwVjjnEXr+h1iHtKh17N2sN/d8+IIX3MI8RWtG3EeY9r6o9EaJ5rQg2quzNdLcvN8CB7d2r6lMtqjnAKsvaw0uk6yWzi1GPENM0I7970qSl59EmyzsjrVhxKAKu0KbH4jChIxKzBrkSORPuUU7zFUbcjspw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4ZBV+H90nEt74P0BvK/S1m0ZVPmeIRK7ayHgTTu/NrU=;
 b=S12AKVMB3EETSlu8Dx+bGk/qpfMVysRrCVA7Hn3otBLSAhmNkci1C158equye8ZGg8GtVpI9wwCaGQmZBLNWUMRkjh2uy6PKdglYKTwo9kKL0/N+pFWyUAVQ6kTwqUiNSjUFAQ0fRX+iyixMF4xKqkWcgL7ewoV1Z5jai2cMjyIC0LlAlfb40NfQ3WXdDy8T5FEgBaggZYL63w3/4hKW48xzQw8VT6v5oEr7LC0zqmhiThCmhg9W7TP57TAzMjAQX/e9FLJ9vXTb5xxv9V5+c+t9sMpR8Rhtq6D7j5n6TctzpulqKMfKw/+06LGigL0sIEdevAZtq9wphJ/vaxg9+g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4ZBV+H90nEt74P0BvK/S1m0ZVPmeIRK7ayHgTTu/NrU=;
 b=U40LAzy48LkyV9p9v8AIVp3qaLTS8GDvmrlI+ddn8nKRVvf/WerlET0Pv46OjJ/7KHGojwZ1s570sxyiUAqKyMBPonZcBfg/zTLIj/366dZuDrks8q7iwerV19q8YaDoVbxATTJO+YGilD1PkIgUUFMlzWs6Ywabxrv4seqMAYD/rSkiwkH9xxIGD+K6neSeVlJzdIBgUpb39/0XSDOo/tFcNU/eFlNbIa57qoVjf/Er/9+skowDgOSymI9y75Y0cqgJksB2bOXGxmFjDi4mNCovug4JcT/97n/W+rXwNeuHWn497iuH+tn60rz9UcWnfvmjWWLLMsjVeAnAkmGpYw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <c9016145-c325-75bf-08cb-c1ff7855bc33@suse.com>
Date: Wed, 12 Jul 2023 11:22:50 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] docs/misra: add Rule 9.3
Content-Language: en-US
To: Luca Fancellu <Luca.Fancellu@arm.com>,
 Stefano Stabellini <sstabellini@kernel.org>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
 "roger.pau@citrix.com" <roger.pau@citrix.com>,
 "julien@xen.org" <julien@xen.org>,
 "george.dunlap@citrix.com" <george.dunlap@citrix.com>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Stefano Stabellini <stefano.stabellini@amd.com>
References: <20230711202145.2334563-1-sstabellini@kernel.org>
 <AD59BC9A-B2A4-47D7-A010-2FBF08DA3840@arm.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <AD59BC9A-B2A4-47D7-A010-2FBF08DA3840@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0269.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b5::7) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAXPR04MB9217:EE_
X-MS-Office365-Filtering-Correlation-Id: 3b569567-26f3-4e35-159b-08db82b991fd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	VfOOYp31OBRffdaeZNchoziBoCTfa5wyghfqc5a6TpeGmYPBKM6xV7aqsOhvF27yucG9BnfgYx1r+jpgraeTy7dj7abgFb2ci/Y8sNaZVzmDE5+QYAomAcbbcIVOrAG99CdBDxwcwt3wHFmHisKTBR0nYsx7xqbGF4V9QUkGHJ1dXGoN1nOIh6j98Q5eSQsdC1U0Zk2iPWFGuYT88vOu+FkCHOdphbtbthfWcHV35jSBxWkDMO0q7/0JTZ0Br9aVj0xbhiLgA9wqlkNGtJLJrG43f7dKKVdz6OKSt7aXR8MAp9sFQxvDAFlnnQLwRhnWAVjBJWhGgb7Kzp9U1uzgGNKx5Kqssy8oQf4WKZSPAHR5C139Xf303t6psPCLe/7YxQo5omLCKCV1DGs8BKgD4L13F9wHZctNiWHd5OxhfYk2xP+v9GoE9ekYzD7lrLidE+dJB4cFOus8NO4w/wDuWJcDWsRu+HshVkfAmYEWDH2LbrgQx1+rpBKg0RuF4aLeptieeMlsDasU40opM67eewubQhJ6KQ2GfOtnR4PRcPrgwREOnrQjFgUJ4yvYkeV4KO4eJp/SSx4Zm7ALo5DxGAO1m6Gfm5WL4ol7eHDbTivA+YMBwRbplTBKLzo/X3hV4f4xbcqG65r6ZSSTnXI+dA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(366004)(136003)(376002)(396003)(451199021)(2906002)(6512007)(38100700002)(2616005)(186003)(26005)(53546011)(86362001)(31696002)(6506007)(5660300002)(8676002)(36756003)(8936002)(110136005)(54906003)(6486002)(478600001)(66556008)(66946007)(41300700001)(66476007)(316002)(4326008)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MzlneVh4TURFR1JES1k3WFpPQXhIWGVpeGtMKzdVbDI4KzczSEpnajZCRnhP?=
 =?utf-8?B?TXYrU0p6bnBGTjRoLzlnaFd5MVJWY1poUFBIWlhKdGlPQ2JEQW4yb3ZUaWpn?=
 =?utf-8?B?QU5PbjlkZGVKMktYMytOR3FtZjVnTlk5MlZQaUNCOGtnQjArM1RVWmZ4Z1N6?=
 =?utf-8?B?TWFKdU10NXhJamVaVkRjUVNKS2JsaUVPUVFUdmNiOFBWU2Uza0c4M1Q3YzFR?=
 =?utf-8?B?NzR5R1dmSmVSaFRtRVd2NEdieG9WeDlVa0x5V2IyREpFaDRPVm41MkxOQUFZ?=
 =?utf-8?B?WDg3UXBEdWdtYlFXbGl1KzFDWk1rU3JlYXJTdVVRMXAzV1BPZ1FCZm1pRV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Wo3SWRGMnpEYm5lR0lXdmZNQWcyaGlL?=
 =?utf-8?Q?CMpbkWW/hm4027WGJJXMmskY2?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3b569567-26f3-4e35-159b-08db82b991fd
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 09:22:53.3710
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: QpHXMNeN/LXMgFYF2VZcNXvJ7oWnMjBe5h9jm3tJp3oe1y4hG8fKhjY9FjY1NjnTl5SyXC+tDXG6bDI/z/Rj/A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9217

On 12.07.2023 10:21, Luca Fancellu wrote:
>> On 11 Jul 2023, at 21:21, Stefano Stabellini <sstabellini@kernel.org> wrote:
>>
>> From: Stefano Stabellini <stefano.stabellini@amd.com>
>>
>> Specify that {} is allowed for zero-initialization.
>>
>> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
> 
> Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

>> --- a/docs/misra/rules.rst
>> +++ b/docs/misra/rules.rst
>> @@ -284,6 +284,11 @@ maintainers if you want to suggest a change.
>>        braces
>>      -
>>
>> +   * - `Rule 9.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_09_03.c>`_
>> +     - Required
>> +     - Arrays shall not be partially initialized
>> +     - {} is also allowed to specify explicit zero-initialization
> 
> Not related to this patch, but how is the coding style for this? Is it {} without spaces or { } with one space?
> Itâ€™s not specified in the coding style

In the absence of anything written down, I'm inclined to infer both
forms are acceptable.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 09:26:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 09:26:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562105.878676 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJW7C-0001Jy-67; Wed, 12 Jul 2023 09:26:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562105.878676; Wed, 12 Jul 2023 09:26:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJW7C-0001Jr-1w; Wed, 12 Jul 2023 09:26:30 +0000
Received: by outflank-mailman (input) for mailman id 562105;
 Wed, 12 Jul 2023 09:26:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=V3yk=C6=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qJW7B-0001Jl-E6
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 09:26:29 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20612.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::612])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2d709627-2096-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 11:26:27 +0200 (CEST)
Received: from AM6P194CA0033.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:90::46)
 by AS8PR08MB6294.eurprd08.prod.outlook.com (2603:10a6:20b:29a::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 09:26:21 +0000
Received: from AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:209:90:cafe::2b) by AM6P194CA0033.outlook.office365.com
 (2603:10a6:209:90::46) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20 via Frontend
 Transport; Wed, 12 Jul 2023 09:26:21 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT021.mail.protection.outlook.com (100.127.140.243) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.22 via Frontend Transport; Wed, 12 Jul 2023 09:26:20 +0000
Received: ("Tessian outbound f9124736ff4f:v145");
 Wed, 12 Jul 2023 09:26:20 +0000
Received: from fb51bc4c5138.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 55259188-0679-4994-9260-EBADA5DC5A1D.1; 
 Wed, 12 Jul 2023 09:26:09 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id fb51bc4c5138.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 12 Jul 2023 09:26:09 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by PAVPR08MB9553.eurprd08.prod.outlook.com (2603:10a6:102:314::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Wed, 12 Jul
 2023 09:26:07 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::eaec:5611:c427:57f7]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::eaec:5611:c427:57f7%4]) with mapi id 15.20.6565.028; Wed, 12 Jul 2023
 09:26:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2d709627-2096-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yRt9e1uXosEYbKTEU+cTJMbucibKq6c3u0VLjz6C7O8=;
 b=f+X7h3o/Vct3Vi3clhGQ0v2AKmWI1dMPByRxoX7UQzcqROWiIyNiyW7+/+pHmm/Whx2YUyT5OETQyBY9r2GpGIM+1wA9YRDUH6r/AM9eXye/e0wJ0w3gGXzxU18/jzUgNsFBPmbyjq/kKzmQGOY2TXUbxjlOm+qKrL4UcJO7egg=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 4ff1c62b460e3303
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=TStLri7e7q/fn+2mnMyBWUJPy0jc2M5JFWPdSxjG2GZEfyYQE6SBSEJBAgiTapREOe4BFlxn0WBaffMz98ORu55w3M55lOVSQu6opUeTPDTWXAT/9tAkDzImzVPdJi9GJhvGpGQldSMy0WM1gfoInFbLKeEGgLLx9dpy/MQa5gbsJWwe1dkY7MFoFRkq9QLzlmQPNfUT4adLDOe6x4DJeb/D7QFYQoZF8+5JbCeBHUQWyMi24c+nYx0mUqxHNPEWc9zaUivkYxAtR/gpGDRwnRervHojHB6dAr3ibVwSE+fo1yTfEUN4Q4kDtyfq2mlLKUADldPG/w1//ZEUagCpcA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yRt9e1uXosEYbKTEU+cTJMbucibKq6c3u0VLjz6C7O8=;
 b=R7Lh6V6XBDMpeoTGNVmNLboanKCHfbppRMn3STdud1CqBgWMnqLB9MRs3bfaOggiNUC551vctMB9j0+WCfPGnH8kuZlsvAQ/Aat55SE67kbwOWaXwEes96dZNDyxN3a/tfWyVYgQTy2ctc+e45hidANuHA8vTR1GTrv+9yTiMyGfKW5ul56IeC54SdHD3rKNm3uohP+1xQwE71reEEy8VAUm9mScQ+AVxriixry74z5x13KNEeFh1ucL1Jg4KVaw0tQxPKXS+cXmshLbPiHRU/SB8dRvsxtMJT46xGieVkzzMzqafMsXXhu5MLLaX0d71TPonYlYcN9ttSDRBMyzgg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yRt9e1uXosEYbKTEU+cTJMbucibKq6c3u0VLjz6C7O8=;
 b=f+X7h3o/Vct3Vi3clhGQ0v2AKmWI1dMPByRxoX7UQzcqROWiIyNiyW7+/+pHmm/Whx2YUyT5OETQyBY9r2GpGIM+1wA9YRDUH6r/AM9eXye/e0wJ0w3gGXzxU18/jzUgNsFBPmbyjq/kKzmQGOY2TXUbxjlOm+qKrL4UcJO7egg=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>, Xen-devel
	<xen-devel@lists.xenproject.org>, "andrew.cooper3@citrix.com"
	<andrew.cooper3@citrix.com>, "roger.pau@citrix.com" <roger.pau@citrix.com>,
	"julien@xen.org" <julien@xen.org>, "george.dunlap@citrix.com"
	<george.dunlap@citrix.com>, Bertrand Marquis <Bertrand.Marquis@arm.com>,
	Stefano Stabellini <stefano.stabellini@amd.com>
Subject: Re: [PATCH] docs/misra: add Rule 9.3
Thread-Topic: [PATCH] docs/misra: add Rule 9.3
Thread-Index: AQHZtDVnm2uoBPIrqkmByEz++gKzmq+1yx6AgAARUgCAAADeAA==
Date: Wed, 12 Jul 2023 09:26:06 +0000
Message-ID: <144EE5A6-4896-4029-B8F4-8614925AC89F@arm.com>
References: <20230711202145.2334563-1-sstabellini@kernel.org>
 <AD59BC9A-B2A4-47D7-A010-2FBF08DA3840@arm.com>
 <c9016145-c325-75bf-08cb-c1ff7855bc33@suse.com>
In-Reply-To: <c9016145-c325-75bf-08cb-c1ff7855bc33@suse.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|PAVPR08MB9553:EE_|AM7EUR03FT021:EE_|AS8PR08MB6294:EE_
X-MS-Office365-Filtering-Correlation-Id: d06a4e82-dd94-4bef-e402-08db82ba0dbd
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 C6fR/tBTACqcDLhCJdJkln4u1iillJathZxKFXw+NhVrlj2apZdW7squC+nftvwsATRsnhSbjqT1yhOH+cG7Q/4yqyY0GtMM3Wp99Xcjr25ih6mIevkNvZoyT8YuIjcGsjxvXwqW0YsSSwuIk+vcDAoTtnI05vQpNLU+uwgNHMXL+DJFFb+gfxYEmzJ8UwLflhxtB7ZzT94qI57eHOZPgffdIaZ/VK1ruDN4H7mEENaKqjWiqdwNiOzAWpbyOsbRzy/iCT3MEAVe1Uuf/dUXKtzgDwN8/Cs4iWTIxcXQhhG7xmv3uQb5nLu73KA2kGF5e5cQ6VQphhnKtya3yQ/eY9MKgW2PPlfe5dRIHKhygkOtz7iETaeTcxmLZzOnV+/FatnRAkT+13fPWXTXsVts1heu2gVPu5Bs51HgYHQTBx0JL/Q56nyVIJv6Eg0wd9spHOxNdYrYmYs1dER7rg7Itx+wubfLZtgp36RTypmzqjKr4zwmebLjGS0Il4eq3CJ52ybT0ykg42zAQWVY48BGL/fpA0AF3DoJUTVN+RZZ+51/GAhPY9x0cn+MeCh0MZfK3iUaYLq4xYvM6RU95ASTn0yhPF0XV9YdYgh79niCjzvHK6NjI5EdIkVsx3GJSUXj
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(366004)(136003)(376002)(39860400002)(451199021)(54906003)(76116006)(6486002)(71200400001)(478600001)(91956017)(6506007)(53546011)(186003)(26005)(6512007)(2906002)(66946007)(122000001)(64756008)(5660300002)(66476007)(4326008)(6916009)(316002)(66556008)(38100700002)(41300700001)(66446008)(8676002)(8936002)(86362001)(38070700005)(33656002)(36756003)(2616005)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <65EBC67082DA284EA2F6EDE0EB63EBB4@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9553
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	47758a50-64c4-4d78-4d81-08db82ba052c
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	N794fDdzkdNfad/MM0X0CnSbrgA24V5rNrNk44hb7kuV2OwEql4n68frOoJ6/PMvox9sjuqEUR5SUnmzGdjFUUwbBLF1q54PIOnKBiTQq5wUaVZBJTURDg3oaP3iLpgav5ae4QN+aBUSjErZI4IrgvcLVO32OVK3pxJBrUyTusc7SE8a37PjU/KrvkSyeyMHrEBBGRCyxi2S6051oWdRhPGTHs2ZaRLdKzRmBrgFd7WB6v2uWF3AygP7Zvy8xncakE29xJS0h3EG/HjsvFl/5Wy/lQ7BlS/AwzANIT171NGu7Uw23mm6XZKAgtTFuI+nNLZozlNHCZAGx4NCsDlCYuznm2i2Ss0wqqZH0HpeieLCjrNeeLClVBhZuozOJszCxb7dHfxS87Rx13cSHQkxRA1W3EbgADr9Y7bd0yCu1jRomedZaqxGknCmhTJ/ofNypnQm0DbEZ8WsqnGSvyjcIWfbwNQoD6brCHHc7kaPV1hCOVDjEUcovXnBuhiyMGBOz7+A0sr2qikwDpJXds/56CgXs68NKN8mDIcTAGcNq440Oz9bra1w47qCrcHhDi+qZU4JHUjyTqZ7vLqRpd7VitGbzwkxvqIv0Y+9XWWZWotMWyyZx31tGsvdZ0D8hEfWvZ2iXNpWoyOX+lsnbpXHOjlvCrYkycW9reOb045o+cwlppL4AcsvU1pRhm937l9scqznSuO2cWxjyhSpBN6LI/pey4eADO3rsdNgnGNPv6s=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(346002)(39860400002)(136003)(451199021)(46966006)(36840700001)(40470700004)(40460700003)(316002)(47076005)(41300700001)(6862004)(8676002)(8936002)(6512007)(5660300002)(26005)(6506007)(336012)(53546011)(2616005)(40480700001)(2906002)(356005)(86362001)(81166007)(54906003)(36860700001)(36756003)(478600001)(6486002)(33656002)(82310400005)(82740400003)(70206006)(70586007)(4326008)(186003);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 09:26:20.8508
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d06a4e82-dd94-4bef-e402-08db82ba0dbd
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6294

DQoNCj4gT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zAzLmM+YF8N
Cj4+PiArICAgICAtIFJlcXVpcmVkDQo+Pj4gKyAgICAgLSBBcnJheXMgc2hhbGwgbm90IGJlIHBh
cnRpYWxseSBpbml0aWFsaXplZA0KPj4+ICsgICAgIC0ge30gaXMgYWxzbyBhbGxvd2VkIHRvIHNw
ZWNpZnkgZXhwbGljaXQgemVyby1pbml0aWFsaXphdGlvbg0KPj4gDQo+PiBOb3QgcmVsYXRlZCB0
byB0aGlzIHBhdGNoLCBidXQgaG93IGlzIHRoZSBjb2Rpbmcgc3R5bGUgZm9yIHRoaXM/IElzIGl0
IHt9IHdpdGhvdXQgc3BhY2VzIG9yIHsgfSB3aXRoIG9uZSBzcGFjZT8NCj4+IEl04oCZcyBub3Qg
c3BlY2lmaWVkIGluIHRoZSBjb2Rpbmcgc3R5bGUNCj4gDQo+IEluIHRoZSBhYnNlbmNlIG9mIGFu
eXRoaW5nIHdyaXR0ZW4gZG93biwgSSdtIGluY2xpbmVkIHRvIGluZmVyIGJvdGgNCj4gZm9ybXMg
YXJlIGFjY2VwdGFibGUuDQoNCjopIEkgc2VlLCB0aGF04oCZcyB3aGF0IEkgd2FzIHdvcnJpZWQs
IGFueXdheSB5b3UgYXJlIHJpZ2h0ISANCkkgaGF2ZSBhIFdJUCBmb3IgY2xhbmcgZm9ybWF0IHRo
YXQgd291bGQgZ2VuZXJhdGUgc29tZSBkaXNjdXNzaW9uLCBidXQgYXQgbGVhc3QgSSBob3BlIGl0
IHdpbGwgY2xhcmlmeSBtYW55IG9mIHRoZXNlIHNtYWxsDQp0aGluZ3MgdGhhdCBtYWtlIG91ciBj
b2RlYmFzZSBsZXNzIHVuaWZvcm0sIG1ha2luZyB1cyB3cml0ZSBkb3duIHNvbWUgcnVsZXMgDQoN
Cj4gDQo+IEphbg0KDQo=


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 09:39:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 09:39:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562115.878685 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJWJo-0002sN-BG; Wed, 12 Jul 2023 09:39:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562115.878685; Wed, 12 Jul 2023 09:39:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJWJo-0002sG-8D; Wed, 12 Jul 2023 09:39:32 +0000
Received: by outflank-mailman (input) for mailman id 562115;
 Wed, 12 Jul 2023 09:39:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Mhes=C6=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qJWJm-0002ry-Ik
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 09:39:30 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20625.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::625])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ff9482cb-2097-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 11:39:29 +0200 (CEST)
Received: from DUZPR01CA0275.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4b9::6) by DBBPR08MB6092.eurprd08.prod.outlook.com
 (2603:10a6:10:20e::21) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 09:39:26 +0000
Received: from DBAEUR03FT049.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4b9:cafe::5e) by DUZPR01CA0275.outlook.office365.com
 (2603:10a6:10:4b9::6) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20 via Frontend
 Transport; Wed, 12 Jul 2023 09:39:26 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT049.mail.protection.outlook.com (100.127.142.192) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.20 via Frontend Transport; Wed, 12 Jul 2023 09:39:26 +0000
Received: ("Tessian outbound ba2f3d95109c:v145");
 Wed, 12 Jul 2023 09:39:26 +0000
Received: from 70b896db243b.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 C04A3BE4-E9F3-47DB-961E-834E01234F8C.1; 
 Wed, 12 Jul 2023 09:39:13 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 70b896db243b.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 12 Jul 2023 09:39:13 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by AS2PR08MB10110.eurprd08.prod.outlook.com (2603:10a6:20b:62e::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Wed, 12 Jul
 2023 09:39:08 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::488c:5182:718d:7759]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::488c:5182:718d:7759%4]) with mapi id 15.20.6588.017; Wed, 12 Jul 2023
 09:39:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ff9482cb-2097-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MsT6bN6mclgUWAyo5qoKvIOvhbHp1xLY4CgkY0xsxhU=;
 b=70XfeJEl2kKIZ+4y+LaOaCuz6LVnrrcfwShBji3rgT6pFS5/e8HsKaBAT4PeWM9XvZnZQdWw/GsdcKEtwRcN4Pkoj0bPUpSw8GSiVHUuuh1Vn3ewuRa69NfV6YRynKTRcHZOZ/aYEOEv0uFpzik1HvsHuZ0uK5x2xh4YwpcMs6o=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: d2b15425a6df23ee
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=bcarSUHn4zv1SDW/B7Vle9YaJO4f8NcwxHrLDrveUN9JXR5tqIaB+qe8jFA3BifKs44ElXwxpVn+bFpyBis1Zjtw+XCm5ujepy5r1qbNAo16ru1OtBpNu20T+sPPGUdAF4F4Fnk1ceVfFmBqbQcW+B30i30do6lcSQM7XuoWtzNotZVfX5aH0kQr17C3DnHXrvlZPHTRIhsQLgWfoKHR688YTi1kkNrSqY5OUXk1bxMPCUnGAKr8buZBsoYLq3rNlQMV+4AxFhdu6cV/g1mKoQ0pOlqmjc+cmd7UazCuLZF8Z42cd9tRiFlYViwwse5qp2axoGWfTcjkBVWurFNmTg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MsT6bN6mclgUWAyo5qoKvIOvhbHp1xLY4CgkY0xsxhU=;
 b=mUYxXFHIFHosX/iE9E460oU9qyMV71+rbeDZGqGSIPA+rYB2OkiZ31XoLgGgEU4RUzqq0j4ZUsxOpF/9oJ67Z7lz65TX5JXJpZi6dZKFzAWTqS2HWBQGmbnTZ3iJegSrHh0YLFSNh7mX0Au23Y/9DLtxaEeXeqandx6EZe2G7nLi09FGjgil1erZVy0AQgkFTxdpQdfHcAoA/INLtR5qaXfk9GWk1yzQdwFfyysQdAUpggI3TqqlScDln+CaH8iAaAThqdnj98x4NUmbSXR6kKYuJsrVN5n6L6QuOUdO5rT0egi9Pt74hDTUqut9oKtNEe+m5/HF1DFlAFBZVDhUsQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MsT6bN6mclgUWAyo5qoKvIOvhbHp1xLY4CgkY0xsxhU=;
 b=70XfeJEl2kKIZ+4y+LaOaCuz6LVnrrcfwShBji3rgT6pFS5/e8HsKaBAT4PeWM9XvZnZQdWw/GsdcKEtwRcN4Pkoj0bPUpSw8GSiVHUuuh1Vn3ewuRa69NfV6YRynKTRcHZOZ/aYEOEv0uFpzik1HvsHuZ0uK5x2xh4YwpcMs6o=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, Jan
 Beulich <jbeulich@suse.com>, =?iso-8859-1?Q?Roger_Pau_Monn=E9?=
	<roger.pau@citrix.com>
Subject: Re: [XEN PATCH v9 00/24] Xen FF-A mediator
Thread-Topic: [XEN PATCH v9 00/24] Xen FF-A mediator
Thread-Index: AQHZryQNERDOaolIdEep8BfaVs4WwK+16xOA
Date: Wed, 12 Jul 2023 09:39:07 +0000
Message-ID: <480AA225-0590-40BE-BCD5-ADCCB1BC2274@arm.com>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
In-Reply-To: <20230705093433.2514898-1-jens.wiklander@linaro.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|AS2PR08MB10110:EE_|DBAEUR03FT049:EE_|DBBPR08MB6092:EE_
X-MS-Office365-Filtering-Correlation-Id: 4ecd77e1-cd21-4123-261e-08db82bbe1f0
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 oL1mV+Oa6SQhEnQG8m0bhQxeHGHKfNz3TQhdlk5Fy7/UnbvfWjQDFbjcpeJT99Hc0z8zqPeMR6ZjjBWLRdkaXHA5htmqhX2VsfKJZZKe/8kCuKR2Q5R2LEVyvzP9X+pS3nn+1ZsJolc1uS1yGSiAZ3DLAQuuts4b7pwM12Qta4UfRlmDXHPRfbd3e7U9YYEcRK6AuWCF8wBBoVdy9j3amHPDhXkMIjTbtFo/zEoqTd35ck0El4DFAX12IGMjbqbR7MGAtVxptm2eP2VSy5l0KdWPsxrFyxexgScIsbrdjB7FPTbNS7nYoFtBLuXlyKIHRfvymqHHYddkQGUpW0f87cUyaJcTnlul4Ngj+oY14gXBe/USvHLwGfly/ZKoLiAJ1fogNpumWWs18oTlevlG2axSHKsAlVnxBqHLE98UB+AkPzV/KtwYmlmwXXCTxFPGzqwNi6MtbIT7zVIIuVLGh95QlpWeXcm0f71pUMrfKx6swLQ7nSuwexFba2teXHhKHhm6OsTWHA0/8Yc1gTd1jB4szicmEeertDMKiwNxT1TzuLqKHH+qg8gPB0Q62/8AxGuUfbm0uOuwOce0JQUjK29D9fPlu0G+VLj710OE6OQ9oHwANJcNclAzVDh93N93dP1R5G/C4U1kginUmE37pA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(366004)(136003)(346002)(396003)(451199021)(86362001)(8676002)(8936002)(33656002)(186003)(30864003)(2906002)(2616005)(83380400001)(36756003)(5660300002)(7416002)(53546011)(6506007)(122000001)(54906003)(71200400001)(38100700002)(76116006)(66946007)(64756008)(66446008)(91956017)(66556008)(6486002)(6916009)(4326008)(66476007)(478600001)(38070700005)(41300700001)(316002)(966005)(6512007)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="iso-8859-1"
Content-ID: <E2F7ED5342D782489833BE1128270FC7@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10110
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT049.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	3c108849-de1c-46ed-a939-08db82bbd6eb
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	9t4DUcn3Ute63oI2y6ABAD6cJrNlCGW3p+Gy7wCYlPNBsQQcPh8k/zSHGfbDoGD62jBmsBxfn9oc2719FmqsPCjzB0RewWN1MeANsfaNzCXWrMTurDaivjRHzFnn1qPWZQ0hT5iEpF1Q6SBg+/cA4Fgp9QUhNUyq0DNr1qyRW0OaNescCg4GBZJt09D4R/yn6FCqNUL9tvHrj7dF6wTXAta57JOMPGTpy+w3jxIcgotLprH6Wa0Y8lbGzCOBFpCutQJcaMBkv1HJNiHYdXUMaZBr8VltoN9g0W6sT4hKb7Ssff/kehRFmcm1EwyQujftw2fjdta97K8yrTOA0Ttak3podbeWeL0aSPitTDRZUFS1bHehIZjYYaQnOksEjdE7740cMf3LwrWKymy5OHjkWA3ACOOlz144GcLKys9S9FjDEpOtGfZuoJBrImajtUW61eB2nNpD8b8ry6GhbEbtGNAQXRzcN1o4yTkd4cC1NfFw/WTQJQTuBptyL3bbM1BLqJC/5AEloPqkQPxJV4REtfP7T2TP8ieSg0CMmOU9WcKRCLKGTsmvi7O97HyoOnrV+qLAgrE8KE7kO6cTO+2xM3B0fFsydR/flM1mz/yB0RJUpxgWBTXKUurtBUfg3F31R9gD48RzHixVCwfx7WkEf9AVDEw4CQSsAC5J91+/EP0tdF/QypB+oo6ItsdGh3GpU629i4MdqRAVR4stcuS8soKhQ4gcFBUGxZJaCkVlfRw=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(396003)(136003)(346002)(451199021)(40470700004)(46966006)(36840700001)(70206006)(70586007)(4326008)(36860700001)(40460700003)(478600001)(36756003)(54906003)(40480700001)(86362001)(336012)(26005)(6506007)(53546011)(107886003)(186003)(33656002)(6512007)(966005)(6486002)(47076005)(83380400001)(82310400005)(82740400003)(81166007)(356005)(41300700001)(2616005)(6862004)(8936002)(8676002)(30864003)(316002)(2906002)(5660300002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 09:39:26.3070
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 4ecd77e1-cd21-4123-261e-08db82bbe1f0
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT049.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6092

Hi Jens,

> On 5 Jul 2023, at 11:34, Jens Wiklander <jens.wiklander@linaro.org> wrote=
:
>=20
> Hi,
>=20
> This patch sets add an FF-A [1] mediator to the TEE mediator framework
> already present in Xen.  The FF-A mediator implements the subset of the
> FF-A 1.1 specification needed to communicate with OP-TEE using FF-A as
> transport mechanism instead of SMC/HVC as with the TEE mediator. It allow=
s
> a similar design in OP-TEE as with the TEE mediator where OP-TEE presents
> one virtual partition of itself to each guest in Xen.
>=20
> The FF-A mediator is generic in the sense it has nothing OP-TEE specific
> except that only the subset needed for OP-TEE is implemented so far. The
> hooks needed to inform OP-TEE that a guest is created or destroyed are pa=
rt
> of the FF-A specification.
>=20
> It should be possible to extend the FF-A mediator to implement a larger
> portion of the FF-A 1.1 specification without breaking with the way OP-TE=
E
> is communicated with here. So it should be possible to support any TEE or
> Secure Partition using FF-A as transport with this mediator.
>=20
> The patches are also available at https://github.com/jenswi-linaro/xen
> branch "xen_ffa_v9".
>=20
> With help from Bertrand I've integrated this in a test setup with OP-TEE.
> Please check prerequisites at
> https://optee.readthedocs.io/en/latest/building/prerequisites.html
>=20
> My setup is duplicated using:
> repo init -u https://github.com/jenswi-linaro/manifest.git -m qemu_v8.xml=
 \
>        -b qemu_xen_ffa
> repo sync -j8
> cd build
> make -j8 toolchains
> make -j8 all
> make run-only
>=20
> Test in dom0 with for instance:
> xtest 1004
>=20
> at the prompt.
>=20
> To start up a domu and connect to it do:
> cd /mnt/host/build/qemu_v8/xen
> xl create guest_ffa.cfg
> xl console domu
>=20
> Then test as usual with "xtest 1004".
>=20
> The setup uses the branch "ffa" from https://github.com/jenswi-linaro/xen=
.
> That's currently the same as the "xen_ffa_v9" branch, but the "ffa" branc=
h
> may change later as I update for a new version of the patch set.
>=20
> [1] https://developer.arm.com/documentation/den0077/latest
>=20
> Thanks,
> Jens
>=20
> v8->v9:
> * Patch "xen/arm: ffa: add remaining SMC function IDs"
>  - mention the documentation number used
>  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
> * Patch "xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET"
>  - Adding a reference to the documentation
>  - Renaming FFA_PART_PROP_IS_MASK to FFA_PART_PROP_IS_TYPE_MASK
>  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
> * Patch "xen/arm: ffa: add defines for framework direct request/response =
messages"
>  - add a reference to the documentation
>  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
> * Patch "docs: add Arm FF-A mediator"
>  - Updating the wording as requested.
>  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
>  - Fixing a few typos and adding a reference to the code for a list of
>    limitations
> * Patch "xen/arm: ffa: list current limitations"
>  - Fixing a couple of typos
>  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
>  - Removing an invalid limitation of FFA_RXTX_MAP_*
> * Patch "xen/arm: ffa: add defines for sharing memory"
>  - Fixing a few typos
>  - Adding a reference to the documentation
>  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
>  - Updating FFA_MAX_SHM_PAGE_COUNT to have a safe margin to
>    TEEC_CONFIG_SHAREDMEM_MAX_SIZE
> * Patch "xen/arm: ffa: add direct request support"
>  - Fixing a coding style issue
>  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
>  - Updating the TODO comment about features.
> * Patch "xen/arm: ffa: send guest events to Secure Partitions"
>  - Adding a TODO comment and a limit on the loop in ffa_direct_req_send_v=
m()
> * Patch "xen/arm: ffa: support mapping guest RX/TX buffers"
>  - Change FFA_MAX_RXTX_PAGE_COUNT to 1 with a TODO for a larger value
>  - Replace !p2m_is_ram(t) test with t !=3D p2m_ram_rw
>  - Rename the introduced field tx_is_free to tx_is_free
> * Patch "xen/arm: ffa: support sharing memory"
>  - Fixing read_atomic() issue in get_shm_pages()
>  - Fixing style issue in free_ffa_shm_mem()
>  - Replace !p2m_is_ram(t) test with t !=3D p2m_ram_rw in get_shm_pages()
> * Patch "tools: add Arm FF-A mediator"
>  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
>  - Adding Acked-by: Anthony PERARD <anthony.perard@citrix.com>
>  - Moving the patch to just before the docs patch.
> * Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com to:
>  - "xen/arm: ffa: enforce dependency on 4k pages"
>  - "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h"
>  - "xen/arm: ffa: add ABI structs for sharing memory"
> * Adding "xen: Introduce arch_domain_teardown()" by Andrew Cooper
> * Adding "xen/arm: add TEE teardown to arch_domain_teardown()"=20
>  based on a patch from Andrew Cooper

It makes it easier for reviewers if you put the changelog per patch
instead of having all of them in the cover letter.

Cheers
Bertrand

>=20
> v7->v8:
> * Adding "xen/arm: ffa: list current limitations" as requested
> * Adding tags to "xen/arm: smccc: add support for SMCCCv1.2 extended
>  input/output registers"
> * Patch "xen/arm: tee: add a primitive FF-A mediator":
>  - Changing license for ffa.h and ffa.c to GPL-2.0-only
>  - Avoiding IS_ENABLED() in the constant FFA_NR_FUNCS
>  - Accepting version 1.1 SPMC only to keep things simple
>  - Removes 32bit and only supports 64bit to keep things simple
> * Patch "tools: add Arm FF-A mediator"
>  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
>  - Adding LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE_FFA for the "ffa" value=20
>    in arch_arm.tee
> * Patch "docs: add Arm FF-A mediator"
>  - Fixing a spell error
>  - Moving the patch last in the series
> * Patch "xen/arm: ffa: add remaining SMC function IDs"
>  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
>  - Renaming the define FFA_MSG_RUN to FFA_RUN to match the specification
> * Patch "xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET"
>  - Updating the comment describing the flags for FFA_PARTITION_INFO_GET
> * Patch "xen/arm: ffa: add defines for framework direct request/response
>  messages"
>  - Updating the comment describing the flags for MSG_SEND_DIRECT_REQ/RESP
> * Patch "xen/arm: ffa: enforce dependency on 4k pages"
>  - Updating title of patch
>  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
> * Patch "xen/arm: ffa: add support for FFA_ID_GET"
>  - In ffa_domain_init(), check that domain_id isn't greater than
>    UINT16_MAX to avoid a future potential integer overflow in get_vm_id()
> * Patch "xen/arm: ffa: add direct request support"
>  - Move preemption (interrupted) parts to a separate patch "xen/arm: ffa:
>    support preemption of SP during direct request"
>  - Remove loop in handle_msg_send_direct_req() to return eventual
>    errors back to the VM instead of the SP.
> * Patch "xen/arm: ffa: map SPMC rx/tx buffers"
>  - Adding a FFA_RXTX_PAGE_COUNT define instead of using 1 directly
> * New patch "xen/arm: ffa: support preemption of SP during direct request=
"
> * Patch "xen/arm: ffa: send guest events to Secure Partitions"
>  - Replacing unsigned int with uint16_t for subscr_vm_created_count and
>    subscr_vm_destroyed_count plus the needed range check to see that
>    they don't overflow.
> * Patch "xen/arm: ffa: support mapping guest RX/TX buffers"
>  - Limit the number of pages in VM RX/TX buffers to 32 using a new
>    FFA_MAX_RXTX_PAGE_COUNT define.
> * Patch "xen/arm: ffa: support guest FFA_PARTITION_INFO_GET"
>  - Renaming tx_is_mine to rx_is_free as requested
>  - Simplified the FFA_PARTITION_INFO_GET_COUNT_FLAG check in
>    handle_partition_info_get()
>  - Adding a comment on ownership of the RX buffer
>  - Adding the patch "xen/arm: ffa: improve lock granularity" to address
>    parts of the locking concerns.
> * Patch "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to reg=
s.h"
>  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
> * Patch "xen/arm: ffa: add defines for sharing memory"
>  - Fixing reference for FFA_NORMAL_MEM_REG_ATTR and FFA_MEM_ACC_RW
>  - Updating descirption for FFA_MAX_SHM_PAGE_COUNT
> * Patch "xen/arm: ffa: add ABI structs for sharing memory"
>  - Changing name of the "global_handle" memeber in struct
>    ffa_mem_transaction_* to "handle".
> * Patch "xen/arm: ffa: support sharing memory"
>  - Use FFA_MEM_SHARE_64 only since we changed to only suporting ARM_64.
>  - Rename struct ffa_mem_transaction_x to struct ffa_mem_transaction_int
>    as requested.
>  - Adding a check that shm->page_count isn't 0 before calling share_shm()
>  - Masking return value from FFA_MEM_FRAG_RX to avoid an implic cast to
>    the int32_t returned by ffa_mem_share().
> * Patch "xen/arm: ffa: add support to reclaim shared memory"
>  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
> * Patch "xen/arm: ffa: support sharing large memory ranges"
>  - Adding commetns for struct ffa_ctx
>  - Cleaning up and removing the fragmentation state if handle_mem_frag_tx=
()
>    detects an error.
> * Adding "xen/arm: ffa: improve lock granularity" to address some of the
>  locking concerns.
>=20
> v6->v7:
> * Split some of the larger patches into smaller patches for easier review=
.
>  For instance, the v6 patch "xen/arm: add a primitive FF-A mediator" has
>  been replaced with:
>  - "xen/arm: add a primitive FF-A mediator"
>  - "tools: add Arm FF-A mediator"
>  - "docs: add Arm FF-A mediator"
>  - "xen/arm: ffa: add remaining SMC function IDs"
> * Some small fixes in the error path for handle_mem_share()
> * Switched to SPDX for license in new files.
> * Fixed comment style issues in
>  "xen/arm: smccc: add support for SMCCCv1.2 extended input/output registe=
rs"
> * Made FFA support UNSUPPORTED in "xen/arm: add a primitive FF-A mediator=
"
> * Replaced ffa_get_call_count() with FFA_NR_FUNCS
> * Update the FFA_MAX_SHM_PAGE_COUNT with a formula instead of a value.
> * Replaced XEN_ARM_FLAGS_FFA with XEN_DOMCTL_CONFIG_TEE_FFA to minimize i=
mpact
>  on struct xen_arch_domainconfig. This works because the FF-A mediator an=
d
>  the OP-TEE mediator will not be used at the same time in by a guest.
> * Replaced "ffa" boolean in the guest config with a new "ffa" value to th=
e
>  enumeration "tee_type".
> * Integrated the FF-A mediator in the TEE mediator framework instead of
>  being its own.
> * Rebased on staging as of 2023-02-16
>=20
> v5->v6:
> * Updated "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to r=
egs.h"
>  commit message and moved the patch right before the patch which needs it=
.
>  Applied Michal Orzel's R-B tag.
> * Renamed the guest configuration option "ffa_enabled" to "ffa" and
>  updated the description.
> * More tools update in "xen/arm: add a primitive FF-A mediator" with the =
"ffa"
>  option, including golang and ocaml.
> * Update ffa_domain_init() to return an error if communication with
>  the SPMC can't be established.
> * Factored out a ffa_domain_destroy() from ffa_relinquish_resources().
> * Added ffa_get_call_count() to give an accurate number of FF-A function,
>  updated in each patch as new FF-A functions are added.
> * Added a flags field in struct xen_arch_domainconfig that replaces the
>  ffa_enabled field.
> * Made check_mandatory_feature() __init
> * Replaced a few printk() calls with gprintk() where needed.
> * Rebased on staging as of 2022-09-14
>=20
> V4->v5:
> * Added "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to reg=
s.h"
> * Added documentation for the "ffa_enabled" guest config flag
> * Changed to GPL license for xen/arch/arm/ffa.c
> * Added __read_mostly and const where applicable
> * Added more describing comments in the code
> * Moved list of shared memory object ("ffa_mem_list") into the guest cont=
ext
>  as they are guest specific
> * Simplified a few of the simple wrapper functions for SMC to SPMC
> * Added a BUILD_BUG_ON(PAGE_SIZE !=3D FFA_PAGE_SIZE) since the mediator
>  currently depends on the page size to be same as FFA_PAGE_SIZE (4k).
> * Added max number of shared memory object per guest and max number of
>  size of each shared memory object
> * Added helper macros to calculate offsets of different FF-A data structu=
res
>  in the communication buffer instead of relying on pointer arithmetic
> * Addressed style issues and other comments
> * Broke the commit "xen/arm: add FF-A mediator" into multiple parts, tryi=
ng
>  to add a few features at a time as requested
> * Added a missing call to rxtx_unmap() in ffa_relinquish_resources()
> * Assignment of "ffa_enabled" is kept as is until I have something defini=
tive
>  on the type etc.
> * Tested with CONFIG_DEBUG=3Dy
>=20
> v3->v4:
> * Missed v3 and sent a v4 instead by mistake.
>=20
> v2->v3:
> * Generates offsets into struct arm_smccc_1_2_regs with asm-offsets.c in
>  order to avoid hard coded offsets in the assembly function
>  arm_smccc_1_2_smc()
> * Adds an entry in SUPPORT.md on the FF-A status
> * Adds a configuration variable "ffa_enabled" to tell if FF-A should be
>  enabled for a particular domu guest
> * Moves the ffa_frag_list for fragmented memory share requests into
>  struct ffa_ctx instead to keep it per guest in order to avoid mixups
>  and simplify locking
> * Adds a spinlock to struct ffa_ctx for per guest locking
> * Addressing style issues and suggestions
> * Uses FFA_FEATURES to check that all the needed features are available
>  before initializing the mediator
> * Rebased on staging as of 2022-06-20
>=20
> v1->v2:
> * Rebased on staging to resolve some merge conflicts as requested
>=20
> Andrew Cooper (1):
>  xen: Introduce arch_domain_teardown()
>=20
> Jens Wiklander (23):
>  xen/arm: add TEE teardown to arch_domain_teardown()
>  xen/arm: smccc: add support for SMCCCv1.2 extended input/output
>    registers
>  xen/arm: tee: add a primitive FF-A mediator
>  xen/arm: ffa: add remaining SMC function IDs
>  xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET
>  xen/arm: ffa: add defines for framework direct request/response
>    messages
>  xen/arm: ffa: enforce dependency on 4k pages
>  xen/arm: ffa: add support for FFA_ID_GET
>  xen/arm: ffa: add direct request support
>  xen/arm: ffa: map SPMC rx/tx buffers
>  xen/arm: ffa: send guest events to Secure Partitions
>  xen/arm: ffa: support mapping guest RX/TX buffers
>  xen/arm: ffa: support guest FFA_PARTITION_INFO_GET
>  xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h
>  xen/arm: ffa: add defines for sharing memory
>  xen/arm: ffa: add ABI structs for sharing memory
>  xen/arm: ffa: support sharing memory
>  xen/arm: ffa: add support to reclaim shared memory
>  xen/arm: ffa: support sharing large memory ranges
>  xen/arm: ffa: improve lock granularity
>  xen/arm: ffa: list current limitations
>  tools: add Arm FF-A mediator
>  docs: add Arm FF-A mediator
>=20
> SUPPORT.md                         |    9 +
> docs/man/xl.cfg.5.pod.in           |   15 +
> tools/include/libxl.h              |    5 +
> tools/libs/light/libxl_arm.c       |    3 +
> tools/libs/light/libxl_types.idl   |    3 +-
> xen/arch/arm/arm64/asm-offsets.c   |    9 +
> xen/arch/arm/arm64/smc.S           |   42 +
> xen/arch/arm/domain.c              |   41 +
> xen/arch/arm/include/asm/psci.h    |    4 +
> xen/arch/arm/include/asm/regs.h    |   12 +
> xen/arch/arm/include/asm/smccc.h   |   40 +
> xen/arch/arm/include/asm/tee/ffa.h |   35 +
> xen/arch/arm/include/asm/tee/tee.h |    7 +
> xen/arch/arm/tee/Kconfig           |   11 +
> xen/arch/arm/tee/Makefile          |    1 +
> xen/arch/arm/tee/ffa.c             | 1988 ++++++++++++++++++++++++++++
> xen/arch/arm/tee/optee.c           |   11 +-
> xen/arch/arm/tee/tee.c             |    8 +
> xen/arch/arm/vsmc.c                |   19 +-
> xen/arch/x86/domain.c              |    5 +
> xen/common/domain.c                |    6 +
> xen/include/public/arch-arm.h      |    1 +
> xen/include/xen/domain.h           |    1 +
> xen/include/xen/sched.h            |    1 +
> 24 files changed, 2264 insertions(+), 13 deletions(-)
> create mode 100644 xen/arch/arm/include/asm/tee/ffa.h
> create mode 100644 xen/arch/arm/tee/ffa.c
>=20
> --=20
> 2.34.1
>=20



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 09:47:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 09:47:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562128.878696 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJWRP-0004Rm-7N; Wed, 12 Jul 2023 09:47:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562128.878696; Wed, 12 Jul 2023 09:47:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJWRP-0004Rf-4i; Wed, 12 Jul 2023 09:47:23 +0000
Received: by outflank-mailman (input) for mailman id 562128;
 Wed, 12 Jul 2023 09:47:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=MfTd=C6=pengutronix.de=ukl@srs-se1.protection.inumbo.net>)
 id 1qJWRN-0004QP-B8
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 09:47:21 +0000
Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de
 [2001:67c:670:201:290:27ff:fe1d:cc33])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1871f7ee-2099-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 11:47:20 +0200 (CEST)
Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2])
 by metis.ext.pengutronix.de with esmtps
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJWRI-0001gi-MR; Wed, 12 Jul 2023 11:47:16 +0200
Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de)
 by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJWRH-00Dr6z-B1; Wed, 12 Jul 2023 11:47:15 +0200
Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJWRG-004GV2-E6; Wed, 12 Jul 2023 11:47:14 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1871f7ee-2099-11ee-b239-6b7b168915f2
From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
To: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	David Airlie <airlied@gmail.com>,
	Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org,
	xen-devel@lists.xenproject.org,
	kernel@pengutronix.de
Subject: [PATCH RFC v1 50/52] drm/xen: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
Date: Wed, 12 Jul 2023 11:47:00 +0200
Message-Id: <20230712094702.1770121-51-u.kleine-koenig@pengutronix.de>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Developer-Signature: v=1; a=openpgp-sha256; l=2234; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=4JQln/Shv9usfMfN5P2qRiulxlrxKajP/CdCtAPx/7U=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkrnaQzs1+wM39L5Obw+FywgTwC3eOlZMVvXLLy L6tpeE2RweJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK52kAAKCRCPgPtYfRL+ Tn/YCACCUWng2jWALKbLH4qxPQvGq5Z/APgLNJrfFTJf8vPpxFtMWv/NLsAXpOspDsvDwQs5snR PdDagtck9c/rTw5xkc+FR+kyX1c9zr7/qsl6eXXc8N/NzGpND7wHNlx/sDt2Vzu8luds3CGgUih AZxR1FBnBrPHlbM+2B5QqfEcACftPs8BOtUmklcZ7frvRl6e/eYmJfZMcROhue4NE3DQkWj+m5O 0HYPqP2HQoIZ1z2TO/0hHUA2CZJqg6B3l45aokWGHUGnZO1NB5dLVJsp0iTl1OXiPVDM6/rfLiA sTf3BoRj+yGkLCfOIj5lz3iyYh0Vl9STjCw0VlnEQyi0Ulxd
X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6
Content-Transfer-Encoding: 8bit
X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2
X-SA-Exim-Mail-From: ukl@pengutronix.de
X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false
X-PTX-Original-Recipient: xen-devel@lists.xenproject.org

Prepare dropping the alias "dev" for struct drm_crtc::drm_dev. "drm_dev"
is the better name as "dev" is usually a struct device pointer.

No semantic changes.

Signed-off-by: Uwe Kleine-KÃ¶nig <u.kleine-koenig@pengutronix.de>
---
 drivers/gpu/drm/xen/xen_drm_front_kms.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/xen/xen_drm_front_kms.c b/drivers/gpu/drm/xen/xen_drm_front_kms.c
index dfa78a49a6d9..72042139b73a 100644
--- a/drivers/gpu/drm/xen/xen_drm_front_kms.c
+++ b/drivers/gpu/drm/xen/xen_drm_front_kms.c
@@ -93,7 +93,7 @@ static const struct drm_mode_config_funcs mode_config_funcs = {
 static void send_pending_event(struct xen_drm_front_drm_pipeline *pipeline)
 {
 	struct drm_crtc *crtc = &pipeline->pipe.crtc;
-	struct drm_device *dev = crtc->dev;
+	struct drm_device *dev = crtc->drm_dev;
 	unsigned long flags;
 
 	spin_lock_irqsave(&dev->event_lock, flags);
@@ -113,7 +113,7 @@ static void display_enable(struct drm_simple_display_pipe *pipe,
 	struct drm_framebuffer *fb = plane_state->fb;
 	int ret, idx;
 
-	if (!drm_dev_enter(pipe->crtc.dev, &idx))
+	if (!drm_dev_enter(pipe->crtc.drm_dev, &idx))
 		return;
 
 	ret = xen_drm_front_mode_set(pipeline, crtc->x, crtc->y,
@@ -135,7 +135,7 @@ static void display_disable(struct drm_simple_display_pipe *pipe)
 			to_xen_drm_pipeline(pipe);
 	int ret = 0, idx;
 
-	if (drm_dev_enter(pipe->crtc.dev, &idx)) {
+	if (drm_dev_enter(pipe->crtc.drm_dev, &idx)) {
 		ret = xen_drm_front_mode_set(pipeline, 0, 0, 0, 0, 0,
 					     xen_drm_front_fb_to_cookie(NULL));
 		drm_dev_exit(idx);
@@ -251,7 +251,7 @@ static void display_update(struct drm_simple_display_pipe *pipe,
 
 	event = crtc->state->event;
 	if (event) {
-		struct drm_device *dev = crtc->dev;
+		struct drm_device *dev = crtc->drm_dev;
 		unsigned long flags;
 
 		WARN_ON(pipeline->pending_event);
@@ -263,7 +263,7 @@ static void display_update(struct drm_simple_display_pipe *pipe,
 		spin_unlock_irqrestore(&dev->event_lock, flags);
 	}
 
-	if (!drm_dev_enter(pipe->crtc.dev, &idx)) {
+	if (!drm_dev_enter(pipe->crtc.drm_dev, &idx)) {
 		send_pending_event(pipeline);
 		return;
 	}
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 09:53:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 09:53:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562134.878706 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJWWv-0005ub-QI; Wed, 12 Jul 2023 09:53:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562134.878706; Wed, 12 Jul 2023 09:53:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJWWv-0005uU-Na; Wed, 12 Jul 2023 09:53:05 +0000
Received: by outflank-mailman (input) for mailman id 562134;
 Wed, 12 Jul 2023 09:53:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qJWWu-0005uO-1n
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 09:53:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJWWs-0003Tu-3i; Wed, 12 Jul 2023 09:53:02 +0000
Received: from [15.248.2.150] (helo=[10.24.67.30])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJWWr-0002h1-QP; Wed, 12 Jul 2023 09:53:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=vuXmIAv4AZUppmiBlulQc0pZkBQLZtRtdwKOei99RmQ=; b=qY/kR+gtSHdtR7/ys/sGg7xaCn
	dsa0GbeP5PxEzFAz0cBuVOcyHFrfQ5bQ1cNLzqw1ykbp0GB51Yjr28fLfBTT+5sasO0IfVQxcrmFH
	z3cY5QlNAnWMLutlr2a2wvR2UUx9kBSAm5Tx0L5NOEovbGf0ZqU3/gKFptF/v3sHRc7U=;
Message-ID: <b1a9be99-6078-6553-74f1-5be5f002b23d@xen.org>
Date: Wed, 12 Jul 2023 10:52:59 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v9 02/24] xen/arm: add TEE teardown to
 arch_domain_teardown()
Content-Language: en-US
To: Jens Wiklander <jens.wiklander@linaro.org>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Bertrand.Marquis@arm.com,
 Anthony PERARD <anthony.perard@citrix.com>, Juergen Gross <jgross@suse.com>,
 Wei Liu <wl@xen.org>, Marc Bonnici <marc.bonnici@arm.com>,
 Achin Gupta <achin.gupta@arm.com>, Andrew Cooper <andrew.cooper3@citrix.com>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
 <20230705093433.2514898-3-jens.wiklander@linaro.org>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230705093433.2514898-3-jens.wiklander@linaro.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Jens,

On 05/07/2023 10:34, Jens Wiklander wrote:
> Adds a progress state for tee_domain_teardown() to be called from
> arch_domain_teardown(). tee_domain_teardown() calls the new callback
> domain_teardown() in struct tee_mediator_ops.
> 
> An empty domain_teardown() callback is added to the OP-TEE mediator.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Co-developed-by: Andrew Cooper <andrew.cooper3@citrix.com>

I am a bit confused with the tags ordering. The first signed-off-by 
indicates that Andrew is the author but he co-developped with himself? 
Did you indent to put your signed-off-by first?

> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> 
> ---
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Julien Grall <julien@xen.org>
> CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
> CC: Bertrand Marquis <bertrand.marquis@arm.com>
> CC: Jens Wiklander <jens.wiklander@linaro.org>
> ---
>   xen/arch/arm/domain.c              | 36 ++++++++++++++++++++++++++++++
>   xen/arch/arm/include/asm/tee/tee.h |  7 ++++++
>   xen/arch/arm/tee/optee.c           |  6 +++++
>   xen/arch/arm/tee/tee.c             |  8 +++++++
>   4 files changed, 57 insertions(+)
> 
> diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> index 15d9709a97d2..18171decdc66 100644
> --- a/xen/arch/arm/domain.c
> +++ b/xen/arch/arm/domain.c
> @@ -795,6 +795,42 @@ fail:
>   
>   int arch_domain_teardown(struct domain *d)
>   {
> +    int ret = 0;
> +
> +    BUG_ON(!d->is_dying);
> +
> +    /* See domain_teardown() for an explanation of all of this magic. */
> +    switch ( d->teardown.arch_val )
> +    {
> +#define PROGRESS(x)                             \
> +        d->teardown.arch_val = PROG_ ## x;      \
> +        fallthrough;                            \
> +    case PROG_ ## x
> +
> +        enum {
> +            PROG_none,
> +            PROG_tee,
> +            PROG_done,
> +        };
> +
> +    case PROG_none:
> +        BUILD_BUG_ON(PROG_none != 0);
> +
> +    PROGRESS(tee):
> +        ret = tee_domain_teardown(d);
> +        if ( ret )
> +            return ret;
> +        break;
> +
> +    PROGRESS(done):
> +        break;
> +
> +#undef PROGRESS
> +
> +    default:
> +        BUG();
> +    }
> +
>       return 0;
>   }
>   
> diff --git a/xen/arch/arm/include/asm/tee/tee.h b/xen/arch/arm/include/asm/tee/tee.h
> index f483986385c8..da324467e130 100644
> --- a/xen/arch/arm/include/asm/tee/tee.h
> +++ b/xen/arch/arm/include/asm/tee/tee.h
> @@ -34,6 +34,7 @@ struct tee_mediator_ops {
>        * guest and create own structures for the new domain.
>        */
>       int (*domain_init)(struct domain *d);
> +    int (*domain_teardown)(struct domain *d);
>   
>       /*
>        * Called during domain destruction to relinquish resources used
> @@ -62,6 +63,7 @@ struct tee_mediator_desc {
>   
>   bool tee_handle_call(struct cpu_user_regs *regs);
>   int tee_domain_init(struct domain *d, uint16_t tee_type);
> +int tee_domain_teardown(struct domain *d);
>   int tee_relinquish_resources(struct domain *d);
>   uint16_t tee_get_type(void);
>   
> @@ -93,6 +95,11 @@ static inline int tee_relinquish_resources(struct domain *d)
>       return 0;
>   }
>   
> +static inline int tee_domain_teardown(struct domain *d)
> +{
> +    return 0;
> +}
> +
>   static inline uint16_t tee_get_type(void)
>   {
>       return XEN_DOMCTL_CONFIG_TEE_NONE;
> diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
> index 301d205a36c5..c91bd7d5ac25 100644
> --- a/xen/arch/arm/tee/optee.c
> +++ b/xen/arch/arm/tee/optee.c
> @@ -268,6 +268,11 @@ static int optee_domain_init(struct domain *d)
>       return 0;
>   }
>   
> +static int optee_domain_teardown(struct domain *d)
> +{
> +    return 0;

I think for OP-TEE, we also need to moved the smc call to destroy the VM 
here. I am OK if this is not handled here, but it would be worth 
mentioning in the commit message.

> +}
> +
>   static uint64_t regpair_to_uint64(register_t reg0, register_t reg1)
>   {
>       return ((uint64_t)reg0 << 32) | (uint32_t)reg1;
> @@ -1732,6 +1737,7 @@ static const struct tee_mediator_ops optee_ops =
>   {
>       .probe = optee_probe,
>       .domain_init = optee_domain_init,
> +    .domain_teardown = optee_domain_teardown,
>       .relinquish_resources = optee_relinquish_resources,
>       .handle_call = optee_handle_call,
>   };
> diff --git a/xen/arch/arm/tee/tee.c b/xen/arch/arm/tee/tee.c
> index 3964a8a5cddf..ddd17506a9ff 100644
> --- a/xen/arch/arm/tee/tee.c
> +++ b/xen/arch/arm/tee/tee.c
> @@ -52,6 +52,14 @@ int tee_domain_init(struct domain *d, uint16_t tee_type)
>       return cur_mediator->ops->domain_init(d);
>   }
>   
> +int tee_domain_teardown(struct domain *d)
> +{
> +    if ( !cur_mediator )
> +        return 0;
> +
> +    return cur_mediator->ops->domain_teardown(d);

NIT: I would consider to check if the callback is NULL. This would avoid 
providing dummy helper.

> +}
> +
>   int tee_relinquish_resources(struct domain *d)
>   {
>       if ( !cur_mediator )

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:08:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:08:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562148.878715 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJWlC-0007cV-1P; Wed, 12 Jul 2023 10:07:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562148.878715; Wed, 12 Jul 2023 10:07:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJWlB-0007cO-Uk; Wed, 12 Jul 2023 10:07:49 +0000
Received: by outflank-mailman (input) for mailman id 562148;
 Wed, 12 Jul 2023 10:07:49 +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 <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJWlB-0007cI-4g
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:07:49 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20620.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::620])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f32ba2aa-209b-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:07:47 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PA4PR04MB8000.eurprd04.prod.outlook.com (2603:10a6:102:c1::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 10:07:45 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 10:07:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f32ba2aa-209b-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CkPiKBlZN/fFJMKyrbeWSJ2DmNfJ5HaMuE2IdgupRv4xKDkPl3YKJX751AbeY+G88drI2HGbSQXN/eMpZcTdmS3wTg4hYpcXv7CwlEz5N4cMTUxJ4nkkq4bOCZe+ycuh23nSL3X3Vv3rTFUvoRILbx6+X4TAFXzUFqgGa5NCET2p0035cU6//eoA8PBPUKmnDtMi8HrgjDqPD0Oqz+s9fYNNACGuKnpqdBiCxs+3tcKLmpKy+Gxph0SRCTjNpBmWPc6WKLCW3V1L33/3scGIzovLdCMyiuT/NHAZuLC4OG4cYaoJ+EmO2qF7dTTQ8/Y2VhN3N1B2R4Jp28Xv8uR2Sg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=B+iMhMfZqS4SfJnc88TfPDC2rHM5kkJJBDlvptMm4o8=;
 b=fycW0JCDQz8c3naQjusQeXJiBbFcxMVhWjyQd6LLO4YK5XLoeKR764M6VJvAec87Xau8kQeTNschpta7kDfPUgoXNoW0Jfe5DkrvaiHvbI4kncJp7Gr1+7A08ms2M41VovibrIuyb9chaQd6W2ia25/pnLDhXZIfRBd1+uSq6XBrTbpVkNgH4w0gWuRqn31krBej8EGrhRhLa3Tkx9LHkXJMCzXjmFUe/rx7Mk9AkapwkyPJoZW9AfK4peGFTluwEEcQYTxSAOeXs3XhnsTBe3MVrvdfQmQt6VJwhCQVnZXGVkwMm2MIlJfOXOHLLDAbLKrJLgcury4EMkO9+bOGcQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=B+iMhMfZqS4SfJnc88TfPDC2rHM5kkJJBDlvptMm4o8=;
 b=cvyXZ2ilaTIHZM8gGmxvgsWAhOP1GNO+jXvICV9vnpHCL8ROX4aZMwSJxGUD4T4xfE1aqoG9GxX11GfQmwSznyeg1RN2UHijm6pdEHVJpnB874PN4VQ+tAkNBfEwY3X6HRfHZDO+LEwBeEsDUIoYullZ2rlIHSpptvpPgFxnJTTAucndRUkG20vk5YzqiRuuWHveGMKP0NZYBgF2O2w3QGsxKrrL8VrGuZ5T+8AcZI7WBQg5LeiOdVo5ffHL0jeH1T3qW9pagaqG8DVu11/QBlO+OrY8yny6B4y8IQ1a/zUrR9+24OnLmdw0yDqocz3ooeG60gRNVQVlchguVSFK9g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <eb2e3b57-a423-cf52-0192-a344db33a58f@suse.com>
Date: Wed, 12 Jul 2023 12:07:43 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] x86/ioapic: sanitize IO-APIC pins before enabling the
 local APIC
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230707095338.44244-1-roger.pau@citrix.com>
 <92d16012-ff9f-693b-07c6-d45fe07a00a0@suse.com>
 <ZKwZBQ_0Z2c7NJNL@MacBook-Air-de-Roger.local>
 <1f79491a-46f5-5293-e92f-0e2b0b3efb62@suse.com>
 <ZK1S1V71ZUIPjKqZ@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZK1S1V71ZUIPjKqZ@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0196.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a5::14) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PA4PR04MB8000:EE_
X-MS-Office365-Filtering-Correlation-Id: 5736aa16-5e62-4783-beec-08db82bfd65c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	FNXWTa3O2SVLGUiOJLRbYmZAsfqZai2WRw2zCQsywzv3hSgTcn/BCQSjN/G7vlhDtfah/1musTbZ8YEROTRwSS/zwVKHV8Wh8Av/od6ezQI2dMiEAxvYgVSgdhYThRh8BEupR4G+J2OLrUqXW3VrTok9cWheqjHnKV8JMJn0xa9mvfbJZgYRnloAHELB1mtDpHKUwoeIvbSBbGCGleOEfPTH1AcHTfO5QWroOp5hfP/okbICHifN/nH2LRJeFit/cDxqTxSVvOUxDq243NM1S4klov5ecfyjSbKlyfhKRYQB/b82fQOFPrRd5lowkdmAr/04wZZQIYKDwLfSBT9sJdXwLfm9OdilMLxvgr7L7PgVgUoYqTcQeYAIfDkNtgW5vF/FICZlMmf6X8W/wjmIUDFyn6kixlaTiRzqFi16Ml1U9iMy3Lii781MUshML9MeaEjnMOmTTQCPcPLOlBnoCWWuXRzaeh/v9tDVjiRlGZk9LLpics0gRJeYZs0SihClsEIrdyKQ/AfGmw920iAK1SHaLhGeCd2i6zeR6tGF0ov1RVTflchVje9H5KvG1HTdX497KnVvMLW1KebAT6YIzD/kzSRpw/VGItW3CyjJ0PDSD9BjNjo9fFfu/55NaLBBs7lfAaMeQmr9hYcUHEvLKQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(376002)(136003)(366004)(346002)(39860400002)(451199021)(31686004)(66899021)(2906002)(54906003)(478600001)(6486002)(36756003)(8676002)(8936002)(66556008)(66476007)(66946007)(41300700001)(4326008)(6916009)(316002)(83380400001)(6512007)(38100700002)(5660300002)(86362001)(31696002)(6506007)(26005)(2616005)(186003)(53546011)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RWtZSnR5NlZRajdOcUMySlUwK1ZFL0x1RVVXR3h0cGVuZzdzRU1Ed1FwbytZ?=
 =?utf-8?B?WUJwemVmbnR1SS91QzU0ZEowbW45UmRCbGJWdXFxbG12VytKdDlpQ01nVEZu?=
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Zk1NQjY5Ull2bUhPSTZBS3laV1JBc1lG?=
 =?utf-8?B?NFk3OGl5d1FWZFRnQW40ZmtmdHJxZ3QwUWJvSkIzVWFQNTUxS256ZEl3Mmpa?=
 =?utf-8?B?TnY3Qk1HWUp4RmRaK3JIdXhUYVlabnpDenhaRDdmUVBwbjFqUjlaVUdMWEp6?=
 =?utf-8?B?TEFwZVdBVmFKaytyQjZRQzcrTVFIc3lubHJGR0pvSzlEcjN0N2JPN09oUjVu?=
 =?utf-8?B?aTB3RXpvRmRWTGxGTjRCTVlaZk1IQlIxa21ucjZLeGlFU29KN243Q0J4c1FQ?=
 =?utf-8?Q?XKflsU/T7/EkH3UgAbyn+uozg?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5736aa16-5e62-4783-beec-08db82bfd65c
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 10:07:45.0732
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: KesU5tkkpV3oDaQqGkMxIcIuXGWcNKDtslj+a6PBI1k0dP2FlMzCMtk+vs6SrJoiK76wsXkAf+ugjLXyY12WLQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB8000

On 11.07.2023 15:02, Roger Pau MonnÃ© wrote:
> On Tue, Jul 11, 2023 at 12:53:31PM +0200, Jan Beulich wrote:
>> On 10.07.2023 16:43, Roger Pau MonnÃ© wrote:
>>> On Mon, Jul 10, 2023 at 12:56:27PM +0200, Jan Beulich wrote:
>>>> On 07.07.2023 11:53, Roger Pau Monne wrote:
>>>>> The current logic to init the local APIC and the IO-APIC does init the
>>>>> former first before doing any kind of sanitation on the IO-APIC pin
>>>>> configuration.  It's already noted on enable_IO_APIC() that Xen
>>>>> shouldn't trust the IO-APIC being empty at bootup.
>>>>>
>>>>> At XenServer we have a system where the IO-APIC 0 is handed to Xen
>>>>> with pin 0 unmasked, set to Fixed delivery mode, edge triggered and
>>>>> with a vector of 0 (all fields of the RTE are zeroed).  Once the local
>>>>> APIC is enabled periodic injections from such pin cause a storm of
>>>>> errors:
>>>>>
>>>>> APIC error on CPU0: 00(40), Received illegal vector
>>>>> APIC error on CPU0: 40(40), Received illegal vector
>>>>> APIC error on CPU0: 40(40), Received illegal vector
>>>>> APIC error on CPU0: 40(40), Received illegal vector
>>>>> APIC error on CPU0: 40(40), Received illegal vector
>>>>> APIC error on CPU0: 40(40), Received illegal vector
>>>>>
>>>>> That prevents Xen from booting.
>>>>
>>>> And I expect no RTE is in ExtInt mode, so one might conclude that
>>>> firmware meant to set up RTE 0 that way. Mainly as a remark, albeit
>>>> of course there's then the question whether to change the RTE
>>>> rather than masking it. What do ACPI tables say?
>>>
>>> There's one relevant override:
>>>
>>> [668h 1640   1]                Subtable Type : 02 [Interrupt Source Override]
>>> [669h 1641   1]                       Length : 0A
>>> [66Ah 1642   1]                          Bus : 00
>>> [66Bh 1643   1]                       Source : 00
>>> [66Ch 1644   4]                    Interrupt : 00000002
>>> [670h 1648   2]        Flags (decoded below) : 0000
>>>                                     Polarity : 0
>>>                                 Trigger Mode : 0
>>>
>>> So IRQ 0 -> GSI 2, so it's likely pin 0 is the one the i8259 is
>>> connected to.
>>
>> Then wouldn't we be better off converting that RTE to ExtInt? That
>> would allow PIC IRQs (not likely to exist, but still) to work
>> (without undue other side effects afaics), whereas masking this RTE
>> would not.
> 
> I'm kind of worry of trying to automate this logic.  Should we always
> convert pin 0 to ExtInt if it's found unmasked, with and invalid
> vector and there's a source override entry for the IRQ?
> 
> It seems weird to infer this just from the fact that pin 0 is all
> zeroed out.

As you say in the earlier paragraph, it wouldn't be just that. It's
unmasked + bad vector + present source override (indicating that
nothing except perhaps a PIC is connected to the pin).

>>>>> --- a/xen/arch/x86/apic.c
>>>>> +++ b/xen/arch/x86/apic.c
>>>>> @@ -1476,6 +1476,10 @@ int __init APIC_init_uniprocessor (void)
>>>>>          return -1;
>>>>>      }
>>>>>  
>>>>> +    if ( smp_found_config && !skip_ioapic_setup && nr_ioapics )
>>>>> +        /* Sanitize the IO-APIC pins before enabling the local APIC. */
>>>>> +        sanitize_IO_APIC();
>>>>
>>>> I'm a little puzzled by the smp_found_config part of the check here,
>>>> but not in smp_prepare_cpus(). What's the reason for (a) the check
>>>> and (b) the difference?
>>>
>>> This just mimics what gates the call to setup_IO_APIC() in that same
>>> function.  It makes no sense to call sanitize_IO_APIC() if
>>> setup_IO_APIC() is not called, and I wasn't planning on changing the
>>> logic that gates the call setup_IO_APIC() in this patch.
>>>
>>> I did note the difference with smp_prepare_cpus(), and I think we
>>> should look at unifying those paths, but didn't want to do it as part
>>> of this fix.
>>
>> Well, consistency is one valid goal. But masking RTEs may need to be
>> done more aggressively than setting up the IO-APICs. In particular
>> if we're not to use them, we still want to mask all RTEs. Otherwise
>> we're likely to observe each IRQ to arrive via two separate routes
>> (once through the 8259 and once from an unmasked IO-APIC pin).
> 
> So avoid the smp_found_config check here and use the same condition as in
> smp_prepare_cpus(), I will adjust the patch to that effect.
> 
> I do wonder why we don't simply mandate IO-APIC usage and get rid of
> the code to handle the 8259.  Is it only to cope with systems that
> have a broken IO-APIC configuration?  Because I don't think there are
> x86 64bit systems without an IO-APIC?

There shouldn't be, yes. And Andrew has been suggesting the same on a
number of occasions, iirc. Yet trying to remove that code is perhaps
more risky than simply keeping it, which may be (besides time
constraints) why nobody has made an attempt so far.

>>>> Isn't checking nr_ioapics sufficient in this
>>>> regard? (b) probably could be addressed by moving the code to the
>>>> beginning of verify_local_APIC(), immediately ahead of which you
>>>> insert both call sites. (At which point the function may want naming
>>>> verify_IO_APIC() for consistency, but that's surely minor.)
>>>
>>> I wanted the call to sanitize_IO_APIC() to be done at the same level
>>> where the call to setup_IO_APIC() is done, because it makes the logic
>>> clearer.
>>
>> Hmm, I see.
>>
>>>> As to also checking skip_ioapic_setup - wouldn't the unmasked pin be
>>>> similarly troublesome in that case?
>>>
>>> skip_ioapic_setup is set when the IO-APIC address in the MADT is
>>> invalid, so in that case attempting to access IO-APIC registers in
>>> that case won't lead to anything good.
>>
>> Of course, as I did say as well. Still if for some IO-APICs we know
>> their addresses, we would still be able to deal with those (if we
>> were to stick to this mask-all-RTEs-early model).
> 
> The issue is that ioapic_init_mappings() will refuse to process
> further IO-APIC entries once an entry with address 0 is found.  We
> could change that, but I would likely do it as an improvement rather
> than tie it to this change.

Sure, I didn't mean to suggest that such needs to be done right here
(it could though, but chances are that this would quickly grow too
much). What we want to do right here is make the change maximally
useful without needing to tweak overly many other places in the code.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:08:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:08:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562126.878726 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJWlc-000808-8r; Wed, 12 Jul 2023 10:08:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562126.878726; Wed, 12 Jul 2023 10:08:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJWlc-000801-6B; Wed, 12 Jul 2023 10:08:16 +0000
Received: by outflank-mailman (input) for mailman id 562126;
 Wed, 12 Jul 2023 09:47:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=MfTd=C6=pengutronix.de=ukl@srs-se1.protection.inumbo.net>)
 id 1qJWRK-0004QP-6f
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 09:47:18 +0000
Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de
 [2001:67c:670:201:290:27ff:fe1d:cc33])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 15384c7b-2099-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 11:47:16 +0200 (CEST)
Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2])
 by metis.ext.pengutronix.de with esmtps
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJWRB-0001GF-JB; Wed, 12 Jul 2023 11:47:09 +0200
Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de)
 by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJWR9-00Dr3Q-1n; Wed, 12 Jul 2023 11:47:07 +0200
Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJWR6-004GRw-Py; Wed, 12 Jul 2023 11:47:04 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 15384c7b-2099-11ee-b239-6b7b168915f2
From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	Alex Deucher <alexander.deucher@amd.com>,
	=?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
	Hamza Mahfooz <hamza.mahfooz@amd.com>,
	Javier Martinez Canillas <javierm@redhat.com>,
	Guchun Chen <guchun.chen@amd.com>,
	Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
	Evan Quan <evan.quan@amd.com>,
	Likun Gao <Likun.Gao@amd.com>,
	=?utf-8?b?TWFyZWsgT2zFocOhaw==?= <marek.olsak@amd.com>,
	David Francis <David.Francis@amd.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>,
	Graham Sider <Graham.Sider@amd.com>,
	Lang Yu <Lang.Yu@amd.com>,
	Philip Yang <Philip.Yang@amd.com>,
	Yifan Zhang <yifan1.zhang@amd.com>,
	Tim Huang <Tim.Huang@amd.com>,
	Zack Rusin <zackr@vmware.com>,
	Sam Ravnborg <sam@ravnborg.org>,
	Jani Nikula <jani.nikula@intel.com>,
	xurui <xurui@kylinos.cn>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	=?utf-8?q?Ma=C3=ADra_Canal?= <mairacanal@riseup.net>,
	=?utf-8?q?Andr=C3=A9_Almeida?= <andrealmeid@igalia.com>,
	Qingqing Zhuo <qingqing.zhuo@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	Hersen Wu <hersenxs.wu@amd.com>,
	Fangzhi Zuo <jerry.zuo@amd.com>,
	Stylon Wang <stylon.wang@amd.com>,
	Alan Liu <haoping.liu@amd.com>,
	Wayne Lin <Wayne.Lin@amd.com>,
	Aaron Liu <aaron.liu@amd.com>,
	Melissa Wen <mwen@igalia.com>,
	Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
	David Tadokoro <davidbtadokoro@usp.br>,
	Wenjing Liu <wenjing.liu@amd.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
	Roman Li <roman.li@amd.com>,
	=?utf-8?q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= <samsagax@gmail.com>,
	Dave Airlie <airlied@redhat.com>,
	Russell King <linux@armlinux.org.uk>,
	Liviu Dudau <liviu.dudau@arm.com>,
	Joel Stanley <joel@jms.id.au>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	Inki Dae <inki.dae@samsung.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Stefan Agner <stefan@agner.ch>,
	Alison Wang <alison.wang@nxp.com>,
	Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
	=?utf-8?q?Noralf_Tr=C3=B8nnes?= <noralf@tronnes.org>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Tian Tao <tiantao6@hisilicon.com>,
	Danilo Krummrich <dakr@redhat.com>,
	Deepak Rawat <drawat.floss@gmail.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	=?utf-8?b?VmlsbGUgU3lyasOkbMOk?= <ville.syrjala@linux.intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>,
	Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
	Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Luca Coelho <luciano.coelho@intel.com>,
	Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Vinod Govindapillai <vinod.govindapillai@intel.com>,
	=?utf-8?q?=C5=81ukasz_Bartosik?= <lb@semihalf.com>,
	Anusha Srivatsa <anusha.srivatsa@intel.com>,
	Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
	Uma Shankar <uma.shankar@intel.com>,
	Imre Deak <imre.deak@intel.com>,
	Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
	Swati Sharma <swati2.sharma@intel.com>,
	=?utf-8?q?Jouni_H=C3=B6gander?= <jouni.hogander@intel.com>,
	Mika Kahola <mika.kahola@intel.com>,
	=?utf-8?q?Jos=C3=A9_Roberto_de_Souza?= <jose.souza@intel.com>,
	Arun R Murthy <arun.r.murthy@intel.com>,
	Gustavo Sousa <gustavo.sousa@intel.com>,
	Khaled Almahallawy <khaled.almahallawy@intel.com>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	Andi Shyti <andi.shyti@linux.intel.com>,
	Nirmoy Das <nirmoy.das@intel.com>,
	Fei Yang <fei.yang@intel.com>,
	Animesh Manna <animesh.manna@intel.com>,
	Deepak R Varma <drv@mailo.com>,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Vandita Kulkarni <vandita.kulkarni@intel.com>,
	Suraj Kandpal <suraj.kandpal@intel.com>,
	Manasi Navare <manasi.d.navare@intel.com>,
	Drew Davenport <ddavenport@chromium.org>,
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Marian Cichy <m.cichy@pengutronix.de>,
	Dan Carpenter <error27@gmail.com>,
	Paul Cercueil <paul@crapouillou.net>,
	Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
	Edmund Dea <edmund.j.dea@intel.com>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Rob Clark <robdclark@gmail.com>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Vinod Polimera <quic_vpolimer@quicinc.com>,
	Jiasheng Jiang <jiasheng@iscas.ac.cn>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Jessica Zhang <quic_jesszhan@quicinc.com>,
	Liu Shixin <liushixin2@huawei.com>,
	Marek Vasut <marex@denx.de>,
	Ben Skeggs <bskeggs@redhat.com>,
	Karol Herbst <kherbst@redhat.com>,
	Lyude Paul <lyude@redhat.com>,
	Tomi Valkeinen <tomba@kernel.org>,
	Emma Anholt <emma@anholt.net>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Sandy Huang <hjc@rock-chips.com>,
	=?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>,
	Orson Zhai <orsonzhai@gmail.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Alain Volmat <alain.volmat@foss.st.com>,
	Yannick Fertre <yannick.fertre@foss.st.com>,
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
	Philippe Cornu <philippe.cornu@foss.st.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Mikko Perttunen <mperttunen@nvidia.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Jyri Sarha <jyri.sarha@iki.fi>,
	David Lechner <david@lechnology.com>,
	Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
	Melissa Wen <melissa.srw@gmail.com>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Michal Simek <michal.simek@amd.com>
Cc: dri-devel@lists.freedesktop.org,
	kernel@pengutronix.de,
	amd-gfx@lists.freedesktop.org,
	Andrew Jeffery <andrew@aj.id.au>,
	linux-aspeed@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org,
	Alim Akhtar <alim.akhtar@samsung.com>,
	linux-samsung-soc@vger.kernel.org,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Yongqin Liu <yongqin.liu@linaro.org>,
	John Stultz <jstultz@google.com>,
	linux-hyperv@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	Lucas Stach <l.stach@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	linux-mips@vger.kernel.org,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
	linux-mediatek@lists.infradead.org,
	Jerome Brunet <jbrunet@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-amlogic@lists.infradead.org,
	Sean Paul <sean@poorly.run>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org,
	nouveau@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org,
	spice-devel@lists.freedesktop.org,
	linux-renesas-soc@vger.kernel.org,
	linux-rockchip@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-sunxi@lists.linux.dev,
	linux-tegra@vger.kernel.org,
	Gurchetan Singh <gurchetansingh@chromium.org>,
	Chia-I Wu <olvaffe@gmail.com>,
	Haneen Mohammed <hamohammed.sa@gmail.com>,
	VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
	xen-devel@lists.xenproject.org
Subject: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to drm_dev
Date: Wed, 12 Jul 2023 11:46:10 +0200
Message-Id: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Developer-Signature: v=1; a=openpgp-sha256; l=17523; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=g0h6pUFpCMsZSSA9DW92MRldVIF/HYPJn1U5OSED4Ao=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkrnZWX6Ep8Mh9kWCztcxEqvN5TuaDYE6kinbEZ tFzpyq4jO+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZK52VgAKCRCPgPtYfRL+ TsPMB/49FCi0Fz5HIM5DCGfnqOdHB/qWvY7uvziD9RS5BcPOs0rO6eNoFXwd7zCQeNkBU4XFeJF u/6EbJIDqeVPfUKmBibfD9qdfNglcVJoCxEgQYjIUkaV4yL6URwaPqqsNxuALgWq2PT5/Y0k+Ch 2FrLsGtb8gp3cr6Uou8N41F5mrJVBOXkr6mkjg+vwR6LMyIr/ndMeQT1kNNxNR/aNH5kXskHHcZ 8Ibgpz8zVO0KDpgc2Y5Q8OTExPWdq5TT7Ij4uJxmWGpadjphaVEeYdWmzMz7rOV5wdpoFds7ggc Bzj2ZWEFXa0Sc3uW5bxUyhRVJGE/aNbEuELxvP0s5Ncxpikk
X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6
Content-Transfer-Encoding: 8bit
X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2
X-SA-Exim-Mail-From: ukl@pengutronix.de
X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false
X-PTX-Original-Recipient: xen-devel@lists.xenproject.org

Hello,

while I debugged an issue in the imx-lcdc driver I was constantly
irritated about struct drm_device pointer variables being named "dev"
because with that name I usually expect a struct device pointer.

I think there is a big benefit when these are all renamed to "drm_dev".
I have no strong preference here though, so "drmdev" or "drm" are fine
for me, too. Let the bikesheding begin!

Some statistics:

$ git grep -ohE 'struct drm_device *\* *[^ (),;]*' v6.5-rc1 | sort | uniq -c | sort -n
      1 struct drm_device *adev_to_drm
      1 struct drm_device *drm_
      1 struct drm_device          *drm_dev
      1 struct drm_device        *drm_dev
      1 struct drm_device *pdev
      1 struct drm_device *rdev
      1 struct drm_device *vdev
      2 struct drm_device *dcss_drv_dev_to_drm
      2 struct drm_device **ddev
      2 struct drm_device *drm_dev_alloc
      2 struct drm_device *mock
      2 struct drm_device *p_ddev
      5 struct drm_device *device
      9 struct drm_device * dev
     25 struct drm_device *d
     95 struct drm_device *
    216 struct drm_device *ddev
    234 struct drm_device *drm_dev
    611 struct drm_device *drm
   4190 struct drm_device *dev

This series starts with renaming struct drm_crtc::dev to drm_dev. If
it's not only me and others like the result of this effort it should be
followed up by adapting the other structs and the individual usages in
the different drivers.

To make this series a bit easier handleable, I first added an alias for
drm_crtc::dev, then converted the drivers one after another and the last
patch drops the "dev" name. This has the advantage of being easier to
review, and if I should have missed an instance only the last patch must
be dropped/reverted. Also this series might conflict with other patches,
in this case the remaining patches can still go in (apart from the last
one of course). Maybe it also makes sense to delay applying the last
patch by one development cycle?

The series was compile tested for arm, arm64, powerpc and amd64 using an
allmodconfig (though I only build drivers/gpu/).

Best regards
Uwe

Uwe Kleine-KÃ¶nig (52):
  drm/crtc: Start renaming struct drm_crtc::dev to drm_dev
  drm/core: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/amd: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/armada: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/arm: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/aspeed: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/ast: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/atmel-hlcdc: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/exynos: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/fsl-dcu: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/gma500: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/gud: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/hisilicon: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/hyperv: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/i915: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/imx: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/ingenic: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/kmb: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/logicvc: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/mcde: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/mediatek: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/meson: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/mgag200: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/msm: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/mxsfb: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/nouveau: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/omapdrm: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/panel-ili9341: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/pl111: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/qxl: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/radeon: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/renesas: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/rockchip: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/solomon: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/sprd: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/sti: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/stm: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/sun4i: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/tegra: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/tidss: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/tilcdc: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/tiny: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/tve200: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/udl: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/vboxvideo: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/vc4: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/virtio: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/vkms: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/vmwgfx: Use struct drm_crtc::drm_dev instead of struct
    drm_crtc::dev
  drm/xen: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/xlnx: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
  drm/crtc: Complete renaming struct drm_crtc::dev to drm_dev

 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   |  18 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c       |   6 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c       |   6 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c      |   8 +-
 drivers/gpu/drm/amd/amdgpu/atombios_crtc.c    |  22 +--
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c        |  26 +--
 drivers/gpu/drm/amd/amdgpu/dce_v11_0.c        |  28 ++--
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c         |  26 +--
 drivers/gpu/drm/amd/amdgpu/dce_v8_0.c         |  26 +--
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  29 ++--
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c |  20 +--
 .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c    |   8 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c |  22 +--
 .../amd/display/amdgpu_dm/amdgpu_dm_plane.c   |   2 +-
 .../gpu/drm/arm/display/komeda/komeda_crtc.c  |  24 +--
 .../gpu/drm/arm/display/komeda/komeda_kms.c   |   2 +-
 drivers/gpu/drm/arm/hdlcd_crtc.c              |   4 +-
 drivers/gpu/drm/arm/malidp_crtc.c             |   7 +-
 drivers/gpu/drm/armada/armada_crtc.c          |  10 +-
 drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c      |   6 +-
 drivers/gpu/drm/ast/ast_dp.c                  |   2 +-
 drivers/gpu/drm/ast/ast_mode.c                |  26 +--
 .../gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c    |  10 +-
 drivers/gpu/drm/drm_atomic.c                  |  22 +--
 drivers/gpu/drm/drm_atomic_helper.c           |  20 ++-
 drivers/gpu/drm/drm_atomic_state_helper.c     |   2 +-
 drivers/gpu/drm/drm_atomic_uapi.c             |  22 +--
 drivers/gpu/drm/drm_blend.c                   |   2 +-
 drivers/gpu/drm/drm_color_mgmt.c              |  10 +-
 drivers/gpu/drm/drm_crtc.c                    |  19 ++-
 drivers/gpu/drm/drm_crtc_helper.c             |  10 +-
 drivers/gpu/drm/drm_debugfs.c                 |   2 +-
 drivers/gpu/drm/drm_debugfs_crc.c             |   2 +-
 drivers/gpu/drm/drm_fb_helper.c               |   6 +-
 drivers/gpu/drm/drm_mipi_dbi.c                |   4 +-
 drivers/gpu/drm/drm_plane.c                   |   2 +-
 drivers/gpu/drm/drm_plane_helper.c            |   2 +-
 drivers/gpu/drm/drm_self_refresh_helper.c     |   2 +-
 drivers/gpu/drm/drm_vblank.c                  |  40 ++---
 drivers/gpu/drm/drm_vblank_work.c             |   2 +-
 drivers/gpu/drm/exynos/exynos_drm_crtc.c      |   8 +-
 drivers/gpu/drm/exynos/exynos_drm_plane.c     |   4 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c    |  16 +-
 drivers/gpu/drm/gma500/cdv_intel_display.c    |   2 +-
 drivers/gpu/drm/gma500/cdv_intel_dp.c         |   2 +-
 drivers/gpu/drm/gma500/gma_display.c          |  20 +--
 drivers/gpu/drm/gma500/oaktrail_crtc.c        |   8 +-
 drivers/gpu/drm/gma500/oaktrail_hdmi.c        |   4 +-
 drivers/gpu/drm/gma500/psb_intel_display.c    |   2 +-
 drivers/gpu/drm/gma500/psb_irq.c              |   6 +-
 drivers/gpu/drm/gud/gud_pipe.c                |   6 +-
 .../gpu/drm/hisilicon/hibmc/hibmc_drm_de.c    |  20 +--
 .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c   |   4 +-
 drivers/gpu/drm/hyperv/hyperv_drm_modeset.c   |   6 +-
 drivers/gpu/drm/i915/display/g4x_dp.c         |   4 +-
 drivers/gpu/drm/i915/display/hsw_ips.c        |  16 +-
 drivers/gpu/drm/i915/display/i9xx_plane.c     |   4 +-
 drivers/gpu/drm/i915/display/i9xx_wm.c        |  40 ++---
 drivers/gpu/drm/i915/display/icl_dsi.c        |   2 +-
 drivers/gpu/drm/i915/display/intel_atomic.c   |   2 +-
 .../gpu/drm/i915/display/intel_atomic_plane.c |   4 +-
 drivers/gpu/drm/i915/display/intel_audio.c    |   2 +-
 drivers/gpu/drm/i915/display/intel_bw.c       |  10 +-
 drivers/gpu/drm/i915/display/intel_cdclk.c    |   6 +-
 drivers/gpu/drm/i915/display/intel_color.c    | 124 +++++++-------
 drivers/gpu/drm/i915/display/intel_crtc.c     |  20 +--
 .../drm/i915/display/intel_crtc_state_dump.c  |   4 +-
 drivers/gpu/drm/i915/display/intel_cursor.c   |   2 +-
 drivers/gpu/drm/i915/display/intel_ddi.c      |  28 ++--
 drivers/gpu/drm/i915/display/intel_display.c  | 154 +++++++++---------
 .../gpu/drm/i915/display/intel_display_irq.c  |  22 +--
 .../gpu/drm/i915/display/intel_display_rps.c  |   2 +-
 .../drm/i915/display/intel_display_trace.h    |  12 +-
 drivers/gpu/drm/i915/display/intel_dp.c       |   2 +-
 drivers/gpu/drm/i915/display/intel_dpll.c     |  38 ++---
 drivers/gpu/drm/i915/display/intel_dpll_mgr.c |  44 ++---
 drivers/gpu/drm/i915/display/intel_dpt.c      |   2 +-
 drivers/gpu/drm/i915/display/intel_drrs.c     |  10 +-
 drivers/gpu/drm/i915/display/intel_dsb.c      |   8 +-
 drivers/gpu/drm/i915/display/intel_fbc.c      |   2 +-
 drivers/gpu/drm/i915/display/intel_fdi.c      |  22 +--
 .../drm/i915/display/intel_fifo_underrun.c    |   6 +-
 drivers/gpu/drm/i915/display/intel_hdmi.c     |   2 +-
 .../drm/i915/display/intel_modeset_setup.c    |  22 +--
 .../drm/i915/display/intel_modeset_verify.c   |   2 +-
 drivers/gpu/drm/i915/display/intel_panel.c    |   4 +-
 .../gpu/drm/i915/display/intel_pch_display.c  |  32 ++--
 .../gpu/drm/i915/display/intel_pch_refclk.c   |   2 +-
 drivers/gpu/drm/i915/display/intel_pipe_crc.c |  10 +-
 .../drm/i915/display/intel_plane_initial.c    |   6 +-
 drivers/gpu/drm/i915/display/intel_psr.c      |  14 +-
 drivers/gpu/drm/i915/display/intel_sdvo.c     |   2 +-
 drivers/gpu/drm/i915/display/intel_vblank.c   |  24 +--
 drivers/gpu/drm/i915/display/intel_vdsc.c     |  18 +-
 drivers/gpu/drm/i915/display/intel_vrr.c      |  18 +-
 drivers/gpu/drm/i915/display/skl_scaler.c     |  10 +-
 .../drm/i915/display/skl_universal_plane.c    |   6 +-
 drivers/gpu/drm/i915/display/skl_watermark.c  |  42 ++---
 drivers/gpu/drm/i915/display/vlv_dsi.c        |   2 +-
 drivers/gpu/drm/imx/dcss/dcss-crtc.c          |  20 +--
 drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c        |  15 +-
 drivers/gpu/drm/imx/lcdc/imx-lcdc.c           |  16 +-
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c     |   4 +-
 drivers/gpu/drm/kmb/kmb_crtc.c                |  16 +-
 drivers/gpu/drm/logicvc/logicvc_crtc.c        |  14 +-
 drivers/gpu/drm/mcde/mcde_display.c           |  18 +-
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c       |  22 +--
 drivers/gpu/drm/meson/meson_crtc.c            |  12 +-
 drivers/gpu/drm/mgag200/mgag200_g200.c        |   4 +-
 drivers/gpu/drm/mgag200/mgag200_g200eh.c      |   2 +-
 drivers/gpu/drm/mgag200/mgag200_g200er.c      |   4 +-
 drivers/gpu/drm/mgag200/mgag200_g200ev.c      |   4 +-
 drivers/gpu/drm/mgag200/mgag200_g200se.c      |   6 +-
 drivers/gpu/drm/mgag200/mgag200_g200wb.c      |   2 +-
 drivers/gpu/drm/mgag200/mgag200_mode.c        |  10 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c |   6 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c      |  70 ++++----
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c       |   2 +-
 drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c     |  12 +-
 drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c     |  20 +--
 drivers/gpu/drm/msm/msm_drv.c                 |   4 +-
 drivers/gpu/drm/mxsfb/lcdif_kms.c             |  18 +-
 drivers/gpu/drm/mxsfb/mxsfb_kms.c             |  16 +-
 drivers/gpu/drm/nouveau/dispnv04/crtc.c       |  58 +++----
 drivers/gpu/drm/nouveau/dispnv04/cursor.c     |  10 +-
 drivers/gpu/drm/nouveau/dispnv50/atom.h       |   2 +-
 drivers/gpu/drm/nouveau/dispnv50/crc.c        |  30 ++--
 drivers/gpu/drm/nouveau/dispnv50/crc907d.c    |   6 +-
 drivers/gpu/drm/nouveau/dispnv50/crcc37d.c    |   6 +-
 drivers/gpu/drm/nouveau/dispnv50/crcc57d.c    |   2 +-
 drivers/gpu/drm/nouveau/dispnv50/disp.c       |   5 +-
 drivers/gpu/drm/nouveau/dispnv50/head.c       |   4 +-
 drivers/gpu/drm/nouveau/dispnv50/head507d.c   |  26 +--
 drivers/gpu/drm/nouveau/dispnv50/head827d.c   |  10 +-
 drivers/gpu/drm/nouveau/dispnv50/head907d.c   |  26 +--
 drivers/gpu/drm/nouveau/dispnv50/head917d.c   |   6 +-
 drivers/gpu/drm/nouveau/dispnv50/headc37d.c   |  18 +-
 drivers/gpu/drm/nouveau/dispnv50/headc57d.c   |  10 +-
 drivers/gpu/drm/nouveau/nouveau_connector.h   |   2 +-
 drivers/gpu/drm/nouveau/nouveau_display.c     |   2 +-
 drivers/gpu/drm/omapdrm/omap_crtc.c           |  56 +++----
 drivers/gpu/drm/omapdrm/omap_irq.c            |   6 +-
 drivers/gpu/drm/panel/panel-ilitek-ili9341.c  |   4 +-
 drivers/gpu/drm/pl111/pl111_display.c         |  16 +-
 drivers/gpu/drm/qxl/qxl_display.c             |   2 +-
 drivers/gpu/drm/radeon/atombios_crtc.c        |  54 +++---
 drivers/gpu/drm/radeon/radeon_cursor.c        |  14 +-
 drivers/gpu/drm/radeon/radeon_display.c       |  28 ++--
 drivers/gpu/drm/radeon/radeon_kms.c           |   6 +-
 drivers/gpu/drm/radeon/radeon_legacy_crtc.c   |  16 +-
 .../gpu/drm/renesas/rcar-du/rcar_du_crtc.c    |  14 +-
 .../gpu/drm/renesas/shmobile/shmob_drm_crtc.c |  20 +--
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c   |   8 +-
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c  |  15 +-
 drivers/gpu/drm/solomon/ssd130x.c             |   2 +-
 drivers/gpu/drm/sprd/sprd_dpu.c               |   6 +-
 drivers/gpu/drm/sti/sti_crtc.c                |  14 +-
 drivers/gpu/drm/stm/ltdc.c                    |  12 +-
 drivers/gpu/drm/sun4i/sun4i_crtc.c            |  12 +-
 drivers/gpu/drm/tegra/dc.c                    |  12 +-
 drivers/gpu/drm/tidss/tidss_crtc.c            |  19 ++-
 drivers/gpu/drm/tidss/tidss_irq.c             |   4 +-
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c          |  43 ++---
 drivers/gpu/drm/tiny/bochs.c                  |   6 +-
 drivers/gpu/drm/tiny/cirrus.c                 |   2 +-
 drivers/gpu/drm/tiny/gm12u320.c               |   4 +-
 drivers/gpu/drm/tiny/hx8357d.c                |   4 +-
 drivers/gpu/drm/tiny/ili9163.c                |   4 +-
 drivers/gpu/drm/tiny/ili9225.c                |   8 +-
 drivers/gpu/drm/tiny/ili9341.c                |   4 +-
 drivers/gpu/drm/tiny/ili9486.c                |   4 +-
 drivers/gpu/drm/tiny/mi0283qt.c               |   4 +-
 drivers/gpu/drm/tiny/ofdrm.c                  |   8 +-
 drivers/gpu/drm/tiny/panel-mipi-dbi.c         |   6 +-
 drivers/gpu/drm/tiny/repaper.c                |   8 +-
 drivers/gpu/drm/tiny/simpledrm.c              |   2 +-
 drivers/gpu/drm/tiny/st7586.c                 |   6 +-
 drivers/gpu/drm/tiny/st7735r.c                |   4 +-
 drivers/gpu/drm/tve200/tve200_display.c       |  14 +-
 drivers/gpu/drm/udl/udl_modeset.c             |   4 +-
 drivers/gpu/drm/vboxvideo/vbox_mode.c         |   6 +-
 drivers/gpu/drm/vc4/vc4_crtc.c                |  38 ++---
 drivers/gpu/drm/vc4/vc4_hdmi.c                |   2 +-
 drivers/gpu/drm/vc4/vc4_hvs.c                 |  12 +-
 drivers/gpu/drm/vc4/vc4_txp.c                 |   2 +-
 drivers/gpu/drm/virtio/virtgpu_display.c      |   4 +-
 drivers/gpu/drm/vkms/vkms_crtc.c              |  12 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c           |   4 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c          |  10 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c          |   8 +-
 drivers/gpu/drm/xen/xen_drm_front_kms.c       |  10 +-
 drivers/gpu/drm/xlnx/zynqmp_kms.c             |   8 +-
 include/drm/drm_atomic_helper.h               |   2 +-
 include/drm/drm_crtc.h                        |   4 +-
 194 files changed, 1296 insertions(+), 1264 deletions(-)

base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:23:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:23:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562161.878735 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJX0B-0002Db-PD; Wed, 12 Jul 2023 10:23:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562161.878735; Wed, 12 Jul 2023 10:23:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJX0B-0002DU-MW; Wed, 12 Jul 2023 10:23:19 +0000
Received: by outflank-mailman (input) for mailman id 562161;
 Wed, 12 Jul 2023 10:14:28 +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
 <SRS0=6v9O=C6=bootlin.com=paul.kocialkowski@srs-se1.protection.inumbo.net>)
 id 1qJWrb-0001FG-OO
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:14:28 +0000
Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net
 [2001:4b98:dc4:8::229])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e0186156-209c-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:14:24 +0200 (CEST)
Received: by mail.gandi.net (Postfix) with ESMTPSA id A814DFF813;
 Wed, 12 Jul 2023 10:13:38 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e0186156-209c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1;
	t=1689156863;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=pUZeSfojSh8tyQKh/pCOiQO/bJAvUa3k92qKX0dswKM=;
	b=hdRvXwWhgslDICiCkZwZGbTfJKrpN1Anr48dpccrbV0vvt/TF1dEOrGo3SIhj0snd8e3kY
	SrnIYyH49q2K5lQliRUQOpmQ10mxhIc5ivNuAnsUWBZQzqqXMrVjZ8gNBWVgkiYBLwYe9e
	UxXPiD0+6i5/bzsvWCZ9UvPlHqvqryHi0UdAMHhHoe0qTkixfzoYvl5aqHYWfpTI211Xuy
	aIgQBAcuoODejw5o2Z0fqZqIS0RzaKDcpWC15Bz+qrNSkoLKb3cjtnwZaBcDMH108gSwR2
	0qBheI52LJU215IQjQt4e4UxQ7sTp4VA1J0YxEXMmm0nY+tY0d2ZBoBosk6F2g==
Date: Wed, 12 Jul 2023 12:13:38 +0200
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	Alex Deucher <alexander.deucher@amd.com>,
	Christian =?utf-8?B?S8O2bmln?= <christian.koenig@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
	Hamza Mahfooz <hamza.mahfooz@amd.com>,
	Javier Martinez Canillas <javierm@redhat.com>,
	Guchun Chen <guchun.chen@amd.com>,
	Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
	Evan Quan <evan.quan@amd.com>, Likun Gao <Likun.Gao@amd.com>,
	Marek =?utf-8?B?T2zFocOhaw==?= <marek.olsak@amd.com>,
	David Francis <David.Francis@amd.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>,
	Graham Sider <Graham.Sider@amd.com>, Lang Yu <Lang.Yu@amd.com>,
	Philip Yang <Philip.Yang@amd.com>,
	Yifan Zhang <yifan1.zhang@amd.com>, Tim Huang <Tim.Huang@amd.com>,
	Zack Rusin <zackr@vmware.com>, Sam Ravnborg <sam@ravnborg.org>,
	Jani Nikula <jani.nikula@intel.com>, xurui <xurui@kylinos.cn>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	=?utf-8?B?TWHDrXJh?= Canal <mairacanal@riseup.net>,
	=?utf-8?B?QW5kcsOp?= Almeida <andrealmeid@igalia.com>,
	Qingqing Zhuo <qingqing.zhuo@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	Hersen Wu <hersenxs.wu@amd.com>, Fangzhi Zuo <jerry.zuo@amd.com>,
	Stylon Wang <stylon.wang@amd.com>, Alan Liu <haoping.liu@amd.com>,
	Wayne Lin <Wayne.Lin@amd.com>, Aaron Liu <aaron.liu@amd.com>,
	Melissa Wen <mwen@igalia.com>,
	Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
	David Tadokoro <davidbtadokoro@usp.br>,
	Wenjing Liu <wenjing.liu@amd.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
	Roman Li <roman.li@amd.com>,
	=?utf-8?Q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= <samsagax@gmail.com>,
	Dave Airlie <airlied@redhat.com>,
	Russell King <linux@armlinux.org.uk>,
	Liviu Dudau <liviu.dudau@arm.com>, Joel Stanley <joel@jms.id.au>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	Inki Dae <inki.dae@samsung.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Stefan Agner <stefan@agner.ch>, Alison Wang <alison.wang@nxp.com>,
	Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
	Noralf =?utf-8?Q?Tr=C3=B8nnes?= <noralf@tronnes.org>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Tian Tao <tiantao6@hisilicon.com>,
	Danilo Krummrich <dakr@redhat.com>,
	Deepak Rawat <drawat.floss@gmail.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Ville =?utf-8?B?U3lyasOkbMOk?= <ville.syrjala@linux.intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>,
	Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
	Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Luca Coelho <luciano.coelho@intel.com>,
	Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Vinod Govindapillai <vinod.govindapillai@intel.com>,
	=?utf-8?Q?=C5=81ukasz?= Bartosik <lb@semihalf.com>,
	Anusha Srivatsa <anusha.srivatsa@intel.com>,
	Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
	Uma Shankar <uma.shankar@intel.com>,
	Imre Deak <imre.deak@intel.com>,
	Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
	Swati Sharma <swati2.sharma@intel.com>,
	Jouni =?utf-8?B?SMO2Z2FuZGVy?= <jouni.hogander@intel.com>,
	Mika Kahola <mika.kahola@intel.com>,
	=?utf-8?B?Sm9zw6k=?= Roberto de Souza <jose.souza@intel.com>,
	Arun R Murthy <arun.r.murthy@intel.com>,
	Gustavo Sousa <gustavo.sousa@intel.com>,
	Khaled Almahallawy <khaled.almahallawy@intel.com>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	Andi Shyti <andi.shyti@linux.intel.com>,
	Nirmoy Das <nirmoy.das@intel.com>, Fei Yang <fei.yang@intel.com>,
	Animesh Manna <animesh.manna@intel.com>,
	Deepak R Varma <drv@mailo.com>,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Vandita Kulkarni <vandita.kulkarni@intel.com>,
	Suraj Kandpal <suraj.kandpal@intel.com>,
	Manasi Navare <manasi.d.navare@intel.com>,
	Drew Davenport <ddavenport@chromium.org>,
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Marian Cichy <m.cichy@pengutronix.de>,
	Dan Carpenter <error27@gmail.com>,
	Paul Cercueil <paul@crapouillou.net>,
	Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
	Edmund Dea <edmund.j.dea@intel.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Rob Clark <robdclark@gmail.com>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Vinod Polimera <quic_vpolimer@quicinc.com>,
	Jiasheng Jiang <jiasheng@iscas.ac.cn>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Jessica Zhang <quic_jesszhan@quicinc.com>,
	Liu Shixin <liushixin2@huawei.com>, Marek Vasut <marex@denx.de>,
	Ben Skeggs <bskeggs@redhat.com>, Karol Herbst <kherbst@redhat.com>,
	Lyude Paul <lyude@redhat.com>, Tomi Valkeinen <tomba@kernel.org>,
	Emma Anholt <emma@anholt.net>, Gerd Hoffmann <kraxel@redhat.com>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Sandy Huang <hjc@rock-chips.com>,
	Heiko =?utf-8?Q?St=C3=BCbner?= <heiko@sntech.de>,
	Orson Zhai <orsonzhai@gmail.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Alain Volmat <alain.volmat@foss.st.com>,
	Yannick Fertre <yannick.fertre@foss.st.com>,
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
	Philippe Cornu <philippe.cornu@foss.st.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Mikko Perttunen <mperttunen@nvidia.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Jyri Sarha <jyri.sarha@iki.fi>,
	David Lechner <david@lechnology.com>,
	Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
	Melissa Wen <melissa.srw@gmail.com>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Michal Simek <michal.simek@amd.com>,
	dri-devel@lists.freedesktop.org, kernel@pengutronix.de,
	amd-gfx@lists.freedesktop.org, Andrew Jeffery <andrew@aj.id.au>,
	linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
	Alim Akhtar <alim.akhtar@samsung.com>,
	linux-samsung-soc@vger.kernel.org,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Yongqin Liu <yongqin.liu@linaro.org>,
	John Stultz <jstultz@google.com>, linux-hyperv@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	Lucas Stach <l.stach@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>, linux-mips@vger.kernel.org,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
	linux-mediatek@lists.infradead.org,
	Jerome Brunet <jbrunet@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-amlogic@lists.infradead.org, Sean Paul <sean@poorly.run>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
	nouveau@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org,
	spice-devel@lists.freedesktop.org,
	linux-renesas-soc@vger.kernel.org,
	linux-rockchip@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org,
	Gurchetan Singh <gurchetansingh@chromium.org>,
	Chia-I Wu <olvaffe@gmail.com>,
	Haneen Mohammed <hamohammed.sa@gmail.com>,
	VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
Message-ID: <ZK580kHQrDp_JNCH@aptenodytes>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="DbTmTNcmEZJ3sxG3"
Content-Disposition: inline
In-Reply-To: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
X-GND-Sasl: paul.kocialkowski@bootlin.com


--DbTmTNcmEZJ3sxG3
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi Uwe,

On Wed 12 Jul 23, 11:46, Uwe Kleine-K=C3=B6nig wrote:
> Hello,
>=20
> while I debugged an issue in the imx-lcdc driver I was constantly
> irritated about struct drm_device pointer variables being named "dev"
> because with that name I usually expect a struct device pointer.

Well personally I usually expect that the "dev" member of a subsystem-speci=
fic
struct refers to a device of that subsystem, so for me having "dev" refer to
a drm_device for e.g. drm_crtc makes good sense.

I would only expect dev to refer to a struct device in the subsystem-specif=
ic
device structure (drm_device). I don't think it makes much sense to carry
the struct device in any other subsystem-specific structure anyway.

So IMO things are fine as-is but this is not a very strong opinion either.

> I think there is a big benefit when these are all renamed to "drm_dev".
> I have no strong preference here though, so "drmdev" or "drm" are fine
> for me, too. Let the bikesheding begin!

I would definitely prefer "drm_dev" over "drmdev" (hard to read, feels like
aborted camelcase, pretty ugly) or "drm" (too vague).

Cheers,

Paul

> Some statistics:
>=20
> $ git grep -ohE 'struct drm_device *\* *[^ (),;]*' v6.5-rc1 | sort | uniq=
 -c | sort -n
>       1 struct drm_device *adev_to_drm
>       1 struct drm_device *drm_
>       1 struct drm_device          *drm_dev
>       1 struct drm_device        *drm_dev
>       1 struct drm_device *pdev
>       1 struct drm_device *rdev
>       1 struct drm_device *vdev
>       2 struct drm_device *dcss_drv_dev_to_drm
>       2 struct drm_device **ddev
>       2 struct drm_device *drm_dev_alloc
>       2 struct drm_device *mock
>       2 struct drm_device *p_ddev
>       5 struct drm_device *device
>       9 struct drm_device * dev
>      25 struct drm_device *d
>      95 struct drm_device *
>     216 struct drm_device *ddev
>     234 struct drm_device *drm_dev
>     611 struct drm_device *drm
>    4190 struct drm_device *dev
>=20
> This series starts with renaming struct drm_crtc::dev to drm_dev. If
> it's not only me and others like the result of this effort it should be
> followed up by adapting the other structs and the individual usages in
> the different drivers.
>=20
> To make this series a bit easier handleable, I first added an alias for
> drm_crtc::dev, then converted the drivers one after another and the last
> patch drops the "dev" name. This has the advantage of being easier to
> review, and if I should have missed an instance only the last patch must
> be dropped/reverted. Also this series might conflict with other patches,
> in this case the remaining patches can still go in (apart from the last
> one of course). Maybe it also makes sense to delay applying the last
> patch by one development cycle?
>=20
> The series was compile tested for arm, arm64, powerpc and amd64 using an
> allmodconfig (though I only build drivers/gpu/).
>=20
> Best regards
> Uwe
>=20
> Uwe Kleine-K=C3=B6nig (52):
>   drm/crtc: Start renaming struct drm_crtc::dev to drm_dev
>   drm/core: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/amd: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/armada: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/arm: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/aspeed: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/ast: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/atmel-hlcdc: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/exynos: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/fsl-dcu: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/gma500: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/gud: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/hisilicon: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/hyperv: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/i915: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/imx: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/ingenic: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/kmb: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/logicvc: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/mcde: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/mediatek: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/meson: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/mgag200: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/msm: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/mxsfb: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/nouveau: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/omapdrm: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/panel-ili9341: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/pl111: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/qxl: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/radeon: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/renesas: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/rockchip: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/solomon: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/sprd: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/sti: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/stm: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/sun4i: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/tegra: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/tidss: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/tilcdc: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/tiny: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/tve200: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/udl: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/vboxvideo: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/vc4: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/virtio: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/vkms: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/vmwgfx: Use struct drm_crtc::drm_dev instead of struct
>     drm_crtc::dev
>   drm/xen: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/xlnx: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>   drm/crtc: Complete renaming struct drm_crtc::dev to drm_dev
>=20
>  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   |  18 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c       |   6 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c       |   6 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c      |   8 +-
>  drivers/gpu/drm/amd/amdgpu/atombios_crtc.c    |  22 +--
>  drivers/gpu/drm/amd/amdgpu/dce_v10_0.c        |  26 +--
>  drivers/gpu/drm/amd/amdgpu/dce_v11_0.c        |  28 ++--
>  drivers/gpu/drm/amd/amdgpu/dce_v6_0.c         |  26 +--
>  drivers/gpu/drm/amd/amdgpu/dce_v8_0.c         |  26 +--
>  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  29 ++--
>  .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c |  20 +--
>  .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c    |   8 +-
>  .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c |  22 +--
>  .../amd/display/amdgpu_dm/amdgpu_dm_plane.c   |   2 +-
>  .../gpu/drm/arm/display/komeda/komeda_crtc.c  |  24 +--
>  .../gpu/drm/arm/display/komeda/komeda_kms.c   |   2 +-
>  drivers/gpu/drm/arm/hdlcd_crtc.c              |   4 +-
>  drivers/gpu/drm/arm/malidp_crtc.c             |   7 +-
>  drivers/gpu/drm/armada/armada_crtc.c          |  10 +-
>  drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c      |   6 +-
>  drivers/gpu/drm/ast/ast_dp.c                  |   2 +-
>  drivers/gpu/drm/ast/ast_mode.c                |  26 +--
>  .../gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c    |  10 +-
>  drivers/gpu/drm/drm_atomic.c                  |  22 +--
>  drivers/gpu/drm/drm_atomic_helper.c           |  20 ++-
>  drivers/gpu/drm/drm_atomic_state_helper.c     |   2 +-
>  drivers/gpu/drm/drm_atomic_uapi.c             |  22 +--
>  drivers/gpu/drm/drm_blend.c                   |   2 +-
>  drivers/gpu/drm/drm_color_mgmt.c              |  10 +-
>  drivers/gpu/drm/drm_crtc.c                    |  19 ++-
>  drivers/gpu/drm/drm_crtc_helper.c             |  10 +-
>  drivers/gpu/drm/drm_debugfs.c                 |   2 +-
>  drivers/gpu/drm/drm_debugfs_crc.c             |   2 +-
>  drivers/gpu/drm/drm_fb_helper.c               |   6 +-
>  drivers/gpu/drm/drm_mipi_dbi.c                |   4 +-
>  drivers/gpu/drm/drm_plane.c                   |   2 +-
>  drivers/gpu/drm/drm_plane_helper.c            |   2 +-
>  drivers/gpu/drm/drm_self_refresh_helper.c     |   2 +-
>  drivers/gpu/drm/drm_vblank.c                  |  40 ++---
>  drivers/gpu/drm/drm_vblank_work.c             |   2 +-
>  drivers/gpu/drm/exynos/exynos_drm_crtc.c      |   8 +-
>  drivers/gpu/drm/exynos/exynos_drm_plane.c     |   4 +-
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c    |  16 +-
>  drivers/gpu/drm/gma500/cdv_intel_display.c    |   2 +-
>  drivers/gpu/drm/gma500/cdv_intel_dp.c         |   2 +-
>  drivers/gpu/drm/gma500/gma_display.c          |  20 +--
>  drivers/gpu/drm/gma500/oaktrail_crtc.c        |   8 +-
>  drivers/gpu/drm/gma500/oaktrail_hdmi.c        |   4 +-
>  drivers/gpu/drm/gma500/psb_intel_display.c    |   2 +-
>  drivers/gpu/drm/gma500/psb_irq.c              |   6 +-
>  drivers/gpu/drm/gud/gud_pipe.c                |   6 +-
>  .../gpu/drm/hisilicon/hibmc/hibmc_drm_de.c    |  20 +--
>  .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c   |   4 +-
>  drivers/gpu/drm/hyperv/hyperv_drm_modeset.c   |   6 +-
>  drivers/gpu/drm/i915/display/g4x_dp.c         |   4 +-
>  drivers/gpu/drm/i915/display/hsw_ips.c        |  16 +-
>  drivers/gpu/drm/i915/display/i9xx_plane.c     |   4 +-
>  drivers/gpu/drm/i915/display/i9xx_wm.c        |  40 ++---
>  drivers/gpu/drm/i915/display/icl_dsi.c        |   2 +-
>  drivers/gpu/drm/i915/display/intel_atomic.c   |   2 +-
>  .../gpu/drm/i915/display/intel_atomic_plane.c |   4 +-
>  drivers/gpu/drm/i915/display/intel_audio.c    |   2 +-
>  drivers/gpu/drm/i915/display/intel_bw.c       |  10 +-
>  drivers/gpu/drm/i915/display/intel_cdclk.c    |   6 +-
>  drivers/gpu/drm/i915/display/intel_color.c    | 124 +++++++-------
>  drivers/gpu/drm/i915/display/intel_crtc.c     |  20 +--
>  .../drm/i915/display/intel_crtc_state_dump.c  |   4 +-
>  drivers/gpu/drm/i915/display/intel_cursor.c   |   2 +-
>  drivers/gpu/drm/i915/display/intel_ddi.c      |  28 ++--
>  drivers/gpu/drm/i915/display/intel_display.c  | 154 +++++++++---------
>  .../gpu/drm/i915/display/intel_display_irq.c  |  22 +--
>  .../gpu/drm/i915/display/intel_display_rps.c  |   2 +-
>  .../drm/i915/display/intel_display_trace.h    |  12 +-
>  drivers/gpu/drm/i915/display/intel_dp.c       |   2 +-
>  drivers/gpu/drm/i915/display/intel_dpll.c     |  38 ++---
>  drivers/gpu/drm/i915/display/intel_dpll_mgr.c |  44 ++---
>  drivers/gpu/drm/i915/display/intel_dpt.c      |   2 +-
>  drivers/gpu/drm/i915/display/intel_drrs.c     |  10 +-
>  drivers/gpu/drm/i915/display/intel_dsb.c      |   8 +-
>  drivers/gpu/drm/i915/display/intel_fbc.c      |   2 +-
>  drivers/gpu/drm/i915/display/intel_fdi.c      |  22 +--
>  .../drm/i915/display/intel_fifo_underrun.c    |   6 +-
>  drivers/gpu/drm/i915/display/intel_hdmi.c     |   2 +-
>  .../drm/i915/display/intel_modeset_setup.c    |  22 +--
>  .../drm/i915/display/intel_modeset_verify.c   |   2 +-
>  drivers/gpu/drm/i915/display/intel_panel.c    |   4 +-
>  .../gpu/drm/i915/display/intel_pch_display.c  |  32 ++--
>  .../gpu/drm/i915/display/intel_pch_refclk.c   |   2 +-
>  drivers/gpu/drm/i915/display/intel_pipe_crc.c |  10 +-
>  .../drm/i915/display/intel_plane_initial.c    |   6 +-
>  drivers/gpu/drm/i915/display/intel_psr.c      |  14 +-
>  drivers/gpu/drm/i915/display/intel_sdvo.c     |   2 +-
>  drivers/gpu/drm/i915/display/intel_vblank.c   |  24 +--
>  drivers/gpu/drm/i915/display/intel_vdsc.c     |  18 +-
>  drivers/gpu/drm/i915/display/intel_vrr.c      |  18 +-
>  drivers/gpu/drm/i915/display/skl_scaler.c     |  10 +-
>  .../drm/i915/display/skl_universal_plane.c    |   6 +-
>  drivers/gpu/drm/i915/display/skl_watermark.c  |  42 ++---
>  drivers/gpu/drm/i915/display/vlv_dsi.c        |   2 +-
>  drivers/gpu/drm/imx/dcss/dcss-crtc.c          |  20 +--
>  drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c        |  15 +-
>  drivers/gpu/drm/imx/lcdc/imx-lcdc.c           |  16 +-
>  drivers/gpu/drm/ingenic/ingenic-drm-drv.c     |   4 +-
>  drivers/gpu/drm/kmb/kmb_crtc.c                |  16 +-
>  drivers/gpu/drm/logicvc/logicvc_crtc.c        |  14 +-
>  drivers/gpu/drm/mcde/mcde_display.c           |  18 +-
>  drivers/gpu/drm/mediatek/mtk_drm_crtc.c       |  22 +--
>  drivers/gpu/drm/meson/meson_crtc.c            |  12 +-
>  drivers/gpu/drm/mgag200/mgag200_g200.c        |   4 +-
>  drivers/gpu/drm/mgag200/mgag200_g200eh.c      |   2 +-
>  drivers/gpu/drm/mgag200/mgag200_g200er.c      |   4 +-
>  drivers/gpu/drm/mgag200/mgag200_g200ev.c      |   4 +-
>  drivers/gpu/drm/mgag200/mgag200_g200se.c      |   6 +-
>  drivers/gpu/drm/mgag200/mgag200_g200wb.c      |   2 +-
>  drivers/gpu/drm/mgag200/mgag200_mode.c        |  10 +-
>  drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c |   6 +-
>  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c      |  70 ++++----
>  drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c       |   2 +-
>  drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c     |  12 +-
>  drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c     |  20 +--
>  drivers/gpu/drm/msm/msm_drv.c                 |   4 +-
>  drivers/gpu/drm/mxsfb/lcdif_kms.c             |  18 +-
>  drivers/gpu/drm/mxsfb/mxsfb_kms.c             |  16 +-
>  drivers/gpu/drm/nouveau/dispnv04/crtc.c       |  58 +++----
>  drivers/gpu/drm/nouveau/dispnv04/cursor.c     |  10 +-
>  drivers/gpu/drm/nouveau/dispnv50/atom.h       |   2 +-
>  drivers/gpu/drm/nouveau/dispnv50/crc.c        |  30 ++--
>  drivers/gpu/drm/nouveau/dispnv50/crc907d.c    |   6 +-
>  drivers/gpu/drm/nouveau/dispnv50/crcc37d.c    |   6 +-
>  drivers/gpu/drm/nouveau/dispnv50/crcc57d.c    |   2 +-
>  drivers/gpu/drm/nouveau/dispnv50/disp.c       |   5 +-
>  drivers/gpu/drm/nouveau/dispnv50/head.c       |   4 +-
>  drivers/gpu/drm/nouveau/dispnv50/head507d.c   |  26 +--
>  drivers/gpu/drm/nouveau/dispnv50/head827d.c   |  10 +-
>  drivers/gpu/drm/nouveau/dispnv50/head907d.c   |  26 +--
>  drivers/gpu/drm/nouveau/dispnv50/head917d.c   |   6 +-
>  drivers/gpu/drm/nouveau/dispnv50/headc37d.c   |  18 +-
>  drivers/gpu/drm/nouveau/dispnv50/headc57d.c   |  10 +-
>  drivers/gpu/drm/nouveau/nouveau_connector.h   |   2 +-
>  drivers/gpu/drm/nouveau/nouveau_display.c     |   2 +-
>  drivers/gpu/drm/omapdrm/omap_crtc.c           |  56 +++----
>  drivers/gpu/drm/omapdrm/omap_irq.c            |   6 +-
>  drivers/gpu/drm/panel/panel-ilitek-ili9341.c  |   4 +-
>  drivers/gpu/drm/pl111/pl111_display.c         |  16 +-
>  drivers/gpu/drm/qxl/qxl_display.c             |   2 +-
>  drivers/gpu/drm/radeon/atombios_crtc.c        |  54 +++---
>  drivers/gpu/drm/radeon/radeon_cursor.c        |  14 +-
>  drivers/gpu/drm/radeon/radeon_display.c       |  28 ++--
>  drivers/gpu/drm/radeon/radeon_kms.c           |   6 +-
>  drivers/gpu/drm/radeon/radeon_legacy_crtc.c   |  16 +-
>  .../gpu/drm/renesas/rcar-du/rcar_du_crtc.c    |  14 +-
>  .../gpu/drm/renesas/shmobile/shmob_drm_crtc.c |  20 +--
>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c   |   8 +-
>  drivers/gpu/drm/rockchip/rockchip_drm_vop2.c  |  15 +-
>  drivers/gpu/drm/solomon/ssd130x.c             |   2 +-
>  drivers/gpu/drm/sprd/sprd_dpu.c               |   6 +-
>  drivers/gpu/drm/sti/sti_crtc.c                |  14 +-
>  drivers/gpu/drm/stm/ltdc.c                    |  12 +-
>  drivers/gpu/drm/sun4i/sun4i_crtc.c            |  12 +-
>  drivers/gpu/drm/tegra/dc.c                    |  12 +-
>  drivers/gpu/drm/tidss/tidss_crtc.c            |  19 ++-
>  drivers/gpu/drm/tidss/tidss_irq.c             |   4 +-
>  drivers/gpu/drm/tilcdc/tilcdc_crtc.c          |  43 ++---
>  drivers/gpu/drm/tiny/bochs.c                  |   6 +-
>  drivers/gpu/drm/tiny/cirrus.c                 |   2 +-
>  drivers/gpu/drm/tiny/gm12u320.c               |   4 +-
>  drivers/gpu/drm/tiny/hx8357d.c                |   4 +-
>  drivers/gpu/drm/tiny/ili9163.c                |   4 +-
>  drivers/gpu/drm/tiny/ili9225.c                |   8 +-
>  drivers/gpu/drm/tiny/ili9341.c                |   4 +-
>  drivers/gpu/drm/tiny/ili9486.c                |   4 +-
>  drivers/gpu/drm/tiny/mi0283qt.c               |   4 +-
>  drivers/gpu/drm/tiny/ofdrm.c                  |   8 +-
>  drivers/gpu/drm/tiny/panel-mipi-dbi.c         |   6 +-
>  drivers/gpu/drm/tiny/repaper.c                |   8 +-
>  drivers/gpu/drm/tiny/simpledrm.c              |   2 +-
>  drivers/gpu/drm/tiny/st7586.c                 |   6 +-
>  drivers/gpu/drm/tiny/st7735r.c                |   4 +-
>  drivers/gpu/drm/tve200/tve200_display.c       |  14 +-
>  drivers/gpu/drm/udl/udl_modeset.c             |   4 +-
>  drivers/gpu/drm/vboxvideo/vbox_mode.c         |   6 +-
>  drivers/gpu/drm/vc4/vc4_crtc.c                |  38 ++---
>  drivers/gpu/drm/vc4/vc4_hdmi.c                |   2 +-
>  drivers/gpu/drm/vc4/vc4_hvs.c                 |  12 +-
>  drivers/gpu/drm/vc4/vc4_txp.c                 |   2 +-
>  drivers/gpu/drm/virtio/virtgpu_display.c      |   4 +-
>  drivers/gpu/drm/vkms/vkms_crtc.c              |  12 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_kms.c           |   4 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c          |  10 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c          |   8 +-
>  drivers/gpu/drm/xen/xen_drm_front_kms.c       |  10 +-
>  drivers/gpu/drm/xlnx/zynqmp_kms.c             |   8 +-
>  include/drm/drm_atomic_helper.h               |   2 +-
>  include/drm/drm_crtc.h                        |   4 +-
>  194 files changed, 1296 insertions(+), 1264 deletions(-)
>=20
> base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
> --=20
> 2.39.2
>=20

--=20
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

--DbTmTNcmEZJ3sxG3
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAmSufNEACgkQ3cLmz3+f
v9FSMgf+JV6Salw2w4GLv+9asbGD6ik0oblmM2PMKoiE0lr5WJxx13dzR24bybN+
/yLeBZDoIu/s7Q6LeqGCsxmFbec13qKaZGYBYkJLv+OMHbyh4REeRiAcb8UmsooR
a6BhJiU9HH2PH5snsQ9nH1H5grb3DPvwgaqO2yXIOYSlF70H8t7zyD8zjlPAywwZ
0xBkR+4qw63MDKu5RWTeaIjIpjKpEUFfhA323992hjshPmtNphRHKAw0w0jGQ33u
yscku+iOuCxxEek3Mvf0VIc9wrVwGstUzFgAyNde+Hw9qWoe8r9L1igpwudGKgSK
2EbKtFUVm+TGcuoAh1GijOyj9Fgf9A==
=F3Xd
-----END PGP SIGNATURE-----

--DbTmTNcmEZJ3sxG3--


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:23:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:23:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562163.878741 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJX0C-0002H5-3j; Wed, 12 Jul 2023 10:23:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562163.878741; Wed, 12 Jul 2023 10:23:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJX0B-0002GS-VA; Wed, 12 Jul 2023 10:23:19 +0000
Received: by outflank-mailman (input) for mailman id 562163;
 Wed, 12 Jul 2023 10:19:47 +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
 <SRS0=WNfj=C6=suse.de=tzimmermann@srs-se1.protection.inumbo.net>)
 id 1qJWwk-0001KA-OR
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:19:47 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9e5bd018-209d-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:19:43 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id D0F021FF0B;
 Wed, 12 Jul 2023 10:19:42 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0468D13336;
 Wed, 12 Jul 2023 10:19:38 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id SsQwOzp+rmReBgAAMHmgww
 (envelope-from <tzimmermann@suse.de>); Wed, 12 Jul 2023 10:19:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9e5bd018-209d-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1689157182; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=Tsn20WiJd5TowH5i6EsqTPmdSefnbYhCxqN/Dp1tDrY=;
	b=mdd6rtbzcYuR+zUP7LpXIj3vXYqYVWVuL/HlUo3YkHu8DIVKkh0RwKoXTtdeXsnzJBGZ5N
	77yRuLKa2J7d0Tdc1qR69vo+KzQGUmm+OPIY/KjkZzMjgCUtklqtyAs+jY7i5fFxChSxKU
	3WjsCiRnC8Wd/SuLPEtVZEBoyhP037k=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1689157182;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=Tsn20WiJd5TowH5i6EsqTPmdSefnbYhCxqN/Dp1tDrY=;
	b=qXJUMQRUT5d04RrtsnvYKeGNvb6izPNtKJvcyfYnevqLvHyBGSHQt6ueLD/M/9L6OKOmMB
	D+qav4+y0tmp0sCg==
Message-ID: <abf26a82-4f17-51f2-5753-785f8516a81a@suse.de>
Date: Wed, 12 Jul 2023 12:19:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
Content-Language: en-US
To: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= <u.kleine-koenig@pengutronix.de>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, David Airlie <airlied@gmail.com>,
 Daniel Vetter <daniel@ffwll.ch>, Alex Deucher <alexander.deucher@amd.com>,
 =?UTF-8?Q?Christian_K=c3=b6nig?= <christian.koenig@amd.com>,
 "Pan, Xinhui" <Xinhui.Pan@amd.com>, Harry Wentland <harry.wentland@amd.com>,
 Leo Li <sunpeng.li@amd.com>, Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
 Hamza Mahfooz <hamza.mahfooz@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Guchun Chen <guchun.chen@amd.com>,
 Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
 Evan Quan <evan.quan@amd.com>, Likun Gao <Likun.Gao@amd.com>,
 =?UTF-8?B?TWFyZWsgT2zFocOhaw==?= <marek.olsak@amd.com>,
 David Francis <David.Francis@amd.com>, Hawking Zhang
 <Hawking.Zhang@amd.com>, Graham Sider <Graham.Sider@amd.com>,
 Lang Yu <Lang.Yu@amd.com>, Philip Yang <Philip.Yang@amd.com>,
 Yifan Zhang <yifan1.zhang@amd.com>, Tim Huang <Tim.Huang@amd.com>,
 Zack Rusin <zackr@vmware.com>, Sam Ravnborg <sam@ravnborg.org>,
 Jani Nikula <jani.nikula@intel.com>, xurui <xurui@kylinos.cn>,
 Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
 =?UTF-8?Q?Ma=c3=adra_Canal?= <mairacanal@riseup.net>,
 =?UTF-8?Q?Andr=c3=a9_Almeida?= <andrealmeid@igalia.com>,
 Qingqing Zhuo <qingqing.zhuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>, Hersen Wu
 <hersenxs.wu@amd.com>, Fangzhi Zuo <jerry.zuo@amd.com>,
 Stylon Wang <stylon.wang@amd.com>, Alan Liu <haoping.liu@amd.com>,
 Wayne Lin <Wayne.Lin@amd.com>, Aaron Liu <aaron.liu@amd.com>,
 Melissa Wen <mwen@igalia.com>, Bhawanpreet Lakha
 <Bhawanpreet.Lakha@amd.com>, David Tadokoro <davidbtadokoro@usp.br>,
 Wenjing Liu <wenjing.liu@amd.com>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 Mario Limonciello <mario.limonciello@amd.com>,
 Alexey Kodanev <aleksei.kodanev@bell-sw.com>, Roman Li <roman.li@amd.com>,
 =?UTF-8?Q?Joaqu=c3=adn_Ignacio_Aramend=c3=ada?= <samsagax@gmail.com>,
 Dave Airlie <airlied@redhat.com>, Russell King <linux@armlinux.org.uk>,
 Liviu Dudau <liviu.dudau@arm.com>, Joel Stanley <joel@jms.id.au>,
 Boris Brezillon <bbrezillon@kernel.org>,
 Nicolas Ferre <nicolas.ferre@microchip.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 Claudiu Beznea <claudiu.beznea@microchip.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Stefan Agner <stefan@agner.ch>, Alison Wang <alison.wang@nxp.com>,
 Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
 =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= <noralf@tronnes.org>,
 Xinliang Liu <xinliang.liu@linaro.org>, Tian Tao <tiantao6@hisilicon.com>,
 Danilo Krummrich <dakr@redhat.com>, Deepak Rawat <drawat.floss@gmail.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
 =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= <ville.syrjala@linux.intel.com>,
 Lucas De Marchi <lucas.demarchi@intel.com>,
 Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
 Andrzej Hajda <andrzej.hajda@intel.com>,
 Matt Roper <matthew.d.roper@intel.com>,
 Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
 Hans de Goede <hdegoede@redhat.com>, Luca Coelho <luciano.coelho@intel.com>,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 Kai Vehmanen <kai.vehmanen@linux.intel.com>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 =?UTF-8?Q?=c5=81ukasz_Bartosik?= <lb@semihalf.com>,
 Anusha Srivatsa <anusha.srivatsa@intel.com>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
 Uma Shankar <uma.shankar@intel.com>, Imre Deak <imre.deak@intel.com>,
 Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
 Swati Sharma <swati2.sharma@intel.com>,
 =?UTF-8?Q?Jouni_H=c3=b6gander?= <jouni.hogander@intel.com>,
 Mika Kahola <mika.kahola@intel.com>,
 =?UTF-8?Q?Jos=c3=a9_Roberto_de_Souza?= <jose.souza@intel.com>,
 Arun R Murthy <arun.r.murthy@intel.com>,
 Gustavo Sousa <gustavo.sousa@intel.com>,
 Khaled Almahallawy <khaled.almahallawy@intel.com>,
 Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
 Andi Shyti <andi.shyti@linux.intel.com>, Nirmoy Das <nirmoy.das@intel.com>,
 Fei Yang <fei.yang@intel.com>, Animesh Manna <animesh.manna@intel.com>,
 Deepak R Varma <drv@mailo.com>, "Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
 Vandita Kulkarni <vandita.kulkarni@intel.com>,
 Suraj Kandpal <suraj.kandpal@intel.com>,
 Manasi Navare <manasi.d.navare@intel.com>,
 Drew Davenport <ddavenport@chromium.org>,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>,
 Philipp Zabel <p.zabel@pengutronix.de>, Marian Cichy
 <m.cichy@pengutronix.de>, Dan Carpenter <error27@gmail.com>,
 Paul Cercueil <paul@crapouillou.net>,
 Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
 Edmund Dea <edmund.j.dea@intel.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Linus Walleij <linus.walleij@linaro.org>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>, Rob Clark <robdclark@gmail.com>,
 Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Vinod Polimera <quic_vpolimer@quicinc.com>,
 Jiasheng Jiang <jiasheng@iscas.ac.cn>,
 Konrad Dybcio <konrad.dybcio@linaro.org>,
 Jessica Zhang <quic_jesszhan@quicinc.com>, Liu Shixin
 <liushixin2@huawei.com>, Marek Vasut <marex@denx.de>,
 Ben Skeggs <bskeggs@redhat.com>, Karol Herbst <kherbst@redhat.com>,
 Lyude Paul <lyude@redhat.com>, Tomi Valkeinen <tomba@kernel.org>,
 Emma Anholt <emma@anholt.net>, Gerd Hoffmann <kraxel@redhat.com>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>,
 Geert Uytterhoeven <geert+renesas@glider.be>,
 Biju Das <biju.das.jz@bp.renesas.com>, Sandy Huang <hjc@rock-chips.com>,
 =?UTF-8?Q?Heiko_St=c3=bcbner?= <heiko@sntech.de>,
 Orson Zhai <orsonzhai@gmail.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>,
 Alain Volmat <alain.volmat@foss.st.com>,
 Yannick Fertre <yannick.fertre@foss.st.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Philippe Cornu <philippe.cornu@foss.st.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>, Chen-Yu Tsai
 <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>,
 Samuel Holland <samuel@sholland.org>,
 Thierry Reding <thierry.reding@gmail.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Jyri Sarha <jyri.sarha@iki.fi>,
 David Lechner <david@lechnology.com>,
 Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
 Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
 Melissa Wen <melissa.srw@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Michal Simek <michal.simek@amd.com>
Cc: dri-devel@lists.freedesktop.org, kernel@pengutronix.de,
 amd-gfx@lists.freedesktop.org, Andrew Jeffery <andrew@aj.id.au>,
 linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
 Alim Akhtar <alim.akhtar@samsung.com>, linux-samsung-soc@vger.kernel.org,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 Sumit Semwal <sumit.semwal@linaro.org>, Yongqin Liu
 <yongqin.liu@linaro.org>, John Stultz <jstultz@google.com>,
 linux-hyperv@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 Lucas Stach <l.stach@pengutronix.de>, Fabio Estevam <festevam@gmail.com>,
 NXP Linux Team <linux-imx@nxp.com>, linux-mips@vger.kernel.org,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 linux-mediatek@lists.infradead.org, Jerome Brunet <jbrunet@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-amlogic@lists.infradead.org, Sean Paul <sean@poorly.run>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, virtualization@lists.linux-foundation.org,
 spice-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org,
 linux-rockchip@lists.infradead.org,
 linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev,
 linux-tegra@vger.kernel.org, Gurchetan Singh <gurchetansingh@chromium.org>,
 Chia-I Wu <olvaffe@gmail.com>, Haneen Mohammed <hamohammed.sa@gmail.com>,
 VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
 xen-devel@lists.xenproject.org
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
From: Thomas Zimmermann <tzimmermann@suse.de>
In-Reply-To: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------wJeCIz2QByiHOWGnznzIG8hc"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------wJeCIz2QByiHOWGnznzIG8hc
Content-Type: multipart/mixed; boundary="------------qX0sbByUF0ylHTkZbIkCRkYq";
 protected-headers="v1"
From: Thomas Zimmermann <tzimmermann@suse.de>
To: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= <u.kleine-koenig@pengutronix.de>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, David Airlie <airlied@gmail.com>,
 Daniel Vetter <daniel@ffwll.ch>, Alex Deucher <alexander.deucher@amd.com>,
 =?UTF-8?Q?Christian_K=c3=b6nig?= <christian.koenig@amd.com>,
 "Pan, Xinhui" <Xinhui.Pan@amd.com>, Harry Wentland <harry.wentland@amd.com>,
 Leo Li <sunpeng.li@amd.com>, Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
 Hamza Mahfooz <hamza.mahfooz@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Guchun Chen <guchun.chen@amd.com>,
 Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
 Evan Quan <evan.quan@amd.com>, Likun Gao <Likun.Gao@amd.com>,
 =?UTF-8?B?TWFyZWsgT2zFocOhaw==?= <marek.olsak@amd.com>,
 David Francis <David.Francis@amd.com>, Hawking Zhang
 <Hawking.Zhang@amd.com>, Graham Sider <Graham.Sider@amd.com>,
 Lang Yu <Lang.Yu@amd.com>, Philip Yang <Philip.Yang@amd.com>,
 Yifan Zhang <yifan1.zhang@amd.com>, Tim Huang <Tim.Huang@amd.com>,
 Zack Rusin <zackr@vmware.com>, Sam Ravnborg <sam@ravnborg.org>,
 Jani Nikula <jani.nikula@intel.com>, xurui <xurui@kylinos.cn>,
 Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
 =?UTF-8?Q?Ma=c3=adra_Canal?= <mairacanal@riseup.net>,
 =?UTF-8?Q?Andr=c3=a9_Almeida?= <andrealmeid@igalia.com>,
 Qingqing Zhuo <qingqing.zhuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>, Hersen Wu
 <hersenxs.wu@amd.com>, Fangzhi Zuo <jerry.zuo@amd.com>,
 Stylon Wang <stylon.wang@amd.com>, Alan Liu <haoping.liu@amd.com>,
 Wayne Lin <Wayne.Lin@amd.com>, Aaron Liu <aaron.liu@amd.com>,
 Melissa Wen <mwen@igalia.com>, Bhawanpreet Lakha
 <Bhawanpreet.Lakha@amd.com>, David Tadokoro <davidbtadokoro@usp.br>,
 Wenjing Liu <wenjing.liu@amd.com>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 Mario Limonciello <mario.limonciello@amd.com>,
 Alexey Kodanev <aleksei.kodanev@bell-sw.com>, Roman Li <roman.li@amd.com>,
 =?UTF-8?Q?Joaqu=c3=adn_Ignacio_Aramend=c3=ada?= <samsagax@gmail.com>,
 Dave Airlie <airlied@redhat.com>, Russell King <linux@armlinux.org.uk>,
 Liviu Dudau <liviu.dudau@arm.com>, Joel Stanley <joel@jms.id.au>,
 Boris Brezillon <bbrezillon@kernel.org>,
 Nicolas Ferre <nicolas.ferre@microchip.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 Claudiu Beznea <claudiu.beznea@microchip.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Stefan Agner <stefan@agner.ch>, Alison Wang <alison.wang@nxp.com>,
 Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
 =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= <noralf@tronnes.org>,
 Xinliang Liu <xinliang.liu@linaro.org>, Tian Tao <tiantao6@hisilicon.com>,
 Danilo Krummrich <dakr@redhat.com>, Deepak Rawat <drawat.floss@gmail.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
 =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= <ville.syrjala@linux.intel.com>,
 Lucas De Marchi <lucas.demarchi@intel.com>,
 Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
 Andrzej Hajda <andrzej.hajda@intel.com>,
 Matt Roper <matthew.d.roper@intel.com>,
 Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
 Hans de Goede <hdegoede@redhat.com>, Luca Coelho <luciano.coelho@intel.com>,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 Kai Vehmanen <kai.vehmanen@linux.intel.com>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 =?UTF-8?Q?=c5=81ukasz_Bartosik?= <lb@semihalf.com>,
 Anusha Srivatsa <anusha.srivatsa@intel.com>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
 Uma Shankar <uma.shankar@intel.com>, Imre Deak <imre.deak@intel.com>,
 Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
 Swati Sharma <swati2.sharma@intel.com>,
 =?UTF-8?Q?Jouni_H=c3=b6gander?= <jouni.hogander@intel.com>,
 Mika Kahola <mika.kahola@intel.com>,
 =?UTF-8?Q?Jos=c3=a9_Roberto_de_Souza?= <jose.souza@intel.com>,
 Arun R Murthy <arun.r.murthy@intel.com>,
 Gustavo Sousa <gustavo.sousa@intel.com>,
 Khaled Almahallawy <khaled.almahallawy@intel.com>,
 Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
 Andi Shyti <andi.shyti@linux.intel.com>, Nirmoy Das <nirmoy.das@intel.com>,
 Fei Yang <fei.yang@intel.com>, Animesh Manna <animesh.manna@intel.com>,
 Deepak R Varma <drv@mailo.com>, "Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
 Vandita Kulkarni <vandita.kulkarni@intel.com>,
 Suraj Kandpal <suraj.kandpal@intel.com>,
 Manasi Navare <manasi.d.navare@intel.com>,
 Drew Davenport <ddavenport@chromium.org>,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>,
 Philipp Zabel <p.zabel@pengutronix.de>, Marian Cichy
 <m.cichy@pengutronix.de>, Dan Carpenter <error27@gmail.com>,
 Paul Cercueil <paul@crapouillou.net>,
 Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
 Edmund Dea <edmund.j.dea@intel.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Linus Walleij <linus.walleij@linaro.org>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>, Rob Clark <robdclark@gmail.com>,
 Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Vinod Polimera <quic_vpolimer@quicinc.com>,
 Jiasheng Jiang <jiasheng@iscas.ac.cn>,
 Konrad Dybcio <konrad.dybcio@linaro.org>,
 Jessica Zhang <quic_jesszhan@quicinc.com>, Liu Shixin
 <liushixin2@huawei.com>, Marek Vasut <marex@denx.de>,
 Ben Skeggs <bskeggs@redhat.com>, Karol Herbst <kherbst@redhat.com>,
 Lyude Paul <lyude@redhat.com>, Tomi Valkeinen <tomba@kernel.org>,
 Emma Anholt <emma@anholt.net>, Gerd Hoffmann <kraxel@redhat.com>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>,
 Geert Uytterhoeven <geert+renesas@glider.be>,
 Biju Das <biju.das.jz@bp.renesas.com>, Sandy Huang <hjc@rock-chips.com>,
 =?UTF-8?Q?Heiko_St=c3=bcbner?= <heiko@sntech.de>,
 Orson Zhai <orsonzhai@gmail.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>,
 Alain Volmat <alain.volmat@foss.st.com>,
 Yannick Fertre <yannick.fertre@foss.st.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Philippe Cornu <philippe.cornu@foss.st.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>, Chen-Yu Tsai
 <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>,
 Samuel Holland <samuel@sholland.org>,
 Thierry Reding <thierry.reding@gmail.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Jyri Sarha <jyri.sarha@iki.fi>,
 David Lechner <david@lechnology.com>,
 Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
 Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
 Melissa Wen <melissa.srw@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Michal Simek <michal.simek@amd.com>
Cc: dri-devel@lists.freedesktop.org, kernel@pengutronix.de,
 amd-gfx@lists.freedesktop.org, Andrew Jeffery <andrew@aj.id.au>,
 linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
 Alim Akhtar <alim.akhtar@samsung.com>, linux-samsung-soc@vger.kernel.org,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 Sumit Semwal <sumit.semwal@linaro.org>, Yongqin Liu
 <yongqin.liu@linaro.org>, John Stultz <jstultz@google.com>,
 linux-hyperv@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 Lucas Stach <l.stach@pengutronix.de>, Fabio Estevam <festevam@gmail.com>,
 NXP Linux Team <linux-imx@nxp.com>, linux-mips@vger.kernel.org,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 linux-mediatek@lists.infradead.org, Jerome Brunet <jbrunet@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-amlogic@lists.infradead.org, Sean Paul <sean@poorly.run>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, virtualization@lists.linux-foundation.org,
 spice-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org,
 linux-rockchip@lists.infradead.org,
 linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev,
 linux-tegra@vger.kernel.org, Gurchetan Singh <gurchetansingh@chromium.org>,
 Chia-I Wu <olvaffe@gmail.com>, Haneen Mohammed <hamohammed.sa@gmail.com>,
 VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
 xen-devel@lists.xenproject.org
Message-ID: <abf26a82-4f17-51f2-5753-785f8516a81a@suse.de>
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
In-Reply-To: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>

--------------qX0sbByUF0ylHTkZbIkCRkYq
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

SGkNCg0KQW0gMTIuMDcuMjMgdW0gMTE6NDYgc2NocmllYiBVd2UgS2xlaW5lLUvDtm5pZzoN
Cj4gSGVsbG8sDQo+IA0KPiB3aGlsZSBJIGRlYnVnZ2VkIGFuIGlzc3VlIGluIHRoZSBpbXgt
bGNkYyBkcml2ZXIgSSB3YXMgY29uc3RhbnRseQ0KPiBpcnJpdGF0ZWQgYWJvdXQgc3RydWN0
IGRybV9kZXZpY2UgcG9pbnRlciB2YXJpYWJsZXMgYmVpbmcgbmFtZWQgImRldiINCj4gYmVj
YXVzZSB3aXRoIHRoYXQgbmFtZSBJIHVzdWFsbHkgZXhwZWN0IGEgc3RydWN0IGRldmljZSBw
b2ludGVyLg0KPiANCj4gSSB0aGluayB0aGVyZSBpcyBhIGJpZyBiZW5lZml0IHdoZW4gdGhl
c2UgYXJlIGFsbCByZW5hbWVkIHRvICJkcm1fZGV2Ii4NCg0KSWYgeW91IHJlbmFtZSBkcm1f
Y3J0Yy5kZXYsIHlvdSBzaG91bGQgYWxzbyBhZGRyZXNzICphbGwqIG90aGVyIGRhdGEgDQpz
dHJ1Y3R1cmVzLg0KDQo+IEkgaGF2ZSBubyBzdHJvbmcgcHJlZmVyZW5jZSBoZXJlIHRob3Vn
aCwgc28gImRybWRldiIgb3IgImRybSIgYXJlIG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Jh
ZmI4NjJmOWRhOGRjNWVmYTRiNjA3NmEwZTQ4YzNmYmFhYTUNCg0KLS0gDQpUaG9tYXMgWmlt
bWVybWFubg0KR3JhcGhpY3MgRHJpdmVyIERldmVsb3Blcg0KU1VTRSBTb2Z0d2FyZSBTb2x1
dGlvbnMgR2VybWFueSBHbWJIDQpGcmFua2Vuc3RyYXNzZSAxNDYsIDkwNDYxIE51ZXJuYmVy
ZywgR2VybWFueQ0KR0Y6IEl2byBUb3RldiwgQW5kcmV3IE15ZXJzLCBBbmRyZXcgTWNEb25h
bGQsIEJvdWRpZW4gTW9lcm1hbg0KSFJCIDM2ODA5IChBRyBOdWVybmJlcmcpDQo=

--------------qX0sbByUF0ylHTkZbIkCRkYq--

--------------wJeCIz2QByiHOWGnznzIG8hc
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEExndm/fpuMUdwYFFolh/E3EQov+AFAmSufjkFAwAAAAAACgkQlh/E3EQov+Cz
dRAAzNkbOEyt3CFiDonx+JIRdZ2I4ZVwQw2MFPNsKzhxUdXG5Bo2nSJKlr9TEhydwFYNuJ1YMSc1
jALJ2a01S8dS5vKuL881i6j7/7D/BURZ9XnW/P7918eYqsjigNduLg29jk+D8dqAcFr5cRsjRFbZ
TPAB76uz3ZJP/VE/1eILGIaH54R+0MD2EJkeM9qNjOaRbQourkKE8oaz4l6TsOb655uhY87r1lTF
rX+vhxeuMs8Cs1Fiwsz+IGeSgaj5sYFv4a5xgyIsAugz65wE2cbM5YxkjM8OAF5v1KtN7xp50Tqh
NiDAC/6+4IpCpA6d4JFH5j3MMzuFdaQgi+YdXbmNn1xpMoj9dJ4oMyvKkNcV2O3m/Ba5s7U3pnLi
z15Y7m5oIqVz7d3bNpmHPk4o6hYa3zyNgUWXXMk8SgNtzmrTYt5ptC/NpbzEtPuSi3DRnq8IiNQI
AhZf6jOEANc7FA41Ck00RBpcF0/woiqLLoFXhk6r3VI+pjUQGIXst1aHqx+X7aNQBO5oKNwjRBRl
gi5vrFpV/B+mSZjvKnRPI4dJP7I/wUOzV5jVtfDshq13L13gUldbYC+C7kjt+SolliapXCV4oGXt
GzlzJh2DeJpWK81TnA/2FCLuzk7QPMoICxcgpJtm53BjosrmT5DRbYUFiTS1ZCUt9zEC3ifw5ibJ
J/o=
=LS0V
-----END PGP SIGNATURE-----

--------------wJeCIz2QByiHOWGnznzIG8hc--


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:31:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:31:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562180.878766 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJX7e-0004cD-AT; Wed, 12 Jul 2023 10:31:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562180.878766; Wed, 12 Jul 2023 10:31:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJX7e-0004c6-7q; Wed, 12 Jul 2023 10:31:02 +0000
Received: by outflank-mailman (input) for mailman id 562180;
 Wed, 12 Jul 2023 10:31:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=I1v4=C6=arm.com=peter.hoyes@srs-se1.protection.inumbo.net>)
 id 1qJX7d-0004bk-DX
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:31:01 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTP
 id 30b8a382-209f-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 12:30:59 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 460AF14BF;
 Wed, 12 Jul 2023 03:31:40 -0700 (PDT)
Received: from e125920.cambridge.arm.com (unknown [10.1.199.64])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DF9903F73F;
 Wed, 12 Jul 2023 03:30:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 30b8a382-209f-11ee-b239-6b7b168915f2
From: Peter Hoyes <peter.hoyes@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com,
	wei.chen@arm.com,
	luca.fancellu@arm.com,
	Peter Hoyes <Peter.Hoyes@arm.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v5 1/2] tools/console: Add escape argument to configure escape character
Date: Wed, 12 Jul 2023 11:29:16 +0100
Message-Id: <20230712102917.37763-2-peter.hoyes@arm.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230712102917.37763-1-peter.hoyes@arm.com>
References: <20230712102917.37763-1-peter.hoyes@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Peter Hoyes <Peter.Hoyes@arm.com>

Dom0 may be accessed via telnet, meaning the default escape character
(which is the same as telnet's) cannot be directly used to exit the
console. It would be helpful to make the escape character customizable
in such use cases.

Add --escape argument to console tool for this purpose.

Add argument to getopt options, parse and validate the escape character
and pass value to console_loop.

If --escape is not specified, it falls back to the existing behavior
using DEFAULT_ESCAPE_SEQUENCE.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
---
Changes in v5:
- Add this changelog

Changes in v4:
- Improve validation of the escape_character optarg

Changes in v3:
- Re-add the Reviewed-By tag accidentally removed in v2

Changes in v2:
- Drop the tags intended only for internal use at Arm

 tools/console/client/main.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 6775006488..d2dcc3ddca 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -42,7 +42,7 @@
 #include <xenstore.h>
 #include "xenctrl.h"
 
-#define ESCAPE_CHARACTER 0x1d
+#define DEFAULT_ESCAPE_CHARACTER 0x1d
 
 static volatile sig_atomic_t received_signal = 0;
 static char lockfile[sizeof (XEN_LOCK_DIR "/xenconsole.") + 8] = { 0 };
@@ -77,6 +77,7 @@ static void usage(const char *program) {
 	       "  -n, --num N      use console number N\n"
 	       "  --type TYPE      console type. must be 'pv', 'serial' or 'vuart'\n"
 	       "  --start-notify-fd N file descriptor used to notify parent\n"
+	       "  --escape E       escape sequence to exit console\n"
 	       , program);
 }
 
@@ -174,7 +175,7 @@ static void restore_term(int fd, struct termios *old)
 }
 
 static int console_loop(int fd, struct xs_handle *xs, char *pty_path,
-		        bool interactive)
+			bool interactive, char escape_character)
 {
 	int ret, xs_fd = xs_fileno(xs), max_fd = -1;
 
@@ -215,7 +216,7 @@ static int console_loop(int fd, struct xs_handle *xs, char *pty_path,
 			char msg[60];
 
 			len = read(STDIN_FILENO, msg, sizeof(msg));
-			if (len == 1 && msg[0] == ESCAPE_CHARACTER) {
+			if (len == 1 && msg[0] == escape_character) {
 				return 0;
 			} 
 
@@ -335,6 +336,7 @@ int main(int argc, char **argv)
 		{ "help",    0, 0, 'h' },
 		{ "start-notify-fd", 1, 0, 's' },
 		{ "interactive", 0, 0, 'i' },
+		{ "escape",  1, 0, 'e' },
 		{ 0 },
 
 	};
@@ -345,6 +347,7 @@ int main(int argc, char **argv)
 	console_type type = CONSOLE_INVAL;
 	bool interactive = 0;
 	const char *console_names = "serial, pv, vuart";
+	char escape_character = DEFAULT_ESCAPE_CHARACTER;
 
 	while((ch = getopt_long(argc, argv, sopt, lopt, &opt_ind)) != -1) {
 		switch(ch) {
@@ -375,6 +378,16 @@ int main(int argc, char **argv)
 		case 'i':
 			interactive = 1;
 			break;
+		case 'e':
+			if (optarg[0] == '^' && optarg[1] && optarg[2] == '\0')
+				escape_character = optarg[1] & 0x1f;
+			else if (optarg[0] && optarg[1] == '\0')
+				escape_character = optarg[0];
+			else {
+				fprintf(stderr, "Invalid escape argument\n");
+				exit(EINVAL);
+			}
+			break;
 		default:
 			fprintf(stderr, "Invalid argument\n");
 			fprintf(stderr, "Try `%s --help' for more information.\n", 
@@ -493,7 +506,7 @@ int main(int argc, char **argv)
 		close(start_notify_fd);
 	}
 
-	console_loop(spty, xs, path, interactive);
+	console_loop(spty, xs, path, interactive, escape_character);
 
 	free(path);
 	free(dom_path);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:31:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:31:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562179.878756 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJX7c-0004N5-4Q; Wed, 12 Jul 2023 10:31:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562179.878756; Wed, 12 Jul 2023 10:31:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJX7c-0004My-1Z; Wed, 12 Jul 2023 10:31:00 +0000
Received: by outflank-mailman (input) for mailman id 562179;
 Wed, 12 Jul 2023 10:30: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
 <SRS0=I1v4=C6=arm.com=peter.hoyes@srs-se1.protection.inumbo.net>)
 id 1qJX7a-0004Ms-Qp
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:30:58 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTP
 id 2f0e9b32-209f-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:30:56 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 83930D75;
 Wed, 12 Jul 2023 03:31:37 -0700 (PDT)
Received: from e125920.cambridge.arm.com (unknown [10.1.199.64])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 091EF3F73F;
 Wed, 12 Jul 2023 03:30:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2f0e9b32-209f-11ee-8611-37d641c3527e
From: Peter Hoyes <peter.hoyes@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com,
	wei.chen@arm.com,
	luca.fancellu@arm.com,
	Peter Hoyes <Peter.Hoyes@arm.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v5 0/2] Add escape character argument to Xen console
Date: Wed, 12 Jul 2023 11:29:15 +0100
Message-Id: <20230712102917.37763-1-peter.hoyes@arm.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Peter Hoyes <Peter.Hoyes@arm.com>


Dom0 may be accessed via telnet, meaning the default escape character
(which is the same as telnet's) cannot be directly used to exit the
console. It would be helpful to make the escape character customizable
in such use cases, falling back to the existing value if not set.

Make the necessary changes to the console client, libxl and the xl
console sub-command to support this.

Peter Hoyes (2):
  tools/console: Add escape argument to configure escape character
  xl: Add escape character argument to xl console

 docs/man/xl.1.pod.in             |  8 ++++++-
 tools/console/client/main.c      | 21 +++++++++++++----
 tools/include/libxl.h            | 39 +++++++++++++++++++++++++++++---
 tools/libs/light/libxl_console.c | 30 +++++++++++++++++-------
 tools/xl/xl_cmdtable.c           |  3 ++-
 tools/xl/xl_console.c            | 10 +++++---
 tools/xl/xl_vmcontrol.c          |  2 +-
 7 files changed, 92 insertions(+), 21 deletions(-)

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:31:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:31:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562181.878776 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJX7h-0004tB-H5; Wed, 12 Jul 2023 10:31:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562181.878776; Wed, 12 Jul 2023 10:31:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJX7h-0004t2-E6; Wed, 12 Jul 2023 10:31:05 +0000
Received: by outflank-mailman (input) for mailman id 562181;
 Wed, 12 Jul 2023 10:31:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=I1v4=C6=arm.com=peter.hoyes@srs-se1.protection.inumbo.net>)
 id 1qJX7g-0004bk-1i
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:31:04 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTP
 id 334d1767-209f-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 12:31:03 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9E43DD75;
 Wed, 12 Jul 2023 03:31:44 -0700 (PDT)
Received: from e125920.cambridge.arm.com (unknown [10.1.199.64])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0E90F3F73F;
 Wed, 12 Jul 2023 03:31:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 334d1767-209f-11ee-b239-6b7b168915f2
From: Peter Hoyes <peter.hoyes@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com,
	wei.chen@arm.com,
	luca.fancellu@arm.com,
	Peter Hoyes <Peter.Hoyes@arm.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v5 2/2] xl: Add escape character argument to xl console
Date: Wed, 12 Jul 2023 11:29:17 +0100
Message-Id: <20230712102917.37763-3-peter.hoyes@arm.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230712102917.37763-1-peter.hoyes@arm.com>
References: <20230712102917.37763-1-peter.hoyes@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Peter Hoyes <Peter.Hoyes@arm.com>

Add -e argument to xl console and pass to new escape_character argument
of libxl_console_exec.

Introduce a new API version to support this new argument and advertise
the new functionality in libxl.h

In libxl_console_exec, there are currently two call sites to execl,
which uses varargs, in order to support optionally passing
'start-notify-fd' to the console client. In order to support passing
the 'escape' argument optionally too, refactor to instead have a single
call site to execv, which has the same behavior but takes an array of
arguments.

If -e is not specified, --escape is not passed to the console client and
the existing value (^]) is used as a default.

Update the xl docs.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
---
Changes in v5:
- Add this changelog
- Fix comment style in libxl_console_exec

Changes in v4:
- Document xl console -e argument in xl.1.pod.in
- Add changes for libxl API version compatibility

Changes in v3:
- Re-add the Reviewed-By tag accidentally removed in v2

Changes in v2:
- Drop the tags intended only for internal use at Arm

 docs/man/xl.1.pod.in             |  8 ++++++-
 tools/include/libxl.h            | 39 +++++++++++++++++++++++++++++---
 tools/libs/light/libxl_console.c | 30 +++++++++++++++++-------
 tools/xl/xl_cmdtable.c           |  3 ++-
 tools/xl/xl_console.c            | 10 +++++---
 tools/xl/xl_vmcontrol.c          |  2 +-
 6 files changed, 75 insertions(+), 17 deletions(-)

diff --git a/docs/man/xl.1.pod.in b/docs/man/xl.1.pod.in
index 101e14241d..9ba22a8fa2 100644
--- a/docs/man/xl.1.pod.in
+++ b/docs/man/xl.1.pod.in
@@ -222,7 +222,8 @@ Attach to the console of a domain specified by I<domain-id>.  If you've set up
 your domains to have a traditional login console this will look much like a
 normal text login screen.
 
-Use the key combination Ctrl+] to detach from the domain console.
+Use the escape character key combination (default Ctrl+]) to detach from the
+domain console.
 
 B<OPTIONS>
 
@@ -239,6 +240,11 @@ emulated serial for HVM guests and PV console for PV guests.
 
 Connect to console number I<NUM>. Console numbers start from 0.
 
+=item I<-e escapechar>
+
+Customize the escape sequence used to detach from the domain console to
+I<escapechar>. If not specified, the value "^]" is used.
+
 =back
 
 =item B<destroy> [I<OPTIONS>] I<domain-id>
diff --git a/tools/include/libxl.h b/tools/include/libxl.h
index cac641a7eb..21e43cc839 100644
--- a/tools/include/libxl.h
+++ b/tools/include/libxl.h
@@ -81,6 +81,15 @@
  */
 #define LIBXL_HAVE_CONSOLE_NOTIFY_FD 1
 
+/* LIBXL_HAVE_CONSOLE_ESCAPE_CHARACTER
+ *
+ * If this is defined, libxl_console_exec and
+ * libxl_primary_console_exe take an escape_character parameter. That
+ * parameter will be used to modify the escape sequence used to exit the
+ * console.
+ */
+#define LIBXL_HAVE_CONSOLE_ESCAPE_CHARACTER 1
+
 /* LIBXL_HAVE_CONST_COPY_AND_LENGTH_FUNCTIONS
  *
  * If this is defined, the copy functions have constified src parameter and the
@@ -790,7 +799,8 @@ typedef struct libxl__ctx libxl_ctx;
 #if LIBXL_API_VERSION != 0x040200 && LIBXL_API_VERSION != 0x040300 && \
     LIBXL_API_VERSION != 0x040400 && LIBXL_API_VERSION != 0x040500 && \
     LIBXL_API_VERSION != 0x040700 && LIBXL_API_VERSION != 0x040800 && \
-    LIBXL_API_VERSION != 0x041300 && LIBXL_API_VERSION != 0x041400
+    LIBXL_API_VERSION != 0x041300 && LIBXL_API_VERSION != 0x041400 && \
+    LIBXL_API_VERSION != 0x041800
 #error Unknown LIBXL_API_VERSION
 #endif
 #endif
@@ -1958,7 +1968,8 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass);
  * the caller that it has connected to the guest console.
  */
 int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
-                       libxl_console_type type, int notify_fd);
+                       libxl_console_type type, int notify_fd,
+                       char* escape_character);
 /* libxl_primary_console_exec finds the domid and console number
  * corresponding to the primary console of the given vm, then calls
  * libxl_console_exec with the right arguments (domid might be different
@@ -1968,9 +1979,12 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
  * guests using pygrub.
  * If notify_fd is not -1, xenconsole will write 0x00 to it to nofity
  * the caller that it has connected to the guest console.
+ * If escape_character is not NULL, the provided value is used to exit
+ * the guest console.
  */
 int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm,
-                               int notify_fd);
+                               int notify_fd,
+                               char* escape_character);
 
 #if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040800
 
@@ -1989,6 +2003,25 @@ static inline int libxl_primary_console_exec_0x040700(libxl_ctx *ctx,
 }
 #define libxl_primary_console_exec libxl_primary_console_exec_0x040700
 
+#elif defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x041800
+
+static inline int libxl_console_exec_0x041800(libxl_ctx *ctx, uint32_t domid,
+                                              int cons_num,
+                                              libxl_console_type type,
+                                              int notify_fd)
+{
+    return libxl_console_exec(ctx, domid, cons_num, type, notify_fd, NULL);
+}
+#define libxl_console_exec libxl_console_exec_0x041800
+
+static inline int libxl_primary_console_exec_0x041800(libxl_ctx *ctx,
+                                                      uint32_t domid_vm,
+                                                      int notify_fd)
+{
+    return libxl_primary_console_exec(ctx, domid_vm, notify_fd, NULL);
+}
+#define libxl_primary_console_exec libxl_primary_console_exec_0x041800
+
 #endif
 
 /* libxl_console_get_tty retrieves the specified domain's console tty path
diff --git a/tools/libs/light/libxl_console.c b/tools/libs/light/libxl_console.c
index f497be141b..cd7412a327 100644
--- a/tools/libs/light/libxl_console.c
+++ b/tools/libs/light/libxl_console.c
@@ -52,7 +52,8 @@ out:
 }
 
 int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
-                       libxl_console_type type, int notify_fd)
+                       libxl_console_type type, int notify_fd,
+                       char* escape_character)
 {
     GC_INIT(ctx);
     char *p = GCSPRINTF("%s/xenconsole", libxl__private_bindir_path());
@@ -75,15 +76,26 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
         goto out;
     }
 
+    char *args[] = {
+        p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
+        NULL, NULL, NULL, NULL, /* start-notify-fd, escape */
+        NULL, /* list terminator - do not use */
+    };
+    char **args_extra = args + 6;
+
     if (notify_fd != -1) {
         notify_fd_s = GCSPRINTF("%d", notify_fd);
-        execl(p, p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
-              "--start-notify-fd", notify_fd_s, (void *)NULL);
-    } else {
-        execl(p, p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
-              (void *)NULL);
+        *args_extra++ = "--start-notify-fd";
+        *args_extra++ = notify_fd_s;
     }
 
+    if (escape_character) {
+        *args_extra++ = "--escape";
+        *args_extra++ = escape_character;
+    }
+
+    execv(p, args);
+
 out:
     GC_FREE;
     return ERROR_FAIL;
@@ -156,7 +168,8 @@ out:
     return rc;
 }
 
-int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm, int notify_fd)
+int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm, int notify_fd,
+                               char* escape_character)
 {
     uint32_t domid;
     int cons_num;
@@ -165,7 +178,8 @@ int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm, int notify_fd)
 
     rc = libxl__primary_console_find(ctx, domid_vm, &domid, &cons_num, &type);
     if ( rc ) return rc;
-    return libxl_console_exec(ctx, domid, cons_num, type, notify_fd);
+    return libxl_console_exec(ctx, domid, cons_num, type, notify_fd,
+                              escape_character);
 }
 
 int libxl_primary_console_get_tty(libxl_ctx *ctx, uint32_t domid_vm,
diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
index ccf4d83584..67604e9536 100644
--- a/tools/xl/xl_cmdtable.c
+++ b/tools/xl/xl_cmdtable.c
@@ -141,7 +141,8 @@ const struct cmd_spec cmd_table[] = {
       "Attach to domain's console",
       "[options] <Domain>\n"
       "-t <type>       console type, pv , serial or vuart\n"
-      "-n <number>     console number"
+      "-n <number>     console number\n"
+      "-e <escape>     escape character"
     },
     { "vncviewer",
       &main_vncviewer, 0, 0,
diff --git a/tools/xl/xl_console.c b/tools/xl/xl_console.c
index b27f9e0136..5633c6f6f7 100644
--- a/tools/xl/xl_console.c
+++ b/tools/xl/xl_console.c
@@ -28,8 +28,9 @@ int main_console(int argc, char **argv)
     int opt = 0, num = 0;
     libxl_console_type type = 0;
     const char *console_names = "pv, serial, vuart";
+    char* escape_character = NULL;
 
-    SWITCH_FOREACH_OPT(opt, "n:t:", NULL, "console", 1) {
+    SWITCH_FOREACH_OPT(opt, "n:t:e:", NULL, "console", 1) {
     case 't':
         if (!strcmp(optarg, "pv"))
             type = LIBXL_CONSOLE_TYPE_PV;
@@ -45,13 +46,16 @@ int main_console(int argc, char **argv)
     case 'n':
         num = atoi(optarg);
         break;
+    case 'e':
+        escape_character = optarg;
+        break;
     }
 
     domid = find_domain(argv[optind]);
     if (!type)
-        libxl_primary_console_exec(ctx, domid, -1);
+        libxl_primary_console_exec(ctx, domid, -1, escape_character);
     else
-        libxl_console_exec(ctx, domid, num, type, -1);
+        libxl_console_exec(ctx, domid, num, type, -1, escape_character);
     fprintf(stderr, "Unable to attach console\n");
     return EXIT_FAILURE;
 }
diff --git a/tools/xl/xl_vmcontrol.c b/tools/xl/xl_vmcontrol.c
index 5518c78dc6..03971927e9 100644
--- a/tools/xl/xl_vmcontrol.c
+++ b/tools/xl/xl_vmcontrol.c
@@ -643,7 +643,7 @@ static void autoconnect_console(libxl_ctx *ctx_ignored,
     postfork();
 
     sleep(1);
-    libxl_primary_console_exec(ctx, bldomid, notify_fd);
+    libxl_primary_console_exec(ctx, bldomid, notify_fd, NULL);
     /* Do not return. xl continued in child process */
     perror("xl: unable to exec console client");
     _exit(1);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:33:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:33:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562201.878791 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAM-00066u-85; Wed, 12 Jul 2023 10:33:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562201.878791; Wed, 12 Jul 2023 10:33:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAM-00065M-2Q; Wed, 12 Jul 2023 10:33:50 +0000
Received: by outflank-mailman (input) for mailman id 562201;
 Wed, 12 Jul 2023 10:33:48 +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
 <SRS0=M0TT=C6=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qJXAK-00061z-Tc
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:33:48 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9556afb5-209f-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:33:47 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.151.90])
 by support.bugseng.com (Postfix) with ESMTPSA id 15B614EE0C87;
 Wed, 12 Jul 2023 12:33:46 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9556afb5-209f-11ee-8611-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v3 01/15] x86/cpufreq: fix violations of MISRA C:2012 Rule 7.2
Date: Wed, 12 Jul 2023 12:32:02 +0200
Message-Id: <4f22e7c9de1ca407d976891774ad7c74df6cb36f.1689152719.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689152719.git.gianluca.luparini@bugseng.com>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v3:
- change 'Signed-off-by' ordering

Changes in v2:
- change commit title to make it unique
- change commit message
---
 xen/arch/x86/acpi/cpufreq/powernow.c      | 14 +++++++-------
 xen/include/acpi/cpufreq/processor_perf.h |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/powernow.c b/xen/arch/x86/acpi/cpufreq/powernow.c
index d4c7dcd5d9..8e0784b69c 100644
--- a/xen/arch/x86/acpi/cpufreq/powernow.c
+++ b/xen/arch/x86/acpi/cpufreq/powernow.c
@@ -32,14 +32,14 @@
 #include <acpi/acpi.h>
 #include <acpi/cpufreq/cpufreq.h>
 
-#define HW_PSTATE_MASK          0x00000007
-#define HW_PSTATE_VALID_MASK    0x80000000
-#define HW_PSTATE_MAX_MASK      0x000000f0
+#define HW_PSTATE_MASK          0x00000007U
+#define HW_PSTATE_VALID_MASK    0x80000000U
+#define HW_PSTATE_MAX_MASK      0x000000f0U
 #define HW_PSTATE_MAX_SHIFT     4
-#define MSR_PSTATE_DEF_BASE     0xc0010064 /* base of Pstate MSRs */
-#define MSR_PSTATE_STATUS       0xc0010063 /* Pstate Status MSR */
-#define MSR_PSTATE_CTRL         0xc0010062 /* Pstate control MSR */
-#define MSR_PSTATE_CUR_LIMIT    0xc0010061 /* pstate current limit MSR */
+#define MSR_PSTATE_DEF_BASE     0xc0010064U /* base of Pstate MSRs */
+#define MSR_PSTATE_STATUS       0xc0010063U /* Pstate Status MSR */
+#define MSR_PSTATE_CTRL         0xc0010062U /* Pstate control MSR */
+#define MSR_PSTATE_CUR_LIMIT    0xc0010061U /* pstate current limit MSR */
 #define MSR_HWCR_CPBDIS_MASK    0x02000000ULL
 
 #define ARCH_CPU_FLAG_RESUME	1
diff --git a/xen/include/acpi/cpufreq/processor_perf.h b/xen/include/acpi/cpufreq/processor_perf.h
index d8a1ba68a6..8b5a1b9bde 100644
--- a/xen/include/acpi/cpufreq/processor_perf.h
+++ b/xen/include/acpi/cpufreq/processor_perf.h
@@ -5,7 +5,7 @@
 #include <public/sysctl.h>
 #include <xen/acpi.h>
 
-#define XEN_PX_INIT 0x80000000
+#define XEN_PX_INIT 0x80000000U
 
 int powernow_cpufreq_init(void);
 unsigned int powernow_register_driver(void);
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:33:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:33:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562202.878806 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAN-0006X4-It; Wed, 12 Jul 2023 10:33:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562202.878806; Wed, 12 Jul 2023 10:33:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAN-0006Wt-G5; Wed, 12 Jul 2023 10:33:51 +0000
Received: by outflank-mailman (input) for mailman id 562202;
 Wed, 12 Jul 2023 10:33:50 +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
 <SRS0=M0TT=C6=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qJXAM-00061z-GW
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:33:50 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 960c99eb-209f-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:33:48 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.151.90])
 by support.bugseng.com (Postfix) with ESMTPSA id 4B2794EE0C89;
 Wed, 12 Jul 2023 12:33:47 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 960c99eb-209f-11ee-8611-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v3 02/15] AMD/IOMMU: fix violations of MISRA C:2012 Rule 7.2
Date: Wed, 12 Jul 2023 12:32:03 +0200
Message-Id: <662b39b70f91d3f71de929f2b79ad3cfc88f4007.1689152719.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689152719.git.gianluca.luparini@bugseng.com>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v3:
- change 'Signed-off-by' ordering

Changes in v2:
- minor change to commit title
- change commit message
---
 xen/drivers/passthrough/amd/iommu-defs.h | 122 +++++++++++------------
 1 file changed, 61 insertions(+), 61 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu-defs.h b/xen/drivers/passthrough/amd/iommu-defs.h
index 35de548e3a..c145248f9a 100644
--- a/xen/drivers/passthrough/amd/iommu-defs.h
+++ b/xen/drivers/passthrough/amd/iommu-defs.h
@@ -38,49 +38,49 @@
         ((uint64_t)(offset) << (12 + (PTE_PER_TABLE_SHIFT * ((level) - 1))))
 
 /* IOMMU Capability */
-#define PCI_CAP_ID_MASK		0x000000FF
+#define PCI_CAP_ID_MASK		0x000000FFU
 #define PCI_CAP_ID_SHIFT	0
-#define PCI_CAP_NEXT_PTR_MASK	0x0000FF00
+#define PCI_CAP_NEXT_PTR_MASK	0x0000FF00U
 #define PCI_CAP_NEXT_PTR_SHIFT	8
-#define PCI_CAP_TYPE_MASK	0x00070000
+#define PCI_CAP_TYPE_MASK	0x00070000U
 #define PCI_CAP_TYPE_SHIFT	16
-#define PCI_CAP_REV_MASK	0x00F80000
+#define PCI_CAP_REV_MASK	0x00F80000U
 #define PCI_CAP_REV_SHIFT	19
-#define PCI_CAP_IOTLB_MASK	0x01000000
+#define PCI_CAP_IOTLB_MASK	0x01000000U
 #define PCI_CAP_IOTLB_SHIFT	24
-#define PCI_CAP_HT_TUNNEL_MASK	0x02000000
+#define PCI_CAP_HT_TUNNEL_MASK	0x02000000U
 #define PCI_CAP_HT_TUNNEL_SHIFT	25
-#define PCI_CAP_NP_CACHE_MASK	0x04000000
+#define PCI_CAP_NP_CACHE_MASK	0x04000000U
 #define PCI_CAP_NP_CACHE_SHIFT	26
 #define PCI_CAP_EFRSUP_SHIFT    27
-#define PCI_CAP_RESET_MASK	0x80000000
+#define PCI_CAP_RESET_MASK	0x80000000U
 #define PCI_CAP_RESET_SHIFT	31
 
 #define PCI_CAP_TYPE_IOMMU		0x3
 
 #define PCI_CAP_MMIO_BAR_LOW_OFFSET	0x04
 #define PCI_CAP_MMIO_BAR_HIGH_OFFSET	0x08
-#define PCI_CAP_MMIO_BAR_LOW_MASK	0xFFFFC000
+#define PCI_CAP_MMIO_BAR_LOW_MASK	0xFFFFC000U
 #define IOMMU_MMIO_REGION_LENGTH	0x4000
 
 #define PCI_CAP_RANGE_OFFSET		0x0C
-#define PCI_CAP_BUS_NUMBER_MASK		0x0000FF00
+#define PCI_CAP_BUS_NUMBER_MASK		0x0000FF00U
 #define PCI_CAP_BUS_NUMBER_SHIFT	8
-#define PCI_CAP_FIRST_DEVICE_MASK	0x00FF0000
+#define PCI_CAP_FIRST_DEVICE_MASK	0x00FF0000U
 #define PCI_CAP_FIRST_DEVICE_SHIFT	16
-#define PCI_CAP_LAST_DEVICE_MASK	0xFF000000
+#define PCI_CAP_LAST_DEVICE_MASK	0xFF000000U
 #define PCI_CAP_LAST_DEVICE_SHIFT	24
 
-#define PCI_CAP_UNIT_ID_MASK    0x0000001F
+#define PCI_CAP_UNIT_ID_MASK    0x0000001FU
 #define PCI_CAP_UNIT_ID_SHIFT   0
 #define PCI_CAP_MISC_INFO_OFFSET    0x10
-#define PCI_CAP_MSI_NUMBER_MASK     0x0000001F
+#define PCI_CAP_MSI_NUMBER_MASK     0x0000001FU
 #define PCI_CAP_MSI_NUMBER_SHIFT    0
 
 /* Device Table */
 #define IOMMU_DEV_TABLE_BASE_LOW_OFFSET		0x00
 #define IOMMU_DEV_TABLE_BASE_HIGH_OFFSET	0x04
-#define IOMMU_DEV_TABLE_SIZE_MASK		0x000001FF
+#define IOMMU_DEV_TABLE_SIZE_MASK		0x000001FFU
 #define IOMMU_DEV_TABLE_SIZE_SHIFT		0
 
 #define IOMMU_DEV_TABLE_ENTRIES_PER_BUS		256
@@ -159,13 +159,13 @@ struct amd_iommu_dte {
 #define IOMMU_CMD_BUFFER_BASE_HIGH_OFFSET	0x0C
 #define IOMMU_CMD_BUFFER_HEAD_OFFSET		0x2000
 #define IOMMU_CMD_BUFFER_TAIL_OFFSET		0x2008
-#define IOMMU_CMD_BUFFER_LENGTH_MASK		0x0F000000
+#define IOMMU_CMD_BUFFER_LENGTH_MASK		0x0F000000U
 #define IOMMU_CMD_BUFFER_LENGTH_SHIFT		24
 
 #define IOMMU_CMD_BUFFER_ENTRY_ORDER            4
 #define IOMMU_CMD_BUFFER_MAX_ENTRIES            (1u << 15)
 
-#define IOMMU_CMD_OPCODE_MASK			0xF0000000
+#define IOMMU_CMD_OPCODE_MASK			0xF0000000U
 #define IOMMU_CMD_OPCODE_SHIFT			28
 #define IOMMU_CMD_COMPLETION_WAIT		0x1
 #define IOMMU_CMD_INVALIDATE_DEVTAB_ENTRY	0x2
@@ -178,50 +178,50 @@ struct amd_iommu_dte {
 /* COMPLETION_WAIT command */
 #define IOMMU_COMP_WAIT_DATA_BUFFER_SIZE	8
 #define IOMMU_COMP_WAIT_DATA_BUFFER_ALIGNMENT	8
-#define IOMMU_COMP_WAIT_S_FLAG_MASK		0x00000001
-#define IOMMU_COMP_WAIT_I_FLAG_MASK		0x00000002
-#define IOMMU_COMP_WAIT_F_FLAG_MASK		0x00000004
-#define IOMMU_COMP_WAIT_ADDR_LOW_MASK		0xFFFFFFF8
+#define IOMMU_COMP_WAIT_S_FLAG_MASK		0x00000001U
+#define IOMMU_COMP_WAIT_I_FLAG_MASK		0x00000002U
+#define IOMMU_COMP_WAIT_F_FLAG_MASK		0x00000004U
+#define IOMMU_COMP_WAIT_ADDR_LOW_MASK		0xFFFFFFF8U
 #define IOMMU_COMP_WAIT_ADDR_LOW_SHIFT		3
-#define IOMMU_COMP_WAIT_ADDR_HIGH_MASK		0x000FFFFF
+#define IOMMU_COMP_WAIT_ADDR_HIGH_MASK		0x000FFFFFU
 #define IOMMU_COMP_WAIT_ADDR_HIGH_SHIFT		0
 
 /* INVALIDATE_IOMMU_PAGES command */
-#define IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_MASK	0x0000FFFF
+#define IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_MASK	0x0000FFFFU
 #define IOMMU_INV_IOMMU_PAGES_DOMAIN_ID_SHIFT	0
-#define IOMMU_INV_IOMMU_PAGES_S_FLAG_MASK	0x00000001
+#define IOMMU_INV_IOMMU_PAGES_S_FLAG_MASK	0x00000001U
 #define IOMMU_INV_IOMMU_PAGES_S_FLAG_SHIFT	0
-#define IOMMU_INV_IOMMU_PAGES_PDE_FLAG_MASK	0x00000002
+#define IOMMU_INV_IOMMU_PAGES_PDE_FLAG_MASK	0x00000002U
 #define IOMMU_INV_IOMMU_PAGES_PDE_FLAG_SHIFT	1
-#define IOMMU_INV_IOMMU_PAGES_ADDR_LOW_MASK	0xFFFFF000
+#define IOMMU_INV_IOMMU_PAGES_ADDR_LOW_MASK	0xFFFFF000U
 #define IOMMU_INV_IOMMU_PAGES_ADDR_LOW_SHIFT	12
-#define IOMMU_INV_IOMMU_PAGES_ADDR_HIGH_MASK	0xFFFFFFFF
+#define IOMMU_INV_IOMMU_PAGES_ADDR_HIGH_MASK	0xFFFFFFFFU
 #define IOMMU_INV_IOMMU_PAGES_ADDR_HIGH_SHIFT	0
 
 /* INVALIDATE_DEVTAB_ENTRY command */
-#define IOMMU_INV_DEVTAB_ENTRY_DEVICE_ID_MASK   0x0000FFFF
+#define IOMMU_INV_DEVTAB_ENTRY_DEVICE_ID_MASK   0x0000FFFFU
 #define IOMMU_INV_DEVTAB_ENTRY_DEVICE_ID_SHIFT  0
 
 /* INVALIDATE_INTERRUPT_TABLE command */
-#define IOMMU_INV_INT_TABLE_DEVICE_ID_MASK   0x0000FFFF
+#define IOMMU_INV_INT_TABLE_DEVICE_ID_MASK   0x0000FFFFU
 #define IOMMU_INV_INT_TABLE_DEVICE_ID_SHIFT  0
 
 /* INVALIDATE_IOTLB_PAGES command */
-#define IOMMU_INV_IOTLB_PAGES_MAXPEND_MASK          0xff000000
+#define IOMMU_INV_IOTLB_PAGES_MAXPEND_MASK          0xff000000U
 #define IOMMU_INV_IOTLB_PAGES_MAXPEND_SHIFT         24
-#define IOMMU_INV_IOTLB_PAGES_PASID1_MASK           0x00ff0000
+#define IOMMU_INV_IOTLB_PAGES_PASID1_MASK           0x00ff0000U
 #define IOMMU_INV_IOTLB_PAGES_PASID1_SHIFT          16
-#define IOMMU_INV_IOTLB_PAGES_PASID2_MASK           0x0fff0000
+#define IOMMU_INV_IOTLB_PAGES_PASID2_MASK           0x0fff0000U
 #define IOMMU_INV_IOTLB_PAGES_PASID2_SHIFT          16
-#define IOMMU_INV_IOTLB_PAGES_QUEUEID_MASK          0x0000ffff
+#define IOMMU_INV_IOTLB_PAGES_QUEUEID_MASK          0x0000ffffU
 #define IOMMU_INV_IOTLB_PAGES_QUEUEID_SHIFT         0
-#define IOMMU_INV_IOTLB_PAGES_DEVICE_ID_MASK        0x0000FFFF
+#define IOMMU_INV_IOTLB_PAGES_DEVICE_ID_MASK        0x0000FFFFU
 #define IOMMU_INV_IOTLB_PAGES_DEVICE_ID_SHIFT       0
-#define IOMMU_INV_IOTLB_PAGES_ADDR_LOW_MASK         0xFFFFF000
+#define IOMMU_INV_IOTLB_PAGES_ADDR_LOW_MASK         0xFFFFF000U
 #define IOMMU_INV_IOTLB_PAGES_ADDR_LOW_SHIFT        12
-#define IOMMU_INV_IOTLB_PAGES_ADDR_HIGH_MASK        0xFFFFFFFF
+#define IOMMU_INV_IOTLB_PAGES_ADDR_HIGH_MASK        0xFFFFFFFFU
 #define IOMMU_INV_IOTLB_PAGES_ADDR_HIGH_SHIFT       0
-#define IOMMU_INV_IOTLB_PAGES_S_FLAG_MASK           0x00000001
+#define IOMMU_INV_IOTLB_PAGES_S_FLAG_MASK           0x00000001U
 #define IOMMU_INV_IOTLB_PAGES_S_FLAG_SHIFT          0
 
 /* Event Log */
@@ -229,18 +229,18 @@ struct amd_iommu_dte {
 #define IOMMU_EVENT_LOG_BASE_HIGH_OFFSET	0x14
 #define IOMMU_EVENT_LOG_HEAD_OFFSET		0x2010
 #define IOMMU_EVENT_LOG_TAIL_OFFSET		0x2018
-#define IOMMU_EVENT_LOG_LENGTH_MASK		0x0F000000
+#define IOMMU_EVENT_LOG_LENGTH_MASK		0x0F000000U
 #define IOMMU_EVENT_LOG_LENGTH_SHIFT		24
-#define IOMMU_EVENT_LOG_HEAD_MASK		0x0007FFF0
+#define IOMMU_EVENT_LOG_HEAD_MASK		0x0007FFF0U
 #define IOMMU_EVENT_LOG_HEAD_SHIFT		4
-#define IOMMU_EVENT_LOG_TAIL_MASK		0x0007FFF0
+#define IOMMU_EVENT_LOG_TAIL_MASK		0x0007FFF0U
 #define IOMMU_EVENT_LOG_TAIL_SHIFT		4
 
 #define IOMMU_EVENT_LOG_ENTRY_SIZE 			16
 #define IOMMU_EVENT_LOG_POWER_OF2_ENTRIES_PER_PAGE	8
 #define IOMMU_EVENT_LOG_U32_PER_ENTRY	(IOMMU_EVENT_LOG_ENTRY_SIZE / 4)
 
-#define IOMMU_EVENT_CODE_MASK			0xF0000000
+#define IOMMU_EVENT_CODE_MASK			0xF0000000U
 #define IOMMU_EVENT_CODE_SHIFT			28
 #define IOMMU_EVENT_ILLEGAL_DEV_TABLE_ENTRY	0x1
 #define IOMMU_EVENT_IO_PAGE_FAULT		0x2
@@ -251,12 +251,12 @@ struct amd_iommu_dte {
 #define IOMMU_EVENT_IOTLB_INV_TIMEOUT		0x7
 #define IOMMU_EVENT_INVALID_DEV_REQUEST		0x8
 
-#define IOMMU_EVENT_DOMAIN_ID_MASK           0x0000FFFF
+#define IOMMU_EVENT_DOMAIN_ID_MASK           0x0000FFFFU
 #define IOMMU_EVENT_DOMAIN_ID_SHIFT          0
-#define IOMMU_EVENT_DEVICE_ID_MASK           0x0000FFFF
+#define IOMMU_EVENT_DEVICE_ID_MASK           0x0000FFFFU
 #define IOMMU_EVENT_DEVICE_ID_SHIFT          0
 #define IOMMU_EVENT_FLAGS_SHIFT              16
-#define IOMMU_EVENT_FLAGS_MASK               0x0FFF0000
+#define IOMMU_EVENT_FLAGS_MASK               0x0FFF0000U
 
 /* PPR Log */
 #define IOMMU_PPR_LOG_ENTRY_SIZE                        16
@@ -265,21 +265,21 @@ struct amd_iommu_dte {
 
 #define IOMMU_PPR_LOG_BASE_LOW_OFFSET                   0x0038
 #define IOMMU_PPR_LOG_BASE_HIGH_OFFSET                  0x003C
-#define IOMMU_PPR_LOG_BASE_LOW_MASK                     0xFFFFF000
+#define IOMMU_PPR_LOG_BASE_LOW_MASK                     0xFFFFF000U
 #define IOMMU_PPR_LOG_BASE_LOW_SHIFT                    12
-#define IOMMU_PPR_LOG_BASE_HIGH_MASK                    0x000FFFFF
+#define IOMMU_PPR_LOG_BASE_HIGH_MASK                    0x000FFFFFU
 #define IOMMU_PPR_LOG_BASE_HIGH_SHIFT                   0
-#define IOMMU_PPR_LOG_LENGTH_MASK                       0x0F000000
+#define IOMMU_PPR_LOG_LENGTH_MASK                       0x0F000000U
 #define IOMMU_PPR_LOG_LENGTH_SHIFT                      24
-#define IOMMU_PPR_LOG_HEAD_MASK                         0x0007FFF0
+#define IOMMU_PPR_LOG_HEAD_MASK                         0x0007FFF0U
 #define IOMMU_PPR_LOG_HEAD_SHIFT                        4
-#define IOMMU_PPR_LOG_TAIL_MASK                         0x0007FFF0
+#define IOMMU_PPR_LOG_TAIL_MASK                         0x0007FFF0U
 #define IOMMU_PPR_LOG_TAIL_SHIFT                        4
 #define IOMMU_PPR_LOG_HEAD_OFFSET                       0x2030
 #define IOMMU_PPR_LOG_TAIL_OFFSET                       0x2038
-#define IOMMU_PPR_LOG_DEVICE_ID_MASK                    0x0000FFFF
+#define IOMMU_PPR_LOG_DEVICE_ID_MASK                    0x0000FFFFU
 #define IOMMU_PPR_LOG_DEVICE_ID_SHIFT                   0
-#define IOMMU_PPR_LOG_CODE_MASK                         0xF0000000
+#define IOMMU_PPR_LOG_CODE_MASK                         0xF0000000U
 #define IOMMU_PPR_LOG_CODE_SHIFT                        28
 
 #define IOMMU_LOG_ENTRY_TIMEOUT                         1000
@@ -342,17 +342,17 @@ union amd_iommu_control {
 #define IOMMU_EXCLUSION_BASE_HIGH_OFFSET	0x24
 #define IOMMU_EXCLUSION_LIMIT_LOW_OFFSET	0x28
 #define IOMMU_EXCLUSION_LIMIT_HIGH_OFFSET	0x2C
-#define IOMMU_EXCLUSION_BASE_LOW_MASK		0xFFFFF000
+#define IOMMU_EXCLUSION_BASE_LOW_MASK		0xFFFFF000U
 #define IOMMU_EXCLUSION_BASE_LOW_SHIFT		12
-#define IOMMU_EXCLUSION_BASE_HIGH_MASK		0xFFFFFFFF
+#define IOMMU_EXCLUSION_BASE_HIGH_MASK		0xFFFFFFFFU
 #define IOMMU_EXCLUSION_BASE_HIGH_SHIFT		0
-#define IOMMU_EXCLUSION_RANGE_ENABLE_MASK	0x00000001
+#define IOMMU_EXCLUSION_RANGE_ENABLE_MASK	0x00000001U
 #define IOMMU_EXCLUSION_RANGE_ENABLE_SHIFT	0
-#define IOMMU_EXCLUSION_ALLOW_ALL_MASK		0x00000002
+#define IOMMU_EXCLUSION_ALLOW_ALL_MASK		0x00000002U
 #define IOMMU_EXCLUSION_ALLOW_ALL_SHIFT		1
-#define IOMMU_EXCLUSION_LIMIT_LOW_MASK		0xFFFFF000
+#define IOMMU_EXCLUSION_LIMIT_LOW_MASK		0xFFFFF000U
 #define IOMMU_EXCLUSION_LIMIT_LOW_SHIFT		12
-#define IOMMU_EXCLUSION_LIMIT_HIGH_MASK		0xFFFFFFFF
+#define IOMMU_EXCLUSION_LIMIT_HIGH_MASK		0xFFFFFFFFU
 #define IOMMU_EXCLUSION_LIMIT_HIGH_SHIFT	0
 
 /* Extended Feature Register */
@@ -476,14 +476,14 @@ union amd_iommu_pte {
 
 #define INV_IOMMU_ALL_PAGES_ADDRESS      ((1ULL << 63) - 1)
 
-#define IOMMU_RING_BUFFER_PTR_MASK                  0x0007FFF0
+#define IOMMU_RING_BUFFER_PTR_MASK                  0x0007FFF0U
 
-#define IOMMU_CMD_DEVICE_ID_MASK                    0x0000FFFF
+#define IOMMU_CMD_DEVICE_ID_MASK                    0x0000FFFFU
 #define IOMMU_CMD_DEVICE_ID_SHIFT                   0
 
-#define IOMMU_REG_BASE_ADDR_LOW_MASK                0xFFFFF000
+#define IOMMU_REG_BASE_ADDR_LOW_MASK                0xFFFFF000U
 #define IOMMU_REG_BASE_ADDR_LOW_SHIFT               12
-#define IOMMU_REG_BASE_ADDR_HIGH_MASK               0x000FFFFF
+#define IOMMU_REG_BASE_ADDR_HIGH_MASK               0x000FFFFFU
 #define IOMMU_REG_BASE_ADDR_HIGH_SHIFT              0
 
 #endif /* AMD_IOMMU_DEFS_H */
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:33:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:33:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562206.878838 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAR-0007Fm-BY; Wed, 12 Jul 2023 10:33:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562206.878838; Wed, 12 Jul 2023 10:33:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAQ-0007De-V9; Wed, 12 Jul 2023 10:33:54 +0000
Received: by outflank-mailman (input) for mailman id 562206;
 Wed, 12 Jul 2023 10:33:54 +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
 <SRS0=M0TT=C6=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qJXAQ-00061z-10
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:33:54 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9831a288-209f-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:33:52 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.151.90])
 by support.bugseng.com (Postfix) with ESMTPSA id F0ED54EE0C8D;
 Wed, 12 Jul 2023 12:33:50 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9831a288-209f-11ee-8611-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Luca Fancellu <luca.fancellu@arm.com>
Subject: [XEN PATCH v3 05/15] xen/device-tree: fix violations of MISRA C:2012 Rule 7.2
Date: Wed, 12 Jul 2023 12:32:06 +0200
Message-Id: <e916a127d06480384b9de2765b81bd798006e636.1689152719.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689152719.git.gianluca.luparini@bugseng.com>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v3:
- change 'Signed-off-by' ordering

Changes in v2:
- change commit title to the right one
- change commit message
- change maintainers in Cc
- remove changes in 'libfdt'
---
 xen/common/device_tree.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 8da1052911..0677193ab3 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -2115,7 +2115,7 @@ static void __init __unflatten_device_tree(const void *fdt,
     /* Allocate memory for the expanded device tree */
     mem = (unsigned long)_xmalloc (size + 4, __alignof__(struct dt_device_node));
 
-    ((__be32 *)mem)[size / 4] = cpu_to_be32(0xdeadbeef);
+    ((__be32 *)mem)[size / 4] = cpu_to_be32(0xdeadbeefU);
 
     dt_dprintk("  unflattening %lx...\n", mem);
 
@@ -2125,7 +2125,7 @@ static void __init __unflatten_device_tree(const void *fdt,
     if ( be32_to_cpup((__be32 *)start) != FDT_END )
         printk(XENLOG_WARNING "Weird tag at end of tree: %08x\n",
                   *((u32 *)start));
-    if ( be32_to_cpu(((__be32 *)mem)[size / 4]) != 0xdeadbeef )
+    if ( be32_to_cpu(((__be32 *)mem)[size / 4]) != 0xdeadbeefU )
         printk(XENLOG_WARNING "End of tree marker overwritten: %08x\n",
                   be32_to_cpu(((__be32 *)mem)[size / 4]));
     *allnextp = NULL;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:33:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:33:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562203.878811 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAN-0006aK-Tg; Wed, 12 Jul 2023 10:33:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562203.878811; Wed, 12 Jul 2023 10:33:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAN-0006Zi-Ox; Wed, 12 Jul 2023 10:33:51 +0000
Received: by outflank-mailman (input) for mailman id 562203;
 Wed, 12 Jul 2023 10:33:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=M0TT=C6=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qJXAM-0006Dd-Nu
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:33:50 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 96d0c3b8-209f-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 12:33:49 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.151.90])
 by support.bugseng.com (Postfix) with ESMTPSA id 7E7F34EE0C8A;
 Wed, 12 Jul 2023 12:33:48 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 96d0c3b8-209f-11ee-b239-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v3 03/15] x86/svm: fix violations of MISRA C:2012 Rule 7.2
Date: Wed, 12 Jul 2023 12:32:04 +0200
Message-Id: <b63ed0674f467d532afe4b57c833b446b2e29a90.1689152719.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689152719.git.gianluca.luparini@bugseng.com>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v3:
- change 'Signed-off-by' ordering

Changes in v2:
- change commit title to make it unique
- change commit message
---
 xen/arch/x86/hvm/svm/asid.c | 2 +-
 xen/arch/x86/hvm/svm/svm.c  | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/asid.c b/xen/arch/x86/hvm/svm/asid.c
index 09f8c23fd9..56306d1a16 100644
--- a/xen/arch/x86/hvm/svm/asid.c
+++ b/xen/arch/x86/hvm/svm/asid.c
@@ -16,7 +16,7 @@ void svm_asid_init(const struct cpuinfo_x86 *c)
 
     /* Check for erratum #170, and leave ASIDs disabled if it's present. */
     if ( !cpu_has_amd_erratum(c, AMD_ERRATUM_170) )
-        nasids = cpuid_ebx(0x8000000A);
+        nasids = cpuid_ebx(0x8000000AU);
 
     hvm_asid_init(nasids);
 }
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 59a6e88dff..56cb2f61bb 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -269,9 +269,9 @@ svm_msrbit(unsigned long *msr_bitmap, uint32_t msr)
      */
     if ( msr <= 0x1fff )
         msr_bit = msr_bitmap + 0x0000 / BYTES_PER_LONG;
-    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
+    else if ( (msr >= 0xc0000000U) && (msr <= 0xc0001fffU) )
         msr_bit = msr_bitmap + 0x0800 / BYTES_PER_LONG;
-    else if ( (msr >= 0xc0010000) && (msr <= 0xc0011fff) )
+    else if ( (msr >= 0xc0010000U) && (msr <= 0xc0011fffU) )
         msr_bit = msr_bitmap + 0x1000 / BYTES_PER_LONG;
 
     return msr_bit;
@@ -2539,8 +2539,8 @@ const struct hvm_function_table * __init start_svm(void)
 
     setup_vmcb_dump();
 
-    if ( boot_cpu_data.extended_cpuid_level >= 0x8000000a )
-        svm_feature_flags = cpuid_edx(0x8000000a);
+    if ( boot_cpu_data.extended_cpuid_level >= 0x8000000aU )
+        svm_feature_flags = cpuid_edx(0x8000000aU);
 
     printk("SVM: Supported advanced features:\n");
 
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:33:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:33:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562200.878785 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAL-00062c-T8; Wed, 12 Jul 2023 10:33:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562200.878785; Wed, 12 Jul 2023 10:33:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAL-00062V-QX; Wed, 12 Jul 2023 10:33:49 +0000
Received: by outflank-mailman (input) for mailman id 562200;
 Wed, 12 Jul 2023 10:33:48 +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
 <SRS0=M0TT=C6=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qJXAK-00061z-6N
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:33:48 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 949e7cab-209f-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:33:46 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.151.90])
 by support.bugseng.com (Postfix) with ESMTPSA id 9085C4EE0737;
 Wed, 12 Jul 2023 12:33:43 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 949e7cab-209f-11ee-8611-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Paul Durrant <paul@xen.org>,
	Juergen Gross <jgross@suse.com>,
	Tamas K Lengyel <tamas@tklengyel.com>,
	Alexandru Isaila <aisaila@bitdefender.com>,
	Petre Pircalabu <ppircalabu@bitdefender.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: [XEN PATCH v3 00/15] xen: fix violations of MISRA C:2012 Rule 7.2
Date: Wed, 12 Jul 2023 12:32:01 +0200
Message-Id: <cover.1689152719.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose headline
states:
"A 'u' or 'U' suffix shall be applied to all integer constants that are
represented in an unsigned type".

These violations are caused by the missing "u" or "U" suffix in unsigned
integer constants, such as:

xen/arch/x86/hvm/hypercall.c:132.17-132.26
if ( (eax & 0x80000000) && is_viridian_domain(currd) )

If a rule is not met, fixes are needed in order to achieve compliance.
The patches in this series achieve compliance for MISRA C:2012 Rule 7.2 by
adding the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Changes to macros 'X86_CR0_PG' and 'MSR_EFER' in files
"xen/arch/x86/include/asm/x86-defns.h" and "xen/arch/x86/include/asm/msr-index.h"
are not made since they are used also in assembly files.

---
Changes in v3:
- fixes following review comments
- change some commit messages
- change 'Signed-off-by' ordering
- create two new commits

Changes in v2:
- fixes following review comments
- change title and commit messages
- remove changes in out of scope files
- remove changes in some macros

Gianluca Luparini (15):
  x86/cpufreq: fix violations of MISRA C:2012 Rule 7.2
  AMD/IOMMU: fix violations of MISRA C:2012 Rule 7.2
  x86/svm: fix violations of MISRA C:2012 Rule 7.2
  xen/arm: fix violations of MISRA C:2012 Rule 7.2
  xen/device-tree: fix violations of MISRA C:2012 Rule 7.2
  xen/efi: fix violations of MISRA C:2012 Rule 7.2
  x86/vmx: fix violations of MISRA C:2012 Rule 7.2
  xen/pci: fix violations of MISRA C:2012 Rule 7.2
  xen/public: fix violations of MISRA C:2012 Rule 7.2
  x86/monitor: fix violations of MISRA C:2012 Rule 7.2
  xen/vpci: fix violations of MISRA C:2012 Rule 7.2
  xen/x86: fix violations of MISRA C:2012 Rule 7.2
  x86/viridian: fix violations of MISRA C:2012 Rule 7.2
  ACPI/APEI: fix violations of MISRA C:2012 Rule 7.2
  xen: fix violations of MISRA C:2012 Rule 7.2

 xen/arch/arm/domain_build.c                  |   4 +-
 xen/arch/arm/efi/efi-boot.h                  |   2 +-
 xen/arch/arm/gic-v2.c                        |   6 +-
 xen/arch/arm/gic-v3.c                        |  10 +-
 xen/arch/arm/include/asm/arm64/brk.h         |   2 +-
 xen/arch/arm/include/asm/arm64/efibind.h     |  10 +-
 xen/arch/arm/include/asm/arm64/insn.h        |  16 +-
 xen/arch/arm/include/asm/vreg.h              |   2 +-
 xen/arch/arm/kernel.c                        |   2 +-
 xen/arch/arm/traps.c                         |  14 +-
 xen/arch/arm/vgic-v2.c                       |   2 +-
 xen/arch/arm/vgic-v3.c                       |   2 +-
 xen/arch/x86/acpi/cpufreq/powernow.c         |  14 +-
 xen/arch/x86/apic.c                          |   2 +-
 xen/arch/x86/cpu-policy.c                    |  18 +-
 xen/arch/x86/cpu/mcheck/mce-apei.c           |   4 +-
 xen/arch/x86/cpu/vpmu_intel.c                |   2 +-
 xen/arch/x86/cpuid.c                         |   8 +-
 xen/arch/x86/efi/efi-boot.h                  |   6 +-
 xen/arch/x86/extable.c                       |   2 +-
 xen/arch/x86/hvm/hypercall.c                 |   2 +-
 xen/arch/x86/hvm/irq.c                       |   2 +-
 xen/arch/x86/hvm/pmtimer.c                   |   4 +-
 xen/arch/x86/hvm/stdvga.c                    |  50 ++---
 xen/arch/x86/hvm/svm/asid.c                  |   2 +-
 xen/arch/x86/hvm/svm/svm.c                   |   8 +-
 xen/arch/x86/hvm/viridian/viridian.c         |   2 +-
 xen/arch/x86/hvm/vlapic.c                    |   6 +-
 xen/arch/x86/hvm/vmx/vmcs.c                  |   6 +-
 xen/arch/x86/hvm/vmx/vvmx.c                  |   8 +-
 xen/arch/x86/include/asm/apicdef.h           |   2 +-
 xen/arch/x86/include/asm/config.h            |   2 +-
 xen/arch/x86/include/asm/guest/hyperv-tlfs.h |  28 +--
 xen/arch/x86/include/asm/hpet.h              |   2 +-
 xen/arch/x86/include/asm/hvm/trace.h         |   4 +-
 xen/arch/x86/include/asm/hvm/vioapic.h       |   2 +-
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h      |  84 ++++----
 xen/arch/x86/include/asm/hvm/vmx/vmx.h       |  16 +-
 xen/arch/x86/include/asm/msi.h               |   2 +-
 xen/arch/x86/include/asm/msr-index.h         | 202 +++++++++----------
 xen/arch/x86/include/asm/pci.h               |   8 +-
 xen/arch/x86/include/asm/x86-defns.h         |   2 +-
 xen/arch/x86/monitor.c                       |   6 +-
 xen/arch/x86/percpu.c                        |   2 +-
 xen/arch/x86/psr.c                           |   2 +-
 xen/arch/x86/spec_ctrl.c                     |   8 +-
 xen/arch/x86/x86_64/acpi_mmcfg.c             |   2 +-
 xen/arch/x86/x86_64/pci.c                    |   2 +-
 xen/arch/x86/x86_emulate/x86_emulate.h       |   2 +-
 xen/common/device_tree.c                     |   4 +-
 xen/common/efi/boot.c                        |   8 +-
 xen/common/efi/runtime.c                     |   2 +-
 xen/common/gunzip.c                          |   2 +-
 xen/common/xmalloc_tlsf.c                    |   2 +-
 xen/drivers/char/ehci-dbgp.c                 |   4 +-
 xen/drivers/passthrough/amd/iommu-defs.h     | 122 +++++------
 xen/drivers/passthrough/pci.c                |   4 +-
 xen/drivers/video/vesa.c                     |   2 +-
 xen/drivers/vpci/msi.c                       |   2 +-
 xen/drivers/vpci/msix.c                      |   2 +-
 xen/drivers/vpci/vpci.c                      |   6 +-
 xen/include/acpi/cpufreq/processor_perf.h    |   2 +-
 xen/include/public/arch-arm/smccc.h          |   4 +-
 xen/include/public/io/ring.h                 |  10 +-
 xen/include/public/memory.h                  |   2 +-
 xen/include/public/sysctl.h                  |   4 +-
 xen/include/xen/bitops.h                     |  10 +-
 xen/include/xen/cper.h                       |  18 +-
 xen/lib/muldiv64.c                           |   2 +-
 xen/lib/x86/cpuid.c                          |   8 +-
 xen/lib/x86/policy.c                         |   2 +-
 71 files changed, 409 insertions(+), 409 deletions(-)

-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:33:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:33:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562205.878831 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAQ-0007Bn-N9; Wed, 12 Jul 2023 10:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562205.878831; Wed, 12 Jul 2023 10:33:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAQ-00079N-JQ; Wed, 12 Jul 2023 10:33:54 +0000
Received: by outflank-mailman (input) for mailman id 562205;
 Wed, 12 Jul 2023 10:33:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=M0TT=C6=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qJXAP-0006Dd-Mr
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:33:53 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 98cb6af0-209f-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 12:33:53 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.151.90])
 by support.bugseng.com (Postfix) with ESMTPSA id 16E794EE0C8F;
 Wed, 12 Jul 2023 12:33:52 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 98cb6af0-209f-11ee-b239-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Luca Fancellu <luca.fancellu@arm.com>
Subject: [XEN PATCH v3 06/15] xen/efi: fix violations of MISRA C:2012 Rule 7.2
Date: Wed, 12 Jul 2023 12:32:07 +0200
Message-Id: <4e53fc8fc5c3512a521311220375ba8542ae0e5f.1689152719.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689152719.git.gianluca.luparini@bugseng.com>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type.

For the sake of uniformity, the following changes are made:
- add the 'U' suffix to all first macro's arguments in 'boot.c'
- add the 'U' suffix near '0x3fffffff' in 'runtime.c'

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v3:
- change 'Signed-off-by' ordering
- change commit message
- remove excessive suffixes in 'boot.c'

Changes in v2:
- minor change to commit title
- change commit message
- remove changes in 'efibind.h', 'efiapi.h', 'efidef.h' and 'efiprot.h'
---
 xen/common/efi/boot.c    | 8 ++++----
 xen/common/efi/runtime.c | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index c5850c26af..24169b7b50 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -34,13 +34,13 @@
 #define EFI_REVISION(major, minor) (((major) << 16) | (minor))
 
 #define SMBIOS3_TABLE_GUID \
-  { 0xf2fd1544, 0x9794, 0x4a2c, {0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94} }
+  { 0xf2fd1544U, 0x9794, 0x4a2c, {0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94} }
 #define SHIM_LOCK_PROTOCOL_GUID \
-  { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} }
+  { 0x605dab50U, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} }
 #define APPLE_PROPERTIES_PROTOCOL_GUID \
-  { 0x91bd12fe, 0xf6c3, 0x44fb, { 0xa5, 0xb7, 0x51, 0x22, 0xab, 0x30, 0x3a, 0xe0} }
+  { 0x91bd12feU, 0xf6c3, 0x44fb, {0xa5, 0xb7, 0x51, 0x22, 0xab, 0x30, 0x3a, 0xe0} }
 #define EFI_SYSTEM_RESOURCE_TABLE_GUID    \
-  { 0xb122a263, 0x3661, 0x4f68, {0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80} }
+  { 0xb122a263U, 0x3661, 0x4f68, {0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80} }
 #define EFI_SYSTEM_RESOURCE_TABLE_FIRMWARE_RESOURCE_VERSION 1
 
 typedef struct {
diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
index 13b0975866..5cb7504c96 100644
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -698,7 +698,7 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
 #ifndef COMPAT
     op->status = status;
 #else
-    op->status = (status & 0x3fffffff) | ((status >> 32) & 0xc0000000);
+    op->status = (status & 0x3fffffffU) | ((status >> 32) & 0xc0000000U);
 #endif
 
     return rc;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:33:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:33:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562211.878856 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAU-0007zf-Jy; Wed, 12 Jul 2023 10:33:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562211.878856; Wed, 12 Jul 2023 10:33:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAU-0007zI-EF; Wed, 12 Jul 2023 10:33:58 +0000
Received: by outflank-mailman (input) for mailman id 562211;
 Wed, 12 Jul 2023 10:33:56 +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
 <SRS0=M0TT=C6=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qJXAS-00061z-F3
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:33:56 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 99a1a30f-209f-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:33:54 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.151.90])
 by support.bugseng.com (Postfix) with ESMTPSA id 291FE4EE0C92;
 Wed, 12 Jul 2023 12:33:53 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 99a1a30f-209f-11ee-8611-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v3 07/15] x86/vmx: fix violations of MISRA C:2012 Rule 7.2
Date: Wed, 12 Jul 2023 12:32:08 +0200
Message-Id: <c4953517b9675b2099841be704f0c67989e76342.1689152719.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689152719.git.gianluca.luparini@bugseng.com>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type.

For the sake of uniformity, the following changes are made:
- add the 'U' suffix to macros near
  'CPU_BASED_ACTIVATE_SECONDARY_CONTROLS' and
  'SECONDARY_EXEC_NOTIFY_VM_EXITING' macros in 'vmcs.h'
- add the 'U' suffix to macros near 'INTR_INFO_VALID_MASK'
  macro in 'vmx.h'

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v3:
- change 'Signed-off-by' ordering
- change commit message
- remove unnecessary changes in 'vvmx.c'
- add 'uint32_t' casts in 'vvmx.c'
- add missing 'U' in 'vmcs.h' macros
- change macro to '(1u << 31)' in 'vmx.h'
- remove unnecessary changes to 'vmx.h'

Changes in v2:
- minor change to commit title
- change commit message
- remove unnecessary changes in 'vpmu_intel.c' and 'vmx.h'
- add 'ULL' suffix in 'vpmu_intel.c'
- add zero-padding to constants in 'vmx.h'
- add missing 'U' in 'vmx.h'
---
 xen/arch/x86/cpu/vpmu_intel.c           |  2 +-
 xen/arch/x86/hvm/vmx/vmcs.c             |  6 +-
 xen/arch/x86/hvm/vmx/vvmx.c             |  8 +--
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h | 84 ++++++++++++-------------
 xen/arch/x86/include/asm/hvm/vmx/vmx.h  | 16 ++---
 5 files changed, 58 insertions(+), 58 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index fa5b40c65c..6330c89b47 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -945,7 +945,7 @@ const struct arch_vpmu_ops *__init core2_vpmu_init(void)
     fixed_counters_mask = ~((1ull << core2_get_bitwidth_fix_count()) - 1);
     global_ctrl_mask = ~((((1ULL << fixed_pmc_cnt) - 1) << 32) |
                          ((1ULL << arch_pmc_cnt) - 1));
-    global_ovf_ctrl_mask = ~(0xC000000000000000 |
+    global_ovf_ctrl_mask = ~(0xC000000000000000ULL |
                              (((1ULL << fixed_pmc_cnt) - 1) << 32) |
                              ((1ULL << arch_pmc_cnt) - 1));
     if ( version > 2 )
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index b209563625..d5a2b847a9 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -911,7 +911,7 @@ void vmx_clear_msr_intercept(struct vcpu *v, unsigned int msr,
         if ( type & VMX_MSR_W )
             clear_bit(msr, msr_bitmap->write_low);
     }
-    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
+    else if ( (msr >= 0xc0000000U) && (msr <= 0xc0001fffU) )
     {
         msr &= 0x1fff;
         if ( type & VMX_MSR_R )
@@ -939,7 +939,7 @@ void vmx_set_msr_intercept(struct vcpu *v, unsigned int msr,
         if ( type & VMX_MSR_W )
             set_bit(msr, msr_bitmap->write_low);
     }
-    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
+    else if ( (msr >= 0xc0000000U) && (msr <= 0xc0001fffU) )
     {
         msr &= 0x1fff;
         if ( type & VMX_MSR_R )
@@ -957,7 +957,7 @@ bool vmx_msr_is_intercepted(struct vmx_msr_bitmap *msr_bitmap,
     if ( msr <= 0x1fff )
         return test_bit(msr, is_write ? msr_bitmap->write_low
                                       : msr_bitmap->read_low);
-    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
+    else if ( (msr >= 0xc0000000U) && (msr <= 0xc0001fffU) )
         return test_bit(msr & 0x1fff, is_write ? msr_bitmap->write_high
                                                : msr_bitmap->read_high);
     else
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 16b0ef82b6..b7be424afb 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -263,7 +263,7 @@ uint64_t get_vvmcs_virtual(void *vvmcs, uint32_t vmcs_encoding)
             res >>= 32;
         break;
     case VVMCS_WIDTH_32:
-        res &= 0xffffffff;
+        res = (uint32_t)res;
         break;
     case VVMCS_WIDTH_NATURAL:
     default:
@@ -315,14 +315,14 @@ void set_vvmcs_virtual(void *vvmcs, uint32_t vmcs_encoding, uint64_t val)
     case VVMCS_WIDTH_64:
         if ( enc.access_type )
         {
-            res &= 0xffffffff;
+            res = (uint32_t)res;
             res |= val << 32;
         }
         else
             res = val;
         break;
     case VVMCS_WIDTH_32:
-        res = val & 0xffffffff;
+        res = (uint32_t)val;
         break;
     case VVMCS_WIDTH_NATURAL:
     default:
@@ -2306,7 +2306,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         break;
     case MSR_IA32_VMX_CR0_FIXED1:
         /* allow 0-settings for all bits */
-        data = 0xffffffff;
+        data = 0xffffffffU;
         break;
     case MSR_IA32_VMX_CR4_FIXED0:
         /* VMXE bit must be 1 in VMX operation */
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
index d07fcb2bc9..e056643993 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
@@ -187,27 +187,27 @@ bool_t __must_check vmx_vmcs_try_enter(struct vcpu *v);
 void vmx_vmcs_exit(struct vcpu *v);
 void vmx_vmcs_reload(struct vcpu *v);
 
-#define CPU_BASED_VIRTUAL_INTR_PENDING        0x00000004
-#define CPU_BASED_USE_TSC_OFFSETING           0x00000008
-#define CPU_BASED_HLT_EXITING                 0x00000080
-#define CPU_BASED_INVLPG_EXITING              0x00000200
-#define CPU_BASED_MWAIT_EXITING               0x00000400
-#define CPU_BASED_RDPMC_EXITING               0x00000800
-#define CPU_BASED_RDTSC_EXITING               0x00001000
-#define CPU_BASED_CR3_LOAD_EXITING            0x00008000
-#define CPU_BASED_CR3_STORE_EXITING           0x00010000
-#define CPU_BASED_CR8_LOAD_EXITING            0x00080000
-#define CPU_BASED_CR8_STORE_EXITING           0x00100000
-#define CPU_BASED_TPR_SHADOW                  0x00200000
-#define CPU_BASED_VIRTUAL_NMI_PENDING         0x00400000
-#define CPU_BASED_MOV_DR_EXITING              0x00800000
-#define CPU_BASED_UNCOND_IO_EXITING           0x01000000
-#define CPU_BASED_ACTIVATE_IO_BITMAP          0x02000000
-#define CPU_BASED_MONITOR_TRAP_FLAG           0x08000000
-#define CPU_BASED_ACTIVATE_MSR_BITMAP         0x10000000
-#define CPU_BASED_MONITOR_EXITING             0x20000000
-#define CPU_BASED_PAUSE_EXITING               0x40000000
-#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000
+#define CPU_BASED_VIRTUAL_INTR_PENDING        0x00000004U
+#define CPU_BASED_USE_TSC_OFFSETING           0x00000008U
+#define CPU_BASED_HLT_EXITING                 0x00000080U
+#define CPU_BASED_INVLPG_EXITING              0x00000200U
+#define CPU_BASED_MWAIT_EXITING               0x00000400U
+#define CPU_BASED_RDPMC_EXITING               0x00000800U
+#define CPU_BASED_RDTSC_EXITING               0x00001000U
+#define CPU_BASED_CR3_LOAD_EXITING            0x00008000U
+#define CPU_BASED_CR3_STORE_EXITING           0x00010000U
+#define CPU_BASED_CR8_LOAD_EXITING            0x00080000U
+#define CPU_BASED_CR8_STORE_EXITING           0x00100000U
+#define CPU_BASED_TPR_SHADOW                  0x00200000U
+#define CPU_BASED_VIRTUAL_NMI_PENDING         0x00400000U
+#define CPU_BASED_MOV_DR_EXITING              0x00800000U
+#define CPU_BASED_UNCOND_IO_EXITING           0x01000000U
+#define CPU_BASED_ACTIVATE_IO_BITMAP          0x02000000U
+#define CPU_BASED_MONITOR_TRAP_FLAG           0x08000000U
+#define CPU_BASED_ACTIVATE_MSR_BITMAP         0x10000000U
+#define CPU_BASED_MONITOR_EXITING             0x20000000U
+#define CPU_BASED_PAUSE_EXITING               0x40000000U
+#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000U
 extern u32 vmx_cpu_based_exec_control;
 
 #define PIN_BASED_EXT_INTR_MASK         0x00000001
@@ -238,26 +238,26 @@ extern u32 vmx_vmexit_control;
 #define VM_ENTRY_LOAD_BNDCFGS           0x00010000
 extern u32 vmx_vmentry_control;
 
-#define SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES 0x00000001
-#define SECONDARY_EXEC_ENABLE_EPT               0x00000002
-#define SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING 0x00000004
-#define SECONDARY_EXEC_ENABLE_RDTSCP            0x00000008
-#define SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE   0x00000010
-#define SECONDARY_EXEC_ENABLE_VPID              0x00000020
-#define SECONDARY_EXEC_WBINVD_EXITING           0x00000040
-#define SECONDARY_EXEC_UNRESTRICTED_GUEST       0x00000080
-#define SECONDARY_EXEC_APIC_REGISTER_VIRT       0x00000100
-#define SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY    0x00000200
-#define SECONDARY_EXEC_PAUSE_LOOP_EXITING       0x00000400
-#define SECONDARY_EXEC_ENABLE_INVPCID           0x00001000
-#define SECONDARY_EXEC_ENABLE_VM_FUNCTIONS      0x00002000
-#define SECONDARY_EXEC_ENABLE_VMCS_SHADOWING    0x00004000
-#define SECONDARY_EXEC_ENABLE_PML               0x00020000
-#define SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS   0x00040000
-#define SECONDARY_EXEC_XSAVES                   0x00100000
-#define SECONDARY_EXEC_TSC_SCALING              0x02000000
-#define SECONDARY_EXEC_BUS_LOCK_DETECTION       0x40000000
-#define SECONDARY_EXEC_NOTIFY_VM_EXITING        0x80000000
+#define SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES 0x00000001U
+#define SECONDARY_EXEC_ENABLE_EPT               0x00000002U
+#define SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING 0x00000004U
+#define SECONDARY_EXEC_ENABLE_RDTSCP            0x00000008U
+#define SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE   0x00000010U
+#define SECONDARY_EXEC_ENABLE_VPID              0x00000020U
+#define SECONDARY_EXEC_WBINVD_EXITING           0x00000040U
+#define SECONDARY_EXEC_UNRESTRICTED_GUEST       0x00000080U
+#define SECONDARY_EXEC_APIC_REGISTER_VIRT       0x00000100U
+#define SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY    0x00000200U
+#define SECONDARY_EXEC_PAUSE_LOOP_EXITING       0x00000400U
+#define SECONDARY_EXEC_ENABLE_INVPCID           0x00001000U
+#define SECONDARY_EXEC_ENABLE_VM_FUNCTIONS      0x00002000U
+#define SECONDARY_EXEC_ENABLE_VMCS_SHADOWING    0x00004000U
+#define SECONDARY_EXEC_ENABLE_PML               0x00020000U
+#define SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS   0x00040000U
+#define SECONDARY_EXEC_XSAVES                   0x00100000U
+#define SECONDARY_EXEC_TSC_SCALING              0x02000000U
+#define SECONDARY_EXEC_BUS_LOCK_DETECTION       0x40000000U
+#define SECONDARY_EXEC_NOTIFY_VM_EXITING        0x80000000U
 extern u32 vmx_secondary_exec_control;
 
 #define VMX_EPT_EXEC_ONLY_SUPPORTED                         0x00000001
@@ -346,7 +346,7 @@ extern u64 vmx_ept_vpid_cap;
 #define cpu_has_vmx_notify_vm_exiting \
     (vmx_secondary_exec_control & SECONDARY_EXEC_NOTIFY_VM_EXITING)
 
-#define VMCS_RID_TYPE_MASK              0x80000000
+#define VMCS_RID_TYPE_MASK              0x80000000U
 
 /* GUEST_INTERRUPTIBILITY_INFO flags. */
 #define VMX_INTR_SHADOW_STI             0x00000001
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
index c84acc221d..d4b335a2bc 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
@@ -137,7 +137,7 @@ static inline void pi_clear_sn(struct pi_desc *pi_desc)
 /*
  * Exit Reasons
  */
-#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000
+#define VMX_EXIT_REASONS_FAILED_VMENTRY (1u << 31)
 #define VMX_EXIT_REASONS_BUS_LOCK       (1u << 26)
 
 #define EXIT_REASON_EXCEPTION_NMI       0
@@ -209,12 +209,12 @@ static inline void pi_clear_sn(struct pi_desc *pi_desc)
  * Note INTR_INFO_NMI_UNBLOCKED_BY_IRET is also used with Exit Qualification
  * field for EPT violations, PML full and SPP-related event vmexits.
  */
-#define INTR_INFO_VECTOR_MASK           0xff            /* 7:0 */
-#define INTR_INFO_INTR_TYPE_MASK        0x700           /* 10:8 */
-#define INTR_INFO_DELIVER_CODE_MASK     0x800           /* 11 */
-#define INTR_INFO_NMI_UNBLOCKED_BY_IRET 0x1000          /* 12 */
-#define INTR_INFO_VALID_MASK            0x80000000      /* 31 */
-#define INTR_INFO_RESVD_BITS_MASK       0x7ffff000
+#define INTR_INFO_VECTOR_MASK           0x000000ffU     /* 7:0 */
+#define INTR_INFO_INTR_TYPE_MASK        0x00000700U     /* 10:8 */
+#define INTR_INFO_DELIVER_CODE_MASK     0x00000800U     /* 11 */
+#define INTR_INFO_NMI_UNBLOCKED_BY_IRET 0x00001000U     /* 12 */
+#define INTR_INFO_VALID_MASK            0x80000000U     /* 31 */
+#define INTR_INFO_RESVD_BITS_MASK       0x7ffff000U
 
 /*
  * Exit Qualifications for NOTIFY VM EXIT
@@ -607,7 +607,7 @@ static inline void vmx_pi_hooks_assign(struct domain *d) {}
 static inline void vmx_pi_hooks_deassign(struct domain *d) {}
 #endif
 
-#define APIC_INVALID_DEST           0xffffffff
+#define APIC_INVALID_DEST           0xffffffffU
 
 /* EPT violation qualifications definitions */
 typedef union ept_qual {
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:33:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:33:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562204.878826 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAQ-00073z-3a; Wed, 12 Jul 2023 10:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562204.878826; Wed, 12 Jul 2023 10:33:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAQ-00073f-0M; Wed, 12 Jul 2023 10:33:54 +0000
Received: by outflank-mailman (input) for mailman id 562204;
 Wed, 12 Jul 2023 10:33:53 +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
 <SRS0=M0TT=C6=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qJXAP-00061z-0s
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:33:53 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 97858c44-209f-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:33:51 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.151.90])
 by support.bugseng.com (Postfix) with ESMTPSA id C76694EE0C8B;
 Wed, 12 Jul 2023 12:33:49 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 97858c44-209f-11ee-8611-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v3 04/15] xen/arm: fix violations of MISRA C:2012 Rule 7.2
Date: Wed, 12 Jul 2023 12:32:05 +0200
Message-Id: <0e899828681c4c408ce223dcd03444a4c9039eab.1689152719.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689152719.git.gianluca.luparini@bugseng.com>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
---
Changes in v3:
- change 'Signed-off-by' ordering
- add 'ULL' instead of 'U' in 'efibind.h' and 'vgic-v3.c'
- remove excessive suffixes in 'efi-boot.h' and 'smccc.h'

Changes in v2:
- minor change to commit title
- change commit message
- fix in 'domain_build.c' file for consistency
- fix typo in 'gic-v2.c' file
- fix in 'insn.h' file for consistency
- add fixes in 'gic-v3.c', 'traps.c' and 'vgic-v3.c'
---
 xen/arch/arm/domain_build.c              |  4 ++--
 xen/arch/arm/efi/efi-boot.h              |  2 +-
 xen/arch/arm/gic-v2.c                    |  6 +++---
 xen/arch/arm/gic-v3.c                    | 10 +++++-----
 xen/arch/arm/include/asm/arm64/brk.h     |  2 +-
 xen/arch/arm/include/asm/arm64/efibind.h | 10 +++++-----
 xen/arch/arm/include/asm/arm64/insn.h    | 16 ++++++++--------
 xen/arch/arm/include/asm/vreg.h          |  2 +-
 xen/arch/arm/kernel.c                    |  2 +-
 xen/arch/arm/traps.c                     | 14 +++++++-------
 xen/arch/arm/vgic-v2.c                   |  2 +-
 xen/arch/arm/vgic-v3.c                   |  2 +-
 xen/include/public/arch-arm/smccc.h      |  4 ++--
 13 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index d0d6be922d..d58604ef4a 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -3751,8 +3751,8 @@ static int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
          * r1 = machine nr, r2 = atags or dtb pointer.
          *...
          */
-        regs->r0 = 0; /* SBZ */
-        regs->r1 = 0xffffffff; /* We use DTB therefore no machine id */
+        regs->r0 = 0U; /* SBZ */
+        regs->r1 = 0xffffffffU; /* We use DTB therefore no machine id */
         regs->r2 = kinfo->dtb_paddr;
     }
 #ifdef CONFIG_ARM_64
diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index bb64925d70..3daa63a40d 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -46,7 +46,7 @@ static int get_module_file_index(const char *name, unsigned int name_len);
 static void PrintMessage(const CHAR16 *s);
 
 #define DEVICE_TREE_GUID \
-{0xb1b621d5, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0}}
+{0xb1b621d5U, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0}}
 
 static struct file __initdata dtbfile;
 static void __initdata *fdt;
diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 6476ff4230..cf392bfd1c 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -386,9 +386,9 @@ static void gicv2_cpu_init(void)
     /* The first 32 interrupts (PPI and SGI) are banked per-cpu, so
      * even though they are controlled with GICD registers, they must
      * be set up here with the other per-cpu state. */
-    writel_gicd(0xffffffff, GICD_ICACTIVER); /* Diactivate PPIs and SGIs */
-    writel_gicd(0xffff0000, GICD_ICENABLER); /* Disable all PPI */
-    writel_gicd(0x0000ffff, GICD_ISENABLER); /* Enable all SGI */
+    writel_gicd(0xffffffffU, GICD_ICACTIVER); /* De-activate PPIs and SGIs */
+    writel_gicd(0xffff0000U, GICD_ICENABLER); /* Disable all PPI */
+    writel_gicd(0x0000ffffU, GICD_ISENABLER); /* Enable all SGI */
 
     /* Set SGI priorities */
     for ( i = 0; i < 16; i += 4 )
diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 4e6c98bada..95e4f020fe 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -619,8 +619,8 @@ static void __init gicv3_dist_init(void)
     /* Disable/deactivate all global interrupts */
     for ( i = NR_GIC_LOCAL_IRQS; i < nr_lines; i += 32 )
     {
-        writel_relaxed(0xffffffff, GICD + GICD_ICENABLER + (i / 32) * 4);
-        writel_relaxed(0xffffffff, GICD + GICD_ICACTIVER + (i / 32) * 4);
+        writel_relaxed(0xffffffffU, GICD + GICD_ICENABLER + (i / 32) * 4);
+        writel_relaxed(0xffffffffU, GICD + GICD_ICACTIVER + (i / 32) * 4);
     }
 
     /*
@@ -832,13 +832,13 @@ static int gicv3_cpu_init(void)
      * The activate state is unknown at boot, so make sure all
      * SGIs and PPIs are de-activated.
      */
-    writel_relaxed(0xffffffff, GICD_RDIST_SGI_BASE + GICR_ICACTIVER0);
+    writel_relaxed(0xffffffffU, GICD_RDIST_SGI_BASE + GICR_ICACTIVER0);
     /*
      * Disable all PPI interrupts, ensure all SGI interrupts are
      * enabled.
      */
-    writel_relaxed(0xffff0000, GICD_RDIST_SGI_BASE + GICR_ICENABLER0);
-    writel_relaxed(0x0000ffff, GICD_RDIST_SGI_BASE + GICR_ISENABLER0);
+    writel_relaxed(0xffff0000U, GICD_RDIST_SGI_BASE + GICR_ICENABLER0);
+    writel_relaxed(0x0000ffffU, GICD_RDIST_SGI_BASE + GICR_ISENABLER0);
     /* Configure SGIs/PPIs as non-secure Group-1 */
     writel_relaxed(GENMASK(31, 0), GICD_RDIST_SGI_BASE + GICR_IGROUPR0);
 
diff --git a/xen/arch/arm/include/asm/arm64/brk.h b/xen/arch/arm/include/asm/arm64/brk.h
index 04442c4b9f..3af153a053 100644
--- a/xen/arch/arm/include/asm/arm64/brk.h
+++ b/xen/arch/arm/include/asm/arm64/brk.h
@@ -21,7 +21,7 @@
  * BRK instruction encoding
  * The #imm16 value should be placed at bits[20:5] within BRK ins
  */
-#define AARCH64_BREAK_MON 0xd4200000
+#define AARCH64_BREAK_MON 0xd4200000U
 
 /*
  * BRK instruction for provoking a fault on purpose
diff --git a/xen/arch/arm/include/asm/arm64/efibind.h b/xen/arch/arm/include/asm/arm64/efibind.h
index 8b43bb8495..f13eadd4f0 100644
--- a/xen/arch/arm/include/asm/arm64/efibind.h
+++ b/xen/arch/arm/include/asm/arm64/efibind.h
@@ -22,12 +22,12 @@ Revision History
 #pragma pack()
 #endif
 
-#define EFIERR(a)           (0x8000000000000000 | a)
-#define EFI_ERROR_MASK      0x8000000000000000
-#define EFIERR_OEM(a)       (0xc000000000000000 | a)
+#define EFIERR(a)           (0x8000000000000000ULL | a)
+#define EFI_ERROR_MASK      0x8000000000000000ULL
+#define EFIERR_OEM(a)       (0xc000000000000000ULL | a)
 
-#define BAD_POINTER         0xFBFBFBFBFBFBFBFB
-#define MAX_ADDRESS         0xFFFFFFFFFFFFFFFF
+#define BAD_POINTER         0xFBFBFBFBFBFBFBFBULL
+#define MAX_ADDRESS         0xFFFFFFFFFFFFFFFFULL
 
 #define EFI_STUB_ERROR      MAX_ADDRESS
 
diff --git a/xen/arch/arm/include/asm/arm64/insn.h b/xen/arch/arm/include/asm/arm64/insn.h
index 4e0d364d41..6308959449 100644
--- a/xen/arch/arm/include/asm/arm64/insn.h
+++ b/xen/arch/arm/include/asm/arm64/insn.h
@@ -60,14 +60,14 @@ static always_inline bool aarch64_insn_is_##abbr(u32 code) \
 static always_inline u32 aarch64_insn_get_##abbr##_value(void) \
 { return (val); }
 
-__AARCH64_INSN_FUNCS(b,		0xFC000000, 0x14000000)
-__AARCH64_INSN_FUNCS(bl,	0xFC000000, 0x94000000)
-__AARCH64_INSN_FUNCS(cbz,	0x7F000000, 0x34000000)
-__AARCH64_INSN_FUNCS(cbnz,	0x7F000000, 0x35000000)
-__AARCH64_INSN_FUNCS(tbz,	0x7F000000, 0x36000000)
-__AARCH64_INSN_FUNCS(tbnz,	0x7F000000, 0x37000000)
-__AARCH64_INSN_FUNCS(bcond,	0xFF000010, 0x54000000)
-__AARCH64_INSN_FUNCS(hint,	0xFFFFF01F, 0xD503201F)
+__AARCH64_INSN_FUNCS(b,		0xFC000000U, 0x14000000U)
+__AARCH64_INSN_FUNCS(bl,	0xFC000000U, 0x94000000U)
+__AARCH64_INSN_FUNCS(cbz,	0x7F000000U, 0x34000000U)
+__AARCH64_INSN_FUNCS(cbnz,	0x7F000000U, 0x35000000U)
+__AARCH64_INSN_FUNCS(tbz,	0x7F000000U, 0x36000000U)
+__AARCH64_INSN_FUNCS(tbnz,	0x7F000000U, 0x37000000U)
+__AARCH64_INSN_FUNCS(bcond,	0xFF000010U, 0x54000000U)
+__AARCH64_INSN_FUNCS(hint,	0xFFFFF01FU, 0xD503201FU)
 
 bool aarch64_insn_is_branch_imm(u32 insn);
 
diff --git a/xen/arch/arm/include/asm/vreg.h b/xen/arch/arm/include/asm/vreg.h
index bf945eebbd..387ce76e7e 100644
--- a/xen/arch/arm/include/asm/vreg.h
+++ b/xen/arch/arm/include/asm/vreg.h
@@ -56,7 +56,7 @@ static inline bool vreg_emulate_cp64(struct cpu_user_regs *regs, union hsr hsr,
 
     if ( ret && cp64.read )
     {
-        set_user_reg(regs, cp64.reg1, x & 0xffffffff);
+        set_user_reg(regs, cp64.reg1, x & 0xffffffffU);
         set_user_reg(regs, cp64.reg2, x >> 32);
     }
 
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index ca5318515e..508c54824d 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -39,7 +39,7 @@ struct minimal_dtb_header {
     /* There are other fields but we don't use them yet. */
 };
 
-#define DTB_MAGIC 0xd00dfeed
+#define DTB_MAGIC 0xd00dfeedU
 
 /**
  * copy_from_paddr - copy data from a physical address
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index ef5c6a8195..d1ef787638 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -398,7 +398,7 @@ static vaddr_t exception_handler32(vaddr_t offset)
     register_t sctlr = READ_SYSREG(SCTLR_EL1);
 
     if ( sctlr & SCTLR_A32_EL1_V )
-        return 0xffff0000 + offset;
+        return 0xffff0000U + offset;
     else /* always have security exceptions */
         return READ_SYSREG(VBAR_EL1) + offset;
 }
@@ -809,7 +809,7 @@ static void show_registers_32(const struct cpu_user_regs *regs,
 #ifdef CONFIG_ARM_64
                (uint32_t)(ctxt->far >> 32),
                ctxt->ifsr32_el2,
-               (uint32_t)(ctxt->far & 0xffffffff),
+               (uint32_t)(ctxt->far & 0xffffffffU),
                ctxt->esr_el1
 #else
                ctxt->ifar, ctxt->ifsr, ctxt->dfar, ctxt->dfsr
@@ -1414,16 +1414,16 @@ static void do_trap_hypercall(struct cpu_user_regs *regs, register_t *nr,
     {
         /* Deliberately corrupt parameter regs used by this hypercall. */
         switch ( hypercall_args[*nr] ) {
-        case 5: HYPERCALL_ARG5(regs) = 0xDEADBEEF;
-        case 4: HYPERCALL_ARG4(regs) = 0xDEADBEEF;
-        case 3: HYPERCALL_ARG3(regs) = 0xDEADBEEF;
-        case 2: HYPERCALL_ARG2(regs) = 0xDEADBEEF;
+        case 5: HYPERCALL_ARG5(regs) = 0xDEADBEEFU;
+        case 4: HYPERCALL_ARG4(regs) = 0xDEADBEEFU;
+        case 3: HYPERCALL_ARG3(regs) = 0xDEADBEEFU;
+        case 2: HYPERCALL_ARG2(regs) = 0xDEADBEEFU;
         case 1: /* Don't clobber x0/r0 -- it's the return value */
         case 0: /* -ENOSYS case */
             break;
         default: BUG();
         }
-        *nr = 0xDEADBEEF;
+        *nr = 0xDEADBEEFU;
     }
 #endif
 
diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 0b083c33e6..35363fee09 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -306,7 +306,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case VREG32(GICD_SGIR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* Write only -- read unknown */
-        *r = 0xdeadbeef;
+        *r = 0xdeadbeefU;
         return 1;
 
     case VRANGE32(0xF04, 0xF0C):
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 9c1fdcc3f8..1b7173da1e 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -354,7 +354,7 @@ read_reserved:
     return 1;
 
 read_unknown:
-    *r = vreg_reg64_extract(0xdeadbeafdeadbeaf, info);
+    *r = vreg_reg64_extract(0xdeadbeafdeadbeafULL, info);
     return 1;
 }
 
diff --git a/xen/include/public/arch-arm/smccc.h b/xen/include/public/arch-arm/smccc.h
index 802d800aad..8a9321ebed 100644
--- a/xen/include/public/arch-arm/smccc.h
+++ b/xen/include/public/arch-arm/smccc.h
@@ -26,7 +26,7 @@
 #define XEN_SMCCC_MINOR_REVISION 1
 
 /* Hypervisor Service UID. Randomly generated with uuidgen. */
-#define XEN_SMCCC_UID XEN_DEFINE_UUID(0xa71812dc, 0xc698, 0x4369, 0x9acf, \
+#define XEN_SMCCC_UID XEN_DEFINE_UUID(0xa71812dcU, 0xc698, 0x4369, 0x9acf, \
                                       0x79, 0xd1, 0x8d, 0xde, 0xe6, 0x67)
 
 /* Standard Service Service Call version. */
@@ -34,7 +34,7 @@
 #define SSSC_SMCCC_MINOR_REVISION 1
 
 /* Standard Service Call UID. Randomly generated with uuidgen. */
-#define SSSC_SMCCC_UID XEN_DEFINE_UUID(0xf863386f, 0x4b39, 0x4cbd, 0x9220,\
+#define SSSC_SMCCC_UID XEN_DEFINE_UUID(0xf863386fU, 0x4b39, 0x4cbd, 0x9220,\
                                        0xce, 0x16, 0x41, 0xe5, 0x9f, 0x6f)
 
 #endif /* __XEN_PUBLIC_ARCH_ARM_SMCCC_H__ */
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:33:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:33:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562212.878861 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAV-00084M-B2; Wed, 12 Jul 2023 10:33:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562212.878861; Wed, 12 Jul 2023 10:33:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAU-000837-Rb; Wed, 12 Jul 2023 10:33:58 +0000
Received: by outflank-mailman (input) for mailman id 562212;
 Wed, 12 Jul 2023 10:33:56 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=M0TT=C6=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qJXAS-0006Dd-NG
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:33:56 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9a50ef10-209f-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 12:33:55 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.151.90])
 by support.bugseng.com (Postfix) with ESMTPSA id 7E3AD4EE0C88;
 Wed, 12 Jul 2023 12:33:54 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9a50ef10-209f-11ee-b239-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Paul Durrant <paul@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v3 08/15] xen/pci: fix violations of MISRA C:2012 Rule 7.2
Date: Wed, 12 Jul 2023 12:32:09 +0200
Message-Id: <b1bb12e7a6fb73f691d76728688e85437c701c1d.1689152719.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689152719.git.gianluca.luparini@bugseng.com>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v3:
- change 'Signed-off-by' ordering

Changes in v2:
- minor change to commit title
- change commit message
---
 xen/drivers/passthrough/pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 07d1986d33..95846e84f2 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -990,8 +990,8 @@ bool_t __init pci_device_detect(u16 seg, u8 bus, u8 dev, u8 func)
 
     vendor = pci_conf_read32(PCI_SBDF(seg, bus, dev, func), PCI_VENDOR_ID);
     /* some broken boards return 0 or ~0 if a slot is empty: */
-    if ( (vendor == 0xffffffff) || (vendor == 0x00000000) ||
-         (vendor == 0x0000ffff) || (vendor == 0xffff0000) )
+    if ( (vendor == 0xffffffffU) || (vendor == 0x00000000U) ||
+         (vendor == 0x0000ffffU) || (vendor == 0xffff0000U) )
         return 0;
     return 1;
 }
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:34:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:34:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562213.878867 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAV-0008Cq-VW; Wed, 12 Jul 2023 10:33:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562213.878867; Wed, 12 Jul 2023 10:33:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAV-00087p-G8; Wed, 12 Jul 2023 10:33:59 +0000
Received: by outflank-mailman (input) for mailman id 562213;
 Wed, 12 Jul 2023 10:33:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=M0TT=C6=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qJXAT-0006Dd-NS
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:33:57 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9af0ad29-209f-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 12:33:56 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.151.90])
 by support.bugseng.com (Postfix) with ESMTPSA id AF8ED4EE0C8B;
 Wed, 12 Jul 2023 12:33:55 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9af0ad29-209f-11ee-b239-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v3 09/15] xen/public: fix violations of MISRA C:2012 Rule 7.2
Date: Wed, 12 Jul 2023 12:32:10 +0200
Message-Id: <bb386366e1754b08392915736413ee93bd2356f6.1689152719.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689152719.git.gianluca.luparini@bugseng.com>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type.

For the sake of uniformity, the following changes are made:
- add the 'U' suffix to integer constants before the '?' operator

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v3:
- change 'Signed-off-by' ordering
- change commit message

Changes in v2:
- minor change to commit title
- change commit message
- correct macros code style
---
 xen/include/public/io/ring.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/include/public/io/ring.h b/xen/include/public/io/ring.h
index 025939278b..0cae4367be 100644
--- a/xen/include/public/io/ring.h
+++ b/xen/include/public/io/ring.h
@@ -36,11 +36,11 @@
 typedef unsigned int RING_IDX;
 
 /* Round a 32-bit unsigned constant down to the nearest power of two. */
-#define __RD2(_x)  (((_x) & 0x00000002) ? 0x2                  : ((_x) & 0x1))
-#define __RD4(_x)  (((_x) & 0x0000000c) ? __RD2((_x)>>2)<<2    : __RD2(_x))
-#define __RD8(_x)  (((_x) & 0x000000f0) ? __RD4((_x)>>4)<<4    : __RD4(_x))
-#define __RD16(_x) (((_x) & 0x0000ff00) ? __RD8((_x)>>8)<<8    : __RD8(_x))
-#define __RD32(_x) (((_x) & 0xffff0000) ? __RD16((_x)>>16)<<16 : __RD16(_x))
+#define __RD2(x)  (((x) & 0x00000002U) ? 0x2                     : ((x) & 0x1))
+#define __RD4(x)  (((x) & 0x0000000cU) ? __RD2((x) >> 2) << 2    : __RD2(x))
+#define __RD8(x)  (((x) & 0x000000f0U) ? __RD4((x) >> 4) << 4    : __RD4(x))
+#define __RD16(x) (((x) & 0x0000ff00U) ? __RD8((x) >> 8) << 8    : __RD8(x))
+#define __RD32(x) (((x) & 0xffff0000U) ? __RD16((x) >> 16) << 16 : __RD16(x))
 
 /*
  * Calculate size of a shared ring, given the total available space for the
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:34:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:34:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562218.878881 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAX-0000Gd-Ru; Wed, 12 Jul 2023 10:34:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562218.878881; Wed, 12 Jul 2023 10:34:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXAX-0000Er-In; Wed, 12 Jul 2023 10:34:01 +0000
Received: by outflank-mailman (input) for mailman id 562218;
 Wed, 12 Jul 2023 10:34:00 +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
 <SRS0=M0TT=C6=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qJXAV-00061z-Rk
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:33:59 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9bdd7fe3-209f-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:33:58 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.151.90])
 by support.bugseng.com (Postfix) with ESMTPSA id C1E9A4EE0C87;
 Wed, 12 Jul 2023 12:33:56 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9bdd7fe3-209f-11ee-8611-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Tamas K Lengyel <tamas@tklengyel.com>,
	Alexandru Isaila <aisaila@bitdefender.com>,
	Petre Pircalabu <ppircalabu@bitdefender.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v3 10/15] x86/monitor: fix violations of MISRA C:2012 Rule 7.2
Date: Wed, 12 Jul 2023 12:32:11 +0200
Message-Id: <13ba23be1b7aba72bbae2cdec781eba9d7d4abd3.1689152719.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689152719.git.gianluca.luparini@bugseng.com>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v3:
- change 'Signed-off-by' ordering

Changes in v2:
- change commit title to make it unique
- change commit message
---
 xen/arch/x86/monitor.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/monitor.c b/xen/arch/x86/monitor.c
index d4857faf8a..dc336c239a 100644
--- a/xen/arch/x86/monitor.c
+++ b/xen/arch/x86/monitor.c
@@ -48,17 +48,17 @@ static unsigned long *monitor_bitmap_for_msr(const struct domain *d, u32 *msr)
 
     switch ( *msr )
     {
-    case 0 ... 0x1fff:
+    case 0 ... 0x1fffU:
         BUILD_BUG_ON(sizeof(d->arch.monitor.msr_bitmap->low) * 8 <= 0x1fff);
         return d->arch.monitor.msr_bitmap->low;
 
-    case 0x40000000 ... 0x40001fff:
+    case 0x40000000U ... 0x40001fffU:
         BUILD_BUG_ON(
             sizeof(d->arch.monitor.msr_bitmap->hypervisor) * 8 <= 0x1fff);
         *msr &= 0x1fff;
         return d->arch.monitor.msr_bitmap->hypervisor;
 
-    case 0xc0000000 ... 0xc0001fff:
+    case 0xc0000000U ... 0xc0001fffU:
         BUILD_BUG_ON(sizeof(d->arch.monitor.msr_bitmap->high) * 8 <= 0x1fff);
         *msr &= 0x1fff;
         return d->arch.monitor.msr_bitmap->high;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:37:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:37:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562261.878919 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXDo-0004Mh-Dy; Wed, 12 Jul 2023 10:37:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562261.878919; Wed, 12 Jul 2023 10:37:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXDo-0004L0-5V; Wed, 12 Jul 2023 10:37:24 +0000
Received: by outflank-mailman (input) for mailman id 562261;
 Wed, 12 Jul 2023 10:37:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=M0TT=C6=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qJXAY-0006Dd-Oc
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:34:02 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9d4106b1-209f-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 12:34:00 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.151.90])
 by support.bugseng.com (Postfix) with ESMTPSA id 413254EE0C89;
 Wed, 12 Jul 2023 12:33:59 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9d4106b1-209f-11ee-b239-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v3 12/15] xen/x86: fix violations of MISRA C:2012 Rule 7.2
Date: Wed, 12 Jul 2023 12:32:13 +0200
Message-Id: <78717a3ccee0517eab915156fc474394ae1dcf81.1689152719.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689152719.git.gianluca.luparini@bugseng.com>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type.

For the sake of uniformity, the following changes are made:
- add the 'U' suffix to all first macro's arguments in 'mce-apei.c'
- add the 'U' suffix to switch cases in 'cpuid.c'
- add 'U' suffixes to 'mask16' in 'stdvga.c'
- add the 'U' suffix to macros in 'pci.h'

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
---
Changes in v3:
- change 'Signed-off-by' ordering
- change commit message
- add 'UL' in 'extable.c'
- fix indentation in 'cpu-policy.c'
- remove excessive suffixes in 'mce-apei.c'
- add 'UL' in 'x86-defns.h'
- remove changes to 'sr_mask' and 'gr_mask' in 'stdvga.c'
- move 'viridian.c' and 'hyperv-tlfs.h' in a separate commit

Changes in v2:
- minor change to commit title
- change commit message
- remove comments from 'gr_mask' in 'stdvga.c'
- correct code style in 'trace.h'
- add fix in 'extable.c'
- remove changes in 'x86-defns.h', 'msr-index.h' and 'xen-x86_64.h'
---
 xen/arch/x86/apic.c                    |   2 +-
 xen/arch/x86/cpu-policy.c              |  18 +--
 xen/arch/x86/cpu/mcheck/mce-apei.c     |   4 +-
 xen/arch/x86/cpuid.c                   |   8 +-
 xen/arch/x86/efi/efi-boot.h            |   6 +-
 xen/arch/x86/extable.c                 |   2 +-
 xen/arch/x86/hvm/hypercall.c           |   2 +-
 xen/arch/x86/hvm/irq.c                 |   2 +-
 xen/arch/x86/hvm/pmtimer.c             |   4 +-
 xen/arch/x86/hvm/stdvga.c              |  50 +++---
 xen/arch/x86/hvm/vlapic.c              |   6 +-
 xen/arch/x86/include/asm/apicdef.h     |   2 +-
 xen/arch/x86/include/asm/config.h      |   2 +-
 xen/arch/x86/include/asm/hpet.h        |   2 +-
 xen/arch/x86/include/asm/hvm/trace.h   |   4 +-
 xen/arch/x86/include/asm/hvm/vioapic.h |   2 +-
 xen/arch/x86/include/asm/msi.h         |   2 +-
 xen/arch/x86/include/asm/msr-index.h   | 202 ++++++++++++-------------
 xen/arch/x86/include/asm/pci.h         |   8 +-
 xen/arch/x86/include/asm/x86-defns.h   |   2 +-
 xen/arch/x86/percpu.c                  |   2 +-
 xen/arch/x86/psr.c                     |   2 +-
 xen/arch/x86/spec_ctrl.c               |   8 +-
 xen/arch/x86/x86_64/acpi_mmcfg.c       |   2 +-
 xen/arch/x86/x86_64/pci.c              |   2 +-
 xen/arch/x86/x86_emulate/x86_emulate.h |   2 +-
 xen/lib/x86/cpuid.c                    |   8 +-
 xen/lib/x86/policy.c                   |   2 +-
 28 files changed, 179 insertions(+), 179 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index f71474d47d..03c5c0f2ee 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1211,7 +1211,7 @@ static void __init calibrate_APIC_clock(void)
      * Setup the APIC counter to maximum. There is no way the lapic
      * can underflow in the 100ms detection time frame.
      */
-    __setup_APIC_LVTT(0xffffffff);
+    __setup_APIC_LVTT(0xffffffffU);
 
     bus_freq = calibrate_apic_timer();
     if ( !bus_freq )
diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c
index f40eeb8be8..5977e21a07 100644
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -321,7 +321,7 @@ static void recalculate_misc(struct cpu_policy *p)
         p->extd.vendor_edx = p->basic.vendor_edx;
 
         p->extd.raw_fms = p->basic.raw_fms;
-        p->extd.raw[0x1].b &= 0xff00ffff;
+        p->extd.raw[0x1].b &= 0xff00ffffU;
         p->extd.e1d |= p->basic._1d & CPUID_COMMON_1D_FEATURES;
 
         p->extd.raw[0x8].a &= 0x0000ffff; /* GuestMaxPhysAddr hidden. */
@@ -378,10 +378,10 @@ static void __init calculate_host_policy(void)
      * this information.
      */
     if ( cpu_has_lfence_dispatch )
-        max_extd_leaf = max(max_extd_leaf, 0x80000021);
+        max_extd_leaf = max(max_extd_leaf, 0x80000021U);
 
-    p->extd.max_leaf = 0x80000000 | min_t(uint32_t, max_extd_leaf & 0xffff,
-                                          ARRAY_SIZE(p->extd.raw) - 1);
+    p->extd.max_leaf = 0x80000000U | min_t(uint32_t, max_extd_leaf & 0xffffU,
+                                           ARRAY_SIZE(p->extd.raw) - 1);
 
     x86_cpu_featureset_to_policy(boot_cpu_data.x86_capability, p);
     recalculate_xstate(p);
@@ -768,11 +768,11 @@ void recalculate_cpuid_policy(struct domain *d)
 
     p->basic.max_leaf   = min(p->basic.max_leaf,   max->basic.max_leaf);
     p->feat.max_subleaf = min(p->feat.max_subleaf, max->feat.max_subleaf);
-    p->extd.max_leaf    = 0x80000000 | min(p->extd.max_leaf & 0xffff,
-                                           ((p->x86_vendor & (X86_VENDOR_AMD |
-                                                              X86_VENDOR_HYGON))
-                                            ? CPUID_GUEST_NR_EXTD_AMD
-                                            : CPUID_GUEST_NR_EXTD_INTEL) - 1);
+    p->extd.max_leaf    = 0x80000000U | min(p->extd.max_leaf & 0xffff,
+                                            ((p->x86_vendor & (X86_VENDOR_AMD |
+                                                               X86_VENDOR_HYGON))
+                                             ? CPUID_GUEST_NR_EXTD_AMD
+                                             : CPUID_GUEST_NR_EXTD_INTEL) - 1);
 
     x86_cpu_policy_to_featureset(p, fs);
     x86_cpu_policy_to_featureset(max, max_fs);
diff --git a/xen/arch/x86/cpu/mcheck/mce-apei.c b/xen/arch/x86/cpu/mcheck/mce-apei.c
index 53b6735896..b895020882 100644
--- a/xen/arch/x86/cpu/mcheck/mce-apei.c
+++ b/xen/arch/x86/cpu/mcheck/mce-apei.c
@@ -37,10 +37,10 @@
 #include "mce.h"
 
 #define CPER_CREATOR_MCE						\
-	UUID_LE(0x75a574e3, 0x5052, 0x4b29, 0x8a, 0x8e, 0xbe, 0x2c,	\
+	UUID_LE(0x75a574e3U, 0x5052, 0x4b29, 0x8a, 0x8e, 0xbe, 0x2c,	\
 		0x64, 0x90, 0xb8, 0x9d)
 #define CPER_SECTION_TYPE_MCE						\
-	UUID_LE(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96,	\
+	UUID_LE(0xfe08ffbeU, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96,	\
 		0x04, 0x4a, 0x38, 0xfc)
 
 /*
diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c
index 455a09b2dd..7290a979c6 100644
--- a/xen/arch/x86/cpuid.c
+++ b/xen/arch/x86/cpuid.c
@@ -93,7 +93,7 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
         }
         break;
 
-    case 0x40000000 ... 0x400000ff:
+    case 0x40000000U ... 0x400000ffU:
         if ( is_viridian_domain(d) )
             return cpuid_viridian_leaves(v, leaf, subleaf, res);
 
@@ -103,10 +103,10 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
          * Intel reserve up until 0x4fffffff for hypervisor use.  AMD reserve
          * only until 0x400000ff, but we already use double that.
          */
-    case 0x40000100 ... 0x400001ff:
+    case 0x40000100U ... 0x400001ffU:
         return cpuid_hypervisor_leaves(v, leaf, subleaf, res);
 
-    case 0x80000000 ... 0x80000000 + CPUID_GUEST_NR_EXTD - 1:
+    case 0x80000000U ... 0x80000000U + CPUID_GUEST_NR_EXTD - 1:
         ASSERT((p->extd.max_leaf & 0xffff) < ARRAY_SIZE(p->extd.raw));
         if ( (leaf & 0xffff) > min_t(uint32_t, p->extd.max_leaf & 0xffff,
                                      ARRAY_SIZE(p->extd.raw) - 1) )
@@ -352,7 +352,7 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
         }
         break;
 
-    case 0x80000001:
+    case 0x80000001U:
         /* SYSCALL is hidden outside of long mode on Intel. */
         if ( p->x86_vendor == X86_VENDOR_INTEL &&
              is_hvm_domain(d) && !hvm_long_mode_active(v) )
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 92f4cfe8bd..eebc54180b 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -740,16 +740,16 @@ static void __init efi_arch_handle_module(const struct file *file,
 
 static void __init efi_arch_cpu(void)
 {
-    uint32_t eax = cpuid_eax(0x80000000);
+    uint32_t eax = cpuid_eax(0x80000000U);
     uint32_t *caps = boot_cpu_data.x86_capability;
 
     boot_tsc_stamp = rdtsc();
 
     caps[FEATURESET_1c] = cpuid_ecx(1);
 
-    if ( (eax >> 16) == 0x8000 && eax > 0x80000000 )
+    if ( (eax >> 16) == 0x8000 && eax > 0x80000000U )
     {
-        caps[FEATURESET_e1d] = cpuid_edx(0x80000001);
+        caps[FEATURESET_e1d] = cpuid_edx(0x80000001U);
 
         /*
          * This check purposefully doesn't use cpu_has_nx because
diff --git a/xen/arch/x86/extable.c b/xen/arch/x86/extable.c
index c3771c2e39..0e8694c188 100644
--- a/xen/arch/x86/extable.c
+++ b/xen/arch/x86/extable.c
@@ -141,7 +141,7 @@ static int __init cf_check stub_selftest(void)
           .rax = 0x0123456789abcdef,
           .res.fields.trapnr = X86_EXC_GP },
         { .opc = { endbr64, 0x02, 0x04, 0x04, 0xc3 }, /* add (%rsp,%rax),%al */
-          .rax = 0xfedcba9876543210,
+          .rax = 0xfedcba9876543210UL,
           .res.fields.trapnr = X86_EXC_SS },
         { .opc = { endbr64, 0xcc, 0xc3, 0xc3, 0xc3 }, /* int3 */
           .res.fields.trapnr = X86_EXC_BP },
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 20d266ffd5..eeb73e1aa5 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen/arch/x86/hvm/hypercall.c
@@ -129,7 +129,7 @@ int hvm_hypercall(struct cpu_user_regs *regs)
         break;
     }
 
-    if ( (eax & 0x80000000) && is_viridian_domain(currd) )
+    if ( (eax & 0x80000000U) && is_viridian_domain(currd) )
     {
         int ret;
 
diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index 1258371eb0..5c00127cfc 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -383,7 +383,7 @@ int hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
 
     if ( !vector )
     {
-        int pirq = ((addr >> 32) & 0xffffff00) | dest;
+        int pirq = ((addr >> 32) & 0xffffff00U) | dest;
 
         if ( pirq > 0 )
         {
diff --git a/xen/arch/x86/hvm/pmtimer.c b/xen/arch/x86/hvm/pmtimer.c
index 2145c531b6..eb4a455763 100644
--- a/xen/arch/x86/hvm/pmtimer.c
+++ b/xen/arch/x86/hvm/pmtimer.c
@@ -40,8 +40,8 @@
 #define SCI_IRQ 9
 
 /* We provide a 32-bit counter (must match the TMR_VAL_EXT bit in the FADT) */
-#define TMR_VAL_MASK  (0xffffffff)
-#define TMR_VAL_MSB   (0x80000000)
+#define TMR_VAL_MASK  (0xffffffffU)
+#define TMR_VAL_MSB   (0x80000000U)
 
 /* Dispatch SCIs based on the PM1a_STS and PM1a_EN registers */
 static void pmt_update_sci(PMTState *s)
diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index 798a9a0549..d3dfb9b689 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -39,22 +39,22 @@
 
 #define PAT(x) (x)
 static const uint32_t mask16[16] = {
-    PAT(0x00000000),
-    PAT(0x000000ff),
-    PAT(0x0000ff00),
-    PAT(0x0000ffff),
-    PAT(0x00ff0000),
-    PAT(0x00ff00ff),
-    PAT(0x00ffff00),
-    PAT(0x00ffffff),
-    PAT(0xff000000),
-    PAT(0xff0000ff),
-    PAT(0xff00ff00),
-    PAT(0xff00ffff),
-    PAT(0xffff0000),
-    PAT(0xffff00ff),
-    PAT(0xffffff00),
-    PAT(0xffffffff),
+    PAT(0x00000000U),
+    PAT(0x000000ffU),
+    PAT(0x0000ff00U),
+    PAT(0x0000ffffU),
+    PAT(0x00ff0000U),
+    PAT(0x00ff00ffU),
+    PAT(0x00ffff00U),
+    PAT(0x00ffffffU),
+    PAT(0xff000000U),
+    PAT(0xff0000ffU),
+    PAT(0xff00ff00U),
+    PAT(0xff00ffffU),
+    PAT(0xffff0000U),
+    PAT(0xffff00ffU),
+    PAT(0xffffff00U),
+    PAT(0xffffffffU),
 };
 
 /* force some bits to zero */
@@ -70,15 +70,15 @@ static const uint8_t sr_mask[8] = {
 };
 
 static const uint8_t gr_mask[9] = {
-    (uint8_t)~0xf0, /* 0x00 */
-    (uint8_t)~0xf0, /* 0x01 */
-    (uint8_t)~0xf0, /* 0x02 */
-    (uint8_t)~0xe0, /* 0x03 */
-    (uint8_t)~0xfc, /* 0x04 */
-    (uint8_t)~0x84, /* 0x05 */
-    (uint8_t)~0xf0, /* 0x06 */
-    (uint8_t)~0xf0, /* 0x07 */
-    (uint8_t)~0x00, /* 0x08 */
+    (uint8_t)~0xf0,
+    (uint8_t)~0xf0,
+    (uint8_t)~0xf0,
+    (uint8_t)~0xe0,
+    (uint8_t)~0xfc,
+    (uint8_t)~0x84,
+    (uint8_t)~0xf0,
+    (uint8_t)~0xf0,
+    (uint8_t)~0x00,
 };
 
 static uint8_t *vram_getb(struct hvm_hw_stdvga *s, unsigned int a)
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index c7ce82d064..a8e87c4446 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -237,7 +237,7 @@ bool_t vlapic_match_dest(
     case APIC_DEST_NOSHORT:
         if ( dest_mode )
             return vlapic_match_logical_addr(target, dest);
-        return (dest == _VLAPIC_ID(target, 0xffffffff)) ||
+        return (dest == _VLAPIC_ID(target, 0xffffffffU)) ||
                (dest == VLAPIC_ID(target));
 
     case APIC_DEST_SELF:
@@ -467,7 +467,7 @@ static bool_t is_multicast_dest(struct vlapic *vlapic, unsigned int short_hand,
         return short_hand != APIC_DEST_SELF;
 
     if ( vlapic_x2apic_mode(vlapic) )
-        return dest_mode ? hweight16(dest) > 1 : dest == 0xffffffff;
+        return dest_mode ? hweight16(dest) > 1 : dest == 0xffffffffU;
 
     if ( dest_mode )
         return hweight8(dest &
@@ -831,7 +831,7 @@ void vlapic_reg_write(struct vcpu *v, unsigned int reg, uint32_t val)
         break;
 
     case APIC_ICR2:
-        vlapic_set_reg(vlapic, APIC_ICR2, val & 0xff000000);
+        vlapic_set_reg(vlapic, APIC_ICR2, val & 0xff000000U);
         break;
 
     case APIC_LVTT:         /* LVT Timer Reg */
diff --git a/xen/arch/x86/include/asm/apicdef.h b/xen/arch/x86/include/asm/apicdef.h
index 2440d83c8d..7f21d3f49c 100644
--- a/xen/arch/x86/include/asm/apicdef.h
+++ b/xen/arch/x86/include/asm/apicdef.h
@@ -8,7 +8,7 @@
  * Ingo Molnar <mingo@redhat.com>, 1999, 2000
  */
 
-#define		APIC_DEFAULT_PHYS_BASE	0xfee00000
+#define		APIC_DEFAULT_PHYS_BASE	0xfee00000U
  
 #define		APIC_ID		0x20
 #define			APIC_ID_MASK		(0xFFu<<24)
diff --git a/xen/arch/x86/include/asm/config.h b/xen/arch/x86/include/asm/config.h
index fbc4bb3416..bbced338be 100644
--- a/xen/arch/x86/include/asm/config.h
+++ b/xen/arch/x86/include/asm/config.h
@@ -257,7 +257,7 @@ extern unsigned char boot_edid_info[128];
 #endif /* CONFIG_PV32 */
 
 #define MACH2PHYS_COMPAT_VIRT_START    HYPERVISOR_COMPAT_VIRT_START
-#define MACH2PHYS_COMPAT_VIRT_END      0xFFE00000
+#define MACH2PHYS_COMPAT_VIRT_END      0xFFE00000U
 #define MACH2PHYS_COMPAT_NR_ENTRIES(d) \
     ((MACH2PHYS_COMPAT_VIRT_END-MACH2PHYS_COMPAT_VIRT_START(d))>>2)
 
diff --git a/xen/arch/x86/include/asm/hpet.h b/xen/arch/x86/include/asm/hpet.h
index 9919f74730..c5e8e9c8db 100644
--- a/xen/arch/x86/include/asm/hpet.h
+++ b/xen/arch/x86/include/asm/hpet.h
@@ -41,7 +41,7 @@
 #define HPET_TN_ROUTE		0x3e00
 #define HPET_TN_FSB		0x4000
 #define HPET_TN_FSB_CAP		0x8000
-#define HPET_TN_RESERVED	0xffff0081
+#define HPET_TN_RESERVED	0xffff0081U
 #define HPET_TN_INT_ROUTE_CAP	(0xffffffffULL << 32)
 
 
diff --git a/xen/arch/x86/include/asm/hvm/trace.h b/xen/arch/x86/include/asm/hvm/trace.h
index 696e42eb94..0437966d1f 100644
--- a/xen/arch/x86/include/asm/hvm/trace.h
+++ b/xen/arch/x86/include/asm/hvm/trace.h
@@ -58,7 +58,7 @@
 #define DO_TRC_HVM_VLAPIC           DEFAULT_HVM_MISC
 
 
-#define TRC_PAR_LONG(par) ((par)&0xFFFFFFFF),((par)>>32)
+#define TRC_PAR_LONG(par) ((par) & 0xFFFFFFFFU), ((par) >> 32)
 
 #define TRACE_2_LONG_2D(_e, d1, d2, ...) \
     TRACE_4D(_e, d1, d2)
@@ -93,7 +93,7 @@
     HVMTRACE_ND(evt, 0, 0)
 
 #define HVMTRACE_LONG_1D(evt, d1)                  \
-                   HVMTRACE_2D(evt ## 64, (d1) & 0xFFFFFFFF, (d1) >> 32)
+                   HVMTRACE_2D(evt ## 64, (d1) & 0xFFFFFFFFU, (d1) >> 32)
 #define HVMTRACE_LONG_2D(evt, d1, d2, ...)              \
                    HVMTRACE_3D(evt ## 64, d1, d2)
 #define HVMTRACE_LONG_3D(evt, d1, d2, d3, ...)      \
diff --git a/xen/arch/x86/include/asm/hvm/vioapic.h b/xen/arch/x86/include/asm/hvm/vioapic.h
index 2944ec20dd..68af6dce79 100644
--- a/xen/arch/x86/include/asm/hvm/vioapic.h
+++ b/xen/arch/x86/include/asm/hvm/vioapic.h
@@ -32,7 +32,7 @@
 #define VIOAPIC_EDGE_TRIG  0
 #define VIOAPIC_LEVEL_TRIG 1
 
-#define VIOAPIC_DEFAULT_BASE_ADDRESS  0xfec00000
+#define VIOAPIC_DEFAULT_BASE_ADDRESS  0xfec00000U
 #define VIOAPIC_MEM_LENGTH            0x100
 
 /* Direct registers. */
diff --git a/xen/arch/x86/include/asm/msi.h b/xen/arch/x86/include/asm/msi.h
index a53ade95c9..d89723d009 100644
--- a/xen/arch/x86/include/asm/msi.h
+++ b/xen/arch/x86/include/asm/msi.h
@@ -37,7 +37,7 @@
  */
 
 #define MSI_ADDR_BASE_HI            0
-#define MSI_ADDR_BASE_LO            0xfee00000
+#define MSI_ADDR_BASE_LO            0xfee00000U
 #define MSI_ADDR_BASE_MASK          (~0xfffff)
 #define MSI_ADDR_HEADER             MSI_ADDR_BASE_LO
 
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 4f861c0bb4..69ca8677c0 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -30,7 +30,7 @@
 
 #define MSR_INTEL_CORE_THREAD_COUNT         0x00000035
 #define  MSR_CTC_THREAD_MASK                0x0000ffff
-#define  MSR_CTC_CORE_MASK                  0xffff0000
+#define  MSR_CTC_CORE_MASK                  0xffff0000U
 
 #define MSR_SPEC_CTRL                       0x00000048
 #define  SPEC_CTRL_IBRS                     (_AC(1, ULL) <<  0)
@@ -181,35 +181,35 @@
     (EFER_SCE | EFER_LME | EFER_LMA | EFER_NXE | EFER_SVME | EFER_FFXSE | \
      EFER_AIBRSE)
 
-#define MSR_STAR                            0xc0000081 /* legacy mode SYSCALL target */
-#define MSR_LSTAR                           0xc0000082 /* long mode SYSCALL target */
-#define MSR_CSTAR                           0xc0000083 /* compat mode SYSCALL target */
-#define MSR_SYSCALL_MASK                    0xc0000084 /* EFLAGS mask for syscall */
-#define MSR_FS_BASE                         0xc0000100 /* 64bit FS base */
-#define MSR_GS_BASE                         0xc0000101 /* 64bit GS base */
-#define MSR_SHADOW_GS_BASE                  0xc0000102 /* SwapGS GS shadow */
-#define MSR_TSC_AUX                         0xc0000103 /* Auxiliary TSC */
+#define MSR_STAR                            0xc0000081U /* legacy mode SYSCALL target */
+#define MSR_LSTAR                           0xc0000082U /* long mode SYSCALL target */
+#define MSR_CSTAR                           0xc0000083U /* compat mode SYSCALL target */
+#define MSR_SYSCALL_MASK                    0xc0000084U /* EFLAGS mask for syscall */
+#define MSR_FS_BASE                         0xc0000100U /* 64bit FS base */
+#define MSR_GS_BASE                         0xc0000101U /* 64bit GS base */
+#define MSR_SHADOW_GS_BASE                  0xc0000102U /* SwapGS GS shadow */
+#define MSR_TSC_AUX                         0xc0000103U /* Auxiliary TSC */
 
-#define MSR_K8_SYSCFG                       0xc0010010
+#define MSR_K8_SYSCFG                       0xc0010010U
 #define  SYSCFG_MTRR_FIX_DRAM_EN            (_AC(1, ULL) << 18)
 #define  SYSCFG_MTRR_FIX_DRAM_MOD_EN        (_AC(1, ULL) << 19)
 #define  SYSCFG_MTRR_VAR_DRAM_EN            (_AC(1, ULL) << 20)
 #define  SYSCFG_MTRR_TOM2_EN                (_AC(1, ULL) << 21)
 #define  SYSCFG_TOM2_FORCE_WB               (_AC(1, ULL) << 22)
 
-#define MSR_K8_IORR_BASE0                   0xc0010016
-#define MSR_K8_IORR_MASK0                   0xc0010017
-#define MSR_K8_IORR_BASE1                   0xc0010018
-#define MSR_K8_IORR_MASK1                   0xc0010019
+#define MSR_K8_IORR_BASE0                   0xc0010016U
+#define MSR_K8_IORR_MASK0                   0xc0010017U
+#define MSR_K8_IORR_BASE1                   0xc0010018U
+#define MSR_K8_IORR_MASK1                   0xc0010019U
 
-#define MSR_K8_TSEG_BASE                    0xc0010112 /* AMD doc: SMMAddr */
-#define MSR_K8_TSEG_MASK                    0xc0010113 /* AMD doc: SMMMask */
+#define MSR_K8_TSEG_BASE                    0xc0010112U /* AMD doc: SMMAddr */
+#define MSR_K8_TSEG_MASK                    0xc0010113U /* AMD doc: SMMMask */
 
-#define MSR_K8_VM_CR                        0xc0010114
+#define MSR_K8_VM_CR                        0xc0010114U
 #define  VM_CR_INIT_REDIRECTION             (_AC(1, ULL) <<  1)
 #define  VM_CR_SVM_DISABLE                  (_AC(1, ULL) <<  4)
 
-#define MSR_VIRT_SPEC_CTRL                  0xc001011f /* Layout matches MSR_SPEC_CTRL */
+#define MSR_VIRT_SPEC_CTRL                  0xc001011fU /* Layout matches MSR_SPEC_CTRL */
 
 /*
  * Legacy MSR constants in need of cleanup.  No new MSRs below this comment.
@@ -293,7 +293,7 @@
 #define CMCI_EN 			(1UL<<30)
 #define CMCI_THRESHOLD_MASK		0x7FFF
 
-#define MSR_AMD64_MC0_MASK		0xc0010044
+#define MSR_AMD64_MC0_MASK		0xc0010044U
 
 #define MSR_IA32_MCx_CTL(x)		(MSR_IA32_MC0_CTL + 4*(x))
 #define MSR_IA32_MCx_STATUS(x)		(MSR_IA32_MC0_STATUS + 4*(x))
@@ -325,83 +325,83 @@
 
 /* K7/K8 MSRs. Not complete. See the architecture manual for a more
    complete list. */
-#define MSR_K7_EVNTSEL0			0xc0010000
-#define MSR_K7_PERFCTR0			0xc0010004
-#define MSR_K7_EVNTSEL1			0xc0010001
-#define MSR_K7_PERFCTR1			0xc0010005
-#define MSR_K7_EVNTSEL2			0xc0010002
-#define MSR_K7_PERFCTR2			0xc0010006
-#define MSR_K7_EVNTSEL3			0xc0010003
-#define MSR_K7_PERFCTR3			0xc0010007
-#define MSR_K8_TOP_MEM1			0xc001001a
-#define MSR_K7_CLK_CTL			0xc001001b
-#define MSR_K8_TOP_MEM2			0xc001001d
-
-#define MSR_K8_HWCR			0xc0010015
+#define MSR_K7_EVNTSEL0			0xc0010000U
+#define MSR_K7_PERFCTR0			0xc0010004U
+#define MSR_K7_EVNTSEL1			0xc0010001U
+#define MSR_K7_PERFCTR1			0xc0010005U
+#define MSR_K7_EVNTSEL2			0xc0010002U
+#define MSR_K7_PERFCTR2			0xc0010006U
+#define MSR_K7_EVNTSEL3			0xc0010003U
+#define MSR_K7_PERFCTR3			0xc0010007U
+#define MSR_K8_TOP_MEM1			0xc001001aU
+#define MSR_K7_CLK_CTL			0xc001001bU
+#define MSR_K8_TOP_MEM2			0xc001001dU
+
+#define MSR_K8_HWCR			0xc0010015U
 #define K8_HWCR_TSC_FREQ_SEL		(1ULL << 24)
 #define K8_HWCR_CPUID_USER_DIS		(1ULL << 35)
 
-#define MSR_K7_FID_VID_CTL		0xc0010041
-#define MSR_K7_FID_VID_STATUS		0xc0010042
-#define MSR_K8_PSTATE_LIMIT		0xc0010061
-#define MSR_K8_PSTATE_CTRL		0xc0010062
-#define MSR_K8_PSTATE_STATUS		0xc0010063
-#define MSR_K8_PSTATE0			0xc0010064
-#define MSR_K8_PSTATE1			0xc0010065
-#define MSR_K8_PSTATE2			0xc0010066
-#define MSR_K8_PSTATE3			0xc0010067
-#define MSR_K8_PSTATE4			0xc0010068
-#define MSR_K8_PSTATE5			0xc0010069
-#define MSR_K8_PSTATE6			0xc001006A
-#define MSR_K8_PSTATE7			0xc001006B
-#define MSR_K8_ENABLE_C1E		0xc0010055
-#define MSR_K8_VM_HSAVE_PA		0xc0010117
-
-#define MSR_AMD_FAM15H_EVNTSEL0		0xc0010200
-#define MSR_AMD_FAM15H_PERFCTR0		0xc0010201
-#define MSR_AMD_FAM15H_EVNTSEL1		0xc0010202
-#define MSR_AMD_FAM15H_PERFCTR1		0xc0010203
-#define MSR_AMD_FAM15H_EVNTSEL2		0xc0010204
-#define MSR_AMD_FAM15H_PERFCTR2		0xc0010205
-#define MSR_AMD_FAM15H_EVNTSEL3		0xc0010206
-#define MSR_AMD_FAM15H_PERFCTR3		0xc0010207
-#define MSR_AMD_FAM15H_EVNTSEL4		0xc0010208
-#define MSR_AMD_FAM15H_PERFCTR4		0xc0010209
-#define MSR_AMD_FAM15H_EVNTSEL5		0xc001020a
-#define MSR_AMD_FAM15H_PERFCTR5		0xc001020b
-
-#define MSR_AMD_L7S0_FEATURE_MASK	0xc0011002
-#define MSR_AMD_THRM_FEATURE_MASK	0xc0011003
-#define MSR_K8_FEATURE_MASK		0xc0011004
-#define MSR_K8_EXT_FEATURE_MASK		0xc0011005
+#define MSR_K7_FID_VID_CTL		0xc0010041U
+#define MSR_K7_FID_VID_STATUS		0xc0010042U
+#define MSR_K8_PSTATE_LIMIT		0xc0010061U
+#define MSR_K8_PSTATE_CTRL		0xc0010062U
+#define MSR_K8_PSTATE_STATUS		0xc0010063U
+#define MSR_K8_PSTATE0			0xc0010064U
+#define MSR_K8_PSTATE1			0xc0010065U
+#define MSR_K8_PSTATE2			0xc0010066U
+#define MSR_K8_PSTATE3			0xc0010067U
+#define MSR_K8_PSTATE4			0xc0010068U
+#define MSR_K8_PSTATE5			0xc0010069U
+#define MSR_K8_PSTATE6			0xc001006AU
+#define MSR_K8_PSTATE7			0xc001006BU
+#define MSR_K8_ENABLE_C1E		0xc0010055U
+#define MSR_K8_VM_HSAVE_PA		0xc0010117U
+
+#define MSR_AMD_FAM15H_EVNTSEL0		0xc0010200U
+#define MSR_AMD_FAM15H_PERFCTR0		0xc0010201U
+#define MSR_AMD_FAM15H_EVNTSEL1		0xc0010202U
+#define MSR_AMD_FAM15H_PERFCTR1		0xc0010203U
+#define MSR_AMD_FAM15H_EVNTSEL2		0xc0010204U
+#define MSR_AMD_FAM15H_PERFCTR2		0xc0010205U
+#define MSR_AMD_FAM15H_EVNTSEL3		0xc0010206U
+#define MSR_AMD_FAM15H_PERFCTR3		0xc0010207U
+#define MSR_AMD_FAM15H_EVNTSEL4		0xc0010208U
+#define MSR_AMD_FAM15H_PERFCTR4		0xc0010209U
+#define MSR_AMD_FAM15H_EVNTSEL5		0xc001020aU
+#define MSR_AMD_FAM15H_PERFCTR5		0xc001020bU
+
+#define MSR_AMD_L7S0_FEATURE_MASK	0xc0011002U
+#define MSR_AMD_THRM_FEATURE_MASK	0xc0011003U
+#define MSR_K8_FEATURE_MASK			0xc0011004U
+#define MSR_K8_EXT_FEATURE_MASK		0xc0011005U
 
 /* AMD64 MSRs */
-#define MSR_AMD64_NB_CFG		0xc001001f
+#define MSR_AMD64_NB_CFG		0xc001001fU
 #define AMD64_NB_CFG_CF8_EXT_ENABLE_BIT	46
-#define MSR_AMD64_LS_CFG		0xc0011020
-#define MSR_AMD64_IC_CFG		0xc0011021
-#define MSR_AMD64_DC_CFG		0xc0011022
-#define MSR_AMD64_DE_CFG		0xc0011029
+#define MSR_AMD64_LS_CFG		0xc0011020U
+#define MSR_AMD64_IC_CFG		0xc0011021U
+#define MSR_AMD64_DC_CFG		0xc0011022U
+#define MSR_AMD64_DE_CFG		0xc0011029U
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
-#define MSR_AMD64_EX_CFG		0xc001102c
-#define MSR_AMD64_DE_CFG2		0xc00110e3
+#define MSR_AMD64_EX_CFG		0xc001102cU
+#define MSR_AMD64_DE_CFG2		0xc00110e3U
 
-#define MSR_AMD64_DR0_ADDRESS_MASK	0xc0011027
-#define MSR_AMD64_DR1_ADDRESS_MASK	0xc0011019
-#define MSR_AMD64_DR2_ADDRESS_MASK	0xc001101a
-#define MSR_AMD64_DR3_ADDRESS_MASK	0xc001101b
+#define MSR_AMD64_DR0_ADDRESS_MASK	0xc0011027U
+#define MSR_AMD64_DR1_ADDRESS_MASK	0xc0011019U
+#define MSR_AMD64_DR2_ADDRESS_MASK	0xc001101aU
+#define MSR_AMD64_DR3_ADDRESS_MASK	0xc001101bU
 
 /* AMD Family10h machine check MSRs */
-#define MSR_F10_MC4_MISC1		0xc0000408
-#define MSR_F10_MC4_MISC2		0xc0000409
-#define MSR_F10_MC4_MISC3		0xc000040A
+#define MSR_F10_MC4_MISC1		0xc0000408U
+#define MSR_F10_MC4_MISC2		0xc0000409U
+#define MSR_F10_MC4_MISC3		0xc000040AU
 
 /* AMD Family10h Bus Unit MSRs */
-#define MSR_F10_BU_CFG 		0xc0011023
-#define MSR_F10_BU_CFG2		0xc001102a
+#define MSR_F10_BU_CFG 		0xc0011023U
+#define MSR_F10_BU_CFG2		0xc001102aU
 
 /* Other AMD Fam10h MSRs */
-#define MSR_FAM10H_MMIO_CONF_BASE	0xc0010058
+#define MSR_FAM10H_MMIO_CONF_BASE	0xc0010058U
 #define FAM10H_MMIO_CONF_ENABLE         (1<<0)
 #define FAM10H_MMIO_CONF_BUSRANGE_MASK	0xf
 #define FAM10H_MMIO_CONF_BUSRANGE_SHIFT 2
@@ -410,31 +410,31 @@
 
 /* AMD Microcode MSRs */
 #define MSR_AMD_PATCHLEVEL		0x0000008b
-#define MSR_AMD_PATCHLOADER		0xc0010020
+#define MSR_AMD_PATCHLOADER		0xc0010020U
 
 /* AMD TSC RATE MSR */
-#define MSR_AMD64_TSC_RATIO		0xc0000104
+#define MSR_AMD64_TSC_RATIO		0xc0000104U
 
 /* AMD Lightweight Profiling MSRs */
-#define MSR_AMD64_LWP_CFG		0xc0000105
-#define MSR_AMD64_LWP_CBADDR		0xc0000106
+#define MSR_AMD64_LWP_CFG		0xc0000105U
+#define MSR_AMD64_LWP_CBADDR		0xc0000106U
 
 /* AMD OS Visible Workaround MSRs */
-#define MSR_AMD_OSVW_ID_LENGTH          0xc0010140
-#define MSR_AMD_OSVW_STATUS             0xc0010141
+#define MSR_AMD_OSVW_ID_LENGTH          0xc0010140U
+#define MSR_AMD_OSVW_STATUS             0xc0010141U
 
 /* AMD Protected Processor Inventory Number */
-#define MSR_AMD_PPIN_CTL                0xc00102f0
-#define MSR_AMD_PPIN                    0xc00102f1
+#define MSR_AMD_PPIN_CTL                0xc00102f0U
+#define MSR_AMD_PPIN                    0xc00102f1U
 
 /* K6 MSRs */
-#define MSR_K6_EFER			0xc0000080
-#define MSR_K6_STAR			0xc0000081
-#define MSR_K6_WHCR			0xc0000082
-#define MSR_K6_UWCCR			0xc0000085
-#define MSR_K6_EPMR			0xc0000086
-#define MSR_K6_PSOR			0xc0000087
-#define MSR_K6_PFIR			0xc0000088
+#define MSR_K6_EFER			0xc0000080U
+#define MSR_K6_STAR			0xc0000081U
+#define MSR_K6_WHCR			0xc0000082U
+#define MSR_K6_UWCCR			0xc0000085U
+#define MSR_K6_EPMR			0xc0000086U
+#define MSR_K6_PSOR			0xc0000087U
+#define MSR_K6_PFIR			0xc0000088U
 
 /* Centaur-Hauls/IDT defined MSRs. */
 #define MSR_IDT_FCR1			0x00000107
@@ -459,10 +459,10 @@
 #define MSR_VIA_BCR2			0x00001147
 
 /* Transmeta defined MSRs */
-#define MSR_TMTA_LONGRUN_CTRL		0x80868010
-#define MSR_TMTA_LONGRUN_FLAGS		0x80868011
-#define MSR_TMTA_LRTI_READOUT		0x80868018
-#define MSR_TMTA_LRTI_VOLT_MHZ		0x8086801a
+#define MSR_TMTA_LONGRUN_CTRL		0x80868010U
+#define MSR_TMTA_LONGRUN_FLAGS		0x80868011U
+#define MSR_TMTA_LRTI_READOUT		0x80868018U
+#define MSR_TMTA_LRTI_VOLT_MHZ		0x8086801aU
 
 /* Intel defined MSRs. */
 #define MSR_IA32_P5_MC_ADDR		0x00000000
diff --git a/xen/arch/x86/include/asm/pci.h b/xen/arch/x86/include/asm/pci.h
index f4a58c8acf..e1dd12eb19 100644
--- a/xen/arch/x86/include/asm/pci.h
+++ b/xen/arch/x86/include/asm/pci.h
@@ -3,10 +3,10 @@
 
 #include <xen/mm.h>
 
-#define CF8_BDF(cf8)     (  ((cf8) & 0x00ffff00) >> 8)
-#define CF8_ADDR_LO(cf8) (   (cf8) & 0x000000fc)
-#define CF8_ADDR_HI(cf8) (  ((cf8) & 0x0f000000) >> 16)
-#define CF8_ENABLED(cf8) (!!((cf8) & 0x80000000))
+#define CF8_BDF(cf8)     (  ((cf8) & 0x00ffff00U) >> 8)
+#define CF8_ADDR_LO(cf8) (   (cf8) & 0x000000fcU)
+#define CF8_ADDR_HI(cf8) (  ((cf8) & 0x0f000000U) >> 16)
+#define CF8_ENABLED(cf8) (!!((cf8) & 0x80000000U))
 
 #define IS_SNB_GFX(id) (id == 0x01068086 || id == 0x01168086 \
                         || id == 0x01268086 || id == 0x01028086 \
diff --git a/xen/arch/x86/include/asm/x86-defns.h b/xen/arch/x86/include/asm/x86-defns.h
index e350227e57..f091bc9cf2 100644
--- a/xen/arch/x86/include/asm/x86-defns.h
+++ b/xen/arch/x86/include/asm/x86-defns.h
@@ -103,7 +103,7 @@
 /*
  * Debug status flags in DR6.
  */
-#define X86_DR6_DEFAULT         0xffff0ff0  /* Default %dr6 value. */
+#define X86_DR6_DEFAULT         0xffff0ff0UL  /* Default %dr6 value. */
 
 /*
  * Debug control flags in DR7.
diff --git a/xen/arch/x86/percpu.c b/xen/arch/x86/percpu.c
index 288050cdba..1ebeb65ad6 100644
--- a/xen/arch/x86/percpu.c
+++ b/xen/arch/x86/percpu.c
@@ -12,7 +12,7 @@ unsigned long __per_cpu_offset[NR_CPUS];
  * possible #PF at (NULL + a little) which has security implications in the
  * context of PV guests.
  */
-#define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
+#define INVALID_PERCPU_AREA (0x8000000000000000UL - (long)__per_cpu_start)
 #define PERCPU_ORDER get_order_from_bytes(__per_cpu_data_end - __per_cpu_start)
 
 void __init percpu_init_areas(void)
diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index a1e0af27c5..5581b4717a 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -191,7 +191,7 @@ static struct feat_node *feat_l2_cat;
 static struct feat_node *feat_mba;
 
 /* Common functions */
-#define cat_default_val(len) (0xffffffff >> (32 - (len)))
+#define cat_default_val(len) (0xffffffffU >> (32 - (len)))
 
 /*
  * get_cdp_data - get DATA COS register value from input COS ID.
diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index 4081cef200..b030ad8a5b 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -398,8 +398,8 @@ static void __init print_details(enum ind_thunk thunk)
         cpuid_count(7, 0, &max, &tmp, &tmp, &_7d0);
     if ( max >= 2 )
         cpuid_count(7, 2, &tmp, &tmp, &tmp, &_7d2);
-    if ( boot_cpu_data.extended_cpuid_level >= 0x80000008 )
-        cpuid(0x80000008, &tmp, &e8b, &tmp, &tmp);
+    if ( boot_cpu_data.extended_cpuid_level >= 0x80000008U )
+        cpuid(0x80000008U, &tmp, &e8b, &tmp, &tmp);
     if ( cpu_has_arch_caps )
         rdmsrl(MSR_ARCH_CAPABILITIES, caps);
 
@@ -1337,8 +1337,8 @@ void __init init_speculation_mitigations(void)
          * TODO: Adjust cpu_has_svm_spec_ctrl to be usable earlier on boot.
          */
         if ( opt_msr_sc_hvm &&
-             (boot_cpu_data.extended_cpuid_level >= 0x8000000a) &&
-             (cpuid_edx(0x8000000a) & (1u << SVM_FEATURE_SPEC_CTRL)) )
+             (boot_cpu_data.extended_cpuid_level >= 0x8000000aU) &&
+             (cpuid_edx(0x8000000aU) & (1u << SVM_FEATURE_SPEC_CTRL)) )
             setup_force_cpu_cap(X86_FEATURE_SC_MSR_HVM);
     }
 
diff --git a/xen/arch/x86/x86_64/acpi_mmcfg.c b/xen/arch/x86/x86_64/acpi_mmcfg.c
index 2159c68189..cdde7e453c 100644
--- a/xen/arch/x86/x86_64/acpi_mmcfg.c
+++ b/xen/arch/x86/x86_64/acpi_mmcfg.c
@@ -50,7 +50,7 @@ static int __init acpi_mcfg_check_entry(struct acpi_table_mcfg *mcfg,
 {
     int year;
 
-    if (cfg->address < 0xFFFFFFFF)
+    if (cfg->address < 0xFFFFFFFFU)
         return 0;
 
     if (!strncmp(mcfg->header.oem_id, "SGI", 3))
diff --git a/xen/arch/x86/x86_64/pci.c b/xen/arch/x86/x86_64/pci.c
index aad1c3f7cf..8d33429103 100644
--- a/xen/arch/x86/x86_64/pci.c
+++ b/xen/arch/x86/x86_64/pci.c
@@ -9,7 +9,7 @@
 #include <asm/io.h>
 
 #define PCI_CONF_ADDRESS(sbdf, reg) \
-    (0x80000000 | ((sbdf).bdf << 8) | ((reg) & ~3))
+    (0x80000000U | ((sbdf).bdf << 8) | ((reg) & ~3))
 
 uint8_t pci_conf_read8(pci_sbdf_t sbdf, unsigned int reg)
 {
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h
index 698750267a..d92be69d84 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.h
+++ b/xen/arch/x86/x86_emulate/x86_emulate.h
@@ -620,7 +620,7 @@ struct x86_emulate_ctxt
  * below).
  * Hence no separate #define-s get added.
  */
-#define X86EMUL_OPC_EXT_MASK         0xffff0000
+#define X86EMUL_OPC_EXT_MASK         0xffff0000U
 #define X86EMUL_OPC(ext, byte)       ((uint8_t)(byte) | \
                                       MASK_INSR((ext), X86EMUL_OPC_EXT_MASK))
 /*
diff --git a/xen/lib/x86/cpuid.c b/xen/lib/x86/cpuid.c
index 07e5501914..a4ea579ebe 100644
--- a/xen/lib/x86/cpuid.c
+++ b/xen/lib/x86/cpuid.c
@@ -217,10 +217,10 @@ void x86_cpu_policy_fill_native(struct cpu_policy *p)
     }
 
     /* Extended leaves. */
-    cpuid_leaf(0x80000000, &p->extd.raw[0]);
+    cpuid_leaf(0x80000000U, &p->extd.raw[0]);
     for ( i = 1; i <= MIN(p->extd.max_leaf & 0xffffU,
                           ARRAY_SIZE(p->extd.raw) - 1); ++i )
-        cpuid_leaf(0x80000000 + i, &p->extd.raw[i]);
+        cpuid_leaf(0x80000000U + i, &p->extd.raw[i]);
 
     /* Don't report leaves from possible lower level hypervisor, for now. */
     p->hv_limit = 0;
@@ -421,7 +421,7 @@ int x86_cpuid_copy_to_buffer(const struct cpu_policy *p,
     /* Extended leaves. */
     for ( leaf = 0; leaf <= MIN(p->extd.max_leaf & 0xfffful,
                                 ARRAY_SIZE(p->extd.raw) - 1); ++leaf )
-        COPY_LEAF(0x80000000 | leaf, XEN_CPUID_NO_SUBLEAF, &p->extd.raw[leaf]);
+        COPY_LEAF(0x80000000U | leaf, XEN_CPUID_NO_SUBLEAF, &p->extd.raw[leaf]);
 
 #undef COPY_LEAF
 
@@ -521,7 +521,7 @@ int x86_cpuid_copy_from_buffer(struct cpu_policy *p,
             p->hv2_limit = l.a;
             break;
 
-        case 0x80000000 ... 0x80000000 + ARRAY_SIZE(p->extd.raw) - 1:
+        case 0x80000000U ... 0x80000000U + ARRAY_SIZE(p->extd.raw) - 1:
             if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
                 goto out_of_range;
 
diff --git a/xen/lib/x86/policy.c b/xen/lib/x86/policy.c
index a9c60000af..f033d22785 100644
--- a/xen/lib/x86/policy.c
+++ b/xen/lib/x86/policy.c
@@ -22,7 +22,7 @@ int x86_cpu_policies_are_compatible(const struct cpu_policy *host,
         FAIL_CPUID(7, 0);
 
     if ( guest->extd.max_leaf > host->extd.max_leaf )
-        FAIL_CPUID(0x80000000, NA);
+        FAIL_CPUID(0x80000000U, NA);
 
     /* TODO: Audit more CPUID data. */
 
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:37:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:37:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562282.878936 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXDr-00050S-Qm; Wed, 12 Jul 2023 10:37:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562282.878936; Wed, 12 Jul 2023 10:37:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXDr-00050E-Mq; Wed, 12 Jul 2023 10:37:27 +0000
Received: by outflank-mailman (input) for mailman id 562282;
 Wed, 12 Jul 2023 10:37:26 +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
 <SRS0=M0TT=C6=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qJXAW-00061z-SE
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:34:00 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9c701b74-209f-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:33:59 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.151.90])
 by support.bugseng.com (Postfix) with ESMTPSA id 4138E4EE0C8D;
 Wed, 12 Jul 2023 12:33:58 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9c701b74-209f-11ee-8611-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v3 11/15] xen/vpci: fix violations of MISRA C:2012 Rule 7.2
Date: Wed, 12 Jul 2023 12:32:12 +0200
Message-Id: <83741ce06872850e1e3126c1cab056ebc12b97ea.1689152719.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689152719.git.gianluca.luparini@bugseng.com>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v3:
- change 'Signed-off-by' ordering
- add 'uint32_t' casts in 'msi.c' and 'msix.c'

Changes in v2:
- minor change to commit title
- change commit message
---
 xen/drivers/vpci/msi.c  | 2 +-
 xen/drivers/vpci/msix.c | 2 +-
 xen/drivers/vpci/vpci.c | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/vpci/msi.c b/xen/drivers/vpci/msi.c
index 8f2b59e61a..bf5fe2f981 100644
--- a/xen/drivers/vpci/msi.c
+++ b/xen/drivers/vpci/msi.c
@@ -124,7 +124,7 @@ static void cf_check address_hi_write(
     struct vpci_msi *msi = data;
 
     /* Clear and update high part. */
-    msi->address &= 0xffffffff;
+    msi->address  = (uint32_t)msi->address;
     msi->address |= (uint64_t)val << 32;
 
     update_msi(pdev, msi);
diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 25bde77586..2090168f42 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -531,7 +531,7 @@ static int cf_check msix_write(
 
     case PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET:
         entry->updated = true;
-        entry->addr &= 0xffffffff;
+        entry->addr  = (uint32_t)entry->addr;
         entry->addr |= (uint64_t)data << 32;
         break;
 
diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index d73fa76302..3bec9a4153 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -319,7 +319,7 @@ static void vpci_write_hw(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
 static uint32_t merge_result(uint32_t data, uint32_t new, unsigned int size,
                              unsigned int offset)
 {
-    uint32_t mask = 0xffffffff >> (32 - 8 * size);
+    uint32_t mask = 0xffffffffU >> (32 - 8 * size);
 
     return (data & ~(mask << (offset * 8))) | ((new & mask) << (offset * 8));
 }
@@ -402,7 +402,7 @@ uint32_t vpci_read(pci_sbdf_t sbdf, unsigned int reg, unsigned int size)
         data = merge_result(data, tmp_data, size - data_offset, data_offset);
     }
 
-    return data & (0xffffffff >> (32 - 8 * size));
+    return data & (0xffffffffU >> (32 - 8 * size));
 }
 
 /*
@@ -427,7 +427,7 @@ static void vpci_write_helper(const struct pci_dev *pdev,
         data = merge_result(val, data, size, offset);
     }
 
-    r->write(pdev, r->offset, data & (0xffffffff >> (32 - 8 * r->size)),
+    r->write(pdev, r->offset, data & (0xffffffffU >> (32 - 8 * r->size)),
              r->private);
 }
 
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:37:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:37:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562257.878905 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXDn-0004Am-Kr; Wed, 12 Jul 2023 10:37:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562257.878905; Wed, 12 Jul 2023 10:37:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXDn-0004Ad-G1; Wed, 12 Jul 2023 10:37:23 +0000
Received: by outflank-mailman (input) for mailman id 562257;
 Wed, 12 Jul 2023 10:37:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=M0TT=C6=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qJXAb-0006Dd-EF
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:34:05 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9fa98df3-209f-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 12:34:04 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.151.90])
 by support.bugseng.com (Postfix) with ESMTPSA id 4CB734EE0737;
 Wed, 12 Jul 2023 12:34:03 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9fa98df3-209f-11ee-b239-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v3 15/15] xen: fix violations of MISRA C:2012 Rule 7.2
Date: Wed, 12 Jul 2023 12:32:16 +0200
Message-Id: <7a58c9341d10ef79e117ac35da048bbb088ec5d0.1689152719.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689152719.git.gianluca.luparini@bugseng.com>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type.

Fot the sake of uniformity, the following changes are made:
- add the 'U' suffix to all integer constants before the
  '?' operator in 'bitops.h'

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v3:
- change 'Signed-off-by' ordering
- change commit message
- fix in 'muldiv64.c'
- add changes to 'bitops.h' macros
- move 'cper.h' in a separate commit

Changes in v2:
- minor change to commit title
- change commit message
- add '(uint32_t)' in 'muldiv64.c' for consistency
- add fix in 'vesa.c'
---
 xen/common/gunzip.c          |  2 +-
 xen/common/xmalloc_tlsf.c    |  2 +-
 xen/drivers/char/ehci-dbgp.c |  4 ++--
 xen/drivers/video/vesa.c     |  2 +-
 xen/include/public/memory.h  |  2 +-
 xen/include/public/sysctl.h  |  4 ++--
 xen/include/xen/bitops.h     | 10 +++++-----
 xen/lib/muldiv64.c           |  2 +-
 8 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/xen/common/gunzip.c b/xen/common/gunzip.c
index 71ec5f26be..b810499be2 100644
--- a/xen/common/gunzip.c
+++ b/xen/common/gunzip.c
@@ -11,7 +11,7 @@ static unsigned char *__initdata window;
 static memptr __initdata free_mem_ptr;
 static memptr __initdata free_mem_end_ptr;
 
-#define WSIZE           0x80000000
+#define WSIZE           0x80000000U
 
 static unsigned char *__initdata inbuf;
 static unsigned int __initdata insize;
diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c
index 75bdf18c4e..c21bf71e88 100644
--- a/xen/common/xmalloc_tlsf.c
+++ b/xen/common/xmalloc_tlsf.c
@@ -46,7 +46,7 @@
 #define BHDR_OVERHEAD   (sizeof(struct bhdr) - MIN_BLOCK_SIZE)
 
 #define PTR_MASK        (sizeof(void *) - 1)
-#define BLOCK_SIZE_MASK (0xFFFFFFFF - PTR_MASK)
+#define BLOCK_SIZE_MASK (0xFFFFFFFFU - PTR_MASK)
 
 #define GET_NEXT_BLOCK(addr, r) ((struct bhdr *) \
                                 ((char *)(addr) + (r)))
diff --git a/xen/drivers/char/ehci-dbgp.c b/xen/drivers/char/ehci-dbgp.c
index bb9d3198d9..4d8d765122 100644
--- a/xen/drivers/char/ehci-dbgp.c
+++ b/xen/drivers/char/ehci-dbgp.c
@@ -375,12 +375,12 @@ static inline u32 dbgp_pid_write_update(u32 x, u32 tok)
     static u8 data0 = USB_PID_DATA1;
 
     data0 ^= USB_PID_DATA0 ^ USB_PID_DATA1;
-    return (x & 0xffff0000) | (data0 << 8) | (tok & 0xff);
+    return (x & 0xffff0000U) | (data0 << 8) | (tok & 0xffU);
 }
 
 static inline u32 dbgp_pid_read_update(u32 x, u32 tok)
 {
-    return (x & 0xffffff00) | (tok & 0xff);
+    return (x & 0xffffff00U) | (tok & 0xffU);
 }
 
 static inline void dbgp_set_data(struct ehci_dbg_port __iomem *ehci_debug,
diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c
index c41f6b8d40..b007ff5678 100644
--- a/xen/drivers/video/vesa.c
+++ b/xen/drivers/video/vesa.c
@@ -123,7 +123,7 @@ void __init vesa_init(void)
     if ( vlfb_info.bits_per_pixel > 8 )
     {
         /* Light grey in truecolor. */
-        unsigned int grey = 0xaaaaaaaa;
+        unsigned int grey = 0xaaaaaaaaU;
         lfbp.pixel_on =
             ((grey >> (32 - vlfb_info.  red_size)) << vlfb_info.  red_pos) |
             ((grey >> (32 - vlfb_info.green_size)) << vlfb_info.green_pos) |
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index c5f0d31e23..5e545ae9a4 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -234,7 +234,7 @@ struct xen_add_to_physmap {
 
     unsigned int space; /* => enum phys_map_space */
 
-#define XENMAPIDX_grant_table_status 0x80000000
+#define XENMAPIDX_grant_table_status 0x80000000U
 
     /* Index into space being mapped. */
     xen_ulong_t idx;
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 33e86ace51..fa7147de47 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -384,7 +384,7 @@ struct xen_sysctl_pm_op {
         struct xen_set_cpufreq_para set_para;
         uint64_aligned_t get_avgfreq;
         uint32_t                    set_sched_opt_smt;
-#define XEN_SYSCTL_CX_UNLIMITED 0xffffffff
+#define XEN_SYSCTL_CX_UNLIMITED 0xffffffffU
         uint32_t                    get_max_cstate;
         uint32_t                    set_max_cstate;
     } u;
@@ -547,7 +547,7 @@ struct xen_sysctl_numainfo {
 #define XEN_SYSCTL_CPUPOOL_OP_RMCPU                 5  /* R */
 #define XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN            6  /* M */
 #define XEN_SYSCTL_CPUPOOL_OP_FREEINFO              7  /* F */
-#define XEN_SYSCTL_CPUPOOL_PAR_ANY     0xFFFFFFFF
+#define XEN_SYSCTL_CPUPOOL_PAR_ANY     0xFFFFFFFFU
 struct xen_sysctl_cpupool_op {
     uint32_t op;          /* IN */
     uint32_t cpupool_id;  /* IN: CDIARM OUT: CI */
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index 4cd0310789..e926047932 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -227,11 +227,11 @@ static inline __u32 ror32(__u32 word, unsigned int shift)
 }
 
 /* base-2 logarithm */
-#define __L2(_x)  (((_x) & 0x00000002) ?   1 : 0)
-#define __L4(_x)  (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
-#define __L8(_x)  (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
-#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
-#define ilog2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x))
+#define __L2(x)  (((x) & 0x00000002U) ?   1                     : 0)
+#define __L4(x)  (((x) & 0x0000000cU) ? ( 2 + __L2( (x) >> 2))  : __L2( x))
+#define __L8(x)  (((x) & 0x000000f0U) ? ( 4 + __L4( (x) >> 4))  : __L4( x))
+#define __L16(x) (((x) & 0x0000ff00U) ? ( 8 + __L8( (x) >> 8))  : __L8( x))
+#define ilog2(x) (((x) & 0xffff0000U) ? (16 + __L16((x) >> 16)) : __L16(x))
 
 /**
  * for_each_set_bit - iterate over every set bit in a memory region
diff --git a/xen/lib/muldiv64.c b/xen/lib/muldiv64.c
index 78177ce616..a51cbc8767 100644
--- a/xen/lib/muldiv64.c
+++ b/xen/lib/muldiv64.c
@@ -27,7 +27,7 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)
     rh = (uint64_t)u.l.high * (uint64_t)b;
     rh += (rl >> 32);
     res.l.high = rh / c;
-    res.l.low = (((rh % c) << 32) + (rl & 0xffffffff)) / c;
+    res.l.low = (((rh % c) << 32) + ((uint32_t)rl)) / c;
 
     return res.ll;
 #endif
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:37:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:37:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562258.878909 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXDn-0004Co-UV; Wed, 12 Jul 2023 10:37:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562258.878909; Wed, 12 Jul 2023 10:37:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXDn-0004Bl-Pg; Wed, 12 Jul 2023 10:37:23 +0000
Received: by outflank-mailman (input) for mailman id 562258;
 Wed, 12 Jul 2023 10:37:22 +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
 <SRS0=M0TT=C6=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qJXAc-00061z-BS
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:34:06 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9edd3c6f-209f-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:34:03 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.151.90])
 by support.bugseng.com (Postfix) with ESMTPSA id F15154EE0C8F;
 Wed, 12 Jul 2023 12:34:01 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9edd3c6f-209f-11ee-8611-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v3 14/15] ACPI/APEI: fix violations of MISRA C:2012 Rule 7.2
Date: Wed, 12 Jul 2023 12:32:15 +0200
Message-Id: <9fa7f3b467b7efbe1c9f80269c4af942fbebea8d.1689152719.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689152719.git.gianluca.luparini@bugseng.com>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type.

For the sake of uniformity, the following changes are made:
- add the 'U' suffix to all first macro's arguments in 'cper.h'

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
---
Changes in v3:
- create this commit for 'cper.h'
---
 xen/include/xen/cper.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/xen/include/xen/cper.h b/xen/include/xen/cper.h
index f8e5272bc1..7c6a4c45ce 100644
--- a/xen/include/xen/cper.h
+++ b/xen/include/xen/cper.h
@@ -56,7 +56,7 @@ static inline uint64_t cper_next_record_id(void)
 #define CPER_SIG_RECORD				"CPER"
 #define CPER_SIG_SIZE				4
 /* Used in signature_end field in struct cper_record_header */
-#define CPER_SIG_END				0xffffffff
+#define CPER_SIG_END				0xffffffffU
 
 /*
  * CPER record header revision, used in revision field in struct
@@ -80,35 +80,35 @@ static inline uint64_t cper_next_record_id(void)
  * Corrected Machine Check
  */
 #define CPER_NOTIFY_CMC							\
-	UUID_LE(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4,	\
+	UUID_LE(0x2DCE8BB1U, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4,	\
 		0xEB, 0xD4, 0xF8, 0x90)
 /* Corrected Platform Error */
 #define CPER_NOTIFY_CPE							\
-	UUID_LE(0x4E292F96, 0xD843, 0x4a55, 0xA8, 0xC2, 0xD4, 0x81,	\
+	UUID_LE(0x4E292F96U, 0xD843, 0x4a55, 0xA8, 0xC2, 0xD4, 0x81,	\
 		0xF2, 0x7E, 0xBE, 0xEE)
 /* Machine Check Exception */
 #define CPER_NOTIFY_MCE							\
-	UUID_LE(0xE8F56FFE, 0x919C, 0x4cc5, 0xBA, 0x88, 0x65, 0xAB,	\
+	UUID_LE(0xE8F56FFEU, 0x919C, 0x4cc5, 0xBA, 0x88, 0x65, 0xAB,	\
 		0xE1, 0x49, 0x13, 0xBB)
 /* PCI Express Error */
 #define CPER_NOTIFY_PCIE						\
-	UUID_LE(0xCF93C01F, 0x1A16, 0x4dfc, 0xB8, 0xBC, 0x9C, 0x4D,	\
+	UUID_LE(0xCF93C01FU, 0x1A16, 0x4dfc, 0xB8, 0xBC, 0x9C, 0x4D,	\
 		0xAF, 0x67, 0xC1, 0x04)
 /* INIT Record (for IPF) */
 #define CPER_NOTIFY_INIT						\
-	UUID_LE(0xCC5263E8, 0x9308, 0x454a, 0x89, 0xD0, 0x34, 0x0B,	\
+	UUID_LE(0xCC5263E8U, 0x9308, 0x454a, 0x89, 0xD0, 0x34, 0x0B,	\
 		0xD3, 0x9B, 0xC9, 0x8E)
 /* Non-Maskable Interrupt */
 #define CPER_NOTIFY_NMI							\
-	UUID_LE(0x5BAD89FF, 0xB7E6, 0x42c9, 0x81, 0x4A, 0xCF, 0x24,	\
+	UUID_LE(0x5BAD89FFU, 0xB7E6, 0x42c9, 0x81, 0x4A, 0xCF, 0x24,	\
 		0x85, 0xD6, 0xE9, 0x8A)
 /* BOOT Error Record */
 #define CPER_NOTIFY_BOOT						\
-	UUID_LE(0x3D61A466, 0xAB40, 0x409a, 0xA6, 0x98, 0xF3, 0x62,	\
+	UUID_LE(0x3D61A466U, 0xAB40, 0x409a, 0xA6, 0x98, 0xF3, 0x62,	\
 		0xD4, 0x64, 0xB3, 0x8F)
 /* DMA Remapping Error */
 #define CPER_NOTIFY_DMAR						\
-	UUID_LE(0x667DD791, 0xC6B3, 0x4c27, 0x8A, 0x6B, 0x0F, 0x8E,	\
+	UUID_LE(0x667DD791U, 0xC6B3, 0x4c27, 0x8A, 0x6B, 0x0F, 0x8E,	\
 		0x72, 0x2D, 0xEB, 0x41)
 
 /*
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:37:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:37:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562237.878896 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXDk-0003tJ-D2; Wed, 12 Jul 2023 10:37:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562237.878896; Wed, 12 Jul 2023 10:37:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXDk-0003tC-8w; Wed, 12 Jul 2023 10:37:20 +0000
Received: by outflank-mailman (input) for mailman id 562237;
 Wed, 12 Jul 2023 10:37:19 +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
 <SRS0=M0TT=C6=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qJXAZ-00061z-Sl
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:34:03 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9e15446a-209f-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:34:02 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.151.90])
 by support.bugseng.com (Postfix) with ESMTPSA id 9949A4EE074E;
 Wed, 12 Jul 2023 12:34:00 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9e15446a-209f-11ee-8611-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Paul Durrant <paul@xen.org>,
	Wei Liu <wl@xen.org>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v3 13/15] x86/viridian: fix violations of MISRA C:2012 Rule 7.2
Date: Wed, 12 Jul 2023 12:32:14 +0200
Message-Id: <925b70ccf1140945d6a1e73263c84e3b6db12ec8.1689152719.git.gianluca.luparini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689152719.git.gianluca.luparini@bugseng.com>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
---
Changes in v3:
- create this commit for 'viridian.c' and 'hyperv-tlfs.h'
---
 xen/arch/x86/hvm/viridian/viridian.c         |  2 +-
 xen/arch/x86/include/asm/guest/hyperv-tlfs.h | 28 ++++++++++----------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 7405c117bc..61171e3363 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -291,7 +291,7 @@ static void enable_hypercall_page(struct domain *d)
      * calling convention) to differentiate Xen and Viridian hypercalls.
      */
     *(u8  *)(p + 0) = 0x0d; /* orl $0x80000000, %eax */
-    *(u32 *)(p + 1) = 0x80000000;
+    *(u32 *)(p + 1) = 0x80000000U;
     *(u8  *)(p + 5) = 0x0f; /* vmcall/vmmcall */
     *(u8  *)(p + 6) = 0x01;
     *(u8  *)(p + 7) = (cpu_has_vmx ? 0xc1 : 0xd9);
diff --git a/xen/arch/x86/include/asm/guest/hyperv-tlfs.h b/xen/arch/x86/include/asm/guest/hyperv-tlfs.h
index 38f997a0c8..a6915ad731 100644
--- a/xen/arch/x86/include/asm/guest/hyperv-tlfs.h
+++ b/xen/arch/x86/include/asm/guest/hyperv-tlfs.h
@@ -471,30 +471,30 @@ typedef struct _HV_REFERENCE_TSC_PAGE {
 
 /* Define hypervisor message types. */
 enum hv_message_type {
-	HVMSG_NONE			= 0x00000000,
+	HVMSG_NONE			= 0x00000000U,
 
 	/* Memory access messages. */
-	HVMSG_UNMAPPED_GPA		= 0x80000000,
-	HVMSG_GPA_INTERCEPT		= 0x80000001,
+	HVMSG_UNMAPPED_GPA		= 0x80000000U,
+	HVMSG_GPA_INTERCEPT		= 0x80000001U,
 
 	/* Timer notification messages. */
-	HVMSG_TIMER_EXPIRED			= 0x80000010,
+	HVMSG_TIMER_EXPIRED			= 0x80000010U,
 
 	/* Error messages. */
-	HVMSG_INVALID_VP_REGISTER_VALUE	= 0x80000020,
-	HVMSG_UNRECOVERABLE_EXCEPTION	= 0x80000021,
-	HVMSG_UNSUPPORTED_FEATURE		= 0x80000022,
+	HVMSG_INVALID_VP_REGISTER_VALUE	= 0x80000020U,
+	HVMSG_UNRECOVERABLE_EXCEPTION	= 0x80000021U,
+	HVMSG_UNSUPPORTED_FEATURE		= 0x80000022U,
 
 	/* Trace buffer complete messages. */
-	HVMSG_EVENTLOG_BUFFERCOMPLETE	= 0x80000040,
+	HVMSG_EVENTLOG_BUFFERCOMPLETE	= 0x80000040U,
 
 	/* Platform-specific processor intercept messages. */
-	HVMSG_X64_IOPORT_INTERCEPT		= 0x80010000,
-	HVMSG_X64_MSR_INTERCEPT		= 0x80010001,
-	HVMSG_X64_CPUID_INTERCEPT		= 0x80010002,
-	HVMSG_X64_EXCEPTION_INTERCEPT	= 0x80010003,
-	HVMSG_X64_APIC_EOI			= 0x80010004,
-	HVMSG_X64_LEGACY_FP_ERROR		= 0x80010005
+	HVMSG_X64_IOPORT_INTERCEPT		= 0x80010000U,
+	HVMSG_X64_MSR_INTERCEPT		= 0x80010001U,
+	HVMSG_X64_CPUID_INTERCEPT		= 0x80010002U,
+	HVMSG_X64_EXCEPTION_INTERCEPT	= 0x80010003U,
+	HVMSG_X64_APIC_EOI			= 0x80010004U,
+	HVMSG_X64_LEGACY_FP_ERROR		= 0x80010005U
 };
 
 /* Define synthetic interrupt controller message flags. */
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:42:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:42:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562314.878946 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXIW-0007dq-DW; Wed, 12 Jul 2023 10:42:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562314.878946; Wed, 12 Jul 2023 10:42:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXIW-0007dj-Am; Wed, 12 Jul 2023 10:42:16 +0000
Received: by outflank-mailman (input) for mailman id 562314;
 Wed, 12 Jul 2023 10:42:15 +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 <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJXIV-0007dd-1S
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:42:15 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20610.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::610])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c26f5df4-20a0-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:42:12 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by DBBPR04MB8059.eurprd04.prod.outlook.com (2603:10a6:10:1e9::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Wed, 12 Jul
 2023 10:42:10 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 10:42:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c26f5df4-20a0-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=XC+7q9BaTnQHb2vXQ3FojEcG+huQDz1g0E5WJyc5nfcGCQq0mmO9lbQbnmwMGBT2LkY2P9ZDBrgcAUufdOr7Mfe9cV7O0yGoUS84vlETa9TbbsHpPjJBAv0F8YcL0eheeSei0n/7eLNNYuKPKpiKhh3ytBAmj0TN0ZXeo5Z8awh6gmpP+Lk5LeC37b0uedMy4n6TZPgOoJGd+cqZQCb/7yGOnZkdEU/lkYQqUXo1+mnlNZpXURYUzKuaw+wSoIatpFIMQLhDlQVDkKZQrZcg4XoXIZG8gb4d47DuPhjkvAkecWsX4e4CbzTVKGjhDyII1eF01mTsz+pGIul2Jb2EQA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=CGIQzh1SUNfLLYTD++8e87ktMrg9m0u+487+hAjsAeA=;
 b=BA8sUaE4a+GEEMJ5aY3S9T22Sr+8+CSU6S12Ho38QG7uvPCocqRowsBH5mMrVZiYeNAPbQAf/hTIj/Ho3UF/FrvWHEDR/ajg3FQGEeiENn+YhKnPhzMDotZ+nmnRZv6dlYg7ENzhSTtKUfanH3/IV7bmfYk+0BEaMnB/lVrNZEyeurb+2/SEvD/CoDLxBob8z9Zw95eK0ozYcREXSTFbvzdevNY9vpz4mXUX37eQzDSXtqnouY9oTnyJyM5RyFIhlol1borJbqDaBiVtO2d/OtP6ITBCnAz0OFsRcL3Z/LeXB8DuGCDcB+Kg1dLUBTNcd2dDd3btwx+7ZrJ2GJeDwg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=CGIQzh1SUNfLLYTD++8e87ktMrg9m0u+487+hAjsAeA=;
 b=npU6tswNJ/wGjvGpKX80ALAQTp/GdnoX32DM2WjF6CBN2g0NXngfbcXSXfwK42o3JimozvlyAA0QXp6s9qG6Yb1r+46IbfPzYyNIlAm6+dCjJN9jTKc5R/Av8FiUUwKoReTPEUTBc7+uM/HtEPBy1uBh6O+HSIgWGhrEX5kKHxrKC6Fl37jtQxhX6DzciLwgcHTCPG8pensZqCXbKkD7v34FxtCO8r2zmu2hmHbf6ovq55TeIXOLI8plLlBs8HoexTGDIU1Nhqmmy5uxJwA2IfzX7nsG3im5muVOOGvQPbklCcc2eClAp6dNsTDFZbMdFXFBiNoNLWRGsBOhK5Q+XA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <feef360e-8da0-4ab4-c479-0fc908827a1b@suse.com>
Date: Wed, 12 Jul 2023 12:42:08 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v3 00/15] xen: fix violations of MISRA C:2012 Rule 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>,
 Paul Durrant <paul@xen.org>, Juergen Gross <jgross@suse.com>,
 Tamas K Lengyel <tamas@tklengyel.com>,
 Alexandru Isaila <aisaila@bitdefender.com>,
 Petre Pircalabu <ppircalabu@bitdefender.com>,
 George Dunlap <george.dunlap@citrix.com>, Michal Orzel
 <michal.orzel@amd.com>, Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <cover.1689152719.git.gianluca.luparini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0191.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ab::14) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DBBPR04MB8059:EE_
X-MS-Office365-Filtering-Correlation-Id: d2068178-5e59-4065-1617-08db82c4a564
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	9bqhxZ8JLmRIWTveWbTOenqErs56PGzrg5W9H5Fjk+PGvFf34AR0hTtA82b89DxSiupytTVU85ydR8QuQoYr3bK5upUXms3/rAcLPJfx2DswhHAOGu/c2jub6+kCEde6272t2qge4FGk8KNAWiBqq8u9fv9iCAi7muspMlE0Sd1CgiQ/jftJPwCQOT3uZ1yX3ZOTZfskP4OOM/I8smobT+v/yhaMejbw4T9cDG6iIXQRpNi+c+2W65De+DB0l0JhOneExfZpXkKx3vtCaH3p4pupe2qOHXPDH4yWiueB/LfiVSnlXmED/++2IsKRSE6e+6NBR0ICpbHrHKH6ZS5x3u64/e1N6DqSLzSyHt6auZXdRQ3mXfyKBwQwyhw/HpKwj9ldU2rrAy9/WvX+t2As7T/9h/+VJppPbuXeVUq5JXbI/X9EPvasRphVs1WYkB3XIMP8rcmW1ZcgtWauvti5s+YhtMTzgKaacgsnIGj5G9PhildhyStlWhn+RHOy79wWSjNi6YqK5fSK1Eg/0QnyqGT4rZman5KXZx3zV+cu13CF8JADa/W+HCoqC/+DXg0NSY81qrVt1UuoRlWYNd30Tn7qNAZ91uSXowUkLkqqY2hNiSpgR3Z+L506LBZ57lXjdAmNDazaa9pYkMv1TgGxKA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(376002)(136003)(39860400002)(346002)(451199021)(6486002)(478600001)(54906003)(8936002)(8676002)(5660300002)(36756003)(2906002)(86362001)(4744005)(7416002)(4326008)(6916009)(316002)(66476007)(66946007)(66556008)(38100700002)(41300700001)(26005)(53546011)(31696002)(6506007)(31686004)(186003)(2616005)(6512007)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?b3NLMjM2VDN5Y2xjTm83cGp2b0w5WXR2YzIrR2NuSURXNWRQTTc3cUpDL3FE?=
 =?utf-8?B?V2JsL1ZFQUQyb1pKUDBBMjRRMDk1RnY0cmpSS3BydjRaRk81ZnRuMUFLaitC?=
 =?utf-8?B?eVg5Y3FTT2s5RjdLekFTc21TV29vd1RRSUwrdm5pK1c1TlR4T2lqN1kzVXdE?=
 =?utf-8?B?NnhUQzRTZWVpb015MGsrRStCb0RmOTNJTUdPeGJpZklsRkdNSHQzWnJxUWdr?=
 =?utf-8?B?djIwYlVRUEV2UmZxaFo2eUxpQzFQTEg3N3g2Zmxic2NaUXdXMmhuQ3FJb3l4?=
 =?utf-8?B?SFF3SW42MDBCUnJXYkoxS29XRlBwQXZyTElIZkFQOXhvU0p0WThBV0VXdGFt?=
 =?utf-8?B?YkxVbWhhL2YzZE8rU0lUTkRBRkFHaDdhdndDS1VtT0ZRMjFhTEx5OE1VOGt0?=
 =?utf-8?B?dnhlWmlrWlFvWllFQ1ZJRUIvQlNDU01KeEdiNXpVSVY1RGtCREs0akZ6T3c1?=
 =?utf-8?B?bWh5VlBqYWtjYlZNc3htUFErNDVaSDFBSzd2Um42TGRFT0Y1UV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exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 10:42:10.4368
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: /NOJIMp/ns+Ne1LcNL8IibLbVMGY8shw2fOyyCR+IlzsFTaNGpX7DZSyOP9ePCbWDSyyJOfoT4vQderxjFxwdw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB8059

On 12.07.2023 12:32, Simone Ballarin wrote:
> Changes to macros 'X86_CR0_PG' and 'MSR_EFER' in files
> "xen/arch/x86/include/asm/x86-defns.h" and "xen/arch/x86/include/asm/msr-index.h"
> are not made since they are used also in assembly files.

I guess I overlooked this in earlier versions. There's no need to skip
such headers. You just can't attach U unconditionally; you need to use
_AC() (from xen/const.h), as msr-index.h already does in certain places.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:45:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:45:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562319.878956 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXLb-0008F8-S1; Wed, 12 Jul 2023 10:45:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562319.878956; Wed, 12 Jul 2023 10:45:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXLb-0008F1-Of; Wed, 12 Jul 2023 10:45:27 +0000
Received: by outflank-mailman (input) for mailman id 562319;
 Wed, 12 Jul 2023 10:45:26 +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 <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJXLa-0008Em-2V
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:45:26 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on0603.outbound.protection.outlook.com
 [2a01:111:f400:fe02::603])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 34a25579-20a1-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:45:24 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM7PR04MB6949.eurprd04.prod.outlook.com (2603:10a6:20b:102::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Wed, 12 Jul
 2023 10:45:21 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 10:45:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 34a25579-20a1-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=UWlaQxnHpy6xwcyMkDwf5UIH+yd1ijD3xPDcSY4CH065kG4WTr4P307OC1DzlYRpVlF1jNvBwgho8XoCHQVsdkiu7gay2aJor7EtbIRDv8gQ8aIkNfkY9clDb4Qa7q9qKfhUFHPC3h1+N2tSN3ScBCehlqPEHAx6OsxnHB0UAPhhJomHdjS4dtT3fERL+4spINQrm0QggyKMTFL5VyucU3bNjuvEy/HHDINwZOPo4qn0EQZLKrSQch/fzKCtBXHd8YWNkdTAE4DFMb5D90cHc8yTWGZ8IwSqVdqQx+qIAg+OsbQqE+4VIQSo+243bgPUTyKR4oPJt07z4FDk4mduRQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+JPKHRKtLk0O0yYloJPncdmyXePya+s7YKuYK36KxW8=;
 b=QShToUUQXe0TlEPCcqKMu5wW/XzC5VTzW7D1m1noJGOxQgLKRphl8HgvUhDRLfXf/useUhb90FE8IsRVXx/L00YFjTvrapvf3nF0EZpf593dokMtcbLsrs67ioDB2uNdWL8JWDEBC+tCV6FXApHR5rus6pJC4TE36aA/t+GzIo684p7jjYX/7ullSwUKplicVOisMSlza3EeOBcpqtYWO/Q2m1or5m5qiagqkPB45ebTvQQVdmDh9BIzOWeQdqpsYTA7LUrRmYnJlikTL3sVjBXXmhWg00RZI2igI85CvuBsX0Ld6/Zrxo15gaYtPwVts0bIZqAtc8zn2q/QeppfwA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+JPKHRKtLk0O0yYloJPncdmyXePya+s7YKuYK36KxW8=;
 b=Kpi/e8sT78T5y+RVcd0+x95IJ7p5nZeVBPAl9DvfE4E2XlfKhKFbBxqYOcYIkdwtDJQCN0ANcq4WY86014AcUYvlYIZz3KcNHBDm9+ybI7+FcijzG7tXYS1Dyuo/GyZwW8BD++B5lXY4B4irzvLV/l9oK7arTBxdTA566MVtoUKbSoWAq0kbvFxy278XjYUS3h68jJ49cbD/IZavjAyNPd79C/iZMfEvybr6Tf5iAewUkreuxvHf6TJoQQ+sJ/7tdS1BQjM7onixORjESMkT/SP+rEH4YXYbB9UfkG+vD5p+V74Wp9vznwrN0o1MJM9ynFgavflLN8LyomVUuXf6DQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3802a61b-13a5-870c-7f33-8ed6687e82e4@suse.com>
Date: Wed, 12 Jul 2023 12:45:19 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v3 03/15] x86/svm: fix violations of MISRA C:2012 Rule
 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
 <b63ed0674f467d532afe4b57c833b446b2e29a90.1689152719.git.gianluca.luparini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <b63ed0674f467d532afe4b57c833b446b2e29a90.1689152719.git.gianluca.luparini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0049.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:92::9) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM7PR04MB6949:EE_
X-MS-Office365-Filtering-Correlation-Id: d036e107-ff64-46af-9b5d-08db82c51772
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	R0ycQg/rKGMdFCZo1ee+DN9Vp++nv7MbrZs5trxz0gz2h0uBSNyye67GQtvbM4NydBrTiuhp/ceXfCGMzDKFMOR06gFgoq3cYYMIK55/pf48Ww56SCqN4UPLPwkAKaKltfsisw89wo+30sgvIhoe6LLuBSDML2tUhvCGrjjSrkIIjSHeTa620soX9kJ2sy7os7kKR5Ysb2BG+Ud52/ybBMJJpceUQ1tXHqKIDUaDpAGeemOLbWW0Kr71/spuwDlBKttbhDFXiESwyu+3+bmJwOC4bDBUc7ic1SC1NVaJF17BpwV15bs/SkW2pO1uZp7zMucW6BNLrfy4HfciuPeGAt0jWOzrAB3YY+PbVtDRMz7FEf1W1JQMZtSOcSF7sE22ilNzfkgPflPzKK0HpjwW4Tkw+4n8NJK4Jmw0S1o7R+uvQ0VlTCa0mufZ3hfy9q9QcU6Fl71juoRR4u9FGlzT1PJZkcNftsZnWHLBzjkGtgT1w+JG1bgwX/uEXMbZ+8BRBys9xsBwOsYveDSgyu5DrqCkNJ0Un79RC9fK/mWrM79wOF2WVO/Am9TVAx2CcfXs2zidhgooEFNReY52BEO9ThM/SgaZh7RCYJzsaSe51YzdEJcBChyrrpUxk91KCTFOmjfcXEPzxPJyvC9JzzIElA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(396003)(376002)(366004)(136003)(39860400002)(451199021)(478600001)(31696002)(186003)(6506007)(86362001)(26005)(5660300002)(8936002)(7416002)(8676002)(53546011)(41300700001)(6486002)(38100700002)(66556008)(66476007)(4326008)(6916009)(66946007)(2906002)(4744005)(83380400001)(31686004)(36756003)(2616005)(54906003)(316002)(6512007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZnZWZzV1d1JvcjRUb2JzdVFnbW5UN0VrUzVrVTVBcWpPN042eldSM00xR2k1?=
 =?utf-8?B?cWx1U3N0azk5Tms0Nk5DNXFWWkVJVDRpOEpnblltNTV2c00wMUg1cnloNGMy?=
 =?utf-8?B?YWNiQTJBQ0QvZ1hrUFd6aXl3THQ1RGw3VzJmZ1IrU2gyM2hsUkU4MExkeFFv?=
 =?utf-8?B?T2piREwvS1MwMHcyL1J1OEc4ZXZVVUpjMHBvaXROU2xCYUFqbnRIa3AxRVA2?=
 =?utf-8?B?RlJKUXk2OC9Kd2lDODFyRDZ3WUJJNm5ycFdQd0FVMlVSQnFPYTdaRjFnTm96?=
 =?utf-8?B?NEhUeEo5U2hLbndMZTUyRkxQOWNmdmJKcUtzdGZwYmloWEdDbEQxYzQ5c2xP?=
 =?utf-8?B?R3czQ2hqTi8zY1diNWtxR1llcFRqSzBKZ210VDBJdFZmVlpQbjZXVjZQYUhu?=
 =?utf-8?B?eGVhSG5ydDM5MktmUXFDeWJ2bEZEVlkzNWpnTVExQTRZQ0IrbWwyd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uthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 10:45:21.8687
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 6/NwCsrOt7Ww5zrptmlUCx0lIsWCfJpv26KBQ02OTC//75ZZTFy0+TNKspsTziuvKLzQJuFFiPMNfADo9JkfZg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6949

On 12.07.2023 12:32, Simone Ballarin wrote:
> --- a/xen/arch/x86/hvm/svm/asid.c
> +++ b/xen/arch/x86/hvm/svm/asid.c
> @@ -16,7 +16,7 @@ void svm_asid_init(const struct cpuinfo_x86 *c)
>  
>      /* Check for erratum #170, and leave ASIDs disabled if it's present. */
>      if ( !cpu_has_amd_erratum(c, AMD_ERRATUM_170) )
> -        nasids = cpuid_ebx(0x8000000A);
> +        nasids = cpuid_ebx(0x8000000AU);

When resubmitting it would be really nice if you made changes that earlier
on were indicated could otherwise be done while committing.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:48:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:48:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562333.878965 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXOD-0000QS-9k; Wed, 12 Jul 2023 10:48:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562333.878965; Wed, 12 Jul 2023 10:48:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXOD-0000QL-73; Wed, 12 Jul 2023 10:48:09 +0000
Received: by outflank-mailman (input) for mailman id 562333;
 Wed, 12 Jul 2023 10:48:07 +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 <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJXOB-0000QD-Nl
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:48:07 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0619.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::619])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 94c1bf1d-20a1-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:48:05 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM7PR04MB6949.eurprd04.prod.outlook.com (2603:10a6:20b:102::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Wed, 12 Jul
 2023 10:48:04 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 10:48:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 94c1bf1d-20a1-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Lk5i5eAOTlRyVHKvCDTDEv3kn4EWsObjttgoyP99yArNHpHHt8CyNEqg4rPFeRpgGM/6hC0rd20q/927NXUZ7d98v6xM/eOvmJvNHSD2ZgpOwiVp/gQ+ZlBNCDEP/Fp2lZmkidcKuiBpmPDsfk+Rgff3NcvBKc5jCow/dHchAqxkUDAiF6MdcMPeC7P+SNx8ol0hEisRhvzHV5b2bO1ebxly3b5GF8qeQkDD7yTV3XV2qOZRHuEzFhn4Tf8U+FBikGxq25HqVGGaSlv73xMgIl0a9cdeWKnuzpsSBQ8iwSboNbQqAtXJUUDHMV16BPfqccDwCdp05/miFGHCcaZ3mQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=d28IX6SUR1otnle9UfRUzrwIC6qGz98aNQ8xAMS7yi8=;
 b=FCc70OjyCXEV4oGWPtQRztJhNfG9HE56crCuhIriIBytQgSVVDirCMhQ77qpbQqCmo2Q4T7ro5MiWKfwH/RWIUn550gWASkWnZr8gPlAPEN6wDYNgmuNN+XBsQF88quqREt4E7KJx+UuuDqyURzNeALkKxwdSPCXAX1goE4Mk5pozE6UKb7VHOSLpXWuQTRoKUd++W+mCWh0Ptt9siumF5m5dHFqFDitCcl1EYcBGh5uzOWyi6iT8rh82dL5vSg7CFlUDwjqa7DB6p2m1T/dAWuWPaja+4dwhSePqUYv5gCJAieN5bC4c7DxnE868DhAEnAFFSa3qGAbDAIYbHWFyw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=d28IX6SUR1otnle9UfRUzrwIC6qGz98aNQ8xAMS7yi8=;
 b=Lx2n132BU3MAAKp1XFUSCcDCk29ySGR+Yg+xUSZk5+dMTi4R5Vuv+r1cUs/zBX5k7zZY9OqiRBHb0vRzQ0XX5H5fd0adAYk14Hqe0MEaoz9SawIQfIdkmHmhkpu+UdaLSsK0ioSXDB6UBHoz22/FhGKqbyIjZ7oaUM7XoT9uV8rQNURBLbNmlG2yDFZ9knzS1Z68JDYHejOIwq3M1ZDzjGCimJee+wfXN1abYpDoaB51+zFv31L+ybkTheEG3yOtdL+VZ1pPj1pl8MFW3WUlEbDMbSBOMh9ptm+KRuWXpfXhQ7mU5rbTutYKHGByUmtxv4du/vYIS84lw0xOYNwrPw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <4b15f6ed-e411-1ec4-d53b-afccc2194ede@suse.com>
Date: Wed, 12 Jul 2023 12:48:02 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v3 06/15] xen/efi: fix violations of MISRA C:2012 Rule
 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 Luca Fancellu <luca.fancellu@arm.com>, xen-devel@lists.xenproject.org
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
 <4e53fc8fc5c3512a521311220375ba8542ae0e5f.1689152719.git.gianluca.luparini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <4e53fc8fc5c3512a521311220375ba8542ae0e5f.1689152719.git.gianluca.luparini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0118.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9d::10) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM7PR04MB6949:EE_
X-MS-Office365-Filtering-Correlation-Id: 0d4a0a93-6aee-49eb-85fe-08db82c57817
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	e2XIv6QRZHRJMKRSPol/l+VepOpXQ4lbzt1w/LovNveH6pW7YEqZJzq+KrKel2VX7KglCAUwrhjR4K3+UgJPG2g/qkLBiPtVrNRlC+Z7ORVXyRvhbgrx/sGqZwHxjR1yEyih0Y5o+i0inYtruPHKXQP03+0vPo+axhFoFfAgvthKMZlL7ZpsWafQgCekLChMT0rc+vrfk1eR/rETMKwYDENNKfA7PYR5GgN9dsW1Jsr95qpeNnNuRfWgRcrqJ4EeTrPdcErpjud05EXsR69aggdouLVJp+KliWYhRx7BWPeHXFDBD5vS/J6LNxGUFHBHLrvGkjUfHPzsJsoSdtOuJvgXVHuseu3f0qYRmKdq+ELlrn+6cOPmjgPxjm92xEh2stX+0BpgFpodmMLha90Nw3VazzPSjj612pPCopraXDyb1AMr770S/yfVBAjJK0EJMwoy0PEAt4WSIsMvDgTywd05mYBRlfhn8ZGubpXeUJmSB3oMpJr1PJw9KPhnY+TWs47Kq/gWtki5uHIjAqUNTV7VCNQ9S1oNFLt0eOyXD8ThFgRknYK1WPhYQrvoKKlsbkxZlewf6ucQm1D2Tq+KUeDVlKk/R8bAFk1fN6uT5QuRAQqMfKO2WnkK9ACvq3FGHsFOPRDEint4ofhSNddS1g==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(396003)(376002)(366004)(136003)(39860400002)(451199021)(478600001)(31696002)(186003)(6506007)(86362001)(26005)(5660300002)(8936002)(8676002)(53546011)(41300700001)(6486002)(38100700002)(66556008)(66476007)(4326008)(6916009)(66946007)(2906002)(4744005)(31686004)(36756003)(2616005)(54906003)(316002)(6512007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VDdCdHNSVmE2U0MwRE8zRGo3WFNid1htakJra1A1a2kxbXRBR1ZrNkVjMEVN?=
 =?utf-8?B?MG1LZVIxczJ3cExTU3NsR2RxNnBheU1mNVEwR0RCR1I1ekg4dVVScjA3ekUx?=
 =?utf-8?B?N0hsQ0dPSW1FT0o1NTQwZU1rYkErNnNLdW4vamtFZTROZDNMTmRPRTJ4YmQw?=
 =?utf-8?B?bEYwQUpjY0kvZ3JKeUFrOHB6Nnl3Yzc2WVJSWlR1WjJ4QlRsWTIxMnVaNUFQ?=
 =?utf-8?B?NktsMmxNa2dJNmJ3RDE2UE0yQ2ZMTVptZzh3M1FGZHNJM2tKNnRxdE5WRjJH?=
 =?utf-8?B?SWwybG1nTG9pbnlFTjluU1VONzNhSFo3dzlpTmJSYWtOV200Qm4wanVJcEpQ?=
 =?utf-8?B?bkg5UzRZcjB4endPREtONU9xbkdXUUdwanUyQlNT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SQDYs0ut2c?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0d4a0a93-6aee-49eb-85fe-08db82c57817
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 10:48:03.8774
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: x8L8RlfhqRGTumbLrIdwEzpPnvG4zT0Hor9Au3uM/LxvxyHAwekkTVnyWK05Is16g0v5o3gFAwX6TeiGkbAIUg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6949

On 12.07.2023 12:32, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type.
> 
> For the sake of uniformity, the following changes are made:
> - add the 'U' suffix to all first macro's arguments in 'boot.c'
> - add the 'U' suffix near '0x3fffffff' in 'runtime.c'
> 
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Acked-by: Jan Beulich <jbeulich@suse.com>



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:49:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:49:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562323.878976 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXOy-00010T-PN; Wed, 12 Jul 2023 10:48:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562323.878976; Wed, 12 Jul 2023 10:48:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXOy-00010M-Ly; Wed, 12 Jul 2023 10:48:56 +0000
Received: by outflank-mailman (input) for mailman id 562323;
 Wed, 12 Jul 2023 10:47:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=STpc=C6=amd.com=Christian.Koenig@srs-se1.protection.inumbo.net>)
 id 1qJXNF-0000ML-HH
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:47:09 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on20600.outbound.protection.outlook.com
 [2a01:111:f400:7eae::600])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 71de438a-20a1-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 12:47:07 +0200 (CEST)
Received: from BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13)
 by BL1PR12MB5349.namprd12.prod.outlook.com (2603:10b6:208:31f::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Wed, 12 Jul
 2023 10:47:02 +0000
Received: from BN8PR12MB3587.namprd12.prod.outlook.com
 ([fe80::669f:5dca:d38a:9921]) by BN8PR12MB3587.namprd12.prod.outlook.com
 ([fe80::669f:5dca:d38a:9921%4]) with mapi id 15.20.6588.017; Wed, 12 Jul 2023
 10:47:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 71de438a-20a1-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=i9y9F3bK8eZ2iRf+lGql5tA04nNtMrc/oKqP5W355vVcaTSVXifcq0zjtO9N6UDoGXtLNvbIKv6V9q6Wr/qNxDGRUhrcOlyKZG7eb+Fg5IRtNLnE77K8gF6w2OoNHQEazCzpfD8qcgZ3m5dhf+hZzpn0V9KKQ+nBLxfHbA7ZO6UGDkitod/BTN431/tQe+cw+dG1gECFQ5tAs8jTpx8kunEJCv1V34oGHQB330NfDBf9+Yrx4KP0MjKwMXG/xlWI0+I3HGgyb+zyDfQwPq4ijOblSkQRobgPowde3FQIh3jKeT7t944yOeNunVqRd5gj4Tw3Tqyao0/lBOBqHleRlw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=jtiXEW1wD2EK6Q02eAsJIMpx8KRKJYL0nEclxMsyTSg=;
 b=naFtHbvNX/8ipT88UW6vtBqJjkVey/c2feinkWKKNlbfWVi/4tfISb/bz8n+ltwoKfjH8KA3s03NoWCnJTb1L0fml8gfwUpmJtKbpf3nMnhNz8UJV2b1T9ij9+6O3nO3yFtBfkVzg9sbc9UnvdTSFmjGB5bDWZ0AKJCQDl6KEEVFC2+bdK9bwnLZ4QEjz+r106db++Lg5HEV9jbjzk1gU5MrJGiKOfYuiaF9n6Fk7h27mPCER3MOqi9tlO38NEp39BmT+svixzfbSTWT8C2FXKOAlqMGwxzyRX5XE9oZFtyI2L0viDJQMaAMoqJgiAZs6ba8o47MeMXemw8MWxpnpw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=jtiXEW1wD2EK6Q02eAsJIMpx8KRKJYL0nEclxMsyTSg=;
 b=HclMOfeK57hRWyLK9HHoLORteEMFDGP1Bf5OE9Lgz31+9wtLUA4TMmlxu2C1+sFxYh9cTPh/4qxS111lQOQXwFATkn8k1HKYDTUEa3mvkBAwd0V7H9MYVlfGlMeMzznJI7udvHomoFW+av7E5FThBQvDyDMklRWPlxN1xqOwYc8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <94eb6e4d-9384-152f-351b-ebb217411da9@amd.com>
Date: Wed, 12 Jul 2023 12:46:33 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
Content-Language: en-US
To: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= <u.kleine-koenig@pengutronix.de>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
 Alex Deucher <alexander.deucher@amd.com>, "Pan, Xinhui"
 <Xinhui.Pan@amd.com>, Harry Wentland <harry.wentland@amd.com>,
 Leo Li <sunpeng.li@amd.com>, Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
 Hamza Mahfooz <hamza.mahfooz@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Guchun Chen <guchun.chen@amd.com>,
 Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
 Evan Quan <evan.quan@amd.com>, Likun Gao <Likun.Gao@amd.com>,
 =?UTF-8?B?TWFyZWsgT2zFocOhaw==?= <marek.olsak@amd.com>,
 David Francis <David.Francis@amd.com>, Hawking Zhang
 <Hawking.Zhang@amd.com>, Graham Sider <Graham.Sider@amd.com>,
 Lang Yu <Lang.Yu@amd.com>, Philip Yang <Philip.Yang@amd.com>,
 Yifan Zhang <yifan1.zhang@amd.com>, Tim Huang <Tim.Huang@amd.com>,
 Zack Rusin <zackr@vmware.com>, Sam Ravnborg <sam@ravnborg.org>,
 Jani Nikula <jani.nikula@intel.com>, xurui <xurui@kylinos.cn>,
 Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
 =?UTF-8?Q?Ma=c3=adra_Canal?= <mairacanal@riseup.net>,
 =?UTF-8?Q?Andr=c3=a9_Almeida?= <andrealmeid@igalia.com>,
 Qingqing Zhuo <qingqing.zhuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>, Hersen Wu
 <hersenxs.wu@amd.com>, Fangzhi Zuo <jerry.zuo@amd.com>,
 Stylon Wang <stylon.wang@amd.com>, Alan Liu <haoping.liu@amd.com>,
 Wayne Lin <Wayne.Lin@amd.com>, Aaron Liu <aaron.liu@amd.com>,
 Melissa Wen <mwen@igalia.com>, Bhawanpreet Lakha
 <Bhawanpreet.Lakha@amd.com>, David Tadokoro <davidbtadokoro@usp.br>,
 Wenjing Liu <wenjing.liu@amd.com>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 Mario Limonciello <mario.limonciello@amd.com>,
 Alexey Kodanev <aleksei.kodanev@bell-sw.com>, Roman Li <roman.li@amd.com>,
 =?UTF-8?Q?Joaqu=c3=adn_Ignacio_Aramend=c3=ada?= <samsagax@gmail.com>,
 Dave Airlie <airlied@redhat.com>, Russell King <linux@armlinux.org.uk>,
 Liviu Dudau <liviu.dudau@arm.com>, Joel Stanley <joel@jms.id.au>,
 Boris Brezillon <bbrezillon@kernel.org>,
 Nicolas Ferre <nicolas.ferre@microchip.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 Claudiu Beznea <claudiu.beznea@microchip.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Stefan Agner <stefan@agner.ch>, Alison Wang <alison.wang@nxp.com>,
 Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
 =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= <noralf@tronnes.org>,
 Xinliang Liu <xinliang.liu@linaro.org>, Tian Tao <tiantao6@hisilicon.com>,
 Danilo Krummrich <dakr@redhat.com>, Deepak Rawat <drawat.floss@gmail.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
 =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= <ville.syrjala@linux.intel.com>,
 Lucas De Marchi <lucas.demarchi@intel.com>,
 Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
 Andrzej Hajda <andrzej.hajda@intel.com>,
 Matt Roper <matthew.d.roper@intel.com>,
 Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
 Hans de Goede <hdegoede@redhat.com>, Luca Coelho <luciano.coelho@intel.com>,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 Kai Vehmanen <kai.vehmanen@linux.intel.com>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 =?UTF-8?Q?=c5=81ukasz_Bartosik?= <lb@semihalf.com>,
 Anusha Srivatsa <anusha.srivatsa@intel.com>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
 Uma Shankar <uma.shankar@intel.com>, Imre Deak <imre.deak@intel.com>,
 Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
 Swati Sharma <swati2.sharma@intel.com>,
 =?UTF-8?Q?Jouni_H=c3=b6gander?= <jouni.hogander@intel.com>,
 Mika Kahola <mika.kahola@intel.com>,
 =?UTF-8?Q?Jos=c3=a9_Roberto_de_Souza?= <jose.souza@intel.com>,
 Arun R Murthy <arun.r.murthy@intel.com>,
 Gustavo Sousa <gustavo.sousa@intel.com>,
 Khaled Almahallawy <khaled.almahallawy@intel.com>,
 Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
 Andi Shyti <andi.shyti@linux.intel.com>, Nirmoy Das <nirmoy.das@intel.com>,
 Fei Yang <fei.yang@intel.com>, Animesh Manna <animesh.manna@intel.com>,
 Deepak R Varma <drv@mailo.com>, "Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
 Vandita Kulkarni <vandita.kulkarni@intel.com>,
 Suraj Kandpal <suraj.kandpal@intel.com>,
 Manasi Navare <manasi.d.navare@intel.com>,
 Drew Davenport <ddavenport@chromium.org>,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>,
 Philipp Zabel <p.zabel@pengutronix.de>, Marian Cichy
 <m.cichy@pengutronix.de>, Dan Carpenter <error27@gmail.com>,
 Paul Cercueil <paul@crapouillou.net>,
 Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
 Edmund Dea <edmund.j.dea@intel.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Linus Walleij <linus.walleij@linaro.org>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>, Rob Clark <robdclark@gmail.com>,
 Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Vinod Polimera <quic_vpolimer@quicinc.com>,
 Jiasheng Jiang <jiasheng@iscas.ac.cn>,
 Konrad Dybcio <konrad.dybcio@linaro.org>,
 Jessica Zhang <quic_jesszhan@quicinc.com>, Liu Shixin
 <liushixin2@huawei.com>, Marek Vasut <marex@denx.de>,
 Ben Skeggs <bskeggs@redhat.com>, Karol Herbst <kherbst@redhat.com>,
 Lyude Paul <lyude@redhat.com>, Tomi Valkeinen <tomba@kernel.org>,
 Emma Anholt <emma@anholt.net>, Gerd Hoffmann <kraxel@redhat.com>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>,
 Geert Uytterhoeven <geert+renesas@glider.be>,
 Biju Das <biju.das.jz@bp.renesas.com>, Sandy Huang <hjc@rock-chips.com>,
 =?UTF-8?Q?Heiko_St=c3=bcbner?= <heiko@sntech.de>,
 Orson Zhai <orsonzhai@gmail.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>,
 Alain Volmat <alain.volmat@foss.st.com>,
 Yannick Fertre <yannick.fertre@foss.st.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Philippe Cornu <philippe.cornu@foss.st.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>, Chen-Yu Tsai
 <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>,
 Samuel Holland <samuel@sholland.org>,
 Thierry Reding <thierry.reding@gmail.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Jyri Sarha <jyri.sarha@iki.fi>,
 David Lechner <david@lechnology.com>,
 Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
 Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
 Melissa Wen <melissa.srw@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Michal Simek <michal.simek@amd.com>
Cc: dri-devel@lists.freedesktop.org, kernel@pengutronix.de,
 amd-gfx@lists.freedesktop.org, Andrew Jeffery <andrew@aj.id.au>,
 linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
 Alim Akhtar <alim.akhtar@samsung.com>, linux-samsung-soc@vger.kernel.org,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 Sumit Semwal <sumit.semwal@linaro.org>, Yongqin Liu
 <yongqin.liu@linaro.org>, John Stultz <jstultz@google.com>,
 linux-hyperv@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 Lucas Stach <l.stach@pengutronix.de>, Fabio Estevam <festevam@gmail.com>,
 NXP Linux Team <linux-imx@nxp.com>, linux-mips@vger.kernel.org,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 linux-mediatek@lists.infradead.org, Jerome Brunet <jbrunet@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-amlogic@lists.infradead.org, Sean Paul <sean@poorly.run>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, virtualization@lists.linux-foundation.org,
 spice-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org,
 linux-rockchip@lists.infradead.org,
 linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev,
 linux-tegra@vger.kernel.org, Gurchetan Singh <gurchetansingh@chromium.org>,
 Chia-I Wu <olvaffe@gmail.com>, Haneen Mohammed <hamohammed.sa@gmail.com>,
 VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
 xen-devel@lists.xenproject.org
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
From: =?UTF-8?Q?Christian_K=c3=b6nig?= <christian.koenig@amd.com>
In-Reply-To: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0084.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9b::11) To BN8PR12MB3587.namprd12.prod.outlook.com
 (2603:10b6:408:43::13)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN8PR12MB3587:EE_|BL1PR12MB5349:EE_
X-MS-Office365-Filtering-Correlation-Id: bbe76e35-279b-4ed7-d359-08db82c55318
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	V27m7ouus2JdRMtlqLdd/n247ZrMuKZDwr4JBTL1QCGI4Lx5ekLb2Uc+Nuniho2hNO8hFTqjEenhlZl6pI+0PL87b9htT67aAjQbw7DUiaTjH8PDUTlOcRrFNJ0y7xGIuURiAv+JP8WqKPUFWAs9ZiHI/1t09QdN93+qnREtJQfv0/nC1P4MSocvDFShLk1L8j7s3RbdRzXGu262TmccL6yKC50SIpTN1aExZ4Nc/n7p/0JYtVL9mp8TbEVauOMv8a5uzipSjT2Z9wqJagncH5TEaQZIpa9cHZd8qZL40RExWbGxmx7/Tqr9z7gXSD9nC6QsQ3cWrpAjMDNda0ZFgh6CfFgHjCG4IGM/y5xhhJV0Nu1Y24fi9laQoX8DcAmotse07Zls8LDtF1L8uToWR0tq+HAY9z7RygxVbI74ztj5OJm8powLgRORs8hZIrkYjPMSQwpwFqd+RRuVmvbAE5qGqmVA+FIAbKcpmzTcO05fkBJqAlTsRI9NANTbAo0VJJxMX8aZK1CTQGLkQhNGvrZQ36i50x7oBrQbyuYxqdJ88MMlQ/HjDV3RsXU4AvQxU1pJx+DyS+5rsikhPA5zCwGEmyvlPNYJX6DJK7gDrjCm7yBVw+AY5Ox5jSnSp9D0CaJ7eig4bOom+UDc0MmZV9ZFNc9ZkZ75xC0a964hlQ4=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR12MB3587.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(39860400002)(346002)(376002)(136003)(451199021)(31686004)(4326008)(6636002)(6486002)(1191002)(6666004)(478600001)(66476007)(36756003)(66556008)(41300700001)(316002)(54906003)(66946007)(110136005)(86362001)(6506007)(31696002)(83380400001)(2616005)(66574015)(186003)(6512007)(921005)(38100700002)(7336002)(7406005)(8936002)(7366002)(2906002)(30864003)(8676002)(5660300002)(7276002)(7416002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NFEwdW5IVE83UjRWNkMwR2l1bnBNNkNwVGVQVSszTG8rbWdBeGFTNVdHUUN2?=
 =?utf-8?B?cm93NDRvWnFsSGY5TXFOOW1udW1WcTFYb3lCKzJKUEtmSzRtM2tVSzdnckcv?=
 =?utf-8?B?RXBXSlBGR2QzUkRJSjlvR1hZcWVNTnAyVktQYjZUQi9zMEh1QlQrNFYwT054?=
 =?utf-8?B?eXlrdVhCS3BuYWw4ZVVQVnRHaFZEUEE5SDZLeW5kc0NkQlNpK1lkNG5aeW93?=
 =?utf-8?B?d09vcGdjdEwySzR4Z1hydnczemU4M1p4bTZaQlY4RXYrcDFhN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QXkzY3F5ZkpmR2NBbXZNSXYySDNvNHlm?=
 =?utf-8?B?MTBVcXQzQ1BUWit1QXlheXUxOTZPSE8rWGlIQ3dqdDBWbWtwYWREbkVGY1VU?=
 =?utf-8?B?RzVuZ1NTNGlJWW9xdmpGVkxVQ0ZuenFLdEIxU1V1ZTlhUXhhMUdFMDRlMDBW?=
 =?utf-8?Q?1wogSGDXTmhOPZ9ad8XCHtEag+2lrksACdlFk2n0JFbu?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bbe76e35-279b-4ed7-d359-08db82c55318
X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 10:47:02.1153
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: DstsdDNwdz59DklArxQdBCUEXtKqLpTjplzq+TEWkeNgrluBGhaEOMYLSYBYGFOk
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5349

Am 12.07.23 um 11:46 schrieb Uwe Kleine-KÃ¶nig:
> Hello,
>
> while I debugged an issue in the imx-lcdc driver I was constantly
> irritated about struct drm_device pointer variables being named "dev"
> because with that name I usually expect a struct device pointer.
>
> I think there is a big benefit when these are all renamed to "drm_dev".
> I have no strong preference here though, so "drmdev" or "drm" are fine
> for me, too. Let the bikesheding begin!
>
> Some statistics:
>
> $ git grep -ohE 'struct drm_device *\* *[^ (),;]*' v6.5-rc1 | sort | uniq -c | sort -n
>        1 struct drm_device *adev_to_drm
>        1 struct drm_device *drm_
>        1 struct drm_device          *drm_dev
>        1 struct drm_device        *drm_dev
>        1 struct drm_device *pdev
>        1 struct drm_device *rdev
>        1 struct drm_device *vdev
>        2 struct drm_device *dcss_drv_dev_to_drm
>        2 struct drm_device **ddev
>        2 struct drm_device *drm_dev_alloc
>        2 struct drm_device *mock
>        2 struct drm_device *p_ddev
>        5 struct drm_device *device
>        9 struct drm_device * dev
>       25 struct drm_device *d
>       95 struct drm_device *
>      216 struct drm_device *ddev
>      234 struct drm_device *drm_dev
>      611 struct drm_device *drm
>     4190 struct drm_device *dev
>
> This series starts with renaming struct drm_crtc::dev to drm_dev. If
> it's not only me and others like the result of this effort it should be
> followed up by adapting the other structs and the individual usages in
> the different drivers.
>
> To make this series a bit easier handleable, I first added an alias for
> drm_crtc::dev, then converted the drivers one after another and the last
> patch drops the "dev" name. This has the advantage of being easier to
> review, and if I should have missed an instance only the last patch must
> be dropped/reverted. Also this series might conflict with other patches,
> in this case the remaining patches can still go in (apart from the last
> one of course). Maybe it also makes sense to delay applying the last
> patch by one development cycle?

When you automatically generate the patch (with cocci for example) I 
usually prefer a single patch instead.

Background is that this makes merge conflicts easier to handle and detect.

When you have multiple patches and a merge conflict because of some 
added lines using the old field the build breaks only on the last patch 
which removes the old field.

In such cases reviewing the patch just means automatically re-generating 
it and double checking that you don't see anything funky.

Apart from that I honestly absolutely don't care what the name is.

Cheers,
Christian.

>
> The series was compile tested for arm, arm64, powerpc and amd64 using an
> allmodconfig (though I only build drivers/gpu/).
>
> Best regards
> Uwe
>
> Uwe Kleine-KÃ¶nig (52):
>    drm/crtc: Start renaming struct drm_crtc::dev to drm_dev
>    drm/core: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/amd: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/armada: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/arm: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/aspeed: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/ast: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/atmel-hlcdc: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/exynos: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/fsl-dcu: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/gma500: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/gud: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/hisilicon: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/hyperv: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/i915: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/imx: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/ingenic: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/kmb: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/logicvc: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/mcde: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/mediatek: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/meson: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/mgag200: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/msm: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/mxsfb: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/nouveau: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/omapdrm: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/panel-ili9341: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/pl111: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/qxl: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/radeon: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/renesas: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/rockchip: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/solomon: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/sprd: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/sti: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/stm: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/sun4i: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/tegra: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/tidss: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/tilcdc: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/tiny: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/tve200: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/udl: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/vboxvideo: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/vc4: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/virtio: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/vkms: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/vmwgfx: Use struct drm_crtc::drm_dev instead of struct
>      drm_crtc::dev
>    drm/xen: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/xlnx: Use struct drm_crtc::drm_dev instead of struct drm_crtc::dev
>    drm/crtc: Complete renaming struct drm_crtc::dev to drm_dev
>
>   drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   |  18 +-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c       |   6 +-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c       |   6 +-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c      |   8 +-
>   drivers/gpu/drm/amd/amdgpu/atombios_crtc.c    |  22 +--
>   drivers/gpu/drm/amd/amdgpu/dce_v10_0.c        |  26 +--
>   drivers/gpu/drm/amd/amdgpu/dce_v11_0.c        |  28 ++--
>   drivers/gpu/drm/amd/amdgpu/dce_v6_0.c         |  26 +--
>   drivers/gpu/drm/amd/amdgpu/dce_v8_0.c         |  26 +--
>   .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  29 ++--
>   .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c |  20 +--
>   .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c    |   8 +-
>   .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c |  22 +--
>   .../amd/display/amdgpu_dm/amdgpu_dm_plane.c   |   2 +-
>   .../gpu/drm/arm/display/komeda/komeda_crtc.c  |  24 +--
>   .../gpu/drm/arm/display/komeda/komeda_kms.c   |   2 +-
>   drivers/gpu/drm/arm/hdlcd_crtc.c              |   4 +-
>   drivers/gpu/drm/arm/malidp_crtc.c             |   7 +-
>   drivers/gpu/drm/armada/armada_crtc.c          |  10 +-
>   drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c      |   6 +-
>   drivers/gpu/drm/ast/ast_dp.c                  |   2 +-
>   drivers/gpu/drm/ast/ast_mode.c                |  26 +--
>   .../gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c    |  10 +-
>   drivers/gpu/drm/drm_atomic.c                  |  22 +--
>   drivers/gpu/drm/drm_atomic_helper.c           |  20 ++-
>   drivers/gpu/drm/drm_atomic_state_helper.c     |   2 +-
>   drivers/gpu/drm/drm_atomic_uapi.c             |  22 +--
>   drivers/gpu/drm/drm_blend.c                   |   2 +-
>   drivers/gpu/drm/drm_color_mgmt.c              |  10 +-
>   drivers/gpu/drm/drm_crtc.c                    |  19 ++-
>   drivers/gpu/drm/drm_crtc_helper.c             |  10 +-
>   drivers/gpu/drm/drm_debugfs.c                 |   2 +-
>   drivers/gpu/drm/drm_debugfs_crc.c             |   2 +-
>   drivers/gpu/drm/drm_fb_helper.c               |   6 +-
>   drivers/gpu/drm/drm_mipi_dbi.c                |   4 +-
>   drivers/gpu/drm/drm_plane.c                   |   2 +-
>   drivers/gpu/drm/drm_plane_helper.c            |   2 +-
>   drivers/gpu/drm/drm_self_refresh_helper.c     |   2 +-
>   drivers/gpu/drm/drm_vblank.c                  |  40 ++---
>   drivers/gpu/drm/drm_vblank_work.c             |   2 +-
>   drivers/gpu/drm/exynos/exynos_drm_crtc.c      |   8 +-
>   drivers/gpu/drm/exynos/exynos_drm_plane.c     |   4 +-
>   drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c    |  16 +-
>   drivers/gpu/drm/gma500/cdv_intel_display.c    |   2 +-
>   drivers/gpu/drm/gma500/cdv_intel_dp.c         |   2 +-
>   drivers/gpu/drm/gma500/gma_display.c          |  20 +--
>   drivers/gpu/drm/gma500/oaktrail_crtc.c        |   8 +-
>   drivers/gpu/drm/gma500/oaktrail_hdmi.c        |   4 +-
>   drivers/gpu/drm/gma500/psb_intel_display.c    |   2 +-
>   drivers/gpu/drm/gma500/psb_irq.c              |   6 +-
>   drivers/gpu/drm/gud/gud_pipe.c                |   6 +-
>   .../gpu/drm/hisilicon/hibmc/hibmc_drm_de.c    |  20 +--
>   .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c   |   4 +-
>   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c   |   6 +-
>   drivers/gpu/drm/i915/display/g4x_dp.c         |   4 +-
>   drivers/gpu/drm/i915/display/hsw_ips.c        |  16 +-
>   drivers/gpu/drm/i915/display/i9xx_plane.c     |   4 +-
>   drivers/gpu/drm/i915/display/i9xx_wm.c        |  40 ++---
>   drivers/gpu/drm/i915/display/icl_dsi.c        |   2 +-
>   drivers/gpu/drm/i915/display/intel_atomic.c   |   2 +-
>   .../gpu/drm/i915/display/intel_atomic_plane.c |   4 +-
>   drivers/gpu/drm/i915/display/intel_audio.c    |   2 +-
>   drivers/gpu/drm/i915/display/intel_bw.c       |  10 +-
>   drivers/gpu/drm/i915/display/intel_cdclk.c    |   6 +-
>   drivers/gpu/drm/i915/display/intel_color.c    | 124 +++++++-------
>   drivers/gpu/drm/i915/display/intel_crtc.c     |  20 +--
>   .../drm/i915/display/intel_crtc_state_dump.c  |   4 +-
>   drivers/gpu/drm/i915/display/intel_cursor.c   |   2 +-
>   drivers/gpu/drm/i915/display/intel_ddi.c      |  28 ++--
>   drivers/gpu/drm/i915/display/intel_display.c  | 154 +++++++++---------
>   .../gpu/drm/i915/display/intel_display_irq.c  |  22 +--
>   .../gpu/drm/i915/display/intel_display_rps.c  |   2 +-
>   .../drm/i915/display/intel_display_trace.h    |  12 +-
>   drivers/gpu/drm/i915/display/intel_dp.c       |   2 +-
>   drivers/gpu/drm/i915/display/intel_dpll.c     |  38 ++---
>   drivers/gpu/drm/i915/display/intel_dpll_mgr.c |  44 ++---
>   drivers/gpu/drm/i915/display/intel_dpt.c      |   2 +-
>   drivers/gpu/drm/i915/display/intel_drrs.c     |  10 +-
>   drivers/gpu/drm/i915/display/intel_dsb.c      |   8 +-
>   drivers/gpu/drm/i915/display/intel_fbc.c      |   2 +-
>   drivers/gpu/drm/i915/display/intel_fdi.c      |  22 +--
>   .../drm/i915/display/intel_fifo_underrun.c    |   6 +-
>   drivers/gpu/drm/i915/display/intel_hdmi.c     |   2 +-
>   .../drm/i915/display/intel_modeset_setup.c    |  22 +--
>   .../drm/i915/display/intel_modeset_verify.c   |   2 +-
>   drivers/gpu/drm/i915/display/intel_panel.c    |   4 +-
>   .../gpu/drm/i915/display/intel_pch_display.c  |  32 ++--
>   .../gpu/drm/i915/display/intel_pch_refclk.c   |   2 +-
>   drivers/gpu/drm/i915/display/intel_pipe_crc.c |  10 +-
>   .../drm/i915/display/intel_plane_initial.c    |   6 +-
>   drivers/gpu/drm/i915/display/intel_psr.c      |  14 +-
>   drivers/gpu/drm/i915/display/intel_sdvo.c     |   2 +-
>   drivers/gpu/drm/i915/display/intel_vblank.c   |  24 +--
>   drivers/gpu/drm/i915/display/intel_vdsc.c     |  18 +-
>   drivers/gpu/drm/i915/display/intel_vrr.c      |  18 +-
>   drivers/gpu/drm/i915/display/skl_scaler.c     |  10 +-
>   .../drm/i915/display/skl_universal_plane.c    |   6 +-
>   drivers/gpu/drm/i915/display/skl_watermark.c  |  42 ++---
>   drivers/gpu/drm/i915/display/vlv_dsi.c        |   2 +-
>   drivers/gpu/drm/imx/dcss/dcss-crtc.c          |  20 +--
>   drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c        |  15 +-
>   drivers/gpu/drm/imx/lcdc/imx-lcdc.c           |  16 +-
>   drivers/gpu/drm/ingenic/ingenic-drm-drv.c     |   4 +-
>   drivers/gpu/drm/kmb/kmb_crtc.c                |  16 +-
>   drivers/gpu/drm/logicvc/logicvc_crtc.c        |  14 +-
>   drivers/gpu/drm/mcde/mcde_display.c           |  18 +-
>   drivers/gpu/drm/mediatek/mtk_drm_crtc.c       |  22 +--
>   drivers/gpu/drm/meson/meson_crtc.c            |  12 +-
>   drivers/gpu/drm/mgag200/mgag200_g200.c        |   4 +-
>   drivers/gpu/drm/mgag200/mgag200_g200eh.c      |   2 +-
>   drivers/gpu/drm/mgag200/mgag200_g200er.c      |   4 +-
>   drivers/gpu/drm/mgag200/mgag200_g200ev.c      |   4 +-
>   drivers/gpu/drm/mgag200/mgag200_g200se.c      |   6 +-
>   drivers/gpu/drm/mgag200/mgag200_g200wb.c      |   2 +-
>   drivers/gpu/drm/mgag200/mgag200_mode.c        |  10 +-
>   drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c |   6 +-
>   drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c      |  70 ++++----
>   drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c       |   2 +-
>   drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c     |  12 +-
>   drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c     |  20 +--
>   drivers/gpu/drm/msm/msm_drv.c                 |   4 +-
>   drivers/gpu/drm/mxsfb/lcdif_kms.c             |  18 +-
>   drivers/gpu/drm/mxsfb/mxsfb_kms.c             |  16 +-
>   drivers/gpu/drm/nouveau/dispnv04/crtc.c       |  58 +++----
>   drivers/gpu/drm/nouveau/dispnv04/cursor.c     |  10 +-
>   drivers/gpu/drm/nouveau/dispnv50/atom.h       |   2 +-
>   drivers/gpu/drm/nouveau/dispnv50/crc.c        |  30 ++--
>   drivers/gpu/drm/nouveau/dispnv50/crc907d.c    |   6 +-
>   drivers/gpu/drm/nouveau/dispnv50/crcc37d.c    |   6 +-
>   drivers/gpu/drm/nouveau/dispnv50/crcc57d.c    |   2 +-
>   drivers/gpu/drm/nouveau/dispnv50/disp.c       |   5 +-
>   drivers/gpu/drm/nouveau/dispnv50/head.c       |   4 +-
>   drivers/gpu/drm/nouveau/dispnv50/head507d.c   |  26 +--
>   drivers/gpu/drm/nouveau/dispnv50/head827d.c   |  10 +-
>   drivers/gpu/drm/nouveau/dispnv50/head907d.c   |  26 +--
>   drivers/gpu/drm/nouveau/dispnv50/head917d.c   |   6 +-
>   drivers/gpu/drm/nouveau/dispnv50/headc37d.c   |  18 +-
>   drivers/gpu/drm/nouveau/dispnv50/headc57d.c   |  10 +-
>   drivers/gpu/drm/nouveau/nouveau_connector.h   |   2 +-
>   drivers/gpu/drm/nouveau/nouveau_display.c     |   2 +-
>   drivers/gpu/drm/omapdrm/omap_crtc.c           |  56 +++----
>   drivers/gpu/drm/omapdrm/omap_irq.c            |   6 +-
>   drivers/gpu/drm/panel/panel-ilitek-ili9341.c  |   4 +-
>   drivers/gpu/drm/pl111/pl111_display.c         |  16 +-
>   drivers/gpu/drm/qxl/qxl_display.c             |   2 +-
>   drivers/gpu/drm/radeon/atombios_crtc.c        |  54 +++---
>   drivers/gpu/drm/radeon/radeon_cursor.c        |  14 +-
>   drivers/gpu/drm/radeon/radeon_display.c       |  28 ++--
>   drivers/gpu/drm/radeon/radeon_kms.c           |   6 +-
>   drivers/gpu/drm/radeon/radeon_legacy_crtc.c   |  16 +-
>   .../gpu/drm/renesas/rcar-du/rcar_du_crtc.c    |  14 +-
>   .../gpu/drm/renesas/shmobile/shmob_drm_crtc.c |  20 +--
>   drivers/gpu/drm/rockchip/rockchip_drm_vop.c   |   8 +-
>   drivers/gpu/drm/rockchip/rockchip_drm_vop2.c  |  15 +-
>   drivers/gpu/drm/solomon/ssd130x.c             |   2 +-
>   drivers/gpu/drm/sprd/sprd_dpu.c               |   6 +-
>   drivers/gpu/drm/sti/sti_crtc.c                |  14 +-
>   drivers/gpu/drm/stm/ltdc.c                    |  12 +-
>   drivers/gpu/drm/sun4i/sun4i_crtc.c            |  12 +-
>   drivers/gpu/drm/tegra/dc.c                    |  12 +-
>   drivers/gpu/drm/tidss/tidss_crtc.c            |  19 ++-
>   drivers/gpu/drm/tidss/tidss_irq.c             |   4 +-
>   drivers/gpu/drm/tilcdc/tilcdc_crtc.c          |  43 ++---
>   drivers/gpu/drm/tiny/bochs.c                  |   6 +-
>   drivers/gpu/drm/tiny/cirrus.c                 |   2 +-
>   drivers/gpu/drm/tiny/gm12u320.c               |   4 +-
>   drivers/gpu/drm/tiny/hx8357d.c                |   4 +-
>   drivers/gpu/drm/tiny/ili9163.c                |   4 +-
>   drivers/gpu/drm/tiny/ili9225.c                |   8 +-
>   drivers/gpu/drm/tiny/ili9341.c                |   4 +-
>   drivers/gpu/drm/tiny/ili9486.c                |   4 +-
>   drivers/gpu/drm/tiny/mi0283qt.c               |   4 +-
>   drivers/gpu/drm/tiny/ofdrm.c                  |   8 +-
>   drivers/gpu/drm/tiny/panel-mipi-dbi.c         |   6 +-
>   drivers/gpu/drm/tiny/repaper.c                |   8 +-
>   drivers/gpu/drm/tiny/simpledrm.c              |   2 +-
>   drivers/gpu/drm/tiny/st7586.c                 |   6 +-
>   drivers/gpu/drm/tiny/st7735r.c                |   4 +-
>   drivers/gpu/drm/tve200/tve200_display.c       |  14 +-
>   drivers/gpu/drm/udl/udl_modeset.c             |   4 +-
>   drivers/gpu/drm/vboxvideo/vbox_mode.c         |   6 +-
>   drivers/gpu/drm/vc4/vc4_crtc.c                |  38 ++---
>   drivers/gpu/drm/vc4/vc4_hdmi.c                |   2 +-
>   drivers/gpu/drm/vc4/vc4_hvs.c                 |  12 +-
>   drivers/gpu/drm/vc4/vc4_txp.c                 |   2 +-
>   drivers/gpu/drm/virtio/virtgpu_display.c      |   4 +-
>   drivers/gpu/drm/vkms/vkms_crtc.c              |  12 +-
>   drivers/gpu/drm/vmwgfx/vmwgfx_kms.c           |   4 +-
>   drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c          |  10 +-
>   drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c          |   8 +-
>   drivers/gpu/drm/xen/xen_drm_front_kms.c       |  10 +-
>   drivers/gpu/drm/xlnx/zynqmp_kms.c             |   8 +-
>   include/drm/drm_atomic_helper.h               |   2 +-
>   include/drm/drm_crtc.h                        |   4 +-
>   194 files changed, 1296 insertions(+), 1264 deletions(-)
>
> base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:52:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:52:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562350.878985 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXSN-0002XI-C2; Wed, 12 Jul 2023 10:52:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562350.878985; Wed, 12 Jul 2023 10:52:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXSN-0002XB-9P; Wed, 12 Jul 2023 10:52:27 +0000
Received: by outflank-mailman (input) for mailman id 562350;
 Wed, 12 Jul 2023 10:52:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJXSL-0002Wq-VY
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:52:25 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0630.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::630])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2f8dcceb-20a2-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 12:52:25 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by DBBPR04MB8025.eurprd04.prod.outlook.com (2603:10a6:10:1e4::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 10:52:23 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 10:52:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2f8dcceb-20a2-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=DldRQgaxTdzy/Yxl2RnTAr5zF/PPwWAI+L/7k1J51UkHiuFA/6BPDfVfrdbCb0HaJUXyk5jq04kDkVt/vorgwCNcGqiWHiv0FijI5URyeoN29IOAIHzSFSQDTKb16y8ztts4w4gLjKUNlPR/9MVGdi5HdzCksPqBvlzxKexjOOdIlGMgVNBhpEZCd1Bip8IozKlrDmz+QzoBAOnfXlxSey7GqIgrpIbBw73/0g1NooTa22AbX2CBw2qepRcjbA7jpp9Fd8/5bI7ziPu8LFKJadLIdQ5YHVmLoXyaC21+z16l6SNKl7PLds6w/iQu0NRoAwfp2+ZDWQbZPkL86QB90g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=KpZYUK4NCM8LATODje/gfsOtb3Cjjx/3p1PoPTJQIxg=;
 b=Izsy33YGkjc2W3Ttru0+DjrLVeq7v11AmEP0uqANuvPQZYasao/DBQhpsU55TjI8I2y/D0rTAUbEwCTazZLzR9f5esPLdvJ3NHpFvKLh/txNElpf/alEpLN54T/FeFuCUu6fniFTx2EZl/1GWADj56OpIWo6SqaxsjL7yUlAPmrYI7hFawHBrAWpksyH2N55DbUFkWXv6H+bHmk+UzwVlQ84X20Q+4nwYuczvd6TW4nlQtiLWQoastgz64C0gIxBqMZKeazhoCwJcS9w0dD7OVi6lWnrhrBkyef8Q8i7hp07qRTBkU6++STr5BUjHhC1CSh9n4tv4rr9Sdl4SW/JxA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KpZYUK4NCM8LATODje/gfsOtb3Cjjx/3p1PoPTJQIxg=;
 b=AGomH+vBNbg6yURbJT4A1hRM0812H9OIQrDlpeFnrkX2P2fVy0CVVNTHPx/eO1e9g/weDWsYaLmy3VTygpKyUPh0PfVtV/ZVaoP4hkii2rUvZRovUobWMJeuaHRq2hrUF9vw3R4QsX4rd9CkUq8pCvshhRnKEGPKRIIGTzAvqOJ8F4LcAjTI5hMQrSPA/eCV6Qbe5p6AAjtrzZdOzhEJNVLuIlT2rWZpMcBorpHO1QM4DXnzsPdi1lkxGqiZuG98NlNYgaxOpCUg7rsgFalDIjRbkxnusS3cYVALvpQotrcSa2mNtUlvogEaxiqL31jIV1pnz5u8zz6AeM0N147F0A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <301fda12-33bb-325f-2ca7-8f177ddf89b2@suse.com>
Date: Wed, 12 Jul 2023 12:52:21 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v3 07/15] x86/vmx: fix violations of MISRA C:2012 Rule
 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Jun Nakajima <jun.nakajima@intel.com>,
 Kevin Tian <kevin.tian@intel.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
 <c4953517b9675b2099841be704f0c67989e76342.1689152719.git.gianluca.luparini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <c4953517b9675b2099841be704f0c67989e76342.1689152719.git.gianluca.luparini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0016.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1d::21) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DBBPR04MB8025:EE_
X-MS-Office365-Filtering-Correlation-Id: 3ae2815b-3d72-40e2-a9cb-08db82c61296
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	UgUlHrmMr7TiYCi2w4SAqXNqGUF6AWRRcK4f5IFtlustKBKsDAbYcPFeXVYbCSWjv45LTWi6DiPObc6oE7g9HGTNMujo6P7/5uV4k4L8jnTgczFaehIkd6z7fFcDvkJBv2xXTkwWszejx/82md0GWdCyLS+tduv2tqZqmn5wdrGHkESWvXGRckTFhzhtEgyWspK3c3mizx73103C2xU7AdNzHqH8tGhETavhDxN+NElWdMPad0a0qlFO63rr2EfaFiEf/GrXq3aRPsPGkLHrAh+yxvIpzZM4/r7mYsYtNRVXraf3lZ+szNrOp91Y/jzu7M/l0CynSBuoK+AC2oVxi59k672EQbD2QaeJQlY29wSRw3EC850MG7aGHV5pheRl9J5VDpiHwLeLXPqW1CLdvO3VP0HG8+caWBYf2s+uzoBMvKed9zlmTAqf3dx1+HxSw8D4NflL7QAWeNOi5+eIGk/t0YU/AG96bbXw8IL+V6+BOmwJphm+eDsB/ZU3H7Anas/jYufyLLIPz1owPbEI+ZclRhiDkiVnPe8cJAIo1bpFmQ+gRWZ9U7ld8pS4eIO9cM0jjA4wBTcCup5d1w8EglXaViWbb9kRlUjGZb4m9OMsSkJeivKOj5MbV4i/Xp/8jHIG6P9WpF2pMBaM1S0v7w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(39860400002)(136003)(366004)(396003)(376002)(451199021)(7416002)(6916009)(66946007)(66476007)(66556008)(4326008)(316002)(41300700001)(2906002)(478600001)(31686004)(8936002)(5660300002)(8676002)(54906003)(6486002)(6512007)(26005)(53546011)(6506007)(186003)(36756003)(83380400001)(38100700002)(2616005)(86362001)(31696002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TUFmNG85UVc1TjI3ZUg5R2pra3lBSFNIdStNWkszSkJEU0o2SzhtZVBhMTNX?=
 =?utf-8?B?QXVIbDFuSWRrZStRM3JLRldTSHpWMmJjcktTS0tPZUppY0haMHN3WDgvUlZV?=
 =?utf-8?B?L0tCS2Q1aXQwUWJPQVlPVjMxZndHdjNlN0R1Rmg0R1kxK2VXSDdUY1dES3cz?=
 =?utf-8?B?WnFQQU13TFlRRTRVUVQ3NDJ0TFRlQXlSZ1BubXJJUUVSQ1BwNGsxaFFvTGxW?=
 =?utf-8?B?NERZdUJqZ2RFNitHMk1mUjF4YmZ3ZW1GYUNzK3hJWmJtZUEzTVdhMGlMRDlx?=
 =?utf-8?B?ZTBkYitNVExmN3hnakxrem1NQkRZZ0ZuTHU4YWg2c051VXBEdVJDcE9HS3gw?=
 =?utf-8?B?VmxmWGxqUWFKd2hUWWEzNDBFdi84Z1lRa082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Q?n0Gz5tZlMcnXxh1Pm2EcgAsaF?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3ae2815b-3d72-40e2-a9cb-08db82c61296
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 10:52:23.0884
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: VXgWHSssQ8PanrY7gJs/qgrpDKj96tqc9goGqmdRRz/P4WKrV1LpKPoYpbA0Qss+9d6D4ETTDak03JQ48smDZw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB8025

On 12.07.2023 12:32, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type.
> 
> For the sake of uniformity, the following changes are made:
> - add the 'U' suffix to macros near
>   'CPU_BASED_ACTIVATE_SECONDARY_CONTROLS' and
>   'SECONDARY_EXEC_NOTIFY_VM_EXITING' macros in 'vmcs.h'
> - add the 'U' suffix to macros near 'INTR_INFO_VALID_MASK'
>   macro in 'vmx.h'
> 
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> ---
> Changes in v3:
> - change 'Signed-off-by' ordering
> - change commit message
> - remove unnecessary changes in 'vvmx.c'
> - add 'uint32_t' casts in 'vvmx.c'
> - add missing 'U' in 'vmcs.h' macros
> - change macro to '(1u << 31)' in 'vmx.h'
> - remove unnecessary changes to 'vmx.h'

With this many changes I don't think you can retain an R-b, unless
the person it came from really explicitly agreed with at least all
not purely cosmetic changes (which I don't think was the case here).

Irrespective:
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:54:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:54:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562354.878996 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXUb-00035z-PU; Wed, 12 Jul 2023 10:54:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562354.878996; Wed, 12 Jul 2023 10:54:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXUb-00035s-MT; Wed, 12 Jul 2023 10:54:45 +0000
Received: by outflank-mailman (input) for mailman id 562354;
 Wed, 12 Jul 2023 10:54:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJXUa-00035i-E7
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:54:44 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0618.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::618])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 81985f07-20a2-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 12:54:43 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS8PR04MB9512.eurprd04.prod.outlook.com (2603:10a6:20b:40f::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 10:54:40 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 10:54:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 81985f07-20a2-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=NBQzmL9Oxs6JQp8vakUGT7YCY45604IEo59/WNLFFPWu4JeDbW8VPlPQCOgcfsKC9O++2/1RAfOR7kJgEnGdv+aO059alp53mPoEDQLt7EwJTHXkZ232+8BCVnN3rio4opm4f6CUlGiAXfRbJtjKMlll6Q6xpeS/Bpw+zEqDg4xtKffKgPz8eguZtOGfK3QJeueVSz2HGCPuOcBJFTnxrs4ocQo26pVPyy0grySG5F8j1JWJ1y68O8z6qx6Pmo5aaqcgOdZxDn4tapFUh/S1InJw3T/4odOVm8q5Gff5h5GNhRHvVeU5WALHRVbFi9dg6iqwiCgg/e3xYXlCgUTEqg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=cbsBwAXNEArg1hcD+/sfkojwEe80jWAnvwgMMeO3kyM=;
 b=Z9BoDSlBj5Ccst+2VWVHtRTsCY6+TG2uceYm2ctt3cjBd4r92d0h3T5mr/MKhtKui8TXavBOjESWJM8uTn8MvzEmRq1eAdRZ53KdXDmEszvlFKheGDVM7NEoX11LOlzZ2JPHfkSn3+yoQBG+Y/x7tIq0eTTgOqlx0YVEHoGvfO4boBF2GckkgYQl+I6ocE1voveY/EHpLJk4fPkUMBIEEN6P6co85Ux62lnI4Jvk080GAxhOU3wZs416kSEuHy+hpHoyxaU6q1N39ZLti4tuqHW8pQoeHHf3ClecUYRDb5347eYUg14UgxjtJ38SUSdrubC44olTyR3FTwYPEMZIDw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=cbsBwAXNEArg1hcD+/sfkojwEe80jWAnvwgMMeO3kyM=;
 b=xT3VDFBiCYNmAzLSDAdwJr0mFNgFN6F1/UJ+/eghPJGOsHeJOSgGF05OvdE6f6dhtVxYEW3qlWHSIrwTa4XdgrSLScOQclYb6oSeO/2MEMpmW/Pz6vKXkYK9k0NXaGEdOq0MMxr21N6jtXIa0jdSCk146WJpLH9LqEYliPsmld35GusEr1WCseWPKHY78+8sCisZ06bS8nRdFZun6sng6rJfy0EHTdbajiefhCR8A0+YEePNb8roGUj91NkfvwXlmnOog4zuM7IUN9higbaqsTL6rrFI++M5GBnUhz7+sxpzqHbQRMHc5G09vCW7rbFSzHdFE7Mfu/wy0zMcwGbsEA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <95c2b8a0-068b-c789-eb52-df6ff858f1cb@suse.com>
Date: Wed, 12 Jul 2023 12:54:39 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v3 10/15] x86/monitor: fix violations of MISRA C:2012
 Rule 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Tamas K Lengyel <tamas@tklengyel.com>,
 Alexandru Isaila <aisaila@bitdefender.com>,
 Petre Pircalabu <ppircalabu@bitdefender.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
 <13ba23be1b7aba72bbae2cdec781eba9d7d4abd3.1689152719.git.gianluca.luparini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <13ba23be1b7aba72bbae2cdec781eba9d7d4abd3.1689152719.git.gianluca.luparini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0176.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b4::15) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS8PR04MB9512:EE_
X-MS-Office365-Filtering-Correlation-Id: 38f20c89-a462-4aa2-06ba-08db82c664a9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	9DlrMpJ/St9N/l0NNdnTj/pFk3wieO2LggdycBJRjvpueBTzs5JYrTItDXP6Qp0XGTkYcsrxPifOkQPVBCRFVKSM7jSUwcuVPeW9sUmAzoGAfhaI4pnXnE9SlrQZNBCSb643FJGCoCNAfH1RyqYGcygaYZvzSBfBDuM6rrI8oBdY8s9K0KMZAyWgx5HsUSbrXRu7oKdc80+MiuKzT+MoH7eXSuob8XcQ5z2L9s9z6FCm5NnpHt/zrTu29vaCLadGkuHx3beIjjqagv30dM1QIJ5774XdPZWcs7uDH3e0ux4U/ql/k/c2fxl7xWLVhNYCy0Yds51GHNSLJUIbLNplQsMEwyVyMlV7xpBnQx1IiCSRGbDcHLYIloMogWDOsEW8V/tRSpbYJKtZl9t0nzPKrGfiJBWzdmzlfHntoMvHqaH0wA1bpDZnbOQcSQKr5ymcG4tjY1PkxPUvTfnDzNFYd9cMDI5b6691RCXQqFurnVXDLesElL0H+foRLrdOJLpv9RR0RdWzBA84dRZR+jhhbnNBeufFHx7KEA7lyP15cylgMgjIWF4Kp3yzrIHaimGjBeCoX/hmrQ2EWwuLu4NVuNOu904v83B449dbW2CYva4LLsJJRcZjPvcg94T+V3X0v3PgE3boXnGcTJzeZJYImA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(39860400002)(376002)(136003)(396003)(346002)(451199021)(31686004)(6486002)(4744005)(36756003)(86362001)(2616005)(53546011)(2906002)(38100700002)(4326008)(66946007)(6916009)(31696002)(186003)(66556008)(66476007)(478600001)(54906003)(316002)(41300700001)(83380400001)(26005)(6506007)(7416002)(5660300002)(6512007)(8936002)(8676002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SzI2aGVRQjVWVEVsbDhFdTBtcDdTeWRQZjNHa2JMRzQvY0ZMYVU3RlhiSXR6?=
 =?utf-8?B?MkorQXFlak8ycHNmL1R0aXc5VlVuTWd1eVBJQ1RLN3hPaU0wWEtKbEREU0t0?=
 =?utf-8?B?UjcyZExtamFURnRzVUVZc3NyV3Z1YytUQ3NRdE4vRHNzL2R0ODJsMndPVVlj?=
 =?utf-8?B?ZmZtZS80OVBsbThCYlVtZFB2ZUlSTk92a0pmZ054b011SEdQVGtXb0Q3Ym55?=
 =?utf-8?B?M1R6OFJEb09WODl0UnY2VTExNUpYeWx5RHVDWkQwUC9uOXF1NnYxUEo1UHpN?=
 =?utf-8?B?UXBoRmJnUURSelY4ekhxT0kxMTFUaTFFWVcwZlVnZnIxVG9IRHN2TmNvVklR?=
 =?utf-8?B?bk02dTM2U1NIb3NocTR4SExJajYwRjQzd2VNdjVBcGRmY09veUZkV3ZTY1Vi?=
 =?utf-8?B?MGkrMmZFU0xnWHVrWGJEcE10OCtZeXJyWmVPOTR6Mzl1UGloMEE4WTRXK1pu?=
 =?utf-8?B?S3g2QURFbXdzT3JaOCsvLzRrQjErZXBXKytIbFZ6VEgrSmZVSUw4V29DTE1l?=
 =?utf-8?B?NWF4b0kvdUhlQURxYXJkclh5UE42VWNIaHlzem4xbXl1MURsNjFEejVqUUU5?=
 =?utf-8?B?WENsUitBMkZzZTQrOTBLR0N2NHNMditpOWJDSXNpN2Rmd1gxWmRVL1dObEdY?=
 =?utf-8?B?QlpYYU5CUksxc1hlSTFqM1kyT2x6TURPa25kUlNTQ3UvVjM0UGo3dVZIeDFC?=
 =?utf-8?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ra1pLbjYwU2ZGeTBPS29Ib05kR29ONlk2a2liOEZs?=
 =?utf-8?B?S3IwbXBpRkRZbHRWUlJBd3VkZnRmYXlKWlJmUzdKMDZUQzRKcEZOV1ZlcjRM?=
 =?utf-8?B?ZStNdzlJTnVLM09scXhZaDdqRmcveDJsZmpFZkRHc0VxZXBYbGxDUlkwUThl?=
 =?utf-8?B?WjBUTC9sTzFQNlc3QS9wVGkvTFVZYWFYR0FZeWJKb2g3V2pKak9oTVZSMVBG?=
 =?utf-8?B?TzZWcWRoOXJrSEZZQUlNTndwRmdkeUZhZUZlOVBRbGFVQWtmZmkwb01wb0s0?=
 =?utf-8?B?R1JlVjJFR05XK2xZbk5XSGZiRHRBQ2l2N1ZIWmx5OEgwYXpCUlZKV2RvM2Ju?=
 =?utf-8?B?eVg0L283NWw0NTNBOUxUWk1SbytOMlQ4N3pXZytOcU1nMkxDaFVENVdjZFp5?=
 =?utf-8?B?WXhvaUttVVE0NW4yNWFyTm9KQlJqTFZCZ1I1OFdmRDFlUEtRQXJtb05zZ3Bt?=
 =?utf-8?B?RlVwZ3huNnpUVVhvclhhckJRYzVVam9FYmVSd1pFUnYySmEwempvR2l0Yzho?=
 =?utf-8?Q?Yq71qCikn8VFCwVY6ByXjhuYu?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 38f20c89-a462-4aa2-06ba-08db82c664a9
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 10:54:40.7821
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: YK4MPErlOPm6Y3npinPuHqj21Xi4EEICJk+p6OuRORwe95XbUrpb1YEGWAlmvdYXXeOdMko0qudXRCCdDKBvcA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9512

On 12.07.2023 12:32, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type and also to other
> literals used in the same contexts or near violations, when their positive
> nature is immediately clear. The latter changes are done for the sake of
> uniformity.
> 
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Looks like you've lost Tamas'es ack here.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:56:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:56:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562360.879006 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXWY-0003gd-7R; Wed, 12 Jul 2023 10:56:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562360.879006; Wed, 12 Jul 2023 10:56:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXWY-0003gW-3b; Wed, 12 Jul 2023 10:56:46 +0000
Received: by outflank-mailman (input) for mailman id 562360;
 Wed, 12 Jul 2023 10:56:44 +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 <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJXWW-0003gM-Q2
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:56:44 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on0627.outbound.protection.outlook.com
 [2a01:111:f400:fe02::627])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c8ff6c9b-20a2-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:56:42 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PAXPR04MB8109.eurprd04.prod.outlook.com (2603:10a6:102:1c2::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 10:56:40 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 10:56:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c8ff6c9b-20a2-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=n8KBwe6F6OK6F8Mlz4Reb81UFbIrkkC0+0SBTk2Obwl67dekZKxQrkwf4dCp8c92XNraVvvL5dXMZbzSPQwkhlMX14EGdCiFLoILrjqDyzJzYoOWF/SZXRSJAwxVCEOEF4Salr9TPZCUpQn6A0g3aDMK9eAOId6RAvVKeUewAABXwiOihQsBawYDmFkV/XCwAvPgAJmHhfge5wGYpwVQEPNFEg2fCghQC+4JstJPUu4TR8SDyrlZgVPtoCWSAkqQRwj9RMdgCljGhKxC182g21fLd158yepUQEaq4HT4xstR071EXJHcyG1d4JEHx4tFxhh/y5ImblJMp1bFk0dcxA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=a0xDb9uFAjmFVHfWwROsyqVJ+c+Zi/BVX8RBoz3fGms=;
 b=NWgq+ppHOgWIGtuNhSB55YxZfgKgxoL8S99NoJbWz2FSKC4j6tE9pgZP+EnmRHnfHSKTwr7WTDtsi4cYngiLIOlAbhowr32AY8T5Xil8LwQK3OMSnNm+05OH2dCV++MpMt/WzbIYA8VGu+peYMwIe4ZMxKx/ejIBQjx7Q+5Y9xFtAwWjpIw84TwDzFZchKnTCrGv3Lts71lB3sLFI4A1YBk08oB1H0K1OTYLdc/bYOCE/ZsIcbsOW6SDXQ+HlU+sctOsBr5l6cPjJAi/3tWriPoAiRCDJBMTUvWqRuC3B3EB0Aa7wMPD9MKgBYfBu4fUn2p4lPHHOZzJRq4pOtOo/w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=a0xDb9uFAjmFVHfWwROsyqVJ+c+Zi/BVX8RBoz3fGms=;
 b=CYAPox/yD+k9l7vvDPV3afYvhmRxe1+VP4IGi/ZjT3rIZKGpqekzQ3tENOeYgQ8qakpLIZdOALlD1sqzbxRqoOkJmEOAaEyqx1asLvmwPWykiW+M9ymIUj0zut5cHBDM4radmFW7IwpijeFFYy6R56856vNSBwhsoA1au8RRBsciDvHMAq6MQXyngSabds9y6OFqn4W5Q4zJ8mG/Bqd2+EJPz52A3RGEb1uCO2wt22q5lLAQCzir+1WAznkrd+S2+9/xTpX6LaSo4C+/eDrQAQTtoPbew7GtOJBlz/ho6J5p2Xz45rjN7uAtgI3CGJiEGkuvi7cC7cZqj4ULG/9mow==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <2c7b96fb-fe76-0969-c530-fba57c113d35@suse.com>
Date: Wed, 12 Jul 2023 12:56:38 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v3 14/15] ACPI/APEI: fix violations of MISRA C:2012
 Rule 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
 <9fa7f3b467b7efbe1c9f80269c4af942fbebea8d.1689152719.git.gianluca.luparini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <9fa7f3b467b7efbe1c9f80269c4af942fbebea8d.1689152719.git.gianluca.luparini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0106.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9c::18) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAXPR04MB8109:EE_
X-MS-Office365-Filtering-Correlation-Id: f2afe108-9a4b-41ed-e8e7-08db82c6ac1d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Wp2Z0HdEyVHQipvdZZwi1BZ8tYOdDz4DPt+gR48oR/7uvSbDU9uC6bi1DEWcUeMF1aeod3s7dnMw6SpdRi6cCi37B/1j873qCL0VNPQ9mV6lWQADQb5oGZK2CdFgsheNfUapaK3gUHp4J5c1qUxG2AdW6BqJhIurDeLZj4WgOSgiDH2hAlodPSU50piRE54HokR/u/3dEBqAccopAIss+pRbHUkm9bVGRrNCmeSrvFYJfB6b9vowVfNzlIv614BqjN/lqHTIZzAgj02tMDmUfMZI1ScOWvt7abGKDnX9DDgFhKLSSXFo2jtaRC/KVMy3BR2+/75iGoGJAj0xRTNe+zNprYcebZn5jp6KxGxrYv82A/LOETjt/J+Vv+ikP/T5dyu3AABGBt7XVag29+RufLayP0H9qNOtr2v000jXDLja90eIEs24jPZuF0RlZJbHexRVkKRYXCPu0vkuMy6MuvCjQr2Atc8eCfqJQef2P6EKooLTfyR8r9buAx5+KhkjRHXgwtgCcigAS/v7LEfOEOJWaVfVo9mnwWQKKPEMe6sYqB4svtziy4FgrnDOfZ1+BzwNiV3m9vgLubIgcUx2Rv8kboPdJx8TOfDzcZhpcvBte2+rOJqv+nNY+kMxAQrHXODcvyWdjxzhwBVAHr+c7g==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(136003)(366004)(396003)(39860400002)(376002)(451199021)(7416002)(38100700002)(2616005)(4744005)(41300700001)(316002)(2906002)(31686004)(8676002)(8936002)(5660300002)(66476007)(4326008)(6916009)(66556008)(66946007)(6486002)(6512007)(478600001)(36756003)(54906003)(6506007)(31696002)(53546011)(186003)(26005)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NzlsQ3Y1U2RwNzNWQmttRmF0RFBCWUNrYWpTcWEvN1pvQ0U4b29DZWJjUzV2?=
 =?utf-8?B?eEpsaCtOTHBxUnBvRkU3MVRIOHJlbGxRZ2xiR21mZXBmaEF6ZkcwUzJjaHlI?=
 =?utf-8?B?Vzh1SkRRRW05ODZIVjA1ak9Xd25pTUhaRUUxY3MyYklJWU9WVHZneldaeWgy?=
 =?utf-8?B?S0JvSWlhOStZeVNCMDE5TjBsVklwVG5mMS9OcXIxdzRIeExhTWVWb2lOa1dG?=
 =?utf-8?B?S1R6Tm9LVWJYVlIzSElhcEpXU05IcWJqcE9ReWVnK0RiR01zaC9rT3llVHdH?=
 =?utf-8?B?cTg5Z0Rnd3ZXR2sveU5rc0NDWDVkYVAxZStzVUlaMzlyTkJ5U2w1aE16T2xu?=
 =?utf-8?B?VmtwZW0yeHlWanl3Y3VycVlhOWJaaUlUSFV0VFJCcmtDNU1hNFpoVHdVZWpP?=
 =?utf-8?B?V2JITlVLM2hKQWZJSVJqOTlTYk1oRmIrMHkzWk85UytGa3dvUnBsMjBSQmV5?=
 =?utf-8?B?ZDBwRUJxNUxEZFZlaUNCV2VDclpVNkREOUtjeGRNRHNQZnVadmVjSGNMVWxJ?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YlNzMzZvR1hhTnhYTm05Z3dadkdkdFVpK2I1Vmxk?=
 =?utf-8?B?WVQ0aHhXMW40UjdTZ2gvd0NDSHFSWFpjY0hnbDNjK0lvV3NTWXg4ZnlZWDJu?=
 =?utf-8?B?RTNPNkFBc0tFY3JseEl6VEQ3WjBpblcvdldPajl4cTFwYmpQaG1YQ2laUmFD?=
 =?utf-8?B?U2E1bW9RcG0wTXdRUDFjL1poYWkyWmlYRUI5SStPUlNIbVo1a0VEMVVEQUJ5?=
 =?utf-8?B?aVY5UFk1SW1VdnROZitDVWgwb0FVYS9UZ0UvMlpZQnNwYk11cXkyc2RqRm9X?=
 =?utf-8?B?Sk14WGhhZ1U5S3VzODlxR1paQyt6Sjkwb3VPS3hyMklHNlBkMjBsbW52ZElz?=
 =?utf-8?B?MjBFbmVhcmh1aW9JWlBrVGw3Yzk4YVViYzZTZjdhUktLY01XSDQrK2Uzb3FW?=
 =?utf-8?B?dlhPeE5QdWZLSWg4SllNdndST29UUDI1MUJLaWt4RTYxeWZEZk9udEp1YlVT?=
 =?utf-8?B?ZDlSa1FkNWFZSXV3ODNIRjdsS095UGFvcUlLUnN3SFJVNC9DME5rVUhHZHJo?=
 =?utf-8?B?a3NoQXo3TUQ1K0tPVjFWRUU4OGtmUTFuTnZiemwwYTFhVWxDVmZ1MkJqR0dm?=
 =?utf-8?B?ZU5Ta2JYZk9TdlFxS25NMm5BYlh3RkRTWVluR1JLVTI1bTBLUHBvd0hWMGU4?=
 =?utf-8?B?T3hKVjQzcUJmWlEyNkVoUkUwREhJOENIeUkyWTFNRkl0ZHB2Z2Mva2J0anp4?=
 =?utf-8?Q?si9XgZzzOCSCn3yaNqsOTfzZx?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f2afe108-9a4b-41ed-e8e7-08db82c6ac1d
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 10:56:40.6658
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: YLFfu8IEjmjRCOgmPsa4mMP6yj74Ib8lFaBVxwE+g+82kr1QzFaSvMy9qkLKBjQQxPLCPXpfZ09ch0SIWse+gQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8109

On 12.07.2023 12:32, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type.
> 
> For the sake of uniformity, the following changes are made:
> - add the 'U' suffix to all first macro's arguments in 'cper.h'
> 
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:57:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:57:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562358.879015 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXWm-00044p-Iq; Wed, 12 Jul 2023 10:57:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562358.879015; Wed, 12 Jul 2023 10:57:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXWm-00044i-FY; Wed, 12 Jul 2023 10:57:00 +0000
Received: by outflank-mailman (input) for mailman id 562358;
 Wed, 12 Jul 2023 10:56:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=MfTd=C6=pengutronix.de=ukl@srs-se1.protection.inumbo.net>)
 id 1qJXVw-0003fD-3w
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:56:08 +0000
Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de
 [2001:67c:670:201:290:27ff:fe1d:cc33])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b07a8b2d-20a2-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 12:56:01 +0200 (CEST)
Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2])
 by metis.ext.pengutronix.de with esmtps
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJXUZ-0005DQ-Ft; Wed, 12 Jul 2023 12:54:43 +0200
Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de)
 by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJXUP-00Drm1-Ta; Wed, 12 Jul 2023 12:54:33 +0200
Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJXUP-004Hjx-1W; Wed, 12 Jul 2023 12:54:33 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b07a8b2d-20a2-11ee-b239-6b7b168915f2
Date: Wed, 12 Jul 2023 12:54:32 +0200
From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	Alex Deucher <alexander.deucher@amd.com>,
	Christian =?utf-8?B?S8O2bmln?= <christian.koenig@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
	Hamza Mahfooz <hamza.mahfooz@amd.com>,
	Javier Martinez Canillas <javierm@redhat.com>,
	Guchun Chen <guchun.chen@amd.com>,
	Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
	Evan Quan <evan.quan@amd.com>, Likun Gao <Likun.Gao@amd.com>,
	Marek =?utf-8?B?T2zFocOhaw==?= <marek.olsak@amd.com>,
	David Francis <David.Francis@amd.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>, Lang Yu <Lang.Yu@amd.com>,
	Philip Yang <Philip.Yang@amd.com>,
	Yifan Zhang <yifan1.zhang@amd.com>, Tim Huang <Tim.Huang@amd.com>,
	Zack Rusin <zackr@vmware.com>, Sam Ravnborg <sam@ravnborg.org>,
	Jani Nikula <jani.nikula@intel.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	=?utf-8?B?TWHDrXJh?= Canal <mairacanal@riseup.net>,
	=?utf-8?B?QW5kcsOp?= Almeida <andrealmeid@igalia.com>,
	Qingqing Zhuo <qingqing.zhuo@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	Hersen Wu <hersenxs.wu@amd.com>, Fangzhi Zuo <jerry.zuo@amd.com>,
	Stylon Wang <stylon.wang@amd.com>, Alan Liu <haoping.liu@amd.com>,
	Wayne Lin <Wayne.Lin@amd.com>, Aaron Liu <aaron.liu@amd.com>,
	Melissa Wen <mwen@igalia.com>,
	Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
	David Tadokoro <davidbtadokoro@usp.br>,
	Wenjing Liu <wenjing.liu@amd.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
	Roman Li <roman.li@amd.com>,
	=?utf-8?Q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= <samsagax@gmail.com>,
	Dave Airlie <airlied@redhat.com>,
	Russell King <linux@armlinux.org.uk>,
	Liviu Dudau <liviu.dudau@arm.com>, Joel Stanley <joel@jms.id.au>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	Inki Dae <inki.dae@samsung.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Stefan Agner <stefan@agner.ch>, Alison Wang <alison.wang@nxp.com>,
	Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
	Noralf =?utf-8?Q?Tr=C3=B8nnes?= <noralf@tronnes.org>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Tian Tao <tiantao6@hisilicon.com>,
	Danilo Krummrich <dakr@redhat.com>,
	Deepak Rawat <drawat.floss@gmail.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Ville =?utf-8?B?U3lyasOkbMOk?= <ville.syrjala@linux.intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>,
	Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
	Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Luca Coelho <luciano.coelho@intel.com>,
	Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Vinod Govindapillai <vinod.govindapillai@intel.com>,
	=?utf-8?Q?=C5=81ukasz?= Bartosik <lb@semihalf.com>,
	Anusha Srivatsa <anusha.srivatsa@intel.com>,
	Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
	Uma Shankar <uma.shankar@intel.com>,
	Imre Deak <imre.deak@intel.com>,
	Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
	Swati Sharma <swati2.sharma@intel.com>,
	Jouni =?utf-8?B?SMO2Z2FuZGVy?= <jouni.hogander@intel.com>,
	Mika Kahola <mika.kahola@intel.com>,
	=?utf-8?B?Sm9zw6k=?= Roberto de Souza <jose.souza@intel.com>,
	Arun R Murthy <arun.r.murthy@intel.com>,
	Gustavo Sousa <gustavo.sousa@intel.com>,
	Khaled Almahallawy <khaled.almahallawy@intel.com>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	Andi Shyti <andi.shyti@linux.intel.com>,
	Nirmoy Das <nirmoy.das@intel.com>, Fei Yang <fei.yang@intel.com>,
	Animesh Manna <animesh.manna@intel.com>,
	Deepak R Varma <drv@mailo.com>,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Vandita Kulkarni <vandita.kulkarni@intel.com>,
	Suraj Kandpal <suraj.kandpal@intel.com>,
	Drew Davenport <ddavenport@chromium.org>,
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Dan Carpenter <error27@gmail.com>,
	Paul Cercueil <paul@crapouillou.net>,
	Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Rob Clark <robdclark@gmail.com>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Vinod Polimera <quic_vpolimer@quicinc.com>,
	Jiasheng Jiang <jiasheng@iscas.ac.cn>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Jessica Zhang <quic_jesszhan@quicinc.com>,
	Liu Shixin <liushixin2@huawei.com>, Marek Vasut <marex@denx.de>,
	Ben Skeggs <bskeggs@redhat.com>, Karol Herbst <kherbst@redhat.com>,
	Lyude Paul <lyude@redhat.com>, Tomi Valkeinen <tomba@kernel.org>,
	Emma Anholt <emma@anholt.net>, Gerd Hoffmann <kraxel@redhat.com>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Sandy Huang <hjc@rock-chips.com>,
	Heiko =?utf-8?Q?St=C3=BCbner?= <heiko@sntech.de>,
	Orson Zhai <orsonzhai@gmail.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Alain Volmat <alain.volmat@foss.st.com>,
	Yannick Fertre <yannick.fertre@foss.st.com>,
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
	Philippe Cornu <philippe.cornu@foss.st.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Mikko Perttunen <mperttunen@nvidia.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Jyri Sarha <jyri.sarha@iki.fi>,
	David Lechner <david@lechnology.com>,
	Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
	Melissa Wen <melissa.srw@gmail.com>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Michal Simek <michal.simek@amd.com>,
	Haneen Mohammed <hamohammed.sa@gmail.com>,
	linux-hyperv@vger.kernel.org, linux-aspeed@lists.ozlabs.org,
	nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org,
	Yongqin Liu <yongqin.liu@linaro.org>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Fabio Estevam <festevam@gmail.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Jerome Brunet <jbrunet@baylibre.com>,
	linux-samsung-soc@vger.kernel.org, amd-gfx@lists.freedesktop.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-rockchip@lists.infradead.org,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	spice-devel@lists.freedesktop.org, linux-sunxi@lists.linux.dev,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org,
	linux-mediatek@lists.infradead.org, xen-devel@lists.xenproject.org,
	linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org,
	Gurchetan Singh <gurchetansingh@chromium.org>,
	Sean Paul <sean@poorly.run>, linux-arm-kernel@lists.infradead.org,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
	Andrew Jeffery <andrew@aj.id.au>, linux-mips@vger.kernel.org,
	Chia-I Wu <olvaffe@gmail.com>, linux-renesas-soc@vger.kernel.org,
	kernel@pengutronix.de, John Stultz <jstultz@google.com>,
	freedreno@lists.freedesktop.org,
	Lucas Stach <l.stach@pengutronix.de>
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
Message-ID: <20230712105432.urgwb4zzwgsyfbwq@pengutronix.de>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <abf26a82-4f17-51f2-5753-785f8516a81a@suse.de>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="snmthjfbxwt65cnd"
Content-Disposition: inline
In-Reply-To: <abf26a82-4f17-51f2-5753-785f8516a81a@suse.de>
X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2
X-SA-Exim-Mail-From: ukl@pengutronix.de
X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false
X-PTX-Original-Recipient: xen-devel@lists.xenproject.org


--snmthjfbxwt65cnd
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello Thomas,

On Wed, Jul 12, 2023 at 12:19:37PM +0200, Thomas Zimmermann wrote:
> Am 12.07.23 um 11:46 schrieb Uwe Kleine-K=F6nig:
> > Hello,
> >=20
> > while I debugged an issue in the imx-lcdc driver I was constantly
> > irritated about struct drm_device pointer variables being named "dev"
> > because with that name I usually expect a struct device pointer.
> >=20
> > I think there is a big benefit when these are all renamed to "drm_dev".
>=20
> If you rename drm_crtc.dev, you should also address *all* other data
> structures.

Yes. Changing drm_crtc::dev was some effort, so I thought to send that
one out before doing the same to

	drm_dp_mst_topology_mgr
	drm_atomic_state
	drm_master
	drm_bridge
	drm_client_dev
	drm_connector
	drm_debugfs_entry
	drm_encoder
	drm_fb_helper
	drm_minor
	drm_framebuffer
	drm_gem_object
	drm_plane
	drm_property
	drm_property_blob
	drm_vblank_crtc

when in the end the intention isn't welcome.

> > I have no strong preference here though, so "drmdev" or "drm" are fine
> > for me, too. Let the bikesheding begin!
>=20
> We've discussed this to death. IIRC 'drm' would be the prefered choice.

"drm" at least has the advantage to be the 2nd most common name. With
Paul Kocialkowski prefering "drm_dev" there is no clear favourite yet.
Maybe all the other people with strong opinions are dead if this was
"discussed to death" before? :-)

Best regards
Uwe

--=20
Pengutronix e.K.                           | Uwe Kleine-K=F6nig            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

--snmthjfbxwt65cnd
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmSuhmcACgkQj4D7WH0S
/k6NWgf9G1hRA99SMHoFQ5uekFovv/T9dA7iGwATGfa0pA+aMgH5SZMa9Xo09rLQ
52Kp+NCWHQPmebyjTq3+9ZFw2zfKPjA+5Ud9RKDb06qDXdZv8jJQzOpWJ4xY9gKJ
+6UChGpG+5T3+1qDhh5PhwAPA0/bOUEAB4Tu+Loy5hnXtgRFCNZahebc5WGRSx+i
2p8d7IjESE+uwE+SEmfQRShUtMk3npEoGtMzVEXFSPWEBNMLymHTbyhIyECaOO4P
mneizN+uZGRji9kX9TcJzqFQlMl9hccUcxawJZ2xi6KWy7sbRaHYm+lpjXwCy3Gq
zmcEaEvrnGjEdXFUWuczv2aDrAikxA==
=/ac8
-----END PGP SIGNATURE-----

--snmthjfbxwt65cnd--


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 10:59:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 10:59:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562372.879026 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXZ9-0004uJ-0G; Wed, 12 Jul 2023 10:59:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562372.879026; Wed, 12 Jul 2023 10:59:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXZ8-0004uC-Tq; Wed, 12 Jul 2023 10:59:26 +0000
Received: by outflank-mailman (input) for mailman id 562372;
 Wed, 12 Jul 2023 10:59:25 +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 <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJXZ7-0004u6-ST
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:59:25 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on20630.outbound.protection.outlook.com
 [2a01:111:f400:fe12::630])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 28f2157b-20a3-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 12:59:23 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by DBBPR04MB7833.eurprd04.prod.outlook.com (2603:10a6:10:1ef::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 10:59:21 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 10:59:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 28f2157b-20a3-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hPW+j7P8W4En8zUbAAz4f50vLBpnAXZ7rEyyVn0w5q5HvnggI3vEcVOZup3AMPwQuT714UvZf481IhftMjBvmibTK8sPR3lLjxihVpZoHyirthw6zb+zMkyVjonYxjj5Grra5N9uwcuwICnrnWPX/KkJ5ILCVa8MnmeLlzBBNiD+NtvNVMda0yFB+ja+OAh6OdaIUMBoqGU5N4rI6rfWk3JJ8qDXf4n4ARMxiFwT2oXRxBE6edbbo+6ctvC4WxFp6rNokZYnj6v1206j5sK04rXYVWAnlylUhWLcLd60AEYa+UMytJ56qcyV3H9MMiTEUlZgFdNa/HuYb8Add2aoPA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3mhO9XPSu9CQySCs0dqtRatUFWGeHo7Qth9MqNNK4FU=;
 b=YIz7riKW//pI6nMfsmTkt/qCJL6jyAXadGugy0WZUImQwa1WmqpFQDs6/V8Hbr3rv0/bBODVrseCy2AOgevAjjEuDJqtt1TR728G9ZzEEPNtPfEnUNYymCvLyDVBddheRM2+IegSxkoe8Grjqde4Mw3zXoIGPVF059n/7QwwOfuIQwkHXu4Bb3oKPDCkXPlN3UPitZ2nMs2sSxV+fcQuc/yJ/npJkj7o0UAbgSFTT4Cf4gfW5Ti1jga7ZqNxREzOplxVt7qiEiGUT9C3ClmM3zFBhkw2vCvjT3LeeSKeACmlpXK2v8UJM819cFxE/3ATame5fK6havC3bgqvCxiYgg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3mhO9XPSu9CQySCs0dqtRatUFWGeHo7Qth9MqNNK4FU=;
 b=oz9gb+rxIvczTFMc21FYj2iQ4XQvKY4a/AG/2r9jkzuq67bjUZn6mN4SftkPcxbVQ8cORaHbvz+c4dwL0/bNIAki5JdRaOvvRv+OHNcYwqoDCAvndVGlJl1fuT9N5K0qzwikoeA+kvPg63tU5T+xuvL/MKAxhttyqXEpgK3CivpJRMaG/iU8qtnfmsSkoWDSw1s7ccuR5oXEvIzU0CSFdLtjYnR1Nx94krOAgLeb0sjZrrsB7FpkrypM/5hjEVl4IA8g4mws+yTy6TKywlCOd0LapW0l0q6SP7tvuK19WNEZXuUz/F7CDdJF8G6rkH1KDjKIfoAsDVvck7/hnFYF2g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ffe43685-77fc-27bd-cd40-a447e7094129@suse.com>
Date: Wed, 12 Jul 2023 12:59:18 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v3 15/15] xen: fix violations of MISRA C:2012 Rule 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
 <7a58c9341d10ef79e117ac35da048bbb088ec5d0.1689152719.git.gianluca.luparini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <7a58c9341d10ef79e117ac35da048bbb088ec5d0.1689152719.git.gianluca.luparini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0148.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:96::9) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DBBPR04MB7833:EE_
X-MS-Office365-Filtering-Correlation-Id: cc07528c-1de7-4fb0-144d-08db82c70bb3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	j2E9GgE4g/ptloFszVgf4rWK9M/V9OQuJ/MuxAXjfNUG6q0JeXYSCdenBVhBofrvy7287ssRNsWE7jSfvpeAX/nepw/sQec3KxH68IJkZ1DegLwTfaaJihbQEZAeQzG1G9hO1bshREfecb3QB6wOGdZkq3Z29s0mhGfjU3sKvEzaAdWnxD35wavFUnZH0WfAtjGWPVCLBwPi+XyJT+HPVGENU9CLvU2FsH6PKuKd0NseeKmd70wn9OF2HxcrmuVJQfjDhEQoRvFHizZOV6lEukXCDTICN7oV/VlhM0K923AAFzXpD5zLEuBL+mSWOSQTczidFXwG0SamkbkxOqq7zBmwFF5XxYHsXWgcdB7CdKUzmgKcSq42XiTSXVjy3qf2cEwI4ZZz68iEG6j5jjVaJNqSs8+3PDm/NWdSfETT0kFdJ8bkNIEYlaloS2xR94FJV8KJ9OhD/FkhGsc0JDr8Xj3nrDHpCrSwX7cd+2HwL9Hurgu0btjNiGdKAsKIKA5Z+GbIF1FPCuKYm2N7OcpBvyI0PsLIaCbjoWG8GqbygV6JIkoioHgsR02VY1RZYtZsFw8pHPPIoCm2vG9aLBvJw4GTWs/E4QjIZGWp0VeLEhEPCYsh49nv91ZWYbERvFxW8b1vei47ecQMGTbRJ5BMLQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(39860400002)(136003)(366004)(396003)(376002)(451199021)(7416002)(6916009)(66946007)(66476007)(66556008)(4326008)(316002)(41300700001)(2906002)(478600001)(31686004)(8936002)(5660300002)(8676002)(54906003)(6666004)(6486002)(6512007)(26005)(53546011)(6506007)(186003)(36756003)(38100700002)(2616005)(86362001)(31696002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount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NHoxRms5SVlOQVB6b1QrTXRFQWdTTmtUWDZTRUF5QlVPcXR4?=
 =?utf-8?B?Zi9JVVJtK24xcUhpcU4xbzEwOFBhMzBsMUFkTlNsTzBnazNQRElyWHhqM05X?=
 =?utf-8?B?SXBjdmw1RGh2RVNrVmZlZ2hLUU51SC9uTDFremtORFJrUmNsVUUwTTlQQzA1?=
 =?utf-8?B?OWFLWUJPTkVRNitQRktsWXMyV2k0ck40TkVydVBrd0VnR2lUSkwwbTh2eUZ4?=
 =?utf-8?B?MDhSYWpXdXp1T2grNWs1U2FEeCtZUVkvRVRneEthMDJjS2FrcHMzdkswQXZv?=
 =?utf-8?B?VUdpdkhKbHZVU0I4aXhSV3NKT3grK1E3enhDMDdvMUNnSGRpSENMMEQ3bHpT?=
 =?utf-8?B?VGdHN0J3a3NIOWJZblBvYzhIMmxaemxtWUZTRklwSVhQbUxTSkxZdXBzb0I3?=
 =?utf-8?Q?j/LapEnxmkrIV07HmoZi6mrhA?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: cc07528c-1de7-4fb0-144d-08db82c70bb3
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 10:59:21.0513
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: IMmsZtCIRQL3O7+X4NUM8BSKTe/5K3h2WhtEf4Au0ExuMz3zPhmOi1BMh2AanS9MXC9ZBIKx9fOXdDtp5AiD/w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7833

On 12.07.2023 12:32, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type.
> 
> Fot the sake of uniformity, the following changes are made:
> - add the 'U' suffix to all integer constants before the
>   '?' operator in 'bitops.h'
> 
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Acked-by: Jan Beulich <jbeulich@suse.com>
with ...

> --- a/xen/lib/muldiv64.c
> +++ b/xen/lib/muldiv64.c
> @@ -27,7 +27,7 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)
>      rh = (uint64_t)u.l.high * (uint64_t)b;
>      rh += (rl >> 32);
>      res.l.high = rh / c;
> -    res.l.low = (((rh % c) << 32) + (rl & 0xffffffff)) / c;
> +    res.l.low = (((rh % c) << 32) + ((uint32_t)rl)) / c;

... the excess pair of parentheses here dropped (which I'll do while
committing).

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 11:04:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 11:04:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562379.879036 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXe2-0006Nj-Mi; Wed, 12 Jul 2023 11:04:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562379.879036; Wed, 12 Jul 2023 11:04:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXe2-0006Nc-Jw; Wed, 12 Jul 2023 11:04:30 +0000
Received: by outflank-mailman (input) for mailman id 562379;
 Wed, 12 Jul 2023 11:04:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=MfTd=C6=pengutronix.de=ukl@srs-se1.protection.inumbo.net>)
 id 1qJXdb-0006MS-2X
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 11:04:03 +0000
Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de
 [2001:67c:670:201:290:27ff:fe1d:cc33])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cf3052fd-20a3-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 13:04:02 +0200 (CEST)
Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2])
 by metis.ext.pengutronix.de with esmtps
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJXcX-0006Kb-FX; Wed, 12 Jul 2023 13:02:57 +0200
Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de)
 by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJXcU-00Drn9-6o; Wed, 12 Jul 2023 13:02:54 +0200
Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJXcT-004ID3-Dy; Wed, 12 Jul 2023 13:02:53 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cf3052fd-20a3-11ee-b239-6b7b168915f2
Date: Wed, 12 Jul 2023 13:02:53 +0200
From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
To: Christian =?utf-8?B?S8O2bmln?= <christian.koenig@amd.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	Alex Deucher <alexander.deucher@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
	Hamza Mahfooz <hamza.mahfooz@amd.com>,
	Javier Martinez Canillas <javierm@redhat.com>,
	Guchun Chen <guchun.chen@amd.com>,
	Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
	Evan Quan <evan.quan@amd.com>, Likun Gao <Likun.Gao@amd.com>,
	Marek =?utf-8?B?T2zFocOhaw==?= <marek.olsak@amd.com>,
	David Francis <David.Francis@amd.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>, Lang Yu <Lang.Yu@amd.com>,
	Philip Yang <Philip.Yang@amd.com>,
	Yifan Zhang <yifan1.zhang@amd.com>, Tim Huang <Tim.Huang@amd.com>,
	Zack Rusin <zackr@vmware.com>, Sam Ravnborg <sam@ravnborg.org>,
	Jani Nikula <jani.nikula@intel.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	=?utf-8?B?TWHDrXJh?= Canal <mairacanal@riseup.net>,
	=?utf-8?B?QW5kcsOp?= Almeida <andrealmeid@igalia.com>,
	Qingqing Zhuo <qingqing.zhuo@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	Hersen Wu <hersenxs.wu@amd.com>, Fangzhi Zuo <jerry.zuo@amd.com>,
	Stylon Wang <stylon.wang@amd.com>, Alan Liu <haoping.liu@amd.com>,
	Wayne Lin <Wayne.Lin@amd.com>, Aaron Liu <aaron.liu@amd.com>,
	Melissa Wen <mwen@igalia.com>,
	Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
	David Tadokoro <davidbtadokoro@usp.br>,
	Wenjing Liu <wenjing.liu@amd.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
	Roman Li <roman.li@amd.com>,
	=?utf-8?Q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= <samsagax@gmail.com>,
	Dave Airlie <airlied@redhat.com>,
	Russell King <linux@armlinux.org.uk>,
	Liviu Dudau <liviu.dudau@arm.com>, Joel Stanley <joel@jms.id.au>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	Inki Dae <inki.dae@samsung.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Stefan Agner <stefan@agner.ch>, Alison Wang <alison.wang@nxp.com>,
	Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
	Noralf =?utf-8?Q?Tr=C3=B8nnes?= <noralf@tronnes.org>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Tian Tao <tiantao6@hisilicon.com>,
	Danilo Krummrich <dakr@redhat.com>,
	Deepak Rawat <drawat.floss@gmail.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Ville =?utf-8?B?U3lyasOkbMOk?= <ville.syrjala@linux.intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>,
	Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
	Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Luca Coelho <luciano.coelho@intel.com>,
	Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Vinod Govindapillai <vinod.govindapillai@intel.com>,
	=?utf-8?Q?=C5=81ukasz?= Bartosik <lb@semihalf.com>,
	Anusha Srivatsa <anusha.srivatsa@intel.com>,
	Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
	Uma Shankar <uma.shankar@intel.com>,
	Imre Deak <imre.deak@intel.com>,
	Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
	Swati Sharma <swati2.sharma@intel.com>,
	Jouni =?utf-8?B?SMO2Z2FuZGVy?= <jouni.hogander@intel.com>,
	Mika Kahola <mika.kahola@intel.com>,
	=?utf-8?B?Sm9zw6k=?= Roberto de Souza <jose.souza@intel.com>,
	Arun R Murthy <arun.r.murthy@intel.com>,
	Gustavo Sousa <gustavo.sousa@intel.com>,
	Khaled Almahallawy <khaled.almahallawy@intel.com>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	Andi Shyti <andi.shyti@linux.intel.com>,
	Nirmoy Das <nirmoy.das@intel.com>, Fei Yang <fei.yang@intel.com>,
	Animesh Manna <animesh.manna@intel.com>,
	Deepak R Varma <drv@mailo.com>,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Vandita Kulkarni <vandita.kulkarni@intel.com>,
	Suraj Kandpal <suraj.kandpal@intel.com>,
	Drew Davenport <ddavenport@chromium.org>,
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Dan Carpenter <error27@gmail.com>,
	Paul Cercueil <paul@crapouillou.net>,
	Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Rob Clark <robdclark@gmail.com>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Vinod Polimera <quic_vpolimer@quicinc.com>,
	Jiasheng Jiang <jiasheng@iscas.ac.cn>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Jessica Zhang <quic_jesszhan@quicinc.com>,
	Liu Shixin <liushixin2@huawei.com>, Marek Vasut <marex@denx.de>,
	Ben Skeggs <bskeggs@redhat.com>, Karol Herbst <kherbst@redhat.com>,
	Lyude Paul <lyude@redhat.com>, Tomi Valkeinen <tomba@kernel.org>,
	Emma Anholt <emma@anholt.net>, Gerd Hoffmann <kraxel@redhat.com>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Sandy Huang <hjc@rock-chips.com>,
	Heiko =?utf-8?Q?St=C3=BCbner?= <heiko@sntech.de>,
	Orson Zhai <orsonzhai@gmail.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Alain Volmat <alain.volmat@foss.st.com>,
	Yannick Fertre <yannick.fertre@foss.st.com>,
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
	Philippe Cornu <philippe.cornu@foss.st.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Mikko Perttunen <mperttunen@nvidia.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Jyri Sarha <jyri.sarha@iki.fi>,
	David Lechner <david@lechnology.com>,
	Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
	Melissa Wen <melissa.srw@gmail.com>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Michal Simek <michal.simek@amd.com>,
	Haneen Mohammed <hamohammed.sa@gmail.com>,
	linux-hyperv@vger.kernel.org, linux-aspeed@lists.ozlabs.org,
	nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org,
	Yongqin Liu <yongqin.liu@linaro.org>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Fabio Estevam <festevam@gmail.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Jerome Brunet <jbrunet@baylibre.com>,
	linux-samsung-soc@vger.kernel.org, amd-gfx@lists.freedesktop.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-rockchip@lists.infradead.org,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	spice-devel@lists.freedesktop.org, linux-sunxi@lists.linux.dev,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org,
	linux-mediatek@lists.infradead.org, xen-devel@lists.xenproject.org,
	linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org,
	Gurchetan Singh <gurchetansingh@chromium.org>,
	Sean Paul <sean@poorly.run>, linux-arm-kernel@lists.infradead.org,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
	Andrew Jeffery <andrew@aj.id.au>, linux-mips@vger.kernel.org,
	Chia-I Wu <olvaffe@gmail.com>, linux-renesas-soc@vger.kernel.org,
	kernel@pengutronix.de, John Stultz <jstultz@google.com>,
	freedreno@lists.freedesktop.org,
	Lucas Stach <l.stach@pengutronix.de>,
	Julia Lawall <Julia.Lawall@inria.fr>
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
Message-ID: <20230712110253.paoyrmcbvlhpfxbf@pengutronix.de>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <94eb6e4d-9384-152f-351b-ebb217411da9@amd.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="3iwy3q65ffdde3du"
Content-Disposition: inline
In-Reply-To: <94eb6e4d-9384-152f-351b-ebb217411da9@amd.com>
X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2
X-SA-Exim-Mail-From: ukl@pengutronix.de
X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false
X-PTX-Original-Recipient: xen-devel@lists.xenproject.org


--3iwy3q65ffdde3du
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 12, 2023 at 12:46:33PM +0200, Christian K=F6nig wrote:
> Am 12.07.23 um 11:46 schrieb Uwe Kleine-K=F6nig:
> > Hello,
> >=20
> > while I debugged an issue in the imx-lcdc driver I was constantly
> > irritated about struct drm_device pointer variables being named "dev"
> > because with that name I usually expect a struct device pointer.
> >=20
> > I think there is a big benefit when these are all renamed to "drm_dev".
> > I have no strong preference here though, so "drmdev" or "drm" are fine
> > for me, too. Let the bikesheding begin!
> >=20
> > Some statistics:
> >=20
> > $ git grep -ohE 'struct drm_device *\* *[^ (),;]*' v6.5-rc1 | sort | un=
iq -c | sort -n
> >        1 struct drm_device *adev_to_drm
> >        1 struct drm_device *drm_
> >        1 struct drm_device          *drm_dev
> >        1 struct drm_device        *drm_dev
> >        1 struct drm_device *pdev
> >        1 struct drm_device *rdev
> >        1 struct drm_device *vdev
> >        2 struct drm_device *dcss_drv_dev_to_drm
> >        2 struct drm_device **ddev
> >        2 struct drm_device *drm_dev_alloc
> >        2 struct drm_device *mock
> >        2 struct drm_device *p_ddev
> >        5 struct drm_device *device
> >        9 struct drm_device * dev
> >       25 struct drm_device *d
> >       95 struct drm_device *
> >      216 struct drm_device *ddev
> >      234 struct drm_device *drm_dev
> >      611 struct drm_device *drm
> >     4190 struct drm_device *dev
> >=20
> > This series starts with renaming struct drm_crtc::dev to drm_dev. If
> > it's not only me and others like the result of this effort it should be
> > followed up by adapting the other structs and the individual usages in
> > the different drivers.
> >=20
> > To make this series a bit easier handleable, I first added an alias for
> > drm_crtc::dev, then converted the drivers one after another and the last
> > patch drops the "dev" name. This has the advantage of being easier to
> > review, and if I should have missed an instance only the last patch must
> > be dropped/reverted. Also this series might conflict with other patches,
> > in this case the remaining patches can still go in (apart from the last
> > one of course). Maybe it also makes sense to delay applying the last
> > patch by one development cycle?
>=20
> When you automatically generate the patch (with cocci for example) I usua=
lly
> prefer a single patch instead.

Maybe I'm too stupid, but only parts of this patch were created by
coccinelle. I failed to convert code like

-       spin_lock_irq(&crtc->dev->event_lock);
+       spin_lock_irq(&crtc->drm_dev->event_lock);

Added Julia to Cc, maybe she has a hint?!

(Up to now it's only=20

@@
struct drm_crtc *crtc;
@@
-crtc->dev
+crtc->drm_dev

)

> Background is that this makes merge conflicts easier to handle and detect.

Really? Each file (apart from include/drm/drm_crtc.h) is only touched
once. So unless I'm missing something you don't get less or easier
conflicts by doing it all in a single patch. But you gain the freedom to
drop a patch for one driver without having to drop the rest with it. So
I still like the split version better, but I'm open to a more verbose
reasoning from your side.

> When you have multiple patches and a merge conflict because of some added
> lines using the old field the build breaks only on the last patch which
> removes the old field.

Then you can revert/drop the last patch without having to respin the
whole single patch and thus caring for still more conflicts that arise
until the new version is sent.

Best regards
Uwe

--=20
Pengutronix e.K.                           | Uwe Kleine-K=F6nig            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

--3iwy3q65ffdde3du
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmSuiFwACgkQj4D7WH0S
/k6WQAf+LFgI9NExXKHizIxlAKcu5G8zO7fFx06qBcxLI5KrCwTfZWRX4JdMKpMo
5K/qeFXK6pOtoDJOth+E/cclh0HGZybUMKHNB2GJ5tQhGAf6erqEzGtJybTMfOWT
BAMc9FTGfs+HZ5lbSIhDHSNslCbQZEWuEJczrXoi2Cvj7pmoSjyVoCLeeI+4o3Yc
SwV3JLE35b4uCAXvLtLMIQGji+tHmW00SBwsa1+biZv+ois13g+seTg5JLw6b9PG
EnXcqpqEam0LIDyZCqB65ATzcuYLrBQls79+l8OuEG1R8dCWA6To5Jw9XipxWh53
vPHVg4DCzs8uC2Zxgb1PNd/lhcHymQ==
=FqFI
-----END PGP SIGNATURE-----

--3iwy3q65ffdde3du--


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 11:10:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 11:10:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562395.879047 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXjU-0007wE-EU; Wed, 12 Jul 2023 11:10:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562395.879047; Wed, 12 Jul 2023 11:10:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXjU-0007w7-A9; Wed, 12 Jul 2023 11:10:08 +0000
Received: by outflank-mailman (input) for mailman id 562395;
 Wed, 12 Jul 2023 11:08:06 +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
 <SRS0=1Wxm=C6=inria.fr=julia.lawall@srs-se1.protection.inumbo.net>)
 id 1qJXhW-000749-9Z
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 11:08:06 +0000
Received: from mail3-relais-sop.national.inria.fr
 (mail3-relais-sop.national.inria.fr [192.134.164.104])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5ec2a468-20a4-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 13:08:03 +0200 (CEST)
Received: from hstsheraton06.h.subnet.rcn.com (HELO hadrien) ([207.180.135.5])
 by mail3-relais-sop.national.inria.fr with
 ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2023 13:07:34 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5ec2a468-20a4-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
  d=inria.fr; s=dc;
  h=date:from:to:cc:subject:in-reply-to:message-id:
   references:mime-version;
  bh=ZJpBQTRvYf3xLQYim5PgpqIBO472OK4qQBRBn5wK5Lo=;
  b=LiXL1vdteb3LQ9kRIyiqac+rKgCW2hgh2hum23eyRXq5g9LP+B8eU6Dp
   yAXUq+WJAba1z7ssx8t9t2gLhg3oemVZYeyt9D+AD8e0OAjokLOSxIaFX
   9WTYl28HsAaDebnlB3oyseEPBOV0bXJ9JOXjVMF/PU7HUlTO1JHrhIytd
   4=;
Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=julia.lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr
X-IronPort-AV: E=Sophos;i="6.01,199,1684792800"; 
   d="scan'208";a="61228938"
Date: Wed, 12 Jul 2023 07:07:32 -0400 (EDT)
From: Julia Lawall <julia.lawall@inria.fr>
To: =?ISO-8859-15?Q?Uwe_Kleine-K=F6nig?= <u.kleine-koenig@pengutronix.de>
cc: =?ISO-8859-15?Q?Christian_K=F6nig?= <christian.koenig@amd.com>, 
    Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
    Maxime Ripard <mripard@kernel.org>, 
    Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, 
    Daniel Vetter <daniel@ffwll.ch>, Alex Deucher <alexander.deucher@amd.com>, 
    "Pan, Xinhui" <Xinhui.Pan@amd.com>, 
    Harry Wentland <harry.wentland@amd.com>, Leo Li <sunpeng.li@amd.com>, 
    Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>, 
    Hamza Mahfooz <hamza.mahfooz@amd.com>, 
    Javier Martinez Canillas <javierm@redhat.com>, 
    Guchun Chen <guchun.chen@amd.com>, 
    Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>, 
    Evan Quan <evan.quan@amd.com>, Likun Gao <Likun.Gao@amd.com>, 
    =?ISO-8859-15?Q?Marek_Ol=A8=E1k?= <marek.olsak@amd.com>, 
    David Francis <David.Francis@amd.com>, 
    Hawking Zhang <Hawking.Zhang@amd.com>, Lang Yu <Lang.Yu@amd.com>, 
    Philip Yang <Philip.Yang@amd.com>, Yifan Zhang <yifan1.zhang@amd.com>, 
    Tim Huang <Tim.Huang@amd.com>, Zack Rusin <zackr@vmware.com>, 
    Sam Ravnborg <sam@ravnborg.org>, Jani Nikula <jani.nikula@intel.com>, 
    Laurent Pinchart <laurent.pinchart@ideasonboard.com>, 
    =?ISO-8859-15?Q?Ma=EDra_Canal?= <mairacanal@riseup.net>, 
    =?ISO-8859-15?Q?Andr=E9_Almeida?= <andrealmeid@igalia.com>, 
    Qingqing Zhuo <qingqing.zhuo@amd.com>, 
    Aurabindo Pillai <aurabindo.pillai@amd.com>, 
    Hersen Wu <hersenxs.wu@amd.com>, Fangzhi Zuo <jerry.zuo@amd.com>, 
    Stylon Wang <stylon.wang@amd.com>, Alan Liu <haoping.liu@amd.com>, 
    Wayne Lin <Wayne.Lin@amd.com>, Aaron Liu <aaron.liu@amd.com>, 
    Melissa Wen <mwen@igalia.com>, 
    Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>, 
    David Tadokoro <davidbtadokoro@usp.br>, Wenjing Liu <wenjing.liu@amd.com>, 
    Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, 
    Mario Limonciello <mario.limonciello@amd.com>, 
    Alexey Kodanev <aleksei.kodanev@bell-sw.com>, Roman Li <roman.li@amd.com>, 
    =?ISO-8859-15?Q?Joaqu=EDn_Ignacio_Aramend=EDa?= <samsagax@gmail.com>, 
    Dave Airlie <airlied@redhat.com>, Russell King <linux@armlinux.org.uk>, 
    Liviu Dudau <liviu.dudau@arm.com>, Joel Stanley <joel@jms.id.au>, 
    Boris Brezillon <bbrezillon@kernel.org>, 
    Nicolas Ferre <nicolas.ferre@microchip.com>, 
    Alexandre Belloni <alexandre.belloni@bootlin.com>, 
    Claudiu Beznea <claudiu.beznea@microchip.com>, 
    Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, 
    Kyungmin Park <kyungmin.park@samsung.com>, 
    Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, 
    Stefan Agner <stefan@agner.ch>, Alison Wang <alison.wang@nxp.com>, 
    Patrik Jakobsson <patrik.r.jakobsson@gmail.com>, 
    =?ISO-8859-15?Q?Noralf_Tr=F8nnes?= <noralf@tronnes.org>, 
    Xinliang Liu <xinliang.liu@linaro.org>, Tian Tao <tiantao6@hisilicon.com>, 
    Danilo Krummrich <dakr@redhat.com>, Deepak Rawat <drawat.floss@gmail.com>, 
    Jani Nikula <jani.nikula@linux.intel.com>, 
    Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
    Rodrigo Vivi <rodrigo.vivi@intel.com>, 
    Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>, 
    =?ISO-8859-15?Q?Ville_Syrj=E4l=E4?= <ville.syrjala@linux.intel.com>, 
    Lucas De Marchi <lucas.demarchi@intel.com>, 
    Ankit Nautiyal <ankit.k.nautiyal@intel.com>, 
    Andrzej Hajda <andrzej.hajda@intel.com>, 
    Matt Roper <matthew.d.roper@intel.com>, 
    Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>, 
    Radhakrishna Sripada <radhakrishna.sripada@intel.com>, 
    Hans de Goede <hdegoede@redhat.com>, 
    Luca Coelho <luciano.coelho@intel.com>, 
    Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>, 
    Kai Vehmanen <kai.vehmanen@linux.intel.com>, 
    Vinod Govindapillai <vinod.govindapillai@intel.com>, 
    =?ISO-8859-2?Q?=A3ukasz_Bartosik?= <lb@semihalf.com>, 
    Anusha Srivatsa <anusha.srivatsa@intel.com>, 
    Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>, 
    Uma Shankar <uma.shankar@intel.com>, Imre Deak <imre.deak@intel.com>, 
    Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>, 
    Swati Sharma <swati2.sharma@intel.com>, 
    =?ISO-8859-15?Q?Jouni_H=F6gander?= <jouni.hogander@intel.com>, 
    Mika Kahola <mika.kahola@intel.com>, 
    =?ISO-8859-15?Q?Jos=E9_Roberto_de_Souza?= <jose.souza@intel.com>, 
    Arun R Murthy <arun.r.murthy@intel.com>, 
    Gustavo Sousa <gustavo.sousa@intel.com>, 
    Khaled Almahallawy <khaled.almahallawy@intel.com>, 
    Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>, 
    Andi Shyti <andi.shyti@linux.intel.com>, Nirmoy Das <nirmoy.das@intel.com>, 
    Fei Yang <fei.yang@intel.com>, Animesh Manna <animesh.manna@intel.com>, 
    Deepak R Varma <drv@mailo.com>, "Jiri Slaby (SUSE)" <jirislaby@kernel.org>, 
    Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, 
    Vandita Kulkarni <vandita.kulkarni@intel.com>, 
    Suraj Kandpal <suraj.kandpal@intel.com>, 
    Drew Davenport <ddavenport@chromium.org>, 
    Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>, 
    Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, 
    Philipp Zabel <p.zabel@pengutronix.de>, Dan Carpenter <error27@gmail.com>, 
    Paul Cercueil <paul@crapouillou.net>, 
    Anitha Chrisanthus <anitha.chrisanthus@intel.com>, 
    Paul Kocialkowski <paul.kocialkowski@bootlin.com>, 
    Linus Walleij <linus.walleij@linaro.org>, 
    Chun-Kuang Hu <chunkuang.hu@kernel.org>, 
    Matthias Brugger <matthias.bgg@gmail.com>, 
    Neil Armstrong <neil.armstrong@linaro.org>, 
    Kevin Hilman <khilman@baylibre.com>, Rob Clark <robdclark@gmail.com>, 
    Abhinav Kumar <quic_abhinavk@quicinc.com>, 
    Vinod Polimera <quic_vpolimer@quicinc.com>, 
    Jiasheng Jiang <jiasheng@iscas.ac.cn>, 
    Konrad Dybcio <konrad.dybcio@linaro.org>, 
    Jessica Zhang <quic_jesszhan@quicinc.com>, 
    Liu Shixin <liushixin2@huawei.com>, Marek Vasut <marex@denx.de>, 
    Ben Skeggs <bskeggs@redhat.com>, Karol Herbst <kherbst@redhat.com>, 
    Lyude Paul <lyude@redhat.com>, Tomi Valkeinen <tomba@kernel.org>, 
    Emma Anholt <emma@anholt.net>, Gerd Hoffmann <kraxel@redhat.com>, 
    Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>, 
    Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>, 
    Wolfram Sang <wsa+renesas@sang-engineering.com>, 
    Geert Uytterhoeven <geert+renesas@glider.be>, 
    Biju Das <biju.das.jz@bp.renesas.com>, Sandy Huang <hjc@rock-chips.com>, 
    =?ISO-8859-15?Q?Heiko_St=FCbner?= <heiko@sntech.de>, 
    Orson Zhai <orsonzhai@gmail.com>, 
    Baolin Wang <baolin.wang@linux.alibaba.com>, 
    Chunyan Zhang <zhang.lyra@gmail.com>, 
    Alain Volmat <alain.volmat@foss.st.com>, 
    Yannick Fertre <yannick.fertre@foss.st.com>, 
    Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>, 
    Philippe Cornu <philippe.cornu@foss.st.com>, 
    Maxime Coquelin <mcoquelin.stm32@gmail.com>, 
    Alexandre Torgue <alexandre.torgue@foss.st.com>, 
    Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, 
    Samuel Holland <samuel@sholland.org>, 
    Thierry Reding <thierry.reding@gmail.com>, 
    Mikko Perttunen <mperttunen@nvidia.com>, 
    Jonathan Hunter <jonathanh@nvidia.com>, Jyri Sarha <jyri.sarha@iki.fi>, 
    David Lechner <david@lechnology.com>, 
    Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>, 
    Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>, 
    Melissa Wen <melissa.srw@gmail.com>, 
    Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
    Michal Simek <michal.simek@amd.com>, 
    Haneen Mohammed <hamohammed.sa@gmail.com>, linux-hyperv@vger.kernel.org, 
    linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org, 
    dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, 
    Yongqin Liu <yongqin.liu@linaro.org>, 
    Alim Akhtar <alim.akhtar@samsung.com>, 
    Marijn Suijten <marijn.suijten@somainline.org>, 
    Fabio Estevam <festevam@gmail.com>, Sumit Semwal <sumit.semwal@linaro.org>, 
    Jerome Brunet <jbrunet@baylibre.com>, linux-samsung-soc@vger.kernel.org, 
    amd-gfx@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, 
    linux-rockchip@lists.infradead.org, 
    Xinwei Kong <kong.kongxinwei@hisilicon.com>, 
    VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>, 
    NXP Linux Team <linux-imx@nxp.com>, spice-devel@lists.freedesktop.org, 
    linux-sunxi@lists.linux.dev, 
    Martin Blumenstingl <martin.blumenstingl@googlemail.com>, 
    linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, 
    linux-mediatek@lists.infradead.org, xen-devel@lists.xenproject.org, 
    linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org, 
    Gurchetan Singh <gurchetansingh@chromium.org>, Sean Paul <sean@poorly.run>, 
    linux-arm-kernel@lists.infradead.org, 
    AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, 
    Andrew Jeffery <andrew@aj.id.au>, linux-mips@vger.kernel.org, 
    Chia-I Wu <olvaffe@gmail.com>, linux-renesas-soc@vger.kernel.org, 
    kernel@pengutronix.de, John Stultz <jstultz@google.com>, 
    freedreno@lists.freedesktop.org, Lucas Stach <l.stach@pengutronix.de>, 
    Julia Lawall <Julia.Lawall@inria.fr>
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
In-Reply-To: <20230712110253.paoyrmcbvlhpfxbf@pengutronix.de>
Message-ID: <acd7913-3c42-7354-434-a826b6c8718@inria.fr>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de> <94eb6e4d-9384-152f-351b-ebb217411da9@amd.com> <20230712110253.paoyrmcbvlhpfxbf@pengutronix.de>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="8323329-1690266391-1689160075=:3129"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-1690266391-1689160075=:3129
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8BIT



On Wed, 12 Jul 2023, Uwe Kleine-König wrote:

> On Wed, Jul 12, 2023 at 12:46:33PM +0200, Christian König wrote:
> > Am 12.07.23 um 11:46 schrieb Uwe Kleine-König:
> > > Hello,
> > >
> > > while I debugged an issue in the imx-lcdc driver I was constantly
> > > irritated about struct drm_device pointer variables being named "dev"
> > > because with that name I usually expect a struct device pointer.
> > >
> > > I think there is a big benefit when these are all renamed to "drm_dev".
> > > I have no strong preference here though, so "drmdev" or "drm" are fine
> > > for me, too. Let the bikesheding begin!
> > >
> > > Some statistics:
> > >
> > > $ git grep -ohE 'struct drm_device *\* *[^ (),;]*' v6.5-rc1 | sort | uniq -c | sort -n
> > >        1 struct drm_device *adev_to_drm
> > >        1 struct drm_device *drm_
> > >        1 struct drm_device          *drm_dev
> > >        1 struct drm_device        *drm_dev
> > >        1 struct drm_device *pdev
> > >        1 struct drm_device *rdev
> > >        1 struct drm_device *vdev
> > >        2 struct drm_device *dcss_drv_dev_to_drm
> > >        2 struct drm_device **ddev
> > >        2 struct drm_device *drm_dev_alloc
> > >        2 struct drm_device *mock
> > >        2 struct drm_device *p_ddev
> > >        5 struct drm_device *device
> > >        9 struct drm_device * dev
> > >       25 struct drm_device *d
> > >       95 struct drm_device *
> > >      216 struct drm_device *ddev
> > >      234 struct drm_device *drm_dev
> > >      611 struct drm_device *drm
> > >     4190 struct drm_device *dev
> > >
> > > This series starts with renaming struct drm_crtc::dev to drm_dev. If
> > > it's not only me and others like the result of this effort it should be
> > > followed up by adapting the other structs and the individual usages in
> > > the different drivers.
> > >
> > > To make this series a bit easier handleable, I first added an alias for
> > > drm_crtc::dev, then converted the drivers one after another and the last
> > > patch drops the "dev" name. This has the advantage of being easier to
> > > review, and if I should have missed an instance only the last patch must
> > > be dropped/reverted. Also this series might conflict with other patches,
> > > in this case the remaining patches can still go in (apart from the last
> > > one of course). Maybe it also makes sense to delay applying the last
> > > patch by one development cycle?
> >
> > When you automatically generate the patch (with cocci for example) I usually
> > prefer a single patch instead.
>
> Maybe I'm too stupid, but only parts of this patch were created by
> coccinelle. I failed to convert code like
>
> -       spin_lock_irq(&crtc->dev->event_lock);
> +       spin_lock_irq(&crtc->drm_dev->event_lock);
>
> Added Julia to Cc, maybe she has a hint?!

A priori, I see no reason why the rule below should not apply to the above
code.  Is there a parsing problem in the containing function?  You can run

spatch --parse-c file.c

If there is a paring problem, please let me know and i will try to fix it
so the while thing can be done automatically.

julia

>
> (Up to now it's only
>
> @@
> struct drm_crtc *crtc;
> @@
> -crtc->dev
> +crtc->drm_dev
>
> )
>
> > Background is that this makes merge conflicts easier to handle and detect.
>
> Really? Each file (apart from include/drm/drm_crtc.h) is only touched
> once. So unless I'm missing something you don't get less or easier
> conflicts by doing it all in a single patch. But you gain the freedom to
> drop a patch for one driver without having to drop the rest with it. So
> I still like the split version better, but I'm open to a more verbose
> reasoning from your side.
>
> > When you have multiple patches and a merge conflict because of some added
> > lines using the old field the build breaks only on the last patch which
> > removes the old field.
>
> Then you can revert/drop the last patch without having to respin the
> whole single patch and thus caring for still more conflicts that arise
> until the new version is sent.
>
> Best regards
> Uwe
>
> --
> Pengutronix e.K.                           | Uwe Kleine-König            |
> Industrial Linux Solutions                 | https://www.pengutronix.de/ |
>
--8323329-1690266391-1689160075=:3129--


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 11:11:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 11:11:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562400.879056 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXks-0008TK-OC; Wed, 12 Jul 2023 11:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562400.879056; Wed, 12 Jul 2023 11:11:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXks-0008TD-LO; Wed, 12 Jul 2023 11:11:34 +0000
Received: by outflank-mailman (input) for mailman id 562400;
 Wed, 12 Jul 2023 11:11:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=v/dJ=C6=epam.com=prvs=1557cd3329=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qJXks-0008T7-46
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 11:11:34 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dae9a0aa-20a4-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 13:11:32 +0200 (CEST)
Received: from pps.filterd (m0174680.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36C7KE8Y031295; Wed, 12 Jul 2023 11:09:16 GMT
Received: from eur05-db8-obe.outbound.protection.outlook.com
 (mail-db8eur05lp2113.outbound.protection.outlook.com [104.47.17.113])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3rs96gtt35-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Wed, 12 Jul 2023 11:09:16 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by DB9PR03MB7417.eurprd03.prod.outlook.com (2603:10a6:10:225::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Wed, 12 Jul
 2023 11:09:12 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::c192:26de:9053:ab05]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::c192:26de:9053:ab05%6]) with mapi id 15.20.6565.028; Wed, 12 Jul 2023
 11:09:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dae9a0aa-20a4-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hJ2Fs0Re0laEhWB9s13xkRX73E35Ti5MV9Ig2K9fxjaSSTd95sw4lT08dh9OeTuZEBjkrLJ6c/e6R0mfrMfX0ZODrj35JhEAmzHYHsA5m6+QLVbwRtJbUMcsFKagCQ+/aACRbUY0qhtxIjebg6GRww95dY3K0glRihpPgalUgO7wSWOrfCafXO9UfOW/skLTEqzlsOiGkSFHFTQ2cgugmUPyrdgVGurni6yCRB2qdrML0CgDBugo3XLAVRxEa/qhiswh8R55aX8H/WQh7isZ8IkkOevrsztY9bcQ7oKDPnckB+T1F+o0f8Qu6fOeNSaOln63TqKuJzAUpDXAbslSKA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yBQplZJ/bBI+Ds3UBCsq/QIdWwTo2b0qGVSwh7iiGTI=;
 b=G8WTmcXMVOpbO+RZmjtynoIOPWdyLrSf81+TfHFtqE647B3Vxf+S0Kd+tYyheoKHktiLYrkSR4FSozS3uPOqz6D1zPn0LvrPoc0cn5KeQ2GPuIOvxNHqn2GROYmVgQjsy/x4F7mHGWw9H1nCe50u6ak7sKbtwySWklUEDp5nNWM/VoDDHjkMFwD37pdRvRO9aKNn/eYA/WbKCjwJRCRNJQ3jWgBDBd6hK4V2VBmIff36Y7bLt2I7YauFS0Z7JIkoK0G7sfCJsC5zU9dbWltJqPtlxG+ewAuPMjnYyfZrBhibn8otoxUqbX0BObzeHe7gk34ryXjApDIfQUGlTxHwKA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yBQplZJ/bBI+Ds3UBCsq/QIdWwTo2b0qGVSwh7iiGTI=;
 b=M02N2DGSswgWbM2LQjAJrsysz6hZWQA8l4f1LoppgqZmNU7iV1DRWQo2G2/X4jC5+HH6ydZNzFbXD+bH+d3zIpFZDVAIoaohM0Vr8diw+KA3Cx2o9g24gndcj0vQc952gJGvuaCO6wntfpblKiXwR1hd4j0fdGF9c2sZQjSL1pdYmhBfsIdDh1EBYdKSk9gz3ymgR1Sa1wf0gC1u4ULs8bQij2mAbAB2aWaHMSi8qh49TufudrLmAwo02ryqAs2BFZKKylEk+XTTnxZQGI7tGXCe7ssTstthucvi47fsyf08uAq9CtQUP4zd2U5gt7Z5t94sI1O6yirFmsvyPJHsjQ==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: Jan Beulich <jbeulich@suse.com>,
        =?iso-8859-1?Q?Roger_Pau_Monn=E9?=
	<roger.pau@citrix.co>
CC: Andrew Cooper <andrew.cooper3@citrix.com>,
        =?iso-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>,
        Wei Liu
	<wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
        Julien Grall
	<julien@xen.org>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Jun Nakajima
	<jun.nakajima@intel.com>,
        Kevin Tian <kevin.tian@intel.com>, Paul Durrant
	<paul@xen.org>,
        Oleksandr Tyshchenko <olekstysh@gmail.com>,
        Oleksandr
 Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
        "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [RFC PATCH] pci: introduce per-domain PCI rwlock
Thread-Topic: [RFC PATCH] pci: introduce per-domain PCI rwlock
Thread-Index: AQHZs5ESsjHhLtlMU0qzCbDGds6cO6+0XLQAgABxyYCAAQ0QAIAAE50A
Date: Wed, 12 Jul 2023 11:09:12 +0000
Message-ID: <87wmz5fktl.fsf@epam.com>
References: <20230711004537.888185-1-volodymyr_babchuk@epam.com>
 <e6ca0ef1-fb66-d923-388f-79cfc20d1626@suse.com> <874jmagulx.fsf@epam.com>
 <c0ba8144-3e3e-1f98-a719-ea03e9f29495@suse.com>
In-Reply-To: <c0ba8144-3e3e-1f98-a719-ea03e9f29495@suse.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: mu4e 1.8.9; emacs 28.2
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|DB9PR03MB7417:EE_
x-ms-office365-filtering-correlation-id: 01981ee1-4a4c-4357-249a-08db82c86c17
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 qPbB/bPpKmydvFuYjjv4y2D9uPEq8WTpIQdsuDFaSbgQh5najjC3OEICU0XpAxNqBdQWbcrnPoOm3MP4QGPIYsJNii8/NRVbt+kc5KpouIVehdOr48jz8bjm4/ZRQkTEMBaCsB70v6POBoUzhfs59wKnvzMyHgBgOYL7OTCq039pka8WWXFUPV3PHt9qayxMzMXy7iTx5DXnYDTwO91h9y8Z4QceJu030D7l0t9i2RjbMKTz686p+Yy9DtiPZRJDmvoIr0LHwrUqLB0bTXvyeQ+ajx3PmgQC2U0jSUT4NuHvIZQbNyadWX+HJnuszAXiBGXzBAKs1cp1O6br2Ek/Kxo9+XEIaADLPO9rIevAph756ObZ2v3KccfT9dwKCbSl8gxQuLAZlDTCvVgSpbgNAyb5IDqyenfJ55SVGXFsQnfiJO5zR5ZqBWlpDRapSWhlAxovAisp7W5xcKQu1XYVOyNx4fp/SLCccNw5g0Ia2flZ4zjIWm5F9/oe/tA93P2q90MmWJaOufWntTTJmaUBysNtYJ8LkAZbwUNn8BuHLuqDT3JA3PlbCKaMTxC7zuaxNWbGxNQXpv+lBPre1HHdTEgDbsvXv8ilxzORPqz6Azo=
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(366004)(136003)(376002)(396003)(346002)(451199021)(186003)(6506007)(55236004)(26005)(6512007)(966005)(2616005)(5660300002)(4326008)(64756008)(66446008)(83380400001)(8936002)(478600001)(41300700001)(2906002)(66556008)(316002)(66946007)(66476007)(8676002)(7416002)(76116006)(54906003)(91956017)(110136005)(71200400001)(6486002)(36756003)(122000001)(38070700005)(38100700002)(86362001);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?iso-8859-1?Q?9EjfmWgxVt2qFSwgjM6k0ibPI1LbnOZaU7baqsovhaZq8v77o1WmyjeGf2?=
 =?iso-8859-1?Q?n0dQMd7B+S8K7X/FtCj/vymVx7au0bSneo3DhhmqhkoHlmoCp3YgIT6bQq?=
 =?iso-8859-1?Q?eCWsfctGfzh9ZOvpejba3mpzbJjS8UuhRP/P93tGWMd6/RBYYpzFPECGcR?=
 =?iso-8859-1?Q?4Ksi7RUc6wZEBzxkSW0CHkL4U0FcxmmnaiY9jgw/97WsJE/gehef/uwDVH?=
 =?iso-8859-1?Q?rMO1g6DqmOPMEuG33Z1Ytlj4P062nCTFYrJwtTkRUCr+qUEgkn5ZkIjHP0?=
 =?iso-8859-1?Q?W9Ewg8pvbMseZrKZDLNWBZPpKYuDisRal3gBIIw14t/zSiaVFNnJA8unlP?=
 =?iso-8859-1?Q?kOMoubPhWufI++rwOi7y3l9WK0MV8KL1NiDsxd2sYzfFboMgRdWNx3vjMt?=
 =?iso-8859-1?Q?mB2caGnuElZoGRLX+2XJOYKx2sH5Aih/yMPTWqli21L9PHphdYTTOBIeGc?=
 =?iso-8859-1?Q?JNCRMqmQJAOme8bFw9t+XEyePIdfS0sNcgWoWg+fbAwdjn/ftl0KJpmHPU?=
 =?iso-8859-1?Q?iIsUI1TGEmqOhx8ZMnJNUVErLBp3Tl8jg70AZ5SOZB7l+lPkugxPXBJAhq?=
 =?iso-8859-1?Q?y6znAUOUiwHT2fE4U4UQn602Bgk0APNVRav39to6MDcIRLMz1KVTX32rgO?=
 =?iso-8859-1?Q?tYKMfOCyLJuvaAtbkRq7R8lXvR0cfzxKDfV/LMOVfF+c45W+SgYYM27B+T?=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-1?Q?Rltl3L93k8Apm69p7C9PV38sn7GB+OMUtG/HXWyBJO1sCrZyORnx6iqwoV?=
 =?iso-8859-1?Q?Dgi1xgwtkyWgkC6BD7plm5y1tPpvi5y8psS3clzUpOuFeCiuA9i0H6YA?=
 =?iso-8859-1?Q?=3D=3D?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 01981ee1-4a4c-4357-249a-08db82c86c17
X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jul 2023 11:09:12.1183
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: bLm3cDQmakp1/GvIZqIkRNhI2AoG5yoO9Vxf6ccQ+RuZUgS4XCe/1loW1+LutmSFfarRS5WM7j5zu/Mj+iSOb2kUEyfowlZ5WGoBR651Xsc=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR03MB7417
X-Proofpoint-GUID: W_uM00fa6kLMe-4WQB9WjR5EblDrgsgf
X-Proofpoint-ORIG-GUID: W_uM00fa6kLMe-4WQB9WjR5EblDrgsgf
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-12_06,2023-07-11_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501
 mlxlogscore=691 bulkscore=0 clxscore=1011 malwarescore=0 impostorscore=0
 mlxscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 spamscore=0
 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2305260000 definitions=main-2307120099


Hi Jan, Roger,

Jan Beulich <jbeulich@suse.com> writes:

> Up front remark: I'm sorry for some possibly unhelpful replies below. I,
> for one, am of the opinion that some of the issues you ask about are to
> be looked into by whoever wants / needs to rework the locking model.
> After all this (likely) is why nobody has dared to make an attempt before
> the need became apparent.

I have no great need desire or need to rework the locking model. I was
perfectly fine with much narrower vpci_lock. As you remember, it is
Roger who suggested to extend this lock to the include the whole PCI
device.

I already tried something like this as part of the another patch series:
"[RFC,01/10] xen: pci: add per-domain pci list lock" [1], with the same
result: it was considered very hard to do this properly, so I dropped
that effort. I am not so familiar with x86-specific code as a whole and
IOMMU drivers in particular to be 100% sure that I am doing correct
changes. Without support from x86 guys I can't do proper patches and
looks like x86 guys are not interested in this. So, this is dead end.

Roger, in [2] I proposed another approach to fix ABBA in modify_bars():
store copy of BARs in the domain structure. Taking into account that my
effort to introduce d->pci_lock basically failed (again), I am proposing
to return back to d->vpci_lock + BARs shadow copy in the domain
struct. What do you think? And you, Jan?

[1] https://lore.kernel.org/all/20220831141040.13231-2-volodymyr_babchuk@ep=
am.com/
[2] https://lore.kernel.org/all/87ilbfnqmo.fsf@epam.com/

--=20
WBR, Volodymyr=


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 11:15:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 11:15:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562404.879066 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXog-0000gc-AM; Wed, 12 Jul 2023 11:15:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562404.879066; Wed, 12 Jul 2023 11:15:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXog-0000gV-6K; Wed, 12 Jul 2023 11:15:30 +0000
Received: by outflank-mailman (input) for mailman id 562404;
 Wed, 12 Jul 2023 11:14:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=QQN+=C6=intel.com=andrzej.hajda@srs-se1.protection.inumbo.net>)
 id 1qJXo1-0000de-SC
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 11:14:50 +0000
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4d5aae8f-20a5-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 13:14:45 +0200 (CEST)
Received: from fmsmga005.fm.intel.com ([10.253.24.32])
 by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 12 Jul 2023 04:14:42 -0700
Received: from ahajda-mobl.ger.corp.intel.com (HELO [10.213.31.249])
 ([10.213.31.249])
 by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 12 Jul 2023 04:13:48 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4d5aae8f-20a5-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1689160486; x=1720696486;
  h=message-id:date:mime-version:subject:to:cc:references:
   from:in-reply-to:content-transfer-encoding;
  bh=pa2Bj6VqT5cElyyhfEvI8AxkZz4IX9juc4rRJw0HbBE=;
  b=gaflAFx5VZTk90cRxsoZ6xtpXo3QqZFz1W0I1AvvxO8tSbO2id+zhepa
   kjdRdAzyY9uzbzT+Cqckdt/FQkhaumynR/EU82CiAHgs6g+EoJMXknaP6
   OWuvibY031yz+kU/r4IyW7sb2380+RJf267SDhzy9VhR+5vlO+3MN4YCf
   DvBwECBuTwF0YT9+eVQtKFg4ARg3Wem1NW+hdJLONqc5/pmi5NWfUjp7i
   YYcqeVKYdSVsKBZYmmY2OVOF6tZzkhad1KE0ZCSVN1QSdtkrg2Foz5Dgg
   3x1vUVfEl9e087oOxybF1QhrCRR23mtZ4LyPBJZHeqXSIXjz0cebxDR7u
   A==;
X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="368396108"
X-IronPort-AV: E=Sophos;i="6.01,199,1684825200"; 
   d="scan'208";a="368396108"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="1052148842"
X-IronPort-AV: E=Sophos;i="6.01,199,1684825200"; 
   d="scan'208";a="1052148842"
Message-ID: <60a183df-9776-1f10-bbd7-248531921888@intel.com>
Date: Wed, 12 Jul 2023 13:13:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Firefox/102.0 Thunderbird/102.13.0
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
Content-Language: en-US
To: Julia Lawall <julia.lawall@inria.fr>,
 =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= <u.kleine-koenig@pengutronix.de>
Cc: =?UTF-8?Q?Christian_K=c3=b6nig?= <christian.koenig@amd.com>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
 Alex Deucher <alexander.deucher@amd.com>, "Pan, Xinhui"
 <Xinhui.Pan@amd.com>, Harry Wentland <harry.wentland@amd.com>,
 Leo Li <sunpeng.li@amd.com>, Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
 Hamza Mahfooz <hamza.mahfooz@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Guchun Chen <guchun.chen@amd.com>,
 Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
 Evan Quan <evan.quan@amd.com>, Likun Gao <Likun.Gao@amd.com>,
 =?UTF-8?B?TWFyZWsgT2zFocOhaw==?= <marek.olsak@amd.com>,
 David Francis <David.Francis@amd.com>, Hawking Zhang
 <Hawking.Zhang@amd.com>, Lang Yu <Lang.Yu@amd.com>,
 Philip Yang <Philip.Yang@amd.com>, Yifan Zhang <yifan1.zhang@amd.com>,
 Tim Huang <Tim.Huang@amd.com>, Zack Rusin <zackr@vmware.com>,
 Sam Ravnborg <sam@ravnborg.org>, Jani Nikula <jani.nikula@intel.com>,
 Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
 =?UTF-8?Q?Ma=c3=adra_Canal?= <mairacanal@riseup.net>,
 =?UTF-8?Q?Andr=c3=a9_Almeida?= <andrealmeid@igalia.com>,
 Qingqing Zhuo <qingqing.zhuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>, Hersen Wu
 <hersenxs.wu@amd.com>, Fangzhi Zuo <jerry.zuo@amd.com>,
 Stylon Wang <stylon.wang@amd.com>, Alan Liu <haoping.liu@amd.com>,
 Wayne Lin <Wayne.Lin@amd.com>, Aaron Liu <aaron.liu@amd.com>,
 Melissa Wen <mwen@igalia.com>, Bhawanpreet Lakha
 <Bhawanpreet.Lakha@amd.com>, David Tadokoro <davidbtadokoro@usp.br>,
 Wenjing Liu <wenjing.liu@amd.com>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 Mario Limonciello <mario.limonciello@amd.com>,
 Alexey Kodanev <aleksei.kodanev@bell-sw.com>, Roman Li <roman.li@amd.com>,
 =?UTF-8?Q?Joaqu=c3=adn_Ignacio_Aramend=c3=ada?= <samsagax@gmail.com>,
 Dave Airlie <airlied@redhat.com>, Russell King <linux@armlinux.org.uk>,
 Liviu Dudau <liviu.dudau@arm.com>, Joel Stanley <joel@jms.id.au>,
 Boris Brezillon <bbrezillon@kernel.org>,
 Nicolas Ferre <nicolas.ferre@microchip.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 Claudiu Beznea <claudiu.beznea@microchip.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Stefan Agner <stefan@agner.ch>, Alison Wang <alison.wang@nxp.com>,
 Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
 =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= <noralf@tronnes.org>,
 Xinliang Liu <xinliang.liu@linaro.org>, Tian Tao <tiantao6@hisilicon.com>,
 Danilo Krummrich <dakr@redhat.com>, Deepak Rawat <drawat.floss@gmail.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
 =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= <ville.syrjala@linux.intel.com>,
 Lucas De Marchi <lucas.demarchi@intel.com>,
 Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
 Matt Roper <matthew.d.roper@intel.com>,
 Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
 Hans de Goede <hdegoede@redhat.com>, Luca Coelho <luciano.coelho@intel.com>,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 Kai Vehmanen <kai.vehmanen@linux.intel.com>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 =?UTF-8?Q?=c5=81ukasz_Bartosik?= <lb@semihalf.com>,
 Anusha Srivatsa <anusha.srivatsa@intel.com>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
 Uma Shankar <uma.shankar@intel.com>, Imre Deak <imre.deak@intel.com>,
 Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
 Swati Sharma <swati2.sharma@intel.com>,
 =?UTF-8?Q?Jouni_H=c3=b6gander?= <jouni.hogander@intel.com>,
 Mika Kahola <mika.kahola@intel.com>,
 =?UTF-8?Q?Jos=c3=a9_Roberto_de_Souza?= <jose.souza@intel.com>,
 Arun R Murthy <arun.r.murthy@intel.com>,
 Gustavo Sousa <gustavo.sousa@intel.com>,
 Khaled Almahallawy <khaled.almahallawy@intel.com>,
 Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
 Andi Shyti <andi.shyti@linux.intel.com>, Nirmoy Das <nirmoy.das@intel.com>,
 Fei Yang <fei.yang@intel.com>, Animesh Manna <animesh.manna@intel.com>,
 Deepak R Varma <drv@mailo.com>, "Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
 Vandita Kulkarni <vandita.kulkarni@intel.com>,
 Suraj Kandpal <suraj.kandpal@intel.com>,
 Drew Davenport <ddavenport@chromium.org>,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>,
 Philipp Zabel <p.zabel@pengutronix.de>, Dan Carpenter <error27@gmail.com>,
 Paul Cercueil <paul@crapouillou.net>,
 Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Linus Walleij <linus.walleij@linaro.org>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>, Rob Clark <robdclark@gmail.com>,
 Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Vinod Polimera <quic_vpolimer@quicinc.com>,
 Jiasheng Jiang <jiasheng@iscas.ac.cn>,
 Konrad Dybcio <konrad.dybcio@linaro.org>,
 Jessica Zhang <quic_jesszhan@quicinc.com>, Liu Shixin
 <liushixin2@huawei.com>, Marek Vasut <marex@denx.de>,
 Ben Skeggs <bskeggs@redhat.com>, Karol Herbst <kherbst@redhat.com>,
 Lyude Paul <lyude@redhat.com>, Tomi Valkeinen <tomba@kernel.org>,
 Emma Anholt <emma@anholt.net>, Gerd Hoffmann <kraxel@redhat.com>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>,
 Geert Uytterhoeven <geert+renesas@glider.be>,
 Biju Das <biju.das.jz@bp.renesas.com>, Sandy Huang <hjc@rock-chips.com>,
 =?UTF-8?Q?Heiko_St=c3=bcbner?= <heiko@sntech.de>,
 Orson Zhai <orsonzhai@gmail.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>,
 Alain Volmat <alain.volmat@foss.st.com>,
 Yannick Fertre <yannick.fertre@foss.st.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Philippe Cornu <philippe.cornu@foss.st.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>, Chen-Yu Tsai
 <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>,
 Samuel Holland <samuel@sholland.org>,
 Thierry Reding <thierry.reding@gmail.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Jyri Sarha <jyri.sarha@iki.fi>,
 David Lechner <david@lechnology.com>,
 Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
 Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
 Melissa Wen <melissa.srw@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Michal Simek <michal.simek@amd.com>,
 Haneen Mohammed <hamohammed.sa@gmail.com>, linux-hyperv@vger.kernel.org,
 linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org,
 dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org,
 Yongqin Liu <yongqin.liu@linaro.org>, Alim Akhtar <alim.akhtar@samsung.com>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 Fabio Estevam <festevam@gmail.com>, Sumit Semwal <sumit.semwal@linaro.org>,
 Jerome Brunet <jbrunet@baylibre.com>, linux-samsung-soc@vger.kernel.org,
 amd-gfx@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com,
 linux-rockchip@lists.infradead.org,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
 NXP Linux Team <linux-imx@nxp.com>, spice-devel@lists.freedesktop.org,
 linux-sunxi@lists.linux.dev,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-mediatek@lists.infradead.org, xen-devel@lists.xenproject.org,
 linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org,
 Gurchetan Singh <gurchetansingh@chromium.org>, Sean Paul <sean@poorly.run>,
 linux-arm-kernel@lists.infradead.org,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 Andrew Jeffery <andrew@aj.id.au>, linux-mips@vger.kernel.org,
 Chia-I Wu <olvaffe@gmail.com>, linux-renesas-soc@vger.kernel.org,
 kernel@pengutronix.de, John Stultz <jstultz@google.com>,
 freedreno@lists.freedesktop.org, Lucas Stach <l.stach@pengutronix.de>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <94eb6e4d-9384-152f-351b-ebb217411da9@amd.com>
 <20230712110253.paoyrmcbvlhpfxbf@pengutronix.de>
 <acd7913-3c42-7354-434-a826b6c8718@inria.fr>
From: Andrzej Hajda <andrzej.hajda@intel.com>
Organization: Intel Technology Poland sp. z o.o. - ul. Slowackiego 173, 80-298
 Gdansk - KRS 101882 - NIP 957-07-52-316
In-Reply-To: <acd7913-3c42-7354-434-a826b6c8718@inria.fr>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 12.07.2023 13:07, Julia Lawall wrote:
>
> On Wed, 12 Jul 2023, Uwe Kleine-KÃ¶nig wrote:
>
>> On Wed, Jul 12, 2023 at 12:46:33PM +0200, Christian KÃ¶nig wrote:
>>> Am 12.07.23 um 11:46 schrieb Uwe Kleine-KÃ¶nig:
>>>> Hello,
>>>>
>>>> while I debugged an issue in the imx-lcdc driver I was constantly
>>>> irritated about struct drm_device pointer variables being named "dev"
>>>> because with that name I usually expect a struct device pointer.
>>>>
>>>> I think there is a big benefit when these are all renamed to "drm_dev".
>>>> I have no strong preference here though, so "drmdev" or "drm" are fine
>>>> for me, too. Let the bikesheding begin!
>>>>
>>>> Some statistics:
>>>>
>>>> $ git grep -ohE 'struct drm_device *\* *[^ (),;]*' v6.5-rc1 | sort | uniq -c | sort -n
>>>>         1 struct drm_device *adev_to_drm
>>>>         1 struct drm_device *drm_
>>>>         1 struct drm_device          *drm_dev
>>>>         1 struct drm_device        *drm_dev
>>>>         1 struct drm_device *pdev
>>>>         1 struct drm_device *rdev
>>>>         1 struct drm_device *vdev
>>>>         2 struct drm_device *dcss_drv_dev_to_drm
>>>>         2 struct drm_device **ddev
>>>>         2 struct drm_device *drm_dev_alloc
>>>>         2 struct drm_device *mock
>>>>         2 struct drm_device *p_ddev
>>>>         5 struct drm_device *device
>>>>         9 struct drm_device * dev
>>>>        25 struct drm_device *d
>>>>        95 struct drm_device *
>>>>       216 struct drm_device *ddev
>>>>       234 struct drm_device *drm_dev
>>>>       611 struct drm_device *drm
>>>>      4190 struct drm_device *dev
>>>>
>>>> This series starts with renaming struct drm_crtc::dev to drm_dev. If
>>>> it's not only me and others like the result of this effort it should be
>>>> followed up by adapting the other structs and the individual usages in
>>>> the different drivers.
>>>>
>>>> To make this series a bit easier handleable, I first added an alias for
>>>> drm_crtc::dev, then converted the drivers one after another and the last
>>>> patch drops the "dev" name. This has the advantage of being easier to
>>>> review, and if I should have missed an instance only the last patch must
>>>> be dropped/reverted. Also this series might conflict with other patches,
>>>> in this case the remaining patches can still go in (apart from the last
>>>> one of course). Maybe it also makes sense to delay applying the last
>>>> patch by one development cycle?
>>> When you automatically generate the patch (with cocci for example) I usually
>>> prefer a single patch instead.
>> Maybe I'm too stupid, but only parts of this patch were created by
>> coccinelle. I failed to convert code like
>>
>> -       spin_lock_irq(&crtc->dev->event_lock);
>> +       spin_lock_irq(&crtc->drm_dev->event_lock);
>>
>> Added Julia to Cc, maybe she has a hint?!
> A priori, I see no reason why the rule below should not apply to the above
> code.  Is there a parsing problem in the containing function?  You can run
>
> spatch --parse-c file.c
>
> If there is a paring problem, please let me know and i will try to fix it
> so the while thing can be done automatically.

I guess some clever macros can fool spatch, at least I observe such 
things in i915 which often uses custom iterators.

Regards
Andrzej

>
> julia
>
>> (Up to now it's only
>>
>> @@
>> struct drm_crtc *crtc;
>> @@
>> -crtc->dev
>> +crtc->drm_dev
>>
>> )
>>
>>> Background is that this makes merge conflicts easier to handle and detect.
>> Really? Each file (apart from include/drm/drm_crtc.h) is only touched
>> once. So unless I'm missing something you don't get less or easier
>> conflicts by doing it all in a single patch. But you gain the freedom to
>> drop a patch for one driver without having to drop the rest with it. So
>> I still like the split version better, but I'm open to a more verbose
>> reasoning from your side.
>>
>>> When you have multiple patches and a merge conflict because of some added
>>> lines using the old field the build breaks only on the last patch which
>>> removes the old field.
>> Then you can revert/drop the last patch without having to respin the
>> whole single patch and thus caring for still more conflicts that arise
>> until the new version is sent.
>>
>> Best regards
>> Uwe
>>
>> --
>> Pengutronix e.K.                           | Uwe Kleine-KÃ¶nig            |
>> Industrial Linux Solutions                 | https://www.pengutronix.de/ |
> >



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 11:18:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 11:18:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562412.879076 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXrS-0001L4-Rr; Wed, 12 Jul 2023 11:18:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562412.879076; Wed, 12 Jul 2023 11:18:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXrS-0001Kx-O1; Wed, 12 Jul 2023 11:18:22 +0000
Received: by outflank-mailman (input) for mailman id 562412;
 Wed, 12 Jul 2023 11:18:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YOEi=C6=redhat.com=fmartine@srs-se1.protection.inumbo.net>)
 id 1qJXrR-0001Kr-Up
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 11:18:21 +0000
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [170.10.133.124])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ce17b3a8-20a5-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 13:18:20 +0200 (CEST)
Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com
 [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-548-9b314-DBOQqlmOm2ht99wA-1; Wed, 12 Jul 2023 07:18:17 -0400
Received: by mail-wm1-f69.google.com with SMTP id
 5b1f17b1804b1-3fc08d6a40cso26216265e9.0
 for <xen-devel@lists.xenproject.org>; Wed, 12 Jul 2023 04:18:16 -0700 (PDT)
Received: from localhost (205.pool92-176-231.dynamic.orange.es.
 [92.176.231.205]) by smtp.gmail.com with ESMTPSA id
 k6-20020a05600c0b4600b003fc00702f65sm14151776wmr.46.2023.07.12.04.18.15
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 12 Jul 2023 04:18:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ce17b3a8-20a5-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1689160699;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=sqF46ZIeTTxnF0x2v0q2HtXa3ZhclBx145UBtd0H60M=;
	b=GFCzQKsxsPbK0pRnq2TrZdz46CESVuRV7IYHZyYpB2n5GQRqFTQbKmgYJG9lgnP2PK5Uu0
	l0BYo0/TB7+Q7+KZKR9s2X/OdfSjebkPXFd97HwLE6PQ0N8L9ME8l1NzDraKRYQW9bDMyd
	fHoZoT+kGZzIuMVp21a7CAIMYhLKw3g=
X-MC-Unique: 9b314-DBOQqlmOm2ht99wA-1
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689160696; x=1691752696;
        h=content-transfer-encoding:mime-version:message-id:date:references
         :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=mGmoSdcAtbAnvFmDIfmKNE01xrI5yfsr2LA1G6eD+Js=;
        b=eZBf4gG5awqonZMS/Rxstq2HIllfZdmERi1msatR94nL+jcfG6EUB6TJbxSooc9GXn
         jVR1yYmxdE7LDIQr60HYfLbAr2ouBIPYBgCjVuMZM3mkWkiCTz+PVxd21z1VmVgt8AXW
         zfmQyXnMGy7khQyR00qXwJfkBoG4Jmq93Leup1twYgrVWUbvEe2YVq3yTp+RF1Q25/eO
         CfckTiARPghpXnJnRLJTwzxgdSFQJE6QO358VAOazOv7AnKbhdGXbRoVwhcC550QP2Wn
         9yi0zav+M59wXojOYhidOVvrpyts7U5fTmcuIoiBOlrJnRqBCw4/KY1kJPsGvmCgFZ79
         a35g==
X-Gm-Message-State: ABy/qLaiKgWTNLcO5N0LDd3J9J6GsCGwIrPjefLesDlh5Y6XPGLqdJJu
	iP+gvonL2tkjeyqPRF/zMiQ95i/3l5Z0mnAjDZrs6vyH1lxz1vtcK2NWG5hUdAD1n2k69ncjw03
	sr36N0A9/9BYMdyqU6K6uMExzaLw=
X-Received: by 2002:a05:600c:3644:b0:3fc:627:ea31 with SMTP id y4-20020a05600c364400b003fc0627ea31mr12056769wmq.38.1689160695901;
        Wed, 12 Jul 2023 04:18:15 -0700 (PDT)
X-Google-Smtp-Source: APBJJlHe6rz0BytbzD5//h/wnxrk0jp/oOEOt3AbTKSXStRClYkvIUVNGHa0orOjttguAlZUCgSKTg==
X-Received: by 2002:a05:600c:3644:b0:3fc:627:ea31 with SMTP id y4-20020a05600c364400b003fc0627ea31mr12056740wmq.38.1689160695625;
        Wed, 12 Jul 2023 04:18:15 -0700 (PDT)
From: Javier Martinez Canillas <javierm@redhat.com>
To: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>,
 Thomas Zimmermann
 <tzimmermann@suse.de>
Cc: linux-samsung-soc@vger.kernel.org,
 amd-gfx@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com,
 linux-rockchip@lists.infradead.org, Xinwei Kong
 <kong.kongxinwei@hisilicon.com>, VMware Graphics Reviewers
 <linux-graphics-maintainer@vmware.com>, NXP Linux Team
 <linux-imx@nxp.com>, spice-devel@lists.freedesktop.org,
 linux-sunxi@lists.linux.dev, Martin Blumenstingl
 <martin.blumenstingl@googlemail.com>, linux-arm-msm@vger.kernel.org,
 intel-gfx@lists.freedesktop.org, linux-mediatek@lists.infradead.org,
 xen-devel@lists.xenproject.org, linux-tegra@vger.kernel.org,
 linux-amlogic@lists.infradead.org, Gurchetan Singh
 <gurchetansingh@chromium.org>, Sean Paul <sean@poorly.run>,
 linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno
 <angelogioacchino.delregno@collabora.com>, Andrew Jeffery
 <andrew@aj.id.au>, linux-mips@vger.kernel.org, Chia-I Wu
 <olvaffe@gmail.com>, linux-renesas-soc@vger.kernel.org,
 kernel@pengutronix.de, John Stultz <jstultz@google.com>,
 freedreno@lists.freedesktop.org, Lucas Stach <l.stach@pengutronix.de>
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
In-Reply-To: <20230712105432.urgwb4zzwgsyfbwq@pengutronix.de>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <abf26a82-4f17-51f2-5753-785f8516a81a@suse.de>
 <20230712105432.urgwb4zzwgsyfbwq@pengutronix.de>
Date: Wed, 12 Jul 2023 13:18:14 +0200
Message-ID: <87r0pdgyyx.fsf@minerva.mail-host-address-is-not-set>
MIME-Version: 1.0
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Uwe Kleine-K=C3=B6nig <u.kleine-koenig@pengutronix.de> writes:

[dropping some recipients since my SMTP server was complaining about the si=
ze]

> Hello Thomas,
>
> On Wed, Jul 12, 2023 at 12:19:37PM +0200, Thomas Zimmermann wrote:
>> Am 12.07.23 um 11:46 schrieb Uwe Kleine-K=C3=B6nig:
>> > Hello,
>> >=20
>> > while I debugged an issue in the imx-lcdc driver I was constantly
>> > irritated about struct drm_device pointer variables being named "dev"
>> > because with that name I usually expect a struct device pointer.
>> >=20
>> > I think there is a big benefit when these are all renamed to "drm_dev"=
.
>>=20
>> If you rename drm_crtc.dev, you should also address *all* other data
>> structures.
>
> Yes. Changing drm_crtc::dev was some effort, so I thought to send that
> one out before doing the same to
>
> =09drm_dp_mst_topology_mgr
> =09drm_atomic_state
> =09drm_master
> =09drm_bridge
> =09drm_client_dev
> =09drm_connector
> =09drm_debugfs_entry
> =09drm_encoder
> =09drm_fb_helper
> =09drm_minor
> =09drm_framebuffer
> =09drm_gem_object
> =09drm_plane
> =09drm_property
> =09drm_property_blob
> =09drm_vblank_crtc
>
> when in the end the intention isn't welcome.
>
>> > I have no strong preference here though, so "drmdev" or "drm" are fine
>> > for me, too. Let the bikesheding begin!
>>=20
>> We've discussed this to death. IIRC 'drm' would be the prefered choice.
>
> "drm" at least has the advantage to be the 2nd most common name. With
> Paul Kocialkowski prefering "drm_dev" there is no clear favourite yet.

I think that either "drm" or "drm_dev" would be more clear than "dev",
which I also found it confusing and thinking about a "struct device".

Probably leaning to "drm", since as you said is the second most used name
in drivers that assign crtc->dev to a local variable.

> Maybe all the other people with strong opinions are dead if this was
> "discussed to death" before? :-)
>
> Best regards
> Uwe
>
> --=20
> Pengutronix e.K.                           | Uwe Kleine-K=C3=B6nig       =
     |
> Industrial Linux Solutions                 | https://www.pengutronix.de/ =
|

--=20
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 11:23:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 11:23:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562417.879086 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXwh-0002mh-Ew; Wed, 12 Jul 2023 11:23:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562417.879086; Wed, 12 Jul 2023 11:23:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJXwh-0002ma-Av; Wed, 12 Jul 2023 11:23:47 +0000
Received: by outflank-mailman (input) for mailman id 562417;
 Wed, 12 Jul 2023 11:23:46 +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 <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJXwg-0002mU-0x
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 11:23:46 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2061f.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::61f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8f54b7d3-20a6-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 13:23:43 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS8PR04MB7543.eurprd04.prod.outlook.com (2603:10a6:20b:29b::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 11:23:41 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 11:23:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8f54b7d3-20a6-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LAekG3TQtwH0dkcnbtNeiJw9rcZVG9h3pmNYZ/hioXq43AmwBoehGn0PGMbf1/JCRhs3DkWLzz7g11G1NPT05/VkO6h23Qtj1lQcwdVn0R9NEVnKoshn/LrqHThhbG8gr8O8qvpoq+wcLyNlj0Jkwa9x0epcK1MHBfjZoKHF9X0l+hBtRpBnTKXLCBGfjvC8tVeQFH4CDM2CxW9v1QgGIPddiCZ1rvtP3NMBJnIE2gbm4P9xLC2+taig46soCn826IMkfDZUq/Q4fPGnfooPqEMhJO1sgFpzikBLEGlGQIhy0e/TuSj0TXLahg6BGPmHJRK8rk4yyESTX1q6Z0th5A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=eDtPm9QkeCo50XZePz2iRaGDHxRvfJHfslIqfxv1a/0=;
 b=KARu8srMsBJ7ribndubHC4KQkKAK14SHzO5hFWELeSd1DKC25zk8Bc8Im/s/5ihjSNCOVivv+ISyLouiGwGm5emY5tmu+Y44wLC4AMXdMrckH3snWQee8nbDwL2IC4d4UPZZ9/uWeWfPKD6vnF73oa5PY6m1uI7szcNoHNi0/SWwDQfoH0Z3HGgEWxio+Up9W7DgbzNNe5AZbJZXuI6te2DEy6pHuIMWq66Agog42HXPgYuctFtidLR7iPsJ0GGN2kPhOfNqnoYVmS+qS1ole0wPb5pwgREFaNaMV9xSmYVzh5+pp1fYT9Nztjf9RAl9SvB1WvzHqqZQakgyRK9mJQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=eDtPm9QkeCo50XZePz2iRaGDHxRvfJHfslIqfxv1a/0=;
 b=kVPBeMdj/Rq+Xt23NJPX0GsJ0hOxSQWUYL3QKpA+Ijbwlqe+HTBJpZN3rJVGpbp5zZdfdyYJVAycf6jorfXWMOlRO5jfFmmXDCAtiTWLQFSxkbvXnpknCdR1aWCSkexRoM4axhXE9lVDFexvWrAH3+IpMTKhSbgIUYDGKq+mBYi9TZkWk6XOum4qgQaiEw9Ms+9rGefoQEzDRXzCGomldazR/XHqW2Rj/TMci7RMDACSqS8WEW+ZvhkvpMcMctNaHcZodlduhz/qmslwJgdTHhSlXipC+X74tIXdo1GST8HBCJu4pkwiVz3Ix8iuoLEokTcGIhyiX8ktuLKSEHEMDQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <a823789d-7bfb-1824-7d85-f68d3152d3bb@suse.com>
Date: Wed, 12 Jul 2023 13:23:39 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH] pci: introduce per-domain PCI rwlock
Content-Language: en-US
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>,
 Paul Durrant <paul@xen.org>, Oleksandr Tyshchenko <olekstysh@gmail.com>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20230711004537.888185-1-volodymyr_babchuk@epam.com>
 <e6ca0ef1-fb66-d923-388f-79cfc20d1626@suse.com> <874jmagulx.fsf@epam.com>
 <c0ba8144-3e3e-1f98-a719-ea03e9f29495@suse.com> <87wmz5fktl.fsf@epam.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <87wmz5fktl.fsf@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0077.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1e::16) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS8PR04MB7543:EE_
X-MS-Office365-Filtering-Correlation-Id: d12a3519-59a1-4e3b-52b4-08db82ca721a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	NcNOx458l8XJ5ooMTStLUkuevJWpJUNPk08mgo6tqOFvaCX9BWeJLHC0OzlLKJYb4Bkdmqk6iZrBltxMPH/0fHwm/xFK6BDo3vY9i8zXnhb5oxDC/Mfesur0MDvNVkE8gGHSMMlRiz/BJTyBACnCSVjP3ULzo8zi7ZMNtAHcb3WyJ6pemT97y1SZYYBEnIbeBTCzk70e0+AtE5RoQ8JpKLxyzHZUTo3VidQO6bKaQedEZmWffbnxF/0p5f8DNEhyfqqUm3fjTo51R9ZqOzRzWaZzUDh2hO/WuFn+ADcnd5W9eBkH2NeQaaYTyEszT8fQhNHVpVHCtIhKGSc+EDslNI2gtonAykATYqm9pgljoTnSKMWvr93/3a/PSFUbwx7aKuQ5OJ0E+uBa99EBNxRaYd1D1XVWKdgyz2EOfryhM0o86ShKBG8pWYkKmG6sKsaIs0j3u4YoxImusWNoosGxRcEXnk1jA12CVjMXS76797qpQFN2t3jMS/WssP4KcF0On+vFRmsY9TjU7EzWSOEJ8UggVf9wFefbcR9SAt5FHtVb2sya1eO1YIEgF0xBJF5V6UzUSW6RNeHwoZAC0kU0GO6nGgvLdoBn10r3Mf5GlR3gjeGWE0/2Efo8UibIWlrpLMhADUM9NC21/yTDDn5VrXi9/YuUdovlnbSOCUUTc9nU7V8Ww0Sm3CA+iocaWm3L
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(136003)(376002)(396003)(346002)(39860400002)(451199021)(41300700001)(2906002)(2616005)(186003)(53546011)(6506007)(8936002)(26005)(8676002)(6486002)(316002)(36756003)(7416002)(966005)(6512007)(38100700002)(31696002)(54906003)(66946007)(66556008)(4326008)(6916009)(31686004)(66476007)(478600001)(5660300002)(83380400001)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?K2loekJLTkQ5OVdnbkJvUW9CRzduU25UWTA0STdLbHZ2RmlRVURmdjkvWjVS?=
 =?utf-8?B?TjdjTWlIQzVZb2M1a3crcXUycVlyeXVNQ3cxSlAyM3lzSnV4ZExjUEF3MTdJ?=
 =?utf-8?B?K1FEMzJOT3poQ1d4VHZ1NmRzZGRPVWp2elBSSGVzbklaWGoxWnphakhVOHlS?=
 =?utf-8?B?Z09heEUrVTZkTE1QMXpZSnJaTFhBWmMwL1Y0dm1QZ1B6U2lISVBlK3A3MHlT?=
 =?utf-8?B?bndQaE9uSzQ4TG5Od1RJNDRrdy9RUU1OMUVUUlltYzBPRVFyKzduVzJFOW9u?=
 =?utf-8?B?V1BUa2xoNUNkbEZiaXFjQkJUd1lyRzIrRzRGRDdHa2xGUWQ3eDBPdHR0a3RQ?=
 =?utf-8?B?Q0krMkVHeVlvWjNpS1RTMUl0QzRuZENZZXc5NlZ2eXpQMGR6aGNPckd4MXox?=
 =?utf-8?B?QzBBc3kvZGp2RDIwV0pMTDlBNkwwb3owOVJ4cGpWQ2psV1FqdStUeUVkU3k3?=
 =?utf-8?B?VXNBTm9GOVVZdUZiV0FZZ1QzZmRVTm1wWEo5eDJLS0FLQXBkN1NqYzc2ditK?=
 =?utf-8?B?ZllmYTRZWDZwd3lVZHRVbkFqajBBNThkbWU0Zk9DUGQyTnRhWENVTWxWa2c1?=
 =?utf-8?B?MDVVOS9hOUVBMlUyeUlyL290NEVtNU0rMEFKUXkvZm9ob1F5dG5DdU45MUU3?=
 =?utf-8?B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xRlliRXRyNGx2OXZ5cGpVYlZlSG56em1qdXZv?=
 =?utf-8?B?bDRFS2RzcmVVM2E0T3o3eDdjQzBaazhFUlFKcXhsUElRNVlyTytPUGVxaXYw?=
 =?utf-8?B?cTZIaTEvOW0yclJuekNvMTNCa0tXa2R2L1Yra3RRWHB4NmtFSXZrOHZHVVRu?=
 =?utf-8?B?T1VzMzRZcEVXUzJHdEs4d2t4Y0xQV05lWHZQSnNtZjlTK0tSa1A5cmxkK0Nw?=
 =?utf-8?B?d3NqcU5RZ210akpZQjByVmpDN3NaZ1RJa0RnNFpQdUFaYzNNM2xXRWUzTkty?=
 =?utf-8?B?eldEN2drTGt3MjBiWnQ2M2ttUFNnLzBLK1lsUXNCZVpuYXFOT2ZwaHhObUsx?=
 =?utf-8?B?bTQxcU5ENExBZjFiZE5iUWYwL29KWXVGNHhZRjkzaHpEeTBWa1VmRXdjcWFM?=
 =?utf-8?B?RkR5clZDRmFzcE9yZTUraGN1S004b1ZoMDhwcXdJbzdTaG1XN3JSVVlXTm9r?=
 =?utf-8?B?L3BoQ21NSGtGUHFkZ1F4UFRzY1gyTjU2ZHh1cU0vaXg5K212RUlkNzFvVTZV?=
 =?utf-8?B?M2l2Y05iTzlHd1pSMGFUTHlmclVLaFZ6MmNEV2x4cWc4Y3VhWW5RaFUvT2VU?=
 =?utf-8?Q?VXZDXmLLMAL9l/dk+7HrWVWRb?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d12a3519-59a1-4e3b-52b4-08db82ca721a
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 11:23:41.3520
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Cer6kgNuZ0ZOVkW3tchtzBsMip5sxRo5yregxD2vL0ktg+KRxoajORCYX2vMjiM6qFeAj/1zeA4f2b6xGLEYQw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7543

On 12.07.2023 13:09, Volodymyr Babchuk wrote:
> Jan Beulich <jbeulich@suse.com> writes:
> 
>> Up front remark: I'm sorry for some possibly unhelpful replies below. I,
>> for one, am of the opinion that some of the issues you ask about are to
>> be looked into by whoever wants / needs to rework the locking model.
>> After all this (likely) is why nobody has dared to make an attempt before
>> the need became apparent.
> 
> I have no great need desire or need to rework the locking model. I was
> perfectly fine with much narrower vpci_lock. As you remember, it is
> Roger who suggested to extend this lock to the include the whole PCI
> device.
> 
> I already tried something like this as part of the another patch series:
> "[RFC,01/10] xen: pci: add per-domain pci list lock" [1], with the same
> result: it was considered very hard to do this properly, so I dropped
> that effort. I am not so familiar with x86-specific code as a whole and
> IOMMU drivers in particular to be 100% sure that I am doing correct
> changes. Without support from x86 guys I can't do proper patches and
> looks like x86 guys are not interested in this.

That's not the case, no. The problem is time: I don't have the time to
take on this effort myself. I'm willing to help where necessary, within
reasonable bounds. But I can't realistically do large parts of the
analysis that is inevitably needed. (I'm also a little sick of doing
code audits for other, unrelated reasons.) Hence that earlier "up front"
remark.

> So, this is dead end.
> 
> Roger, in [2] I proposed another approach to fix ABBA in modify_bars():
> store copy of BARs in the domain structure. Taking into account that my
> effort to introduce d->pci_lock basically failed (again), I am proposing
> to return back to d->vpci_lock + BARs shadow copy in the domain
> struct. What do you think? And you, Jan?

I support Roger's earlier request, and I think that doing what you
propose would move us further away from where we want to arrive at some
point.

I'm sorry that this is all pretty unpleasant.

Jan

> [1] https://lore.kernel.org/all/20220831141040.13231-2-volodymyr_babchuk@epam.com/
> [2] https://lore.kernel.org/all/87ilbfnqmo.fsf@epam.com/
> 



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 12:05:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 12:05:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562437.879095 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJYaa-0007Jp-Im; Wed, 12 Jul 2023 12:05:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562437.879095; Wed, 12 Jul 2023 12:05:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJYaa-0007Ji-GK; Wed, 12 Jul 2023 12:05:00 +0000
Received: by outflank-mailman (input) for mailman id 562437;
 Wed, 12 Jul 2023 12:04:59 +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
 <SRS0=V3yk=C6=arm.com=luca.fancellu@srs-se1.protection.inumbo.net>)
 id 1qJYaZ-0007Ja-Ap
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 12:04:59 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTP
 id 50d39f25-20ac-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 14:04:56 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A6D44D75;
 Wed, 12 Jul 2023 05:05:37 -0700 (PDT)
Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.1])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5E32F3F67D;
 Wed, 12 Jul 2023 05:04:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 50d39f25-20ac-11ee-8611-37d641c3527e
From: Luca Fancellu <luca.fancellu@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com,
	wei.chen@arm.com,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH] docs: Fix style in misc/arm/silicon-errata.txt table
Date: Wed, 12 Jul 2023 13:04:40 +0100
Message-Id: <20230712120440.1815240-1-luca.fancellu@arm.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Fix the right border of the silicon-errata.txt table

Fixes: 1814a626fb58 ("xen/arm: Update silicon-errata.txt with the Neovers AT erratum")
Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
---
 docs/misc/arm/silicon-errata.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index 1925d8fd4ee0..a7abcc1ba16c 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -56,6 +56,6 @@ stable hypervisors.
 | ARM            | Cortex-A73      | #858921         | ARM_ERRATUM_858921      |
 | ARM            | Cortex-A76      | #1165522        | N/A                     |
 | ARM            | Cortex-A76      | #1286807        | ARM64_ERRATUM_1286807   |
-| ARM            | Neoverse-N1     | #1165522        | N/A
+| ARM            | Neoverse-N1     | #1165522        | N/A                     |
 | ARM            | Neoverse-N1     | #1286807        | ARM64_ERRATUM_1286807   |
 | ARM            | MMU-500         | #842869         | N/A                     |
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 12:32:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 12:32:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562448.879106 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZ0w-0002MU-MX; Wed, 12 Jul 2023 12:32:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562448.879106; Wed, 12 Jul 2023 12:32:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZ0w-0002MN-Ia; Wed, 12 Jul 2023 12:32:14 +0000
Received: by outflank-mailman (input) for mailman id 562448;
 Wed, 12 Jul 2023 12:32:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJZ0v-0002MH-B8
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 12:32:13 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20611.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::611])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1fe6a2ac-20b0-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 14:32:12 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PAXPR04MB8848.eurprd04.prod.outlook.com (2603:10a6:102:20f::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 12 Jul
 2023 12:32:09 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 12:32:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1fe6a2ac-20b0-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ONhJwhL9dCkCnRMlY/btBnkQrbuAkoddENqX9ZgLiHqAHC4+483bbpC+pTNIj11fQ/A+4jDs74yl1VVu6rc2ekWFDdyfQpwFCK4zK94aFfyqHhr8fOFVcNbEjyMIUApOHS4IpT09q5vcDkioqSzKlH7m3r0WdhYgKSQCgWbvhJ6QhNGLG6R/btr58Eq5ZbWFn3r6YfDuVsW8PrUDBUazwah2QpGrljgE1HL+A1T5YVx0CbkhtcKr80dvRAF+87cBjgvrVML893MG093/VBpXOkAqVny3rF+0rnZVqEeUySrooXo30gfb0XAwGYgrxMdfdxhaR/gkkZNGj1h6+NWAJQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=6gDz/iYeLcDEfRNYreqo79Imh9dwbgKwZGlvuvvTroo=;
 b=Yo5mLaV6t4j/bhyBTcQlQqWa4C4+JGoYqd89ca5KDY6N3oVqzj0v5B6QrnG2so8FKd64ui4757fQVXmP895xuTt/ic6uuD/Rw916sw7xa3Z6iyJN+UYWIpa/69etisS8QrnL9Gu+OFytaR9/jnf+gVDQ7KfISYBuYMUUUBNJgNwBUk9frB8kx8R3vPdGz4WCamU3UH5FMDrb0XENApDeAa6CJZqLfMQu7AZ/gzkyiB5KCskQ5gW58V+kjW/t9uJb6whyD0h4qKa9jaTvkeoCtGyfgjc1FdqrDvUwUgfCSsimfDAE5AuHAYlsa2IjLR5GsPJqhxOQEtzI2c+w+BMHsQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=6gDz/iYeLcDEfRNYreqo79Imh9dwbgKwZGlvuvvTroo=;
 b=Z3KZqd2re/3bvsgOW6AVD8iv6a8gvxgE/jt/k1pRonAzzPaGzreLpTIFlzLbcefiVOBsn0YhBvzhY7wJoSeUjlklA6sClcDsUHSB4f32Ds4/O3cWhmXMaejFF4zPbug3taRNVaxGVDIh4BEDLLWKW6jy0yhvMa/tnZhmub6UIAs1vs5OdWPpS499Yj93uq/mOzJE3z5ZRXGPeYQSvf86scsLgWx3/LK/PzpW1HSWbIDEDcS7eunYeQDd2C+hSpadhj4Nbug5qU01BUPJxihqJhMWiAB2rdU3udBVuqKXKyOJqOBz1X5zmA/s5LpA9HsOZF7VuiOaWHCHbZ5adunXrg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com>
Date: Wed, 12 Jul 2023 14:32:07 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH 0/3] x86: allow Kconfig control over psABI level
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0054.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:93::8) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAXPR04MB8848:EE_
X-MS-Office365-Filtering-Correlation-Id: b2e9eaf1-4e0f-431a-7e82-08db82d40276
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	OMMT7gKQvfJ7IBwpLdb0kTXWviGbc8Hv6soWzH2jg3KCmx95Mc3nfTxSN6ZK66FP6lgAgNBMJgXMfEUo9/Hs0oukfwgPuBZBs1Euymvv73kjdDvDZ8DfSIUk1CvpwHFMjycapPVEzX3anbs+YDdevpogD23g/D8QJlqW87EuPdmLmDPAccvQcAc/5Z5O3x9NcuFo7SEwPUarmPoClGs5uvwzL+IDpDN1n8qrp1M3c+pJztJ0NCdp5bMMmXvqmFEBXNN4UhD3GgIDCOc3kVgr+M6L162/Li9LLb+LjU2y+pFGLyDV27S9joM8TMkMQG4eXdztx2p5wjwS/5FC934huccRdMHN2Pmyox0/r27X3t1sJaU0AOs5Fa05L1x0dxEZMjs0+2gSRgwqYfT0mp+IPEn/swn+spxAgKleAw5G9fa+P2bZq6l3KHr+mPXX4yCYrz6pPyu/m6Md4KrlnaqFNFLytp7xmtHgYeXL21mgROx473Jyr9w9nAdTLXy5c6YmX7tPyHdIIx9KtUyCdheVrMqqBU1ewKMeNma948dXe72fU3/n8rGwdLVoNP+OSAMnkcVBQ99LbXI0DkpS87TtgPAjPRyaUAqidi6vU6xaQloL34SVlis7SSbCeIM5Lunn53V5aVuT/KVIWF6LNk5/HA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(39860400002)(376002)(136003)(366004)(346002)(451199021)(2616005)(26005)(6512007)(6506007)(186003)(36756003)(558084003)(38100700002)(54906003)(478600001)(6486002)(66556008)(66946007)(66476007)(31686004)(86362001)(31696002)(8676002)(8936002)(5660300002)(6916009)(2906002)(41300700001)(316002)(4326008)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VGxJZjNlbHpwS0ZEaElHUXFYcktyMHBLUzJ2cUV4WlFwbE1qOUYyWVBzUXRi?=
 =?utf-8?B?K0JsSTBVZXdsejZsR1M2WXROL3QrZW0venZqZzlqdGpBNHJJdzFQT1I1TkNi?=
 =?utf-8?B?QmN0WTdiTVhtNDFGeE9CRGppL1dPQ1FhOVk2VXlPc21CaFA4VUExWmZBS3Vu?=
 =?utf-8?B?WHNKemhYbHN4V1Fw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
 =?utf-8?B?YnJSVDVoWHRBcExuSmdobUdqdFBPUFlUTGYwZ1R0L1N0djFneGNTNm5Yd3Bn?=
 =?utf-8?B?ZTRPWnB0dVN4bnl2N3poUGZ1YTJaYUtvT2tVazVzR2UyalFGY0FzWUxXdVU5?=
 =?utf-8?B?TGg0ZW91M3pwRXRjOGNtemhRRXE0TzFDTTlKZ3ZjUDc3WEhiZWZ5L1FZblov?=
 =?utf-8?Q?S5F51vA/mffBUpouJ0sYaXSb3?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b2e9eaf1-4e0f-431a-7e82-08db82d40276
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 12:32:09.0438
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: M02m53ge0YFP6wm8ChOusy3qT6kCWdqI++wl6ANL7fzSXkf5jd+J/jWg395BrdqH6q6DlTctB76Y9xm2S497ZA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8848

As discussed in Prague, with some minor add-ons (patch 2 replacing a much
older patch under the same title).

1: allow Kconfig control over psABI level
2: use POPCNT for hweight<N>() when available
3: short-circuit certain cpu_has_* when x86-64-v{2,3} are in effect

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 12:34:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 12:34:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562452.879115 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZ2b-0002tq-02; Wed, 12 Jul 2023 12:33:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562452.879115; Wed, 12 Jul 2023 12:33:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZ2a-0002tj-TU; Wed, 12 Jul 2023 12:33:56 +0000
Received: by outflank-mailman (input) for mailman id 562452;
 Wed, 12 Jul 2023 12:33:55 +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 <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJZ2Z-0002td-Su
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 12:33:55 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on20621.outbound.protection.outlook.com
 [2a01:111:f400:fe13::621])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5c6580c5-20b0-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 14:33:53 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS4PR04MB9292.eurprd04.prod.outlook.com (2603:10a6:20b:4e7::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Wed, 12 Jul
 2023 12:33:51 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 12:33:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5c6580c5-20b0-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=HjkcbXJKpkJgADoQrPWMuRUJjgUDSQTxUcVZCAfFcSAioOvD0DXcSGPkki6dkfmixbttxclxA+NcxJDtkluo64pAT7v1eV1Zj4Rs9pswk0n84Wbvlq1d7FyhqWTTSWMSqXEibRnal1OMI21kcJj0lEhrPn+xdpQZcgbTGbdNLHwRLaNL5vSNx0D/N4r0vDsBUHYdIiJfdTQO37ZKuT3siNBp9EsA7JWUK7uCzaMccy3I64mk1Z9vzSwYxfz9LKZnpAk5XbP+t/4n1q6diIBbMSyK8/77bCNd3Tz4rr15vAmHwaVo7Da/n9FGyEzvQJU9LlK2y6zRlQ+Umq+Yc8iA8g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=rtLOHvDW3yXb0XGX8XzAuCLdaHStzU+kOEDq0XjqWuA=;
 b=I4fKpzesTseIoyK38wJ4GmMgVt7S8m0EN1FiBcaGCfkrdme32hxC16SxWzVC52T2Pw0Eb6HwKNG+3PSnZqfGuHD1EieoiePMnccfRG2epW0VCbK+OA3wMSwCP04bk62ZmFc1U04dMZjmSk/4okQ/OkPwRBpfvB28RfEt62p+rN/X53Rx74z407JwymWHE9rvexKewdA1o6rpTMFn/mNgR24ez2kB2kIR/Lj+HqbIbfKLEaUSj/kkGVoq6wMTzeEyLy9qw9xxkfHW4URJhV4Oz+op9aM/LJCnzggAeOdekElklz8NeG43JOSgX8p2t7AwRy84oVCrgiFQEu16XgOLBg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=rtLOHvDW3yXb0XGX8XzAuCLdaHStzU+kOEDq0XjqWuA=;
 b=oqlTc+fin4OP8CvpFNUXlGbx4eELx5eNb/lzUcIuWlKFiPbhpRho5qhM/UPbmiZwgmuncaPlp3F44p8Gj7yU483/4GvaWp0QwNSobomhvPOeGJ5U5N0+dAh2NFu30ecAc1SdgHw3GqVc234GMobCiFcJDXW9r2TK9Mwxm2ZRf11r2L9FbmUM+qAsjkP7P1Otzx4Q/y8B/s24xphlQ1z7dX6H5z9vCh9a9qPWt/zUDvbbFGOfPfbeC1SkCEpSMXmOBOPm5Lji+O8H4z+94T/dAmxJpLnrbhfuCqP33c+m4VsIRDPd0BBtvuGZNcs58Rxgmvvz8GLvLHjzyx/a1aOnKA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <6f462a2f-2e91-6397-a527-18eeade19476@suse.com>
Date: Wed, 12 Jul 2023 14:33:49 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH 1/3] x86: allow Kconfig control over psABI level
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com>
In-Reply-To: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0202.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a5::6) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS4PR04MB9292:EE_
X-MS-Office365-Filtering-Correlation-Id: f46273bf-9082-4e09-b993-08db82d43f84
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	rDLpCWTtimiydtP2txdryUMtLZG6UC8YLtyg8tJizd8AW2UAz8cUAGBUmRfN1qmP/Z83NEcsqua8m64AJ/pniwvpAYEm4BleINJ2GRLODevHiAJ19J0v4okArk/hbkwcIuEyHI3jnwR2NVbITECjM90mdL9wRa9/bNuCIiIMJphp8raET0cOBtHwewmRjuhjlMLWnojxkvWO7QwWb3KiBtI6Yge6lTkKLEjH5RFx1ICuCQqNKqRm6NeujPivN8pVBG0q0wD84sVKsbilZ4vEc/XtB1eTfEFpwka5r2yAHmqA/6472xZlP9KSwRfS/vaXSAYa7f7VL/7ASdy8e1rCSdxvZJBTlURwUFBI8fthfY4zElyKQIifmO6E6bwsaNkSep1GroZPx38sapNtatW4S+j2FsqEA6bEBsPM7KA1a/ef2yMaWAIAUfB/10jGR3N6eA3THMILRqv1jgVJek9lfUCGLriVkClHP/pyVGfjS/gQg54fuVVqwyjHlZlf26JgTv/hf5GN1JTVckcSl84ebD63UDWZH9vtM+3ht7cJ2p4fuhjlZnFc/kUCVBjwzSc0EsayxGevsrFTHLJqGU7wmY/TOPeGXPrb6i1CPq26rFzs97feydkSwkQYK0AUbehPB8+THNndApqBHGcFtriIbQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(136003)(346002)(39860400002)(376002)(451199021)(2616005)(2906002)(66556008)(6486002)(66476007)(4326008)(316002)(66946007)(83380400001)(54906003)(6916009)(478600001)(26005)(8676002)(186003)(6512007)(5660300002)(6506007)(41300700001)(8936002)(38100700002)(86362001)(36756003)(31696002)(31686004)(66899021)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bjFSenpJaS9zMjZCTTlPSWp4VDYyN0dtaUoxUUFZQmNhWHBNQjZiTTF2czFL?=
 =?utf-8?B?azljOCtLN2RnaldZR2N2L2czQnl1bTlxTmM4L3hOUU9ORTYyaWpqRHdpTlZi?=
 =?utf-8?B?bnBGN1VrOUdWVERZVndTMjJlbnI1Nm5XOHpyeit5MnpOQm1SU0JFVFhOSE85?=
 =?utf-8?B?MWdyeG11cE82aXJkVStJaGxOMjFSQkZNdllxcWpSZFY1a0FhVEhVWWtVQ1hy?=
 =?utf-8?B?NWMvTUZPalhWUTFLeVBPQVNHVlBrcWNGSFR4U0pXVnFKTmRGVXM4cmJydlBP?=
 =?utf-8?B?dSsybmd2d2JZSWt3VFhuRHdpSkZBcXhaQktYVTBBSVZYUDNScUhiWnc0YWJE?=
 =?utf-8?B?cHhsTGZUd0psYkpvNFI4c2FyTXIxRzZVeE9yTTNvWmQxUWRValJ6RXQ2UWVo?=
 =?utf-8?B?ekZMMk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ant-Network-Message-Id: f46273bf-9082-4e09-b993-08db82d43f84
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 12:33:51.4105
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 61l5IlMj2cDt8JatQ54Tl9TDHvXLi6OTP6REw24xvbgrHhy5Oy9oZMExn5j5UZ1zDjrLn/+k/qoOW21WKo/AmQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9292

Newer hardware offers more efficient and/or flexible and/or capable
instructions, some of which we can make good use of in the hypervisor
as well. Allow a basic way (no alternatives patching) of enabling their
use. Of course this means that hypervisors thus built won't work
anymore on older, less capable hardware.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
TBD: Should we, just like for NX, add an early check in assembly code,
     to have a "clean" failure rather than a random crash?

Whereas the baseline -> v2 step isn't much of a difference (we'll gain
more there by a subsequent patch), v2 -> v3, while presumably (or shall
I say hopefully) faster, yields an overall growth of .text size by (in
my build) about 2k. The primary reason for this appear to be conversions
of SHL-by-immediate to SHLX.

--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -118,6 +118,36 @@ config HVM
 
 	  If unsure, say Y.
 
+choice
+	prompt "base psABI level"
+	default X86_64_BASELINE
+	help
+	  The psABI defines 4 levels of ISA extension sets as a coarse granular
+	  way of identifying advanced functionality that would be uniformly
+	  available in respectively newer hardware.  While v4 is not really of
+	  interest for Xen, the others can be selected here, making the
+	  resulting Xen no longer work on older hardware.  This option won't
+	  have any effect if the toolchain doesn't support the distinction.
+
+	  If unsure, stick to the default.
+
+config X86_64_BASELINE
+	bool "baseline"
+
+config X86_64_V2
+	bool "v2"
+	help
+	  This enables POPCNT and CX16, besides other extensions which are of
+	  no interest here.
+
+config X86_64_V3
+	bool "v3"
+	help
+	  This enables BMI, BMI2, LZCNT, and MOVBE, besides other extensions
+	  which are of no interest here.
+
+endchoice
+
 config XEN_SHSTK
 	bool "Supervisor Shadow Stacks"
 	depends on HAS_AS_CET_SS
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -36,6 +36,10 @@ CFLAGS += -mno-red-zone -fpic
 # the SSE setup for variadic function calls.
 CFLAGS += -mno-mmx -mno-sse $(call cc-option,$(CC),-mskip-rax-setup)
 
+# Enable the selected baseline ABI, if supported by the compiler.
+CFLAGS-$(CONFIG_X86_64_V2) += $(call cc-option,$(CC),-march=x86-64-v2)
+CFLAGS-$(CONFIG_X86_64_V3) += $(call cc-option,$(CC),-march=x86-64-v3)
+
 ifeq ($(CONFIG_INDIRECT_THUNK),y)
 # Compile with gcc thunk-extern, indirect-branch-register if available.
 CFLAGS-$(CONFIG_CC_IS_GCC) += -mindirect-branch=thunk-extern



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 12:34:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 12:34:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562455.879126 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZ3G-0003Pj-8V; Wed, 12 Jul 2023 12:34:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562455.879126; Wed, 12 Jul 2023 12:34:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZ3G-0003Pc-5U; Wed, 12 Jul 2023 12:34:38 +0000
Received: by outflank-mailman (input) for mailman id 562455;
 Wed, 12 Jul 2023 12:34:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJZ3E-0003Ju-G5
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 12:34:36 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on2062c.outbound.protection.outlook.com
 [2a01:111:f400:fe13::62c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7597ead6-20b0-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 14:34:35 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS4PR04MB9292.eurprd04.prod.outlook.com (2603:10a6:20b:4e7::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Wed, 12 Jul
 2023 12:34:33 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 12:34:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7597ead6-20b0-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=X18hHrRz4hEnVPvdts88BmNXw6De0Xek5EPFjYXGgEmNMNH7syP/ogRTi++6T24r0uXn9T0gtxaJbS0KPddbFhr2psW/S3cIhSw2FST3uLBDDyA3O2jzxHj2VwPeO+K9AThibKruD26HBkMphkfPAQ36qolXBG5MJR7RFpRkfxKJNayJapOP7s88WLQYaRxdiO1XZrfBtVQd2Ab+xKYQVQVyjrtqHbano1q/0GPkClDTOKbpKE5hOG90p89o5ZZ1+7nzmBcWL8qyzJ71s0ZxAIUxOXU9LLG2wsJl9dCgcP03+m3+0kIkIqXXU/F4ShwlhaT27SDf9t55pgPLP44g9A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=WSfHTrJ7pOa2oeWcPF+TfLLO+C/+vFOck5rOH+Ofwek=;
 b=EJWj3UTh9LnXveqOOW9EPCbFXXrMf2jGIK2QStWjPsM038Oc3WyMMwEsoVI2aJektL/u3e5CR9lEDY5tHOX2da9L4sZNwsMIA+1erP1vg9PD1XuX2t9iQUU0UUqHXFNXRjX/hb0Ll8JLpMp8em0vZfM5TVz6oGoDDNcijUYMMbCM6YN4c/w3a50u/LIimDW9iA7iZ0FUQvHSm43LORHxozxeTG8HI8Adm6amcLiG4kaWTMl0YCU0bwd887oiArStybk9fPYdYv9sffTfwGvfOl1ID6knat3LklQUdjBYL01tdEpyZaGTixrMNYq3GUaN1cF6aS2dgKXi6Z1DZd5AXw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=WSfHTrJ7pOa2oeWcPF+TfLLO+C/+vFOck5rOH+Ofwek=;
 b=u9y6mRJaK1MhwR4OxHxvYBFhesi6YY03g9dIs2wyAJhfoJsVOW1VuLKGUna8mBDiskkDk4mrfFLlqCkXG7PE3Bm9ixX6OUioWW9pEywFfIbGZ5gMwEDn5T/8wTGvX7yqQfMKMiWZD6kIFlvw50P1E0WCpxxA5Wjka5Gbdl9E6rS8eU+nu45wMD0UhDJ/WDW+WAaOADV8XjxsPJch8xkYC3g7vQ2OM4KgO6XbcEEKocJr6+yoiNVcbAHZj3RJEeRR7sYTUcFQTcb5JIWq2z2ZWeikE5VnWgNx9N5NedZ1ecaLIy1AmbGV5ed9EJcmwTj5T42if5cIU0Vh1xsDFetyrg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3e1cea22-dde5-c723-5ebb-78a54b128b56@suse.com>
Date: Wed, 12 Jul 2023 14:34:31 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH 2/3] x86: use POPCNT for hweight<N>() when available
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com>
In-Reply-To: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0208.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a5::18) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS4PR04MB9292:EE_
X-MS-Office365-Filtering-Correlation-Id: e43d1a94-cdee-4255-5458-08db82d45861
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	RP3OD1sCL//X8rGouwER+qrjCXd41eCylQBCzYMYBFXUmuezb77V99wOCxSXRf4pZP6BukJcL06Aih4tG2YTMZ1ldo5GqEfpmnt0ZBsvgz8CbdzQCEoYnIcziztUsRs7kVDBzW9AWNx1BjQqUvb6lSFJAJ9p/XgJbJeFcuywyRweElE6F7cW8BOkW1RR/YoEmKhFvzbsn3+hZK0oDIQoJfqfWUmzeS6xQqvfEQGSIn30zsh9TtdmuYn/+LtRAeWp5RQl/p36R4nUULjFb8b+E749Ugya1S/bHHkp5UOzZ6wcY2xrOZKZhU7PF+qeudhC93ivZhSRMRniiga8KM+fAUgsQAZZCedMCjQnBPkDem4VjfHedhkoQpvXJnba/+q2UDJyjTACdNd9ZRsCpOs8IhWNp2qryMzdWD/HC2nlYkiuDdCc/Gme/kDFzcd/9YxcfnWfPWlXCm9jUsem9UyEt5YtPFyf+occ2aZpIF5WemzfBkUpNsK9L+EEdHQAY3MWKnbjc8h/AjdxJLicvFtoNURTIRffuir1uvKwsBEy71Bk+Cz78IhOrz5yFzv7XQL0h/WtMpmzrPN2JvmJ0UZjp/fNytxVUsO3DJ+sqhk3G5WXhlbh/CfpxJil/59PRfPoqVz04OvdXwMDiBrIRR3ZMVArWWruvRcDsC/9iYqfrYXD9LyucTaXIm+kju8ckUv8
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(136003)(346002)(39860400002)(376002)(451199021)(2616005)(2906002)(66556008)(6486002)(66476007)(4326008)(316002)(66946007)(54906003)(6916009)(478600001)(26005)(8676002)(186003)(6512007)(5660300002)(6506007)(41300700001)(8936002)(38100700002)(86362001)(36756003)(31696002)(31686004)(16393002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QkxHVE5EalZHLytsZDVXMzBGNlJkdkFha0VWTEpmVXlHanc4d0dMTWVBbEFH?=
 =?utf-8?B?V2E2bjRHbW80a3NBTUlMcVJoTVB0NkNYcmVPSGgrY3NwRDNhZFBnbG9icXpF?=
 =?utf-8?B?YzRUZXBubE1UbGhFVm1YU2V5VVBqdHY4ZWRzd042eW94WkNSZHJkSjlMbGJY?=
 =?utf-8?B?UjROT2luNXZuU3h3TVhUcmxhMjlQdTl4amllYVBMSWIyTUttdDBRdnBYY1FU?=
 =?utf-8?B?QlpWeU92QURNOE9GMXNzRXM3S2JaTCt2RUVMRytmMjdiZk14dEhpZWc3eHpZ?=
 =?utf-8?B?ZitLNzk2VFp1SEh4MXIrOGMwN0E1VmhaSjFFSUdwR3VuUGlTalhkTDRhQzJr?=
 =?utf-8?B?OHl5RTJXWXI2dXU4aitNaS83VVltdmdDZUFZVmpuUG9KWGpIWDV3d2orQmp2?=
 =?utf-8?B?R1M5bEI4SUVxakdXc0g4bDlIUDdTajVRTVl0amo3NEVJelY0NTluQUc0T0VO?=
 =?utf-8?B?UWh2eC9nUjdYc3BWUXlQbFJDZ0JRd1NUUWd3di9tekUyTzJXbVMwK3EzODJF?=
 =?utf-8?B?UUZOSzBKcVRaY0doVnc2Q2cyTG1vMTNvcEw4eHlRZlpIVkptdC9ndWZHU0xX?=
 =?utf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MHZyYW5IWER5eTlYalJYMlIyNjB1Sk9pVHNpUHlVbms5MGFsWWdv?=
 =?utf-8?B?ekJrbHRVb0pxUVBUNFVDSVZqZFMyekVVYmFLdDBPc2ZDRnB6Z2dyc0UxRmdj?=
 =?utf-8?B?UGhTSko5NitHYnBMRkNXeWtFTk15bDA2VTdsWFlZQ3FVNUV3OVUwSm84Qnpo?=
 =?utf-8?B?RlJIcEJWN3NZakxpZi9GNkZZMVZEc1VRVkwybVU1VlM2K29SZzdCQlovdSti?=
 =?utf-8?B?djFHMEpVbXFCYkdCeHlWbDQxY1FJcS9QbjdzcXkybWpTLzA0T3NKMGFaMll5?=
 =?utf-8?B?aDR5eDd6R1ZqRUNGTVBZQU9wU2U3N0pPbFpEUDVIMEZCZ01teTVuRjFyZ0Nj?=
 =?utf-8?B?ckNqNk9COCtiSXkxZTd6aUdiOXR0dnZ5bCs1eDloVllaMEhSeGdmb2ZRUThq?=
 =?utf-8?B?RXFjTVJwQWV6Q0xHNHorQnJUclFXVzdaMUZ5ZDJ2SjhRUnB5S3BpSld1Um56?=
 =?utf-8?B?ZEZVc0xna0NTcU5JUXpJR0cwOGtPRGgrd29WOFgrQldEOGpwS01nR3BJWnJS?=
 =?utf-8?B?akxsOTdFV2dhYmxlQkFkNmx3Yzk0aGhOZ0NNQ2tkWXNBdzBZZ0FwZmRBTjMy?=
 =?utf-8?B?ZGUvRCtZZXRCU0VsdU1sUVVJK3VzRWZxaXVkOHNMZWFBYmdWM3Njd1IvK1pV?=
 =?utf-8?Q?XgmDW6gODvyAdVNyWn2p4WCQY?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e43d1a94-cdee-4255-5458-08db82d45861
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 12:34:33.1398
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: nhA+nsuu82yVaV/GcnRpON0jsMBakbS3M/7Ei9Kf8iCsyRlowvKCctWsEZ1Fz/nPy9tZ25U1DiTIAiGFpSKmzw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9292

This is faster than using the software implementation, and the insn is
available on all half-way recent hardware. Use the respective compiler
builtins when available.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v3: Re-do in a much simpler manner, without alternatives patching.
v2: Also suppress UB sanitizer instrumentation. Reduce macroization in
    hweight.c. Exclude clang builds.

--- a/xen/arch/x86/include/asm/bitops.h
+++ b/xen/arch/x86/include/asm/bitops.h
@@ -475,9 +475,16 @@ static inline int fls(unsigned int x)
  *
  * The Hamming Weight of a number is the total number of bits set in it.
  */
+#ifdef __POPCNT__
+#define hweight64(x) __builtin_popcountll(x)
+#define hweight32(x) __builtin_popcount(x)
+#define hweight16(x) __builtin_popcount((uint16_t)(x))
+#define hweight8(x)  __builtin_popcount((uint8_t)(x))
+#else
 #define hweight64(x) generic_hweight64(x)
 #define hweight32(x) generic_hweight32(x)
 #define hweight16(x) generic_hweight16(x)
 #define hweight8(x) generic_hweight8(x)
+#endif
 
 #endif /* _X86_BITOPS_H */



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 12:36:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 12:36:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562462.879136 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZ4Y-000462-Lj; Wed, 12 Jul 2023 12:35:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562462.879136; Wed, 12 Jul 2023 12:35:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZ4Y-00045v-J0; Wed, 12 Jul 2023 12:35:58 +0000
Received: by outflank-mailman (input) for mailman id 562462;
 Wed, 12 Jul 2023 12:35:57 +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 <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJZ4X-00045i-5I
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 12:35:57 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on20623.outbound.protection.outlook.com
 [2a01:111:f400:fe13::623])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a4f29abb-20b0-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 14:35:55 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS4PR04MB9292.eurprd04.prod.outlook.com (2603:10a6:20b:4e7::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Wed, 12 Jul
 2023 12:35:54 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 12:35:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a4f29abb-20b0-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LjQShAiwOaFbgSph6Kj/ZvoJAgwlcnzEAzyNcEYdA9CCAwIbDETjKd8jzrn0sOfPMwA7jD7vSUJPP03s1GRaOGYUpW5ulcPqbi1ObyqMJE7ct/qUFIXc8mIXuovZ3S66++5l1jg8A33vWcq7ufPjTuwqXKP/jQui1js+dH7lIBWP63OkbsOOGyZiaMPx4WZuXRrXpGI21qlyeaHaNezRRAAo3cWxtZIhfgGVQxOPlsTqGrcb+nN4E9LSKRVEbwJQ8hd0tyce0MImgbCEGdOKxuSLXmz3oz2GhdSZcD66VeXuckcVdY6KURMdfRtjpp53ccmpFq7pDgO4ImU5ZoaZWA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/5JtolAVvt9vNKUFYXvoqYSCHPLwYP/pbhtLKnh3NpA=;
 b=FatYSdnA2vWWEnDskwApKZJ/eaPppF9G2yH2Rp2AUp0Ucjv3W4R/+COQAO1VMy2BJGZXpE9Gq6SyJ+Z1WQOu43yL0zrzHq9Vq7jmBW18fD6rOJssuBCNVrdVGzKBhRxMIbk2KwVYYmsXJiaptTQTbqzjVd6hf1ekgSozK6rmPzmMdybsTqIDzydlbeqdJeIfybfKlaQOfMt3E9nT8JrbnShTou2viMFF+J80U0xNejjnT78w3snES3M9ixgMGzXghbsUFbBAVla34mWbikLpuGeBSKa7aVUg9uygjPVTABjGcKKnAkrvvqwKCFKCi716QhAYcLjYdcrukKISson2KA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/5JtolAVvt9vNKUFYXvoqYSCHPLwYP/pbhtLKnh3NpA=;
 b=rk9EAKCFh27vsm1/NVh2RdVth1pAh7oklfLmfhyr570YuEQpv75Ibke8tEoxSMo/vG64uPTxd4dUClc0qVMHxcXoNxoLX8vhtSmIHAUFSxN5sxpsaE/5Tz+ZnQYUbx68JisVL8k1+c5OWGm0LN82jDFxH7ImfKcGjqXcFq+EWVnyfwG0aoSZX/SsCt3eMjzUo5uvVLY7YbA2bq9Hd936K71nMDZdxA5Ll7fXdOtmDqozAc5DLSIVCxp0JkWzLbl4X+HYobHznnvd3FmBxKhE/7d8hfgjpxRGSxQs2ivhQd9hQQM3m5l38wBr1GrN5KwQfvWt0NYd7Eb6+3V/Q6cmZQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <60e79cc5-ad07-81e9-e7e6-f97a73a4df62@suse.com>
Date: Wed, 12 Jul 2023 14:35:52 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH 3/3] x86: short-circuit certain cpu_has_* when x86-64-v{2,3}
 are in effect
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com>
In-Reply-To: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0040.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4a::8) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS4PR04MB9292:EE_
X-MS-Office365-Filtering-Correlation-Id: 86730012-e967-4df2-e553-08db82d488c0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	O+nUgMRbacEqZxWIqG9oVukWfRiEoTWWsYz/XQ2A3RiZiLHRD2AzRSa2a0NmBHFiWCWE24Iogah2yzjaEYOFBVHTsM742Ro1xpoRP+qzM9PA2XSVUzVodNN9RX/0iYC4pUPULuAG6EzoehO8l3+IUeJhCl9hF1rKlPQgCrEA0UbmyqSdfLoSrnZohdXduRc0nGQUmG6bzMNhIlqESqiDuaTiDStEjpI8bzGo6TOW8Sz0qcGKez1xEbwkjNl0lDOOYjPAVKSoEfYXx3oEj9G1v+Mk+A4h76gj2ZydkhyxCyMzHZRPro8nLuMfjlIq/IbCLItiTcWZF/Mkobh4HArpkfJSM4azhqaryGnXjOlkEhxUX78U3zCuy/6diIKIsTOu+Gw6SihMsxtcPT2N/5iLw/nro80Ddbcdfy6ux/4+L1H1vr77trVNbRIL6Ub6sJmfGrxhHZ1YuZFFGJabmd1TVNPlVMDpq4z/QbZ9UPwS+ztLrsBZTJhQIWgV6oXAnqix7QUcb7iKjGH7vIiAqfhrh8l4R6/2OtCLWPWdKRSUDcREeMUwz2qLxn48tKSl/JvK9kEyevCEqQa5Wh0/NWt/5SHVjWZpEZw4OIZeGQQU50skcr7O8DnJfDAYxkZdfm9GOKFPCbILVaSI3cEZ9MyZjA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(136003)(346002)(39860400002)(376002)(451199021)(2616005)(2906002)(66556008)(6486002)(66476007)(4326008)(316002)(66946007)(54906003)(6916009)(478600001)(26005)(8676002)(186003)(6512007)(5660300002)(6506007)(41300700001)(8936002)(38100700002)(86362001)(36756003)(31696002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?d3hoeTFJdjdUM2k0Y3N4L0VudDRoUXNlcHNoeWJFaDlwbVpUOWpWc3d1SVZv?=
 =?utf-8?B?ZldNaUFaZ2FFMy9JdXRRUlB6VDV3OVFlZmVHVEJGQ0R4V2JnSXlKajAwdHdJ?=
 =?utf-8?B?QnVOOVNtcml2R3Y4c3BPQ2xQT3JSTHBCdTZmSjhhTkdUSEdZY1YyTVl3UUZj?=
 =?utf-8?B?dGc2R3ZKaEJUZVRYL1JmWVVaaHh5dGh0eFZGYitFTWRleGY2VE8zemN5djl3?=
 =?utf-8?B?a2NnZTZQN2w5TUFIcWhGUkg0MUpwcDlKL25Ga0J0TGxxU3p6Vlp4aTBJemRs?=
 =?utf-8?B?QVR1dzdMN3FVYzNXMkFWdlQyVjBBNHp4ZFVoaUNicHhwYmhIc0xOQ1JPK2VP?=
 =?utf-8?B?ZmVRRmsvaDZVY016dXdXdmxRclJTdTN1b2RjQ2dlM0VJTlVvK25OVkwwOWtI?=
 =?utf-8?B?SGhxdkI5Vm5PbnVIeWNvM3h1d3VZSV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e553-08db82d488c0
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 12:35:54.2839
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: B0bslSMILy/x5wTnOLojhyTcIwFLZwprPq5tVjiZfys/fj0l0twMF9X7NjHWfLEl3s8SU5I5Pf/MHkIZRW5RbA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9292

Certain fallback code can be made subject to DCE this way. Note that
CX16 has no compiler provided manifest constant, so CONFIG_* are used
there instead. Note also that we don't have cpu_has_movbe nor
cpu_has_lzcnt (aka cpu_has_abm).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Of course we could use IS_ENABLED(CONFIG_X86_64_V<n>) everywhere, but as
CX16 shows this isn't necessarily better than the #if/#else approach
based on compiler-provided manifest constants. While not really intended
to be used that way, it looks as if we could also use
IS_ENABLED(__POPCNT__) and alike.

We could go further and also short-circuit SSE*, AVX and alike, which we
don't use outside of the emulator.

--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -76,13 +76,19 @@ static inline bool boot_cpu_has(unsigned
 #define cpu_has_eist            boot_cpu_has(X86_FEATURE_EIST)
 #define cpu_has_ssse3           boot_cpu_has(X86_FEATURE_SSSE3)
 #define cpu_has_fma             boot_cpu_has(X86_FEATURE_FMA)
-#define cpu_has_cx16            boot_cpu_has(X86_FEATURE_CX16)
+#define cpu_has_cx16            (IS_ENABLED(CONFIG_X86_64_V2) || \
+                                 IS_ENABLED(CONFIG_X86_64_V3) || \
+                                 boot_cpu_has(X86_FEATURE_CX16))
 #define cpu_has_pdcm            boot_cpu_has(X86_FEATURE_PDCM)
 #define cpu_has_pcid            boot_cpu_has(X86_FEATURE_PCID)
 #define cpu_has_sse4_1          boot_cpu_has(X86_FEATURE_SSE4_1)
 #define cpu_has_sse4_2          boot_cpu_has(X86_FEATURE_SSE4_2)
 #define cpu_has_x2apic          boot_cpu_has(X86_FEATURE_X2APIC)
+#ifdef __POPCNT__
+#define cpu_has_popcnt          true
+#else
 #define cpu_has_popcnt          boot_cpu_has(X86_FEATURE_POPCNT)
+#endif
 #define cpu_has_aesni           boot_cpu_has(X86_FEATURE_AESNI)
 #define cpu_has_xsave           boot_cpu_has(X86_FEATURE_XSAVE)
 #define cpu_has_avx             boot_cpu_has(X86_FEATURE_AVX)
@@ -114,11 +120,19 @@ static inline bool boot_cpu_has(unsigned
 #define cpu_has_xsaves          boot_cpu_has(X86_FEATURE_XSAVES)
 
 /* CPUID level 0x00000007:0.ebx */
+#ifdef __BMI__
+#define cpu_has_bmi1            true
+#else
 #define cpu_has_bmi1            boot_cpu_has(X86_FEATURE_BMI1)
+#endif
 #define cpu_has_hle             boot_cpu_has(X86_FEATURE_HLE)
 #define cpu_has_avx2            boot_cpu_has(X86_FEATURE_AVX2)
 #define cpu_has_smep            boot_cpu_has(X86_FEATURE_SMEP)
+#ifdef __BMI2__
+#define cpu_has_bmi2            true
+#else
 #define cpu_has_bmi2            boot_cpu_has(X86_FEATURE_BMI2)
+#endif
 #define cpu_has_invpcid         boot_cpu_has(X86_FEATURE_INVPCID)
 #define cpu_has_rtm             boot_cpu_has(X86_FEATURE_RTM)
 #define cpu_has_pqe             boot_cpu_has(X86_FEATURE_PQE)



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 12:38:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 12:38:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562466.879146 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZ6U-0004hT-0h; Wed, 12 Jul 2023 12:37:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562466.879146; Wed, 12 Jul 2023 12:37:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZ6T-0004hM-U0; Wed, 12 Jul 2023 12:37:57 +0000
Received: by outflank-mailman (input) for mailman id 562466;
 Wed, 12 Jul 2023 12:37:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJZ6S-0004hC-Ls; Wed, 12 Jul 2023 12:37:56 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJZ6S-0007O4-It; Wed, 12 Jul 2023 12:37:56 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJZ6S-00080F-6k; Wed, 12 Jul 2023 12:37:56 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJZ6S-0005S2-6H; Wed, 12 Jul 2023 12:37:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=w5X+PW2tWchktNDyI4Dwir9PYXms0Nn3uRI/xwkYCqo=; b=sTlTlK/DbrO/KRrNlNt6mUXYqk
	chh5XSGJQlmc3Ljax/O5bPdbzBn2663TCaZdNPrp/1lwOJlkF8pYcIm8iyAdaHzOTdByz7+2ppeiB
	EYSoQn1AYZE8meGmVKq6zvyEXjX4wybS5g5PNfQEFDjZkNXhpAqteEjWxxYQlHnY3Eww=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181768-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181768: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:guest-saverestore.2:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-credit1:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:guest-localmigrate:fail:heisenbug
    linux-linus:test-amd64-amd64-dom0pvh-xl-amd:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-freebsd11-amd64:guest-start/freebsd.repeat:fail:heisenbug
    linux-linus:test-arm64-arm64-xl-credit2:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-multivcpu:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-credit2:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:guest-saverestore:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-shadow:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-dom0pvh-xl-intel:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=3f01e9fed8454dcd89727016c3e5b2fbb8f8e50c
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 12 Jul 2023 12:37:56 +0000

flight 181768 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181768/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 17 guest-saverestore.2 fail in 181765 pass in 181768
 test-amd64-amd64-xl-credit1 20 guest-localmigrate/x10 fail in 181765 pass in 181768
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 16 guest-localmigrate fail in 181765 pass in 181768
 test-amd64-amd64-dom0pvh-xl-amd 22 guest-start/debian.repeat fail in 181765 pass in 181768
 test-amd64-amd64-freebsd11-amd64 21 guest-start/freebsd.repeat fail in 181765 pass in 181768
 test-arm64-arm64-xl-credit2 18 guest-start/debian.repeat fail in 181765 pass in 181768
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 18 guest-localmigrate/x10 fail in 181765 pass in 181768
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 18 guest-localmigrate/x10 fail in 181765 pass in 181768
 test-amd64-amd64-xl-multivcpu 22 guest-start/debian.repeat fail pass in 181765
 test-amd64-amd64-xl-credit2  20 guest-localmigrate/x10     fail pass in 181765
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 15 guest-saverestore fail pass in 181765
 test-amd64-amd64-xl-shadow   22 guest-start/debian.repeat  fail pass in 181765
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 18 guest-localmigrate/x10 fail pass in 181765
 test-amd64-amd64-dom0pvh-xl-intel 22 guest-start/debian.repeat fail pass in 181765

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                3f01e9fed8454dcd89727016c3e5b2fbb8f8e50c
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   86 days
Failing since        180281  2023-04-17 06:24:36 Z   86 days  172 attempts
Testing same since   181755  2023-07-10 17:42:07 Z    1 days    4 attempts

------------------------------------------------------------
3736 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            fail    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 622011 lines long.)


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 12:50:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 12:50:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562473.879156 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZI6-0006GZ-2u; Wed, 12 Jul 2023 12:49:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562473.879156; Wed, 12 Jul 2023 12:49:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZI5-0006GS-Vx; Wed, 12 Jul 2023 12:49:57 +0000
Received: by outflank-mailman (input) for mailman id 562473;
 Wed, 12 Jul 2023 12:49:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJZI5-0006Fb-09
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 12:49:57 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on062c.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::62c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 99ac8978-20b2-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 14:49:55 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PAWPR04MB9808.eurprd04.prod.outlook.com (2603:10a6:102:383::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 12:49:53 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 12:49:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 99ac8978-20b2-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JwzK1DOq+IN1bQPeZ0BwmYbkonuEaih7dmCCjBlCnie/cU3be8+yUIR6RovQQ4YjQaoZlV8Vt22GEg80TnJihKxUeb2WNqXnh1h0ssmhA0mEUfoxnAHyHBCOgyM+i8kLNrxPHFpAYA/SQmqrHHCRduLHeRJFyFSfkBZVR5LS1IAPw/TkaOduw8Z82tROrxdGSbl+ZX+zykVE+w43SMVD8H6q2gXbm/o8mGzXT3xILdh5tQgWy/0Gtv0iSHsCv+W3A8DrmtGbjwof2algnYoN/w7funD9YfumN9Hxk6lsw/BQvf5jgvXkcqAvDclJj8C9jUyMDSVJgj06kv0JmydBug==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=A9lCbn3DqAMl1RM2QPrZTbiQRfaWGrcLMBTpPLT9Qjc=;
 b=FnIT6132SVgNltVOKsK9pj4RaiQoprz1Dx4j3h3xy43E5C61WNwz9xkNPoCNC4zpshShoqzZdtK/xr1BcWgDqVx8i39AoX8okyTW43XIUMTY4sAXHGcLMvJ8dzb5cezZ1lfIv/0b4qBPK6Tz9l51A9zlIgiKe+uh+fFtFJmWSkf8QyTDV8R20QPFsVrJZEutxcFPWkKjGCxdJJuHRXjcTcKIx+/U8ZwPchKKCsZ+upyrknyvycCuZDZKHcQpnRlP+jEf25ieH1YvjjpwJLMAIdR+ATyXBuLkOJeYiX3Xr0anvw2f3xQO6uEA3rL7rppeFdf4O9zkE4kV1pWhDgkGBg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=A9lCbn3DqAMl1RM2QPrZTbiQRfaWGrcLMBTpPLT9Qjc=;
 b=Ukf1EtzGiVbc986myLdFSqsnFS3i+IvJlJ1B/fIIO1nqvXPPjR/QVpxAcpTY7DGU7iIMVv+6iTc9efjU4lX825KX7kZYxeIs4/CVvG+x3NzCQKsxUToRrdyn8+utu4+qeAnOwFsEAs02f2Bce2YymMarwjQvNXP8xrKyoWkjnTTrOFUFfkAdxcBpW1FReSmlKg0E67DasQWUNkBXPT41z2F0XGkBi7CG0/8aePIPVcw6Y0wiuiPhFaM8qs6B3dt/ppoO8I5DS0p4SgiZbi2ggMA+uQm8Ocnm+lXyPLv9zkbfyEjU76FcxHjVcmmoDSM1OwAi4U4tXsg1pB6PDICWoQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <73977cf1-b38a-4eb8-4bac-cf2656535cb0@suse.com>
Date: Wed, 12 Jul 2023 14:49:51 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: Violations of mandatory MISRA C:2012 Rule 19.1 in X86_64 build
Content-Language: en-US
To: Roberto Bagnara <roberto.bagnara@bugseng.com>
References: <fa2bc5da-b866-05ac-409f-c26e025428c3@bugseng.com>
Cc: xen-devel@lists.xenproject.org
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <fa2bc5da-b866-05ac-409f-c26e025428c3@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0245.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:af::6) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAWPR04MB9808:EE_
X-MS-Office365-Filtering-Correlation-Id: fb51a40a-768e-4731-95f3-08db82d67cdd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	OIqSWDflAV65DMcnunRf61ulASECkjWpi3vEBbXNnKHnmcZTsZ7seXrAWRtD9rey1VNnlpjL6bSIVSP23XF7mbifa6fqH2JsiqhhbqZrqja8FB7FXiL7JEmsUNeyoU7jGeVyzgydpt/P4wZRbhsvZjbbCDxhA7NALdfagTltn24g7xzEgi3OjdwBtaLG8/QdGBSFEi+zPRjnjGxSDUVvgUGmALzu8al3A0RfifrCz8IBoMbGAwV076x2K7mInHy05gtLpxPFoA27dcjMDA3Jtu2olHZ4bS0y/jMY1wNS2SauCCjem+cCwtuFHiH68Ghmph828rcSGtxDFt7zHxe71ACXdENWpUAbCSgC2OrOsoI+eDGRm/16pkq+z19EnxSNqhZUTHgDqyoFxjjFKUL7W56kL/IZpCZkvHWa6cIRhdcTzKg1mctSnAWE7wDLElxfib83fQPYZx2m6aMp812vdsB/g47WyZld3XlrFx0+wVjOvWEmI4ioq7g3v1jZBuv8x5Opj92KeFLznB6G3t9VInuN4dk8hZA7I+Su5bkQQpiu+9z/5xzYPwiO7QNC+menBH6QRzqBfMNtRYUTYa0wN7/wA2L2/CmZv2TwagGhsyBjiMjs2FcU1wW6J4JWscnU
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(396003)(39860400002)(366004)(376002)(346002)(451199021)(4326008)(66946007)(6916009)(66556008)(66476007)(6486002)(966005)(6512007)(83380400001)(478600001)(36756003)(186003)(2616005)(6506007)(86362001)(53546011)(26005)(38100700002)(31696002)(41300700001)(8676002)(8936002)(31686004)(5660300002)(316002)(2906002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aWF0d0twTE1xY0RvK21nNTV4WjFtUWFERGRtcHQ2MTd5MzhzWlI1dTQreFlG?=
 =?utf-8?B?dlJFbXhibVBTekVVbFhHY3l1cmg4Mi85aDJhbUJ4bXZoOFMyeVpCbTZybGJj?=
 =?utf-8?B?ZmorU2lPU24vK05zWEloRWcxckZjbGc1MEZmZE8xbUFtUVFUdHVjZ2FpTHFN?=
 =?utf-8?B?a3M3SmhP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lq?=
 =?utf-8?B?RVhwc2NxeXVPNEQ3ZlVDaWxmaGFaUzdtbGVPcm8rR0hRYkdQY2I1alU2WnIz?=
 =?utf-8?B?TkVMdzNOR1EybFhnNnpZMTN2QkVZTUVOUm5GdWdKV3FSNVpEbGFRdUVPZ1FK?=
 =?utf-8?B?ZU1meXdONzFJM2Zia2FCUHpEbG5OSUVnOGgxNHBFbTFFTkNqcWx3dUMyTG8y?=
 =?utf-8?Q?5w7sNeXeenyiBk9l0n0xzUMQ1?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: fb51a40a-768e-4731-95f3-08db82d67cdd
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 12:49:53.3464
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: G6uRqysDkonHIsM8X1ktsKTE80+wC3e6UilSrMWGLLhO2IFmG5/0UsJxWvk3OivI67ao/dReSokvLTIiRNSbGA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9808

On 11.07.2023 18:40, Roberto Bagnara wrote:
> Mandatory Rule 19.1 (An object shall not be assigned or copied to an
> overlapping object) is directly targeted at two undefined behaviors,
> one of which is the subject of 6.5.16.1p3, namely:
> 
>    If the value being stored in an object is read from another object
>    that overlaps in any way the storage of the first object, then the
>    overlap shall be exact and the two objects shall have qualified or
>    unqualified versions of a compatible type; otherwise, the behavior
>    is undefined.
> 
> You can see a number of definite violations in the X86_64 build
> at this link:
> 
>    https://saas.eclairit.com:3787/fs/var/local/eclair/XEN.ecdf/ECLAIR_normal/origin/staging/X86_64-Set1/149/PROJECT.ecd;/by_service/MC3R1.R19.1.html

Hmm, gives me "Unauthorized".

> As the rule is mandatory, it cannot be deviated.

Which is odd, and that's in turn because the C spec is overly strict
imo. Considering the one example we looked at yesterday, I have a hard
time seeing what UB there would be on little-endian hardware. Both
fields (rip and eip) don't overlap exactly, but their low halves (which
is all we care about here) do. With this I cannot come up with a way in
which the compiler could screw us up, even if it wanted to.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 12:57:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 12:57:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562481.879165 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZOx-0007n6-UD; Wed, 12 Jul 2023 12:57:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562481.879165; Wed, 12 Jul 2023 12:57:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZOx-0007mz-RU; Wed, 12 Jul 2023 12:57:03 +0000
Received: by outflank-mailman (input) for mailman id 562481;
 Wed, 12 Jul 2023 12:57:02 +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
 <SRS0=M0TT=C6=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qJZOw-0007mt-Km
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 12:57:02 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 97285f52-20b3-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 14:57:00 +0200 (CEST)
Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com
 [209.85.217.41])
 by support.bugseng.com (Postfix) with ESMTPSA id 051E84EE073E
 for <xen-devel@lists.xenproject.org>; Wed, 12 Jul 2023 14:57:00 +0200 (CEST)
Received: by mail-vs1-f41.google.com with SMTP id
 ada2fe7eead31-44358c019ddso2580061137.1
 for <xen-devel@lists.xenproject.org>; Wed, 12 Jul 2023 05:56:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 97285f52-20b3-11ee-8611-37d641c3527e
X-Gm-Message-State: ABy/qLZD0UtpXJT1MKVvjpYFEMw+n6zuDIBokJh2pQgaTbmfOFovybmh
	BBIOzvl368HvFeakaiRQnagYNIYq/n/BRxX+nhk=
X-Google-Smtp-Source: APBJJlH/I1pPS+txKz4GmAGBQSlpaGeiOwzM7KI9TpAQ4/OduLPc9+3jzsrDKsrklh5c//ETeCuHKSJ5R4OKJJXFffg=
X-Received: by 2002:a67:e90b:0:b0:443:6cd7:6dc3 with SMTP id
 c11-20020a67e90b000000b004436cd76dc3mr9503763vso.5.1689166618811; Wed, 12 Jul
 2023 05:56:58 -0700 (PDT)
MIME-Version: 1.0
References: <fa2bc5da-b866-05ac-409f-c26e025428c3@bugseng.com> <73977cf1-b38a-4eb8-4bac-cf2656535cb0@suse.com>
In-Reply-To: <73977cf1-b38a-4eb8-4bac-cf2656535cb0@suse.com>
From: Simone Ballarin <simone.ballarin@bugseng.com>
Date: Wed, 12 Jul 2023 14:56:47 +0200
X-Gmail-Original-Message-ID: <CAFHJcJu8Z7Lwv6RJuGnqovV0OGK1ehhm3y6xCevfLrniLJN4uQ@mail.gmail.com>
Message-ID: <CAFHJcJu8Z7Lwv6RJuGnqovV0OGK1ehhm3y6xCevfLrniLJN4uQ@mail.gmail.com>
Subject: Re: Violations of mandatory MISRA C:2012 Rule 19.1 in X86_64 build
To: Jan Beulich <jbeulich@suse.com>
Cc: Roberto Bagnara <roberto.bagnara@bugseng.com>, xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="00000000000047e28b060049c0a1"

--00000000000047e28b060049c0a1
Content-Type: text/plain; charset="UTF-8"

Il giorno mer 12 lug 2023 alle ore 14:50 Jan Beulich <jbeulich@suse.com> ha
scritto:

> On 11.07.2023 18:40, Roberto Bagnara wrote:
> > Mandatory Rule 19.1 (An object shall not be assigned or copied to an
> > overlapping object) is directly targeted at two undefined behaviors,
> > one of which is the subject of 6.5.16.1p3, namely:
> >
> >    If the value being stored in an object is read from another object
> >    that overlaps in any way the storage of the first object, then the
> >    overlap shall be exact and the two objects shall have qualified or
> >    unqualified versions of a compatible type; otherwise, the behavior
> >    is undefined.
> >
> > You can see a number of definite violations in the X86_64 build
> > at this link:
> >
> >
> https://saas.eclairit.com:3787/fs/var/local/eclair/XEN.ecdf/ECLAIR_normal/origin/staging/X86_64-Set1/149/PROJECT.ecd;/by_service/MC3R1.R19.1.html
>
> Hmm, gives me "Unauthorized".
>

Please try again, now it should work.

Simone Ballarin, M.Sc.

Field Application Engineer, BUGSENG (https://bugseng.com
<http://bugseng.com>)

--00000000000047e28b060049c0a1
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">Il giorno mer 12 lug 2023 alle ore 14=
:50 Jan Beulich &lt;<a href=3D"mailto:jbeulich@suse.com">jbeulich@suse.com<=
/a>&gt; ha scritto:<br></div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1=
ex">On 11.07.2023 18:40, Roberto Bagnara wrote:<br>
&gt; Mandatory Rule 19.1 (An object shall not be assigned or copied to an<b=
r>
&gt; overlapping object) is directly targeted at two undefined behaviors,<b=
r>
&gt; one of which is the subject of 6.5.16.1p3, namely:<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 If the value being stored in an object is read from anoth=
er object<br>
&gt;=C2=A0 =C2=A0 that overlaps in any way the storage of the first object,=
 then the<br>
&gt;=C2=A0 =C2=A0 overlap shall be exact and the two objects shall have qua=
lified or<br>
&gt;=C2=A0 =C2=A0 unqualified versions of a compatible type; otherwise, the=
 behavior<br>
&gt;=C2=A0 =C2=A0 is undefined.<br>
&gt; <br>
&gt; You can see a number of definite violations in the X86_64 build<br>
&gt; at this link:<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 <a href=3D"https://saas.eclairit.com:3787/fs/var/local/ec=
lair/XEN.ecdf/ECLAIR_normal/origin/staging/X86_64-Set1/149/PROJECT.ecd;/by_=
service/MC3R1.R19.1.html" rel=3D"noreferrer" target=3D"_blank">https://saas=
.eclairit.com:3787/fs/var/local/eclair/XEN.ecdf/ECLAIR_normal/origin/stagin=
g/X86_64-Set1/149/PROJECT.ecd;/by_service/MC3R1.R19.1.html</a><br>
<br>
Hmm, gives me &quot;Unauthorized&quot;.<br></blockquote><div><br></div></di=
v><div>Please try again, now it should work.<br></div><div><br></div><div d=
ir=3D"ltr" class=3D"gmail_signature"><div dir=3D"ltr">Simone Ballarin, M.Sc=
.<br><br><div>Field Application Engineer, BUGSENG (<a href=3D"http://bugsen=
g.com" target=3D"_blank">https://bugseng.com</a>)</div></div></div></div>

--00000000000047e28b060049c0a1--


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 12:57:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 12:57:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562479.879176 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZPE-0008Be-60; Wed, 12 Jul 2023 12:57:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562479.879176; Wed, 12 Jul 2023 12:57:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZPE-0008BX-28; Wed, 12 Jul 2023 12:57:20 +0000
Received: by outflank-mailman (input) for mailman id 562479;
 Wed, 12 Jul 2023 12:52:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=LPQ8=C6=kernel.org=mripard@srs-se1.protection.inumbo.net>)
 id 1qJZKn-0007iA-Dh
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 12:52:45 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fdb620df-20b2-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 14:52:43 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 90731616E0;
 Wed, 12 Jul 2023 12:52:42 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9574CC433C8;
 Wed, 12 Jul 2023 12:52:40 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fdb620df-20b2-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689166362;
	bh=VUp4Rlz/Z/tP0fYoIxay7sGXmkE8wNT+g75bK+DZxB0=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=VHSSnie62FieoVZOPTFB2Y3BjScn36W/kPCzU0kXJHhE//ue9XPS8m8BWVWuK1JXg
	 ngaOk9HelI7O3aehIp1cvxRX++gsm1/VNXMpJoJ6OKutHO0yat7merxyOCYv6jkNrs
	 mGyIH3jgSgWA0kzfyrXQxBTe5//Y6oX/yFTBbJLfDivqCZcdf4hMsL1M53Yj07fHxc
	 +CFygYRSh/CbU7jjYhXtYXZB2YcAkCjR1J+1GNdgC/BLrzt6gd9aCHwPsxTanKUq+3
	 uBhYtE9f8zj5keX4AmzbR58Pa5L0hvIRHKFAQDBWxlZmRc02OZPz7QiEefmWySfT4X
	 ekkVQHORXTphg==
Date: Wed, 12 Jul 2023 14:52:38 +0200
From: Maxime Ripard <mripard@kernel.org>
To: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
Cc: Christian =?utf-8?B?S8O2bmln?= <christian.koenig@amd.com>, 
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Thomas Zimmermann <tzimmermann@suse.de>, 
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, 
	Alex Deucher <alexander.deucher@amd.com>, "Pan, Xinhui" <Xinhui.Pan@amd.com>, 
	Harry Wentland <harry.wentland@amd.com>, Leo Li <sunpeng.li@amd.com>, 
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>, Hamza Mahfooz <hamza.mahfooz@amd.com>, 
	Javier Martinez Canillas <javierm@redhat.com>, Guchun Chen <guchun.chen@amd.com>, 
	Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>, Evan Quan <evan.quan@amd.com>, Likun Gao <Likun.Gao@amd.com>, 
	Marek =?utf-8?B?T2zFocOhaw==?= <marek.olsak@amd.com>, David Francis <David.Francis@amd.com>, 
	Hawking Zhang <Hawking.Zhang@amd.com>, Lang Yu <Lang.Yu@amd.com>, Philip Yang <Philip.Yang@amd.com>, 
	Yifan Zhang <yifan1.zhang@amd.com>, Tim Huang <Tim.Huang@amd.com>, Zack Rusin <zackr@vmware.com>, 
	Sam Ravnborg <sam@ravnborg.org>, Jani Nikula <jani.nikula@intel.com>, 
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>, =?utf-8?B?TWHDrXJh?= Canal <mairacanal@riseup.net>, 
	=?utf-8?B?QW5kcsOp?= Almeida <andrealmeid@igalia.com>, Qingqing Zhuo <qingqing.zhuo@amd.com>, 
	Aurabindo Pillai <aurabindo.pillai@amd.com>, Hersen Wu <hersenxs.wu@amd.com>, Fangzhi Zuo <jerry.zuo@amd.com>, 
	Stylon Wang <stylon.wang@amd.com>, Alan Liu <haoping.liu@amd.com>, Wayne Lin <Wayne.Lin@amd.com>, 
	Aaron Liu <aaron.liu@amd.com>, Melissa Wen <mwen@igalia.com>, 
	Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>, David Tadokoro <davidbtadokoro@usp.br>, 
	Wenjing Liu <wenjing.liu@amd.com>, Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, 
	Mario Limonciello <mario.limonciello@amd.com>, Alexey Kodanev <aleksei.kodanev@bell-sw.com>, 
	Roman Li <roman.li@amd.com>, 
	=?utf-8?Q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= <samsagax@gmail.com>, Dave Airlie <airlied@redhat.com>, 
	Russell King <linux@armlinux.org.uk>, Liviu Dudau <liviu.dudau@arm.com>, Joel Stanley <joel@jms.id.au>, 
	Boris Brezillon <bbrezillon@kernel.org>, Nicolas Ferre <nicolas.ferre@microchip.com>, 
	Alexandre Belloni <alexandre.belloni@bootlin.com>, Claudiu Beznea <claudiu.beznea@microchip.com>, 
	Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, 
	Kyungmin Park <kyungmin.park@samsung.com>, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, 
	Stefan Agner <stefan@agner.ch>, Alison Wang <alison.wang@nxp.com>, 
	Patrik Jakobsson <patrik.r.jakobsson@gmail.com>, Noralf =?utf-8?Q?Tr=C3=B8nnes?= <noralf@tronnes.org>, 
	Xinliang Liu <xinliang.liu@linaro.org>, Tian Tao <tiantao6@hisilicon.com>, 
	Danilo Krummrich <dakr@redhat.com>, Deepak Rawat <drawat.floss@gmail.com>, 
	Jani Nikula <jani.nikula@linux.intel.com>, Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
	Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>, 
	Ville =?utf-8?B?U3lyasOkbMOk?= <ville.syrjala@linux.intel.com>, Lucas De Marchi <lucas.demarchi@intel.com>, 
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>, Andrzej Hajda <andrzej.hajda@intel.com>, 
	Matt Roper <matthew.d.roper@intel.com>, Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>, 
	Radhakrishna Sripada <radhakrishna.sripada@intel.com>, Hans de Goede <hdegoede@redhat.com>, 
	Luca Coelho <luciano.coelho@intel.com>, Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>, 
	Kai Vehmanen <kai.vehmanen@linux.intel.com>, Vinod Govindapillai <vinod.govindapillai@intel.com>, 
	=?utf-8?Q?=C5=81ukasz?= Bartosik <lb@semihalf.com>, Anusha Srivatsa <anusha.srivatsa@intel.com>, 
	Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>, Uma Shankar <uma.shankar@intel.com>, 
	Imre Deak <imre.deak@intel.com>, Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>, 
	Swati Sharma <swati2.sharma@intel.com>, Jouni =?utf-8?B?SMO2Z2FuZGVy?= <jouni.hogander@intel.com>, 
	Mika Kahola <mika.kahola@intel.com>, =?utf-8?B?Sm9zw6k=?= Roberto de Souza <jose.souza@intel.com>, 
	Arun R Murthy <arun.r.murthy@intel.com>, Gustavo Sousa <gustavo.sousa@intel.com>, 
	Khaled Almahallawy <khaled.almahallawy@intel.com>, Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>, 
	Andi Shyti <andi.shyti@linux.intel.com>, Nirmoy Das <nirmoy.das@intel.com>, Fei Yang <fei.yang@intel.com>, 
	Animesh Manna <animesh.manna@intel.com>, Deepak R Varma <drv@mailo.com>, 
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, 
	Vandita Kulkarni <vandita.kulkarni@intel.com>, Suraj Kandpal <suraj.kandpal@intel.com>, 
	Drew Davenport <ddavenport@chromium.org>, Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>, 
	Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, 
	Philipp Zabel <p.zabel@pengutronix.de>, Dan Carpenter <error27@gmail.com>, 
	Paul Cercueil <paul@crapouillou.net>, Anitha Chrisanthus <anitha.chrisanthus@intel.com>, 
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>, Linus Walleij <linus.walleij@linaro.org>, 
	Chun-Kuang Hu <chunkuang.hu@kernel.org>, Matthias Brugger <matthias.bgg@gmail.com>, 
	Neil Armstrong <neil.armstrong@linaro.org>, Kevin Hilman <khilman@baylibre.com>, 
	Rob Clark <robdclark@gmail.com>, Abhinav Kumar <quic_abhinavk@quicinc.com>, 
	Vinod Polimera <quic_vpolimer@quicinc.com>, Jiasheng Jiang <jiasheng@iscas.ac.cn>, 
	Konrad Dybcio <konrad.dybcio@linaro.org>, Jessica Zhang <quic_jesszhan@quicinc.com>, 
	Liu Shixin <liushixin2@huawei.com>, Marek Vasut <marex@denx.de>, Ben Skeggs <bskeggs@redhat.com>, 
	Karol Herbst <kherbst@redhat.com>, Lyude Paul <lyude@redhat.com>, Tomi Valkeinen <tomba@kernel.org>, 
	Emma Anholt <emma@anholt.net>, Gerd Hoffmann <kraxel@redhat.com>, 
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>, Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>, 
	Wolfram Sang <wsa+renesas@sang-engineering.com>, Geert Uytterhoeven <geert+renesas@glider.be>, 
	Biju Das <biju.das.jz@bp.renesas.com>, Sandy Huang <hjc@rock-chips.com>, 
	Heiko =?utf-8?Q?St=C3=BCbner?= <heiko@sntech.de>, Orson Zhai <orsonzhai@gmail.com>, 
	Baolin Wang <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>, 
	Alain Volmat <alain.volmat@foss.st.com>, Yannick Fertre <yannick.fertre@foss.st.com>, 
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>, Philippe Cornu <philippe.cornu@foss.st.com>, 
	Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, 
	Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, 
	Samuel Holland <samuel@sholland.org>, Thierry Reding <thierry.reding@gmail.com>, 
	Mikko Perttunen <mperttunen@nvidia.com>, Jonathan Hunter <jonathanh@nvidia.com>, 
	Jyri Sarha <jyri.sarha@iki.fi>, David Lechner <david@lechnology.com>, 
	Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>, Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>, 
	Melissa Wen <melissa.srw@gmail.com>, Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
	Michal Simek <michal.simek@amd.com>, Haneen Mohammed <hamohammed.sa@gmail.com>, 
	linux-hyperv@vger.kernel.org, linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org, 
	dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, 
	Yongqin Liu <yongqin.liu@linaro.org>, Alim Akhtar <alim.akhtar@samsung.com>, 
	Marijn Suijten <marijn.suijten@somainline.org>, Fabio Estevam <festevam@gmail.com>, 
	Sumit Semwal <sumit.semwal@linaro.org>, Jerome Brunet <jbrunet@baylibre.com>, 
	linux-samsung-soc@vger.kernel.org, amd-gfx@lists.freedesktop.org, 
	linux-stm32@st-md-mailman.stormreply.com, linux-rockchip@lists.infradead.org, 
	Xinwei Kong <kong.kongxinwei@hisilicon.com>, VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>, 
	NXP Linux Team <linux-imx@nxp.com>, spice-devel@lists.freedesktop.org, linux-sunxi@lists.linux.dev, 
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>, linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, 
	linux-mediatek@lists.infradead.org, xen-devel@lists.xenproject.org, linux-tegra@vger.kernel.org, 
	linux-amlogic@lists.infradead.org, Gurchetan Singh <gurchetansingh@chromium.org>, 
	Sean Paul <sean@poorly.run>, linux-arm-kernel@lists.infradead.org, 
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Andrew Jeffery <andrew@aj.id.au>, linux-mips@vger.kernel.org, 
	Chia-I Wu <olvaffe@gmail.com>, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de, 
	John Stultz <jstultz@google.com>, freedreno@lists.freedesktop.org, 
	Lucas Stach <l.stach@pengutronix.de>, Julia Lawall <Julia.Lawall@inria.fr>
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
Message-ID: <o3dc4q27ap6rajsvpfwfvs3z3afekkwbhnclvswkaietciy2kc@unjf67gz5tur>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <94eb6e4d-9384-152f-351b-ebb217411da9@amd.com>
 <20230712110253.paoyrmcbvlhpfxbf@pengutronix.de>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="qdsglwcywcjoch6m"
Content-Disposition: inline
In-Reply-To: <20230712110253.paoyrmcbvlhpfxbf@pengutronix.de>


--qdsglwcywcjoch6m
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 12, 2023 at 01:02:53PM +0200, Uwe Kleine-K=F6nig wrote:
> > Background is that this makes merge conflicts easier to handle and dete=
ct.
>=20
> Really?

FWIW, I agree with Christian here.

> Each file (apart from include/drm/drm_crtc.h) is only touched once. So
> unless I'm missing something you don't get less or easier conflicts by
> doing it all in a single patch. But you gain the freedom to drop a
> patch for one driver without having to drop the rest with it.

Not really, because the last patch removed the union anyway. So you have
to revert both the last patch, plus that driver one. And then you need
to add a TODO to remove that union eventually.

> So I still like the split version better, but I'm open to a more
> verbose reasoning from your side.

You're doing only one thing here, really: you change the name of a
structure field. If it was shared between multiple maintainers, then
sure, splitting that up is easier for everyone, but this will go through
drm-misc, so I can't see the benefit it brings.

Maxime

--qdsglwcywcjoch6m
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZK6iFgAKCRDj7w1vZxhR
xRLYAP93B76KgEWcuaOZ/kYDv8XjPHyPciX51vnTJB/XyRmulQD/cDTXF3s/NDy9
IAy9XkaOSqt5P/YkwqvexkelvA3a6wU=
=y7ve
-----END PGP SIGNATURE-----

--qdsglwcywcjoch6m--


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 13:01:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 13:01:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562491.879187 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZT9-0001Np-NA; Wed, 12 Jul 2023 13:01:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562491.879187; Wed, 12 Jul 2023 13:01:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZT9-0001Ni-Ir; Wed, 12 Jul 2023 13:01:23 +0000
Received: by outflank-mailman (input) for mailman id 562491;
 Wed, 12 Jul 2023 13:01:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJZT8-0001Nc-0Z
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 13:01:22 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20611.outbound.protection.outlook.com
 [2a01:111:f400:7d00::611])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 31b3ff3b-20b4-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 15:01:19 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS8PR04MB8181.eurprd04.prod.outlook.com (2603:10a6:20b:3f5::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 13:01:17 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 13:01:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 31b3ff3b-20b4-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=RQn5bXSOM5xU7XNIFQ9XdMsEvkEL+kT/ye7DY58Szuy/FzohH4avT+iXX9nQYlYio8valJBHZa9TDjI8g+3PUQeSrvIZ5Wpv8QcLA3nqiXxhbcWG6u72Bq9o2FerPD+ZnJ6WF6AGIq/Kykn9OF+R1cEOS4nqm4urr5rmOeFMCNE6v3fpzGKmCXQm5MbNLCkQm/5FdDxN8WlxIT8lrCGOg9tSuaJJM4mM7yRVVHcXgga3lI/Bi97Lx16wiG8MMuD4kM2RzOtN/2YGL7ElFBxzLnGLG9sl0qgPlpuSZPvLNJxS7XzJWHDsd7mP/u3ZAHZzJT4b2nHSb5CkDBVDE/W1mQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=RwV3K5ru0fS/EaEyw2Eum6+kPBb6VamB7EOPgvTjmok=;
 b=fnWYB/IUjlbPyeOfl15Efss2Bwf7cnn93DJz8pZMsX5zq8RQWKKXHYwtn5kub5W7rWownrkGegU+JDd8JSGCttwNo8IBXqf/oythsaIvMxbUeB7x+MHumuuWvho3Zic6UmTTpS/wENI7i0FWZel8lGj59aqbyRqT+glMSv6CBVCOdZPQ0soJ0D88bu4S30ui+3OOruYJzj6lu/2xy6MS/ztNfpO86KzQktxVLR6l8K7Na/+qe7RBOfVV9+rnEYksoF3iHwUqg5LwNpL17ihSVc7at0M/8UeLMxQcqxewlkz62H5wly1usz5gnCSv2XSDs19cnKOkiRlXFlIQb0S7Og==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RwV3K5ru0fS/EaEyw2Eum6+kPBb6VamB7EOPgvTjmok=;
 b=CYrZtGe8QLCuucNA0nxdjjhcD2p+p74gXxnOd5Xi/o/bmnO/LRx91c0irYE99XlAQE3TsEUoVqL0laLNIwXe52t7arBfGmFVB0oTrbiiBm+Xrwvfju1w+g3G467RU0nbh/sP8kLn5G12Bk6qL/IfSTfUdpElfJr9d5Z88inJ+vo31idxmoINQBQY4HOivoyaVp5ao+39CcHXHE58X2Oe5xqIkxRBBijW3SkOprvRzOze2uUVXOK26+Oed2E7dH/ff2Y2gXViFXsH3syrXChoyutCrUhQDI5dgkm5rW1SHAg9QC42seWnkcSGblzCzxwfQ9gY88mQJu/zG62vAJqr1w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <c08e5663-3337-849c-6398-42d220f43463@suse.com>
Date: Wed, 12 Jul 2023 15:01:15 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 1/3] x86: allow Kconfig control over psABI level
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com>
 <6f462a2f-2e91-6397-a527-18eeade19476@suse.com>
In-Reply-To: <6f462a2f-2e91-6397-a527-18eeade19476@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0102.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9c::16) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS8PR04MB8181:EE_
X-MS-Office365-Filtering-Correlation-Id: afe55e66-42f8-49b9-bf92-08db82d8148a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	GOl6GrtEhgxkEsXGnF3jWEj1+E7RD99MLSuwfafNBeMFwZWMR6Xj14Ki8nb7QO4uuWf0XOFpZEbP/EJ4yYStyVV1Q8Htzlutr7IPjIbK31jHboKQ/Y1Yw9ixmdb485g0tr+uyukuXGat2Z2aB7dBqNy8McD/nSUW13KURp2Uy8aPCtwJrd0MSyP/0lKR3+Iujq7imhbAyNJy8cOGLFnHdG1/QMOJjq/k47T1P/VB/faLIMnClndC6FxGUAZf1voUWwD5fDGManICxyoHZPJhQ+e8MtRF6lxbyPBo0BVYUHUGetyGdS55fcTLxpLU088fQyIs/OynehBZbCNaxNlqYyuCG7XJcpzbn//BJ3+B/xShg2Xx6hW1VZ+pQTLa4MIEYJB6iR4qytSFpr8ZhW64uiMKiyNJX9NkJ51gFd8Gx7f+pZxbPbo14QokdfxEvJyurcCNZRXZvbcEDkgl11BTmKveWzAoZbTVNzrt4b74ZUO1q3EyIoCIAhacuuO4hIKXX2DO87wn/Y73CN+N973BVSDPHGG7yi/zlFP1suhUi9k+9RaIt1EkFsJdtV6bNATEOo4pcXjg2tAM401KA76Nhh7ldsLr0HVoRDWDpepvuWLIqSzDmLLtGyYO/v9z1C0aMyxW8/q0l9+5+x8nSEgvsQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(136003)(366004)(396003)(39860400002)(376002)(451199021)(8936002)(8676002)(38100700002)(41300700001)(2616005)(2906002)(316002)(5660300002)(31686004)(4744005)(66476007)(4326008)(6916009)(66556008)(66946007)(6486002)(6512007)(478600001)(36756003)(54906003)(6506007)(31696002)(53546011)(186003)(26005)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dWhTMFZUYjgvMXJhYytKRUJYQTROYzk5LzVZKzBva2VvRHJxbTA4SXd3MWF4?=
 =?utf-8?B?N0VFdUQ3ZnNaYkJXWTEydEdFNDVTNFFINjJCUXplMGdCZE9Wc0gvTGtHQUxz?=
 =?utf-8?B?bUlRMnRuUG5YZ2xyS2RRcEVHTUVQNDcxeEpkRFBmZ2JrNEJEYkc5YzRzRTYz?=
 =?utf-8?B?WnE2ZnBubUVkUTBDZUJ6Yk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2RGRjWWVpdTMvb2RIOTN2ZkxGMW9RWGZBWElpNTFHaXlH?=
 =?utf-8?B?WkVSMGtmb2RGMnBVbXJia2FTMXVtUUtYOWR1U2VoaE1XNzl1Uld2c1lPYVR0?=
 =?utf-8?B?NmZvQ1RKaUF2TnVlZU43OVBqREVxOW9BeEQ0TFNOeXpoRzhkdWdadGdWZFVJ?=
 =?utf-8?Q?L2YNmzEDOB8tJmZTyDtHb+TrP?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: afe55e66-42f8-49b9-bf92-08db82d8148a
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 13:01:17.3131
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 12gyGML+LZiY4lXQLqtNona1Sqx2D6RoJlRCX8uphk1hwWogtiSiMQPH6pai0nKtB4a7r7cPYDYfrJXqnsEZzg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8181

On 12.07.2023 14:33, Jan Beulich wrote:
> --- a/xen/arch/x86/arch.mk
> +++ b/xen/arch/x86/arch.mk
> @@ -36,6 +36,10 @@ CFLAGS += -mno-red-zone -fpic
>  # the SSE setup for variadic function calls.
>  CFLAGS += -mno-mmx -mno-sse $(call cc-option,$(CC),-mskip-rax-setup)
>  
> +# Enable the selected baseline ABI, if supported by the compiler.
> +CFLAGS-$(CONFIG_X86_64_V2) += $(call cc-option,$(CC),-march=x86-64-v2)
> +CFLAGS-$(CONFIG_X86_64_V3) += $(call cc-option,$(CC),-march=x86-64-v3)

Hmm, I should have remembered that this won't work with older gcc,
because of how $(cc-option ...) works. I recall someone else already
fell into this trap a few years ago, but then they weren't following
up on the suggestions on how to make their somewhat fragile workaround
more robust. Now I'm on the hook ...

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 13:05:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 13:05:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562495.879196 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZWV-0001xr-4c; Wed, 12 Jul 2023 13:04:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562495.879196; Wed, 12 Jul 2023 13:04:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZWV-0001xk-1Z; Wed, 12 Jul 2023 13:04:51 +0000
Received: by outflank-mailman (input) for mailman id 562495;
 Wed, 12 Jul 2023 13:04:49 +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
 <SRS0=gKGC=C6=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1qJZWT-0001xO-BW
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 13:04:49 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on20627.outbound.protection.outlook.com
 [2a01:111:f400:fe59::627])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ac9a3f6e-20b4-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 15:04:46 +0200 (CEST)
Received: from MW4PR03CA0235.namprd03.prod.outlook.com (2603:10b6:303:b9::30)
 by BL3PR12MB6473.namprd12.prod.outlook.com (2603:10b6:208:3b9::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 13:04:43 +0000
Received: from CO1NAM11FT108.eop-nam11.prod.protection.outlook.com
 (2603:10b6:303:b9:cafe::a0) by MW4PR03CA0235.outlook.office365.com
 (2603:10b6:303:b9::30) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20 via Frontend
 Transport; Wed, 12 Jul 2023 13:04:43 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1NAM11FT108.mail.protection.outlook.com (10.13.175.226) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.20 via Frontend Transport; Wed, 12 Jul 2023 13:04:42 +0000
Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 12 Jul
 2023 08:04:39 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com
 (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 12 Jul
 2023 06:04:39 -0700
Received: from [10.71.193.39] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Wed, 12 Jul 2023 08:04:38 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ac9a3f6e-20b4-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=R14ZO9TxBNzGEE7k/Bbden8qknE55k2/BCifNKxos94ofR3cDRa4PIKRL2U8+HNJkey+IdkMe+c0tZtHZxIkDJgmS8XtENJ6mig7fdh7hj7Oawg7tfp1d3p+h8GEW9lTwYh/vkSPmcVDO2J4thdqw+jfVguOsg27vQLwP3zPhE15BtaX1O+UlLe1nfls/Jg42eZyIP/UHmGTTXlycooABqQkL785axWSKXW/AvBAq/SGjE4OMfq0qpKBZJU38GIeYUBqw/oSmxbBLY+I4Hs5j0UYs3Xvv4/KadlGi8nJ6HMf2z+au+Xm0Aq/Mddk5G3lVcyYZl9PYCxtTS82JzTn3g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ALYRmK7dezL+NL0wl6TMquTYMr5k607QGgE4XcfIm1E=;
 b=iM6Xb/EWMMBQm9D80sbvKWEc7jIwD9vq/a7ipXcLf3TDFp3Yt00QLK2BpKngKbro+qCocN8wqCk8FNvCIOuOC9CQ3A1P0d/NrjVRR49wn6a4E+bBxjdee9btbzBJThpiw53KXoHrokev0uH4mL7/SxVYewJhBtjgvoaz5wByF6oVR5Es/4BhZe5XalpEqJhvaB2YtHlxx2/NfqyV+QruP205HoMbb94WRJpmR1lp1zJ+ORRLIaB9TkTat7SkOXbpipIxOlWREUL0FXHv38tb/0yUsh7nJR3O0rnnYekqo32hy3j/DYCSSqGNjm3L+W8q9KI9iihScguwa3Fgd1Ogzw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=arm.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ALYRmK7dezL+NL0wl6TMquTYMr5k607QGgE4XcfIm1E=;
 b=3cSESfdVQCvOBqhxdvySy9n986L4c6j/oOIOTNgYvlAW9TjO3c6ImyxduI9cCxuknZqGCk/j3bRsvC80DuVjU/SW3uNdrYVPk0flb7Ed168dWV+a0ulX+7MCMiJs93feOdoMg39VKwJzvyUKtGOPVZI5XhYPmNwktBmH+K7NfMQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <c139abd7-bd27-f8cf-b561-5c795bb663a7@amd.com>
Date: Wed, 12 Jul 2023 15:04:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] docs: Fix style in misc/arm/silicon-errata.txt table
Content-Language: en-US
To: Luca Fancellu <luca.fancellu@arm.com>, <xen-devel@lists.xenproject.org>
CC: <bertrand.marquis@arm.com>, <wei.chen@arm.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
References: <20230712120440.1815240-1-luca.fancellu@arm.com>
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20230712120440.1815240-1-luca.fancellu@arm.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1NAM11FT108:EE_|BL3PR12MB6473:EE_
X-MS-Office365-Filtering-Correlation-Id: 22a24488-845b-417e-b30a-08db82d88f08
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	O1DKNGk9DGMV8Ya8Ymfq1w57Nh2WOBtxe23w4BDrIE86zEMKxRnuDvQVdJdqrlixECDv7qcTApaXpefCHde7R34q9DyhC4HsLQdZsL/wHIY1XOFTwenL+dsKQ8CAWNhIq5yuc7XXymBV3XAsjYukU4fo3Yf6A7wC6mKaAnmPPyC36Jqjb8AdERLymfbpGdx3TPVu/2sZWTtlxKQNRL1QpT1XkeHugkX/jso+5l/7RfSJKZxgrUERYHny7o2XgTuXnTED5DIDiHO/TPpan3NQSMquktaANdPDG51hq1idDKdqftl54xsSeEXbkPrMLZjH44NP6sDzbn1T8S2moMR+zcrNHOqRSFB1bptPvClnjR/xuWufDfwMv3h91rOX3n6aSnj2cCCS8wfhQOyq9b0RVY5PkhA+vlDcJ9EZkOOK1T9nJMIa/beFRjWftbJp5QlY4dZD219gM28H7HQ+7iAGtbS8X1JNNI6TeLyNrOEs0R85ICoO8f2pWpyAiLkaI/WRBigWFM9vcugwkPnhoh4HcSu2w7znIfJ14D6zEL68dOP6IoWbcwz8/CjNTsVWrl9+2uxWZGlnFN9F+dfsfymnNbF5hD/hhyjoAAMtRKkwSy4u5AbFX1IPCAQx+Dt8myqriCjNo3LpQYirjKCn60K9lgLu0xlmvssc392tFYUGTBRUVXtBf7OxdhIiYAlp8Joy3SQ8sbaEuXcnDk5V6ZSa+ERdgg9MkKCVQmfIG1TvdQp+39b6gSa5PjuiacIm3Sq+5uR5HvWuIpRPfBvUeNbwGw0uJtFsvcORkONcIFxxwF3MLNgiXtuiQPtP8SngUL4q
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(39860400002)(136003)(376002)(451199021)(40470700004)(36840700001)(46966006)(356005)(31696002)(86362001)(81166007)(82740400003)(83380400001)(54906003)(82310400005)(110136005)(31686004)(36860700001)(4744005)(2906002)(426003)(2616005)(36756003)(47076005)(4326008)(316002)(70206006)(70586007)(16576012)(8676002)(8936002)(40460700003)(53546011)(478600001)(336012)(186003)(26005)(41300700001)(5660300002)(44832011)(40480700001)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 13:04:42.5753
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 22a24488-845b-417e-b30a-08db82d88f08
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1NAM11FT108.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6473

Hi Luca,

On 12/07/2023 14:04, Luca Fancellu wrote:
> 
> 
> Fix the right border of the silicon-errata.txt table
> 
> Fixes: 1814a626fb58 ("xen/arm: Update silicon-errata.txt with the Neovers AT erratum")
Fixes tag is for bugs and this one is clearly not.
With that removed:
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 13:07:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 13:07:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562501.879206 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZZC-0002dC-LS; Wed, 12 Jul 2023 13:07:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562501.879206; Wed, 12 Jul 2023 13:07:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJZZC-0002d5-Ia; Wed, 12 Jul 2023 13:07:38 +0000
Received: by outflank-mailman (input) for mailman id 562501;
 Wed, 12 Jul 2023 13:07:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=V3yk=C6=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qJZZB-0002cx-2J
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 13:07:37 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0614.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::614])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 10fbce83-20b5-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 15:07:34 +0200 (CEST)
Received: from AS8PR04CA0088.eurprd04.prod.outlook.com (2603:10a6:20b:313::33)
 by DBAPR08MB5720.eurprd08.prod.outlook.com (2603:10a6:10:1a1::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 13:07:32 +0000
Received: from AM7EUR03FT052.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:313:cafe::7b) by AS8PR04CA0088.outlook.office365.com
 (2603:10a6:20b:313::33) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.22 via Frontend
 Transport; Wed, 12 Jul 2023 13:07:32 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT052.mail.protection.outlook.com (100.127.140.214) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.20 via Frontend Transport; Wed, 12 Jul 2023 13:07:31 +0000
Received: ("Tessian outbound f9124736ff4f:v145");
 Wed, 12 Jul 2023 13:07:31 +0000
Received: from b5bca23b3591.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 32EC7689-68E6-4C98-B521-9AF1EBB92D37.1; 
 Wed, 12 Jul 2023 13:07:25 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b5bca23b3591.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 12 Jul 2023 13:07:25 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by PAVPR08MB8917.eurprd08.prod.outlook.com (2603:10a6:102:329::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 13:07:21 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::eaec:5611:c427:57f7]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::eaec:5611:c427:57f7%4]) with mapi id 15.20.6565.028; Wed, 12 Jul 2023
 13:07:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 10fbce83-20b5-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=x7sxzEnJBUbFyZE9Gnvw00wk87w+WC+5rGx61zkBmuM=;
 b=dyeQJk6qePFvE3BIBZ0E9EBaPjM6zTJkpuzazmvVV8sXtaRUR8UBfOjaavyD1BDvoALU9n9A3L5oO3zZrbnewWSm14vO2czSWL84vr3EtBuFNzIXgfW6b4k0IKD/5/ehGRVtarcaQyn5Mw/S6oX4EkEBqIbizwjxJQFZ6+es4jw=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 279bde3e4e6c11ba
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=QH2W7rWtgM12E7MbkgabMhSFfkHQmVzCfRu09ba8sA4YE+IX6TyEt7bta1w8Yxp3wmw/zsvwlmZun3LjJj9b23cKv20m6XJloZrIAoL1YsArN3WUxG3YVNQKFw5KLOt1uni/mWZKwFtQP7BOSZFY4OsdkljI8L5CvU0fVk55eXHuD/dfnBFQmcPDVHehxjftpA8qIBz4vc5zESp9Fy4j2UHqtYa4op0TmxoItP0N8ytLRAMwVPecWUhV1UMwLIbkoR0OYu4syJPmZVFfU12k15QVWq+K7TLEhgawc8T1G/iHiNmxI1CPIFQ2Bz5ByuxjLD/j5XcRxTsJIc0FDoNKQw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=x7sxzEnJBUbFyZE9Gnvw00wk87w+WC+5rGx61zkBmuM=;
 b=E3Na+1iX8QGT147I8a38VuFdf0Hvt22hLkre62697yKydrN24xObOjkE+cE6nkXtIeIq+Z3FWtY3rp/uThvx/1s6OAj+79ItZ+roBSkHZjAL45kULXoeVJUPbkatQ9/T5HvLWDMvvlicYvHLzGjs2u1e+VrCcZYg2w9qDJg+B/Stzwr4V+lc5SYCkIQjG1gLOFWHWFF/MWR2ZCYYuHdGo2GXUnodCQfCjxOeNqP1WcuURqLwWZXojgQGGL1AlP049sw22qFalra9APq8HZDGbTefbqFkQVX9lvYjiM/5osJ8aKFD15Nonxrqi6bpUFJYu3vU5dh/troWmhYyHDLfQg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=x7sxzEnJBUbFyZE9Gnvw00wk87w+WC+5rGx61zkBmuM=;
 b=dyeQJk6qePFvE3BIBZ0E9EBaPjM6zTJkpuzazmvVV8sXtaRUR8UBfOjaavyD1BDvoALU9n9A3L5oO3zZrbnewWSm14vO2czSWL84vr3EtBuFNzIXgfW6b4k0IKD/5/ehGRVtarcaQyn5Mw/S6oX4EkEBqIbizwjxJQFZ6+es4jw=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Michal Orzel <michal.orzel@amd.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, Wei Chen <Wei.Chen@arm.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH] docs: Fix style in misc/arm/silicon-errata.txt table
Thread-Topic: [PATCH] docs: Fix style in misc/arm/silicon-errata.txt table
Thread-Index: AQHZtLkqrH81SiNKb0iqu22X4/KYPK+2GV+AgAAAuIA=
Date: Wed, 12 Jul 2023 13:07:21 +0000
Message-ID: <AFE6AA84-4ADE-4496-896A-8843575C962E@arm.com>
References: <20230712120440.1815240-1-luca.fancellu@arm.com>
 <c139abd7-bd27-f8cf-b561-5c795bb663a7@amd.com>
In-Reply-To: <c139abd7-bd27-f8cf-b561-5c795bb663a7@amd.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|PAVPR08MB8917:EE_|AM7EUR03FT052:EE_|DBAPR08MB5720:EE_
X-MS-Office365-Filtering-Correlation-Id: 9fe3b6ee-55ad-4917-29a2-08db82d8f3bb
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 +w+wdlZzSMZKX1oGV895T435b9aEX8r3Qgc6Uqjul2fp8To20wcf1dEa08DqwzVfM2AUA63xF8jf6pm/m5233cvAF/wM/WKLFGvFzut8N4DkwP43iIB+zHuovf2RwIknEIj+Vh/Os4RfjEd4jS+W710cMZSb3x0xZ1VJgCNJ0MKYNdGoJPB/4EgCg6KSEdQBwk+7gqDHrXJ0q7qVMdXtOTcMxuU+SJmB/gQ5iMt+JL8H2VuH8f9eIC8ZKuD9epSpEZAmDYuLWqbyDEKHUf3KBenkTvuJ+7iZ+IyzbXcSPQKkmkWxzxxzYrAP5TBnmfH9yIkvaCwk52il3RruNri1Tj89JoRy1jLZcJmNFMorp8h/JtmToBJ+zNWgGU9toR7KE9/WtCgECPQapz+0OgVSH+ouUMl8blvf9T0co0TKJh2bOHGiLYGglgXb1w138D7k7LTGO4DxF0FfD/7wPJrh5+K1kVY2VzKWoagZnE9BKy9pJJ0U6OljeUa+v3YWmikvSPQV66xRdRneLVaWc+i9k+gS7sfne9qU5cpBstTCKwoRMNPbnkhdQbzjnTxbdRPvHgjOyYkr8gGiRv+ICXT4ctX8MWI/3FmUN12519O0ABRlxoOCC59BDdy7b+GoN27gHQVAbGVPs4RIDlOR5e4eJA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(366004)(39860400002)(396003)(346002)(451199021)(6486002)(478600001)(91956017)(71200400001)(54906003)(83380400001)(2616005)(33656002)(36756003)(86362001)(38070700005)(4744005)(2906002)(76116006)(26005)(186003)(53546011)(6512007)(6506007)(38100700002)(122000001)(66476007)(66446008)(64756008)(6916009)(4326008)(66556008)(316002)(41300700001)(8936002)(8676002)(66946007)(5660300002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <FD971BCAA7C42244ABB99D107B877107@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB8917
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT052.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	48baa0bd-e709-4503-7b95-08db82d8edb6
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	qhbDvWtv9zPqnP212rV/1Nm5gKuTcbFwkQmOBypACZwNDF5q4cqlijF36yFoxXKGK+yd+L1xQnngq6XCC3+1DL2y290LbhvsELK7K1ZaUuY1n/WvrWu59u0GkIP6MuJW797JcBNtzr6EJzjAthO6h+bz4pmB/dKfv1dKp+UwaiZHRLGX/QEFw/59f/yj9AJ+yu+nrzo1+8M57CcqNFIy9LJY+1mRbpJbylrzjuqnySU+QiYiXI/8D+Fe2lE/VKOBYyfV8lJI9Nm9gqHNo4PWC1LuQmSzJIB7nnCndsB/sTjtofaw3iLcLrfZRylDf7CO3beCVoXmMAVeQUXzFz4tqeLfdmntZABSmmvncb5UAFMPBrcllJxX+H4/wfR5YdGQWxLB0mOCskBo3OJQgfImE/+N41YOsIIjLnWIYDDlXCQIZonH94Gpgw/WyQlkgKad0U56Df06fYCzX3siKQTRenGyfzh3vg9SBuPesxWNg427P2a8AknsMyKzt++Qwb6FWuUFxyxUldPhESn54XKgsmdETvpzo1831JU9Nd4TMtWX1ry1EpJdMdqBOLSLoJmI2ilpNOQSfG57TodwfYRBZGixfwHVILT/wsNZ3kAdwctlR2yo9ITkBi5JHI3g/dUC6YjkcjZETRquYshs1ReEgplrSyDux/RJNRMyU919+HqBLRbu9kK5gPAN2q73/7DlvTZrwpMdEkcr4BEnXM2uDwytm3csAapcprPPv6yHl92KhuQCGGyc7V+78MUJOu3A
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(346002)(396003)(376002)(451199021)(40470700004)(36840700001)(46966006)(4326008)(70586007)(70206006)(316002)(4744005)(41300700001)(2906002)(8676002)(6862004)(8936002)(5660300002)(478600001)(54906003)(36860700001)(6486002)(40460700003)(6512007)(107886003)(40480700001)(26005)(53546011)(186003)(36756003)(83380400001)(336012)(6506007)(33656002)(47076005)(81166007)(356005)(82740400003)(82310400005)(2616005)(86362001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 13:07:31.6108
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 9fe3b6ee-55ad-4917-29a2-08db82d8f3bb
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT052.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5720

DQoNCj4gT24gMTIgSnVsIDIwMjMsIGF0IDE0OjA0LCBNaWNoYWwgT3J6ZWwgPG1pY2hhbC5vcnpl
bEBhbWQuY29tPiB3cm90ZToNCj4gDQo+IEhpIEx1Y2EsDQo+IA0KPiBPbiAxMi8wNy8yMDIzIDE0
OjA0LCBMdWNhIEZhbmNlbGx1IHdyb3RlOg0KPj4gDQo+PiANCj4+IEZpeCB0aGUgcmlnaHQgYm9y
ZGVyIG9mIHRoZSBzaWxpY29uLWVycmF0YS50eHQgdGFibGUNCj4+IA0KPj4gRml4ZXM6IDE4MTRh
NjI2ZmI1OCAoInhlbi9hcm06IFVwZGF0ZSBzaWxpY29uLWVycmF0YS50eHQgd2l0aCB0aGUgTmVv
dmVycyBBVCBlcnJhdHVtIikNCj4gRml4ZXMgdGFnIGlzIGZvciBidWdzIGFuZCB0aGlzIG9uZSBp
cyBjbGVhcmx5IG5vdC4NCj4gV2l0aCB0aGF0IHJlbW92ZWQ6DQo+IFJldmlld2VkLWJ5OiBNaWNo
YWwgT3J6ZWwgPG1pY2hhbC5vcnplbEBhbWQuY29tPg0KDQpUaGFuayB5b3UsIHllYWggd2VsbCBJ
IGRpc2NvdmVyZWQgaXQgY2FuIGJlIHVzZWQgYWxzbyBvbiBiYWNrLXBvcnRzLCBzbyBJ4oCZdmUg
YWRkZWQgaXQsIGFueXdheQ0KSWYgbWFpbnRhaW5lciBhcmUgb2ssIGl0IGNhbiBiZSBhZGRyZXNz
ZWQgb24gY29tbWl0DQoNCj4gDQo+IH5NaWNoYWwNCj4gDQoNCg==


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 13:43:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 13:43:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562510.879216 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJa7q-0006uf-Fv; Wed, 12 Jul 2023 13:43:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562510.879216; Wed, 12 Jul 2023 13:43:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJa7q-0006uY-CW; Wed, 12 Jul 2023 13:43:26 +0000
Received: by outflank-mailman (input) for mailman id 562510;
 Wed, 12 Jul 2023 13:39:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ItXa=C6=ionos.com=haris.iqbal@srs-se1.protection.inumbo.net>)
 id 1qJa3v-00061c-5S
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 13:39:23 +0000
Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com
 [2a00:1450:4864:20::12e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 81d5a88e-20b9-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 15:39:21 +0200 (CEST)
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-4fb960b7c9dso11283283e87.0
 for <xen-devel@lists.xenproject.org>; Wed, 12 Jul 2023 06:39:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 81d5a88e-20b9-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=ionos.com; s=google; t=1689169161; x=1691761161;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=+evqX27DGBiWJkyZnqGeEHQI9QcDiX7JHwbrqFd6EpQ=;
        b=HvU/baPM6sZwTLnq/qfa5rJyKcj7shqfM6D7Yb+G9g3ZYKTi3s0EcBiC7f7tIEjtdm
         QA5axW7VPwPnkXZzytIsv3row1wqxHmeDpHZnctYAtNdrbiFmseznOuEbaqL8+1ZuCdx
         mHq0tH1oyBhuyYi3VnGKgi7s+kfN3fJslBaL8GJuknQcFsq3zqBycULjxCNTh0AQw7xm
         1wOmoQ5WDMp1n00gvCTlg6QVLQFj2LlfqH5fv/sX4+XD5tLQqI3TVk0j8HJlphtzaXvc
         STEw6QCxnVvzKbvtX6kVCmEnTLJyBGmZAtS0H4Rhh3ZkO7nx2ZhYYIcL3MQBWzCiQS8O
         xksA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689169161; x=1691761161;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=+evqX27DGBiWJkyZnqGeEHQI9QcDiX7JHwbrqFd6EpQ=;
        b=geS6+90I6KrXjQsN/Japau4OS8xyxKZ1piUsyRK83R1XK1R5vW4g3n6yXbdKIZ4F8E
         81QnHG5HXj1tvEz/k87la1v7d6hjH9GaQti6fYSxkn58Svda9cHRjCvOooFqqW9uyWXc
         17gduSwkCJh1gqHMHcgYDrFZ7RvkwiiYG2CTe4qpS3g0TA0Iun0gNTtQTDlLRUp4iCiJ
         ecFYrhvTxYUkIISLl73owz/xP08PtZF0gJFK/cAFfxu1qELLm2B4eYEYl+UNldEDcmZQ
         u7h05v2LnHQGortI4U/VNDFdtzviSaD3YEzPrPKmEvQIKYPDqV/0mgBnQfHyO/rjSzyH
         SfZw==
X-Gm-Message-State: ABy/qLYR/xcaLPgEUGbJxugaOhCVFxksiQp0517/j9YHjpGxW9WeuhaM
	n4sdiiU/PCx23kVs9pL0APElp1d55PSw911Ziu/pXA==
X-Google-Smtp-Source: APBJJlEI1gyVFA9e0vzN1OZw8HqZ9LgUDYjdSVkcc/YNKBWyCbO3ruOl1C16YRvIxaIjAxVOOIhj+dxwF3VF9wwHpIo=
X-Received: by 2002:a05:6512:34cd:b0:4fb:82ac:9d23 with SMTP id
 w13-20020a05651234cd00b004fb82ac9d23mr13814794lfr.36.1689169161029; Wed, 12
 Jul 2023 06:39:21 -0700 (PDT)
MIME-Version: 1.0
References: <20230629165206.383-1-jack@suse.cz> <20230704122224.16257-1-jack@suse.cz>
 <ZKbgAG5OoHVyUKOG@infradead.org>
In-Reply-To: <ZKbgAG5OoHVyUKOG@infradead.org>
From: Haris Iqbal <haris.iqbal@ionos.com>
Date: Wed, 12 Jul 2023 15:39:09 +0200
Message-ID: <CAJpMwyhKW23zEfMcsGrBG6Bq0Md40vZ4qj-PgDkR6KWPv8+7PQ@mail.gmail.com>
Subject: Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions
To: Christoph Hellwig <hch@infradead.org>
Cc: Jan Kara <jack@suse.cz>, linux-block@vger.kernel.org, 
	linux-fsdevel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>, 
	Alasdair Kergon <agk@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, 
	Anna Schumaker <anna@kernel.org>, Chao Yu <chao@kernel.org>, 
	Christian Borntraeger <borntraeger@linux.ibm.com>, "Darrick J. Wong" <djwong@kernel.org>, 
	Dave Kleikamp <shaggy@kernel.org>, David Sterba <dsterba@suse.com>, dm-devel@redhat.com, 
	drbd-dev@lists.linbit.com, Gao Xiang <xiang@kernel.org>, 
	Jack Wang <jinpu.wang@ionos.com>, Jaegeuk Kim <jaegeuk@kernel.org>, 
	jfs-discussion@lists.sourceforge.net, Joern Engel <joern@lazybastard.org>, 
	Joseph Qi <joseph.qi@linux.alibaba.com>, Kent Overstreet <kent.overstreet@gmail.com>, 
	linux-bcache@vger.kernel.org, linux-btrfs@vger.kernel.org, 
	linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, 
	linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org, 
	linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org, 
	linux-nilfs@vger.kernel.org, linux-nvme@lists.infradead.org, 
	linux-pm@vger.kernel.org, linux-raid@vger.kernel.org, 
	linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, 
	linux-xfs@vger.kernel.org, Mike Snitzer <snitzer@kernel.org>, 
	Minchan Kim <minchan@kernel.org>, ocfs2-devel@oss.oracle.com, 
	reiserfs-devel@vger.kernel.org, Sergey Senozhatsky <senozhatsky@chromium.org>, 
	Song Liu <song@kernel.org>, Sven Schnelle <svens@linux.ibm.com>, target-devel@vger.kernel.org, 
	Ted Tso <tytso@mit.edu>, Trond Myklebust <trond.myklebust@hammerspace.com>, 
	xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000cf1dc906004a5728"

--000000000000cf1dc906004a5728
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 6, 2023 at 5:38=E2=80=AFPM Christoph Hellwig <hch@infradead.org=
> wrote:

> On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote:
> > Create struct bdev_handle that contains all parameters that need to be
> > passed to blkdev_put() and provide blkdev_get_handle_* functions that
> > return this structure instead of plain bdev pointer. This will
> > eventually allow us to pass one more argument to blkdev_put() without
> > too much hassle.
>
> Can we use the opportunity to come up with better names?  blkdev_get_*
> was always a rather horrible naming convention for something that
> ends up calling into ->open.
>
> What about:
>
> struct bdev_handle *bdev_open_by_dev(dev_t dev, blk_mode_t mode, void
> *holder,
>                 const struct blk_holder_ops *hops);
> struct bdev_handle *bdev_open_by_path(dev_t dev, blk_mode_t mode,
>                 void *holder, const struct blk_holder_ops *hops);
> void bdev_release(struct bdev_handle *handle);
>

+1 to this.
Also, if we are removing "handle" from the function, should the name of the
structure it returns also change? Would something like bdev_ctx be better?


>
> ?
>

--000000000000cf1dc906004a5728
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jul 6, 2023 at 5:38=E2=80=AFP=
M Christoph Hellwig &lt;<a href=3D"mailto:hch@infradead.org">hch@infradead.=
org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"marg=
in:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1e=
x">On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote:<br>
&gt; Create struct bdev_handle that contains all parameters that need to be=
<br>
&gt; passed to blkdev_put() and provide blkdev_get_handle_* functions that<=
br>
&gt; return this structure instead of plain bdev pointer. This will<br>
&gt; eventually allow us to pass one more argument to blkdev_put() without<=
br>
&gt; too much hassle.<br>
<br>
Can we use the opportunity to come up with better names?=C2=A0 blkdev_get_*=
<br>
was always a rather horrible naming convention for something that<br>
ends up calling into -&gt;open.<br>
<br>
What about:<br>
<br>
struct bdev_handle *bdev_open_by_dev(dev_t dev, blk_mode_t mode, void *hold=
er,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 const struct blk_ho=
lder_ops *hops);<br>
struct bdev_handle *bdev_open_by_path(dev_t dev, blk_mode_t mode,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 void *holder, const=
 struct blk_holder_ops *hops);<br>
void bdev_release(struct bdev_handle *handle);<br></blockquote><div><br></d=
iv><div>+1 to this.</div><div>Also, if we are removing &quot;handle&quot; f=
rom the function, should the name of the structure it returns also change? =
Would something like bdev_ctx be better?<br></div><div>=C2=A0</div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px=
 solid rgb(204,204,204);padding-left:1ex">
<br>
?<br>
</blockquote></div></div>

--000000000000cf1dc906004a5728--


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 13:43:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 13:43:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562512.879221 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJa7q-0006y2-Oz; Wed, 12 Jul 2023 13:43:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562512.879221; Wed, 12 Jul 2023 13:43:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJa7q-0006xJ-Jr; Wed, 12 Jul 2023 13:43:26 +0000
Received: by outflank-mailman (input) for mailman id 562512;
 Wed, 12 Jul 2023 13:40:27 +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
 <SRS0=MfTd=C6=pengutronix.de=ukl@srs-se1.protection.inumbo.net>)
 id 1qJa4x-0006si-BE
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 13:40:27 +0000
Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de
 [2001:67c:670:201:290:27ff:fe1d:cc33])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a71556b8-20b9-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 15:40:25 +0200 (CEST)
Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2])
 by metis.ext.pengutronix.de with esmtps
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJa31-0003SA-EH; Wed, 12 Jul 2023 15:38:27 +0200
Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de)
 by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJa2f-00DtzU-Hf; Wed, 12 Jul 2023 15:38:05 +0200
Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJa2e-004JeB-NH; Wed, 12 Jul 2023 15:38:04 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a71556b8-20b9-11ee-8611-37d641c3527e
Date: Wed, 12 Jul 2023 15:38:03 +0200
From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
To: Maxime Ripard <mripard@kernel.org>
Cc: Heiko =?utf-8?Q?St=C3=BCbner?= <heiko@sntech.de>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
	Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
	dri-devel@lists.freedesktop.org,
	Vandita Kulkarni <vandita.kulkarni@intel.com>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Arun R Murthy <arun.r.murthy@intel.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Liu Shixin <liushixin2@huawei.com>,
	linux-samsung-soc@vger.kernel.org,
	Samuel Holland <samuel@sholland.org>,
	Matt Roper <matthew.d.roper@intel.com>,
	Wenjing Liu <wenjing.liu@amd.com>,
	Javier Martinez Canillas <javierm@redhat.com>,
	Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
	Danilo Krummrich <dakr@redhat.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	spice-devel@lists.freedesktop.org,
	Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
	linux-sunxi@lists.linux.dev, Stylon Wang <stylon.wang@amd.com>,
	Tim Huang <Tim.Huang@amd.com>,
	Suraj Kandpal <suraj.kandpal@intel.com>,
	=?utf-8?B?QW5kcsOp?= Almeida <andrealmeid@igalia.com>,
	Andi Shyti <andi.shyti@linux.intel.com>,
	Yifan Zhang <yifan1.zhang@amd.com>,
	Jani Nikula <jani.nikula@intel.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	Inki Dae <inki.dae@samsung.com>, Hersen Wu <hersenxs.wu@amd.com>,
	Jessica Zhang <quic_jesszhan@quicinc.com>,
	Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
	Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
	=?utf-8?Q?=C5=81ukasz?= Bartosik <lb@semihalf.com>,
	Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
	Andrew Jeffery <andrew@aj.id.au>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Noralf =?utf-8?Q?Tr=C3=B8nnes?= <noralf@tronnes.org>,
	kernel@pengutronix.de, Alex Deucher <alexander.deucher@amd.com>,
	freedreno@lists.freedesktop.org,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	Zack Rusin <zackr@vmware.com>, Gerd Hoffmann <kraxel@redhat.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org,
	Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
	=?utf-8?B?Sm9zw6k=?= Roberto de Souza <jose.souza@intel.com>,
	virtualization@lists.linux-foundation.org,
	Thierry Reding <thierry.reding@gmail.com>,
	Yongqin Liu <yongqin.liu@linaro.org>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Fei Yang <fei.yang@intel.com>,
	Ville =?utf-8?B?U3lyasOkbMOk?= <ville.syrjala@linux.intel.com>,
	David Lechner <david@lechnology.com>,
	Julia Lawall <Julia.Lawall@inria.fr>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
	David Francis <David.Francis@amd.com>,
	Aaron Liu <aaron.liu@amd.com>,
	Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
	Vinod Polimera <quic_vpolimer@quicinc.com>,
	linux-rockchip@lists.infradead.org, Fangzhi Zuo <jerry.zuo@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
	Ben Skeggs <bskeggs@redhat.com>,
	Jouni =?utf-8?B?SMO2Z2FuZGVy?= <jouni.hogander@intel.com>,
	Dave Airlie <airlied@redhat.com>, linux-mips@vger.kernel.org,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Gurchetan Singh <gurchetansingh@chromium.org>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-arm-msm@vger.kernel.org,
	Animesh Manna <animesh.manna@intel.com>,
	linux-renesas-soc@vger.kernel.org,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	linux-amlogic@lists.infradead.org, Evan Quan <evan.quan@amd.com>,
	Michal Simek <michal.simek@amd.com>,
	linux-arm-kernel@lists.infradead.org, Sean Paul <sean@poorly.run>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Qingqing Zhuo <qingqing.zhuo@amd.com>,
	Sandy Huang <hjc@rock-chips.com>,
	Swati Sharma <swati2.sharma@intel.com>,
	John Stultz <jstultz@google.com>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Drew Davenport <ddavenport@chromium.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>,
	Haneen Mohammed <hamohammed.sa@gmail.com>,
	Anusha Srivatsa <anusha.srivatsa@intel.com>,
	Dan Carpenter <error27@gmail.com>,
	Karol Herbst <kherbst@redhat.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	linux-hyperv@vger.kernel.org, Stefan Agner <stefan@agner.ch>,
	Melissa Wen <melissa.srw@gmail.com>,
	=?utf-8?B?TWHDrXJh?= Canal <mairacanal@riseup.net>,
	Luca Coelho <luciano.coelho@intel.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Likun Gao <Likun.Gao@amd.com>, Sam Ravnborg <sam@ravnborg.org>,
	Alain Volmat <alain.volmat@foss.st.com>,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Deepak Rawat <drawat.floss@gmail.com>, Chen-Yu Tsai <wens@csie.org>,
	Joel Stanley <joel@jms.id.au>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
	Harry Wentland <harry.wentland@amd.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Alan Liu <haoping.liu@amd.com>, Philip Yang <Philip.Yang@amd.com>,
	Lyude Paul <lyude@redhat.com>, intel-gfx@lists.freedesktop.org,
	Alison Wang <alison.wang@nxp.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Gustavo Sousa <gustavo.sousa@intel.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Mikko Perttunen <mperttunen@nvidia.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
	Tomi Valkeinen <tomba@kernel.org>, Deepak R Varma <drv@mailo.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>, Chia-I Wu <olvaffe@gmail.com>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Tian Tao <tiantao6@hisilicon.com>, Shawn Guo <shawnguo@kernel.org>,
	Christian =?utf-8?B?S8O2bmln?= <christian.koenig@amd.com>,
	Khaled Almahallawy <khaled.almahallawy@intel.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	Emma Anholt <emma@anholt.net>,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Imre Deak <imre.deak@intel.com>, Liviu Dudau <liviu.dudau@arm.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Roman Li <roman.li@amd.com>, Paul Cercueil <paul@crapouillou.net>,
	Rob Clark <robdclark@gmail.com>,
	Hamza Mahfooz <hamza.mahfooz@amd.com>,
	David Airlie <airlied@gmail.com>, Marek Vasut <marex@denx.de>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	xen-devel@lists.xenproject.org, Guchun Chen <guchun.chen@amd.com>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
	Russell King <linux@armlinux.org.uk>, Leo Li <sunpeng.li@amd.com>,
	Uma Shankar <uma.shankar@intel.com>,
	Mika Kahola <mika.kahola@intel.com>,
	Jiasheng Jiang <jiasheng@iscas.ac.cn>,
	Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Vinod Govindapillai <vinod.govindapillai@intel.com>,
	linux-tegra@vger.kernel.org,
	Marek =?utf-8?B?T2zFocOhaw==?= <marek.olsak@amd.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	=?utf-8?Q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= <samsagax@gmail.com>,
	Melissa Wen <mwen@igalia.com>, Hans de Goede <hdegoede@redhat.com>,
	linux-mediatek@lists.infradead.org,
	Fabio Estevam <festevam@gmail.com>,
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	David Tadokoro <davidbtadokoro@usp.br>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
	Orson Zhai <orsonzhai@gmail.com>, amd-gfx@lists.freedesktop.org,
	Jyri Sarha <jyri.sarha@iki.fi>,
	Yannick Fertre <yannick.fertre@foss.st.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Philippe Cornu <philippe.cornu@foss.st.com>,
	Daniel Vetter <daniel@ffwll.ch>, Wayne Lin <Wayne.Lin@amd.com>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Nirmoy Das <nirmoy.das@intel.com>, Lang Yu <Lang.Yu@amd.com>,
	Lucas Stach <l.stach@pengutronix.de>
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
Message-ID: <20230712133803.rf26cbg5wz7wsmgl@pengutronix.de>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <94eb6e4d-9384-152f-351b-ebb217411da9@amd.com>
 <20230712110253.paoyrmcbvlhpfxbf@pengutronix.de>
 <o3dc4q27ap6rajsvpfwfvs3z3afekkwbhnclvswkaietciy2kc@unjf67gz5tur>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="aip3kulofrfujcj7"
Content-Disposition: inline
In-Reply-To: <o3dc4q27ap6rajsvpfwfvs3z3afekkwbhnclvswkaietciy2kc@unjf67gz5tur>
X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2
X-SA-Exim-Mail-From: ukl@pengutronix.de
X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false
X-PTX-Original-Recipient: xen-devel@lists.xenproject.org


--aip3kulofrfujcj7
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello Maxime,

On Wed, Jul 12, 2023 at 02:52:38PM +0200, Maxime Ripard wrote:
> On Wed, Jul 12, 2023 at 01:02:53PM +0200, Uwe Kleine-K=F6nig wrote:
> > > Background is that this makes merge conflicts easier to handle and de=
tect.
> >=20
> > Really?
>=20
> FWIW, I agree with Christian here.
>=20
> > Each file (apart from include/drm/drm_crtc.h) is only touched once. So
> > unless I'm missing something you don't get less or easier conflicts by
> > doing it all in a single patch. But you gain the freedom to drop a
> > patch for one driver without having to drop the rest with it.
>=20
> Not really, because the last patch removed the union anyway. So you have
> to revert both the last patch, plus that driver one. And then you need
> to add a TODO to remove that union eventually.

Yes, with a single patch you have only one revert (but 194 files changed,
1264 insertions(+), 1296 deletions(-)) instead of two (one of them: 1
file changed, 9 insertions(+), 1 deletion(-); the other maybe a bit
bigger). (And maybe you get away with just reverting the last patch.)

With a single patch the TODO after a revert is "redo it all again (and
prepare for a different set of conflicts)" while with the split series
it's only "fix that one driver that was forgotten/borked" + reapply that
10 line patch. As the one who gets that TODO, I prefer the latter.

So in sum: If your metric is "small count of reverted commits", you're
right. If however your metric is: Better get 95% of this series' change
in than maybe 0%, the split series is the way to do it.

With me having spend ~3h on this series' changes, it's maybe
understandable that I did it the way I did.

FTR: This series was created on top of v6.5-rc1. If you apply it to
drm-misc-next you get a (trivial) conflict in patch #2. If I consider to
be the responsible maintainer who applies this series, I like being able
to just do git am --skip then.=20

FTR#2: In drm-misc-next is a new driver
(drivers/gpu/drm/loongson/lsdc_crtc.c) so skipping the last patch for
now might indeed be a good idea.

> > So I still like the split version better, but I'm open to a more
> > verbose reasoning from your side.
>=20
> You're doing only one thing here, really: you change the name of a
> structure field. If it was shared between multiple maintainers, then
> sure, splitting that up is easier for everyone, but this will go through
> drm-misc, so I can't see the benefit it brings.

I see your argument, but I think mine weights more.

Best regards
Uwe

--=20
Pengutronix e.K.                           | Uwe Kleine-K=F6nig            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

--aip3kulofrfujcj7
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmSurLsACgkQj4D7WH0S
/k4sEwf/UuiwqpRpFkDoh5EhwtXKdh8XLT/EutMDLIG+CdmIF7NPxvR+ZXgiD5e9
BaYtiZNivy0cfbUas4l0w7WekMbHw5MsVttULAGgUP4sLLJ8c2njon3k5JWJA8z4
W3AKDPJ/uwAYPmFY0mElfTsvDoy/x4EdJqeF7fbHlwdk5NHXWh/7Csw6b4jJBLC2
ucmM2LxhSR6awQqbXnd/MXgkIap0fsy40En7wKq6B/B3pECguPZg8cChiztq8mVa
/8DEhoDQWgJ2YzBcMhE+nW+4G/hc51psOIylkBMhZFrvmXZMwMFv+g7UDIJ4jp/N
4A1ksamP+GbxqozqipxuHSgGp3+6dQ==
=UcVQ
-----END PGP SIGNATURE-----

--aip3kulofrfujcj7--


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 13:52:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 13:52:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562526.879235 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJaGl-0000cN-OR; Wed, 12 Jul 2023 13:52:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562526.879235; Wed, 12 Jul 2023 13:52:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJaGl-0000cG-Ln; Wed, 12 Jul 2023 13:52:39 +0000
Received: by outflank-mailman (input) for mailman id 562526;
 Wed, 12 Jul 2023 13:52:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YmCp=C6=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1qJaGj-0000c8-Ng
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 13:52:37 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on20620.outbound.protection.outlook.com
 [2a01:111:f400:7eab::620])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5a7619a3-20bb-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 15:52:35 +0200 (CEST)
Received: from DS7PR03CA0108.namprd03.prod.outlook.com (2603:10b6:5:3b7::23)
 by DM3PR12MB9288.namprd12.prod.outlook.com (2603:10b6:0:4a::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Wed, 12 Jul
 2023 13:52:31 +0000
Received: from DM6NAM11FT075.eop-nam11.prod.protection.outlook.com
 (2603:10b6:5:3b7:cafe::6f) by DS7PR03CA0108.outlook.office365.com
 (2603:10b6:5:3b7::23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.22 via Frontend
 Transport; Wed, 12 Jul 2023 13:52:30 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 DM6NAM11FT075.mail.protection.outlook.com (10.13.173.42) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.22 via Frontend Transport; Wed, 12 Jul 2023 13:52:30 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 12 Jul
 2023 08:52:29 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 12 Jul
 2023 08:52:29 -0500
Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Wed, 12 Jul 2023 08:52:27 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5a7619a3-20bb-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=lnXw4M11PL8zadG8PaiPgh4k09kVjzgt+3UUF/CmMVpPkuLUQy1OJ9UfJAzC+K3atqx7JxjH5txa4BwmMW6t+41OVuO1OPK0QDkVX0zGqveBnCOSvh/HhVq91qZ0NqQmfTU5kvUI6uXcpOZjOu919TbPrWlmz1cL9HCyPN2/uwxuMllZ7AOmgJCCDca6d/cpuvjZhIJf8sEktiipFNfJqBsEkvH+T+4YOXEXshsBGxyyreihmR12qsyO3J+3otSHA0wXeWC08Qvok577q4unEClhNAWD6VzZKKgfJIwNhl/lX0nx8NuH/9v220bKsrmIqhzQlaiAnfoxNn+xL/4JLg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Qq36jgKCRrcIt4jf2b+WTJ8T8S9NB90WpaGx93hStms=;
 b=Wyb7wNscKOgaeMfpi/yJsTIDur8M1tWOvTKvnh3u+RzcnBy5iunXVAON2lPQkZ3/mqyBs+H7ek7saVXSxgBu0vHFemp9rUFBM6H41vwFHqXkJgxm/xoB6DU+Zy2ihh9EhIk02+hERuydDMZcZTax5CzCmW3f/E9dFzOVOsF8ZenHKYKF7DtGzMcTSJq6wjEDkeoHpv0+2MT1dFjJi4FfAs9DWEu59uEqBNn9gphnX9bj1jxH5ZZ0No1TIXBBt9G1jubGgZRfq5pUAgvrO6ep//9nYRo/zhXYe52xw2V3DkqWwu7sS+pGn3kqmV8/XknYX1kdeybn1xh2ITrWzF7+kw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Qq36jgKCRrcIt4jf2b+WTJ8T8S9NB90WpaGx93hStms=;
 b=X3PWyxCgNodNpxMFFVOXrgyDGJI5gD13sxreH+VQuRrKxLq4y5FAnnbV3z35N5tqRKhy0TW8edxaeEEeud+sYxkBigA4Uloha8Y1P27T7FIh6eXuBmHDhS9OzfLzlH72uSKJjhPRrCmlF4CIc7zDIPZhLa1Jv2V+kqR8YkSJhwI=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Stewart Hildebrand <stewart.hildebrand@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Rahul Singh <rahul.singh@arm.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>
Subject: [PATCH v3] xen/arm: pci: fix check in pci_check_bar()
Date: Wed, 12 Jul 2023 09:52:21 -0400
Message-ID: <20230712135226.747472-1-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DM6NAM11FT075:EE_|DM3PR12MB9288:EE_
X-MS-Office365-Filtering-Correlation-Id: f1aea321-8392-459e-28d9-08db82df3c59
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	JpNQohC8DzYwVsCqLd4o/KuuTLOqa3WzLAfDelsws91pcBPdJBYxqYIC4AUPbnI8NFvOWN1hyiZYOCyMv3CWadTuuwzbQgPXlybZZTzTfUeH0pWUI09F+TYeNItc/xBHq2T1JKcZuNP8HYRTghf/T2wwGRW89X7k41Tb7pnzV6hpK9woh6DbmINUxcDBYfVjtQclaGvH1iMJdFZ62RygUmMAGRAKbO8yRUdiuEEjz7q4BR89T2sIkHOzfV2zHeFvrHImraFG4l+FjL3/Hfo2dTdk+o9uSnBRrgg9VAHeUvoadSw/PDMwqH3Gc1mTXHUoJjmRvjlJGOGyI0Tj1GlG4msj3lzKiI8VuaeYn0Ub3mZbqUlbEBlKB+sVM6m2A7hVP3NL5L5xA6lNxu8+XvFIYBAyQ6fz/rDT8SroFjB1dusgO2+0cl0wGor/Hagsrfb/SVORap5J0DygAX4acOi5nEg5lRYEnqc8KjfmcSxvsdcA7s7fIDJ6O6JDqGOCMUdh6VZ48K61WbhJ+RcoEbUMv8XTq2P1dD/FO5eUzMssTTbFjDl59/gjJGfms7ItYKeVLPppLnMGYxQ5Y3T4qk6684/A70fLmK5AdULaTU+6ZOd0yYIxAUGtGG4j/z0tzscWoQAzXFLUt9OEnC1+dZwDm9YWuGNu634iaTLTdnu67qog0caQsI4b8A4Nv9Wh7gbOxVhgaxGCROIXy2YvBwg7/Y6iaKiEG8PuPWGlZxzDXi7yhuiAO30limox7TteONjVMx/nhhI5J2Y/p5ofiD9ljA==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(376002)(39860400002)(396003)(451199021)(40470700004)(46966006)(36840700001)(82740400003)(356005)(81166007)(83380400001)(186003)(2616005)(1076003)(426003)(336012)(26005)(40480700001)(47076005)(36860700001)(44832011)(2906002)(5660300002)(36756003)(478600001)(6666004)(316002)(54906003)(8676002)(6916009)(86362001)(70206006)(8936002)(70586007)(4326008)(41300700001)(40460700003)(82310400005)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 13:52:30.4069
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: f1aea321-8392-459e-28d9-08db82df3c59
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DM6NAM11FT075.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9288

When mapping BARs for vPCI, it's valid for a BAR mfn_t start to equal the BAR
mfn_t end (i.e. start == end) since end is inclusive. However, pci_check_bar()
currently returns false in this case, which results in Xen not mapping the BAR
in the guest 2nd stage page tables. In this example boot log, Linux has mapped
the BARs in the 1st stage, but since Xen did not map them in the 2nd stage,
Linux encounters a data abort and panics:

[    2.593300] pci 0000:00:00.0: BAR 0: assigned [mem 0x50008000-0x50008fff]
[    2.593682] pci 0000:00:00.0: BAR 2: assigned [mem 0x50009000-0x50009fff]
[    2.594066] pci 0000:00:00.0: BAR 4: assigned [mem 0x5000a000-0x5000afff]
...
[    2.810502] virtio-pci 0000:00:00.0: enabling device (0000 -> 0002)
(XEN) 0000:00:00.0: not mapping BAR [50008, 50008] invalid position
(XEN) 0000:00:00.0: not mapping BAR [50009, 50009] invalid position
(XEN) 0000:00:00.0: not mapping BAR [5000a, 5000a] invalid position
[    2.817502] virtio-pci 0000:00:00.0: virtio_pci: leaving for legacy driver
[    2.817853] virtio-pci 0000:00:00.0: enabling bus mastering
(XEN) arch/arm/traps.c:1992:d0v0 HSR=0x00000093010045 pc=0xffff8000089507d4 gva=0xffff80000c46d012 gpa=0x00000050008012
[    2.818397] Unable to handle kernel ttbr address size fault at virtual address ffff80000c46d012
...

Adjust the end physical address e to account for the full page when converting
from mfn, at which point s and e cannot be equal, so drop the equality check in
the condition.

Note that adjusting e to account for the full page also increases the accuracy
of the subsequent is_bar_valid check.

Fixes: cc80e2bab0d0 ("xen/pci: replace call to is_memory_hole to pci_check_bar")
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
Reviewed-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
v2->v3:
* re-word commit message slightly
* add Roger's R-b

v1->v2:
* adjust e to include full page (e is still inclusive)
* add comment at the top of the function to document that end is inclusive
---
 xen/arch/arm/pci/pci-host-common.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/pci/pci-host-common.c b/xen/arch/arm/pci/pci-host-common.c
index 7cdfc89e5211..c0faf0f43675 100644
--- a/xen/arch/arm/pci/pci-host-common.c
+++ b/xen/arch/arm/pci/pci-host-common.c
@@ -393,20 +393,24 @@ static int is_bar_valid(const struct dt_device_node *dev,
     return 0;
 }
 
-/* TODO: Revisit this function when ACPI PCI passthrough support is added. */
+/*
+ * The MFN range [start, end] is inclusive.
+ *
+ * TODO: Revisit this function when ACPI PCI passthrough support is added.
+ */
 bool pci_check_bar(const struct pci_dev *pdev, mfn_t start, mfn_t end)
 {
     int ret;
     const struct dt_device_node *dt_node;
     paddr_t s = mfn_to_maddr(start);
-    paddr_t e = mfn_to_maddr(end);
+    paddr_t e = mfn_to_maddr(mfn_add(end, 1)) - 1; /* inclusive */
     struct pdev_bar_check bar_data =  {
         .start = s,
         .end = e,
         .is_valid = false
     };
 
-    if ( s >= e )
+    if ( s > e )
         return false;
 
     dt_node = pci_find_host_bridge_node(pdev);

base-commit: 0a834e953b01ec25c412369d7a5b8b57d340ac60
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 13:54:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 13:54:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562532.879246 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJaIL-0001Ah-7q; Wed, 12 Jul 2023 13:54:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562532.879246; Wed, 12 Jul 2023 13:54:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJaIL-0001Aa-4E; Wed, 12 Jul 2023 13:54:17 +0000
Received: by outflank-mailman (input) for mailman id 562532;
 Wed, 12 Jul 2023 13:54:16 +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
 <SRS0=65J3=C6=citrix.com=prvs=55084c2ea=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qJaIJ-0001AU-Ro
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 13:54:16 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 94adb952-20bb-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 15:54:13 +0200 (CEST)
Received: from mail-mw2nam12lp2040.outbound.protection.outlook.com (HELO
 NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.40])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 12 Jul 2023 09:54:05 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by DM4PR03MB5999.namprd03.prod.outlook.com (2603:10b6:5:38a::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 13:54:00 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2%5]) with mapi id 15.20.6565.028; Wed, 12 Jul 2023
 13:54:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 94adb952-20bb-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689170053;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=vCdrEdqrufE4zBgy5pmd7cjq7Z6h7Nt5UN56pxCJ8MY=;
  b=fU+9Q0j3+KZZIFkqTchnW9JkQMCkiDWKdl/h+i0KjVWcqEnuyk+xHkDn
   VNpecqbe9jMzWP3Oi8QRilohEjNWrLrai/fcZynK4zRdtMN/0B9kf24Vk
   AVz146DEA6cVETFVXLK+xjMhZ5t3n/Qx5yWLOsLCU7WivnI90RwNWDRsF
   g=;
X-IronPort-RemoteIP: 104.47.66.40
X-IronPort-MID: 114683009
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:Gk3fpqip1lEgwsxT5xB3Zaf3X161RxEKZh0ujC45NGQN5FlHY01je
 htvDziPO/ncNmagKI9zadvi/R4EusLXzYdnGgRt+CwwES0b9cadCdqndUqhZCn6wu8v7q5Ex
 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv
 cKai8DEMRqu1iUc3lg8sspvkzsx+qyr0N8klgZmP6sT4waEzyN94K83fsldEVOpGuG4IcbiL
 wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ
 OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+
 tQSESJcQEqi3tmt/++GYe13tp5zCo70adZ3VnFIlVk1DN4AaLWaGeDv2oUd2z09wMdTAfzZe
 swVLyJ1awjNaAFOPVFRD48imOCvhT/0dDgwRFC9/PJrpTSMilIvluS1WDbWUoXiqcF9hEGXq
 3iA523kKhobKMae2XyO9XfEaurnxHqnBtJJTOXpnhJsqHu19mMUNDhKbwL4qtOdpkq/adJbc
 2VBr0LCqoB3riRHVOLVXRe1vXqFtR40QMdLHqsx7wTl4rXQyxaUAC4DVDEpQMwrsoo6SCIn0
 neNnsj1Hnp/vbuNU3Wf+7yI6zSoNkAowXQqYCYFSU4A/IPlqYRq1BbXFI4/SOiyk8H/Hiz2z
 3aSti8iir4PjMkNkaKm4VTAhDHqrZ/MJuIo2jjqsquexlsRTOaYi0aAsDA3Md4owF6lc2S8
IronPort-HdrOrdr: A9a23:6HVvkKtMF2iUxA/SnBOBLISI7skDWtV00zEX/kB9WHVpm6uj+v
 xG/c526faQslwssR4b+OxoVJPwJk80lqQU3WByB9mftWDd0QOVxedZnPLfKlbbak/DH4Bmup
 uII5IUNDSJNykdsS7HijPIcOrJ/7O8gcSVrPabxX9oVAlrZaYl7woRMHf/LnFL
X-Talos-CUID: 9a23:YPeRDmDpfC/Ab+/6EyNe5h86QOF8SWbikUr7J1SIUzZPD6LAHA==
X-Talos-MUID: 9a23:GVHK+ATEmDKIiexsRXTKogFtM/tNv573S0sntbkCuvuEMXRZbmI=
X-IronPort-AV: E=Sophos;i="6.01,199,1684814400"; 
   d="scan'208";a="114683009"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BokNYzyCHaeJApe/xvdhvpjQdl8kwyhpqmBEwUmnIimatjxAaa8Zikt/hQ3iXJ4M1Ca5+i40QBcvyuXs/7ZWf/BSeFSUGiCXhBZX7GvJe7Vx1ZdkW4+vtdy+hoD/Fln71P44CNclHRQqO+wtgarCYrtGsaYaC2H93Unje735vsaQvQIps9cJCqrSazYBAurSw0IrF4mOpimBsIEU5SY18KLEaWCgt8yBIXjVr0HXL5iXiZN6iSCZB9DPdofnQbmJwW3uLkJAlUnp8iGSVntfNs5IYhNt75DAdQr4O5M6qXVx7GWVjo634qrX/ctQjJEVy+MH/r9rbMFSsVCe6SfGWA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=m/vQOwoWy4tF03DCtwjLc3AtsQSOcYWmuL0vQhZhTms=;
 b=LIuYEkFs8hYAGa12vV9hbTO/9U4ti6wK32gs7KPL62opTIloiBXT7Tk417QT+/TESJNx5p7PxWW0Cos6bV4m581CLTAeH/MQy/m7s318q3pu55eEtDFiGK1ij5S/RyOh/TeZURQdvE95wgSC8Oj0/ryyDqE+s378/vZFsX+lRqmKEGtEhGFN9sGYWWiM19+0C5h8LYIE8GWhju0IVMus0S9F21bzAmdmHVqKNkuOf671cZ+uV7AuYSCz5DHRU5N+UUoSVKIF9JJlZ2l4cqarGVbQkJLWrzlViVre4Hstc8ydWoVexPS7k5I7OJBySgWH62eybFaoSDwrQPBOryPmvQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=m/vQOwoWy4tF03DCtwjLc3AtsQSOcYWmuL0vQhZhTms=;
 b=tB8Xcv6+NCfJI3S2GnTOV8la7IowLwmmG+As+4d4Iu1v3oq8pmiBOAn8gL7CgUJgc6y8nltDaEV1QR2FveRDzzBZxl8QfxaGi5X8tvh9ZRjZwrdQD/8C8LflZYFe24rC8q/1ucVF42tl+hw2GGnankYaI11Q9YEkUmlAyDwQDAc=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Wed, 12 Jul 2023 15:53:54 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] x86/ioapic: sanitize IO-APIC pins before enabling the
 local APIC
Message-ID: <ZK6wcpHnh5OgHv4R@MacBook-Air-de-Roger.local>
References: <20230707095338.44244-1-roger.pau@citrix.com>
 <92d16012-ff9f-693b-07c6-d45fe07a00a0@suse.com>
 <ZKwZBQ_0Z2c7NJNL@MacBook-Air-de-Roger.local>
 <1f79491a-46f5-5293-e92f-0e2b0b3efb62@suse.com>
 <ZK1S1V71ZUIPjKqZ@MacBook-Air-de-Roger.local>
 <eb2e3b57-a423-cf52-0192-a344db33a58f@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <eb2e3b57-a423-cf52-0192-a344db33a58f@suse.com>
X-ClientProxiedBy: LO4P302CA0018.GBRP302.PROD.OUTLOOK.COM
 (2603:10a6:600:2c1::14) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|DM4PR03MB5999:EE_
X-MS-Office365-Filtering-Correlation-Id: fab9ef08-7ef7-48ef-69aa-08db82df717d
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	R5UKSr7vn0ASD2FkZPFgXJpiYdT1NeKenfL3ITZYx7nvjNGuv0Xx2IhdFs0Np+zPMlBEONdeODET+8sxAX7yuL/k+ED29tH6CnKro7Ffyt5CbXXZPogUZ1qmGAEZ7e/7eDL5vYFbuwub/KKHjLo3UT0vOadCXYoU7+tvMe7MtI6lH/zpIvu7H14+FA5RiYDpcxd358S6XNOhAx6OsuMfI1KGHb/TXYA1/+uNYm1B89GnQGgk/Y0Tsf7JWBPxnwkHeoyfLdrF5C7I4QbzQ1Unmpfgn4uAasE9Posehm5INUEF7mSA7374mFWaCLtsBjmOSK8b159Tnsm/h2Hzv85WKppvSzV+50r+xE2Y2C7Q1z9iZ8T4zgbw3jo17k665JYlYImAwCH6UodEmKcs52g1GeZcaKi3JFQoQP5gpmtEW39ozg3gNriUINVKSxwt1mXPFejSQQXVihpajyeHsso8iUAKmCD26Ut09Nr+XpDSWwr+l6i6IGyF8MXfXvMFGSwd6WoChhq2RVVEMI42irj8sMWyaEz8XzLvcq21dPytCSpqeeVe/xsaDkkhTtiQ8pqy
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(396003)(39860400002)(346002)(366004)(451199021)(6486002)(186003)(82960400001)(54906003)(86362001)(6666004)(478600001)(53546011)(6506007)(26005)(9686003)(316002)(8936002)(8676002)(85182001)(41300700001)(5660300002)(6512007)(66476007)(66556008)(66946007)(6916009)(4326008)(38100700002)(2906002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?d0N2RjhGK0JFNzZCYzVHQXlmQnFMNVNMNEFMMFNmc2xGWUR2UDZxeGswbmhZ?=
 =?utf-8?B?SDVhQnZXVkxkelVJdGhkYzU4ekZRQU9ROHcrbDl0Wi91M3ZiM0V4Z29FNG9x?=
 =?utf-8?B?aTR5cjZPRVUwWFJkdzUrWUw0ZzErdU1EMkRJZXVJeEd2Zy9RYTR3VktVdzlO?=
 =?utf-8?B?K0lqb0k3VjRHYkdCOUNjcnNFcXQ4K05sRWl6eFNDazUxejlSU25uamF2RFNP?=
 =?utf-8?B?MktJaDk2bVFsMzUvUlBlcHM5TG1SO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OOcJuFy8DW2DjaPQJpHJrU9SOeiV+I5l6o4CJq8
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: fab9ef08-7ef7-48ef-69aa-08db82df717d
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 13:53:59.9772
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: h4+Ekyyrfd8d556iZa4Np3Ehk/iR0oCsFYyqptYy70rYrhEWcNVnxAeeeybKP/qsQxE4JPp37rOKqKFhpQnb4A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR03MB5999

On Wed, Jul 12, 2023 at 12:07:43PM +0200, Jan Beulich wrote:
> On 11.07.2023 15:02, Roger Pau MonnÃ© wrote:
> > On Tue, Jul 11, 2023 at 12:53:31PM +0200, Jan Beulich wrote:
> >> On 10.07.2023 16:43, Roger Pau MonnÃ© wrote:
> >>> On Mon, Jul 10, 2023 at 12:56:27PM +0200, Jan Beulich wrote:
> >>>> On 07.07.2023 11:53, Roger Pau Monne wrote:
> >>>>> The current logic to init the local APIC and the IO-APIC does init the
> >>>>> former first before doing any kind of sanitation on the IO-APIC pin
> >>>>> configuration.  It's already noted on enable_IO_APIC() that Xen
> >>>>> shouldn't trust the IO-APIC being empty at bootup.
> >>>>>
> >>>>> At XenServer we have a system where the IO-APIC 0 is handed to Xen
> >>>>> with pin 0 unmasked, set to Fixed delivery mode, edge triggered and
> >>>>> with a vector of 0 (all fields of the RTE are zeroed).  Once the local
> >>>>> APIC is enabled periodic injections from such pin cause a storm of
> >>>>> errors:
> >>>>>
> >>>>> APIC error on CPU0: 00(40), Received illegal vector
> >>>>> APIC error on CPU0: 40(40), Received illegal vector
> >>>>> APIC error on CPU0: 40(40), Received illegal vector
> >>>>> APIC error on CPU0: 40(40), Received illegal vector
> >>>>> APIC error on CPU0: 40(40), Received illegal vector
> >>>>> APIC error on CPU0: 40(40), Received illegal vector
> >>>>>
> >>>>> That prevents Xen from booting.
> >>>>
> >>>> And I expect no RTE is in ExtInt mode, so one might conclude that
> >>>> firmware meant to set up RTE 0 that way. Mainly as a remark, albeit
> >>>> of course there's then the question whether to change the RTE
> >>>> rather than masking it. What do ACPI tables say?
> >>>
> >>> There's one relevant override:
> >>>
> >>> [668h 1640   1]                Subtable Type : 02 [Interrupt Source Override]
> >>> [669h 1641   1]                       Length : 0A
> >>> [66Ah 1642   1]                          Bus : 00
> >>> [66Bh 1643   1]                       Source : 00
> >>> [66Ch 1644   4]                    Interrupt : 00000002
> >>> [670h 1648   2]        Flags (decoded below) : 0000
> >>>                                     Polarity : 0
> >>>                                 Trigger Mode : 0
> >>>
> >>> So IRQ 0 -> GSI 2, so it's likely pin 0 is the one the i8259 is
> >>> connected to.
> >>
> >> Then wouldn't we be better off converting that RTE to ExtInt? That
> >> would allow PIC IRQs (not likely to exist, but still) to work
> >> (without undue other side effects afaics), whereas masking this RTE
> >> would not.
> > 
> > I'm kind of worry of trying to automate this logic.  Should we always
> > convert pin 0 to ExtInt if it's found unmasked, with and invalid
> > vector and there's a source override entry for the IRQ?
> > 
> > It seems weird to infer this just from the fact that pin 0 is all
> > zeroed out.
> 
> As you say in the earlier paragraph, it wouldn't be just that. It's
> unmasked + bad vector + present source override (indicating that
> nothing except perhaps a PIC is connected to the pin).

I can do this as a separate patch, but not really here IMO.  The
purpose of this patch is strictly to perform the IO-APIC sanitation
ahead of enabling the local APIC.  I will add a followup patch to the
series, albeit I'm unconvinced we want to infer IO-APIC pin
configuration based on firmware miss configurations.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 13:57:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 13:57:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562533.879261 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJaL2-0001rS-VS; Wed, 12 Jul 2023 13:57:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562533.879261; Wed, 12 Jul 2023 13:57:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJaL2-0001qf-Ql; Wed, 12 Jul 2023 13:57:04 +0000
Received: by outflank-mailman (input) for mailman id 562533;
 Wed, 12 Jul 2023 13:54:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=STpc=C6=amd.com=Christian.Koenig@srs-se1.protection.inumbo.net>)
 id 1qJaIM-0001Kh-2j
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 13:54:18 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on2060d.outbound.protection.outlook.com
 [2a01:111:f400:7eab::60d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 96ad5705-20bb-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 15:54:16 +0200 (CEST)
Received: from BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13)
 by SN7PR12MB8004.namprd12.prod.outlook.com (2603:10b6:806:341::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Wed, 12 Jul
 2023 13:54:11 +0000
Received: from BN8PR12MB3587.namprd12.prod.outlook.com
 ([fe80::669f:5dca:d38a:9921]) by BN8PR12MB3587.namprd12.prod.outlook.com
 ([fe80::669f:5dca:d38a:9921%4]) with mapi id 15.20.6588.017; Wed, 12 Jul 2023
 13:54:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 96ad5705-20bb-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=lg/wJHH/ZFJfBXf0dR+HzSa8gUzcCNvgEVvSP267D7MPQK3c5Exm7efzcpBuo/uHQ9WOvoGqGIVxG40Rc82ll6k2VkBtY1yuAaYceR/K//D14Gm0caoArWB3nfjKis14Vskkl0gSEIzUbyz8mqAk0gEsHi+duohyuMOg2sGtjJab7KWtg4+aigLjIevXMT9EMyH4/8k/rcdxC8VEE1KEbQateFBjVetDl1pvJneGzw3czwTtBQciw04ZgfocQhHIfF9cClYcvKS59o75Obf7g7CcFeutjC4KZIDbPZC2MrPgdhHt9VK7C82QtwlM63cm1vipNSn0EqwbJk05JoZkOg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=XgHMqA6NR6xwi31+5UQb02kpONt6s3GFuikZRULOVgI=;
 b=XcpEFbGo4dujwilE05EBLxUAB4zsdSGoZgIAg7JhFWRakc8T6Z5SxWzlFR5OPi0yEBzVwcBJVx21N6zDlJrw88liyEa3Qb3q1tRUxUvgCgu23cpv2gVXUPTy5SdiEVvy/MP/iWQAFMSC9E1HkUKoUWYyz4UCwrODoIGzQR7Stf1uViO9Mo0aFUcTck0fYCVUyXWgjyrJscV3vgmjbnlWa3cUf2F+tLcmQYpMJH+oddSKYKdJNiM/NmBHSoYjjUCDePj/XpsawdOanzetUfInWzoimAoLBVt45F9UDG0yd1mG3gf7G8OwxPWh/RL7pIZwKiGJvxdfLrhBI+roBotxUA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XgHMqA6NR6xwi31+5UQb02kpONt6s3GFuikZRULOVgI=;
 b=VsTwGxlovAH+46yi04iJt6VNhWVApnJMd0mPZ5sw1AqorHxPRvBJGBkrD52FaJ9tbEji7+v0jusEoLcCNJqN5huTd57Zq9u6F31SQth6QTv2sU53YqkDgGQDd2Lj2tG/LZx4c+pqyQW2Di8ZFFsObxdpo62OpsNeTEiAtUV1kqo=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <603f0b69-71d3-ad8f-4b5e-53b63a6fd521@amd.com>
Date: Wed, 12 Jul 2023 15:53:41 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
Content-Language: en-US
To: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= <u.kleine-koenig@pengutronix.de>,
 Maxime Ripard <mripard@kernel.org>
Cc: =?UTF-8?Q?Heiko_St=c3=bcbner?= <heiko@sntech.de>,
 Geert Uytterhoeven <geert+renesas@glider.be>,
 Xinliang Liu <xinliang.liu@linaro.org>,
 Linus Walleij <linus.walleij@linaro.org>,
 Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
 Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
 dri-devel@lists.freedesktop.org,
 Vandita Kulkarni <vandita.kulkarni@intel.com>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 Jonathan Hunter <jonathanh@nvidia.com>,
 Arun R Murthy <arun.r.murthy@intel.com>, Jerome Brunet
 <jbrunet@baylibre.com>, Liu Shixin <liushixin2@huawei.com>,
 linux-samsung-soc@vger.kernel.org, Samuel Holland <samuel@sholland.org>,
 Matt Roper <matthew.d.roper@intel.com>, Wenjing Liu <wenjing.liu@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
 Danilo Krummrich <dakr@redhat.com>, NXP Linux Team <linux-imx@nxp.com>,
 spice-devel@lists.freedesktop.org,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 linux-sunxi@lists.linux.dev, Stylon Wang <stylon.wang@amd.com>,
 Tim Huang <Tim.Huang@amd.com>, Suraj Kandpal <suraj.kandpal@intel.com>,
 =?UTF-8?Q?Andr=c3=a9_Almeida?= <andrealmeid@igalia.com>,
 Andi Shyti <andi.shyti@linux.intel.com>, Yifan Zhang <yifan1.zhang@amd.com>,
 Jani Nikula <jani.nikula@intel.com>, Sascha Hauer <s.hauer@pengutronix.de>,
 Lucas De Marchi <lucas.demarchi@intel.com>, Inki Dae <inki.dae@samsung.com>,
 Hersen Wu <hersenxs.wu@amd.com>, Jessica Zhang <quic_jesszhan@quicinc.com>,
 Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
 Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
 =?UTF-8?Q?=c5=81ukasz_Bartosik?= <lb@semihalf.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
 Andrew Jeffery <andrew@aj.id.au>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= <noralf@tronnes.org>, kernel@pengutronix.de,
 Alex Deucher <alexander.deucher@amd.com>, freedreno@lists.freedesktop.org,
 Claudiu Beznea <claudiu.beznea@microchip.com>, Zack Rusin
 <zackr@vmware.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org,
 Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
 =?UTF-8?Q?Jos=c3=a9_Roberto_de_Souza?= <jose.souza@intel.com>,
 virtualization@lists.linux-foundation.org,
 Thierry Reding <thierry.reding@gmail.com>,
 Yongqin Liu <yongqin.liu@linaro.org>,
 Mario Limonciello <mario.limonciello@amd.com>, Fei Yang
 <fei.yang@intel.com>, =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?=
 <ville.syrjala@linux.intel.com>, David Lechner <david@lechnology.com>,
 Julia Lawall <Julia.Lawall@inria.fr>,
 Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
 "Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
 David Francis <David.Francis@amd.com>, Aaron Liu <aaron.liu@amd.com>,
 Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
 Vinod Polimera <quic_vpolimer@quicinc.com>,
 linux-rockchip@lists.infradead.org, Fangzhi Zuo <jerry.zuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>,
 VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
 Ben Skeggs <bskeggs@redhat.com>, =?UTF-8?Q?Jouni_H=c3=b6gander?=
 <jouni.hogander@intel.com>, Dave Airlie <airlied@redhat.com>,
 linux-mips@vger.kernel.org, Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Gurchetan Singh <gurchetansingh@chromium.org>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-arm-msm@vger.kernel.org, Animesh Manna <animesh.manna@intel.com>,
 linux-renesas-soc@vger.kernel.org, Jani Nikula
 <jani.nikula@linux.intel.com>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
 Biju Das <biju.das.jz@bp.renesas.com>, linux-amlogic@lists.infradead.org,
 Evan Quan <evan.quan@amd.com>, Michal Simek <michal.simek@amd.com>,
 linux-arm-kernel@lists.infradead.org, Sean Paul <sean@poorly.run>,
 Neil Armstrong <neil.armstrong@linaro.org>,
 Kai Vehmanen <kai.vehmanen@linux.intel.com>,
 Boris Brezillon <bbrezillon@kernel.org>, Chunyan Zhang
 <zhang.lyra@gmail.com>, Qingqing Zhuo <qingqing.zhuo@amd.com>,
 Sandy Huang <hjc@rock-chips.com>, Swati Sharma <swati2.sharma@intel.com>,
 John Stultz <jstultz@google.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Drew Davenport <ddavenport@chromium.org>, Kevin Hilman
 <khilman@baylibre.com>, Hawking Zhang <Hawking.Zhang@amd.com>,
 Haneen Mohammed <hamohammed.sa@gmail.com>,
 Anusha Srivatsa <anusha.srivatsa@intel.com>,
 Dan Carpenter <error27@gmail.com>, Karol Herbst <kherbst@redhat.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 linux-hyperv@vger.kernel.org, Stefan Agner <stefan@agner.ch>,
 Melissa Wen <melissa.srw@gmail.com>, =?UTF-8?Q?Ma=c3=adra_Canal?=
 <mairacanal@riseup.net>, Luca Coelho <luciano.coelho@intel.com>,
 Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
 Andrzej Hajda <andrzej.hajda@intel.com>, Likun Gao <Likun.Gao@amd.com>,
 Sam Ravnborg <sam@ravnborg.org>, Alain Volmat <alain.volmat@foss.st.com>,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 Jernej Skrabec <jernej.skrabec@gmail.com>,
 Deepak Rawat <drawat.floss@gmail.com>, Chen-Yu Tsai <wens@csie.org>,
 Joel Stanley <joel@jms.id.au>, Philipp Zabel <p.zabel@pengutronix.de>,
 Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
 Harry Wentland <harry.wentland@amd.com>,
 Sumit Semwal <sumit.semwal@linaro.org>, Alan Liu <haoping.liu@amd.com>,
 Philip Yang <Philip.Yang@amd.com>, Lyude Paul <lyude@redhat.com>,
 intel-gfx@lists.freedesktop.org, Alison Wang <alison.wang@nxp.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>,
 Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Gustavo Sousa <gustavo.sousa@intel.com>,
 Baolin Wang <baolin.wang@linux.alibaba.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
 Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
 Tomi Valkeinen <tomba@kernel.org>, Deepak R Varma <drv@mailo.com>,
 "Pan, Xinhui" <Xinhui.Pan@amd.com>, Chia-I Wu <olvaffe@gmail.com>,
 Konrad Dybcio <konrad.dybcio@linaro.org>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Tian Tao <tiantao6@hisilicon.com>, Shawn Guo <shawnguo@kernel.org>,
 Khaled Almahallawy <khaled.almahallawy@intel.com>,
 linux-stm32@st-md-mailman.stormreply.com, Emma Anholt <emma@anholt.net>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>, Imre Deak <imre.deak@intel.com>,
 Liviu Dudau <liviu.dudau@arm.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>, Roman Li
 <roman.li@amd.com>, Paul Cercueil <paul@crapouillou.net>,
 Rob Clark <robdclark@gmail.com>, Hamza Mahfooz <hamza.mahfooz@amd.com>,
 David Airlie <airlied@gmail.com>, Marek Vasut <marex@denx.de>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 xen-devel@lists.xenproject.org, Guchun Chen <guchun.chen@amd.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
 Russell King <linux@armlinux.org.uk>, Leo Li <sunpeng.li@amd.com>,
 Uma Shankar <uma.shankar@intel.com>, Mika Kahola <mika.kahola@intel.com>,
 Jiasheng Jiang <jiasheng@iscas.ac.cn>,
 Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
 Thomas Zimmermann <tzimmermann@suse.de>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 linux-tegra@vger.kernel.org, =?UTF-8?B?TWFyZWsgT2zFocOhaw==?=
 <marek.olsak@amd.com>, Maarten Lankhorst
 <maarten.lankhorst@linux.intel.com>,
 =?UTF-8?Q?Joaqu=c3=adn_Ignacio_Aramend=c3=ada?= <samsagax@gmail.com>,
 Melissa Wen <mwen@igalia.com>, Hans de Goede <hdegoede@redhat.com>,
 linux-mediatek@lists.infradead.org, Fabio Estevam <festevam@gmail.com>,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 David Tadokoro <davidbtadokoro@usp.br>,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 Orson Zhai <orsonzhai@gmail.com>, amd-gfx@lists.freedesktop.org,
 Jyri Sarha <jyri.sarha@iki.fi>, Yannick Fertre <yannick.fertre@foss.st.com>,
 Nicolas Ferre <nicolas.ferre@microchip.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Philippe Cornu <philippe.cornu@foss.st.com>, Daniel Vetter
 <daniel@ffwll.ch>, Wayne Lin <Wayne.Lin@amd.com>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
 Nirmoy Das <nirmoy.das@intel.com>, Lang Yu <Lang.Yu@amd.com>,
 Lucas Stach <l.stach@pengutronix.de>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <94eb6e4d-9384-152f-351b-ebb217411da9@amd.com>
 <20230712110253.paoyrmcbvlhpfxbf@pengutronix.de>
 <o3dc4q27ap6rajsvpfwfvs3z3afekkwbhnclvswkaietciy2kc@unjf67gz5tur>
 <20230712133803.rf26cbg5wz7wsmgl@pengutronix.de>
From: =?UTF-8?Q?Christian_K=c3=b6nig?= <christian.koenig@amd.com>
In-Reply-To: <20230712133803.rf26cbg5wz7wsmgl@pengutronix.de>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0182.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a4::17) To BN8PR12MB3587.namprd12.prod.outlook.com
 (2603:10b6:408:43::13)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN8PR12MB3587:EE_|SN7PR12MB8004:EE_
X-MS-Office365-Filtering-Correlation-Id: 671d3312-9a10-4462-11d9-08db82df77d0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Q+CjsHYjoEoIKYhGUtD4L6IdokqTfF3/rDoqE4aTyfCbPLgsxxuVuGUsuYCA35P4DktoBo4NaYU33T1d8TbAYeptCtWe1B55Dc7oLzVxiycliZfDBnEm8XarwPg0ryzzSJwJvhapixHLvylLlitF0v/N12hzY0tfsoDFfKqumWSnLuk5x9Kn4zL6bJWU91FmrGKdnYdHX5drfEhP8xT5CwqxgEcEcA6YmR3c+YE5hsNLi/9CstC4LyCaAp5+lOrfLNlEjbdWekywxde7dpFY5E5s2/endwHQUHrz1bB9ykbxzYdRfCd0i9JW7/R6RC1xHH6+RRBRUIVRg1hDT66tr9wgyeCj9kKh/5b2fvBgeIJAefMeQ4DQGX2ABfSJY1ODzvBXYMRjaaJvv2MH5lBW1Wdn+4LhArrIoqD0ox+pZbg4DAYjKVelomflcL76YONd3m/Nm+A7Hl4KYkmN3O9uoF8v3kUa4pH8JvdeVkcLPt6rn2HtEznZol9p06p+UQwoRqyFsHPi7xBhaQmHP/1s/M/8/S29cNU3SALPZIHU7nlxbjBCA4vScSL+4SOd+JOPhDgQZTqOQ2+2X3KoAk0XpNvhaWjTc9kOmWYNTsNJP8BQ2Q3Gk9OICAtK/ERCMFrWI2Rxa4J2jJ36saRcsxOVNQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR12MB3587.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(366004)(396003)(39860400002)(136003)(451199021)(8676002)(8936002)(7336002)(83380400001)(2906002)(66574015)(2616005)(36756003)(38100700002)(31696002)(86362001)(7406005)(7416002)(7366002)(7276002)(5660300002)(6506007)(186003)(31686004)(6666004)(66556008)(66476007)(4326008)(6486002)(110136005)(54906003)(66946007)(41300700001)(6512007)(316002)(478600001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cWZnOXNSRjdOTkRMN2twRmhhNlZKUU04WHhCY2Z0bUFVMmd0ZzMzZldoayts?=
 =?utf-8?B?elhFTXRKeWVNRUpHQ01yaTVaa1Ztakt4R216MWlHODdMUmhQYjdhMWRWUk9K?=
 =?utf-8?B?OFRpNCtPWlhuR003dy83ZXZySTlIcExnU1c0aHFEaWlya2hyRDliSjlkYlg1?=
 =?utf-8?B?bDNlV3I3b3VsWXN6VStIZDhhd1hzc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f-8?B?aCtjeWp2dk1IWWg2anFrZDQ2WWMzSGtWY0xBT3FPZXJBMXY0U2xGNkY0eFZ3?=
 =?utf-8?B?QnpHWjJ2WXBGdjBBRTUvcXVkeC8yYkdXSWRJMDZIOUNSOHdsR2JhYWVNMkU5?=
 =?utf-8?B?T1FQQk9YVVFTL2RLcllWZXhWdGt0YWxxc2JJYVpwYlRRc3AxZGpLYTdLaXU4?=
 =?utf-8?B?K0hSNmJqS3BVUG04aWhWdlBvM2lBSTZQZU9kaDBwT2tJRkozSjdRZVNZSmkr?=
 =?utf-8?Q?wZiHYk+qO2DJStqXYi3DikavUdxGeplCKcXkmFW5lXc7?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 671d3312-9a10-4462-11d9-08db82df77d0
X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 13:54:10.5983
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ISzr+3rCUPYNUMLw1tOBcCfws4G9gt0O8QB3ANwU8gXg/6JBx2yCDaCKDG7kwoD8
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8004

Am 12.07.23 um 15:38 schrieb Uwe Kleine-KÃ¶nig:
> Hello Maxime,
>
> On Wed, Jul 12, 2023 at 02:52:38PM +0200, Maxime Ripard wrote:
>> On Wed, Jul 12, 2023 at 01:02:53PM +0200, Uwe Kleine-KÃ¶nig wrote:
>>>> Background is that this makes merge conflicts easier to handle and detect.
>>> Really?
>> FWIW, I agree with Christian here.
>>
>>> Each file (apart from include/drm/drm_crtc.h) is only touched once. So
>>> unless I'm missing something you don't get less or easier conflicts by
>>> doing it all in a single patch. But you gain the freedom to drop a
>>> patch for one driver without having to drop the rest with it.
>> Not really, because the last patch removed the union anyway. So you have
>> to revert both the last patch, plus that driver one. And then you need
>> to add a TODO to remove that union eventually.
> Yes, with a single patch you have only one revert (but 194 files changed,
> 1264 insertions(+), 1296 deletions(-)) instead of two (one of them: 1
> file changed, 9 insertions(+), 1 deletion(-); the other maybe a bit
> bigger). (And maybe you get away with just reverting the last patch.)
>
> With a single patch the TODO after a revert is "redo it all again (and
> prepare for a different set of conflicts)" while with the split series
> it's only "fix that one driver that was forgotten/borked" + reapply that
> 10 line patch.

Yeah, but for a maintainer the size of the patches doesn't matter. 
That's only interesting if you need to manually review the patch, which 
you hopefully doesn't do in case of something auto-generated.

In other words if the patch is auto-generated re-applying it completely 
is less work than fixing things up individually.

>   As the one who gets that TODO, I prefer the latter.

Yeah, but your personal preferences are not a technical relevant 
argument to a maintainer.

At the end of the day Dave or Daniel need to decide, because they need 
to live with it.

Regards,
Christian.

>
> So in sum: If your metric is "small count of reverted commits", you're
> right. If however your metric is: Better get 95% of this series' change
> in than maybe 0%, the split series is the way to do it.
>
> With me having spend ~3h on this series' changes, it's maybe
> understandable that I did it the way I did.
>
> FTR: This series was created on top of v6.5-rc1. If you apply it to
> drm-misc-next you get a (trivial) conflict in patch #2. If I consider to
> be the responsible maintainer who applies this series, I like being able
> to just do git am --skip then.
>
> FTR#2: In drm-misc-next is a new driver
> (drivers/gpu/drm/loongson/lsdc_crtc.c) so skipping the last patch for
> now might indeed be a good idea.
>
>>> So I still like the split version better, but I'm open to a more
>>> verbose reasoning from your side.
>> You're doing only one thing here, really: you change the name of a
>> structure field. If it was shared between multiple maintainers, then
>> sure, splitting that up is easier for everyone, but this will go through
>> drm-misc, so I can't see the benefit it brings.
> I see your argument, but I think mine weights more.
>
> Best regards
> Uwe
>



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 13:57:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 13:57:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562530.879256 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJaL2-0001o9-Md; Wed, 12 Jul 2023 13:57:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562530.879256; Wed, 12 Jul 2023 13:57:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJaL2-0001o2-Jy; Wed, 12 Jul 2023 13:57:04 +0000
Received: by outflank-mailman (input) for mailman id 562530;
 Wed, 12 Jul 2023 13:53:08 +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
 <SRS0=LPQ8=C6=kernel.org=mripard@srs-se1.protection.inumbo.net>)
 id 1qJaHE-00015o-E0
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 13:53:08 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6cf2c5de-20bb-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 15:53:06 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id B9C64617D6;
 Wed, 12 Jul 2023 13:53:04 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id A345AC433C7;
 Wed, 12 Jul 2023 13:53:02 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6cf2c5de-20bb-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689169984;
	bh=0sbyIiczIJDnx26Ch8e9l+qxXeZZ0rwKcMQ0zWjPG2E=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=hjUTKto8Ioz8iKBRqNaRabBf11Oc7eHOlmTK9M/ZTt8ltDoWCX6CFOzjIGxRlGFY3
	 Gx5jqcVwy1TF/krIPVc4UMyuHZxNLbDekq6CNc/YFW9XZuZPgy9H7AxolbKkWLgnAi
	 r9fpm9kzzSwMYN6Psfg7TVfTW8n0B+mvlh2FTRcCYAZ0ciN3u0JY7dyza48kXnOA9n
	 WMci9hbcuhVOWKEEdS8SZtYhWg6pK+ZLR69YBjxKaOmTAGDWdtxl6Adlqjo21243Qn
	 XbsKfbvDJLN7WkAM0aaNNMoLWVYfSKf0LdY3uyS6mKtDCMS2NYJoRkpPzq+x8hypZP
	 ozEduvqpUbjZw==
Date: Wed, 12 Jul 2023 15:53:00 +0200
From: Maxime Ripard <mripard@kernel.org>
To: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
Cc: Heiko =?utf-8?Q?St=C3=BCbner?= <heiko@sntech.de>, 
	Geert Uytterhoeven <geert+renesas@glider.be>, Xinliang Liu <xinliang.liu@linaro.org>, 
	Linus Walleij <linus.walleij@linaro.org>, Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>, 
	Alexey Kodanev <aleksei.kodanev@bell-sw.com>, dri-devel@lists.freedesktop.org, 
	Vandita Kulkarni <vandita.kulkarni@intel.com>, Alim Akhtar <alim.akhtar@samsung.com>, 
	Anitha Chrisanthus <anitha.chrisanthus@intel.com>, Marijn Suijten <marijn.suijten@somainline.org>, 
	Jonathan Hunter <jonathanh@nvidia.com>, Arun R Murthy <arun.r.murthy@intel.com>, 
	Jerome Brunet <jbrunet@baylibre.com>, Liu Shixin <liushixin2@huawei.com>, 
	linux-samsung-soc@vger.kernel.org, Samuel Holland <samuel@sholland.org>, 
	Matt Roper <matthew.d.roper@intel.com>, Wenjing Liu <wenjing.liu@amd.com>, 
	Javier Martinez Canillas <javierm@redhat.com>, Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>, 
	Danilo Krummrich <dakr@redhat.com>, NXP Linux Team <linux-imx@nxp.com>, 
	spice-devel@lists.freedesktop.org, Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>, 
	linux-sunxi@lists.linux.dev, Stylon Wang <stylon.wang@amd.com>, Tim Huang <Tim.Huang@amd.com>, 
	Suraj Kandpal <suraj.kandpal@intel.com>, =?utf-8?B?QW5kcsOp?= Almeida <andrealmeid@igalia.com>, 
	Andi Shyti <andi.shyti@linux.intel.com>, Yifan Zhang <yifan1.zhang@amd.com>, 
	Jani Nikula <jani.nikula@intel.com>, Sascha Hauer <s.hauer@pengutronix.de>, 
	Lucas De Marchi <lucas.demarchi@intel.com>, Inki Dae <inki.dae@samsung.com>, Hersen Wu <hersenxs.wu@amd.com>, 
	Jessica Zhang <quic_jesszhan@quicinc.com>, Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>, 
	Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>, =?utf-8?Q?=C5=81ukasz?= Bartosik <lb@semihalf.com>, 
	Radhakrishna Sripada <radhakrishna.sripada@intel.com>, Andrew Jeffery <andrew@aj.id.au>, 
	Seung-Woo Kim <sw0312.kim@samsung.com>, Noralf =?utf-8?Q?Tr=C3=B8nnes?= <noralf@tronnes.org>, 
	kernel@pengutronix.de, Alex Deucher <alexander.deucher@amd.com>, 
	freedreno@lists.freedesktop.org, Claudiu Beznea <claudiu.beznea@microchip.com>, 
	Zack Rusin <zackr@vmware.com>, Gerd Hoffmann <kraxel@redhat.com>, 
	Alexandre Belloni <alexandre.belloni@bootlin.com>, linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org, 
	Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>, =?utf-8?B?Sm9zw6k=?= Roberto de Souza <jose.souza@intel.com>, 
	virtualization@lists.linux-foundation.org, Thierry Reding <thierry.reding@gmail.com>, 
	Yongqin Liu <yongqin.liu@linaro.org>, Mario Limonciello <mario.limonciello@amd.com>, 
	Fei Yang <fei.yang@intel.com>, Ville =?utf-8?B?U3lyasOkbMOk?= <ville.syrjala@linux.intel.com>, 
	David Lechner <david@lechnology.com>, Julia Lawall <Julia.Lawall@inria.fr>, 
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>, "Jiri Slaby (SUSE)" <jirislaby@kernel.org>, 
	David Francis <David.Francis@amd.com>, Aaron Liu <aaron.liu@amd.com>, 
	Patrik Jakobsson <patrik.r.jakobsson@gmail.com>, Vinod Polimera <quic_vpolimer@quicinc.com>, 
	linux-rockchip@lists.infradead.org, Fangzhi Zuo <jerry.zuo@amd.com>, 
	Aurabindo Pillai <aurabindo.pillai@amd.com>, VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>, 
	Ben Skeggs <bskeggs@redhat.com>, Jouni =?utf-8?B?SMO2Z2FuZGVy?= <jouni.hogander@intel.com>, 
	Dave Airlie <airlied@redhat.com>, linux-mips@vger.kernel.org, 
	Maxime Coquelin <mcoquelin.stm32@gmail.com>, Gurchetan Singh <gurchetansingh@chromium.org>, 
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>, linux-arm-msm@vger.kernel.org, 
	Animesh Manna <animesh.manna@intel.com>, linux-renesas-soc@vger.kernel.org, 
	Jani Nikula <jani.nikula@linux.intel.com>, Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>, 
	Biju Das <biju.das.jz@bp.renesas.com>, linux-amlogic@lists.infradead.org, Evan Quan <evan.quan@amd.com>, 
	Michal Simek <michal.simek@amd.com>, linux-arm-kernel@lists.infradead.org, 
	Sean Paul <sean@poorly.run>, Neil Armstrong <neil.armstrong@linaro.org>, 
	Kai Vehmanen <kai.vehmanen@linux.intel.com>, Boris Brezillon <bbrezillon@kernel.org>, 
	Chunyan Zhang <zhang.lyra@gmail.com>, Qingqing Zhuo <qingqing.zhuo@amd.com>, 
	Sandy Huang <hjc@rock-chips.com>, Swati Sharma <swati2.sharma@intel.com>, 
	John Stultz <jstultz@google.com>, Paul Kocialkowski <paul.kocialkowski@bootlin.com>, 
	Kyungmin Park <kyungmin.park@samsung.com>, Drew Davenport <ddavenport@chromium.org>, 
	Kevin Hilman <khilman@baylibre.com>, Hawking Zhang <Hawking.Zhang@amd.com>, 
	Haneen Mohammed <hamohammed.sa@gmail.com>, Anusha Srivatsa <anusha.srivatsa@intel.com>, 
	Dan Carpenter <error27@gmail.com>, Karol Herbst <kherbst@redhat.com>, 
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, linux-hyperv@vger.kernel.org, Stefan Agner <stefan@agner.ch>, 
	Melissa Wen <melissa.srw@gmail.com>, =?utf-8?B?TWHDrXJh?= Canal <mairacanal@riseup.net>, 
	Luca Coelho <luciano.coelho@intel.com>, Laurent Pinchart <laurent.pinchart@ideasonboard.com>, 
	Andrzej Hajda <andrzej.hajda@intel.com>, Likun Gao <Likun.Gao@amd.com>, Sam Ravnborg <sam@ravnborg.org>, 
	Alain Volmat <alain.volmat@foss.st.com>, Xinwei Kong <kong.kongxinwei@hisilicon.com>, 
	Jernej Skrabec <jernej.skrabec@gmail.com>, Deepak Rawat <drawat.floss@gmail.com>, 
	Chen-Yu Tsai <wens@csie.org>, Joel Stanley <joel@jms.id.au>, 
	Philipp Zabel <p.zabel@pengutronix.de>, Ankit Nautiyal <ankit.k.nautiyal@intel.com>, 
	Harry Wentland <harry.wentland@amd.com>, Sumit Semwal <sumit.semwal@linaro.org>, 
	Alan Liu <haoping.liu@amd.com>, Philip Yang <Philip.Yang@amd.com>, Lyude Paul <lyude@redhat.com>, 
	intel-gfx@lists.freedesktop.org, Alison Wang <alison.wang@nxp.com>, 
	Wolfram Sang <wsa+renesas@sang-engineering.com>, Abhinav Kumar <quic_abhinavk@quicinc.com>, 
	Gustavo Sousa <gustavo.sousa@intel.com>, Baolin Wang <baolin.wang@linux.alibaba.com>, 
	Rodrigo Vivi <rodrigo.vivi@intel.com>, Mikko Perttunen <mperttunen@nvidia.com>, 
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>, Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>, 
	Tomi Valkeinen <tomba@kernel.org>, Deepak R Varma <drv@mailo.com>, 
	"Pan, Xinhui" <Xinhui.Pan@amd.com>, Chia-I Wu <olvaffe@gmail.com>, 
	Konrad Dybcio <konrad.dybcio@linaro.org>, Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>, 
	Tian Tao <tiantao6@hisilicon.com>, Shawn Guo <shawnguo@kernel.org>, 
	Christian =?utf-8?B?S8O2bmln?= <christian.koenig@amd.com>, Khaled Almahallawy <khaled.almahallawy@intel.com>, 
	linux-stm32@st-md-mailman.stormreply.com, Emma Anholt <emma@anholt.net>, 
	Chun-Kuang Hu <chunkuang.hu@kernel.org>, Imre Deak <imre.deak@intel.com>, 
	Liviu Dudau <liviu.dudau@arm.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, 
	Roman Li <roman.li@amd.com>, Paul Cercueil <paul@crapouillou.net>, 
	Rob Clark <robdclark@gmail.com>, Hamza Mahfooz <hamza.mahfooz@amd.com>, 
	David Airlie <airlied@gmail.com>, Marek Vasut <marex@denx.de>, 
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, xen-devel@lists.xenproject.org, 
	Guchun Chen <guchun.chen@amd.com>, Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>, Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>, 
	Russell King <linux@armlinux.org.uk>, Leo Li <sunpeng.li@amd.com>, Uma Shankar <uma.shankar@intel.com>, 
	Mika Kahola <mika.kahola@intel.com>, Jiasheng Jiang <jiasheng@iscas.ac.cn>, 
	Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>, Thomas Zimmermann <tzimmermann@suse.de>, 
	Vinod Govindapillai <vinod.govindapillai@intel.com>, linux-tegra@vger.kernel.org, 
	Marek =?utf-8?B?T2zFocOhaw==?= <marek.olsak@amd.com>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
	=?utf-8?Q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= <samsagax@gmail.com>, Melissa Wen <mwen@igalia.com>, 
	Hans de Goede <hdegoede@redhat.com>, linux-mediatek@lists.infradead.org, 
	Fabio Estevam <festevam@gmail.com>, Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>, 
	Matthias Brugger <matthias.bgg@gmail.com>, David Tadokoro <davidbtadokoro@usp.br>, 
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Orson Zhai <orsonzhai@gmail.com>, amd-gfx@lists.freedesktop.org, 
	Jyri Sarha <jyri.sarha@iki.fi>, Yannick Fertre <yannick.fertre@foss.st.com>, 
	Nicolas Ferre <nicolas.ferre@microchip.com>, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, 
	Philippe Cornu <philippe.cornu@foss.st.com>, Daniel Vetter <daniel@ffwll.ch>, Wayne Lin <Wayne.Lin@amd.com>, 
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, Nirmoy Das <nirmoy.das@intel.com>, Lang Yu <Lang.Yu@amd.com>, 
	Lucas Stach <l.stach@pengutronix.de>
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
Message-ID: <a7h7uovevwdsuuwdqh7g36qgfyq3bt5sx3eba2npyduoyu2icc@pwygetstxdp3>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <94eb6e4d-9384-152f-351b-ebb217411da9@amd.com>
 <20230712110253.paoyrmcbvlhpfxbf@pengutronix.de>
 <o3dc4q27ap6rajsvpfwfvs3z3afekkwbhnclvswkaietciy2kc@unjf67gz5tur>
 <20230712133803.rf26cbg5wz7wsmgl@pengutronix.de>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="jyn7gwdek3zlokhs"
Content-Disposition: inline
In-Reply-To: <20230712133803.rf26cbg5wz7wsmgl@pengutronix.de>


--jyn7gwdek3zlokhs
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 12, 2023 at 03:38:03PM +0200, Uwe Kleine-K=F6nig wrote:
> Hello Maxime,
>=20
> On Wed, Jul 12, 2023 at 02:52:38PM +0200, Maxime Ripard wrote:
> > On Wed, Jul 12, 2023 at 01:02:53PM +0200, Uwe Kleine-K=F6nig wrote:
> > > > Background is that this makes merge conflicts easier to handle and =
detect.
> > >=20
> > > Really?
> >=20
> > FWIW, I agree with Christian here.
> >=20
> > > Each file (apart from include/drm/drm_crtc.h) is only touched once. So
> > > unless I'm missing something you don't get less or easier conflicts by
> > > doing it all in a single patch. But you gain the freedom to drop a
> > > patch for one driver without having to drop the rest with it.
> >=20
> > Not really, because the last patch removed the union anyway. So you have
> > to revert both the last patch, plus that driver one. And then you need
> > to add a TODO to remove that union eventually.
>=20
> Yes, with a single patch you have only one revert (but 194 files changed,
> 1264 insertions(+), 1296 deletions(-)) instead of two (one of them: 1
> file changed, 9 insertions(+), 1 deletion(-); the other maybe a bit
> bigger). (And maybe you get away with just reverting the last patch.)
>=20
> With a single patch the TODO after a revert is "redo it all again (and
> prepare for a different set of conflicts)" while with the split series
> it's only "fix that one driver that was forgotten/borked" + reapply that
> 10 line patch. As the one who gets that TODO, I prefer the latter.
>=20
> So in sum: If your metric is "small count of reverted commits", you're
> right. If however your metric is: Better get 95% of this series' change
> in than maybe 0%, the split series is the way to do it.

I guess that's where we disagree: I don't see the point of having 95% of
it, either 0 or 100.

> With me having spend ~3h on this series' changes, it's maybe
> understandable that I did it the way I did.

I'm sorry, but that's never been an argument? I'm sure you and I both
have had series that took much longer dropped because it wasn't the
right approach.

> FTR: This series was created on top of v6.5-rc1. If you apply it to
> drm-misc-next you get a (trivial) conflict in patch #2. If I consider to
> be the responsible maintainer who applies this series, I like being able
> to just do git am --skip then.=20

Or we can ask that the driver is based on drm-misc-next ...

> FTR#2: In drm-misc-next is a new driver
> (drivers/gpu/drm/loongson/lsdc_crtc.c) so skipping the last patch for
> now might indeed be a good idea.

=2E.. which is going to fix that one too.

Maxime

--jyn7gwdek3zlokhs
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZK6wPAAKCRDj7w1vZxhR
xY/cAP9MfcZQUQhgCUm7SZclTdLuVOlNrClVj1izsCv4zrFrtQD+JUUX9b9K3JdO
tDqchM2qQCmIMTRzt6ZwyV0l4KQkjgM=
=G8dy
-----END PGP SIGNATURE-----

--jyn7gwdek3zlokhs--


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 14:23:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 14:23:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562553.879276 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJakc-0005sn-4a; Wed, 12 Jul 2023 14:23:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562553.879276; Wed, 12 Jul 2023 14:23:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJakc-0005sg-1F; Wed, 12 Jul 2023 14:23:30 +0000
Received: by outflank-mailman (input) for mailman id 562553;
 Wed, 12 Jul 2023 14:23:28 +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 <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJaka-0005sa-KY
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 14:23:28 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20611.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::611])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a9f8d62e-20bf-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 16:23:26 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PR3PR04MB7212.eurprd04.prod.outlook.com (2603:10a6:102:8c::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 14:23:24 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 14:23:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a9f8d62e-20bf-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=gEog0XhmmjXJwf1bmTbVETiyZPVUb4JvbySmxk0jxodeMnrhpqk3DyuPEVbaSr8NecrSxOoEMOJMrNJ976txdW6Fc/ldqmYN2V6/avfGBwtJC/3jOGb9M6lQetpeehF1U19/kh98xFPQ0AGsAKRSJxWa3iuaK45+52GY40OxkCLtnXdXrMCzSES+MAnFRsyopKWJv/1Fo7DA36YVHHzJZadiaYyXYFY1HIUtZobQjVSmbV7iGbyusIQUNR4DwaKf6x6J9RTcNsTFLKo2lJBUmsYymtCv1Y2Ylvhqc967ULydWy0eJ/yoVu8+DPIwLezPd4C2LPrY9K9PqGWFnEjxHA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=K7CXn2W39dnnk5PdOufiMOKJrY1668M2OesQaA2XClM=;
 b=b2ZLc9NeT7/CYP6CSNjts20wQdWG+ItES21NB5GukIqrHr+EBEbsQhgE9r81CEscEjrjX8rzurg5j6foxM4e41lT+cLJOLXdy9EH5pSXZb27kvX05ViIcPI3hp3R9X824mp1yfNtDYKoK27gBcfyIcIfqCaiJcU5XLuNdoShLaD/ANOKYuIi+U8Ko+lMzb8pTdP9D3/809/EUT13BsNJxc5FnONwM0atcaNdpKcMw6Z8kZWgDzO4hr3rHg3rOsx/VZgjIko9fd0LMpWRC2JnTfO1ykxSdWQDcJF/3SYaYd5mUUQ5YCUR2bFYIGIVLxZqdrnFgqIb++hoc2JNZTC7Mw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=K7CXn2W39dnnk5PdOufiMOKJrY1668M2OesQaA2XClM=;
 b=KBNgtflVb2Nzyi2j3Y5PXB/SIt0eDF5/Css79fsaLPCaBGezZkzy3QjD2uSauEdY7o1C9qUN3UfmoZ8wgvyLKGxC5LEbp4m4dP7EaLqlkllZS6ZOkA9o7B4U6DSiS3WICE2sB1O4gzKexbjiN2EYnT5aw1Qby3cWm5qD9kvqmrD/pRpvg8d90qWyphql/DROsx1whNbgR3MwMouB/oqZ3MayiXOMg77n1UEGuuL6qX/U8lwun5IONKMAuMOy6OAJbcLMUS7VSu9rsRwSMHk/L5KshoJD/pW/dMxS6LcgPD8tia7bKqLpdqFP9yxV+ARyM3xIeZ22seF9jLHoirzLkA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e5b54663-77c3-5be1-ea54-3f18246bf77f@suse.com>
Date: Wed, 12 Jul 2023 16:23:22 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Anthony Perard <anthony.perard@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] build: correct gas --noexecstack check
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0209.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a5::8) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PR3PR04MB7212:EE_
X-MS-Office365-Filtering-Correlation-Id: 217ab0bd-6cd9-4e24-162a-08db82e38d0c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	uXjHehHLwvw/s5zEcdUpShm+ZYFX6ZHV16YvAsQwBmx7YTWonoh4xkVHPP+bvvbLp46JXxbEg5PfvpPzJ6tsqCkA63Tw/S7hFpksycD2DPZkt8HoiGzdJr2EjN3t7STpvSKb78ANI4BLXG2YIB9Z4GapAzWIYtp5O2mWR5ZMU7Cju8H/AjXnp8jVgZ/ZiUxeekmQj9Hh3ibFG5VZEGQR9YLQVaXeS2qjfC6A9X10/ki5ZrdfAmyzHlWdQ0zEgEakm6oggYkmR+YffRzNFtGb6PnE1z+1gTeF3nGAM8IujoY76F22AnF8+Kf9ZMZIRYJZ9SlAr2JUpDyI10hdAC/eXCuKrq4i3SYY8IEtQuLq1L8oq6Yb9mKxLGLHjczfsblFP9UWqoG1xBftsMOYOpm+IVIycSNmbBtTv2dnkqLIAVhtzJAg2925u5RJBUpyufml4peJisAh+6VmTVjLEPLNbo42GbUmwHQYSj4TXjSG8HtoWRn1tg3zsfJnBFEfMnLix5DeL36tSBAIlZVqM6gF89tF10X+NjZarLlJt1V4ky5KeVx8jNCifDRkeo29E0wAdBIkWLf5BeF97qobNtMDF16Dc6aMe6YdonezfRsxUoBIbmLbkZr9H97gylxisLIia9pyTq0QBj3hyazxa9ZdTA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(39860400002)(376002)(366004)(136003)(346002)(451199021)(8936002)(8676002)(38100700002)(2616005)(41300700001)(2906002)(316002)(5660300002)(4744005)(31686004)(6916009)(66476007)(4326008)(66946007)(66556008)(6486002)(6512007)(83380400001)(478600001)(36756003)(54906003)(86362001)(6506007)(31696002)(186003)(26005)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UDR2bkU2cTMydS9HMW1uT29PNXBDaEZKcnVXUU9GL0FWZmZ1b3d6SzNmbHhY?=
 =?utf-8?B?NXBNU3JiUElzalp1UHFjNTlYSGJiZHA2a2VManBQTTJuQ1Jpd01nVUExdUFy?=
 =?utf-8?B?RXFQY0loVExEYkZ5RGZYaEF5SHlScEJJakhWM0tKWTJydmFrbGQ1T0RvUmFo?=
 =?utf-8?B?V1RkMGNjWThSQkpDUmZuTG5DbTNaRjQrQ2FuaU9uTVBsOEFIWDNaSTY4aUEz?=
 =?utf-8?B?YkdGcTMvaTlFRlpEK1h5YnpTUXJaYmgrZExCd3gwUVl6ZGxlbGdMazB5QU5n?=
 =?utf-8?B?akxRWGsrZHJkNTZ3T21XRFdCeG9BdWNxZldPMU1wbDl1aCs0YjFSWkZZM21y?=
 =?utf-8?B?dUhhbjhwK0hVT09kTjU4Tzl4RFdtQU9kNzIxdXBoc0IzcXoxaERud01Ga1h3?=
 =?utf-8?B?cUM1dllFRkRWNEJxakgxUk0rWlppMkZ3bVJlSVJQRmFraHprZStjTE1TMjlH?=
 =?utf-8?B?Tnd2T3V0dE93YjEvMEZBeVdLSStxZTJwZS9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-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 14:23:24.0059
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: RRC+sTLpiOsBv7ytiD+GYv72abV/KSWWlRkAwcRQzURd8wZO96p6QlSWLKEOebWhQccwurQWKoKTMnTx1BhaEg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7212

The check was missing an escape for the inner $, thus breaking things
in the unlikely event that the underlying assembler doesn't support this
option.

Fixes: 62d22296a95d ("build: silence GNU ld warning about executable stacks")
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/Makefile
+++ b/xen/Makefile
@@ -397,7 +397,7 @@ endif
 
 AFLAGS += -D__ASSEMBLY__
 
-$(call cc-option-add,AFLAGS,CC,-Wa$(comma)--noexecstack)
+$(call cc-option-add,AFLAGS,CC,-Wa$$(comma)--noexecstack)
 
 LDFLAGS-$(call ld-option,--warn-rwx-segments) += --no-warn-rwx-segments
 


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 14:25:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 14:25:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562559.879286 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJaly-0006Tu-Ho; Wed, 12 Jul 2023 14:24:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562559.879286; Wed, 12 Jul 2023 14:24:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJaly-0006Tn-EL; Wed, 12 Jul 2023 14:24:54 +0000
Received: by outflank-mailman (input) for mailman id 562559;
 Wed, 12 Jul 2023 14:24:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJalw-0006TZ-OH; Wed, 12 Jul 2023 14:24:52 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJalw-0001hT-NN; Wed, 12 Jul 2023 14:24:52 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJalw-0005Us-FB; Wed, 12 Jul 2023 14:24:52 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJalw-00054S-Ej; Wed, 12 Jul 2023 14:24:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=tqTxoUeYnGe9Y6zIyCrqXerG71dbHS6Uf/xyMSHaiOo=; b=ONQtsaKF2MS+/+wR8w/wMV2AS+
	Po+eURtz+lJkE7+p1C8jv0Yo4uP8wtPZDD7ymILJ5yu5Ob6yIjvqT2Bpgw0kp11FYMcIc/RG0sAbq
	jn0ttPrXThi9rTGhELksoIFRGxOi1RnlrjUA18gfXXFADULw+0rcjEDZXInnF75rXM/s=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181773-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181773: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=0a834e953b01ec25c412369d7a5b8b57d340ac60
X-Osstest-Versions-That:
    xen=3c911be55f1c4e0063e690fb61223df21511b5bb
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 12 Jul 2023 14:24:52 +0000

flight 181773 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181773/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  0a834e953b01ec25c412369d7a5b8b57d340ac60
baseline version:
 xen                  3c911be55f1c4e0063e690fb61223df21511b5bb

Last test of basis   181766  2023-07-11 21:02:08 Z    0 days
Testing same since   181773  2023-07-12 12:02:02 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Gianluca Luparini <gianluca.luparini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>
  Simone Ballarin <simone.ballarin@bugseng.com>
  Tamas K Lengyel <tamas@tklengyel.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   3c911be55f..0a834e953b  0a834e953b01ec25c412369d7a5b8b57d340ac60 -> smoke


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 14:25:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 14:25:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562564.879296 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJamY-00070Z-Qp; Wed, 12 Jul 2023 14:25:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562564.879296; Wed, 12 Jul 2023 14:25:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJamY-00070S-Nz; Wed, 12 Jul 2023 14:25:30 +0000
Received: by outflank-mailman (input) for mailman id 562564;
 Wed, 12 Jul 2023 14:25:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJamX-00070C-9W
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 14:25:29 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2062a.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::62a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f2685bff-20bf-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 16:25:28 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PR3PR04MB7212.eurprd04.prod.outlook.com (2603:10a6:102:8c::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 14:25:26 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 14:25:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f2685bff-20bf-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=N+Whk3ZjwvGog9jqyDMsK572DTqQn41KB7pG6skssYZR3hiZ2sXBiqEu21yd+zSZ1s2uhWK8CxDeN36mjk4jBLzrf8ladfBFuf+lEPy7ZptyCJcmRFMssMRsm/a8tBv+T8SvEBpOazkMiOEouRXqZl//N3OEotm+qWyJO78mK7doAyTvtuwxaZ4+FKSJkIuR8xPnxkxBy3L1HpfAesW2d9UobTxcH1aWhxRP92ft2XKOtQwy6aLMcwaPk94QwxMU73/lLvh2suH4h5mie40MZ02/hpqQw/U703ujwJwmmuUWx5LQzVVCbJmbjQBP/qHdC2LmzdUrsExxmDhESG8oug==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=actnbxdtcI+RA2YJzPiZ0LnEyvRXEVw+dZc506y8HFE=;
 b=jqg4Np3Se3XGomdJYKG1saVYBVQuN0ZdkkPAvsRISF82ZKojbCsQnFwByQUjGLp+yLXdhVj4Yw30/GvQ4gyXkO+H3LLBdCDUwiZTwWkylU3LCyDeiq3xmmNGTBXyHAA79EsU8Nt08cjVnorstlCiwRM3Vcvv6VS3CDlIlsHuhXAI0amD/oVCnIN1xowKjQhO/KMi9VweAeZsZSu7LGT8NV+ej8rxC2tIOKSLri7moyCVq0i4uDfen9rUukVyefe+TT2p6PWa9EpGT3mqidTwlOuQG0ypm7dPw8jqYFoZoIVE/nEpsnolRAhq48du0ZIWYhTYLvFv+F2RjBUa1erc5g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=actnbxdtcI+RA2YJzPiZ0LnEyvRXEVw+dZc506y8HFE=;
 b=TOFD1KCdTxW5HNkL+PfKBC2R3cyCvkNrwAWpdqMBsfd+IHkfNrTFZk4J41Qn3Iun2oX5evhdh+t/WNBqwn7gJfGG8okOzKWw2yQFEf6/KK5ojktxvJt5OMD8XZ9GAOwvRf7OCtw1X8Bl8GMj+jsQ1M+RX90WHhvV0Dh/5g7YouRi2mp/1fEhUeO+I2ZLazgfyFRzjg40hh5yLllsiwXDvKK26DBM69LoucSfB4wSrOsVGPmSizluXeSmeFsviCQ9OqjmyjHD+5hWDymAPPd++D5VkcglGzAm9s6o7whuUeB7YSVuHFOTUa8AvUwGv+9hfNU2TBdCIVWfK39QNEn3gg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <fdf90115-7ea8-7835-c252-aba55ccf86d3@suse.com>
Date: Wed, 12 Jul 2023 16:25:23 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH 0.5/3] build: make cc-option properly deal with unrecognized
 sub-options
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com>
In-Reply-To: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0177.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a0::14) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PR3PR04MB7212:EE_
X-MS-Office365-Filtering-Correlation-Id: e7a27805-536d-4f20-c776-08db82e3d5c2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	zQ89SBAsJWKrqc6EOnSRfEtmu1C4evK4HYZhy+z30ZzcbuStHJBQ7EYQnfL/Vo0jZhRV9aFGNVMQSTqDnhbVAhZX4JTgOd7caOM97CCpdHc9IaZglriqaqI9gJG1Rxt166erkI8YGhkijk+8WLO/+IAKuOsoiivaCT7s/7i29w4/KkBDeg6+kTKj3uWT4TPFEwJQH3ObilwT8GYHddOU4Kxd1orL0tfguNXtrj7NZqSAXFUERC4hVODLZlBx8jm1ddMId8g6xqgFQ5u9bahyKxLHUR5u2O8PX6Jk/naZIPGgfh8I63TCpIcKgvA6MEIy2X2WQB3mfQDBgegYMhjecY5WV5kBBdXMbxyXcKoYUQObRvdFN/mH9qGPwoSm2PmVe5dO1WF0fhtAeHEQ7X/xDCuwWxsDvpbZdA9PyzdL+cUQ3ou7Uk9NiQxNkrLtVghI2u7223SN8jmGDDTOdQpv4ObUqBt86kt+WhwjEo7UolFHe5/VWIVpEh9BfT+pFvDoQ4w1QAf51VHlXc32GP0KtpimV04BO8q/KzWqC68YP0IFrDnNP7BngZbUionjTGTJKHocrhnQ6iV/6UpIYGJPO+m62jzGDQOlWZGXA8gVVhQaaSRLyrXwwrh8E4dUNngjKz9kUlHHj8xhy/evhWwcyA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(39860400002)(376002)(366004)(136003)(346002)(451199021)(8936002)(8676002)(38100700002)(2616005)(41300700001)(2906002)(316002)(5660300002)(31686004)(6916009)(66476007)(4326008)(66946007)(66556008)(6486002)(6512007)(83380400001)(478600001)(36756003)(54906003)(86362001)(6506007)(31696002)(186003)(26005)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZmJTTmNRV0lXd2g0dmUwN1BjZTJPMm5Qc1MwVGRJS3RUb0lLT1c2eE5Wd3R2?=
 =?utf-8?B?SUVDd2EzdkQ3Mm9lWnJJbVF4NHhoYW4vaWdnTHl1cTJjTFpGZ29Qc3JURzll?=
 =?utf-8?B?NW52MUg0MFNrbjByN1FIc1dibWFSOGJXRTJhN2lveWNzRWc0YXQ4WXoyall0?=
 =?utf-8?B?ZTdTYlBVc3NnUUhFZUN2Z2NQNDAzYmFPUDhTczV4V2VoTWRZVWtZeUNiSmRZ?=
 =?utf-8?B?b1JaWWw4aVo2RHpPTlVWMEM2d0V3UXN2bFVnLzB1d08rN0Z4dXUwdEg5TjVx?=
 =?utf-8?B?NGtRRFoxME9SeWNvUzFkc1RWUHFaWU02dHh0c2lCaytHUjB1SER0bjc0WmI0?=
 =?utf-8?B?NExMdWZ4Ny94aE9Jc1QrMzY2ZWh5ZDRQRVdTcVp2eHFCa0lEZDNZTVZOMllv?=
 =?utf-8?B?bWJPcTFKdU5VV1lWNVpvNVpoZ2JzTmxjek03YTJUaDJOM3AxNHpnSC9QcTU2?=
 =?utf-8?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.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 14:25:25.9443
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: TpDTHKU9raqA7dirJ34iAXwKoKANbxRWY+wiIqSTMunBLj7n4Y6rcL+ryUqH011DHRFYC/Uc2sEt4BxyeKUw4Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7212

In options like -march=, it may be only the sub-option which is
unrecognized by the compiler. In such an event the error message often
splits option and argument, typically saying something like "bad value
'<argument>' for '<option>'. Extend the grep invocation to check for
any of the three resulting variants.

To keep things halfway readable, re-wrap and re-indent the entire
construct.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/Config.mk
+++ b/Config.mk
@@ -90,9 +90,14 @@ PYTHON_PREFIX_ARG ?= --prefix="$(prefix)
 # of which would indicate an "unrecognized command-line option" warning/error.
 #
 # Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
-cc-option = $(shell if test -z "`echo 'void*p=1;' | \
-              $(1) $(2) -c -o /dev/null -x c - 2>&1 | grep -- $(2:-Wa$(comma)%=%) -`"; \
-              then echo "$(2)"; else echo "$(3)"; fi ;)
+cc-option = $(shell pat='$(2:-Wa$(comma)%=%)'; \
+                    opt="$${pat%%=*}" arg="$${pat\#*=}"; \
+                    if test -z "`echo 'void*p=1;' | \
+                                 $(1) $(2) -c -o /dev/null -x c - 2>&1 | \
+                                 grep -e "$$pat" -e "$$arg.*$$opt" -e "$$opt.*$$arg" -`"; \
+                    then echo "$(2)"; \
+                    else echo "$(3)"; \
+                    fi;)
 
 # cc-option-add: Add an option to compilation flags, but only if supported.
 # Usage: $(call cc-option-add CFLAGS,CC,-march=winchip-c6)



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 14:27:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 14:27:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562569.879306 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJanz-0007Zv-60; Wed, 12 Jul 2023 14:26:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562569.879306; Wed, 12 Jul 2023 14:26:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJanz-0007Zo-1q; Wed, 12 Jul 2023 14:26:59 +0000
Received: by outflank-mailman (input) for mailman id 562569;
 Wed, 12 Jul 2023 14:26:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJanx-0007Zg-QL
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 14:26:57 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20603.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::603])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2774dc34-20c0-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 16:26:56 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PR3PR04MB7212.eurprd04.prod.outlook.com (2603:10a6:102:8c::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 14:26:55 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 14:26:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2774dc34-20c0-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hAGWCsZALSHL0R9kmsY4T7duC/8KjX5PqfarCf4CZxe09EnqBtYt9wpCdpilpjkSyDwDFf01O63aQaf69MJ6oqUK29xJP04xLsHMc9hDxnjhV/G6x47YZL4ocjxih+R5J0w4FwgRJZnsVFg0C3WtdWROLkCylqnVo4YxWkAWgd1vOt1cod45Uzk+a7mhePMTlNQ2lCd8BuP+iDRIHwB3HF7TwS6lMwpA/GzG9qffuqXYFOrMjEtWKvDDHnbgdCljdDl8OFjaUBQeGH8i8qpjqIFl1tjxQKatCpPu0jojFMU5C1VF+oVjvbr/B3dkKyuLOYmtCdxxgh7VbIyTdUPiZg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BBlY3/LJPEqXfh4o+2erDcxetpKZgO/+Av51FujHwls=;
 b=EJN6Pf3nM2Z7Jp58t653I1u31TDpa/EmRlf2y/ZmpU+3gqq0uPDtWpQ0nxAuV1xtIZ/UekeRPamd/u0dg2FRzbPDqfIfFpX6e4ocq23C7mGfEVy5KKiNYvTTy36VSn1frrnCbTv/hIiKpzTPFHNLUgXKJkoJtXEKtsMQR2zqUZ68WW9H1ixrD0IEUluPF/1neFUq3h4q++/+0nZ6lP0kltEE2RLmeVFLKlO8hPJMnKLrcaj/5jSFWE5K+axQaOg4u6IAQvlulMvu5WZa11PBlkhHdsgJY0K5iIHmsQlIVsM/30GciZ5IvZ7euREAj/gmpllWqvzTAKRDNgzODYMuDA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BBlY3/LJPEqXfh4o+2erDcxetpKZgO/+Av51FujHwls=;
 b=YaLqrTf7xqlesO6R7TxwFE1F+DqAJysSJi+PphU4wfLxGND1hDJ4uwqC33UYmaec6zSowVL71fhSi2QLbQZuNbBiGg1nNyLyZQ4ZYKuvHWI/mOZmt7vrdJkRYIqPMiQpqPwXe6dWRyMDu50VGytipx5+iwfTxMAAxBu4tJ2n+/G62gHlRapO0To2u+CTgjUdKR+XlJh5I8Lbu1wtprBeKca3/lke8ohI/fbH/TYXTLiDpY5GMTFS9Vo/BxyOlFvdc4QNKsLagT1vFB3/Lly/0bkHhqWoz+s35m2d63hmCPbU2c0iqWVYYLqdDykyDYK0ACgPmRG9gDdSQB4YCWoCAg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <fe4c01c0-91cd-a303-71e9-96a81e46ddff@suse.com>
Date: Wed, 12 Jul 2023 16:26:53 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH 0.5/3] build: make cc-option properly deal with unrecognized
 sub-options
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Anthony Perard <anthony.perard@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
References: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com>
Content-Language: en-US
In-Reply-To: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0153.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b3::12) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PR3PR04MB7212:EE_
X-MS-Office365-Filtering-Correlation-Id: 2c87006d-39f6-4c8e-1dc0-08db82e40af5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	yzFqRqXIyoUhrxoNa5mmpDj74gdxuyTPl4aetgX+h0LsjpFfmZHPeeWDrcz/30WMk3Cy41z79eIawscn55CEjp4TM+Z276Fv3L+b6Q/mQ++P5ZKl6tY88avFGxpCDBHXtk+cZtumXTIQZpIvr7OuFp8cne+0g45cDbRfTy/GeCK0Q+9yQLbMv5jA5XEXkxBcr8W+gwb6TOgUBFATVNI8tTdILvZ/OWw003m4IdaY0aGNKmmWdXBTKNXPrP3vP0B6ksyn7NaWO1jX7RfNjWQnqehXGNcBBNRrcT+RFoNjLUBXsFkMnG4WxsXoJPhaF4jOcxkA1SccTCuSC6qq5N5++DIudyQZKiZZP7TqE7IA5c6D6ZGrdKecntuMFI7krS4KKwvPjZkmEM5ArNm4bc2qr4VTVDH2Rhp9gIAq1FjFuGuGlCz9FBcPas9VbeA6lUnA/kF4wq4kW9kRXWgsEf7yKclZbltJRsg44sjI1rjRZBgB9VRe3CY3Rnt/Ywv1P3jGJNo9C9ctzYcdfhm0i+kITugJl5RtGNDSscQy5518HaEA8oAuL2v/nrRMkku0eyeuQqwDBwsys8fJYEYYU6h+uQmozPjndQm9IimiJIxOWO6MNrRfDyq4iatd/rQNOHTmO4l8FqNi+wiH+cv6MgtnuA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(39860400002)(376002)(366004)(136003)(346002)(451199021)(8936002)(8676002)(38100700002)(2616005)(41300700001)(2906002)(316002)(5660300002)(31686004)(6916009)(66476007)(4326008)(66946007)(66556008)(6486002)(6512007)(83380400001)(478600001)(36756003)(54906003)(86362001)(6506007)(31696002)(186003)(26005)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WVI4SnZIUmNlTVh2TkIyOXZzTHFCQ0l2Q2tneXorRDhWczBlTVRtY05CdGVP?=
 =?utf-8?B?L08reEdLTzB3WjZaYU9vK0R2UVNYbVVzeHk4bStoL3JOYVFaZ0JoemxFYWVh?=
 =?utf-8?B?NjlWTzk4MEd4SWdzbDg1Q05VZ3ZqNj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ndBaUlSSlVxUld4cFh5S1hJNUVrbk9E?=
 =?utf-8?B?WU9WODlvTXR3SWIyNTlvUjF4U2tMVTUwbE16WVdkZGtCVWRhWG43dHZ0Z3Bk?=
 =?utf-8?B?N0dGUzJKdmk2dE5YQUtRVTF0WHMzaS9OcGJ1RUdyMGpaNXI4aXRaeWlmU2FK?=
 =?utf-8?B?bnZkdVJwM3hhNU9tbStvYUIvRFc5V1h5SjNDRElGYTQxZjNxRjdyVmJsellO?=
 =?utf-8?Q?OcJodGIfY+A7ztptdJJpS//EH?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2c87006d-39f6-4c8e-1dc0-08db82e40af5
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 14:26:55.1979
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Ak6aHg0iLDbe6teZ+oWzDrpdESR5X+qjkGNeWTZ1C3fDpxn4lLQhLxam3waPhAKY3j2mL9bZ4AwBvO3lTnTVaQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7212

In options like -march=, it may be only the sub-option which is
unrecognized by the compiler. In such an event the error message often
splits option and argument, typically saying something like "bad value
'<argument>' for '<option>'. Extend the grep invocation to check for
any of the three resulting variants.

To keep things halfway readable, re-wrap and re-indent the entire
construct.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
I'm sorry, re-sending with wider Cc list (as was intended originally).

--- a/Config.mk
+++ b/Config.mk
@@ -90,9 +90,14 @@ PYTHON_PREFIX_ARG ?= --prefix="$(prefix)
 # of which would indicate an "unrecognized command-line option" warning/error.
 #
 # Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
-cc-option = $(shell if test -z "`echo 'void*p=1;' | \
-              $(1) $(2) -c -o /dev/null -x c - 2>&1 | grep -- $(2:-Wa$(comma)%=%) -`"; \
-              then echo "$(2)"; else echo "$(3)"; fi ;)
+cc-option = $(shell pat='$(2:-Wa$(comma)%=%)'; \
+                    opt="$${pat%%=*}" arg="$${pat\#*=}"; \
+                    if test -z "`echo 'void*p=1;' | \
+                                 $(1) $(2) -c -o /dev/null -x c - 2>&1 | \
+                                 grep -e "$$pat" -e "$$arg.*$$opt" -e "$$opt.*$$arg" -`"; \
+                    then echo "$(2)"; \
+                    else echo "$(3)"; \
+                    fi;)
 
 # cc-option-add: Add an option to compilation flags, but only if supported.
 # Usage: $(call cc-option-add CFLAGS,CC,-march=winchip-c6)



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 14:34:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 14:34:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562575.879315 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJavO-0000jL-Su; Wed, 12 Jul 2023 14:34:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562575.879315; Wed, 12 Jul 2023 14:34:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJavO-0000jE-QL; Wed, 12 Jul 2023 14:34:38 +0000
Received: by outflank-mailman (input) for mailman id 562575;
 Wed, 12 Jul 2023 14:34:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=R8Q3=C6=citrix.com=prvs=550b2c143=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qJavN-0000j8-Az
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 14:34:37 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 37ce9924-20c1-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 16:34:35 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 37ce9924-20c1-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689172475;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=LG9LqQMdV6J2PUCymKn3Aox/gbkTEDTWztzIR4DCS/E=;
  b=OsT6C5pBggjfprhx1cq9gzMZ6L9FvHd7C5CReHbujskU/V4FoKYV7Gdu
   uX7caFkL1pOOIurA6yKWBDXCw4lyviSD0BOD+gO+pYnqU/OFYW1NfPPVy
   bfXV8Jy7uRuuQ9sDX3Y5+TJsvHuCgxXVYDdmoDoE7/+PUX2hfhxc5s+xj
   E=;
Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 114690188
X-Ironport-Server: esa5.hc3370-68.iphmx.com
X-Remote-IP: 162.221.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MwZat89CiOR2l0jSNEvYRIzhzgTP7FZtTCf9dFvxC3PXNrpRxPrd8G3oH
 yN3a5PiJ+N3DLevPUE6MOc7cTg3EJTMLcqu8ZcIK7HffVUO9aNII6a5/I7NsrdNx8x9/tokN
 FnkMqOE4DITXUH6FDg=
IronPort-HdrOrdr: A9a23:5rn3V622SldIw3nNjupOKAqjBJkkLtp133Aq2lEZdPU1SL38qy
 nKpp536faaslossR0b9uxoQZPwOE80lqQFg7X5X43DYOCOggLBEGgF1+XfKlbbak7DH4BmtJ
 uIRJIObOEYXWIQsS8j2njCLz/7+qjgzEl0v5a4856wd3ATV0i/1XYCNjqm
X-Talos-CUID: =?us-ascii?q?9a23=3A+dTrdmoG27WBjb0WqvNo55bmUZ44Ilz9xWqNGmP?=
 =?us-ascii?q?mLkp0SpbNGGeu86wxxg=3D=3D?=
X-Talos-MUID: 9a23:POLyrghEAvOsUpK6q5Y1K8MpE+lS86ajT242kLYBl9SnM3JgCzPNtWHi
X-IronPort-AV: E=Sophos;i="6.01,199,1684814400"; 
   d="scan'208";a="114690188"
Date: Wed, 12 Jul 2023 15:34:23 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
CC: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>, Juergen Gross
	<jgross@suse.com>
Subject: Re: [PATCH v2 1/6] libs/guest: introduce support for setting guest
 MSRs
Message-ID: <45c89e03-fe3d-43f0-9f2b-de11ae4fd539@perard>
References: <20230711092230.15408-1-roger.pau@citrix.com>
 <20230711092230.15408-2-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230711092230.15408-2-roger.pau@citrix.com>

On Tue, Jul 11, 2023 at 11:22:25AM +0200, Roger Pau Monne wrote:
> diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c
> index 5b035223f4f5..5e5c8124dd74 100644
> --- a/tools/libs/guest/xg_cpuid_x86.c
> +++ b/tools/libs/guest/xg_cpuid_x86.c
> +static int xc_msr_policy(xc_interface *xch, domid_t domid,
> +                         const struct xc_msr *msr)
> +{
[...]
> +
> +    rc = -ENOMEM;

This `rc' value looks unused, should it be moved to the if true block?

> +    if ( (host = calloc(nr_msrs, sizeof(*host))) == NULL ||
> +         (def  = calloc(nr_msrs, sizeof(*def)))  == NULL ||
> +         (cur  = calloc(nr_msrs, sizeof(*cur)))  == NULL )
> +    {
> +        ERROR("Unable to allocate memory for %u CPUID leaves", nr_leaves);
> +        goto fail;
> +    }
> +
> +    /* Get the domain's current policy. */
> +    nr_leaves = 0;
> +    nr_cur = nr_msrs;
> +    rc = get_domain_cpu_policy(xch, domid, &nr_leaves, NULL, &nr_cur, cur);
[...]
> +    for ( ; msr->index != XC_MSR_INPUT_UNUSED; ++msr )
> +    {
> +        xen_msr_entry_t *cur_msr = find_msr(cur, nr_cur, msr->index);
> +        const xen_msr_entry_t *def_msr = find_msr(def, nr_def, msr->index);
> +        const xen_msr_entry_t *host_msr = find_msr(host, nr_host, msr->index);
> +        unsigned int i;
> +
> +        if ( cur_msr == NULL || def_msr == NULL || host_msr == NULL )
> +        {
> +            ERROR("Missing MSR %#x", msr->index);
> +            rc = -ENOENT;
> +            goto fail;
> +        }
> +
> +        for ( i = 0; i < ARRAY_SIZE(msr->policy) - 1; i++ )
> +        {
> +            bool val;
> +
> +            if ( msr->policy[i] == '1' )
> +                val = true;
> +            else if ( msr->policy[i] == '0' )
> +                val = false;
> +            else if ( msr->policy[i] == 'x' )
> +                val = test_bit(63 - i, &def_msr->val);
> +            else if ( msr->policy[i] == 'k' )
> +                val = test_bit(63 - i, &host_msr->val);
> +            else
> +            {
> +                ERROR("Bad character '%c' in policy string '%s'",
> +                      msr->policy[i], msr->policy);

Would it be useful to also display msr->index?

> +                rc = -EINVAL;
> +                goto fail;
> +            }
> +
> +            clear_bit(63 - i, &cur_msr->val);
> +            if ( val )
> +                set_bit(63 - i, &cur_msr->val);

Does this need to be first clear then set? A opposed to just do one or
the other.

> +        }
> +    }
> +
> +    /* Feed the transformed policy back up to Xen. */
> +    rc = xc_set_domain_cpu_policy(xch, domid, 0, NULL, nr_cur, cur,
> +                                  &err_leaf, &err_subleaf, &err_msr);
> +    if ( rc )
> +    {
> +        PERROR("Failed to set d%d's policy (err leaf %#x, subleaf %#x, msr %#x)",
> +               domid, err_leaf, err_subleaf, err_msr);
> +        rc = -errno;
> +        goto fail;
> +    }
> +
> +    /* Success! */
> +
> + fail:

Even if this label is only used on "fail", the code path is also use on
success. So a label named "out" might be more appropriate.

> +    free(cur);
> +    free(def);
> +    free(host);
> +
> +    return rc;
> +}
> +

In any case, patch looks fine to me:
Acked-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 14:50:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 14:50:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562585.879325 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJbAv-0003Ho-Cu; Wed, 12 Jul 2023 14:50:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562585.879325; Wed, 12 Jul 2023 14:50:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJbAv-0003Hh-A4; Wed, 12 Jul 2023 14:50:41 +0000
Received: by outflank-mailman (input) for mailman id 562585;
 Wed, 12 Jul 2023 14:50:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJbAt-0003Hb-PU
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 14:50:39 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20621.outbound.protection.outlook.com
 [2a01:111:f400:7d00::621])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 76dbeed3-20c3-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 16:50:38 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS8PR04MB8086.eurprd04.prod.outlook.com (2603:10a6:20b:3f6::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Wed, 12 Jul
 2023 14:50:36 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 14:50:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 76dbeed3-20c3-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=IhH4ZVNKSYuNHiLDblrALwKOuprX4FxB+AFU8/TjagABSspGhPqPdgpyi1/I9AyOLImYV9dPsMNeTUs2qGDnJUKqAWiIy9T7Ex4jgLpWWrLHlEhu3lQ5zRDdxGkvmb+uEbqAztrwl3aiZbsMUC9xPot47nhB0dxN4J1JnxSv+bcJLfo/yfcOx8AAtEBb+jN28KPrVCMARanoHsCAKJy6UlKXJ424QpfsZFQz7ysv83CYToqXDc5ZopzUbF2EEQY8mZkl5i3SkWf7XHULoWJ1mWrcJx5Y+X1jv3ab4ELdSP/Zw5c6GW32NfN4WDudb8Q+3NSokVRg5q2TSHIcMdYB4Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7fmrr+0oe+hp5dkJ3y2M5RfCMw4ULlntis3R15ewqVQ=;
 b=kcAWuq66bgl05LwOK7j3skje9BFFlBOR8nw2YBC6gaLb9YOiFRYcU3aEDdWMxFLuad5BT38uj10UGoGn3re67AgFjDka/qKUF9ke8nYI2kvh7/0L+OulrjtIaSP1+tU94qT5gjMo73TWDKHa0r5YpNgQoZYPVm2xs4VPLn9VaAGdpjgQ/CGql0qMmDMUrYtr56aszsUDTIER6Iwe8H2eVq0SQCm6cyA+DeCaujVqQk0oH219zymiPON1aFx3Fus60TsGOBkAoP9ejZVhummuOT8bSWj+uXBPA9RhYTPYU3i4iZj0E2Mpe0n8wX6SG4SJOXLIE8Nc9fN7KBQK76jBTg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7fmrr+0oe+hp5dkJ3y2M5RfCMw4ULlntis3R15ewqVQ=;
 b=Q+AFOjcifNPEM6yP+KeRT9ASOGsaYZAasY7xIXTX/GwXQfkG4b6FkuFcpcSiXak47kao8vm50WJPVmzZ7jxc+EsV423utRGX/jSonb7cItbpFIkr3GoGAryAisQ8KK7ew49rFCdv0TRKTx6aKodriPPeXYAZAHImX6UU7aATw+nvBTnfMmWxOOIWjwNpI7nm7+8I9uuATiNa01Pi9UGckwvnGUoY6j9VFNOn7bPsViAerEPDuu0mvuZ4teghXFSETOc31+r2ml/Qm/lwBdMKcy2EMRQwXfcW9Yeprx5e/bkVpyMiC69guJC0onB+VR7XVam/idpiOr0sxl3wytRfNg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <d84482f4-8be6-e514-58a7-a529890c8feb@suse.com>
Date: Wed, 12 Jul 2023 16:50:34 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] x86/ioapic: sanitize IO-APIC pins before enabling the
 local APIC
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230707095338.44244-1-roger.pau@citrix.com>
 <92d16012-ff9f-693b-07c6-d45fe07a00a0@suse.com>
 <ZKwZBQ_0Z2c7NJNL@MacBook-Air-de-Roger.local>
 <1f79491a-46f5-5293-e92f-0e2b0b3efb62@suse.com>
 <ZK1S1V71ZUIPjKqZ@MacBook-Air-de-Roger.local>
 <eb2e3b57-a423-cf52-0192-a344db33a58f@suse.com>
 <ZK6wcpHnh5OgHv4R@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZK6wcpHnh5OgHv4R@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0096.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a9::9) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS8PR04MB8086:EE_
X-MS-Office365-Filtering-Correlation-Id: 32de923c-e7f1-4f0d-78ef-08db82e759ff
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	OdIidflwN4YO+u46KnqZDBCdl7owgGtqrFmjdiRIamMmwCUlmXVMftWzfry2bxNT6rwFZ20gsucYARwDhFrxJRbwYzJbr89i2dF9fKw3sBFr4G4zXoKaEWX3qS/k2ViriDCUbcPfItlm383W4abKmMC8o0/VaBVyel15yu33c/HNTjDLYDpv8iaV5mFmNxqUwNLIA31FXxVr6P+1BqcbP1M+KSqRF9c6E0rf+kiORHqdgZ6m9gkS/JR/ovkOgSOwZX8uV5wp+WIpMuCSnsU4RsRE5tylwtwiv9H97/xpIqTlmXV3jW/vfZ4kdXElclQZGqDWz7quPCwDcm43g9aq79HbGOgoYaoHyspFRgiGM1DNaBMKw4LA/fX3TlgapJ1hxJ6msjEH2Bv31XB2pnLHzQBbwAh2oVGJKkc1D3mlSXlmz5DxKJmPI6NjkAk9Cp7Qhc01cE/HC2iZweI/aZoBtiw42cD6ERgFPHLXtTv3MMvSw8QHQUhbfOwZODH2fk0LdvrRa/FuaI8yhGYi0fkgjr4nssRC6mc/EygU66Tbm20ujMh7Hft40pDuRQ2TegFEFck7D59mQ2dGgjCK1jGLvr9r+phFhn8tlm3xhpAnk54a2t6iZWvqitmBiBCwGmkUXA6IkXKXIzC8+hvCXD1Aza621ixr2dXYn1UG/GiiCD2KMxWXNPhcO1ZczfwPonnBY5638ZK3nZMY2xlepFP1hQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(39860400002)(396003)(366004)(136003)(346002)(451199021)(8936002)(8676002)(5660300002)(478600001)(41300700001)(316002)(6512007)(6486002)(4326008)(6916009)(31686004)(53546011)(186003)(26005)(6506007)(66556008)(66946007)(66476007)(54906003)(2906002)(2616005)(38100700002)(31696002)(86362001)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?S3JNa3hjYlZmc3QrMjAyNnJWenN0QXVBdi8xSUVpNDR3K3QyYllsQlJaUVVZ?=
 =?utf-8?B?MWZCdGxJcFI1VFNvcjFTaVI5RWN0Z0laQzExVFlKalp6NmhCRGZ6Y2JCSVh1?=
 =?utf-8?B?c0ZTdE5IS3hCeEdTT0pXd3dTTTlaaWFDU1hnWjNnSml2Smg5eXhUem1VRzFV?=
 =?utf-8?B?OUNMdTAzblBmM29ENS9IUTZ3RzJZZGNRN1JvVlNmZnJjT2ZNTVBEcW11QzNQ?=
 =?utf-8?B?aUVFZ3ZCMzFCaXRyZHpxL1pDZzJabEgrZzZFZnVHNmdWazlnck9Ra3cxdkNw?=
 =?utf-8?B?akN6UGJyUDJEK3lCZURFME1NcnBUSnNYUElJNXRZZEFReis4WXNuS3E3YzRF?=
 =?utf-8?B?WTh6eENFLzFSdW5ISkZBNUlHZ0x3YjRWVjVVcmswZjVSb0EybjZPOFVBSGU1?=
 =?utf-8?B?YlFERkRXanBjZFAvODZPVGtjMWVRTnVxMnE5enNMUU9XQVJ6bnZPVWd1WkR5?=
 =?utf-8?B?QzNrdUUyQTNseWY2ZDkyWnBpdWVqUC9Fcnl0NVZRQ0lzLzJsL3dCcy90SkV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Es3cWc0VG8yUXFqN2RFODJqd0MvMWJFdTNBcGlHaTdMS0xuQWhoaXdH?=
 =?utf-8?B?WG84WTBzQVNTZTJaTUt0K3MzcmlUTmR5NVh3VHBKRThFRWROMUk5QTdCeUFM?=
 =?utf-8?B?YzVIZkJJL3BzSUFxeVBRbUwzUTNLb1hrS3lWQUhJT2VmdFpoaytPSEJ2WGY4?=
 =?utf-8?B?dkQ1bDYxUlNYNFVuUVhvSTRRZUJpRCtpQlgxcHU1WUdGdmJQV1g1YVJpVFJ5?=
 =?utf-8?B?UEVhRWlZa1lObmxEaVFoWVpTd25jd2JqODRqdGh2WTlUWC93emhHM2ZNTC9s?=
 =?utf-8?B?VStnai9JWDJRcE03eXp0UEpuY0FnWThENDNGdFJXdVBjRnJDVXFvcnFkY0V3?=
 =?utf-8?B?dGNtZTFPcmJheWd3OE9SWHRhTlQrWktXQmJ1TUpEN0QwbmV6aEJud3NMakh2?=
 =?utf-8?B?Z2pSWldOVCttQjBvSVJleDdkYUxlUU9mMTVWQUw3VnlMKzBSNW9pVWNBT3Ju?=
 =?utf-8?B?YUp1b1BUS0VGVzJoSkxlQjQ1eXNUZjZjYWVPR0swUWhZV3pCM2J3NnMySEdz?=
 =?utf-8?B?VlFCelpQaCtkRkZBL041aGVyMVJCbmtwZUdhTDYvT252amtXWkV6NUYva1ZY?=
 =?utf-8?B?eFdOU1pMQWZQdVJpVEFaMW5zZ3hjWU4vOVhLd3lhSkplZ1puTEpCNWZOUjR2?=
 =?utf-8?B?OFhhRWJDMWMwOFdRa3ZVWS9FL3Z4clZpRGl0ZVZ2d1R3SGtiMFhsaTAzbmdu?=
 =?utf-8?Q?omgyGvrtxWnbA8qBIi0pPSGeJ?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 32de923c-e7f1-4f0d-78ef-08db82e759ff
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 14:50:36.3099
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: T/DaovDOkrklZl38YPUYoQXeCBzyEQxiGDYj+l3Ew+wRZJp91cSsD3iBEbduv7mcA+Ko/zMIDSIJFNDe2RczTg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8086

On 12.07.2023 15:53, Roger Pau MonnÃ© wrote:
> On Wed, Jul 12, 2023 at 12:07:43PM +0200, Jan Beulich wrote:
>> On 11.07.2023 15:02, Roger Pau MonnÃ© wrote:
>>> On Tue, Jul 11, 2023 at 12:53:31PM +0200, Jan Beulich wrote:
>>>> On 10.07.2023 16:43, Roger Pau MonnÃ© wrote:
>>>>> On Mon, Jul 10, 2023 at 12:56:27PM +0200, Jan Beulich wrote:
>>>>>> On 07.07.2023 11:53, Roger Pau Monne wrote:
>>>>>>> The current logic to init the local APIC and the IO-APIC does init the
>>>>>>> former first before doing any kind of sanitation on the IO-APIC pin
>>>>>>> configuration.  It's already noted on enable_IO_APIC() that Xen
>>>>>>> shouldn't trust the IO-APIC being empty at bootup.
>>>>>>>
>>>>>>> At XenServer we have a system where the IO-APIC 0 is handed to Xen
>>>>>>> with pin 0 unmasked, set to Fixed delivery mode, edge triggered and
>>>>>>> with a vector of 0 (all fields of the RTE are zeroed).  Once the local
>>>>>>> APIC is enabled periodic injections from such pin cause a storm of
>>>>>>> errors:
>>>>>>>
>>>>>>> APIC error on CPU0: 00(40), Received illegal vector
>>>>>>> APIC error on CPU0: 40(40), Received illegal vector
>>>>>>> APIC error on CPU0: 40(40), Received illegal vector
>>>>>>> APIC error on CPU0: 40(40), Received illegal vector
>>>>>>> APIC error on CPU0: 40(40), Received illegal vector
>>>>>>> APIC error on CPU0: 40(40), Received illegal vector
>>>>>>>
>>>>>>> That prevents Xen from booting.
>>>>>>
>>>>>> And I expect no RTE is in ExtInt mode, so one might conclude that
>>>>>> firmware meant to set up RTE 0 that way. Mainly as a remark, albeit
>>>>>> of course there's then the question whether to change the RTE
>>>>>> rather than masking it. What do ACPI tables say?
>>>>>
>>>>> There's one relevant override:
>>>>>
>>>>> [668h 1640   1]                Subtable Type : 02 [Interrupt Source Override]
>>>>> [669h 1641   1]                       Length : 0A
>>>>> [66Ah 1642   1]                          Bus : 00
>>>>> [66Bh 1643   1]                       Source : 00
>>>>> [66Ch 1644   4]                    Interrupt : 00000002
>>>>> [670h 1648   2]        Flags (decoded below) : 0000
>>>>>                                     Polarity : 0
>>>>>                                 Trigger Mode : 0
>>>>>
>>>>> So IRQ 0 -> GSI 2, so it's likely pin 0 is the one the i8259 is
>>>>> connected to.
>>>>
>>>> Then wouldn't we be better off converting that RTE to ExtInt? That
>>>> would allow PIC IRQs (not likely to exist, but still) to work
>>>> (without undue other side effects afaics), whereas masking this RTE
>>>> would not.
>>>
>>> I'm kind of worry of trying to automate this logic.  Should we always
>>> convert pin 0 to ExtInt if it's found unmasked, with and invalid
>>> vector and there's a source override entry for the IRQ?
>>>
>>> It seems weird to infer this just from the fact that pin 0 is all
>>> zeroed out.
>>
>> As you say in the earlier paragraph, it wouldn't be just that. It's
>> unmasked + bad vector + present source override (indicating that
>> nothing except perhaps a PIC is connected to the pin).
> 
> I can do this as a separate patch, but not really here IMO.  The
> purpose of this patch is strictly to perform the IO-APIC sanitation
> ahead of enabling the local APIC.  I will add a followup patch to the
> series, albeit I'm unconvinced we want to infer IO-APIC pin
> configuration based on firmware miss configurations.

Hmm. The question really is which of the changes we want to backport.
That one should be first. While it's largely guesswork, I'd be more
inclined to take the change that has less of an effect overall.

That said I can see that Linux have their enable_IO_APIC() calls
also ahead of setup_IO_APIC() (but after connect_bsp_APIC() and
setup_local_APIC()). IOW with your change we'd do the masking yet
earlier than them. This may of course even be advantageous, but
there may also be good reasons for the sequence they're using.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 14:56:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 14:56:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562581.879336 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJbGP-000406-0I; Wed, 12 Jul 2023 14:56:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562581.879336; Wed, 12 Jul 2023 14:56:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJbGO-0003zz-TH; Wed, 12 Jul 2023 14:56:20 +0000
Received: by outflank-mailman (input) for mailman id 562581;
 Wed, 12 Jul 2023 14:35:36 +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
 <SRS0=vScV=C6=intel.com=jani.nikula@srs-se1.protection.inumbo.net>)
 id 1qJawK-00016Z-Dg
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 14:35:36 +0000
Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5a2d191a-20c1-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 16:35:32 +0200 (CEST)
Received: from orsmga004.jf.intel.com ([10.7.209.38])
 by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 12 Jul 2023 07:35:29 -0700
Received: from pmessina-mobl.ger.corp.intel.com (HELO localhost)
 ([10.252.42.186])
 by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 12 Jul 2023 07:34:31 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5a2d191a-20c1-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1689172533; x=1720708533;
  h=from:to:cc:subject:in-reply-to:references:date:
   message-id:mime-version:content-transfer-encoding;
  bh=7EqKUdX8amzDodN7nIatZqqu7r5MTljrQuoCdn53hEQ=;
  b=a9UqAWc65MIY0tDFR7woBKTQ7PdJvKloaE11JNi6ZEGFF5k501iM06Jr
   OIdPWpNKzlHwS/I2RR2+6Bd/Ia8wQVmWo72oS4O8Bdl3iOPjUHmnQogw+
   wVdbTrsXujqJSk96HOk8a4jI8oYEGmE52vpglbv93YibVDdcWO2512vA2
   87MnV82lrcJ0h0qxmKT06OvkfjQ8SfSFZ6IwfhWdhDsyACDhtjl9S9ynF
   G0nhj4DiWY70mZcfWvZ/yCxF1Oep7Mf9moWDXEYlLJTisyqovkyNxfr/9
   6d3ET/5hSkyY520f9Y4Yg5UPOZdk++rH58NkCtJJ3Z5h2y5g2RXke0GB7
   g==;
X-IronPort-AV: E=McAfee;i="6600,9927,10769"; a="428641969"
X-IronPort-AV: E=Sophos;i="6.01,199,1684825200"; 
   d="scan'208";a="428641969"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10769"; a="845686939"
X-IronPort-AV: E=Sophos;i="6.01,199,1684825200"; 
   d="scan'208";a="845686939"
From: Jani Nikula <jani.nikula@intel.com>
To: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	Alex Deucher <alexander.deucher@amd.com>,
	Christian =?utf-8?Q?K=C3=B6nig?= <christian.koenig@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>, Harry
 Wentland <harry.wentland@amd.com>, Leo Li <sunpeng.li@amd.com>, Rodrigo
 Siqueira <Rodrigo.Siqueira@amd.com>, Hamza Mahfooz <hamza.mahfooz@amd.com>,
	Javier Martinez Canillas <javierm@redhat.com>,
	Guchun Chen <guchun.chen@amd.com>,
	Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
	Evan Quan <evan.quan@amd.com>, Likun Gao <Likun.Gao@amd.com>,
	Marek =?utf-8?B?T2zFocOhaw==?= <marek.olsak@amd.com>,
	David Francis <David.Francis@amd.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>,
	Graham Sider <Graham.Sider@amd.com>, Lang Yu <Lang.Yu@amd.com>,
	Philip Yang <Philip.Yang@amd.com>,
	Yifan Zhang <yifan1.zhang@amd.com>, Tim Huang <Tim.Huang@amd.com>,
	Zack Rusin <zackr@vmware.com>, Sam Ravnborg <sam@ravnborg.org>,
	xurui <xurui@kylinos.cn>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	=?utf-8?Q?Ma=C3=ADra?= Canal <mairacanal@riseup.net>,
	=?utf-8?Q?Andr=C3=A9?= Almeida <andrealmeid@igalia.com>,
	Qingqing Zhuo <qingqing.zhuo@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>, Hersen
 Wu <hersenxs.wu@amd.com>, Fangzhi Zuo <jerry.zuo@amd.com>,
	Stylon Wang <stylon.wang@amd.com>, Alan Liu <haoping.liu@amd.com>,
	Wayne Lin <Wayne.Lin@amd.com>, Aaron Liu <aaron.liu@amd.com>,
	Melissa Wen <mwen@igalia.com>,
	Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>, David
 Tadokoro <davidbtadokoro@usp.br>, Wenjing Liu <wenjing.liu@amd.com>,
 Jiapeng
 Chong <jiapeng.chong@linux.alibaba.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
	Roman Li <roman.li@amd.com>,
	=?utf-8?Q?Joaqu=C3=ADn?= Ignacio =?utf-8?Q?Aramend=C3=ADa?=
 <samsagax@gmail.com>,
	Dave Airlie <airlied@redhat.com>,
	Russell King <linux@armlinux.org.uk>,
	Liviu Dudau <liviu.dudau@arm.com>, Joel Stanley <joel@jms.id.au>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	Inki Dae <inki.dae@samsung.com>, Seung-Woo
 Kim <sw0312.kim@samsung.com>, Kyungmin Park <kyungmin.park@samsung.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Stefan Agner <stefan@agner.ch>, Alison Wang <alison.wang@nxp.com>,
	Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
	Noralf =?utf-8?Q?Tr=C3=B8nnes?= <noralf@tronnes.org>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Tian Tao <tiantao6@hisilicon.com>,
	Danilo Krummrich <dakr@redhat.com>,
	Deepak Rawat <drawat.floss@gmail.com>, Joonas
 Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Ville =?utf-8?B?U3lyasOkbMOk?= <ville.syrjala@linux.intel.com>, Lucas De
 Marchi <lucas.demarchi@intel.com>,
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>, Matt
 Roper <matthew.d.roper@intel.com>,
	Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
	Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
	Hans de Goede <hdegoede@redhat.com>, Luca
 Coelho <luciano.coelho@intel.com>,
	Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Vinod Govindapillai <vinod.govindapillai@intel.com>,
	=?utf-8?Q?=C5=81ukasz?= Bartosik <lb@semihalf.com>,
	Anusha Srivatsa <anusha.srivatsa@intel.com>, Chaitanya
 Kumar Borah <chaitanya.kumar.borah@intel.com>,
	Uma Shankar <uma.shankar@intel.com>, Imre Deak <imre.deak@intel.com>,
	Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
	Swati Sharma <swati2.sharma@intel.com>,
	Jouni =?utf-8?Q?H=C3=B6gander?= <jouni.hogander@intel.com>,
	Mika Kahola <mika.kahola@intel.com>,
	=?utf-8?Q?Jos=C3=A9?= Roberto de Souza <jose.souza@intel.com>,
	Arun R Murthy <arun.r.murthy@intel.com>,
	Gustavo Sousa <gustavo.sousa@intel.com>, Khaled
 Almahallawy <khaled.almahallawy@intel.com>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	Andi Shyti <andi.shyti@linux.intel.com>,
	Nirmoy Das <nirmoy.das@intel.com>, Fei Yang <fei.yang@intel.com>, Animesh
 Manna <animesh.manna@intel.com>, Deepak R Varma <drv@mailo.com>, "Jiri
 Slaby
 (SUSE)" <jirislaby@kernel.org>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Vandita Kulkarni <vandita.kulkarni@intel.com>,
	Suraj Kandpal <suraj.kandpal@intel.com>,
	Manasi Navare <manasi.d.navare@intel.com>,
	Drew Davenport <ddavenport@chromium.org>,
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Marian Cichy <m.cichy@pengutronix.de>, Dan
 Carpenter <error27@gmail.com>, Paul Cercueil <paul@crapouillou.net>, Anitha
 Chrisanthus <anitha.chrisanthus@intel.com>,
	Edmund Dea <edmund.j.dea@intel.com>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>, Neil
 Armstrong <neil.armstrong@linaro.org>, Kevin Hilman <khilman@baylibre.com>,
	Rob Clark <robdclark@gmail.com>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Vinod Polimera <quic_vpolimer@quicinc.com>,
	Jiasheng Jiang <jiasheng@iscas.ac.cn>,
	Konrad Dybcio <konrad.dybcio@linaro.org>, Jessica
 Zhang <quic_jesszhan@quicinc.com>, Liu Shixin <liushixin2@huawei.com>,
 Marek
 Vasut <marex@denx.de>, Ben Skeggs <bskeggs@redhat.com>,
	Karol Herbst <kherbst@redhat.com>, Lyude Paul <lyude@redhat.com>,
	Tomi Valkeinen <tomba@kernel.org>, Emma Anholt <emma@anholt.net>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Sandy Huang <hjc@rock-chips.com>, Heiko =?utf-8?Q?St=C3=BCbner?=
 <heiko@sntech.de>, Orson
 Zhai <orsonzhai@gmail.com>, Baolin Wang <baolin.wang@linux.alibaba.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Alain Volmat <alain.volmat@foss.st.com>,
	Yannick Fertre <yannick.fertre@foss.st.com>,
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
	Philippe Cornu <philippe.cornu@foss.st.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Thierry Reding <thierry.reding@gmail.com>, Mikko
 Perttunen <mperttunen@nvidia.com>, Jonathan Hunter <jonathanh@nvidia.com>,
	Jyri Sarha <jyri.sarha@iki.fi>, David Lechner <david@lechnology.com>,
 Kamlesh
 Gurudasani <kamlesh.gurudasani@gmail.com>,
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
	Melissa Wen <melissa.srw@gmail.com>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Michal Simek <michal.simek@amd.com>
Cc: dri-devel@lists.freedesktop.org, kernel@pengutronix.de,
	amd-gfx@lists.freedesktop.org, Andrew Jeffery <andrew@aj.id.au>,
	linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Alim
 Akhtar <alim.akhtar@samsung.com>, linux-samsung-soc@vger.kernel.org, Xinwei
 Kong <kong.kongxinwei@hisilicon.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Yongqin Liu <yongqin.liu@linaro.org>,
	John Stultz <jstultz@google.com>, linux-hyperv@vger.kernel.org,
	intel-gfx@lists.freedesktop.org, Lucas
 Stach <l.stach@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, NXP Linux
 Team <linux-imx@nxp.com>, linux-mips@vger.kernel.org, AngeloGioacchino Del
 Regno <angelogioacchino.delregno@collabora.com>,
	linux-mediatek@lists.infradead.org,
	Jerome Brunet <jbrunet@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-amlogic@lists.infradead.org, Sean Paul <sean@poorly.run>, Marijn
 Suijten <marijn.suijten@somainline.org>, linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org,
	spice-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org,
	linux-rockchip@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org,
	Gurchetan Singh <gurchetansingh@chromium.org>,
	Chia-I Wu <olvaffe@gmail.com>,
	Haneen Mohammed <hamohammed.sa@gmail.com>,
	VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
In-Reply-To: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
Date: Wed, 12 Jul 2023 17:34:28 +0300
Message-ID: <87fs5tgpvv.fsf@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Wed, 12 Jul 2023, Uwe Kleine-K=C3=B6nig <u.kleine-koenig@pengutronix.de>=
 wrote:
> Hello,
>
> while I debugged an issue in the imx-lcdc driver I was constantly
> irritated about struct drm_device pointer variables being named "dev"
> because with that name I usually expect a struct device pointer.
>
> I think there is a big benefit when these are all renamed to "drm_dev".
> I have no strong preference here though, so "drmdev" or "drm" are fine
> for me, too. Let the bikesheding begin!
>
> Some statistics:
>
> $ git grep -ohE 'struct drm_device *\* *[^ (),;]*' v6.5-rc1 | sort | uniq=
 -c | sort -n
>       1 struct drm_device *adev_to_drm
>       1 struct drm_device *drm_
>       1 struct drm_device          *drm_dev
>       1 struct drm_device        *drm_dev
>       1 struct drm_device *pdev
>       1 struct drm_device *rdev
>       1 struct drm_device *vdev
>       2 struct drm_device *dcss_drv_dev_to_drm
>       2 struct drm_device **ddev
>       2 struct drm_device *drm_dev_alloc
>       2 struct drm_device *mock
>       2 struct drm_device *p_ddev
>       5 struct drm_device *device
>       9 struct drm_device * dev
>      25 struct drm_device *d
>      95 struct drm_device *
>     216 struct drm_device *ddev
>     234 struct drm_device *drm_dev
>     611 struct drm_device *drm
>    4190 struct drm_device *dev
>
> This series starts with renaming struct drm_crtc::dev to drm_dev. If
> it's not only me and others like the result of this effort it should be
> followed up by adapting the other structs and the individual usages in
> the different drivers.

I think this is an unnecessary change. In drm, a dev is usually a drm
device, i.e. struct drm_device *. As shown by the numbers above.

If folks insist on following through with this anyway, I'm firmly in the
camp the name should be "drm" and nothing else.


BR,
Jani.


--=20
Jani Nikula, Intel Open Source Graphics Center


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 15:09:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 15:09:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562594.879346 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJbSz-0005hB-5O; Wed, 12 Jul 2023 15:09:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562594.879346; Wed, 12 Jul 2023 15:09:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJbSz-0005h4-1n; Wed, 12 Jul 2023 15:09:21 +0000
Received: by outflank-mailman (input) for mailman id 562594;
 Wed, 12 Jul 2023 15:09:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8Wak=C6=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJbSx-0005gy-60
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 15:09:19 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0604.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::604])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 124ca65b-20c6-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 17:09:18 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AS8PR04MB7575.eurprd04.prod.outlook.com (2603:10a6:20b:29c::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Wed, 12 Jul
 2023 15:09:16 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Wed, 12 Jul 2023
 15:09:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 124ca65b-20c6-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=jBPmDsZzX+DSJUC/QwnX5jJok1095aEuOiuBf9RcrJWTiYpxrnYrrG86VhivrwXVLZoZYW7k3AH5e9F19wrZWzOkcFT3Cgka/5ZkF/4wOwBpsUuHzH8aRXv9llCkT9ytvTjnX9Vc2cy/uyXYyRhEngfbFmlZjYaAVQNg1Nwm0+7Z2jvHIn4a84L4DA5oi5ajPow476a06IgfpKZTi2x1Fo7p5ernPNNjai4aVcmX7fDESvj4warGJ46nKz13KrnzGggyUAgJx/aYl0hQboI97aNMw7+DmdISF++2sCCjw+EMm1xnLwF4fesCpQUcNYvum3DB9nDcvXrtIvJPTFWvng==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=wm70FUsX5KjiAsWaedna3TwjjujG0aJ9RtEpykIh6i4=;
 b=fiPhUIHJ3NxIU8Vg4JF8GdHXsrw/dLlsWx6CLeNbkjW4xFhatUW09uTd1JgogDDrf9k8bYpK1PDMwsdussXaTsCei8dO9/XqLlaOz4NaC6Xb+1YMe8afkRcozuDOpWTv2u0lQw1wrJStfNxzTRi0l+slmFWBJQh2L50zOCAkkcXxDgjhrbQ/V7ofKvSsGYyDbROHZocTTPWOv5f4zG/ETFQ081S9qGVK+ntC81CLeUVOU5Z7TQICFuP8tTGN7mOZhR2r0UbEbicUzRUwy73jHC7Mp93SMVigrCeSrHxO5DzArjb6sTdixcTKcn0bbbtyDB6vkCdevAfklH1fTJLRBw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=wm70FUsX5KjiAsWaedna3TwjjujG0aJ9RtEpykIh6i4=;
 b=3F8gzg7M42zB0NcEdlMRple25Sq7UwraKo7P+Zg27TFsf/oHCXKDGA9EXfRBo6RMvEsxPplnNRYbEWF1smJJZOEeWNL0Xq5J7KUrFg5Z6LFnPEMDEjBIBvcetBmtKBNrTlNqPBQkWlW5ZqVdRey5pj4HhqLtKbNKDdy3QGb4Qtuvl1idVLEf0LtKreJkrFPdkByBowT1oRNfDEdEk3t5A7tie6nXUN7jZRT9sDzND3AjRr30yqw+Y1UXI9hV0jmabqUCZNy4ZBMUduGqco6g4FPHgfAfaK+hCgkHvmRyxoMZRqMVaxNoI+X1lhcaArejhHc3J7g6XSFPdVPBwPzxVA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <561ec830-d3cb-3f47-00ed-219cc03108d0@suse.com>
Date: Wed, 12 Jul 2023 17:09:14 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: Violations of mandatory MISRA C:2012 Rule 19.1 in X86_64 build
Content-Language: en-US
To: Roberto Bagnara <roberto.bagnara@bugseng.com>
References: <fa2bc5da-b866-05ac-409f-c26e025428c3@bugseng.com>
Cc: xen-devel@lists.xenproject.org, Andrew Cooper
 <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <fa2bc5da-b866-05ac-409f-c26e025428c3@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0074.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1e::20) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AS8PR04MB7575:EE_
X-MS-Office365-Filtering-Correlation-Id: 429ee0f3-7c28-4d19-f3ac-08db82e9f58e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	d65LMXgyMhocHiiehtXRroqo5RJTh8DqRb/iMnhSJgmBV3V6sTLk+SkMtfh28Gpv7JCF5MKUNEI3qTT3vQSkFOL3DPdUQ50ThAmSwIBb6PFMDw0/tPWTmpLKq9GXYzdx9dP8zVtLob1j9aWfY7VXWgAQKho9iD5FO5j1q+G7QMMCkD2zIa7xCIY+/aXnb8wHQxy+NQM7VumYkPxb0Q5RFdBPzOgH6i3WQjSHS2U1DXp+UDKeczsx9cJAYqXtDSlvjhoZAMkz3U4SQbd9ivdBrOddG3ASV24W30DkmxJ2wzzhsDtf2S0a1sR7+GkVYF98X/e4liXT0hq9KvPcRgPJJDbvnlDDr5VCeDivGjyF5ZJzGDIKrLqW43HVMKlC+pm3V35JGHbhM1SFnvdMt+eZXUBPM8z2Z5UeTi8KbDe1U8BxvhByGJ1sfILs+BDa4FYde1UdEY4x5K/3BdZeLRiQ2kItSHWKwEBqZqCOa1pOtib/k0Et4Fpz1PuXZ/HoCVNEsHSWK6LBCIFAWAIPVuyPdx1JWp7JqY/vgFxn3liDNUxXrcNXhTgs4qv5F28dNMoKiHvImkCFMXq50lysZ1E7WzysV+JH1aO4uJXbd2A/GessWQzSNvjSQggzOy/mt5ai
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(39860400002)(376002)(366004)(136003)(346002)(451199021)(186003)(66899021)(41300700001)(26005)(5660300002)(6506007)(478600001)(53546011)(8936002)(54906003)(66556008)(2906002)(6486002)(2616005)(4326008)(36756003)(6916009)(66946007)(66476007)(8676002)(31696002)(86362001)(31686004)(316002)(6512007)(966005)(38100700002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UXZRZ3ZUU1RmV3UwRjlPeHVLV0dscGhvbFNHanVhMFlDcTlZTTduYTJ1bW9F?=
 =?utf-8?B?MDVvVC9QeGRhSGVCRWpvK3QyaGlsM1kxbUVwWXdVTTdrQWVGb3FiUUJUNlBU?=
 =?utf-8?B?cC91bG1yRDZsbWtOTU1sMG5QM3ZrYlV5d1ZGTWlHVkIyN2VZK05SS0k0WHcv?=
 =?utf-8?B?UGVHVSt3aS9oUW5jc2pCTlBYSkdVYlVWRWR3SXBGTjRMYU9LbVdHM0tsd2lS?=
 =?utf-8?B?aGVmenFSVzBEM3R5Q216SGdNUmwxeGNxRHB2RlFIRkhQN3YwdHROajhPS3V1?=
 =?utf-8?B?anRvM3FUYWxQZnNRYTJxaDR0Q3o2WmxGL0xxY1ZQcU5HTlVtSFhjS2xYK1Zh?=
 =?utf-8?B?WHFJUGV6bG5DZ0p2czNMd1RETXM4N2xUcERNT042aWNhK0RnODc0UFc1ckU3?=
 =?utf-8?B?TTR3Mi96QXlnL0Q2am9KdU1mQndYU0dWUTBpM1lEMXIyN0MxTERoTmtzMi9D?=
 =?utf-8?B?aVhhd2NoWXR5YmdseVFKMW9nUFVGRlp5RjlaNzI2UGRkaFZLb2ZFTUdKVVRs?=
 =?utf-8?B?Y2lJYmpOcWhpYU1QbTVrNUp5RkYyL0xGUGhacHRIY2hEbDNtMlpXem1kYkpq?=
 =?utf-8?B?WXZPQm1ZZmJ5SStlL212VTdnUmw4WW9HVUxUaVFGcWtvVnp0dWVTWW85eFJr?=
 =?utf-8?B?TWRUOHd1N3pEb3ZUUmxjNlk0YlFjVzVyQ0UySWl0ZGpRWmFOWjdnUTI3azVE?=
 =?utf-8?B?bGwyU1g4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6L0JmZEdyU2VkdC9p?=
 =?utf-8?B?Ykg0c3Q5NUZRa0lvZlZYR2ZxK0FQcVNmaGhGNC9lelIwZy9OeEdodW92LzV0?=
 =?utf-8?B?eDF5eUpNWG90cHFaclBXYUtUQ0lFVFhmcDI4NjJYTjVWL0JhZHgrZW5MWmFm?=
 =?utf-8?B?SmZCOUZqMk5yWW11a2hXOHFKd2U3WkR3dlRIT3QraDNpcnk3MWdMTHlwSHhY?=
 =?utf-8?B?aWhLRUZ1eHRGaWxnRHErck1EQjFFQUR5aFY1ZXg5TWl1S1ZKaC83VHFwLzV4?=
 =?utf-8?B?cHBpdWZ5Q1IyVUw1bWJybUVpWTQzV0JQL2haMGMrRUJDQnU1ekNLV2Yza3JP?=
 =?utf-8?B?UVZjRG1FWGNOSXUvcEoyMWVpSWRidmYvZFR2WlI2dFFhWE5URDVWY0tVaWR5?=
 =?utf-8?B?UkJPdERnMWtJS3ppeU9vcVpSZHhRTnlyRnQ2cCtxL1E4dnVzdXFLYWNlZkdo?=
 =?utf-8?B?NDZCdGw4ZnVGQzJhWkpOVU5jRGRZM0w2Q3g2YTBuWnRzY24xU0pEZ25BZVpm?=
 =?utf-8?Q?hHZV0Ixi5/Yw9UQt3Cpq6fHNr?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 429ee0f3-7c28-4d19-f3ac-08db82e9f58e
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 15:09:16.2638
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 8e2K85rV8+Pb6wkBMB49REyjmUX1xuIwHpBY6nM3ItDYcYEFynliQul/bqeND/rhpMT1iPsntWKvx3C2bspd9Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7575

On 11.07.2023 18:40, Roberto Bagnara wrote:
> Mandatory Rule 19.1 (An object shall not be assigned or copied to an
> overlapping object) is directly targeted at two undefined behaviors,
> one of which is the subject of 6.5.16.1p3, namely:
> 
>    If the value being stored in an object is read from another object
>    that overlaps in any way the storage of the first object, then the
>    overlap shall be exact and the two objects shall have qualified or
>    unqualified versions of a compatible type; otherwise, the behavior
>    is undefined.
> 
> You can see a number of definite violations in the X86_64 build
> at this link:
> 
>    https://saas.eclairit.com:3787/fs/var/local/eclair/XEN.ecdf/ECLAIR_normal/origin/staging/X86_64-Set1/149/PROJECT.ecd;/by_service/MC3R1.R19.1.html

Just to summarize: Except for one instance, all follow the same pattern
of extending in-place a (guest) register value. Sometimes in straight
line code (typically eip -> rip), otherwise in get_rep_prefix() (esi ->
rsi and edi -> rdi). I continue to think that the way we have it is the
best way for it to be written; as per an earlier reply I also can't see
how even a "malicious" compiler (still aiming at generating correct
code, just not necessarily doing things the "obvious" way) could break
those cases. (I understand none of this is going to help, yet I'd like
to clarify that sometimes overly strict rules are getting in the way,
like here forcing use to e.g. switch to using casts when we'd like to
avoid doing so.)

The one other instance is in compat multicall handling. There I guess
the compiler could indeed do things "the wrong way". Any solution there
that I can think of would involve an auxiliary on-stack array, to first
copy into and then out of. That's not very efficient, so I wonder what
your suggestion would be how to deal with such a case.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 15:42:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 15:42:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562609.879356 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJbyv-0001jW-O0; Wed, 12 Jul 2023 15:42:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562609.879356; Wed, 12 Jul 2023 15:42:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJbyv-0001jP-KO; Wed, 12 Jul 2023 15:42:21 +0000
Received: by outflank-mailman (input) for mailman id 562609;
 Wed, 12 Jul 2023 15:42:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=65J3=C6=citrix.com=prvs=55084c2ea=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qJbyu-0001jJ-PJ
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 15:42:20 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id adf36a00-20ca-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 17:42:18 +0200 (CEST)
Received: from mail-dm6nam10lp2101.outbound.protection.outlook.com (HELO
 NAM10-DM6-obe.outbound.protection.outlook.com) ([104.47.58.101])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 12 Jul 2023 11:42:09 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by BL1PR03MB6037.namprd03.prod.outlook.com (2603:10b6:208:309::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 15:42:00 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::fb95:b992:be69:7fa2%5]) with mapi id 15.20.6565.028; Wed, 12 Jul 2023
 15:42:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: adf36a00-20ca-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689176538;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=06yPJ4cqjP/zHQjGZG2AEE1mboBtpf1ZrVOqnQEbrqo=;
  b=FuoRTA9Q36KH0Tla8laFpphoOSDa3SDPnUTRriTiBON6kJMqm3tMadP8
   8K6dng13NJGgzyPGeExqwPc6TSwgW1zJGPM2ux26fqh/JzeiDwuxA83rK
   PhrDYuTVgBgMIrL+CrGyrpfT4aTDxRym9Qf0SEmUg+8GaRNWEO2KjOVe/
   o=;
X-IronPort-RemoteIP: 104.47.58.101
X-IronPort-MID: 118569263
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:CVwKSqjopMKLEfHfo8w44UPjX161RhEKZh0ujC45NGQN5FlHY01je
 htvWW2DP6zeNjegfNx3Pd7ioRwAscTSndYwSgo9pSowFyIb9cadCdqndUqhZCn6wu8v7q5Ex
 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv
 cKai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6p6/WEYhqLY?=
 =?us-ascii?q?XgfHYOhFSAQqWsjviFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,200,1684814400"; 
   d="scan'208";a="118569263"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Y0Yoc+jFwM7A3ZMVBAZDYqyp4MggeRSlBqk6tODErs5iTFlB1d/QBiRYohd8xYjPRwnoNvVjZAEq2QtP639U1WTXIxsSl/VeSEWH95IFUzRTgmXWupX8op4HJLfSAJSwpCpk+mm5OmfblqPz+arcubEwPBRK0ZfAuSpmAJJnzeYDIRP+HNVRlzFa/oHdxjJFgiMNpZaiMnzre0PdzuhiAzi2YEQbBIVvJkwLnbMzlTdrU/AamzNLamN6SjcBo+v3UbZ3kRQ8H4KPZbkjeQQQe1yS71sRUDSRJa3O9OkPTiszccohqrybdcvEO3Z8mBoHkjMzHi7173idp9yPAAdmOQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=G/IRc1XeWGs0W6e4UVFb3G6LChKbmKKuFcLi12nb4ZE=;
 b=F3G9SNj6sEAqAikU/Y/yCYoT0ZQtuUAzYc59D/uOBOfchMsu7vcr5Ulz4qFw7s3aZgrcCVnyW12m44awKgitWxsii/nRUhiIT+5OUjJvVjeL3LXk3M1BkwLub02jtLKqxgzqsIEbUxOpLAVIkJDnPXjVXOrgvu2Dx35tqIr3rTTlfwApP3zOw7uykH2TSlIGXvD9kdAQyP1/o0ZWKImeVJxb47FsfcCR1cY2xQZYz1vE4APrdPYdbLVku1QgKI/O03Z+93p+EDmYp7gBE5oVv+IV1RE09cif72U6/taS4GofSugY0otQ2IE0RFtHRwl3bYWRvH+78N5XxZvKhAjXPw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=G/IRc1XeWGs0W6e4UVFb3G6LChKbmKKuFcLi12nb4ZE=;
 b=pRMZ4bWfcXMjHvRWY/P8MZW9jmkcDN7STPRV+mfZqBsFQtXVfwlr47M+w3eR2pjR20JyayUc4Ck4GEFbkdy0qZ1bOmhhACHsuhr1bd/TaQk9jxT3Fk8rklo5qe2R3H8BaRVjjZ/qkz+0YXpvzVv5ltm1ACQBxbMCeU4ghtjxvbA=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Wed, 12 Jul 2023 17:41:52 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] x86/ioapic: sanitize IO-APIC pins before enabling the
 local APIC
Message-ID: <ZK7JwEhrB-70nlla@MacBook-Air-de-Roger.local>
References: <20230707095338.44244-1-roger.pau@citrix.com>
 <92d16012-ff9f-693b-07c6-d45fe07a00a0@suse.com>
 <ZKwZBQ_0Z2c7NJNL@MacBook-Air-de-Roger.local>
 <1f79491a-46f5-5293-e92f-0e2b0b3efb62@suse.com>
 <ZK1S1V71ZUIPjKqZ@MacBook-Air-de-Roger.local>
 <eb2e3b57-a423-cf52-0192-a344db33a58f@suse.com>
 <ZK6wcpHnh5OgHv4R@MacBook-Air-de-Roger.local>
 <d84482f4-8be6-e514-58a7-a529890c8feb@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <d84482f4-8be6-e514-58a7-a529890c8feb@suse.com>
X-ClientProxiedBy: LO2P265CA0003.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:62::15) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|BL1PR03MB6037:EE_
X-MS-Office365-Filtering-Correlation-Id: 9c1f79e4-cbb0-4805-d843-08db82ee87c8
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	QpfEEkxD9LYAkhs2g+hi1MwlFw888rJDHY7gfMi+PXw7eG/pE3XgfsGy2oL1TrwXggg6CntUtkuGfINs/sOKvem/HCRTmKCgyKEBd0G13U/qJ/59YZWUZ3kt90rY9R+cel9d//qRD/RaXreyPuaaUA2+XbW0FIm0FM328R8yWhNRyJ3/+qtyXT5sAuN5tRIrl8qQWFZL/wYaMeq2tCEa5jp54x7tsyojZTQJYSjFPpJuT4QNRvrFDruOV46zC7M9GgiEZoexuu9arTeZpJiHsgIhvUyEy3I4Z9IQsNb0oc4PkqwiZuo/CaQA+662wTwcl0k+H1vgMT0Wz5pPoX+tr23LnXjRr61bLRtTiLDC5Cskz+4AwzSy2fIHoSlrGTdOleKxpSNJpAw5vvvs0NSMKS5cbp0Ce7hm/zJ3RFkoOoLIQLbkHd+I9Ly80vLdW/LTAMJZSE9tVekalw3xkL2BQARogAlw7hWntMxd3PzCmmIuu3pIpKm5tKX4YXyrEKIq04a7H4vwSyWDtc3iBtg/3LVMRjXZDOV/z4HVxOng2TdXNrEhKV9vCG02hrI1Runc
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(346002)(366004)(136003)(396003)(451199021)(54906003)(82960400001)(38100700002)(66946007)(478600001)(4326008)(6916009)(66556008)(66476007)(6666004)(85182001)(316002)(6512007)(83380400001)(86362001)(5660300002)(41300700001)(2906002)(26005)(8676002)(6506007)(8936002)(6486002)(186003)(53546011)(9686003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bm9UbUJMV0hXeVZ6bEk5NExPd1dIVDljeHY4a3VZSUVNaWtxWEJqQVdFWTF2?=
 =?utf-8?B?eUhTT1JUbnNQMXdVYWF4bHkybWVLaEdKTnFUVlpHQUFGY0tZc05DakFCSFV2?=
 =?utf-8?B?VjZWNDMwMnpZa1Y5QjA3RmNHTGd2OHprbncwVFFkRkhWMTc2T1FCTmEwcVZY?=
 =?utf-8?B?RzB6UUdaWFAvTG5MMEVRK1hvTHpaZVdkdVFUSDRudWkxeGlNQnRRNExnYXJo?=
 =?utf-8?B?UUt3b2ozVkdiVTdFNHcvRzFtQm0rd1ZITGRTVWYrRFpMcDZaSVdnQ2dFclZ3?=
 =?utf-8?B?bFFTdHdyKzlZR2oyQ1VYMWhrYTBVMHEyQ2lyeHlGZFJzUXFRejdabU1KejRQ?=
 =?utf-8?B?blJlN1gxckdibjg5Mkk4emFpU0FjbXZWR3kzdXZxeGJsNmFCL0paMVhWMGg4?=
 =?utf-8?B?SkE0ZGNZYXJWektIVEpab3BYZFFZWFpXWVZDbHR4VVZ4SWpMUE1mcFFxejlB?=
 =?utf-8?B?OU5ZWHlPSmJxY2J6M1NOdkhnUFFjcWt4THNJVlFranBUZVRtckkrQ1krV0Vp?=
 =?utf-8?B?Tk5QN0NFcVdFMDlRSzFoV2xLVFJ5RkN6VEtnSUlNWEJ5TX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oWxHIHXN01P6Yk+lzAvaK+2r/bkZow86tz50wpM46ZnPuP8jRjhxuF9YAkMEO5KsjTCxMpnsg3jfzVvh9r8E62EFM+ldyVgWP+z92rykYF2ik4l22kL7Kvkfb111rEYX1a5it8eARSwPRFfEdOubGLLyW+EdmM4tdKtUTP8KL9uvm0yuij9nizS/SZRmYxeph7qmkWuKkAJMDjsKh5262Fd6uPsCxNXkvNRjKC+axY6oCk8NpNKKyfU/Ypk+CAAzHUGj5KeQPvvb8wrSOUFrm2rqMEq3JJayFxalLN7Re54CDeJIcsq5GtHk3mz9qz/m4zqkYcMp4fC1CAqIor2lGj38tsERes5BYdsP6yGH0PrYlqteIoOGqj9nSpKDNiuFZKun676UorBahWGVzRG6q0Jk5kQymJMnMHlAp9+aw+vfPaGWNXv+ZUvlQhAny3+KJ4Bx9ze0Nbj4gJhWEOc5u8uGoLSRB1R5TZiUB4BVGR5wSvPQ+GZ0CQJaFeKIJdC7u1zu4wdBc7JMgl1QKbKG0YJentRx5/kJyhv4ncxPmFpLDeBPYsHBEHz6huYoy0iG4QOosFmHX3gg3HqRItbx4P5R0Ui7RCHSZE5nOdUJog+TwMN/piqbKYNcVPOCAWdKgnVU1d6l1GekrqBVm5YabBBmOO+Sq0thk3EOx2xnnMYOJ5VByKu0qgDRk6JVTB2BuRIU2i7j93AF6gqobh2hJMjcFs5rnF2qA/Z
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9c1f79e4-cbb0-4805-d843-08db82ee87c8
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 15:41:59.8454
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: zSedEGBBsgp3B8cMuK3S3WlnWxet7Zui36dXyoCr2AxMysbD+Or6vhaC/UKIt6dfcYjZypPwPiB08NVH4rhJwg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR03MB6037

On Wed, Jul 12, 2023 at 04:50:34PM +0200, Jan Beulich wrote:
> On 12.07.2023 15:53, Roger Pau MonnÃ© wrote:
> > On Wed, Jul 12, 2023 at 12:07:43PM +0200, Jan Beulich wrote:
> >> On 11.07.2023 15:02, Roger Pau MonnÃ© wrote:
> >>> On Tue, Jul 11, 2023 at 12:53:31PM +0200, Jan Beulich wrote:
> >>>> On 10.07.2023 16:43, Roger Pau MonnÃ© wrote:
> >>>>> On Mon, Jul 10, 2023 at 12:56:27PM +0200, Jan Beulich wrote:
> >>>>>> On 07.07.2023 11:53, Roger Pau Monne wrote:
> >>>>>>> The current logic to init the local APIC and the IO-APIC does init the
> >>>>>>> former first before doing any kind of sanitation on the IO-APIC pin
> >>>>>>> configuration.  It's already noted on enable_IO_APIC() that Xen
> >>>>>>> shouldn't trust the IO-APIC being empty at bootup.
> >>>>>>>
> >>>>>>> At XenServer we have a system where the IO-APIC 0 is handed to Xen
> >>>>>>> with pin 0 unmasked, set to Fixed delivery mode, edge triggered and
> >>>>>>> with a vector of 0 (all fields of the RTE are zeroed).  Once the local
> >>>>>>> APIC is enabled periodic injections from such pin cause a storm of
> >>>>>>> errors:
> >>>>>>>
> >>>>>>> APIC error on CPU0: 00(40), Received illegal vector
> >>>>>>> APIC error on CPU0: 40(40), Received illegal vector
> >>>>>>> APIC error on CPU0: 40(40), Received illegal vector
> >>>>>>> APIC error on CPU0: 40(40), Received illegal vector
> >>>>>>> APIC error on CPU0: 40(40), Received illegal vector
> >>>>>>> APIC error on CPU0: 40(40), Received illegal vector
> >>>>>>>
> >>>>>>> That prevents Xen from booting.
> >>>>>>
> >>>>>> And I expect no RTE is in ExtInt mode, so one might conclude that
> >>>>>> firmware meant to set up RTE 0 that way. Mainly as a remark, albeit
> >>>>>> of course there's then the question whether to change the RTE
> >>>>>> rather than masking it. What do ACPI tables say?
> >>>>>
> >>>>> There's one relevant override:
> >>>>>
> >>>>> [668h 1640   1]                Subtable Type : 02 [Interrupt Source Override]
> >>>>> [669h 1641   1]                       Length : 0A
> >>>>> [66Ah 1642   1]                          Bus : 00
> >>>>> [66Bh 1643   1]                       Source : 00
> >>>>> [66Ch 1644   4]                    Interrupt : 00000002
> >>>>> [670h 1648   2]        Flags (decoded below) : 0000
> >>>>>                                     Polarity : 0
> >>>>>                                 Trigger Mode : 0
> >>>>>
> >>>>> So IRQ 0 -> GSI 2, so it's likely pin 0 is the one the i8259 is
> >>>>> connected to.
> >>>>
> >>>> Then wouldn't we be better off converting that RTE to ExtInt? That
> >>>> would allow PIC IRQs (not likely to exist, but still) to work
> >>>> (without undue other side effects afaics), whereas masking this RTE
> >>>> would not.
> >>>
> >>> I'm kind of worry of trying to automate this logic.  Should we always
> >>> convert pin 0 to ExtInt if it's found unmasked, with and invalid
> >>> vector and there's a source override entry for the IRQ?
> >>>
> >>> It seems weird to infer this just from the fact that pin 0 is all
> >>> zeroed out.
> >>
> >> As you say in the earlier paragraph, it wouldn't be just that. It's
> >> unmasked + bad vector + present source override (indicating that
> >> nothing except perhaps a PIC is connected to the pin).
> > 
> > I can do this as a separate patch, but not really here IMO.  The
> > purpose of this patch is strictly to perform the IO-APIC sanitation
> > ahead of enabling the local APIC.  I will add a followup patch to the
> > series, albeit I'm unconvinced we want to infer IO-APIC pin
> > configuration based on firmware miss configurations.
> 
> Hmm. The question really is which of the changes we want to backport.
> That one should be first. While it's largely guesswork, I'd be more
> inclined to take the change that has less of an effect overall.

My views would be the other way around I think.  Current code already
has a comment to notice that IO-APIC pins might be wrongly unmasked,
and there's also logic for masking them when the IO-APICs are
initialized.  The fact that such logic is placed after the local APIC
has been initialized is IMO a bug, as having unmasked unconfigured
IO-APIC pins when the local APIC is enabled should be avoided.

> That said I can see that Linux have their enable_IO_APIC() calls
> also ahead of setup_IO_APIC() (but after connect_bsp_APIC() and
> setup_local_APIC()). IOW with your change we'd do the masking yet
> earlier than them. This may of course even be advantageous, but
> there may also be good reasons for the sequence they're using.

Linux calls enable_IO_APIC() before setting up the local
APIC LVT Error vector (that's done in end_local_APIC_setup()).  That
logic seems to be introduced by commit:

1c69524c2e5b x86: clear IO_APIC before enabing apic error vector.

Might it be less controversial to do like Linux does and call
enable_IO_APIC() before the local APIC ESR is setup?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 15:55:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 15:55:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562643.879378 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJcBB-0003XL-Tb; Wed, 12 Jul 2023 15:55:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562643.879378; Wed, 12 Jul 2023 15:55:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJcBB-0003XE-QB; Wed, 12 Jul 2023 15:55:01 +0000
Received: by outflank-mailman (input) for mailman id 562643;
 Wed, 12 Jul 2023 15:55:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ywyK=C6=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qJcBA-0003X8-0I
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 15:55:00 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 73d3d39f-20cc-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 17:54:58 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.161.151.90])
 by support.bugseng.com (Postfix) with ESMTPSA id 6D25A4EE0C89;
 Wed, 12 Jul 2023 17:54:56 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 73d3d39f-20cc-11ee-b239-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH] xen: fix violations of MISRA C:2012 Rule 3.1
Date: Wed, 12 Jul 2023 17:54:44 +0200
Message-Id: <9a27f6cbe552a00274f7ad32eec63f0e80e7644f.1689176790.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In the file 'xen/common/xmalloc_tlsf.c' is not clear how
the commented-out code should interact with the previous statement.
To resolve the MISRA violation generated by the nested comment
a #if .. #endif block with an explanatory comment substitutes
the earlier construct.

In the file 'xen/include/xen/atomic.h' the nested comment has been removed,
since the code sample is already explained by the preceding comment.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
Following the suggestion of this message
https://lore.kernel.org/xen-devel/536f3049-41f7-b127-ba94-81925e34ea0f@suse.com/
an explanatory comment has been added.
---
 xen/common/xmalloc_tlsf.c | 13 ++++++++++---
 xen/include/xen/atomic.h  |  2 +-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c
index c21bf71e88..56c3849414 100644
--- a/xen/common/xmalloc_tlsf.c
+++ b/xen/common/xmalloc_tlsf.c
@@ -139,10 +139,17 @@ static inline void MAPPING_SEARCH(unsigned long *r, int *fl, int *sl)
         *r = *r + t;
         *fl = flsl(*r) - 1;
         *sl = (*r >> (*fl - MAX_LOG2_SLI)) - MAX_SLI;
-        *fl -= FLI_OFFSET;
-        /*if ((*fl -= FLI_OFFSET) < 0) // FL will be always >0!
-         *fl = *sl = 0;
+        /* 
+         * It's unclear what was the purpose of the commented-out code that now
+         * is in the #else branch. The current form is motivated by the correction
+         * of a violation MISRA:C 2012 Rule 3.1
          */
+#if 1
+        *fl -= FLI_OFFSET;
+#else
+        if ((*fl -= FLI_OFFSET) < 0) // FL will be always >0!
+          *fl = *sl = 0;
+#endif
         *r &= ~t;
     }
 }
diff --git a/xen/include/xen/atomic.h b/xen/include/xen/atomic.h
index 529213ebbb..fa750a18ae 100644
--- a/xen/include/xen/atomic.h
+++ b/xen/include/xen/atomic.h
@@ -78,7 +78,7 @@ static inline void _atomic_set(atomic_t *v, int i);
  *      int old = atomic_read(&v);
  *      int new = old + 1;
  *      if ( likely(old == atomic_cmpxchg(&v, old, new)) )
- *          break; // success!
+ *          break;
  *  }
  */
 static inline int atomic_cmpxchg(atomic_t *v, int old, int new);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 16:02:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 16:02:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562650.879388 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJcI8-0005We-Je; Wed, 12 Jul 2023 16:02:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562650.879388; Wed, 12 Jul 2023 16:02:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJcI8-0005WX-GQ; Wed, 12 Jul 2023 16:02:12 +0000
Received: by outflank-mailman (input) for mailman id 562650;
 Wed, 12 Jul 2023 16:02:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=R8Q3=C6=citrix.com=prvs=550b2c143=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qJcI7-0005WR-7K
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 16:02:11 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 73bb228e-20cd-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 18:02:09 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 73bb228e-20cd-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689177729;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=AGW6/A4RP5/5jv9ASpkkoytNt740B5PGNMG0C5XLlc8=;
  b=HLBPPFU5o7SOWWci7x4g+uoxldqA37sJZ/NjzfaKVh4oLXrKJ1Ubt4DJ
   7pYn0eJ1tAU3iwVH1oSPuUor8P0I4c2z/n6YfRdWM76pIhnIH3/pqriqp
   vlfBKOA9br+Q2blT/acH+FIpEVmj/DGjrEjdLCnkcAOc/vYQOH9QuV74x
   g=;
Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 116011473
X-Ironport-Server: esa3.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:hcnXYK97j8pRaNy0zEdnDrUDlX6TJUtcMsCJ2f8bNWPcYEJGY0x3z
 2sWUDuPPPiKMDGmf48iaISw90wDvsTXnIQwHVY9+3o8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s
 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk
 d7pqojUNUTNNwRcawr40Ird7ks21BjOkGlA5AdmOqkR5AS2e0Q9V/rzG4ngdxMUfaEMdgKKb
 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk
 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklf3
 qQDImhXQiqH3eLm3ZbnGrk0hOUseZyD0IM34hmMzBncBPciB5vCX7/L9ZlT2z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PtmssU7zg=3D=3D?=
X-Talos-MUID: 9a23:h6Xy5wam4k8kleBTiBPvox5jNO5SxL2PDlkKk4gIvPOhHHkl
X-IronPort-AV: E=Sophos;i="6.01,200,1684814400"; 
   d="scan'208";a="116011473"
Date: Wed, 12 Jul 2023 17:02:03 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
CC: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>, Juergen Gross
	<jgross@suse.com>
Subject: Re: [PATCH v2 2/6] libxl: change the type of libxl_cpuid_policy_list
Message-ID: <c4df983f-d53a-468b-8ee0-f6f4d048d6c0@perard>
References: <20230711092230.15408-1-roger.pau@citrix.com>
 <20230711092230.15408-3-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230711092230.15408-3-roger.pau@citrix.com>

On Tue, Jul 11, 2023 at 11:22:26AM +0200, Roger Pau Monne wrote:
> -void libxl_cpuid_dispose(libxl_cpuid_policy_list *p_cpuid_list)
> +void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl)
>  {
> -    int i, j;
> -    libxl_cpuid_policy_list cpuid_list = *p_cpuid_list;
> +    libxl_cpuid_policy_list policy = *pl;
>  
> -    if (cpuid_list == NULL)
> +    if (policy == NULL)
>          return;
> -    for (i = 0; cpuid_list[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
> -        for (j = 0; j < 4; j++)
> -            if (cpuid_list[i].policy[j] != NULL) {
> -                free(cpuid_list[i].policy[j]);
> -                cpuid_list[i].policy[j] = NULL;
> -            }
> +
> +    if (policy->cpuid) {
> +        unsigned int i, j;
> +        struct xc_xend_cpuid *cpuid_list = policy->cpuid;
> +
> +        for (i = 0; cpuid_list[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
> +            for (j = 0; j < 4; j++)
> +                if (cpuid_list[i].policy[j] != NULL) {
> +                    free(cpuid_list[i].policy[j]);
> +                    cpuid_list[i].policy[j] = NULL;
> +                }

This looks like a lot of work. We could just call
free(cpuid_list[i].policy[j]) and that's all, as cpuid_list will be gone
right after the loop.

Also, please add {} for the second "for ()" loop.

> +        }
> +        free(policy->cpuid);
>      }

Beside some the coding style pointing out, the patch looks fine:
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 16:03:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 16:03:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562653.879398 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJcIz-000622-T4; Wed, 12 Jul 2023 16:03:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562653.879398; Wed, 12 Jul 2023 16:03:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJcIz-00061t-Q9; Wed, 12 Jul 2023 16:03:05 +0000
Received: by outflank-mailman (input) for mailman id 562653;
 Wed, 12 Jul 2023 16:03:04 +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
 <SRS0=V3yk=C6=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qJcIy-0005wd-8a
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 16:03:04 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20610.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::610])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 92ce1563-20cd-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 18:03:00 +0200 (CEST)
Received: from AM6P193CA0096.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::37)
 by PAVPR08MB9092.eurprd08.prod.outlook.com (2603:10a6:102:32a::17) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Wed, 12 Jul
 2023 16:02:56 +0000
Received: from AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:209:88:cafe::9d) by AM6P193CA0096.outlook.office365.com
 (2603:10a6:209:88::37) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32 via Frontend
 Transport; Wed, 12 Jul 2023 16:02:56 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT059.mail.protection.outlook.com (100.127.140.215) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.19 via Frontend Transport; Wed, 12 Jul 2023 16:02:56 +0000
Received: ("Tessian outbound f5de790fcf89:v145");
 Wed, 12 Jul 2023 16:02:55 +0000
Received: from 337a4c0bea24.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 82B677DB-53E1-447A-AB2C-5D610FBBE3DB.1; 
 Wed, 12 Jul 2023 16:02:48 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 337a4c0bea24.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 12 Jul 2023 16:02:48 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by GV2PR08MB8654.eurprd08.prod.outlook.com (2603:10a6:150:b6::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.26; Wed, 12 Jul
 2023 16:02:46 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::eaec:5611:c427:57f7]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::eaec:5611:c427:57f7%4]) with mapi id 15.20.6565.028; Wed, 12 Jul 2023
 16:02:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 92ce1563-20cd-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=VExihCHbSffD3ni/B0diIFaXWyB5cjU4S91AiY7QUPY=;
 b=pyjNTpDPSaMUZ1VPmjp1LjGRX1CnAjCotK/Mmj1nnwby7z3ynMoAlYpGQ4FZXtJbxX8DSUBVG/tSY1O3GQ/c/kYjL0MzhTWZ06l7SqCaMEXWR8u1w1xaMnOMCeUr/m4zLl5BIMtLO4E64cIqeUpucz+FI0UHPGH4cPCEu6aBRoI=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 49bff66012b2908f
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=HZ3aCu2pzGqj+PGXlp7dpgtWvVfoPHEjF4pDYW789iARykO0ql+GJDYgJFjFa0KcwA05U1Y+sJaPqeGvIqN/tTLcxtqDpZ9+CL/HfPE/RE/IevGxNRJyCU6uroFe+zYCq33kp1y9PP7mFJrUgvrDmSNs0ugmZMmuHEaENEDYvYXezA2GWcF7Q9luSWogbKshwzyQ3R59TQibRP1iVZpoi+cKTIcBFCNr5N9FSDOvdNU/VOgTXonblEQ1MUhUNVExzXPrIkMFhhX3QljzmkwN4f5BuVlghdsRO8+h4VuYCMo7wFEwMM43oFfojSFLyOPf+dR8Ndrcbz8VQpi5zMOZCQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=VExihCHbSffD3ni/B0diIFaXWyB5cjU4S91AiY7QUPY=;
 b=Rx4NYhZFIqpbNSU6zWk5XIAQmXDD4D6DFJDSUuoy+sD2CohhrwatPTaI+Hz138CeBMmNUjA8q7sudHKO8D/3Iz5FQlECmnei529MJiukxFrtN8gfx5GWUnPTEvcGQo8pA9e/Csa/ff3/z4KcgqfPTeS369uLZAlk26DUl4CB3fSuZVsuxlJhSGdFPR9yz5+orze6Rrrb3Jv2H9KZNuKl6Dr5vKZI6MPzTiYtJ69yeIaTIVw87dlEbmswmTctCOj30pE3m6dpEcRXMU3q1/uVjCwG/BDB4fqMEjb6iPERwkT0iga9bn7p9W7niLw250h7MDZCJFLbLJoYY0i9y0D/kg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=VExihCHbSffD3ni/B0diIFaXWyB5cjU4S91AiY7QUPY=;
 b=pyjNTpDPSaMUZ1VPmjp1LjGRX1CnAjCotK/Mmj1nnwby7z3ynMoAlYpGQ4FZXtJbxX8DSUBVG/tSY1O3GQ/c/kYjL0MzhTWZ06l7SqCaMEXWR8u1w1xaMnOMCeUr/m4zLl5BIMtLO4E64cIqeUpucz+FI0UHPGH4cPCEu6aBRoI=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, "michal.orzel@amd.com" <michal.orzel@amd.com>,
	"xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
	"ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
	"consulting@bugseng.com" <consulting@bugseng.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, Jan
 Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, Wei Liu
	<wl@xen.org>
Subject: Re: [XEN PATCH] xen: fix violations of MISRA C:2012 Rule 3.1
Thread-Topic: [XEN PATCH] xen: fix violations of MISRA C:2012 Rule 3.1
Thread-Index: AQHZtNlJBMaqjD35lk+am0TGpnL30K+2StiA
Date: Wed, 12 Jul 2023 16:02:46 +0000
Message-ID: <94E9B010-D56E-46A4-AF8F-9010E34A3541@arm.com>
References:
 <9a27f6cbe552a00274f7ad32eec63f0e80e7644f.1689176790.git.nicola.vetrini@bugseng.com>
In-Reply-To:
 <9a27f6cbe552a00274f7ad32eec63f0e80e7644f.1689176790.git.nicola.vetrini@bugseng.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|GV2PR08MB8654:EE_|AM7EUR03FT059:EE_|PAVPR08MB9092:EE_
X-MS-Office365-Filtering-Correlation-Id: d258d8a1-dee2-4666-6ba0-08db82f174d0
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 VbLBlV3Ms2wlCRjqUSC17L8kjppSo7Z5fQVz9wGxJyuxsmAD0ItzX4nfBXo16FRlDWiAfik9Oo16bYzuIeKEZXeCAlQfB+25TdUJKN/z6S8Vu5rxUEBcO2GdDFj65ISycJaeaXUVxqbcE0JZISY7kEzTM7YReS5gvJpfFLdrSScNAogJyFHqgtRVfufV7UatxrG76BTGr/QsVh1tboCO4mLJ2fa2IFYjS5+5r1iwb2SBuO4U8vZ0pY4juRB4EbFooSBogj1keHqeA0Ol7+GU9K+Z6XjDHATJA67fht0h3rPDgwUaoVlBSy3Ik2jn/H8l5T4VepM9NTzxO8y5gYZoqGwL893efYugtP6FZDwDBBP22Nm4KlQK9sMQLEoU/xI4fhAuS0vkuK3KuV2VhOYXBgf9pqjk7+6ZXIwrrwSvHnFsGCzniwTpMf9vzKkqnaueTh3zL5LcEznSx8evlQAtZ8qNk6Eq5s/EcuYf79G3j89EJQqmhJ0F4LaVE0nLJSXCBP+Z9ye+qvlbXfUerGej2+/Y8/1LDvY3Jc/wFB1nTHZ4XoKxd6spevQqendZfKwnzLfdDbMOfyX30TwSHhVn7JSNyocMpHLznBjhIrrKdwR38G8/WNfzQN1ZmPCVLFCL2CgOkFcDMfcYBCF38gtOjw==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(376002)(346002)(366004)(136003)(451199021)(71200400001)(76116006)(6486002)(478600001)(91956017)(54906003)(26005)(6512007)(966005)(38070700005)(186003)(2906002)(41300700001)(316002)(4326008)(83380400001)(64756008)(8936002)(6506007)(8676002)(66446008)(66556008)(7416002)(66476007)(122000001)(5660300002)(38100700002)(53546011)(6916009)(36756003)(33656002)(2616005)(86362001)(66946007)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <F6ED78D770D5C746828FEADDE4F0D905@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8654
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	566d3603-8c3a-4832-42d2-08db82f16ee8
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	lHaZVDUFmAGCfHkmQEp2xJsSPWcmZ5pe6idGYkpWG6GWYqSAYUImJxgeivetuTXdxp1fiTDH2EOgHUtfKGmf4Xgn98snaSkIQs+pwtsLCXEKzfd5vC2ZBqn/qIfD2/GSydzrxJioaxfzI6qZIwXm79kQ+UEY74hbz4GJyb8OfjURJUb3cSUnHZxY15I4qqCswUCiRNAX1IxNiv5r26lUKtXKwPai2ReEcKPGlMROPdTVpr1kAu6AiHdM47BXxamM6Mcv2KFP+qGaxpNbvaAFFQIZ6+24vC6RZkJCzOK+kVnfFNdIY2Mgi0RQWg1X7nRtlq8JpcR9l4his7sn2E5AoctLDaXEEdS/NtXBXABQ3QzHJEPr/SzHif3Opy70ptdpKAlvmq2tziQHLMa5Qk96bXNwEyhlKe/8KYod1g8jfNolwfWM1WljZ/1/2cl4iNs9KPY3mT9NrqP+AhdbMZqRBtKlnZlKl0At0JMtwvjnKrXdm0Dk7B4EJ8QRkvkff9vNQ3euyh1PW6vpoYR55KbEm5wP4E7ifUSoTdPsbFMSwP4qJmnTkoqzKLclLQfQU1YyDig3BieMbXPC7XMRK4z5/vJd5zH+6un9f57b2+kRKI/IlGG9YLncp9Ywu6sSGF2cZUGFjbrU9Me679n/ACI9Hn6abO4cNnfg0ZiRpUOv28zk5Qo2GL4RcSEyN7MJIWz6myVC6jvdJa+t+ZsxZCYra4E9v+u3IfNBAEb0skDAA5I=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(39860400002)(396003)(346002)(451199021)(36840700001)(40470700004)(46966006)(40460700003)(6506007)(186003)(26005)(2906002)(2616005)(6512007)(53546011)(478600001)(966005)(36860700001)(83380400001)(47076005)(336012)(41300700001)(4326008)(316002)(5660300002)(8676002)(8936002)(6862004)(6486002)(70206006)(70586007)(54906003)(36756003)(40480700001)(33656002)(81166007)(356005)(82310400005)(86362001)(82740400003);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 16:02:56.0977
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d258d8a1-dee2-4666-6ba0-08db82f174d0
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9092



> On 12 Jul 2023, at 16:54, Nicola Vetrini <nicola.vetrini@bugseng.com> wro=
te:
>=20
> In the file 'xen/common/xmalloc_tlsf.c' is not clear how
> the commented-out code should interact with the previous statement.
> To resolve the MISRA violation generated by the nested comment
> a #if .. #endif block with an explanatory comment substitutes
> the earlier construct.
>=20
> In the file 'xen/include/xen/atomic.h' the nested comment has been remove=
d,
> since the code sample is already explained by the preceding comment.
>=20
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
> Following the suggestion of this message
> https://lore.kernel.org/xen-devel/536f3049-41f7-b127-ba94-81925e34ea0f@su=
se.com/
> an explanatory comment has been added.
> ---
> xen/common/xmalloc_tlsf.c | 13 ++++++++++---
> xen/include/xen/atomic.h  |  2 +-
> 2 files changed, 11 insertions(+), 4 deletions(-)
>=20
> diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c
> index c21bf71e88..56c3849414 100644
> --- a/xen/common/xmalloc_tlsf.c
> +++ b/xen/common/xmalloc_tlsf.c
> @@ -139,10 +139,17 @@ static inline void MAPPING_SEARCH(unsigned long *r,=
 int *fl, int *sl)
>         *r =3D *r + t;
>         *fl =3D flsl(*r) - 1;
>         *sl =3D (*r >> (*fl - MAX_LOG2_SLI)) - MAX_SLI;
> -        *fl -=3D FLI_OFFSET;
> -        /*if ((*fl -=3D FLI_OFFSET) < 0) // FL will be always >0!
> -         *fl =3D *sl =3D 0;
> +        /*=20
> +         * It's unclear what was the purpose of the commented-out code t=
hat now
> +         * is in the #else branch. The current form is motivated by the =
correction
> +         * of a violation MISRA:C 2012 Rule 3.1
>          */
> +#if 1
> +        *fl -=3D FLI_OFFSET;
> +#else
> +        if ((*fl -=3D FLI_OFFSET) < 0) // FL will be always >0!

In the message you linked above, you suggested to use /* FL will be always =
>0! */, why has it changed?
Was some comment I missed? The xen codestyle mandates the use of /* */, any=
way I agree that here you
are just moving code...
So maybe the maintainer can tell what is the best thing to do here.

> +          *fl =3D *sl =3D 0;
> +#endif
>         *r &=3D ~t;
>     }
> }
> diff --git a/xen/include/xen/atomic.h b/xen/include/xen/atomic.h
> index 529213ebbb..fa750a18ae 100644
> --- a/xen/include/xen/atomic.h
> +++ b/xen/include/xen/atomic.h
> @@ -78,7 +78,7 @@ static inline void _atomic_set(atomic_t *v, int i);
>  *      int old =3D atomic_read(&v);
>  *      int new =3D old + 1;
>  *      if ( likely(old =3D=3D atomic_cmpxchg(&v, old, new)) )
> - *          break; // success!
> + *          break;
>  *  }
>  */
> static inline int atomic_cmpxchg(atomic_t *v, int old, int new);
> --=20
> 2.34.1
>=20
>=20

Anyway apart from that, the patch looks ok to me.

Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>





From xen-devel-bounces@lists.xenproject.org Wed Jul 12 16:07:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 16:07:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562668.879412 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJcMa-0006mw-Ik; Wed, 12 Jul 2023 16:06:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562668.879412; Wed, 12 Jul 2023 16:06:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJcMa-0006mp-G9; Wed, 12 Jul 2023 16:06:48 +0000
Received: by outflank-mailman (input) for mailman id 562668;
 Wed, 12 Jul 2023 16:06:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ItXa=C6=ionos.com=haris.iqbal@srs-se1.protection.inumbo.net>)
 id 1qJcMZ-0006ll-KA
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 16:06:47 +0000
Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com
 [2a00:1450:4864:20::131])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 19fe2b7f-20ce-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 18:06:46 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-4fb863edcb6so11538963e87.0
 for <xen-devel@lists.xenproject.org>; Wed, 12 Jul 2023 09:06:46 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 19fe2b7f-20ce-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=ionos.com; s=google; t=1689178006; x=1691770006;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=8X6ArMXh62A5UxRR3ZN+q1CvObhoeb8ltfmXU1xj+zw=;
        b=V0Mwyzpfv5NHo344FebMkemb4OkDhqesSJzk3oLJrC1sXingJzi/DqoHJPX3cM7/kU
         /daZbGumusx7p3ETz9bL+dV7+a249DzrdJ5ucaxUqFs1cH4q4UNK1aBbCP0kRMVezgvK
         Gb0u18D1omT5qk875/bvJSIuyWWXlLKu5WnA0OT929rTcOY7rHqZVsWOvIcdQTq+Q4TI
         Xty8IQiQ2uEFjkBqRHhjaYUeIIjdk3TlKuW6ZBNL29/kZI8LKdOXvAAi+FiRNxSMUXsG
         92h/diWQ5jGfG/Pc/9JTOLcLZ2bS8Hyd3sIfxIs/rFITeR6YjIQmonhcUevYE5m/zN7s
         SmPw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689178006; x=1691770006;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=8X6ArMXh62A5UxRR3ZN+q1CvObhoeb8ltfmXU1xj+zw=;
        b=FB1WVJXBRL2sl5sZSMSlbgE4YLaTyCZUVmudqTwIRU4ag86+E8fIQO/LSHT5ibk9My
         5YInqv5vIS1I/DkIZAltbWNpyKnpYiMRjW5wa3zyosnIIGi0G/G8bVOP1c3XGleEfBV2
         U/HGd4MNTr0hKdKW1vDst3E4ULVID9zfVdoS+GO8Nd6G8KoiUBMe60+7lFaNHzw1QGTT
         QY2lqqp5q8yGA3zV1qe9HZ50VZ2gCE+m9QsDd5xrqV6hwSloNnbgq5pts3TfjtZHjzBb
         P9gfI3zuck72sVA/2EouPjOBDjxQaLQjVrDkWI3HXHwvAEubTyfvFeBO6EYRgqPX7jBF
         aLew==
X-Gm-Message-State: ABy/qLZDCJcqNgV1jI5oPbLfyhbzI60WoiAgep/yoyk5HX6EO56KlKCf
	1Of3TOTpnq9JHfCDjQusg4gmXs2qtuD9FvMrrmbbGA==
X-Google-Smtp-Source: APBJJlHjPtNIqZNhhKZT3JSG1orBAozCwd3+TwwvFjulJuToD7D5iIrA7grwKZQU8Z67qc0UJ0oDxWof6WbkdfMRi3A=
X-Received: by 2002:ac2:5b1d:0:b0:4fb:7a90:1abe with SMTP id
 v29-20020ac25b1d000000b004fb7a901abemr15797051lfn.49.1689178006211; Wed, 12
 Jul 2023 09:06:46 -0700 (PDT)
MIME-Version: 1.0
References: <20230629165206.383-1-jack@suse.cz> <20230704122224.16257-1-jack@suse.cz>
 <ZKbgAG5OoHVyUKOG@infradead.org>
In-Reply-To: <ZKbgAG5OoHVyUKOG@infradead.org>
From: Haris Iqbal <haris.iqbal@ionos.com>
Date: Wed, 12 Jul 2023 18:06:35 +0200
Message-ID: <CAJpMwyiUcw+mH0sZa8f8UJsaSZ7NSE65s2gZDEia+pASyP_gJQ@mail.gmail.com>
Subject: Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions
To: Christoph Hellwig <hch@infradead.org>
Cc: Jan Kara <jack@suse.cz>, linux-block@vger.kernel.org, 
	linux-fsdevel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>, 
	Alasdair Kergon <agk@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, 
	Anna Schumaker <anna@kernel.org>, Chao Yu <chao@kernel.org>, 
	Christian Borntraeger <borntraeger@linux.ibm.com>, "Darrick J. Wong" <djwong@kernel.org>, 
	Dave Kleikamp <shaggy@kernel.org>, David Sterba <dsterba@suse.com>, dm-devel@redhat.com, 
	drbd-dev@lists.linbit.com, Gao Xiang <xiang@kernel.org>, 
	Jack Wang <jinpu.wang@ionos.com>, Jaegeuk Kim <jaegeuk@kernel.org>, 
	jfs-discussion@lists.sourceforge.net, Joern Engel <joern@lazybastard.org>, 
	Joseph Qi <joseph.qi@linux.alibaba.com>, Kent Overstreet <kent.overstreet@gmail.com>, 
	linux-bcache@vger.kernel.org, linux-btrfs@vger.kernel.org, 
	linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, 
	linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org, 
	linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org, 
	linux-nilfs@vger.kernel.org, linux-nvme@lists.infradead.org, 
	linux-pm@vger.kernel.org, linux-raid@vger.kernel.org, 
	linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, 
	linux-xfs@vger.kernel.org, Mike Snitzer <snitzer@kernel.org>, 
	Minchan Kim <minchan@kernel.org>, ocfs2-devel@oss.oracle.com, 
	reiserfs-devel@vger.kernel.org, Sergey Senozhatsky <senozhatsky@chromium.org>, 
	Song Liu <song@kernel.org>, Sven Schnelle <svens@linux.ibm.com>, target-devel@vger.kernel.org, 
	Ted Tso <tytso@mit.edu>, Trond Myklebust <trond.myklebust@hammerspace.com>, 
	xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 6, 2023 at 5:38=E2=80=AFPM Christoph Hellwig <hch@infradead.org=
> wrote:
>
> On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote:
> > Create struct bdev_handle that contains all parameters that need to be
> > passed to blkdev_put() and provide blkdev_get_handle_* functions that
> > return this structure instead of plain bdev pointer. This will
> > eventually allow us to pass one more argument to blkdev_put() without
> > too much hassle.
>
> Can we use the opportunity to come up with better names?  blkdev_get_*
> was always a rather horrible naming convention for something that
> ends up calling into ->open.
>
> What about:
>
> struct bdev_handle *bdev_open_by_dev(dev_t dev, blk_mode_t mode, void *ho=
lder,
>                 const struct blk_holder_ops *hops);
> struct bdev_handle *bdev_open_by_path(dev_t dev, blk_mode_t mode,
>                 void *holder, const struct blk_holder_ops *hops);
> void bdev_release(struct bdev_handle *handle);

+1 to this.
Also, if we are removing "handle" from the function, should the name
of the structure it returns also change? Would something like bdev_ctx
be better?

(Apologies for the previous non-plaintext email)

>
> ?


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 16:13:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 16:13:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562675.879422 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJcTF-0008IR-B2; Wed, 12 Jul 2023 16:13:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562675.879422; Wed, 12 Jul 2023 16:13:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJcTF-0008II-8I; Wed, 12 Jul 2023 16:13:41 +0000
Received: by outflank-mailman (input) for mailman id 562675;
 Wed, 12 Jul 2023 16:11:52 +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
 <SRS0=MfTd=C6=pengutronix.de=ukl@srs-se1.protection.inumbo.net>)
 id 1qJcRU-0008Fh-OD
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 16:11:52 +0000
Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de
 [2001:67c:670:201:290:27ff:fe1d:cc33])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cef916d3-20ce-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 18:11:50 +0200 (CEST)
Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2])
 by metis.ext.pengutronix.de with esmtps
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJcQH-0000ws-J6; Wed, 12 Jul 2023 18:10:37 +0200
Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de)
 by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJcQ7-00DvHU-NY; Wed, 12 Jul 2023 18:10:27 +0200
Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJcQ6-004LMY-OR; Wed, 12 Jul 2023 18:10:26 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cef916d3-20ce-11ee-8611-37d641c3527e
Date: Wed, 12 Jul 2023 18:10:25 +0200
From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
To: Jani Nikula <jani.nikula@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	Alex Deucher <alexander.deucher@amd.com>,
	Christian =?utf-8?B?S8O2bmln?= <christian.koenig@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
	Hamza Mahfooz <hamza.mahfooz@amd.com>,
	Javier Martinez Canillas <javierm@redhat.com>,
	Guchun Chen <guchun.chen@amd.com>,
	Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
	Evan Quan <evan.quan@amd.com>, Likun Gao <Likun.Gao@amd.com>,
	Marek =?utf-8?B?T2zFocOhaw==?= <marek.olsak@amd.com>,
	David Francis <David.Francis@amd.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>, Lang Yu <Lang.Yu@amd.com>,
	Philip Yang <Philip.Yang@amd.com>,
	Yifan Zhang <yifan1.zhang@amd.com>, Tim Huang <Tim.Huang@amd.com>,
	Zack Rusin <zackr@vmware.com>, Sam Ravnborg <sam@ravnborg.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	=?utf-8?B?TWHDrXJh?= Canal <mairacanal@riseup.net>,
	=?utf-8?B?QW5kcsOp?= Almeida <andrealmeid@igalia.com>,
	Qingqing Zhuo <qingqing.zhuo@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	Hersen Wu <hersenxs.wu@amd.com>, Fangzhi Zuo <jerry.zuo@amd.com>,
	Stylon Wang <stylon.wang@amd.com>, Alan Liu <haoping.liu@amd.com>,
	Wayne Lin <Wayne.Lin@amd.com>, Aaron Liu <aaron.liu@amd.com>,
	Melissa Wen <mwen@igalia.com>,
	Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
	David Tadokoro <davidbtadokoro@usp.br>,
	Wenjing Liu <wenjing.liu@amd.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
	Roman Li <roman.li@amd.com>,
	=?utf-8?Q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= <samsagax@gmail.com>,
	Dave Airlie <airlied@redhat.com>,
	Russell King <linux@armlinux.org.uk>,
	Liviu Dudau <liviu.dudau@arm.com>, Joel Stanley <joel@jms.id.au>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	Inki Dae <inki.dae@samsung.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Stefan Agner <stefan@agner.ch>, Alison Wang <alison.wang@nxp.com>,
	Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
	Noralf =?utf-8?Q?Tr=C3=B8nnes?= <noralf@tronnes.org>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Tian Tao <tiantao6@hisilicon.com>,
	Danilo Krummrich <dakr@redhat.com>,
	Deepak Rawat <drawat.floss@gmail.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Ville =?utf-8?B?U3lyasOkbMOk?= <ville.syrjala@linux.intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>,
	Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
	Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Luca Coelho <luciano.coelho@intel.com>,
	Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Vinod Govindapillai <vinod.govindapillai@intel.com>,
	=?utf-8?Q?=C5=81ukasz?= Bartosik <lb@semihalf.com>,
	Anusha Srivatsa <anusha.srivatsa@intel.com>,
	Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
	Uma Shankar <uma.shankar@intel.com>,
	Imre Deak <imre.deak@intel.com>,
	Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
	Swati Sharma <swati2.sharma@intel.com>,
	Jouni =?utf-8?B?SMO2Z2FuZGVy?= <jouni.hogander@intel.com>,
	Mika Kahola <mika.kahola@intel.com>,
	=?utf-8?B?Sm9zw6k=?= Roberto de Souza <jose.souza@intel.com>,
	Arun R Murthy <arun.r.murthy@intel.com>,
	Gustavo Sousa <gustavo.sousa@intel.com>,
	Khaled Almahallawy <khaled.almahallawy@intel.com>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	Andi Shyti <andi.shyti@linux.intel.com>,
	Nirmoy Das <nirmoy.das@intel.com>, Fei Yang <fei.yang@intel.com>,
	Animesh Manna <animesh.manna@intel.com>,
	Deepak R Varma <drv@mailo.com>,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Vandita Kulkarni <vandita.kulkarni@intel.com>,
	Suraj Kandpal <suraj.kandpal@intel.com>,
	Drew Davenport <ddavenport@chromium.org>,
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Dan Carpenter <error27@gmail.com>,
	Paul Cercueil <paul@crapouillou.net>,
	Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Rob Clark <robdclark@gmail.com>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Vinod Polimera <quic_vpolimer@quicinc.com>,
	Jiasheng Jiang <jiasheng@iscas.ac.cn>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Jessica Zhang <quic_jesszhan@quicinc.com>,
	Liu Shixin <liushixin2@huawei.com>, Marek Vasut <marex@denx.de>,
	Ben Skeggs <bskeggs@redhat.com>, Karol Herbst <kherbst@redhat.com>,
	Lyude Paul <lyude@redhat.com>, Tomi Valkeinen <tomba@kernel.org>,
	Emma Anholt <emma@anholt.net>, Gerd Hoffmann <kraxel@redhat.com>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Sandy Huang <hjc@rock-chips.com>,
	Heiko =?utf-8?Q?St=C3=BCbner?= <heiko@sntech.de>,
	Orson Zhai <orsonzhai@gmail.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Alain Volmat <alain.volmat@foss.st.com>,
	Yannick Fertre <yannick.fertre@foss.st.com>,
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
	Philippe Cornu <philippe.cornu@foss.st.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Mikko Perttunen <mperttunen@nvidia.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Jyri Sarha <jyri.sarha@iki.fi>,
	David Lechner <david@lechnology.com>,
	Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
	Melissa Wen <melissa.srw@gmail.com>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Michal Simek <michal.simek@amd.com>,
	Haneen Mohammed <hamohammed.sa@gmail.com>,
	linux-hyperv@vger.kernel.org, linux-aspeed@lists.ozlabs.org,
	nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org,
	Yongqin Liu <yongqin.liu@linaro.org>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Fabio Estevam <festevam@gmail.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Jerome Brunet <jbrunet@baylibre.com>,
	linux-samsung-soc@vger.kernel.org, amd-gfx@lists.freedesktop.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-rockchip@lists.infradead.org,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	spice-devel@lists.freedesktop.org, linux-sunxi@lists.linux.dev,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org,
	linux-mediatek@lists.infradead.org, xen-devel@lists.xenproject.org,
	linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org,
	Gurchetan Singh <gurchetansingh@chromium.org>,
	Sean Paul <sean@poorly.run>, linux-arm-kernel@lists.infradead.org,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
	Andrew Jeffery <andrew@aj.id.au>, linux-mips@vger.kernel.org,
	Chia-I Wu <olvaffe@gmail.com>, linux-renesas-soc@vger.kernel.org,
	kernel@pengutronix.de, John Stultz <jstultz@google.com>,
	freedreno@lists.freedesktop.org,
	Lucas Stach <l.stach@pengutronix.de>
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
Message-ID: <20230712161025.22op3gtzgujrhytb@pengutronix.de>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="fzugsjz5u2erhwcr"
Content-Disposition: inline
In-Reply-To: <87fs5tgpvv.fsf@intel.com>
X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2
X-SA-Exim-Mail-From: ukl@pengutronix.de
X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false
X-PTX-Original-Recipient: xen-devel@lists.xenproject.org


--fzugsjz5u2erhwcr
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello Jani,

On Wed, Jul 12, 2023 at 05:34:28PM +0300, Jani Nikula wrote:
> On Wed, 12 Jul 2023, Uwe Kleine-K=F6nig <u.kleine-koenig@pengutronix.de> =
wrote:
> > Hello,
> >
> > while I debugged an issue in the imx-lcdc driver I was constantly
> > irritated about struct drm_device pointer variables being named "dev"
> > because with that name I usually expect a struct device pointer.
> >
> > I think there is a big benefit when these are all renamed to "drm_dev".
> > I have no strong preference here though, so "drmdev" or "drm" are fine
> > for me, too. Let the bikesheding begin!
> >
> > Some statistics:
> >
> > $ git grep -ohE 'struct drm_device *\* *[^ (),;]*' v6.5-rc1 | sort | un=
iq -c | sort -n
> >       1 struct drm_device *adev_to_drm
> >       1 struct drm_device *drm_
> >       1 struct drm_device          *drm_dev
> >       1 struct drm_device        *drm_dev
> >       1 struct drm_device *pdev
> >       1 struct drm_device *rdev
> >       1 struct drm_device *vdev
> >       2 struct drm_device *dcss_drv_dev_to_drm
> >       2 struct drm_device **ddev
> >       2 struct drm_device *drm_dev_alloc
> >       2 struct drm_device *mock
> >       2 struct drm_device *p_ddev
> >       5 struct drm_device *device
> >       9 struct drm_device * dev
> >      25 struct drm_device *d
> >      95 struct drm_device *
> >     216 struct drm_device *ddev
> >     234 struct drm_device *drm_dev
> >     611 struct drm_device *drm
> >    4190 struct drm_device *dev
> >
> > This series starts with renaming struct drm_crtc::dev to drm_dev. If
> > it's not only me and others like the result of this effort it should be
> > followed up by adapting the other structs and the individual usages in
> > the different drivers.
>=20
> I think this is an unnecessary change. In drm, a dev is usually a drm
> device, i.e. struct drm_device *.

Well, unless it's not. Prominently there is

	struct drm_device {
		...
		struct device *dev;
		...
	};

which yields quite a few code locations using dev->dev which is
IMHO unnecessary irritating:

	$ git grep '\<dev->dev' v6.5-rc1 drivers/gpu/drm | wc -l
	1633

Also the functions that deal with both a struct device and a struct
drm_device often use "dev" for the struct device and then "ddev" for
the drm_device (see for example amdgpu_device_get_pcie_replay_count()).

> If folks insist on following through with this anyway, I'm firmly in the
> camp the name should be "drm" and nothing else.

Up to now positive feedback is in the majority.

Best regards
Uwe

--=20
Pengutronix e.K.                           | Uwe Kleine-K=F6nig            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

--fzugsjz5u2erhwcr
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmSu0HEACgkQj4D7WH0S
/k4tEAgAjSlm+m9acQMJLbHVbIAaWzq11GFCJMY9/BGZLpqO6K6E9a01pfO8fCgN
isja7eDWpKflOXKYWqhmcSssK1xwJLNSKt8+htEafh6mxWV5HU0jyoWvSxTnQ1gL
nWDFOPr3pLhv1CGL5/k0t1+hd+ECL1khVbWpQFdBDTjwwqD6TfY0iTXxGaZuGxa8
lJUBRc+bVymGD1u+8ox4REDSHSpNH5sz5k4aGUyv1NQmIFYZJL/BkV8FDSJ5ch4S
9zSAf5yMI9E3lXBKmepbTTTUk3sobZSO4cb1acQreVw0dx3kVtIw3yq1clLJcajd
E9HRqReDdg8q7s08KuyJFhsdIlCQLQ==
=sqnn
-----END PGP SIGNATURE-----

--fzugsjz5u2erhwcr--


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 16:17:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 16:17:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562682.879432 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJcWq-0000V2-OX; Wed, 12 Jul 2023 16:17:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562682.879432; Wed, 12 Jul 2023 16:17:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJcWq-0000Uv-LC; Wed, 12 Jul 2023 16:17:24 +0000
Received: by outflank-mailman (input) for mailman id 562682;
 Wed, 12 Jul 2023 16:17:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ywyK=C6=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qJcWo-0000Ul-WF
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 16:17:23 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 947c93b7-20cf-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 18:17:21 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.161.151.90])
 by support.bugseng.com (Postfix) with ESMTPSA id 176484EE0C89;
 Wed, 12 Jul 2023 18:17:19 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 947c93b7-20cf-11ee-b239-6b7b168915f2
Message-ID: <97bf441e-db06-6e37-c551-d5a7f30093d8@bugseng.com>
Date: Wed, 12 Jul 2023 18:17:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [XEN PATCH] xen: fix violations of MISRA C:2012 Rule 3.1
Content-Language: en-US
To: Luca Fancellu <Luca.Fancellu@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 "xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
 "ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
 "consulting@bugseng.com" <consulting@bugseng.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>
References: <9a27f6cbe552a00274f7ad32eec63f0e80e7644f.1689176790.git.nicola.vetrini@bugseng.com>
 <94E9B010-D56E-46A4-AF8F-9010E34A3541@arm.com>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <94E9B010-D56E-46A4-AF8F-9010E34A3541@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 12/07/23 18:02, Luca Fancellu wrote:
> 
> 
>> On 12 Jul 2023, at 16:54, Nicola Vetrini <nicola.vetrini@bugseng.com> wrote:
>>
>> In the file 'xen/common/xmalloc_tlsf.c' is not clear how
>> the commented-out code should interact with the previous statement.
>> To resolve the MISRA violation generated by the nested comment
>> a #if .. #endif block with an explanatory comment substitutes
>> the earlier construct.
>>
>> In the file 'xen/include/xen/atomic.h' the nested comment has been removed,
>> since the code sample is already explained by the preceding comment.
>>
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>> ---
>> Following the suggestion of this message
>> https://lore.kernel.org/xen-devel/536f3049-41f7-b127-ba94-81925e34ea0f@suse.com/
>> an explanatory comment has been added.
>> ---
>> xen/common/xmalloc_tlsf.c | 13 ++++++++++---
>> xen/include/xen/atomic.h  |  2 +-
>> 2 files changed, 11 insertions(+), 4 deletions(-)
>>
>> diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c
>> index c21bf71e88..56c3849414 100644
>> --- a/xen/common/xmalloc_tlsf.c
>> +++ b/xen/common/xmalloc_tlsf.c
>> @@ -139,10 +139,17 @@ static inline void MAPPING_SEARCH(unsigned long *r, int *fl, int *sl)
>>          *r = *r + t;
>>          *fl = flsl(*r) - 1;
>>          *sl = (*r >> (*fl - MAX_LOG2_SLI)) - MAX_SLI;
>> -        *fl -= FLI_OFFSET;
>> -        /*if ((*fl -= FLI_OFFSET) < 0) // FL will be always >0!
>> -         *fl = *sl = 0;
>> +        /*
>> +         * It's unclear what was the purpose of the commented-out code that now
>> +         * is in the #else branch. The current form is motivated by the correction
>> +         * of a violation MISRA:C 2012 Rule 3.1
>>           */
>> +#if 1
>> +        *fl -= FLI_OFFSET;
>> +#else
>> +        if ((*fl -= FLI_OFFSET) < 0) // FL will be always >0!
> 
> In the message you linked above, you suggested to use /* FL will be always >0! */, why has it changed?
> Was some comment I missed? The xen codestyle mandates the use of /* */, anyway I agree that here you
> are just moving code...
> So maybe the maintainer can tell what is the best thing to do here.

You didn't miss any further comment: my suggestion was related to the 
explanatory comment, not the nested comment itself. If a better wording 
can be found for the former, no problem. As for the codestyle point: it 
does not change anything doing
"// FL will be always >0!" -> "/* FL will be always >0!  */
w.r.t. Rule 3.1 (both would have been nested comments).

Regards,

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 16:37:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 16:37:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562690.879442 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJcpv-00035u-9m; Wed, 12 Jul 2023 16:37:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562690.879442; Wed, 12 Jul 2023 16:37:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJcpv-00035l-6S; Wed, 12 Jul 2023 16:37:07 +0000
Received: by outflank-mailman (input) for mailman id 562690;
 Wed, 12 Jul 2023 16:37:05 +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
 <SRS0=V3yk=C6=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qJcpt-00035f-9h
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 16:37:05 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2047.outbound.protection.outlook.com [40.107.7.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5489821b-20d2-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 18:37:03 +0200 (CEST)
Received: from AS9PR06CA0714.eurprd06.prod.outlook.com (2603:10a6:20b:49f::21)
 by GV1PR08MB8450.eurprd08.prod.outlook.com (2603:10a6:150:82::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 16:36:30 +0000
Received: from AM7EUR03FT026.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:49f:cafe::b7) by AS9PR06CA0714.outlook.office365.com
 (2603:10a6:20b:49f::21) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20 via Frontend
 Transport; Wed, 12 Jul 2023 16:36:30 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT026.mail.protection.outlook.com (100.127.140.154) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.20 via Frontend Transport; Wed, 12 Jul 2023 16:36:29 +0000
Received: ("Tessian outbound 997ae1cc9f47:v145");
 Wed, 12 Jul 2023 16:36:29 +0000
Received: from 00ad787e5b1e.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 E845BBC5-4245-469A-ACB1-FEC113FAEB07.1; 
 Wed, 12 Jul 2023 16:36:22 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 00ad787e5b1e.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 12 Jul 2023 16:36:22 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by AS8PR08MB7944.eurprd08.prod.outlook.com (2603:10a6:20b:541::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Wed, 12 Jul
 2023 16:36:19 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::eaec:5611:c427:57f7]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::eaec:5611:c427:57f7%4]) with mapi id 15.20.6565.028; Wed, 12 Jul 2023
 16:36:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5489821b-20d2-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=VQkI+Bitb+JFnJYSvA/ti/6vfRy6Yy3MkNNTQHFyjYI=;
 b=FZh6GQCOowHb1wcE0LgT9cxVSWY5osqJJHg7lF1gfPRrDabQgpoiT6HdMqEnBJJuvZ98PgUa1AF6bpgqEBeustkyGqudT9cm9hd3IwB1f6L6pB2nuC15PgIkwDfefVR9VGoWWaIlvxeCJnV5cx/1R5YbS+rgU+YoEYDCD6a/uPs=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 763c5c40e5c7676e
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=XDJStZd3RixbA3egb4O8+C9dOkFf+MrcaIJQjCbYb8Ni0AV1m0Jg1d476koUg66CrdpjZN1rM0NucLNh0NknggKokFpMddOiWtST+BVQKQqOaNNiZsBI21hpybLldaJDaF1201TA9Uo7FkwGf48gjuDndpopuPX2PtM+xpASXcN+TdDYRgGrn5sWSBtCIpnnRz+2O3+5UcaJ1Ejx9kolehxKlx1Or7f8PvLnHZlDfbjK/DK6nEaV0DhH+9czDNEdlExHUCzSldFWAAdpUw1B6c/J2cHV4rOMjU3qZ4gWjH2/rzQJslfM1JHvhcUqqUAQV8HGa6Z3Ux7IuT9R8KJwXg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=VQkI+Bitb+JFnJYSvA/ti/6vfRy6Yy3MkNNTQHFyjYI=;
 b=hKWwYo2zUEWsCWO1RIGZKh8teEG2idnKrX5Q9P9Yaf4QFksqOr0unU2DFNPALgF7INn1FJsuGWM6tsQx5kXLcvSRql/3ykJLxv2yZDXCfvzmip3v2u8cCakv2B2B6xZ6BWrJOATW7vX+M1qynQei+XEaNzID9kfsTW8rg/pTRgzBHCY/u/tJ3gR+f0x1tDKvowovEOxvfHqNulUzL45N38ZbGzjrN4L7dLNiKS/B7bdXjRkwfnJOtXDYxHFQ0HuuznueIhHRyL4uM+RYmNyLpvjZ86LMCh2E7YEhzf+VP2lLFE4GFzoUvsq55imQ7Cn4FO5VV3l3jWz8kFGJvqcXjA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=VQkI+Bitb+JFnJYSvA/ti/6vfRy6Yy3MkNNTQHFyjYI=;
 b=FZh6GQCOowHb1wcE0LgT9cxVSWY5osqJJHg7lF1gfPRrDabQgpoiT6HdMqEnBJJuvZ98PgUa1AF6bpgqEBeustkyGqudT9cm9hd3IwB1f6L6pB2nuC15PgIkwDfefVR9VGoWWaIlvxeCJnV5cx/1R5YbS+rgU+YoEYDCD6a/uPs=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, "michal.orzel@amd.com" <michal.orzel@amd.com>,
	"xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
	"ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
	"consulting@bugseng.com" <consulting@bugseng.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, Jan
 Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, Wei Liu
	<wl@xen.org>
Subject: Re: [XEN PATCH] xen: fix violations of MISRA C:2012 Rule 3.1
Thread-Topic: [XEN PATCH] xen: fix violations of MISRA C:2012 Rule 3.1
Thread-Index: AQHZtNlJBMaqjD35lk+am0TGpnL30K+2StiAgAAEHQCAAAVDAA==
Date: Wed, 12 Jul 2023 16:36:18 +0000
Message-ID: <48DC10E2-5B93-4D0D-A4EC-84DE63D0B917@arm.com>
References:
 <9a27f6cbe552a00274f7ad32eec63f0e80e7644f.1689176790.git.nicola.vetrini@bugseng.com>
 <94E9B010-D56E-46A4-AF8F-9010E34A3541@arm.com>
 <97bf441e-db06-6e37-c551-d5a7f30093d8@bugseng.com>
In-Reply-To: <97bf441e-db06-6e37-c551-d5a7f30093d8@bugseng.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|AS8PR08MB7944:EE_|AM7EUR03FT026:EE_|GV1PR08MB8450:EE_
X-MS-Office365-Filtering-Correlation-Id: be5f0ce6-9f74-4ce7-fc86-08db82f624d1
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 vp+NesPVK+jIS86/jtUQr2GjrIwZHC81JuPE7b+atYNmdRLEofgYDAIh1jOWNzN/rhpfn3PaIb4/KxW3t2ALS7dLuIa3KtStP+a+f6gfYh4sJTLOE8JPqmIC0MxlXUsVKstcwLaViB1GrW5WYFf7NQdTS+JtzJI/S7rxaTrdqSlvtSC7RnnIFGszixOMAyiUke3MOjsrABZ/6SkGc/L9zDQwCVg+0om4//wM6gJkm54TzBOLgB0BrTk6J23EfOCeEZCZEFnEGEYhBWQ3uRp8gg3wqdtMCX/OdAcY1D2yj53uH73szyokCaPGJDN88ckKaIP5XT0gzchkiO6sxYuCCbD9mXQb/Wbb/RHrqBoK1rj3f/RQHn2f11X9GYuZJXshSnOQ9vxNifFxS2AfRwFVXKo91EiDFo4ZdJoZX1swy9HMXIs+GnL44vsd1GVsqGs4OFyuf5XKtKzwGI6j8Iguy5Dx/5PZhD4Y6WEm5wC/3WkzTnllIW0JVPtl60GGh9nzJYYaF3b2+ljg/121DE5wH2I9wXEUc34SM2YEHATyZOli3bcVUsgHVlzus3HMNai7z9zoQ7v4xX6wm4q0pBJnh8FnG9IrCXY8zbQ5R+NEHJGFBNtqlT+GhzwV7VTShVZhVr32sTAoxnuKwndSOkVpaQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(366004)(39860400002)(346002)(396003)(451199021)(54906003)(83380400001)(41300700001)(2616005)(7416002)(2906002)(36756003)(186003)(5660300002)(38100700002)(33656002)(122000001)(26005)(6916009)(4326008)(8936002)(66446008)(8676002)(66556008)(6506007)(53546011)(64756008)(316002)(66476007)(76116006)(66946007)(91956017)(38070700005)(71200400001)(966005)(6512007)(478600001)(86362001)(6486002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <E1174516BFFBAB4B932B890B4A9FD9EA@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7944
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT026.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	8112779b-9adf-449e-1137-08db82f61e99
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	S5Zi6HW9IOSLvsHOzOfDSLKK/Wmbt5QurXZNhete7HLDNQ+RnjlS0CF/SL9bNr4IjzPkr8uMkTpJdDpcAbKhYMthwlJgrB2bu3I4iZJot1HYPamCGvdYaCT+p+d6SGnt+FRWPLLtCLXRKwcyiwBFFWJmAms17xC1guGsM0cVH+KbzYHo8+Jq/6xS72gQD8jal5Px2y2vFG/yKSzfSrH/jX3Qe2X1TVN7Zo7zAOWvhctf1NFIm0YJJ5mBoVr3bjadPT//E/TnT7X5oXcAIUqQi4tk9G79bHZWlxP7iILWLx6urgC2f3jk7GhYzld5hoDgtm3ZSWGWJJ91sEvNGMWgxlC3B95GINj94Eff+yf4UsbLPmExRqIxo/BkwI/wvuac1+dQbxhMWWJTRLZ5eV/cQ7pkxjEtCGSkGiKl/8YL1gRcjDu/otCwvSJ44ZFFJsTB7RisknA1VGoEdTFTjFHPv0Cpbfch5ffNJ6JTze8E65SwoF5iOqDnOHdmTnWwZuXHhe9Ki/JZQtDaLgQW6WjbEAWDb9oUbFmUPNENj5BWyCfOyNus5OGklhEOganhu2iGfR9Fi1/7fWEP61v4cDlPu3q9H7GZm1xfWPcgBDT7Hdl0WDcPnU4UH7l2ct+CJDnQfs4BF68vpXGAaon1m0UuVODzc8Qfk7becVwtRtju/2ZAVL8yX8Q0Rrtunb7EO5q9GY+UUXfry/Uv3Yp6AXftam/UWBnZy29RSUf6cgOy0rg=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(396003)(39860400002)(136003)(451199021)(46966006)(40470700004)(36840700001)(40460700003)(6862004)(8676002)(8936002)(47076005)(36860700001)(83380400001)(33656002)(2906002)(336012)(36756003)(2616005)(82740400003)(356005)(81166007)(82310400005)(86362001)(53546011)(40480700001)(6506007)(5660300002)(26005)(186003)(4326008)(6486002)(70586007)(54906003)(70206006)(41300700001)(6512007)(966005)(316002)(478600001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 16:36:29.3739
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: be5f0ce6-9f74-4ce7-fc86-08db82f624d1
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT026.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8450



> On 12 Jul 2023, at 17:17, Nicola Vetrini <nicola.vetrini@bugseng.com> wro=
te:
>=20
>=20
>=20
> On 12/07/23 18:02, Luca Fancellu wrote:
>>> On 12 Jul 2023, at 16:54, Nicola Vetrini <nicola.vetrini@bugseng.com> w=
rote:
>>>=20
>>> In the file 'xen/common/xmalloc_tlsf.c' is not clear how
>>> the commented-out code should interact with the previous statement.
>>> To resolve the MISRA violation generated by the nested comment
>>> a #if .. #endif block with an explanatory comment substitutes
>>> the earlier construct.
>>>=20
>>> In the file 'xen/include/xen/atomic.h' the nested comment has been remo=
ved,
>>> since the code sample is already explained by the preceding comment.
>>>=20
>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>> ---
>>> Following the suggestion of this message
>>> https://lore.kernel.org/xen-devel/536f3049-41f7-b127-ba94-81925e34ea0f@=
suse.com/
>>> an explanatory comment has been added.
>>> ---
>>> xen/common/xmalloc_tlsf.c | 13 ++++++++++---
>>> xen/include/xen/atomic.h  |  2 +-
>>> 2 files changed, 11 insertions(+), 4 deletions(-)
>>>=20
>>> diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c
>>> index c21bf71e88..56c3849414 100644
>>> --- a/xen/common/xmalloc_tlsf.c
>>> +++ b/xen/common/xmalloc_tlsf.c
>>> @@ -139,10 +139,17 @@ static inline void MAPPING_SEARCH(unsigned long *=
r, int *fl, int *sl)
>>>         *r =3D *r + t;
>>>         *fl =3D flsl(*r) - 1;
>>>         *sl =3D (*r >> (*fl - MAX_LOG2_SLI)) - MAX_SLI;
>>> -        *fl -=3D FLI_OFFSET;
>>> -        /*if ((*fl -=3D FLI_OFFSET) < 0) // FL will be always >0!
>>> -         *fl =3D *sl =3D 0;
>>> +        /*
>>> +         * It's unclear what was the purpose of the commented-out code=
 that now
>>> +         * is in the #else branch. The current form is motivated by th=
e correction
>>> +         * of a violation MISRA:C 2012 Rule 3.1
>>>          */
>>> +#if 1
>>> +        *fl -=3D FLI_OFFSET;
>>> +#else
>>> +        if ((*fl -=3D FLI_OFFSET) < 0) // FL will be always >0!
>> In the message you linked above, you suggested to use /* FL will be alwa=
ys >0! */, why has it changed?
>> Was some comment I missed? The xen codestyle mandates the use of /* */, =
anyway I agree that here you
>> are just moving code...
>> So maybe the maintainer can tell what is the best thing to do here.
>=20
> You didn't miss any further comment: my suggestion was related to the exp=
lanatory comment, not the nested comment itself. If a better wording can be=
 found for the former, no problem. As for the codestyle point: it does not =
change anything doing
> "// FL will be always >0!" -> "/* FL will be always >0!  */
> w.r.t. Rule 3.1 (both would have been nested comments).

Yes, I agree it does not change anything, now that I read better the messag=
e, it is from Jan suggesting this:

#if 1
    *fl -=3D FLI_OFFSET;
#else
    if ((*fl -=3D FLI_OFFSET) < 0) /* FL will be always >0! */
        *fl =3D *sl =3D 0;
#endif

So using /* FL will be always >0! */ instead of copying // FL will be alway=
s >0!

Anyway, I think it can be addressed on commit, whatever form the maintainer=
 prefers.

>=20
> Regards,
>=20
> --=20
> Nicola Vetrini, BSc
> Software Engineer, BUGSENG srl (https://bugseng.com)



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 16:39:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 16:39:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562696.879452 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJcs6-0003jT-Qp; Wed, 12 Jul 2023 16:39:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562696.879452; Wed, 12 Jul 2023 16:39:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJcs6-0003jM-Mu; Wed, 12 Jul 2023 16:39:22 +0000
Received: by outflank-mailman (input) for mailman id 562696;
 Wed, 12 Jul 2023 16:39:22 +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
 <SRS0=R8Q3=C6=citrix.com=prvs=550b2c143=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qJcs6-0003jG-C4
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 16:39:22 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a4ce09be-20d2-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 18:39:19 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a4ce09be-20d2-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689179959;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:content-transfer-encoding:in-reply-to;
  bh=cznVBpO5M0Y1bKJzT/U+o6yKu4DJiU1mC5AsiTOdwfY=;
  b=h/O80+sj8TWrV8tnF/nFccmn3ao/eOBKGL0fjmUhSUArgMlS1cK6floI
   2hvchqu32D6VbWzHzuzWGCAhldOA967cyRA1zBVN80VtZKci/zd+IqMQa
   AejoZcHklb/nvsZLghS49/+88EG+2jaa+KNlTHjT9jydmLIkbeP10v3pk
   w=;
Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 114709272
X-Ironport-Server: esa5.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:A1JOdq5EtIQ1zX0F6ljtqQxRtC3HchMFZxGqfqrLsTDasY5as4F+v
 mUYUTqFP/iMYGrxfN1xb4qz8kwEv5GEyIViSFds+HpgHi5G8cbLO4+Ufxz6V8+wwm8vb2o8t
 plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraCYnsrLeNdYH9JoQp5nOIkiZJfj9G8Agec0
 fv/uMSaM1K+s9JOGjt8B5mr9lU35ZwehBtC5gZlPa8S5geF/5UoJMl3yZ+ZfiOQrrZ8RoZWd
 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4
 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5m8
 vUCcyAdMz+6q/ON3O6GEuQ0v+VyFZy+VG8fkikIITDxCP8nRdbIQrnQ5M8e1zA17ixMNa+AP
 YxDM2MpNUmeJUQVYT/7C7pn9AusrnD5bz1frkPTvact6nLf5AdwzKLsIJzefdniqcB9xx/E+
 TqXpTujav0cHOW+lxaPsVSHvajgwA3ndrlVBqGT1sc/1TV/wURMUUZLBDNXu8KRmkO4Ht5SN
 UEQ0i4vtrQpslymSMHnWB+1q2LCuQQTM/JPF8Uq5QfLzbDbiy6bCXIDVSVpc8E9uYk9QjlC/
 laRksngHzBHrLyfQnXb/bCRxQ5eIgBMczVEP3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kBJnLWspbypK444em7EaZ4u6fbs/
 z6ISNlXK4JCjbT4OG1reh2G0r2MRaAtBzWu7Nj26Q=
X-Talos-CUID: 9a23:piQJ2WBWND3pknL6Ey5u7hUECp0KS1HM92uMHhe1UV9IGYTAHA==
X-Talos-MUID: 9a23:t4uQWwV5zEKfbn/q/AbN2h1od+FD2OOBVW4Rv65BqdWvFRUlbg==
X-IronPort-AV: E=Sophos;i="6.01,200,1684814400"; 
   d="scan'208";a="114709272"
Date: Wed, 12 Jul 2023 17:39:01 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
CC: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>, Juergen Gross
	<jgross@suse.com>
Subject: Re: [PATCH v2 3/6] libxl: introduce MSR data in libxl_cpuid_policy
Message-ID: <d7be70e8-611c-4f7d-a585-2a00b1513a92@perard>
References: <20230711092230.15408-1-roger.pau@citrix.com>
 <20230711092230.15408-4-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230711092230.15408-4-roger.pau@citrix.com>

On Tue, Jul 11, 2023 at 11:22:27AM +0200, Roger Pau Monne wrote:
> Add a new array field to libxl_cpuid_policy in order to store the MSR
> policies.
> 
> Note that libxl_cpuid_policy_list_{copy,length,parse_json,gen_json}
> are not adjusted to deal with the new MSR array now part of
> libxl_cpuid_policy_list.

Why? Isn't this going to be an issue? Or maybe that going to be dealt
with in a future patch?

> 
> Adding the MSR data in the libxl_cpuid_policy_list type is done so
> that existing users can seamlessly pass MSR features as part of the
> CPUID data, without requiring the introduction of a separate
> domain_build_info field, and a new set of handlers functions.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
>  tools/libs/light/libxl_cpuid.c    | 6 +++++-
>  tools/libs/light/libxl_internal.h | 1 +
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
> index 724cb4f182d4..65cad28c3ef0 100644
> --- a/tools/libs/light/libxl_cpuid.c
> +++ b/tools/libs/light/libxl_cpuid.c
> @@ -40,6 +40,9 @@ void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl)
>          free(policy->cpuid);
>      }
>  
> +    if (policy->msr)

You don't need to test for NULL, you can call free() in this case as
well.

> +        free(policy->msr);
> +
>      free(policy);
>      *pl = NULL;
>      return;

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 16:58:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 16:58:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562706.879461 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJdAE-0006D4-A5; Wed, 12 Jul 2023 16:58:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562706.879461; Wed, 12 Jul 2023 16:58:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJdAE-0006Cx-7Y; Wed, 12 Jul 2023 16:58:06 +0000
Received: by outflank-mailman (input) for mailman id 562706;
 Wed, 12 Jul 2023 16:58:04 +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
 <SRS0=R8Q3=C6=citrix.com=prvs=550b2c143=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qJdAC-0006Cr-Ee
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 16:58:04 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 42009120-20d5-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 18:58:01 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 42009120-20d5-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689181081;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:content-transfer-encoding:in-reply-to;
  bh=z/YEa944EpbIWQAR6Y1H9k5PiGhMvb5I+/cKEtZxC5I=;
  b=Oh8y+cqN0fKDIxe/uIP4KAOXY4gzhuWGSsWycwlDAAgsdgRYLbMksS7j
   ovKjxdaPPBla4IV9N72EzPop75Jx+9PoryI+0G3gUGFul72Z1lkJqCZAk
   Tri9g+nskJmeSitfZeXSJvi8vXscqKBbqCuOdhhcxwjFQrjNar9vMoOj9
   I=;
Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 118579462
X-Ironport-Server: esa4.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:ilyFO6znVf1TcC+4R7Z6t+cixirEfRIJ4+MujC+fZmUNrF6WrkUFn
 WYcDWmEPPaPZzaje40lYIqwp0oG7MDXn4NkTQc4ryAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEO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==
X-IronPort-AV: E=Sophos;i="6.01,200,1684814400"; 
   d="scan'208";a="118579462"
Date: Wed, 12 Jul 2023 17:57:47 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
CC: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>, Juergen Gross
	<jgross@suse.com>
Subject: Re: [PATCH v2 4/6] libxl: split logic to parse user provided CPUID
 features
Message-ID: <478e0509-033a-4442-af93-7085ee1effaf@perard>
References: <20230711092230.15408-1-roger.pau@citrix.com>
 <20230711092230.15408-5-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230711092230.15408-5-roger.pau@citrix.com>

On Tue, Jul 11, 2023 at 11:22:28AM +0200, Roger Pau Monne wrote:
> Move the CPUID value parsers out of libxl_cpuid_parse_config() into a
> newly created cpuid_add() local helper.  This is in preparation for
> also adding MSR feature parsing support.
> 
> No functional change intended.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 17:03:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 17:03:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562711.879471 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJdFe-0007fO-Ta; Wed, 12 Jul 2023 17:03:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562711.879471; Wed, 12 Jul 2023 17:03:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJdFe-0007fH-Qu; Wed, 12 Jul 2023 17:03:42 +0000
Received: by outflank-mailman (input) for mailman id 562711;
 Wed, 12 Jul 2023 17:03:41 +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
 <SRS0=ZlNA=C6=arm.com=Rahul.Singh@srs-se1.protection.inumbo.net>)
 id 1qJdFd-0007fB-8A
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 17:03:41 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20622.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::622])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0affd781-20d6-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 19:03:38 +0200 (CEST)
Received: from DU2PR04CA0045.eurprd04.prod.outlook.com (2603:10a6:10:234::20)
 by DBAPR08MB5559.eurprd08.prod.outlook.com (2603:10a6:10:1a4::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Wed, 12 Jul
 2023 17:03:35 +0000
Received: from DBAEUR03FT022.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:234:cafe::5b) by DU2PR04CA0045.outlook.office365.com
 (2603:10a6:10:234::20) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20 via Frontend
 Transport; Wed, 12 Jul 2023 17:03:35 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT022.mail.protection.outlook.com (100.127.142.217) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.22 via Frontend Transport; Wed, 12 Jul 2023 17:03:34 +0000
Received: ("Tessian outbound e1fdbe8a48d3:v145");
 Wed, 12 Jul 2023 17:03:34 +0000
Received: from f3c486dd6195.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 8DA5D342-B2FB-4080-BFCF-C434BABC4E12.1; 
 Wed, 12 Jul 2023 17:03:28 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f3c486dd6195.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 12 Jul 2023 17:03:28 +0000
Received: from AM9PR08MB7165.eurprd08.prod.outlook.com (2603:10a6:20b:41f::23)
 by AS8PR08MB5991.eurprd08.prod.outlook.com (2603:10a6:20b:29f::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 17:03:26 +0000
Received: from AM9PR08MB7165.eurprd08.prod.outlook.com
 ([fe80::a4db:63a3:ef32:ffd3]) by AM9PR08MB7165.eurprd08.prod.outlook.com
 ([fe80::a4db:63a3:ef32:ffd3%4]) with mapi id 15.20.6565.028; Wed, 12 Jul 2023
 17:03:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0affd781-20d6-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Ba6Mja8EZteepbYdAvxgOHhUTyOaOw3eVOGNs7AF7b4=;
 b=4uj7+f4tUjKaQdyRp+tHz/53UOjern5e8subKAvbf29n6jL+QodXLuRkqvv5bRohghuvr/i2abky6rYHkgjKWVCaUd/Ys/69UWBSFhNhej48RHxh7U0slZ7jX5KG+kM5aaPwgV3VVYkrNZ7MV543GSohZD8b99NzYcE9HztnHPQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 2a3b9bfa7c7f57c2
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=DE8GgiHFLTuuN/wT3rf9TO0YtEI/Kh4V3PU2zoiaGtutYKgYACTefjtVrEa+j5uUZWvn6GQ7hit6tkOSTeK5wHUnNl+EQdmKc7o8R9qidk833dVvGplt8hn/YofLAgw+6+Zn0t7H7pdC24vmhVHaf+G1zt4zxD0wPihqskIITIOXVPQQi2+fc3fIdnA1u+n1n1OUDNfrQkgz7fyUNOcZfPxy//dVenOvoQxb9P5veey3CLej92S64oaZatna/v4deAklwFpw5QuWXa0AQ+2Te6Xc8pO3VDYDK0BMt/HmcH3SnPJ66lMgKP6VnvzOqWxgYm+Cgl/26lmKaNvlq007Ew==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Ba6Mja8EZteepbYdAvxgOHhUTyOaOw3eVOGNs7AF7b4=;
 b=WosnRvut5qTaTFxrgWCvswNfbxmEi2zWwKtRShMb9mnr2F3V2tzQla57RFAmjpb51hQhTN4Gu7DwIicXZRh8Ce4K4AKJajf9R/K1PK9mUHHBVJJtNefwwHneIB+8CWnL/HhXgntttS/A6kg0d7rD3PQD0X5YJ2LFLISiNUYTBk7VyMRvk4sBQtSByfaZ96DjQnDMrnmF3Ee3WOEGz1nsBDU4tR4VBNwgxYZxmqnQI5q4/qlLCBv7uQeAOtj3alkX10aCQP2rts0iMh4X9zGhxk7AeIaFtQTThNarhYWeRdkE2SVr0lXBMCp/EW0S2X57A0SbQEUS5xohO6N7/9A5Vw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Ba6Mja8EZteepbYdAvxgOHhUTyOaOw3eVOGNs7AF7b4=;
 b=4uj7+f4tUjKaQdyRp+tHz/53UOjern5e8subKAvbf29n6jL+QodXLuRkqvv5bRohghuvr/i2abky6rYHkgjKWVCaUd/Ys/69UWBSFhNhej48RHxh7U0slZ7jX5KG+kM5aaPwgV3VVYkrNZ7MV543GSohZD8b99NzYcE9HztnHPQ=
From: Rahul Singh <Rahul.Singh@arm.com>
To: Stewart Hildebrand <Stewart.Hildebrand@amd.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
Subject: Re: [PATCH v3] xen/arm: pci: fix check in pci_check_bar()
Thread-Topic: [PATCH v3] xen/arm: pci: fix check in pci_check_bar()
Thread-Index: AQHZtMggOVMN7Efb4EuWVUiRObIz7a+2W9aA
Date: Wed, 12 Jul 2023 17:03:26 +0000
Message-ID: <5DC13CCA-D174-421B-A8DE-B20DEDC8823E@arm.com>
References: <20230712135226.747472-1-stewart.hildebrand@amd.com>
In-Reply-To: <20230712135226.747472-1-stewart.hildebrand@amd.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM9PR08MB7165:EE_|AS8PR08MB5991:EE_|DBAEUR03FT022:EE_|DBAPR08MB5559:EE_
X-MS-Office365-Filtering-Correlation-Id: bd0eb872-0c2a-48f3-f568-08db82f9ed8d
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 v/tLp7jOf8bpXpK0izVFMnTm12hKyuAfoktVwXr9B/ueNk7ch6rTB33ZQ4jNXW2jURLdLVWNDW2uOhQFeVN39T0erDGvE6rQSZkvCLNgCeUf3PLGlaNeSXTacjq11cruWIiWh9E7C40agr1Kbbtwo5G3fx4mzUWitTEgzxmw19tgTdn9jsYQqDrpM9U0vEzkyFMhV5Frwgm6vYYYNvzmqGTpPyL8BaP1p10JX4mD7qPLB8Le7MZqYcus95oweFtQTI+4ZpQtBOlg98w0rhRsui/dU1+FsGd4mC60h3ZcCX91O/e5KlnukTaAScEkhRn0iD7I8Q23wqWiWnr4qTjGZNYngrfKBXQat7NUtT3dSdZHfxFk25KN0TSgQI3jNtNjR1Nb3qgI7MdO0tIjVmdc7mjpzR142Z/vTUaNt6ytuEkL5b+egyFo2zoQmwdH6u/Ytsf/5ctzQGbxjkKcRjwtX5I+/JO3O7NE210EUgrbybHDIjcbFtJYzAuz9YN60xk6qDF1mAwJOvc02ifCIb/ek2bKCJ1q6L+siWJVPcIsiPh4aAneQ4HYpdi0YlYb2exywY9bnRmyVQu0qyMI33/wFdF/6F8rDPPeAacbUcQj7btT+JozpGps6kCxlKx36lYDtDO/dW5+Vhy0TuSMRJ75Ig==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR08MB7165.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(366004)(376002)(346002)(39860400002)(396003)(451199021)(66946007)(91956017)(66446008)(64756008)(66476007)(4326008)(6916009)(76116006)(66556008)(478600001)(36756003)(54906003)(86362001)(38070700005)(26005)(6506007)(53546011)(186003)(33656002)(71200400001)(6512007)(6486002)(83380400001)(38100700002)(122000001)(41300700001)(2616005)(8676002)(8936002)(316002)(2906002)(5660300002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <B7707ED5EBEA4F42A67D4E572899740F@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB5991
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT022.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	462ce072-ee98-4e06-0c6e-08db82f9e878
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	gsRbEoXpo96mGHwy3ftlKFtPqlyQy9Hr+j4lpdDNnuzSmYEcsF7U3f6FpQ9aPM+KxUsp1MKCjLlQuOcvKwxzY88d6E2m4/SopbDiKZr1OOTkItx9TF65xhw10ZDcDsJz9N14oNG5UtcDhHYl/yRqZhW30LLYBttWK4uQrYvbYnbW/6oaS45JqDa5c94NWaImoiroJMPWeryItuR74dGc8jYbhodC/EILm1BRFGMn9j9EK7cQV900yYZ1sdZxLM+mWwgPzpKTuAdTolMn3fuIjRrqWV5qvXHPpWuZm2IPYzBwAD2VyfShLUBHnFiF/dYoMmM5XGq36jvj1NQpeDF1ONHiUMQXHgDC6sSYtMNE3Xfs4+hZ/u9T0DbHtkMkmQiTyaFMbZICMnmO6DRXFQCeLz4Mrh3dhgzBMOAEa1zDabQEu+ff8qgtD+W6vWFKNKpZidngqdmNu+21UOM+D39/dKfaaFwK92OAApFJ/m9eXrEcrNBZFiyqo8jOgFE+2/oFUXQCg4x+XuW+UflLsuUCtNTEkotyK8ljBDarX7Y1MsIeg9nyKdutkFPQHB2R95m54FEnlFchwnqGB6UIH69tWjkTZZk3YvVETWnmKWe02UNWnV54mksM67DH5dwMwckgU5rMmiskKVjrbSeL9+sjuqF6sUbTLQn2T/iB6jATYyDnRwsCiQioWY228KAXDhMomKSFhkFCTR3LXqGUht230i2Mf8G2So/ly4lq0+jkmFU=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(136003)(376002)(346002)(451199021)(36840700001)(46966006)(40470700004)(82740400003)(40480700001)(86362001)(40460700003)(36860700001)(36756003)(83380400001)(2906002)(356005)(2616005)(478600001)(107886003)(6486002)(54906003)(26005)(6506007)(53546011)(5660300002)(186003)(6512007)(8676002)(41300700001)(6862004)(8936002)(336012)(47076005)(4326008)(316002)(70206006)(70586007)(81166007)(82310400005)(33656002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 17:03:34.6872
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: bd0eb872-0c2a-48f3-f568-08db82f9ed8d
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT022.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5559

SGkgU3Rld2FydCwNCg0KPiBPbiAxMiBKdWwgMjAyMywgYXQgMjo1MiBwbSwgU3Rld2FydCBIaWxk
ZWJyYW5kIDxTdGV3YXJ0LkhpbGRlYnJhbmRAYW1kLmNvbT4gd3JvdGU6DQo+IA0KPiBXaGVuIG1h
cHBpbmcgQkFScyBmb3IgdlBDSSwgaXQncyB2YWxpZCBmb3IgYSBCQVIgbWZuX3Qgc3RhcnQgdG8g
ZXF1YWwgdGhlIEJBUg0KPiBtZm5fdCBlbmQgKGkuZS4gc3RhcnQgPT0gZW5kKSBzaW5jZSBlbmQg
aXMgaW5jbHVzaXZlLiBIb3dldmVyLCBwY2lfY2hlY2tfYmFyKCkNCj4gY3VycmVudGx5IHJldHVy
bnMgZmFsc2UgaW4gdGhpcyBjYXNlLCB3aGljaCByZXN1bHRzIGluIFhlbiBub3QgbWFwcGluZyB0
aGUgQkFSDQo+IGluIHRoZSBndWVzdCAybmQgc3RhZ2UgcGFnZSB0YWJsZXMuIEluIHRoaXMgZXhh
bXBsZSBib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1QGNpdHJpeC5jb20+
DQoNCkkgdGVzdGVkIHRoZSBwYXRjaCBvbiBOMVNEUCBib2FyZCBldmVyeXRoaW5nIHdvcmtzLg0K
DQpSZXZpZXdlZC1ieTogUmFodWwgU2luZ2ggPHJhaHVsLnNpbmdoQGFybS5jb20+DQpUZXN0ZWQt
Ynk6IFJhaHVsIFNpbmdoIDxyYWh1bC5zaW5naEBhcm0uY29tPg0KDQpSZWdhcmRzLA0KUmFodWw=


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 17:04:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 17:04:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562714.879482 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJdGg-0008BY-6w; Wed, 12 Jul 2023 17:04:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562714.879482; Wed, 12 Jul 2023 17:04:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJdGg-0008BR-4C; Wed, 12 Jul 2023 17:04:46 +0000
Received: by outflank-mailman (input) for mailman id 562714;
 Wed, 12 Jul 2023 17:04:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ZlNA=C6=arm.com=Rahul.Singh@srs-se1.protection.inumbo.net>)
 id 1qJdGe-0008AL-Ql
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 17:04:44 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0618.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::618])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 327af46c-20d6-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 19:04:44 +0200 (CEST)
Received: from AS4P251CA0002.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d2::8)
 by AS8PR08MB7323.eurprd08.prod.outlook.com (2603:10a6:20b:442::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 17:04:41 +0000
Received: from AM7EUR03FT007.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:5d2:cafe::fc) by AS4P251CA0002.outlook.office365.com
 (2603:10a6:20b:5d2::8) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20 via Frontend
 Transport; Wed, 12 Jul 2023 17:04:41 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT007.mail.protection.outlook.com (100.127.140.242) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.22 via Frontend Transport; Wed, 12 Jul 2023 17:04:40 +0000
Received: ("Tessian outbound d7adc65d10b4:v145");
 Wed, 12 Jul 2023 17:04:40 +0000
Received: from 34e11de95373.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 8C23C3C3-A3BB-43E8-8E49-F9DD24FF6E3E.1; 
 Wed, 12 Jul 2023 17:04:34 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 34e11de95373.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 12 Jul 2023 17:04:34 +0000
Received: from AM9PR08MB7165.eurprd08.prod.outlook.com (2603:10a6:20b:41f::23)
 by AS8PR08MB5991.eurprd08.prod.outlook.com (2603:10a6:20b:29f::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul
 2023 17:04:32 +0000
Received: from AM9PR08MB7165.eurprd08.prod.outlook.com
 ([fe80::a4db:63a3:ef32:ffd3]) by AM9PR08MB7165.eurprd08.prod.outlook.com
 ([fe80::a4db:63a3:ef32:ffd3%4]) with mapi id 15.20.6565.028; Wed, 12 Jul 2023
 17:04:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 327af46c-20d6-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Ba6Mja8EZteepbYdAvxgOHhUTyOaOw3eVOGNs7AF7b4=;
 b=oC5BVLHyuT7zCbXBFtCphN91By3rE+6Ep4LcGr8BRq9PTYeh1EXco2B6djxbtUGTmBDGp/78wXy/W7wswhJnAr697lI0mZoF0G0cOoYHRsS2S4VhfbVNJLzQC8jtZzGp/g0MkKgG+qUWyfybxDSwvEMSP7DHAXvSMewbypd9lwo=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 2212b56886e5531e
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=la9ICwF4F1WOKBcpxuhNLVWgY34+hlL0GXMfPxephuO+XtAUld6M3FbtQ4yAt2kOQXqcQJno9y8lovNLGRQDCPt/xpQZzopeguyJBIvXgp3yhz848AO+ncCWueH/4jzB5M3WqhCwj1IktsVlr3MkXnONhP1hbOHLTAblkQ3d9bCvmXQhbOWfzSbUU3/Kaaq1gP4IWi+eQlTm5Mw9ixu1wtck3YJ872stvVK74d+fPb4eolkBw4BLz2Lb4aiNfuT9JWU27oaepJzjXnmGh7nQcMClkdJx0yBdWKo6CqnF17A/hb0v+q1L1jMvG4ufKH/Lg1VqosvVR30ig+24ANeLgQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Ba6Mja8EZteepbYdAvxgOHhUTyOaOw3eVOGNs7AF7b4=;
 b=XZiTZBhxvUEquZyfJR+lXEdmmF9bD2n3O287gKBW4+MfufJBilwtLhb1AqKgDnrc6wJd3J+/X/4AhlU/vK1a7NOJ9vRmWzump6kRLVeb7BnOjTxIq6G5uUYQ+9chQyVDtYfFvWbAF4P7/nrz0/9eD9Bis6c2BMaddktsCivvRvr/yB1kDuH2bnPtJmhu0ul3wYOt0tlY5c62ln2mTBbifm7xb54NPowBySanRFMyxogFegthBhaAQuXdQCOzh1qm/eKxCDrEHc4ygW03Dkvnr3f88wqT5brkAJq02gelniLt2Crd3JGkGUu2qnlvLC/3+hTHqWp4Bjwwy33M9GMlYA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Ba6Mja8EZteepbYdAvxgOHhUTyOaOw3eVOGNs7AF7b4=;
 b=oC5BVLHyuT7zCbXBFtCphN91By3rE+6Ep4LcGr8BRq9PTYeh1EXco2B6djxbtUGTmBDGp/78wXy/W7wswhJnAr697lI0mZoF0G0cOoYHRsS2S4VhfbVNJLzQC8jtZzGp/g0MkKgG+qUWyfybxDSwvEMSP7DHAXvSMewbypd9lwo=
From: Rahul Singh <Rahul.Singh@arm.com>
To: Stewart Hildebrand <Stewart.Hildebrand@amd.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
Subject: Re: [PATCH v3] xen/arm: pci: fix check in pci_check_bar()
Thread-Topic: [PATCH v3] xen/arm: pci: fix check in pci_check_bar()
Thread-Index: AQHZtMggOVMN7Efb4EuWVUiRObIz7a+2W+KA
Date: Wed, 12 Jul 2023 17:04:32 +0000
Message-ID: <1FA588FD-8C55-4796-A75D-120D27AD5507@arm.com>
References: <20230712135226.747472-1-stewart.hildebrand@amd.com>
In-Reply-To: <20230712135226.747472-1-stewart.hildebrand@amd.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM9PR08MB7165:EE_|AS8PR08MB5991:EE_|AM7EUR03FT007:EE_|AS8PR08MB7323:EE_
X-MS-Office365-Filtering-Correlation-Id: 9a2e1d8a-07fe-4cdc-8c18-08db82fa1507
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 2gPJpp97d/oc2SGWws9rQtntyRh4hosFq4689gOePvlImMyGlBffdL98piecL4kGBgDfKg36TMC3muKc/7rzEftyfg5rGGIHYclQkJMJYVr8Az1PDk/Re2kpPyp6e6DS4Ho2Srx5Yauvh8PvTubDdA4qQmMlOHCkeCZj6qfPiltCm4buSEGy1BSejIzt+IsXLJW1Poyh/X84nVKZ/MidxzIcXBCPuaosgfnoXW8Dz62mmslv679wijFuzUyu4Y64JXx4KUmncThQZ6WkVIx3zLhsOHQYaaZMNbvrt7pkXXziY/Kj0RHjW3RAOfJS/s377UVHToGNGm3TUuWaSvcq2rzQMEK81hUiMBnfH7oQrX3VqBLa/NQ2gimsk6BEPVFibjeqpoFqHEqFqynKiwoNEHeFZNpX4n96O4ZiAeoIMs59xOLBe2H+6To5FwfsBaWufdr0R8gkRjYJ7BGzUMWALOfIP3MHOCdglcDXZKmvoFA4cuPKhbf1OBmSheWUd8ABRdUVXdhyQ5Gdl7B7FeX2T6il5z8TbOz7RNvIWRUNPs2TAuzChAcHX0AJjT6jFhIBqyRfgs0wDQ6rt+jcWGjUbW5obQVE0YE8tgVVM6GtDBJ0NDSO6yrdkVNxyHa/Qn0bES4D1wcqGYI81soWvROvJQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR08MB7165.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(366004)(376002)(346002)(39860400002)(396003)(451199021)(66946007)(91956017)(66446008)(64756008)(66476007)(4326008)(6916009)(76116006)(66556008)(478600001)(36756003)(54906003)(86362001)(38070700005)(26005)(6506007)(53546011)(186003)(33656002)(71200400001)(6512007)(6486002)(83380400001)(38100700002)(122000001)(41300700001)(2616005)(8676002)(8936002)(316002)(2906002)(5660300002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <9ED13E6A1567724FA912D773D8E66B57@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB5991
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT007.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	d0f7d1cf-740e-4ebf-5d66-08db82fa0fdb
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	mwxWbBz7m+oXw7iIeo/1/vP5Xcgn8CvLUF6UKUYQdC1K/Zt8ljWGgNcn5rfjVfjXHb+8E5lg3NuZJtc6OcNK9xGEuTEhpMYzfbgiNvzZ/1xmxVVllTWoWgCgzOuIFL54i+F6q/J/UZAsWGRUH8oFng4uQaLTp8xekcwGxMp/3IAFC9CYebc4EoKb0di+OqZHgwEt/RDy5gOlmcEX/jF8m5NOPFu1Beo1KxIa+iwJEdlab5XjzdlaltgRRpwx8mAEofiO0+ZMPlnsBZTOu2syR1hBKYM7n+YP+O2flUh9PMfnDpSsS16x+KuTfytBgz/6UKNgpVJX5V/m42Z9KDWh12F+F2i8UTyMN+AJyzJ9un9y0G4u+rjhkWOOkPjQAqZ2vHfealSHuhQbT22TEa1tJZ2f8yj7wHtndz2Nz2ig1DaSs3DDkd/71d48kY+aRmYyRN65vZhQpil3u1LCVjfHlsHvL/Jz/FKAiVtJeVCNSV5SNeCsB3W3L6JMAkvh+BXPau0X3wP1o6ZlSp8b8TSYpjfg5n+v4zSgAbVJxFDNOMzqZgdN4RYWhErmcejHYa8weD5smD36oa5BMazR6Tv/jR9FnSDZBwD8iDuGcTWlfELKGSrIsFST+rz/5BVVeFOF+B7d1u6tU1KpBvVi/5h/SVgLD8VRWnyTFY63kZnrptPp1ojnlTGKJNL4pYJaZmGNQGhR2hktG79LHn6Yu6c6kG6bi6QXxN5XJkL3dy90w1s=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(396003)(376002)(136003)(451199021)(40470700004)(46966006)(36840700001)(70206006)(4326008)(70586007)(316002)(41300700001)(2906002)(478600001)(8676002)(8936002)(5660300002)(6862004)(54906003)(36860700001)(6486002)(6512007)(40460700003)(107886003)(40480700001)(53546011)(6506007)(26005)(186003)(36756003)(83380400001)(336012)(33656002)(47076005)(356005)(82740400003)(81166007)(82310400005)(2616005)(86362001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 17:04:40.8683
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 9a2e1d8a-07fe-4cdc-8c18-08db82fa1507
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT007.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7323

SGkgU3Rld2FydCwNCg0KPiBPbiAxMiBKdWwgMjAyMywgYXQgMjo1MiBwbSwgU3Rld2FydCBIaWxk
ZWJyYW5kIDxTdGV3YXJ0LkhpbGRlYnJhbmRAYW1kLmNvbT4gd3JvdGU6DQo+IA0KPiBXaGVuIG1h
cHBpbmcgQkFScyBmb3IgdlBDSSwgaXQncyB2YWxpZCBmb3IgYSBCQVIgbWZuX3Qgc3RhcnQgdG8g
ZXF1YWwgdGhlIEJBUg0KPiBtZm5fdCBlbmQgKGkuZS4gc3RhcnQgPT0gZW5kKSBzaW5jZSBlbmQg
aXMgaW5jbHVzaXZlLiBIb3dldmVyLCBwY2lfY2hlY2tfYmFyKCkNCj4gY3VycmVudGx5IHJldHVy
bnMgZmFsc2UgaW4gdGhpcyBjYXNlLCB3aGljaCByZXN1bHRzIGluIFhlbiBub3QgbWFwcGluZyB0
aGUgQkFSDQo+IGluIHRoZSBndWVzdCAybmQgc3RhZ2UgcGFnZSB0YWJsZXMuIEluIHRoaXMgZXhh
bXBsZSBib290IGxvZywgTGludXggaGFzIG1hcHBlZA0KPiB0aGUgQkFScyBpbiB0aGUgMXN0IHN0
YWdlLCBidXQgc2luY2UgWGVuIGRpZCBub3QgbWFwIHRoZW0gaW4gdGhlIDJuZCBzdGFnZSwNCj4g
TGludXggZW5jb3VudGVycyBhIGRhdGEgYWJvcnQgYW5kIHBhbmljczoNCj4gDQo+IFsgICAgMi41
OTMzMDBdIHBjaSAwMDAwOjAwOjAwLjA6IEJBUiAwOiBhc3NpZ25lZCBbbWVtIDB4NTAwMDgwMDAt
MHg1MDAwOGZmZl0NCj4gWyAgICAyLjU5MzY4Ml0gcGNpIDAwMDA6MDA6MDAuMDogQkF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4uLg0KPiANCj4gQWRq
dXN0IHRoZSBlbmQgcGh5c2ljYWwgYWRkcmVzcyBlIHRvIGFjY291bnQgZm9yIHRoZSBmdWxsIHBh
Z2Ugd2hlbiBjb252ZXJ0aW5nDQo+IGZyb20gbWZuLCBhdCB3aGljaCBwb2ludCBzIGFuZCBlIGNh
bm5vdCBiZSBlcXVhbCwgc28gZHJvcCB0aGUgZXF1YWxpdHkgY2hlY2sgaW4NCj4gdGhlIGNvbmRp
dGlvbi4NCj4gDQo+IE5vdGUgdGhhdCBhZGp1c3RpbmcgZSB0byBhY2NvdW50IGZvciB0aGUgZnVs
bCBwYWdlIGFsc28gaW5jcmVhc2VzIHRoZSBhY2N1cmFjeQ0KPiBvZiB0aGUgc3Vic2VxdWVudCBp
c19iYXJfdmFsaWQgY2hlY2suDQo+IA0KPiBGaXhlczogY2M4MGUyYmFiMGQwICgieGVuL3BjaTog
cmVwbGFjZSBjYWxsIHRvIGlzX21lbW9yeV9ob2xlIHRvIHBjaV9jaGVja19iYXIiKQ0KPiBTaWdu
ZWQtb2ZmLWJ5OiBTdGV3YXJ0IEhpbGRlYnJhbmQgPHN0ZXdhcnQuaGlsZGVicmFuZEBhbWQuY29t
Pg0KPiBSZXZpZXdlZC1ieTogUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+
DQoNCkkgdGVzdGVkIHRoZSBwYXRjaCBvbiBOMVNEUCBib2FyZCBldmVyeXRoaW5nIHdvcmtzLg0K
DQpSZXZpZXdlZC1ieTogUmFodWwgU2luZ2ggPHJhaHVsLnNpbmdoQGFybS5jb20+DQpUZXN0ZWQt
Ynk6IFJhaHVsIFNpbmdoIDxyYWh1bC5zaW5naEBhcm0uY29tPg0KDQpSZWdhcmRzLA0KUmFodWw=


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 17:16:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 17:16:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562721.879492 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJdRa-0001PP-9o; Wed, 12 Jul 2023 17:16:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562721.879492; Wed, 12 Jul 2023 17:16:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJdRa-0001PI-79; Wed, 12 Jul 2023 17:16:02 +0000
Received: by outflank-mailman (input) for mailman id 562721;
 Wed, 12 Jul 2023 17:16:00 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJdRY-0001P8-Jp; Wed, 12 Jul 2023 17:16:00 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJdRY-00060l-FX; Wed, 12 Jul 2023 17:16:00 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJdRY-0003RG-62; Wed, 12 Jul 2023 17:16:00 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJdRY-0002Me-5V; Wed, 12 Jul 2023 17:16:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=+O3y1DkpJW3wHHzCSuPHV7HHbUOLr46wC+JEQaoGOI0=; b=jyVDa5LVsRadTuQepsm9Ly+9sb
	2qfZW/m4d5hOSP40vFA71gX4DCp0IZG70kpi8+o74IMuNFZZ4mZZlMX6zE33ZqS602eVzkU4Irl5s
	Z8+5xNBN6yaxihjR4E+5LJyjBO7OW6fOrcK4rLNBBy6UVSjHLSaNUDbZFp8BQMVhBI6E=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181769-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 181769: tolerable FAIL - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt-raw:guest-start:fail:heisenbug
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=ded44a0406c82c560b654ac69ef4259add152eb4
X-Osstest-Versions-That:
    libvirt=3bf02acdc5446b2c4a3078f99d8f5232acff9043
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 12 Jul 2023 17:16:00 +0000

flight 181769 libvirt real [real]
flight 181775 libvirt real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181769/
http://logs.test-lab.xenproject.org/osstest/logs/181775/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-libvirt-raw 13 guest-start         fail pass in 181775-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check fail blocked in 181759
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail in 181775 like 181759
 test-armhf-armhf-libvirt-raw 14 migrate-support-check fail in 181775 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181759
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass

version targeted for testing:
 libvirt              ded44a0406c82c560b654ac69ef4259add152eb4
baseline version:
 libvirt              3bf02acdc5446b2c4a3078f99d8f5232acff9043

Last test of basis   181759  2023-07-11 04:18:51 Z    1 days
Testing same since   181769  2023-07-12 04:20:30 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Michal Privoznik <mprivozn@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   3bf02acdc5..ded44a0406  ded44a0406c82c560b654ac69ef4259add152eb4 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 17:23:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 17:23:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562727.879502 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJdYm-0002sS-1N; Wed, 12 Jul 2023 17:23:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562727.879502; Wed, 12 Jul 2023 17:23:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJdYl-0002sL-UY; Wed, 12 Jul 2023 17:23:27 +0000
Received: by outflank-mailman (input) for mailman id 562727;
 Wed, 12 Jul 2023 17:23:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=R8Q3=C6=citrix.com=prvs=550b2c143=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qJdYk-0002sF-Rd
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 17:23:26 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cdc54f90-20d8-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 19:23:24 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cdc54f90-20d8-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689182604;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:content-transfer-encoding:in-reply-to;
  bh=+RQZc0OWIh9IEnCUXPS7aXu/ofA/Ef3cLNXyHevqBq4=;
  b=b1evxeHdRBdIUbDuDd7316Gg0PUmXZ+sktz0T0a5AOMlaLA+SclApBOz
   iWymTBGgX2JRzbik8d8FGhu18e+BX6EMisYE8iKlNZWl5O6gqVs0C6Wx3
   SJDCEaoULKMLUeQGVLNRYs7GVBU5PYy4bBufb2veK2eVWWU6M1k7vuonX
   M=;
Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 116427630
X-Ironport-Server: esa1.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:1T3tAqzwUg4nV+Fiwad6t+cixirEfRIJ4+MujC+fZmUNrF6WrkUAn
 zcWDTqEa/aLZ2L2edolPNjk8E0C757VytNlTlY5qSAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhPKoT5zcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KVxxx
 8EmBAs2V0uk3tuMyY+yU9lCv9t2eaEHPKtH0p1h5TTQDPJgSpHfWaTao9Rf2V/chOgXQ6yYP
 ZBAL2MyMlKZOUYn1lQ/UfrSmM+hgGX/dDtJ7kqYv6Mt70DYzRBr0airO93QE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DW/N7TTSxnkUKyvD4LjfMTtXpCSoETAYUh7LD3vXklUKvoLhiKqrzPI9
 MeSf00I8wmNW9yWkqp/VWHBubcGUjbUC32BHTq8fblrgS+1EoJs3fxQ6ck7y09HEZXcege2w
 2DCNUwqJheCsIZKblwC446MLSKI32ITByJK26cJ1PqfZt3Sk7lutr77vEv6O62Zppg9upDpL
 3RFF5X8XU1YE2GM7zx4LRbth/KW2mzRjLr14VX4IV4oKT1QP7xPTSEU01GqbrpnxwzOLysZx
 +IAuMeP9bzaW/1XYpZ1Qz3XJdfbXEYTc0Oo94+H1aDuNjCJIHmvvHSNK+7HsumLR80HmfkRn
 cTVjn6I8tNqkitR3/jmRDUH3fgYFb28558GLXTu+IT1I8OPItRtRV9syXz2uibbTlZ9qAmdk
 p3J73q1qu9uGmt5G7Nq35kPxJMZ3wll4kIk0k60TPiH3mEBIrr4e/vCly69EH3VCNCcw==
X-Talos-CUID: 9a23:WRHkjm7W5ryWC6JEJ9ssyXEmJ/4JSUbkl1CJGnWxNG9weJOsVgrF
X-Talos-MUID: =?us-ascii?q?9a23=3AGx4tcw+AFE+p0k3piKXUhkWQf99P56eTWVI1q68?=
 =?us-ascii?q?XldG0MBxNGHTenTviFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,200,1684814400"; 
   d="scan'208";a="116427630"
Date: Wed, 12 Jul 2023 18:23:18 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
CC: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>, Juergen Gross
	<jgross@suse.com>
Subject: Re: [PATCH v2 5/6] libxl: use the cpuid feature names from
 cpufeatureset.h
Message-ID: <40a9a687-fae0-4c44-ba83-0c89cf4f8af0@perard>
References: <20230711092230.15408-1-roger.pau@citrix.com>
 <20230711092230.15408-6-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230711092230.15408-6-roger.pau@citrix.com>

On Tue, Jul 11, 2023 at 11:22:29AM +0200, Roger Pau Monne wrote:
> The current implementation in libxl_cpuid_parse_config() requires
> keeping a list of cpuid feature bits that should be mostly in sync
> with the contents of cpufeatureset.h.
> 
> Avoid such duplication by using the automatically generated list of
> cpuid features in INIT_FEATURE_NAMES in order to map feature names to
> featureset bits, and then translate from featureset bits into cpuid
> leaf, subleaf, register tuple.
> 
> Note that the full contents of the previous cpuid translation table
> can't be removed.  That's because some feature names allowed by libxl
> are not described in the featuresets, or because naming has diverged
> and the previous nomenclature is preserved for compatibility reasons.
> 
> Should result in no functional change observed by callers, albeit some
> new cpuid features will be available as a result of the change.
> 
> While there constify cpuid_flags name field.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 18:45:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 18:45:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562732.879512 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJeqJ-0002qi-Gb; Wed, 12 Jul 2023 18:45:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562732.879512; Wed, 12 Jul 2023 18:45:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJeqJ-0002qb-DC; Wed, 12 Jul 2023 18:45:39 +0000
Received: by outflank-mailman (input) for mailman id 562732;
 Wed, 12 Jul 2023 18:39:20 +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
 <SRS0=JlC3=C6=chromium.org=seanpaul@srs-se1.protection.inumbo.net>)
 id 1qJekB-0001uT-RY
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 18:39:20 +0000
Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com
 [2607:f8b0:4864:20::42a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 66e96bfa-20e3-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 20:39:16 +0200 (CEST)
Received: by mail-pf1-x42a.google.com with SMTP id
 d2e1a72fcca58-6687096c6ddso4441851b3a.0
 for <xen-devel@lists.xenproject.org>; Wed, 12 Jul 2023 11:39:16 -0700 (PDT)
Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com.
 [209.85.210.179]) by smtp.gmail.com with ESMTPSA id
 k15-20020aa790cf000000b00666b3706be6sm3878086pfk.107.2023.07.12.11.39.12
 for <xen-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 12 Jul 2023 11:39:12 -0700 (PDT)
Received: by mail-pf1-f179.google.com with SMTP id
 d2e1a72fcca58-666e5f0d60bso4420711b3a.3
 for <xen-devel@lists.xenproject.org>; Wed, 12 Jul 2023 11:39:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 66e96bfa-20e3-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=chromium.org; s=google; t=1689187153; x=1691779153;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=rTThceHWQZD4Ac2XfATsHd8gywiOPtbGgdMtmxYrl6g=;
        b=oJAX7ilgKQYdf/a2vYZFXEEyfbM1+oUF5BiEMHU3fy/WIU6Lm81GmIvP7c5hiaZkf8
         HjQe5FR3smFKUHd1j0KlWwXvez6SKKeB7L1SDoeSvh8GITuxV448Jonkw/7CK9yXN8by
         ORnu52koKQ9jaBSktIDq1C4EAlSJwAl+VIoFk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689187153; x=1691779153;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=rTThceHWQZD4Ac2XfATsHd8gywiOPtbGgdMtmxYrl6g=;
        b=k6f8HRkt4xIbWfDNKTECV7qQ4PHw8bCLrsFvEkC/gDm8BZAeEtYD/H79G36uL1JUz4
         dwmO2ya//5eNdq6EJKXGRhfI5/QpE2SbmgtjyCReversNnJfwXZEq/Iwtte52o8oEDpM
         BuAHUqe6cDdq0rRJwELCUW6yq0RkYD9E95C7Q53cVXdil7N8d5mvgrRfcb3D5jkOy+dv
         AqfIEDmj/T90NkQ956Znqno8NYgmOataHuM1BcJh/EMJTYcAy1aYpWpvRqXsdPxvYBRl
         ViUixpJW1msGOqzmKg8IKvQD61qNQLJZ0dlTDzvyvgDqvm/J+SVaiE3VajlUfNr3K3X/
         0B+A==
X-Gm-Message-State: ABy/qLYhkmgL+6n1Lm1BL9c55x5Du2IsF8MKEluBL8zlzZ8S3MRYBzIw
	puuZLdZJjD/SIg1dR3V1tVIe1e0BEzd8w9KmxYE8AiUR
X-Google-Smtp-Source: APBJJlGwr864UsqYalSQ5fwgg9TMIbZ4aXEWgJRoznGQ9uiZ23c4WDLPh44EuwltqN5IRDyFQpQvtg==
X-Received: by 2002:aa7:88cf:0:b0:681:d247:8987 with SMTP id k15-20020aa788cf000000b00681d2478987mr17825081pff.17.1689187152938;
        Wed, 12 Jul 2023 11:39:12 -0700 (PDT)
X-Received: by 2002:a25:50c9:0:b0:c6d:e3e3:5592 with SMTP id
 e192-20020a2550c9000000b00c6de3e35592mr13511834ybb.54.1689186698646; Wed, 12
 Jul 2023 11:31:38 -0700 (PDT)
MIME-Version: 1.0
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de> <87fs5tgpvv.fsf@intel.com>
In-Reply-To: <87fs5tgpvv.fsf@intel.com>
From: Sean Paul <seanpaul@chromium.org>
Date: Wed, 12 Jul 2023 14:31:02 -0400
X-Gmail-Original-Message-ID: <CAOw6vbLO_UaXDbTCtAQJgthXOUMPqEV+c2MQhP-1DuK44OhGxw@mail.gmail.com>
Message-ID: <CAOw6vbLO_UaXDbTCtAQJgthXOUMPqEV+c2MQhP-1DuK44OhGxw@mail.gmail.com>
Subject: Re: [Freedreno] [PATCH RFC v1 00/52] drm/crtc: Rename struct
 drm_crtc::dev to drm_dev
To: Jani Nikula <jani.nikula@intel.com>
Cc: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, 
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, 
	Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, 
	Alex Deucher <alexander.deucher@amd.com>, =?UTF-8?Q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>, 
	"Pan, Xinhui" <Xinhui.Pan@amd.com>, Harry Wentland <harry.wentland@amd.com>, Leo Li <sunpeng.li@amd.com>, 
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>, Hamza Mahfooz <hamza.mahfooz@amd.com>, 
	Javier Martinez Canillas <javierm@redhat.com>, Guchun Chen <guchun.chen@amd.com>, 
	Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>, Evan Quan <evan.quan@amd.com>, 
	Likun Gao <Likun.Gao@amd.com>, =?UTF-8?B?TWFyZWsgT2zFocOhaw==?= <marek.olsak@amd.com>, 
	David Francis <David.Francis@amd.com>, Hawking Zhang <Hawking.Zhang@amd.com>, 
	Graham Sider <Graham.Sider@amd.com>, Lang Yu <Lang.Yu@amd.com>, 
	Philip Yang <Philip.Yang@amd.com>, Yifan Zhang <yifan1.zhang@amd.com>, 
	Tim Huang <Tim.Huang@amd.com>, Zack Rusin <zackr@vmware.com>, Sam Ravnborg <sam@ravnborg.org>, 
	xurui <xurui@kylinos.cn>, Laurent Pinchart <laurent.pinchart@ideasonboard.com>, 
	=?UTF-8?B?TWHDrXJhIENhbmFs?= <mairacanal@riseup.net>, 
	=?UTF-8?Q?Andr=C3=A9_Almeida?= <andrealmeid@igalia.com>, 
	Qingqing Zhuo <qingqing.zhuo@amd.com>, Aurabindo Pillai <aurabindo.pillai@amd.com>, 
	Hersen Wu <hersenxs.wu@amd.com>, Fangzhi Zuo <jerry.zuo@amd.com>, 
	Stylon Wang <stylon.wang@amd.com>, Alan Liu <haoping.liu@amd.com>, Wayne Lin <Wayne.Lin@amd.com>, 
	Aaron Liu <aaron.liu@amd.com>, Melissa Wen <mwen@igalia.com>, 
	Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>, David Tadokoro <davidbtadokoro@usp.br>, 
	Wenjing Liu <wenjing.liu@amd.com>, Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, 
	Mario Limonciello <mario.limonciello@amd.com>, Alexey Kodanev <aleksei.kodanev@bell-sw.com>, 
	Roman Li <roman.li@amd.com>, =?UTF-8?Q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= <samsagax@gmail.com>, 
	Dave Airlie <airlied@redhat.com>, Russell King <linux@armlinux.org.uk>, 
	Liviu Dudau <liviu.dudau@arm.com>, Joel Stanley <joel@jms.id.au>, 
	Boris Brezillon <bbrezillon@kernel.org>, Nicolas Ferre <nicolas.ferre@microchip.com>, 
	Alexandre Belloni <alexandre.belloni@bootlin.com>, 
	Claudiu Beznea <claudiu.beznea@microchip.com>, Inki Dae <inki.dae@samsung.com>, 
	Seung-Woo Kim <sw0312.kim@samsung.com>, Kyungmin Park <kyungmin.park@samsung.com>, 
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, Stefan Agner <stefan@agner.ch>, 
	Alison Wang <alison.wang@nxp.com>, Patrik Jakobsson <patrik.r.jakobsson@gmail.com>, 
	=?UTF-8?Q?Noralf_Tr=C3=B8nnes?= <noralf@tronnes.org>, 
	Xinliang Liu <xinliang.liu@linaro.org>, Tian Tao <tiantao6@hisilicon.com>, 
	Danilo Krummrich <dakr@redhat.com>, Deepak Rawat <drawat.floss@gmail.com>, 
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>, 
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>, 
	=?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= <ville.syrjala@linux.intel.com>, 
	Lucas De Marchi <lucas.demarchi@intel.com>, Ankit Nautiyal <ankit.k.nautiyal@intel.com>, 
	Andrzej Hajda <andrzej.hajda@intel.com>, Matt Roper <matthew.d.roper@intel.com>, 
	Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>, 
	Radhakrishna Sripada <radhakrishna.sripada@intel.com>, Hans de Goede <hdegoede@redhat.com>, 
	Luca Coelho <luciano.coelho@intel.com>, 
	Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>, 
	Kai Vehmanen <kai.vehmanen@linux.intel.com>, 
	Vinod Govindapillai <vinod.govindapillai@intel.com>, =?UTF-8?Q?=C5=81ukasz_Bartosik?= <lb@semihalf.com>, 
	Anusha Srivatsa <anusha.srivatsa@intel.com>, 
	Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>, Uma Shankar <uma.shankar@intel.com>, 
	Imre Deak <imre.deak@intel.com>, Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>, 
	Swati Sharma <swati2.sharma@intel.com>, =?UTF-8?Q?Jouni_H=C3=B6gander?= <jouni.hogander@intel.com>, 
	Mika Kahola <mika.kahola@intel.com>, =?UTF-8?Q?Jos=C3=A9_Roberto_de_Souza?= <jose.souza@intel.com>, 
	Arun R Murthy <arun.r.murthy@intel.com>, Gustavo Sousa <gustavo.sousa@intel.com>, 
	Khaled Almahallawy <khaled.almahallawy@intel.com>, 
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>, Andi Shyti <andi.shyti@linux.intel.com>, 
	Nirmoy Das <nirmoy.das@intel.com>, Fei Yang <fei.yang@intel.com>, 
	Animesh Manna <animesh.manna@intel.com>, Deepak R Varma <drv@mailo.com>, 
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, 
	Vandita Kulkarni <vandita.kulkarni@intel.com>, Suraj Kandpal <suraj.kandpal@intel.com>, 
	Manasi Navare <manasi.d.navare@intel.com>, Drew Davenport <ddavenport@chromium.org>, 
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>, Shawn Guo <shawnguo@kernel.org>, 
	Sascha Hauer <s.hauer@pengutronix.de>, Philipp Zabel <p.zabel@pengutronix.de>, 
	Marian Cichy <m.cichy@pengutronix.de>, Dan Carpenter <error27@gmail.com>, 
	Paul Cercueil <paul@crapouillou.net>, Anitha Chrisanthus <anitha.chrisanthus@intel.com>, 
	Edmund Dea <edmund.j.dea@intel.com>, Paul Kocialkowski <paul.kocialkowski@bootlin.com>, 
	Linus Walleij <linus.walleij@linaro.org>, Chun-Kuang Hu <chunkuang.hu@kernel.org>, 
	Matthias Brugger <matthias.bgg@gmail.com>, Neil Armstrong <neil.armstrong@linaro.org>, 
	Kevin Hilman <khilman@baylibre.com>, Rob Clark <robdclark@gmail.com>, 
	Abhinav Kumar <quic_abhinavk@quicinc.com>, Vinod Polimera <quic_vpolimer@quicinc.com>, 
	Jiasheng Jiang <jiasheng@iscas.ac.cn>, Konrad Dybcio <konrad.dybcio@linaro.org>, 
	Jessica Zhang <quic_jesszhan@quicinc.com>, Liu Shixin <liushixin2@huawei.com>, 
	Marek Vasut <marex@denx.de>, Ben Skeggs <bskeggs@redhat.com>, Karol Herbst <kherbst@redhat.com>, 
	Lyude Paul <lyude@redhat.com>, Tomi Valkeinen <tomba@kernel.org>, Emma Anholt <emma@anholt.net>, 
	Gerd Hoffmann <kraxel@redhat.com>, 
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>, 
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>, 
	Wolfram Sang <wsa+renesas@sang-engineering.com>, 
	Geert Uytterhoeven <geert+renesas@glider.be>, Biju Das <biju.das.jz@bp.renesas.com>, 
	Sandy Huang <hjc@rock-chips.com>, =?UTF-8?Q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 
	Orson Zhai <orsonzhai@gmail.com>, Baolin Wang <baolin.wang@linux.alibaba.com>, 
	Chunyan Zhang <zhang.lyra@gmail.com>, Alain Volmat <alain.volmat@foss.st.com>, 
	Yannick Fertre <yannick.fertre@foss.st.com>, 
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>, 
	Philippe Cornu <philippe.cornu@foss.st.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, 
	Alexandre Torgue <alexandre.torgue@foss.st.com>, Chen-Yu Tsai <wens@csie.org>, 
	Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org>, 
	Thierry Reding <thierry.reding@gmail.com>, Mikko Perttunen <mperttunen@nvidia.com>, 
	Jonathan Hunter <jonathanh@nvidia.com>, Jyri Sarha <jyri.sarha@iki.fi>, 
	David Lechner <david@lechnology.com>, Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>, 
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>, Melissa Wen <melissa.srw@gmail.com>, 
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, Michal Simek <michal.simek@amd.com>, 
	Haneen Mohammed <hamohammed.sa@gmail.com>, linux-hyperv@vger.kernel.org, 
	linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org, 
	dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, 
	Yongqin Liu <yongqin.liu@linaro.org>, Alim Akhtar <alim.akhtar@samsung.com>, 
	Marijn Suijten <marijn.suijten@somainline.org>, Fabio Estevam <festevam@gmail.com>, 
	Sumit Semwal <sumit.semwal@linaro.org>, Jerome Brunet <jbrunet@baylibre.com>, 
	linux-samsung-soc@vger.kernel.org, amd-gfx@lists.freedesktop.org, 
	linux-stm32@st-md-mailman.stormreply.com, linux-rockchip@lists.infradead.org, 
	Xinwei Kong <kong.kongxinwei@hisilicon.com>, 
	VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>, NXP Linux Team <linux-imx@nxp.com>, 
	spice-devel@lists.freedesktop.org, linux-sunxi@lists.linux.dev, 
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>, linux-arm-msm@vger.kernel.org, 
	intel-gfx@lists.freedesktop.org, linux-mediatek@lists.infradead.org, 
	xen-devel@lists.xenproject.org, linux-tegra@vger.kernel.org, 
	linux-amlogic@lists.infradead.org, 
	Gurchetan Singh <gurchetansingh@chromium.org>, Sean Paul <sean@poorly.run>, 
	linux-arm-kernel@lists.infradead.org, 
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Andrew Jeffery <andrew@aj.id.au>, 
	linux-mips@vger.kernel.org, Chia-I Wu <olvaffe@gmail.com>, 
	linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de, 
	John Stultz <jstultz@google.com>, freedreno@lists.freedesktop.org, 
	Lucas Stach <l.stach@pengutronix.de>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 12, 2023 at 10:52=E2=80=AFAM Jani Nikula <jani.nikula@intel.com=
> wrote:
>
> On Wed, 12 Jul 2023, Uwe Kleine-K=C3=B6nig <u.kleine-koenig@pengutronix.d=
e> wrote:
> > Hello,
> >
> > while I debugged an issue in the imx-lcdc driver I was constantly
> > irritated about struct drm_device pointer variables being named "dev"
> > because with that name I usually expect a struct device pointer.
> >
> > I think there is a big benefit when these are all renamed to "drm_dev".
> > I have no strong preference here though, so "drmdev" or "drm" are fine
> > for me, too. Let the bikesheding begin!
> >
> > Some statistics:
> >
> > $ git grep -ohE 'struct drm_device *\* *[^ (),;]*' v6.5-rc1 | sort | un=
iq -c | sort -n
> >       1 struct drm_device *adev_to_drm
> >       1 struct drm_device *drm_
> >       1 struct drm_device          *drm_dev
> >       1 struct drm_device        *drm_dev
> >       1 struct drm_device *pdev
> >       1 struct drm_device *rdev
> >       1 struct drm_device *vdev
> >       2 struct drm_device *dcss_drv_dev_to_drm
> >       2 struct drm_device **ddev
> >       2 struct drm_device *drm_dev_alloc
> >       2 struct drm_device *mock
> >       2 struct drm_device *p_ddev
> >       5 struct drm_device *device
> >       9 struct drm_device * dev
> >      25 struct drm_device *d
> >      95 struct drm_device *
> >     216 struct drm_device *ddev
> >     234 struct drm_device *drm_dev
> >     611 struct drm_device *drm
> >    4190 struct drm_device *dev
> >
> > This series starts with renaming struct drm_crtc::dev to drm_dev. If
> > it's not only me and others like the result of this effort it should be
> > followed up by adapting the other structs and the individual usages in
> > the different drivers.
>
> I think this is an unnecessary change. In drm, a dev is usually a drm
> device, i.e. struct drm_device *. As shown by the numbers above.
>

I'd really prefer this patch (series or single) is not accepted. This
will cause problems for everyone cherry-picking patches to a
downstream kernel (LTS or distro tree). I usually wouldn't expect
sympathy here, but the questionable benefit does not outweigh the cost
IM[biased]O.

Sean

> If folks insist on following through with this anyway, I'm firmly in the
> camp the name should be "drm" and nothing else.
>
>
> BR,
> Jani.
>
>
> --
> Jani Nikula, Intel Open Source Graphics Center


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 19:38:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 19:38:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562741.879522 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJffH-0008Lq-HT; Wed, 12 Jul 2023 19:38:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562741.879522; Wed, 12 Jul 2023 19:38:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJffH-0008Lj-Es; Wed, 12 Jul 2023 19:38:19 +0000
Received: by outflank-mailman (input) for mailman id 562741;
 Wed, 12 Jul 2023 19:38:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=OL/P=C6=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qJffG-0008Ld-Jd
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 19:38:18 +0000
Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com
 [2a00:1450:4864:20::536])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a623d2e2-20eb-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 21:38:17 +0200 (CEST)
Received: by mail-ed1-x536.google.com with SMTP id
 4fb4d7f45d1cf-51e6113437cso3554620a12.2
 for <xen-devel@lists.xenproject.org>; Wed, 12 Jul 2023 12:38:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a623d2e2-20eb-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689190697; x=1691782697;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=pdBmotNbBMmDJfHlV/l0karpg8+a4cpZORK1uq4GvLA=;
        b=hFl+ksKSwfzM78VR9t3NiGE1EQSMsYbjHrNZW38BIu2d4vR52c/VU1RA0N7k5FMgK2
         ItgA6lrZow1td6RcY2e8YtPVEi4mCoDyPPLPA6+5+NwEkW2GnIoszS54X1cM3WqaWP2X
         vAXxRwd3NYhdagHG46gVxx2i8Mc1Q+tumrzKPgALiiRWjNlgDKAsYzot2tKAV7fbtCC6
         eRb+HDUvAJvXZXx2Mn0X/nLRN1r/dTuCWNHecSRxyrI7WPudHdslrRGQ6uj3o6+hRfib
         5qMJOqbAct21AcitDmRtP9iGMml2n0rSU6ELIvYMZaRrr/g61rM2cnwhMkTfGzdbWWuR
         ahTw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689190697; x=1691782697;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=pdBmotNbBMmDJfHlV/l0karpg8+a4cpZORK1uq4GvLA=;
        b=a69lnQtn0DH2AtB5loaJ+10SSp5WNZcGcYAlb2Y0ZMjfdEC3eEcDu9LJVeb3FQHYok
         P0L56RQPS/BgQX1FmtechZqvAABWR1KSU15hek/OQ92raknZ4X5xLQTonLqqoWReXPTv
         YZyoU4i9N+y+mUvmMWfZSzZGnDTDDa0jvckR3Nd9LYiCrnqU8eCIx4ho0SB+mqj0rbRh
         vAApGdkIcJFYA/5MX8Dt1B8P4ivSfNk9KcpJGlKa8PZNbh7IUnL0vvNj9r0ix/YnZ6qj
         jNAHUFlntlO/4t5k1RgrKNT5vzsl36m0rrv5ZrCIGt8HxxJFHTc8vBy+DKVeIRyCY03x
         nnXg==
X-Gm-Message-State: ABy/qLYDVJMDwZN1Rv6Gu+7EDIW5YuFaxByg1ACZzKEmnxt8Xy2+cuqs
	7iPjBBBEwXJXmyx2iLoeZrUQb2RJSqPLXNjeuaU=
X-Google-Smtp-Source: APBJJlFwOMNxZdrApkL4LRIdSWZM4srUharo5o9qPqMURwZpX7RxJdHszdsNlwTwsa4ea6u3FCpgExSFvZVPJdoj0ck=
X-Received: by 2002:a05:6402:120b:b0:51b:ec86:b49a with SMTP id
 c11-20020a056402120b00b0051bec86b49amr19242766edw.7.1689190696429; Wed, 12
 Jul 2023 12:38:16 -0700 (PDT)
MIME-Version: 1.0
References: <20230706185440.48333-1-jandryuk@gmail.com> <20230706185440.48333-7-jandryuk@gmail.com>
 <eeeb032f-a21b-5eb2-e3d5-63357a04a500@suse.com> <CAKf6xptn0OL0qz+DW9qrwU=sFSKSp-O3S7z6vFbZp9RstFanbw@mail.gmail.com>
 <bfacee48-f640-f2eb-7fd7-f440ad03e612@suse.com> <CAKf6xpvVd49dx=CtGyPMt+NMuOfhJ4a1fiZb-O4e-guq9BwcFw@mail.gmail.com>
 <cdbaec77-9112-7b18-e9eb-fa12a16d2ccf@suse.com> <CAKf6xpspsyShp2O8SLK+=VQvxd=Uaewg-JHYAFPqEPmEWvDRAg@mail.gmail.com>
 <f768b046-4e14-30b3-479b-bdcdebb4d397@suse.com>
In-Reply-To: <f768b046-4e14-30b3-479b-bdcdebb4d397@suse.com>
From: Jason Andryuk <jandryuk@gmail.com>
Date: Wed, 12 Jul 2023 15:38:04 -0400
Message-ID: <CAKf6xpt53io1TGDy0hmfhBoDqz5bUHNbpU37Y0xtpUqPVMJd4g@mail.gmail.com>
Subject: Re: [PATCH v5 06/15] cpufreq: Add Hardware P-State (HWP) driver
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, 
	Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 12, 2023 at 4:43=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wro=
te:
>
> On 11.07.2023 19:49, Jason Andryuk wrote:
> > On Tue, Jul 11, 2023 at 10:41=E2=80=AFAM Jan Beulich <jbeulich@suse.com=
> wrote:
> >>
> >> On 11.07.2023 16:16, Jason Andryuk wrote:
> >>> On Tue, Jul 11, 2023 at 4:18=E2=80=AFAM Jan Beulich <jbeulich@suse.co=
m> wrote:
> >>>> On 10.07.2023 17:22, Jason Andryuk wrote:
> >>>>> On Mon, Jul 10, 2023 at 9:13=E2=80=AFAM Jan Beulich <jbeulich@suse.=
com> wrote:
> >>>>>> On 06.07.2023 20:54, Jason Andryuk wrote:
> >>>>>>> @@ -510,6 +510,22 @@ choice of `dom0-kernel` is deprecated and no=
t supported by all Dom0 kernels.
> >>>>>>>  * `<maxfreq>` and `<minfreq>` are integers which represent max a=
nd min processor frequencies
> >>>>>>>    respectively.
> >>>>>>>  * `verbose` option can be included as a string or also as `verbo=
se=3D<integer>`
> >>>>>>> +  for `xen`.  It is a boolean for `hwp`.
> >>>>>>> +* `hwp` selects Hardware-Controlled Performance States (HWP) on =
supported Intel
> >>>>>>> +  hardware.  HWP is a Skylake+ feature which provides better CPU=
 power
> >>>>>>> +  management.  The default is disabled.  If `hwp` is selected, b=
ut hardware
> >>>>>>> +  support is not available, Xen will fallback to cpufreq=3Dxen.
> >>>>>>> +* `<hdc>` is a boolean to enable Hardware Duty Cycling (HDC).  H=
DC enables the
> >>>>>>> +  processor to autonomously force physical package components in=
to idle state.
> >>>>>>> +  The default is enabled, but the option only applies when `hwp`=
 is enabled.
> >>>>>>> +
> >>>>>>> +There is also support for `;`-separated fallback options:
> >>>>>>> +`cpufreq=3Dhwp,verbose;xen`.  This first tries `hwp` and falls b=
ack to `xen`
> >>>>>>> +if unavailable.
> >>>>>>
> >>>>>> In the given example, does "verbose" also apply to the fallback ca=
se? If so,
> >>>>>> perhaps better "cpufreq=3Dhwp;xen,verbose", to eliminate that ambi=
guity?
> >>>>>
> >>>>> Yes, "verbose" is applied to both.  I can make the change.  I
> >>>>> mentioned it in the commit message, but I'll mention it here as wel=
l.
> >>>>
> >>>> FTAOD my earlier comment implied that the spelling form you use abov=
e
> >>>> should not even be accepted when parsing. I.e. it was not just about
> >>>> the doc aspect.
> >>>
> >>> Oh.  So what exactly do you want then?
> >>>
> >>> There is a single cpufreq_verbose variable today that is set by eithe=
r
> >>> cpufreq=3Dhwp,verbose or cpufreq=3Dxen,verbose.  Is that okay, or sho=
uld
> >>> the "xen" and "hwp" each get a separate variable?
> >>>
> >>> Do you only want to allow a single trailing "verbose" to apply to all
> >>> of cpufreq (cpufreq=3D$foo,verbose)?  Or do you want "verbose" to be
> >>> only valid for "xen"?  Both cpufreq_cmdline_parse() and
> >>> hwp_cmdline_parse() just loop over their options and don't care about
> >>> order, even though the documentation lists verbose last.  Would you
> >>> want "cpufreq=3Dhwp,verbose,hdc" to fail to parse?
> >>>
> >>> All parsing is done upfront before knowing whether "xen" or "hwp" wil=
l
> >>> be used as the cpufreq driver, so there is a trickiness for
> >>> implementing "verbose" only for one option.  Similarly,
> >>> "cpufreq=3Dhwp,invalid;xen" will try "hwp" (but not "xen")  since the
> >>> live variables are updated.  Even without this patch, cpufreq will be
> >>> configured up to an invalid parameter.
> >>
> >> Right, and I'd like to see "hwp;xen" to be treated as a "unit", with
> >> ",verbose" applying to whichever succeeds initializing. I don't think
> >> there is much point to have separate verbosity variables.
> >
> > When you say "hwp;xen" as a unit, you don't mean to intermix all the
> > options like:
> > cpufreq=3Dhwp;xen:ondemand,hdc,maxfreq=3D42
> > do you?
> >
> > Because of the suboptions, I don't treat "hwp;xen" as a unit, but as
> > strings separated by ';'.
> > That allows the full selection of parameters like:
> > cpufreq=3Dhwc,no-hdc;xen:ondemand,maxfreq=3D42,minfreq=3D0
> >
> > This lets each respective parser handle the options it knows about.
> > This does duplicate "verbose" handling.  cpufreq_cmdline_parse() and
> > hwp_cmdline_parse() are also usable when only one of "hwp" or "xen" is
> > specified.
> >
> > These all work:
> > cpufreq=3Dxen:ondemand,verbose
> > cpufreq=3Dhwp,hdc,verbose
> > cpurfre=3Dhwp,hdc;xen:ondemand,verbose
> >
> > To disallow "verbose" in "cpufreq=3Dhwp,verbose;xen" would require extr=
a
> > code, and setup_cpufreq_option() is already rather complicated IMO.
> > It's a corner case, but doesn't seem harmful to me.   Hmmm, making the
> > above fail parsing may be worse since it would only try "hwp" without
> > a fallback to "xen".
> >
> > I just want to be clear on exactly what I need to implement.
>
> Maybe we need to take a step back a revisit what option forms actually
> make sense to express. Part of the problem may be that we permit (but
> not require afaics) the use of colon as a separator after the "main"
> option ("xen", "none", "dom0-kernel", and perhaps now "hwp"). Such a
> colon suggests that what follows are sub-options applicable to that
> specific "main" option, especially since what follows "xen:" can be
> more than just the governor name (and in fact no governor name is
> required - I've been using cpufreq=3Dxen:up_threshold=3D40 on some of my
> systems, for example). I have to admit that I don't see a clean way
> of (largely) retaining existing behavior while at the same time
> avoiding ambiguity with your additions (and it may well be that there
> is pre-existing ambiguity as well, but the introduction of yet
> another separator [semicolon] clearly makes things worse in this
> regard, as it suggests strong grouping).
>
> Maybe we want to consider an alternative form of expressing the
> fallback. What about e.g. "cpufreq=3Dhwp:hdc(xen:ondemand),verbose"
> (and its possible variations)?

I think I like this less.

I think the strong grouping of ';' is nice.  It clearly delineates the
first and fallback option, and it could be extended to N in the
future.  I like that if you have 2 working cpufreq=3D lines, you just
concatenate them together with the ';'.  If the suboptions were all a
disjoint set, I think it would be easy to pick this.

The downside is the "verbose" handling.  The strong grouping makes
verbose seemingly only apply to the specified group and not globally.
Not the best, but we can document that away.

I implemented something to only allow specifying "verbose" in only the
last ';' grouping.  It's not that bad, but seems a little weird in
light of the strong grouping since it uses the same comma separator.
Also, failing to parse "verbose" in the first part breaks the
concatenation.

A different or additional separator could be used to separate verbose,
but that seems kinda overkill and would not be backwards compatible.

Another idea could be to allow multiple cpufreq=3D lines.  Each one
would call setup_cpufreq_option(), which could track the entries in
cpufreq_xen_opts[].  It still doesn't show a single "verbose" applies
globally.  And it breaks "later options override earlier ones."
"cpufreqfallback=3D" is another option, but I don't particularly care
for that.

I think I just prefer the ';' separator and letting "verbose" be
weird.  It maps well into the existing syntax and I liked it when you
first suggested it.

Regards,
Jason


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 19:59:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 19:59:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562745.879532 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJfzN-0002aT-7J; Wed, 12 Jul 2023 19:59:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562745.879532; Wed, 12 Jul 2023 19:59:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJfzN-0002aM-3n; Wed, 12 Jul 2023 19:59:05 +0000
Received: by outflank-mailman (input) for mailman id 562745;
 Wed, 12 Jul 2023 19:59:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eU4r=C6=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qJfzM-0002aG-4l
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 19:59:04 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8b4108d0-20ee-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 21:59:01 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 3CDE9618FB;
 Wed, 12 Jul 2023 19:59:00 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 919C8C433C7;
 Wed, 12 Jul 2023 19:58:58 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8b4108d0-20ee-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689191939;
	bh=HecMTw6AhXkRHgwa2M98sKbaO4JTtNmnVVEn3kz+KZk=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=HpePBpfGDenhjv9iRNYL+I00ty0VDFPkf7OJvJcZZavDqTo/vw5w2Stp1J3E7Zmai
	 7YNJ+ZwYtPFjwgbUp9zXTLdtagkVNi4xdXdTl9PCW1U12JuyLw3Y4vRY1kmtZ6sB1a
	 Ezo4eH3u+GtA4hYVEwvKZ5fPf5d3a86D6xWzINpCCcK8E+ZrS4tBGquWexb9YTsdfr
	 wSOSw5kU26rIiHKN5Kxz4EwMzgeVK3Bl+7vmK5Su7A3DEkRmq47aW6HVz/Ye6gqwWS
	 NF21jr4Dt9jtkx3kSh0HiSyNVUC+vUesiz8CFelzad3UNiU1XgEUqpdJGIT1/z8mOt
	 ed86x9DKrnD7g==
Date: Wed, 12 Jul 2023 12:58:56 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Luca Fancellu <Luca.Fancellu@arm.com>
cc: Michal Orzel <michal.orzel@amd.com>, 
    Xen-devel <xen-devel@lists.xenproject.org>, 
    Bertrand Marquis <Bertrand.Marquis@arm.com>, Wei Chen <Wei.Chen@arm.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH] docs: Fix style in misc/arm/silicon-errata.txt table
In-Reply-To: <AFE6AA84-4ADE-4496-896A-8843575C962E@arm.com>
Message-ID: <alpine.DEB.2.22.394.2307121258510.761183@ubuntu-linux-20-04-desktop>
References: <20230712120440.1815240-1-luca.fancellu@arm.com> <c139abd7-bd27-f8cf-b561-5c795bb663a7@amd.com> <AFE6AA84-4ADE-4496-896A-8843575C962E@arm.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="8323329-1231765994-1689191939=:761183"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-1231765994-1689191939=:761183
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT

On Wed, 12 Jul 2023, Luca Fancellu wrote:
> > On 12 Jul 2023, at 14:04, Michal Orzel <michal.orzel@amd.com> wrote:
> > 
> > Hi Luca,
> > 
> > On 12/07/2023 14:04, Luca Fancellu wrote:
> >> 
> >> 
> >> Fix the right border of the silicon-errata.txt table
> >> 
> >> Fixes: 1814a626fb58 ("xen/arm: Update silicon-errata.txt with the Neovers AT erratum")
> > Fixes tag is for bugs and this one is clearly not.
> > With that removed:
> > Reviewed-by: Michal Orzel <michal.orzel@amd.com>
> 
> Thank you, yeah well I discovered it can be used also on back-ports, so Iâ€™ve added it, anyway
> If maintainer are ok, it can be addressed on commit

Acked-by: Stefano Stabellini <sstabellini@kernel.org>
--8323329-1231765994-1689191939=:761183--


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 20:02:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 20:02:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562749.879541 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJg2q-00047m-MM; Wed, 12 Jul 2023 20:02:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562749.879541; Wed, 12 Jul 2023 20:02:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJg2q-00047f-Jf; Wed, 12 Jul 2023 20:02:40 +0000
Received: by outflank-mailman (input) for mailman id 562749;
 Wed, 12 Jul 2023 20:02:39 +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 <SRS0=Cscr=C6=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qJg2o-00047T-VS
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 20:02:38 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0a4cf889-20ef-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 22:02:35 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36CK2IJs091884
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Wed, 12 Jul 2023 16:02:24 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36CK2IMq091883;
 Wed, 12 Jul 2023 13:02:18 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0a4cf889-20ef-11ee-8611-37d641c3527e
Message-Id: <cover.1689191941.git.ehem+xen@m5p.com>
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Roger Pau MonnÃ©" <roger.pau@citrix.com>
Cc: Wei Liu <wl@xen.org>
Date: Wed, 12 Jul 2023 12:59:01 -0700
Subject: [PATCH v3 0/3] Fixing ACPI error reporting display
X-Spam-Status: No, score=0.4 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

This series has been seen previously.  The issue is pretty simple, if
ACPI errors occur there is a high probability they will occur on multiple
cores at once.  Since there is no locking for `printk()` there is a need
to emit the entire error with a single `printk()`.

I believe this is roughly where things left off.  The loop adjustment had
been requested to be broken into a separate step.  I had also goofed when
adjusting the handling and the string order had gotten reversed.

I'm unsure how best to make the `printk()` more maintainable.  Yet more
"%s" and entries[#] will be needed if additional bits get defined.  I'm
inclined to keep the string broken apart to hint as to how it matches
the entry list.  I'm okay with everything being fully concatenated if
that is felt best.


Elliott Mitchell (3):
  x86/APIC: include full string with error_interrupt() error messages
  x86/APIC: modify error_interrupt() to output using single printk()
  x86/APIC: adjustments to error_interrupt() loop

 xen/arch/x86/apic.c | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 20:03:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 20:03:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562763.879553 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJg3K-0004eq-0z; Wed, 12 Jul 2023 20:03:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562763.879553; Wed, 12 Jul 2023 20:03:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJg3J-0004ej-Rf; Wed, 12 Jul 2023 20:03:09 +0000
Received: by outflank-mailman (input) for mailman id 562763;
 Wed, 12 Jul 2023 20:03:08 +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 <SRS0=Cscr=C6=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qJg3I-00047T-2t
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 20:03:08 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1d2ccd96-20ef-11ee-8611-37d641c3527e;
 Wed, 12 Jul 2023 22:03:06 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36CK2uW8091908
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Wed, 12 Jul 2023 16:03:02 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36CK2ueX091907;
 Wed, 12 Jul 2023 13:02:56 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1d2ccd96-20ef-11ee-8611-37d641c3527e
Message-Id: <062ed51e7529d282b6e336c8b62734afaf21979f.1689191941.git.ehem+xen@m5p.com>
In-Reply-To: <cover.1689191941.git.ehem+xen@m5p.com>
References: <cover.1689191941.git.ehem+xen@m5p.com>
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Roger Pau MonnÃ©" <roger.pau@citrix.com>
Cc: Wei Liu <wl@xen.org>
Date: Fri, 17 Mar 2023 12:45:41 -0700
Subject: [PATCH v3 1/3] x86/APIC: include full string with error_interrupt()
 error messages
X-Spam-Status: No, score=2.5 required=10.0 tests=DATE_IN_PAST_96_XX,
	KHOP_HELO_FCRDNS autolearn=no autolearn_force=no version=3.4.6
X-Spam-Level: **
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

Rather than adding ", " with each printf(), simply include them in the
string initially.  This allows converting to strlcat() or other methods
which strictly concatenate, rather than formatting.

Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
v2:
        One more sentence in the commit message.
---
 xen/arch/x86/apic.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index f71474d47d..8cfb8cd71c 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1401,14 +1401,14 @@ static void cf_check spurious_interrupt(struct cpu_user_regs *regs)
 static void cf_check error_interrupt(struct cpu_user_regs *regs)
 {
     static const char *const esr_fields[] = {
-        "Send CS error",
-        "Receive CS error",
-        "Send accept error",
-        "Receive accept error",
-        "Redirectable IPI",
-        "Send illegal vector",
-        "Received illegal vector",
-        "Illegal register address",
+        ", Send CS error",
+        ", Receive CS error",
+        ", Send accept error",
+        ", Receive accept error",
+        ", Redirectable IPI",
+        ", Send illegal vector",
+        ", Received illegal vector",
+        ", Illegal register address",
     };
     unsigned int v, v1;
     int i;
@@ -1423,7 +1423,7 @@ static void cf_check error_interrupt(struct cpu_user_regs *regs)
             smp_processor_id(), v , v1);
     for ( i = 7; i >= 0; --i )
         if ( v1 & (1 << i) )
-            printk(", %s", esr_fields[i]);
+            printk("%s", esr_fields[i]);
     printk("\n");
 }
 
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 20:03:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 20:03:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562779.879562 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJg3u-0005EF-6o; Wed, 12 Jul 2023 20:03:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562779.879562; Wed, 12 Jul 2023 20:03:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJg3u-0005E8-3h; Wed, 12 Jul 2023 20:03:46 +0000
Received: by outflank-mailman (input) for mailman id 562779;
 Wed, 12 Jul 2023 20:03:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Cscr=C6=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qJg3t-0004Xs-EF
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 20:03:45 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 342e8050-20ef-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 22:03:44 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36CK3Xjx091919
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Wed, 12 Jul 2023 16:03:39 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36CK3XCk091918;
 Wed, 12 Jul 2023 13:03:33 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 342e8050-20ef-11ee-b239-6b7b168915f2
Message-Id: <7771343b52e6769d7670ad73094f5276025a10fe.1689191941.git.ehem+xen@m5p.com>
In-Reply-To: <cover.1689191941.git.ehem+xen@m5p.com>
References: <cover.1689191941.git.ehem+xen@m5p.com>
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Roger Pau MonnÃ©" <roger.pau@citrix.com>
Cc: Wei Liu <wl@xen.org>
Date: Fri, 17 Mar 2023 12:53:32 -0700
Subject: [PATCH v3 2/3] x86/APIC: modify error_interrupt() to output using
 single printk()
X-Spam-Status: No, score=2.5 required=10.0 tests=DATE_IN_PAST_96_XX,
	KHOP_HELO_FCRDNS autolearn=no autolearn_force=no version=3.4.6
X-Spam-Level: **
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

This takes care of the issue of APIC errors tending to occur on multiple
cores at once.  In turn this tends to causes the error messages to be
merged together, making understanding them difficult.

Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
v2:
        Splitting the loop adjustment off.  Fixing the entry display
order.
---
 xen/arch/x86/apic.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 8cfb8cd71c..5b830b2312 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1410,6 +1410,7 @@ static void cf_check error_interrupt(struct cpu_user_regs *regs)
         ", Received illegal vector",
         ", Illegal register address",
     };
+    const char *entries[ARRAY_SIZE(esr_fields)];
     unsigned int v, v1;
     int i;
 
@@ -1419,12 +1420,13 @@ static void cf_check error_interrupt(struct cpu_user_regs *regs)
     v1 = apic_read(APIC_ESR);
     ack_APIC_irq();
 
-    printk(XENLOG_DEBUG "APIC error on CPU%u: %02x(%02x)",
-            smp_processor_id(), v , v1);
     for ( i = 7; i >= 0; --i )
-        if ( v1 & (1 << i) )
-            printk("%s", esr_fields[i]);
-    printk("\n");
+        entries[i] = v1 & (1 << i) ? esr_fields[i] : "";
+    printk(XENLOG_DEBUG "APIC error on CPU%u: %02x(%02x)"
+        "%s%s%s%s%s%s%s%s" "\n",
+        smp_processor_id(), v , v1,
+        entries[7], entries[6],
+        entries[5], entries[4], entries[3], entries[2], entries[1], entries[0]);
 }
 
 /*
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 20:04:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 20:04:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562791.879572 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJg4U-0005oE-GL; Wed, 12 Jul 2023 20:04:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562791.879572; Wed, 12 Jul 2023 20:04:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJg4U-0005o7-DK; Wed, 12 Jul 2023 20:04:22 +0000
Received: by outflank-mailman (input) for mailman id 562791;
 Wed, 12 Jul 2023 20:04:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Cscr=C6=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qJg4T-0004Xs-Kt
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 20:04:21 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 49c476a1-20ef-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 22:04:21 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36CK4B1W091933
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Wed, 12 Jul 2023 16:04:17 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36CK4BC3091932;
 Wed, 12 Jul 2023 13:04:11 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 49c476a1-20ef-11ee-b239-6b7b168915f2
Message-Id: <880212ac370425389688f8b4fef2fd27c4fba446.1689191941.git.ehem+xen@m5p.com>
In-Reply-To: <cover.1689191941.git.ehem+xen@m5p.com>
References: <cover.1689191941.git.ehem+xen@m5p.com>
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Roger Pau MonnÃ©" <roger.pau@citrix.com>
Cc: Wei Liu <wl@xen.org>
Date: Fri, 17 Mar 2023 12:53:32 -0700
Subject: [PATCH v3 3/3] x86/APIC: adjustments to error_interrupt() loop
X-Spam-Status: No, score=2.5 required=10.0 tests=DATE_IN_PAST_96_XX,
	KHOP_HELO_FCRDNS autolearn=no autolearn_force=no version=3.4.6
X-Spam-Level: **
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

ARRAY_SIZE() makes future maintainance easier and thus less likely for
bugs to occur.

Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
v2:
        Breaking this miniscule tidbit off.
---
 xen/arch/x86/apic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 5b830b2312..18ceb35e34 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1412,7 +1412,7 @@ static void cf_check error_interrupt(struct cpu_user_regs *regs)
     };
     const char *entries[ARRAY_SIZE(esr_fields)];
     unsigned int v, v1;
-    int i;
+    unsigned int i;
 
     /* First tickle the hardware, only then report what went on. -- REW */
     v = apic_read(APIC_ESR);
@@ -1420,7 +1420,7 @@ static void cf_check error_interrupt(struct cpu_user_regs *regs)
     v1 = apic_read(APIC_ESR);
     ack_APIC_irq();
 
-    for ( i = 7; i >= 0; --i )
+    for ( i = 0; i < ARRAY_SIZE(entries); ++i )
         entries[i] = v1 & (1 << i) ? esr_fields[i] : "";
     printk(XENLOG_DEBUG "APIC error on CPU%u: %02x(%02x)"
         "%s%s%s%s%s%s%s%s" "\n",
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 12 21:18:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 21:18:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562845.879581 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJhDw-0005HN-Ta; Wed, 12 Jul 2023 21:18:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562845.879581; Wed, 12 Jul 2023 21:18:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJhDw-0005HG-R3; Wed, 12 Jul 2023 21:18:12 +0000
Received: by outflank-mailman (input) for mailman id 562845;
 Wed, 12 Jul 2023 21:18:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJhDv-0005H6-GQ; Wed, 12 Jul 2023 21:18:11 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJhDv-0003Tt-43; Wed, 12 Jul 2023 21:18:11 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJhDu-0000Wg-On; Wed, 12 Jul 2023 21:18:10 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJhDu-0005LX-OL; Wed, 12 Jul 2023 21:18:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=hJzTsSCHqbJvvGwVHHsmAOYhmgk6jHPtcE8O+nZvucs=; b=4tBRl7/6HOXnR9quQG8LHRACgf
	EX2kr1COZS3ZRuT81I7NqhXcaPWRLMZw/e2W6djGAPVjBGpp4mG278tfV/0aRn7rqDRpnycmwqY4o
	jJI4P8Ogez1QwMYeyDQVMrc3bBeKUtKsasK0zJBJ8m/8fWcV0lGTCP1/tUZDEbBUNpa4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181772-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181772: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:debian-hvm-install:fail:heisenbug
    xen-unstable:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qcow2:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-amd64-i386-xl-shadow:xen-install:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-multivcpu:guest-localmigrate/x10:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt-raw:guest-start:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    xen-unstable:test-amd64-i386-pair:xen-install/src_host:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=3c911be55f1c4e0063e690fb61223df21511b5bb
X-Osstest-Versions-That:
    xen=b831326ee2f9ed94523b3d8b0fb2da2a82113e9e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 12 Jul 2023 21:18:10 +0000

flight 181772 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181772/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 12 debian-hvm-install fail in 181767 pass in 181772
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail in 181767 pass in 181772
 test-amd64-amd64-xl-qcow2 21 guest-start/debian.repeat fail in 181767 pass in 181772
 test-amd64-i386-xl-shadow     7 xen-install                fail pass in 181767
 test-amd64-amd64-xl-multivcpu 20 guest-localmigrate/x10    fail pass in 181767
 test-armhf-armhf-libvirt-raw 13 guest-start                fail pass in 181767
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 181767

Tests which did not succeed, but are not blocking:
 test-amd64-i386-pair        10 xen-install/src_host fail in 181767 like 181763
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail in 181767 like 181763
 test-armhf-armhf-libvirt-raw 14 migrate-support-check fail in 181767 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181763
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181763
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181763
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181763
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181763
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181763
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181763
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181763
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181763
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181763
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181763
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass

version targeted for testing:
 xen                  3c911be55f1c4e0063e690fb61223df21511b5bb
baseline version:
 xen                  b831326ee2f9ed94523b3d8b0fb2da2a82113e9e

Last test of basis   181763  2023-07-11 09:44:15 Z    1 days
Testing same since   181767  2023-07-11 23:38:29 Z    0 days    2 attempts

------------------------------------------------------------
People who touched revisions under test:
  Federico Serafini <federico.serafini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Roberto Bagnara <roberto.bagnara@bugseng.com>
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   b831326ee2..3c911be55f  3c911be55f1c4e0063e690fb61223df21511b5bb -> master


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 22:38:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 22:38:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562864.879603 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJiTn-0005IQ-OX; Wed, 12 Jul 2023 22:38:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562864.879603; Wed, 12 Jul 2023 22:38:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJiTn-0005IJ-Ll; Wed, 12 Jul 2023 22:38:39 +0000
Received: by outflank-mailman (input) for mailman id 562864;
 Wed, 12 Jul 2023 22:38:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eU4r=C6=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qJiTl-0005ID-Ng
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 22:38:37 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d58ce9c6-2104-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 00:38:35 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id A027861902;
 Wed, 12 Jul 2023 22:38:33 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FA31C433C7;
 Wed, 12 Jul 2023 22:38:31 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d58ce9c6-2104-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689201513;
	bh=uiYA0gJvZYY38nHKeQVfF4MalSJ4wLzvXYoPclMmc/k=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=QEF/zU59PVpazClmWppV7Mc+YgvDsmCbrx/mbX2O5kIvx17yV8VxNu1/1UrFkYi8W
	 1i1VDg/G9isiMQS7WksVqbATPYVSXEICi3QYWRVts2e1Slblocg35zimkgBi3idfy2
	 29n3Q2V5kJvQwwyMn/81eotiaApd5X1XfErUW07qsfW8DXtQoY+DhAtfpLJ1E9ZgwF
	 71yS8s82Vs6tmczrqtwceXwlEsi/MalRdBpuNWueEx0UPe5DpktGLREp1KlrCsbz5l
	 a5SzqQZlaGkNwmWZeFh+wT9LffPAy7ze2v2P3Dnh3IMQypr0l6CLaPvEvfrXijPM7k
	 FjedCSTxsGGeQ==
Date: Wed, 12 Jul 2023 15:38:30 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Gianluca Luparini <gianluca.luparini@bugseng.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
    Bertrand Marquis <bertrand.marquis@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH v3 04/15] xen/arm: fix violations of MISRA C:2012
 Rule 7.2
In-Reply-To: <0e899828681c4c408ce223dcd03444a4c9039eab.1689152719.git.gianluca.luparini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307121538230.761183@ubuntu-linux-20-04-desktop>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com> <0e899828681c4c408ce223dcd03444a4c9039eab.1689152719.git.gianluca.luparini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 12 Jul 2023, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type and also to other
> literals used in the same contexts or near violations, when their positive
> nature is immediately clear. The latter changes are done for the sake of
> uniformity.
> 
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes in v3:
> - change 'Signed-off-by' ordering
> - add 'ULL' instead of 'U' in 'efibind.h' and 'vgic-v3.c'
> - remove excessive suffixes in 'efi-boot.h' and 'smccc.h'
> 
> Changes in v2:
> - minor change to commit title
> - change commit message
> - fix in 'domain_build.c' file for consistency
> - fix typo in 'gic-v2.c' file
> - fix in 'insn.h' file for consistency
> - add fixes in 'gic-v3.c', 'traps.c' and 'vgic-v3.c'
> ---
>  xen/arch/arm/domain_build.c              |  4 ++--
>  xen/arch/arm/efi/efi-boot.h              |  2 +-
>  xen/arch/arm/gic-v2.c                    |  6 +++---
>  xen/arch/arm/gic-v3.c                    | 10 +++++-----
>  xen/arch/arm/include/asm/arm64/brk.h     |  2 +-
>  xen/arch/arm/include/asm/arm64/efibind.h | 10 +++++-----
>  xen/arch/arm/include/asm/arm64/insn.h    | 16 ++++++++--------
>  xen/arch/arm/include/asm/vreg.h          |  2 +-
>  xen/arch/arm/kernel.c                    |  2 +-
>  xen/arch/arm/traps.c                     | 14 +++++++-------
>  xen/arch/arm/vgic-v2.c                   |  2 +-
>  xen/arch/arm/vgic-v3.c                   |  2 +-
>  xen/include/public/arch-arm/smccc.h      |  4 ++--
>  13 files changed, 38 insertions(+), 38 deletions(-)
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index d0d6be922d..d58604ef4a 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -3751,8 +3751,8 @@ static int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
>           * r1 = machine nr, r2 = atags or dtb pointer.
>           *...
>           */
> -        regs->r0 = 0; /* SBZ */
> -        regs->r1 = 0xffffffff; /* We use DTB therefore no machine id */
> +        regs->r0 = 0U; /* SBZ */
> +        regs->r1 = 0xffffffffU; /* We use DTB therefore no machine id */
>          regs->r2 = kinfo->dtb_paddr;
>      }
>  #ifdef CONFIG_ARM_64
> diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
> index bb64925d70..3daa63a40d 100644
> --- a/xen/arch/arm/efi/efi-boot.h
> +++ b/xen/arch/arm/efi/efi-boot.h
> @@ -46,7 +46,7 @@ static int get_module_file_index(const char *name, unsigned int name_len);
>  static void PrintMessage(const CHAR16 *s);
>  
>  #define DEVICE_TREE_GUID \
> -{0xb1b621d5, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0}}
> +{0xb1b621d5U, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0}}
>  
>  static struct file __initdata dtbfile;
>  static void __initdata *fdt;
> diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
> index 6476ff4230..cf392bfd1c 100644
> --- a/xen/arch/arm/gic-v2.c
> +++ b/xen/arch/arm/gic-v2.c
> @@ -386,9 +386,9 @@ static void gicv2_cpu_init(void)
>      /* The first 32 interrupts (PPI and SGI) are banked per-cpu, so
>       * even though they are controlled with GICD registers, they must
>       * be set up here with the other per-cpu state. */
> -    writel_gicd(0xffffffff, GICD_ICACTIVER); /* Diactivate PPIs and SGIs */
> -    writel_gicd(0xffff0000, GICD_ICENABLER); /* Disable all PPI */
> -    writel_gicd(0x0000ffff, GICD_ISENABLER); /* Enable all SGI */
> +    writel_gicd(0xffffffffU, GICD_ICACTIVER); /* De-activate PPIs and SGIs */
> +    writel_gicd(0xffff0000U, GICD_ICENABLER); /* Disable all PPI */
> +    writel_gicd(0x0000ffffU, GICD_ISENABLER); /* Enable all SGI */
>  
>      /* Set SGI priorities */
>      for ( i = 0; i < 16; i += 4 )
> diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
> index 4e6c98bada..95e4f020fe 100644
> --- a/xen/arch/arm/gic-v3.c
> +++ b/xen/arch/arm/gic-v3.c
> @@ -619,8 +619,8 @@ static void __init gicv3_dist_init(void)
>      /* Disable/deactivate all global interrupts */
>      for ( i = NR_GIC_LOCAL_IRQS; i < nr_lines; i += 32 )
>      {
> -        writel_relaxed(0xffffffff, GICD + GICD_ICENABLER + (i / 32) * 4);
> -        writel_relaxed(0xffffffff, GICD + GICD_ICACTIVER + (i / 32) * 4);
> +        writel_relaxed(0xffffffffU, GICD + GICD_ICENABLER + (i / 32) * 4);
> +        writel_relaxed(0xffffffffU, GICD + GICD_ICACTIVER + (i / 32) * 4);
>      }
>  
>      /*
> @@ -832,13 +832,13 @@ static int gicv3_cpu_init(void)
>       * The activate state is unknown at boot, so make sure all
>       * SGIs and PPIs are de-activated.
>       */
> -    writel_relaxed(0xffffffff, GICD_RDIST_SGI_BASE + GICR_ICACTIVER0);
> +    writel_relaxed(0xffffffffU, GICD_RDIST_SGI_BASE + GICR_ICACTIVER0);
>      /*
>       * Disable all PPI interrupts, ensure all SGI interrupts are
>       * enabled.
>       */
> -    writel_relaxed(0xffff0000, GICD_RDIST_SGI_BASE + GICR_ICENABLER0);
> -    writel_relaxed(0x0000ffff, GICD_RDIST_SGI_BASE + GICR_ISENABLER0);
> +    writel_relaxed(0xffff0000U, GICD_RDIST_SGI_BASE + GICR_ICENABLER0);
> +    writel_relaxed(0x0000ffffU, GICD_RDIST_SGI_BASE + GICR_ISENABLER0);
>      /* Configure SGIs/PPIs as non-secure Group-1 */
>      writel_relaxed(GENMASK(31, 0), GICD_RDIST_SGI_BASE + GICR_IGROUPR0);
>  
> diff --git a/xen/arch/arm/include/asm/arm64/brk.h b/xen/arch/arm/include/asm/arm64/brk.h
> index 04442c4b9f..3af153a053 100644
> --- a/xen/arch/arm/include/asm/arm64/brk.h
> +++ b/xen/arch/arm/include/asm/arm64/brk.h
> @@ -21,7 +21,7 @@
>   * BRK instruction encoding
>   * The #imm16 value should be placed at bits[20:5] within BRK ins
>   */
> -#define AARCH64_BREAK_MON 0xd4200000
> +#define AARCH64_BREAK_MON 0xd4200000U
>  
>  /*
>   * BRK instruction for provoking a fault on purpose
> diff --git a/xen/arch/arm/include/asm/arm64/efibind.h b/xen/arch/arm/include/asm/arm64/efibind.h
> index 8b43bb8495..f13eadd4f0 100644
> --- a/xen/arch/arm/include/asm/arm64/efibind.h
> +++ b/xen/arch/arm/include/asm/arm64/efibind.h
> @@ -22,12 +22,12 @@ Revision History
>  #pragma pack()
>  #endif
>  
> -#define EFIERR(a)           (0x8000000000000000 | a)
> -#define EFI_ERROR_MASK      0x8000000000000000
> -#define EFIERR_OEM(a)       (0xc000000000000000 | a)
> +#define EFIERR(a)           (0x8000000000000000ULL | a)
> +#define EFI_ERROR_MASK      0x8000000000000000ULL
> +#define EFIERR_OEM(a)       (0xc000000000000000ULL | a)
>  
> -#define BAD_POINTER         0xFBFBFBFBFBFBFBFB
> -#define MAX_ADDRESS         0xFFFFFFFFFFFFFFFF
> +#define BAD_POINTER         0xFBFBFBFBFBFBFBFBULL
> +#define MAX_ADDRESS         0xFFFFFFFFFFFFFFFFULL
>  
>  #define EFI_STUB_ERROR      MAX_ADDRESS
>  
> diff --git a/xen/arch/arm/include/asm/arm64/insn.h b/xen/arch/arm/include/asm/arm64/insn.h
> index 4e0d364d41..6308959449 100644
> --- a/xen/arch/arm/include/asm/arm64/insn.h
> +++ b/xen/arch/arm/include/asm/arm64/insn.h
> @@ -60,14 +60,14 @@ static always_inline bool aarch64_insn_is_##abbr(u32 code) \
>  static always_inline u32 aarch64_insn_get_##abbr##_value(void) \
>  { return (val); }
>  
> -__AARCH64_INSN_FUNCS(b,		0xFC000000, 0x14000000)
> -__AARCH64_INSN_FUNCS(bl,	0xFC000000, 0x94000000)
> -__AARCH64_INSN_FUNCS(cbz,	0x7F000000, 0x34000000)
> -__AARCH64_INSN_FUNCS(cbnz,	0x7F000000, 0x35000000)
> -__AARCH64_INSN_FUNCS(tbz,	0x7F000000, 0x36000000)
> -__AARCH64_INSN_FUNCS(tbnz,	0x7F000000, 0x37000000)
> -__AARCH64_INSN_FUNCS(bcond,	0xFF000010, 0x54000000)
> -__AARCH64_INSN_FUNCS(hint,	0xFFFFF01F, 0xD503201F)
> +__AARCH64_INSN_FUNCS(b,		0xFC000000U, 0x14000000U)
> +__AARCH64_INSN_FUNCS(bl,	0xFC000000U, 0x94000000U)
> +__AARCH64_INSN_FUNCS(cbz,	0x7F000000U, 0x34000000U)
> +__AARCH64_INSN_FUNCS(cbnz,	0x7F000000U, 0x35000000U)
> +__AARCH64_INSN_FUNCS(tbz,	0x7F000000U, 0x36000000U)
> +__AARCH64_INSN_FUNCS(tbnz,	0x7F000000U, 0x37000000U)
> +__AARCH64_INSN_FUNCS(bcond,	0xFF000010U, 0x54000000U)
> +__AARCH64_INSN_FUNCS(hint,	0xFFFFF01FU, 0xD503201FU)
>  
>  bool aarch64_insn_is_branch_imm(u32 insn);
>  
> diff --git a/xen/arch/arm/include/asm/vreg.h b/xen/arch/arm/include/asm/vreg.h
> index bf945eebbd..387ce76e7e 100644
> --- a/xen/arch/arm/include/asm/vreg.h
> +++ b/xen/arch/arm/include/asm/vreg.h
> @@ -56,7 +56,7 @@ static inline bool vreg_emulate_cp64(struct cpu_user_regs *regs, union hsr hsr,
>  
>      if ( ret && cp64.read )
>      {
> -        set_user_reg(regs, cp64.reg1, x & 0xffffffff);
> +        set_user_reg(regs, cp64.reg1, x & 0xffffffffU);
>          set_user_reg(regs, cp64.reg2, x >> 32);
>      }
>  
> diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
> index ca5318515e..508c54824d 100644
> --- a/xen/arch/arm/kernel.c
> +++ b/xen/arch/arm/kernel.c
> @@ -39,7 +39,7 @@ struct minimal_dtb_header {
>      /* There are other fields but we don't use them yet. */
>  };
>  
> -#define DTB_MAGIC 0xd00dfeed
> +#define DTB_MAGIC 0xd00dfeedU
>  
>  /**
>   * copy_from_paddr - copy data from a physical address
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index ef5c6a8195..d1ef787638 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -398,7 +398,7 @@ static vaddr_t exception_handler32(vaddr_t offset)
>      register_t sctlr = READ_SYSREG(SCTLR_EL1);
>  
>      if ( sctlr & SCTLR_A32_EL1_V )
> -        return 0xffff0000 + offset;
> +        return 0xffff0000U + offset;
>      else /* always have security exceptions */
>          return READ_SYSREG(VBAR_EL1) + offset;
>  }
> @@ -809,7 +809,7 @@ static void show_registers_32(const struct cpu_user_regs *regs,
>  #ifdef CONFIG_ARM_64
>                 (uint32_t)(ctxt->far >> 32),
>                 ctxt->ifsr32_el2,
> -               (uint32_t)(ctxt->far & 0xffffffff),
> +               (uint32_t)(ctxt->far & 0xffffffffU),
>                 ctxt->esr_el1
>  #else
>                 ctxt->ifar, ctxt->ifsr, ctxt->dfar, ctxt->dfsr
> @@ -1414,16 +1414,16 @@ static void do_trap_hypercall(struct cpu_user_regs *regs, register_t *nr,
>      {
>          /* Deliberately corrupt parameter regs used by this hypercall. */
>          switch ( hypercall_args[*nr] ) {
> -        case 5: HYPERCALL_ARG5(regs) = 0xDEADBEEF;
> -        case 4: HYPERCALL_ARG4(regs) = 0xDEADBEEF;
> -        case 3: HYPERCALL_ARG3(regs) = 0xDEADBEEF;
> -        case 2: HYPERCALL_ARG2(regs) = 0xDEADBEEF;
> +        case 5: HYPERCALL_ARG5(regs) = 0xDEADBEEFU;
> +        case 4: HYPERCALL_ARG4(regs) = 0xDEADBEEFU;
> +        case 3: HYPERCALL_ARG3(regs) = 0xDEADBEEFU;
> +        case 2: HYPERCALL_ARG2(regs) = 0xDEADBEEFU;
>          case 1: /* Don't clobber x0/r0 -- it's the return value */
>          case 0: /* -ENOSYS case */
>              break;
>          default: BUG();
>          }
> -        *nr = 0xDEADBEEF;
> +        *nr = 0xDEADBEEFU;
>      }
>  #endif
>  
> diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
> index 0b083c33e6..35363fee09 100644
> --- a/xen/arch/arm/vgic-v2.c
> +++ b/xen/arch/arm/vgic-v2.c
> @@ -306,7 +306,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
>      case VREG32(GICD_SGIR):
>          if ( dabt.size != DABT_WORD ) goto bad_width;
>          /* Write only -- read unknown */
> -        *r = 0xdeadbeef;
> +        *r = 0xdeadbeefU;
>          return 1;
>  
>      case VRANGE32(0xF04, 0xF0C):
> diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
> index 9c1fdcc3f8..1b7173da1e 100644
> --- a/xen/arch/arm/vgic-v3.c
> +++ b/xen/arch/arm/vgic-v3.c
> @@ -354,7 +354,7 @@ read_reserved:
>      return 1;
>  
>  read_unknown:
> -    *r = vreg_reg64_extract(0xdeadbeafdeadbeaf, info);
> +    *r = vreg_reg64_extract(0xdeadbeafdeadbeafULL, info);
>      return 1;
>  }
>  
> diff --git a/xen/include/public/arch-arm/smccc.h b/xen/include/public/arch-arm/smccc.h
> index 802d800aad..8a9321ebed 100644
> --- a/xen/include/public/arch-arm/smccc.h
> +++ b/xen/include/public/arch-arm/smccc.h
> @@ -26,7 +26,7 @@
>  #define XEN_SMCCC_MINOR_REVISION 1
>  
>  /* Hypervisor Service UID. Randomly generated with uuidgen. */
> -#define XEN_SMCCC_UID XEN_DEFINE_UUID(0xa71812dc, 0xc698, 0x4369, 0x9acf, \
> +#define XEN_SMCCC_UID XEN_DEFINE_UUID(0xa71812dcU, 0xc698, 0x4369, 0x9acf, \
>                                        0x79, 0xd1, 0x8d, 0xde, 0xe6, 0x67)
>  
>  /* Standard Service Service Call version. */
> @@ -34,7 +34,7 @@
>  #define SSSC_SMCCC_MINOR_REVISION 1
>  
>  /* Standard Service Call UID. Randomly generated with uuidgen. */
> -#define SSSC_SMCCC_UID XEN_DEFINE_UUID(0xf863386f, 0x4b39, 0x4cbd, 0x9220,\
> +#define SSSC_SMCCC_UID XEN_DEFINE_UUID(0xf863386fU, 0x4b39, 0x4cbd, 0x9220,\
>                                         0xce, 0x16, 0x41, 0xe5, 0x9f, 0x6f)
>  
>  #endif /* __XEN_PUBLIC_ARCH_ARM_SMCCC_H__ */
> -- 
> 2.41.0
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 22:43:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 22:43:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562870.879614 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJiYT-0006nJ-Db; Wed, 12 Jul 2023 22:43:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562870.879614; Wed, 12 Jul 2023 22:43:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJiYT-0006nC-Au; Wed, 12 Jul 2023 22:43:29 +0000
Received: by outflank-mailman (input) for mailman id 562870;
 Wed, 12 Jul 2023 22:43:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eU4r=C6=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qJiYR-0006n6-R2
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 22:43:27 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8346d7de-2105-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 00:43:26 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 462A26197C;
 Wed, 12 Jul 2023 22:43:25 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF7A4C433CA;
 Wed, 12 Jul 2023 22:43:22 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8346d7de-2105-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689201804;
	bh=Wp2RkSBZ1d9tlr3YrJGZaC2S9ApRBwd88ZF5B4+vwYo=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=bVWYkDF7/vDGj540mpbziTMw49IhBUDLfv/hCAzptpSJ+62iuqHy8fR7DrKZBP3pY
	 jbmWtqnMMhD/u23CXpl/k/vkNA6fI0+WYDIin7VhCkBibyxzcZ2bhXCsql4lH9t9G9
	 t1F1809ZuTIJ/puRdoqvIfwyZuxFYsunoea8FiMzR3jfeM3h+Nwn/Qs98/Kk46aUl9
	 mBjVr68XCtxm+yRCzYrCHcByUcF1e+yT+T5A9lM2LCYJGbFL73Fpz1iTcHcM/28pZD
	 +aRPpspBWdldVYJPfPcT/dcywyT366dB7jmh4+Y+Pzq2mP6VoyEeOX2vteVe/YFW+e
	 bqSx1khlMdN4w==
Date: Wed, 12 Jul 2023 15:43:21 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Simone Ballarin <simone.ballarin@bugseng.com>, consulting@bugseng.com, 
    Gianluca Luparini <gianluca.luparini@bugseng.com>, 
    Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>, 
    xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v3 07/15] x86/vmx: fix violations of MISRA C:2012
 Rule 7.2
In-Reply-To: <301fda12-33bb-325f-2ca7-8f177ddf89b2@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307121543080.761183@ubuntu-linux-20-04-desktop>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com> <c4953517b9675b2099841be704f0c67989e76342.1689152719.git.gianluca.luparini@bugseng.com> <301fda12-33bb-325f-2ca7-8f177ddf89b2@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 12 Jul 2023, Jan Beulich wrote:
> On 12.07.2023 12:32, Simone Ballarin wrote:
> > From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> > 
> > The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> > headline states:
> > "A 'u' or 'U' suffix shall be applied to all integer constants
> > that are represented in an unsigned type".
> > 
> > Add the 'U' suffix to integers literals with unsigned type.
> > 
> > For the sake of uniformity, the following changes are made:
> > - add the 'U' suffix to macros near
> >   'CPU_BASED_ACTIVATE_SECONDARY_CONTROLS' and
> >   'SECONDARY_EXEC_NOTIFY_VM_EXITING' macros in 'vmcs.h'
> > - add the 'U' suffix to macros near 'INTR_INFO_VALID_MASK'
> >   macro in 'vmx.h'
> > 
> > Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> > Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> > Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> > ---
> > Changes in v3:
> > - change 'Signed-off-by' ordering
> > - change commit message
> > - remove unnecessary changes in 'vvmx.c'
> > - add 'uint32_t' casts in 'vvmx.c'
> > - add missing 'U' in 'vmcs.h' macros
> > - change macro to '(1u << 31)' in 'vmx.h'
> > - remove unnecessary changes to 'vmx.h'
> 
> With this many changes I don't think you can retain an R-b, unless
> the person it came from really explicitly agreed with at least all
> not purely cosmetic changes (which I don't think was the case here).

I re-reviewed it:

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> Irrespective:
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> 
> Jan
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 23:03:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 23:03:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562874.879623 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJirf-0000uT-Vl; Wed, 12 Jul 2023 23:03:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562874.879623; Wed, 12 Jul 2023 23:03:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJirf-0000uM-T3; Wed, 12 Jul 2023 23:03:19 +0000
Received: by outflank-mailman (input) for mailman id 562874;
 Wed, 12 Jul 2023 23:03:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eU4r=C6=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qJirf-0000uG-5K
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 23:03:19 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 492418b4-2108-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 01:03:17 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 1E2916198A;
 Wed, 12 Jul 2023 23:03:16 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id E243FC433C7;
 Wed, 12 Jul 2023 23:03:13 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 492418b4-2108-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689202995;
	bh=s7UpWwfEAKw7LnHMf0U++pkdvy2QbsIG0grpKwXNRmo=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=G9zl0kumBz56bV49DihZwU2XQUCikxETwHW04qo3Xz6JP/IIbIry5rS7OoDiMvJrK
	 d/vLfC7mj9S9IFQBiql6dKTybBaAhSGZXJWads/iOMuNBVqzA7ssYt2TjUe9ElC1Zr
	 xxOYj4s2QlaRlnUhiieig0e/pQIbvabolw/dFNxWVNhOh/N0K2OG9UC4vgs/FIh428
	 Vl33x2zWg6V9gJ31iQeaBWZbq2tyGibkyltoiy8IYSXt4FhcKkxyIhqCy9sIjWLjyH
	 jbH70y8NHqQB+9FHjW7b2EmUTu0PNoV1dbzHBu08/OupmoOeWkHEDqyAMT7nJ+nap8
	 XSjizafuJjhEQ==
Date: Wed, 12 Jul 2023 16:03:12 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Gianluca Luparini <gianluca.luparini@bugseng.com>, 
    Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH v3 12/15] xen/x86: fix violations of MISRA C:2012
 Rule 7.2
In-Reply-To: <78717a3ccee0517eab915156fc474394ae1dcf81.1689152719.git.gianluca.luparini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307121554040.761183@ubuntu-linux-20-04-desktop>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com> <78717a3ccee0517eab915156fc474394ae1dcf81.1689152719.git.gianluca.luparini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 12 Jul 2023, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type.
> 
> For the sake of uniformity, the following changes are made:
> - add the 'U' suffix to all first macro's arguments in 'mce-apei.c'
> - add the 'U' suffix to switch cases in 'cpuid.c'
> - add 'U' suffixes to 'mask16' in 'stdvga.c'
> - add the 'U' suffix to macros in 'pci.h'
> 
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

The checked the patch and everything looks correct.

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


Two minor comments below that could or could not be addressed on commit.
It is fine either way for me.


> diff --git a/xen/arch/x86/extable.c b/xen/arch/x86/extable.c
> index c3771c2e39..0e8694c188 100644
> --- a/xen/arch/x86/extable.c
> +++ b/xen/arch/x86/extable.c
> @@ -141,7 +141,7 @@ static int __init cf_check stub_selftest(void)
>            .rax = 0x0123456789abcdef,
>            .res.fields.trapnr = X86_EXC_GP },
>          { .opc = { endbr64, 0x02, 0x04, 0x04, 0xc3 }, /* add (%rsp,%rax),%al */
> -          .rax = 0xfedcba9876543210,
> +          .rax = 0xfedcba9876543210UL,
>            .res.fields.trapnr = X86_EXC_SS },
>          { .opc = { endbr64, 0xcc, 0xc3, 0xc3, 0xc3 }, /* int3 */
>            .res.fields.trapnr = X86_EXC_BP },

I wonder if it would be easier to be consistent cross-arch and just use
ULL everywhere a 64-bit value is present.

I know it is not required on x86, so this is just an optional
comment, I'll leave it to the maintainers.


> @@ -325,83 +325,83 @@
>  
>  /* K7/K8 MSRs. Not complete. See the architecture manual for a more
>     complete list. */
> -#define MSR_K7_EVNTSEL0			0xc0010000
> -#define MSR_K7_PERFCTR0			0xc0010004
> -#define MSR_K7_EVNTSEL1			0xc0010001
> -#define MSR_K7_PERFCTR1			0xc0010005
> -#define MSR_K7_EVNTSEL2			0xc0010002
> -#define MSR_K7_PERFCTR2			0xc0010006
> -#define MSR_K7_EVNTSEL3			0xc0010003
> -#define MSR_K7_PERFCTR3			0xc0010007
> -#define MSR_K8_TOP_MEM1			0xc001001a
> -#define MSR_K7_CLK_CTL			0xc001001b
> -#define MSR_K8_TOP_MEM2			0xc001001d
> -
> -#define MSR_K8_HWCR			0xc0010015
> +#define MSR_K7_EVNTSEL0			0xc0010000U
> +#define MSR_K7_PERFCTR0			0xc0010004U
> +#define MSR_K7_EVNTSEL1			0xc0010001U
> +#define MSR_K7_PERFCTR1			0xc0010005U
> +#define MSR_K7_EVNTSEL2			0xc0010002U
> +#define MSR_K7_PERFCTR2			0xc0010006U
> +#define MSR_K7_EVNTSEL3			0xc0010003U
> +#define MSR_K7_PERFCTR3			0xc0010007U
> +#define MSR_K8_TOP_MEM1			0xc001001aU
> +#define MSR_K7_CLK_CTL			0xc001001bU
> +#define MSR_K8_TOP_MEM2			0xc001001dU
> +
> +#define MSR_K8_HWCR			0xc0010015U
>  #define K8_HWCR_TSC_FREQ_SEL		(1ULL << 24)
>  #define K8_HWCR_CPUID_USER_DIS		(1ULL << 35)
>  
> -#define MSR_K7_FID_VID_CTL		0xc0010041
> -#define MSR_K7_FID_VID_STATUS		0xc0010042
> -#define MSR_K8_PSTATE_LIMIT		0xc0010061
> -#define MSR_K8_PSTATE_CTRL		0xc0010062
> -#define MSR_K8_PSTATE_STATUS		0xc0010063
> -#define MSR_K8_PSTATE0			0xc0010064
> -#define MSR_K8_PSTATE1			0xc0010065
> -#define MSR_K8_PSTATE2			0xc0010066
> -#define MSR_K8_PSTATE3			0xc0010067
> -#define MSR_K8_PSTATE4			0xc0010068
> -#define MSR_K8_PSTATE5			0xc0010069
> -#define MSR_K8_PSTATE6			0xc001006A
> -#define MSR_K8_PSTATE7			0xc001006B
> -#define MSR_K8_ENABLE_C1E		0xc0010055
> -#define MSR_K8_VM_HSAVE_PA		0xc0010117
> -
> -#define MSR_AMD_FAM15H_EVNTSEL0		0xc0010200
> -#define MSR_AMD_FAM15H_PERFCTR0		0xc0010201
> -#define MSR_AMD_FAM15H_EVNTSEL1		0xc0010202
> -#define MSR_AMD_FAM15H_PERFCTR1		0xc0010203
> -#define MSR_AMD_FAM15H_EVNTSEL2		0xc0010204
> -#define MSR_AMD_FAM15H_PERFCTR2		0xc0010205
> -#define MSR_AMD_FAM15H_EVNTSEL3		0xc0010206
> -#define MSR_AMD_FAM15H_PERFCTR3		0xc0010207
> -#define MSR_AMD_FAM15H_EVNTSEL4		0xc0010208
> -#define MSR_AMD_FAM15H_PERFCTR4		0xc0010209
> -#define MSR_AMD_FAM15H_EVNTSEL5		0xc001020a
> -#define MSR_AMD_FAM15H_PERFCTR5		0xc001020b
> -
> -#define MSR_AMD_L7S0_FEATURE_MASK	0xc0011002
> -#define MSR_AMD_THRM_FEATURE_MASK	0xc0011003
> -#define MSR_K8_FEATURE_MASK		0xc0011004
> -#define MSR_K8_EXT_FEATURE_MASK		0xc0011005
> +#define MSR_K7_FID_VID_CTL		0xc0010041U
> +#define MSR_K7_FID_VID_STATUS		0xc0010042U
> +#define MSR_K8_PSTATE_LIMIT		0xc0010061U
> +#define MSR_K8_PSTATE_CTRL		0xc0010062U
> +#define MSR_K8_PSTATE_STATUS		0xc0010063U
> +#define MSR_K8_PSTATE0			0xc0010064U
> +#define MSR_K8_PSTATE1			0xc0010065U
> +#define MSR_K8_PSTATE2			0xc0010066U
> +#define MSR_K8_PSTATE3			0xc0010067U
> +#define MSR_K8_PSTATE4			0xc0010068U
> +#define MSR_K8_PSTATE5			0xc0010069U
> +#define MSR_K8_PSTATE6			0xc001006AU
> +#define MSR_K8_PSTATE7			0xc001006BU
> +#define MSR_K8_ENABLE_C1E		0xc0010055U
> +#define MSR_K8_VM_HSAVE_PA		0xc0010117U
> +
> +#define MSR_AMD_FAM15H_EVNTSEL0		0xc0010200U
> +#define MSR_AMD_FAM15H_PERFCTR0		0xc0010201U
> +#define MSR_AMD_FAM15H_EVNTSEL1		0xc0010202U
> +#define MSR_AMD_FAM15H_PERFCTR1		0xc0010203U
> +#define MSR_AMD_FAM15H_EVNTSEL2		0xc0010204U
> +#define MSR_AMD_FAM15H_PERFCTR2		0xc0010205U
> +#define MSR_AMD_FAM15H_EVNTSEL3		0xc0010206U
> +#define MSR_AMD_FAM15H_PERFCTR3		0xc0010207U
> +#define MSR_AMD_FAM15H_EVNTSEL4		0xc0010208U
> +#define MSR_AMD_FAM15H_PERFCTR4		0xc0010209U
> +#define MSR_AMD_FAM15H_EVNTSEL5		0xc001020aU
> +#define MSR_AMD_FAM15H_PERFCTR5		0xc001020bU
> +
> +#define MSR_AMD_L7S0_FEATURE_MASK	0xc0011002U
> +#define MSR_AMD_THRM_FEATURE_MASK	0xc0011003U
> +#define MSR_K8_FEATURE_MASK			0xc0011004U
> +#define MSR_K8_EXT_FEATURE_MASK		0xc0011005U

Here MSR_K8_FEATURE_MASK has one more tab compared to the original code.
The code style might need adjusting, it can be done on commit.


>  /* AMD64 MSRs */
> -#define MSR_AMD64_NB_CFG		0xc001001f
> +#define MSR_AMD64_NB_CFG		0xc001001fU
>  #define AMD64_NB_CFG_CF8_EXT_ENABLE_BIT	46
> -#define MSR_AMD64_LS_CFG		0xc0011020
> -#define MSR_AMD64_IC_CFG		0xc0011021
> -#define MSR_AMD64_DC_CFG		0xc0011022
> -#define MSR_AMD64_DE_CFG		0xc0011029
> +#define MSR_AMD64_LS_CFG		0xc0011020U
> +#define MSR_AMD64_IC_CFG		0xc0011021U
> +#define MSR_AMD64_DC_CFG		0xc0011022U
> +#define MSR_AMD64_DE_CFG		0xc0011029U
>  #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
> -#define MSR_AMD64_EX_CFG		0xc001102c
> -#define MSR_AMD64_DE_CFG2		0xc00110e3
> +#define MSR_AMD64_EX_CFG		0xc001102cU
> +#define MSR_AMD64_DE_CFG2		0xc00110e3U
>  
> -#define MSR_AMD64_DR0_ADDRESS_MASK	0xc0011027
> -#define MSR_AMD64_DR1_ADDRESS_MASK	0xc0011019
> -#define MSR_AMD64_DR2_ADDRESS_MASK	0xc001101a
> -#define MSR_AMD64_DR3_ADDRESS_MASK	0xc001101b
> +#define MSR_AMD64_DR0_ADDRESS_MASK	0xc0011027U
> +#define MSR_AMD64_DR1_ADDRESS_MASK	0xc0011019U
> +#define MSR_AMD64_DR2_ADDRESS_MASK	0xc001101aU
> +#define MSR_AMD64_DR3_ADDRESS_MASK	0xc001101bU
>  
>  /* AMD Family10h machine check MSRs */
> -#define MSR_F10_MC4_MISC1		0xc0000408
> -#define MSR_F10_MC4_MISC2		0xc0000409
> -#define MSR_F10_MC4_MISC3		0xc000040A
> +#define MSR_F10_MC4_MISC1		0xc0000408U
> +#define MSR_F10_MC4_MISC2		0xc0000409U
> +#define MSR_F10_MC4_MISC3		0xc000040AU
>  
>  /* AMD Family10h Bus Unit MSRs */
> -#define MSR_F10_BU_CFG 		0xc0011023
> -#define MSR_F10_BU_CFG2		0xc001102a
> +#define MSR_F10_BU_CFG 		0xc0011023U
> +#define MSR_F10_BU_CFG2		0xc001102aU
>  
>  /* Other AMD Fam10h MSRs */
> -#define MSR_FAM10H_MMIO_CONF_BASE	0xc0010058
> +#define MSR_FAM10H_MMIO_CONF_BASE	0xc0010058U
>  #define FAM10H_MMIO_CONF_ENABLE         (1<<0)
>  #define FAM10H_MMIO_CONF_BUSRANGE_MASK	0xf
>  #define FAM10H_MMIO_CONF_BUSRANGE_SHIFT 2
> @@ -410,31 +410,31 @@
>  
>  /* AMD Microcode MSRs */
>  #define MSR_AMD_PATCHLEVEL		0x0000008b
> -#define MSR_AMD_PATCHLOADER		0xc0010020
> +#define MSR_AMD_PATCHLOADER		0xc0010020U
>  
>  /* AMD TSC RATE MSR */
> -#define MSR_AMD64_TSC_RATIO		0xc0000104
> +#define MSR_AMD64_TSC_RATIO		0xc0000104U
>  
>  /* AMD Lightweight Profiling MSRs */
> -#define MSR_AMD64_LWP_CFG		0xc0000105
> -#define MSR_AMD64_LWP_CBADDR		0xc0000106
> +#define MSR_AMD64_LWP_CFG		0xc0000105U
> +#define MSR_AMD64_LWP_CBADDR		0xc0000106U
>  
>  /* AMD OS Visible Workaround MSRs */
> -#define MSR_AMD_OSVW_ID_LENGTH          0xc0010140
> -#define MSR_AMD_OSVW_STATUS             0xc0010141
> +#define MSR_AMD_OSVW_ID_LENGTH          0xc0010140U
> +#define MSR_AMD_OSVW_STATUS             0xc0010141U
>  
>  /* AMD Protected Processor Inventory Number */
> -#define MSR_AMD_PPIN_CTL                0xc00102f0
> -#define MSR_AMD_PPIN                    0xc00102f1
> +#define MSR_AMD_PPIN_CTL                0xc00102f0U
> +#define MSR_AMD_PPIN                    0xc00102f1U
>  
>  /* K6 MSRs */
> -#define MSR_K6_EFER			0xc0000080
> -#define MSR_K6_STAR			0xc0000081
> -#define MSR_K6_WHCR			0xc0000082
> -#define MSR_K6_UWCCR			0xc0000085
> -#define MSR_K6_EPMR			0xc0000086
> -#define MSR_K6_PSOR			0xc0000087
> -#define MSR_K6_PFIR			0xc0000088
> +#define MSR_K6_EFER			0xc0000080U
> +#define MSR_K6_STAR			0xc0000081U
> +#define MSR_K6_WHCR			0xc0000082U
> +#define MSR_K6_UWCCR			0xc0000085U
> +#define MSR_K6_EPMR			0xc0000086U
> +#define MSR_K6_PSOR			0xc0000087U
> +#define MSR_K6_PFIR			0xc0000088U
>  
>  /* Centaur-Hauls/IDT defined MSRs. */
>  #define MSR_IDT_FCR1			0x00000107
> @@ -459,10 +459,10 @@
>  #define MSR_VIA_BCR2			0x00001147
>  
>  /* Transmeta defined MSRs */
> -#define MSR_TMTA_LONGRUN_CTRL		0x80868010
> -#define MSR_TMTA_LONGRUN_FLAGS		0x80868011
> -#define MSR_TMTA_LRTI_READOUT		0x80868018
> -#define MSR_TMTA_LRTI_VOLT_MHZ		0x8086801a
> +#define MSR_TMTA_LONGRUN_CTRL		0x80868010U
> +#define MSR_TMTA_LONGRUN_FLAGS		0x80868011U
> +#define MSR_TMTA_LRTI_READOUT		0x80868018U
> +#define MSR_TMTA_LRTI_VOLT_MHZ		0x8086801aU
>  
>  /* Intel defined MSRs. */
>  #define MSR_IA32_P5_MC_ADDR		0x00000000

[...]

> diff --git a/xen/arch/x86/percpu.c b/xen/arch/x86/percpu.c
> index 288050cdba..1ebeb65ad6 100644
> --- a/xen/arch/x86/percpu.c
> +++ b/xen/arch/x86/percpu.c
> @@ -12,7 +12,7 @@ unsigned long __per_cpu_offset[NR_CPUS];
>   * possible #PF at (NULL + a little) which has security implications in the
>   * context of PV guests.
>   */
> -#define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
> +#define INVALID_PERCPU_AREA (0x8000000000000000UL - (long)__per_cpu_start)
>  #define PERCPU_ORDER get_order_from_bytes(__per_cpu_data_end - __per_cpu_start)
>  
>  void __init percpu_init_areas(void)

Also here about 64-bit values


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 23:04:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 23:04:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562878.879634 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJisx-0001QU-8z; Wed, 12 Jul 2023 23:04:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562878.879634; Wed, 12 Jul 2023 23:04:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJisx-0001QN-5t; Wed, 12 Jul 2023 23:04:39 +0000
Received: by outflank-mailman (input) for mailman id 562878;
 Wed, 12 Jul 2023 23:04:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eU4r=C6=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qJisw-0001QH-Iq
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 23:04:38 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 78bc041a-2108-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 01:04:37 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 15E81618B3;
 Wed, 12 Jul 2023 23:04:36 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEA2CC433C7;
 Wed, 12 Jul 2023 23:04:33 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 78bc041a-2108-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689203075;
	bh=U1fB1kfpXc4HvTZoE3th9aoKWcHY/FdcPG8yJzGQ30M=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=CxD0C+IzHd7rImrJpcYHgqv0KLVaxVZ3466RrUhCarfmsBwgqceBV+hH037Y+UZY8
	 qrCeFbuYIgLFlO8HD2/ZkG7+hrKpQSdMEvuq+iZfx3paXJqp1d3a8BJ3DjuHyCQwhH
	 yW6Tn1+F4oP9gDT7HUkQbd46D3cRC6/NqQPSwEjQAqVn1czMDirQeISlVkmHQpQ8BX
	 ncMonJNlY0ihmSCnZHiywvJ1/i8Pwuq0EiMiPVq9R7AY8FVxNCKkyssYJVyriWRSC/
	 FVGn6FWid2SBeWgkSqPdeT8bTaxQPHtafHOPUcLnXY+CiBnxF3fyATjg4j26H0SZ7r
	 5Ca9UI92PmHag==
Date: Wed, 12 Jul 2023 16:04:32 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Gianluca Luparini <gianluca.luparini@bugseng.com>, 
    Paul Durrant <paul@xen.org>, Wei Liu <wl@xen.org>, 
    Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH v3 13/15] x86/viridian: fix violations of MISRA C:2012
 Rule 7.2
In-Reply-To: <925b70ccf1140945d6a1e73263c84e3b6db12ec8.1689152719.git.gianluca.luparini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307121604240.761183@ubuntu-linux-20-04-desktop>
References: <cover.1689152719.git.gianluca.luparini@bugseng.com> <925b70ccf1140945d6a1e73263c84e3b6db12ec8.1689152719.git.gianluca.luparini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 12 Jul 2023, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.luparini@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type and also to other
> literals used in the same contexts or near violations, when their positive
> nature is immediately clear. The latter changes are done for the sake of
> uniformity.
> 
> Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes in v3:
> - create this commit for 'viridian.c' and 'hyperv-tlfs.h'
> ---
>  xen/arch/x86/hvm/viridian/viridian.c         |  2 +-
>  xen/arch/x86/include/asm/guest/hyperv-tlfs.h | 28 ++++++++++----------
>  2 files changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
> index 7405c117bc..61171e3363 100644
> --- a/xen/arch/x86/hvm/viridian/viridian.c
> +++ b/xen/arch/x86/hvm/viridian/viridian.c
> @@ -291,7 +291,7 @@ static void enable_hypercall_page(struct domain *d)
>       * calling convention) to differentiate Xen and Viridian hypercalls.
>       */
>      *(u8  *)(p + 0) = 0x0d; /* orl $0x80000000, %eax */
> -    *(u32 *)(p + 1) = 0x80000000;
> +    *(u32 *)(p + 1) = 0x80000000U;
>      *(u8  *)(p + 5) = 0x0f; /* vmcall/vmmcall */
>      *(u8  *)(p + 6) = 0x01;
>      *(u8  *)(p + 7) = (cpu_has_vmx ? 0xc1 : 0xd9);
> diff --git a/xen/arch/x86/include/asm/guest/hyperv-tlfs.h b/xen/arch/x86/include/asm/guest/hyperv-tlfs.h
> index 38f997a0c8..a6915ad731 100644
> --- a/xen/arch/x86/include/asm/guest/hyperv-tlfs.h
> +++ b/xen/arch/x86/include/asm/guest/hyperv-tlfs.h
> @@ -471,30 +471,30 @@ typedef struct _HV_REFERENCE_TSC_PAGE {
>  
>  /* Define hypervisor message types. */
>  enum hv_message_type {
> -	HVMSG_NONE			= 0x00000000,
> +	HVMSG_NONE			= 0x00000000U,
>  
>  	/* Memory access messages. */
> -	HVMSG_UNMAPPED_GPA		= 0x80000000,
> -	HVMSG_GPA_INTERCEPT		= 0x80000001,
> +	HVMSG_UNMAPPED_GPA		= 0x80000000U,
> +	HVMSG_GPA_INTERCEPT		= 0x80000001U,
>  
>  	/* Timer notification messages. */
> -	HVMSG_TIMER_EXPIRED			= 0x80000010,
> +	HVMSG_TIMER_EXPIRED			= 0x80000010U,
>  
>  	/* Error messages. */
> -	HVMSG_INVALID_VP_REGISTER_VALUE	= 0x80000020,
> -	HVMSG_UNRECOVERABLE_EXCEPTION	= 0x80000021,
> -	HVMSG_UNSUPPORTED_FEATURE		= 0x80000022,
> +	HVMSG_INVALID_VP_REGISTER_VALUE	= 0x80000020U,
> +	HVMSG_UNRECOVERABLE_EXCEPTION	= 0x80000021U,
> +	HVMSG_UNSUPPORTED_FEATURE		= 0x80000022U,
>  
>  	/* Trace buffer complete messages. */
> -	HVMSG_EVENTLOG_BUFFERCOMPLETE	= 0x80000040,
> +	HVMSG_EVENTLOG_BUFFERCOMPLETE	= 0x80000040U,
>  
>  	/* Platform-specific processor intercept messages. */
> -	HVMSG_X64_IOPORT_INTERCEPT		= 0x80010000,
> -	HVMSG_X64_MSR_INTERCEPT		= 0x80010001,
> -	HVMSG_X64_CPUID_INTERCEPT		= 0x80010002,
> -	HVMSG_X64_EXCEPTION_INTERCEPT	= 0x80010003,
> -	HVMSG_X64_APIC_EOI			= 0x80010004,
> -	HVMSG_X64_LEGACY_FP_ERROR		= 0x80010005
> +	HVMSG_X64_IOPORT_INTERCEPT		= 0x80010000U,
> +	HVMSG_X64_MSR_INTERCEPT		= 0x80010001U,
> +	HVMSG_X64_CPUID_INTERCEPT		= 0x80010002U,
> +	HVMSG_X64_EXCEPTION_INTERCEPT	= 0x80010003U,
> +	HVMSG_X64_APIC_EOI			= 0x80010004U,
> +	HVMSG_X64_LEGACY_FP_ERROR		= 0x80010005U
>  };
>  
>  /* Define synthetic interrupt controller message flags. */
> -- 
> 2.41.0
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 23:07:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 23:07:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562882.879643 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJivW-00024m-LN; Wed, 12 Jul 2023 23:07:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562882.879643; Wed, 12 Jul 2023 23:07:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJivW-00024e-Im; Wed, 12 Jul 2023 23:07:18 +0000
Received: by outflank-mailman (input) for mailman id 562882;
 Wed, 12 Jul 2023 23:07:17 +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
 <SRS0=eU4r=C6=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qJivV-00024Y-Ry
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 23:07:17 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d71aae3c-2108-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 01:07:15 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 6899161987;
 Wed, 12 Jul 2023 23:07:14 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51974C433C9;
 Wed, 12 Jul 2023 23:07:12 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d71aae3c-2108-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689203233;
	bh=CYRbIpWoIAaxmtzfD3OKPejKu4fNSGS/fN4ROsKBYnI=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=IhwzZVTVknV/Q8SRDFs6r69Yo5byXyFS7p3MMok4LBqx0TmiCxHwA6VDWq14XawB+
	 QCXapxuln3Z/fHty5XiVqxd3/0Y7F5zU5aTpY12y3VfoMxW+z2ufuLhVmEhozvekv0
	 PjOvFt8Poqm/29tOBRpwrptMXm8bAMr4qXvLkH8UrAXge5d4ui3idPP+DUWPnC9o8H
	 Q6UU0csbDhvFANRFsRe0kLQyVflwTVvv+F/IiNjuUxeHBmjtU6m+WhnjH7TzoyWZUk
	 PuYGRdwtwSReql8Ige5ejQLKVvY2vj0n1ADco4Onz7rCkPWlkrz/BdShy7vKOTEJtl
	 LgbwrXakAKfPA==
Date: Wed, 12 Jul 2023 16:07:10 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org, 
    michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, 
    consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>
Subject: Re: [XEN PATCH] xen: fix violations of MISRA C:2012 Rule 3.1
In-Reply-To: <9a27f6cbe552a00274f7ad32eec63f0e80e7644f.1689176790.git.nicola.vetrini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307121607030.761183@ubuntu-linux-20-04-desktop>
References: <9a27f6cbe552a00274f7ad32eec63f0e80e7644f.1689176790.git.nicola.vetrini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 12 Jul 2023, Nicola Vetrini wrote:
> In the file 'xen/common/xmalloc_tlsf.c' is not clear how
> the commented-out code should interact with the previous statement.
> To resolve the MISRA violation generated by the nested comment
> a #if .. #endif block with an explanatory comment substitutes
> the earlier construct.
> 
> In the file 'xen/include/xen/atomic.h' the nested comment has been removed,
> since the code sample is already explained by the preceding comment.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Following the suggestion of this message
> https://lore.kernel.org/xen-devel/536f3049-41f7-b127-ba94-81925e34ea0f@suse.com/
> an explanatory comment has been added.
> ---
>  xen/common/xmalloc_tlsf.c | 13 ++++++++++---
>  xen/include/xen/atomic.h  |  2 +-
>  2 files changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c
> index c21bf71e88..56c3849414 100644
> --- a/xen/common/xmalloc_tlsf.c
> +++ b/xen/common/xmalloc_tlsf.c
> @@ -139,10 +139,17 @@ static inline void MAPPING_SEARCH(unsigned long *r, int *fl, int *sl)
>          *r = *r + t;
>          *fl = flsl(*r) - 1;
>          *sl = (*r >> (*fl - MAX_LOG2_SLI)) - MAX_SLI;
> -        *fl -= FLI_OFFSET;
> -        /*if ((*fl -= FLI_OFFSET) < 0) // FL will be always >0!
> -         *fl = *sl = 0;
> +        /* 
> +         * It's unclear what was the purpose of the commented-out code that now
> +         * is in the #else branch. The current form is motivated by the correction
> +         * of a violation MISRA:C 2012 Rule 3.1
>           */
> +#if 1
> +        *fl -= FLI_OFFSET;
> +#else
> +        if ((*fl -= FLI_OFFSET) < 0) // FL will be always >0!
> +          *fl = *sl = 0;
> +#endif
>          *r &= ~t;
>      }
>  }
> diff --git a/xen/include/xen/atomic.h b/xen/include/xen/atomic.h
> index 529213ebbb..fa750a18ae 100644
> --- a/xen/include/xen/atomic.h
> +++ b/xen/include/xen/atomic.h
> @@ -78,7 +78,7 @@ static inline void _atomic_set(atomic_t *v, int i);
>   *      int old = atomic_read(&v);
>   *      int new = old + 1;
>   *      if ( likely(old == atomic_cmpxchg(&v, old, new)) )
> - *          break; // success!
> + *          break;
>   *  }
>   */
>  static inline int atomic_cmpxchg(atomic_t *v, int old, int new);
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 12 23:24:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Jul 2023 23:24:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562891.879653 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJjCA-0004aW-5G; Wed, 12 Jul 2023 23:24:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562891.879653; Wed, 12 Jul 2023 23:24:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJjCA-0004aP-2i; Wed, 12 Jul 2023 23:24:30 +0000
Received: by outflank-mailman (input) for mailman id 562891;
 Wed, 12 Jul 2023 23:24:28 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJjC8-0004aF-Nn; Wed, 12 Jul 2023 23:24:28 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJjC8-0006Tw-KV; Wed, 12 Jul 2023 23:24:28 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJjC7-0005Px-VF; Wed, 12 Jul 2023 23:24:28 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJjC7-0006H1-Ur; Wed, 12 Jul 2023 23:24:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=xXxdQbWmWsS3fwnbxss3iIV9jRdESrWt3Eoqgd2JiNg=; b=bkllW/HXvA7nj0VC+3gERJrUjT
	1xYNnF2E0ZnjgTU90zx/de6GwymI4w1Wfm5WV6knqy2NcOedOVWrxU4gdM4CrAIULw1a1PmVSRHep
	kTQwi3YZJDvKdb/D/0D8aQHv81okPbCXIlTfSG/beROxmi2lJj6Wo/iPk4lzQI652Y0c=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181776-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181776: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=24909098fdb260da9ffd0ba733d3a540c8c61aec
X-Osstest-Versions-That:
    xen=0a834e953b01ec25c412369d7a5b8b57d340ac60
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 12 Jul 2023 23:24:27 +0000

flight 181776 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181776/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  24909098fdb260da9ffd0ba733d3a540c8c61aec
baseline version:
 xen                  0a834e953b01ec25c412369d7a5b8b57d340ac60

Last test of basis   181773  2023-07-12 12:02:02 Z    0 days
Testing same since   181776  2023-07-12 21:00:25 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   0a834e953b..24909098fd  24909098fdb260da9ffd0ba733d3a540c8c61aec -> smoke


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 01:28:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 01:28:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562901.879665 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJl8H-0007Lp-Jg; Thu, 13 Jul 2023 01:28:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562901.879665; Thu, 13 Jul 2023 01:28:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJl8H-0007Li-FO; Thu, 13 Jul 2023 01:28:37 +0000
Received: by outflank-mailman (input) for mailman id 562901;
 Thu, 13 Jul 2023 01:28:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJl8F-0007LY-SC; Thu, 13 Jul 2023 01:28:35 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJl8F-0008E3-Lv; Thu, 13 Jul 2023 01:28:35 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJl8F-00049T-8d; Thu, 13 Jul 2023 01:28:35 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJl8F-0006jG-83; Thu, 13 Jul 2023 01:28:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=18ilu41Ul+ThHfdn5o8QKr5SWO9PS03HBkaBz/EZYJw=; b=Toro5UzJE3Sz2DwNkDWOrhsxet
	XkboTpsUezpcfQ2PWTefFc/NsKoKlILylfrR6OrVlXuoUP+6D4oprOXwGEd2OPl6RQNNy/amVR7Wm
	dgD191MO5x6voPS6SEt6XAD0Bq83vGyRDNjJTpNWJ9m2srOudQzYaizIjgoq8HXAM264=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181774-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181774: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:guest-saverestore.2:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-credit1:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:guest-localmigrate:fail:heisenbug
    linux-linus:test-amd64-amd64-dom0pvh-xl-amd:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-arm64-arm64-xl-credit2:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-freebsd11-amd64:guest-start/freebsd.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-multivcpu:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:guest-saverestore:fail:heisenbug
    linux-linus:test-amd64-amd64-dom0pvh-xl-intel:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-credit2:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-shadow:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-xsm:guest-saverestore.2:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:windows-install:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-vhd:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=3f01e9fed8454dcd89727016c3e5b2fbb8f8e50c
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 13 Jul 2023 01:28:35 +0000

flight 181774 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181774/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 17 guest-saverestore.2 fail in 181765 pass in 181774
 test-amd64-amd64-xl-credit1 20 guest-localmigrate/x10 fail in 181765 pass in 181774
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 16 guest-localmigrate fail in 181765 pass in 181774
 test-amd64-amd64-dom0pvh-xl-amd 22 guest-start/debian.repeat fail in 181765 pass in 181774
 test-arm64-arm64-xl-credit2 18 guest-start/debian.repeat fail in 181765 pass in 181774
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 18 guest-localmigrate/x10 fail in 181765 pass in 181774
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 18 guest-localmigrate/x10 fail in 181765 pass in 181774
 test-amd64-amd64-freebsd11-amd64 21 guest-start/freebsd.repeat fail in 181765 pass in 181774
 test-amd64-amd64-xl-multivcpu 22 guest-start/debian.repeat fail in 181768 pass in 181774
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 15 guest-saverestore fail in 181768 pass in 181774
 test-amd64-amd64-dom0pvh-xl-intel 22 guest-start/debian.repeat fail in 181768 pass in 181774
 test-amd64-amd64-xl-credit2  20 guest-localmigrate/x10     fail pass in 181765
 test-amd64-amd64-xl-shadow   22 guest-start/debian.repeat  fail pass in 181765
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 18 guest-localmigrate/x10 fail pass in 181765
 test-amd64-amd64-xl-xsm      19 guest-saverestore.2        fail pass in 181768
 test-amd64-amd64-xl-qemuu-win7-amd64 12 windows-install    fail pass in 181768
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 18 guest-localmigrate/x10 fail pass in 181768
 test-amd64-amd64-xl-vhd      21 guest-start/debian.repeat  fail pass in 181768

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop  fail in 181768 like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                3f01e9fed8454dcd89727016c3e5b2fbb8f8e50c
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   87 days
Failing since        180281  2023-04-17 06:24:36 Z   86 days  173 attempts
Testing same since   181755  2023-07-10 17:42:07 Z    2 days    5 attempts

------------------------------------------------------------
3736 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 622011 lines long.)


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 03:12:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 03:12:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562911.879674 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJmku-00024j-4P; Thu, 13 Jul 2023 03:12:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562911.879674; Thu, 13 Jul 2023 03:12:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJmku-00024c-0k; Thu, 13 Jul 2023 03:12:36 +0000
Received: by outflank-mailman (input) for mailman id 562911;
 Thu, 13 Jul 2023 03:12:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tMFS=C7=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qJmks-00024W-9k
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 03:12:34 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on2061c.outbound.protection.outlook.com
 [2a01:111:f400:7d00::61c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1adfc520-212b-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 05:12:32 +0200 (CEST)
Received: from DUZPR01CA0156.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4bd::19) by AS2PR08MB9296.eurprd08.prod.outlook.com
 (2603:10a6:20b:598::11) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24; Thu, 13 Jul
 2023 03:12:28 +0000
Received: from DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4bd:cafe::1) by DUZPR01CA0156.outlook.office365.com
 (2603:10a6:10:4bd::19) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24 via Frontend
 Transport; Thu, 13 Jul 2023 03:12:28 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT013.mail.protection.outlook.com (100.127.142.222) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.24 via Frontend Transport; Thu, 13 Jul 2023 03:12:27 +0000
Received: ("Tessian outbound d7adc65d10b4:v145");
 Thu, 13 Jul 2023 03:12:27 +0000
Received: from db0c4e033e20.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 6D15B24A-8667-4919-B0B9-90AB78886CD1.1; 
 Thu, 13 Jul 2023 03:12:20 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id db0c4e033e20.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 13 Jul 2023 03:12:20 +0000
Received: from DB9PR02CA0012.eurprd02.prod.outlook.com (2603:10a6:10:1d9::17)
 by PA4PR08MB7388.eurprd08.prod.outlook.com (2603:10a6:102:2a3::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24; Thu, 13 Jul
 2023 03:12:17 +0000
Received: from DBAEUR03FT052.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:1d9:cafe::27) by DB9PR02CA0012.outlook.office365.com
 (2603:10a6:10:1d9::17) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24 via Frontend
 Transport; Thu, 13 Jul 2023 03:12:17 +0000
Received: from nebula.arm.com (40.67.248.234) by
 DBAEUR03FT052.mail.protection.outlook.com (100.127.142.144) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.22 via Frontend Transport; Thu, 13 Jul 2023 03:12:16 +0000
Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX04.Arm.com
 (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 13 Jul
 2023 03:12:15 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com
 (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 13 Jul
 2023 03:12:15 +0000
Received: from [10.169.188.57] (10.169.188.57) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Thu, 13 Jul 2023 03:12:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1adfc520-212b-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Z2LBhkWC8DU0jJ4oQ/ZRvKCgY3x7Z6by8dwwQ3Z8Ar8=;
 b=5Ezl/6jEXEN596bqwTLYwgMo+BaTaNvk39w6xxFUoAezrfk6nidJvJG0LyO97S792cpi9LSQS0ScWeTQZgAWh84mpenE2P4dmX8OK2hFCcsk8g1DbjBz3CF2KIS+eUa7Qo865lv7wNg2+drHzJ0ek6V/CD+J9wGiBTXG7PW2FLg=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: ad16a113698f3ae8
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BekIXAesnkW/CR+DT0RZ+BteU/jPzv8YTvbCgt9SmLDdpTSAiQByarHyQWnvXVscKrC7LrgH2JgMpzegJHkuIt7r9jLeXUHhfLqwaCEYS5XC1sq6sV3HM6LYPu1IztiqfL507WIj/jYr0+8jb0AXQGm40YYoigOLKDES86heYYag5cNkPIO3W5928pxMnldnXKHOtrLcR9j5SB5CWFBYiNntS6vkZwE/mrvgRCJpUwW1tAEkwLfQA9w8HgTtnAU7nl4qhGSFMX97ud0GtLmiRxUTpTXx5XY6cuHz/WRtoT6pqi73PdF5fqSUO5L1SZuMxuysKcQBBRinCehLcW9+zQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Z2LBhkWC8DU0jJ4oQ/ZRvKCgY3x7Z6by8dwwQ3Z8Ar8=;
 b=lc0fu0LnhSSdSY0g0W+jPPQUsjdJREGxtXIsxVICnIjnNphz0NpGJTOaAl7mEhZNPMkOMl1uyhv2WIcYd8TvWyBsJ2eneVC/w2hxzpF+/7E5p29BWOXp6UhhgyG+3GppX695wNEaaXgTGVTUDAU8sLfkIuniNcmMnstuKCppviHsQil+KkF9yYUXLagg30t6ABoDCsuDjQh1EzcBGEmkZL6SdT4zkrrRm0IVu1bwXstfAa0ma/zZrBol5czrnZVp6HnsJolhPjSoYaUsJP/j/S8TqkvgJiHXoYpaB46zC2BBTI3yJecfzKSZuHqLuwhVLW2pP6RgrfDD1dGhKBbzXA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Z2LBhkWC8DU0jJ4oQ/ZRvKCgY3x7Z6by8dwwQ3Z8Ar8=;
 b=5Ezl/6jEXEN596bqwTLYwgMo+BaTaNvk39w6xxFUoAezrfk6nidJvJG0LyO97S792cpi9LSQS0ScWeTQZgAWh84mpenE2P4dmX8OK2hFCcsk8g1DbjBz3CF2KIS+eUa7Qo865lv7wNg2+drHzJ0ek6V/CD+J9wGiBTXG7PW2FLg=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <23275eba-3c1e-a51c-b248-7f7625671750@arm.com>
Date: Thu, 13 Jul 2023 11:12:11 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 31/52] xen/mpu: make early_fdt_map support in MPU
 systems
Content-Language: en-US
To: Julien Grall <julien@xen.org>, Ayan Kumar Halder <ayankuma@amd.com>,
	<xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, Wei Chen <wei.chen@arm.com>,
	"Volodymyr_Babchuk@epam.com" <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-32-Penny.Zheng@arm.com>
 <c2a779e5-51a9-f0c8-4c00-a568ff4bde83@amd.com>
 <a381b1b0-d18a-8fea-56a4-d88c65bd3cea@arm.com>
 <9530f9f8-795b-783a-bc74-e30a3c5c2fd3@amd.com>
 <baed1eac-0f9a-a85a-d4cc-feef772870db@xen.org>
 <c070054d-3f92-ecd2-4f04-a97c5a84d3d7@amd.com>
 <c05ac82d-f9bb-5d52-8b7d-df44d9043a66@xen.org>
 <bd6d9646-f0a8-5341-b4ce-7eca1d6153dc@arm.com>
 <93e0e360-d7f2-1987-a0a6-73420c55afcd@xen.org>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <93e0e360-d7f2-1987-a0a6-73420c55afcd@xen.org>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	DBAEUR03FT052:EE_|PA4PR08MB7388:EE_|DBAEUR03FT013:EE_|AS2PR08MB9296:EE_
X-MS-Office365-Filtering-Correlation-Id: 266b0abf-7a20-48d0-f0fa-08db834efccf
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 tauawAB44GxuGLAVhROMmhtiPsKDxu2VMI3BuIXHnP45ts+X9mEWUIcuhdP17wV/5bNr/JIEopwkxc3W4w/WTP+Lajd8PJalSiBcGQHfPIIsDPPIj2N4FUFVMawohH5S6wg/0GUmlMtJy21R66ZsiSsPVWw3dvhhqiudhohHf6EQXID5YuEIPj5TRR7CELL4Tq4Wxd7HQiWx3wdS8A5dBwpywmw7jlGdBp/pYN4hdNFk8qI7YCQ1KngHLLy71xl2GC4TeLnNCDahhwTuxIxCVYmS+nYzOFvZ3PzWCquVyH8t2fnuoSavhPzJN+vD9bsCXEZ/SmiNDeOoKFLhNUdMQNhxr6aak19qN6/hBx9xidqO+dYtmSiqCVVe/nBH1Q3CpSPtpY9cyRFScw1k4lrBCIheUTG/HZoi4ZKnBlKiDUrCbew72LF5cqpGpI7ijD3OtIhNPK1xjXk4L+HlxB5YCos0pCZl97kwa7TYmSgtoloQ2x5QmzJ33Ezyz6emGKUWjrwoymz4pN292MP46R/17cosmSpmgtDietH9XHu4jNAK9SsniUl4TPVWbD7dGwU96Jqde7zRwG5/NBeb7QdJU0fTDteviXs/iOLzsI5r/cJQBq2EVNGiNLkeaxz0CW4pbikJEzqpzzZiRnrksF+viNkiTp7xfk2NORCSxeSXPZ+76PkzUmqc6gczeKOiyDaKtGG37gKEbtnd0GRPmBMPe8f01IO0tMMMycE044+AMxG4uqCLlRQ+bmZ/+U8vxu1MQyU4+6/uBXDnTNb2Qd9xB0K/EfifoOpOOfqbGIQTY3O4RjRxbmlgWfLhvllHk+lZynCw9Rnvv4HdNeUXtu5CXvxL9moXYMgHzCdyTPc++L8=
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(39860400002)(396003)(376002)(451199021)(46966006)(36840700001)(40470700004)(40480700001)(36860700001)(36756003)(31696002)(86362001)(356005)(81166007)(82740400003)(82310400005)(40460700003)(478600001)(110136005)(16576012)(54906003)(8676002)(8936002)(44832011)(5660300002)(316002)(70206006)(70586007)(2906002)(4326008)(41300700001)(31686004)(2616005)(83380400001)(47076005)(336012)(426003)(53546011)(26005)(186003)(21314003)(3940600001)(36900700001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7388
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	ca91b9fc-3e67-474b-db15-08db834ef62d
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Cx1rJkn2cQQrWjtdSinhpdN7ni1hzw+PXzslphOqzhjOzKjUIsINy5H2uhLTwu/t4DBU7hLiWk6x6CJ47EPy8Aox+G86Y4Zi90SFAYELW1f/Qsti3GJ+1WHVtHm734CUGRrLIQun3adQDBVhmL5EKCv5tcTNQJjUNuqhZXTYoxH1P9cXblXSKwOF0TmcJCwEm2JGLzXSVbycvXJoqlCBjAddloXc6pX2A9a6dWVrXQqU9e1xCTSPPhoS3GydkCLRI/KgRSF4rZwg4+EvpGvYC55+UxzUqvulrmnVA+03pjQNsApipchpWpFNKyQWkILcbK2y9mggYgoH/Pto8+P/AckQti0jiWOyYOUHu1gCjyjVnsEspmr8PNThFP4njAtb2SwxikxeMYvL3WM1Cx0b7nr39P570025fSGsjDosGamsucc6LqKGMRcnoN/KjUJqI4Bm0ox3q8NnpvxFTF4k9Gjmia1FoYySkQ7gVSsAmT9tXghbGTnKql6lnfN/EF0ZLA6vkd0hIY5CJZMA/bBgzkI/SC7+e1zLugVvPtiJRM0jGbF5a1M4en6vLb6Nsqdxr49oiGGcJpf7iCa5TSHUpEfvXpvRGyI1ap0QnnOIS7BjDCr/6fmpNKZ9dp93WB8N0J5mh8lwP2hn6rzvzxDMAigWpfOcCqpt+UYUzJGrLSwvmLigRcoNglbwKpjYHHjv8/Ufny+8rao2dA+ETTF9+VrNm7dHRAhbMDCVwiga6zXGf/m26IlJS+BEibuXMyQBwBlyPbUEaaD/HyNVWd3DpmGO9KbAD34VJI0YPvvSwcPr1GYRCL5lZ2R0zo9O4ktAkSX77KbZwqRZLQ+LmAGOEA==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(136003)(376002)(346002)(451199021)(36840700001)(46966006)(40470700004)(44832011)(4326008)(70586007)(70206006)(41300700001)(316002)(2906002)(478600001)(16576012)(5660300002)(8936002)(8676002)(31686004)(110136005)(54906003)(36860700001)(40460700003)(26005)(40480700001)(107886003)(186003)(53546011)(36756003)(426003)(336012)(83380400001)(47076005)(81166007)(82740400003)(2616005)(82310400005)(86362001)(31696002)(21314003)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 03:12:27.5230
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 266b0abf-7a20-48d0-f0fa-08db834efccf
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9296

Hi Julien

On 2023/7/3 17:20, Julien Grall wrote:
> Hi,
> 
> On 03/07/2023 06:12, Penny Zheng wrote:
>> Hi,
>>
>>
>> On 2023/6/30 23:02, Julien Grall wrote:
>>> Hi,
>>>
>>> On 30/06/2023 15:42, Ayan Kumar Halder wrote:
>>>> Hi Julien,
>>>>
>>>> On 30/06/2023 12:22, Julien Grall wrote:
>>>>>
>>>>>
>>>>> On 30/06/2023 11:49, Ayan Kumar Halder wrote:
>>>>>>
>>>>>> On 30/06/2023 05:07, Penny Zheng wrote:
>>>>>>> Hi,
>>>>>> Hi Penny,
>>>>>>>
>>>>>>>
>>>>>>> On 2023/6/30 01:22, Ayan Kumar Halder wrote:
>>>>>>>>
>>>>>>>> On 26/06/2023 04:34, Penny Zheng wrote:
>>>>>>>>> CAUTION: This message has originated from an External Source. 
>>>>>>>>> Please use proper judgment and caution when opening 
>>>>>>>>> attachments, clicking links, or responding to this email.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> In MPU system, MPU memory region is always mapped PAGE_ALIGN, 
>>>>>>>>> so in order to
>>>>>>>>> not access unexpected memory area, dtb section in xen.lds.S 
>>>>>>>>> should be made
>>>>>>>>> page-aligned too.
>>>>>>>>> We add . = ALIGN(PAGE_SIZE); in the head of dtb section to make 
>>>>>>>>> it happen.
>>>>>>>>>
>>>>>>>>> In this commit, we map early FDT with a transient MPU memory 
>>>>>>>>> region, as
>>>>>>>>> it will be relocated into heap and unmapped at the end of boot.
>>>>>>>>>
>>>>>>>>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>>>>>>>>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>>>>>>>>> ---
>>>>>>>>> v3:
>>>>>>>>> - map the first 2MB. Check the size and then re-map with an 
>>>>>>>>> extra 2MB if needed
>>>>>>>>> ---
>>>>>>>>> Â  xen/arch/arm/include/asm/arm64/mpu.h |Â  3 ++-
>>>>>>>>> Â  xen/arch/arm/include/asm/page.hÂ Â Â Â Â  |Â  5 +++++
>>>>>>>>> Â  xen/arch/arm/mm.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  | 26 
>>>>>>>>> ++++++++++++++++++++------
>>>>>>>>> Â  xen/arch/arm/mpu/mm.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  1 +
>>>>>>>>> Â  xen/arch/arm/xen.lds.SÂ Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  5 ++++-
>>>>>>>>> Â  5 files changed, 32 insertions(+), 8 deletions(-)
>>>>>>>>>
>>>>>>>>> diff --git a/xen/arch/arm/include/asm/arm64/mpu.h 
>>>>>>>>> b/xen/arch/arm/include/asm/arm64/mpu.h
>>>>>>>>> index a6b07bab02..715ea69884 100644
>>>>>>>>> --- a/xen/arch/arm/include/asm/arm64/mpu.h
>>>>>>>>> +++ b/xen/arch/arm/include/asm/arm64/mpu.h
>>>>>>>>> @@ -72,7 +72,8 @@ typedef union {
>>>>>>>>> Â Â Â Â Â Â Â Â Â  unsigned long ns:1;Â Â Â Â  /* Not-Secure */
>>>>>>>>> Â Â Â Â Â Â Â Â Â  unsigned long res:1;Â Â Â  /* Reserved 0 by hardware */
>>>>>>>>> Â Â Â Â Â Â Â Â Â  unsigned long limit:42; /* Limit Address */
>>>>>>>>> -Â Â Â Â Â Â Â  unsigned long pad:16;
>>>>>>>>> +Â Â Â Â Â Â Â  unsigned long pad:15;
>>>>>>>>> +Â Â Â Â Â Â Â  unsigned long tran:1;Â Â  /* Transient region */
>>>>>>>>> Â Â Â Â Â  } reg;
>>>>>>>>> Â Â Â Â Â  uint64_t bits;
>>>>>>>>> Â  } prlar_t;
>>>>>>>>> diff --git a/xen/arch/arm/include/asm/page.h 
>>>>>>>>> b/xen/arch/arm/include/asm/page.h
>>>>>>>>> index 85ecd5e4de..a434e2205a 100644
>>>>>>>>> --- a/xen/arch/arm/include/asm/page.h
>>>>>>>>> +++ b/xen/arch/arm/include/asm/page.h
>>>>>>>>> @@ -97,19 +97,24 @@
>>>>>>>>> Â Â  * [3:4] Execute Never
>>>>>>>>> Â Â  * [5:6] Access Permission
>>>>>>>>> Â Â  * [7]Â Â  Region Present
>>>>>>>>> + * [8]Â Â  Transient Region, e.g. MPU memory region is temproraily
>>>>>>>>> + *Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  mapped for a short time
>>>>>>>>> Â Â  */
>>>>>>>>> Â  #define _PAGE_AI_BITÂ Â Â Â Â Â Â Â Â Â Â  0
>>>>>>>>> Â  #define _PAGE_XN_BITÂ Â Â Â Â Â Â Â Â Â Â  3
>>>>>>>>> Â  #define _PAGE_AP_BITÂ Â Â Â Â Â Â Â Â Â Â  5
>>>>>>>>> Â  #define _PAGE_PRESENT_BITÂ Â Â Â Â Â  7
>>>>>>>>> +#define _PAGE_TRANSIENT_BITÂ Â Â Â  8
>>>>>>>> I don't think this is related to MPU. At least when I look at 
>>>>>>>> the bit representation of PRBAR_EL1/2,
>>>>>>>
>>>>>>> This set of _PAGE_xxx flags aren't compliant with PRBAR_EL1/2 
>>>>>>> register map.
>>>>>>> It is a flag passed to function map_pages_to_xen() to indicate 
>>>>>>> memory
>>>>>>> attributes and permission.
>>>>>>
>>>>>> But aren't you writing these flags to PRBAR_EL1/EL2 when you call 
>>>>>> xen_mpumap_update_entry().
>>>>>>
>>>>>> In the below snippet of xen_mpumap_update_entry(), IIUC, you are 
>>>>>> writing these flags.
>>>>>>
>>>>>> Â Â Â Â Â Â Â Â  xen_mpumap[idx].prbar.reg.ap = PAGE_AP_MASK(flags);
>>>>>> Â Â Â Â Â Â Â Â  xen_mpumap[idx].prbar.reg.xn = PAGE_XN_MASK(flags);
>>>>>>
>>>>>> Â Â Â Â Â Â Â Â  write_protection_region((const pr_t*)(&xen_mpumap[idx]), 
>>>>>> idx);
>>>>>>
>>>>>> Please clarify here.
>>>>>>
>>>>>> In this case, I don't prefer mixing hardware specific bits with 
>>>>>> software only representation for these reasons :-
>>>>>>
>>>>>> 1. It makes it confusing and hard to differentiate the hardware 
>>>>>> specific attrbutes from software only.
>>>>>
>>>>> Penny's approach matches what we are doing in the MMU code. We want 
>>>>> to have a way for the caller to pass just set of flags and let the 
>>>>> callee to decide what to do with them.
>>>>>
>>>>> This may be flags converted for HW fields or just used by the logic.
>>>>>
>>>>> If you disagree with this approach, then can you propose a 
>>>>> different way that we can discuss?
>>
>> Thanks ayan for pointing out that RES0 is not suitable for storing 
>> software-only flags, agreed.
>>
>> Then, maybe we should refine the existing "struct pr_t" to store these
>> sw bits, like:
>> ```
>> typedef union {
>> Â Â Â Â  struct {
>> Â Â Â Â Â Â Â  uint8_t tran:1; /* Transient region */
>> Â Â Â Â Â Â Â  uint8_t p2m_type:4; /* Used to store p2m types.*/
> 
> Why do you need the p2m_type?
> 

I inherited the usage from MMU. Right now, in commit "[PATCH v3 46/52] 
xen/mpu: look up entry in p2m table", we introduce the first usage to
tell whether it is a valid P2M MPU memory region. In the future,
we may also use it to check whether it works as RAM region(p2m_ram_rw).

>> Â Â Â Â  };
>> Â Â Â Â  uint8_t bits;
>> } pr_flags;
>>
>> /* MPU Protection Region */
>> typedef struct {
>> Â Â Â Â Â Â Â Â  prbar_t prbar;
>> Â Â Â Â Â Â Â Â  prlar_t prlar;
>> Â Â Â Â Â pr_flags flags;
>> } pr_t;
>> ```
>> The drawback is that, considering the padding, "struct pr_t" expands 
>> from 16 bytes to 24 bytes.
> 
> For clarifications, pr_t is going to be used to create an array in Xen, 
> right? If so, what's the expected size of the array?
> 

Yes, it is going to be an array. And the maximum length is 255.
MPUIR_EL2 identifies the number of regions supported by the EL2 MPU,
which is 8-bits wide.
The original 16 bytes, even with 255 regions at most, will take up
less than 4KB. One page is enough. The following definition could have 
covered all scenarios.
```
/* EL2 Xen MPU memory region mapping table. */
pr_t __aligned(PAGE_SIZE) __section(".data.page_aligned")
      xen_mpumap[ARM_MAX_MPU_MEMORY_REGIONS];
```

Now, FWIT, with 24 bytes, the static xen_mpumap definition only works 
before the heap allocator are up.
When heap is up, we may need to re-allocate xen_mpumap from heap. When
MPUIR_EL2.Region is more than 170, an extra page is needed.

> Cheers,
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 04:08:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 04:08:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562739.879684 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJncx-0007cv-1n; Thu, 13 Jul 2023 04:08:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562739.879684; Thu, 13 Jul 2023 04:08:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJncw-0007co-VE; Thu, 13 Jul 2023 04:08:26 +0000
Received: by outflank-mailman (input) for mailman id 562739;
 Wed, 12 Jul 2023 19:24:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=cQPv=C6=kernel.org=krzk@srs-se1.protection.inumbo.net>)
 id 1qJfRW-0007I3-F5
 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 19:24:06 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a8eb20ca-20e9-11ee-b239-6b7b168915f2;
 Wed, 12 Jul 2023 21:24:04 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 11D21618FA;
 Wed, 12 Jul 2023 19:24:02 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2E67C433C7;
 Wed, 12 Jul 2023 19:22:49 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a8eb20ca-20e9-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689189841;
	bh=Tfejh8EXB17kdCnKChHCKsENFyCAyHmgokGK8jgx0S4=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=ntLZbbIa8ui4VLewT/ZWNtkWgRs7MbRiBOhFPmK6XwjRbTD/3kPBu1aqhFZ0rkrTw
	 NoTZi0Izio/rxjoLWBubaj+3vL5lvYukHPTwqzZkAMQJcVh8+LeSyVQRiF6uaWPcM/
	 zuqSfu4Q9tdtMALob+iDjB+wXeO+wx4IclmprAMk1ovBvhz2Kb6mUBbsrON4ASXRiy
	 LcrKecm8vPG1UI+nVF2Hnnsm4BKqA7ElLyIZzw3R6g6ih439+oVUcyzCdQwNklbbMO
	 NQNR0TgJUV9FeYvO7UXNbntxcy7XKI2L5F9S7YJV8onDbx66b25wYy9gLnXBEh/586
	 QVl33fuhfdZNQ==
Message-ID: <2eeb1271-731a-1a70-4c83-449567452f8f@kernel.org>
Date: Wed, 12 Jul 2023 21:22:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [Freedreno] [PATCH RFC v1 00/52] drm/crtc: Rename struct
 drm_crtc::dev to drm_dev
Content-Language: en-US
To: Sean Paul <seanpaul@chromium.org>, Jani Nikula <jani.nikula@intel.com>
Cc: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= <u.kleine-koenig@pengutronix.de>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
 Alex Deucher <alexander.deucher@amd.com>,
 =?UTF-8?Q?Christian_K=c3=b6nig?= <christian.koenig@amd.com>,
 "Pan, Xinhui" <Xinhui.Pan@amd.com>, Harry Wentland <harry.wentland@amd.com>,
 Leo Li <sunpeng.li@amd.com>, Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
 Hamza Mahfooz <hamza.mahfooz@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Guchun Chen <guchun.chen@amd.com>,
 Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
 Evan Quan <evan.quan@amd.com>, Likun Gao <Likun.Gao@amd.com>,
 =?UTF-8?B?TWFyZWsgT2zFocOhaw==?= <marek.olsak@amd.com>,
 David Francis <David.Francis@amd.com>, Hawking Zhang
 <Hawking.Zhang@amd.com>, Graham Sider <Graham.Sider@amd.com>,
 Lang Yu <Lang.Yu@amd.com>, Philip Yang <Philip.Yang@amd.com>,
 Yifan Zhang <yifan1.zhang@amd.com>, Tim Huang <Tim.Huang@amd.com>,
 Zack Rusin <zackr@vmware.com>, Sam Ravnborg <sam@ravnborg.org>,
 xurui <xurui@kylinos.cn>,
 Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
 =?UTF-8?Q?Ma=c3=adra_Canal?= <mairacanal@riseup.net>,
 =?UTF-8?Q?Andr=c3=a9_Almeida?= <andrealmeid@igalia.com>,
 Qingqing Zhuo <qingqing.zhuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>, Hersen Wu
 <hersenxs.wu@amd.com>, Fangzhi Zuo <jerry.zuo@amd.com>,
 Stylon Wang <stylon.wang@amd.com>, Alan Liu <haoping.liu@amd.com>,
 Wayne Lin <Wayne.Lin@amd.com>, Aaron Liu <aaron.liu@amd.com>,
 Melissa Wen <mwen@igalia.com>, Bhawanpreet Lakha
 <Bhawanpreet.Lakha@amd.com>, David Tadokoro <davidbtadokoro@usp.br>,
 Wenjing Liu <wenjing.liu@amd.com>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 Mario Limonciello <mario.limonciello@amd.com>,
 Alexey Kodanev <aleksei.kodanev@bell-sw.com>, Roman Li <roman.li@amd.com>,
 =?UTF-8?Q?Joaqu=c3=adn_Ignacio_Aramend=c3=ada?= <samsagax@gmail.com>,
 Dave Airlie <airlied@redhat.com>, Russell King <linux@armlinux.org.uk>,
 Liviu Dudau <liviu.dudau@arm.com>, Joel Stanley <joel@jms.id.au>,
 Boris Brezillon <bbrezillon@kernel.org>,
 Nicolas Ferre <nicolas.ferre@microchip.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 Claudiu Beznea <claudiu.beznea@microchip.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>, Stefan Agner <stefan@agner.ch>,
 Alison Wang <alison.wang@nxp.com>,
 Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
 =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= <noralf@tronnes.org>,
 Xinliang Liu <xinliang.liu@linaro.org>, Tian Tao <tiantao6@hisilicon.com>,
 Danilo Krummrich <dakr@redhat.com>, Deepak Rawat <drawat.floss@gmail.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
 =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= <ville.syrjala@linux.intel.com>,
 Lucas De Marchi <lucas.demarchi@intel.com>,
 Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
 Andrzej Hajda <andrzej.hajda@intel.com>,
 Matt Roper <matthew.d.roper@intel.com>,
 Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
 Hans de Goede <hdegoede@redhat.com>, Luca Coelho <luciano.coelho@intel.com>,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 Kai Vehmanen <kai.vehmanen@linux.intel.com>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 =?UTF-8?Q?=c5=81ukasz_Bartosik?= <lb@semihalf.com>,
 Anusha Srivatsa <anusha.srivatsa@intel.com>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
 Uma Shankar <uma.shankar@intel.com>, Imre Deak <imre.deak@intel.com>,
 Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
 Swati Sharma <swati2.sharma@intel.com>,
 =?UTF-8?Q?Jouni_H=c3=b6gander?= <jouni.hogander@intel.com>,
 Mika Kahola <mika.kahola@intel.com>,
 =?UTF-8?Q?Jos=c3=a9_Roberto_de_Souza?= <jose.souza@intel.com>,
 Arun R Murthy <arun.r.murthy@intel.com>,
 Gustavo Sousa <gustavo.sousa@intel.com>,
 Khaled Almahallawy <khaled.almahallawy@intel.com>,
 Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
 Andi Shyti <andi.shyti@linux.intel.com>, Nirmoy Das <nirmoy.das@intel.com>,
 Fei Yang <fei.yang@intel.com>, Animesh Manna <animesh.manna@intel.com>,
 Deepak R Varma <drv@mailo.com>, "Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
 Vandita Kulkarni <vandita.kulkarni@intel.com>,
 Suraj Kandpal <suraj.kandpal@intel.com>,
 Manasi Navare <manasi.d.navare@intel.com>,
 Drew Davenport <ddavenport@chromium.org>,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>,
 Philipp Zabel <p.zabel@pengutronix.de>, Marian Cichy
 <m.cichy@pengutronix.de>, Dan Carpenter <error27@gmail.com>,
 Paul Cercueil <paul@crapouillou.net>,
 Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
 Edmund Dea <edmund.j.dea@intel.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Linus Walleij <linus.walleij@linaro.org>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>, Rob Clark <robdclark@gmail.com>,
 Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Vinod Polimera <quic_vpolimer@quicinc.com>,
 Jiasheng Jiang <jiasheng@iscas.ac.cn>,
 Konrad Dybcio <konrad.dybcio@linaro.org>,
 Jessica Zhang <quic_jesszhan@quicinc.com>, Liu Shixin
 <liushixin2@huawei.com>, Marek Vasut <marex@denx.de>,
 Ben Skeggs <bskeggs@redhat.com>, Karol Herbst <kherbst@redhat.com>,
 Lyude Paul <lyude@redhat.com>, Tomi Valkeinen <tomba@kernel.org>,
 Emma Anholt <emma@anholt.net>, Gerd Hoffmann <kraxel@redhat.com>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>,
 Geert Uytterhoeven <geert+renesas@glider.be>,
 Biju Das <biju.das.jz@bp.renesas.com>, Sandy Huang <hjc@rock-chips.com>,
 =?UTF-8?Q?Heiko_St=c3=bcbner?= <heiko@sntech.de>,
 Orson Zhai <orsonzhai@gmail.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>,
 Alain Volmat <alain.volmat@foss.st.com>,
 Yannick Fertre <yannick.fertre@foss.st.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Philippe Cornu <philippe.cornu@foss.st.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>, Chen-Yu Tsai
 <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>,
 Samuel Holland <samuel@sholland.org>,
 Thierry Reding <thierry.reding@gmail.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Jyri Sarha <jyri.sarha@iki.fi>,
 David Lechner <david@lechnology.com>,
 Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
 Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
 Melissa Wen <melissa.srw@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Michal Simek <michal.simek@amd.com>,
 Haneen Mohammed <hamohammed.sa@gmail.com>, linux-hyperv@vger.kernel.org,
 linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org,
 dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org,
 Yongqin Liu <yongqin.liu@linaro.org>, Alim Akhtar <alim.akhtar@samsung.com>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 Fabio Estevam <festevam@gmail.com>, Sumit Semwal <sumit.semwal@linaro.org>,
 Jerome Brunet <jbrunet@baylibre.com>, linux-samsung-soc@vger.kernel.org,
 amd-gfx@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com,
 linux-rockchip@lists.infradead.org,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
 NXP Linux Team <linux-imx@nxp.com>, spice-devel@lists.freedesktop.org,
 linux-sunxi@lists.linux.dev,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-mediatek@lists.infradead.org, xen-devel@lists.xenproject.org,
 linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org,
 Gurchetan Singh <gurchetansingh@chromium.org>, Sean Paul <sean@poorly.run>,
 linux-arm-kernel@lists.infradead.org,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 Andrew Jeffery <andrew@aj.id.au>, linux-mips@vger.kernel.org,
 Chia-I Wu <olvaffe@gmail.com>, linux-renesas-soc@vger.kernel.org,
 kernel@pengutronix.de, John Stultz <jstultz@google.com>,
 freedreno@lists.freedesktop.org, Lucas Stach <l.stach@pengutronix.de>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com>
 <CAOw6vbLO_UaXDbTCtAQJgthXOUMPqEV+c2MQhP-1DuK44OhGxw@mail.gmail.com>
From: Krzysztof Kozlowski <krzk@kernel.org>
In-Reply-To: <CAOw6vbLO_UaXDbTCtAQJgthXOUMPqEV+c2MQhP-1DuK44OhGxw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 12/07/2023 20:31, Sean Paul wrote:
>>>     216 struct drm_device *ddev
>>>     234 struct drm_device *drm_dev
>>>     611 struct drm_device *drm
>>>    4190 struct drm_device *dev
>>>
>>> This series starts with renaming struct drm_crtc::dev to drm_dev. If
>>> it's not only me and others like the result of this effort it should be
>>> followed up by adapting the other structs and the individual usages in
>>> the different drivers.
>>
>> I think this is an unnecessary change. In drm, a dev is usually a drm
>> device, i.e. struct drm_device *. As shown by the numbers above.
>>
> 
> I'd really prefer this patch (series or single) is not accepted. This
> will cause problems for everyone cherry-picking patches to a
> downstream kernel (LTS or distro tree). I usually wouldn't expect
> sympathy here, but the questionable benefit does not outweigh the cost
> IM[biased]O.

You know, every code cleanup and style adjustment is interfering with
backporting. The only argument for a fast-pacing kernel should be
whether the developers of this code find it more readable with such cleanup.

Best regards,
Krzysztof



From xen-devel-bounces@lists.xenproject.org Thu Jul 13 04:08:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 04:08:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562897.879689 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJncx-0007fd-B2; Thu, 13 Jul 2023 04:08:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562897.879689; Thu, 13 Jul 2023 04:08:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJncx-0007f5-61; Thu, 13 Jul 2023 04:08:27 +0000
Received: by outflank-mailman (input) for mailman id 562897;
 Thu, 13 Jul 2023 00:07:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8DW2=C7=amd.com=Luben.Tuikov@srs-se1.protection.inumbo.net>)
 id 1qJjrj-0001O8-3H
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 00:07:27 +0000
Received: from NAM10-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam10on20624.outbound.protection.outlook.com
 [2a01:111:f400:7e88::624])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3defcdda-2111-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 02:07:24 +0200 (CEST)
Received: from DM6PR12MB3370.namprd12.prod.outlook.com (2603:10b6:5:38::25) by
 DS0PR12MB7747.namprd12.prod.outlook.com (2603:10b6:8:138::20) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.22; Thu, 13 Jul 2023 00:07:17 +0000
Received: from DM6PR12MB3370.namprd12.prod.outlook.com
 ([fe80::e3dd:99bb:b742:2d48]) by DM6PR12MB3370.namprd12.prod.outlook.com
 ([fe80::e3dd:99bb:b742:2d48%2]) with mapi id 15.20.6565.034; Thu, 13 Jul 2023
 00:07:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3defcdda-2111-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LUTw+GaxXAo8m7B/4EiLWvPeyR6kNfHX+LqHUG+iO+b00q24d3uLSQMQioutIwk2jepTG8XvzFTTmRLL1uTZI1rQ0e+0yRR0kv5GOjnCCRYIKmZWZZ8n8b/k8Us6vAFFYKj64c9mRrMWikXudEHNc+aa2ZX0a3ODnhiCELeYPVDWNTjEzF/Cvp7kaTwKItgRhubTU0fz5U/I2kVk2fvXG2ePDZwzYAySeSgYHyYbDMrXXEzWoqrdwPxeWGHvH1lissVVPoKhXvO9VlI1sep6pJVNX1rKp+7EMW6qj6YApGp7lEuuvhaiKri9/QeSvUwFuNrH0jAmmXOtV869MH1jzw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7Z5H35+F0RctIC+ljl2z7BhYqWE5Rp24IPpYbkFwomc=;
 b=gbH852GnHE3csMzrWtRgQF9QPxLtJi8uDaojIjmx3r8W+0Ey1KWQD98QYjMfSb0mRCwHx5789Ox4uKJM6jaI74doWzmMnd/PFmDJ6vPMGTfiZGvUWjrTvE+GAdnB3Q9j8fREsEF/Wu3voozV3JHoDPDszMPAOQ/n9SlyWVLIf1DvOLVEj6Sj7k4iup0QT7f+nUeO6hO/9pUd+gsX1GDM6h64JI0YtXCYwvrwo0YLZpHYmEGIfImYDzQ75CwM4cu7BoYJdNXNT5Qi3nPWxL3CEXgzQ3msklUfFc+m3ZJoz4htvvW6ACUGUxlsX5GcmguYbFdhXqybrcK5rz5+GF7HLA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7Z5H35+F0RctIC+ljl2z7BhYqWE5Rp24IPpYbkFwomc=;
 b=nI0CjZDiXaSvo8Be/EgRitxDIdf1OSksh20gaEk9fZlmEtivU+COKbmPteZ8GuziqBaODlRwxWSspRnPNmTGj4isIkdWdEtwaLG4vfTlsUNJh5OlhOqI66vNu0Lk1ZNr2Mj8t+AOgOmzSS8X2yaqxuMTPKHYhhnDzWijroTOBts=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <83bba180-faac-e2a9-e7d3-c5fdf5df2303@amd.com>
Date: Wed, 12 Jul 2023 20:06:58 -0400
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
Content-Language: en-CA, en-US
To: =?UTF-8?Q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>,
 =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>,
 Maxime Ripard <mripard@kernel.org>
Cc: =?UTF-8?Q?Heiko_St=C3=BCbner?= <heiko@sntech.de>,
 Geert Uytterhoeven <geert+renesas@glider.be>,
 Xinliang Liu <xinliang.liu@linaro.org>,
 Linus Walleij <linus.walleij@linaro.org>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
 dri-devel@lists.freedesktop.org,
 Vandita Kulkarni <vandita.kulkarni@intel.com>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 Jonathan Hunter <jonathanh@nvidia.com>,
 Arun R Murthy <arun.r.murthy@intel.com>, Jerome Brunet
 <jbrunet@baylibre.com>, linux-samsung-soc@vger.kernel.org,
 Samuel Holland <samuel@sholland.org>, Matt Roper
 <matthew.d.roper@intel.com>, Wenjing Liu <wenjing.liu@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
 Danilo Krummrich <dakr@redhat.com>, NXP Linux Team <linux-imx@nxp.com>,
 spice-devel@lists.freedesktop.org,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, linux-sunxi@lists.linux.dev,
 Matthias Brugger <matthias.bgg@gmail.com>, Stylon Wang
 <stylon.wang@amd.com>, Tim Huang <Tim.Huang@amd.com>,
 Suraj Kandpal <suraj.kandpal@intel.com>,
 =?UTF-8?Q?Andr=C3=A9_Almeida?= <andrealmeid@igalia.com>,
 Mika Kahola <mika.kahola@intel.com>,
 Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
 Jani Nikula <jani.nikula@intel.com>, Sascha Hauer <s.hauer@pengutronix.de>,
 Lucas De Marchi <lucas.demarchi@intel.com>, Inki Dae <inki.dae@samsung.com>,
 Hersen Wu <hersenxs.wu@amd.com>, Dave Airlie <airlied@redhat.com>,
 Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
 Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
 =?UTF-8?Q?=C5=81ukasz_Bartosik?= <lb@semihalf.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
 Andrew Jeffery <andrew@aj.id.au>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 =?UTF-8?Q?Noralf_Tr=C3=B8nnes?= <noralf@tronnes.org>, kernel@pengutronix.de,
 Alex Deucher <alexander.deucher@amd.com>, freedreno@lists.freedesktop.org,
 Claudiu Beznea <claudiu.beznea@microchip.com>, Zack Rusin
 <zackr@vmware.com>, Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org,
 Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
 =?UTF-8?Q?Jos=C3=A9_Roberto_de_Souza?= <jose.souza@intel.com>,
 virtualization@lists.linux-foundation.org,
 Thierry Reding <thierry.reding@gmail.com>,
 Yongqin Liu <yongqin.liu@linaro.org>,
 Mario Limonciello <mario.limonciello@amd.com>, Fei Yang
 <fei.yang@intel.com>, =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?=
 <ville.syrjala@linux.intel.com>, Konrad Dybcio <konrad.dybcio@linaro.org>,
 Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
 Chunyan Zhang <zhang.lyra@gmail.com>, David Francis <David.Francis@amd.com>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 Aaron Liu <aaron.liu@amd.com>,
 Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
 Vinod Polimera <quic_vpolimer@quicinc.com>,
 linux-rockchip@lists.infradead.org, Fangzhi Zuo <jerry.zuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>,
 VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
 Ben Skeggs <bskeggs@redhat.com>, =?UTF-8?Q?Jouni_H=C3=B6gander?=
 <jouni.hogander@intel.com>, Jessica Zhang <quic_jesszhan@quicinc.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-arm-msm@vger.kernel.org, Animesh Manna <animesh.manna@intel.com>,
 Nicolas Ferre <nicolas.ferre@microchip.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
 Tian Tao <tiantao6@hisilicon.com>, Biju Das <biju.das.jz@bp.renesas.com>,
 linux-amlogic@lists.infradead.org, Evan Quan <evan.quan@amd.com>,
 Michal Simek <michal.simek@amd.com>, linux-arm-kernel@lists.infradead.org,
 Sean Paul <sean@poorly.run>, Neil Armstrong <neil.armstrong@linaro.org>,
 Kai Vehmanen <kai.vehmanen@linux.intel.com>,
 Boris Brezillon <bbrezillon@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
 Qingqing Zhuo <qingqing.zhuo@amd.com>, Sandy Huang <hjc@rock-chips.com>,
 Swati Sharma <swati2.sharma@intel.com>, linux-renesas-soc@vger.kernel.org,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Kevin Hilman <khilman@baylibre.com>, Hawking Zhang <Hawking.Zhang@amd.com>,
 Haneen Mohammed <hamohammed.sa@gmail.com>,
 Paul Cercueil <paul@crapouillou.net>,
 Anusha Srivatsa <anusha.srivatsa@intel.com>,
 Dan Carpenter <error27@gmail.com>, Karol Herbst <kherbst@redhat.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 linux-hyperv@vger.kernel.org, Stefan Agner <stefan@agner.ch>,
 Melissa Wen <melissa.srw@gmail.com>, =?UTF-8?Q?Ma=C3=ADra_Canal?=
 <mairacanal@riseup.net>, Luca Coelho <luciano.coelho@intel.com>,
 Gerd Hoffmann <kraxel@redhat.com>, Andrzej Hajda <andrzej.hajda@intel.com>,
 Likun Gao <Likun.Gao@amd.com>, "Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
 Emma Anholt <emma@anholt.net>, Alain Volmat <alain.volmat@foss.st.com>,
 Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>,
 Deepak Rawat <drawat.floss@gmail.com>,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>, Joel Stanley <joel@jms.id.au>,
 Orson Zhai <orsonzhai@gmail.com>, Ankit Nautiyal
 <ankit.k.nautiyal@intel.com>, Harry Wentland <harry.wentland@amd.com>,
 Chia-I Wu <olvaffe@gmail.com>, Alan Liu <haoping.liu@amd.com>,
 Philip Yang <Philip.Yang@amd.com>, intel-gfx@lists.freedesktop.org,
 Alison Wang <alison.wang@nxp.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>,
 Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Gustavo Sousa <gustavo.sousa@intel.com>,
 Baolin Wang <baolin.wang@linux.alibaba.com>,
 Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
 Daniel Vetter <daniel@ffwll.ch>, Mikko Perttunen <mperttunen@nvidia.com>,
 Yifan Zhang <yifan1.zhang@amd.com>,
 Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
 Tomi Valkeinen <tomba@kernel.org>, Deepak R Varma <drv@mailo.com>,
 "Pan, Xinhui" <Xinhui.Pan@amd.com>, Julia Lawall <Julia.Lawall@inria.fr>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 John Stultz <jstultz@google.com>, Roman Li <roman.li@amd.com>,
 Sumit Semwal <sumit.semwal@linaro.org>,
 Khaled Almahallawy <khaled.almahallawy@intel.com>,
 linux-stm32@st-md-mailman.stormreply.com, Sam Ravnborg <sam@ravnborg.org>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>, Imre Deak <imre.deak@intel.com>,
 Liviu Dudau <liviu.dudau@arm.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>,
 Gurchetan Singh <gurchetansingh@chromium.org>,
 Liu Shixin <liushixin2@huawei.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Hamza Mahfooz <hamza.mahfooz@amd.com>, David Airlie <airlied@gmail.com>,
 Marek Vasut <marex@denx.de>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>, Lang Yu
 <Lang.Yu@amd.com>, xen-devel@lists.xenproject.org,
 Guchun Chen <guchun.chen@amd.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
 Russell King <linux@armlinux.org.uk>, Leo Li <sunpeng.li@amd.com>,
 Uma Shankar <uma.shankar@intel.com>, Andi Shyti
 <andi.shyti@linux.intel.com>, Jiasheng Jiang <jiasheng@iscas.ac.cn>,
 Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
 David Lechner <david@lechnology.com>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 =?UTF-8?B?TWFyZWsgT2zFocOhaw==?= <marek.olsak@amd.com>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 =?UTF-8?Q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= <samsagax@gmail.com>,
 Melissa Wen <mwen@igalia.com>, Hans de Goede <hdegoede@redhat.com>,
 linux-mediatek@lists.infradead.org, Fabio Estevam <festevam@gmail.com>,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>, linux-tegra@vger.kernel.org,
 David Tadokoro <davidbtadokoro@usp.br>,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 amd-gfx@lists.freedesktop.org, Thomas Zimmermann <tzimmermann@suse.de>,
 Yannick Fertre <yannick.fertre@foss.st.com>, linux-mips@vger.kernel.org,
 Rob Clark <robdclark@gmail.com>, Philippe Cornu
 <philippe.cornu@foss.st.com>, Philipp Zabel <p.zabel@pengutronix.de>,
 Wayne Lin <Wayne.Lin@amd.com>, Drew Davenport <ddavenport@chromium.org>,
 Nirmoy Das <nirmoy.das@intel.com>, Jyri Sarha <jyri.sarha@iki.fi>,
 Lucas Stach <l.stach@pengutronix.de>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <94eb6e4d-9384-152f-351b-ebb217411da9@amd.com>
 <20230712110253.paoyrmcbvlhpfxbf@pengutronix.de>
 <o3dc4q27ap6rajsvpfwfvs3z3afekkwbhnclvswkaietciy2kc@unjf67gz5tur>
 <20230712133803.rf26cbg5wz7wsmgl@pengutronix.de>
 <603f0b69-71d3-ad8f-4b5e-53b63a6fd521@amd.com>
From: Luben Tuikov <luben.tuikov@amd.com>
Autocrypt: addr=luben.tuikov@amd.com; keydata=
 xjMEY1i6jxYJKwYBBAHaRw8BAQdAhfD+Cc+P5t/fiF08Vw25EMLiwUuxULYRiDQAP6H50MTN
 I0x1YmVuIFR1aWtvdiA8bHViZW4udHVpa292QGFtZC5jb20+wpkEExYKAEEWIQQyyR05VSHw
 x45E/SoppxulNG8HhgUCY1i6jwIbAwUJCWYBgAULCQgHAgIiAgYVCgkICwIEFgIDAQIeBwIX
 gAAKCRAppxulNG8Hhk53AP4k4UY5xfcje0c5OF1k22pNv8tErxtVpgKKZgvfetA4xwD+OoAh
 vesLIYumBDxP0BoLiLN84udxdT15HwPFUGiDmwDOOARjWLqPEgorBgEEAZdVAQUBAQdAzSxY
 a2EtvvIwd09NckBLSTarSLNDkUthmqPnwolwiDYDAQgHwn4EGBYKACYWIQQyyR05VSHwx45E
 /SoppxulNG8HhgUCY1i6jwIbDAUJCWYBgAAKCRAppxulNG8HhnBLAP4yjSGpK6PE1mapKhrq
 8bSl9reo+F6EqdhE8X2TTHPycAEAt8EkTEstSiaOpM66gneU7r+xxzOYULo1b1XjXayGvwM=
In-Reply-To: <603f0b69-71d3-ad8f-4b5e-53b63a6fd521@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: YQZPR01CA0142.CANPRD01.PROD.OUTLOOK.COM
 (2603:10b6:c01:87::21) To DM6PR12MB3370.namprd12.prod.outlook.com
 (2603:10b6:5:38::25)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DM6PR12MB3370:EE_|DS0PR12MB7747:EE_
X-MS-Office365-Filtering-Correlation-Id: 4992d380-7822-4818-e82c-08db83351e21
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	OetvGvXD4kbxnCvicm9ni93hrWSam1zxuJRcM29ALwkNkH1AFtPd7P/Fyut+wVTwNRt8kO+LhdiIUSC1nQqS+szX772rIFaiUjeRRephMzDJ3xy8rpIje9x49uMfe9F9/LjfLGoWKdfeJqcwYUureMjoenn97vO+dYMxty5PauyatVWKpap4APxXn7eypRg6Z4r7zknOnRzj29/lHavwBcALufwcs5VfL/FigAspNt75CSQuPhNMs3a08krXLPL/erzed/WZkLd+0FBPGRAp8c5vsiH52N3jc94uvGRANw+kb5Uw+28WUhzIvnpwvEa8VJCgsr3deKdhL3+f4AT3drVotCYjrDbci0NrK24snHfS3m1Tgo31MAq7mIH2elLJ/JhuClAnoygxSAIg+mYpet5v7nkLkibMmthjZRSUisxDItjg1idZmrA18aJ6v/BkjE1N8YzvGJ1bxPasqsJUs+I4kfjVsctqSXhZQXRMaJR9zJe9rGcf2iFQ+IDOhHlM56aUv6o7oe7mIuzVXImAvsy3PM1U9GPWr9Kase/6s8ozNB6wq8z8Yd3XwvsQhOBf6vk0a3KEotDh3oYEJEq+43G/I6/3LDwJlkzPH0DpqdI8I6zEDNPCZU/Kpsp4gjErmrS4H6o/dX3ChVCJ3du5ZQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3370.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(376002)(39860400002)(396003)(366004)(451199021)(66574015)(2906002)(2616005)(36756003)(41300700001)(83380400001)(53546011)(5660300002)(26005)(6506007)(186003)(7416002)(7406005)(7366002)(7276002)(44832011)(7336002)(8936002)(8676002)(31696002)(54906003)(110136005)(6486002)(66476007)(66946007)(66556008)(4326008)(6666004)(86362001)(478600001)(38100700002)(31686004)(316002)(6512007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Z2N5THVtVkpNaWV5NUJIRG1QS1dBa0dqbXpYZnpOTmxFZ2pDVUY2U3M4anh2?=
 =?utf-8?B?SW1IOTlCN2RVbUJha2hzY01aZkFZT2UxTndiR2dKNlVjVFZINDJXLzRYN1Aw?=
 =?utf-8?B?djFxN0VGZVVyaW1xSmhTN1NpYmo3NGRLTVl1Mlo0L2V4cklISHM2bStXL1lj?=
 =?utf-8?B?bVZTd2pTaGJVcG9WN0svQ0pQVXFQKzEvaUsxTlJIblc5N2l3TFNtYlpqSmNh?=
 =?utf-8?B?Rk1aZHBZUS9oanhwOGxzV1VCMFR2MjM3UmdzRE43V3F4V3dMQVRYdy81bVQ3?=
 =?utf-8?B?bF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?utf-8?B?Tm5NbThmYUJ5YjJ3Q1JuaW55cmlBd3BGZUhKcnZ1dVhseHhEU1dTc1VYbzNP?=
 =?utf-8?Q?k7m36FXVjmqGRYjPJGL1uTMxN?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4992d380-7822-4818-e82c-08db83351e21
X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3370.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 00:07:16.9878
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: CKN08Ur9guvB4xSjc0iFLLgs5BPyDy2I6XIh73skvHxQqbwwf8rx4nqW3J6KPWkI
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7747

On 2023-07-12 09:53, Christian KÃ¶nig wrote:
> Am 12.07.23 um 15:38 schrieb Uwe Kleine-KÃ¶nig:
>> Hello Maxime,
>>
>> On Wed, Jul 12, 2023 at 02:52:38PM +0200, Maxime Ripard wrote:
>>> On Wed, Jul 12, 2023 at 01:02:53PM +0200, Uwe Kleine-KÃ¶nig wrote:
>>>>> Background is that this makes merge conflicts easier to handle and detect.
>>>> Really?
>>> FWIW, I agree with Christian here.
>>>
>>>> Each file (apart from include/drm/drm_crtc.h) is only touched once. So
>>>> unless I'm missing something you don't get less or easier conflicts by
>>>> doing it all in a single patch. But you gain the freedom to drop a
>>>> patch for one driver without having to drop the rest with it.
>>> Not really, because the last patch removed the union anyway. So you have
>>> to revert both the last patch, plus that driver one. And then you need
>>> to add a TODO to remove that union eventually.
>> Yes, with a single patch you have only one revert (but 194 files changed,
>> 1264 insertions(+), 1296 deletions(-)) instead of two (one of them: 1
>> file changed, 9 insertions(+), 1 deletion(-); the other maybe a bit
>> bigger). (And maybe you get away with just reverting the last patch.)
>>
>> With a single patch the TODO after a revert is "redo it all again (and
>> prepare for a different set of conflicts)" while with the split series
>> it's only "fix that one driver that was forgotten/borked" + reapply that
>> 10 line patch.
> 
> Yeah, but for a maintainer the size of the patches doesn't matter. 
> That's only interesting if you need to manually review the patch, which 
> you hopefully doesn't do in case of something auto-generated.
> 
> In other words if the patch is auto-generated re-applying it completely 
> is less work than fixing things up individually.
> 
>>   As the one who gets that TODO, I prefer the latter.
> 
> Yeah, but your personal preferences are not a technical relevant 
> argument to a maintainer.
> 
> At the end of the day Dave or Daniel need to decide, because they need 
> to live with it.
> 
> Regards,
> Christian.
> 
>>
>> So in sum: If your metric is "small count of reverted commits", you're
>> right. If however your metric is: Better get 95% of this series' change
>> in than maybe 0%, the split series is the way to do it.
>>
>> With me having spend ~3h on this series' changes, it's maybe
>> understandable that I did it the way I did.
>>
>> FTR: This series was created on top of v6.5-rc1. If you apply it to
>> drm-misc-next you get a (trivial) conflict in patch #2. If I consider to
>> be the responsible maintainer who applies this series, I like being able
>> to just do git am --skip then.
>>
>> FTR#2: In drm-misc-next is a new driver
>> (drivers/gpu/drm/loongson/lsdc_crtc.c) so skipping the last patch for
>> now might indeed be a good idea.
>>
>>>> So I still like the split version better, but I'm open to a more
>>>> verbose reasoning from your side.
>>> You're doing only one thing here, really: you change the name of a
>>> structure field. If it was shared between multiple maintainers, then
>>> sure, splitting that up is easier for everyone, but this will go through
>>> drm-misc, so I can't see the benefit it brings.
>> I see your argument, but I think mine weights more.

I'm with Maxime and Christian on this--a single action necessitates a single patch.
One single movement. As Maxime said "either 0 or 100."

As to the name, perhaps "drm_dev" is more descriptive than just "drm".
What is "drm"? Ah it's a "dev", as in "drm dev"... Then why not rename it
to "drm_dev"? You are renaming it from "dev" to something more descriptive
after all. "dev" --> "drm" is no better, but "dev" --> "drm_dev" is just
right.
-- 
Regards,
Luben



From xen-devel-bounces@lists.xenproject.org Thu Jul 13 05:59:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 05:59:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562925.879703 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJpMS-00033D-62; Thu, 13 Jul 2023 05:59:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562925.879703; Thu, 13 Jul 2023 05:59:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJpMS-000336-3P; Thu, 13 Jul 2023 05:59:32 +0000
Received: by outflank-mailman (input) for mailman id 562925;
 Thu, 13 Jul 2023 05:59:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tMFS=C7=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qJpMP-000330-VB
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 05:59:30 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20628.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::628])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6c8888f4-2142-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 07:59:27 +0200 (CEST)
Received: from DUZPR01CA0223.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4b4::10) by AM8PR08MB6580.eurprd08.prod.outlook.com
 (2603:10a6:20b:369::8) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24; Thu, 13 Jul
 2023 05:59:23 +0000
Received: from DBAEUR03FT011.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4b4:cafe::b) by DUZPR01CA0223.outlook.office365.com
 (2603:10a6:10:4b4::10) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24 via Frontend
 Transport; Thu, 13 Jul 2023 05:59:23 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT011.mail.protection.outlook.com (100.127.142.132) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.24 via Frontend Transport; Thu, 13 Jul 2023 05:59:22 +0000
Received: ("Tessian outbound f9124736ff4f:v145");
 Thu, 13 Jul 2023 05:59:22 +0000
Received: from 481900c8624d.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 F00C89A8-9CD6-4B73-9718-F74A4DEF12EA.1; 
 Thu, 13 Jul 2023 05:59:16 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 481900c8624d.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 13 Jul 2023 05:59:16 +0000
Received: from DB8PR06CA0024.eurprd06.prod.outlook.com (2603:10a6:10:100::37)
 by DB3PR08MB8889.eurprd08.prod.outlook.com (2603:10a6:10:439::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Thu, 13 Jul
 2023 05:59:13 +0000
Received: from DBAEUR03FT061.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:100:cafe::2d) by DB8PR06CA0024.outlook.office365.com
 (2603:10a6:10:100::37) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.26 via Frontend
 Transport; Thu, 13 Jul 2023 05:59:13 +0000
Received: from nebula.arm.com (40.67.248.234) by
 DBAEUR03FT061.mail.protection.outlook.com (100.127.143.28) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.20 via Frontend Transport; Thu, 13 Jul 2023 05:59:13 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com
 (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 13 Jul
 2023 05:59:13 +0000
Received: from [10.169.188.57] (10.169.188.57) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Thu, 13 Jul 2023 05:59:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6c8888f4-2142-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fb21Prp8fY+sRO79D5+pwDnvhBbwbDsxvfdcKF5/o2o=;
 b=Jt3FPx3S4gK//08qFG/vsEJ9934c63N0KXO4waEqYHIqrWS/Jv2xgUttIL59ubppet/wB9imPvJ8FezIIId47pbiUPW6RJ4g7n2G+Vu3FSL+74gE1vubaJoHOXW1WMuGaf53YA6cNN0pggemnIN9h32pN/cWLBZ1+sPnfj6LrNU=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 45810f259d438bca
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=eaivM5W/YR5q7hil1ZB3aCnEqpTDp9SqEhEoYC3szP7vb9KDjfRkOcitqJUyrleKAiFxmWngrplq8YMSi3HvRa+trxIy+R6zFw8nREFIywV5gPlAx02XDoGzH14wsVIE7MMrRfujqFLwgZgX9ODOintKzPU4JcP+IMDf99FjbYYOVB13o1XUPr8X9e2MH5I8GllSemdUy+/XcARFO7vIMZK3Wpdk1F6K3CLsdmfYbL9o/xu7wm+iikDSK0p8MJe7GtKqGkn/EIr/VXV1lzKbOkGXDH2eUjmJC0X1QQZNczUG6iy628u/5xGhVvJsjrt2FQjdvaN2qZrCSP7VDrPHAg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=fb21Prp8fY+sRO79D5+pwDnvhBbwbDsxvfdcKF5/o2o=;
 b=CfAMaPClnL+n/6Q9GWFs1wABvawGG7cFSFz8eNqs3g3etpyP99JFNu/E8eqXzgFUAaTCyZ73BhUIkKXMYTySg3z38L1dQdOzgnbxBp1MPcNJS7CX5JxGnoKoYH5dzSgDx0bffXNDFxtc2WFniuzGum28yEPSsP11bAQiJzRwABr3mPliDyHvm+NZxwFY1mCL3zacmagjADIZ6wsxm1GnCJE/K7rMmpJ/QHVaJ0SG/QgOXb+KPwq6UZ2TSnhbhC4VJiQNMxSvtCR4U9rtkzPwGDBFGqcAp0anZfeS3HHyeUU0kI5uQBQpM0oLB1m39i5ad8rmmPLVSPQrBzSJ2PmPdw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=amd.com smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fb21Prp8fY+sRO79D5+pwDnvhBbwbDsxvfdcKF5/o2o=;
 b=Jt3FPx3S4gK//08qFG/vsEJ9934c63N0KXO4waEqYHIqrWS/Jv2xgUttIL59ubppet/wB9imPvJ8FezIIId47pbiUPW6RJ4g7n2G+Vu3FSL+74gE1vubaJoHOXW1WMuGaf53YA6cNN0pggemnIN9h32pN/cWLBZ1+sPnfj6LrNU=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <4aea82de-6517-a974-2610-897de52fe952@arm.com>
Date: Thu, 13 Jul 2023 13:59:08 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 35/52] xen/arm: map static memory on demand
Content-Language: en-US
To: Ayan Kumar Halder <ayankuma@amd.com>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-36-Penny.Zheng@arm.com>
 <16428e2d-423c-6a9c-5caa-6ff5770a840e@amd.com>
 <add845b8-31c1-52a6-18ff-b19a6cb6ef38@arm.com>
 <ae0f338b-e86e-79db-8cb1-65cdd36c0911@amd.com>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <ae0f338b-e86e-79db-8cb1-65cdd36c0911@amd.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	DBAEUR03FT061:EE_|DB3PR08MB8889:EE_|DBAEUR03FT011:EE_|AM8PR08MB6580:EE_
X-MS-Office365-Filtering-Correlation-Id: cdbc86ec-c846-4579-d987-08db83664e4f
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 0yb8DpECsSfZ4DHPrss3a5Ds7fMT7LhMtcrG+sEg3cxhFIh6T7PnLGrEe6qqcNe7fmtYfgYo4SoGwqNbexioalaz1EgATIoVa1H34TPtkSToaAiOrArv/9bEDBzzlY8+/qwcXJn9A0WQbllNYQF92JBePswTorhhHKTgmAVpfe3NJNYVdxuuKaC8U8GY9ohzd1Z4jWs4o3CX9h8oP55amrXZdmkO1n8jPaBnqpXb+BOP5U1ShDqhr7cP2H+kxZT5IcF94m6h5BhgDU15HwzX2tH1+BqLNDtxQCoZ1Lkjp9mnZ/OSr4OMq0nOXlOn6E7GvFvAJliUtXJz9D2sYm+OBBYwn/qSFmPwhVmgtoYn5WrmVkXj2qGhUGewSfBxBPJuKHwZG8G35ImaFCb5N0zwpneeIrXD0USDPmWSIezSwKG+DJHfFPETRa/Egrgju4MEsWrtqhnIHLJwRZJw5dRpjEMzEsbZB3zFcU0UNlzHtonCrmOmVd+7zB8dfW8Wpnu6U1uGguI7qEMUUTvNG+NdE+E+qsVgKVzJeJZmkq/JG4yCcKvdP+8bF4l51n1HwxKRq9fiA6kklKVwpJ3tlEqpnOXiYy6IgZpZPQ3fbRn1FJSSK1gDB/+G5Mo2lZMmjAmGKV6Reo8o3r8wvPdCnGXIluhUlVpho8IKKboMoZjQ+HYI/7m6/acfvwjY1eRG4UHwoecshtRBUhH9CdLONKaI71AJIyYocfD7FZ9XdTR1Y6DBIX+aCHa3sRfUUmvvjJNtutka1774ewD3pjNf+PVl06NWcbzYq+cM7FWOUDdl4mGnJFBobYyylmp3bVe8rFmIhcod4MR6tY/dAHZlm15MovLFYUWC4s3bCOvp4U93aPw=
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(396003)(346002)(136003)(451199021)(40470700004)(46966006)(36840700001)(31686004)(8936002)(8676002)(41300700001)(54906003)(110136005)(40480700001)(5660300002)(2906002)(316002)(16576012)(44832011)(4326008)(70586007)(70206006)(40460700003)(426003)(478600001)(36756003)(31696002)(86362001)(186003)(336012)(82310400005)(81166007)(356005)(83380400001)(47076005)(82740400003)(2616005)(53546011)(26005)(36860700001)(21314003)(3940600001)(36900700001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB8889
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT011.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	82678c0e-3079-4e49-d350-08db836648fb
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	BNdM4eNh2H0iyZ8JagLc+QR1w3UCz7mRF9s4phjRyDIT/U9ch/ZRGe1/1pypo6uc2beQgV7ch625/9Z4FBWPdLwSoUKO95J4GtJdfrcZjvqEr3jyXEhwGTdcebI0O2VgCnBn4mcg7J7rwzkreVMRh4k5l5+UXgElai/ZmD/WcIquMQlvXrPuqWBnVygZ7zvF5HTzVh6bk1sw3QtlvXqc6oSO2hybdei79+RmH73DtAu73z+Yl5t6v4C7XthX1bb7oGSe0cL6f0U5DX8q0hvAHfZqlzOPPHHc+n/wLQDQFnignwIsikjP98mCb3lQqTzbhhm8w5cIPDFbYaSYmaBe5yMWVY1xTImekZkJsCFD3kg1r0oSWniF7NreITv6RVjcSVIiXHNpSyGYja4au/9IxPR4xWvhVwtphzj15qS0c9gpm+p9bVC3lwbMw8ma40HEdKhVg77fQRjfvviQpDotPjQYRMtRgNcdL5y+NDnBXk4LyFO4dvaWvxrr1TzAdvPtemugEsdcLL4JjqRHiJMW2SLZPgV3MGNlVWpRVjIxwpHXT5h1oBQ8VuysM+2wgOQ6A6WkD+WUMn0UR0/cbk3Cmj5Ve0hir+DXNZpFaSmvyGvlv+UYVZ4h8hF11e89VvuD9OIb9tZ2zF9ctStOobFAkSfxM9TcbA4RdJr2CYT5hgN9LB1NSF9iu0VQqsW7rgItwwDlejCdflMLdNOS7rdypiOmPzFqFhjh1KDUt/BBOPR1oMab5GmMSpzdYYCpoM/YkII2jAq85tPyCpv631jk0JFgd4MLOdHn2gcvqXHE7F78NEDQVqUOm9l1n9WkT7QDZ8uIcBoOhfdbPQxzxdk67g==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(396003)(376002)(346002)(451199021)(36840700001)(46966006)(40470700004)(40480700001)(36860700001)(36756003)(31696002)(86362001)(81166007)(82740400003)(82310400005)(40460700003)(478600001)(110136005)(54906003)(16576012)(8936002)(44832011)(5660300002)(316002)(70586007)(70206006)(2906002)(41300700001)(8676002)(31686004)(4326008)(2616005)(83380400001)(47076005)(336012)(426003)(53546011)(26005)(186003)(21314003)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 05:59:22.6815
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: cdbc86ec-c846-4579-d987-08db83664e4f
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT011.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6580

Hi Ayan

On 2023/7/5 21:33, Ayan Kumar Halder wrote:
> 
> On 05/07/2023 11:16, Penny Zheng wrote:
>> Hi Ayan
> Hi Penny,
>>
>> On 2023/7/4 23:10, Ayan Kumar Halder wrote:
>>> Hi Penny,
>>>
>>> On 26/06/2023 04:34, Penny Zheng wrote:
>>>> CAUTION: This message has originated from an External Source. Please 
>>>> use proper judgment and caution when opening attachments, clicking 
>>>> links, or responding to this email.
>>>>
>>>>
>>>> In function init_staticmem_pages, we need the access to static memory
>>>> for proper initialization.
>>>> It is not a problem in MMU system, as Xen map the whole RAM in
>>>> setup_mm(). However, with limited MPU memory regions, it is too luxury
>>>> to map the whole RAM.
>>>> As a result, we follow the rule of "map on demand", to map static 
>>>> memory
>>>> temporarily before its initialization, and unmap immediately after its
>>>> initialization.
>>>
>>> I could see that you are using _PAGE_TRANSIENTÂ  to map memory 
>>> temporarily. However, I don't see this being translated to any of the 
>>> MPU hardware features (ie _PAGE_TRANSIENT does not seem to translate 
>>> to any of the attributes in PRBAR, PRLAR, PRENR, etc). Thus, how is 
>>> it different from mapping the memory in "non temporary" way ?
>>>
>>
>> It is only software feature.
>> It is designed for implementing functions like ioremap_xxx(), or 
>> map_staticmem_pages_to_xen() here, which are always occuring with its 
>> reverse unmapping function nearby like iounmap(), or 
>> unmap_staticmem_pages_to_xen(), to map a chunk of memory 
>> *temporarily*, for a very short time.
> I understand that it is a software only feature. But why does the 
> software need to know if the memory is mapped temporarily or not ? What 
> difference does it make ?

See this pair map_domain_page()/unmap_domain_page(), which is used to 
map/unmap page of guest RAM. vcpu in different mode is facing different 
scenario.

Taking usage in copy_guest() as example:
When vcpu in guest mode trying to access its own memory(e.g. copy
hypercall param), there is no need to do the mapping/unmapping in MPU,
as page is already mapped at both EL1/EL2. Checking if it is transient
region in unmap_domain_page() is definitely necessary to help avoid 
unmapping it here.
When vcpu in hypervisor mode at boot time copying kernel image to guest
memory, we need to map page as transient MPU region to do the copying 
and pasting.

>> I want to check this flag in the unmapping function, to ensure that we 
>> are unmapping the proper MPU region.
> 
> I had a look at unmap_staticmem_pages_to_xen() --> xen_mpumap_update() 
> --> control_mpu_region_from_index() and I don't see this flag used 
> anywhere.
 >
> - Ayan
> 
>>
>> Fixed MPU regions are like Xen text section, Xen data section, etc.
>>
>>> Please let me know what I am missing.
>>>
>>> - Ayan
>>>
>>>>
>>>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>>>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>>>> ---
>>>> v3:
>>>> - new commit
>>>> ---
>>>> Â  xen/arch/arm/include/asm/mm.h |Â  2 ++
>>>> Â  xen/arch/arm/mmu/mm.cÂ Â Â Â Â Â Â Â  | 10 ++++++++++
>>>> Â  xen/arch/arm/mpu/mm.cÂ Â Â Â Â Â Â Â  | 10 ++++++++++
>>>> Â  xen/arch/arm/setup.cÂ Â Â Â Â Â Â Â Â  | 21 +++++++++++++++++++++
>>>> Â  4 files changed, 43 insertions(+)
>>>>
>>>> diff --git a/xen/arch/arm/include/asm/mm.h 
>>>> b/xen/arch/arm/include/asm/mm.h
>>>> index 66d98b9a29..cffbf8a595 100644
>>>> --- a/xen/arch/arm/include/asm/mm.h
>>>> +++ b/xen/arch/arm/include/asm/mm.h
>>>> @@ -224,6 +224,8 @@ extern void mm_init_secondary_cpu(void);
>>>> Â  extern void setup_frametable_mappings(paddr_t ps, paddr_t pe);
>>>> Â  /* map a physical range in virtual memory */
>>>> Â  void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned int 
>>>> attributes);
>>>> +extern int map_staticmem_pages_to_xen(paddr_t start, paddr_t end);
>>>> +extern int unmap_staticmem_pages_to_xen(paddr_t start, paddr_t end);
>>>>
>>>> Â  static inline void __iomem *ioremap_nocache(paddr_t start, size_t 
>>>> len)
>>>> Â  {
>>>> diff --git a/xen/arch/arm/mmu/mm.c b/xen/arch/arm/mmu/mm.c
>>>> index 2f29cb53fe..4196a55c32 100644
>>>> --- a/xen/arch/arm/mmu/mm.c
>>>> +++ b/xen/arch/arm/mmu/mm.c
>>>> @@ -1113,6 +1113,16 @@ int populate_pt_range(unsigned long virt, 
>>>> unsigned long nr_mfns)
>>>> Â Â Â Â Â  return xen_pt_update(virt, INVALID_MFN, nr_mfns, _PAGE_POPULATE);
>>>> Â  }
>>>>
>>>> +int __init map_staticmem_pages_to_xen(paddr_t start, paddr_t end)
>>>> +{
>>>> +Â Â Â  return 0;
>>>> +}
>>>> +
>>>> +int __init unmap_staticmem_pages_to_xen(paddr_t start, paddr_t end)
>>>> +{
>>>> +Â Â Â  return 0;
>>>> +}
>>>> +
>>>> Â  /*
>>>> Â Â  * Local variables:
>>>> Â Â  * mode: C
>>>> diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
>>>> index a40055ae5e..9d5c1da39c 100644
>>>> --- a/xen/arch/arm/mpu/mm.c
>>>> +++ b/xen/arch/arm/mpu/mm.c
>>>> @@ -614,6 +614,16 @@ void __init setup_frametable_mappings(paddr_t 
>>>> ps, paddr_t pe)
>>>> Â Â Â Â Â Â Â Â Â Â Â Â  frametable_size - (nr_pdxs * sizeof(struct page_info)));
>>>> Â  }
>>>>
>>>> +int __init map_staticmem_pages_to_xen(paddr_t start, paddr_t end)
>>>> +{
>>>> +Â Â Â  return xen_mpumap_update(start, end, PAGE_HYPERVISOR | 
>>>> _PAGE_TRANSIENT);
>>>> +}
>>>> +
>>>> +int __init unmap_staticmem_pages_to_xen(paddr_t start, paddr_t end)
>>>> +{
>>>> +Â Â Â  return xen_mpumap_update(start, end, 0);
>>>> +}
>>>> +
>>>> Â  /*
>>>> Â Â  * Local variables:
>>>> Â Â  * mode: C
>>>> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
>>>> index f42b53d17b..c21d1db763 100644
>>>> --- a/xen/arch/arm/setup.c
>>>> +++ b/xen/arch/arm/setup.c
>>>> @@ -637,12 +637,33 @@ void __init init_staticmem_pages(void)
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_t bank_start = 
>>>> _mfn(PFN_UP(bootinfo.reserved_mem.bank[bank].start));
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned long bank_pages = 
>>>> PFN_DOWN(bootinfo.reserved_mem.bank[bank].size);
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_t bank_end = mfn_add(bank_start, bank_pages);
>>>> +Â Â Â Â Â Â Â Â Â Â Â  int res;
>>>>
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  if ( mfn_x(bank_end) <= mfn_x(bank_start) )
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  return;
>>>>
>>>> +Â Â Â Â Â Â Â Â Â Â Â  /* Map temporarily before initialization */
>>>> +Â Â Â Â Â Â Â Â Â Â Â  res = map_staticmem_pages_to_xen(mfn_to_maddr(bank_start),
>>>> + mfn_to_maddr(bank_end));
>>>> +Â Â Â Â Â Â Â Â Â Â Â  if ( res )
>>>> +Â Â Â Â Â Â Â Â Â Â Â  {
>>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  printk(XENLOG_ERR "Failed to map static memory to 
>>>> Xen: %d\n",
>>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  res);
>>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  return;
>>>> +Â Â Â Â Â Â Â Â Â Â Â  }
>>>> +
>>>> unprepare_staticmem_pages(mfn_to_page(bank_start),
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  bank_pages, false);
>>>> +
>>>> +Â Â Â Â Â Â Â Â Â Â Â  /* Unmap immediately after initialization */
>>>> +Â Â Â Â Â Â Â Â Â Â Â  res = 
>>>> unmap_staticmem_pages_to_xen(mfn_to_maddr(bank_start),
>>>> + mfn_to_maddr(bank_end));
>>>> +Â Â Â Â Â Â Â Â Â Â Â  if ( res )
>>>> +Â Â Â Â Â Â Â Â Â Â Â  {
>>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  printk(XENLOG_ERR "Failed to unmap static memory to 
>>>> Xen: %d\n",
>>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  res);
>>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  return;
>>>> +Â Â Â Â Â Â Â Â Â Â Â  }
>>>> Â Â Â Â Â Â Â Â Â  }
>>>> Â Â Â Â Â  }
>>>> Â  #endif
>>>> -- 
>>>> 2.25.1
>>>>
>>>>


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 06:14:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 06:14:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562928.879714 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJpaq-0005gf-Ey; Thu, 13 Jul 2023 06:14:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562928.879714; Thu, 13 Jul 2023 06:14:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJpaq-0005gY-BQ; Thu, 13 Jul 2023 06:14:24 +0000
Received: by outflank-mailman (input) for mailman id 562928;
 Thu, 13 Jul 2023 06:14:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=3bWA=C7=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qJpao-0005gO-W8
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 06:14:23 +0000
Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com
 [2607:f8b0:4864:20::733])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 80e32cde-2144-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 08:14:21 +0200 (CEST)
Received: by mail-qk1-x733.google.com with SMTP id
 af79cd13be357-7679d75940fso37992485a.0
 for <xen-devel@lists.xenproject.org>; Wed, 12 Jul 2023 23:14:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 80e32cde-2144-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689228859; x=1691820859;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=W7D0WxEsVMHRDc8fyrvqHBYuZzwAEnOozUda4fV0nPs=;
        b=LHMaEaw0n5HxtTEE7HtnW01fcg5n5MaA8rNH8z6/qgVVYr1ev/yMM/4Xdv8xMFUGGU
         osuHkr/b3i7SIt/Jmp/RFUpc9uCcbgGtaNZJVSO31Je2sk66rHMji9bQmZ36tQi7BO+G
         00NwALkSyTJPYnG5p3EXS3NGVLmJAvkN3QKupKq6hNxn8s9tDL/pb3GTVtHsxPD8g6Pf
         82UweFTrJGBo/TOAVILHMagIFd/nyWFUy6GBLF/m2Tbe+Ay4XsumK7By4qsY2/+rXZfn
         nRTzvsfpGSroK+7X09pFb5DlKYEANL0/3y8/Se6dcXymt5/PHUQAMjBDOIkbRD7ITsAt
         OmZg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689228859; x=1691820859;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=W7D0WxEsVMHRDc8fyrvqHBYuZzwAEnOozUda4fV0nPs=;
        b=jHfq+MoQcbDJomshrbMKvw++jLvYV6ekG+AAk8EwTo6EXEllSspD+dkBrWjTzWz+Zz
         e94J7xOIKlu3qJgFP+qV1S2dHOXRE8DGTAsgFbgNOWea18aucNJhXqaY9pr4O/BQL0D6
         mGoZpU1YNRX/uYI5X+eBmlqEk5ZON2HA1Q0jhqtI1CDYLtDnxQcLWjFdoGdtKedHs0LG
         gj7THDKAHw9BnpZNTI0Fhe99d87NvOpISFSpvj4jH7RA6JGHByDtvazAM6zPSD58H5I7
         yR1Q6ia4au0M8ZEi+kcS5JoHyy7oIEhyU5HCZ5mE13/apU5ltgmY8iYgHYm/Znh8jEBQ
         XOMQ==
X-Gm-Message-State: ABy/qLZ/O7SLhwFXBk3QjMF16xOxuld62eApsOuxS+iTisVAsXSNH+o1
	p/rDFDEqFGkS1Ls5E+s0VzRzamiqeOApM+bKDZU2XQ==
X-Google-Smtp-Source: APBJJlH8aiFIV24pou68ahVwbiG3Vlz8L40+ewtNEHVC/wiUcNZeJp0yc/2vbyi47iAdXJ/OXktqXNrTE4itxQjGzqs=
X-Received: by 2002:a05:620a:2587:b0:765:83e8:d990 with SMTP id
 x7-20020a05620a258700b0076583e8d990mr511388qko.75.1689228859441; Wed, 12 Jul
 2023 23:14:19 -0700 (PDT)
MIME-Version: 1.0
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
 <20230705093433.2514898-3-jens.wiklander@linaro.org> <826c2ff0-79d3-9544-5ce3-7f49905a353c@citrix.com>
In-Reply-To: <826c2ff0-79d3-9544-5ce3-7f49905a353c@citrix.com>
From: Jens Wiklander <jens.wiklander@linaro.org>
Date: Thu, 13 Jul 2023 08:14:08 +0200
Message-ID: <CAHUa44FxWv1DhLvQ_tRycKG0zZ9y5AHpQAHiQLKScAnKXFOnkA@mail.gmail.com>
Subject: Re: [XEN PATCH v9 02/24] xen/arm: add TEE teardown to arch_domain_teardown()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org, 
	Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Bertrand.Marquis@arm.com, 
	Anthony PERARD <anthony.perard@citrix.com>, Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, 
	Marc Bonnici <marc.bonnici@arm.com>, Achin Gupta <achin.gupta@arm.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi,

On Wed, Jul 12, 2023 at 10:31=E2=80=AFAM Andrew Cooper
<andrew.cooper3@citrix.com> wrote:
>
> On 05/07/2023 10:34 am, Jens Wiklander wrote:
> > diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> > index 15d9709a97d2..18171decdc66 100644
> > --- a/xen/arch/arm/domain.c
> > +++ b/xen/arch/arm/domain.c
> > @@ -795,6 +795,42 @@ fail:
> >
> >  int arch_domain_teardown(struct domain *d)
> >  {
> > +    int ret =3D 0;
> > +
> > +    BUG_ON(!d->is_dying);
> > +
> > +    /* See domain_teardown() for an explanation of all of this magic. =
*/
> > +    switch ( d->teardown.arch_val )
> > +    {
> > +#define PROGRESS(x)                             \
> > +        d->teardown.arch_val =3D PROG_ ## x;      \
> > +        fallthrough;                            \
> > +    case PROG_ ## x
> > +
> > +        enum {
> > +            PROG_none,
> > +            PROG_tee,
> > +            PROG_done,
> > +        };
> > +
> > +    case PROG_none:
> > +        BUILD_BUG_ON(PROG_none !=3D 0);
> > +
> > +    PROGRESS(tee):
> > +        ret =3D tee_domain_teardown(d);
> > +        if ( ret )
> > +            return ret;
> > +        break;
>
> This unconditional break isn't correct.
>
> The logic functions right now (because upon hitting return 0, you don't
> re-enter this function), but will cease working when you add a new
> PROG_*, or when the calling code gets more complicated.
>
> > +
> > +    PROGRESS(done):
> > +        break;
>
> This needs to be the only break in the switch statement, for it to
> behave in the intended manner.

Got it, thanks for the explanation. I'll fix it in the next version.

Thanks,
Jens

>
> ~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 06:14:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 06:14:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562930.879724 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJpbF-00066W-MI; Thu, 13 Jul 2023 06:14:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562930.879724; Thu, 13 Jul 2023 06:14:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJpbF-00066P-JE; Thu, 13 Jul 2023 06:14:49 +0000
Received: by outflank-mailman (input) for mailman id 562930;
 Thu, 13 Jul 2023 06:14:48 +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 <SRS0=0tL6=C7=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJpbE-000660-E8
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 06:14:48 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2060a.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::60a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 90363ef2-2144-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 08:14:46 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PAXPR04MB8832.eurprd04.prod.outlook.com (2603:10a6:102:20f::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Thu, 13 Jul
 2023 06:14:43 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Thu, 13 Jul 2023
 06:14:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 90363ef2-2144-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KwBvZukoAxZx+ef3tOsjMBTcybHHBrSNjAl0oenrHqG7kdHVbekn6t5a1iOI4COPLT/hbPMLfaClbc8ZUGI4ZmryAb2W/vCfBLk/NPvHpVEp6njohV/gx55hmu91PgmhV0QiYGA8o3aLo2WrkHqbd8kmN5AZHp4kOflrLbDM56vjqQ4Pp7yEIVmYl5OSJl6A/nq/ylE0S/oqeghT2FkUpnWx66exC2fRqlIR0MgWnEqK9Gk88Dpz8wPhbdpbPLe+16f3+wGS5zL9JizdnHhkCb61tXQyPgThMOTX3DbtvVv/oEjvUOfTNtGCvXXflIjTB9O9dDoUNJq5HhiCjQ6zxA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=IfPNIszJKThWY98bg+AiezdmaaKtKc1KVIHa/QFxn3Y=;
 b=XYPnik/4KDAK7AxqyLndPymbGyo5qVMN4LZaAmsmiWkvAj1aMJ3QTfZKCHIcDjB21ScT6mIQpRLJIc6pUa5eLDu5DsFYs9O/ybcIgw8rYnZm3K+DPaDI7jBJDGexWxZg9PCXg1Bv2Zos+qW5j56n1nV4nbiN17HWmLVzRKsw6BFtz5lH72nlwIyXoIWUILnGpCRFJ0OW7KDgKnjepeeVgyfYTX9Nw+0CdA5S3EXYTmHjinS6+7Pw+U6BMkPuigveWHODam8lxdQanHvhZDcD2YkRqWA7j9r2ED1ZbJYrUaQtpSlfnUbgRIoKI6z/gKeRIgFbGY3XBRX4VcBJaZ/V3w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IfPNIszJKThWY98bg+AiezdmaaKtKc1KVIHa/QFxn3Y=;
 b=woXz1lGm0oXjhi70LJvn0bRZgXSYG6It8A+w5AJVqzHmAgiv4PSPi8F7qrUBy/2i37dg3YNC+cwqBbqt0bk4Lj72uTO3K2XMOq5wTOys3qHMqbgQhSbxdkhi78DcHe+H2sCikpTBBBuoARAwKs9UvswHgtcr7txfpo0gJwP4PTS7TaZ6GNe1QIAH+2mh+r42bU+xI8Zp2w++W3b6+lYQkVsskvvt7a4tKuPbDvoccRDECg0G8DQ8yS5/3zsopFApKfv4vXi5L/aCre+b9ck/MtqKoxVp9JBr1Mm45JyLIYAQy3KxMg5vdNsAfUSSzwoBxzRpt2QOpy4nyewj9JKybg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <61328d60-7089-5a0d-dd72-23f3cf57f802@suse.com>
Date: Thu, 13 Jul 2023 08:14:39 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v5 06/15] cpufreq: Add Hardware P-State (HWP) driver
Content-Language: en-US
To: Jason Andryuk <jandryuk@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20230706185440.48333-1-jandryuk@gmail.com>
 <20230706185440.48333-7-jandryuk@gmail.com>
 <eeeb032f-a21b-5eb2-e3d5-63357a04a500@suse.com>
 <CAKf6xptn0OL0qz+DW9qrwU=sFSKSp-O3S7z6vFbZp9RstFanbw@mail.gmail.com>
 <bfacee48-f640-f2eb-7fd7-f440ad03e612@suse.com>
 <CAKf6xpvVd49dx=CtGyPMt+NMuOfhJ4a1fiZb-O4e-guq9BwcFw@mail.gmail.com>
 <cdbaec77-9112-7b18-e9eb-fa12a16d2ccf@suse.com>
 <CAKf6xpspsyShp2O8SLK+=VQvxd=Uaewg-JHYAFPqEPmEWvDRAg@mail.gmail.com>
 <f768b046-4e14-30b3-479b-bdcdebb4d397@suse.com>
 <CAKf6xpt53io1TGDy0hmfhBoDqz5bUHNbpU37Y0xtpUqPVMJd4g@mail.gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <CAKf6xpt53io1TGDy0hmfhBoDqz5bUHNbpU37Y0xtpUqPVMJd4g@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0053.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:48::17) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAXPR04MB8832:EE_
X-MS-Office365-Filtering-Correlation-Id: bc305f96-0919-46d5-6b0d-08db836871d5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	YGJoFiMIO3kCjUpkPtiTljS+hAdCLzVSh1h3cgmJuWwdKwSXhlpzh4+XwmzK2IerANY8Z6WaSvUgi5smupIYszxQNWRZt+cbKuaY9rsbIztzKXgj8pbGpJGuu2navCBdDcXjmneWPUqRglXVr083MSk/4K/ARiwfLNb9TI5Y3BVou9VSR5KgYJ28hTf0eCCitNx284zbInpzGZJ/DTtqqjSsv1CsHUXmESXNjNBO0DyZ5WaP/oMQcHjHQbokRLIDSyV6M1bbuvqRSpEVidF1cALg0B8JDM22CZC2Qk2FWWSavAgvoezLv9uFCtIDbi5gGm48QpBKwKOmUN1eb4WmCVKyjQvgKxu7tjUjT8ZDLOOvgvEjlkczhheEsl/kr08dWaLUAn7MWXyaiVz7mI7mUKhyDqRmitEciqFifE6dGgXtdwXhk/ILsHFNrMFcqVRug0WEdTZuHfVSEwwVmt28EZDaqFgmBN3tzwf8nAJu+4LJ4U/lA66CAc27d7X5Dnx7x00L+dcJPnsd63ROTRt+fwhA/OtfZFAdUKnfP0rh0YxcVpVwsgPc59HZTbzap//6j0qfs1gFYdB5icVcaTMYGKb+UckWdfbSEgoJo86V3D4oUi2qbGzOqi+iOe3Vn6sA1qoQC5JkNafxMuOr84TQqg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(396003)(39860400002)(346002)(376002)(366004)(451199021)(8676002)(8936002)(54906003)(478600001)(26005)(41300700001)(36756003)(31696002)(2906002)(31686004)(6486002)(5660300002)(86362001)(316002)(6506007)(38100700002)(66476007)(6916009)(66946007)(53546011)(2616005)(186003)(66556008)(558084003)(6512007)(4326008)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QS9jMkhRVlRDWHRRUGs4NVJERVh3dnd2bzFEYkZjUDVZVkhMK2FWZGNBRXIv?=
 =?utf-8?B?WE40UllHZFBtblRZU1dqdU9SQzNCZnJEZHdYcGQ1Nmd1d2gwalRmVlo5SU1z?=
 =?utf-8?B?VTBZZEdPbXRrL09hR3VJNkhLRksvN3hOb1gvWkk3RlYwZ3k2ZnVmaDdWUk5O?=
 =?utf-8?B?UUlVTEIveTkxTjFaUXE1Uk1yU1JVb0psaEZ1UUVsUGVwOEZSU01WM1pneThR?=
 =?utf-8?B?ZThacUpBMzNzc0NBaVVZYVl5aU5ralgzUTRDWGlXR21pSUg4MjA4K21YNG9r?=
 =?utf-8?B?YWFRMTBQWUdLZ3VRNlZ5T2VKTnRDc29JMWlYRFE0WUlYNTJFRnJQbnVSenE2?=
 =?utf-8?B?aXMxVkJsbUV5UldyejA4dU1jQnVSSDRkMmRwVThpa1pqejNIVWFKbDNHbDFo?=
 =?utf-8?B?UXpvUUxmL2pzS2ZmMHV2dnZBRGJBSnl3aFdlWnF3dGZvV0c1K0NMajFWekNK?=
 =?utf-8?B?NnkremxJYVAveEZQak4yOTI3emhDQnAvV2tOZEVXckR2RVdjY09iUXR4QnE5?=
 =?utf-8?B?cW82K3Q1UzZ3Q21ZNVZHMzN4bUM2WUhyWjFHdUJDayszSkRWazRWdFZDZHdU?=
 =?utf-8?B?cjAzblZRRUhINHFFdUZzMUg2WmdpMG54VlY4eGlRa29kOEI4L0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
 =?utf-8?B?OGl6N2ZtV29SNnZQZWtQRDFGQm9odWlkcGUwbXpNWDU3dDBJKzU0d3I2aDQ5?=
 =?utf-8?B?K0MrbmovNGFqZzA2RlMvQ21lUVFuTDNSUy9yVzBGWHRIUFFGaXNyb2Riem56?=
 =?utf-8?B?RTE2TGdZTktwRXhsalYwWFd1Z2pGc0RVSExwdGxTUzlVekx1QUNidkhyS0py?=
 =?utf-8?B?MnloSiswMkhCRlpEdXJRZktDNlNvOFdaVHgya0xBRisvNk5QT0Q5SXViNFN4?=
 =?utf-8?B?akw4ellLLys0ajY2c1hHYzR4MzR5YWwrWGMveVUyTGh1MjkrbWE0bU9rN0ZT?=
 =?utf-8?B?M1JHUEV1ZGIwVU1ZN0VLNG94aWVHU0ZvSDQ5NDFJbkFmamlEejVzNWR3alEv?=
 =?utf-8?B?NmhGSGVYVjRDMllHdERPVlZsTkhCd3lhVG5raEE1M0xMRkNRNkRQNzBLWkdu?=
 =?utf-8?B?SlNRaXRYNGZNVll2VkRKNE5QQW00eTM4eFhNSjExTXU2ZHlhckZ0N3E4ZWlT?=
 =?utf-8?B?TjdlRXdPRzY3Z092a3BBcG10Z01vQ21sVC9BSThQTGEyeGVJcUc0YkliZDd4?=
 =?utf-8?B?cmpGOXRsUER4Vy9xMG10bkVjdW1UdFBmY3VYRE1jQzNvQlhUenpZRFZEWEli?=
 =?utf-8?Q?Vcpyn1WgF0F5h9+twIFC2ovpc?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bc305f96-0919-46d5-6b0d-08db836871d5
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 06:14:41.4220
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: VaWtqTRCncgdpEOKid2nEArnV29HZZ6X7z4jfYa/CmtXERAeHr9dCopNK1H3tGLd+rG+2qeO8trws+j2JhJC+Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8832

On 12.07.2023 21:38, Jason Andryuk wrote:
> I think I just prefer the ';' separator and letting "verbose" be
> weird.  It maps well into the existing syntax and I liked it when you
> first suggested it.

Well, okay, then let's stick to that, emphasizing the weirdness in doc.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 07:03:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 07:03:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562939.879734 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJqLu-0003WX-Ci; Thu, 13 Jul 2023 07:03:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562939.879734; Thu, 13 Jul 2023 07:03:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJqLu-0003WQ-8V; Thu, 13 Jul 2023 07:03:02 +0000
Received: by outflank-mailman (input) for mailman id 562939;
 Thu, 13 Jul 2023 07:03:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=3bWA=C7=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qJqLt-0003W4-GP
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 07:03:01 +0000
Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com
 [2607:f8b0:4864:20::f32])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4cad8749-214b-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 09:02:59 +0200 (CEST)
Received: by mail-qv1-xf32.google.com with SMTP id
 6a1803df08f44-635e8536ed6so2354216d6.0
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 00:02:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4cad8749-214b-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689231778; x=1691823778;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=+ZTJtN55Wca58tCqwYuvWqT79USxYAYDiEgZB7QSGeo=;
        b=kEriNvikz5R/TZ3VfrtVAEk2utPtJnv42xg/MhwyMWjDoK+8HJN4cfL9TjsHcnoxH4
         FLcrH4IeUovTVpt1bCTNVxOmHX3mkB8t1xYDqC8mw7cdv+kO8+quOJjN7Gv3b1i7h0ei
         Km89cIALD75JWzbJvi0cFYo7uch8gUAfrK4TeyfE15BpGsTLcnI+mFiG2djUoGSjiaNe
         ECRd8cRecIIFpQVcy2qY5Wvwm9zrI+Gf/KHzXhImVziUFwBWqKWG5daK1i+G43sL49VC
         J2687BcGCjPLd4PJzWb+lVvG8JyS6yBaxVmHYK/zGNekm0LfuNILlAX9aUdJVYMLLOld
         TbFg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689231778; x=1691823778;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=+ZTJtN55Wca58tCqwYuvWqT79USxYAYDiEgZB7QSGeo=;
        b=EHdbI9fvgR8b5IK1UtT4kEVUmbZU58cGAQP3qgsJte3MyaooPISk8cc11+ApjKe875
         UuGpnoUP0bmxQVOzc0zxNRTC3JcDZpRCKygRmpOlR5mHv5QQMNKDQgDJ48KC3lyysw3a
         nz9S3OHEtrrXF18IaTZ/5iAHjH5T4hwOKikJz/56dNcExOdh+NfEb21f5YQ+aT00D9zN
         jtALwDHTrD7rKLfjxWCkpswPHh9j3h0pEOommxPkROuEu0BG0Ly1EclFiCagx4BUHI2p
         zzPZYV4s0Rg6+Bqe8dGaGX76Ui6EED0g7Hzi/wCK4+3+vtZJJ/RjEr2Zj6mVVvN3MFvJ
         4daQ==
X-Gm-Message-State: ABy/qLao3ZIJLCJ+O1rCLwpJD8UmxwFVz++CTCiWs9BY2ChKQ9UzmJeO
	b5hevdTjLy1Ev0pPOWxrfvS4YA/wNSOJfCd5zygTQQ==
X-Google-Smtp-Source: APBJJlFOD1EHQsjlMKEq0JW+9G5TdQXdWneOYBUts4u8JSA4QNqHF4aQbTCfWAfo71Vq4s+JAxaGCTn+itB6ZFw3cUo=
X-Received: by 2002:a0c:cc13:0:b0:636:39ed:4dd1 with SMTP id
 r19-20020a0ccc13000000b0063639ed4dd1mr766725qvk.29.1689231778335; Thu, 13 Jul
 2023 00:02:58 -0700 (PDT)
MIME-Version: 1.0
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
 <20230705093433.2514898-3-jens.wiklander@linaro.org> <b1a9be99-6078-6553-74f1-5be5f002b23d@xen.org>
In-Reply-To: <b1a9be99-6078-6553-74f1-5be5f002b23d@xen.org>
From: Jens Wiklander <jens.wiklander@linaro.org>
Date: Thu, 13 Jul 2023 09:02:47 +0200
Message-ID: <CAHUa44FxkUxN4+pfECk0Sb9JgArNAh7vgKktK+=bY1C0rABVqg@mail.gmail.com>
Subject: Re: [XEN PATCH v9 02/24] xen/arm: add TEE teardown to arch_domain_teardown()
To: Julien Grall <julien@xen.org>
Cc: xen-devel@lists.xenproject.org, 
	Stefano Stabellini <sstabellini@kernel.org>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
	Bertrand.Marquis@arm.com, Anthony PERARD <anthony.perard@citrix.com>, 
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici <marc.bonnici@arm.com>, 
	Achin Gupta <achin.gupta@arm.com>, Andrew Cooper <andrew.cooper3@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Julien,

On Wed, Jul 12, 2023 at 11:53=E2=80=AFAM Julien Grall <julien@xen.org> wrot=
e:
>
> Hi Jens,
>
> On 05/07/2023 10:34, Jens Wiklander wrote:
> > Adds a progress state for tee_domain_teardown() to be called from
> > arch_domain_teardown(). tee_domain_teardown() calls the new callback
> > domain_teardown() in struct tee_mediator_ops.
> >
> > An empty domain_teardown() callback is added to the OP-TEE mediator.
> >
> > Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> > Co-developed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> I am a bit confused with the tags ordering. The first signed-off-by
> indicates that Andrew is the author but he co-developped with himself?
> Did you indent to put your signed-off-by first?

Sorry, my mistake, I swapped the two lines. I'll fix it in the next version=
.

>
> > Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> >
> > ---
> > CC: Stefano Stabellini <sstabellini@kernel.org>
> > CC: Julien Grall <julien@xen.org>
> > CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
> > CC: Bertrand Marquis <bertrand.marquis@arm.com>
> > CC: Jens Wiklander <jens.wiklander@linaro.org>
> > ---
> >   xen/arch/arm/domain.c              | 36 +++++++++++++++++++++++++++++=
+
> >   xen/arch/arm/include/asm/tee/tee.h |  7 ++++++
> >   xen/arch/arm/tee/optee.c           |  6 +++++
> >   xen/arch/arm/tee/tee.c             |  8 +++++++
> >   4 files changed, 57 insertions(+)
> >
> > diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> > index 15d9709a97d2..18171decdc66 100644
> > --- a/xen/arch/arm/domain.c
> > +++ b/xen/arch/arm/domain.c
> > @@ -795,6 +795,42 @@ fail:
> >
> >   int arch_domain_teardown(struct domain *d)
> >   {
> > +    int ret =3D 0;
> > +
> > +    BUG_ON(!d->is_dying);
> > +
> > +    /* See domain_teardown() for an explanation of all of this magic. =
*/
> > +    switch ( d->teardown.arch_val )
> > +    {
> > +#define PROGRESS(x)                             \
> > +        d->teardown.arch_val =3D PROG_ ## x;      \
> > +        fallthrough;                            \
> > +    case PROG_ ## x
> > +
> > +        enum {
> > +            PROG_none,
> > +            PROG_tee,
> > +            PROG_done,
> > +        };
> > +
> > +    case PROG_none:
> > +        BUILD_BUG_ON(PROG_none !=3D 0);
> > +
> > +    PROGRESS(tee):
> > +        ret =3D tee_domain_teardown(d);
> > +        if ( ret )
> > +            return ret;
> > +        break;
> > +
> > +    PROGRESS(done):
> > +        break;
> > +
> > +#undef PROGRESS
> > +
> > +    default:
> > +        BUG();
> > +    }
> > +
> >       return 0;
> >   }
> >
> > diff --git a/xen/arch/arm/include/asm/tee/tee.h b/xen/arch/arm/include/=
asm/tee/tee.h
> > index f483986385c8..da324467e130 100644
> > --- a/xen/arch/arm/include/asm/tee/tee.h
> > +++ b/xen/arch/arm/include/asm/tee/tee.h
> > @@ -34,6 +34,7 @@ struct tee_mediator_ops {
> >        * guest and create own structures for the new domain.
> >        */
> >       int (*domain_init)(struct domain *d);
> > +    int (*domain_teardown)(struct domain *d);
> >
> >       /*
> >        * Called during domain destruction to relinquish resources used
> > @@ -62,6 +63,7 @@ struct tee_mediator_desc {
> >
> >   bool tee_handle_call(struct cpu_user_regs *regs);
> >   int tee_domain_init(struct domain *d, uint16_t tee_type);
> > +int tee_domain_teardown(struct domain *d);
> >   int tee_relinquish_resources(struct domain *d);
> >   uint16_t tee_get_type(void);
> >
> > @@ -93,6 +95,11 @@ static inline int tee_relinquish_resources(struct do=
main *d)
> >       return 0;
> >   }
> >
> > +static inline int tee_domain_teardown(struct domain *d)
> > +{
> > +    return 0;
> > +}
> > +
> >   static inline uint16_t tee_get_type(void)
> >   {
> >       return XEN_DOMCTL_CONFIG_TEE_NONE;
> > diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
> > index 301d205a36c5..c91bd7d5ac25 100644
> > --- a/xen/arch/arm/tee/optee.c
> > +++ b/xen/arch/arm/tee/optee.c
> > @@ -268,6 +268,11 @@ static int optee_domain_init(struct domain *d)
> >       return 0;
> >   }
> >
> > +static int optee_domain_teardown(struct domain *d)
> > +{
> > +    return 0;
>
> I think for OP-TEE, we also need to moved the smc call to destroy the VM
> here. I am OK if this is not handled here, but it would be worth
> mentioning in the commit message.

Fair enough, I'll mention that in the commit message.

>
> > +}
> > +
> >   static uint64_t regpair_to_uint64(register_t reg0, register_t reg1)
> >   {
> >       return ((uint64_t)reg0 << 32) | (uint32_t)reg1;
> > @@ -1732,6 +1737,7 @@ static const struct tee_mediator_ops optee_ops =
=3D
> >   {
> >       .probe =3D optee_probe,
> >       .domain_init =3D optee_domain_init,
> > +    .domain_teardown =3D optee_domain_teardown,
> >       .relinquish_resources =3D optee_relinquish_resources,
> >       .handle_call =3D optee_handle_call,
> >   };
> > diff --git a/xen/arch/arm/tee/tee.c b/xen/arch/arm/tee/tee.c
> > index 3964a8a5cddf..ddd17506a9ff 100644
> > --- a/xen/arch/arm/tee/tee.c
> > +++ b/xen/arch/arm/tee/tee.c
> > @@ -52,6 +52,14 @@ int tee_domain_init(struct domain *d, uint16_t tee_t=
ype)
> >       return cur_mediator->ops->domain_init(d);
> >   }
> >
> > +int tee_domain_teardown(struct domain *d)
> > +{
> > +    if ( !cur_mediator )
> > +        return 0;
> > +
> > +    return cur_mediator->ops->domain_teardown(d);
>
> NIT: I would consider to check if the callback is NULL. This would avoid
> providing dummy helper.

Yes, that's an advantage, but we'd treat this callback differently
from others. I'd prefer to keep this as it is if you don't mind.

Thanks,
Jens

>
> > +}
> > +
> >   int tee_relinquish_resources(struct domain *d)
> >   {
> >       if ( !cur_mediator )
>
> Cheers,
>
> --
> Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 07:10:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 07:10:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562942.879743 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJqSW-0004A7-VR; Thu, 13 Jul 2023 07:09:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562942.879743; Thu, 13 Jul 2023 07:09:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJqSW-0004A0-Sn; Thu, 13 Jul 2023 07:09:52 +0000
Received: by outflank-mailman (input) for mailman id 562942;
 Thu, 13 Jul 2023 07:09:51 +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
 <SRS0=tMFS=C7=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qJqSV-00049s-Ia
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 07:09:51 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on2060f.outbound.protection.outlook.com
 [2a01:111:f400:7d00::60f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 40f6e422-214c-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 09:09:48 +0200 (CEST)
Received: from AS9PR06CA0161.eurprd06.prod.outlook.com (2603:10a6:20b:45c::11)
 by AM0PR08MB5490.eurprd08.prod.outlook.com (2603:10a6:208:184::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24; Thu, 13 Jul
 2023 07:09:46 +0000
Received: from AM7EUR03FT015.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:45c:cafe::6b) by AS9PR06CA0161.outlook.office365.com
 (2603:10a6:20b:45c::11) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24 via Frontend
 Transport; Thu, 13 Jul 2023 07:09:46 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT015.mail.protection.outlook.com (100.127.140.173) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.24 via Frontend Transport; Thu, 13 Jul 2023 07:09:45 +0000
Received: ("Tessian outbound f9124736ff4f:v145");
 Thu, 13 Jul 2023 07:09:45 +0000
Received: from bdfbac3fca67.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 E290C975-03E5-4E3C-A5D2-3A23CAC36550.1; 
 Thu, 13 Jul 2023 07:09:38 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id bdfbac3fca67.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 13 Jul 2023 07:09:38 +0000
Received: from AM6PR10CA0068.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:80::45)
 by DU2PR08MB9962.eurprd08.prod.outlook.com (2603:10a6:10:498::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24; Thu, 13 Jul
 2023 07:09:36 +0000
Received: from AM7EUR03FT004.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:209:80:cafe::8f) by AM6PR10CA0068.outlook.office365.com
 (2603:10a6:209:80::45) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24 via Frontend
 Transport; Thu, 13 Jul 2023 07:09:36 +0000
Received: from nebula.arm.com (40.67.248.234) by
 AM7EUR03FT004.mail.protection.outlook.com (100.127.140.210) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.22 via Frontend Transport; Thu, 13 Jul 2023 07:09:35 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com
 (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 13 Jul
 2023 07:09:34 +0000
Received: from [10.169.188.57] (10.169.188.57) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Thu, 13 Jul 2023 07:09:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 40f6e422-214c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=nTU4ZHlLMoF2IsWu3EkxBu5NQSzytA07Bng6us1O7H8=;
 b=lti6Hs9SDQ6+HRj0uUxTAyR0OKbZuVmTp+BGKsdCyVds88boi3NIsI4NXGNO4A6F73NWrULyRuV6C6r5Sd0levPgHdDCmDe9GgVMZxEYuWwM0A2ymj37uQkLEGDhKPf6bbaDRA3/yutbRxk5/eIP97SkfEs7ybOA+3hUmdLVTsg=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 7ac72dcd7b898748
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LtQzVcL1N/gATDi/1g05jn9oQ1byVKWScYujOgb0SoiLGpPvdFUGYR6NlsT7h5hQOHWkf05PzVvoaUtPrNYrZs3mJIuBL1krWIfMCKtrzv2ziao7Jj2ufwddw+rrcjdgE+Nqd/JMuU6qTJMMstAlPhavProJYwYQ+xMjAZ3w/3/4JPhG4GV16dmn7qYAthXw5ZLD9TpzubQiv1wsUo3kMqlDLVFlvsqQNfGeRYgRDVyBs4Zr2DwWNSTNQZVBUQQ9UT3GXhtnr09yh0zH2EoRZzkKSkAqGYQ8OFGJBmaO5j95SaZPtW0arlnEUH3QwknwgJ59uhy0d+dgMiVYLHjj5Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=nTU4ZHlLMoF2IsWu3EkxBu5NQSzytA07Bng6us1O7H8=;
 b=HUkena8i+MaJmJAnX6sFjJVRGq+MpVqKYp6V9Tns1FP9mSrOctyCIPAGb4g5+etj3SJ+MGIsJJ466HElfPrSWg98cdSGnZg5E6gtWHNSVRSC0Rz9Biv62IFUZ+rnko1zhj7nK5Kk4cCKM/JMw2sTZqATrtbuJG6JX667st78ykyfN+X7BtzUmLAS+WHIDXfCu34qzHHOCcAfETc8o8iXVRiTB7Ty2by6XMnQAZHcAiYerulC78xfCZMiacx5ezvLG6ljMjHi2SWnB5Vfov7oRuGXm636CSTsrMmXUQ5yBt/eVgs2T2/tAGwjYTzoCFGl0HBHuXLVH2A7BbvKUX7wAA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=amd.com smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=nTU4ZHlLMoF2IsWu3EkxBu5NQSzytA07Bng6us1O7H8=;
 b=lti6Hs9SDQ6+HRj0uUxTAyR0OKbZuVmTp+BGKsdCyVds88boi3NIsI4NXGNO4A6F73NWrULyRuV6C6r5Sd0levPgHdDCmDe9GgVMZxEYuWwM0A2ymj37uQkLEGDhKPf6bbaDRA3/yutbRxk5/eIP97SkfEs7ybOA+3hUmdLVTsg=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <9e0c03c5-3fcf-b9b2-f1ae-da04aae27e0a@arm.com>
Date: Thu, 13 Jul 2023 15:09:30 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 36/52] xen/mpu: implememt ioremap_xxx in MPU
Content-Language: en-US
To: Ayan Kumar Halder <ayankuma@amd.com>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-37-Penny.Zheng@arm.com>
 <60afd920-6fdb-5403-e096-57f86e4ed35e@amd.com>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <60afd920-6fdb-5403-e096-57f86e4ed35e@amd.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	AM7EUR03FT004:EE_|DU2PR08MB9962:EE_|AM7EUR03FT015:EE_|AM0PR08MB5490:EE_
X-MS-Office365-Filtering-Correlation-Id: a7ebeba0-c38c-4a0d-ff31-08db83702361
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 f/K6dJePZTiQ+BNLDD8g5q31cct71dST1qoifowIdCb2J/a6fZXikJOdge0R/P4LOEcdTDjbSin/IAkzpnrtZhiSGULutsO1/9FpGLQ/6lVua5X2rwiNq1pdCaj3MRkFSdUg9F0DmbpIwQQuzJKA9SH/0zQuKix3iW+ya9tmBwUr3LNyv22wtjFHsUH4SS33ryRwh5UwCuV17DlfMRgYKV8KvMZlkJBrjy6p+UVzKtI/XBokc34PDdRcxmSMzSDA1yLNvnWlStFopa3KLcmpc9qrsJpIETgSMsSFgJIj5YHF+4R6Q6XB7l1oWJUuFaWPixwQNZQFEw8No74eNDzdsXgIjhXfCKcxZ69fci1Q/DLEDvxI5UmGEJ7N3XdqnGNzc/2Su09OIXZ0Zw+pqjaPZJe4Pu+UlS9NDTO8Lsj20eUWO/9s8E/GP9i/ModogXY1S7FjPTq7cR9nSBefBghWT5b/V+auFEZ0+DEC9KKRpSG7Nxg1b4t45tD2XcaPkJFfx50Z3rXzRBesnKLpmHt6OmtHkzPx8zdgKBdrhj67wcaUXVjb0A+E4TLSl93qeAIl7KeTHFSMGzCRkYBYoXnixq9WnELVYj3MEKUvgHL/i96NCiGvKos5kGPbEJWyHkmAjYg2d/Vff1l9XeNdkcNxadbdJlrFAuS71l5ZgjiCGLceULX0eI0jHC3r2AzsdMoJ2OqvVRkWAjfr2ZlzkkJPkDM2NLtq7/wPhKTdWlH1a+6kUKM0MYOdb87MmfilSfw9BzAK8bYYKJS3tIGX4YmbkRdLF88G57499ZzG3QOjy/AinAZCAy7niDBFRvfxJB6r83fRbeWCoIZuGMEuuBVVwBrJxLfKSn72RrzECLgM+mo=
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(136003)(39860400002)(346002)(451199021)(40470700004)(46966006)(36840700001)(40460700003)(36860700001)(47076005)(186003)(53546011)(426003)(336012)(83380400001)(36756003)(2616005)(82310400005)(86362001)(31696002)(81166007)(356005)(82740400003)(40480700001)(26005)(41300700001)(4326008)(70586007)(70206006)(30864003)(2906002)(316002)(44832011)(31686004)(5660300002)(8936002)(8676002)(54906003)(110136005)(66899021)(478600001)(16576012)(21314003)(3940600001)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB9962
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT015.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	812e5975-6d24-42cf-3b3f-08db83701d96
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	gzpspmJ4FQ8h2TrFSMuJ1cmxHmpsMxindZDbhYvepUb4hwJGGmVCHAyAOSKKybUAwrpL7kpT8X1HUa3SvPYIVAhQsH3A9EYtj2rSf8nhmaa1CAOKyF9bN9pj0w/A9Yp3nycsOuf6OFdzk4qFj/Ee8KiiTH7cWiIQjFVG4I0oFW8O4QrWco35t2eKBsWLL26Sdhuu3o56SlhL3FKuY9NIX2GWf8KGO7HEQCxERYnvUd9vJH5pkLi9PbZiVKtJW6fgnj7Y8aw/aFZmwkj24BhoNoHY8EONVNC9dYtUONDv2i9VnGQ152I2fVxPiXmsGgP3bJ5bEVwf9Lpdr8NC2wduUt77IfCO5TcpVE19PjXwsM67xUSnl1IqUBVtwSrech3aY9fX1CU9bsdzAo8H3b8IGV+RcM5BummxybTMlRZGYvRhw5KkOcQT+Mg1cHpGCB2jekZqSrolnAYeF6THdyuez7iwhvvYU28LN/3gQH89yRbcvgPiwT/5/Vieo3V0lqIPkl8Onb4tb3loAi9zeYN4e9LFse5I5vkzZpB08wUyvGGbbsYexQsGU7FhJdwHQ1ueZLRpWjB/K3ejVvdszMxmnG7WMc4rW5TzSX2qOGMOt35yS4roa9YIZmtsfERKOTUlCsk8YSUgiVPMEq059OCWACK2ZidddHGFCvgYajRF2NJtVjp7al08SvEatQEzggWvpHPfrhmY4H+YArIhb/MyEwi9n+jM2HtfDRzzzHthWgNZP4FRw/acRVelWJ+HJWHedK2FszPcwpn/LTYpTKg/UM+cPyGYYwOhRUpTf4E3nsRXh2MvpmhtWCnXlHynoIlVK5UAn4RFp5CjWSPFy1ZYew==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(136003)(346002)(39860400002)(451199021)(46966006)(40470700004)(36840700001)(40460700003)(47076005)(336012)(426003)(26005)(53546011)(186003)(36860700001)(2616005)(83380400001)(70206006)(70586007)(4326008)(316002)(44832011)(8676002)(8936002)(41300700001)(5660300002)(2906002)(110136005)(16576012)(30864003)(478600001)(54906003)(40480700001)(82740400003)(81166007)(36756003)(82310400005)(86362001)(31696002)(31686004)(66899021)(3940600001)(21314003)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 07:09:45.5476
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: a7ebeba0-c38c-4a0d-ff31-08db83702361
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT015.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5490

Hi Ayan

On 2023/7/5 22:01, Ayan Kumar Halder wrote:
> Hi Penny,
> 
> On 26/06/2023 04:34, Penny Zheng wrote:
>> CAUTION: This message has originated from an External Source. Please 
>> use proper judgment and caution when opening attachments, clicking 
>> links, or responding to this email.
>>
>>
>> A set of function ioremap_xxx are designed to map deivce memory or
>> remap part of memory temporarily for short-time special purpose, like
>> using ioremap_wc to temporarily remap guest kernel non-cacheable, for
>> copying it to guest memory.
>>
>> As virtual translation is not supported in MPU, and we always follow the
>> rule of "map in demand" in MPU, we implement MPU version of ioremap_xxx,
>> through mapping the memory with a transient MPU memory region.
>>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> ---
>> v3:
>> - adapt to the new rule of "map in demand"
>> ---
>> Â  xen/arch/arm/include/asm/arm64/mpu.h |Â Â  4 +
>> Â  xen/arch/arm/include/asm/mm.hÂ Â Â Â Â Â Â  |Â Â  6 +
>> Â  xen/arch/arm/mpu/mm.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â  | 185 +++++++++++++++++++++++++++
>> Â  3 files changed, 195 insertions(+)
>>
>> diff --git a/xen/arch/arm/include/asm/arm64/mpu.h 
>> b/xen/arch/arm/include/asm/arm64/mpu.h
>> index aee7947223..c5e69f239a 100644
>> --- a/xen/arch/arm/include/asm/arm64/mpu.h
>> +++ b/xen/arch/arm/include/asm/arm64/mpu.h
>> @@ -121,6 +121,10 @@ static inline bool region_is_valid(pr_t *pr)
>> Â Â Â Â Â  return pr->prlar.reg.en;
>> Â  }
>>
>> +static inline bool region_is_transient(pr_t *pr)
>> +{
>> +Â Â Â  return pr->prlar.reg.tran;
>> +}
>> Â  #endif /* __ASSEMBLY__ */
>>
>> Â  #endif /* __ARM64_MPU_H__ */
>> diff --git a/xen/arch/arm/include/asm/mm.h 
>> b/xen/arch/arm/include/asm/mm.h
>> index cffbf8a595..0352182d99 100644
>> --- a/xen/arch/arm/include/asm/mm.h
>> +++ b/xen/arch/arm/include/asm/mm.h
>> @@ -227,6 +227,7 @@ void __iomem *ioremap_attr(paddr_t start, size_t 
>> len, unsigned int attributes);
>> Â  extern int map_staticmem_pages_to_xen(paddr_t start, paddr_t end);
>> Â  extern int unmap_staticmem_pages_to_xen(paddr_t start, paddr_t end);
>>
>> +#ifndef CONFIG_HAS_MPU
>> Â  static inline void __iomem *ioremap_nocache(paddr_t start, size_t len)
>> Â  {
>> Â Â Â Â Â  return ioremap_attr(start, len, PAGE_HYPERVISOR_NOCACHE);
>> @@ -241,6 +242,11 @@ static inline void __iomem *ioremap_wc(paddr_t 
>> start, size_t len)
>> Â  {
>> Â Â Â Â Â  return ioremap_attr(start, len, PAGE_HYPERVISOR_WC);
>> Â  }
>> +#else
>> +extern void __iomem *ioremap_nocache(paddr_t start, size_t len);
>> +extern void __iomem *ioremap_cache(paddr_t start, size_t len);
>> +extern void __iomem *ioremap_wc(paddr_t start, size_t len);
>> +#endif
>>
>> Â  /* XXX -- account for base */
>> Â  #define mfn_valid(mfn)        
>> ({Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  \
>> diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
>> index 9d5c1da39c..3bb1a5c7c4 100644
>> --- a/xen/arch/arm/mpu/mm.c
>> +++ b/xen/arch/arm/mpu/mm.c
>> @@ -624,6 +624,191 @@ int __init unmap_staticmem_pages_to_xen(paddr_t 
>> start, paddr_t end)
>> Â Â Â Â Â  return xen_mpumap_update(start, end, 0);
>> Â  }
>>
>> +/*
>> + * Check whether memory range [pa, pa + len) is mapped in Xen MPU
>> + * memory mapping table xen_mpumap.
>> + *
>> + * If it is mapped, the associated index will be returned.
>> + * If it is not mapped, INVALID_REGION_IDX will be returned.
>> + */
>> +static uint8_t is_mm_range_mapped(paddr_t pa, paddr_t len)
>> +{
>> +Â Â Â  int rc;
>> +Â Â Â  uint8_t idx;
>> +
>> +Â Â Â  rc = mpumap_contain_region(xen_mpumap, max_xen_mpumap, pa, pa + 
>> len - 1,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  &idx);
>> +Â Â Â  if ( (rc == MPUMAP_REGION_FOUND) || (rc == 
>> MPUMAP_REGION_INCLUSIVE) )
>> +Â Â Â Â Â Â Â  return idx;
>> +
>> +Â Â Â  if ( rc == MPUMAP_REGION_OVERLAP )
>> +Â Â Â Â Â Â Â Â  panic("mpu: can not deal with overlapped MPU memory region\n");
>> +Â Â Â  /* Not mapped */
>> +Â Â Â  return INVALID_REGION_IDX;
>> +}
>> +
>> +static bool is_mm_attr_match(pr_t *region, unsigned int attributes)
>> +{
>> +Â Â Â  if ( region->prbar.reg.ap != PAGE_AP_MASK(attributes) )
>> +Â Â Â  {
>> +Â Â Â Â Â Â Â  printk(XENLOG_WARNING "region permission is not matched (0x%x 
>> -> 0x%x)\n",
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â  region->prbar.reg.ap, PAGE_AP_MASK(attributes));
>> +Â Â Â Â Â Â Â  return false;
>> +Â Â Â  }
>> +
>> +Â Â Â  if ( region->prbar.reg.xn != PAGE_XN_MASK(attributes) )
>> +Â Â Â  {
>> +Â Â Â Â Â Â Â  printk(XENLOG_WARNING "region execution permission is not 
>> matched (0x%x -> 0x%x)\n",
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â  region->prbar.reg.xn, PAGE_XN_MASK(attributes));
>> +Â Â Â Â Â Â Â  return false;
>> +Â Â Â  }
>> +
>> +Â Â Â  if ( region->prlar.reg.ai != PAGE_AI_MASK(attributes) )
>> +Â Â Â  {
>> +Â Â Â Â Â Â Â  printk(XENLOG_WARNING "region memory attributes is not 
>> matched (0x%x -> 0x%x)\n",
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â  region->prlar.reg.ai, PAGE_AI_MASK(attributes));
>> +Â Â Â Â Â Â Â  return false;
>> +Â Â Â  }
>> +
>> +Â Â Â  return true;
>> +}
>> +
>> +/*
>> + * Check whether memory range [pa, pa + len) is mapped with memory
>> + * attributes #attr in Xen MPU memory mapping table xen_mpumap.
>> + *
>> + * If it is mapped but with different memory attributes, Errno -EINVAL
>> + * will be returned.
>> + * If it is not mapped at all, Errno -ENOENT will be returned.
>> + */
>> +static int is_mm_range_mapped_with_attr(paddr_t pa, paddr_t len,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned int attr)
>> +{
>> +Â Â Â  uint8_t idx;
>> +
>> +Â Â Â  idx = is_mm_range_mapped(pa, len);
>> +Â Â Â  if ( idx != INVALID_REGION_IDX )
>> +Â Â Â  {
>> +Â Â Â Â Â Â Â  pr_t *region;
>> +
>> +Â Â Â Â Â Â Â  region = &xen_mpumap[idx];
>> +Â Â Â Â Â Â Â  if ( !is_mm_attr_match(region, attr) )
>> +Â Â Â Â Â Â Â Â Â Â Â  return -EINVAL;
>> +
>> +Â Â Â Â Â Â Â  return 0;
>> +Â Â Â  }
>> +
>> +Â Â Â  return -ENOENT;
>> +}
>> +
>> +/*
>> + * map_mm_range shall work with unmap_mm_range to map a chunk
>> + * of memory with a transient MPU memory region for a period of short 
>> time.
>> + */
>> +static void *map_mm_range(paddr_t pa, size_t len, unsigned int 
>> attributes)
>> +{
>> +Â Â Â  if ( xen_mpumap_update(pa, pa + len, attributes | _PAGE_TRANSIENT) )
>> +Â Â Â Â Â Â Â  printk(XENLOG_ERR "Failed to map_mm_range 
>> 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â  pa, pa + len);
> Don't you want to return NULL or something from here ?

Right, I shall return NULL. Will fix.

>> +
>> +Â Â Â  return maddr_to_virt(pa);
>> +}
>> +
>> +static void unmap_mm_range(paddr_t pa)
>> +{
>> +Â Â Â  uint8_t idx;
>> +
>> +Â Â Â  /*
>> +Â Â Â Â  * The mapping size in map_mm_range is at least PAGE_SIZE.
>> +Â Â Â Â  * Find the MPU memory region mapped through map_mm_range, and 
>> associated
>> +Â Â Â Â  * idx will be returned.
>> +Â Â Â Â  */
>> +Â Â Â  idx = is_mm_range_mapped(pa, PAGE_SIZE);
>> +Â Â Â  if ( idx == INVALID_REGION_IDX )
>> +Â Â Â  {
>> +Â Â Â Â Â Â Â  printk(XENLOG_ERR "Failed to unmap_mm_range MPU memory region 
>> at 0x%"PRIpaddr"\n",
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â  pa);
>> +Â Â Â Â Â Â Â  return;
>> +Â Â Â  }
>> +
>> +Â Â Â  if ( !region_is_transient(&xen_mpumap[idx]) )
>> +Â Â Â  {
>> +Â Â Â Â Â Â Â  printk(XENLOG_WARNING "Failed to unmap MPU memory region at 
>> 0x%"PRIpaddr"\n, as it is not transient\n",
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â  pa);
>> +Â Â Â Â Â Â Â  return;
>> +Â Â Â  }
> 
> Does this mean you only allow unmapping of transient memory ?

For this function, yes.

> 
> So, is the non transient memory always expected to be mapped throughout 
> the lifetime of the system ?
> 

Maybe I should rename this pair helpers to 
map_mm_transient()/unmap_mm_transient() for better understanding.
For mapping memory with transient MPU region, we are suggesting to
use map_mm_transient()/unmap_mm_transient().

You could see that, in Xen, Functions like, ioremap_xxx()/iounmap(),
map_domain_page()/unmap_domain_page(), are always working as a pair
and showing up with each other nearby. "Transient" is referring to
this kind of senario.
So for "non-transient" memory, it is more pointing to the memory not
mapped from functions like ioremap_xxx() and map_domain_page(). We could
use xen_mpumap_update to do the mapping/unmapping for them.

>> +
>> +Â Â Â  /* Disable MPU memory region and clear the according entry in 
>> xen_mpumap */
>> +Â Â Â  control_mpu_region_from_index(idx, false);
>> +}
>> +
>> +/*
>> + * It works with "iounmap" as a pair to temporarily map a chunk of 
>> memory
>> + * with a transient MPU memory region, for short-time special accessing.
>> + */
>> +void *ioremap_attr(paddr_t pa, size_t len, unsigned int attributes)
>> +{
>> +Â Â Â  return map_mm_range(round_pgdown(pa), round_pgup(len), attributes);
>> +}
>> +
>> +/* ioremap_nocache is normally used to map device memory */
>> +void __iomem *ioremap_nocache(paddr_t start, size_t len)
>> +{
>> +Â Â Â  int rc;
> 
> For this function and others (ioremap_xxx()), don't we need to check if 
> the memory is transient ?
> 

Checking if the memory is transient should lay in unmapping function, 
like iounmap(). Since in function iounmap(), we shall only unmap the 
"transient" memory, memory that is mapped through ioremap_xxx().

The reason why I add checking is_mm_range_mapped_with_attr() here is 
that, in some corner cases, memory is already mapped as expected, there 
is no need to map again. In MMU, it is only a redundant mapping. 
However, in MPU, it could lead to failure of "Overlapping MPU memory 
region".

For example,
If earlyprintk is enabled, uart0 will be mapped at assembly by 
setup_early_uart(), see commit
"[PATCH v3 26/52] xen/mpu: map early uart when earlyprintk on".
Then later when we are doing uart initialization in pl011_uart_init(),
ioremap_nocache() will try to map it twice if there is no checking.

> - Ayan
> 
>> +
>> +Â Â Â  /* Check whether it is already mapped as device memory */
>> +Â Â Â  rc = is_mm_range_mapped_with_attr(start, len, 
>> PAGE_HYPERVISOR_NOCACHE);
>> +Â Â Â  if ( rc == -ENOENT )
>> +Â Â Â Â Â Â Â  return ioremap_attr(start, len, PAGE_HYPERVISOR_NOCACHE);
>> +Â Â Â  else if ( rc != 0 )
>> +Â Â Â Â Â Â Â  return NULL;
>> +
>> +Â Â Â  /* Already mapped */
>> +Â Â Â  return maddr_to_virt(start);
>> +}
>> +
>> +/*
>> + * ioremap_cache which is working with iounmap as a pair, is normally 
>> used to
>> + * map a chunck of cacheable memory temporarily for short-time 
>> special purpose.
>> + */
>> +void __iomem *ioremap_cache(paddr_t start, size_t len)
>> +{
>> +Â Â Â  int rc;
>> +
>> +Â Â Â  rc = is_mm_range_mapped_with_attr(start, len, PAGE_HYPERVISOR);
>> +Â Â Â  if ( rc == -ENOENT )
>> +Â Â Â Â Â Â Â  return ioremap_attr(start, len, PAGE_HYPERVISOR);
>> +Â Â Â  else if ( rc != 0 )
>> +Â Â Â Â Â Â Â  return NULL;
>> +
>> +Â Â Â  /* Already mapped */
>> +Â Â Â  return maddr_to_virt(start);
>> +}
>> +
>> +/*
>> + * ioremap_wc which is working with iounmap as a pair, is normally 
>> used to
>> + * map a chunck of non-cacheable memory temporarily for short-time 
>> special
>> + * purpose.
>> + */
>> +void __iomem *ioremap_wc(paddr_t start, size_t len)
>> +{
>> +Â Â Â  int rc;
>> +
>> +Â Â Â  rc = is_mm_range_mapped_with_attr(start, len, PAGE_HYPERVISOR_WC);
>> +Â Â Â  if ( rc == -ENOENT )
>> +Â Â Â Â Â Â Â  ioremap_attr(start, len, PAGE_HYPERVISOR_WC);
>> +Â Â Â  else if ( rc != 0 )
>> +Â Â Â Â Â Â Â  return NULL;
>> +
>> +Â Â Â  /* Already mapped */
>> +Â Â Â  return maddr_to_virt(start);
>> +}
>> +
>> +void iounmap(void __iomem *va)
>> +{
>> +Â Â Â  unmap_mm_range(virt_to_maddr(va));
>> +}
>> +
>> Â  /*
>> Â Â  * Local variables:
>> Â Â  * mode: C
>> -- 
>> 2.25.1
>>
>>


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 07:12:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 07:12:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562949.879760 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJqUx-0005gk-R8; Thu, 13 Jul 2023 07:12:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562949.879760; Thu, 13 Jul 2023 07:12:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJqUx-0005gT-MB; Thu, 13 Jul 2023 07:12:23 +0000
Received: by outflank-mailman (input) for mailman id 562949;
 Thu, 13 Jul 2023 07:12:23 +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
 <SRS0=3bWA=C7=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qJqUw-0005cv-T4
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 07:12:23 +0000
Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com
 [2607:f8b0:4864:20::f2f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9afe5934-214c-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 09:12:20 +0200 (CEST)
Received: by mail-qv1-xf2f.google.com with SMTP id
 6a1803df08f44-635ee3baa14so1602166d6.3
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 00:12:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9afe5934-214c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689232339; x=1691824339;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=sVBsFNcMcN27JVUrRBvthC7aYOWj6V0PgXOouSvKXOE=;
        b=GK1BYzD8ty/NfWzvyARbvTIhbsNmj7WFGCEkU68kR37gyteo3L8BO5ItxWXKwecX2q
         9OFB8fSYZiRq5CAXRE6Nls82daD8205qTTi5Oo5esr9fuG3zoPXhs7znVsUX9CtrobcD
         C5SOi8f/MlWnwCHhfCibcx62v6SBKMGjAqTNibtC4g+1TPj7Aez8fDDP0ACPZp80kRfl
         K/DHSFWbcHHJzJ/9Drqz8VG5+ft9HZI6gVQQ9EE9yFkPY7QFP9EWBHxdtUgxCFK2vbKy
         bXRwnENFwol/1xQS3s12abMBiAT52tq9iCU96HH+jzVLJG5w8ULmfWkE9xWSAVhkpS+T
         SYQw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689232339; x=1691824339;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=sVBsFNcMcN27JVUrRBvthC7aYOWj6V0PgXOouSvKXOE=;
        b=J4GFG0Jc5cEeh/f6k2wvB4mdnktOwU6SVTpMfE+06aFvKWYw3UWbE2YIIHC0OxRiVY
         CiHGtg6HuEYn6naqzJ2oTaTIKZA5EAnkVV/ZmThyMUeWQcMFIbdCQKdnxOWvQSKns8+n
         r5tyA7pAyUsUtAYYgsLtS6ALMaRCypmsp9d5lDxeaFVbw+YADQkh/q3I+8Pb3oahwmH0
         /4+piNN5Tc3NSqH6o/Kmf+/hBm6QqRt1+g2Qc/hSeK/SXo+S1YTlgy0XV1CVaBHDOrED
         SJjXoG1EOqBnM77YSEadjNCUf2THZSs/Zt2894YlbZ7Rtv0Tr3aVbNzlnyG0LlSp08E+
         +vpg==
X-Gm-Message-State: ABy/qLZGvWm8CxQdAVTli3vDej3MLx3YzgKc5DboiwmPufSH1CQtk71i
	MTaOL1nGPgR30vP+s7HysIXCI6vWa9tGO+yQut6hVA==
X-Google-Smtp-Source: APBJJlEZaXwb7tSVvkiDSu65OS9c1Vgu0Iq6WcVWZN6mYt6Rp1SU4I+kCJ5PyP9aebaRCMRskYL6UDUxOxl1QpBgV/A=
X-Received: by 2002:a0c:fca8:0:b0:635:e25d:7eff with SMTP id
 h8-20020a0cfca8000000b00635e25d7effmr477846qvq.6.1689232339061; Thu, 13 Jul
 2023 00:12:19 -0700 (PDT)
MIME-Version: 1.0
References: <20230705093433.2514898-1-jens.wiklander@linaro.org> <480AA225-0590-40BE-BCD5-ADCCB1BC2274@arm.com>
In-Reply-To: <480AA225-0590-40BE-BCD5-ADCCB1BC2274@arm.com>
From: Jens Wiklander <jens.wiklander@linaro.org>
Date: Thu, 13 Jul 2023 09:12:08 +0200
Message-ID: <CAHUa44FQotjOASHhUknwju20iOoFnub3erYOp+b_2+h=NCvv1A@mail.gmail.com>
Subject: Re: [XEN PATCH v9 00/24] Xen FF-A mediator
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, 
	Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>, 
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici <Marc.Bonnici@arm.com>, 
	Achin Gupta <Achin.Gupta@arm.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Bertrand,

On Wed, Jul 12, 2023 at 11:39=E2=80=AFAM Bertrand Marquis
<Bertrand.Marquis@arm.com> wrote:
>
> Hi Jens,
>
> > On 5 Jul 2023, at 11:34, Jens Wiklander <jens.wiklander@linaro.org> wro=
te:
> >
> > Hi,
> >
> > This patch sets add an FF-A [1] mediator to the TEE mediator framework
> > already present in Xen.  The FF-A mediator implements the subset of the
> > FF-A 1.1 specification needed to communicate with OP-TEE using FF-A as
> > transport mechanism instead of SMC/HVC as with the TEE mediator. It all=
ows
> > a similar design in OP-TEE as with the TEE mediator where OP-TEE presen=
ts
> > one virtual partition of itself to each guest in Xen.
> >
> > The FF-A mediator is generic in the sense it has nothing OP-TEE specifi=
c
> > except that only the subset needed for OP-TEE is implemented so far. Th=
e
> > hooks needed to inform OP-TEE that a guest is created or destroyed are =
part
> > of the FF-A specification.
> >
> > It should be possible to extend the FF-A mediator to implement a larger
> > portion of the FF-A 1.1 specification without breaking with the way OP-=
TEE
> > is communicated with here. So it should be possible to support any TEE =
or
> > Secure Partition using FF-A as transport with this mediator.
> >
> > The patches are also available at https://github.com/jenswi-linaro/xen
> > branch "xen_ffa_v9".
> >
> > With help from Bertrand I've integrated this in a test setup with OP-TE=
E.
> > Please check prerequisites at
> > https://optee.readthedocs.io/en/latest/building/prerequisites.html
> >
> > My setup is duplicated using:
> > repo init -u https://github.com/jenswi-linaro/manifest.git -m qemu_v8.x=
ml \
> >        -b qemu_xen_ffa
> > repo sync -j8
> > cd build
> > make -j8 toolchains
> > make -j8 all
> > make run-only
> >
> > Test in dom0 with for instance:
> > xtest 1004
> >
> > at the prompt.
> >
> > To start up a domu and connect to it do:
> > cd /mnt/host/build/qemu_v8/xen
> > xl create guest_ffa.cfg
> > xl console domu
> >
> > Then test as usual with "xtest 1004".
> >
> > The setup uses the branch "ffa" from https://github.com/jenswi-linaro/x=
en.
> > That's currently the same as the "xen_ffa_v9" branch, but the "ffa" bra=
nch
> > may change later as I update for a new version of the patch set.
> >
> > [1] https://developer.arm.com/documentation/den0077/latest
> >
> > Thanks,
> > Jens
> >
> > v8->v9:
> > * Patch "xen/arm: ffa: add remaining SMC function IDs"
> >  - mention the documentation number used
> >  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
> > * Patch "xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET"
> >  - Adding a reference to the documentation
> >  - Renaming FFA_PART_PROP_IS_MASK to FFA_PART_PROP_IS_TYPE_MASK
> >  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
> > * Patch "xen/arm: ffa: add defines for framework direct request/respons=
e messages"
> >  - add a reference to the documentation
> >  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
> > * Patch "docs: add Arm FF-A mediator"
> >  - Updating the wording as requested.
> >  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
> >  - Fixing a few typos and adding a reference to the code for a list of
> >    limitations
> > * Patch "xen/arm: ffa: list current limitations"
> >  - Fixing a couple of typos
> >  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
> >  - Removing an invalid limitation of FFA_RXTX_MAP_*
> > * Patch "xen/arm: ffa: add defines for sharing memory"
> >  - Fixing a few typos
> >  - Adding a reference to the documentation
> >  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
> >  - Updating FFA_MAX_SHM_PAGE_COUNT to have a safe margin to
> >    TEEC_CONFIG_SHAREDMEM_MAX_SIZE
> > * Patch "xen/arm: ffa: add direct request support"
> >  - Fixing a coding style issue
> >  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
> >  - Updating the TODO comment about features.
> > * Patch "xen/arm: ffa: send guest events to Secure Partitions"
> >  - Adding a TODO comment and a limit on the loop in ffa_direct_req_send=
_vm()
> > * Patch "xen/arm: ffa: support mapping guest RX/TX buffers"
> >  - Change FFA_MAX_RXTX_PAGE_COUNT to 1 with a TODO for a larger value
> >  - Replace !p2m_is_ram(t) test with t !=3D p2m_ram_rw
> >  - Rename the introduced field tx_is_free to tx_is_free
> > * Patch "xen/arm: ffa: support sharing memory"
> >  - Fixing read_atomic() issue in get_shm_pages()
> >  - Fixing style issue in free_ffa_shm_mem()
> >  - Replace !p2m_is_ram(t) test with t !=3D p2m_ram_rw in get_shm_pages(=
)
> > * Patch "tools: add Arm FF-A mediator"
> >  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
> >  - Adding Acked-by: Anthony PERARD <anthony.perard@citrix.com>
> >  - Moving the patch to just before the docs patch.
> > * Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com to:
> >  - "xen/arm: ffa: enforce dependency on 4k pages"
> >  - "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h=
"
> >  - "xen/arm: ffa: add ABI structs for sharing memory"
> > * Adding "xen: Introduce arch_domain_teardown()" by Andrew Cooper
> > * Adding "xen/arm: add TEE teardown to arch_domain_teardown()"
> >  based on a patch from Andrew Cooper
>
> It makes it easier for reviewers if you put the changelog per patch
> instead of having all of them in the cover letter.

OK. When I post the next version is it enough to document the v9->v10
changes in the affected patches?

Cheers,
Jens

>
> Cheers
> Bertrand
>
> >
> > v7->v8:
> > * Adding "xen/arm: ffa: list current limitations" as requested
> > * Adding tags to "xen/arm: smccc: add support for SMCCCv1.2 extended
> >  input/output registers"
> > * Patch "xen/arm: tee: add a primitive FF-A mediator":
> >  - Changing license for ffa.h and ffa.c to GPL-2.0-only
> >  - Avoiding IS_ENABLED() in the constant FFA_NR_FUNCS
> >  - Accepting version 1.1 SPMC only to keep things simple
> >  - Removes 32bit and only supports 64bit to keep things simple
> > * Patch "tools: add Arm FF-A mediator"
> >  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
> >  - Adding LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE_FFA for the "ffa" value
> >    in arch_arm.tee
> > * Patch "docs: add Arm FF-A mediator"
> >  - Fixing a spell error
> >  - Moving the patch last in the series
> > * Patch "xen/arm: ffa: add remaining SMC function IDs"
> >  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
> >  - Renaming the define FFA_MSG_RUN to FFA_RUN to match the specificatio=
n
> > * Patch "xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET"
> >  - Updating the comment describing the flags for FFA_PARTITION_INFO_GET
> > * Patch "xen/arm: ffa: add defines for framework direct request/respons=
e
> >  messages"
> >  - Updating the comment describing the flags for MSG_SEND_DIRECT_REQ/RE=
SP
> > * Patch "xen/arm: ffa: enforce dependency on 4k pages"
> >  - Updating title of patch
> >  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
> > * Patch "xen/arm: ffa: add support for FFA_ID_GET"
> >  - In ffa_domain_init(), check that domain_id isn't greater than
> >    UINT16_MAX to avoid a future potential integer overflow in get_vm_id=
()
> > * Patch "xen/arm: ffa: add direct request support"
> >  - Move preemption (interrupted) parts to a separate patch "xen/arm: ff=
a:
> >    support preemption of SP during direct request"
> >  - Remove loop in handle_msg_send_direct_req() to return eventual
> >    errors back to the VM instead of the SP.
> > * Patch "xen/arm: ffa: map SPMC rx/tx buffers"
> >  - Adding a FFA_RXTX_PAGE_COUNT define instead of using 1 directly
> > * New patch "xen/arm: ffa: support preemption of SP during direct reque=
st"
> > * Patch "xen/arm: ffa: send guest events to Secure Partitions"
> >  - Replacing unsigned int with uint16_t for subscr_vm_created_count and
> >    subscr_vm_destroyed_count plus the needed range check to see that
> >    they don't overflow.
> > * Patch "xen/arm: ffa: support mapping guest RX/TX buffers"
> >  - Limit the number of pages in VM RX/TX buffers to 32 using a new
> >    FFA_MAX_RXTX_PAGE_COUNT define.
> > * Patch "xen/arm: ffa: support guest FFA_PARTITION_INFO_GET"
> >  - Renaming tx_is_mine to rx_is_free as requested
> >  - Simplified the FFA_PARTITION_INFO_GET_COUNT_FLAG check in
> >    handle_partition_info_get()
> >  - Adding a comment on ownership of the RX buffer
> >  - Adding the patch "xen/arm: ffa: improve lock granularity" to address
> >    parts of the locking concerns.
> > * Patch "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to r=
egs.h"
> >  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
> > * Patch "xen/arm: ffa: add defines for sharing memory"
> >  - Fixing reference for FFA_NORMAL_MEM_REG_ATTR and FFA_MEM_ACC_RW
> >  - Updating descirption for FFA_MAX_SHM_PAGE_COUNT
> > * Patch "xen/arm: ffa: add ABI structs for sharing memory"
> >  - Changing name of the "global_handle" memeber in struct
> >    ffa_mem_transaction_* to "handle".
> > * Patch "xen/arm: ffa: support sharing memory"
> >  - Use FFA_MEM_SHARE_64 only since we changed to only suporting ARM_64.
> >  - Rename struct ffa_mem_transaction_x to struct ffa_mem_transaction_in=
t
> >    as requested.
> >  - Adding a check that shm->page_count isn't 0 before calling share_shm=
()
> >  - Masking return value from FFA_MEM_FRAG_RX to avoid an implic cast to
> >    the int32_t returned by ffa_mem_share().
> > * Patch "xen/arm: ffa: add support to reclaim shared memory"
> >  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
> > * Patch "xen/arm: ffa: support sharing large memory ranges"
> >  - Adding commetns for struct ffa_ctx
> >  - Cleaning up and removing the fragmentation state if handle_mem_frag_=
tx()
> >    detects an error.
> > * Adding "xen/arm: ffa: improve lock granularity" to address some of th=
e
> >  locking concerns.
> >
> > v6->v7:
> > * Split some of the larger patches into smaller patches for easier revi=
ew.
> >  For instance, the v6 patch "xen/arm: add a primitive FF-A mediator" ha=
s
> >  been replaced with:
> >  - "xen/arm: add a primitive FF-A mediator"
> >  - "tools: add Arm FF-A mediator"
> >  - "docs: add Arm FF-A mediator"
> >  - "xen/arm: ffa: add remaining SMC function IDs"
> > * Some small fixes in the error path for handle_mem_share()
> > * Switched to SPDX for license in new files.
> > * Fixed comment style issues in
> >  "xen/arm: smccc: add support for SMCCCv1.2 extended input/output regis=
ters"
> > * Made FFA support UNSUPPORTED in "xen/arm: add a primitive FF-A mediat=
or"
> > * Replaced ffa_get_call_count() with FFA_NR_FUNCS
> > * Update the FFA_MAX_SHM_PAGE_COUNT with a formula instead of a value.
> > * Replaced XEN_ARM_FLAGS_FFA with XEN_DOMCTL_CONFIG_TEE_FFA to minimize=
 impact
> >  on struct xen_arch_domainconfig. This works because the FF-A mediator =
and
> >  the OP-TEE mediator will not be used at the same time in by a guest.
> > * Replaced "ffa" boolean in the guest config with a new "ffa" value to =
the
> >  enumeration "tee_type".
> > * Integrated the FF-A mediator in the TEE mediator framework instead of
> >  being its own.
> > * Rebased on staging as of 2023-02-16
> >
> > v5->v6:
> > * Updated "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to=
 regs.h"
> >  commit message and moved the patch right before the patch which needs =
it.
> >  Applied Michal Orzel's R-B tag.
> > * Renamed the guest configuration option "ffa_enabled" to "ffa" and
> >  updated the description.
> > * More tools update in "xen/arm: add a primitive FF-A mediator" with th=
e "ffa"
> >  option, including golang and ocaml.
> > * Update ffa_domain_init() to return an error if communication with
> >  the SPMC can't be established.
> > * Factored out a ffa_domain_destroy() from ffa_relinquish_resources().
> > * Added ffa_get_call_count() to give an accurate number of FF-A functio=
n,
> >  updated in each patch as new FF-A functions are added.
> > * Added a flags field in struct xen_arch_domainconfig that replaces the
> >  ffa_enabled field.
> > * Made check_mandatory_feature() __init
> > * Replaced a few printk() calls with gprintk() where needed.
> > * Rebased on staging as of 2022-09-14
> >
> > V4->v5:
> > * Added "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to r=
egs.h"
> > * Added documentation for the "ffa_enabled" guest config flag
> > * Changed to GPL license for xen/arch/arm/ffa.c
> > * Added __read_mostly and const where applicable
> > * Added more describing comments in the code
> > * Moved list of shared memory object ("ffa_mem_list") into the guest co=
ntext
> >  as they are guest specific
> > * Simplified a few of the simple wrapper functions for SMC to SPMC
> > * Added a BUILD_BUG_ON(PAGE_SIZE !=3D FFA_PAGE_SIZE) since the mediator
> >  currently depends on the page size to be same as FFA_PAGE_SIZE (4k).
> > * Added max number of shared memory object per guest and max number of
> >  size of each shared memory object
> > * Added helper macros to calculate offsets of different FF-A data struc=
tures
> >  in the communication buffer instead of relying on pointer arithmetic
> > * Addressed style issues and other comments
> > * Broke the commit "xen/arm: add FF-A mediator" into multiple parts, tr=
ying
> >  to add a few features at a time as requested
> > * Added a missing call to rxtx_unmap() in ffa_relinquish_resources()
> > * Assignment of "ffa_enabled" is kept as is until I have something defi=
nitive
> >  on the type etc.
> > * Tested with CONFIG_DEBUG=3Dy
> >
> > v3->v4:
> > * Missed v3 and sent a v4 instead by mistake.
> >
> > v2->v3:
> > * Generates offsets into struct arm_smccc_1_2_regs with asm-offsets.c i=
n
> >  order to avoid hard coded offsets in the assembly function
> >  arm_smccc_1_2_smc()
> > * Adds an entry in SUPPORT.md on the FF-A status
> > * Adds a configuration variable "ffa_enabled" to tell if FF-A should be
> >  enabled for a particular domu guest
> > * Moves the ffa_frag_list for fragmented memory share requests into
> >  struct ffa_ctx instead to keep it per guest in order to avoid mixups
> >  and simplify locking
> > * Adds a spinlock to struct ffa_ctx for per guest locking
> > * Addressing style issues and suggestions
> > * Uses FFA_FEATURES to check that all the needed features are available
> >  before initializing the mediator
> > * Rebased on staging as of 2022-06-20
> >
> > v1->v2:
> > * Rebased on staging to resolve some merge conflicts as requested
> >
> > Andrew Cooper (1):
> >  xen: Introduce arch_domain_teardown()
> >
> > Jens Wiklander (23):
> >  xen/arm: add TEE teardown to arch_domain_teardown()
> >  xen/arm: smccc: add support for SMCCCv1.2 extended input/output
> >    registers
> >  xen/arm: tee: add a primitive FF-A mediator
> >  xen/arm: ffa: add remaining SMC function IDs
> >  xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET
> >  xen/arm: ffa: add defines for framework direct request/response
> >    messages
> >  xen/arm: ffa: enforce dependency on 4k pages
> >  xen/arm: ffa: add support for FFA_ID_GET
> >  xen/arm: ffa: add direct request support
> >  xen/arm: ffa: map SPMC rx/tx buffers
> >  xen/arm: ffa: send guest events to Secure Partitions
> >  xen/arm: ffa: support mapping guest RX/TX buffers
> >  xen/arm: ffa: support guest FFA_PARTITION_INFO_GET
> >  xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h
> >  xen/arm: ffa: add defines for sharing memory
> >  xen/arm: ffa: add ABI structs for sharing memory
> >  xen/arm: ffa: support sharing memory
> >  xen/arm: ffa: add support to reclaim shared memory
> >  xen/arm: ffa: support sharing large memory ranges
> >  xen/arm: ffa: improve lock granularity
> >  xen/arm: ffa: list current limitations
> >  tools: add Arm FF-A mediator
> >  docs: add Arm FF-A mediator
> >
> > SUPPORT.md                         |    9 +
> > docs/man/xl.cfg.5.pod.in           |   15 +
> > tools/include/libxl.h              |    5 +
> > tools/libs/light/libxl_arm.c       |    3 +
> > tools/libs/light/libxl_types.idl   |    3 +-
> > xen/arch/arm/arm64/asm-offsets.c   |    9 +
> > xen/arch/arm/arm64/smc.S           |   42 +
> > xen/arch/arm/domain.c              |   41 +
> > xen/arch/arm/include/asm/psci.h    |    4 +
> > xen/arch/arm/include/asm/regs.h    |   12 +
> > xen/arch/arm/include/asm/smccc.h   |   40 +
> > xen/arch/arm/include/asm/tee/ffa.h |   35 +
> > xen/arch/arm/include/asm/tee/tee.h |    7 +
> > xen/arch/arm/tee/Kconfig           |   11 +
> > xen/arch/arm/tee/Makefile          |    1 +
> > xen/arch/arm/tee/ffa.c             | 1988 ++++++++++++++++++++++++++++
> > xen/arch/arm/tee/optee.c           |   11 +-
> > xen/arch/arm/tee/tee.c             |    8 +
> > xen/arch/arm/vsmc.c                |   19 +-
> > xen/arch/x86/domain.c              |    5 +
> > xen/common/domain.c                |    6 +
> > xen/include/public/arch-arm.h      |    1 +
> > xen/include/xen/domain.h           |    1 +
> > xen/include/xen/sched.h            |    1 +
> > 24 files changed, 2264 insertions(+), 13 deletions(-)
> > create mode 100644 xen/arch/arm/include/asm/tee/ffa.h
> > create mode 100644 xen/arch/arm/tee/ffa.c
> >
> > --
> > 2.34.1
> >
>


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 07:12:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 07:12:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562948.879754 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJqUx-0005dD-II; Thu, 13 Jul 2023 07:12:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562948.879754; Thu, 13 Jul 2023 07:12:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJqUx-0005d6-Du; Thu, 13 Jul 2023 07:12:23 +0000
Received: by outflank-mailman (input) for mailman id 562948;
 Thu, 13 Jul 2023 07:12:21 +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
 <SRS0=tMFS=C7=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qJqUv-0005cv-Nh
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 07:12:21 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20612.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::612])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9ace6f27-214c-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 09:12:19 +0200 (CEST)
Received: from AM6P191CA0050.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:7f::27)
 by DBBPR08MB6202.eurprd08.prod.outlook.com (2603:10a6:10:209::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Thu, 13 Jul
 2023 07:12:17 +0000
Received: from AM7EUR03FT018.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:209:7f:cafe::f8) by AM6P191CA0050.outlook.office365.com
 (2603:10a6:209:7f::27) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24 via Frontend
 Transport; Thu, 13 Jul 2023 07:12:17 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT018.mail.protection.outlook.com (100.127.140.97) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.24 via Frontend Transport; Thu, 13 Jul 2023 07:12:17 +0000
Received: ("Tessian outbound d7adc65d10b4:v145");
 Thu, 13 Jul 2023 07:12:16 +0000
Received: from 2fb59f65bb23.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 A0B61F6C-D9D7-46A1-94F1-22B362CEA5D1.1; 
 Thu, 13 Jul 2023 07:12:10 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2fb59f65bb23.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 13 Jul 2023 07:12:10 +0000
Received: from DUZPR01CA0190.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4b6::8) by DU2PR08MB9992.eurprd08.prod.outlook.com
 (2603:10a6:10:490::11) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Thu, 13 Jul
 2023 07:12:08 +0000
Received: from DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4b6:cafe::f3) by DUZPR01CA0190.outlook.office365.com
 (2603:10a6:10:4b6::8) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24 via Frontend
 Transport; Thu, 13 Jul 2023 07:12:08 +0000
Received: from nebula.arm.com (40.67.248.234) by
 DBAEUR03FT008.mail.protection.outlook.com (100.127.142.107) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.24 via Frontend Transport; Thu, 13 Jul 2023 07:12:08 +0000
Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX04.Arm.com
 (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 13 Jul
 2023 07:12:07 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com
 (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 13 Jul
 2023 07:12:07 +0000
Received: from [10.169.188.57] (10.169.188.57) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Thu, 13 Jul 2023 07:12:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9ace6f27-214c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ZkHhjTevpnhLye27oEukpTeduPg1rrsSkUOQlq7+S0g=;
 b=B7/zN1zSwNFxb/Zgr929AxuZ/rw+PjdiYmN5+FVLiGu12XItWq9CZXFstLbHA4mHej3p/1SRli0NXGYyMAK8cjGogTyBNBEA7ET7v3DnM86K3tqnkFuF6VZJb4B4Qx29K9fHsGoxl05UYOAJwK5Japej1QHo5PnFcAdwjFS5Y2U=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 5c3c62947ecf76e7
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=IP96VE1nKTgfyDp13JEfyONOYo1oLVRLs+BeYmVtO7FaB/gjR/32MTAhlNpY6vtk/C7dlLQMiJe1O4BBV8RiiAaZTuNcQld/RNzK5vnmHP6gEH/hRjBNN3ZZdsBwGQFDv3ON9J40e0MrS6oTsHOqQdbb/7TRnYWPHRwFvkkAm+I9SOr7bjNOX9+xPgJsLndvKKFm8eCLn8SQA2sfm/cYtqaJmfHcSOc/xspXUmNL7np29KkDBMZfP2gIpfbMElRywNJsxFwZ4zIwqkpX/TVCo7zPdcoW4/g7Syx1+WUQSZDuR35AGDmlnIgSsJvHoQqV6sUDOtkY9eojpk3xysP8FQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ZkHhjTevpnhLye27oEukpTeduPg1rrsSkUOQlq7+S0g=;
 b=BuFzmfDkbjLF1oMvGcL9G5aAEyWnagsUK+tVimCMcNQC78o9oFghGaEKYIlugy8azMtNtC+s0Uo09Ta5uywuPMbXG5AL3H8Z3OzHjJvJQauIouK1KqlHQPTow2jZfCLgZCALlXTEVElyAc2DTJT3gDseK7UZu8rYFm97BLatnxJMpmX5Z53eZ79g/OgOZc0/0TDcPah2vvYlrN0jX4zrZC4XuvxIH1CZw4xQVMfa4QU9YODbvZXSFyAk43lQ4PrvDSvmrMPxbNGcarv1klAbJmrTlkOJtVjFxOdU+E/dRpGomhapY3TfAmjNNIG+5BfTe6uqCiIS/GoQbaRWYkOmCw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=amd.com smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ZkHhjTevpnhLye27oEukpTeduPg1rrsSkUOQlq7+S0g=;
 b=B7/zN1zSwNFxb/Zgr929AxuZ/rw+PjdiYmN5+FVLiGu12XItWq9CZXFstLbHA4mHej3p/1SRli0NXGYyMAK8cjGogTyBNBEA7ET7v3DnM86K3tqnkFuF6VZJb4B4Qx29K9fHsGoxl05UYOAJwK5Japej1QHo5PnFcAdwjFS5Y2U=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <231ccdf4-df8a-6946-9a31-a7ee0795cc41@arm.com>
Date: Thu, 13 Jul 2023 15:12:03 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 43/52] xen/mpu: configure VSTCR_EL2 in MPU system
Content-Language: en-US
To: Ayan Kumar Halder <ayankuma@amd.com>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-44-Penny.Zheng@arm.com>
 <040d7ea3-aeaf-62ea-5561-81e283f2185c@amd.com>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <040d7ea3-aeaf-62ea-5561-81e283f2185c@amd.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	DBAEUR03FT008:EE_|DU2PR08MB9992:EE_|AM7EUR03FT018:EE_|DBBPR08MB6202:EE_
X-MS-Office365-Filtering-Correlation-Id: fbfdf6c4-a023-499f-549d-08db83707dab
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 ER14wydO7pUyKtlk1tIILJ8/N9+n8tXHb4DGin0SI3GfrFClvJgR2O8j/LTTA7qE4tvObxE3Vy9NrFzocHuiV4churvr7ppWpzp2ERQjT9Y4S9HpjktfgtSSLVf+R8mkTyB1cNO+yqTPii2QH55zrUtgzg1TYDdP4vQdNwmhZe+5VEswOrxDa8hhjAvqIz6g+26+tL+e//4NzbuqyDYv+7xQvRmFQyR1GNaQnEIfk9kQ0Ov1rc7KbB2ee09E6xQchzREy0JJcWCZN8yF0ou8/RbCHQul9xTtMLqaF1JJGaWBPY/UkyCfw2eppB5jiki5Db8QtroJRR1jM6cVWNsIwL+VbzWuXxsOjSftF6rVui5E8Jexla9xLXudUASqwZiospOu0ew5lmyCc7qCXqQzC50/wWxgSV/uDvx+Sf0UTgnIFOCtmQU4oA+ubRQpwFnEGLrFqOBjvsjd6JQ0wA32ogum5mpYtoNS5tgvuV/kyau5ZpZGx2TTICnt36zLu1j3oq2Qb8/+wbsvaJ67hmbPjZBZGIIQFg7WVWDgzJ6Ps8cV9A7DgA5WK+x/TAS8v4fKwt+6HmNWtbdsJcMptDQw88vzouzk51nVkg+Glp+Wztn3kvJFJU7lkFu/B35NpuM0DsRNR5h9F4HFKH5Nph94LG5fOKVv4fQCUZp53uvGM8x40aO00jdKn4RHGMxoyug/kzp3z+SXoGxzHgOEa9Hjkg/ft0w6mRe+3WT/lQYm3h7FE7rnls82rWbSNmXlK5o1sdRmXFzMaDJ0jL5qoIsdl+qo3Qc64qbKig+IfAGm3Ve8Q4b0iX3PwwwY3PorfE96ii8QJWXFMkAvwtuNBw7ljg==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(396003)(39860400002)(136003)(451199021)(46966006)(40470700004)(36840700001)(186003)(26005)(53546011)(41300700001)(336012)(36860700001)(426003)(47076005)(83380400001)(2616005)(31686004)(82740400003)(40460700003)(478600001)(356005)(54906003)(81166007)(110136005)(4326008)(70586007)(44832011)(70206006)(40480700001)(16576012)(316002)(82310400005)(31696002)(8676002)(86362001)(8936002)(5660300002)(36756003)(2906002)(3940600001)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB9992
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT018.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	2f0bf4ab-0960-4bb7-8376-08db8370787e
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	41x82RZCQXat5o9tvZWjjHULqTWuo39MCuTL/9UVZI+JQqsYF1rHyfLgqE4eB2ZRgDbHICslqVw0k98cwd73w983lX+R+f7nUMJ2Tcu7vtnx6gCUFa15v9JalVtKERgGdE3GqqFWvHsR6A03bLymOCPfX0JZ0CBSroNRQtWTaniHkFKGaqJpXzpIlYOz3OaZcKdb2hTUl1KSAPgzmKvPrUf5sA/02SloUSI2VUCHfqvqB+g99FMnJeVJi+aZwqEcreEOnKbuvVYP7zKsK9lqMkozWB9IfQUeMztJKACvk8ZIPmUTuyTR5z9gYgfSVengQ4IeIp/5Tps8VVqEFfWMHxX+HWnNTXDib0xw48wlFuLlsgaX9a524xediVz8PVEC00rt+6BNPSDUg/Pfpu9B1AIGCzuEgx6Nxed2D/4zamaZtlyROaYFp5B/bKLSiL0781JQr8qQ9yiu8Dd1H9YDJQt6Nv/trn7IO6Jty4uge3UGeMTOWo8L5DB2N7pwWtp/0Hq7ON+35uPAzie1ioi6PNPEPZg4IOz+OW8Z1FxfcVOnD2OaJarE2ZU1LA+f0Aubf+fSVXojZvGwJRChopKaweZkAS30pPgtwAZuypwX5mWrxb9CJKBdPNnXh921aRguj5WdoQMVnyPjWmz0srVpg/DLlwVAcIeZidJZHTowtBeeE7W1YMvSHsgG/IwIEzRi5d8vXZJsoSpyzXkB8AXQOi6PIyMznW0fI6VaUbt8tcLyXfZLoz0c7M9aEOl3Y3beuRGKtwpsfVapEEtYNGeSKnumVk+UOqelhHjMBVfOyow=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(396003)(136003)(376002)(451199021)(40470700004)(46966006)(36840700001)(44832011)(70206006)(4326008)(70586007)(316002)(2906002)(41300700001)(31686004)(478600001)(8936002)(5660300002)(8676002)(16576012)(110136005)(54906003)(36860700001)(40460700003)(40480700001)(426003)(186003)(36756003)(336012)(83380400001)(47076005)(53546011)(26005)(86362001)(31696002)(82310400005)(81166007)(2616005)(82740400003)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 07:12:17.0388
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: fbfdf6c4-a023-499f-549d-08db83707dab
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT018.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6202

Hi Ayan

On 2023/7/5 22:21, Ayan Kumar Halder wrote:
> 
> On 26/06/2023 04:34, Penny Zheng wrote:
>> CAUTION: This message has originated from an External Source. Please 
>> use proper judgment and caution when opening attachments, clicking 
>> links, or responding to this email.
>>
>>
>> VSTCR_EL2, Virtualization Secure Translation Control Registerï¼Œis
>> the control register for stage 2 of the Secure EL1&0 translation regime.
>>
>> VSTCR_EL2.SA defines secure stage 2 translation output address space.
>> To make sure that all stage 2 translations for the Secure PA space
>> access the Secure PA space, we keep SA bit as 0.
>> VSTCR_EL2.SC is NS check enable bit.
>> To make sure that Stage 2 NS configuration is checked against stage 1
>> NS configuration in EL1&0 translation regime for the given address, and
>> generates a fault if they are different, we set SC bit 1.
>>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> ---
>> v3:
>> - new commit
>> ---
>> Â  xen/arch/arm/include/asm/arm64/sysregs.h |Â  6 ++++++
>> Â  xen/arch/arm/mpu/p2m.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  | 17 ++++++++++++++++-
>> Â  2 files changed, 22 insertions(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/include/asm/arm64/sysregs.h 
>> b/xen/arch/arm/include/asm/arm64/sysregs.h
>> index ab0e6a97d3..35d7da411d 100644
>> --- a/xen/arch/arm/include/asm/arm64/sysregs.h
>> +++ b/xen/arch/arm/include/asm/arm64/sysregs.h
>> @@ -512,6 +512,12 @@
>> Â  /* MPU Protection Region Enable Register encode */
>> Â  #define PRENR_EL2Â Â  S3_4_C6_C1_1
>>
>> +/* Virtualization Secure Translation Control Register */
>> +#define VSTCR_EL2Â Â Â Â Â Â Â Â Â Â Â  S3_4_C2_C6_2
>> +#define VSTCR_EL2_RES1_SHIFT 31
>> +#define VSTCR_EL2_SAÂ Â Â Â Â Â Â Â  ~(_AC(0x1,UL)<<30)
>> +#define VSTCR_EL2_SCÂ Â Â Â Â Â Â Â  (_AC(0x1,UL)<<20)
>> +
>> Â  #endif
>>
>> Â  #ifdef CONFIG_ARM_SECURE_STATE
>> diff --git a/xen/arch/arm/mpu/p2m.c b/xen/arch/arm/mpu/p2m.c
>> index 04c44825cb..a7a3912a9a 100644
>> --- a/xen/arch/arm/mpu/p2m.c
>> +++ b/xen/arch/arm/mpu/p2m.c
>> @@ -10,7 +10,7 @@
>>
>> Â  void __init setup_virt_paging(void)
>> Â  {
>> -Â Â Â  uint64_t val = 0;
>> +Â Â Â  uint64_t val = 0, val2 = 0;
>> Â Â Â Â Â  bool p2m_vmsa = true;
>>
>> Â Â Â Â Â  /* PA size */
>> @@ -76,6 +76,21 @@ void __init setup_virt_paging(void)
>>
>> Â Â Â Â Â  WRITE_SYSREG(val, VTCR_EL2);
> #ifdef CONFIG_ARM_64
>>
>> +Â Â Â  /*
>> +Â Â Â Â  * VSTCR_EL2.SA defines secure stage 2 translation output address 
>> space.
>> +Â Â Â Â  * To make sure that all stage 2 translations for the Secure PA 
>> space
>> +Â Â Â Â  * access the Secure PA space, we keep SA bit as 0.
>> +Â Â Â Â  *
>> +Â Â Â Â  * VSTCR_EL2.SC is NS check enable bit.
>> +Â Â Â Â  * To make sure that Stage 2 NS configuration is checked against 
>> stage 1
>> +Â Â Â Â  * NS configuration in EL1&0 translation regime for the given 
>> address, and
>> +Â Â Â Â  * generates a fault if they are different, we set SC bit 1.
>> +Â Â Â Â  */
>> +Â Â Â  val2 = 1 << VSTCR_EL2_RES1_SHIFT;
>> +Â Â Â  val2 &= VSTCR_EL2_SA;
>> +Â Â Â  val2 |= VSTCR_EL2_SC;
>> +Â Â Â  WRITE_SYSREG(val2, VSTCR_EL2);
> #endif

Understood, will fix.

>> +
>> Â Â Â Â Â  return;
>>
>> Â  fault:
>> -- 
>> 2.25.1
>>
>>


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 07:17:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 07:17:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562957.879774 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJqZS-0006qp-EY; Thu, 13 Jul 2023 07:17:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562957.879774; Thu, 13 Jul 2023 07:17:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJqZS-0006qi-Bg; Thu, 13 Jul 2023 07:17:02 +0000
Received: by outflank-mailman (input) for mailman id 562957;
 Thu, 13 Jul 2023 07:17:01 +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
 <SRS0=tMFS=C7=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qJqZR-0006qM-9u
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 07:17:01 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2089.outbound.protection.outlook.com [40.107.13.89])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4178a50e-214d-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 09:16:59 +0200 (CEST)
Received: from DUZPR01CA0199.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4b6::28) by DB8PR08MB5340.eurprd08.prod.outlook.com
 (2603:10a6:10:11c::14) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Thu, 13 Jul
 2023 07:16:29 +0000
Received: from DBAEUR03FT048.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4b6:cafe::a0) by DUZPR01CA0199.outlook.office365.com
 (2603:10a6:10:4b6::28) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24 via Frontend
 Transport; Thu, 13 Jul 2023 07:16:29 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT048.mail.protection.outlook.com (100.127.142.200) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.24 via Frontend Transport; Thu, 13 Jul 2023 07:16:29 +0000
Received: ("Tessian outbound e1fdbe8a48d3:v145");
 Thu, 13 Jul 2023 07:16:29 +0000
Received: from ff7fe6a1eec3.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 BC09B89D-1B83-4D68-836C-AFB1724E987E.1; 
 Thu, 13 Jul 2023 07:16:22 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ff7fe6a1eec3.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 13 Jul 2023 07:16:22 +0000
Received: from AM0PR10CA0046.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:150::26)
 by VI1PR08MB10102.eurprd08.prod.outlook.com (2603:10a6:800:1cf::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.36; Thu, 13 Jul
 2023 07:16:15 +0000
Received: from AM7EUR03FT042.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:150:cafe::85) by AM0PR10CA0046.outlook.office365.com
 (2603:10a6:20b:150::26) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24 via Frontend
 Transport; Thu, 13 Jul 2023 07:16:15 +0000
Received: from nebula.arm.com (40.67.248.234) by
 AM7EUR03FT042.mail.protection.outlook.com (100.127.140.209) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.24 via Frontend Transport; Thu, 13 Jul 2023 07:16:14 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com
 (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 13 Jul
 2023 07:16:13 +0000
Received: from [10.169.188.57] (10.169.188.57) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Thu, 13 Jul 2023 07:16:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4178a50e-214d-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=oymRyCwfeCV/d39Of32f4qMPRSzv2CrD7IDJ53f++YA=;
 b=W+rQvUq7UGzrNqxzVmD5O1zjLFRADmcmPrwmcoIk5efFHIqH59mJyrCwBLOJAsHz1CUVKkmW9uGceqoo5XoF10eewszPUP0CMtdVchmNDjJes07YPthjfl0WLUtwP3HWH5MyMMVsxJnbyRRiyzR1kBK1Zy71Z0N+i0FSzWjBdLg=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 2912640809e4b62c
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=jxP6mrVm3d4NQfzBTpNu7bUsgL3e37bPDOCfoau6TIiWGV4ebsfIwwtFz+N68pkwyz74ZXJvDLC/WIkv22kK0UF1P6ua4NgFKl4RFVvT5ORw0VaGC+xCae6fGtPL66AhGHUrKlu5NfXc7l4/EHc50CpN6VjAnwjEo5tUWkCgPrcCU4NuDT3FzU9vgVxTYa9YvO9N0XcTNiH94qxMdXpwxnq+NGoU51YQShJp3lxv5eL51s/V7PBfsmZ1124DTp8FQrR1tvVE8vRzfwil0/LEsaRdRxUZFAyT+ipKzWkX6V1ocjFh2njIOgJrbkJbCLMgs1KHBt3fMgKIYsYgloYs8w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=oymRyCwfeCV/d39Of32f4qMPRSzv2CrD7IDJ53f++YA=;
 b=lPP5dqd+WFuA98d61ELGSbQiesHLBswzX3KotRYFg2NOAIeL5ohbrlhU6bPLq03YiZMy2zpiqxRKLQ/4VfxxHVMTBoTIKIp6el5uY8BrUeZBrGvX86iYSvLrbZsKhJpJ1h/XROBDoMOKHlkKpw+phb4KhcEt2D87L9uvjx1w8xzVJ6pt9WFgO3aNTgcdcXArmx8rWKFZk62ph+ta/Ia+y+HDxLTc5l5xO7PiIACwIR9iJwLx1VnZa0XwI9joDZDOyHtZnoJfDm7HogNe7jbnPK6TCPIZuQ6u3g9Kq/fPViYHP6Ecr9CMdymC4ZJOZ6qrB3wHXTpOG20TgzhxXjqwIQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=oymRyCwfeCV/d39Of32f4qMPRSzv2CrD7IDJ53f++YA=;
 b=W+rQvUq7UGzrNqxzVmD5O1zjLFRADmcmPrwmcoIk5efFHIqH59mJyrCwBLOJAsHz1CUVKkmW9uGceqoo5XoF10eewszPUP0CMtdVchmNDjJes07YPthjfl0WLUtwP3HWH5MyMMVsxJnbyRRiyzR1kBK1Zy71Z0N+i0FSzWjBdLg=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <532695f6-639c-5993-d0d0-95b3305f9c62@arm.com>
Date: Thu, 13 Jul 2023 15:16:09 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 33/52] xen/mpu: initialize frametable in MPU system
Content-Language: en-US
To: Julien Grall <julien@xen.org>, Ayan Kumar Halder <ayankuma@amd.com>,
	<xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-34-Penny.Zheng@arm.com>
 <ee709651-a6fc-2485-ae2b-edf0306fbc13@amd.com>
 <db707ef1-cc91-bc7d-33d2-bf804ece2226@arm.com>
 <15791f2e-b4cf-aa60-3f67-d9e74877e54b@xen.org>
 <63c58ce7-08c0-e86c-acec-9273f48cdc12@arm.com>
 <3114b76e-1cf9-12ef-d83c-76c566009e71@xen.org>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <3114b76e-1cf9-12ef-d83c-76c566009e71@xen.org>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	AM7EUR03FT042:EE_|VI1PR08MB10102:EE_|DBAEUR03FT048:EE_|DB8PR08MB5340:EE_
X-MS-Office365-Filtering-Correlation-Id: 81a3ad3e-e4c5-453a-b211-08db837113ea
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 nkbznO+gqvea50iOzN5nr2Zgc7ly06xqEolNirlIqv4nU94locH7x7+2/5lSbSBiwXSakg/YbQR6kMhOeLQGqeH8jHYD7oqkN/HoBycEhxAKhstZqpHIc3ABk4hjkp2gttNPmwmi1DmJz5cHwiuT7BjzsYCazbRRIF1pq156trdEzF2g1qclxlaSyRsVI2LZI7lyhPceqiRnIP/hc/zB83F0jwU/z5MHpLiUtNTGVRD8EYV4kW3CdNbCWtaRDmH6KObSIwwkS5f4m8vnzeNWnX4/TrLr398B00PXp0u/vwgbNu9HT2ZDJh7OAj/CPUEf1l9h349p4YMC73yBb0nukUnknhLHxPwc3Qp+K0Oip2+vY3SRzrw+7FWRfCOh0fDbu1eNqM04tuLKJ7/PRtjzyG5qlkchkp7LaLkNt3uLbxoDij7buQ4JGRVPceUteuR6n8UAClKtSa4IHjn8Zf/jKN4JQ7nePu1bxcZ9tGMs1RCJH8r5EIEWui7DMBGmMnBPR6Ta1iLU4CN6wNGI6eU6eMFwSOEQZINFAQRsyAXKQ/qhQtLTSHEvt+gFFpo+zk5R80Pqm/DGZ6rS7pugJLbRFp9QJEwgidxnuAyaZ2W4BtmGMQ71KR0JHpJG0iBTeUa2w9FjJN/w6bf6+j9ou0Kk4ouGQEwb6djqdsIIjM67OKkNa0Kt2Qg8UQdD71qi4zLYxO4WJMBlt0VZdMPppEUhwP89xLMzsGhm/Yeg2WQoBTbsU1+YDAVqIOjCYaNSVFVv8I8Wlsrep+s++kW7sEkdbqCE5v7gNoxynY2aO5nsjwHe2wQY+4Dj7p9UhvmLbffGuyST+4ONXHqMPe7j4TDfGg==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(136003)(39860400002)(376002)(451199021)(46966006)(40470700004)(36840700001)(83380400001)(2616005)(82740400003)(478600001)(47076005)(336012)(31686004)(186003)(426003)(36860700001)(53546011)(26005)(40460700003)(4326008)(40480700001)(70586007)(2906002)(86362001)(16576012)(316002)(70206006)(82310400005)(41300700001)(31696002)(36756003)(54906003)(110136005)(44832011)(8936002)(5660300002)(8676002)(81166007)(356005)(3940600001)(36900700001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB10102
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT048.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	058daa77-1c2e-4197-be21-08db83710b59
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	b+dAD0/7n775jHT+BUN+OywdzNerLR3LhYP0+pOt0AZaWhPJMxJpHMoROCHjDsNfXFAzV3sGda6Mtu7w4L5nG5CzyRDI9dF4qKYliaWWP/lIrQZOXPLX2MayAsb0jYcFxw9qYmt5Yf/86fVNjezMRMne5enxBNgPe4NGNq8x0b0kODtA+wjLk4tqr++qFx9Ty6Pr+jjxEGBTJhHMUx4Tl3AbsjaP+TxKzn6BREXrsOD9eN5yuxNQ5aDAEWSbPjc20Y0ryuVcI/FDoMGF1yKms0jGhzSiY+DUaAn0BfpnYWx0SCsz8JuX1L/kUTuwKCeu8Z8N3xoYgfRi4/1apeU2xONSwkIJTq4tNxD+ioHQE0eAxKe+ucETk9FYP/Iw2sU8wa4yrro6lT46CuDAwFst64BhY1g+c+y7pP7ZNwuL2MIe3B2sTeujHtmglhwg4S5B44rh+U+cFRb59mk4djqlo1k8i/tp/cQJ32Us9OqhWZgHy7XEZ/v4PC2omu+sogddH2KKKUxW6yWqI3JGYOF5Y1ZKUXhuz4RLajv3/b49Q5sknCt6uxjashj2MDcl5BsOSG1ZXJMxPvLOmY8rvwWfTqoMnBel4XK3bUQRgHvdiJMIQ6azxPfaxTfMFgBguMdKnRXd9ct0dbLxXN22h4yq8+bsYMUM3UXGEl/EurccqbSYLfx4VgLEzDHJ+DmP83gjOMqEEEoCzqzu/rme1U0IQ4CD9wpw57413xyj6OuIuY/FyEw7MY0uxz3eyEL/chazj1YpuQxXx/agJIEyzhx3JhjQ47mmheZfHIWsSzKZggo6IaJG8iPmgkZ/U6kJm5Tb
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(376002)(396003)(136003)(451199021)(36840700001)(40470700004)(46966006)(44832011)(70206006)(70586007)(4326008)(316002)(2906002)(41300700001)(478600001)(31686004)(8936002)(5660300002)(8676002)(110136005)(16576012)(54906003)(36860700001)(40460700003)(40480700001)(26005)(53546011)(426003)(186003)(36756003)(83380400001)(336012)(47076005)(81166007)(82740400003)(86362001)(2616005)(82310400005)(31696002)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 07:16:29.1592
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 81a3ad3e-e4c5-453a-b211-08db837113ea
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT048.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5340

Hi,

On 2023/7/5 21:52, Julien Grall wrote:
> Hi,
> 
> On 05/07/2023 10:53, Penny Zheng wrote:
>>>> Since if not and when anyone wants to update map_pages_to_xen(), 
>>>> destroy_xen_mappings() and modify_xen_mappings() in the future, it 
>>>> is possible for them to leave changes in only one file.
>>>
>>> The helpers are just wrappers. I doubt they will change in the 
>>> future. So I think it would be OK to duplicate.
>>>
>>> The alternative would to have a common prototype for xen_pt_update() 
>>> and xen_mpumap_update() and avoid any #ifdery. That said, this is not 
>>> my preference at least if they are not static inline.
>>>
>>
>> Correct me if I'm wrong, you are suggesting something like this:
>> A more-generic wrapper like xen_mm_update, and we introduce static 
>> inline implementation in mmu/mm.h with xen_pt_update(), and static
>> inline implementation in mpu/mm.h with xen_mpumap_update().
> 
> Yes as an alternative proposal. But my preference here is to duplicate 
> the helpers in mm-mmu.c and mm-mpu.c.
> 

Understood, I'll do the duplication.

> Cheers,
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 07:23:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 07:23:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562960.879784 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJqfb-0008JD-1E; Thu, 13 Jul 2023 07:23:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562960.879784; Thu, 13 Jul 2023 07:23:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJqfa-0008J6-Uj; Thu, 13 Jul 2023 07:23:22 +0000
Received: by outflank-mailman (input) for mailman id 562960;
 Thu, 13 Jul 2023 07:23:22 +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
 <SRS0=tMFS=C7=arm.com=Penny.Zheng@srs-se1.protection.inumbo.net>)
 id 1qJqfZ-0008J0-TW
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 07:23:22 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on2062d.outbound.protection.outlook.com
 [2a01:111:f400:fe16::62d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 23d52414-214e-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 09:23:19 +0200 (CEST)
Received: from DBBPR09CA0029.eurprd09.prod.outlook.com (2603:10a6:10:d4::17)
 by VI1PR08MB5485.eurprd08.prod.outlook.com (2603:10a6:803:138::23) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24; Thu, 13 Jul
 2023 07:23:11 +0000
Received: from DBAEUR03FT024.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:d4:cafe::29) by DBBPR09CA0029.outlook.office365.com
 (2603:10a6:10:d4::17) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24 via Frontend
 Transport; Thu, 13 Jul 2023 07:23:11 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT024.mail.protection.outlook.com (100.127.142.163) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.24 via Frontend Transport; Thu, 13 Jul 2023 07:23:11 +0000
Received: ("Tessian outbound d7adc65d10b4:v145");
 Thu, 13 Jul 2023 07:23:11 +0000
Received: from 18bcb988f32f.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 74DC55A5-96B1-43DB-9E87-A50C1ABFC0ED.1; 
 Thu, 13 Jul 2023 07:23:04 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 18bcb988f32f.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 13 Jul 2023 07:23:04 +0000
Received: from AM6P191CA0082.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8a::23)
 by DB9PR08MB6457.eurprd08.prod.outlook.com (2603:10a6:10:23e::17) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24; Thu, 13 Jul
 2023 07:23:02 +0000
Received: from AM7EUR03FT019.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:209:8a:cafe::58) by AM6P191CA0082.outlook.office365.com
 (2603:10a6:209:8a::23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.22 via Frontend
 Transport; Thu, 13 Jul 2023 07:23:02 +0000
Received: from nebula.arm.com (40.67.248.234) by
 AM7EUR03FT019.mail.protection.outlook.com (100.127.140.245) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.20 via Frontend Transport; Thu, 13 Jul 2023 07:23:01 +0000
Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com
 (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 13 Jul
 2023 07:23:00 +0000
Received: from [10.169.188.57] (10.169.188.57) by mail.arm.com (10.251.24.31)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend
 Transport; Thu, 13 Jul 2023 07:22:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 23d52414-214e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3X5YRe7IEE82qehEe9TCTySMrhm/yQ/XCaBRvAiyH24=;
 b=S96TuXMq8Xo0WYjRkOoIXecXHd87uh268hga+6Ng4U5A+RdnT172oRAU8gxzzM3/mxkEWlY8nIlNUsamccxLkL1d4AGG5/tCGTJ8rJt5/RXJ5LKVU3Xkjdox4r/VTRLST2TU58OrSyWk6AsVa6imiC6r2qBr+OGQYlNsu1dfbxQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 57ba763cd74662de
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=QHUPD1oRMwBlDeG5kihQlpwCgN5fzaleS8kzvVdGuqnqLBcAzecLlZ3sGXvgETrGd5eAJshhR1pnIXoPuWHA9w7OlcZ4tr3OzEKNQaLcU7gBL5v8TZpr0laik6QbuaaF+CD+IoypTx/fy578y766E0ESPdGRhViZqrkpc/ebTNZPhMvfx0JvR1+2tHD/pjilYKbREt6jtbO5nSGYMhKApxj2/zcDPZq0/zCaCLYhEnIoZoTRm8hRhPQim8W7U8BgnsRja4DBCxRiGv1W4etSaGgri8uQjtK1uJ1wKVTwVHkuZyh9L8WWKc1A3Owlyko5+nbK7UHdDbW6S3uWk097Jw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3X5YRe7IEE82qehEe9TCTySMrhm/yQ/XCaBRvAiyH24=;
 b=VhOWFPTtIZbC1XAmANaNDqvecNra/8vg5+VQ9nazYwY1zM84GKgVGD7J9GhqvtfGT7Je7zpZZCYvJQxi0hX2pwCjfNathIAhlZrZGtiO0PPBgxcWZOaoHpueEk229okh9r3SeTmf0ruAbs2sDsvrhSQLB63yq1PD/DVY12oeLZ+efC8rQvx9Hzyu1x2KOemEzggNbWdYAmYHnXkSagoETArtEKX6YOH+5UlO6RVAncURxPxzmkeVhJPbuIWRfrF8F/cNISRO+57XMq4RRjCi1tfhCkoTk9Zr68ppSLH6LolESkt01Cc56Z2n8SZGvEL6wgFLQNhjjwR3vj9tK3btPA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 40.67.248.234) smtp.rcpttodomain=amd.com smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message
 not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3X5YRe7IEE82qehEe9TCTySMrhm/yQ/XCaBRvAiyH24=;
 b=S96TuXMq8Xo0WYjRkOoIXecXHd87uh268hga+6Ng4U5A+RdnT172oRAU8gxzzM3/mxkEWlY8nIlNUsamccxLkL1d4AGG5/tCGTJ8rJt5/RXJ5LKVU3Xkjdox4r/VTRLST2TU58OrSyWk6AsVa6imiC6r2qBr+OGQYlNsu1dfbxQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234)
 smtp.mailfrom=arm.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 40.67.248.234 as permitted sender) receiver=protection.outlook.com;
 client-ip=40.67.248.234; helo=nebula.arm.com; pr=C
Message-ID: <e32b0108-8376-df56-6fa5-77562586f40f@arm.com>
Date: Thu, 13 Jul 2023 15:22:56 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 44/52] xen/mpu: P2M initialization in MPU system
Content-Language: en-US
To: Ayan Kumar Halder <ayankuma@amd.com>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-45-Penny.Zheng@arm.com>
 <7df5b74c-8570-a484-b0c3-978a44a7c66a@amd.com>
From: Penny Zheng <penny.zheng@arm.com>
In-Reply-To: <7df5b74c-8570-a484-b0c3-978a44a7c66a@amd.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 1
X-MS-TrafficTypeDiagnostic:
	AM7EUR03FT019:EE_|DB9PR08MB6457:EE_|DBAEUR03FT024:EE_|VI1PR08MB5485:EE_
X-MS-Office365-Filtering-Correlation-Id: f0ce018e-aee4-468a-a154-08db8372038f
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 iWKr4gXreUpwXDZtyASydfOWIRM4OiDowy4jo/UpHg1tIy13cUPyMOyuYwU6Fy97hIJ/yyZrbh1xCITN7+WAwEgwYmO5bUmYlzQnF1AjNcPtXvAYw3UTTrA/Ne3aPs2ybPBErx9cuSiZa/SUb3jdbZq1J/CP0M2SXtN3aUsTuKsLHZ05jbf+I59WX6ILZCGal6Gb71ZjJBs7PAa541UlECOlpS5eAM09j8en+pF3Z469XkkRoVr3NLRnZpuoyARXu2iTRmY+Py85Br9bGZ5nSaVldKgUO2pJ04A47oL2WkNIja+4+TFu2nQyRLqp7mVaPEjlQLdg4Doj1fh4utXeDX5PQ7TTTeW61T8f+FRxk0l3o1GPSAm1KT1kdfyB1kvrt93T2oXjXgaab8PDSEcr235DNhTrpS5qfvFvqUeMi/u8PxIJB23LD6xw1dUFppjzpeegje5MYekWa0WlOgUpNnhpEML0jq2Q3/ocvKKlFlpLliWrCN/gkT1QuHbIWUNF4ksGHv99/2het76tkxLsI8lxp3iSLr5xn0VALAx7ftNE/5gynBiph509N2AllvfuDfWrjUzErQt/D4LAaIYEt/oCuGpy4k4PeE9x6GC6poPK7Rh471ht0xZw/yFPE+sp9iom0neXdtU4VCnHX9oSjgpxqs0TJP1QCCAk0rEvHEQFnfVeR/ep/OyIrFqeuv9ktr1AmnR7pI3ZiuoUL6i/gOQf9WcaHH7StXrk2ScbM5I91ug4JP6Puauznc4Ci/X4F4j1KykGfuRFk2tunEFrLOBkhXxekHrrds5RBezKMvnFpEexNfMbmmuXtcE55dO5BP6iBlZibHJjN3wwrD4Odw==
X-Forefront-Antispam-Report-Untrusted:
 CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(39860400002)(376002)(346002)(451199021)(40470700004)(36840700001)(46966006)(110136005)(16576012)(54906003)(316002)(186003)(336012)(70206006)(4326008)(31686004)(70586007)(478600001)(41300700001)(40460700003)(8676002)(8936002)(53546011)(40480700001)(86362001)(31696002)(82310400005)(26005)(5660300002)(44832011)(83380400001)(47076005)(36860700001)(356005)(81166007)(2616005)(36756003)(2906002)(426003)(82740400003)(3940600001)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6457
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT024.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	0e24a7d5-ef91-4f96-c316-08db8371fdea
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	41hYnpveu8RtKJnKgcayWmGTkQ0kVQa1LeQIT+Y2Ahu6fEB/qwPwzdaJr77Q48mU/Oct926jKD8iacAQIbcq7L2ULhfNUlGnu/2zlLlxvpbK0KUA6bhwXsvtoZScziU+wvt+DCLSPRfdwF3uTW3IG9stYzDC93IURNdt7v5ayRssW3dxrCLYJ8P9LvxGAyGqEHRJUPEOJEsqbMekTW4zgKdk+seaaY6IMBiuzRzlVRFeboXgiBPfWJOxXtawrWKpkk6nA92SQb8NuZCqh+5naaiyenyKxVOEexpux5O1bixIZ0KmZu69zgN42qaCsAkDdz0TN+K1ZEpKTvv2gy+puGxkaL5PFAzUweLi2rcONdev63PAKo3JZ62wKAZ5pZCBryYPSdc8IRzr2YWL1DSY4/gUuNCVYXIydGW8USnrM4pYnem1qc9gy6ozRGyQWNomS8tDf3KEPpRGNJ5w06D38gYwHihVDmUvhSBvQou7wTjFH0uOhN5jTXcjkU+J0/WDFz5iQTbqiKuEwW0KoFuCUFAEILTwxhQi/bfWZ7xwpuKD/52cFnZT/QHaNu4diVSDo77ZY58W5dD48YILaBVX6UixBXhJVPEhk8/2ivOhoDCYO86eLmyQMNAZe/d9DPBlD4aYU5nGVCkAdNWYhNBSy9J8+L+N32Z/NrldizqS+pP/dHPvOQ99Faagam+2dEm4Gk3BCkB24/AQAc+jUtTuyIpTZwOo4Td3oyM5FIuej1WNJuWNFLNirHYIDTXsEeaR4ctTknTsShfvbw0HwVj1aqm7OFGnII1rRyiqFO2VwkZr9ou9fUa2R4cmJtZlozL6
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(136003)(39860400002)(376002)(451199021)(40470700004)(36840700001)(46966006)(110136005)(16576012)(54906003)(316002)(186003)(336012)(31686004)(4326008)(70206006)(70586007)(478600001)(41300700001)(40460700003)(8676002)(8936002)(53546011)(40480700001)(86362001)(31696002)(82310400005)(26005)(5660300002)(44832011)(83380400001)(47076005)(36860700001)(81166007)(2616005)(36756003)(2906002)(426003)(82740400003)(3940600001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 07:23:11.2312
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: f0ce018e-aee4-468a-a154-08db8372038f
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT024.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5485

Hi, Ayan

On 2023/7/5 23:35, Ayan Kumar Halder wrote:
> Hi Penny,
> 
> On 26/06/2023 04:34, Penny Zheng wrote:
>> CAUTION: This message has originated from an External Source. Please 
>> use proper judgment and caution when opening attachments, clicking 
>> links, or responding to this email.
>>
>>
>> We inherit p2m_init() to do P2M initialization in MPU system, including
>> VMID assignment, setting up P2M MPU region mapping table, etc.
>>
>> p2m_alloc_table() is responsible for allocating per-domain P2M MPU memory
>> region mapping table. As a MPU memory region structure(pr_t) takes 16 
>> bytes,
>> even with maximum supported MPU memory regions, 255, MPU memory 
>> mapping table
>> at most takes up less than 4KB.
>>
>> VSCTLR_EL2, Virtualization System Control Register, provides 
>> configuration
>> information for VMSAv8-64 and PMSAv8-64 virtualization using stage 2
>> of EL1&0 translation regime, bit[63:48] of which determines VMID for the
>> EL1-Guest-OS.
>>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> ---
>> v3:
>> - new commit
>> ---
>> Â  xen/arch/arm/include/asm/mpu/mm.h |Â  3 ++
>> Â  xen/arch/arm/include/asm/p2m.hÂ Â Â  |Â  5 +++
>> Â  xen/arch/arm/mpu/mm.cÂ Â Â Â Â Â Â Â Â Â Â Â  | 22 ++++++++++
>> Â  xen/arch/arm/mpu/p2m.cÂ Â Â Â Â Â Â Â Â Â Â  | 69 +++++++++++++++++++++++++++++++
>> Â  4 files changed, 99 insertions(+)
>>
>> diff --git a/xen/arch/arm/include/asm/mpu/mm.h 
>> b/xen/arch/arm/include/asm/mpu/mm.h
>> index a83519ad13..4df69245c6 100644
>> --- a/xen/arch/arm/include/asm/mpu/mm.h
>> +++ b/xen/arch/arm/include/asm/mpu/mm.h
>> @@ -2,6 +2,8 @@
>> Â  #ifndef __ARCH_ARM_MM_MPU__
>> Â  #define __ARCH_ARM_MM_MPU__
> #ifdef CONFIG_ARM_64
>> +#include <asm/arm64/mpu.h>
> #endif
>> +
>> Â  extern struct page_info *frame_table;
>> Â  extern unsigned long frametable_pdx_end;
>>
>> @@ -11,6 +13,7 @@ extern uint8_t is_mm_range_mapped(paddr_t pa, 
>> paddr_t len);
>> Â  extern void *map_mm_range(paddr_t pa, size_t len, unsigned int 
>> attributes);
>> Â  extern void unmap_mm_range(paddr_t pa);
>> Â  extern bool is_mm_range_mapped_transient(paddr_t pa, paddr_t len);
>> +extern pr_t *alloc_mpumap(void);
>>
>> Â  #endif /* __ARCH_ARM_MM_MPU__ */
>>
>> diff --git a/xen/arch/arm/include/asm/p2m.h 
>> b/xen/arch/arm/include/asm/p2m.h
>> index d9c91d4a98..c3598d514e 100644
>> --- a/xen/arch/arm/include/asm/p2m.h
>> +++ b/xen/arch/arm/include/asm/p2m.h
>> @@ -61,8 +61,13 @@ struct p2m_domain {
>> Â Â Â Â Â  /* Current VMID in use */
>> Â Â Â Â Â  uint16_t vmid;
>>
>> +#ifndef CONFIG_HAS_MPU
>> Â Â Â Â Â  /* Current Translation Table Base Register for the p2m */
>> Â Â Â Â Â  uint64_t vttbr;
>> +#else
>> +Â Â Â  /* Current Virtualization System Control Register for the p2m */
>> +Â Â Â  uint64_t vsctlr;
> 
> register_t vsctlr;
> 
> So that it is 64-bit for ARM_64 and 32-bit for ARM_32.
> 

Understood, will fix

>> +#endif
>>
>> Â Â Â Â Â  /* Highest guest frame that's ever been mapped in the p2m */
>> Â Â Â Â Â  gfn_t max_mapped_gfn;
>> diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
>> index 27d924e449..de5da96b80 100644
>> --- a/xen/arch/arm/mpu/mm.c
>> +++ b/xen/arch/arm/mpu/mm.c
>> @@ -872,6 +872,28 @@ void __init remove_early_mappings(paddr_t dtb_paddr)
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  panic("Unable to destroy early Device-Tree mapping.\n");
>> Â  }
>>
>> +/*
>> + * Standard entry to dynamically allocate MPU memory region mapping 
>> table.
>> + * A 4KB page is enough for holding the maximum supported MPU memory
>> + * regions.
>> + */
>> +pr_t *alloc_mpumap(void)
>> +{
>> +Â Â Â  pr_t *map;
>> +
>> +Â Â Â  /*
>> +Â Â Â Â  * A MPU memory region structure(pr_t) takes 16 bytes, even with 
>> maximum
>> +Â Â Â Â  * supported MPU memory regions, 255, MPU memory mapping table at 
>> most
>> +Â Â Â Â  * takes up less than 4KB.
>> +Â Â Â Â  */
>> +Â Â Â  map = alloc_xenheap_pages(0, 0);
>> +Â Â Â  if ( map == NULL )
>> +Â Â Â Â Â Â Â  return NULL;
>> +
>> +Â Â Â  clear_page(map);
>> +Â Â Â  return map;
>> +}
>> +
>> Â  /*
>> Â Â  * Local variables:
>> Â Â  * mode: C
>> diff --git a/xen/arch/arm/mpu/p2m.c b/xen/arch/arm/mpu/p2m.c
>> index a7a3912a9a..8f728f8957 100644
>> --- a/xen/arch/arm/mpu/p2m.c
>> +++ b/xen/arch/arm/mpu/p2m.c
>> @@ -4,6 +4,7 @@
>> Â  #include <xen/sched.h>
>> Â  #include <xen/warning.h>
>>
>> +#include <asm/mpu/mm.h>
>> Â  #include <asm/p2m.h>
>> Â  #include <asm/processor.h>
>> Â  #include <asm/sysregs.h>
>> @@ -97,6 +98,74 @@ fault:
>> Â Â Â Â Â  panic("Hardware with no PMSAv8-64 support in any translation 
>> regime.\n");
>> Â  }
>>
>> +static uint64_t __init generate_vsctlr(uint16_t vmid)
>> +{
>> +Â Â Â  return ((uint64_t)vmid << 48);
>> +}
> 
> Please move ^^^ to ./xen/arch/arm/include/asm/arm64/mpu.h as it differs 
> between R82 and R52
> 

Sure, will do

> - Ayan
> 
>> +
>> +static int __init p2m_alloc_table(struct domain *d)
>> +{
>> +Â Â Â  struct p2m_domain *p2m = p2m_get_hostp2m(d);
>> +Â Â Â  pr_t* p2m_map;
>> +
>> +Â Â Â  p2m_map = alloc_mpumap();
>> +Â Â Â  if ( !p2m_map )
>> +Â Â Â  {
>> +Â Â Â Â Â Â Â  printk(XENLOG_G_ERR "DOM%pd: p2m: unable to allocate P2M MPU 
>> mapping table\n", d);
>> +Â Â Â Â Â Â Â  return -ENOMEM;
>> +Â Â Â  }
>> +
>> +Â Â Â  p2m->root = virt_to_page((const void *)p2m_map);
>> +
>> +Â Â Â  return 0;
>> +}
>> +
>> +int p2m_init(struct domain *d)
>> +{
>> +Â Â Â  struct p2m_domain *p2m = p2m_get_hostp2m(d);
>> +Â Â Â  int rc = 0;
>> +Â Â Â  unsigned int cpu;
>> +
>> +Â Â Â  rwlock_init(&p2m->lock);
>> +Â Â Â  spin_lock_init(&d->arch.paging.lock);
>> +
>> +Â Â Â  p2m->vmid = INVALID_VMID;
>> +Â Â Â  p2m->max_mapped_gfn = _gfn(0);
>> +Â Â Â  p2m->lowest_mapped_gfn = _gfn(ULONG_MAX);
>> +
>> +Â Â Â  p2m->default_access = p2m_access_rwx;
>> +Â Â Â  /* mem_access is NOT supported in MPU system. */
>> +Â Â Â  p2m->mem_access_enabled = false;
>> +
>> +Â Â Â  /*
>> +Â Â Â Â  * Make sure that the type chosen to is able to store an vCPU ID
>> +Â Â Â Â  * between 0 and the maximum of virtual CPUS supported as long as
>> +Â Â Â Â  * the INVALID_VCPU_ID.
>> +Â Â Â Â  */
>> +Â Â Â  BUILD_BUG_ON((1 << (sizeof(p2m->last_vcpu_ran[0]) * 8)) < 
>> MAX_VIRT_CPUS);
>> +Â Â Â  BUILD_BUG_ON((1 << (sizeof(p2m->last_vcpu_ran[0]) * 8)) < 
>> INVALID_VCPU_ID);
>> +
>> +Â Â Â  for_each_possible_cpu(cpu)
>> +Â Â Â Â Â Â  p2m->last_vcpu_ran[cpu] = INVALID_VCPU_ID;
>> +
>> +Â Â Â  /*
>> +Â Â Â Â  * "Trivial" initialisation is now complete.Â  Set the backpointer so
>> +Â Â Â Â  * p2m_teardown() and friends know to do something.
>> +Â Â Â Â  */
>> +Â Â Â  p2m->domain = d;
>> +
>> +Â Â Â  rc = p2m_alloc_vmid(d);
>> +Â Â Â  if ( rc )
>> +Â Â Â Â Â Â Â  return rc;
>> +Â Â Â  p2m->vsctlr = generate_vsctlr(p2m->vmid);
>> +
>> +Â Â Â  rc = p2m_alloc_table(d);
>> +Â Â Â  if ( rc )
>> +Â Â Â Â Â Â Â  return rc;
>> +
>> +Â Â Â  return rc;
>> +}
>> +
>> Â  /*
>> Â Â  * Local variables:
>> Â Â  * mode: C
>> -- 
>> 2.25.1
>>
>>


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 07:35:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 07:35:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562937.879793 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJqqv-0001Wl-4Q; Thu, 13 Jul 2023 07:35:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562937.879793; Thu, 13 Jul 2023 07:35:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJqqv-0001We-1k; Thu, 13 Jul 2023 07:35:05 +0000
Received: by outflank-mailman (input) for mailman id 562937;
 Thu, 13 Jul 2023 06:59:05 +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
 <SRS0=cTst=C7=gmail.com=geert.uytterhoeven@srs-se1.protection.inumbo.net>)
 id 1qJqI5-0002ZW-Qp
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 06:59:05 +0000
Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com
 [209.85.219.43]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bfc60a35-214a-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 08:59:03 +0200 (CEST)
Received: by mail-qv1-f43.google.com with SMTP id
 6a1803df08f44-634a3682c25so2474506d6.3
 for <xen-devel@lists.xenproject.org>; Wed, 12 Jul 2023 23:59:03 -0700 (PDT)
Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com.
 [209.85.160.178]) by smtp.gmail.com with ESMTPSA id
 r30-20020a05620a03de00b00767f00a9c67sm858080qkm.95.2023.07.12.23.59.01
 for <xen-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 12 Jul 2023 23:59:01 -0700 (PDT)
Received: by mail-qt1-f178.google.com with SMTP id
 d75a77b69052e-403b07cf5d0so3935811cf.2
 for <xen-devel@lists.xenproject.org>; Wed, 12 Jul 2023 23:59:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bfc60a35-214a-11ee-8611-37d641c3527e
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689231542; x=1691823542;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=a+0qanWxODhzgXHCXIxDgPeQhxCw3xhLkeN7rWN/J3A=;
        b=iBJTVChQHRPXsylpBOnQRyoxH1qIUZWRdBO5ga5bjiZmMWBTSKx/zUZP9yxAfpCUqZ
         nCzN9qsoIAnw439sVVU5BDS/A0nogA0/0JQ9yhh65K+NFz5aCzycMCr0nem9sY7BsmxM
         sszj52QYtAtniziHz7AYYv3skmD7Vfip1yNPJaGNfv04BIwbyU4aSeGo38AAMLl7FjkX
         0TcmM8w3UvkAR4CP+7ECoGDAgHvL5WA7nvqG/raQwtpT40tdHnjVU5UKy76zWCfItfAe
         65o6EWKVezKJMFnXONYa5yuYao5XXeUYfCD1RFD58tOPUXu54EfO6HA8Kx2MKGdpeH4j
         Cgzg==
X-Gm-Message-State: ABy/qLb+NCzDauCQAO6RYchl1s2BClX5kcw44B7hDdnoJJrWujW83lXE
	/W/Dx0uWgGVe/0JGqFBdZCqyWy3RWJe/Q/yM
X-Google-Smtp-Source: APBJJlF7WyAS9UDnDXPT2NYMCGxbtFmv0PxNbcSY8AGoWRWmFaxrBVHm6ZVKKBZDTHaT+nrCXTjRsw==
X-Received: by 2002:a0c:f049:0:b0:630:1954:b30 with SMTP id b9-20020a0cf049000000b0063019540b30mr733537qvl.9.1689231541676;
        Wed, 12 Jul 2023 23:59:01 -0700 (PDT)
X-Received: by 2002:a0d:e208:0:b0:56d:9e2:7d9e with SMTP id
 l8-20020a0de208000000b0056d09e27d9emr931586ywe.21.1689231149403; Wed, 12 Jul
 2023 23:52:29 -0700 (PDT)
MIME-Version: 1.0
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com> <20230712161025.22op3gtzgujrhytb@pengutronix.de>
In-Reply-To: <20230712161025.22op3gtzgujrhytb@pengutronix.de>
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Thu, 13 Jul 2023 08:52:12 +0200
X-Gmail-Original-Message-ID: <CAMuHMdWuvkxcj05OTfEn5f2p-6e71QEHVjSLWwNFRnR_=WEJVQ@mail.gmail.com>
Message-ID: <CAMuHMdWuvkxcj05OTfEn5f2p-6e71QEHVjSLWwNFRnR_=WEJVQ@mail.gmail.com>
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to drm_dev
To: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
Cc: Jani Nikula <jani.nikula@intel.com>, 
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, 
	Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, 
	Alex Deucher <alexander.deucher@amd.com>, =?UTF-8?Q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>, 
	"Pan, Xinhui" <Xinhui.Pan@amd.com>, Harry Wentland <harry.wentland@amd.com>, Leo Li <sunpeng.li@amd.com>, 
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>, Hamza Mahfooz <hamza.mahfooz@amd.com>, 
	Javier Martinez Canillas <javierm@redhat.com>, Guchun Chen <guchun.chen@amd.com>, 
	Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>, Evan Quan <evan.quan@amd.com>, 
	Likun Gao <Likun.Gao@amd.com>, =?UTF-8?B?TWFyZWsgT2zFocOhaw==?= <marek.olsak@amd.com>, 
	David Francis <David.Francis@amd.com>, Hawking Zhang <Hawking.Zhang@amd.com>, Lang Yu <Lang.Yu@amd.com>, 
	Philip Yang <Philip.Yang@amd.com>, Yifan Zhang <yifan1.zhang@amd.com>, 
	Tim Huang <Tim.Huang@amd.com>, Zack Rusin <zackr@vmware.com>, Sam Ravnborg <sam@ravnborg.org>, 
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>, =?UTF-8?B?TWHDrXJhIENhbmFs?= <mairacanal@riseup.net>, 
	=?UTF-8?Q?Andr=C3=A9_Almeida?= <andrealmeid@igalia.com>, 
	Qingqing Zhuo <qingqing.zhuo@amd.com>, Aurabindo Pillai <aurabindo.pillai@amd.com>, 
	Hersen Wu <hersenxs.wu@amd.com>, Fangzhi Zuo <jerry.zuo@amd.com>, 
	Stylon Wang <stylon.wang@amd.com>, Alan Liu <haoping.liu@amd.com>, Wayne Lin <Wayne.Lin@amd.com>, 
	Aaron Liu <aaron.liu@amd.com>, Melissa Wen <mwen@igalia.com>, 
	Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>, David Tadokoro <davidbtadokoro@usp.br>, 
	Wenjing Liu <wenjing.liu@amd.com>, Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, 
	Mario Limonciello <mario.limonciello@amd.com>, Alexey Kodanev <aleksei.kodanev@bell-sw.com>, 
	Roman Li <roman.li@amd.com>, =?UTF-8?Q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= <samsagax@gmail.com>, 
	Dave Airlie <airlied@redhat.com>, Russell King <linux@armlinux.org.uk>, 
	Liviu Dudau <liviu.dudau@arm.com>, Joel Stanley <joel@jms.id.au>, 
	Boris Brezillon <bbrezillon@kernel.org>, Nicolas Ferre <nicolas.ferre@microchip.com>, 
	Alexandre Belloni <alexandre.belloni@bootlin.com>, 
	Claudiu Beznea <claudiu.beznea@microchip.com>, Inki Dae <inki.dae@samsung.com>, 
	Seung-Woo Kim <sw0312.kim@samsung.com>, Kyungmin Park <kyungmin.park@samsung.com>, 
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, Stefan Agner <stefan@agner.ch>, 
	Alison Wang <alison.wang@nxp.com>, Patrik Jakobsson <patrik.r.jakobsson@gmail.com>, 
	=?UTF-8?Q?Noralf_Tr=C3=B8nnes?= <noralf@tronnes.org>, 
	Xinliang Liu <xinliang.liu@linaro.org>, Tian Tao <tiantao6@hisilicon.com>, 
	Danilo Krummrich <dakr@redhat.com>, Deepak Rawat <drawat.floss@gmail.com>, 
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>, 
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>, 
	=?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= <ville.syrjala@linux.intel.com>, 
	Lucas De Marchi <lucas.demarchi@intel.com>, Ankit Nautiyal <ankit.k.nautiyal@intel.com>, 
	Andrzej Hajda <andrzej.hajda@intel.com>, Matt Roper <matthew.d.roper@intel.com>, 
	Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>, 
	Radhakrishna Sripada <radhakrishna.sripada@intel.com>, Hans de Goede <hdegoede@redhat.com>, 
	Luca Coelho <luciano.coelho@intel.com>, 
	Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>, 
	Kai Vehmanen <kai.vehmanen@linux.intel.com>, 
	Vinod Govindapillai <vinod.govindapillai@intel.com>, =?UTF-8?Q?=C5=81ukasz_Bartosik?= <lb@semihalf.com>, 
	Anusha Srivatsa <anusha.srivatsa@intel.com>, 
	Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>, Uma Shankar <uma.shankar@intel.com>, 
	Imre Deak <imre.deak@intel.com>, Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>, 
	Swati Sharma <swati2.sharma@intel.com>, =?UTF-8?Q?Jouni_H=C3=B6gander?= <jouni.hogander@intel.com>, 
	Mika Kahola <mika.kahola@intel.com>, =?UTF-8?Q?Jos=C3=A9_Roberto_de_Souza?= <jose.souza@intel.com>, 
	Arun R Murthy <arun.r.murthy@intel.com>, Gustavo Sousa <gustavo.sousa@intel.com>, 
	Khaled Almahallawy <khaled.almahallawy@intel.com>, 
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>, Andi Shyti <andi.shyti@linux.intel.com>, 
	Nirmoy Das <nirmoy.das@intel.com>, Fei Yang <fei.yang@intel.com>, 
	Animesh Manna <animesh.manna@intel.com>, Deepak R Varma <drv@mailo.com>, 
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, 
	Vandita Kulkarni <vandita.kulkarni@intel.com>, Suraj Kandpal <suraj.kandpal@intel.com>, 
	Drew Davenport <ddavenport@chromium.org>, Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>, 
	Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, 
	Philipp Zabel <p.zabel@pengutronix.de>, Dan Carpenter <error27@gmail.com>, 
	Paul Cercueil <paul@crapouillou.net>, Anitha Chrisanthus <anitha.chrisanthus@intel.com>, 
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>, Linus Walleij <linus.walleij@linaro.org>, 
	Chun-Kuang Hu <chunkuang.hu@kernel.org>, Matthias Brugger <matthias.bgg@gmail.com>, 
	Neil Armstrong <neil.armstrong@linaro.org>, Kevin Hilman <khilman@baylibre.com>, 
	Rob Clark <robdclark@gmail.com>, Abhinav Kumar <quic_abhinavk@quicinc.com>, 
	Vinod Polimera <quic_vpolimer@quicinc.com>, Jiasheng Jiang <jiasheng@iscas.ac.cn>, 
	Konrad Dybcio <konrad.dybcio@linaro.org>, Jessica Zhang <quic_jesszhan@quicinc.com>, 
	Liu Shixin <liushixin2@huawei.com>, Marek Vasut <marex@denx.de>, Ben Skeggs <bskeggs@redhat.com>, 
	Karol Herbst <kherbst@redhat.com>, Lyude Paul <lyude@redhat.com>, Tomi Valkeinen <tomba@kernel.org>, 
	Emma Anholt <emma@anholt.net>, Gerd Hoffmann <kraxel@redhat.com>, 
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>, 
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>, 
	Wolfram Sang <wsa+renesas@sang-engineering.com>, 
	Geert Uytterhoeven <geert+renesas@glider.be>, Biju Das <biju.das.jz@bp.renesas.com>, 
	Sandy Huang <hjc@rock-chips.com>, =?UTF-8?Q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 
	Orson Zhai <orsonzhai@gmail.com>, Baolin Wang <baolin.wang@linux.alibaba.com>, 
	Chunyan Zhang <zhang.lyra@gmail.com>, Alain Volmat <alain.volmat@foss.st.com>, 
	Yannick Fertre <yannick.fertre@foss.st.com>, 
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>, 
	Philippe Cornu <philippe.cornu@foss.st.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, 
	Alexandre Torgue <alexandre.torgue@foss.st.com>, Chen-Yu Tsai <wens@csie.org>, 
	Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org>, 
	Thierry Reding <thierry.reding@gmail.com>, Mikko Perttunen <mperttunen@nvidia.com>, 
	Jonathan Hunter <jonathanh@nvidia.com>, Jyri Sarha <jyri.sarha@iki.fi>, 
	David Lechner <david@lechnology.com>, Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>, 
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>, Melissa Wen <melissa.srw@gmail.com>, 
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, Michal Simek <michal.simek@amd.com>, 
	Haneen Mohammed <hamohammed.sa@gmail.com>, linux-hyperv@vger.kernel.org, 
	linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org, 
	dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, 
	Yongqin Liu <yongqin.liu@linaro.org>, Alim Akhtar <alim.akhtar@samsung.com>, 
	Marijn Suijten <marijn.suijten@somainline.org>, Fabio Estevam <festevam@gmail.com>, 
	Sumit Semwal <sumit.semwal@linaro.org>, Jerome Brunet <jbrunet@baylibre.com>, 
	linux-samsung-soc@vger.kernel.org, amd-gfx@lists.freedesktop.org, 
	linux-stm32@st-md-mailman.stormreply.com, linux-rockchip@lists.infradead.org, 
	Xinwei Kong <kong.kongxinwei@hisilicon.com>, 
	VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>, NXP Linux Team <linux-imx@nxp.com>, 
	spice-devel@lists.freedesktop.org, linux-sunxi@lists.linux.dev, 
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>, linux-arm-msm@vger.kernel.org, 
	intel-gfx@lists.freedesktop.org, linux-mediatek@lists.infradead.org, 
	xen-devel@lists.xenproject.org, linux-tegra@vger.kernel.org, 
	linux-amlogic@lists.infradead.org, 
	Gurchetan Singh <gurchetansingh@chromium.org>, Sean Paul <sean@poorly.run>, 
	linux-arm-kernel@lists.infradead.org, 
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Andrew Jeffery <andrew@aj.id.au>, 
	linux-mips@vger.kernel.org, Chia-I Wu <olvaffe@gmail.com>, 
	linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de, 
	John Stultz <jstultz@google.com>, freedreno@lists.freedesktop.org, 
	Lucas Stach <l.stach@pengutronix.de>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Uwe,

Let's add some fuel to keep the thread alive ;-)

On Wed, Jul 12, 2023 at 6:13=E2=80=AFPM Uwe Kleine-K=C3=B6nig
<u.kleine-koenig@pengutronix.de> wrote:
> On Wed, Jul 12, 2023 at 05:34:28PM +0300, Jani Nikula wrote:
> > On Wed, 12 Jul 2023, Uwe Kleine-K=C3=B6nig <u.kleine-koenig@pengutronix=
.de> wrote:
> > > Hello,
> > >
> > > while I debugged an issue in the imx-lcdc driver I was constantly
> > > irritated about struct drm_device pointer variables being named "dev"
> > > because with that name I usually expect a struct device pointer.
> > >
> > > I think there is a big benefit when these are all renamed to "drm_dev=
".
> > > I have no strong preference here though, so "drmdev" or "drm" are fin=
e
> > > for me, too. Let the bikesheding begin!
> > >
> > > Some statistics:
> > >
> > > $ git grep -ohE 'struct drm_device *\* *[^ (),;]*' v6.5-rc1 | sort | =
uniq -c | sort -n
> > >       1 struct drm_device *adev_to_drm
> > >       1 struct drm_device *drm_
> > >       1 struct drm_device          *drm_dev
> > >       1 struct drm_device        *drm_dev
> > >       1 struct drm_device *pdev
> > >       1 struct drm_device *rdev
> > >       1 struct drm_device *vdev
> > >       2 struct drm_device *dcss_drv_dev_to_drm
> > >       2 struct drm_device **ddev
> > >       2 struct drm_device *drm_dev_alloc
> > >       2 struct drm_device *mock
> > >       2 struct drm_device *p_ddev
> > >       5 struct drm_device *device
> > >       9 struct drm_device * dev
> > >      25 struct drm_device *d
> > >      95 struct drm_device *
> > >     216 struct drm_device *ddev
> > >     234 struct drm_device *drm_dev
> > >     611 struct drm_device *drm
> > >    4190 struct drm_device *dev
> > >
> > > This series starts with renaming struct drm_crtc::dev to drm_dev. If
> > > it's not only me and others like the result of this effort it should =
be
> > > followed up by adapting the other structs and the individual usages i=
n
> > > the different drivers.
> >
> > I think this is an unnecessary change. In drm, a dev is usually a drm
> > device, i.e. struct drm_device *.
>
> Well, unless it's not. Prominently there is
>
>         struct drm_device {
>                 ...
>                 struct device *dev;
>                 ...
>         };
>
> which yields quite a few code locations using dev->dev which is
> IMHO unnecessary irritating:
>
>         $ git grep '\<dev->dev' v6.5-rc1 drivers/gpu/drm | wc -l
>         1633

I find that irritating as well...

Same for e.g. crtc->crtc.

Hence that's why I had sent patches to rename the base members in the
shmob_drm-specific subclasses of drm_{crtc,connector,plane} to "base".
https://lore.kernel.org/dri-devel/b3daca80f82625ba14e3aeaf2fca6dcefa056e47.=
1687423204.git.geert+renesas@glider.be

> Also the functions that deal with both a struct device and a struct
> drm_device often use "dev" for the struct device and then "ddev" for
> the drm_device (see for example amdgpu_device_get_pcie_replay_count()).

I guess you considered "drm_dev", because it is still a short name?
Code dealing with platform devices usually uses "pdev" and "dev".
Same for PCI drivers (despite "pci_dev" being a short name).

So my personal preference goes to "ddev".

EOF (End-of-Fuel ;-)

Gr{oetje,eeting}s,

                        Geert

--=20
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k=
.org

In personal conversations with technical people, I call myself a hacker. Bu=
t
when I'm talking to journalists I just say "programmer" or something like t=
hat.
                                -- Linus Torvalds


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 07:38:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 07:38:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562970.879804 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJqtq-00027N-Jt; Thu, 13 Jul 2023 07:38:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562970.879804; Thu, 13 Jul 2023 07:38:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJqtq-00027G-Gd; Thu, 13 Jul 2023 07:38:06 +0000
Received: by outflank-mailman (input) for mailman id 562970;
 Thu, 13 Jul 2023 07:38:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eJA9=C7=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qJqto-000278-2J
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 07:38:04 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20626.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::626])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 32c2326a-2150-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 09:38:03 +0200 (CEST)
Received: from DB7PR05CA0060.eurprd05.prod.outlook.com (2603:10a6:10:2e::37)
 by DBBPR08MB5916.eurprd08.prod.outlook.com (2603:10a6:10:205::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.22; Thu, 13 Jul
 2023 07:37:58 +0000
Received: from DBAEUR03FT020.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:2e:cafe::30) by DB7PR05CA0060.outlook.office365.com
 (2603:10a6:10:2e::37) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.22 via Frontend
 Transport; Thu, 13 Jul 2023 07:37:58 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT020.mail.protection.outlook.com (100.127.143.27) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.24 via Frontend Transport; Thu, 13 Jul 2023 07:37:58 +0000
Received: ("Tessian outbound d7adc65d10b4:v145");
 Thu, 13 Jul 2023 07:37:58 +0000
Received: from 1a12eaa746ff.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 0AD29DBA-D31C-49CC-8E16-03D89E2A3FDB.1; 
 Thu, 13 Jul 2023 07:37:47 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1a12eaa746ff.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 13 Jul 2023 07:37:47 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by GV1PR08MB7914.eurprd08.prod.outlook.com (2603:10a6:150:8e::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Thu, 13 Jul
 2023 07:37:44 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::488c:5182:718d:7759]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::488c:5182:718d:7759%4]) with mapi id 15.20.6588.017; Thu, 13 Jul 2023
 07:37:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 32c2326a-2150-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Lub41am0G2QnD/QIu3/whbu650UG4Z2jlHpyI5RbXQ8=;
 b=t3DIX4r67T4pxDEKaBNc0IPo9Mjo4mouvb1VYJrScQdE27mFQDhaCqCo7EMFIM+M1KCuz+60THP9R7lA9fCNBA2jcg7EDeS20BmIs4v/KOAa8bbCYAwjm4CviklfioMZgRVDfvrLTrOKgJHqaPo+Pv1b1ZKZcB0Tb6kqTSprk0U=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 845ed801df76a064
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=PoW17wD+cmwhJjKO/ayDaZckjz3OdmkoVtNueqvZ/Q/ioDZhPbHdcMR8PDisF8+RgulDuivvrHNXAoHvvtBjPYYg+V/Lip1/xIgzgYNoq6xHvFJ4ip9lFOMFQaTvRSfkFt8xyy3NaejuY6+UJMVeIHGkN5eGLbkfIaAwC7iv+jQ4WP/x6U2R+w8ow4Gw9SZLdnFFmTaN+4j7SWZXkUT29Un3ttYVpEbeNgXMeKQyDpRHemKnDyFZH5L3ReoD/PKhR/udEdcr5Xi4umfJAKJfGWa8DyJtsnGGBhVnmupbvqRjt8bgg3AB9NuOgMe9VuLy9QS3xYvatr7xLm0dMSszBQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Lub41am0G2QnD/QIu3/whbu650UG4Z2jlHpyI5RbXQ8=;
 b=Eiw50App27ZiOKUPUw34fINQPsu6ZkULxLNyZ/pghzhlA1w1qikvrjybFS38JO9O7uqoRU5QXcvUHjWfF2q5ZfiMouJEOLefxSKsP8Pn6xIsMyWPPmEP0Hx3NXrBjiPDVlR/Ip0od0aEuxJJeu7I+uiWD3D4Qy1SLTO4sBOil/KMQhiRkB0QG02THFqcyXGXyI5d5ieYW84VW/uIJAxuuhA5doB+43oNTwnk1LISsLFitWth7j/zs5p7s9h5YPd3YnEjj6wAGVXKm7lv55tSpWskxmCs4cDMkASwlTLGIzuSt2hiSE3Mcohvm5E7qiLe7S3wkgb+o29GaH4g46D+nQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Lub41am0G2QnD/QIu3/whbu650UG4Z2jlHpyI5RbXQ8=;
 b=t3DIX4r67T4pxDEKaBNc0IPo9Mjo4mouvb1VYJrScQdE27mFQDhaCqCo7EMFIM+M1KCuz+60THP9R7lA9fCNBA2jcg7EDeS20BmIs4v/KOAa8bbCYAwjm4CviklfioMZgRVDfvrLTrOKgJHqaPo+Pv1b1ZKZcB0Tb6kqTSprk0U=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, Jan
 Beulich <jbeulich@suse.com>, =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?=
	<roger.pau@citrix.com>
Subject: Re: [XEN PATCH v9 00/24] Xen FF-A mediator
Thread-Topic: [XEN PATCH v9 00/24] Xen FF-A mediator
Thread-Index: AQHZryQNERDOaolIdEep8BfaVs4WwK+16xOAgAFpUACAAAcagA==
Date: Thu, 13 Jul 2023 07:37:43 +0000
Message-ID: <DBFFABBE-AF3A-4ED1-8DAB-B00054D41C37@arm.com>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
 <480AA225-0590-40BE-BCD5-ADCCB1BC2274@arm.com>
 <CAHUa44FQotjOASHhUknwju20iOoFnub3erYOp+b_2+h=NCvv1A@mail.gmail.com>
In-Reply-To:
 <CAHUa44FQotjOASHhUknwju20iOoFnub3erYOp+b_2+h=NCvv1A@mail.gmail.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|GV1PR08MB7914:EE_|DBAEUR03FT020:EE_|DBBPR08MB5916:EE_
X-MS-Office365-Filtering-Correlation-Id: a135f542-0d10-4875-9e47-08db8374145c
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 78/i9e5Yu63PXnb4jX7f5Shd2SgbefuCV1tZBHfMpEPLdp6gfyh/h2Ww53vkT7ONzFgzULOy9nFTjdtnHczVmJDFEl/B6EElmSdJzGZmkJbEYMBMYWDqrBcCWixvvSe2RtvwlKDuhW92bjf2gQmqOjwr8rm47X3zBebxLzXWFMxpjk8XZie9RvC8MajF6RZfGOwR0sYCfSbTu9bh21JHFEMy07yDfYcU0Hw3WOpzvwzqm09ANn4erXVFdx/NviOHNHeyddW1Qfs4wBCfW8f+abD9qJSddSSGnLbEFD5/v6ZC8MTXVe3JgTxhP3sImPPIlCvaDaBrGRDnXoYYNlEVsUvZKRoG6RI8UnEIs92Isvhdc7Jx83jCAUigih+vkH8ECEnNv1T1233WiLAjo16empFKSwINVe8Gpw6XA8mY22fITDVEup+uUoQd0+B8hNMwswgsseemzwJO0uNnqh+Xh+HGJJgat7zsg3mCdNZd78U0VRzq04k5dqxpIbO9wFV3Bd7yX8F47DYku45tWE175thwDmSRvQ0OdjOP/uwH9XOebogrJjaB5PXDSXfTXf8uiCQpAapQ/xNWXVXyxTgDNweWoD6x1GtIeydVtvlRDOpCGfeafj11efxDBWpnFJSW8iLhH8FHSYJb5J08mET5IQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(346002)(39860400002)(136003)(366004)(451199021)(33656002)(2906002)(54906003)(41300700001)(71200400001)(478600001)(8936002)(36756003)(8676002)(7416002)(30864003)(66476007)(64756008)(76116006)(66446008)(66946007)(66556008)(91956017)(6916009)(4326008)(6486002)(316002)(83380400001)(122000001)(966005)(6512007)(38100700002)(5660300002)(86362001)(6506007)(38070700005)(2616005)(186003)(53546011)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <E1771C677E1E3F4484A667556E5872DB@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB7914
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT020.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	e753c570-4b66-4378-a9a1-08db83740bab
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	tV3Q4ESamocgSrQF369Kl1otg9BibHTGt0Buz61fjoC//u0AF6iwQGkB5YqdIKDxuzFQTsijKwItUGS9fave7axWo6ObaFSILUy3LIfxovSR6MBKC4K2cv8NVxet/Ljzjo3FxkSRMMYnmhrMO9ZZywbZ/Ix3TtaokJLxl9NXQWxfu4vSmB+gNz1//7sXC2rvhiWUITu3VlDjsog7Pc7czJvwVvRhpPFy7yKWr9OlOmbZdC5Hd+55RBHxA/vOUt5xNEpqQgoZY6lWSsSmnLuHX6CGmyLR1UHB1TB3QDOBY35y6qqTD1jZGXKA7GO3abOhp17GvBbzmqjwYrQ/Er60WCd11trRzNBfZvUUNT9UNeOK2/lLhkh/U72TVPTkdlF02+C5P37LQEvMWEyB0NpFa+FCq4uIxfuqFnQA6gLX3UblC6EM2DGVAZIrUx9icxJSV7wY/ZRF0oazCKeESCiAT2FXJXOfeq2zctn8QGuAYGQvj7yzLZgdD9O2y6U+N7EkMiVMWmyOpMctLZXCoClvye2W7//smFStPvpnzaynLXogEx+wg60SPjPFi/PThgLC+8G6knzxo5FmVYNM3vnD2cOWtj1sgUUF1dASCe1gnooVWdhg6OWbyHMqKg9P9W+T4r4c2TYl0u/rDpIupdwUDRY78KXaExUtebLl4N2S30rcADvqH3e66rVGYGTKqXn9O8jiK4oqhzgA8w9g9kI2qF20OJsIjoeehV+kzxxbCxE=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(376002)(136003)(396003)(451199021)(46966006)(36840700001)(40470700004)(6486002)(478600001)(54906003)(53546011)(6506007)(26005)(966005)(107886003)(6512007)(70586007)(30864003)(82310400005)(2906002)(316002)(41300700001)(5660300002)(4326008)(8936002)(8676002)(6862004)(70206006)(82740400003)(81166007)(356005)(36756003)(336012)(36860700001)(86362001)(47076005)(186003)(83380400001)(40460700003)(2616005)(33656002)(40480700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 07:37:58.3960
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: a135f542-0d10-4875-9e47-08db8374145c
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT020.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB5916

SGkgSmVucywNCg0KPiBPbiAxMyBKdWwgMjAyMywgYXQgMDk6MTIsIEplbnMgV2lrbGFuZGVyIDxq
ZW5zLndpa2xhbmRlckBsaW5hcm8ub3JnPiB3cm90ZToNCj4gDQo+IEhpIEJlcnRyYW5kLA0KPiAN
Cj4gT24gV2VkLCBKdWwgMTIsIDIwMjMgYXQgMTE6MznigK9BTSBCZXJ0cmFuZCBNYXJxdWlzDQo+
IDxCZXJ0cmFuZC5NYXJxdWlzQGFybS5jb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ZW4vaW5jbHVkZS94ZW4vZG9tYWluLmggICAg
ICAgICAgIHwgICAgMSArDQo+Pj4geGVuL2luY2x1ZGUveGVuL3NjaGVkLmggICAgICAgICAgICB8
ICAgIDEgKw0KPj4+IDI0IGZpbGVzIGNoYW5nZWQsIDIyNjQgaW5zZXJ0aW9ucygrKSwgMTMgZGVs
ZXRpb25zKC0pDQo+Pj4gY3JlYXRlIG1vZGUgMTAwNjQ0IHhlbi9hcmNoL2FybS9pbmNsdWRlL2Fz
bS90ZWUvZmZhLmgNCj4+PiBjcmVhdGUgbW9kZSAxMDA2NDQgeGVuL2FyY2gvYXJtL3RlZS9mZmEu
Yw0KPj4+IA0KPj4+IC0tDQo+Pj4gMi4zNC4xDQoNCg0K


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 07:45:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 07:45:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562975.879815 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJr0O-0003dU-GV; Thu, 13 Jul 2023 07:44:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562975.879815; Thu, 13 Jul 2023 07:44:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJr0O-0003dN-C2; Thu, 13 Jul 2023 07:44:52 +0000
Received: by outflank-mailman (input) for mailman id 562975;
 Thu, 13 Jul 2023 07:44:51 +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 <SRS0=1J9w=C7=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qJr0N-0003dG-AM
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 07:44:51 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 249010fc-2151-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 09:44:48 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 3CBD321E4E;
 Thu, 13 Jul 2023 07:44:48 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D457B133D6;
 Thu, 13 Jul 2023 07:44:47 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id rZdcMm+rr2QGFgAAMHmgww
 (envelope-from <jgross@suse.com>); Thu, 13 Jul 2023 07:44:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 249010fc-2151-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1689234288; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=nT5l3UP49ArGnrLIsUe3PysMDVm0cM6Rfg+dJxVHW24=;
	b=jFOgzSblKU14Q0CXzUig6ZuOu2SoGYouJEoH6e3JZ/e9GRy6X90sy8/qpKPiHp7v5VCzqQ
	8UzVU2vyUHskohjwwXaIHZT/WlwKcaz35E8mmU9wpKm+604L8d5tSMwb2ce3zvjdmVFG6v
	foeYeZdLH+dtw5BUbewqRhrYQSTsiBQ=
Message-ID: <a5521a9d-72c6-4e03-0fbb-8a37418c32f2@suse.com>
Date: Thu, 13 Jul 2023 09:44:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
To: Viresh Kumar <viresh.kumar@linaro.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
 =?UTF-8?Q?Alex_Benn=c3=a9e?= <alex.bennee@linaro.org>,
 stratos-dev@op-lists.linaro.org, Erik Schilling <erik.schilling@linaro.org>,
 Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
 Mathieu Poirier <mathieu.poirier@linaro.org>,
 xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
References: <d4e0233524b8c7c48614b09cae4d23f2cdf10988.1689150266.git.viresh.kumar@linaro.org>
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH] xen: privcmd: Add support for irqfd
In-Reply-To: <d4e0233524b8c7c48614b09cae4d23f2cdf10988.1689150266.git.viresh.kumar@linaro.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------clKjvCyTvP1SUvhYTh9jfB5C"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------clKjvCyTvP1SUvhYTh9jfB5C
Content-Type: multipart/mixed; boundary="------------1x8O0IqUVTBcrg0qq01qf3WJ";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Viresh Kumar <viresh.kumar@linaro.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
 =?UTF-8?Q?Alex_Benn=c3=a9e?= <alex.bennee@linaro.org>,
 stratos-dev@op-lists.linaro.org, Erik Schilling <erik.schilling@linaro.org>,
 Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
 Mathieu Poirier <mathieu.poirier@linaro.org>,
 xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Message-ID: <a5521a9d-72c6-4e03-0fbb-8a37418c32f2@suse.com>
Subject: Re: [PATCH] xen: privcmd: Add support for irqfd
References: <d4e0233524b8c7c48614b09cae4d23f2cdf10988.1689150266.git.viresh.kumar@linaro.org>
In-Reply-To: <d4e0233524b8c7c48614b09cae4d23f2cdf10988.1689150266.git.viresh.kumar@linaro.org>

--------------1x8O0IqUVTBcrg0qq01qf3WJ
Content-Type: multipart/mixed; boundary="------------B1tofwxR6qCDXyD8qrowJ0KX"

--------------B1tofwxR6qCDXyD8qrowJ0KX
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMTIuMDcuMjMgMTA6NDgsIFZpcmVzaCBLdW1hciB3cm90ZToNCj4gWGVuIHByb3ZpZGVz
IHN1cHBvcnQgZm9yIGluamVjdGluZyBpbnRlcnJ1cHRzIHRvIHRoZSBndWVzdHMgdmlhIHRo
ZQ0KPiBIWVBFUlZJU09SX2RtX29wKCkgaHlwZXJjYWxsLiBUaGUgc2FtZSBpcyB1c2VkIGJ5
IHRoZSBWaXJ0aW8gYmFzZWQNCj4gZGV2aWN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EBAIC0xMjUsNSArMTM3LDcg
QEAgc3RydWN0IHByaXZjbWRfbW1hcF9yZXNvdXJjZSB7DQo+ICAgCV9JT0MoX0lPQ19OT05F
LCAnUCcsIDYsIHNpemVvZihkb21pZF90KSkNCj4gICAjZGVmaW5lIElPQ1RMX1BSSVZDTURf
TU1BUF9SRVNPVVJDRQkJCQlcDQo+ICAgCV9JT0MoX0lPQ19OT05FLCAnUCcsIDcsIHNpemVv
ZihzdHJ1Y3QgcHJpdmNtZF9tbWFwX3Jlc291cmNlKSkNCj4gKyNkZWZpbmUgSU9DVExfUFJJ
VkNNRF9JUlFGRAkJCQkJXA0KPiArCV9JT0MoX0lPQ19OT05FLCAnUCcsIDgsIHNpemVvZihz
dHJ1Y3QgcHJpdmNtZF9pcnFmZCkpDQo+ICAgDQo+ICAgI2VuZGlmIC8qIF9fTElOVVhfUFVC
TElDX1BSSVZDTURfSF9fICovDQoNCg0KSnVlcmdlbg0K
--------------B1tofwxR6qCDXyD8qrowJ0KX
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc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1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------B1tofwxR6qCDXyD8qrowJ0KX--

--------------1x8O0IqUVTBcrg0qq01qf3WJ--

--------------clKjvCyTvP1SUvhYTh9jfB5C
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmSvq28FAwAAAAAACgkQsN6d1ii/Ey/u
Nwf/do9K+5IjkhDfy0lPIWyY5eREEAMS+Q3GpwqdkhzA7O94AoprX9xty6IiiJGs8Yk2ep5xQtkp
WBIRd85zUCa9mQQUjUa3jTjFmf1weU2fuKn69X/3LWikquDogV+RJXI8Oh8VzgNuCrijMfuk3yY4
YUIARLWEXOSD5JN7QqJsubEZBoC+971arxgUyFw7z/vMd+cPsYJRKB2gmGnYUXJu7XFlgA768PGO
RCksnXOb+EaTdffr00Uz6hJ9rp6+zGIMSvdMtyW7aybRqbXTtvP+Xe3YmxidnSnsunOgXyT7dBh9
jXsqLRwq9rsxOR3T/DUnslBbpwShftdAeKLnvKlf+Q==
=ac37
-----END PGP SIGNATURE-----

--------------clKjvCyTvP1SUvhYTh9jfB5C--


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 07:48:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 07:48:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562978.879823 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJr3o-0004Gv-0D; Thu, 13 Jul 2023 07:48:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562978.879823; Thu, 13 Jul 2023 07:48:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJr3n-0004Go-Tl; Thu, 13 Jul 2023 07:48:23 +0000
Received: by outflank-mailman (input) for mailman id 562978;
 Thu, 13 Jul 2023 07:47:58 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8EtB=C7=suse.de=tzimmermann@srs-se1.protection.inumbo.net>)
 id 1qJr3O-0004FS-HX
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 07:47:58 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9511ec69-2151-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 09:47:57 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 16DDF21EEB;
 Thu, 13 Jul 2023 07:47:57 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E78B1133D6;
 Thu, 13 Jul 2023 07:47:52 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id T3mGNyisr2TfFwAAMHmgww
 (envelope-from <tzimmermann@suse.de>); Thu, 13 Jul 2023 07:47:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9511ec69-2151-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1689234477; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=fTLCbBj1jIj95Vk3OEVFypBv7EXItxDal76mePPiA+8=;
	b=bfKVW45oDZYCmhcGzUIgQZ+XM2O+7qHiV9WC/mFCAEv40Hwgoiqqb7QSWK+9AKuXsYXNhb
	od858kfvxXxuDodtErQhUaoiXGVvC9/MboortVZngZd62zSh1gqDEHN6Lb+y1Fx0oVo2UN
	oE/CQhTubIOIM9rOtPUUjyLNImD3nNM=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1689234477;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=fTLCbBj1jIj95Vk3OEVFypBv7EXItxDal76mePPiA+8=;
	b=MPED7mOOf308DxNlQAQz9alnKoic0rEySaUqggFL2dp8f6pCIMJ2vQ6x0QJzdoYH0chOHe
	a0OZOdOtxBOs2mBQ==
Message-ID: <955528fe-fd45-b8c1-8458-b3a7cd3dfbbb@suse.de>
Date: Thu, 13 Jul 2023 09:47:51 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
Content-Language: en-US
To: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= <u.kleine-koenig@pengutronix.de>,
 Jani Nikula <jani.nikula@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, David Airlie <airlied@gmail.com>,
 Daniel Vetter <daniel@ffwll.ch>, Alex Deucher <alexander.deucher@amd.com>,
 =?UTF-8?Q?Christian_K=c3=b6nig?= <christian.koenig@amd.com>,
 "Pan, Xinhui" <Xinhui.Pan@amd.com>, Harry Wentland <harry.wentland@amd.com>,
 Leo Li <sunpeng.li@amd.com>, Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
 Hamza Mahfooz <hamza.mahfooz@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Guchun Chen <guchun.chen@amd.com>,
 Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
 Evan Quan <evan.quan@amd.com>, Likun Gao <Likun.Gao@amd.com>,
 =?UTF-8?B?TWFyZWsgT2zFocOhaw==?= <marek.olsak@amd.com>,
 David Francis <David.Francis@amd.com>, Hawking Zhang
 <Hawking.Zhang@amd.com>, Lang Yu <Lang.Yu@amd.com>,
 Philip Yang <Philip.Yang@amd.com>, Yifan Zhang <yifan1.zhang@amd.com>,
 Tim Huang <Tim.Huang@amd.com>, Zack Rusin <zackr@vmware.com>,
 Sam Ravnborg <sam@ravnborg.org>,
 Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
 =?UTF-8?Q?Ma=c3=adra_Canal?= <mairacanal@riseup.net>,
 =?UTF-8?Q?Andr=c3=a9_Almeida?= <andrealmeid@igalia.com>,
 Qingqing Zhuo <qingqing.zhuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>, Hersen Wu
 <hersenxs.wu@amd.com>, Fangzhi Zuo <jerry.zuo@amd.com>,
 Stylon Wang <stylon.wang@amd.com>, Alan Liu <haoping.liu@amd.com>,
 Wayne Lin <Wayne.Lin@amd.com>, Aaron Liu <aaron.liu@amd.com>,
 Melissa Wen <mwen@igalia.com>, Bhawanpreet Lakha
 <Bhawanpreet.Lakha@amd.com>, David Tadokoro <davidbtadokoro@usp.br>,
 Wenjing Liu <wenjing.liu@amd.com>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 Mario Limonciello <mario.limonciello@amd.com>,
 Alexey Kodanev <aleksei.kodanev@bell-sw.com>, Roman Li <roman.li@amd.com>,
 =?UTF-8?Q?Joaqu=c3=adn_Ignacio_Aramend=c3=ada?= <samsagax@gmail.com>,
 Dave Airlie <airlied@redhat.com>, Russell King <linux@armlinux.org.uk>,
 Liviu Dudau <liviu.dudau@arm.com>, Joel Stanley <joel@jms.id.au>,
 Boris Brezillon <bbrezillon@kernel.org>,
 Nicolas Ferre <nicolas.ferre@microchip.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 Claudiu Beznea <claudiu.beznea@microchip.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Stefan Agner <stefan@agner.ch>, Alison Wang <alison.wang@nxp.com>,
 Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
 =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= <noralf@tronnes.org>,
 Xinliang Liu <xinliang.liu@linaro.org>, Tian Tao <tiantao6@hisilicon.com>,
 Danilo Krummrich <dakr@redhat.com>, Deepak Rawat <drawat.floss@gmail.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
 =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= <ville.syrjala@linux.intel.com>,
 Lucas De Marchi <lucas.demarchi@intel.com>,
 Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
 Andrzej Hajda <andrzej.hajda@intel.com>,
 Matt Roper <matthew.d.roper@intel.com>,
 Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
 Hans de Goede <hdegoede@redhat.com>, Luca Coelho <luciano.coelho@intel.com>,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 Kai Vehmanen <kai.vehmanen@linux.intel.com>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 =?UTF-8?Q?=c5=81ukasz_Bartosik?= <lb@semihalf.com>,
 Anusha Srivatsa <anusha.srivatsa@intel.com>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
 Uma Shankar <uma.shankar@intel.com>, Imre Deak <imre.deak@intel.com>,
 Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
 Swati Sharma <swati2.sharma@intel.com>,
 =?UTF-8?Q?Jouni_H=c3=b6gander?= <jouni.hogander@intel.com>,
 Mika Kahola <mika.kahola@intel.com>,
 =?UTF-8?Q?Jos=c3=a9_Roberto_de_Souza?= <jose.souza@intel.com>,
 Arun R Murthy <arun.r.murthy@intel.com>,
 Gustavo Sousa <gustavo.sousa@intel.com>,
 Khaled Almahallawy <khaled.almahallawy@intel.com>,
 Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
 Andi Shyti <andi.shyti@linux.intel.com>, Nirmoy Das <nirmoy.das@intel.com>,
 Fei Yang <fei.yang@intel.com>, Animesh Manna <animesh.manna@intel.com>,
 Deepak R Varma <drv@mailo.com>, "Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
 Vandita Kulkarni <vandita.kulkarni@intel.com>,
 Suraj Kandpal <suraj.kandpal@intel.com>,
 Drew Davenport <ddavenport@chromium.org>,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>,
 Philipp Zabel <p.zabel@pengutronix.de>, Dan Carpenter <error27@gmail.com>,
 Paul Cercueil <paul@crapouillou.net>,
 Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Linus Walleij <linus.walleij@linaro.org>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>, Rob Clark <robdclark@gmail.com>,
 Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Vinod Polimera <quic_vpolimer@quicinc.com>,
 Jiasheng Jiang <jiasheng@iscas.ac.cn>,
 Konrad Dybcio <konrad.dybcio@linaro.org>,
 Jessica Zhang <quic_jesszhan@quicinc.com>, Liu Shixin
 <liushixin2@huawei.com>, Marek Vasut <marex@denx.de>,
 Ben Skeggs <bskeggs@redhat.com>, Karol Herbst <kherbst@redhat.com>,
 Lyude Paul <lyude@redhat.com>, Tomi Valkeinen <tomba@kernel.org>,
 Emma Anholt <emma@anholt.net>, Gerd Hoffmann <kraxel@redhat.com>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>,
 Geert Uytterhoeven <geert+renesas@glider.be>,
 Biju Das <biju.das.jz@bp.renesas.com>, Sandy Huang <hjc@rock-chips.com>,
 =?UTF-8?Q?Heiko_St=c3=bcbner?= <heiko@sntech.de>,
 Orson Zhai <orsonzhai@gmail.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>,
 Alain Volmat <alain.volmat@foss.st.com>,
 Yannick Fertre <yannick.fertre@foss.st.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Philippe Cornu <philippe.cornu@foss.st.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>, Chen-Yu Tsai
 <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>,
 Samuel Holland <samuel@sholland.org>,
 Thierry Reding <thierry.reding@gmail.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Jyri Sarha <jyri.sarha@iki.fi>,
 David Lechner <david@lechnology.com>,
 Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
 Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
 Melissa Wen <melissa.srw@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Michal Simek <michal.simek@amd.com>,
 Haneen Mohammed <hamohammed.sa@gmail.com>, linux-hyperv@vger.kernel.org,
 linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org,
 dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org,
 Yongqin Liu <yongqin.liu@linaro.org>, Alim Akhtar <alim.akhtar@samsung.com>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 Fabio Estevam <festevam@gmail.com>, Sumit Semwal <sumit.semwal@linaro.org>,
 Jerome Brunet <jbrunet@baylibre.com>, linux-samsung-soc@vger.kernel.org,
 amd-gfx@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com,
 linux-rockchip@lists.infradead.org,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
 NXP Linux Team <linux-imx@nxp.com>, spice-devel@lists.freedesktop.org,
 linux-sunxi@lists.linux.dev,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-mediatek@lists.infradead.org, xen-devel@lists.xenproject.org,
 linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org,
 Gurchetan Singh <gurchetansingh@chromium.org>, Sean Paul <sean@poorly.run>,
 linux-arm-kernel@lists.infradead.org,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 Andrew Jeffery <andrew@aj.id.au>, linux-mips@vger.kernel.org,
 Chia-I Wu <olvaffe@gmail.com>, linux-renesas-soc@vger.kernel.org,
 kernel@pengutronix.de, John Stultz <jstultz@google.com>,
 freedreno@lists.freedesktop.org, Lucas Stach <l.stach@pengutronix.de>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com> <20230712161025.22op3gtzgujrhytb@pengutronix.de>
From: Thomas Zimmermann <tzimmermann@suse.de>
In-Reply-To: <20230712161025.22op3gtzgujrhytb@pengutronix.de>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------kFtFEiqeMKJZ4HgZ6qn0z8X0"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------kFtFEiqeMKJZ4HgZ6qn0z8X0
Content-Type: multipart/mixed; boundary="------------hX0Y0L30m6F5STQTlkmw5Rlm";
 protected-headers="v1"
From: Thomas Zimmermann <tzimmermann@suse.de>
To: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= <u.kleine-koenig@pengutronix.de>,
 Jani Nikula <jani.nikula@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, David Airlie <airlied@gmail.com>,
 Daniel Vetter <daniel@ffwll.ch>, Alex Deucher <alexander.deucher@amd.com>,
 =?UTF-8?Q?Christian_K=c3=b6nig?= <christian.koenig@amd.com>,
 "Pan, Xinhui" <Xinhui.Pan@amd.com>, Harry Wentland <harry.wentland@amd.com>,
 Leo Li <sunpeng.li@amd.com>, Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
 Hamza Mahfooz <hamza.mahfooz@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Guchun Chen <guchun.chen@amd.com>,
 Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
 Evan Quan <evan.quan@amd.com>, Likun Gao <Likun.Gao@amd.com>,
 =?UTF-8?B?TWFyZWsgT2zFocOhaw==?= <marek.olsak@amd.com>,
 David Francis <David.Francis@amd.com>, Hawking Zhang
 <Hawking.Zhang@amd.com>, Lang Yu <Lang.Yu@amd.com>,
 Philip Yang <Philip.Yang@amd.com>, Yifan Zhang <yifan1.zhang@amd.com>,
 Tim Huang <Tim.Huang@amd.com>, Zack Rusin <zackr@vmware.com>,
 Sam Ravnborg <sam@ravnborg.org>,
 Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
 =?UTF-8?Q?Ma=c3=adra_Canal?= <mairacanal@riseup.net>,
 =?UTF-8?Q?Andr=c3=a9_Almeida?= <andrealmeid@igalia.com>,
 Qingqing Zhuo <qingqing.zhuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>, Hersen Wu
 <hersenxs.wu@amd.com>, Fangzhi Zuo <jerry.zuo@amd.com>,
 Stylon Wang <stylon.wang@amd.com>, Alan Liu <haoping.liu@amd.com>,
 Wayne Lin <Wayne.Lin@amd.com>, Aaron Liu <aaron.liu@amd.com>,
 Melissa Wen <mwen@igalia.com>, Bhawanpreet Lakha
 <Bhawanpreet.Lakha@amd.com>, David Tadokoro <davidbtadokoro@usp.br>,
 Wenjing Liu <wenjing.liu@amd.com>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 Mario Limonciello <mario.limonciello@amd.com>,
 Alexey Kodanev <aleksei.kodanev@bell-sw.com>, Roman Li <roman.li@amd.com>,
 =?UTF-8?Q?Joaqu=c3=adn_Ignacio_Aramend=c3=ada?= <samsagax@gmail.com>,
 Dave Airlie <airlied@redhat.com>, Russell King <linux@armlinux.org.uk>,
 Liviu Dudau <liviu.dudau@arm.com>, Joel Stanley <joel@jms.id.au>,
 Boris Brezillon <bbrezillon@kernel.org>,
 Nicolas Ferre <nicolas.ferre@microchip.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 Claudiu Beznea <claudiu.beznea@microchip.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Stefan Agner <stefan@agner.ch>, Alison Wang <alison.wang@nxp.com>,
 Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
 =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= <noralf@tronnes.org>,
 Xinliang Liu <xinliang.liu@linaro.org>, Tian Tao <tiantao6@hisilicon.com>,
 Danilo Krummrich <dakr@redhat.com>, Deepak Rawat <drawat.floss@gmail.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
 =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= <ville.syrjala@linux.intel.com>,
 Lucas De Marchi <lucas.demarchi@intel.com>,
 Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
 Andrzej Hajda <andrzej.hajda@intel.com>,
 Matt Roper <matthew.d.roper@intel.com>,
 Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
 Hans de Goede <hdegoede@redhat.com>, Luca Coelho <luciano.coelho@intel.com>,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 Kai Vehmanen <kai.vehmanen@linux.intel.com>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 =?UTF-8?Q?=c5=81ukasz_Bartosik?= <lb@semihalf.com>,
 Anusha Srivatsa <anusha.srivatsa@intel.com>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
 Uma Shankar <uma.shankar@intel.com>, Imre Deak <imre.deak@intel.com>,
 Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
 Swati Sharma <swati2.sharma@intel.com>,
 =?UTF-8?Q?Jouni_H=c3=b6gander?= <jouni.hogander@intel.com>,
 Mika Kahola <mika.kahola@intel.com>,
 =?UTF-8?Q?Jos=c3=a9_Roberto_de_Souza?= <jose.souza@intel.com>,
 Arun R Murthy <arun.r.murthy@intel.com>,
 Gustavo Sousa <gustavo.sousa@intel.com>,
 Khaled Almahallawy <khaled.almahallawy@intel.com>,
 Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
 Andi Shyti <andi.shyti@linux.intel.com>, Nirmoy Das <nirmoy.das@intel.com>,
 Fei Yang <fei.yang@intel.com>, Animesh Manna <animesh.manna@intel.com>,
 Deepak R Varma <drv@mailo.com>, "Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
 Vandita Kulkarni <vandita.kulkarni@intel.com>,
 Suraj Kandpal <suraj.kandpal@intel.com>,
 Drew Davenport <ddavenport@chromium.org>,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>,
 Philipp Zabel <p.zabel@pengutronix.de>, Dan Carpenter <error27@gmail.com>,
 Paul Cercueil <paul@crapouillou.net>,
 Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Linus Walleij <linus.walleij@linaro.org>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>, Rob Clark <robdclark@gmail.com>,
 Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Vinod Polimera <quic_vpolimer@quicinc.com>,
 Jiasheng Jiang <jiasheng@iscas.ac.cn>,
 Konrad Dybcio <konrad.dybcio@linaro.org>,
 Jessica Zhang <quic_jesszhan@quicinc.com>, Liu Shixin
 <liushixin2@huawei.com>, Marek Vasut <marex@denx.de>,
 Ben Skeggs <bskeggs@redhat.com>, Karol Herbst <kherbst@redhat.com>,
 Lyude Paul <lyude@redhat.com>, Tomi Valkeinen <tomba@kernel.org>,
 Emma Anholt <emma@anholt.net>, Gerd Hoffmann <kraxel@redhat.com>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>,
 Geert Uytterhoeven <geert+renesas@glider.be>,
 Biju Das <biju.das.jz@bp.renesas.com>, Sandy Huang <hjc@rock-chips.com>,
 =?UTF-8?Q?Heiko_St=c3=bcbner?= <heiko@sntech.de>,
 Orson Zhai <orsonzhai@gmail.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>,
 Alain Volmat <alain.volmat@foss.st.com>,
 Yannick Fertre <yannick.fertre@foss.st.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Philippe Cornu <philippe.cornu@foss.st.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>, Chen-Yu Tsai
 <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>,
 Samuel Holland <samuel@sholland.org>,
 Thierry Reding <thierry.reding@gmail.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Jyri Sarha <jyri.sarha@iki.fi>,
 David Lechner <david@lechnology.com>,
 Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
 Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
 Melissa Wen <melissa.srw@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Michal Simek <michal.simek@amd.com>,
 Haneen Mohammed <hamohammed.sa@gmail.com>, linux-hyperv@vger.kernel.org,
 linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org,
 dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org,
 Yongqin Liu <yongqin.liu@linaro.org>, Alim Akhtar <alim.akhtar@samsung.com>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 Fabio Estevam <festevam@gmail.com>, Sumit Semwal <sumit.semwal@linaro.org>,
 Jerome Brunet <jbrunet@baylibre.com>, linux-samsung-soc@vger.kernel.org,
 amd-gfx@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com,
 linux-rockchip@lists.infradead.org,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
 NXP Linux Team <linux-imx@nxp.com>, spice-devel@lists.freedesktop.org,
 linux-sunxi@lists.linux.dev,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-mediatek@lists.infradead.org, xen-devel@lists.xenproject.org,
 linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org,
 Gurchetan Singh <gurchetansingh@chromium.org>, Sean Paul <sean@poorly.run>,
 linux-arm-kernel@lists.infradead.org,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 Andrew Jeffery <andrew@aj.id.au>, linux-mips@vger.kernel.org,
 Chia-I Wu <olvaffe@gmail.com>, linux-renesas-soc@vger.kernel.org,
 kernel@pengutronix.de, John Stultz <jstultz@google.com>,
 freedreno@lists.freedesktop.org, Lucas Stach <l.stach@pengutronix.de>
Message-ID: <955528fe-fd45-b8c1-8458-b3a7cd3dfbbb@suse.de>
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com> <20230712161025.22op3gtzgujrhytb@pengutronix.de>
In-Reply-To: <20230712161025.22op3gtzgujrhytb@pengutronix.de>

--------------hX0Y0L30m6F5STQTlkmw5Rlm
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

SGkNCg0KQW0gMTIuMDcuMjMgdW0gMTg6MTAgc2NocmllYiBVd2UgS2xlaW5lLUvDtm5pZzoN
Cj4gSGVsbG8gSmFuaSwNCj4gDQo+IE9uIFdlZCwgSnVsIDEyLCAyMDIzIGF0IDA1OjM0OjI4
UE0gKzAzMDAsIEphbmkgTmlrdWxhIHdyb3RlOg0KPj4gT24gV2VkLCAxMiBKdWwgMjAyMywg
VXdlIEtsZWluZS1Lw7ZuaWcgPHUua2xlaW5lLWtvZW5pZ0BwZW5ndXRyb25peC5kZT4gd3Jv
dGU6DQo+Pj4gSGVsbG8sDQo+Pj4NCj4+PiB3aGlsZSBJIGRlYnVnZ2VkIGFuIGlzc3VlIGlu
IHRoZSBpbXgtbGNkYyBkcml2ZXIgSSB3YXMgY29uc3RhbnRseQ0KPj4+IGlycml0YXRlZCBh
Ym91dCBzdHJ1Y3QgZHJtX2R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CBJJ20gZmlybWx5IGluIHRoZQ0KPj4g
Y2FtcCB0aGUgbmFtZSBzaG91bGQgYmUgImRybSIgYW5kIG5vdGhpbmcgZWxzZS4NCj4gDQo+
IFVwIHRvIG5vdyBwb3NpdGl2ZSBmZWVkYmFjayBpcyBpbiB0aGUgbWFqb3JpdHkuDQo+IA0K
PiBCZXN0IHJlZ2FyZHMNCj4gVXdlDQo+IA0KDQotLSANClRob21hcyBaaW1tZXJtYW5uDQpH
cmFwaGljcyBEcml2ZXIgRGV2ZWxvcGVyDQpTVVNFIFNvZnR3YXJlIFNvbHV0aW9ucyBHZXJt
YW55IEdtYkgNCkZyYW5rZW5zdHJhc3NlIDE0NiwgOTA0NjEgTnVlcm5iZXJnLCBHZXJtYW55
DQpHRjogSXZvIFRvdGV2LCBBbmRyZXcgTXllcnMsIEFuZHJldyBNY0RvbmFsZCwgQm91ZGll
biBNb2VybWFuDQpIUkIgMzY4MDkgKEFHIE51ZXJuYmVyZykNCg==

--------------hX0Y0L30m6F5STQTlkmw5Rlm--

--------------kFtFEiqeMKJZ4HgZ6qn0z8X0
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEExndm/fpuMUdwYFFolh/E3EQov+AFAmSvrCcFAwAAAAAACgkQlh/E3EQov+DJ
PhAAr98ggA96Z2w3wyv8ofgp+UF6w/zMt4QW5UGdlEVnsbSsMsZvzn6wF08HFKbQtN5a9iBBnt+f
5/tIfU2f76afG8WDSbUKW61ZnEu2EwZxLY207Vbeo7SD6US8W3NgaA+cs6nEccA1AHKPOU/uTPY5
gRTqzdtti6+N+iz/aj5bcKRfBe5zkJj2TDVOg4VM2nMcOcnqdlBG6zxcOd0/7f822X2h5FHYvBcw
WUfoBgp4CFBkpWLyeqVk9jQiMCZrwXiYsPo5X/YIqG46xhIfOvWDnjz8oaDzoT/gK/vXmAwUmqf8
vHkvk7fn09fN0tUL4ErUqunJZ3PbPA20sm3kPFUp9/46XcnGYjD8HkdeV6c71IprSuqW8nPRKQ5a
i41BoLZQ9LL7bPhGplpNEiUIMARvShWvgE7VmkSC8B1qDnKabHCwlbDmvBk7bpHG9RsvQWi24ubI
DyVUFa2lyRHB7jA8y0aspgqorAzQ0EcrZMCJVXMkUg0NRU/uRqxFstG04a7HT872oOIEv6NmcHnK
hSfYDTA6iDuTxmmErZ8/111b0zHL3jzBuYFuk7yCILHUrU7mIVpyoWBF8ANEOixG5oDraOC5T2D7
CMTZtgFjeJ8M3Vw3T5cSe0q7eW4ZxS1m/qYVeVvZoYBwBXs/sQWTyQZe17comjBkKzAvWT/5rS/u
eL0=
=Tts0
-----END PGP SIGNATURE-----

--------------kFtFEiqeMKJZ4HgZ6qn0z8X0--


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 07:49:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 07:49:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562986.879833 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJr4l-0004rd-Gm; Thu, 13 Jul 2023 07:49:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562986.879833; Thu, 13 Jul 2023 07:49:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJr4l-0004rW-ED; Thu, 13 Jul 2023 07:49:23 +0000
Received: by outflank-mailman (input) for mailman id 562986;
 Thu, 13 Jul 2023 07:49:21 +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 <SRS0=0tL6=C7=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJr4j-0004rM-Nd
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 07:49:21 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20603.outbound.protection.outlook.com
 [2a01:111:f400:7d00::603])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c5ef1ec5-2151-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 09:49:19 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by DB9PR04MB8432.eurprd04.prod.outlook.com (2603:10a6:10:243::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24; Thu, 13 Jul
 2023 07:49:16 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Thu, 13 Jul 2023
 07:49:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c5ef1ec5-2151-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=NsmTe9e9CqaqAZcFBtgOTyh5dchxgcew9QBvkFa2x34+QxJfnaNMAXT+x8lD90KFXMXkhxmfRffYdZaEaW72FEIg6rrMa259VigcfEo+A+iB1nGGR7VaHgGx3AS5D53sX8MLKQfekErWvX8U2ojlw9pyv2kkL3P67StEKHykvFh+J2ORSV3uQeib0Amk1ewZMuUwYG5EUQM2G/3quSllfejZTpzfNciGb5/ysAPO4irV4O4AD7u4JFPQyftTLyyEtsw54k50HPNwhJRARL5+7h+wRCOvB1Izxx/vNY531709AFdzM98kQSbiyjfQZYi/5O89nwXX81c1bZKiWSmSrg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=DjO+xW2IuCqUIrUfCx5Fb7+6nhCjDXBnnfII4gE1vTE=;
 b=jOZhQBB00dv4eNZ3Hprh+/l1Q8hX3f44TW8OUqNxF08jZKvUg2vTy+J5fmqAJrb9lXtQEO8uyylIz7Br62spu9dgFPpd3YRyeomKSoleIGtV1oh4bOaHO+rui636iUtj9GMetCez21KlGNOv3P7NdS50iieD+z//dmH1RyMN38H2J8lba5Gg8shqPvSfoMDrhebo6dcFmKP07yLK4H+qWeOGl4heWuGVCOjRhWuW4eJZ8m00wmAiSgwA+6kRkMXDovOUr9eSj+wrK7L0is72UHqzprawmlbY8DtYcpKQpr+ZC3b7zEQkM1ajrgCsiNqpbRCVG/dkWUOdswZF/ZgxBQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=DjO+xW2IuCqUIrUfCx5Fb7+6nhCjDXBnnfII4gE1vTE=;
 b=qtMOb3p0XHAoHJf2TmUbJFyEcbb01Dyzl4NIUdGGCpUV2pXlnkZCra2I7DwYZMtWR9dZ8sVhCBBdcPwrlkgR/nKs+//nEG0RT1yfhZMA7fqv45jJsTn1jg8gs7yKkNBeC1VAW53mWBIvdX2Elz1KC3axOZz79BPB1YgRVOMNYEBa5due4c/ZNHdP9uZtg/Xu89fxYSItawI8P/FhITx5+YTNaKuwlZzwJOKSTD5GoLQgMjtKDtUoUfX7unzlfR7Syl9y52YoGT2Jcj77fVKVCLrlzgRSsgJA3QpTEISGB+NBzr3zfCpfDuYoM+P5JjMls/KA3XZ0836dvTWE6TuLgQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <6d0ed712-0807-33b6-1586-a0588086c3a7@suse.com>
Date: Thu, 13 Jul 2023 09:49:14 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] x86/ioapic: sanitize IO-APIC pins before enabling the
 local APIC
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230707095338.44244-1-roger.pau@citrix.com>
 <92d16012-ff9f-693b-07c6-d45fe07a00a0@suse.com>
 <ZKwZBQ_0Z2c7NJNL@MacBook-Air-de-Roger.local>
 <1f79491a-46f5-5293-e92f-0e2b0b3efb62@suse.com>
 <ZK1S1V71ZUIPjKqZ@MacBook-Air-de-Roger.local>
 <eb2e3b57-a423-cf52-0192-a344db33a58f@suse.com>
 <ZK6wcpHnh5OgHv4R@MacBook-Air-de-Roger.local>
 <d84482f4-8be6-e514-58a7-a529890c8feb@suse.com>
 <ZK7JwEhrB-70nlla@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZK7JwEhrB-70nlla@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0085.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9b::12) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DB9PR04MB8432:EE_
X-MS-Office365-Filtering-Correlation-Id: d3ac35c3-f73b-4398-fcc7-08db8375a81e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	8Bq4dsf0wXYppoKh2X8wjnvSkmACw8r5sM9lGfHUqmatPakYs82acQVavsnWTmc/xWzw6PgdCIK0SxCdk6UBTCvJkRSVQhRza9j7+BXBgfZpAMJrCmj3jEIrS4KOMmdV8qJVpvRo2gQmbUG0Tg8wCIccvGxTsCNw2EEE3WeonRiAHFuIFWPVSRrYu+0OVIDDKyBUln78dVVDjwdtMsTfhq/ycx4wEGJ2aSHgaNml6WXdmhLTC/lbIpQy+nXpSTQt2YBxprwRU/WczebO4sw4ITaDyqnKc/Wjeo4QZiMr+0lE49IpD2o3C8mmZZYMtRg/4s9EMJ6aAO1/4mWHhtzcREsm38IxNvRkAW7u2T0aFLQD2bLYgWCfi5M4v/iTgtp6oe6Yff7Tblp+3Q2cIuCX0HbLmaTb08U30V+IDPm7Q1ZaX7cLKqKMjztjLOTiWCJDpOGN8GAQk1AbNB4UNCjn/L8TjHgzPBkhr/WTA4Pc/KWAc2vON4aL/kFbbJcJukEWouW67srDYkl0ixW4klJkvSvCXZA+/eArG/zCqgcKJGmTQ/fq7LSp6BBYDhj5V3hW7yTmiPMorPbGrqBDy7Riaq61KhSOjMbq36i98vTq2Dl5LQPMGt6mOvs7nMmVAT/GtiX7c5v8DTyb3PHAj/nYrQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(396003)(136003)(366004)(39860400002)(376002)(451199021)(54906003)(316002)(186003)(66946007)(6916009)(31686004)(4326008)(6486002)(66556008)(66476007)(478600001)(41300700001)(6512007)(8676002)(8936002)(53546011)(86362001)(31696002)(6506007)(26005)(5660300002)(83380400001)(2616005)(36756003)(2906002)(38100700002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?czB4YXArb1FZQVhQaXZUUmR5dlVtNlZJOUJUcHZ2VUNieGorRHd2RUxzZU53?=
 =?utf-8?B?ZytVVEgzOThFd3FqSE53dTh6T3NZSjJiVGFGN3p2QmNQemlISVF1S2J1WXRr?=
 =?utf-8?B?UHp4cUVORjlpcmZhYUpPNzBGVXN2SnlRYVZNUWJqOFMyejJJSHFjMDJGd2dn?=
 =?utf-8?B?emo5T2o1eG1ST2c3V042RXNEK2o4MUM0YVVvZ0oyWktKczlEeVRUM25UV1R1?=
 =?utf-8?B?M2g4WVhwMHdPUXg2NXlhNmFJc1hKaTdtamRvbUZHV3dxckl3ZVl3YlRJUUpi?=
 =?utf-8?B?Mi9oLzIvUHJHZjFhWXI4T0pPT3lmL0w0SWJlZVdpS2ZmMVF3Z0xRWGp6bDlG?=
 =?utf-8?B?VjQvNGpxU3B0NkIvT0x6QWxqem4veDZoeTA0eWVqMStxU3N4cVNibDlGekFi?=
 =?utf-8?B?c25qSlJKWUMzS0lWWXlvWUk5dlg5dTZYaklPTzZRUzJZVFh0dGJrRys1UnFO?=
 =?utf-8?B?M0ErV3Bla2pZOS9ZMUdaMXZ4a1JKV09rNU93OGM3REpXenI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ange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 07:49:15.9857
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ZFyZqcINRhCUgdgY/buE9ezHpqZQbsLaX4C+sJ0GRDl3G5eN5/RWlDk2OXmAEc7okhC4S7TB8umV94W/rxZNtQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8432

On 12.07.2023 17:41, Roger Pau MonnÃ© wrote:
> On Wed, Jul 12, 2023 at 04:50:34PM +0200, Jan Beulich wrote:
>> Hmm. The question really is which of the changes we want to backport.
>> That one should be first. While it's largely guesswork, I'd be more
>> inclined to take the change that has less of an effect overall.
> 
> My views would be the other way around I think.  Current code already
> has a comment to notice that IO-APIC pins might be wrongly unmasked,
> and there's also logic for masking them when the IO-APICs are
> initialized.  The fact that such logic is placed after the local APIC
> has been initialized is IMO a bug, as having unmasked unconfigured
> IO-APIC pins when the local APIC is enabled should be avoided.

Hmm, if you really meant this (and not setting up / unmasking of
LVTERR), then your change would still be insufficient. We may enable
the APIC for the BSP in init_bsp_APIC() (which is called quite a bit
earlier), and the APIC may also have been enabled by firmware already,
so I don't view this argument as fully convincing. (That said,
init_bsp_APIC() calls clear_local_APIC(), so while the LAPIC may be
enabled, errors would be reported only in ESR, not by delivering
interrupts.)

Which gets me back to another aspect of your scenario that I haven't
fully understood: In the description you say that booting fails.
Since we handle the errors, the implication is that the pin remains
constantly active (thus triggering errors over and over again). Yet
how would this not already cause problems ahead of smp_prepare_cpus()
if the LAPIC was already enabled? Wouldn't we need to do part of
clear_local_APIC() from init_bsp_APIC() before bailing from there
when smp_found_config is set? ("Part of" because as per the comment
at the top of init_bsp_APIC() we apparently would need to leave LVT0
[and then perhaps also LVT1] unmasked.)

>> That said I can see that Linux have their enable_IO_APIC() calls
>> also ahead of setup_IO_APIC() (but after connect_bsp_APIC() and
>> setup_local_APIC()). IOW with your change we'd do the masking yet
>> earlier than them. This may of course even be advantageous, but
>> there may also be good reasons for the sequence they're using.
> 
> Linux calls enable_IO_APIC() before setting up the local
> APIC LVT Error vector (that's done in end_local_APIC_setup()).  That
> logic seems to be introduced by commit:
> 
> 1c69524c2e5b x86: clear IO_APIC before enabing apic error vector.
> 
> Might it be less controversial to do like Linux does and call
> enable_IO_APIC() before the local APIC ESR is setup?

You already do so, just that you do it yet earlier. I'm not
convinced it needs doing from the middle of setup_local_APIC() (or,
like nowaday's Linux has it, with ESR / LVTERR setup split to a
separate function, and enable_IO_APIC() called between those two
LAPIC related calls). You also disliked putting the call at the
beginning of setup_local_APIC(), so putting it in the middle of it
might be yet worse when taking that perspective. (Another downside
of calling it from anywhere in setup_local_APIC() is that this
would be another __init function called from a non-__init one. We
have examples of such, and keying the call to "bsp" would leave it
safe, but avoiding such calls when we easily can is probably a
worthwhile secondary goal.)

Question is whether it can sensibly be moved at least a little
later: verify_local_APIC() isn't of much use anyway, first and
foremost because we ignore its return value. And connect_bsp_APIC()
largely is concerned about leaving PIC mode. So maybe put the call
immediately ahead of the setup_local_APIC(true) ones?

A further question is whether, considering that Linux continues to
use that name, we wouldn't be better off not renaming the function.

One other thing I finally figured was confusing me in the
description of the patch; re-quoting that paragraph here:

"Fix this by moving the masking of IO-APIC pins ahead of the enabling
 of the local APIC.  Note that before doing such masking Xen attempts
 to detect the pin where the legacy i8259 is connected, and that logic
 relies on the pin being unmasked, hence the logic is also moved ahead
 of enabling the local APIC."

The last sentence saying "also" is kind of odd with the first one
already stating this very movement. To me it's therefore unclear what
exactly the second sentence is intended to be telling me. I guess you
want to express that together with the making the detection logic is
also moved (i.e. the entire function is called earlier), but I'm
afraid this isn't the only way to read that second sentence.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 07:50:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 07:50:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562984.879844 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJr5V-0006Ex-Rm; Thu, 13 Jul 2023 07:50:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562984.879844; Thu, 13 Jul 2023 07:50:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJr5V-0006Eq-OQ; Thu, 13 Jul 2023 07:50:09 +0000
Received: by outflank-mailman (input) for mailman id 562984;
 Thu, 13 Jul 2023 07:48:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8EtB=C7=suse.de=tzimmermann@srs-se1.protection.inumbo.net>)
 id 1qJr4H-0004dM-Nl
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 07:48:53 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b636d2cb-2151-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 09:48:53 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 180B51FD87;
 Thu, 13 Jul 2023 07:48:52 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4032B133D6;
 Thu, 13 Jul 2023 07:48:48 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id ObRHDmCsr2RnGAAAMHmgww
 (envelope-from <tzimmermann@suse.de>); Thu, 13 Jul 2023 07:48:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b636d2cb-2151-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1689234532; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=/33jkpkQxS3/vwlD2R7UYefGuqjA2q3OxN4xqqzYfOI=;
	b=zO/SKlF/sarMqsGTLKLvl/G1tCEvmzH7Xs1dDqV5Umym61eMgmExwL2tnzK5BnmI/3Mdsu
	aJF06qy39qB+bzXHxRNOHQ4Hjr8Hok7juUwmvN9Rs+tnSKVCdRlBhoVVzBNxjETzNzDbDk
	xtomNWurXcWy8sMACRKKi+nnwSCm6gY=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1689234532;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=/33jkpkQxS3/vwlD2R7UYefGuqjA2q3OxN4xqqzYfOI=;
	b=sZw3JpW05ADQZuJaPrsZWWONBk3QH3yibc8VckQeB2ASSaXcp3fmoY+uldKJYPjWs67cp0
	e+tGBrazzZPL0VDQ==
Message-ID: <8cba166e-b218-791c-392b-f1162eefe1e7@suse.de>
Date: Thu, 13 Jul 2023 09:48:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [Freedreno] [PATCH RFC v1 00/52] drm/crtc: Rename struct
 drm_crtc::dev to drm_dev
Content-Language: en-US
To: Sean Paul <seanpaul@chromium.org>, Jani Nikula <jani.nikula@intel.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
 Marian Cichy <m.cichy@pengutronix.de>, Xinliang Liu
 <xinliang.liu@linaro.org>,
 Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
 Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
 dri-devel@lists.freedesktop.org,
 Vandita Kulkarni <vandita.kulkarni@intel.com>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 Jonathan Hunter <jonathanh@nvidia.com>,
 Arun R Murthy <arun.r.murthy@intel.com>, Jerome Brunet
 <jbrunet@baylibre.com>, Liu Shixin <liushixin2@huawei.com>,
 linux-samsung-soc@vger.kernel.org, Samuel Holland <samuel@sholland.org>,
 Matt Roper <matthew.d.roper@intel.com>, Wenjing Liu <wenjing.liu@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
 Danilo Krummrich <dakr@redhat.com>, NXP Linux Team <linux-imx@nxp.com>,
 =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= <u.kleine-koenig@pengutronix.de>,
 spice-devel@lists.freedesktop.org,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 linux-sunxi@lists.linux.dev, Stylon Wang <stylon.wang@amd.com>,
 Tim Huang <Tim.Huang@amd.com>, Suraj Kandpal <suraj.kandpal@intel.com>,
 =?UTF-8?Q?Andr=c3=a9_Almeida?= <andrealmeid@igalia.com>,
 Andi Shyti <andi.shyti@linux.intel.com>, Yifan Zhang <yifan1.zhang@amd.com>,
 Leo Li <sunpeng.li@amd.com>, Sascha Hauer <s.hauer@pengutronix.de>,
 Lucas De Marchi <lucas.demarchi@intel.com>, Hersen Wu <hersenxs.wu@amd.com>,
 Jessica Zhang <quic_jesszhan@quicinc.com>,
 Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
 Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
 =?UTF-8?Q?=c5=81ukasz_Bartosik?= <lb@semihalf.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
 Andrew Jeffery <andrew@aj.id.au>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Manasi Navare <manasi.d.navare@intel.com>,
 =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= <noralf@tronnes.org>, kernel@pengutronix.de,
 Alex Deucher <alexander.deucher@amd.com>, freedreno@lists.freedesktop.org,
 Claudiu Beznea <claudiu.beznea@microchip.com>,
 Gerd Hoffmann <kraxel@redhat.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org,
 Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
 Edmund Dea <edmund.j.dea@intel.com>,
 =?UTF-8?Q?Jos=c3=a9_Roberto_de_Souza?= <jose.souza@intel.com>,
 virtualization@lists.linux-foundation.org,
 Thierry Reding <thierry.reding@gmail.com>,
 Yongqin Liu <yongqin.liu@linaro.org>,
 Mario Limonciello <mario.limonciello@amd.com>, Fei Yang
 <fei.yang@intel.com>, David Lechner <david@lechnology.com>,
 Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
 "Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
 David Francis <David.Francis@amd.com>, Aaron Liu <aaron.liu@amd.com>,
 Vinod Polimera <quic_vpolimer@quicinc.com>,
 linux-rockchip@lists.infradead.org, Fangzhi Zuo <jerry.zuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>,
 VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
 Ben Skeggs <bskeggs@redhat.com>, =?UTF-8?Q?Jouni_H=c3=b6gander?=
 <jouni.hogander@intel.com>, Dave Airlie <airlied@redhat.com>,
 linux-mips@vger.kernel.org, Graham Sider <Graham.Sider@amd.com>,
 Gurchetan Singh <gurchetansingh@chromium.org>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-arm-msm@vger.kernel.org, Animesh Manna <animesh.manna@intel.com>,
 linux-renesas-soc@vger.kernel.org, Maxime Ripard <mripard@kernel.org>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
 linux-amlogic@lists.infradead.org, Evan Quan <evan.quan@amd.com>,
 Michal Simek <michal.simek@amd.com>, linux-arm-kernel@lists.infradead.org,
 Sean Paul <sean@poorly.run>, Neil Armstrong <neil.armstrong@linaro.org>,
 Kai Vehmanen <kai.vehmanen@linux.intel.com>,
 Boris Brezillon <bbrezillon@kernel.org>, Chunyan Zhang
 <zhang.lyra@gmail.com>, Qingqing Zhuo <qingqing.zhuo@amd.com>,
 Sandy Huang <hjc@rock-chips.com>, Swati Sharma <swati2.sharma@intel.com>,
 John Stultz <jstultz@google.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Drew Davenport <ddavenport@chromium.org>, Kevin Hilman
 <khilman@baylibre.com>, Hawking Zhang <Hawking.Zhang@amd.com>,
 Haneen Mohammed <hamohammed.sa@gmail.com>,
 Anusha Srivatsa <anusha.srivatsa@intel.com>,
 Dan Carpenter <error27@gmail.com>, Karol Herbst <kherbst@redhat.com>,
 linux-hyperv@vger.kernel.org, Melissa Wen <melissa.srw@gmail.com>,
 =?UTF-8?Q?Ma=c3=adra_Canal?= <mairacanal@riseup.net>,
 Luca Coelho <luciano.coelho@intel.com>,
 Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
 Andrzej Hajda <andrzej.hajda@intel.com>, Likun Gao <Likun.Gao@amd.com>,
 Sam Ravnborg <sam@ravnborg.org>, Alain Volmat <alain.volmat@foss.st.com>,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 Jernej Skrabec <jernej.skrabec@gmail.com>,
 Deepak Rawat <drawat.floss@gmail.com>, Chen-Yu Tsai <wens@csie.org>,
 Joel Stanley <joel@jms.id.au>, xurui <xurui@kylinos.cn>,
 Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
 Sumit Semwal <sumit.semwal@linaro.org>, Alan Liu <haoping.liu@amd.com>,
 Philip Yang <Philip.Yang@amd.com>, intel-gfx@lists.freedesktop.org,
 Alison Wang <alison.wang@nxp.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>,
 Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Gustavo Sousa <gustavo.sousa@intel.com>,
 Baolin Wang <baolin.wang@linux.alibaba.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
 Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
 Tomi Valkeinen <tomba@kernel.org>, Deepak R Varma <drv@mailo.com>,
 "Pan, Xinhui" <Xinhui.Pan@amd.com>, Biju Das <biju.das.jz@bp.renesas.com>,
 Konrad Dybcio <konrad.dybcio@linaro.org>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Tian Tao <tiantao6@hisilicon.com>, Shawn Guo <shawnguo@kernel.org>,
 =?UTF-8?Q?Christian_K=c3=b6nig?= <christian.koenig@amd.com>,
 Khaled Almahallawy <khaled.almahallawy@intel.com>,
 linux-stm32@st-md-mailman.stormreply.com, Emma Anholt <emma@anholt.net>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>, Liviu Dudau <liviu.dudau@arm.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>, Roman Li
 <roman.li@amd.com>, Paul Cercueil <paul@crapouillou.net>,
 Hamza Mahfooz <hamza.mahfooz@amd.com>, Marek Vasut <marex@denx.de>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 xen-devel@lists.xenproject.org, Guchun Chen <guchun.chen@amd.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
 Russell King <linux@armlinux.org.uk>, Uma Shankar <uma.shankar@intel.com>,
 Mika Kahola <mika.kahola@intel.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Jiasheng Jiang <jiasheng@iscas.ac.cn>,
 Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 linux-tegra@vger.kernel.org, =?UTF-8?B?TWFyZWsgT2zFocOhaw==?=
 <marek.olsak@amd.com>, =?UTF-8?Q?Joaqu=c3=adn_Ignacio_Aramend=c3=ada?=
 <samsagax@gmail.com>, Melissa Wen <mwen@igalia.com>,
 Hans de Goede <hdegoede@redhat.com>, linux-mediatek@lists.infradead.org,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 David Tadokoro <davidbtadokoro@usp.br>,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 Orson Zhai <orsonzhai@gmail.com>, amd-gfx@lists.freedesktop.org,
 Jyri Sarha <jyri.sarha@iki.fi>, Yannick Fertre <yannick.fertre@foss.st.com>,
 Nicolas Ferre <nicolas.ferre@microchip.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Philippe Cornu <philippe.cornu@foss.st.com>, Wayne Lin <Wayne.Lin@amd.com>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
 Nirmoy Das <nirmoy.das@intel.com>, Lang Yu <Lang.Yu@amd.com>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com>
 <CAOw6vbLO_UaXDbTCtAQJgthXOUMPqEV+c2MQhP-1DuK44OhGxw@mail.gmail.com>
From: Thomas Zimmermann <tzimmermann@suse.de>
In-Reply-To: <CAOw6vbLO_UaXDbTCtAQJgthXOUMPqEV+c2MQhP-1DuK44OhGxw@mail.gmail.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------WJL0aWyoW1bnlNMhRVfNPze8"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------WJL0aWyoW1bnlNMhRVfNPze8
Content-Type: multipart/mixed; boundary="------------BxmMunC4gYOzgdzgzemdbJ9I";
 protected-headers="v1"
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Sean Paul <seanpaul@chromium.org>, Jani Nikula <jani.nikula@intel.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
 Marian Cichy <m.cichy@pengutronix.de>, Xinliang Liu
 <xinliang.liu@linaro.org>,
 Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
 Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
 dri-devel@lists.freedesktop.org,
 Vandita Kulkarni <vandita.kulkarni@intel.com>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 Jonathan Hunter <jonathanh@nvidia.com>,
 Arun R Murthy <arun.r.murthy@intel.com>, Jerome Brunet
 <jbrunet@baylibre.com>, Liu Shixin <liushixin2@huawei.com>,
 linux-samsung-soc@vger.kernel.org, Samuel Holland <samuel@sholland.org>,
 Matt Roper <matthew.d.roper@intel.com>, Wenjing Liu <wenjing.liu@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
 Danilo Krummrich <dakr@redhat.com>, NXP Linux Team <linux-imx@nxp.com>,
 =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= <u.kleine-koenig@pengutronix.de>,
 spice-devel@lists.freedesktop.org,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 linux-sunxi@lists.linux.dev, Stylon Wang <stylon.wang@amd.com>,
 Tim Huang <Tim.Huang@amd.com>, Suraj Kandpal <suraj.kandpal@intel.com>,
 =?UTF-8?Q?Andr=c3=a9_Almeida?= <andrealmeid@igalia.com>,
 Andi Shyti <andi.shyti@linux.intel.com>, Yifan Zhang <yifan1.zhang@amd.com>,
 Leo Li <sunpeng.li@amd.com>, Sascha Hauer <s.hauer@pengutronix.de>,
 Lucas De Marchi <lucas.demarchi@intel.com>, Hersen Wu <hersenxs.wu@amd.com>,
 Jessica Zhang <quic_jesszhan@quicinc.com>,
 Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
 Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
 =?UTF-8?Q?=c5=81ukasz_Bartosik?= <lb@semihalf.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
 Andrew Jeffery <andrew@aj.id.au>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Manasi Navare <manasi.d.navare@intel.com>,
 =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= <noralf@tronnes.org>, kernel@pengutronix.de,
 Alex Deucher <alexander.deucher@amd.com>, freedreno@lists.freedesktop.org,
 Claudiu Beznea <claudiu.beznea@microchip.com>,
 Gerd Hoffmann <kraxel@redhat.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org,
 Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
 Edmund Dea <edmund.j.dea@intel.com>,
 =?UTF-8?Q?Jos=c3=a9_Roberto_de_Souza?= <jose.souza@intel.com>,
 virtualization@lists.linux-foundation.org,
 Thierry Reding <thierry.reding@gmail.com>,
 Yongqin Liu <yongqin.liu@linaro.org>,
 Mario Limonciello <mario.limonciello@amd.com>, Fei Yang
 <fei.yang@intel.com>, David Lechner <david@lechnology.com>,
 Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
 "Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
 David Francis <David.Francis@amd.com>, Aaron Liu <aaron.liu@amd.com>,
 Vinod Polimera <quic_vpolimer@quicinc.com>,
 linux-rockchip@lists.infradead.org, Fangzhi Zuo <jerry.zuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>,
 VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
 Ben Skeggs <bskeggs@redhat.com>, =?UTF-8?Q?Jouni_H=c3=b6gander?=
 <jouni.hogander@intel.com>, Dave Airlie <airlied@redhat.com>,
 linux-mips@vger.kernel.org, Graham Sider <Graham.Sider@amd.com>,
 Gurchetan Singh <gurchetansingh@chromium.org>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-arm-msm@vger.kernel.org, Animesh Manna <animesh.manna@intel.com>,
 linux-renesas-soc@vger.kernel.org, Maxime Ripard <mripard@kernel.org>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
 linux-amlogic@lists.infradead.org, Evan Quan <evan.quan@amd.com>,
 Michal Simek <michal.simek@amd.com>, linux-arm-kernel@lists.infradead.org,
 Sean Paul <sean@poorly.run>, Neil Armstrong <neil.armstrong@linaro.org>,
 Kai Vehmanen <kai.vehmanen@linux.intel.com>,
 Boris Brezillon <bbrezillon@kernel.org>, Chunyan Zhang
 <zhang.lyra@gmail.com>, Qingqing Zhuo <qingqing.zhuo@amd.com>,
 Sandy Huang <hjc@rock-chips.com>, Swati Sharma <swati2.sharma@intel.com>,
 John Stultz <jstultz@google.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Drew Davenport <ddavenport@chromium.org>, Kevin Hilman
 <khilman@baylibre.com>, Hawking Zhang <Hawking.Zhang@amd.com>,
 Haneen Mohammed <hamohammed.sa@gmail.com>,
 Anusha Srivatsa <anusha.srivatsa@intel.com>,
 Dan Carpenter <error27@gmail.com>, Karol Herbst <kherbst@redhat.com>,
 linux-hyperv@vger.kernel.org, Melissa Wen <melissa.srw@gmail.com>,
 =?UTF-8?Q?Ma=c3=adra_Canal?= <mairacanal@riseup.net>,
 Luca Coelho <luciano.coelho@intel.com>,
 Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
 Andrzej Hajda <andrzej.hajda@intel.com>, Likun Gao <Likun.Gao@amd.com>,
 Sam Ravnborg <sam@ravnborg.org>, Alain Volmat <alain.volmat@foss.st.com>,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 Jernej Skrabec <jernej.skrabec@gmail.com>,
 Deepak Rawat <drawat.floss@gmail.com>, Chen-Yu Tsai <wens@csie.org>,
 Joel Stanley <joel@jms.id.au>, xurui <xurui@kylinos.cn>,
 Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
 Sumit Semwal <sumit.semwal@linaro.org>, Alan Liu <haoping.liu@amd.com>,
 Philip Yang <Philip.Yang@amd.com>, intel-gfx@lists.freedesktop.org,
 Alison Wang <alison.wang@nxp.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>,
 Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Gustavo Sousa <gustavo.sousa@intel.com>,
 Baolin Wang <baolin.wang@linux.alibaba.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
 Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
 Tomi Valkeinen <tomba@kernel.org>, Deepak R Varma <drv@mailo.com>,
 "Pan, Xinhui" <Xinhui.Pan@amd.com>, Biju Das <biju.das.jz@bp.renesas.com>,
 Konrad Dybcio <konrad.dybcio@linaro.org>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Tian Tao <tiantao6@hisilicon.com>, Shawn Guo <shawnguo@kernel.org>,
 =?UTF-8?Q?Christian_K=c3=b6nig?= <christian.koenig@amd.com>,
 Khaled Almahallawy <khaled.almahallawy@intel.com>,
 linux-stm32@st-md-mailman.stormreply.com, Emma Anholt <emma@anholt.net>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>, Liviu Dudau <liviu.dudau@arm.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>, Roman Li
 <roman.li@amd.com>, Paul Cercueil <paul@crapouillou.net>,
 Hamza Mahfooz <hamza.mahfooz@amd.com>, Marek Vasut <marex@denx.de>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 xen-devel@lists.xenproject.org, Guchun Chen <guchun.chen@amd.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
 Russell King <linux@armlinux.org.uk>, Uma Shankar <uma.shankar@intel.com>,
 Mika Kahola <mika.kahola@intel.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Jiasheng Jiang <jiasheng@iscas.ac.cn>,
 Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 linux-tegra@vger.kernel.org, =?UTF-8?B?TWFyZWsgT2zFocOhaw==?=
 <marek.olsak@amd.com>, =?UTF-8?Q?Joaqu=c3=adn_Ignacio_Aramend=c3=ada?=
 <samsagax@gmail.com>, Melissa Wen <mwen@igalia.com>,
 Hans de Goede <hdegoede@redhat.com>, linux-mediatek@lists.infradead.org,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 David Tadokoro <davidbtadokoro@usp.br>,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 Orson Zhai <orsonzhai@gmail.com>, amd-gfx@lists.freedesktop.org,
 Jyri Sarha <jyri.sarha@iki.fi>, Yannick Fertre <yannick.fertre@foss.st.com>,
 Nicolas Ferre <nicolas.ferre@microchip.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Philippe Cornu <philippe.cornu@foss.st.com>, Wayne Lin <Wayne.Lin@amd.com>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
 Nirmoy Das <nirmoy.das@intel.com>, Lang Yu <Lang.Yu@amd.com>
Message-ID: <8cba166e-b218-791c-392b-f1162eefe1e7@suse.de>
Subject: Re: [Freedreno] [PATCH RFC v1 00/52] drm/crtc: Rename struct
 drm_crtc::dev to drm_dev
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com>
 <CAOw6vbLO_UaXDbTCtAQJgthXOUMPqEV+c2MQhP-1DuK44OhGxw@mail.gmail.com>
In-Reply-To: <CAOw6vbLO_UaXDbTCtAQJgthXOUMPqEV+c2MQhP-1DuK44OhGxw@mail.gmail.com>

--------------BxmMunC4gYOzgdzgzemdbJ9I
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

SGkNCg0KQW0gMTIuMDcuMjMgdW0gMjA6MzEgc2NocmllYiBTZWFuIFBhdWw6DQo+IE9uIFdl
ZCwgSnVsIDEyLCAyMDIzIGF0IDEwOjUy4oCvQU0gSmFuaSBOaWt1bGEgPGphbmkubmlrdWxh
QGludGVsLmNvbT4gd3JvdGU6DQo+Pg0KPj4gT24gV2VkLCAxM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j4+IEphbmkuDQo+
Pg0KPj4NCj4+IC0tDQo+PiBKYW5pIE5pa3VsYSwgSW50ZWwgT3BlbiBTb3VyY2UgR3JhcGhp
Y3MgQ2VudGVyDQoNCi0tIA0KVGhvbWFzIFppbW1lcm1hbm4NCkdyYXBoaWNzIERyaXZlciBE
ZXZlbG9wZXINClNVU0UgU29mdHdhcmUgU29sdXRpb25zIEdlcm1hbnkgR21iSA0KRnJhbmtl
bnN0cmFzc2UgMTQ2LCA5MDQ2MSBOdWVybmJlcmcsIEdlcm1hbnkNCkdGOiBJdm8gVG90ZXYs
IEFuZHJldyBNeWVycywgQW5kcmV3IE1jRG9uYWxkLCBCb3VkaWVuIE1vZXJtYW4NCkhSQiAz
NjgwOSAoQUcgTnVlcm5iZXJnKQ0K

--------------BxmMunC4gYOzgdzgzemdbJ9I--

--------------WJL0aWyoW1bnlNMhRVfNPze8
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEExndm/fpuMUdwYFFolh/E3EQov+AFAmSvrF8FAwAAAAAACgkQlh/E3EQov+Cg
TA//RqXBDRWQfqb2lmJXpmP+g91uK9AsW/x9HhvQdNADnFUSuoh/unZndXui3JUaj7alFut+OCBY
S00QVT58f8NttJape7/BSytdR7LGHQq59nLD9bsiGxRuZBbhI8UWRnGd+C6FhMkXrfitY1agvu/S
FaUnr7uTFgYvsS8MGNjqVKPhK4+fhl+pII8Maa1KafRGZdmsh/mW60vFSQ9VrdwIFVr1VaGK4xOw
3S0Tvta7UpPHdaxwfK9AjasKDbADCQLQjOnl60QXavFL3VkiDCpNlPCja3EaX6RclWAjPomwHDrC
c7JCzJKD9++hBuSvb9TF29FDCcXxUsUKs5Qhv+0LAiqOGBJ7OBsipFZuwFn0IwLyBfA5UlJuiru/
YFNZFxTYDQTt5KVS/hRBHbCfilS4QUKAeiKmM/Yjb5v5vfiGDrzEJkcoXMMyXqn+CzSHvZDwsSC9
77f1X0wsYyopn/8ZfbN6NKnmiD1zlbtXCuEURY57TCFSWdXdrX3jJcA46XHCYRQvQpPckoUoDdNu
IWMHS+Yk4PRP9qhyyfZ63UZkXmSGd7e4Xx4UquVJwN49v3qEHzvwyYRqoeFFTLASzaYmASRZznhc
YEyOvAtA0/Kq3G9PJzyP891lWkh2pnGjCupzyAMD2rIoa9jgJZGfY83vTj1+F7LQeYyBjMxgqB4W
ZOY=
=jSFv
-----END PGP SIGNATURE-----

--------------WJL0aWyoW1bnlNMhRVfNPze8--


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 07:55:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 07:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.562993.879854 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJrAa-0006z1-MH; Thu, 13 Jul 2023 07:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 562993.879854; Thu, 13 Jul 2023 07:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJrAa-0006yu-Il; Thu, 13 Jul 2023 07:55:24 +0000
Received: by outflank-mailman (input) for mailman id 562993;
 Thu, 13 Jul 2023 07:54:45 +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
 <SRS0=8EtB=C7=suse.de=tzimmermann@srs-se1.protection.inumbo.net>)
 id 1qJr9x-0006wS-DP
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 07:54:45 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 866f2830-2152-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 09:54:42 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id C9D091F890;
 Thu, 13 Jul 2023 07:54:41 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 268C8133D6;
 Thu, 13 Jul 2023 07:54:38 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id JjhrCL6tr2QsHAAAMHmgww
 (envelope-from <tzimmermann@suse.de>); Thu, 13 Jul 2023 07:54:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 866f2830-2152-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1689234881; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=+/S4BgBLci068jR22yPrPrqolsc0REsSJoDDke7KaJs=;
	b=AjwhRcLrRXyK5JcZ13tNrXtf6VUBKJE6nftWKnljMo+kY4wW5ciZTaWfTKvzy2k2nA5oGG
	JE0VybUlyhE9KsPTUNdCOyZVKnPc4pBC+XC/8mth0CAqzhxAC51vgrzWvYBHkTF6ZMMeue
	f38WaMSttXES33KjtYjtme6QE5Ml5II=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1689234881;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=+/S4BgBLci068jR22yPrPrqolsc0REsSJoDDke7KaJs=;
	b=tMT8r31Y4wkq5+qbxwAy97dyK60dV5hvy0OuRo+Dh5T7wamraZyaSYFcvVwvPmIgseyvvj
	Aht+SOCwTOrMBICg==
Message-ID: <919495f5-bb2e-e7d9-5896-cfb6605b573a@suse.de>
Date: Thu, 13 Jul 2023 09:54:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
Content-Language: en-US
To: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= <u.kleine-koenig@pengutronix.de>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, David Airlie <airlied@gmail.com>,
 Daniel Vetter <daniel@ffwll.ch>, Alex Deucher <alexander.deucher@amd.com>,
 =?UTF-8?Q?Christian_K=c3=b6nig?= <christian.koenig@amd.com>,
 "Pan, Xinhui" <Xinhui.Pan@amd.com>, Harry Wentland <harry.wentland@amd.com>,
 Leo Li <sunpeng.li@amd.com>, Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
 Hamza Mahfooz <hamza.mahfooz@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Guchun Chen <guchun.chen@amd.com>,
 Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
 Evan Quan <evan.quan@amd.com>, Likun Gao <Likun.Gao@amd.com>,
 =?UTF-8?B?TWFyZWsgT2zFocOhaw==?= <marek.olsak@amd.com>,
 David Francis <David.Francis@amd.com>, Hawking Zhang
 <Hawking.Zhang@amd.com>, Graham Sider <Graham.Sider@amd.com>,
 Lang Yu <Lang.Yu@amd.com>, Philip Yang <Philip.Yang@amd.com>,
 Yifan Zhang <yifan1.zhang@amd.com>, Tim Huang <Tim.Huang@amd.com>,
 Zack Rusin <zackr@vmware.com>, Sam Ravnborg <sam@ravnborg.org>,
 Jani Nikula <jani.nikula@intel.com>, xurui <xurui@kylinos.cn>,
 Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
 =?UTF-8?Q?Ma=c3=adra_Canal?= <mairacanal@riseup.net>,
 =?UTF-8?Q?Andr=c3=a9_Almeida?= <andrealmeid@igalia.com>,
 Qingqing Zhuo <qingqing.zhuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>, Hersen Wu
 <hersenxs.wu@amd.com>, Fangzhi Zuo <jerry.zuo@amd.com>,
 Stylon Wang <stylon.wang@amd.com>, Alan Liu <haoping.liu@amd.com>,
 Wayne Lin <Wayne.Lin@amd.com>, Aaron Liu <aaron.liu@amd.com>,
 Melissa Wen <mwen@igalia.com>, Bhawanpreet Lakha
 <Bhawanpreet.Lakha@amd.com>, David Tadokoro <davidbtadokoro@usp.br>,
 Wenjing Liu <wenjing.liu@amd.com>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 Mario Limonciello <mario.limonciello@amd.com>,
 Alexey Kodanev <aleksei.kodanev@bell-sw.com>, Roman Li <roman.li@amd.com>,
 =?UTF-8?Q?Joaqu=c3=adn_Ignacio_Aramend=c3=ada?= <samsagax@gmail.com>,
 Dave Airlie <airlied@redhat.com>, Russell King <linux@armlinux.org.uk>,
 Liviu Dudau <liviu.dudau@arm.com>, Joel Stanley <joel@jms.id.au>,
 Boris Brezillon <bbrezillon@kernel.org>,
 Nicolas Ferre <nicolas.ferre@microchip.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 Claudiu Beznea <claudiu.beznea@microchip.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Stefan Agner <stefan@agner.ch>, Alison Wang <alison.wang@nxp.com>,
 Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
 =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= <noralf@tronnes.org>,
 Xinliang Liu <xinliang.liu@linaro.org>, Tian Tao <tiantao6@hisilicon.com>,
 Danilo Krummrich <dakr@redhat.com>, Deepak Rawat <drawat.floss@gmail.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
 =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= <ville.syrjala@linux.intel.com>,
 Lucas De Marchi <lucas.demarchi@intel.com>,
 Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
 Andrzej Hajda <andrzej.hajda@intel.com>,
 Matt Roper <matthew.d.roper@intel.com>,
 Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
 Hans de Goede <hdegoede@redhat.com>, Luca Coelho <luciano.coelho@intel.com>,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 Kai Vehmanen <kai.vehmanen@linux.intel.com>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 =?UTF-8?Q?=c5=81ukasz_Bartosik?= <lb@semihalf.com>,
 Anusha Srivatsa <anusha.srivatsa@intel.com>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
 Uma Shankar <uma.shankar@intel.com>, Imre Deak <imre.deak@intel.com>,
 Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
 Swati Sharma <swati2.sharma@intel.com>,
 =?UTF-8?Q?Jouni_H=c3=b6gander?= <jouni.hogander@intel.com>,
 Mika Kahola <mika.kahola@intel.com>,
 =?UTF-8?Q?Jos=c3=a9_Roberto_de_Souza?= <jose.souza@intel.com>,
 Arun R Murthy <arun.r.murthy@intel.com>,
 Gustavo Sousa <gustavo.sousa@intel.com>,
 Khaled Almahallawy <khaled.almahallawy@intel.com>,
 Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
 Andi Shyti <andi.shyti@linux.intel.com>, Nirmoy Das <nirmoy.das@intel.com>,
 Fei Yang <fei.yang@intel.com>, Animesh Manna <animesh.manna@intel.com>,
 Deepak R Varma <drv@mailo.com>, "Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
 Vandita Kulkarni <vandita.kulkarni@intel.com>,
 Suraj Kandpal <suraj.kandpal@intel.com>,
 Manasi Navare <manasi.d.navare@intel.com>,
 Drew Davenport <ddavenport@chromium.org>,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>,
 Philipp Zabel <p.zabel@pengutronix.de>, Marian Cichy
 <m.cichy@pengutronix.de>, Dan Carpenter <error27@gmail.com>,
 Paul Cercueil <paul@crapouillou.net>,
 Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
 Edmund Dea <edmund.j.dea@intel.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Linus Walleij <linus.walleij@linaro.org>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>, Rob Clark <robdclark@gmail.com>,
 Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Vinod Polimera <quic_vpolimer@quicinc.com>,
 Jiasheng Jiang <jiasheng@iscas.ac.cn>,
 Konrad Dybcio <konrad.dybcio@linaro.org>,
 Jessica Zhang <quic_jesszhan@quicinc.com>, Liu Shixin
 <liushixin2@huawei.com>, Marek Vasut <marex@denx.de>,
 Ben Skeggs <bskeggs@redhat.com>, Karol Herbst <kherbst@redhat.com>,
 Lyude Paul <lyude@redhat.com>, Tomi Valkeinen <tomba@kernel.org>,
 Emma Anholt <emma@anholt.net>, Gerd Hoffmann <kraxel@redhat.com>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>,
 Geert Uytterhoeven <geert+renesas@glider.be>,
 Biju Das <biju.das.jz@bp.renesas.com>, Sandy Huang <hjc@rock-chips.com>,
 =?UTF-8?Q?Heiko_St=c3=bcbner?= <heiko@sntech.de>,
 Orson Zhai <orsonzhai@gmail.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>,
 Alain Volmat <alain.volmat@foss.st.com>,
 Yannick Fertre <yannick.fertre@foss.st.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Philippe Cornu <philippe.cornu@foss.st.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>, Chen-Yu Tsai
 <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>,
 Samuel Holland <samuel@sholland.org>,
 Thierry Reding <thierry.reding@gmail.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Jyri Sarha <jyri.sarha@iki.fi>,
 David Lechner <david@lechnology.com>,
 Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
 Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
 Melissa Wen <melissa.srw@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Michal Simek <michal.simek@amd.com>
Cc: dri-devel@lists.freedesktop.org, kernel@pengutronix.de,
 amd-gfx@lists.freedesktop.org, Andrew Jeffery <andrew@aj.id.au>,
 linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
 Alim Akhtar <alim.akhtar@samsung.com>, linux-samsung-soc@vger.kernel.org,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 Sumit Semwal <sumit.semwal@linaro.org>, Yongqin Liu
 <yongqin.liu@linaro.org>, John Stultz <jstultz@google.com>,
 linux-hyperv@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 Lucas Stach <l.stach@pengutronix.de>, Fabio Estevam <festevam@gmail.com>,
 NXP Linux Team <linux-imx@nxp.com>, linux-mips@vger.kernel.org,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 linux-mediatek@lists.infradead.org, Jerome Brunet <jbrunet@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-amlogic@lists.infradead.org, Sean Paul <sean@poorly.run>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, virtualization@lists.linux-foundation.org,
 spice-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org,
 linux-rockchip@lists.infradead.org,
 linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev,
 linux-tegra@vger.kernel.org, Gurchetan Singh <gurchetansingh@chromium.org>,
 Chia-I Wu <olvaffe@gmail.com>, Haneen Mohammed <hamohammed.sa@gmail.com>,
 VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
 xen-devel@lists.xenproject.org
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
From: Thomas Zimmermann <tzimmermann@suse.de>
In-Reply-To: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------LsA5aH03LE2v0lMRxuTTaC4q"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------LsA5aH03LE2v0lMRxuTTaC4q
Content-Type: multipart/mixed; boundary="------------qNrxUl4l5gqAJoRcktOjBhJ7";
 protected-headers="v1"
From: Thomas Zimmermann <tzimmermann@suse.de>
To: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= <u.kleine-koenig@pengutronix.de>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, David Airlie <airlied@gmail.com>,
 Daniel Vetter <daniel@ffwll.ch>, Alex Deucher <alexander.deucher@amd.com>,
 =?UTF-8?Q?Christian_K=c3=b6nig?= <christian.koenig@amd.com>,
 "Pan, Xinhui" <Xinhui.Pan@amd.com>, Harry Wentland <harry.wentland@amd.com>,
 Leo Li <sunpeng.li@amd.com>, Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
 Hamza Mahfooz <hamza.mahfooz@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Guchun Chen <guchun.chen@amd.com>,
 Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
 Evan Quan <evan.quan@amd.com>, Likun Gao <Likun.Gao@amd.com>,
 =?UTF-8?B?TWFyZWsgT2zFocOhaw==?= <marek.olsak@amd.com>,
 David Francis <David.Francis@amd.com>, Hawking Zhang
 <Hawking.Zhang@amd.com>, Graham Sider <Graham.Sider@amd.com>,
 Lang Yu <Lang.Yu@amd.com>, Philip Yang <Philip.Yang@amd.com>,
 Yifan Zhang <yifan1.zhang@amd.com>, Tim Huang <Tim.Huang@amd.com>,
 Zack Rusin <zackr@vmware.com>, Sam Ravnborg <sam@ravnborg.org>,
 Jani Nikula <jani.nikula@intel.com>, xurui <xurui@kylinos.cn>,
 Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
 =?UTF-8?Q?Ma=c3=adra_Canal?= <mairacanal@riseup.net>,
 =?UTF-8?Q?Andr=c3=a9_Almeida?= <andrealmeid@igalia.com>,
 Qingqing Zhuo <qingqing.zhuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>, Hersen Wu
 <hersenxs.wu@amd.com>, Fangzhi Zuo <jerry.zuo@amd.com>,
 Stylon Wang <stylon.wang@amd.com>, Alan Liu <haoping.liu@amd.com>,
 Wayne Lin <Wayne.Lin@amd.com>, Aaron Liu <aaron.liu@amd.com>,
 Melissa Wen <mwen@igalia.com>, Bhawanpreet Lakha
 <Bhawanpreet.Lakha@amd.com>, David Tadokoro <davidbtadokoro@usp.br>,
 Wenjing Liu <wenjing.liu@amd.com>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 Mario Limonciello <mario.limonciello@amd.com>,
 Alexey Kodanev <aleksei.kodanev@bell-sw.com>, Roman Li <roman.li@amd.com>,
 =?UTF-8?Q?Joaqu=c3=adn_Ignacio_Aramend=c3=ada?= <samsagax@gmail.com>,
 Dave Airlie <airlied@redhat.com>, Russell King <linux@armlinux.org.uk>,
 Liviu Dudau <liviu.dudau@arm.com>, Joel Stanley <joel@jms.id.au>,
 Boris Brezillon <bbrezillon@kernel.org>,
 Nicolas Ferre <nicolas.ferre@microchip.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 Claudiu Beznea <claudiu.beznea@microchip.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Stefan Agner <stefan@agner.ch>, Alison Wang <alison.wang@nxp.com>,
 Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
 =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= <noralf@tronnes.org>,
 Xinliang Liu <xinliang.liu@linaro.org>, Tian Tao <tiantao6@hisilicon.com>,
 Danilo Krummrich <dakr@redhat.com>, Deepak Rawat <drawat.floss@gmail.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
 =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= <ville.syrjala@linux.intel.com>,
 Lucas De Marchi <lucas.demarchi@intel.com>,
 Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
 Andrzej Hajda <andrzej.hajda@intel.com>,
 Matt Roper <matthew.d.roper@intel.com>,
 Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
 Hans de Goede <hdegoede@redhat.com>, Luca Coelho <luciano.coelho@intel.com>,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 Kai Vehmanen <kai.vehmanen@linux.intel.com>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 =?UTF-8?Q?=c5=81ukasz_Bartosik?= <lb@semihalf.com>,
 Anusha Srivatsa <anusha.srivatsa@intel.com>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
 Uma Shankar <uma.shankar@intel.com>, Imre Deak <imre.deak@intel.com>,
 Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
 Swati Sharma <swati2.sharma@intel.com>,
 =?UTF-8?Q?Jouni_H=c3=b6gander?= <jouni.hogander@intel.com>,
 Mika Kahola <mika.kahola@intel.com>,
 =?UTF-8?Q?Jos=c3=a9_Roberto_de_Souza?= <jose.souza@intel.com>,
 Arun R Murthy <arun.r.murthy@intel.com>,
 Gustavo Sousa <gustavo.sousa@intel.com>,
 Khaled Almahallawy <khaled.almahallawy@intel.com>,
 Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
 Andi Shyti <andi.shyti@linux.intel.com>, Nirmoy Das <nirmoy.das@intel.com>,
 Fei Yang <fei.yang@intel.com>, Animesh Manna <animesh.manna@intel.com>,
 Deepak R Varma <drv@mailo.com>, "Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
 Vandita Kulkarni <vandita.kulkarni@intel.com>,
 Suraj Kandpal <suraj.kandpal@intel.com>,
 Manasi Navare <manasi.d.navare@intel.com>,
 Drew Davenport <ddavenport@chromium.org>,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>,
 Philipp Zabel <p.zabel@pengutronix.de>, Marian Cichy
 <m.cichy@pengutronix.de>, Dan Carpenter <error27@gmail.com>,
 Paul Cercueil <paul@crapouillou.net>,
 Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
 Edmund Dea <edmund.j.dea@intel.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Linus Walleij <linus.walleij@linaro.org>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>, Rob Clark <robdclark@gmail.com>,
 Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Vinod Polimera <quic_vpolimer@quicinc.com>,
 Jiasheng Jiang <jiasheng@iscas.ac.cn>,
 Konrad Dybcio <konrad.dybcio@linaro.org>,
 Jessica Zhang <quic_jesszhan@quicinc.com>, Liu Shixin
 <liushixin2@huawei.com>, Marek Vasut <marex@denx.de>,
 Ben Skeggs <bskeggs@redhat.com>, Karol Herbst <kherbst@redhat.com>,
 Lyude Paul <lyude@redhat.com>, Tomi Valkeinen <tomba@kernel.org>,
 Emma Anholt <emma@anholt.net>, Gerd Hoffmann <kraxel@redhat.com>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>,
 Geert Uytterhoeven <geert+renesas@glider.be>,
 Biju Das <biju.das.jz@bp.renesas.com>, Sandy Huang <hjc@rock-chips.com>,
 =?UTF-8?Q?Heiko_St=c3=bcbner?= <heiko@sntech.de>,
 Orson Zhai <orsonzhai@gmail.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>,
 Alain Volmat <alain.volmat@foss.st.com>,
 Yannick Fertre <yannick.fertre@foss.st.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Philippe Cornu <philippe.cornu@foss.st.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>, Chen-Yu Tsai
 <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>,
 Samuel Holland <samuel@sholland.org>,
 Thierry Reding <thierry.reding@gmail.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Jyri Sarha <jyri.sarha@iki.fi>,
 David Lechner <david@lechnology.com>,
 Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
 Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
 Melissa Wen <melissa.srw@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Michal Simek <michal.simek@amd.com>
Cc: dri-devel@lists.freedesktop.org, kernel@pengutronix.de,
 amd-gfx@lists.freedesktop.org, Andrew Jeffery <andrew@aj.id.au>,
 linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
 Alim Akhtar <alim.akhtar@samsung.com>, linux-samsung-soc@vger.kernel.org,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 Sumit Semwal <sumit.semwal@linaro.org>, Yongqin Liu
 <yongqin.liu@linaro.org>, John Stultz <jstultz@google.com>,
 linux-hyperv@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 Lucas Stach <l.stach@pengutronix.de>, Fabio Estevam <festevam@gmail.com>,
 NXP Linux Team <linux-imx@nxp.com>, linux-mips@vger.kernel.org,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 linux-mediatek@lists.infradead.org, Jerome Brunet <jbrunet@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-amlogic@lists.infradead.org, Sean Paul <sean@poorly.run>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, virtualization@lists.linux-foundation.org,
 spice-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org,
 linux-rockchip@lists.infradead.org,
 linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev,
 linux-tegra@vger.kernel.org, Gurchetan Singh <gurchetansingh@chromium.org>,
 Chia-I Wu <olvaffe@gmail.com>, Haneen Mohammed <hamohammed.sa@gmail.com>,
 VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
 xen-devel@lists.xenproject.org
Message-ID: <919495f5-bb2e-e7d9-5896-cfb6605b573a@suse.de>
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
In-Reply-To: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>

--------------qNrxUl4l5gqAJoRcktOjBhJ7
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

SGkNCg0KQW0gMTIuMDcuMjMgdW0gMTE6NDYgc2NocmllYiBVd2UgS2xlaW5lLUvDtm5pZzoN
Cj4gSGVsbG8sDQo+IA0KPiB3aGlsZSBJIGRlYnV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cml2ZXJzL2dwdS9kcm0vZHJtX2Js
ZW5kLmMgICAgICAgICAgICAgICAgICAgfCAgIDIgKy0NCj4gICBkcml2ZXJzL2dwdS9kcm0v
ZHJtX2NvbG9yX21nbXQuYyAgICAgICAgICAgICAgfCAgMTAgKy0NCj4gICBkcml2ZXJzL2dw
dS9kcm0vZHJtX2NydGMuYyAgICAgICAgICAgICAgICAgICAgfCAgMTkgKystDQo+ICAgZHJp
dmVycy9ncHUvZHJtL2RybV9jcnRjX2hlbHBlci5jICAgICAgICAgICAgIHwgIDEwICstDQo+
ICAgZHJpdmVycy9ncHUvZHJtL2RybV9kZWJ1Z2ZzLmMgICAgICAgICAgICAgICAgIHwgICAy
ICstDQo+ICAgZHJpdmVycy9ncHUvZHJtL2RybV9kZWJ1Z2ZzX2NyYy5jICAgICAgICAgICAg
IHwgICAyICstDQo+ICAgZHJpdmVycy9ncHUvZHJtL2RybV9mYl9oZWxwZXIuYyAgICAgICAg
ICAgICAgIHwgICA2ICstDQo+ICAgZHJpdmVycy9ncHUvZHJtL2RybV9taXBpX2RiaS5jICAg
ICAgICAgICAgICAgIHwgICA0ICstDQo+ICAgZHJpdmVycy9ncHUvZHJtL2RybV9wbGFuZS5j
ICAgICAgICAgICAgICAgICAgIHwgICAyICstDQo+ICAgZHJpdmVycy9ncHUvZHJtL2RybV9w
bGFuZV9oZWxwZXIuYyAgICAgICAgICAgIHwgICAyICstDQo+ICAgZHJpdmVycy9ncHUvZHJt
L2RybV9zZWxmX3JlZnJlc2hfaGVscGVyLmMgICAgIHwgICAyICstDQo+ICAgZHJpdmVycy9n
cHUvZHJtL2RybV92YmxhbmsuYyAgICAgICAgICAgICAgICAgIHwgIDQwICsrLS0tDQo+ICAg
ZHJpdmVycy9ncHUvZHJtL2RybV92Ymxhbmtfd29yay5jICAgICAgICAgICAgIHwgICAyICst
DQo+ICAgZHJpdmVycy9ncHUvZHJtL2V4eW5vcy9leHlub3NfZHJtX2NydGMuYyAgICAgIHwg
ICA4IC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QpHRjogSXZvIFRvdGV2LCBBbmRyZXcg
TXllcnMsIEFuZHJldyBNY0RvbmFsZCwgQm91ZGllbiBNb2VybWFuDQpIUkIgMzY4MDkgKEFH
IE51ZXJuYmVyZykNCg==

--------------qNrxUl4l5gqAJoRcktOjBhJ7--

--------------LsA5aH03LE2v0lMRxuTTaC4q
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEExndm/fpuMUdwYFFolh/E3EQov+AFAmSvrb0FAwAAAAAACgkQlh/E3EQov+C0
pBAAic0dPMqj5wzwOLKkTcwE5/c346xd2nHVbaYTqrl2x+W699dIsKBKxdcQ2oQrdMmheKf3tUq0
mYxoCapnTDIByOl9F/KfFDll/QdYFHOTJt2hQOwx6MjVGP8jT6NsASvO6PbP4K422kdzD2ujxm6J
m+4dekBafESleuiBRPgHfcGRlwAtXnV8sQ8hf0By/Vax7H48VGgPU/MG21u2qx/qJm80cpYYGzmL
1Sh/B3X+NZI0myuz7/cvpk8y+C9m/+UtZU8v3l+lhLGgrQHbyPiY3IFUDtxKE+9NfaAaRAGnnVui
OcMXeUVflrHBOukcStcOiN+yTnEH2t8dN4q6ORN4eQ9M1fxytn5Wj1w0GYSofpXKYYlyIr6Nd2f6
PzTX8itrvnccic+1zyBJ6b3scMRa4npmXfYuq8/Ez43FvIZowkUiwicX01DI5B5nQuGt+cDNLJcZ
sF7BnJxeqdF5ELWxgpJpD0piGzKAstRYrwc3LxwOFLer2O6yl2bVyZfA8nNu9TpAmhcCQA1kvzVF
HcmnPE2mq7xDMzm6eFVYMpjEubV9jWzQml9mMdeK7LvvbBa5TUW2H+B+QeuHHVDETJCs6XfoRmTX
pFsMOJyou6lBtd6qXHzbWBtr6Wig0k6JoxWksxzdLjR9/6kzw94IsUp3AEWr8nQaHaO2xaZh5FUT
hkQ=
=YZnB
-----END PGP SIGNATURE-----

--------------LsA5aH03LE2v0lMRxuTTaC4q--


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 08:30:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 08:30:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563009.879863 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJriJ-0003aO-1I; Thu, 13 Jul 2023 08:30:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563009.879863; Thu, 13 Jul 2023 08:30:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJriI-0003aH-Uz; Thu, 13 Jul 2023 08:30:14 +0000
Received: by outflank-mailman (input) for mailman id 563009;
 Thu, 13 Jul 2023 08:30:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=3tZN=C7=citrix.com=prvs=5513f61bf=edvin.torok@srs-se1.protection.inumbo.net>)
 id 1qJriH-0003a9-TD
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 08:30:14 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7a541ae0-2157-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 10:30:11 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7a541ae0-2157-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689237011;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=w4ON7zZmWZRE/nTYJfzNVlT9Rgni4/BHAnPQvc1KIVU=;
  b=VhGSokWxXZwKe/txKpxiZIjJjZ6ieoUWjfqidBoJMkCBSD+WoWLzvZpD
   47KsFz2k1XQu7JZBbntyRdCmaKugL4Mr+f+Lc008/tqqRVbkiTQjve1vO
   y5TKXWvXAFQFBmUZ/+gXSD08ur4O14QGXkjEhqJpWSA1ub3PZSohrZjVb
   8=;
Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 115947715
X-Ironport-Server: esa2.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:lSaW2axEw9BaG/jMFLB6t+dIxirEfRIJ4+MujC+fZmUNrF6WrkVRn
 zYeWjyAPa3bamD1LogjaI3n9h4EuMSBm4QwSAdrpCAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhPKsT5TcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB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wtN63dTC8QUS0TQ3nfJeBWcB2R2YaLAHA==
X-Talos-MUID: 9a23:b5rwtQTQIcue4ok3RXTAmxx5Dv5R/56lCX1Sq7teqZOKGndJbmI=
X-IronPort-AV: E=Sophos;i="6.01,202,1684814400"; 
   d="scan'208";a="115947715"
From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= <edvin.torok@citrix.com>
To: <xen-devel@lists.xenproject.org>
CC: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@cloud.com>, "Christian
 Lindig" <christian.lindig@citrix.com>, David Scott <dave@recoil.org>, Wei Liu
	<wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH] xenctrl_stubs.c: fix NULL dereference
Date: Thu, 13 Jul 2023 09:30:01 +0100
Message-ID: <3b6374c44ae7e4afce427a9ea852d8d1ebbb42b3.1689236671.git.edwin.torok@cloud.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

From: Edwin TÃ¶rÃ¶k <edwin.torok@cloud.com>

`Tag_cons` is `0` and is meant to be used as the tag argument for `caml_alloc`/`caml_alloc_small`
when constructing a non-empty list.
The empty list is `Val_emptylist` instead (which is really just `Val_int(0)`).

Assigning `0` to a list value like this is equivalent to assigning the naked pointer `NULL` to the field.
Naked pointers are not valid in OCaml 5, however even in OCaml <5.x any attempt to iterate on the list will lead to a segfault.

The list currently only has an opaque type, so no code would have reason to iterate on it currently,
but we shouldn't construct invalid OCaml values that might lead to a crash when exploring the type.

`Val_emptylist` is available since OCaml 3.01 as a constant.

Fixes: e5ac68a011 ("x86/hvm: Revert per-domain APIC acceleration support")

Signed-off-by: Edwin TÃ¶rÃ¶k <edwin.torok@cloud.com>
---
 tools/ocaml/libs/xc/xenctrl_stubs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index e4d9070f2d..3703f48c74 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -832,7 +832,7 @@ CAMLprim value physinfo_arch_caps(const xc_physinfo_t *info)
 
 	tag = 1; /* tag x86 */
 
-	arch_obj = Tag_cons;
+	arch_obj = Val_emptylist;
 
 #endif
 
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 13 08:35:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 08:35:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563013.879873 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJrmf-0004Aq-JS; Thu, 13 Jul 2023 08:34:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563013.879873; Thu, 13 Jul 2023 08:34:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJrmf-0004Aj-Gm; Thu, 13 Jul 2023 08:34:45 +0000
Received: by outflank-mailman (input) for mailman id 563013;
 Thu, 13 Jul 2023 08:34:43 +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 <SRS0=0tL6=C7=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJrmd-0004AD-Tf
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 08:34:43 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on062a.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::62a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1c9da47c-2158-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 10:34:42 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM9PR04MB8522.eurprd04.prod.outlook.com (2603:10a6:20b:431::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 13 Jul
 2023 08:34:38 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Thu, 13 Jul 2023
 08:34:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1c9da47c-2158-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=mwGUw8kNlzq06YuWJbVSIniM4+qe34iBIe60f1h4BhCTGIh+DOLbPL3F8nj6UULLst0NGpDg/rH+1+UMt8chdfrmikOWfuwltKSd0/fsP5cJVIkeLXcgy1RCn9ZP3z8XTEQnzLXtX9FUHhDQRorbZvdD7OHE5P1syN6ArDUCUsanV7h5UpgCnnD/Y9qPqBR5rPMAwa5POdgYYVZCoyAErT0OrZ46KQs3c6J26K37B/Zz4UvdBfwGz7adaWc8PMu34qlqrloKCqOcOJ58PWqS76NQdqfLQucZCbnoVp8rIB9U4QJNvfbyitcga7L5sd+v/4ynjvCXXUrXVa3XZaj0bA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Uzpr0KNsi9KArvSLtlgVEBn4FYzY/UzYTVybChcsCeI=;
 b=NfL0+Yz62rDvSilV7NC5P2xEBLrdsVoDdm8rVq8wqsf0VtXCUMbonhUEOWLNDwehKDjUOj7Y2vdCT7+YtkR3FxP4BRH8pa9XBrtWdJtcI8X5wddAXmCUwHWEvEKzRkyZyUn8n5FF1ua8J1AirZCjZqVTnhIulTAFoY6GpwNyi0STrr+RIdOh+plNlTB07EubCGCCK45bJqdzUjh3BnpUI5M68me7H9xJtQNmaFAo54nk5AGarYs7Adeg2sAp7ir7a5N9QfEViOgCTzKd1Qtj9DyDTUTNpwJJg4AN/Ubq08FoocDPAHFbuEGeCCcOnPovrflYG+zd7C60vEXDe18u4g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Uzpr0KNsi9KArvSLtlgVEBn4FYzY/UzYTVybChcsCeI=;
 b=X4Fi3fZZzjniAv/5qyC/ntH1Rz5dxnbsNYhCkMbzpyPxDF2pWakXmjGD3iGF1fNcM/Td+r1wFZSWdWow9PsSay29dWRZeJzW1GlAPPCVoIDBPwlUySeoJ6k7uLN1mw9Wt+Zn9/DxJfkv+CcPqGlFbMxJxU5ASVREHa450VdPEl3RNOwRRdya+ykwo1bRAW2sqPWm5Xx9lajRKFu3HSf4t/5/S751V22JB3lpscb4SD8vpZotuWN0kbbvFfyyGryBNP7E7M3sW8zdokUFYeE1VcOfONsZDSgspo1E8agHiXVaY1frBEAxzDMmQYBd6ZEM7POVBw9glu7kiK6N/1zzTQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <d785bbdb-22df-c76e-087a-7ffc5532ae4e@suse.com>
Date: Thu, 13 Jul 2023 10:34:35 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v3 00/15] xen: fix violations of MISRA C:2012 Rule 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>,
 Gianluca Luparini <gianluca.luparini@bugseng.com>
Cc: consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Jun Nakajima <jun.nakajima@intel.com>, Kevin Tian <kevin.tian@intel.com>,
 Paul Durrant <paul@xen.org>, Juergen Gross <jgross@suse.com>,
 Tamas K Lengyel <tamas@tklengyel.com>,
 Alexandru Isaila <aisaila@bitdefender.com>,
 Petre Pircalabu <ppircalabu@bitdefender.com>,
 George Dunlap <george.dunlap@citrix.com>, Michal Orzel
 <michal.orzel@amd.com>, Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <cover.1689152719.git.gianluca.luparini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0004.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:15::9) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM9PR04MB8522:EE_
X-MS-Office365-Filtering-Correlation-Id: f82a6a8a-9445-4392-d159-08db837bfecf
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	fMtB704pkdzlULRKZ0IP9kJkKpTqXAu/z0catzUEAYz6J66ScXDgflyA2TLpBwY5C1v9fx5PJVAwUMA9YmV84DVt/kDjiX1S00EB28oSJUNsDI4q0G8+bmUfW5IJkHJQa7+iN5m1Ws0MueDy3Q3C6xY/iOx4SzOmIjOjbJTFzTpR+Gk2lEfwfzuNcp0HLaiTTYVsBGeWo7NjbiBp5epKxzBDlA0iLp282zWeSV77leghyuSwFezZEkWdiVIh97E3n/srS/wSiawCL2+gTOvKUn+QSqejjtFzVXJR+/GcLN0/SbAdiUD/qw2FVSFFUPUfc4vN1eSbgSzDU2ozw5SDYdYdH1tWVZdH1LVceHrWmMTOwwyAl2oXZ8UYZ49tVhzteAJPvh/hYhANBUZEhgxqGwqM5IzD6b289e9yOqxX7/+xMEJ9ILlOl1WVf9cVm6CVMxyu6LNNlZsVqEMvoBhjveoctnJUrO+9x3K6TXZNfRERGq+A2A4fLsRRR+Hv9/nfXWkz5CkYQeJ4kPd04W25+0gkgcar11q/4N+FXNIh9dU5mnWwWRkvSiMI0knJq5sjL6kzqcuB1EyzFxs8kdTtuDchJA+eSyO4U0vMVsCGBfbdWy5kZXQLZLccVF5+ddbUd3CirlMH1GxXm3fMLAJzqw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(39860400002)(366004)(396003)(376002)(346002)(451199021)(38100700002)(2616005)(53546011)(66946007)(66556008)(66476007)(86362001)(478600001)(110136005)(26005)(186003)(4326008)(6486002)(6506007)(6666004)(36756003)(6512007)(316002)(54906003)(31696002)(7416002)(31686004)(8936002)(8676002)(2906002)(5660300002)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aW9OcE0xQTlsQ3VQTGdCRkRoZXdOWG8wUUlXV1VXSm1rSzc5eGdEbXB5M0lp?=
 =?utf-8?B?YXcvUUNHWmhzemdRSHhrenNJbkZubzlVWkc0V01VNWwrT3pZT3ZET3dpNFZl?=
 =?utf-8?B?ZGh0OUdmRXJYVjQ0VTdBNmowdHh6VVFmUUM2dkp4QmJWQWwrVklCSVdRY0Zn?=
 =?utf-8?B?R2laNEM2Y2FrT3VZamxzT2N5YmRmS2hXOUhNdFpwbkRsMW5KeHoraWpnQnBG?=
 =?utf-8?B?S2JGekpCU0M3WURTOXR5c0dsUSsrOTlBSEt0TTg1VFZnYnZMQ3JHOERhdGVJ?=
 =?utf-8?B?TDJoMWF2OTA3OGt0VGRJM2pkSUEwTDFMRHUwYzZNOEUyY2RJVG00ekhyUE91?=
 =?utf-8?B?M3hmbmFDRlpxUkp0SkcvY05xdWlzQUplaWlNZ0pydFBqazdycEdacHd3ZHVJ?=
 =?utf-8?B?WTF3K1hKZVdIaWZpKzgwWHhKdHZ6OGQ4cHE2a2o5NlQ2Z0pVQit4cjVRYVdr?=
 =?utf-8?B?RnVmOUs1RFUwTGl5K1orWm50aUZTZEhFMVZkMTc2OTh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NzdDQWFh?=
 =?utf-8?B?R3hmNWE5N1lyOE1JdlhnUmsxSmRYcTRmTm54UDQ1UCt6OUNEVnNkNEdkeDhk?=
 =?utf-8?B?alVUWkVGUGZnRDdmNUhmbEVTNnJRblU1WXZ2MTdCTExFb0prWGo2TStLTUFN?=
 =?utf-8?B?YTQwSDlNa2RVdG5IY3E0bzdLMTF6a1hXWGJsQUhmc0M5by9rYVBVTmFwOGYz?=
 =?utf-8?B?aEVSd0k3WC9NYXRTOU83Umh1TE9MeitiazlLbVJjaStiT3BYN1JBbTZ6dDdO?=
 =?utf-8?B?eUhPK1F1MWhnNms5U3RyRkRleHlOQzhwU1VvVzVaZzBqcnlBdEo0S3dPU0Fm?=
 =?utf-8?B?MTZJUHJLSVNqWTJ6eldpUy8zaVNpNENVVUJqVE5UdTI3QlRyS0FybXQ0RG1H?=
 =?utf-8?B?VDNuZzFDVGQvRTZTaE82QUV4c0VWSVcwS3JOWENCOThBRVVoL2hjZHQ0S1Ex?=
 =?utf-8?B?bEYzckdtNmdnYVhxN3dvV2JyMGs0YUduWWpWQ0JaaUsxck1ORDBwWklaS2dD?=
 =?utf-8?B?R2JySGt4UUhwT21ucVpKT3k5SnpGeXZEVUhBLzdNVjFlazRpcS85Y05UR0xR?=
 =?utf-8?B?clpocWtJMzVaaDh2TkRJUEIyVVQ5MCtQT3NTVjhYdTV4bEpNQXI2Q1VNSjhs?=
 =?utf-8?B?WjRWUUxMWDhwK29CcjJ3Q1dTN014OENsa1BreDZNR0F5ZnhnaGtMbE1nWk1m?=
 =?utf-8?B?MXMrbGpVaFpiQ0tKSUVRUmwzcWJjaDZxcjNBRDVjSjBTV2JQeGtmYjNaYTBW?=
 =?utf-8?Q?fRU5zE0mLP6fAGMUCDLUD93i/?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f82a6a8a-9445-4392-d159-08db837bfecf
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 08:34:38.3697
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: I90igndqJktqLUo2YNG5mV6m6ctREEDi8LOSQoDApJMWO8UsPmAREWdh+LcQovJYVErn+/0IafPTr5IAe2flDQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8522

On 12.07.2023 12:32, Simone Ballarin wrote:
> Changes to macros 'X86_CR0_PG' and 'MSR_EFER' in files
> "xen/arch/x86/include/asm/x86-defns.h" and "xen/arch/x86/include/asm/msr-index.h"
> are not made since they are used also in assembly files.

Following on from yesterday's remark here: Both files are touched anyway,
as per ...

>  xen/arch/arm/domain_build.c                  |   4 +-
>  xen/arch/arm/efi/efi-boot.h                  |   2 +-
>  xen/arch/arm/gic-v2.c                        |   6 +-
>  xen/arch/arm/gic-v3.c                        |  10 +-
>  xen/arch/arm/include/asm/arm64/brk.h         |   2 +-
>  xen/arch/arm/include/asm/arm64/efibind.h     |  10 +-
>  xen/arch/arm/include/asm/arm64/insn.h        |  16 +-
>  xen/arch/arm/include/asm/vreg.h              |   2 +-
>  xen/arch/arm/kernel.c                        |   2 +-
>  xen/arch/arm/traps.c                         |  14 +-
>  xen/arch/arm/vgic-v2.c                       |   2 +-
>  xen/arch/arm/vgic-v3.c                       |   2 +-
>  xen/arch/x86/acpi/cpufreq/powernow.c         |  14 +-
>  xen/rch/x86/apic.c                          |   2 +-
>  xen/arch/x86/cpu-policy.c                    |  18 +-
>  xen/arch/x86/cpu/mcheck/mce-apei.c           |   4 +-
>  xen/arch/x86/cpu/vpmu_intel.c                |   2 +-
>  xen/arch/x86/cpuid.c                         |   8 +-
>  xen/arch/x86/efi/efi-boot.h                  |   6 +-
>  xen/arch/x86/extable.c                       |   2 +-
>  xen/arch/x86/hvm/hypercall.c                 |   2 +-
>  xen/arch/x86/hvm/irq.c                       |   2 +-
>  xen/arch/x86/hvm/pmtimer.c                   |   4 +-
>  xen/arch/x86/hvm/stdvga.c                    |  50 ++---
>  xen/arch/x86/hvm/svm/asid.c                  |   2 +-
>  xen/arch/x86/hvm/svm/svm.c                   |   8 +-
>  xen/arch/x86/hvm/viridian/viridian.c         |   2 +-
>  xen/arch/x86/hvm/vlapic.c                    |   6 +-
>  xen/arch/x86/hvm/vmx/vmcs.c                  |   6 +-
>  xen/arch/x86/hvm/vmx/vvmx.c                  |   8 +-
>  xen/arch/x86/include/asm/apicdef.h           |   2 +-
>  xen/arch/x86/include/asm/config.h            |   2 +-
>  xen/arch/x86/include/asm/guest/hyperv-tlfs.h |  28 +--
>  xen/arch/x86/include/asm/hpet.h              |   2 +-
>  xen/arch/x86/include/asm/hvm/trace.h         |   4 +-
>  xen/arch/x86/include/asm/hvm/vioapic.h       |   2 +-
>  xen/arch/x86/include/asm/hvm/vmx/vmcs.h      |  84 ++++----
>  xen/arch/x86/include/asm/hvm/vmx/vmx.h       |  16 +-
>  xen/arch/x86/include/asm/msi.h               |   2 +-
>  xen/arch/x86/include/asm/msr-index.h         | 202 +++++++++----------
>  xen/arch/x86/include/asm/pci.h               |   8 +-
>  xen/arch/x86/include/asm/x86-defns.h         |   2 +-

... the diffstat, so allowing other constants there to be used from
assembly code (if and when need be) would be a good idea as well. I
guess this may apply elsewhere as well, when constants live outside of
#ifndef __ASSEMBLY__ sections.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 08:38:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 08:38:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563016.879884 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJrqY-0004oL-42; Thu, 13 Jul 2023 08:38:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563016.879884; Thu, 13 Jul 2023 08:38:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJrqY-0004oE-0n; Thu, 13 Jul 2023 08:38:46 +0000
Received: by outflank-mailman (input) for mailman id 563016;
 Thu, 13 Jul 2023 08:38:44 +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 <SRS0=0tL6=C7=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJrqW-0004o8-UR
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 08:38:44 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20614.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::614])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ac34d0cf-2158-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 10:38:43 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by VI1PR04MB6912.eurprd04.prod.outlook.com (2603:10a6:803:134::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Thu, 13 Jul
 2023 08:38:39 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Thu, 13 Jul 2023
 08:38:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ac34d0cf-2158-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=cPSd28T5I4jQEPF70PG1O5xRo1M0dogj22OU5YfTMtOjSGhNuRW1ltXTPoXx6YTbogy04O43c2zvxEfM2mBzIyeDSu3xEVMzAcUnWwrhgwsiUfoTtJ6iN9UTVLWH24dXBny5WD7jpWmuidk2NJsp/hNnC4QxIxTmyEjyWuYRHnqE7TLu6WjFDw9OWPvt14oSBKksRHGrDbEC1vvjm0GFPD1id6Dwbf13E3Vh5ZrrfGchQBIaSz/jhRpgXP1RAeObliRG9Jasmwa/HhkEi+wIeAzJlnvK+wU6kfpxEdHZp8VUSZqjitOa6IM337FegHUCYLidxwCNMJLjC72OOon7lg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=eNuaswZ2BjWORMItjz7/biMTYirV+bHvKdZ1wkJ92zY=;
 b=J6PqiBc0h9aLTqoWV+Y2M/Al4c5hfFCuyMdaLoVLbi1tMqLQr3mS3AG+u+WIVZtVRef8YyRNc6dbsx+WgDJhmLyRsKiYG+yKU2q2dttVAfafd9/bQGu96g0ytP77SrlrqQCBqqsvISs4SUSTWWxR0fNEd/nSzwaWAqHRLsbbjIIGIkF/htHIZXUu6CiH9+13Es6tECdpr4XdQEKsyy8IitFAvzzJpek5imm5x76HdifZjsjZBivaEzaRKhPE9RL3E7XcxKkYoGvw9DMarpFdFPv6iGYTuMoe6b5xWhFthBo+wwafAggSFs6qvHiB45ofnfvgCDO+GF5SDR9L8KxQxA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=eNuaswZ2BjWORMItjz7/biMTYirV+bHvKdZ1wkJ92zY=;
 b=a+JjTcn+GLzHRyMDv+gYO6JeKhbQ05WBOVNDpTt+MxGUzyfrXvZJ/hemGDTnAAstKVTlziTi22dreVzzcFlPrE7uZP/J7sB1Fkzxxr5icMV0oLJB+uaDju83UKy8NsuD8crCmishiPYTS2tQQbjPuLMclQ/L6qKzHKWghzbxU0B1qOxwgzMxGpx0zq2goykQSxCfPrVW18G9//TEQDNbyEzw1+g+Opal6YkUXW5BgP0HdD8D6YcYg9qlz4E8FEleaG6LUSlQm51dSNvtvSNGCdS+g95hGZhHs0/CbzJ7z1vYnEqDr/WWucLC/Qxff4WD/pzkLnim7+SuMOwdRSj9/g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <47f21cdf-5aa3-5f19-b967-6b217890e706@suse.com>
Date: Thu, 13 Jul 2023 10:38:37 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 0/3] Fixing ACPI error reporting display
Content-Language: en-US
To: Elliott Mitchell <ehem+xen@m5p.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1689191941.git.ehem+xen@m5p.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <cover.1689191941.git.ehem+xen@m5p.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FRYP281CA0011.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::21)
 To AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|VI1PR04MB6912:EE_
X-MS-Office365-Filtering-Correlation-Id: 252da8dd-f533-4eb5-22a5-08db837c8e71
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	8z04Zv5IA+4qOuu044WKqSLSJRbs6lqxfWNNBD20iF/eb3jXSC/a1LmFBYruUFnW7WNdP5J/xBbotuhGxtXKITc29V/9lD5+ekLJ5Bj5x+J+uKkt6mdnshIKyd1/m1uyS4i09HUzBCrhDLhXcBvwdwAkod7X5loVPyDVQq5KAP6sb0s7cI+k8bxVSDW4Ca7+6KHgzlxwjzs1jAc9L4E5etzz6KlKabCE5wIgnmqeKWb5z7RsnqdroUvPlXNIc1tkoTaTKqRrcM97mRQJFVdMNk6LLsBYdvFAFr4LxQ44SnEGrysjs2KiQsHyp0OblLl4HWKblykIo8OeJ6UJWe6tEKEXN6CzXOSlpafK4Mg2Jd4ZGYGf5lcnlNW9Ej1/FsczuW3wOOTfS1xn3Or7N6ShxITNht19br+qr5xJ1Ktjjm8oglOfRtwtxajMPjG+QoB8yQwwRJnpHiflmke+F7KRJ9svj11qe0Hmadexk7lSPoARENLpAz0s4HjNdJifA4bo9f+IO8eSo/sNRuwptpSUv4WYrnevHCyI6whD68teLVLrS0llVSmyz+kJt6EiIfRnfGXT9Qp/s7Yk/VhcziriDlS+DBZUjqFJxKZpRHmmwiyCRAZI+JtQUP4fucLNN8M0cWdMxTrnhw6lUZUzS6+y8g==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(366004)(136003)(39860400002)(376002)(396003)(451199021)(2906002)(6512007)(38100700002)(83380400001)(2616005)(53546011)(26005)(186003)(31696002)(6506007)(86362001)(5660300002)(8676002)(36756003)(8936002)(478600001)(54906003)(66556008)(66946007)(41300700001)(4326008)(316002)(66476007)(6486002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VENmOTZKcCtpY0ErMjhuY3BEb3M0Wm5KUm1HaEUxVkxuWmpRTlRQam84Rkw4?=
 =?utf-8?B?M3pLWHliZWZRdDNsZWUrb3dzMVNHazdmaCt6UlltU29ETEduT08weUpFSUNt?=
 =?utf-8?B?UDZtL1AwUlJXaDdSKzgxSTZDYVY2dlJ5amZjOS9jRE51cnlSZ2hablRLTFV5?=
 =?utf-8?B?U2FFUGJQRjU4WG90d0J0ZWwyQjRpQUFVdFFJMWVWck9oaTdFdFdwU01jaHJM?=
 =?utf-8?B?T0pycXdJMy9QVGwxNDY3c0VrMDA2c212MmRDVCtZZFZKS1dFalc5MU9PWTFn?=
 =?utf-8?B?VUxWdjhGODliMURleDRweDZneFJ1TGREeWdTTDl6aFBubU9LM1VreWNoVUJk?=
 =?utf-8?B?UXMrTU1JZXhLYnpXRXJBNkJEVGhmMlBkTTdaQ1pNcjdjMlBKSklsRGdzWXlO?=
 =?utf-8?B?TmExS0puMWQvemt3dEJTc3dxaGJOL1VZ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-Network-Message-Id: 252da8dd-f533-4eb5-22a5-08db837c8e71
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 08:38:39.2898
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: tUmGnYSwUpL9QGFi/5VjqQ5fVnDocXW1iuFZACHpRwbUlXNQX8UQiLDCI6Dgkz1OHbA2TwBUVgbvhgLAPkpDJw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6912

On 12.07.2023 21:59, Elliott Mitchell wrote:
> This series has been seen previously.  The issue is pretty simple, if
> ACPI errors occur there is a high probability they will occur on multiple
> cores at once.

Nit: Both here and in the title s/ACPI/APIC/, to not misguide people about
the area the series touches (just in case a v4 might be needed).

Jan

>  Since there is no locking for `printk()` there is a need
> to emit the entire error with a single `printk()`.
> 
> I believe this is roughly where things left off.  The loop adjustment had
> been requested to be broken into a separate step.  I had also goofed when
> adjusting the handling and the string order had gotten reversed.
> 
> I'm unsure how best to make the `printk()` more maintainable.  Yet more
> "%s" and entries[#] will be needed if additional bits get defined.  I'm
> inclined to keep the string broken apart to hint as to how it matches
> the entry list.  I'm okay with everything being fully concatenated if
> that is felt best.
> 
> 
> Elliott Mitchell (3):
>   x86/APIC: include full string with error_interrupt() error messages
>   x86/APIC: modify error_interrupt() to output using single printk()
>   x86/APIC: adjustments to error_interrupt() loop
> 
>  xen/arch/x86/apic.c | 32 +++++++++++++++++---------------
>  1 file changed, 17 insertions(+), 15 deletions(-)
> 



From xen-devel-bounces@lists.xenproject.org Thu Jul 13 08:43:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 08:43:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563019.879894 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJruv-0006FZ-MJ; Thu, 13 Jul 2023 08:43:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563019.879894; Thu, 13 Jul 2023 08:43:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJruv-0006FS-Jd; Thu, 13 Jul 2023 08:43:17 +0000
Received: by outflank-mailman (input) for mailman id 563019;
 Thu, 13 Jul 2023 08:43:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ZvnF=C7=tibco.com=clindig@srs-se1.protection.inumbo.net>)
 id 1qJrut-0006FM-J4
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 08:43:15 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4e05aa37-2159-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 10:43:14 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-993a37b79e2so77951266b.1
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 01:43:14 -0700 (PDT)
Received: from smtpclient.apple (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 cd26-20020a170906b35a00b009929c39d5c4sm3682659ejb.36.2023.07.13.01.43.13
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 13 Jul 2023 01:43:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4e05aa37-2159-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689237793; x=1691829793;
        h=to:references:message-id:content-transfer-encoding:cc:date
         :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=dd4So+ud0W3G2H0jXSJDsrDV60FvjWe7/Kq5sWGCO44=;
        b=AvKvhjrdDcPOagBfUHANws+zB3BDy7ObiUWv5S8EJML2iP85bW/TOWZl8SGa8a3LfZ
         b82KbpYdrRTHOiVXkigutBJQUUx1yM7uann9J/BSRV7GiW9CEtP7C/KdlsiSDVrsU7iz
         iCQAmyvEG3Aid1b+Wi4XpD0UljthfbAH4PpcE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689237793; x=1691829793;
        h=to:references:message-id:content-transfer-encoding:cc:date
         :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=dd4So+ud0W3G2H0jXSJDsrDV60FvjWe7/Kq5sWGCO44=;
        b=XzvD5m0PJq3N9Xi90o/62ZKYVs3Nq/tDZhhP/Qq1F7B49y8z2xSJ9JFgZ5PavlW3Ki
         uJVHaiG90hg/1VyCmb1AZWcpimbxRk3qsiYvaHarE2zOtdwLmiD/Phff7NivDzw9CBD7
         Q1AATeiFjHPg19y3qs5DTES3JqsHPUnCAyjdQ5TdIIGLDLal6CprmJjYNPnKajb7UNah
         mM23sSDTIsqj42Xiw8hMM4XazWPSbFW2i4ypYPXfHlM/aUbnRPVPntaXcqWuHyCHmVan
         Ghj4TB7o3+UegV9lgtmoGk9KT0PTaKgIzONZlCwtoNi0RYUy20ikqdA+65qjUoECDp03
         N6OQ==
X-Gm-Message-State: ABy/qLYKRpPrHLNxuyPIqB0vgEPsoSmcCu9lEUWBAWf+IGrpm8fRIig5
	FeyWuRwZt7Vi3o7/VlGFd6ngvw==
X-Google-Smtp-Source: APBJJlGu5GsdVUCQZ22Fu9xArfZ9UNN5ewwVWFMDZLdIXxHer+riKWKb9HChJjqO2OHnErKNAS1l+w==
X-Received: by 2002:a17:907:2093:b0:991:b2a2:e424 with SMTP id pv19-20020a170907209300b00991b2a2e424mr890047ejb.76.1689237793525;
        Thu, 13 Jul 2023 01:43:13 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.3\))
Subject: Re: [PATCH] xenctrl_stubs.c: fix NULL dereference
From: Christian Lindig <christian.lindig@cloud.com>
In-Reply-To: <3b6374c44ae7e4afce427a9ea852d8d1ebbb42b3.1689236671.git.edwin.torok@cloud.com>
Date: Thu, 13 Jul 2023 09:43:12 +0100
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 =?utf-8?B?RWR3aW4gVMO2csO2aw==?= <edwin.torok@cloud.com>,
 Christian Lindig <christian.lindig@citrix.com>,
 David Scott <dave@recoil.org>,
 Wei Liu <wl@xen.org>,
 Anthony PERARD <anthony.perard@citrix.com>
Content-Transfer-Encoding: quoted-printable
Message-Id: <B7692393-A65B-4CDB-803B-4F8C135E0341@cloud.com>
References: <3b6374c44ae7e4afce427a9ea852d8d1ebbb42b3.1689236671.git.edwin.torok@cloud.com>
To: =?utf-8?B?RWR3aW4gVMO2csO2aw==?= <edvin.torok@citrix.com>
X-Mailer: Apple Mail (2.3696.120.41.1.3)



> On 13 Jul 2023, at 09:30, Edwin T=C3=B6r=C3=B6k =
<edvin.torok@citrix.com> wrote:
>=20
> From: Edwin T=C3=B6r=C3=B6k <edwin.torok@cloud.com>
>=20
> `Tag_cons` is `0` and is meant to be used as the tag argument for =
`caml_alloc`/`caml_alloc_small`
> when constructing a non-empty list.
> The empty list is `Val_emptylist` instead (which is really just =
`Val_int(0)`).
>=20
> Assigning `0` to a list value like this is equivalent to assigning the =
naked pointer `NULL` to the field.
> Naked pointers are not valid in OCaml 5, however even in OCaml <5.x =
any attempt to iterate on the list will lead to a segfault.
>=20
> The list currently only has an opaque type, so no code would have =
reason to iterate on it currently,
> but we shouldn't construct invalid OCaml values that might lead to a =
crash when exploring the type.
>=20
> `Val_emptylist` is available since OCaml 3.01 as a constant.
>=20
> Fixes: e5ac68a011 ("x86/hvm: Revert per-domain APIC acceleration =
support")
>=20
> Signed-off-by: Edwin T=C3=B6r=C3=B6k <edwin.torok@cloud.com>
> ---
> tools/ocaml/libs/xc/xenctrl_stubs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>=20
> diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c =
b/tools/ocaml/libs/xc/xenctrl_stubs.c
> index e4d9070f2d..3703f48c74 100644
> --- a/tools/ocaml/libs/xc/xenctrl_stubs.c
> +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
> @@ -832,7 +832,7 @@ CAMLprim value physinfo_arch_caps(const =
xc_physinfo_t *info)
>=20
> 	tag =3D 1; /* tag x86 */
>=20
> -	arch_obj =3D Tag_cons;
> +	arch_obj =3D Val_emptylist;
>=20
> #endif
>=20
> --=20
> 2.41.0
>=20

Acked-by: Christian Lindig <christian.lindig@cloud.com>



From xen-devel-bounces@lists.xenproject.org Thu Jul 13 09:11:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 09:11:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563028.879904 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJsLa-0001PN-1v; Thu, 13 Jul 2023 09:10:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563028.879904; Thu, 13 Jul 2023 09:10:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJsLZ-0001PG-Uz; Thu, 13 Jul 2023 09:10:49 +0000
Received: by outflank-mailman (input) for mailman id 563028;
 Thu, 13 Jul 2023 09:10:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qJsLY-0001PA-JG
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 09:10:48 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJsLX-0003fk-6j; Thu, 13 Jul 2023 09:10:47 +0000
Received: from [15.248.2.150] (helo=[10.24.67.22])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJsLW-0000Tc-VZ; Thu, 13 Jul 2023 09:10:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=8LZFOLx1RGeM07jcNM4RNjnkjegoh+yZ61l0VIGUVWw=; b=yFvHf79esqr4NQl32aF22Cwn8n
	KTlc3Z9nN0GvO1D4niBIgREz5q/jEMApW5kS1ff0Moh7RegiZQl4SirpXYxbp01u+x9xE+ndZGHtQ
	bgWNx1OHROBObqcy19Og7I2/RNVqyVKDsDy6HlDsvj4aG4O/3+gORoWHflWMUE2nrRug=;
Message-ID: <1ee3260f-7592-8384-9000-ea068b84a6c7@xen.org>
Date: Thu, 13 Jul 2023 10:10:44 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v9 00/24] Xen FF-A mediator
Content-Language: en-US
To: Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Jens Wiklander <jens.wiklander@linaro.org>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Anthony PERARD <anthony.perard@citrix.com>, Juergen Gross <jgross@suse.com>,
 Wei Liu <wl@xen.org>, Marc Bonnici <Marc.Bonnici@arm.com>,
 Achin Gupta <Achin.Gupta@arm.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>,
 Jan Beulich <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
 <480AA225-0590-40BE-BCD5-ADCCB1BC2274@arm.com>
 <CAHUa44FQotjOASHhUknwju20iOoFnub3erYOp+b_2+h=NCvv1A@mail.gmail.com>
 <DBFFABBE-AF3A-4ED1-8DAB-B00054D41C37@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <DBFFABBE-AF3A-4ED1-8DAB-B00054D41C37@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 13/07/2023 08:37, Bertrand Marquis wrote:
>> On 13 Jul 2023, at 09:12, Jens Wiklander <jens.wiklander@linaro.org> wrote:
>>>
>>> It makes it easier for reviewers if you put the changelog per patch
>>> instead of having all of them in the cover letter.
>>
>> OK. When I post the next version is it enough to document the v9->v10
>> changes in the affected patches?
> 
> 
> Yes that would be ok for me. If someone else has other requirements they will tell you :-)

No problem from me. It would be mean to request adding the per-patch 
changelog retroactively for 10 versions :).

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 09:19:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 09:19:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563031.879914 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJsTX-00023x-Ry; Thu, 13 Jul 2023 09:19:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563031.879914; Thu, 13 Jul 2023 09:19:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJsTX-00023q-P1; Thu, 13 Jul 2023 09:19:03 +0000
Received: by outflank-mailman (input) for mailman id 563031;
 Thu, 13 Jul 2023 09:19:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJsTW-00023Q-8O; Thu, 13 Jul 2023 09:19:02 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJsTV-0003sR-Qd; Thu, 13 Jul 2023 09:19:01 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJsTV-0003Ag-DP; Thu, 13 Jul 2023 09:19:01 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJsTV-0004J8-Cr; Thu, 13 Jul 2023 09:19:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=X9WsLTqLVZJzJl4bzDsWwMU5LOoyw9xcB4HwX1/WvBg=; b=fRvLOq0XtGPBsIs/uEuz/F6P5T
	pchJTKSHd7bUpPvk/jUtWQ40H3H/SkbMOTfWmAyZoDJDyNn/4xyIbj2ZOVpZZRRZytw8SvznfAQgR
	M/6zH2f7nPAz6LDMMoP4WqFyo/XqRsaR1azYEJ9/vxxeFd1IWdrJU6zwth+uvShzC5Ms=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181777-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181777: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qcow2:guest-start/debian.repeat:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=0a834e953b01ec25c412369d7a5b8b57d340ac60
X-Osstest-Versions-That:
    xen=3c911be55f1c4e0063e690fb61223df21511b5bb
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 13 Jul 2023 09:19:01 +0000

flight 181777 xen-unstable real [real]
flight 181779 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181777/
http://logs.test-lab.xenproject.org/osstest/logs/181779/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 181779-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181767
 test-amd64-amd64-xl-qcow2    21 guest-start/debian.repeat    fail  like 181767
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181772
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181772
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181772
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181772
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181772
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181772
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181772
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181772
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181772
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181772
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181772
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass

version targeted for testing:
 xen                  0a834e953b01ec25c412369d7a5b8b57d340ac60
baseline version:
 xen                  3c911be55f1c4e0063e690fb61223df21511b5bb

Last test of basis   181772  2023-07-12 09:14:07 Z    0 days
Testing same since   181777  2023-07-12 21:38:40 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Gianluca Luparini <gianluca.luparini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>
  Simone Ballarin <simone.ballarin@bugseng.com>
  Tamas K Lengyel <tamas@tklengyel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    fail    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   3c911be55f..0a834e953b  0a834e953b01ec25c412369d7a5b8b57d340ac60 -> master


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 09:22:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 09:22:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563025.879943 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJsXE-0003gp-JC; Thu, 13 Jul 2023 09:22:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563025.879943; Thu, 13 Jul 2023 09:22:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJsXE-0003gi-GG; Thu, 13 Jul 2023 09:22:52 +0000
Received: by outflank-mailman (input) for mailman id 563025;
 Thu, 13 Jul 2023 09:04:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=EagU=C7=intel.com=jani.nikula@srs-se1.protection.inumbo.net>)
 id 1qJsEy-0000RJ-BZ
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 09:04:00 +0000
Received: from mga01.intel.com (mga01.intel.com [192.55.52.88])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 320aee44-215c-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 11:03:57 +0200 (CEST)
Received: from orsmga007.jf.intel.com ([10.7.209.58])
 by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 13 Jul 2023 02:03:52 -0700
Received: from atadj-mobl1.amr.corp.intel.com (HELO localhost) ([10.252.50.30])
 by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 13 Jul 2023 02:03:08 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 320aee44-215c-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1689239037; x=1720775037;
  h=from:to:cc:subject:in-reply-to:references:date:
   message-id:mime-version:content-transfer-encoding;
  bh=wpe6dsOBfDPS7D7Sq/hiKhbMpNSn/Y2A1D02VMmRxgw=;
  b=PxZBt9LmpvX2z2YUmYlwynS0qDoO4A1s1rcbR8mCAcgxj3MIg/BFV5YQ
   TF5ozm0yDXh6azXLVNgLEoJG+aXbz8DlN10dZoNwj1l0YcmkzHIUnW9Tj
   KvDccwfPxg4lzZEnWkllXKJ04OHvW3d61TqmfGiKcy0dNr9/NZr1Rcwgo
   DSQtNwkg2vYxHkqXjRYlnekaPdMpLTPQMbt6rYFbF8uavCsnqS0hOq1yv
   G4qDNcZz4OPgm4HQzrah3N0XIStyMTTXXchtcXfWCIBmmUdlqoRYgUHOV
   /2eHBH4SRxdkTEkSnlivPRMaLl0Ufcz5u7CmjvBJq8Xz1zVPJhWUmKPGD
   Q==;
X-IronPort-AV: E=McAfee;i="6600,9927,10769"; a="395935105"
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="395935105"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10769"; a="715882508"
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="715882508"
From: Jani Nikula <jani.nikula@intel.com>
To: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>, Xinliang Liu
 <xinliang.liu@linaro.org>, Tomi Valkeinen
 <tomi.valkeinen+renesas@ideasonboard.com>, Alexey Kodanev
 <aleksei.kodanev@bell-sw.com>, dri-devel@lists.freedesktop.org, Vandita
 Kulkarni <vandita.kulkarni@intel.com>, Alim Akhtar
 <alim.akhtar@samsung.com>, Anitha Chrisanthus
 <anitha.chrisanthus@intel.com>, Marijn Suijten
 <marijn.suijten@somainline.org>, Jonathan Hunter <jonathanh@nvidia.com>,
 Arun R Murthy <arun.r.murthy@intel.com>, Jerome Brunet
 <jbrunet@baylibre.com>, Liu Shixin <liushixin2@huawei.com>,
 linux-samsung-soc@vger.kernel.org, Samuel Holland <samuel@sholland.org>,
 Matt Roper <matthew.d.roper@intel.com>, Wenjing Liu <wenjing.liu@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>, Stanislav Lisovskiy
 <stanislav.lisovskiy@intel.com>, Danilo Krummrich <dakr@redhat.com>, NXP
 Linux Team <linux-imx@nxp.com>, spice-devel@lists.freedesktop.org,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 linux-sunxi@lists.linux.dev, Stylon Wang <stylon.wang@amd.com>, Tim Huang
 <Tim.Huang@amd.com>, Suraj Kandpal <suraj.kandpal@intel.com>, =?utf-8?Q?A?=
 =?utf-8?Q?ndr=C3=A9?=
 Almeida <andrealmeid@igalia.com>, Andi Shyti <andi.shyti@linux.intel.com>,
 Yifan Zhang <yifan1.zhang@amd.com>, Leo Li <sunpeng.li@amd.com>, Sascha
 Hauer <s.hauer@pengutronix.de>, Lucas De Marchi
 <lucas.demarchi@intel.com>, Hersen Wu <hersenxs.wu@amd.com>, Jessica Zhang
 <quic_jesszhan@quicinc.com>, Kamlesh Gurudasani
 <kamlesh.gurudasani@gmail.com>, Bhawanpreet Lakha
 <Bhawanpreet.Lakha@amd.com>, =?utf-8?Q?=C5=81ukasz?= Bartosik
 <lb@semihalf.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>, Andrew Jeffery
 <andrew@aj.id.au>, Seung-Woo Kim <sw0312.kim@samsung.com>, Noralf
 =?utf-8?Q?Tr=C3=B8nnes?=
 <noralf@tronnes.org>, kernel@pengutronix.de, Alex Deucher
 <alexander.deucher@amd.com>, freedreno@lists.freedesktop.org, Claudiu
 Beznea <claudiu.beznea@microchip.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org, Mitul Golani
 <mitulkumar.ajitkumar.golani@intel.com>, =?utf-8?Q?Jos=C3=A9?= Roberto de
 Souza
 <jose.souza@intel.com>, virtualization@lists.linux-foundation.org, Thierry
 Reding <thierry.reding@gmail.com>, Yongqin Liu <yongqin.liu@linaro.org>,
 Mario Limonciello <mario.limonciello@amd.com>, Fei Yang
 <fei.yang@intel.com>, David Lechner <david@lechnology.com>, Juha-Pekka
 Heikkila <juhapekka.heikkila@gmail.com>, "Jiri Slaby (SUSE)"
 <jirislaby@kernel.org>, David Francis <David.Francis@amd.com>, Aaron Liu
 <aaron.liu@amd.com>, Vinod Polimera <quic_vpolimer@quicinc.com>,
 linux-rockchip@lists.infradead.org, Fangzhi Zuo <jerry.zuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>, VMware Graphics Reviewers
 <linux-graphics-maintainer@vmware.com>, Ben Skeggs <bskeggs@redhat.com>,
 Jouni =?utf-8?Q?H=C3=B6gander?= <jouni.hogander@intel.com>, Dave Airlie
 <airlied@redhat.com>, linux-mips@vger.kernel.org, Maxime Coquelin
 <mcoquelin.stm32@gmail.com>, Gurchetan Singh
 <gurchetansingh@chromium.org>, Martin Blumenstingl
 <martin.blumenstingl@googlemail.com>, linux-arm-msm@vger.kernel.org,
 Animesh Manna <animesh.manna@intel.com>,
 linux-renesas-soc@vger.kernel.org, Maxime Ripard <mripard@kernel.org>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>, Biju Das
 <biju.das.jz@bp.renesas.com>, linux-amlogic@lists.infradead.org, Evan Quan
 <evan.quan@amd.com>, Michal Simek <michal.simek@amd.com>,
 linux-arm-kernel@lists.infradead.org, Sean Paul <sean@poorly.run>, Neil
 Armstrong <neil.armstrong@linaro.org>, Kai Vehmanen
 <kai.vehmanen@linux.intel.com>, Boris Brezillon <bbrezillon@kernel.org>,
 Chunyan Zhang <zhang.lyra@gmail.com>, Qingqing Zhuo
 <qingqing.zhuo@amd.com>, Sandy Huang <hjc@rock-chips.com>, Swati Sharma
 <swati2.sharma@intel.com>, John Stultz <jstultz@google.com>, Paul
 Kocialkowski <paul.kocialkowski@bootlin.com>, Kyungmin Park
 <kyungmin.park@samsung.com>, Drew Davenport <ddavenport@chromium.org>,
 Kevin Hilman <khilman@baylibre.com>, Hawking Zhang
 <Hawking.Zhang@amd.com>, Haneen Mohammed <hamohammed.sa@gmail.com>, Anusha
 Srivatsa <anusha.srivatsa@intel.com>, Dan Carpenter <error27@gmail.com>,
 Karol Herbst <kherbst@redhat.com>, linux-hyperv@vger.kernel.org, Melissa
 Wen <melissa.srw@gmail.com>, =?utf-8?Q?Ma=C3=ADra?= Canal
 <mairacanal@riseup.net>, Luca
 Coelho <luciano.coelho@intel.com>, Laurent Pinchart
 <laurent.pinchart@ideasonboard.com>, Andrzej Hajda
 <andrzej.hajda@intel.com>, Likun Gao <Likun.Gao@amd.com>, Sam Ravnborg
 <sam@ravnborg.org>, Alain Volmat <alain.volmat@foss.st.com>, Xinwei Kong
 <kong.kongxinwei@hisilicon.com>, Jernej Skrabec
 <jernej.skrabec@gmail.com>, Deepak Rawat <drawat.floss@gmail.com>, Chen-Yu
 Tsai <wens@csie.org>, Joel Stanley <joel@jms.id.au>, Ankit Nautiyal
 <ankit.k.nautiyal@intel.com>, Sumit Semwal <sumit.semwal@linaro.org>, Alan
 Liu <haoping.liu@amd.com>, Philip Yang <Philip.Yang@amd.com>,
 intel-gfx@lists.freedesktop.org, Alison Wang <alison.wang@nxp.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>, Abhinav Kumar
 <quic_abhinavk@quicinc.com>, Gustavo Sousa <gustavo.sousa@intel.com>,
 Baolin Wang <baolin.wang@linux.alibaba.com>, Rodrigo Vivi
 <rodrigo.vivi@intel.com>, Mikko Perttunen <mperttunen@nvidia.com>, Tvrtko
 Ursulin <tvrtko.ursulin@linux.intel.com>, Rodrigo Siqueira
 <rodrigosiqueiramelo@gmail.com>, Tomi Valkeinen <tomba@kernel.org>, Deepak
 R Varma <drv@mailo.com>, "Pan,
 Xinhui" <Xinhui.Pan@amd.com>, Konrad Dybcio <konrad.dybcio@linaro.org>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>, Tian Tao
 <tiantao6@hisilicon.com>, Shawn Guo <shawnguo@kernel.org>, Christian
 =?utf-8?Q?K=C3=B6nig?=
 <christian.koenig@amd.com>, Khaled Almahallawy
 <khaled.almahallawy@intel.com>, linux-stm32@st-md-mailman.stormreply.com,
 Emma Anholt <emma@anholt.net>, Chun-Kuang Hu <chunkuang.hu@kernel.org>,
 Liviu Dudau <liviu.dudau@arm.com>, Alexandre Torgue
 <alexandre.torgue@foss.st.com>, Roman Li <roman.li@amd.com>, Paul Cercueil
 <paul@crapouillou.net>, Hamza Mahfooz <hamza.mahfooz@amd.com>, Marek Vasut
 <marex@denx.de>, Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 xen-devel@lists.xenproject.org, Guchun Chen <guchun.chen@amd.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, Raphael
 Gallais-Pou <raphael.gallais-pou@foss.st.com>, Rodrigo Siqueira
 <Rodrigo.Siqueira@amd.com>, Russell King <linux@armlinux.org.uk>, Uma
 Shankar <uma.shankar@intel.com>, Mika Kahola <mika.kahola@intel.com>,
 Jiasheng Jiang <jiasheng@iscas.ac.cn>, Srinivasan Shanmugam
 <srinivasan.shanmugam@amd.com>, Thomas Zimmermann <tzimmermann@suse.de>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 linux-tegra@vger.kernel.org, Marek =?utf-8?B?T2zFocOhaw==?=
 <marek.olsak@amd.com>, =?utf-8?Q?Joaqu=C3=ADn?=
 Ignacio =?utf-8?Q?Aramend=C3=ADa?= <samsagax@gmail.com>, Melissa Wen
 <mwen@igalia.com>,
 Hans de Goede <hdegoede@redhat.com>, linux-mediatek@lists.infradead.org,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>, Matthias Brugger
 <matthias.bgg@gmail.com>, David Tadokoro <davidbtadokoro@usp.br>,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 Orson Zhai <orsonzhai@gmail.com>, amd-gfx@lists.freedesktop.org, Jyri
 Sarha <jyri.sarha@iki.fi>, Yannick Fertre <yannick.fertre@foss.st.com>,
 Nicolas Ferre <nicolas.ferre@microchip.com>, Krzysztof Kozlowski
 <krzysztof.kozlowski@linaro.org>, Philippe Cornu
 <philippe.cornu@foss.st.com>, Wayne Lin <Wayne.Lin@amd.com>, Dmitry
 Baryshkov <dmitry.baryshkov@linaro.org>, Nirmoy Das
 <nirmoy.das@intel.com>, Lang Yu <Lang.Yu@amd.com>
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
In-Reply-To: <20230712161025.22op3gtzgujrhytb@pengutronix.de>
Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com>
 <20230712161025.22op3gtzgujrhytb@pengutronix.de>
Date: Thu, 13 Jul 2023 12:03:05 +0300
Message-ID: <878rbkgp4m.fsf@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Wed, 12 Jul 2023, Uwe Kleine-K=C3=B6nig <u.kleine-koenig@pengutronix.de>=
 wrote:
> Hello Jani,
>
> On Wed, Jul 12, 2023 at 05:34:28PM +0300, Jani Nikula wrote:
>> On Wed, 12 Jul 2023, Uwe Kleine-K=C3=B6nig <u.kleine-koenig@pengutronix.=
de> wrote:
>> > Hello,
>> >
>> > while I debugged an issue in the imx-lcdc driver I was constantly
>> > irritated about struct drm_device pointer variables being named "dev"
>> > because with that name I usually expect a struct device pointer.
>> >
>> > I think there is a big benefit when these are all renamed to "drm_dev".
>> > I have no strong preference here though, so "drmdev" or "drm" are fine
>> > for me, too. Let the bikesheding begin!
>> >
>> > Some statistics:
>> >
>> > $ git grep -ohE 'struct drm_device *\* *[^ (),;]*' v6.5-rc1 | sort | u=
niq -c | sort -n
>> >       1 struct drm_device *adev_to_drm
>> >       1 struct drm_device *drm_
>> >       1 struct drm_device          *drm_dev
>> >       1 struct drm_device        *drm_dev
>> >       1 struct drm_device *pdev
>> >       1 struct drm_device *rdev
>> >       1 struct drm_device *vdev
>> >       2 struct drm_device *dcss_drv_dev_to_drm
>> >       2 struct drm_device **ddev
>> >       2 struct drm_device *drm_dev_alloc
>> >       2 struct drm_device *mock
>> >       2 struct drm_device *p_ddev
>> >       5 struct drm_device *device
>> >       9 struct drm_device * dev
>> >      25 struct drm_device *d
>> >      95 struct drm_device *
>> >     216 struct drm_device *ddev
>> >     234 struct drm_device *drm_dev
>> >     611 struct drm_device *drm
>> >    4190 struct drm_device *dev
>> >
>> > This series starts with renaming struct drm_crtc::dev to drm_dev. If
>> > it's not only me and others like the result of this effort it should be
>> > followed up by adapting the other structs and the individual usages in
>> > the different drivers.
>>=20
>> I think this is an unnecessary change. In drm, a dev is usually a drm
>> device, i.e. struct drm_device *.
>
> Well, unless it's not. Prominently there is
>
> 	struct drm_device {
> 		...
> 		struct device *dev;
> 		...
> 	};
>
> which yields quite a few code locations using dev->dev which is
> IMHO unnecessary irritating:
>
> 	$ git grep '\<dev->dev' v6.5-rc1 drivers/gpu/drm | wc -l
> 	1633
>
> Also the functions that deal with both a struct device and a struct
> drm_device often use "dev" for the struct device and then "ddev" for
> the drm_device (see for example amdgpu_device_get_pcie_replay_count()).

Why is specifically struct drm_device *dev so irritating to you?

You lead us to believe it's an outlier in kernel, something that goes
against common kernel style, but it's really not:

$ git grep -how "struct [A-Za-z0-9_]\+ \*dev" | sort | uniq -c | sort -rn |=
 head -20
  38494 struct device *dev
  16388 struct net_device *dev
   4184 struct drm_device *dev
   2780 struct pci_dev *dev
   1916 struct comedi_device *dev
   1510 struct mlx5_core_dev *dev
   1057 struct mlx4_dev *dev
    894 struct b43_wldev *dev
    762 struct input_dev *dev
    623 struct usbnet *dev
    561 struct mlx5_ib_dev *dev
    525 struct mt76_dev *dev
    465 struct mt76x02_dev *dev
    435 struct platform_device *dev
    431 struct usb_device *dev
    411 struct mt7915_dev *dev
    398 struct cx231xx *dev
    378 struct mei_device *dev
    363 struct ksz_device *dev
    359 struct mthca_dev *dev

A good portion of the above also have a dev member.

Are you planning on changing all of the above too, or are you only
annoyed by drm?

I'm really not convinced at all.


BR,
Jani.


--=20
Jani Nikula, Intel Open Source Graphics Center


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 09:30:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 09:30:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563051.879977 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJseR-0005W8-NG; Thu, 13 Jul 2023 09:30:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563051.879977; Thu, 13 Jul 2023 09:30:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJseR-0005W1-Kc; Thu, 13 Jul 2023 09:30:19 +0000
Received: by outflank-mailman (input) for mailman id 563051;
 Thu, 13 Jul 2023 09:30:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=In0U=C7=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qJseP-0005Vv-PC
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 09:30:17 +0000
Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com
 [2a00:1450:4864:20::12f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e007fea9-215f-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 11:30:16 +0200 (CEST)
Received: by mail-lf1-x12f.google.com with SMTP id
 2adb3069b0e04-4fb77f21c63so880364e87.2
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 02:30:16 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 c17-20020a197611000000b004f864690901sm1039696lff.244.2023.07.13.02.30.14
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 13 Jul 2023 02:30:14 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e007fea9-215f-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689240615; x=1691832615;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=TCC3wHLU3EhDpG5xS20qPZ7FesJRYrMeuCZoxrc5oGE=;
        b=Ru8vtgVY6iVKv0/4OvN+UGyrxTtBSVCm0rlbx4F5kDxPuE/3m324cLjQSHFthQb3WQ
         dWUU0zQI2E1q8XsfUeHowftAbGwTZ2JNgG62VwUr73r4zrbNf5qvMc9puC8LW4RBZ0Ss
         hXKYQcptCXW7jJ+CFl+HpcyKo2ULAi0QSjtw3iDwWDBAKRb3pmC6m2LPoINvBup6Zwum
         rmVg5VF6AapRXF7AQM1Iu/GbVIilstx3Ln4sMBsptJUiN+kYUAdO5Sw+5KlsHafD1tDU
         FkP9+R5SY5x5+gRWsbo5XZwJMFzpYGv1GOTp1kw22Rjc7sT8mzQBnz8T4ZrRstdx9tPe
         CKgA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689240615; x=1691832615;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=TCC3wHLU3EhDpG5xS20qPZ7FesJRYrMeuCZoxrc5oGE=;
        b=QaGDza7Wr/hOptnw14mMv3z+n9qkJwV3IdKgLjGHzvN2ILvpcOtnEAZ8hQSnbRsqAG
         rvEOMGogcUK+JI9HC1OBrKFGJfphTcskf7Emq3HrBLAJETyuHmuaSQAW3Z2X9zSIxP0m
         /R4ZrtVYmPpK9WvQZO73Twumydc+Rr/EqBd2hrs70B2bjZXKkF1siz3dwVVvcBUhy8Hw
         0attmWlOsdMllfyiLzd978beJ4740rk849CxFhsnUYhqjZzk2sc2KevnJSyxCops/Kwy
         NOzI04HAuFBKhL3xtG0wk7aQqh7frNpl7iHDVHLLy4YEhqqLGtDRKDtA+dngRXMy1VbD
         Esbg==
X-Gm-Message-State: ABy/qLY5mwboczOdHj6Dqc/zbthHA6fQbz2hprQq6ecevZgY22uQj/D/
	sUNixcq/4ApyPAPH8EOKMG5t5SQqjEQ=
X-Google-Smtp-Source: APBJJlFsEFHRqsywd1UY+1d0ySwez1HIHeawwZQzmlP3UKz0KFqlZWhH9EUXTmw/d5MXOvnXoJtW6w==
X-Received: by 2002:a05:6512:31d4:b0:4fb:99c7:bb60 with SMTP id j20-20020a05651231d400b004fb99c7bb60mr856491lfe.59.1689240614889;
        Thu, 13 Jul 2023 02:30:14 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [PATCH] ns1650: refactor interrupt handling in ns16550_uart_dt_init()
Date: Thu, 13 Jul 2023 12:30:11 +0300
Message-ID: <cc5a08056abacdbb6d6509b56716eb45467307bb.1689240611.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In ns16550_init_postirq() there is the following check:
    if ( uart->irq > 0 )
    {
        uart->irqaction.handler = ns16550_interrupt;
        uart->irqaction.name    = "ns16550";
        uart->irqaction.dev_id  = port;
        if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
            printk("ERROR: Failed to allocate ns16550 IRQ %d\n", uart->irq);
    }

Thereby to have ns16550 work in polling mode uart->irq, should be equal to 0.

So it is needed to relax the following check in ns16550_uart_dt_init():
    res = platform_get_irq(dev, 0);
    if ( ! res )
        return -EINVAL;
    uart->irq = res;
If 'res' equals to -1 then polling mode should be used instead of return
-EINVAL.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/drivers/char/ns16550.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 2aed6ec707..f30f10d175 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1791,8 +1791,16 @@ static int __init ns16550_uart_dt_init(struct dt_device_node *dev,
     }
 
     res = platform_get_irq(dev, 0);
-    if ( ! res )
-        return -EINVAL;
+    if ( res == -1 )
+    {
+        printk("ns1650: polling will be used\n");
+        /*
+         * There is the check 'if ( uart->irq > 0 )' in ns16550_init_postirq().
+         * If the check is true then interrupt mode will be used otherwise
+         * ( when irq = 0 )polling.
+         */
+        res = 0;
+    }
     uart->irq = res;
 
     uart->dw_usr_bsy = dt_device_is_compatible(dev, "snps,dw-apb-uart");
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 13 09:34:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 09:34:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563054.879987 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJsiK-000667-6Y; Thu, 13 Jul 2023 09:34:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563054.879987; Thu, 13 Jul 2023 09:34:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJsiK-000660-3y; Thu, 13 Jul 2023 09:34:20 +0000
Received: by outflank-mailman (input) for mailman id 563054;
 Thu, 13 Jul 2023 09:34:19 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qJsiJ-00065u-5H
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 09:34:19 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJsiI-0004O5-38; Thu, 13 Jul 2023 09:34:18 +0000
Received: from [15.248.2.150] (helo=[10.24.67.22])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJsiH-0001eZ-Th; Thu, 13 Jul 2023 09:34:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=bcoc3IJFFi4Cq0DgAnGjf5qqSfL5e2opArg8uGrYNZM=; b=RO+I4Q+V9tYw3MoqA4L/5wsrkG
	3pHRQBmDc0ONcF+WRwxl0AFtAUEAnfsE22PyuwPT0VfGaV3RnEahqRJziWnm6SdyT1+MNwygWmnO0
	kKyZn1ZqwruSMaXeSjqjTiEpqiW0FGuIYjC75Uyie4iP4vetTSIf2IoEzvblAF9x7sTY=;
Message-ID: <3f853d77-f1a3-3031-cd83-6826dc9d966f@xen.org>
Date: Thu, 13 Jul 2023 10:34:15 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [XEN PATCH v9 02/24] xen/arm: add TEE teardown to
 arch_domain_teardown()
Content-Language: en-US
To: Jens Wiklander <jens.wiklander@linaro.org>
Cc: xen-devel@lists.xenproject.org,
 Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Bertrand.Marquis@arm.com,
 Anthony PERARD <anthony.perard@citrix.com>, Juergen Gross <jgross@suse.com>,
 Wei Liu <wl@xen.org>, Marc Bonnici <marc.bonnici@arm.com>,
 Achin Gupta <achin.gupta@arm.com>, Andrew Cooper <andrew.cooper3@citrix.com>
References: <20230705093433.2514898-1-jens.wiklander@linaro.org>
 <20230705093433.2514898-3-jens.wiklander@linaro.org>
 <b1a9be99-6078-6553-74f1-5be5f002b23d@xen.org>
 <CAHUa44FxkUxN4+pfECk0Sb9JgArNAh7vgKktK+=bY1C0rABVqg@mail.gmail.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <CAHUa44FxkUxN4+pfECk0Sb9JgArNAh7vgKktK+=bY1C0rABVqg@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 13/07/2023 08:02, Jens Wiklander wrote:
>>> +}
>>> +
>>>    static uint64_t regpair_to_uint64(register_t reg0, register_t reg1)
>>>    {
>>>        return ((uint64_t)reg0 << 32) | (uint32_t)reg1;
>>> @@ -1732,6 +1737,7 @@ static const struct tee_mediator_ops optee_ops =
>>>    {
>>>        .probe = optee_probe,
>>>        .domain_init = optee_domain_init,
>>> +    .domain_teardown = optee_domain_teardown,
>>>        .relinquish_resources = optee_relinquish_resources,
>>>        .handle_call = optee_handle_call,
>>>    };
>>> diff --git a/xen/arch/arm/tee/tee.c b/xen/arch/arm/tee/tee.c
>>> index 3964a8a5cddf..ddd17506a9ff 100644
>>> --- a/xen/arch/arm/tee/tee.c
>>> +++ b/xen/arch/arm/tee/tee.c
>>> @@ -52,6 +52,14 @@ int tee_domain_init(struct domain *d, uint16_t tee_type)
>>>        return cur_mediator->ops->domain_init(d);
>>>    }
>>>
>>> +int tee_domain_teardown(struct domain *d)
>>> +{
>>> +    if ( !cur_mediator )
>>> +        return 0;
>>> +
>>> +    return cur_mediator->ops->domain_teardown(d);
>>
>> NIT: I would consider to check if the callback is NULL. This would avoid
>> providing dummy helper.
> 
> Yes, that's an advantage, but we'd treat this callback differently
> from others. 

I haven't checked the rest of the callbacks. But I would argue that any 
callback that are expected to be optional, should have an if 
(...->ops->fn). This reducing the amount of dummy helper (4 lines) each 
times.

> I'd prefer to keep this as it is if you don't mind.
I am Ok with that. Once FFA is merged, I will try to remember to go 
through the callback and there the empty ones.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 09:37:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 09:37:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563057.879998 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJsll-0006j1-Om; Thu, 13 Jul 2023 09:37:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563057.879998; Thu, 13 Jul 2023 09:37:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJsll-0006iu-Lt; Thu, 13 Jul 2023 09:37:53 +0000
Received: by outflank-mailman (input) for mailman id 563057;
 Thu, 13 Jul 2023 09:35:53 +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
 <SRS0=cTst=C7=gmail.com=geert.uytterhoeven@srs-se1.protection.inumbo.net>)
 id 1qJsjp-0006di-Pr
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 09:35:53 +0000
Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com
 [209.85.210.174]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a74018d2-2160-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 11:35:51 +0200 (CEST)
Received: by mail-pf1-f174.google.com with SMTP id
 d2e1a72fcca58-6687096c6ddso312505b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 02:35:51 -0700 (PDT)
Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com.
 [209.85.210.175]) by smtp.gmail.com with ESMTPSA id
 e26-20020aa78c5a000000b006828e49c04csm5043133pfd.75.2023.07.13.02.35.48
 for <xen-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 13 Jul 2023 02:35:48 -0700 (PDT)
Received: by mail-pf1-f175.google.com with SMTP id
 d2e1a72fcca58-666e5f0d60bso292850b3a.3
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 02:35:48 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a74018d2-2160-11ee-8611-37d641c3527e
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689240949; x=1691832949;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=LHmbzhpkJKMYjCs3rLqCEOJxasGkKa4brFmr33oqUxc=;
        b=KUgrNIJ4xQlyIRLlI/C9eGpbq8LStFlWF0Am0VZh5j3Gw9vHjhhj9fFg+osIG3rGSh
         8ELscpzrn2LBufDyuMlRA/7jZhKvmDFQ4+cjZGMHXsj0LnFQmscs6+M1/gK1J6HRwYGZ
         Ic5D3EKtTqh3/E0RsCDfb5FxKrJtDji/1K6gSmqtcZMjnGbJ6guLBCEl/8vFkKqO2+Q9
         47kqEVICpcTjcq2cTycNWh+1TmZhs031w1vrl+obqkcuL7uFV7Rx+l7bQS83FokI4xjQ
         DVNllUbxWKlvxannKQeyyzeEYlirj5ojDbMK2qTZkCxoQChlcJkMkKD7aTgVIz6f01FE
         5SyQ==
X-Gm-Message-State: ABy/qLb6TEn9gMpj6zeuiA2Ewf/+AD6oPu13icrqZ6BpaBH1UGu/dLko
	p4FxfuzeuGBLez9lT5g20j/4ohaC3I1MrkJm
X-Google-Smtp-Source: APBJJlFXHT2M0P5mwkm2GPAVPRmV9vMg2YIp5LSRHQckXjJu6nanBBghbYRmzvYSBZokTMsx0/h3Kw==
X-Received: by 2002:a05:6a20:4291:b0:11e:e940:441e with SMTP id o17-20020a056a20429100b0011ee940441emr475432pzj.25.1689240949328;
        Thu, 13 Jul 2023 02:35:49 -0700 (PDT)
X-Received: by 2002:a0d:ef46:0:b0:56e:1df1:dc58 with SMTP id
 y67-20020a0def46000000b0056e1df1dc58mr1228415ywe.45.1689240610993; Thu, 13
 Jul 2023 02:30:10 -0700 (PDT)
MIME-Version: 1.0
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com> <20230712161025.22op3gtzgujrhytb@pengutronix.de> <878rbkgp4m.fsf@intel.com>
In-Reply-To: <878rbkgp4m.fsf@intel.com>
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Thu, 13 Jul 2023 11:29:54 +0200
X-Gmail-Original-Message-ID: <CAMuHMdV_CvSyF-dFpZwOkQ8PWXWphWxCm2Lwpx8ZXAfWDBafcQ@mail.gmail.com>
Message-ID: <CAMuHMdV_CvSyF-dFpZwOkQ8PWXWphWxCm2Lwpx8ZXAfWDBafcQ@mail.gmail.com>
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to drm_dev
To: Jani Nikula <jani.nikula@intel.com>
Cc: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, 
	Xinliang Liu <xinliang.liu@linaro.org>, 
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>, 
	Alexey Kodanev <aleksei.kodanev@bell-sw.com>, dri-devel@lists.freedesktop.org, 
	Vandita Kulkarni <vandita.kulkarni@intel.com>, Alim Akhtar <alim.akhtar@samsung.com>, 
	Anitha Chrisanthus <anitha.chrisanthus@intel.com>, 
	Marijn Suijten <marijn.suijten@somainline.org>, Jonathan Hunter <jonathanh@nvidia.com>, 
	Arun R Murthy <arun.r.murthy@intel.com>, Jerome Brunet <jbrunet@baylibre.com>, 
	Liu Shixin <liushixin2@huawei.com>, linux-samsung-soc@vger.kernel.org, 
	Samuel Holland <samuel@sholland.org>, Matt Roper <matthew.d.roper@intel.com>, 
	Wenjing Liu <wenjing.liu@amd.com>, Javier Martinez Canillas <javierm@redhat.com>, 
	Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>, Danilo Krummrich <dakr@redhat.com>, 
	NXP Linux Team <linux-imx@nxp.com>, spice-devel@lists.freedesktop.org, 
	Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>, linux-sunxi@lists.linux.dev, 
	Stylon Wang <stylon.wang@amd.com>, Tim Huang <Tim.Huang@amd.com>, 
	Suraj Kandpal <suraj.kandpal@intel.com>, =?UTF-8?Q?Andr=C3=A9_Almeida?= <andrealmeid@igalia.com>, 
	Andi Shyti <andi.shyti@linux.intel.com>, Yifan Zhang <yifan1.zhang@amd.com>, 
	Leo Li <sunpeng.li@amd.com>, Sascha Hauer <s.hauer@pengutronix.de>, 
	Lucas De Marchi <lucas.demarchi@intel.com>, Hersen Wu <hersenxs.wu@amd.com>, 
	Jessica Zhang <quic_jesszhan@quicinc.com>, 
	Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>, 
	Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>, =?UTF-8?Q?=C5=81ukasz_Bartosik?= <lb@semihalf.com>, 
	Radhakrishna Sripada <radhakrishna.sripada@intel.com>, Andrew Jeffery <andrew@aj.id.au>, 
	Seung-Woo Kim <sw0312.kim@samsung.com>, =?UTF-8?Q?Noralf_Tr=C3=B8nnes?= <noralf@tronnes.org>, 
	kernel@pengutronix.de, Alex Deucher <alexander.deucher@amd.com>, 
	freedreno@lists.freedesktop.org, 
	Claudiu Beznea <claudiu.beznea@microchip.com>, Gerd Hoffmann <kraxel@redhat.com>, 
	Alexandre Belloni <alexandre.belloni@bootlin.com>, linux-aspeed@lists.ozlabs.org, 
	nouveau@lists.freedesktop.org, 
	Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>, 
	=?UTF-8?Q?Jos=C3=A9_Roberto_de_Souza?= <jose.souza@intel.com>, 
	virtualization@lists.linux-foundation.org, 
	Thierry Reding <thierry.reding@gmail.com>, Yongqin Liu <yongqin.liu@linaro.org>, 
	Mario Limonciello <mario.limonciello@amd.com>, Fei Yang <fei.yang@intel.com>, 
	David Lechner <david@lechnology.com>, Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>, 
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>, David Francis <David.Francis@amd.com>, 
	Aaron Liu <aaron.liu@amd.com>, Vinod Polimera <quic_vpolimer@quicinc.com>, 
	linux-rockchip@lists.infradead.org, Fangzhi Zuo <jerry.zuo@amd.com>, 
	Aurabindo Pillai <aurabindo.pillai@amd.com>, 
	VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>, Ben Skeggs <bskeggs@redhat.com>, 
	=?UTF-8?Q?Jouni_H=C3=B6gander?= <jouni.hogander@intel.com>, 
	Dave Airlie <airlied@redhat.com>, linux-mips@vger.kernel.org, 
	Maxime Coquelin <mcoquelin.stm32@gmail.com>, Gurchetan Singh <gurchetansingh@chromium.org>, 
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>, linux-arm-msm@vger.kernel.org, 
	Animesh Manna <animesh.manna@intel.com>, linux-renesas-soc@vger.kernel.org, 
	Maxime Ripard <mripard@kernel.org>, 
	Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>, Biju Das <biju.das.jz@bp.renesas.com>, 
	linux-amlogic@lists.infradead.org, Evan Quan <evan.quan@amd.com>, 
	Michal Simek <michal.simek@amd.com>, linux-arm-kernel@lists.infradead.org, 
	Sean Paul <sean@poorly.run>, Neil Armstrong <neil.armstrong@linaro.org>, 
	Kai Vehmanen <kai.vehmanen@linux.intel.com>, Boris Brezillon <bbrezillon@kernel.org>, 
	Chunyan Zhang <zhang.lyra@gmail.com>, Qingqing Zhuo <qingqing.zhuo@amd.com>, 
	Sandy Huang <hjc@rock-chips.com>, Swati Sharma <swati2.sharma@intel.com>, 
	John Stultz <jstultz@google.com>, Paul Kocialkowski <paul.kocialkowski@bootlin.com>, 
	Kyungmin Park <kyungmin.park@samsung.com>, Drew Davenport <ddavenport@chromium.org>, 
	Kevin Hilman <khilman@baylibre.com>, Hawking Zhang <Hawking.Zhang@amd.com>, 
	Haneen Mohammed <hamohammed.sa@gmail.com>, Anusha Srivatsa <anusha.srivatsa@intel.com>, 
	Dan Carpenter <error27@gmail.com>, Karol Herbst <kherbst@redhat.com>, linux-hyperv@vger.kernel.org, 
	Melissa Wen <melissa.srw@gmail.com>, =?UTF-8?B?TWHDrXJhIENhbmFs?= <mairacanal@riseup.net>, 
	Luca Coelho <luciano.coelho@intel.com>, 
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Andrzej Hajda <andrzej.hajda@intel.com>, 
	Likun Gao <Likun.Gao@amd.com>, Sam Ravnborg <sam@ravnborg.org>, 
	Alain Volmat <alain.volmat@foss.st.com>, Xinwei Kong <kong.kongxinwei@hisilicon.com>, 
	Jernej Skrabec <jernej.skrabec@gmail.com>, Deepak Rawat <drawat.floss@gmail.com>, 
	Chen-Yu Tsai <wens@csie.org>, Joel Stanley <joel@jms.id.au>, 
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>, Sumit Semwal <sumit.semwal@linaro.org>, 
	Alan Liu <haoping.liu@amd.com>, Philip Yang <Philip.Yang@amd.com>, 
	intel-gfx@lists.freedesktop.org, Alison Wang <alison.wang@nxp.com>, 
	Wolfram Sang <wsa+renesas@sang-engineering.com>, 
	Abhinav Kumar <quic_abhinavk@quicinc.com>, Gustavo Sousa <gustavo.sousa@intel.com>, 
	Baolin Wang <baolin.wang@linux.alibaba.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>, 
	Mikko Perttunen <mperttunen@nvidia.com>, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>, 
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>, Tomi Valkeinen <tomba@kernel.org>, 
	Deepak R Varma <drv@mailo.com>, "Pan, Xinhui" <Xinhui.Pan@amd.com>, 
	Konrad Dybcio <konrad.dybcio@linaro.org>, 
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>, Tian Tao <tiantao6@hisilicon.com>, 
	Shawn Guo <shawnguo@kernel.org>, =?UTF-8?Q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>, 
	Khaled Almahallawy <khaled.almahallawy@intel.com>, linux-stm32@st-md-mailman.stormreply.com, 
	Emma Anholt <emma@anholt.net>, Chun-Kuang Hu <chunkuang.hu@kernel.org>, 
	Liviu Dudau <liviu.dudau@arm.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, 
	Roman Li <roman.li@amd.com>, Paul Cercueil <paul@crapouillou.net>, 
	Hamza Mahfooz <hamza.mahfooz@amd.com>, Marek Vasut <marex@denx.de>, 
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, xen-devel@lists.xenproject.org, 
	Guchun Chen <guchun.chen@amd.com>, 
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>, 
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>, Russell King <linux@armlinux.org.uk>, 
	Uma Shankar <uma.shankar@intel.com>, Mika Kahola <mika.kahola@intel.com>, 
	Jiasheng Jiang <jiasheng@iscas.ac.cn>, Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>, 
	Thomas Zimmermann <tzimmermann@suse.de>, Vinod Govindapillai <vinod.govindapillai@intel.com>, 
	linux-tegra@vger.kernel.org, =?UTF-8?B?TWFyZWsgT2zFocOhaw==?= <marek.olsak@amd.com>, 
	=?UTF-8?Q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= <samsagax@gmail.com>, 
	Melissa Wen <mwen@igalia.com>, Hans de Goede <hdegoede@redhat.com>, 
	linux-mediatek@lists.infradead.org, 
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>, Matthias Brugger <matthias.bgg@gmail.com>, 
	David Tadokoro <davidbtadokoro@usp.br>, 
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Orson Zhai <orsonzhai@gmail.com>, 
	amd-gfx@lists.freedesktop.org, Jyri Sarha <jyri.sarha@iki.fi>, 
	Yannick Fertre <yannick.fertre@foss.st.com>, Nicolas Ferre <nicolas.ferre@microchip.com>, 
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, 
	Philippe Cornu <philippe.cornu@foss.st.com>, Wayne Lin <Wayne.Lin@amd.com>, 
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, Nirmoy Das <nirmoy.das@intel.com>, 
	Lang Yu <Lang.Yu@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Jani,

On Thu, Jul 13, 2023 at 11:03=E2=80=AFAM Jani Nikula <jani.nikula@intel.com=
> wrote:
> On Wed, 12 Jul 2023, Uwe Kleine-K=C3=B6nig <u.kleine-koenig@pengutronix.d=
e> wrote:
> > On Wed, Jul 12, 2023 at 05:34:28PM +0300, Jani Nikula wrote:
> >> On Wed, 12 Jul 2023, Uwe Kleine-K=C3=B6nig <u.kleine-koenig@pengutroni=
x.de> wrote:
> >> > while I debugged an issue in the imx-lcdc driver I was constantly
> >> > irritated about struct drm_device pointer variables being named "dev=
"
> >> > because with that name I usually expect a struct device pointer.
> >> >
> >> > I think there is a big benefit when these are all renamed to "drm_de=
v".
> >> > I have no strong preference here though, so "drmdev" or "drm" are fi=
ne
> >> > for me, too. Let the bikesheding begin!
> >> >
> >> > Some statistics:
> >> >
> >> > $ git grep -ohE 'struct drm_device *\* *[^ (),;]*' v6.5-rc1 | sort |=
 uniq -c | sort -n
> >> >       1 struct drm_device *adev_to_drm
> >> >       1 struct drm_device *drm_
> >> >       1 struct drm_device          *drm_dev
> >> >       1 struct drm_device        *drm_dev
> >> >       1 struct drm_device *pdev
> >> >       1 struct drm_device *rdev
> >> >       1 struct drm_device *vdev
> >> >       2 struct drm_device *dcss_drv_dev_to_drm
> >> >       2 struct drm_device **ddev
> >> >       2 struct drm_device *drm_dev_alloc
> >> >       2 struct drm_device *mock
> >> >       2 struct drm_device *p_ddev
> >> >       5 struct drm_device *device
> >> >       9 struct drm_device * dev
> >> >      25 struct drm_device *d
> >> >      95 struct drm_device *
> >> >     216 struct drm_device *ddev
> >> >     234 struct drm_device *drm_dev
> >> >     611 struct drm_device *drm
> >> >    4190 struct drm_device *dev
> >> >
> >> > This series starts with renaming struct drm_crtc::dev to drm_dev. If
> >> > it's not only me and others like the result of this effort it should=
 be
> >> > followed up by adapting the other structs and the individual usages =
in
> >> > the different drivers.
> >>
> >> I think this is an unnecessary change. In drm, a dev is usually a drm
> >> device, i.e. struct drm_device *.
> >
> > Well, unless it's not. Prominently there is
> >
> >       struct drm_device {
> >               ...
> >               struct device *dev;
> >               ...
> >       };
> >
> > which yields quite a few code locations using dev->dev which is
> > IMHO unnecessary irritating:
> >
> >       $ git grep '\<dev->dev' v6.5-rc1 drivers/gpu/drm | wc -l
> >       1633
> >
> > Also the functions that deal with both a struct device and a struct
> > drm_device often use "dev" for the struct device and then "ddev" for
> > the drm_device (see for example amdgpu_device_get_pcie_replay_count()).
>
> Why is specifically struct drm_device *dev so irritating to you?
>
> You lead us to believe it's an outlier in kernel, something that goes
> against common kernel style, but it's really not:
>
> $ git grep -how "struct [A-Za-z0-9_]\+ \*dev" | sort | uniq -c | sort -rn=
 | head -20
>   38494 struct device *dev
>   16388 struct net_device *dev
>    4184 struct drm_device *dev
>    2780 struct pci_dev *dev
>    1916 struct comedi_device *dev
>    1510 struct mlx5_core_dev *dev
>    1057 struct mlx4_dev *dev
>     894 struct b43_wldev *dev
>     762 struct input_dev *dev
>     623 struct usbnet *dev
>     561 struct mlx5_ib_dev *dev
>     525 struct mt76_dev *dev
>     465 struct mt76x02_dev *dev
>     435 struct platform_device *dev
>     431 struct usb_device *dev
>     411 struct mt7915_dev *dev
>     398 struct cx231xx *dev
>     378 struct mei_device *dev
>     363 struct ksz_device *dev
>     359 struct mthca_dev *dev
>
> A good portion of the above also have a dev member.

Not all of them access both the foo_device and the device pointers.

Let's put the number of 435 platform_device pointers named "dev"
into perspective:

    10095 struct platform_device *pdev

Gr{oetje,eeting}s,

                        Geert

--=20
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k=
.org

In personal conversations with technical people, I call myself a hacker. Bu=
t
when I'm talking to journalists I just say "programmer" or something like t=
hat.
                                -- Linus Torvalds


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 09:43:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 09:43:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563064.880008 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJsqn-00089e-C0; Thu, 13 Jul 2023 09:43:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563064.880008; Thu, 13 Jul 2023 09:43:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJsqn-00089X-8B; Thu, 13 Jul 2023 09:43:05 +0000
Received: by outflank-mailman (input) for mailman id 563064;
 Thu, 13 Jul 2023 09:43:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qJsqm-00089R-34
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 09:43:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJsql-0004Ww-6c; Thu, 13 Jul 2023 09:43:03 +0000
Received: from [15.248.2.150] (helo=[10.24.67.22])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJsql-00028h-0D; Thu, 13 Jul 2023 09:43:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=VDTftAUGfVfdWCue+V47lISMjulisJSRWjxTzf9wXfA=; b=1pWwKEAiQKq5XzsHqE7vz/p7Oz
	b2CiDD7JfWEqHc8EYS8y854Hlt4sasqftqgHAwKaMq0cxhwwIyuE2pMMvt8a5M0f+m0h6aTazvI6D
	QlZMrAEzjd4LD2KKpVDU4b5/pVBIu/8bYf1EtEVHVGUuSEggUJf8m9rSheqI9E9s8eKE=;
Message-ID: <ca31c7aa-1879-a196-ace0-4418d8a5b0c9@xen.org>
Date: Thu, 13 Jul 2023 10:43:01 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH] ns1650: refactor interrupt handling in
 ns16550_uart_dt_init()
Content-Language: en-US
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
References: <cc5a08056abacdbb6d6509b56716eb45467307bb.1689240611.git.oleksii.kurochko@gmail.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <cc5a08056abacdbb6d6509b56716eb45467307bb.1689240611.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Oleksii,

Title: IMO, Your patch doesn't do any refactor. Instead, it add support 
for polling when using the DT.

On 13/07/2023 10:30, Oleksii Kurochko wrote:
> In ns16550_init_postirq() there is the following check:
>      if ( uart->irq > 0 )
>      {
>          uart->irqaction.handler = ns16550_interrupt;
>          uart->irqaction.name    = "ns16550";
>          uart->irqaction.dev_id  = port;
>          if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
>              printk("ERROR: Failed to allocate ns16550 IRQ %d\n", uart->irq);
>      }
> 
> Thereby to have ns16550 work in polling mode uart->irq, should be equal to 0.
> 
> So it is needed to relax the following check in ns16550_uart_dt_init():
>      res = platform_get_irq(dev, 0);
>      if ( ! res )
>          return -EINVAL;
>      uart->irq = res;
> If 'res' equals to -1 then polling mode should be used instead of return
> -EINVAL.

This commit message has a bit too much code in it for me taste. I don't 
think it is necessary to quote the code. Instead, you can explain the 
following:

  * Why you want to support polling
  * Why this is valid to have a node without interrupts (add a reference 
to the bindings)
  * That polling is indicated by using 'irq = 0'. I would consider to 
provide a define (e.g NO_IRQ_POLL) to make it more clearer.

> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
>   xen/drivers/char/ns16550.c | 12 ++++++++++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
> index 2aed6ec707..f30f10d175 100644
> --- a/xen/drivers/char/ns16550.c
> +++ b/xen/drivers/char/ns16550.c
> @@ -1791,8 +1791,16 @@ static int __init ns16550_uart_dt_init(struct dt_device_node *dev,
>       }
>   
>       res = platform_get_irq(dev, 0);
> -    if ( ! res )
> -        return -EINVAL;
> +    if ( res == -1 )

Why do you check explicitely for -1 instead of < 0? Also, the behavior 
is somewhat change now. Before, we would return -EINVAL when res equals 
0. Can you explain in the commit message why this is done?

> +    {
> +        printk("ns1650: polling will be used\n");
> +        /*
> +         * There is the check 'if ( uart->irq > 0 )' in ns16550_init_postirq().
> +         * If the check is true then interrupt mode will be used otherwise
> +         * ( when irq = 0 )polling.
> +         */

Similar remark to the commit message. You could write:

"If the node doesn't have any interrupt, then it means the driver will 
want to using polling."

> +        res = 0;
> +    }
>       uart->irq = res;
>   
>       uart->dw_usr_bsy = dt_device_is_compatible(dev, "snps,dw-apb-uart");

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 09:57:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 09:57:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563069.880018 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJt40-0001Me-P9; Thu, 13 Jul 2023 09:56:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563069.880018; Thu, 13 Jul 2023 09:56:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJt40-0001MX-Kg; Thu, 13 Jul 2023 09:56:44 +0000
Received: by outflank-mailman (input) for mailman id 563069;
 Thu, 13 Jul 2023 09:56:23 +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
 <SRS0=MlyT=C7=pengutronix.de=ukl@srs-se1.protection.inumbo.net>)
 id 1qJt3f-0001Lt-3k
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 09:56:23 +0000
Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de
 [2001:67c:670:201:290:27ff:fe1d:cc33])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 844c6c67-2163-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 11:56:20 +0200 (CEST)
Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2])
 by metis.ext.pengutronix.de with esmtps
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJt2G-0003Tu-57; Thu, 13 Jul 2023 11:54:56 +0200
Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de)
 by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJt1o-00E5Pi-If; Thu, 13 Jul 2023 11:54:28 +0200
Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJt1n-004WRt-D8; Thu, 13 Jul 2023 11:54:27 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 844c6c67-2163-11ee-8611-37d641c3527e
Date: Thu, 13 Jul 2023 11:54:27 +0200
From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
To: Jani Nikula <jani.nikula@intel.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
	dri-devel@lists.freedesktop.org,
	Vandita Kulkarni <vandita.kulkarni@intel.com>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Arun R Murthy <arun.r.murthy@intel.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	linux-samsung-soc@vger.kernel.org,
	Samuel Holland <samuel@sholland.org>,
	Matt Roper <matthew.d.roper@intel.com>,
	Wenjing Liu <wenjing.liu@amd.com>,
	Javier Martinez Canillas <javierm@redhat.com>,
	Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
	Danilo Krummrich <dakr@redhat.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	spice-devel@lists.freedesktop.org,
	Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	linux-sunxi@lists.linux.dev,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Stylon Wang <stylon.wang@amd.com>, Tim Huang <Tim.Huang@amd.com>,
	Suraj Kandpal <suraj.kandpal@intel.com>,
	=?utf-8?B?QW5kcsOp?= Almeida <andrealmeid@igalia.com>,
	Mika Kahola <mika.kahola@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Leo Li <sunpeng.li@amd.com>, Sascha Hauer <s.hauer@pengutronix.de>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	Hersen Wu <hersenxs.wu@amd.com>, Dave Airlie <airlied@redhat.com>,
	Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
	Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
	=?utf-8?Q?=C5=81ukasz?= Bartosik <lb@semihalf.com>,
	Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
	Andrew Jeffery <andrew@aj.id.au>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Noralf =?utf-8?Q?Tr=C3=B8nnes?= <noralf@tronnes.org>,
	kernel@pengutronix.de, Alex Deucher <alexander.deucher@amd.com>,
	freedreno@lists.freedesktop.org,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org,
	Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
	=?utf-8?B?Sm9zw6k=?= Roberto de Souza <jose.souza@intel.com>,
	virtualization@lists.linux-foundation.org,
	Thierry Reding <thierry.reding@gmail.com>,
	Yongqin Liu <yongqin.liu@linaro.org>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Fei Yang <fei.yang@intel.com>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	David Francis <David.Francis@amd.com>,
	Vinod Govindapillai <vinod.govindapillai@intel.com>,
	Aaron Liu <aaron.liu@amd.com>,
	Vinod Polimera <quic_vpolimer@quicinc.com>,
	linux-rockchip@lists.infradead.org, Fangzhi Zuo <jerry.zuo@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
	Ben Skeggs <bskeggs@redhat.com>,
	Jouni =?utf-8?B?SMO2Z2FuZGVy?= <jouni.hogander@intel.com>,
	Jessica Zhang <quic_jesszhan@quicinc.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-arm-msm@vger.kernel.org,
	Animesh Manna <animesh.manna@intel.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Maxime Ripard <mripard@kernel.org>,
	Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
	Tian Tao <tiantao6@hisilicon.com>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	linux-amlogic@lists.infradead.org, Evan Quan <evan.quan@amd.com>,
	Michal Simek <michal.simek@amd.com>,
	linux-arm-kernel@lists.infradead.org, Sean Paul <sean@poorly.run>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Qingqing Zhuo <qingqing.zhuo@amd.com>,
	Sandy Huang <hjc@rock-chips.com>,
	Swati Sharma <swati2.sharma@intel.com>,
	linux-renesas-soc@vger.kernel.org,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>,
	Haneen Mohammed <hamohammed.sa@gmail.com>,
	Paul Cercueil <paul@crapouillou.net>,
	Anusha Srivatsa <anusha.srivatsa@intel.com>,
	Dan Carpenter <error27@gmail.com>,
	Karol Herbst <kherbst@redhat.com>, linux-hyperv@vger.kernel.org,
	Melissa Wen <melissa.srw@gmail.com>,
	=?utf-8?B?TWHDrXJh?= Canal <mairacanal@riseup.net>,
	Luca Coelho <luciano.coelho@intel.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Likun Gao <Likun.Gao@amd.com>,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
	Emma Anholt <emma@anholt.net>,
	Alain Volmat <alain.volmat@foss.st.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Deepak Rawat <drawat.floss@gmail.com>,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	Joel Stanley <joel@jms.id.au>, Orson Zhai <orsonzhai@gmail.com>,
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
	Alan Liu <haoping.liu@amd.com>, Philip Yang <Philip.Yang@amd.com>,
	intel-gfx@lists.freedesktop.org, Alison Wang <alison.wang@nxp.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Gustavo Sousa <gustavo.sousa@intel.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
	Mikko Perttunen <mperttunen@nvidia.com>,
	Yifan Zhang <yifan1.zhang@amd.com>,
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
	Tomi Valkeinen <tomba@kernel.org>, Deepak R Varma <drv@mailo.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	John Stultz <jstultz@google.com>, Roman Li <roman.li@amd.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Christian =?utf-8?B?S8O2bmln?= <christian.koenig@amd.com>,
	Khaled Almahallawy <khaled.almahallawy@intel.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	Sam Ravnborg <sam@ravnborg.org>,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Liviu Dudau <liviu.dudau@arm.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Gurchetan Singh <gurchetansingh@chromium.org>,
	Liu Shixin <liushixin2@huawei.com>,
	Hamza Mahfooz <hamza.mahfooz@amd.com>, Marek Vasut <marex@denx.de>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	xen-devel@lists.xenproject.org, Guchun Chen <guchun.chen@amd.com>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
	Russell King <linux@armlinux.org.uk>,
	Uma Shankar <uma.shankar@intel.com>,
	Andi Shyti <andi.shyti@linux.intel.com>,
	Jiasheng Jiang <jiasheng@iscas.ac.cn>,
	Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
	David Lechner <david@lechnology.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Marek =?utf-8?B?T2zFocOhaw==?= <marek.olsak@amd.com>,
	=?utf-8?Q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= <samsagax@gmail.com>,
	Melissa Wen <mwen@igalia.com>, Hans de Goede <hdegoede@redhat.com>,
	linux-mediatek@lists.infradead.org,
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	linux-tegra@vger.kernel.org, David Tadokoro <davidbtadokoro@usp.br>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
	amd-gfx@lists.freedesktop.org, Lang Yu <Lang.Yu@amd.com>,
	Yannick Fertre <yannick.fertre@foss.st.com>,
	linux-mips@vger.kernel.org,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Philippe Cornu <philippe.cornu@foss.st.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Wayne Lin <Wayne.Lin@amd.com>,
	Drew Davenport <ddavenport@chromium.org>,
	Nirmoy Das <nirmoy.das@intel.com>, Jyri Sarha <jyri.sarha@iki.fi>
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
Message-ID: <20230713095427.swf7unzca4ahipsk@pengutronix.de>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com>
 <20230712161025.22op3gtzgujrhytb@pengutronix.de>
 <878rbkgp4m.fsf@intel.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="qeweu3qcdjoypth2"
Content-Disposition: inline
In-Reply-To: <878rbkgp4m.fsf@intel.com>
X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2
X-SA-Exim-Mail-From: ukl@pengutronix.de
X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false
X-PTX-Original-Recipient: xen-devel@lists.xenproject.org


--qeweu3qcdjoypth2
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 13, 2023 at 12:03:05PM +0300, Jani Nikula wrote:
> On Wed, 12 Jul 2023, Uwe Kleine-K=F6nig <u.kleine-koenig@pengutronix.de> =
wrote:
> > Hello Jani,
> >
> > On Wed, Jul 12, 2023 at 05:34:28PM +0300, Jani Nikula wrote:
> >> On Wed, 12 Jul 2023, Uwe Kleine-K=F6nig <u.kleine-koenig@pengutronix.d=
e> wrote:
> >> > Hello,
> >> >
> >> > while I debugged an issue in the imx-lcdc driver I was constantly
> >> > irritated about struct drm_device pointer variables being named "dev"
> >> > because with that name I usually expect a struct device pointer.
> >> >
> >> > I think there is a big benefit when these are all renamed to "drm_de=
v".
> >> > I have no strong preference here though, so "drmdev" or "drm" are fi=
ne
> >> > for me, too. Let the bikesheding begin!
> >> >
> >> > Some statistics:
> >> >
> >> > $ git grep -ohE 'struct drm_device *\* *[^ (),;]*' v6.5-rc1 | sort |=
 uniq -c | sort -n
> >> >       1 struct drm_device *adev_to_drm
> >> >       1 struct drm_device *drm_
> >> >       1 struct drm_device          *drm_dev
> >> >       1 struct drm_device        *drm_dev
> >> >       1 struct drm_device *pdev
> >> >       1 struct drm_device *rdev
> >> >       1 struct drm_device *vdev
> >> >       2 struct drm_device *dcss_drv_dev_to_drm
> >> >       2 struct drm_device **ddev
> >> >       2 struct drm_device *drm_dev_alloc
> >> >       2 struct drm_device *mock
> >> >       2 struct drm_device *p_ddev
> >> >       5 struct drm_device *device
> >> >       9 struct drm_device * dev
> >> >      25 struct drm_device *d
> >> >      95 struct drm_device *
> >> >     216 struct drm_device *ddev
> >> >     234 struct drm_device *drm_dev
> >> >     611 struct drm_device *drm
> >> >    4190 struct drm_device *dev
> >> >
> >> > This series starts with renaming struct drm_crtc::dev to drm_dev. If
> >> > it's not only me and others like the result of this effort it should=
 be
> >> > followed up by adapting the other structs and the individual usages =
in
> >> > the different drivers.
> >>=20
> >> I think this is an unnecessary change. In drm, a dev is usually a drm
> >> device, i.e. struct drm_device *.
> >
> > Well, unless it's not. Prominently there is
> >
> > 	struct drm_device {
> > 		...
> > 		struct device *dev;
> > 		...
> > 	};
> >
> > which yields quite a few code locations using dev->dev which is
> > IMHO unnecessary irritating:
> >
> > 	$ git grep '\<dev->dev' v6.5-rc1 drivers/gpu/drm | wc -l
> > 	1633
> >
> > Also the functions that deal with both a struct device and a struct
> > drm_device often use "dev" for the struct device and then "ddev" for
> > the drm_device (see for example amdgpu_device_get_pcie_replay_count()).
>=20
> Why is specifically struct drm_device *dev so irritating to you?
>=20
> You lead us to believe it's an outlier in kernel, something that goes
> against common kernel style, but it's really not:
>=20
> $ git grep -how "struct [A-Za-z0-9_]\+ \*dev" | sort | uniq -c | sort -rn=
 | head -20
>   38494 struct device *dev
>   16388 struct net_device *dev
>    4184 struct drm_device *dev
>    2780 struct pci_dev *dev
>    1916 struct comedi_device *dev
>    1510 struct mlx5_core_dev *dev
>    1057 struct mlx4_dev *dev
>     894 struct b43_wldev *dev
>     762 struct input_dev *dev
>     623 struct usbnet *dev
>     561 struct mlx5_ib_dev *dev
>     525 struct mt76_dev *dev
>     465 struct mt76x02_dev *dev
>     435 struct platform_device *dev
>     431 struct usb_device *dev
>     411 struct mt7915_dev *dev
>     398 struct cx231xx *dev
>     378 struct mei_device *dev
>     363 struct ksz_device *dev
>     359 struct mthca_dev *dev
>=20
> A good portion of the above also have a dev member.

Yeah, other subsystems and drivers have the same problem. You're lucky
that I noticed drm first and invested some effort to improve it. IMHO
other subsystems being bad shouldn't stop drm to improve here.

And note that for example for pci_dev there are 5794 instances that are
named "pdev" and there are 9971 struct platform_device that are called
"pdev", too. So the majority for these does it better. And agreed,
net_device and others are also inconsistent. If you want an area that is
better, look at the naming of i2c_client or spi_device. (And take into
account that these are spread all over the tree and so are not in
control of a single maintainer team.)

> Are you planning on changing all of the above too, or are you only
> annoyed by drm?

Would you be more welcoming if I promised to tackle some of the above,
too? If so: I might. I hesitate a bit because I didn't suffer from the
others. (Apart from asking ctags for "dev" is a nightmare.)

And regarding the second part of your question: I was annoyed by drm
because that was the one that offended me while researching a problem in
a drm driver. And the variable/struct member name irritated me enough to
believe that with consistent naming I would have found it quicker.

Best regards
Uwe

--=20
Pengutronix e.K.                           | Uwe Kleine-K=F6nig            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

--qeweu3qcdjoypth2
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmSvydIACgkQj4D7WH0S
/k4hjAgAozFp653NVzmkpE7aXTRWhbDCNL3DGT9ODtF01d4F5Hj7wJVIryc1iT+i
pKEV3mhZKNm6WpaQU9OtvO3zdC2E6lx4+fyvWXNW9JpRVgekEPJyl60rXGhU8fuN
pghoNgpFQ2LJFVA81cUXRwu81TZBU3fMt/EUn6f4skEG0QVCIdVZNP8w5W9+5g5P
ZTx8I6TkHDjubT+sZeYiWn1FQxah3EU9o9rk6Bj8aa61vJOuDKXo3NTSLN78Aitl
e0aR9Ro4Vfdg3XW5b52IGHn+Sg8dzYClC4kPBBQtdUao8U6CO8hW7w9+pNraKIV8
T5zOCDUDryMjbJbNfnD2SSquB7gVlw==
=7d5L
-----END PGP SIGNATURE-----

--qeweu3qcdjoypth2--


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 10:09:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 10:09:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563077.880028 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJtFt-00031h-RP; Thu, 13 Jul 2023 10:09:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563077.880028; Thu, 13 Jul 2023 10:09:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJtFt-00031a-Os; Thu, 13 Jul 2023 10:09:01 +0000
Received: by outflank-mailman (input) for mailman id 563077;
 Thu, 13 Jul 2023 10:08:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=0tL6=C7=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJtFr-00031U-Kr
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 10:08:59 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on2060f.outbound.protection.outlook.com
 [2a01:111:f400:fe12::60f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 481304e3-2165-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 12:08:58 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PAWPR04MB10031.eurprd04.prod.outlook.com (2603:10a6:102:38b::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24; Thu, 13 Jul
 2023 10:08:55 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Thu, 13 Jul 2023
 10:08:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 481304e3-2165-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=OESnFr6jOVm6AdjCKCMPVu1Z9Hi8T0SOEmojP2Vb9kSwdXIrbMYPj04QiyV4f2p3dcCmQwxSk+5TRh7X5/ByIciBUFIcoItwP0L+mNB9uWiVwm9KwScNcmGsRYVYWbDccDLOdR1Vb4IIfXiLTdQR8IPxk9q359WcvyEaM3EOpCeFtTp9ZPBILMpzUw8t3ZyJ0GZcoVgJAMNMMsLHL5rQEUMDVyKKt2jKvlrZK8lp1QOGWEHwy2ouEWjV+hXwoadD02D4RRo/SKkNNLzzBQTr+BxKWQaSvV6FCFBQnLevMPNBnKiD0nYxZV2A/KHSE8x7OrgmvuO7d2NJscoJMXtzZw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=cs/iHZ6wTOUd5ud+2uIVAP6yVHZ7HE+7sLg9mA+mHfc=;
 b=Fxp3x1afOz/5HLnZ9X/lJoq2Qs9fgp1JAGCPneeID1PMMsQFAU+Erst0ykzm6gHkCYtkDKROJOMyuTBOWbenmpL66OsKzEkw0YWGNDz3LgJUutpFnKiwy+Y+wjyo2/YFlmdiuRs5iY10u5hjC1wjWmr5kzX8ip2r08Z/pN9d68pewM7iDIbLY21kP3//8e0ZqxngRTif5PTL+PKuDlcyfSqGRm/5BfnSoZfm/u2zFwPUvIyyBfIHWIujR+rKCG8gRz65lg6Ea1XyTG+pZw1Fqk9Q/H/hoGQFH9jW3YyNYiJGtwWDhQgwgB4TpDKScjsqx6l+Hkqo07sHKl6iPwy9hQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=cs/iHZ6wTOUd5ud+2uIVAP6yVHZ7HE+7sLg9mA+mHfc=;
 b=bQAP+jepya/ZHgRSweGtoY1tBAX9Pu1kJG/hSszBeZtra/yTUvLn97me0V7XYawqdH2Alc5NTHDeCkiuWjLzAlQpmh8EiRHCfg7TDN7UgfiBEcbURivagqn+JlkXmpx0n/bLs8kS4OW2RRpXrKNJEY8nf+7+dA5bI/un3HtWL5WU8C/fFZJt3wm3tqKBYaiL++K6HK9W7GNmmm1t6StJus8kiWMPYkp0Gogq6Liv1Ax7NsWUANowD+qs6mtgeuvM90Q1UQlxCzsQzQ5YU9VmnIuN/dUNqNFHs3q+NENcsqHtvOYMCcfVWj/WEcdTckNHhan2h0c5RV5O0nAI02Jqgg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <a385a17b-a60c-d770-e044-af64273371d6@suse.com>
Date: Thu, 13 Jul 2023 12:08:53 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] ns1650: refactor interrupt handling in
 ns16550_uart_dt_init()
Content-Language: en-US
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Julien Grall <julien@xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <cc5a08056abacdbb6d6509b56716eb45467307bb.1689240611.git.oleksii.kurochko@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <cc5a08056abacdbb6d6509b56716eb45467307bb.1689240611.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0044.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:92::18) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAWPR04MB10031:EE_
X-MS-Office365-Filtering-Correlation-Id: c6c7e2c5-fdd5-4e7f-6974-08db83892afa
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	epnUZaItMMpWX1fGx2Z1EikdmHtXc6I4//gx5PxKoDjf3m+DWN1SUycxft9x4Lxo6wCG5XFaK9Y4xMS7/IaKmi8livpfWrVmxmeFFodLFCc71+z1C9/0EigM6I2JHEXK9heojIp6BbYx1jEVIhHuoXNktA4OR1oArxJLsc90Py5QXS7pLhPFXzcuLgYW78ayHjB8qfxRk/qUA8rgoCqxWXnsT+pr2coZAbA/QVGy0W5n6wQhU8H6klZ2u2muMV9WCaOb2m5mGCWOUH6uVxKjW5KldG96bLt1XURESgPOf+6ZQyijN7yYn5aUH1ebGcx/SrUXat6jaX68abEsvgYXyTHbdpsje/Kz+hith21CX9a75p4N3JYYoJQ17QIJBT+u+cW/ad61Oxf3RloPP/8Q6HBUl6b5EZKaU3o6eiFtjZdckQHUMv5VFrz09J+UYeHtiyo3/WQZ5kZyf2icxBn0NcaTfCw8ZT5cJeg8l/aInkGCtJeZrMj4RX8w0KVD6lDFbBiSkrwNHWzz5abRnQJ19AGkBbAaT3UdR33Qh1MPeWDHxH44OA7O4ktIM34M4iuLeg6r2dv4znEzJaeFOdi+WglbeS8j6weIjvSsmEDZ9S9p2AZpbxB/7HIN2nG8NtzrPeIKfiL7B7oO6hTeGbJGrQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(396003)(136003)(39860400002)(366004)(451199021)(478600001)(31686004)(4744005)(54906003)(66946007)(110136005)(4326008)(2906002)(5660300002)(316002)(41300700001)(8676002)(8936002)(66556008)(66476007)(6512007)(6486002)(26005)(6506007)(53546011)(38100700002)(186003)(2616005)(36756003)(86362001)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aERqWGp2eWQyRTRlT3o3YVFxdXRjZC9hanQ0SGpTcXhHNmtZT2Q1OS93aWZX?=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3FnNWdUVEkwWnAzR094MGtSSVhZNmRj?=
 =?utf-8?B?Q05CU3dPTzYzV3ROUFBnY3pXaFNlOVBLMlA1bnhwdXNwZzR3WlpmVXVqbk43?=
 =?utf-8?B?ei9WY2l4azNQM1dpSzNYbENUM2FvTG82cy9XL0NUd1RSOWFuZ2Y0MVlZVUxS?=
 =?utf-8?B?ZnlRRyt0NGtFRDloUjJOYjNwQmlDYUpMQUtIT3BUT3JzMUs4NXF1RzhlbUND?=
 =?utf-8?B?dXpWMjJ3ZzdJakFwZVlJbkdFWEt0MHB1SWVzOHFqbEc5MFBxQjJ2T3o0dGRB?=
 =?utf-8?B?aTM5amVMa21MTGVuRFBobkxId3o5YlpJVXBFRzlwdit3SnMwcmtrNXJVZWRk?=
 =?utf-8?Q?9JeKh+3k50qkIUtPSDOmqhwTO?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c6c7e2c5-fdd5-4e7f-6974-08db83892afa
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 10:08:55.8634
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Fx1i1IumrS1QqUsPjw6nagl0FxCfYGltQMMHl+9FKHWMJu0W1+upil2Qd5XWZYHoYtAs0kcUIVFsCR4eG4gD7Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB10031

On 13.07.2023 11:30, Oleksii Kurochko wrote:
> --- a/xen/drivers/char/ns16550.c
> +++ b/xen/drivers/char/ns16550.c
> @@ -1791,8 +1791,16 @@ static int __init ns16550_uart_dt_init(struct dt_device_node *dev,
>      }
>  
>      res = platform_get_irq(dev, 0);
> -    if ( ! res )
> -        return -EINVAL;
> +    if ( res == -1 )
> +    {
> +        printk("ns1650: polling will be used\n");

Nit: Please don't omit one of the two 5-s here.

> +        /*
> +         * There is the check 'if ( uart->irq > 0 )' in ns16550_init_postirq().
> +         * If the check is true then interrupt mode will be used otherwise
> +         * ( when irq = 0 )polling.
> +         */

I wonder in how far that's actually correct outside of x86. On x86 IRQ0 is
always the timer interrupt, but I'm not convinced something similar can be
used as kind of a heuristic on Arm, RISC-V, or basically any other
architecture.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 10:13:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 10:13:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563079.880038 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJtKJ-0004S1-CF; Thu, 13 Jul 2023 10:13:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563079.880038; Thu, 13 Jul 2023 10:13:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJtKJ-0004Ru-8k; Thu, 13 Jul 2023 10:13:35 +0000
Received: by outflank-mailman (input) for mailman id 563079;
 Thu, 13 Jul 2023 10:13:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qJtKI-0004Rk-8X
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 10:13:34 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJtKF-0005Iu-KM; Thu, 13 Jul 2023 10:13:31 +0000
Received: from [15.248.2.150] (helo=[10.24.67.22])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJtKF-0003wS-EA; Thu, 13 Jul 2023 10:13:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=VAVE3mqEwnh6DRLAfrMDm8bQKwF56tacgnhtAa4n4MQ=; b=DcnAzN6FmeVEFzIb2Jk41S5P5T
	VbH/KeR7FpdxIOX97zILW8+2pStvj1zgGJrOCJ6PHm7bKRLCvFr60vIZSgC+w4GN44IT00Hr2e1Tx
	fn5IDUNMu2GFvF1ppgDJ5NULchvlOtip1Jv2MDhs3QyelTDHItBC3oHw/TQ1iEFEJ2eM=;
Message-ID: <d05c5fb0-63ab-4368-ed3b-bb06b242808a@xen.org>
Date: Thu, 13 Jul 2023 11:13:29 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH] ns1650: refactor interrupt handling in
 ns16550_uart_dt_init()
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <cc5a08056abacdbb6d6509b56716eb45467307bb.1689240611.git.oleksii.kurochko@gmail.com>
 <a385a17b-a60c-d770-e044-af64273371d6@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <a385a17b-a60c-d770-e044-af64273371d6@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Jan,

On 13/07/2023 11:08, Jan Beulich wrote:
> On 13.07.2023 11:30, Oleksii Kurochko wrote:
>> --- a/xen/drivers/char/ns16550.c
>> +++ b/xen/drivers/char/ns16550.c
>> @@ -1791,8 +1791,16 @@ static int __init ns16550_uart_dt_init(struct dt_device_node *dev,
>>       }
>>   
>>       res = platform_get_irq(dev, 0);
>> -    if ( ! res )
>> -        return -EINVAL;
>> +    if ( res == -1 )
>> +    {
>> +        printk("ns1650: polling will be used\n");
> 
> Nit: Please don't omit one of the two 5-s here.
> 
>> +        /*
>> +         * There is the check 'if ( uart->irq > 0 )' in ns16550_init_postirq().
>> +         * If the check is true then interrupt mode will be used otherwise
>> +         * ( when irq = 0 )polling.
>> +         */
> 
> I wonder in how far that's actually correct outside of x86. On x86 IRQ0 is
> always the timer interrupt, but I'm not convinced something similar can be
> used as kind of a heuristic on Arm, RISC-V, or basically any other
> architecture.

I wondered the same. On Arm we are fine because the UART will be an SPI 
which starts at 32.

That's part why I was suggesting to use a define. Because we don't have 
to hardcode the poll value everywhere.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 10:40:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 10:40:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563085.880048 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJtjv-0007U7-GV; Thu, 13 Jul 2023 10:40:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563085.880048; Thu, 13 Jul 2023 10:40:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJtjv-0007Tb-Du; Thu, 13 Jul 2023 10:40:03 +0000
Received: by outflank-mailman (input) for mailman id 563085;
 Thu, 13 Jul 2023 10:40:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DQTI=C7=citrix.com=prvs=551dcd425=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qJtjt-0007BY-LA
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 10:40:01 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9c920d8a-2169-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 12:39:59 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9c920d8a-2169-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689244799;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=FGhj2c0X1N7Uk8yepWwjAUO5waflu4/WnfyeZf3GX+o=;
  b=ZLxKS2J6bTd74GfNaUc3RW7PD2iESiXwMuMmlvDWEom5LWTtDGENYicP
   ZrmrBTZsvXrFzUjJ0T8qcKIYi8B9KaMWtp96tkhvpUKn9h46fs/nxbUrX
   zVYlqX5qF5oelZPP6pgAuJl+n5+G91t/oUtUE0jzegr3v2P+jTkT4tRpQ
   8=;
Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 116513475
X-Ironport-Server: esa1.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:ijHIqau9SlpzNK9sa3uFYWCcHOfnVENeMUV32f8akzHdYApBsoF/q
 tZmKWyGPf6OZjf0coxyaIu18BkP75fQndU3Tws+ryBhQXsU+JbJXdiXEBz9bniYRiHhoOCLz
 O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQqIu
 Nfjy+XSI1bg0DNvWo4uw/vrRChH4rKq4Vv0gnRkPaoQ5ACHzCFMZH4iDfrZw0XQE9E88tGSH
 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9
 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG
 fMwMzMkLRuzvdmKg5GADfBstOZ6Hu23I9ZK0p1g5Wmx4fcORJnCR+PB5MNC3Sd2jcdLdRrcT
 5NHM3w1Nk2GOkARfA5NU/rSn8/x7pX7WzRetFKSo7tx+2XJxRZ9+L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="116513475"
Date: Thu, 13 Jul 2023 11:39:53 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
CC: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>, Juergen Gross
	<jgross@suse.com>
Subject: Re: [PATCH v2 6/6] libxl: add support for parsing MSR features
Message-ID: <48d5ca83-d14b-44e1-9431-5324118eacb7@perard>
References: <20230711092230.15408-1-roger.pau@citrix.com>
 <20230711092230.15408-7-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230711092230.15408-7-roger.pau@citrix.com>

On Tue, Jul 11, 2023 at 11:22:30AM +0200, Roger Pau Monne wrote:
> diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
> index b1c4f8f2f45b..86a08f29a19c 100644
> --- a/tools/libs/light/libxl_cpuid.c
> +++ b/tools/libs/light/libxl_cpuid.c
> @@ -158,6 +158,57 @@ static int cpuid_add(libxl_cpuid_policy_list *policy,
>      return 0;
>  }
>  
> +static struct xc_msr *msr_find_match(libxl_cpuid_policy_list *pl, uint32_t index)
> +{
> +    unsigned int i = 0;
> +    libxl_cpuid_policy_list policy = *pl;
> +
> +    if (policy == NULL)
> +        policy = *pl = calloc(1, sizeof(*policy));
> +
> +    if (policy->msr != NULL)
> +        for (i = 0; policy->msr[i].index != XC_MSR_INPUT_UNUSED; i++)

Could you add { } for this two blocks? One line after a if() without { }
is ok, but not more.

> +            if (policy->msr[i].index == index)
> +                return &policy->msr[i];
> +
> +    policy->msr = realloc(policy->msr, sizeof(struct xc_msr) * (i + 2));
> +    policy->msr[i].index = index;
> +    memset(policy->msr[i].policy, 'x', ARRAY_SIZE(policy->msr[0].policy) - 1);

Is this "array_size() - 1" correct? The -1 need to go, right?

> +    policy->msr[i].policy[ARRAY_SIZE(policy->msr[0].policy) - 1] = '\0';

Is it for convenience? Maybe for easier debugging (printf)? Also, I
guess having a NUL at the end mean the -1 on the previous statement kind
of useful.

> +    policy->msr[i + 1].index = XC_MSR_INPUT_UNUSED;
> +
> +    return &policy->msr[i];
> +}

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 10:43:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 10:43:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563075.880058 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJtnX-00008R-1E; Thu, 13 Jul 2023 10:43:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563075.880058; Thu, 13 Jul 2023 10:43:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJtnW-00008K-Um; Thu, 13 Jul 2023 10:43:46 +0000
Received: by outflank-mailman (input) for mailman id 563075;
 Thu, 13 Jul 2023 10:06:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=MlyT=C7=pengutronix.de=ukl@srs-se1.protection.inumbo.net>)
 id 1qJtD9-0002xw-SM
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 10:06:11 +0000
Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de
 [2001:67c:670:201:290:27ff:fe1d:cc33])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e2a5e786-2164-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 12:06:08 +0200 (CEST)
Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2])
 by metis.ext.pengutronix.de with esmtps
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJtAp-0005VD-Rg; Thu, 13 Jul 2023 12:03:47 +0200
Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de)
 by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJtAh-00E5Qb-W2; Thu, 13 Jul 2023 12:03:40 +0200
Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJtAh-004WUt-8s; Thu, 13 Jul 2023 12:03:39 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e2a5e786-2164-11ee-b239-6b7b168915f2
Date: Thu, 13 Jul 2023 12:03:39 +0200
From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Heiko =?utf-8?Q?St=C3=BCbner?= <heiko@sntech.de>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
	Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
	dri-devel@lists.freedesktop.org,
	Vandita Kulkarni <vandita.kulkarni@intel.com>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Arun R Murthy <arun.r.murthy@intel.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Liu Shixin <liushixin2@huawei.com>,
	linux-samsung-soc@vger.kernel.org,
	Samuel Holland <samuel@sholland.org>,
	Matt Roper <matthew.d.roper@intel.com>,
	Wenjing Liu <wenjing.liu@amd.com>,
	Javier Martinez Canillas <javierm@redhat.com>,
	Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
	Danilo Krummrich <dakr@redhat.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	spice-devel@lists.freedesktop.org,
	Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
	linux-sunxi@lists.linux.dev, Stylon Wang <stylon.wang@amd.com>,
	Tim Huang <Tim.Huang@amd.com>,
	Suraj Kandpal <suraj.kandpal@intel.com>,
	=?utf-8?B?QW5kcsOp?= Almeida <andrealmeid@igalia.com>,
	Andi Shyti <andi.shyti@linux.intel.com>,
	Yifan Zhang <yifan1.zhang@amd.com>, Leo Li <sunpeng.li@amd.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	Inki Dae <inki.dae@samsung.com>, Hersen Wu <hersenxs.wu@amd.com>,
	Jessica Zhang <quic_jesszhan@quicinc.com>,
	Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
	Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
	=?utf-8?Q?=C5=81ukasz?= Bartosik <lb@semihalf.com>,
	Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
	Andrew Jeffery <andrew@aj.id.au>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Noralf =?utf-8?Q?Tr=C3=B8nnes?= <noralf@tronnes.org>,
	kernel@pengutronix.de, Alex Deucher <alexander.deucher@amd.com>,
	freedreno@lists.freedesktop.org,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	Zack Rusin <zackr@vmware.com>, Gerd Hoffmann <kraxel@redhat.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org,
	Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
	=?utf-8?B?Sm9zw6k=?= Roberto de Souza <jose.souza@intel.com>,
	virtualization@lists.linux-foundation.org,
	Thierry Reding <thierry.reding@gmail.com>,
	Yongqin Liu <yongqin.liu@linaro.org>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Fei Yang <fei.yang@intel.com>,
	Ville =?utf-8?B?U3lyasOkbMOk?= <ville.syrjala@linux.intel.com>,
	David Lechner <david@lechnology.com>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
	David Francis <David.Francis@amd.com>,
	Aaron Liu <aaron.liu@amd.com>,
	Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
	Vinod Polimera <quic_vpolimer@quicinc.com>,
	linux-rockchip@lists.infradead.org, Fangzhi Zuo <jerry.zuo@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
	Ben Skeggs <bskeggs@redhat.com>,
	Jouni =?utf-8?B?SMO2Z2FuZGVy?= <jouni.hogander@intel.com>,
	Dave Airlie <airlied@redhat.com>, linux-mips@vger.kernel.org,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Gurchetan Singh <gurchetansingh@chromium.org>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-arm-msm@vger.kernel.org,
	Animesh Manna <animesh.manna@intel.com>,
	linux-renesas-soc@vger.kernel.org,
	Maxime Ripard <mripard@kernel.org>,
	Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	linux-amlogic@lists.infradead.org, Evan Quan <evan.quan@amd.com>,
	Michal Simek <michal.simek@amd.com>,
	linux-arm-kernel@lists.infradead.org, Sean Paul <sean@poorly.run>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Qingqing Zhuo <qingqing.zhuo@amd.com>,
	Sandy Huang <hjc@rock-chips.com>,
	Swati Sharma <swati2.sharma@intel.com>,
	John Stultz <jstultz@google.com>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Drew Davenport <ddavenport@chromium.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>,
	Haneen Mohammed <hamohammed.sa@gmail.com>,
	Anusha Srivatsa <anusha.srivatsa@intel.com>,
	Dan Carpenter <error27@gmail.com>,
	Karol Herbst <kherbst@redhat.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	linux-hyperv@vger.kernel.org, Stefan Agner <stefan@agner.ch>,
	Melissa Wen <melissa.srw@gmail.com>,
	=?utf-8?B?TWHDrXJh?= Canal <mairacanal@riseup.net>,
	Luca Coelho <luciano.coelho@intel.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Likun Gao <Likun.Gao@amd.com>, Sam Ravnborg <sam@ravnborg.org>,
	Alain Volmat <alain.volmat@foss.st.com>,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Deepak Rawat <drawat.floss@gmail.com>, Chen-Yu Tsai <wens@csie.org>,
	Joel Stanley <joel@jms.id.au>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
	Harry Wentland <harry.wentland@amd.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Alan Liu <haoping.liu@amd.com>, Philip Yang <Philip.Yang@amd.com>,
	Lyude Paul <lyude@redhat.com>, intel-gfx@lists.freedesktop.org,
	Alison Wang <alison.wang@nxp.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Gustavo Sousa <gustavo.sousa@intel.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Mikko Perttunen <mperttunen@nvidia.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
	Tomi Valkeinen <tomba@kernel.org>, Deepak R Varma <drv@mailo.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>, Chia-I Wu <olvaffe@gmail.com>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Tian Tao <tiantao6@hisilicon.com>, Shawn Guo <shawnguo@kernel.org>,
	Christian =?utf-8?B?S8O2bmln?= <christian.koenig@amd.com>,
	Khaled Almahallawy <khaled.almahallawy@intel.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	Emma Anholt <emma@anholt.net>,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Imre Deak <imre.deak@intel.com>, Liviu Dudau <liviu.dudau@arm.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Roman Li <roman.li@amd.com>, Paul Cercueil <paul@crapouillou.net>,
	Rob Clark <robdclark@gmail.com>,
	Hamza Mahfooz <hamza.mahfooz@amd.com>,
	David Airlie <airlied@gmail.com>, Marek Vasut <marex@denx.de>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	xen-devel@lists.xenproject.org, Guchun Chen <guchun.chen@amd.com>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
	Russell King <linux@armlinux.org.uk>,
	Jani Nikula <jani.nikula@intel.com>,
	Uma Shankar <uma.shankar@intel.com>,
	Mika Kahola <mika.kahola@intel.com>,
	Jiasheng Jiang <jiasheng@iscas.ac.cn>,
	Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Vinod Govindapillai <vinod.govindapillai@intel.com>,
	linux-tegra@vger.kernel.org,
	Marek =?utf-8?B?T2zFocOhaw==?= <marek.olsak@amd.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	=?utf-8?Q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= <samsagax@gmail.com>,
	Melissa Wen <mwen@igalia.com>, Hans de Goede <hdegoede@redhat.com>,
	linux-mediatek@lists.infradead.org,
	Fabio Estevam <festevam@gmail.com>,
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	David Tadokoro <davidbtadokoro@usp.br>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
	Orson Zhai <orsonzhai@gmail.com>, amd-gfx@lists.freedesktop.org,
	Jyri Sarha <jyri.sarha@iki.fi>,
	Yannick Fertre <yannick.fertre@foss.st.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Philippe Cornu <philippe.cornu@foss.st.com>,
	Daniel Vetter <daniel@ffwll.ch>, Wayne Lin <Wayne.Lin@amd.com>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Nirmoy Das <nirmoy.das@intel.com>, Lang Yu <Lang.Yu@amd.com>,
	Lucas Stach <l.stach@pengutronix.de>
Subject: Re: [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to
 drm_dev
Message-ID: <20230713100339.a3ve3ixhuwqyrp4d@pengutronix.de>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com>
 <20230712161025.22op3gtzgujrhytb@pengutronix.de>
 <CAMuHMdWuvkxcj05OTfEn5f2p-6e71QEHVjSLWwNFRnR_=WEJVQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="r55rq6gusfloss7g"
Content-Disposition: inline
In-Reply-To: <CAMuHMdWuvkxcj05OTfEn5f2p-6e71QEHVjSLWwNFRnR_=WEJVQ@mail.gmail.com>
X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2
X-SA-Exim-Mail-From: ukl@pengutronix.de
X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false
X-PTX-Original-Recipient: xen-devel@lists.xenproject.org


--r55rq6gusfloss7g
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 13, 2023 at 08:52:12AM +0200, Geert Uytterhoeven wrote:
> Hi Uwe,
>=20
> Let's add some fuel to keep the thread alive ;-)
>=20
> On Wed, Jul 12, 2023 at 6:13=E2=80=AFPM Uwe Kleine-K=C3=B6nig
> <u.kleine-koenig@pengutronix.de> wrote:
> > On Wed, Jul 12, 2023 at 05:34:28PM +0300, Jani Nikula wrote:
> > > I think this is an unnecessary change. In drm, a dev is usually a drm
> > > device, i.e. struct drm_device *.
> >
> > Well, unless it's not. Prominently there is
> >
> >         struct drm_device {
> >                 ...
> >                 struct device *dev;
> >                 ...
> >         };
> >
> > which yields quite a few code locations using dev->dev which is
> > IMHO unnecessary irritating:
> >
> >         $ git grep '\<dev->dev' v6.5-rc1 drivers/gpu/drm | wc -l
> >         1633
>=20
> I find that irritating as well...
>=20
> Same for e.g. crtc->crtc.
>=20
> Hence that's why I had sent patches to rename the base members in the
> shmob_drm-specific subclasses of drm_{crtc,connector,plane} to "base".
> https://lore.kernel.org/dri-devel/b3daca80f82625ba14e3aeaf2fca6dcefa056e4=
7.1687423204.git.geert+renesas@glider.be
>=20
> > Also the functions that deal with both a struct device and a struct
> > drm_device often use "dev" for the struct device and then "ddev" for
> > the drm_device (see for example amdgpu_device_get_pcie_replay_count()).
>=20
> I guess you considered "drm_dev", because it is still a short name?

I considered drm_dev because it is still moderately short and a good
approximation of "drm_device". Other than that the main driving force to
pick "drm_dev" was that it's unique enough that I could have done
s/\<drm_dev\>/$nameofchoice/ on the initial patch and get it mostly
right.

> Code dealing with platform devices usually uses "pdev" and "dev".
> Same for PCI drivers (despite "pci_dev" being a short name).

pci_dev and platform_device both typlically using pdev already annoyed
me in the past. However less than drm_device *dev because for pci_dev +
platform_device there is little overlap.

> So my personal preference goes to "ddev".

I sticked to "drm" for the new series. I think this provides less fuel.

Best regards and thanks for your thoughts,
Uwe

--=20
Pengutronix e.K.                           | Uwe Kleine-K=C3=B6nig         =
   |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

--r55rq6gusfloss7g
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmSvy/oACgkQj4D7WH0S
/k4Sjgf/S9rhd9EUi1FPWVc+CvaTZE8MfgLnoSUtdUSBBTwMois7UyHR7Le2pcT8
nnC4R7NI8fo5mVcNuPc8tU8wwm/qtM6iRRfrPkx4mefnVwh+eg5AnkzNGDgo7IGq
s6wGtKn7VWysrV1LV+fCgmL1Tb/CIkawX8hIvgpLnuXpyeQP4HrYFNu6i1evGJ5/
mQiWx6HCN+8HpAIFOwC0TIleVN/MxUZKW0cKcl9jWdRO+HYz6yRJtaipU6I3v4CN
foFppbbIUOpFDstiqGWJm9Bh5dt/o3gF8kS90ZvOVqCZuHFC+lPLX3kcXIDhos1Y
LuJHug8FRIi/8Js5JUXPzf5Melun0g==
=EIdq
-----END PGP SIGNATURE-----

--r55rq6gusfloss7g--


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 10:48:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 10:48:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563092.880068 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJts1-0000oY-If; Thu, 13 Jul 2023 10:48:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563092.880068; Thu, 13 Jul 2023 10:48:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJts1-0000oR-Fm; Thu, 13 Jul 2023 10:48:25 +0000
Received: by outflank-mailman (input) for mailman id 563092;
 Thu, 13 Jul 2023 10:48:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0yHZ=C7=amd.com=Xenia.Ragiadakou@srs-se1.protection.inumbo.net>)
 id 1qJtrz-0000oL-Qq
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 10:48:24 +0000
Received: from NAM12-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam12on20612.outbound.protection.outlook.com
 [2a01:111:f400:fe5a::612])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c84fea2a-216a-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 12:48:21 +0200 (CEST)
Received: from DM5PR08CA0057.namprd08.prod.outlook.com (2603:10b6:4:60::46) by
 CY5PR12MB6432.namprd12.prod.outlook.com (2603:10b6:930:38::8) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.20; Thu, 13 Jul 2023 10:48:17 +0000
Received: from DM6NAM11FT050.eop-nam11.prod.protection.outlook.com
 (2603:10b6:4:60:cafe::a3) by DM5PR08CA0057.outlook.office365.com
 (2603:10b6:4:60::46) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32 via Frontend
 Transport; Thu, 13 Jul 2023 10:48:17 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 DM6NAM11FT050.mail.protection.outlook.com (10.13.173.111) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.20 via Frontend Transport; Thu, 13 Jul 2023 10:48:17 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 13 Jul
 2023 05:48:16 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 13 Jul
 2023 05:48:16 -0500
Received: from 10.0.2.15 (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Thu, 13 Jul 2023 05:48:14 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c84fea2a-216a-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=WAyXxHTvSdqzH3BpepE0v7KHbb5IeAAm+Gfk8tEtBCCvBPuk1S4rLNaGDYbad3B7ZqggGGnLbcwlKI47esxc5xRZFniEAfR+OmqoWgyARwWJV48dpXM3DMW7mcRKOTKIKBGbJe7ZWcv8Z+QFSGnAEo46LPHcSF7CiMv+d5aiK3XEiRaIeG44Q2Tw7wjpzdypDREh3SfzGsJ39Kinc6zNBaYhRaX/iku5/Mh+CPycuYY1zddUfm5CcWg7fPafPriB9Og0sArAK8iQpyNb1k7NizMkzpPZ+7Do5EJoNKD2XFuUUw/GaKPqf/0PvJXaR82ycz6tjiMU4O6YZYAZDRSmtg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=JYJ17GsHkvf3wzt1JRROVoT4+2yfsQVmFXOSjlfBPiM=;
 b=aog1K4YF/xyIbgR9DwskjEM7XnG0vfcvplVFUn3Wrik2SzLP7syjz5uZLYIaalvVKZviUSwjSruduWRcW7Jl7Haj0pI8aV44rey/jZTNR9XNtU04l9BcHEQ9ZREu+Jl1x23E0QEVhdt6NwxcEJjsjCUScl3mkiHU/nB1Z/lavJ9Ef7JpHYcy4/v/KOaxps2gJVcB5rkl7sDKCUmHes5pi76eiOIgQ9GHh/eIweeCy9L4fDngu+CUmUflFssBou/DEKPzqFqdBWs8L+i45BNIdGhBaK5RmzenFzByBvwtDrC5LBzqeHBhsupZbMZAUNVHjOZ9IO654LiWIqtJXGF8LA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=JYJ17GsHkvf3wzt1JRROVoT4+2yfsQVmFXOSjlfBPiM=;
 b=aWbZB5YgnL1IRzWEGp7XaNyc8pr0hZHwb6wM3DXiCJWddthPJwrSjzZWuUDpYpHbNe081mjx5334xifux9B0NfEytofRjQPZzQBOEqahpcGCQ2FmQeD8BOTdgB7TCIDkj+VEGYA+Ztllm6lrSd5Qs+nm7Kku3K2MzNvGiu875ME=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Xenia Ragiadakou <xenia.ragiadakou@amd.com>
To: <devel@edk2.groups.io>
CC: Xenia Ragiadakou <xenia.ragiadakou@amd.com>, Ard Biesheuvel
	<ardb+tianocore@kernel.org>, Jiewen Yao <jiewen.yao@intel.com>, Jordan Justen
	<jordan.l.justen@intel.com>, Gerd Hoffmann <kraxel@redhat.com>, "Anthony
 Perard" <anthony.perard@citrix.com>, Julien Grall <julien@xen.org>,
	<xen-devel@lists.xenproject.org>
Subject: [PATCH] OvmfPkg/OvmfXen: Fix S3
Date: Thu, 13 Jul 2023 13:47:12 +0300
Message-ID: <c79e568e0d1c85bef9a2efc4c854de8f80ea1487.1689244868.git.xenia.ragiadakou@amd.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DM6NAM11FT050:EE_|CY5PR12MB6432:EE_
X-MS-Office365-Filtering-Correlation-Id: 1f4bc75a-0e66-4e36-4d84-08db838eaaa2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	x5K9rcAeMqL33oug1dkj/87yvNCmnA3SLr4+mhtkujkITsdUWiIFCxohXMPSTmzDAACgt9YGpGuom5i/ExWNPyRkucbnqXaK1AZ5W7xytv+s4wsaUO90wyGhhtU7Ia5CJ7zAtq7KcEHvye35sHY31DxOmQvxYgXKSWLFBcxDsshFZwnJRCyVR+giFDppKD79sPi96kNZM8ufEXb6hJD579TPAF+PsQIX5lpAeeZB3To3wpV3YlMQWR3fCC/30Jrob1a0QwIdQ/FYYL/RsHoho8ZZpHtjvVY4+q60KURIudoA5+c6Musg3nAs6BCTR1ycQU313tv2bymZ9tQURQbqs1223sP4JnABLjX5LYNR6INltbRYnSpJKHIbvm61af4xzBBACOzJPpUDVpPWsHo7TTQHPsJbJ0HaFxbrFWPKinS073RG8jMO6m61vo8sry6ebL1n0uwNkaYzEAExD1C6XM+uW/qm9+lcrqNWH1g5CBbfBiomtQHpfVybJ4KD8NQoe6qQucJ0ty0kCyJJ3mH+naoSdxsQ6K4iochW1olCHt/VbJs9oorMJnaceqS+qQgLLyFr4xjRsjohARBsVGM/B+PQ7zlatzlYpC9prUGjYucB/kl4NIKERKgcO5KSLx5sf2tpQsna6gQJLRbh+CicBqtvEWG4xmTqhjZOR3IxvksNaf0Pxig0RiTgPUMhP4rtC6qizddPsRzIswqWq2lGdkDqH8g2r1uqWLJlqLh1s4itbi8OjFlDX+3cLddcmfPXjflA45j9Vdpmpsy5IxIotw==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(346002)(39860400002)(136003)(451199021)(36840700001)(46966006)(40470700004)(478600001)(47076005)(83380400001)(86362001)(81166007)(70586007)(70206006)(6916009)(4326008)(16576012)(82740400003)(356005)(26005)(186003)(336012)(36860700001)(19627235002)(54906003)(2616005)(426003)(5660300002)(44832011)(8676002)(8936002)(40460700003)(316002)(2906002)(41300700001)(40480700001)(36756003)(82310400005)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 10:48:17.3634
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 1f4bc75a-0e66-4e36-4d84-08db838eaaa2
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DM6NAM11FT050.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6432

Currently, resuming an S3 suspended guest results in the following
assertion failure:
ASSERT MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.c=
(41): MemoryLength > 0
This happens because some parts of the S3 suspend and resume paths
are missing in order for S3 to work. For instance, the variables
mS3AcpiReservedMemoryBase and mS3AcpiReservedMemoryBase are not
initialized, regions that are used on S3 resume are either missing
or not marked as ACPI NVS memory and can be corrupted by the OS.
This patch adds the missing parts based heavily on the existing S3
implementation of other virtual platforms.

For S3 support, the provision of fw_cfg is required in order for
suspend states to be retrieved.

Another issue noticed is that when CalibrateLapicTimer() is called
on S3 resume path, the shared info page is remapped to a different
guest physical address. This remapping happens under guest's feet,
so any subsequent attempt of the guest to access the shared info
page results in nested page faults. This patch removes any local
APIC timer initializion and calibration from S3 resume path.

Signed-off-by: Xenia Ragiadakou <xenia.ragiadakou@amd.com>
---
 OvmfPkg/XenPlatformPei/Fv.c               |  2 +-
 OvmfPkg/XenPlatformPei/MemDetect.c        | 60 ++++++++++++++++++++++-
 OvmfPkg/XenPlatformPei/Platform.c         | 11 ++++-
 OvmfPkg/XenPlatformPei/Platform.h         |  2 +
 OvmfPkg/XenPlatformPei/XenPlatformPei.inf |  7 +++
 5 files changed, 78 insertions(+), 4 deletions(-)

diff --git a/OvmfPkg/XenPlatformPei/Fv.c b/OvmfPkg/XenPlatformPei/Fv.c
index 871a2c1c5b..37ecb3cfee 100644
--- a/OvmfPkg/XenPlatformPei/Fv.c
+++ b/OvmfPkg/XenPlatformPei/Fv.c
@@ -37,7 +37,7 @@ PeiFvInitialization (
   BuildMemoryAllocationHob (=0D
     PcdGet32 (PcdOvmfPeiMemFvBase),=0D
     PcdGet32 (PcdOvmfPeiMemFvSize),=0D
-    EfiBootServicesData=0D
+    mS3Supported ? EfiACPIMemoryNVS : EfiBootServicesData=0D
     );=0D
 =0D
   //=0D
diff --git a/OvmfPkg/XenPlatformPei/MemDetect.c b/OvmfPkg/XenPlatformPei/Me=
mDetect.c
index e552e7a55e..1724a4988f 100644
--- a/OvmfPkg/XenPlatformPei/MemDetect.c
+++ b/OvmfPkg/XenPlatformPei/MemDetect.c
@@ -283,6 +283,19 @@ PublishPeiMemory (
 =0D
   LowerMemorySize =3D GetSystemMemorySizeBelow4gb ();=0D
 =0D
+  //=0D
+  // If S3 is supported, then the S3 permanent PEI memory is placed next,=
=0D
+  // downwards. Its size is primarily dictated by CpuMpPei. The formula be=
low=0D
+  // is an approximation.=0D
+  //=0D
+  if (mS3Supported) {=0D
+    mS3AcpiReservedMemorySize =3D SIZE_512KB +=0D
+                                PcdGet32 (PcdCpuMaxLogicalProcessorNumber)=
 *=0D
+                                PcdGet32 (PcdCpuApStackSize);=0D
+    mS3AcpiReservedMemoryBase =3D LowerMemorySize - mS3AcpiReservedMemoryS=
ize;=0D
+    LowerMemorySize           =3D mS3AcpiReservedMemoryBase;=0D
+  }=0D
+=0D
   if (mBootMode =3D=3D BOOT_ON_S3_RESUME) {=0D
     MemoryBase =3D mS3AcpiReservedMemoryBase;=0D
     MemorySize =3D mS3AcpiReservedMemorySize;=0D
@@ -328,6 +341,51 @@ InitializeRamRegions (
 {=0D
   XenPublishRamRegions ();=0D
 =0D
+  if (mS3Supported && (mBootMode !=3D BOOT_ON_S3_RESUME)) {=0D
+    //=0D
+    // This is the memory range that will be used for PEI on S3 resume=0D
+    //=0D
+    BuildMemoryAllocationHob (=0D
+      mS3AcpiReservedMemoryBase,=0D
+      mS3AcpiReservedMemorySize,=0D
+      EfiACPIMemoryNVS=0D
+      );=0D
+=0D
+    //=0D
+    // Cover the initial RAM area used as stack and temporary PEI heap.=0D
+    //=0D
+    // This is reserved as ACPI NVS so it can be used on S3 resume.=0D
+    //=0D
+    BuildMemoryAllocationHob (=0D
+      PcdGet32 (PcdOvmfSecPeiTempRamBase),=0D
+      PcdGet32 (PcdOvmfSecPeiTempRamSize),=0D
+      EfiACPIMemoryNVS=0D
+      );=0D
+=0D
+    //=0D
+    // SEC stores its table of GUIDed section handlers here.=0D
+    //=0D
+    BuildMemoryAllocationHob (=0D
+      PcdGet64 (PcdGuidedExtractHandlerTableAddress),=0D
+      PcdGet32 (PcdGuidedExtractHandlerTableSize),=0D
+      EfiACPIMemoryNVS=0D
+      );=0D
+=0D
+ #ifdef MDE_CPU_X64=0D
+    //=0D
+    // Reserve the initial page tables built by the reset vector code.=0D
+    //=0D
+    // Since this memory range will be used by the Reset Vector on S3=0D
+    // resume, it must be reserved as ACPI NVS.=0D
+    //=0D
+    BuildMemoryAllocationHob (=0D
+      (EFI_PHYSICAL_ADDRESS)(UINTN)PcdGet32 (PcdOvmfSecPageTablesBase),=0D
+      (UINT64)(UINTN)PcdGet32 (PcdOvmfSecPageTablesSize),=0D
+      EfiACPIMemoryNVS=0D
+      );=0D
+ #endif=0D
+  }=0D
+=0D
   if (mBootMode !=3D BOOT_ON_S3_RESUME) {=0D
     //=0D
     // Reserve the lock box storage area=0D
@@ -346,7 +404,7 @@ InitializeRamRegions (
     BuildMemoryAllocationHob (=0D
       (EFI_PHYSICAL_ADDRESS)(UINTN)PcdGet32 (PcdOvmfLockBoxStorageBase),=0D
       (UINT64)(UINTN)PcdGet32 (PcdOvmfLockBoxStorageSize),=0D
-      EfiBootServicesData=0D
+      mS3Supported ? EfiACPIMemoryNVS : EfiBootServicesData=0D
       );=0D
   }=0D
 }=0D
diff --git a/OvmfPkg/XenPlatformPei/Platform.c b/OvmfPkg/XenPlatformPei/Pla=
tform.c
index c3fdf3d0b8..1b074cff33 100644
--- a/OvmfPkg/XenPlatformPei/Platform.c
+++ b/OvmfPkg/XenPlatformPei/Platform.c
@@ -60,6 +60,8 @@ UINT16  mHostBridgeDevId;
 =0D
 EFI_BOOT_MODE  mBootMode =3D BOOT_WITH_FULL_CONFIGURATION;=0D
 =0D
+BOOLEAN  mS3Supported =3D FALSE;=0D
+=0D
 VOID=0D
 AddIoMemoryBaseSizeHob (=0D
   EFI_PHYSICAL_ADDRESS  MemoryBase,=0D
@@ -350,6 +352,11 @@ BootModeInitialization (
 =0D
   if (CmosRead8 (0xF) =3D=3D 0xFE) {=0D
     mBootMode =3D BOOT_ON_S3_RESUME;=0D
+    if (!mS3Supported) {=0D
+      DEBUG ((DEBUG_ERROR, "ERROR: S3 not supported\n"));=0D
+      ASSERT (FALSE);=0D
+      CpuDeadLoop ();=0D
+    }=0D
   }=0D
 =0D
   CmosWrite8 (0xF, 0x00);=0D
@@ -463,6 +470,7 @@ InitializeXenPlatform (
   //=0D
   if (QemuFwCfgS3Enabled ()) {=0D
     DEBUG ((DEBUG_INFO, "S3 support was detected on QEMU\n"));=0D
+    mS3Supported =3D TRUE;=0D
     Status =3D PcdSetBoolS (PcdAcpiS3Enable, TRUE);=0D
     ASSERT_EFI_ERROR (Status);=0D
   }=0D
@@ -481,9 +489,8 @@ InitializeXenPlatform (
 =0D
   InitializeRamRegions ();=0D
 =0D
-  CalibrateLapicTimer ();=0D
-=0D
   if (mBootMode !=3D BOOT_ON_S3_RESUME) {=0D
+    CalibrateLapicTimer ();=0D
     ReserveEmuVariableNvStore ();=0D
     PeiFvInitialization ();=0D
     MemMapInitialization ();=0D
diff --git a/OvmfPkg/XenPlatformPei/Platform.h b/OvmfPkg/XenPlatformPei/Pla=
tform.h
index 7b4de128e7..fda66747cc 100644
--- a/OvmfPkg/XenPlatformPei/Platform.h
+++ b/OvmfPkg/XenPlatformPei/Platform.h
@@ -139,4 +139,6 @@ extern UINT8  mPhysMemAddressWidth;
 =0D
 extern UINT16  mHostBridgeDevId;=0D
 =0D
+extern BOOLEAN  mS3Supported;=0D
+=0D
 #endif // _PLATFORM_PEI_H_INCLUDED_=0D
diff --git a/OvmfPkg/XenPlatformPei/XenPlatformPei.inf b/OvmfPkg/XenPlatfor=
mPei/XenPlatformPei.inf
index 20c27ff34b..a359cf60ca 100644
--- a/OvmfPkg/XenPlatformPei/XenPlatformPei.inf
+++ b/OvmfPkg/XenPlatformPei/XenPlatformPei.inf
@@ -69,9 +69,13 @@
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize=0D
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase=0D
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize=0D
+  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase=0D
+  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize=0D
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase=0D
+  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesSize=0D
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageBase=0D
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageSize=0D
+  gUefiOvmfPkgTokenSpaceGuid.PcdGuidedExtractHandlerTableSize=0D
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId=0D
   gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase=0D
   gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize=0D
@@ -80,6 +84,7 @@
   gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base=0D
   gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size=0D
   gUefiOvmfPkgTokenSpaceGuid.PcdQ35TsegMbytes=0D
+  gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress=0D
   gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable=0D
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize=0D
   gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved=0D
@@ -89,6 +94,8 @@
   gEfiMdePkgTokenSpaceGuid.PcdFSBClock=0D
   gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy=0D
   gUefiCpuPkgTokenSpaceGuid.PcdCpuLocalApicBaseAddress=0D
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuApStackSize=0D
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber=0D
 =0D
   gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtr=0D
   gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtrSize=0D
--=20
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 13 11:30:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 11:30:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563102.880077 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJuW5-0005NK-Pp; Thu, 13 Jul 2023 11:29:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563102.880077; Thu, 13 Jul 2023 11:29:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJuW5-0005ND-NC; Thu, 13 Jul 2023 11:29:49 +0000
Received: by outflank-mailman (input) for mailman id 563102;
 Thu, 13 Jul 2023 11:29:48 +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
 <SRS0=8fBF=C7=citrix.com=prvs=5514777d4=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qJuW4-0005MS-3g
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 11:29:48 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9090ced7-2170-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 13:29:45 +0200 (CEST)
Received: from mail-bn8nam11lp2168.outbound.protection.outlook.com (HELO
 NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.168])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 13 Jul 2023 07:29:42 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by DS0PR03MB7289.namprd03.prod.outlook.com (2603:10b6:8:120::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.19; Thu, 13 Jul
 2023 11:29:40 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::e14d:fb6d:9e52:1524]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::e14d:fb6d:9e52:1524%4]) with mapi id 15.20.6588.024; Thu, 13 Jul 2023
 11:29:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9090ced7-2170-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689247785;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=LWZZBM7HeLS4oc/1CRaZGm4FijTun8EAKlPY/GC7Yn8=;
  b=a2HLp6fQQVWMFc9x5T6NqB8v8dK6Q1nIHUGdufL10L+4/HgbFmBGI8KA
   FCVgIhSt0yF6xThpPCEPrSqTKGRsAE28hwmScagoSzuyjE2/9RyIE9Fjp
   9nxKD16sSjxzfl7gHZOqfQ7qPqLwQNnYEnE6DlLKkBbD83qyF+M4iKXnF
   g=;
X-IronPort-RemoteIP: 104.47.58.168
X-IronPort-MID: 116109084
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:oHCuEaNBP0DQqffvrR2DlsFynXyQoLVcMsEvi/4bfWQNrUoi3zMPz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MsfGX
 6sqX2H2kyMiYDE9iPh
X-Talos-CUID: 9a23:OHFKsm6+wWAQcEFYrdsszxMsRssnf3/kzFD+P0K6Blw1U7eXcArF
X-Talos-MUID: 9a23:Mln/GAZcAGU+CeBTvjvpoHJ+JudSu5uKExkjsrUJ4NONHHkl
X-IronPort-AV: E=Sophos;i="6.01,202,1684814400"; 
   d="scan'208";a="116109084"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=IGKGT0CPbEEgcKrtSR5HXCZRyYy/yMlmngXUTs+lPq55MN728DBHBp0yKkX9/k7Hi83/0LlF4NtdJRwlyCn1fqr2YoVt1Zd/QCEBig6BYFNPU2Z5s4/am+ksT70r40YMgBRZHds2kVJVKbAyk/y7ETvtmWWbcTK6zp0AleGrP8BCXAmfLGGTpkMsZIdazyCaB0+1yhYyWPVkW11SQlEKrdG30XQXQpnAM6VOInOtbMrisP9EJOG5fzwRKVAyb/HPGccDCP7GK7IbMXiDQ0y0jv1aldCEmOxZhpg37ZbhVGL/idHhXNJ08+6ETyoccGyWgwhFPx31NUBc4UdlVHyIsQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=hSS7ygLTprxq6xSYbXjCyWXIMAU+wteSYsFZ4WKt2Bc=;
 b=PGKygkJaefJJCNeALiHYtjGempr/5ZFbpfJIXRIaJo+Pra7MUXfXmXeWGfzPzyPu9ZFjEbb681Wz9aBHaiWqjoFtSN9wLedGhgfx6w0Uqc6WOFtqbonr0G5YCmXQ19ya31mOFkxDor0TgMszEg3Gv8kSuWaxvFReB+j2W7WdNHdSRacDpDjrVdrAvEsRrq52SRR0ly7pUhLkz+Q6Dg6RxanaXmip36naNjkRZ5TqHNwqxMDQhHFVZIdpJYAV3drwnaN7F1YGFuOmkpEu1hVauwrAj646QlzPX32VnNoZ0PrMIrnTSshhtzlqTjrcjEj90rO0+IO45uZsoLLekMEGeA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=hSS7ygLTprxq6xSYbXjCyWXIMAU+wteSYsFZ4WKt2Bc=;
 b=FQ6QMKLfDUQeeRgQkpcwSmU9VOJfNNFvAhq19CqsX+RG/NYyNLQLu188u81CCNUXg5peb2RPMTAxZdXpUtCcQVsJtIdVv1uX2Z3AIrDxHH13tsLMIqx2AJPl2BFRXrNLc4lQK9qea4nlVRc7lnHB9ir0vuL5iMXe8rYh+b2QvpY=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Thu, 13 Jul 2023 13:29:34 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] x86/ioapic: sanitize IO-APIC pins before enabling the
 local APIC
Message-ID: <ZK_gHltq-1se3fau@MacBook-Air-de-Roger.local>
References: <20230707095338.44244-1-roger.pau@citrix.com>
 <92d16012-ff9f-693b-07c6-d45fe07a00a0@suse.com>
 <ZKwZBQ_0Z2c7NJNL@MacBook-Air-de-Roger.local>
 <1f79491a-46f5-5293-e92f-0e2b0b3efb62@suse.com>
 <ZK1S1V71ZUIPjKqZ@MacBook-Air-de-Roger.local>
 <eb2e3b57-a423-cf52-0192-a344db33a58f@suse.com>
 <ZK6wcpHnh5OgHv4R@MacBook-Air-de-Roger.local>
 <d84482f4-8be6-e514-58a7-a529890c8feb@suse.com>
 <ZK7JwEhrB-70nlla@MacBook-Air-de-Roger.local>
 <6d0ed712-0807-33b6-1586-a0588086c3a7@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <6d0ed712-0807-33b6-1586-a0588086c3a7@suse.com>
X-ClientProxiedBy: LO4P302CA0039.GBRP302.PROD.OUTLOOK.COM
 (2603:10a6:600:317::12) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|DS0PR03MB7289:EE_
X-MS-Office365-Filtering-Correlation-Id: 6534b019-846b-411c-27b2-08db8394722b
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	DsCZwohCtLJyKTCkbCB0Bp+vVURcQspdiUuHDGS4JlyyeMR75N+1OAyr67ih7ss3tXom4Y06q8iOOgwuTdut61rOpt+3bfSEPtIdjfydOYQUBmbOfBJ3p6Mq4jsMhEj0nWORJwiBEcvH4f3OyvndrAbW60hNIOISTUU1WMPPDdlsFAo6uBlatjOfquLuU8DVj9NRJ8y08rqdIr/oPiRXMWP9QlNO115uC2YjQ7ypkheFwaCrT9DqJH8bEG+GxnmJosJYT7nxRaXTXTCxRmxZv2dumrBuAqIk0hra22LfsQ4cYsbLIBQ07OoNfFilVhMNAiCzeCBCIC8/qL/pn5bCnoIS1WhFJxPK5+8Qm0z3xsMkPtWozXgXTxxs623r9YnvLJAvAuOSXpNBNVnTEgXg1STc5ncjxBwO/U+YdsBJROgCVXw11cNM3sIYvf0fjzZICnsxmf71r0yjvzyk8KpFlJbkL0SvYwkzOeSfYxqeItuJQvDhdTOl5o5qjpHOSEv6Un0gLtfduUimBwBnO4n7gTNoccqWHtoxZ+LEV8nNPa6tRv2372A7QQ0qG5WapJHw
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(366004)(396003)(136003)(39860400002)(451199021)(86362001)(8936002)(5660300002)(8676002)(41300700001)(38100700002)(316002)(2906002)(66476007)(66556008)(4326008)(66946007)(6916009)(82960400001)(54906003)(83380400001)(6486002)(6666004)(478600001)(186003)(26005)(6506007)(85182001)(6512007)(53546011)(9686003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?OTd1eVArQjlDck5PVjM4bVZha1ljVjhSdmdJNW15QkxBRjBrME51MFlQNEdJ?=
 =?utf-8?B?bEJ2dlA2VndQMXpzSy9hYklLQVp4UHFRbkVuVkk5aXVjLzNmdUUyOS93M3JV?=
 =?utf-8?B?KzRZZS9ERXJ2c1g5K0pCYkZJUWxWdWcraWl6Q09WNWNITmZJblNiZkJxQStM?=
 =?utf-8?B?RUl6TEd1K0tFSldnKzhoalgxSWVnY20zOEw0MUxXTTNFVHkzcElRdmRBdHRS?=
 =?utf-8?B?UEtkVjE1eEg5bXlGelZrZXo4Y3ZkNU12T2ZXcFFsZXh1MVVER0hMcE9jN1Bl?=
 =?utf-8?B?RWE2NVNBc1hMdGhBQUVveWVyUGd2V1Rub1U0VHlmVVRXRzdMREVSdUFhOE9Y?=
 =?utf-8?B?Q0daeXRGS2ZwTjVaY3hUYVFFYjgvRjQ3bFdTc1d1OEpKazMxek5HQmxEdngx?=
 =?utf-8?B?MlJwV0RLQXhKUlpSSU91NUx3ejBJYU1TMHhna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pam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	rH2n+PGBiAlsD+D01PuC0LGN+wcwN1lpC+3GktHzxa/nWv+aj2ltvfG2GGyefpcJu3XkuxD3wB/ATo0SWjAXlVBdiwDpX5BkzkhIne+bPGHC2HF6wFFpfQ9emhUUt3v2PfWeETSLGwtfvRAEdRNPPHu+MK8n+aGoQ7u3kkg9+YFOYl6Ae5439mOPc3iT16Mf5MqhtZTX27YH7HAD88/PNG9aXiuGpqsseF1QKfECO5h94MJVq1BPWxYMgWOcwvV5kfPErvi+P13X+9nIE4F7Ffl6EoB9KB1+RV9XtEC7ANhTVc4i8VmaGiz/4AaU1Bg6MQyCXcjsLtJYhhj+RTTf8ECFu1yxI2yJSR4OhirLI+zgzFB5+7h6hZKCkVgOgQ3kb4aLAfVlcw+dz4Sdk42vrtCvt4/8/GzBxV2bNgGycR2OZN0ngeQHUOrIirVS1FHgvNJMCFpFiXkrrzyVfZZ/xqkm9DZxDAkJWaBp4XJoiVM1j+/Vg9xomQhlclGVX7YwO8JiWhdy9TVVRJL/UFsHYGWbylTSkFYX9wpMr85w2x+lL9qvFjS0ecD+oqlnbemOg+XCop3Pt9EEhjj2wsDlER//bMja65deRNmQBqJcsACrM6wRWyDum8AVGhUZtR30OAqPoIv570WWcIQIfvBFAn3MWJRFYxsf450VioZqjRX47K1DjWIuucIMdfwFYeXi38lR3dqxKn1SWs+PWmfVM9NNaMt+GzF4/+iG7e506KcyLjdJ1CIOBj6dEeEyilNGNXoBhCujwuyILsv+X7YgQQU44WrPQbEBcpXL5I4y0CJdL3DmEBIzs0yABwklvU8XF0OHzdyeNbYumruBqhoYLQ==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6534b019-846b-411c-27b2-08db8394722b
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 11:29:40.0113
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: QX62XClH5BkluTjk33CppTRxVXQlIH3VdxKyGV3wM3KTpVVumzr5ILGUONmZ1iFGoqpoRfFSekUAQ3JBknbSBw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR03MB7289

On Thu, Jul 13, 2023 at 09:49:14AM +0200, Jan Beulich wrote:
> On 12.07.2023 17:41, Roger Pau MonnÃ© wrote:
> > On Wed, Jul 12, 2023 at 04:50:34PM +0200, Jan Beulich wrote:
> >> Hmm. The question really is which of the changes we want to backport.
> >> That one should be first. While it's largely guesswork, I'd be more
> >> inclined to take the change that has less of an effect overall.
> > 
> > My views would be the other way around I think.  Current code already
> > has a comment to notice that IO-APIC pins might be wrongly unmasked,
> > and there's also logic for masking them when the IO-APICs are
> > initialized.  The fact that such logic is placed after the local APIC
> > has been initialized is IMO a bug, as having unmasked unconfigured
> > IO-APIC pins when the local APIC is enabled should be avoided.
> 
> Hmm, if you really meant this (and not setting up / unmasking of
> LVTERR), then your change would still be insufficient. We may enable
> the APIC for the BSP in init_bsp_APIC() (which is called quite a bit
> earlier), and the APIC may also have been enabled by firmware already,
> so I don't view this argument as fully convincing. (That said,
> init_bsp_APIC() calls clear_local_APIC(), so while the LAPIC may be
> enabled, errors would be reported only in ESR, not by delivering
> interrupts.)

Indeed.  I should mention the error vector explicitly, as it's not the
local APIC being enabled, but the error vector being setup which
causes the loop here.

> Which gets me back to another aspect of your scenario that I haven't
> fully understood: In the description you say that booting fails.
> Since we handle the errors, the implication is that the pin remains
> constantly active (thus triggering errors over and over again). Yet
> how would this not already cause problems ahead of smp_prepare_cpus()

Before smp_prepare_cpus() (and explicitly before setup_local_APIC())
the error vector is not setup (or that would be my expectation), so
errors are just reported on the ESR, but there's no vector injected.

> if the LAPIC was already enabled? Wouldn't we need to do part of
> clear_local_APIC() from init_bsp_APIC() before bailing from there
> when smp_found_config is set? ("Part of" because as per the comment
> at the top of init_bsp_APIC() we apparently would need to leave LVT0
> [and then perhaps also LVT1] unmasked.)

Right, if the APIC is already enabled by the firmware we do currently
rely on the error vector being masked.  OI think this is a reasonable
expectation, as handing being done with an unknown error vector
unmasked in the local APIC would be bad.  Even with the CPU running
with interrupts disabled we would get error vectors set in IRR.

> 
> >> That said I can see that Linux have their enable_IO_APIC() calls
> >> also ahead of setup_IO_APIC() (but after connect_bsp_APIC() and
> >> setup_local_APIC()). IOW with your change we'd do the masking yet
> >> earlier than them. This may of course even be advantageous, but
> >> there may also be good reasons for the sequence they're using.
> > 
> > Linux calls enable_IO_APIC() before setting up the local
> > APIC LVT Error vector (that's done in end_local_APIC_setup()).  That
> > logic seems to be introduced by commit:
> > 
> > 1c69524c2e5b x86: clear IO_APIC before enabing apic error vector.
> > 
> > Might it be less controversial to do like Linux does and call
> > enable_IO_APIC() before the local APIC ESR is setup?
> 
> You already do so, just that you do it yet earlier. I'm not
> convinced it needs doing from the middle of setup_local_APIC() (or,
> like nowaday's Linux has it, with ESR / LVTERR setup split to a
> separate function, and enable_IO_APIC() called between those two
> LAPIC related calls). You also disliked putting the call at the
> beginning of setup_local_APIC(), so putting it in the middle of it
> might be yet worse when taking that perspective. (Another downside
> of calling it from anywhere in setup_local_APIC() is that this
> would be another __init function called from a non-__init one. We
> have examples of such, and keying the call to "bsp" would leave it
> safe, but avoiding such calls when we easily can is probably a
> worthwhile secondary goal.)

Yes, it's not my preference to call it from setup_local_APIC(),
neither splitting the setup of LVTERR/ESR into a separate function.

> 
> Question is whether it can sensibly be moved at least a little
> later: verify_local_APIC() isn't of much use anyway, first and
> foremost because we ignore its return value. And connect_bsp_APIC()
> largely is concerned about leaving PIC mode. So maybe put the call
> immediately ahead of the setup_local_APIC(true) ones?

Strictly speaking for the issue I have at hand it needs to be done
ahead of setting up LVTERR/ESR.

> A further question is whether, considering that Linux continues to
> use that name, we wouldn't be better off not renaming the function.

Yes, I will leave the name alone, albeit it's IMO a bit misleading,
it's not actually enabling anything, but rather masking the pins and
figuring out the pin where the i8259 might be connected.

> One other thing I finally figured was confusing me in the
> description of the patch; re-quoting that paragraph here:
> 
> "Fix this by moving the masking of IO-APIC pins ahead of the enabling
>  of the local APIC.  Note that before doing such masking Xen attempts
>  to detect the pin where the legacy i8259 is connected, and that logic
>  relies on the pin being unmasked, hence the logic is also moved ahead
>  of enabling the local APIC."
> 
> The last sentence saying "also" is kind of odd with the first one
> already stating this very movement. To me it's therefore unclear what
> exactly the second sentence is intended to be telling me. I guess you
> want to express that together with the making the detection logic is
> also moved (i.e. the entire function is called earlier), but I'm
> afraid this isn't the only way to read that second sentence.

Yes, you are reading it as I was intending.  It's merely a logic that
the i8259 detection is also done slightly earlier, as it relies on the
RTE masking not being tampered with.

What about:

"Fix this by moving the masking of IO-APIC pins ahead of the enabling
 of the local APIC.  Note that before doing such masking Xen attempts
 to detect the pin where the legacy i8259 is connected, and that logic
 relies on the pin being unmasked, hence the logic is also moved ahead
 of enabling the local APIC."

"Move the masking of the IO-APIC pins ahead of the setup of the local
 APIC.  This has the side effect of also moving the detection of the
 pin where the i8259 is connected, as it must be done before masking
 any pins."

Is the aboce any better?  Would you rather prefer me to drop any
mention of the i8259 detection being moved? (as it's just a side
effect of moving the masking).

So to recap, I think we are in agreement that calling enable_IO_APIC()
just ahead of the call to setup_local_APIC() is the preferred
solution?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 11:36:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 11:36:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563106.880088 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJucS-0006rE-Gg; Thu, 13 Jul 2023 11:36:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563106.880088; Thu, 13 Jul 2023 11:36:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJucS-0006r7-Cr; Thu, 13 Jul 2023 11:36:24 +0000
Received: by outflank-mailman (input) for mailman id 563106;
 Thu, 13 Jul 2023 11:36:23 +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
 <SRS0=In0U=C7=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qJucQ-0006r1-VW
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 11:36:23 +0000
Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com
 [2a00:1450:4864:20::22c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7ce70dbf-2171-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 13:36:20 +0200 (CEST)
Received: by mail-lj1-x22c.google.com with SMTP id
 38308e7fff4ca-2b72161c6e9so23835311fa.0
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 04:36:20 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 y18-20020a2e9d52000000b002b6ce4c5942sm1460860ljj.136.2023.07.13.04.36.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 13 Jul 2023 04:36:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7ce70dbf-2171-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689248180; x=1691840180;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=mK4MLPKWVLYkpfkfFzUI5A+BhVNzw5VpqFWXh8yC4bc=;
        b=TzdRVGLCbej5m0XznMypK2fLnId02BFnaN3hyJdPHW00qR+3iIdClPwsCDqqRogmHS
         8KPRtlR2W65zP4LSoE7zynlDLGyW5JoOjSv7m18//Bimt6jLL9iqyZaDsyjvw54vKRW8
         W38ssGwHWRQI4KZJZn7iZ9jLuuL/XUSNhlAkgx42QtTb4bPW1kilprT5Xp3pZGPO31pU
         Jn6FhvbeG+9BGCy8E4Vl9cF9H+Yr3BwjfycaSBY8RyRnRM9Px2PBR9XMM9uE0YfYvBR0
         qfGff1Ikr2j9WVeZ/DNA5nF4wjDv9cngLa2hXAUngJqHyjSZ2GI2EIuJ50945LkW/jvL
         0yXA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689248180; x=1691840180;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=mK4MLPKWVLYkpfkfFzUI5A+BhVNzw5VpqFWXh8yC4bc=;
        b=hzYq7cDhWtIfG6q4KIBuOX0ooIECurSHt0TcIxlDwbs6Ey5o7zerb7LCavf4XXjzeb
         WMNSHQLRSD1sPp6OgWVH/4ZyR+PKqpJOgSbGPlvqjv0OK/Vgmv/YGBly8vEJJ12rRFIB
         b0n8jgqgpw50tKb8Jt33cSVHVcJkl2YV+NZC+6MdYxk1zfmE1Yp0bvRWGfV2BWFt9LVg
         EB9UqfgUOo1r0L5IfTSGTts4mhS7L8rwbC9hvS3YqRHv47R0o6mOSKihL6ERCBQLMTdG
         MiIVEqaTQNv3SEG6cAitK6HqqnYCZzYefZy6Jrl+2+1BEhh7JGx3CfbMdLDDDgmfqZoJ
         nHbA==
X-Gm-Message-State: ABy/qLaCrmg6sCQxNi3HLwRLbkzs9ke0TJj9fInfpVOrrue2jbf5NyyZ
	FfPByW7iRQOjEXwxjd7EQBM=
X-Google-Smtp-Source: APBJJlFQ+3bcJhJStjD96SaY8avz4ZSbsjizZRxdyvAauFRUqDZBJMIe/fmpaW3Y47MgJDjkCG8jQw==
X-Received: by 2002:a2e:9acb:0:b0:2b5:8b02:1000 with SMTP id p11-20020a2e9acb000000b002b58b021000mr741520ljj.8.1689248179810;
        Thu, 13 Jul 2023 04:36:19 -0700 (PDT)
Message-ID: <655feb25d44516bbe954402156e3b26f41594eef.camel@gmail.com>
Subject: Re: [PATCH] ns1650: refactor interrupt handling in
 ns16550_uart_dt_init()
From: Oleksii <oleksii.kurochko@gmail.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap
 <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, Stefano
 Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
Date: Thu, 13 Jul 2023 14:36:18 +0300
In-Reply-To: <ca31c7aa-1879-a196-ace0-4418d8a5b0c9@xen.org>
References: 
	<cc5a08056abacdbb6d6509b56716eb45467307bb.1689240611.git.oleksii.kurochko@gmail.com>
	 <ca31c7aa-1879-a196-ace0-4418d8a5b0c9@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

Hi Julien,

On Thu, 2023-07-13 at 10:43 +0100, Julien Grall wrote:
> Hi Oleksii,
>=20
> Title: IMO, Your patch doesn't do any refactor. Instead, it add
> support=20
> for polling when using the DT.
Agree. It would be better to rephrase the title.

>=20
> On 13/07/2023 10:30, Oleksii Kurochko wrote:
> > In ns16550_init_postirq() there is the following check:
> > =C2=A0=C2=A0=C2=A0=C2=A0 if ( uart->irq > 0 )
> > =C2=A0=C2=A0=C2=A0=C2=A0 {
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uart->irqaction.handle=
r =3D ns16550_interrupt;
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uart->irqaction.name=
=C2=A0=C2=A0=C2=A0 =3D "ns16550";
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uart->irqaction.dev_id=
=C2=A0 =3D port;
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( (rc =3D setup_irq=
(uart->irq, 0, &uart->irqaction)) !=3D 0
> > )
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 printk("ERROR: Failed to allocate ns16550 IRQ %d\n",
> > uart->irq);
> > =C2=A0=C2=A0=C2=A0=C2=A0 }
> >=20
> > Thereby to have ns16550 work in polling mode uart->irq, should be
> > equal to 0.
> >=20
> > So it is needed to relax the following check in
> > ns16550_uart_dt_init():
> > =C2=A0=C2=A0=C2=A0=C2=A0 res =3D platform_get_irq(dev, 0);
> > =C2=A0=C2=A0=C2=A0=C2=A0 if ( ! res )
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -EINVAL;
> > =C2=A0=C2=A0=C2=A0=C2=A0 uart->irq =3D res;
> > If 'res' equals to -1 then polling mode should be used instead of
> > return
> > -EINVAL.
>=20
> This commit message has a bit too much code in it for me taste. I
> don't=20
> think it is necessary to quote the code. Instead, you can explain the
> following:
>=20
> =C2=A0 * Why you want to support polling
> =C2=A0 * Why this is valid to have a node without interrupts (add a
> reference=20
> to the bindings)
> =C2=A0 * That polling is indicated by using 'irq =3D 0'. I would consider=
 to
> provide a define (e.g NO_IRQ_POLL) to make it more clearer.
Thanks. I'll update the commit message.

>=20
> >=20
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> > ---
> > =C2=A0 xen/drivers/char/ns16550.c | 12 ++++++++++--
> > =C2=A0 1 file changed, 10 insertions(+), 2 deletions(-)
> >=20
> > diff --git a/xen/drivers/char/ns16550.c
> > b/xen/drivers/char/ns16550.c
> > index 2aed6ec707..f30f10d175 100644
> > --- a/xen/drivers/char/ns16550.c
> > +++ b/xen/drivers/char/ns16550.c
> > @@ -1791,8 +1791,16 @@ static int __init
> > ns16550_uart_dt_init(struct dt_device_node *dev,
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > =C2=A0=20
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 res =3D platform_get_irq(dev, 0);
> > -=C2=A0=C2=A0=C2=A0 if ( ! res )
> > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -EINVAL;
> > +=C2=A0=C2=A0=C2=A0 if ( res =3D=3D -1 )
>=20
> Why do you check explicitely for -1 instead of < 0? Also, the
> behavior=20
> is somewhat change now.
I checked it for -1 as I missed that platform_get_irq() returns 'int'
and uart->irq is also 'int'. 'irq' variable inside plaform_get_irq is
declared as 'unsigned int', so I thought that in case of 'interrupt'
property is processed successfully we will have some positive value
otherwise platform_get_irq() returns -1 ( in current implementation ).
So it would be better to check for " res < 0 ".

>  Before, we would return -EINVAL when res equals=20
> 0. Can you explain in the commit message why this is done?
This is not clear for me.
It was done during replacing of dt_device_get_irq by platform_get_irq
(=C2=A0https://gitlab.com/xen-project/xen/-/commit/554cbe32381fa4482e1a47cd=
31afb054e97d986d
) and for other similar cases it was changed to "res < 0" except
ns16550 driver.

>=20
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printk("ns1650: polling wil=
l be used\n");
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * There is the check =
'if ( uart->irq > 0 )' in
> > ns16550_init_postirq().
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * If the check is tru=
e then interrupt mode will be used
> > otherwise
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * ( when irq =3D 0 )p=
olling.
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */
>=20
> Similar remark to the commit message. You could write:
>=20
> "If the node doesn't have any interrupt, then it means the driver
> will=20
> want to using polling."
Thanks. I'll take into account.
>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 res =3D 0;
> > +=C2=A0=C2=A0=C2=A0 }
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uart->irq =3D res;
> > =C2=A0=20
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uart->dw_usr_bsy =3D dt_device_is_compat=
ible(dev, "snps,dw-apb-
> > uart");
>=20
> Cheers,
>=20

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Thu Jul 13 11:53:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 11:53:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563110.880097 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJusJ-0000uZ-R8; Thu, 13 Jul 2023 11:52:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563110.880097; Thu, 13 Jul 2023 11:52:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJusJ-0000uS-OZ; Thu, 13 Jul 2023 11:52:47 +0000
Received: by outflank-mailman (input) for mailman id 563110;
 Thu, 13 Jul 2023 11:52:46 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qJusI-0000uM-A3
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 11:52:46 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJusH-0007bf-AF; Thu, 13 Jul 2023 11:52:45 +0000
Received: from 54-240-197-236.amazon.com ([54.240.197.236]
 helo=[192.168.30.214]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJusH-000830-43; Thu, 13 Jul 2023 11:52:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=Y3j2Lw6S2foCTx4r1HLl3Qt1wV9zNF9uVf3jq+hcGvs=; b=IFSuOKtEC2wp2t+lNFREda8dmU
	QlB0i+lCrbvyPwnzdJjoKu2GHISg5hTMN83AGoN7MJcyNr/VepH3aBZpEUdpNgfi/81qfxn4Brcvs
	MyzQKd7p00IMHNfYebRnFDb8DIO8cMMM0A3iWSJ25RS3m8MTHkvVY8xeLLSELqYndKuw=;
Message-ID: <bf729e4d-3078-c247-d74b-5b25e523850e@xen.org>
Date: Thu, 13 Jul 2023 12:52:43 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH] ns1650: refactor interrupt handling in
 ns16550_uart_dt_init()
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>, xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
References: <cc5a08056abacdbb6d6509b56716eb45467307bb.1689240611.git.oleksii.kurochko@gmail.com>
 <ca31c7aa-1879-a196-ace0-4418d8a5b0c9@xen.org>
 <655feb25d44516bbe954402156e3b26f41594eef.camel@gmail.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <655feb25d44516bbe954402156e3b26f41594eef.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 13/07/2023 12:36, Oleksii wrote:
> On Thu, 2023-07-13 at 10:43 +0100, Julien Grall wrote:
>> Hi Oleksii,
>>
>> Title: IMO, Your patch doesn't do any refactor. Instead, it add
>> support
>> for polling when using the DT.
> Agree. It would be better to rephrase the title.
> 
>>
>> On 13/07/2023 10:30, Oleksii Kurochko wrote:
>>> In ns16550_init_postirq() there is the following check:
>>>  Â Â Â Â  if ( uart->irq > 0 )
>>>  Â Â Â Â  {
>>>  Â Â Â Â Â Â Â Â  uart->irqaction.handler = ns16550_interrupt;
>>>  Â Â Â Â Â Â Â Â  uart->irqaction.nameÂ Â Â  = "ns16550";
>>>  Â Â Â Â Â Â Â Â  uart->irqaction.dev_idÂ  = port;
>>>  Â Â Â Â Â Â Â Â  if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0
>>> )
>>>  Â Â Â Â Â Â Â Â Â Â Â Â  printk("ERROR: Failed to allocate ns16550 IRQ %d\n",
>>> uart->irq);
>>>  Â Â Â Â  }
>>>
>>> Thereby to have ns16550 work in polling mode uart->irq, should be
>>> equal to 0.
>>>
>>> So it is needed to relax the following check in
>>> ns16550_uart_dt_init():
>>>  Â Â Â Â  res = platform_get_irq(dev, 0);
>>>  Â Â Â Â  if ( ! res )
>>>  Â Â Â Â Â Â Â Â  return -EINVAL;
>>>  Â Â Â Â  uart->irq = res;
>>> If 'res' equals to -1 then polling mode should be used instead of
>>> return
>>> -EINVAL.
>>
>> This commit message has a bit too much code in it for me taste. I
>> don't
>> think it is necessary to quote the code. Instead, you can explain the
>> following:
>>
>>  Â  * Why you want to support polling
>>  Â  * Why this is valid to have a node without interrupts (add a
>> reference
>> to the bindings)
>>  Â  * That polling is indicated by using 'irq = 0'. I would consider to
>> provide a define (e.g NO_IRQ_POLL) to make it more clearer.
> Thanks. I'll update the commit message.
> 
>>
>>>
>>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>>> ---
>>>  Â  xen/drivers/char/ns16550.c | 12 ++++++++++--
>>>  Â  1 file changed, 10 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/xen/drivers/char/ns16550.c
>>> b/xen/drivers/char/ns16550.c
>>> index 2aed6ec707..f30f10d175 100644
>>> --- a/xen/drivers/char/ns16550.c
>>> +++ b/xen/drivers/char/ns16550.c
>>> @@ -1791,8 +1791,16 @@ static int __init
>>> ns16550_uart_dt_init(struct dt_device_node *dev,
>>>  Â Â Â Â Â  }
>>>    
>>>  Â Â Â Â Â  res = platform_get_irq(dev, 0);
>>> -Â Â Â  if ( ! res )
>>> -Â Â Â Â Â Â Â  return -EINVAL;
>>> +Â Â Â  if ( res == -1 )
>>
>> Why do you check explicitely for -1 instead of < 0? Also, the
>> behavior
>> is somewhat change now.
> I checked it for -1 as I missed that platform_get_irq() returns 'int'
> and uart->irq is also 'int'. 'irq' variable inside plaform_get_irq is
> declared as 'unsigned int', so I thought that in case of 'interrupt'
> property is processed successfully we will have some positive value
> otherwise platform_get_irq() returns -1 ( in current implementation ).
> So it would be better to check for " res < 0 ".
> 
>>   Before, we would return -EINVAL when res equals
>> 0. Can you explain in the commit message why this is done?
> This is not clear for me.
> It was done during replacing of dt_device_get_irq by platform_get_irq
> (Â https://gitlab.com/xen-project/xen/-/commit/554cbe32381fa4482e1a47cd31afb054e97d986d
> ) and for other similar cases it was changed to "res < 0" except
> ns16550 driver.

Hmmm... I think I made a mistake back then. This check should have been 
'res <= 0' because '0' is used for polling.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 11:55:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 11:55:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563115.880108 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJuuh-0001Xx-DN; Thu, 13 Jul 2023 11:55:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563115.880108; Thu, 13 Jul 2023 11:55:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJuuh-0001Xq-Ae; Thu, 13 Jul 2023 11:55:15 +0000
Received: by outflank-mailman (input) for mailman id 563115;
 Thu, 13 Jul 2023 11:55:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=In0U=C7=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qJuug-0001Xi-2Y
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 11:55:14 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1f97c036-2174-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 13:55:12 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-4fbf09a9139so1046278e87.2
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 04:55:12 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 g12-20020ac2538c000000b004fb763b5171sm1095616lfh.86.2023.07.13.04.55.10
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 13 Jul 2023 04:55:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1f97c036-2174-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689249312; x=1691841312;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=KqJrr5wNn+3DjoX50prgKwEUvsk9E+J5T8JR1LY8ZSs=;
        b=Zba0nH+X4Ap8k2PQWHN50c+pPZD5yBTwtctl7qhMjl1rtCAiCWBlJRcW8y6CtNsyxA
         VOBgweDlDxdvHK6LVGnNTawBYNmke4BU0DxlDxgKLSSWkL9y8iMtgfNQvJ+L+smT/FJ7
         WM0BuxFYsiQ5DZ0PbTDk388GTvikFaVdILp6pzP9V2zYxWfhGI7DaLWmKfP5npFEtvK3
         RgF7CxYUoEipfJj7dBgyERDQQ1BDgiw1ewGxTLKbsiPZLeb8Q5JDfZq9OoUjhU0pdVc1
         J0qAR2A4Pfh+SW1TVytsHGWi5JcAByWBMIiTIwvTXGRgUuf2vIW+IJvCApjvCcCR4qWU
         e+KA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689249312; x=1691841312;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=KqJrr5wNn+3DjoX50prgKwEUvsk9E+J5T8JR1LY8ZSs=;
        b=CMGz16QEfgzX4ATyOWaALgNKeGtgQUbcXqIiqX8/AB+JXdUnPTx7Vk/KpPsGqlrjxg
         PKH7VKvfuksz5ywc2D9YNqgs7H2oEFu6rrf0dJbXiKLrbqRGzXswxzoISc614t63BNrz
         ZZQ5oy5qe2hW+EbuBycU8t0HoJ6T2IiiCIPwDZayY/NthC8+RC6QdKujTSl9t42oGJR/
         ZCxTTEXsVbr3x+4onr+xOotx/Jl/60avKQyzHsL0W2nF2Wl4xZEvirfBVmh5CzygEtIx
         ggDaJm8wuMs0PGwAZb1W9QmHULKclIKZ20wyvkACRWVU277IemK+iDsKRWOeekQHXPjy
         KA9g==
X-Gm-Message-State: ABy/qLZ7RSNVCRbuxpDnsgremUrdHa7LzZ8j57QFsFUSB0YTHzPmWQBA
	0yzL6fPV5RzwYZfnEmnRIDY=
X-Google-Smtp-Source: APBJJlG0VWCheMT3j1XBg8hYwZCLainrwq1e72jxJxm1IOxfhLD9T52wkIeUXXqWCU7peEPnO06gEw==
X-Received: by 2002:a05:6512:4002:b0:4fb:7c40:9f97 with SMTP id br2-20020a056512400200b004fb7c409f97mr1269868lfb.27.1689249311799;
        Thu, 13 Jul 2023 04:55:11 -0700 (PDT)
Message-ID: <27c323353ffd231f778b48b1cf6bca8560c7734a.camel@gmail.com>
Subject: Re: [PATCH] ns1650: refactor interrupt handling in
 ns16550_uart_dt_init()
From: Oleksii <oleksii.kurochko@gmail.com>
To: Julien Grall <julien@xen.org>, Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap
 <george.dunlap@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
Date: Thu, 13 Jul 2023 14:55:10 +0300
In-Reply-To: <d05c5fb0-63ab-4368-ed3b-bb06b242808a@xen.org>
References: 
	<cc5a08056abacdbb6d6509b56716eb45467307bb.1689240611.git.oleksii.kurochko@gmail.com>
	 <a385a17b-a60c-d770-e044-af64273371d6@suse.com>
	 <d05c5fb0-63ab-4368-ed3b-bb06b242808a@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Thu, 2023-07-13 at 11:13 +0100, Julien Grall wrote:
> Hi Jan,
>=20
> On 13/07/2023 11:08, Jan Beulich wrote:
> > On 13.07.2023 11:30, Oleksii Kurochko wrote:
> > > --- a/xen/drivers/char/ns16550.c
> > > +++ b/xen/drivers/char/ns16550.c
> > > @@ -1791,8 +1791,16 @@ static int __init
> > > ns16550_uart_dt_init(struct dt_device_node *dev,
> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > > =C2=A0=20
> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 res =3D platform_get_irq(dev, 0);
> > > -=C2=A0=C2=A0=C2=A0 if ( ! res )
> > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -EINVAL;
> > > +=C2=A0=C2=A0=C2=A0 if ( res =3D=3D -1 )
> > > +=C2=A0=C2=A0=C2=A0 {
> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printk("ns1650: polling w=
ill be used\n");
> >=20
> > Nit: Please don't omit one of the two 5-s here.
> >=20
> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /*
> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * There is the chec=
k 'if ( uart->irq > 0 )' in
> > > ns16550_init_postirq().
> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * If the check is t=
rue then interrupt mode will be used
> > > otherwise
> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * ( when irq =3D 0 =
)polling.
> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */
> >=20
> > I wonder in how far that's actually correct outside of x86. On x86
> > IRQ0 is
> > always the timer interrupt, but I'm not convinced something similar
> > can be
> > used as kind of a heuristic on Arm, RISC-V, or basically any other
> > architecture.
>=20
> I wondered the same. On Arm we are fine because the UART will be an
> SPI=20
> which starts at 32.
>=20
> That's part why I was suggesting to use a define. Because we don't
> have=20
> to hardcode the poll value everywhere.
Probably then it would be better to introduce 'bool is_polling_mode'
inside struct ns16550?

The same thing ( with uart->irq =3D 0 ) is used for detecting if polling
mode should be used in case of x86 and PCI:
https://gitlab.com/xen-project/xen/-/blame/staging/xen/drivers/char/ns16550=
.c?page=3D2#L1332

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 11:57:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 11:57:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563118.880118 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJuxC-0002AF-Pu; Thu, 13 Jul 2023 11:57:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563118.880118; Thu, 13 Jul 2023 11:57:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJuxC-0002A8-NK; Thu, 13 Jul 2023 11:57:50 +0000
Received: by outflank-mailman (input) for mailman id 563118;
 Thu, 13 Jul 2023 11:57:49 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qJuxB-0002A0-PN
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 11:57:49 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJux9-0007i4-8C; Thu, 13 Jul 2023 11:57:47 +0000
Received: from 54-240-197-236.amazon.com ([54.240.197.236]
 helo=[192.168.30.214]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qJux9-0008Je-2X; Thu, 13 Jul 2023 11:57:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=Uh6TFhOJ/u/QHYVOBICtcvOXTt06PmVU+nYj7Ur9eQk=; b=1oVOcxUVnJRvZsqyPsXKe1Dunp
	gZORyDkiZtNr5Xv4Z2II5pDBVntRV7FpCXcHl+JQ289n91r1FhjPdU+YyudVMugNyxm3irXb4iJTs
	9cwGfo/n3YVSLXYSC4oaHWzgO5eObyd7lOZzcaYqMNXxWC6MzvwbGybvK4J8OOhavPjk=;
Message-ID: <52c836d7-3e63-d577-754a-6bec029033d6@xen.org>
Date: Thu, 13 Jul 2023 12:57:45 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH] ns1650: refactor interrupt handling in
 ns16550_uart_dt_init()
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>, Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <cc5a08056abacdbb6d6509b56716eb45467307bb.1689240611.git.oleksii.kurochko@gmail.com>
 <a385a17b-a60c-d770-e044-af64273371d6@suse.com>
 <d05c5fb0-63ab-4368-ed3b-bb06b242808a@xen.org>
 <27c323353ffd231f778b48b1cf6bca8560c7734a.camel@gmail.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <27c323353ffd231f778b48b1cf6bca8560c7734a.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 13/07/2023 12:55, Oleksii wrote:
> On Thu, 2023-07-13 at 11:13 +0100, Julien Grall wrote:
>> Hi Jan,
>>
>> On 13/07/2023 11:08, Jan Beulich wrote:
>>> On 13.07.2023 11:30, Oleksii Kurochko wrote:
>>>> --- a/xen/drivers/char/ns16550.c
>>>> +++ b/xen/drivers/char/ns16550.c
>>>> @@ -1791,8 +1791,16 @@ static int __init
>>>> ns16550_uart_dt_init(struct dt_device_node *dev,
>>>>  Â Â Â Â Â  }
>>>>    
>>>>  Â Â Â Â Â  res = platform_get_irq(dev, 0);
>>>> -Â Â Â  if ( ! res )
>>>> -Â Â Â Â Â Â Â  return -EINVAL;
>>>> +Â Â Â  if ( res == -1 )
>>>> +Â Â Â  {
>>>> +Â Â Â Â Â Â Â  printk("ns1650: polling will be used\n");
>>>
>>> Nit: Please don't omit one of the two 5-s here.
>>>
>>>> +Â Â Â Â Â Â Â  /*
>>>> +Â Â Â Â Â Â Â Â  * There is the check 'if ( uart->irq > 0 )' in
>>>> ns16550_init_postirq().
>>>> +Â Â Â Â Â Â Â Â  * If the check is true then interrupt mode will be used
>>>> otherwise
>>>> +Â Â Â Â Â Â Â Â  * ( when irq = 0 )polling.
>>>> +Â Â Â Â Â Â Â Â  */
>>>
>>> I wonder in how far that's actually correct outside of x86. On x86
>>> IRQ0 is
>>> always the timer interrupt, but I'm not convinced something similar
>>> can be
>>> used as kind of a heuristic on Arm, RISC-V, or basically any other
>>> architecture.
>>
>> I wondered the same. On Arm we are fine because the UART will be an
>> SPI
>> which starts at 32.
>>
>> That's part why I was suggesting to use a define. Because we don't
>> have
>> to hardcode the poll value everywhere.
> Probably then it would be better to introduce 'bool is_polling_mode'
> inside struct ns16550?

I would be OK with that.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 12:15:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 12:15:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563125.880128 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJvEZ-0004jM-Dh; Thu, 13 Jul 2023 12:15:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563125.880128; Thu, 13 Jul 2023 12:15:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJvEZ-0004jF-9u; Thu, 13 Jul 2023 12:15:47 +0000
Received: by outflank-mailman (input) for mailman id 563125;
 Thu, 13 Jul 2023 12:15:45 +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 <SRS0=1J9w=C7=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qJvEX-0004j9-Kk
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 12:15:45 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fd1e51ec-2176-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 14:15:43 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id EFFFD1FDAE;
 Thu, 13 Jul 2023 12:15:42 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BA2C0133D6;
 Thu, 13 Jul 2023 12:15:42 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id MjDtK+7qr2TLJQAAMHmgww
 (envelope-from <jgross@suse.com>); Thu, 13 Jul 2023 12:15:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fd1e51ec-2176-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1689250542; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:  content-transfer-encoding:content-transfer-encoding;
	bh=69I9n2IK3naLFPJAhL5ZT4b7LKGGJ1CwIXBa7kBCt5U=;
	b=MQCCxB2Vlfl4wRDyy7mk8NCrZoyHLEB6I2HxpmeQgn8e4ut2z2KDRmd4VZrd1H+0jImkaw
	1tBCvT0JpY8S+P0Iq3SbfO/w1TDlYUW5z6u3B67RF/wabIAeEnecE48LwiMhZefI5M+agi
	v8mX3H8rOGhC4aQOvyK6jSLksu4fSRc=
From: Juergen Gross <jgross@suse.com>
To: torvalds@linux-foundation.org
Cc: linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	sstabellini@kernel.org
Subject: [GIT PULL] xen: branch for v6.5-rc2
Date: Thu, 13 Jul 2023 14:15:42 +0200
Message-Id: <20230713121542.4854-1-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Linus,

Please git pull the following tag:

 git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git for-linus-6.5-rc2-tag

xen: branch for v6.5-rc2

It contains the following patches:

- a cleanup of the Xe related ELF-notes

- a fix for virtio handling in Xen dom0 when running Xen in a VM


Thanks.

Juergen

 arch/x86/xen/xen-head.S     | 37 +++++++++++++++++++++----------------
 drivers/xen/grant-dma-ops.c |  2 ++
 2 files changed, 23 insertions(+), 16 deletions(-)

Jan Beulich (1):
      x86/Xen: tidy xen-head.S

Petr Pavlu (1):
      xen/virtio: Fix NULL deref when a bridge of PCI root bus has no parent


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 12:18:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 12:18:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563128.880138 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJvHI-0005KA-OK; Thu, 13 Jul 2023 12:18:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563128.880138; Thu, 13 Jul 2023 12:18:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJvHI-0005K3-Lb; Thu, 13 Jul 2023 12:18:36 +0000
Received: by outflank-mailman (input) for mailman id 563128;
 Thu, 13 Jul 2023 12:18:35 +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 <SRS0=0tL6=C7=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJvHH-0005Jx-ES
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 12:18:35 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20606.outbound.protection.outlook.com
 [2a01:111:f400:7d00::606])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6262d363-2177-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 14:18:33 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM9PR04MB8604.eurprd04.prod.outlook.com (2603:10a6:20b:43b::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 13 Jul
 2023 12:18:31 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Thu, 13 Jul 2023
 12:18:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6262d363-2177-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=DYppZfI4X0XgRSPc0jd8y/nIcbixj9LZq+H8yZsU9vckOei5qSlk1bUE0CVW/Q2hU4wtjB5Kep6zUHznwY5JQ4XNzsKM/x1le8PD1/6qZkIqOU+70o2THlmmn9bsFrBjBU3iaHiH3bL/tQCn7gAqaSWareDX2eLPzTVZVVfOTG3gudeeTXssjeTPNvz4mTc9WavJBScB4/jpn/wl5zGk86vFqB8ib1xf7zx75KSqjqlkNKRyrx7JqraeZ0M1ivJZkRsCIg066ClL5l/9fvUqAfJclnudxXxhNTxbFTkLTK/4KUNo78NZTeWbEqujlazlZ+5cp+C0vusccjf+zrhN2Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Gcd8J65i8vMfqwXzXSD63zpDSYFUuSaQAzs5IcQb68w=;
 b=B3xGPic6ovIMqXGwlLWeyYD2KhIogFsp7dkP7GTu6UER+gCezTN/yq0AyJ9DqqmfKFw7WjtceZvBy9ExlRkx+1AchCvZoGxet8E3NdtIZkfkxCSiu56Ymcsu7fmJfzDTL4bxFFa0r9QmE7lvN0Ibi1HTHEaBMzLN95QoFq5Z2JtZjUDr4tOJSmRE4+BeSMKg1AzGjXB+X2IBYO8I0IdRgI5UXQQ8e7IDo+DyySYGcN+EgxzkKWhh0ILPdZ5ucSTVOWNOGV2Ctt4ZtOQZw8f8BXiMryHRkR1WRSb583F3G8i7mH2DCtU4eSqLBJiq2iOOyk1KrHYlT/corC99t6mqow==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Gcd8J65i8vMfqwXzXSD63zpDSYFUuSaQAzs5IcQb68w=;
 b=gOJSkMIfYFvinQnhJcutYUUpK8ptWZ9jh35GZVynQ+eP+M2WNM6YdubF+X4P9Dy2tG1H8AZcldSnMMvtekAZhn4K5riHG7zWjEkhIYkfCkDTKPLkAm+piuEIxrwC8QlQTxRpVTlOrrGoJkJ11ZL217iZV40lvaZ5MICJVpLZyM+Ew4W39SXZLb2YGA4/KS9+p3abG86mhO2qd0PtSxt4pIoOu+6uYSGKtpETpPmPfLCCGwNoSsTWuRZ3xHUvsfCOfI0AXSf2J2G/WIF7dIK6qMuixpZOknWRxJgz5bEV3yrzBGZsvXkdRRmD3IsZEF/oIUntQW0YbjB02mR4m4dlBg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <c2de675d-b4cd-1040-efa2-1b8b90448d90@suse.com>
Date: Thu, 13 Jul 2023 14:18:29 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] x86/ioapic: sanitize IO-APIC pins before enabling the
 local APIC
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230707095338.44244-1-roger.pau@citrix.com>
 <92d16012-ff9f-693b-07c6-d45fe07a00a0@suse.com>
 <ZKwZBQ_0Z2c7NJNL@MacBook-Air-de-Roger.local>
 <1f79491a-46f5-5293-e92f-0e2b0b3efb62@suse.com>
 <ZK1S1V71ZUIPjKqZ@MacBook-Air-de-Roger.local>
 <eb2e3b57-a423-cf52-0192-a344db33a58f@suse.com>
 <ZK6wcpHnh5OgHv4R@MacBook-Air-de-Roger.local>
 <d84482f4-8be6-e514-58a7-a529890c8feb@suse.com>
 <ZK7JwEhrB-70nlla@MacBook-Air-de-Roger.local>
 <6d0ed712-0807-33b6-1586-a0588086c3a7@suse.com>
 <ZK_gHltq-1se3fau@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZK_gHltq-1se3fau@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0027.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:14::14) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM9PR04MB8604:EE_
X-MS-Office365-Filtering-Correlation-Id: 12f64496-b82a-4d15-a37b-08db839b4543
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	DvaYFcB5H/xDXczYOavqsw5XMW5N2vQKrfPxjcC7LewL/8XZJL2/O+9TCtkz5ClLjDHx8f1XxfXf+I9vKCu1JWDtPqknS0qT74SC5VC8g5SzdNOT7yKcO7AaxiT+dru4k/j7klghafXzOVtSpYgOiG2+1uJdI2qu5DsbvORhHYyhsCwyTqRsAqrXgVKfPcK9bmhqMPDCR9A9Nnwl90J14YA9vnA3qiNDFlqCBT9dAFd4V14oIciwIJ2dSdDe6NLOsm1wAoX3ZT3J7D/qUJ2FLdrUd3Z6jdZ3mufv514guv5uaGAioj/ByIZsrJK3wHW6osMU4bot0dp2HL+28qxuwGVPm1Nfp7ihZMx4XuwXty+7VgbpXsuWlAWrd5lHpCq5op51PeREnWiKzZgnjynwarIR0ElOZRSYvcFMr/UJO5em+OAUJz/mkgi8f88xQmIssTF13YRRQjYtohapdMwfaCchLGVfkvtzBRct3MAZH4LSp9IcTH1YxqodpXR6rgg9YSxPuq5XLJcQlPSBvmqZZrpJJ1TgsDIOFxBJoFpFsdxdYR6iJ95MLi1VHyNRO5PUj2x7RbSX3MdZD4WOaQWLYi5VcGvMH+doZG67q6KAjZXQhP9go6p0mtU0dA7B9WcOOZeiiLLoVZz/haYt9QnNOQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(346002)(376002)(39860400002)(396003)(366004)(451199021)(31696002)(86362001)(31686004)(36756003)(6512007)(2906002)(41300700001)(478600001)(186003)(2616005)(26005)(54906003)(66556008)(5660300002)(66476007)(53546011)(6486002)(4326008)(83380400001)(38100700002)(6506007)(66946007)(6916009)(316002)(8936002)(8676002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Yk5kSWdTR3NZVmhvU2NkUXB3UnlSeFJEK05EaU9CdFVRbmxiSWtydlZRRUNl?=
 =?utf-8?B?TTdXNnN2QmJrVEF1ZE0vRXhjKzhVSWNGaXhnWWs0Z21oelRLWHVKOGpUTkUy?=
 =?utf-8?B?czA0cmF2bTVJY0s2bkdKU2NXc1p1bUtJbnhUY1RnMzNhelVxYnFobi9HRTBm?=
 =?utf-8?B?Vlk0NzNBb3hTemlTUWxiOU5hWWxhc0ZYTmNXNDBkdWpsbVh4bis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2V5RG53TVJqZ3I0d3FVb3d6L2YxUnkrL21GdThuMzFXR0g4Rk02?=
 =?utf-8?B?WjIrZmlMRU9SU1drUjczTENlRzFLcXN4aU1MOVdKTFdpbVRlMm9wVW1iYUs0?=
 =?utf-8?B?cm9hK2M3UHpNVkRRVWNybUxuaHdJbStTOGxlSnh6dHlDMUtHZGJNdEtaM3hJ?=
 =?utf-8?Q?mchrPHgtfVcl4t8DLuPZXWGy4?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 12f64496-b82a-4d15-a37b-08db839b4543
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 12:18:30.9942
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: t55SJXWrWUe3uYf6KD2ku3eQ32K2UVBiUkNKW3DteJgiEvfEkfxTTD4G/5PYryj7met7vNbsik2Y1k3fhiPWhg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8604

On 13.07.2023 13:29, Roger Pau MonnÃ© wrote:
> On Thu, Jul 13, 2023 at 09:49:14AM +0200, Jan Beulich wrote:
>> One other thing I finally figured was confusing me in the
>> description of the patch; re-quoting that paragraph here:
>>
>> "Fix this by moving the masking of IO-APIC pins ahead of the enabling
>>  of the local APIC.  Note that before doing such masking Xen attempts
>>  to detect the pin where the legacy i8259 is connected, and that logic
>>  relies on the pin being unmasked, hence the logic is also moved ahead
>>  of enabling the local APIC."
>>
>> The last sentence saying "also" is kind of odd with the first one
>> already stating this very movement. To me it's therefore unclear what
>> exactly the second sentence is intended to be telling me. I guess you
>> want to express that together with the making the detection logic is
>> also moved (i.e. the entire function is called earlier), but I'm
>> afraid this isn't the only way to read that second sentence.
> 
> Yes, you are reading it as I was intending.  It's merely a logic that
> the i8259 detection is also done slightly earlier, as it relies on the
> RTE masking not being tampered with.
> 
> What about:
> 
> "Fix this by moving the masking of IO-APIC pins ahead of the enabling
>  of the local APIC.  Note that before doing such masking Xen attempts
>  to detect the pin where the legacy i8259 is connected, and that logic
>  relies on the pin being unmasked, hence the logic is also moved ahead
>  of enabling the local APIC."
> 
> "Move the masking of the IO-APIC pins ahead of the setup of the local
>  APIC.  This has the side effect of also moving the detection of the
>  pin where the i8259 is connected, as it must be done before masking
>  any pins."
> 
> Is the aboce any better?

It is, thanks.

>  Would you rather prefer me to drop any
> mention of the i8259 detection being moved? (as it's just a side
> effect of moving the masking).

No, better mention this aspect.

> So to recap, I think we are in agreement that calling enable_IO_APIC()
> just ahead of the call to setup_local_APIC() is the preferred
> solution?

Well, yes and no. My preferred course of action for the issue at hand
would be to convert RTE 0 to ExtInt (under the mentioned set of
conditions). I agree though that we also want to move the masking of
RTEs, and for that I further agree with the placement mentioned above.

That said, you're the contributor, so it's still up to you what you
submit in what order (you could still decide to leave out the RTE
conversion change). The two of us not reaching agreement merely makes
a little more difficult to decide which of the changes to backport
then.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 12:25:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 12:25:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563130.880147 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJvO9-0006nO-DS; Thu, 13 Jul 2023 12:25:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563130.880147; Thu, 13 Jul 2023 12:25:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJvO9-0006nH-Ah; Thu, 13 Jul 2023 12:25:41 +0000
Received: by outflank-mailman (input) for mailman id 563130;
 Thu, 13 Jul 2023 12:25:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=0tL6=C7=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJvO7-0006n8-5Q
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 12:25:39 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0614.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::614])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5f675573-2178-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 14:25:37 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PAXPR04MB8302.eurprd04.prod.outlook.com (2603:10a6:102:1ca::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Thu, 13 Jul
 2023 12:25:35 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Thu, 13 Jul 2023
 12:25:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5f675573-2178-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=QldQrssk/g1Ii6ynhl8mPfdBXj0z2T6Xa+DXUgbGpB4y4MzZ1zmAI/pywDC5BdEph5YI4iqpD5fxElw3f4mUKPibSm+lopCprQ56Mzcma3juzbaKq7D6BYmBU9WkL0yYSNc41OewCzDR0YwgpUUe6dOa6EVzhWQKfxuKMr0G81h6IWrLY0l4HgiYIO91bl3c5DiueiGbAuTwr6SjNyv+3JZvLQDpGh0gIA0K5MRqEskXzXvsT/cEC3Ogfa3Y/RknmCL47uoVJ7axjLnFStLHmNaHqUIAWrTIwA0FgwlUZuI4w/MWfaq31gGhLngSfP6hqPcqmidZLuFFoqn5vyf0OQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=WGInQ63RH9BoVszkg+YVbqNi9E+CNcqXFnDAW7bqnzc=;
 b=YO4TSHUSNy/fJiPbiHSbqjmnQDm/4btOsc4p76StyKQB0La445ke2jduliBYMQx1N5pAHtW0KFNa1Ctya3Ow2Kom7sOKbbAIrYgnqD9Q1TubTKD6w3hCjOvMccBwmaxgGhuuV1mHubX8703x7SBYuulotI2RmHsN9AGcCYnJRROms/3iXiQNshMerHzKiwZnRY/JnPmi5Gk27Z3YoU8vtGsjgOv/Psp/85jcLet5Gogp1HSlA7/fXedElsnJlb0Awc/nxM7hKqNoVb4V1KySxcYACHtdOsLALpkIVrjk6Ax1jn9zoDh6ihf729wiUxctVzB1u/KSrDw2pdMf0ijByg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=WGInQ63RH9BoVszkg+YVbqNi9E+CNcqXFnDAW7bqnzc=;
 b=ZCMu+2J6htC/gJaHmS8lmC01709TyPz4YwDNE6qokmiSNxce5HOPq59qMAXFCpoOP5g+YYIHRoNruNvyzGAJZIgG7ZckO/C7rDDfiy7BtfFQl4FPlJaFpm/NWyjHq5Oc8w3MrQL0y32Sv46IQs1R9U8YVIGzGGjiJ/K9sCs0xGbo4/NGRCA5vhczoyt+YWrDLflh+gFtzySLOtpq0tI46Nk6Kf4R+oY5/MR/miN0ReZJfo5XRqB1fLaMFShmi8tLjXw3s+COYKx14wDYoZpCyt+m1pzc8ALRkWqmVUP/+titZkpMcxyDjIFbhYXM45CK9UY6rP31jvNkhQ+Jiu5IkQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <c7a8cd09-fbeb-2453-3762-1bedb9cbecea@suse.com>
Date: Thu, 13 Jul 2023 14:25:33 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] ns1650: refactor interrupt handling in
 ns16550_uart_dt_init()
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org, Julien Grall <julien@xen.org>
References: <cc5a08056abacdbb6d6509b56716eb45467307bb.1689240611.git.oleksii.kurochko@gmail.com>
 <a385a17b-a60c-d770-e044-af64273371d6@suse.com>
 <d05c5fb0-63ab-4368-ed3b-bb06b242808a@xen.org>
 <27c323353ffd231f778b48b1cf6bca8560c7734a.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <27c323353ffd231f778b48b1cf6bca8560c7734a.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0140.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:95::12) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAXPR04MB8302:EE_
X-MS-Office365-Filtering-Correlation-Id: 6e9610c7-d845-4212-e61c-08db839c423a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	8DStwLC+rrnt+8CzX2jXpjF9tHbNcMHcYbOM+tkWWGUlt8V0sZf+83loFhTGuhnhwmnce+VBjHYAMKaLOVgSTHrIg7ynH5eJaopkhG6kOVRq+JyZnMgbgvwXySw7NHq/Y3czd0SVrRnvE0IctOFabkfqWM58jwVNSQm6rliBvRj6MyIKquct4pHz7iins5JEh7FtjNBKZKHNnEcbTNTkz9i06EOwqQWABhQ+fMKvd/R53TZXGNw2SPXvRVImKApgpuF4/2I4Yy6nXFInlHFAWqhakjDQzsDUbtpmJiaeB1A886BGBF4mbJK33giBwuyj7V9KmTdsthzX5KAAXQb5GX3JEombiPpP2y20pYxFGMkEYkmhDHbXuWhJe1ehcCKyTKlDW+y6im0jWpruommnWJbJZToGu9Pu3Tn/UympD52JO6LE1ryL6LeADa3v+80H5WBLPo+Ar9+7Oama6L2oJdmbRYCDXdEaNu1V8lLSrEzKbPwhoi8OB7jao2A2lq7MJkB3tJU9xyrm4MhdbW0qKjLvX/H/Yd9U3SKyh3qbu/RuuvxrgEJev5kfsKE91hRVR9blHUEzGwPs93MczEKDru3sF6ziDM7/4UXhMMyXeVo1n/ltz860EKcfRQbEb4N5GM4SKH1jjt2RuZ1qipkt7Q==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(366004)(376002)(136003)(346002)(451199021)(66946007)(6916009)(66556008)(66476007)(4326008)(54906003)(478600001)(86362001)(6506007)(26005)(31696002)(53546011)(186003)(36756003)(6512007)(6486002)(41300700001)(38100700002)(2616005)(8936002)(8676002)(31686004)(316002)(2906002)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?L05nU0lpRDhKVHdtams4WVZCemFSNC9QZ3JXM1pQS09SL3J4bWFCS2hRdjd6?=
 =?utf-8?B?RlVkWVlsOXFHUTVZSUJObmZQOGhiL3RXenVEVGlNNXNEMGpyamFHZ0FNazBD?=
 =?utf-8?B?UWRvck1KVU8zZnZKVnM0UjJIOTZ2WGEyV3hYRjlka3VyMDRRSGdNc1psN3dZ?=
 =?utf-8?B?MEx6TDNtdkpoUno2bC9NZ2g0R09iek4rUVBUbk9FeUQ0TU41RjJldHpzdWFo?=
 =?utf-8?B?K2RpZGRZTElYMkgyWGU3STBSTzdMNzRYNHRWVDRoN1FtaUc4STZUQm0vVFlr?=
 =?utf-8?B?UXc1SjZaYjVTQjBYU3o0d1NGS2VmQ0FJQjk0aWIxM1lmUmtpZmU5dzhUeGVx?=
 =?utf-8?B?SHNEb2k1RmJIQVc4YnNoaTlCbmxjMitvVGQzdUg1MnRhOGhDU0JQbzJrMW8y?=
 =?utf-8?B?MEVzYzYwTTdod0w0RDFVSTVk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c423a
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 12:25:35.3223
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ddFD6rHqcqEb7KVOy0Hcptv3fz/8DZhfqn+/wMcXfpAGi51tlWFDIu7/F6QE5BUwej2UaTmY3oS92mrpAoXe+A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8302

On 13.07.2023 13:55, Oleksii wrote:
> On Thu, 2023-07-13 at 11:13 +0100, Julien Grall wrote:
>> Hi Jan,
>>
>> On 13/07/2023 11:08, Jan Beulich wrote:
>>> On 13.07.2023 11:30, Oleksii Kurochko wrote:
>>>> --- a/xen/drivers/char/ns16550.c
>>>> +++ b/xen/drivers/char/ns16550.c
>>>> @@ -1791,8 +1791,16 @@ static int __init
>>>> ns16550_uart_dt_init(struct dt_device_node *dev,
>>>> Â Â Â Â Â  }
>>>> Â  
>>>> Â Â Â Â Â  res = platform_get_irq(dev, 0);
>>>> -Â Â Â  if ( ! res )
>>>> -Â Â Â Â Â Â Â  return -EINVAL;
>>>> +Â Â Â  if ( res == -1 )
>>>> +Â Â Â  {
>>>> +Â Â Â Â Â Â Â  printk("ns1650: polling will be used\n");
>>>
>>> Nit: Please don't omit one of the two 5-s here.
>>>
>>>> +Â Â Â Â Â Â Â  /*
>>>> +Â Â Â Â Â Â Â Â  * There is the check 'if ( uart->irq > 0 )' in
>>>> ns16550_init_postirq().
>>>> +Â Â Â Â Â Â Â Â  * If the check is true then interrupt mode will be used
>>>> otherwise
>>>> +Â Â Â Â Â Â Â Â  * ( when irq = 0 )polling.
>>>> +Â Â Â Â Â Â Â Â  */
>>>
>>> I wonder in how far that's actually correct outside of x86. On x86
>>> IRQ0 is
>>> always the timer interrupt, but I'm not convinced something similar
>>> can be
>>> used as kind of a heuristic on Arm, RISC-V, or basically any other
>>> architecture.
>>
>> I wondered the same. On Arm we are fine because the UART will be an
>> SPI 
>> which starts at 32.
>>
>> That's part why I was suggesting to use a define. Because we don't
>> have 
>> to hardcode the poll value everywhere.
> Probably then it would be better to introduce 'bool is_polling_mode'
> inside struct ns16550?

Perhaps. If I was to make such a change, I'd probably convert intr_works
to a tristate. But a boolean will be okay; if I may ask, name it just
"polling" though.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 12:37:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 12:37:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563142.880162 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJvZO-0008Ok-Fj; Thu, 13 Jul 2023 12:37:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563142.880162; Thu, 13 Jul 2023 12:37:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJvZO-0008Od-Cy; Thu, 13 Jul 2023 12:37:18 +0000
Received: by outflank-mailman (input) for mailman id 563142;
 Thu, 13 Jul 2023 12:37:17 +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 <SRS0=0tL6=C7=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJvZN-0008OX-SR
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 12:37:17 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20617.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::617])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ff3a393c-2179-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 14:37:15 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM9PR04MB8065.eurprd04.prod.outlook.com (2603:10a6:20b:3ee::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Thu, 13 Jul
 2023 12:37:13 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Thu, 13 Jul 2023
 12:37:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ff3a393c-2179-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JVsQEsUly5uReDrkAbi4+mZUkz/G8Ih1F6XlFt5oP+o+pUcntjjApvRlPsN0eZPqeJLdFNf3Fsg5ZcQIG3CmxcFQAh5HqgcHi+a2RbRw6ItqFiJDVlum5gjNTj3bG+UBPL5gB4fYGgbRvRFE1sD7wpFa1sLRmSVKXdgaFMQi2io/tZxRBf96imzeiCyxKqgWY0uSQxKbqLoWsl1A6LQacH1M2mswOzJlUubIi48SqnYFmTn9JM5t0eFY9ewcBZP0ojvZ8EvDXprZ8d3bDdmSO8K5DiI8zoMxUnVEGnDP1qcIFSodUF4kuoy6SoGFIvW4LZ7ntjV7In0un7/ODihJAA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/YFlR+gDc6meItpOHRB1S3DEccJnN0Wdyc9BOoURh00=;
 b=WfntvFURbjaqJH9F72DGAVE0B9HDPo5/LYmNchcoIOppVWHJFpeh4KksnS/yoAruy9lRDyPjqyuMn4Tt/dCGlA+k121ASl3pxONGnYyoYEXEdGvfQaO+fBgKBS+RTblJ6LwQJ/wUYtPSVdauCmiXcIXGTitzVS6/1k9FHNmxCbVZF1GPRn10/mlW43TA6ijmVaWXLPjPUqJsij4/LbQsN0i1WkQ2YlkAzXwwQdWA7x474MZCJlbQBROl2RweoiSxX25GC+X5azZTuxLxH5QgDGJ4R6la0ea7IeMohFlNGbvabng8ZrfmKDTxP0ZtNHLwnj4fytmKC0yflEvoezKtIg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/YFlR+gDc6meItpOHRB1S3DEccJnN0Wdyc9BOoURh00=;
 b=uH0DUqSQ6ADrHsixMJzEjVzoG+9hvtDwTEKPHwBeGyOpJLVGeOHUEBuX3f/E0ZUPQaNuoBp69tmHqoXt4KyaAafBShKA6GWgqrZEV2npfCl0rjENyPxv/UzxOXP3AhL5rJa21eleeS27AJBS6M1h1868L8YVgdd2f90fykNTTnhbFMj7lIkSHflusVlH2+kaNigcETxOzn+N0aDaFzv0KqFadjcf7QdCd72rF/C4SWMIQrbpwyKKxIpTj4Vth+u0YaHdtjD1rOMyWG7iDBAQAhBJli3e5rtOT8tK7DMYG8aeYqU24QTcITJXDOIt5SzU8HeDGHfyUfffYJmU1c47uQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <9e16348c-4b43-0ed3-fa53-b7bb69538437@suse.com>
Date: Thu, 13 Jul 2023 14:37:11 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v5 09/15] cpufreq: Export HWP parameters to userspace as
 CPPC
Content-Language: en-US
To: Jason Andryuk <jandryuk@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <20230706185440.48333-1-jandryuk@gmail.com>
 <20230706185440.48333-10-jandryuk@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230706185440.48333-10-jandryuk@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0175.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a0::12) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM9PR04MB8065:EE_
X-MS-Office365-Filtering-Correlation-Id: 8c601e5c-98c9-4d31-6735-08db839de242
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	t9fouMGYfvBQBFX2YM3SqFaOz71Z/IvH03HwhIgQrblpSPQKN9AzswwaHDbRQ8qzmOg6U5M5hW9hRSsfOw9tK1mHW7NzJM8YAHxGK3r3RpKHMwUXU9e+XLe4ProxdJF+DcF35Rtf8OVhkh3L+SG+aZLSGe2G2SDNyVE1TGXkZF05zmUhw1rVsy6QRWjwUIFLlI8R8/ej5ZHw4XD91EAgGZCw3EYtnFo+ETezXqfYtA73WOljIkU1SFxGcNbw+RHbYZ1aTl+3iNYOI92wWkdYS7N8icRMZX4k+jqfrqresQSKOVXghT/Wx4rBUMhFr+F3SCk1NScgscF4xCNhA7gXR3eI0DJVnehX+/8lemuUgf6dZBr554SHxDUtRPcFKtLvb0ZKBO7cvacP5iG6rCMgcMsES5ERDrvenWBKva214PCS9qq6WLUjpCdmnSu9YFLsc8boML05aIzCFmbWFUF3RJBbV65nocS1CyPD1ibaNU1l9NMVpQLLINEGK9J3Ek+Zot8YImvnU4Wocc/SmT9Oo+N5RAOu28VW2KmcWAetSiQ4CpFIwShNgJXs2rTKDQwhUjsz6QnDydKMZUoE+RnXmFit12uI59aJkD3ENMQi4D4trc4EL1YzBMtA5pylpNCy5OpRVeQr8S0SGbHX422d7Q==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(376002)(39860400002)(346002)(136003)(451199021)(2906002)(38100700002)(6512007)(83380400001)(2616005)(186003)(26005)(53546011)(6506007)(86362001)(31696002)(5660300002)(8676002)(8936002)(36756003)(478600001)(54906003)(6486002)(41300700001)(316002)(66946007)(66556008)(66476007)(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T0xOQUlpSHpKZVM3bEpvME9FQjgwUDVCNjBD?=
 =?utf-8?B?SG1oT21LRXpEbmNycGpJd0pDTUVMRzhrOW5yaVpkTkN1YmliQzJsL2VFMDRL?=
 =?utf-8?B?QjdvMlpDYlc5VFl4Z0tocWpVWFhwMmRBRUhzWXo0TE9zclFaTFovbkxIc2pm?=
 =?utf-8?B?WklVK2JmNFRWNGJQd0t6bnEzZFZwcG40a05NYzFIMlBDTXNrUWJQTlZjWnJj?=
 =?utf-8?B?L0ZWUjczUkRwRGp6V05uRDR4Z0dEZnpmTTBxQXo0YjlScGhoZUZQL0E1UUNs?=
 =?utf-8?B?ZWNEWnZiK1F4aU56Zkc0M09RWTFTaXhZeXAvRWw2b1haSzhjN3pUc3pSTllL?=
 =?utf-8?B?NlFKNjFKeW5PeWpxVWRERkxFaXpVdmk4YWZLQVNOTFRGMUU5VDBqbU9tdHdU?=
 =?utf-8?B?K0xRejVFNDU0dmhKQUtLZC95ZVhTWE1HTkFSSVVyc0hUM1dGbjRGaVFJdmQy?=
 =?utf-8?Q?I3QdYBLuQTCAzt67kYO9QzVTS?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8c601e5c-98c9-4d31-6735-08db839de242
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 12:37:13.3404
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 7ZVce08La/0A3AAvGsRdqxLMf7+4LqBQRWB3lzh4FVReMQsjKtQrwOLSGxeNiBx8seZDRGvc2MpzCJ2hgb+P5w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8065

On 06.07.2023 20:54, Jason Andryuk wrote:
> Extend xen_get_cpufreq_para to return hwp parameters.  HWP is an
> implementation of ACPI CPPC (Collaborative Processor Performance
> Control).  Use the CPPC name since that might be useful in the future
> for AMD P-state.
> 
> We need the features bitmask to indicate fields supported by the actual
> hardware - this only applies to activity window for the time being.
> 
> The HWP most_efficient is mapped to CPPC lowest_nonlinear, and guaranteed is
> mapped to nominal.  CPPC has a guaranteed that is optional while nominal
> is required.  ACPI spec says "If this register is not implemented, OSPM
> assumes guaranteed performance is always equal to nominal performance."
> 
> The use of uint8_t parameters matches the hardware size.  uint32_t
> entries grows the sysctl_t past the build assertion in setup.c.  The
> uint8_t ranges are supported across multiple generations, so hopefully
> they won't change.

Isn't this paragraph stale now?

> --- a/xen/drivers/acpi/pmstat.c
> +++ b/xen/drivers/acpi/pmstat.c
> @@ -251,46 +251,52 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
>      else
>          strlcpy(op->u.get_para.scaling_driver, "Unknown", CPUFREQ_NAME_LEN);
>  
> -    if ( !(scaling_available_governors =
> -           xzalloc_array(char, gov_num * CPUFREQ_NAME_LEN)) )
> -        return -ENOMEM;
> -    if ( (ret = read_scaling_available_governors(scaling_available_governors,
> -                gov_num * CPUFREQ_NAME_LEN * sizeof(char))) )
> +    if ( !strncmp(op->u.get_para.scaling_driver, XEN_HWP_DRIVER_NAME,
> +                      CPUFREQ_NAME_LEN) )
> +        ret = get_hwp_para(policy->cpu, &op->u.get_para.u.cppc_para);
> +    else
>      {
> +        if ( !(scaling_available_governors =
> +               xzalloc_array(char, gov_num * CPUFREQ_NAME_LEN)) )
> +            return -ENOMEM;
> +        if ( (ret = read_scaling_available_governors(
> +                        scaling_available_governors,
> +                        gov_num * CPUFREQ_NAME_LEN *
> +                            sizeof(*scaling_available_governors) )) )

Nit: Too deep indentation of this last line. If you want to visually
express the continuation of the last argument, add a pair of parens:

        if ( (ret = read_scaling_available_governors(
                        scaling_available_governors,
                        (gov_num * CPUFREQ_NAME_LEN *
                         sizeof(*scaling_available_governors)))) )

Otherwise all line beginnings want to align with one another, no matter
whether new or continued argument.

Also there's a stray blank after the 1st closing paren.

> --- a/xen/include/public/sysctl.h
> +++ b/xen/include/public/sysctl.h
> @@ -296,6 +296,61 @@ struct xen_ondemand {
>      uint32_t up_threshold;
>  };
>  
> +struct xen_cppc_para {
> +    /* OUT */
> +    /* activity_window supported if set */
> +#define XEN_SYSCTL_CPPC_FEAT_ACT_WINDOW  (1 << 0)
> +    uint32_t features; /* bit flags for features */
> +    /*
> +     * See Intel SDM: HWP Performance Range and Dynamic Capabilities
> +     *
> +     * These four are 0-255 hardware-provided values.  They "continuous,

Nit: "They're"

> +     * abstract unit-less, performance" values.  Smaller numbers are slower
> +     * and larger ones are faster.
> +     */

With the adjustments (provided you agree)
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 13:03:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 13:03:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563147.880172 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJvy9-0003Y1-L5; Thu, 13 Jul 2023 13:02:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563147.880172; Thu, 13 Jul 2023 13:02:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJvy9-0003Xu-IO; Thu, 13 Jul 2023 13:02:53 +0000
Received: by outflank-mailman (input) for mailman id 563147;
 Thu, 13 Jul 2023 13:02:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=0tL6=C7=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJvy7-0003Xo-Pt
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 13:02:51 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2062d.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::62d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 91e5d1a2-217d-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 15:02:50 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM9PR04MB8700.eurprd04.prod.outlook.com (2603:10a6:20b:43f::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 13 Jul
 2023 13:02:48 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Thu, 13 Jul 2023
 13:02:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 91e5d1a2-217d-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CGUBywDFApOIuzIET8t+G9bHPRrjH5BLKsDmc1BXb6oc5/V5jcF1b5xSCGA1PJ5JwPRYnAiVeLRA8KiPx7d8+ocZiHH0m7pdjqBIxfBSmt6NDrIXGS48iHbcL21hBW7pGHYDszypa/kysTSPSdx7oFZwNaLXZrkMTXXadYHBi5a0uYPODWwQFkDOTu/s7Dzocwgzyf38WNZGYiGQp3grxZ0u1XcJi8mp9rYk9/9IU3wmuYWUzbtQ3ZhmA3c0DKYDy9DJWxEk8xDzl6GvLviYqUCnv9MDJ2Qxop8YtCKZlYejZ5ClaSDbEBvK2DJMrSxaUi5TG3PwNQNtnq2+TiOIPg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Q0+JziC2DWMLKXUQ2+6AYymAasPio2XVKkf1gkCYdak=;
 b=iObK6TJFbycwLWo9PSAB93J2/WVlz6GX6Vm9Okz3UQy69NNt5ffehCof8Hz+gpLo4Ex/37Bu5oxvFxi0pZnGiRcWL2HbtrIOxT725lOPqQkAsukhaV/x0uP2CiFYaxKSDXE0rdKaPMgns9x8m9jbq32Grget5X7tPDwNt+z75PVm63gv1nfy4Ffy9IA8mTLuKJAicrGz91jwYWs9tmkmin1CwkALTaCEZesVpoyCzKrmXyOGrr1yFV6uVsmVMnjK7x691NyvwgE1rl+FO3fKMZxWIjMilWzJXLuWirT9BybYWE0ZSwRwR6uxRnNusGB05Lp5VlkjANg5NdkP6X5Oog==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Q0+JziC2DWMLKXUQ2+6AYymAasPio2XVKkf1gkCYdak=;
 b=21VCb9/bD1buOoIWuNk+mK3eCrhhXBt98IRrTSbhlkp+sjINOMniDPJWSA5exLqdZSuv5V3n5yKaduFNupiIYJF3oXV8yJcynIa7q7DcTPk9CRKG9qmvJb1eY7Y+p5EzTve5+i7eQfVkiobIL2eYHmzfLKvyN2OC00XVDnvBD9Iilxs50hRiXd4DxPjZHl25iaF/ROk11KcmxvtmfjVCJOVaSObAy1ZP0iR5/M7EmxMfH2WYM0p4XJWmBJoe6GjBly8sqDtYXv/U2rSsUDL4z+xmNI5b8ps2KDhgjqVWmp6wwZFHM+54Pxs47j4umg6lvRkyE3/7fle6wHkLnwrybw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e398f2f3-3c12-5bbd-5bfb-d3fac7c1b23a@suse.com>
Date: Thu, 13 Jul 2023 15:02:45 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v5 12/15] xen: Add SET_CPUFREQ_HWP xen_sysctl_pm_op
Content-Language: en-US
To: Jason Andryuk <jandryuk@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <20230706185440.48333-1-jandryuk@gmail.com>
 <20230706185440.48333-13-jandryuk@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230706185440.48333-13-jandryuk@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0182.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a4::17) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM9PR04MB8700:EE_
X-MS-Office365-Filtering-Correlation-Id: d2ca83f2-7115-4e48-b0ea-08db83a17511
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	V2CUDUNAk+YXKdzWqz+IGTB89fiJn9NU9aX6rpcOOdvlMCsJCAM3ajkz4E5V5MPFhxbB6kGCMYVR7j7UX9ncP1q4rjhmtiP+Fvkd3XN7NMGWMzZm2l9dsS0lhxmMXisAU8XpaZ+hC/pAO9EJWKjWqf7pUzYL3pf+Tv0+y1a5p4I8Xz4Gt0myuh0S/GmUclhFQFQ6dgdTFB7XB25z8wKbr3ZyrqcURcSmHLQEjySlvPuo1ghA0j4yP4JX6lHMyHXffF7x9nTy3XC81NfvnZr62/MhkSSHmCQVi2qDkcM0rMdDnQnhGzmU8D72Pj2SW8ZAJorBo5FTZ6+gt4iBA23DT7w+n1d0Tv2sFmXnUN0U5B8w/nXO7MdXVbUKdMF2ZTEAf29EJMJ78sZED08ZykODaO/PuBgygyF7iKJNBQyxnVDiaeBj1mYYOTZEY4cFGuqPuV6cjdhG9IyY5TuZtOBDwY7j8Dws3pm9RyyNuadtixLvHESNcs8bRtIFuDXPP6ex31S+1fM1ZTSEctN4xqIcvp1OGDS+nSs+rumq5qrdwTyz6z8D2WMbHxwkPq3Elt/cc6mba5PzDYF0ApiaNFaoxVJ1cWwuYjXcL8sfIw9b706f4IcjtMFXHvCh2zzVUBaDqhKccjEQYWMTkdHr4mqpJA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(396003)(366004)(39860400002)(136003)(451199021)(31686004)(8936002)(8676002)(5660300002)(41300700001)(83380400001)(316002)(2906002)(6916009)(66556008)(66476007)(38100700002)(66946007)(2616005)(4326008)(186003)(36756003)(53546011)(6486002)(26005)(6506007)(6666004)(31696002)(86362001)(6512007)(478600001)(54906003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?c08rcVVabnFJRDZxaVkrcjA2YitVNlhkaEJFNkszckRhTUV4QmVhcHlmVm9j?=
 =?utf-8?B?T3d6NEVIYklNTHIxWnk0ZUFVdHY4T0VtdFpKT1hLbjlIdVBHWVZHai9wZkts?=
 =?utf-8?B?emlWMVBoRUxkcWg2OVc2WlZ3Sm9RTmtvVXorVDlXNEtmUEk4bmZzaTVURDc3?=
 =?utf-8?B?THZWUmRZRkFEcFZSZ016V1Bxdjg4MG14ckQ4b3I1SmliU0JxcU0rRzV1Umli?=
 =?utf-8?B?U051TEY0RHZRNjJyeXpkeHBFMmlYeGxtKzc1cE0vRFd3M3FnN0c4YWJWSmdM?=
 =?utf-8?B?dFdmZy9veXIvamhQMFpuaUdiOWNzandLR0pFOUNIQUZPVjJGMUZjMHpzSlRk?=
 =?utf-8?B?VG9jbG01bEdaTEt5clFrZ0hxdWZ3aUdxdFIveW1TSjFyMzQrTkFKTUNyeGRW?=
 =?utf-8?B?MmVqTUZzbk1GUUpTeFgwWEtITFhvbXRNMmZHaURuNTdobnFoQjhneEZkQURN?=
 =?utf-8?B?eUVLUk5zM1NEQ2crVElKYlFEVk5qNjBtUHlzMHVDemVFZHhRVnFybVVYVE9P?=
 =?utf-8?B?TVhSN3BmWnA4WGFzVDlqYWphK2JDbHQxUUlad3M1ZS9hT0dIRHA3QS9sRTRw?=
 =?utf-8?B?VE96Q2lhRm5XZXBRT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aWprc3JsMEdjd0E2U2cxblJIMG1V?=
 =?utf-8?B?MmhldmdBOXZZamZmcTZEczJNS3d0OWtwejJVbGtheENVcCs4UkgyYVdvdHRY?=
 =?utf-8?B?Q3pXMEdhQVFkMEJ2RG9rMjVCaUJCSVc4Z2Nmd3IwM0xVelNxSndPNXNJc25z?=
 =?utf-8?B?Yi82eXZJMnBxaUJ0V29va1N2MGpKcHBua09IS3V3Umtra0ZrNy8vY05NR01m?=
 =?utf-8?B?UnBNL1N6d3FxS29Ja25NQ2lsck9IbzlFVjYwSVh5c2thMGJqWGFaTmhqY1Fv?=
 =?utf-8?B?NjI3bk1kZko0KzVUTVI0UEthZXkvV3Fpa3paR2Q1M2gzMGh4eTJnYjYxbHhm?=
 =?utf-8?B?cytwNTY3ck1GNVc4Q0U5NTlFOUgzVnVDOWl5M0JlY3p2eXdRZWZ2M3g5Z1JK?=
 =?utf-8?B?TmxncmtBYW9yYTZCYmlWMWZFYVBPSzF5MlZ6aUN3dXVRRTRkWXpLdUtZSnA0?=
 =?utf-8?B?RTIrdlgxdzVMZ0xuWk5wZzNQRThETzd2MDBkbGozcjdOS0liVlJCZ3RIazJZ?=
 =?utf-8?B?N1FzQUViRFpsVm9VdTh5dkswSndMSThmTnU5cXFEZnhNSWF1b0ROS0tJOFY4?=
 =?utf-8?B?aFI2TDlPaEVJd0ovWFRxQ3ROeWoxMFF2MVQyd2tpZndyRzVqV1FMNHluSi8v?=
 =?utf-8?Q?OSjGTZ4ujDaiqHsiZftVP/VYn?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d2ca83f2-7115-4e48-b0ea-08db83a17511
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 13:02:48.1142
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: G/iqbNIGCpzTQa/ZjQR1W2AQolVAydKoSFTrEtPtkDxK7jjFn5nFEgepmZ8jrgB1Gknn04sjkXUmNRcEgmbARg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8700

On 06.07.2023 20:54, Jason Andryuk wrote:
> @@ -531,6 +535,103 @@ int get_hwp_para(unsigned int cpu,
>      return 0;
>  }
>  
> +int set_hwp_para(struct cpufreq_policy *policy,
> +                 struct xen_set_cppc_para *set_cppc)
> +{
> +    unsigned int cpu = policy->cpu;
> +    struct hwp_drv_data *data = per_cpu(hwp_drv_data, cpu);
> +    bool cleared_act_window = false;
> +
> +    if ( data == NULL )
> +        return -EINVAL;

I don't think EINVAL is appropriate here. EOPNOTSUPP might be, or ENOENT,
or EIO, or perhaps a few others.

> +    /* Validate all parameters - Disallow reserved bits. */
> +    if ( set_cppc->minimum > 255 ||
> +         set_cppc->maximum > 255 ||
> +         set_cppc->desired > 255 ||
> +         set_cppc->energy_perf > 255 ||
> +         set_cppc->set_params & ~XEN_SYSCTL_CPPC_SET_PARAM_MASK ||
> +         set_cppc->activity_window & ~XEN_SYSCTL_CPPC_ACT_WINDOW_MASK )

Nit: Parentheses again please around the operands of &.

> +        return -EINVAL;
> +
> +    /* Only allow values if params bit is set. */
> +    if ( (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_DESIRED) &&
> +          set_cppc->desired) ||
> +         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_MINIMUM) &&
> +          set_cppc->minimum) ||
> +         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_MAXIMUM) &&
> +          set_cppc->maximum) ||
> +         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ENERGY_PERF) &&
> +          set_cppc->energy_perf) ||
> +         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ACT_WINDOW) &&
> +          set_cppc->activity_window) )
> +        return -EINVAL;
> +
> +    /* Clear out activity window if lacking HW supported. */
> +    if ( (set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ACT_WINDOW) &&
> +         !feature_hwp_activity_window ) {
> +        set_cppc->set_params &= ~XEN_SYSCTL_CPPC_SET_ACT_WINDOW;
> +        cleared_act_window = true;
> +    }
> +
> +    /* Return if there is nothing to do. */
> +    if ( set_cppc->set_params == 0 )
> +        return cleared_act_window ? 0 : -EINVAL;

Is it really necessary to return an error when there's nothing to do?
We have various hypercalls which can degenerate to no-ops under
certain conditions, and which simply return success then.

> --- a/xen/drivers/acpi/pmstat.c
> +++ b/xen/drivers/acpi/pmstat.c
> @@ -400,6 +400,19 @@ static int set_cpufreq_para(struct xen_sysctl_pm_op *op)
>      return ret;
>  }
>  
> +static int set_cpufreq_cppc(struct xen_sysctl_pm_op *op)
> +{
> +    struct cpufreq_policy *policy = per_cpu(cpufreq_cpu_policy, op->cpuid);
> +
> +    if ( !policy || !policy->governor )
> +        return -EINVAL;
> +
> +    if ( !hwp_active() )
> +        return -EINVAL;

In both cases I again wonder in how far EINVAL is really appropriate.

> --- a/xen/include/public/sysctl.h
> +++ b/xen/include/public/sysctl.h
> @@ -351,6 +351,68 @@ struct xen_cppc_para {
>      uint32_t activity_window;
>  };
>  
> +/*
> + * Set CPPC values.
> + *
> + * Configure the parameters for CPPC.  Set bits in set_params control which
> + * values are applied.  If a bit is not set in set_params, the field must be
> + * zero.
> + *
> + * For HWP specifically, values must be limited to 0-255 or within
> + * XEN_SYSCTL_CPPC_ACT_WINDOW_MASK for activity window.  Set bits outside the
> + * range will be returned as -EINVAL.
> + *
> + * Activity Window may not be supported by the hardware.  In that case, the
> + * returned set_params will clear XEN_SYSCTL_CPPC_SET_ACT_WINDOW to indicate
> + * that it was not applied - though the rest of the values will be applied.
> + *
> + * There are a set of presets along with individual fields.  Presets are
> + * applied first, and then individual fields.  This allows customizing
> + * a preset without having to specify every value.
> + *
> + * The preset options values are as follows:
> + *
> + * preset      | minimum | maxium  | energy_perf
> + * ------------+---------+---------+----------------
> + * powersave   | lowest  | lowest  | powersave (255)
> + * ------------+---------+---------+----------------
> + * balance     | lowest  | highest | balance (128)
> + * ------------+---------+---------+----------------
> + * performance | highest | highest | performance (0)
> + *
> + * desired and activity_window are set to 0, hardware selected.
> + */
> +struct xen_set_cppc_para {
> +#define XEN_SYSCTL_CPPC_SET_MINIMUM              (1U << 0)
> +#define XEN_SYSCTL_CPPC_SET_MAXIMUM              (1U << 1)
> +#define XEN_SYSCTL_CPPC_SET_DESIRED              (1U << 2)
> +#define XEN_SYSCTL_CPPC_SET_ENERGY_PERF          (1U << 3)
> +#define XEN_SYSCTL_CPPC_SET_ACT_WINDOW           (1U << 4)
> +#define XEN_SYSCTL_CPPC_SET_PRESET_MASK          0xf0000000
> +#define XEN_SYSCTL_CPPC_SET_PRESET_NONE          0x00000000
> +#define XEN_SYSCTL_CPPC_SET_PRESET_BALANCE       0x10000000
> +#define XEN_SYSCTL_CPPC_SET_PRESET_POWERSAVE     0x20000000
> +#define XEN_SYSCTL_CPPC_SET_PRESET_PERFORMANCE   0x30000000

As corrections for the respective Misra rule are in the process of
being merged, please add U suffixes here (at the very least on the
_MASK).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 13:09:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 13:09:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563152.880182 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJw49-0004Ed-Cu; Thu, 13 Jul 2023 13:09:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563152.880182; Thu, 13 Jul 2023 13:09:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJw49-0004EW-9P; Thu, 13 Jul 2023 13:09:05 +0000
Received: by outflank-mailman (input) for mailman id 563152;
 Thu, 13 Jul 2023 13:09:03 +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 <SRS0=0tL6=C7=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJw47-0004EP-Gp
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 13:09:03 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on060a.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::60a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6f691731-217e-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 15:09:01 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM7PR04MB6933.eurprd04.prod.outlook.com (2603:10a6:20b:10d::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Thu, 13 Jul
 2023 13:08:59 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Thu, 13 Jul 2023
 13:08:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6f691731-217e-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=EgMW0twK4Kmt7AK5PYyrDX5/Js0krtQ5U55SKrpY3p0WjKoVLnP8oeYbxdHxbsyLLu5Ivicsvk2VdSu5rH/zpNhOCAloJrUfbJk+/Nh6OwHRJkSxKnGImRfs5siZtFu13i3q6sp1xpixyXaKjYj3E0LE86wAc8HJMgJ7tmH+o1WwoQ9/fddbI6DOTrUsGSNF4au0TA/R2nl9P1VXzV4XR95NNVXXfXYmaalFlXaVt50pEDFxSLpfcci5IrNZH4glL3EcTnWhWguuLwsOoQWARS3SROHcMByzwJrDfdd6f3XWfgoorbTIEodXEFmOKLJeWTm3wR4zaU5OT43NG3XAdA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=cRGt5nOPXknVEwGQlNXG3ZB3qCaI9fOSOZb+oc2CknQ=;
 b=ghu0LQPwrfRKrYy24FeoaiIqzrPV3WQ/eR23RTihHY3zpPMex788ppZFknCcLNbZib06K1BVcbps0zQ971G7MiiHw7PskIeyA5b7rjzhUDmO4ac4YVz4HduJKEw4O+WU05t8q5A39OoPD7yv7pmpj0gG8afKzQPts1gJw6JFnFyVaFbZI26ZQncdRolkTx3qCVYThIUAVEyPnvi6GEUIbhYMbeXsp6gORxIiH0bS1VCcr3DjhcO+LD56zjR9ezpAAQvbLatnN8XHD16SV3NtTLD7cWq14F67d03Q5F2uuc6j7hXVyR6hJyqM2NHG+m8zHFMZR0try4sWhOFkdstb7A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=cRGt5nOPXknVEwGQlNXG3ZB3qCaI9fOSOZb+oc2CknQ=;
 b=AbtwiNeuRI3qc8F6A3Qkkm+HdkLEl6xjvojbfSeGYzdDOR9ZLc1grgXzfhz9ApvM2qiNI2AYgM7P4xrcj39S3yVFfcigj2Lb544oe5+34iirjA7EkFSdIsLlpUaI7Erh3IFT1excKdOvgbjDyKrdSTZOqwCasQKB7kjAwzxsZ5c8I5wqB1FS0TJyRyWQFBMrj6HFNHtH6ZhZq6uKJAcy8yzbEJi2J4yGW21gvVVhZEPZG7vhNnE7XfN9hn0NCYx7NyBsrxTNg6MI8YTs00ss+KjrQpRUwJeDq8vwblrBssbNy8qYv/yqui13/wxJtm9dJTK7/QJ4MFLttzjcJceYgw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <5a3664ef-6b58-cefd-ba42-f4b70da348b0@suse.com>
Date: Thu, 13 Jul 2023 15:08:56 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 1/3] x86/APIC: include full string with
 error_interrupt() error messages
Content-Language: en-US
To: Elliott Mitchell <ehem+xen@m5p.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1689191941.git.ehem+xen@m5p.com>
 <062ed51e7529d282b6e336c8b62734afaf21979f.1689191941.git.ehem+xen@m5p.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <062ed51e7529d282b6e336c8b62734afaf21979f.1689191941.git.ehem+xen@m5p.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0168.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b4::17) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM7PR04MB6933:EE_
X-MS-Office365-Filtering-Correlation-Id: 34201bfc-6831-4f6b-3c9f-08db83a25222
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	4EPrmHdeRKNJ9amwglQL8hK1KhIGFBesNNc3Q/pjttb1BnWP92wHD3joVDyW7aJpmRqKc3WVNAR0F/xArI4p+4ijp1XnGExr3j/mJBbI4Xk5LAqyerjXtZws6p8ZNUh8vDxrpLweZZljVFBp6Z711Aeay6rhmyUow1sR2DExkgzY5oCIT323vHht3kG3OlNAUvF+hqPDi3dvrDcq6vHuhrATDjeiIQWXoYBNfYZPrvz0V28bv2TW4izmI00TPXqL5FeNM8OvnyIKZnbSWEbOSKej2jcyevD64GKbXtamQHsXvbB1n1TFzpbfTy92HTZGaEXh8LvcDEd0w6PgBXC6+CCrfYBWgsY03mJbsHBsYP52T+lyirX57btr22ZwO4DfnMrkcO/HDBtsh6C6Rp1H+SZnm8bGCKi/cnQec4HcKMo3OnYyLsyshlDIwL1gZMFJNDL7CSQlFT1PU4kEk15WOXVkbVWf2FEOq+m1YgF2Z5IQUrrSG43Rkc9EHBbppYIIrM3/RAiZyJka5IOsNuvOqd3ZY++4vUpBb4sgA3uOwrySIOchNISTiPLGPIm6ulflGgG20A86CVJrsywoBcJeHC/6JvE2j19iZZzG2Br6jLGYDE82CcDZTxR4E/4TUwDQRiPaWWUKKpJ2jPA0uML7UQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(136003)(396003)(39860400002)(346002)(451199021)(54906003)(31686004)(41300700001)(2616005)(2906002)(5660300002)(186003)(36756003)(26005)(8676002)(8936002)(53546011)(316002)(6506007)(66556008)(66476007)(38100700002)(4326008)(66946007)(31696002)(6486002)(86362001)(6512007)(478600001)(6666004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NjdkTERrMWxKcGVxVHdZQXpBaXdxQnJUUXAreFVBd2NmcFp5d0o2emZBU0Rk?=
 =?utf-8?B?b3Z0VldTZHc2VTFLbi83NGorRTRZQ2t1a25RMGQyVWN5SktUWFlIdHNROUIy?=
 =?utf-8?B?MXczajcvWGRkTkJuZWptcTBTeXo1a3Q2bUh3cUJpTXFpNjczTDQ0LzZrRHh5?=
 =?utf-8?B?WEZadXNIOTFUZzkyeGhlWjgvYS9IRFIxUzVIZXJ4dXQ4MUZnOEF0dlByRFM4?=
 =?utf-8?B?MFNkUmEzcTJvQWlqc2hoQWZ5SGtmWEZUeklUS2d3S2dLOWFZWEVsdnZ0dXFi?=
 =?utf-8?B?bXp5a1o4VjV3VHNJZHRkWFQvYjZ0Ny9zVWRNTm8ycEtYS3dhTFo3dk9zRGdh?=
 =?utf-8?B?RjZ6U0JabythZDFNY1pCaHRjMUl0QnVXbXhGaGRPUGduZW9WZEpNUVliNEI5?=
 =?utf-8?B?V2V2YkVpUlFkeHAwYjRySGpLRmNROGc1L2paQm9JWlVzbk4vY2lhQnA0dUxZ?=
 =?utf-8?B?a0txc1RrWU9zUzM4MU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AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 13:08:58.9900
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 8SOsjkaxaVvYI8IHE8nX3IbRL7b2miv7UdYRKOmgGueX8MaFeK91EFFAmzP/tUOsVoDyzVfOk0k2yQLK3/DtEQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6933

On 17.03.2023 20:45, Elliott Mitchell wrote:
> Rather than adding ", " with each printf(), simply include them in the
> string initially.  This allows converting to strlcat() or other methods
> which strictly concatenate, rather than formatting.
> 
> Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

Nevertheless I wonder ...

> --- a/xen/arch/x86/apic.c
> +++ b/xen/arch/x86/apic.c
> @@ -1401,14 +1401,14 @@ static void cf_check spurious_interrupt(struct cpu_user_regs *regs)
>  static void cf_check error_interrupt(struct cpu_user_regs *regs)
>  {
>      static const char *const esr_fields[] = {
> -        "Send CS error",
> -        "Receive CS error",
> -        "Send accept error",
> -        "Receive accept error",
> -        "Redirectable IPI",
> -        "Send illegal vector",
> -        "Received illegal vector",
> -        "Illegal register address",
> +        ", Send CS error",
> +        ", Receive CS error",
> +        ", Send accept error",
> +        ", Receive accept error",
> +        ", Redirectable IPI",
> +        ", Send illegal vector",
> +        ", Received illegal vector",
> +        ", Illegal register address",
>      };
>      unsigned int v, v1;
>      int i;
> @@ -1423,7 +1423,7 @@ static void cf_check error_interrupt(struct cpu_user_regs *regs)
>              smp_processor_id(), v , v1);
>      for ( i = 7; i >= 0; --i )
>          if ( v1 & (1 << i) )
> -            printk(", %s", esr_fields[i]);
> +            printk("%s", esr_fields[i]);

... whether the extra level of indirection (by using %s) is then still
necessary: There are no % characters in any of the individual strings.
Then again iirc this goes away anyway in the next patch ...

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 13:13:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 13:13:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563155.880191 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJw7z-0005fa-SF; Thu, 13 Jul 2023 13:13:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563155.880191; Thu, 13 Jul 2023 13:13:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJw7z-0005fT-PU; Thu, 13 Jul 2023 13:13:03 +0000
Received: by outflank-mailman (input) for mailman id 563155;
 Thu, 13 Jul 2023 13:13:02 +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 <SRS0=0tL6=C7=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJw7y-0005fK-FG
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 13:13:02 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20620.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::620])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fd9ff272-217e-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 15:13:00 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by DU2PR04MB9114.eurprd04.prod.outlook.com (2603:10a6:10:2f5::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24; Thu, 13 Jul
 2023 13:12:58 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Thu, 13 Jul 2023
 13:12:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fd9ff272-217e-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=gdP+J5eNOns6j1+OWdZ2qY/7f7yVb+nzLnw4YYzoVcwdG5D/JJ6Y64YjDGMD3sBmFop6L/l/b0IdvKJEV/hLy1YkTNRiCQCFyl+YoSS7odxiASMtHZKFAHK0H4W8Nrtsp+Y3B7Ahl9+CcrNbTERXihVA6KAaeBtqif8+3JLvh1yBv9CL/3SaweN1jFmciIk789sUJvNlFHt26EkLTxM9nh/OvF7zOCTbmd80vRP+WTNg3Rx4EiGAugvbgFEMfYbxrjCkn3DZFn+Bzj0DaKktIXh/kKYaybS6k9sNk4rjXHoAOq9Gxvq+xFORjx9cqsrV6Tfc39PGB5iCk1UrTFJ/7A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=q0BYXk1Yk4nLEnI1bExbCgN5JYJ0yDm2Or9qYtttFtU=;
 b=U7+T5MsvHkkTJ2zz7WRjRftp3bV6xzWkBb0bEU2XU0uu1Pm8hMRTXRquctckEiGeT65knV08uWDGabQwq1/BzVC1m7MLYUMl1aS7s3oLF3r3fW1hVs/M74yoy6L4VktLdV/DRZA/WKHGXlI5u6QkixvHwbmhytiwBLnrD1PTJzLaFmuIkDjTwvL83/a6O4buN+abiVOZbOCdz5DFr550EfPqZWfbMlZ2OM1M8L5bplii1J/rfwOj8HjKE9zH6dDZgyQyhf6hh49a273U3ti79D05ItPY77gBAFJKJMx0tVlN9Hb6/eIGBObHee0Rh9iv1MZo4zby/kts0cRQg7lAhw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=q0BYXk1Yk4nLEnI1bExbCgN5JYJ0yDm2Or9qYtttFtU=;
 b=G5spflWqUE+vN3e2G+WYLqdTd3Xlwi3pGhPLWc5HLTV0NQhiBGrsORE/BlrrUKsa8l21d3SxCiHTkL0Bk63HyicSVtxtC248zqHHVjgMem6ekp7Fhyi3sNtAgJiDjJwHB60RgL4pZc6DtoxPdfN7laD/LyCd44AZuo/mUhfpUeKFVC49Q/P4P4jdb3KJgwOej8fo56P2gu4k2fnwsD2hVFWqT4yVGEXrm5fS3anv6Dz9yRzxVI5IJEoSs93NgaUN3tF6juD0iFfWbTXlOlTML5Oq0VwOG5HhVv1+uCYgEj+R8xWYj/IVxaCptCDbfCR1Mfk0ZblEqBst+amfR/g9fQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3b16e1d8-acfb-8dd4-763b-57908ea6a2a1@suse.com>
Date: Thu, 13 Jul 2023 15:12:55 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 2/3] x86/APIC: modify error_interrupt() to output using
 single printk()
Content-Language: en-US
To: Elliott Mitchell <ehem+xen@m5p.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1689191941.git.ehem+xen@m5p.com>
 <7771343b52e6769d7670ad73094f5276025a10fe.1689191941.git.ehem+xen@m5p.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <7771343b52e6769d7670ad73094f5276025a10fe.1689191941.git.ehem+xen@m5p.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0039.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:48::22) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DU2PR04MB9114:EE_
X-MS-Office365-Filtering-Correlation-Id: 8bfb5aee-867a-4d09-2cb3-08db83a2e0b6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	JLm8r/4UUj2bv2Tt/b7YEhW25GihVzptf4gYM8RqXeASxb0C9FIFTYp/qP07eskp+NSx4kgQQk540+xx27P5WWp9dHYflty3wPUvG8NGILVROFyg06CdxTzr4JWxX5UjhmmJH+4bT/GxdxAIxgjcKB4cTes45nc8LWRQC26+H1GAFYWQNEgGAVRCA/Rm61L9yotfPiBVCAxRMAkHuDu6BDLaAOxw+ulfOA/Wr0Q/IcreWQS2YEk7zItozecqiHCBXYQaaKenK0U3Yocyd5A1q06PgSKOEDpY83D6mz2gENdzbRQPT4YYBh2Msrfcpo4DJOReDW2h5zpqBxPyR6uKyv1BIap6gL/LCUf20NW1jKGXax961dFQDQU+LyFx4GmsjXwkN9437v5hCH8ThW5ppiM2y5TXYz51chrg8BryvAlQhU9fK2YjjrIlZd5THkkX3ZTfV/IXUkoiGtTzGqg8DrOp+4fahHtyuaFiVsC6hg8H5a0oVTt6AEfK4eTghnFuR2E4ssk4ShCBfiTzw8/xlWwnpocDoFnRYLpt3h0RojHCTXx6yOaMi6maxGgoIsY0ael1p3AMgfKe8EnHy4lbdSmj9eTvSqiPG1CYcYD7Qa/eiNn24YL7ARZMYpzuotWZT1oKFyIYtsQI3vBqdFox2w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(396003)(136003)(39860400002)(366004)(451199021)(478600001)(31686004)(54906003)(66946007)(4326008)(2906002)(5660300002)(316002)(41300700001)(8676002)(6666004)(8936002)(66556008)(66476007)(6512007)(6486002)(26005)(6506007)(53546011)(38100700002)(186003)(2616005)(36756003)(86362001)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MGtHNHlDWTdDcHphV3poV1h2eUhJY2x4NkZMSXJGdzd0NTduYThlcGxOQy85?=
 =?utf-8?B?T1hxbzdQOXkyUXNvb0pMZ0xVQ3dVSFlvQytEZE1udUoyaTY0VWlhV1F2c2lr?=
 =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utf-8?B?ZnRQZG85bURXQ0hObUR3VEhKVm5MVm1EQ3N4eW1ueFIrTm1sN0xkelJLRTlL?=
 =?utf-8?B?TnNxd2pNOTlXQi9wYjRka3BrQnBVSDFUa0pjd3FBSmxidUlWZlErUzlQT3di?=
 =?utf-8?B?ZWhaNEh2am8zYU9PODRFK1phcmJKKzFyME5vNXVTdW92MzVzeDRpMFVVMmJz?=
 =?utf-8?B?L0JMQVdlNWNSMzcxdFJlUWMzVzkzU1NnNUtkNlB1QXNLUUNKeVZVZ1lrVUNp?=
 =?utf-8?Q?3E/tOHt2WjX1ex8crOcIxvQKf?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8bfb5aee-867a-4d09-2cb3-08db83a2e0b6
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 13:12:58.1785
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: LqYN+bL/2BNxidrJL6w3+pdhgFWBdhbuOUH56YjpNnxAtcaY2Wzlw5MmQUagzhX5K8VHJIl8MMFKUNaRKfXt0w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9114

On 17.03.2023 20:53, Elliott Mitchell wrote:
> --- a/xen/arch/x86/apic.c
> +++ b/xen/arch/x86/apic.c
> @@ -1410,6 +1410,7 @@ static void cf_check error_interrupt(struct cpu_user_regs *regs)
>          ", Received illegal vector",
>          ", Illegal register address",
>      };
> +    const char *entries[ARRAY_SIZE(esr_fields)];
>      unsigned int v, v1;
>      int i;
>  
> @@ -1419,12 +1420,13 @@ static void cf_check error_interrupt(struct cpu_user_regs *regs)
>      v1 = apic_read(APIC_ESR);
>      ack_APIC_irq();
>  
> -    printk(XENLOG_DEBUG "APIC error on CPU%u: %02x(%02x)",
> -            smp_processor_id(), v , v1);
>      for ( i = 7; i >= 0; --i )
> -        if ( v1 & (1 << i) )
> -            printk("%s", esr_fields[i]);
> -    printk("\n");
> +        entries[i] = v1 & (1 << i) ? esr_fields[i] : "";
> +    printk(XENLOG_DEBUG "APIC error on CPU%u: %02x(%02x)"
> +        "%s%s%s%s%s%s%s%s" "\n",
> +        smp_processor_id(), v , v1,
> +        entries[7], entries[6],
> +        entries[5], entries[4], entries[3], entries[2], entries[1], entries[0]);

While pre-existing in both cases, two nits: There's a stray blank before one
of the commas, and indentation is wrong too.

Furthermore there's no reason to split the format string, especially not
ahead of the \n. Plus line wrapping for the 8 entries[] references could
also be done more evenly.

Since these are all cosmetic, I guess I'll do adjustments while committing:
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 13:14:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 13:14:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563150.880202 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJw95-0006GQ-9d; Thu, 13 Jul 2023 13:14:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563150.880202; Thu, 13 Jul 2023 13:14:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJw95-0006GJ-6o; Thu, 13 Jul 2023 13:14:11 +0000
Received: by outflank-mailman (input) for mailman id 563150;
 Thu, 13 Jul 2023 13:05:54 +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
 <SRS0=MlyT=C7=pengutronix.de=ukl@srs-se1.protection.inumbo.net>)
 id 1qJw14-00048d-Sv
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 13:05:54 +0000
Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de
 [2001:67c:670:201:290:27ff:fe1d:cc33])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fed1a7e7-217d-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 15:05:52 +0200 (CEST)
Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2])
 by metis.ext.pengutronix.de with esmtps
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJvzH-0005FV-62; Thu, 13 Jul 2023 15:04:03 +0200
Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de)
 by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJvyt-00E7bY-FX; Thu, 13 Jul 2023 15:03:39 +0200
Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJvys-004Ym0-J0; Thu, 13 Jul 2023 15:03:38 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fed1a7e7-217d-11ee-8611-37d641c3527e
Date: Thu, 13 Jul 2023 15:03:37 +0200
From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
To: Sean Paul <seanpaul@chromium.org>
Cc: Jani Nikula <jani.nikula@intel.com>,
	Heiko =?utf-8?Q?St=C3=BCbner?= <heiko@sntech.de>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
	Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
	dri-devel@lists.freedesktop.org,
	Vandita Kulkarni <vandita.kulkarni@intel.com>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Arun R Murthy <arun.r.murthy@intel.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Liu Shixin <liushixin2@huawei.com>,
	linux-samsung-soc@vger.kernel.org,
	Samuel Holland <samuel@sholland.org>,
	Matt Roper <matthew.d.roper@intel.com>,
	Wenjing Liu <wenjing.liu@amd.com>,
	Javier Martinez Canillas <javierm@redhat.com>,
	Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
	Danilo Krummrich <dakr@redhat.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	spice-devel@lists.freedesktop.org,
	Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
	linux-sunxi@lists.linux.dev, Stylon Wang <stylon.wang@amd.com>,
	Tim Huang <Tim.Huang@amd.com>,
	Suraj Kandpal <suraj.kandpal@intel.com>,
	=?utf-8?B?QW5kcsOp?= Almeida <andrealmeid@igalia.com>,
	Andi Shyti <andi.shyti@linux.intel.com>,
	Yifan Zhang <yifan1.zhang@amd.com>, Leo Li <sunpeng.li@amd.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	Inki Dae <inki.dae@samsung.com>, Hersen Wu <hersenxs.wu@amd.com>,
	Jessica Zhang <quic_jesszhan@quicinc.com>,
	Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
	Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
	=?utf-8?Q?=C5=81ukasz?= Bartosik <lb@semihalf.com>,
	Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
	Andrew Jeffery <andrew@aj.id.au>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Noralf =?utf-8?Q?Tr=C3=B8nnes?= <noralf@tronnes.org>,
	kernel@pengutronix.de, Alex Deucher <alexander.deucher@amd.com>,
	freedreno@lists.freedesktop.org,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	Zack Rusin <zackr@vmware.com>, Gerd Hoffmann <kraxel@redhat.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org,
	Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
	=?utf-8?B?Sm9zw6k=?= Roberto de Souza <jose.souza@intel.com>,
	virtualization@lists.linux-foundation.org,
	Thierry Reding <thierry.reding@gmail.com>,
	Yongqin Liu <yongqin.liu@linaro.org>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Fei Yang <fei.yang@intel.com>,
	Ville =?utf-8?B?U3lyasOkbMOk?= <ville.syrjala@linux.intel.com>,
	David Lechner <david@lechnology.com>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
	David Francis <David.Francis@amd.com>,
	Aaron Liu <aaron.liu@amd.com>,
	Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
	Vinod Polimera <quic_vpolimer@quicinc.com>,
	linux-rockchip@lists.infradead.org, Fangzhi Zuo <jerry.zuo@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
	Ben Skeggs <bskeggs@redhat.com>,
	Jouni =?utf-8?B?SMO2Z2FuZGVy?= <jouni.hogander@intel.com>,
	Dave Airlie <airlied@redhat.com>, linux-mips@vger.kernel.org,
	Gurchetan Singh <gurchetansingh@chromium.org>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-arm-msm@vger.kernel.org,
	Animesh Manna <animesh.manna@intel.com>,
	linux-renesas-soc@vger.kernel.org,
	Maxime Ripard <mripard@kernel.org>,
	Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	linux-amlogic@lists.infradead.org, Evan Quan <evan.quan@amd.com>,
	Michal Simek <michal.simek@amd.com>,
	linux-arm-kernel@lists.infradead.org, Sean Paul <sean@poorly.run>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Qingqing Zhuo <qingqing.zhuo@amd.com>,
	Sandy Huang <hjc@rock-chips.com>,
	Swati Sharma <swati2.sharma@intel.com>,
	John Stultz <jstultz@google.com>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Drew Davenport <ddavenport@chromium.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>,
	Haneen Mohammed <hamohammed.sa@gmail.com>,
	Anusha Srivatsa <anusha.srivatsa@intel.com>,
	Dan Carpenter <error27@gmail.com>,
	Karol Herbst <kherbst@redhat.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	linux-hyperv@vger.kernel.org, Stefan Agner <stefan@agner.ch>,
	Melissa Wen <melissa.srw@gmail.com>,
	=?utf-8?B?TWHDrXJh?= Canal <mairacanal@riseup.net>,
	Luca Coelho <luciano.coelho@intel.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Likun Gao <Likun.Gao@amd.com>, Sam Ravnborg <sam@ravnborg.org>,
	Alain Volmat <alain.volmat@foss.st.com>,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Deepak Rawat <drawat.floss@gmail.com>, Chen-Yu Tsai <wens@csie.org>,
	Joel Stanley <joel@jms.id.au>,
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
	Harry Wentland <harry.wentland@amd.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Alan Liu <haoping.liu@amd.com>, Philip Yang <Philip.Yang@amd.com>,
	Lyude Paul <lyude@redhat.com>, intel-gfx@lists.freedesktop.org,
	Alison Wang <alison.wang@nxp.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Gustavo Sousa <gustavo.sousa@intel.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Mikko Perttunen <mperttunen@nvidia.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
	Tomi Valkeinen <tomba@kernel.org>, Deepak R Varma <drv@mailo.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Chia-I Wu <olvaffe@gmail.com>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Tian Tao <tiantao6@hisilicon.com>, Shawn Guo <shawnguo@kernel.org>,
	Christian =?utf-8?B?S8O2bmln?= <christian.koenig@amd.com>,
	Khaled Almahallawy <khaled.almahallawy@intel.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	Emma Anholt <emma@anholt.net>,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Imre Deak <imre.deak@intel.com>, Liviu Dudau <liviu.dudau@arm.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Roman Li <roman.li@amd.com>, Paul Cercueil <paul@crapouillou.net>,
	Rob Clark <robdclark@gmail.com>,
	Hamza Mahfooz <hamza.mahfooz@amd.com>,
	David Airlie <airlied@gmail.com>, Marek Vasut <marex@denx.de>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	xen-devel@lists.xenproject.org, Guchun Chen <guchun.chen@amd.com>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
	Russell King <linux@armlinux.org.uk>,
	Uma Shankar <uma.shankar@intel.com>,
	Mika Kahola <mika.kahola@intel.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Jiasheng Jiang <jiasheng@iscas.ac.cn>,
	Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Vinod Govindapillai <vinod.govindapillai@intel.com>,
	linux-tegra@vger.kernel.org,
	Marek =?utf-8?B?T2zFocOhaw==?= <marek.olsak@amd.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	=?utf-8?Q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= <samsagax@gmail.com>,
	Melissa Wen <mwen@igalia.com>, Hans de Goede <hdegoede@redhat.com>,
	linux-mediatek@lists.infradead.org,
	Fabio Estevam <festevam@gmail.com>,
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	David Tadokoro <davidbtadokoro@usp.br>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
	Orson Zhai <orsonzhai@gmail.com>, amd-gfx@lists.freedesktop.org,
	Jyri Sarha <jyri.sarha@iki.fi>,
	Yannick Fertre <yannick.fertre@foss.st.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Philippe Cornu <philippe.cornu@foss.st.com>,
	Daniel Vetter <daniel@ffwll.ch>, Wayne Lin <Wayne.Lin@amd.com>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Nirmoy Das <nirmoy.das@intel.com>, Lang Yu <Lang.Yu@amd.com>,
	Lucas Stach <l.stach@pengutronix.de>
Subject: Re: [Freedreno] [PATCH RFC v1 00/52] drm/crtc: Rename struct
 drm_crtc::dev to drm_dev
Message-ID: <20230713130337.fd2l67r23g2irifx@pengutronix.de>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com>
 <CAOw6vbLO_UaXDbTCtAQJgthXOUMPqEV+c2MQhP-1DuK44OhGxw@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="5p2oc3dth3vpey32"
Content-Disposition: inline
In-Reply-To: <CAOw6vbLO_UaXDbTCtAQJgthXOUMPqEV+c2MQhP-1DuK44OhGxw@mail.gmail.com>
X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2
X-SA-Exim-Mail-From: ukl@pengutronix.de
X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false
X-PTX-Original-Recipient: xen-devel@lists.xenproject.org


--5p2oc3dth3vpey32
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

hello Sean,

On Wed, Jul 12, 2023 at 02:31:02PM -0400, Sean Paul wrote:
> I'd really prefer this patch (series or single) is not accepted. This
> will cause problems for everyone cherry-picking patches to a
> downstream kernel (LTS or distro tree). I usually wouldn't expect
> sympathy here, but the questionable benefit does not outweigh the cost
> IM[biased]O.

I agree that for backports this isn't so nice. However with the split
approach (that was argumented against here) it's not soo bad. Patch #1
(and similar changes for the other affected structures) could be
trivially backported and with that it doesn't matter if you write dev or
drm (or whatever name is chosen in the end); both work in the same way.

But even with the one-patch-per-rename approach I'd consider the
renaming a net win, because ease of understanding code has a big value.
It's value is not so easy measurable as "conflicts when backporting",
but it also matters in say two years from now, while backporting
shouldn't be an issue then any more.

Thanks for your input, best regards
Uwe

--=20
Pengutronix e.K.                           | Uwe Kleine-K=F6nig            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

--5p2oc3dth3vpey32
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmSv9igACgkQj4D7WH0S
/k6RYAf+Kb/OGUhX7UtaJ7F8lhh4A5MpdV0+zb8XHPmzkL4JlVB9wEVJC/FPN8Ls
d7eLHeVkntU9o11OhmTy2/1TYBfmcdz9eAte/ft+tAvD4DhDvUPySu9XvRYf1iov
ksEZynnx3l/QMc+WWmWc+3w7jN+LPiTg3ONEV2zyBDlx1VjCHUZSbmUsEM3o8NnW
2J2n4ghAkrSQ77hLo6RAshVhlbGx7jstgB7iuFZwsamrdDZSVscJBkclQtvSxLxI
BleN75F50zT+Gn8wdseapq9FCEZhz/l9JcpAW1IabKTU9puwfuVyUkBQ3qEpRLGB
GaDEUTla8XGImNxnIA6ElXmraX1ZqA==
=qokw
-----END PGP SIGNATURE-----

--5p2oc3dth3vpey32--


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 13:14:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 13:14:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563162.880212 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJw9Q-0006cL-HW; Thu, 13 Jul 2023 13:14:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563162.880212; Thu, 13 Jul 2023 13:14:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJw9Q-0006cC-EP; Thu, 13 Jul 2023 13:14:32 +0000
Received: by outflank-mailman (input) for mailman id 563162;
 Thu, 13 Jul 2023 13:14:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=0tL6=C7=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJw9P-0006Y7-GE
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 13:14:31 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2061c.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::61c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 33ba69d8-217f-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 15:14:31 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by DU2PR04MB9114.eurprd04.prod.outlook.com (2603:10a6:10:2f5::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24; Thu, 13 Jul
 2023 13:14:29 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Thu, 13 Jul 2023
 13:14:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 33ba69d8-217f-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=GCne/XI7ZWO6nCeEFpI+5YL8me8GRfPQxgSKDFAAGFhzWXe0lebxIbVdRAGUtZOROpO8FyikiyCFttDMXwhvK+OYhoGEehV18SrzLkFoneaVbbfzVwhzKY9ac64EpgLWm5a2SV470K9qMW20Dz2RbzBCGzFSL15vsIV6PS5THLh4X3Ul9S4gEUBxMo+JokHFUPGQWAmJYHeRFwoCRrBzewOxr2sV9Y6NgepzS4izPj6Dwa/asypmwrK+rHq0/h2BlQvLhgEYhMQt21T3pcF1RLFO3UmoyvRETHThxtIBwLKFZcp73m002brBdxrAJ9kzrCFo8EtmKRzHWaWkAB0Iog==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=QlZX91p8o+J8o6R9G8RODh9CdY9TAzoNfg11XvRDMjI=;
 b=L3fls1SME78uk8SNoRzOgkf9c95K2dgGqpNLOXSO0gv4Mt90R845G0uOOuMH86LD0p1BJWAWGWzeUdxmLJN1PU8pjqwuZ+hX0YZoHjmYzWbS7cnXOXjx+4tJf5vUamXVHNnGxK1Cl6mr61nXv6UwvyRDwLlAFat6VbXy58IJ0AyfEgXP52ofIMPJ9jAsyqnme2NhUmwMkXuWLVg/XTl27rH3iyik21ivtGT80h2LBJHR33L1+qCcKkyGWyqtBrEHkHhXkcJlGdaWS55YirUJQ7oDDilR/70FxugNjMBr+IGI8ILMmZq1TwL0qVQuHjWkq5Qmggq1QSyXFzkjvYoLgQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QlZX91p8o+J8o6R9G8RODh9CdY9TAzoNfg11XvRDMjI=;
 b=zBZziDsWhZjoU5Ne33Z0JV1hqAIDX9pl2XwfgFTTz+ryrJ0PAcxicw6RGYLkyYYNEKw4T9sysvGL2tNmumy2nAP+DJOq5H2FMFpCvLZgzKAPxteYxoxsuXWM9mRUe6g30JNpqfkUq/Tp3HHBV3RMhITgCFY/DWpXIU+7pPAJvsnCVuQqTqpcogRhYgyD+67odCqXGhkpWBp56IrfrzdpXCIS5KuKLpZySpb774HGK+403zOXRZ1rcY/MY1zG+ArKGzNkBJ1VbJybA7gz+HtspKXM5z/wGiuvJaphnaEoWaGA5a8q874oJlrw8Jk70lOQw5fWtVsvJP0VV5vBRM5h8Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <9338d641-5833-caed-ef3b-5653247287ad@suse.com>
Date: Thu, 13 Jul 2023 15:14:27 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 3/3] x86/APIC: adjustments to error_interrupt() loop
Content-Language: en-US
To: Elliott Mitchell <ehem+xen@m5p.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1689191941.git.ehem+xen@m5p.com>
 <880212ac370425389688f8b4fef2fd27c4fba446.1689191941.git.ehem+xen@m5p.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <880212ac370425389688f8b4fef2fd27c4fba446.1689191941.git.ehem+xen@m5p.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0157.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:99::18) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DU2PR04MB9114:EE_
X-MS-Office365-Filtering-Correlation-Id: 30d24798-8887-4a8a-8f48-08db83a31725
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	FpbznjFGz+778woaRLeV7UkyVKcKcaJZY8IonbWCJ1Rm7SVOSDQe7X/EhLnw8QMmatvGw2PMIbyTyhIZkZfYylTQlLJ+w5ciqQZDGhmOo9PspjAQB2col0rtItazaUfCkMEBob42vO1iUQPr+PZaE684ENyoAm8DijoiusDWA6MT1b4ng5FnioDJiu6clV7c01O6VTi//u6UEm+2zxe8UbqlCMgtYY4VARg1fM9Y4sN9BhxsAM1oczWcC8ncuZDLSmZlFdS5E8HCmkNcK2w0UJuucb5nsObQbIxcrhnCAK2Li2O23oDmQp5YdM1k5F402CiaH9JwxVV/eFLBQ8vZ+0dIKAd93H2ua6KT4sUXA9Az/NoxYWKUR/MyL8cUOk2XhMF5kAFAaSccCazQswhhEyn3K059YitoBFIeavd+yDhLfBvdi2S7aaLej5TUMH+iAqrd68RoQHW6yica5BW2E82/cBT/60MuIJW/D1EfR0SIS094e+WDL/fH5YUPXpMOd3JaIxu3cdpD2WXNQO2Izl0nyOWi978z5Bqvv3wGLKj5+WOyBphf+lQjl00l0SEciTV/ztEo7Q6apH0dBNPIV8fdbE3USbVt+tlCKLICl5WWOE/7lmmhQ+uBxQa5sFJD2m3megXZnSabDnJXcPiY9A==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(396003)(136003)(39860400002)(366004)(451199021)(478600001)(31686004)(54906003)(66946007)(4326008)(2906002)(5660300002)(316002)(41300700001)(8676002)(8936002)(66556008)(66476007)(6512007)(6486002)(26005)(6506007)(53546011)(38100700002)(186003)(2616005)(36756003)(86362001)(31696002)(558084003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?L3NDNXV3V253UXhoUjZ1clRGTklHNkxBRzI5eXZkdXVRMWpWK3VRWjcyWWNJ?=
 =?utf-8?B?YkpvZlg4Tnh6OHl6dDJMMzNudDJRS2dzejlVMmNYLzA4LzJ6eVVLR0QrbE5a?=
 =?utf-8?B?elhLazFLbVo4aG85NUxyT1pqUHc0R3ZtZFUyWG12eHRTSWJUcmhHM1NJNTVX?=
 =?utf-8?B?cWxRWFpJS1hkbGhxbDAxTHZSUmxuVTRaSHFiNjhLRFA5SnNzSGp5anVRVko0?=
 =?utf-8?B?QU1yOEZnbktWaWxBUUN2SUd1SVVQV2VYQ00xUVpqTWxhc2tlTzRkbjRacHRB?=
 =?utf-8?B?SklYUHJQNWpwZVdaVklkcE9pZkhmZWZvd0FBckovZUUrM2VkRU9wNlNmZzFs?=
 =?utf-8?B?cGFUWWFSOWw0ZVZ4TmFvQ1M2WWFGdzV4NWw3aGplK2xvc1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ardlYXH8H0vKNL5Pyu?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 30d24798-8887-4a8a-8f48-08db83a31725
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 13:14:29.6505
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: nVbWdAgi+btD5+WsHCgZmoeTEfmI2xPhY47SmEYqUk2qNfLuAnXn8xU645sDta4n8gQHf9JXDpKXEdhUAv7OFQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9114

On 17.03.2023 20:53, Elliott Mitchell wrote:
> ARRAY_SIZE() makes future maintainance easier and thus less likely for
> bugs to occur.
> 
> Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Thu Jul 13 13:19:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 13:19:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563167.880222 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJwEO-0007VH-4v; Thu, 13 Jul 2023 13:19:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563167.880222; Thu, 13 Jul 2023 13:19:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJwEO-0007VA-1d; Thu, 13 Jul 2023 13:19:40 +0000
Received: by outflank-mailman (input) for mailman id 563167;
 Thu, 13 Jul 2023 13:19:38 +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
 <SRS0=In0U=C7=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qJwEM-0007V4-Es
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 13:19:38 +0000
Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com
 [2a00:1450:4864:20::133])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e9e9b135-217f-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 15:19:36 +0200 (CEST)
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-4fa48b5dc2eso1249924e87.1
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 06:19:36 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 j23-20020ac24557000000b004f755b6ffcdsm1118718lfm.23.2023.07.13.06.19.35
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 13 Jul 2023 06:19:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e9e9b135-217f-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689254376; x=1691846376;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=ekp53NrB2fdpzrC5sxzIdHoUGPVY+3adxPPQjel8A3k=;
        b=LLALEiJ5JSSSRWAId5MidDk4A8YFE3p7/BluKSWJtq1uUl66V2L4I6Q/k747qXsX2A
         THt7JAYZohsesleJjztHVx2BGzeXne9UMBU5XHZPAdWVM267IUuFD3FtM1RtApddwEVO
         aTIWPykcYL1vrJs9ldjhrirPo4vGHyEu4eLeBxyQifSkCUrrcq+nOToKZwPY2kpPeVFY
         J6fAVktQ9HUn0ZqN+XfWRWRwQC0uJMH7Wyl9VUrQPnhLbql5pg7lOz1ek+SGfo/jYzWW
         JI0FYxOlD5HMlZg/J0XLRiUPECHDxROAApLmdI6Po6Rb4ttz5yejF3/LTQRkRudAmcgy
         IORw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689254376; x=1691846376;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=ekp53NrB2fdpzrC5sxzIdHoUGPVY+3adxPPQjel8A3k=;
        b=fMbao6CCWPgj1j9+vvMX4rkQw+bivwXpwDn9VTR1e1DpwomTQ6gaTQXDQPg/gDcDJ0
         4gpFuLZw+qT6ZXWH4ClmD9V6GADWy5dFIORN2lgL8e5goPitspCwDoxkqvbudHOF19Ty
         xdwECxj1BSJSmmHQSNheQ0MQMndmlcI07W45VhcxshNFnp7Vmv4ZreHmy81BxNRJlGr6
         vfGFxQhvyR5CSSBTzbrJ0MY/fTffjWJqME6fdhWnfaviSGn4P3Wx6K/g9Xv2lqpHGBhz
         DCpCjC2agr1wva1wUy9VYsq6NTfdva5jW4rAhPxKzZOlCHL+0QLZEo45PPkSPpzNIXaQ
         qqRQ==
X-Gm-Message-State: ABy/qLbNqlXoqFQdMpg5w21dVSaagD/Gb1DcZIG1ddTQPQELh0Zv8Xti
	284OK6tdTtFm76ly6mc6rSE=
X-Google-Smtp-Source: APBJJlEGt43PxyE4QjYYxtaCWVO4v8Kba2CW+RmLwpmLXTNDU6kNvalBLsKbwg5+nEp/iWeNmx8ASw==
X-Received: by 2002:ac2:4c86:0:b0:4fb:7772:7bae with SMTP id d6-20020ac24c86000000b004fb77727baemr1140218lfl.6.1689254375547;
        Thu, 13 Jul 2023 06:19:35 -0700 (PDT)
Message-ID: <86702f86787ee7b963b131c4b2d6db463eddc1f3.camel@gmail.com>
Subject: Re: [PATCH] ns1650: refactor interrupt handling in
 ns16550_uart_dt_init()
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap
 <george.dunlap@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
Date: Thu, 13 Jul 2023 16:19:34 +0300
In-Reply-To: <a385a17b-a60c-d770-e044-af64273371d6@suse.com>
References: 
	<cc5a08056abacdbb6d6509b56716eb45467307bb.1689240611.git.oleksii.kurochko@gmail.com>
	 <a385a17b-a60c-d770-e044-af64273371d6@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Thu, 2023-07-13 at 12:08 +0200, Jan Beulich wrote:
> On 13.07.2023 11:30, Oleksii Kurochko wrote:
> > --- a/xen/drivers/char/ns16550.c
> > +++ b/xen/drivers/char/ns16550.c
> > @@ -1791,8 +1791,16 @@ static int __init
> > ns16550_uart_dt_init(struct dt_device_node *dev,
> > =C2=A0=C2=A0=C2=A0=C2=A0 }
> > =C2=A0
> > =C2=A0=C2=A0=C2=A0=C2=A0 res =3D platform_get_irq(dev, 0);
> > -=C2=A0=C2=A0=C2=A0 if ( ! res )
> > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -EINVAL;
> > +=C2=A0=C2=A0=C2=A0 if ( res =3D=3D -1 )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printk("ns1650: polling wil=
l be used\n");
>=20
> Nit: Please don't omit one of the two 5-s here.
>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * There is the check =
'if ( uart->irq > 0 )' in
> > ns16550_init_postirq().
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * If the check is tru=
e then interrupt mode will be used
> > otherwise
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * ( when irq =3D 0 )p=
olling.
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */
>=20
> I wonder in how far that's actually correct outside of x86. On x86
> IRQ0 is
> always the timer interrupt, but I'm not convinced something similar
> can be
> used as kind of a heuristic on Arm, RISC-V, or basically any other
> architecture.
uart->irq is used as an interrupt number for ns16550 and according to
the code in ns16550_init_postirq() uart->irq should be > 0.
So there is safe to use 0 as a detector of polling as it won't be used
as an interrupt number for ns16550 itself.


~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 13:27:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 13:27:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563170.880232 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJwLn-0000Yf-U9; Thu, 13 Jul 2023 13:27:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563170.880232; Thu, 13 Jul 2023 13:27:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJwLn-0000YY-R6; Thu, 13 Jul 2023 13:27:19 +0000
Received: by outflank-mailman (input) for mailman id 563170;
 Thu, 13 Jul 2023 13:27:19 +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 <SRS0=0tL6=C7=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJwLn-0000Xv-1I
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 13:27:19 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2061d.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::61d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fc0b8113-2180-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 15:27:16 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM9PR04MB8793.eurprd04.prod.outlook.com (2603:10a6:20b:408::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 13 Jul
 2023 13:27:14 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Thu, 13 Jul 2023
 13:27:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fc0b8113-2180-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=fXLG172FLbs7dy8oeWrpxU16aAIYTwtVMHfSBr+mv97WSbbeCcgvNXkCU0a+XylE5Z+iBNJQEo1zdSrPA9XipH3B4SII3UNRNBWOT1USaLK07ZL7LzKIvoGa+VJOZVJ+drc0qWAXEC+uwGa3ucwqbHJ0z/pJqh0oOe3yZdhgnWJDYPXxi4s3Ul10IoLHbuRt43PXqs8uFn/rsbu5M60p08iENMLPyDcj6gToMjzGlkS9YgEYiCBK6Lw65Igyb8c2zzGqk2iD5PDLHHKut6pUWat9BjT+Mij5UI40T1E0jq0Ty5/2pdM3Q2sxy0b+5QichUFtfaXLpQlVgN0odGFb0A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=rVowdBeioNqE7rx3G1jPNX1b58+2dJY50H1U2ncgZbE=;
 b=gLM2huKPwnYZHeDn0MyhYoeY3/O5pSkfL0EodSVKVBRDRLgKHZL48bt4UhCRsEWvpJOT8FCeIpxilMqG+lt0HnYjFmM1/2F+C5tFr6X+cqQpoXsgCIjZMY/Y4ggFnJgxGfyXkfk16ZmT1hxLeEhnEgB3xpnPnz035t2YdNeQELGt+yOjw2TiG4TOgSUDUaNOFZSEdurQ65ekyQftQHs+L5zhNA+2FI55TjD8micKs7Sasjp9UR3naKmsWbHezaK9zMZvNmx5wTWbfUvkL2id4krVYhC0QKw2RWerTFEUxwNNoAR274OZLtAXIAbfv9kpewDYwmNKZ12HDcea9zTbpQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=rVowdBeioNqE7rx3G1jPNX1b58+2dJY50H1U2ncgZbE=;
 b=SFaxgHjHp3LLsLGDX467GOKUW8XuSkhFMJ+qWdSE++WbTSmmrWmA0JwJewrITSGjWxQmWjKRttkONWEb9as7L+03sETgXCdFAPAaxB/ZB9U4O2xWkmmPnlRkvljtTQs5I6LPIzWBCfSt4xP76gs8odOcYsdxNMuJHEuHh14RnaSd12Rfwkey7BrvC/dGBJ6GGm8uqGYhN2wHYenwThcfhzCDB+GREI5QgdcrvIgjzzc5kdlgbFSQsqePld+tN8zi/GhXAVMnzU/zBJO0q+Xzi051H2EfNkAVw6A8OGPPHZstUI3/R7XrW/Stz0hEj8y+lV0fAa5L9qw70cIBvgj9Kg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3e4c673d-1b8b-15ab-629f-27a9f687b37a@suse.com>
Date: Thu, 13 Jul 2023 15:27:12 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] ns1650: refactor interrupt handling in
 ns16550_uart_dt_init()
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org, Julien Grall <julien@xen.org>
References: <cc5a08056abacdbb6d6509b56716eb45467307bb.1689240611.git.oleksii.kurochko@gmail.com>
 <a385a17b-a60c-d770-e044-af64273371d6@suse.com>
 <86702f86787ee7b963b131c4b2d6db463eddc1f3.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <86702f86787ee7b963b131c4b2d6db463eddc1f3.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0125.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:97::20) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM9PR04MB8793:EE_
X-MS-Office365-Filtering-Correlation-Id: 701bde98-8ef3-44e1-d4cd-08db83a4decb
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	8IpBNehh5IZ7kmLdNNBWr6HQtimBnZgb/aqx1pelRdqw3+FP2XCFlze1pOx5Pbt8MjsDxnYl038YRhEI3gbc+/09eOATIAEYjoG2yU2R7emjnmRgUIz/bUxFtdYFDH0Ymwo1hRNS9ZmlEnmVZqof58GlaOVNy1L2hhlLnr/J77TfCrQHTUmxvooKHaHrScnCADCnWIimihGwqHDRYypxyNDktKzrY5sLtapee8MbFysUM6GnCOU9dE23ZDHv4dBLAi0h6WtoRk4ili7UbNwqHkwR7Ad2I4wnjtygmaJrGSHyMvpdV/f0UaIaR/XfnCBHrhLMj2kaiCKABfOxd0nWVx2LvtpWK5coIqUijGebv/GUPHPyJFefAu2cyZMO8LQnYLe9XX2ZDdTQggv98QGFdSGXPoQ41B2cUfNwlYYj5e4F4vJ3+/1zjB+cimx0Zk4Y5vQz/a5QKHy6mN54q/CAxcPmDWE746FpQxnsGMM5bybfAQy0Zcd6nlCFuMvqAuODYkFtRPzLNp2n/xNQtS1ICn/1ZfnVlu1qNOMb7fG+KGMeSGwRyBhYdU3RUE1Tzd62Yb08cEwc/7yNhEoAp0LZeyr07bqNfKixQvcXqdf98wCI5EZ1pNQ6KTFnoT7D4xCuVNCCQKMlOcd1DloL6Xfreg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(136003)(39860400002)(396003)(366004)(451199021)(6512007)(5660300002)(8676002)(8936002)(316002)(41300700001)(2906002)(83380400001)(31686004)(38100700002)(2616005)(6916009)(66946007)(66556008)(54906003)(66476007)(31696002)(86362001)(53546011)(26005)(186003)(4326008)(6486002)(478600001)(6506007)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?OTNBQzFXbnJleTBqUUg0VG9XYmdWaWNvbUhZZ2RtaFg0RitXamVyV3RvdTBC?=
 =?utf-8?B?Y0pEMUVjb3V4dHoySmxLYmpEbWl3a1V5eWtiU0VSM282YWlBYnY0eVZpTUtI?=
 =?utf-8?B?T3dWdE5WMGFMbCszTTNYRDR6My9xOTQ5MUd2RmkwZnFkM3BTNytXK3hLZEp3?=
 =?utf-8?B?US9XMFRMR3R0VGIzYWpidDB3QWpyWncvaUg1RXJOd25PQjNib3lWbHJEQ25E?=
 =?utf-8?B?S2NxWHdFZWZjemxZaWdETERxYXFPUVhUNURYc1duQkczaVJzN1dSc0l4bER1?=
 =?utf-8?B?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b1dZNFZkVVZB?=
 =?utf-8?B?M3JrM3pVL3A2VmVnR3BOWXJMT2lKbURDbmh3WkhHK3V0L3plVHVBRytsdjJh?=
 =?utf-8?Q?aG1Js3k3tfQfve3RN2ndBYEYg?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 701bde98-8ef3-44e1-d4cd-08db83a4decb
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 13:27:13.9731
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: c31Y0x3u6Xz+SOL4nUaRRKsNPQDAhobXq94U5Uxug0cWTADTGDfDaY3IjqiUyz+C8mdcwh36W/ZYUbvzzld4cA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8793

On 13.07.2023 15:19, Oleksii wrote:
> On Thu, 2023-07-13 at 12:08 +0200, Jan Beulich wrote:
>> On 13.07.2023 11:30, Oleksii Kurochko wrote:
>>> --- a/xen/drivers/char/ns16550.c
>>> +++ b/xen/drivers/char/ns16550.c
>>> @@ -1791,8 +1791,16 @@ static int __init
>>> ns16550_uart_dt_init(struct dt_device_node *dev,
>>> Â Â Â Â  }
>>> Â 
>>> Â Â Â Â  res = platform_get_irq(dev, 0);
>>> -Â Â Â  if ( ! res )
>>> -Â Â Â Â Â Â Â  return -EINVAL;
>>> +Â Â Â  if ( res == -1 )
>>> +Â Â Â  {
>>> +Â Â Â Â Â Â Â  printk("ns1650: polling will be used\n");
>>
>> Nit: Please don't omit one of the two 5-s here.
>>
>>> +Â Â Â Â Â Â Â  /*
>>> +Â Â Â Â Â Â Â Â  * There is the check 'if ( uart->irq > 0 )' in
>>> ns16550_init_postirq().
>>> +Â Â Â Â Â Â Â Â  * If the check is true then interrupt mode will be used
>>> otherwise
>>> +Â Â Â Â Â Â Â Â  * ( when irq = 0 )polling.
>>> +Â Â Â Â Â Â Â Â  */
>>
>> I wonder in how far that's actually correct outside of x86. On x86
>> IRQ0 is
>> always the timer interrupt, but I'm not convinced something similar
>> can be
>> used as kind of a heuristic on Arm, RISC-V, or basically any other
>> architecture.
> uart->irq is used as an interrupt number for ns16550 and according to
> the code in ns16550_init_postirq() uart->irq should be > 0.
> So there is safe to use 0 as a detector of polling as it won't be used
> as an interrupt number for ns16550 itself.

I don't understand. My earlier comment was affecting all checks of
uart->irq alike, as I'm unconvinced IRQ0 may not possibly be usable
on some architecture / platform. IOW I don't see why the check in
ns16550_init_postirq() would allow us any leeway.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 13:37:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 13:37:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563175.880242 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJwVV-0002B2-Un; Thu, 13 Jul 2023 13:37:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563175.880242; Thu, 13 Jul 2023 13:37:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJwVV-0002Av-Rm; Thu, 13 Jul 2023 13:37:21 +0000
Received: by outflank-mailman (input) for mailman id 563175;
 Thu, 13 Jul 2023 13:37:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=In0U=C7=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qJwVV-0002Ap-8L
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 13:37:21 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4acbb449-2182-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 15:36:38 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-4f95bf5c493so1275705e87.3
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 06:36:38 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 h12-20020ac2596c000000b004fbb011c9c7sm1120050lfp.162.2023.07.13.06.36.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 13 Jul 2023 06:36:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4acbb449-2182-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689255397; x=1691847397;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=BfgR5y98oK5asaUp7M81t2LiGzYaD1t1AQDY9HxBF+c=;
        b=Uc9HzGhYhdqlp4cNpJ3orGC/y0OxBiUhPNraCOJEPDnNaFQxnUl61gAk8xYShTd3vH
         a1TGI2isz+hSfYzTPlAxPd+u7wt8taONjxSun+LB+lB/H1X4cLUx641Dqwp+0TC83SN8
         WIdYtz9mgXaaQGii86NI9LK+TD4D6fUrzTGPP9Gs7psbtqycWSjhme1P5nUiGyMoRtXS
         k+kVdXRHeeoFb1jT5y8O3gWGJiJRa4akR4FrMgQz8R6B9CowGsIYJZEqsQD5fgwQzCuK
         vksBK8ix5iHI9tR6hgOHxJl85tto8OhFZsPgtaDZyznzohkdIxyPsvYwMEackfarXrdh
         zoHw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689255397; x=1691847397;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=BfgR5y98oK5asaUp7M81t2LiGzYaD1t1AQDY9HxBF+c=;
        b=jUCcs5tDUqiRR+W+1yZVcxAce7y9JHFSL8acel+2VydxW6Xjn9Tb4CBdexwjjlp06G
         P4PtRB76+DvxMX7Nl19z0uUOreGHvhMD4tFBgtDXsZnnvEYENckvwMjiu8UPEo2VdBAl
         tglRt5OL3SLKPT/dpJY4Gbf9O932NEQZEKjOG+cez8IgA6t6g86LL41LCZ9oPzrMjCUD
         tuWtTJEnRycOmosWuRawU3Db648r7G2zkllre9mLtkOb+C6PXoLmF2PhFbVyQ+CMy1M2
         /skNVCTKpxHI1J/ufYHhnvLok0NMasTAPOZN0eAoD+dSZ9TbEIfvgEQz0OcnMB/uE5ZQ
         o1oA==
X-Gm-Message-State: ABy/qLbMkrVKT/dCHUuh9QEp36Ve7rLkbCZCaM0apNQDFN40JRNyVMZj
	lDRn2keJuHZY2ZySj/X0vw4=
X-Google-Smtp-Source: APBJJlE5lyVy67bvtFDpMQYnzhDZ0Gx7jOb3PMQ4x/5IumypXSCQOrgNKXcoGGZHRj0j3Xg2h7b6dA==
X-Received: by 2002:ac2:55ac:0:b0:4f8:6d99:f4f3 with SMTP id y12-20020ac255ac000000b004f86d99f4f3mr1423225lfg.52.1689255397319;
        Thu, 13 Jul 2023 06:36:37 -0700 (PDT)
Message-ID: <83f67337cb69fb8cf2aa5d56b8a711384cdaa5f0.camel@gmail.com>
Subject: Re: [PATCH] ns1650: refactor interrupt handling in
 ns16550_uart_dt_init()
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap
 <george.dunlap@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org, Julien Grall
 <julien@xen.org>
Date: Thu, 13 Jul 2023 16:36:35 +0300
In-Reply-To: <3e4c673d-1b8b-15ab-629f-27a9f687b37a@suse.com>
References: 
	<cc5a08056abacdbb6d6509b56716eb45467307bb.1689240611.git.oleksii.kurochko@gmail.com>
	 <a385a17b-a60c-d770-e044-af64273371d6@suse.com>
	 <86702f86787ee7b963b131c4b2d6db463eddc1f3.camel@gmail.com>
	 <3e4c673d-1b8b-15ab-629f-27a9f687b37a@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Thu, 2023-07-13 at 15:27 +0200, Jan Beulich wrote:
> I don't understand. My earlier comment was affecting all checks of
> uart->irq alike, as I'm unconvinced IRQ0 may not possibly be usable
> on some architecture / platform. IOW I don't see why the check in
> ns16550_init_postirq() would allow us any leeway.
It looks like I misunderstood you.

Do you mean that on some architecture IRQ0 may be used for ns16550?

If yes, the code inside ns16550_init_postirq() will ignore that fact
and use polling mode.

~ Oleksii





From xen-devel-bounces@lists.xenproject.org Thu Jul 13 13:43:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 13:43:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563180.880252 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJwbc-0003dA-Jm; Thu, 13 Jul 2023 13:43:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563180.880252; Thu, 13 Jul 2023 13:43:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJwbc-0003d3-Fn; Thu, 13 Jul 2023 13:43:40 +0000
Received: by outflank-mailman (input) for mailman id 563180;
 Thu, 13 Jul 2023 13:43:39 +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
 <SRS0=Khrh=C7=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qJwbb-0003cx-Jb
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 13:43:39 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 44bb4138-2183-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 15:43:37 +0200 (CEST)
Received: from [192.168.1.101] (unknown [37.163.129.145])
 by support.bugseng.com (Postfix) with ESMTPSA id 460E84EE0739;
 Thu, 13 Jul 2023 15:43:36 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 44bb4138-2183-11ee-8611-37d641c3527e
Message-ID: <c07a096a-9089-f600-4acd-30ae4d929d5c@bugseng.com>
Date: Thu, 13 Jul 2023 15:43:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v2] x86: make function declarations consistent with
 definitions
Content-Language: en-US, it
To: Jan Beulich <jbeulich@suse.com>
Cc: consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <1b2d5be30c0e4f335e59dce6e7c001cb0805d702.1688465215.git.federico.serafini@bugseng.com>
 <a16cdb60-1307-636e-1473-e5388e8f79d9@suse.com>
From: Federico Serafini <federico.serafini@bugseng.com>
Organization: BUGSENG srl
In-Reply-To: <a16cdb60-1307-636e-1473-e5388e8f79d9@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 04/07/23 16:51, Jan Beulich wrote:
> On top of my earlier remark (when this was part of a series):
> 
>> --- a/xen/arch/x86/cpu/mcheck/x86_mca.h
>> +++ b/xen/arch/x86/cpu/mcheck/x86_mca.h
>> @@ -113,7 +113,7 @@ static inline int mcabanks_test(int bit, struct mca_banks* banks)
>>       return test_bit(bit, banks->bank_map);
>>   }
>>   
>> -struct mca_banks *mcabanks_alloc(unsigned int nr);
>> +struct mca_banks *mcabanks_alloc(unsigned int nr_mce_banks);
> 
> I'm not convinced here.
> 
>> --- a/xen/arch/x86/hvm/rtc.c
>> +++ b/xen/arch/x86/hvm/rtc.c
>> @@ -59,7 +59,7 @@ enum rtc_mode {
>>   static void rtc_copy_date(RTCState *s);
>>   static void rtc_set_time(RTCState *s);
>>   static inline int from_bcd(RTCState *s, int a);
>> -static inline int convert_hour(RTCState *s, int hour);
>> +static inline int convert_hour(RTCState *s, int raw);
> 
> Nor here.
> 
>> --- a/xen/arch/x86/include/asm/guest_pt.h
>> +++ b/xen/arch/x86/include/asm/guest_pt.h
>> @@ -422,7 +422,7 @@ static inline unsigned int guest_walk_to_page_order(const walk_t *gw)
>>   
>>   bool
>>   guest_walk_tables(const struct vcpu *v, struct p2m_domain *p2m,
>> -                  unsigned long va, walk_t *gw, uint32_t pfec,
>> +                  unsigned long va, walk_t *gw, uint32_t walk,
>>                     gfn_t top_gfn, mfn_t top_mfn, void *top_map);
> 
> While the definition's use of "walk" makes clear why the variable is
> named the way it is despite being used with PFEC_* constants, not
> naming it "pfec" here will add confusion, as the connection to those
> constants will be lost. One will then be forced to go look at the
> definition, when looking at the declaration ought to be sufficient.
> 
> I'm not going to look further, but instead repeat my suggestion to
> split this patch. Besides reducing the Cc list(s), that'll also
> help getting in parts which are uncontroversial (like e.g. the
> change to xen/arch/x86/hvm/vioapic.c).
> 
> Jan

Hello Jan.

In the three cases above,
do you think changing the definitions to match the declarations
might be a solution?

Regards
-- 
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 14:02:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 14:02:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563187.880261 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJwtT-0006Ds-39; Thu, 13 Jul 2023 14:02:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563187.880261; Thu, 13 Jul 2023 14:02:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJwtT-0006Dl-0d; Thu, 13 Jul 2023 14:02:07 +0000
Received: by outflank-mailman (input) for mailman id 563187;
 Thu, 13 Jul 2023 14:02:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJwtR-0006DI-O9; Thu, 13 Jul 2023 14:02:05 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJwtR-0002Nd-Hv; Thu, 13 Jul 2023 14:02:05 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJwtR-0007X6-0i; Thu, 13 Jul 2023 14:02:05 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJwtR-00067C-0H; Thu, 13 Jul 2023 14:02:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=TxHP42q8WlzeFSPgN4dyGHFmDqAqR7ahDNsflDz9Mr4=; b=FKi09ZCQWSF//QTzGfTaVNWfRT
	Sq42itM002IqJNfUdXsBw0vb56qYf2w9OOxiSXnb6UZZkQIDLtCUs8jgOeZGm/uSILpFpJoRQDRdE
	T2OEeR7g81tI1t3QgYZa8469NIyVzFzqvE0+WYyGeoRkrHA65GVOQ1kHzd9hOJhO6/A0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181778-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181778: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:guest-start:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-credit1:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-freebsd11-amd64:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-vhd:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=eb26cbb1a754ccde5d4d74527dad5ba051808fad
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 13 Jul 2023 14:02:05 +0000

flight 181778 linux-linus real [real]
flight 181782 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181778/
http://logs.test-lab.xenproject.org/osstest/logs/181782/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-shadow   14 guest-start         fail pass in 181782-retest
 test-amd64-amd64-xl-credit1 22 guest-start/debian.repeat fail pass in 181782-retest
 test-amd64-amd64-freebsd11-amd64 19 guest-localmigrate/x10 fail pass in 181782-retest
 test-amd64-amd64-xl-vhd 21 guest-start/debian.repeat fail pass in 181782-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                eb26cbb1a754ccde5d4d74527dad5ba051808fad
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   87 days
Failing since        180281  2023-04-17 06:24:36 Z   87 days  174 attempts
Testing same since   181778  2023-07-13 01:44:31 Z    0 days    1 attempts

------------------------------------------------------------
3739 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 622639 lines long.)


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 14:06:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 14:06:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563192.880271 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJwxe-0006pP-M3; Thu, 13 Jul 2023 14:06:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563192.880271; Thu, 13 Jul 2023 14:06:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJwxe-0006pI-JJ; Thu, 13 Jul 2023 14:06:26 +0000
Received: by outflank-mailman (input) for mailman id 563192;
 Thu, 13 Jul 2023 14:06:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJwxd-0006p8-6D; Thu, 13 Jul 2023 14:06:25 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJwxd-0002S0-5Q; Thu, 13 Jul 2023 14:06:25 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qJwxc-0007lU-Ut; Thu, 13 Jul 2023 14:06:25 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qJwxc-0001T9-UR; Thu, 13 Jul 2023 14:06:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=M9ULdIqpWk14cSre5rw9A2nUsDtm2/LDVZEy+7yKMmY=; b=4GeXVJ/qR0s0zy1VYv/nt9lvfJ
	QG3oX3011gRBz85CY64X3wpY+2DJENDT1jCq+rpEqF9+iSMtik2keOd177Gev24XJhI+lBimC3QXU
	d/Ktgsew81w/pzUN/UO0+MSIxoyZgFdoJnOuug75RP7tswj5nvJ9kGEXPjv29RDIcxJY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181781-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181781: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=99e45548934923f0d2c1d52ae1239ffe4ef17a06
X-Osstest-Versions-That:
    xen=24909098fdb260da9ffd0ba733d3a540c8c61aec
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 13 Jul 2023 14:06:24 +0000

flight 181781 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181781/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  99e45548934923f0d2c1d52ae1239ffe4ef17a06
baseline version:
 xen                  24909098fdb260da9ffd0ba733d3a540c8c61aec

Last test of basis   181776  2023-07-12 21:00:25 Z    0 days
Testing same since   181781  2023-07-13 11:00:27 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Christian Lindig <christian.lindig@cloud.com>
  Edwin TÃ¶rÃ¶k <edwin.torok@cloud.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   24909098fd..99e4554893  99e45548934923f0d2c1d52ae1239ffe4ef17a06 -> smoke


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 14:26:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 14:26:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563199.880281 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJxHC-00011Q-9G; Thu, 13 Jul 2023 14:26:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563199.880281; Thu, 13 Jul 2023 14:26:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJxHC-00011J-6Y; Thu, 13 Jul 2023 14:26:38 +0000
Received: by outflank-mailman (input) for mailman id 563199;
 Thu, 13 Jul 2023 14:26:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=0tL6=C7=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJxHA-00011C-Sb
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 14:26:36 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0611.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::611])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 443622be-2189-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 16:26:35 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM9PR04MB8355.eurprd04.prod.outlook.com (2603:10a6:20b:3b7::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24; Thu, 13 Jul
 2023 14:26:31 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Thu, 13 Jul 2023
 14:26:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 443622be-2189-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=cUCZJxGC0za5SoRGoC03vtKU/OcVZd15bodirs4zuV0tFSatitavYNDKdCCeP3uFsLDANeGNWSxIsmGyUQzsnCUdQxIfVx1FOux6timHyAFlVuTXyJidulGPlqGyR1HJg4GDvyh1ClO+lUXTti4P21nstZgY54+b98LWJD7msfkuY8TnmwGvyCnm2Gsw+qfEMH2Ut0zZ4LOU235jQOyHOcqRySi/roUBJxZPsy46jIYx94v8ch5VWUPgA9fuhhjQasmyeutJnxxVrHJgrOQ5MH9RPMfGU+MiyD2T57N6i0sbED1fO+wDfxXN3oEgWeI0qhMziBgYqkH+0sDJ/OEyMA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=cng//jCHET8mynMMMnrbIUc34ilas+gWD2Q8e9FqTvI=;
 b=hWHVHoyBtiUJfIOazCE3lYs7R1QkWCg8zB1s5xbmBHMQ2sDlM3mXuG76qttTYZraj4RT8nr1vXOXDH9PnUX9t7e/WtuRFSvI0gTn8E9gaiJ/R7DMZR5cE1eK3F3xMheHMKn8sJSZYca5MatTH9oIt/eCxLoYFAN2c7+wL2n2BaIUYwQi+fVKGqhyJxwMZKOkXKSZbTxDZmnqqSd2V0mWMNu02tgm383YpmPZTdhBBRPS3lNjTfBHw9BaQXCncqJGyLy1A35Io483bNyYqWeIJYOdjRv8dJivJiRqyuRIANNi34PEj3+oAS9gQr+3R+FmoRRiSh+aDwmOklEaOZF7ng==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=cng//jCHET8mynMMMnrbIUc34ilas+gWD2Q8e9FqTvI=;
 b=IfglZBInLT2lDcXoe+Q/Eayi990YU1hnW/OTg7OfPxB2NL3eiYt0tErvdH2sjp/4r19C4QswFutv4S+avqXX53w/gaSISjhimPmIpnOlxlZ3KHVMeQRUdi7U3GaAzNftjTCh3uS0qj9773fBHoXQ7aGdV94Oynev+0xwQUSnrA/iapGCAeqWcLZs9/tk35Eoyu0jejq/lSt5yQFtM80nSLWOnJ0CQ1kIBs7iTz7XgZue+dMxDSHL554ynbm+5SUNW53L9QDco7xm0gOmllNdkOAE2zxiQzX+omRa6+5rVgonFtqjaHcRH4EiLGLL37B/wAXah8RzMlnJQS63hS1nCw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <200693a2-267d-16c8-61f3-3047dc8967da@suse.com>
Date: Thu, 13 Jul 2023 16:26:29 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] ns1650: refactor interrupt handling in
 ns16550_uart_dt_init()
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org, Julien Grall <julien@xen.org>
References: <cc5a08056abacdbb6d6509b56716eb45467307bb.1689240611.git.oleksii.kurochko@gmail.com>
 <a385a17b-a60c-d770-e044-af64273371d6@suse.com>
 <86702f86787ee7b963b131c4b2d6db463eddc1f3.camel@gmail.com>
 <3e4c673d-1b8b-15ab-629f-27a9f687b37a@suse.com>
 <83f67337cb69fb8cf2aa5d56b8a711384cdaa5f0.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <83f67337cb69fb8cf2aa5d56b8a711384cdaa5f0.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0052.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:93::15) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM9PR04MB8355:EE_
X-MS-Office365-Filtering-Correlation-Id: 75170be6-e412-4fd3-016d-08db83ad270e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	RAp4HSZITkNDXxwOaAtnGz7sSW4MNboE2M7Ujq3AbHcIXBFPsZbr6OB7HL+sBjfIuAW8Lwqp65t9KTQHt0RhIvmdwlPNS3f94Q9R9TtGJxbqsRq/IAnbJGO0SABSvXpIGer50zc1ppQJfee3cB4CiL3PMD4jNev64E5VaI7YyB1qgvsUMZ1g+o0nIKb9mqUUq1OYPR7arKwW1py0F7+pzF092Ey1oOMnukcNNh4Iif+UW4Qlh5FmGqJ0/WHa/RehDf/nRKUuBQkToFWWRFlg+4mV39D3/gTyqTwW3oqHI52IfzBLLR/zLojPOMiZImykI7BSSLbC1JtDX6ZE2Xn8OipBYuFE38rqICwfcSwBLfB5ws9PrWPRhYV097tLvEEO5aCu5eFhMpB1+U4FAMfmIG5w5iwbMItAjUA+SvPxCpjxYD72R1I/axKbNGDv24Xyx3CEmnR8952VM9XopJYemwE2NNYJkICuFmnHiWTj5be2Gc+FKcvxTqzJ3WxmwUZEqbkAIJ4MjqZ3IkzpTlNmjkOZB0+z6CJkzCtB5cDcXqQtgLELEbmOeWcRaPlnVY4SHy/PZu65fSKTRW0EHN09I3wHFD3EbmAm1Gtu6iupirFQcVGGor2TFVYz1oBkxLBcjnNfOPnCRRWsNrfaxr/yTQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(39860400002)(376002)(136003)(396003)(346002)(451199021)(478600001)(26005)(53546011)(6512007)(6506007)(6486002)(8676002)(8936002)(5660300002)(316002)(2616005)(41300700001)(31696002)(66556008)(86362001)(2906002)(4744005)(31686004)(186003)(38100700002)(36756003)(66476007)(66946007)(4326008)(6916009)(54906003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiS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TlUvRjFUM21lak5kUTczTzViU0hM?=
 =?utf-8?B?NlJvNkIvK3RMM3gxUmZ3TWhFYzN3eGZiaXFuRWM2aXMxRnc0VStDRmVrSUlw?=
 =?utf-8?B?WndHVVR0YW12UVJSOTdIelpBYk93VDBMUDh0TDE1VXZqdmZiZ3lvNmlYVVNU?=
 =?utf-8?B?THNybDR3MXJUeUpOLzFDcFJmU0FjL3U1SWEzSGl5R3pxcFVYQ0pqYzN6aG9k?=
 =?utf-8?B?UENpaWxwZlVuNjZtN3Z4cDZzcmFNK3FoT1Q2aGFDTFFyd1E5bDQ3UFhYZld5?=
 =?utf-8?B?clM3cnhySkJlUDRVcWdmbE1iSjdIK1BKT01NYWpod1MxNklYaGFTbUQxeWtV?=
 =?utf-8?B?YnlWN1hOakxLbGxoaGg3TytYdjZubGpUQjgvWmtlSnlSOXZ0Uno1a0t2L2hh?=
 =?utf-8?Q?QXwID0DGdK3tDH/zwkn0nm2Qg?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 75170be6-e412-4fd3-016d-08db83ad270e
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 14:26:31.1941
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ej1Inrxm16XLmbANM9zUlp10TK5TRg0AxnWs9LOtJ6OTw2hI++VxEBDLqorY4JbyjEobwSD2JOszfmUTzETAWg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8355

On 13.07.2023 15:36, Oleksii wrote:
> On Thu, 2023-07-13 at 15:27 +0200, Jan Beulich wrote:
>> I don't understand. My earlier comment was affecting all checks of
>> uart->irq alike, as I'm unconvinced IRQ0 may not possibly be usable
>> on some architecture / platform. IOW I don't see why the check in
>> ns16550_init_postirq() would allow us any leeway.
> It looks like I misunderstood you.
> 
> Do you mean that on some architecture IRQ0 may be used for ns16550?

Yes, I don't see why this shouldn't be possible in principle. As Julien
said it can't happen on Arm, so if it also can't happen on RISC-V and
PPC, we could elect to continue to ignore that aspect.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 14:32:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 14:32:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563203.880291 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJxMN-0002Uz-T6; Thu, 13 Jul 2023 14:31:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563203.880291; Thu, 13 Jul 2023 14:31:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJxMN-0002Us-QR; Thu, 13 Jul 2023 14:31:59 +0000
Received: by outflank-mailman (input) for mailman id 563203;
 Thu, 13 Jul 2023 14:31: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 <SRS0=0tL6=C7=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJxMM-0002Um-GK
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 14:31:58 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0616.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::616])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 047dae3d-218a-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 16:31:56 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by DBBPR04MB7964.eurprd04.prod.outlook.com (2603:10a6:10:1e9::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24; Thu, 13 Jul
 2023 14:31:53 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Thu, 13 Jul 2023
 14:31:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 047dae3d-218a-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hn3JgjCVLTryE0nhQOK1kHTtf9u4H8+gLUYqzLFAORRu0A/5G10E3NoL6af2RtOGjVmDLxE18v+4g0bzioIkzAZNpPP3RduSz1gEcS4vZGr3kA7TgZW8G/lKBet+u6vj0ZTyW/0LTuFAtK/58eaCPLizzDHN0K5XgNXcO8KnKvAN1Ps8RhKJkhTl8AbwulXoo5XyVS44Mr0CGejXO6HKngvU2eWO30WFKHsv4uFDP95y9YPOmYF21D5pnF2kS9+NMzdM0uJd4I/1rH4ED/6ID36TZvLLCp18ReKB+ACXAKH46r+bf1IPSogD4HPAo5k5bOIc99klF2DUQQa2i4+sCg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=1YWDZ3DnE2WqVOnPJEmvNbV7n+3zE2OC3vd+B0iwvPE=;
 b=B6Aj+ZWWPmwBMLO0cUA8mUQdMibsiAlqqcNapHUUjlgWONMSIYPXPPDAZvbcDjuopUntsnpCMlhm/J0ZIti+47E7oHLmErvloWHcIrKYiojTZ9pJZ/eCvq98d0AzqVuofRSEZ876YIT0q01GVX51JXu7dVJJbBlj4Q/7R6wMne89hsWHGdsfKpaQ7C16LSj7pehIVbp1sRquMXzUDj+dd0jYYCshjmgRLLM68du2Fx6g/DnuIYsPeShiYRfWilAkKCrIsw6LUeT/o1Zz/AuV+4MpNP2Ny7pAiRVO0w/lIQWvqXGswdQ4JxQClyAndb64oVQkROqBVWZbDlsTCeW8ig==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=1YWDZ3DnE2WqVOnPJEmvNbV7n+3zE2OC3vd+B0iwvPE=;
 b=OMKFyQo/hvwmMJjijYtWIx9jojv+R5Dr3P3A6YiABRdpD1xRWcGE1Mhs3dVm/9UJ/8kfD1F4GNGGtOj+edBXps/6LwBybogv9xkGHFvCKLU6SMi7pcVCUMBTmjEuFk068FlUpAnE7DLgHU7hJmvfEJ//+065zP4LWZWMxf3/3SJnHhfpUoU9PXWDg+91UrSbwLoF4A8IWcKRqTAC/7tJbmv+3cLb1AKZTph6/UlX29XmeQ+gdyL5nIBxL6cR5G54F4oA5vnzQhHxvBth8T9OykB/AxFPUkEOdP8/xLhlL8NGxZZ2aYmzEnqj4FPbV4ibY0P59T49cfD/vrX06CCb4g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <72553e6d-b459-784c-bbf0-dabd8700ebc2@suse.com>
Date: Thu, 13 Jul 2023 16:31:50 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v2] x86: make function declarations consistent with
 definitions
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <1b2d5be30c0e4f335e59dce6e7c001cb0805d702.1688465215.git.federico.serafini@bugseng.com>
 <a16cdb60-1307-636e-1473-e5388e8f79d9@suse.com>
 <c07a096a-9089-f600-4acd-30ae4d929d5c@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <c07a096a-9089-f600-4acd-30ae4d929d5c@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0141.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9e::20) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|DBBPR04MB7964:EE_
X-MS-Office365-Filtering-Correlation-Id: 5cede1a5-5dd9-46df-49aa-08db83ade6e6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	fMam075Xa5WgCu1tmk2BO0d/50BW0uryz/r7LnTMAtHRkt2PrBdyVomCfp/fuOJ2a/OmK6No5SZ7I1BCbxLe/X8KxYGygppx1Q+AG1nfqxez2TgK/5vV+1NoObRcOvM0U4EhFIZ5ZrrNdzpMjyOB7OWo2juOdDF/z//4UktkF6UnEMJQJukNs5d6W/dzzfQr9685ymfiLpPzET2+psUL1mZsBpjwAHpsOQ36uI/MTDgafoMQaznkOtAXqHbNtkzWnhy2Z6e2vPGqgbtPFP8EgqvXgHIKAdACUchqw5vnh901NuZyVBYe/r5rMajaiYQfXE7BcFTCBas5K0IapKwGvXpSexhZFabNWQf+fhySUFdPRvskR9iGJg4HMbOuF79+DT3zWyxsSgE51i+jqVfMkS1HxyDSIgLKNMfnMVVRXz4xbMep9QGjo2Ee+Z5gG+/gq5FoYmCCr5hG7XZYC3zpAvfisvAfar2vN1t+uzxw2rh7LJEHwY/ZacwemeJ1OLm+vA7571u0Idsf9yts7cn31/BKydkYvVhyvNp9bn1UIR1yVtrOn0Jta3W0/5VaJ19/nPF+Y6/DyWV+vTzwQg1COyDpVzv1N0WVYsYd9bn/wb0Jsbivoh8Q4G/hSnytlh2qbflZI5+4lfsjQPDEDDevfw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(39860400002)(136003)(366004)(396003)(451199021)(478600001)(31686004)(54906003)(66946007)(6916009)(4326008)(2906002)(5660300002)(316002)(8676002)(41300700001)(8936002)(7416002)(66556008)(66476007)(6512007)(6486002)(26005)(6506007)(53546011)(38100700002)(186003)(83380400001)(2616005)(36756003)(86362001)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dTNkTWhHZ2JHUm5ua05GR3FnRjgvS3ZzdWZyWjUvMW94MW1NS2lTTkJBL2hT?=
 =?utf-8?B?dmlNZFZrbVZSUWo5YWlsdzFrSE5PL0pDVVFNTUNZTHhNZnQ0SmhQc1NDMmUv?=
 =?utf-8?B?Zks2cHd2K1AraWpFM2RDaG9tMXc0djg3M1YwU1pneG9ldXFMRFh3ekMxS2RZ?=
 =?utf-8?B?Mm11NmcwSU5lV2ZhNzB5SVpLOFBwS0FKemxDTUVRU3NjUnFVUTEyOFdNa0dK?=
 =?utf-8?B?djlnYllDaTVEd1N3MC8wcmtjb0JzWDFqd0xaUEdQams0eTlRSEJvRWJsNTNr?=
 =?utf-8?B?bVVkTmxxYkUrTUZiSWN5UmZyeFVjaGdrOENZUjhlQXZZVzhSUi9TdEZWblll?=
 =?utf-8?B?U0JWb2Z1TlhJOFQxVGsxYy94ZWRlc1h3QnlTZ1YzV2ZFTzM2RnJvcU1XQndW?=
 =?utf-8?B?VnRNSzg5c1U2ZXZKUXlCbDg5V3o1ams3dStycFhJT3NRNDhERjFGemZZaDYx?=
 =?utf-8?B?UERXSzZYWTl2eENRa09JWXNOVFU1Sm41aVBra0l1TXBLNmhuc2NRcWNJSzVo?=
 =?utf-8?B?VWNaNGplSXZabkVCYTJMaUIzL0VpWU4xY25oRHNoSGRBK2tiekh0SWFNZkh0?=
 =?utf-8?B?VFE5VVJSa2hqdkloamVWY2JmSHZLemNUTjhzZExMelFtV1pJbVpNL1ZjTmZN?=
 =?utf-8?B?K2RCUFZ1SW5vYnNGY0hXU29qbWdPaUxrekJ6bW82a1pZcVBlQ21kZEwxanZj?=
 =?utf-8?B?OXo4Sm5wUFhaSFZhcXA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C9wZXp1Zmk3cUhZ?=
 =?utf-8?B?a1IrY0cwbnBqZzFXekkxNWoyaitmb21hWmRrbmIwclJudzZia1VXcjg1QnI3?=
 =?utf-8?B?OXEzN0NjWWZWaFpNWGdXZTFGQThLdmxMbHpSOUlDN2xpbVpLdVBxNlZic1NC?=
 =?utf-8?B?c0lET3BIM3VzK3ZQSmIwTHIvQW5tdHFJQ21lM0ppVW5heHB5QWNUZ2w2amc4?=
 =?utf-8?B?REVtZEFCc1A3YW10UVoyM1FlaWRWZFRZa3RoR0xOTUVsNDhRY3NBc1J2bVFz?=
 =?utf-8?B?K2IzYzF3cFVjRW03YXd6elQxRlZoTXFlN3pQRGhkTlQ2N3g5QzhDZVh3amM3?=
 =?utf-8?B?VXByWm4vTStCek9DdEhlOTNzZ3VrcldkdjlZV054K2d1K0wvNU1zbEdhN0xB?=
 =?utf-8?B?dFJDcFg5MUJxd3lFZ2o4VnM0TXJ3VlF3WkxpV2V6TFFJcDZPMGxXRjFuanFD?=
 =?utf-8?B?Q1NTZmc1T2dkeUZRY2xqTFRVOW9lczFoeFRIazhzSXM3Qms2TkI2VkxFRFVB?=
 =?utf-8?Q?UugUmIKQt7GHl/c74zFYikuqL?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5cede1a5-5dd9-46df-49aa-08db83ade6e6
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 14:31:53.0314
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: jJRy8dffAJDkj2s7M4YMf0sPZqZ3ARMv6tfcEM4vuXuBayOSva2GCF0Ia6s31l/q6dd/VDqCwFmNetncJoo3xA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7964

On 13.07.2023 15:43, Federico Serafini wrote:
> 
> 
> On 04/07/23 16:51, Jan Beulich wrote:
>> On top of my earlier remark (when this was part of a series):
>>
>>> --- a/xen/arch/x86/cpu/mcheck/x86_mca.h
>>> +++ b/xen/arch/x86/cpu/mcheck/x86_mca.h
>>> @@ -113,7 +113,7 @@ static inline int mcabanks_test(int bit, struct mca_banks* banks)
>>>       return test_bit(bit, banks->bank_map);
>>>   }
>>>   
>>> -struct mca_banks *mcabanks_alloc(unsigned int nr);
>>> +struct mca_banks *mcabanks_alloc(unsigned int nr_mce_banks);
>>
>> I'm not convinced here.
>>
>>> --- a/xen/arch/x86/hvm/rtc.c
>>> +++ b/xen/arch/x86/hvm/rtc.c
>>> @@ -59,7 +59,7 @@ enum rtc_mode {
>>>   static void rtc_copy_date(RTCState *s);
>>>   static void rtc_set_time(RTCState *s);
>>>   static inline int from_bcd(RTCState *s, int a);
>>> -static inline int convert_hour(RTCState *s, int hour);
>>> +static inline int convert_hour(RTCState *s, int raw);
>>
>> Nor here.
>>
>>> --- a/xen/arch/x86/include/asm/guest_pt.h
>>> +++ b/xen/arch/x86/include/asm/guest_pt.h
>>> @@ -422,7 +422,7 @@ static inline unsigned int guest_walk_to_page_order(const walk_t *gw)
>>>   
>>>   bool
>>>   guest_walk_tables(const struct vcpu *v, struct p2m_domain *p2m,
>>> -                  unsigned long va, walk_t *gw, uint32_t pfec,
>>> +                  unsigned long va, walk_t *gw, uint32_t walk,
>>>                     gfn_t top_gfn, mfn_t top_mfn, void *top_map);
>>
>> While the definition's use of "walk" makes clear why the variable is
>> named the way it is despite being used with PFEC_* constants, not
>> naming it "pfec" here will add confusion, as the connection to those
>> constants will be lost. One will then be forced to go look at the
>> definition, when looking at the declaration ought to be sufficient.
>>
>> I'm not going to look further, but instead repeat my suggestion to
>> split this patch. Besides reducing the Cc list(s), that'll also
>> help getting in parts which are uncontroversial (like e.g. the
>> change to xen/arch/x86/hvm/vioapic.c).
> 
> In the three cases above,
> do you think changing the definitions to match the declarations
> might be a solution?

In the first case yes. In the 2nd one I'm not sure, as the function
already has a variable named "hour". The 3rd one is probably better
left out of sync (and be deviated), but I'm open to differing views
from either or both of the other x86 maintainers.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 14:40:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 14:40:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563206.880302 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJxUU-00041T-Mc; Thu, 13 Jul 2023 14:40:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563206.880302; Thu, 13 Jul 2023 14:40:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJxUU-00041M-Jv; Thu, 13 Jul 2023 14:40:22 +0000
Received: by outflank-mailman (input) for mailman id 563206;
 Thu, 13 Jul 2023 14:40:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BBdH=C7=epam.com=prvs=155895d3aa=oleksandr_tyshchenko@srs-se1.protection.inumbo.net>)
 id 1qJxUT-00041G-Cp
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 14:40:21 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2f92a1e7-218b-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 16:40:19 +0200 (CEST)
Received: from pps.filterd (m0174678.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36DCxkiV030300; Thu, 13 Jul 2023 14:40:12 GMT
Received: from eur03-dba-obe.outbound.protection.outlook.com
 (mail-dbaeur03lp2174.outbound.protection.outlook.com [104.47.51.174])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rsx91md00-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 13 Jul 2023 14:40:11 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com (2603:10a6:10:ed::15)
 by PAWPR03MB9201.eurprd03.prod.outlook.com (2603:10a6:102:341::14) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Thu, 13 Jul
 2023 14:40:08 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::11f9:615a:4d9a:a5d2]) by DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::11f9:615a:4d9a:a5d2%6]) with mapi id 15.20.6588.017; Thu, 13 Jul 2023
 14:40:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2f92a1e7-218b-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=PsqAdu2R4EXtx0frvVcKB2jlRCB48n/Gkij4e4PTZmJ/XVgmaUuTGzs36GzFsQS0T9wnNaD9duJasHjB6WAMoM01QVIp7oMENm1MN/G5BdouJJMoV3rf1FfO4grMqY22g+hzf+5xd2gp4vL4Qx6N8yHQ3iGecV7QQf0Sf3IYo1MLOQp6/3g0O6BlznRfD5Zj2J3g6gXr3yxk1ZwZLsLmibsMs06CBpvP9EHMFXL9wjtRGPRFnU7jg5NBa3GRAYusbjaGRheJ3Q2cBwKJ1rB2wsB+LaGbjXcKfcySfKRkhHZ6RiYMGDK1t5ky1k5YTn/RCfiGNwxr9Wj0tNs2TjK/jw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7AWXD6xifU4U0eaRhlp3L/5/ivssBJWP3bjtBZPlTns=;
 b=UeSY0DWNHVnX5y0xI3/BvMmqWSJ1Ck2WieoHj6dVvhx+IiX/XvZ0MYT5dOC67DqZEobyRAEDY9r7zeyJ8/iFeE3KiVpcWzBC7VxgeW8zVvRjp58MtTLWyQmI6r7nMpOHVUw78ti+7BzAtGRax3LNe+lzwnPFQ1J1GrSDj9wx5LCgHOxCk3f9A3xruDmUcGfaWxT97AotYTaUkJfc06DoRfp3NPAV2y0cganSEe9EgfIXuFahorQ5u89ojNWJrmL0btjBhmswNV1Id4V9oCHcIjBwjcUbNx7uihdNilGy9GZaZH+Unmi4UfTjPJwZDxE0dRvswQjhF0qPj9+Fgjk3zQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7AWXD6xifU4U0eaRhlp3L/5/ivssBJWP3bjtBZPlTns=;
 b=XO9oAEl+ISI5GqiBdl6hp/ic13lQQD5LsfuWf8NT5gRmPqMXpXBc0qhVYAMMgBnwFFud3L9cGZa+TftR3lei1a0SMWVPpYn40fjeADumZNlEUydmgJbGciPg7kKN9R/CSXIp3Pfq7o9c3O9vso367hLwsd7/83Q7pF/r3HDPKlADTs7Cni1pvZy3AKLTOnKh+M7FXQMu/e15m01UVGyERHazB7bpZNqAt/rvAVk7kiMQpGyUdIzLEhavq5YBhUkTMRtjRk/pRgiUs+6tt3RvA2lLjzUzpnet2KBlitwGsxrpn83S+TZiC8QaKkbKKN8NrmX8pSbXKMhhEtL0mbOpkw==
From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
To: Juergen Gross <jgross@suse.com>, Viresh Kumar <viresh.kumar@linaro.org>,
        Stefano Stabellini <sstabellini@kernel.org>
CC: Vincent Guittot <vincent.guittot@linaro.org>,
        =?utf-8?B?QWxleCBCZW5uw6ll?=
	<alex.bennee@linaro.org>,
        "stratos-dev@op-lists.linaro.org"
	<stratos-dev@op-lists.linaro.org>,
        Erik Schilling
	<erik.schilling@linaro.org>,
        Manos Pitsidianakis
	<manos.pitsidianakis@linaro.org>,
        Mathieu Poirier
	<mathieu.poirier@linaro.org>,
        "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>,
        "linux-kernel@vger.kernel.org"
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] xen: privcmd: Add support for irqfd
Thread-Topic: [PATCH] xen: privcmd: Add support for irqfd
Thread-Index: AQHZtJ2tw+2Ln+ZUhUa/nIHLslV4fq+3Uo+AgAB0BQA=
Date: Thu, 13 Jul 2023 14:40:08 +0000
Message-ID: <97e63191-e2ba-34f6-ca6c-99b9e9841587@epam.com>
References: 
 <d4e0233524b8c7c48614b09cae4d23f2cdf10988.1689150266.git.viresh.kumar@linaro.org>
 <a5521a9d-72c6-4e03-0fbb-8a37418c32f2@suse.com>
In-Reply-To: <a5521a9d-72c6-4e03-0fbb-8a37418c32f2@suse.com>
Accept-Language: en-US, ru-RU
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DB8PR03MB6108:EE_|PAWPR03MB9201:EE_
x-ms-office365-filtering-correlation-id: ab676c45-0dc9-469d-95a0-08db83af0e64
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 z3PHHN0LCQ+FmHDNW3acd2f4bpuslnlaDs7r6Kx9YL0l98fhlytqxIZWmKbCLpHcqc1lI6W4ukjABe/2VtmeSvbyPnnawSzAL1Q2qRasS6CTuNdNy5Wv+RryOlnHh89a/I3vfs7uopewHDTXDk8r19yCCF5/K42QCmGB7akAcyHtPy98vLNyRYybZQ9CzC9p5x4paovwMMu2I6kQi+wCzUQQl8At9F5+0T8BeHOkOuL1aI0LICrlDvowt/4Wgr2CLONnPps6rbl/+VvqeoJe/qKTt3Z54PVMphYoqC65bMi9Byy8LoK/ZGMNnwqp0sgzj2l+oVmtDMwPVwCBIFh5F5JjpsIb/NzSlUKtq3CbF4EDuxNk70gn0tcQSLOv8kEQ6cXM63+3DV7wZB7iDlEsFLWF6/cjqICvHIvi+QbE0v/GgdrNPOZBP4hhGmmriHVg2HHVGZsZaAP62NHFvefobzEvUwH5Wkokm/svZJL+zU6bnPQYfzOegGSor0lag+fukq+88XQjQeJW3nt0+mL6ikbRAwsTftKJwkjdhUMR8KKFzIIc/5ynvqdERhF7R+Y1QdpzzKvHgTHCwuIcRqIx8+IAOBRCxjISfRMxtijl7RxkGuxhBwKowEzBwswh4/J0OC71IiZy055RtUJGgzYhn68qD8CRSxJzAyCw9/AxQtI=
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR03MB6108.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(366004)(346002)(376002)(396003)(136003)(451199021)(86362001)(31686004)(2906002)(8936002)(71200400001)(110136005)(54906003)(478600001)(6486002)(7416002)(36756003)(41300700001)(66946007)(66476007)(76116006)(316002)(4326008)(66556008)(66446008)(64756008)(91956017)(6512007)(83380400001)(122000001)(38100700002)(5660300002)(6506007)(38070700005)(8676002)(53546011)(31696002)(186003)(2616005)(26005)(21314003)(45980500001);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?Z1lFbDFJaThhbmFUcnNLQ0xScVdzdHp6U0tvcTRRWmxHNWtMOUFEUnd0NTh1?=
 =?utf-8?B?QWVqcGRnSDZLZmM5Mm5EMUpNeDNyV3lsb3grQllCRTBwdU5OM0hJRXJISFJr?=
 =?utf-8?B?VGxxMENZTTU2M01EWmpIRWIyNzNqYVdhY1l0UGlMV0NHTjNSRExodkl0VlFE?=
 =?utf-8?B?OGVSWE5qTnpUTlBNeFhUczd4Vnljd1lKSGNTMVpiRWRBNTBNU2dzeE9jYi80?=
 =?utf-8?B?NDhBWmZCVDdLL0pJdU41Vit0eTBqSm9YQUs0NHJSZUZSUlZtNVIxUlR2bnNv?=
 =?utf-8?B?amh3dkpLZzdDOS9oV1NNS1haQmtPRm8wM21aT3FlNlVqYmR2bjh2SlZzc1E3?=
 =?utf-8?B?bnM5MlRFMmxJaDY1Qzg5K3B5VmdWV0UreVc0c2pIL0syc2RyWFVxbWpPTFI0?=
 =?utf-8?B?K3RVZnJGbHV2eEU0dFdvcGRWczN0b21kSmlidW0xNnIvdUtIeU9JTWQ4dkRR?=
 =?utf-8?B?OFFId0JhdkhFWEtUSHNnVkVIMGRXNUNjODFHRmJKUUp1ODR3RmlsQXRIanJE?=
 =?utf-8?B?V1pEOGFTL3FUV3BTL0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3FUR3pOZHhYazlPU2Uz?=
 =?utf-8?B?RS9GU0xmTTBvOVJEWEJVQzR3WmlTYVdKb1hYQ253NXk5bjlzSzRzS2plaHFG?=
 =?utf-8?B?azBxMTRjbVY3MlgzVTZhQVQrL2JQVXRFV3dhZ245eHBNMEZlWXhuWVI3aENq?=
 =?utf-8?B?MHVsS25Td0NXWVBUVjJ0VzFOOVN0bkVHZlVTdU03bTU4bXJ3Ym53bFdYZzNy?=
 =?utf-8?B?aTBjT0g1aXlRUHltc2x0NGE3U29mYVJmVEpaQnBydzdqTjJOTHZlUGFtbUlD?=
 =?utf-8?B?MTh1K1VRZGlqdjJVNXhpL0RDbFZNSmNiRWNhVm5kRGxzeGlYWjNTYTNXSUFi?=
 =?utf-8?B?ZW9LVytzZmJ1dVlaTXVacUFIMkszWEEwY2dJZW5vbkNOUkx2QXFmZmVXRnN4?=
 =?utf-8?B?cEhDdTFMR0VwTUJ5bDRRdk9sTUNtVGloeGtPQjRENXdhdUZFdXg1Z2FtTkN2?=
 =?utf-8?B?bGdWZjUrZEtvRHNKTUYrVFFxVjA3cHk2Rng2WXdUditxdCs2MlpjVUNnOUpD?=
 =?utf-8?B?dHJ3R2ZvZFU3aCtoMzNtUUhsSzVaMDZsKzdUcURBV0wvWVpuajlIUU02SHZT?=
 =?utf-8?B?SjFMdzZZalFIZmp1eHRDZm5IRXFuUjdWZzI4d0VnVUV6RC9OdXAxbDlSWXpo?=
 =?utf-8?B?YlZoNEc2SmZDbTk4Q1NwYjJYNUtEYjBjQittSjduUjBWSlE4RzZNVnhQZ2Q1?=
 =?utf-8?B?YmFJaVV5VDJqMCtNOW1kK05lelhYVjNUMUFHV1FISWN3T1ZxRzNNYUowTHFM?=
 =?utf-8?Q?UOE0qOBB3S2EyV1pcZnsC8k=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <2B015EECB6F5864CBDA189B9D0373BDA@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DB8PR03MB6108.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ab676c45-0dc9-469d-95a0-08db83af0e64
X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jul 2023 14:40:08.6672
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: G02DqiP8WmMSLUdCyu4JxiCRirAJl/kNzkRIwkFIpnEwHeA22iC6nwEvLeRlv4fizrLMWqDvrmz+ZlbwOLo34XklqphhP5fp36sB0Dwdk4Q=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR03MB9201
X-Proofpoint-ORIG-GUID: e9wzjv97Rap0aQOdUjqN3Uo4SAyhqYQg
X-Proofpoint-GUID: e9wzjv97Rap0aQOdUjqN3Uo4SAyhqYQg
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-13_05,2023-07-13_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999
 malwarescore=0 suspectscore=0 adultscore=0 mlxscore=0 priorityscore=1501
 impostorscore=0 phishscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0
 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2305260000 definitions=main-2307130128

DQoNCk9uIDEzLjA3LjIzIDEwOjQ0LCBKdWVyZ2VuIEdyb3NzIHdyb3RlOg0KDQpIZWxsbyBhbGwu
DQoNCg0KPiBPbiAxMi4wNy4yMyAxMDo0OCwgVmlyZXNoIEt1bWFyIHdyb3RlOg0KPj4gWGVuIHBy
b3ZpZGVzIHN1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odCBub3cgb3IgdGhpcyBjYW4g
YmUgZXh0ZW5kZWQvdXBkYXRlZCBsYXRlciANCm9uICh3aGVuIHRoZXJlIGlzIGEgcmVhbCBuZWVk
KT8NCg0KDQoNCltzbmlwXQ==


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 15:02:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 15:02:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563211.880311 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJxq6-0006iC-Li; Thu, 13 Jul 2023 15:02:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563211.880311; Thu, 13 Jul 2023 15:02:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJxq6-0006i5-J5; Thu, 13 Jul 2023 15:02:42 +0000
Received: by outflank-mailman (input) for mailman id 563211;
 Thu, 13 Jul 2023 14:48:08 +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
 <SRS0=NF/v=C7=chromium.org=seanpaul@srs-se1.protection.inumbo.net>)
 id 1qJxc0-0004mk-M6
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 14:48:08 +0000
Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com
 [2001:4860:4864:20::34])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 467c8e1f-218c-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 16:48:06 +0200 (CEST)
Received: by mail-oa1-x34.google.com with SMTP id
 586e51a60fabf-1b441dd19eeso673512fac.1
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 07:48:06 -0700 (PDT)
Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com.
 [209.85.160.43]) by smtp.gmail.com with ESMTPSA id
 k5-20020a056870350500b001acfd23ca84sm3107076oah.6.2023.07.13.07.48.04
 for <xen-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 13 Jul 2023 07:48:04 -0700 (PDT)
Received: by mail-oa1-f43.google.com with SMTP id
 586e51a60fabf-1b060bce5b0so673639fac.3
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 07:48:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 467c8e1f-218c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=chromium.org; s=google; t=1689259684; x=1691851684;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=vKItIj72hAMISxrHuiptAazhKs3+4zy1JRueUjGy5Ew=;
        b=HXKv0lyN3VjTvx87/OFs4ZljSut9Xp+J33xoeIxWzpp8OHvd01GrxonKShvlEV/Ip9
         XolMlv5UBHoQo3LDP3GcfxNvJ3V6sWbI2BO8iFEaPoXksHuR+yB7o39yAd8wbMxCMZ7b
         EAT7TmmnuSWjeCuQPRFssTDWNo9o+vSTrhkxU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689259684; x=1691851684;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=vKItIj72hAMISxrHuiptAazhKs3+4zy1JRueUjGy5Ew=;
        b=eF6o0012EV50aoYQ2wuAJaPoJJ7sHQMZHE6Egc/3xOLdxpoIcMETIp7RJadWezFYZ6
         O3HUQNVs0fSikYX/5gPpp6uIQR1clIDRq658b7Nr39yawAJIDb+pneGOn9ghi5xlZh3o
         yX/hvK7p15/bEYCwKx34vSGg9kB6K11kxO9GpkPnKlRSk1McfqGfFut3Y2NNTKn7YwA4
         cRuR2aAl5EotVR9MB65JYGhZ538yJslrO0MtxmZQ4XUOHBBIdEfNZpc4Icz2Y0TSBMTk
         ET4xJNqqVDy6qU9cmgBfe1a7DiMSPgJO32LN4n8dlBR6R3NnPA5/1M2Xhs7UVgAYSOKy
         F8lg==
X-Gm-Message-State: ABy/qLZnwS4Q+M/LN62pidQAN90JCtISeIveBXsWvmGrETBUTYAGs/eY
	LBCQNOi889CNwEptGebDPFRWUMAsWT4Jg3WTG8tgOXwG
X-Google-Smtp-Source: APBJJlEj826dfUwZwt5xQnhSEylHhga0tn4JP5nNUOA70hnp6JAahdpOj2XAPkYJ+pQJn1HZ/WKyAg==
X-Received: by 2002:a05:6870:a68c:b0:1b0:222f:9cda with SMTP id i12-20020a056870a68c00b001b0222f9cdamr2483993oam.0.1689259684575;
        Thu, 13 Jul 2023 07:48:04 -0700 (PDT)
X-Received: by 2002:a05:6902:211:b0:c8b:3:e399 with SMTP id
 j17-20020a056902021100b00c8b0003e399mr1398441ybs.44.1689259342555; Thu, 13
 Jul 2023 07:42:22 -0700 (PDT)
MIME-Version: 1.0
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com> <CAOw6vbLO_UaXDbTCtAQJgthXOUMPqEV+c2MQhP-1DuK44OhGxw@mail.gmail.com>
 <20230713130337.fd2l67r23g2irifx@pengutronix.de>
In-Reply-To: <20230713130337.fd2l67r23g2irifx@pengutronix.de>
From: Sean Paul <seanpaul@chromium.org>
Date: Thu, 13 Jul 2023 10:41:45 -0400
X-Gmail-Original-Message-ID: <CAOw6vbKtjyUm+OqO7LSV1hDOMQATwkEWP4GzBbbXib0i5EviUQ@mail.gmail.com>
Message-ID: <CAOw6vbKtjyUm+OqO7LSV1hDOMQATwkEWP4GzBbbXib0i5EviUQ@mail.gmail.com>
Subject: Re: [Freedreno] [PATCH RFC v1 00/52] drm/crtc: Rename struct
 drm_crtc::dev to drm_dev
To: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
Cc: Jani Nikula <jani.nikula@intel.com>, =?UTF-8?Q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 
	Geert Uytterhoeven <geert+renesas@glider.be>, Xinliang Liu <xinliang.liu@linaro.org>, 
	Linus Walleij <linus.walleij@linaro.org>, 
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>, 
	Alexey Kodanev <aleksei.kodanev@bell-sw.com>, dri-devel@lists.freedesktop.org, 
	Vandita Kulkarni <vandita.kulkarni@intel.com>, Alim Akhtar <alim.akhtar@samsung.com>, 
	Anitha Chrisanthus <anitha.chrisanthus@intel.com>, 
	Marijn Suijten <marijn.suijten@somainline.org>, Jonathan Hunter <jonathanh@nvidia.com>, 
	Arun R Murthy <arun.r.murthy@intel.com>, Jerome Brunet <jbrunet@baylibre.com>, 
	Liu Shixin <liushixin2@huawei.com>, linux-samsung-soc@vger.kernel.org, 
	Samuel Holland <samuel@sholland.org>, Matt Roper <matthew.d.roper@intel.com>, 
	Wenjing Liu <wenjing.liu@amd.com>, Javier Martinez Canillas <javierm@redhat.com>, 
	Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>, Danilo Krummrich <dakr@redhat.com>, 
	NXP Linux Team <linux-imx@nxp.com>, spice-devel@lists.freedesktop.org, 
	Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>, linux-sunxi@lists.linux.dev, 
	Stylon Wang <stylon.wang@amd.com>, Tim Huang <Tim.Huang@amd.com>, 
	Suraj Kandpal <suraj.kandpal@intel.com>, =?UTF-8?Q?Andr=C3=A9_Almeida?= <andrealmeid@igalia.com>, 
	Andi Shyti <andi.shyti@linux.intel.com>, Yifan Zhang <yifan1.zhang@amd.com>, 
	Leo Li <sunpeng.li@amd.com>, Sascha Hauer <s.hauer@pengutronix.de>, 
	Lucas De Marchi <lucas.demarchi@intel.com>, Inki Dae <inki.dae@samsung.com>, 
	Hersen Wu <hersenxs.wu@amd.com>, Jessica Zhang <quic_jesszhan@quicinc.com>, 
	Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>, 
	Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>, =?UTF-8?Q?=C5=81ukasz_Bartosik?= <lb@semihalf.com>, 
	Radhakrishna Sripada <radhakrishna.sripada@intel.com>, Andrew Jeffery <andrew@aj.id.au>, 
	Seung-Woo Kim <sw0312.kim@samsung.com>, =?UTF-8?Q?Noralf_Tr=C3=B8nnes?= <noralf@tronnes.org>, 
	kernel@pengutronix.de, Alex Deucher <alexander.deucher@amd.com>, 
	freedreno@lists.freedesktop.org, 
	Claudiu Beznea <claudiu.beznea@microchip.com>, Zack Rusin <zackr@vmware.com>, 
	Gerd Hoffmann <kraxel@redhat.com>, Alexandre Belloni <alexandre.belloni@bootlin.com>, 
	linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org, 
	Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>, 
	=?UTF-8?Q?Jos=C3=A9_Roberto_de_Souza?= <jose.souza@intel.com>, 
	virtualization@lists.linux-foundation.org, 
	Thierry Reding <thierry.reding@gmail.com>, Yongqin Liu <yongqin.liu@linaro.org>, 
	Mario Limonciello <mario.limonciello@amd.com>, Fei Yang <fei.yang@intel.com>, 
	=?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= <ville.syrjala@linux.intel.com>, 
	David Lechner <david@lechnology.com>, Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>, 
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>, David Francis <David.Francis@amd.com>, 
	Aaron Liu <aaron.liu@amd.com>, Patrik Jakobsson <patrik.r.jakobsson@gmail.com>, 
	Vinod Polimera <quic_vpolimer@quicinc.com>, linux-rockchip@lists.infradead.org, 
	Fangzhi Zuo <jerry.zuo@amd.com>, Aurabindo Pillai <aurabindo.pillai@amd.com>, 
	VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>, Ben Skeggs <bskeggs@redhat.com>, 
	=?UTF-8?Q?Jouni_H=C3=B6gander?= <jouni.hogander@intel.com>, 
	Dave Airlie <airlied@redhat.com>, linux-mips@vger.kernel.org, 
	Gurchetan Singh <gurchetansingh@chromium.org>, 
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>, linux-arm-msm@vger.kernel.org, 
	Animesh Manna <animesh.manna@intel.com>, linux-renesas-soc@vger.kernel.org, 
	Maxime Ripard <mripard@kernel.org>, 
	Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>, Philipp Zabel <p.zabel@pengutronix.de>, 
	linux-amlogic@lists.infradead.org, Evan Quan <evan.quan@amd.com>, 
	Michal Simek <michal.simek@amd.com>, linux-arm-kernel@lists.infradead.org, 
	Sean Paul <sean@poorly.run>, Neil Armstrong <neil.armstrong@linaro.org>, 
	Kai Vehmanen <kai.vehmanen@linux.intel.com>, Boris Brezillon <bbrezillon@kernel.org>, 
	Chunyan Zhang <zhang.lyra@gmail.com>, Qingqing Zhuo <qingqing.zhuo@amd.com>, 
	Sandy Huang <hjc@rock-chips.com>, Swati Sharma <swati2.sharma@intel.com>, 
	John Stultz <jstultz@google.com>, Paul Kocialkowski <paul.kocialkowski@bootlin.com>, 
	Kyungmin Park <kyungmin.park@samsung.com>, Drew Davenport <ddavenport@chromium.org>, 
	Kevin Hilman <khilman@baylibre.com>, Hawking Zhang <Hawking.Zhang@amd.com>, 
	Haneen Mohammed <hamohammed.sa@gmail.com>, Anusha Srivatsa <anusha.srivatsa@intel.com>, 
	Dan Carpenter <error27@gmail.com>, Karol Herbst <kherbst@redhat.com>, 
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, linux-hyperv@vger.kernel.org, 
	Stefan Agner <stefan@agner.ch>, Melissa Wen <melissa.srw@gmail.com>, 
	=?UTF-8?B?TWHDrXJhIENhbmFs?= <mairacanal@riseup.net>, 
	Luca Coelho <luciano.coelho@intel.com>, 
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Andrzej Hajda <andrzej.hajda@intel.com>, 
	Likun Gao <Likun.Gao@amd.com>, Sam Ravnborg <sam@ravnborg.org>, 
	Alain Volmat <alain.volmat@foss.st.com>, Xinwei Kong <kong.kongxinwei@hisilicon.com>, 
	Jernej Skrabec <jernej.skrabec@gmail.com>, Deepak Rawat <drawat.floss@gmail.com>, 
	Chen-Yu Tsai <wens@csie.org>, Joel Stanley <joel@jms.id.au>, 
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>, Harry Wentland <harry.wentland@amd.com>, 
	Sumit Semwal <sumit.semwal@linaro.org>, Alan Liu <haoping.liu@amd.com>, 
	Philip Yang <Philip.Yang@amd.com>, Lyude Paul <lyude@redhat.com>, intel-gfx@lists.freedesktop.org, 
	Alison Wang <alison.wang@nxp.com>, Wolfram Sang <wsa+renesas@sang-engineering.com>, 
	Abhinav Kumar <quic_abhinavk@quicinc.com>, Gustavo Sousa <gustavo.sousa@intel.com>, 
	Baolin Wang <baolin.wang@linux.alibaba.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>, 
	Mikko Perttunen <mperttunen@nvidia.com>, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>, 
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>, Tomi Valkeinen <tomba@kernel.org>, 
	Deepak R Varma <drv@mailo.com>, "Pan, Xinhui" <Xinhui.Pan@amd.com>, 
	Biju Das <biju.das.jz@bp.renesas.com>, Chia-I Wu <olvaffe@gmail.com>, 
	Konrad Dybcio <konrad.dybcio@linaro.org>, 
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>, Tian Tao <tiantao6@hisilicon.com>, 
	Shawn Guo <shawnguo@kernel.org>, =?UTF-8?Q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>, 
	Khaled Almahallawy <khaled.almahallawy@intel.com>, linux-stm32@st-md-mailman.stormreply.com, 
	Emma Anholt <emma@anholt.net>, Chun-Kuang Hu <chunkuang.hu@kernel.org>, 
	Imre Deak <imre.deak@intel.com>, Liviu Dudau <liviu.dudau@arm.com>, 
	Alexandre Torgue <alexandre.torgue@foss.st.com>, Roman Li <roman.li@amd.com>, 
	Paul Cercueil <paul@crapouillou.net>, Rob Clark <robdclark@gmail.com>, 
	Hamza Mahfooz <hamza.mahfooz@amd.com>, David Airlie <airlied@gmail.com>, Marek Vasut <marex@denx.de>, 
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, xen-devel@lists.xenproject.org, 
	Guchun Chen <guchun.chen@amd.com>, 
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>, 
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>, Russell King <linux@armlinux.org.uk>, 
	Uma Shankar <uma.shankar@intel.com>, Mika Kahola <mika.kahola@intel.com>, 
	Maxime Coquelin <mcoquelin.stm32@gmail.com>, Jiasheng Jiang <jiasheng@iscas.ac.cn>, 
	Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>, Thomas Zimmermann <tzimmermann@suse.de>, 
	Vinod Govindapillai <vinod.govindapillai@intel.com>, linux-tegra@vger.kernel.org, 
	=?UTF-8?B?TWFyZWsgT2zFocOhaw==?= <marek.olsak@amd.com>, 
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
	=?UTF-8?Q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= <samsagax@gmail.com>, 
	Melissa Wen <mwen@igalia.com>, Hans de Goede <hdegoede@redhat.com>, 
	linux-mediatek@lists.infradead.org, Fabio Estevam <festevam@gmail.com>, 
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>, Matthias Brugger <matthias.bgg@gmail.com>, 
	David Tadokoro <davidbtadokoro@usp.br>, 
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Orson Zhai <orsonzhai@gmail.com>, 
	amd-gfx@lists.freedesktop.org, Jyri Sarha <jyri.sarha@iki.fi>, 
	Yannick Fertre <yannick.fertre@foss.st.com>, Nicolas Ferre <nicolas.ferre@microchip.com>, 
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, 
	Philippe Cornu <philippe.cornu@foss.st.com>, Daniel Vetter <daniel@ffwll.ch>, 
	Wayne Lin <Wayne.Lin@amd.com>, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, 
	Nirmoy Das <nirmoy.das@intel.com>, Lang Yu <Lang.Yu@amd.com>, 
	Lucas Stach <l.stach@pengutronix.de>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 13, 2023 at 9:04=E2=80=AFAM Uwe Kleine-K=C3=B6nig
<u.kleine-koenig@pengutronix.de> wrote:
>
> hello Sean,
>
> On Wed, Jul 12, 2023 at 02:31:02PM -0400, Sean Paul wrote:
> > I'd really prefer this patch (series or single) is not accepted. This
> > will cause problems for everyone cherry-picking patches to a
> > downstream kernel (LTS or distro tree). I usually wouldn't expect
> > sympathy here, but the questionable benefit does not outweigh the cost
> > IM[biased]O.
>
> I agree that for backports this isn't so nice. However with the split
> approach (that was argumented against here) it's not soo bad. Patch #1
> (and similar changes for the other affected structures) could be
> trivially backported and with that it doesn't matter if you write dev or
> drm (or whatever name is chosen in the end); both work in the same way.

Patch #1 avoids the need to backport the entire set, however every
change occuring after the rename patches will cause conflicts on
future cherry-picks. Downstream kernels will have to backport the
whole set. Backporting the entire set will create an epoch in
downstream kernels where cherry-picking patches preceding this set
will need to undergo conflict resolution as well. As mentioned in my
previous email, I don't expect sympathy here, it's part of maintaining
a downstream kernel, but there is a real cost to kernel consumers.

>
> But even with the one-patch-per-rename approach I'd consider the
> renaming a net win, because ease of understanding code has a big value.
> It's value is not so easy measurable as "conflicts when backporting",
> but it also matters in say two years from now, while backporting
> shouldn't be an issue then any more.

You've rightly identified the conjecture in your statement. I've been
on both sides of the argument, having written/maintained drm code
upstream and cherry-picked changes to a downstream kernel. Perhaps
it's because drm's definition of dev is ingrained in my muscle memory,
or maybe it's because I don't do a lot of upstream development these
days, but I just have a hard time seeing the benefit here.

I appreciate your engagement on the topic, thank you!

Sean

>
> Thanks for your input, best regards
> Uwe
>
> --
> Pengutronix e.K.                           | Uwe Kleine-K=C3=B6nig       =
     |
> Industrial Linux Solutions                 | https://www.pengutronix.de/ =
|


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 15:12:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 15:12:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563217.880321 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJxzO-0008GT-Jd; Thu, 13 Jul 2023 15:12:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563217.880321; Thu, 13 Jul 2023 15:12:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJxzO-0008GM-Gt; Thu, 13 Jul 2023 15:12:18 +0000
Received: by outflank-mailman (input) for mailman id 563217;
 Thu, 13 Jul 2023 15:12:17 +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 <SRS0=0tL6=C7=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qJxzN-0008GG-8q
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 15:12:17 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on2061e.outbound.protection.outlook.com
 [2a01:111:f400:7d00::61e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a6225f8a-218f-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 17:12:15 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by VI1PR04MB9763.eurprd04.prod.outlook.com (2603:10a6:800:1d3::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.36; Thu, 13 Jul
 2023 15:12:11 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Thu, 13 Jul 2023
 15:12:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a6225f8a-218f-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=OCWJdIlf1DwTh1hvTDnce5o38nhPTLWbQxWV4oIfcdH0qL6Ka6n/RiJZT7cdcaCUv6j3BAD6vANIQoT3EBxWZv5ATCiDqkbJGNO7l0NwTBFWKZTpJiu0pvuAh4Mtx1qNJRjggCkndaST6/ADofm9EetyLeIdLtNmy5VgbbyVzy7r7DF+m3CgSXK70acuOCED7aUwDbS0aiFKAyl/P9gg5TsGbXqBFP/JElxr4CS/pmwzqReIwm5fOntUwfv6bqXfw1IEX6xFbTGyQ3qAoelrG9vR5miiBx+CTX0wXMjvp7Zf0odYcDcR9NFO+xMbtQGHiFLVxsjr4yIa/qXVrZGCvA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=m7GEpxG8plrcHkZLC6LAHA131sajozL3jMElLXf1qww=;
 b=kLwn/R085xqmNob4Y7zJKHRC6e+ZZ+M4Cn48k2EoHUCm9KlZiwdHR0ARksyh6DO57JXsKGNphMGxhDe1LbuILFlICTpNG5HguVpqeZ1ydE9YDs/t+p283uovDiJsrRJ2dQyNK73eP6VTknvsAzfDHODt4JkzPPRhAF7soFkg0zzeHDqNpyaguvb7c+ewZKFvx47rnUAECUWHOCMSX8yrfI4ntMvbOd9+Q1MA631t8Mp2KNU8NCD1rF0FJqsdc3gFGEFn0sWrkOU1tfCOoVgJfSAS/VjjP+UVKEXLLcGUkCPjcrDHoaTbN8WQxOuivexMMgtPGjh2Z+ojpoHwB4Nl1g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=m7GEpxG8plrcHkZLC6LAHA131sajozL3jMElLXf1qww=;
 b=m5ZXFp8Pkyvq46DD93v/lbKhsezM2w2cbfDD06wHg7MhE4YN9xfQMy11HPVK8JitLhoaICYFJqJbltJRz7bYy2EyrUOn6Mpnpdz3i0VuJfG1YenYZ/SvzWtMf7HaJQfEspc9Hf1jhsloBFsCmYw97l2RMbiOr4L1YWkVvGrNTXNqMPTN3xSfELkmdkfXFud3rMdy9BboAPE0Fs5xvvqba0mw/OQCWxJUGA/yk2Q9/dFI2R1xuMCcN+NneO29BkM/1i/zL2lALH1TQ00hmZu5uYWkZiOQJhYcPniWwhE+WaMShsQ2FhAPs+RPrD+Z0Nzlmud+18sgpNgNYcqJWd6gsA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <646ce8b8-7a8c-88c1-2b1e-76a721e6f164@suse.com>
Date: Thu, 13 Jul 2023 17:12:09 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3] mm/pdx: Add comments throughout the codebase for pdx
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230707160759.12132-1-alejandro.vallejo@cloud.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230707160759.12132-1-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0011.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a::21) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|VI1PR04MB9763:EE_
X-MS-Office365-Filtering-Correlation-Id: 5200a549-eb49-4576-ffe1-08db83b38869
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	5iFRgDEjwXhZYtkKoaQX434Mi3bkXwjuiRXI/WOSmjTyls+GqeZODZXpCMeRLFcPPuxSUeXShVmZrcxZt2dxc87XvIOlw/Nd0r7And4FMwNoNE47NZic8UglZCDzmYH3hVnAeV6SfUoraLeL75eAWlzLij88y6KNN2//EtaSBCf9rM02kr7doHZR+CNYbQkDNMgCuPo1KIAEmyjxdE9Jp4Z8XyxZPTi9rOUjYW0TLzvKiGL9mnoxxla9SZ8/gKFvFLsWwcuc+vzMTxBWiTr2BHNKdY80N9xc5RKTVUR9m/Enk6qiuslu8O0MJV8jG2cIVzSQ8kah5YwWkX9EU+si7dhIUrkX5DWrVmEGh/ZOrRp+DF34FCc9cOuhbj8gCLe7W6yqfl0zljSxk5iW7vDtsrMuuCToOaLQTLnQbmAZzgT72bWyZhWqZhF4miX4K/iy+7Bar0KbpEsZmx7H7QXOrvSkoJJp5xXqLXkaAEN08fHQqUVYyF8Sux7GORXCIq9JxLsBb/DQU1qy4AV/volajX0QFPGud9m0xvLxvoQihq8zMF6WEFOfH0VyrRVOza9SJ0kBLIzaqFm/IuyMMdnzvW2QSEg9PtHm+OwP+t+rwIkLbiq73+KSCGC35kJUs7+x1LAPn+OBGYr4q05Oo+okkg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(136003)(39860400002)(346002)(396003)(366004)(451199021)(31696002)(36756003)(86362001)(38100700002)(478600001)(2906002)(6486002)(6506007)(53546011)(6512007)(26005)(8676002)(8936002)(316002)(41300700001)(66556008)(66476007)(66946007)(5660300002)(6916009)(54906003)(31686004)(4326008)(66899021)(2616005)(186003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?U21UdGdsMExJRGVmOGZKYWo5cmc0aHY3b1ZFeE5xeW4xYnI2dmx1WlhGS05B?=
 =?utf-8?B?VkNIb2I1L1R1dUpnYVZPTmRLRStIWkRQeFZxT1lSNjJUMGJwN1c0eWRmWmxu?=
 =?utf-8?B?RWxJNFJ4VTJEZk1rM2tzWTd1YzZnREJIMjRNTWZDdEFYWVBjaUN6bGVJbDB6?=
 =?utf-8?B?UEFyNkNJYkUxMTVPU3NUeFFNWE9BMkNyV3lFMFpyWUlGbFNWdVZOUmFRWUN2?=
 =?utf-8?B?N2RSM1NsMElFMEprVUVKZjhHT3VzMnBiMWNyU2NuSkFlWDV1VUhWUVFNL2tQ?=
 =?utf-8?B?di80MENrNmx0UUZNUkdKaGxTMWZMcE1makJWejc0dU03RHB4WjdORlNUcTAy?=
 =?utf-8?B?TFNWakREVkhId1Y3TFVYbFNNSk1MSmFHRXRaRmI5SFlONmVETHpZWkY0WFpz?=
 =?utf-8?B?RkthT050MGd5OHM1K1FYdjNnaFEyMEJ5NllZbERla0ErOXV4WUVsK00vdjI2?=
 =?utf-8?B?VWhIcWNVQjhFNWhwN05CdVdPWFVhQzdtUG56eEVodEFYVG5oS2JCZ3JnQ0Fj?=
 =?utf-8?B?eXkvcTlMZW9TQU1wTTRsK1JWNlo0Nm4zZ05MVVlBUWRZZ28zbWtrSHVXclY4?=
 =?utf-8?B?VDdVOXBuS2xvMmhIMSsza1JKaVQ2UzlvL0dxNko3U0dzdGNpRW81NzMxcC84?=
 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xobUZpdE9OTkh4dk9zSG5GZkU2UG16bmJseTM2N1ZJRFAvaHVR?=
 =?utf-8?B?bWFiU2ZNMHMrOUJnVnNmOW0wMUpmT3h5MEE5MVIwN1U5NnFlYUs1d2tVMzNS?=
 =?utf-8?B?WXd6U0tpUE82YWRobEh4RVRvcDZOOHBwVWplSDIrOWJ5eVRBdHY4NWtEUlpu?=
 =?utf-8?B?Zi8vd1Vhd29DTjJCRkxaNUJSRDgxMW9DOXFCWnVEa0JmM0xJVjZlaHlJNzg5?=
 =?utf-8?B?NzVGY09OWnVxWGpRWXRLVGQyakpjSkczYVVZZzI5T1J1TEVJbU5rY2w3b3hQ?=
 =?utf-8?B?aC9ER3E5OXZwWkQzSWxRVHl1MUQwUGp4ZEcxekErMUFBZ2ZrUytKMVJraTJ4?=
 =?utf-8?B?eTlQUjV5ZzFNczY1NjZhZ2pkSmtkSlBnK2pYRThwLzhMTE44OWdiaXJWUVZR?=
 =?utf-8?B?bktCbFpDb2RsU2RyRzVnaytqbkRJRHJmY1NkQzlxU2lPSmdzMXZPSjJHWjls?=
 =?utf-8?B?cWRrTU80bFJiL3hvQWkrdFBhd2pGZGtQcFZzWStGNHRMTW5YZU91ZUc5bVk3?=
 =?utf-8?B?UThKeUR3SmtkTmplbXd6WExUVnh0cExuRmh1MDJuMTNwUEw5RUo5SFFoV3RH?=
 =?utf-8?Q?GfXPu8dght3UJ43Z7IYWMI3fu?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5200a549-eb49-4576-ffe1-08db83b38869
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 15:12:11.5135
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 69227qSZBWUbKxDh/LdgMjISD5aQDIOKgzBqTmq91cnb5iUEv/CmjItD7OQv27tMvkpsZ9XrhjYjz7dlfnW3VQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB9763

On 07.07.2023 18:07, Alejandro Vallejo wrote:
> --- a/xen/include/xen/mm.h
> +++ b/xen/include/xen/mm.h
> @@ -31,6 +31,17 @@
>   *   (i.e. all devices assigned to) a guest share a single DMA address space
>   *   and, by default, Xen will ensure dfn == pfn.
>   *
> + * pdx: Page InDeX
> + *   Indices into the frame table holding the per-page's book-keeping
> + *   metadata. A compression scheme may be used, so there's a possibly non
> + *   identity mapping between valid(mfn) <-> valid(pdx). See the comments
> + *   in pdx.c for an in-depth explanation of that mapping. This also has a
> + *   knock-on effect on the directmap, as "compressed" pfns have no
> + *   corresponding mapped frames.

Didn't you mean to keep the directmap part optional, which would call for
saying "may" here (twice)? Yet then ...

> --- a/xen/include/xen/pdx.h
> +++ b/xen/include/xen/pdx.h
> @@ -1,6 +1,73 @@
>  #ifndef __XEN_PDX_H__
>  #define __XEN_PDX_H__
>  
> +/*
> + * PDX (Page inDeX)
> + *
> + * This file deals with optimisations pertaining to frame table and
> + * directmap indexing, A pdx is an index into the frame table, which
> + * typically also means an index into the directmap[1]. However, having an
> + * identity relationship between mfn and pdx could waste copious amounts of
> + * memory in empty frame table entries and page tables. There are some
> + * techniques to bring memory wastage down.
> + *
> + * [1] Some ports apply further modifications to a pdx before indexing the
> + *     directmap. This doesn't change the fact that the same compression
> + *     present in the frame table is also present in the directmap
> + *     whenever said map is present.

.. you mention it here as non-optional as well. Didn't you tell me that
Arm doesn't use compressed indexes into the directmap?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 15:14:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 15:14:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563220.880332 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJy1m-0000O5-0L; Thu, 13 Jul 2023 15:14:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563220.880332; Thu, 13 Jul 2023 15:14:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJy1l-0000Ny-TW; Thu, 13 Jul 2023 15:14:45 +0000
Received: by outflank-mailman (input) for mailman id 563220;
 Thu, 13 Jul 2023 15:14:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=QZKt=C7=citrix.com=prvs=551b96af5=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qJy1j-0000Ns-Ft
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 15:14:44 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fd42a861-218f-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 17:14:42 +0200 (CEST)
Received: from mail-dm6nam10lp2103.outbound.protection.outlook.com (HELO
 NAM10-DM6-obe.outbound.protection.outlook.com) ([104.47.58.103])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 13 Jul 2023 11:14:39 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by SJ0PR03MB6344.namprd03.prod.outlook.com (2603:10b6:a03:395::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Thu, 13 Jul
 2023 15:14:36 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::f3c4:948d:a70a:de2a]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::f3c4:948d:a70a:de2a%5]) with mapi id 15.20.6588.025; Thu, 13 Jul 2023
 15:14:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fd42a861-218f-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689261282;
  h=message-id:date:subject:to:cc:references:from:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=IPPkEQVeSGFSttT+Zv26DftA4N4vBn0+PGuVY/jt1P4=;
  b=RtpDWuW21GyGKoZmmzf5zQvsqO7TFjT0zXudRdt3y30ecsY5+in1u/QY
   epsB6u3go9jpI8e7QP+KvxVKaW8zj/UDZsiJ7B2y380UvvKMxhKyJ5VV1
   PRLgAkytYiUu9s+/NPgy/jNbsoUFiWb/N2wuKlCy0ZSbHNXhKjOS5EiPl
   8=;
X-IronPort-RemoteIP: 104.47.58.103
X-IronPort-MID: 116137583
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:fOUOyq5FB+3cSmKTvYX2JQxRtBvGchMFZxGqfqrLs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CR2fiIP2U21lDa177y/OASZ2xp2aUIz/Z4StV
 LdlhD/5OGFu/W2oyWssFP73tBtgd78zdkGItKKhtN9EESLti+YIL55XqGEvnQOgMzH0idTrP
 D85y04Oth16TfqcnqrrQDL0w3tuQxekEPK+BujmH7+ps68ez4gEcpGgutiA2Hk13Y=
X-Talos-CUID: 9a23:Y99ELm2ZvDBjIFDZj9z/6rxfEc8fLGbC733pH1a1LDtQZJ/OUlm80fYx
X-Talos-MUID: 9a23:YJewPQQnKcHmkDTBRXTOgAtHLPdX3ZiLAXJKs7gso9OaEwpZbmI=
X-IronPort-AV: E=Sophos;i="6.01,203,1684814400"; 
   d="scan'208";a="116137583"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=g7Ih3mfJgjCtC9X14Uq5eXkAcH5DgZgsV3AQ4GF/f/xwkzZDX27g1jygtcZ+5DW+0bxI6an4b6qfxO8JM6ZSN0NJrqI4U6CciSXXPl+rcO+wUKnYoPMjMoy199dXFhJ46xaZUOaDTNQNYvvZSpifOApNVNuwDFPm26hMWOMKpquo2Nao1BgntP9k6us13rM5SBl8kRG8AIbxYyUw6IdonubwKeG3oTcx19aj/h1idy8zPVASxopHOJyasyPg0hti4gHGwBHh/7YnI7FGe9oJo2KWGVsC6UhyJU/8a3PAz/mMwMDqr/TOvnzjoGhqe//GrHruaxY/UIO8Nc42zLfYMg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MJsj4KSe5JAhjFlCBYkS2o/CEljs6ul5TGHCIlkNXKc=;
 b=G/x8IRKDG98vRBbiYPtWliED5ahHrm1OyItnjWLcArjRE7OuVwRYEP39eS2BKFI5wpaS6wF+7T2XF7aEWsF1naDuYkqkbWdMG2Oz51sHRF2OgKBqi7YBK7e8Iy+3XIBNMqHaAojBtymXCjTLjA9nONty2tAGaCPchyI3QGLGEHkH7Z/b98i8LXjxVOHCE5WW2G7xBjRizE3+OY40a7xRzAjdJ9MLJGewA5b26xPumVKxd4ZJ0xxxbVZ47/fYnF7uW+YfUlklOSVv0OEEv+E7Hd/0qOq7vX2fukOYYhQ67OOsvNz7btUVWMkzUfgGc2hfifvcQ1rx8MVrYJ1XicWZQg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MJsj4KSe5JAhjFlCBYkS2o/CEljs6ul5TGHCIlkNXKc=;
 b=qQQJNPIzWMUXhQChBEBd+mnkQ/aIHWQfikn2P4E7/zxrgdDHsSWZb2zxtKTL8+MJQZ8C7fF4TKtd/JayG/8C18owpmsHH7DMTnwV1AdxLLWLcVUJxrgD9/R0OZpRj7ZTHIUZOweloFyEgjhKFbwjbUXM/gxuG4q48uyf+EWGXQE=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <6cb49c4c-b355-38a0-5d96-9ca4938ac145@citrix.com>
Date: Thu, 13 Jul 2023 16:14:30 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 1/6] libs/guest: introduce support for setting guest
 MSRs
Content-Language: en-GB
To: Roger Pau Monne <roger.pau@citrix.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>,
 Juergen Gross <jgross@suse.com>
References: <20230711092230.15408-1-roger.pau@citrix.com>
 <20230711092230.15408-2-roger.pau@citrix.com>
From: Andrew Cooper <andrew.cooper3@citrix.com>
In-Reply-To: <20230711092230.15408-2-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0206.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a5::13) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|SJ0PR03MB6344:EE_
X-MS-Office365-Filtering-Correlation-Id: 5a39743c-6a14-4a1c-1ffa-08db83b3deb4
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Y87/z0rUEHtNcPv9hmBjpIO2y0HvljN8XdB64pEweP0Hg52JfGdc6baWxiKzTfT4sS7ZB0lJ4zlZfdT0h6lTc5JYTDNE7UX5PGpJhbOj9dLWVyczr9IsJ6e87inJVyhxcEGusrQB84yGjzANDUQaxUz1SuSP2sbxKuvMlIUmemb68c0ENue/iDefMw3Y51eM84bWWMUCsDINF0gh8rSEjj+oMW3HjMPztBkM0FYrwSTr1+VmUTYpQogmsM9tVSQgqsdTqyKtWg1Izod9vOXouTtPZW5wyoOQWltvIw+zSB8dirIxOHQViRq/59TjG/IQgspNAMELkJhWJoKUFV5dluAauRWJyfJsJ4CC4O4lqGK5NZRjSAmWOd+gWI2d+PyqhdgAsKFvI2yKGKDVrTOQ2oQhZUb9OgjXWhog/C/6GEiozJ2kMs6pu4XqXq0LfYvh3K44dIM7i/5S6TrmE9Y7kfRCk9gN2m7uOUQDtTbS+H+Km/kWiwY8/uyKRIl5jQAvmKfoLJCqr6uPTHTdujcQguUhN7u9YED3ImhC/KXWfhQ2xg4XtwPsHJ0ItdxK5c5n12QrT6tlgk5HUja1dXB5+Ff/io4YUI3mHbclv9Qwx0sYP84z2WNGPmhddkMxf3AphY6AoyPzK1nP32TflcXuPg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(366004)(39860400002)(396003)(346002)(451199021)(31686004)(6666004)(6486002)(478600001)(54906003)(86362001)(36756003)(31696002)(2616005)(4744005)(2906002)(26005)(6506007)(186003)(66946007)(53546011)(316002)(6512007)(8676002)(8936002)(38100700002)(5660300002)(66556008)(82960400001)(66476007)(41300700001)(4326008)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eXNpbTQ3dHRxcUhRa0FRdElXaG1PQU83c1VQTUszcm00YW43NXdlZ01EQUNY?=
 =?utf-8?B?dm5hK1NhRUZDWW1MUVdDd29lRVNKS1lnakJ0b3NGUjlVOFUvQyszU3RlTWtp?=
 =?utf-8?B?dW50a3UrNllSYkcyTEd6SzM4UFBPdzhveTQ1UU4rODFMejQzZFhlN01YQTVW?=
 =?utf-8?B?VlJ3WWkxdC9UbmQ5ck1vaXhVSUhIbmZ4bkhwYUZBMHBBUjJ1elVweExTZ0lH?=
 =?utf-8?B?aDU2dEFPZWs4WnlnUlMvVW1CTTloL01qVk5BL01YWVF5SmNVQmhvWFliQmpJ?=
 =?utf-8?B?MFBBS2psalBVT1ZWOW1ZZktTblNKWjBNTm1UOUlzaS8zQ1JDcG96S0FldmJZ?=
 =?utf-8?B?YWcySTZnVFNJTE9zZXI2ZDg2bzcxQ0FoY2d2WmZvVjVXZTd6NENqa3YxTkdM?=
 =?utf-8?B?dU93OGJkTGN6dGw5NHQxUnd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?B?b3c9PQ==?=
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	rK7qZAW/zG3whjcXawMNacZ545Yw5ocwSk5bPMHR+IPef4pD6hWzvTbizIe+/3d6lpRkzrvpSh1Dk+//RQ9GEcTfe6C1MNMDGUE1Z0vB91UDtLLSnuyuWv5aLnfvjoMgTpoOT2oSgaV6o1XZAhskMTZNVZb4VJykdeCswYd6d8TtXGS3b5icV9xKoYss1XVepgALfzGBs6ZNV0eL2/2kFHftO+sbP1LQ9zKhQTQCLitchgtjWM1wzoCs191Jv8hFLX3RCulksufannvNv55ld61+qfO/K2z1sLsl4o3O+HbRzh8M00ee7tEISTF0fQiOnmg4gE/FIWLELEaKLdv7dtJCGKnkNsFnTlWaGfqzTNaKNwj1acnWEZXkbA7RNia/EflGrgyDtvoL7nq21aUcoC7WD57hu5MMFpB7uBcBieo+dgJkXE8w5vRvyCXwscsEbijJkbASMcAT5rAu6kdH5LqzD8Ran/POZkNYFAveWcXkV74Kn3J1NV4pHqN1eSXXrrDe3iuL3nbri0BHQVeLDlvGluVWfoLCmOxQdFXkInxWbvmXi2atMxWeSMJaPI8waLodWpEjltrY6kjKwH+ATPNvqsRq2gofq2aTArewOpLGiw0SeQWwVLzWaOxH39lL3fyufaVVAAS4cyjG6YhX342shv6JrlVYbLLmt7lCoqxBOOmuc0Iyv/vbHMPVuZH1kbRzqtmlrB4SAJZGQD0Dz6gpXKglvMOn780wYEBNgQSsRTUuzVPFEWbkx9QWtskaMT7M0xA+q7VLv5qjrguVdO0pCiepd3FhN489BGtAq1m4+cn7M0gJA8IwKICVA6WD
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5a39743c-6a14-4a1c-1ffa-08db83b3deb4
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 15:14:36.4579
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 7VSRx/1u7inW9bAZHH5X57dfstjXSsM5fAXeIW4qnJyocKfSPolK//1/eDMU2MyhWwS9pu9Ek4DAGLorVeELYzRt8mwqJVTlMmQm8rLXABU=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB6344

On 11/07/2023 10:22 am, Roger Pau Monne wrote:
> diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c
> index 5b035223f4f5..5e5c8124dd74 100644
> --- a/tools/libs/guest/xg_cpuid_x86.c
> +++ b/tools/libs/guest/xg_cpuid_x86.c
> @@ -423,10 +423,169 @@ static int xc_cpuid_xend_policy(
>      return rc;
>  }
>  
> +static int compare_msr(const void *l, const void *r)
> +{
> +    const xen_msr_entry_t *lhs = l;
> +    const xen_msr_entry_t *rhs = r;
> +
> +    if ( lhs->idx == rhs->idx )
> +        return 0;
> +
> +    return lhs->idx < rhs->idx ? -1 : 1;

The sum total of logic here is just

return lhs->idx - rhs->idx;

(I think.Â  Double check which way around the subtraction works.)

You don't need to return -1, 0 or 1.Â  You only need negative, 0 or positive.

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 15:20:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 15:20:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563215.880342 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJy6h-00019Q-RK; Thu, 13 Jul 2023 15:19:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563215.880342; Thu, 13 Jul 2023 15:19:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJy6h-00019J-OZ; Thu, 13 Jul 2023 15:19:51 +0000
Received: by outflank-mailman (input) for mailman id 563215;
 Thu, 13 Jul 2023 15:09:12 +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
 <SRS0=8EtB=C7=suse.de=tzimmermann@srs-se1.protection.inumbo.net>)
 id 1qJxwO-0007Ny-Gs
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 15:09:12 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 36c741db-218f-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 17:09:08 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 7C6A52215A;
 Thu, 13 Jul 2023 15:09:07 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D4808133D6;
 Thu, 13 Jul 2023 15:09:03 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 08LHMo8TsGTCBQAAMHmgww
 (envelope-from <tzimmermann@suse.de>); Thu, 13 Jul 2023 15:09:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 36c741db-218f-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1689260947; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=MS6Q/88TMXWzZPXfu/PTu2qDJkEKMqR1diKbb8wT1eU=;
	b=cEBc0UcNtLsv9/np6kbLs/An3rRHlzzg4WKB1vazu2CrpKaBj2wmoM6mOu0B48lqik2WZU
	s0jUIKNWNSsjxwILxBM98lddtS+cUFtia+65jXw7n0fBK7Q5iNfwmfJLNnBLiP47Upwn23
	PHKmf1yem40W1KFSIQvAVq4ArQzWMuk=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1689260947;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=MS6Q/88TMXWzZPXfu/PTu2qDJkEKMqR1diKbb8wT1eU=;
	b=Vl/f6Y8CEHJhBZGlsg6hVEEwlwTtg+HhIYHsDOu10IZWCZUdlBGSixnruIlV04LbwCBXFV
	h0UKbVbUcp8wDlBA==
Message-ID: <78be52b8-5ffb-601a-84b2-ead2894973a6@suse.de>
Date: Thu, 13 Jul 2023 17:09:02 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [Freedreno] [PATCH RFC v1 00/52] drm/crtc: Rename struct
 drm_crtc::dev to drm_dev
Content-Language: en-US
To: Sean Paul <seanpaul@chromium.org>,
 =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= <u.kleine-koenig@pengutronix.de>
Cc: Jani Nikula <jani.nikula@intel.com>, =?UTF-8?Q?Heiko_St=c3=bcbner?=
 <heiko@sntech.de>, Geert Uytterhoeven <geert+renesas@glider.be>,
 Xinliang Liu <xinliang.liu@linaro.org>,
 Linus Walleij <linus.walleij@linaro.org>,
 Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
 Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
 dri-devel@lists.freedesktop.org,
 Vandita Kulkarni <vandita.kulkarni@intel.com>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 Jonathan Hunter <jonathanh@nvidia.com>,
 Arun R Murthy <arun.r.murthy@intel.com>, Jerome Brunet
 <jbrunet@baylibre.com>, Liu Shixin <liushixin2@huawei.com>,
 linux-samsung-soc@vger.kernel.org, Samuel Holland <samuel@sholland.org>,
 Matt Roper <matthew.d.roper@intel.com>, Wenjing Liu <wenjing.liu@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
 Danilo Krummrich <dakr@redhat.com>, NXP Linux Team <linux-imx@nxp.com>,
 spice-devel@lists.freedesktop.org,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 linux-sunxi@lists.linux.dev, Stylon Wang <stylon.wang@amd.com>,
 Tim Huang <Tim.Huang@amd.com>, Suraj Kandpal <suraj.kandpal@intel.com>,
 =?UTF-8?Q?Andr=c3=a9_Almeida?= <andrealmeid@igalia.com>,
 Andi Shyti <andi.shyti@linux.intel.com>, Yifan Zhang <yifan1.zhang@amd.com>,
 Leo Li <sunpeng.li@amd.com>, Sascha Hauer <s.hauer@pengutronix.de>,
 Lucas De Marchi <lucas.demarchi@intel.com>, Inki Dae <inki.dae@samsung.com>,
 Hersen Wu <hersenxs.wu@amd.com>, Jessica Zhang <quic_jesszhan@quicinc.com>,
 Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
 Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
 =?UTF-8?Q?=c5=81ukasz_Bartosik?= <lb@semihalf.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
 Andrew Jeffery <andrew@aj.id.au>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= <noralf@tronnes.org>, kernel@pengutronix.de,
 Alex Deucher <alexander.deucher@amd.com>, freedreno@lists.freedesktop.org,
 Claudiu Beznea <claudiu.beznea@microchip.com>, Zack Rusin
 <zackr@vmware.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org,
 Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
 =?UTF-8?Q?Jos=c3=a9_Roberto_de_Souza?= <jose.souza@intel.com>,
 virtualization@lists.linux-foundation.org,
 Thierry Reding <thierry.reding@gmail.com>,
 Yongqin Liu <yongqin.liu@linaro.org>,
 Mario Limonciello <mario.limonciello@amd.com>, Fei Yang
 <fei.yang@intel.com>, =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?=
 <ville.syrjala@linux.intel.com>, David Lechner <david@lechnology.com>,
 Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
 "Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
 David Francis <David.Francis@amd.com>, Aaron Liu <aaron.liu@amd.com>,
 Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
 Vinod Polimera <quic_vpolimer@quicinc.com>,
 linux-rockchip@lists.infradead.org, Fangzhi Zuo <jerry.zuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>,
 VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
 Ben Skeggs <bskeggs@redhat.com>, =?UTF-8?Q?Jouni_H=c3=b6gander?=
 <jouni.hogander@intel.com>, Dave Airlie <airlied@redhat.com>,
 linux-mips@vger.kernel.org, Gurchetan Singh <gurchetansingh@chromium.org>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-arm-msm@vger.kernel.org, Animesh Manna <animesh.manna@intel.com>,
 linux-renesas-soc@vger.kernel.org, Maxime Ripard <mripard@kernel.org>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
 Philipp Zabel <p.zabel@pengutronix.de>, linux-amlogic@lists.infradead.org,
 Evan Quan <evan.quan@amd.com>, Michal Simek <michal.simek@amd.com>,
 linux-arm-kernel@lists.infradead.org, Sean Paul <sean@poorly.run>,
 Neil Armstrong <neil.armstrong@linaro.org>,
 Kai Vehmanen <kai.vehmanen@linux.intel.com>,
 Boris Brezillon <bbrezillon@kernel.org>, Chunyan Zhang
 <zhang.lyra@gmail.com>, Qingqing Zhuo <qingqing.zhuo@amd.com>,
 Sandy Huang <hjc@rock-chips.com>, Swati Sharma <swati2.sharma@intel.com>,
 John Stultz <jstultz@google.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Drew Davenport <ddavenport@chromium.org>, Kevin Hilman
 <khilman@baylibre.com>, Hawking Zhang <Hawking.Zhang@amd.com>,
 Haneen Mohammed <hamohammed.sa@gmail.com>,
 Anusha Srivatsa <anusha.srivatsa@intel.com>,
 Dan Carpenter <error27@gmail.com>, Karol Herbst <kherbst@redhat.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 linux-hyperv@vger.kernel.org, Stefan Agner <stefan@agner.ch>,
 Melissa Wen <melissa.srw@gmail.com>, =?UTF-8?Q?Ma=c3=adra_Canal?=
 <mairacanal@riseup.net>, Luca Coelho <luciano.coelho@intel.com>,
 Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
 Andrzej Hajda <andrzej.hajda@intel.com>, Likun Gao <Likun.Gao@amd.com>,
 Sam Ravnborg <sam@ravnborg.org>, Alain Volmat <alain.volmat@foss.st.com>,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 Jernej Skrabec <jernej.skrabec@gmail.com>,
 Deepak Rawat <drawat.floss@gmail.com>, Chen-Yu Tsai <wens@csie.org>,
 Joel Stanley <joel@jms.id.au>, Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
 Harry Wentland <harry.wentland@amd.com>,
 Sumit Semwal <sumit.semwal@linaro.org>, Alan Liu <haoping.liu@amd.com>,
 Philip Yang <Philip.Yang@amd.com>, Lyude Paul <lyude@redhat.com>,
 intel-gfx@lists.freedesktop.org, Alison Wang <alison.wang@nxp.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>,
 Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Gustavo Sousa <gustavo.sousa@intel.com>,
 Baolin Wang <baolin.wang@linux.alibaba.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
 Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
 Tomi Valkeinen <tomba@kernel.org>, Deepak R Varma <drv@mailo.com>,
 "Pan, Xinhui" <Xinhui.Pan@amd.com>, Biju Das <biju.das.jz@bp.renesas.com>,
 Chia-I Wu <olvaffe@gmail.com>, Konrad Dybcio <konrad.dybcio@linaro.org>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Tian Tao <tiantao6@hisilicon.com>, Shawn Guo <shawnguo@kernel.org>,
 =?UTF-8?Q?Christian_K=c3=b6nig?= <christian.koenig@amd.com>,
 Khaled Almahallawy <khaled.almahallawy@intel.com>,
 linux-stm32@st-md-mailman.stormreply.com, Emma Anholt <emma@anholt.net>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>, Imre Deak <imre.deak@intel.com>,
 Liviu Dudau <liviu.dudau@arm.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>, Roman Li
 <roman.li@amd.com>, Paul Cercueil <paul@crapouillou.net>,
 Rob Clark <robdclark@gmail.com>, Hamza Mahfooz <hamza.mahfooz@amd.com>,
 David Airlie <airlied@gmail.com>, Marek Vasut <marex@denx.de>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 xen-devel@lists.xenproject.org, Guchun Chen <guchun.chen@amd.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
 Russell King <linux@armlinux.org.uk>, Uma Shankar <uma.shankar@intel.com>,
 Mika Kahola <mika.kahola@intel.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Jiasheng Jiang <jiasheng@iscas.ac.cn>,
 Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 linux-tegra@vger.kernel.org, =?UTF-8?B?TWFyZWsgT2zFocOhaw==?=
 <marek.olsak@amd.com>, Maarten Lankhorst
 <maarten.lankhorst@linux.intel.com>,
 =?UTF-8?Q?Joaqu=c3=adn_Ignacio_Aramend=c3=ada?= <samsagax@gmail.com>,
 Melissa Wen <mwen@igalia.com>, Hans de Goede <hdegoede@redhat.com>,
 linux-mediatek@lists.infradead.org, Fabio Estevam <festevam@gmail.com>,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 David Tadokoro <davidbtadokoro@usp.br>,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 Orson Zhai <orsonzhai@gmail.com>, amd-gfx@lists.freedesktop.org,
 Jyri Sarha <jyri.sarha@iki.fi>, Yannick Fertre <yannick.fertre@foss.st.com>,
 Nicolas Ferre <nicolas.ferre@microchip.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Philippe Cornu <philippe.cornu@foss.st.com>, Daniel Vetter
 <daniel@ffwll.ch>, Wayne Lin <Wayne.Lin@amd.com>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
 Nirmoy Das <nirmoy.das@intel.com>, Lang Yu <Lang.Yu@amd.com>,
 Lucas Stach <l.stach@pengutronix.de>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com>
 <CAOw6vbLO_UaXDbTCtAQJgthXOUMPqEV+c2MQhP-1DuK44OhGxw@mail.gmail.com>
 <20230713130337.fd2l67r23g2irifx@pengutronix.de>
 <CAOw6vbKtjyUm+OqO7LSV1hDOMQATwkEWP4GzBbbXib0i5EviUQ@mail.gmail.com>
From: Thomas Zimmermann <tzimmermann@suse.de>
In-Reply-To: <CAOw6vbKtjyUm+OqO7LSV1hDOMQATwkEWP4GzBbbXib0i5EviUQ@mail.gmail.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------UZzIExM15Kv5h8d3TfG92PJg"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------UZzIExM15Kv5h8d3TfG92PJg
Content-Type: multipart/mixed; boundary="------------MlAYonS9DhZc9LUjMUrylqL8";
 protected-headers="v1"
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Sean Paul <seanpaul@chromium.org>,
 =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= <u.kleine-koenig@pengutronix.de>
Cc: Jani Nikula <jani.nikula@intel.com>, =?UTF-8?Q?Heiko_St=c3=bcbner?=
 <heiko@sntech.de>, Geert Uytterhoeven <geert+renesas@glider.be>,
 Xinliang Liu <xinliang.liu@linaro.org>,
 Linus Walleij <linus.walleij@linaro.org>,
 Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
 Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
 dri-devel@lists.freedesktop.org,
 Vandita Kulkarni <vandita.kulkarni@intel.com>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 Jonathan Hunter <jonathanh@nvidia.com>,
 Arun R Murthy <arun.r.murthy@intel.com>, Jerome Brunet
 <jbrunet@baylibre.com>, Liu Shixin <liushixin2@huawei.com>,
 linux-samsung-soc@vger.kernel.org, Samuel Holland <samuel@sholland.org>,
 Matt Roper <matthew.d.roper@intel.com>, Wenjing Liu <wenjing.liu@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
 Danilo Krummrich <dakr@redhat.com>, NXP Linux Team <linux-imx@nxp.com>,
 spice-devel@lists.freedesktop.org,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 linux-sunxi@lists.linux.dev, Stylon Wang <stylon.wang@amd.com>,
 Tim Huang <Tim.Huang@amd.com>, Suraj Kandpal <suraj.kandpal@intel.com>,
 =?UTF-8?Q?Andr=c3=a9_Almeida?= <andrealmeid@igalia.com>,
 Andi Shyti <andi.shyti@linux.intel.com>, Yifan Zhang <yifan1.zhang@amd.com>,
 Leo Li <sunpeng.li@amd.com>, Sascha Hauer <s.hauer@pengutronix.de>,
 Lucas De Marchi <lucas.demarchi@intel.com>, Inki Dae <inki.dae@samsung.com>,
 Hersen Wu <hersenxs.wu@amd.com>, Jessica Zhang <quic_jesszhan@quicinc.com>,
 Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
 Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
 =?UTF-8?Q?=c5=81ukasz_Bartosik?= <lb@semihalf.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
 Andrew Jeffery <andrew@aj.id.au>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= <noralf@tronnes.org>, kernel@pengutronix.de,
 Alex Deucher <alexander.deucher@amd.com>, freedreno@lists.freedesktop.org,
 Claudiu Beznea <claudiu.beznea@microchip.com>, Zack Rusin
 <zackr@vmware.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org,
 Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
 =?UTF-8?Q?Jos=c3=a9_Roberto_de_Souza?= <jose.souza@intel.com>,
 virtualization@lists.linux-foundation.org,
 Thierry Reding <thierry.reding@gmail.com>,
 Yongqin Liu <yongqin.liu@linaro.org>,
 Mario Limonciello <mario.limonciello@amd.com>, Fei Yang
 <fei.yang@intel.com>, =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?=
 <ville.syrjala@linux.intel.com>, David Lechner <david@lechnology.com>,
 Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
 "Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
 David Francis <David.Francis@amd.com>, Aaron Liu <aaron.liu@amd.com>,
 Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
 Vinod Polimera <quic_vpolimer@quicinc.com>,
 linux-rockchip@lists.infradead.org, Fangzhi Zuo <jerry.zuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>,
 VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
 Ben Skeggs <bskeggs@redhat.com>, =?UTF-8?Q?Jouni_H=c3=b6gander?=
 <jouni.hogander@intel.com>, Dave Airlie <airlied@redhat.com>,
 linux-mips@vger.kernel.org, Gurchetan Singh <gurchetansingh@chromium.org>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-arm-msm@vger.kernel.org, Animesh Manna <animesh.manna@intel.com>,
 linux-renesas-soc@vger.kernel.org, Maxime Ripard <mripard@kernel.org>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
 Philipp Zabel <p.zabel@pengutronix.de>, linux-amlogic@lists.infradead.org,
 Evan Quan <evan.quan@amd.com>, Michal Simek <michal.simek@amd.com>,
 linux-arm-kernel@lists.infradead.org, Sean Paul <sean@poorly.run>,
 Neil Armstrong <neil.armstrong@linaro.org>,
 Kai Vehmanen <kai.vehmanen@linux.intel.com>,
 Boris Brezillon <bbrezillon@kernel.org>, Chunyan Zhang
 <zhang.lyra@gmail.com>, Qingqing Zhuo <qingqing.zhuo@amd.com>,
 Sandy Huang <hjc@rock-chips.com>, Swati Sharma <swati2.sharma@intel.com>,
 John Stultz <jstultz@google.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Drew Davenport <ddavenport@chromium.org>, Kevin Hilman
 <khilman@baylibre.com>, Hawking Zhang <Hawking.Zhang@amd.com>,
 Haneen Mohammed <hamohammed.sa@gmail.com>,
 Anusha Srivatsa <anusha.srivatsa@intel.com>,
 Dan Carpenter <error27@gmail.com>, Karol Herbst <kherbst@redhat.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 linux-hyperv@vger.kernel.org, Stefan Agner <stefan@agner.ch>,
 Melissa Wen <melissa.srw@gmail.com>, =?UTF-8?Q?Ma=c3=adra_Canal?=
 <mairacanal@riseup.net>, Luca Coelho <luciano.coelho@intel.com>,
 Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
 Andrzej Hajda <andrzej.hajda@intel.com>, Likun Gao <Likun.Gao@amd.com>,
 Sam Ravnborg <sam@ravnborg.org>, Alain Volmat <alain.volmat@foss.st.com>,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 Jernej Skrabec <jernej.skrabec@gmail.com>,
 Deepak Rawat <drawat.floss@gmail.com>, Chen-Yu Tsai <wens@csie.org>,
 Joel Stanley <joel@jms.id.au>, Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
 Harry Wentland <harry.wentland@amd.com>,
 Sumit Semwal <sumit.semwal@linaro.org>, Alan Liu <haoping.liu@amd.com>,
 Philip Yang <Philip.Yang@amd.com>, Lyude Paul <lyude@redhat.com>,
 intel-gfx@lists.freedesktop.org, Alison Wang <alison.wang@nxp.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>,
 Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Gustavo Sousa <gustavo.sousa@intel.com>,
 Baolin Wang <baolin.wang@linux.alibaba.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
 Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
 Tomi Valkeinen <tomba@kernel.org>, Deepak R Varma <drv@mailo.com>,
 "Pan, Xinhui" <Xinhui.Pan@amd.com>, Biju Das <biju.das.jz@bp.renesas.com>,
 Chia-I Wu <olvaffe@gmail.com>, Konrad Dybcio <konrad.dybcio@linaro.org>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Tian Tao <tiantao6@hisilicon.com>, Shawn Guo <shawnguo@kernel.org>,
 =?UTF-8?Q?Christian_K=c3=b6nig?= <christian.koenig@amd.com>,
 Khaled Almahallawy <khaled.almahallawy@intel.com>,
 linux-stm32@st-md-mailman.stormreply.com, Emma Anholt <emma@anholt.net>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>, Imre Deak <imre.deak@intel.com>,
 Liviu Dudau <liviu.dudau@arm.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>, Roman Li
 <roman.li@amd.com>, Paul Cercueil <paul@crapouillou.net>,
 Rob Clark <robdclark@gmail.com>, Hamza Mahfooz <hamza.mahfooz@amd.com>,
 David Airlie <airlied@gmail.com>, Marek Vasut <marex@denx.de>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 xen-devel@lists.xenproject.org, Guchun Chen <guchun.chen@amd.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
 Russell King <linux@armlinux.org.uk>, Uma Shankar <uma.shankar@intel.com>,
 Mika Kahola <mika.kahola@intel.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Jiasheng Jiang <jiasheng@iscas.ac.cn>,
 Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 linux-tegra@vger.kernel.org, =?UTF-8?B?TWFyZWsgT2zFocOhaw==?=
 <marek.olsak@amd.com>, Maarten Lankhorst
 <maarten.lankhorst@linux.intel.com>,
 =?UTF-8?Q?Joaqu=c3=adn_Ignacio_Aramend=c3=ada?= <samsagax@gmail.com>,
 Melissa Wen <mwen@igalia.com>, Hans de Goede <hdegoede@redhat.com>,
 linux-mediatek@lists.infradead.org, Fabio Estevam <festevam@gmail.com>,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 David Tadokoro <davidbtadokoro@usp.br>,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 Orson Zhai <orsonzhai@gmail.com>, amd-gfx@lists.freedesktop.org,
 Jyri Sarha <jyri.sarha@iki.fi>, Yannick Fertre <yannick.fertre@foss.st.com>,
 Nicolas Ferre <nicolas.ferre@microchip.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Philippe Cornu <philippe.cornu@foss.st.com>, Daniel Vetter
 <daniel@ffwll.ch>, Wayne Lin <Wayne.Lin@amd.com>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
 Nirmoy Das <nirmoy.das@intel.com>, Lang Yu <Lang.Yu@amd.com>,
 Lucas Stach <l.stach@pengutronix.de>
Message-ID: <78be52b8-5ffb-601a-84b2-ead2894973a6@suse.de>
Subject: Re: [Freedreno] [PATCH RFC v1 00/52] drm/crtc: Rename struct
 drm_crtc::dev to drm_dev
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com>
 <CAOw6vbLO_UaXDbTCtAQJgthXOUMPqEV+c2MQhP-1DuK44OhGxw@mail.gmail.com>
 <20230713130337.fd2l67r23g2irifx@pengutronix.de>
 <CAOw6vbKtjyUm+OqO7LSV1hDOMQATwkEWP4GzBbbXib0i5EviUQ@mail.gmail.com>
In-Reply-To: <CAOw6vbKtjyUm+OqO7LSV1hDOMQATwkEWP4GzBbbXib0i5EviUQ@mail.gmail.com>

--------------MlAYonS9DhZc9LUjMUrylqL8
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

SGkNCg0KQW0gMTMuMDcuMjMgdW0gMTY6NDEgc2NocmllYiBTZWFuIFBhdWw6DQo+IE9uIFRo
dSwgSnVsIDEzLCAyMDIzIGF0IDk6MDTigK9BTSBVd2UgS2xlaW5lLUvDtm5pZw0KPiA8dS5r
bGVpbmUta29lbmlnQHBlbmd1dHJvbml4LmRlPiB3cm90ZToNCj4+DQo+PiBoZWxsbyBTZWFu
LA0KPj4NCj4+IE9uIFdlZCwgSnVsIDEyLCAyMDIzIGF0IDAyOjMxOjAyUE0gLTA0MDAsIFNl
YW4gUGF1bCB3cm90ZToNCj4+PiBJJ2QgcmVhbGx5IHByZWZlciB0aGlzIHBhdGNoIChzZXJp
ZXMgb3Igc2luZ2xlKSBpcyBub3QgYWNjZXB0ZWQuIFRoaXMNCj4+PiB3aWxsIGNhdXNlIHBy
b2JsZW1zIGZvciBldmVyeW9uZSBjaGVycnktcGlja2luZyBwYXRjaGVzIHRvIGENCj4+PiBk
b3duc3RyZWFtIGtlcm5lbCAoTFRTIG9yIG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UgeW91ciBlbmdhZ2Vt
ZW50IG9uIHRoZSB0b3BpYywgdGhhbmsgeW91IQ0KPiANCj4gU2Vhbg0KPiANCj4+DQo+PiBU
aGFua3MgZm9yIHlvdXIgaW5wdXQsIGJlc3QgcmVnYXJkcw0KPj4gVXdlDQo+Pg0KPj4gLS0N
Cj4+IFBlbmd1dHJvbml4IGUuSy4gICAgICAgICAgICAgICAgICAgICAgICAgICB8IFV3ZSBL
bGVpbmUtS8O2bmlnICAgICAgICAgICAgfA0KPj4gSW5kdXN0cmlhbCBMaW51eCBTb2x1dGlv
bnMgICAgICAgICAgICAgICAgIHwgaHR0cHM6Ly93d3cucGVuZ3V0cm9uaXguZGUvIHwNCg0K
LS0gDQpUaG9tYXMgWmltbWVybWFubg0KR3JhcGhpY3MgRHJpdmVyIERldmVsb3Blcg0KU1VT
RSBTb2Z0d2FyZSBTb2x1dGlvbnMgR2VybWFueSBHbWJIDQpGcmFua2Vuc3RyYXNzZSAxNDYs
IDkwNDYxIE51ZXJuYmVyZywgR2VybWFueQ0KR0Y6IEl2byBUb3RldiwgQW5kcmV3IE15ZXJz
LCBBbmRyZXcgTWNEb25hbGQsIEJvdWRpZW4gTW9lcm1hbg0KSFJCIDM2ODA5IChBRyBOdWVy
bmJlcmcpDQo=

--------------MlAYonS9DhZc9LUjMUrylqL8--

--------------UZzIExM15Kv5h8d3TfG92PJg
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEExndm/fpuMUdwYFFolh/E3EQov+AFAmSwE44FAwAAAAAACgkQlh/E3EQov+CI
yQ//aZHYhcxB037tgGfzs4wCdHrFdvhb5Mqh5H9F2uMCAuLkMCZZ6zMzqlDeOTNynCNJ8xBXx/tY
Z9jdNWdNGgTZE4GyX63pd3sAgBDtmj62p2x5eeBhve2bM01a7BvueZoqQ7bKedRwl7xyVPZYM11a
zBT+/iz7U+E/+N5J66ZaUOVWiIW1CAo+Z+zxewzXD+pjA/earmoHjIu+01QUsUyUQ9OX9cQpJOPv
/J0bNuItNGvILSLV7rR70FF55hJ/DbyvlCgOmrbhFRsVX4uuuuCAW3gAoTu/UFq+ZWhUDV0Td3Bg
jb/adYZH7VmxHTv6LOheoWTgj3K8qjK+fgbTIZy/Llzenh1R+b8cf5hbIMirI2i1BdNLqiRZggWK
cuEA8icsjxmmXDpLK1+bRk5L5Jh0oKmI3AJztXIFAQIC/KiC4S2a2onb7toJyFvoeEzbIdpR5xXw
a7NhaDkGwksRiHgQv1BMO4GIZtkzMqxja6qqac1CQxnU3nyBH3rBjSiT36K7+uyMQkw/11rNweNU
Bp/pM3ZcHIUoyP6oJTuIYWZm7drTbfstCMjAuQGT+EY1V/vHJifdtruW29QM9DsXPz09pkFR0REk
f/Xbx4gNiXjL6H17xkRd1v/NJ/NTJXoxF1Oc9H46yvUMX4Vj8klQKGqEcnUzYWmAQB8VdfHTff1e
ztc=
=359C
-----END PGP SIGNATURE-----

--------------UZzIExM15Kv5h8d3TfG92PJg--


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 15:20:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 15:20:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563226.880347 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJy6i-0001Ca-3B; Thu, 13 Jul 2023 15:19:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563226.880347; Thu, 13 Jul 2023 15:19:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJy6h-0001By-Vk; Thu, 13 Jul 2023 15:19:51 +0000
Received: by outflank-mailman (input) for mailman id 563226;
 Thu, 13 Jul 2023 15:15:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=no0J=C7=linux.intel.com=tvrtko.ursulin@srs-se1.protection.inumbo.net>)
 id 1qJy2p-00011Z-MS
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 15:15:51 +0000
Received: from mga18.intel.com (mga18.intel.com [134.134.136.126])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 240fbcfb-2190-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 17:15:48 +0200 (CEST)
Received: from fmsmga006.fm.intel.com ([10.253.24.20])
 by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 13 Jul 2023 08:15:44 -0700
Received: from apaulaux-mobl.ger.corp.intel.com (HELO [10.213.206.56])
 ([10.213.206.56])
 by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 13 Jul 2023 08:14:58 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 240fbcfb-2190-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1689261348; x=1720797348;
  h=message-id:date:mime-version:subject:to:cc:references:
   from:in-reply-to:content-transfer-encoding;
  bh=FdV+ihBB75TX4OJUKwPysdCuraDJ8JqOsAXrG1NV6Qw=;
  b=RWlgdMrt8+bpnTLUPvcDLKRRTjVo0+h/H74wgrwp+mToZcR+LhUHgDT9
   z9jZaRhcRgzL3PuZN1HG+yuqam+fdljJFBpp7dC0LSX80iXUp+6O2tJdj
   1vlM7Js6aFWMR4Bq9QRq1g/FtMjiO16Hyr/BR9vbesjM/VnphowPoZgt7
   R+9m5ojVlEsjWYoLntZibrezpVCuUCNbgmzxqqSHfBGRJic3p/8/WWb8N
   g8GGup2zjDZxqKx/EqVYlbTVGAU3bP6mm1paboMEcVzQRKx7Apxtg0Am+
   as/oLmgsp5H+OGfjDNp3K9xkq8XPaYMVXPsJfCYhwDW8Ny6OziK6cGszG
   Q==;
X-IronPort-AV: E=McAfee;i="6600,9927,10770"; a="350089226"
X-IronPort-AV: E=Sophos;i="6.01,203,1684825200"; 
   d="scan'208";a="350089226"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10770"; a="968656199"
X-IronPort-AV: E=Sophos;i="6.01,203,1684825200"; 
   d="scan'208";a="968656199"
Message-ID: <d6160aeb-6344-b272-775a-cb665dca46ac@linux.intel.com>
Date: Thu, 13 Jul 2023 16:14:55 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [Freedreno] [PATCH RFC v1 00/52] drm/crtc: Rename struct
 drm_crtc::dev to drm_dev
Content-Language: en-US
To: Thomas Zimmermann <tzimmermann@suse.de>, Sean Paul
 <seanpaul@chromium.org>, =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?=
 <u.kleine-koenig@pengutronix.de>
Cc: Jani Nikula <jani.nikula@intel.com>, =?UTF-8?Q?Heiko_St=c3=bcbner?=
 <heiko@sntech.de>, Geert Uytterhoeven <geert+renesas@glider.be>,
 Xinliang Liu <xinliang.liu@linaro.org>,
 Linus Walleij <linus.walleij@linaro.org>,
 Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
 Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
 dri-devel@lists.freedesktop.org,
 Vandita Kulkarni <vandita.kulkarni@intel.com>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 Jonathan Hunter <jonathanh@nvidia.com>,
 Arun R Murthy <arun.r.murthy@intel.com>, Jerome Brunet
 <jbrunet@baylibre.com>, Liu Shixin <liushixin2@huawei.com>,
 linux-samsung-soc@vger.kernel.org, Samuel Holland <samuel@sholland.org>,
 Matt Roper <matthew.d.roper@intel.com>, Wenjing Liu <wenjing.liu@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
 Danilo Krummrich <dakr@redhat.com>, NXP Linux Team <linux-imx@nxp.com>,
 spice-devel@lists.freedesktop.org,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 linux-sunxi@lists.linux.dev, Stylon Wang <stylon.wang@amd.com>,
 Tim Huang <Tim.Huang@amd.com>, Suraj Kandpal <suraj.kandpal@intel.com>,
 =?UTF-8?Q?Andr=c3=a9_Almeida?= <andrealmeid@igalia.com>,
 Andi Shyti <andi.shyti@linux.intel.com>, Yifan Zhang <yifan1.zhang@amd.com>,
 Leo Li <sunpeng.li@amd.com>, Sascha Hauer <s.hauer@pengutronix.de>,
 Lucas De Marchi <lucas.demarchi@intel.com>, Inki Dae <inki.dae@samsung.com>,
 Hersen Wu <hersenxs.wu@amd.com>, Jessica Zhang <quic_jesszhan@quicinc.com>,
 Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
 Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
 =?UTF-8?Q?=c5=81ukasz_Bartosik?= <lb@semihalf.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
 Andrew Jeffery <andrew@aj.id.au>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= <noralf@tronnes.org>, kernel@pengutronix.de,
 Alex Deucher <alexander.deucher@amd.com>, freedreno@lists.freedesktop.org,
 Claudiu Beznea <claudiu.beznea@microchip.com>, Zack Rusin
 <zackr@vmware.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org,
 Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
 =?UTF-8?Q?Jos=c3=a9_Roberto_de_Souza?= <jose.souza@intel.com>,
 virtualization@lists.linux-foundation.org,
 Thierry Reding <thierry.reding@gmail.com>,
 Yongqin Liu <yongqin.liu@linaro.org>,
 Mario Limonciello <mario.limonciello@amd.com>, Fei Yang
 <fei.yang@intel.com>, =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?=
 <ville.syrjala@linux.intel.com>, David Lechner <david@lechnology.com>,
 Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
 "Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
 David Francis <David.Francis@amd.com>, Aaron Liu <aaron.liu@amd.com>,
 Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
 Vinod Polimera <quic_vpolimer@quicinc.com>,
 linux-rockchip@lists.infradead.org, Fangzhi Zuo <jerry.zuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>,
 VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
 Ben Skeggs <bskeggs@redhat.com>, =?UTF-8?Q?Jouni_H=c3=b6gander?=
 <jouni.hogander@intel.com>, Dave Airlie <airlied@redhat.com>,
 linux-mips@vger.kernel.org, Gurchetan Singh <gurchetansingh@chromium.org>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-arm-msm@vger.kernel.org, Animesh Manna <animesh.manna@intel.com>,
 linux-renesas-soc@vger.kernel.org, Maxime Ripard <mripard@kernel.org>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
 Philipp Zabel <p.zabel@pengutronix.de>, linux-amlogic@lists.infradead.org,
 Evan Quan <evan.quan@amd.com>, Michal Simek <michal.simek@amd.com>,
 linux-arm-kernel@lists.infradead.org, Sean Paul <sean@poorly.run>,
 Neil Armstrong <neil.armstrong@linaro.org>,
 Kai Vehmanen <kai.vehmanen@linux.intel.com>,
 Boris Brezillon <bbrezillon@kernel.org>, Chunyan Zhang
 <zhang.lyra@gmail.com>, Qingqing Zhuo <qingqing.zhuo@amd.com>,
 Sandy Huang <hjc@rock-chips.com>, Swati Sharma <swati2.sharma@intel.com>,
 John Stultz <jstultz@google.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Drew Davenport <ddavenport@chromium.org>, Kevin Hilman
 <khilman@baylibre.com>, Hawking Zhang <Hawking.Zhang@amd.com>,
 Haneen Mohammed <hamohammed.sa@gmail.com>,
 Anusha Srivatsa <anusha.srivatsa@intel.com>,
 Dan Carpenter <error27@gmail.com>, Karol Herbst <kherbst@redhat.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 linux-hyperv@vger.kernel.org, Stefan Agner <stefan@agner.ch>,
 Melissa Wen <melissa.srw@gmail.com>, =?UTF-8?Q?Ma=c3=adra_Canal?=
 <mairacanal@riseup.net>, Luca Coelho <luciano.coelho@intel.com>,
 Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
 Andrzej Hajda <andrzej.hajda@intel.com>, Likun Gao <Likun.Gao@amd.com>,
 Sam Ravnborg <sam@ravnborg.org>, Alain Volmat <alain.volmat@foss.st.com>,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 Jernej Skrabec <jernej.skrabec@gmail.com>,
 Deepak Rawat <drawat.floss@gmail.com>, Chen-Yu Tsai <wens@csie.org>,
 Joel Stanley <joel@jms.id.au>, Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
 Harry Wentland <harry.wentland@amd.com>,
 Sumit Semwal <sumit.semwal@linaro.org>, Alan Liu <haoping.liu@amd.com>,
 Philip Yang <Philip.Yang@amd.com>, Lyude Paul <lyude@redhat.com>,
 intel-gfx@lists.freedesktop.org, Alison Wang <alison.wang@nxp.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>,
 Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Gustavo Sousa <gustavo.sousa@intel.com>,
 Baolin Wang <baolin.wang@linux.alibaba.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
 Tomi Valkeinen <tomba@kernel.org>, Deepak R Varma <drv@mailo.com>,
 "Pan, Xinhui" <Xinhui.Pan@amd.com>, Biju Das <biju.das.jz@bp.renesas.com>,
 Chia-I Wu <olvaffe@gmail.com>, Konrad Dybcio <konrad.dybcio@linaro.org>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Tian Tao <tiantao6@hisilicon.com>, Shawn Guo <shawnguo@kernel.org>,
 =?UTF-8?Q?Christian_K=c3=b6nig?= <christian.koenig@amd.com>,
 Khaled Almahallawy <khaled.almahallawy@intel.com>,
 linux-stm32@st-md-mailman.stormreply.com, Emma Anholt <emma@anholt.net>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>, Imre Deak <imre.deak@intel.com>,
 Liviu Dudau <liviu.dudau@arm.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>, Roman Li
 <roman.li@amd.com>, Paul Cercueil <paul@crapouillou.net>,
 Rob Clark <robdclark@gmail.com>, Hamza Mahfooz <hamza.mahfooz@amd.com>,
 David Airlie <airlied@gmail.com>, Marek Vasut <marex@denx.de>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 xen-devel@lists.xenproject.org, Guchun Chen <guchun.chen@amd.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
 Russell King <linux@armlinux.org.uk>, Uma Shankar <uma.shankar@intel.com>,
 Mika Kahola <mika.kahola@intel.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Jiasheng Jiang <jiasheng@iscas.ac.cn>,
 Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 linux-tegra@vger.kernel.org, =?UTF-8?B?TWFyZWsgT2zFocOhaw==?=
 <marek.olsak@amd.com>, Maarten Lankhorst
 <maarten.lankhorst@linux.intel.com>,
 =?UTF-8?Q?Joaqu=c3=adn_Ignacio_Aramend=c3=ada?= <samsagax@gmail.com>,
 Melissa Wen <mwen@igalia.com>, Hans de Goede <hdegoede@redhat.com>,
 linux-mediatek@lists.infradead.org, Fabio Estevam <festevam@gmail.com>,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 David Tadokoro <davidbtadokoro@usp.br>,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 Orson Zhai <orsonzhai@gmail.com>, amd-gfx@lists.freedesktop.org,
 Jyri Sarha <jyri.sarha@iki.fi>, Yannick Fertre <yannick.fertre@foss.st.com>,
 Nicolas Ferre <nicolas.ferre@microchip.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Philippe Cornu <philippe.cornu@foss.st.com>, Daniel Vetter
 <daniel@ffwll.ch>, Wayne Lin <Wayne.Lin@amd.com>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
 Nirmoy Das <nirmoy.das@intel.com>, Lang Yu <Lang.Yu@amd.com>,
 Lucas Stach <l.stach@pengutronix.de>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com>
 <CAOw6vbLO_UaXDbTCtAQJgthXOUMPqEV+c2MQhP-1DuK44OhGxw@mail.gmail.com>
 <20230713130337.fd2l67r23g2irifx@pengutronix.de>
 <CAOw6vbKtjyUm+OqO7LSV1hDOMQATwkEWP4GzBbbXib0i5EviUQ@mail.gmail.com>
 <78be52b8-5ffb-601a-84b2-ead2894973a6@suse.de>
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Organization: Intel Corporation UK Plc
In-Reply-To: <78be52b8-5ffb-601a-84b2-ead2894973a6@suse.de>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit


On 13/07/2023 16:09, Thomas Zimmermann wrote:
> Hi
> 
> Am 13.07.23 um 16:41 schrieb Sean Paul:
>> On Thu, Jul 13, 2023 at 9:04â€¯AM Uwe Kleine-KÃ¶nig
>> <u.kleine-koenig@pengutronix.de> wrote:
>>>
>>> hello Sean,
>>>
>>> On Wed, Jul 12, 2023 at 02:31:02PM -0400, Sean Paul wrote:
>>>> I'd really prefer this patch (series or single) is not accepted. This
>>>> will cause problems for everyone cherry-picking patches to a
>>>> downstream kernel (LTS or distro tree). I usually wouldn't expect
>>>> sympathy here, but the questionable benefit does not outweigh the cost
>>>> IM[biased]O.
>>>
>>> I agree that for backports this isn't so nice. However with the split
>>> approach (that was argumented against here) it's not soo bad. Patch #1
>>> (and similar changes for the other affected structures) could be
>>> trivially backported and with that it doesn't matter if you write dev or
>>> drm (or whatever name is chosen in the end); both work in the same way.
>>
>> Patch #1 avoids the need to backport the entire set, however every
>> change occuring after the rename patches will cause conflicts on
>> future cherry-picks. Downstream kernels will have to backport the
>> whole set. Backporting the entire set will create an epoch in
>> downstream kernels where cherry-picking patches preceding this set
>> will need to undergo conflict resolution as well. As mentioned in my
>> previous email, I don't expect sympathy here, it's part of maintaining
>> a downstream kernel, but there is a real cost to kernel consumers.
>>
>>>
>>> But even with the one-patch-per-rename approach I'd consider the
>>> renaming a net win, because ease of understanding code has a big value.
>>> It's value is not so easy measurable as "conflicts when backporting",
>>> but it also matters in say two years from now, while backporting
>>> shouldn't be an issue then any more.
>>
>> You've rightly identified the conjecture in your statement. I've been
>> on both sides of the argument, having written/maintained drm code
>> upstream and cherry-picked changes to a downstream kernel. Perhaps
>> it's because drm's definition of dev is ingrained in my muscle memory,
>> or maybe it's because I don't do a lot of upstream development these
>> days, but I just have a hard time seeing the benefit here.
> 
> I can only second what Sean writes. I've done quite a bit of backporting 
> of DRM code. It's hard already. And this kind of change is going to to 
> affect almost every backported DRM patch in the coming years. Not just 
> for distribution kernels, but also for upstream's stable series. It's 
> really only possible to do this change over many releases while keeping 
> compatible with the old name. So the more I think about it, the less I 
> like this change.

I've done my share of backporting, and still am doing it, so I can say I 
dislike it as much as anyone, however.. Is this an argument which the 
kernel as a wider entity typically accepts? If not could it be a 
slippery slope to start a precedent?

It is a honest question - I am not familiar if there were or were not 
any similar discussions in the past.

My gut feeling is that *if* there is a consensus that something 
_improves_ the code base significantly, backporting pains should 
probably not be weighted very heavily as a contra argument.

Regards,

Tvrtko


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 15:24:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 15:24:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563235.880362 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyBH-0003BO-QS; Thu, 13 Jul 2023 15:24:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563235.880362; Thu, 13 Jul 2023 15:24:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyBH-0003BH-Ne; Thu, 13 Jul 2023 15:24:35 +0000
Received: by outflank-mailman (input) for mailman id 563235;
 Thu, 13 Jul 2023 15:24:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=9mYz=C7=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qJyBG-0003BB-Gv
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 15:24:34 +0000
Received: from frasgout11.his.huawei.com (unknown [14.137.139.23])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5c549fba-2191-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 17:24:30 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.227])
 by frasgout11.his.huawei.com (SkyGuard) with ESMTP id 4R1ymK5CXbz9xGgh
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 23:13:21 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.218.161])
 by APP1 (Coremail) with SMTP id LxC2BwA3k94BF7BkxG6BBA--.7207S2;
 Thu, 13 Jul 2023 16:24:02 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5c549fba-2191-11ee-b239-6b7b168915f2
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	petr@tesarici.cz
Subject: [PATCH v4 0/8] Allow dynamic allocation of software IO TLB bounce buffers
Date: Thu, 13 Jul 2023 17:23:11 +0200
Message-Id: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:LxC2BwA3k94BF7BkxG6BBA--.7207S2
X-Coremail-Antispam: 1UD129KBjvJXoW3Wr1Dtw1rJr47Aw4kKrykZrb_yoWfCrW8pF
	WrKryxtF4qq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xghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

Motivation
==========

The software IO TLB was designed with these assumptions:

1) It would not be used much. Small systems (little RAM) don't need it, and
   big systems (lots of RAM) would have modern DMA controllers and an IOMMU
   chip to handle legacy devices.
2) A small fixed memory area (64 MiB by default) is sufficient to
   handle the few cases which require a bounce buffer.
3) 64 MiB is little enough that it has no impact on the rest of the
   system.
4) Bounce buffers require large contiguous chunks of low memory. Such
   memory is precious and can be allocated only early at boot.

It turns out they are not always true:

1) Embedded systems may have more than 4GiB RAM but no IOMMU and legacy
   32-bit peripheral busses and/or DMA controllers.
2) CoCo VMs use bounce buffers for all I/O but may need substantially more
   than 64 MiB.
3) Embedded developers put as many features as possible into the available
   memory. A few dozen "missing" megabytes may limit what features can be
   implemented.
4) If CMA is available, it can allocate large continuous chunks even after
   the system has run for some time.

Goals
=====

The goal of this work is to start with a small software IO TLB at boot and
expand it later when/if needed.

Design
======

This version of the patch series retains the current slot allocation
algorithm with multiple areas to reduce lock contention, but additional
slots can be added when necessary.

These alternatives have been considered:

- Allocate and free buffers as needed using direct DMA API. This works
  quite well, except in CoCo VMs where each allocation/free requires
  decrypting/encrypting memory, which is a very expensive operation.

- Allocate a very large software IO TLB at boot, but allow to migrate pages
  to/from it (like CMA does). For systems with CMA, this would mean two big
  allocations at boot. Finding the balance between CMA, SWIOTLB and rest of
  available RAM can be challenging. More importantly, there is no clear
  benefit compared to allocating SWIOTLB memory pools from the CMA.

Implementation Constraints
==========================

These constraints have been taken into account:

1) Minimize impact on devices which do not benefit from the change.
2) Minimize the number of memory decryption/encryption operations.
3) Avoid contention on a lock or atomic variable to preserve parallel
   scalability.

Additionally, the software IO TLB code is also used to implement restricted
DMA pools. These pools are restricted to a pre-defined physical memory
region and must not use any other memory. In other words, dynamic
allocation of memory pools must be disabled for restricted DMA pools.

Data Structures
===============

The existing struct io_tlb_mem is the central type for a SWIOTLB allocator,
but it now contains multiple memory pools::

  io_tlb_mem
  +---------+   io_tlb_pool
  | SWIOTLB | 	+-------+   +-------+   +-------+
  |allocator|-->|default|-->|dynamic|-->|dynamic|-->...
  |    	    |  	|memory |   |memory |   |memory |
  +---------+ 	| pool  |   | pool  |   | pool  |
	      	+-------+   +-------+   +-------+

The allocator structure contains global state (such as flags and counters)
and structures needed to schedule new allocations. Each memory pool
contains the actual buffer slots and metadata. The first memory pool in the
list is the default memory pool allocated statically at early boot.

New memory pools are allocated from a kernel worker thread. That's because
bounce buffers are allocated when mapping a DMA buffer, which may happen in
interrupt context where large atomic allocations would probably fail.
Allocation from process context is much more likely to succeed, especially
if it can use CMA.

Nonetheless, the onset of a load spike may fill up the SWIOTLB before the
worker has a chance to run. In that case, try to allocate a small transient
memory pool to accommodate the request. If memory is encrypted and the
device cannot do DMA to encrypted memory, this buffer is allocated from the
coherent atomic DMA memory pool. Reducing the size of SWIOTLB may therefore
require increasing the size of the coherent pool with the "coherent_pool"
command-line parameter.

Performance
===========

All testing compared a vanilla v6.4-rc6 kernel with a fully patched
kernel. The kernel was booted with "swiotlb=force" to allow stress-testing
the software IO TLB on a high-performance device that would otherwise not
need it. CONFIG_DEBUG_FS was set to 'y' to match the configuration of
popular distribution kernels; it is understood that parallel workloads
suffer from contention on the recently added debugfs atomic counters.

These benchmarks were run:

- small: single-threaded I/O of 4 KiB blocks,
- big: single-threaded I/O of 64 KiB blocks,
- 4way: 4-way parallel I/O of 4 KiB blocks.

In all tested cases, the default 64 MiB SWIOTLB would be sufficient (but
wasteful). The "default" pair of columns shows performance impact when
booted with 64 MiB SWIOTLB (i.e. current state). The "growing" pair of
columns shows the impact when booted with a 1 MiB initial SWIOTLB, which
grew to 5 MiB at run time. The "var" column in the tables below is the
coefficient of variance over 5 runs of the test, the "diff" column is the
difference in read-write I/O bandwidth (MiB/s). The very first column is
the coefficient of variance in the results of the base unpatched kernel.

First, on an x86 VM against a QEMU virtio SATA driver backed by a RAM-based
block device on the host:

	base	   default	   growing
	var	var	diff	var	diff
small	1.96%	0.47%	-1.5%	0.52%	-2.2%
big	2.03%	1.35%	+0.9%	2.22%	+2.9%
4way	0.80%	0.45%	-0.7%	1.22%	<0.1%

Second, on a Raspberry Pi4 with 8G RAM and a class 10 A1 microSD card:

	base	   default	   growing
	var	var	diff	var	diff
small	1.09%	1.69%	+0.5%	2.14%	-0.2%
big	0.03%	0.28%	-0.5%	0.03%	-0.1%
4way	5.15%	2.39%	+0.2%	0.66%	<0.1%

Third, on a CoCo VM. This was a bigger system, so I also added a 24-thread
parallel I/O test:

	base	   default	   growing
	var	var	diff	var	diff
small	2.41%	6.02%	+1.1%	10.33%	+6.7%
big	9.20%	2.81%	-0.6%	16.84%	-0.2%
4way	0.86%	2.66%	-0.1%	 2.22%	-4.9%
24way	3.19%	6.19%	+4.4%	 4.08%	-5.9%

Note the increased variance of the CoCo VM, although the host was not
otherwise loaded. These are caused by the first run, which includes the
overhead of allocating additional bounce buffers and sharing them with the
hypervisor. The system was not rebooted between successive runs.

Parallel tests suffer from a reduced number of areas in the dynamically
allocated memory pools. This can be improved by allocating a larger pool
from CMA (not implemented in this series yet).

I have no good explanation for the increase in performance of the
24-thread I/O test with the default (non-growing) memory pool. Although the
difference is within variance, it seems to be real. The average bandwidth
is consistently above that of the unpatched kernel.

To sum it up:

- All workloads benefit from reduced memory footprint.
- No performance regressions have been observed with the default size of
  the software IO TLB.
- Most workloads retain their former performance even if the software IO
  TLB grows at run time.

Changelog
=========

Changes from v3:
- Provide swiotlb_is_allocated() instead of extending swiotlb_is_active().
- Do not grow SWIOTLB if its address has been queried (affects Octeon).
- Do not grow SWIOTLB if a remap function is used (affects Xen PV).
- Use dma_mask instead of coherent_dma_mask.
- Replace complex ternary operators with if-else blocks.

Changes from v2:
- Complete rewrite using dynamically allocated memory pools rather
  than a list of individual buffers
- Depend on other SWIOTLB fixes (already sent)
- Fix Xen and MIPS Octeon builds

Changes from RFC:
- Track dynamic buffers per device instead of per swiotlb
- Use a linked list instead of a maple tree
- Move initialization of swiotlb fields of struct device to a
  helper function
- Rename __lookup_dyn_slot() to lookup_dyn_slot_locked()
- Introduce per-device flag if dynamic buffers are in use
- Add one more user of DMA_ATTR_MAY_SLEEP
- Add kernel-doc comments for new (and some old) code
- Properly escape '*' in dma-attributes.rst

Petr Tesarik (8):
  swiotlb: make io_tlb_default_mem local to swiotlb.c
  swiotlb: add documentation and rename swiotlb_do_find_slots()
  swiotlb: separate memory pool data from other allocator data
  swiotlb: add a flag whether a SWIOTLB is allowed to grow
  swiotlb: if swiotlb is full, fall back to a transient memory pool
  swiotlb: determine potential physical address limit
  swiotlb: allocate a new memory pool when existing pools are full
  swiotlb: search the software IO TLB only if a device makes use of it

 arch/arm/xen/mm.c           |   2 +-
 arch/mips/pci/pci-octeon.c  |   2 +-
 arch/x86/kernel/pci-dma.c   |   2 +-
 drivers/base/core.c         |   4 +-
 drivers/xen/swiotlb-xen.c   |   2 +-
 include/linux/device.h      |   8 +-
 include/linux/dma-mapping.h |   2 +
 include/linux/swiotlb.h     | 111 +++++--
 kernel/dma/direct.c         |   2 +-
 kernel/dma/swiotlb.c        | 605 ++++++++++++++++++++++++++++++++----
 10 files changed, 643 insertions(+), 97 deletions(-)

-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 13 15:24:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 15:24:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563237.880372 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyBT-0003Si-1X; Thu, 13 Jul 2023 15:24:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563237.880372; Thu, 13 Jul 2023 15:24:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyBS-0003Sb-Uk; Thu, 13 Jul 2023 15:24:46 +0000
Received: by outflank-mailman (input) for mailman id 563237;
 Thu, 13 Jul 2023 15:24:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=9mYz=C7=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qJyBR-0003BB-Rh
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 15:24:45 +0000
Received: from frasgout13.his.huawei.com (unknown [14.137.139.46])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 64b7b8d9-2191-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 17:24:44 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.227])
 by frasgout13.his.huawei.com (SkyGuard) with ESMTP id 4R1ymf2hgwz9xGn0
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 23:13:38 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.218.161])
 by APP1 (Coremail) with SMTP id LxC2BwA3k94BF7BkxG6BBA--.7207S3;
 Thu, 13 Jul 2023 16:24:16 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 64b7b8d9-2191-11ee-b239-6b7b168915f2
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	petr@tesarici.cz
Subject: [PATCH v4 1/8] swiotlb: make io_tlb_default_mem local to swiotlb.c
Date: Thu, 13 Jul 2023 17:23:12 +0200
Message-Id: <7f64111986f4f361a2deb4a1a1b6f588e63a851b.1689261692.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
References: <cover.1689261692.git.petr.tesarik.ext@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Ir41lIxAIcVC0
	I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UMIIF0xvE42
	xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF
	7I0E14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43ZEXa7VUjPCztUUUUU==
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

SWIOTLB implementation details should not be exposed to the rest of the
kernel. This will allow to make changes to the implementation without
modifying non-swiotlb code.

To avoid breaking existing users, provide helper functions for the few
required fields.

As a bonus, using a helper function to initialize struct device allows to
get rid of an #ifdef in driver core.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 arch/arm/xen/mm.c          |  2 +-
 arch/mips/pci/pci-octeon.c |  2 +-
 arch/x86/kernel/pci-dma.c  |  2 +-
 drivers/base/core.c        |  4 +---
 drivers/xen/swiotlb-xen.c  |  2 +-
 include/linux/swiotlb.h    | 25 +++++++++++++++++++++++-
 kernel/dma/swiotlb.c       | 39 +++++++++++++++++++++++++++++++++++++-
 7 files changed, 67 insertions(+), 9 deletions(-)

diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c
index 3d826c0b5fee..0f32c14eb786 100644
--- a/arch/arm/xen/mm.c
+++ b/arch/arm/xen/mm.c
@@ -125,7 +125,7 @@ static int __init xen_mm_init(void)
 		return 0;
 
 	/* we can work with the default swiotlb */
-	if (!io_tlb_default_mem.nslabs) {
+	if (!is_swiotlb_allocated()) {
 		rc = swiotlb_init_late(swiotlb_size_or_default(),
 				       xen_swiotlb_gfp(), NULL);
 		if (rc < 0)
diff --git a/arch/mips/pci/pci-octeon.c b/arch/mips/pci/pci-octeon.c
index e457a18cbdc5..c5c4c1f7d5e4 100644
--- a/arch/mips/pci/pci-octeon.c
+++ b/arch/mips/pci/pci-octeon.c
@@ -664,7 +664,7 @@ static int __init octeon_pci_setup(void)
 
 		/* BAR1 movable regions contiguous to cover the swiotlb */
 		octeon_bar1_pci_phys =
-			io_tlb_default_mem.start & ~((1ull << 22) - 1);
+			default_swiotlb_start() & ~((1ull << 22) - 1);
 
 		for (index = 0; index < 32; index++) {
 			union cvmx_pci_bar1_indexx bar1_index;
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index de6be0a3965e..08c6ffc3550f 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -90,7 +90,7 @@ int pci_xen_swiotlb_init_late(void)
 		return 0;
 
 	/* we can work with the default swiotlb */
-	if (!io_tlb_default_mem.nslabs) {
+	if (!is_swiotlb_allocated()) {
 		int rc = swiotlb_init_late(swiotlb_size_or_default(),
 					   GFP_KERNEL, xen_swiotlb_fixup);
 		if (rc < 0)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 3dff5037943e..46d1d78c5beb 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -3108,9 +3108,7 @@ void device_initialize(struct device *dev)
     defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL)
 	dev->dma_coherent = dma_default_coherent;
 #endif
-#ifdef CONFIG_SWIOTLB
-	dev->dma_io_tlb_mem = &io_tlb_default_mem;
-#endif
+	swiotlb_dev_init(dev);
 }
 EXPORT_SYMBOL_GPL(device_initialize);
 
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index 67aa74d20162..946bd56f0ac5 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -381,7 +381,7 @@ xen_swiotlb_sync_sg_for_device(struct device *dev, struct scatterlist *sgl,
 static int
 xen_swiotlb_dma_supported(struct device *hwdev, u64 mask)
 {
-	return xen_phys_to_dma(hwdev, io_tlb_default_mem.end - 1) <= mask;
+	return xen_phys_to_dma(hwdev, default_swiotlb_limit()) <= mask;
 }
 
 const struct dma_map_ops xen_swiotlb_dma_ops = {
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 4e52cd5e0bdc..07216af59e93 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -110,7 +110,6 @@ struct io_tlb_mem {
 	atomic_long_t used_hiwater;
 #endif
 };
-extern struct io_tlb_mem io_tlb_default_mem;
 
 static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
 {
@@ -128,13 +127,22 @@ static inline bool is_swiotlb_force_bounce(struct device *dev)
 
 void swiotlb_init(bool addressing_limited, unsigned int flags);
 void __init swiotlb_exit(void);
+void swiotlb_dev_init(struct device *dev);
 size_t swiotlb_max_mapping_size(struct device *dev);
+bool is_swiotlb_allocated(void);
 bool is_swiotlb_active(struct device *dev);
 void __init swiotlb_adjust_size(unsigned long size);
+phys_addr_t default_swiotlb_start(void);
+phys_addr_t default_swiotlb_limit(void);
 #else
 static inline void swiotlb_init(bool addressing_limited, unsigned int flags)
 {
 }
+
+static inline void swiotlb_dev_init(struct device *dev)
+{
+}
+
 static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
 {
 	return false;
@@ -151,6 +159,11 @@ static inline size_t swiotlb_max_mapping_size(struct device *dev)
 	return SIZE_MAX;
 }
 
+static inline bool is_swiotlb_allocated(void)
+{
+	return false;
+}
+
 static inline bool is_swiotlb_active(struct device *dev)
 {
 	return false;
@@ -159,6 +172,16 @@ static inline bool is_swiotlb_active(struct device *dev)
 static inline void swiotlb_adjust_size(unsigned long size)
 {
 }
+
+static inline phys_addr_t default_swiotlb_start(void)
+{
+	return 0;
+}
+
+static inline phys_addr_t default_swiotlb_limit(void)
+{
+	return 0;
+}
 #endif /* CONFIG_SWIOTLB */
 
 extern void swiotlb_print_info(void);
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 2b83e3ad9dca..873b077d7e37 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -71,7 +71,7 @@ struct io_tlb_slot {
 static bool swiotlb_force_bounce;
 static bool swiotlb_force_disable;
 
-struct io_tlb_mem io_tlb_default_mem;
+static struct io_tlb_mem io_tlb_default_mem;
 
 static unsigned long default_nslabs = IO_TLB_DEFAULT_SIZE >> IO_TLB_SHIFT;
 static unsigned long default_nareas;
@@ -486,6 +486,15 @@ void __init swiotlb_exit(void)
 	memset(mem, 0, sizeof(*mem));
 }
 
+/**
+ * swiotlb_dev_init() - initialize swiotlb fields in &struct device
+ * @dev:	Device to be initialized.
+ */
+void swiotlb_dev_init(struct device *dev)
+{
+	dev->dma_io_tlb_mem = &io_tlb_default_mem;
+}
+
 /*
  * Return the offset into a iotlb slot required to keep the device happy.
  */
@@ -950,6 +959,14 @@ size_t swiotlb_max_mapping_size(struct device *dev)
 	return ((size_t)IO_TLB_SIZE) * IO_TLB_SEGSIZE - min_align;
 }
 
+/**
+ * is_swiotlb_allocated() - check if the default software IO TLB is initialized
+ */
+bool is_swiotlb_allocated(void)
+{
+	return !!io_tlb_default_mem.nslabs;
+}
+
 bool is_swiotlb_active(struct device *dev)
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
@@ -958,6 +975,26 @@ bool is_swiotlb_active(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(is_swiotlb_active);
 
+/**
+ * default_swiotlb_start() - get the start of the default SWIOTLB
+ *
+ * Get the lowest physical address used by the default software IO TLB pool.
+ */
+phys_addr_t default_swiotlb_start(void)
+{
+	return io_tlb_default_mem.start;
+}
+
+/**
+ * default_swiotlb_limit() - get the highest address in the default SWIOTLB
+ *
+ * Get the highest physical address used by the default software IO TLB pool.
+ */
+phys_addr_t default_swiotlb_limit(void)
+{
+	return io_tlb_default_mem.end - 1;
+}
+
 #ifdef CONFIG_DEBUG_FS
 
 static int io_tlb_used_get(void *data, u64 *val)
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 13 15:25:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 15:25:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563242.880382 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyBj-0003zI-9B; Thu, 13 Jul 2023 15:25:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563242.880382; Thu, 13 Jul 2023 15:25:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyBj-0003zB-5o; Thu, 13 Jul 2023 15:25:03 +0000
Received: by outflank-mailman (input) for mailman id 563242;
 Thu, 13 Jul 2023 15:25:02 +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
 <SRS0=9mYz=C7=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qJyBi-0003b5-IK
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 15:25:02 +0000
Received: from frasgout13.his.huawei.com (unknown [14.137.139.46])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6d35db2d-2191-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 17:24:59 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.229])
 by frasgout13.his.huawei.com (SkyGuard) with ESMTP id 4R1ymw4VCSz9xGn0
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 23:13:52 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.218.161])
 by APP1 (Coremail) with SMTP id LxC2BwA3k94BF7BkxG6BBA--.7207S4;
 Thu, 13 Jul 2023 16:24:31 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6d35db2d-2191-11ee-8611-37d641c3527e
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	petr@tesarici.cz
Subject: [PATCH v4 2/8] swiotlb: add documentation and rename swiotlb_do_find_slots()
Date: Thu, 13 Jul 2023 17:23:13 +0200
Message-Id: <11826bfbc148771ab36d0b485558aa52cbdd204f.1689261692.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:LxC2BwA3k94BF7BkxG6BBA--.7207S4
X-Coremail-Antispam: 1UD129KBjvJXoW3GrWfGF4UuFy8tF1xZF1kKrg_yoW7Zw4rpF
	48KFn8tFZ8Jr1xC39Fka18uF1S9w4kK347uFWavryF9rnxJr9agFyvyrW5Xa4rJFWxuF4U
	Ja4avr48GF45Xr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDU0xBIdaVrnRJUUUQv14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0
	rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_Jryl82xGYIkIc2
	x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0
	Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw
	A2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr0_Cr1U
	M2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjx
	v20xvE14v26r106r15McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1l
	F7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8cxan2
	IY04v7MxkF7I0En4kS14v26r1q6r43MxkF7I0Ew4C26cxK6c8Ij28IcwCF04k20xvY0x0E
	wIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E74
	80Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Wrv_Gr1UMIIYrxkI7VAKI48JMIIF0xvE
	2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwCI42IY6x
	AIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY
	1x0267AKxVW8Jr0_Cr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUa2NtUUUUU=
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

Add some kernel-doc comments and move the existing documentation of struct
io_tlb_slot to its correct location. The latter was forgotten in commit
942a8186eb445 ("swiotlb: move struct io_tlb_slot to swiotlb.c").

Use the opportunity to give swiotlb_do_find_slots() a more descriptive
name, which makes it clear how it differs from swiotlb_find_slots().

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/swiotlb.h | 15 +++++++---
 kernel/dma/swiotlb.c    | 61 +++++++++++++++++++++++++++++++++++++----
 2 files changed, 66 insertions(+), 10 deletions(-)

diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 07216af59e93..39313c3a791a 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -76,10 +76,6 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t phys,
  * @nslabs:	The number of IO TLB blocks (in groups of 64) between @start and
  *		@end. For default swiotlb, this is command line adjustable via
  *		setup_io_tlb_npages.
- * @list:	The free list describing the number of free entries available
- *		from each index.
- * @orig_addr:	The original address corresponding to a mapped entry.
- * @alloc_size:	Size of the allocated buffer.
  * @debugfs:	The dentry to debugfs.
  * @late_alloc:	%true if allocated using the page allocator
  * @force_bounce: %true if swiotlb bouncing is forced
@@ -111,6 +107,17 @@ struct io_tlb_mem {
 #endif
 };
 
+/**
+ * is_swiotlb_buffer() - check if a physical address belongs to a swiotlb
+ * @dev:        Device which has mapped the buffer.
+ * @paddr:      Physical address within the DMA buffer.
+ *
+ * Check if @paddr points into a bounce buffer.
+ *
+ * Return:
+ * * %true if @paddr points into a bounce buffer
+ * * %false otherwise
+ */
 static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 873b077d7e37..01161d040639 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -62,6 +62,13 @@
 
 #define INVALID_PHYS_ADDR (~(phys_addr_t)0)
 
+/**
+ * struct io_tlb_slot - IO TLB slot descriptor
+ * @orig_addr:	The original address corresponding to a mapped entry.
+ * @alloc_size:	Size of the allocated buffer.
+ * @list:	The free list describing the number of free entries available
+ *		from each index.
+ */
 struct io_tlb_slot {
 	phys_addr_t orig_addr;
 	size_t alloc_size;
@@ -632,11 +639,22 @@ static void dec_used(struct io_tlb_mem *mem, unsigned int nslots)
 }
 #endif /* CONFIG_DEBUG_FS */
 
-/*
- * Find a suitable number of IO TLB entries size that will fit this request and
- * allocate a buffer from that IO TLB pool.
+/**
+ * area_find_slots() - search for slots in one IO TLB memory area
+ * @dev:	Device which maps the buffer.
+ * @area_index:	Index of the IO TLB memory area to be searched.
+ * @orig_addr:	Original (non-bounced) IO buffer address.
+ * @alloc_size: Total requested size of the bounce buffer,
+ *		including initial alignment padding.
+ * @alloc_align_mask:	Required alignment of the allocated buffer.
+ *
+ * Find a suitable sequence of IO TLB entries for the request and allocate
+ * a buffer from the given IO TLB memory area.
+ * This function takes care of locking.
+ *
+ * Return: Index of the first allocated slot, or -1 on error.
  */
-static int swiotlb_do_find_slots(struct device *dev, int area_index,
+static int area_find_slots(struct device *dev, int area_index,
 		phys_addr_t orig_addr, size_t alloc_size,
 		unsigned int alloc_align_mask)
 {
@@ -731,6 +749,19 @@ static int swiotlb_do_find_slots(struct device *dev, int area_index,
 	return slot_index;
 }
 
+/**
+ * swiotlb_find_slots() - search for slots in the whole swiotlb
+ * @dev:	Device which maps the buffer.
+ * @orig_addr:	Original (non-bounced) IO buffer address.
+ * @alloc_size: Total requested size of the bounce buffer,
+ *		including initial alignment padding.
+ * @alloc_align_mask:	Required alignment of the allocated buffer.
+ *
+ * Search through the whole software IO TLB to find a sequence of slots that
+ * match the allocation constraints.
+ *
+ * Return: Index of the first allocated slot, or -1 on error.
+ */
 static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
 		size_t alloc_size, unsigned int alloc_align_mask)
 {
@@ -739,8 +770,8 @@ static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
 	int i = start, index;
 
 	do {
-		index = swiotlb_do_find_slots(dev, i, orig_addr, alloc_size,
-					      alloc_align_mask);
+		index = area_find_slots(dev, i, orig_addr, alloc_size,
+					alloc_align_mask);
 		if (index >= 0)
 			return index;
 		if (++i >= mem->nareas)
@@ -752,6 +783,15 @@ static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
 
 #ifdef CONFIG_DEBUG_FS
 
+/**
+ * mem_used() - get number of used slots in an allocator
+ * @mem:	Software IO TLB allocator.
+ *
+ * The result is accurate in this version of the function, because an atomic
+ * counter is available if CONFIG_DEBUG_FS is set.
+ *
+ * Return: Number of used slots.
+ */
 static unsigned long mem_used(struct io_tlb_mem *mem)
 {
 	return atomic_long_read(&mem->total_used);
@@ -759,6 +799,15 @@ static unsigned long mem_used(struct io_tlb_mem *mem)
 
 #else /* !CONFIG_DEBUG_FS */
 
+/**
+ * mem_used() - get number of used slots in an allocator
+ * @mem:	Software IO TLB allocator.
+ *
+ * The result is not accurate, because there is no locking of individual
+ * areas.
+ *
+ * Return: Approximate number of used slots.
+ */
 static unsigned long mem_used(struct io_tlb_mem *mem)
 {
 	int i;
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 13 15:25:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 15:25:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563249.880391 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyBu-0004Vj-KE; Thu, 13 Jul 2023 15:25:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563249.880391; Thu, 13 Jul 2023 15:25:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyBu-0004Vc-H5; Thu, 13 Jul 2023 15:25:14 +0000
Received: by outflank-mailman (input) for mailman id 563249;
 Thu, 13 Jul 2023 15:25:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=9mYz=C7=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qJyBt-0003BB-Q1
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 15:25:13 +0000
Received: from frasgout11.his.huawei.com (unknown [14.137.139.23])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 75dbbeac-2191-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 17:25:12 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.229])
 by frasgout11.his.huawei.com (SkyGuard) with ESMTP id 4R1yn86brmz9xGgn
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 23:14:04 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.218.161])
 by APP1 (Coremail) with SMTP id LxC2BwA3k94BF7BkxG6BBA--.7207S5;
 Thu, 13 Jul 2023 16:24:45 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 75dbbeac-2191-11ee-b239-6b7b168915f2
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	petr@tesarici.cz
Subject: [PATCH v4 3/8] swiotlb: separate memory pool data from other allocator data
Date: Thu, 13 Jul 2023 17:23:14 +0200
Message-Id: <e309b4a88ffb306c88a3b3cfe5e57483d73d20bc.1689261692.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:LxC2BwA3k94BF7BkxG6BBA--.7207S5
X-Coremail-Antispam: 1UD129KBjvAXoWfCF45Kr47KF1ftryDJr1rtFb_yoW8ur4DXo
	W7GFnrXw4ftryjyFW2yan3Jr17uayqka1rAF1rZay5Xayjyr4Ygw1fKa15Xw13Wr1fGFWx
	AwnxWa48WF4kAr18n29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7v73VFW2AGmfu7bjvjm3
	AaLaJ3UjIYCTnIWjp_UUUOQ7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20EY4v20xva
	j40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r1rM28IrcIa0x
	kI8VCY1x0267AKxVW5JVCq3wA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84AC
	jcxK6xIIjxv20xvE14v26r1j6r1xM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr
	1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr1j6F4U
	JwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7
	IYx2IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4U
	M4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628vn2
	kIc2xKxwCY1x0262kKe7AKxVWUtVW8ZwCY1x0264kExVAvwVAq07x20xyl42xK82IYc2Ij
	64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x
	8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26rWY6r4UJwCIc40Y0x0EwIxGrwCI42IY
	6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UMIIF0x
	vE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv
	6xkF7I0E14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43ZEXa7VUjmFAJUUUUU==
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

Carve out memory pool specific fields from struct io_tlb_mem. The original
struct now contains shared data for the whole allocator, while the new
struct io_tlb_pool contains data that is specific to one memory pool of
(potentially) many.

Allocate both structures together for restricted DMA pools to keep the
error cleanup path simple.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/device.h  |   2 +-
 include/linux/swiotlb.h |  47 +++++++----
 kernel/dma/swiotlb.c    | 181 +++++++++++++++++++++++++---------------
 3 files changed, 147 insertions(+), 83 deletions(-)

diff --git a/include/linux/device.h b/include/linux/device.h
index bbaeabd04b0d..d9754a68ba95 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -625,7 +625,7 @@ struct device_physical_location {
  * @dma_pools:	Dma pools (if dma'ble device).
  * @dma_mem:	Internal for coherent mem override.
  * @cma_area:	Contiguous memory area for dma allocations
- * @dma_io_tlb_mem: Pointer to the swiotlb pool used.  Not for driver use.
+ * @dma_io_tlb_mem: Software IO TLB allocator.  Not for driver use.
  * @archdata:	For arch-specific additions.
  * @of_node:	Associated device tree node.
  * @fwnode:	Associated device node supplied by platform firmware.
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 39313c3a791a..d669e11e2827 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -62,8 +62,7 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t phys,
 #ifdef CONFIG_SWIOTLB
 
 /**
- * struct io_tlb_mem - IO TLB Memory Pool Descriptor
- *
+ * struct io_tlb_pool - IO TLB memory pool descriptor
  * @start:	The start address of the swiotlb memory pool. Used to do a quick
  *		range check to see if the memory was in fact allocated by this
  *		API.
@@ -73,15 +72,36 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t phys,
  * @vaddr:	The vaddr of the swiotlb memory pool. The swiotlb memory pool
  *		may be remapped in the memory encrypted case and store virtual
  *		address for bounce buffer operation.
- * @nslabs:	The number of IO TLB blocks (in groups of 64) between @start and
- *		@end. For default swiotlb, this is command line adjustable via
- *		setup_io_tlb_npages.
+ * @nslabs:	The number of IO TLB slots between @start and @end. For the
+ *		default swiotlb, this can be adjusted with a boot parameter,
+ *		see setup_io_tlb_npages().
+ * @used:	The number of used IO TLB slots.
+ * @late_alloc:	%true if allocated using the page allocator.
+ * @nareas:	Number of areas in the pool.
+ * @area_nslabs: Number of slots in each area.
+ * @areas:	Array of memory area descriptors.
+ * @slots:	Array of slot descriptors.
+ */
+struct io_tlb_pool {
+	phys_addr_t start;
+	phys_addr_t end;
+	void *vaddr;
+	unsigned long nslabs;
+	unsigned long used;
+	bool late_alloc;
+	unsigned int nareas;
+	unsigned int area_nslabs;
+	struct io_tlb_area *areas;
+	struct io_tlb_slot *slots;
+};
+
+/**
+ * struct io_tlb_mem - Software IO TLB allocator
+ * @pool:	IO TLB memory pool descriptor.
+ * @nslabs:	Total number of IO TLB slabs in all pools.
  * @debugfs:	The dentry to debugfs.
- * @late_alloc:	%true if allocated using the page allocator
  * @force_bounce: %true if swiotlb bouncing is forced
  * @for_alloc:  %true if the pool is used for memory allocation
- * @nareas:  The area number in the pool.
- * @area_nslabs: The slot number in the area.
  * @total_used:	The total number of slots in the pool that are currently used
  *		across all areas. Used only for calculating used_hiwater in
  *		debugfs.
@@ -89,18 +109,11 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t phys,
  *		in debugfs.
  */
 struct io_tlb_mem {
-	phys_addr_t start;
-	phys_addr_t end;
-	void *vaddr;
+	struct io_tlb_pool *pool;
 	unsigned long nslabs;
 	struct dentry *debugfs;
-	bool late_alloc;
 	bool force_bounce;
 	bool for_alloc;
-	unsigned int nareas;
-	unsigned int area_nslabs;
-	struct io_tlb_area *areas;
-	struct io_tlb_slot *slots;
 #ifdef CONFIG_DEBUG_FS
 	atomic_long_t total_used;
 	atomic_long_t used_hiwater;
@@ -122,7 +135,7 @@ static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
 
-	return mem && paddr >= mem->start && paddr < mem->end;
+	return mem && paddr >= mem->pool->start && paddr < mem->pool->end;
 }
 
 static inline bool is_swiotlb_force_bounce(struct device *dev)
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 01161d040639..a80b77de8829 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -78,7 +78,10 @@ struct io_tlb_slot {
 static bool swiotlb_force_bounce;
 static bool swiotlb_force_disable;
 
-static struct io_tlb_mem io_tlb_default_mem;
+static struct io_tlb_pool io_tlb_default_pool;
+static struct io_tlb_mem io_tlb_default_mem = {
+	.pool = &io_tlb_default_pool,
+};
 
 static unsigned long default_nslabs = IO_TLB_DEFAULT_SIZE >> IO_TLB_SHIFT;
 static unsigned long default_nareas;
@@ -209,7 +212,7 @@ void __init swiotlb_adjust_size(unsigned long size)
 
 void swiotlb_print_info(void)
 {
-	struct io_tlb_mem *mem = &io_tlb_default_mem;
+	struct io_tlb_pool *mem = &io_tlb_default_pool;
 
 	if (!mem->nslabs) {
 		pr_warn("No low mem\n");
@@ -238,7 +241,7 @@ static inline unsigned long nr_slots(u64 val)
  */
 void __init swiotlb_update_mem_attributes(void)
 {
-	struct io_tlb_mem *mem = &io_tlb_default_mem;
+	struct io_tlb_pool *mem = &io_tlb_default_pool;
 	unsigned long bytes;
 
 	if (!mem->nslabs || mem->late_alloc)
@@ -247,9 +250,8 @@ void __init swiotlb_update_mem_attributes(void)
 	set_memory_decrypted((unsigned long)mem->vaddr, bytes >> PAGE_SHIFT);
 }
 
-static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,
-		unsigned long nslabs, unsigned int flags,
-		bool late_alloc, unsigned int nareas)
+static void swiotlb_init_io_tlb_pool(struct io_tlb_pool *mem, phys_addr_t start,
+		unsigned long nslabs, bool late_alloc, unsigned int nareas)
 {
 	void *vaddr = phys_to_virt(start);
 	unsigned long bytes = nslabs << IO_TLB_SHIFT, i;
@@ -261,8 +263,6 @@ static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,
 	mem->nareas = nareas;
 	mem->area_nslabs = nslabs / mem->nareas;
 
-	mem->force_bounce = swiotlb_force_bounce || (flags & SWIOTLB_FORCE);
-
 	for (i = 0; i < mem->nareas; i++) {
 		spin_lock_init(&mem->areas[i].lock);
 		mem->areas[i].index = 0;
@@ -319,7 +319,7 @@ static void __init *swiotlb_memblock_alloc(unsigned long nslabs,
 void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 		int (*remap)(void *tlb, unsigned long nslabs))
 {
-	struct io_tlb_mem *mem = &io_tlb_default_mem;
+	struct io_tlb_pool *mem = &io_tlb_default_pool;
 	unsigned long nslabs;
 	unsigned int nareas;
 	size_t alloc_size;
@@ -330,6 +330,9 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 	if (swiotlb_force_disable)
 		return;
 
+	io_tlb_default_mem.force_bounce =
+		swiotlb_force_bounce || (flags & SWIOTLB_FORCE);
+
 	if (!default_nareas)
 		swiotlb_adjust_nareas(num_possible_cpus());
 
@@ -363,8 +366,9 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 		return;
 	}
 
-	swiotlb_init_io_tlb_mem(mem, __pa(tlb), nslabs, flags, false,
-				default_nareas);
+	swiotlb_init_io_tlb_pool(mem, __pa(tlb), nslabs, false,
+				 default_nareas);
+	io_tlb_default_mem.nslabs = nslabs;
 
 	if (flags & SWIOTLB_VERBOSE)
 		swiotlb_print_info();
@@ -383,7 +387,7 @@ void __init swiotlb_init(bool addressing_limit, unsigned int flags)
 int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 		int (*remap)(void *tlb, unsigned long nslabs))
 {
-	struct io_tlb_mem *mem = &io_tlb_default_mem;
+	struct io_tlb_pool *mem = &io_tlb_default_pool;
 	unsigned long nslabs = ALIGN(size >> IO_TLB_SHIFT, IO_TLB_SEGSIZE);
 	unsigned int nareas;
 	unsigned char *vstart = NULL;
@@ -394,6 +398,8 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 	if (swiotlb_force_disable)
 		return 0;
 
+	io_tlb_default_mem.force_bounce = swiotlb_force_bounce;
+
 	if (!default_nareas)
 		swiotlb_adjust_nareas(num_possible_cpus());
 
@@ -445,8 +451,9 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 
 	set_memory_decrypted((unsigned long)vstart,
 			     (nslabs << IO_TLB_SHIFT) >> PAGE_SHIFT);
-	swiotlb_init_io_tlb_mem(mem, virt_to_phys(vstart), nslabs, 0, true,
-				nareas);
+	swiotlb_init_io_tlb_pool(mem, virt_to_phys(vstart), nslabs, true,
+				 nareas);
+	io_tlb_default_mem.nslabs = nslabs;
 
 	swiotlb_print_info();
 	return 0;
@@ -460,7 +467,7 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 
 void __init swiotlb_exit(void)
 {
-	struct io_tlb_mem *mem = &io_tlb_default_mem;
+	struct io_tlb_pool *mem = &io_tlb_default_pool;
 	unsigned long tbl_vaddr;
 	size_t tbl_size, slots_size;
 	unsigned int area_order;
@@ -516,7 +523,7 @@ static unsigned int swiotlb_align_offset(struct device *dev, u64 addr)
 static void swiotlb_bounce(struct device *dev, phys_addr_t tlb_addr, size_t size,
 			   enum dma_data_direction dir)
 {
-	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
+	struct io_tlb_pool *mem = dev->dma_io_tlb_mem->pool;
 	int index = (tlb_addr - mem->start) >> IO_TLB_SHIFT;
 	phys_addr_t orig_addr = mem->slots[index].orig_addr;
 	size_t alloc_size = mem->slots[index].alloc_size;
@@ -598,7 +605,7 @@ static inline unsigned long get_max_slots(unsigned long boundary_mask)
 	return nr_slots(boundary_mask + 1);
 }
 
-static unsigned int wrap_area_index(struct io_tlb_mem *mem, unsigned int index)
+static unsigned int wrap_area_index(struct io_tlb_pool *mem, unsigned int index)
 {
 	if (index >= mem->area_nslabs)
 		return 0;
@@ -642,6 +649,7 @@ static void dec_used(struct io_tlb_mem *mem, unsigned int nslots)
 /**
  * area_find_slots() - search for slots in one IO TLB memory area
  * @dev:	Device which maps the buffer.
+ * @pool:	Memory pool to be searched.
  * @area_index:	Index of the IO TLB memory area to be searched.
  * @orig_addr:	Original (non-bounced) IO buffer address.
  * @alloc_size: Total requested size of the bounce buffer,
@@ -654,15 +662,14 @@ static void dec_used(struct io_tlb_mem *mem, unsigned int nslots)
  *
  * Return: Index of the first allocated slot, or -1 on error.
  */
-static int area_find_slots(struct device *dev, int area_index,
-		phys_addr_t orig_addr, size_t alloc_size,
+static int area_find_slots(struct device *dev, struct io_tlb_pool *pool,
+		int area_index, phys_addr_t orig_addr, size_t alloc_size,
 		unsigned int alloc_align_mask)
 {
-	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
-	struct io_tlb_area *area = mem->areas + area_index;
+	struct io_tlb_area *area = pool->areas + area_index;
 	unsigned long boundary_mask = dma_get_seg_boundary(dev);
 	dma_addr_t tbl_dma_addr =
-		phys_to_dma_unencrypted(dev, mem->start) & boundary_mask;
+		phys_to_dma_unencrypted(dev, pool->start) & boundary_mask;
 	unsigned long max_slots = get_max_slots(boundary_mask);
 	unsigned int iotlb_align_mask =
 		dma_get_min_align_mask(dev) | alloc_align_mask;
@@ -674,7 +681,7 @@ static int area_find_slots(struct device *dev, int area_index,
 	unsigned int slot_index;
 
 	BUG_ON(!nslots);
-	BUG_ON(area_index >= mem->nareas);
+	BUG_ON(area_index >= pool->nareas);
 
 	/*
 	 * For allocations of PAGE_SIZE or larger only look for page aligned
@@ -691,19 +698,19 @@ static int area_find_slots(struct device *dev, int area_index,
 	stride = (iotlb_align_mask >> IO_TLB_SHIFT) + 1;
 
 	spin_lock_irqsave(&area->lock, flags);
-	if (unlikely(nslots > mem->area_nslabs - area->used))
+	if (unlikely(nslots > pool->area_nslabs - area->used))
 		goto not_found;
 
-	slot_base = area_index * mem->area_nslabs;
+	slot_base = area_index * pool->area_nslabs;
 	index = area->index;
 
-	for (slots_checked = 0; slots_checked < mem->area_nslabs; ) {
+	for (slots_checked = 0; slots_checked < pool->area_nslabs; ) {
 		slot_index = slot_base + index;
 
 		if (orig_addr &&
 		    (slot_addr(tbl_dma_addr, slot_index) &
 		     iotlb_align_mask) != (orig_addr & iotlb_align_mask)) {
-			index = wrap_area_index(mem, index + 1);
+			index = wrap_area_index(pool, index + 1);
 			slots_checked++;
 			continue;
 		}
@@ -716,10 +723,10 @@ static int area_find_slots(struct device *dev, int area_index,
 		if (!iommu_is_span_boundary(slot_index, nslots,
 					    nr_slots(tbl_dma_addr),
 					    max_slots)) {
-			if (mem->slots[slot_index].list >= nslots)
+			if (pool->slots[slot_index].list >= nslots)
 				goto found;
 		}
-		index = wrap_area_index(mem, index + stride);
+		index = wrap_area_index(pool, index + stride);
 		slots_checked += stride;
 	}
 
@@ -729,58 +736,79 @@ static int area_find_slots(struct device *dev, int area_index,
 
 found:
 	for (i = slot_index; i < slot_index + nslots; i++) {
-		mem->slots[i].list = 0;
-		mem->slots[i].alloc_size = alloc_size - (offset +
+		pool->slots[i].list = 0;
+		pool->slots[i].alloc_size = alloc_size - (offset +
 				((i - slot_index) << IO_TLB_SHIFT));
 	}
 	for (i = slot_index - 1;
 	     io_tlb_offset(i) != IO_TLB_SEGSIZE - 1 &&
-	     mem->slots[i].list; i--)
-		mem->slots[i].list = ++count;
+	     pool->slots[i].list; i--)
+		pool->slots[i].list = ++count;
 
 	/*
 	 * Update the indices to avoid searching in the next round.
 	 */
-	area->index = wrap_area_index(mem, index + nslots);
+	area->index = wrap_area_index(pool, index + nslots);
 	area->used += nslots;
 	spin_unlock_irqrestore(&area->lock, flags);
 
-	inc_used_and_hiwater(mem, nslots);
+	inc_used_and_hiwater(dev->dma_io_tlb_mem, nslots);
 	return slot_index;
 }
 
 /**
- * swiotlb_find_slots() - search for slots in the whole swiotlb
+ * pool_find_slots() - search for slots in one memory pool
  * @dev:	Device which maps the buffer.
+ * @pool:	Memory pool to be searched.
  * @orig_addr:	Original (non-bounced) IO buffer address.
  * @alloc_size: Total requested size of the bounce buffer,
  *		including initial alignment padding.
  * @alloc_align_mask:	Required alignment of the allocated buffer.
  *
- * Search through the whole software IO TLB to find a sequence of slots that
- * match the allocation constraints.
+ * Search through one memory pool to find a sequence of slots that match the
+ * allocation constraints.
  *
  * Return: Index of the first allocated slot, or -1 on error.
  */
-static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
-		size_t alloc_size, unsigned int alloc_align_mask)
+static int pool_find_slots(struct device *dev, struct io_tlb_pool *pool,
+		phys_addr_t orig_addr, size_t alloc_size,
+		unsigned int alloc_align_mask)
 {
-	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
-	int start = raw_smp_processor_id() & (mem->nareas - 1);
+	int start = raw_smp_processor_id() & (pool->nareas - 1);
 	int i = start, index;
 
 	do {
-		index = area_find_slots(dev, i, orig_addr, alloc_size,
+		index = area_find_slots(dev, pool, i, orig_addr, alloc_size,
 					alloc_align_mask);
 		if (index >= 0)
 			return index;
-		if (++i >= mem->nareas)
+		if (++i >= pool->nareas)
 			i = 0;
 	} while (i != start);
 
 	return -1;
 }
 
+/**
+ * swiotlb_find_slots() - search for slots in the whole swiotlb
+ * @dev:	Device which maps the buffer.
+ * @orig_addr:	Original (non-bounced) IO buffer address.
+ * @alloc_size: Total requested size of the bounce buffer,
+ *		including initial alignment padding.
+ * @alloc_align_mask:	Required alignment of the allocated buffer.
+ *
+ * Search through the whole software IO TLB to find a sequence of slots that
+ * match the allocation constraints.
+ *
+ * Return: Index of the first allocated slot, or -1 on error.
+ */
+static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
+		size_t alloc_size, unsigned int alloc_align_mask)
+{
+	return pool_find_slots(dev, dev->dma_io_tlb_mem->pool, orig_addr,
+			       alloc_size, alloc_align_mask);
+}
+
 #ifdef CONFIG_DEBUG_FS
 
 /**
@@ -799,6 +827,24 @@ static unsigned long mem_used(struct io_tlb_mem *mem)
 
 #else /* !CONFIG_DEBUG_FS */
 
+/**
+ * mem_pool_used() - get number of used slots in a memory pool
+ * @pool:	Software IO TLB memory pool.
+ *
+ * The result is not accurate, see mem_used().
+ *
+ * Return: Approximate number of used slots.
+ */
+static unsigned long mem_pool_used(struct io_tlb_pool *pool)
+{
+	int i;
+	unsigned long used = 0;
+
+	for (i = 0; i < pool->nareas; i++)
+		used += pool->areas[i].used;
+	return used;
+}
+
 /**
  * mem_used() - get number of used slots in an allocator
  * @mem:	Software IO TLB allocator.
@@ -810,12 +856,7 @@ static unsigned long mem_used(struct io_tlb_mem *mem)
  */
 static unsigned long mem_used(struct io_tlb_mem *mem)
 {
-	int i;
-	unsigned long used = 0;
-
-	for (i = 0; i < mem->nareas; i++)
-		used += mem->areas[i].used;
-	return used;
+	return mem_pool_used(mem->pool);
 }
 
 #endif /* CONFIG_DEBUG_FS */
@@ -827,6 +868,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
 	unsigned int offset = swiotlb_align_offset(dev, orig_addr);
+	struct io_tlb_pool *pool;
 	unsigned int i;
 	int index;
 	phys_addr_t tlb_addr;
@@ -861,9 +903,10 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
 	 * This is needed when we sync the memory.  Then we sync the buffer if
 	 * needed.
 	 */
+	pool = mem->pool;
 	for (i = 0; i < nr_slots(alloc_size + offset); i++)
-		mem->slots[index + i].orig_addr = slot_addr(orig_addr, i);
-	tlb_addr = slot_addr(mem->start, index) + offset;
+		pool->slots[index + i].orig_addr = slot_addr(orig_addr, i);
+	tlb_addr = slot_addr(pool->start, index) + offset;
 	/*
 	 * When dir == DMA_FROM_DEVICE we could omit the copy from the orig
 	 * to the tlb buffer, if we knew for sure the device will
@@ -877,7 +920,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
 
 static void swiotlb_release_slots(struct device *dev, phys_addr_t tlb_addr)
 {
-	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
+	struct io_tlb_pool *mem = dev->dma_io_tlb_mem->pool;
 	unsigned long flags;
 	unsigned int offset = swiotlb_align_offset(dev, tlb_addr);
 	int index = (tlb_addr - offset - mem->start) >> IO_TLB_SHIFT;
@@ -921,7 +964,7 @@ static void swiotlb_release_slots(struct device *dev, phys_addr_t tlb_addr)
 	area->used -= nslots;
 	spin_unlock_irqrestore(&area->lock, flags);
 
-	dec_used(mem, nslots);
+	dec_used(dev->dma_io_tlb_mem, nslots);
 }
 
 /*
@@ -1031,7 +1074,7 @@ EXPORT_SYMBOL_GPL(is_swiotlb_active);
  */
 phys_addr_t default_swiotlb_start(void)
 {
-	return io_tlb_default_mem.start;
+	return io_tlb_default_pool.start;
 }
 
 /**
@@ -1041,7 +1084,7 @@ phys_addr_t default_swiotlb_start(void)
  */
 phys_addr_t default_swiotlb_limit(void)
 {
-	return io_tlb_default_mem.end - 1;
+	return io_tlb_default_pool.end - 1;
 }
 
 #ifdef CONFIG_DEBUG_FS
@@ -1117,6 +1160,7 @@ static inline void swiotlb_create_debugfs_files(struct io_tlb_mem *mem,
 struct page *swiotlb_alloc(struct device *dev, size_t size)
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
+	struct io_tlb_pool *pool;
 	phys_addr_t tlb_addr;
 	int index;
 
@@ -1127,7 +1171,8 @@ struct page *swiotlb_alloc(struct device *dev, size_t size)
 	if (index == -1)
 		return NULL;
 
-	tlb_addr = slot_addr(mem->start, index);
+	pool = mem->pool;
+	tlb_addr = slot_addr(pool->start, index);
 
 	return pfn_to_page(PFN_DOWN(tlb_addr));
 }
@@ -1164,29 +1209,35 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem,
 	 * to it.
 	 */
 	if (!mem) {
-		mem = kzalloc(sizeof(*mem), GFP_KERNEL);
+		struct io_tlb_pool *pool;
+
+		mem = kzalloc(sizeof(*mem) + sizeof(*pool), GFP_KERNEL);
 		if (!mem)
 			return -ENOMEM;
+		pool = (void *)mem + sizeof(*mem);
 
-		mem->slots = kcalloc(nslabs, sizeof(*mem->slots), GFP_KERNEL);
-		if (!mem->slots) {
+		pool->slots = kcalloc(nslabs, sizeof(*pool->slots), GFP_KERNEL);
+		if (!pool->slots) {
 			kfree(mem);
 			return -ENOMEM;
 		}
 
-		mem->areas = kcalloc(nareas, sizeof(*mem->areas),
+		pool->areas = kcalloc(nareas, sizeof(*pool->areas),
 				GFP_KERNEL);
-		if (!mem->areas) {
-			kfree(mem->slots);
+		if (!pool->areas) {
+			kfree(pool->slots);
 			kfree(mem);
 			return -ENOMEM;
 		}
 
 		set_memory_decrypted((unsigned long)phys_to_virt(rmem->base),
 				     rmem->size >> PAGE_SHIFT);
-		swiotlb_init_io_tlb_mem(mem, rmem->base, nslabs, SWIOTLB_FORCE,
-					false, nareas);
+		swiotlb_init_io_tlb_pool(pool, rmem->base, nslabs,
+					 false, nareas);
+		mem->force_bounce = true;
 		mem->for_alloc = true;
+		mem->pool = pool;
+		mem->nslabs = nslabs;
 
 		rmem->priv = mem;
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 13 15:25:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 15:25:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563254.880402 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyCB-00057o-TB; Thu, 13 Jul 2023 15:25:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563254.880402; Thu, 13 Jul 2023 15:25:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyCB-00057e-Pd; Thu, 13 Jul 2023 15:25:31 +0000
Received: by outflank-mailman (input) for mailman id 563254;
 Thu, 13 Jul 2023 15:25:30 +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
 <SRS0=9mYz=C7=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qJyCA-0003b5-II
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 15:25:30 +0000
Received: from frasgout12.his.huawei.com (unknown [14.137.139.154])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7eca0539-2191-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 17:25:28 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.227])
 by frasgout12.his.huawei.com (SkyGuard) with ESMTP id 4R1ylN4SXlz9xFqk
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 23:12:32 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.218.161])
 by APP1 (Coremail) with SMTP id LxC2BwA3k94BF7BkxG6BBA--.7207S6;
 Thu, 13 Jul 2023 16:25:00 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7eca0539-2191-11ee-8611-37d641c3527e
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	petr@tesarici.cz
Subject: [PATCH v4 4/8] swiotlb: add a flag whether a SWIOTLB is allowed to grow
Date: Thu, 13 Jul 2023 17:23:15 +0200
Message-Id: <80501ecd65a7089ccfe9577a666dcaaddcafb4e7.1689261692.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:LxC2BwA3k94BF7BkxG6BBA--.7207S6
X-Coremail-Antispam: 1UD129KBjvJXoWxWrW8XF1fKr1fZr13Wr4UArb_yoW5CFWUpF
	15Aa1UKF42qF1xArZ7CwnxJF929a1vkay7urWY9ry5Ar13Gr13tF4DKay5tryFqr4jv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UU=
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

Mark the default SWIOTLB as able to grow and restricted DMA pools as
unable.

However, if the address of the default memory pool is explicitly queried,
make the default SWIOTLB also unable to grow. This is currently used to set
up PCI BAR movable regions on some Octeon MIPS boards which may not be able
to use a SWIOTLB pool elsewhere in physical memory. See octeon_pci_setup()
for more details.

If a remap function is specified, it must be also called on any dynamically
allocated pools, but there are some issues:

- The remap function may block, so it should not be called from an atomic
  context.
- There is no corresponding unremap() function if the memory pool is
  freed.
- The only in-tree implementation (xen_swiotlb_fixup) requires that the
  number of slots in the memory pool is a multiple of SWIOTLB_SEGSIZE.

Keep it simple for now and disable growing the SWIOTLB if a remap function
was specified.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/swiotlb.h | 2 ++
 kernel/dma/swiotlb.c    | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index d669e11e2827..81f8c901e888 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -102,6 +102,7 @@ struct io_tlb_pool {
  * @debugfs:	The dentry to debugfs.
  * @force_bounce: %true if swiotlb bouncing is forced
  * @for_alloc:  %true if the pool is used for memory allocation
+ * @can_grow:	%true if more pools can be allocated dynamically.
  * @total_used:	The total number of slots in the pool that are currently used
  *		across all areas. Used only for calculating used_hiwater in
  *		debugfs.
@@ -114,6 +115,7 @@ struct io_tlb_mem {
 	struct dentry *debugfs;
 	bool force_bounce;
 	bool for_alloc;
+	bool can_grow;
 #ifdef CONFIG_DEBUG_FS
 	atomic_long_t total_used;
 	atomic_long_t used_hiwater;
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index a80b77de8829..16e5b9a82902 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -332,6 +332,7 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 
 	io_tlb_default_mem.force_bounce =
 		swiotlb_force_bounce || (flags & SWIOTLB_FORCE);
+	io_tlb_default_mem.can_grow = !remap;
 
 	if (!default_nareas)
 		swiotlb_adjust_nareas(num_possible_cpus());
@@ -399,6 +400,7 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 		return 0;
 
 	io_tlb_default_mem.force_bounce = swiotlb_force_bounce;
+	io_tlb_default_mem.can_grow = !remap;
 
 	if (!default_nareas)
 		swiotlb_adjust_nareas(num_possible_cpus());
@@ -1074,6 +1076,7 @@ EXPORT_SYMBOL_GPL(is_swiotlb_active);
  */
 phys_addr_t default_swiotlb_start(void)
 {
+	io_tlb_default_mem.can_grow = false;
 	return io_tlb_default_pool.start;
 }
 
@@ -1236,6 +1239,7 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem,
 					 false, nareas);
 		mem->force_bounce = true;
 		mem->for_alloc = true;
+		mem->can_grow = false;
 		mem->pool = pool;
 		mem->nslabs = nslabs;
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 13 15:25:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 15:25:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563259.880412 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyCQ-0005hG-C2; Thu, 13 Jul 2023 15:25:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563259.880412; Thu, 13 Jul 2023 15:25:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyCQ-0005g7-7x; Thu, 13 Jul 2023 15:25:46 +0000
Received: by outflank-mailman (input) for mailman id 563259;
 Thu, 13 Jul 2023 15:25:44 +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
 <SRS0=9mYz=C7=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qJyCO-0003b5-73
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 15:25:44 +0000
Received: from frasgout12.his.huawei.com (unknown [14.137.139.154])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 87421007-2191-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 17:25:41 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.227])
 by frasgout12.his.huawei.com (SkyGuard) with ESMTP id 4R1ylf710sz9xFqk
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 23:12:46 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.218.161])
 by APP1 (Coremail) with SMTP id LxC2BwA3k94BF7BkxG6BBA--.7207S7;
 Thu, 13 Jul 2023 16:25:14 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 87421007-2191-11ee-8611-37d641c3527e
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	petr@tesarici.cz
Subject: [PATCH v4 5/8] swiotlb: if swiotlb is full, fall back to a transient memory pool
Date: Thu, 13 Jul 2023 17:23:16 +0200
Message-Id: <41285b9a1bf022206d8f6ff5d8af1fbca3921e9b.1689261692.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:LxC2BwA3k94BF7BkxG6BBA--.7207S7
X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F0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2
	jsIEc7CjxVAFwI0_Cr1j6rxdYxBIdaVFxhVjvjDU0xZFpf9x0JU3l19UUUUU=
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

Try to allocate a transient memory pool if no suitable slots can be found
and the respective SWIOTLB is allowed to grow. The transient pool is just
enough big for this one bounce buffer. It is inserted into a per-device
list of transient memory pools, and it is freed again when the bounce
buffer is unmapped.

Transient memory pools are kept in an RCU list. A memory barrier is
required after adding a new entry, because any address within a transient
buffer must be immediately recognized as belonging to the SWIOTLB, even if
it is passed to another CPU.

Deletion does not require any synchronization beyond RCU ordering
guarantees. After a buffer is unmapped, its physical addresses may no
longer be passed to the DMA API, so the memory range of the corresponding
stale entry in the RCU list never matches. If the memory range gets
allocated again, then it happens only after a RCU quiescent state.

Since bounce buffers can now be allocated from different pools, add a
parameter to swiotlb_alloc_pool() to let the caller know which memory pool
is used. Add swiotlb_find_pool() to find the memory pool corresponding to
an address. This function is now also used by is_swiotlb_buffer(), because
a simple boundary check is no longer sufficient.

The logic in swiotlb_alloc_tlb() is taken from __dma_direct_alloc_pages(),
simplified and enhanced to use coherent memory pools if needed.

Note that this is not the most efficient way to provide a bounce buffer,
but when a DMA buffer can't be mapped, something may (and will) actually
break. At that point it is better to make an allocation, even if it may be
an expensive operation.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/device.h      |   4 +
 include/linux/dma-mapping.h |   2 +
 include/linux/swiotlb.h     |  13 +-
 kernel/dma/direct.c         |   2 +-
 kernel/dma/swiotlb.c        | 270 ++++++++++++++++++++++++++++++++++--
 5 files changed, 277 insertions(+), 14 deletions(-)

diff --git a/include/linux/device.h b/include/linux/device.h
index d9754a68ba95..549b0a62455c 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -626,6 +626,8 @@ struct device_physical_location {
  * @dma_mem:	Internal for coherent mem override.
  * @cma_area:	Contiguous memory area for dma allocations
  * @dma_io_tlb_mem: Software IO TLB allocator.  Not for driver use.
+ * @dma_io_tlb_pools:	List of transient swiotlb memory pools.
+ * @dma_io_tlb_lock:	Protects changes to the list of active pools.
  * @archdata:	For arch-specific additions.
  * @of_node:	Associated device tree node.
  * @fwnode:	Associated device node supplied by platform firmware.
@@ -731,6 +733,8 @@ struct device {
 #endif
 #ifdef CONFIG_SWIOTLB
 	struct io_tlb_mem *dma_io_tlb_mem;
+	struct list_head dma_io_tlb_pools;
+	spinlock_t dma_io_tlb_lock;
 #endif
 	/* arch specific additions */
 	struct dev_archdata	archdata;
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index e13050eb9777..f0ccca16a0ac 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -418,6 +418,8 @@ static inline void dma_sync_sgtable_for_device(struct device *dev,
 #define dma_get_sgtable(d, t, v, h, s) dma_get_sgtable_attrs(d, t, v, h, s, 0)
 #define dma_mmap_coherent(d, v, c, h, s) dma_mmap_attrs(d, v, c, h, s, 0)
 
+bool dma_coherent_ok(struct device *dev, phys_addr_t phys, size_t size);
+
 static inline void *dma_alloc_coherent(struct device *dev, size_t size,
 		dma_addr_t *dma_handle, gfp_t gfp)
 {
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 81f8c901e888..b642e7739604 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -63,6 +63,7 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t phys,
 
 /**
  * struct io_tlb_pool - IO TLB memory pool descriptor
+ * @node:	Member of the IO TLB memory pool list.
  * @start:	The start address of the swiotlb memory pool. Used to do a quick
  *		range check to see if the memory was in fact allocated by this
  *		API.
@@ -77,22 +78,27 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t phys,
  *		see setup_io_tlb_npages().
  * @used:	The number of used IO TLB slots.
  * @late_alloc:	%true if allocated using the page allocator.
+ * @transient:  %true if transient memory pool.
  * @nareas:	Number of areas in the pool.
  * @area_nslabs: Number of slots in each area.
  * @areas:	Array of memory area descriptors.
  * @slots:	Array of slot descriptors.
+ * @rcu:	RCU head for swiotlb_dyn_free().
  */
 struct io_tlb_pool {
+	struct list_head node;
 	phys_addr_t start;
 	phys_addr_t end;
 	void *vaddr;
 	unsigned long nslabs;
 	unsigned long used;
 	bool late_alloc;
+	bool transient;
 	unsigned int nareas;
 	unsigned int area_nslabs;
 	struct io_tlb_area *areas;
 	struct io_tlb_slot *slots;
+	struct rcu_head rcu;
 };
 
 /**
@@ -122,6 +128,8 @@ struct io_tlb_mem {
 #endif
 };
 
+struct io_tlb_pool *swiotlb_find_pool(struct device *dev, phys_addr_t paddr);
+
 /**
  * is_swiotlb_buffer() - check if a physical address belongs to a swiotlb
  * @dev:        Device which has mapped the buffer.
@@ -135,9 +143,8 @@ struct io_tlb_mem {
  */
 static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
 {
-	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
-
-	return mem && paddr >= mem->pool->start && paddr < mem->pool->end;
+	return dev->dma_io_tlb_mem &&
+		!!swiotlb_find_pool(dev, paddr);
 }
 
 static inline bool is_swiotlb_force_bounce(struct device *dev)
diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
index d29cade048db..9596ae1aa0da 100644
--- a/kernel/dma/direct.c
+++ b/kernel/dma/direct.c
@@ -66,7 +66,7 @@ static gfp_t dma_direct_optimal_gfp_mask(struct device *dev, u64 *phys_limit)
 	return 0;
 }
 
-static bool dma_coherent_ok(struct device *dev, phys_addr_t phys, size_t size)
+bool dma_coherent_ok(struct device *dev, phys_addr_t phys, size_t size)
 {
 	dma_addr_t dma_addr = phys_to_dma_direct(dev, phys);
 
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 16e5b9a82902..6ec5a81acc2a 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -35,6 +35,7 @@
 #include <linux/memblock.h>
 #include <linux/mm.h>
 #include <linux/pfn.h>
+#include <linux/rculist.h>
 #include <linux/scatterlist.h>
 #include <linux/set_memory.h>
 #include <linux/spinlock.h>
@@ -502,6 +503,159 @@ void __init swiotlb_exit(void)
 	memset(mem, 0, sizeof(*mem));
 }
 
+/**
+ * alloc_dma_pages() - allocate pages to be used for DMA
+ * @gfp:	GFP flags for the allocation.
+ * @bytes:	Size of the buffer.
+ *
+ * Allocate pages from the buddy allocator. If successful, make the allocated
+ * pages decrypted that they can be used for DMA.
+ *
+ * Return: Decrypted pages, or %NULL on failure.
+ */
+static struct page *alloc_dma_pages(gfp_t gfp, size_t bytes)
+{
+	unsigned int order = get_order(bytes);
+	struct page *page;
+	void *vaddr;
+
+	page = alloc_pages(gfp, order);
+	if (!page)
+		return NULL;
+
+	vaddr = page_address(page);
+	if (set_memory_decrypted((unsigned long)vaddr, PFN_UP(bytes)))
+		goto error;
+	return page;
+
+error:
+	__free_pages(page, order);
+	return NULL;
+}
+
+/**
+ * swiotlb_alloc_tlb() - allocate a dynamic IO TLB buffer
+ * @dev:	Device for which a memory pool is allocated.
+ * @bytes:	Size of the buffer.
+ * @phys_limit:	Maximum allowed physical address of the buffer.
+ * @gfp:	GFP flags for the allocation.
+ *
+ * Return: Allocated pages, or %NULL on allocation failure.
+ */
+static struct page *swiotlb_alloc_tlb(struct device *dev, size_t bytes,
+		u64 phys_limit, gfp_t gfp)
+{
+	struct page *page;
+
+	/*
+	 * Allocate from the atomic pools if memory is encrypted and
+	 * the allocation is atomic, because decrypting may block.
+	 */
+	if (!gfpflags_allow_blocking(gfp) && dev && force_dma_unencrypted(dev)) {
+		void *vaddr;
+
+		if (!IS_ENABLED(CONFIG_DMA_COHERENT_POOL))
+			return NULL;
+
+		return dma_alloc_from_pool(dev, bytes, &vaddr, gfp,
+					   dma_coherent_ok);
+	}
+
+	gfp &= ~GFP_ZONEMASK;
+	if (phys_limit <= DMA_BIT_MASK(zone_dma_bits))
+		gfp |= __GFP_DMA;
+	else if (phys_limit <= DMA_BIT_MASK(32))
+		gfp |= __GFP_DMA32;
+
+	while ((page = alloc_dma_pages(gfp, bytes)) &&
+	       page_to_phys(page) + bytes - 1 > phys_limit) {
+		/* allocated, but too high */
+		__free_pages(page, get_order(bytes));
+
+		if (IS_ENABLED(CONFIG_ZONE_DMA32) &&
+		    phys_limit < DMA_BIT_MASK(64) &&
+		    !(gfp & (__GFP_DMA32 | __GFP_DMA)))
+			gfp |= __GFP_DMA32;
+		else if (IS_ENABLED(CONFIG_ZONE_DMA) &&
+			 !(gfp & __GFP_DMA))
+			gfp = (gfp & ~__GFP_DMA32) | __GFP_DMA;
+		else
+			return NULL;
+	}
+
+	return page;
+}
+
+/**
+ * swiotlb_free_tlb() - free a dynamically allocated IO TLB buffer
+ * @vaddr:	Virtual address of the buffer.
+ * @bytes:	Size of the buffer.
+ */
+static void swiotlb_free_tlb(void *vaddr, size_t bytes)
+{
+	if (IS_ENABLED(CONFIG_DMA_COHERENT_POOL) &&
+	    dma_free_from_pool(NULL, vaddr, bytes))
+		return;
+
+	/* Intentional leak if pages cannot be encrypted again. */
+	if (!set_memory_encrypted((unsigned long)vaddr, PFN_UP(bytes)))
+		__free_pages(virt_to_page(vaddr), get_order(bytes));
+}
+
+/**
+ * swiotlb_alloc_pool() - allocate a new IO TLB memory pool
+ * @dev:	Device for which a memory pool is allocated.
+ * @nslabs:	Desired number of slabs.
+ * @phys_limit:	Maximum DMA buffer physical address.
+ * @gfp:	GFP flags for the allocations.
+ *
+ * Allocate and initialize a new IO TLB memory pool.
+ *
+ * Return: New memory pool, or %NULL on allocation failure.
+ */
+static struct io_tlb_pool *swiotlb_alloc_pool(struct device *dev,
+		unsigned int nslabs, u64 phys_limit, gfp_t gfp)
+{
+	struct io_tlb_pool *pool;
+	struct page *tlb;
+	size_t pool_size;
+	size_t tlb_size;
+
+	pool_size = sizeof(*pool) + array_size(sizeof(*pool->areas), 1) +
+		array_size(sizeof(*pool->slots), nslabs);
+	pool = kzalloc(pool_size, gfp);
+	if (!pool)
+		goto error;
+	pool->areas = (void *)pool + sizeof(*pool);
+	pool->slots = (void *)pool->areas + sizeof(*pool->areas);
+
+	tlb_size = nslabs << IO_TLB_SHIFT;
+	tlb = swiotlb_alloc_tlb(dev, tlb_size, phys_limit, gfp);
+	if (!tlb)
+		goto error_tlb;
+
+	swiotlb_init_io_tlb_pool(pool, page_to_phys(tlb), nslabs, true, 1);
+	return pool;
+
+error_tlb:
+	kfree(pool);
+error:
+	return NULL;
+}
+
+/**
+ * swiotlb_dyn_free() - RCU callback to free a memory pool
+ * @rcu:	RCU head in the corresponding struct io_tlb_pool.
+ */
+static void swiotlb_dyn_free(struct rcu_head *rcu)
+{
+	struct io_tlb_pool *pool = container_of(rcu, struct io_tlb_pool, rcu);
+	size_t tlb_size = pool->end - pool->start;
+
+	swiotlb_free_tlb(pool->vaddr, tlb_size);
+	kfree(pool);
+}
+
 /**
  * swiotlb_dev_init() - initialize swiotlb fields in &struct device
  * @dev:	Device to be initialized.
@@ -509,6 +663,56 @@ void __init swiotlb_exit(void)
 void swiotlb_dev_init(struct device *dev)
 {
 	dev->dma_io_tlb_mem = &io_tlb_default_mem;
+	INIT_LIST_HEAD(&dev->dma_io_tlb_pools);
+	spin_lock_init(&dev->dma_io_tlb_lock);
+}
+
+/**
+ * swiotlb_find_pool() - find the IO TLB pool for a physical address
+ * @dev:        Device which has mapped the DMA buffer.
+ * @paddr:      Physical address within the DMA buffer.
+ *
+ * Find the IO TLB memory pool descriptor which contains the given physical
+ * address, if any.
+ *
+ * Return: Memory pool which contains @paddr, or %NULL if none.
+ */
+struct io_tlb_pool *swiotlb_find_pool(struct device *dev, phys_addr_t paddr)
+{
+	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
+	struct io_tlb_pool *pool = mem->pool;
+
+	if (paddr >= pool->start && paddr < pool->end)
+		return pool;
+
+	/* Pairs with smp_wmb() in swiotlb_find_slots(). */
+	smp_rmb();
+
+	rcu_read_lock();
+	list_for_each_entry_rcu(pool, &dev->dma_io_tlb_pools, node) {
+		if (paddr >= pool->start && paddr < pool->end)
+			goto out;
+	}
+	pool = NULL;
+out:
+	rcu_read_unlock();
+	return pool;
+}
+
+/**
+ * swiotlb_del_pool() - remove an IO TLB pool from a device
+ * @dev:	Owning device.
+ * @pool:	Memory pool to be removed.
+ */
+static void swiotlb_del_pool(struct device *dev, struct io_tlb_pool *pool)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&dev->dma_io_tlb_lock, flags);
+	list_del_rcu(&pool->node);
+	spin_unlock_irqrestore(&dev->dma_io_tlb_lock, flags);
+
+	call_rcu(&pool->rcu, swiotlb_dyn_free);
 }
 
 /*
@@ -525,7 +729,7 @@ static unsigned int swiotlb_align_offset(struct device *dev, u64 addr)
 static void swiotlb_bounce(struct device *dev, phys_addr_t tlb_addr, size_t size,
 			   enum dma_data_direction dir)
 {
-	struct io_tlb_pool *mem = dev->dma_io_tlb_mem->pool;
+	struct io_tlb_pool *mem = swiotlb_find_pool(dev, tlb_addr);
 	int index = (tlb_addr - mem->start) >> IO_TLB_SHIFT;
 	phys_addr_t orig_addr = mem->slots[index].orig_addr;
 	size_t alloc_size = mem->slots[index].alloc_size;
@@ -798,6 +1002,7 @@ static int pool_find_slots(struct device *dev, struct io_tlb_pool *pool,
  * @alloc_size: Total requested size of the bounce buffer,
  *		including initial alignment padding.
  * @alloc_align_mask:	Required alignment of the allocated buffer.
+ * @retpool:	Used memory pool, updated on return.
  *
  * Search through the whole software IO TLB to find a sequence of slots that
  * match the allocation constraints.
@@ -805,10 +1010,49 @@ static int pool_find_slots(struct device *dev, struct io_tlb_pool *pool,
  * Return: Index of the first allocated slot, or -1 on error.
  */
 static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
-		size_t alloc_size, unsigned int alloc_align_mask)
+		size_t alloc_size, unsigned int alloc_align_mask,
+		struct io_tlb_pool **retpool)
 {
-	return pool_find_slots(dev, dev->dma_io_tlb_mem->pool, orig_addr,
-			       alloc_size, alloc_align_mask);
+	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
+	struct io_tlb_pool *pool;
+	unsigned long nslabs;
+	unsigned long flags;
+	u64 phys_limit;
+	int index;
+
+	pool = mem->pool;
+	index = pool_find_slots(dev, pool, orig_addr,
+				alloc_size, alloc_align_mask);
+	if (index >= 0)
+		goto found;
+
+	if (!dev->dma_io_tlb_mem->can_grow)
+		return -1;
+
+	nslabs = nr_slots(alloc_size);
+	phys_limit = min_not_zero(*dev->dma_mask, dev->bus_dma_limit);
+	pool = swiotlb_alloc_pool(dev, nslabs, phys_limit,
+				  GFP_NOWAIT | __GFP_NOWARN);
+	if (!pool)
+		return -1;
+
+	index = pool_find_slots(dev, pool, orig_addr,
+				alloc_size, alloc_align_mask);
+	if (index < 0) {
+		swiotlb_dyn_free(&pool->rcu);
+		return -1;
+	}
+
+	pool->transient = true;
+	spin_lock_irqsave(&dev->dma_io_tlb_lock, flags);
+	list_add_rcu(&pool->node, &dev->dma_io_tlb_pools);
+	spin_unlock_irqrestore(&dev->dma_io_tlb_lock, flags);
+
+	/* Pairs with smp_rmb() in swiotlb_find_pool(). */
+	smp_wmb();
+found:
+	*retpool = pool;
+	return index;
 }
 
 #ifdef CONFIG_DEBUG_FS
@@ -891,7 +1135,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
 	}
 
 	index = swiotlb_find_slots(dev, orig_addr,
-				   alloc_size + offset, alloc_align_mask);
+				   alloc_size + offset, alloc_align_mask, &pool);
 	if (index == -1) {
 		if (!(attrs & DMA_ATTR_NO_WARN))
 			dev_warn_ratelimited(dev,
@@ -905,7 +1149,6 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
 	 * This is needed when we sync the memory.  Then we sync the buffer if
 	 * needed.
 	 */
-	pool = mem->pool;
 	for (i = 0; i < nr_slots(alloc_size + offset); i++)
 		pool->slots[index + i].orig_addr = slot_addr(orig_addr, i);
 	tlb_addr = slot_addr(pool->start, index) + offset;
@@ -922,7 +1165,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
 
 static void swiotlb_release_slots(struct device *dev, phys_addr_t tlb_addr)
 {
-	struct io_tlb_pool *mem = dev->dma_io_tlb_mem->pool;
+	struct io_tlb_pool *mem = swiotlb_find_pool(dev, tlb_addr);
 	unsigned long flags;
 	unsigned int offset = swiotlb_align_offset(dev, tlb_addr);
 	int index = (tlb_addr - offset - mem->start) >> IO_TLB_SHIFT;
@@ -976,6 +1219,8 @@ void swiotlb_tbl_unmap_single(struct device *dev, phys_addr_t tlb_addr,
 			      size_t mapping_size, enum dma_data_direction dir,
 			      unsigned long attrs)
 {
+	struct io_tlb_pool *pool;
+
 	/*
 	 * First, sync the memory before unmapping the entry
 	 */
@@ -983,7 +1228,13 @@ void swiotlb_tbl_unmap_single(struct device *dev, phys_addr_t tlb_addr,
 	    (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL))
 		swiotlb_bounce(dev, tlb_addr, mapping_size, DMA_FROM_DEVICE);
 
-	swiotlb_release_slots(dev, tlb_addr);
+	pool = swiotlb_find_pool(dev, tlb_addr);
+	if (pool->transient) {
+		dec_used(dev->dma_io_tlb_mem, pool->nslabs);
+		swiotlb_del_pool(dev, pool);
+	} else {
+		swiotlb_release_slots(dev, tlb_addr);
+	}
 }
 
 void swiotlb_sync_single_for_device(struct device *dev, phys_addr_t tlb_addr,
@@ -1170,11 +1421,10 @@ struct page *swiotlb_alloc(struct device *dev, size_t size)
 	if (!mem)
 		return NULL;
 
-	index = swiotlb_find_slots(dev, 0, size, 0);
+	index = swiotlb_find_slots(dev, 0, size, 0, &pool);
 	if (index == -1)
 		return NULL;
 
-	pool = mem->pool;
 	tlb_addr = slot_addr(pool->start, index);
 
 	return pfn_to_page(PFN_DOWN(tlb_addr));
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 13 15:28:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 15:28:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563270.880428 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyEf-0006jt-3d; Thu, 13 Jul 2023 15:28:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563270.880428; Thu, 13 Jul 2023 15:28:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyEe-0006jS-Un; Thu, 13 Jul 2023 15:28:04 +0000
Received: by outflank-mailman (input) for mailman id 563270;
 Thu, 13 Jul 2023 15:28:04 +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
 <SRS0=9mYz=C7=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qJyD4-0003b5-IX
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 15:26:26 +0000
Received: from frasgout13.his.huawei.com (unknown [14.137.139.46])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a0e9f764-2191-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 17:26:25 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.229])
 by frasgout13.his.huawei.com (SkyGuard) with ESMTP id 4R1ypb2WRhz9xGnG
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 23:15:19 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.218.161])
 by APP1 (Coremail) with SMTP id LxC2BwA3k94BF7BkxG6BBA--.7207S10;
 Thu, 13 Jul 2023 16:25:57 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a0e9f764-2191-11ee-8611-37d641c3527e
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	petr@tesarici.cz
Subject: [PATCH v4 8/8] swiotlb: search the software IO TLB only if a device makes use of it
Date: Thu, 13 Jul 2023 17:23:19 +0200
Message-Id: <a8d31d3fffa0867dce2b44b98dc2714289edfdc9.1689261692.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:LxC2BwA3k94BF7BkxG6BBA--.7207S10
X-Coremail-Antispam: 1UD129KBjvJXoWxZF15Ww18ZF1fWr1UtFW7XFb_yoWrXF1DpF
	yUAFZ8Kayqqr97Cr92kF4UZ3Wagw4vkw43CryaqrnY9rn8JwnaqF1DKrWYv3s5Ar47ZF47
	Xryj939Ykw17Xr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDU0xBIdaVrnRJUUUQl14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0
	rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYI
	kIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2
	z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F
	4UJwA2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z280aVCY1x0267AKxVWxJr0_
	GcWle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2I
	x0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8
	JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7CjxVA2Y2
	ka0xkIwI1lc7CjxVAaw2AFwI0_Jw0_GFylc7CjxVAKzI0EY4vE52x082I5MxAIw28IcxkI
	7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxV
	Cjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWrXVW8Jr1lIxkGc2Ij64vIr41lIxAI
	cVC0I7IYx2IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJwCI42
	IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280
	aVCY1x0267AKxVWxJr0_GcJvcSsGvfC2KfnxnUUI43ZEXa7VUjgAw3UUUUU==
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

Skip searching the software IO TLB if a device has never used it, making
sure these devices are not affected by the introduction of multiple IO TLB
memory pools.

Additional memory barrier is required to ensure that the new value of the
flag is visible to other CPUs after mapping a new bounce buffer. For
efficiency, the flag check should be inlined, and then the memory barrier
must be moved to is_swiotlb_buffer(). However, it can replace the existing
barrier in swiotlb_find_pool(), because all callers use is_swiotlb_buffer()
first to verify that the buffer address belongs to the software IO TLB.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/device.h  |  2 ++
 include/linux/swiotlb.h |  6 +++++-
 kernel/dma/swiotlb.c    | 14 ++++++--------
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/include/linux/device.h b/include/linux/device.h
index 549b0a62455c..86871d628648 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -628,6 +628,7 @@ struct device_physical_location {
  * @dma_io_tlb_mem: Software IO TLB allocator.  Not for driver use.
  * @dma_io_tlb_pools:	List of transient swiotlb memory pools.
  * @dma_io_tlb_lock:	Protects changes to the list of active pools.
+ * @dma_uses_io_tlb: %true if device has used the software IO TLB.
  * @archdata:	For arch-specific additions.
  * @of_node:	Associated device tree node.
  * @fwnode:	Associated device node supplied by platform firmware.
@@ -735,6 +736,7 @@ struct device {
 	struct io_tlb_mem *dma_io_tlb_mem;
 	struct list_head dma_io_tlb_pools;
 	spinlock_t dma_io_tlb_lock;
+	bool dma_uses_io_tlb;
 #endif
 	/* arch specific additions */
 	struct dev_archdata	archdata;
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 06fd94de1cd8..8069cb62c893 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -150,7 +150,11 @@ struct io_tlb_pool *swiotlb_find_pool(struct device *dev, phys_addr_t paddr);
  */
 static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
 {
-	return dev->dma_io_tlb_mem &&
+	/* Pairs with smp_wmb() in swiotlb_find_slots() and
+	 * swiotlb_dyn_alloc(), which modify the RCU lists.
+	 */
+	smp_rmb();
+	return dev->dma_uses_io_tlb &&
 		!!swiotlb_find_pool(dev, paddr);
 }
 
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 9c66ec2c47dd..854d139ddcb7 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -706,7 +706,7 @@ static void swiotlb_dyn_alloc(struct work_struct *work)
 
 	add_mem_pool(mem, pool);
 
-	/* Pairs with smp_rmb() in swiotlb_find_pool(). */
+	/* Pairs with smp_rmb() in is_swiotlb_buffer(). */
 	smp_wmb();
 }
 
@@ -734,6 +734,7 @@ void swiotlb_dev_init(struct device *dev)
 	dev->dma_io_tlb_mem = &io_tlb_default_mem;
 	INIT_LIST_HEAD(&dev->dma_io_tlb_pools);
 	spin_lock_init(&dev->dma_io_tlb_lock);
+	dev->dma_uses_io_tlb = false;
 }
 
 /**
@@ -751,11 +752,6 @@ struct io_tlb_pool *swiotlb_find_pool(struct device *dev, phys_addr_t paddr)
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
 	struct io_tlb_pool *pool;
 
-	/* Pairs with smp_wmb() in swiotlb_find_slots() and
-	 * swiotlb_dyn_alloc(), which modify the RCU lists.
-	 */
-	smp_rmb();
-
 	rcu_read_lock();
 	list_for_each_entry_rcu(pool, &mem->pools, node) {
 		if (paddr >= pool->start && paddr < pool->end)
@@ -1128,9 +1124,11 @@ static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
 	list_add_rcu(&pool->node, &dev->dma_io_tlb_pools);
 	spin_unlock_irqrestore(&dev->dma_io_tlb_lock, flags);
 
-	/* Pairs with smp_rmb() in swiotlb_find_pool(). */
-	smp_wmb();
 found:
+	dev->dma_uses_io_tlb = true;
+	/* Pairs with smp_rmb() in is_swiotlb_buffer() */
+	smp_wmb();
+
 	*retpool = pool;
 	return index;
 }
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 13 15:28:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 15:28:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563269.880421 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyEe-0006gF-PS; Thu, 13 Jul 2023 15:28:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563269.880421; Thu, 13 Jul 2023 15:28:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyEe-0006g8-MG; Thu, 13 Jul 2023 15:28:04 +0000
Received: by outflank-mailman (input) for mailman id 563269;
 Thu, 13 Jul 2023 15:28:04 +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
 <SRS0=9mYz=C7=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qJyCd-0003b5-2v
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 15:25:59 +0000
Received: from frasgout12.his.huawei.com (unknown [14.137.139.154])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8ffcb9d9-2191-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 17:25:56 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.227])
 by frasgout12.his.huawei.com (SkyGuard) with ESMTP id 4R1ylx1ZZgz9xFqy
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 23:13:01 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.218.161])
 by APP1 (Coremail) with SMTP id LxC2BwA3k94BF7BkxG6BBA--.7207S8;
 Thu, 13 Jul 2023 16:25:29 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8ffcb9d9-2191-11ee-8611-37d641c3527e
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	petr@tesarici.cz
Subject: [PATCH v4 6/8] swiotlb: determine potential physical address limit
Date: Thu, 13 Jul 2023 17:23:17 +0200
Message-Id: <ad39dc47041faa42f0307737a210cbd944e68c52.1689261692.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
References: <cover.1689261692.git.petr.tesarik.ext@huawei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VC0I7IYx2IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJwCI42
	IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280
	aVCY1x0267AKxVWxJr0_GcJvcSsGvfC2KfnxnUUI43ZEXa7VUjgAw3UUUUU==
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

The value returned by default_swiotlb_limit() should be constant, because
it is used to decide whether DMA can be used. To allow allocating memory
pools on the fly, use the maximum possible physical address rather than the
highest address used by the default pool.

For swiotlb_init_remap(), this is either an arch-specific limit used by
memblock_alloc_low(), or the highest directly mapped physical address if
the initialization flags include SWIOTLB_ANY. For swiotlb_init_late(), the
highest address is determined by the GFP flags.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/swiotlb.h |  2 ++
 kernel/dma/swiotlb.c    | 12 +++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index b642e7739604..ff8f5150f4de 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -105,6 +105,7 @@ struct io_tlb_pool {
  * struct io_tlb_mem - Software IO TLB allocator
  * @pool:	IO TLB memory pool descriptor.
  * @nslabs:	Total number of IO TLB slabs in all pools.
+ * @phys_limit:	Maximum allowed physical address.
  * @debugfs:	The dentry to debugfs.
  * @force_bounce: %true if swiotlb bouncing is forced
  * @for_alloc:  %true if the pool is used for memory allocation
@@ -118,6 +119,7 @@ struct io_tlb_pool {
 struct io_tlb_mem {
 	struct io_tlb_pool *pool;
 	unsigned long nslabs;
+	u64 phys_limit;
 	struct dentry *debugfs;
 	bool force_bounce;
 	bool for_alloc;
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 6ec5a81acc2a..d6a05727efc5 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -334,6 +334,10 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 	io_tlb_default_mem.force_bounce =
 		swiotlb_force_bounce || (flags & SWIOTLB_FORCE);
 	io_tlb_default_mem.can_grow = !remap;
+	if (flags & SWIOTLB_ANY)
+		io_tlb_default_mem.phys_limit = virt_to_phys(high_memory - 1);
+	else
+		io_tlb_default_mem.phys_limit = ARCH_LOW_ADDRESS_LIMIT;
 
 	if (!default_nareas)
 		swiotlb_adjust_nareas(num_possible_cpus());
@@ -402,6 +406,12 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 
 	io_tlb_default_mem.force_bounce = swiotlb_force_bounce;
 	io_tlb_default_mem.can_grow = !remap;
+	if (IS_ENABLED(CONFIG_ZONE_DMA) && (gfp_mask & __GFP_DMA))
+		io_tlb_default_mem.phys_limit = DMA_BIT_MASK(zone_dma_bits);
+	else if (IS_ENABLED(CONFIG_ZONE_DMA32) && (gfp_mask & __GFP_DMA32))
+		io_tlb_default_mem.phys_limit = DMA_BIT_MASK(32);
+	else
+		io_tlb_default_mem.phys_limit = virt_to_phys(high_memory - 1);
 
 	if (!default_nareas)
 		swiotlb_adjust_nareas(num_possible_cpus());
@@ -1338,7 +1348,7 @@ phys_addr_t default_swiotlb_start(void)
  */
 phys_addr_t default_swiotlb_limit(void)
 {
-	return io_tlb_default_pool.end - 1;
+	return io_tlb_default_mem.phys_limit;
 }
 
 #ifdef CONFIG_DEBUG_FS
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 13 15:28:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 15:28:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563271.880434 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyEf-0006qO-Di; Thu, 13 Jul 2023 15:28:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563271.880434; Thu, 13 Jul 2023 15:28:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyEf-0006oh-7c; Thu, 13 Jul 2023 15:28:05 +0000
Received: by outflank-mailman (input) for mailman id 563271;
 Thu, 13 Jul 2023 15:28:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=9mYz=C7=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qJyCq-0003BB-K3
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 15:26:12 +0000
Received: from frasgout11.his.huawei.com (unknown [14.137.139.23])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 99154c10-2191-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 17:26:11 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.229])
 by frasgout11.his.huawei.com (SkyGuard) with ESMTP id 4R1ypG5Rqrz9xGgv
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 23:15:02 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.218.161])
 by APP1 (Coremail) with SMTP id LxC2BwA3k94BF7BkxG6BBA--.7207S9;
 Thu, 13 Jul 2023 16:25:43 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 99154c10-2191-11ee-b239-6b7b168915f2
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	petr@tesarici.cz
Subject: [PATCH v4 7/8] swiotlb: allocate a new memory pool when existing pools are full
Date: Thu, 13 Jul 2023 17:23:18 +0200
Message-Id: <ce22a2ada0b31cf52e8228236dcfb575e4924fdc.1689261692.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:LxC2BwA3k94BF7BkxG6BBA--.7207S9
X-Coremail-Antispam: 1UD129KBjvJXoW3ZrWfGFyxAryxCr4UJFWfAFb_yoWkJFyDpF
	y5Aa47KFWUXrnrCFy2k3WUAF1akws2kr47Cryavr15Zrn7Wrn5KFyvkrWYqrWrJFWDuF13
	tFWYvF13uw47Ar7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDU0xBIdaVrnRJUUUQl14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0
	rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYI
	kIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2
	z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F
	4UJwA2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z280aVCY1x0267AKxVWxJr0_
	GcWle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2I
	x0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8
	JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7CjxVA2Y2
	ka0xkIwI1lc7CjxVAaw2AFwI0_Jw0_GFylc7CjxVAKzI0EY4vE52x082I5MxAIw28IcxkI
	7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxV
	Cjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWrXVW8Jr1lIxkGc2Ij64vIr41lIxAI
	cVC0I7IYx2IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJwCI42
	IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280
	aVCY1x0267AKxVWxJr0_GcJvcSsGvfC2KfnxnUUI43ZEXa7VUjgAw3UUUUU==
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

When swiotlb_find_slots() cannot find suitable slots, schedule the
allocation of a new memory pool. It is not possible to allocate the pool
immediately, because this code may run in interrupt context, which is not
suitable for large memory allocations. This means that the memory pool will
be available too late for the currently requested mapping, but the stress
on the software IO TLB allocator is likely to continue, and subsequent
allocations will benefit from the additional pool eventually.

Keep all memory pools for an allocator in an RCU list to avoid locking on
the read side. For modifications, add a new spinlock to struct io_tlb_mem.

The spinlock also protects updates to the total number of slabs (nslabs in
struct io_tlb_mem), but not reads of the value. Readers may therefore
encounter a stale value, but this is not an issue:

- swiotlb_tbl_map_single() and is_swiotlb_active() only check for non-zero
  value. This is ensured by the existence of the default memory pool,
  allocated at boot.

- The exact value is used only for non-critical purposes (debugfs, kernel
  messages).

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/swiotlb.h |   9 ++-
 kernel/dma/swiotlb.c    | 134 +++++++++++++++++++++++++++++++---------
 2 files changed, 113 insertions(+), 30 deletions(-)

diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index ff8f5150f4de..06fd94de1cd8 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -8,6 +8,7 @@
 #include <linux/types.h>
 #include <linux/limits.h>
 #include <linux/spinlock.h>
+#include <linux/workqueue.h>
 
 struct device;
 struct page;
@@ -103,13 +104,15 @@ struct io_tlb_pool {
 
 /**
  * struct io_tlb_mem - Software IO TLB allocator
- * @pool:	IO TLB memory pool descriptor.
+ * @lock:	Lock to synchronize changes to the list.
+ * @pools:	List of IO TLB memory pool descriptors.
  * @nslabs:	Total number of IO TLB slabs in all pools.
  * @phys_limit:	Maximum allowed physical address.
  * @debugfs:	The dentry to debugfs.
  * @force_bounce: %true if swiotlb bouncing is forced
  * @for_alloc:  %true if the pool is used for memory allocation
  * @can_grow:	%true if more pools can be allocated dynamically.
+ * @dyn_alloc:	Dynamic IO TLB pool allocation work.
  * @total_used:	The total number of slots in the pool that are currently used
  *		across all areas. Used only for calculating used_hiwater in
  *		debugfs.
@@ -117,13 +120,15 @@ struct io_tlb_pool {
  *		in debugfs.
  */
 struct io_tlb_mem {
-	struct io_tlb_pool *pool;
+	spinlock_t lock;
+	struct list_head pools;
 	unsigned long nslabs;
 	u64 phys_limit;
 	struct dentry *debugfs;
 	bool force_bounce;
 	bool for_alloc;
 	bool can_grow;
+	struct work_struct dyn_alloc;
 #ifdef CONFIG_DEBUG_FS
 	atomic_long_t total_used;
 	atomic_long_t used_hiwater;
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index d6a05727efc5..9c66ec2c47dd 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -79,9 +79,14 @@ struct io_tlb_slot {
 static bool swiotlb_force_bounce;
 static bool swiotlb_force_disable;
 
+static void swiotlb_dyn_alloc(struct work_struct *work);
+
 static struct io_tlb_pool io_tlb_default_pool;
-static struct io_tlb_mem io_tlb_default_mem = {
-	.pool = &io_tlb_default_pool,
+struct io_tlb_mem io_tlb_default_mem = {
+	.lock = __SPIN_LOCK_UNLOCKED(io_tlb_default_mem.lock),
+	.pools = LIST_HEAD_INIT(io_tlb_default_mem.pools),
+	.dyn_alloc = __WORK_INITIALIZER(io_tlb_default_mem.dyn_alloc,
+					swiotlb_dyn_alloc),
 };
 
 static unsigned long default_nslabs = IO_TLB_DEFAULT_SIZE >> IO_TLB_SHIFT;
@@ -281,6 +286,19 @@ static void swiotlb_init_io_tlb_pool(struct io_tlb_pool *mem, phys_addr_t start,
 	return;
 }
 
+/**
+ * add_mem_pool() - add a memory pool to the allocator
+ * @mem:	Software IO TLB allocator.
+ * @pool:	Memory pool to be added.
+ */
+static void add_mem_pool(struct io_tlb_mem *mem, struct io_tlb_pool *pool)
+{
+	spin_lock(&mem->lock);
+	list_add_rcu(&pool->node, &mem->pools);
+	mem->nslabs += pool->nslabs;
+	spin_unlock(&mem->lock);
+}
+
 static void __init *swiotlb_memblock_alloc(unsigned long nslabs,
 		unsigned int flags,
 		int (*remap)(void *tlb, unsigned long nslabs))
@@ -374,7 +392,7 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 
 	swiotlb_init_io_tlb_pool(mem, __pa(tlb), nslabs, false,
 				 default_nareas);
-	io_tlb_default_mem.nslabs = nslabs;
+	add_mem_pool(&io_tlb_default_mem, mem);
 
 	if (flags & SWIOTLB_VERBOSE)
 		swiotlb_print_info();
@@ -466,7 +484,7 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 			     (nslabs << IO_TLB_SHIFT) >> PAGE_SHIFT);
 	swiotlb_init_io_tlb_pool(mem, virt_to_phys(vstart), nslabs, true,
 				 nareas);
-	io_tlb_default_mem.nslabs = nslabs;
+	add_mem_pool(&io_tlb_default_mem, mem);
 
 	swiotlb_print_info();
 	return 0;
@@ -615,44 +633,83 @@ static void swiotlb_free_tlb(void *vaddr, size_t bytes)
 /**
  * swiotlb_alloc_pool() - allocate a new IO TLB memory pool
  * @dev:	Device for which a memory pool is allocated.
- * @nslabs:	Desired number of slabs.
+ * @minslabs:	Minimum number of slabs.
+ * @nslabs:	Desired (maximum) number of slabs.
+ * @nareas:	Number of areas.
  * @phys_limit:	Maximum DMA buffer physical address.
  * @gfp:	GFP flags for the allocations.
  *
- * Allocate and initialize a new IO TLB memory pool.
+ * Allocate and initialize a new IO TLB memory pool. The actual number of
+ * slabs may be reduced if allocation of @nslabs fails. If even
+ * @minslabs cannot be allocated, this function fails.
  *
  * Return: New memory pool, or %NULL on allocation failure.
  */
 static struct io_tlb_pool *swiotlb_alloc_pool(struct device *dev,
-		unsigned int nslabs, u64 phys_limit, gfp_t gfp)
+		unsigned long minslabs, unsigned long nslabs,
+		unsigned int nareas, u64 phys_limit, gfp_t gfp)
 {
 	struct io_tlb_pool *pool;
+	unsigned int slot_order;
 	struct page *tlb;
 	size_t pool_size;
 	size_t tlb_size;
 
-	pool_size = sizeof(*pool) + array_size(sizeof(*pool->areas), 1) +
-		array_size(sizeof(*pool->slots), nslabs);
+	pool_size = sizeof(*pool) + array_size(sizeof(*pool->areas), nareas);
 	pool = kzalloc(pool_size, gfp);
 	if (!pool)
 		goto error;
 	pool->areas = (void *)pool + sizeof(*pool);
-	pool->slots = (void *)pool->areas + sizeof(*pool->areas);
 
 	tlb_size = nslabs << IO_TLB_SHIFT;
-	tlb = swiotlb_alloc_tlb(dev, tlb_size, phys_limit, gfp);
-	if (!tlb)
-		goto error_tlb;
+	while (!(tlb = swiotlb_alloc_tlb(dev, tlb_size, phys_limit, gfp))) {
+		if (nslabs <= minslabs)
+			goto error_tlb;
+		nslabs = ALIGN(nslabs >> 1, IO_TLB_SEGSIZE);
+		nareas = limit_nareas(nareas, nslabs);
+		tlb_size = nslabs << IO_TLB_SHIFT;
+	}
+
+	slot_order = get_order(array_size(sizeof(*pool->slots), nslabs));
+	pool->slots = (struct io_tlb_slot *)
+		__get_free_pages(gfp, slot_order);
+	if (!pool->slots)
+		goto error_slots;
 
-	swiotlb_init_io_tlb_pool(pool, page_to_phys(tlb), nslabs, true, 1);
+	swiotlb_init_io_tlb_pool(pool, page_to_phys(tlb), nslabs, true, nareas);
 	return pool;
 
+error_slots:
+	swiotlb_free_tlb(page_address(tlb), tlb_size);
 error_tlb:
 	kfree(pool);
 error:
 	return NULL;
 }
 
+/**
+ * swiotlb_dyn_alloc() - dynamic memory pool allocation worker
+ * @work:	Pointer to dyn_alloc in struct io_tlb_mem.
+ */
+static void swiotlb_dyn_alloc(struct work_struct *work)
+{
+	struct io_tlb_mem *mem =
+		container_of(work, struct io_tlb_mem, dyn_alloc);
+	struct io_tlb_pool *pool;
+
+	pool = swiotlb_alloc_pool(NULL, IO_TLB_MIN_SLABS, default_nslabs,
+				  default_nareas, mem->phys_limit, GFP_KERNEL);
+	if (!pool) {
+		pr_warn_ratelimited("Failed to allocate new pool");
+		return;
+	}
+
+	add_mem_pool(mem, pool);
+
+	/* Pairs with smp_rmb() in swiotlb_find_pool(). */
+	smp_wmb();
+}
+
 /**
  * swiotlb_dyn_free() - RCU callback to free a memory pool
  * @rcu:	RCU head in the corresponding struct io_tlb_pool.
@@ -660,8 +717,10 @@ static struct io_tlb_pool *swiotlb_alloc_pool(struct device *dev,
 static void swiotlb_dyn_free(struct rcu_head *rcu)
 {
 	struct io_tlb_pool *pool = container_of(rcu, struct io_tlb_pool, rcu);
+	size_t slots_size = array_size(sizeof(*pool->slots), pool->nslabs);
 	size_t tlb_size = pool->end - pool->start;
 
+	free_pages((unsigned long)pool->slots, get_order(slots_size));
 	swiotlb_free_tlb(pool->vaddr, tlb_size);
 	kfree(pool);
 }
@@ -690,15 +749,19 @@ void swiotlb_dev_init(struct device *dev)
 struct io_tlb_pool *swiotlb_find_pool(struct device *dev, phys_addr_t paddr)
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
-	struct io_tlb_pool *pool = mem->pool;
-
-	if (paddr >= pool->start && paddr < pool->end)
-		return pool;
+	struct io_tlb_pool *pool;
 
-	/* Pairs with smp_wmb() in swiotlb_find_slots(). */
+	/* Pairs with smp_wmb() in swiotlb_find_slots() and
+	 * swiotlb_dyn_alloc(), which modify the RCU lists.
+	 */
 	smp_rmb();
 
 	rcu_read_lock();
+	list_for_each_entry_rcu(pool, &mem->pools, node) {
+		if (paddr >= pool->start && paddr < pool->end)
+			goto out;
+	}
+
 	list_for_each_entry_rcu(pool, &dev->dma_io_tlb_pools, node) {
 		if (paddr >= pool->start && paddr < pool->end)
 			goto out;
@@ -1030,18 +1093,25 @@ static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
 	u64 phys_limit;
 	int index;
 
-	pool = mem->pool;
-	index = pool_find_slots(dev, pool, orig_addr,
-				alloc_size, alloc_align_mask);
-	if (index >= 0)
-		goto found;
+	rcu_read_lock();
+	list_for_each_entry_rcu(pool, &mem->pools, node) {
+		index = pool_find_slots(dev, pool, orig_addr,
+					alloc_size, alloc_align_mask);
+		if (index >= 0) {
+			rcu_read_unlock();
+			goto found;
+		}
+	}
+	rcu_read_unlock();
 
 	if (!dev->dma_io_tlb_mem->can_grow)
 		return -1;
 
+	schedule_work(&mem->dyn_alloc);
+
 	nslabs = nr_slots(alloc_size);
 	phys_limit = min_not_zero(*dev->dma_mask, dev->bus_dma_limit);
-	pool = swiotlb_alloc_pool(dev, nslabs, phys_limit,
+	pool = swiotlb_alloc_pool(dev, nslabs, nslabs, 1, phys_limit,
 				  GFP_NOWAIT | __GFP_NOWARN);
 	if (!pool)
 		return -1;
@@ -1112,7 +1182,15 @@ static unsigned long mem_pool_used(struct io_tlb_pool *pool)
  */
 static unsigned long mem_used(struct io_tlb_mem *mem)
 {
-	return mem_pool_used(mem->pool);
+	struct io_tlb_pool *pool;
+	unsigned long used = 0;
+
+	rcu_read_lock();
+	list_for_each_entry_rcu(pool, &mem->pools, node)
+		used += mem_pool_used(pool);
+	rcu_read_unlock();
+
+	return used;
 }
 
 #endif /* CONFIG_DEBUG_FS */
@@ -1500,8 +1578,8 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem,
 		mem->force_bounce = true;
 		mem->for_alloc = true;
 		mem->can_grow = false;
-		mem->pool = pool;
-		mem->nslabs = nslabs;
+		spin_lock_init(&mem->lock);
+		add_mem_pool(mem, pool);
 
 		rmem->priv = mem;
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 13 15:35:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 15:35:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563295.880451 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyLM-0000w7-Cp; Thu, 13 Jul 2023 15:35:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563295.880451; Thu, 13 Jul 2023 15:35:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyLM-0000w0-AA; Thu, 13 Jul 2023 15:35:00 +0000
Received: by outflank-mailman (input) for mailman id 563295;
 Thu, 13 Jul 2023 15:31:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ojy9=C7=kernel.org=mripard@srs-se1.protection.inumbo.net>)
 id 1qJyHb-0000p0-H4
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 15:31:07 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 457e2d6b-2192-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 17:31:01 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 63BC76191F;
 Thu, 13 Jul 2023 15:31:00 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69C7EC433C8;
 Thu, 13 Jul 2023 15:30:58 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 457e2d6b-2192-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689262259;
	bh=uzhsJbzCPqmtv9Iva7enj3ZHEuzsA/mgnEXkOaQhU9Y=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=apAUusekBfUIkmKmEO/VS8T9qHdqUnkE+vHBuwh7V6I5QcyPpYmgxp1ahQXAI5PYX
	 Q205Dc8ZiTML6NoPvDwStBJdVecictHdGlX6sR8d1yIInCRjby34A2LvHQw5pxENsQ
	 1wqp0rrEzF/BTmElQJW3al1svso7EF4o44ATGXZhxb+TPq8S8yAKu5zqWlAuIBRb5B
	 czCx5x8gAWYnhrDGlBoqImAOuEkIxSg1sW8eWzrENJp0ZpX/Ea+J76nQC36ce987vw
	 FRACS4R5ZawYDdX2diVtgrWZ7hU7ITXQ2m15GlNNkcy4iK52jTnnHWSzOrigCzUwUj
	 hi6Doo/CMqFLg==
Date: Thu, 13 Jul 2023 17:30:56 +0200
From: Maxime Ripard <mripard@kernel.org>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>, 
	Sean Paul <seanpaul@chromium.org>, 
	Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, Jani Nikula <jani.nikula@intel.com>, 
	Heiko =?utf-8?Q?St=C3=BCbner?= <heiko@sntech.de>, Geert Uytterhoeven <geert+renesas@glider.be>, 
	Xinliang Liu <xinliang.liu@linaro.org>, Linus Walleij <linus.walleij@linaro.org>, 
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>, Alexey Kodanev <aleksei.kodanev@bell-sw.com>, 
	dri-devel@lists.freedesktop.org, Vandita Kulkarni <vandita.kulkarni@intel.com>, 
	Alim Akhtar <alim.akhtar@samsung.com>, Anitha Chrisanthus <anitha.chrisanthus@intel.com>, 
	Marijn Suijten <marijn.suijten@somainline.org>, Jonathan Hunter <jonathanh@nvidia.com>, 
	Arun R Murthy <arun.r.murthy@intel.com>, Jerome Brunet <jbrunet@baylibre.com>, 
	Liu Shixin <liushixin2@huawei.com>, linux-samsung-soc@vger.kernel.org, 
	Samuel Holland <samuel@sholland.org>, Matt Roper <matthew.d.roper@intel.com>, 
	Wenjing Liu <wenjing.liu@amd.com>, Javier Martinez Canillas <javierm@redhat.com>, 
	Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>, Danilo Krummrich <dakr@redhat.com>, 
	NXP Linux Team <linux-imx@nxp.com>, spice-devel@lists.freedesktop.org, 
	Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>, linux-sunxi@lists.linux.dev, Stylon Wang <stylon.wang@amd.com>, 
	Tim Huang <Tim.Huang@amd.com>, Suraj Kandpal <suraj.kandpal@intel.com>, 
	=?utf-8?B?QW5kcsOp?= Almeida <andrealmeid@igalia.com>, Andi Shyti <andi.shyti@linux.intel.com>, 
	Yifan Zhang <yifan1.zhang@amd.com>, Leo Li <sunpeng.li@amd.com>, 
	Sascha Hauer <s.hauer@pengutronix.de>, Lucas De Marchi <lucas.demarchi@intel.com>, 
	Inki Dae <inki.dae@samsung.com>, Hersen Wu <hersenxs.wu@amd.com>, 
	Jessica Zhang <quic_jesszhan@quicinc.com>, Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>, 
	Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>, =?utf-8?Q?=C5=81ukasz?= Bartosik <lb@semihalf.com>, 
	Radhakrishna Sripada <radhakrishna.sripada@intel.com>, Andrew Jeffery <andrew@aj.id.au>, 
	Seung-Woo Kim <sw0312.kim@samsung.com>, Noralf =?utf-8?Q?Tr=C3=B8nnes?= <noralf@tronnes.org>, 
	kernel@pengutronix.de, Alex Deucher <alexander.deucher@amd.com>, 
	freedreno@lists.freedesktop.org, Claudiu Beznea <claudiu.beznea@microchip.com>, 
	Zack Rusin <zackr@vmware.com>, Gerd Hoffmann <kraxel@redhat.com>, 
	Alexandre Belloni <alexandre.belloni@bootlin.com>, linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org, 
	Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>, =?utf-8?B?Sm9zw6k=?= Roberto de Souza <jose.souza@intel.com>, 
	virtualization@lists.linux-foundation.org, Thierry Reding <thierry.reding@gmail.com>, 
	Yongqin Liu <yongqin.liu@linaro.org>, Mario Limonciello <mario.limonciello@amd.com>, 
	Fei Yang <fei.yang@intel.com>, Ville =?utf-8?B?U3lyasOkbMOk?= <ville.syrjala@linux.intel.com>, 
	David Lechner <david@lechnology.com>, Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>, 
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>, David Francis <David.Francis@amd.com>, 
	Aaron Liu <aaron.liu@amd.com>, Patrik Jakobsson <patrik.r.jakobsson@gmail.com>, 
	Vinod Polimera <quic_vpolimer@quicinc.com>, linux-rockchip@lists.infradead.org, 
	Fangzhi Zuo <jerry.zuo@amd.com>, Aurabindo Pillai <aurabindo.pillai@amd.com>, 
	VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>, Ben Skeggs <bskeggs@redhat.com>, 
	Jouni =?utf-8?B?SMO2Z2FuZGVy?= <jouni.hogander@intel.com>, Dave Airlie <airlied@redhat.com>, linux-mips@vger.kernel.org, 
	Gurchetan Singh <gurchetansingh@chromium.org>, Martin Blumenstingl <martin.blumenstingl@googlemail.com>, 
	linux-arm-msm@vger.kernel.org, Animesh Manna <animesh.manna@intel.com>, 
	linux-renesas-soc@vger.kernel.org, Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>, 
	Philipp Zabel <p.zabel@pengutronix.de>, linux-amlogic@lists.infradead.org, Evan Quan <evan.quan@amd.com>, 
	Michal Simek <michal.simek@amd.com>, linux-arm-kernel@lists.infradead.org, 
	Sean Paul <sean@poorly.run>, Neil Armstrong <neil.armstrong@linaro.org>, 
	Kai Vehmanen <kai.vehmanen@linux.intel.com>, Boris Brezillon <bbrezillon@kernel.org>, 
	Chunyan Zhang <zhang.lyra@gmail.com>, Qingqing Zhuo <qingqing.zhuo@amd.com>, 
	Sandy Huang <hjc@rock-chips.com>, Swati Sharma <swati2.sharma@intel.com>, 
	John Stultz <jstultz@google.com>, Paul Kocialkowski <paul.kocialkowski@bootlin.com>, 
	Kyungmin Park <kyungmin.park@samsung.com>, Drew Davenport <ddavenport@chromium.org>, 
	Kevin Hilman <khilman@baylibre.com>, Hawking Zhang <Hawking.Zhang@amd.com>, 
	Haneen Mohammed <hamohammed.sa@gmail.com>, Anusha Srivatsa <anusha.srivatsa@intel.com>, 
	Dan Carpenter <error27@gmail.com>, Karol Herbst <kherbst@redhat.com>, 
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, linux-hyperv@vger.kernel.org, Stefan Agner <stefan@agner.ch>, 
	Melissa Wen <melissa.srw@gmail.com>, =?utf-8?B?TWHDrXJh?= Canal <mairacanal@riseup.net>, 
	Luca Coelho <luciano.coelho@intel.com>, Laurent Pinchart <laurent.pinchart@ideasonboard.com>, 
	Andrzej Hajda <andrzej.hajda@intel.com>, Likun Gao <Likun.Gao@amd.com>, Sam Ravnborg <sam@ravnborg.org>, 
	Alain Volmat <alain.volmat@foss.st.com>, Xinwei Kong <kong.kongxinwei@hisilicon.com>, 
	Jernej Skrabec <jernej.skrabec@gmail.com>, Deepak Rawat <drawat.floss@gmail.com>, 
	Chen-Yu Tsai <wens@csie.org>, Joel Stanley <joel@jms.id.au>, 
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>, Harry Wentland <harry.wentland@amd.com>, 
	Sumit Semwal <sumit.semwal@linaro.org>, Alan Liu <haoping.liu@amd.com>, 
	Philip Yang <Philip.Yang@amd.com>, Lyude Paul <lyude@redhat.com>, intel-gfx@lists.freedesktop.org, 
	Alison Wang <alison.wang@nxp.com>, Wolfram Sang <wsa+renesas@sang-engineering.com>, 
	Abhinav Kumar <quic_abhinavk@quicinc.com>, Gustavo Sousa <gustavo.sousa@intel.com>, 
	Baolin Wang <baolin.wang@linux.alibaba.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>, 
	Mikko Perttunen <mperttunen@nvidia.com>, Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>, 
	Tomi Valkeinen <tomba@kernel.org>, Deepak R Varma <drv@mailo.com>, 
	"Pan, Xinhui" <Xinhui.Pan@amd.com>, Biju Das <biju.das.jz@bp.renesas.com>, 
	Chia-I Wu <olvaffe@gmail.com>, Konrad Dybcio <konrad.dybcio@linaro.org>, 
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>, Tian Tao <tiantao6@hisilicon.com>, 
	Shawn Guo <shawnguo@kernel.org>, Christian =?utf-8?B?S8O2bmln?= <christian.koenig@amd.com>, 
	Khaled Almahallawy <khaled.almahallawy@intel.com>, linux-stm32@st-md-mailman.stormreply.com, 
	Emma Anholt <emma@anholt.net>, Chun-Kuang Hu <chunkuang.hu@kernel.org>, 
	Imre Deak <imre.deak@intel.com>, Liviu Dudau <liviu.dudau@arm.com>, 
	Alexandre Torgue <alexandre.torgue@foss.st.com>, Roman Li <roman.li@amd.com>, 
	Paul Cercueil <paul@crapouillou.net>, Rob Clark <robdclark@gmail.com>, 
	Hamza Mahfooz <hamza.mahfooz@amd.com>, David Airlie <airlied@gmail.com>, Marek Vasut <marex@denx.de>, 
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, xen-devel@lists.xenproject.org, 
	Guchun Chen <guchun.chen@amd.com>, Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>, Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>, 
	Russell King <linux@armlinux.org.uk>, Uma Shankar <uma.shankar@intel.com>, 
	Mika Kahola <mika.kahola@intel.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, 
	Jiasheng Jiang <jiasheng@iscas.ac.cn>, Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>, 
	Vinod Govindapillai <vinod.govindapillai@intel.com>, linux-tegra@vger.kernel.org, 
	Marek =?utf-8?B?T2zFocOhaw==?= <marek.olsak@amd.com>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
	=?utf-8?Q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= <samsagax@gmail.com>, Melissa Wen <mwen@igalia.com>, 
	Hans de Goede <hdegoede@redhat.com>, linux-mediatek@lists.infradead.org, 
	Fabio Estevam <festevam@gmail.com>, Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>, 
	Matthias Brugger <matthias.bgg@gmail.com>, David Tadokoro <davidbtadokoro@usp.br>, 
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Orson Zhai <orsonzhai@gmail.com>, amd-gfx@lists.freedesktop.org, 
	Jyri Sarha <jyri.sarha@iki.fi>, Yannick Fertre <yannick.fertre@foss.st.com>, 
	Nicolas Ferre <nicolas.ferre@microchip.com>, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, 
	Philippe Cornu <philippe.cornu@foss.st.com>, Daniel Vetter <daniel@ffwll.ch>, Wayne Lin <Wayne.Lin@amd.com>, 
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, Nirmoy Das <nirmoy.das@intel.com>, Lang Yu <Lang.Yu@amd.com>, 
	Lucas Stach <l.stach@pengutronix.de>
Subject: Re: [Freedreno] [PATCH RFC v1 00/52] drm/crtc: Rename struct
 drm_crtc::dev to drm_dev
Message-ID: <hoaz447ghc2vypjo7peknac35vzkgsaikp7ctehk3yhgopnweh@gzwzthsp2fnr>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com>
 <CAOw6vbLO_UaXDbTCtAQJgthXOUMPqEV+c2MQhP-1DuK44OhGxw@mail.gmail.com>
 <20230713130337.fd2l67r23g2irifx@pengutronix.de>
 <CAOw6vbKtjyUm+OqO7LSV1hDOMQATwkEWP4GzBbbXib0i5EviUQ@mail.gmail.com>
 <78be52b8-5ffb-601a-84b2-ead2894973a6@suse.de>
 <d6160aeb-6344-b272-775a-cb665dca46ac@linux.intel.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="yql6uuzpsgfxjltx"
Content-Disposition: inline
In-Reply-To: <d6160aeb-6344-b272-775a-cb665dca46ac@linux.intel.com>


--yql6uuzpsgfxjltx
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 13, 2023 at 04:14:55PM +0100, Tvrtko Ursulin wrote:
>=20
> On 13/07/2023 16:09, Thomas Zimmermann wrote:
> > Hi
> >=20
> > Am 13.07.23 um 16:41 schrieb Sean Paul:
> > > On Thu, Jul 13, 2023 at 9:04=E2=80=AFAM Uwe Kleine-K=C3=B6nig
> > > <u.kleine-koenig@pengutronix.de> wrote:
> > > >=20
> > > > hello Sean,
> > > >=20
> > > > On Wed, Jul 12, 2023 at 02:31:02PM -0400, Sean Paul wrote:
> > > > > I'd really prefer this patch (series or single) is not accepted. =
This
> > > > > will cause problems for everyone cherry-picking patches to a
> > > > > downstream kernel (LTS or distro tree). I usually wouldn't expect
> > > > > sympathy here, but the questionable benefit does not outweigh the=
 cost
> > > > > IM[biased]O.
> > > >=20
> > > > I agree that for backports this isn't so nice. However with the spl=
it
> > > > approach (that was argumented against here) it's not soo bad. Patch=
 #1
> > > > (and similar changes for the other affected structures) could be
> > > > trivially backported and with that it doesn't matter if you write d=
ev or
> > > > drm (or whatever name is chosen in the end); both work in the same =
way.
> > >=20
> > > Patch #1 avoids the need to backport the entire set, however every
> > > change occuring after the rename patches will cause conflicts on
> > > future cherry-picks. Downstream kernels will have to backport the
> > > whole set. Backporting the entire set will create an epoch in
> > > downstream kernels where cherry-picking patches preceding this set
> > > will need to undergo conflict resolution as well. As mentioned in my
> > > previous email, I don't expect sympathy here, it's part of maintaining
> > > a downstream kernel, but there is a real cost to kernel consumers.
> > >=20
> > > >=20
> > > > But even with the one-patch-per-rename approach I'd consider the
> > > > renaming a net win, because ease of understanding code has a big va=
lue.
> > > > It's value is not so easy measurable as "conflicts when backporting=
",
> > > > but it also matters in say two years from now, while backporting
> > > > shouldn't be an issue then any more.
> > >=20
> > > You've rightly identified the conjecture in your statement. I've been
> > > on both sides of the argument, having written/maintained drm code
> > > upstream and cherry-picked changes to a downstream kernel. Perhaps
> > > it's because drm's definition of dev is ingrained in my muscle memory,
> > > or maybe it's because I don't do a lot of upstream development these
> > > days, but I just have a hard time seeing the benefit here.
> >=20
> > I can only second what Sean writes. I've done quite a bit of backporting
> > of DRM code. It's hard already. And this kind of change is going to to
> > affect almost every backported DRM patch in the coming years. Not just
> > for distribution kernels, but also for upstream's stable series. It's
> > really only possible to do this change over many releases while keeping
> > compatible with the old name. So the more I think about it, the less I
> > like this change.
>=20
> I've done my share of backporting, and still am doing it, so I can say I
> dislike it as much as anyone, however.. Is this an argument which the ker=
nel
> as a wider entity typically accepts? If not could it be a slippery slope =
to
> start a precedent?
>=20
> It is a honest question - I am not familiar if there were or were not any
> similar discussions in the past.

Eventually, it's a trade-off. There's always pros and cons to merging
every patch, and "backporting pains" is indeed not a very strong con.

But it's definitely the kind of patch where everyone and their mother
will have their opinion, without every reaching a clear consensus, and
there's no clear benefit either (but I might be biaised on that one).

So imo, while that downside is fairly weak, the pros are certainly
weaker.

> My gut feeling is that *if* there is a consensus that something _improves_
> the code base significantly, backporting pains should probably not be
> weighted very heavily as a contra argument.

100% agreed here, but I'm afraid we're far from that point.

Maxime

--yql6uuzpsgfxjltx
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZLAYrwAKCRDj7w1vZxhR
xf8DAQCNcz/JSq5Uj/12GtaqEjBVAYLY5aL9Nnxgat9AIjRbRgD/fdm86CWCaQ2V
rEH5Fl9T7PgR6UnZbbxrlm+UvQdqrwE=
=3Ea3
-----END PGP SIGNATURE-----

--yql6uuzpsgfxjltx--


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 15:35:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 15:35:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563300.880462 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyLb-0001FK-Ps; Thu, 13 Jul 2023 15:35:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563300.880462; Thu, 13 Jul 2023 15:35:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyLb-0001FD-MI; Thu, 13 Jul 2023 15:35:15 +0000
Received: by outflank-mailman (input) for mailman id 563300;
 Thu, 13 Jul 2023 15:35:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=LNpG=C7=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qJyLa-0000uP-6Z
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 15:35:14 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id daddfdef-2192-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 17:35:12 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36DFYsHe097067
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Thu, 13 Jul 2023 11:34:59 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36DFYqdM097066;
 Thu, 13 Jul 2023 08:34:52 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: daddfdef-2192-11ee-b239-6b7b168915f2
Date: Thu, 13 Jul 2023 08:34:52 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
        Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
        Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 0/3] Fixing ACPI error reporting display
Message-ID: <ZLAZnHUo8P2wccxD@mattapan.m5p.com>
References: <cover.1689191941.git.ehem+xen@m5p.com>
 <47f21cdf-5aa3-5f19-b967-6b217890e706@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <47f21cdf-5aa3-5f19-b967-6b217890e706@suse.com>
X-Spam-Status: No, score=0.4 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

On Thu, Jul 13, 2023 at 10:38:37AM +0200, Jan Beulich wrote:
> On 12.07.2023 21:59, Elliott Mitchell wrote:
> > This series has been seen previously.  The issue is pretty simple, if
> > ACPI errors occur there is a high probability they will occur on multiple
> > cores at once.
> 
> Nit: Both here and in the title s/ACPI/APIC/, to not misguide people about
> the area the series touches (just in case a v4 might be needed).

Uh, yeah.  Wonder how that got missed.  Seems like the time for a
Simpson's "doh!"  Also in patch #2 there is "APIC errors".

It would be correct if English words had the transitivity property.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Thu Jul 13 15:45:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 15:45:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563309.880472 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyV9-00035z-QH; Thu, 13 Jul 2023 15:45:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563309.880472; Thu, 13 Jul 2023 15:45:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyV9-00035s-NZ; Thu, 13 Jul 2023 15:45:07 +0000
Received: by outflank-mailman (input) for mailman id 563309;
 Thu, 13 Jul 2023 15:41:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=MlyT=C7=pengutronix.de=ukl@srs-se1.protection.inumbo.net>)
 id 1qJyRt-00032A-Jk
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 15:41:45 +0000
Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de
 [2001:67c:670:201:290:27ff:fe1d:cc33])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c4d52c67-2193-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 17:41:44 +0200 (CEST)
Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2])
 by metis.ext.pengutronix.de with esmtps
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJyQC-00033b-T0; Thu, 13 Jul 2023 17:40:00 +0200
Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de)
 by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJyPp-00E9Ib-Gt; Thu, 13 Jul 2023 17:39:37 +0200
Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2)
 (envelope-from <ukl@pengutronix.de>)
 id 1qJyPo-004aZX-PQ; Thu, 13 Jul 2023 17:39:36 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c4d52c67-2193-11ee-b239-6b7b168915f2
Date: Thu, 13 Jul 2023 17:39:36 +0200
From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
To: Sean Paul <seanpaul@chromium.org>
Cc: Heiko =?utf-8?Q?St=C3=BCbner?= <heiko@sntech.de>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
	dri-devel@lists.freedesktop.org,
	Vandita Kulkarni <vandita.kulkarni@intel.com>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Arun R Murthy <arun.r.murthy@intel.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	linux-samsung-soc@vger.kernel.org,
	Samuel Holland <samuel@sholland.org>,
	Matt Roper <matthew.d.roper@intel.com>,
	Wenjing Liu <wenjing.liu@amd.com>,
	Javier Martinez Canillas <javierm@redhat.com>,
	Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
	Danilo Krummrich <dakr@redhat.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	spice-devel@lists.freedesktop.org,
	Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	linux-sunxi@lists.linux.dev,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Stylon Wang <stylon.wang@amd.com>, Tim Huang <Tim.Huang@amd.com>,
	Suraj Kandpal <suraj.kandpal@intel.com>,
	=?utf-8?B?QW5kcsOp?= Almeida <andrealmeid@igalia.com>,
	Mika Kahola <mika.kahola@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Leo Li <sunpeng.li@amd.com>, Sascha Hauer <s.hauer@pengutronix.de>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	Inki Dae <inki.dae@samsung.com>, Hersen Wu <hersenxs.wu@amd.com>,
	Dave Airlie <airlied@redhat.com>,
	Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
	Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
	=?utf-8?Q?=C5=81ukasz?= Bartosik <lb@semihalf.com>,
	Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
	Andrew Jeffery <andrew@aj.id.au>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Noralf =?utf-8?Q?Tr=C3=B8nnes?= <noralf@tronnes.org>,
	kernel@pengutronix.de, Alex Deucher <alexander.deucher@amd.com>,
	freedreno@lists.freedesktop.org,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	Zack Rusin <zackr@vmware.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org,
	Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
	=?utf-8?B?Sm9zw6k=?= Roberto de Souza <jose.souza@intel.com>,
	virtualization@lists.linux-foundation.org,
	Thierry Reding <thierry.reding@gmail.com>,
	Yongqin Liu <yongqin.liu@linaro.org>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Fei Yang <fei.yang@intel.com>,
	Ville =?utf-8?B?U3lyasOkbMOk?= <ville.syrjala@linux.intel.com>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	David Francis <David.Francis@amd.com>,
	Vinod Govindapillai <vinod.govindapillai@intel.com>,
	Aaron Liu <aaron.liu@amd.com>,
	Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
	Vinod Polimera <quic_vpolimer@quicinc.com>,
	linux-rockchip@lists.infradead.org, Fangzhi Zuo <jerry.zuo@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
	Ben Skeggs <bskeggs@redhat.com>,
	Jouni =?utf-8?B?SMO2Z2FuZGVy?= <jouni.hogander@intel.com>,
	Jessica Zhang <quic_jesszhan@quicinc.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-arm-msm@vger.kernel.org,
	Animesh Manna <animesh.manna@intel.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Maxime Ripard <mripard@kernel.org>,
	Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
	Tian Tao <tiantao6@hisilicon.com>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	linux-amlogic@lists.infradead.org, Evan Quan <evan.quan@amd.com>,
	Michal Simek <michal.simek@amd.com>,
	linux-arm-kernel@lists.infradead.org, Sean Paul <sean@poorly.run>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Qingqing Zhuo <qingqing.zhuo@amd.com>,
	Sandy Huang <hjc@rock-chips.com>,
	Swati Sharma <swati2.sharma@intel.com>,
	linux-renesas-soc@vger.kernel.org,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>,
	Haneen Mohammed <hamohammed.sa@gmail.com>,
	Paul Cercueil <paul@crapouillou.net>,
	Anusha Srivatsa <anusha.srivatsa@intel.com>,
	Dan Carpenter <error27@gmail.com>,
	Karol Herbst <kherbst@redhat.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	linux-hyperv@vger.kernel.org, Stefan Agner <stefan@agner.ch>,
	Melissa Wen <melissa.srw@gmail.com>,
	=?utf-8?B?TWHDrXJh?= Canal <mairacanal@riseup.net>,
	Luca Coelho <luciano.coelho@intel.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Likun Gao <Likun.Gao@amd.com>,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
	Emma Anholt <emma@anholt.net>,
	Alain Volmat <alain.volmat@foss.st.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Deepak Rawat <drawat.floss@gmail.com>,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	Joel Stanley <joel@jms.id.au>, Orson Zhai <orsonzhai@gmail.com>,
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
	Harry Wentland <harry.wentland@amd.com>,
	Chia-I Wu <olvaffe@gmail.com>, Alan Liu <haoping.liu@amd.com>,
	Philip Yang <Philip.Yang@amd.com>, Lyude Paul <lyude@redhat.com>,
	intel-gfx@lists.freedesktop.org, Alison Wang <alison.wang@nxp.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Gustavo Sousa <gustavo.sousa@intel.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	Mikko Perttunen <mperttunen@nvidia.com>,
	Yifan Zhang <yifan1.zhang@amd.com>,
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
	Tomi Valkeinen <tomba@kernel.org>, Deepak R Varma <drv@mailo.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	John Stultz <jstultz@google.com>, Roman Li <roman.li@amd.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Christian =?utf-8?B?S8O2bmln?= <christian.koenig@amd.com>,
	Khaled Almahallawy <khaled.almahallawy@intel.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	Sam Ravnborg <sam@ravnborg.org>,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Imre Deak <imre.deak@intel.com>, Liviu Dudau <liviu.dudau@arm.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Gurchetan Singh <gurchetansingh@chromium.org>,
	Liu Shixin <liushixin2@huawei.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Hamza Mahfooz <hamza.mahfooz@amd.com>,
	David Airlie <airlied@gmail.com>, Marek Vasut <marex@denx.de>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Lang Yu <Lang.Yu@amd.com>, xen-devel@lists.xenproject.org,
	Guchun Chen <guchun.chen@amd.com>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
	Russell King <linux@armlinux.org.uk>,
	Jani Nikula <jani.nikula@intel.com>,
	Uma Shankar <uma.shankar@intel.com>,
	Andi Shyti <andi.shyti@linux.intel.com>,
	Jiasheng Jiang <jiasheng@iscas.ac.cn>,
	Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
	David Lechner <david@lechnology.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Marek =?utf-8?B?T2zFocOhaw==?= <marek.olsak@amd.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	=?utf-8?Q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= <samsagax@gmail.com>,
	Melissa Wen <mwen@igalia.com>, Hans de Goede <hdegoede@redhat.com>,
	linux-mediatek@lists.infradead.org,
	Fabio Estevam <festevam@gmail.com>,
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	linux-tegra@vger.kernel.org, David Tadokoro <davidbtadokoro@usp.br>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
	amd-gfx@lists.freedesktop.org,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Yannick Fertre <yannick.fertre@foss.st.com>,
	linux-mips@vger.kernel.org, Rob Clark <robdclark@gmail.com>,
	Philippe Cornu <philippe.cornu@foss.st.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Wayne Lin <Wayne.Lin@amd.com>,
	Drew Davenport <ddavenport@chromium.org>,
	Nirmoy Das <nirmoy.das@intel.com>, Jyri Sarha <jyri.sarha@iki.fi>,
	Lucas Stach <l.stach@pengutronix.de>
Subject: Re: [Freedreno] [PATCH RFC v1 00/52] drm/crtc: Rename struct
 drm_crtc::dev to drm_dev
Message-ID: <20230713153936.k2m6aj34vptj5vf7@pengutronix.de>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com>
 <CAOw6vbLO_UaXDbTCtAQJgthXOUMPqEV+c2MQhP-1DuK44OhGxw@mail.gmail.com>
 <20230713130337.fd2l67r23g2irifx@pengutronix.de>
 <CAOw6vbKtjyUm+OqO7LSV1hDOMQATwkEWP4GzBbbXib0i5EviUQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="mnk65dkcvejfh2ja"
Content-Disposition: inline
In-Reply-To: <CAOw6vbKtjyUm+OqO7LSV1hDOMQATwkEWP4GzBbbXib0i5EviUQ@mail.gmail.com>
X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2
X-SA-Exim-Mail-From: ukl@pengutronix.de
X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false
X-PTX-Original-Recipient: xen-devel@lists.xenproject.org


--mnk65dkcvejfh2ja
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 13, 2023 at 10:41:45AM -0400, Sean Paul wrote:
> On Thu, Jul 13, 2023 at 9:04=E2=80=AFAM Uwe Kleine-K=C3=B6nig
> > But even with the one-patch-per-rename approach I'd consider the
> > renaming a net win, because ease of understanding code has a big value.
> > It's value is not so easy measurable as "conflicts when backporting",
> > but it also matters in say two years from now, while backporting
> > shouldn't be an issue then any more.
>=20
> You've rightly identified the conjecture in your statement. I've been
> on both sides of the argument, having written/maintained drm code
> upstream and cherry-picked changes to a downstream kernel. Perhaps
> it's because drm's definition of dev is ingrained in my muscle memory,
> or maybe it's because I don't do a lot of upstream development these
> days, but I just have a hard time seeing the benefit here.

I see that my change doesn't immediately benefit those who are already
at home in drivers/gpu/drm. So it's quite understandable that someone in
a senior role (long time contributor or maintainer) doesn't see a big
upside.

In contrast I think my change (with its indisputable cost) lowers the
bar for new contributors to drm. IMHO that's something a maintainer has
to have on their radar, too, and that's easily undervalued in my
experience.

Of course in the end it's about weighting the ups and downs.=20

Thanks
Uwe

--=20
Pengutronix e.K.                           | Uwe Kleine-K=C3=B6nig         =
   |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

--mnk65dkcvejfh2ja
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmSwGrcACgkQj4D7WH0S
/k5Z8gf+L2DppHWGxGaiKRiYvHQTrpom5T4lLxWIcMzNp/SZXGce+FkxNCXXp4ev
Fm4EE5lHyGkTfeMAeH8KSvtkAT3Lf/Bifz3Ij2fmsLRLCJdOxIA9Zra8u3cWmLdd
JX+wb8zFJARzb/u+kG6ZD4IgJ+39LqIZ9JLUqaV4jyZZps2Vf8cvPDNYp96vAwdB
GUECE+pPcMQvSkBdwy5pCGdEatjq9O12xWwv6uvNcJqbIbToJVVsUHLBjTGEJfGI
PgyrtoM72NQY/p5d9veqBKCQTkKUBW5Ly+HbKzey9Dy/IPWeSU1Q/1WH/hUphbbs
k0+Jh4Ot72m5BF8rwKgRu0NikQcP4A==
=OtIn
-----END PGP SIGNATURE-----

--mnk65dkcvejfh2ja--


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 16:12:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 16:12:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563316.880482 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyuw-00076G-Sc; Thu, 13 Jul 2023 16:11:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563316.880482; Thu, 13 Jul 2023 16:11:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyuw-000769-PS; Thu, 13 Jul 2023 16:11:46 +0000
Received: by outflank-mailman (input) for mailman id 563316;
 Thu, 13 Jul 2023 16:11:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eidt=C7=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qJyuu-000763-R1
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 16:11:44 +0000
Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com
 [2a00:1450:4864:20::12d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f560c542-2197-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 18:11:43 +0200 (CEST)
Received: by mail-lf1-x12d.google.com with SMTP id
 2adb3069b0e04-4f122ff663eso1600986e87.2
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 09:11:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f560c542-2197-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689264703; x=1691856703;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=HXyvRpUMWg4EI9ylPggQuxrJTaRonG7XdSB3edApzp4=;
        b=Qlv9PZFijkC/kT09RvKheT4rzhOZHzKdSJxitZqDlLxZrj+9OZgYVq37+PJQ8fPRtk
         +6QOatiaogdQ22w+U5Wq69Thxa6IXCsmL4nBpGlDEdTLx9dHoP3XjEsyX6MKsBTwBet6
         G60vqwlQpS4NxBImbyWpGxwBjqB/r//g+yIIVu8HYgt0aLel3G/BSs18Pionsq3pvRA1
         7LBynklb7SKFfvkGelJuR+SsDZZZw6XY2kO1s9U73vGdACDLsCpus7rqGCe9jL/Zy7bL
         TuPEirz4RiNbb0WxGobSEdEl4S2je4xT5Pxds+mahXz9SatdKcA0AUzXSnTKKkjzqDkF
         GmNw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689264703; x=1691856703;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=HXyvRpUMWg4EI9ylPggQuxrJTaRonG7XdSB3edApzp4=;
        b=Lb9d1OpoussYgue0XL+V8/ediVBK2q3mTG4wR1Bp693Etv5nl8aRe8reFIw0d1lp+W
         uHTXjd0vK5tjkATCQTOpzLkOREs8kpBXVRI9U+eUjeNUmmpNapLKnFNMVURfK3r550Y8
         eHPLyz3K5Dush0Oliea0Fsh9Qvzu+oNPKVpo0Onk+nal1LDWCHKtshzvFNiD3UPhQ0iu
         heryrpV+sOvG0rXLPY2skISuDXjV0v/IclWkydjXLAE0NICLHsaQIfFEUvWIhBKqoFn8
         BI1T5fW4olRDEYRpze2LqNQWJp1mN8MGO59eVJ/iaYoK4tq6jLFMY/8S2TUoS9Yzcih8
         w6Lg==
X-Gm-Message-State: ABy/qLZtfbCmcpERNso9ubFJee1duDgl5S7hrhlNyNqWHQrW07HrfUAh
	ozw9iz8eOnuALyjcmai8qC2pkx1QImzWi989dXE=
X-Google-Smtp-Source: APBJJlEQnjMO9FK8lr/Fr1WodDzuvU4oogfIbXoJpnKfzfDz2FDo447f0ZkSkrTv4AuLve3WZHUxLh2U+9Y9mEXyGO4=
X-Received: by 2002:ac2:5f0b:0:b0:4f9:5f62:830c with SMTP id
 11-20020ac25f0b000000b004f95f62830cmr1468027lfq.7.1689264702821; Thu, 13 Jul
 2023 09:11:42 -0700 (PDT)
MIME-Version: 1.0
References: <20230706185440.48333-1-jandryuk@gmail.com> <20230706185440.48333-10-jandryuk@gmail.com>
 <9e16348c-4b43-0ed3-fa53-b7bb69538437@suse.com>
In-Reply-To: <9e16348c-4b43-0ed3-fa53-b7bb69538437@suse.com>
From: Jason Andryuk <jandryuk@gmail.com>
Date: Thu, 13 Jul 2023 12:11:30 -0400
Message-ID: <CAKf6xpvkMV91mPL0B0bBuSHpYYjVFxFAz9kyZhDs7Q+L2pnGYw@mail.gmail.com>
Subject: Re: [PATCH v5 09/15] cpufreq: Export HWP parameters to userspace as CPPC
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Wei Liu <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>, 
	Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 13, 2023 at 8:37=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wro=
te:
>
> With the adjustments (provided you agree)
> Acked-by: Jan Beulich <jbeulich@suse.com>

Yes, they all sound good.  Thank you.

-Jason


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 16:12:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 16:12:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563320.880491 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyvW-0007ZH-4T; Thu, 13 Jul 2023 16:12:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563320.880491; Thu, 13 Jul 2023 16:12:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJyvW-0007ZA-1T; Thu, 13 Jul 2023 16:12:22 +0000
Received: by outflank-mailman (input) for mailman id 563320;
 Thu, 13 Jul 2023 16:12:20 +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
 <SRS0=eidt=C7=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qJyvU-0007Mt-Er
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 16:12:20 +0000
Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com
 [2a00:1450:4864:20::52b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0a36813f-2198-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 18:12:18 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-51ff068c09cso1133845a12.2
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 09:12:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0a36813f-2198-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689264738; x=1691856738;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Tl+CXOA5MwBHYy19kkJS/DmYOxvrAr/t/y+6LdRo2mc=;
        b=YjXmlkMCZ/TpiM0JpS0id9JN2kBRdqA76yvYuHqEY+FfH1YwnKOfP1nv3XIw2Ypk2r
         ZKZIqeDSfvQSzWOY55K5kpZ1T8jHtbC6DDKeo5EJ280W6unEV4fEVO6KdRt1RPn28fs2
         e8a+yXKoYXV6FSNJk8AsHMHbPBzv5RKvbjG/+ZuYl+AY5jsgRaSFq6LprAmwlbokSdev
         Rxgrq00+ihiwAjnERyFmXbt65LYx3df05fumWcHbOlauY4t9StZ+aPNn9tgBwGpD5Y7E
         RBahIWw8/bRc7us7+a/6mmMcgQ81nnJ+A6F42JFP1c3nvl7FryloCBwwVUu/3yUoYAk3
         TGLA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689264738; x=1691856738;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=Tl+CXOA5MwBHYy19kkJS/DmYOxvrAr/t/y+6LdRo2mc=;
        b=NGSIs61TCWSQKk43INrd4zVKvb1h+c8sHaqtY4rkUSuQe93ROG7bPDNLTThXqZK4Wa
         tdD91X8nZvfcnsCbgxLHacZTVdMVPEyATexdidywiqb1QwBOXAjCMT49xvFE1z9OmTWl
         dAZLeYzQnIwGDHaqMx5+MUP2b/a439/DeOhUpqIW/eA55AYp5TfoRtQ4x5lYFRV054mF
         1AT9++8kXJ2IiH2gv8MJp9A48Bk4zwF1Pfe4U8BHQOq+mxtzgLcNHp0S1EnHtbF+RuIE
         1KcjPgT8tfZIxlYAETv+ie86cXO/f8mG0ed5lL6kVZEkEKD1nNA4zlvnVDpjwo0Hvcds
         uCuA==
X-Gm-Message-State: ABy/qLaYBlW4RQu3kUmCXT3gHECjbIAPLdwczK7JQepjChBJ9yojY8jw
	mqG97VFrAmzOzCPWYn4rlfGDJ2lzJtCz7hXigjc=
X-Google-Smtp-Source: APBJJlHd7/LrjLbCTHc/nbjnQUA8OQtnrVuLCYrm0qPvgyrACn6PEy/UK0qKo+nIyAQLeJKQ4hN5VGHkE72LZl8hzO0=
X-Received: by 2002:aa7:c505:0:b0:51d:df5e:5674 with SMTP id
 o5-20020aa7c505000000b0051ddf5e5674mr2250366edq.1.1689264737785; Thu, 13 Jul
 2023 09:12:17 -0700 (PDT)
MIME-Version: 1.0
References: <20230706185440.48333-1-jandryuk@gmail.com> <20230706185440.48333-13-jandryuk@gmail.com>
 <e398f2f3-3c12-5bbd-5bfb-d3fac7c1b23a@suse.com>
In-Reply-To: <e398f2f3-3c12-5bbd-5bfb-d3fac7c1b23a@suse.com>
From: Jason Andryuk <jandryuk@gmail.com>
Date: Thu, 13 Jul 2023 12:12:05 -0400
Message-ID: <CAKf6xpsUD8NusOBzW-p1YwH6daok5TXkHrDD_JQcSL3n3St7Hg@mail.gmail.com>
Subject: Re: [PATCH v5 12/15] xen: Add SET_CPUFREQ_HWP xen_sysctl_pm_op
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Wei Liu <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>, 
	Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 13, 2023 at 9:02=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wro=
te:
>
> On 06.07.2023 20:54, Jason Andryuk wrote:
> > @@ -531,6 +535,103 @@ int get_hwp_para(unsigned int cpu,
> >      return 0;
> >  }
> >
> > +int set_hwp_para(struct cpufreq_policy *policy,
> > +                 struct xen_set_cppc_para *set_cppc)
> > +{
> > +    unsigned int cpu =3D policy->cpu;
> > +    struct hwp_drv_data *data =3D per_cpu(hwp_drv_data, cpu);
> > +    bool cleared_act_window =3D false;
> > +
> > +    if ( data =3D=3D NULL )
> > +        return -EINVAL;
>
> I don't think EINVAL is appropriate here. EOPNOTSUPP might be, or ENOENT,
> or EIO, or perhaps a few others.

Yes.  ENOENT seems good here since a NULL data is comparable to not existin=
g.

> > +    /* Validate all parameters - Disallow reserved bits. */
> > +    if ( set_cppc->minimum > 255 ||
> > +         set_cppc->maximum > 255 ||
> > +         set_cppc->desired > 255 ||
> > +         set_cppc->energy_perf > 255 ||
> > +         set_cppc->set_params & ~XEN_SYSCTL_CPPC_SET_PARAM_MASK ||
> > +         set_cppc->activity_window & ~XEN_SYSCTL_CPPC_ACT_WINDOW_MASK =
)
>
> Nit: Parentheses again please around the operands of &.

Sure

> > +        return -EINVAL;
> > +
> > +    /* Only allow values if params bit is set. */
> > +    if ( (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_DESIRED) &&
> > +          set_cppc->desired) ||
> > +         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_MINIMUM) &&
> > +          set_cppc->minimum) ||
> > +         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_MAXIMUM) &&
> > +          set_cppc->maximum) ||
> > +         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ENERGY_PERF) &&
> > +          set_cppc->energy_perf) ||
> > +         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ACT_WINDOW) &&
> > +          set_cppc->activity_window) )
> > +        return -EINVAL;
> > +
> > +    /* Clear out activity window if lacking HW supported. */
> > +    if ( (set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ACT_WINDOW) &&
> > +         !feature_hwp_activity_window ) {
> > +        set_cppc->set_params &=3D ~XEN_SYSCTL_CPPC_SET_ACT_WINDOW;
> > +        cleared_act_window =3D true;
> > +    }
> > +
> > +    /* Return if there is nothing to do. */
> > +    if ( set_cppc->set_params =3D=3D 0 )
> > +        return cleared_act_window ? 0 : -EINVAL;
>
> Is it really necessary to return an error when there's nothing to do?
> We have various hypercalls which can degenerate to no-ops under
> certain conditions, and which simply return success then.

With all the earlier parameter checking, I think it would be fine to
return success here for a no-op.

> > --- a/xen/drivers/acpi/pmstat.c
> > +++ b/xen/drivers/acpi/pmstat.c
> > @@ -400,6 +400,19 @@ static int set_cpufreq_para(struct xen_sysctl_pm_o=
p *op)
> >      return ret;
> >  }
> >
> > +static int set_cpufreq_cppc(struct xen_sysctl_pm_op *op)
> > +{
> > +    struct cpufreq_policy *policy =3D per_cpu(cpufreq_cpu_policy, op->=
cpuid);
> > +
> > +    if ( !policy || !policy->governor )
> > +        return -EINVAL;
> > +
> > +    if ( !hwp_active() )
> > +        return -EINVAL;
>
> In both cases I again wonder in how far EINVAL is really appropriate.

-EOPNOTSUPP seems good for the !hwp_active() case.  Maybe ENOENT for
the policy one.

> > --- a/xen/include/public/sysctl.h
> > +++ b/xen/include/public/sysctl.h
> > @@ -351,6 +351,68 @@ struct xen_cppc_para {
> >      uint32_t activity_window;
> >  };
> >
> > +/*
> > + * Set CPPC values.
> > + *
> > + * Configure the parameters for CPPC.  Set bits in set_params control =
which
> > + * values are applied.  If a bit is not set in set_params, the field m=
ust be
> > + * zero.
> > + *
> > + * For HWP specifically, values must be limited to 0-255 or within
> > + * XEN_SYSCTL_CPPC_ACT_WINDOW_MASK for activity window.  Set bits outs=
ide the
> > + * range will be returned as -EINVAL.
> > + *
> > + * Activity Window may not be supported by the hardware.  In that case=
, the
> > + * returned set_params will clear XEN_SYSCTL_CPPC_SET_ACT_WINDOW to in=
dicate
> > + * that it was not applied - though the rest of the values will be app=
lied.
> > + *
> > + * There are a set of presets along with individual fields.  Presets a=
re
> > + * applied first, and then individual fields.  This allows customizing
> > + * a preset without having to specify every value.
> > + *
> > + * The preset options values are as follows:
> > + *
> > + * preset      | minimum | maxium  | energy_perf
> > + * ------------+---------+---------+----------------
> > + * powersave   | lowest  | lowest  | powersave (255)
> > + * ------------+---------+---------+----------------
> > + * balance     | lowest  | highest | balance (128)
> > + * ------------+---------+---------+----------------
> > + * performance | highest | highest | performance (0)
> > + *
> > + * desired and activity_window are set to 0, hardware selected.
> > + */
> > +struct xen_set_cppc_para {
> > +#define XEN_SYSCTL_CPPC_SET_MINIMUM              (1U << 0)
> > +#define XEN_SYSCTL_CPPC_SET_MAXIMUM              (1U << 1)
> > +#define XEN_SYSCTL_CPPC_SET_DESIRED              (1U << 2)
> > +#define XEN_SYSCTL_CPPC_SET_ENERGY_PERF          (1U << 3)
> > +#define XEN_SYSCTL_CPPC_SET_ACT_WINDOW           (1U << 4)
> > +#define XEN_SYSCTL_CPPC_SET_PRESET_MASK          0xf0000000
> > +#define XEN_SYSCTL_CPPC_SET_PRESET_NONE          0x00000000
> > +#define XEN_SYSCTL_CPPC_SET_PRESET_BALANCE       0x10000000
> > +#define XEN_SYSCTL_CPPC_SET_PRESET_POWERSAVE     0x20000000
> > +#define XEN_SYSCTL_CPPC_SET_PRESET_PERFORMANCE   0x30000000
>
> As corrections for the respective Misra rule are in the process of
> being merged, please add U suffixes here (at the very least on the
> _MASK).

Sure.

Thanks,
Jason


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 16:34:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 16:34:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563326.880501 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJzGV-0001qa-VC; Thu, 13 Jul 2023 16:34:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563326.880501; Thu, 13 Jul 2023 16:34:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJzGV-0001qT-Sa; Thu, 13 Jul 2023 16:34:03 +0000
Received: by outflank-mailman (input) for mailman id 563326;
 Thu, 13 Jul 2023 16:34:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=LNpG=C7=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qJzGU-0001qN-Lj
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 16:34:02 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 11dfc01e-219b-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 18:34:00 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36DGXMxF097255
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Thu, 13 Jul 2023 12:33:28 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36DGXMtE097254;
 Thu, 13 Jul 2023 09:33:22 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 11dfc01e-219b-11ee-b239-6b7b168915f2
Date: Thu, 13 Jul 2023 09:33:22 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
        Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
        Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 1/3] x86/APIC: include full string with
 error_interrupt() error messages
Message-ID: <ZLAnUg7qnaL2XfaI@mattapan.m5p.com>
References: <cover.1689191941.git.ehem+xen@m5p.com>
 <062ed51e7529d282b6e336c8b62734afaf21979f.1689191941.git.ehem+xen@m5p.com>
 <5a3664ef-6b58-cefd-ba42-f4b70da348b0@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <5a3664ef-6b58-cefd-ba42-f4b70da348b0@suse.com>
X-Spam-Status: No, score=0.4 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

On Thu, Jul 13, 2023 at 03:08:56PM +0200, Jan Beulich wrote:
> On 17.03.2023 20:45, Elliott Mitchell wrote:
> > Rather than adding ", " with each printf(), simply include them in the
> > string initially.  This allows converting to strlcat() or other methods
> > which strictly concatenate, rather than formatting.
> > 
> > Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
> 
> Acked-by: Jan Beulich <jbeulich@suse.com>
> 
> Nevertheless I wonder ...


> > @@ -1423,7 +1423,7 @@ static void cf_check error_interrupt(struct cpu_user_regs *regs)
> >              smp_processor_id(), v , v1);
> >      for ( i = 7; i >= 0; --i )
> >          if ( v1 & (1 << i) )
> > -            printk(", %s", esr_fields[i]);
> > +            printk("%s", esr_fields[i]);
> 
> ... whether the extra level of indirection (by using %s) is then still
> necessary: There are no % characters in any of the individual strings.
> Then again iirc this goes away anyway in the next patch ...

I suspect most development guidelines generally discourage this.  Too
easy for someone to later add a '%' to the string, or make it a dynamic
string coming from some random location.

More notable is that last point.  Emphasis here is the ", " being merged
into the strings and the line is being completely replaced in the next
patch.  v0 was to strcpy() into a buffer, but this is simpler.

I also suspect "%s" may be faster if the string is sufficiently long,
as this amounts to a strcpy() info printk's buffer.  Whereas avoiding the
indirection causes the string to be scanned for '%' which will be slower
than strcpy().


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Thu Jul 13 16:47:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 16:47:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563332.880511 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJzTe-0003Ue-3H; Thu, 13 Jul 2023 16:47:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563332.880511; Thu, 13 Jul 2023 16:47:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qJzTe-0003UX-0Z; Thu, 13 Jul 2023 16:47:38 +0000
Received: by outflank-mailman (input) for mailman id 563332;
 Thu, 13 Jul 2023 16:47:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=LNpG=C7=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qJzTc-0003UR-VN
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 16:47:36 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f7539f51-219c-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 18:47:35 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36DGlKgX097332
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Thu, 13 Jul 2023 12:47:26 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36DGlILG097329;
 Thu, 13 Jul 2023 09:47:18 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f7539f51-219c-11ee-b239-6b7b168915f2
Date: Thu, 13 Jul 2023 09:47:18 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
        Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
        Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 2/3] x86/APIC: modify error_interrupt() to output
 using single printk()
Message-ID: <ZLAqlsvIvzOPMdOV@mattapan.m5p.com>
References: <cover.1689191941.git.ehem+xen@m5p.com>
 <7771343b52e6769d7670ad73094f5276025a10fe.1689191941.git.ehem+xen@m5p.com>
 <3b16e1d8-acfb-8dd4-763b-57908ea6a2a1@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <3b16e1d8-acfb-8dd4-763b-57908ea6a2a1@suse.com>
X-Spam-Status: No, score=0.4 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

On Thu, Jul 13, 2023 at 03:12:55PM +0200, Jan Beulich wrote:
> On 17.03.2023 20:53, Elliott Mitchell wrote:
> > --- a/xen/arch/x86/apic.c
> > +++ b/xen/arch/x86/apic.c
> > @@ -1419,12 +1420,13 @@ static void cf_check error_interrupt(struct cpu_user_regs *regs)
> >      v1 = apic_read(APIC_ESR);
> >      ack_APIC_irq();
> >  
> > -    printk(XENLOG_DEBUG "APIC error on CPU%u: %02x(%02x)",
> > -            smp_processor_id(), v , v1);
> >      for ( i = 7; i >= 0; --i )
> > -        if ( v1 & (1 << i) )
> > -            printk("%s", esr_fields[i]);
> > -    printk("\n");
> > +        entries[i] = v1 & (1 << i) ? esr_fields[i] : "";
> > +    printk(XENLOG_DEBUG "APIC error on CPU%u: %02x(%02x)"
> > +        "%s%s%s%s%s%s%s%s" "\n",
> > +        smp_processor_id(), v , v1,
> > +        entries[7], entries[6],
> > +        entries[5], entries[4], entries[3], entries[2], entries[1], entries[0]);
> 
> While pre-existing in both cases, two nits: There's a stray blank before one
> of the commas, and indentation is wrong too.

I don't see anything which could be called an indentation error.  The
very first added line is attached to the `for ()`, therefore it correctly
has one more indent.

I guess this is an advantage of rewriting the loop as part of this patch.
The correct indentation is clearer.

> Furthermore there's no reason to split the format string, especially not
> ahead of the \n. Plus line wrapping for the 8 entries[] references could
> also be done more evenly.
> 
> Since these are all cosmetic, I guess I'll do adjustments while committing:
> Acked-by: Jan Beulich <jbeulich@suse.com>

Yeah, that seems the best approach here.  I'm unsure how likely it is for
additional bits in the ESR register to be allocated.  Ideal is to format
this in such a way that adding bits causes a smaller delta.  I was
thinking high-order bits were likely to be reportted at start, hence the
last line would be best filled first.

Though one does not know the future and trying to anticipate it may well
yield worse results.  This really does seem a place where it should be
adjusted to taste during final commit.  Otherwise there are too many
minor nits and things get bogged down in trivial issues.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Thu Jul 13 17:50:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 17:50:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563338.880522 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK0Rv-0001hL-Ee; Thu, 13 Jul 2023 17:49:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563338.880522; Thu, 13 Jul 2023 17:49:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK0Rv-0001hE-BY; Thu, 13 Jul 2023 17:49:55 +0000
Received: by outflank-mailman (input) for mailman id 563338;
 Thu, 13 Jul 2023 17:49:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=In0U=C7=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qK0Ru-0001h8-Dh
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 17:49:54 +0000
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com
 [2a00:1450:4864:20::130])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ab745fb6-21a5-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 19:49:52 +0200 (CEST)
Received: by mail-lf1-x130.google.com with SMTP id
 2adb3069b0e04-4fba8f2197bso1797331e87.3
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 10:49:52 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 m17-20020a056512015100b004f858249931sm1200091lfo.93.2023.07.13.10.49.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 13 Jul 2023 10:49:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ab745fb6-21a5-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689270592; x=1691862592;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=SkAJ95bWITjQMArIuV8XW+ADF1vl6AjTeXxHvoUW+6o=;
        b=DQe23IVYip4+hUV9RVfYMopeHJtuSymTvwj4iHT3I6VwFW2cpi/6ccZAAyhSAb9O22
         81RtKCyoHq/a5YAKM8tapRRpKz8ufvPhBSG5YGxPGelzL91oXHcMYTeJCw3oyoIIVmUK
         kiL5Q/0FMwerNw4pizdRyrVEA/jVJFiQPkpKC+g7NEb9uOng8OI+uLHdJXjjLdv2d4eN
         5kV4JwPNS/u5BS4ybYoGyMOGomNjr0a8MtiZtkJmhsW647T1EMgfXO5E1hJLNJO7goV8
         1Q59AG/Jul9Mi3rIQY9GL78Oc1uzRQUeXpzcSiWHy5KSUDkyVR/ahDwatdFvtYZVcz1G
         nejg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689270592; x=1691862592;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=SkAJ95bWITjQMArIuV8XW+ADF1vl6AjTeXxHvoUW+6o=;
        b=I7HTnVw/JvvW8DPwPxaTLzjjAhaFE/AECfaUPiEppsLhfGIgrvtLrO2wePUzz9YDLf
         lK2Qyc77Xxs83LE6ZeRVgMAtH+8B8lnQhge6T7f91FEUXjfcIDFz/4+J8VrGaXbtpLQX
         IY9ofpXS3w+RyIwjWp8cPiSPTwn1Hv/piv8eA1gc8aODHQzV6Ey7YoiklqCOaYabf6ye
         /Xp4CVbAderY3MZz6Vv/kzL/etwo5dqb1BEjDLbddamc0SmE8RS/s6vgNpfcTzFhH+oZ
         802cKIlHuH1KRVGnc71N26JvBAr5cAqBSrTm6ptd917Zallbvcr9dgAlRFw32mgRH2El
         pcJw==
X-Gm-Message-State: ABy/qLYeM63qsax+MMd11mIpkjrY3nUGyHBuCf8VQorGq0RVYQfcPB1y
	SaEjSfPQY/zl1obGXeu0/e8=
X-Google-Smtp-Source: APBJJlE4iIixE04N+uFeZYFhfUHi+rJmQRq248BG/D+sRpK1LZuoNlqdR8zJ4ujVJHabf4eCZ0R9AA==
X-Received: by 2002:ac2:5f01:0:b0:4f9:567a:7a62 with SMTP id 1-20020ac25f01000000b004f9567a7a62mr1529986lfq.21.1689270592044;
        Thu, 13 Jul 2023 10:49:52 -0700 (PDT)
Message-ID: <9415dc2fe8c8ca0325ba6dfe41fdf72cb0f2ea0a.camel@gmail.com>
Subject: Re: [PATCH] ns1650: refactor interrupt handling in
 ns16550_uart_dt_init()
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap
 <george.dunlap@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org, Julien Grall
 <julien@xen.org>
Date: Thu, 13 Jul 2023 20:49:51 +0300
In-Reply-To: <200693a2-267d-16c8-61f3-3047dc8967da@suse.com>
References: 
	<cc5a08056abacdbb6d6509b56716eb45467307bb.1689240611.git.oleksii.kurochko@gmail.com>
	 <a385a17b-a60c-d770-e044-af64273371d6@suse.com>
	 <86702f86787ee7b963b131c4b2d6db463eddc1f3.camel@gmail.com>
	 <3e4c673d-1b8b-15ab-629f-27a9f687b37a@suse.com>
	 <83f67337cb69fb8cf2aa5d56b8a711384cdaa5f0.camel@gmail.com>
	 <200693a2-267d-16c8-61f3-3047dc8967da@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Thu, 2023-07-13 at 16:26 +0200, Jan Beulich wrote:
> On 13.07.2023 15:36, Oleksii wrote:
> > On Thu, 2023-07-13 at 15:27 +0200, Jan Beulich wrote:
> > > I don't understand. My earlier comment was affecting all checks
> > > of
> > > uart->irq alike, as I'm unconvinced IRQ0 may not possibly be
> > > usable
> > > on some architecture / platform. IOW I don't see why the check in
> > > ns16550_init_postirq() would allow us any leeway.
> > It looks like I misunderstood you.
> >=20
> > Do you mean that on some architecture IRQ0 may be used for ns16550?
>=20
> Yes, I don't see why this shouldn't be possible in principle. As
> Julien
> said it can't happen on Arm, so if it also can't happen on RISC-V and
> PPC, we could elect to continue to ignore that aspect.
>=20
Then for RISC-V ( at least, for PLIC interrupt controller ) it is
reserved:
https://github.com/riscv/riscv-plic-spec/blob/master/riscv-plic.adoc#interr=
upt-identifiers-ids

What about to have 'define NO_IRQ_POLL 0' ( mentioned by Julien )+
assert(irq_from_device_tree !=3D NO_IRQ_POLL) ?

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 17:53:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 17:53:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563341.880532 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK0VA-00036K-UB; Thu, 13 Jul 2023 17:53:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563341.880532; Thu, 13 Jul 2023 17:53:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK0VA-00036D-QJ; Thu, 13 Jul 2023 17:53:16 +0000
Received: by outflank-mailman (input) for mailman id 563341;
 Thu, 13 Jul 2023 17:53:14 +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 <SRS0=dpWG=C7=tesarici.cz=petr@srs-se1.protection.inumbo.net>)
 id 1qK0V7-000365-ND
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 17:53:14 +0000
Received: from bee.tesarici.cz (bee.tesarici.cz [77.93.223.253])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 21bdd4ac-21a6-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 19:53:11 +0200 (CEST)
Received: from meshulam.tesarici.cz
 (dynamic-2a00-1028-83b8-1e7a-4427-cc85-6706-c595.ipv6.o2.cz
 [IPv6:2a00:1028:83b8:1e7a:4427:cc85:6706:c595])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (No client certificate requested)
 by bee.tesarici.cz (Postfix) with ESMTPSA id 5EE5814DBB9;
 Thu, 13 Jul 2023 19:53:09 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 21bdd4ac-21a6-11ee-8611-37d641c3527e
Authentication-Results: mail.tesarici.cz; dmarc=fail (p=none dis=none) header.from=tesarici.cz
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tesarici.cz; s=mail;
	t=1689270789; bh=bPL0dJQsO71F+7x2c6oBcd15kYFwAiWbA6uxbyrkpGE=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
	b=EkihYalIeEcrIel7VgAhcpVNo9/pboyyZekjWK0jOnc5F1ahW2sgtlX2s4G3xz2aa
	 7/pVJP13bkUSQtOnx/qTC561TvfhmkpEWgCjkNF0dnKtNeOHHWOPNueuVhTFgK2ELk
	 wUOXEGu3hH49hYFoW2UWlnrBscc4Wib4CIVTdHzIxE5HMHeeuN7aydOSwzOTqbpdDv
	 gD5Bsyr0BRxuvTKvkDlRDW5xFxEeTF4ZsC7VFVRP05INsvS0TzW3gxx20lzeEnkYdG
	 ce/RvNC6zV5zfoC3oip2w9zTQ1heZ9+LR1nTdovemvPME96D6qgBeJM/SIEWJ77vyR
	 +exPMHF3hrfBg==
Date: Thu, 13 Jul 2023 19:53:07 +0200
From: Petr =?UTF-8?B?VGVzYcWZw61r?= <petr@tesarici.cz>
To: Petr Tesarik <petrtesarik@huaweicloud.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Russell King
 <linux@armlinux.org.uk>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), "H. Peter
 Anvin" <hpa@zytor.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "Rafael J. Wysocki" <rafael@kernel.org>, Juergen Gross <jgross@suse.com>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, Christoph Hellwig
 <hch@lst.de>, Marek Szyprowski <m.szyprowski@samsung.com>, Robin Murphy
 <robin.murphy@arm.com>, Petr Tesarik <petr.tesarik.ext@huawei.com>,
 Jonathan Corbet <corbet@lwn.net>, Andy Shevchenko
 <andriy.shevchenko@linux.intel.com>, Hans de Goede <hdegoede@redhat.com>,
 James Seo <james@equiv.tech>, James Clark <james.clark@arm.com>, Kees Cook
 <keescook@chromium.org>, xen-devel@lists.xenproject.org (moderated list:XEN
 HYPERVISOR ARM), linux-arm-kernel@lists.infradead.org (moderated list:ARM
 PORT), linux-kernel@vger.kernel.org (open list), linux-mips@vger.kernel.org
 (open list:MIPS), iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM),
 Roberto Sassu <roberto.sassu@huaweicloud.com>, Kefeng Wang
 <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH v4 3/8] swiotlb: separate memory pool data from other
 allocator data
Message-ID: <20230713195307.08d68b01@meshulam.tesarici.cz>
In-Reply-To: <e309b4a88ffb306c88a3b3cfe5e57483d73d20bc.1689261692.git.petr.tesarik.ext@huawei.com>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
	<e309b4a88ffb306c88a3b3cfe5e57483d73d20bc.1689261692.git.petr.tesarik.ext@huawei.com>
X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Thu, 13 Jul 2023 17:23:14 +0200
Petr Tesarik <petrtesarik@huaweicloud.com> wrote:

> From: Petr Tesarik <petr.tesarik.ext@huawei.com>
> 
> Carve out memory pool specific fields from struct io_tlb_mem. The original
> struct now contains shared data for the whole allocator, while the new
> struct io_tlb_pool contains data that is specific to one memory pool of
> (potentially) many.
> 
> Allocate both structures together for restricted DMA pools to keep the
> error cleanup path simple.
> 
> Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
> ---
>  include/linux/device.h  |   2 +-
>  include/linux/swiotlb.h |  47 +++++++----
>  kernel/dma/swiotlb.c    | 181 +++++++++++++++++++++++++---------------
>  3 files changed, 147 insertions(+), 83 deletions(-)
> 
> diff --git a/include/linux/device.h b/include/linux/device.h
> index bbaeabd04b0d..d9754a68ba95 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -625,7 +625,7 @@ struct device_physical_location {
>   * @dma_pools:	Dma pools (if dma'ble device).
>   * @dma_mem:	Internal for coherent mem override.
>   * @cma_area:	Contiguous memory area for dma allocations
> - * @dma_io_tlb_mem: Pointer to the swiotlb pool used.  Not for driver use.
> + * @dma_io_tlb_mem: Software IO TLB allocator.  Not for driver use.
>   * @archdata:	For arch-specific additions.
>   * @of_node:	Associated device tree node.
>   * @fwnode:	Associated device node supplied by platform firmware.
> diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
> index 39313c3a791a..d669e11e2827 100644
> --- a/include/linux/swiotlb.h
> +++ b/include/linux/swiotlb.h
> @@ -62,8 +62,7 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t phys,
>  #ifdef CONFIG_SWIOTLB
>  
>  /**
> - * struct io_tlb_mem - IO TLB Memory Pool Descriptor
> - *
> + * struct io_tlb_pool - IO TLB memory pool descriptor
>   * @start:	The start address of the swiotlb memory pool. Used to do a quick
>   *		range check to see if the memory was in fact allocated by this
>   *		API.
> @@ -73,15 +72,36 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t phys,
>   * @vaddr:	The vaddr of the swiotlb memory pool. The swiotlb memory pool
>   *		may be remapped in the memory encrypted case and store virtual
>   *		address for bounce buffer operation.
> - * @nslabs:	The number of IO TLB blocks (in groups of 64) between @start and
> - *		@end. For default swiotlb, this is command line adjustable via
> - *		setup_io_tlb_npages.
> + * @nslabs:	The number of IO TLB slots between @start and @end. For the
> + *		default swiotlb, this can be adjusted with a boot parameter,
> + *		see setup_io_tlb_npages().
> + * @used:	The number of used IO TLB slots.
> + * @late_alloc:	%true if allocated using the page allocator.
> + * @nareas:	Number of areas in the pool.
> + * @area_nslabs: Number of slots in each area.
> + * @areas:	Array of memory area descriptors.
> + * @slots:	Array of slot descriptors.
> + */
> +struct io_tlb_pool {
> +	phys_addr_t start;
> +	phys_addr_t end;
> +	void *vaddr;
> +	unsigned long nslabs;
> +	unsigned long used;

Oops. This member should not be re-introduced here after I removed it
with commit efa76afdde16...

I'm going to fix this in a v5, but I don't think it's critical enough
to make an immediate resend.

Petr T


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 18:03:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 18:03:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563346.880541 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK0eQ-0004jL-Q3; Thu, 13 Jul 2023 18:02:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563346.880541; Thu, 13 Jul 2023 18:02:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK0eQ-0004jE-NS; Thu, 13 Jul 2023 18:02:50 +0000
Received: by outflank-mailman (input) for mailman id 563346;
 Thu, 13 Jul 2023 18:02:50 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qK0eQ-0004j5-Fd; Thu, 13 Jul 2023 18:02:50 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qK0eQ-00008H-9b; Thu, 13 Jul 2023 18:02:50 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qK0eQ-00011B-0V; Thu, 13 Jul 2023 18:02:50 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qK0eP-0002Yg-WB; Thu, 13 Jul 2023 18:02:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=T6klABTE2RUxrKUsStUrDFTUAGuzIrwXtO55S1zCphE=; b=Nv1k0LWfGyZKlMi57X1ZWY+4hP
	diBqqja0ZyVG1rY2iT72PPcvWUlFrF39Nb/xu8pYcGL6yxi5CemuZV/3pNjiS7M3uROYVZJvNGq5h
	xNSiamtdFWZ4Xm+jrWzL9Xqk5BON0qCJpVC2t8xdTV0qM8XJ+kaY057UnNdCWxnJEFwk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181784-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181784: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=2acec876949e2488dfeffab3c531984b91d33cf5
X-Osstest-Versions-That:
    xen=99e45548934923f0d2c1d52ae1239ffe4ef17a06
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 13 Jul 2023 18:02:49 +0000

flight 181784 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181784/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  2acec876949e2488dfeffab3c531984b91d33cf5
baseline version:
 xen                  99e45548934923f0d2c1d52ae1239ffe4ef17a06

Last test of basis   181781  2023-07-13 11:00:27 Z    0 days
Testing same since   181784  2023-07-13 15:00:28 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Elliott Mitchell <ehem+xen@m5p.com>
  Jan Beulich <jbeulich@suse.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   99e4554893..2acec87694  2acec876949e2488dfeffab3c531984b91d33cf5 -> smoke


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 18:16:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 18:16:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563352.880552 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK0rB-0006KM-13; Thu, 13 Jul 2023 18:16:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563352.880552; Thu, 13 Jul 2023 18:16:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK0rA-0006KF-Tu; Thu, 13 Jul 2023 18:16:00 +0000
Received: by outflank-mailman (input) for mailman id 563352;
 Thu, 13 Jul 2023 18:15:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qK0r8-0006K9-QU
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 18:15:58 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qK0r8-0000MR-DB; Thu, 13 Jul 2023 18:15:58 +0000
Received: from 54-240-197-236.amazon.com ([54.240.197.236]
 helo=[192.168.30.214]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qK0r8-0004s5-7O; Thu, 13 Jul 2023 18:15:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=eLMZ1eunLjksH9WZerI8huF0kt1l/ZRISTyz8uO1K7U=; b=vRo/pDKzECBfQwX2FAi7v97/cB
	WursnVu6kQnaqNZ0mITSp7MRxy5DcSrsLWlDXZJmvm9yV924xSVSdkNhXI1ekUqU+abrt/ANOTOAF
	TeprrpXtUoUPThMfTTFmqlsvc642oczcEgdgealg8HGHaTITEH3Tc24FN3Jgeyxv0f5c=;
Message-ID: <66997c9c-d0d9-fce3-e5bd-a4f41cf0de91@xen.org>
Date: Thu, 13 Jul 2023 19:15:56 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH 2/2] xen/arm: Account for domU dtb bootmodule size
 separately
Content-Language: en-US
To: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230711082931.5402-1-michal.orzel@amd.com>
 <20230711082931.5402-3-michal.orzel@amd.com>
 <8bc1ed0e-3ad6-2243-4dd6-a88dd0ee00f8@xen.org>
 <b39b19a4-9649-173b-bb05-518702d05873@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <b39b19a4-9649-173b-bb05-518702d05873@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 12/07/2023 08:01, Michal Orzel wrote:
> Hi Julien,

Hi Michal,
> 
> On 11/07/2023 18:07, Julien Grall wrote:
>>
>>
>> Hi Michal,
>>
>> On 11/07/2023 09:29, Michal Orzel wrote:
>>> At the moment, we limit the allocation size when creating a domU dtb to
>>> 4KB, which is not enough when using a passthrough dtb with several nodes.
>>> Improve the handling by accounting for a dtb bootmodule (if present)
>>> size separately, while keeping 4KB for the Xen generated nodes (still
>>> plenty of space for new nodes). Also, cap the allocation size to 2MB,
>>> which is the max dtb size allowed.
>>>
>>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
>>> ---
>>> Note for the future:
>>> As discussed with Julien, really the best way would be to generate dtb directly
>>> in the guest memory, where no allocation would be necessary. This of course
>>> requires some rework. The solution in this patch is good enough for now and
>>> can be treated as an intermediated step to support dtb creation of various
>>> sizes.
>>
>> Thanks for summarizing our discussion :).
>>
>>> ---
>>>    xen/arch/arm/domain_build.c | 18 +++++++++++++-----
>>>    1 file changed, 13 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>>> index f2134f24b971..1dc0eca37bd6 100644
>>> --- a/xen/arch/arm/domain_build.c
>>> +++ b/xen/arch/arm/domain_build.c
>>> @@ -3257,14 +3257,15 @@ static int __init domain_handle_dtb_bootmodule(struct domain *d,
>>>    }
>>>
>>>    /*
>>> - * The max size for DT is 2MB. However, the generated DT is small, 4KB
>>> - * are enough for now, but we might have to increase it in the future.
>>> + * The max size for DT is 2MB. However, the generated DT is small (not including
>>> + * domU passthrough DT nodes whose size we account separately), 4KB are enough
>>> + * for now, but we might have to increase it in the future.
>>>     */
>>>    #define DOMU_DTB_SIZE 4096
>>>    static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
>>>    {
>>>        int addrcells, sizecells;
>>> -    int ret;
>>> +    int ret, fdt_size = DOMU_DTB_SIZE;
>>
>> Can fdt_size be unsigned?
> I used int because by looking at all the fdt_create() calls in our codebase
> we seem to use int and not unsigned. 

This is a bit of a mess because xmalloc_bytes() is expecting an unsigned 
long parameter. So we have some inconsistency here and we need to chose 
a side.

My preference would be to use the 'unsigned int/long' because the value 
is not meant to be negative.

Also, I used min() that does strict type checking
> and SZ_2M is int. So if you want, I can use unsigned int but will also have to use
> MIN() macro instead not to do type checking (I cannot use MB(2) as it has ULL type
> and do not want to use min() with cast).

By "use min() with cast", do you mean using min_t()? I would be OK with 
using MIN().

> Also, are you OK with the rest of the code?

The rest is fine to me. Anyway, I am OK with this patch as-is. So:

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 18:19:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 18:19:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563357.880561 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK0u7-00070k-IZ; Thu, 13 Jul 2023 18:19:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563357.880561; Thu, 13 Jul 2023 18:19:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK0u7-00070d-G0; Thu, 13 Jul 2023 18:19:03 +0000
Received: by outflank-mailman (input) for mailman id 563357;
 Thu, 13 Jul 2023 18:19:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qK0u6-00070V-K1
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 18:19:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qK0u5-0000Qp-R9; Thu, 13 Jul 2023 18:19:01 +0000
Received: from 54-240-197-236.amazon.com ([54.240.197.236]
 helo=[192.168.30.214]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qK0u5-0004wN-L0; Thu, 13 Jul 2023 18:19:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=FGipteWqmG4l0nNp12J/sU2ZBBdjXOuraMgXI4nPp6U=; b=Kg5zgseyVSN5YY8uZ8bEDZTUOn
	BMkFUoUDi0Pcd5lbkeuGbbGO6c7rxy4jzpkMn1w4czyl2IXbu87M7QDtvowfHPvYlQuaYz2X8pFaC
	d94ilOCxXdfTupxiwVzxq4wpzREG6hKk3qkk6gFbdBNMQ1yIgXBTaE+eTR2zmKJtQ3Nk=;
Message-ID: <1a14cd31-0499-cb70-4da5-d355119c6355@xen.org>
Date: Thu, 13 Jul 2023 19:18:59 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3] xen/arm: pci: fix check in pci_check_bar()
Content-Language: en-US
To: Rahul Singh <Rahul.Singh@arm.com>,
 Stewart Hildebrand <Stewart.Hildebrand@amd.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <20230712135226.747472-1-stewart.hildebrand@amd.com>
 <1FA588FD-8C55-4796-A75D-120D27AD5507@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <1FA588FD-8C55-4796-A75D-120D27AD5507@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 12/07/2023 18:04, Rahul Singh wrote:
> Hi Stewart,
> 
>> On 12 Jul 2023, at 2:52 pm, Stewart Hildebrand <Stewart.Hildebrand@amd.com> wrote:
>>
>> When mapping BARs for vPCI, it's valid for a BAR mfn_t start to equal the BAR
>> mfn_t end (i.e. start == end) since end is inclusive. However, pci_check_bar()
>> currently returns false in this case, which results in Xen not mapping the BAR
>> in the guest 2nd stage page tables. In this example boot log, Linux has mapped
>> the BARs in the 1st stage, but since Xen did not map them in the 2nd stage,
>> Linux encounters a data abort and panics:
>>
>> [    2.593300] pci 0000:00:00.0: BAR 0: assigned [mem 0x50008000-0x50008fff]
>> [    2.593682] pci 0000:00:00.0: BAR 2: assigned [mem 0x50009000-0x50009fff]
>> [    2.594066] pci 0000:00:00.0: BAR 4: assigned [mem 0x5000a000-0x5000afff]
>> ...
>> [    2.810502] virtio-pci 0000:00:00.0: enabling device (0000 -> 0002)
>> (XEN) 0000:00:00.0: not mapping BAR [50008, 50008] invalid position
>> (XEN) 0000:00:00.0: not mapping BAR [50009, 50009] invalid position
>> (XEN) 0000:00:00.0: not mapping BAR [5000a, 5000a] invalid position
>> [    2.817502] virtio-pci 0000:00:00.0: virtio_pci: leaving for legacy driver
>> [    2.817853] virtio-pci 0000:00:00.0: enabling bus mastering
>> (XEN) arch/arm/traps.c:1992:d0v0 HSR=0x00000093010045 pc=0xffff8000089507d4 gva=0xffff80000c46d012 gpa=0x00000050008012
>> [    2.818397] Unable to handle kernel ttbr address size fault at virtual address ffff80000c46d012
>> ...
>>
>> Adjust the end physical address e to account for the full page when converting
>> from mfn, at which point s and e cannot be equal, so drop the equality check in
>> the condition.
>>
>> Note that adjusting e to account for the full page also increases the accuracy
>> of the subsequent is_bar_valid check.
>>
>> Fixes: cc80e2bab0d0 ("xen/pci: replace call to is_memory_hole to pci_check_bar")
>> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
>> Reviewed-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> 
> I tested the patch on N1SDP board everything works.
> 
> Reviewed-by: Rahul Singh <rahul.singh@arm.com>
> Tested-by: Rahul Singh <rahul.singh@arm.com>

Acked-by: Julien Grall <jgrall@amazon.com>

> 
> Regards,
> Rahul

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 18:41:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 18:41:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563363.880571 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK1FQ-0001za-7t; Thu, 13 Jul 2023 18:41:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563363.880571; Thu, 13 Jul 2023 18:41:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK1FQ-0001zT-5H; Thu, 13 Jul 2023 18:41:04 +0000
Received: by outflank-mailman (input) for mailman id 563363;
 Thu, 13 Jul 2023 18:41:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qK1FO-0001zN-RJ
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 18:41:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qK1FO-0000w6-0z; Thu, 13 Jul 2023 18:41:02 +0000
Received: from 54-240-197-236.amazon.com ([54.240.197.236]
 helo=[192.168.30.214]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qK1FN-0005op-Qe; Thu, 13 Jul 2023 18:41:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=PNx4BVssbsyDXauQTngh3Z4kDcMyVs7xLKtpnHVEigs=; b=rO57tju/9DHJeoEjryuuo+92Wd
	j4EdY68681TzlE7VXyNADjl3VDsoKMs6ROpblhhJfUK+pkHVuHY7aKlohUd0SumxnuWaGFYf7yHRx
	D1qhfuAqCqPbPfBxieateIYbYSf4k93N8KT163q2ePbp6qvsWawt4RAaM9wTZQOsUxFU=;
Message-ID: <041323d2-9114-328f-40c6-f5fed60892a5@xen.org>
Date: Thu, 13 Jul 2023 19:40:59 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 1/3] xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig
 option
Content-Language: en-US
To: Stewart Hildebrand <stewart.hildebrand@amd.com>,
 xen-devel@lists.xenproject.org
Cc: Rahul Singh <rahul.singh@arm.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Artem Mygaiev <artem_mygaiev@epam.com>,
 Stefano Stabellini <stefano.stabellini@amd.com>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-2-stewart.hildebrand@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230707014754.51333-2-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Stewart,

On 07/07/2023 02:47, Stewart Hildebrand wrote:
> From: Rahul Singh <rahul.singh@arm.com>
> 
> Setting CONFIG_PCI_PASSTHROUGH=y will enable PCI passthrough on ARM, even though
> the feature is not yet complete in the current upstream codebase. The purpose of
> this is to make it easier to enable the necessary configs (HAS_PCI, HAS_VPCI) for
> testing and development of PCI passthrough on ARM.
> 
> Since PCI passthrough on ARM is still work in progress at this time, make it
> depend on EXPERT.

While preparing the patch for committing, I noticed that HAS_PASSTHROUGH 
will now allow the user to select one of the IOMMU quarantine options.

There are three of them right now:
   1. none
   2. basic (i.e. faulting)
   3. scratch page

The latter is unlikely to work on Arm because we don't setup the scratch 
page. AFAIU, for that, we would need to implement the callback 
quarantine_init().

I would expect 1 and 2 work. That said, I think 1. would behave like 2. 
because on Arm the device should not be automatically re-assigned to 
dom0. I know this is correct for platform device, but will it be valid 
for PCI as well?

Overall, before enabling HAS_PASSTHROUGH, I think there would be a bit 
of tweaking necessary to at least prevent a user to select the option 3 
(either via Kconfig or the command line). And possibly update the 
Kconfig for IOMMU_QUARANTINE to reflect the behavior on Arm.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 18:43:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 18:43:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563365.880582 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK1HA-0002WV-Jp; Thu, 13 Jul 2023 18:42:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563365.880582; Thu, 13 Jul 2023 18:42:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK1HA-0002WO-GI; Thu, 13 Jul 2023 18:42:52 +0000
Received: by outflank-mailman (input) for mailman id 563365;
 Thu, 13 Jul 2023 18:42:50 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qK1H8-0002WI-RB
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 18:42:50 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qK1H8-0000xY-Cx; Thu, 13 Jul 2023 18:42:50 +0000
Received: from 54-240-197-236.amazon.com ([54.240.197.236]
 helo=[192.168.30.214]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qK1H8-0005ru-7Q; Thu, 13 Jul 2023 18:42:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:
	References:Cc:To:From:Subject:MIME-Version:Date:Message-ID;
	bh=uciWJ6ncC1UbU99qMDc1CGTA6jFa7k6eUckYNUY1O2A=; b=oks5VfMZoNF3gUNEW3zqcOt3J0
	qX8QzmveU7p+96vPjJ1GtIQtCNeuHwtf1ctL8eNPUWSwadKR7iPp83cDWlw5FPh40xYukxoiLKDjb
	MUIIPsywk3tDSm6R62Vo0P265f5tj9dZQVDd2pqmIsT2+sBKUVZN2oFYN/TlfabuTDA4=;
Message-ID: <c3ed2f28-4f71-d5cb-0e6e-a073a0ca1766@xen.org>
Date: Thu, 13 Jul 2023 19:42:48 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3] xen/arm: pci: fix check in pci_check_bar()
Content-Language: en-US
From: Julien Grall <julien@xen.org>
To: Rahul Singh <Rahul.Singh@arm.com>,
 Stewart Hildebrand <Stewart.Hildebrand@amd.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <20230712135226.747472-1-stewart.hildebrand@amd.com>
 <1FA588FD-8C55-4796-A75D-120D27AD5507@arm.com>
 <1a14cd31-0499-cb70-4da5-d355119c6355@xen.org>
In-Reply-To: <1a14cd31-0499-cb70-4da5-d355119c6355@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 13/07/2023 19:18, Julien Grall wrote:
> 
> 
> On 12/07/2023 18:04, Rahul Singh wrote:
>> Hi Stewart,
>>
>>> On 12 Jul 2023, at 2:52 pm, Stewart Hildebrand 
>>> <Stewart.Hildebrand@amd.com> wrote:
>>>
>>> When mapping BARs for vPCI, it's valid for a BAR mfn_t start to equal 
>>> the BAR
>>> mfn_t end (i.e. start == end) since end is inclusive. However, 
>>> pci_check_bar()
>>> currently returns false in this case, which results in Xen not 
>>> mapping the BAR
>>> in the guest 2nd stage page tables. In this example boot log, Linux 
>>> has mapped
>>> the BARs in the 1st stage, but since Xen did not map them in the 2nd 
>>> stage,
>>> Linux encounters a data abort and panics:
>>>
>>> [Â Â Â  2.593300] pci 0000:00:00.0: BAR 0: assigned [mem 
>>> 0x50008000-0x50008fff]
>>> [Â Â Â  2.593682] pci 0000:00:00.0: BAR 2: assigned [mem 
>>> 0x50009000-0x50009fff]
>>> [Â Â Â  2.594066] pci 0000:00:00.0: BAR 4: assigned [mem 
>>> 0x5000a000-0x5000afff]
>>> ...
>>> [Â Â Â  2.810502] virtio-pci 0000:00:00.0: enabling device (0000 -> 0002)
>>> (XEN) 0000:00:00.0: not mapping BAR [50008, 50008] invalid position
>>> (XEN) 0000:00:00.0: not mapping BAR [50009, 50009] invalid position
>>> (XEN) 0000:00:00.0: not mapping BAR [5000a, 5000a] invalid position
>>> [Â Â Â  2.817502] virtio-pci 0000:00:00.0: virtio_pci: leaving for 
>>> legacy driver
>>> [Â Â Â  2.817853] virtio-pci 0000:00:00.0: enabling bus mastering
>>> (XEN) arch/arm/traps.c:1992:d0v0 HSR=0x00000093010045 
>>> pc=0xffff8000089507d4 gva=0xffff80000c46d012 gpa=0x00000050008012
>>> [Â Â Â  2.818397] Unable to handle kernel ttbr address size fault at 
>>> virtual address ffff80000c46d012
>>> ...
>>>
>>> Adjust the end physical address e to account for the full page when 
>>> converting
>>> from mfn, at which point s and e cannot be equal, so drop the 
>>> equality check in
>>> the condition.
>>>
>>> Note that adjusting e to account for the full page also increases the 
>>> accuracy
>>> of the subsequent is_bar_valid check.
>>>
>>> Fixes: cc80e2bab0d0 ("xen/pci: replace call to is_memory_hole to 
>>> pci_check_bar")
>>> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
>>> Reviewed-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
>>
>> I tested the patch on N1SDP board everything works.
>>
>> Reviewed-by: Rahul Singh <rahul.singh@arm.com>
>> Tested-by: Rahul Singh <rahul.singh@arm.com>
> 
> Acked-by: Julien Grall <jgrall@amazon.com>

And committed.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 18:44:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 18:44:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563370.880591 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK1II-00033r-SH; Thu, 13 Jul 2023 18:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563370.880591; Thu, 13 Jul 2023 18:44:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK1II-00033k-Pm; Thu, 13 Jul 2023 18:44:02 +0000
Received: by outflank-mailman (input) for mailman id 563370;
 Thu, 13 Jul 2023 18:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qK1IH-00033a-Qr
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 18:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qK1IG-00010M-6m; Thu, 13 Jul 2023 18:44:00 +0000
Received: from 54-240-197-236.amazon.com ([54.240.197.236]
 helo=[192.168.30.214]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qK1IG-0005tH-1S; Thu, 13 Jul 2023 18:44:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=aaXeu5X1ht3DNxAp25Oqe2F76txbqX/o5vKxoDRnkGs=; b=f54gO80pyjkNRlXm2xNuhgcBZQ
	Nx009B0boRgUZ7yXJwajTt1iKX+6Q9JNMbafIj2dtk8vATq+is0IMhg868bclbOLhh+sDdQ3MBxcC
	8lowGkqDudnc7h/jhVhi8qjFjodXkcm4fLk5yV+tXeVe3uO+Iqzxerr+idKu++v/zeCA=;
Message-ID: <1ed41842-417b-3ceb-6214-8d9cbb4f936c@xen.org>
Date: Thu, 13 Jul 2023 19:43:58 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH] docs: Fix style in misc/arm/silicon-errata.txt table
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>,
 Luca Fancellu <Luca.Fancellu@arm.com>
Cc: Michal Orzel <michal.orzel@amd.com>,
 Xen-devel <xen-devel@lists.xenproject.org>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>, Wei Chen <Wei.Chen@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230712120440.1815240-1-luca.fancellu@arm.com>
 <c139abd7-bd27-f8cf-b561-5c795bb663a7@amd.com>
 <AFE6AA84-4ADE-4496-896A-8843575C962E@arm.com>
 <alpine.DEB.2.22.394.2307121258510.761183@ubuntu-linux-20-04-desktop>
From: Julien Grall <julien@xen.org>
In-Reply-To: <alpine.DEB.2.22.394.2307121258510.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 12/07/2023 20:58, Stefano Stabellini wrote:
> On Wed, 12 Jul 2023, Luca Fancellu wrote:
>>> On 12 Jul 2023, at 14:04, Michal Orzel <michal.orzel@amd.com> wrote:
>>>
>>> Hi Luca,
>>>
>>> On 12/07/2023 14:04, Luca Fancellu wrote:
>>>>
>>>>
>>>> Fix the right border of the silicon-errata.txt table
>>>>
>>>> Fixes: 1814a626fb58 ("xen/arm: Update silicon-errata.txt with the Neovers AT erratum")
>>> Fixes tag is for bugs and this one is clearly not.
>>> With that removed:
>>> Reviewed-by: Michal Orzel <michal.orzel@amd.com>
>>
>> Thank you, yeah well I discovered it can be used also on back-ports, so Iâ€™ve added it, anyway
>> If maintainer are ok, it can be addressed on commit
> 
> Acked-by: Stefano Stabellini <sstabellini@kernel.org>

This is now committed.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 19:06:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 19:06:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563374.880602 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK1dO-0005jk-M3; Thu, 13 Jul 2023 19:05:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563374.880602; Thu, 13 Jul 2023 19:05:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK1dO-0005jd-Ht; Thu, 13 Jul 2023 19:05:50 +0000
Received: by outflank-mailman (input) for mailman id 563374;
 Thu, 13 Jul 2023 19:05:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=LNpG=C7=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qK1dN-0005jX-3M
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 19:05:49 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 45606f0d-21b0-11ee-b239-6b7b168915f2;
 Thu, 13 Jul 2023 21:05:46 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36DJ5Kdr097933
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Thu, 13 Jul 2023 15:05:26 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36DJ5J5s097932;
 Thu, 13 Jul 2023 12:05:19 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 45606f0d-21b0-11ee-b239-6b7b168915f2
Date: Thu, 13 Jul 2023 12:05:19 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
        Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
        Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 0/3] Fixing ACPI error reporting display
Message-ID: <ZLBK7/xbwtZ3Afah@mattapan.m5p.com>
References: <cover.1689191941.git.ehem+xen@m5p.com>
 <47f21cdf-5aa3-5f19-b967-6b217890e706@suse.com>
 <ZLAZnHUo8P2wccxD@mattapan.m5p.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <ZLAZnHUo8P2wccxD@mattapan.m5p.com>
X-Spam-Status: No, score=0.4 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

On Thu, Jul 13, 2023 at 08:34:52AM -0700, Elliott Mitchell wrote:
> On Thu, Jul 13, 2023 at 10:38:37AM +0200, Jan Beulich wrote:
> > On 12.07.2023 21:59, Elliott Mitchell wrote:
> > > This series has been seen previously.  The issue is pretty simple, if
> > > ACPI errors occur there is a high probability they will occur on multiple
> > > cores at once.
> > 
> > Nit: Both here and in the title s/ACPI/APIC/, to not misguide people about
> > the area the series touches (just in case a v4 might be needed).
> 
> Uh, yeah.  Wonder how that got missed.  Seems like the time for a
> Simpson's "doh!"  Also in patch #2 there is "APIC errors".
> 
> It would be correct if English words had the transitivity property.

Then re-check and realize I corrected things the wrong way.  Acronyms
become problematic when they are anagrams of each other.

Anyone up for Hitchhiker's Guide to the Galaxy quotes?


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Thu Jul 13 19:31:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 19:31:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563386.880613 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK225-0000rH-NJ; Thu, 13 Jul 2023 19:31:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563386.880613; Thu, 13 Jul 2023 19:31:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK225-0000rA-IP; Thu, 13 Jul 2023 19:31:21 +0000
Received: by outflank-mailman (input) for mailman id 563386;
 Thu, 13 Jul 2023 19:31:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qK224-0000r0-Ux; Thu, 13 Jul 2023 19:31:20 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qK224-00029Q-Mw; Thu, 13 Jul 2023 19:31:20 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qK224-0004UA-6R; Thu, 13 Jul 2023 19:31:20 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qK224-00031R-62; Thu, 13 Jul 2023 19:31:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=MitiP5G40hyoOMZQ/MBxTPugJsvfQu8Ivpbc5fgxhkQ=; b=ppMNQN6eannBg2yAAnSKAjm3fr
	Ei26NJSF9hefcPxyKiDULdSaaf4ieBgJ1xQyE86fB1AH5MAOVb+DTsOzD2cUzDHExskxJZbrRyJvg
	s0mc6uuwh64luhjjN7+9nBuH9v558a/vp5FlJONDbmW5AGgGO4D21jz9BoWTv3O4eV18=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181786-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181786: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=ff3382a51ca726a90f49623a2b2d2e8ad8459ce2
X-Osstest-Versions-That:
    ovmf=8dab4eebe435fc28cae329867a74cee45d040d3e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 13 Jul 2023 19:31:20 +0000

flight 181786 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181786/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 ff3382a51ca726a90f49623a2b2d2e8ad8459ce2
baseline version:
 ovmf                 8dab4eebe435fc28cae329867a74cee45d040d3e

Last test of basis   181760  2023-07-11 06:42:24 Z    2 days
Testing same since   181786  2023-07-13 17:42:16 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Hao A Wu <hao.a.wu@intel.com>
  Richard Ho <richardho@ami.com>
  Tinh Nguyen <tinhnguyen@os.amperecomputing.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   8dab4eebe4..ff3382a51c  ff3382a51ca726a90f49623a2b2d2e8ad8459ce2 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Jul 13 21:42:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Jul 2023 21:42:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563394.880621 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK44C-0006I0-Gv; Thu, 13 Jul 2023 21:41:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563394.880621; Thu, 13 Jul 2023 21:41:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK44C-0006Ht-EM; Thu, 13 Jul 2023 21:41:40 +0000
Received: by outflank-mailman (input) for mailman id 563394;
 Thu, 13 Jul 2023 21:41:39 +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
 <SRS0=aZdJ=C7=kernel.org=pr-tracker-bot@srs-se1.protection.inumbo.net>)
 id 1qK44B-0006Hl-IZ
 for xen-devel@lists.xenproject.org; Thu, 13 Jul 2023 21:41:39 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0a404df8-21c6-11ee-8611-37d641c3527e;
 Thu, 13 Jul 2023 23:41:36 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 8905161B8A;
 Thu, 13 Jul 2023 21:41:34 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPS id EBBB3C433CC;
 Thu, 13 Jul 2023 21:41:33 +0000 (UTC)
Received: from aws-us-west-2-korg-oddjob-1.ci.codeaurora.org
 (localhost.localdomain [127.0.0.1])
 by aws-us-west-2-korg-oddjob-1.ci.codeaurora.org (Postfix) with ESMTP id
 D7B58E29F42; Thu, 13 Jul 2023 21:41:33 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0a404df8-21c6-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689284494;
	bh=/F+dionR7vdp3SyJcv0WxofuWRapRmFADCuIWFBlP9g=;
	h=Subject:From:In-Reply-To:References:Date:To:Cc:From;
	b=e243fUPTvPX3TRajQn9ZcybPZJeKiZe/onIWGrmYh1mv+apXg6v9M7/+Cn7yACnch
	 18Wis2rSvTPSLBIgXbOikfZEVNUU/AzYpuIh6b3AbFXXuComfJpRiIbFGRQN1Dr93a
	 cQfaMbxTLyNiMoB3c6eWZJsro7S171/huc4+vFWSPP52G5X+OI0ZLNFDG2smjve88g
	 0OJWqf/CFAIlpFpRdpnXvVHlrKFEmlkSKy9/UxHp/eZXgFmAMsaYbVrA8twvFgbEIu
	 HNDiWZhfKYNcycdtLfG9yw91M2yjcN2Vz1Luz1PGmCJtPoq3by+s88L39TB/EU8frF
	 FRUM4rANQYsIw==
Subject: Re: [GIT PULL] xen: branch for v6.5-rc2
From: pr-tracker-bot@kernel.org
In-Reply-To: <20230713121542.4854-1-jgross@suse.com>
References: <20230713121542.4854-1-jgross@suse.com>
X-PR-Tracked-List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
X-PR-Tracked-Message-Id: <20230713121542.4854-1-jgross@suse.com>
X-PR-Tracked-Remote: git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git for-linus-6.5-rc2-tag
X-PR-Tracked-Commit-Id: 21a235bce12361e64adfc2ef97e4ae2e51ad63d4
X-PR-Merge-Tree: torvalds/linux.git
X-PR-Merge-Refname: refs/heads/master
X-PR-Merge-Commit-Id: 15999328946bd778b7bbf57179ee871dd5279b04
Message-Id: <168928449387.12038.12724884070520325293.pr-tracker-bot@kernel.org>
Date: Thu, 13 Jul 2023 21:41:33 +0000
To: Juergen Gross <jgross@suse.com>
Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, sstabellini@kernel.org

The pull request you sent on Thu, 13 Jul 2023 14:15:42 +0200:

> git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git for-linus-6.5-rc2-tag

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/15999328946bd778b7bbf57179ee871dd5279b04

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 00:00:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 00:00:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563416.880632 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK6EL-0004sr-Bs; Fri, 14 Jul 2023 00:00:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563416.880632; Fri, 14 Jul 2023 00:00:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK6EL-0004sk-8h; Fri, 14 Jul 2023 00:00:17 +0000
Received: by outflank-mailman (input) for mailman id 563416;
 Fri, 14 Jul 2023 00:00:15 +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 <SRS0=Uaxh=DA=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qK6EJ-0004kA-7I
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 00:00:15 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 662cde7b-21d9-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 02:00:11 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36DNxpoa098867
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Thu, 13 Jul 2023 19:59:56 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36DNxn4e098866;
 Thu, 13 Jul 2023 16:59:49 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 662cde7b-21d9-11ee-8611-37d641c3527e
Message-Id: <d71c1ddd04de64222579fe312c6fdcdb8f95abf5.1689292729.git.ehem+xen@m5p.com>
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Date: Thu, 13 Jul 2023 16:53:57 -0700
Subject: [PATCH] tools/xl_parse: remove message for tsc mode string
X-Spam-Status: No, score=0.4 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

Normal behavior is to be silent.  Generating a message for the preferred
input can be mistaken for an error.  As such remove this message to match
other conditions.

Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
 tools/xl/xl_parse.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index f036e56fc2..7b1369f098 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -1658,7 +1658,6 @@ void parse_config_data(const char *config_source,
         }
         b_info->tsc_mode = l;
     } else if (!xlu_cfg_get_string(config, "tsc_mode", &buf, 0)) {
-        fprintf(stderr, "got a tsc mode string: \"%s\"\n", buf);
         if (libxl_tsc_mode_from_string(buf, &b_info->tsc_mode)) {
             fprintf(stderr, "ERROR: invalid value \"%s\" for \"tsc_mode\"\n",
                     buf);
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 14 00:22:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 00:22:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563443.880642 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK6ZX-0007Uf-Si; Fri, 14 Jul 2023 00:22:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563443.880642; Fri, 14 Jul 2023 00:22:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK6ZX-0007UY-Ov; Fri, 14 Jul 2023 00:22:11 +0000
Received: by outflank-mailman (input) for mailman id 563443;
 Fri, 14 Jul 2023 00:22:10 +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 <SRS0=Uaxh=DA=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qK6ZW-0007US-Hb
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 00:22:10 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 773b2297-21dc-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 02:22:08 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36E0Luni098961
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Thu, 13 Jul 2023 20:22:02 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36E0LuEM098960;
 Thu, 13 Jul 2023 17:21:56 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 773b2297-21dc-11ee-8611-37d641c3527e
Message-Id: <a8223a339a0b8ff3c0d04fb4ee2913c7558cc131.1689294071.git.ehem+xen@m5p.com>
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Date: Thu, 13 Jul 2023 17:16:40 -0700
Subject: [PATCH] docs/xen-tscmode: remove mention of numeric tsc_mode= values
X-Spam-Status: No, score=0.4 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

The better to encourage moving to setting via string mode names.

Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
I'm not actually sure what tsc_mode==0 does.  I didn't find other
references, so I'm unsure how that should be modified.
---
 docs/man/xen-tscmode.7.pod | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/docs/man/xen-tscmode.7.pod b/docs/man/xen-tscmode.7.pod
index 1d81a3fe18..80aea77f76 100644
--- a/docs/man/xen-tscmode.7.pod
+++ b/docs/man/xen-tscmode.7.pod
@@ -63,19 +63,19 @@ The non-default choices for tsc_mode are:
 
 =over 4
 
-=item * B<tsc_mode=1> (always emulate).
+=item * B<tsc_mode='always_emulate'> (always emulate).
 
 All rdtsc instructions are emulated; this is the best choice when
 TSC-sensitive apps are running and it is necessary to understand
 worst-case performance degradation for a specific hardware environment.
 
-=item * B<tsc_mode=2> (never emulate).
+=item * B<tsc_mode='native'> (never emulate).
 
 This is the same as prior to Xen 4.0 and is the best choice if it
 is certain that all apps running in this VM are TSC-resilient and
 highest performance is required.
 
-=item * B<tsc_mode=3> (PVRDTSCP).
+=item * B<tsc_mode='native_paravirt'> (PVRDTSCP).
 
 This mode has been removed.
 
@@ -200,10 +200,10 @@ per second per processor), this performance degradation is not noticeable
 OS-provided alternatives (e.g. Linux's gettimeofday).  For environments
 where it is certain that all apps are TSC-resilient (e.g.
 "TSC-safeness" is not necessary) and highest performance is a
-requirement, TSC emulation may be entirely disabled (tsc_mode==2).
+requirement, TSC emulation may be entirely disabled (tsc_mode='native').
 
-The default mode (tsc_mode==0) checks TSC-safeness of the underlying
-hardware on which the virtual machine is launched.  If it is
+The default mode (tsc_mode='always_emulate') checks TSC-safeness of the
+underlying hardware on which the virtual machine is launched.  If it is
 TSC-safe, rdtsc will execute at hardware speed; if it is not, rdtsc
 will be emulated.  Once a virtual machine is save/restored or migrated,
 however, there are two possibilities: TSC remains native IF the source
@@ -213,12 +213,13 @@ is emulated.  Note that, though emulated, the "apparent" TSC frequency
 will be the TSC frequency of the initial physical machine, even after
 migration.
 
-Finally, tsc_mode==1 always enables TSC emulation, regardless of
+Finally, tsc_mode='always_emulate' always enables TSC emulation, regardless of
 the underlying physical hardware. The "apparent" TSC frequency will
 be the TSC frequency of the initial physical machine, even after migration.
 This mode is useful to measure any performance degradation that
 might be encountered by a tsc_mode==0 domain after migration occurs,
-or a tsc_mode==3 domain when it is running on TSC-unsafe hardware.
+or a tsc_mode='native_paravirt' domain when it is running on
+TSC-unsafe hardware.
 
 Note that while Xen ensures that an emulated TSC is "safe" across migration,
 it does not ensure that it continues to tick at the same rate during
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 14 01:09:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 01:09:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563472.880651 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK7JO-00025t-BW; Fri, 14 Jul 2023 01:09:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563472.880651; Fri, 14 Jul 2023 01:09:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK7JO-00025m-8S; Fri, 14 Jul 2023 01:09:34 +0000
Received: by outflank-mailman (input) for mailman id 563472;
 Fri, 14 Jul 2023 01:09:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qK7JN-00025c-3t; Fri, 14 Jul 2023 01:09:33 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qK7JM-0000FQ-Rv; Fri, 14 Jul 2023 01:09:32 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qK7JM-0004Ab-IV; Fri, 14 Jul 2023 01:09:32 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qK7JM-0005nM-I2; Fri, 14 Jul 2023 01:09:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=nHVWS9fz0hIgR+iTZ7pbGqGOk19ola4yNG3Sv8jVUdU=; b=k1xJ23d5u/Rsr7u67kAqHzMQHF
	5Hj/eg0m22uxY8z7ZsGAu7shWYCEm9CMTQQxBrFRZZ6H56nuwkUQGbZcqbuBQuflse15Rizwx8U/S
	aHiSflmFng1/htfbDGUiSiJlcFYaV80kArCMtwgIe9RI/HOHqQZ748vxqmYPUoD7IWYo=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181788-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181788: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=11961f0a6700fb62edb17930fcf6c3f5453c133b
X-Osstest-Versions-That:
    xen=2acec876949e2488dfeffab3c531984b91d33cf5
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 14 Jul 2023 01:09:32 +0000

flight 181788 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181788/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  11961f0a6700fb62edb17930fcf6c3f5453c133b
baseline version:
 xen                  2acec876949e2488dfeffab3c531984b91d33cf5

Last test of basis   181784  2023-07-13 15:00:28 Z    0 days
Testing same since   181788  2023-07-13 19:00:25 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Julien Grall <jgrall@amazon.com>
  Luca Fancellu <luca.fancellu@arm.com>
  Rahul Singh <rahul.singh@arm.com>
  Stefano Stabellini <sstabellini@kernel.org>
  Stewart Hildebrand <stewart.hildebrand@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   2acec87694..11961f0a67  11961f0a6700fb62edb17930fcf6c3f5453c133b -> smoke


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 01:25:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 01:25:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563477.880662 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK7YY-0004cc-Mz; Fri, 14 Jul 2023 01:25:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563477.880662; Fri, 14 Jul 2023 01:25:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK7YY-0004cV-JE; Fri, 14 Jul 2023 01:25:14 +0000
Received: by outflank-mailman (input) for mailman id 563477;
 Fri, 14 Jul 2023 01:25:14 +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
 <SRS0=qN+J=DA=invisiblethingslab.com=marmarek@srs-se1.protection.inumbo.net>)
 id 1qK7YX-0004c5-TO
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 01:25:14 +0000
Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com
 [64.147.123.20]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 449879bb-21e5-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 03:25:09 +0200 (CEST)
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.west.internal (Postfix) with ESMTP id 30EDD3200990;
 Thu, 13 Jul 2023 21:25:06 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute4.internal (MEProxy); Thu, 13 Jul 2023 21:25:06 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 13 Jul 2023 21:25:04 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 449879bb-21e5-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm2; t=
	1689297905; x=1689384305; bh=K+hmV+BandF09R6ayynDHWnmwYWMzK4iZEH
	5qN9GllM=; b=jZ8RuRyK/Defac+RAJ8Ud4EV0nbwHfwuj2yAecB3QWhu9ZKldrf
	DUG/b5+HtIm/LuMhjh4aDV3ekUOsc2dLn4rJG2fsxdffEFQ1lcl8ygiMS8QOmPYG
	PATnE8piIPPw1ufUkAyiRag4X+r2D/8lTEvuf2UzpFWKT4dx+95Df+EsmopNOCSS
	/VcoEMOFMEd1QcBe9ROBYH/nZMlvfYvxTQJuq0rVRUwPRDOXYb+k9BuEYgRBkInY
	J5LeDVJ7JDWKMd6IbVCncLengEuE2SKT+xpH4AV5ERg9+Ff/jUptS/z5FaGN7SOM
	2i8K/ApeSfzOHBzVYQe3zkpd//3pBE74FSg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1689297905; x=1689384305; bh=K+hmV+BandF09
	R6ayynDHWnmwYWMzK4iZEH5qN9GllM=; b=geLcAqwPh4xQe/LXlTLXM/CTyOnps
	FhcDDuayeY+041QAFxmbUJtajGXT0TWHO+DZ0mnCWIiOCsf39m19Mfc+KxrPPWtQ
	48Chgp1DhErIERUt7Ku4UZ171BlXgOsNP0iNzgXZJYMLPjDVGzopceI1hNrcHbh8
	AFRyH7xpu8j46IMitMA8ChWDaZHrFzQH285thM/xCcp+oX6hWOnHqSARGSfq74AN
	qP0tT471YkBRiV0vpTztaVY2rkHL+sOmxQoNK//WYCt/wGnEhWdcvNESdLeeUK8m
	cGsLje4r5snvJjRZf4JGZ7N10jDcrwrTzhN8bg+aYMTWysOYnXvQuuTIQ==
X-ME-Sender: <xms:8aOwZHOmdLfGJXNQE3rqm_bnva017CGxjgMjBUgcLEP_kf579MDLvA>
    <xme:8aOwZB9NMF6w3TVdHuc6KBc5i4IvJmXwrgeqLibu2f0iFQkv3RFEP8N1vavSO2_dW
    tcMgNXcyGbNDw>
X-ME-Received: <xmr:8aOwZGQIz3H0_2A_UtF_j2cvfDdd8u-86Y_RReajaadOAxTWdN62Trebj6fU-mkCGZhRTnOnfaOeb6EIkC_02Ma5Qt-rd4k8sks>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrfeehgdegjecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpeffhffvvefukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpeforghrvghk
    ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh
    hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpefgudel
    teefvefhfeehieetleeihfejhfeludevteetkeevtedtvdegueetfeejudenucevlhhush
    htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhes
    ihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm
X-ME-Proxy: <xmx:8aOwZLvWwy_YFKTsssaX1FI2828RR-Qj9d_rc5fzpieNd_kSnO0-xw>
    <xmx:8aOwZPcz9qN6ZL4ceR_wDXAEi63eOOhbQpG4IyH_ewQZK20v2KIdSw>
    <xmx:8aOwZH2mHp3GuWf0AzLyCz65VkBRSJ-qipfCuEy24DQ1ijGj34cYBQ>
    <xmx:8aOwZHHe-hPEOjZfX4pPIIk7WEW_qDmjwFA2LH__VxMlm4m7_KiWOA>
Feedback-ID: i1568416f:Fastmail
Date: Fri, 14 Jul 2023 03:24:59 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Elliott Mitchell <ehem+xen@m5p.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: Re: [PATCH] docs/xen-tscmode: remove mention of numeric tsc_mode=
 values
Message-ID: <ZLCj62XMBbspMWbY@mail-itl>
References: <a8223a339a0b8ff3c0d04fb4ee2913c7558cc131.1689294071.git.ehem+xen@m5p.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="tb9bDuqycHXD16lz"
Content-Disposition: inline
In-Reply-To: <a8223a339a0b8ff3c0d04fb4ee2913c7558cc131.1689294071.git.ehem+xen@m5p.com>


--tb9bDuqycHXD16lz
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Fri, 14 Jul 2023 03:24:59 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Elliott Mitchell <ehem+xen@m5p.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: Re: [PATCH] docs/xen-tscmode: remove mention of numeric tsc_mode=
 values

On Thu, Jul 13, 2023 at 05:16:40PM -0700, Elliott Mitchell wrote:
> The better to encourage moving to setting via string mode names.

The numeric values needs to remain documented, otherwise interpreting
pre-existing configs (that may use them) will be tricky.

--=20
Best Regards,
Marek Marczykowski-G=C3=B3recki
Invisible Things Lab

--tb9bDuqycHXD16lz
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmSwo+sACgkQ24/THMrX
1yz9dgf/TJ1yGe0gcpJACMAYSRZm3ChzujQtCd3NM7N5CJBMBdvi8UlMJ9nQ1JyH
sL6iWQC4ULxBagrlL5jk2vC3IrDamx6lZeOJ6i3+xFnPBp2dEzwdkSVnPcOhaWrf
Bb70HVjKFygVN3Y8+gaZmYvwbdDnFk2Hk/dAxBCO1Btf2Hky325D6rxPd26Jz+gb
vpyIYDVOvRuOUWup4n2wSNYsBttgduAbzGCcVn5K9V/9GkMIceLmeMX+ErNn3gBu
7/NfreQ7ULXhxe9U0RvQBLLYut2Ej05ZfTmmnS2o97aZ8vu5qOICeBEpeWWD9viP
ng1XMez6EunFJsiq9t++tEvVf+KaSg==
=/ptM
-----END PGP SIGNATURE-----

--tb9bDuqycHXD16lz--


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 03:45:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 03:45:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563484.880672 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK9jw-0002zp-IJ; Fri, 14 Jul 2023 03:45:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563484.880672; Fri, 14 Jul 2023 03:45:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qK9jw-0002zi-Ey; Fri, 14 Jul 2023 03:45:08 +0000
Received: by outflank-mailman (input) for mailman id 563484;
 Fri, 14 Jul 2023 03:45:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Uaxh=DA=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qK9ju-0002za-UX
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 03:45:06 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d00a0794-21f8-11ee-b239-6b7b168915f2;
 Fri, 14 Jul 2023 05:45:03 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36E3ijv1000052
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Thu, 13 Jul 2023 23:44:51 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36E3iiCm000051;
 Thu, 13 Jul 2023 20:44:44 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d00a0794-21f8-11ee-b239-6b7b168915f2
Date: Thu, 13 Jul 2023 20:44:44 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: Marek =?iso-8859-1?Q?Marczykowski-G=F3recki?= <marmarek@invisiblethingslab.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
        Anthony PERARD <anthony.perard@citrix.com>
Subject: Re: [PATCH] docs/xen-tscmode: remove mention of numeric tsc_mode=
 values
Message-ID: <ZLDErKk8ziBuh1ZJ@mattapan.m5p.com>
References: <a8223a339a0b8ff3c0d04fb4ee2913c7558cc131.1689294071.git.ehem+xen@m5p.com>
 <ZLCj62XMBbspMWbY@mail-itl>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <ZLCj62XMBbspMWbY@mail-itl>
X-Spam-Status: No, score=0.4 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

On Fri, Jul 14, 2023 at 03:24:59AM +0200, Marek Marczykowski-Górecki wrote:
> On Thu, Jul 13, 2023 at 05:16:40PM -0700, Elliott Mitchell wrote:
> > The better to encourage moving to setting via string mode names.
> 
> The numeric values needs to remain documented, otherwise interpreting
> pre-existing configs (that may use them) will be tricky.

Problem is the way it is documented tends to encourage continued use of
the numeric values (notice how reports irt Zen 4 mention "tsc_mode=1").

`parse_config_data()` suggests the appropriate string value, so nominally
that should take care of older configurations.  If "xen-tscmode" really
needs to continue mentioning the numeric value, it should be in
parentheses and with "old value" to suggest moving away from that.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Fri Jul 14 05:28:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 05:28:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563491.880682 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKBLu-0006EI-Ov; Fri, 14 Jul 2023 05:28:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563491.880682; Fri, 14 Jul 2023 05:28:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKBLu-0006EB-Li; Fri, 14 Jul 2023 05:28:26 +0000
Received: by outflank-mailman (input) for mailman id 563491;
 Fri, 14 Jul 2023 05:28:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKBLs-0006E1-Jf; Fri, 14 Jul 2023 05:28:24 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKBLs-0007An-5L; Fri, 14 Jul 2023 05:28:24 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKBLr-0003Id-Jm; Fri, 14 Jul 2023 05:28:23 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qKBLr-0004jj-JF; Fri, 14 Jul 2023 05:28:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=iJ9sTwgAwzrJZag6RS3IBxeZednUy97g0fgLj5+VjQo=; b=h/x0pTWnzb1T7n6zWj8gwbki4i
	QEBOGcoYtth+/sOZshLfgiMne4ngR2sM5Y1kiPtD7yB9F1ROt9ISe8+SqVL9yQ6WEK4LAv9zEzej5
	1RFJZqzHIRmEAnsYW1cktPhKPat6Z5IPupX/8oHb7mOaaQCl0t+sN5HkJ574xfIGvr8A=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181780-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181780: regressions - FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-xl-vhd:guest-start.2:fail:regression
    xen-unstable:test-amd64-i386-xl-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=24909098fdb260da9ffd0ba733d3a540c8c61aec
X-Osstest-Versions-That:
    xen=0a834e953b01ec25c412369d7a5b8b57d340ac60
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 14 Jul 2023 05:28:23 +0000

flight 181780 xen-unstable real [real]
flight 181787 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181780/
http://logs.test-lab.xenproject.org/osstest/logs/181787/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-xl-vhd       22 guest-start.2            fail REGR. vs. 181777

Tests which are failing intermittently (not blocking):
 test-amd64-i386-xl-vhd 21 guest-start/debian.repeat fail in 181787 pass in 181780
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail pass in 181787-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181777
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181777
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181777
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181777
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181777
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181777
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181777
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181777
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181777
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181777
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181777
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181777
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 xen                  24909098fdb260da9ffd0ba733d3a540c8c61aec
baseline version:
 xen                  0a834e953b01ec25c412369d7a5b8b57d340ac60

Last test of basis   181777  2023-07-12 21:38:40 Z    1 days
Testing same since   181780  2023-07-13 09:21:22 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 24909098fdb260da9ffd0ba733d3a540c8c61aec
Author: Stefano Stabellini <stefano.stabellini@amd.com>
Date:   Tue Jul 11 13:21:45 2023 -0700

    docs/misra: add Rule 9.3
    
    Specify that {} is allowed for zero-initialization.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 06:51:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 06:51:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563502.880695 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKCeJ-0007V7-QG; Fri, 14 Jul 2023 06:51:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563502.880695; Fri, 14 Jul 2023 06:51:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKCeJ-0007V0-Na; Fri, 14 Jul 2023 06:51:31 +0000
Received: by outflank-mailman (input) for mailman id 563502;
 Fri, 14 Jul 2023 06:51:31 +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
 <SRS0=Wozw=DA=gmail.com=christopher.w.clark@srs-se1.protection.inumbo.net>)
 id 1qKCeJ-0007Uu-Bl
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 06:51:31 +0000
Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com
 [2a00:1450:4864:20::536])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dbf9f290-2212-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 08:51:29 +0200 (CEST)
Received: by mail-ed1-x536.google.com with SMTP id
 4fb4d7f45d1cf-51cff235226so3160288a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 13 Jul 2023 23:51:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dbf9f290-2212-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689317488; x=1691909488;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=3MCw20tAWoO5aflvCjSt/1lyaGgqvUru1X3wubOp2Xo=;
        b=IHbKWk8sIS92GhORHdC31LhE2lUpO3dlvDlSELYZm+hBXoVCE8ZiDnDopAieHFRHsz
         YSeAGFKnCSNWQ3dhIHCtN5Bmpdo3nS0KGOEX8JpsGaW0EAFEbhcSyfm3Qmo43dMI0f8d
         Vik1iEZrD/vBvpg/dQhtuEjRUqwHyig3gLYQbl/Eo2wsejWUbSfoY6cojJzloqwFsTsJ
         GUaNV2QgFQaZE1r1vznh+bYtWO8YiDgj97X9L41ZbkHTSx4TRPbgAyiQSZ0takJZ9GHn
         Icm8/rVZ/zt3Jrt9b2MMW+2aIpcpdU0AQOnNxHWm+zY3rU7tWDa14wlxZRTj3whD/+ac
         7h2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689317488; x=1691909488;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=3MCw20tAWoO5aflvCjSt/1lyaGgqvUru1X3wubOp2Xo=;
        b=abAkAnLTvgwmcLrF5XGttJiFOH9srbFWszpjxQJxVbWtW5RZKxLeShtQjPJXd2af7H
         zjSNxmB/C+ejD/dWa4GwhodiUNfgGhFvb80dJVJ/03To/G7muAvUxetPVQfKYUH7tL/T
         QbXs6K4fqINdHYPeJqacoeLEJWzAmHK+T2n9Qbcqrz43nr0JYDau562WR3QEjJQvegbf
         f+O817UoYrJgdYhRabm0sOnRe5cdj+2gdO8zmQbVmBfX3V+u6mUCnzynOpPX2LbKuuGL
         gZ00AoJySdYjc3DDmed7cbLE6vIes7/qQBHhiZrr+GrDMns0clDWgdPNSL5OJGx/t7o2
         UKzg==
X-Gm-Message-State: ABy/qLbGyjMqshdkE01FdUGxO2G7dL2IXjXi3DTw9zuonjtqY4DSZWOy
	9Cu054tOinLWM6IOd2BJUTmLKWouPNscob5N730=
X-Google-Smtp-Source: APBJJlEDP3CU1w1GiRakphj9iwv6kHH3u5HoOsV/rH3PPimleeE+ELxI2L28013jqFdRcAu60rbSJYQQlPcM8D6mbYE=
X-Received: by 2002:aa7:d852:0:b0:521:6275:c9af with SMTP id
 f18-20020aa7d852000000b005216275c9afmr707206eds.7.1689317488393; Thu, 13 Jul
 2023 23:51:28 -0700 (PDT)
MIME-Version: 1.0
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
 <20230701071835.41599-4-christopher.w.clark@gmail.com> <alpine.DEB.2.22.394.2307081144340.761183@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2307081144340.761183@ubuntu-linux-20-04-desktop>
From: Christopher Clark <christopher.w.clark@gmail.com>
Date: Thu, 13 Jul 2023 23:51:16 -0700
Message-ID: <CACMJ4GYE6PW1SY35dhs4XkXd9ru25igrvMCrh4pJMWEBNNz0YQ@mail.gmail.com>
Subject: Re: [PATCH 03/10] x86 setup: change bootstrap map to accept new boot
 module structures
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, 
	Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
	Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, 
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, 
	Bertrand Marquis <bertrand.marquis@arm.com>, Luca Fancellu <luca.fancellu@arm.com>, 
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Rich Persaud <persaur@gmail.com>
Content-Type: multipart/alternative; boundary="000000000000cf00e506006ce04c"

--000000000000cf00e506006ce04c
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sat, Jul 8, 2023 at 11:47=E2=80=AFAM Stefano Stabellini <sstabellini@ker=
nel.org>
wrote:

> On Sat, 1 Jul 2023, Christopher Clark wrote:
> > To convert the x86 boot logic from multiboot to boot module structures,
> > change the bootstrap map function to accept a boot module parameter.
> >
> > To allow incremental change from multiboot to boot modules across all
> > x86 setup logic, provide a temporary inline wrapper that still accepts =
a
> > multiboot module parameter and use it where necessary. The wrapper is
> > placed in a new arch/x86 header <asm/boot.h> to avoid putting a static
> > inline function into an existing header that has no such functions
> > already. This new header will be expanded with additional functions in
> > subsequent patches in this series.
> >
> > No functional change intended.
> >
> > Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
> > Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
> >
>
> [...]
>
> > diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
> > index b72ae31a66..eb93cc3439 100644
> > --- a/xen/include/xen/bootinfo.h
> > +++ b/xen/include/xen/bootinfo.h
> > @@ -10,6 +10,9 @@
> >  #endif
> >
> >  struct boot_module {
> > +    paddr_t start;
> > +    size_t size;
>
> I think size should be paddr_t (instead of size_t) to make sure it is
> the right size on both 64-bit and 32-bit architectures that support
> 64-bit addresses.
>

Thanks, that explanation does make sense - ack.

Christopher


>
>
> >      struct arch_bootmodule *arch;
> >  };
>

--000000000000cf00e506006ce04c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Sat, Jul 8, 2023 at 11:47=E2=80=AF=
AM Stefano Stabellini &lt;<a href=3D"mailto:sstabellini@kernel.org">sstabel=
lini@kernel.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad=
ding-left:1ex">On Sat, 1 Jul 2023, Christopher Clark wrote:<br>
&gt; To convert the x86 boot logic from multiboot to boot module structures=
,<br>
&gt; change the bootstrap map function to accept a boot module parameter.<b=
r>
&gt; <br>
&gt; To allow incremental change from multiboot to boot modules across all<=
br>
&gt; x86 setup logic, provide a temporary inline wrapper that still accepts=
 a<br>
&gt; multiboot module parameter and use it where necessary. The wrapper is<=
br>
&gt; placed in a new arch/x86 header &lt;asm/boot.h&gt; to avoid putting a =
static<br>
&gt; inline function into an existing header that has no such functions<br>
&gt; already. This new header will be expanded with additional functions in=
<br>
&gt; subsequent patches in this series.<br>
&gt; <br>
&gt; No functional change intended.<br>
&gt; <br>
&gt; Signed-off-by: Christopher Clark &lt;<a href=3D"mailto:christopher.w.c=
lark@gmail.com" target=3D"_blank">christopher.w.clark@gmail.com</a>&gt;<br>
&gt; Signed-off-by: Daniel P. Smith &lt;<a href=3D"mailto:dpsmith@apertusso=
lutions.com" target=3D"_blank">dpsmith@apertussolutions.com</a>&gt;<br>
&gt; <br>
<br>
[...]<br>
<br>
&gt; diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h<b=
r>
&gt; index b72ae31a66..eb93cc3439 100644<br>
&gt; --- a/xen/include/xen/bootinfo.h<br>
&gt; +++ b/xen/include/xen/bootinfo.h<br>
&gt; @@ -10,6 +10,9 @@<br>
&gt;=C2=A0 #endif<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 struct boot_module {<br>
&gt; +=C2=A0 =C2=A0 paddr_t start;<br>
&gt; +=C2=A0 =C2=A0 size_t size;<br>
<br>
I think size should be paddr_t (instead of size_t) to make sure it is<br>
the right size on both 64-bit and 32-bit architectures that support<br>
64-bit addresses.<br></blockquote><div><br></div><div>Thanks, that explanat=
ion does make sense - ack.</div><div><br></div><div>Christopher</div><div>=
=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 struct arch_bootmodule *arch;<br>
&gt;=C2=A0 };<br>
</blockquote></div></div>

--000000000000cf00e506006ce04c--


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 06:52:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 06:52:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563504.880705 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKCev-0007vd-3E; Fri, 14 Jul 2023 06:52:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563504.880705; Fri, 14 Jul 2023 06:52:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKCeu-0007vW-Vi; Fri, 14 Jul 2023 06:52:08 +0000
Received: by outflank-mailman (input) for mailman id 563504;
 Fri, 14 Jul 2023 06:52:08 +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 <SRS0=dZ6j=DA=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qKCeu-0007vB-Fr
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 06:52:08 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2087.outbound.protection.outlook.com [40.107.7.87])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f212ef9e-2212-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 08:52:06 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM8PR04MB7956.eurprd04.prod.outlook.com (2603:10a6:20b:241::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.27; Fri, 14 Jul
 2023 06:51:50 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Fri, 14 Jul 2023
 06:51:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f212ef9e-2212-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=aVDP3nPy7dRKsYRhVdkNoeLRh8AHGCxGavHbBBgH1BpbLvZRkwBsLRypDTc4LM5tOIXkJKgRAeFT5mkvCvnf3gY9w+VPbyKM2u9jPkbYXSeGKqFNm1AlDHR2LvHNHMEkdJjGf7fO/PB6fIVIB7M2YNnEt1nj1XN1lV/ymO+ghvCAexHN0nUxE9iadsC/9ordYIcuh1SpNO7LtLqzOFIVBzoh73DICa5o4u9+KSEWAa3d2NqhcxQnCChFwLR9x1U0tV+0BaMFl3/I9ij1FEL02iYZVRDUDCveZG2EqLbKxfxkuuPsdMvLi9fK33Jz7MFf2jkIX/eZBhpMvTZBwWnjyA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=PtMzgE20PQLWoqCkkdtvNnvCCaNzYzyeTwbepSPpx3k=;
 b=b+E35pF8AxDw2+/OOZ4Iy2W6V7WR5Cy/cMSQwDhnfMzOuoYvQQgVKyHPl4EtZK2eDb2ykdMKRGEMEMUzmlkw9boN44TnMjjkiRXcjN6MalOx/oEgls1OvnJzdOhIGCBJucDi8zCfuY/NBV4iCBPSlKc2yN72KSfjcSD+a3TI91vW3FGRfg94AA2GK+cTX6eyq/Kwz3tBA9WFgqHZRdlVm2iIBQpQH2UGSTOHdjAo453/qfMcHDPBtFZaDiTaAaDOWlubl7dkMyc4MCBgEB7fw+pWJUzFm64PLd/5YDkyr8q5DbQHsIkLu6dutbzGgOfDUAk38lP3HoEd7iXhXSXH4w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=PtMzgE20PQLWoqCkkdtvNnvCCaNzYzyeTwbepSPpx3k=;
 b=hYYjQ0NalIlO92gRufnKuDQ9/F/2Cm3aikQO5GnKtEc1vmEeUhCt/c4hIhq/M8vkeE/VdBqWkXlAWWXUQRYGOWWGA7htRHVXKBAVIBOgNYHtCCT3MIjQurvyzM3r9D4vDkahM1s979dtagD5OHNtvbprdja4/EyGMppNeiR+8vi1A6v8f5LWKhDwDWrw3iz7tnJPaCfwLcPnEo4AwzM9zl8Z7PjQ0wQMEh4fWspxvMVdffpdsm25SUX1fuWTgA218Ulp7jYqYUij7VwYmvY/Likrz/GZ/BjdL+T0fmVysK4lEa1J3UeXpc1USu6wQcVsv8UPpu46oW8pqd2tk5qaGw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <564c0a96-a0ff-72fe-1148-882ef9beb6a5@suse.com>
Date: Fri, 14 Jul 2023 08:51:48 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 2/3] x86/APIC: modify error_interrupt() to output using
 single printk()
Content-Language: en-US
To: Elliott Mitchell <ehem+xen@m5p.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1689191941.git.ehem+xen@m5p.com>
 <7771343b52e6769d7670ad73094f5276025a10fe.1689191941.git.ehem+xen@m5p.com>
 <3b16e1d8-acfb-8dd4-763b-57908ea6a2a1@suse.com>
 <ZLAqlsvIvzOPMdOV@mattapan.m5p.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZLAqlsvIvzOPMdOV@mattapan.m5p.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0011.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1d::17) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM8PR04MB7956:EE_
X-MS-Office365-Filtering-Correlation-Id: b5396271-3bc9-4c3c-f92f-08db8436cc88
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	M2/eaYJcZyzbdA4FbgA6FX3+OtihpVb7c0GG0p93k0VElJhZDeuTS4KWD8G4mzPHVFC0SV9qUmB6P8b4gBYPAKL63v4yl2pkk2nMb7peURCCy3mj2Zo0M4S/xmTOFk1AjNQTOygUnrlgOzb2p2sSDBmH3SXlPDQ6WeQ3UaRifPAT3e9eUFY61Zdk234Eelbw288V32MgiV9fyofVrYXNAOd2WocONf46RdK3x7fjYtbI/kcQUhC/GSVV11dvDrFCJIWmo87Nb/J9mj+ZrrjXoy7YL30TystztUhfXcuar1y8UWgwhAuUBaBffJ9uuXLUInK0YKg1oArjfTdSqCqErS3NiMty6/q8+shUl2Bca4KRulhgIoAYT16dJR+uxPE9kuTw0o0NWLVpROHzRwyMYSEaqYIluVHa2PoRxWaWFzyDLZuZsrJx62Md6Q4Qk452QU8bdpboDhWJJBEPdZucc/GV7oCiBMT3bY/qvG5nfRvUyhtMmeUpHY3+AMmWRRBrSrivB2CK0EABObKw3aDrJxVrryCVs63ioba44RfZUg2SUkKeqfJTHzaFE4UnECa0vvor5peb21YdS9gwtz3gDQFg4toEpwZ/aB9SKjVxmvVRUE22WANXb1DiBE4DumGsBvlm+/O5jyta2gkFP4tA4Q==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(376002)(366004)(136003)(346002)(451199021)(6512007)(6486002)(186003)(2616005)(38100700002)(36756003)(86362001)(31696002)(26005)(6506007)(53546011)(4326008)(66476007)(66946007)(66556008)(54906003)(41300700001)(5660300002)(31686004)(316002)(8936002)(8676002)(2906002)(478600001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dmRuVFlDUkM1RXEvTkkzK0JsQVBzQ2luSzVVU0VrOFBaajB5eHRXL2w2blBV?=
 =?utf-8?B?MVhLeCtjMGtvK21TYmt2VVR6N1FyVi9FQVBBV2tqUG8rbHZPdzdVVTA5WlRS?=
 =?utf-8?B?MjJpNnJqUlYxV0E4dzVjVHQzVHozOWppQXdlNUN3d3JoOEFXMWZERkxOTmNi?=
 =?utf-8?B?VnphRll1cFg3OWRVaFpVZXNSQUpnWUNqTlRDalVBSVJQZTBPTHJ4WGtUMHRZ?=
 =?utf-8?B?WTBGa1gwb25lRXdvM3ZxRnNuMG9LWDN4aGJSZW5jSzd2Z1o1UzdTMTFrS3lh?=
 =?utf-8?B?TnpUS29vbzBEOTlKY0VYZFhrNlY5dnZnUmk0REhwNndTcmNNUmx4VGFZdFlv?=
 =?utf-8?B?TnJ2bmZVejhSZzF5UjVx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tvIgbFibw7?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b5396271-3bc9-4c3c-f92f-08db8436cc88
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 06:51:49.8670
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: UH6Igm8/COngR/wxxcl8MTUF6080Z8jFds9gKTPL+sL91+8tBkFzRSQiNrOMNdYxJq8MG3Dr6tdPRnklGx+lWQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7956

On 13.07.2023 18:47, Elliott Mitchell wrote:
> On Thu, Jul 13, 2023 at 03:12:55PM +0200, Jan Beulich wrote:
>> On 17.03.2023 20:53, Elliott Mitchell wrote:
>>> --- a/xen/arch/x86/apic.c
>>> +++ b/xen/arch/x86/apic.c
>>> @@ -1419,12 +1420,13 @@ static void cf_check error_interrupt(struct cpu_user_regs *regs)
>>>      v1 = apic_read(APIC_ESR);
>>>      ack_APIC_irq();
>>>  
>>> -    printk(XENLOG_DEBUG "APIC error on CPU%u: %02x(%02x)",
>>> -            smp_processor_id(), v , v1);
>>>      for ( i = 7; i >= 0; --i )
>>> -        if ( v1 & (1 << i) )
>>> -            printk("%s", esr_fields[i]);
>>> -    printk("\n");
>>> +        entries[i] = v1 & (1 << i) ? esr_fields[i] : "";
>>> +    printk(XENLOG_DEBUG "APIC error on CPU%u: %02x(%02x)"
>>> +        "%s%s%s%s%s%s%s%s" "\n",
>>> +        smp_processor_id(), v , v1,
>>> +        entries[7], entries[6],
>>> +        entries[5], entries[4], entries[3], entries[2], entries[1], entries[0]);
>>
>> While pre-existing in both cases, two nits: There's a stray blank before one
>> of the commas, and indentation is wrong too.
> 
> I don't see anything which could be called an indentation error.  The
> very first added line is attached to the `for ()`, therefore it correctly
> has one more indent.

It's the printk() invocation, where all continued lines lacked another 3
blanks.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 06:56:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 06:56:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563508.880715 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKCjG-0000Dx-KP; Fri, 14 Jul 2023 06:56:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563508.880715; Fri, 14 Jul 2023 06:56:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKCjG-0000Dq-H9; Fri, 14 Jul 2023 06:56:38 +0000
Received: by outflank-mailman (input) for mailman id 563508;
 Fri, 14 Jul 2023 06:56:37 +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 <SRS0=dZ6j=DA=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qKCjE-0000Dk-Uj
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 06:56:36 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on20623.outbound.protection.outlook.com
 [2a01:111:f400:fe13::623])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 920412db-2213-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 08:56:34 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by PAXPR04MB8237.eurprd04.prod.outlook.com (2603:10a6:102:1cc::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.27; Fri, 14 Jul
 2023 06:56:32 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Fri, 14 Jul 2023
 06:56:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 920412db-2213-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=bn+S4urDe7l3KPug+tDjaXs7CgTvH9v9lZcPyzV9ZsOiXkD42Q8zumCqIxXMD9Up3ZNviIxWxJ7Ezu+iLbga5Hpl7b/jdXnQpNQXX73X0p5HCeEL558E+6D0XdnNnwnmESDtpuEP5oj2sIFm+vQtDl+FHkUGSSrTPNjCac/R85kt7suuZ9QwIWZsF+mvZiNxa5e9XJ7yQiae3VSQc6BDEgWqb4Q4nAIjwzCTn/burH/tG+8VGZU9iiRjc7PB3VBpBZ0NXcQI65xQI4ylInkL2uiYl3j9FjYD07a59OkshIYwgZfmiH1P80SSXaAdfSOnaaneBn9bhvgbpJBC3L+48g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=GsOLB+E0eqbsGn9k6wi61DOmyWFBtrf71/o8iat64fA=;
 b=a8w9PBYT7Whbr/Gl4G/6esthXiudZS1K5KVAXTqT/JQZcEnoSPf5VqB+gkdDu8TxEfbSrsbIB24dWzJQ1nwK+NcPfeNPev5wUE8w4hZDL216vtniqzeO6fZ+lCsVDVMLueqr/ii6ndLXlgagSBhKf8RhZTTsYA7RdokbiFphsvQS+/shmfQQt9P4dHs76frW+buimixEzr4SfrJHTpQ7wqE9/U3P3gxYAUlxbDUYhdlHrnlYl447FM0Pv1pMFv9eXcsr+GT82/OU5pwY3TGTnSeDMk2MloBwx8byFhA/wccdAl+ijmkRvuFbWzUJmPdm4iWrwtcwFIE/RWjKjDrPYQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=GsOLB+E0eqbsGn9k6wi61DOmyWFBtrf71/o8iat64fA=;
 b=HyMd4IQjyhW38rZnhl++DLMok52eUkgQYowG24JIILWXp0qbyXUXIArupLmwtPWz8U1KYysQY9cBLsZYWqqr4yvrUNrmh2eHPtzsyFKxyWU2VCKRVU6ToJFNi4AYVJ8u1gBFy91ptvmUBHPjcvcw8dkgL71dUV34hXwinCnCMSZIk8WGmnx6z+RI/droj5gmzXn/HdP0AgOUEy9N/RkhHOKGlX7C45ge1pLxjM+pKHm3TnmAMnc+x7AQFAFggsYFQeNYdI7NFclCC+CJ5rAB8FYvwAysk8MndWQaANtTyMJddUT/i59SPsWrR7SnWeOAJOs2PzuGzFcyGjasQbMIVg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ed458992-b1c3-527c-4372-67355a5616e0@suse.com>
Date: Fri, 14 Jul 2023 08:56:30 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] ns1650: refactor interrupt handling in
 ns16550_uart_dt_init()
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org, Julien Grall <julien@xen.org>
References: <cc5a08056abacdbb6d6509b56716eb45467307bb.1689240611.git.oleksii.kurochko@gmail.com>
 <a385a17b-a60c-d770-e044-af64273371d6@suse.com>
 <86702f86787ee7b963b131c4b2d6db463eddc1f3.camel@gmail.com>
 <3e4c673d-1b8b-15ab-629f-27a9f687b37a@suse.com>
 <83f67337cb69fb8cf2aa5d56b8a711384cdaa5f0.camel@gmail.com>
 <200693a2-267d-16c8-61f3-3047dc8967da@suse.com>
 <9415dc2fe8c8ca0325ba6dfe41fdf72cb0f2ea0a.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <9415dc2fe8c8ca0325ba6dfe41fdf72cb0f2ea0a.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0119.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a8::17) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|PAXPR04MB8237:EE_
X-MS-Office365-Filtering-Correlation-Id: 6718b846-fd9c-4fa5-64a8-08db84377510
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Aj3pZX+WdnNczWqcxiz9lVopV3cD4IoemphaUjIkYbGO9OO8BUjnU0musFBj+l7C4+iKb4O+SeiakIt+6K4EFv2qWh7uY71erIce8TnvmqEIoI3wHOL+wfeM94ceiRsSYfIW7OmO5nEDxMPML6Qyt4/GRq+C0gsotjY3Qe/3FOVL2zrsj15mTrJ+SKivZr3PoSJNlHWNlAvmgIPuTN1ixUvJzxRQFbDtJPYQyeKvNFW58i/j/d08eIBfNkiDR15clpYn4+uyk+AL8pZ1gr0WFcd55hyHnXVMgGHDQYh2lrSvervtANbec3dfJRBwGoQrefzzwMgxNdZa/nTMY5qbjFgW6v87dBvkU/Ud6IJeQ/7kvciNvqCvTapu5cmRilHzDyHUfVBS/TRe1Ie05xHEBYbLIiav2ELspDHVMYVlAOXNzFTtfbBIClr3sS475HyEKVdvDzqAyxBZHbGpA0FgXj8EJfh8AQCGsY9s5ee4KOtin7+nGuQToQRu1JnHu3fkbV+orbRDKZaMivXG1vuHvq3AwySeE8Fmp/gnNHb66reejPV9p/eOH8PZ4UA4FVRfsc1RTIiBVfXwgskxrAizbrvGMbnLihyJaQTRQbYTKZxr+i+NehuvBFIfsnrXZJ93
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(396003)(136003)(366004)(376002)(39860400002)(451199021)(38100700002)(36756003)(31696002)(86362001)(31686004)(8936002)(5660300002)(6506007)(53546011)(54906003)(8676002)(41300700001)(26005)(186003)(2616005)(2906002)(966005)(6512007)(66556008)(4326008)(478600001)(316002)(66946007)(66476007)(6486002)(6916009)(43740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0M2pPZEdqeERoYnYyT2tjSXZ0bnRNVG9hVkZ6bWRX?=
 =?utf-8?B?aWl5WHBRWUh3VTdiNzRDdHc2OHpraC9zRVJtRVQ2Mm1FWkE4YXBDblZwMlhQ?=
 =?utf-8?B?K1dza1hvakUyQXcrQzJ5WHJHRXl0d1dWeXZDVmFKc0ZncmtlR0V0MXUyOTBL?=
 =?utf-8?B?L1hEK3I4RnZmTGdkaU81RkRuRXFCYUNRK01JdDkvWDJ5TlhQbk90c0RnbWlu?=
 =?utf-8?B?KzBJblJtTXFGdUNXZWdDTmFKcE5DUnFvYU5zWm1jemtVaVpPaExxMy91QVc4?=
 =?utf-8?B?OFR2b0g3S0kreU5oaUFlcXFOQmVkb1pUUDUySHN3VTlwR3V4b3E1R0VGZ28v?=
 =?utf-8?B?OUMyS2xBNVBlNjMrWVZDamIrN2lFQ0w1aTVWSzVGeUJLMzFDU0hwb1M4Njdy?=
 =?utf-8?B?NVNCejJaZmt1TjVDUDZDYUl6ZFJXTUhCcllsSjBpdzNKeTdKR0M1M0VWK3VR?=
 =?utf-8?Q?kOp1kCnJ5ff6zFY0Q0hB/Il8u?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6718b846-fd9c-4fa5-64a8-08db84377510
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 06:56:32.6052
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: d2i7Af4soRswuWgm1MFHAVFN3k8pZFl+um5zdKNOwKTUQLHFEQ9KDpqW8XhRrlsph2lw2yMEnThX8MMm9BxA+A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8237

On 13.07.2023 19:49, Oleksii wrote:
> On Thu, 2023-07-13 at 16:26 +0200, Jan Beulich wrote:
>> On 13.07.2023 15:36, Oleksii wrote:
>>> On Thu, 2023-07-13 at 15:27 +0200, Jan Beulich wrote:
>>>> I don't understand. My earlier comment was affecting all checks
>>>> of
>>>> uart->irq alike, as I'm unconvinced IRQ0 may not possibly be
>>>> usable
>>>> on some architecture / platform. IOW I don't see why the check in
>>>> ns16550_init_postirq() would allow us any leeway.
>>> It looks like I misunderstood you.
>>>
>>> Do you mean that on some architecture IRQ0 may be used for ns16550?
>>
>> Yes, I don't see why this shouldn't be possible in principle. As
>> Julien
>> said it can't happen on Arm, so if it also can't happen on RISC-V and
>> PPC, we could elect to continue to ignore that aspect.
>>
> Then for RISC-V ( at least, for PLIC interrupt controller ) it is
> reserved:
> https://github.com/riscv/riscv-plic-spec/blob/master/riscv-plic.adoc#interrupt-identifiers-ids
> 
> What about to have 'define NO_IRQ_POLL 0' ( mentioned by Julien )+
> assert(irq_from_device_tree != NO_IRQ_POLL) ?

Such a #define may be okay as long as indeed used consistently in all
places where it belongs (which may mean making some code less simple,
which is a downside), but I can't judge at all the validity of the
assertion you propose.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 07:05:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 07:05:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563513.880724 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKCrK-0001tg-HW; Fri, 14 Jul 2023 07:04:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563513.880724; Fri, 14 Jul 2023 07:04:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKCrK-0001tZ-EJ; Fri, 14 Jul 2023 07:04:58 +0000
Received: by outflank-mailman (input) for mailman id 563513;
 Fri, 14 Jul 2023 07:04:56 +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
 <SRS0=tSc+=DA=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1qKCrI-0001si-Hh
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 07:04:56 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on20616.outbound.protection.outlook.com
 [2a01:111:f400:7eab::616])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ba8bc954-2214-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 09:04:53 +0200 (CEST)
Received: from DM6PR02CA0102.namprd02.prod.outlook.com (2603:10b6:5:1f4::43)
 by DM4PR12MB6446.namprd12.prod.outlook.com (2603:10b6:8:be::7) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.27; Fri, 14 Jul 2023 07:04:49 +0000
Received: from DM6NAM11FT096.eop-nam11.prod.protection.outlook.com
 (2603:10b6:5:1f4:cafe::bd) by DM6PR02CA0102.outlook.office365.com
 (2603:10b6:5:1f4::43) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20 via Frontend
 Transport; Fri, 14 Jul 2023 07:04:49 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 DM6NAM11FT096.mail.protection.outlook.com (10.13.173.145) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.22 via Frontend Transport; Fri, 14 Jul 2023 07:04:48 +0000
Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 14 Jul
 2023 02:04:48 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com
 (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.6; Fri, 14 Jul
 2023 00:04:48 -0700
Received: from [10.71.193.39] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Fri, 14 Jul 2023 02:04:46 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ba8bc954-2214-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=S36bVp3W8wnfJK/5awi0/ENvMxU9OJoNqyzbTVyDZ6SledleYSemh0ETKdgedRGZM17l4Khfc+DoM1ar9hRuu2i5gtgS0Q0HjBe30B9QH/wo3maLETp435kssVsJ2EQeSvO9dPy4DXtvWSLYVjILwahoSOzgzKjJCPObL2jB5KAs5Z8svKxRN8l76dzTTPL0reP5HZmOwsazxZT/KxriP3BxFLZN1p8WMAoHzNCxXSgcgJQm4vHXrJUn0BK9kAnPBdEm0mi/V4NFb3OLLQXbgW8k+OQguIz4QDI3XwLuS6jj1oX27qCiYl5VLziJc+u1k4cfzfTL7Kl6/OVXjexQBQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=VXrvwGb8dSFJ8qc6mgpnsoDY3de+1hPw34SHHHbfNAA=;
 b=NHlvJvAAsTU7G1hagFHYwSNBs8rLt6j0fgRcoxiOACvum7iM532JT1qO9U0xLfh0MGegBhb6qymbokZmpioTBX/ud6ZGRIT1qmS2gTPcYxws9QBdp/Edpr8lPTGn29tDxhPjge+3WLr76R3YKD39bxBupbuc4p5BAXKO+AMA33yQSuufHQqSmNawMtCqWv4s8FsWl+fGmrdjFxy07EtPk6vYRZ9VfQe7yfERQqsWDJuwPjRpoAYF5V2o2wrM8982K7wfKUcgz8MEzE7xMaJ85Ercleuu+Hx0BP38li43Z9bRqOYd67vP4VJmWX2qlFSLDbrecu9//Bnya2xEmT/UUQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=VXrvwGb8dSFJ8qc6mgpnsoDY3de+1hPw34SHHHbfNAA=;
 b=kFr4IvqezLobxIZfHy64VqiTpe8zJbFMATt1X7TpknIFnFlBRMV0qjpX9oc7OCJETaf8ue7WOhloiwd4xUKexP45LLbAaVahSdb174Fofe4yspO0ltAH9SQo/ec9PNejmD2iIWDRe2ueSevL7F73jffZvHhU0ePFa0u4SySoKBs=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <4ba51e3c-d6c4-5d0d-1517-fceebbe516e6@amd.com>
Date: Fri, 14 Jul 2023 09:04:46 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 2/2] xen/arm: Account for domU dtb bootmodule size
 separately
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230711082931.5402-1-michal.orzel@amd.com>
 <20230711082931.5402-3-michal.orzel@amd.com>
 <8bc1ed0e-3ad6-2243-4dd6-a88dd0ee00f8@xen.org>
 <b39b19a4-9649-173b-bb05-518702d05873@amd.com>
 <66997c9c-d0d9-fce3-e5bd-a4f41cf0de91@xen.org>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <66997c9c-d0d9-fce3-e5bd-a4f41cf0de91@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DM6NAM11FT096:EE_|DM4PR12MB6446:EE_
X-MS-Office365-Filtering-Correlation-Id: 2fcb1ac1-faac-4ef0-bff7-08db84389cf3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	GbVl3a5rKh3FPMcBFCmpr9lpU0trLvtliu2S8gz5MCXrsiIFEo5rZj9bo8MxpNXB8sMwxe4ZYj+mbfkZ3FIGIwBSVF67+BA9dcSXL19oIU9FhKN2lAmAzmmAEXOWKV4xG/G63Oxsilvzv5GYE6jgPmOHfwmJ9uMVkBMe8Y0dvk+ZvVFoLCZ93kJOCcey+Aa0KtDUrcfbolh0DaQcrRuWQGUQLgGyDtx8ZY8hflu6dfK7my8x/bJq6whGjcYi98hhzqVpZQaGOQbUzV90F1wj6KGSdbZ8kHt7zS6AdHirH8SOmULk/eGlgNO2cgWPEXa0+4Q0AXSHiZIMyyIa2AJl9vyj/eEbzl4UXfijnudpMmB6SB62Uad/VHMitb6WkOPxJFROxQw0a61STcp6F/Nz6U7ZOgOZThmvvrej5aw27FfGXHNZ/YgBDoPwL3ex/Ld7K/RYI4iGNpTZ6CFMcVEwb3NvsG3C0uWYUKXprami77+uaelfx6iWQMA82tqYKAlgqwDBv5z4WUrStUvra4z19cNn/4T4O90EzVhGK/NqUSuS+lCU2jJ0oDtHqgDTLESW6ixohcNWx0aXBCsLL2c9WrxPRflZD+0WSKgipBZDz3PItM9JkYzh4aDgCRsm2OvUz8UNx8/uXjVrHsN/PzrW/BrY79j82S0dVF+mcbAMIVrw85N9RCUZBXlbSx79t7dFYSzo6p7miplSQ4ew8JVYkw/w4Z/O1r0c5xCPQEX6Po44TI67FJfYgBhEsF8NXchR1a24JiFHyBZxdxD4rFd1EAoOFJg7xMkS3Bid7EM6UpvGfOc//YCv32Zbayvz8TsY
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(346002)(376002)(136003)(451199021)(36840700001)(40470700004)(46966006)(40460700003)(4326008)(70206006)(70586007)(82310400005)(356005)(81166007)(31696002)(86362001)(186003)(26005)(53546011)(36860700001)(82740400003)(47076005)(83380400001)(336012)(426003)(2616005)(36756003)(478600001)(110136005)(54906003)(40480700001)(16576012)(41300700001)(31686004)(5660300002)(8676002)(8936002)(15650500001)(44832011)(316002)(2906002)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 07:04:48.8531
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 2fcb1ac1-faac-4ef0-bff7-08db84389cf3
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DM6NAM11FT096.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6446

Hi Julien,

On 13/07/2023 20:15, Julien Grall wrote:
> 
> 
> On 12/07/2023 08:01, Michal Orzel wrote:
>> Hi Julien,
> 
> Hi Michal,
>>
>> On 11/07/2023 18:07, Julien Grall wrote:
>>>
>>>
>>> Hi Michal,
>>>
>>> On 11/07/2023 09:29, Michal Orzel wrote:
>>>> At the moment, we limit the allocation size when creating a domU dtb to
>>>> 4KB, which is not enough when using a passthrough dtb with several nodes.
>>>> Improve the handling by accounting for a dtb bootmodule (if present)
>>>> size separately, while keeping 4KB for the Xen generated nodes (still
>>>> plenty of space for new nodes). Also, cap the allocation size to 2MB,
>>>> which is the max dtb size allowed.
>>>>
>>>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
>>>> ---
>>>> Note for the future:
>>>> As discussed with Julien, really the best way would be to generate dtb directly
>>>> in the guest memory, where no allocation would be necessary. This of course
>>>> requires some rework. The solution in this patch is good enough for now and
>>>> can be treated as an intermediated step to support dtb creation of various
>>>> sizes.
>>>
>>> Thanks for summarizing our discussion :).
>>>
>>>> ---
>>>>    xen/arch/arm/domain_build.c | 18 +++++++++++++-----
>>>>    1 file changed, 13 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>>>> index f2134f24b971..1dc0eca37bd6 100644
>>>> --- a/xen/arch/arm/domain_build.c
>>>> +++ b/xen/arch/arm/domain_build.c
>>>> @@ -3257,14 +3257,15 @@ static int __init domain_handle_dtb_bootmodule(struct domain *d,
>>>>    }
>>>>
>>>>    /*
>>>> - * The max size for DT is 2MB. However, the generated DT is small, 4KB
>>>> - * are enough for now, but we might have to increase it in the future.
>>>> + * The max size for DT is 2MB. However, the generated DT is small (not including
>>>> + * domU passthrough DT nodes whose size we account separately), 4KB are enough
>>>> + * for now, but we might have to increase it in the future.
>>>>     */
>>>>    #define DOMU_DTB_SIZE 4096
>>>>    static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
>>>>    {
>>>>        int addrcells, sizecells;
>>>> -    int ret;
>>>> +    int ret, fdt_size = DOMU_DTB_SIZE;
>>>
>>> Can fdt_size be unsigned?
>> I used int because by looking at all the fdt_create() calls in our codebase
>> we seem to use int and not unsigned.
> 
> This is a bit of a mess because xmalloc_bytes() is expecting an unsigned
> long parameter. So we have some inconsistency here and we need to chose
> a side.
> 
> My preference would be to use the 'unsigned int/long' because the value
> is not meant to be negative.
> 
> Also, I used min() that does strict type checking
>> and SZ_2M is int. So if you want, I can use unsigned int but will also have to use
>> MIN() macro instead not to do type checking (I cannot use MB(2) as it has ULL type
>> and do not want to use min() with cast).
> 
> By "use min() with cast", do you mean using min_t()? I would be OK with
> using MIN().
> 
>> Also, are you OK with the rest of the code?
> 
> The rest is fine to me. Anyway, I am OK with this patch as-is. So:
> 
> Acked-by: Julien Grall <jgrall@amazon.com>
Thanks. So, let's keep it as is and one day we may just choose a side
and do refactoring globally for consistency.

~Michal


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 07:22:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 07:22:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563517.880734 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKD7w-0004Qh-Sq; Fri, 14 Jul 2023 07:22:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563517.880734; Fri, 14 Jul 2023 07:22:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKD7w-0004Qa-QC; Fri, 14 Jul 2023 07:22:08 +0000
Received: by outflank-mailman (input) for mailman id 563517;
 Fri, 14 Jul 2023 07:22:07 +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 <SRS0=dZ6j=DA=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qKD7v-0004QU-LO
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 07:22:07 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on2061a.outbound.protection.outlook.com
 [2a01:111:f400:fe12::61a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 211c4442-2217-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 09:22:03 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM9PR04MB8972.eurprd04.prod.outlook.com (2603:10a6:20b:40b::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 14 Jul
 2023 07:22:01 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Fri, 14 Jul 2023
 07:22:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 211c4442-2217-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Jsm3uXKOAQeZ/mqNHhUvjawkULcyKQ7SVimvsSj/QhO0OvzHv1m9+oXZzsp9euhi7a2+WCwZ/3nlsROFy5G0VcxaGH0v6rfv25dv0TXOI/iagJiUuUglbfWWgjS4432LRe2/e+p8TKXBjSZngz9DvJAPcpYLCtila0l2av2kz2BDtOVn9SNweNs2s5Mj6XnxL74/G7/ABioHduRUJRAZiBqPBTBkCwhUvQsAGFLsBQi7+PzQRzol/EKOehbySrL9eukaAIkOLIeD2BoI5ACQ2Xoky95Tskh4V88Gwx35tm4ax3fjK1E1X1+InfxzqDCFZR44nD1ZDkYtr0HHxc9YSw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=eO/dBxYW8Qr6n5VUF1iS40XT6a/pvQu6awmEewCYBRE=;
 b=OqF6r6dwXZ28dpljs4WdqHLou0PQBpcf+7xbjkT4agu1hTEEBkcjdPZNeT3pu0fg0Q5++tI1DTr3XI8ULFLuHXidGZ3BBQyXDL8NNsFM1lUd8d9gRYG2hLyXiML1cXDqgV4U+icqFuVVLIRmmqhknPyt2cNjHGiKyXyWmym2qv4akZFxzLmeI0SXrRvizm7EBklZSNeqT5W526i5NcSHNPJ1Muvsr86+RsCM75mer744J6r0MI5URX9Anh5nNF6XcqeUoFdTkn3oCO1/HigSebmVJO1A8s4sNrnFh/ZOiIJuNzb+0eG4v5zVx04RLzzBR3WDLdDliSYU3q982hQ6Yg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=eO/dBxYW8Qr6n5VUF1iS40XT6a/pvQu6awmEewCYBRE=;
 b=xtLIQGshtkBMkwCBHP9trRlI1qipXUsz/bl90qNfrtplHwtrExpNVSsX1UXq6qH3x8XRW3iKJW/4Mn0WJKK632ybvT+4eIv1njjaif2R3LsX9FCtL1vJEVTxznJYf2I0qZtj9v+O52Hr7/dur6Ouh1ZaXF3Qo2Tkvh/GJcpX5+cO5vDakOHSynK45qhPD0bTALfOgt84ys2I4KiidNItFksqaMees355Pz6qa+AfWEgOZMuT5Jlt6OShlPR26ZHlrp2j8rMIv98WkCb+wheIYaSqBFHJxifhQUEbYzV4YxnTvfiJgTkkNToSPwW1wBjtkxdIMDcl33ndOkIIQXQhKw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <b3db9387-8139-e7f8-d250-9933e288f9fc@suse.com>
Date: Fri, 14 Jul 2023 09:21:59 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] docs/xen-tscmode: remove mention of numeric tsc_mode=
 values
Content-Language: en-US
To: Elliott Mitchell <ehem+xen@m5p.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
 Anthony PERARD <anthony.perard@citrix.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= <marmarek@invisiblethingslab.com>
References: <a8223a339a0b8ff3c0d04fb4ee2913c7558cc131.1689294071.git.ehem+xen@m5p.com>
 <ZLCj62XMBbspMWbY@mail-itl> <ZLDErKk8ziBuh1ZJ@mattapan.m5p.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZLDErKk8ziBuh1ZJ@mattapan.m5p.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0225.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ac::13) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM9PR04MB8972:EE_
X-MS-Office365-Filtering-Correlation-Id: d92a4b12-ca64-4e3a-d529-08db843b041a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	2aqrjeaYPVINsGA+pQ/q77p5CFFZ0BYqQ0TIph1tKM2FZKJ1e9zI5J90OSs0uSbjL1WTrHRp3FFxwhyrVI8V/FzMO44R68BgbIzy0uYzeSXNJfXIFOWLJUp10UzOf/epBFzmYwlyOsBdjk/mHID7Af+V/ZIG8+bvA613By2nfiC7XaencpT4A9SjhVPCZ0LSGRpbwuz58/irlHQ49bAgw3jW+cqQZEWAWZ9F0ptz2XawShmjwLJiUD8RHO0/NrPqrEYvHn5fxPQ+tR/qXEXXfKiVjVuXp4934UZFt2StsXHLbOctjaTCPrcCVxwof9QguSzs6DTldVX8xMnD40q6x3zLup1nnHtchFUKtjg68yb4tk/Me38ZstPaXBZ8ywr8VPgGPuDPukRlqKP2bG4bPrsfRd8OoGH1734Np7Bf1AlZSEBYg0URRffMtZHpcjTpcKOtZHcGSgT7zb/OlxUQF/zSvTC/xcYfmqTqWUbQEVVYh9mhs5WTB5nbOWyQl9/scaViALU7+7IGzKsJrHWUhzYfRjXSaFMscULpZkaG0gAngG69rKXs0cb3eBsWIhWE8kY5FItAPqBYUKHYqV0mZHSKXBs892fm5ql7rwsFIJnhFc1UZccDqVi7ewJYlxBZWnV0tirGpOeD+DnrRMBhiQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(396003)(39860400002)(346002)(366004)(376002)(451199021)(53546011)(478600001)(2616005)(66476007)(66946007)(38100700002)(66556008)(4326008)(6486002)(54906003)(6506007)(36756003)(26005)(6512007)(186003)(86362001)(41300700001)(8936002)(8676002)(31696002)(5660300002)(31686004)(316002)(2906002)(83380400001)(66574015)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bnNJeEFyaVRSQkpkRkhhL2pxYUJtUHdPazREMVVrdW9malVvejNEK2QrK2w2?=
 =?utf-8?B?aFNyNlZSeUZnN01aY1ZmQk1SUlRvdTlUTUlmUmU0Z3RKUVp3ZnlZTkowelpG?=
 =?utf-8?B?MWJDRGluMjBpZ3lPWnN0bnRhNEg1SFBtcG1hSksxNlcvd3JEbUpISHFsSFJG?=
 =?utf-8?B?Z0h6ak9FWGp4cFhwUlBZZTlBU08wTERMaWlCa1ZnTmZXbjluVHdxT3dsTUhl?=
 =?utf-8?B?YnZqbEdjcm5DaGRhVW5jMm9iOWtXMFZjS2RIUklReWgvN3dXSTVWUUlkV1pE?=
 =?utf-8?B?dUxXNVZ2VTJaVmlhcWZxSHBUbmF4VW4vWkNkNzRxU2ZBMGJoTmpTODhNdWg5?=
 =?utf-8?B?M0pHNklEa2ErdkI1dUxXN3dJeUM1ZUVOUXg3RFBKU29PUUd4elFwMVJUQTNq?=
 =?utf-8?B?Nkx4S2k1OGx3dW92Z0RHek1EaVM0YmVTUFB4WjJRaDZQUzZEcHU1VmZiQzZI?=
 =?utf-8?B?OGdhZGFwMjBhckViZXJxQzI2LzRDN3ZLWU03UXBiaTVhaFVwcG1PQTJhZEpm?=
 =?utf-8?B?OVBnY3lhZGV3cXhMWFdiZ3FiNEpjRVMrZDM2VlhWTC93UVZRdGdONkZDQmdv?=
 =?utf-8?B?b3JJd0FQam14WExqTkc0eGV5QzhKZHNjcGhBN1RyUDdB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WNVdUwzYTlDK2tCSUlEUmhhd1RMREY3NHNLSUxnTzM2TnUwRGFOVkJ0RFBo?=
 =?utf-8?B?ZlVyOG12elJQMzR6YnpxOWIycWtkaUtxOHJxN0FMMkVralAyQTh5WFBUb2xL?=
 =?utf-8?B?N0V5bHVkYlpQQ1d6bnkvUlVjTGtsQWg0UEJtZlRnVTc2M3MxUUtZUGtXYktv?=
 =?utf-8?B?UTcxSFZKVnREd3k1cFVJTTIrUUVPNkE1KzNQeTNKSGR3SzZFWEU2S3hPTUJJ?=
 =?utf-8?B?R1Y4bUV1RWNUQzlkYmh4NXFVdWQ1SjhPMXdyeWZkVXVMbEozQXBhZ0pCNE9K?=
 =?utf-8?B?WlpnSjdKdjBERjB1Rmk1RFVrN2pGaVRhTW5nbi9uYk80aUZjQ1VHNzBiQ0t0?=
 =?utf-8?B?akRTUFdqUWxKSjA3YnVORmliaDBSVk9leWhWYXdmTTVkY1hxc1ZWUyszdXpm?=
 =?utf-8?B?TUp4cFUrREE5OHZiM3pJTDFQRU0ydUcyR2NmWGZYMGUxTWlINThTb2JIck54?=
 =?utf-8?B?TFphNlIzVHVDQkhZckpCT2oyVEt6bTJqT2ZwTGZzdGVSd3ZScVlPcHB0TkUy?=
 =?utf-8?B?RGRUNjJ5WFRaditlenl0V1dESVBRNFR5TXJKbHNKeGtMeFp5enVoWXQ4c1p5?=
 =?utf-8?Q?gizQv0i2XAVIke661UhsmUkWF?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d92a4b12-ca64-4e3a-d529-08db843b041a
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 07:22:01.0785
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: EknzJE2e3O90iWWPTny974fhE12RaiLNV+W0zo8ckR7ipeYB+1YUPTnZGQIPR381+hg+Y9HZsP+yQLgS9u8n5A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8972

On 14.07.2023 05:44, Elliott Mitchell wrote:
> On Fri, Jul 14, 2023 at 03:24:59AM +0200, Marek Marczykowski-GÃ³recki wrote:
>> On Thu, Jul 13, 2023 at 05:16:40PM -0700, Elliott Mitchell wrote:
>>> The better to encourage moving to setting via string mode names.
>>
>> The numeric values needs to remain documented, otherwise interpreting
>> pre-existing configs (that may use them) will be tricky.
> 
> Problem is the way it is documented tends to encourage continued use of
> the numeric values (notice how reports irt Zen 4 mention "tsc_mode=1").
> 
> `parse_config_data()` suggests the appropriate string value, so nominally
> that should take care of older configurations.  If "xen-tscmode" really
> needs to continue mentioning the numeric value, it should be in
> parentheses and with "old value" to suggest moving away from that.

I'm not sure about "old" (we can't change the values without breaking
backwards compatibility), but the numeric values will want mentioning
alongside their spelled out names.

As to mode 0 - that's the default mode, engaging emulation as
necessary. See xen/include/public/arch-x86/cpuid.h

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 07:46:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 07:46:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563520.880745 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKDVJ-0007F7-SI; Fri, 14 Jul 2023 07:46:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563520.880745; Fri, 14 Jul 2023 07:46:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKDVJ-0007Ey-Op; Fri, 14 Jul 2023 07:46:17 +0000
Received: by outflank-mailman (input) for mailman id 563520;
 Fri, 14 Jul 2023 07:39:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=EYdF=DA=suse.de=tzimmermann@srs-se1.protection.inumbo.net>)
 id 1qKDOI-0006Iv-Vj
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 07:39:03 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 802f4399-2219-11ee-b239-6b7b168915f2;
 Fri, 14 Jul 2023 09:39:01 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id E2F031FD65;
 Fri, 14 Jul 2023 07:39:00 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4805313A15;
 Fri, 14 Jul 2023 07:38:57 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 3v5aEJH7sGTTOwAAMHmgww
 (envelope-from <tzimmermann@suse.de>); Fri, 14 Jul 2023 07:38:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 802f4399-2219-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1689320340; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=nMWGIzR5HguJc3P736wDMWr57FecGJdaqmJS12K5GD8=;
	b=OV/gdDYm2uAVKIOz4nhzePkYLXrydA5b3efhEo7z+cVzoc69jEcZ9YUPxA/NhvPVXLWvEK
	vJIvaON/yN1mFbFrVG7sKhziYU63JMVKYJGeW1n98N87iPjWLM8zYVr6K0n35gCWrr5LeV
	JgA1RKDnRqnC54CoGkXQO7OYQ/3TZwA=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1689320340;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=nMWGIzR5HguJc3P736wDMWr57FecGJdaqmJS12K5GD8=;
	b=nMR4Tsarzd8uBtjx+g3rJCIL8W+d0+uFe/ZArcyeUxAaSOobgaEVTX4FctsZNVklH+ZvS6
	4af1u0Io24CrO6Dw==
Message-ID: <ebc6167a-0696-11d2-cb20-bcc7d23427aa@suse.de>
Date: Fri, 14 Jul 2023 09:38:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [Freedreno] [PATCH RFC v1 00/52] drm/crtc: Rename struct
 drm_crtc::dev to drm_dev
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
 Sean Paul <seanpaul@chromium.org>,
 =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= <u.kleine-koenig@pengutronix.de>
Cc: Jani Nikula <jani.nikula@intel.com>, =?UTF-8?Q?Heiko_St=c3=bcbner?=
 <heiko@sntech.de>, Geert Uytterhoeven <geert+renesas@glider.be>,
 Xinliang Liu <xinliang.liu@linaro.org>,
 Linus Walleij <linus.walleij@linaro.org>,
 Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
 Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
 dri-devel@lists.freedesktop.org,
 Vandita Kulkarni <vandita.kulkarni@intel.com>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 Jonathan Hunter <jonathanh@nvidia.com>,
 Arun R Murthy <arun.r.murthy@intel.com>, Jerome Brunet
 <jbrunet@baylibre.com>, Liu Shixin <liushixin2@huawei.com>,
 linux-samsung-soc@vger.kernel.org, Samuel Holland <samuel@sholland.org>,
 Matt Roper <matthew.d.roper@intel.com>, Wenjing Liu <wenjing.liu@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
 Danilo Krummrich <dakr@redhat.com>, NXP Linux Team <linux-imx@nxp.com>,
 spice-devel@lists.freedesktop.org,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 linux-sunxi@lists.linux.dev, Stylon Wang <stylon.wang@amd.com>,
 Tim Huang <Tim.Huang@amd.com>, Suraj Kandpal <suraj.kandpal@intel.com>,
 =?UTF-8?Q?Andr=c3=a9_Almeida?= <andrealmeid@igalia.com>,
 Andi Shyti <andi.shyti@linux.intel.com>, Yifan Zhang <yifan1.zhang@amd.com>,
 Leo Li <sunpeng.li@amd.com>, Sascha Hauer <s.hauer@pengutronix.de>,
 Lucas De Marchi <lucas.demarchi@intel.com>, Inki Dae <inki.dae@samsung.com>,
 Hersen Wu <hersenxs.wu@amd.com>, Jessica Zhang <quic_jesszhan@quicinc.com>,
 Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
 Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
 =?UTF-8?Q?=c5=81ukasz_Bartosik?= <lb@semihalf.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
 Andrew Jeffery <andrew@aj.id.au>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= <noralf@tronnes.org>, kernel@pengutronix.de,
 Alex Deucher <alexander.deucher@amd.com>, freedreno@lists.freedesktop.org,
 Claudiu Beznea <claudiu.beznea@microchip.com>, Zack Rusin
 <zackr@vmware.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org,
 Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
 =?UTF-8?Q?Jos=c3=a9_Roberto_de_Souza?= <jose.souza@intel.com>,
 virtualization@lists.linux-foundation.org,
 Thierry Reding <thierry.reding@gmail.com>,
 Yongqin Liu <yongqin.liu@linaro.org>,
 Mario Limonciello <mario.limonciello@amd.com>, Fei Yang
 <fei.yang@intel.com>, =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?=
 <ville.syrjala@linux.intel.com>, David Lechner <david@lechnology.com>,
 Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
 "Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
 David Francis <David.Francis@amd.com>, Aaron Liu <aaron.liu@amd.com>,
 Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
 Vinod Polimera <quic_vpolimer@quicinc.com>,
 linux-rockchip@lists.infradead.org, Fangzhi Zuo <jerry.zuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>,
 VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
 Ben Skeggs <bskeggs@redhat.com>, =?UTF-8?Q?Jouni_H=c3=b6gander?=
 <jouni.hogander@intel.com>, Dave Airlie <airlied@redhat.com>,
 linux-mips@vger.kernel.org, Gurchetan Singh <gurchetansingh@chromium.org>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-arm-msm@vger.kernel.org, Animesh Manna <animesh.manna@intel.com>,
 linux-renesas-soc@vger.kernel.org, Maxime Ripard <mripard@kernel.org>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
 Philipp Zabel <p.zabel@pengutronix.de>, linux-amlogic@lists.infradead.org,
 Evan Quan <evan.quan@amd.com>, Michal Simek <michal.simek@amd.com>,
 linux-arm-kernel@lists.infradead.org, Sean Paul <sean@poorly.run>,
 Neil Armstrong <neil.armstrong@linaro.org>,
 Kai Vehmanen <kai.vehmanen@linux.intel.com>,
 Boris Brezillon <bbrezillon@kernel.org>, Chunyan Zhang
 <zhang.lyra@gmail.com>, Qingqing Zhuo <qingqing.zhuo@amd.com>,
 Sandy Huang <hjc@rock-chips.com>, Swati Sharma <swati2.sharma@intel.com>,
 John Stultz <jstultz@google.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Drew Davenport <ddavenport@chromium.org>, Kevin Hilman
 <khilman@baylibre.com>, Hawking Zhang <Hawking.Zhang@amd.com>,
 Haneen Mohammed <hamohammed.sa@gmail.com>,
 Anusha Srivatsa <anusha.srivatsa@intel.com>,
 Dan Carpenter <error27@gmail.com>, Karol Herbst <kherbst@redhat.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 linux-hyperv@vger.kernel.org, Stefan Agner <stefan@agner.ch>,
 Melissa Wen <melissa.srw@gmail.com>, =?UTF-8?Q?Ma=c3=adra_Canal?=
 <mairacanal@riseup.net>, Luca Coelho <luciano.coelho@intel.com>,
 Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
 Andrzej Hajda <andrzej.hajda@intel.com>, Likun Gao <Likun.Gao@amd.com>,
 Sam Ravnborg <sam@ravnborg.org>, Alain Volmat <alain.volmat@foss.st.com>,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 Jernej Skrabec <jernej.skrabec@gmail.com>,
 Deepak Rawat <drawat.floss@gmail.com>, Chen-Yu Tsai <wens@csie.org>,
 Joel Stanley <joel@jms.id.au>, Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
 Harry Wentland <harry.wentland@amd.com>,
 Sumit Semwal <sumit.semwal@linaro.org>, Alan Liu <haoping.liu@amd.com>,
 Philip Yang <Philip.Yang@amd.com>, Lyude Paul <lyude@redhat.com>,
 intel-gfx@lists.freedesktop.org, Alison Wang <alison.wang@nxp.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>,
 Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Gustavo Sousa <gustavo.sousa@intel.com>,
 Baolin Wang <baolin.wang@linux.alibaba.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
 Tomi Valkeinen <tomba@kernel.org>, Deepak R Varma <drv@mailo.com>,
 "Pan, Xinhui" <Xinhui.Pan@amd.com>, Biju Das <biju.das.jz@bp.renesas.com>,
 Chia-I Wu <olvaffe@gmail.com>, Konrad Dybcio <konrad.dybcio@linaro.org>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Tian Tao <tiantao6@hisilicon.com>, Shawn Guo <shawnguo@kernel.org>,
 =?UTF-8?Q?Christian_K=c3=b6nig?= <christian.koenig@amd.com>,
 Khaled Almahallawy <khaled.almahallawy@intel.com>,
 linux-stm32@st-md-mailman.stormreply.com, Emma Anholt <emma@anholt.net>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>, Imre Deak <imre.deak@intel.com>,
 Liviu Dudau <liviu.dudau@arm.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>, Roman Li
 <roman.li@amd.com>, Paul Cercueil <paul@crapouillou.net>,
 Rob Clark <robdclark@gmail.com>, Hamza Mahfooz <hamza.mahfooz@amd.com>,
 David Airlie <airlied@gmail.com>, Marek Vasut <marex@denx.de>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 xen-devel@lists.xenproject.org, Guchun Chen <guchun.chen@amd.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
 Russell King <linux@armlinux.org.uk>, Uma Shankar <uma.shankar@intel.com>,
 Mika Kahola <mika.kahola@intel.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Jiasheng Jiang <jiasheng@iscas.ac.cn>,
 Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 linux-tegra@vger.kernel.org, =?UTF-8?B?TWFyZWsgT2zFocOhaw==?=
 <marek.olsak@amd.com>, Maarten Lankhorst
 <maarten.lankhorst@linux.intel.com>,
 =?UTF-8?Q?Joaqu=c3=adn_Ignacio_Aramend=c3=ada?= <samsagax@gmail.com>,
 Melissa Wen <mwen@igalia.com>, Hans de Goede <hdegoede@redhat.com>,
 linux-mediatek@lists.infradead.org, Fabio Estevam <festevam@gmail.com>,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 David Tadokoro <davidbtadokoro@usp.br>,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 Orson Zhai <orsonzhai@gmail.com>, amd-gfx@lists.freedesktop.org,
 Jyri Sarha <jyri.sarha@iki.fi>, Yannick Fertre <yannick.fertre@foss.st.com>,
 Nicolas Ferre <nicolas.ferre@microchip.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Philippe Cornu <philippe.cornu@foss.st.com>, Daniel Vetter
 <daniel@ffwll.ch>, Wayne Lin <Wayne.Lin@amd.com>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
 Nirmoy Das <nirmoy.das@intel.com>, Lang Yu <Lang.Yu@amd.com>,
 Lucas Stach <l.stach@pengutronix.de>
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com>
 <CAOw6vbLO_UaXDbTCtAQJgthXOUMPqEV+c2MQhP-1DuK44OhGxw@mail.gmail.com>
 <20230713130337.fd2l67r23g2irifx@pengutronix.de>
 <CAOw6vbKtjyUm+OqO7LSV1hDOMQATwkEWP4GzBbbXib0i5EviUQ@mail.gmail.com>
 <78be52b8-5ffb-601a-84b2-ead2894973a6@suse.de>
 <d6160aeb-6344-b272-775a-cb665dca46ac@linux.intel.com>
Content-Language: en-US
From: Thomas Zimmermann <tzimmermann@suse.de>
In-Reply-To: <d6160aeb-6344-b272-775a-cb665dca46ac@linux.intel.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------jeLFGePkiFpCJh0eHqRS7GTg"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------jeLFGePkiFpCJh0eHqRS7GTg
Content-Type: multipart/mixed; boundary="------------NtcVQEWFF5WDzksvmBN1dmoE";
 protected-headers="v1"
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
 Sean Paul <seanpaul@chromium.org>,
 =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= <u.kleine-koenig@pengutronix.de>
Cc: Jani Nikula <jani.nikula@intel.com>, =?UTF-8?Q?Heiko_St=c3=bcbner?=
 <heiko@sntech.de>, Geert Uytterhoeven <geert+renesas@glider.be>,
 Xinliang Liu <xinliang.liu@linaro.org>,
 Linus Walleij <linus.walleij@linaro.org>,
 Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
 Alexey Kodanev <aleksei.kodanev@bell-sw.com>,
 dri-devel@lists.freedesktop.org,
 Vandita Kulkarni <vandita.kulkarni@intel.com>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 Jonathan Hunter <jonathanh@nvidia.com>,
 Arun R Murthy <arun.r.murthy@intel.com>, Jerome Brunet
 <jbrunet@baylibre.com>, Liu Shixin <liushixin2@huawei.com>,
 linux-samsung-soc@vger.kernel.org, Samuel Holland <samuel@sholland.org>,
 Matt Roper <matthew.d.roper@intel.com>, Wenjing Liu <wenjing.liu@amd.com>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
 Danilo Krummrich <dakr@redhat.com>, NXP Linux Team <linux-imx@nxp.com>,
 spice-devel@lists.freedesktop.org,
 Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
 linux-sunxi@lists.linux.dev, Stylon Wang <stylon.wang@amd.com>,
 Tim Huang <Tim.Huang@amd.com>, Suraj Kandpal <suraj.kandpal@intel.com>,
 =?UTF-8?Q?Andr=c3=a9_Almeida?= <andrealmeid@igalia.com>,
 Andi Shyti <andi.shyti@linux.intel.com>, Yifan Zhang <yifan1.zhang@amd.com>,
 Leo Li <sunpeng.li@amd.com>, Sascha Hauer <s.hauer@pengutronix.de>,
 Lucas De Marchi <lucas.demarchi@intel.com>, Inki Dae <inki.dae@samsung.com>,
 Hersen Wu <hersenxs.wu@amd.com>, Jessica Zhang <quic_jesszhan@quicinc.com>,
 Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>,
 Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
 =?UTF-8?Q?=c5=81ukasz_Bartosik?= <lb@semihalf.com>,
 Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
 Andrew Jeffery <andrew@aj.id.au>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= <noralf@tronnes.org>, kernel@pengutronix.de,
 Alex Deucher <alexander.deucher@amd.com>, freedreno@lists.freedesktop.org,
 Claudiu Beznea <claudiu.beznea@microchip.com>, Zack Rusin
 <zackr@vmware.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Alexandre Belloni <alexandre.belloni@bootlin.com>,
 linux-aspeed@lists.ozlabs.org, nouveau@lists.freedesktop.org,
 Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
 =?UTF-8?Q?Jos=c3=a9_Roberto_de_Souza?= <jose.souza@intel.com>,
 virtualization@lists.linux-foundation.org,
 Thierry Reding <thierry.reding@gmail.com>,
 Yongqin Liu <yongqin.liu@linaro.org>,
 Mario Limonciello <mario.limonciello@amd.com>, Fei Yang
 <fei.yang@intel.com>, =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?=
 <ville.syrjala@linux.intel.com>, David Lechner <david@lechnology.com>,
 Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
 "Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
 David Francis <David.Francis@amd.com>, Aaron Liu <aaron.liu@amd.com>,
 Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
 Vinod Polimera <quic_vpolimer@quicinc.com>,
 linux-rockchip@lists.infradead.org, Fangzhi Zuo <jerry.zuo@amd.com>,
 Aurabindo Pillai <aurabindo.pillai@amd.com>,
 VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
 Ben Skeggs <bskeggs@redhat.com>, =?UTF-8?Q?Jouni_H=c3=b6gander?=
 <jouni.hogander@intel.com>, Dave Airlie <airlied@redhat.com>,
 linux-mips@vger.kernel.org, Gurchetan Singh <gurchetansingh@chromium.org>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-arm-msm@vger.kernel.org, Animesh Manna <animesh.manna@intel.com>,
 linux-renesas-soc@vger.kernel.org, Maxime Ripard <mripard@kernel.org>,
 Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
 Philipp Zabel <p.zabel@pengutronix.de>, linux-amlogic@lists.infradead.org,
 Evan Quan <evan.quan@amd.com>, Michal Simek <michal.simek@amd.com>,
 linux-arm-kernel@lists.infradead.org, Sean Paul <sean@poorly.run>,
 Neil Armstrong <neil.armstrong@linaro.org>,
 Kai Vehmanen <kai.vehmanen@linux.intel.com>,
 Boris Brezillon <bbrezillon@kernel.org>, Chunyan Zhang
 <zhang.lyra@gmail.com>, Qingqing Zhuo <qingqing.zhuo@amd.com>,
 Sandy Huang <hjc@rock-chips.com>, Swati Sharma <swati2.sharma@intel.com>,
 John Stultz <jstultz@google.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Drew Davenport <ddavenport@chromium.org>, Kevin Hilman
 <khilman@baylibre.com>, Hawking Zhang <Hawking.Zhang@amd.com>,
 Haneen Mohammed <hamohammed.sa@gmail.com>,
 Anusha Srivatsa <anusha.srivatsa@intel.com>,
 Dan Carpenter <error27@gmail.com>, Karol Herbst <kherbst@redhat.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 linux-hyperv@vger.kernel.org, Stefan Agner <stefan@agner.ch>,
 Melissa Wen <melissa.srw@gmail.com>, =?UTF-8?Q?Ma=c3=adra_Canal?=
 <mairacanal@riseup.net>, Luca Coelho <luciano.coelho@intel.com>,
 Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
 Andrzej Hajda <andrzej.hajda@intel.com>, Likun Gao <Likun.Gao@amd.com>,
 Sam Ravnborg <sam@ravnborg.org>, Alain Volmat <alain.volmat@foss.st.com>,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 Jernej Skrabec <jernej.skrabec@gmail.com>,
 Deepak Rawat <drawat.floss@gmail.com>, Chen-Yu Tsai <wens@csie.org>,
 Joel Stanley <joel@jms.id.au>, Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
 Harry Wentland <harry.wentland@amd.com>,
 Sumit Semwal <sumit.semwal@linaro.org>, Alan Liu <haoping.liu@amd.com>,
 Philip Yang <Philip.Yang@amd.com>, Lyude Paul <lyude@redhat.com>,
 intel-gfx@lists.freedesktop.org, Alison Wang <alison.wang@nxp.com>,
 Wolfram Sang <wsa+renesas@sang-engineering.com>,
 Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Gustavo Sousa <gustavo.sousa@intel.com>,
 Baolin Wang <baolin.wang@linux.alibaba.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
 Tomi Valkeinen <tomba@kernel.org>, Deepak R Varma <drv@mailo.com>,
 "Pan, Xinhui" <Xinhui.Pan@amd.com>, Biju Das <biju.das.jz@bp.renesas.com>,
 Chia-I Wu <olvaffe@gmail.com>, Konrad Dybcio <konrad.dybcio@linaro.org>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Tian Tao <tiantao6@hisilicon.com>, Shawn Guo <shawnguo@kernel.org>,
 =?UTF-8?Q?Christian_K=c3=b6nig?= <christian.koenig@amd.com>,
 Khaled Almahallawy <khaled.almahallawy@intel.com>,
 linux-stm32@st-md-mailman.stormreply.com, Emma Anholt <emma@anholt.net>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>, Imre Deak <imre.deak@intel.com>,
 Liviu Dudau <liviu.dudau@arm.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>, Roman Li
 <roman.li@amd.com>, Paul Cercueil <paul@crapouillou.net>,
 Rob Clark <robdclark@gmail.com>, Hamza Mahfooz <hamza.mahfooz@amd.com>,
 David Airlie <airlied@gmail.com>, Marek Vasut <marex@denx.de>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
 xen-devel@lists.xenproject.org, Guchun Chen <guchun.chen@amd.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
 Russell King <linux@armlinux.org.uk>, Uma Shankar <uma.shankar@intel.com>,
 Mika Kahola <mika.kahola@intel.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Jiasheng Jiang <jiasheng@iscas.ac.cn>,
 Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>,
 Vinod Govindapillai <vinod.govindapillai@intel.com>,
 linux-tegra@vger.kernel.org, =?UTF-8?B?TWFyZWsgT2zFocOhaw==?=
 <marek.olsak@amd.com>, Maarten Lankhorst
 <maarten.lankhorst@linux.intel.com>,
 =?UTF-8?Q?Joaqu=c3=adn_Ignacio_Aramend=c3=ada?= <samsagax@gmail.com>,
 Melissa Wen <mwen@igalia.com>, Hans de Goede <hdegoede@redhat.com>,
 linux-mediatek@lists.infradead.org, Fabio Estevam <festevam@gmail.com>,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 David Tadokoro <davidbtadokoro@usp.br>,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 Orson Zhai <orsonzhai@gmail.com>, amd-gfx@lists.freedesktop.org,
 Jyri Sarha <jyri.sarha@iki.fi>, Yannick Fertre <yannick.fertre@foss.st.com>,
 Nicolas Ferre <nicolas.ferre@microchip.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Philippe Cornu <philippe.cornu@foss.st.com>, Daniel Vetter
 <daniel@ffwll.ch>, Wayne Lin <Wayne.Lin@amd.com>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
 Nirmoy Das <nirmoy.das@intel.com>, Lang Yu <Lang.Yu@amd.com>,
 Lucas Stach <l.stach@pengutronix.de>
Message-ID: <ebc6167a-0696-11d2-cb20-bcc7d23427aa@suse.de>
Subject: Re: [Freedreno] [PATCH RFC v1 00/52] drm/crtc: Rename struct
 drm_crtc::dev to drm_dev
References: <20230712094702.1770121-1-u.kleine-koenig@pengutronix.de>
 <87fs5tgpvv.fsf@intel.com>
 <CAOw6vbLO_UaXDbTCtAQJgthXOUMPqEV+c2MQhP-1DuK44OhGxw@mail.gmail.com>
 <20230713130337.fd2l67r23g2irifx@pengutronix.de>
 <CAOw6vbKtjyUm+OqO7LSV1hDOMQATwkEWP4GzBbbXib0i5EviUQ@mail.gmail.com>
 <78be52b8-5ffb-601a-84b2-ead2894973a6@suse.de>
 <d6160aeb-6344-b272-775a-cb665dca46ac@linux.intel.com>
In-Reply-To: <d6160aeb-6344-b272-775a-cb665dca46ac@linux.intel.com>

--------------NtcVQEWFF5WDzksvmBN1dmoE
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

SGkNCg0KQW0gMTMuMDcuMjMgdW0gMTc6MTQgc2NocmllYiBUdnJ0a28gVXJzdWxpbjoNCj4g
DQo+IE9uIDEzLzA3LzIwMjMgMTY6MDksIFRob21hcyBaaW1tZXJtYW5uIHdyb3RlOg0KPj4g
SGkNCj4+DQo+PiBBbSAxMy4wNy4yMyB1bSAxNjo0MSBzY2hyaWViIFNlYW4gUGF1bDoNCj4+
PiBPbiBUaHUsIEp1bCAxMywgMjAyMyBhdCA5OjA04oCvQU0gVXdlIEtsZWluZS1Lw7ZuaWcN
Cj4+PiA8dS5rbGVpbmUta29lbmlnQHBlbmd1dHJvbml4LmRlPiB3cm90ZToNCj4+Pj4NCj4+
Pj4gaGVsbG8gU2VhbiwNCj4+Pj4NCj4+Pj4gT24gV2VkLCBKdWwgMTIsIDIwMjMgYXQgMDI6
MzE6MDJQTSAtMDQwMCwgU2VhbiBQYXVsIHdyb3RlOg0KPj4+Pj4gSSdkIHJlYWxseSBwcmVm
ZXIgdGhpcyBwYXRjaCAoc2VyaWVzIG9yIHNpbmdsZSkg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d2FyZSBTb2x1dGlvbnMgR2VybWFueSBHbWJIDQpGcmFua2Vu
c3RyYXNzZSAxNDYsIDkwNDYxIE51ZXJuYmVyZywgR2VybWFueQ0KR0Y6IEl2byBUb3Rldiwg
QW5kcmV3IE15ZXJzLCBBbmRyZXcgTWNEb25hbGQsIEJvdWRpZW4gTW9lcm1hbg0KSFJCIDM2
ODA5IChBRyBOdWVybmJlcmcpDQo=

--------------NtcVQEWFF5WDzksvmBN1dmoE--

--------------jeLFGePkiFpCJh0eHqRS7GTg
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEExndm/fpuMUdwYFFolh/E3EQov+AFAmSw+5AFAwAAAAAACgkQlh/E3EQov+CJ
FRAAs3UnPVAh602q8J7TFsiuYzv75xdkD8C1ihsIF3xnPxQT4AwrlZzGu4Uelh/Db1o8yFEitfnA
Ghk92aBwnLnf5crMh+qux1g/HHhYMLAGvmiGbR8H1tIx7VO3n4E/gm8OMkVG7xQ0Tz4+Qs8oTiJK
kFpsq/h6tqmJTjGbBnwTCMeHoYGFZM4h+KfSAYrMkT3lD/WSYbFmKrtSrmVcUbax/trVPRyEDyV1
D5uAUaWHZYEIZMmHPD65yfbjmAKKvXkCFbaHS0dwfGfuNjTS/tVtoFSohLsKThhgn3lSHnPpzx3K
4r83L4KZRQCDTM9vsTG2JYxJoq+Liw70fLe8gFXO6xD0Z8IWSTG+a8kgeKYtJ1kDtw9nfzZlUoZh
zFxr2af/nGZRpLjA1enMf0GRisUvW3CtTmvdYQwBoEULHpAwUqGoDVAvz1lMUgew/Ezm65E/qO0X
9mjGUHNEne4/DZ1y1cO68JQO+F3mgFTOM6nRrlboy+wGlyxLwthlMkSfsCwF3elI3/zC1NXqNfk+
9qkQfSm4QsV+6amus2nwk3HuV1i4oRdy9YpQ+k2NvFAKjh6AS4JxTEBCtoZ4pq5Z4z92GrWpBS8P
tVzDaIy4+/mZeIQbou1prQZzpZdPSVKLCpfys3YCEeT+G4s0WAXhsOpvkh/Qc3ob7418D7bqWFti
6q8=
=i/hH
-----END PGP SIGNATURE-----

--------------jeLFGePkiFpCJh0eHqRS7GTg--


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 08:11:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 08:11:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563534.880755 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKDtI-0003AZ-DY; Fri, 14 Jul 2023 08:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563534.880755; Fri, 14 Jul 2023 08:11:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKDtI-0003AS-AK; Fri, 14 Jul 2023 08:11:04 +0000
Received: by outflank-mailman (input) for mailman id 563534;
 Fri, 14 Jul 2023 08:11:03 +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
 <SRS0=1HgV=DA=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qKDtG-0003AM-Vx
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 08:11:02 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f7c093c0-221d-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 10:11:00 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.163.153.34])
 by support.bugseng.com (Postfix) with ESMTPSA id 338F54EE0739;
 Fri, 14 Jul 2023 10:10:58 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f7c093c0-221d-11ee-8611-37d641c3527e
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: [XEN PATCH] x86/mce: change parameter names in function definitions to match the corresponding declarations
Date: Fri, 14 Jul 2023 10:10:49 +0200
Message-Id: <5d1b292f3bb46dccf7e1cae38903165c5e236507.1689321884.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Change parameter names in function definitions to match the
corresponding delcarations thus fixing violations of MISRA C:2012
Rule 8.3 ("All declarations of an object or function shall use the same
names and type qualifiers").

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/arch/x86/cpu/mcheck/mce.c     | 11 +++++------
 xen/arch/x86/cpu/mcheck/mce_amd.c | 16 ++++++++--------
 2 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 3e93bdd8da..140634198c 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -123,7 +123,7 @@ void mce_recoverable_register(mce_recoverable_t cbfunc)
     mc_recoverable_scan = cbfunc;
 }
 
-struct mca_banks *mcabanks_alloc(unsigned int nr_mce_banks)
+struct mca_banks *mcabanks_alloc(unsigned int nr)
 {
     struct mca_banks *mb;
 
@@ -135,18 +135,17 @@ struct mca_banks *mcabanks_alloc(unsigned int nr_mce_banks)
      * For APs allocations get done by the BSP, i.e. when the bank count may
      * may not be known yet. A zero bank count is a clear indication of this.
      */
-    if ( !nr_mce_banks )
-        nr_mce_banks = MCG_CAP_COUNT;
+    if ( !nr )
+        nr = MCG_CAP_COUNT;
 
-    mb->bank_map = xzalloc_array(unsigned long,
-                                 BITS_TO_LONGS(nr_mce_banks));
+    mb->bank_map = xzalloc_array(unsigned long, BITS_TO_LONGS(nr));
     if ( !mb->bank_map )
     {
         xfree(mb);
         return NULL;
     }
 
-    mb->num = nr_mce_banks;
+    mb->num = nr;
 
     return mb;
 }
diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.c b/xen/arch/x86/cpu/mcheck/mce_amd.c
index 3c374fd4e4..6c7951d028 100644
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c
@@ -272,13 +272,13 @@ int vmce_amd_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
 }
 
 enum mcheck_type
-amd_mcheck_init(struct cpuinfo_x86 *ci)
+amd_mcheck_init(struct cpuinfo_x86 *c)
 {
     uint32_t i;
     enum mcequirk_amd_flags quirkflag = 0;
 
-    if ( ci->x86_vendor != X86_VENDOR_HYGON )
-        quirkflag = mcequirk_lookup_amd_quirkdata(ci);
+    if ( c->x86_vendor != X86_VENDOR_HYGON )
+        quirkflag = mcequirk_lookup_amd_quirkdata(c);
 
     /* Assume that machine check support is available.
      * The minimum provided support is at least the K8. */
@@ -298,14 +298,14 @@ amd_mcheck_init(struct cpuinfo_x86 *ci)
         }
     }
 
-    if ( ci->x86 == 0xf )
+    if ( c->x86 == 0xf )
         return mcheck_amd_k8;
 
     if ( quirkflag == MCEQUIRK_F10_GART )
         mcequirk_amd_apply(quirkflag);
 
-    if ( cpu_has(ci, X86_FEATURE_AMD_PPIN) &&
-         (ci == &boot_cpu_data || ppin_msr) )
+    if ( cpu_has(c, X86_FEATURE_AMD_PPIN) &&
+         (c == &boot_cpu_data || ppin_msr) )
     {
         uint64_t val;
 
@@ -320,7 +320,7 @@ amd_mcheck_init(struct cpuinfo_x86 *ci)
 
         if ( !(val & PPIN_ENABLE) )
             ppin_msr = 0;
-        else if ( ci == &boot_cpu_data )
+        else if ( c == &boot_cpu_data )
             ppin_msr = MSR_AMD_PPIN;
     }
 
@@ -328,6 +328,6 @@ amd_mcheck_init(struct cpuinfo_x86 *ci)
     mce_recoverable_register(mc_amd_recoverable_scan);
     mce_register_addrcheck(mc_amd_addrcheck);
 
-    return ci->x86_vendor == X86_VENDOR_HYGON ?
+    return c->x86_vendor == X86_VENDOR_HYGON ?
             mcheck_hygon : mcheck_amd_famXX;
 }
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 14 08:42:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 08:42:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563542.880771 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKENU-0006ua-QL; Fri, 14 Jul 2023 08:42:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563542.880771; Fri, 14 Jul 2023 08:42:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKENU-0006uT-NY; Fri, 14 Jul 2023 08:42:16 +0000
Received: by outflank-mailman (input) for mailman id 563542;
 Fri, 14 Jul 2023 08:42:15 +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 <SRS0=dZ6j=DA=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qKENT-0006uL-6Z
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 08:42:15 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20602.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::602])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 531f152b-2222-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 10:42:11 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM7PR04MB7112.eurprd04.prod.outlook.com (2603:10a6:20b:113::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24; Fri, 14 Jul
 2023 08:42:09 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Fri, 14 Jul 2023
 08:42:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 531f152b-2222-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=k3Zb+Gk3knxNi3F4OAMZZyWXr0SMW6xHf3TOqHb2baPpjoXZC4AAcy/kLrFcFfwMvBwB1bK9b3Oopo0oKXP0szFICuS46mSAYVT6bLLUz6ZPS7LMWwGn3RQ1OY35huSgrdqnpiJ+ckkPc9UPVYN8feVjZ7YEc+2YwYai5f3taQfCM53Qal9raI2sQ1jKb9AJeXr+IDSOfILDd9CZWvz83MVPJkZZMezY78fsh3Rm+STagIMQ7rAR2jnxO5pDxkpt/nsQ7TkcorAeR7tMYKAYriGd67WkbNVQwZ9KgShEIt1ygxyUP/RF3mCPrKiRztqOwU7hrD66fiWJD6Zpu9SYZQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/1pb0GgA5M+V5KbnFMx4YxRFANsacuU+kNapv3ZEn48=;
 b=HuXLYuIPm60SllZDMeA8KiIxKXkbk7z0O3rXDkNnw3IIm84G6qWk0XSfNggu4XMEdWkPY56hcx0Paa+JaQ3rZ0XDKZK52no+WmiXGngQpQ5yjfTPbzrAX9D1znDMwMPlTGqAV9wRbpdg/mfpT5Ye6MKA9mehXqYvnwx/K4nnhEK88mcFzF2lCK9Pp89uzWkgJQLlYX3/8Py4j1CQA+90VggH3ngnHJEhO9EBJ1KFhpZEZCEkNPJeB2QTj3Bh4xVDVCCTqom/FMLgWNJcsiyl2i5EuLNbMN4fCn7Xxa+5lRmtlvZomFuhddSopORWkLxMeiaFHMcAIx6aYzymVuLtsw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/1pb0GgA5M+V5KbnFMx4YxRFANsacuU+kNapv3ZEn48=;
 b=udYCu6NE7BRlyNGb4/3c4ya5iDmTEpT7YDPmktdJjD5F/x0v9Z8beBZs+2rH+AedD1w3h7U7UB+IxopwBEooCz+BtBTL4gBn+bP0aW1DZQf9rhDUm+7eIl5YreZxlVoVUcu0/62zgRblgzJ1vNFKonIJz3WrkeNPx2vuvNJZ5r18in4ist44QJGBZO9juhgrirGpGk8km42/mSaZuOSbyAIfLUD+Rau+Y8mmN8/HysThro89lkC+USIOC7Mp+r/8EvT/zNX/0ZctLv4gTabH8g2bKunCKIbkSw4CIObjxQItZezsOJaEE4zxiSIxO31kWKwsJDFgQ3OITC95egvu2w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <0ab935de-824a-87ff-c541-a654019ceb8d@suse.com>
Date: Fri, 14 Jul 2023 10:42:06 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] x86/mce: change parameter names in function
 definitions to match the corresponding declarations
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <5d1b292f3bb46dccf7e1cae38903165c5e236507.1689321884.git.federico.serafini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <5d1b292f3bb46dccf7e1cae38903165c5e236507.1689321884.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0140.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:96::6) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM7PR04MB7112:EE_
X-MS-Office365-Filtering-Correlation-Id: 227c073a-f090-43c3-4f15-08db844635d0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	s0Qtg/Icim6t0O1s2UrkCb7DpQBdMGQii0WJr7iTzyLOipEhC/507lHtHf0/Uu0ZhJoWLq8vyngqTLAsTKvfNwDiiHoYa0AhG2Fcezgb80ZkBaiOkYtavfEHujWmwH1mrMK/B3xZR9/I97N4zHjH0/ILp5ogqJUryTe5xeL/asn5Y/NtdEy9+rwOeGlw1xcr0HleNT465bPflszlCQTtparXCEZtjcaWPSC2ffeqcvId0pOtKn0YnUa8D7pKYa0aF3Q04moIRzcM+1wd+HRYWXX/GxZKTOnIGO3zI1Vr1arWQJKmqvaqLuy1wHm2g9nOUopnItZBMwkl4hvubomCNoZe845Pcw5S+FYE59ng0kq4e3L35UALzjvWgCaHooKvh0t9vuJ1R2yLie5+stcmDfTfBA0a744sfJfZx3m0ENbBKpZCOTv0+vgbhCB+a+5y4dC94v7mQxTToYQyqZvJn3j6HK8+vGe75UBaWEMLvnftiHzuiA36prXH6+RVxoPetmiGMaDp8a4rWfXHwkWBufZzaCrilTBTz7vyJYH+CkhfXFB8FLtemWpw14spiMRYVL48k3JB9MLC3HAHJtRDejcWpdyMS9mOcvoUHXr6nQYjNlq/k6CrDF7euqJqaoqxpHhHzL16AXKBgFvLLC+7uQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(346002)(39860400002)(136003)(396003)(451199021)(2906002)(2616005)(36756003)(41300700001)(4744005)(7416002)(6506007)(5660300002)(26005)(186003)(53546011)(8936002)(8676002)(31696002)(6666004)(86362001)(478600001)(38100700002)(31686004)(316002)(54906003)(6512007)(66476007)(66556008)(66946007)(6916009)(6486002)(4326008)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?T05wRm5iRVF2OTZnazI0eDFiYVhVbkVCY29FRkNiR29SM3N6d3VBZkthbGMv?=
 =?utf-8?B?cXVHK0dOVmUydXdJSlNRVHFPVDI5Qi9ZV3FVbHIrRFREcXV2N0JtaTFrNDhK?=
 =?utf-8?B?cjU1NXNUUkZaVlZoUW9rSGQ5TlpMMXIrYTladGJmT3BCVWxSb1lnY3hOT3JR?=
 =?utf-8?B?TGlkNjBYMEx1RUN5cGkwNEFyYmNkL1hjbnNhOVYyeUwrQmFJZFJzNE9EMkFD?=
 =?utf-8?B?eWFCYXhpTlJJbHg0c0trUmR5QmVDVUFlSmorcCtKQVU3eVI4STM0VXRMOTBI?=
 =?utf-8?B?Ritlc3M2WTNHUTlGbzRzYmNXL2t0SitUSWgvNWhPYlJ3WTRlb0RhZlBjak92?=
 =?utf-8?B?U0xLZ1pTUjVRSHozczhPcW15TU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f-8?Q?X9BSpyAKFmGoBpZrRmbhM9QTX?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 227c073a-f090-43c3-4f15-08db844635d0
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 08:42:08.9878
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: SdhNM8O5MSYl72bjTS1G8fyhZ5wbEAJ594Xsh9bcheJjPZ4aQSg2WjdRK99KSb23imnPWRj8JVZgrANZ7DgSXw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB7112

On 14.07.2023 10:10, Federico Serafini wrote:
> Change parameter names in function definitions to match the
> corresponding delcarations thus fixing violations of MISRA C:2012
> Rule 8.3 ("All declarations of an object or function shall use the same
> names and type qualifiers").
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

Would have been nice if ...

> --- a/xen/arch/x86/cpu/mcheck/mce_amd.c
> +++ b/xen/arch/x86/cpu/mcheck/mce_amd.c
> @@ -272,13 +272,13 @@ int vmce_amd_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
>  }
>  
>  enum mcheck_type
> -amd_mcheck_init(struct cpuinfo_x86 *ci)
> +amd_mcheck_init(struct cpuinfo_x86 *c)

... const had been added here on this occasion; I may take the liberty
of doing so while committing.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 08:49:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 08:49:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563545.880781 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKEU0-0007d0-Fe; Fri, 14 Jul 2023 08:49:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563545.880781; Fri, 14 Jul 2023 08:49:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKEU0-0007ct-Cr; Fri, 14 Jul 2023 08:49:00 +0000
Received: by outflank-mailman (input) for mailman id 563545;
 Fri, 14 Jul 2023 08:49:00 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qKEU0-0007cn-03
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 08:49:00 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKETw-000463-HJ; Fri, 14 Jul 2023 08:48:56 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKETw-0007oX-Bl; Fri, 14 Jul 2023 08:48:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=1ZuDIzolVXjcGfSwtYfZGIy2VfnapVBjsWS6xe58X0I=; b=LMczv2XecMCYenzptHJYRh5lJx
	lU4+EAvMFTCEGAOeLgAdX98gKee0OGchcAQxidKDYpxDVPJnv6O87jUfAYnseCFdGzeS/7vXXDDWr
	XrmsSAMR7AeXkNvLyDYuxAUe+6Oe/ndhgwDYyvuJhFD0TLCG57u2A+fa7Ps4DCZ+XHcs=;
Message-ID: <610ce9f8-58d1-a5d8-d46a-888e119762b6@xen.org>
Date: Fri, 14 Jul 2023 09:48:54 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH] ns1650: refactor interrupt handling in
 ns16550_uart_dt_init()
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>, Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <cc5a08056abacdbb6d6509b56716eb45467307bb.1689240611.git.oleksii.kurochko@gmail.com>
 <a385a17b-a60c-d770-e044-af64273371d6@suse.com>
 <86702f86787ee7b963b131c4b2d6db463eddc1f3.camel@gmail.com>
 <3e4c673d-1b8b-15ab-629f-27a9f687b37a@suse.com>
 <83f67337cb69fb8cf2aa5d56b8a711384cdaa5f0.camel@gmail.com>
 <200693a2-267d-16c8-61f3-3047dc8967da@suse.com>
 <9415dc2fe8c8ca0325ba6dfe41fdf72cb0f2ea0a.camel@gmail.com>
 <ed458992-b1c3-527c-4372-67355a5616e0@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <ed458992-b1c3-527c-4372-67355a5616e0@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 14/07/2023 07:56, Jan Beulich wrote:
> On 13.07.2023 19:49, Oleksii wrote:
>> On Thu, 2023-07-13 at 16:26 +0200, Jan Beulich wrote:
>>> On 13.07.2023 15:36, Oleksii wrote:
>>>> On Thu, 2023-07-13 at 15:27 +0200, Jan Beulich wrote:
>>>>> I don't understand. My earlier comment was affecting all checks
>>>>> of
>>>>> uart->irq alike, as I'm unconvinced IRQ0 may not possibly be
>>>>> usable
>>>>> on some architecture / platform. IOW I don't see why the check in
>>>>> ns16550_init_postirq() would allow us any leeway.
>>>> It looks like I misunderstood you.
>>>>
>>>> Do you mean that on some architecture IRQ0 may be used for ns16550?
>>>
>>> Yes, I don't see why this shouldn't be possible in principle. As
>>> Julien
>>> said it can't happen on Arm, so if it also can't happen on RISC-V and
>>> PPC, we could elect to continue to ignore that aspect.
>>>
>> Then for RISC-V ( at least, for PLIC interrupt controller ) it is
>> reserved:
>> https://github.com/riscv/riscv-plic-spec/blob/master/riscv-plic.adoc#interrupt-identifiers-ids
>>
>> What about to have 'define NO_IRQ_POLL 0' ( mentioned by Julien )+
>> assert(irq_from_device_tree != NO_IRQ_POLL) ?
> 
> Such a #define may be okay as long as indeed used consistently in all
> places where it belongs (which may mean making some code less simple,
> which is a downside), but I can't judge at all the validity of the
> assertion you propose.

Is the assert() indented to check the return of platform_get_irq()? If 
so, the return value is considered as user input because it is coming 
from the device-tree. assert()s must not be used for checking external 
input. Instead, you need to add proper check (i.e. if (...)).

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 09:29:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 09:29:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563548.880791 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKF6k-0003oc-Ge; Fri, 14 Jul 2023 09:29:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563548.880791; Fri, 14 Jul 2023 09:29:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKF6k-0003oV-E0; Fri, 14 Jul 2023 09:29:02 +0000
Received: by outflank-mailman (input) for mailman id 563548;
 Fri, 14 Jul 2023 09:29:00 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qKF6i-0003oP-SU
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 09:29:00 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKF6c-000581-RO; Fri, 14 Jul 2023 09:28:54 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKF6c-0000uG-GC; Fri, 14 Jul 2023 09:28:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=50WfSytNTAkD+vaGxiaTL0sbP+GHuBfj/91rG957sjc=; b=k0RHeoIDNSQIKXyNHV0DXZdumo
	9ejlFGcrG1cxxfj1Cek2LZPZPYpNn4xNJSiQCgtPBfuj2sBf7i9zLUrhEEjBd8Rh4LKutxBD3AHqo
	m3nQmkwP1ujLEqOMtO4BOwDEFJLn/m1iAiDEbaBIYuowsgOGyTcnlVOVVgj4KbQiJYxc=;
Message-ID: <4a6bd691-95e1-ad15-1054-b43460c85b32@xen.org>
Date: Fri, 14 Jul 2023 10:28:52 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 1/2] restrict concept of pIRQ to x86
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <85e59fd5-9a06-48b4-ba7e-81865d44e332@suse.com>
 <98f51b96-8a1c-7f33-b4d3-1744174df465@suse.com>
 <0cd9d94b-0a8d-a3e1-d683-04fac1572750@xen.org>
 <8cdf9179-7b3f-5a52-ff02-8ededbe03e0c@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <8cdf9179-7b3f-5a52-ff02-8ededbe03e0c@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Jan,

On 11/07/2023 13:29, Jan Beulich wrote:
> On 10.07.2023 22:59, Julien Grall wrote:
>>> ---
>>> I'm not really certain about XEN_DOMCTL_irq_permission: With pIRQ-s not
>>> used, the prior pIRQ -> IRQ translation cannot have succeeded on Arm, so
>>> quite possibly the entire domctl is unused there? Yet then how is access
>>> to particular device IRQs being granted/revoked?
> 
> (Leaving this in context, as it'll be relevant for the last comment you
> gave.)

Sorry I missed this comment.

 > so quite possibly the entire domctl is unused there?

You are right, the domctl permission is not used on Arm.

 >  Yet then how is access to particular device IRQs being granted/revoked?

At the moment, a device can only be attached at domain creation and 
detached when the domain is destroyed. Also, only the toolstack can map 
IRQs. So we don't need to worry for granting/revoking IRQs.

> 
>>> --- a/xen/common/domain.c
>>> +++ b/xen/common/domain.c
>>> @@ -350,6 +350,8 @@ static int late_hwdom_init(struct domain
>>>    #endif
>>>    }
>>>    
>>> +#ifdef CONFIG_HAS_PIRQ
>>> +
>>>    static unsigned int __read_mostly extra_hwdom_irqs;
>>>    static unsigned int __read_mostly extra_domU_irqs = 32;
>>>    
>>> @@ -364,6 +366,8 @@ static int __init cf_check parse_extra_g
>>>    }
>>>    custom_param("extra_guest_irqs", parse_extra_guest_irqs);
>>>    
>>> +#endif /* CONFIG_HAS_PIRQ */
>>
>> NIT: I would suggest create a file pirq.c and move anything PIRQ
>> specific there. This should reduce the number of #ifdef in the code.
> 
> I did consider that, but it looked quite a bit more intrusive to
> me than the few #ifdef-s added to this file. (The ones in other
> files would be yet uglier to eliminate, if that was to be implied
> from your remark.)

I was under the impression we wanted to limit the number of #ifdef in 
the common code. They didn't seem to be warrant here and, from a brief 
look, it didn't seem the option would be that "ugly". But I guess this 
is a matter of taste.

> 
>>> @@ -1864,6 +1874,8 @@ long do_vm_assist(unsigned int cmd, unsi
>>>    }
>>>    #endif
>>>    
>>> +#ifdef CONFIG_HAS_PIRQ
>>> +
>>
>> With this change and some others, we probably can remove
>> alloc_pirq_struct() & co. I will have a look to send a clean-up patch
>> after this goes in.
> 
> Right, there's likely further cleanup possible.
> 
>>> --- a/xen/common/domctl.c
>>> +++ b/xen/common/domctl.c
>>> @@ -683,11 +683,13 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
>>>            unsigned int pirq = op->u.irq_permission.pirq, irq;
>>>            int allow = op->u.irq_permission.allow_access;
>>>    
>>> +#ifdef CONFIG_HAS_PIRQ
>>>            if ( pirq >= current->domain->nr_pirqs )
>>>            {
>>>                ret = -EINVAL;
>>>                break;
>>>            }
>>> +#endif
>>
>> This #ifdef reads a little bit strange. If we can get away with the
>> check for Arm, then why can't when CONFIG_HAS_PIRQ=y? Overall, a comment
>> would be helpful.
> 
> As per the post-commit-message remark first of all I need to understand
> why things were the way they were, and why (whether) that was correct
> (or at least entirely benign) for Arm in the first place. Only then I'll
> (hopefully) be in the position of putting a sensible comment here.
> 
> One thing is clear, I suppose: Without the #ifdef the code wouldn't
> build. Yet imo if things all matched up, it should have been buildable
> either way already in the past. Hence the questions.

Right, it would not build. But does this check really matter even in the 
case where CONFIG_HAS_PIRQ=y? Looking at the code, it sounds like more 
an optimization/a way to return a different error code if there value is 
too high. For the domctl, it doesn't seem to be worth it, the more if we 
need to add #ifdef.

With that, the rest of the domctl should mostly work for Arm.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 09:29:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 09:29:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563549.880800 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKF6w-00045N-Nv; Fri, 14 Jul 2023 09:29:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563549.880800; Fri, 14 Jul 2023 09:29:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKF6w-00045G-LM; Fri, 14 Jul 2023 09:29:14 +0000
Received: by outflank-mailman (input) for mailman id 563549;
 Fri, 14 Jul 2023 09:29:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VHA8=DA=amd.com=Xenia.Ragiadakou@srs-se1.protection.inumbo.net>)
 id 1qKF6v-00044r-Ih
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 09:29:13 +0000
Received: from NAM04-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam04on20607.outbound.protection.outlook.com
 [2a01:111:f400:7e8d::607])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e30037f6-2228-11ee-b239-6b7b168915f2;
 Fri, 14 Jul 2023 11:29:10 +0200 (CEST)
Received: from BY3PR05CA0024.namprd05.prod.outlook.com (2603:10b6:a03:254::29)
 by CH2PR12MB4937.namprd12.prod.outlook.com (2603:10b6:610:64::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.26; Fri, 14 Jul
 2023 09:29:07 +0000
Received: from DM6NAM11FT012.eop-nam11.prod.protection.outlook.com
 (2603:10b6:a03:254:cafe::f4) by BY3PR05CA0024.outlook.office365.com
 (2603:10b6:a03:254::29) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.15 via Frontend
 Transport; Fri, 14 Jul 2023 09:29:06 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 DM6NAM11FT012.mail.protection.outlook.com (10.13.173.109) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.27 via Frontend Transport; Fri, 14 Jul 2023 09:29:06 +0000
Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 14 Jul
 2023 04:29:05 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB07.amd.com
 (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.6; Fri, 14 Jul
 2023 02:29:05 -0700
Received: from 10.0.2.15 (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Fri, 14 Jul 2023 04:29:04 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e30037f6-2228-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KMnpdvlxNR7gN13AKguLpbh1b2uTlfiXGHTRNgGK+TNjPbx+LDl4+CyB3MyP8gDvMSall9l9USxdlHJP0k2bUDXZC3nMTAptwDXTSq+mh7JObDLJ4Hb7xwMFndnooBKV7JEGBbaiMes7lndIAgYQLFwQnomETzWqCa1jFROHlggIQIQFmP7kJHPvH77zPFZ7SL83iB+qZ/iLTxkGiTK/BOIYjDcbL3ca2UEG7H2vlFnK1jWt7iEHcsHvqnlZrdMBlQHzkSOLiCuX1SWpwIvhhypHUyDwbahDidjnSS8lJO5DH2U/QFOt5fR7mRS0ehmRzlXGCIiVuWXhhuJ3D3cJrg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0xOoX2/Cgac9pFbV1Jy/oMIpEZrUX9KsUGUFT4KaB8k=;
 b=mzatdwN+kyGU7PecrYVN7jwASXzSaDRITLswK5LMJh7Nku//EIFbsPjmG7ypgrf/pjVXeVzgFZRXj0xixcyhzD9m6HRJyzs11eDsHTA6cq1OH4NWGe59U+CdtRNy6RGlecyDxC3hCjvPAkFuy17AcTjIfi6qKh5aaWFLr62z3MMOKU8RV53EsCNuVOmop31NNsZqenYe15eHeJdR8+ff92YMQF0lm7XyqFNfwDQmXJPRrM2LAAVgI55gV3QCVp/S6rLDMBuEAvtJYvhAug7ADKlKrM4HpZP1LPBg8HbD+7ZMHRC9B8HQRp/+I/hjD0OfjNvEeXlCRGEmvWSJ1/X24A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=seabios.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0xOoX2/Cgac9pFbV1Jy/oMIpEZrUX9KsUGUFT4KaB8k=;
 b=Yitsv9p+gF7xfGu0OpdX6uq2F+pkIoQc1+xEs4peC4pok4bd97lGsE2zAN5NlhvBVgt0eVsSlRSnzt+BWWcOPN4vwoM7srNV54aYSka8SHWNQWI1Qj46S4K+DsvtYtfwN/cXYFy+vTEFF3h/5XUQwP+TCVIACfZu00sOVRZZybA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Xenia Ragiadakou <xenia.ragiadakou@amd.com>
To: <seabios@seabios.org>
CC: Xenia Ragiadakou <xenia.ragiadakou@amd.com>, Gerd Hoffmann
	<kraxel@redhat.com>, Kevin O'Connor <kevin@koconnor.net>,
	<xen-devel@lists.xenproject.org>
Subject: [PATCH] paravirt: call pci_bios_init_devices() when runningOnXen()
Date: Fri, 14 Jul 2023 12:28:09 +0300
Message-ID: <eed01ea56212a0e1c5ebfd7d087da5a231cb7af1.1689326029.git.xenia.ragiadakou@amd.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DM6NAM11FT012:EE_|CH2PR12MB4937:EE_
X-MS-Office365-Filtering-Correlation-Id: 71c03ef3-fd5a-41a9-05b8-08db844cc532
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	yxctxlntajJR0I3b0s6BCYonnnAY4xGNFdhzLpSa+ovIW6Zf0tf+IgQCodXNcesPgh2T6/uD4pmy6RPXRXsFkFtEdYuRrNTza4DckCzMJ+FHmrkno9iNiL00V2ydMfN1LhFdzaD261khhRT0cBohwk7zKQPsfySfEbEF9llsNVn8QICcBjgg4CFYDWSCkgodpS5oaG+bPtP0GtEH9feO7iSlm1r+EWl/69nGKVcKSsupHNO20rqOS/IJwP4wiIkuhZ3yW9b3Tcrl69yoxfm7cNNh+lROXfmVTJlY/dnVQx7EJC+f2iqBFQKt9zUHawZ5pcs8AG9juMAKL/1JMIz/Zz6AM9zLvlnR+Fsw88yzK2cVh3tMtTM3E3tLKTDEQeGFlBj7otClEMhZ7HRnz7u4WrX9dOaHQniqFqViDsXASbZG2UoQ3TBicHJy9w7B7COwWrGXEUaF2VzEOxpbXEdUt96L1lwWfvtW3IWMf3E38xPaYZpLvgSpibSn37QSpwTh2DE+DvrBYaeOwONbW0XbuOUoQ84vjOMcoTziTkmoko0++/0/f33kq6w29oRQgiZ1+oZYP3hbA7bficvplH6QjsrcDEDv6PbeiEH7PrNDgv8AsG+fdLjlCPg0uWQOCcAMy19mboVA0avKXR9JI0vcSABLkwxFZ0kAM8zLHTKoNoBFxTjFp9ANn4oiQSD7r8m5a8B4fhuNnWFRidA2UND/xC2YkgRh7IBsSb09AleGKRkdmiaKy3fU4jQ9Q+b9JNQUHT9s37CIf2k9HfV1qTK6VA==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(6029001)(4636009)(396003)(39860400002)(346002)(376002)(136003)(451199021)(46966006)(40470700004)(36840700001)(36860700001)(82310400005)(36756003)(86362001)(40480700001)(81166007)(40460700003)(82740400003)(356005)(16576012)(54906003)(44832011)(478600001)(316002)(70586007)(4326008)(6916009)(70206006)(5660300002)(8676002)(2906002)(41300700001)(8936002)(2616005)(336012)(186003)(26005)(47076005)(426003)(83380400001)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 09:29:06.2890
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 71c03ef3-fd5a-41a9-05b8-08db844cc532
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DM6NAM11FT012.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4937

The issue that this patch attempts to address is S3 related.
Currently, suspending a XEN guest multiple times does not work.
This happens because PIIX4 PM io space gets unmapped during S3
resume and any accesses performed to trigger subsequent suspends
are not handled. So, the guest spins on the wake sts bit forever.
Below follows a more detailed description of the issue.

On S3 resume path, QEMU issues piix4_pm_reset() to bring PPIX4 PM
controller to the state expected. More specifically, piix4_pm_reset()
zeroes PMIOSE register, i.e pci_conf[0x80] = 0, and this results in
unmapping PIIX4 PM io space,
i.e. memory_region_set_enabled(&s->io, d->config[0x80] & 1)
It is bios responsibility to reenable PIIX4 PM io space during
S3 resume path. However, when running on XEN, the qemu platform
initialization code does not call pci_bios_init_devices(), hence
the PIIX4 PM controller init function is not called and PiixPmBDF
is not set. The value of PiixPmBDF indicates the presence of PIIX4
PM controller. Thus, S3 resume code in pci_resume() considers that
PIIX4 PM controller is not present and does not perform the relevant
post-resume setup that restores PIIX4 PM io space. This is the reason
why any subsequent guest access to those registers is not handled.

This patch adds a call to pci_bios_init_devices() to the early xen
platform setup code.

Signed-off-by: Xenia Ragiadakou <xenia.ragiadakou@amd.com>
---
 src/fw/paravirt.c | 1 +
 src/fw/pciinit.c  | 2 +-
 src/util.h        | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/fw/paravirt.c b/src/fw/paravirt.c
index fba4e52..0c035eb 100644
--- a/src/fw/paravirt.c
+++ b/src/fw/paravirt.c
@@ -205,6 +205,7 @@ qemu_platform_setup(void)
 
     if (runningOnXen()) {
         pci_probe_devices();
+        pci_bios_init_devices();
         xen_hypercall_setup();
         xen_biostable_setup();
         return;
diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c
index badf13d..f955481 100644
--- a/src/fw/pciinit.c
+++ b/src/fw/pciinit.c
@@ -417,7 +417,7 @@ static void pci_bios_init_device(struct pci_device *pci)
                          PCI_BRIDGE_CTL_SERR);
 }
 
-static void pci_bios_init_devices(void)
+void pci_bios_init_devices(void)
 {
     struct pci_device *pci;
     foreachpci(pci) {
diff --git a/src/util.h b/src/util.h
index aff8e88..ebd863f 100644
--- a/src/util.h
+++ b/src/util.h
@@ -137,6 +137,7 @@ extern u64 pcimem64_start, pcimem64_end;
 extern const u8 pci_irqs[4];
 void pci_setup(void);
 void pci_resume(void);
+void pci_bios_init_devices(void);
 
 // fw/pirtable.c
 void pirtable_setup(void);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 14 10:28:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 10:28:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563557.880811 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKG1l-0002il-4y; Fri, 14 Jul 2023 10:27:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563557.880811; Fri, 14 Jul 2023 10:27:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKG1l-0002ie-11; Fri, 14 Jul 2023 10:27:57 +0000
Received: by outflank-mailman (input) for mailman id 563557;
 Fri, 14 Jul 2023 10:27:56 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dx2S=DA=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qKG1k-0002iY-E1
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 10:27:56 +0000
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com
 [2a00:1450:4864:20::132])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 18319ad6-2231-11ee-b239-6b7b168915f2;
 Fri, 14 Jul 2023 12:27:55 +0200 (CEST)
Received: by mail-lf1-x132.google.com with SMTP id
 2adb3069b0e04-4fbb281eec6so2882865e87.1
 for <xen-devel@lists.xenproject.org>; Fri, 14 Jul 2023 03:27:55 -0700 (PDT)
Received: from EMEAENGAAD19049. ([2.223.46.215])
 by smtp.gmail.com with ESMTPSA id
 o10-20020a05600c510a00b003fbb1ce274fsm1862089wms.0.2023.07.14.03.27.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 14 Jul 2023 03:27:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 18319ad6-2231-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689330474; x=1691922474;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=twurVRsPlIe7uMwCQf+SqDy5nf0XEhbH2pBEM5eBNkw=;
        b=XEPKr3AF68fwYH3XaAnOEfgbgcBV0L5/t5/ByI5CKkS591y46VHjOYwm0igfhdDN5f
         vYIktIOFvqlM/b4QOeFHeHHSNg4Ag6u20drmBjDoZ7gC1GCyw5nK4UVyEXBkd6A9yMdK
         cAVIxehoJr363g9LSW8NzPYJa/3WboWdork2o=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689330474; x=1691922474;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=twurVRsPlIe7uMwCQf+SqDy5nf0XEhbH2pBEM5eBNkw=;
        b=LpTa7b6Zx7Cfmsr4B7J3T2J2qxjx4OIr97WnHeSU/wNEWBh8BmPxknv8AHp+Q8ePVX
         pGiXUNTHRzDnVnMd04nszFX7BYVJgOX38AcT8MCX+eknEFgLwg49Yt7Qc2M2VCBOqwAJ
         j3wFCqVkzKrG3VWXMD7cMjKTt+BusSIlsV7xotRTmNzPvozqh3tiFFHSv4KtEIDJkvRx
         gXihMGzvmh8SHRsg/MScCAbDUe1w44OyRYpG/BX3XTmFL/d3mHFoQxGLHLsOSFbrREeo
         61nmTVLgKRHF7S66Z/Jx4qaf1pH/R3rju+h0SoBKBSwdaURZ4GFuYSeEkvMzFXrrKrr/
         9TrQ==
X-Gm-Message-State: ABy/qLZMCj8Nq5pIcPmzduPOp8bfh1wSRmN04OptJzZYQEjePgI3G+zc
	c3v9pasYUzxjK9FbfKRx+rthjQ==
X-Google-Smtp-Source: APBJJlH4DuCO+oObOR726JhPMmpn9HDxk6v8dWqztMs9QpWndOZldZbRx5rB0k2eHuH7Ok9tbeEEBQ==
X-Received: by 2002:a05:6512:224c:b0:4fb:7626:31a2 with SMTP id i12-20020a056512224c00b004fb762631a2mr3736685lfu.43.1689330474576;
        Fri, 14 Jul 2023 03:27:54 -0700 (PDT)
Message-ID: <64b1232a.050a0220.898b.6177@mx.google.com>
X-Google-Original-Message-ID: <ZLEjIT1adG0W/I3o@EMEAENGAAD19049.>
Date: Fri, 14 Jul 2023 11:27:45 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v3] mm/pdx: Add comments throughout the codebase for pdx
References: <20230707160759.12132-1-alejandro.vallejo@cloud.com>
 <646ce8b8-7a8c-88c1-2b1e-76a721e6f164@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <646ce8b8-7a8c-88c1-2b1e-76a721e6f164@suse.com>

Hi,

On Thu, Jul 13, 2023 at 05:12:09PM +0200, Jan Beulich wrote:
> On 07.07.2023 18:07, Alejandro Vallejo wrote:
> > --- a/xen/include/xen/mm.h
> > +++ b/xen/include/xen/mm.h
> > @@ -31,6 +31,17 @@
> >   *   (i.e. all devices assigned to) a guest share a single DMA address space
> >   *   and, by default, Xen will ensure dfn == pfn.
> >   *
> > + * pdx: Page InDeX
> > + *   Indices into the frame table holding the per-page's book-keeping
> > + *   metadata. A compression scheme may be used, so there's a possibly non
> > + *   identity mapping between valid(mfn) <-> valid(pdx). See the comments
> > + *   in pdx.c for an in-depth explanation of that mapping. This also has a
> > + *   knock-on effect on the directmap, as "compressed" pfns have no
> > + *   corresponding mapped frames.
> 
> Didn't you mean to keep the directmap part optional,
I did.

> which would call for saying "may" here (twice)?
That paragraph as-is doesn't really mandate a directmap. It merely state
that there are knock-on effects on directmap indexing, not that there's
always a directmap to index.

> Yet then ...
>
> 
> > --- a/xen/include/xen/pdx.h
> > +++ b/xen/include/xen/pdx.h
> > @@ -1,6 +1,73 @@
> >  #ifndef __XEN_PDX_H__
> >  #define __XEN_PDX_H__
> >  
> > +/*
> > + * PDX (Page inDeX)
> > + *
> > + * This file deals with optimisations pertaining to frame table and
> > + * directmap indexing, A pdx is an index into the frame table, which
> > + * typically also means an index into the directmap[1]. However, having an
> > + * identity relationship between mfn and pdx could waste copious amounts of
> > + * memory in empty frame table entries and page tables. There are some
> > + * techniques to bring memory wastage down.
> > + *
> > + * [1] Some ports apply further modifications to a pdx before indexing the
> > + *     directmap. This doesn't change the fact that the same compression
> > + *     present in the frame table is also present in the directmap
> > + *     whenever said map is present.
> 
> .. you mention it here as non-optional as well. Didn't you tell me that
> Arm doesn't use compressed indexes into the directmap?
> 
> Jan

The [1] note states "whenever said map is present", meaning that it may not
be present. Saying it's optional is a stretch though. It's not like we can
choose right now.

> Didn't you tell me that Arm doesn't use compressed indexes into the directmap?
arm32 doesn't have a directmap at all. arm64 uses biased pdx as indices
(they are offset by a constant), so they are still subject to compression.

Alejandro


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 10:36:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 10:36:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563560.880820 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKG9q-0004Ba-UM; Fri, 14 Jul 2023 10:36:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563560.880820; Fri, 14 Jul 2023 10:36:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKG9q-0004BT-RO; Fri, 14 Jul 2023 10:36:18 +0000
Received: by outflank-mailman (input) for mailman id 563560;
 Fri, 14 Jul 2023 10:36:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=dZ6j=DA=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qKG9p-0004BN-86
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 10:36:17 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on2060a.outbound.protection.outlook.com
 [2a01:111:f400:7d00::60a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4256fcae-2232-11ee-b239-6b7b168915f2;
 Fri, 14 Jul 2023 12:36:15 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM8PR04MB7985.eurprd04.prod.outlook.com (2603:10a6:20b:234::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.27; Fri, 14 Jul
 2023 10:36:13 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Fri, 14 Jul 2023
 10:36:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4256fcae-2232-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=MxBL9k1guvJu+LE4HgQJuH1nCDfgEAG39UvHcnkg6cTP2ZDhAk03aX6WX7Mf5iUCkjg0EoOaX2JlR2yuY/0154Y15r0mr6zy5fJRaxI/noLhklhPcZvm9u9utaoKYhzTR5vKAQbPSyBMUlq2bMFuLGW1xBiAqsixaBm/46NbXArf2EfB9V03R+gojT3LzCPnZDiAGmtLYNi0nBPCmUYBYACIdQy4zbj4a21Vu9VzJzChmaV6Om2q5n/HjYQ3KocYl6al/5+Z6zCerV2Eo/aRY48XhnwJnlDOjqqiCvxdPf9jAXynoPMNXuf3O7CzZ3Z1dy+tVPoNMhWn7ZvQxbkGZw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=9+RaykPCRbdgeRyXofqTtk73lNViHXDMglaAipBLksg=;
 b=OTb6E3XgwXDU2Pfo3jjkMQY1AA1G8Nzux1Rq+203X8wD1jTjEzPPSpeE/I2y5/Kz3IqjyikHsSaRoCoP7zgAEVdJwPjhe5yYcRtkTxqw48iy6eh9XGiVQcpSmsOBwPrsQe/RSsMNg+PpF/9S97HbyXQcXmr861GlZtwfG6DkTSKEix0kjd92r4xKJr45oDR80QX482paRnt/wjOEQb1P1JyQwsIQd3SN9KBWYQLH0EhqToVPGs5K0+m/RdcaJXXGHX5cRTQhRuQgQfxJuUrgUYHe3qNJ2ZZxpK3RX8Kapew+Nc4ha/49JxKHq3JflIQ1ruWvW5ZBQNn7ZGGtAOITfw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=9+RaykPCRbdgeRyXofqTtk73lNViHXDMglaAipBLksg=;
 b=dTryznHbDOabxCjDWqef6VHq0qVsF5LJaPx0+M2KPlMmb9WbbbiCZWtl/HrEEtZpEBBt9r61AIIQjuLBWwoyw4LDyZrv7oI1ziVo8iI/NxkYyVFZ7DIQZ3fOu6uQ1rr6s3oytirrEhTIr7EI6VCsbjfaOcUuQM1rnCeIahJjg4G9BUxbZa/eHNyMLZMibl4SvFpu2vZMk8qzArwZj0jVHFoKmLXUS2D7AkAc8Oyrer4XnbYZ8yAEJCZwDhZQR7Xv5iGb0lM3xm5mkjKzNLyjx6Zd3gEyt0ujJPZ284sIUNd8dadA5Xzk6l8teQ/NdNTHrzYm61WIuV1ptNZsAJ+Eng==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <6519818f-d31e-d588-6613-3671cc7427d4@suse.com>
Date: Fri, 14 Jul 2023 12:36:11 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3] mm/pdx: Add comments throughout the codebase for pdx
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230707160759.12132-1-alejandro.vallejo@cloud.com>
 <646ce8b8-7a8c-88c1-2b1e-76a721e6f164@suse.com>
 <64b1232a.050a0220.898b.6177@mx.google.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <64b1232a.050a0220.898b.6177@mx.google.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0047.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:48::18) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM8PR04MB7985:EE_
X-MS-Office365-Filtering-Correlation-Id: 38e34685-aeb2-453e-a2fc-08db84562540
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	vYA0mfBvMMsNk7ZpGpqFfnVhDwZkWMdbiWto6QV21BQVrAQOiJzXMd3AvI4GhRqDPsr38/FO5P12ggq661VNQlB2M4yP3OiKTUumaAfSP3o8dlqGf8RT5RMsEEYdYWOdxqWUbki5NbyaVJLeaz35lZCR9WXWxALJ6sfsE/geBqq83WMqfPQAIlMTlbW/Z4PPzUOrXR9QB57u8uh1D+xizJYmZsgWBFnvZTcWHd5Di0W2ym5R3EQt+VFsj2QgYm5+w2wduPPaSTBHmrWxgniClpd/M8d+XbHqk4cKJUxA/bXOUfMeejckW2KnOOz99JDbAf1YxXV5I/nwYhJ0+gZ1dC29oha/gMbtGeW93PI83keBCE0xPL/tR+gcg7e2UTtdhGyVzAC1uQf5c2AB85/GfM8uKfp3D3sknpomsviGpx5WZ/KbKNbsKa0NAKrRGlT4y4Q197g+bc2Ns4qZ7i1xdgdq8lkgPFtlu4CPAB2YKlweN7okpL2od3KYhbknV61qbf7xVk3TvNslN/eBGy5Kewmju/h3UYxwhHED5vGQhgakgWRtXQACQ2R8zH9WoWlGWbYf4Mc9ri6fZJI3kHmNZiHQQYMxc2YHlfw4fR4kHUrfzTW35PGHpS+5nm3qVeChciWX7xbG1MtFon85MtzFqw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(136003)(396003)(376002)(366004)(451199021)(31686004)(66899021)(2906002)(478600001)(54906003)(6486002)(8676002)(8936002)(36756003)(66946007)(66556008)(4326008)(316002)(41300700001)(6916009)(66476007)(6512007)(38100700002)(186003)(31696002)(5660300002)(6506007)(2616005)(86362001)(53546011)(26005)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RDRpaEtvcjNBMDVwRE14TnJLMzFTS0s3RFZQVnJIMEFQQ0Q5NWNkRDdvUUdF?=
 =?utf-8?B?bzBRYkVYY0FNWDJvZGNpVGJKRWpMMkRSNUxHaUhDOUdoSDU1WjdkMTErMVlh?=
 =?utf-8?B?MnFCWVE4UmlsdCtsdGlSTGpaTWc0K2ZuOVV4MUhYa3hOMXJaMXROeldLWFox?=
 =?utf-8?B?dVNXVnJDY2dXaXE1Lyt4TXlZS1M3TW1tSU1GdUlibFd2OFJLRXdDeW15ZmhM?=
 =?utf-8?B?dzFNY0RjdGxPbEFwQWc5OGhCcjExUFhuWXN2Wm9tZlh6N0gyMmEwbUp1TVcv?=
 =?utf-8?B?dzFvMlNnc0NTUWVieXdIK2JDVjkzY0o3cnEwVWQxdTU0dDhoTFpVeEpUcklM?=
 =?utf-8?B?ZlQ4ZG56QWpWUWVwdWtYUFUvSEMvZ3JSb2xrTzhPMUZkbDNaMlNkbng4Y0Er?=
 =?utf-8?B?ZUxCU2N3S2F4SXUyOWd3akE2TTRDaTVzcXhQcDdUZXZDcndiL21iZ1U1UTF5?=
 =?utf-8?B?WWN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ossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 10:36:13.1546
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 3TGbo79O6P9O5vlzdooii2dPHFMfnXPN0th9qW34KgWjOxRiPo940Aw4bmpZ7r0gvaKXxNEHfyzdQjtDr6Yraw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7985

On 14.07.2023 12:27, Alejandro Vallejo wrote:
> On Thu, Jul 13, 2023 at 05:12:09PM +0200, Jan Beulich wrote:
>> On 07.07.2023 18:07, Alejandro Vallejo wrote:
>>> --- a/xen/include/xen/mm.h
>>> +++ b/xen/include/xen/mm.h
>>> @@ -31,6 +31,17 @@
>>>   *   (i.e. all devices assigned to) a guest share a single DMA address space
>>>   *   and, by default, Xen will ensure dfn == pfn.
>>>   *
>>> + * pdx: Page InDeX
>>> + *   Indices into the frame table holding the per-page's book-keeping
>>> + *   metadata. A compression scheme may be used, so there's a possibly non
>>> + *   identity mapping between valid(mfn) <-> valid(pdx). See the comments
>>> + *   in pdx.c for an in-depth explanation of that mapping. This also has a
>>> + *   knock-on effect on the directmap, as "compressed" pfns have no
>>> + *   corresponding mapped frames.
>>
>> Didn't you mean to keep the directmap part optional,
> I did.
> 
>> which would call for saying "may" here (twice)?
> That paragraph as-is doesn't really mandate a directmap. It merely state
> that there are knock-on effects on directmap indexing, not that there's
> always a directmap to index.
> 
>> Yet then ...
>>
>>
>>> --- a/xen/include/xen/pdx.h
>>> +++ b/xen/include/xen/pdx.h
>>> @@ -1,6 +1,73 @@
>>>  #ifndef __XEN_PDX_H__
>>>  #define __XEN_PDX_H__
>>>  
>>> +/*
>>> + * PDX (Page inDeX)
>>> + *
>>> + * This file deals with optimisations pertaining to frame table and
>>> + * directmap indexing, A pdx is an index into the frame table, which
>>> + * typically also means an index into the directmap[1]. However, having an
>>> + * identity relationship between mfn and pdx could waste copious amounts of
>>> + * memory in empty frame table entries and page tables. There are some
>>> + * techniques to bring memory wastage down.
>>> + *
>>> + * [1] Some ports apply further modifications to a pdx before indexing the
>>> + *     directmap. This doesn't change the fact that the same compression
>>> + *     present in the frame table is also present in the directmap
>>> + *     whenever said map is present.
>>
>> .. you mention it here as non-optional as well. Didn't you tell me that
>> Arm doesn't use compressed indexes into the directmap?
>>
>> Jan
> 
> The [1] note states "whenever said map is present", meaning that it may not
> be present. Saying it's optional is a stretch though. It's not like we can
> choose right now.
> 
>> Didn't you tell me that Arm doesn't use compressed indexes into the directmap?
> arm32 doesn't have a directmap at all. arm64 uses biased pdx as indices
> (they are offset by a constant), so they are still subject to compression.

Hmm, then our understanding of "optional" was differing: I understood
"use of compressed indexes is optional", when you apparently meant
"the use of a directmap is optional". If this is the case, then I
agree with the chosen wording. (Nevertheless using the suggested "may"
wouldn't yield and incorrect outcome.)

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 10:59:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 10:59:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563566.880836 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKGW3-0006uD-Mp; Fri, 14 Jul 2023 10:59:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563566.880836; Fri, 14 Jul 2023 10:59:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKGW3-0006u6-K9; Fri, 14 Jul 2023 10:59:15 +0000
Received: by outflank-mailman (input) for mailman id 563566;
 Fri, 14 Jul 2023 10:59:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=lIDz=DA=citrix.com=prvs=552896509=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qKGW1-0006ty-W5
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 10:59:14 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 75efabed-2235-11ee-b239-6b7b168915f2;
 Fri, 14 Jul 2023 12:59:12 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 75efabed-2235-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689332352;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=DIB6Cy1+k9QGwvGHQUyNwfDEPpOlJOzj3JPEDXPcr1E=;
  b=bw30zUlALoD5rXcj2d8vHe6drves45S/bwRmSQqWD8A1O7r2GcYV6j7y
   +b8F1eZhhcmlyZ2iOjIIFT6/f9MtkR8+j2HqYEVQlgpI/dAdvMiQK+KJy
   cduZxNtY3vEw5vl0BRy0JYNQ9k2RWVNjboJyjoocmf1jaK1sejkOVQ/MG
   o=;
Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 115517592
X-Ironport-Server: esa6.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:swkbS6DYawrdeRVW/8rjw5YqxClBgxIJ4kV8jS/XYbTApD9x3jIBm
 zFOWmuPbP6PNGTyKNEkPt/g9R8BvsPWzoJnQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h
 yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs
 t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GxB4gRnDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS
 uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada
 jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIwpsAoPWhh6
 /wjGTVXZy2/ldCKmaiaRbw57igjBJGD0II3v3hhyXfSDOo8QICFSKLPjTNa9G5u3IYUR6+YP
 pdHL2M1N3wsYDUWUrsTILs4kP2lmT/UdDpApUjOjaE2/3LS3Ep6172F3N/9I4XXGJwKwxfCz
 o7A123AQU4ILICc8GCq7nC0o+/lkD7XRatHQdVU8dY12QbOlwT/EiY+RVa95PW0lEO6c9ZeM
 FAPvDojq7Ao806mRcW7WAe3yFamlBMBX9tbE8Uh9RqAjKHT5m6xHXMYRzRMbNgnss4eRjEw0
 FKN2dTzClRHr7m9WX+bsLCOoluaOzURLGIETT8JS00C+daLiJs0hB/VUtElGqe6iNTvEBn63
 j+RoS4xwb4UiKYj0aSw+lTOxSyhuoLISA8d7BjYRW+j4UVyY4vNWmCzwQGFt7Aadt/fFwTf+
 iFewKBy8dziE7nRsnOxScoTHIqY4qyMDQHOs2I2BbguomHFF2GYQWxA3N1vDB43YpdfI2e5O
 BC7VRB5v8EKYibzBUNjS8foUplxk/C9fTjwfqqMBueidKSdY+NuEMtGQUeLl17gn0E3+U3UE
 cfKKJ38ZZr25EkO8dZXewv++eVxrszG7TmPLa0XNjz+uVZkWFabSK0eLHyFZf0j4aWPrW39q
 ogPZpHVkE0ADLOjMkE7FLL/y3hQdhDX4riv+6RqmhOreFI6SAnN9deMqV/eR2CVt/sMzbqZl
 p1MckRZ1ED+lRX6xfaiMxhehEfUdc8n9xoTZHV8VWtELlB/Oe5DGo9DLcpoFVTmncQ/pcNJo
 w4tJ5/YXKkQFmyeolzwr/DV9eRfSfhivirWVwLNXdT1V8cIq9DhkjM8QjbSyQ==
IronPort-HdrOrdr: A9a23:Q1L68K4gvkLjQbwxBgPXwAzXdLJyesId70hD6qkQc3Fom62j5q
 WTdZEgvyMc5wx/ZJhNo7690cq7MBHhHPxOgbX5VI3KNGXbUQOTR72KhrGSoAEIdReeygZcv5
 0QCZSXCrfLfCVHZRCR2njFLz4iquP3j5xBnY3lvhNQpZkBUdAZ0+9+YDzrdXFedU19KrcSMo
 GT3cZDryrIQwVtUizqbkN1OdQqvrfw5evbXSI=
X-Talos-CUID: 9a23:L+C6VmyRostI8z+thkhHBgVIPJ8Ze1LDzEzhJhWxNFp7eoHMU36frfY=
X-Talos-MUID: 9a23:H5ckHAnq0wCxrQE62uChdnprDYQ38bzyC3lXvokEo+yEHyFtFyq02WE=
X-IronPort-AV: E=Sophos;i="6.01,205,1684814400"; 
   d="scan'208";a="115517592"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap
	<George.Dunlap@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>, "Stefano
 Stabellini" <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, Julien Grall
	<julien@xen.org>, Roberto Bagnara <roberto.bagnara@bugseng.com>, "Nicola
 Vetrini" <nicola.vetrini@bugseng.com>
Subject: [PATCH] xen/common: Use const char * for string literals
Date: Fri, 14 Jul 2023 11:59:02 +0100
Message-ID: <20230714105902.2996620-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain

For pre-ANSI-C compatibility reasons, string literals have a mutable type, but
it is undefined behaviour to mutate them.

Swap char *'s to const char *'s for variables which hold string literals.

This fixes several violations of MISRA Rule 7.4:

  A string literal shall not be assigned to an object unless the object's type
  is "pointer to const-qualified char".

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: George Dunlap <George.Dunlap@eu.citrix.com>
CC: Jan Beulich <JBeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Wei Liu <wl@xen.org>
CC: Julien Grall <julien@xen.org>
CC: Roberto Bagnara <roberto.bagnara@bugseng.com>
CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/common/gunzip.c                | 2 +-
 xen/common/ioreq.c                 | 3 ++-
 xen/common/libelf/libelf-dominfo.c | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/common/gunzip.c b/xen/common/gunzip.c
index b810499be2b6..2c6eae167d54 100644
--- a/xen/common/gunzip.c
+++ b/xen/common/gunzip.c
@@ -52,7 +52,7 @@ typedef unsigned long   ulg;
 static long __initdata bytes_out;
 static void flush_window(void);
 
-static __init void error(char *x)
+static __init void error(const char *x)
 {
     panic("%s\n", x);
 }
diff --git a/xen/common/ioreq.c b/xen/common/ioreq.c
index ecb8f545e1c4..7cb717f7a2a4 100644
--- a/xen/common/ioreq.c
+++ b/xen/common/ioreq.c
@@ -501,7 +501,8 @@ static int ioreq_server_alloc_rangesets(struct ioreq_server *s,
 
     for ( i = 0; i < NR_IO_RANGE_TYPES; i++ )
     {
-        char *name, *type;
+        const char *type;
+        char *name;
 
         switch ( i )
         {
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index fcaee2f7bcff..a13a5e4db603 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -100,7 +100,7 @@ elf_errorstatus elf_xen_parse_note(struct elf_binary *elf,
 {
 /* *INDENT-OFF* */
     static const struct {
-        char *name;
+        const char *name;
         bool str;
     } note_desc[] = {
         [XEN_ELFNOTE_ENTRY] = { "ENTRY", 0},
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 14 11:00:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 11:00:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563569.880846 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKGXA-0008I3-00; Fri, 14 Jul 2023 11:00:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563569.880846; Fri, 14 Jul 2023 11:00:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKGX9-0008Hw-TH; Fri, 14 Jul 2023 11:00:23 +0000
Received: by outflank-mailman (input) for mailman id 563569;
 Fri, 14 Jul 2023 11:00:22 +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
 <SRS0=lIDz=DA=citrix.com=prvs=552896509=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qKGX8-0008Hk-0d
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 11:00:22 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9e42351f-2235-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 13:00:19 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9e42351f-2235-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689332419;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=SxhCInnklup+XeRx+IqG2pAVyIM+zCWGUjhGJE2lHlc=;
  b=Er7jJTMPmE1CYnyP7p0E39Wy2crNWJMQdAfMPKWOap+S2tvgie/ghFbu
   caX0VmbDRW4/citr/uKhdTXc91fmDc+v7/KJge1iq+kgmgOTmPjDRKYeQ
   cZMKA83ttawBpfkUp2jn4la4cBREke+2UFYKV2a+xyP83N1t2Ri41ObFs
   8=;
Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 114929888
X-Ironport-Server: esa5.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:A9Lk8aJKH3G2UsPNFE+RApUlxSXFcZb7ZxGr2PjKsXjdYENSgzxVy
 mVJXGqHOvrYYDSgKNBwOdiy9BgGuZ7Qz9RkHAplqX01Q3x08seUXt7xwmUcnc+xBpaa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5FGhELPe6S0UvoX8dtJed6q7A7lKcco
 jtsU5zoP8mjgw/vo1w1BaQRZqQ7HPh3rWpi5xaYXQU=
IronPort-HdrOrdr: A9a23:4piWI60rtmkKv6tqUpcYfwqjBHYkLtp133Aq2lEZdPU0SKGlfq
 GV7ZEmPHrP4gr5N0tOpTntAse9qBDnhPxICOsqXYtKNTOO0AeVxelZhrcKqAeQeBEWmNQ96U
 9hGZIOcuEZDzJB/LvHCN/TKadd/DGFmprY+ts31x1WPGVXgzkL1XYANu6ceHcGIzVuNN4CO7
 e3wNFInDakcWR/VLXBOpFUN9KzweEijfjdEGc7OyI=
X-Talos-CUID: 9a23:489vfG8yxObtcaD4PpuVv20eF94JSGLR8Fz7OUXpCDoycZqzcFDFrQ==
X-Talos-MUID: 9a23:1rxkxAbxXs9vceBTm2TtrxNBatVT0amOJnlK0sRBl+6mDHkl
X-IronPort-AV: E=Sophos;i="6.01,205,1684814400"; 
   d="scan'208";a="114929888"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
	<JBeulich@suse.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Roberto Bagnara <roberto.bagnara@bugseng.com>,
	Nicola Vetrini <nicola.vetrini@bugseng.com>
Subject: [PATCH] x86/common: Use const char * for string literals
Date: Fri, 14 Jul 2023 12:00:09 +0100
Message-ID: <20230714110009.3004073-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

For pre-ANSI-C compatibility reasons, string literals have a mutable type, but
it is undefined behaviour to mutate them.

Swap char *'s to const char *'s for variables which hold string literals.

This fixes several violations of MISRA Rule 7.4:

  A string literal shall not be assigned to an object unless the object's type
  is "pointer to const-qualified char".

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Roberto Bagnara <roberto.bagnara@bugseng.com>
CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/x86/acpi/cpu_idle.c       | 2 +-
 xen/arch/x86/cpu/mcheck/mce.c      | 2 +-
 xen/arch/x86/cpu/mcheck/mce.h      | 2 +-
 xen/arch/x86/e820.c                | 2 +-
 xen/arch/x86/hvm/vmx/vmcs.c        | 4 ++--
 xen/arch/x86/include/asm/hvm/hvm.h | 2 +-
 xen/arch/x86/oprofile/nmi_int.c    | 8 ++++----
 xen/arch/x86/time.c                | 4 ++--
 xen/include/xen/dmi.h              | 4 ++--
 9 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 427c8c89c5c4..cfce4cc0408f 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -302,7 +302,7 @@ static void print_hw_residencies(uint32_t cpu)
            hw_res.cc6, hw_res.cc7);
 }
 
-static char* acpi_cstate_method_name[] =
+static const char *const acpi_cstate_method_name[] =
 {
     "NONE",
     "SYSIO",
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 3e93bdd8dab4..1144a91aa444 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1706,7 +1706,7 @@ static void mc_panic_dump(void)
     dprintk(XENLOG_ERR, "End dump mc_info, %x mcinfo dumped\n", mcinfo_dumpped);
 }
 
-void mc_panic(char *s)
+void mc_panic(const char *s)
 {
     is_mc_panic = true;
     console_force_unlock();
diff --git a/xen/arch/x86/cpu/mcheck/mce.h b/xen/arch/x86/cpu/mcheck/mce.h
index dd5d258362e6..7de8aa98378a 100644
--- a/xen/arch/x86/cpu/mcheck/mce.h
+++ b/xen/arch/x86/cpu/mcheck/mce.h
@@ -57,7 +57,7 @@ struct mcinfo_extended *intel_get_extended_msrs(
 bool mce_available(const struct cpuinfo_x86 *c);
 unsigned int mce_firstbank(struct cpuinfo_x86 *c);
 /* Helper functions used for collecting error telemetry */
-void noreturn mc_panic(char *s);
+void noreturn mc_panic(const char *s);
 void x86_mc_get_cpu_info(unsigned, uint32_t *, uint16_t *, uint16_t *,
                          uint32_t *, uint32_t *, uint32_t *, uint32_t *);
 
diff --git a/xen/arch/x86/e820.c b/xen/arch/x86/e820.c
index c5911cf48dc4..0b89935510ae 100644
--- a/xen/arch/x86/e820.c
+++ b/xen/arch/x86/e820.c
@@ -363,7 +363,7 @@ static unsigned long __init find_max_pfn(void)
     return max_pfn;
 }
 
-static void __init clip_to_limit(uint64_t limit, char *warnmsg)
+static void __init clip_to_limit(uint64_t limit, const char *warnmsg)
 {
     unsigned int i;
     char _warnmsg[160];
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index b2095636250c..13719cc923d9 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1949,7 +1949,7 @@ static inline unsigned long vmr(unsigned long field)
     (uint32_t)vmr(fld);                       \
 })
 
-static void vmx_dump_sel(char *name, uint32_t selector)
+static void vmx_dump_sel(const char *name, uint32_t selector)
 {
     uint32_t sel, attr, limit;
     uint64_t base;
@@ -1960,7 +1960,7 @@ static void vmx_dump_sel(char *name, uint32_t selector)
     printk("%s: %04x %05x %08x %016"PRIx64"\n", name, sel, attr, limit, base);
 }
 
-static void vmx_dump_sel2(char *name, uint32_t lim)
+static void vmx_dump_sel2(const char *name, uint32_t lim)
 {
     uint32_t limit;
     uint64_t base;
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index 9555b4c41fef..3c37f522b90d 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -92,7 +92,7 @@ struct hvm_vcpu_nonreg_state {
  * supports Intel's VT-x and AMD's SVM extensions.
  */
 struct hvm_function_table {
-    char *name;
+    const char *name;
 
     /* Support Hardware-Assisted Paging? */
     bool_t hap_supported;
diff --git a/xen/arch/x86/oprofile/nmi_int.c b/xen/arch/x86/oprofile/nmi_int.c
index 17bf3135f86f..1313818af8dd 100644
--- a/xen/arch/x86/oprofile/nmi_int.c
+++ b/xen/arch/x86/oprofile/nmi_int.c
@@ -36,7 +36,7 @@ struct op_x86_model_spec const *__read_mostly model;
 static struct op_msrs cpu_msrs[NR_CPUS];
 static unsigned long saved_lvtpc[NR_CPUS];
 
-static char *cpu_type;
+static const char *cpu_type;
 
 static DEFINE_PER_CPU(struct vcpu *, nmi_cont_vcpu);
 
@@ -309,7 +309,7 @@ void nmi_stop(void)
 }
 
 
-static int __init p4_init(char ** cpu_type)
+static int __init p4_init(const char **cpu_type)
 {
 	unsigned int cpu_model = current_cpu_data.x86_model;
 
@@ -353,7 +353,7 @@ static int __init cf_check force_cpu_type(const char *str)
 }
 custom_param("cpu_type", force_cpu_type);
 
-static int __init ppro_init(char ** cpu_type)
+static int __init ppro_init(const char **cpu_type)
 {
 	if (force_arch_perfmon && cpu_has_arch_perfmon)
 		return 0;
@@ -375,7 +375,7 @@ static int __init ppro_init(char ** cpu_type)
 	return 1;
 }
 
-static int __init arch_perfmon_init(char **cpu_type)
+static int __init arch_perfmon_init(const char **cpu_type)
 {
 	if (!cpu_has_arch_perfmon)
 		return 0;
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index f5e30d4e0236..af40a9993c81 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -64,8 +64,8 @@ struct cpu_time {
 };
 
 struct platform_timesource {
-    char *id;
-    char *name;
+    const char *id;
+    const char *name;
     u64 frequency;
     /* Post-init this hook may only be invoked via the read_counter() wrapper! */
     u64 (*read_counter)(void);
diff --git a/xen/include/xen/dmi.h b/xen/include/xen/dmi.h
index fa25f6cd3816..71a5c46dc6ea 100644
--- a/xen/include/xen/dmi.h
+++ b/xen/include/xen/dmi.h
@@ -20,12 +20,12 @@ enum dmi_field {
  */
 struct dmi_strmatch {
 	u8 slot;
-	char *substr;
+	const char *substr;
 };
 
 struct dmi_system_id {
 	int (*callback)(const struct dmi_system_id *);
-	char *ident;
+	const char *ident;
 	struct dmi_strmatch matches[4];
 	void *driver_data;
 };
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 14 11:47:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 11:47:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563577.880857 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKHGS-0004ek-HY; Fri, 14 Jul 2023 11:47:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563577.880857; Fri, 14 Jul 2023 11:47:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKHGS-0004ed-El; Fri, 14 Jul 2023 11:47:12 +0000
Received: by outflank-mailman (input) for mailman id 563577;
 Fri, 14 Jul 2023 11:47:10 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKHGQ-0004eT-EX; Fri, 14 Jul 2023 11:47:10 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKHGQ-0008Ky-7p; Fri, 14 Jul 2023 11:47:10 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKHGP-0005r5-PH; Fri, 14 Jul 2023 11:47:09 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qKHGP-0001hJ-Oo; Fri, 14 Jul 2023 11:47:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=cvHI4vZ7NEwLbRtzO39dHFXt+AURd86slBbZQ5zjs7s=; b=Or1NdROPOnpFzCtbFpCToM0msx
	dv5JVx8wrlsGGrtfTQ6t1zl/ZVJ8VsgBD0A/jWG+LMy2Fwt9At7qyb3RcKnC9MQ7NexvlsvZU0+6r
	hGWCj0ZKcXTCrvY3i9edCTL1QzhFv3Efjfrf2tXhaLLCM8xEjccy7o31YJe0vc08jzko=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181783-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181783: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-credit1:guest-start/debian.repeat:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:build-arm64-pvops:kernel-build:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:guest-start:fail:heisenbug
    linux-linus:test-amd64-amd64-freebsd11-amd64:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-vhd:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-credit2:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-arm64-arm64-xl-credit2:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-examine:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=eb26cbb1a754ccde5d4d74527dad5ba051808fad
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 14 Jul 2023 11:47:09 +0000

flight 181783 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181783/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-credit1 22 guest-start/debian.repeat fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 build-arm64-pvops             6 kernel-build             fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start    fail in 181778 REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start    fail in 181778 REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-shadow   14 guest-start      fail in 181778 pass in 181783
 test-amd64-amd64-freebsd11-amd64 19 guest-localmigrate/x10 fail in 181778 pass in 181783
 test-amd64-amd64-xl-vhd 21 guest-start/debian.repeat fail in 181778 pass in 181783
 test-amd64-amd64-xl-credit2  22 guest-start/debian.repeat  fail pass in 181778
 test-amd64-amd64-xl-qemut-debianhvm-amd64 18 guest-localmigrate/x10 fail pass in 181778

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-xl-credit2   1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-thunderx  1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-vhd       1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-xsm       1 build-check(1)               blocked  n/a
 test-arm64-arm64-examine      1 build-check(1)               blocked  n/a
 test-arm64-arm64-libvirt-raw  1 build-check(1)               blocked  n/a
 test-arm64-arm64-libvirt-xsm  1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl           1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-credit1   1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl         15 migrate-support-check fail in 181778 never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check fail in 181778 never pass
 test-arm64-arm64-xl     16 saverestore-support-check fail in 181778 never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check fail in 181778 never pass
 test-arm64-arm64-xl-credit1 15 migrate-support-check fail in 181778 never pass
 test-arm64-arm64-xl-credit1 16 saverestore-support-check fail in 181778 never pass
 test-arm64-arm64-xl-credit2 15 migrate-support-check fail in 181778 never pass
 test-arm64-arm64-xl-credit2 16 saverestore-support-check fail in 181778 never pass
 test-arm64-arm64-xl-xsm     15 migrate-support-check fail in 181778 never pass
 test-arm64-arm64-xl-xsm 16 saverestore-support-check fail in 181778 never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check fail in 181778 never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check fail in 181778 never pass
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                eb26cbb1a754ccde5d4d74527dad5ba051808fad
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   88 days
Failing since        180281  2023-04-17 06:24:36 Z   88 days  175 attempts
Testing same since   181778  2023-07-13 01:44:31 Z    1 days    2 attempts

------------------------------------------------------------
3739 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            fail    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          blocked 
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 blocked 
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      blocked 
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  blocked 
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  blocked 
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     blocked 
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 blocked 
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 blocked 
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      blocked 
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 622639 lines long.)


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 11:49:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 11:49:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563582.880867 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKHIy-0005HB-V1; Fri, 14 Jul 2023 11:49:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563582.880867; Fri, 14 Jul 2023 11:49:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKHIy-0005H4-S3; Fri, 14 Jul 2023 11:49:48 +0000
Received: by outflank-mailman (input) for mailman id 563582;
 Fri, 14 Jul 2023 11:49:47 +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
 <SRS0=Z95V=DA=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qKHIx-0005Gy-0z
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 11:49:47 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8669acc6-223c-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 13:49:44 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.163.94.163])
 by support.bugseng.com (Postfix) with ESMTPSA id 33D494EE0739;
 Fri, 14 Jul 2023 13:49:42 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8669acc6-223c-11ee-8611-37d641c3527e
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [RFC PATCH 0/4] fix some issues related to MISRA C:2012 Rule 9.1
Date: Fri, 14 Jul 2023 13:49:17 +0200
Message-Id: <cover.1689329728.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This patch series is aimed at discussing different categories of
patterns concerning local variables that are possibly not
initialized in all code paths, which results in hard-to-prove
correctness. The main categories are as follows:

1. Variables initialized by passing a pointer to them to a function.
   Many such functions are coupled with error handling which results
	 in the variable not being initialized.

2. Some variables are used in switch statements and the control flow
   ensures that all code paths do initialize them, but due to the
	 presence of goto statements, the flow is harder to follow.

I emphasize that, as far as I can tell, the code is already
compliant with the rule, but there is room for improvement, especially
on the side of allowing automatic checks to be more effective.

Nicola Vetrini (4):
  xen/arm: justify or initialize conditionally uninitialized variables
  xen/arm64: bitops: justify uninitialized variable inside a macro
  xen/arm: initialize conditionally uninitialized local variables
  xen/arm: initialize conditionally uninitialized local variables

 docs/misra/safe.json                        | 24 +++++++++++++++
 xen/arch/arm/arm64/lib/bitops.c             |  3 ++
 xen/arch/arm/arm64/lib/find_next_bit.c      |  1 +
 xen/arch/arm/bootfdt.c                      |  6 ++++
 xen/arch/arm/cpuerrata.c                    |  6 ++--
 xen/arch/arm/decode.c                       |  2 ++
 xen/arch/arm/dm.c                           |  2 +-
 xen/arch/arm/domain_build.c                 | 29 ++++++++++++++----
 xen/arch/arm/domctl.c                       |  8 ++---
 xen/arch/arm/efi/efi-boot.h                 |  6 ++--
 xen/arch/arm/gic-v3-its.c                   |  9 +++---
 xen/arch/arm/gic-v3-lpi.c                   | 17 ++++++-----
 xen/arch/arm/guest_walk.c                   | 12 ++++----
 xen/arch/arm/include/asm/guest_atomics.h    |  3 ++
 xen/arch/arm/include/asm/p2m.h              | 10 ++++---
 xen/arch/arm/mm.c                           |  1 +
 xen/arch/arm/p2m.c                          | 33 ++++++++++++---------
 xen/arch/arm/platforms/xilinx-zynqmp-eemi.c | 10 ++-----
 xen/arch/arm/psci.c                         | 10 +++----
 xen/drivers/char/pl011.c                    |  2 +-
 20 files changed, 129 insertions(+), 65 deletions(-)

--
2.34.1


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 11:49:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 11:49:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563583.880876 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKHJ4-0005Xi-6F; Fri, 14 Jul 2023 11:49:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563583.880876; Fri, 14 Jul 2023 11:49:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKHJ4-0005Xa-3Q; Fri, 14 Jul 2023 11:49:54 +0000
Received: by outflank-mailman (input) for mailman id 563583;
 Fri, 14 Jul 2023 11:49:52 +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
 <SRS0=Z95V=DA=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qKHJ2-0005Gy-OM
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 11:49:52 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 89fcd3e5-223c-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 13:49:50 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.163.94.163])
 by support.bugseng.com (Postfix) with ESMTPSA id A002C4EE0C89;
 Fri, 14 Jul 2023 13:49:48 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 89fcd3e5-223c-11ee-8611-37d641c3527e
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally uninitialized variables
Date: Fri, 14 Jul 2023 13:49:18 +0200
Message-Id: <1ad20473a031eca75db4007bdc169616b512ef44.1689329728.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689329728.git.nicola.vetrini@bugseng.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This patch aims to fix some occurrences of possibly uninitialized
variables, that may be read before being written. This behaviour would
violate MISRA C:2012 Rule 9.1, besides being generally undesirable.

In all the analyzed cases, such accesses were actually safe, but it's
quite difficult to prove so by automatic checking, therefore a safer
route is to change the code so as to avoid the behaviour from occurring,
while preserving the semantics.

To achieve this goal, I adopted the following strategies:

- Add a suitably formatted local deviation comment
  (as indicated in 'docs/misra/documenting-violations.rst')
  to exempt the following line from checking.

- Provide an initialization for the variable at the declaration.

- Substitute a goto breaking out of control flow logic with a semantically
  equivalent do { .. } while(0).

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 docs/misra/safe.json                   |  8 +++++++
 xen/arch/arm/arm64/lib/find_next_bit.c |  1 +
 xen/arch/arm/bootfdt.c                 |  6 +++++
 xen/arch/arm/decode.c                  |  2 ++
 xen/arch/arm/domain_build.c            | 29 ++++++++++++++++++----
 xen/arch/arm/efi/efi-boot.h            |  6 +++--
 xen/arch/arm/gic-v3-its.c              |  9 ++++---
 xen/arch/arm/mm.c                      |  1 +
 xen/arch/arm/p2m.c                     | 33 +++++++++++++++-----------
 9 files changed, 69 insertions(+), 26 deletions(-)

diff --git a/docs/misra/safe.json b/docs/misra/safe.json
index e3c8a1d8eb..244001f5be 100644
--- a/docs/misra/safe.json
+++ b/docs/misra/safe.json
@@ -12,6 +12,14 @@
         },
         {
             "id": "SAF-1-safe",
+            "analyser": {
+                "eclair": "MC3R1.R9.1"
+            },
+            "name": "Rule 9.1: initializer not needed",
+            "text": "The following local variables are possibly subject to being read before being written, but code inspection ensured that the control flow in the construct where they appear ensures that no such event may happen."
+        },
+        {
+            "id": "SAF-2-safe",
             "analyser": {},
             "name": "Sentinel",
             "text": "Next ID to be used"
diff --git a/xen/arch/arm/arm64/lib/find_next_bit.c b/xen/arch/arm/arm64/lib/find_next_bit.c
index ca6f82277e..51b852c595 100644
--- a/xen/arch/arm/arm64/lib/find_next_bit.c
+++ b/xen/arch/arm/arm64/lib/find_next_bit.c
@@ -67,6 +67,7 @@ unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size,
 {
 	const unsigned long *p = addr + BIT_WORD(offset);
 	unsigned long result = offset & ~(BITS_PER_LONG-1);
+	/* SAF-1-safe MC3R1.R9.1 */
 	unsigned long tmp;
 
 	if (offset >= size)
diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index 2673ad17a1..1292a64e8d 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -34,6 +34,7 @@ static bool __init device_tree_node_matches(const void *fdt, int node,
 static bool __init device_tree_node_compatible(const void *fdt, int node,
                                                const char *match)
 {
+    /* SAF-1-safe MC3R1.R9.1 */
     int len, l;
     const void *prop;
 
@@ -169,7 +170,9 @@ int __init device_tree_for_each_node(const void *fdt, int node,
      */
     int depth = 0;
     const int first_node = node;
+    /* SAF-1-safe MC3R1.R9.1 */
     u32 address_cells[DEVICE_TREE_MAX_DEPTH];
+    /* SAF-1-safe MC3R1.R9.1 */
     u32 size_cells[DEVICE_TREE_MAX_DEPTH];
     int ret;
 
@@ -249,8 +252,10 @@ static void __init process_multiboot_node(const void *fdt, int node,
     const __be32 *cell;
     bootmodule_kind kind;
     paddr_t start, size;
+    /* SAF-1-safe MC3R1.R9.1 */
     int len;
     /* sizeof("/chosen/") + DT_MAX_NAME + '/' + DT_MAX_NAME + '/0' => 92 */
+    /* SAF-1-safe MC3R1.R9.1*/
     char path[92];
     int parent_node, ret;
     bool domU;
@@ -326,6 +331,7 @@ static int __init process_chosen_node(const void *fdt, int node,
 {
     const struct fdt_property *prop;
     paddr_t start, end;
+    /* SAF-1-safe MC3R1.R9.1 */
     int len;
 
     if ( fdt_get_property(fdt, node, "xen,static-heap", NULL) )
diff --git a/xen/arch/arm/decode.c b/xen/arch/arm/decode.c
index 2537dbebc1..b3ea504356 100644
--- a/xen/arch/arm/decode.c
+++ b/xen/arch/arm/decode.c
@@ -27,6 +27,7 @@ static void update_dabt(struct hsr_dabt *dabt, int reg,
 
 static int decode_thumb2(register_t pc, struct hsr_dabt *dabt, uint16_t hw1)
 {
+    /* SAF-1-safe MC3R1.R9.1 */
     uint16_t hw2;
     uint16_t rt;
 
@@ -151,6 +152,7 @@ static int decode_arm64(register_t pc, mmio_info_t *info)
 
 static int decode_thumb(register_t pc, struct hsr_dabt *dabt)
 {
+    /* SAF-1-safe MC3R1.R9.1 */
     uint16_t instr;
 
     if ( raw_copy_from_guest(&instr, (void * __user)pc, sizeof (instr)) )
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index d0d6be922d..d43f86c2f0 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -62,7 +62,7 @@ custom_param("dom0_mem", parse_dom0_mem);
 
 int __init parse_arch_dom0_param(const char *s, const char *e)
 {
-    long long val;
+    long long val = LLONG_MAX;
 
     if ( !parse_signed_integer("sve", s, e, &val) )
     {
@@ -1077,6 +1077,7 @@ static void __init assign_static_memory_11(struct domain *d,
 static int __init handle_linux_pci_domain(struct kernel_info *kinfo,
                                           const struct dt_device_node *node)
 {
+    /* SAF-1-safe MC3R1.R9.1 */
     uint16_t segment;
     int res;
 
@@ -1351,6 +1352,7 @@ static int __init make_memory_node(const struct domain *d,
     unsigned int i;
     int res, reg_size = addrcells + sizecells;
     int nr_cells = 0;
+    /* SAF-1-safe MC3R1.R9.1*/
     __be32 reg[NR_MEM_BANKS * 4 /* Worst case addrcells + sizecells */];
     __be32 *cells;
 
@@ -1578,6 +1580,7 @@ static int __init find_unallocated_memory(const struct kernel_info *kinfo,
     struct rangeset *unalloc_mem;
     paddr_t start, end;
     unsigned int i;
+    /* SAF-1-safe MC3R1.R9.1 */
     int res;
 
     dt_dprintk("Find unallocated memory for extended regions\n");
@@ -1727,6 +1730,7 @@ static int __init find_memory_holes(const struct kernel_info *kinfo,
     dt_for_each_device_node( dt_host, np )
     {
         unsigned int naddr;
+        /* SAF-1-safe MC3R1.R9.1 */
         paddr_t addr, size;
 
         naddr = dt_number_of_address(np);
@@ -1976,9 +1980,11 @@ static int __init make_cpus_node(const struct domain *d, void *fdt)
     const struct dt_device_node *npcpu;
     unsigned int cpu;
     const void *compatible = NULL;
+    /* SAF-1-safe MC3R1.R9.1 */
     u32 len;
     /* Placeholder for cpu@ + a 32-bit hexadecimal number + \0 */
     char buf[13];
+    /* SAF-1-safe MC3R1.R9.1 */
     u32 clock_frequency;
     /* Keep the compiler happy with -Og */
     bool clock_valid = false;
@@ -2104,6 +2110,7 @@ static int __init make_gic_node(const struct domain *d, void *fdt,
     const struct dt_device_node *gic = dt_interrupt_controller;
     int res = 0;
     const void *addrcells, *sizecells;
+    /* SAF-1-safe MC3R1.R9.1 */
     u32 addrcells_len, sizecells_len;
 
     /*
@@ -2179,6 +2186,7 @@ static int __init make_timer_node(const struct kernel_info *kinfo)
     int res;
     unsigned int irq[MAX_TIMER_PPI];
     gic_interrupt_t intrs[3];
+    /* SAF-1-safe MC3R1.R9.1 */
     u32 clock_frequency;
     bool clock_valid;
 
@@ -2511,6 +2519,7 @@ static int __init handle_device(struct domain *d, struct dt_device_node *dev,
     unsigned int naddr;
     unsigned int i;
     int res;
+    /* SAF-1-safe MC3R1.R9.1 */
     paddr_t addr, size;
     bool own_device = !dt_device_for_passthrough(dev);
     /*
@@ -2779,6 +2788,7 @@ static int __init make_gicv2_domU_node(struct kernel_info *kinfo)
 {
     void *fdt = kinfo->fdt;
     int res = 0;
+    /* SAF-1-safe MC3R1.R9.1*/
     __be32 reg[(GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS) * 2];
     __be32 *cells;
     const struct domain *d = kinfo->d;
@@ -2914,6 +2924,7 @@ static int __init make_vpl011_uart_node(struct kernel_info *kinfo)
     void *fdt = kinfo->fdt;
     int res;
     gic_interrupt_t intr;
+    /* SAF-1-safe MC3R1.R9.1*/
     __be32 reg[GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS];
     __be32 *cells;
     struct domain *d = kinfo->d;
@@ -3435,6 +3446,7 @@ static void __init initrd_load(struct kernel_info *kinfo)
     paddr_t paddr, len;
     int node;
     int res;
+    /* SAF-1-safe MC3R1.R9.1 */
     __be32 val[2];
     __be32 *cellp;
     void __iomem *initrd;
@@ -3514,6 +3526,7 @@ static int __init get_evtchn_dt_property(const struct dt_device_node *np,
                                          uint32_t *port, uint32_t *phandle)
 {
     const __be32 *prop = NULL;
+    /* SAF-1-safe MC3R1.R9.1 */
     uint32_t len;
 
     prop = dt_get_property(np, "xen,evtchn", &len);
@@ -3538,10 +3551,13 @@ static int __init get_evtchn_dt_property(const struct dt_device_node *np,
 static int __init alloc_domain_evtchn(struct dt_device_node *node)
 {
     int rc;
+    /* SAF-1-safe MC3R1.R9.1 */
     uint32_t domU1_port, domU2_port, remote_phandle;
     struct dt_device_node *remote_node;
     const struct dt_device_node *p1_node, *p2_node;
+    /* SAF-1-safe MC3R1.R9.1 */
     struct evtchn_alloc_unbound alloc_unbound;
+    /* SAF-1-safe MC3R1.R9.1 */
     struct evtchn_bind_interdomain bind_interdomain;
     struct domain *d1 = NULL, *d2 = NULL;
 
@@ -3789,11 +3805,12 @@ static int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
 
 static int __init alloc_xenstore_evtchn(struct domain *d)
 {
-    evtchn_alloc_unbound_t alloc;
+    evtchn_alloc_unbound_t alloc = {
+        .dom = d->domain_id,
+        .remote_dom = hardware_domain->domain_id
+    };
     int rc;
 
-    alloc.dom = d->domain_id;
-    alloc.remote_dom = hardware_domain->domain_id;
     rc = evtchn_alloc_unbound(&alloc, 0);
     if ( rc )
     {
@@ -3810,8 +3827,9 @@ static int __init construct_domU(struct domain *d,
                                  const struct dt_device_node *node)
 {
     struct kernel_info kinfo = {};
-    const char *dom0less_enhanced;
+    const char *dom0less_enhanced = NULL;
     int rc;
+    /* SAF-1-safe MC3R1.R9.1 */
     u64 mem;
     u32 p2m_mem_mb;
     unsigned long p2m_pages;
@@ -3939,6 +3957,7 @@ void __init create_domUs(void)
             .grant_opts = XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
         };
         unsigned int flags = 0U;
+        /* SAF-1-safe MC3R1.R9.1 */
         uint32_t val;
         int rc;
 
diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index bb64925d70..25f39364d1 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -117,6 +117,7 @@ static int __init setup_chosen_node(void *fdt, int *addr_cells, int *size_cells)
 static int __init fdt_set_reg(void *fdt, int node, int addr_cells,
                               int size_cells, uint64_t addr, uint64_t len)
 {
+    /* SAF-1-safe MC3R1.R9.1 */
     __be32 val[4]; /* At most 2 64 bit values to be stored */
     __be32 *cellp;
 
@@ -308,7 +309,7 @@ fdt_set_fail:
 static void __init *fdt_increase_size(struct file *fdtfile, int add_size)
 {
     EFI_STATUS status;
-    EFI_PHYSICAL_ADDRESS fdt_addr;
+    EFI_PHYSICAL_ADDRESS fdt_addr = 0;
     int fdt_size;
     int pages;
     void *new_fdt;
@@ -433,7 +434,7 @@ static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
 
 static void *__init efi_arch_allocate_mmap_buffer(UINTN map_size)
 {
-    void *ptr;
+    void *ptr = NULL;
     EFI_STATUS status;
 
     status = efi_bs->AllocatePool(EfiLoaderData, map_size, &ptr);
@@ -538,6 +539,7 @@ static void __init efi_arch_handle_module(const struct file *file,
 {
     int node;
     int chosen;
+    /* SAF-1-safe MC3R1.R9.1 */
     int addr_len, size_len;
 
     if ( file == &dtbfile )
diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
index 3aa4edda10..aa0180ab5b 100644
--- a/xen/arch/arm/gic-v3-its.c
+++ b/xen/arch/arm/gic-v3-its.c
@@ -192,8 +192,7 @@ static int its_send_cmd_mapc(struct host_its *its, uint32_t collection_id,
 
     cmd[0] = GITS_CMD_MAPC;
     cmd[1] = 0x00;
-    cmd[2] = encode_rdbase(its, cpu, collection_id);
-    cmd[2] |= GITS_VALID_BIT;
+    cmd[2] = encode_rdbase(its, cpu, collection_id) | GITS_VALID_BIT;
     cmd[3] = 0x00;
 
     return its_send_command(its, cmd);
@@ -215,9 +214,7 @@ static int its_send_cmd_mapd(struct host_its *its, uint32_t deviceid,
     }
     cmd[0] = GITS_CMD_MAPD | ((uint64_t)deviceid << 32);
     cmd[1] = size_bits;
-    cmd[2] = itt_addr;
-    if ( valid )
-        cmd[2] |= GITS_VALID_BIT;
+    cmd[2] = itt_addr | (valid ? GITS_VALID_BIT : 0x00);
     cmd[3] = 0x00;
 
     return its_send_command(its, cmd);
@@ -911,6 +908,7 @@ int gicv3_its_make_hwdom_dt_nodes(const struct domain *d,
                                   const struct dt_device_node *gic,
                                   void *fdt)
 {
+    /* SAF-1-safe MC3R1.R9.1 */
     uint32_t len;
     int res;
     const void *prop = NULL;
@@ -1004,6 +1002,7 @@ static void gicv3_its_dt_init(const struct dt_device_node *node)
      */
     dt_for_each_child_node(node, its)
     {
+        /* SAF-1-safe MC3R1.R9.1 */
         paddr_t addr, size;
 
         if ( !dt_device_is_compatible(its, "arm,gic-v3-its") )
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index c688227abd..a36068b2d8 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -935,6 +935,7 @@ static int xen_pt_update_entry(mfn_t root, unsigned long virt,
                                mfn_t mfn, unsigned int target,
                                unsigned int flags)
 {
+    /* SAF-1-safe MC3R1.R9.1 */
     int rc;
     unsigned int level;
     lpae_t *table;
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index de32a2d638..83c56cf1cb 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -496,16 +496,18 @@ mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
     lpae_t entry, *table;
     int rc;
     mfn_t mfn = INVALID_MFN;
-    p2m_type_t _t;
+    p2m_type_t _t = p2m_invalid;
     DECLARE_OFFSETS(offsets, addr);
 
     ASSERT(p2m_is_locked(p2m));
     BUILD_BUG_ON(THIRD_MASK != PAGE_MASK);
 
     /* Allow t to be NULL */
-    t = t ?: &_t;
-
-    *t = p2m_invalid;
+    if( t ) {
+        *t = _t;
+    } else {
+        t = &_t;
+    }
 
     if ( valid )
         *valid = false;
@@ -1031,6 +1033,7 @@ static int __p2m_set_entry(struct p2m_domain *p2m,
     unsigned int level = 0;
     unsigned int target = 3 - (page_order / XEN_PT_LPAE_SHIFT);
     lpae_t *entry, *table, orig_pte;
+    /* SAF-1-safe MC3R1.R9.1 */
     int rc;
     /* A mapping is removed if the MFN is invalid. */
     bool removing_mapping = mfn_eq(smfn, INVALID_MFN);
@@ -1483,6 +1486,7 @@ static inline int p2m_remove_mapping(struct domain *d,
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
     unsigned long i;
+    /* SAF-1-safe MC3R1.R9.1 */
     int rc;
 
     p2m_write_lock(p2m);
@@ -1685,20 +1689,21 @@ static int p2m_alloc_vmid(struct domain *d)
 
     ASSERT(nr != INVALID_VMID);
 
-    if ( nr == MAX_VMID )
-    {
-        rc = -EBUSY;
-        printk(XENLOG_ERR "p2m.c: dom%d: VMID pool exhausted\n", d->domain_id);
-        goto out;
-    }
+    do {
+      if ( nr == MAX_VMID )
+      {
+          rc = -EBUSY;
+          printk(XENLOG_ERR "p2m.c: dom%d: VMID pool exhausted\n", d->domain_id);
+          break;
+      }
 
-    set_bit(nr, vmid_mask);
+      set_bit(nr, vmid_mask);
 
-    p2m->vmid = nr;
+      p2m->vmid = nr;
 
-    rc = 0;
+			rc = 0;
+		} while ( 0 );
 
-out:
     spin_unlock(&vmid_alloc_lock);
     return rc;
 }
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 14 11:49:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 11:49:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563584.880887 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKHJ5-0005nk-KG; Fri, 14 Jul 2023 11:49:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563584.880887; Fri, 14 Jul 2023 11:49:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKHJ5-0005nb-Gl; Fri, 14 Jul 2023 11:49:55 +0000
Received: by outflank-mailman (input) for mailman id 563584;
 Fri, 14 Jul 2023 11:49:53 +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
 <SRS0=Z95V=DA=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qKHJ3-0005Gy-UA
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 11:49:53 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8b19dbbb-223c-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 13:49:52 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.163.94.163])
 by support.bugseng.com (Postfix) with ESMTPSA id 7A3D04EE0739;
 Fri, 14 Jul 2023 13:49:50 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8b19dbbb-223c-11ee-8611-37d641c3527e
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable inside a macro
Date: Fri, 14 Jul 2023 13:49:19 +0200
Message-Id: <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689329728.git.nicola.vetrini@bugseng.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The macro 'testop' expands to a function that declares the local
variable 'oldbit', which is written before being set, but is such a
way that is not amenable to automatic checking.

Therefore, a deviation comment, is introduced to document this situation.

A similar reasoning applies to macro 'guest_testop'.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 docs/misra/safe.json                     | 16 ++++++++++++++++
 xen/arch/arm/arm64/lib/bitops.c          |  3 +++
 xen/arch/arm/include/asm/guest_atomics.h |  3 +++
 3 files changed, 22 insertions(+)

diff --git a/docs/misra/safe.json b/docs/misra/safe.json
index 244001f5be..4cf7cbf57b 100644
--- a/docs/misra/safe.json
+++ b/docs/misra/safe.json
@@ -20,6 +20,22 @@
         },
         {
             "id": "SAF-2-safe",
+            "analyser": {
+                "eclair": "MC3R1.R9.1"
+            },
+            "name": "Rule 9.1: initializer not needed",
+            "text": "The following local variables are possibly subject to being read before being written, but code inspection ensured that the control flow in the construct where they appear ensures that no such event may happen."
+        },
+        {
+            "id": "SAF-3-safe",
+            "analyser": {
+                "eclair": "MC3R1.R9.1"
+            },
+            "name": "Rule 9.1: initializer not needed",
+            "text": "The following local variables are possibly subject to being read before being written, but code inspection ensured that the control flow in the construct where they appear ensures that no such event may happen."
+        },
+        {
+            "id": "SAF-4-safe",
             "analyser": {},
             "name": "Sentinel",
             "text": "Next ID to be used"
diff --git a/xen/arch/arm/arm64/lib/bitops.c b/xen/arch/arm/arm64/lib/bitops.c
index 20e3f3d6ce..e0728bb29d 100644
--- a/xen/arch/arm/arm64/lib/bitops.c
+++ b/xen/arch/arm/arm64/lib/bitops.c
@@ -114,8 +114,11 @@ bitop(change_bit, eor)
 bitop(clear_bit, bic)
 bitop(set_bit, orr)
 
+/* SAF-2-safe MC3R1.R9.1 */
 testop(test_and_change_bit, eor)
+/* SAF-2-safe MC3R1.R9.1 */
 testop(test_and_clear_bit, bic)
+/* SAF-2-safe MC3R1.R9.1 */
 testop(test_and_set_bit, orr)
 
 static always_inline bool int_clear_mask16(uint16_t mask, volatile uint16_t *p,
diff --git a/xen/arch/arm/include/asm/guest_atomics.h b/xen/arch/arm/include/asm/guest_atomics.h
index a1745f8613..9d8f8ec3a3 100644
--- a/xen/arch/arm/include/asm/guest_atomics.h
+++ b/xen/arch/arm/include/asm/guest_atomics.h
@@ -67,8 +67,11 @@ guest_bitop(change_bit)
 /* test_bit does not use load-store atomic operations */
 #define guest_test_bit(d, nr, p) ((void)(d), test_bit(nr, p))
 
+/* SAF-3-safe MC3R1.R9.1 */
 guest_testop(test_and_set_bit)
+/* SAF-3-safe MC3R1.R9.1 */
 guest_testop(test_and_clear_bit)
+/* SAF-3-safe MC3R1.R9.1 */
 guest_testop(test_and_change_bit)
 
 #undef guest_testop
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 14 11:49:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 11:49:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563585.880893 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKHJ5-0005ra-W0; Fri, 14 Jul 2023 11:49:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563585.880893; Fri, 14 Jul 2023 11:49:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKHJ5-0005qg-QH; Fri, 14 Jul 2023 11:49:55 +0000
Received: by outflank-mailman (input) for mailman id 563585;
 Fri, 14 Jul 2023 11:49:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z95V=DA=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qKHJ4-0005Xk-EZ
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 11:49:54 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8bae35d5-223c-11ee-b239-6b7b168915f2;
 Fri, 14 Jul 2023 13:49:53 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.163.94.163])
 by support.bugseng.com (Postfix) with ESMTPSA id 464074EE0C8B;
 Fri, 14 Jul 2023 13:49:52 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8bae35d5-223c-11ee-b239-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [RFC PATCH 3/4] xen/arm: initialize conditionally uninitialized local variables
Date: Fri, 14 Jul 2023 13:49:20 +0200
Message-Id: <c7d2cd46f06f75f8a1810168c508f05d242f831c.1689329728.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689329728.git.nicola.vetrini@bugseng.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This patch aims to fix some occurrences of possibly uninitialized
variables, that may be read before being written. This behaviour would
violate MISRA C:2012 Rule 9.1, besides being generally undesirable.

In all the analyzed cases, such accesses were actually safe, but it's
quite difficult to prove so by automatic checking, therefore a safer
route is to change the code so as to avoid the behaviour from occurring,
while preserving the semantics.

An initialization to a safe value is provided to reach this aim.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
Additional input on which values may be 'safe' in each context is
surely welcome, to avoid possibly compromising the correctness of
the function semantics.
---
 xen/arch/arm/cpuerrata.c                    |  6 +++---
 xen/arch/arm/domctl.c                       |  8 ++++----
 xen/arch/arm/gic-v3-lpi.c                   | 17 +++++++++--------
 xen/arch/arm/include/asm/p2m.h              | 10 ++++++----
 xen/arch/arm/platforms/xilinx-zynqmp-eemi.c | 10 ++--------
 xen/arch/arm/psci.c                         | 10 +++++-----
 xen/drivers/char/pl011.c                    |  2 +-
 7 files changed, 30 insertions(+), 33 deletions(-)

diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
index d0658aedb6..14694c6081 100644
--- a/xen/arch/arm/cpuerrata.c
+++ b/xen/arch/arm/cpuerrata.c
@@ -159,7 +159,7 @@ extern char __mitigate_spectre_bhb_loop_start_32[],
 
 static int enable_smccc_arch_workaround_1(void *data)
 {
-    struct arm_smccc_res res;
+    struct arm_smccc_res res = {0};
     const struct arm_cpu_capabilities *entry = data;
 
     /*
@@ -252,7 +252,7 @@ static int enable_spectre_bhb_workaround(void *data)
 
     if ( cpus_have_cap(ARM_WORKAROUND_BHB_SMCC_3) )
     {
-        struct arm_smccc_res res;
+        struct arm_smccc_res res = {0};
 
         if ( smccc_ver < SMCCC_VERSION(1, 1) )
             goto warn;
@@ -393,7 +393,7 @@ DEFINE_PER_CPU_READ_MOSTLY(register_t, ssbd_callback_required);
 
 static bool has_ssbd_mitigation(const struct arm_cpu_capabilities *entry)
 {
-    struct arm_smccc_res res;
+    struct arm_smccc_res res = {0};
     bool required;
 
     if ( smccc_ver < SMCCC_VERSION(1, 1) )
diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c
index ad56efb0f5..b38fed72be 100644
--- a/xen/arch/arm/domctl.c
+++ b/xen/arch/arm/domctl.c
@@ -29,10 +29,10 @@ static int handle_vuart_init(struct domain *d,
                              struct xen_domctl_vuart_op *vuart_op)
 {
     int rc;
-    struct vpl011_init_info info;
-
-    info.console_domid = vuart_op->console_domid;
-    info.gfn = _gfn(vuart_op->gfn);
+    struct vpl011_init_info info = {
+        .console_domid = vuart_op->console_domid,
+        .gfn = _gfn(vuart_op->gfn)
+    };
 
     if ( d->creation_finished )
         return -EPERM;
diff --git a/xen/arch/arm/gic-v3-lpi.c b/xen/arch/arm/gic-v3-lpi.c
index eb0a5535e4..12f2af2e4d 100644
--- a/xen/arch/arm/gic-v3-lpi.c
+++ b/xen/arch/arm/gic-v3-lpi.c
@@ -210,7 +210,10 @@ out:
 void gicv3_lpi_update_host_entry(uint32_t host_lpi, int domain_id,
                                  uint32_t virt_lpi)
 {
-    union host_lpi *hlpip, hlpi;
+    union host_lpi *hlpip, hlpi = {
+        .virt_lpi = virt_lpi,
+        .dom_id = domain_id
+    };
 
     ASSERT(host_lpi >= LPI_OFFSET);
 
@@ -218,9 +221,6 @@ void gicv3_lpi_update_host_entry(uint32_t host_lpi, int domain_id,
 
     hlpip = &lpi_data.host_lpis[host_lpi / HOST_LPIS_PER_PAGE][host_lpi % HOST_LPIS_PER_PAGE];
 
-    hlpi.virt_lpi = virt_lpi;
-    hlpi.dom_id = domain_id;
-
     write_u64_atomic(&hlpip->data, hlpi.data);
 }
 
@@ -542,14 +542,15 @@ int gicv3_allocate_host_lpi_block(struct domain *d, uint32_t *first_lpi)
 
     for ( i = 0; i < LPI_BLOCK; i++ )
     {
-        union host_lpi hlpi;
-
         /*
          * Mark this host LPI as belonging to the domain, but don't assign
          * any virtual LPI or a VCPU yet.
          */
-        hlpi.virt_lpi = INVALID_LPI;
-        hlpi.dom_id = d->domain_id;
+        union host_lpi hlpi = {
+            .virt_lpi = INVALID_LPI,
+            .dom_id = d->domain_id
+        };
+
         write_u64_atomic(&lpi_data.host_lpis[chunk][lpi_idx + i].data,
                          hlpi.data);
 
diff --git a/xen/arch/arm/include/asm/p2m.h b/xen/arch/arm/include/asm/p2m.h
index 940495d42b..413e2a7add 100644
--- a/xen/arch/arm/include/asm/p2m.h
+++ b/xen/arch/arm/include/asm/p2m.h
@@ -345,7 +345,7 @@ static inline struct page_info *get_page_from_gfn(
     struct domain *d, unsigned long gfn, p2m_type_t *t, p2m_query_t q)
 {
     mfn_t mfn;
-    p2m_type_t _t;
+    p2m_type_t _t = p2m_invalid;
     struct page_info *page;
 
     /*
@@ -355,10 +355,12 @@ static inline struct page_info *get_page_from_gfn(
     if ( likely(d != dom_xen) )
         return p2m_get_page_from_gfn(d, _gfn(gfn), t);
 
-    if ( !t )
+    /* Allow t to be NULL */
+    if ( t )
+        *t = _t;
+    else {
         t = &_t;
-
-    *t = p2m_invalid;
+    }
 
     /*
      * DOMID_XEN sees 1-1 RAM. The p2m_type is based on the type of the
diff --git a/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c b/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
index 2053ed7ac5..39d9ab4fa9 100644
--- a/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
+++ b/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
@@ -51,11 +51,11 @@ static inline bool domain_has_reset_access(struct domain *d, uint32_t rst)
 
 bool zynqmp_eemi(struct cpu_user_regs *regs)
 {
-    struct arm_smccc_res res;
+    struct arm_smccc_res res = {0};
     uint32_t fid = get_user_reg(regs, 0);
     uint32_t nodeid = get_user_reg(regs, 1);
     unsigned int pm_fn = fid & 0xFFFF;
-    enum pm_ret_status ret;
+    enum pm_ret_status ret = XST_PM_NO_ACCESS;
 
     switch ( fid )
     {
@@ -89,7 +89,6 @@ bool zynqmp_eemi(struct cpu_user_regs *regs)
         {
             gprintk(XENLOG_WARNING,
                     "zynqmp-pm: fn=%u No access to node %u\n", pm_fn, nodeid);
-            ret = XST_PM_NO_ACCESS;
             goto done;
         }
         goto forward_to_fw;
@@ -100,7 +99,6 @@ bool zynqmp_eemi(struct cpu_user_regs *regs)
         {
             gprintk(XENLOG_WARNING,
                     "zynqmp-pm: fn=%u No access to reset %u\n", pm_fn, nodeid);
-            ret = XST_PM_NO_ACCESS;
             goto done;
         }
         goto forward_to_fw;
@@ -116,7 +114,6 @@ bool zynqmp_eemi(struct cpu_user_regs *regs)
     case EEMI_FID(PM_MMIO_READ):
         gprintk(XENLOG_WARNING,
                 "zynqmp-pm: fn=%u No MMIO access to %u\n", pm_fn, nodeid);
-        ret = XST_PM_NO_ACCESS;
         goto done;
 
     /* Exclusive to the hardware domain.  */
@@ -146,14 +143,12 @@ bool zynqmp_eemi(struct cpu_user_regs *regs)
         if ( !is_hardware_domain(current->domain) )
         {
             gprintk(XENLOG_WARNING, "eemi: fn=%u No access", pm_fn);
-            ret = XST_PM_NO_ACCESS;
             goto done;
         }
         goto forward_to_fw;
 
     /* These calls are never allowed.  */
     case EEMI_FID(PM_SYSTEM_SHUTDOWN):
-        ret = XST_PM_NO_ACCESS;
         goto done;
 
     case IPI_MAILBOX_FID(IPI_MAILBOX_OPEN):
@@ -166,7 +161,6 @@ bool zynqmp_eemi(struct cpu_user_regs *regs)
         if ( !is_hardware_domain(current->domain) )
         {
             gprintk(XENLOG_WARNING, "IPI mailbox: fn=%u No access", pm_fn);
-            ret = XST_PM_NO_ACCESS;
             goto done;
         }
         goto forward_to_fw;
diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index 695d2fa1f1..47e46af608 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -38,7 +38,7 @@ static uint32_t psci_cpu_on_nr;
 
 int call_psci_cpu_on(int cpu)
 {
-    struct arm_smccc_res res;
+    struct arm_smccc_res res = {0};
 
     arm_smccc_smc(psci_cpu_on_nr, cpu_logical_map(cpu), __pa(init_secondary),
                   &res);
@@ -50,7 +50,7 @@ void call_psci_cpu_off(void)
 {
     if ( psci_ver > PSCI_VERSION(0, 1) )
     {
-        struct arm_smccc_res res;
+        struct arm_smccc_res res = {0};
 
         /* If successfull the PSCI cpu_off call doesn't return */
         arm_smccc_smc(PSCI_0_2_FN32_CPU_OFF, &res);
@@ -73,7 +73,7 @@ void call_psci_system_reset(void)
 
 static int __init psci_features(uint32_t psci_func_id)
 {
-    struct arm_smccc_res res;
+    struct arm_smccc_res res = {0};
 
     if ( psci_ver < PSCI_VERSION(1, 0) )
         return PSCI_NOT_SUPPORTED;
@@ -115,7 +115,7 @@ static void __init psci_init_smccc(void)
 
     if ( psci_features(ARM_SMCCC_VERSION_FID) != PSCI_NOT_SUPPORTED )
     {
-        struct arm_smccc_res res;
+        struct arm_smccc_res res = {0};
 
         arm_smccc_smc(ARM_SMCCC_VERSION_FID, &res);
         if ( PSCI_RET(res) != ARM_SMCCC_NOT_SUPPORTED )
@@ -168,7 +168,7 @@ static int __init psci_init_0_2(void)
         { /* sentinel */ },
     };
     int ret;
-    struct arm_smccc_res res;
+    struct arm_smccc_res res = {0};
 
     if ( acpi_disabled )
     {
diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
index f7bf3ad117..34ce90be52 100644
--- a/xen/drivers/char/pl011.c
+++ b/xen/drivers/char/pl011.c
@@ -285,7 +285,7 @@ static int __init pl011_dt_uart_init(struct dt_device_node *dev,
     const char *config = data;
     int res;
     paddr_t addr, size;
-    uint32_t io_width;
+    uint32_t io_width = 0;
     bool mmio32 = false, sbsa;
 
     if ( strcmp(config, "") )
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 14 11:49:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 11:49:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563586.880907 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKHJ8-0006Lk-8M; Fri, 14 Jul 2023 11:49:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563586.880907; Fri, 14 Jul 2023 11:49:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKHJ8-0006LX-2l; Fri, 14 Jul 2023 11:49:58 +0000
Received: by outflank-mailman (input) for mailman id 563586;
 Fri, 14 Jul 2023 11:49:56 +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
 <SRS0=Z95V=DA=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qKHJ5-0005Gy-UM
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 11:49:55 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8c51e747-223c-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 13:49:54 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.163.94.163])
 by support.bugseng.com (Postfix) with ESMTPSA id 463314EE0C8D;
 Fri, 14 Jul 2023 13:49:53 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8c51e747-223c-11ee-8611-37d641c3527e
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [RFC PATCH 4/4] xen/arm: initialize conditionally uninitialized local variables
Date: Fri, 14 Jul 2023 13:49:21 +0200
Message-Id: <6640fc480d550bb337455afc0c2663d4b288dd4f.1689329728.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1689329728.git.nicola.vetrini@bugseng.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The function 'guest_walk_tables' contains an initialization
pattern for the pointee of parameter 'perms' that is not easy
for automatic checkers to reason about.

A modified pattern that does not alter the semantics of the
code is introduced.

A const qualifier is added in 'xen/arch/arm/dm.c' because
'copy_to_guest_offset' doesn't modify that parameter.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/arm/dm.c         |  2 +-
 xen/arch/arm/guest_walk.c | 12 +++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/dm.c b/xen/arch/arm/dm.c
index 5569efa121..910788e098 100644
--- a/xen/arch/arm/dm.c
+++ b/xen/arch/arm/dm.c
@@ -129,7 +129,7 @@ int dm_op(const struct dmop_args *op_args)
 
     if ( (!rc || rc == -ERESTART) &&
          !const_op && copy_to_guest_offset(op_args->buf[0].h, offset,
-                                           (void *)&op.u, op_size[op.op]) )
+                                           (const void *)&op.u, op_size[op.op]) )
         rc = -EFAULT;
 
  out:
diff --git a/xen/arch/arm/guest_walk.c b/xen/arch/arm/guest_walk.c
index d99b411f3b..6c017242f2 100644
--- a/xen/arch/arm/guest_walk.c
+++ b/xen/arch/arm/guest_walk.c
@@ -552,15 +552,12 @@ bool guest_walk_tables(const struct vcpu *v, vaddr_t gva,
 {
     register_t sctlr = READ_SYSREG(SCTLR_EL1);
     register_t tcr = READ_SYSREG(TCR_EL1);
-    unsigned int _perms;
+    unsigned int _perms = GV2M_READ;
 
     /* We assume that the domain is running on the currently active domain. */
     if ( v != current )
         return false;
 
-    /* Allow perms to be NULL. */
-    perms = perms ?: &_perms;
-
     /*
      * Currently, we assume a GVA to IPA translation with EL1 privileges.
      * Since, valid mappings in the first stage address translation table are
@@ -570,7 +567,12 @@ bool guest_walk_tables(const struct vcpu *v, vaddr_t gva,
      * attributes that distinguish between EL0 and EL1 permissions (EL0 might
      * not have permissions on the particular mapping).
      */
-    *perms = GV2M_READ;
+    /* Allow perms to be NULL. */
+    if( perms ) {
+      *perms = _perms;
+    } else {
+      perms = &_perms;
+    }
 
     /* If the MMU is disabled, there is no need to translate the gva. */
     if ( !(sctlr & SCTLR_Axx_ELx_M) )
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 14 13:01:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 13:01:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563621.880923 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKIPf-0007kv-87; Fri, 14 Jul 2023 13:00:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563621.880923; Fri, 14 Jul 2023 13:00:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKIPf-0007ko-56; Fri, 14 Jul 2023 13:00:47 +0000
Received: by outflank-mailman (input) for mailman id 563621;
 Fri, 14 Jul 2023 13:00:46 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qKIPe-0007ki-4y
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 13:00:46 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKIPc-0001dx-Pr; Fri, 14 Jul 2023 13:00:44 +0000
Received: from [54.239.6.186] (helo=[192.168.4.173])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKIPc-0002FE-Ax; Fri, 14 Jul 2023 13:00:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=41CIW+OVC5fjhkuv2xGoVLJPHzL2aiHpTia0hu6DN4w=; b=wJqJgsGi/U82P5pB8OpBw08OHs
	vjIb5ffPZJexCiAVCBog/SUxxTTt1Y+SBeiGYBvigfvDobV5/CajLtvX4TE2epMWJKDc2hzY1QRRP
	Efra+5u+zQ+4nfVNbjNSSM6q3EV3S/6yfcu53TRG0x5iOw7N8e3+x+XEsNJvyLj3z1DA=;
Message-ID: <97d8a796-f790-8efc-1d89-def1f1193e61@xen.org>
Date: Fri, 14 Jul 2023 14:00:41 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally
 uninitialized variables
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <1ad20473a031eca75db4007bdc169616b512ef44.1689329728.git.nicola.vetrini@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <1ad20473a031eca75db4007bdc169616b512ef44.1689329728.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Nicola,

On 14/07/2023 12:49, Nicola Vetrini wrote:
> This patch aims to fix some occurrences of possibly uninitialized
> variables, that may be read before being written. This behaviour would
> violate MISRA C:2012 Rule 9.1, besides being generally undesirable.
> 
> In all the analyzed cases, such accesses were actually safe, but it's
> quite difficult to prove so by automatic checking, therefore a safer
> route is to change the code so as to avoid the behaviour from occurring,
> while preserving the semantics.
> 
> To achieve this goal, I adopted the following strategies:

Please let's at least one patch per strategy. I would also consider some 
of the rework separate so they can go in regardless the decision for the 
SAF-*.

> 
> - Add a suitably formatted local deviation comment
>    (as indicated in 'docs/misra/documenting-violations.rst')
>    to exempt the following line from checking.
> 
> - Provide an initialization for the variable at the declaration.
> 
> - Substitute a goto breaking out of control flow logic with a semantically
>    equivalent do { .. } while(0).

As I already mentioned in private, it is unclear to me how you decided 
which strategy to use. I still think we need to define our policy before 
changing the code. Otherwise, it is going to be difficult to decide for 
new code.

> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
>   docs/misra/safe.json                   |  8 +++++++
>   xen/arch/arm/arm64/lib/find_next_bit.c |  1 +
>   xen/arch/arm/bootfdt.c                 |  6 +++++
>   xen/arch/arm/decode.c                  |  2 ++
>   xen/arch/arm/domain_build.c            | 29 ++++++++++++++++++----
>   xen/arch/arm/efi/efi-boot.h            |  6 +++--
>   xen/arch/arm/gic-v3-its.c              |  9 ++++---
>   xen/arch/arm/mm.c                      |  1 +
>   xen/arch/arm/p2m.c                     | 33 +++++++++++++++-----------
>   9 files changed, 69 insertions(+), 26 deletions(-)
> 
> diff --git a/docs/misra/safe.json b/docs/misra/safe.json
> index e3c8a1d8eb..244001f5be 100644
> --- a/docs/misra/safe.json
> +++ b/docs/misra/safe.json
> @@ -12,6 +12,14 @@
>           },
>           {
>               "id": "SAF-1-safe",
> +            "analyser": {
> +                "eclair": "MC3R1.R9.1"
> +            },
> +            "name": "Rule 9.1: initializer not needed",
> +            "text": "The following local variables are possibly subject to being read before being written, but code inspection ensured that the control flow in the construct where they appear ensures that no such event may happen."
I am bit concerned which such statement because the code instance was 
today with the current code. This could change in the future and 
invalide the reasoning.

It is not clear to me if we have any mechanism to prevent that. If we 
don't, then I think we need to drastically reduce the number of time 
this is used (there are a bit too much for my taste).

> +        },
> +        {
> +            "id": "SAF-2-safe",
>               "analyser": {},
>               "name": "Sentinel",
>               "text": "Next ID to be used"
> diff --git a/xen/arch/arm/arm64/lib/find_next_bit.c b/xen/arch/arm/arm64/lib/find_next_bit.c
> index ca6f82277e..51b852c595 100644
> --- a/xen/arch/arm/arm64/lib/find_next_bit.c
> +++ b/xen/arch/arm/arm64/lib/find_next_bit.c
> @@ -67,6 +67,7 @@ unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size,
>   {
>   	const unsigned long *p = addr + BIT_WORD(offset);
>   	unsigned long result = offset & ~(BITS_PER_LONG-1);
> +	/* SAF-1-safe MC3R1.R9.1 */
>   	unsigned long tmp;

This is a file that was copied as-is from Linux. I thought we exclude them.

Anyway, can you provide some details why Eclair thinks this is may be 
used unitialized?

>   
>   	if (offset >= size)
> diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
> index 2673ad17a1..1292a64e8d 100644
> --- a/xen/arch/arm/bootfdt.c
> +++ b/xen/arch/arm/bootfdt.c
> @@ -34,6 +34,7 @@ static bool __init device_tree_node_matches(const void *fdt, int node,
>   static bool __init device_tree_node_compatible(const void *fdt, int node,
>                                                  const char *match)
>   {
> +    /* SAF-1-safe MC3R1.R9.1 */
>       int len, l;

It is unclear to me whether the SAF-* applies to 'len' or 'l'.

>       const void *prop;
>   
> @@ -169,7 +170,9 @@ int __init device_tree_for_each_node(const void *fdt, int node,
>        */
>       int depth = 0;
>       const int first_node = node;
> +    /* SAF-1-safe MC3R1.R9.1 */
>       u32 address_cells[DEVICE_TREE_MAX_DEPTH];
> +    /* SAF-1-safe MC3R1.R9.1 */
>       u32 size_cells[DEVICE_TREE_MAX_DEPTH];

I have never sent formally, but in the past I proposed to rework the 
code so {address, size}_cells[0] would be initialized before the loop. 
See 
https://lore.kernel.org/all/ea06f2ac-4ac1-4a6f-bda6-e775a7e68699@xen.org/.

Do you think this would help?

>       int ret;
>   
> @@ -249,8 +252,10 @@ static void __init process_multiboot_node(const void *fdt, int node,
>       const __be32 *cell;
>       bootmodule_kind kind;
>       paddr_t start, size;
> +    /* SAF-1-safe MC3R1.R9.1 */
>       int len;
>       /* sizeof("/chosen/") + DT_MAX_NAME + '/' + DT_MAX_NAME + '/0' => 92 */
> +    /* SAF-1-safe MC3R1.R9.1*/
>       char path[92];

So the two above, is one category of issue. The variables are passed as 
argument of function which will fill them.

Can Eclair look at the callers, if so, can we consider to always 
initialize the values in the callee?

This would reduce the number of SAF-*. There are a few other examples 
like that below. So I will skip them for now.

[...]

> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index d0d6be922d..d43f86c2f0 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -62,7 +62,7 @@ custom_param("dom0_mem", parse_dom0_mem);
>   
>   int __init parse_arch_dom0_param(const char *s, const char *e)
>   {
> -    long long val;
> +    long long val = LLONG_MAX;

Can you explain why you decided to initialize rather than SAF-? For 
clarity, I am not asking to switch to SAF-, I am mainly interested what 
were your though process.

>   
>       if ( !parse_signed_integer("sve", s, e, &val) )
>       {
> @@ -1077,6 +1077,7 @@ static void __init assign_static_memory_11(struct domain *d,
>   static int __init handle_linux_pci_domain(struct kernel_info *kinfo,
>                                             const struct dt_device_node *node)
>   {
> +    /* SAF-1-safe MC3R1.R9.1 */
>       uint16_t segment;
>       int res;
>   
> @@ -1351,6 +1352,7 @@ static int __init make_memory_node(const struct domain *d,
>       unsigned int i;
>       int res, reg_size = addrcells + sizecells;
>       int nr_cells = 0;
> +    /* SAF-1-safe MC3R1.R9.1*/
>       __be32 reg[NR_MEM_BANKS * 4 /* Worst case addrcells + sizecells */];
>       __be32 *cells;
>   
> @@ -1578,6 +1580,7 @@ static int __init find_unallocated_memory(const struct kernel_info *kinfo,
>       struct rangeset *unalloc_mem;
>       paddr_t start, end;
>       unsigned int i;
> +    /* SAF-1-safe MC3R1.R9.1 */
>       int res;
>   
>       dt_dprintk("Find unallocated memory for extended regions\n");
> @@ -1727,6 +1730,7 @@ static int __init find_memory_holes(const struct kernel_info *kinfo,
>       dt_for_each_device_node( dt_host, np )
>       {
>           unsigned int naddr;
> +        /* SAF-1-safe MC3R1.R9.1 */
>           paddr_t addr, size;
>   
>           naddr = dt_number_of_address(np);
> @@ -1976,9 +1980,11 @@ static int __init make_cpus_node(const struct domain *d, void *fdt)
>       const struct dt_device_node *npcpu;
>       unsigned int cpu;
>       const void *compatible = NULL;
> +    /* SAF-1-safe MC3R1.R9.1 */
>       u32 len;
>       /* Placeholder for cpu@ + a 32-bit hexadecimal number + \0 */
>       char buf[13];
> +    /* SAF-1-safe MC3R1.R9.1 */
>       u32 clock_frequency;
>       /* Keep the compiler happy with -Og */
>       bool clock_valid = false;
> @@ -2104,6 +2110,7 @@ static int __init make_gic_node(const struct domain *d, void *fdt,
>       const struct dt_device_node *gic = dt_interrupt_controller;
>       int res = 0;
>       const void *addrcells, *sizecells;
> +    /* SAF-1-safe MC3R1.R9.1 */
>       u32 addrcells_len, sizecells_len;
>   
>       /*
> @@ -2179,6 +2186,7 @@ static int __init make_timer_node(const struct kernel_info *kinfo)
>       int res;
>       unsigned int irq[MAX_TIMER_PPI];
>       gic_interrupt_t intrs[3];
> +    /* SAF-1-safe MC3R1.R9.1 */
>       u32 clock_frequency;
>       bool clock_valid;
>   
> @@ -2511,6 +2519,7 @@ static int __init handle_device(struct domain *d, struct dt_device_node *dev,
>       unsigned int naddr;
>       unsigned int i;
>       int res;
> +    /* SAF-1-safe MC3R1.R9.1 */
>       paddr_t addr, size;
>       bool own_device = !dt_device_for_passthrough(dev);
>       /*
> @@ -2779,6 +2788,7 @@ static int __init make_gicv2_domU_node(struct kernel_info *kinfo)
>   {
>       void *fdt = kinfo->fdt;
>       int res = 0;
> +    /* SAF-1-safe MC3R1.R9.1*/
>       __be32 reg[(GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS) * 2];
>       __be32 *cells;
>       const struct domain *d = kinfo->d;
> @@ -2914,6 +2924,7 @@ static int __init make_vpl011_uart_node(struct kernel_info *kinfo)
>       void *fdt = kinfo->fdt;
>       int res;
>       gic_interrupt_t intr;
> +    /* SAF-1-safe MC3R1.R9.1*/
>       __be32 reg[GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS];
>       __be32 *cells;
>       struct domain *d = kinfo->d;
> @@ -3435,6 +3446,7 @@ static void __init initrd_load(struct kernel_info *kinfo)
>       paddr_t paddr, len;
>       int node;
>       int res;
> +    /* SAF-1-safe MC3R1.R9.1 */
>       __be32 val[2];
>       __be32 *cellp;
>       void __iomem *initrd;
> @@ -3514,6 +3526,7 @@ static int __init get_evtchn_dt_property(const struct dt_device_node *np,
>                                            uint32_t *port, uint32_t *phandle)
>   {
>       const __be32 *prop = NULL;
> +    /* SAF-1-safe MC3R1.R9.1 */
>       uint32_t len;
>   
>       prop = dt_get_property(np, "xen,evtchn", &len);
> @@ -3538,10 +3551,13 @@ static int __init get_evtchn_dt_property(const struct dt_device_node *np,
>   static int __init alloc_domain_evtchn(struct dt_device_node *node)
>   {
>       int rc;
> +    /* SAF-1-safe MC3R1.R9.1 */
>       uint32_t domU1_port, domU2_port, remote_phandle;
>       struct dt_device_node *remote_node;
>       const struct dt_device_node *p1_node, *p2_node;
> +    /* SAF-1-safe MC3R1.R9.1 */
>       struct evtchn_alloc_unbound alloc_unbound;
> +    /* SAF-1-safe MC3R1.R9.1 */
>       struct evtchn_bind_interdomain bind_interdomain;
>       struct domain *d1 = NULL, *d2 = NULL;
>   
> @@ -3789,11 +3805,12 @@ static int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
>   
>   static int __init alloc_xenstore_evtchn(struct domain *d)
>   {
> -    evtchn_alloc_unbound_t alloc;
> +    evtchn_alloc_unbound_t alloc = {
> +        .dom = d->domain_id,
> +        .remote_dom = hardware_domain->domain_id
> +    };
>       int rc;
>   
> -    alloc.dom = d->domain_id;
> -    alloc.remote_dom = hardware_domain->domain_id;

It is not clear why this is modified. There are only two fields in 
'alloc' and they are both initialized.

>       rc = evtchn_alloc_unbound(&alloc, 0);
>       if ( rc )
>       {
> @@ -3810,8 +3827,9 @@ static int __init construct_domU(struct domain *d,
>                                    const struct dt_device_node *node)
>   {
>       struct kernel_info kinfo = {};
> -    const char *dom0less_enhanced;
> +    const char *dom0less_enhanced = NULL;

If you look at the user below, all the callers assume dom0less_enhanced 
will be non-NULL. So it is unclear to me how this value is safer.

Looking at the code, I wonder whether we should convert 
dt_property_read_string() to use ERR_PTR(). So we could remove the last 
argument and return it instead.

>       int rc;
> +    /* SAF-1-safe MC3R1.R9.1 */
>       u64 mem;
>       u32 p2m_mem_mb;
>       unsigned long p2m_pages;
> @@ -3939,6 +3957,7 @@ void __init create_domUs(void)
>               .grant_opts = XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
>           };
>           unsigned int flags = 0U;
> +        /* SAF-1-safe MC3R1.R9.1 */
>           uint32_t val;
>           int rc;
>   
> diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
> index bb64925d70..25f39364d1 100644
> --- a/xen/arch/arm/efi/efi-boot.h
> +++ b/xen/arch/arm/efi/efi-boot.h
> @@ -117,6 +117,7 @@ static int __init setup_chosen_node(void *fdt, int *addr_cells, int *size_cells)
>   static int __init fdt_set_reg(void *fdt, int node, int addr_cells,
>                                 int size_cells, uint64_t addr, uint64_t len)
>   {
> +    /* SAF-1-safe MC3R1.R9.1 */
>       __be32 val[4]; /* At most 2 64 bit values to be stored */
>       __be32 *cellp;
>   
> @@ -308,7 +309,7 @@ fdt_set_fail:
>   static void __init *fdt_increase_size(struct file *fdtfile, int add_size)
>   {
>       EFI_STATUS status;
> -    EFI_PHYSICAL_ADDRESS fdt_addr;
> +    EFI_PHYSICAL_ADDRESS fdt_addr = 0;
>       int fdt_size;
>       int pages;
>       void *new_fdt;
> @@ -433,7 +434,7 @@ static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
>   
>   static void *__init efi_arch_allocate_mmap_buffer(UINTN map_size)
>   {
> -    void *ptr;
> +    void *ptr = NULL;
>       EFI_STATUS status;
>   
>       status = efi_bs->AllocatePool(EfiLoaderData, map_size, &ptr);
> @@ -538,6 +539,7 @@ static void __init efi_arch_handle_module(const struct file *file,
>   {
>       int node;
>       int chosen;
> +    /* SAF-1-safe MC3R1.R9.1 */
>       int addr_len, size_len;
>   
>       if ( file == &dtbfile )
> diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
> index 3aa4edda10..aa0180ab5b 100644
> --- a/xen/arch/arm/gic-v3-its.c
> +++ b/xen/arch/arm/gic-v3-its.c
> @@ -192,8 +192,7 @@ static int its_send_cmd_mapc(struct host_its *its, uint32_t collection_id,
>   
>       cmd[0] = GITS_CMD_MAPC;
>       cmd[1] = 0x00;
> -    cmd[2] = encode_rdbase(its, cpu, collection_id);
> -    cmd[2] |= GITS_VALID_BIT;
> +    cmd[2] = encode_rdbase(its, cpu, collection_id) | GITS_VALID_BIT;

Hmmm... How is this even considered as unitialized variable?

>       cmd[3] = 0x00;
>   
>       return its_send_command(its, cmd);
> @@ -215,9 +214,7 @@ static int its_send_cmd_mapd(struct host_its *its, uint32_t deviceid,
>       }
>       cmd[0] = GITS_CMD_MAPD | ((uint64_t)deviceid << 32);
>       cmd[1] = size_bits;
> -    cmd[2] = itt_addr;
> -    if ( valid )
> -        cmd[2] |= GITS_VALID_BIT;
> +    cmd[2] = itt_addr | (valid ? GITS_VALID_BIT : 0x00);

Same here.

> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index c688227abd..a36068b2d8 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -935,6 +935,7 @@ static int xen_pt_update_entry(mfn_t root, unsigned long virt,
>                                  mfn_t mfn, unsigned int target,
>                                  unsigned int flags)
>   {
> +    /* SAF-1-safe MC3R1.R9.1 */
>       int rc;
>       unsigned int level;
>       lpae_t *table;
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index de32a2d638..83c56cf1cb 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -496,16 +496,18 @@ mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
>       lpae_t entry, *table;
>       int rc;
>       mfn_t mfn = INVALID_MFN;
> -    p2m_type_t _t;
> +    p2m_type_t _t = p2m_invalid;
>       DECLARE_OFFSETS(offsets, addr);
>   
>       ASSERT(p2m_is_locked(p2m));
>       BUILD_BUG_ON(THIRD_MASK != PAGE_MASK);
>   
>       /* Allow t to be NULL */
> -    t = t ?: &_t;
> -
> -    *t = p2m_invalid;
> +    if( t ) {
> +        *t = _t;
> +    } else {
> +        t = &_t;
> +    }
What was the problem with the previous code?

This is also not conformant to Xen coding style.

>   
>       if ( valid )
>           *valid = false;
> @@ -1031,6 +1033,7 @@ static int __p2m_set_entry(struct p2m_domain *p2m,
>       unsigned int level = 0;
>       unsigned int target = 3 - (page_order / XEN_PT_LPAE_SHIFT);
>       lpae_t *entry, *table, orig_pte;
> +    /* SAF-1-safe MC3R1.R9.1 */
>       int rc;

Can you provide some details why Eclair thinks it is unitialized?

>       /* A mapping is removed if the MFN is invalid. */
>       bool removing_mapping = mfn_eq(smfn, INVALID_MFN);
> @@ -1483,6 +1486,7 @@ static inline int p2m_remove_mapping(struct domain *d,
>   {
>       struct p2m_domain *p2m = p2m_get_hostp2m(d);
>       unsigned long i;
> +    /* SAF-1-safe MC3R1.R9.1 */
>       int rc;


Can you provide some details why Eclair thinks it is unitialized?

>   
>       p2m_write_lock(p2m);
> @@ -1685,20 +1689,21 @@ static int p2m_alloc_vmid(struct domain *d)
>   
>       ASSERT(nr != INVALID_VMID);
>   
> -    if ( nr == MAX_VMID )
> -    {
> -        rc = -EBUSY;
> -        printk(XENLOG_ERR "p2m.c: dom%d: VMID pool exhausted\n", d->domain_id);
> -        goto out;
> -    }
> +    do {

I don't understand this change. How is this making better for Eclair?

> +      if ( nr == MAX_VMID )
> +      {
> +          rc = -EBUSY;
> +          printk(XENLOG_ERR "p2m.c: dom%d: VMID pool exhausted\n", d->domain_id);
> +          break;
> +      }
>   
> -    set_bit(nr, vmid_mask);
> +      set_bit(nr, vmid_mask);
>   
> -    p2m->vmid = nr;
> +      p2m->vmid = nr;
>   
> -    rc = 0;
> +			rc = 0;
> +		} while ( 0 );
>   
> -out:
>       spin_unlock(&vmid_alloc_lock);
>       return rc;
>   }

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 13:04:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 13:04:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563624.880933 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKITB-0008Kk-NP; Fri, 14 Jul 2023 13:04:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563624.880933; Fri, 14 Jul 2023 13:04:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKITB-0008Kd-KV; Fri, 14 Jul 2023 13:04:25 +0000
Received: by outflank-mailman (input) for mailman id 563624;
 Fri, 14 Jul 2023 13:04:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=lIDz=DA=citrix.com=prvs=552896509=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qKITA-0008KX-7c
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 13:04:24 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f24652f6-2246-11ee-b239-6b7b168915f2;
 Fri, 14 Jul 2023 15:04:22 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f24652f6-2246-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689339862;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=IcQi58JOw5H4SaYEOAtieBCdxWJz52I4A+zCxyg1iLs=;
  b=gWfyq3d9uP/UqiK+asIQF902OkJQy2Or1HuMNe0FoqPNAPmMl3TTNjKP
   BsoH+LK6NmMEAi3ASqV1/ddonpbw88Fiuqnw1iKqCr4ludK1nNgpuwiOI
   Engl2ghPeGYn1dbUNKYOIhoirYFQYZq3pdgsGlRq9RDfWy1ej9QQn7cu/
   g=;
Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 116656760
X-Ironport-Server: esa1.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:8u7o1KhrUxc/wDq+rBn2Ine2X161gBAKZh0ujC45NGQN5FlHY01je
 htvWG+BO/zZMGDwc9Bwbo/g8h8Ov5fRxoJjTQtvq31jEykb9cadCdqndUqhZCn6wu8v7q5Ex
 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv
 cKai8DEMRqu1iUc3lg8sspvkzsx+qyr0N8klgZmP6sT4waCzyB94K83fsldEVOpGuG4IcbiL
 wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ
 OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+
 tQadAEyfgufgt62mreEQdBQqth9D8nkadZ3VnFIlVk1DN4jSJHHBa7L+cVZzHE7gcUm8fT2P
 pRDL2A1NVKZPkMJYw1MYH49tL7Aan3XWjtUsl+K44Ew5HDe1ldZ27nxKtvFPNeNQK25m27B/
 zyYojqmXEly2Nq3lWeirV+vguTzgHnZB5wSB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pQwtVv4DlE/5TyWOuBPo7RPr1i0j3X/k1Daj8AfenfA=
X-Talos-CUID: 9a23:cTalPWDS0yhNyuv6Eys7xXEEAdwgTn2HyUjbGnOUFThKSLLAHA==
X-Talos-MUID: 9a23:1ilHhAkp1/yJpDslSH0Ydno+aeA3zqeqA3wQy7dZpcmVDhcuNj2k2WE=
X-IronPort-AV: E=Sophos;i="6.01,205,1684814400"; 
   d="scan'208";a="116656760"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap
	<George.Dunlap@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>, "Stefano
 Stabellini" <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, Julien Grall
	<julien@xen.org>, Roberto Bagnara <roberto.bagnara@bugseng.com>, "Nicola
 Vetrini" <nicola.vetrini@bugseng.com>
Subject: [PATCH] xen/ACPI: Remove the acpi_string type
Date: Fri, 14 Jul 2023 14:04:11 +0100
Message-ID: <20230714130411.3055187-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain

Typedef-ing a naked pointer like this an anti-pattern which is best avoided.
Furthermore, it's bad to pass a string literate in a mutable type.  Delete the
type entirely, and replace it with a plain 'const char *'.

This highlights two futher bugs.  acpi_get_table() already had a mismatch in
types between it's declaration and definition, and we have declarations for
acpi_get_handle() and acpi_get_table_header() but no definition at all (nor
any callers).

This fixes violations of MISRA Rule 7.4:

  A string literal shall not be assigned to an object unless the object's type
  is "pointer to const-qualified char".

and of Rule 8.3:

  All declarations of an object or function shall use the same names and type
  qualifiers.

and of Rule 8.6:

  An identifier with external linkage shall have exactly one external
  definition.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: George Dunlap <George.Dunlap@eu.citrix.com>
CC: Jan Beulich <JBeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Wei Liu <wl@xen.org>
CC: Julien Grall <julien@xen.org>
CC: Roberto Bagnara <roberto.bagnara@bugseng.com>
CC: Nicola Vetrini <nicola.vetrini@bugseng.com>

Roberto/Nicola: Please double check my choice of rules here, and point out any
others that I may have missed.
---
 xen/drivers/acpi/tables/tbxface.c |  4 ++--
 xen/include/acpi/acpixf.h         | 13 ++-----------
 xen/include/acpi/actypes.h        |  1 -
 3 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/xen/drivers/acpi/tables/tbxface.c b/xen/drivers/acpi/tables/tbxface.c
index 21b2e5eae1c7..204d66caea48 100644
--- a/xen/drivers/acpi/tables/tbxface.c
+++ b/xen/drivers/acpi/tables/tbxface.c
@@ -164,7 +164,7 @@ acpi_initialize_tables(struct acpi_table_desc * initial_table_array,
  *
  *****************************************************************************/
 acpi_status __init
-acpi_get_table(char *signature,
+acpi_get_table(const char *signature,
 	       acpi_native_uint instance, struct acpi_table_header **out_table)
 {
 	acpi_native_uint i;
@@ -220,7 +220,7 @@ acpi_get_table(char *signature,
  *
  *****************************************************************************/
 acpi_status __init
-acpi_get_table_phys(acpi_string signature, acpi_native_uint instance,
+acpi_get_table_phys(const char *signature, acpi_native_uint instance,
 		     acpi_physical_address *addr, acpi_native_uint *len)
 {
 	acpi_native_uint i, j;
diff --git a/xen/include/acpi/acpixf.h b/xen/include/acpi/acpixf.h
index ba74908f0478..8b70154b8f96 100644
--- a/xen/include/acpi/acpixf.h
+++ b/xen/include/acpi/acpixf.h
@@ -69,25 +69,16 @@ acpi_status acpi_load_tables(void);
 acpi_status acpi_load_table(struct acpi_table_header *table_ptr);
 
 acpi_status
-acpi_get_table_header(acpi_string signature,
-		      acpi_native_uint instance,
-		      struct acpi_table_header *out_table_header);
-
-acpi_status
-acpi_get_table(acpi_string signature,
+acpi_get_table(const char *signature,
 	       acpi_native_uint instance, struct acpi_table_header **out_table);
 
 acpi_status
-acpi_get_table_phys(acpi_string signature, acpi_native_uint instance,
+acpi_get_table_phys(const char *signature, acpi_native_uint instance,
 		     acpi_physical_address *addr, acpi_native_uint *len);
 /*
  * Namespace and name interfaces
  */
 acpi_status
-acpi_get_handle(acpi_handle parent,
-		acpi_string pathname, acpi_handle * ret_handle);
-
-acpi_status
 acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags);
 
 acpi_status
diff --git a/xen/include/acpi/actypes.h b/xen/include/acpi/actypes.h
index f3e95abc3ab3..7023863d0349 100644
--- a/xen/include/acpi/actypes.h
+++ b/xen/include/acpi/actypes.h
@@ -281,7 +281,6 @@ typedef acpi_native_uint acpi_size;
  */
 typedef u32 acpi_status;	/* All ACPI Exceptions */
 typedef u32 acpi_name;		/* 4-byte ACPI name */
-typedef char *acpi_string;	/* Null terminated ASCII string */
 typedef void *acpi_handle;	/* Actually a ptr to a NS Node */
 
 struct uint64_struct {
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 14 13:05:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 13:05:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563626.880942 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKITt-0000R2-01; Fri, 14 Jul 2023 13:05:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563626.880942; Fri, 14 Jul 2023 13:05:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKITs-0000Qv-TK; Fri, 14 Jul 2023 13:05:08 +0000
Received: by outflank-mailman (input) for mailman id 563626;
 Fri, 14 Jul 2023 13:05:07 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qKITr-0000Qk-U3
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 13:05:07 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKITq-0001iz-NI; Fri, 14 Jul 2023 13:05:06 +0000
Received: from [54.239.6.186] (helo=[192.168.4.173])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKITq-0002PF-FZ; Fri, 14 Jul 2023 13:05:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=6GwLvMcT6Ze0EGmiN8d7VYkpW9dTm3or5uX8nkY1JB4=; b=VH244JYh8PY6Nd+0P/V8YTPqXe
	MMDSQrqV3SMQc2Afi4T7Lgny/ASdSjC98i1ElFILmtmRuUWJ8X4TxvUb0HE1jnezEayoNS2hN6+LR
	qgv0gFQzm/uNXM8q0TrkqvL0cvcWrlJLQWhu+DSRWOaIxMZOSenoRcC0ITS8E80Te9mY=;
Message-ID: <d1ccb5e1-d122-88df-e46a-39494b6d6d12@xen.org>
Date: Fri, 14 Jul 2023 14:05:03 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 14/07/2023 12:49, Nicola Vetrini wrote:
> The macro 'testop' expands to a function that declares the local
> variable 'oldbit', which is written before being set, but is such a
> way that is not amenable to automatic checking.

The code is pretty straightforward. So I am not entirely sure why Eclair 
is not happy. Is it because the value is set by assembly code?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 13:10:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 13:10:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563633.880953 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKIZA-00023J-Pp; Fri, 14 Jul 2023 13:10:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563633.880953; Fri, 14 Jul 2023 13:10:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKIZA-00023C-Lz; Fri, 14 Jul 2023 13:10:36 +0000
Received: by outflank-mailman (input) for mailman id 563633;
 Fri, 14 Jul 2023 13:10:35 +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
 <SRS0=lIDz=DA=citrix.com=prvs=552896509=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qKIZ9-000236-Gb
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 13:10:35 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cf687c7a-2247-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 15:10:32 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cf687c7a-2247-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689340232;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=TubUCgaOpcPozNc4hn7KgzQpWH88pNLu5aE4X43RVo4=;
  b=hrFDG6CiSP7vx/yZaqgfdyGBe22tvWYm7U34uLf2Nf//sF24+2VRvRco
   B74M/FnfCsLZuu1NBZ3Vnfir//T57IXHX981guDOD7f0aczoRfZ23R8gr
   NZhqCYwxNZG12RwCVR2BzATrv9agAY4d6ZmgOFP9LOhm2Y1eOjpRbDMPp
   4=;
Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 118818560
X-Ironport-Server: esa4.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:+D5zt6wI155f8NwnyS96t+fXxirEfRIJ4+MujC+fZmUNrF6WrkVUm
 GBODTqPaPaCamr0e9onPoS0oBgGupLUnddrTQA++yAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhPKwT5TcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KWhr7
 6A8BAlWUkGsuMaRg7afTeNUttt2eaEHPKtH0p1h5TTQDPJgSpHfWaTao9Rf2V/chOgXQ6yYP
 ZBAL2MyMlKZOUYn1lQ/UfrSmM+BgHXlfiIeg1WSvactuEDYzRBr0airO93QEjCPbZwMzhbB9
 j+YpwwVBDk6BoOz5SDZ1U62vezqxC7qQLAvEL6no6sCbFq7mTVIVUx+uUGAiem0jAuyVsxSL
 2QQ+zEytu4i+UqzVN7/Uhak5nmesXY0efBdDuk74wGl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3D?=
X-IronPort-AV: E=Sophos;i="6.01,205,1684814400"; 
   d="scan'208";a="118818560"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap
	<George.Dunlap@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>, "Stefano
 Stabellini" <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, Julien Grall
	<julien@xen.org>, Roberto Bagnara <roberto.bagnara@bugseng.com>, "Nicola
 Vetrini" <nicola.vetrini@bugseng.com>
Subject: [PATCH] xen/ACPI: Use const char * for string literals
Date: Fri, 14 Jul 2023 14:10:26 +0100
Message-ID: <20230714131026.3082591-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain

For pre-ANSI-C compatibility reasons, string literals have a mutable type, but
it is undefined behaviour to mutate them.

Swap char *'s to const char *'s for variables which hold string literals.

This fixes several violations of MISRA Rule 7.4:

  A string literal shall not be assigned to an object unless the object's type
  is "pointer to const-qualified char".

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: George Dunlap <George.Dunlap@eu.citrix.com>
CC: Jan Beulich <JBeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Wei Liu <wl@xen.org>
CC: Julien Grall <julien@xen.org>
CC: Roberto Bagnara <roberto.bagnara@bugseng.com>
CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/drivers/acpi/tables.c           |  6 +++---
 xen/drivers/acpi/tables/tbfadt.c    |  2 +-
 xen/drivers/acpi/tables/tbutils.c   |  2 +-
 xen/drivers/acpi/utilities/utmisc.c |  6 +++---
 xen/include/acpi/actables.h         |  2 +-
 xen/include/acpi/acutils.h          | 12 ++++++------
 xen/include/xen/acpi.h              |  6 +++---
 7 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c
index 96ff96b84c66..20aed8929b86 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -300,7 +300,7 @@ acpi_table_get_entry_madt(enum acpi_madt_type entry_id,
 }
 
 int __init
-acpi_parse_entries(char *id, unsigned long table_size,
+acpi_parse_entries(const char *id, unsigned long table_size,
 		   acpi_table_entry_handler handler,
 		   struct acpi_table_header *table_header,
 		   int entry_id, unsigned int max_entries)
@@ -359,7 +359,7 @@ acpi_parse_entries(char *id, unsigned long table_size,
 }
 
 int __init
-acpi_table_parse_entries(char *id,
+acpi_table_parse_entries(const char *id,
 			 unsigned long table_size,
 			 int entry_id,
 			 acpi_table_entry_handler handler,
@@ -405,7 +405,7 @@ acpi_table_parse_madt(enum acpi_madt_type id,
  * Scan the ACPI System Descriptor Table (STD) for a table matching @id,
  * run @handler on it.
  */
-int __init acpi_table_parse(char *id, acpi_table_handler handler)
+int __init acpi_table_parse(const char *id, acpi_table_handler handler)
 {
 	struct acpi_table_header *table = NULL;
 
diff --git a/xen/drivers/acpi/tables/tbfadt.c b/xen/drivers/acpi/tables/tbfadt.c
index d8fcc50deca5..a03836e0dc8a 100644
--- a/xen/drivers/acpi/tables/tbfadt.c
+++ b/xen/drivers/acpi/tables/tbfadt.c
@@ -60,7 +60,7 @@ static void acpi_tb_validate_fadt(void);
 /* Table for conversion of FADT to common internal format and FADT validation */
 
 typedef struct acpi_fadt_info {
-	char *name;
+	const char *name;
 	u16 target;
 	u16 source;
 	u16 length;
diff --git a/xen/drivers/acpi/tables/tbutils.c b/xen/drivers/acpi/tables/tbutils.c
index 11412c47deb4..458989abea99 100644
--- a/xen/drivers/acpi/tables/tbutils.c
+++ b/xen/drivers/acpi/tables/tbutils.c
@@ -243,7 +243,7 @@ u8 acpi_tb_checksum(u8 * buffer, acpi_native_uint length)
 
 void __init
 acpi_tb_install_table(acpi_physical_address address,
-		      u8 flags, char *signature, acpi_native_uint table_index)
+		      u8 flags, const char *signature, acpi_native_uint table_index)
 {
 	struct acpi_table_header *table;
 
diff --git a/xen/drivers/acpi/utilities/utmisc.c b/xen/drivers/acpi/utilities/utmisc.c
index 4e1497ad0fae..ee22c83e3842 100644
--- a/xen/drivers/acpi/utilities/utmisc.c
+++ b/xen/drivers/acpi/utilities/utmisc.c
@@ -134,7 +134,7 @@ const char *__init acpi_ut_validate_exception(acpi_status status)
  ******************************************************************************/
 
 void ACPI_INTERNAL_VAR_XFACE __init
-acpi_ut_error(const char *module_name, u32 line_number, char *format, ...)
+acpi_ut_error(const char *module_name, u32 line_number, const char *format, ...)
 {
 	va_list args;
 
@@ -147,7 +147,7 @@ acpi_ut_error(const char *module_name, u32 line_number, char *format, ...)
 }
 
 void ACPI_INTERNAL_VAR_XFACE __init
-acpi_ut_warning(const char *module_name, u32 line_number, char *format, ...)
+acpi_ut_warning(const char *module_name, u32 line_number, const char *format, ...)
 {
 	va_list args;
 
@@ -161,7 +161,7 @@ acpi_ut_warning(const char *module_name, u32 line_number, char *format, ...)
 }
 
 void ACPI_INTERNAL_VAR_XFACE __init
-acpi_ut_info(const char *module_name, u32 line_number, char *format, ...)
+acpi_ut_info(const char *module_name, u32 line_number, const char *format, ...)
 {
 	va_list args;
 
diff --git a/xen/include/acpi/actables.h b/xen/include/acpi/actables.h
index d4cad35f41c0..527e1c9f9b9d 100644
--- a/xen/include/acpi/actables.h
+++ b/xen/include/acpi/actables.h
@@ -99,7 +99,7 @@ acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length);
 
 void
 acpi_tb_install_table(acpi_physical_address address,
-		      u8 flags, char *signature, acpi_native_uint table_index);
+		      u8 flags, const char *signature, acpi_native_uint table_index);
 
 acpi_status
 acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags);
diff --git a/xen/include/acpi/acutils.h b/xen/include/acpi/acutils.h
index b1b0df758bd6..ac54adaa8c23 100644
--- a/xen/include/acpi/acutils.h
+++ b/xen/include/acpi/acutils.h
@@ -164,7 +164,7 @@ acpi_ut_debug_print(u32 requested_debug_level,
 		    u32 line_number,
 		    const char *function_name,
 		    const char *module_name,
-		    u32 component_id, char *format, ...) ACPI_PRINTF_LIKE(6);
+		    u32 component_id, const char *format, ...) ACPI_PRINTF_LIKE(6);
 
 void ACPI_INTERNAL_VAR_XFACE
 acpi_ut_debug_print_raw(u32 requested_debug_level,
@@ -172,24 +172,24 @@ acpi_ut_debug_print_raw(u32 requested_debug_level,
 			const char *function_name,
 			const char *module_name,
 			u32 component_id,
-			char *format, ...) ACPI_PRINTF_LIKE(6);
+			const char *format, ...) ACPI_PRINTF_LIKE(6);
 
 void ACPI_INTERNAL_VAR_XFACE
 acpi_ut_error(const char *module_name,
-	      u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3);
+	      u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
 
 void ACPI_INTERNAL_VAR_XFACE
 acpi_ut_exception(const char *module_name,
 		  u32 line_number,
-		  acpi_status status, char *format, ...) ACPI_PRINTF_LIKE(4);
+		  acpi_status status, const char *format, ...) ACPI_PRINTF_LIKE(4);
 
 void ACPI_INTERNAL_VAR_XFACE
 acpi_ut_warning(const char *module_name,
-		u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3);
+		u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
 
 void ACPI_INTERNAL_VAR_XFACE
 acpi_ut_info(const char *module_name,
-	     u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3);
+	     u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
 
 /*
  * utmisc
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index 352f27f6a723..8ec95791726e 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -81,12 +81,12 @@ int erst_init(void);
 void acpi_hest_init(void);
 
 int acpi_table_init (void);
-int acpi_table_parse(char *id, acpi_table_handler handler);
-int acpi_parse_entries(char *id, unsigned long table_size,
+int acpi_table_parse(const char *id, acpi_table_handler handler);
+int acpi_parse_entries(const char *id, unsigned long table_size,
 		       acpi_table_entry_handler handler,
 		       struct acpi_table_header *table_header,
 		       int entry_id, unsigned int max_entries);
-int acpi_table_parse_entries(char *id, unsigned long table_size,
+int acpi_table_parse_entries(const char *id, unsigned long table_size,
 	int entry_id, acpi_table_entry_handler handler, unsigned int max_entries);
 struct acpi_subtable_header *acpi_table_get_entry_madt(enum acpi_madt_type id,
 						      unsigned int entry_index);
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 14 13:21:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 13:21:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563637.880962 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKIjC-0003bv-Mj; Fri, 14 Jul 2023 13:20:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563637.880962; Fri, 14 Jul 2023 13:20:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKIjC-0003bo-Js; Fri, 14 Jul 2023 13:20:58 +0000
Received: by outflank-mailman (input) for mailman id 563637;
 Fri, 14 Jul 2023 13:20:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=lIDz=DA=citrix.com=prvs=552896509=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qKIjB-0003bi-Pn
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 13:20:57 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 43029106-2249-11ee-b239-6b7b168915f2;
 Fri, 14 Jul 2023 15:20:56 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 43029106-2249-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689340856;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=4J+jV04Ao7kvosuULBR3hVbNd7EwavyjMazSdj6BgAo=;
  b=GD34DJyh6bP1XnAgx3Y1ivSdwdseFQt2Vn6JFOfafdTSfEBekpKIMiG5
   OnNui01rs8tgoWQBtDTvYkZNhnFG8iOzYO5jJHd0VNUPvjhO//l/mEZCe
   4Kmr5ZWwY5evDZmDxYKPS9GQDslY23XXfzm/545vf8PiQPkutD65rfPsQ
   E=;
Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 114942402
X-Ironport-Server: esa5.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:Grt0/q94QQiGhm7rz8UTDrUDqH6TJUtcMsCJ2f8bNWPcYEJGY0x3n
 zEWXDqFPv+MNmf3ftp2bo2wp0gE6pbUm9Q1QVM9qSo8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s
 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG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a23:gHZjPagXMUYfrgbDprMpcwtFJXBQXh4ji2hC6mlwRA09TyX5ra
 2TdZUgpHrJYVMqMk3I9uruBEDtex3hHP1OkOss1NWZPDUO0VHARO1fBOPZqAEIcBeOldK1u5
 0AT0B/YueAd2STj6zBkXSF+wBL+qj6zEiq792usEuEVWtRGsVdB58SMHfiLqVxLjM2YqYRJd
 6nyedsgSGvQngTZtTTPAh/YwCSz+e78q4PeHQ9dmca1DU=
X-Talos-CUID: =?us-ascii?q?9a23=3ARAJsY2u9ulqnC707+f5vJTx/6Is0X2bm80vVCXa?=
 =?us-ascii?q?0KmhQdoG+eF7T8vl7xp8=3D?=
X-Talos-MUID: =?us-ascii?q?9a23=3A71uz5g/CiiuJN+JqmElteJqQf+EroIGjCHsrrYx?=
 =?us-ascii?q?FmtufCidRfA2iqg3iFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,205,1684814400"; 
   d="scan'208";a="114942402"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap
	<George.Dunlap@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>, "Stefano
 Stabellini" <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, Julien Grall
	<julien@xen.org>
Subject: [PATCH] xen/ACPI: Remove acpi_get_pxm() entirely
Date: Fri, 14 Jul 2023 14:20:24 +0100
Message-ID: <20230714132024.3091309-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain

There are no callers, and the non-stub implementation is #if 0'd out, with the
internal trying to perform an AML invocation.

There's no plausible way that code is getting un-#if 0'd, so drop it.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: George Dunlap <George.Dunlap@eu.citrix.com>
CC: Jan Beulich <JBeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Wei Liu <wl@xen.org>
CC: Julien Grall <julien@xen.org>
---
 xen/drivers/acpi/numa.c | 21 ---------------------
 xen/include/xen/acpi.h  |  9 ---------
 2 files changed, 30 deletions(-)

diff --git a/xen/drivers/acpi/numa.c b/xen/drivers/acpi/numa.c
index bc6e888234e4..77945f874454 100644
--- a/xen/drivers/acpi/numa.c
+++ b/xen/drivers/acpi/numa.c
@@ -212,24 +212,3 @@ int __init acpi_numa_init(void)
 	acpi_numa_arch_fixup();
 	return 0;
 }
-
-#if 0
-int acpi_get_pxm(acpi_handle h)
-{
-	unsigned long pxm;
-	acpi_status status;
-	acpi_handle handle;
-	acpi_handle phandle = h;
-
-	do {
-		handle = phandle;
-		status = acpi_evaluate_integer(handle, "_PXM", NULL, &pxm);
-		if (ACPI_SUCCESS(status))
-			return (int)pxm;
-		status = acpi_get_parent(handle, &phandle);
-	} while (ACPI_SUCCESS(status));
-	return -1;
-}
-
-EXPORT_SYMBOL(acpi_get_pxm);
-#endif
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index 8ec95791726e..6a2f5983fdd3 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -195,15 +195,6 @@ int acpi_set_pdc_bits(uint32_t acpi_id, XEN_GUEST_HANDLE(uint32));
 #endif
 int arch_acpi_set_pdc_bits(u32 acpi_id, u32 *, u32 mask);
 
-#ifdef CONFIG_ACPI_NUMA
-int acpi_get_pxm(acpi_handle handle);
-#else
-static inline int acpi_get_pxm(acpi_handle handle)
-{
-	return 0;
-}
-#endif
-
 void acpi_reboot(void);
 
 #ifdef CONFIG_INTEL_IOMMU
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 14 13:21:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 13:21:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563640.880973 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKIjv-00046r-Vy; Fri, 14 Jul 2023 13:21:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563640.880973; Fri, 14 Jul 2023 13:21:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKIjv-00046k-SR; Fri, 14 Jul 2023 13:21:43 +0000
Received: by outflank-mailman (input) for mailman id 563640;
 Fri, 14 Jul 2023 13:21:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qKIju-00046c-Hj
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 13:21:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKIjt-00029X-P9; Fri, 14 Jul 2023 13:21:41 +0000
Received: from [54.239.6.186] (helo=[192.168.4.173])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKIjt-000341-FG; Fri, 14 Jul 2023 13:21:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=Ha+6tZyTDIUtjL/vtzwfiky+EFOmYIPqeYmTZ03yuj4=; b=UfkT8e2kQRPY9cVSlYn8Xx2+hQ
	ImChIaRlCDSKNSXdclAaVh09GKln0xBGFrh5ECDq6/f/ZhcXhZwZqeGBiVyybIMz+PXlfn3IOrOSZ
	y5SLd+o4IQE/qNELSnhxGelj99q5LPUXrrnzEASm92omDltQak1xDVYzHHKbmtVsE5J8=;
Message-ID: <9ab4ae66-aa72-2426-08e5-cbe44030d7f2@xen.org>
Date: Fri, 14 Jul 2023 14:21:39 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [RFC PATCH 3/4] xen/arm: initialize conditionally uninitialized
 local variables
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <c7d2cd46f06f75f8a1810168c508f05d242f831c.1689329728.git.nicola.vetrini@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <c7d2cd46f06f75f8a1810168c508f05d242f831c.1689329728.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 14/07/2023 12:49, Nicola Vetrini wrote:
> This patch aims to fix some occurrences of possibly uninitialized
> variables, that may be read before being written. This behaviour would
> violate MISRA C:2012 Rule 9.1, besides being generally undesirable.
> 
> In all the analyzed cases, such accesses were actually safe, but it's
> quite difficult to prove so by automatic checking, therefore a safer
> route is to change the code so as to avoid the behaviour from occurring,
> while preserving the semantics.
> 
> An initialization to a safe value is provided to reach this aim.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
> Additional input on which values may be 'safe' in each context is
> surely welcome, to avoid possibly compromising the correctness of
> the function semantics.
> ---
>   xen/arch/arm/cpuerrata.c                    |  6 +++---
>   xen/arch/arm/domctl.c                       |  8 ++++----
>   xen/arch/arm/gic-v3-lpi.c                   | 17 +++++++++--------
>   xen/arch/arm/include/asm/p2m.h              | 10 ++++++----
>   xen/arch/arm/platforms/xilinx-zynqmp-eemi.c | 10 ++--------
>   xen/arch/arm/psci.c                         | 10 +++++-----
>   xen/drivers/char/pl011.c                    |  2 +-
>   7 files changed, 30 insertions(+), 33 deletions(-)
> 
> diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
> index d0658aedb6..14694c6081 100644
> --- a/xen/arch/arm/cpuerrata.c
> +++ b/xen/arch/arm/cpuerrata.c
> @@ -159,7 +159,7 @@ extern char __mitigate_spectre_bhb_loop_start_32[],
>   
>   static int enable_smccc_arch_workaround_1(void *data)
>   {
> -    struct arm_smccc_res res;
> +    struct arm_smccc_res res = {0};

I understand you desire to make happy. But I am not sure that 
initializing to 0 is the right thing. If the SMCC were not properly 
setting the register, then we most likely don't want to install the 
workaround. Instead, we most likely want to warn.

So you want (int)res.a0 to be negative. We don't care about the other 
fields.

>       const struct arm_cpu_capabilities *entry = data;
>   
>       /*
> @@ -252,7 +252,7 @@ static int enable_spectre_bhb_workaround(void *data)
>   
>       if ( cpus_have_cap(ARM_WORKAROUND_BHB_SMCC_3) )
>       {
> -        struct arm_smccc_res res;
> +        struct arm_smccc_res res = {0};

Same remark here.

>   
>           if ( smccc_ver < SMCCC_VERSION(1, 1) )
>               goto warn;
> @@ -393,7 +393,7 @@ DEFINE_PER_CPU_READ_MOSTLY(register_t, ssbd_callback_required);
>   
>   static bool has_ssbd_mitigation(const struct arm_cpu_capabilities *entry)
>   {
> -    struct arm_smccc_res res;
> +    struct arm_smccc_res res = {0};

Here you would want (int)res.a0 to be equal to ARM_SMCCC_NOT_SUPPORTED.

>       bool required;
>   
>       if ( smccc_ver < SMCCC_VERSION(1, 1) )
> diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c
> index ad56efb0f5..b38fed72be 100644
> --- a/xen/arch/arm/domctl.c
> +++ b/xen/arch/arm/domctl.c
> @@ -29,10 +29,10 @@ static int handle_vuart_init(struct domain *d,
>                                struct xen_domctl_vuart_op *vuart_op)
>   {
>       int rc;
> -    struct vpl011_init_info info;
> -
> -    info.console_domid = vuart_op->console_domid;
> -    info.gfn = _gfn(vuart_op->gfn);
> +    struct vpl011_init_info info = {
> +        .console_domid = vuart_op->console_domid,
> +        .gfn = _gfn(vuart_op->gfn)
> +    };

I am not against, this change. But I don't quite understand how this 
makes Eclair much happier?

Also, if this is the desired way, then I think this should be written 
down in the CODING_STYLE.

>   
>       if ( d->creation_finished )
>           return -EPERM;
> diff --git a/xen/arch/arm/gic-v3-lpi.c b/xen/arch/arm/gic-v3-lpi.c
> index eb0a5535e4..12f2af2e4d 100644
> --- a/xen/arch/arm/gic-v3-lpi.c
> +++ b/xen/arch/arm/gic-v3-lpi.c
> @@ -210,7 +210,10 @@ out:
>   void gicv3_lpi_update_host_entry(uint32_t host_lpi, int domain_id,
>                                    uint32_t virt_lpi)
>   {
> -    union host_lpi *hlpip, hlpi;
> +    union host_lpi *hlpip, hlpi = {
> +        .virt_lpi = virt_lpi,
> +        .dom_id = domain_id
> +    };
>   
>       ASSERT(host_lpi >= LPI_OFFSET);
>   
> @@ -218,9 +221,6 @@ void gicv3_lpi_update_host_entry(uint32_t host_lpi, int domain_id,
>   
>       hlpip = &lpi_data.host_lpis[host_lpi / HOST_LPIS_PER_PAGE][host_lpi % HOST_LPIS_PER_PAGE];
>   
> -    hlpi.virt_lpi = virt_lpi;
> -    hlpi.dom_id = domain_id;
> -
>       write_u64_atomic(&hlpip->data, hlpi.data);
>   }
>   
> @@ -542,14 +542,15 @@ int gicv3_allocate_host_lpi_block(struct domain *d, uint32_t *first_lpi)
>   
>       for ( i = 0; i < LPI_BLOCK; i++ )
>       {
> -        union host_lpi hlpi;
> -
>           /*
>            * Mark this host LPI as belonging to the domain, but don't assign
>            * any virtual LPI or a VCPU yet.
>            */
> -        hlpi.virt_lpi = INVALID_LPI;
> -        hlpi.dom_id = d->domain_id;
> +        union host_lpi hlpi = {
> +            .virt_lpi = INVALID_LPI,
> +            .dom_id = d->domain_id
> +        };
> +
>           write_u64_atomic(&lpi_data.host_lpis[chunk][lpi_idx + i].data,
>                            hlpi.data);
>   
> diff --git a/xen/arch/arm/include/asm/p2m.h b/xen/arch/arm/include/asm/p2m.h
> index 940495d42b..413e2a7add 100644
> --- a/xen/arch/arm/include/asm/p2m.h
> +++ b/xen/arch/arm/include/asm/p2m.h
> @@ -345,7 +345,7 @@ static inline struct page_info *get_page_from_gfn(
>       struct domain *d, unsigned long gfn, p2m_type_t *t, p2m_query_t q)
>   {
>       mfn_t mfn;
> -    p2m_type_t _t;
> +    p2m_type_t _t = p2m_invalid;
>       struct page_info *page;
>   
>       /*
> @@ -355,10 +355,12 @@ static inline struct page_info *get_page_from_gfn(
>       if ( likely(d != dom_xen) )
>           return p2m_get_page_from_gfn(d, _gfn(gfn), t);
>   
> -    if ( !t )
> +    /* Allow t to be NULL */
> +    if ( t )
> +        *t = _t;
> +    else {
>           t = &_t;
> -
> -    *t = p2m_invalid;
> +    }

I understand the exist construct is not liked by Eclair. But your new 
construct is not easily readable by a human. Before I can propose a 
different approach, can you clarify why Eclair is unhappy this the 
existing code?

>       /*
>        * DOMID_XEN sees 1-1 RAM. The p2m_type is based on the type of the
> diff --git a/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c b/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
> index 2053ed7ac5..39d9ab4fa9 100644
> --- a/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
> +++ b/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
> @@ -51,11 +51,11 @@ static inline bool domain_has_reset_access(struct domain *d, uint32_t rst)
>   
>   bool zynqmp_eemi(struct cpu_user_regs *regs)
>   {
> -    struct arm_smccc_res res;
> +    struct arm_smccc_res res = {0};
>       uint32_t fid = get_user_reg(regs, 0);
>       uint32_t nodeid = get_user_reg(regs, 1);
>       unsigned int pm_fn = fid & 0xFFFF;
> -    enum pm_ret_status ret;
> +    enum pm_ret_status ret = XST_PM_NO_ACCESS;

It is not clear to me why Eclair is unhappy here?

>   
>       switch ( fid )
>       {
> @@ -89,7 +89,6 @@ bool zynqmp_eemi(struct cpu_user_regs *regs)
>           {
>               gprintk(XENLOG_WARNING,
>                       "zynqmp-pm: fn=%u No access to node %u\n", pm_fn, nodeid);
> -            ret = XST_PM_NO_ACCESS;
>               goto done;

I find the new approach less obvious. How about introduce a macro that 
will set the result and the use replace the two lines with:

set_result(regs, XST_PM_NO_ACCESS);
return 0;

where set_result(regs, ret) is

set_user_reg(regs, 0, ret)

> diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
> index 695d2fa1f1..47e46af608 100644
> --- a/xen/arch/arm/psci.c
> +++ b/xen/arch/arm/psci.c
> @@ -38,7 +38,7 @@ static uint32_t psci_cpu_on_nr;
>   
>   int call_psci_cpu_on(int cpu)
>   {
> -    struct arm_smccc_res res;
> +    struct arm_smccc_res res = {0};

I don't this we should initialize a0 to 0 as this would indicate a 
success. Instead, we want an invalid value.

>   
>       arm_smccc_smc(psci_cpu_on_nr, cpu_logical_map(cpu), __pa(init_secondary),
>                     &res);
> @@ -50,7 +50,7 @@ void call_psci_cpu_off(void)
>   {
>       if ( psci_ver > PSCI_VERSION(0, 1) )
>       {
> -        struct arm_smccc_res res;
> +        struct arm_smccc_res res = {0};

Same here.

>   
>           /* If successfull the PSCI cpu_off call doesn't return */
>           arm_smccc_smc(PSCI_0_2_FN32_CPU_OFF, &res);
> @@ -73,7 +73,7 @@ void call_psci_system_reset(void)
>   
>   static int __init psci_features(uint32_t psci_func_id)
>   {
> -    struct arm_smccc_res res;
> +    struct arm_smccc_res res = {0};

Same here.

>   
>       if ( psci_ver < PSCI_VERSION(1, 0) )
>           return PSCI_NOT_SUPPORTED;
> @@ -115,7 +115,7 @@ static void __init psci_init_smccc(void)
>   
>       if ( psci_features(ARM_SMCCC_VERSION_FID) != PSCI_NOT_SUPPORTED )
>       {
> -        struct arm_smccc_res res;
> +        struct arm_smccc_res res = {0};

Same here.

>   
>           arm_smccc_smc(ARM_SMCCC_VERSION_FID, &res);
>           if ( PSCI_RET(res) != ARM_SMCCC_NOT_SUPPORTED )
> @@ -168,7 +168,7 @@ static int __init psci_init_0_2(void)
>           { /* sentinel */ },
>       };
>       int ret;
> -    struct arm_smccc_res res;
> +    struct arm_smccc_res res = {0};

Same here.

>   
>       if ( acpi_disabled )
>       {
> diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
> index f7bf3ad117..34ce90be52 100644
> --- a/xen/drivers/char/pl011.c
> +++ b/xen/drivers/char/pl011.c
> @@ -285,7 +285,7 @@ static int __init pl011_dt_uart_init(struct dt_device_node *dev,
>       const char *config = data;
>       int res;
>       paddr_t addr, size;
> -    uint32_t io_width;
> +    uint32_t io_width = 0;

We have many use of dt_property_read_*() within the code base. I would 
like us te decide of a policy first.

>       bool mmio32 = false, sbsa;
>   
>       if ( strcmp(config, "") )

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 13:23:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 13:23:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563646.880983 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKIlE-0004mY-DW; Fri, 14 Jul 2023 13:23:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563646.880983; Fri, 14 Jul 2023 13:23:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKIlE-0004mR-9G; Fri, 14 Jul 2023 13:23:04 +0000
Received: by outflank-mailman (input) for mailman id 563646;
 Fri, 14 Jul 2023 13:23:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qKIlC-0004mH-Qj
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 13:23:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKIlB-0002BE-KT; Fri, 14 Jul 2023 13:23:01 +0000
Received: from [54.239.6.186] (helo=[192.168.4.173])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKIlB-0003FY-Eg; Fri, 14 Jul 2023 13:23:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=dGRqjOHHyeYazry7toK83b5avv/MhJKkK17pLYfjMRo=; b=u2dOM9IUcvpgDdKbSKLsTpoetg
	sHR08tsztw8VH7L0rcyY4UvUjdWTPbS3HnTacLEQ4T8ztINA1DWH0ZIdqTq5bQarui8zZq52SGLNH
	TVHqns2viCTtv6JyjyxeosbnzWQhoUXp1hHxNkiHDINKuXHYtT89aQqzgO+hQTYFllho=;
Message-ID: <b7aeb152-3dce-6378-3f9d-e23913a1e15f@xen.org>
Date: Fri, 14 Jul 2023 14:22:59 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH] xen/common: Use const char * for string literals
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
 Jan Beulich <JBeulich@suse.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Roberto Bagnara <roberto.bagnara@bugseng.com>,
 Nicola Vetrini <nicola.vetrini@bugseng.com>
References: <20230714105902.2996620-1-andrew.cooper3@citrix.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230714105902.2996620-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Andrew,

On 14/07/2023 11:59, Andrew Cooper wrote:
> For pre-ANSI-C compatibility reasons, string literals have a mutable type, but
> it is undefined behaviour to mutate them.
> 
> Swap char *'s to const char *'s for variables which hold string literals.
> 
> This fixes several violations of MISRA Rule 7.4:
> 
>    A string literal shall not be assigned to an object unless the object's type
>    is "pointer to const-qualified char".
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 13:24:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 13:24:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563649.880992 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKImp-0005Ld-MY; Fri, 14 Jul 2023 13:24:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563649.880992; Fri, 14 Jul 2023 13:24:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKImp-0005LW-Jb; Fri, 14 Jul 2023 13:24:43 +0000
Received: by outflank-mailman (input) for mailman id 563649;
 Fri, 14 Jul 2023 13:24:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qKImp-0005LO-58
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 13:24:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKImo-0002Ei-7s; Fri, 14 Jul 2023 13:24:42 +0000
Received: from [54.239.6.186] (helo=[192.168.4.173])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKImo-0003I1-1K; Fri, 14 Jul 2023 13:24:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=8dSjrJX81ELMcw/ReX9TZOJZz8Ymx6aMnuM7JVpffe4=; b=ro7pLELRAOPpzsDMkw18ox2/Wt
	qScAh9dfnCc/9tdUH7KGuifi1gFV3ipZgfwhlt9sxbE/UL2JdQuD/1k/D7xqHemDE2NdxKfRmNMNl
	0EErLyq5mjDUjb6vA8gOnlLahjLpUb80iypgChhvlbKqHPQG7TeqJgitbzI5ruGIGVBA=;
Message-ID: <625fd6db-18cf-8d04-c94e-9f988baa1878@xen.org>
Date: Fri, 14 Jul 2023 14:24:39 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH] xen/ACPI: Use const char * for string literals
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
 Jan Beulich <JBeulich@suse.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Roberto Bagnara <roberto.bagnara@bugseng.com>,
 Nicola Vetrini <nicola.vetrini@bugseng.com>
References: <20230714131026.3082591-1-andrew.cooper3@citrix.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230714131026.3082591-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Andrew,

On 14/07/2023 14:10, Andrew Cooper wrote:
> For pre-ANSI-C compatibility reasons, string literals have a mutable type, but
> it is undefined behaviour to mutate them.
> 
> Swap char *'s to const char *'s for variables which hold string literals.
> 
> This fixes several violations of MISRA Rule 7.4:
> 
>    A string literal shall not be assigned to an object unless the object's type
>    is "pointer to const-qualified char".
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>


I had a similar patch in my queue. But never sent as I didn't know 
whether it would be accepted. This was one of the major blocker for 
switching the hypervisor to use const string.

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 13:44:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 13:44:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563652.881003 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKJ5n-0007v7-8b; Fri, 14 Jul 2023 13:44:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563652.881003; Fri, 14 Jul 2023 13:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKJ5n-0007v0-5E; Fri, 14 Jul 2023 13:44:19 +0000
Received: by outflank-mailman (input) for mailman id 563652;
 Fri, 14 Jul 2023 13:44:18 +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
 <SRS0=Z95V=DA=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qKJ5m-0007uu-FE
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 13:44:18 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 85dda14e-224c-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 15:44:15 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.163.94.163])
 by support.bugseng.com (Postfix) with ESMTPSA id 551DA4EE0739;
 Fri, 14 Jul 2023 15:44:14 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 85dda14e-224c-11ee-8611-37d641c3527e
Message-ID: <77b82911-a6c1-d23f-e42b-132d928e6603@bugseng.com>
Date: Fri, 14 Jul 2023 15:44:12 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] xen/ACPI: Remove the acpi_string type
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
 Jan Beulich <JBeulich@suse.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, Julien Grall
 <julien@xen.org>, Roberto Bagnara <roberto.bagnara@bugseng.com>
References: <20230714130411.3055187-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <20230714130411.3055187-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit


On 14/07/23 15:04, Andrew Cooper wrote:
> Typedef-ing a naked pointer like this an anti-pattern which is best avoided.

s/this an/this is an/

> Furthermore, it's bad to pass a string literate in a mutable type.  Delete the

s/literate/literal/

> type entirely, and replace it with a plain 'const char *'.
> 
> This highlights two futher bugs.  acpi_get_table() already had a mismatch in
> types between it's declaration and definition, and we have declarations for
> acpi_get_handle() and acpi_get_table_header() but no definition at all (nor
> any callers).
> 
> This fixes violations of MISRA Rule 7.4:
> 
>    A string literal shall not be assigned to an object unless the object's type
>    is "pointer to const-qualified char".
> 
> and of Rule 8.3:
> 
>    All declarations of an object or function shall use the same names and type
>    qualifiers.
> 
> and of Rule 8.6:
> 
>    An identifier with external linkage shall have exactly one external
>    definition.

The choice of rules looks good to me, but perhaps Roberto has some 
additional insight on this.

> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: George Dunlap <George.Dunlap@eu.citrix.com>
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Wei Liu <wl@xen.org>
> CC: Julien Grall <julien@xen.org>
> CC: Roberto Bagnara <roberto.bagnara@bugseng.com>
> CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
> 
> Roberto/Nicola: Please double check my choice of rules here, and point out any
> others that I may have missed.
> ---
>   xen/drivers/acpi/tables/tbxface.c |  4 ++--
>   xen/include/acpi/acpixf.h         | 13 ++-----------
>   xen/include/acpi/actypes.h        |  1 -
>   3 files changed, 4 insertions(+), 14 deletions(-)
> 
> diff --git a/xen/drivers/acpi/tables/tbxface.c b/xen/drivers/acpi/tables/tbxface.c
> index 21b2e5eae1c7..204d66caea48 100644
> --- a/xen/drivers/acpi/tables/tbxface.c
> +++ b/xen/drivers/acpi/tables/tbxface.c
> @@ -164,7 +164,7 @@ acpi_initialize_tables(struct acpi_table_desc * initial_table_array,
>    *
>    *****************************************************************************/
>   acpi_status __init
> -acpi_get_table(char *signature,
> +acpi_get_table(const char *signature,
>   	       acpi_native_uint instance, struct acpi_table_header **out_table)
>   {
>   	acpi_native_uint i;
> @@ -220,7 +220,7 @@ acpi_get_table(char *signature,
>    *
>    *****************************************************************************/
>   acpi_status __init
> -acpi_get_table_phys(acpi_string signature, acpi_native_uint instance,
> +acpi_get_table_phys(const char *signature, acpi_native_uint instance,
>   		     acpi_physical_address *addr, acpi_native_uint *len)
>   {
>   	acpi_native_uint i, j;
> diff --git a/xen/include/acpi/acpixf.h b/xen/include/acpi/acpixf.h
> index ba74908f0478..8b70154b8f96 100644
> --- a/xen/include/acpi/acpixf.h
> +++ b/xen/include/acpi/acpixf.h
> @@ -69,25 +69,16 @@ acpi_status acpi_load_tables(void);
>   acpi_status acpi_load_table(struct acpi_table_header *table_ptr);
>   
>   acpi_status
> -acpi_get_table_header(acpi_string signature,
> -		      acpi_native_uint instance,
> -		      struct acpi_table_header *out_table_header);
> -
> -acpi_status
> -acpi_get_table(acpi_string signature,
> +acpi_get_table(const char *signature,
>   	       acpi_native_uint instance, struct acpi_table_header **out_table);
>   
>   acpi_status
> -acpi_get_table_phys(acpi_string signature, acpi_native_uint instance,
> +acpi_get_table_phys(const char *signature, acpi_native_uint instance,
>   		     acpi_physical_address *addr, acpi_native_uint *len);
>   /*
>    * Namespace and name interfaces
>    */
>   acpi_status
> -acpi_get_handle(acpi_handle parent,
> -		acpi_string pathname, acpi_handle * ret_handle);
> -
> -acpi_status
>   acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags);
>   
>   acpi_status
> diff --git a/xen/include/acpi/actypes.h b/xen/include/acpi/actypes.h
> index f3e95abc3ab3..7023863d0349 100644
> --- a/xen/include/acpi/actypes.h
> +++ b/xen/include/acpi/actypes.h
> @@ -281,7 +281,6 @@ typedef acpi_native_uint acpi_size;
>    */
>   typedef u32 acpi_status;	/* All ACPI Exceptions */
>   typedef u32 acpi_name;		/* 4-byte ACPI name */
> -typedef char *acpi_string;	/* Null terminated ASCII string */
>   typedef void *acpi_handle;	/* Actually a ptr to a NS Node */
>   
>   struct uint64_struct {

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 14:17:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 14:17:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563661.881015 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKJbI-0003EF-T6; Fri, 14 Jul 2023 14:16:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563661.881015; Fri, 14 Jul 2023 14:16:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKJbI-0003E8-QU; Fri, 14 Jul 2023 14:16:52 +0000
Received: by outflank-mailman (input) for mailman id 563661;
 Fri, 14 Jul 2023 14:16:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=lIDz=DA=citrix.com=prvs=552896509=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qKJbH-0003E2-Pe
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 14:16:52 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0efeed81-2251-11ee-b239-6b7b168915f2;
 Fri, 14 Jul 2023 16:16:48 +0200 (CEST)
Received: from mail-dm6nam12lp2174.outbound.protection.outlook.com (HELO
 NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.174])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 14 Jul 2023 10:16:40 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by MW5PR03MB6983.namprd03.prod.outlook.com (2603:10b6:303:1aa::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.27; Fri, 14 Jul
 2023 14:16:34 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::f3c4:948d:a70a:de2a]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::f3c4:948d:a70a:de2a%5]) with mapi id 15.20.6588.027; Fri, 14 Jul 2023
 14:16:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0efeed81-2251-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689344208;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=z/UviPzAr2Jb6nh5ZiFajggBrwubaESZiky78CfUFL0=;
  b=EBYUle/bQ1kdYwHMdA667sRT+ZHQdvLylo7RZmzZJukj7P/u7K4U58Ek
   HMv+DAiOtLXbhKqTXzLC3ukO1wfIGtOOviJLyWriwZb1MDxem3KkdHDp9
   0Xeq4Q1NViWNIegblGVVVxrrKzc5vLqmc1Kfu/qK0yolHx8dz0o67JLQl
   U=;
X-IronPort-RemoteIP: 104.47.59.174
X-IronPort-MID: 116260139
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:TzGXuqyZ/hL0CNx/pnx6t+e7xyrEfRIJ4+MujC+fZmUNrF6WrkUBz
 jEbXDuPb62INzD8f9snYYW3o0kPuMXQyYA2Tgo9pSAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhPKwT5TcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KWIX8
 PInAzZdUjmKicGWwfW6UfdCl/12eaEHPKtH0p1h5RfwKK98BLzmHeDN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjmVlVMtuFTuGIO9ltiibMNZhEuH4
 EnB+Hz0GEoyP92D0zuVtHmrg4cjmAuiAdxISuXhra8CbFu74DU6Vi1HfHKHj+SYml+6XPRxA
 A8M0397xUQ13AnxJjXnZDW+oXWDuhdaRddMCew86SmH16XP7gCWQGMDS1ZpeNEg8cM7WzEu/
 luIhM/yQyxitqWPTnCQ/avSqim9UQA3B2IfYS4PTSMe/sLu5oo0i3rnVc1/GaS4itn0HzDYw
 D2QqiU6wbIJgqYjyKGT7V3BxTW2qfDhTBMx5wjRdnKo6EV+foHNT5av41XB8fEGJo+WSFCbt
 VAOhseF4eYBS5qKkUSwrP4lGbio47OJNWPaiFs2RZ05rW3ypzikYJxa5yx4KAFxKMEYdDT1Y
 UjV/wRM+JtUO3jsZqhyC26sN/kXIWHbPYyNfpjpghBmPvCdqCfvEPlSWHOt
IronPort-HdrOrdr: A9a23:3eusHq6YCAIktQ+JtgPXwOrXdLJyesId70hD6qkRc20xTiX8ra
 rCoB1173PJYVoqN03I4OrwX5VoIkmsl6Kdg7NwAV7KZmCPhILPFu9fBODZsl7d8kPFl9K14p
 0QF5SWWOeaMbGjt7eB3OBjKadZ/DBbytHPuQ4D9QYXcei1UdAc0+8XYjzra3FLeA==
X-Talos-CUID: 9a23:Yp41sW6wdhUkSbNVQ9ss9xcRFP8OdC3h5X7eAG+5TmdyVpOEcArF
X-Talos-MUID: 9a23:dsYxmwowAEHUmZuf0/8ezxc7HZlYso2HNG4QsIUXv86iGwczIx7I2Q==
X-IronPort-AV: E=Sophos;i="6.01,205,1684814400"; 
   d="scan'208";a="116260139"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=nKt90J/R28tEpJMUHcwXkZt4jPH4u/eXzjPX000lK2/0tKckzEH4+RLQJHn2CHH5fjhFsWfQLXx3XfROpcTb9Rp+aabspJyL6zcj9hk+opY9aNr1ZII1E8J5CLQe3pxMVciyZf4th2zbPGgQnpa1J/D5KUxjV9+LcmOzh18v5LSU+M51RTpyHUPcIqj5Ot7BzyYy7jSuRVAK/aus10yIQVxlGfBuM3x7djP9FUcHfrsQRwo/eALWld+eiEyKwLPyzwH+HF2ExtMWNS/znef/z3Qu0SJf9JdLlkl3SlR9TCWtuym9mnimesCkgzSpmNGxRsrWUTZjylj3vvcLswWf7A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=z/UviPzAr2Jb6nh5ZiFajggBrwubaESZiky78CfUFL0=;
 b=mW/ZUp091rcbBnHd9c5T4CbAldLv1ntZ5xDoTcORHIzvKnEzPB9cPuUL5WvC46wK7T/Jv5jjkzRHW8Bie0Fxp7kUx3ObuYCdfAhWbOQGsoSXigZFDJQO+ku06+kz1KUjOrwzM70xbPT4NwC8dkaOBmzhhY4QZZ3IA75T9UCYJcVcSabUO2pqy5aSTjqrB1srIZZJXHxIhEEvMJDWwcCn2vt7b1BxMLa9AJGX2/BTqam3JTLZMI3Cx3NZmYvVY9IS9HE1XDEDDKGvmRIqFDURBQUBX4SBfOEbz0gUEkkJOAKNY2qyEGT+quNUUHD17CH0onqrLgt0frOqvmvmDP9GIw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=z/UviPzAr2Jb6nh5ZiFajggBrwubaESZiky78CfUFL0=;
 b=OeyHCae1J5PcrRCf39BnJBY6k/PaND57N8tzsrmIKsuDR49bL7AIYpcWgL2XsGG3CwQYxFSq8qTXC6wsECbP6uXdpj5D9w9pIPkOjilE0fYbBSVHXS3vbs67SQ1SACmwGi8m2ZyPRmjpKGlDX7ZGU5lfHEhlq1u5UgZAHYXyohI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <9fbf85e3-f07d-db50-ed62-7e10b33c34a2@citrix.com>
Date: Fri, 14 Jul 2023 15:16:29 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH] xen/ACPI: Remove the acpi_string type
Content-Language: en-GB
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
 Jan Beulich <JBeulich@suse.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, Julien Grall
 <julien@xen.org>, Roberto Bagnara <roberto.bagnara@bugseng.com>
References: <20230714130411.3055187-1-andrew.cooper3@citrix.com>
 <77b82911-a6c1-d23f-e42b-132d928e6603@bugseng.com>
In-Reply-To: <77b82911-a6c1-d23f-e42b-132d928e6603@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0111.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2c3::11) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|MW5PR03MB6983:EE_
X-MS-Office365-Filtering-Correlation-Id: aa2c2890-2b30-4884-9491-08db8474edd3
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	MaoLdiz8O1R450oCkFO5syhe2x+wfIQ7yeJRVlRxa/qoqZLmuK0PdcegEkLFTSfVPUQ0GQJN6tiL0XChQj6HL2+mJEEiXn6xxRrqd5puW5rG51hnK6vkyFqCJj8n9f5RGLwCUBk925O/R7njhuDSMJwHkEHRxOrhEmMJQ6tc+YW/axrCpzHS+irpU5WF4cZM6qy2Vw5slh8MvI2Ft/7GDkuUUxo+fBrRzvpFkbS/Otl9jIC1XxxwSbzA85bwVy6OhNFT09NwyWzAHiFw3FhJ0iBMelCi5YOLkmjfVIuesin/7F+MR+WG5aj6/RM/aeuXIMtHKuX7eKj+gFQsKrQwjSBRnXXU/7qTP+xHLuyB8aa6v8TlqyskZiuDbhkQEgBSLenR3y2xJyyvcuFxksJd6FHQaJHL1jW01Bfsw/cdKIu7h07YptxEVAGDrNeJbZo7tzGpAVSLkyLW9ocIk6kSMzUGeBJVmntnLoYt4KCMqYTbITNdYEJfSZoA9je95DHYx95Jq1rZTP9ez5C71pFG9iwyo711l1Vslr8DPy5PIGz8zkgW6t80kmxAOrxiGMoThCiCCQX6CI6JLYnrsnG4IbTccbkpstNLxHCTS46vcoPK2dD3qwj7EtuChGsYgsNwBg8PsoYi7czOkQJxEDyYJA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(366004)(136003)(346002)(376002)(396003)(451199021)(6512007)(83380400001)(2616005)(66476007)(6486002)(478600001)(66556008)(316002)(4326008)(66946007)(2906002)(54906003)(110136005)(6666004)(6506007)(53546011)(186003)(41300700001)(26005)(5660300002)(8676002)(8936002)(38100700002)(86362001)(31696002)(36756003)(82960400001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NTd6aGtBR0loVzllNFVkZmtBaWZKY2xWZzJmVTJqYmhVa3dhK2t2a3laZTk0?=
 =?utf-8?B?b2hWdjhPeFBtMUlTNDhUVmxaSnB3QVdaSU5VcVpyZGlHc1huY0l6V2xEL2lD?=
 =?utf-8?B?OFh6c25yd1pOeU5nOHBGZ09kVGdneWdLYmVCNkE2UUE3UFU2RExoUWVDRHZJ?=
 =?utf-8?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1Lh17SnZHO+Ne/yzhGyd9dn5JYddRSx4dxtGYjWWbWv5S5iEaH9AQn1cu1chToBMNjaZe8nmwyXkncDUwoHkg4deBhh8RIp6gqQhWXEZ0VYZ9ztpgScPgc1yyq6mckqfskt39N3wb2QNQqLiCbSlLNnpi9XDumO2L6sNgOGAboY1mYdD+w2NQMuAWAoMIYNMydb1LuoA3jOWBAzNVODaiMjoXCO4rppQ
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: aa2c2890-2b30-4884-9491-08db8474edd3
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 14:16:34.6902
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 0zxhG7Rr+8x6Xk/F1SAeU8bYq38gdRIzo9scxMCetGobPN7M68fKlO6jHJKLvo365G9EpBMQy76o/5nPtcnOpFm5+WoDhm0NjcMbcJGvfXY=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR03MB6983

On 14/07/2023 2:44 pm, Nicola Vetrini wrote:
>
> On 14/07/23 15:04, Andrew Cooper wrote:
>> Typedef-ing a naked pointer like this an anti-pattern which is best
>> avoided.
>
> s/this an/this is an/
>
>> Furthermore, it's bad to pass a string literate in a mutable type.Â 
>> Delete the
>
> s/literate/literal/

Fixed, thanks.Â  And the 3rd typo below.

>
>> type entirely, and replace it with a plain 'const char *'.
>>
>> This highlights two futher bugs.Â  acpi_get_table() already had a
>> mismatch in
>> types between it's declaration and definition, and we have
>> declarations for
>> acpi_get_handle() and acpi_get_table_header() but no definition at
>> all (nor
>> any callers).
>>
>> This fixes violations of MISRA Rule 7.4:
>>
>> Â Â  A string literal shall not be assigned to an object unless the
>> object's type
>> Â Â  is "pointer to const-qualified char".
>>
>> and of Rule 8.3:
>>
>> Â Â  All declarations of an object or function shall use the same names
>> and type
>> Â Â  qualifiers.
>>
>> and of Rule 8.6:
>>
>> Â Â  An identifier with external linkage shall have exactly one external
>> Â Â  definition.
>
> The choice of rules looks good to me, but perhaps Roberto has some
> additional insight on this.

Thanks.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 14:20:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 14:20:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563665.881026 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKJeu-0004jt-Cs; Fri, 14 Jul 2023 14:20:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563665.881026; Fri, 14 Jul 2023 14:20:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKJeu-0004jm-A4; Fri, 14 Jul 2023 14:20:36 +0000
Received: by outflank-mailman (input) for mailman id 563665;
 Fri, 14 Jul 2023 14:20:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=3usO=DA=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qKJes-0004jg-AH
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 14:20:34 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on2061a.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::61a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 978fffc6-2251-11ee-b239-6b7b168915f2;
 Fri, 14 Jul 2023 16:20:33 +0200 (CEST)
Received: from DU2PR04CA0325.eurprd04.prod.outlook.com (2603:10a6:10:2b5::30)
 by DB9PR08MB6572.eurprd08.prod.outlook.com (2603:10a6:10:252::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.27; Fri, 14 Jul
 2023 14:20:27 +0000
Received: from DBAEUR03FT051.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:2b5:cafe::23) by DU2PR04CA0325.outlook.office365.com
 (2603:10a6:10:2b5::30) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32 via Frontend
 Transport; Fri, 14 Jul 2023 14:20:27 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT051.mail.protection.outlook.com (100.127.142.148) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.27 via Frontend Transport; Fri, 14 Jul 2023 14:20:27 +0000
Received: ("Tessian outbound f9124736ff4f:v145");
 Fri, 14 Jul 2023 14:20:26 +0000
Received: from acde2031ac13.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 5C4A2378-AC17-4B26-96DB-C2B4303722B3.1; 
 Fri, 14 Jul 2023 14:20:16 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id acde2031ac13.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 14 Jul 2023 14:20:16 +0000
Received: from AM0PR08MB3745.eurprd08.prod.outlook.com (2603:10a6:208:ff::27)
 by AS4PR08MB8241.eurprd08.prod.outlook.com (2603:10a6:20b:51d::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.27; Fri, 14 Jul
 2023 14:20:12 +0000
Received: from AM0PR08MB3745.eurprd08.prod.outlook.com
 ([fe80::d85f:f23f:ef0a:d163]) by AM0PR08MB3745.eurprd08.prod.outlook.com
 ([fe80::d85f:f23f:ef0a:d163%4]) with mapi id 15.20.6588.027; Fri, 14 Jul 2023
 14:20:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 978fffc6-2251-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=n6OT61ln+bj06Za8RV8SyTwZ/59XXWqkNmJcsNMugnY=;
 b=0TSgK6T7xocUd8aFfKMP9TQFQTgMwbMMlfDi9ijVD0vp9t7q/Os29PBhaCHq+YciN/Olwzf1lFlHM7qoapbqLASADyE4fjnZt8rNh3lwPzSPGsFi0DoNXkgt0Zeh/uuFhAaI2M/yLS/TTYYCp7Qno85Pc6pjNRA1mVJl7F3Xx3o=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 79594215c7f9b808
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=g0EOaxoXQUzzXegbEpx7UBGp7BjGnqvPYpdS0TNNbvNxwE+bSIaCr1CRu/omLq3Ag7TVDcfxLluO0SjTKcFWS4CNZCLApdE4s8v0eZbRGjGLwf7P1FB7jaI3cTkFR8IMF5PudnUmE9Ls4JF/qkdoAOozeVBRR/N1B/7mpqdUWksxz/VP0yHI4JVFFrHMSIEaE6k13670rtj13/f4cxeat9QtP6lNF+uMBhiXFhMKoICZ/RkwdjYkWHVewqiERRez9+zg3iIkNJTV/pYq4VyBReX34wPJ79/JjfHv2iEah4cO6qzosn0Dcc2vASldJvnQOnwoWFVa+9NcKz8p6yq4uw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=n6OT61ln+bj06Za8RV8SyTwZ/59XXWqkNmJcsNMugnY=;
 b=CcY0frh2yAjpBa2ED32V7lyr/a1OBF+kUxUwkbzNCY9AOXAd2O95a9Cu/f9Lwdvo8Fv6aeO7cJRvf54QaH6p4fAAcN/lEz47NFNOyKLOBi2Xav+Dt0sPzzJ608mpTXJhQo5jaE0+DN4gCMa881WpOdFunlJ1K6GF1XwIywH8ZONVEw+ImFX6LJFDqyqDpx3Rw/fjoXbJagbVFnqxEKYRy0lxTBLbRxbeMMjEnKbIpUq35r3J301K5PzvPdtmAm/+kEGEPAOMHtv7c44UR0ovvDjxl2AbPta7P0PlrIOuZqT1Y6xBNDh5I5p/yY8Sm0MSVHWSNsLdNEW1pMq6J8Fgrg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=n6OT61ln+bj06Za8RV8SyTwZ/59XXWqkNmJcsNMugnY=;
 b=0TSgK6T7xocUd8aFfKMP9TQFQTgMwbMMlfDi9ijVD0vp9t7q/Os29PBhaCHq+YciN/Olwzf1lFlHM7qoapbqLASADyE4fjnZt8rNh3lwPzSPGsFi0DoNXkgt0Zeh/uuFhAaI2M/yLS/TTYYCp7Qno85Pc6pjNRA1mVJl7F3Xx3o=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, "michal.orzel@amd.com" <michal.orzel@amd.com>,
	"xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
	"ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
	"consulting@bugseng.com" <consulting@bugseng.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, Jan
 Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, Wei Liu
	<wl@xen.org>, Bertrand Marquis <Bertrand.Marquis@arm.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
Thread-Topic: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized
 variable inside a macro
Thread-Index: AQHZtkllBkKUd/6mO0+M9pyVgMwza6+5T/sA
Date: Fri, 14 Jul 2023 14:20:12 +0000
Message-ID: <CB1B8DB0-7708-454D-9E73-171CA894E304@arm.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
In-Reply-To:
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM0PR08MB3745:EE_|AS4PR08MB8241:EE_|DBAEUR03FT051:EE_|DB9PR08MB6572:EE_
X-MS-Office365-Filtering-Correlation-Id: be954ded-0d5e-4c14-1f55-08db84757886
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 K4TGeETsMmP0lmeyAKPJ0zG1qoXWP8seCpV8Z6ZErc0nv4H1l4dXBDLmtNTH6P3vRqCfwBftjFwZEN7W9nhEKyXgXaYzBDlQgBYnglJiOBvJ9LPWn9BmYZEA9+hQWogrRbpTprUtN9rIenhAqVWjzL7f+M1jsfCs8tan1LnI5pIV83TdwsCDUkSXFl/bCJ8cfxVzXzWvXf0eNDDKKQzQYyfMletYQ65ggyuVB/JlFBo1BjOWerIgTx0a0gJ6ZVLn4AlHMIpHQ5HAOqnywAmjq7yXaQNWxPHu934d2vHtVQVcZ7y2cHS9OlR1XmWdxu9+QwdNoRlze8udhqUeDaOk9YKd/rA8+Wn3kaRXNqgPzrCMl6NuEy4/janyf+HMNiJ+dXHQkJwediT1vOlCiX2xbCRuehaUOd1jPiEq+IyGdLtduHw3b8Vcu+vlmURkonbJ7nH0UYxJ2ZxOJLC1VnN88bgtV+23s1Br1ZJ9yBvxARyuciBiCeTU4qq8u0LzR9tKBpOl15P1L8GMgcR3gMV9hI3MkLFmurow4AGhRo8cRNjWdaJkowYll5CnbvHK05dNrSI7SAObxhKp9Qn7K/SBPHE++SlsJUOYNygLiBZzJdFExRej1czAiGuCBNlRSveT0QHcDQRxmBVyLkHsHo6iWw==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB3745.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(136003)(396003)(39860400002)(346002)(451199021)(2906002)(122000001)(2616005)(33656002)(38070700005)(36756003)(86362001)(38100700002)(6916009)(316002)(4326008)(71200400001)(66556008)(66476007)(66446008)(66946007)(76116006)(64756008)(91956017)(41300700001)(53546011)(6506007)(26005)(186003)(54906003)(478600001)(6512007)(6486002)(7416002)(8936002)(8676002)(5660300002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <2DEE87FC4AE6B247B51E949CCD038B17@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB8241
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT051.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	e14bf679-63fb-4271-399b-08db84756fe9
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	nryYK2vha35JrIAEMpQoVAkblKifBotpEHM5eqL4k1xHd8FgsLgDmnqxYHb3/drqhXaK8NjXZdbK+AJzTR+HjHDiZ7Kb2zLZsW0WvReQfHA4c/Rfl02ihSAGDYoyaBWWjXX2Ig4g5gsTjj0gJNnTKKEOWo7Se00TgAEPequjQtWfDdSeILwe0SsA5eka+hAahFg1WVvRITcv768d/0QK411u6HTt39g7E1v7JsTouqu4qBAL94kAwq7fdciIZwsg9ZviUlrkfIJCE8EcaZr6olmv0pBgit846ecy/VZW86flDpJvUYvhglVRBYcKHcrt7Hjyc2KGbVCZxzb0p7jLAYBoCpYly2hH/GShArqgto+3+Ff1TBkno1J0onOp/gzPfbeZ+hIxx86jqB3dq2ByEyKjQGyajOsnpweYD0Md83EPcMLc+lXNIokexijyYHzl0weDf2dfPUheohdqLUn0zFRMhHrAKrT55MLMcFEWNupoKjGxMgOP9vQ83t5XvZpyxMf/ePU58gPzzmnH0yAEz+tatIFi/GMLzUCvxOB4NCWvw2kBBcexG/wYV2LfRw4TDKjzNAGtAX7tPbbWlTzRyP8qqvt/yxOCs6gAT75ccRJ658/kqLxAX5qhO1adegUBRfPzt9sCnPtThOr1h7X5zoxl8TFEK1QKgT11mcenONVIkoK68rDjIHeWL74TIT6L+O0ZhndOqbBYV70CHMbkzyw/hjG9RRu88iFJgL2S8CUzj8/PRLnT1ShXlne/VIAx
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(376002)(346002)(396003)(451199021)(36840700001)(46966006)(40470700004)(36860700001)(316002)(47076005)(4326008)(2616005)(336012)(41300700001)(54906003)(82310400005)(6512007)(6486002)(478600001)(186003)(70586007)(70206006)(107886003)(26005)(53546011)(6506007)(33656002)(36756003)(2906002)(40480700001)(86362001)(40460700003)(8676002)(6862004)(82740400003)(5660300002)(81166007)(356005)(8936002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 14:20:27.1152
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: be954ded-0d5e-4c14-1f55-08db84757886
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT051.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6572

DQoNCj4gT24gMTQgSnVsIDIwMjMsIGF0IDEyOjQ5LCBOaWNvbGEgVmV0cmluaSA8bmljb2xhLnZl
dHJpbmlAYnVnc2VuZy5jb20+IHdyb3RlOg0KPiANCj4gVGhlIG1hY3JvICd0ZXN0b3AnIGV4cGFu
ZHMgdG8gYSBmdW5jdGlvbiB0aGF0IGRlY2xhcmVzIHRoZSBsb2NhbA0KPiB2YXJpYWJsZSAnb2xk
Yml0Jywgd2hpY2ggaXMgd3JpdHRlbiBiZWZvcmUgYmVpbmcgc2V0LCBidXQgaXMgc3VjaCBhDQo+
IHdheSB0aGF0IGlzIG5vdCBhbWVuYWJsZSB0byBhdXRvbWF0aWMgY2hlY2tpbmcuDQo+IA0KPiBU
aGVyZWZvcmUsIGEgZGV2aWF0aW9uIGNvbW1lbnQsIGlzIGludHJvZHVjZWQgdG8gZG9jdW1lbnQg
dGhpcyBzaXR1YXRpb24uDQo+IA0KPiBBIHNpbWlsYXIgcmVhc29uaW5nIGFwcGxpZXMgdG8gbWFj
cm8gJ2d1ZXN0X3Rlc3RvcCcuDQo+IA0KPiBTaWduZWQtb2ZmLWJ5OiBOaWNvbGEgVmV0cmluaSA8
bmljb2xhLnZldHJpb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bWljcy5oIGIveGVuL2FyY2gvYXJt
L2luY2x1ZGUvYXNtL2d1ZXN0X2F0b21pY3MuaA0KPiBpbmRleCBhMTc0NWY4NjEzLi45ZDhmOGVj
M2EzIDEwMDY0NA0KPiAtLS0gYS94ZW4vYXJjaC9hcm0vaW5jbHVkZS9hc20vZ3Vlc3RfYXRvbWlj
cy5oDQo+ICsrKyBiL3hlbi9hcmNoL2FybS9pbmNsdWRlL2FzbS9ndWVzdF9hdG9taWNzLmgNCj4g
QEAgLTY3LDggKzY3LDExIEBAIGd1ZXN0X2JpdG9wKGNoYW5nZV9iaXQpDQo+IC8qIHRlc3RfYml0
IGRvZXMgbm90IHVzZSBsb2FkLXN0b3JlIGF0b21pYyBvcGVyYXRpb25zICovDQo+ICNkZWZpbmUg
Z3Vlc3RfdGVzdF9iaXQoZCwgbnIsIHApICgodm9pZCkoZCksIHRlc3RfYml0KG5yLCBwKSkNCj4g
DQo+ICsvKiBTQUYtMy1zYWZlIE1DM1IxLlI5LjEgKi8NCj4gZ3Vlc3RfdGVzdG9wKHRlc3RfYW5k
X3NldF9iaXQpDQo+ICsvKiBTQUYtMy1zYWZlIE1DM1IxLlI5LjEgKi8NCj4gZ3Vlc3RfdGVzdG9w
KHRlc3RfYW5kX2NsZWFyX2JpdCkNCj4gKy8qIFNBRi0zLXNhZmUgTUMzUjEuUjkuMSAqLw0KPiBn
dWVzdF90ZXN0b3AodGVzdF9hbmRfY2hhbmdlX2JpdCkNCj4gDQo+ICN1bmRlZiBndWVzdF90ZXN0
b3ANCj4gLS0gDQo+IDIuMzQuMQ0KPiANCj4gDQoNCg==


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 14:32:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 14:32:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563670.881036 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKJqM-0006Mx-IU; Fri, 14 Jul 2023 14:32:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563670.881036; Fri, 14 Jul 2023 14:32:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKJqM-0006Mq-Fi; Fri, 14 Jul 2023 14:32:26 +0000
Received: by outflank-mailman (input) for mailman id 563670;
 Fri, 14 Jul 2023 14:32:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=3usO=DA=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qKJqK-0006Mk-AI
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 14:32:24 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on061f.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::61f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3e0430e7-2253-11ee-b239-6b7b168915f2;
 Fri, 14 Jul 2023 16:32:22 +0200 (CEST)
Received: from DUZPR01CA0309.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4ba::9) by DB5PR08MB10115.eurprd08.prod.outlook.com
 (2603:10a6:10:4a2::17) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.27; Fri, 14 Jul
 2023 14:32:16 +0000
Received: from DBAEUR03FT047.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4ba:cafe::88) by DUZPR01CA0309.outlook.office365.com
 (2603:10a6:10:4ba::9) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.27 via Frontend
 Transport; Fri, 14 Jul 2023 14:32:16 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT047.mail.protection.outlook.com (100.127.143.25) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.27 via Frontend Transport; Fri, 14 Jul 2023 14:32:16 +0000
Received: ("Tessian outbound f9124736ff4f:v145");
 Fri, 14 Jul 2023 14:32:16 +0000
Received: from 47b0ccf6ae24.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 CCBAA5E4-ED5F-4ABD-84C3-29D1B329248F.1; 
 Fri, 14 Jul 2023 14:32:05 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 47b0ccf6ae24.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 14 Jul 2023 14:32:05 +0000
Received: from AM0PR08MB3745.eurprd08.prod.outlook.com (2603:10a6:208:ff::27)
 by PAWPR08MB10091.eurprd08.prod.outlook.com (2603:10a6:102:366::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.36; Fri, 14 Jul
 2023 14:32:03 +0000
Received: from AM0PR08MB3745.eurprd08.prod.outlook.com
 ([fe80::d85f:f23f:ef0a:d163]) by AM0PR08MB3745.eurprd08.prod.outlook.com
 ([fe80::d85f:f23f:ef0a:d163%4]) with mapi id 15.20.6588.027; Fri, 14 Jul 2023
 14:32:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3e0430e7-2253-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=JbRcR3buSSujg0UvOOkM3XuwpAEdnAQmh0QexJ7WeVQ=;
 b=O2celH1cU4LZt9soeB9fuDHIvBugYOYTNRNCq2UkLB7MMC050o0RecTFNme1ju0en1Sm3NFWwGRI530RNWdwaQmh5EL21y1MgXlIFISu9X8gx+n3g5cium6bPOWBnQQ1Ml8H/drVRO9TqXZHVHx94DK2olbei8FCR577QwtfqR4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: bddfd79087217051
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=dmUsmpI9U/PO0PrYNr1a5a4eg2rhshvLM7nIYKHPumcdNQ5t2RaMmPk22AJIpmNmR59EIyT4w5CPLmT22rwElT//RfOiH7/FnWPgVbtUNUWmZIrenP+4A+nGeTFwaVHH7otS1m6ZNSiPDWs+h3aEDw++p4834qmxO1zBHJ9auQwufMNKgIJ/kZC4w6pjrIRcgYRS3rsnxJZiobi1IcGEAlJqvHtJ5xyM3FL4aqDTjHOp23TM1dlSul8eGVHaLQxUy8e6wxMOki6U9EaI0IzVy/9c/1R9T9i6nvIc7Y8zsWhdtC08aFB6t0ZsDZ+Fs6Z1tGcnxTVscCD4YkPeQE+Mgw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=JbRcR3buSSujg0UvOOkM3XuwpAEdnAQmh0QexJ7WeVQ=;
 b=oAw68lgAaX622eWANvvubyxvRYXt6O+gkVlUc0gOGFHSrKBd6bJ49m7A3xElQrjPxnEngXI21fLBwXoZlY66LQDcyaZHlkPJW7hYAddOgDhKt1yVrg9ltuWpnsTxVnvjTtlFEzCX2dPYoN4X4WhmwMIDEqleOgwBwMhGiKrVW/7OC9nByN5HCiADqFtJEx3v5zx3VY8isPrMR382Ic7af4efcnO+okknLIo4lf/8RUQjHUOOQBQXQZIPN4mKT5D0S41ROrlUKKdJnnjZMHrG3noiRGp5BHDq1r7ivDMfV+w4C/7s5qqdIRE1fEYJ5IzuR7eOsrOa/Gq0NlLZGx/HNg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=JbRcR3buSSujg0UvOOkM3XuwpAEdnAQmh0QexJ7WeVQ=;
 b=O2celH1cU4LZt9soeB9fuDHIvBugYOYTNRNCq2UkLB7MMC050o0RecTFNme1ju0en1Sm3NFWwGRI530RNWdwaQmh5EL21y1MgXlIFISu9X8gx+n3g5cium6bPOWBnQQ1Ml8H/drVRO9TqXZHVHx94DK2olbei8FCR577QwtfqR4=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, "michal.orzel@amd.com" <michal.orzel@amd.com>,
	"xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
	"ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
	"consulting@bugseng.com" <consulting@bugseng.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, Jan
 Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, Wei Liu
	<wl@xen.org>, Bertrand Marquis <Bertrand.Marquis@arm.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
Thread-Topic: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized
 variable inside a macro
Thread-Index: AQHZtkllBkKUd/6mO0+M9pyVgMwza6+5T/sAgAADTgA=
Date: Fri, 14 Jul 2023 14:32:02 +0000
Message-ID: <3305C79F-38AA-4BA3-A9AA-4A626C7CC478@arm.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
 <CB1B8DB0-7708-454D-9E73-171CA894E304@arm.com>
In-Reply-To: <CB1B8DB0-7708-454D-9E73-171CA894E304@arm.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM0PR08MB3745:EE_|PAWPR08MB10091:EE_|DBAEUR03FT047:EE_|DB5PR08MB10115:EE_
X-MS-Office365-Filtering-Correlation-Id: 0e981d87-e4c3-4481-2396-08db84771f5f
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 SxEme2cr2qsgQDns2AKQ4heHNWQM2pKDFYNI5qCZ4UUuv4eihAxvm/XtfhBzNw3FYQVMf6Y7ycTvWeV2zz42DAQbKQxsPBd2uZeIMpFO75uU3QErWedtE34iz5Qyi5duzFkMxxtxqKrmNpv7ahKfuKPYbETUsYNmmxbbTkIwF2MO8xPPh9zxyaT+sav3qcsu5nghucgk07gcIvm6+qnqQB+BAKlLKhzkRuhe3cZUUnqwIwMc27eeFLyjx8MDv2anzMCQ0OBkYQVZuIEQzccFoPk1sQZ4DxD2KsaxMMc+cVKVsjUzBysVMa0ILF5oDHv0vnQv94VPBWU941qvdCgjON1FjimpppcddjWs0M9FOELta8CLruZp83rU3731O3khJITHVyj6P6uL/bgjSKbtJ2bceX3mSkRACis+VYIi2WOJ9SqXU3zFUFeB7SHMLTYlckQsjWFb0c8NyVW8151dkEwWD7PYSid5x8m5NMK7+QDx7Mljb/n6lrljOQ1CMJwLpHm8SrNg0Wb/lXMhJ7aGtziPMxgblQojN95kFHXiJDYz17kiwuo32Ip+cH6wpMO+3HCKxc5ScgftSWcEAP8FHhD5dbrHO1PVFOOkaB/RNzEgwOP+PnB11A8TE5Yb1k6LaS5SuxRAgTKcaNYa7YmKzw==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB3745.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(376002)(39860400002)(136003)(346002)(396003)(451199021)(8936002)(8676002)(33656002)(36756003)(2616005)(38100700002)(38070700005)(122000001)(2906002)(6506007)(86362001)(53546011)(7416002)(26005)(5660300002)(186003)(4326008)(6916009)(6486002)(54906003)(66446008)(66946007)(71200400001)(91956017)(66556008)(6512007)(66476007)(64756008)(41300700001)(76116006)(478600001)(316002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <A1B760AA930C144C98FFE7BB5FC3E554@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB10091
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT047.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	54c2a27b-f2e5-416e-9f8b-08db84771748
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	lVoOQk9YLIo7YGnVhAttZiyLh4oc39X+oJK38wR3Av9x81VnAyu9B+pzzUGLdP9EbYMpiRXEnZ20/wBsfOv4ReAtySGxLbhCnmBdhzz25wAH+la3dTcnYYOFCsEZcUUXDU6cq5/e3GT5/fXeaSQ8R7LeRx4UQZXxW024lB8gChF0gyeQMk5+2rA5H7zz03Q23mDI4J3c6KQBRKfQi1rSDFHdAyr96NVzFRpdqmnxC02jLn+FKEpIcSdwrVIctpfz92Y6nGKEIAn1CoCkFSvkjLMauWSQQtC/KuZ+MrC6jtfFlKNDSF1C+eX4Iw1n2akj02Hj5VXFgU9mr0r8P0aKj17guL1RGksOKTW5j5wDCOu1jAb/Dq/DQRlyvmxRG1gMMFmefvA6LhFjZXZMNbY4SeweUsCtp4lYFgu+zACRC6iX8opCVdfg2EeEgJwf9v/pxY6lML6nxfNkXCAKuPzJ/DRubGTpKeQrSbh84pudVQARW2b4IJbmWFi43u9zAz2tccYMAa6Z1deGHsj0ovreO9cPg/QUK2meWZPHelaZzMi4TwA3IKgQiIlHU66MnvvBS93B6VhDcg8xiOEaQXpdVHpPsogb+56RQU4KOjjkaP4fHQUAoWDvmlyKHZLIaXFwx5WkGwaZWDR6ReP97rTzG6LXX1SjmySxTn6pijpz7k0ccLZoktvt7gnFn8skQZ+ZZ97sI7DfPBrh2HsZUjuh9WyMN1ObIo05/DRoRp4Loq4v52519dPjWsSpgmYEeXFK
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(39860400002)(376002)(346002)(451199021)(46966006)(36840700001)(40470700004)(316002)(41300700001)(5660300002)(82740400003)(356005)(81166007)(6862004)(8676002)(8936002)(40460700003)(86362001)(82310400005)(33656002)(36756003)(40480700001)(2906002)(6486002)(107886003)(6512007)(478600001)(47076005)(2616005)(186003)(336012)(36860700001)(26005)(6506007)(53546011)(4326008)(70586007)(70206006)(54906003);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 14:32:16.5204
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 0e981d87-e4c3-4481-2396-08db84771f5f
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT047.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHead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RpZmYgLS1naXQgYS94ZW4vYXJjaC9hcm0vaW5j
bHVkZS9hc20vZ3Vlc3RfYXRvbWljcy5oIGIveGVuL2FyY2gvYXJtL2luY2x1ZGUvYXNtL2d1ZXN0
X2F0b21pY3MuaA0KPj4gaW5kZXggYTE3NDVmODYxMy4uOWQ4ZjhlYzNhMyAxMDA2NDQNCj4+IC0t
LSBhL3hlbi9hcmNoL2FybS9pbmNsdWRlL2FzbS9ndWVzdF9hdG9taWNzLmgNCj4+ICsrKyBiL3hl
bi9hcmNoL2FybS9pbmNsdWRlL2FzbS9ndWVzdF9hdG9taWNzLmgNCj4+IEBAIC02Nyw4ICs2Nywx
MSBAQCBndWVzdF9iaXRvcChjaGFuZ2VfYml0KQ0KPj4gLyogdGVzdF9iaXQgZG9lcyBub3QgdXNl
IGxvYWQtc3RvcmUgYXRvbWljIG9wZXJhdGlvbnMgKi8NCj4+ICNkZWZpbmUgZ3Vlc3RfdGVzdF9i
aXQoZCwgbnIsIHApICgodm9pZCkoZCksIHRlc3RfYml0KG5yLCBwKSkNCj4+IA0KPj4gKy8qIFNB
Ri0zLXNhZmUgTUMzUjEuUjkuMSAqLw0KPj4gZ3Vlc3RfdGVzdG9wKHRlc3RfYW5kX3NldF9iaXQp
DQo+PiArLyogU0FGLTMtc2FmZSBNQzNSMS5SOS4xICovDQo+PiBndWVzdF90ZXN0b3AodGVzdF9h
bmRfY2xlYXJfYml0KQ0KPj4gKy8qIFNBRi0zLXNhZmUgTUMzUjEuUjkuMSAqLw0KPj4gZ3Vlc3Rf
dGVzdG9wKHRlc3RfYW5kX2NoYW5nZV9iaXQpDQo+PiANCj4+ICN1bmRlZiBndWVzdF90ZXN0b3AN
Cj4+IC0tIA0KPj4gMi4zNC4xDQo+PiANCj4+IA0KPiANCg0K


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 14:36:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 14:36:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563673.881046 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKJuW-0006y7-4Z; Fri, 14 Jul 2023 14:36:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563673.881046; Fri, 14 Jul 2023 14:36:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKJuW-0006y0-1X; Fri, 14 Jul 2023 14:36:44 +0000
Received: by outflank-mailman (input) for mailman id 563673;
 Fri, 14 Jul 2023 14:36:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=3usO=DA=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qKJuV-0006xu-LH
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 14:36:43 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20613.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::613])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d95a22a1-2253-11ee-b239-6b7b168915f2;
 Fri, 14 Jul 2023 16:36:42 +0200 (CEST)
Received: from AS4P189CA0029.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5db::20)
 by AS2PR08MB9128.eurprd08.prod.outlook.com (2603:10a6:20b:5fc::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.27; Fri, 14 Jul
 2023 14:36:24 +0000
Received: from AM7EUR03FT034.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:5db:cafe::8a) by AS4P189CA0029.outlook.office365.com
 (2603:10a6:20b:5db::20) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.26 via Frontend
 Transport; Fri, 14 Jul 2023 14:36:24 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT034.mail.protection.outlook.com (100.127.140.87) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.28 via Frontend Transport; Fri, 14 Jul 2023 14:36:24 +0000
Received: ("Tessian outbound ba2f3d95109c:v145");
 Fri, 14 Jul 2023 14:36:24 +0000
Received: from 890d80c215f0.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 ABE9EA54-481F-4F5E-8792-94DF6A685FA1.1; 
 Fri, 14 Jul 2023 14:36:17 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 890d80c215f0.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 14 Jul 2023 14:36:17 +0000
Received: from AM0PR08MB3745.eurprd08.prod.outlook.com (2603:10a6:208:ff::27)
 by AS2PR08MB10323.eurprd08.prod.outlook.com (2603:10a6:20b:5fe::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.27; Fri, 14 Jul
 2023 14:36:14 +0000
Received: from AM0PR08MB3745.eurprd08.prod.outlook.com
 ([fe80::d85f:f23f:ef0a:d163]) by AM0PR08MB3745.eurprd08.prod.outlook.com
 ([fe80::d85f:f23f:ef0a:d163%4]) with mapi id 15.20.6588.027; Fri, 14 Jul 2023
 14:36:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d95a22a1-2253-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=qqcCLFyKUZ1tFDdy2DZjnC0Xjc5EIowBNRtAD63MeIc=;
 b=mL/NT6nR9A8rzAwKNurtXnYXBpIMXgQSnL03zmd0rInOAaAB859K4jhhNPJCud8rf+whetvVT4ANmHGCfvKZ2yg/oTANiE0FHK8CYVcOFNwcUC6Z0rX0TDWKzOp0hBDVjWHPSEB4zuop7HEmR6Ayc46jr2pFdLrYvR2U2jSYoC8=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 28dc41d501b92f27
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Ktj0snTz4dQLpFai192CPUfK6U1wlI5fXEFcgXsTkmk9nAGHe25LimN+FBMMQz2nLWGkWbL+cb9vdLGr66nQQrPsEpVI3U3DQ9LZNXMpotZGam1bCK+lbytm/XbCzUOEW1oNel9KCPW7jCX6iVE1xjY28Cb9W4FINd8M9ea+U6WfutfgqtViXEAyHxEeZlKBKi0NwheIWr3cpC/n4VlsrKKflJADt3AT3ZKXgb2zSOQY/Z/cu8BBei9QmzIt4sdfW8s1T8axa26ac3KjFJNByepAUZRMTB3/kJ5MFvqfKvnsW1Ce8DSOuwM+ElAYW8UfwRXdELpTmzA0ed8maJa2EA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=qqcCLFyKUZ1tFDdy2DZjnC0Xjc5EIowBNRtAD63MeIc=;
 b=Z1ZN6ipyWlTANX8C5Xw0p0Zzfw0fKXGz25MRxbm0wXdUvccDtrozSLfLif2HNINBSCKbdQN9Ou2xST9HJoTqKhVqIDOikDEKzqGrveR1NbOSGBa40a9n1Cx0HaL5Q36+lSlSnKkJiz2Gn0cPcc/eYAisFoOwZyn9+RaUBfMrCt/B6ewIGpZM8LFLTPaT8xa8q4j1LLZf/MDyjaWZsmyxqhFBTVJ2jk3ulA9MnrmaNA2voSBywB18LUI410W3H4+xitibQjf3gFnk28jwNPhQumZ4a/DHxOy9dM96SkNeJ5Dq6syypmFbk/edXFZzi52vybTn5bCUEkN8dA29jmwcBA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=qqcCLFyKUZ1tFDdy2DZjnC0Xjc5EIowBNRtAD63MeIc=;
 b=mL/NT6nR9A8rzAwKNurtXnYXBpIMXgQSnL03zmd0rInOAaAB859K4jhhNPJCud8rf+whetvVT4ANmHGCfvKZ2yg/oTANiE0FHK8CYVcOFNwcUC6Z0rX0TDWKzOp0hBDVjWHPSEB4zuop7HEmR6Ayc46jr2pFdLrYvR2U2jSYoC8=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, "michal.orzel@amd.com" <michal.orzel@amd.com>,
	"xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
	"ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
	"consulting@bugseng.com" <consulting@bugseng.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, Jan
 Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, Wei Liu
	<wl@xen.org>, Bertrand Marquis <Bertrand.Marquis@arm.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
Thread-Topic: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized
 variable inside a macro
Thread-Index: AQHZtkllBkKUd/6mO0+M9pyVgMwza6+5T/sAgAADTgCAAAEtAA==
Date: Fri, 14 Jul 2023 14:36:14 +0000
Message-ID: <86E1EAC8-ED9A-4AF0-BD0A-70C6685E7628@arm.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
 <CB1B8DB0-7708-454D-9E73-171CA894E304@arm.com>
 <3305C79F-38AA-4BA3-A9AA-4A626C7CC478@arm.com>
In-Reply-To: <3305C79F-38AA-4BA3-A9AA-4A626C7CC478@arm.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM0PR08MB3745:EE_|AS2PR08MB10323:EE_|AM7EUR03FT034:EE_|AS2PR08MB9128:EE_
X-MS-Office365-Filtering-Correlation-Id: 1d0adbcc-0dc8-4a8f-838c-08db8477b310
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 ArEPNiG8kJd5u4JP/l8Oz0OOFC9gzLU/8NzZcHjncdKbyNm5VERFjcTRztRhDrp3lcSegEn9Z6OZ7hTJXTDcmMXc/ybJPabIPklDTD1rvAwtAXj0cTKsnE0BjvBkW262JHAduhn8ZQTligEZ2Z5oL1Tzr+NmqffLl+j2BQlUxlIE8zzCkbXZvRQatxUu1fJ4ISZrqZQkAExbAvysTZ991GqmFQjrb1nl7YwlPEAieMyIUrjF7CNQjkRp7sTe+jCOUJWmnSLThW6qEXCMsh/4GrKzY0kCVd/bdl4UAHAJ4GPRX2CRiyMq1f1l6jThojATEpTulZMGhuFtJekNc7N7XJ/p4WvA4lhZMCXlDKoFFmfTX64z8sgtvZMW2aCs3Qg7UqqCB++V7K+gzQMxdOuZinC3aKvIg+yk99ptyBlvl5RvTeCH7l5LB+WyQaWyGqj5y2aNAWH49stvvkwCwZ6GDJdP9bH/PSpx54KDfY0v7DZlxSRhuUp+8sTGpVbJn8Lm7HMVd6HWQ8a0jjcEg4xLeCncEiX3RjLBZWOCXG3yLeXdBezjwJG0nsiyxakDwlxuava1N/gEUeI6jsSq6S3QwQKHGYJBY2UzWd72wxIGGp9r/el4/JT3vIFkQUskcNvyfRl6XKo70X78u1E5rbogMw==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB3745.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(366004)(376002)(396003)(136003)(346002)(451199021)(478600001)(6486002)(71200400001)(54906003)(91956017)(2616005)(86362001)(36756003)(38070700005)(33656002)(2906002)(26005)(6506007)(186003)(76116006)(6512007)(38100700002)(122000001)(66946007)(66476007)(4326008)(5660300002)(316002)(41300700001)(64756008)(66556008)(6916009)(8936002)(8676002)(7416002)(66446008)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <22A635571A8B5342B521A9AE0B4D90FE@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10323
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT034.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	f2d8c1ab-07ad-416f-ea2a-08db8477ad1f
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Mmp2By6vo/Vw+NIW0jw9d+WAqPw9TuNyYmhdUzV66BgJS+LVva4L4o0LfygERR0k40aJg2cDtW8nN+QOMfSKtT65GUVZTEbtxwlvBoSKgjfv8ht78D7y9GAC0uM8r5rn3DwyF4xFjd9b/6/ySbSkDRWl85n88MNi9dY/jF8eoVOFVmV9BYPnDisMOybGCwv6stw8jaS1ske5llkzsBk78ZYsY+DphRzM8xYNAwlBMGifpLNGqn7/x5hQYikvoxI79+RqQK1AeZ94AGYRqdbyE2JGvmlalYK8ik2imOBdenhLCurx0Ot/72xOcjSGDEF6u0knex3fwTb+tRB6/eQw7mkLtawopR4paHvaUOL8PWGaUHcOyb7XbvQxeFrssdO2KJEvkbdrZy30YPE6Lfuj0CpLomhoiffvbF/HKDXUslafc3WA8lS/lhnBeZHYv9c1OtyYnzg6x7w2Y8jqKuv68mHCJEZ1ssLhF6NJjA5XGvy1siCv1VjqKD4agh8ViGOQWADBRkK6LMqPUKFpFqRLPz2eIa8RErGFXR0Qpa83+8uT/zz0+tYj8Ev2I63Vho/t6+WhU339YU29xsr+J1V/QSb6Go3vF1M89HmhJTW49KXe/PzcxCM7WHpt3FHAYNeRr/0uKp4upa+b0unqr+WbYRUuv4D1YOyLSAq0o4DCfS5rU59Pakzdin/58esCycEsBUG3WFviw8jckYkBLLMIKip6wb6tYOBFQEAr9lXbM/meWW1fv/5SdadFtpTCRFn5
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(39860400002)(136003)(376002)(451199021)(36840700001)(40470700004)(46966006)(36860700001)(86362001)(2906002)(33656002)(336012)(6862004)(8676002)(8936002)(2616005)(316002)(41300700001)(82310400005)(47076005)(5660300002)(81166007)(54906003)(36756003)(70206006)(4326008)(70586007)(186003)(6506007)(26005)(6512007)(356005)(107886003)(82740400003)(478600001)(40460700003)(40480700001)(6486002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 14:36:24.2767
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 1d0adbcc-0dc8-4a8f-838c-08db8477b310
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT034.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9128

DQo+Pj4gICAgICAgICAgICJpZCI6ICJTQUYtMi1zYWZlIiwNCj4+PiArICAgICAgICAgICAgImFu
YWx5c2VyIjogew0KPj4+ICsgICAgICAgICAgICAgICAgImVjbGFpciI6ICJNQzNSMS5SOS4xIg0K
Pj4+ICsgICAgICAgICAgICB9LA0KPj4+ICsgICAgICAgICAgICAibmFtZSI6ICJSdWxlIDkuMTog
aW5pdGlhbGl6ZXIgbm90IG5lZWRlZCIsDQo+Pj4gKyAgICAgICAgICAgICJ0ZXh0IjogIlRoZSBm
b2xsb3dpbmcgbG9jYWwgdmFyaWFibGVzIGFyZSBwb3NzaWJseSBzdWJqZWN0IHRvIGJlaW5nIHJl
YWQgYmVmb3JlIGJlaW5nIHdyaXR0ZW4sIGJ1dCBjb2RlIGluc3BlY3Rpb24gZW5zdXJlZCB0aGF0
IHRoZSBjb250cm9sIGZsb3cgaW4gdGhlIGNvbnN0cnVjdCB3aGVyZSB0aGV5IGFwcGVhciBlbnN1
cmVzIHRoYXQgbm8gc3VjaCBldmVudCBtYXkgaGFwcGVuLiINCj4+PiArICAgICAgICB9LA0KPj4+
ICsgICAgICAgIHsNCj4+PiArICAgICAgICAgICAgImlkIjogIlNBRi0zLXNhZmUiLA0KPj4+ICsg
ICAgICAgICAgICAiYW5hbHlzZXIiOiB7DQo+Pj4gKyAgICAgICAgICAgICAgICAiZWNsYWlyIjog
Ik1DM1IxLlI5LjEiDQo+Pj4gKyAgICAgICAgICAgIH0sDQo+Pj4gKyAgICAgICAgICAgICJuYW1l
IjogIlJ1bGUgOS4xOiBpbml0aWFsaXplciBub3QgbmVlZGVkIiwNCj4+PiArICAgICAgICAgICAg
InRleHQiOiA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ces@lists.xenproject.org Fri Jul 14 14:41:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 14:41:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563678.881056 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKJyq-00005p-PM; Fri, 14 Jul 2023 14:41:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563678.881056; Fri, 14 Jul 2023 14:41:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKJyq-00005i-Me; Fri, 14 Jul 2023 14:41:12 +0000
Received: by outflank-mailman (input) for mailman id 563678;
 Fri, 14 Jul 2023 14:41:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=dZ6j=DA=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qKJyp-00005b-Iy
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 14:41:11 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2084.outbound.protection.outlook.com [40.107.13.84])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 791dd57c-2254-11ee-b239-6b7b168915f2;
 Fri, 14 Jul 2023 16:41:10 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM9PR04MB8308.eurprd04.prod.outlook.com (2603:10a6:20b:3e3::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.27; Fri, 14 Jul
 2023 14:40:41 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Fri, 14 Jul 2023
 14:40:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 791dd57c-2254-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=lH/6N6NI1YGBsBsHZgbln0EYwciZkBRewVvGWlDKiyf98wSTk/Y+6LKbG1pNLq7gZD3IsVoN9jmoF+IP29Nq+eWeIUk8AUPMjlmLqOaha+DhK09pCmiv3xr1W53aq2Ik7Y8XG4FONw5VPiI77IxEeEt/pRTsGhNG7KpalTQotbsQYNV/LWcBNA7IKzCtaNXIiIopkgAYoS/WZvJk3EzU+N/IgZbl75m3fU5NJHGHFJfjkrsarfguTcvAQll+NLFnszvg+XYJxbOlPIi+CsmNE+uQyeUhpMtWN5kfTD63b/fzh+GKlX3b+kWZKwMOXf2WSmYpHooP63AaIJEqHocXmg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=s9xcCZ5bULcjU42W+HOvGot+c19JR3wgzQ1lNA+t24M=;
 b=IC3y1NIuKY4xOcatgLjjW/BAhylsByywPVUpqpXoQG+urC+NEGBEs2GXLkwZciE6/jd1wrrEpqtvgHWagA/FVw88qGt2ttN210Ma2VCY5sjpzjbXo7O2PhbKkwYzYqVigqGoT3JioG+1u8xnTEIxx8fQruJNWRQ8Zeg31qxseIPq9OMp0zRexCnJWWZHxM6nq7K3wQaUf5fbB8zlmRd211J4p72dZAOhFM3BMkS8SkI3WG4Jx+TFwADB0OKy1rD4Enp+V4+vwj/PG0v1ykOCKusz8eeJJS82Mq8ScugjZvgJSmp370HZu7nEdiPzVlUeyXGQ7/I8s7SqBgu4MFThQQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=s9xcCZ5bULcjU42W+HOvGot+c19JR3wgzQ1lNA+t24M=;
 b=RdikRxh6r9CUMMXStt9Ht98pZTyNzBmbujVPWpqj6sZlOk3b9otuljjqtLevKtL4GrOTXX7WRTuXTHDn79r3xoYv57haCsoogpyJG+SaAtHeIaKUKf6N9y6a6rt4EAM0WSXAGl1II8QjD9jdVWvIS3zP0aODkhF74J+qe+i0qCwr5dV/e26rOfuzLDARWpCmTXW78+yuwSGwt9gzGg4Qc1SYrwaP9Igt26xl7o2JsvNGB31Cfqr/Ran4OYdPvnrZ9K/XvMfHhda6jorvY+vawb8hGiINMDmYIakv+au4HTOxfEH9Gg5G0L5rB7QU6Dh5IkHBgfLy1xS1gpgHtcnW0A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <792966c8-835d-d388-463e-e341f7975419@suse.com>
Date: Fri, 14 Jul 2023 16:40:39 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] xen/ACPI: Remove the acpi_string type
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Julien Grall <julien@xen.org>, Roberto Bagnara
 <roberto.bagnara@bugseng.com>, Nicola Vetrini <nicola.vetrini@bugseng.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230714130411.3055187-1-andrew.cooper3@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230714130411.3055187-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0212.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ac::11) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM9PR04MB8308:EE_
X-MS-Office365-Filtering-Correlation-Id: 00cb3cf1-ef75-4999-ed71-08db84784c2c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	4sunRXq2DEX08bXKj6k1eMXGQb3gv7yxSl2jAV6L2IKdWvt8QsLaM3lajfPb3xu9cMbo+SLb6wzHxYE5IMDXdxigkCfBWKXSbHuJCSbiGuXJmPn+BbQtAfrBvc1NfdmuPWTykfHIc5RA0PY8c/Vr3E0ITV6ZQkAK3HRrsXMLy+bK0et5EvWfahVKXJnw8YHB6CWWrtbwts2UOlkyUU0Su9EeTeI+D5bsAvH1H8VCE5qn5aWDJr3hB4UcRpRebnYrYEoq3Ed1Juub89EAS9UCx8RFqfQOfyaDsbpyT8l8THIBuNHGjooQyqkLiYkJE/SvlPCSGx8RkmFTjRWteWEwu1OCg6ewd3ILQp6Vp3AUajq3qpwZYzLBh2OyRngwhWfcCRu/ldcrnNeF5XvHCDTozKX4tsVEBsvjrOPPjBCc54QgfkWwof4mdQwtWEshVSuwCmUoB8/WZzr5kDFit02VUF5lBPNPUwoGEd011ggyCnPVGvQMhCj1ynzC7Mdd4GbnkT0VNCImZlIgHamvCIlLgdTEFwftI4sS8tfn8Qxfb+PsST+QSclL1yjTbcqwhVcJtupa0tEae1d83pgvolAjnnG4nE+4VP7HEXwOqA9ZWhzZYhgKFTCvrH0H6VTqjoG6B3jphOgkbtIKPWehi/cHIg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(376002)(396003)(39860400002)(366004)(346002)(451199021)(83380400001)(2616005)(478600001)(31686004)(186003)(53546011)(6506007)(26005)(6512007)(6916009)(4326008)(66946007)(66556008)(316002)(86362001)(2906002)(8936002)(66476007)(6486002)(41300700001)(36756003)(38100700002)(54906003)(31696002)(5660300002)(8676002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YkFsemhjWnJaTTBWMFlTbHZBM3VzZEdnR1JaUWY1WnBzMlFCRksvdmQzVTJn?=
 =?utf-8?B?alVVeVpkalNpaGMzRUR1QWxUN2hQbkkxWkJtcWc0TjhSUFVjbk1CblB2bEt0?=
 =?utf-8?B?RWtOSFJaODFJUWc1L0RCbGJvT1JGbndjeTVQdkwzTWZ1K3MvZEZVVkx0bjgz?=
 =?utf-8?B?cHA1RXMvclA0VjU3cmZjYmUrLzl2OXJ1WWJBblR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hkSEc5MmZsR08xZEhBZVdpbThXekdsU0pNTkNN?=
 =?utf-8?B?bDJRSEt4RWIyT0lwb1o0RmRmRWJZNEJkUFR2bXFNLytWZCs5Q2pLc0VYaExY?=
 =?utf-8?B?UU9xSE5OUXBwWEE4a2tNZFl3Ti9RV3VNNVJyc0tNdHRmZVhVNlF0ZG1QRnVE?=
 =?utf-8?Q?hcHUrhr9w9PB7pGfazz0GI6Xo?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 00cb3cf1-ef75-4999-ed71-08db84784c2c
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 14:40:41.2988
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Q7hymnpSbj8xFgX7qWoZt2KnqIYsGzsdrSNEt7B/RIxKiOCMvghYTESaUOfARM57W8lP9KXv3mW5Qhx98kuEOw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8308

On 14.07.2023 15:04, Andrew Cooper wrote:
> Typedef-ing a naked pointer like this an anti-pattern which is best avoided.
> Furthermore, it's bad to pass a string literate in a mutable type.  Delete the
> type entirely, and replace it with a plain 'const char *'.
> 
> This highlights two futher bugs.  acpi_get_table() already had a mismatch in
> types between it's declaration and definition, and we have declarations for
> acpi_get_handle() and acpi_get_table_header() but no definition at all (nor
> any callers).
> 
> This fixes violations of MISRA Rule 7.4:
> 
>   A string literal shall not be assigned to an object unless the object's type
>   is "pointer to const-qualified char".
> 
> and of Rule 8.3:
> 
>   All declarations of an object or function shall use the same names and type
>   qualifiers.
> 
> and of Rule 8.6:
> 
>   An identifier with external linkage shall have exactly one external
>   definition.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Fri Jul 14 14:42:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 14:42:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563681.881065 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKJzd-0000c6-1s; Fri, 14 Jul 2023 14:42:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563681.881065; Fri, 14 Jul 2023 14:42:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKJzc-0000bz-VH; Fri, 14 Jul 2023 14:42:00 +0000
Received: by outflank-mailman (input) for mailman id 563681;
 Fri, 14 Jul 2023 14:41:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=dZ6j=DA=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qKJzb-0000bp-Qd
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 14:41:59 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2055.outbound.protection.outlook.com [40.107.13.55])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9638d889-2254-11ee-b239-6b7b168915f2;
 Fri, 14 Jul 2023 16:41:59 +0200 (CEST)
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21)
 by AM9PR04MB8308.eurprd04.prod.outlook.com (2603:10a6:20b:3e3::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.27; Fri, 14 Jul
 2023 14:41:30 +0000
Received: from AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com
 ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Fri, 14 Jul 2023
 14:41:30 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9638d889-2254-11ee-b239-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Y4znHQR2GriI6rKBJyII27FzlZyRDPP/hx8+QQT+yKzYMtFq8tHV22AhjFnByBtJp7qI0Gcr2CzFtpRezJO/gfqeGdkGAw4A6laUuUuUbcuXRYyktyyEovjVZdCnd3t4nZWQs8fsB3S6dBjxnlZ7fp6VrO3s5I9r7gCnOqn792MchwzjYbkICUuv6qzPuI9w9XNgE7WOuJw1lh1EOJAWpa3iuL9dx1OsEr2GMINlFWDrY1oBqhQn4JpRVvQE7SH9jEGlwp5r0FdZCkSzHnNogW7QMAGk/95EPxPn4LVPaGCweo3JdHr8Rxfw61bL61vZymHiyRQ7dSVuUhv8qqbKSw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+ycJjRYKhTOmgVstaVaXlN67Fw8yms79dvIGN7wOypY=;
 b=VdMs46luLzyOo9gFrBdtxdWu1nNrRK5yWJet64L7dmALSi/8nQ/2UDs4NwsPiqjjOKbNnIxm+Rmo332++sjKtZZZL8KUyLj41SaQK+BCBzTw+0UqbmT0DTEcSnA7/bL0KbHIuYMc28AZgWKOdtkcddWqxBKqwWPO1qWB1j8b8E5xLH/FJLQZAmUKvxz3XwUCkFTPsjO1/UBpn6MZGTS9fA+oUOW55aWFIppN/DMC+qR3Rm59TvQZc7/hcLNwtwnLEVQBc2LNPTx9nPx9Zw2BOZ3ufvbVjQRN1aEGCnpje3MYrn27yBuzzMmdHeQKoB/IIu8dJXoW2fqqRxNrkKyQfw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+ycJjRYKhTOmgVstaVaXlN67Fw8yms79dvIGN7wOypY=;
 b=MouEmcf91+ym4P4cIEfdW6sds7fYUTeHVQ36RrJTa0C146BOQqpRLKsTQCpfvg7A7RRi4c86vUlPqt90D2WBU9IwhYPVSWIo9X3iwQgd7aAbam61nhLY5TwoGnMCayhMj4B+HsvwTlhw3RoHVXOtDtXDSpIymciffwgqpLOcSNgA3UyThIYy3aaujMzG/q3rgOkze5QlG2Og6FueonaL8/tVmFlfYbqGxXVvFbOjK0PcLEpjet/aVnUo2dU+28au+115bEPoweFztuNt+lu9wXpgQUTJt3/zneXuX319HlsBtTbi9YJ8lajlSlfWB2RNueyd5ID28R3ELk2mh0FE+Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <9892f09c-90aa-82ce-2b05-1bf4dd9ca9f4@suse.com>
Date: Fri, 14 Jul 2023 16:41:28 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] xen/ACPI: Use const char * for string literals
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Julien Grall <julien@xen.org>, Roberto Bagnara
 <roberto.bagnara@bugseng.com>, Nicola Vetrini <nicola.vetrini@bugseng.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230714131026.3082591-1-andrew.cooper3@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230714131026.3082591-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0218.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ac::14) To AS8PR04MB8788.eurprd04.prod.outlook.com
 (2603:10a6:20b:42f::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM9PR04MB8308:EE_
X-MS-Office365-Filtering-Correlation-Id: c9c64f18-1c1c-4c6f-bb9f-08db84786981
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	WXCH3P7Fh3Bw7bds+RMiyPN9wFAcrZEFV0adNQRavFfD/A5qfujZQQ/UglmSLNEzgDmuTSDkm61Zd2t/0b5XneGa3vxCwQsSBmQlBuzmAjRgep9J/rkF7DS7hXZHgXDKhD/2AqxEYeC5w35iSzHgziJVuulTSoiMSlxvEY2aQJ1ZhviMp5D0q+aCG89ur8Bj/+aKcVVu0iYIMcXS/eXtyOg1ruVAnLxxj4cVDYPQ1Dp/4Z86qKusNkJOD15pi3Xu9iLpxS95voXAhSijH1yMTg7xJCsIgfs94i1VaPkPxzIGEMTmkvP8GguEiNwCxFDUs3TyAs1Bln8TYwky68YAspROkku61fq5r4B3ixsMS40Rhi7fp7PP7YN9u3VDSO52pRcDUfl2p7hq0OcWobQtcEing1TdtXSXHW4ZTaLWmCajRLUhwy0He1bYjitrxCnZbBbAHAoXKc8/4YOCuTzb3rMtFEjo5Y1ezOIcpWAwtCPzPwQwtlblJElOvm3i0XcSitBVittPG0DbXz3B4rIBW4ZHBlmg/Zb7luHvoborPN9rOsPQJfB3+fUT1R7w9ZwQtMR6SssUw73CTJHMhQYMkdeoRvhVdrvgw9Kx+9ufhsm+Dv4lu39WNacSNb+0OFgQ6HihqSTuRpnvMvye5kKUpw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8788.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(376002)(396003)(39860400002)(366004)(346002)(451199021)(2616005)(478600001)(31686004)(186003)(53546011)(6506007)(26005)(6512007)(6916009)(4326008)(66946007)(66556008)(316002)(86362001)(2906002)(8936002)(66476007)(4744005)(6486002)(41300700001)(36756003)(38100700002)(54906003)(31696002)(5660300002)(8676002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ekRETXZUc0V1RGVYYUJrUUIrTU9sVXRVbTVMTHNzczR5dmVvMDd1VEJlZWlN?=
 =?utf-8?B?WHJhNGc5cUJZMXBXWDhCNEdDeWc2S1IxdnRtQ0w4YkpCMkRLbE1yc2ZkQndj?=
 =?utf-8?B?c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VH?=
 =?utf-8?B?bjUwY09xbnZVVE5zdHJqVmMwZExUblgweHNHelN3V1d3YlRrRnc4ZDBLQUxY?=
 =?utf-8?B?VG1weENoa1dVQnFIVXRYUnpmWHFPdHhhZ3VQVk9ZVGJpQUdoSDNiMVZsb3lJ?=
 =?utf-8?B?blNwMVp4ZjBwNkhTcVF3RnVyWWl0WTdFTkRKb0NBRVhRZlBlV3hYVjNqQ1lK?=
 =?utf-8?B?UjF1NVMzQ0ZWOVJzWWJpeW9hUU5lTGlSRERMVzdIbm9aNk1HSnNKUlQ2eWx0?=
 =?utf-8?Q?MxIa+5NbMQX73cvWE54cG7bku?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c9c64f18-1c1c-4c6f-bb9f-08db84786981
X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 14:41:30.4901
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 5c72cck0N4+v0sYSsStZEsrRxS434fYEaMSoG2svpntNikFW0p8dUaHbIA1RVM8BVls+Md1Ke7jGeo+TsShzCQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8308

On 14.07.2023 15:10, Andrew Cooper wrote:
> For pre-ANSI-C compatibility reasons, string literals have a mutable type, but
> it is undefined behaviour to mutate them.
> 
> Swap char *'s to const char *'s for variables which hold string literals.
> 
> This fixes several violations of MISRA Rule 7.4:
> 
>   A string literal shall not be assigned to an object unless the object's type
>   is "pointer to const-qualified char".
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Fri Jul 14 14:46:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 14:46:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563684.881076 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKK3r-0001GU-Kl; Fri, 14 Jul 2023 14:46:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563684.881076; Fri, 14 Jul 2023 14:46:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKK3r-0001GN-I2; Fri, 14 Jul 2023 14:46:23 +0000
Received: by outflank-mailman (input) for mailman id 563684;
 Fri, 14 Jul 2023 14:46:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=lIDz=DA=citrix.com=prvs=552896509=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qKK3q-0001Fy-El
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 14:46:22 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 31ca7842-2255-11ee-b239-6b7b168915f2;
 Fri, 14 Jul 2023 16:46:21 +0200 (CEST)
Received: from mail-dm6nam11lp2170.outbound.protection.outlook.com (HELO
 NAM11-DM6-obe.outbound.protection.outlook.com) ([104.47.57.170])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 14 Jul 2023 10:46:14 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by BL1PR03MB6069.namprd03.prod.outlook.com (2603:10b6:208:309::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.27; Fri, 14 Jul
 2023 14:46:12 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::f3c4:948d:a70a:de2a]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::f3c4:948d:a70a:de2a%5]) with mapi id 15.20.6588.027; Fri, 14 Jul 2023
 14:46:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 31ca7842-2255-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689345980;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=AVzWvFh2eoCjjatEGajZeLavM49u+k9b6UNzsRribCQ=;
  b=DhPDlaXd0n8SHTaSdtH4+1jB2IFvpffGLj/EmCNyysJvmExj3DwSpND0
   9fD+5N56SH6pMVYhl4YS0/iTnCS9XJ8Wdd2fauXuoyrSB4JnC9fE7ccPc
   3e8PZEPpcbWp4nE2x/9En59o8BGnw2Tn/+44zOHd+b+bvLgoFqEa/vtsz
   A=;
X-IronPort-RemoteIP: 104.47.57.170
X-IronPort-MID: 115541256
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:jfeCo6yCr2NhyFv7V8l6t+fLxyrEfRIJ4+MujC+fZmUNrF6WrkUPz
 2pND2qCOaveMzahedklOYW1pEoP6sPQn9RjSAJlpCAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhPKwT5TcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KVwS8
 PlFcS8dUk2ClcyS8rW5Uu903f12eaEHPKtH0p1h5RfwKK9/BLzmHeDN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjeVlVMpuFTuGIO9ltiibMNZhEuH4
 EnB+Hz0GEoyP92D0zuVtHmrg4cjmAuiAd9PSOTiq6ACbFu7+3Y8BQYEfH+ChvzgqELned9uE
 RUP5X97xUQ13AnxJjXnZDWorXjBshMCVt54F+wh9BrL2qfS+xyeBGUPUnhGctNOnO0cSCEu1
 1SJt8j0HjEpu7qQIVqC8p+EoDX0PjIaRUcZfjMNRwYB59jloakwgwjJQ9IlF7S65vXvHjv92
 SyN6iI3iLMal8cj3bi05l3BjHSnoZ2hZgg07QLTVyS74x9jZYikT4a15kPW6/kGJ4GcJmRtp
 1ABksmaqewLU5eEkXXURP1XRe7xofGYLDfbnFhjWYE78Cig8GKieoYW5yxiIEBuMYAPfjqBj
 FLvhD69LaR7ZBOCBZKbqaroYyj25cAMzejYa80=
IronPort-HdrOrdr: A9a23:yNBikaG9bG24PrB9pLqE4MeALOsnbusQ8zAXPiFKOHlom6mj/K
 qTdZsgpHzJYVoqOE3I4OrgBEDiewK/yXcW2+Us1N6ZNWHbUQ2TQ72KhrGO/9SPIUPDHso379
 YFT5RD
X-Talos-CUID: 9a23:F9hycGz6gmDpBGpocM9wBgUpRsUgLyTC3EuNIl2WLVRuSqWTUQSprfY=
X-Talos-MUID: 9a23:XZexIgo0ZRPf2aeq5tUezwx4G8pz8Y2KMWcIyLcK4uuJBBYpICjI2Q==
X-IronPort-AV: E=Sophos;i="6.01,205,1684814400"; 
   d="scan'208";a="115541256"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JvHv3GTU7UGTUjW3khkjGRmEt2J1lxHgphuS9NSqXtu7JG8pde2+EdZiJ0iekjynTf692sjV54LylHqop/JJV0Yc7/XMABl5Q0+v3S4oH9Iz9bs2fdr1wtgQbnmEti1IMpG+jtRRGa3WBDjrL6cDYL+e8rSZnW33u/C7mfcl+JMX0I30Fq307JI8zquuGkHADJceAtBPoitGdzAvZtTN+d7GF+HeFQ0fj7dv4s7buQz73fZvMT8WNgYqEcwyngbsD1YTfKUU3lfbkCxqBLdBv/22XCiqWgtJT/8wj+2LZ16vxBGnmbFzmoxqe1OCsNodtYuMy5M4gT8htOYnkCg2wA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=AVzWvFh2eoCjjatEGajZeLavM49u+k9b6UNzsRribCQ=;
 b=FYDx7xWKm/KvzdnFk9B+k+ECIUbqCRAuzuIcwSNF17qiik57+mY9XTso/Q8tdAStSj1qtW4GiCaXPw1fqrLYJrKToBvtKqbLh0reO4wPAX9Smft7az+csWIZKRXvSU6d5Ws9VHKly4naEsQcyYEqG/kmMxlWQwmmWpP1VrhuTcUrJo5891r3x44ZZ9iGUgI6i8/PEYXMVHO6pwIkeMTlph8lSxM1AgbhXRkrthrf8PaSvrdzJwlAWkdE1QK4A6nUQoQMsgxjwfda2ysL1GZl0hvQ2h77F3/ZLzSVlzx1FMmstzW79ydMtaRYQT6JW9TYw8yVlSRudLVd0fWSZgYY8Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=AVzWvFh2eoCjjatEGajZeLavM49u+k9b6UNzsRribCQ=;
 b=Jm8DIuFb7sGM/Fxe09l6cpzTZohbjRHXQl2SnQlQXv25zCTjzXg9WQcJ3VyI6J/9Pt3rHYT1sL0PyX9/8pPyG2WIFnMWrSsyrZbFNnEgiLe2Q97FUOlN+lqSc7Nc+AkEsZ0heaUaQHIEnOdaT1aTth4w6YRip+E6hT5vdedyPdk=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <77dffcb7-242c-0a4e-9ad0-b541105f2c4a@citrix.com>
Date: Fri, 14 Jul 2023 15:46:05 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH] x86/common: Use const char * for string literals
Content-Language: en-GB
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Jan Beulich <JBeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Roberto Bagnara <roberto.bagnara@bugseng.com>,
 Nicola Vetrini <nicola.vetrini@bugseng.com>
References: <20230714110009.3004073-1-andrew.cooper3@citrix.com>
In-Reply-To: <20230714110009.3004073-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0646.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:296::15) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|BL1PR03MB6069:EE_
X-MS-Office365-Filtering-Correlation-Id: e5d1fff6-8757-48be-7c90-08db8479111c
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	7uFLDExtHIDeHadcvkkF4ULiDLYn072Ib7QgHW2MrAc7SsauClUR415Y8k14VFHPQhlyjJIp+qceUCjG9l7V5acAwFTf/zn8oK/FNF9U5Dc+sdlHUdQRkyCTJkOVtHmzuPAjyG7U4ey17xa/FaMiP6n4JRqwlAjP5CkOCP6dgLt+JwGHbTjzryYyPcapobJmY64tA5ORW4oCvTOqkVTR5Sl8jMVaiqIQ3PrFoAOkd2Bm8mfwdPs2JG5493JH2x9/n6OGWYiMfvgwl6R5pLXYQhh5wGnMbPcxFe1oGHcu5j8I1fJQtcjvKTPf2Ujwmjwa/p8LHB4iltS1BgNclLdDnjxot2Ms/izYX5k6F1eDWBZvB0otahf/kVkRM8D8C+zgPnbWZFDk98bLCnqUWqwi2P32jSgmCz3vA5BY63Otl+2zY/UQGHha5i7vzOPrF4JLMfBIv65E+Z8rG+lSh0eChKlwUuLPm1K+oGRhpzZ1KO2M3oDHGIKekbax36BaGE/XNOROAZVSwgDSvU2BGOck5xzxxqYlSx8Fo9xEnv3/MovGvWjuvluvXPmNRgcwKFM8BZKG2MjAGh3/0FZF8wOenzwCulcuXf/yh7Sbh91DTGvVJsNShZsJ2C6MB6K1Ttn+DVIElkuYge02JvrbK74/EQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(346002)(39860400002)(376002)(136003)(451199021)(86362001)(558084003)(31696002)(36756003)(82960400001)(38100700002)(478600001)(2906002)(6486002)(6666004)(6506007)(26005)(6512007)(6916009)(8676002)(8936002)(316002)(41300700001)(66946007)(66556008)(54906003)(5660300002)(4326008)(31686004)(66476007)(2616005)(186003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TDM1NTR2OTBVbHJicENWeE9MT3B6ZURxNmhIaUJ3RURWSDVEWnQwa0o4bS9Q?=
 =?utf-8?B?S3pmbXFwM1QvSDhzODdNZkpYYlFOUkM2ZUZwMDhBWVRPTHFtMHgyQnBUeEVR?=
 =?utf-8?B?MVdrNXB5cG9FaHNpdlorWVBoMVE4b0RTUXlYY1Z1eEdMWVJIUFdjeit2YjA5?=
 =?utf-8?B?VXVzVHpQYk96dGlyZTFDUUhPU01TRlErMHh5cnk3ajlkckVURnB6VGdTOTha?=
 =?utf-8?B?ZHM5emRObVdnSUsrZk5jaXNZaWNMM0hvQjU5djNRUUZSUDAxNkFUdk5UQ05P?=
 =?utf-8?B?UTVNenlCNDBUTFd6aDhyc2pZbFJCWkJ3aWZxbWdoVnNHd1Fub0NKeUdadFUx?=
 =?utf-8?B?K2tIR1AvV0FsMWFZbEhoYmRJUjRBQUNWZXQ0MUNselVWc3o2WWhYRFV6UVZT?=
 =?utf-8?B?by93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f-8?B?Q0E9PQ==?=
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	31tnwB3t85/RruSeE3j1VXthn0Ympe1Af0AuwqfBiUxNbh9GRtyaJk6yBbx3ExAVY2yJdha0ww67acQCTxwF6nFrTpgsW7KwpbOk2zsp1Eo1dbgcOh2Y3NFI+HZUx4tetbjwveIQ37TlYlrWB077WO/L5me4NmNfVQ7Pk/4pbKbe/rrBovLr7BqRLDvOkJzb8R1A0/YOhGq0vxI0yFC3xOtuBYuT2Zmpp/8XuajuExsGi5Bo01hjhxe7tFFM1bHzSF/jlS/cmwZDDCX8Be+znTG4cXuEukywQxaVRPFBRLLAxZUAPO7/YETPvjwio+jcJ6+1FpuST34k9v6ltO72dvDKyMo7iw4NWOATdgOEjj+eYlYejLCjBzPYeoydfa6uGz6h/05eB+oTXgowVgnA+/gZn2i6oIzvwsJyWBPslP6zicFwY74rj7TbToR5uE6ihJkxYHoBvHMAyqNGHMZIw6hN6cG2Q3syU9b9/mc/8Azh4zj7yl+aRPVdruQ8U0hP6/lClL+MUV+e+VNKjXv/Kvpq0TcDUvyvWXeZJO5IYb79c4b8tEjvIl5r2QKWCiduzaiDWR2yJ+ah2yK0o5uF29zP+lI66F7CUg+QN9LaHhHrpEvoXjAxhuN+0QZpCO1b+XNDld+6CkHHUVHu/xXFbfmH/Lz6dAtwJfIYl3TARYrrxPfls+izho30K0njfXJd+BXOapQ6xzdCEMAuxPrL5d0nwMDk6RxyCidQoZtJWcc3GrtAAl8QISO46NLjX2nrlxjsxWJEZi77cVRlfzH2HoedHXoY5rxEc+eTKzbWnAkd+a2T6zvFKeytamazhhP/hKtsZHd4vtiIihgNFYIBi7qSXGYSY/0+FncBl/Ufbyzlg3F6UIyTnzBhvotrRsay
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e5d1fff6-8757-48be-7c90-08db8479111c
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 14:46:11.9982
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: z2BhxMq5VQvM2O3ND9+TM3Jxf2S3XNGTZyQhFRswz7O7CjMy0jTUJM/v4jAkKJNKoe996NBMnkpKg2zilhuqz20w28uFjv32Udw0VrHze3o=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR03MB6069

Hmm, I intended this to be xen/x86: as a subject.

Fixed locally, but I won't resend for just this.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 14:49:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 14:49:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563690.881086 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKK6g-0001ye-6k; Fri, 14 Jul 2023 14:49:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563690.881086; Fri, 14 Jul 2023 14:49:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKK6g-0001yX-2y; Fri, 14 Jul 2023 14:49:18 +0000
Received: by outflank-mailman (input) for mailman id 563690;
 Fri, 14 Jul 2023 14:49:17 +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
 <SRS0=Z95V=DA=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qKK6f-0001yP-KK
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 14:49:17 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9a29950b-2255-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 16:49:15 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.163.94.163])
 by support.bugseng.com (Postfix) with ESMTPSA id 249A14EE0739;
 Fri, 14 Jul 2023 16:49:13 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9a29950b-2255-11ee-8611-37d641c3527e
Message-ID: <f1917965-8e43-9942-7c3e-d620c7b1d103@bugseng.com>
Date: Fri, 14 Jul 2023 16:49:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
Content-Language: en-US
To: Luca Fancellu <Luca.Fancellu@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 "xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
 "ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
 "consulting@bugseng.com" <consulting@bugseng.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
 <CB1B8DB0-7708-454D-9E73-171CA894E304@arm.com>
 <3305C79F-38AA-4BA3-A9AA-4A626C7CC478@arm.com>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <3305C79F-38AA-4BA3-A9AA-4A626C7CC478@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 14/07/23 16:32, Luca Fancellu wrote:
> 
> 
>> On 14 Jul 2023, at 15:20, Luca Fancellu <Luca.Fancellu@arm.com> wrote:
>>
>>
>>
>>> On 14 Jul 2023, at 12:49, Nicola Vetrini <nicola.vetrini@bugseng.com> wrote:
>>>
>>> The macro 'testop' expands to a function that declares the local
>>> variable 'oldbit', which is written before being set, but is such a
>>> way that is not amenable to automatic checking.
>>>
>>> Therefore, a deviation comment, is introduced to document this situation.
>>>
>>> A similar reasoning applies to macro 'guest_testop'.
>>>
>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>> ---
>>> docs/misra/safe.json                     | 16 ++++++++++++++++
>>> xen/arch/arm/arm64/lib/bitops.c          |  3 +++
>>> xen/arch/arm/include/asm/guest_atomics.h |  3 +++
>>> 3 files changed, 22 insertions(+)
>>>
>>> diff --git a/docs/misra/safe.json b/docs/misra/safe.json
>>> index 244001f5be..4cf7cbf57b 100644
>>> --- a/docs/misra/safe.json
>>> +++ b/docs/misra/safe.json
>>> @@ -20,6 +20,22 @@
>>>         },
>>>         {
>>>             "id": "SAF-2-safe",
>>> +            "analyser": {
>>> +                "eclair": "MC3R1.R9.1"
>>> +            },
>>> +            "name": "Rule 9.1: initializer not needed",
>>> +            "text": "The following local variables are possibly subject to being read before being written, but code inspection ensured that the control flow in the construct where they appear ensures that no such event may happen."
>>> +        },
>>> +        {
>>> +            "id": "SAF-3-safe",
>>> +            "analyser": {
>>> +                "eclair": "MC3R1.R9.1"
>>> +            },
>>> +            "name": "Rule 9.1: initializer not needed",
>>> +            "text": "The following local variables are possibly subject to being read before being written, but code inspection ensured that the control flow in the construct where they appear ensures that no such event may happen."
>>> +        },
>>
>> Since the rule and the justification are the same, you can declare only once and use the same tag on top of the offending lines, so /* SAF-2-safe MC3R1.R9.1 */,
>> also, I remember some maintainers not happy about the misra rule being put after the tag, now I donâ€™t recall who
> 
> Sorry, I see there was in a patch before a SAF-1-safe with the same justification, so I suggest you use SAF-3-safe as tag and drop the new justifications introduced here

I was a bit uncertain in choosing whether to use different IDs for 
bitops.c and guest_atomics.h, as they are very similar. Maybe a 
catch-all justification is too broad, but I have no strong opinion here.

As for the rule identifier after the tag, that's not a big problem (I 
added it mostly to emphasize why the deviation is there at a glance).

> 
>>
>>> +        {
>>> +            "id": "SAF-4-safe",
>>>             "analyser": {},
>>>             "name": "Sentinel",
>>>             "text": "Next ID to be used"
>>> diff --git a/xen/arch/arm/arm64/lib/bitops.c b/xen/arch/arm/arm64/lib/bitops.c
>>> index 20e3f3d6ce..e0728bb29d 100644
>>> --- a/xen/arch/arm/arm64/lib/bitops.c
>>> +++ b/xen/arch/arm/arm64/lib/bitops.c
>>> @@ -114,8 +114,11 @@ bitop(change_bit, eor)
>>> bitop(clear_bit, bic)
>>> bitop(set_bit, orr)
>>>
>>> +/* SAF-2-safe MC3R1.R9.1 */
>>> testop(test_and_change_bit, eor)
>>> +/* SAF-2-safe MC3R1.R9.1 */
>>> testop(test_and_clear_bit, bic)
>>> +/* SAF-2-safe MC3R1.R9.1 */
>>> testop(test_and_set_bit, orr)
>>>
>>> static always_inline bool int_clear_mask16(uint16_t mask, volatile uint16_t *p,
>>> diff --git a/xen/arch/arm/include/asm/guest_atomics.h b/xen/arch/arm/include/asm/guest_atomics.h
>>> index a1745f8613..9d8f8ec3a3 100644
>>> --- a/xen/arch/arm/include/asm/guest_atomics.h
>>> +++ b/xen/arch/arm/include/asm/guest_atomics.h
>>> @@ -67,8 +67,11 @@ guest_bitop(change_bit)
>>> /* test_bit does not use load-store atomic operations */
>>> #define guest_test_bit(d, nr, p) ((void)(d), test_bit(nr, p))
>>>
>>> +/* SAF-3-safe MC3R1.R9.1 */
>>> guest_testop(test_and_set_bit)
>>> +/* SAF-3-safe MC3R1.R9.1 */
>>> guest_testop(test_and_clear_bit)
>>> +/* SAF-3-safe MC3R1.R9.1 */
>>> guest_testop(test_and_change_bit)
>>>
>>> #undef guest_testop
>>> -- 
>>> 2.34.1
>>>
>>>
>>
> 

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 15:35:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 15:35:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563696.881096 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKKop-0007av-KA; Fri, 14 Jul 2023 15:34:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563696.881096; Fri, 14 Jul 2023 15:34:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKKop-0007ao-HD; Fri, 14 Jul 2023 15:34:55 +0000
Received: by outflank-mailman (input) for mailman id 563696;
 Fri, 14 Jul 2023 15:34:54 +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
 <SRS0=7XGI=DA=citrix.com=prvs=5525cada8=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qKKoo-0007ai-0o
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 15:34:54 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f74c3c2b-225b-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 17:34:49 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f74c3c2b-225b-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689348889;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:content-transfer-encoding:in-reply-to;
  bh=Rrn18Px0Jy/Mwd4sqh2vtawJA0bH2EjjTmHrhss+9vA=;
  b=HHX4beel6xYDcH+l6P9WXIj550Tz09pCmNeQclvpC21obgo1N0EPon2M
   ykacOBexykLzpWkuKNT1y6b6EGbPX96jQTIkP5vs0uxhbMv96vD7fPi1o
   SUiqjKNmJO8fg7oSw53KJ2Yrwfu+fzEVkZJeXunHG2zCzCksb8fDH3eyl
   M=;
Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 118837742
X-Ironport-Server: esa4.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:StIIc60BRf6ne2drvfbD5fVxkn2cJEfYwER7XKvMYLTBsI5bpzdRn
 2ceDW/XOK7YZWP3eNx+PI7j9RxU65aHnYBlSlZlpC1hF35El5HIVI+TRqvS04F+DeWYFR46s
 J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo
 tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5gNnOagS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL
 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ
 OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfL1x03
 98hIWE0RB2YmsmxnpGlVfJ2v5F2RCXrFNt3VnBIyDjYCbAtQIzZQrWM7thdtNsyrpkQR7CEP
 ZNfMGcxKk2aOHWjOX9OYH46tO6umnn4dSwesF+PrLA7y2PS0BZwwP7mN9+9ltmiHJwFzh3H+
 T6cl4j/KhoHNpuU6mWmy1P2jNTLvCbLf8EPFqLto5aGh3XMnzdOWXX6T2CTo/O0l0q/UNJ3M
 FEP92wlqq1a3FWmS8S4UxCmrXqsuBkaVNxNVeog52ml2qfSpgqUGGUAZjpAc8A98t87QyQw0
 V2ElM+vAiZg2JWcUX+H/62YhS+zMyMSa2QFYEc5oRAtuoe55ttp11SWE4glSfTu5jHoJd3u6
 x63lgIdvrxCtOQGzLiQ+g7knS23vKGcG2bZ+T7rsnKZAhJRPdD1NtfysQiDsp6sP67CEADf4
 SFsd9y2qblXUMrTzHHlrPAlRunB2hqTDNHLbbeD9bEF/i/lxXOsdJs4DNpWdBYwaZZsldMEj
 SbuVeJtCHx7ZiHCgVdfOd7ZNijT5fGI+S7Zfv7VdMFSRZN6aRWK+ipjDWbJgTC8yhd3yf5jZ
 8rLGSpJMZr8If48pNZRb75NuYLHOwhknT+DLXwF50nPPUWiiI69Fu5ebQrmghER56KYugTFm
 +uzxOPToyizpNbWO3GNmaZKdABiEJTOLcyuwyChXrLZc1UO9aBII6O5/I7NjKQ8wf8Kyb+Wo
 S7hMqKaoXKm7UD6xcyxQigLQNvSsVxX9xrX4QRE0Y6U5kUe
IronPort-HdrOrdr: A9a23:JN6vLaoJYz1jrJi0acr68KQaV5oReYIsimQD101hICG9JPbo8P
 xG+85rtiMc6QxwZJhOo7u90cW7K080lqQV3WByB9iftVLdyQ+VxehZhOPfKlvbdhEWndQy6U
 4PScRD4HKbNykdsS5XijPIcerJYbO8gcWVuds=
X-Talos-CUID: =?us-ascii?q?9a23=3AKm+p7mtWdU0CoztEZfuK2bD36IsLT0f3707Zcna?=
 =?us-ascii?q?SBH10Y7rLakGP47ldxp8=3D?=
X-Talos-MUID: 9a23:BY3Zngp6Xy7dj2U4/MYezzp/NoBjwPuNMWFXm64Cmsy0Em9tOSjI2Q==
X-IronPort-AV: E=Sophos;i="6.01,205,1684814400"; 
   d="scan'208";a="118837742"
Date: Fri, 14 Jul 2023 16:34:29 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
CC: Jan Beulich <jbeulich@suse.com>, <qemu-devel@nongnu.org>,
	<xen-devel@lists.xenproject.org>
Subject: Re: QEMU assert (was: [xen-unstable test] 181558: regressions - FAIL)
Message-ID: <a58f5bef-0543-4913-9a70-edb77c269a29@perard>
References: <osstest-181558-mainreport@xen.org>
 <ZJwoK50FcnTSfFZ8@MacBook-Air-de-Roger.local>
 <947da45d-f336-4034-bf51-fb190420506b@perard>
 <ZKPs5r3wen4PymqX@MacBook-Air-de-Roger.local>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <ZKPs5r3wen4PymqX@MacBook-Air-de-Roger.local>

On Tue, Jul 04, 2023 at 11:56:54AM +0200, Roger Pau Monné wrote:
> On Tue, Jul 04, 2023 at 10:37:38AM +0100, Anthony PERARD wrote:
> > On Wed, Jun 28, 2023 at 02:31:39PM +0200, Roger Pau Monné wrote:
> > > On Fri, Jun 23, 2023 at 03:04:21PM +0000, osstest service owner wrote:
> > > > flight 181558 xen-unstable real [real]
> > > > http://logs.test-lab.xenproject.org/osstest/logs/181558/
> > > > 
> > > > Regressions :-(
> > > > 
> > > > Tests which did not succeed and are blocking,
> > > > including tests which could not be run:
> > > >  test-amd64-amd64-xl-qcow2   21 guest-start/debian.repeat fail REGR. vs. 181545
> > > 
> > > The test failing here is hitting the assert in qemu_cond_signal() as
> > > called by worker_thread():
> > > 
> > > #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
> > > #1  0x00007ffff740b535 in __GI_abort () at abort.c:79
> > > #2  0x00007ffff740b40f in __assert_fail_base (fmt=0x7ffff756cef0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55555614abcb "cond->initialized",
> > >     file=0x55555614ab88 "../qemu-xen-dir-remote/util/qemu-thread-posix.c", line=198, function=<optimized out>) at assert.c:92
> > > #3  0x00007ffff74191a2 in __GI___assert_fail (assertion=0x55555614abcb "cond->initialized", file=0x55555614ab88 "../qemu-xen-dir-remote/util/qemu-thread-posix.c", line=198,
> > >     function=0x55555614ad80 <__PRETTY_FUNCTION__.17104> "qemu_cond_signal") at assert.c:101
> > > #4  0x0000555555f1c8d2 in qemu_cond_signal (cond=0x7fffb800db30) at ../qemu-xen-dir-remote/util/qemu-thread-posix.c:198
> > > #5  0x0000555555f36973 in worker_thread (opaque=0x7fffb800dab0) at ../qemu-xen-dir-remote/util/thread-pool.c:129
> > > #6  0x0000555555f1d1d2 in qemu_thread_start (args=0x7fffb8000b20) at ../qemu-xen-dir-remote/util/qemu-thread-posix.c:505
> > > #7  0x00007ffff75b0fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
> > > #8  0x00007ffff74e206f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
> > > 
> > > I've been trying to figure out how it can get in such state, but so
> > > far I had no luck.  I'm not a QEMU expert, so it's probably better if
> > > someone else could handle this.
> > > 
> > > In the failures I've seen, and the reproduction I have, the assert
> > > triggers in the QEMU dom0 instance responsible for locally-attaching
> > > the disk to dom0 in order to run pygrub.
> > > 
> > > This is also with QEMU 7.2, as testing with upstream QEMU is blocked
> > > ATM, so there's a chance it has already been fixed upstream.
> > > 
> > > Thanks, Roger.
> > 
> > So, I've run a test with the latest QEMU and I can still reproduce the
> > issue. The test also fails with QEMU 7.1.0.
> > 
> > But, QEMU 7.0 seems to pass the test, even with a start-stop loop of 200
> > iteration. So I'll try to find out if something change in that range.
> > Or try to find out why would the thread pool be not initialised
> > properly.
> 
> Thanks for looking into this.
> 
> There are a set of changes from Paolo Bonzini:
> 
> 232e9255478f thread-pool: remove stopping variable
> 900fa208f506 thread-pool: replace semaphore with condition variable
> 3c7b72ddca9c thread-pool: optimize scheduling of completion bottom half
> 
> That landed in 7.1 that seem like possible candidates.

I think I've figured out the issue. I've sent a patch:
https://lore.kernel.org/qemu-devel/20230714152720.5077-1-anthony.perard@citrix.com/

I did run osstest with this patch, and 200 iteration of stop/start, no
more issue of qemu for dom0 disapearing. The issue I've found is osstest
not able to ssh to the guest, which seems to be started. And qemu for
dom0 is still running.

While the report exist:
    http://logs.test-lab.xenproject.org/osstest/logs/181785/

Cheers,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 16:05:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 16:05:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563700.881105 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKLIT-0003PH-Rj; Fri, 14 Jul 2023 16:05:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563700.881105; Fri, 14 Jul 2023 16:05:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKLIT-0003PA-P8; Fri, 14 Jul 2023 16:05:33 +0000
Received: by outflank-mailman (input) for mailman id 563700;
 Fri, 14 Jul 2023 16:05:32 +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
 <SRS0=1dmA=DA=citrix.com=prvs=552b8e743=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qKLIS-0003P4-69
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 16:05:32 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3fbd6038-2260-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 18:05:29 +0200 (CEST)
Received: from mail-mw2nam10lp2106.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.106])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 14 Jul 2023 12:05:26 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB6438.namprd03.prod.outlook.com (2603:10b6:a03:396::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Fri, 14 Jul
 2023 16:05:23 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::e14d:fb6d:9e52:1524]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::e14d:fb6d:9e52:1524%4]) with mapi id 15.20.6588.024; Fri, 14 Jul 2023
 16:05:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3fbd6038-2260-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689350729;
  h=from:to:cc:subject:date:message-id:
   content-transfer-encoding:mime-version;
  bh=8lGIoVSmbQI3geIM7K6Dw264tZPPYS+3vpWdBhSRTXQ=;
  b=WL5DnF3IVWt0QQXj2kM/aAYukuHw/bbL6zyPKpHvWRugtP67JBIPEukw
   vm2GJzLyPbzDVBmz9BlTDBZHLgX5MiWzI1Ypo/J4xDsvIoLxmamDJ5gZL
   dRGR/fyCj2hsDG1bErz1FWiG2RATatPPbTHF6ecFEjNDyuFh/XZuAyn5a
   w=;
X-IronPort-RemoteIP: 104.47.55.106
X-IronPort-MID: 116129626
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:/sAoCqrSOYlCzPfFZOdsVEj32AteBmI+ZBIvgKrLsJaIsI4StFCzt
 garIBmDMvbeZjP3Kt12Pdi+/EJVvcLdzIQyQVQ9rik3QSlB85uZCY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7pa8CkcCv7o?=
 =?us-ascii?q?9gsSeKhBJZhukzwv0a9py?=
X-IronPort-AV: E=Sophos;i="6.01,205,1684814400"; 
   d="scan'208";a="116129626"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=SbJRsZ1iWIKMEs6Hzs1m99fFoRs8lsvKI5UkquTFzrXGqpnStfi+Tp6uXFco+o4fwccjbcm0KNiq9C73tNxXaYm2cDdLDgzv2blvkVj2PV5W48GjT2oAnz1szoK6tsFwY1HypMC64usRa5hp/bwvgkvKuIn6+mAjAJ59150h4MeB4d5FoBEtsMQj12XpkDbeztyp+pfLLZ/9YJuRsloN2Pc37fEDYU+m2hlluNswJ9IAnwPwgptvg52XWSFyp9AiCXMtWn7mLYsboOfQpZQ9dbCbxOx0JACZAFdN32ewo/zC99Yi1C6YggrK0D/8lDJSQjRlytV0EEuzjUkx5c39nw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=U0HISuVX845kGAG0SnJ2bfw4WW7gmh3amQHJcMNwxgY=;
 b=Y1MKUdRewjpzoatITmVojdMZMhayWZn5vGWjIM8EV72P73XquaH8e+DCkX+WKbK28WpH/GtD4/KNsNdJMZ4fG1dIRSednL5r2kCrrDWjKU7+WKw4IhNHA3P3CN3SKiC0N4gLrKA+OoNttGqU4rOkULrvxBdXQqtI/4TzZ1GNAbGvKiytHm3vgv7Y9JADt/idv9ddjkSII5UWQ2FKrTy6PR/EZRCpyYUd2CNZ2WAvEbdey/AYY8cu47xjAWBPGZKZIBRhggiLFt0rQ6vj/H+Zd9Od4GsBAJmoM+Hv8s5dELXg0+2nL64y5WEkSeD23/Z2B0+aVLECRMczhIOmstsJxw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=U0HISuVX845kGAG0SnJ2bfw4WW7gmh3amQHJcMNwxgY=;
 b=Oxfdk0Ff7FNZYinozYlzdIU6l9y1p8I6FlijUcqqDf827tKxSsqUoAd3cFKd3IK1JZdIzD4ZKuB9rfJLQkEkMVLGh0a0lFu6h1T0eHReR118L0tt+90FCX2yzDpjhqGDPMt62+3cPnUlctsiDY8h7+680OhHaxjRzdUwdlKAoRo=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v2] x86/ioapic: sanitize IO-APIC pins before enabling lapic LVTERR/ESR
Date: Fri, 14 Jul 2023 18:03:14 +0200
Message-ID: <20230714160314.71379-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO6P123CA0050.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:310::6) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB6438:EE_
X-MS-Office365-Filtering-Correlation-Id: ae3b6e55-3f9f-404e-9053-08db848420af
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	zxhYJlJ0wX5nHxR+WP0OaxosPNpO7oEOlYZvXcve82C3o0788jTOox7SEB+kAE5xi+0hsYOFS27EVux/KL9i+fygMd17Ymb4EsqpKoDe/hd7fl9qEPY26EbUDOttP9yvcf5msMJGdUr7H024sPa2gJI5obLQFHvPH8wVwR+6rtXK/f93bumatr/NMWXjEL6wfcqAvkkC89/hrdSX0u1mzPxvfSJGs00RONsA27K5AbTSniQzNJBEBm5hh2HmTZ7/vQ5h/uUUarC/CIfGega1NtRoI/sFUr1jSkyicagm0QWH9pY+miieBzqIEpaw9MMKX2qoEqh/mqu4vZYJc0R1VAja/FDTrB83HLd27C4Tah4lVwInhGKqlT0qAF/krzxiuDO4rozox7jaczTF4LoMcIOwrDvIGSWIqgTCPJHl99RXU+774VWqAOjgCAPKFmHShfs+K42yf3179u/ga27iPsqsbVGDh3v6Q1bbgSFVtCBa5jkMccn2XC7QYUFRas82elWP7lHZwUO22zDJtcQX4KMS1OG9axIKe0H9L4ArCPu2K3EHD+C1aPtcNCOdEMwM
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(136003)(346002)(396003)(366004)(451199021)(186003)(1076003)(26005)(478600001)(6512007)(2906002)(2616005)(83380400001)(4326008)(41300700001)(66556008)(6916009)(316002)(5660300002)(66476007)(66946007)(8936002)(8676002)(6486002)(6666004)(54906003)(36756003)(6506007)(82960400001)(38100700002)(86362001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WHhmb2FKWHZrTkpi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RL0iJ4ZJT+jv2QEVv3LEScHbXYkcPUXkn1jWxUKbUXv7bdgOg/Mk7ztmEKU//5yFvJKXeGT2fSLhVvIEC7yyvWF9dw7e5AvXw/TFQeQs7gdjTgyXQV8AZqVx/RFrBt4/pTpOGIKASQS3Gh0JQtiVppd4UV33vlYTknn/Haqm4pPw4un84bBEruTiVo66P0YZIkHnJy5BsOUvqPABF0UV00BS/tCdP6YyzlKVkcxRC788GITm9SbxS4iThwMXsbYGwQVG8L+HxtOv1JtcmALJfl+MhTO8OHyVYOVcftCQ9MHeLaqJqMVJU9AVZ5pJk/eDp7qaDASjma6psGPEzkUAyNjNowoVvqUz2UoQNVIUuq88cED65cZMansp00gJOfxV7gR4iD4r+
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ae3b6e55-3f9f-404e-9053-08db848420af
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 16:05:22.4905
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: OMvpMDBPfO0NzD1w1YeRu8oKdaLyp7wkfPvSBJxqErLh0es6BjDmpbVpJn6orSlBGE1jVwG1bm5B2/VecZrCyA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB6438

The current logic to init the local APIC and the IO-APIC does init the
local APIC LVTERR/ESR before doing any sanitation on the IO-APIC pin
configuration.  It's already noted on enable_IO_APIC() that Xen
shouldn't trust the IO-APIC being empty at bootup.

At XenServer we have a system where the IO-APIC 0 is handed to Xen
with pin 0 unmasked, set to Fixed delivery mode, edge triggered and
with a vector of 0 (all fields of the RTE are zeroed).  Once the local
APIC LVTERR/ESR is enabled periodic injections from such pin cause the
local APIC to in turn inject periodic error vectors:

APIC error on CPU0: 00(40), Received illegal vector
APIC error on CPU0: 40(40), Received illegal vector
APIC error on CPU0: 40(40), Received illegal vector
APIC error on CPU0: 40(40), Received illegal vector
APIC error on CPU0: 40(40), Received illegal vector
APIC error on CPU0: 40(40), Received illegal vector

That prevents Xen from booting.

Move the masking of the IO-APIC pins ahead of the setup of the local
APIC.  This has the side effect of also moving the detection of the
pin where the i8259 is connected, as such detection must be done
before masking any pins.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
Changes since v1:
 - Remove the smp_found_config from APIC_init_uniprocessor().
 - Adjust commit message.
 - Move the IO-APIC sanitize call just ahead of setup_local_APIC().
 - Keep the enable_IO_APIC() function name.
---
 xen/arch/x86/apic.c            | 4 ++++
 xen/arch/x86/include/asm/irq.h | 1 +
 xen/arch/x86/io_apic.c         | 4 +---
 xen/arch/x86/smpboot.c         | 5 +++++
 4 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index f71474d47dd1..cf1d012841e6 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1491,6 +1491,10 @@ int __init APIC_init_uniprocessor (void)
     physids_clear(phys_cpu_present_map);
     physid_set(boot_cpu_physical_apicid, phys_cpu_present_map);
 
+    if ( !skip_ioapic_setup && nr_ioapics )
+        /* Sanitize the IO-APIC pins before enabling the lapic LVTERR/ESR. */
+        enable_IO_APIC();
+
     setup_local_APIC(true);
 
     if (nmi_watchdog == NMI_LOCAL_APIC)
diff --git a/xen/arch/x86/include/asm/irq.h b/xen/arch/x86/include/asm/irq.h
index 424b0e1af8f4..3f95dd39b7b9 100644
--- a/xen/arch/x86/include/asm/irq.h
+++ b/xen/arch/x86/include/asm/irq.h
@@ -118,6 +118,7 @@ bool bogus_8259A_irq(unsigned int irq);
 int i8259A_suspend(void);
 int i8259A_resume(void);
 
+void enable_IO_APIC(void);
 void setup_IO_APIC(void);
 void disable_IO_APIC(void);
 void setup_ioapic_dest(void);
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 9b8a972cf570..25a08b1ea6c6 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1273,7 +1273,7 @@ static void cf_check _print_IO_APIC_keyhandler(unsigned char key)
     __print_IO_APIC(0);
 }
 
-static void __init enable_IO_APIC(void)
+void __init enable_IO_APIC(void)
 {
     int i8259_apic, i8259_pin;
     int i, apic;
@@ -2067,8 +2067,6 @@ static void __init ioapic_pm_state_alloc(void)
 
 void __init setup_IO_APIC(void)
 {
-    enable_IO_APIC();
-
     if (acpi_ioapic)
         io_apic_irqs = ~0;	/* all IRQs go through IOAPIC */
     else
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index cf9bb220f90d..3a1a659082c6 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -1224,6 +1224,11 @@ void __init smp_prepare_cpus(void)
     verify_local_APIC();
 
     connect_bsp_APIC();
+
+    if ( !skip_ioapic_setup && nr_ioapics )
+        /* Sanitize the IO-APIC pins before enabling the lapic LVTERR/ESR. */
+        enable_IO_APIC();
+
     setup_local_APIC(true);
 
     if ( !skip_ioapic_setup && nr_ioapics )
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 14 16:06:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 16:06:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563703.881115 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKLIu-0003mc-8J; Fri, 14 Jul 2023 16:06:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563703.881115; Fri, 14 Jul 2023 16:06:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKLIu-0003mV-5D; Fri, 14 Jul 2023 16:06:00 +0000
Received: by outflank-mailman (input) for mailman id 563703;
 Fri, 14 Jul 2023 16:05:59 +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
 <SRS0=1dmA=DA=citrix.com=prvs=552b8e743=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qKLIt-0003P4-N4
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 16:05:59 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 50f2e729-2260-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 18:05:57 +0200 (CEST)
Received: from mail-dm6nam11lp2169.outbound.protection.outlook.com (HELO
 NAM11-DM6-obe.outbound.protection.outlook.com) ([104.47.57.169])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 14 Jul 2023 12:05:50 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB6438.namprd03.prod.outlook.com (2603:10b6:a03:396::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Fri, 14 Jul
 2023 16:05:48 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::e14d:fb6d:9e52:1524]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::e14d:fb6d:9e52:1524%4]) with mapi id 15.20.6588.024; Fri, 14 Jul 2023
 16:05:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 50f2e729-2260-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689350757;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=PoQ8cEOjWjcX9C/zqqTIDxpiW2o4BpROzTf2IY5cQSU=;
  b=K+1nxn9X7WjkexvQHLtYPAeT0cw99I8oHcpQCM6SqP36ciiIlClSqSdK
   1zMvCv5lseuzopDGM5eL/hg1eyYQPuXdZQxaFtsmOl78foGdKhB3rkBcr
   EtDofRA6AuNt+agQsKikHzEmC9vzCtXxFtlZ73hjlCazbRuGkAuK+peZs
   A=;
X-IronPort-RemoteIP: 104.47.57.169
X-IronPort-MID: 115550706
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:87ClVqmJ3nHThk4x5uopxEPo5gynJ0RdPkR7XQ2eYbSJt1+Wr1Gzt
 xIfXGHTMqrYYjOgKY8naYy/9UsBvZGBytFqSFdr+HwyESMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5QOGzhH5MbpETU2PByqgKmVrNrbSq
 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/
 f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3
 c4mCDlOVT6pvd2V7J3lUdFXuZ4+b9a+aevzulk4pd3YJdAPZMmaBonvu5pf1jp2gd1SF/HDY
 cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVkVM3iea8WDbWUoXiqcF9hEGXq
 3iA523kKhobKMae2XyO9XfEaurnxHqmBd9KS+XmnhJsqAXPwks2LRoZb2GQrtuWuw2yVulwc
 1NBr0LCqoB3riRHVOLVXRe1vXqFtR40QMdLHqsx7wTl4rXQyxaUAC4DVDEpQMwrsoo6SCIn0
 neNnsj1Hnp/vbuNU3Wf+7yI6zSoNkAowXQqYCYFSU4J5oflqYRq1xbXFI89Qeiyk8H/Hiz2z
 3aSti8iir4PjMkNkaKm4VTAhDHqrZ/MJuIo2jjqsquexlsRTOaYi0aAsDA3Md4owF6lc2S8
IronPort-HdrOrdr: A9a23:SZiS7606G7dVVCD2XHSLeAqjBJkkLtp133Aq2lEZdPU1SL38qy
 nKpp536faaslossR0b9uxoQZPwOE80lqQFg7X5X43DYOCOggLBEGgF1+XfKlbbak7DH4BmtJ
 uIRJIObOEYXWIQsS8j2njCLz/7+qjgzEl0v5a4856wd3ATV0i/1XYCNjqm
X-Talos-CUID: =?us-ascii?q?9a23=3AB+1Oe2mDR3cyIRiKNCmsZWB0uVDXOU/j7H6TGGG?=
 =?us-ascii?q?SM1lKZJLLUmerx/l50NU7zg=3D=3D?=
X-Talos-MUID: =?us-ascii?q?9a23=3AsWUbnw5IONkFHBzk04O5BvExxowwv6CJLWUKnq8?=
 =?us-ascii?q?8kMamGh0zNzqmo2yoF9o=3D?=
X-IronPort-AV: E=Sophos;i="6.01,205,1684814400"; 
   d="scan'208";a="115550706"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=j6fpsVqo8N+6HEZS/dQ6Cy6P/Ig6NeHiyH1UleLLeeRdDmZ6oO2vnSr9mvOnTSwiLXnlo0KLnxuwW9cW5ytMG2MR8tie0eY4Urx4zMNa0C9OrPReAO23cOUUuJiIYM5csYm6BNyXvsq3d3EoQlkmywkWsuKyz4vrCYFJ8qz9oYQvN8gG06d711Yz4oYwHgHHOchmeCM8HMWkcdzJZDSwotMTT+xLKPm8jouLTYB9NPJ6lAVilzaBdjJAVu73DMJsKJu0mEX7Vym/wYb8OpDyAX1oHi7ZJSLu+ZIVNsY39LUSdPe53BeCO/M8MOfh7BHZd5b/Uslrip8bC3owzzITOA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=twUQE7mTHxFLPlFtAgbZTzifOVeNNyhHf9eIklb82fo=;
 b=RBESy6eXNRp6baRBV68kWq6iM/JyQwPSqMAPo5yMz85kOjuRiCGjOWUdw3p7SQu8XFg0X0sXGGv/uM3fT8OQNRKzo7UyxKLh2kTgPgQQS0fzeY4pcq14ahOnJCuEEJzIFfmkOiwOnx9SrrMGmrHNpdLtSBL7lcaFDrwnLKfTB025tZY7LjGiCE1rXupiNhxQjvOCmtnh+BtYMS73A3bzNP29izaYH63onOLDFGNl/4QCvC2NBDZKWFxHUyJufZwJaJTHzasaZQUDy7QtomgQicm2cnkPAdcHX1uj6Ajs0EU1yIc/IKxV6ncimw/9c4LZtI3ouVS7X/n3trXdZrhROQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=twUQE7mTHxFLPlFtAgbZTzifOVeNNyhHf9eIklb82fo=;
 b=hwW1ltOFLw5M0UtTCh9i0gm6DWSFF2XiJZCCuCYGxN51X68yNsENU2mirGo+f7kvcNDK/aCEu7NzyVHf7yDMJytZnr/VWIf2NbLpwCgCpucIchyoIYJm7XAswqpYpxkzTmUw4FdopTTdAOYBI4pMMcOrq6rZzSON58PtZmNfjLI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 14 Jul 2023 18:05:42 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] x86/ioapic: sanitize IO-APIC pins before enabling the
 local APIC
Message-ID: <ZLFyVugKWItJklcu@MacBook-Air-de-Roger.local>
References: <ZKwZBQ_0Z2c7NJNL@MacBook-Air-de-Roger.local>
 <1f79491a-46f5-5293-e92f-0e2b0b3efb62@suse.com>
 <ZK1S1V71ZUIPjKqZ@MacBook-Air-de-Roger.local>
 <eb2e3b57-a423-cf52-0192-a344db33a58f@suse.com>
 <ZK6wcpHnh5OgHv4R@MacBook-Air-de-Roger.local>
 <d84482f4-8be6-e514-58a7-a529890c8feb@suse.com>
 <ZK7JwEhrB-70nlla@MacBook-Air-de-Roger.local>
 <6d0ed712-0807-33b6-1586-a0588086c3a7@suse.com>
 <ZK_gHltq-1se3fau@MacBook-Air-de-Roger.local>
 <c2de675d-b4cd-1040-efa2-1b8b90448d90@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <c2de675d-b4cd-1040-efa2-1b8b90448d90@suse.com>
X-ClientProxiedBy: LO4P123CA0039.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:152::8) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB6438:EE_
X-MS-Office365-Filtering-Correlation-Id: 5d52ee57-4ddb-407d-2089-08db8484300f
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	VViLyqFAEI8t4ZxuILGUHtdKF1QPf6FWUf5uXLeOfdTsBn6j9Hvyf24HF1Uf+SZGmv+btEgKEdYC+3Zt4WVdiBqB+KkBIL43UUNHffwEPG89dU2pVI/N8K03buAgnGlUgh8pwB8uDB1peENIv1zN76aPLEuzaPYCb5vcBpxvslpNkv6gmQxsxtOVVGQBhKA3TVpMd9ezb26v42u5NxJ/PoxoqoEzI86ZsL5NMP8K6fH3VvvST0/2WDZ99+8tHYqJUKc1uYPQccqs0xkg3EijT9LoVKTq3bGa38eW1cR/tm1JMU1/+bZc7pnpC2PQ6d15J1BnSJoZNKhXQi9EwrXqaIylO0f4q5Fnsv37gZ7/QsniIYIyFvgwyoBphBDr1QnovHuCl+niB7Q4asln1K4o2lKFrgj6plm0DlLCYLFA91TwFl/+4tQReC0kdQxGMimpgJ+payHoRiqQqhhws3t7Cg59BEacWZhjH7xRgaX/hwgKm8FKZwQUC2MkbILf3eyfp4f0qFvzNUKv09wtk/R3NRZRsOn4xGn+QWt9VWBumcBV8pQ/t+oVHb7RxDRl0QKB
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(136003)(346002)(396003)(366004)(451199021)(186003)(26005)(478600001)(6512007)(2906002)(53546011)(9686003)(4744005)(4326008)(41300700001)(66556008)(6916009)(316002)(5660300002)(66476007)(66946007)(8936002)(8676002)(6486002)(6666004)(54906003)(85182001)(6506007)(82960400001)(38100700002)(86362001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Z2E5NlNnSVh4L3BpN1dGRVlodURwWGs3VXFCMzNuMWd4bXg2TXl6V2xXVW1u?=
 =?utf-8?B?a2xwU1FZeWZIVWVaa0FvcTQzSm81d29YK1BuM2VDYnc1VzBNRGJaNmFQMWs5?=
 =?utf-8?B?WThHbGRNdGxIOU1MYjczODAvcnNKWVk3MC8xMFBhelc3T3lkdGNYMjRDSTRx?=
 =?utf-8?B?RklzVmxyVGdIcytWcnc1a2tSNEh0RlU4UFZMeFhxT1gxV2gveXFRR2xJa3l3?=
 =?utf-8?B?QXk1UmRkb1oyTWtLL2gvM1BJcjk5U3JiNVYvMkM2emh6MTFNSnVHOGZrZi9O?=
 =?utf-8?B?S2drL3RGelViQnVtamdKUXFZV2M5eGFqRmVndUFiVWkwVjNPWTdiNVRXRm5Z?=
 =?utf-8?B?aGhOYkZxdTVBeS9tTmpRN2ppdEF5WTJ4WDMzTWdBUkxHaW4xaUs4LzJxVXY4?=
 =?utf-8?B?Ykg3YXAzZVN6T1Y4SGJhSmtHanhDRVZnTTVpZWIvVnZESk9PYjMrRHFFRG1P?=
 =?utf-8?B?V3htM0Z6VmRDZWhaNUdUN3R5TERKeDNSdWl1bnlHU09JNE5uQkZDZ1ExUGZw?=
 =?utf-8?B?cUhPVmYrSWRkUDFXbmFGaDU2cVdmRE9HZWlaZUxiSExzWW1YN2lkYlB5RWMy?=
 =?utf-8?B?dXR2d0tuaitsREtvY3lHUV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Zbw8a3PT9zewVpPfMQ2vTjqx0+8O419FS2RzClTRTWzsoSrUvNhMbIkvQlpgDf3fj2knbzQb1feQjSoFi1PX68F1AhFRTipFP641viejvUvBcvBUoaX2cr+9E/MhK0E0B4yz/1ZAdYQOW2cw5aDi3MZuxtiPEVRYJWd4n/cbiT+SAy8/HpNmdbqeoe8UMKFcQrn4fUhKSv3SvJ+VD4TGftkXLW/MHUgxUVpovHcZ5f/eHjeZdMoq3O3Q2g3GK3rauyLupgtknY/HvLeuBnTKGa61pJg2Mtn19ZnHU6SL+zrCuDiIRmqv7PEGRXVUIxV7io/cUV+ph/4PQCnJnBMLqXnLb3IDhXh6l5R0/5Sy06uB3d4Y4cDUbCEP18g+ncWUJQIpW7f8iDNfZc9ac3RegkM5UC+ruWp6IV+vYIgmiaS+j01m7Pv85F346A5ZTjM5zOITNLX/zRCWnhwBLVBnqwIv9HMZVxt7bfoBFUWBTWSFoRwvHGnYrfhMyoN7Ilk2iP2qHWaFfLfCTcoDJ+STTTF9Vn1DG76MbdJqCJM9GEBeMk6718J9CM2wuBN7Rsql0q8dt0a7OwW6F2vJkjIrROkRaqH5b/sGwC+pKd9lysgduMPPqW2PdTzsEv3rnamw8EybQbIwmeUDgsbC3YZQBBVXaNtHwIaHsm6wbL2YJUjtvPj2o+n2phY
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5d52ee57-4ddb-407d-2089-08db8484300f
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 16:05:48.3332
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: hYBRKIcGtDSk5JEnQX0IwAyC/EL+a+F+YBmcPo6cvrghUYGx+k9XcaUsv890NLJD6xtEBkIAPUyIvhMHSD4ktQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB6438

On Thu, Jul 13, 2023 at 02:18:29PM +0200, Jan Beulich wrote:
> On 13.07.2023 13:29, Roger Pau MonnÃ© wrote:
> > So to recap, I think we are in agreement that calling enable_IO_APIC()
> > just ahead of the call to setup_local_APIC() is the preferred
> > solution?
> 
> Well, yes and no. My preferred course of action for the issue at hand
> would be to convert RTE 0 to ExtInt (under the mentioned set of
> conditions). I agree though that we also want to move the masking of
> RTEs, and for that I further agree with the placement mentioned above.

So I hacked up a change to set pin 0 to ExtINT mode (and avoid doing
the masking early), and I got:

(XEN) spurious 8259A interrupt: IRQ7.

This was a single interrupt, but still I think the masking is the
critical part to get backported.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 16:34:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 16:34:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563710.881125 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKLjz-0007eQ-Cw; Fri, 14 Jul 2023 16:33:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563710.881125; Fri, 14 Jul 2023 16:33:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKLjz-0007eJ-9n; Fri, 14 Jul 2023 16:33:59 +0000
Received: by outflank-mailman (input) for mailman id 563710;
 Fri, 14 Jul 2023 16:33:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qKLjy-0007eD-Nn
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 16:33:58 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKLjx-0007SW-KA; Fri, 14 Jul 2023 16:33:57 +0000
Received: from [54.239.6.186] (helo=[192.168.4.173])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKLjx-0003Lu-Bz; Fri, 14 Jul 2023 16:33:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=1ILi0ItHcgzrW8xZ+Ep/hwYSPduYCjt3oeIawq8gqTE=; b=eoVwxr4ZDFA34WHFXSBEAjVuz7
	2VS7PDIylJa/n92N3M7N9mbRtCFi2MCepORIzTbN3hS5xXCBjmc40Zht4y+raJh6Si119CH7bSQVQ
	6XwHS3pLCODMygNwdC6GApt7NHZnPnfql2th02JhuXZ5JNsx021yxje2d9Q7CPFWqoBI=;
Message-ID: <768da4a9-bcf9-0c13-a573-c535ecd7468f@xen.org>
Date: Fri, 14 Jul 2023 17:33:55 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH] iommu/ipmmu-vmsa: Add missing 'U' in IMTTLBR0_TTBR_MASK
 for shifted constant
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <olekstysh@gmail.com>
Cc: xen-devel@lists.xenproject.org,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230704203032.4062921-1-olekstysh@gmail.com>
 <alpine.DEB.2.22.394.2307051555460.761183@ubuntu-linux-20-04-desktop>
From: Julien Grall <julien@xen.org>
In-Reply-To: <alpine.DEB.2.22.394.2307051555460.761183@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 05/07/2023 23:55, Stefano Stabellini wrote:
> On Tue, 4 Jul 2023, Oleksandr Tyshchenko wrote:
>> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>>
>> With enabling both CONFIG_UBSAN and CONFIG_IPMMU_VMSA I have got the following
>> splat when an IOMMU driver tried to setup page tables:
>>
>> (XEN) ipmmu: /soc/iommu@e67b0000: d1: Set IPMMU context 1 (pgd 0x77fe90000)
>> (XEN) ================================================================================
>> (XEN) UBSAN: Undefined behaviour in drivers/passthrough/arm/ipmmu-vmsa.c:558:51
>> (XEN) left shift of 1048575 by 12 places cannot be represented in type 'int'
>> (XEN) Xen WARN at common/ubsan/ubsan.c:172
>> (XEN) ---[ Xen-4.18-unstable  arm64  debug=y ubsan=y  Tainted:      S ]----
>> ...
>>
>> This points to shifted constant in IMTTLBR0_TTBR_MASK. Fix that by adding
>> missing 'U' to it.
>>
>> This should also address MISRA Rule 7.2:
>>
>> A "u" or "U" suffix shall be applied to all integer constants that
>> are represented in an unsigned type.
>>
>> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 
> Acked-by: Stefano Stabellini <sstabellini@kernel.org>

This is now committed.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 16:35:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 16:35:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563713.881135 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKLlQ-0008Do-Nn; Fri, 14 Jul 2023 16:35:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563713.881135; Fri, 14 Jul 2023 16:35:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKLlQ-0008Dh-Kz; Fri, 14 Jul 2023 16:35:28 +0000
Received: by outflank-mailman (input) for mailman id 563713;
 Fri, 14 Jul 2023 16:35:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qKLlP-0008Da-4V
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 16:35:27 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKLlO-0007US-Og; Fri, 14 Jul 2023 16:35:26 +0000
Received: from [54.239.6.186] (helo=[192.168.4.173])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKLlO-0003QQ-Ii; Fri, 14 Jul 2023 16:35:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=K0puUX0oaV0OKEDPKD6QMy3pyL6XizJv3UaaAEVJ54s=; b=gU+3esDR8CnS+oMeSWkRSeqcYG
	XnrZTua+oGu6c4vMDgiPBhS7MkNgmhVcBVaIQlgo64SZdr+ESDo+qTiENs/zwiYp9aBj9q7cMk/82
	IfaFc5Vdi0BOlk9cb4mRALz6ZkXBlaXD5EgFVTKh4TkvZ47Y6jSXyLJZ4RuOdlE9p4Zk=;
Message-ID: <cfd812c0-07cc-eb7b-1908-0327b6a915d2@xen.org>
Date: Fri, 14 Jul 2023 17:35:24 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH 2/2] xen/arm: Account for domU dtb bootmodule size
 separately
Content-Language: en-US
To: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230711082931.5402-1-michal.orzel@amd.com>
 <20230711082931.5402-3-michal.orzel@amd.com>
 <8bc1ed0e-3ad6-2243-4dd6-a88dd0ee00f8@xen.org>
 <b39b19a4-9649-173b-bb05-518702d05873@amd.com>
 <66997c9c-d0d9-fce3-e5bd-a4f41cf0de91@xen.org>
 <4ba51e3c-d6c4-5d0d-1517-fceebbe516e6@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <4ba51e3c-d6c4-5d0d-1517-fceebbe516e6@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 14/07/2023 08:04, Michal Orzel wrote:
> Thanks. So, let's keep it as is and one day we may just choose a side
> and do refactoring globally for consistency.

The series is now committed.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 16:45:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 16:45:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563716.881145 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKLuU-0001MV-IY; Fri, 14 Jul 2023 16:44:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563716.881145; Fri, 14 Jul 2023 16:44:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKLuU-0001MO-G2; Fri, 14 Jul 2023 16:44:50 +0000
Received: by outflank-mailman (input) for mailman id 563716;
 Fri, 14 Jul 2023 16:44:49 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qKLuT-0001MI-BY
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 16:44:49 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKLuS-0007iN-S6; Fri, 14 Jul 2023 16:44:48 +0000
Received: from [54.239.6.186] (helo=[192.168.4.173])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qKLuS-0003vJ-L2; Fri, 14 Jul 2023 16:44:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=MHaiPLNNQxAgcUw20mMmJkVlLrmOPBNeCOcLSNP13Rs=; b=mCeDt+JaAyGaGgl4Ba5t9/+Uxx
	HfaA4k38qXb1392Xc6bD3o+gWqyjGloEPc6exc2Ogp0RiR2CN6mQNs4LGXLX6HAACV5ce0GP/FiDr
	cWP2qQCkKtS42uBMGML0DoFS6hx1PEDCXYUdoWf0ey6J/3Jxc/zC6wlFxB22Wam5binU=;
Message-ID: <e7ff51c6-7408-8b39-e682-e9a973c4b29d@xen.org>
Date: Fri, 14 Jul 2023 17:44:46 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 31/52] xen/mpu: make early_fdt_map support in MPU
 systems
Content-Language: en-US
To: Penny Zheng <penny.zheng@arm.com>, Ayan Kumar Halder <ayankuma@amd.com>,
 xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>, Wei Chen <wei.chen@arm.com>,
 "Volodymyr_Babchuk@epam.com" <Volodymyr_Babchuk@epam.com>
References: <20230626033443.2943270-1-Penny.Zheng@arm.com>
 <20230626033443.2943270-32-Penny.Zheng@arm.com>
 <c2a779e5-51a9-f0c8-4c00-a568ff4bde83@amd.com>
 <a381b1b0-d18a-8fea-56a4-d88c65bd3cea@arm.com>
 <9530f9f8-795b-783a-bc74-e30a3c5c2fd3@amd.com>
 <baed1eac-0f9a-a85a-d4cc-feef772870db@xen.org>
 <c070054d-3f92-ecd2-4f04-a97c5a84d3d7@amd.com>
 <c05ac82d-f9bb-5d52-8b7d-df44d9043a66@xen.org>
 <bd6d9646-f0a8-5341-b4ce-7eca1d6153dc@arm.com>
 <93e0e360-d7f2-1987-a0a6-73420c55afcd@xen.org>
 <23275eba-3c1e-a51c-b248-7f7625671750@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <23275eba-3c1e-a51c-b248-7f7625671750@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 13/07/2023 04:12, Penny Zheng wrote:
>>>
>>> Thanks ayan for pointing out that RES0 is not suitable for storing 
>>> software-only flags, agreed.
>>>
>>> Then, maybe we should refine the existing "struct pr_t" to store these
>>> sw bits, like:
>>> ```
>>> typedef union {
>>> Â Â Â Â  struct {
>>> Â Â Â Â Â Â Â  uint8_t tran:1; /* Transient region */
>>> Â Â Â Â Â Â Â  uint8_t p2m_type:4; /* Used to store p2m types.*/
>>
>> Why do you need the p2m_type?
>>
> 
> I inherited the usage from MMU. Right now, in commit "[PATCH v3 46/52] 
> xen/mpu: look up entry in p2m table", we introduce the first usage to
> tell whether it is a valid P2M MPU memory region. In the future,
> we may also use it to check whether it works as RAM region(p2m_ram_rw).

I find a bit odd to use p2m_type to decide whether this is an MPU memory 
region describing guest information. It would make more sense to 
introduce a boolean 'guest' for now. We can add the type if necessary.

> 
>>> Â Â Â Â  };
>>> Â Â Â Â  uint8_t bits;
>>> } pr_flags;
>>>
>>> /* MPU Protection Region */
>>> typedef struct {
>>> Â Â Â Â Â Â Â Â  prbar_t prbar;
>>> Â Â Â Â Â Â Â Â  prlar_t prlar;
>>> Â Â Â Â Â pr_flags flags;
>>> } pr_t;
>>> ```
>>> The drawback is that, considering the padding, "struct pr_t" expands 
>>> from 16 bytes to 24 bytes.
>>
>> For clarifications, pr_t is going to be used to create an array in 
>> Xen, right? If so, what's the expected size of the array?
>>
> 
> Yes, it is going to be an array. And the maximum length is 255.
> MPUIR_EL2 identifies the number of regions supported by the EL2 MPU,
> which is 8-bits wide.
> The original 16 bytes, even with 255 regions at most, will take up
> less than 4KB. One page is enough. The following definition could have 
> covered all scenarios.
> ```
> /* EL2 Xen MPU memory region mapping table. */
> pr_t __aligned(PAGE_SIZE) __section(".data.page_aligned")
>  Â Â Â Â  xen_mpumap[ARM_MAX_MPU_MEMORY_REGIONS];
> ```
Can you explain why you want the array to be page-aligned?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 17:41:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 17:41:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563721.881159 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKMn9-00085k-It; Fri, 14 Jul 2023 17:41:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563721.881159; Fri, 14 Jul 2023 17:41:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKMn9-00085d-GI; Fri, 14 Jul 2023 17:41:19 +0000
Received: by outflank-mailman (input) for mailman id 563721;
 Fri, 14 Jul 2023 17:41:17 +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
 <SRS0=GXWP=DA=xenbits.xen.org=andrewcoop@srs-se1.protection.inumbo.net>)
 id 1qKMn7-00083u-Se
 for xen-devel@lists.xen.org; Fri, 14 Jul 2023 17:41:17 +0000
Received: from mail.xenproject.org (mail.xenproject.org [104.130.215.37])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9e7e1b83-226d-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 19:41:14 +0200 (CEST)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1qKMmq-0000i8-Up; Fri, 14 Jul 2023 17:41:00 +0000
Received: from andrewcoop by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1qKMmq-00035B-SS; Fri, 14 Jul 2023 17:41:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9e7e1b83-226d-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:CC:From:To:MIME-Version:
	Content-Transfer-Encoding:Content-Type;
	bh=gxB4B4uIvI6wAiFwKGJzyX3wE3vX8wzw64hKr8BxA9I=; b=FXF2NKoFKFfVrspdb9BJ/B/frR
	8W+LCdD1qV75H2UAogqF38xZnScWubmNwXpKQySknnKHr5impkoj7BWMp98CdeAzKJkxAW4ltoOSV
	EDXn1LNqXMD7+5wlk7QQMxOuLsHxi/jf7Wf6qJG5cnS7J3PunBsJ/tPzrcUs0aM3eJvo=;
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.509 (Entity 5.509)
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
 xen-users@lists.xen.org, oss-security@lists.openwall.com
From: Xen.org security team <security@xen.org>
CC: Xen.org security team <security-team-members@xen.org>
Subject: Xen Security Notice 1 v1 - winpvdrvbuild.xenproject.org
 potentially compromised
Message-Id: <E1qKMmq-00035B-SS@xenbits.xenproject.org>
Date: Fri, 14 Jul 2023 17:41:00 +0000

--=separator
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

                     Xen Security Notice 1

         winpvdrvbuild.xenproject.org potentially compromised

ISSUE DESCRIPTION
=================

Software running on the Xen Project hosted subdomain
winpvdrvbuild.xenproject.org is outdated and vulnerable to several
CVEs.  Some of the reported issues include remote code execution.  The
affected host was running the Jenkins build system for the Windows PV
Drivers subproject.

IMPACT
======

Since the list of CVEs reported include remote code execution we no
longer have confidence that binaries previously available at:

https://xenbits.xen.org/pvdrivers/win/

are trustworthy.  This includes binaries signed with Xen Project's EV
key that is cross-signed by Microsoft.

Note that the source code for the windows drivers, hosted on
xenbits.xen.org is in a separate system and we are confident that it
has not been tampered with.  The EV key was also not available to the
possibly compromised system.

ACTIONS TAKEN
=============

The possibly compromised system has been decommissioned.

We have removed all previous binaries from:

https://xenbits.xen.org/pvdrivers/win/

A new set of drivers based on the current master branch
(9.0-unstable) and built on a trusted environment have been uploaded
on the same folder with the following hashes:

$ sha256sum xen*.tar
b089e46d52ffc64a14799c609272ccdded805c1552a88b45d95a64a27e775de7  xenbus.tar
afc6f11f9078cb457daa000b8b8d8ab69656d3950e7afbf6f40aaa5da217301a  xencons.tar
7bbcedcda5e2ffa8ab32eb3d207d1c7db5b91e22926b26d75750bfadde6611f0  xenhid.tar
a8f3344e370647696e3ed39201f5c9db693aca1c093a638fde8b7a928a4416c2  xeniface.tar
560d7049f5e321545dda25c26b5f56e0975a7f62d35629f4c9a73f0fbd148cf3  xennet.tar
9cb34cd135aab045a2401098c4044c95dbd179c454718e43045e433401b8e3dd  xenvbd.tar
47c1b9bc6e90e20d3f524036a3171cf7f8da1d94186febbae0d4a108db7bb3b5  xenvif.tar
09a4b108a9d3fca699c3c31aeb4836cfee2538e588462b0646dcccbde42a4263  xenvkbd.tar

ACTIONS IN PROGRESS
===================

The security team is attempting to inspect existing binaries to
determine whether there are any obvious signs of tampering.

CREDITS
=======

We would like to thank Mahmud Hasan for bringing this to our
attention.

WHAT IS AN XSN
==============

A Xen Security Notice is a mechanism the Security Team was already in
the process of introducing, for providing official communication of
security-relevant information that is not of the form that fits in the
normal XSA template.  Please bear with us as we find the right balance
while trying to fast-track it into use.
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmSxe3YMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZgwgH/1serMIChH2tFlbU0HSgVk07KCO17lFcCJnhDSA8
uEv3uYiW8NCZEwaD2wmgxN9tW7yTIoeSrsnTyU9D305M6gy3F9g1XcktAv9HhtEO
fS/Pdq1q/ec4vStOYUzx6yG/2GIKNYny5Um4X2Odr/dvYcdZJPkmeJtv6yIa5wSC
q3jCou/VoBCwXUGqlqzRdRsJ+srmsFfmsTn/oNuM28gkV+qRAUc+J6z+psObo2yp
KE/Jgl9B6Nq2+d7sbcgto77a/4FrgtW01qFgIbvQPcE8BBlPF4xymKeCBSGEY/yL
MrOyYpw81cOd0IvSVdQglW63+DO76EksBJJWQbtazwhbPDs=
=jmGB
-----END PGP SIGNATURE-----

--=separator--


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 17:55:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 17:55:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563787.881200 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKN0c-0003EN-P9; Fri, 14 Jul 2023 17:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563787.881200; Fri, 14 Jul 2023 17:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKN0c-0003EG-LD; Fri, 14 Jul 2023 17:55:14 +0000
Received: by outflank-mailman (input) for mailman id 563787;
 Fri, 14 Jul 2023 17:55:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKN0b-0003E6-BY; Fri, 14 Jul 2023 17:55:13 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKN0b-00018P-4g; Fri, 14 Jul 2023 17:55:13 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKN0a-0001pi-R2; Fri, 14 Jul 2023 17:55:12 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qKN0a-0004dH-Qa; Fri, 14 Jul 2023 17:55:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=clvLsVewBq2FFBFVbZ3lH1errGZbWPYA6RrTeZeB21Q=; b=RIP1MCieMXnVKaNgxPi3IAHfXS
	AeZAEmv0Uqhnj4YSpzrLzHtfM/kO9chuxWBDCz3b4XQrMJzrrFgc6NcjAqXh6prN2e8AmYIGAYZwr
	DEJkOb3StWtkx5YZvbjzqWifN/vsI72Zok1WkYM9OZ1cq/SydsqgyczyenSGQt8Z9HTg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181789-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 181789: tolerable FAIL - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:xen-boot:fail:heisenbug
    libvirt:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=14026db9b0e25739ea30685bd643ff23aca30588
X-Osstest-Versions-That:
    libvirt=ded44a0406c82c560b654ac69ef4259add152eb4
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 14 Jul 2023 17:55:12 +0000

flight 181789 libvirt real [real]
flight 181796 libvirt real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181789/
http://logs.test-lab.xenproject.org/osstest/logs/181796/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-libvirt      8 xen-boot            fail pass in 181796-retest
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail pass in 181796-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail blocked in 181769
 test-armhf-armhf-libvirt 16 saverestore-support-check fail in 181796 like 181769
 test-armhf-armhf-libvirt    15 migrate-support-check fail in 181796 never pass
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181769
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 libvirt              14026db9b0e25739ea30685bd643ff23aca30588
baseline version:
 libvirt              ded44a0406c82c560b654ac69ef4259add152eb4

Last test of basis   181769  2023-07-12 04:20:30 Z    2 days
Testing same since   181789  2023-07-14 04:21:56 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Boris Fiuczynski <fiuczy@linux.ibm.com>
  Jim Fehlig <jfehlig@suse.com>
  Jonathon Jongsma <jjongsma@redhat.com>
  Michal Privoznik <mprivozn@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-libvirt-vhd                                 fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   ded44a0406..14026db9b0  14026db9b0e25739ea30685bd643ff23aca30588 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 19:36:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 19:36:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563798.881210 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKOae-0005vK-Uz; Fri, 14 Jul 2023 19:36:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563798.881210; Fri, 14 Jul 2023 19:36:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKOae-0005vD-SK; Fri, 14 Jul 2023 19:36:32 +0000
Received: by outflank-mailman (input) for mailman id 563798;
 Fri, 14 Jul 2023 19:36:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKOad-0005v3-JL; Fri, 14 Jul 2023 19:36:31 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKOad-0003bI-6U; Fri, 14 Jul 2023 19:36:31 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKOac-0004EL-QL; Fri, 14 Jul 2023 19:36:30 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qKOac-0000C0-Pw; Fri, 14 Jul 2023 19:36:30 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=kBxxLqYLn5Todz3N2QR47bh1vc01WoyVLN1DhzRauRo=; b=gSBsbnlc+DVQe6LmE2fNnxy0Ey
	n9XqNy5y887eNL1H+YvamFHRDQn0gkbM/aGzB1cQbgANMQLO6ZKzS9psj1qPunRnaRmbGzRRsKO5f
	wf/2LXddCltt43J6XLugLCD2cDWDrHHjiGoVwk/M4hqfIFxvZ6UzXpZ853F5GSH/8vaI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181798-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181798: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=d27d274ffab06b42e5680073db11b592d282d53d
X-Osstest-Versions-That:
    xen=11961f0a6700fb62edb17930fcf6c3f5453c133b
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 14 Jul 2023 19:36:30 +0000

flight 181798 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181798/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  d27d274ffab06b42e5680073db11b592d282d53d
baseline version:
 xen                  11961f0a6700fb62edb17930fcf6c3f5453c133b

Last test of basis   181788  2023-07-13 19:00:25 Z    1 days
Testing same since   181798  2023-07-14 17:01:54 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Julien Grall <jgrall@amazon.com>
  Michal Orzel <michal.orzel@amd.com>
  Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
  Stefano Stabellini <sstabellini@kernel.org>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   11961f0a67..d27d274ffa  d27d274ffab06b42e5680073db11b592d282d53d -> smoke


From xen-devel-bounces@lists.xenproject.org Fri Jul 14 20:53:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 20:53:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563804.881219 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKPmb-0006QB-94; Fri, 14 Jul 2023 20:52:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563804.881219; Fri, 14 Jul 2023 20:52:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKPmb-0006Q4-5r; Fri, 14 Jul 2023 20:52:57 +0000
Received: by outflank-mailman (input) for mailman id 563804;
 Fri, 14 Jul 2023 20:52:55 +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
 <SRS0=NZ7Y=DA=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qKPmZ-0006Py-Qj
 for xen-devel@lists.xenproject.org; Fri, 14 Jul 2023 20:52:55 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 64bddefe-2288-11ee-8611-37d641c3527e;
 Fri, 14 Jul 2023 22:52:51 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id CC5C5828574E;
 Fri, 14 Jul 2023 15:52:48 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id IxRrqKKg5imE; Fri, 14 Jul 2023 15:52:47 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 422FE8285BFE;
 Fri, 14 Jul 2023 15:52:47 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id DeNnmfWwH1kr; Fri, 14 Jul 2023 15:52:47 -0500 (CDT)
Received: from [10.11.0.2] (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 4819E828574E;
 Fri, 14 Jul 2023 15:52:46 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 64bddefe-2288-11ee-8611-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 422FE8285BFE
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1689367967; bh=WFB8iyv21E5BDylK+vUh6mU+N/ndugCfCLrdDQVnPz8=;
	h=Message-ID:Date:MIME-Version:To:From;
	b=biYBljfuUuCjt1aoTuII4cSsctanVWYOEsmvtyyze1XCQ3zdnXCSsey7jz/sDT6nW
	 Nq4fOEfK+gR3GumCR/k//t1tXs1OGwe9fx8F7enuyY5ehlsKc2yDhuL+ryNgEHbrbz
	 mqaiRD5F0oPTE2KbtcajreyuWA2z9dZ9LbSpIBZE=
X-Virus-Scanned: amavisd-new at rptsys.com
Message-ID: <6af948f7-562d-65cc-ca1e-30bc8db90d02@raptorengineering.com>
Date: Fri, 14 Jul 2023 15:52:45 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: XenSummit: Empty per-arch files
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 xen-devel <xen-devel@lists.xenproject.org>
Cc: Jan Beulich <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bobby Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Timothy Pearson <tpearson@raptorengineering.com>
References: <2aabfb63-1a2f-bb02-488a-ea79136bc6c0@citrix.com>
From: Shawn Anastasio <sanastasio@raptorengineering.com>
In-Reply-To: <2aabfb63-1a2f-bb02-488a-ea79136bc6c0@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 6/28/23 6:32 AM, Andrew Cooper wrote:
> Hello,

Hi Andrew,

> This wasn't a formal discussion point at XenSummit, but Oleksii pointed
> out that it was still a problem, hence this thread.
> 
> As we take on more architectures, it becomes more and more important for
> things to be handled in a mostly-common way.  With that comes quite a
> lot of <xen/foo.h> including <asm/foo.h>, and the arch one being a stub
> in simple cases.
>
> It would be nice to get rid of the stub files; they're irritating to
> deal with, both when refactoring and simply for the file bloat they create.

This is definitely something that would be great to see from the Power
side of things, especially as we're getting to the point where we'd like
to start dropping the build overrides in arch.mk and building the rest
of xen/common/.

As we get to that point, I was wonder if upstream would be fine with
submission of patches that add stub files for ppc in the interim, to be
removed later when this proposal is finalized and a solution is decided
upon. It'd obviously be best to avoid too much duplication of effort,
but at the same time we'd like to avoid getting blocked on progressing.

> ~Andrew

Thanks,
Shawn



From xen-devel-bounces@lists.xenproject.org Fri Jul 14 20:59:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Jul 2023 20:59:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563817.881263 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKPtB-0007Ub-BO; Fri, 14 Jul 2023 20:59:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563817.881263; Fri, 14 Jul 2023 20:59:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKPtB-0007UU-62; Fri, 14 Jul 2023 20:59:45 +0000
Received: by outflank-mailman (input) for mailman id 563817;
 Fri, 14 Jul 2023 20:59:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKPt9-0007UK-5s; Fri, 14 Jul 2023 20:59:43 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKPt9-0005XN-3X; Fri, 14 Jul 2023 20:59:43 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKPt8-00065c-NS; Fri, 14 Jul 2023 20:59:42 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qKPt8-0001oT-N5; Fri, 14 Jul 2023 20:59:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=MRncyz4K2y9wtC3VvD5y6rxx0j1ZuFWLJA9sH7qHOeY=; b=Z1yeEx0wFZDTG2D8mpJcaSjFnM
	IatWiqhtUGG8fIgz8FQ0ygu342dZDA5oy0+Nai+K2Ar14Y2QMA9ctjlJSnE7B+qkIoTCzsZBpNNYw
	wAME0Ri494oQJvEW5Jkw2+c9GTaaZsZmw+jw/xB0PsVEQsnnRmyRdftQDSIxpvHGMDz0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181791-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181791: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-xl-qemuu-debianhvm-i386-xsm:xen-install:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt-qcow2:guest-start:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=11961f0a6700fb62edb17930fcf6c3f5453c133b
X-Osstest-Versions-That:
    xen=0a834e953b01ec25c412369d7a5b8b57d340ac60
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 14 Jul 2023 20:59:42 +0000

flight 181791 xen-unstable real [real]
flight 181800 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181791/
http://logs.test-lab.xenproject.org/osstest/logs/181800/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm 7 xen-install fail pass in 181800-retest
 test-armhf-armhf-libvirt-qcow2 13 guest-start       fail pass in 181800-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check fail in 181800 like 181777
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check fail in 181800 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181777
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181777
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181777
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181777
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181777
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181777
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181777
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181777
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181777
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181777
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181777
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 xen                  11961f0a6700fb62edb17930fcf6c3f5453c133b
baseline version:
 xen                  0a834e953b01ec25c412369d7a5b8b57d340ac60

Last test of basis   181777  2023-07-12 21:38:40 Z    1 days
Failing since        181780  2023-07-13 09:21:22 Z    1 days    2 attempts
Testing same since   181791  2023-07-14 05:36:50 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Christian Lindig <christian.lindig@cloud.com>
  Edwin TÃ¶rÃ¶k <edwin.torok@cloud.com>
  Elliott Mitchell <ehem+xen@m5p.com>
  Jan Beulich <jbeulich@suse.com>
  Julien Grall <jgrall@amazon.com>
  Luca Fancellu <luca.fancellu@arm.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Rahul Singh <rahul.singh@arm.com>
  Stefano Stabellini <sstabellini@kernel.org>
  Stefano Stabellini <stefano.stabellini@amd.com>
  Stewart Hildebrand <stewart.hildebrand@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  fail    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   0a834e953b..11961f0a67  11961f0a6700fb62edb17930fcf6c3f5453c133b -> master


From xen-devel-bounces@lists.xenproject.org Sat Jul 15 01:15:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 15 Jul 2023 01:15:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563837.881276 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKTs0-0006y3-7H; Sat, 15 Jul 2023 01:14:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563837.881276; Sat, 15 Jul 2023 01:14:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKTs0-0006xw-1z; Sat, 15 Jul 2023 01:14:48 +0000
Received: by outflank-mailman (input) for mailman id 563837;
 Sat, 15 Jul 2023 01:14:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKTrz-0006xm-Bu; Sat, 15 Jul 2023 01:14:47 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKTrz-0001zk-01; Sat, 15 Jul 2023 01:14:47 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKTry-00013S-4p; Sat, 15 Jul 2023 01:14:46 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qKTry-0006XG-4L; Sat, 15 Jul 2023 01:14:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=2mcDEyhoWKeFunZ6oKxux+tW1wtnhS+QiK4WWtnQhu8=; b=gwj6+xABOPdZXniIMUPYn/vm3j
	cSGy1BXWYzVJRatP2UrqTaLGelLfDYwfA+3w8O7Z/WSBBwTgcRoQnuOJ+UlMm4przhhW4SKydf+OA
	9iwgaS5BGPWsCiXP2J9E76VS4r73GqyWyaL6yPPkGZTDVLvq8m1U5o//iGMt0ZxFdc+w=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181802-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181802: regressions - FAIL
X-Osstest-Failures:
    ovmf:test-amd64-i386-xl-qemuu-ovmf-amd64:xen-install:fail:regression
X-Osstest-Versions-This:
    ovmf=e674096accc8e57cd0dd84679905e1222423251e
X-Osstest-Versions-That:
    ovmf=ff3382a51ca726a90f49623a2b2d2e8ad8459ce2
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 15 Jul 2023 01:14:46 +0000

flight 181802 ovmf real [real]
flight 181804 ovmf real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181802/
http://logs.test-lab.xenproject.org/osstest/logs/181804/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-xl-qemuu-ovmf-amd64  7 xen-install       fail REGR. vs. 181786

version targeted for testing:
 ovmf                 e674096accc8e57cd0dd84679905e1222423251e
baseline version:
 ovmf                 ff3382a51ca726a90f49623a2b2d2e8ad8459ce2

Last test of basis   181786  2023-07-13 17:42:16 Z    1 days
Testing same since   181802  2023-07-14 23:12:30 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Tom Lendacky <thomas.lendacky@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit e674096accc8e57cd0dd84679905e1222423251e
Author: Tom Lendacky <thomas.lendacky@amd.com>
Date:   Fri Jul 14 15:28:26 2023 -0500

    OvmfPkg/ResetVector: Fix assembler bit test flag check
    
    Commit 63c50d3ff2854a76432b752af4f2a76f33ff1974 changed the check that is
    used to determine if SEV-ES is active. Originally, a CMP instruction with
    a supporting JZ instruction was used for the check. It was changed to use
    the BT instruction but not JZ instruction. The result of a BT instruction
    changes the the carry flag (CF) and not the zero flag (ZF). As a result,
    the wrong condition is being checked. Update the JZ to a JNC to properly
    detect if SEV-ES is active.
    
    Fixes: 63c50d3ff285 ("OvmfPkg/ResetVector: cache the SEV status MSR...")
    Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>


From xen-devel-bounces@lists.xenproject.org Sat Jul 15 02:35:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 15 Jul 2023 02:35:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563843.881289 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKV7i-0007IZ-NA; Sat, 15 Jul 2023 02:35:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563843.881289; Sat, 15 Jul 2023 02:35:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKV7i-0007IR-J7; Sat, 15 Jul 2023 02:35:06 +0000
Received: by outflank-mailman (input) for mailman id 563843;
 Sat, 15 Jul 2023 02:35:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKV7g-0007IH-UD; Sat, 15 Jul 2023 02:35:04 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKV7g-0004DI-Oh; Sat, 15 Jul 2023 02:35:04 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKV7f-0003hr-Vq; Sat, 15 Jul 2023 02:35:04 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qKV7f-0007lO-VF; Sat, 15 Jul 2023 02:35:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Oouh7D0lChZLTTtQ8ZFK7pTC2cCaeE748JtXkLDHh+U=; b=mUWUq+F3N/tqiriwGADNupESxa
	hLzHTUdb7lknloO+KlvNB07lWGeJlQp17HujpNIVEjON1BQyV3wbwYOLgjLuAeKuz1l7a8lIeCLSL
	XCNO9l4E9YrB9DgCKb2svSaXVZjdI0XUf0aOqtayu59YrfYjt+6nzjEm8VOFzynkeTK4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181794-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181794: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:guest-start/debianhvm.repeat:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=4b810bf037e524b54669acbe4e0df54b15d87ea1
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 15 Jul 2023 02:35:03 +0000

flight 181794 linux-linus real [real]
flight 181803 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181794/
http://logs.test-lab.xenproject.org/osstest/logs/181803/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-credit2 20 guest-localmigrate/x10 fail pass in 181803-retest
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 18 guest-localmigrate/x10 fail pass in 181803-retest
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 20 guest-start/debianhvm.repeat fail pass in 181803-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                4b810bf037e524b54669acbe4e0df54b15d87ea1
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   89 days
Failing since        180281  2023-04-17 06:24:36 Z   88 days  176 attempts
Testing same since   181794  2023-07-14 11:50:07 Z    0 days    1 attempts

------------------------------------------------------------
3756 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 626600 lines long.)


From xen-devel-bounces@lists.xenproject.org Sat Jul 15 04:34:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 15 Jul 2023 04:34:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563851.881302 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKWyk-0002hK-FH; Sat, 15 Jul 2023 04:33:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563851.881302; Sat, 15 Jul 2023 04:33:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKWyk-0002hD-BJ; Sat, 15 Jul 2023 04:33:58 +0000
Received: by outflank-mailman (input) for mailman id 563851;
 Sat, 15 Jul 2023 04:33:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKWyi-0002h3-G6; Sat, 15 Jul 2023 04:33:56 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKWyi-0006ou-4d; Sat, 15 Jul 2023 04:33:56 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKWyh-0000VQ-Ly; Sat, 15 Jul 2023 04:33:55 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qKWyh-0006H3-Lc; Sat, 15 Jul 2023 04:33:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=kQIZA4ocPK0BXDhFzZpyfV9+qB6ZUqKUDS24ytwrsNk=; b=DUIKZTRcNxXHhTk2/OY4/pckyV
	nwILc9AxkHgI4UPPOOTDiVz6Ea29TIANxo30aBIDHgpijOLoBpDoVCAsaLM8bToz254m8RiQJRKwh
	PMsLE4yupB4MKo47r62nM975AqobDFrpWKM6zBzIIzBs80hrZ87vcB2dipOucUiyY8BE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181806-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181806: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=e674096accc8e57cd0dd84679905e1222423251e
X-Osstest-Versions-That:
    ovmf=ff3382a51ca726a90f49623a2b2d2e8ad8459ce2
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 15 Jul 2023 04:33:55 +0000

flight 181806 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181806/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 e674096accc8e57cd0dd84679905e1222423251e
baseline version:
 ovmf                 ff3382a51ca726a90f49623a2b2d2e8ad8459ce2

Last test of basis   181786  2023-07-13 17:42:16 Z    1 days
Testing same since   181802  2023-07-14 23:12:30 Z    0 days    2 attempts

------------------------------------------------------------
People who touched revisions under test:
  Tom Lendacky <thomas.lendacky@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   ff3382a51c..e674096acc  e674096accc8e57cd0dd84679905e1222423251e -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sat Jul 15 06:31:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 15 Jul 2023 06:31:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563863.881312 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKYns-0006pM-9x; Sat, 15 Jul 2023 06:30:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563863.881312; Sat, 15 Jul 2023 06:30:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKYns-0006pF-5Q; Sat, 15 Jul 2023 06:30:52 +0000
Received: by outflank-mailman (input) for mailman id 563863;
 Sat, 15 Jul 2023 06:30:51 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKYnr-0006p5-Mu; Sat, 15 Jul 2023 06:30:51 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKYnr-0001cY-DX; Sat, 15 Jul 2023 06:30:51 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKYnr-0005Wr-1H; Sat, 15 Jul 2023 06:30:51 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qKYnr-00059q-0u; Sat, 15 Jul 2023 06:30:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=YdOC9igA45arSBBlqoQtFjMIjW9AmS09AUXBfga8Dzk=; b=g7v/Q39KeC4E0QJ3zE3yPEUlfb
	HVZAciX2Ks3ZR2kRTLFpxcuZvHFZp7Q9Xn8tpPOxXuZPAQh/UrnKbybafQv8u+EGw7bo8QUHJx3bR
	yBK+9vA4OIupf27KvtoSO1TG25BSHSoI4/0LYEb1yGnRNLfj7MBBuGmDjej+0SaTYUjg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181801-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181801: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-xl-vhd:guest-start:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=d27d274ffab06b42e5680073db11b592d282d53d
X-Osstest-Versions-That:
    xen=11961f0a6700fb62edb17930fcf6c3f5453c133b
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 15 Jul 2023 06:30:51 +0000

flight 181801 xen-unstable real [real]
flight 181809 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181801/
http://logs.test-lab.xenproject.org/osstest/logs/181809/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-vhd      13 guest-start         fail pass in 181809-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check fail blocked in 181791
 test-armhf-armhf-xl-vhd     14 migrate-support-check fail in 181809 never pass
 test-armhf-armhf-xl-vhd 15 saverestore-support-check fail in 181809 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181791
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181791
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181791
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181791
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181791
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181791
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181791
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181791
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181791
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181791
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181791
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 xen                  d27d274ffab06b42e5680073db11b592d282d53d
baseline version:
 xen                  11961f0a6700fb62edb17930fcf6c3f5453c133b

Last test of basis   181791  2023-07-14 05:36:50 Z    1 days
Testing same since   181801  2023-07-14 21:08:37 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Julien Grall <jgrall@amazon.com>
  Michal Orzel <michal.orzel@amd.com>
  Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
  Stefano Stabellini <sstabellini@kernel.org>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      fail    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   11961f0a67..d27d274ffa  d27d274ffab06b42e5680073db11b592d282d53d -> master


From xen-devel-bounces@lists.xenproject.org Sat Jul 15 08:26:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 15 Jul 2023 08:26:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563848.881334 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKabF-00023G-6C; Sat, 15 Jul 2023 08:25:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563848.881334; Sat, 15 Jul 2023 08:25:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKabF-000239-3Q; Sat, 15 Jul 2023 08:25:57 +0000
Received: by outflank-mailman (input) for mailman id 563848;
 Sat, 15 Jul 2023 02:43:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=aqJL=DB=robh_at_kernel.org=rob@kernel.org>)
 id 1qKVFX-0000KL-Fh
 for xen-devel@lists.xenproject.org; Sat, 15 Jul 2023 02:43:11 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 54411bd5-22b9-11ee-b239-6b7b168915f2;
 Sat, 15 Jul 2023 04:43:08 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 8624B61DAD;
 Sat, 15 Jul 2023 02:43:06 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id D15D8C433C8;
 Sat, 15 Jul 2023 02:42:56 +0000 (UTC)
Received: (nullmailer pid 4056631 invoked by uid 1000);
 Fri, 14 Jul 2023 17:45:49 -0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 54411bd5-22b9-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689388985;
	bh=/K8sAwy3ddTHJ7iZOsozCcqPijpsQjWvdFKW4CzAawE=;
	h=From:To:Cc:Subject:Date:From;
	b=lxDu9HxHl9XJPtRL/ts2JtWaPhEIvloYhe3caviNr4aLTDw8/znS9FMzVwMvR1QFz
	 mfsykFkYHkGE4ctA6cBk5UwUZGCWEsLgr3wX5F1ymqbDmlSpacw4t0aQPzDewOjmZK
	 89brcj920+P6cbGtQMGAkOymptJgaG8UuVBN+eJSMPhuCSnXu8zAOwHCJAEHwRxuZA
	 J56kgvO5PJYzwaHgjA1X180zZhMCZlYG5VPuq6RHJheh1tp1V+en9Ynb57o7HS/quC
	 8vtWqSfIQVUrq3L22jdP1sxmlaFX97cbRTf6riSWrdMJyJOKYRyAACP0oogzCcv/hB
	 v6ITWvx+QCQrA==
From: Rob Herring <robh@kernel.org>
To: Liviu Dudau <liviu.dudau@arm.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Andrzej Hajda <andrzej.hajda@intel.com>, Neil Armstrong <neil.armstrong@linaro.org>, Robert Foss <rfoss@kernel.org>, Laurent Pinchart <Laurent.pinchart@ideasonboard.com>, Jonas Karlman <jonas@kwiboo.se>, Jernej Skrabec <jernej.skrabec@gmail.com>, Jagan Teki <jagan@amarulasolutions.com>, Liu Ying <victor.liu@nxp.com>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, NXP Linux Team <linux-imx@nxp.com>, Inki Dae <inki.dae@samsung.com>, Marek Szyprowski <m.szyprowski@samsung.com>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, Lucas Stach <l.stach@pengutronix.de>, Russell King <linux+etnaviv@armlinux.org.uk>, Christian Gmeiner <christian.gmeiner@gmail.com>, Seung-Woo Kim <sw0312.kim@samsung.com
 >, Kyungmin Park <kyungmin.park@samsung.com>, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, Alim Akhtar <alim.akhtar@samsung.com>, Xinliang Liu <xinliang.liu@linaro.org>, Tian Tao <tiantao6@hisilicon.com>, Xinwei Kong <kong.kongxinwei@hisilicon.com>, Sumit Semwal <sumit.semwal@linaro.org>, Yongqin Liu <yongqin.liu@linaro.org>, John Stultz <jstultz@google.com>, Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>, Paul Cercueil <paul@crapouillou.net>, Qiang Yu <yuq825@gmail.com>, Paul Kocialkowski <paul.kocialkowski@bootlin.com>, Linus Walleij <linus.walleij@linaro.org>, Chun-Kuang Hu <chunkuang.hu@kernel.org>, Philipp Zabel <p.zabel@pengutronix.de>, Matthias Brugger <matthias.bgg@gmail.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Kevin Hilman <khilman@baylibre.com>, Jerome Brunet <jbrunet@baylibre.com>, Martin Blumenstingl <martin.blumenstingl@googlemail.com>, Rob Clark <robdclark@gmail.com>, Abhinav Kumar <quic_abhinavk@quicinc.com>, Dmitry Baryshkov
  <dmitry.baryshkov@linaro.org>, Sean Paul <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>, Marek Vasut <marex@denx.de>, Stefan Agner <stefan@agner.ch>, Sam Ravnborg <sam@ravnborg.org>, Jerry Han <hanxu5@huaqin.corp-partner.google.com>, Icenowy Zheng <icenowy@aosc.io>, Ondrej Jirman <megi@xff.cz>, Javier Martinez Canillas <javierm@redhat.com>, =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>, Purism Kernel Team <kernel@puri.sm>, Jianhua Lu <lujianhua000@gmail.com>, Florian Fainelli <florian.fainelli@broadcom.com>, Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, Artur Weber <aweber.kernel@gmail.com>, Tomeu Vizoso <tomeu.vizoso@collabora.com>, Steven Price <steven.price@arm.com>, Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>, Emma Anholt <emma@anholt.net>, Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>, Sandy Huang <hjc@rock-chips.com>, =?UTF-8?q?Heiko=20St=C3=BCbner?= <heiko@sntech.de>, Orson Zhai <orsonzhai@gmail.com>,
  Baolin Wang <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>, Alain Volmat <alain.volmat@foss.st.com>, Yannick Fertre <yannick.fertre@foss.st.com>, Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>, Philippe Cornu <philippe.cornu@foss.st.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, Chen-Yu Tsai <wens@csie.org>, Samuel Holland <samuel@sholland.org>, Thierry Reding <thierry.reding@gmail.com>, Mikko Perttunen <mperttunen@nvidia.com>, Jonathan Hunter <jonathanh@nvidia.com>, Jyri Sarha <jyri.sarha@iki.fi>, Tomi Valkeinen <tomba@kernel.org>, Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: devicetree@vger.kernel.org, Ondrej Jirman <megous@megous.com>, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, etnaviv@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-mips@vger.kernel.org, lima@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, linux-rpi-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: [PATCH] drm: Explicitly include correct DT includes
Date: Fri, 14 Jul 2023 11:45:34 -0600
Message-Id: <20230714174545.4056287-1-robh@kernel.org>
X-Mailer: git-send-email 2.40.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/gpu/drm/arm/display/komeda/komeda_dev.c       | 2 +-
 drivers/gpu/drm/arm/malidp_drv.c                      | 1 +
 drivers/gpu/drm/bridge/adv7511/adv7511_cec.c          | 1 -
 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c          | 2 +-
 drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c        | 3 +--
 drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c   | 1 -
 drivers/gpu/drm/bridge/chipone-icn6211.c              | 2 +-
 drivers/gpu/drm/bridge/display-connector.c            | 1 -
 drivers/gpu/drm/bridge/fsl-ldb.c                      | 1 -
 drivers/gpu/drm/bridge/imx/imx8qm-ldb.c               | 2 +-
 drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c              | 1 +
 drivers/gpu/drm/bridge/lontium-lt9211.c               | 1 -
 drivers/gpu/drm/bridge/lvds-codec.c                   | 1 -
 drivers/gpu/drm/bridge/nwl-dsi.c                      | 2 +-
 drivers/gpu/drm/bridge/parade-ps8622.c                | 1 -
 drivers/gpu/drm/bridge/samsung-dsim.c                 | 3 ++-
 drivers/gpu/drm/bridge/simple-bridge.c                | 3 ++-
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c             | 2 +-
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c         | 2 +-
 drivers/gpu/drm/bridge/ti-sn65dsi83.c                 | 2 +-
 drivers/gpu/drm/drm_mipi_dsi.c                        | 1 +
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c                 | 2 +-
 drivers/gpu/drm/exynos/exynos5433_drm_decon.c         | 2 +-
 drivers/gpu/drm/exynos/exynos7_drm_decon.c            | 1 -
 drivers/gpu/drm/exynos/exynos_drm_dsi.c               | 3 ++-
 drivers/gpu/drm/exynos/exynos_drm_fimd.c              | 1 -
 drivers/gpu/drm/exynos/exynos_drm_rotator.c           | 2 +-
 drivers/gpu/drm/exynos/exynos_drm_scaler.c            | 2 +-
 drivers/gpu/drm/exynos/exynos_hdmi.c                  | 2 +-
 drivers/gpu/drm/exynos/exynos_mixer.c                 | 1 -
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c       | 2 +-
 drivers/gpu/drm/imx/dcss/dcss-dev.c                   | 5 +++--
 drivers/gpu/drm/imx/lcdc/imx-lcdc.c                   | 2 +-
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c             | 2 +-
 drivers/gpu/drm/ingenic/ingenic-ipu.c                 | 2 +-
 drivers/gpu/drm/lima/lima_drv.c                       | 3 ++-
 drivers/gpu/drm/logicvc/logicvc_drm.c                 | 2 +-
 drivers/gpu/drm/mcde/mcde_drv.c                       | 2 +-
 drivers/gpu/drm/mediatek/mtk_disp_aal.c               | 3 +--
 drivers/gpu/drm/mediatek/mtk_disp_ccorr.c             | 3 +--
 drivers/gpu/drm/mediatek/mtk_disp_color.c             | 3 +--
 drivers/gpu/drm/mediatek/mtk_disp_gamma.c             | 3 +--
 drivers/gpu/drm/mediatek/mtk_disp_merge.c             | 3 +--
 drivers/gpu/drm/mediatek/mtk_disp_ovl.c               | 3 +--
 drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c       | 3 ++-
 drivers/gpu/drm/mediatek/mtk_disp_rdma.c              | 3 +--
 drivers/gpu/drm/mediatek/mtk_dpi.c                    | 1 -
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c               | 1 +
 drivers/gpu/drm/mediatek/mtk_drm_drv.c                | 3 ++-
 drivers/gpu/drm/mediatek/mtk_ethdr.c                  | 2 +-
 drivers/gpu/drm/mediatek/mtk_mdp_rdma.c               | 3 +--
 drivers/gpu/drm/meson/meson_drv.h                     | 1 -
 drivers/gpu/drm/meson/meson_dw_hdmi.c                 | 3 ++-
 drivers/gpu/drm/meson/meson_dw_mipi_dsi.c             | 3 ++-
 drivers/gpu/drm/meson/meson_encoder_dsi.c             | 1 -
 drivers/gpu/drm/meson/meson_encoder_hdmi.c            | 4 +++-
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c                 | 2 ++
 drivers/gpu/drm/msm/dp/dp_audio.c                     | 2 +-
 drivers/gpu/drm/msm/dsi/dsi_host.c                    | 2 +-
 drivers/gpu/drm/msm/hdmi/hdmi.c                       | 2 ++
 drivers/gpu/drm/msm/hdmi/hdmi_phy.c                   | 3 ++-
 drivers/gpu/drm/msm/msm_mdss.c                        | 2 ++
 drivers/gpu/drm/mxsfb/lcdif_drv.c                     | 1 -
 drivers/gpu/drm/panel/panel-abt-y030xx067a.c          | 3 ++-
 drivers/gpu/drm/panel/panel-auo-a030jtn01.c           | 2 +-
 drivers/gpu/drm/panel/panel-boe-himax8279d.c          | 1 -
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c        | 1 -
 drivers/gpu/drm/panel/panel-dsi-cm.c                  | 2 +-
 drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c     | 1 -
 drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c | 2 +-
 drivers/gpu/drm/panel/panel-himax-hx8394.c            | 2 +-
 drivers/gpu/drm/panel/panel-ilitek-ili9322.c          | 3 ++-
 drivers/gpu/drm/panel/panel-ilitek-ili9341.c          | 2 +-
 drivers/gpu/drm/panel/panel-ilitek-ili9881c.c         | 2 +-
 drivers/gpu/drm/panel/panel-innolux-ej030na.c         | 3 ++-
 drivers/gpu/drm/panel/panel-innolux-p079zca.c         | 1 -
 drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c      | 2 +-
 drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c    | 1 -
 drivers/gpu/drm/panel/panel-lvds.c                    | 2 +-
 drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c   | 1 -
 drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c      | 2 +-
 drivers/gpu/drm/panel/panel-newvision-nv3051d.c       | 2 +-
 drivers/gpu/drm/panel/panel-newvision-nv3052c.c       | 3 ++-
 drivers/gpu/drm/panel/panel-novatek-nt35510.c         | 2 +-
 drivers/gpu/drm/panel/panel-novatek-nt35560.c         | 1 -
 drivers/gpu/drm/panel/panel-novatek-nt35950.c         | 2 +-
 drivers/gpu/drm/panel/panel-novatek-nt36523.c         | 2 +-
 drivers/gpu/drm/panel/panel-novatek-nt36672a.c        | 1 -
 drivers/gpu/drm/panel/panel-novatek-nt39016.c         | 1 -
 drivers/gpu/drm/panel/panel-orisetech-ota5601a.c      | 1 -
 drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 1 -
 drivers/gpu/drm/panel/panel-samsung-s6d16d0.c         | 2 +-
 drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c         | 1 -
 drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c         | 2 +-
 drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c     | 2 +-
 drivers/gpu/drm/panel/panel-samsung-sofef00.c         | 1 -
 drivers/gpu/drm/panel/panel-sitronix-st7701.c         | 2 +-
 drivers/gpu/drm/panel/panel-sitronix-st7703.c         | 2 +-
 drivers/gpu/drm/panel/panel-sony-td4353-jdi.c         | 1 -
 drivers/gpu/drm/panel/panel-truly-nt35597.c           | 2 +-
 drivers/gpu/drm/panel/panel-visionox-rm69299.c        | 2 +-
 drivers/gpu/drm/panfrost/panfrost_drv.c               | 3 ++-
 drivers/gpu/drm/pl111/pl111_versatile.c               | 1 +
 drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c         | 2 +-
 drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c         | 2 ++
 drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c         | 1 +
 drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c       | 1 -
 drivers/gpu/drm/renesas/rcar-du/rzg2l_mipi_dsi.c      | 1 -
 drivers/gpu/drm/rockchip/analogix_dp-rockchip.c       | 3 ++-
 drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c       | 2 ++
 drivers/gpu/drm/rockchip/inno_hdmi.c                  | 3 ++-
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c           | 1 +
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c           | 1 -
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c          | 1 -
 drivers/gpu/drm/sprd/sprd_dpu.c                       | 4 +---
 drivers/gpu/drm/sprd/sprd_drm.c                       | 3 ++-
 drivers/gpu/drm/sprd/sprd_dsi.c                       | 6 ++----
 drivers/gpu/drm/sti/sti_drv.c                         | 2 ++
 drivers/gpu/drm/stm/drv.c                             | 3 ++-
 drivers/gpu/drm/stm/ltdc.c                            | 1 -
 drivers/gpu/drm/sun4i/sun4i_frontend.c                | 2 +-
 drivers/gpu/drm/sun4i/sun4i_frontend.h                | 1 +
 drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c                | 2 +-
 drivers/gpu/drm/sun4i/sun4i_tcon.c                    | 6 +++---
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c                 | 2 +-
 drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c                | 3 ++-
 drivers/gpu/drm/sun4i/sun8i_mixer.c                   | 2 ++
 drivers/gpu/drm/sun4i/sun8i_tcon_top.c                | 2 +-
 drivers/gpu/drm/tegra/dc.c                            | 3 ++-
 drivers/gpu/drm/tegra/dpaux.c                         | 2 +-
 drivers/gpu/drm/tegra/gr2d.c                          | 3 ++-
 drivers/gpu/drm/tegra/gr3d.c                          | 2 +-
 drivers/gpu/drm/tegra/hdmi.c                          | 3 ++-
 drivers/gpu/drm/tegra/hub.c                           | 2 +-
 drivers/gpu/drm/tegra/nvdec.c                         | 2 --
 drivers/gpu/drm/tegra/sor.c                           | 2 +-
 drivers/gpu/drm/tegra/vic.c                           | 2 --
 drivers/gpu/drm/tidss/tidss_dispc.c                   | 2 --
 drivers/gpu/drm/tidss/tidss_drv.c                     | 2 +-
 drivers/gpu/drm/vc4/vc4_crtc.c                        | 3 ++-
 drivers/gpu/drm/vc4/vc4_dpi.c                         | 4 ++--
 drivers/gpu/drm/vc4/vc4_drv.c                         | 2 +-
 drivers/gpu/drm/vc4/vc4_dsi.c                         | 3 ++-
 drivers/gpu/drm/vc4/vc4_hdmi.c                        | 2 +-
 drivers/gpu/drm/vc4/vc4_txp.c                         | 4 ++--
 drivers/gpu/drm/vc4/vc4_vec.c                         | 4 ++--
 drivers/gpu/drm/xen/xen_drm_front.c                   | 1 -
 drivers/gpu/ipu-v3/ipu-common.c                       | 2 +-
 148 files changed, 152 insertions(+), 156 deletions(-)

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
index cc7664c95a54..14ee79becacb 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
@@ -6,7 +6,7 @@
  */
 #include <linux/io.h>
 #include <linux/iommu.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_graph.h>
 #include <linux/of_reserved_mem.h>
 #include <linux/platform_device.h>
diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
index c03cfd57b752..a5a9534d4353 100644
--- a/drivers/gpu/drm/arm/malidp_drv.c
+++ b/drivers/gpu/drm/arm/malidp_drv.c
@@ -12,6 +12,7 @@
 #include <linux/of_device.h>
 #include <linux/of_graph.h>
 #include <linux/of_reserved_mem.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/debugfs.h>
 
diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_cec.c b/drivers/gpu/drm/bridge/adv7511/adv7511_cec.c
index 99964f5a5457..2a6b91f752cb 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_cec.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_cec.c
@@ -7,7 +7,6 @@
 
 #include <linux/device.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
 #include <linux/slab.h>
 #include <linux/clk.h>
 
diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
index 2254457ab5d0..b9957da0f55a 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -9,7 +9,7 @@
 #include <linux/device.h>
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/slab.h>
 
 #include <media/cec.h>
diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
index f50d65f54314..7457d38622b0 100644
--- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
+++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
@@ -14,8 +14,7 @@
 #include <linux/interrupt.h>
 #include <linux/iopoll.h>
 #include <linux/module.h>
-#include <linux/of_address.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_graph.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
index f6822dfa3805..4aff817f82ce 100644
--- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
+++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
@@ -29,7 +29,6 @@
 #include <linux/media-bus-format.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/phy/phy.h>
 #include <linux/phy/phy-dp.h>
 #include <linux/platform_device.h>
diff --git a/drivers/gpu/drm/bridge/chipone-icn6211.c b/drivers/gpu/drm/bridge/chipone-icn6211.c
index 8bfce21d6b90..d205e755e524 100644
--- a/drivers/gpu/drm/bridge/chipone-icn6211.c
+++ b/drivers/gpu/drm/bridge/chipone-icn6211.c
@@ -17,7 +17,7 @@
 #include <linux/i2c.h>
 #include <linux/media-bus-format.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 
diff --git a/drivers/gpu/drm/bridge/display-connector.c b/drivers/gpu/drm/bridge/display-connector.c
index f7f436cf96e0..08bd5695ddae 100644
--- a/drivers/gpu/drm/bridge/display-connector.c
+++ b/drivers/gpu/drm/bridge/display-connector.c
@@ -10,7 +10,6 @@
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/regulator/consumer.h>
 
diff --git a/drivers/gpu/drm/bridge/fsl-ldb.c b/drivers/gpu/drm/bridge/fsl-ldb.c
index b8e52156b07a..0e4bac7dd04f 100644
--- a/drivers/gpu/drm/bridge/fsl-ldb.c
+++ b/drivers/gpu/drm/bridge/fsl-ldb.c
@@ -8,7 +8,6 @@
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/of_graph.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
diff --git a/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c b/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c
index 386032a02599..21471a9a28b2 100644
--- a/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c
+++ b/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c
@@ -9,9 +9,9 @@
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/of_graph.h>
 #include <linux/phy/phy.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 
diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c
index c806576b1e22..7984da9c0a35 100644
--- a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c
+++ b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c
@@ -12,6 +12,7 @@
 #include <linux/of_device.h>
 #include <linux/of_graph.h>
 #include <linux/phy/phy.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 
diff --git a/drivers/gpu/drm/bridge/lontium-lt9211.c b/drivers/gpu/drm/bridge/lontium-lt9211.c
index aa8d47e7f40d..4d404f5ef87e 100644
--- a/drivers/gpu/drm/bridge/lontium-lt9211.c
+++ b/drivers/gpu/drm/bridge/lontium-lt9211.c
@@ -16,7 +16,6 @@
 #include <linux/i2c.h>
 #include <linux/media-bus-format.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
 #include <linux/of_graph.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
diff --git a/drivers/gpu/drm/bridge/lvds-codec.c b/drivers/gpu/drm/bridge/lvds-codec.c
index 67368f23d4aa..8c5668dca0c4 100644
--- a/drivers/gpu/drm/bridge/lvds-codec.c
+++ b/drivers/gpu/drm/bridge/lvds-codec.c
@@ -7,7 +7,6 @@
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/of_graph.h>
 #include <linux/platform_device.h>
 #include <linux/regulator/consumer.h>
diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
index 4a5f5c4f5dcc..8d54091ec66e 100644
--- a/drivers/gpu/drm/bridge/nwl-dsi.c
+++ b/drivers/gpu/drm/bridge/nwl-dsi.c
@@ -16,8 +16,8 @@
 #include <linux/module.h>
 #include <linux/mux/consumer.h>
 #include <linux/of.h>
-#include <linux/of_platform.h>
 #include <linux/phy/phy.h>
+#include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/reset.h>
 #include <linux/sys_soc.h>
diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c b/drivers/gpu/drm/bridge/parade-ps8622.c
index c9b6cb7678e3..ae3ab9262ef1 100644
--- a/drivers/gpu/drm/bridge/parade-ps8622.c
+++ b/drivers/gpu/drm/bridge/parade-ps8622.c
@@ -12,7 +12,6 @@
 #include <linux/i2c.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/pm.h>
 #include <linux/regulator/consumer.h>
 
diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c
index 043b8109e64a..46b2c5027690 100644
--- a/drivers/gpu/drm/bridge/samsung-dsim.c
+++ b/drivers/gpu/drm/bridge/samsung-dsim.c
@@ -16,8 +16,9 @@
 #include <linux/delay.h>
 #include <linux/irq.h>
 #include <linux/media-bus-format.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/phy/phy.h>
+#include <linux/platform_device.h>
 
 #include <video/mipi_display.h>
 
diff --git a/drivers/gpu/drm/bridge/simple-bridge.c b/drivers/gpu/drm/bridge/simple-bridge.c
index d85d9ee463b8..cbe8e778d7c7 100644
--- a/drivers/gpu/drm/bridge/simple-bridge.c
+++ b/drivers/gpu/drm/bridge/simple-bridge.c
@@ -8,8 +8,9 @@
 
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_graph.h>
+#include <linux/platform_device.h>
 #include <linux/regulator/consumer.h>
 
 #include <drm/drm_atomic_helper.h>
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 9d6dcaf317a1..9df19d7b8445 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -14,7 +14,7 @@
 #include <linux/irq.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/pinctrl/consumer.h>
 #include <linux/regmap.h>
 #include <linux/dma-mapping.h>
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
index b2efecf7d160..5cc9a63a65ff 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
@@ -13,7 +13,7 @@
 #include <linux/debugfs.h>
 #include <linux/iopoll.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/reset.h>
 
diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
index 7e9f4ec8e780..061e8bd5915d 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
@@ -31,7 +31,7 @@
 #include <linux/i2c.h>
 #include <linux/media-bus-format.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_graph.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
index 6252ac01e945..14201f73aab1 100644
--- a/drivers/gpu/drm/drm_mipi_dsi.c
+++ b/drivers/gpu/drm/drm_mipi_dsi.c
@@ -27,6 +27,7 @@
 
 #include <linux/device.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/slab.h>
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index de8c9894967c..bbc9c54871f4 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -8,8 +8,8 @@
 #include <linux/delay.h>
 #include <linux/dma-fence.h>
 #include <linux/dma-mapping.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
index 2867b39fa35e..4d986077738b 100644
--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
@@ -12,7 +12,7 @@
 #include <linux/iopoll.h>
 #include <linux/irq.h>
 #include <linux/mfd/syscon.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
index 3126f735dedc..0156a5e94435 100644
--- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
@@ -12,7 +12,6 @@
 #include <linux/kernel.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
-#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index fc81f728e6ba..69ea33cae651 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -8,7 +8,8 @@
  */
 
 #include <linux/component.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
 
 #include <drm/bridge/samsung-dsim.h>
 #include <drm/drm_probe_helper.h>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 7f4a0be03dd1..8dde7b1e9b35 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -12,7 +12,6 @@
 #include <linux/kernel.h>
 #include <linux/mfd/syscon.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
index 8706f377c349..ffb327c5139e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
@@ -12,7 +12,7 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/sizes.h>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_scaler.c b/drivers/gpu/drm/exynos/exynos_drm_scaler.c
index 20608e9780ce..f2b8b09a6b4e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_scaler.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_scaler.c
@@ -11,7 +11,7 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index b7c11bdce2c8..f3aaa4ea3e68 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -21,8 +21,8 @@
 #include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/mfd/syscon.h>
+#include <linux/of.h>
 #include <linux/of_address.h>
-#include <linux/of_device.h>
 #include <linux/of_graph.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 8d333db813b7..b302392ff0d7 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -18,7 +18,6 @@
 #include <linux/kernel.h>
 #include <linux/ktime.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index 9c5d49bf40c9..711f7ce9894a 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -11,9 +11,9 @@
  *	Xinwei Kong <kong.kongxinwei@hisilicon.com>
  */
 
-#include <linux/of_platform.h>
 #include <linux/component.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/of_graph.h>
 #include <linux/platform_device.h>
 
diff --git a/drivers/gpu/drm/imx/dcss/dcss-dev.c b/drivers/gpu/drm/imx/dcss/dcss-dev.c
index 5d1779ab65c0..4f3af0dfb344 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-dev.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-dev.c
@@ -4,8 +4,9 @@
  */
 
 #include <linux/clk.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_graph.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/slab.h>
 #include <drm/drm_bridge_connector.h>
@@ -198,7 +199,7 @@ struct dcss_dev *dcss_dev_create(struct device *dev, bool hdmi_output)
 
 	dcss->of_port = of_graph_get_port_by_id(dev->of_node, 0);
 	if (!dcss->of_port) {
-		dev_err(dev, "no port@0 node in %s\n", dev->of_node->full_name);
+		dev_err(dev, "no port@0 node in %pOF\n", dev->of_node);
 		ret = -ENODEV;
 		goto clks_err;
 	}
diff --git a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
index 277ead6a459a..22b65f4a0e30 100644
--- a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
+++ b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
@@ -19,8 +19,8 @@
 #include <linux/bitfield.h>
 #include <linux/clk.h>
 #include <linux/dma-mapping.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
 #include <linux/platform_device.h>
 
 #define IMX21LCDC_LSSAR         0x0000 /* LCDC Screen Start Address Register */
diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
index 5ec75e9ba499..8dbd4847d3a6 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -14,7 +14,7 @@
 #include <linux/media-bus-format.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_reserved_mem.h>
 #include <linux/platform_device.h>
 #include <linux/pm.h>
diff --git a/drivers/gpu/drm/ingenic/ingenic-ipu.c b/drivers/gpu/drm/ingenic/ingenic-ipu.c
index 7a43505011a5..6d236547f611 100644
--- a/drivers/gpu/drm/ingenic/ingenic-ipu.c
+++ b/drivers/gpu/drm/ingenic/ingenic-ipu.c
@@ -14,7 +14,7 @@
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
+#include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/time.h>
 
diff --git a/drivers/gpu/drm/lima/lima_drv.c b/drivers/gpu/drm/lima/lima_drv.c
index 39cab4a55f57..39c725958ef3 100644
--- a/drivers/gpu/drm/lima/lima_drv.c
+++ b/drivers/gpu/drm/lima/lima_drv.c
@@ -2,7 +2,8 @@
 /* Copyright 2017-2019 Qiang Yu <yuq825@gmail.com> */
 
 #include <linux/module.h>
-#include <linux/of_platform.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
 #include <linux/uaccess.h>
 #include <linux/slab.h>
 #include <linux/pm_runtime.h>
diff --git a/drivers/gpu/drm/logicvc/logicvc_drm.c b/drivers/gpu/drm/logicvc/logicvc_drm.c
index c35c453fd025..e6b68c2e249b 100644
--- a/drivers/gpu/drm/logicvc/logicvc_drm.c
+++ b/drivers/gpu/drm/logicvc/logicvc_drm.c
@@ -10,8 +10,8 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
-#include <linux/of_device.h>
 #include <linux/of_reserved_mem.h>
+#include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/types.h>
 
diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c
index a8cd86c06c14..5d68d0f27212 100644
--- a/drivers/gpu/drm/mcde/mcde_drv.c
+++ b/drivers/gpu/drm/mcde/mcde_drv.c
@@ -471,7 +471,7 @@ static const struct of_device_id mcde_of_match[] = {
 static struct platform_driver mcde_driver = {
 	.driver = {
 		.name           = "mcde",
-		.of_match_table = of_match_ptr(mcde_of_match),
+		.of_match_table = mcde_of_match,
 	},
 	.probe = mcde_probe,
 	.remove = mcde_remove,
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_aal.c b/drivers/gpu/drm/mediatek/mtk_disp_aal.c
index 434e8a9ce8ab..cdbec79474d1 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_aal.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_aal.c
@@ -6,8 +6,7 @@
 #include <linux/clk.h>
 #include <linux/component.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
-#include <linux/of_irq.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/soc/mediatek/mtk-cmdq.h>
 
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c b/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c
index 1773379b2439..7c5e04ee5b9f 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c
@@ -6,8 +6,7 @@
 #include <linux/clk.h>
 #include <linux/component.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
-#include <linux/of_irq.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/soc/mediatek/mtk-cmdq.h>
 
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_color.c b/drivers/gpu/drm/mediatek/mtk_disp_color.c
index cac9206079e7..0b9b4b06d19c 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_color.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_color.c
@@ -6,8 +6,7 @@
 #include <linux/clk.h>
 #include <linux/component.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
-#include <linux/of_irq.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/soc/mediatek/mtk-cmdq.h>
 
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c
index c844942603f7..7746dceadb20 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c
@@ -6,8 +6,7 @@
 #include <linux/clk.h>
 #include <linux/component.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
-#include <linux/of_irq.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/soc/mediatek/mtk-cmdq.h>
 
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_merge.c b/drivers/gpu/drm/mediatek/mtk_disp_merge.c
index 6428b6203ffe..bea8a0d8040a 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_merge.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_merge.c
@@ -5,8 +5,7 @@
 
 #include <linux/clk.h>
 #include <linux/component.h>
-#include <linux/of_device.h>
-#include <linux/of_irq.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/reset.h>
 #include <linux/soc/mediatek/mtk-cmdq.h>
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
index 8f52cc1f3fba..73320a7425cd 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
@@ -10,8 +10,7 @@
 #include <linux/clk.h>
 #include <linux/component.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
-#include <linux/of_irq.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/soc/mediatek/mtk-cmdq.h>
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
index c0a38f5217ee..878575bb9671 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
@@ -7,8 +7,9 @@
 #include <drm/drm_of.h>
 #include <linux/clk.h>
 #include <linux/component.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/reset.h>
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c
index d4df17ad600a..a12c05786d28 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c
@@ -8,8 +8,7 @@
 #include <linux/clk.h>
 #include <linux/component.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
-#include <linux/of_irq.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/soc/mediatek/mtk-cmdq.h>
diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
index 948a53f1f4b3..28bdb1f427ff 100644
--- a/drivers/gpu/drm/mediatek/mtk_dpi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
@@ -10,7 +10,6 @@
 #include <linux/kernel.h>
 #include <linux/media-bus-format.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/of_graph.h>
 #include <linux/pinctrl/consumer.h>
 #include <linux/platform_device.h>
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
index d40142842f85..8a43656ecc30 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
@@ -6,6 +6,7 @@
 #include <linux/clk.h>
 #include <linux/dma-mapping.h>
 #include <linux/mailbox_controller.h>
+#include <linux/of.h>
 #include <linux/pm_runtime.h>
 #include <linux/soc/mediatek/mtk-cmdq.h>
 #include <linux/soc/mediatek/mtk-mmsys.h>
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
index 6dcb4ba2466c..e01427717912 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
@@ -7,8 +7,9 @@
 #include <linux/component.h>
 #include <linux/iommu.h>
 #include <linux/module.h>
-#include <linux/of_address.h>
+#include <linux/of.h>
 #include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/dma-mapping.h>
 
diff --git a/drivers/gpu/drm/mediatek/mtk_ethdr.c b/drivers/gpu/drm/mediatek/mtk_ethdr.c
index 73dc4da3ba3b..db7ac666ec5e 100644
--- a/drivers/gpu/drm/mediatek/mtk_ethdr.c
+++ b/drivers/gpu/drm/mediatek/mtk_ethdr.c
@@ -7,7 +7,7 @@
 #include <drm/drm_framebuffer.h>
 #include <linux/clk.h>
 #include <linux/component.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/platform_device.h>
 #include <linux/reset.h>
diff --git a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
index e06db6e56b5f..4806bdd4b8fa 100644
--- a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
+++ b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
@@ -6,8 +6,7 @@
 #include <drm/drm_fourcc.h>
 #include <linux/clk.h>
 #include <linux/component.h>
-#include <linux/of_address.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/soc/mediatek/mtk-cmdq.h>
diff --git a/drivers/gpu/drm/meson/meson_drv.h b/drivers/gpu/drm/meson/meson_drv.h
index b23009a3380f..3f9345c14f31 100644
--- a/drivers/gpu/drm/meson/meson_drv.h
+++ b/drivers/gpu/drm/meson/meson_drv.h
@@ -9,7 +9,6 @@
 
 #include <linux/device.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/regmap.h>
 
 struct drm_crtc;
diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
index 3d046878ce6c..63206535de65 100644
--- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
+++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
@@ -9,8 +9,9 @@
 #include <linux/component.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_graph.h>
+#include <linux/platform_device.h>
 #include <linux/regulator/consumer.h>
 #include <linux/reset.h>
 
diff --git a/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c b/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c
index 57447abf1a29..e5fe4e994f43 100644
--- a/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c
+++ b/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c
@@ -7,9 +7,10 @@
 
 #include <linux/clk.h>
 #include <linux/kernel.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
 #include <linux/of_graph.h>
+#include <linux/platform_device.h>
 #include <linux/reset.h>
 #include <linux/phy/phy.h>
 #include <linux/bitfield.h>
diff --git a/drivers/gpu/drm/meson/meson_encoder_dsi.c b/drivers/gpu/drm/meson/meson_encoder_dsi.c
index 812e172dec63..3f93c70488ca 100644
--- a/drivers/gpu/drm/meson/meson_encoder_dsi.c
+++ b/drivers/gpu/drm/meson/meson_encoder_dsi.c
@@ -7,7 +7,6 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
 #include <linux/of_graph.h>
 
 #include <drm/drm_atomic_helper.h>
diff --git a/drivers/gpu/drm/meson/meson_encoder_hdmi.c b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
index 53231bfdf7e2..9913971fa5d2 100644
--- a/drivers/gpu/drm/meson/meson_encoder_hdmi.c
+++ b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
@@ -9,8 +9,10 @@
 #include <linux/component.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_graph.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/regulator/consumer.h>
 #include <linux/reset.h>
 
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
index 5deb79924897..b20ef6c8ea26 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
@@ -3,6 +3,8 @@
 
 #include <linux/clk.h>
 #include <linux/interconnect.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/pm_domain.h>
 #include <linux/pm_opp.h>
 #include <soc/qcom/cmd-db.h>
diff --git a/drivers/gpu/drm/msm/dp/dp_audio.c b/drivers/gpu/drm/msm/dp/dp_audio.c
index 1245c7aa49df..4a2e479723a8 100644
--- a/drivers/gpu/drm/msm/dp/dp_audio.c
+++ b/drivers/gpu/drm/msm/dp/dp_audio.c
@@ -6,7 +6,7 @@
 
 #define pr_fmt(fmt)	"[drm-dp] %s: " fmt, __func__
 
-#include <linux/of_platform.h>
+#include <linux/platform_device.h>
 
 #include <drm/display/drm_dp_helper.h>
 #include <drm/drm_edid.h>
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 3f6dfb4f9d5a..4c6d73e24bb5 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -10,7 +10,7 @@
 #include <linux/gpio/consumer.h>
 #include <linux/interrupt.h>
 #include <linux/mfd/syscon.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_graph.h>
 #include <linux/of_irq.h>
 #include <linux/pinctrl/consumer.h>
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index 3132105a2a43..60509fb39710 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -7,6 +7,8 @@
 
 #include <linux/of_irq.h>
 #include <linux/of_gpio.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
 
 #include <drm/drm_bridge_connector.h>
 #include <drm/drm_of.h>
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy.c
index 9780107e1cc9..3e00fb8190b2 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy.c
@@ -3,7 +3,8 @@
  * Copyright (c) 2016, The Linux Foundation. All rights reserved.
  */
 
-#include <linux/of_device.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
 
 #include "hdmi.h"
 
diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c
index 05648c910c68..6bf6c4a0f550 100644
--- a/drivers/gpu/drm/msm/msm_mdss.c
+++ b/drivers/gpu/drm/msm/msm_mdss.c
@@ -10,6 +10,8 @@
 #include <linux/irqchip.h>
 #include <linux/irqdesc.h>
 #include <linux/irqchip/chained_irq.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/reset.h>
 
diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c
index c9d8cbb21407..5e8dc88efea1 100644
--- a/drivers/gpu/drm/mxsfb/lcdif_drv.c
+++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c
@@ -10,7 +10,6 @@
 #include <linux/io.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/of_graph.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
diff --git a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c
index 1cc0f1d09684..662c7bcbe6e5 100644
--- a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c
+++ b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c
@@ -11,7 +11,8 @@
 #include <linux/gpio/consumer.h>
 #include <linux/media-bus-format.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/spi/spi.h>
diff --git a/drivers/gpu/drm/panel/panel-auo-a030jtn01.c b/drivers/gpu/drm/panel/panel-auo-a030jtn01.c
index 3c976a98de6a..6c86ebf2cad7 100644
--- a/drivers/gpu/drm/panel/panel-auo-a030jtn01.c
+++ b/drivers/gpu/drm/panel/panel-auo-a030jtn01.c
@@ -11,8 +11,8 @@
 #include <linux/device.h>
 #include <linux/gpio/consumer.h>
 #include <linux/media-bus-format.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/spi/spi.h>
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
index d879b3b14c48..11b64acbe8a9 100644
--- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -10,7 +10,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 
 #include <linux/gpio/consumer.h>
 #include <linux/regulator/consumer.h>
diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index dc276c346fd1..5ac926281d2c 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -8,7 +8,6 @@
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/regulator/consumer.h>
 
 #include <drm/drm_connector.h>
diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c b/drivers/gpu/drm/panel/panel-dsi-cm.c
index ba17bcc4461c..6b3f4d664d2a 100644
--- a/drivers/gpu/drm/panel/panel-dsi-cm.c
+++ b/drivers/gpu/drm/panel/panel-dsi-cm.c
@@ -11,7 +11,7 @@
 #include <linux/gpio/consumer.h>
 #include <linux/jiffies.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/regulator/consumer.h>
 
 #include <drm/drm_connector.h>
diff --git a/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c b/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c
index 76572c922983..986e3e192881 100644
--- a/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c
+++ b/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c
@@ -7,7 +7,6 @@
 #include <linux/delay.h>
 #include <linux/mod_devicetable.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
 #include <linux/regulator/consumer.h>
 
 #include <drm/drm_mipi_dsi.h>
diff --git a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c
index df493da50afe..48e3acaecdf3 100644
--- a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c
+++ b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c
@@ -11,7 +11,7 @@
 #include <linux/gpio/consumer.h>
 #include <linux/delay.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
 #include <linux/regulator/consumer.h>
 
 #define FEIYANG_INIT_CMD_LEN	2
diff --git a/drivers/gpu/drm/panel/panel-himax-hx8394.c b/drivers/gpu/drm/panel/panel-himax-hx8394.c
index d4fb5d1b295b..c73243d85de7 100644
--- a/drivers/gpu/drm/panel/panel-himax-hx8394.c
+++ b/drivers/gpu/drm/panel/panel-himax-hx8394.c
@@ -15,7 +15,7 @@
 #include <linux/media-bus-format.h>
 #include <linux/mod_devicetable.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/regulator/consumer.h>
 
 #include <video/mipi_display.h>
diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
index 3dfafa585127..61c872f0f7ca 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
@@ -22,7 +22,8 @@
 #include <linux/bitops.h>
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/spi/spi.h>
diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9341.c b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c
index 3fdf884b3257..3574681891e8 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9341.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c
@@ -23,7 +23,7 @@
 #include <linux/delay.h>
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/regulator/consumer.h>
 #include <linux/spi/spi.h>
 
diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
index 1ec696adf9de..72dbb8184280 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
@@ -9,7 +9,7 @@
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 
 #include <linux/gpio/consumer.h>
 #include <linux/regulator/consumer.h>
diff --git a/drivers/gpu/drm/panel/panel-innolux-ej030na.c b/drivers/gpu/drm/panel/panel-innolux-ej030na.c
index b2b0ebc9e943..8fdbda59be48 100644
--- a/drivers/gpu/drm/panel/panel-innolux-ej030na.c
+++ b/drivers/gpu/drm/panel/panel-innolux-ej030na.c
@@ -11,7 +11,8 @@
 #include <linux/gpio/consumer.h>
 #include <linux/media-bus-format.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/spi/spi.h>
diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
index 9992d0d4c0e5..485178a99910 100644
--- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
+++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
@@ -7,7 +7,6 @@
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/regulator/consumer.h>
 
 #include <video/mipi_display.h>
diff --git a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c b/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c
index 323c33c9c37a..4879835fe101 100644
--- a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c
+++ b/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c
@@ -16,7 +16,7 @@
 #include <linux/gpio/consumer.h>
 #include <linux/delay.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/regulator/consumer.h>
 
 #define JD9365DA_INIT_CMD_LEN		2
diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
index d2efd887484b..d41482d3a34f 100644
--- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
+++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
@@ -8,7 +8,6 @@
 #include <linux/media-bus-format.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/regulator/consumer.h>
 
 #include <video/display_timing.h>
diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
index de8758c30e6e..6c46985237c6 100644
--- a/drivers/gpu/drm/panel/panel-lvds.c
+++ b/drivers/gpu/drm/panel/panel-lvds.c
@@ -10,7 +10,7 @@
 
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
-#include <linux/of_platform.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/regulator/consumer.h>
 #include <linux/slab.h>
diff --git a/drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c b/drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c
index 26d358b9b85a..799c2161fc85 100644
--- a/drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c
+++ b/drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c
@@ -18,7 +18,6 @@
 #include <linux/media-bus-format.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/regulator/consumer.h>
 #include <linux/spi/spi.h>
 
diff --git a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
index 9243b2ad828d..ea4a6bf6d35b 100644
--- a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
+++ b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
@@ -10,7 +10,7 @@
 #include <linux/gpio/consumer.h>
 #include <linux/media-bus-format.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/regulator/consumer.h>
 
 #include <video/mipi_display.h>
diff --git a/drivers/gpu/drm/panel/panel-newvision-nv3051d.c b/drivers/gpu/drm/panel/panel-newvision-nv3051d.c
index a07958038ffd..ad98dd9322b4 100644
--- a/drivers/gpu/drm/panel/panel-newvision-nv3051d.c
+++ b/drivers/gpu/drm/panel/panel-newvision-nv3051d.c
@@ -13,7 +13,7 @@
 #include <linux/gpio/consumer.h>
 #include <linux/media-bus-format.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/regulator/consumer.h>
 
 #include <video/display_timing.h>
diff --git a/drivers/gpu/drm/panel/panel-newvision-nv3052c.c b/drivers/gpu/drm/panel/panel-newvision-nv3052c.c
index cf078f0d3cd3..71e57de6d8b2 100644
--- a/drivers/gpu/drm/panel/panel-newvision-nv3052c.c
+++ b/drivers/gpu/drm/panel/panel-newvision-nv3052c.c
@@ -11,7 +11,8 @@
 #include <linux/gpio/consumer.h>
 #include <linux/media-bus-format.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
 #include <linux/regulator/consumer.h>
 #include <linux/spi/spi.h>
 #include <video/mipi_display.h>
diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35510.c b/drivers/gpu/drm/panel/panel-novatek-nt35510.c
index 493c3c23f0d6..d6dceb858008 100644
--- a/drivers/gpu/drm/panel/panel-novatek-nt35510.c
+++ b/drivers/gpu/drm/panel/panel-novatek-nt35510.c
@@ -26,7 +26,7 @@
 #include <linux/bitops.h>
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 
diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35560.c b/drivers/gpu/drm/panel/panel-novatek-nt35560.c
index cc7f96d70826..5bbea734123b 100644
--- a/drivers/gpu/drm/panel/panel-novatek-nt35560.c
+++ b/drivers/gpu/drm/panel/panel-novatek-nt35560.c
@@ -18,7 +18,6 @@
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/regulator/consumer.h>
 
 #include <video/mipi_display.h>
diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35950.c b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
index 8b108ac80b55..412ca84d0581 100644
--- a/drivers/gpu/drm/panel/panel-novatek-nt35950.c
+++ b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
@@ -8,7 +8,7 @@
 #include <linux/delay.h>
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_graph.h>
 #include <linux/regulator/consumer.h>
 
diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36523.c b/drivers/gpu/drm/panel/panel-novatek-nt36523.c
index c3befa7f253d..9632b9e95b71 100644
--- a/drivers/gpu/drm/panel/panel-novatek-nt36523.c
+++ b/drivers/gpu/drm/panel/panel-novatek-nt36523.c
@@ -9,7 +9,7 @@
 #include <linux/delay.h>
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_graph.h>
 #include <linux/regulator/consumer.h>
 
diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36672a.c b/drivers/gpu/drm/panel/panel-novatek-nt36672a.c
index 73bcffa1e0c1..33fb3d715e54 100644
--- a/drivers/gpu/drm/panel/panel-novatek-nt36672a.c
+++ b/drivers/gpu/drm/panel/panel-novatek-nt36672a.c
@@ -16,7 +16,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 
 #include <linux/gpio/consumer.h>
 #include <linux/pinctrl/consumer.h>
diff --git a/drivers/gpu/drm/panel/panel-novatek-nt39016.c b/drivers/gpu/drm/panel/panel-novatek-nt39016.c
index f58cfb10b58a..059260262b5a 100644
--- a/drivers/gpu/drm/panel/panel-novatek-nt39016.c
+++ b/drivers/gpu/drm/panel/panel-novatek-nt39016.c
@@ -12,7 +12,6 @@
 #include <linux/media-bus-format.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/spi/spi.h>
diff --git a/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c b/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c
index e46be5014d42..c415dacf1816 100644
--- a/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c
+++ b/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c
@@ -12,7 +12,6 @@
 #include <linux/media-bus-format.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/spi/spi.h>
diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
index 90ea91e4311d..4618c892cdd6 100644
--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
+++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
@@ -47,7 +47,6 @@
 #include <linux/media-bus-format.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/of_graph.h>
 #include <linux/pm.h>
 
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c
index 008e2b0d6652..79f611963c61 100644
--- a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c
+++ b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c
@@ -11,7 +11,7 @@
 #include <linux/gpio/consumer.h>
 #include <linux/regulator/consumer.h>
 #include <linux/delay.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 
 struct s6d16d0 {
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c b/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c
index 102e1fc7ee38..0755f85a44bd 100644
--- a/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c
+++ b/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c
@@ -11,7 +11,6 @@
 #include <linux/module.h>
 #include <linux/regulator/consumer.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 
 #include <video/mipi_display.h>
 #include <drm/drm_mipi_dsi.h>
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c
index 39eef3dce7c9..639a4fdf57bb 100644
--- a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c
+++ b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c
@@ -12,7 +12,7 @@
 #include <linux/delay.h>
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/regulator/consumer.h>
 
 #include <drm/drm_mipi_dsi.h>
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c
index ed3895e4ca5e..a89d925fdfb2 100644
--- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c
+++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c
@@ -6,7 +6,7 @@
 
 #include <linux/module.h>
 #include <linux/delay.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
 
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_print.h>
diff --git a/drivers/gpu/drm/panel/panel-samsung-sofef00.c b/drivers/gpu/drm/panel/panel-samsung-sofef00.c
index 1ebb79e3103c..cbf9607dd576 100644
--- a/drivers/gpu/drm/panel/panel-samsung-sofef00.c
+++ b/drivers/gpu/drm/panel/panel-samsung-sofef00.c
@@ -8,7 +8,6 @@
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/regulator/consumer.h>
 #include <linux/backlight.h>
 
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7701.c b/drivers/gpu/drm/panel/panel-sitronix-st7701.c
index 7eae83aa0ea1..0459965e1b4f 100644
--- a/drivers/gpu/drm/panel/panel-sitronix-st7701.c
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7701.c
@@ -12,7 +12,7 @@
 #include <linux/gpio/consumer.h>
 #include <linux/delay.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/regulator/consumer.h>
 
 #include <video/mipi_display.h>
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
index 3aa31f3d6157..6a3945639535 100644
--- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
@@ -13,7 +13,7 @@
 #include <linux/media-bus-format.h>
 #include <linux/mod_devicetable.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/regulator/consumer.h>
 
 #include <video/display_timing.h>
diff --git a/drivers/gpu/drm/panel/panel-sony-td4353-jdi.c b/drivers/gpu/drm/panel/panel-sony-td4353-jdi.c
index 8d8813dbaa45..1bde2f01786b 100644
--- a/drivers/gpu/drm/panel/panel-sony-td4353-jdi.c
+++ b/drivers/gpu/drm/panel/panel-sony-td4353-jdi.c
@@ -14,7 +14,6 @@
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/regulator/consumer.h>
 
 #include <video/mipi_display.h>
diff --git a/drivers/gpu/drm/panel/panel-truly-nt35597.c b/drivers/gpu/drm/panel/panel-truly-nt35597.c
index b31cffb660a7..4f4009f9fe25 100644
--- a/drivers/gpu/drm/panel/panel-truly-nt35597.c
+++ b/drivers/gpu/drm/panel/panel-truly-nt35597.c
@@ -7,7 +7,7 @@
 #include <linux/delay.h>
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_graph.h>
 #include <linux/pinctrl/consumer.h>
 #include <linux/regulator/consumer.h>
diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
index ec228c269146..c2806e4fd553 100644
--- a/drivers/gpu/drm/panel/panel-visionox-rm69299.c
+++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
@@ -5,7 +5,7 @@
 
 #include <linux/delay.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
 #include <linux/gpio/consumer.h>
 #include <linux/regulator/consumer.h>
 
diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index bbada731bbbd..20c25c836198 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -4,8 +4,9 @@
 /* Copyright 2019 Collabora ltd. */
 
 #include <linux/module.h>
-#include <linux/of_platform.h>
+#include <linux/of.h>
 #include <linux/pagemap.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <drm/panfrost_drm.h>
 #include <drm/drm_drv.h>
diff --git a/drivers/gpu/drm/pl111/pl111_versatile.c b/drivers/gpu/drm/pl111/pl111_versatile.c
index 00c3ebd32359..1e4b28d03f4d 100644
--- a/drivers/gpu/drm/pl111/pl111_versatile.c
+++ b/drivers/gpu/drm/pl111/pl111_versatile.c
@@ -15,6 +15,7 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/vexpress.h>
 
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c
index 1ffde19cb87f..3904b0cca814 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c
@@ -12,7 +12,7 @@
 #include <linux/io.h>
 #include <linux/mm.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pm.h>
 #include <linux/slab.h>
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
index adfb36b0e815..9ff4537c26c8 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
@@ -20,8 +20,10 @@
 
 #include <linux/device.h>
 #include <linux/dma-buf.h>
+#include <linux/of.h>
 #include <linux/of_graph.h>
 #include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/wait.h>
 
 #include "rcar_du_crtc.h"
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
index 45c05d0ffc70..9cbb5e6e2cba 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
@@ -22,6 +22,7 @@
 #include <linux/bitops.h>
 #include <linux/dma-mapping.h>
 #include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/scatterlist.h>
 #include <linux/slab.h>
 #include <linux/videodev2.h>
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c
index e10e4d4b89a2..db2e6f16f954 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c
@@ -12,7 +12,6 @@
 #include <linux/math64.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/of_graph.h>
 #include <linux/platform_device.h>
 #include <linux/reset.h>
diff --git a/drivers/gpu/drm/renesas/rcar-du/rzg2l_mipi_dsi.c b/drivers/gpu/drm/renesas/rcar-du/rzg2l_mipi_dsi.c
index aa95b85a2964..8048bdca2d6c 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rzg2l_mipi_dsi.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rzg2l_mipi_dsi.c
@@ -10,7 +10,6 @@
 #include <linux/iopoll.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/of_graph.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
index ad2d3ae7e621..255e6eab8544 100644
--- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
@@ -10,8 +10,9 @@
 
 #include <linux/component.h>
 #include <linux/mfd/syscon.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_graph.h>
+#include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/reset.h>
 #include <linux/clk.h>
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
index 917e79951aac..2744d8f4a6fa 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
@@ -12,7 +12,9 @@
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/phy/phy.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 
diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c
index 9afb889963c1..751e694b39cd 100644
--- a/drivers/gpu/drm/rockchip/inno_hdmi.c
+++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
@@ -11,9 +11,10 @@
 #include <linux/err.h>
 #include <linux/hdmi.h>
 #include <linux/mfd/syscon.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
-#include <linux/of_device.h>
+#include <linux/platform_device.h>
 
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_edid.h>
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index d97f2edc646b..01954a0b5696 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -7,6 +7,7 @@
  */
 
 #include <linux/dma-mapping.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/module.h>
 #include <linux/of_graph.h>
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index a530ecc4d207..86fd9f51c692 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -12,7 +12,6 @@
 #include <linux/log2.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/overflow.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
index ca73b8ccc29f..583df4d22f7e 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
@@ -13,7 +13,6 @@
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/of_graph.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
diff --git a/drivers/gpu/drm/sprd/sprd_dpu.c b/drivers/gpu/drm/sprd/sprd_dpu.c
index b96fc6837b0d..48183bbd0590 100644
--- a/drivers/gpu/drm/sprd/sprd_dpu.c
+++ b/drivers/gpu/drm/sprd/sprd_dpu.c
@@ -9,10 +9,8 @@
 #include <linux/io.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_device.h>
 #include <linux/of_graph.h>
-#include <linux/of_irq.h>
+#include <linux/platform_device.h>
 #include <linux/wait.h>
 #include <linux/workqueue.h>
 
diff --git a/drivers/gpu/drm/sprd/sprd_drm.c b/drivers/gpu/drm/sprd/sprd_drm.c
index be60c0d546a3..0aa39156f2fa 100644
--- a/drivers/gpu/drm/sprd/sprd_drm.c
+++ b/drivers/gpu/drm/sprd/sprd_drm.c
@@ -5,10 +5,11 @@
 
 #include <linux/component.h>
 #include <linux/dma-mapping.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/of_graph.h>
-#include <linux/of_platform.h>
+#include <linux/platform_device.h>
 
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_drv.h>
diff --git a/drivers/gpu/drm/sprd/sprd_dsi.c b/drivers/gpu/drm/sprd/sprd_dsi.c
index ab0e5cce7adb..d7b143a75601 100644
--- a/drivers/gpu/drm/sprd/sprd_dsi.c
+++ b/drivers/gpu/drm/sprd/sprd_dsi.c
@@ -5,10 +5,8 @@
 
 #include <linux/component.h>
 #include <linux/module.h>
-#include <linux/of_address.h>
-#include <linux/of_device.h>
-#include <linux/of_irq.h>
-#include <linux/of_graph.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
 #include <video/mipi_display.h>
 
 #include <drm/drm_atomic_helper.h>
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index 1b87b5899f9e..deb75b61e4cf 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -8,7 +8,9 @@
 #include <linux/dma-mapping.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/of_platform.h>
+#include <linux/platform_device.h>
 
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
index cb4404b3ce62..e507739ced0c 100644
--- a/drivers/gpu/drm/stm/drv.c
+++ b/drivers/gpu/drm/stm/drv.c
@@ -10,8 +10,9 @@
 
 #include <linux/component.h>
 #include <linux/dma-mapping.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
-#include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
 #include <drm/drm_aperture.h>
diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index b8be4c1db423..5576fdae4962 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -14,7 +14,6 @@
 #include <linux/interrupt.h>
 #include <linux/media-bus-format.h>
 #include <linux/module.h>
-#include <linux/of_address.h>
 #include <linux/of_graph.h>
 #include <linux/pinctrl/consumer.h>
 #include <linux/platform_device.h>
diff --git a/drivers/gpu/drm/sun4i/sun4i_frontend.c b/drivers/gpu/drm/sun4i/sun4i_frontend.c
index 799ab7460ae5..e156a9e97fd8 100644
--- a/drivers/gpu/drm/sun4i/sun4i_frontend.c
+++ b/drivers/gpu/drm/sun4i/sun4i_frontend.c
@@ -7,7 +7,7 @@
 #include <linux/clk.h>
 #include <linux/component.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
diff --git a/drivers/gpu/drm/sun4i/sun4i_frontend.h b/drivers/gpu/drm/sun4i/sun4i_frontend.h
index 2e7b76e50c2b..61c24088772c 100644
--- a/drivers/gpu/drm/sun4i/sun4i_frontend.h
+++ b/drivers/gpu/drm/sun4i/sun4i_frontend.h
@@ -8,6 +8,7 @@
 #define _SUN4I_FRONTEND_H_
 
 #include <linux/list.h>
+#include <linux/mod_devicetable.h>
 
 #define SUN4I_FRONTEND_EN_REG			0x000
 #define SUN4I_FRONTEND_EN_EN				BIT(0)
diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
index c0df5e892fa7..ac4e07142378 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
@@ -10,7 +10,7 @@
 #include <linux/i2c.h>
 #include <linux/iopoll.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index 6a52fb12cbfb..662027f137a6 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -10,9 +10,9 @@
 #include <linux/ioport.h>
 #include <linux/media-bus-format.h>
 #include <linux/module.h>
-#include <linux/of_address.h>
-#include <linux/of_device.h>
-#include <linux/of_irq.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/reset.h>
 
diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
index 7cab4213a680..a450f33fb02a 100644
--- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
+++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
@@ -5,7 +5,7 @@
 
 #include <linux/component.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 
 #include <drm/drm_modeset_helper_vtables.h>
diff --git a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c
index ca53b5e9fffc..4fa69c463dc4 100644
--- a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c
+++ b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c
@@ -4,8 +4,9 @@
  */
 
 #include <linux/delay.h>
-#include <linux/of_address.h>
+#include <linux/of.h>
 #include <linux/of_platform.h>
+#include <linux/platform_device.h>
 
 #include "sun8i_dw_hdmi.h"
 
diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c
index 11d5244a5aa5..dac442f94128 100644
--- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
@@ -10,8 +10,10 @@
 #include <linux/component.h>
 #include <linux/dma-mapping.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_graph.h>
+#include <linux/platform_device.h>
 #include <linux/reset.h>
 
 #include <drm/drm_atomic_helper.h>
diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
index da97682b6835..a7cb2b0ffb02 100644
--- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
+++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
@@ -7,7 +7,7 @@
 #include <linux/device.h>
 #include <linux/io.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_graph.h>
 #include <linux/platform_device.h>
 
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 6e78416e64b0..13b182ab905f 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -11,7 +11,8 @@
 #include <linux/iommu.h>
 #include <linux/interconnect.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
 #include <linux/pm_domain.h>
 #include <linux/pm_opp.h>
 #include <linux/pm_runtime.h>
diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c
index 4d2677dcd831..96a8afcab3ef 100644
--- a/drivers/gpu/drm/tegra/dpaux.c
+++ b/drivers/gpu/drm/tegra/dpaux.c
@@ -8,7 +8,7 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/pinctrl/pinconf-generic.h>
 #include <linux/pinctrl/pinctrl.h>
 #include <linux/pinctrl/pinmux.h>
diff --git a/drivers/gpu/drm/tegra/gr2d.c b/drivers/gpu/drm/tegra/gr2d.c
index 50f77fddda54..4c55133467a0 100644
--- a/drivers/gpu/drm/tegra/gr2d.c
+++ b/drivers/gpu/drm/tegra/gr2d.c
@@ -7,7 +7,8 @@
 #include <linux/delay.h>
 #include <linux/iommu.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/reset.h>
 
diff --git a/drivers/gpu/drm/tegra/gr3d.c b/drivers/gpu/drm/tegra/gr3d.c
index c026c2c916c1..2768f8f073ed 100644
--- a/drivers/gpu/drm/tegra/gr3d.c
+++ b/drivers/gpu/drm/tegra/gr3d.c
@@ -9,7 +9,7 @@
 #include <linux/host1x.h>
 #include <linux/iommu.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pm_domain.h>
 #include <linux/pm_opp.h>
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index 6eac54ae1205..00be307ca070 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -10,7 +10,8 @@
 #include <linux/hdmi.h>
 #include <linux/math64.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
 #include <linux/pm_opp.h>
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c
index 916857361a91..1af5f8318d91 100644
--- a/drivers/gpu/drm/tegra/hub.c
+++ b/drivers/gpu/drm/tegra/hub.c
@@ -9,8 +9,8 @@
 #include <linux/host1x.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/of_graph.h>
+#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/reset.h>
diff --git a/drivers/gpu/drm/tegra/nvdec.c b/drivers/gpu/drm/tegra/nvdec.c
index ae78a81e5eef..f821e36111a7 100644
--- a/drivers/gpu/drm/tegra/nvdec.c
+++ b/drivers/gpu/drm/tegra/nvdec.c
@@ -11,8 +11,6 @@
 #include <linux/iopoll.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
-#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/reset.h>
diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index abd6e3b92293..93471b70e180 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -8,7 +8,7 @@
 #include <linux/debugfs.h>
 #include <linux/io.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
diff --git a/drivers/gpu/drm/tegra/vic.c b/drivers/gpu/drm/tegra/vic.c
index da7a038dca20..5da989ac700e 100644
--- a/drivers/gpu/drm/tegra/vic.c
+++ b/drivers/gpu/drm/tegra/vic.c
@@ -10,8 +10,6 @@
 #include <linux/iommu.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
-#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/reset.h>
diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c
index dca077411f77..da6b2b01f7bd 100644
--- a/drivers/gpu/drm/tidss/tidss_dispc.c
+++ b/drivers/gpu/drm/tidss/tidss_dispc.c
@@ -15,8 +15,6 @@
 #include <linux/module.h>
 #include <linux/mfd/syscon.h>
 #include <linux/of.h>
-#include <linux/of_graph.h>
-#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
diff --git a/drivers/gpu/drm/tidss/tidss_drv.c b/drivers/gpu/drm/tidss/tidss_drv.c
index 3f5f27fb6ebc..1f06a6284770 100644
--- a/drivers/gpu/drm/tidss/tidss_drv.c
+++ b/drivers/gpu/drm/tidss/tidss_drv.c
@@ -5,7 +5,7 @@
  */
 
 #include <linux/console.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/module.h>
 #include <linux/pm_runtime.h>
 
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
index bef9d45ef1df..7b30e4675559 100644
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
@@ -31,7 +31,8 @@
 
 #include <linux/clk.h>
 #include <linux/component.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
 #include <drm/drm_atomic.h>
diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
index e68c07d86040..333f77609dba 100644
--- a/drivers/gpu/drm/vc4/vc4_dpi.c
+++ b/drivers/gpu/drm/vc4/vc4_dpi.c
@@ -22,8 +22,8 @@
 #include <linux/clk.h>
 #include <linux/component.h>
 #include <linux/media-bus-format.h>
-#include <linux/of_graph.h>
-#include <linux/of_platform.h>
+#include <linux/mod_devicetable.h>
+#include <linux/platform_device.h>
 #include "vc4_drv.h"
 #include "vc4_regs.h"
 
diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
index 823395c23cc3..272c6503aac9 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.c
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
@@ -26,7 +26,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/io.h>
 #include <linux/module.h>
-#include <linux/of_platform.h>
+#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
index 9e0c355b236f..46f28e04cefc 100644
--- a/drivers/gpu/drm/vc4/vc4_dsi.c
+++ b/drivers/gpu/drm/vc4/vc4_dsi.c
@@ -25,8 +25,9 @@
 #include <linux/dma-mapping.h>
 #include <linux/dmaengine.h>
 #include <linux/io.h>
+#include <linux/of.h>
 #include <linux/of_address.h>
-#include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
 #include <drm/drm_atomic_helper.h>
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 5261526d286f..a9515eb7b587 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -41,8 +41,8 @@
 #include <linux/component.h>
 #include <linux/gpio/consumer.h>
 #include <linux/i2c.h>
+#include <linux/of.h>
 #include <linux/of_address.h>
-#include <linux/of_platform.h>
 #include <linux/pm_runtime.h>
 #include <linux/rational.h>
 #include <linux/reset.h>
diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c
index c5abdec03103..136fb4f4fe7a 100644
--- a/drivers/gpu/drm/vc4/vc4_txp.c
+++ b/drivers/gpu/drm/vc4/vc4_txp.c
@@ -9,8 +9,8 @@
 
 #include <linux/clk.h>
 #include <linux/component.h>
-#include <linux/of_graph.h>
-#include <linux/of_platform.h>
+#include <linux/mod_devicetable.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
 #include <drm/drm_atomic.h>
diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c
index d6e6a1a22eba..26441be41265 100644
--- a/drivers/gpu/drm/vc4/vc4_vec.c
+++ b/drivers/gpu/drm/vc4/vc4_vec.c
@@ -21,8 +21,8 @@
 #include <drm/drm_simple_kms_helper.h>
 #include <linux/clk.h>
 #include <linux/component.h>
-#include <linux/of_graph.h>
-#include <linux/of_platform.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
 #include "vc4_drv.h"
diff --git a/drivers/gpu/drm/xen/xen_drm_front.c b/drivers/gpu/drm/xen/xen_drm_front.c
index 90996c108146..a83f054d0a8b 100644
--- a/drivers/gpu/drm/xen/xen_drm_front.c
+++ b/drivers/gpu/drm/xen/xen_drm_front.c
@@ -11,7 +11,6 @@
 #include <linux/delay.h>
 #include <linux/dma-mapping.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
 
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_drv.h>
diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c
index c35eac1116f5..71ec1e7f657a 100644
--- a/drivers/gpu/ipu-v3/ipu-common.c
+++ b/drivers/gpu/ipu-v3/ipu-common.c
@@ -18,7 +18,7 @@
 #include <linux/irq.h>
 #include <linux/irqchip/chained_irq.h>
 #include <linux/irqdomain.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_graph.h>
 
 #include <drm/drm_fourcc.h>
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Sat Jul 15 12:16:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 15 Jul 2023 12:16:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563961.881344 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKeBe-0008Gq-E0; Sat, 15 Jul 2023 12:15:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563961.881344; Sat, 15 Jul 2023 12:15:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKeBe-0008Gj-9v; Sat, 15 Jul 2023 12:15:46 +0000
Received: by outflank-mailman (input) for mailman id 563961;
 Sat, 15 Jul 2023 12:15:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKeBd-0008GZ-83; Sat, 15 Jul 2023 12:15:45 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKeBd-0001El-0u; Sat, 15 Jul 2023 12:15:45 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKeBc-0004RL-JU; Sat, 15 Jul 2023 12:15:44 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qKeBc-0001Ua-J6; Sat, 15 Jul 2023 12:15:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=KgGzkMqDtwYBLMuKXhgS8amuXZK0SHwp593Fenigho8=; b=4+NZWfq3q3z5qS0t+ATAWkMrIC
	joqEwZZUtO0LsAm7KXBBw7wwCd0G/M0g3ikT/ZDHFNYvc6MidHHsQX1r4Ses3y5HmpsyUXy0XvxS+
	+v9K8I9CYXepPgU5+cz9wAZhFx8hT677sxqe4wXjXna4N2T1KG2CN7QtsGn3X5JV9rQM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181807-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181807: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-libvirt-qcow2:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-freebsd11-amd64:guest-destroy:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=2772d7df3c93f15e5b2119bd9e14724db6a21a04
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 15 Jul 2023 12:15:44 +0000

flight 181807 linux-linus real [real]
flight 181819 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181807/
http://logs.test-lab.xenproject.org/osstest/logs/181819/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 18 guest-localmigrate/x10 fail pass in 181819-retest
 test-amd64-amd64-libvirt-qcow2 19 guest-start/debian.repeat fail pass in 181819-retest
 test-amd64-amd64-freebsd11-amd64 23 guest-destroy   fail pass in 181819-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                2772d7df3c93f15e5b2119bd9e14724db6a21a04
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   89 days
Failing since        180281  2023-04-17 06:24:36 Z   89 days  177 attempts
Testing same since   181807  2023-07-15 02:40:11 Z    0 days    1 attempts

------------------------------------------------------------
3765 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               fail    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 627793 lines long.)


From xen-devel-bounces@lists.xenproject.org Sat Jul 15 16:10:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 15 Jul 2023 16:10:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563977.881354 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKhqH-0006no-R9; Sat, 15 Jul 2023 16:09:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563977.881354; Sat, 15 Jul 2023 16:09:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKhqH-0006nh-Lu; Sat, 15 Jul 2023 16:09:57 +0000
Received: by outflank-mailman (input) for mailman id 563977;
 Sat, 15 Jul 2023 16:09:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKhqG-0006nX-C6; Sat, 15 Jul 2023 16:09:56 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKhqG-00078o-0u; Sat, 15 Jul 2023 16:09:56 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qKhqF-0004mK-Jx; Sat, 15 Jul 2023 16:09:55 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qKhqF-0008TE-JR; Sat, 15 Jul 2023 16:09:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=wbJYu/3xm+WJVcSHBIM8QS+1yg06+fC8rVHJ2WIPoWk=; b=dIG9TtlWwNz9PHU7f58AWaPNy6
	mZJHHAvAtMBVGU/hL9m47LY2S1aWr5r0b53o9apKl8oAXNYYrZYIiXhL3irHk0J31aZy6mOAs37++
	RUahP3BFugsa6GCEPLc9v5ZxzQOOxGmVFn9boU/pYllu6xLewhe3Xk9TEfaAlORSHYHU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181824-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181824: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=f220dcbba86bfc1222180c61bbd31dd6023433db
X-Osstest-Versions-That:
    ovmf=e674096accc8e57cd0dd84679905e1222423251e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 15 Jul 2023 16:09:55 +0000

flight 181824 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181824/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 f220dcbba86bfc1222180c61bbd31dd6023433db
baseline version:
 ovmf                 e674096accc8e57cd0dd84679905e1222423251e

Last test of basis   181806  2023-07-15 01:50:22 Z    0 days
Testing same since   181824  2023-07-15 14:12:20 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Tuan Phan <tphan@ventanamicro.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   e674096acc..f220dcbba8  f220dcbba86bfc1222180c61bbd31dd6023433db -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sun Jul 16 04:22:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 16 Jul 2023 04:22:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.563991.881364 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKtH0-0001eC-1k; Sun, 16 Jul 2023 04:22:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 563991.881364; Sun, 16 Jul 2023 04:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKtGz-0001dq-Rr; Sun, 16 Jul 2023 04:22:17 +0000
Received: by outflank-mailman (input) for mailman id 563991;
 Sat, 15 Jul 2023 20:19:19 +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 <SRS0=4YgR=DB=ravnborg.org=sam@srs-se1.protection.inumbo.net>)
 id 1qKljZ-000681-5c
 for xen-devel@lists.xenproject.org; Sat, 15 Jul 2023 20:19:19 +0000
Received: from mailrelay1-1.pub.mailoutpod2-cph3.one.com
 (mailrelay1-1.pub.mailoutpod2-cph3.one.com [2a02:2350:5:400::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dd907688-234c-11ee-8611-37d641c3527e;
 Sat, 15 Jul 2023 22:19:14 +0200 (CEST)
Received: from ravnborg.org (2-105-2-98-cable.dk.customer.tdc.net [2.105.2.98])
 by mailrelay1 (Halon) with ESMTPSA
 id da40b60a-234c-11ee-b5d0-99461c6a3fe8;
 Sat, 15 Jul 2023 20:19:11 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dd907688-234c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=ravnborg.org; s=rsa1;
	h=in-reply-to:content-type:mime-version:references:message-id:subject:cc:to:
	 from:date:from;
	bh=JxBhhYK0Y5VT2HXGIOu9TJojogxR36dmFxRFhj6IWCk=;
	b=EVElt5TCflzYgiRrmN27f0ZK5MwnAlXBDddOCHg6/OVohDn42qAtgNTo5OfcLdzxWG2SRBFfTehox
	 xNOBoSfNDJzs3G7hNViFJKi/eWgcZSc8XjfH227Fu8qgxnV8T/L9k2kbIA0TZQokuWJ+ry5L7uGt3S
	 eDRotSkr5oRNdgzxdg7YaiwxS1dKxGLKWYbj3gEJyCEtA+CikK6SwC793O4AA7oPFy3WliBjXaujiN
	 jIW5IRtD7dVIQTKWn5fuE38KmwgPMYpkppyDRBcw0Lj664vpEaR8bSW8fFgvBrj4JprqbJ9guXY0Cs
	 zK0jiHS5+p6sj2f0nA1gLqEzVUOMj3w==
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed;
	d=ravnborg.org; s=ed1;
	h=in-reply-to:content-type:mime-version:references:message-id:subject:cc:to:
	 from:date:from;
	bh=JxBhhYK0Y5VT2HXGIOu9TJojogxR36dmFxRFhj6IWCk=;
	b=Z/37LrNNgkFmoRmOnuPWeSyBJ3zkNDMuzDj4yl37D//Yx8vlrZ1t4ZtvhEx9F98EMcvKO2OmDB7Cz
	 mpB1B+iCw==
X-HalOne-ID: da40b60a-234c-11ee-b5d0-99461c6a3fe8
Date: Sat, 15 Jul 2023 22:19:08 +0200
From: Sam Ravnborg <sam@ravnborg.org>
To: Rob Herring <robh@kernel.org>
Cc: Liviu Dudau <liviu.dudau@arm.com>, David Airlie <airlied@gmail.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Jagan Teki <jagan@amarulasolutions.com>,
	Liu Ying <victor.liu@nxp.com>, Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>, Inki Dae <inki.dae@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Lucas Stach <l.stach@pengutronix.de>,
	Russell King <linux+etnaviv@armlinux.org.uk>,
	Christian Gmeiner <christian.gmeiner@gmail.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Tian Tao <tiantao6@hisilicon.com>,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Yongqin Liu <yongqin.liu@linaro.org>,
	John Stultz <jstultz@google.com>,
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	Paul Cercueil <paul@crapouillou.net>, Qiang Yu <yuq825@gmail.com>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Rob Clark <robdclark@gmail.com>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Sean Paul <sean@poorly.run>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Marek Vasut <marex@denx.de>, Stefan Agner <stefan@agner.ch>,
	Jerry Han <hanxu5@huaqin.corp-partner.google.com>,
	Icenowy Zheng <icenowy@aosc.io>, Ondrej Jirman <megi@xff.cz>,
	Javier Martinez Canillas <javierm@redhat.com>,
	Guido =?iso-8859-1?Q?G=FCnther?= <agx@sigxcpu.org>,
	Purism Kernel Team <kernel@puri.sm>,
	Jianhua Lu <lujianhua000@gmail.com>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>,
	Artur Weber <aweber.kernel@gmail.com>,
	Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	Steven Price <steven.price@arm.com>,
	Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>,
	Emma Anholt <emma@anholt.net>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Sandy Huang <hjc@rock-chips.com>,
	Heiko =?iso-8859-1?Q?St=FCbner?= <heiko@sntech.de>,
	Orson Zhai <orsonzhai@gmail.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Alain Volmat <alain.volmat@foss.st.com>,
	Yannick Fertre <yannick.fertre@foss.st.com>,
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
	Philippe Cornu <philippe.cornu@foss.st.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Chen-Yu Tsai <wens@csie.org>, Samuel Holland <samuel@sholland.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Mikko Perttunen <mperttunen@nvidia.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Jyri Sarha <jyri.sarha@iki.fi>, Tomi Valkeinen <tomba@kernel.org>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Ondrej Jirman <megous@megous.com>, devicetree@vger.kernel.org,
	linux-sunxi@lists.linux.dev, linux-samsung-soc@vger.kernel.org,
	lima@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-rockchip@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	linux-rpi-kernel@lists.infradead.org,
	xen-devel@lists.xenproject.org, linux-tegra@vger.kernel.org,
	linux-amlogic@lists.infradead.org, linux-mips@vger.kernel.org,
	freedreno@lists.freedesktop.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] drm: Explicitly include correct DT includes
Message-ID: <20230715201908.GA321950@ravnborg.org>
References: <20230714174545.4056287-1-robh@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20230714174545.4056287-1-robh@kernel.org>

Hi Rob,

On Fri, Jul 14, 2023 at 11:45:34AM -0600, Rob Herring wrote:
> The DT of_device.h and of_platform.h date back to the separate
> of_platform_bus_type before it as merged into the regular platform bus.
> As part of that merge prepping Arm DT support 13 years ago, they
> "temporarily" include each other. They also include platform_device.h
> and of.h. As a result, there's a pretty much random mix of those include
> files used throughout the tree. In order to detangle these headers and
> replace the implicit includes with struct declarations, users need to
> explicitly include the correct includes.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>


From xen-devel-bounces@lists.xenproject.org Sun Jul 16 09:21:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 16 Jul 2023 09:21:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564040.881374 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKxw0-0006tt-AJ; Sun, 16 Jul 2023 09:20:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564040.881374; Sun, 16 Jul 2023 09:20:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qKxw0-0006tm-7R; Sun, 16 Jul 2023 09:20:56 +0000
Received: by outflank-mailman (input) for mailman id 564040;
 Sun, 16 Jul 2023 09:20:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+Zb8=DC=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qKxvy-0006tg-VP
 for xen-devel@lists.xenproject.org; Sun, 16 Jul 2023 09:20:55 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0611.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::611])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0f170093-23ba-11ee-b239-6b7b168915f2;
 Sun, 16 Jul 2023 11:20:52 +0200 (CEST)
Received: from DU2PR04CA0018.eurprd04.prod.outlook.com (2603:10a6:10:3b::23)
 by PAXPR08MB6589.eurprd08.prod.outlook.com (2603:10a6:102:159::19) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.28; Sun, 16 Jul
 2023 09:20:48 +0000
Received: from DBAEUR03FT024.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:3b:cafe::16) by DU2PR04CA0018.outlook.office365.com
 (2603:10a6:10:3b::23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31 via Frontend
 Transport; Sun, 16 Jul 2023 09:20:47 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT024.mail.protection.outlook.com (100.127.142.163) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.28 via Frontend Transport; Sun, 16 Jul 2023 09:20:47 +0000
Received: ("Tessian outbound f1e964b3a9be:v145");
 Sun, 16 Jul 2023 09:20:47 +0000
Received: from bc0ada54e362.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 0FDC83B4-6430-4FEB-BD92-C76295CAF3C7.1; 
 Sun, 16 Jul 2023 09:20:36 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id bc0ada54e362.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Sun, 16 Jul 2023 09:20:36 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by GV2PR08MB8320.eurprd08.prod.outlook.com (2603:10a6:150:b5::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.28; Sun, 16 Jul
 2023 09:20:31 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::c78c:c78a:5ab9:570c]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::c78c:c78a:5ab9:570c%4]) with mapi id 15.20.6588.031; Sun, 16 Jul 2023
 09:20:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0f170093-23ba-11ee-b239-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=TCG6tiNKZKE6QnUD5HVuiJSmtqHSTSDCv50XvdrqgyQ=;
 b=tQxXcIEkJ7cChkRMu6KrDwTGFVcJWCubRdniYRI+dVsfo608Fwe3cHOJx5O6f4Y+74XZIJ/aPH2E0u5mvZV4mX6KK0FwHEz0EeLy8+3lNVwCl+27i06yK/SoObgKPv88xsE8rd58TyAxuYSebcGHZGr89wLLZUsJLRTIw3tgHZ0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: dde4a536feca7860
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=L7P4uZa9oepihb4lHux2lnD8SsYq+XfWKlWM5OBtwOUxtjPu2GnWWFpgBNvr6qjJLfvBWvQRvDGbvF/uuoLlshhc33qOR/QfrTCAmg4Q8jfI1XYp5E2JSidZqYRwlgACgRbHO57H0gq+FFLc6Bs0sbElBniVCoczgai+7No+GhlidiBlhbREy406eb9p+L49cVJ2y9NfWHzANMDydF/NovOYlzixtCWHev4SOZMfT0di8uVeS0p7JYPQOLkKUshyNpYAyAzeP8Kf/tAEsdqecrz4I7Pgb3xYickqPy8upFhfTjcOUt7kj56zx/dAGz4jnqnlT6pKc93ziaQighvH8A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=TCG6tiNKZKE6QnUD5HVuiJSmtqHSTSDCv50XvdrqgyQ=;
 b=lnfNGEX/aD9ZdAY6MFHGBOMpiC+h/Qb5a857/GvbMPPcSyP7WcJ39VNZqpUgFQb/NesckYJ9ui6h6fZWI7prhPx2qDwMYUOakHrELUU4mDKKFwMIZnyIprcgme1iJeIzPK4oHYXE3WhFGdPIxYElcMz4I7l4RI/KJIgZsyNtlldHDN4Y8dVQJZZq29Gq2wAyQYmeI0CNzGsl05MZfv+TeWNyN9Z20jmoPqoaFzKvKdqv1YSq3A+TnWIuQhJeq5ulzZibxjr4VIU+B9NpjZcElfaBqHobvigRj8trYK13pjUAI0OBTujMwCMkr2+YYFF8hqYzNw0pCtXn8FjMYA9JlA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=TCG6tiNKZKE6QnUD5HVuiJSmtqHSTSDCv50XvdrqgyQ=;
 b=tQxXcIEkJ7cChkRMu6KrDwTGFVcJWCubRdniYRI+dVsfo608Fwe3cHOJx5O6f4Y+74XZIJ/aPH2E0u5mvZV4mX6KK0FwHEz0EeLy8+3lNVwCl+27i06yK/SoObgKPv88xsE8rd58TyAxuYSebcGHZGr89wLLZUsJLRTIw3tgHZ0=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Julien Grall <julien@xen.org>
CC: Nicola Vetrini <nicola.vetrini@bugseng.com>, Xen-devel
	<xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, "michal.orzel@amd.com" <michal.orzel@amd.com>,
	"xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
	"ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
	"consulting@bugseng.com" <consulting@bugseng.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, Jan
 Beulich <jbeulich@suse.com>, Wei Liu <wl@xen.org>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
Thread-Topic: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized
 variable inside a macro
Thread-Index: AQHZtkllBkKUd/6mO0+M9pyVgMwza6+5OwiAgALl4AA=
Date: Sun, 16 Jul 2023 09:20:30 +0000
Message-ID: <299D0BAE-D15E-4260-AF3E-8D84CF058083@arm.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
 <d1ccb5e1-d122-88df-e46a-39494b6d6d12@xen.org>
In-Reply-To: <d1ccb5e1-d122-88df-e46a-39494b6d6d12@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|GV2PR08MB8320:EE_|DBAEUR03FT024:EE_|PAXPR08MB6589:EE_
X-MS-Office365-Filtering-Correlation-Id: 66966bf0-ee86-4cbc-253a-08db85ddf09f
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 H7sDDhnzSn/3uBXwmo/7P5bSVHIq1x/1TdBUCP7sd9/voEmNiPTU79bBdWXBAbNDYnINUlySImRAj1X3/5CDvmuInB1dIvNrFUoFzgSdrFupR4XRHWLMPaMCOKl4rxBXvM9gVizYO0Yn406aNYSIUUGmjzBcCQ61OcLtxw42Q3VrlZGPshYEWPlcrd8oZv2RyTBtHgE1H2lbWx25mcbULk7iExtgBEVzxcqQC5bBaAZwfeWixSlCam9TkJb2b4r7x8Vd8Ms1oGwM2KhFv/GiDgXHsbm5fRGOO7b1U0ZVDBB9QWrfcFCFM1DM2YHxt1B+BtptfRaLK0wu+naJu1VsHSDYhNFhXZNe8j8axVGVOdxFuy1nZN75QG8pKi+avopXMOyM0nxWJHxE8dsEO2LbhDYj+sGiI/wO7VomQPhrw3tz0UEMrfPaVF/51P2+2R4JnGHVOa0t0bmaa7O3xoaHdaMr2la2FhnFKVRPD6cY4oiiMTUZdXzLuKtDyWV3Yip4L8OZ0FDdzOvRFxhCQdJfDfr96i3xvVtthKcBpTqzuCjRzp5JMzJOpIsReKOS2XaZQSdl7eV5DFqNnO2OhxinNR62I6Q/vW94pVIDFEWVOp1Bu4O/Uu1+5ru5NJDMmXgNhTJ/atIsaabWODdR0W5mIQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(396003)(376002)(136003)(39860400002)(346002)(451199021)(2616005)(6486002)(6512007)(478600001)(71200400001)(6916009)(64756008)(66446008)(76116006)(66946007)(66476007)(66556008)(54906003)(53546011)(26005)(186003)(4326008)(6506007)(91956017)(8936002)(8676002)(38100700002)(122000001)(4744005)(41300700001)(5660300002)(316002)(2906002)(38070700005)(86362001)(7416002)(33656002)(36756003)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <BEE60D5B182C624A976AA55AC8EED27B@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8320
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT024.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	0ef9483d-fa92-4639-504a-08db85dde6c9
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	YRnaJsM+lB8jpOwBKwSCe0VmrYQFhPQ4+Ci0fksIDYtdTQGWRo6EzBMsoN/T2TxzOPhDN4KYnpITTpdbuBKAUFF+EVGptLSpg8JzL6Lgyru73gFaXuoMcoI+KkWLUlwR4yTDeLgOZCQ5gcfC8KGSysWv4dwH2vhgkQ+dqJn5fcIPE+xgDikSxlvsWsIK56AomUebV6MuCq1PkPjnl0CDqM7JZ4297HvXL/1mAdsPO5vQV7RShl7mrwpiqnLVc2PDrujCJtdx9/5aisRhMetu/rm0aqsz5rdMx2nAEXihAwUMNM5s2oVFZbs4aE73qhVdVTFwEbY/gD9B56BEeTefbSZc7BCw2WpaZaSUzJ+cCng1tlV8MJuLvIjhDrSFUpL3efkDraXJWrYFTJVU/sqS68+gSUnYpaLf8ncc860lS9aY2cCP5vULPE9zefZWaZ2rgs3pVkSDdFKv0XLgKURGp94zX39GNYz8wT9OgyDqGzgjuiJMGL8baUMVWtn73Re7Hbmk1VcsIXI0+Pj0XUzVp/irvzvXV2ik599JqvBvfOATmQBstt3k2AdagHIBjvwoKam6F7ZHltV9vOYSmrQmXyvqs8SakSozEAdcmfeu91qQaRjM2P3Tqzs1hEf8Eu1JaxPkFiP2hdLggA/17vzwFf3D5O5Q2V92daJg3MGtTGvcXWPdAoGpHrSytZCyUPqw81FmisIMX1w6uxeJhI/8Gg==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(396003)(376002)(136003)(451199021)(82310400008)(36840700001)(46966006)(8676002)(6862004)(5660300002)(8936002)(316002)(41300700001)(70206006)(4326008)(70586007)(54906003)(478600001)(2906002)(4744005)(6486002)(6512007)(107886003)(53546011)(26005)(6506007)(186003)(336012)(47076005)(2616005)(40480700001)(36860700001)(81166007)(86362001)(33656002)(36756003)(356005)(82740400003);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2023 09:20:47.4129
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 66966bf0-ee86-4cbc-253a-08db85ddf09f
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT024.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6589

DQoNCj4gT24gMTQgSnVsIDIwMjMsIGF0IDE0OjA1LCBKdWxpZW4gR3JhbGwgPGp1bGllbkB4ZW4u
b3JnPiB3cm90ZToNCj4gDQo+IEhpLA0KPiANCj4gT24gMTQvMDcvMjAyMyAxMjo0OSwgTmljb2xh
IFZldHJpbmkgd3JvdGU6DQo+PiBUaGUgbWFjcm8gJ3Rlc3RvcCcgZXhwYW5kcyB0byBhIGZ1bmN0
aW9uIHRoYXQgZGVjbGFyZXMgdGhlIGxvY2FsDQo+PiB2YXJpYWJsZSAnb2xkYml0Jywgd2hpY2gg
aXMgd3JpdHRlbiBiZWZvcmUgYmVpbmcgc2V0LCBidXQgaXMgc3VjaCBhDQo+PiB3YXkgdGhhdCBp
cyBub3QgYW1lbmFibGUgdG8gYXV0b21hdGljIGNoZWNraW5nLg0KPiANCj4gVGhlIGNvZGUgaXMg
cHJldHR5IHN0cmFpZ2h0Zm9yd2FyZC4gU28gSSBhbSBub3QgZW50aXJlbHkgc3VyZSB3aHkgRWNs
YWlyIGlzIG5vdCBoYXBweS4gSXMgaXQgYmVjYXVzZSB0aGUgdmFsdWUgaXMgc2V0IGJ5IGFzc2Vt
Ymx5IGNvZGU/DQoNCkhpIEp1bGllbiwNCg0KWWVzIEkgYWdyZWUgdGhhdCBpdOKAmXMgc3RyYW5n
ZSwgZG8geW91IHRoaW5rIHRoYXQgdGhhdCBpZiBhdCBsaW5lIDk3IHdlIGluaXRpYWxpemUgb2xk
Yml0IHRvIHplcm8sIGl0IHdvdWxkIHNvbHZlIHRoZSBpc3N1ZT8NCkBOaWNvbGENCg0KQ2hlZXJz
LA0KTHVjYQ0KDQo+IA0KPiBDaGVlcnMsDQo+IA0KPiAtLSANCj4gSnVsaWVuIEdyYWxsDQo+IA0K
DQo=


From xen-devel-bounces@lists.xenproject.org Sun Jul 16 14:47:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 16 Jul 2023 14:47:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564047.881383 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qL31z-00052z-DG; Sun, 16 Jul 2023 14:47:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564047.881383; Sun, 16 Jul 2023 14:47:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qL31z-00052s-Ag; Sun, 16 Jul 2023 14:47:27 +0000
Received: by outflank-mailman (input) for mailman id 564047;
 Sun, 16 Jul 2023 09:26:38 +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 <SRS0=INUH=DC=sntech.de=heiko@srs-se1.protection.inumbo.net>)
 id 1qKy1W-0007Yw-65
 for xen-devel@lists.xenproject.org; Sun, 16 Jul 2023 09:26:38 +0000
Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id db170576-23ba-11ee-8611-37d641c3527e;
 Sun, 16 Jul 2023 11:26:34 +0200 (CEST)
Received: from i53875a6a.versanet.de ([83.135.90.106] helo=phil.localnet)
 by gloria.sntech.de with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2)
 (envelope-from <heiko@sntech.de>)
 id 1qKy04-0005tq-1S; Sun, 16 Jul 2023 11:25:08 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: db170576-23ba-11ee-8611-37d641c3527e
From: Heiko Stuebner <heiko@sntech.de>
To: Liviu Dudau <liviu.dudau@arm.com>, David Airlie <airlied@gmail.com>,
 Daniel Vetter <daniel@ffwll.ch>, Andrzej Hajda <andrzej.hajda@intel.com>,
 Neil Armstrong <neil.armstrong@linaro.org>, Robert Foss <rfoss@kernel.org>,
 Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
 Jonas Karlman <jonas@kwiboo.se>, Jernej Skrabec <jernej.skrabec@gmail.com>,
 Jagan Teki <jagan@amarulasolutions.com>, Liu Ying <victor.liu@nxp.com>,
 Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>,
 Pengutronix Kernel Team <kernel@pengutronix.de>,
 Fabio Estevam <festevam@gmail.com>, NXP Linux Team <linux-imx@nxp.com>,
 Inki Dae <inki.dae@samsung.com>, Marek Szyprowski <m.szyprowski@samsung.com>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 Lucas Stach <l.stach@pengutronix.de>,
 Russell King <linux+etnaviv@armlinux.org.uk>,
 Christian Gmeiner <christian.gmeiner@gmail.com>,
 Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Xinliang Liu <xinliang.liu@linaro.org>, Tian Tao <tiantao6@hisilicon.com>,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 Sumit Semwal <sumit.semwal@linaro.org>, Yongqin Liu <yongqin.liu@linaro.org>,
 John Stultz <jstultz@google.com>,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Paul Cercueil <paul@crapouillou.net>, Qiang Yu <yuq825@gmail.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Linus Walleij <linus.walleij@linaro.org>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>,
 Philipp Zabel <p.zabel@pengutronix.de>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 Kevin Hilman <khilman@baylibre.com>, Jerome Brunet <jbrunet@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 Rob Clark <robdclark@gmail.com>, Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, Sean Paul <sean@poorly.run>,
 Marijn Suijten <marijn.suijten@somainline.org>, Marek Vasut <marex@denx.de>,
 Stefan Agner <stefan@agner.ch>, Sam Ravnborg <sam@ravnborg.org>,
 Jerry Han <hanxu5@huaqin.corp-partner.google.com>,
 Icenowy Zheng <icenowy@aosc.io>, Ondrej Jirman <megi@xff.cz>,
 Javier Martinez Canillas <javierm@redhat.com>,
 Guido =?ISO-8859-1?Q?G=FCnther?= <agx@sigxcpu.org>,
 Purism Kernel Team <kernel@puri.sm>, Jianhua Lu <lujianhua000@gmail.com>,
 Florian Fainelli <florian.fainelli@broadcom.com>,
 Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>,
 Artur Weber <aweber.kernel@gmail.com>,
 Tomeu Vizoso <tomeu.vizoso@collabora.com>,
 Steven Price <steven.price@arm.com>,
 Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>,
 Emma Anholt <emma@anholt.net>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Sandy Huang <hjc@rock-chips.com>, Orson Zhai <orsonzhai@gmail.com>,
 Baolin Wang <baolin.wang@linux.alibaba.com>,
 Chunyan Zhang <zhang.lyra@gmail.com>,
 Alain Volmat <alain.volmat@foss.st.com>,
 Yannick Fertre <yannick.fertre@foss.st.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Philippe Cornu <philippe.cornu@foss.st.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>,
 Chen-Yu Tsai <wens@csie.org>, Samuel Holland <samuel@sholland.org>,
 Thierry Reding <thierry.reding@gmail.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Jyri Sarha <jyri.sarha@iki.fi>,
 Tomi Valkeinen <tomba@kernel.org>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org, Ondrej Jirman <megous@megous.com>,
 dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
 linux-arm-kernel@lists.infradead.org, etnaviv@lists.freedesktop.org,
 linux-samsung-soc@vger.kernel.org, linux-mips@vger.kernel.org,
 lima@lists.freedesktop.org, linux-mediatek@lists.infradead.org,
 linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org,
 freedreno@lists.freedesktop.org, linux-rpi-kernel@lists.infradead.org,
 linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org,
 linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev,
 linux-tegra@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH] drm: Explicitly include correct DT includes
Date: Sun, 16 Jul 2023 11:25:03 +0200
Message-ID: <114500369.nniJfEyVGO@phil>
In-Reply-To: <20230714174545.4056287-1-robh@kernel.org>
References: <20230714174545.4056287-1-robh@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"

Am Freitag, 14. Juli 2023, 19:45:34 CEST schrieb Rob Herring:
> The DT of_device.h and of_platform.h date back to the separate
> of_platform_bus_type before it as merged into the regular platform bus.
> As part of that merge prepping Arm DT support 13 years ago, they
> "temporarily" include each other. They also include platform_device.h
> and of.h. As a result, there's a pretty much random mix of those include
> files used throughout the tree. In order to detangle these headers and
> replace the implicit includes with struct declarations, users need to
> explicitly include the correct includes.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---

[...]

> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> index 917e79951aac..2744d8f4a6fa 100644
> --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> @@ -12,7 +12,9 @@
>  #include <linux/mfd/syscon.h>
>  #include <linux/module.h>
>  #include <linux/of_device.h>
> +#include <linux/of_platform.h>
>  #include <linux/phy/phy.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/regmap.h>

I'm not sure if I'm just misreading something, but in all other places
of_device.h gets removed while here is stays as an include. Is this
correct this way?

Thanks
Heiko




From xen-devel-bounces@lists.xenproject.org Sun Jul 16 16:51:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 16 Jul 2023 16:51:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564117.881394 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qL4xO-0001t6-74; Sun, 16 Jul 2023 16:50:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564117.881394; Sun, 16 Jul 2023 16:50:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qL4xO-0001sz-4A; Sun, 16 Jul 2023 16:50:50 +0000
Received: by outflank-mailman (input) for mailman id 564117;
 Sun, 16 Jul 2023 16:50:49 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qL4xN-0001st-I0
 for xen-devel@lists.xenproject.org; Sun, 16 Jul 2023 16:50:49 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qL4xM-0008Al-IH; Sun, 16 Jul 2023 16:50:48 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qL4xM-0002qK-9U; Sun, 16 Jul 2023 16:50:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=ItGT6v8bVkITgc4WS/g5tFMZBIepdldn/F9rCI8F0ks=; b=PBp+zPDZe7kIQGfXtjQVazaofs
	cr4c5oIFcI/6L1j6x8fqVCsbbaXrQHeCimqufXJJyhPFHsx/0IOVLf7Zx+m8qoap/V8+L2FUuKuhj
	sj4hY7RHDZjsw8qUPzd5cK7lMgHcb3JbwlCnY6knR+qXpCXJ80ISgFwhwXDMFUhxpzDs=;
Message-ID: <528fb310-f469-e449-d1c3-269fa7dec750@xen.org>
Date: Sun, 16 Jul 2023 17:50:45 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
To: Luca Fancellu <Luca.Fancellu@arm.com>
Cc: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 "xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
 "ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
 "consulting@bugseng.com" <consulting@bugseng.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
 <d1ccb5e1-d122-88df-e46a-39494b6d6d12@xen.org>
 <299D0BAE-D15E-4260-AF3E-8D84CF058083@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <299D0BAE-D15E-4260-AF3E-8D84CF058083@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 16/07/2023 10:20, Luca Fancellu wrote:
>> On 14 Jul 2023, at 14:05, Julien Grall <julien@xen.org> wrote:
>>
>> Hi,
>>
>> On 14/07/2023 12:49, Nicola Vetrini wrote:
>>> The macro 'testop' expands to a function that declares the local
>>> variable 'oldbit', which is written before being set, but is such a
>>> way that is not amenable to automatic checking.
>>
>> The code is pretty straightforward. So I am not entirely sure why Eclair is not happy. Is it because the value is set by assembly code?
> 
> Hi Julien,
> 
> Yes I agree that itâ€™s strange, do you think that that if at line 97 we initialize oldbit to zero, it would solve the issue?

At the moment, I am not entirely happy to zero oldbit because we have 
other places in Xen where we need assembly instructions to read a value 
(e.g. READ_SYSREG()).

So I would first like to understand why Eclair can't cope with it.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 04:29:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 04:29:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564149.881404 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLFqg-00028r-Do; Mon, 17 Jul 2023 04:28:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564149.881404; Mon, 17 Jul 2023 04:28:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLFqg-00028j-82; Mon, 17 Jul 2023 04:28:38 +0000
Received: by outflank-mailman (input) for mailman id 564149;
 Mon, 17 Jul 2023 04:28:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLFqe-00028Z-Q5; Mon, 17 Jul 2023 04:28:36 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLFqe-0007Zn-HR; Mon, 17 Jul 2023 04:28:36 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLFqe-0001xo-1L; Mon, 17 Jul 2023 04:28:36 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLFqe-00070K-0s; Mon, 17 Jul 2023 04:28:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=tzt2vjZdTWSxmvYrLg/JaHQ8AmmDwBPcJIwI5GwCRtg=; b=IOtV2K8vvjqwxh7AbmRC0KS5zd
	/S+ru+WwtYPjEyND5SIW48qorhtlJpc1dGpJlUKhlQxCYzbYcfx1jOieyl6vMYDPGfQR3VSXXFwBv
	BbUOy68c1yTsKHx1gEoaw9aKHc3PGEWuknImrt+aw69204K7K/1K5IO8eHofvYlH1dAw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181829-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181829: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=dd49d448b0815c65847241a3faa957e3b4605001
X-Osstest-Versions-That:
    ovmf=f220dcbba86bfc1222180c61bbd31dd6023433db
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 17 Jul 2023 04:28:36 +0000

flight 181829 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181829/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 dd49d448b0815c65847241a3faa957e3b4605001
baseline version:
 ovmf                 f220dcbba86bfc1222180c61bbd31dd6023433db

Last test of basis   181824  2023-07-15 14:12:20 Z    1 days
Testing same since   181829  2023-07-17 02:43:44 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Ranbir Singh <Ranbir.Singh3@Dell.com>
  Ranbir Singh <rsingh@ventanamicro.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   f220dcbba8..dd49d448b0  dd49d448b0815c65847241a3faa957e3b4605001 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 06:06:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 06:06:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564156.881414 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLHNB-0004CF-Cn; Mon, 17 Jul 2023 06:06:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564156.881414; Mon, 17 Jul 2023 06:06:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLHNB-0004C8-A5; Mon, 17 Jul 2023 06:06:17 +0000
Received: by outflank-mailman (input) for mailman id 564156;
 Mon, 17 Jul 2023 06:06:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=cA2O=DD=linaro.org=philmd@srs-se1.protection.inumbo.net>)
 id 1qLHN9-0004C0-9c
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 06:06:15 +0000
Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com
 [2a00:1450:4864:20::22e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 08153a18-2468-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 08:06:12 +0200 (CEST)
Received: by mail-lj1-x22e.google.com with SMTP id
 38308e7fff4ca-2b9338e4695so19911751fa.2
 for <xen-devel@lists.xenproject.org>; Sun, 16 Jul 2023 23:06:12 -0700 (PDT)
Received: from [192.168.69.115] ([176.176.144.39])
 by smtp.gmail.com with ESMTPSA id
 p5-20020a5d4e05000000b003143d80d11dsm18078305wrt.112.2023.07.16.23.06.08
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 16 Jul 2023 23:06:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 08153a18-2468-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689573972; x=1692165972;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=V9PPbgd68wocT4TvRhmcO/nETjGOz62AhMV/Wt93B7Q=;
        b=ms+Ay07n0lyPm2SMUObQ9GjdsaldYs4VUWpkhI9RsYlip9CudCjC8ofTEhWMxc+gbc
         K0YtVClyOIFxttDZLliNzf3gbsIu835cEAVjrm05LoLwmD+xEpYYmElER6/tTcPAFvd/
         p2lztdzYDwdRIgKoaXXCaQGNTdGxMByqHznLfQzrSXnEnAliyuQIuPJ2DHdt8U8hDVUj
         pIIVhdinE7fn9LMpO4v4GDRrX6wVNxGYi92lYsJ/m30w58uxf/A8pv9pmFF9oslSdX7C
         f8TXdN/IpdnuJOIClc5E5kJaWu5AzB+RIbuDksQjbE4lIlj/YHAncSTpNp/lY1qETdK/
         eyqw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689573972; x=1692165972;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=V9PPbgd68wocT4TvRhmcO/nETjGOz62AhMV/Wt93B7Q=;
        b=NO/8CSZ+nOSkfxQzYzwn7peHFmXhOQ77eJxHVdxApRljAaMNtLDlILrcJ3/4m1ilUQ
         weYZgdBBxHaBHS5tnGoRNJodNlccs5ZpUbr5XUoUUbKjVFD39Fa7S6lomTKlHJ36I4RI
         Ws+G3Dqu9KV6sh3yZ/Y8hUVFB+ypHIqIcK8qANf8R/td9EP07xdtbIFTZd3F0kkT7AUb
         tiE2xIydVH+8mJH4kWqzEjOQJpqyepewM5VMpm2ux6JnEsSpr2RGK1ZAaYebK1yYvft0
         j7R/KTTYsZBf6w+Pve0iQkA9Bw8wtmKCCPkb2WyDXkKpX3AtIBWtLDbXsvJKTLmLD8dd
         RTMA==
X-Gm-Message-State: ABy/qLazzePH2L62wsZhZ1BQSk/XW3jdR5Le2wjHk9AFmxY5Z9vCYToX
	sRbaAsdG3WEFrRY+aM/2ZVtTYQ==
X-Google-Smtp-Source: APBJJlHW/NFDKdvFhoq+y8xrvjg5fcDRitDcC29a/QX354QST/fiAOhwToFZQukWGxzIAoA8z/fnRA==
X-Received: by 2002:a05:6512:1181:b0:4fb:7d73:d097 with SMTP id g1-20020a056512118100b004fb7d73d097mr6674575lfr.39.1689573972086;
        Sun, 16 Jul 2023 23:06:12 -0700 (PDT)
Message-ID: <45f89fee-6825-3f5d-9dfb-aad5d47c8c36@linaro.org>
Date: Mon, 17 Jul 2023 08:06:07 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v4 1/8] swiotlb: make io_tlb_default_mem local to
 swiotlb.c
Content-Language: en-US
To: Petr Tesarik <petrtesarik@huaweicloud.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Russell King <linux@armlinux.org.uk>,
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>,
 "H. Peter Anvin" <hpa@zytor.com>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "Rafael J. Wysocki" <rafael@kernel.org>, Juergen Gross <jgross@suse.com>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Christoph Hellwig <hch@lst.de>, Marek Szyprowski <m.szyprowski@samsung.com>,
 Robin Murphy <robin.murphy@arm.com>,
 Petr Tesarik <petr.tesarik.ext@huawei.com>, Jonathan Corbet
 <corbet@lwn.net>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
 Hans de Goede <hdegoede@redhat.com>, James Seo <james@equiv.tech>,
 James Clark <james.clark@arm.com>, Kees Cook <keescook@chromium.org>,
 "moderated list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>,
 "moderated list:ARM PORT" <linux-arm-kernel@lists.infradead.org>,
 open list <linux-kernel@vger.kernel.org>,
 "open list:MIPS" <linux-mips@vger.kernel.org>,
 "open list:XEN SWIOTLB SUBSYSTEM" <iommu@lists.linux.dev>
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
 Kefeng Wang <wangkefeng.wang@huawei.com>, petr@tesarici.cz
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
 <7f64111986f4f361a2deb4a1a1b6f588e63a851b.1689261692.git.petr.tesarik.ext@huawei.com>
From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= <philmd@linaro.org>
In-Reply-To: <7f64111986f4f361a2deb4a1a1b6f588e63a851b.1689261692.git.petr.tesarik.ext@huawei.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Petr,

On 13/7/23 17:23, Petr Tesarik wrote:
> From: Petr Tesarik <petr.tesarik.ext@huawei.com>
> 
> SWIOTLB implementation details should not be exposed to the rest of the
> kernel. This will allow to make changes to the implementation without
> modifying non-swiotlb code.
> 
> To avoid breaking existing users, provide helper functions for the few
> required fields.
> 
> As a bonus, using a helper function to initialize struct device allows to
> get rid of an #ifdef in driver core.
> 
> Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
> ---
>   arch/arm/xen/mm.c          |  2 +-
>   arch/mips/pci/pci-octeon.c |  2 +-
>   arch/x86/kernel/pci-dma.c  |  2 +-
>   drivers/base/core.c        |  4 +---
>   drivers/xen/swiotlb-xen.c  |  2 +-
>   include/linux/swiotlb.h    | 25 +++++++++++++++++++++++-
>   kernel/dma/swiotlb.c       | 39 +++++++++++++++++++++++++++++++++++++-
>   7 files changed, 67 insertions(+), 9 deletions(-)


> diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
> index 4e52cd5e0bdc..07216af59e93 100644
> --- a/include/linux/swiotlb.h
> +++ b/include/linux/swiotlb.h
> @@ -110,7 +110,6 @@ struct io_tlb_mem {
>   	atomic_long_t used_hiwater;
>   #endif
>   };
> -extern struct io_tlb_mem io_tlb_default_mem;
>   
>   static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
>   {
> @@ -128,13 +127,22 @@ static inline bool is_swiotlb_force_bounce(struct device *dev)
>   
>   void swiotlb_init(bool addressing_limited, unsigned int flags);
>   void __init swiotlb_exit(void);
> +void swiotlb_dev_init(struct device *dev);
>   size_t swiotlb_max_mapping_size(struct device *dev);
> +bool is_swiotlb_allocated(void);
>   bool is_swiotlb_active(struct device *dev);
>   void __init swiotlb_adjust_size(unsigned long size);
> +phys_addr_t default_swiotlb_start(void);
> +phys_addr_t default_swiotlb_limit(void);

Usually we use start/end, base/limit, low[est]/high[est] tuples.

Possibly clearer to rename, regardless:
Reviewed-by: Philippe Mathieu-DaudÃ© <philmd@linaro.org>

> diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
> index 2b83e3ad9dca..873b077d7e37 100644
> --- a/kernel/dma/swiotlb.c
> +++ b/kernel/dma/swiotlb.c


> @@ -958,6 +975,26 @@ bool is_swiotlb_active(struct device *dev)
>   }
>   EXPORT_SYMBOL_GPL(is_swiotlb_active);
>   
> +/**
> + * default_swiotlb_start() - get the start of the default SWIOTLB
> + *
> + * Get the lowest physical address used by the default software IO TLB pool.
> + */
> +phys_addr_t default_swiotlb_start(void)
> +{
> +	return io_tlb_default_mem.start;
> +}
> +
> +/**
> + * default_swiotlb_limit() - get the highest address in the default SWIOTLB
> + *
> + * Get the highest physical address used by the default software IO TLB pool.

(note you describe lowest/highest).

> + */
> +phys_addr_t default_swiotlb_limit(void)
> +{
> +	return io_tlb_default_mem.end - 1;
> +}
> +
>   #ifdef CONFIG_DEBUG_FS
>   
>   static int io_tlb_used_get(void *data, u64 *val)



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 06:35:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 06:35:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564159.881423 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLHpZ-0007b8-LK; Mon, 17 Jul 2023 06:35:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564159.881423; Mon, 17 Jul 2023 06:35:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLHpZ-0007b1-IT; Mon, 17 Jul 2023 06:35:37 +0000
Received: by outflank-mailman (input) for mailman id 564159;
 Mon, 17 Jul 2023 06:35:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLHpY-0007ar-9H; Mon, 17 Jul 2023 06:35:36 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLHpX-0002h1-JN; Mon, 17 Jul 2023 06:35:35 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLHpX-0004rw-7i; Mon, 17 Jul 2023 06:35:35 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLHpX-00068X-7G; Mon, 17 Jul 2023 06:35:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ri2G3hFXA91WdXzma3kP96F2HYJXi8bKlM9APn3MJ+o=; b=XSiPE+kK+Ik/2mpac6pQEARDTz
	p6e3masEOyWSqfWexhIOJt6ph6AhT6TnDuq8nRfeVWCf8k2Tae3+B9sXcrP7/0zldJ7OwqA2AK5jo
	R1n6zRm2F3wiDvJaGL4WRcco3cylheRe3UbTJ0kCHXnHDWS+I486C2+rIqZl7/MK9ESs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181830-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181830: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=3399f64588428010d48c754f3743bdc8131fa270
X-Osstest-Versions-That:
    ovmf=dd49d448b0815c65847241a3faa957e3b4605001
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 17 Jul 2023 06:35:35 +0000

flight 181830 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181830/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 3399f64588428010d48c754f3743bdc8131fa270
baseline version:
 ovmf                 dd49d448b0815c65847241a3faa957e3b4605001

Last test of basis   181829  2023-07-17 02:43:44 Z    0 days
Testing same since   181830  2023-07-17 04:42:10 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Nickle Wang <nicklew@nvidia.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   dd49d448b0..3399f64588  3399f64588428010d48c754f3743bdc8131fa270 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 06:40:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 06:40:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564164.881434 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLHu0-0000bc-5w; Mon, 17 Jul 2023 06:40:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564164.881434; Mon, 17 Jul 2023 06:40:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLHu0-0000bV-3C; Mon, 17 Jul 2023 06:40:12 +0000
Received: by outflank-mailman (input) for mailman id 564164;
 Mon, 17 Jul 2023 06:40:10 +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 <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLHty-0000bP-En
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 06:40:10 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on2062b.outbound.protection.outlook.com
 [2a01:111:f400:fe16::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c5288b8c-246c-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 08:40:08 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VE1PR04MB7295.eurprd04.prod.outlook.com (2603:10a6:800:1ac::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 06:40:05 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 06:40:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c5288b8c-246c-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Z3wBIWQb9wMYgmCQvwOTcE8wlf6saM44kONMJVGRcgLbHJ/U5yQJp6sg/qyrKvaBz02UIu3/JGztqv95jgwosc/BGfhsffHUvTjGLvg5ea+LEMrxJCpRvDhXEkjq8C4U7JBlLaf+W/mmOzJHL1zJL1DrV8G2obTfh3FmmKEJ8eQRWILu/ioMKqvfbO0hdpX6s7UO/mNJ/vT2bf40FCBcHI7iKnnjLRARWjgawFEjAfFkxxzWu5uLjMUYdUW7QtMtFqKtgXBzNIV/+073SRC4kmnJgdlOsViTvySDTPimeT9A/FSPjkAZysXo8fhpV7IwrE89A6TLRFC7hNm+qhaD+A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=VKmexXTbrUGTn9DQSN9fpZ/XfjPhjBUEKn6DOlNpc+c=;
 b=DRRU7xuf3pi3n+eR/ak9RB5zS5aW+gu30QDaw8vOQuq9c8I8oRjmMTzXyNGeG2PArI3P/YVp+VXuX6vpzIRsr3dNfvqx70it95zJTi4WIoJwMo9E2gYh4l1yDKPSUrTQ9nPoWlP1t+0ysGECGVCW/WCL2NrN+HK2eNyb5+3iobLQBJN+CzzakmT2TQGcbh1ckLosjIkIOYEF7WYAhPdXUIBCpv9DJewz+Ds+uobBkAcBHSMvVmf0FW9Vv/fu4iOdYwoMuIqd6/QCPsiEsY8q9Dnv3R9hDtZuKvAyBO3yw2ciKPZ3ctc+uy6Rfg0b9Dj4jJ8UfgM7skt4t/qsvsDWiw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=VKmexXTbrUGTn9DQSN9fpZ/XfjPhjBUEKn6DOlNpc+c=;
 b=v5De/NQLDu15xxC2ZzZApL/Whmd7h/ZfOihF/KWCSmxfWVA43cyOAmRxJ3twjYvFo0SBnBTfUGiz+/sEUHUB3C6E46VsW+M8y4qKchj6U8D59s3lPFwMYWU1iIZvzvmu0N3CPdL+XQbXxch2RkefWE6oKzjTd2VAYja0tZfEK77mFUh62fKnsEsUwwTzL1KVp1NT6vFZGn3reo2XF1AGpyoiP5XoIXOsV72X4slYX+jEMd/GzH1fM3okICYGnoNymCI7THHDPARMI7QvQtZtFQQ6+8pBg/Zh7+l4UQz0wzHFD8xigwJaCj52tzequJgk/BNfHB+nyAsnZeK1Z/gCIw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <2a2c1e47-767a-4029-bbc3-b809b0baaf75@suse.com>
Date: Mon, 17 Jul 2023 08:40:05 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] x86/ioapic: sanitize IO-APIC pins before enabling the
 local APIC
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <ZKwZBQ_0Z2c7NJNL@MacBook-Air-de-Roger.local>
 <1f79491a-46f5-5293-e92f-0e2b0b3efb62@suse.com>
 <ZK1S1V71ZUIPjKqZ@MacBook-Air-de-Roger.local>
 <eb2e3b57-a423-cf52-0192-a344db33a58f@suse.com>
 <ZK6wcpHnh5OgHv4R@MacBook-Air-de-Roger.local>
 <d84482f4-8be6-e514-58a7-a529890c8feb@suse.com>
 <ZK7JwEhrB-70nlla@MacBook-Air-de-Roger.local>
 <6d0ed712-0807-33b6-1586-a0588086c3a7@suse.com>
 <ZK_gHltq-1se3fau@MacBook-Air-de-Roger.local>
 <c2de675d-b4cd-1040-efa2-1b8b90448d90@suse.com>
 <ZLFyVugKWItJklcu@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZLFyVugKWItJklcu@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0067.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:49::21) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VE1PR04MB7295:EE_
X-MS-Office365-Filtering-Correlation-Id: bc05750b-9332-4864-d57f-08db8690a7c7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	rP00HS9BhJleFT5xe3U2EERZCGRMRdGbqInNcaQ2aacmeqXYLRzNxT4ubWXpFrNp/MsZQEHXFkvCjz/GHlr99EDfp1oxR5s3OA297cOppSWiTFpz3Jl8mBS69nCHRVpivD8cmzpxR67ox7yQiQdp3bQ1J1rm6Pa1r507HMrfyAiToEge3vlDYbxTgH/j6ecXtsH7JqkesqBbvT/lcgRT/T3aceyZLeM1F4fWaBNz/+z5pMz2ELZNM77EKiCb129F2cY3e1k2k/Y3UHAVTF336h0u5rv3+giB09Orw+7hDHwIGgZ0h9KIeMUuXIR8/Obgu/RGnRE0dfKnWkmEL3OmOpBcaIAr2M5NiujPxXgJgGb8Tb7ODByBK3bbC5RzMv8GZ4k9Zo0E0Oy/foLAwPjCZ1sGTwyA4I24e0azRqZ674o7PmawyOAjdD4cPrZ3CKaQOpmzHOWK6a0FZQT2lPk/yj2aKlv0lnlaEpdl96hLy6oYL3JkH4ikrXWjjcjgTzkMkg3jqkyQ985UV6RogM1w6uJCEMkPKVtxZWtDZZJMRKk1frhU1fbLoWt04rxFloLW8zUoD5a4IovBo0u1rBKZia4EOxpGrsP8JkX+Sv4uEsQKhwFQ9MLy0+hew9w8YgUo6cd8JgqIrHpS7Yme2fscUQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(136003)(39850400004)(366004)(396003)(451199021)(6486002)(26005)(6506007)(53546011)(6512007)(36756003)(2616005)(86362001)(31696002)(38100700002)(186003)(8676002)(8936002)(2906002)(41300700001)(478600001)(4326008)(5660300002)(316002)(6916009)(66946007)(66556008)(66476007)(54906003)(31686004)(66899021)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bjZEc2k5aTdwMXVwQmNQbXJRWHYyZVJFVDh4SzVCK050a0FiSzhxbHl1V0VD?=
 =?utf-8?B?bUptZE1tdFhhNlhrdTNTM3VrRER6TTRtdU1waTRqRk1oUW1TTmJCYysxckNy?=
 =?utf-8?B?N1FrTHBRQXNrQUp2WXpkYWR4ZDE2dGhFNU0yN2MrWGdpcXFNQkxaN0s5RVRD?=
 =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DZZT1NWbFhCMThXVkVsQlBTMUFGOXcz?=
 =?utf-8?B?cWZ2TXBuNkVaMFIrUzdKRk5VMTRBQzRPZDVvUmMvMkY0WkpXaVlLYVltR1lK?=
 =?utf-8?B?b1dEczlCV3pQM3JVS1NWdFFyM2lYQ1lJU09leHpVZ1dEYlZrekRvOFljRlFk?=
 =?utf-8?B?NzFSaW5aRjhjRWx1eldLanU3azZ0azFUblVCYTA3TG52TnR5RXhla1BTSmxx?=
 =?utf-8?Q?G2gt11aGFTCgO1Rzu0c+856WO?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bc05750b-9332-4864-d57f-08db8690a7c7
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 06:40:05.2308
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Sl7eEwChtSlKm5XS0As3GD3N7lrbbmn5JsG5EyzgKiSPSU1wqWmUgPfVkqVpoO8MQjROAzs3iApjuNZ77TnoTA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7295

On 14.07.2023 18:05, Roger Pau MonnÃ© wrote:
> On Thu, Jul 13, 2023 at 02:18:29PM +0200, Jan Beulich wrote:
>> On 13.07.2023 13:29, Roger Pau MonnÃ© wrote:
>>> So to recap, I think we are in agreement that calling enable_IO_APIC()
>>> just ahead of the call to setup_local_APIC() is the preferred
>>> solution?
>>
>> Well, yes and no. My preferred course of action for the issue at hand
>> would be to convert RTE 0 to ExtInt (under the mentioned set of
>> conditions). I agree though that we also want to move the masking of
>> RTEs, and for that I further agree with the placement mentioned above.
> 
> So I hacked up a change to set pin 0 to ExtINT mode (and avoid doing
> the masking early), and I got:
> 
> (XEN) spurious 8259A interrupt: IRQ7.
> 
> This was a single interrupt, but still I think the masking is the
> critical part to get backported.

One way to look at it, yes. My perspective is different though: If
there truly is a (spurious or not) IRQ at the 8259, then it needs
dealing with sooner or later (in the process of booting). Aiui if
we masked pin 0 initially and then later unmasked it (after
switching to ExtInt, if not set so by firmware), we'd still see a
spurious IRQ7.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564172.881444 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIXt-0005AH-5g; Mon, 17 Jul 2023 07:21:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564172.881444; Mon, 17 Jul 2023 07:21:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIXt-0005AA-26; Mon, 17 Jul 2023 07:21:25 +0000
Received: by outflank-mailman (input) for mailman id 564172;
 Mon, 17 Jul 2023 07:21:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIXr-0005A3-0Q
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:23 +0000
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com
 [2a00:1450:4864:20::134])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 87e25e77-2472-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 09:21:22 +0200 (CEST)
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-4fb863edcb6so6584613e87.0
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:22 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 87e25e77-2472-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578481; x=1692170481;
        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=7RE6uG9NjzKwawEyJ2gsdMq0MHWGazWEuP8uHbPdmuU=;
        b=zWNOzeXta3SSh8fEY3svaVDiKh1QL/i98lXyuLzVAeqC98dgvekXp17KodV8L8Da+S
         q1SNlq2MlUZgD6uAav71n9zzRrJ285CmxpQ3LKfB9+ne6FnZWLLDIgugOPdkG7QaQKUw
         zxSKS0DNdXJWltjMxbnnnqmj9YrzUGsEXdGHEEC5B4V6X6tT3SxMckY+1EQzfKAqRhjV
         JTbatKQYo2nwq+ZSMcH8s5wdq1veUdownCcSH20KpQXT1DGhyL4bbIxT9pMsQK2jrsAQ
         0cMBniQW9WyNQNzJjZkZTr0NvZo/6wMfAjKhFq1+G2AawUZbabbh8JFUAZZAbPy4tDL/
         4YmQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578481; x=1692170481;
        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=7RE6uG9NjzKwawEyJ2gsdMq0MHWGazWEuP8uHbPdmuU=;
        b=GDhKO5VUP06Uo3luVJ5hIKj3YD+6b1RUEgGmv7iF0mZHH4m2Rc3unOXw8R84ZCBXU0
         p1a/uYZKzGFKJ6BC8XFnJMZce55RvrM2+EGP9CKmsvlT44iduYeB9BJqhGZRJf2BBIC9
         Mjq1SKGToCB9VBlrK1xi++AznV8Qs/Gh5JtX0bvbURK/C1xPCSMMkcIFKBQEHs3j0PQQ
         8GzHXOD8zX8eU/44I3Q6SnqSaNCWKlRN/Ok8qxFAEJSJGJi8R7sHuoB4pcr+Ez7pXEm9
         69paC+HMXvB0RaD74Ru5uWXWhetYVvJgNz9iBnNYJhTeWRKVReyKhr2r1zbS+6RGUIDv
         FCBw==
X-Gm-Message-State: ABy/qLaANZnpkfAvT92tVh5apEihWXyDa+eb1ur9059PqHZlwiUY5T3p
	yMycVa+RS1QMsgxZUUUuCJ/YNxXETUNtygFvSas=
X-Google-Smtp-Source: APBJJlGeN3T6Hgojf0g7hw68B554gvcSk/HnHMYLTAMBsluJJgWJmx0JTC5gYyMwfff0qCOyOvzovg==
X-Received: by 2002:a05:6512:2392:b0:4f9:5718:70b3 with SMTP id c18-20020a056512239200b004f9571870b3mr8576528lfv.31.1689578481324;
        Mon, 17 Jul 2023 00:21:21 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Jan Beulich <jbeulich@suse.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Jan Beulich <JBeulich@suse.com>
Subject: [XEN PATCH v10 01/24] xen: Introduce arch_domain_teardown()
Date: Mon, 17 Jul 2023 09:20:44 +0200
Message-Id: <20230717072107.753304-2-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From: Andrew Cooper <andrew.cooper3@citrix.com>

Plumb it into domain_teardown().  Provide arch_val in the teardown
continuation information for use by arch_domain_teardown().

No practical change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Jens Wiklander <jens.wiklander@linaro.org>

v9 -> v10
- Added Jan's and Bertand's tags
---
 xen/arch/arm/domain.c    | 5 +++++
 xen/arch/x86/domain.c    | 5 +++++
 xen/common/domain.c      | 6 ++++++
 xen/include/xen/domain.h | 1 +
 xen/include/xen/sched.h  | 1 +
 5 files changed, 18 insertions(+)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 8c18e9207907..15d9709a97d2 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -793,6 +793,11 @@ fail:
     return rc;
 }
 
+int arch_domain_teardown(struct domain *d)
+{
+    return 0;
+}
+
 void arch_domain_destroy(struct domain *d)
 {
     /* IOMMU page table is shared with P2M, always call
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 39c215316546..5f66c2ae33d7 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -888,6 +888,11 @@ int arch_domain_create(struct domain *d,
     return rc;
 }
 
+int arch_domain_teardown(struct domain *d)
+{
+    return 0;
+}
+
 void arch_domain_destroy(struct domain *d)
 {
     if ( is_hvm_domain(d) )
diff --git a/xen/common/domain.c b/xen/common/domain.c
index caaa40263792..304aa04fa6cb 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -439,6 +439,7 @@ static int domain_teardown(struct domain *d)
             PROG_none,
             PROG_gnttab_mappings,
             PROG_vcpu_teardown,
+            PROG_arch_teardown,
             PROG_done,
         };
 
@@ -459,6 +460,11 @@ static int domain_teardown(struct domain *d)
                 return rc;
         }
 
+    PROGRESS(arch_teardown):
+        rc = arch_domain_teardown(d);
+        if ( rc )
+            return rc;
+
     PROGRESS(done):
         break;
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 1df8f933d076..d35af348410c 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -81,6 +81,7 @@ int arch_domain_create(struct domain *d,
                        struct xen_domctl_createdomain *config,
                        unsigned int flags);
 
+int arch_domain_teardown(struct domain *d);
 void arch_domain_destroy(struct domain *d);
 
 void arch_domain_shutdown(struct domain *d);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 85242a73d374..854f3e32c00e 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -589,6 +589,7 @@ struct domain
      */
     struct {
         unsigned int val;
+        unsigned int arch_val;
         struct vcpu *vcpu;
     } teardown;
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564178.881499 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIXy-0006Ro-8f; Mon, 17 Jul 2023 07:21:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564178.881499; Mon, 17 Jul 2023 07:21:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIXy-0006Qg-2g; Mon, 17 Jul 2023 07:21:30 +0000
Received: by outflank-mailman (input) for mailman id 564178;
 Mon, 17 Jul 2023 07:21:28 +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
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIXw-0005A9-9x
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:28 +0000
Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com
 [2a00:1450:4864:20::12b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8ab55b1a-2472-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 09:21:26 +0200 (CEST)
Received: by mail-lf1-x12b.google.com with SMTP id
 2adb3069b0e04-4f122ff663eso6448768e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:26 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8ab55b1a-2472-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578486; x=1692170486;
        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=dqoldXxWy8H0mye06Jm+vbzYDtmZMz3z5RdS7rzJXrI=;
        b=k5s9hWg0UjMMBvk2rvqYEsCQ+9oVoo/BjP4XJxw9Qn74sKitjmiunmrrj84bOCM5oL
         JUO9qNu9Y0n1xrx8RoDajzyAIW37ENS0WNnlOq8Bd7Qcs/02Tu6Tf6dQBlW2/a+qs8CS
         36ZuvxaSe8ElAWll3npoltLAnrgRHw1mZH2hY4+3xcPjrfAvjpvwusio5Uh9wjJJhnC3
         isUwYLq/hFMXjE5NkUdYXJp9XMoVaTYyvvh6HbIZawOjtoDZt0i7yi+qiMkDF3HNbUdC
         HWNds8NH+JkohvFg3b2jdblQZ2b8Sr1hTlqiTK5Hj751ZnOoYoP/4V9BBr1rQFYJX0Z1
         6hXg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578486; x=1692170486;
        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=dqoldXxWy8H0mye06Jm+vbzYDtmZMz3z5RdS7rzJXrI=;
        b=WyzOU3kEaPWiepOpr+iGR10dc4Lgu+EE73Ik3cYvd1YncmpoOXBbMjFz4eLOy4ORt0
         YAQH7jT1UUnurT1Fp9f2K0Kb7v/2RkFVMGFPefCnJjLmm7+V+5T5enDx3S/r1RAr4L6N
         7fnXmH7cQFTuOwWLPJt3MM99XGgpZUYZcXUvw9Q1Gu1P5diGOQnYlNM9FNebB77/3HdO
         b9dsz9d16adv6bCez1AyVrYDGgSNEZTJ+JKucVFPViB1TGDX9Urm8CHWiWetuBEuY3eQ
         dZCg8V4rs9jMV8X+i+BUZdo+RPkUER5X4HPtP/eGxFqnR1LvbQd+6u2gAj+uI0wfdOGz
         0GiA==
X-Gm-Message-State: ABy/qLaT7xUlh58aof3HF3oPMecrd6JlKPl4OfhdhKccLQVzv7k67IIr
	oSYLZvwkfTCSsPADA0JBO90+vWOt2U2DXn/l1qM=
X-Google-Smtp-Source: APBJJlFsPVqb1ZKW99UCUnllvrT3Wz1ecmkenPUbmhg7YarNaX6cyia4T22tYLKgNzCZYPDh/tRMog==
X-Received: by 2002:ac2:4c0b:0:b0:4fb:73ba:5d9c with SMTP id t11-20020ac24c0b000000b004fb73ba5d9cmr6460037lfq.17.1689578485988;
        Mon, 17 Jul 2023 00:21:25 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v10 05/24] xen/arm: ffa: add remaining SMC function IDs
Date: Mon, 17 Jul 2023 09:20:48 +0200
Message-Id: <20230717072107.753304-6-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds the remaining SMC function IDs from FF-A 1.1 specification,
DEN0077A version 1.1 REL0.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 xen/arch/arm/tee/ffa.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 927c4d33a380..2296e3115beb 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -60,7 +60,41 @@
 /* Function IDs */
 #define FFA_ERROR                       0x84000060U
 #define FFA_SUCCESS_32                  0x84000061U
+#define FFA_SUCCESS_64                  0xC4000061U
+#define FFA_INTERRUPT                   0x84000062U
 #define FFA_VERSION                     0x84000063U
+#define FFA_FEATURES                    0x84000064U
+#define FFA_RX_ACQUIRE                  0x84000084U
+#define FFA_RX_RELEASE                  0x84000065U
+#define FFA_RXTX_MAP_32                 0x84000066U
+#define FFA_RXTX_MAP_64                 0xC4000066U
+#define FFA_RXTX_UNMAP                  0x84000067U
+#define FFA_PARTITION_INFO_GET          0x84000068U
+#define FFA_ID_GET                      0x84000069U
+#define FFA_SPM_ID_GET                  0x84000085U
+#define FFA_MSG_WAIT                    0x8400006BU
+#define FFA_MSG_YIELD                   0x8400006CU
+#define FFA_RUN                         0x8400006DU
+#define FFA_MSG_SEND2                   0x84000086U
+#define FFA_MSG_SEND_DIRECT_REQ_32      0x8400006FU
+#define FFA_MSG_SEND_DIRECT_REQ_64      0xC400006FU
+#define FFA_MSG_SEND_DIRECT_RESP_32     0x84000070U
+#define FFA_MSG_SEND_DIRECT_RESP_64     0xC4000070U
+#define FFA_MEM_DONATE_32               0x84000071U
+#define FFA_MEM_DONATE_64               0xC4000071U
+#define FFA_MEM_LEND_32                 0x84000072U
+#define FFA_MEM_LEND_64                 0xC4000072U
+#define FFA_MEM_SHARE_32                0x84000073U
+#define FFA_MEM_SHARE_64                0xC4000073U
+#define FFA_MEM_RETRIEVE_REQ_32         0x84000074U
+#define FFA_MEM_RETRIEVE_REQ_64         0xC4000074U
+#define FFA_MEM_RETRIEVE_RESP           0x84000075U
+#define FFA_MEM_RELINQUISH              0x84000076U
+#define FFA_MEM_RECLAIM                 0x84000077U
+#define FFA_MEM_FRAG_RX                 0x8400007AU
+#define FFA_MEM_FRAG_TX                 0x8400007BU
+#define FFA_MSG_SEND                    0x8400006EU
+#define FFA_MSG_POLL                    0x8400006AU
 
 struct ffa_ctx {
     /* FF-A version used by the guest */
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564175.881474 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIXw-0005tF-5J; Mon, 17 Jul 2023 07:21:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564175.881474; Mon, 17 Jul 2023 07:21:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIXw-0005t8-2K; Mon, 17 Jul 2023 07:21:28 +0000
Received: by outflank-mailman (input) for mailman id 564175;
 Mon, 17 Jul 2023 07:21:26 +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
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIXu-0005A9-2B
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:26 +0000
Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com
 [2a00:1450:4864:20::22f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 893edf61-2472-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 09:21:24 +0200 (CEST)
Received: by mail-lj1-x22f.google.com with SMTP id
 38308e7fff4ca-2b946602d64so2673711fa.0
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:24 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 893edf61-2472-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578483; x=1692170483;
        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=sPB2Dc6t3Zgd1EEjPsex1QWFM8C9VFNKedpjWqBxO5k=;
        b=V22QfuOvnrz2ZMKPpbLsf8tnrMXE/ezbAbUc/m06Cfu+FlBDYuKhrFWUmPQzq+dZ+L
         MjZvwlwKX9kFQgiRGpCTXW9Ktlg/ENe4UWhgG97/bIeTGYjq66G6spi/fJUoUVZGqc6G
         tLornI/HoFmZiT0pbSi6gArdQ/8KcGvA4i2UP19q+xdbdSEbpBrsavA7uXbELffRWHQy
         Md31Mg3Ahr+xfa55TjhIRH4lEtjisRGQR62i2gr8CxunH6mfHGev6HDjjLdzyjF7mlN7
         qWR20e5InWoPW+vI6vghNKxyxbF2rpiz0KWfbbvW3h9oJthJzwr7YIUiOsa4xAXByOXX
         ID/A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578483; x=1692170483;
        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=sPB2Dc6t3Zgd1EEjPsex1QWFM8C9VFNKedpjWqBxO5k=;
        b=LV8OpPcw6LIyk1Kw1NWQ0D0RflrG64ncr96YveWwLjnaVUX8Z0VEvbGF+JHvn9DCCc
         YPoMiL/Ztp8zq14VgQiBYw+xGIPDbT7fKSWsGnvA1V7SDyrptsxSGxEKyP30cT3rcsUb
         ALyB0/cKK3KYn1bLg3foSxKUSzKcYBHa7gbmSdr+OPw8EQRfxN1TFVwRQjnsSGGOYUbD
         Jx4ZrgqB3SKDqhaGbjZ9BtO3JaqeYM9SWo5GKkT2/sd3SQyuAVMahLFAIdP/hGUOrCD5
         a6NfpsV55Fo7oWV5NENZXX9hASUbvupyVkAmgbN1rYLTp7uGoLQ1543wdRcBZ9PIkdKm
         dlDw==
X-Gm-Message-State: ABy/qLaRNQDFwyHMk5UOSj7R/MiEa2ypvJ8TdV938KwSIX0c5ph57nBm
	MnTgdNFqwocxB0DhRjp5UbkI7vVDwUGPG2F6Do0=
X-Google-Smtp-Source: APBJJlFhv/HAHZq3LJyFZmgq1sZPcwSSK8rc5jEZbHc6Bywkzh9GPJhEqSyHRRnZWHklGW1ywNcTxQ==
X-Received: by 2002:a05:6512:2313:b0:4f9:51b7:a19c with SMTP id o19-20020a056512231300b004f951b7a19cmr9120809lfu.19.1689578483607;
        Mon, 17 Jul 2023 00:21:23 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Luca Fancellu <luca.fancellu@arm.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [XEN PATCH v10 03/24] xen/arm: smccc: add support for SMCCCv1.2 extended input/output registers
Date: Mon, 17 Jul 2023 09:20:46 +0200
Message-Id: <20230717072107.753304-4-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

SMCCC v1.2 [1] AArch64 allows x0-x17 to be used as both parameter
registers and result registers for the SMC and HVC instructions.

Arm Firmware Framework for Armv8-A specification makes use of x0-x7 as
parameter and result registers.

Let us add new interface to support this extended set of input/output
registers.

This is based on 3fdc0cb59d97 ("arm64: smccc: Add support for SMCCCv1.2
extended input/output registers") by Sudeep Holla from the Linux kernel

The SMCCC version reported to the VM is bumped to 1.2 in order to support
handling FF-A messages.

[1] https://developer.arm.com/documentation/den0028/c/?lang=en

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/arm64/asm-offsets.c |  9 +++++++
 xen/arch/arm/arm64/smc.S         | 42 ++++++++++++++++++++++++++++++++
 xen/arch/arm/include/asm/smccc.h | 40 ++++++++++++++++++++++++++++++
 xen/arch/arm/vsmc.c              |  2 +-
 4 files changed, 92 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/arm64/asm-offsets.c b/xen/arch/arm/arm64/asm-offsets.c
index 7226cd9b2eb0..7adb67a1b81a 100644
--- a/xen/arch/arm/arm64/asm-offsets.c
+++ b/xen/arch/arm/arm64/asm-offsets.c
@@ -57,6 +57,15 @@ void __dummy__(void)
    BLANK();
    OFFSET(SMCCC_RES_a0, struct arm_smccc_res, a0);
    OFFSET(SMCCC_RES_a2, struct arm_smccc_res, a2);
+   OFFSET(ARM_SMCCC_1_2_REGS_X0_OFFS, struct arm_smccc_1_2_regs, a0);
+   OFFSET(ARM_SMCCC_1_2_REGS_X2_OFFS, struct arm_smccc_1_2_regs, a2);
+   OFFSET(ARM_SMCCC_1_2_REGS_X4_OFFS, struct arm_smccc_1_2_regs, a4);
+   OFFSET(ARM_SMCCC_1_2_REGS_X6_OFFS, struct arm_smccc_1_2_regs, a6);
+   OFFSET(ARM_SMCCC_1_2_REGS_X8_OFFS, struct arm_smccc_1_2_regs, a8);
+   OFFSET(ARM_SMCCC_1_2_REGS_X10_OFFS, struct arm_smccc_1_2_regs, a10);
+   OFFSET(ARM_SMCCC_1_2_REGS_X12_OFFS, struct arm_smccc_1_2_regs, a12);
+   OFFSET(ARM_SMCCC_1_2_REGS_X14_OFFS, struct arm_smccc_1_2_regs, a14);
+   OFFSET(ARM_SMCCC_1_2_REGS_X16_OFFS, struct arm_smccc_1_2_regs, a16);
 }
 
 /*
diff --git a/xen/arch/arm/arm64/smc.S b/xen/arch/arm/arm64/smc.S
index 91bae62dd4d2..fc6b676e2ee3 100644
--- a/xen/arch/arm/arm64/smc.S
+++ b/xen/arch/arm/arm64/smc.S
@@ -27,3 +27,45 @@ ENTRY(__arm_smccc_1_0_smc)
         stp     x2, x3, [x4, #SMCCC_RES_a2]
 1:
         ret
+
+/*
+ * void arm_smccc_1_2_smc(const struct arm_smccc_1_2_regs *args,
+ *                        struct arm_smccc_1_2_regs *res)
+ */
+ENTRY(arm_smccc_1_2_smc)
+    /* Save `res` and free a GPR that won't be clobbered by SMC call */
+    stp     x1, x19, [sp, #-16]!
+
+    /* Ensure `args` won't be clobbered while loading regs in next step */
+    mov	x19, x0
+
+    /* Load the registers x0 - x17 from the struct arm_smccc_1_2_regs */
+    ldp	x0, x1, [x19, #ARM_SMCCC_1_2_REGS_X0_OFFS]
+    ldp	x2, x3, [x19, #ARM_SMCCC_1_2_REGS_X2_OFFS]
+    ldp	x4, x5, [x19, #ARM_SMCCC_1_2_REGS_X4_OFFS]
+    ldp	x6, x7, [x19, #ARM_SMCCC_1_2_REGS_X6_OFFS]
+    ldp	x8, x9, [x19, #ARM_SMCCC_1_2_REGS_X8_OFFS]
+    ldp	x10, x11, [x19, #ARM_SMCCC_1_2_REGS_X10_OFFS]
+    ldp	x12, x13, [x19, #ARM_SMCCC_1_2_REGS_X12_OFFS]
+    ldp	x14, x15, [x19, #ARM_SMCCC_1_2_REGS_X14_OFFS]
+    ldp	x16, x17, [x19, #ARM_SMCCC_1_2_REGS_X16_OFFS]
+
+    smc #0
+
+    /* Load the `res` from the stack */
+    ldr	x19, [sp]
+
+    /* Store the registers x0 - x17 into the result structure */
+    stp	x0, x1, [x19, #ARM_SMCCC_1_2_REGS_X0_OFFS]
+    stp	x2, x3, [x19, #ARM_SMCCC_1_2_REGS_X2_OFFS]
+    stp	x4, x5, [x19, #ARM_SMCCC_1_2_REGS_X4_OFFS]
+    stp	x6, x7, [x19, #ARM_SMCCC_1_2_REGS_X6_OFFS]
+    stp	x8, x9, [x19, #ARM_SMCCC_1_2_REGS_X8_OFFS]
+    stp	x10, x11, [x19, #ARM_SMCCC_1_2_REGS_X10_OFFS]
+    stp	x12, x13, [x19, #ARM_SMCCC_1_2_REGS_X12_OFFS]
+    stp	x14, x15, [x19, #ARM_SMCCC_1_2_REGS_X14_OFFS]
+    stp	x16, x17, [x19, #ARM_SMCCC_1_2_REGS_X16_OFFS]
+
+    /* Restore original x19 */
+    ldp     xzr, x19, [sp], #16
+    ret
diff --git a/xen/arch/arm/include/asm/smccc.h b/xen/arch/arm/include/asm/smccc.h
index b3dbeecc90ad..1adcd37443c7 100644
--- a/xen/arch/arm/include/asm/smccc.h
+++ b/xen/arch/arm/include/asm/smccc.h
@@ -33,6 +33,7 @@
 
 #define ARM_SMCCC_VERSION_1_0   SMCCC_VERSION(1, 0)
 #define ARM_SMCCC_VERSION_1_1   SMCCC_VERSION(1, 1)
+#define ARM_SMCCC_VERSION_1_2   SMCCC_VERSION(1, 2)
 
 /*
  * This file provides common defines for ARM SMC Calling Convention as
@@ -265,6 +266,45 @@ void __arm_smccc_1_0_smc(register_t a0, register_t a1, register_t a2,
         else                                                    \
             arm_smccc_1_0_smc(__VA_ARGS__);                     \
     } while ( 0 )
+
+/*
+ * struct arm_smccc_1_2_regs - Arguments for or Results from SMC call
+ * @a0-a17 argument values from registers 0 to 17
+ */
+struct arm_smccc_1_2_regs {
+    unsigned long a0;
+    unsigned long a1;
+    unsigned long a2;
+    unsigned long a3;
+    unsigned long a4;
+    unsigned long a5;
+    unsigned long a6;
+    unsigned long a7;
+    unsigned long a8;
+    unsigned long a9;
+    unsigned long a10;
+    unsigned long a11;
+    unsigned long a12;
+    unsigned long a13;
+    unsigned long a14;
+    unsigned long a15;
+    unsigned long a16;
+    unsigned long a17;
+};
+
+/*
+ * arm_smccc_1_2_smc() - make SMC calls
+ * @args: arguments passed via struct arm_smccc_1_2_regs
+ * @res: result values via struct arm_smccc_1_2_regs
+ *
+ * This function is used to make SMC calls following SMC Calling Convention
+ * v1.2 or above. The content of the supplied param are copied from the
+ * structure to registers prior to the SMC instruction. The return values
+ * are updated with the content from registers on return from the SMC
+ * instruction.
+ */
+void arm_smccc_1_2_smc(const struct arm_smccc_1_2_regs *args,
+                       struct arm_smccc_1_2_regs *res);
 #endif /* CONFIG_ARM_64 */
 
 #endif /* __ASSEMBLY__ */
diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c
index 7335276f3fa1..cd68fa80e98a 100644
--- a/xen/arch/arm/vsmc.c
+++ b/xen/arch/arm/vsmc.c
@@ -85,7 +85,7 @@ static bool handle_arch(struct cpu_user_regs *regs)
     switch ( fid )
     {
     case ARM_SMCCC_VERSION_FID:
-        set_user_reg(regs, 0, ARM_SMCCC_VERSION_1_1);
+        set_user_reg(regs, 0, ARM_SMCCC_VERSION_1_2);
         return true;
 
     case ARM_SMCCC_ARCH_FEATURES_FID:
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564179.881514 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIXz-0006ub-No; Mon, 17 Jul 2023 07:21:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564179.881514; Mon, 17 Jul 2023 07:21:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIXz-0006uM-He; Mon, 17 Jul 2023 07:21:31 +0000
Received: by outflank-mailman (input) for mailman id 564179;
 Mon, 17 Jul 2023 07:21:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIXx-0005A3-8H
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:29 +0000
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com
 [2a00:1450:4864:20::134])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8c049270-2472-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 09:21:28 +0200 (CEST)
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-4fbf09a9139so6406620e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:28 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:27 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8c049270-2472-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578488; x=1692170488;
        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=aYcDkH+NYTJEg4WTYuKdvOgpJpdPrLrE00Jo/az+PMc=;
        b=qeEQVTU/uIhG8giLV5/dRxCZSgeeq27GxFS1BpEHcNfafLbkqtZw2O6dbThI/1u5WC
         xHvUYXV0OOfO5n/+j/S+JHu6jOatAEp65GcNRyuMrOiVxnGQu1t8vh5Q+JYyqd33UmQH
         gD/vwXQuAE4g0o5omSj3feSh4rO3U6fn6P0ivkkmIXBRJuwQGmvP/fqjR32zPmDqE65R
         VTVU/44a2FritFQR4J/8IbJCyeINhM1GBftaLYAIZXxN5BkNlwONsYpq8VzFWVJ86eWY
         E2CSq1BNnNkCdG8mX/eIrhURo1OXak79JVSMsj0IW1hHcus/wt2jZoohyuiaDS3joSo6
         7gfA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578488; x=1692170488;
        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=aYcDkH+NYTJEg4WTYuKdvOgpJpdPrLrE00Jo/az+PMc=;
        b=QnZQhvwWr+wUeRHqorR1W5owq/8sHGBETMv1wNwuG3ffGx3QwGmdiwLPQcOwJrMX0W
         DHhTJvanuUt1C6q+GGSlqixpG9lWoDCyiLBOIt0894woZnbn7jkOwNr7+jP4mUzkZu5T
         z4MIHfyywuZqLNrXreEhCIv/lafEj4SjRfqLRYI/tcRP74iYtVjqdEeFaIFoDZ/lQZ5s
         1h92ryymmeO/GoHamc18twPbbn88+t0QScrJQ5TWrg1zyxtt7CkSLTrskPTlQBcqk8CM
         8VNH3Wb2gRbtLK1NitlNYZZEv+70OwELCyRFL+jKvlu2mXLteRB8CYNRezKmPb9wl/cR
         8PAQ==
X-Gm-Message-State: ABy/qLYskJUO7lQQcC7IIHSc6alHdaHtAGAQt4O59G4oUSp7BqlS3Phu
	N1WsWOVqtoSF7mYP4fwTZSMBKfoByvcoRzv8wxQ=
X-Google-Smtp-Source: APBJJlFH+UTCquq5aztcb0YP7Hsbl7pIWV1DEcjUzXSobzinHuk8hvDcwyb7CKsP9C3Gndp2YEx/jQ==
X-Received: by 2002:a05:6512:3d89:b0:4fd:c23b:959d with SMTP id k9-20020a0565123d8900b004fdc23b959dmr749729lfv.34.1689578488247;
        Mon, 17 Jul 2023 00:21:28 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v10 07/24] xen/arm: ffa: add defines for framework direct request/response messages
Date: Mon, 17 Jul 2023 09:20:50 +0200
Message-Id: <20230717072107.753304-8-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

According to DEN0077A version 1.1 REL0, section 18.3, Table 18.{21, 25,
26, 27, 28}, add defines for framework direct request/response messages.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 xen/arch/arm/tee/ffa.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index c1dead73d1f2..56a0a10c1e99 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -57,6 +57,19 @@
 #define FFA_MY_VERSION          MAKE_FFA_VERSION(FFA_MY_VERSION_MAJOR, \
                                                  FFA_MY_VERSION_MINOR)
 
+/*
+ * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
+ * BIT(31): Framework or partition message
+ * BIT(7-0): Message type for frameworks messages
+ */
+#define FFA_MSG_FLAG_FRAMEWORK          BIT(31, U)
+#define FFA_MSG_TYPE_MASK               0xFFU;
+#define FFA_MSG_PSCI                    0x0U
+#define FFA_MSG_SEND_VM_CREATED         0x4U
+#define FFA_MSG_RESP_VM_CREATED         0x5U
+#define FFA_MSG_SEND_VM_DESTROYED       0x6U
+#define FFA_MSG_RESP_VM_DESTROYED       0x7U
+
 /*
  * Flags to determine partition properties in FFA_PARTITION_INFO_GET return
  * message:
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564174.881459 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIXu-0005RW-Mp; Mon, 17 Jul 2023 07:21:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564174.881459; Mon, 17 Jul 2023 07:21:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIXu-0005Qr-Ih; Mon, 17 Jul 2023 07:21:26 +0000
Received: by outflank-mailman (input) for mailman id 564174;
 Mon, 17 Jul 2023 07:21:25 +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
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIXt-0005A9-IH
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:25 +0000
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com
 [2a00:1450:4864:20::134])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 888e111e-2472-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 09:21:23 +0200 (CEST)
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-4fdb856482fso1593739e87.1
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:23 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 888e111e-2472-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578482; x=1692170482;
        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=YTfecuZmrRJwBVogB5ezh0l17VaUmLGIInWmzQbInCM=;
        b=U1NSUyiVi6jtMu3mg8RQU/en91jHmETszTobKfYoQmXczC1bl4tr9TwuZRHjsGsFkr
         v/1XmKo9NAkqovtQrqvO/e0YV70HUEDMGhWf1F30cpHGmUauCSnzIZLSaJBzdc0K33p3
         n5HQSF+3nTpRxoyx9sSWrrZpESUs6UMoLdzqt7LT6V5zR0XBBbsP2PWfSF7wH7yMPNNr
         p2P7SqALo0IJVZAQF8SYeBOLEoTDyXLKOXh1tpERWErEn/uJM+t6oEqG0YHPPKPsn4e7
         c2f4an7A8WnHzpxRJspn62Ux++SVEfrJRfuZSQQPtyadwDFiX6tJxzx72b2FI0lYQflF
         7bwA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578482; x=1692170482;
        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=YTfecuZmrRJwBVogB5ezh0l17VaUmLGIInWmzQbInCM=;
        b=G+9QdqgkyzK5DAfvmazZ5Ca64S8k08qxIFIFKWwsIuoy8NcpjigNbxLP14+ljt+TvH
         7MaiL/ul1meT8qnOHuHShxvKBIO5aMeJOOX7jX3a+82tBAmoXFA2DqMixQh7ekY18AX2
         GyV7pHrOHkerA0saIWfjo2PRD/JHZ93JxR8qty3Ha/dnVzQdJ97AxtOT7xDvJSc2nz8M
         a9JAZndcklunmEuB8hnNFcfixnD1JX44H6xOQ342OR6n1zUb6jPpnOeP+nqKn4KUkbuJ
         cr72EdoTLEgLV97yETTpsxzE7yotmdXEnR3EMg9c3e3Na4b6ByKnfOFfL96zirGile+g
         vS9A==
X-Gm-Message-State: ABy/qLZauEUK6ok1j77FY5PX0Y2He7w+oWKahRvXhaykZtIs/KfNrKuk
	c79PnqseV5ewHYSefz7S/P0Mz7YYQcaMQ7Pmflw=
X-Google-Smtp-Source: APBJJlGS7Quup9l3ju/k3iUE/XW1VXwPVottBcHg+Om5+3MgG1Z2JfOJLGZfHQWUWvfP+7Tf3LpjMg==
X-Received: by 2002:a05:6512:3a89:b0:4fb:89e2:fc27 with SMTP id q9-20020a0565123a8900b004fb89e2fc27mr9113874lfu.54.1689578482395;
        Mon, 17 Jul 2023 00:21:22 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v10 02/24] xen/arm: add TEE teardown to arch_domain_teardown()
Date: Mon, 17 Jul 2023 09:20:45 +0200
Message-Id: <20230717072107.753304-3-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds a progress state for tee_domain_teardown() to be called from
arch_domain_teardown(). tee_domain_teardown() calls the new callback
domain_teardown() in struct tee_mediator_ops.

Note that the OP-TEE mediator should be updated in a future patch to use
the new teardown facility, that is not done here.

Co-developed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

---
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Jens Wiklander <jens.wiklander@linaro.org>

v9 -> v10

- Swapped Andrews tags in the commit message
- Added Bertand's tag
- Removed the erroneous unconditional break switch statement in
  arch_domain_teardown()
- Updated commit message to note that the OP-TEE mediator also should
  use the new teardown facility.
---
 xen/arch/arm/domain.c              | 35 ++++++++++++++++++++++++++++++
 xen/arch/arm/include/asm/tee/tee.h |  7 ++++++
 xen/arch/arm/tee/optee.c           |  6 +++++
 xen/arch/arm/tee/tee.c             |  8 +++++++
 4 files changed, 56 insertions(+)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 15d9709a97d2..3ae86ca620a4 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -795,6 +795,41 @@ fail:
 
 int arch_domain_teardown(struct domain *d)
 {
+    int ret = 0;
+
+    BUG_ON(!d->is_dying);
+
+    /* See domain_teardown() for an explanation of all of this magic. */
+    switch ( d->teardown.arch_val )
+    {
+#define PROGRESS(x)                             \
+        d->teardown.arch_val = PROG_ ## x;      \
+        fallthrough;                            \
+    case PROG_ ## x
+
+        enum {
+            PROG_none,
+            PROG_tee,
+            PROG_done,
+        };
+
+    case PROG_none:
+        BUILD_BUG_ON(PROG_none != 0);
+
+    PROGRESS(tee):
+        ret = tee_domain_teardown(d);
+        if ( ret )
+            return ret;
+
+    PROGRESS(done):
+        break;
+
+#undef PROGRESS
+
+    default:
+        BUG();
+    }
+
     return 0;
 }
 
diff --git a/xen/arch/arm/include/asm/tee/tee.h b/xen/arch/arm/include/asm/tee/tee.h
index f483986385c8..da324467e130 100644
--- a/xen/arch/arm/include/asm/tee/tee.h
+++ b/xen/arch/arm/include/asm/tee/tee.h
@@ -34,6 +34,7 @@ struct tee_mediator_ops {
      * guest and create own structures for the new domain.
      */
     int (*domain_init)(struct domain *d);
+    int (*domain_teardown)(struct domain *d);
 
     /*
      * Called during domain destruction to relinquish resources used
@@ -62,6 +63,7 @@ struct tee_mediator_desc {
 
 bool tee_handle_call(struct cpu_user_regs *regs);
 int tee_domain_init(struct domain *d, uint16_t tee_type);
+int tee_domain_teardown(struct domain *d);
 int tee_relinquish_resources(struct domain *d);
 uint16_t tee_get_type(void);
 
@@ -93,6 +95,11 @@ static inline int tee_relinquish_resources(struct domain *d)
     return 0;
 }
 
+static inline int tee_domain_teardown(struct domain *d)
+{
+    return 0;
+}
+
 static inline uint16_t tee_get_type(void)
 {
     return XEN_DOMCTL_CONFIG_TEE_NONE;
diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
index 301d205a36c5..c91bd7d5ac25 100644
--- a/xen/arch/arm/tee/optee.c
+++ b/xen/arch/arm/tee/optee.c
@@ -268,6 +268,11 @@ static int optee_domain_init(struct domain *d)
     return 0;
 }
 
+static int optee_domain_teardown(struct domain *d)
+{
+    return 0;
+}
+
 static uint64_t regpair_to_uint64(register_t reg0, register_t reg1)
 {
     return ((uint64_t)reg0 << 32) | (uint32_t)reg1;
@@ -1732,6 +1737,7 @@ static const struct tee_mediator_ops optee_ops =
 {
     .probe = optee_probe,
     .domain_init = optee_domain_init,
+    .domain_teardown = optee_domain_teardown,
     .relinquish_resources = optee_relinquish_resources,
     .handle_call = optee_handle_call,
 };
diff --git a/xen/arch/arm/tee/tee.c b/xen/arch/arm/tee/tee.c
index 3964a8a5cddf..ddd17506a9ff 100644
--- a/xen/arch/arm/tee/tee.c
+++ b/xen/arch/arm/tee/tee.c
@@ -52,6 +52,14 @@ int tee_domain_init(struct domain *d, uint16_t tee_type)
     return cur_mediator->ops->domain_init(d);
 }
 
+int tee_domain_teardown(struct domain *d)
+{
+    if ( !cur_mediator )
+        return 0;
+
+    return cur_mediator->ops->domain_teardown(d);
+}
+
 int tee_relinquish_resources(struct domain *d)
 {
     if ( !cur_mediator )
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564176.881479 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIXw-0005vW-IP; Mon, 17 Jul 2023 07:21:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564176.881479; Mon, 17 Jul 2023 07:21:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIXw-0005v0-BM; Mon, 17 Jul 2023 07:21:28 +0000
Received: by outflank-mailman (input) for mailman id 564176;
 Mon, 17 Jul 2023 07:21:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIXu-0005A3-6x
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:26 +0000
Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com
 [2a00:1450:4864:20::12d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8a024a91-2472-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 09:21:25 +0200 (CEST)
Received: by mail-lf1-x12d.google.com with SMTP id
 2adb3069b0e04-4fbaef9871cso6440494e87.0
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:25 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8a024a91-2472-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578485; x=1692170485;
        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=eWdsZxNkENko/UmOoCJsCn44L2mriNbtUyUkPA5KWjw=;
        b=cV9OCepZnVg5XTGq34+r4Z2lT1izd5sooR3D88Gf7Etxs5Cbr3/U7sCi/Ohy2TptJa
         QedfRSMPxKIdb9RF8aWDTNkoRDj2vsObC80SVAYzF8jbYhSii1PhAbYzzUimuQglqk9m
         nHYZc2BtSIfxm8bsrod7rNS664OlOBIbPB2APHwqRozD6O/IjQon8NHNOEOZR1sS6qbf
         962cY07fPlbrf6yBusGstG/optKODb4Omh50bULSKllcibv1uX4ANIXPVHCYDO1deKQ2
         5WOmUnF2HBPDq29eiZmaONeRXs4fqmSo7ZMtGBgT1Ky3QBWe/rWbzqBh9uEE2TlIdaMw
         cCKQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578485; x=1692170485;
        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=eWdsZxNkENko/UmOoCJsCn44L2mriNbtUyUkPA5KWjw=;
        b=JWtAaabcGlJ9IE97hi8S4TeUkqA8EVxl8lmJWBueAB3bJU81d7ZDiIwn+g1BIrGdGi
         ga81sLJnikHw8zM9bY/LMKEv61y0E8E2Kva8ZMIMaZnGZdSLfFmTnYj0V+VALfYtv5Nc
         zC3HfB/UlVoKbAX5icYDuliGtdOyc/xFAtBxUHxtdlFaq3y50TVA0Iz3p3RbQfjoxItb
         wBq2+aLisbi9zgk6MkKuHjeVDBV/DuIEViJ0/wuHAAK6dl5WDRK0GQvCf8AQEGzZO1HH
         7niZntP7hd3HFsLDinZEijAa5AKyZzWXw8Nu5MyJavOx7VM1y7yy2AH54kP2Nor//Mr5
         2gOA==
X-Gm-Message-State: ABy/qLYKk0Pti0HgnMpcn1MG7ytbFecsM7WeL2BtST2w9ZG1qjMhMrgl
	A6LyIef5thTkkyMDre0mT94WBl5poFBrhShW/Z4=
X-Google-Smtp-Source: APBJJlG2Eqg/bLpKBsEvS3SwNAGKKjz2aQ+DXuit/au6eEbnmsqH5cn2U9OsjNm0J+qnx+b1R1dQEQ==
X-Received: by 2002:a19:915d:0:b0:4fb:caed:95c3 with SMTP id y29-20020a19915d000000b004fbcaed95c3mr6360263lfj.53.1689578484712;
        Mon, 17 Jul 2023 00:21:24 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [XEN PATCH v10 04/24] xen/arm: tee: add a primitive FF-A mediator
Date: Mon, 17 Jul 2023 09:20:47 +0200
Message-Id: <20230717072107.753304-5-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds a FF-A version 1.1 [1] mediator to communicate with a Secure
Partition in secure world.

This commit brings in only the parts needed to negotiate FF-A version
number with guest and SPMC.

[1] https://developer.arm.com/documentation/den0077/e
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/include/asm/psci.h    |   4 +
 xen/arch/arm/include/asm/tee/ffa.h |  35 +++++
 xen/arch/arm/tee/Kconfig           |  11 ++
 xen/arch/arm/tee/Makefile          |   1 +
 xen/arch/arm/tee/ffa.c             | 225 +++++++++++++++++++++++++++++
 xen/arch/arm/vsmc.c                |  17 ++-
 xen/include/public/arch-arm.h      |   1 +
 7 files changed, 291 insertions(+), 3 deletions(-)
 create mode 100644 xen/arch/arm/include/asm/tee/ffa.h
 create mode 100644 xen/arch/arm/tee/ffa.c

diff --git a/xen/arch/arm/include/asm/psci.h b/xen/arch/arm/include/asm/psci.h
index 832f77afff3a..4780972621bb 100644
--- a/xen/arch/arm/include/asm/psci.h
+++ b/xen/arch/arm/include/asm/psci.h
@@ -24,6 +24,10 @@ void call_psci_cpu_off(void);
 void call_psci_system_off(void);
 void call_psci_system_reset(void);
 
+/* Range of allocated PSCI function numbers */
+#define	PSCI_FNUM_MIN_VALUE                 _AC(0,U)
+#define	PSCI_FNUM_MAX_VALUE                 _AC(0x1f,U)
+
 /* PSCI v0.2 interface */
 #define PSCI_0_2_FN32(nr) ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL,             \
                                              ARM_SMCCC_CONV_32,               \
diff --git a/xen/arch/arm/include/asm/tee/ffa.h b/xen/arch/arm/include/asm/tee/ffa.h
new file mode 100644
index 000000000000..44361a4e78e4
--- /dev/null
+++ b/xen/arch/arm/include/asm/tee/ffa.h
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * xen/arch/arm/include/asm/tee/ffa.h
+ *
+ * Arm Firmware Framework for ARMv8-A(FFA) mediator
+ *
+ * Copyright (C) 2023  Linaro Limited
+ */
+
+#ifndef __ASM_ARM_TEE_FFA_H__
+#define __ASM_ARM_TEE_FFA_H__
+
+#include <xen/const.h>
+#include <xen/kconfig.h>
+
+#include <asm/smccc.h>
+#include <asm/types.h>
+
+#define FFA_FNUM_MIN_VALUE              _AC(0x60,U)
+#define FFA_FNUM_MAX_VALUE              _AC(0x86,U)
+
+static inline bool is_ffa_fid(uint32_t fid)
+{
+    uint32_t fn = fid & ARM_SMCCC_FUNC_MASK;
+
+    return fn >= FFA_FNUM_MIN_VALUE && fn <= FFA_FNUM_MAX_VALUE;
+}
+
+#ifdef CONFIG_FFA
+#define FFA_NR_FUNCS    12
+#else
+#define FFA_NR_FUNCS    0
+#endif
+
+#endif /*__ASM_ARM_TEE_FFA_H__*/
diff --git a/xen/arch/arm/tee/Kconfig b/xen/arch/arm/tee/Kconfig
index 392169b2559d..923f08ba8cb7 100644
--- a/xen/arch/arm/tee/Kconfig
+++ b/xen/arch/arm/tee/Kconfig
@@ -8,3 +8,14 @@ config OPTEE
 	  virtualization-enabled OP-TEE present. You can learn more
 	  about virtualization for OP-TEE at
 	  https://optee.readthedocs.io/architecture/virtualization.html
+
+config FFA
+	bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
+	default n
+	depends on ARM_64
+	help
+	  This option enables a minimal FF-A mediator. The mediator is
+	  generic as it follows the FF-A specification [1], but it only
+	  implements a small subset of the specification.
+
+	  [1] https://developer.arm.com/documentation/den0077/latest
diff --git a/xen/arch/arm/tee/Makefile b/xen/arch/arm/tee/Makefile
index 982c87968447..58a1015e40e0 100644
--- a/xen/arch/arm/tee/Makefile
+++ b/xen/arch/arm/tee/Makefile
@@ -1,2 +1,3 @@
+obj-$(CONFIG_FFA) += ffa.o
 obj-y += tee.o
 obj-$(CONFIG_OPTEE) += optee.o
diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
new file mode 100644
index 000000000000..927c4d33a380
--- /dev/null
+++ b/xen/arch/arm/tee/ffa.c
@@ -0,0 +1,225 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * xen/arch/arm/tee/ffa.c
+ *
+ * Arm Firmware Framework for ARMv8-A (FF-A) mediator
+ *
+ * Copyright (C) 2023  Linaro Limited
+ */
+
+#include <xen/bitops.h>
+#include <xen/domain_page.h>
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/sched.h>
+#include <xen/sizes.h>
+#include <xen/types.h>
+
+#include <asm/event.h>
+#include <asm/regs.h>
+#include <asm/smccc.h>
+#include <asm/tee/ffa.h>
+#include <asm/tee/tee.h>
+
+/* Error codes */
+#define FFA_RET_OK                      0
+#define FFA_RET_NOT_SUPPORTED           -1
+#define FFA_RET_INVALID_PARAMETERS      -2
+#define FFA_RET_NO_MEMORY               -3
+#define FFA_RET_BUSY                    -4
+#define FFA_RET_INTERRUPTED             -5
+#define FFA_RET_DENIED                  -6
+#define FFA_RET_RETRY                   -7
+#define FFA_RET_ABORTED                 -8
+
+/* FFA_VERSION helpers */
+#define FFA_VERSION_MAJOR_SHIFT         16U
+#define FFA_VERSION_MAJOR_MASK          0x7FFFU
+#define FFA_VERSION_MINOR_SHIFT         0U
+#define FFA_VERSION_MINOR_MASK          0xFFFFU
+#define MAKE_FFA_VERSION(major, minor)  \
+        ((((major) & FFA_VERSION_MAJOR_MASK) << FFA_VERSION_MAJOR_SHIFT) | \
+         ((minor) & FFA_VERSION_MINOR_MASK))
+
+#define FFA_VERSION_1_0         MAKE_FFA_VERSION(1, 0)
+#define FFA_VERSION_1_1         MAKE_FFA_VERSION(1, 1)
+/* The minimal FF-A version of the SPMC that can be supported */
+#define FFA_MIN_SPMC_VERSION    FFA_VERSION_1_1
+
+/*
+ * This is the version we want to use in communication with guests and SPs.
+ * During negotiation with a guest or a SP we may need to lower it for
+ * that particular guest or SP.
+ */
+#define FFA_MY_VERSION_MAJOR    1U
+#define FFA_MY_VERSION_MINOR    1U
+#define FFA_MY_VERSION          MAKE_FFA_VERSION(FFA_MY_VERSION_MAJOR, \
+                                                 FFA_MY_VERSION_MINOR)
+
+/* Function IDs */
+#define FFA_ERROR                       0x84000060U
+#define FFA_SUCCESS_32                  0x84000061U
+#define FFA_VERSION                     0x84000063U
+
+struct ffa_ctx {
+    /* FF-A version used by the guest */
+    uint32_t guest_vers;
+};
+
+/* Negotiated FF-A version to use with the SPMC */
+static uint32_t __ro_after_init ffa_version;
+
+static bool ffa_get_version(uint32_t *vers)
+{
+    const struct arm_smccc_1_2_regs arg = {
+        .a0 = FFA_VERSION,
+        .a1 = FFA_MY_VERSION,
+    };
+    struct arm_smccc_1_2_regs resp;
+
+    arm_smccc_1_2_smc(&arg, &resp);
+    if ( resp.a0 == FFA_RET_NOT_SUPPORTED )
+    {
+        gprintk(XENLOG_ERR, "ffa: FFA_VERSION returned not supported\n");
+        return false;
+    }
+
+    *vers = resp.a0;
+
+    return true;
+}
+
+static void set_regs(struct cpu_user_regs *regs, register_t v0, register_t v1,
+                     register_t v2, register_t v3, register_t v4, register_t v5,
+                     register_t v6, register_t v7)
+{
+        set_user_reg(regs, 0, v0);
+        set_user_reg(regs, 1, v1);
+        set_user_reg(regs, 2, v2);
+        set_user_reg(regs, 3, v3);
+        set_user_reg(regs, 4, v4);
+        set_user_reg(regs, 5, v5);
+        set_user_reg(regs, 6, v6);
+        set_user_reg(regs, 7, v7);
+}
+
+static void handle_version(struct cpu_user_regs *regs)
+{
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+    uint32_t vers = get_user_reg(regs, 1);
+
+    if ( vers < FFA_VERSION_1_1 )
+        vers = FFA_VERSION_1_0;
+    else
+        vers = FFA_VERSION_1_1;
+
+    ctx->guest_vers = vers;
+    set_regs(regs, vers, 0, 0, 0, 0, 0, 0, 0);
+}
+
+static bool ffa_handle_call(struct cpu_user_regs *regs)
+{
+    uint32_t fid = get_user_reg(regs, 0);
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+
+    if ( !ctx )
+        return false;
+
+    switch ( fid )
+    {
+    case FFA_VERSION:
+        handle_version(regs);
+        return true;
+
+    default:
+        gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
+        return false;
+    }
+}
+
+static int ffa_domain_init(struct domain *d)
+{
+    struct ffa_ctx *ctx;
+
+    if ( !ffa_version )
+        return -ENODEV;
+
+    ctx = xzalloc(struct ffa_ctx);
+    if ( !ctx )
+        return -ENOMEM;
+
+    d->arch.tee = ctx;
+
+    return 0;
+}
+
+/* This function is supposed to undo what ffa_domain_init() has done */
+static int ffa_domain_teardown(struct domain *d)
+{
+    struct ffa_ctx *ctx = d->arch.tee;
+
+    if ( !ctx )
+        return 0;
+
+    XFREE(d->arch.tee);
+
+    return 0;
+}
+
+static int ffa_relinquish_resources(struct domain *d)
+{
+    return 0;
+}
+
+static bool ffa_probe(void)
+{
+    uint32_t vers;
+    unsigned int major_vers;
+    unsigned int minor_vers;
+
+    /*
+     * psci_init_smccc() updates this value with what's reported by EL-3
+     * or secure world.
+     */
+    if ( smccc_ver < ARM_SMCCC_VERSION_1_2 )
+    {
+        printk(XENLOG_ERR
+               "ffa: unsupported SMCCC version %#x (need at least %#x)\n",
+               smccc_ver, ARM_SMCCC_VERSION_1_2);
+        return false;
+    }
+
+    if ( !ffa_get_version(&vers) )
+        return false;
+
+    if ( vers < FFA_MIN_SPMC_VERSION || vers > FFA_MY_VERSION )
+    {
+        printk(XENLOG_ERR "ffa: Incompatible version %#x found\n", vers);
+        return false;
+    }
+
+    major_vers = (vers >> FFA_VERSION_MAJOR_SHIFT) & FFA_VERSION_MAJOR_MASK;
+    minor_vers = vers & FFA_VERSION_MINOR_MASK;
+    printk(XENLOG_INFO "ARM FF-A Mediator version %u.%u\n",
+           FFA_MY_VERSION_MAJOR, FFA_MY_VERSION_MINOR);
+    printk(XENLOG_INFO "ARM FF-A Firmware version %u.%u\n",
+           major_vers, minor_vers);
+
+    ffa_version = vers;
+
+    return true;
+}
+
+static const struct tee_mediator_ops ffa_ops =
+{
+    .probe = ffa_probe,
+    .domain_init = ffa_domain_init,
+    .domain_teardown = ffa_domain_teardown,
+    .relinquish_resources = ffa_relinquish_resources,
+    .handle_call = ffa_handle_call,
+};
+
+REGISTER_TEE_MEDIATOR(ffa, "FF-A", XEN_DOMCTL_CONFIG_TEE_FFA, &ffa_ops);
diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c
index cd68fa80e98a..7f2f5eb9ce3d 100644
--- a/xen/arch/arm/vsmc.c
+++ b/xen/arch/arm/vsmc.c
@@ -15,6 +15,7 @@
 #include <asm/monitor.h>
 #include <asm/regs.h>
 #include <asm/smccc.h>
+#include <asm/tee/ffa.h>
 #include <asm/tee/tee.h>
 #include <asm/traps.h>
 #include <asm/vpsci.h>
@@ -24,7 +25,7 @@
 #define XEN_SMCCC_FUNCTION_COUNT 3
 
 /* Number of functions currently supported by Standard Service Service Calls. */
-#define SSSC_SMCCC_FUNCTION_COUNT (3 + VPSCI_NR_FUNCS)
+#define SSSC_SMCCC_FUNCTION_COUNT (3 + VPSCI_NR_FUNCS + FFA_NR_FUNCS)
 
 static bool fill_uid(struct cpu_user_regs *regs, xen_uuid_t uuid)
 {
@@ -188,13 +189,23 @@ static bool handle_existing_apis(struct cpu_user_regs *regs)
     return do_vpsci_0_1_call(regs, fid);
 }
 
+static bool is_psci_fid(uint32_t fid)
+{
+    uint32_t fn = fid & ARM_SMCCC_FUNC_MASK;
+
+    return fn >= PSCI_FNUM_MIN_VALUE && fn <= PSCI_FNUM_MAX_VALUE;
+}
+
 /* PSCI 0.2 interface and other Standard Secure Calls */
 static bool handle_sssc(struct cpu_user_regs *regs)
 {
     uint32_t fid = (uint32_t)get_user_reg(regs, 0);
 
-    if ( do_vpsci_0_2_call(regs, fid) )
-        return true;
+    if ( is_psci_fid(fid) )
+        return do_vpsci_0_2_call(regs, fid);
+
+    if ( is_ffa_fid(fid) )
+        return tee_handle_call(regs);
 
     switch ( fid )
     {
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 38311f559581..c6449893e493 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -296,6 +296,7 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
 
 #define XEN_DOMCTL_CONFIG_TEE_NONE      0
 #define XEN_DOMCTL_CONFIG_TEE_OPTEE     1
+#define XEN_DOMCTL_CONFIG_TEE_FFA       2
 
 struct xen_arch_domainconfig {
     /* IN/OUT */
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564177.881493 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIXx-0006OM-Sj; Mon, 17 Jul 2023 07:21:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564177.881493; Mon, 17 Jul 2023 07:21:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIXx-0006Nf-PN; Mon, 17 Jul 2023 07:21:29 +0000
Received: by outflank-mailman (input) for mailman id 564177;
 Mon, 17 Jul 2023 07:21:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIXw-0005A3-5T
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:28 +0000
Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com
 [2a00:1450:4864:20::12d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8b5cc22a-2472-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 09:21:27 +0200 (CEST)
Received: by mail-lf1-x12d.google.com with SMTP id
 2adb3069b0e04-4fb5bcb9a28so6385308e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:27 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.26
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8b5cc22a-2472-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578487; x=1692170487;
        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=4wSiWqYej8EPgULt6otzEwmKVlaIAponcAwfHuOJ0rA=;
        b=qZlG5/5+KozbDG0dX2Pv46WGN80L7UYXywXQ+0/2LnHsEZfdvzqVzKq6DYdlBIkufx
         MsJI0/Kv4gGhPvcwBAT2ZhvJPFKOFTlg2aqK1h7wHNZ9MBUbNJ6SOyMC8cbKmDBrAoVg
         M6Ijx/72XKfb0hklTPFpMmmd18TMEdL82yOMRO4govS81iwG4I5CW5eD+b0qOTR8d+d5
         I916oiuztElanzYWmV32MZ2DGizLFiUzzcPnF/pFm9rwv6Spuz4RkzKN6NxHYBAzJOKj
         kIzG86XXbbXZdlLfy8BWrCVrgyCULG0QcK4e5p1c8gfT5YxOw2gtrMkeQ4QZ+UQNRyOs
         PCfQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578487; x=1692170487;
        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=4wSiWqYej8EPgULt6otzEwmKVlaIAponcAwfHuOJ0rA=;
        b=HsJxrecgYTXFegKO0rPC080T6ONZMDlWCEj4AKzqrzHTFxpTAoEkjToTQqgcn4N69M
         WGrbF8AlD+zCb96Vu9KInyUIQW+r0o+p9jJwVc9Nipq3RWJlydCrNt8fF22inzR7WL/A
         dpf6nywUqDi+k0gFGAoRweqWJjVeX7vzIO30hXDjGA+hoQUwORG0KEuOietVRlmUurBx
         Ri4bNx0u4NwX9L/ckGHAH+AiqDmmvJph/yfYD8Fc7bqWWok42itbjyXV0IP521bwEbg5
         CiJaGJkXdVXupp+094r/oeiG7OcfKZp7zYKb7L+nkxJ3/Eo6fxI6mfELV/kp+w4nhlMK
         FZ6w==
X-Gm-Message-State: ABy/qLZroWUk1bKznFvrKYo03W55wVbO0tEYV0f6C297YSHeb7D5Pi4E
	SyPartw42DanHfOzU3gpW1DdktraHE8wMME/Big=
X-Google-Smtp-Source: APBJJlHsUIExGwq/SOkJY5f47gzvIKiWT9Pe1PJHiVjY2QneHf99uvvJZtEmarMrEGqvoCJjvSgxVg==
X-Received: by 2002:ac2:5921:0:b0:4fb:85ad:b6e2 with SMTP id v1-20020ac25921000000b004fb85adb6e2mr7278312lfi.50.1689578487119;
        Mon, 17 Jul 2023 00:21:27 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v10 06/24] xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET
Date: Mon, 17 Jul 2023 09:20:49 +0200
Message-Id: <20230717072107.753304-7-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

According to DEN0077A version 1.1 REL0, section 13.8, defines
flags used for the function FFA_PARTITION_INFO_GET.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 xen/arch/arm/tee/ffa.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 2296e3115beb..c1dead73d1f2 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -57,6 +57,40 @@
 #define FFA_MY_VERSION          MAKE_FFA_VERSION(FFA_MY_VERSION_MAJOR, \
                                                  FFA_MY_VERSION_MINOR)
 
+/*
+ * Flags to determine partition properties in FFA_PARTITION_INFO_GET return
+ * message:
+ * BIT(0): Supports receipt of direct requests
+ * BIT(1): Can send direct requests
+ * BIT(2): Can send and receive indirect messages
+ * BIT(3): Supports receipt of notifications
+ * BIT(4-5): Partition ID is a PE endpoint ID
+ * BIT(6): Partition must be informed about each VM that is created by
+ *         the Hypervisor
+ * BIT(7): Partition must be informed about each VM that is destroyed by
+ *         the Hypervisor
+ * BIT(8): Partition runs in the AArch64 execution state else AArch32
+ *         execution state
+ */
+#define FFA_PART_PROP_DIRECT_REQ_RECV   BIT(0, U)
+#define FFA_PART_PROP_DIRECT_REQ_SEND   BIT(1, U)
+#define FFA_PART_PROP_INDIRECT_MSGS     BIT(2, U)
+#define FFA_PART_PROP_RECV_NOTIF        BIT(3, U)
+#define FFA_PART_PROP_IS_TYPE_MASK      (3U << 4)
+#define FFA_PART_PROP_IS_PE_ID          (0U << 4)
+#define FFA_PART_PROP_IS_SEPID_INDEP    (1U << 4)
+#define FFA_PART_PROP_IS_SEPID_DEP      (2U << 4)
+#define FFA_PART_PROP_IS_AUX_ID         (3U << 4)
+#define FFA_PART_PROP_NOTIF_CREATED     BIT(6, U)
+#define FFA_PART_PROP_NOTIF_DESTROYED   BIT(7, U)
+#define FFA_PART_PROP_AARCH64_STATE     BIT(8, U)
+
+/*
+ * Flag used as parameter to FFA_PARTITION_INFO_GET to return partition
+ * count only.
+ */
+#define FFA_PARTITION_INFO_GET_COUNT_FLAG BIT(0, U)
+
 /* Function IDs */
 #define FFA_ERROR                       0x84000060U
 #define FFA_SUCCESS_32                  0x84000061U
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564173.881454 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIXu-0005PH-Dv; Mon, 17 Jul 2023 07:21:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564173.881454; Mon, 17 Jul 2023 07:21:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIXu-0005P6-Am; Mon, 17 Jul 2023 07:21:26 +0000
Received: by outflank-mailman (input) for mailman id 564173;
 Mon, 17 Jul 2023 07:21:25 +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
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIXt-0005A9-7g
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:25 +0000
Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com
 [2a00:1450:4864:20::131])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 875611a1-2472-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 09:21:21 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-4fb9ae4cef6so6518084e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:21 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 875611a1-2472-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578480; x=1692170480;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=UcyDFAwMClUMKj1eUnO6D/yh7YyMNNNtbCimK9Us1eo=;
        b=Y0oD3nWFn57AhmvKH6IUPbSgB6ak5ksRb+KfcgDUV0yXObAZXhWmjIL06dUVb6hOQ2
         L/ym+RTbC6+32f5aLx8bqX9MgP9ctEsudH0xApf1x2VSDf8JKJSZfMbIuEMPLt7V5oWf
         2/3TH+a1hQLmJ11r99hFrpYmjG/2JVdxxbtkgw44h+/qf2XxIkQqj4JCnuPfyzsv6QzL
         GDfF4WJY3J2IydoFKOz41vMgTTva9O6kH/eT5HlRUOliMR/bvC+II9tti0WTMjOwkadc
         S59UNAKKzrAbvzMgytKOE/OX1JDLN4T2xs8Y/bFf7d4n8XnlzJdQExxpg1gceghTZS+J
         PUOg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578480; x=1692170480;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=UcyDFAwMClUMKj1eUnO6D/yh7YyMNNNtbCimK9Us1eo=;
        b=LQBnJqXzGgEANP3amzB/bUEJVu5NwA+kl+jJBgbl6nQYtJ6bCGTSIXGiKEYGgoensF
         dj10sZbjHKyNbpn3XPPIfjeIMGNAgUCSNOQyBFLEC2X6Cp4JsYOreUmTq6aZKuHC0ume
         fwNWbdfVdQQ5OoWsB0A0kRho0v2VBiQXo7MGpW5wfDfk5Axfd/AJNuHW5BUOPCNUg0Wq
         vwuV8nZRQFhq8zX4o7dzYQMcby60ita7rkG8fvXZhr5hvVwMpM00V/DaBguJzNo0u0sl
         6Tlsz5yaKZ49MuQWU+wpOC+Mu5t71gHS5HeRU/9jvovYa6oLzbTCqyTCFn8njOFeZ8km
         sCFw==
X-Gm-Message-State: ABy/qLaZhlASzBqoQFsuNdyIHyXXOGUw4T6YCNhfNfbr6WI4ddYhUffG
	tdKbgg6ZKfijWgcGSPfZTrwqyq+Sw87lpktC+WY=
X-Google-Smtp-Source: APBJJlEJdRaPF54ta/Kl63xSnBIFgxID+WuKmJEDF5/IMpIQqzou/bXcoF9Lr5dveilSkwa2O8QTlA==
X-Received: by 2002:a05:6512:39d4:b0:4fb:cab9:ddf with SMTP id k20-20020a05651239d400b004fbcab90ddfmr8987298lfu.57.1689578480106;
        Mon, 17 Jul 2023 00:21:20 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [XEN PATCH v10 00/24] Xen FF-A mediator
Date: Mon, 17 Jul 2023 09:20:43 +0200
Message-Id: <20230717072107.753304-1-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Hi,

This patch sets add an FF-A [1] mediator to the TEE mediator framework
already present in Xen.  The FF-A mediator implements the subset of the
FF-A 1.1 specification needed to communicate with OP-TEE using FF-A as
transport mechanism instead of SMC/HVC as with the TEE mediator. It allows
a similar design in OP-TEE as with the TEE mediator where OP-TEE presents
one virtual partition of itself to each guest in Xen.

The FF-A mediator is generic in the sense it has nothing OP-TEE specific
except that only the subset needed for OP-TEE is implemented so far. The
hooks needed to inform OP-TEE that a guest is created or destroyed are part
of the FF-A specification.

It should be possible to extend the FF-A mediator to implement a larger
portion of the FF-A 1.1 specification without breaking with the way OP-TEE
is communicated with here. So it should be possible to support any TEE or
Secure Partition using FF-A as transport with this mediator.

The patches are also available at https://github.com/jenswi-linaro/xen
branch "xen_ffa_v10".

With help from Bertrand I've integrated this in a test setup with OP-TEE.
Please check prerequisites at
https://optee.readthedocs.io/en/latest/building/prerequisites.html

My setup is duplicated using:
repo init -u https://github.com/jenswi-linaro/manifest.git -m qemu_v8.xml \
        -b qemu_xen_ffa
repo sync -j8
cd build
make -j8 toolchains
make -j8 all
make run-only

Test in dom0 with for instance:
xtest 1004

at the prompt.

To start up a domu and connect to it do:
cd /mnt/host/build/qemu_v8/xen
xl create guest_ffa.cfg
xl console domu

Then test as usual with "xtest 1004".

The setup uses the branch "ffa" from https://github.com/jenswi-linaro/xen.
That's currently the same as the "xen_ffa_v10" branch, but the "ffa" branch
may change later as I update for a new version of the patch set.

[1] https://developer.arm.com/documentation/den0077/latest

Thanks,
Jens

v9->v10:
Changelog in the the patches for two changed patches:
- "xen: Introduce arch_domain_teardown()"
- "xen/arm: add TEE teardown to arch_domain_teardown()"

v8->v9:
* Patch "xen/arm: ffa: add remaining SMC function IDs"
  - mention the documentation number used
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
* Patch "xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET"
  - Adding a reference to the documentation
  - Renaming FFA_PART_PROP_IS_MASK to FFA_PART_PROP_IS_TYPE_MASK
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
* Patch "xen/arm: ffa: add defines for framework direct request/response messages"
  - add a reference to the documentation
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
* Patch "docs: add Arm FF-A mediator"
  - Updating the wording as requested.
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
  - Fixing a few typos and adding a reference to the code for a list of
    limitations
* Patch "xen/arm: ffa: list current limitations"
  - Fixing a couple of typos
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
  - Removing an invalid limitation of FFA_RXTX_MAP_*
* Patch "xen/arm: ffa: add defines for sharing memory"
  - Fixing a few typos
  - Adding a reference to the documentation
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
  - Updating FFA_MAX_SHM_PAGE_COUNT to have a safe margin to
    TEEC_CONFIG_SHAREDMEM_MAX_SIZE
* Patch "xen/arm: ffa: add direct request support"
  - Fixing a coding style issue
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
  - Updating the TODO comment about features.
* Patch "xen/arm: ffa: send guest events to Secure Partitions"
  - Adding a TODO comment and a limit on the loop in ffa_direct_req_send_vm()
* Patch "xen/arm: ffa: support mapping guest RX/TX buffers"
  - Change FFA_MAX_RXTX_PAGE_COUNT to 1 with a TODO for a larger value
  - Replace !p2m_is_ram(t) test with t != p2m_ram_rw
  - Rename the introduced field tx_is_free to tx_is_free
* Patch "xen/arm: ffa: support sharing memory"
  - Fixing read_atomic() issue in get_shm_pages()
  - Fixing style issue in free_ffa_shm_mem()
  - Replace !p2m_is_ram(t) test with t != p2m_ram_rw in get_shm_pages()
* Patch "tools: add Arm FF-A mediator"
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
  - Adding Acked-by: Anthony PERARD <anthony.perard@citrix.com>
  - Moving the patch to just before the docs patch.
* Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com to:
  - "xen/arm: ffa: enforce dependency on 4k pages"
  - "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h"
  - "xen/arm: ffa: add ABI structs for sharing memory"
* Adding "xen: Introduce arch_domain_teardown()" by Andrew Cooper
* Adding "xen/arm: add TEE teardown to arch_domain_teardown()" 
  based on a patch from Andrew Cooper

v7->v8:
* Adding "xen/arm: ffa: list current limitations" as requested
* Adding tags to "xen/arm: smccc: add support for SMCCCv1.2 extended
  input/output registers"
* Patch "xen/arm: tee: add a primitive FF-A mediator":
  - Changing license for ffa.h and ffa.c to GPL-2.0-only
  - Avoiding IS_ENABLED() in the constant FFA_NR_FUNCS
  - Accepting version 1.1 SPMC only to keep things simple
  - Removes 32bit and only supports 64bit to keep things simple
* Patch "tools: add Arm FF-A mediator"
  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
  - Adding LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE_FFA for the "ffa" value 
    in arch_arm.tee
* Patch "docs: add Arm FF-A mediator"
  - Fixing a spell error
  - Moving the patch last in the series
* Patch "xen/arm: ffa: add remaining SMC function IDs"
  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
  - Renaming the define FFA_MSG_RUN to FFA_RUN to match the specification
* Patch "xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET"
  - Updating the comment describing the flags for FFA_PARTITION_INFO_GET
* Patch "xen/arm: ffa: add defines for framework direct request/response
  messages"
  - Updating the comment describing the flags for MSG_SEND_DIRECT_REQ/RESP
* Patch "xen/arm: ffa: enforce dependency on 4k pages"
  - Updating title of patch
  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
* Patch "xen/arm: ffa: add support for FFA_ID_GET"
  - In ffa_domain_init(), check that domain_id isn't greater than
    UINT16_MAX to avoid a future potential integer overflow in get_vm_id()
* Patch "xen/arm: ffa: add direct request support"
  - Move preemption (interrupted) parts to a separate patch "xen/arm: ffa:
    support preemption of SP during direct request"
  - Remove loop in handle_msg_send_direct_req() to return eventual
    errors back to the VM instead of the SP.
* Patch "xen/arm: ffa: map SPMC rx/tx buffers"
  - Adding a FFA_RXTX_PAGE_COUNT define instead of using 1 directly
* New patch "xen/arm: ffa: support preemption of SP during direct request"
* Patch "xen/arm: ffa: send guest events to Secure Partitions"
  - Replacing unsigned int with uint16_t for subscr_vm_created_count and
    subscr_vm_destroyed_count plus the needed range check to see that
    they don't overflow.
* Patch "xen/arm: ffa: support mapping guest RX/TX buffers"
  - Limit the number of pages in VM RX/TX buffers to 32 using a new
    FFA_MAX_RXTX_PAGE_COUNT define.
* Patch "xen/arm: ffa: support guest FFA_PARTITION_INFO_GET"
  - Renaming tx_is_mine to rx_is_free as requested
  - Simplified the FFA_PARTITION_INFO_GET_COUNT_FLAG check in
    handle_partition_info_get()
  - Adding a comment on ownership of the RX buffer
  - Adding the patch "xen/arm: ffa: improve lock granularity" to address
    parts of the locking concerns.
* Patch "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h"
  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
* Patch "xen/arm: ffa: add defines for sharing memory"
  - Fixing reference for FFA_NORMAL_MEM_REG_ATTR and FFA_MEM_ACC_RW
  - Updating descirption for FFA_MAX_SHM_PAGE_COUNT
* Patch "xen/arm: ffa: add ABI structs for sharing memory"
  - Changing name of the "global_handle" memeber in struct
    ffa_mem_transaction_* to "handle".
* Patch "xen/arm: ffa: support sharing memory"
  - Use FFA_MEM_SHARE_64 only since we changed to only suporting ARM_64.
  - Rename struct ffa_mem_transaction_x to struct ffa_mem_transaction_int
    as requested.
  - Adding a check that shm->page_count isn't 0 before calling share_shm()
  - Masking return value from FFA_MEM_FRAG_RX to avoid an implic cast to
    the int32_t returned by ffa_mem_share().
* Patch "xen/arm: ffa: add support to reclaim shared memory"
  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
* Patch "xen/arm: ffa: support sharing large memory ranges"
  - Adding commetns for struct ffa_ctx
  - Cleaning up and removing the fragmentation state if handle_mem_frag_tx()
    detects an error.
* Adding "xen/arm: ffa: improve lock granularity" to address some of the
  locking concerns.

v6->v7:
* Split some of the larger patches into smaller patches for easier review.
  For instance, the v6 patch "xen/arm: add a primitive FF-A mediator" has
  been replaced with:
  - "xen/arm: add a primitive FF-A mediator"
  - "tools: add Arm FF-A mediator"
  - "docs: add Arm FF-A mediator"
  - "xen/arm: ffa: add remaining SMC function IDs"
* Some small fixes in the error path for handle_mem_share()
* Switched to SPDX for license in new files.
* Fixed comment style issues in
  "xen/arm: smccc: add support for SMCCCv1.2 extended input/output registers"
* Made FFA support UNSUPPORTED in "xen/arm: add a primitive FF-A mediator"
* Replaced ffa_get_call_count() with FFA_NR_FUNCS
* Update the FFA_MAX_SHM_PAGE_COUNT with a formula instead of a value.
* Replaced XEN_ARM_FLAGS_FFA with XEN_DOMCTL_CONFIG_TEE_FFA to minimize impact
  on struct xen_arch_domainconfig. This works because the FF-A mediator and
  the OP-TEE mediator will not be used at the same time in by a guest.
* Replaced "ffa" boolean in the guest config with a new "ffa" value to the
  enumeration "tee_type".
* Integrated the FF-A mediator in the TEE mediator framework instead of
  being its own.
* Rebased on staging as of 2023-02-16

v5->v6:
* Updated "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h"
  commit message and moved the patch right before the patch which needs it.
  Applied Michal Orzel's R-B tag.
* Renamed the guest configuration option "ffa_enabled" to "ffa" and
  updated the description.
* More tools update in "xen/arm: add a primitive FF-A mediator" with the "ffa"
  option, including golang and ocaml.
* Update ffa_domain_init() to return an error if communication with
  the SPMC can't be established.
* Factored out a ffa_domain_destroy() from ffa_relinquish_resources().
* Added ffa_get_call_count() to give an accurate number of FF-A function,
  updated in each patch as new FF-A functions are added.
* Added a flags field in struct xen_arch_domainconfig that replaces the
  ffa_enabled field.
* Made check_mandatory_feature() __init
* Replaced a few printk() calls with gprintk() where needed.
* Rebased on staging as of 2022-09-14

V4->v5:
* Added "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h"
* Added documentation for the "ffa_enabled" guest config flag
* Changed to GPL license for xen/arch/arm/ffa.c
* Added __read_mostly and const where applicable
* Added more describing comments in the code
* Moved list of shared memory object ("ffa_mem_list") into the guest context
  as they are guest specific
* Simplified a few of the simple wrapper functions for SMC to SPMC
* Added a BUILD_BUG_ON(PAGE_SIZE != FFA_PAGE_SIZE) since the mediator
  currently depends on the page size to be same as FFA_PAGE_SIZE (4k).
* Added max number of shared memory object per guest and max number of
  size of each shared memory object
* Added helper macros to calculate offsets of different FF-A data structures
  in the communication buffer instead of relying on pointer arithmetic
* Addressed style issues and other comments
* Broke the commit "xen/arm: add FF-A mediator" into multiple parts, trying
  to add a few features at a time as requested
* Added a missing call to rxtx_unmap() in ffa_relinquish_resources()
* Assignment of "ffa_enabled" is kept as is until I have something definitive
  on the type etc.
* Tested with CONFIG_DEBUG=y

v3->v4:
* Missed v3 and sent a v4 instead by mistake.

v2->v3:
* Generates offsets into struct arm_smccc_1_2_regs with asm-offsets.c in
  order to avoid hard coded offsets in the assembly function
  arm_smccc_1_2_smc()
* Adds an entry in SUPPORT.md on the FF-A status
* Adds a configuration variable "ffa_enabled" to tell if FF-A should be
  enabled for a particular domu guest
* Moves the ffa_frag_list for fragmented memory share requests into
  struct ffa_ctx instead to keep it per guest in order to avoid mixups
  and simplify locking
* Adds a spinlock to struct ffa_ctx for per guest locking
* Addressing style issues and suggestions
* Uses FFA_FEATURES to check that all the needed features are available
  before initializing the mediator
* Rebased on staging as of 2022-06-20

v1->v2:
* Rebased on staging to resolve some merge conflicts as requested



Andrew Cooper (1):
  xen: Introduce arch_domain_teardown()

Jens Wiklander (23):
  xen/arm: add TEE teardown to arch_domain_teardown()
  xen/arm: smccc: add support for SMCCCv1.2 extended input/output
    registers
  xen/arm: tee: add a primitive FF-A mediator
  xen/arm: ffa: add remaining SMC function IDs
  xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET
  xen/arm: ffa: add defines for framework direct request/response
    messages
  xen/arm: ffa: enforce dependency on 4k pages
  xen/arm: ffa: add support for FFA_ID_GET
  xen/arm: ffa: add direct request support
  xen/arm: ffa: map SPMC rx/tx buffers
  xen/arm: ffa: send guest events to Secure Partitions
  xen/arm: ffa: support mapping guest RX/TX buffers
  xen/arm: ffa: support guest FFA_PARTITION_INFO_GET
  xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h
  xen/arm: ffa: add defines for sharing memory
  xen/arm: ffa: add ABI structs for sharing memory
  xen/arm: ffa: support sharing memory
  xen/arm: ffa: add support to reclaim shared memory
  xen/arm: ffa: support sharing large memory ranges
  xen/arm: ffa: improve lock granularity
  xen/arm: ffa: list current limitations
  tools: add Arm FF-A mediator
  docs: add Arm FF-A mediator

 SUPPORT.md                         |    9 +
 docs/man/xl.cfg.5.pod.in           |   15 +
 tools/include/libxl.h              |    5 +
 tools/libs/light/libxl_arm.c       |    3 +
 tools/libs/light/libxl_types.idl   |    3 +-
 xen/arch/arm/arm64/asm-offsets.c   |    9 +
 xen/arch/arm/arm64/smc.S           |   42 +
 xen/arch/arm/domain.c              |   40 +
 xen/arch/arm/include/asm/psci.h    |    4 +
 xen/arch/arm/include/asm/regs.h    |   12 +
 xen/arch/arm/include/asm/smccc.h   |   40 +
 xen/arch/arm/include/asm/tee/ffa.h |   35 +
 xen/arch/arm/include/asm/tee/tee.h |    7 +
 xen/arch/arm/tee/Kconfig           |   11 +
 xen/arch/arm/tee/Makefile          |    1 +
 xen/arch/arm/tee/ffa.c             | 1988 ++++++++++++++++++++++++++++
 xen/arch/arm/tee/optee.c           |   11 +-
 xen/arch/arm/tee/tee.c             |    8 +
 xen/arch/arm/vsmc.c                |   19 +-
 xen/arch/x86/domain.c              |    5 +
 xen/common/domain.c                |    6 +
 xen/include/public/arch-arm.h      |    1 +
 xen/include/xen/domain.h           |    1 +
 xen/include/xen/sched.h            |    1 +
 24 files changed, 2263 insertions(+), 13 deletions(-)
 create mode 100644 xen/arch/arm/include/asm/tee/ffa.h
 create mode 100644 xen/arch/arm/tee/ffa.c

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564180.881519 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIY0-000703-5I; Mon, 17 Jul 2023 07:21:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564180.881519; Mon, 17 Jul 2023 07:21:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIXz-0006zH-V2; Mon, 17 Jul 2023 07:21:31 +0000
Received: by outflank-mailman (input) for mailman id 564180;
 Mon, 17 Jul 2023 07:21:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIXy-0005A3-FO
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:30 +0000
Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com
 [2a00:1450:4864:20::133])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8cb7ab25-2472-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 09:21:30 +0200 (CEST)
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-4fb7373dd35so6646286e87.1
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:30 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.28
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8cb7ab25-2472-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578489; x=1692170489;
        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=tuV8RapENruJ9yIpnO0p4qSE4ssdvVfnP6i34l3RXw0=;
        b=xaRC7zfu3nwRG0g9KqOu4hYbFrxWD5cKBOkdZh+AZOaPYSuznqtQ+0HOauj9iavEbu
         JbSF/VqlvIoR8MVkJt6tOwMqupN1d/kGmr3IKneKPpgt9CBNZ6jXvcQDKbw9MbiyX9xk
         YXyrGJJYALbaRjptdvPv3ObZKKeT0lQ3HmaDfIFAFjOOh94qI7izgr1spgDUKdjNF4nQ
         SLvh8YlZlxZ/uM/NqxRzfyY4GDZSUK9PvBIwKfBkPvcWF1cGRSBLEO8CmuhD9LuPh0+t
         vX2WSgmpK5PaAtj398pz2Jp6BpF0/mfCUBUPMDC1OC1gDds/VD0Vsffyf0ytk8AwYTmu
         mJDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578489; x=1692170489;
        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=tuV8RapENruJ9yIpnO0p4qSE4ssdvVfnP6i34l3RXw0=;
        b=DmGf9FFY0dBTrJHlXCiDb92RQ3RxFgrD3/BqPmj6Gt803RUSs/hJ7W3WAJeH6r0F14
         GhaTjtlWKT1ZFizhx3QXZrINs0sP6Y/BZ9vfCgwXQYP2nmPb7/Fj6nCqj1D1xq86xaQ/
         GyyaUsrX1ciZcX1Z9CFUAwNrlrCUJEOglbN5k0j3SUcjvat3ZBnPfyrLtbwoi/SQCiyL
         qYzNkEAhEWSKhZ2s/RKZPVo6UwLpek79quH4wqYEg14JI6AfblID7gsWKEYtlA3TmfWI
         4aBSFZ28fDVAScMywM9UfH4cM6+POrrsXLYp8JfN0IAza8eutE5btcVuuHX1GQescS0U
         8laA==
X-Gm-Message-State: ABy/qLaTr0ncAtj4tIlKMgwEcGIeROBrutGppOD9TE3NTpXmBZQI70Cd
	5swoPGczOoXfWAFP/ILPd1R+ZyBWZiSVefFoamE=
X-Google-Smtp-Source: APBJJlG/vrwn0VQlvci45eWYHtneEcIHChEHUySN/ceSE3SZZJjWrV7JOQpGtbYA8p8mjpjqp0fuGA==
X-Received: by 2002:a05:6512:202d:b0:4f8:6253:540 with SMTP id s13-20020a056512202d00b004f862530540mr2938837lfs.19.1689578489348;
        Mon, 17 Jul 2023 00:21:29 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v10 08/24] xen/arm: ffa: enforce dependency on 4k pages
Date: Mon, 17 Jul 2023 09:20:51 +0200
Message-Id: <20230717072107.753304-9-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds a BUILD_BUG_ON() to assert the dependency on 4k pages in the FF-A
mediator since the current implementation only works if Xen page size is
the same as the FFA page size.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 xen/arch/arm/tee/ffa.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 56a0a10c1e99..f0a2715d4bbf 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -57,6 +57,16 @@
 #define FFA_MY_VERSION          MAKE_FFA_VERSION(FFA_MY_VERSION_MAJOR, \
                                                  FFA_MY_VERSION_MINOR)
 
+/*
+ * The FF-A specification explicitly works with 4K pages as a measure of
+ * memory size, for example, FFA_RXTX_MAP takes one parameter "RX/TX page
+ * count" which is the number of contiguous 4K pages allocated. Xen may use
+ * a different page size depending on the configuration to avoid confusion
+ * with PAGE_SIZE use a special define when it's a page size as in the FF-A
+ * specification.
+ */
+#define FFA_PAGE_SIZE                   SZ_4K
+
 /*
  * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
  * BIT(31): Framework or partition message
@@ -261,6 +271,17 @@ static bool ffa_probe(void)
     unsigned int major_vers;
     unsigned int minor_vers;
 
+    /*
+     * FF-A often works in units of 4K pages and currently it's assumed
+     * that we can map memory using that granularity. See also the comment
+     * above the FFA_PAGE_SIZE define.
+     *
+     * It is possible to support a PAGE_SIZE larger than 4K in Xen, but
+     * until that is fully handled in this code make sure that we only use
+     * 4K page sizes.
+     */
+    BUILD_BUG_ON(PAGE_SIZE != FFA_PAGE_SIZE);
+
     /*
      * psci_init_smccc() updates this value with what's reported by EL-3
      * or secure world.
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564182.881534 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIY2-0007Xn-EW; Mon, 17 Jul 2023 07:21:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564182.881534; Mon, 17 Jul 2023 07:21:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIY2-0007XZ-Ab; Mon, 17 Jul 2023 07:21:34 +0000
Received: by outflank-mailman (input) for mailman id 564182;
 Mon, 17 Jul 2023 07:21:32 +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
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIY0-0005A9-Lw
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:32 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8d532846-2472-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 09:21:31 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-4fb863edcb6so6584845e87.0
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:31 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8d532846-2472-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578490; x=1692170490;
        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=x0GAChav/BgZruQ3EPU8Qo2tQ1sDnkEZR3Mc3i3hmhg=;
        b=txMm7BRZi3w3XhLyh5bgmsFOQsVZjgRfBefc+vyxakV5NhNk+LSNEcPkpz7fOoObUU
         czB8NoKoVz4YiqNsRbMmUEPn7P37T+g38r5NQ7Jz8NFBmIux7k5kjBQUGgEK6Nh9Htn1
         iMqRlr0lgIt2Dii5jzsNGIG3/Mwpk7b8JnTR/si7Q9nCoASibE/WkIlXBDcGTs2biyPa
         IQxetarrR+nCe+va1ZK8WainU+78XrO76gg7NTGgMzAlMOxHM4Hi38p+avLmlT3zFhuj
         WJIOro/49k9L+ZiXopjimnR+zW0Nh6/VIq/o56Ev48Fbu3lKfrNxa9SegGU7wWXlb+S2
         1Ktw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578490; x=1692170490;
        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=x0GAChav/BgZruQ3EPU8Qo2tQ1sDnkEZR3Mc3i3hmhg=;
        b=LSwPPbdA0zuvuNNQZKiFEwpqIMPfnpziVzAI6bya8ej5QqzhJu3xSBGUoxGvhhJWZn
         ugJyyDu1uM7jRjpC0/JeiPC7HWDaNNuhofcaOlV6nye6vkPBMAV7M5G3iRpEwWKd3F0I
         UZRKeW+GQHvvMgawDtJlxoYl90GebBZX7hgevwp1BVz/MQFe+zCtwgEwYVvGpD3TCihY
         RiKIb1ofdmSz4ygGOR2BM6L1YjFPvTvsm9sb1KlmfEhYPZYtzKiheLIEVbGVJ5fEIJh5
         hvc99UkPnuF+IMJ4mmaMLMhT+Kl1kB4A3dX1yDfoNaf2qa7VDGHRzZg9B5pG1An/izO4
         PZdQ==
X-Gm-Message-State: ABy/qLb58uJMbuC4X8GMQUHeKu7AkvVe8Ig4xpwhqyyHBYIx2sJNhVJ0
	ywqb8zgQgH8AnR42d2MVl8Ww3vDN0rwCQ4hCSjA=
X-Google-Smtp-Source: APBJJlEYcEmYPKsb2mSNB4YPQUBU+JnlKnpd4CpGIP2ykpJd1mq1aL3xNfIX8swGMqEGnt6AS/vjhQ==
X-Received: by 2002:a05:6512:1146:b0:4fb:745e:dd01 with SMTP id m6-20020a056512114600b004fb745edd01mr7090531lfg.45.1689578490527;
        Mon, 17 Jul 2023 00:21:30 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v10 09/24] xen/arm: ffa: add support for FFA_ID_GET
Date: Mon, 17 Jul 2023 09:20:52 +0200
Message-Id: <20230717072107.753304-10-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support for the FF-A function FFA_ID_GET to return the ID of the
calling client.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index f0a2715d4bbf..e157ed20ad8b 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -181,6 +181,12 @@ static bool ffa_get_version(uint32_t *vers)
     return true;
 }
 
+static uint16_t get_vm_id(const struct domain *d)
+{
+    /* +1 since 0 is reserved for the hypervisor in FF-A */
+    return d->domain_id + 1;
+}
+
 static void set_regs(struct cpu_user_regs *regs, register_t v0, register_t v1,
                      register_t v2, register_t v3, register_t v4, register_t v5,
                      register_t v6, register_t v7)
@@ -195,6 +201,12 @@ static void set_regs(struct cpu_user_regs *regs, register_t v0, register_t v1,
         set_user_reg(regs, 7, v7);
 }
 
+static void set_regs_success(struct cpu_user_regs *regs, uint32_t w2,
+                             uint32_t w3)
+{
+    set_regs(regs, FFA_SUCCESS_32, 0, w2, w3, 0, 0, 0, 0);
+}
+
 static void handle_version(struct cpu_user_regs *regs)
 {
     struct domain *d = current->domain;
@@ -224,6 +236,9 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     case FFA_VERSION:
         handle_version(regs);
         return true;
+    case FFA_ID_GET:
+        set_regs_success(regs, get_vm_id(d), 0);
+        return true;
 
     default:
         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
@@ -237,6 +252,12 @@ static int ffa_domain_init(struct domain *d)
 
     if ( !ffa_version )
         return -ENODEV;
+     /*
+      * We can't use that last possible domain ID or get_vm_id() would cause
+      * an overflow.
+      */
+    if ( d->domain_id >= UINT16_MAX)
+        return -ERANGE;
 
     ctx = xzalloc(struct ffa_ctx);
     if ( !ctx )
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564183.881541 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIY3-0007cF-0C; Mon, 17 Jul 2023 07:21:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564183.881541; Mon, 17 Jul 2023 07:21:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIY2-0007bH-Mt; Mon, 17 Jul 2023 07:21:34 +0000
Received: by outflank-mailman (input) for mailman id 564183;
 Mon, 17 Jul 2023 07:21:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIY0-0005A3-Oi
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:32 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8e0dea5a-2472-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 09:21:32 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-4fbc0314a7bso6513295e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:32 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:31 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8e0dea5a-2472-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578491; x=1692170491;
        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=C+n5gOj+w1Jr5cwaD9TQj7fEu8jpwI0+pO30/yvaxYY=;
        b=IMh+wbIT/TbXwxrvp2ciElkOW/rWU0pEwJZ5O4D2EN6qPqr/egaLJ6xlOT9AMJPcR/
         o0E5CVs3248PdVyhyZHLz6L7/HQHw7oX9mgAl8fW+v2ssl7fgBm6OvPRBK50SmZSPLX7
         1JiHV9JTH5O4rO7EK1ZHlu/Y96JwT5l/xsICFkFXJsx8bqC51f8lA7RE7ZMwlFn9HpKR
         5Ru+Bvv2YmNQXprQ0BZxE53Hu5I3vrrxsF4pVFTYgm6fiMwECjj26onbTX/UGlobRYPm
         lzFwjrotuZFrJx5xNlhDVZhGv+WvIblltDgazCHb1d1i7oMO25bJGl3JflvxhmKZwwAi
         fA1w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578491; x=1692170491;
        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=C+n5gOj+w1Jr5cwaD9TQj7fEu8jpwI0+pO30/yvaxYY=;
        b=QVdhh2CNeta/cP5FYbRDTZXwbfqApMrBTd+FXP+J/OvpeWZxQqArd8UUIeqqmY+j2a
         uzKkAm18ro2GL2p6eiNw7NZqwJFT87tonrZ//MP3vXp/Sr7U1X4iKVab+xnia5mSvNX+
         8pdxPydJ/qBCiNvMrjuP3jTMp/Z/R2pVsbWKDjOCCHPCwRJpzX37BS7mzMDbVmdz52z5
         nm3EqypGu9eDd6UtvK/AL+dVl4ieaoO/NWisUVYyd7Qzxfr/0UPP9nvUrhBUGH5IKfbY
         +dKCJISTE76AOKbZ5UU18tYgcHN8Y6NTxqAlvuzzKSLcc/M0ocRs9wCiuZUu+PdOVi6G
         xDZA==
X-Gm-Message-State: ABy/qLaCe7jMKjdErgbRxbE5JMJH8pxxrCGH4gFFN6mJwbrAnZVzaV73
	7lTvlxqb+zPRBn0FMLsuMjd9rtpEq1m3wayEXps=
X-Google-Smtp-Source: APBJJlFvaco7npPz4rr4/KtQq61ejQ/KdDpM1NhtXoFiPR3xecSCFnbvPtFeJJUZa2b/9Nb64XXQrA==
X-Received: by 2002:a05:6512:3710:b0:4fb:7de4:c837 with SMTP id z16-20020a056512371000b004fb7de4c837mr7628433lfr.68.1689578491597;
        Mon, 17 Jul 2023 00:21:31 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v10 10/24] xen/arm: ffa: add direct request support
Date: Mon, 17 Jul 2023 09:20:53 +0200
Message-Id: <20230717072107.753304-11-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support for sending a FF-A direct request. Checks that the SP also
supports handling a 32-bit direct request. 64-bit direct requests are
not used by the mediator itself so there is not need to check for that.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 xen/arch/arm/tee/ffa.c | 113 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 113 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index e157ed20ad8b..e05d58cf7755 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -181,6 +181,56 @@ static bool ffa_get_version(uint32_t *vers)
     return true;
 }
 
+static int32_t get_ffa_ret_code(const struct arm_smccc_1_2_regs *resp)
+{
+    switch ( resp->a0 )
+    {
+    case FFA_ERROR:
+        if ( resp->a2 )
+            return resp->a2;
+        else
+            return FFA_RET_NOT_SUPPORTED;
+    case FFA_SUCCESS_32:
+    case FFA_SUCCESS_64:
+        return FFA_RET_OK;
+    default:
+        return FFA_RET_NOT_SUPPORTED;
+    }
+}
+
+static int32_t ffa_simple_call(uint32_t fid, register_t a1, register_t a2,
+                               register_t a3, register_t a4)
+{
+    const struct arm_smccc_1_2_regs arg = {
+        .a0 = fid,
+        .a1 = a1,
+        .a2 = a2,
+        .a3 = a3,
+        .a4 = a4,
+    };
+    struct arm_smccc_1_2_regs resp;
+
+    arm_smccc_1_2_smc(&arg, &resp);
+
+    return get_ffa_ret_code(&resp);
+}
+
+static int32_t ffa_features(uint32_t id)
+{
+    return ffa_simple_call(FFA_FEATURES, id, 0, 0, 0);
+}
+
+static bool check_mandatory_feature(uint32_t id)
+{
+    int32_t ret = ffa_features(id);
+
+    if ( ret )
+        printk(XENLOG_ERR "ffa: mandatory feature id %#x missing: error %d\n",
+               id, ret);
+
+    return !ret;
+}
+
 static uint16_t get_vm_id(const struct domain *d)
 {
     /* +1 since 0 is reserved for the hypervisor in FF-A */
@@ -222,6 +272,57 @@ static void handle_version(struct cpu_user_regs *regs)
     set_regs(regs, vers, 0, 0, 0, 0, 0, 0, 0);
 }
 
+static void handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
+{
+    struct arm_smccc_1_2_regs arg = { .a0 = fid, };
+    struct arm_smccc_1_2_regs resp = { };
+    struct domain *d = current->domain;
+    uint32_t src_dst;
+    uint64_t mask;
+
+    if ( smccc_is_conv_64(fid) )
+        mask = GENMASK_ULL(63, 0);
+    else
+        mask = GENMASK_ULL(31, 0);
+
+    src_dst = get_user_reg(regs, 1);
+    if ( (src_dst >> 16) != get_vm_id(d) )
+    {
+        resp.a0 = FFA_ERROR;
+        resp.a2 = FFA_RET_INVALID_PARAMETERS;
+        goto out;
+    }
+
+    arg.a1 = src_dst;
+    arg.a2 = get_user_reg(regs, 2) & mask;
+    arg.a3 = get_user_reg(regs, 3) & mask;
+    arg.a4 = get_user_reg(regs, 4) & mask;
+    arg.a5 = get_user_reg(regs, 5) & mask;
+    arg.a6 = get_user_reg(regs, 6) & mask;
+    arg.a7 = get_user_reg(regs, 7) & mask;
+
+    arm_smccc_1_2_smc(&arg, &resp);
+    switch ( resp.a0 )
+    {
+    case FFA_ERROR:
+    case FFA_SUCCESS_32:
+    case FFA_SUCCESS_64:
+    case FFA_MSG_SEND_DIRECT_RESP_32:
+    case FFA_MSG_SEND_DIRECT_RESP_64:
+        break;
+    default:
+        /* Bad fid, report back. */
+        memset(&arg, 0, sizeof(arg));
+        arg.a0 = FFA_ERROR;
+        arg.a1 = src_dst;
+        arg.a2 = FFA_RET_ABORTED;
+    }
+
+out:
+    set_regs(regs, resp.a0, resp.a1 & mask, resp.a2 & mask, resp.a3 & mask,
+             resp.a4 & mask, resp.a5 & mask, resp.a6 & mask, resp.a7 & mask);
+}
+
 static bool ffa_handle_call(struct cpu_user_regs *regs)
 {
     uint32_t fid = get_user_reg(regs, 0);
@@ -239,6 +340,10 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     case FFA_ID_GET:
         set_regs_success(regs, get_vm_id(d), 0);
         return true;
+    case FFA_MSG_SEND_DIRECT_REQ_32:
+    case FFA_MSG_SEND_DIRECT_REQ_64:
+        handle_msg_send_direct_req(regs, fid);
+        return true;
 
     default:
         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
@@ -331,6 +436,14 @@ static bool ffa_probe(void)
     printk(XENLOG_INFO "ARM FF-A Firmware version %u.%u\n",
            major_vers, minor_vers);
 
+    /*
+     * At the moment domains must support the same features used by Xen.
+     * TODO: Rework the code to allow domain to use a subset of the
+     * features supported.
+     */
+    if ( !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
+        return false;
+
     ffa_version = vers;
 
     return true;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564185.881552 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIY4-00083z-DD; Mon, 17 Jul 2023 07:21:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564185.881552; Mon, 17 Jul 2023 07:21:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIY4-00082n-8K; Mon, 17 Jul 2023 07:21:36 +0000
Received: by outflank-mailman (input) for mailman id 564185;
 Mon, 17 Jul 2023 07:21:35 +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
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIY3-0005A9-2e
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:35 +0000
Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com
 [2a00:1450:4864:20::12b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8ebc5e2b-2472-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 09:21:33 +0200 (CEST)
Received: by mail-lf1-x12b.google.com with SMTP id
 2adb3069b0e04-4fb7373dd35so6646335e87.1
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:33 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:32 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8ebc5e2b-2472-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578493; x=1692170493;
        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=I6PcGNOj2uFVtSWdI80VqpOM3Tw157fUaqVtYpkv27I=;
        b=cJMTpeW9Nv2fHAIsIMl9o3An6ZclOge0jq+KZkmwk/6ZRiEPtjmB9sRidhvNETMl6u
         Us9RohRHhBu0hfNZf0zLIYAPx+IfG2v5xRJRdJokjOt762fjg9JgyZCRxSPhek6xL37J
         pz7nH6A4gpDj2uECzLKOLgd9VWBgjbAPZyhbsxmewKJsleaYn0Z6qEyYc1nroZGnQCm0
         mHsYnSvYB/CLsFw0ZLdfdvhmLEHHU/7PmBjRtR4j8f23BS8IjTj1gion63r0Hc1BWzVY
         /9OJvWh/8TnPBa+OtoqTco4NDmrCy5D3WtULFzVXoR2q9sdAs/jpzAnswv09SwK+5XC3
         mJ5g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578493; x=1692170493;
        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=I6PcGNOj2uFVtSWdI80VqpOM3Tw157fUaqVtYpkv27I=;
        b=JNUtGIz7oXjG8rv13MF5wuDMecK8QMg4Gv6/F8xrNo6pExFjgh/Avpwgu93zisVf0R
         OkRLmPG3bfVAce34OaK60qRbtmBqDpxEpMdzFhna6URVTDkh4TlnlS+kBAUV0ZYJHa11
         UPi6Vy9DT1MLl25L11caYXJFOcRzkQuWCGdcV0UNZ5CTmC1CAW/Fws0bEBlJFstJm0EH
         WrL9zPn21jTVlv/an659X6xc+lzQUJRZyk1rtQu+wA9oKQ+D4O5wLrZQAzchsDsF4ljJ
         BOhfKGfZZh8kkKZmexs9Q+Dt+UWpQSyRvlLMvgMHnY/s6LOH9xJaPRfKTUBlr/uVZ/rj
         A+2g==
X-Gm-Message-State: ABy/qLYiNUNYJjYM13LD1rT2hx6IYtd9hJUg+YGLOhZbxbIpxfWOujAc
	QGLJ2FfeO5h1I9pgiZfD53tlFiTWSEECYalNHPc=
X-Google-Smtp-Source: APBJJlEHdF+sylsEGBuTLVkRKIU3lKo+4KNeZ6W0Fb4VaLp6sEq9EVIXBfZD6Yquf+I5aSvpL8Nvbg==
X-Received: by 2002:a19:7111:0:b0:4fb:103f:7d56 with SMTP id m17-20020a197111000000b004fb103f7d56mr2948669lfc.14.1689578492785;
        Mon, 17 Jul 2023 00:21:32 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v10 11/24] xen/arm: ffa: map SPMC rx/tx buffers
Date: Mon, 17 Jul 2023 09:20:54 +0200
Message-Id: <20230717072107.753304-12-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

When initializing the FF-A mediator map the RX and TX buffers shared with
the SPMC.

These buffer are later used to to transmit data that cannot be passed in
registers only.

Adds a check that the SP supports the needed FF-A features
FFA_RXTX_MAP_64 and FFA_RXTX_UNMAP.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c | 50 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 49 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index e05d58cf7755..f8ccaabc568d 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -12,6 +12,7 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
+#include <xen/mm.h>
 #include <xen/sched.h>
 #include <xen/sizes.h>
 #include <xen/types.h>
@@ -67,6 +68,12 @@
  */
 #define FFA_PAGE_SIZE                   SZ_4K
 
+/*
+ * The number of pages used for each of the RX and TX buffers shared with
+ * the SPMC.
+ */
+#define FFA_RXTX_PAGE_COUNT             1
+
 /*
  * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
  * BIT(31): Framework or partition message
@@ -161,6 +168,13 @@ struct ffa_ctx {
 /* Negotiated FF-A version to use with the SPMC */
 static uint32_t __ro_after_init ffa_version;
 
+/*
+ * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
+ * number of pages used in each of these buffers.
+ */
+static void *ffa_rx __read_mostly;
+static void *ffa_tx __read_mostly;
+
 static bool ffa_get_version(uint32_t *vers)
 {
     const struct arm_smccc_1_2_regs arg = {
@@ -231,6 +245,12 @@ static bool check_mandatory_feature(uint32_t id)
     return !ret;
 }
 
+static int32_t ffa_rxtx_map(paddr_t tx_addr, paddr_t rx_addr,
+                            uint32_t page_count)
+{
+    return ffa_simple_call(FFA_RXTX_MAP_64, tx_addr, rx_addr, page_count, 0);
+}
+
 static uint16_t get_vm_id(const struct domain *d)
 {
     /* +1 since 0 is reserved for the hypervisor in FF-A */
@@ -394,6 +414,7 @@ static int ffa_relinquish_resources(struct domain *d)
 static bool ffa_probe(void)
 {
     uint32_t vers;
+    int e;
     unsigned int major_vers;
     unsigned int minor_vers;
 
@@ -441,12 +462,39 @@ static bool ffa_probe(void)
      * TODO: Rework the code to allow domain to use a subset of the
      * features supported.
      */
-    if ( !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
+    if (
+         !check_mandatory_feature(FFA_RXTX_MAP_64) ||
+         !check_mandatory_feature(FFA_RXTX_UNMAP) ||
+         !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
+        return false;
+
+    ffa_rx = alloc_xenheap_pages(get_order_from_pages(FFA_RXTX_PAGE_COUNT), 0);
+    if ( !ffa_rx )
         return false;
 
+    ffa_tx = alloc_xenheap_pages(get_order_from_pages(FFA_RXTX_PAGE_COUNT), 0);
+    if ( !ffa_tx )
+        goto err_free_ffa_rx;
+
+    e = ffa_rxtx_map(__pa(ffa_tx), __pa(ffa_rx), FFA_RXTX_PAGE_COUNT);
+    if ( e )
+    {
+        printk(XENLOG_ERR "ffa: Failed to map rxtx: error %d\n", e);
+        goto err_free_ffa_tx;
+    }
     ffa_version = vers;
 
     return true;
+
+err_free_ffa_tx:
+    free_xenheap_pages(ffa_tx, 0);
+    ffa_tx = NULL;
+err_free_ffa_rx:
+    free_xenheap_pages(ffa_rx, 0);
+    ffa_rx = NULL;
+    ffa_version = 0;
+
+    return false;
 }
 
 static const struct tee_mediator_ops ffa_ops =
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564186.881563 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIY6-0008PI-0C; Mon, 17 Jul 2023 07:21:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564186.881563; Mon, 17 Jul 2023 07:21:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIY5-0008OI-PP; Mon, 17 Jul 2023 07:21:37 +0000
Received: by outflank-mailman (input) for mailman id 564186;
 Mon, 17 Jul 2023 07:21:36 +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
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIY4-0005A9-FA
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:36 +0000
Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com
 [2a00:1450:4864:20::131])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8f6fbc9a-2472-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 09:21:34 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-4fb8574a3a1so6410259e87.1
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:34 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.32
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8f6fbc9a-2472-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578494; x=1692170494;
        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=xKMZdOi/Dn1qjCZASYiDWBzyjEGqNklqsbHI8w4JIKE=;
        b=c4Bd4oT61+05JIG5n8aLHl41wWub0vJuw4h7zAoij+UDaznVtkVxL/gBtIW9xjxWtD
         1aZFbmW4uTmkM3RCVecePFD8SyJwMv++Zb79+H67D8GxEDvXVh2aeVH9vrgjIvgjX2Mz
         3ji8vR1NrzoUgrLQrvV5sHfC7Dr0+uPdfH7H68BsMpByFMdtLaoEXA66mIpQNGt0sv96
         nFxlY7NH1QtbxCpLFQbdS10JnVMU8q0WcHT3Gt0ouKDJ/9kL4dh72zWmcyC7PdqKCdYI
         72dMA3K4tAPNa6UGcNyU8keeU0me8BfVocfav7dws5ArBKj+zk9eI2ficM7RqIZ9pjEQ
         I2JA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578494; x=1692170494;
        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=xKMZdOi/Dn1qjCZASYiDWBzyjEGqNklqsbHI8w4JIKE=;
        b=hx2bMfp1RCgXxRdDQcOEHMlvQ274tgB9geas0LegGd8fuYqv1gUAxEXKjEeociHWuJ
         GdXP+x1xjNRNl3sIfetgEBKCYQSFkbjVtltonPLmocAiP0+MkY5qXodah2TUSJTY6qdl
         to3qgEtkEVzO5rj3Jd+FT1d4HJlJQvqEu62HBRh7VT8t18t8WWnNlv8MNMeGbtAbOC/t
         k2v+eyumLScBIWG6GafNr6jZrDDDDmM9pXRQT916uDJ6Yzl2AZmIA35f1XjuZlMfurgL
         T7DgBHTnruMuvpXk46uFjA3+49kVmgO2jNVts6fHohUWCAGK0f/mpyweSOK3sxCWWTF9
         cLHw==
X-Gm-Message-State: ABy/qLbYWQW4yYGiwroPznj4PcmnQOMIPQS+PYQHkjz3GWh+PMUOAU5n
	FZMGOB0jfSbrnlrja4y1LcR+ilTWCPkEGu5WtO8=
X-Google-Smtp-Source: APBJJlH1XfaEHWpQQp8qy2+MtzfZswKeRNkdS4EtbQQm4fpT9dPK2G7U1sV/Mb6FSfYhrSeHHKCeOw==
X-Received: by 2002:ac2:447b:0:b0:4fb:8441:be06 with SMTP id y27-20020ac2447b000000b004fb8441be06mr6836417lfl.18.1689578493876;
        Mon, 17 Jul 2023 00:21:33 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [XEN PATCH v10 12/24] xen/arm: ffa: send guest events to Secure Partitions
Date: Mon, 17 Jul 2023 09:20:55 +0200
Message-Id: <20230717072107.753304-13-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The FF-A specification defines framework messages sent as direct
requests when certain events occurs. For instance when a VM (guest) is
created or destroyed. Only SPs which have subscribed to these events
will receive them. An SP can subscribe to these messages in its
partition properties.

Adds a check that the SP supports the needed FF-A features
FFA_PARTITION_INFO_GET and FFA_RX_RELEASE.

The partition properties of each SP is retrieved with
FFA_PARTITION_INFO_GET which returns the information in our RX buffer.
Using FFA_PARTITION_INFO_GET changes the owner of the RX buffer to the
caller (us), so once we're done with the buffer it must be released
using FFA_RX_RELEASE before another call can be made.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c | 233 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 231 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index f8ccaabc568d..d755363de686 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -160,14 +160,33 @@
 #define FFA_MSG_SEND                    0x8400006EU
 #define FFA_MSG_POLL                    0x8400006AU
 
+/* Partition information descriptor */
+struct ffa_partition_info_1_1 {
+    uint16_t id;
+    uint16_t execution_context;
+    uint32_t partition_properties;
+    uint8_t uuid[16];
+};
+
 struct ffa_ctx {
     /* FF-A version used by the guest */
     uint32_t guest_vers;
+    /*
+     * Number of SPs that we have sent a VM created signal to, used in
+     * ffa_domain_teardown() to know which SPs need to be signalled.
+     */
+    uint16_t create_signal_count;
 };
 
 /* Negotiated FF-A version to use with the SPMC */
 static uint32_t __ro_after_init ffa_version;
 
+/* SPs subscribing to VM_CREATE and VM_DESTROYED events */
+static uint16_t *subscr_vm_created __read_mostly;
+static uint16_t subscr_vm_created_count __read_mostly;
+static uint16_t *subscr_vm_destroyed __read_mostly;
+static uint16_t subscr_vm_destroyed_count __read_mostly;
+
 /*
  * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
  * number of pages used in each of these buffers.
@@ -251,6 +270,87 @@ static int32_t ffa_rxtx_map(paddr_t tx_addr, paddr_t rx_addr,
     return ffa_simple_call(FFA_RXTX_MAP_64, tx_addr, rx_addr, page_count, 0);
 }
 
+static int32_t ffa_partition_info_get(uint32_t w1, uint32_t w2, uint32_t w3,
+                                      uint32_t w4, uint32_t w5,
+                                      uint32_t *count)
+{
+    const struct arm_smccc_1_2_regs arg = {
+        .a0 = FFA_PARTITION_INFO_GET,
+        .a1 = w1,
+        .a2 = w2,
+        .a3 = w3,
+        .a4 = w4,
+        .a5 = w5,
+    };
+    struct arm_smccc_1_2_regs resp;
+    uint32_t ret;
+
+    arm_smccc_1_2_smc(&arg, &resp);
+
+    ret = get_ffa_ret_code(&resp);
+    if ( !ret )
+        *count = resp.a2;
+
+    return ret;
+}
+
+static int32_t ffa_rx_release(void)
+{
+    return ffa_simple_call(FFA_RX_RELEASE, 0, 0, 0, 0);
+}
+
+static int32_t ffa_direct_req_send_vm(uint16_t sp_id, uint16_t vm_id,
+                                      uint8_t msg)
+{
+    uint32_t exp_resp = FFA_MSG_FLAG_FRAMEWORK;
+    unsigned int retry_count = 0;
+    int32_t res;
+
+    if ( msg == FFA_MSG_SEND_VM_CREATED )
+        exp_resp |= FFA_MSG_RESP_VM_CREATED;
+    else if ( msg == FFA_MSG_SEND_VM_DESTROYED )
+        exp_resp |= FFA_MSG_RESP_VM_DESTROYED;
+    else
+        return FFA_RET_INVALID_PARAMETERS;
+
+    do {
+        const struct arm_smccc_1_2_regs arg = {
+            .a0 = FFA_MSG_SEND_DIRECT_REQ_32,
+            .a1 = sp_id,
+            .a2 = FFA_MSG_FLAG_FRAMEWORK | msg,
+            .a5 = vm_id,
+        };
+        struct arm_smccc_1_2_regs resp;
+
+        arm_smccc_1_2_smc(&arg, &resp);
+        if ( resp.a0 != FFA_MSG_SEND_DIRECT_RESP_32 || resp.a2 != exp_resp )
+        {
+            /*
+             * This is an invalid response, likely due to some error in the
+             * implementation of the ABI.
+             */
+            return FFA_RET_INVALID_PARAMETERS;
+        }
+        res = resp.a3;
+        if ( ++retry_count > 10 )
+        {
+            /*
+             * TODO
+             * FFA_RET_INTERRUPTED means that the SPMC has a pending
+             * non-secure interrupt, we need a way of delivering that
+             * non-secure interrupt.
+             * FFA_RET_RETRY is the SP telling us that it's temporarily
+             * blocked from handling the direct request, we need a generic
+             * way to deal with this.
+             * For now in both cases, give up after a few retries.
+             */
+            return res;
+        }
+    } while ( res == FFA_RET_INTERRUPTED || res == FFA_RET_RETRY );
+
+    return res;
+}
+
 static uint16_t get_vm_id(const struct domain *d)
 {
     /* +1 since 0 is reserved for the hypervisor in FF-A */
@@ -374,6 +474,8 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
 static int ffa_domain_init(struct domain *d)
 {
     struct ffa_ctx *ctx;
+    unsigned int n;
+    int32_t res;
 
     if ( !ffa_version )
         return -ENODEV;
@@ -387,20 +489,68 @@ static int ffa_domain_init(struct domain *d)
     ctx = xzalloc(struct ffa_ctx);
     if ( !ctx )
         return -ENOMEM;
-
     d->arch.tee = ctx;
 
+    for ( n = 0; n < subscr_vm_created_count; n++ )
+    {
+        res = ffa_direct_req_send_vm(subscr_vm_created[n], get_vm_id(d),
+                                     FFA_MSG_SEND_VM_CREATED);
+        if ( res )
+        {
+            printk(XENLOG_ERR "ffa: Failed to report creation of vm_id %u to  %u: res %d\n",
+                   get_vm_id(d), subscr_vm_created[n], res);
+            ctx->create_signal_count = n;
+            return -EIO;
+        }
+    }
+    ctx->create_signal_count = n;
+
     return 0;
 }
 
+static bool is_in_subscr_list(const uint16_t *subscr, uint16_t start,
+                              uint16_t end, uint16_t vm_id)
+{
+    unsigned int n;
+
+    for (n = start; n < end; n++)
+    {
+        if (subscr[n] == vm_id)
+            return true;
+    }
+
+    return false;
+}
+
 /* This function is supposed to undo what ffa_domain_init() has done */
 static int ffa_domain_teardown(struct domain *d)
 {
     struct ffa_ctx *ctx = d->arch.tee;
+    unsigned int n;
+    int32_t res;
 
     if ( !ctx )
         return 0;
 
+    for ( n = 0; n < subscr_vm_destroyed_count; n++ )
+    {
+        /*
+         * Skip SPs subscribed to the VM created event that never was
+         * notified of the VM creation due to an error during
+         * ffa_domain_init().
+         */
+        if ( is_in_subscr_list(subscr_vm_created, ctx->create_signal_count,
+                               subscr_vm_created_count, get_vm_id(d)) )
+            continue;
+
+        res = ffa_direct_req_send_vm(subscr_vm_destroyed[n], get_vm_id(d),
+                                     FFA_MSG_SEND_VM_DESTROYED);
+
+        if ( res )
+            printk(XENLOG_ERR "ffa: Failed to report destruction of vm_id %u to  %u: res %d\n",
+                   get_vm_id(d), subscr_vm_destroyed[n], res);
+    }
+
     XFREE(d->arch.tee);
 
     return 0;
@@ -411,6 +561,81 @@ static int ffa_relinquish_resources(struct domain *d)
     return 0;
 }
 
+static void uninit_subscribers(void)
+{
+        subscr_vm_created_count = 0;
+        subscr_vm_destroyed_count = 0;
+        XFREE(subscr_vm_created);
+        XFREE(subscr_vm_destroyed);
+}
+
+static bool init_subscribers(struct ffa_partition_info_1_1 *fpi, uint16_t count)
+{
+    uint16_t n;
+    uint16_t c_pos;
+    uint16_t d_pos;
+
+    subscr_vm_created_count = 0;
+    subscr_vm_destroyed_count = 0;
+    for ( n = 0; n < count; n++ )
+    {
+        if (fpi[n].partition_properties & FFA_PART_PROP_NOTIF_CREATED)
+            subscr_vm_created_count++;
+        if (fpi[n].partition_properties & FFA_PART_PROP_NOTIF_DESTROYED)
+            subscr_vm_destroyed_count++;
+    }
+
+    if ( subscr_vm_created_count )
+        subscr_vm_created = xzalloc_array(uint16_t, subscr_vm_created_count);
+    if ( subscr_vm_destroyed_count )
+        subscr_vm_destroyed = xzalloc_array(uint16_t,
+                                            subscr_vm_destroyed_count);
+    if ( (subscr_vm_created_count && !subscr_vm_created) ||
+         (subscr_vm_destroyed_count && !subscr_vm_destroyed) )
+    {
+        printk(XENLOG_ERR "ffa: Failed to allocate subscription lists\n");
+        uninit_subscribers();
+        return false;
+    }
+
+    for ( c_pos = 0, d_pos = 0, n = 0; n < count; n++ )
+    {
+        if ( fpi[n].partition_properties & FFA_PART_PROP_NOTIF_CREATED )
+            subscr_vm_created[c_pos++] = fpi[n].id;
+        if ( fpi[n].partition_properties & FFA_PART_PROP_NOTIF_DESTROYED )
+            subscr_vm_destroyed[d_pos++] = fpi[n].id;
+    }
+
+    return true;
+}
+
+static bool init_sps(void)
+{
+    bool ret = false;
+    uint32_t count;
+    int e;
+
+    e = ffa_partition_info_get(0, 0, 0, 0, 0, &count);
+    if ( e )
+    {
+        printk(XENLOG_ERR "ffa: Failed to get list of SPs: %d\n", e);
+        goto out;
+    }
+
+    if ( count >= UINT16_MAX )
+    {
+        printk(XENLOG_ERR "ffa: Impossible number of SPs: %u\n", count);
+        goto out;
+    }
+
+    ret = init_subscribers(ffa_rx, count);
+
+out:
+    ffa_rx_release();
+
+    return ret;
+}
+
 static bool ffa_probe(void)
 {
     uint32_t vers;
@@ -462,7 +687,8 @@ static bool ffa_probe(void)
      * TODO: Rework the code to allow domain to use a subset of the
      * features supported.
      */
-    if (
+    if ( !check_mandatory_feature(FFA_PARTITION_INFO_GET) ||
+         !check_mandatory_feature(FFA_RX_RELEASE) ||
          !check_mandatory_feature(FFA_RXTX_MAP_64) ||
          !check_mandatory_feature(FFA_RXTX_UNMAP) ||
          !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
@@ -484,6 +710,9 @@ static bool ffa_probe(void)
     }
     ffa_version = vers;
 
+    if ( !init_sps() )
+        goto err_free_ffa_tx;
+
     return true;
 
 err_free_ffa_tx:
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564187.881570 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIY6-0008VI-PE; Mon, 17 Jul 2023 07:21:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564187.881570; Mon, 17 Jul 2023 07:21:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIY6-0008Sx-Ax; Mon, 17 Jul 2023 07:21:38 +0000
Received: by outflank-mailman (input) for mailman id 564187;
 Mon, 17 Jul 2023 07:21:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIY4-0005A3-EQ
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:36 +0000
Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com
 [2a00:1450:4864:20::133])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 90301a22-2472-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 09:21:35 +0200 (CEST)
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-4fba74870abso6463266e87.0
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:35 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:34 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 90301a22-2472-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578495; x=1692170495;
        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=DSBg2xryTcGQSIhkiAk5XZ42VUodB1h52U56N4DUxBw=;
        b=WEFo1xCrhPIKQl/EoWN2EbA7RUYk7dZ4eYCvPCFWGH69YNSbobCMAA7B42TzjVfhgo
         tiikNHzgRqPvJBG2OQIDwjlK6qw1XO9x0J5XDZdsiL0pPgP0so653MtX33/Jx2vKSUKJ
         OtikNc0q727N2Wgh5mXEsHQ3z15KErB07GIFBiGCaJ7zvNOqPlZgU4sIy9t2g2oGXmnf
         kwBBsiyssr7uYoscrtJPb1efZ0pon0aBuI5Dguqe8U8Ctt2cTlCxE+WHCL1QHz+0u/uf
         thEkVixZ1uPyfDRHZUO2ng17bfAqiq5OXuKBzaooqdxQXwd4495s/CCOzrbLOSYrgco0
         sr0Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578495; x=1692170495;
        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=DSBg2xryTcGQSIhkiAk5XZ42VUodB1h52U56N4DUxBw=;
        b=J6b78hU/2uJzBeZLQoKfNL2GaxXSy4SgndaIGqSnPVOmzx/KolnCgpGEKf+R96fCzJ
         j1Kt9Z3U1USsYvtoUQxsGEkkAQQkwG7gj0ZZ+WnlpnAC84id6bpXxy3UDSoKOXDy9FdU
         TteL4NENszWguHp3JARRpjS8hk5ha67CBW2MWcMkYiIj3t6Vr35EXy+8pmwPoiGqLDyQ
         5mz+0IbLAmNRhkNpcb2EfRPqltxrrxY1XBV2oG351k0PWABZOIfRjHYz+nfwhyaF49io
         JzlhHecnGIUsmB2lfU2LnyfwNmg1e4e6zTYZwQsJsQ5GKDsEnfEV6rbyfgIlaLoTjfoW
         O0jg==
X-Gm-Message-State: ABy/qLZfeZGNjLadHUy10XY9qBWCcy9mMXhok818etxIW7Ig5OqSEgK1
	aJvEU87BjxC3UC5rO5r3pzVWqj954CEe2VeQr08=
X-Google-Smtp-Source: APBJJlHKkTI0NKp536H6xxNI0RfMjn8kGf9vtAkpc1gGkhzDksM/T2J3y7/xbL7evFjx3DbrXyn7Qg==
X-Received: by 2002:ac2:51ae:0:b0:4f9:607a:6508 with SMTP id f14-20020ac251ae000000b004f9607a6508mr6829078lfk.50.1689578494987;
        Mon, 17 Jul 2023 00:21:34 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [XEN PATCH v10 13/24] xen/arm: ffa: support mapping guest RX/TX buffers
Date: Mon, 17 Jul 2023 09:20:56 +0200
Message-Id: <20230717072107.753304-14-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support in the mediator to map and unmap the RX and TX buffers
provided by the guest using the two FF-A functions FFA_RXTX_MAP and
FFA_RXTX_UNMAP.

These buffer are later used to transmit data that cannot be passed in
registers only.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c | 138 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index d755363de686..ffabb5ed0a80 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -74,6 +74,12 @@
  */
 #define FFA_RXTX_PAGE_COUNT             1
 
+/*
+ * Limits the number of pages RX/TX buffers guests can map.
+ * TODO support a larger number.
+ */
+#define FFA_MAX_RXTX_PAGE_COUNT         1
+
 /*
  * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
  * BIT(31): Framework or partition message
@@ -169,6 +175,12 @@ struct ffa_partition_info_1_1 {
 };
 
 struct ffa_ctx {
+    void *rx;
+    const void *tx;
+    struct page_info *rx_pg;
+    struct page_info *tx_pg;
+    /* Number of 4kB pages in each of rx/rx_pg and tx/tx_pg */
+    unsigned int page_count;
     /* FF-A version used by the guest */
     uint32_t guest_vers;
     /*
@@ -176,6 +188,7 @@ struct ffa_ctx {
      * ffa_domain_teardown() to know which SPs need to be signalled.
      */
     uint16_t create_signal_count;
+    bool rx_is_free;
 };
 
 /* Negotiated FF-A version to use with the SPMC */
@@ -371,6 +384,11 @@ static void set_regs(struct cpu_user_regs *regs, register_t v0, register_t v1,
         set_user_reg(regs, 7, v7);
 }
 
+static void set_regs_error(struct cpu_user_regs *regs, uint32_t error_code)
+{
+    set_regs(regs, FFA_ERROR, 0, error_code, 0, 0, 0, 0, 0);
+}
+
 static void set_regs_success(struct cpu_user_regs *regs, uint32_t w2,
                              uint32_t w3)
 {
@@ -392,6 +410,106 @@ static void handle_version(struct cpu_user_regs *regs)
     set_regs(regs, vers, 0, 0, 0, 0, 0, 0, 0);
 }
 
+static uint32_t handle_rxtx_map(uint32_t fid, register_t tx_addr,
+                                register_t rx_addr, uint32_t page_count)
+{
+    uint32_t ret = FFA_RET_INVALID_PARAMETERS;
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+    struct page_info *tx_pg;
+    struct page_info *rx_pg;
+    p2m_type_t t;
+    void *rx;
+    void *tx;
+
+    if ( !smccc_is_conv_64(fid) )
+    {
+        /*
+         * Calls using the 32-bit calling convention must ignore the upper
+         * 32 bits in the argument registers.
+         */
+        tx_addr &= UINT32_MAX;
+        rx_addr &= UINT32_MAX;
+    }
+
+    if ( page_count > FFA_MAX_RXTX_PAGE_COUNT )
+    {
+        printk(XENLOG_ERR "ffa: RXTX_MAP: error: %u pages requested (limit %u)\n",
+               page_count, FFA_MAX_RXTX_PAGE_COUNT);
+        return FFA_RET_NOT_SUPPORTED;
+    }
+
+    /* Already mapped */
+    if ( ctx->rx )
+        return FFA_RET_DENIED;
+
+    tx_pg = get_page_from_gfn(d, gfn_x(gaddr_to_gfn(tx_addr)), &t, P2M_ALLOC);
+    if ( !tx_pg )
+        return FFA_RET_INVALID_PARAMETERS;
+    /* Only normal RW RAM for now */
+    if ( t != p2m_ram_rw )
+        goto err_put_tx_pg;
+
+    rx_pg = get_page_from_gfn(d, gfn_x(gaddr_to_gfn(rx_addr)), &t, P2M_ALLOC);
+    if ( !tx_pg )
+        goto err_put_tx_pg;
+    /* Only normal RW RAM for now */
+    if ( t != p2m_ram_rw )
+        goto err_put_rx_pg;
+
+    tx = __map_domain_page_global(tx_pg);
+    if ( !tx )
+        goto err_put_rx_pg;
+
+    rx = __map_domain_page_global(rx_pg);
+    if ( !rx )
+        goto err_unmap_tx;
+
+    ctx->rx = rx;
+    ctx->tx = tx;
+    ctx->rx_pg = rx_pg;
+    ctx->tx_pg = tx_pg;
+    ctx->page_count = page_count;
+    ctx->rx_is_free = true;
+    return FFA_RET_OK;
+
+err_unmap_tx:
+    unmap_domain_page_global(tx);
+err_put_rx_pg:
+    put_page(rx_pg);
+err_put_tx_pg:
+    put_page(tx_pg);
+
+    return ret;
+}
+
+static void rxtx_unmap(struct ffa_ctx *ctx)
+{
+    unmap_domain_page_global(ctx->rx);
+    unmap_domain_page_global(ctx->tx);
+    put_page(ctx->rx_pg);
+    put_page(ctx->tx_pg);
+    ctx->rx = NULL;
+    ctx->tx = NULL;
+    ctx->rx_pg = NULL;
+    ctx->tx_pg = NULL;
+    ctx->page_count = 0;
+    ctx->rx_is_free = false;
+}
+
+static uint32_t handle_rxtx_unmap(void)
+{
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+
+    if ( !ctx->rx )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    rxtx_unmap(ctx);
+
+    return FFA_RET_OK;
+}
+
 static void handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
 {
     struct arm_smccc_1_2_regs arg = { .a0 = fid, };
@@ -448,6 +566,7 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     uint32_t fid = get_user_reg(regs, 0);
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
+    int e;
 
     if ( !ctx )
         return false;
@@ -460,6 +579,22 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     case FFA_ID_GET:
         set_regs_success(regs, get_vm_id(d), 0);
         return true;
+    case FFA_RXTX_MAP_32:
+    case FFA_RXTX_MAP_64:
+        e = handle_rxtx_map(fid, get_user_reg(regs, 1), get_user_reg(regs, 2),
+                            get_user_reg(regs, 3));
+        if ( e )
+            set_regs_error(regs, e);
+        else
+            set_regs_success(regs, 0, 0);
+        return true;
+    case FFA_RXTX_UNMAP:
+        e = handle_rxtx_unmap();
+        if ( e )
+            set_regs_error(regs, e);
+        else
+            set_regs_success(regs, 0, 0);
+        return true;
     case FFA_MSG_SEND_DIRECT_REQ_32:
     case FFA_MSG_SEND_DIRECT_REQ_64:
         handle_msg_send_direct_req(regs, fid);
@@ -551,6 +686,9 @@ static int ffa_domain_teardown(struct domain *d)
                    get_vm_id(d), subscr_vm_destroyed[n], res);
     }
 
+    if ( ctx->rx )
+        rxtx_unmap(ctx);
+
     XFREE(d->arch.tee);
 
     return 0;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564188.881574 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIY7-0000FZ-Aq; Mon, 17 Jul 2023 07:21:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564188.881574; Mon, 17 Jul 2023 07:21:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIY7-0000C5-42; Mon, 17 Jul 2023 07:21:39 +0000
Received: by outflank-mailman (input) for mailman id 564188;
 Mon, 17 Jul 2023 07:21:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIY5-0005A3-IT
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:37 +0000
Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com
 [2a00:1450:4864:20::12e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 90e6f746-2472-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 09:21:37 +0200 (CEST)
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-4fb7589b187so6466236e87.1
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:37 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.35
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 90e6f746-2472-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578496; x=1692170496;
        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=yGDYqeByXV8bSEztmWgee0JK3pFxnI7HN01UFyB4olQ=;
        b=OIZFFuTGAtZmeKjST/n6DeRljPjk2acHhAkyrWuRPC3tj2Sucl9X/WYuOkB0ZrbAUw
         1XrOFO4iYXb4iQ5HSLZ9Qcl16KCU21E/2lzRRHFrI5I6Vs9xgy+uSjyW61JtgAtmL6D4
         OlcKXt0Ba+jkzWTmiQ/pExxDF4xgys1e06ITWeH7ZCZl+xFAaqyXAjT6QKYjGF5uJWtf
         f9pBlRGjHn2gmLDZTSn1uIWwQsogSZO62tu2cLUaSV8sn7wlzkHsPsgAjfLLKIdW2xxH
         e23MR7lzjRwqEVeVm92+alZA9erf1oLHfG0Qq8/aMWCaqdfHWrxPXKtFCqf9nwtt3hUO
         wE1Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578496; x=1692170496;
        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=yGDYqeByXV8bSEztmWgee0JK3pFxnI7HN01UFyB4olQ=;
        b=Ah6EtxsEq13b7MpXDea6+hK1o2xITBVxkFjTSTaZKj/9lmcXYef332Qp0tL7QklZZi
         WGF4ipJreAs1YnqKD3xuxlvE5sbXqPl4wqMsgkSIlMILdvKzKiUhBK7Ozbq4knWSKk1q
         ft91e4QzuXUHenFRtrrnFHEpWUMffc6tyMmV2O03BlFEr4aE9T8LJQ3N4m0zipgka2V9
         hwd7+R9qDmsBJ0J+VY5Qp9kpp34bpaEHmdszk5pFYqN9ikaOXGZIZO9stGBgJCIKMsR8
         14HuFMNzhAGZtpaeIVYNM85t3wRJRMJZ+tDV5GAIg79YfrbqMVMVpJ7UphO8AslcNzlJ
         cseQ==
X-Gm-Message-State: ABy/qLZiyxHdgaC/S1rEWctF9qi4covurjgPn2njVT48QoYPoPdV9M+q
	5QtD/CaqDFh1k4H8euX7Sv4Msj0lMF4cWGXoZNQ=
X-Google-Smtp-Source: APBJJlFvMF9sKJ05ylGz+WoP/8dMl7wwvn0bfoZtSSw2bLeWWbzmADI1sZPqGifTfzAoEY6+Ufkgxw==
X-Received: by 2002:a05:6512:304a:b0:4fa:a0c3:ef9d with SMTP id b10-20020a056512304a00b004faa0c3ef9dmr8538752lfb.18.1689578496323;
        Mon, 17 Jul 2023 00:21:36 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v10 14/24] xen/arm: ffa: support guest FFA_PARTITION_INFO_GET
Date: Mon, 17 Jul 2023 09:20:57 +0200
Message-Id: <20230717072107.753304-15-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support in the mediator to handle FFA_PARTITION_INFO_GET requests
from a guest. The requests are forwarded to the SPMC and the response is
translated according to the FF-A version in use by the guest.

Using FFA_PARTITION_INFO_GET changes the owner of the RX buffer to the
caller (the guest in this case), so once it is done with the buffer it
must be released using FFA_RX_RELEASE before another call can be made.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c | 131 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 131 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index ffabb5ed0a80..d5748b9ce88c 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -166,7 +166,18 @@
 #define FFA_MSG_SEND                    0x8400006EU
 #define FFA_MSG_POLL                    0x8400006AU
 
+/*
+ * Structs below ending with _1_0 are defined in FF-A-1.0-REL and
+ * struct ending with _1_1 are defined in FF-A-1.1-REL0.
+ */
+
 /* Partition information descriptor */
+struct ffa_partition_info_1_0 {
+    uint16_t id;
+    uint16_t execution_context;
+    uint32_t partition_properties;
+};
+
 struct ffa_partition_info_1_1 {
     uint16_t id;
     uint16_t execution_context;
@@ -189,6 +200,7 @@ struct ffa_ctx {
      */
     uint16_t create_signal_count;
     bool rx_is_free;
+    spinlock_t lock;
 };
 
 /* Negotiated FF-A version to use with the SPMC */
@@ -203,9 +215,15 @@ static uint16_t subscr_vm_destroyed_count __read_mostly;
 /*
  * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
  * number of pages used in each of these buffers.
+ *
+ * The RX buffer is protected from concurrent usage with ffa_rx_buffer_lock.
+ * Note that the SPMC is also tracking the ownership of our RX buffer so
+ * for calls which uses our RX buffer to deliver a result we must call
+ * ffa_rx_release() to let the SPMC know that we're done with the buffer.
  */
 static void *ffa_rx __read_mostly;
 static void *ffa_tx __read_mostly;
+static DEFINE_SPINLOCK(ffa_rx_buffer_lock);
 
 static bool ffa_get_version(uint32_t *vers)
 {
@@ -510,6 +528,100 @@ static uint32_t handle_rxtx_unmap(void)
     return FFA_RET_OK;
 }
 
+static int32_t handle_partition_info_get(uint32_t w1, uint32_t w2, uint32_t w3,
+                                         uint32_t w4, uint32_t w5,
+                                         uint32_t *count)
+{
+    int32_t ret = FFA_RET_DENIED;
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+
+    /*
+     * FF-A v1.0 has w5 MBZ while v1.1 allows
+     * FFA_PARTITION_INFO_GET_COUNT_FLAG to be non-zero.
+     */
+    if ( w5 == FFA_PARTITION_INFO_GET_COUNT_FLAG &&
+         ctx->guest_vers == FFA_VERSION_1_1 )
+        return ffa_partition_info_get(w1, w2, w3, w4, w5, count);
+    if ( w5 )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    if ( !ffa_rx )
+        return FFA_RET_DENIED;
+
+    spin_lock(&ctx->lock);
+    if ( !ctx->page_count || !ctx->rx_is_free )
+        goto out;
+    spin_lock(&ffa_rx_buffer_lock);
+    ret = ffa_partition_info_get(w1, w2, w3, w4, w5, count);
+    if ( ret )
+        goto out_rx_buf_unlock;
+    /*
+     * ffa_partition_info_get() succeeded so we now own the RX buffer we
+     * share with the SPMC. We must give it back using ffa_rx_release()
+     * once we've copied the content.
+     */
+
+    if ( ctx->guest_vers == FFA_VERSION_1_0 )
+    {
+        size_t n;
+        struct ffa_partition_info_1_1 *src = ffa_rx;
+        struct ffa_partition_info_1_0 *dst = ctx->rx;
+
+        if ( ctx->page_count * FFA_PAGE_SIZE < *count * sizeof(*dst) )
+        {
+            ret = FFA_RET_NO_MEMORY;
+            goto out_rx_release;
+        }
+
+        for ( n = 0; n < *count; n++ )
+        {
+            dst[n].id = src[n].id;
+            dst[n].execution_context = src[n].execution_context;
+            dst[n].partition_properties = src[n].partition_properties;
+        }
+    }
+    else
+    {
+        size_t sz = *count * sizeof(struct ffa_partition_info_1_1);
+
+        if ( ctx->page_count * FFA_PAGE_SIZE < sz )
+        {
+            ret = FFA_RET_NO_MEMORY;
+            goto out_rx_release;
+        }
+
+
+        memcpy(ctx->rx, ffa_rx, sz);
+    }
+    ctx->rx_is_free = false;
+out_rx_release:
+    ffa_rx_release();
+out_rx_buf_unlock:
+    spin_unlock(&ffa_rx_buffer_lock);
+out:
+    spin_unlock(&ctx->lock);
+
+    return ret;
+}
+
+static int32_t handle_rx_release(void)
+{
+    int32_t ret = FFA_RET_DENIED;
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+
+    spin_lock(&ctx->lock);
+    if ( !ctx->page_count || ctx->rx_is_free )
+        goto out;
+    ret = FFA_RET_OK;
+    ctx->rx_is_free = true;
+out:
+    spin_unlock(&ctx->lock);
+
+    return ret;
+}
+
 static void handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
 {
     struct arm_smccc_1_2_regs arg = { .a0 = fid, };
@@ -566,6 +678,7 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     uint32_t fid = get_user_reg(regs, 0);
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
+    uint32_t count;
     int e;
 
     if ( !ctx )
@@ -595,6 +708,24 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
         else
             set_regs_success(regs, 0, 0);
         return true;
+    case FFA_PARTITION_INFO_GET:
+        e = handle_partition_info_get(get_user_reg(regs, 1),
+                                      get_user_reg(regs, 2),
+                                      get_user_reg(regs, 3),
+                                      get_user_reg(regs, 4),
+                                      get_user_reg(regs, 5), &count);
+        if ( e )
+            set_regs_error(regs, e);
+        else
+            set_regs_success(regs, count, 0);
+        return true;
+    case FFA_RX_RELEASE:
+        e = handle_rx_release();
+        if ( e )
+            set_regs_error(regs, e);
+        else
+            set_regs_success(regs, 0, 0);
+        return true;
     case FFA_MSG_SEND_DIRECT_REQ_32:
     case FFA_MSG_SEND_DIRECT_REQ_64:
         handle_msg_send_direct_req(regs, fid);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564190.881592 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIYA-0000oa-1p; Mon, 17 Jul 2023 07:21:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564190.881592; Mon, 17 Jul 2023 07:21:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIY9-0000lq-59; Mon, 17 Jul 2023 07:21:41 +0000
Received: by outflank-mailman (input) for mailman id 564190;
 Mon, 17 Jul 2023 07:21:39 +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
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIY7-0005A9-IP
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:39 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 916f14b0-2472-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 09:21:38 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-4f954d7309fso5144996e87.1
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:38 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:36 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 916f14b0-2472-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578497; x=1692170497;
        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=YcMbvZQAuDfLbcHqMVEHcqz7Bisfyi8R+YRN0ovSOHM=;
        b=wQrqM2t2606UV0OnFoV2KErLEwJQoYnzx747nLlbR+U3DbAlXjM5LrRtBVRMkkn8HC
         HyJCITUZwZy/XJoFrplzmTu86j9+Skn8tQWH+CA5fP9jNJ+/cef22S1L5ZxngOSoQwXU
         Yb3kOKHIPp6Wm4jqDcBdsnkWWSN7tT1o/hc8xCWOUjCfXUK+kxCWnYYuBGRa42w8MrLX
         gahOCC3tC2itPq/xZNawqqziBj+B0/5oaZyT0Z7U6GDXTb4qOvinb0uvBS6TQatVz5wc
         6d+bz1SDyGdrr62YUY2pakJq/2Sqy5Vvk6jSJ/iZnysncboTmTGJ6aH+j4zPHxkxjnrk
         Peqw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578497; x=1692170497;
        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=YcMbvZQAuDfLbcHqMVEHcqz7Bisfyi8R+YRN0ovSOHM=;
        b=FFjZhhdOb9HGORWAvEMvaT61YON7PziuucYsxhMTilrS0Uib9uRtZUTC7CXqtBLwya
         QmSg1GRIfVQrEXQ0X5L14ZK7FjK5pjuI0tu0jAUNxYNu0ooX1mtQI6T2ffKKq//ZpEgh
         eQh8uzIrCmeZvCzBiO8HLzopRimawI71BNC09gt0l8AWz8XlYxImwsQUWkb9Y1l0l38w
         C0/7CDDsUhGdCthqZSALCNoFsRf3Gak5/kfwxEsF8KJyYKKAGmdbGXP9kr6IMg1WdSRi
         OwHSjrOjT3rzu9Bc6f6SvUdzEvfIfxl/ZwW/9FhvFonbxfvFAh3GZICKb75DJ4brOt0x
         eybA==
X-Gm-Message-State: ABy/qLYrwMCNLm4FG4BmyZEZ5vgU2IL5M3eyfDTWsvjBf/u+4hHgaaIu
	JH3NXRDBlzQtWKtVtqSvqr1sA3rhMgo77CAg4PE=
X-Google-Smtp-Source: APBJJlGGxa+H0X6sEoILtlGCpBLd3sxIME8YJaVhY4CqTPoCQVaCTJ+SwgtDIbXAAAlhE+ON3Le2mw==
X-Received: by 2002:a19:4f05:0:b0:4fb:c9e1:5286 with SMTP id d5-20020a194f05000000b004fbc9e15286mr2707204lfb.7.1689578497391;
        Mon, 17 Jul 2023 00:21:37 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v10 15/24] xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h
Date: Mon, 17 Jul 2023 09:20:58 +0200
Message-Id: <20230717072107.753304-16-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Moves the two helper functions regpair_to_uint64() and
uint64_to_regpair() from xen/arch/arm/tee/optee.c to the common arm
specific regs.h. This enables reuse of these functions in the FF-A
mediator in a subsequent patch.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 xen/arch/arm/include/asm/regs.h | 12 ++++++++++++
 xen/arch/arm/tee/optee.c        | 11 -----------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/include/asm/regs.h b/xen/arch/arm/include/asm/regs.h
index ef34b38aa171..8a0db9541507 100644
--- a/xen/arch/arm/include/asm/regs.h
+++ b/xen/arch/arm/include/asm/regs.h
@@ -60,6 +60,18 @@ static inline bool guest_mode(const struct cpu_user_regs *r)
 register_t get_user_reg(struct cpu_user_regs *regs, int reg);
 void set_user_reg(struct cpu_user_regs *regs, int reg, register_t value);
 
+static inline uint64_t regpair_to_uint64(register_t reg0, register_t reg1)
+{
+    return ((uint64_t)reg0 << 32) | (uint32_t)reg1;
+}
+
+static inline void uint64_to_regpair(register_t *reg0, register_t *reg1,
+                                     uint64_t val)
+{
+    *reg0 = val >> 32;
+    *reg1 = (uint32_t)val;
+}
+
 #endif
 
 #endif /* __ARM_REGS_H__ */
diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
index c91bd7d5ac25..5151bd90ed02 100644
--- a/xen/arch/arm/tee/optee.c
+++ b/xen/arch/arm/tee/optee.c
@@ -273,17 +273,6 @@ static int optee_domain_teardown(struct domain *d)
     return 0;
 }
 
-static uint64_t regpair_to_uint64(register_t reg0, register_t reg1)
-{
-    return ((uint64_t)reg0 << 32) | (uint32_t)reg1;
-}
-
-static void uint64_to_regpair(register_t *reg0, register_t *reg1, uint64_t val)
-{
-    *reg0 = val >> 32;
-    *reg1 = (uint32_t)val;
-}
-
 static struct page_info *get_domain_ram_page(gfn_t gfn)
 {
     struct page_info *page;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564191.881596 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIYB-00012B-46; Mon, 17 Jul 2023 07:21:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564191.881596; Mon, 17 Jul 2023 07:21:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIYA-0000yH-Cf; Mon, 17 Jul 2023 07:21:42 +0000
Received: by outflank-mailman (input) for mailman id 564191;
 Mon, 17 Jul 2023 07:21:40 +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
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIY8-0005A9-QR
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:40 +0000
Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com
 [2a00:1450:4864:20::12c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 921d04c3-2472-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 09:21:39 +0200 (CEST)
Received: by mail-lf1-x12c.google.com with SMTP id
 2adb3069b0e04-4fb9ae4cef6so6518481e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:39 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 921d04c3-2472-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578498; x=1692170498;
        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=jd1PqoKu3zNmxIHhUbgtRR0UeglIV+SwdMxJBYTSy/E=;
        b=nvPCYn3abnrPXljDHRPFHr15KbPB3Cc2Tyw+MorT0s3B9IqRXnG88MbbEyfI7ypTXT
         WMYjHTRAVCnK3ucnJGH+IIM1fi0OJS4gRncdC1/u9eJSztM7D554l2vGB6qftAL+DW2K
         X6mm1S/lQUrAwoEcboi0aUrOF2rFXerWy4d0yqgSBGPq4quZBLnQZ1hSSkf0bijm1twq
         7x+jhkhD98MdLfv2hOTOOc4pCf4fWRQyPoSu80NeiGsYDsq6DjiEQQNIuhwQQX1T0dBK
         nndz/9Z9iZgMWQnx6eDWHvadXG0bTkBEcmjK7Hb95Dk0LZs1Ic642RwNW5fanYRsnaNF
         nU8w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578498; x=1692170498;
        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=jd1PqoKu3zNmxIHhUbgtRR0UeglIV+SwdMxJBYTSy/E=;
        b=ldDLSD+cGqgk4O9dTHkJvAM2rgQ8BnkzlCwe8oY9ZBXbDvl8NV7kXp2ijXrNEQvIxf
         1uE4MYY9G5fjAMZh+qOSfF8Hy72EtzUqR4p8Gg2m9w/Ih2FBGdoBNN6rnb+CWrn23nED
         EySPlR1cTDdHQIscDj077Y5LRpQW8FNFAwkpvZQ0cEMkaFV4P0p0IwPk656otHk5qsmc
         7rDc1S0wIAzFLVEtQc5aaCo2ATGkgVerGVtagdm0ygxkBGIVqAqAzSaBsKb0LlmTBk5C
         tSPh+jTrYDtW30L9EnHamG2wJVnCSR8r4/4JXoyLokfKmJCO4Iqdl1kEdFD3jPnoi5OZ
         OzAQ==
X-Gm-Message-State: ABy/qLbT2AO24MGSFjS6lZDpRK30AsHtS36LKcLXsQBZZNQGnGg/2wuL
	SxM8tRGK2RRvo67+L5z5IDtRNtPmQxlgryvvd+U=
X-Google-Smtp-Source: APBJJlFeGStcIAq8SjQ4HIsWMMxT/QdM8hZ/oScthPFdYUluUmJJtPdwGV1PkhIV44GGEQwQpjfibA==
X-Received: by 2002:a05:6512:1320:b0:4f8:7803:64e6 with SMTP id x32-20020a056512132000b004f8780364e6mr6704992lfu.41.1689578498489;
        Mon, 17 Jul 2023 00:21:38 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v10 16/24] xen/arm: ffa: add defines for sharing memory
Date: Mon, 17 Jul 2023 09:20:59 +0200
Message-Id: <20230717072107.753304-17-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

According to DEN0077A version 1.1 REL0
- Section 10.9.2 Memory region handle, page 167
- Table 10.18 at page 175
- Table 10.15 at page 168
- Section 10.11.4 Flags usage, page 184-187
add defines needed for sharing using the function FFA_MEM_SHARE and
friends.

Also add limits for how many shared buffers that a guest can have at
once and how large a shared buffer can be at most.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 xen/arch/arm/tee/ffa.c | 58 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index d5748b9ce88c..e895e355e620 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -5,6 +5,14 @@
  * Arm Firmware Framework for ARMv8-A (FF-A) mediator
  *
  * Copyright (C) 2023  Linaro Limited
+ *
+ * References:
+ * FF-A-1.0-REL: FF-A specification version 1.0 available at
+ *               https://developer.arm.com/documentation/den0077/a
+ * FF-A-1.1-REL0: FF-A specification version 1.1 available at
+ *                https://developer.arm.com/documentation/den0077/e
+ * TEEC-1.0C: TEE Client API Specification version 1.0c available at
+ *            https://globalplatform.org/specs-library/tee-client-api-specification/
  */
 
 #include <xen/bitops.h>
@@ -80,6 +88,56 @@
  */
 #define FFA_MAX_RXTX_PAGE_COUNT         1
 
+/*
+ * Limit for shared buffer size. Please note that this define limits
+ * number of pages.
+ *
+ * FF-A doesn't have any direct requirements on GlobalPlatform or vice
+ * versa, but an implementation can very well use FF-A in order to provide
+ * a GlobalPlatform interface on top.
+ *
+ * Global Platform specification for TEE requires that any TEE
+ * implementation should allow to share buffers with size of at least
+ * 512KB, defined in TEEC-1.0C page 24, Table 4-1,
+ * TEEC_CONFIG_SHAREDMEM_MAX_SIZE.
+ * Due to overhead which can be hard to predict exactly, double this number
+ * to give a safe margin.
+ */
+#define FFA_MAX_SHM_PAGE_COUNT          (2 * SZ_512K / FFA_PAGE_SIZE)
+
+/*
+ * Limits the number of shared buffers that guest can have at once. This
+ * is to prevent case, when guests trick XEN into exhausting its own
+ * memory by allocating many small buffers. This value has been chosen
+ * arbitrarily.
+ */
+#define FFA_MAX_SHM_COUNT               32
+
+/* FF-A-1.1-REL0 section 10.9.2 Memory region handle, page 167 */
+#define FFA_HANDLE_HYP_FLAG             BIT(63, ULL)
+#define FFA_HANDLE_INVALID              0xffffffffffffffffULL
+
+/*
+ * Memory attributes: Normal memory, Write-Back cacheable, Inner shareable
+ * Defined in FF-A-1.1-REL0 Table 10.18 at page 175.
+ */
+#define FFA_NORMAL_MEM_REG_ATTR         0x2fU
+/*
+ * Memory access permissions: Read-write
+ * Defined in FF-A-1.1-REL0 Table 10.15 at page 168.
+ */
+#define FFA_MEM_ACC_RW                  0x2U
+
+/* FF-A-1.1-REL0 section 10.11.4 Flags usage, page 184-187 */
+/* Clear memory before mapping in receiver */
+#define FFA_MEMORY_REGION_FLAG_CLEAR            BIT(0, U)
+/* Relayer may time slice this operation */
+#define FFA_MEMORY_REGION_FLAG_TIME_SLICE       BIT(1, U)
+/* Clear memory after receiver relinquishes it */
+#define FFA_MEMORY_REGION_FLAG_CLEAR_RELINQUISH BIT(2, U)
+/* Share memory transaction */
+#define FFA_MEMORY_REGION_TRANSACTION_TYPE_SHARE (1U << 3)
+
 /*
  * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
  * BIT(31): Framework or partition message
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564192.881605 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIYE-0001fR-0v; Mon, 17 Jul 2023 07:21:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564192.881605; Mon, 17 Jul 2023 07:21:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIYD-0001WB-3A; Mon, 17 Jul 2023 07:21:45 +0000
Received: by outflank-mailman (input) for mailman id 564192;
 Mon, 17 Jul 2023 07:21:42 +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
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIY9-0005A9-NU
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:41 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 92b9e9a9-2472-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 09:21:40 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-4fd32e611e0so2989703e87.0
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:40 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 92b9e9a9-2472-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578499; x=1692170499;
        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=KZBEdfHgu5rAc17OpHgYSz2Q4Zpnm6hWeKYd8pGy/wA=;
        b=iucW60f/fAN0+6ve7OkwZFSP4Oyxoe1jGLAnZjNeH4h3EAn4gPx1KntoldD/UOWOUU
         /0KqzkJGIoTD+zZI9isB7wqPCN2eemCk820mI/J8hDae0Ck0tNXhm5TGCLysYNkFEkzj
         gE7olqlrAHjGtK0b1Q2jZLHjrCNrXWkdFzsmiUoo6OGG20Mmo3n8PYJZe72GjQebgZXM
         9kNUtF9RR8TU6+/+R/M4yet7FWe1/b/cX4iihIEg+M4jHCG0qWEneliSUJMFpD1eKWhm
         MrtiYW6lpomlgeay3er/gedhgOcelonVanztlvli3kzjTAFCyusW2qiunQmaKPoUkXQQ
         q68w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578499; x=1692170499;
        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=KZBEdfHgu5rAc17OpHgYSz2Q4Zpnm6hWeKYd8pGy/wA=;
        b=l27ImCxfZXom6JllSAjqc6puF7thdzkYbkiNW4CgBygVdFh3YxlwMmC5RSh46wG2j7
         Htm9SU8Y3PkDfbOGkNHJs8UMsghdb5/TqBD86DiHwAWruFPmMLqcFqo+3Ner9YUkI+V4
         rj10Mcb5jItnuWWOhF7Ge7O1iAz18BCyvcpLnPCgHsTKwicELBrkLlIsQ2WyJnhFyRcV
         VqXfCsCnkGVK1tESnG+DUd1KpydxD7JdkVybPD47NetcT/err9VcJfqDQrdZAo5/mbIi
         5IeLf/NwQU8puWeu9SNxt4h/BsKf0e5PyTtei0dgZhT+PO1v81uCEAAvS4fYRayAFull
         fYUQ==
X-Gm-Message-State: ABy/qLYzzLXz2kfwGyhlsT827Zw572Akymzvh4eJuNiV8aOXya7fvBr5
	brfTTetvlXRs+p4UKHguQoCBCb7tHT0+7jyU4yQ=
X-Google-Smtp-Source: APBJJlFD4qAYhSmwDwqmvpEfTfkWIvsqG73wtcb94Pi+OjPUt5L2wdqYf/Z0oL6E7tmJUHxaG5FK7A==
X-Received: by 2002:a05:6512:247:b0:4fb:7624:85a5 with SMTP id b7-20020a056512024700b004fb762485a5mr2988561lfo.0.1689578499565;
        Mon, 17 Jul 2023 00:21:39 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v10 17/24] xen/arm: ffa: add ABI structs for sharing memory
Date: Mon, 17 Jul 2023 09:21:00 +0200
Message-Id: <20230717072107.753304-18-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds the ABI structs used by function FFA_MEM_SHARE and friends for
sharing memory.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/tee/ffa.c | 69 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index e895e355e620..03699473cfc5 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -243,6 +243,75 @@ struct ffa_partition_info_1_1 {
     uint8_t uuid[16];
 };
 
+/* Constituent memory region descriptor */
+struct ffa_address_range {
+    uint64_t address;
+    uint32_t page_count;
+    uint32_t reserved;
+};
+
+/* Composite memory region descriptor */
+struct ffa_mem_region {
+    uint32_t total_page_count;
+    uint32_t address_range_count;
+    uint64_t reserved;
+    struct ffa_address_range address_range_array[];
+};
+
+/* Memory access permissions descriptor */
+struct ffa_mem_access_perm {
+    uint16_t endpoint_id;
+    uint8_t perm;
+    uint8_t flags;
+};
+
+/* Endpoint memory access descriptor */
+struct ffa_mem_access {
+    struct ffa_mem_access_perm access_perm;
+    uint32_t region_offs;
+    uint64_t reserved;
+};
+
+/* Lend, donate or share memory transaction descriptor */
+struct ffa_mem_transaction_1_0 {
+    uint16_t sender_id;
+    uint8_t mem_reg_attr;
+    uint8_t reserved0;
+    uint32_t flags;
+    uint64_t handle;
+    uint64_t tag;
+    uint32_t reserved1;
+    uint32_t mem_access_count;
+    struct ffa_mem_access mem_access_array[];
+};
+
+struct ffa_mem_transaction_1_1 {
+    uint16_t sender_id;
+    uint16_t mem_reg_attr;
+    uint32_t flags;
+    uint64_t handle;
+    uint64_t tag;
+    uint32_t mem_access_size;
+    uint32_t mem_access_count;
+    uint32_t mem_access_offs;
+    uint8_t reserved[12];
+};
+
+/* Endpoint RX/TX descriptor */
+struct ffa_endpoint_rxtx_descriptor_1_0 {
+    uint16_t sender_id;
+    uint16_t reserved;
+    uint32_t rx_range_count;
+    uint32_t tx_range_count;
+};
+
+struct ffa_endpoint_rxtx_descriptor_1_1 {
+    uint16_t sender_id;
+    uint16_t reserved;
+    uint32_t rx_region_offs;
+    uint32_t tx_region_offs;
+};
+
 struct ffa_ctx {
     void *rx;
     const void *tx;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:21:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:21:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564194.881612 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIYG-0002RD-9R; Mon, 17 Jul 2023 07:21:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564194.881612; Mon, 17 Jul 2023 07:21:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIYF-0002JR-Jf; Mon, 17 Jul 2023 07:21:47 +0000
Received: by outflank-mailman (input) for mailman id 564194;
 Mon, 17 Jul 2023 07:21:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIYA-0005A3-Rw
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:42 +0000
Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com
 [2a00:1450:4864:20::12c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 940e4892-2472-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 09:21:42 +0200 (CEST)
Received: by mail-lf1-x12c.google.com with SMTP id
 2adb3069b0e04-4fdb3f66fd6so2316152e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:42 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 940e4892-2472-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578501; x=1692170501;
        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=sWua/aGnhgeAUqYKtQ1Lf4Q/vc2pnAQzQP1lQqZFLOs=;
        b=bRjF4qKlC8vQak3a4DLbOBqDwDc1E6uXtGEPEfJ1xjeRdPixyi+QSuS8In7gooenqa
         5LM1ti6GdGiCYor3Hvgi7Vyfr6ehTbnawBDdjY80hwpzONoTF3Cdx5AACoIcMWqaL4cV
         ts1xjZXyWW/cBGhjPqcVVusxsaZFUtYG8CGyRv/68JMesrhA2tooS7Bmaaet/FxSsEVU
         r1ITlSP+YIgA69lr/c1y9F3QtKHiWnccgNzBESM90J+sFGLrKRZBMWJ46NGHOqoiLCcQ
         Bw0oJbQBKeYHDdq1+iH2PHH6BqmJ5ExHGZC5fCOh1ObEXIJ8I5p0Ex+OUHuct9qH1rBu
         3sMg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578501; x=1692170501;
        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=sWua/aGnhgeAUqYKtQ1Lf4Q/vc2pnAQzQP1lQqZFLOs=;
        b=OFqaXwSbOMIODu0ChlMMYVrd3fwP7jammi9KTCuTd5JsMFPvjgAYxQ70kdQHSSB4EG
         Ctpa6mbZ9XZR4EjhPYXyysdlNuzyfFh4Z6j1O3WiMmBwLTNEAt7IckC3yVw05TOyaPco
         NJOoLoQU/5quGtGc+U5s+61xFaWg2wfiT3z5JZrOdRjoqrJEg3+zpzAE9GNYFyCTGf5e
         kpxovXJMB9knErpeBKUl5R2D+8v3fp51LySncZG/sBhbRCnVkwvauj3xfGahYGLZ2sfn
         vR+qX0pIsKBT4XccrxbzChwScnWTciymPAO8n447pcmB9a5aTk3lm/zUtCH5ixaXKYoG
         UZ8A==
X-Gm-Message-State: ABy/qLYRol0ELno2Dm+ZtqLJuREQHZyUMbQ8/m9iIqonas+dS5y8RYw2
	26XnVR2rq3Al9ybrfeSnijryf9D0H6D7e37oUAQ=
X-Google-Smtp-Source: APBJJlFGgqFk90LEx9JDGoSMAlQiXMj+Tu7SBoByp/VnNfNwMZZkYSroesEVWBr3gChieyYidLnpBA==
X-Received: by 2002:ac2:5973:0:b0:4f8:770f:1b0b with SMTP id h19-20020ac25973000000b004f8770f1b0bmr7012547lfp.33.1689578501722;
        Mon, 17 Jul 2023 00:21:41 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v10 19/24] xen/arm: ffa: add support to reclaim shared memory
Date: Mon, 17 Jul 2023 09:21:02 +0200
Message-Id: <20230717072107.753304-20-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support to reclaim memory previously shared with FFA_MEM_SHARE.

A memory region that doesn't need to be shared any longer can be
reclaimed with FFA_MEM_RECLAIM once the SP doesn't use it any longer.
This is checked by the SPMC and not in control of the mediator.

Adds a check that the SP supports the needed FF-A feature
FFA_MEM_RECLAIM.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/tee/ffa.c | 53 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index f3eb84a8e9b7..c623c51168b9 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -538,6 +538,12 @@ static int32_t ffa_mem_share(uint32_t tot_len, uint32_t frag_len,
     }
 }
 
+static int32_t ffa_mem_reclaim(uint32_t handle_lo, uint32_t handle_hi,
+                               uint32_t flags)
+{
+    return ffa_simple_call(FFA_MEM_RECLAIM, handle_lo, handle_hi, flags, 0);
+}
+
 static int32_t ffa_direct_req_send_vm(uint16_t sp_id, uint16_t vm_id,
                                       uint8_t msg)
 {
@@ -1278,6 +1284,43 @@ out_set_ret:
             set_regs_error(regs, ret);
 }
 
+static int handle_mem_reclaim(uint64_t handle, uint32_t flags)
+{
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+    struct ffa_shm_mem *shm;
+    register_t handle_hi;
+    register_t handle_lo;
+    int ret;
+
+    spin_lock(&ctx->lock);
+    list_for_each_entry(shm, &ctx->shm_list, list)
+    {
+        if ( shm->handle == handle )
+            goto found_it;
+    }
+    shm = NULL;
+    ret = FFA_RET_INVALID_PARAMETERS;
+    goto out;
+found_it:
+
+    uint64_to_regpair(&handle_hi, &handle_lo, handle);
+    ret = ffa_mem_reclaim(handle_lo, handle_hi, flags);
+    if ( ret )
+    {
+        shm = NULL;
+        goto out;
+    }
+
+    list_del(&shm->list);
+
+out:
+    free_ffa_shm_mem(ctx, shm);
+    spin_unlock(&ctx->lock);
+
+    return ret;
+}
+
 static bool ffa_handle_call(struct cpu_user_regs *regs)
 {
     uint32_t fid = get_user_reg(regs, 0);
@@ -1339,6 +1382,15 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     case FFA_MEM_SHARE_64:
         handle_mem_share(regs);
         return true;
+    case FFA_MEM_RECLAIM:
+        e = handle_mem_reclaim(regpair_to_uint64(get_user_reg(regs, 2),
+                                                 get_user_reg(regs, 1)),
+                               get_user_reg(regs, 3));
+        if ( e )
+            set_regs_error(regs, e);
+        else
+            set_regs_success(regs, 0, 0);
+        return true;
 
     default:
         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
@@ -1573,6 +1625,7 @@ static bool ffa_probe(void)
          !check_mandatory_feature(FFA_MEM_SHARE_64) ||
          !check_mandatory_feature(FFA_RXTX_UNMAP) ||
          !check_mandatory_feature(FFA_MEM_SHARE_32) ||
+         !check_mandatory_feature(FFA_MEM_RECLAIM) ||
          !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
         return false;
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:22:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:22:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564195.881620 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIYH-0002o2-N3; Mon, 17 Jul 2023 07:21:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564195.881620; Mon, 17 Jul 2023 07:21:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIYG-0002lU-Qi; Mon, 17 Jul 2023 07:21:48 +0000
Received: by outflank-mailman (input) for mailman id 564195;
 Mon, 17 Jul 2023 07:21:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIYC-0005A3-3w
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:44 +0000
Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com
 [2a00:1450:4864:20::12a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 94b723ef-2472-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 09:21:43 +0200 (CEST)
Received: by mail-lf1-x12a.google.com with SMTP id
 2adb3069b0e04-4fb96e2b573so6547829e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:43 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 94b723ef-2472-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578503; x=1692170503;
        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=aYbk+SQ1clAFmK5go+uqkAk7DJv+x5ZhyiBn1d+JtnA=;
        b=DmUDqOeFH5C44ZGDkFM3PkqofkSwHRJMvfsbxsupdpaHZW4yS3fDZ9v5H3gjFPCPCg
         9XI9ke7tCI9TcpjRNoJQi0nd/yfnHUCJ5Ac1kYRxolN+XE4xGhmmXcWUwKuyqVvTpduk
         h6lMFMYfP6oadjzRPmozbt/hCZB45Pow6gU4817UMcGDgAe794TT9KHMby91mED1jziD
         uzhdlHI/92rX7EVSGfe2iVx9k5/FUWmN6y26G7pUlBcSBeCfWYl9MpDALbBmUB6rUseD
         mB7L6QzpblVd4xFAbnqHOk8mV6VzHOSMfuYg+DP2cJhW0qdb1jUBvKRLHEe65pp+xvEm
         DyqA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578503; x=1692170503;
        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=aYbk+SQ1clAFmK5go+uqkAk7DJv+x5ZhyiBn1d+JtnA=;
        b=Orc4PZ5OpZPbaEJUpvv7WrO8jQpZnmMQMCrEHWPnv2+kyUzzVkNIl5ATdVxOe9fzWQ
         5JNAlcJc8BPmr1bblFGAQrYjYpj5dfFtqvIcO/xaxXSd0ynrdQlHqR0sBTCJEyi2o/2J
         uazC5RtYPlMk1/7brQs5zi1qD38JJAJ61t1Pjarz0YsZfHnwGUb7OszgKjn17xEp4Kh+
         z1nqH+lZRiSvuvKeKfAqbcO23aH6mTEpFH8susrLa4cc/sn586X5mw8M74Yu9qR+6L//
         W2Xnyt0Ul+RsQ9pcQjOhAvywI22vDKkHfzKnfteXXSiZkAbMpyYl83iTHADmaCeq/7DP
         GJuQ==
X-Gm-Message-State: ABy/qLZep5nEF5oDQoLBFzA9m2cNdkM8YHgvdBRmHgKFwQJGvo+b4wVe
	rdNfSFwfj7t6WmjAw3rrvn0X8oWvdzgAGDDrrk4=
X-Google-Smtp-Source: APBJJlH1Ix6SPwWzCCwGRDwoDjYpw+Ehp1M/LkGTvIH5IapCCslJt7Avaps0XmBVGJzgrPTjRkp3Mg==
X-Received: by 2002:ac2:4e81:0:b0:4fb:89bb:bcc4 with SMTP id o1-20020ac24e81000000b004fb89bbbcc4mr6419533lfr.51.1689578502776;
        Mon, 17 Jul 2023 00:21:42 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v10 20/24] xen/arm: ffa: support sharing large memory ranges
Date: Mon, 17 Jul 2023 09:21:03 +0200
Message-Id: <20230717072107.753304-21-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support for sharing large memory ranges transmitted in fragments
using FFA_MEM_FRAG_TX.

The implementation is the bare minimum to be able to communicate with
OP-TEE running as an SPMC at S-EL1.

Adds a check that the SP supports the needed FF-A feature
FFA_MEM_FRAG_TX.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c | 253 ++++++++++++++++++++++++++++++++++++++---
 1 file changed, 240 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index c623c51168b9..ac23b9edc74c 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -359,6 +359,8 @@ struct ffa_ctx {
      */
     uint16_t create_signal_count;
     bool rx_is_free;
+    /* Currently used fragment states, struct mem_frag_state */
+    struct list_head frag_list;
     /* Used shared memory objects, struct ffa_shm_mem */
     struct list_head shm_list;
     /* Number of allocated shared memory object */
@@ -375,6 +377,18 @@ struct ffa_shm_mem {
     struct page_info *pages[];
 };
 
+struct mem_frag_state {
+    struct list_head list;
+    struct ffa_shm_mem *shm;
+    uint32_t range_count;
+    unsigned int current_page_idx;
+    unsigned int frag_offset;
+    unsigned int range_offset;
+    const uint8_t *buf;
+    unsigned int buf_size;
+    struct ffa_address_range range;
+};
+
 /* Negotiated FF-A version to use with the SPMC */
 static uint32_t __ro_after_init ffa_version;
 
@@ -538,6 +552,36 @@ static int32_t ffa_mem_share(uint32_t tot_len, uint32_t frag_len,
     }
 }
 
+static int32_t ffa_mem_frag_tx(uint64_t handle, uint32_t frag_len,
+                               uint16_t sender_id)
+{
+    struct arm_smccc_1_2_regs arg = {
+        .a0 = FFA_MEM_FRAG_TX,
+        .a1 = handle & UINT32_MAX,
+        .a2 = handle >> 32,
+        .a3 = frag_len,
+        .a4 = (uint32_t)sender_id << 16,
+    };
+    struct arm_smccc_1_2_regs resp;
+
+    arm_smccc_1_2_smc(&arg, &resp);
+
+    switch ( resp.a0 )
+    {
+    case FFA_ERROR:
+        if ( resp.a2 )
+            return resp.a2;
+        else
+            return FFA_RET_NOT_SUPPORTED;
+    case FFA_SUCCESS_32:
+        return FFA_RET_OK;
+    case FFA_MEM_FRAG_RX:
+        return resp.a3;
+    default:
+            return FFA_RET_NOT_SUPPORTED;
+    }
+}
+
 static int32_t ffa_mem_reclaim(uint32_t handle_lo, uint32_t handle_hi,
                                uint32_t flags)
 {
@@ -627,6 +671,14 @@ static void set_regs_success(struct cpu_user_regs *regs, uint32_t w2,
     set_regs(regs, FFA_SUCCESS_32, 0, w2, w3, 0, 0, 0, 0);
 }
 
+static void set_regs_frag_rx(struct cpu_user_regs *regs, uint32_t handle_lo,
+                             uint32_t handle_hi, uint32_t frag_offset,
+                             uint16_t sender_id)
+{
+    set_regs(regs, FFA_MEM_FRAG_RX, handle_lo, handle_hi, frag_offset,
+             (uint32_t)sender_id << 16, 0, 0, 0);
+}
+
 static void handle_version(struct cpu_user_regs *regs)
 {
     struct domain *d = current->domain;
@@ -999,6 +1051,8 @@ static int share_shm(struct ffa_shm_mem *shm)
     paddr_t last_pa;
     unsigned int n;
     paddr_t pa;
+    bool first;
+    int ret;
 
     ASSERT(spin_is_locked(&ffa_tx_buffer_lock));
     ASSERT(shm->page_count);
@@ -1034,13 +1088,23 @@ static int share_shm(struct ffa_shm_mem *shm)
 
     tot_len = ADDR_RANGE_OFFSET(descr->mem_access_count, region_count,
                                 region_descr->address_range_count);
-    if ( tot_len > max_frag_len )
-        return FFA_RET_NOT_SUPPORTED;
 
+    /*
+     * Sharing memory with secure world may have to be done with multiple
+     * calls depending on how many address ranges will be needed. If we're
+     * sharing physically contiguous memory we will only need one range but
+     * we will also need to deal with the worst case where all physical
+     * pages are non-contiguous. For the first batch of address ranges we
+     * call ffa_mem_share() and for all that follows ffa_mem_frag_tx().
+     *
+     * We use frag_len to keep track of how far into the transmit buffer we
+     * have gone.
+     */
     addr_range = region_descr->address_range_array;
     frag_len = ADDR_RANGE_OFFSET(descr->mem_access_count, region_count, 1);
     last_pa = page_to_maddr(shm->pages[0]);
     init_range(addr_range, last_pa);
+    first = true;
     for ( n = 1; n < shm->page_count; last_pa = pa, n++ )
     {
         pa = page_to_maddr(shm->pages[n]);
@@ -1050,12 +1114,34 @@ static int share_shm(struct ffa_shm_mem *shm)
             continue;
         }
 
-        frag_len += sizeof(*addr_range);
-        addr_range++;
+        if ( frag_len == max_frag_len )
+        {
+            if ( first )
+            {
+                ret = ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
+                first = false;
+            }
+            else
+            {
+                ret = ffa_mem_frag_tx(shm->handle, frag_len, shm->sender_id);
+            }
+            if ( ret <= 0 )
+                return ret;
+            frag_len = sizeof(*addr_range);
+            addr_range = buf;
+        }
+        else
+        {
+            frag_len += sizeof(*addr_range);
+            addr_range++;
+        }
         init_range(addr_range, pa);
     }
 
-    return ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
+    if ( first )
+        return ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
+    else
+        return ffa_mem_frag_tx(shm->handle, frag_len, shm->sender_id);
 }
 
 static int read_mem_transaction(uint32_t ffa_vers, const void *buf, size_t blen,
@@ -1132,8 +1218,53 @@ static int read_mem_transaction(uint32_t ffa_vers, const void *buf, size_t blen,
     return 0;
 }
 
+static int add_mem_share_frag(struct mem_frag_state *s, unsigned int offs,
+                              unsigned int frag_len)
+{
+    struct domain *d = current->domain;
+    unsigned int o = offs;
+    unsigned int l;
+    int ret;
+
+    if ( frag_len < o )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    /* Fill up the first struct ffa_address_range */
+    l = min_t(unsigned int, frag_len - o, sizeof(s->range) - s->range_offset);
+    memcpy((uint8_t *)&s->range + s->range_offset, s->buf + o, l);
+    s->range_offset += l;
+    o += l;
+    if ( s->range_offset != sizeof(s->range) )
+        goto out;
+    s->range_offset = 0;
+
+    while ( true )
+    {
+        ret = get_shm_pages(d, s->shm, &s->range, 1, s->current_page_idx,
+                            &s->current_page_idx);
+        if ( ret )
+            return ret;
+        if ( s->range_count == 1 )
+            return 0;
+        s->range_count--;
+        if ( frag_len - o < sizeof(s->range) )
+            break;
+        memcpy(&s->range, s->buf + o, sizeof(s->range));
+        o += sizeof(s->range);
+    }
+
+    /* Collect any remaining bytes for the next struct ffa_address_range */
+    s->range_offset = frag_len - o;
+    memcpy(&s->range, s->buf + o, frag_len - o);
+out:
+    s->frag_offset += frag_len;
+
+    return s->frag_offset;
+}
+
 static void handle_mem_share(struct cpu_user_regs *regs)
 {
+    static uint64_t next_handle = FFA_HANDLE_HYP_FLAG;
     uint32_t tot_len = get_user_reg(regs, 1);
     uint32_t frag_len = get_user_reg(regs, 2);
     uint64_t addr = get_user_reg(regs, 3);
@@ -1168,13 +1299,6 @@ static void handle_mem_share(struct cpu_user_regs *regs)
         goto out_set_ret;
     }
 
-    /* We currently only support a single fragment */
-    if ( frag_len != tot_len )
-    {
-        ret = FFA_RET_NOT_SUPPORTED;
-        goto out_set_ret;
-    }
-
     spin_lock(&ctx->lock);
 
     if ( frag_len > ctx->page_count * FFA_PAGE_SIZE )
@@ -1240,6 +1364,36 @@ static void handle_mem_share(struct cpu_user_regs *regs)
     shm->sender_id = trans.sender_id;
     shm->ep_id = read_atomic(&mem_access->access_perm.endpoint_id);
 
+    if ( frag_len != tot_len )
+    {
+        struct mem_frag_state *s = xzalloc(struct mem_frag_state);
+
+        if ( !s )
+        {
+            ret = FFA_RET_NO_MEMORY;
+            goto out;
+        }
+        s->shm = shm;
+        s->range_count = range_count;
+        s->buf = ctx->tx;
+        s->buf_size = FFA_RXTX_PAGE_COUNT * FFA_PAGE_SIZE;
+        ret = add_mem_share_frag(s, sizeof(*region_descr)  + region_offs,
+                                 frag_len);
+        if ( ret <= 0 )
+        {
+            xfree(s);
+            if ( ret < 0 )
+                goto out;
+        }
+        else
+        {
+            shm->handle = next_handle++;
+            uint64_to_regpair(&handle_hi, &handle_lo, shm->handle);
+            list_add_tail(&s->list, &ctx->frag_list);
+        }
+        goto out_unlock;
+    }
+
     /*
      * Check that the Composite memory region descriptor fits.
      */
@@ -1278,7 +1432,75 @@ out_unlock:
     spin_unlock(&ctx->lock);
 
 out_set_ret:
-    if ( ret == 0)
+    if ( ret > 0 )
+            set_regs_frag_rx(regs, handle_lo, handle_hi, ret, trans.sender_id);
+    else if ( ret == 0)
+            set_regs_success(regs, handle_lo, handle_hi);
+    else
+            set_regs_error(regs, ret);
+}
+
+static struct mem_frag_state *find_frag_state(struct ffa_ctx *ctx,
+                                              uint64_t handle)
+{
+    struct mem_frag_state *s;
+
+    list_for_each_entry(s, &ctx->frag_list, list)
+        if ( s->shm->handle == handle )
+            return s;
+
+    return NULL;
+}
+
+static void handle_mem_frag_tx(struct cpu_user_regs *regs)
+{
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+    uint32_t frag_len = get_user_reg(regs, 3);
+    uint32_t handle_lo = get_user_reg(regs, 1);
+    uint32_t handle_hi = get_user_reg(regs, 2);
+    uint64_t handle = regpair_to_uint64(handle_hi, handle_lo);
+    struct mem_frag_state *s;
+    uint16_t sender_id = 0;
+    int ret;
+
+    spin_lock(&ctx->lock);
+    s = find_frag_state(ctx, handle);
+    if ( !s )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out;
+    }
+    sender_id = s->shm->sender_id;
+
+    if ( frag_len > s->buf_size )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out_free_s;
+    }
+
+    ret = add_mem_share_frag(s, 0, frag_len);
+    if ( ret < 0 )
+        goto out_free_s;
+
+    /* Note that share_shm() uses our tx buffer */
+    spin_lock(&ffa_tx_buffer_lock);
+    ret = share_shm(s->shm);
+    spin_unlock(&ffa_tx_buffer_lock);
+    if ( ret < 0 )
+        goto out_free_s;
+    list_add_tail(&s->shm->list, &ctx->shm_list);
+out_free_s:
+    if ( ret < 0 )
+        free_ffa_shm_mem(ctx, s->shm);
+    list_del(&s->list);
+    xfree(s);
+out:
+    spin_unlock(&ctx->lock);
+
+    if ( ret > 0 )
+            set_regs_frag_rx(regs, handle_lo, handle_hi, ret, sender_id);
+    else if ( ret == 0)
             set_regs_success(regs, handle_lo, handle_hi);
     else
             set_regs_error(regs, ret);
@@ -1391,6 +1613,9 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
         else
             set_regs_success(regs, 0, 0);
         return true;
+    case FFA_MEM_FRAG_TX:
+        handle_mem_frag_tx(regs);
+        return true;
 
     default:
         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
@@ -1432,6 +1657,7 @@ static int ffa_domain_init(struct domain *d)
     }
     ctx->create_signal_count = n;
 
+    INIT_LIST_HEAD(&ctx->frag_list);
     INIT_LIST_HEAD(&ctx->shm_list);
 
     return 0;
@@ -1625,6 +1851,7 @@ static bool ffa_probe(void)
          !check_mandatory_feature(FFA_MEM_SHARE_64) ||
          !check_mandatory_feature(FFA_RXTX_UNMAP) ||
          !check_mandatory_feature(FFA_MEM_SHARE_32) ||
+         !check_mandatory_feature(FFA_MEM_FRAG_TX) ||
          !check_mandatory_feature(FFA_MEM_RECLAIM) ||
          !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
         return false;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:27:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:27:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564223.881648 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIde-00085n-97; Mon, 17 Jul 2023 07:27:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564223.881648; Mon, 17 Jul 2023 07:27:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIde-00085A-4E; Mon, 17 Jul 2023 07:27:22 +0000
Received: by outflank-mailman (input) for mailman id 564223;
 Mon, 17 Jul 2023 07:27:20 +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
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIYH-0005A9-1Z
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:49 +0000
Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com
 [2a00:1450:4864:20::133])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9694654b-2472-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 09:21:46 +0200 (CEST)
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-4fa16c6a85cso6408915e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:46 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9694654b-2472-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578506; x=1692170506;
        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=7qJzaSd0HvmBntjUGVzcYap0wvkw2yCzYdORcW1H2Eg=;
        b=bBv/vmUt5SNAWbNmektXXpQU68OgYJMFj9Lheo0Cv+SgScp36E7O4c0upQrmA0z3rm
         wFsCZ57FCQgA0vPdclX1rRZJvVCRu9miuA3mIT4FrJ1m/FQTWxifrrDAsGFZG6eUcqdr
         ZaXS0CCnU8eOZhwtIoDnVjozFblA5x0YsnGEG0Gykv4jAqvx8RWXIaX8wI14ag6lnxxh
         iXuO4/06s+I3F8UnnWxWzp62qvH//VTBBslojTtjIckZWhkxJal3ZzGl2xvX9I/HeeDK
         CqiQ89TKB3tYF1WIbhpTcoVHgnOzWO6lkB/SJplWftOakVU7245HLhsUSuPf8G/EDFme
         qPtQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578506; x=1692170506;
        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=7qJzaSd0HvmBntjUGVzcYap0wvkw2yCzYdORcW1H2Eg=;
        b=i/aCpzojBGxJrxqqkDDO2mVfLgh/2M6XPur5fDc9894EIeSDsuZ33n+Rs3W6CqbEwo
         885Nwk1KHMX6iUFQbsYq0e+g9nm6MQZHrU6NqWZzef84UYRWzlJmjJfy4I8VSRkh+Yrx
         j5BIIycC6sI87dOUWhJqaKv+vOoNCyh1U0WvCBN7ucA3dfPY0hkYFmn59/I84Nl7uBVQ
         6iScbNTFrGVICtJEYJFHtPYog0Ajy1CU3c2G6dc+zt/7cU/57OTA6CBNBKudgi2rBKhU
         Y5fnI78uIGRGUodYzSNkLGSNUm9cSUDfB3mSiD79sdoI7rXh4cW0wPzy1x5pPrM2DKsE
         qe+A==
X-Gm-Message-State: ABy/qLZwc8AmD9hQ3RN+GRvLYNr54m9mj0LG84fWjmyWetSSA3OtTI3t
	KTe2MVRl6fKwyT+lgiuRqVBKtr3aJnd7p2zU5So=
X-Google-Smtp-Source: APBJJlGEm67PfXIWh5OJLABNeapeV4BEyEPcBP/UnOrbUV7hZV+9sFHqBlvBiUkXZdSu8Jpm7rjLuA==
X-Received: by 2002:a05:6512:3d22:b0:4f8:752f:df48 with SMTP id d34-20020a0565123d2200b004f8752fdf48mr8572366lfv.29.1689578505960;
        Mon, 17 Jul 2023 00:21:45 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v10 23/24] tools: add Arm FF-A mediator
Date: Mon, 17 Jul 2023 09:21:06 +0200
Message-Id: <20230717072107.753304-24-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds a new "ffa" value to the Enumeration "tee_type" to indicate if a
guest is trusted to use FF-A.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 tools/include/libxl.h            | 5 +++++
 tools/libs/light/libxl_arm.c     | 3 +++
 tools/libs/light/libxl_types.idl | 3 ++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/tools/include/libxl.h b/tools/include/libxl.h
index cac641a7eba2..bf1a49e5d687 100644
--- a/tools/include/libxl.h
+++ b/tools/include/libxl.h
@@ -283,6 +283,11 @@
  */
 #define LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE 1
 
+/*
+ * arch_arm.tee field in libxl_domain_build_info has ffa value.
+ */
+#define LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE_FFA 1
+
 /*
  * libxl_domain_build_info has the arch_arm.sve_vl field.
  */
diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
index 35f76dfc21e4..e155c68989aa 100644
--- a/tools/libs/light/libxl_arm.c
+++ b/tools/libs/light/libxl_arm.c
@@ -207,6 +207,9 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
     case LIBXL_TEE_TYPE_OPTEE:
         config->arch.tee_type = XEN_DOMCTL_CONFIG_TEE_OPTEE;
         break;
+    case LIBXL_TEE_TYPE_FFA:
+        config->arch.tee_type = XEN_DOMCTL_CONFIG_TEE_FFA;
+        break;
     default:
         LOG(ERROR, "Unknown TEE type %d",
             d_config->b_info.tee);
diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
index 9e48bb772646..65600e17429e 100644
--- a/tools/libs/light/libxl_types.idl
+++ b/tools/libs/light/libxl_types.idl
@@ -520,7 +520,8 @@ libxl_gic_version = Enumeration("gic_version", [
 
 libxl_tee_type = Enumeration("tee_type", [
     (0, "none"),
-    (1, "optee")
+    (1, "optee"),
+    (2, "ffa"),
     ], init_val = "LIBXL_TEE_TYPE_NONE")
 
 libxl_sve_type = Enumeration("sve_type", [
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:27:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:27:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564226.881655 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIde-0008GR-Rl; Mon, 17 Jul 2023 07:27:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564226.881655; Mon, 17 Jul 2023 07:27:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIde-0008Ej-Kp; Mon, 17 Jul 2023 07:27:22 +0000
Received: by outflank-mailman (input) for mailman id 564226;
 Mon, 17 Jul 2023 07:27:21 +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
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIYI-0005A9-1f
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:50 +0000
Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com
 [2a00:1450:4864:20::133])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 97329b86-2472-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 09:21:47 +0200 (CEST)
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-4fb7dc16ff0so6409522e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:47 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:46 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 97329b86-2472-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578507; x=1692170507;
        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=6R/D9gUszluJweN/TK1ixSj9VXkkPD7CMOFZ9iBZSkU=;
        b=jmZfVrIj+QUZCLiyE2qEXlSL28t1qMkLYpwIIaLz9UR7yy7hLGhHjgvVHhMQPPD9JL
         1AzAVR1DsldqPnYz5wrf6gfx4w5qmCLR26ACRBciMqRuovXXbLtiTTAhQw36Q0KNrPvQ
         ljunJnwWm7wWA6VzTzOtXm6iRPB5kZ5suueizfFNROrx8TbrJ9a/T61O+jypQeC13fPp
         4jEB5Qwr3z5/gFu03xieUb5JFYJMwAySq13tNHwU5Y8pg4JlJNSza0JbdLxSAiRjPJ6b
         OjfV/UKeh4kqE8LhzJcxUv2V/+nuEp5zMLC3yU+rF8fNfZfpNBuYXWnvldxtybmZs4o/
         DyQw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578507; x=1692170507;
        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=6R/D9gUszluJweN/TK1ixSj9VXkkPD7CMOFZ9iBZSkU=;
        b=eqvbaqqXjoVAh88FXj3ANBCqeRpJei9MEoLI3w/QC+umASwqBDavqGXr0gXLOLqNdD
         goq+xrPGwuiHQbz6NQfwhcj0JvQ5XskYzZTVJQOzB34efR6U78iZ7mu989JgKPQRHpzS
         FxMg/Ha9yiIdkHcAbMvldudrh1gz1dCcblaKvVPjnySBvSSWLTclPnj9Wmh1NHCKHJ/J
         EOlGlApD2utA0f6wvEdJl9RioPaopUNbeuYLolSkaKuKCK6o7XFIoVeSOmAS3elTMEaA
         iVYOebe/RzUq3D/wkxXKg2+GKv6dpKPTTslNRyLZgOpLk8dGImsLlw5EJoVrmzTMcPV3
         gMpQ==
X-Gm-Message-State: ABy/qLYf4eydZlUmq8SGtrZoXKh/iiBsVLgNQ4FjuwgvrDWSqd6cQCOS
	q45FzYZtD3+n/kinh+02KA3cUZfP7uv0zhhiPxQ=
X-Google-Smtp-Source: APBJJlFwaNpoPdQHYMdYEXeH8JXmjKyc6tgoT5FTuM4Y0j/Vr6j4jRRXBICYOe6jLqSDUVHSs94oDQ==
X-Received: by 2002:a19:a412:0:b0:4fb:cabd:2a66 with SMTP id q18-20020a19a412000000b004fbcabd2a66mr6762060lfc.21.1689578507058;
        Mon, 17 Jul 2023 00:21:47 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v10 24/24] docs: add Arm FF-A mediator
Date: Mon, 17 Jul 2023 09:21:07 +0200
Message-Id: <20230717072107.753304-25-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Describes a FF-A version 1.1 [1] mediator to communicate with a Secure
Partition in secure world.

[1] https://developer.arm.com/documentation/den0077/latest
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 SUPPORT.md               |  9 +++++++++
 docs/man/xl.cfg.5.pod.in | 15 +++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/SUPPORT.md b/SUPPORT.md
index 35a6249e03b2..fe512762cee7 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -840,6 +840,15 @@ that covers the DMA of the device to be passed through.
 
 No support for QEMU backends in a 16K or 64K domain.
 
+### ARM: Firmware Framework for Arm A-profile (FF-A) Mediator
+
+    Status, Arm64: Tech Preview
+
+There are still some code paths where a vCPU may hog a pCPU longer than
+necessary. The FF-A mediator is not yet implemented for Arm32. Part of the
+FF-A specification is not supported, see the top comment in
+xen/arch/arm/tee/ffa.c for limitations.
+
 ### ARM: Guest Device Tree support
 
     Status: Supported
diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index 3979be2a590a..911c3619ce32 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -1648,6 +1648,21 @@ in OP-TEE.
 
 This feature is a B<technology preview>.
 
+=item B<ffa>
+
+B<Arm only.> Allow a guest to communicate via FF-A with Secure Partitions
+(SP), default false.
+
+Currently only a small subset of the FF-A specification is supported. Just
+enough to communicate with OP-TEE. In general only direct messaging and
+sharing memory with one SP. More advanced use cases where memory might be
+shared or donated to multiple SPs are not supported.
+
+See L<https://developer.arm.com/documentation/den0077/latest> for more
+information about FF-A.
+
+This feature is a B<technology preview>.
+
 =back
 
 =back
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:27:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:27:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564221.881644 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIdd-00083K-VN; Mon, 17 Jul 2023 07:27:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564221.881644; Mon, 17 Jul 2023 07:27:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIdd-00083A-S6; Mon, 17 Jul 2023 07:27:21 +0000
Received: by outflank-mailman (input) for mailman id 564221;
 Mon, 17 Jul 2023 07:27:20 +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
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIYB-0005A9-GJ
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:43 +0000
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com
 [2a00:1450:4864:20::132])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9376ae2f-2472-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 09:21:41 +0200 (CEST)
Received: by mail-lf1-x132.google.com with SMTP id
 2adb3069b0e04-4fb7769f15aso6527096e87.0
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:41 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9376ae2f-2472-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578500; x=1692170500;
        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=EfUxs6oNXk54MzNkpT+pqgSAZUf1sqgLTIg8nTp7P0A=;
        b=vI+InvarKuJ6bBreRRE1yfiD0xIZEpdqnnHr2f79eKEZEPEP2HG5utxhkkx4metMRv
         QwDPFuVDtajzLu1Hn5cr6uGyZ5+3BeiuhYv2R+LWdw42icq0HBZfA0DhnUVa5VMSf9Wu
         fHzxmnxfp2Q5tlpbV8Yy1so8s2rqqT5G9gheQgTcoSyRxV2ZY+4Go9e4MPCHoM0eBINq
         Fc3w8/gVUDGpPNUfu0hbviC2lI70HcuyUfM35IdrRlyF8SxQ2XYDiVAHa7Cpa1WlK7Ba
         hQ321n8jq/GVuCRRYsIpqykgBeXwHN41uwtQbaJyV08IfDpRHyHf3OnZRah+PdwHJtVf
         18kw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578500; x=1692170500;
        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=EfUxs6oNXk54MzNkpT+pqgSAZUf1sqgLTIg8nTp7P0A=;
        b=X6loH3A/+k3mw3CD4WW0l9H1uhX30DDlk8lZDJhvcO7rdYsOwXaxx5LdvGF6WtVtEp
         XlbeaeFPwEpI6IL0cs10fqAyWDe2VAax+mQPN+DoGn/OgGu8qeb19N89wDLNX1C7wBaE
         T2ENJKpRRURIdU3tIN3rLGtVGR3+TBNsL9EU196zSgJrRvByeO6mVaJXRlipwQHUv00O
         LU2+zlyjnWwV7+8s2Nqau8VdeKikKrKILRWKblY6KTvkQaXaOgZ8WCuppfoxz0x3myFp
         Xy+AF7Imvl8P2ieg4OsslRNvJMqgcntmT1WvOirepBDGwHclgnlX/4Wu837LIoGAv6Q4
         TyVQ==
X-Gm-Message-State: ABy/qLZRhnntFrariIWEymQmwYP1N73OnhymE7TYnkIqw15tNLEEmk8Y
	tuSYk2zeikA/FUHU5c5Qa6ZkmLSSAzu2ZidH7dM=
X-Google-Smtp-Source: APBJJlHUwmFiqO+zUdrTusJHxua2xQoY7VG2jevE5sZqEDEvGynk+FWDtX+PEE5yD0RfiTPE8JosPg==
X-Received: by 2002:a05:6512:e89:b0:4fb:9fa7:dcda with SMTP id bi9-20020a0565120e8900b004fb9fa7dcdamr8946349lfb.26.1689578500648;
        Mon, 17 Jul 2023 00:21:40 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v10 18/24] xen/arm: ffa: support sharing memory
Date: Mon, 17 Jul 2023 09:21:01 +0200
Message-Id: <20230717072107.753304-19-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support for a guest to share memory with an SP using FFA_MEM_SHARE.
Only memory regions small enough to be shared with a single call to
FFA_MEM_SHARE are supported.

With this commit we have a FF-A version 1.1 [1] mediator able to
communicate with a Secure Partition in secure world using shared memory.
The secure world must use FF-A version 1.1, but the guest is free to use
version 1.0 or version 1.1.

Adds a check that the SP supports the needed FF-A features
FFA_MEM_SHARE_64 or FFA_MEM_SHARE_32.

[1] https://developer.arm.com/documentation/den0077/latest
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c | 486 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 486 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 03699473cfc5..f3eb84a8e9b7 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -297,6 +297,38 @@ struct ffa_mem_transaction_1_1 {
     uint8_t reserved[12];
 };
 
+/* Calculate offset of struct ffa_mem_access from start of buffer */
+#define MEM_ACCESS_OFFSET(access_idx) \
+    ( sizeof(struct ffa_mem_transaction_1_1) + \
+      ( access_idx ) * sizeof(struct ffa_mem_access) )
+
+/* Calculate offset of struct ffa_mem_region from start of buffer */
+#define REGION_OFFSET(access_count, region_idx) \
+    ( MEM_ACCESS_OFFSET(access_count) + \
+      ( region_idx ) * sizeof(struct ffa_mem_region) )
+
+/* Calculate offset of struct ffa_address_range from start of buffer */
+#define ADDR_RANGE_OFFSET(access_count, region_count, range_idx) \
+    ( REGION_OFFSET(access_count, region_count) + \
+      ( range_idx ) * sizeof(struct ffa_address_range) )
+
+/*
+ * The parts needed from struct ffa_mem_transaction_1_0 or struct
+ * ffa_mem_transaction_1_1, used to provide an abstraction of difference in
+ * data structures between version 1.0 and 1.1. This is just an internal
+ * interface and can be changed without changing any ABI.
+ */
+struct ffa_mem_transaction_int {
+    uint16_t sender_id;
+    uint8_t mem_reg_attr;
+    uint8_t flags;
+    uint8_t mem_access_size;
+    uint8_t mem_access_count;
+    uint16_t mem_access_offs;
+    uint64_t handle;
+    uint64_t tag;
+};
+
 /* Endpoint RX/TX descriptor */
 struct ffa_endpoint_rxtx_descriptor_1_0 {
     uint16_t sender_id;
@@ -327,9 +359,22 @@ struct ffa_ctx {
      */
     uint16_t create_signal_count;
     bool rx_is_free;
+    /* Used shared memory objects, struct ffa_shm_mem */
+    struct list_head shm_list;
+    /* Number of allocated shared memory object */
+    unsigned int shm_count;
     spinlock_t lock;
 };
 
+struct ffa_shm_mem {
+    struct list_head list;
+    uint16_t sender_id;
+    uint16_t ep_id;     /* endpoint, the one lending */
+    uint64_t handle;    /* FFA_HANDLE_INVALID if not set yet */
+    unsigned int page_count;
+    struct page_info *pages[];
+};
+
 /* Negotiated FF-A version to use with the SPMC */
 static uint32_t __ro_after_init ffa_version;
 
@@ -351,6 +396,7 @@ static uint16_t subscr_vm_destroyed_count __read_mostly;
 static void *ffa_rx __read_mostly;
 static void *ffa_tx __read_mostly;
 static DEFINE_SPINLOCK(ffa_rx_buffer_lock);
+static DEFINE_SPINLOCK(ffa_tx_buffer_lock);
 
 static bool ffa_get_version(uint32_t *vers)
 {
@@ -457,6 +503,41 @@ static int32_t ffa_rx_release(void)
     return ffa_simple_call(FFA_RX_RELEASE, 0, 0, 0, 0);
 }
 
+static int32_t ffa_mem_share(uint32_t tot_len, uint32_t frag_len,
+                             register_t addr, uint32_t pg_count,
+                             uint64_t *handle)
+{
+    struct arm_smccc_1_2_regs arg = {
+        .a0 = FFA_MEM_SHARE_64,
+        .a1 = tot_len,
+        .a2 = frag_len,
+        .a3 = addr,
+        .a4 = pg_count,
+    };
+    struct arm_smccc_1_2_regs resp;
+
+    arm_smccc_1_2_smc(&arg, &resp);
+
+    switch ( resp.a0 )
+    {
+    case FFA_ERROR:
+        if ( resp.a2 )
+            return resp.a2;
+        else
+            return FFA_RET_NOT_SUPPORTED;
+    case FFA_SUCCESS_32:
+        *handle = regpair_to_uint64(resp.a3, resp.a2);
+        return FFA_RET_OK;
+    case FFA_MEM_FRAG_RX:
+        *handle = regpair_to_uint64(resp.a2, resp.a1);
+        if ( resp.a3 > INT32_MAX ) /* Impossible value */
+            return FFA_RET_ABORTED;
+        return resp.a3 & INT32_MAX;
+    default:
+        return FFA_RET_NOT_SUPPORTED;
+    }
+}
+
 static int32_t ffa_direct_req_send_vm(uint16_t sp_id, uint16_t vm_id,
                                       uint8_t msg)
 {
@@ -800,6 +881,403 @@ out:
              resp.a4 & mask, resp.a5 & mask, resp.a6 & mask, resp.a7 & mask);
 }
 
+/*
+ * Gets all page and assigns them to the supplied shared memory object. If
+ * this function fails then the caller is still expected to call
+ * put_shm_pages() as a cleanup.
+ */
+static int get_shm_pages(struct domain *d, struct ffa_shm_mem *shm,
+                         const struct ffa_address_range *range,
+                         uint32_t range_count, unsigned int start_page_idx,
+                         unsigned int *last_page_idx)
+{
+    unsigned int pg_idx = start_page_idx;
+    gfn_t gfn;
+    unsigned int n;
+    unsigned int m;
+    p2m_type_t t;
+    uint64_t addr;
+    uint64_t page_count;
+
+    for ( n = 0; n < range_count; n++ )
+    {
+        page_count = read_atomic(&range[n].page_count);
+        addr = read_atomic(&range[n].address);
+        for ( m = 0; m < page_count; m++ )
+        {
+            if ( pg_idx >= shm->page_count )
+                return FFA_RET_INVALID_PARAMETERS;
+
+            gfn = gaddr_to_gfn(addr + m * FFA_PAGE_SIZE);
+            shm->pages[pg_idx] = get_page_from_gfn(d, gfn_x(gfn), &t,
+						   P2M_ALLOC);
+            if ( !shm->pages[pg_idx] )
+                return FFA_RET_DENIED;
+            /* Only normal RW RAM for now */
+            if ( t != p2m_ram_rw )
+                return FFA_RET_DENIED;
+            pg_idx++;
+        }
+    }
+
+    *last_page_idx = pg_idx;
+
+    return FFA_RET_OK;
+}
+
+static void put_shm_pages(struct ffa_shm_mem *shm)
+{
+    unsigned int n;
+
+    for ( n = 0; n < shm->page_count && shm->pages[n]; n++ )
+    {
+        put_page(shm->pages[n]);
+        shm->pages[n] = NULL;
+    }
+}
+
+static struct ffa_shm_mem *alloc_ffa_shm_mem(struct ffa_ctx *ctx,
+                                             unsigned int page_count)
+{
+    struct ffa_shm_mem *shm;
+
+    if ( page_count >= FFA_MAX_SHM_PAGE_COUNT ||
+         ctx->shm_count >= FFA_MAX_SHM_COUNT )
+        return NULL;
+
+    shm = xzalloc_flex_struct(struct ffa_shm_mem, pages, page_count);
+    if ( shm )
+    {
+        ctx->shm_count++;
+        shm->page_count = page_count;
+    }
+
+    return shm;
+}
+
+static void free_ffa_shm_mem(struct ffa_ctx *ctx, struct ffa_shm_mem *shm)
+{
+    if ( !shm )
+        return;
+
+    ASSERT(ctx->shm_count > 0);
+    ctx->shm_count--;
+    put_shm_pages(shm);
+    xfree(shm);
+}
+
+static void init_range(struct ffa_address_range *addr_range,
+                       paddr_t pa)
+{
+    memset(addr_range, 0, sizeof(*addr_range));
+    addr_range->address = pa;
+    addr_range->page_count = 1;
+}
+
+/*
+ * This function uses the ffa_tx buffer to transmit the memory transaction
+ * descriptor. The function depends ffa_tx_buffer_lock to be used to guard
+ * the buffer from concurrent use.
+ */
+static int share_shm(struct ffa_shm_mem *shm)
+{
+    const uint32_t max_frag_len = FFA_RXTX_PAGE_COUNT * FFA_PAGE_SIZE;
+    struct ffa_mem_access *mem_access_array;
+    struct ffa_mem_transaction_1_1 *descr;
+    struct ffa_address_range *addr_range;
+    struct ffa_mem_region *region_descr;
+    const unsigned int region_count = 1;
+    void *buf = ffa_tx;
+    uint32_t frag_len;
+    uint32_t tot_len;
+    paddr_t last_pa;
+    unsigned int n;
+    paddr_t pa;
+
+    ASSERT(spin_is_locked(&ffa_tx_buffer_lock));
+    ASSERT(shm->page_count);
+
+    descr = buf;
+    memset(descr, 0, sizeof(*descr));
+    descr->sender_id = shm->sender_id;
+    descr->handle = shm->handle;
+    descr->mem_reg_attr = FFA_NORMAL_MEM_REG_ATTR;
+    descr->mem_access_count = 1;
+    descr->mem_access_size = sizeof(*mem_access_array);
+    descr->mem_access_offs = MEM_ACCESS_OFFSET(0);
+
+    mem_access_array = buf + descr->mem_access_offs;
+    memset(mem_access_array, 0, sizeof(*mem_access_array));
+    mem_access_array[0].access_perm.endpoint_id = shm->ep_id;
+    mem_access_array[0].access_perm.perm = FFA_MEM_ACC_RW;
+    mem_access_array[0].region_offs = REGION_OFFSET(descr->mem_access_count, 0);
+
+    region_descr = buf + mem_access_array[0].region_offs;
+    memset(region_descr, 0, sizeof(*region_descr));
+    region_descr->total_page_count = shm->page_count;
+
+    region_descr->address_range_count = 1;
+    last_pa = page_to_maddr(shm->pages[0]);
+    for ( n = 1; n < shm->page_count; last_pa = pa, n++ )
+    {
+        pa = page_to_maddr(shm->pages[n]);
+        if ( last_pa + FFA_PAGE_SIZE == pa )
+            continue;
+        region_descr->address_range_count++;
+    }
+
+    tot_len = ADDR_RANGE_OFFSET(descr->mem_access_count, region_count,
+                                region_descr->address_range_count);
+    if ( tot_len > max_frag_len )
+        return FFA_RET_NOT_SUPPORTED;
+
+    addr_range = region_descr->address_range_array;
+    frag_len = ADDR_RANGE_OFFSET(descr->mem_access_count, region_count, 1);
+    last_pa = page_to_maddr(shm->pages[0]);
+    init_range(addr_range, last_pa);
+    for ( n = 1; n < shm->page_count; last_pa = pa, n++ )
+    {
+        pa = page_to_maddr(shm->pages[n]);
+        if ( last_pa + FFA_PAGE_SIZE == pa )
+        {
+            addr_range->page_count++;
+            continue;
+        }
+
+        frag_len += sizeof(*addr_range);
+        addr_range++;
+        init_range(addr_range, pa);
+    }
+
+    return ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
+}
+
+static int read_mem_transaction(uint32_t ffa_vers, const void *buf, size_t blen,
+                                struct ffa_mem_transaction_int *trans)
+{
+    uint16_t mem_reg_attr;
+    uint32_t flags;
+    uint32_t count;
+    uint32_t offs;
+    uint32_t size;
+
+    if ( ffa_vers >= FFA_VERSION_1_1 )
+    {
+        const struct ffa_mem_transaction_1_1 *descr;
+
+        if ( blen < sizeof(*descr) )
+            return FFA_RET_INVALID_PARAMETERS;
+
+        descr = buf;
+        trans->sender_id = descr->sender_id;
+        mem_reg_attr = descr->mem_reg_attr;
+        flags = descr->flags;
+        trans->handle = descr->handle;
+        trans->tag = descr->tag;
+
+        count = descr->mem_access_count;
+        size = descr->mem_access_size;
+        offs = descr->mem_access_offs;
+    }
+    else
+    {
+        const struct ffa_mem_transaction_1_0 *descr;
+
+        if ( blen < sizeof(*descr) )
+            return FFA_RET_INVALID_PARAMETERS;
+
+        descr = buf;
+        trans->sender_id = descr->sender_id;
+        mem_reg_attr = descr->mem_reg_attr;
+        flags = descr->flags;
+        trans->handle = descr->handle;
+        trans->tag = descr->tag;
+
+        count = descr->mem_access_count;
+        size = sizeof(struct ffa_mem_access);
+        offs = offsetof(struct ffa_mem_transaction_1_0, mem_access_array);
+    }
+    /*
+     * Make sure that "descr" which is shared with the guest isn't accessed
+     * again after this point.
+     */
+    barrier();
+
+    /*
+     * We're doing a rough check to see that no information is lost when
+     * tranfering the values into a struct ffa_mem_transaction_int below.
+     * The fields in struct ffa_mem_transaction_int are wide enough to hold
+     * any valid value so being out of range means that something is wrong.
+     */
+    if ( mem_reg_attr > UINT8_MAX || flags > UINT8_MAX || size > UINT8_MAX ||
+        count > UINT8_MAX || offs > UINT16_MAX )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    /* Check that the endpoint memory access descriptor array fits */
+    if ( size * count + offs > blen )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    trans->mem_reg_attr = mem_reg_attr;
+    trans->flags = flags;
+    trans->mem_access_size = size;
+    trans->mem_access_count = count;
+    trans->mem_access_offs = offs;
+
+    return 0;
+}
+
+static void handle_mem_share(struct cpu_user_regs *regs)
+{
+    uint32_t tot_len = get_user_reg(regs, 1);
+    uint32_t frag_len = get_user_reg(regs, 2);
+    uint64_t addr = get_user_reg(regs, 3);
+    uint32_t page_count = get_user_reg(regs, 4);
+    const struct ffa_mem_region *region_descr;
+    const struct ffa_mem_access *mem_access;
+    struct ffa_mem_transaction_int trans;
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+    struct ffa_shm_mem *shm = NULL;
+    unsigned int last_page_idx = 0;
+    register_t handle_hi = 0;
+    register_t handle_lo = 0;
+    int ret = FFA_RET_DENIED;
+    uint32_t range_count;
+    uint32_t region_offs;
+
+    /*
+     * We're only accepting memory transaction descriptors via the rx/tx
+     * buffer.
+     */
+    if ( addr )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out_set_ret;
+    }
+
+    /* Check that fragment length doesn't exceed total length */
+    if ( frag_len > tot_len )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out_set_ret;
+    }
+
+    /* We currently only support a single fragment */
+    if ( frag_len != tot_len )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out_set_ret;
+    }
+
+    spin_lock(&ctx->lock);
+
+    if ( frag_len > ctx->page_count * FFA_PAGE_SIZE )
+        goto out_unlock;
+
+    ret = read_mem_transaction(ctx->guest_vers, ctx->tx, frag_len, &trans);
+    if ( ret )
+        goto out_unlock;
+
+    if ( trans.mem_reg_attr != FFA_NORMAL_MEM_REG_ATTR )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out_unlock;
+    }
+
+    /* Only supports sharing it with one SP for now */
+    if ( trans.mem_access_count != 1 )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out_unlock;
+    }
+
+    if ( trans.sender_id != get_vm_id(d) )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out_unlock;
+    }
+
+    /* Check that it fits in the supplied data */
+    if ( trans.mem_access_offs + trans.mem_access_size > frag_len )
+        goto out_unlock;
+
+    mem_access = ctx->tx + trans.mem_access_offs;
+    if ( read_atomic(&mem_access->access_perm.perm) != FFA_MEM_ACC_RW )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out_unlock;
+    }
+
+    region_offs = read_atomic(&mem_access->region_offs);
+    if ( sizeof(*region_descr) + region_offs > frag_len )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out_unlock;
+    }
+
+    region_descr = ctx->tx + region_offs;
+    range_count = read_atomic(&region_descr->address_range_count);
+    page_count = read_atomic(&region_descr->total_page_count);
+
+    if ( !page_count )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out_unlock;
+    }
+
+    shm = alloc_ffa_shm_mem(ctx, page_count);
+    if ( !shm )
+    {
+        ret = FFA_RET_NO_MEMORY;
+        goto out_unlock;
+    }
+    shm->sender_id = trans.sender_id;
+    shm->ep_id = read_atomic(&mem_access->access_perm.endpoint_id);
+
+    /*
+     * Check that the Composite memory region descriptor fits.
+     */
+    if ( sizeof(*region_descr) + region_offs +
+         range_count * sizeof(struct ffa_address_range) > frag_len )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out;
+    }
+
+    ret = get_shm_pages(d, shm, region_descr->address_range_array, range_count,
+                        0, &last_page_idx);
+    if ( ret )
+        goto out;
+    if ( last_page_idx != shm->page_count )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out;
+    }
+
+    /* Note that share_shm() uses our tx buffer */
+    spin_lock(&ffa_tx_buffer_lock);
+    ret = share_shm(shm);
+    spin_unlock(&ffa_tx_buffer_lock);
+    if ( ret )
+        goto out;
+
+    list_add_tail(&shm->list, &ctx->shm_list);
+
+    uint64_to_regpair(&handle_hi, &handle_lo, shm->handle);
+
+out:
+    if ( ret )
+        free_ffa_shm_mem(ctx, shm);
+out_unlock:
+    spin_unlock(&ctx->lock);
+
+out_set_ret:
+    if ( ret == 0)
+            set_regs_success(regs, handle_lo, handle_hi);
+    else
+            set_regs_error(regs, ret);
+}
+
 static bool ffa_handle_call(struct cpu_user_regs *regs)
 {
     uint32_t fid = get_user_reg(regs, 0);
@@ -857,6 +1335,10 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     case FFA_MSG_SEND_DIRECT_REQ_64:
         handle_msg_send_direct_req(regs, fid);
         return true;
+    case FFA_MEM_SHARE_32:
+    case FFA_MEM_SHARE_64:
+        handle_mem_share(regs);
+        return true;
 
     default:
         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
@@ -898,6 +1380,8 @@ static int ffa_domain_init(struct domain *d)
     }
     ctx->create_signal_count = n;
 
+    INIT_LIST_HEAD(&ctx->shm_list);
+
     return 0;
 }
 
@@ -1086,7 +1570,9 @@ static bool ffa_probe(void)
     if ( !check_mandatory_feature(FFA_PARTITION_INFO_GET) ||
          !check_mandatory_feature(FFA_RX_RELEASE) ||
          !check_mandatory_feature(FFA_RXTX_MAP_64) ||
+         !check_mandatory_feature(FFA_MEM_SHARE_64) ||
          !check_mandatory_feature(FFA_RXTX_UNMAP) ||
+         !check_mandatory_feature(FFA_MEM_SHARE_32) ||
          !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
         return false;
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:27:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:27:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564232.881674 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIdg-0000L9-4J; Mon, 17 Jul 2023 07:27:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564232.881674; Mon, 17 Jul 2023 07:27:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIdf-0000Kn-VE; Mon, 17 Jul 2023 07:27:23 +0000
Received: by outflank-mailman (input) for mailman id 564232;
 Mon, 17 Jul 2023 07:27:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIYD-0005A3-UM
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:45 +0000
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com
 [2a00:1450:4864:20::130])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 95f2c897-2472-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 09:21:45 +0200 (CEST)
Received: by mail-lf1-x130.google.com with SMTP id
 2adb3069b0e04-4fb73ba3b5dso6589832e87.1
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:45 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 95f2c897-2472-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578505; x=1692170505;
        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=l0XHslbV1muN4VtuaM4zruuvudWXBg6/E8tWHxT1G2w=;
        b=hiG84lTsXnpWA8832BeIlP5biJIxxFZGvsCb47rD851/2OJmcSUHcx2eTdOGALNIAZ
         ZzBJwzIF2ePJoYqe6c5P/S/cMFaJ0tpW45II1w6K6rGN9R89XUaUvLbCwFt+j8d1TcUO
         K3VJXCsWY/omGqq+JrAFsWY62ybuezttDg6BwX3GoXYAy2Vxqais679qISdAG3Ym91vi
         1v9PuvRs7lRUAaFsb76GEjUEEbmBBgk/DMLJYkZwxr0uLfo6IAXxDqGWRyFMDx+Rs0rS
         eDGXcCW7ilLhHd+nZOa1Upvu9BqWXsLk3YO+eBEfD3V9wDYOaC8MYVfmpRUbrsp1Ptc/
         dRUA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578505; x=1692170505;
        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=l0XHslbV1muN4VtuaM4zruuvudWXBg6/E8tWHxT1G2w=;
        b=g6GUV6xRuTD71jItQPGvdLI0/1g6eWBIluOW+dmAncHFI7puFwJxMDfMkncsjuLHBB
         9JxzzAuxUeR3clri2KzMQJ0PRYV4Buthb2RALH4OSAjO45nbp+dnqBixMPEF5hKnnihC
         ys+na9uGFlmtIVz2jN88Z14xyE1jwTYeAo3Qg3DGE67bzlJVbNegd6i+DkWIemAyKPEb
         NQ/C4fXQkC5Okzw2jda5qIfL9c/o/GyAQ2ztdalwdkdRg/ecTei+APzGpX0eQHQzzg2e
         Va4Bf/uvSefnVvfbbIpFqEtKVO8bPlOfJ0KYSWXQ8h55mJroUDhi6kHNndu6PAgM8Lrq
         WSIg==
X-Gm-Message-State: ABy/qLbdTiZmxlEplAIa/ekLFclppiLhWaFwRGJa6T6HhUWpidROezHs
	T/c8PAv98mGSMZmVVzfRNKl7DrpoB/AuSNNaKLM=
X-Google-Smtp-Source: APBJJlEOh5SPXNKa85tFB6sPM9pLXdtn7UKxhIc8ARWr7g9LVIriG2dG3J8xIQ0EyfNmCKDFFpfeng==
X-Received: by 2002:ac2:4e05:0:b0:4f8:7513:8cac with SMTP id e5-20020ac24e05000000b004f875138cacmr7916587lfr.48.1689578504865;
        Mon, 17 Jul 2023 00:21:44 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v10 22/24] xen/arm: ffa: list current limitations
Date: Mon, 17 Jul 2023 09:21:05 +0200
Message-Id: <20230717072107.753304-23-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds comments with a list of unsupported FF-A interfaces and limitations
in the implemented FF-A interfaces.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
 xen/arch/arm/tee/ffa.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 59832f73c2be..0fbaf7e1bb8f 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -13,6 +13,37 @@
  *                https://developer.arm.com/documentation/den0077/e
  * TEEC-1.0C: TEE Client API Specification version 1.0c available at
  *            https://globalplatform.org/specs-library/tee-client-api-specification/
+ *
+ * Notes on the the current implementation.
+ *
+ * Unsupported FF-A interfaces:
+ * o FFA_MSG_POLL and FFA_MSG_SEND - deprecated in FF-A-1.1-REL0
+ * o FFA_MEM_RETRIEVE_* - Used when sharing memory from an SP to a VM
+ * o FFA_MEM_DONATE_* and FFA_MEM_LEND_* - Used when tranferring ownership
+ *   or access of a memory region
+ * o FFA_MSG_SEND2 and FFA_MSG_WAIT - Used for indirect messaging
+ * o FFA_MSG_YIELD
+ * o FFA_INTERRUPT - Used to report preemption
+ * o FFA_RUN
+ *
+ * Limitations in the implemented FF-A interfaces:
+ * o FFA_RXTX_MAP_*:
+ *   - Maps only one 4k page as RX and TX buffers
+ *   - Doesn't support forwarding this call on behalf of an endpoint
+ * o FFA_MEM_SHARE_*: only supports sharing
+ *   - from a VM to an SP
+ *   - with one borrower
+ *   - with the memory transaction descriptor in the RX/TX buffer
+ *   - normal memory
+ *   - at most 512 kB large memory regions
+ *   - at most 32 shared memory regions per guest
+ * o FFA_MSG_SEND_DIRECT_REQ:
+ *   - only supported from a VM to an SP
+ *
+ * There are some large locked sections with ffa_tx_buffer_lock and
+ * ffa_rx_buffer_lock. Especially the ffa_tx_buffer_lock spinlock used
+ * around share_shm() is a very large locked section which can let one VM
+ * affect another VM.
  */
 
 #include <xen/bitops.h>
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:27:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:27:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564238.881684 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIdm-0000n5-Bv; Mon, 17 Jul 2023 07:27:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564238.881684; Mon, 17 Jul 2023 07:27:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIdm-0000ms-7h; Mon, 17 Jul 2023 07:27:30 +0000
Received: by outflank-mailman (input) for mailman id 564238;
 Mon, 17 Jul 2023 07:27:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xV9D=DD=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qLIYD-0005A3-3C
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:45 +0000
Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com
 [2a00:1450:4864:20::22f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9553fe70-2472-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 09:21:44 +0200 (CEST)
Received: by mail-lj1-x22f.google.com with SMTP id
 38308e7fff4ca-2b70bfc8db5so60800931fa.2
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 00:21:44 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 00:21:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9553fe70-2472-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689578504; x=1692170504;
        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=ZoIi1uajGrKh0qyhlJNpu9qRdkH7y35FjQEkn4RminE=;
        b=B3+jrIb0yXT2XMzdgNvrSdrhzstZgxuQREa4YdQovrihqXzLqXVBKks+NdSzkS/MRh
         Yc/e2pMmDJGiHYYfgXpz66TQBs8Bc6oIz6unRqQe4vJI0HWCMFQ4muAiFAAyLnjzuU6f
         XUp2Vc7vD7kesS9LVYqyxLLEYYUTFQuR8Nzh3C9rflGIuaHVQsF3AUVDcZR4uzUznngI
         5N1A8GaQD1sfHXU5e5lwQ183Lhebdlv/fkiC9zWQJiQrivI9fPunDoFqvLmWAiF1wqyP
         T3FdNobRdc5nYygX49bU+oxTeC2yJHSGECv/yE6zirYF6Q9IHMRTSVb1u8Oxxt8oGC/f
         fkvQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689578504; x=1692170504;
        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=ZoIi1uajGrKh0qyhlJNpu9qRdkH7y35FjQEkn4RminE=;
        b=K9g4NV73Rufk7Yu0afCAGlEFN1w1te6m0jNod+4mTYH2RW/pBuKD6ShhAZqGTfC/IC
         Ggzmfj4me70KcZnej1c1prPjWir9ZIgHUPhpx2U205MAx0RXaE49bp+s0fPctkc5QIbo
         NApxujP08ofOdI3Pc3cRuAQnewWlF4bw1z7AN3sE05pGrMFQqeYuC2/qzUGP2xrfXk27
         2vpVw7mNLduksrjl01nA4Ct2MAp9xJj5iC0Ex3T0ZR8pHqBKR00R9rk6qWtB77LyH6tJ
         nGPha2G2CUE8wjAc9srxjAY798lbRRPvvcjqiDDLTRNckSZ3HyuivNjpNDzxMRFHFZoq
         F/9A==
X-Gm-Message-State: ABy/qLb0sWbvZjLXUzLfeh5WqAIW7fFPQuE0VAlZA3w3DiaBUzUZ8/vc
	MH7SMEglbfmOgCsPtui7xMBnPkOqttzIF1Nfcaw=
X-Google-Smtp-Source: APBJJlGqOE0FmP3e2RxIrGtRAMVbmvZEGyOGEKApJB0D87k0xucsrK25ps7L++4vOStziweRuDfcMw==
X-Received: by 2002:a05:6512:3da6:b0:4f8:68a3:38e2 with SMTP id k38-20020a0565123da600b004f868a338e2mr9253650lfv.0.1689578503838;
        Mon, 17 Jul 2023 00:21:43 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v10 21/24] xen/arm: ffa: improve lock granularity
Date: Mon, 17 Jul 2023 09:21:04 +0200
Message-Id: <20230717072107.753304-22-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The single lock in struct ffa_ctx is complemented with rx_lock and tx_lock.

The old lock is used for small critical sections, like increasing
shm_count or adding another shm to shm_list.

rx_lock and tx_lock are only acquired using spin_trylock() which for
well-behaving guests should always succeed. Guests using the RX and TX
buffers are expected to serialize accesses before doing the FF-A
request.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c | 121 ++++++++++++++++++++++++++++++-----------
 1 file changed, 89 insertions(+), 32 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index ac23b9edc74c..59832f73c2be 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -365,6 +365,13 @@ struct ffa_ctx {
     struct list_head shm_list;
     /* Number of allocated shared memory object */
     unsigned int shm_count;
+    /*
+     * tx_lock is used to serialize access to tx
+     * rx_lock is used to serialize access to rx
+     * lock is used for the rest in this struct
+     */
+    spinlock_t tx_lock;
+    spinlock_t rx_lock;
     spinlock_t lock;
 };
 
@@ -815,7 +822,9 @@ static int32_t handle_partition_info_get(uint32_t w1, uint32_t w2, uint32_t w3,
     if ( !ffa_rx )
         return FFA_RET_DENIED;
 
-    spin_lock(&ctx->lock);
+    if ( !spin_trylock(&ctx->rx_lock) )
+        return FFA_RET_BUSY;
+
     if ( !ctx->page_count || !ctx->rx_is_free )
         goto out;
     spin_lock(&ffa_rx_buffer_lock);
@@ -866,7 +875,7 @@ out_rx_release:
 out_rx_buf_unlock:
     spin_unlock(&ffa_rx_buffer_lock);
 out:
-    spin_unlock(&ctx->lock);
+    spin_unlock(&ctx->rx_lock);
 
     return ret;
 }
@@ -877,13 +886,15 @@ static int32_t handle_rx_release(void)
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
 
-    spin_lock(&ctx->lock);
+    if ( !spin_trylock(&ctx->rx_lock) )
+        return FFA_RET_BUSY;
+
     if ( !ctx->page_count || ctx->rx_is_free )
         goto out;
     ret = FFA_RET_OK;
     ctx->rx_is_free = true;
 out:
-    spin_unlock(&ctx->lock);
+    spin_unlock(&ctx->rx_lock);
 
     return ret;
 }
@@ -994,21 +1005,43 @@ static void put_shm_pages(struct ffa_shm_mem *shm)
     }
 }
 
+static bool inc_ctx_shm_count(struct ffa_ctx *ctx)
+{
+    bool ret = true;
+
+    spin_lock(&ctx->lock);
+    if (ctx->shm_count >= FFA_MAX_SHM_COUNT)
+        ret = false;
+    else
+        ctx->shm_count++;
+    spin_unlock(&ctx->lock);
+
+    return ret;
+}
+
+static void dec_ctx_shm_count(struct ffa_ctx *ctx)
+{
+    spin_lock(&ctx->lock);
+    ASSERT(ctx->shm_count > 0);
+    ctx->shm_count--;
+    spin_unlock(&ctx->lock);
+}
+
 static struct ffa_shm_mem *alloc_ffa_shm_mem(struct ffa_ctx *ctx,
                                              unsigned int page_count)
 {
     struct ffa_shm_mem *shm;
 
-    if ( page_count >= FFA_MAX_SHM_PAGE_COUNT ||
-         ctx->shm_count >= FFA_MAX_SHM_COUNT )
+    if ( page_count >= FFA_MAX_SHM_PAGE_COUNT )
+        return NULL;
+    if ( !inc_ctx_shm_count(ctx) )
         return NULL;
 
     shm = xzalloc_flex_struct(struct ffa_shm_mem, pages, page_count);
     if ( shm )
-    {
-        ctx->shm_count++;
         shm->page_count = page_count;
-    }
+    else
+        dec_ctx_shm_count(ctx);
 
     return shm;
 }
@@ -1018,8 +1051,7 @@ static void free_ffa_shm_mem(struct ffa_ctx *ctx, struct ffa_shm_mem *shm)
     if ( !shm )
         return;
 
-    ASSERT(ctx->shm_count > 0);
-    ctx->shm_count--;
+    dec_ctx_shm_count(ctx);
     put_shm_pages(shm);
     xfree(shm);
 }
@@ -1299,7 +1331,11 @@ static void handle_mem_share(struct cpu_user_regs *regs)
         goto out_set_ret;
     }
 
-    spin_lock(&ctx->lock);
+    if ( !spin_trylock(&ctx->tx_lock) )
+    {
+        ret = FFA_RET_BUSY;
+        goto out_set_ret;
+    }
 
     if ( frag_len > ctx->page_count * FFA_PAGE_SIZE )
         goto out_unlock;
@@ -1421,7 +1457,9 @@ static void handle_mem_share(struct cpu_user_regs *regs)
     if ( ret )
         goto out;
 
+    spin_lock(&ctx->lock);
     list_add_tail(&shm->list, &ctx->shm_list);
+    spin_unlock(&ctx->lock);
 
     uint64_to_regpair(&handle_hi, &handle_lo, shm->handle);
 
@@ -1429,7 +1467,7 @@ out:
     if ( ret )
         free_ffa_shm_mem(ctx, shm);
 out_unlock:
-    spin_unlock(&ctx->lock);
+    spin_unlock(&ctx->tx_lock);
 
 out_set_ret:
     if ( ret > 0 )
@@ -1464,7 +1502,12 @@ static void handle_mem_frag_tx(struct cpu_user_regs *regs)
     uint16_t sender_id = 0;
     int ret;
 
-    spin_lock(&ctx->lock);
+    if ( !spin_trylock(&ctx->tx_lock) )
+    {
+        ret = FFA_RET_BUSY;
+        goto out_set_ret;
+    }
+
     s = find_frag_state(ctx, handle);
     if ( !s )
     {
@@ -1489,15 +1532,20 @@ static void handle_mem_frag_tx(struct cpu_user_regs *regs)
     spin_unlock(&ffa_tx_buffer_lock);
     if ( ret < 0 )
         goto out_free_s;
+
+    spin_lock(&ctx->lock);
     list_add_tail(&s->shm->list, &ctx->shm_list);
+    spin_unlock(&ctx->lock);
+
 out_free_s:
     if ( ret < 0 )
         free_ffa_shm_mem(ctx, s->shm);
     list_del(&s->list);
     xfree(s);
 out:
-    spin_unlock(&ctx->lock);
+    spin_unlock(&ctx->tx_lock);
 
+out_set_ret:
     if ( ret > 0 )
             set_regs_frag_rx(regs, handle_lo, handle_hi, ret, sender_id);
     else if ( ret == 0)
@@ -1506,6 +1554,18 @@ out:
             set_regs_error(regs, ret);
 }
 
+/* Must only be called with ctx->lock held */
+static struct ffa_shm_mem *find_shm_mem(struct ffa_ctx *ctx, uint64_t handle)
+{
+    struct ffa_shm_mem *shm;
+
+    list_for_each_entry(shm, &ctx->shm_list, list)
+        if ( shm->handle == handle )
+            return shm;
+
+    return NULL;
+}
+
 static int handle_mem_reclaim(uint64_t handle, uint32_t flags)
 {
     struct domain *d = current->domain;
@@ -1516,29 +1576,26 @@ static int handle_mem_reclaim(uint64_t handle, uint32_t flags)
     int ret;
 
     spin_lock(&ctx->lock);
-    list_for_each_entry(shm, &ctx->shm_list, list)
-    {
-        if ( shm->handle == handle )
-            goto found_it;
-    }
-    shm = NULL;
-    ret = FFA_RET_INVALID_PARAMETERS;
-    goto out;
-found_it:
+    shm = find_shm_mem(ctx, handle);
+    if ( shm )
+        list_del(&shm->list);
+    spin_unlock(&ctx->lock);
+    if ( !shm )
+        return FFA_RET_INVALID_PARAMETERS;
 
     uint64_to_regpair(&handle_hi, &handle_lo, handle);
     ret = ffa_mem_reclaim(handle_lo, handle_hi, flags);
+
     if ( ret )
     {
-        shm = NULL;
-        goto out;
+        spin_lock(&ctx->lock);
+        list_add_tail(&shm->list, &ctx->shm_list);
+        spin_unlock(&ctx->lock);
+    }
+    else
+    {
+        free_ffa_shm_mem(ctx, shm);
     }
-
-    list_del(&shm->list);
-
-out:
-    free_ffa_shm_mem(ctx, shm);
-    spin_unlock(&ctx->lock);
 
     return ret;
 }
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:46:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:46:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564264.881693 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIvc-0004Tp-5J; Mon, 17 Jul 2023 07:45:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564264.881693; Mon, 17 Jul 2023 07:45:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIvc-0004Ti-2d; Mon, 17 Jul 2023 07:45:56 +0000
Received: by outflank-mailman (input) for mailman id 564264;
 Mon, 17 Jul 2023 07:45:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLIvb-0004Tc-7z
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:45:55 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0614.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::614])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f4f2a650-2475-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 09:45:53 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8243.eurprd04.prod.outlook.com (2603:10a6:20b:3b4::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Mon, 17 Jul
 2023 07:45:50 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 07:45:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f4f2a650-2475-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CvuTfUk4DKdOh+h7IvxkUpJpB97lTpcthINeqqkzdmM+F/1jW7E4T0GTkOuJvtx8doKnaADKGJkHzlGtHn+81ar6PMD6Y02LTgMGkUGeJLoC+2Zx36H1W6YR9XmokVdJL//S9r8TD8o/U+WEBLVc9j+Ge0WINaH7H6LxOeOtzKh/tF+KOyls3HgaKmiXp8PYDz8xD37LKOxuGmzprMb4tnxSinTXXPNHf64AOg205DckUF0IaQNtq6nwWSL3u+hO3I+6mJbVYiqOVbQJQZdqhV29dCD7VxCcfYRL2EIfutBiu15weIoe9obtFwlM0nEi/+ItexPbT7kGHyFkYpL7kQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=6cuk3ajhPS/LryROGG+80i8dt4y3BDErmbpTVoHnbwM=;
 b=WiI0XJZ6oOB99KA1NZ68YYpfbO3kbdPgozxmHS7eL9no1G/tfuXp8St7oNW1ipHvFL4SAZtaZv9AIiDvWKXlk+nrCAksd36TxKbmt9xbtD1KJccN9vrFJPIEG331GuiX8S6VHyiEBnmp0uNM0c4Ojlz0ifv/jhktksMDYR1twZyZ8juWagpwuY3Z/RYzn2t51iQhyVl2qQF86yq1jFvPOQY+LIr/0w+Ezsk4eGtAN5b+QC/HiMfW3mz/yKGd5gADFrcwtKxr9kiMs73MUNy49UkuxsA8tVAZYccOc5XXf5QYf1JoB8IrVpDtFpJMO6sINLR5M0o9TGMZXbvOucy7tg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=6cuk3ajhPS/LryROGG+80i8dt4y3BDErmbpTVoHnbwM=;
 b=IM31/6CSAdmnVflSgpZogYLkiSiT+htJCtPLN5CKE/HGfJx45I13/NSjAUOkQn1jN5OkjmMQ0x69Cl3Lwud9yhxrlyrblJo1ht8I91ORhBiWKm++4/YZf7DukCytFPkN50/dRHnxFyJg/yscXO3VpIF48sEgdX2JlBFm1Ou5vGKj6qZpTI7ZzhLIqIDWEK4dr5+ff3+0F/c44n3sHoaIweFYHiu1tHaBJf1Ktu8S+clm2OplLXRwe08Y2ukQp49LfgeQGrrQzI2uomgIdcrGaa3cyRrgttxpDXFH7KktkCnYRnxQ7NhaWwPaPRCvSy7QaP4xMQrXhJYRs+Ni5/01Rw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <8a4c6ca5-db63-8677-043a-5919af157b21@suse.com>
Date: Mon, 17 Jul 2023 09:45:50 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v10 24/24] docs: add Arm FF-A mediator
Content-Language: en-US
To: Jens Wiklander <jens.wiklander@linaro.org>,
 Henry Wang <Henry.Wang@arm.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand.Marquis@arm.com, Anthony PERARD <anthony.perard@citrix.com>,
 Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>,
 Marc Bonnici <marc.bonnici@arm.com>, Achin Gupta <achin.gupta@arm.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, xen-devel@lists.xenproject.org
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-25-jens.wiklander@linaro.org>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230717072107.753304-25-jens.wiklander@linaro.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0022.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1c::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8243:EE_
X-MS-Office365-Filtering-Correlation-Id: 90816d4a-70a4-4bb2-0d0d-08db8699d74c
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	FkQm/GZixDLylf4Yxt3vPdJ7bnJQoGd315jcb2DqRNR40YTYvL7eGKmqm2v0iqJ0ai1WfsPU/MXtPQ397tA+bQC9iBHE/Xqw7gvNUpp8m5MNXK8hZMdU0pNB9dM0+fqQqfu5DYY5wF5o9GzkFjzEUf1wCRHylyhkMymb5ejTvxlmnkN1B6dNFoO7GXwGZNiwVL2ORMmoayuXySEkFJJccXlTR85pEoA9X0/uLAwnBg9YMc9NF8KcfOmD1ry07yPtWcTK/nRBgCXJygZ/2HS6cDxXYskxcqg/5+KtOAknXXY2MHtF0JxdKjAPqw0/KWKX4nWupgSN2a7lNocUeJiyJTu4uC9o43EVE/U2WIFyQqzQHcxMjBZmODXsUaga4hO8Le0spo6G3Xpj/+KIbCsUY67wbV3KXQ9rsZbE4YklQKw6HXCfRw8yJQmJbLaMBoL4NRahzSoB7HBED6lHw8p6qLnK67vc3istxQ7QpApaDtXzbuxPKAHyo1CqTIyCkGMNp0OUi4L1l3/uUd/C66lgYTWMa6GoYv0L/Mg9lIoYnfCCpAKiE9GyhkAx77l4ghnjSOJzAoHmM75yDHOdb14lMeo+Nd7+ua2l/pTf+DlsnBxayi8mypovOYZyRKbBx/oK
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(376002)(396003)(136003)(39860400002)(451199021)(6486002)(478600001)(110136005)(54906003)(186003)(6506007)(53546011)(26005)(966005)(6512007)(2906002)(4744005)(316002)(41300700001)(66946007)(66556008)(66476007)(4326008)(5660300002)(7416002)(8936002)(8676002)(38100700002)(86362001)(31696002)(36756003)(2616005)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Z3NtVjVKWWIwVlBzWWVEcTRsZ2pnZkRyRWVJdVIya29DNEFJVnpHTytiYlp6?=
 =?utf-8?B?TjR4bGZQSCtwT2VFM3F4OTl5U3h2UndOZFdVNjJrVnptd1prMEpFK0J2RFBB?=
 =?utf-8?B?Mm0zSUhCNkZza3c2NERQREc3RmpsTHVuK2tCSnY0cHZSZ0pjYm8xaDQ2UTNH?=
 =?utf-8?B?MzN2Y2NtbFdlK1c3aXAyNkxnbXMyeHkvc3dtVXFRaFFtSWJtRjN3REY2a0dm?=
 =?utf-8?B?L1FjamhwM3o1Z0VBWjFodnRzTFhqQTYrYVpNU21hUkFSSEdKci9oSnlEVGpk?=
 =?utf-8?B?cUYzSW5VK3NPZHNYeGYwL3kwMlNncy9zYlQ3YWZJQW01TlE3NzJGVDM0Z2Ra?=
 =?utf-8?B?VTBjakVzMjhpM2VCaTEyNGNONW9xbjg1NkoySFNVaWErS0ZXSWNpbXBFYVpJ?=
 =?utf-8?B?Z3JJVXZCWSt4T1FGaVFHQ09EWCtFWm9aMkVXOTVXSThXZHc5RUV0SWJEcnhV?=
 =?utf-8?B?QVhxbHNOOFJna2xnZmk0WTF2a2t0NmVHV0FveXBkRE0weTdxUzRwSlk1TU9a?=
 =?utf-8?B?WCtCYWcyb0hvNDNpMGgrb29KeW9vZWhVeUhRQjdTbFFNWkJDUnFZWi8vOU1j?=
 =?utf-8?B?RFBpckY4a2pISjNpZWdyQW40Wk9ZVUFTdklNWWV3WXZ4alNidVJqTVpHTldm?=
 =?utf-8?B?a0hmTzhjbW1ZWFpVTjhPZnV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ckIr?=
 =?utf-8?B?ZDllQ2p6TjhESHFqU29HSzI1UThvTmx1ZjRUWXExaHFLV01GWkZKa2FPU3Iz?=
 =?utf-8?B?OGYrK2gyVWo5RUI2ZU5Pa1JRS0hWMEZHdDl3TTM4T2pNc1ZlblhaRkZnM01P?=
 =?utf-8?B?TjlkZnVFeHlvQVVyNHAzUDlNVzIwMXlvTWtZVXhsN29LVlU2SGo1YzRjc21l?=
 =?utf-8?B?QTFvTDJBRVBjREwwMjg5Q3RKUU1VOXlWWlNwaXpXTndBMVdjOHdLRWZOdFlq?=
 =?utf-8?B?UTNGNURuV1ZxR3ZjTWwyS0hGbkxHMEx6dVpwV1BHTXltVy9NRENsSnRvNTV5?=
 =?utf-8?B?NnlzUE1ZcGxGbzNsKzRQSUxDeTdwbXQvN3V5Z3VnWms2c0R4dWx0M3kyVFBF?=
 =?utf-8?B?TlNDd0NZazNQY1ZndEJsanRBZ1pVcXpKemJZdXMwQi9MMStVeC9nL29yaTl4?=
 =?utf-8?B?a1Z6TmNJZWNUZEsxR1FMMm1xTGxLWitDbU1tWkl5eS9iODVERVdWbVBXSmRI?=
 =?utf-8?B?dk5KWERLYlR5Q1NhQWc5OFpxamNoS002cmdMMW9YYkJlUlRKamQ4Y3RUR1Ez?=
 =?utf-8?Q?5g68pstJmZ7kXWLHGdrrIMNlb?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 90816d4a-70a4-4bb2-0d0d-08db8699d74c
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 07:45:50.5366
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: w3vaeJeU0r4OyzdwkEHM4sNyYYv9qwl8F7g7kDgS3q6RzZY+w9sTzZRJ56BekNe8W5YpqGLxWUWifMpc0sCskg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8243

On 17.07.2023 09:21, Jens Wiklander wrote:
> Describes a FF-A version 1.1 [1] mediator to communicate with a Secure
> Partition in secure world.
> 
> [1] https://developer.arm.com/documentation/den0077/latest
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> Reviewed-by: Henry Wang <Henry.Wang@arm.com>
> ---
>  SUPPORT.md               |  9 +++++++++
>  docs/man/xl.cfg.5.pod.in | 15 +++++++++++++++
>  2 files changed, 24 insertions(+)

Wouldn't this better also get a CHANGELOG.md entry?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:48:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:48:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564267.881703 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIy5-00052y-HE; Mon, 17 Jul 2023 07:48:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564267.881703; Mon, 17 Jul 2023 07:48:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIy5-00052r-Ed; Mon, 17 Jul 2023 07:48:29 +0000
Received: by outflank-mailman (input) for mailman id 564267;
 Mon, 17 Jul 2023 07:48:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLIy4-00052j-6e
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:48:28 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on2061c.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::61c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 505cf9d5-2476-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 09:48:27 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB8023.eurprd04.prod.outlook.com (2603:10a6:20b:2a9::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Mon, 17 Jul
 2023 07:48:24 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 07:48:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 505cf9d5-2476-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=R4ok7YQGmijekyrTknmwQGv3SDEFVwZE5yFN+kgivY2HSI/hyZFRhj1t0sFjWy1v8f2EatJFCO4m3guS0102YE4zeEZC9jVppe+20lzOqBu6tIYA0tQHiQc2Zkiy0SExORY0XvmUwG8Y0/Pwqpa5pc3AyxS2BseYKklNt6GkLKT7pkLSTJqUGmm1Yn0FRzJjjk7Pn1rXkFy5oqnt3phgNxCk3ypUC8VXimrJCJIU1wlXoqQ80gD4R80V8hRWPR2IWnarjL2vQug9HzkfXFsI2Fw4C7ZSnhfIlRY5TDSBSZ7Hj9DVbnXQMOqgpHDArfS733tRqOHeIESUjvGByLfswg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=xg69FafxRLOJ8/ki9CLiJ4p465ydScSmvXIGkVIfpwY=;
 b=TVJ0y/JabLuNAxcyTWOtR0YdhRoPgqYSJqcR7v5yuqipkXa3XzwmNkUJgnY6fNLqXSOkuZGpn/mfjpyqd+xBv/3SSosNgF9bZx+rWtwvgcY41K8dkCaeKYU3nVulOC7o8Cjq+lnC9nMxYUrUsa6gvhCh4E6qmuviKGE5lMwFNZlc9rLp6HYwG42lbQ/ka2+3P+aZ3ehayz/mlCbn/gNdBVDgdqLYt3lASKDIQPHp8wn/EgkwKRm4qeqHAfqjBl00j6LQeOX7TxW1rJ7Odr2tYCGKebddRI8EXxjMq63Iw1pZxE2mVRx9wZE9ryYXvrnIj5RD8Ni2QPbtw92YzdrRwA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=xg69FafxRLOJ8/ki9CLiJ4p465ydScSmvXIGkVIfpwY=;
 b=mCVoIVS7cV8Azn6Pd09SGfR84HIcbsjvh38OtLG1Wt5NhpGkP5WdaEuIWOr72QM1kFrHEBztP5Q0j4g+dYSK2bck0vtos6aR23goUQF/zZb55aT85wc6hZbTy47crBFTHFcKjOl1vSXeRjuP67hZqGEHIPClcuoXArmwPcYX3h0Tw6vgNZ8H99WAKzM3OmKrpIId/dFfRkLR2uwMp7W/PqW4SQYlbVOqtA4mH5YOuuqJFH59L0HDwd3my4NFBbQDzrWPuZJwdDudvliEznzhsXuYgfRPCwI8KyXOuTmpASqAx9m0Ofi1LRnGJs3LeSXLlhgGB0ssxGVGWlTKiXAeWA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <45ea80d7-4500-4c55-f82b-77338b3738d3@suse.com>
Date: Mon, 17 Jul 2023 09:48:24 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: XenSummit: Empty per-arch files
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bobby Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 xen-devel <xen-devel@lists.xenproject.org>
References: <2aabfb63-1a2f-bb02-488a-ea79136bc6c0@citrix.com>
 <6af948f7-562d-65cc-ca1e-30bc8db90d02@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <6af948f7-562d-65cc-ca1e-30bc8db90d02@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0069.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:49::22) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB8023:EE_
X-MS-Office365-Filtering-Correlation-Id: 05af2569-df7f-4e60-e443-08db869a332e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	SOi57OVfArQCKPwlxOcX3iCc3kyVISXShjLQf3J+BQnD5EdwXlFDh0BLrSE9/vY4rh4CeQ9BrLGATHGnJ9kU4Dhh7zmFm0bfkZ7Vizv47LAO8I+njZ2Kjpf2e6LpqXBRC2glbErciwyiz/88i+RCgBExy1M79aZYzMhJfMfbT3S/b6CPAvgXpAv6uNb/YLEP3UGrO/Vn7A0EhmIUYy02KSFWWJTkk60ki1P3LwEeYRaYp2Sb5S3hwNZUSMpqMxvqkg2c+jPnr4KWv+5AgO94E6/vwyRKorw8nVka2GzgVXa2HY/Wk3xvFGSiPiyjme3ahfcN9dD7Tj3GiJsgqVGvv3VXvKqZjsehK1V9gMo/jgqm3+EGX/g+21IuFTIqW0B0I9GZx6o5Lkt1mBt+hvwRsdV+X4ncfkBFf+ARnyKaVtHITvRUDCwawzZSSS/aPu7rmSmK9pNLDeJDWKZGLqg2z/Hvtemo4PiS3VPQPBIHWT9xvNXxlzkUSZ8CEPKvngv/YzlomP0J9dfHg0S4HwAhHpOzfvM9Duy0lhMou4DWBVyoLYXQDEAMvI1NbenJw2kg2BaIeRaWBeQcUFBNuojIvbsvhTnHDlHcDQu89IeCXfsfBEexIxMa4MNH5Q+FOAhk9i+UMhvONxRyRYITA5ShFw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(376002)(396003)(136003)(39860400002)(451199021)(6486002)(478600001)(54906003)(186003)(6506007)(53546011)(26005)(6512007)(2906002)(316002)(41300700001)(66946007)(66556008)(66476007)(6916009)(4326008)(5660300002)(7416002)(8936002)(8676002)(38100700002)(86362001)(31696002)(36756003)(2616005)(83380400001)(31686004)(66899021)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SkpuZkREUGViUGl6V1hDVDg0dlJwaWcyWWVYRE5nMXNxTGE1UjdKS0IwM3Zr?=
 =?utf-8?B?MUhiZXl5VFhZaHIzTElZcmwxOWFZa2xuRUlUT3VRVy81ZXpLNlh3WmdtMzdh?=
 =?utf-8?B?NDRpbCtXTndTc2dNVkg0T0t2S1VwcmNLdFRxVHFDUk5DTFlNTjZCWkVzZXJO?=
 =?utf-8?B?Wko5SnBmOW1iRERvZyszNmFqZkYzOFhlUlpyWkdLS1pZcldZYjY2cFRlVisr?=
 =?utf-8?B?b3ZacngwZU9VQThrL21JL0F0d3pDcC9mWVJTNVM0UTZibkdPdnhNc2tKSnFV?=
 =?utf-8?B?dzduOW1lcHUyUGI1UHpNNTZUei9vdFF0S1JRNzBMOStYclR2bVE2ZVhhYTVP?=
 =?utf-8?B?ZU9sK3dDNFpZMVlZSXNIQW9USm4ySUpMOUZ3VHgwWjZkTWNCbU5kTkxrclFI?=
 =?utf-8?B?QUxKTVhqaGxxc1NwY0psSkU1WGlxQ1B3eGhTVUR5MFVKeHozNTJVaGdTQXYv?=
 =?utf-8?B?eDVUQkgwdTFySGVPYTE4dGRGcXZTMEhMMCtrelEwU3ZCRTFuNktUK1FjYjg2?=
 =?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ZVV4UCtDcndaMkphRlBnd1prSzcwWmIxWTBp?=
 =?utf-8?B?LzJueUtuUHFZczZrSzc1M1FrLzNhTTUrZ0Z1R3piZkVKeVA1eFVxS09kUnk1?=
 =?utf-8?B?eHE5WkFEYWpOZUx4NTlaam1WelpZd2t1ZzNMOUFwVXcra2VocmFPVEsxM1Z6?=
 =?utf-8?B?RkExTVM3WTQvZENjdktCbXBWTjJqeVZ2U0laVXpWelhTN3pSRmhYSVhwRnpi?=
 =?utf-8?B?TVVGSlNXL2c1dHQ5RHlDSWpLU1pKOXpwK2laN2xSOFJ2ZTZnVlJNTkZoWW0y?=
 =?utf-8?B?ZXVTcGE5bmdUbWZQSndXSUt4dGdlMk1vWFJoeXh6TGhvK1Y3dW1WYms0OW1u?=
 =?utf-8?B?dGRXWFhIc0RSdk5DQ2tNNGhDVWNlVnBnOUZRaGFqdVY0bVE3WlhnSHdJaE15?=
 =?utf-8?B?aUJJaWFMRldkTm51WVQwZi9uU2pKM2ZyR1RyaG1sUDI4eWM5N3JaSjd0NXRN?=
 =?utf-8?B?T2tmU1FoODRadHlkbzk5L002b3JUd1NTbWZDSlVsNGU1anpYNHBRZ1JaL0pq?=
 =?utf-8?B?Y0RMNkpMaUxNZlg1QjJjQ2lTS01sTDBzMjF0OG5TbmFhV0JRcWNKSFhsdkwr?=
 =?utf-8?B?cU12VzNuNnB3dzJRRjE0ZGJqYmdPSjRjNGgvMEhFUVNtdjkyWVNoa2cvdWUy?=
 =?utf-8?B?Ym9BVWFmQm0xNWgvKzBRR3pkMWdpdlFCQ3VSL2drTTBtTlhsYmFjdERuWUFK?=
 =?utf-8?Q?24LaSgOwIRCNwST9obxF4CqzU?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 05af2569-df7f-4e60-e443-08db869a332e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 07:48:24.5962
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: loOZE1OF6LYke4myuaBpHubmBIPExGfEaXvNMDHA+nHoHdg6upBjEb/jRyDpnauJPJW2hMQy1d7TFkbSZ7Ff3w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8023

On 14.07.2023 22:52, Shawn Anastasio wrote:
> On 6/28/23 6:32 AM, Andrew Cooper wrote:
>> Hello,
> 
> Hi Andrew,
> 
>> This wasn't a formal discussion point at XenSummit, but Oleksii pointed
>> out that it was still a problem, hence this thread.
>>
>> As we take on more architectures, it becomes more and more important for
>> things to be handled in a mostly-common way.  With that comes quite a
>> lot of <xen/foo.h> including <asm/foo.h>, and the arch one being a stub
>> in simple cases.
>>
>> It would be nice to get rid of the stub files; they're irritating to
>> deal with, both when refactoring and simply for the file bloat they create.
> 
> This is definitely something that would be great to see from the Power
> side of things, especially as we're getting to the point where we'd like
> to start dropping the build overrides in arch.mk and building the rest
> of xen/common/.
> 
> As we get to that point, I was wonder if upstream would be fine with
> submission of patches that add stub files for ppc in the interim, to be
> removed later when this proposal is finalized and a solution is decided
> upon. It'd obviously be best to avoid too much duplication of effort,
> but at the same time we'd like to avoid getting blocked on progressing.

I see no reason why for the time being you shouldn't add stub files; you
clearly shouldn't be forced to wait.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:49:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:49:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564270.881714 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIyy-0005aa-QP; Mon, 17 Jul 2023 07:49:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564270.881714; Mon, 17 Jul 2023 07:49:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLIyy-0005aT-NH; Mon, 17 Jul 2023 07:49:24 +0000
Received: by outflank-mailman (input) for mailman id 564270;
 Mon, 17 Jul 2023 07:49:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=XObt=DD=arm.com=Henry.Wang@srs-se1.protection.inumbo.net>)
 id 1qLIyx-0005aI-6T
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:49:23 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0617.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::617])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 70875deb-2476-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 09:49:21 +0200 (CEST)
Received: from AS8PR08MB7991.eurprd08.prod.outlook.com (2603:10a6:20b:570::15)
 by DU0PR08MB8787.eurprd08.prod.outlook.com (2603:10a6:10:476::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 07:49:18 +0000
Received: from AS8PR08MB7991.eurprd08.prod.outlook.com
 ([fe80::63b4:d202:9288:1453]) by AS8PR08MB7991.eurprd08.prod.outlook.com
 ([fe80::63b4:d202:9288:1453%7]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 07:49:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 70875deb-2476-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Q/X2JFQRpe4nYBPxnV3ru7WC9Z/7pjqYKzrQUJocZR9NmKlih+QHBOEEAYWEfXV667B1ceSCvZxakmtDF6h2a1MOlmlQg1NYmZHx07O0dl96Mdz0sBC7I3yf6lZIH1ISPCQdN2YbcEQL/TkemvnLdDYtlyD+ZuihXgc2xjWctT7TrCFkXkDm85hXRYoXKHg8S9o3Y1gjqxTXiiFibPPjaJ4Wn1G+vxHboDCdhbgOf/AuyKWNTyPr6CBLUxGRcFBtkvmwSUbormDFYI1JqEV8yee/lyEc3rP3ZMsfxy8eitAEVZa53qbx1imiUz57ThmXjsKd2GYdhOmDy7GXcTGAKw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=1Il1GcJla8zR5RvUV6jouxbpmzqTq6tnUvFmCLuyd+g=;
 b=Crl4YeNdi85p6VOyh99v+iZS1QoGCHe54QUYOfoUFVFbK0BwaOEDtJbt7oFcNjBmeEGw66xkMEN8FMyhz9+SYpf0dbzKGnazveoQ/lpbxSQD/CjLcbdehAXk1x1dH3jv6lFNzIkVyVo9dnO+SbTQDiDZSNigeNyidfSoRH7a3Jz2vGoOgwKZkSZyWEC4q61mVKokHDlxXmTER2jtBIA87noCAabH3rx/mJbPGZDiVJybE7i1viO27SisZ+j1Kz2cWMdhbnqO3F2aFHt9ijI+WhN1DAsjBJk6Cyvh3DeBt220VH+YGtEQk3TXp/faJQHG/HAxGN5QllLbo00vin1N+A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=1Il1GcJla8zR5RvUV6jouxbpmzqTq6tnUvFmCLuyd+g=;
 b=dv2LsR68HKijaE0OlbTo9oZWeNwtcnsb89rId1ERZgWnUQpsN55dXsxsZuNfPkhRVfxpTm/9EDWVpDfo2FL+9zmPukOCdO4tqbpZtWV9GHAyBzdUvfqe/cniARNlcva5GzixlMR/GFOWmTSZnO64Ng8zMm5mObz8xG/+AdclQK8=
From: Henry Wang <Henry.Wang@arm.com>
To: Jan Beulich <jbeulich@suse.com>, Jens Wiklander
	<jens.wiklander@linaro.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Bertrand
 Marquis <Bertrand.Marquis@arm.com>, Anthony PERARD
	<anthony.perard@citrix.com>, Juergen Gross <jgross@suse.com>, Wei Liu
	<wl@xen.org>, Marc Bonnici <Marc.Bonnici@arm.com>, Achin Gupta
	<Achin.Gupta@arm.com>, Andrew Cooper <andrew.cooper3@citrix.com>, George
 Dunlap <george.dunlap@citrix.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: RE: [XEN PATCH v10 24/24] docs: add Arm FF-A mediator
Thread-Topic: [XEN PATCH v10 24/24] docs: add Arm FF-A mediator
Thread-Index: AQHZuH9cIzjWAJ1mBES+SXZXgiujjq+9lGoAgAAAjEA=
Date: Mon, 17 Jul 2023 07:49:17 +0000
Message-ID:
 <AS8PR08MB7991AB49C93E4CC6EC97FF03923BA@AS8PR08MB7991.eurprd08.prod.outlook.com>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-25-jens.wiklander@linaro.org>
 <8a4c6ca5-db63-8677-043a-5919af157b21@suse.com>
In-Reply-To: <8a4c6ca5-db63-8677-043a-5919af157b21@suse.com>
Accept-Language: zh-CN, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ts-tracking-id: 79994CC57B1BCB479A8769BFA1939B67.0
x-checkrecipientchecked: true
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AS8PR08MB7991:EE_|DU0PR08MB8787:EE_
x-ms-office365-filtering-correlation-id: c0e890df-cf32-41ab-e0f2-08db869a52f9
nodisclaimer: true
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info:
 2y+Mj9ZgO72KddCvJoCmzDmJ5QwZ6UaCFHLei2wJAMwHo2/7NkErudESYcaB/Jo1xTMUTlrwWmv71bdyBrv9D+T9q06tKpHOV3ksbVf2rjgcVpeXYpn3msfJ9VO7r/D02A6ePRPZSJ47HSg/wzJYOeBot3Li135PJXAxp9fXt1RbhUIxsv2MUw6quZ4Lx0j+4ypLMngZ7WlRaHqFkLFBx+oO4eA6TMa1EHCW31nJbwhASvoZfoPH9fc9ReEdJ5vsik7TzfUvx1CBkKlJmpgXo7d+JXNIW5lJZNgQ0WDes9SQS+ShfaMZpOt0H6IqqSB+IEPC7ec1DbK9PRr5wdSdCYMNyk8IR2Ax30Xj2/aIjAriihutwwsslJLQFZwvQP0Xoq61+ZunSLVCkSUbTxnUr2dPazoBNXrlavys5AqoCp1Lo18uGn9kt+TAfq1GH4JbfZodBxGuUKLpX5owonIJtM2cPDx+PjhM3ZpjAqTmqU7SAmH6wHfGNm9lbx3C24hERZe4ppsH4MIwqVQMEy3CaogW8sqeyGEFVr9sZQcfMhietje12oyRvVMjHSR8bTPOgmy5TZQFx39pBIGQIDqes+hDuNKZTZ4Q3/tDn7wQOMc=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB7991.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(376002)(396003)(136003)(346002)(39860400002)(451199021)(83380400001)(26005)(478600001)(6506007)(53546011)(55016003)(966005)(7696005)(9686003)(71200400001)(33656002)(41300700001)(7416002)(38070700005)(8936002)(52536014)(5660300002)(64756008)(66476007)(66556008)(66446008)(66946007)(4326008)(76116006)(38100700002)(316002)(8676002)(86362001)(4744005)(2906002)(122000001)(186003)(110136005)(54906003);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?ekZPcHN0SjE4YUVibzFzM2w3M1BjV1dRekdDd3NCU09pNWlDWk50ZGFwbXhy?=
 =?utf-8?B?b28xN0V6emtLdG9rS2ZZaUpoTGE2WlpsU2VVK3RqSGNEQ0ZCWlE3N3ZldWZF?=
 =?utf-8?B?YUswSERrRU9xbjVwRm9Ha1VEUTUwNXNjYUxYZnN0V2dwbEN2SnMwa0l5aEhU?=
 =?utf-8?B?aW4zaE1jYmlhYXRuWVlJbEplTW5aOFJzSldQbUhhbjEyM2lMN3VENVRYOVdt?=
 =?utf-8?B?V1kzRHYvSHBrM1UxUkFONTFQVGlYNGpxK0VkMWFReTJkM0V6WGdnRFJmWE9q?=
 =?utf-8?B?VVlLejJJMkxOMUNSWFNMcXEwU0w1Z1Nlb2x2ZE5BWUMxL21TS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zMExNU0RTYjNoeWFwWUhM?=
 =?utf-8?Q?pdeg=3D?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AS8PR08MB7991.eurprd08.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c0e890df-cf32-41ab-e0f2-08db869a52f9
X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2023 07:49:17.7753
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: wp/F0ALKC2CsW4mgPcEUg7EkaRITWaPQCF6eLbIj/m4xKbYdAZcUz5BmSe0mQ1zc2slPl7TTromEur8GWNc/Rg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8787

SGksDQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gU3ViamVjdDogUmU6IFtYRU4g
UEFUQ0ggdjEwIDI0LzI0XSBkb2NzOiBhZGQgQXJtIEZGLUEgbWVkaWF0b3INCj4gDQo+IE9uIDE3
LjA3LjIwMjMgMDk6MjEsIEplbnMgV2lrbGFuZGVyIHdyb3RlOg0KPiA+IERlc2NyaWJlcyBhIEZG
LUEgdmVyc2lvbiAxLjEgWzFdIG1lZGlhdG9yIHRvIGNvbW11bmljYXRlIHdpdGggYSBTZWN1cmUN
Cj4gPiBQYXJ0aXRpb24gaW4gc2VjdXJlIHdvcmxkLg0KPiA+DQo+ID4gWzFdIGh0dHBzOi8vZGV2
ZWxvcGVyLmFybS5jb20vZG9jdW1lbnRhdGlvbi9kZW4wMDc3L2xhdGVzdA0KPiA+IFNpZ25lZC1v
ZmYtYnk6IEplbnMgV2lrbGFuZGVyIDxqZW5zLndpa2xhbmRlckBsaW5hcm8ub3JnPg0KPiA+IFJl
dmlld2VkLWJ5OiBIZW5yeSBXYW5nIDxIZW5yeS5XYW5nQGFybS5jb20+DQo+ID4gLS0tDQo+ID4g
IFNVUFBPUlQubWQgICAgICAgICAgICAgICB8ICA5ICsrKysrKysrKw0KPiA+ICBkb2NzL21hbi94
bC5jZmcuNS5wb2QuaW4gfCAxNSArKysrKysrKysrKysrKysNCj4gPiAgMiBmaWxlcyBjaGFuZ2Vk
LCAyNCBpbnNlcnRpb25zKCspDQo+IA0KPiBXb3VsZG4ndCB0aGlzIGJldHRlciBhbHNvIGdldCBh
IENIQU5HRUxPRy5tZCBlbnRyeT8NCg0KMTAwJSBhZ3JlZS4gU29ycnkgSSd2ZSBtaXNzZWQgdG8g
bWVudGlvbiB0aGlzIGluIG15IHJldmlldyBvZiB0aGUgdjggc2VyaWVzLg0KDQpLaW5kIHJlZ2Fy
ZHMsDQpIZW5yeQ0KDQo+IA0KPiBKYW4NCg==


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:57:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:57:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564279.881724 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLJ6z-0007FI-Ou; Mon, 17 Jul 2023 07:57:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564279.881724; Mon, 17 Jul 2023 07:57:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLJ6z-0007FB-LN; Mon, 17 Jul 2023 07:57:41 +0000
Received: by outflank-mailman (input) for mailman id 564279;
 Mon, 17 Jul 2023 07:57:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLJ6z-0007F3-5C
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:57:41 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on061f.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::61f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 99fe8d72-2477-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 09:57:40 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB7832.eurprd04.prod.outlook.com (2603:10a6:20b:2af::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Mon, 17 Jul
 2023 07:57:38 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 07:57:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 99fe8d72-2477-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=IuiEleEpenIq2mE1cYDKLd86rh3LK+7IF5E4lkVVDmTSvqB825pMVZ3JYz6qFxPTVF2Mts1v/jbcrFjlstX/pVFKlcj3PttzBt4M1MWG3ONt+at8LPFCxsgEGpoah8jriUupkIEFAGl99bC6SVtuz6qDPRdQV+2Zm7VXDyxckQ/HW/w2WMVnpDkhLB/yUbAedtXwFlXv568nSyoqLAAtK74e0Of3GrGYD3OBzk6WfCPRRel5OjNpa88u+w4mcr+i9tLtDthYv38eD7/NfaJmttRuEb1eDgMrhZQaj+l4tc52AWk9DQhEnIHcgJ4pHaLCcCv9mAhV4dcm0Tu2V6sUqQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=SRFbXK6GGnjVtDhTmcjg7SDhShIwH8xcmlWC7OG93sQ=;
 b=PIhXQqU/2HjY/vVjiLImSnfi+FspiB7mV1UOGO3yZ1EO8DSQGzUdyMxmvh0mjNihSmQ9pu2RsTH9ec5YcKLTcJTvF9YEhRdWXKC7KBrBnYY1eIn6gRzTct7m0n6uUWbxZLBHHAmqM0ur++aTZs8Zbf4pVImV7d0fTd4DsF1pney5iepdGbYct6od9wlUDnVzCK0J+4paqOJhcYRZ5jU2LAMeZRNSt1tJ8Hg4WWw+OhqpheAKLNt23g5tlAWX9XbRxucmXNEi06a9hPralQQ5X8dU7LM+EDVTph9LxT8z0UCX1aeG5dGLnSoztsz/dGCv+pu3VwVA3dnV39JgXyS7Tw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=SRFbXK6GGnjVtDhTmcjg7SDhShIwH8xcmlWC7OG93sQ=;
 b=OdC6ctNdPtxju1aIHFV6lYms2uqoH3brqop33ZKcUueiepLQ+WpXuvJrme+bhG34VPncrYc6upZ4mnTW+pgiieL479PRpBh9/g8Uk+xRFslzq7aRB8eHlB0qHma+O1lBKfhynKFYe65QUOY15doEfq5Xk4P6/uBb94RGa8N1dgpBpowL4PXD4Pn1rt8acH7TaGSToE+YD+cANYS7JvcxKE6CLm/u3L5j04k7DFQzSHY4d8JCD4BySgxUwQhKYITdvyHM9goBA3aUYIn2lww1DclMZYYRMHNijfGBvs9VRjhWRK1ya2/Y3/Dlyrw4UBDBDPXkgyTtl72YJ8nAhO11mg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <28eba93a-3ffd-06b2-6fe8-f5c64ff79c9e@suse.com>
Date: Mon, 17 Jul 2023 09:57:38 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] xen/ACPI: Remove acpi_get_pxm() entirely
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Julien Grall <julien@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
References: <20230714132024.3091309-1-andrew.cooper3@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230714132024.3091309-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0056.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:49::6) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB7832:EE_
X-MS-Office365-Filtering-Correlation-Id: 79158142-b90d-423b-9bc4-08db869b7d38
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	fRGMHVbKRfDOsE34LJU+ukOL36oZ4P62VFQ02oouO0vXfVZsu606qGi3aQGHYWVtL+iJHW4t8SiiN8Rk2Jjx7CWo4GxhkpDu2iKOc3FWm2utcE/y/H4wQXWz4XK3cgTORh7sogZWYsB6Of+BsOeNIUw9/NBiU0Bcp8kD1dU1bo14+zpVG+BBKhMMffIsmB+IMeYIdTR+N9r8qz0CmrfnjOkRdlkbItIa3wc+kykaTcQNVty/X1b5tZNqSSm4m6scDFiGQSGh91UIUuPJNslOgV28i46+JQHPUrMTB9Tpg5Mo/jnXzVoGgvdlQMdeYxAZ0TBasnlvmMVQ/K7XaHvBtAoC0ExhSA6mL8ujs132CrDSB5ex61D9gbLMeY/EK51ohWOBV44Uf39FAkW259M5lY0q/jILs+QAeHcJ8mBmurgbcKdXRvTsENgKC813RAJ28V8UN2n5JBGXM8LweCislJ9090a+D9RfbP1y+R1BpA96f9kN6Nh29T9S022AJVbCVBfzzSPvUM/0pgPy6oFyCM5vT3MjRRKvp4HDlxop/L9QZN3m+Z3CKDNktN84rjC+pAUWspbsOVyi2M163N9TXedOn/3uCNYMXs42DmlhsSBNGK4DPcXADRl65u3uTBLt6xDAo7V2okHJxWNTW9QVKQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(376002)(396003)(136003)(39860400002)(451199021)(6486002)(478600001)(54906003)(186003)(6506007)(53546011)(26005)(6512007)(2906002)(4744005)(316002)(41300700001)(66946007)(66556008)(66476007)(6916009)(4326008)(5660300002)(8936002)(8676002)(38100700002)(86362001)(31696002)(36756003)(2616005)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bDZFenBsVklYemJqenAzbnB6VUJWRG03SVBIWHQvdi9xeWxHTCtlWUZrZUln?=
 =?utf-8?B?cjlKN1JWT2VpUDlHM0Z3V0d1WUtRVHFuamN2OEo1VjJQeFBmeWt6NnQ0QWJD?=
 =?utf-8?B?WHpoT1BLbDlUbm9HNW45Q2V3SFYyMWZ4bFlEYWFFM29PK0srZm55dEYrSGdR?=
 =?utf-8?B?eExncERUcm9SanJMMDRNK2RhZXBWNjBrYWVHTFJVMjFqbC9Pc0ZGcVRZNjN1?=
 =?utf-8?B?cWlhT1RhSzIrVzgwMVZRc2VHZG9KclFnRlZUV3UyMUZ3enI4UHI3SUF2NDRT?=
 =?utf-8?B?RjUxVjdRSk1Fa3hZaVJvQnljdUU5VW5IUG0vSnJtMDI5TjI3cHdJWHIzMkxm?=
 =?utf-8?B?UmE1eU5TdUhtV25PaTJkRGNBYW5YMG9kQUU0YkdMc1dCb1I1cFJ3c0pOTS8w?=
 =?utf-8?B?T1lpUkxOVXVQTUVJcE8xRlBNSlhWZjVNNnhlQlF1MkRNMzlKdyt3ekNCMk10?=
 =?utf-8?B?V01xeUxIai9jN2RRMzdQS0JsSmlVdkM0dzBDM01vblJNSlVnN1RwUmJ2ekpG?=
 =?utf-8?B?S1FaNko3RGpQRWlSYzBSQ2NOTmdjekZWN21OU0JpbDJ3UnpmZ2J4OWk5d0pH?=
 =?utf-8?B?SklsSzNic2NEa3Q1MjI4THA2dnhCUlRza3ZaeDlmalNEaXNsQk41RkQyMmE0?=
 =?utf-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DlGZE5XWk11ZlJYcXdGbHZJUmZZMWxQUGJKUENiblR6?=
 =?utf-8?B?L0FUZHhzcTBpS0NJeG0yOHR2T1BlNXlyR003YmphdDl1TFBvQW1NSG9QaUcx?=
 =?utf-8?B?Njl2M2NZYUhzNEx3c2NTM3ZaVzg5SEJqMUJ4SjVYLzR3cVFkUEROQVA2UTdC?=
 =?utf-8?B?WmRnZFRncFZ6NGpmYzZveEdPWnpjYmJTdGQyTlFiTi9zMEJkVjU4RlVFRnVr?=
 =?utf-8?B?ZmtqTzFyUmtHY21RQTBmRWcvTGhaakJlbERCV3YvcWFOSGVRK29DVmdGK0Vp?=
 =?utf-8?B?ZzV0ZGpKTVNGVHNCd3VKbXFJS3RVMXZWUGJmWTdNdm1TM2g1V1Zhb2kzQ1Fq?=
 =?utf-8?B?dHJkbVZDcno5VmhocCsraDEyZVkrUE5KeDkvcW9vbzJvTlJtNE84Tm9DVkZi?=
 =?utf-8?B?Um1odDdLUEN6ZktrdkZRZlYzWWkrcVlHSUJsbU9zd3VCY0lzY1R3TG9aa1k5?=
 =?utf-8?B?K3R4L0V4dkd0TTNrTDM1SXN2dE9hL2JLR1lUa2syREdxaVVYZ0VUUDByeFZZ?=
 =?utf-8?B?cFlWNkpqVWE2czNnaGlSUS9CQ1E4dnJGd1ZvUjBPMzlxa2pQMmJQaUtoaUZX?=
 =?utf-8?Q?0BbEMwQdJ8usdrusfQt5FESe1?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 79158142-b90d-423b-9bc4-08db869b7d38
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 07:57:38.3412
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: yc74NwvAw/NQOh1goRvInTWrX1Xg83t3/XiBP1BzXvoprjyAj7WhHutPeMbN6bEj25sradl1x/4z7388A5M2gQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7832

On 14.07.2023 15:20, Andrew Cooper wrote:
> There are no callers, and the non-stub implementation is #if 0'd out, with the
> internal trying to perform an AML invocation.
> 
> There's no plausible way that code is getting un-#if 0'd, so drop it.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Mon Jul 17 07:59:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 07:59:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564282.881733 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLJ8S-0007mo-2M; Mon, 17 Jul 2023 07:59:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564282.881733; Mon, 17 Jul 2023 07:59:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLJ8R-0007mh-Vo; Mon, 17 Jul 2023 07:59:11 +0000
Received: by outflank-mailman (input) for mailman id 564282;
 Mon, 17 Jul 2023 07:59:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLJ8Q-0007mQ-K0
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:59:10 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20600.outbound.protection.outlook.com
 [2a01:111:f400:7d00::600])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cf76bec6-2477-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 09:59:09 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8970.eurprd04.prod.outlook.com (2603:10a6:20b:409::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Mon, 17 Jul
 2023 07:59:06 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 07:59:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cf76bec6-2477-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=eJqFRbHGZ1O8rjoZSC2J1J4WmGC+6j25hk5kXLrNj6Bge2GLNA1Bkp2IEy3b0blmbe6waAL0oqU0wvLpcZoPOBdsmsS84pz8pDWNprKsvIbHzfq5fi1YyAgI0HECfUGOgn+s/ViLTwazKh2OP0EYwKlKDAfptDKCV8B73kiOQzfcmsQog9M2FNTEvI0cyBHsFJe2jPswUH23BvSQWZg4cmNRhLMWFDG09YlzZBRuNh3QVd9GfP3rMT5AVDd1EAmb19Gf72i8nNbGhxoDUkNHrV12AErXSKR67UZ+npJCOZvLfHsX7Fele4oO02uMihubpxbi8zcVtRqiNThoF78xUw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=15ePut3Ap2jogJhygcZr2RNjPS0PRbnl7OL8Wr4yxNk=;
 b=UJRwD8RLOMdj8dHe/EVGq/LNr4RI8DAH4VysJTBvkgmBxld9JVn9glHQLNDnR7z+w3mVRLawS1Xb6hVN9qlngbgRm3ZKhgnUet04unf8rGULYmhzcBjRov+Yjzgg5y44piA0AKzBflgfIN2FbS1o/U1AecdbnSjQnKUw4hJTMYlNj7p7fcNDyzVfZ8SYpiS0qJKq48yneuR4m/twboSgFp8DYzwq/CAtWcdURVikFtMRrcvfmKuFCxfyKBbtCgtpvhJivWZ7KUrf88r+Xo8LMhu4ggP2M3E40Av9KfHoU4TuelIp2BJPYA2pRIw46yrkv7ku/Rh84TBsYNbT9FVBtQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=15ePut3Ap2jogJhygcZr2RNjPS0PRbnl7OL8Wr4yxNk=;
 b=G6atolRfhYFwhN+TuH5CmWW0vfgAOwerCjDgnKpjr86wQhlgGhNwjK7AbpFoYPWMWQqlpr8QAnxA1bNjAHaxuLM0XnvH82hohYwXDW9f9aXDUksQSKuUy2InlB2rRZWQBFQV962lkFNqRDQLlWrIh1rnFsmsN4WT/nqU6GlGo6khjcMG9tgk9A3KEG2LVxS8sP07EBNDDNKTb1QpoOy0qKMJ9zI5baB4YxySdezOaTcbU/0is04RyHBd9IqTrzEKJKHnY8LUv1PERV246RUqSMLvonmTXGzPXOR1qdViYbFS0MF9II/bwdFOV8gXQjlK2er56/EeSD1DfbPbwj+lsQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <0b19591e-8679-f978-8d9c-6f0984338267@suse.com>
Date: Mon, 17 Jul 2023 09:59:07 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] x86/common: Use const char * for string literals
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Roberto Bagnara <roberto.bagnara@bugseng.com>,
 Nicola Vetrini <nicola.vetrini@bugseng.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230714110009.3004073-1-andrew.cooper3@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230714110009.3004073-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0121.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:94::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8970:EE_
X-MS-Office365-Filtering-Correlation-Id: 600f2c35-8827-4ec2-52aa-08db869bb1fd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Us71qvqRWH/HjRgvi6UMSDe5cfVz4kPgW4FPiVAQVnOr3xPgfE6sVeywUSaEYDp/Xx+PQ3c6jHYgBwZlveTrCHg1XRnXRuHar54wAazSnXKg2t4wvpR4e7x1oPcVDo0L/MrSNRa+YLyJjK3Wl4zOVMQBsDZ+285gdCmTfXWuls7Bt/6FLdAyOLSlQVIMnBlf0dzqH4dOQEFsGzD8O8C/PHz4mYgoB6+HlWHpIsYCIkoR6P0v3HIL10vYYmRO3sX3sivXMCOBotzpRMXE+aEmhfNluNcSbCnIb6GY26AQb+oM7WOwTmqKCFbI90y2bUilJ6Fo4jw375Mvy4EI8lRGImn2fUSd0B/c+UgKczqtV3Pj6GoXWQ4GOPdHJEPta5IvU7FDpqdsuR0ptqxfLDVJ62MPw3x5o2kExwBvvaTsEZRKYk7yDVA+jzyv/MOEhD4CFxpTKKeBluHN5MBzby2paQcVLiUMnAJH/IZ2xvFXSyN716ayx3cuVTJV2/wpCCEaly+yM7+e9ZqrUkcZbs2h5O2lZK7YnjNHk6Mz8bUCNlWv9z7ND69AnRImUKIMXn004l/er4gdLfT520mKhZHAkmdB0FhzOUS7kkNvWO2+kXpjwGQ+8cNCv9ojO1sHSJZ3G8XnAxNbRPJYnS3p9Noiiw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(376002)(346002)(39860400002)(136003)(366004)(451199021)(6916009)(4326008)(66946007)(316002)(86362001)(31686004)(38100700002)(31696002)(6512007)(6486002)(478600001)(8936002)(26005)(41300700001)(2616005)(8676002)(66556008)(66476007)(186003)(5660300002)(6506007)(53546011)(54906003)(2906002)(36756003)(4744005)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Y3VNMmlQdG8zT3c1QmZLbU4vMUV0YkE5S2E5eXJvTHhyT21jeXJMYmNCSlIz?=
 =?utf-8?B?WU1zQzFYc2VNV1JqUlovUWpRVm9PeDEzV040dzV2T3h5K3hZUityTlhORlk0?=
 =?utf-8?B?dnpCK1dwd1ZKcnN1Sk0vOGx6dHJnUUV4R1AxYzRqSit1RUozc3UrOU9TWDkz?=
 =?utf-8?B?MGY5OWZtOCtoekcwemtCMmpvY2tjUVJJVzU5Z0NyTU9WeURsUGlWaEppdThS?=
 =?utf-8?B?elQ5MStJczUwTG1NTDE2Kzd2aHNscnB1dUQ2QUIwQm1qUnVlZE96SFNaeGdB?=
 =?utf-8?B?Q2NtV2F5Y0lQRlJEOTFpWFdheWlVOEpmR09FZXlHUDhIRTNIMmZjQTBxMHV5?=
 =?utf-8?B?b3VCQXBybG5VVHZUMWpTVkFIZmFzdzdKRHN4bjlkaFk3ckt4ekw2dVN3akto?=
 =?utf-8?B?ZWFWRGF0N3pha1pTdGYzVi9paVRJZENNZkREbFZGcERJL2NMZy9wY3F2dnRB?=
 =?utf-8?B?bG1MZlh0R1hFd1RHS05sbGFEOGovWFltM0ZlbElkNXhoUkpaaHE3bk1jTTVl?=
 =?utf-8?B?L095Y1B2ZUJCTFBtQi9Gc0tiYlJweXVpbmVacGdJa0JkaVRVZUhhTjY2UnpH?=
 =?utf-8?B?eXBaaVNrT1hsYlVPaVpMOUErNk40ZmNMVmFKZEdzaWlTZE9tWEFpTlIzTW1D?=
 =?utf-8?B?NUxvRVI2OWw4dGtaNHhEUlhFVktWSGhNbWwxRUhhNXhHdlltd2V4aThyTzlD?=
 =?utf-8?B?WDJ6UE8waW5vUWJsd3dvc2xQS0lOT0N5YlVsZVpTSndHc0dlMWtoVm0vTFc2?=
 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RnUvNEFlNXhDQzZoK3ZPN0NucW5QK3BGK1pLY1VxdENBWTd3cGhkanFo?=
 =?utf-8?B?R0JrWEkzTWlTc3hRaEZYdnR5c2xzUVpsZTk4NFgwR2xxVjB1aUhGd1JyRlQx?=
 =?utf-8?B?V2V1cXcyVWtqckxPQVN1R1kra1dMaFp1WUVHZjE5ZXlnYWFZWC9aUFVQSHVC?=
 =?utf-8?B?bjgzUFlxU3llbGJKOVNWS01JTElMRjB1RE91VEd6NmIybVJBbnc2MFVza0hZ?=
 =?utf-8?B?bGdLZHpRUUt0QkZWZ1lob2tiQVV0bGRkb3QwK0daK01wMnM0LzVJSkhwSXUz?=
 =?utf-8?B?bUs3ZFFkRWZjOTM0eUlITCtqRFBJbld0TE93VGEwNFlzaDNqYkFOTEhSaEpE?=
 =?utf-8?B?QlRyNFptelpTMnYxcVk3SWZUNnlDaUtONGNtenVRNUp5VDhZMW5wcEJ4U0NE?=
 =?utf-8?B?YnhTSFc5WjV0ZTY3ZmxCZGdydzBHdG9OT1BrMTljdk14enlZbkd3aUVJRUJP?=
 =?utf-8?Q?ye6ybeCzpZUUVXPycsZ3BpA1A?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 600f2c35-8827-4ec2-52aa-08db869bb1fd
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 07:59:06.8359
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: iWKqcx7NlLUj6oGM6LccHgJBr6lYs241J5/Qk2FzYHhcEBJcV3zIad9XhRbAEFiKTWW5iJ5Ut/UbKliz4ad0Qg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8970

On 14.07.2023 13:00, Andrew Cooper wrote:
> For pre-ANSI-C compatibility reasons, string literals have a mutable type, but
> it is undefined behaviour to mutate them.
> 
> Swap char *'s to const char *'s for variables which hold string literals.
> 
> This fixes several violations of MISRA Rule 7.4:
> 
>   A string literal shall not be assigned to an object unless the object's type
>   is "pointer to const-qualified char".
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Mon Jul 17 08:21:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 08:21:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564297.881744 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLJTK-0003Nn-DZ; Mon, 17 Jul 2023 08:20:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564297.881744; Mon, 17 Jul 2023 08:20:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLJTK-0003Ng-Aa; Mon, 17 Jul 2023 08:20:46 +0000
Received: by outflank-mailman (input) for mailman id 564297;
 Mon, 17 Jul 2023 08:20:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=TvSE=DD=arm.com=steven.price@srs-se1.protection.inumbo.net>)
 id 1qLJSw-0003Mr-I4
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 08:20:22 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTP
 id c4d373a3-247a-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 10:20:20 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2A67211FB;
 Mon, 17 Jul 2023 01:21:03 -0700 (PDT)
Received: from [10.57.37.37] (unknown [10.57.37.37])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 41CB33F73F;
 Mon, 17 Jul 2023 01:19:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c4d373a3-247a-11ee-b23a-6b7b168915f2
Message-ID: <e2c69d34-7523-98ae-93a2-04e132745ebd@arm.com>
Date: Mon, 17 Jul 2023 09:19:59 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [PATCH] drm: Explicitly include correct DT includes
To: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org, Ondrej Jirman <megous@megous.com>,
 dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
 linux-arm-kernel@lists.infradead.org, etnaviv@lists.freedesktop.org,
 linux-samsung-soc@vger.kernel.org, linux-mips@vger.kernel.org,
 lima@lists.freedesktop.org, linux-mediatek@lists.infradead.org,
 linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org,
 freedreno@lists.freedesktop.org, linux-rpi-kernel@lists.infradead.org,
 linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org,
 linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev,
 linux-tegra@vger.kernel.org, xen-devel@lists.xenproject.org,
 Liviu Dudau <liviu.dudau@arm.com>, David Airlie <airlied@gmail.com>,
 Daniel Vetter <daniel@ffwll.ch>, Andrzej Hajda <andrzej.hajda@intel.com>,
 Neil Armstrong <neil.armstrong@linaro.org>, Robert Foss <rfoss@kernel.org>,
 Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
 Jonas Karlman <jonas@kwiboo.se>, Jernej Skrabec <jernej.skrabec@gmail.com>,
 Jagan Teki <jagan@amarulasolutions.com>, Liu Ying <victor.liu@nxp.com>,
 Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>,
 Pengutronix Kernel Team <kernel@pengutronix.de>,
 Fabio Estevam <festevam@gmail.com>, NXP Linux Team <linux-imx@nxp.com>,
 Inki Dae <inki.dae@samsung.com>, Marek Szyprowski
 <m.szyprowski@samsung.com>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 Lucas Stach <l.stach@pengutronix.de>,
 Russell King <linux+etnaviv@armlinux.org.uk>,
 Christian Gmeiner <christian.gmeiner@gmail.com>,
 Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
 Alim Akhtar <alim.akhtar@samsung.com>, Xinliang Liu
 <xinliang.liu@linaro.org>, Tian Tao <tiantao6@hisilicon.com>,
 Xinwei Kong <kong.kongxinwei@hisilicon.com>,
 Sumit Semwal <sumit.semwal@linaro.org>, Yongqin Liu
 <yongqin.liu@linaro.org>, John Stultz <jstultz@google.com>,
 Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
 Paul Cercueil <paul@crapouillou.net>, Qiang Yu <yuq825@gmail.com>,
 Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
 Linus Walleij <linus.walleij@linaro.org>,
 Chun-Kuang Hu <chunkuang.hu@kernel.org>,
 Philipp Zabel <p.zabel@pengutronix.de>,
 Matthias Brugger <matthias.bgg@gmail.com>,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
 Kevin Hilman <khilman@baylibre.com>, Jerome Brunet <jbrunet@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 Rob Clark <robdclark@gmail.com>, Abhinav Kumar <quic_abhinavk@quicinc.com>,
 Dmitry B aryshkov <dmitry.baryshkov@linaro.org>, Sean Paul
 <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>,
 Marek Vasut <marex@denx.de>, Stefan Agner <stefan@agner.ch>,
 Sam Ravnborg <sam@ravnborg.org>,
 Jerry Han <hanxu5@huaqin.corp-partner.google.com>,
 Icenowy Zheng <icenowy@aosc.io>, Ondrej Jirman <megi@xff.cz>,
 Javier Martinez Canillas <javierm@redhat.com>,
 =?UTF-8?Q?Guido_G=c3=bcnther?= <agx@sigxcpu.org>,
 Purism Kernel Team <kernel@puri.sm>, Jianhua Lu <lujianhua000@gmail.com>,
 Florian Fainelli <florian.fainelli@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Artur Weber <aweber.kernel@gmail.com>,
 Tomeu Vizoso <tomeu.vizoso@collabora.com>,
 Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>,
 Emma Anholt <emma@anholt.net>,
 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
 Sandy Huang <hjc@rock-chips.com>, =?UTF-8?Q?Heiko_St=c3=bcbner?=
 <heiko@sntech.de>, Orson Zhai <orsonzhai@gmail.com>,
 Baolin Wang <baolin.wang@linux.alibaba.com>,
 Chunyan Zhang <zhang.lyra@gmail.com>, Alain Volmat
 <alain.volmat@foss.st.com>, Yannick Fertre <yannick.fertre@foss.st.com>,
 Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
 Philippe Cornu <philippe.cornu@foss.st.com>,
 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
 Alexandre Torgue <alexandre.torgue@foss.st.com>, Chen-Yu Tsai
 <wens@csie.org>, Samuel Holland <samuel@sholland.org>,
 Thierry Reding <thierry.reding@gmail.com>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Jyri Sarha <jyri.sarha@iki.fi>,
 Tomi Valkeinen <tomba@kernel.org>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
References: <20230714174545.4056287-1-robh@kernel.org>
Content-Language: en-GB
From: Steven Price <steven.price@arm.com>
In-Reply-To: <20230714174545.4056287-1-robh@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 14/07/2023 18:45, Rob Herring wrote:
> The DT of_device.h and of_platform.h date back to the separate
> of_platform_bus_type before it as merged into the regular platform bus.
> As part of that merge prepping Arm DT support 13 years ago, they
> "temporarily" include each other. They also include platform_device.h
> and of.h. As a result, there's a pretty much random mix of those include
> files used throughout the tree. In order to detangle these headers and
> replace the implicit includes with struct declarations, users need to
> explicitly include the correct includes.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
[...]
> diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
> index bbada731bbbd..20c25c836198 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_drv.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
> @@ -4,8 +4,9 @@
>  /* Copyright 2019 Collabora ltd. */
>  
>  #include <linux/module.h>
> -#include <linux/of_platform.h>
> +#include <linux/of.h>
>  #include <linux/pagemap.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <drm/panfrost_drm.h>
>  #include <drm/drm_drv.h>

Panfrost part:

Reviewed-by: Steven Price <steven.price@arm.com>

Steve



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 08:24:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 08:24:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564305.881753 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLJWg-0003xQ-S8; Mon, 17 Jul 2023 08:24:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564305.881753; Mon, 17 Jul 2023 08:24:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLJWg-0003xJ-PN; Mon, 17 Jul 2023 08:24:14 +0000
Received: by outflank-mailman (input) for mailman id 564305;
 Mon, 17 Jul 2023 08:24:13 +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 <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLJWf-0003xD-Sl
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 08:24:13 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2061b.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::61b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4de6605f-247b-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 10:24:10 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU2PR04MB8776.eurprd04.prod.outlook.com (2603:10a6:10:2e3::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Mon, 17 Jul
 2023 08:24:08 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 08:24:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4de6605f-247b-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=P0AeQk8TAOSnZugGftqWTJWPih/G0HVAJk8FS5hqwrjosdAoD8oHtUocjqqifAB839kWaECweU+SiMqYTlgPVTIz/07iLFZMCn1h8VF0xCxElVo1x2K4cgJzh3BXT3diLUCaefsXZZk33X/ZVhyZ8gdXy0/PZGyyhqU1dWsanUUNyXObZxhlDTNKb1iJQMZ5KqBVnLtdiDDGvKw/h0e147je/blI+xlasGuBXM+Mtx418IDXvcL7Q6fH9c0GyYxbKA42GCG/iYgbk9taJQnO2bsi1QuT8127PSFm92W6J1fPAq0SRhAeWx6nfXpCim19kDXZsLyZOCOlwdqoSTHtRg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Yuw+Dxn6OwPytOF3eYN8Jek1bRUNjs3qLPEvj93NZNA=;
 b=KEM5m0k+aw/Xo4UDPMXA9wnhajHzZ4oDDINwJgUPUOj9dANkIYB/KiPLrkJnHiw0sMHtm1e1EbgdgCkUZNkFGkTX3wXM3mScCmjhd58alO8/C6iG8KKuPSbUwWnI9y+ICcyMz2ipSbFjHHvWejCIYgmJnarWYwJINM+r7ektpgTfrGAsdf66aaZaxIOS2Mqh7f2NyX7UURNaheEQudiA/pHTVwTsYvToF4Jdv/6DZpkA0E3H9iGeIPnVVC3N7L3pCtuVrLiVlkcNIXvhw9jIZ4TwQzvQatAVJxBfrFEMpbhBCWGLfFCkn+E6k4EsD+aNQ6D5zlz2yWITDkFzTXJtEg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Yuw+Dxn6OwPytOF3eYN8Jek1bRUNjs3qLPEvj93NZNA=;
 b=KfYWS50n8a27SRPs0v4YLwu0HOIQI/+7rfQWTwVC95e02UF6mch2B2iEEc7VYqIIunUxD4J4tk22FUdJDMQpQEPYu8bFXlIkh6PFpgFj8iVf2KaejuPPAhc2r9F1NKx29NckPQSww+pCzr3rQ4vbjNMWfSweQC55GA23Uv6K8oKzzE6ahozvANUreBqGlOrFY5eAOKqROy2/DLiR4M0CcUIbZMkLm+FuB6cKENVFBKn7jumxpB/Xsh5M4GYYCxKrtmSmAt7fBEVZyxjw93nofLNmpxc9NxL/YvejNmGgxUSXyRrkn4lulhNmg4DIrLUxwPZbySV46jdLZ9QyqPaOXA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <de7c464c-95d4-23f1-b33c-1cf888f6b00d@suse.com>
Date: Mon, 17 Jul 2023 10:24:08 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2] x86/ioapic: sanitize IO-APIC pins before enabling
 lapic LVTERR/ESR
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230714160314.71379-1-roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230714160314.71379-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0064.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4b::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU2PR04MB8776:EE_
X-MS-Office365-Filtering-Correlation-Id: 8aedb64f-8b4b-43b9-6dfa-08db869f30dd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	jLjYZdnV98YREFJ1Q2VAPs/dMnlJdinmVqjPmbu9rE82AxP35NQd+spIii8DBUIC3hmIriq/4J5En3SdgsBfaQMzt2EXw+6L5zTB26MAvSSTxqOeiz1NPhPihZjVZE794cuB3JUHzDRO/akDmv3NNEmODaRC5c9Q0p0t4Cu6GuBPLc152YIclsMSNYSTntfn4Eqqx+jqAZyCkp2GYiG5C3zUVyN5UltXdfDEFE7DyCTHWRwRZFPM/P4HMvAeO5Y5PCwwAcPgpFIPYwxjtCLLCKt18Ytdmu+U/tYzQqa6TAgK1y9mKxqOL9HrX4bQqa299xvcOep9VXOpoHuEB90c+8VY7ESAm3YpeoygC1AxphP87m6xCv73mqzGtOc3WYSmDK6xbnPY7JGTZdp5D4O6KJoxgUxKOb9B46POgZgeO1/m7pLEXwZQqnq9/Vw5fUwX5MdZLdsjXnfWnCOCSaUcUg8xA0hxieJwJ+flfwpm3lCQ5Rx7usFvHMtH58kl03QAD3zaf99uik2hZsLiybhjeG7o/ecqLVpZkQR3QjK8BV65o51pSCbsGYmw1J/ftKs03aaH74V+VmjpN9goy1t4sUGk20l77b/GdaiF6FYpWbFk0ZDvanifmOy2drqDcAVuk1+uMRXjOelwGbBORiON2g==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(136003)(396003)(366004)(376002)(39850400004)(451199021)(31696002)(86362001)(31686004)(2906002)(66556008)(8676002)(8936002)(66476007)(5660300002)(41300700001)(316002)(6916009)(4326008)(38100700002)(66946007)(2616005)(36756003)(186003)(54906003)(83380400001)(6506007)(478600001)(53546011)(26005)(6486002)(6512007)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YUlDeDF3SEJkUVNpWXBmQ2dQUTkyWDl2NHJFTzY1a1UxQmhjcE0ySGE2QjBC?=
 =?utf-8?B?Z0NNSU5XK0orSk1ldk1qNHlpM3JFaVJpeENwNEJ4RDA4a09RNFU3MVF3a05F?=
 =?utf-8?B?d1Byd1g4eVRJUVh2cFdmSW90ZGdnT1N2VGFNQ0VGSmw3S0taSEtUS1d5dG8v?=
 =?utf-8?B?M09QY0ZEQUN2WVJrOUNTd21zZVJLM3VVNVhNSFp2YTNtVmZWdndy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hEUk9rdXR5YW8vRGVVYzZFSG9hQmlNTjF1WSt3?=
 =?utf-8?B?d2w5NXIrRUlVbWlyWXB6eitycWRwdlZZVmUyTXpma0lzWkRxSUNuUjBENjBU?=
 =?utf-8?B?b2p1NkRNRlpRWmFTeGVkRlllVUFOQWRQbXVXUUw3YnRxME5NY2h0dTZyTnNr?=
 =?utf-8?Q?tVo1IcRL+Ut3/MKKmk4llk6lr?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8aedb64f-8b4b-43b9-6dfa-08db869f30dd
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 08:24:08.1692
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: XJCbLP5ED8KksmpWtr2YHF4TaDhR/G7n/8fTodaw8rnkdpDsyRPwiE0nZlLsFKayMBhU9kNoBiUyNV5EWz93ng==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8776

On 14.07.2023 18:03, Roger Pau Monne wrote:
> The current logic to init the local APIC and the IO-APIC does init the
> local APIC LVTERR/ESR before doing any sanitation on the IO-APIC pin

Nit: I guess I'll take the liberty of making this read "sanitization"
while committing.

> configuration.  It's already noted on enable_IO_APIC() that Xen
> shouldn't trust the IO-APIC being empty at bootup.
> 
> At XenServer we have a system where the IO-APIC 0 is handed to Xen
> with pin 0 unmasked, set to Fixed delivery mode, edge triggered and
> with a vector of 0 (all fields of the RTE are zeroed).  Once the local
> APIC LVTERR/ESR is enabled periodic injections from such pin cause the
> local APIC to in turn inject periodic error vectors:
> 
> APIC error on CPU0: 00(40), Received illegal vector
> APIC error on CPU0: 40(40), Received illegal vector
> APIC error on CPU0: 40(40), Received illegal vector
> APIC error on CPU0: 40(40), Received illegal vector
> APIC error on CPU0: 40(40), Received illegal vector
> APIC error on CPU0: 40(40), Received illegal vector
> 
> That prevents Xen from booting.
> 
> Move the masking of the IO-APIC pins ahead of the setup of the local
> APIC.  This has the side effect of also moving the detection of the
> pin where the i8259 is connected, as such detection must be done
> before masking any pins.
> 
> Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 09:01:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 09:01:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564319.881763 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLK6u-0008Tl-Pe; Mon, 17 Jul 2023 09:01:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564319.881763; Mon, 17 Jul 2023 09:01:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLK6u-0008Te-N1; Mon, 17 Jul 2023 09:01:40 +0000
Received: by outflank-mailman (input) for mailman id 564319;
 Mon, 17 Jul 2023 09:01:39 +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 <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLK6t-0008TW-FO
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 09:01:39 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on062a.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::62a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 88b983dd-2480-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 11:01:36 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU2PR04MB9178.eurprd04.prod.outlook.com (2603:10a6:10:2f5::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 09:01:34 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 09:01:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 88b983dd-2480-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=U+lseEvXg2sDlHJZz+c2KfYGYUrpyGzUNdI4ju5CwtNwOPRyq8DXFXt2oQiPBi3pMo1rbXKEETL3OR+faiZsyvmB2zWiuRSryfS2yYfFO7M6/xujXc9kMUYmkK3PgWT5wcrD/8m3dVOqMrG7jQonD8bRVGN8fmkReJaOBsl9a8dxfKOWPPyFSzztr8NWmAD1JBp/NERGPwrSS86lnTtI+zjc6EmYAFqeUd91Cb4Rz55NOWIFCBOIvnRQn5Rh3yksVAclaK/dY8FM2iwj00vG/P/oQR1Qe1co2t7TomUdOhH4ulhmrqPfCwSe9FAJuaomydYO09Yo2kGj9tXO5TdTUg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ycCuWX7rcJOr+LuyEh7XbFJYRfebPP1oQRarrAyl83Y=;
 b=I108qU5i+1Gquoq6CITaxaRG8q86vKATDOQcH7LIl8TfGB5oEoiCNCLZhn71/WMIrgj1BgTJRa/prcVcDoaClj8jKrWPyscgMR3M6ACq5Om5HNz1W/tXkJCt/0aHv6eswooMnsaFfOcSLa+cMz8vWnQUenbgYWxHC1IdusbvIOoNfQlCWQPGV6cE4dOcBIRwbWXXwNrytziypA7UNfOBhKFV6xLm6CtFkvZ+cCzQ84OqkXDdyVfDQVmLmOROSaVtua2LMo/AyyuT6+0piijPo004PSjDKr13iKlC/fx5MIXraHISu0MMSwJDRPA78Cv4wCBhtvSLMtyjQHfHzO32Gw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ycCuWX7rcJOr+LuyEh7XbFJYRfebPP1oQRarrAyl83Y=;
 b=MPIYPj3J8t6yKz14Q+gU8yP/JdmToe6U/nJ8fYBMLzQlmrVckl2ujfjIiW3CreiYSYnhDNzElOQEdMfx8TpabasBj2veNvfFb8bewOc0n9qPyCXIFvUa6ZLwIXUtmPhPaNPFRif/hx8B8qZMA61hGgiWWDorKJZcKzbK0dRR4YDcC1WzrP/wc1VOyKrBYiQIfk3F5ke/jgT/psf75RjXvBd4i20IilcVN7XwW2gwCLLjHNIDnSpJ3Ss7rD76sOrs+G00RGsPq9JgCSWxm1TX5d5S1rV1lrCC7N236iRgI89eExcvW3xWKj582D0YIFbIvO1XNjTJyVm57q+L2YEM4Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <9ed67f73-2f03-4e45-3ca1-4e6f2e286ac1@suse.com>
Date: Mon, 17 Jul 2023 11:01:33 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v3 12/15] xen/x86: fix violations of MISRA C:2012 Rule
 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <Xenia.Ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1689152719.git.gianluca.luparini@bugseng.com>
 <78717a3ccee0517eab915156fc474394ae1dcf81.1689152719.git.gianluca.luparini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <78717a3ccee0517eab915156fc474394ae1dcf81.1689152719.git.gianluca.luparini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0024.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:14::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU2PR04MB9178:EE_
X-MS-Office365-Filtering-Correlation-Id: 27266707-76a1-4f59-d1fc-08db86a46b52
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	vqxTT0cXJ/SE3JhDES7PEwPXNvUq4gPEnDL9kuRB4SavWkUBczbeYHB3gwXpiihu6zfHUJgpm7ShyVIoChnsYZnYImHj1SRPYvbEtZBshJ4+ZxnEbt+6PB1SHZenVciKCFVBuxLgr1uq+vwn/6P9LE2dZaFzmytwF2/uYx77OfKQwBkSQwh9x2+MgYzUeAjf/A06AlxzBC9hS90hj6jbQ9rrNxQpTS7xTITjs7pz2mESbdzs5AUl9Ry3jeJanOwIy+yqcAmE3t5U12Q8Hk6uXYAIOuf+jiDo9BobWkoT+odHL1unbcttNH1y1VzKm3vD6PreQe5v7KlTsWCByyiWYALnzN5i/+iWzOPq/VCiiznTrDFZXgjlc9ofJq0K/wPvxvcAX0e7l1nfdxuL/2ygyIoxi76uApUapgcta3rSaJeT+L4S5DkNbNRfm5pWeEqH73MKn/k/sedTU9vrzIq5QhoxtQfIfhcNC8zvn74zB3SoP4OEWlfKMz2nnhRhi7MseUisLPfC+jmvDrZ7/PlwckzJdSkLlkVtQQbhgHnkZWrc+lVFvi/MQJrDOA1PVtR5m3wkGp7OXFIEB5YdWBZ5pSFOS3Vob8Dg+08Rn4bS6rIKB1cFVWT5PPNcmcOiEGukrmBFLiBi/AfcByjZ1QSDZw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39850400004)(396003)(376002)(366004)(136003)(346002)(451199021)(66899021)(2616005)(6486002)(6512007)(31696002)(86362001)(478600001)(26005)(6506007)(53546011)(36756003)(8936002)(8676002)(316002)(7416002)(41300700001)(5660300002)(54906003)(38100700002)(4326008)(6916009)(2906002)(66476007)(66556008)(66946007)(186003)(83380400001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?em1CWitnK0ZlSG1uM3BEQWRvaFVhaHMzTHdGTUQvazUvRFlMQVVNalhrY2hn?=
 =?utf-8?B?U3hSRlB6QTgwTmpSbmNkWjdzQVY1bWlDSVYzQ0xqVjZ1dW85WHNIdGhxZytY?=
 =?utf-8?B?a0dGbHQrd2gxYk0wSmxRUDVNTlphbnFXa2JWQzMyNGt2bzZMc003REUyTGNQ?=
 =?utf-8?B?RlBrR1Y1bVQ3VDJyaVczOThibzZ3bldWazQwT0RBM3VYakxGblJtZnJLK1NX?=
 =?utf-8?B?dlg2NXZ1TGNaRHlsSWtkaWc1c0VYSkZ2UFFGcldia1hoRTJxb0k0a0EwZHo2?=
 =?utf-8?B?eEx5QnUrL1M3bGl5RlRQYnhxVys2ZkxMT01VZzg2SHVORXk1cE1rS0p2amsy?=
 =?utf-8?B?Z09HRzZqSG0wU0JkWjVWb2RWZVhUYmt2UWNleDh6a2tZNnk0RWVDZVRPeDYv?=
 =?utf-8?B?VU5yd2FYOHF2YTcxaTZmMDFzU1ZwREZ1SEQ2enRYNVhwRE5OUk0xN2t3dXMv?=
 =?utf-8?B?R2diMXp4c2pncnBYakxBdHNPb293TEdHM3JTQmx6c200SFNTZGtvZEl2ZDBq?=
 =?utf-8?B?YkxYYjJuakVVRG1JM0o0MURlWDNYeWdPMlM4dmRtMU1jU2VvQWRVd3VuOEEy?=
 =?utf-8?B?alhLMW9SZHlYQkZhR1VhMjBwTjlLdHRQTkM2a3lhZHRBS2o2NjZOd3NTVHE1?=
 =?utf-8?B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hKdm9QbENGU0kyK082cGp5RjVLUStz?=
 =?utf-8?B?NDNabkxzVS9tNzgySllkWDE3ZGhhVWZON0xDS2V0VDBPUXhoRVptdEZZSEhl?=
 =?utf-8?B?RkxpQ3M3cjdZMm9CMUwyK0RZdElLOWhjYWJYdDl4OHlMSVE0L1gyNkRiOG91?=
 =?utf-8?B?L09DV1g1L1E4cXhxd3FwcmJGUmpHZS9pUzJlZjQvck02RGE5eUdhUjl6UWJo?=
 =?utf-8?B?dzQrZTh2UlU3OFkrUVFBS0szV3VXRnFPWkdSMG9ReFRaVVpKcDVQMWxyM0k3?=
 =?utf-8?B?ME9PZVU4N2dqVm1nZUlrL2c4d2ZYNnhNVVIzRmIzbzdrVkpoTjQ2d05BcXF1?=
 =?utf-8?B?cktQWjU2L2VjM2F0L0REc3hhT3hzMFgwUVIwL0RTYUdtdlloWWVSZ1paWnpi?=
 =?utf-8?B?RVBPZmxSUVNIS0UxdW1DcjBKWXZvMzJOZ016Y3R0eXdhUmFEckpuYzcrYm9t?=
 =?utf-8?B?TFlHa3NlQ2JnTE9DUEE1K0ZYeWorWkFwS04rTXBvM2pyMmdoTFBLakFRWHND?=
 =?utf-8?B?bmV6MnVwbCtMRE1aU2lUMllRcDFjRkJHMDFWU2hnRXo2QmdSZUk5NUJJdFBN?=
 =?utf-8?Q?ewwJNXIJ1tIZU2vqd9qNlcD9o?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 27266707-76a1-4f59-d1fc-08db86a46b52
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 09:01:33.8113
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: wDj4YPvGh0xA+I2hSb7RHEV7SliIYOTB5l06ELrR7KXGxOc6q4y9N3ZheY7jUe8zj0UutIkQm+wSwviWjPtzRA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9178

On 12.07.2023 12:32, Simone Ballarin wrote:
> @@ -378,10 +378,10 @@ static void __init calculate_host_policy(void)
>       * this information.
>       */
>      if ( cpu_has_lfence_dispatch )
> -        max_extd_leaf = max(max_extd_leaf, 0x80000021);
> +        max_extd_leaf = max(max_extd_leaf, 0x80000021U);
>  
> -    p->extd.max_leaf = 0x80000000 | min_t(uint32_t, max_extd_leaf & 0xffff,
> -                                          ARRAY_SIZE(p->extd.raw) - 1);
> +    p->extd.max_leaf = 0x80000000U | min_t(uint32_t, max_extd_leaf & 0xffffU,
> +                                           ARRAY_SIZE(p->extd.raw) - 1);

Why the 2nd of the U additions? I ask in particular because ...

> @@ -768,11 +768,11 @@ void recalculate_cpuid_policy(struct domain *d)
>  
>      p->basic.max_leaf   = min(p->basic.max_leaf,   max->basic.max_leaf);
>      p->feat.max_subleaf = min(p->feat.max_subleaf, max->feat.max_subleaf);
> -    p->extd.max_leaf    = 0x80000000 | min(p->extd.max_leaf & 0xffff,
> -                                           ((p->x86_vendor & (X86_VENDOR_AMD |
> -                                                              X86_VENDOR_HYGON))
> -                                            ? CPUID_GUEST_NR_EXTD_AMD
> -                                            : CPUID_GUEST_NR_EXTD_INTEL) - 1);
> +    p->extd.max_leaf    = 0x80000000U | min(p->extd.max_leaf & 0xffff,
> +                                            ((p->x86_vendor & (X86_VENDOR_AMD |
> +                                                               X86_VENDOR_HYGON))
> +                                             ? CPUID_GUEST_NR_EXTD_AMD
> +                                             : CPUID_GUEST_NR_EXTD_INTEL) - 1);

... you don't do the same here (or else you would have to further
switch to e.g. using 1u, to please min()'s type checking).

Just to mention it (I think that U wants dropping for now), in the
earlier case if you switched to UL, you/we would be able to switch
from min_t() to the type-safe min().

> --- a/xen/arch/x86/hvm/irq.c
> +++ b/xen/arch/x86/hvm/irq.c
> @@ -383,7 +383,7 @@ int hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
>  
>      if ( !vector )
>      {
> -        int pirq = ((addr >> 32) & 0xffffff00) | dest;
> +        int pirq = ((addr >> 32) & 0xffffff00U) | dest;

This is fishy, not just because of the use of plain int, but even more
so ...

>          if ( pirq > 0 )
>          {

... with this following. It leaves unclear what negative values would
mean. I think pirq wants to be unsigned int (pirq_info() expects it
this way, albeit far from all of its invocations adhere to this rule),
but the situation isn't helped by XEN_DMOP_inject_msi not having any
comment whatsoever on the meaning of the upper half of the uint64_t
addr field that's being passed in.

I'm inclined to omit this hunk for now. I'll look around some more,
and if I can come to a sensible conclusion I may then submit a patch
just for this.

> --- a/xen/arch/x86/hvm/stdvga.c
> +++ b/xen/arch/x86/hvm/stdvga.c
> @@ -39,22 +39,22 @@
>  
>  #define PAT(x) (x)
>  static const uint32_t mask16[16] = {
> -    PAT(0x00000000),
> -    PAT(0x000000ff),
> -    PAT(0x0000ff00),
> -    PAT(0x0000ffff),
> -    PAT(0x00ff0000),
> -    PAT(0x00ff00ff),
> -    PAT(0x00ffff00),
> -    PAT(0x00ffffff),
> -    PAT(0xff000000),
> -    PAT(0xff0000ff),
> -    PAT(0xff00ff00),
> -    PAT(0xff00ffff),
> -    PAT(0xffff0000),
> -    PAT(0xffff00ff),
> -    PAT(0xffffff00),
> -    PAT(0xffffffff),
> +    PAT(0x00000000U),
> +    PAT(0x000000ffU),
> +    PAT(0x0000ff00U),
> +    PAT(0x0000ffffU),
> +    PAT(0x00ff0000U),
> +    PAT(0x00ff00ffU),
> +    PAT(0x00ffff00U),
> +    PAT(0x00ffffffU),
> +    PAT(0xff000000U),
> +    PAT(0xff0000ffU),
> +    PAT(0xff00ff00U),
> +    PAT(0xff00ffffU),
> +    PAT(0xffff0000U),
> +    PAT(0xffff00ffU),
> +    PAT(0xffffff00U),
> +    PAT(0xffffffffU),
>  };
>  
>  /* force some bits to zero */
> @@ -70,15 +70,15 @@ static const uint8_t sr_mask[8] = {
>  };
>  
>  static const uint8_t gr_mask[9] = {
> -    (uint8_t)~0xf0, /* 0x00 */
> -    (uint8_t)~0xf0, /* 0x01 */
> -    (uint8_t)~0xf0, /* 0x02 */
> -    (uint8_t)~0xe0, /* 0x03 */
> -    (uint8_t)~0xfc, /* 0x04 */
> -    (uint8_t)~0x84, /* 0x05 */
> -    (uint8_t)~0xf0, /* 0x06 */
> -    (uint8_t)~0xf0, /* 0x07 */
> -    (uint8_t)~0x00, /* 0x08 */
> +    (uint8_t)~0xf0,
> +    (uint8_t)~0xf0,
> +    (uint8_t)~0xf0,
> +    (uint8_t)~0xe0,
> +    (uint8_t)~0xfc,
> +    (uint8_t)~0x84,
> +    (uint8_t)~0xf0,
> +    (uint8_t)~0xf0,
> +    (uint8_t)~0x00,
>  };

The changelog for v3 says you did drop the changes to this array.

> --- a/xen/arch/x86/include/asm/hvm/trace.h
> +++ b/xen/arch/x86/include/asm/hvm/trace.h
> @@ -58,7 +58,7 @@
>  #define DO_TRC_HVM_VLAPIC           DEFAULT_HVM_MISC
>  
>  
> -#define TRC_PAR_LONG(par) ((par)&0xFFFFFFFF),((par)>>32)
> +#define TRC_PAR_LONG(par) ((par) & 0xFFFFFFFFU), ((par) >> 32)

Perhaps again better to switch to a uint32_t cast on the lhs of the comma.

> @@ -93,7 +93,7 @@
>      HVMTRACE_ND(evt, 0, 0)
>  
>  #define HVMTRACE_LONG_1D(evt, d1)                  \
> -                   HVMTRACE_2D(evt ## 64, (d1) & 0xFFFFFFFF, (d1) >> 32)
> +                   HVMTRACE_2D(evt ## 64, (d1) & 0xFFFFFFFFU, (d1) >> 32)

Same here then.

>  /* K6 MSRs */
> -#define MSR_K6_EFER			0xc0000080
> -#define MSR_K6_STAR			0xc0000081
> -#define MSR_K6_WHCR			0xc0000082
> -#define MSR_K6_UWCCR			0xc0000085
> -#define MSR_K6_EPMR			0xc0000086
> -#define MSR_K6_PSOR			0xc0000087
> -#define MSR_K6_PFIR			0xc0000088
> +#define MSR_K6_EFER			0xc0000080U
> +#define MSR_K6_STAR			0xc0000081U
> +#define MSR_K6_WHCR			0xc0000082U
> +#define MSR_K6_UWCCR			0xc0000085U
> +#define MSR_K6_EPMR			0xc0000086U
> +#define MSR_K6_PSOR			0xc0000087U
> +#define MSR_K6_PFIR			0xc0000088U

This entire block can be dropped rather than adjusted; there are no uses of
these constants. I expect they're a remnant of 32-bit Xen, which has been
gone for a decade.

> @@ -459,10 +459,10 @@
>  #define MSR_VIA_BCR2			0x00001147
>  
>  /* Transmeta defined MSRs */
> -#define MSR_TMTA_LONGRUN_CTRL		0x80868010
> -#define MSR_TMTA_LONGRUN_FLAGS		0x80868011
> -#define MSR_TMTA_LRTI_READOUT		0x80868018
> -#define MSR_TMTA_LRTI_VOLT_MHZ		0x8086801a
> +#define MSR_TMTA_LONGRUN_CTRL		0x80868010U
> +#define MSR_TMTA_LONGRUN_FLAGS		0x80868011U
> +#define MSR_TMTA_LRTI_READOUT		0x80868018U
> +#define MSR_TMTA_LRTI_VOLT_MHZ		0x8086801aU

Same here.

> --- a/xen/arch/x86/x86_64/acpi_mmcfg.c
> +++ b/xen/arch/x86/x86_64/acpi_mmcfg.c
> @@ -50,7 +50,7 @@ static int __init acpi_mcfg_check_entry(struct acpi_table_mcfg *mcfg,
>  {
>      int year;
>  
> -    if (cfg->address < 0xFFFFFFFF)
> +    if (cfg->address < 0xFFFFFFFFU)
>          return 0;

This check is bogus and would better be corrected. Such a correction
would presumably deal with the Misra violation at the same time.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 09:17:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 09:17:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564322.881774 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLKMK-0001fZ-4Z; Mon, 17 Jul 2023 09:17:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564322.881774; Mon, 17 Jul 2023 09:17:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLKMK-0001fS-13; Mon, 17 Jul 2023 09:17:36 +0000
Received: by outflank-mailman (input) for mailman id 564322;
 Mon, 17 Jul 2023 09:17:34 +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 <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLKMI-0001fM-4D
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 09:17:34 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20626.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::626])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c2198d2d-2482-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 11:17:32 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8669.eurprd04.prod.outlook.com (2603:10a6:102:21c::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 09:17:29 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 09:17:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c2198d2d-2482-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=j+MURylTSZoiIKg+YtxxSERyVfGL+vvilbBXujGoQ00ClTUaDwmgIjXKMXU9Utciyl/C+coCgccz9SdjfiezgoVCFG+dlImsYBrYzxdkEu8tJwLwl89Csbe6tgZ9tRVRfz4STF+XcY2SChuCxhgLJTtE4acQ2KEohY4Vybdesm7Z7AgFJoQspiiUNbiZeacbteC1933B/LiTfDgVteQrilWtvMcpZyCazdl0MlTo3DUEJIxdK6KurMoQywLJocPuR/JeFA0/8QUyDLyPlRcYGK/GPxAxnNLzkCxAB/XahkX7TOO/qtFo1JSmd8H28BVmgIlKwOd+uABkzlt/dLbZHg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=pg1MyTl64WbsP+vCmW05qoprI/VUJcDhMZmUUEZysCw=;
 b=VI0siWFVnRGAB/bT2cktqOVXE6nRdV7D2XuYjY3sGV/nk3KfSRYnGEudP59mAOjqaKcpfFp5BpwOdEEuUQ838BMH+TLhUmIxkAL0wS9JItYO9VyaeRQG+ELX4myh1tLdySW9FVb4VrlxdhaRVM/ddBVGQ31R7nkgwaXmSc6JnUrp8aB1J9bPMlepTL0VsJNlO1cft82dyrNCA0qcUwEBPaoZtjfOxfJi3mhlGs+hBKFUQ0iMGWNY/S8dNt2ibtm/OuLJgDJ9Jj9LVU+Fo1W/tIYh8WwoQ6a7iIQkNHbz+s8Hn7N/xPmJTt4ygb4+JTmRKenIcJtBmxwfC39pT+nfeg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=pg1MyTl64WbsP+vCmW05qoprI/VUJcDhMZmUUEZysCw=;
 b=mI53oAiLJ6Cf8Q0kyb9hfPrgUyVJH8gUYw/eVqj2yeoBpGPUq7wPzChYeOumftPi2W5TYbhwwGdHTarNIINI7sTYGvOD6Dzp6gtD4Sl7ER7c9PA73zQzNM+GZQvh9ExicItgPFPM8CgVRNLL7/h2KWgpzLXs+EF0f9TIUkvyQxInwNoxkHOhMqjPRMTa3RAxEiFyDqk8rm8Mtu+NmXTGWWx5qe6CclfPbhmEr8QOA/XFrTQssuKPpRhKAxYbWY54a0lo01zTGVXz8aCt0MYcu65NVskcqcyqdj373weP+LhshpMNnxSCe5fIpMcazPlwDhgy/fIkqtgTmne7K/CkxA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <df2c3154-2e8b-194a-ec1e-472819bbf026@suse.com>
Date: Mon, 17 Jul 2023 11:17:30 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Simone Ballarin <simone.ballarin@bugseng.com>,
 Gianluca Luparini <gianluca.luparini@bugseng.com>,
 Stefano Stabellini <sstabellini@kernel.org>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86: drop old (32-bit-only) MSR definitions
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0084.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9b::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8669:EE_
X-MS-Office365-Filtering-Correlation-Id: 0f20ee3d-8cac-4e61-a7b8-08db86a6a518
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	4AzIyDWiLXWn5nmWlosnzRK/tG1KDf0t+B17lKMxm+niAD9n0f33zaQyAl0eeHF5eX0lxYKNEfQ4hQvnxKSKSN+RoY+v90CUf+niN06eCncaH/ORcVJhTMB6fxsaqx5t+64efOJpQ3JZeHCJ2FH0FcNJ7uhl7xTeX8BoqOVUA/jm9UzbhAb2zVvqJ3E7hIYiBg2ezMVXUPnUWWfnmAEUAnN2ozRXMLtwjCA8V7TPIGcuY9DgvvV6RO0gdDUXkJAXzfFjSdw03L2T1Ho+niZINtwmsccY1zl7SCGW9V8LDctYbmTvy5SN+j4N+ibtXMuqhNoCQraWCYh7q2nBrx5VmZRi60oPrJYPGl0cqz4zRk006HjMolHq8QfbGdK2pwNYPYCJnyWupm1TEdZf9fsq/pkN+e99RynLZ/cYqyecN6gpSMqQQV7R+AfJrEdcgJhvntGKX2BgmgMExEaP9yxxaLLjshGP3JTU6ApNDy79iEjKm1feRrM7IN+M+me6NVJRVRt9psblfZIUBbW4nR20fKmHt3Lic1XczO+JOWcJvQBL4/fBHqdXZcFkQKvqoIahBr07eQYSZCh6viQJcb1igoCDyGvRvjNlzCGTHdosmZW7uJqDOR5SBytBc3VBQ7jruipvJPuWBAR3IB7ZTr7B+g==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199021)(31696002)(6506007)(38100700002)(186003)(26005)(478600001)(6512007)(6666004)(6486002)(54906003)(8676002)(41300700001)(66476007)(8936002)(66556008)(2906002)(6916009)(66946007)(316002)(4326008)(5660300002)(36756003)(2616005)(86362001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bUxkRVVRakx4UGxQY2lybjdoRnh3eE5hSGpXWHBlUmJkOXZLcEhqZkVUeUJX?=
 =?utf-8?B?ZnFaR1licEJ5czBNMWl2Um1CNmd6N3czZXh0VVRpYndVajhpOFZvUno2V1pI?=
 =?utf-8?B?NWMxaVQxU1I4SWplZG54eGFaaHlDSWFIcVBSWFNQbDYzbENkV0VNZDl2eHdU?=
 =?utf-8?B?OUFuM2JON044ZXlwclUyclQ1MkdXdHFWREpDdnJoa0RCNmxaN3N5aS8xYWVx?=
 =?utf-8?B?NjFjNlB4K1huM2lwUzU1bDNxLzVxTFNVZFFsWU15OXhiNFRGV1dybVNLc0M2?=
 =?utf-8?B?TEF1QkpZWmFmMGxzMGx4dlV2WWd4MEtWUVVFSUhYM3BORlE5UXhVdXdHaEtz?=
 =?utf-8?B?czBYUlJTV3pIWWJ2NU1FdWg4VXVXdURzQmFZT2pzUzF2L1U1c3F6cDBwS1k0?=
 =?utf-8?B?Z1BXdk9iS1NV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-Message-Id: 0f20ee3d-8cac-4e61-a7b8-08db86a6a518
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 09:17:29.7229
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 5iY64bSB3HDfXsGB1npAPylDhmztJkQxnYYoDdllwPbrBKwhEc1+k+HPxADe7QnQlIHdLvWyWwfs2F/laZHtbg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8669

Some of them aren't liked by Misra rule 7.2; rather than fixing them,
drop the affected ones and a few more that aren't used (anymore). (Note
that e.g. some MSR_K7_* are applicable on K8 and newer as well, so need
retaining.)

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -334,7 +334,6 @@
 #define MSR_K7_EVNTSEL3			0xc0010003
 #define MSR_K7_PERFCTR3			0xc0010007
 #define MSR_K8_TOP_MEM1			0xc001001a
-#define MSR_K7_CLK_CTL			0xc001001b
 #define MSR_K8_TOP_MEM2			0xc001001d
 
 #define MSR_K8_HWCR			0xc0010015
@@ -427,46 +426,11 @@
 #define MSR_AMD_PPIN_CTL                0xc00102f0
 #define MSR_AMD_PPIN                    0xc00102f1
 
-/* K6 MSRs */
-#define MSR_K6_EFER			0xc0000080
-#define MSR_K6_STAR			0xc0000081
-#define MSR_K6_WHCR			0xc0000082
-#define MSR_K6_UWCCR			0xc0000085
-#define MSR_K6_EPMR			0xc0000086
-#define MSR_K6_PSOR			0xc0000087
-#define MSR_K6_PFIR			0xc0000088
-
-/* Centaur-Hauls/IDT defined MSRs. */
-#define MSR_IDT_FCR1			0x00000107
-#define MSR_IDT_FCR2			0x00000108
-#define MSR_IDT_FCR3			0x00000109
-#define MSR_IDT_FCR4			0x0000010a
-
-#define MSR_IDT_MCR0			0x00000110
-#define MSR_IDT_MCR1			0x00000111
-#define MSR_IDT_MCR2			0x00000112
-#define MSR_IDT_MCR3			0x00000113
-#define MSR_IDT_MCR4			0x00000114
-#define MSR_IDT_MCR5			0x00000115
-#define MSR_IDT_MCR6			0x00000116
-#define MSR_IDT_MCR7			0x00000117
-#define MSR_IDT_MCR_CTRL		0x00000120
-
 /* VIA Cyrix defined MSRs*/
 #define MSR_VIA_FCR			0x00001107
-#define MSR_VIA_LONGHAUL		0x0000110a
 #define MSR_VIA_RNG			0x0000110b
-#define MSR_VIA_BCR2			0x00001147
-
-/* Transmeta defined MSRs */
-#define MSR_TMTA_LONGRUN_CTRL		0x80868010
-#define MSR_TMTA_LONGRUN_FLAGS		0x80868011
-#define MSR_TMTA_LRTI_READOUT		0x80868018
-#define MSR_TMTA_LRTI_VOLT_MHZ		0x8086801a
 
 /* Intel defined MSRs. */
-#define MSR_IA32_P5_MC_ADDR		0x00000000
-#define MSR_IA32_P5_MC_TYPE		0x00000001
 #define MSR_IA32_TSC			0x00000010
 #define MSR_IA32_PLATFORM_ID		0x00000017
 #define MSR_IA32_EBL_CR_POWERON		0x0000002a


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 09:32:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 09:32:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564329.881784 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLKaj-000453-E6; Mon, 17 Jul 2023 09:32:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564329.881784; Mon, 17 Jul 2023 09:32:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLKaj-00044w-Ar; Mon, 17 Jul 2023 09:32:29 +0000
Received: by outflank-mailman (input) for mailman id 564329;
 Mon, 17 Jul 2023 09:32:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLKah-00044q-JW
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 09:32:27 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2042.outbound.protection.outlook.com [40.107.7.42])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d77f03e5-2484-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 11:32:26 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB7517.eurprd04.prod.outlook.com (2603:10a6:102:e0::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 09:31:57 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 09:31:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d77f03e5-2484-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=DdqqDGozAQXjE5WFW4jvUXNeI9tBCZJ5pg/Ru0OtX80fZJqD6nuNPBcAanBsFlZKqcqCrxHZxnZvAQGu7JdvwbLe4i+cF3JYkITT+CPC91bqZ8wOk0p3ip2nQw+0WYJZV1J1raKCd4KuTrjRz6os6wnApRI4TEC6hMuJ4j0076NaDk2mWfwo7cLQn7x6Fct7Nfi5RZ8qF/UJnYwkD5BJ7NvhXGpAVlvMcCfwaiEJPMwqAfhMeTRv8fm0T7k++G4+rOx0Bp6mBa7R0I+5V+sAMm1pBjA6tcmL2JUen7+lca2NoCkkWZ4PpDf97QnPcOHAaKimIrqawego+roumNjWEg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ESRPs0bkbLM+33DkTgz3eY0sL1zyhmQSU3RxBzzc72Q=;
 b=lBH7//3w/7xNZ8pK74RhLVg8XZeEHnYkGbC1lIUEla/vXB8lOBtCmGdZc1OT0MuXxA4r/YIYf1bCs3NDWKfPc81VPjPjPP+UN4/ZAtTn9xfeltMZ7us8q/JmzamyYdsturFcSSXM+ODUCPJrA8JxSpIZUaW2xV3sv7w0C2rs9ctB+i2dMhSY5rmKroi+G6M4MTHjOUcSdeuyiItOS255U2/dHZJhKUVSjsea5LCgl9ENvBmDsSvjxWrdq4yriTF5tVZ6qJDPB22U6nfR2DIPh6shPhO/5sod9loasJRIFSz6gB/w5+fleeaWY7Z5624ES3OqblGIpKr67N4iD7KNIQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ESRPs0bkbLM+33DkTgz3eY0sL1zyhmQSU3RxBzzc72Q=;
 b=JVTUZ1bp+ntUiXjtKLppkP5swUjcs62Kn6XupmVXp939on864+LGe21WxkFbTsOqx+A5kU59CraVDFFVpnaFKQ74C8II8woybF2MgZ7MM7k/8y202PNqzMbxxOo7kFxoMp5SJZnfJEyGYCYUDXcOojvKn2O+a7OvmNw1s6YFTkKJtzTn8pkKW5SEIh5QHvDgW9NUr6DZ9pQxCvCXX/veHop/l+Juw+OwjK/Gf8HEyHqL8T/jz8vw+Gorth6/3Mh/4QVN7NAE2jxVZFG/FYXGxh1hd4VI7p5mDhYXsw5q0y+mnta2aobnBtNQGrVlDPLHK9BV2BVp0sV+UEgQeXpNpQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <5cfda162-07a3-8a02-4511-b0578b12dbc2@suse.com>
Date: Mon, 17 Jul 2023 11:31:57 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86/HVM: adjust pIRQ calculation in hvm_inject_msi()
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Simone Ballarin <simone.ballarin@bugseng.com>,
 Gianluca Luparini <gianluca.luparini@bugseng.com>,
 Stefano Stabellini <sstabellini@kernel.org>
Content-Language: en-US
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0209.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ad::6) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB7517:EE_
X-MS-Office365-Filtering-Correlation-Id: 6071e04a-891c-4795-3a56-08db86a8aa3b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	zP0/2k87tpdrjSYuuxKyA0ejfY4vsBMqT6X1L0/4ud4RfNsRcNVzTw1tCJIiQibpZYZdGQFfRhB5XJIY6bTf5lk2aulNeWSgKopW23YFktEuv7U2XFcXUuTcL9OgVAFbdPzIt+HN9QfolI5l3UQEmB0vCoXp63xKpEGio30PDwpPRIyMOzsBTufgN4u7BKpfbGiN92g/JSPAp28UoF9LYABa9TDHfDTirkmZpYD0jI8XnFN/S4CokVTMgvxtgtpOuJoKobZfFP4xAQtLePRSdc4Hm9NGsU0XzqKe5pKdFRI7hWZDMoT0+tr2xC5KjmTIU7/PBuvU4x3XmP2DFACKOhj40WLoMR2sbHWOj9AgK7QUFRAWBzzguPYh3u7R32LGYa8y8ICYc4ZES9DNmK/PDzLaxGt2ZPixEodo+2dQWwa2DoKCEeru2q/R0zBCfEDt0aJjoiWN5fyyuP9mIg2yliRvONhyrCUrZK21Bip1Yu0i1afrWHFJMmF0MXaJe09eaBvnxxBkMTnkECPbf7R3M5iXa1EsSYNjf6Y5wrbuiY+YnbdT08pDHvu2XblFgtF65p/wmhluF3TfRVDJzc8rGUulJR5KDWwdYzZcb/9RIT7cRPZFpX6zpSh0mx6zElSFoXJI/dEO5s7XufR03Yxthw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(346002)(396003)(136003)(39860400002)(451199021)(2616005)(31686004)(478600001)(186003)(83380400001)(26005)(6506007)(6512007)(4326008)(41300700001)(8676002)(8936002)(6916009)(2906002)(4744005)(86362001)(316002)(6486002)(31696002)(66476007)(36756003)(38100700002)(54906003)(66556008)(5660300002)(66946007)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Y1JxdGsrbTVmSGZkcW5SK0Fpd2JjQUt4UG1jOVBWRnNVNlMyYk5LalQ3Rzgv?=
 =?utf-8?B?TVM5YkpGYXFkalBSK3FwenE2Wit0akdjT3RBQ2lXeWJYREI0U0Vwc1hieXNq?=
 =?utf-8?B?Yk84aUpGaUEwaEJNYy9Zd3prVkVpajZjdDlNWFU5dEtSK1ZzM1VoeENYNHFO?=
 =?utf-8?B?dlhENHl4RitVMnNwaHBhQWR5Mmp2RTVUZForL0xJdGZNamhFUGxyeHkxTXNq?=
 =?utf-8?B?U01SdDZ6dWI0V3d6MHo5VkE1d3BtRXlob2JtUHE3VWtGNzZCM0NuODRtbExu?=
 =?utf-8?B?YzZyRUZ3NzVXWm5jNDZuaHlaVml5M0kxUnpXa25SR3FxY2lwbFpSL3lZVkQ4?=
 =?utf-8?B?Zk5kOC96MTdKSmplZHFmSTRTalZzVmdaa3lJZnZxMFZZTEM2d0Q3L0RTUmdj?=
 =?utf-8?B?bXRYcnZmZWFub3BHWHpRcWw4MmlSSFo1Um1QYzZhMXhIaGx0UE9ub28xdG81?=
 =?utf-8?B?eEhpT1ZraFo0TTF0dlMzS2dDK2pVSERLektWWkh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B?dlAveSsvQjJhbVZsWVpXVmZyMVJydEtTcS8wcGQ2UEw1WkQwb2JORjNuOThJ?=
 =?utf-8?B?WmxwSzFLYVhUYngySXc3eGlhVGJWSlhvamtET3JBclZUcnJTbUdsNGtucldN?=
 =?utf-8?B?OTZvYzRGL0JjZTJBRDJNS3llWnFYbDhIZ2lxQXdZQlhlNHlEMzNVbzd3SlFQ?=
 =?utf-8?B?cU5rbEgzZjloaExVSGUvUCtObEI2SzdTdmp5N052ZUo2UncvRmw5bVNid3BK?=
 =?utf-8?B?eS9wRHRXN0VOSGhMOHZ2bDhlZDh2SUN5Q0JxakdUZXVVY2gvblJTaGVYTkNk?=
 =?utf-8?B?WThTOTNsY0gzeWp6aGcrTnR1NU4rbVNyUHZjTVJSQlpreFRzV3hXM0YwOTdY?=
 =?utf-8?B?YktuakFTSkxwTkdkamJBaUsxRHdMZnlKTDJXcWxSU3N0TThzM0xmQXBtQTV0?=
 =?utf-8?B?bFpDMEppajE2SUlWL0M4OTZwTHI0R2VRa0ZsTGsybjBkSVZ0NFg2WHd3Z3lY?=
 =?utf-8?B?TnNMRnBDVzVveHMrcDJUL05kZG9PSzBGNHRzSzJmTVRCTm1YVjNnRWJoeVBy?=
 =?utf-8?B?QWwvS0NINjNLTThRNi80WVFVMEpnTllVOERoZ2Fxcmg5UzFVTWFyYkhiY2po?=
 =?utf-8?B?OHlWUjhKZ1pFdXJ1b0xiSlZNOEc5K2ppbDFabnFNdDM2TkJYUjkwMVBUcml3?=
 =?utf-8?B?V0JjK01vYUlVclNHNXdJWlIvMVNpLzFWMXhjdU94cjFUK3NsYnlQQm93MVF2?=
 =?utf-8?Q?dvHhxew3YvPxxs4B6bvwPqQ8N?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6071e04a-891c-4795-3a56-08db86a8aa3b
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 09:31:57.2703
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ylR0RY9BKMKLqPV95UR9UQaRjQJgo55uBLMqD5KI/5ugVQGTUeULb/XfGehOJJUBr9XKjtoZF58YoFL6cHvMmw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7517

While the referenced commit came without any update to the public header
(which doesn't clarify how the upper address bits are used), the
intention looks to have been that bits 12..19 and 40..63 form the pIRQ.
Negative values simply make no sense, and pirq_info() also generally
wants invoking with an unsigned (and not just positive) value.

Since the line was pointed out by Eclair, address Misra rule 7.2 at the
same time, by adding the missing U suffix.

Fixes: 88fccdd11ca0 ("xen: event channel remapping for emulated MSIs")
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -383,7 +383,7 @@ int hvm_inject_msi(struct domain *d, uin
 
     if ( !vector )
     {
-        int pirq = ((addr >> 32) & 0xffffff00) | dest;
+        unsigned int pirq = ((addr >> 32) & 0xffffff00U) | dest;
 
         if ( pirq > 0 )
         {


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 09:44:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 09:44:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564340.881794 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLKls-0005gf-KG; Mon, 17 Jul 2023 09:44:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564340.881794; Mon, 17 Jul 2023 09:44:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLKls-0005gY-Fy; Mon, 17 Jul 2023 09:44:00 +0000
Received: by outflank-mailman (input) for mailman id 564340;
 Mon, 17 Jul 2023 09:43:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLKlr-0005gS-Dj
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 09:43:59 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2078.outbound.protection.outlook.com [40.107.7.78])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 73a69dfd-2486-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 11:43:58 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM0PR04MB6916.eurprd04.prod.outlook.com (2603:10a6:208:185::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 09:43:28 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 09:43:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 73a69dfd-2486-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=MmKEmda/RnE6S7CzNwixU458Dds0wbfHiRMjAT1ZBPGNFe7fiMwPCozK8Ru17ogj59ZzG3vQ7ktfJIgkMucksoWALzpps/iQLz67jdLbTd0HbYnScEKQK+sMlCo4LGj/fX06DOEBTDNFeo9tb/4arhd9QUvKxtDPQzny+k7q+78ohg1pq+ZsHdBUOoRLgPwLouZVLvghEFFdSqLidpnVJPzpSvkjsR1UL12VJwfBuX1d3+Cpl5K43BHXeIxfRvYERXYZcaCev9d/Jn9k2Dj9VjUnCpq4mqw0ahMzBATKx8BdceN1knUFUVJWDn2VzYoCFfwYw8pI34kV6Q/HlM41+Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7qEj9eXO7lsrKeTJfCmJD/7oAg8dzzkd/vp3P4GDAS0=;
 b=mxR5AKqKd7IvBTu8neEgRsWyH5jCPm8xiZebqlEzF+5ezT0AQAqKAko/eSb0WdeLMC6Did7W329JYaXGqwzDR1InlHJ536+LFZTAq++x54EF7NSIxAdLkkUuCh+SyXIFUMBBF8NQKUCSS8f9J+mdN4uypppO9i/SQIwzlMtECxVAs93t8Y98VYcB2WAXxmI72q/66Z9tqxEqfEb9qGGdDZ/mZG42cbBPXTKwazWkJ3DGz5sylZtHHCUBOdAGtqN7pFboMcCXfMwbu7YddM/7ak90zzgXklyJuu6td2dE69vFmrHCfyz5UZKD5LaGuXvDt6w+atFKrvZ3blhJDw92PA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7qEj9eXO7lsrKeTJfCmJD/7oAg8dzzkd/vp3P4GDAS0=;
 b=msZebKGH2sUYbJ8+1vMB00JM8i/tN1QhuO94VzoiN147g4lMPipz9LdbJP0M/dg2c/kQaY6f7EVW5I7iyJGyTQlBKI0WfCkHpiN3m90ZSTwVV8oHTjxgbr/djbvawBVMs7hHrhx5lyxaZAp01ZN/+4xk8OUJcwEKdGTl+MZUQklESyKqQE0uNhiHmSy81GqU72gLR/BQ6a7Jurm25+cNHNJMMZNRCXkxmV/wxDBHuykLQOBxzqDGaKOLoxp/1lQR6T2YKKtyg/JBht6bs1UqKxlgYoBuJxbnqpwFBoMyVhXP+LdwU/9Px/2fm8XF3GoA2PvrXXelvdOGM95G6I2HUg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <93646ba2-ca84-755d-290b-d7470827ef46@suse.com>
Date: Mon, 17 Jul 2023 11:43:28 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86/ACPI: correct off-by-1 in SGI MMCFG check
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Simone Ballarin <simone.ballarin@bugseng.com>,
 Gianluca Luparini <gianluca.luparini@bugseng.com>,
 Stefano Stabellini <sstabellini@kernel.org>
Content-Language: en-US
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0121.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:97::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM0PR04MB6916:EE_
X-MS-Office365-Filtering-Correlation-Id: b2ba0480-5a72-4694-680d-08db86aa4638
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	nw/PQgzl7t1Hykb7mI2wPA0SpBMkh/dbzIzW6nRubT/5ESINe6JUbzTxwXeBY1hSjKwfE+s8Lna1Shfgs+qksBL1Zjpj97LafLqb4ZHz6sg7WD1ftFolt8yq+ABY63YIEagZ58lLyFFXCQKHVlB132ylhdhswF2RkLzwd/M8Y4J9QLW4XEy79HEA83CMJcXXeIeTzNLKBreEIFg1lYt1gdfI5wvX839ne7Ne6kzO4I4Rp2KZIvqHTVLjMdKtcHRUsi0bUt//EIH2j/c2tBbwPuNJQklZTPTO7g4/EuRchZ/YybOdjffNhQe+1If8HBEUKqvnnY7uiYspKunbIQRoDp3ZyTIDQyOXSWhQcx2Q3sl72GgYuvddcmEVGnHb2bjIi7xAYsZtaKM+U4xCmgT7tKze5SIC3LkprdegTSU4vUHxMj3J3YXREwmUex8eft8vizEIr/ey6YKNgmggfeUDCrjTPZjizXQ8FJqWI/zTQXx1rySpERHkNxmy4uZ2MvhQ8M3BZPcfkdkMTNoDY/1suluqA+GDgYY3MWyowLezFCi5F2ICT1kWQdiQbCeCe0DL3ETG9h+tUeJIQPpFaWzEjpNEIUpDoahiJ+Vqja336B5ZTy6JwmEEAZO6T2kHzOGJEg6l/2KokwQlgieDJUM92A==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(39860400002)(376002)(366004)(396003)(136003)(451199021)(31686004)(478600001)(6486002)(54906003)(31696002)(86362001)(2906002)(36756003)(186003)(6506007)(2616005)(26005)(6512007)(316002)(38100700002)(66556008)(4326008)(6916009)(66946007)(66476007)(41300700001)(8676002)(8936002)(5660300002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bUtPUlVYZjFoU0VyOFRQeXRRdWxqZnpDN1J4K1dwSFZOVXZKR0NDNHBtNkJP?=
 =?utf-8?B?Yk9wRWdWOEFoWVJGUTNzRkl5NzBjWmNmYzhaWWJkbXU1SjA3dnVoWWNNcjFk?=
 =?utf-8?B?N3RnaDdRblU2d1IxVld6MDFMbER5NEFGdjFOMWJNZ1dsMEh0TTRrZEdoWWlL?=
 =?utf-8?B?enhXZzc4VlpleDVDUjVkRDJzQXhweDVuUS9IbURwclZJSlZhV1ZNd3VtSjVo?=
 =?utf-8?B?WWtIVE5JejQ3bE9XUDJ1QjVRZHJyQ3JIVHRoVkhac3RtRXpKYzBkdTE4Y215?=
 =?utf-8?B?Z2VYUHk1QnJqcWZzOU5xMmhPdWdadE9zbzdYbldxeHlEczlpb1kzNEtIRm54?=
 =?utf-8?B?bGFHREVQYjZFcGtZM0E3NjRmeGY0UmpBTkJLM09uYWtJbHdrUkN0dE1YUDh0?=
 =?utf-8?B?RStqZWtKTFFtMFM1NEdxaFdjNEE5RTBNWTcxeFQ2dWFiT0hJSGkwRGo2Tng3?=
 =?utf-8?B?ZER6cTg2R1dxV3pnT2Jacko2bUIvVVVjb1pLU2NucmtVRTJUbzNj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VBKy82NUxWUmwzQ080NEVIYUU1bFY3N0RxZVMxaHUrUjRsZXlvT0xN?=
 =?utf-8?B?Z0JnaXNUZ1B4a1lwd2pYZGU3cWswT3lmQWlnUDRHTkppQUF6eDVrRmVlQlRY?=
 =?utf-8?B?UFQrSXZ4Y3dVMWN4WnQrNHNjVmNBdWJwUGpTUWlvQWgxL3VsK1c1T05Ldm5G?=
 =?utf-8?B?WTE0a0pEUW1tRzRsUFFwTExmYjZHYm1aM0pNcnd0azVDZW9UMmU1SGVOc2d6?=
 =?utf-8?B?K3E5K2p3NlNnaHVmRTRZbE15N1RxRXU0bENmQ291THl5MSs3eGdzMTNwbVFr?=
 =?utf-8?B?cCs4UzBWUTVYR05QSDlGUW91eXA4azBzUzJaeEZNODVoOUNKZm00MnBUSTI0?=
 =?utf-8?B?Y3dLZDA3SWxuektidEY4UmJtL3loMm05NFF1SC9MTjdTVnpTOUF3MTR2VHYz?=
 =?utf-8?B?OGkvbmgvRkUrZEI5d1NxQjF2UlBpUVJySGdHMjgxWWFlV3ExaWlUWUpaSXRL?=
 =?utf-8?B?eU1oN21pbGk4clJTeUNQYjdaMjBhbjRTZDBLMEJXYi96Z1V2aTVRbDJhQ2w0?=
 =?utf-8?B?Nzd1eW5GOG5mdXVOa09nSUx1RGYxM3lPZ1IyeWNlaU5mM2hLZmxxcHJLcmJj?=
 =?utf-8?B?dEx2K1hWUFNoSjJKbmFGZ09MbmRkcytZaXhTQnVISjBKbjduUXNUcndLYTl6?=
 =?utf-8?B?bUE4dUJFMXVDQmlMWjlaNndlaXczYXJBMEpydCtrL0lCRmR1ckhvUXJvNE1h?=
 =?utf-8?Q?PWTkdCF6fYHCZFjulrriIsNtj?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b2ba0480-5a72-4694-680d-08db86aa4638
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 09:43:28.4625
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: CnC+ck1CyM0JSMEfYfiEI0Sm1ObkEsrNoozls7f7ptkc5x35U1pENLqKclfIT2PzX7spogIkppCgKS2RL+rj3w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6916

As supported by the printk() (deliberately made visible in context by
also correcting a mis-indented return statement), "above 4GiB" is meant
here. Avoid comparison with a constant to "escape" Misra rule 7.2
complaints. (Note however that even up-to-date Linux, which is where we
"inherited" this code from, still uses the very same off-by-1 check.)

Fixes: 94ea0622c5b8 ("x86-64/mmcfg: relax base address restriction")
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_64/acpi_mmcfg.c
+++ b/xen/arch/x86/x86_64/acpi_mmcfg.c
@@ -50,7 +50,7 @@ static int __init acpi_mcfg_check_entry(
 {
     int year;
 
-    if (cfg->address < 0xFFFFFFFF)
+    if (cfg->address == (uint32_t)cfg->address)
         return 0;
 
     if (!strncmp(mcfg->header.oem_id, "SGI", 3))
@@ -59,7 +59,7 @@ static int __init acpi_mcfg_check_entry(
     if (mcfg->header.revision >= 1 &&
         dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL) &&
         year >= 2010)
-            return 0;
+        return 0;
 
     printk(KERN_ERR "MCFG region for %04x:%02x-%02x at %#"PRIx64
                     " (above 4GB) ignored\n",


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 09:52:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 09:52:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564344.881803 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLKtV-0007D6-BV; Mon, 17 Jul 2023 09:51:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564344.881803; Mon, 17 Jul 2023 09:51:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLKtV-0007Cz-8L; Mon, 17 Jul 2023 09:51:53 +0000
Received: by outflank-mailman (input) for mailman id 564344;
 Mon, 17 Jul 2023 09:51:51 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLKtT-0007Cp-Km; Mon, 17 Jul 2023 09:51:51 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLKtT-0000Dx-EU; Mon, 17 Jul 2023 09:51:51 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLKtS-0005y8-PN; Mon, 17 Jul 2023 09:51:50 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLKtS-0001el-Os; Mon, 17 Jul 2023 09:51:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=KiOMA7X/pOiXLvGyzTACUC9qIIyQud2p1YSPfw9HiWo=; b=DBaPH5ugbUxINY1CeQj2tgLgdJ
	32V27Rx4W/Mp5G/922KS3fDi/SA1JVf5FOl3XRCMwR6B3tedkL0aZJoxEThm0P3oH0RyrYlwZ0YD5
	hLrPnwaI3j/Sfc0OZjLS/AFxmFNlqkACjYknMHhRt24qm8ulPcpYM24FiTCQ0mbjLRLo=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181808-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 181808: regressions - FAIL
X-Osstest-Failures:
    libvirt:test-amd64-i386-libvirt-pair:xen-install/src_host:fail:regression
    libvirt:test-amd64-i386-libvirt-pair:xen-install/dst_host:fail:regression
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=36b247b908e50534a8450909f87bb3f0216a9ff7
X-Osstest-Versions-That:
    libvirt=14026db9b0e25739ea30685bd643ff23aca30588
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 17 Jul 2023 09:51:50 +0000

flight 181808 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181808/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-libvirt-pair 10 xen-install/src_host     fail REGR. vs. 181789
 test-amd64-i386-libvirt-pair 11 xen-install/dst_host     fail REGR. vs. 181789

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt   16 saverestore-support-check fail blocked in 181789
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181789
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181789
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 libvirt              36b247b908e50534a8450909f87bb3f0216a9ff7
baseline version:
 libvirt              14026db9b0e25739ea30685bd643ff23aca30588

Last test of basis   181789  2023-07-14 04:21:56 Z    3 days
Testing same since   181808  2023-07-15 04:18:52 Z    2 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Tim Small <tim@seoss.co.uk>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 fail    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 36b247b908e50534a8450909f87bb3f0216a9ff7
Author: Tim Small <tim@seoss.co.uk>
Date:   Thu Jul 13 12:00:04 2023 +0100

    docs: Reword ninja invocation note to clarify build directory
    
    Minor rewording to clarify purpose of the -C flag in the ninja
    invocation, whilst retaining previous meaning.
    
    Signed-off-by: Tim Small <tim@seoss.co.uk>
    Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

commit ef7228f5ca22c7ebb47d40ce87b8c4817fd28c7c
Author: Tim Small <tim@seoss.co.uk>
Date:   Thu Jul 13 12:00:03 2023 +0100

    docs: Fix deprecated use of implicit meson "setup" command
    
    Use the explicit meson "setup" command instead of the deprecated
    implicit invocation. The implied setup usage generates a warning with
    meson version 1.0.1:
    
    WARNING: Running the setup command as `meson [options]` instead of
    `meson setup [options]` is ambiguous and deprecated.
    
    Additionally the implicit command is likely to be confusing to those
    unfamiliar with Meson - the `build` argument in `meson build` resembles
    an action rather than an arbitrary path.
    
    Signed-off-by: Tim Small <tim@seoss.co.uk>
    Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

commit 4d50cd23c91c54996ba78f424811e0570ed7cb91
Author: Tim Small <tim@seoss.co.uk>
Date:   Thu Jul 13 12:00:02 2023 +0100

    docs: Point to mailing list archives from submitting-patches
    
    Suggest that new contributors should review past patch submissions for
    typical style, feedback etc. prior to submitting. Link to archives.
    
    Signed-off-by: Tim Small <tim@seoss.co.uk>
    Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

commit 7160215146c9b3085a40e3923ab895644de3a645
Author: Tim Small <tim@seoss.co.uk>
Date:   Thu Jul 13 12:00:01 2023 +0100

    docs: Advise running CI tests prior to submission
    
    In the preparing patches section, note that it is possible to run CI
    tests via gitlab prior to submitting patches.
    
    Signed-off-by: Tim Small <tim@seoss.co.uk>
    Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

commit 941fc36f114e6581425310462bd148b924d99495
Author: Tim Small <tim@seoss.co.uk>
Date:   Thu Jul 13 12:00:00 2023 +0100

    docs: Reword "Preparing Patches" to clarify
    
    Clarify that patches should apply cleanly to the master branch. Give
    guidance for typical bug fix process for existing releases.
    
    Signed-off-by: Tim Small <tim@seoss.co.uk>
    Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

commit 3da8d8b5b1c48ae780d0ae76cec9a432e2cc6d39
Author: Tim Small <tim@seoss.co.uk>
Date:   Thu Jul 13 11:59:59 2023 +0100

    docs: Add config instructions for clangd with libvirt
    
    In build environments which use gcc as the default compiler, use of the
    clangd LSP server (for enhanced code editing and navigation etc.) with
    libvirt requires some additional configuration.  Detail this and link
    from `hacking.rst`.
    
    Signed-off-by: Tim Small <tim@seoss.co.uk>
    Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

commit 401a6171a3ea80c3f00e25b78132a4346c346e68
Author: Tim Small <tim@seoss.co.uk>
Date:   Thu Jul 13 11:59:58 2023 +0100

    docs: Point to compiling guide from code contribution guide
    
    The "hacking" doc details where to find the code, but not how to compile
    it - link to the instructions contained in `compiling.rst`.
    
    Signed-off-by: Tim Small <tim@seoss.co.uk>
    Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

commit 721897086254850c9fd1cf762695d265fc30e4b8
Author: Tim Small <tim@seoss.co.uk>
Date:   Thu Jul 13 11:59:57 2023 +0100

    docs: Link main "contributing" from programming-specific guide
    
    There are two guides to contributing: `hacking.rst` is focused on code
    contributions, and `contributing.rst` is more general. Clarify scope of
    `hacking.rst` and link to the general guide in its references.
    
    Signed-off-by: Tim Small <tim@seoss.co.uk>
    Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

commit 225f6de45fc0520d7a4e1037419ab85c97ffe2c4
Author: Tim Small <tim@seoss.co.uk>
Date:   Thu Jul 13 11:59:56 2023 +0100

    docs: Missing "full-stop"/"period" on some bullet items
    
    Signed-off-by: Tim Small <tim@seoss.co.uk>
    Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

commit cccf129c2d253fdb8f49cb89d4442dd019a482a3
Author: Tim Small <tim@seoss.co.uk>
Date:   Thu Jul 13 11:59:55 2023 +0100

    docs: Link to main docs directory from Quick Links
    
    Whilst the "docs" documentation map is linked in the navigation bar,
    users may scroll down and lose sight of this, so also place at the
    bottom of the "Quick Links" section.
    
    Signed-off-by: Tim Small <tim@seoss.co.uk>
    Reviewed-by: Michal Privoznik <mprivozn@redhat.com>


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 10:17:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 10:17:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564356.881816 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLLHZ-0001qE-9z; Mon, 17 Jul 2023 10:16:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564356.881816; Mon, 17 Jul 2023 10:16:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLLHZ-0001q7-7F; Mon, 17 Jul 2023 10:16:45 +0000
Received: by outflank-mailman (input) for mailman id 564356;
 Mon, 17 Jul 2023 10:16:44 +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
 <SRS0=RVQe=DD=citrix.com=prvs=555fa4c0e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qLLHY-0001q1-2x
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 10:16:44 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 045fa6fb-248b-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 12:16:40 +0200 (CEST)
Received: from mail-dm6nam10lp2107.outbound.protection.outlook.com (HELO
 NAM10-DM6-obe.outbound.protection.outlook.com) ([104.47.58.107])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 17 Jul 2023 06:16:33 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by CO1PR03MB5857.namprd03.prod.outlook.com (2603:10b6:303:90::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 10:16:31 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 10:16:30 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 045fa6fb-248b-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689589000;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=FKIdwi7Mznb5kJhfPdGX/6j5F60Vc18pRJIq8/EP2KY=;
  b=dSfKiYK0NjwdqI80ArIKUJK2ECVlLAKa1zdoItSW5ulJZhKNFf19p1cC
   R0S35DF20BWVN1ssCzz+QjSBSbHifY+sPfKp3GFUgD2ub6z4sA2W8l8hS
   QrNT3mfl7D/+JeucCxwWBL5nfOaC4YoX+RwoWhlPXTrVTRrP4AR7qMKFH
   g=;
X-IronPort-RemoteIP: 104.47.58.107
X-IronPort-MID: 115734601
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:QAd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oexq1n/NICOIqTNSftWfdyQ6VBbAnwYz+wyDxXw3Sn9QtsZ
 uIqpIOauHNMQ==
X-Talos-CUID: =?us-ascii?q?9a23=3AUPHKXmpTqzbyi/XXF9lYiQzmUftiXz6DzFfOGGG?=
 =?us-ascii?q?XFnQzTKKJbUCKu6wxxg=3D=3D?=
X-Talos-MUID: 9a23:1dorngnLLVmYPyS4N387dnpHBuVS872zBXwOgJcIl+6tFRQrGh2k2WE=
X-IronPort-AV: E=Sophos;i="6.01,211,1684814400"; 
   d="scan'208";a="115734601"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=MPprn5MzpuBvE00G+VXisfHhKGXpTJwMgAqkMGWfbTZkwwmfQtYTe2+7JLBECSziAfPe1tTZYjK6ziWMHZcKp1OSSYdZlZiz6rjT0UGM1wE4s7ym2/ZOEk3IjkR+u2AGA0ntDLoE178HFDN1zDMoyzTSyoTdWMLrcQh4crGj72pWyFriZFBdd4hZCu28lq+ZNrkV/DnWA6C1Sv1b+GNkgBhIdrW7nR6u+I6BV/oQtnnCu1euNTC8FYZkr3NX0n+IiO0n7V0RfZIuYMPLRhX2nlODOWmTFQVwtbKUTAo2QtSYzEaYobOSBadZM/7uJWDClAabD4mxtjNMbuH9U8gArQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=bAPNmYDbUikkdB1HPtR4tT6fJefwLIm8/v7oqFdwqCo=;
 b=QOk/KoE7y36VYOLgwtGWL3TPaUeQix7IhYeC1q2I2AtBTIgKeiLybrTieBudC333DvaqFXw30ac6ggW3ripF2mhmIfWcIA9KAQt8G+G7d3sfJDyo2pHGGCNE1Iqo0BF89CkxlAQGylKElM/+3kFf7vpIfy4pG0m0yvERLJe5MRdgrQZ/p6P2S4zerutAhfhAwzS0tJ+ZU1NV+H1LUD3vaMNzep0Tv5zRLYSkfu2K/ynNmDcKMD4/uGaCsqrhJdmsRCkUpAxUUZgJfFIqASloSmKW40CXZhcIW+AHChNhiX1tHRj2C1ncjl8FK3A7q0SNLgmZ25rb9hNks15zwsbAdQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=bAPNmYDbUikkdB1HPtR4tT6fJefwLIm8/v7oqFdwqCo=;
 b=ghmeNu9lbLIoNS0Y/fYUcHBRVXmrCtY/7J8GAD+W/XMX2VAZBMVAg/vrC8uCoTVS7tSG8F5kENGiAOqElzW0Y2vpVVVhVB9ZVoMYivn6WusezzAgutFKefePl7wvIhAOijOMb2ZOpOXYX95S89cHOLudYjD9uiCleNgMgjqkwO4=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Mon, 17 Jul 2023 12:16:24 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH] x86/ACPI: correct off-by-1 in SGI MMCFG check
Message-ID: <ZLUU-EGVwWDcejv6@MacBook-Air-de-Roger.local>
References: <93646ba2-ca84-755d-290b-d7470827ef46@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <93646ba2-ca84-755d-290b-d7470827ef46@suse.com>
X-ClientProxiedBy: LO4P123CA0500.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1ab::19) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|CO1PR03MB5857:EE_
X-MS-Office365-Filtering-Correlation-Id: ad6fb422-08d3-492d-684b-08db86aee391
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	VeucMVMMorJMPeBaIx4T/Hn2MLBH6zmpoRrnGw7nKhNhKLafjzRtwR175x1TyAmE9HL2BXYf/gWQrFXLwzkL4o1b0IeZxhRdV2veaiupMddPARaS05P5rY95Dz/3uUmSH2eSW6QGmWBeThbVfdQwuxFnBFCeUkCyHG7Vftg1saaB03bFBsxNFjs798nO7cW3Mns0grt3EpZeuWZBraC417+Xl9CU5EiI3mitdqMbJUtmpgckoSvg24e6LHPvjIJL3OEuDXRf7oLTbGqnmZpwRTFnKvYjSmF51avWMNr1uartB70cYpuayCR472uyO6mc5r3V4rfjBJ+HntvBBsuqI6g44tHCugHO1kgkT2UNVFvxIV3JrJlSSREg7JDhyx7o3JnZEgVzz0fBVzjsucPMyACnHirLWjpHUSliZ6k42hfn0xrrEaOUvye+Gk3othVoJ+ydEV2axE5x2dZMY51Dcuq77wUN2Hy8kA5v6WNLZ64p3mngA+ym5c8x00uLnROXIHwV+oxAt5oNP7NAi806fxH750Whmp+Ju0o9nhn/gJ69OlpEx3UJLFr+ZrSycayK
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(376002)(366004)(39860400002)(346002)(451199021)(54906003)(82960400001)(38100700002)(6666004)(6486002)(41300700001)(478600001)(5660300002)(8676002)(8936002)(66946007)(66556008)(66476007)(6916009)(316002)(4326008)(186003)(6512007)(9686003)(6506007)(26005)(86362001)(85182001)(4744005)(2906002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dUlnd0ZKRTkwNFE5WjRFdUN4MTcxVHpLZ1pWSjhkV2ZnWmZLTjB1Zm5NQU8x?=
 =?utf-8?B?SEd6UHdBSFNKdUplZVVsakZOL2pDc0hYZUNXWmM3SkNlaHpLWEtYMWIrdFM5?=
 =?utf-8?B?NWFmeFNuZUljRzJhaDZ2cER0VFJxUmtQQm1UNkcrcktsOS9DaUVrLzl1OEhO?=
 =?utf-8?B?STFJRHNzNnkvYkNxMy9iRTdyazM2YU4vSGJQMTFMenZ6ZXpLL1kyamZYdGZK?=
 =?utf-8?B?clF3b1Vyd2Q3RGd0aENlTGhRekJxeVJMME9GQUdrWGFnWk5TZDBhdG9WamhV?=
 =?utf-8?B?ZlVPOHY5Y2JYYjVhTUorYmVxVWpOWE5SVy91Z0xkVjVqcEZBdXl5dUJ5R2x3?=
 =?utf-8?B?Qk1YaXdxN0pjSStRN2NiYmUwRTk0OU9sUGs3VWNHL0wxb1BGSWlKQU8wQkRu?=
 =?utf-8?B?UEhlekRkVklBUjFFazNkeUcvdVY5bmNVUGd4alFPL3VIMm16UzAyTWNvVm0r?=
 =?utf-8?B?SGdNYmZXQWd5VFhkRzB5QUxjeGVCRDV3ZUJvMjlmd1FBTjB5dzRrZFFjd3B6?=
 =?utf-8?B?dVhieDlRVzlISjRjSVFzbWlNa25HS1U4MnR6RUQ2Nk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0jjqffDie5cCFoMvdEuLeNfT6vxfel9SKKtoLmzpWmjNwsLTtO7rmCIzwSnS0AcYIxPb3lT2+kqBbN+zVR0tcIW3SUKsgVjn3JG4OE3XxRntSG8e76sLzI/DlUTwi0tsUIl1soXsaGXTT9Dc+GLNCP6CxREzbWYfAlL8oapbY7GyO0/YlR2qAZn36HV07V8KaVD0WzErJ5je6/lIza5c75ktHD7CTuC33EAfsrWFomr13FQEO6k5IIS9WzJKLCZgAOJ/zHbNPwMI3sAaQgdnVITVxuF61Cq9qDQDejJAbG+ReYzeTMY7TuoFT27m4hSz7mIZL8QtixStl/l0R8Dc750hfoj472RkUtYDl731aLKWiBuPDeHnfTNXRsDrVjQ61R9MJ6R5XHoS7eAKzKOpTQR4QvBHJUpBG7n+Rk8vqrid1jx6TcOBL2KKyeoPM7aE0nGkNJTLFPDFnvTdd5urZGpFG+4e9tU1yu5dPB5GE7r49yq8VF63kjs+cszvtuP3tpCn+ZPdzrg63sE0QEktulgVYL4ycdfPAmIRyBc4cYDlRBLpgG2QR6a3qraPvakvRTDCsy33QXKgxcSLQoezTdSDxyJV1AIN9bfoTpLIykknfY/qro7AUMsgiLJ5LLpNP/yUnPXcEbG+cS2lDz0wabED9g3aNh5pY2YwSzpxAvGK/V+zAfrNuYv+3TXqvka6P2fX1EvqakBQWuwdiX8pwBL17RLQmPgcQKN1vEz6gMswqbHm5iBC66Ofo7
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ad6fb422-08d3-492d-684b-08db86aee391
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 10:16:30.5026
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: w8vLJel/0/9a9vqKd3JPjP2rjZBjNYze5nqelgO10NhIV5gpzgwYTYBGKwwWflzN38ofuvox1st7SQrZPttQJg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR03MB5857

On Mon, Jul 17, 2023 at 11:43:28AM +0200, Jan Beulich wrote:
> As supported by the printk() (deliberately made visible in context by
> also correcting a mis-indented return statement), "above 4GiB" is meant
> here. Avoid comparison with a constant to "escape" Misra rule 7.2
> complaints. (Note however that even up-to-date Linux, which is where we
> "inherited" this code from, still uses the very same off-by-1 check.)
> 
> Fixes: 94ea0622c5b8 ("x86-64/mmcfg: relax base address restriction")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

Albeit I wonder how relevant those checks are anymore, TBH I would be
quite tempted to just drop all this.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 10:17:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 10:17:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564361.881827 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLLII-0002Ry-MT; Mon, 17 Jul 2023 10:17:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564361.881827; Mon, 17 Jul 2023 10:17:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLLII-0002Rp-J2; Mon, 17 Jul 2023 10:17:30 +0000
Received: by outflank-mailman (input) for mailman id 564361;
 Mon, 17 Jul 2023 10:17:29 +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 <SRS0=kNtj=DD=tesarici.cz=petr@srs-se1.protection.inumbo.net>)
 id 1qLLIG-0001q1-RF
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 10:17:29 +0000
Received: from bee.tesarici.cz (bee.tesarici.cz [2a03:3b40:fe:2d4::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2028e580-248b-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 12:17:27 +0200 (CEST)
Received: from meshulam.tesarici.cz
 (dynamic-2a00-1028-83b8-1e7a-4427-cc85-6706-c595.ipv6.o2.cz
 [IPv6:2a00:1028:83b8:1e7a:4427:cc85:6706:c595])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (No client certificate requested)
 by bee.tesarici.cz (Postfix) with ESMTPSA id 1B5DF163314;
 Mon, 17 Jul 2023 12:17:22 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2028e580-248b-11ee-8611-37d641c3527e
Authentication-Results: mail.tesarici.cz; dmarc=fail (p=none dis=none) header.from=tesarici.cz
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tesarici.cz; s=mail;
	t=1689589042; bh=Bm0Hy13+JRi9NMlimeswrt8XBhWxLQOI9N21AQMkbyk=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
	b=GQN14zd3XNWnsUCpxj8CAfDRLfHO3yKbIYH4Z1tY2NuUyB/tEAWXePMgXHClGElXV
	 iclkVMk4nMw7f2dCGMBhAdc3436jIvQ3z8yKAco9Yv+innFM08daK23nD+0JAcJW+d
	 SeEwDCP0ntZA0tOgBwjdzE+yAGotID6XvGHHT1DZyU/IAvL5pRZTbpVCELUjsw0pmk
	 Fjduj/nTRd+WS55sOgt6m/O0blal5FJ8IM4Ma27TYBebyldrBxV45Rul1vue8rpAcD
	 H03pbEhB1HqGfsRaZngbNzSDrUmBPA32acEzxYcaaIy38C9WCKNmg+OPDUsAVC/MnK
	 KgQwEGVvlDo6Q==
Date: Mon, 17 Jul 2023 12:17:20 +0200
From: Petr =?UTF-8?B?VGVzYcWZw61r?= <petr@tesarici.cz>
To: Philippe =?UTF-8?B?TWF0aGlldS1EYXVkw6k=?= <philmd@linaro.org>
Cc: Petr Tesarik <petrtesarik@huaweicloud.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Russell King <linux@armlinux.org.uk>, Thomas
 Bogendoerfer <tsbogend@alpha.franken.de>, Thomas Gleixner
 <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov
 <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "maintainer:X86
 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>, "H. Peter Anvin"
 <hpa@zytor.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Rafael
 J. Wysocki" <rafael@kernel.org>, Juergen Gross <jgross@suse.com>, Oleksandr
 Tyshchenko <oleksandr_tyshchenko@epam.com>, Christoph Hellwig <hch@lst.de>,
 Marek Szyprowski <m.szyprowski@samsung.com>, Robin Murphy
 <robin.murphy@arm.com>, Petr Tesarik <petr.tesarik.ext@huawei.com>,
 Jonathan Corbet <corbet@lwn.net>, Andy Shevchenko
 <andriy.shevchenko@linux.intel.com>, Hans de Goede <hdegoede@redhat.com>,
 James Seo <james@equiv.tech>, James Clark <james.clark@arm.com>, Kees Cook
 <keescook@chromium.org>, "moderated list:XEN HYPERVISOR ARM"
 <xen-devel@lists.xenproject.org>, "moderated list:ARM PORT"
 <linux-arm-kernel@lists.infradead.org>, open list
 <linux-kernel@vger.kernel.org>, "open list:MIPS"
 <linux-mips@vger.kernel.org>, "open list:XEN SWIOTLB SUBSYSTEM"
 <iommu@lists.linux.dev>, Roberto Sassu <roberto.sassu@huaweicloud.com>,
 Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH v4 1/8] swiotlb: make io_tlb_default_mem local to
 swiotlb.c
Message-ID: <20230717121720.093cb1cc@meshulam.tesarici.cz>
In-Reply-To: <45f89fee-6825-3f5d-9dfb-aad5d47c8c36@linaro.org>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
	<7f64111986f4f361a2deb4a1a1b6f588e63a851b.1689261692.git.petr.tesarik.ext@huawei.com>
	<45f89fee-6825-3f5d-9dfb-aad5d47c8c36@linaro.org>
X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Mon, 17 Jul 2023 08:06:07 +0200
Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org> wrote:

> Hi Petr,
>=20
> On 13/7/23 17:23, Petr Tesarik wrote:
> > From: Petr Tesarik <petr.tesarik.ext@huawei.com>
> >=20
> > SWIOTLB implementation details should not be exposed to the rest of the
> > kernel. This will allow to make changes to the implementation without
> > modifying non-swiotlb code.
> >=20
> > To avoid breaking existing users, provide helper functions for the few
> > required fields.
> >=20
> > As a bonus, using a helper function to initialize struct device allows =
to
> > get rid of an #ifdef in driver core.
> >=20
> > Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
> > ---
> >   arch/arm/xen/mm.c          |  2 +-
> >   arch/mips/pci/pci-octeon.c |  2 +-
> >   arch/x86/kernel/pci-dma.c  |  2 +-
> >   drivers/base/core.c        |  4 +---
> >   drivers/xen/swiotlb-xen.c  |  2 +-
> >   include/linux/swiotlb.h    | 25 +++++++++++++++++++++++-
> >   kernel/dma/swiotlb.c       | 39 +++++++++++++++++++++++++++++++++++++-
> >   7 files changed, 67 insertions(+), 9 deletions(-) =20
>=20
>=20
> > diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
> > index 4e52cd5e0bdc..07216af59e93 100644
> > --- a/include/linux/swiotlb.h
> > +++ b/include/linux/swiotlb.h
> > @@ -110,7 +110,6 @@ struct io_tlb_mem {
> >   	atomic_long_t used_hiwater;
> >   #endif
> >   };
> > -extern struct io_tlb_mem io_tlb_default_mem;
> >  =20
> >   static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t =
paddr)
> >   {
> > @@ -128,13 +127,22 @@ static inline bool is_swiotlb_force_bounce(struct=
 device *dev)
> >  =20
> >   void swiotlb_init(bool addressing_limited, unsigned int flags);
> >   void __init swiotlb_exit(void);
> > +void swiotlb_dev_init(struct device *dev);
> >   size_t swiotlb_max_mapping_size(struct device *dev);
> > +bool is_swiotlb_allocated(void);
> >   bool is_swiotlb_active(struct device *dev);
> >   void __init swiotlb_adjust_size(unsigned long size);
> > +phys_addr_t default_swiotlb_start(void);
> > +phys_addr_t default_swiotlb_limit(void); =20
>=20
> Usually we use start/end, base/limit, low[est]/high[est] tuples.

I'm no big fan of start/end, because the "end" sometimes means "highest
within range" and sometimes "one past range", being responsible for an
impressive amount of off-by-one errors.

But I agree. When I decided against "end", I should have also replaced
"start" with "base". Well, this patch series will certainly see a v5,
so I'll change it there. Thanks for the suggestion!

Petr T

> Possibly clearer to rename, regardless:
> Reviewed-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org>
>=20
> > diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
> > index 2b83e3ad9dca..873b077d7e37 100644
> > --- a/kernel/dma/swiotlb.c
> > +++ b/kernel/dma/swiotlb.c =20
>=20
>=20
> > @@ -958,6 +975,26 @@ bool is_swiotlb_active(struct device *dev)
> >   }
> >   EXPORT_SYMBOL_GPL(is_swiotlb_active);
> >  =20
> > +/**
> > + * default_swiotlb_start() - get the start of the default SWIOTLB
> > + *
> > + * Get the lowest physical address used by the default software IO TLB=
 pool.
> > + */
> > +phys_addr_t default_swiotlb_start(void)
> > +{
> > +	return io_tlb_default_mem.start;
> > +}
> > +
> > +/**
> > + * default_swiotlb_limit() - get the highest address in the default SW=
IOTLB
> > + *
> > + * Get the highest physical address used by the default software IO TL=
B pool. =20
>=20
> (note you describe lowest/highest).
>=20
> > + */
> > +phys_addr_t default_swiotlb_limit(void)
> > +{
> > +	return io_tlb_default_mem.end - 1;
> > +}
> > +
> >   #ifdef CONFIG_DEBUG_FS
> >  =20
> >   static int io_tlb_used_get(void *data, u64 *val) =20
>=20



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 10:33:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 10:33:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564367.881837 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLLXw-0004vW-UJ; Mon, 17 Jul 2023 10:33:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564367.881837; Mon, 17 Jul 2023 10:33:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLLXw-0004vP-RL; Mon, 17 Jul 2023 10:33:40 +0000
Received: by outflank-mailman (input) for mailman id 564367;
 Mon, 17 Jul 2023 10:33:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=FdAb=DD=citrix.com=prvs=555bb5b00=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qLLXv-0004vJ-UA
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 10:33:39 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 62ca9183-248d-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 12:33:37 +0200 (CEST)
Received: from mail-bn8nam11lp2169.outbound.protection.outlook.com (HELO
 NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.169])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 17 Jul 2023 06:33:18 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by SA1PR03MB6531.namprd03.prod.outlook.com (2603:10b6:806:1c6::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.19; Mon, 17 Jul
 2023 10:33:16 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780%5]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 10:33:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 62ca9183-248d-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689590017;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=XYpwQigsrHqEmtwtzfASfq63tkFy2k7KiZXZw2MfmRM=;
  b=AVSjXAZIi5ISu5qesQszIPoie//dx8z8vPI3jyPY7yDfgAahznjBm0jS
   ZEv5KxpF0C6hFUT0CPU4b9f4NNXW8I4+w4OYGsRtOyZRdGsAfKLgiyWcp
   7FlRB9SRrUH2ViFX4L71/kd5hq46YYo8JqItIdUz0KyAaWZuFT84cK9z7
   E=;
X-IronPort-RemoteIP: 104.47.58.169
X-IronPort-MID: 119028554
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:nCrcA6hKR1uvKr93CkMkvi9OX161mBEKZh0ujC45NGQN5FlHY01je
 htvCmqFbKmJZzT9eIsgPomz8xlQ6MXcy4MwTwc9+CtnFHwb9cadCdqndUqhZCn6wu8v7q5Ex
 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv
 cKai8DEMRqu1iUc3lg8sspvkzsx+qyr0N8klgZmP6sT4waBzyB94K83fsldEVOpGuG4IcbiL
 wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ
 OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+
 tQBMT4IRDHYwNnm6/WfR6pVttYFHdHkadZ3VnFIlVk1DN4AaLWaGuDgw48d2z09wMdTAfzZe
 swVLyJ1awjNaAFOPVFRD48imOCvhT/0dDgwRFC9/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eE6EkOIj6SyzKQ+5emsdpBN5oA1go
 79XFRRsnN3U17yCPeJwIZA/nn2MSSAtAzWu4NjDqVCy/jBrOKBC1zGdLluqbrvnxwnOLyZZx
 7pU6gmRMMKLgPVaPJ0NkPFKt9vwEIlIb4oU+YAKiOzS/3wW/3XX8zgAYDuzenWYH8Zc1K6JE
 c/dx7OA+gFxnyXexbD8W3ssjXWCwPCwa4=
X-Talos-CUID: 9a23:UEnGXG0u35ETn5shdGqIC7xfA9krd1f8lzDrc2T/LWsqcY2Hb26I9/Yx
X-Talos-MUID: =?us-ascii?q?9a23=3AzlOzcwzCsgASQj5gkY5OOnSYyZGaqJiBNBwKsZV?=
 =?us-ascii?q?Yh/mFPBYtaheM3AyuHLZyfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,211,1684814400"; 
   d="scan'208";a="119028554"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LgDOnPvGdA7OU3Lz9meWGoSYAUVkp2fXd9DqIt/qYgwwsIDjAEE9d2GEqsH1r3IhTlA4+ub3xdtI+DfdUlW8X4s/1A29BkjFYP1mePBFIbof8jSz65JxgHY+m1UKkb/Em9TVtDyjb5THC1U/q0tO1pWBHvO/mdjQMq9ANb051olQhPez1jUvMkRcgqVr6Mq0S8k+dWxYIUKRyzXwFYX12LsQuWhOndtvCcCf0lvQmh1IHwhjZwSqxLFJya5SKXkeAwkM/k+5yZtFjv+vrs86nRcDWQoqJzu7hmi7s2Q/yVjgUBQOxo4ujMQEhDCLuc4/HGjLgwaJMif4QQFJCkF4vQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BMCAIWnR94lxNyTfBZ3Asp56scvrJYvkRyhDpqroCB0=;
 b=XEFNilYw7tacQgiYG0bAlbspT+sweD4kqGwBn1p66lS0dKwgGIrBSX2pOxg1R3B2uoxtmJOZvAHo8Vtri9cREqt9z7D2oRpoeFE4wDHBMHWhkGUYTJeZi0HhYpV331wtG2OlebG1fcYsHeriwhCW21xDRSRXlO4EBjAuWs59/GS0TzmbmH4b7S2fwWBi35iDNjQkZSt93PuW12T/VcS0ftiYKiqwA9mnNJETkbBjJM3ic8VxW0sPaQkgMIbI6b1RyFiU3TJEEI6L0Ytr42fPd0nt56xXO9PlKBLc2Nuu4VlXdBo1FsDGHQlyAoCRWzRdahojBgVQW+UJJlEeQNaOrA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BMCAIWnR94lxNyTfBZ3Asp56scvrJYvkRyhDpqroCB0=;
 b=jaqjpl2kCrY3DAkx02HhhundQuTYbH35+BDXuQ3asQZM6Ma6/ey87IXLQCEptHUkCJr1IY9ZOwzMEOJIqcaqgzc4xi2DGJKUWXkRzmhFrRLZyMhf4xUjl87hRwDKAJpwy1jnApFxdEzuj0fbkYlpS1V7jTG4jQ1n1yc7UC2gMzg=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <38707d09-92a3-2807-4bf0-167be5c3bb15@citrix.com>
Date: Mon, 17 Jul 2023 11:33:09 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH] x86: drop old (32-bit-only) MSR definitions
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Simone Ballarin <simone.ballarin@bugseng.com>,
 Gianluca Luparini <gianluca.luparini@bugseng.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <df2c3154-2e8b-194a-ec1e-472819bbf026@suse.com>
In-Reply-To: <df2c3154-2e8b-194a-ec1e-472819bbf026@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0082.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2bd::15) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|SA1PR03MB6531:EE_
X-MS-Office365-Filtering-Correlation-Id: e54d4c2b-21da-4f13-84a5-08db86b13aa7
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	H28aIJHypUgBxqAZYqejy4sjjk/Obk/N8qo6xPa8l21/Cx2PG9Fiy9uAD82WjdGOZ4A61FjKeZ8DCRYsmbm3JJsb4pZb0j7lB7C4u/Bh543fI0PXBVt391Isze/X0mfnRKVB2whck9k7V4a/joeeWJ8/4ouxC4CnerYJU6oEZwfB4XyjfVxyxK00qi8abiW9dtnQ9np1BYGqoh0dH2uRDaQSVTxth9fZivHDP5hso+PVibtzZYQJkkAxctvzkksTCXazFZiI9eIBzb24LIywayieqqtqyf6waXWICPnyX8q9E7/SSC8KiTM3A6astY+AyJPV9qxwEwHu+EGgOhNwYPSIOyAv6Yc32i1lHfvjxPBm0m7iE6fJLbrrhEG1TDkX1HsEcque8gIaP0g5z5rF43dnpDLBsdyMB9XnI2JkYww2pRqrb6yZmnjU+i+zUUintEDAA+ws2ZUQVCL2KjXgzZWHLqwl9OWm9XfC19KXZDtY0u0aFPrjK0P922VU3EqvAnbZTE768XUtIKDZ0wIQxATKzUNgrM55c0DMjCHKv32PLqi5L6GirSEYXj40x421A6sij+eK+OlW6HBU+Z3gW2ZoHD6zhrcp7JSTM0cKzpYyZyLxu4KWrciw6fPa2cgwVQx8LxOSeTC4UYumQAsrTw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(39860400002)(346002)(396003)(366004)(451199021)(2906002)(38100700002)(6512007)(6486002)(82960400001)(2616005)(26005)(53546011)(186003)(6506007)(31696002)(5660300002)(86362001)(36756003)(8676002)(66946007)(6666004)(41300700001)(478600001)(110136005)(8936002)(66556008)(4326008)(66476007)(4744005)(316002)(54906003)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RDAyQ1RxZDMwSm9KdSt6WVJyNlJKT3F3ODdVWWsvaEF5emV1MFhkYWY1Y253?=
 =?utf-8?B?dzBBMjBSdkxPR3J6SnV1Y1JzOWE5L0EvZDEvZUFWdlZwWHQ3L0dUWWlwbERy?=
 =?utf-8?B?MVJ3MXdnbHNGUC9QRUUweCs4bnlsN3lrVStlOXdsRVFMZFhJVHV4d1pNaGVG?=
 =?utf-8?B?SkxmR3pnSjIycGhyWll3T1hBYWZ0NlQ3VzFEVlpTaVJTa2lFRDdkOUE5SEUz?=
 =?utf-8?B?bDc1Sm1lTWRTcy9UdFVpSElocHVwSGF2T2Y1dEkxTXhFSXVNZ0g2S0RpVWY0?=
 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jDVOjTORPW93JOpezQXMTlvhqUjhf0sHWYv5qzmy6wgQEmlEhhxxIjMTqRlRReURJ+al/0A3MwKw5E6sVvq
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e54d4c2b-21da-4f13-84a5-08db86b13aa7
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 10:33:15.7919
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ngjNslrwyO0kGdNGCPr+tjCjDrsYLgozWb07Oh1HI+EXEtT9fysCHJJybrzbjLpNy54TuFh9J8qH8xS7Gxi1AEwSiqBSAmEMkVa+XT/MERg=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB6531

On 17/07/2023 10:17 am, Jan Beulich wrote:
>  /* Intel defined MSRs. */
> -#define MSR_IA32_P5_MC_ADDR		0x00000000
> -#define MSR_IA32_P5_MC_TYPE		0x00000001

These are architectural.Â  They still exist in all Intel and AMD CPUs.

I'd suggest keeping them, because I think we're required to expose them
when advertising MCA.

Otherwise, LGTM.

~Andrew


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 10:52:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 10:52:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564394.881847 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLLps-0007Sc-FG; Mon, 17 Jul 2023 10:52:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564394.881847; Mon, 17 Jul 2023 10:52:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLLps-0007SV-B7; Mon, 17 Jul 2023 10:52:12 +0000
Received: by outflank-mailman (input) for mailman id 564394;
 Mon, 17 Jul 2023 10:52:10 +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
 <SRS0=RVQe=DD=citrix.com=prvs=555fa4c0e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qLLpq-0007SP-Pq
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 10:52:10 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f8be37d1-248f-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 12:52:08 +0200 (CEST)
Received: from mail-dm6nam11lp2169.outbound.protection.outlook.com (HELO
 NAM11-DM6-obe.outbound.protection.outlook.com) ([104.47.57.169])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 17 Jul 2023 06:52:05 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by PH7PR03MB6941.namprd03.prod.outlook.com (2603:10b6:510:156::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.28; Mon, 17 Jul
 2023 10:52:03 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 10:52:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f8be37d1-248f-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689591128;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=iC38s16ivPQM5JTCNhgH75pQFdoBV4gAHFGGaBImJEM=;
  b=PJZPbAhO6CGG23Iy7ykBGXxW4lZnXoOLiOt5LS0lf8TyuJY5nI7Q5tVg
   awVqzUjguCvNGak/gSHfZWA5gkPwjipeaRfSiWGqIWvOcO2vjXzE+1B1r
   40eiei19T7wz9m2q+kJkv8hxcEZlx2MMLcsQ7lxEgPNpqooh6yQG7OqRj
   U=;
X-IronPort-RemoteIP: 104.47.57.169
X-IronPort-MID: 119030282
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:01j7S69noz+sCsYcghtyDrUDcn+TJUtcMsCJ2f8bNWPcYEJGY0x3n
 WpKCmGFOvqLYTf2Lt5wOdux/R4C78XSx99jHQpuqSA8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s
 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk
 d7pqojUNUTNNwRcawr40Ird7ks21BjOkG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zUzM/kr7K++MRxOtYUIsuacNSBJZCjI2Q==
X-IronPort-AV: E=Sophos;i="6.01,211,1684814400"; 
   d="scan'208";a="119030282"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=U2G3WPRKdsIpZN/kSdOrOs8TktzL1w2dAc0LE4fMIHSAcbDpsYdv2d+jXbBdvbKCJrvDJPAXgptOe/n48oEy2KDTfSsIjPKduwLFauV6g+lfwHNyQ5vrZ/JLBQVpy3q5K9C+QInEQxpmliTUdthARcYP0ZpJjC9MQie74hVMMkK50Vjmv+CApEaJa/vAIyOCN+1AmvvY/ND04fY8bJxPqjh/jT52i5DUonYPBBlWvUBuA7t3C/mzm9Q+JuYoo9obxYCyDx6qmrX+Rm1vUynJiY8uIB1nROyYV0x2dgrAwEhrrYVkORK8wDtbse3bn1ZlVXenr91PltTbsoDz52AZGg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=6bMnT8j/thIsdisojHHqR+sOOlbPG+p+8Pu+VyJkT1s=;
 b=SGB4Qj4Zx8UO3IcroeqD3D3/NnyLlNhijg8gmT4qtHvuSDIXlikIHnf7/O5EiDYyuHI3gBulC9rRfUobmpvlsPBqzeBabrfyLyIzhHJ1dbEYYQ1o6fWJD9CN824XBsB79RWiaONstbd+a0mKIakg1/690cazs8gonW/8dBqHo1momEYpNG7Qf0ruFAMi7B8Xe33XLKmOWgfwSmlNcEYmNcKEUEhPiq6jW3tQuB2tnJ9vTuJVtiCV8mSctMe2cWt0ST9Bxt+osI7LiG91/VivyH/E1t7b1rMSQ1HXwn1rkogrA9+YD0DfPTCU55q27P+Bfkcqp8m7lpReTj+WXx6ctw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=6bMnT8j/thIsdisojHHqR+sOOlbPG+p+8Pu+VyJkT1s=;
 b=MFzAdr3SIyiwFakn8QKT+K/o7FasLw9CVPyLeab8DOMKrF5h98/EEOuRUePAO6ol5Ndj3f1i0BQJjbrlQuY+gxqWeByiBTYcUeAVPD6MYvAV4GPEVK2+rLJEvtQfSSTBH5oMaCEJyC3zoOs04suJD3TX/MJBqPFIHVynkJNzsco=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Mon, 17 Jul 2023 12:51:56 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH] x86/HVM: adjust pIRQ calculation in hvm_inject_msi()
Message-ID: <ZLUdTB_gZjRzhpJe@MacBook-Air-de-Roger.local>
References: <5cfda162-07a3-8a02-4511-b0578b12dbc2@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <5cfda162-07a3-8a02-4511-b0578b12dbc2@suse.com>
X-ClientProxiedBy: LO2P265CA0457.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:a2::13) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|PH7PR03MB6941:EE_
X-MS-Office365-Filtering-Correlation-Id: 26259a3f-2d5f-4688-555b-08db86b3d9b9
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	WJKK+5hKrfbDyAW6gJuL96wtJHJLaI5OhJLtl9v+gfNgpDPkchnJ2wdpxyUkvefMweEusoTnYBHS8MfFi7V98+EDThfrbO7ubzJtfOR82XNlllywS+pzXa4EIt6kLixef5/ntJqSRaNkrPpA8d5J+G/ZfNd+5E/fSHpboA+NH3xkxDlaLX5yA5a3bLh+geYCVKMrbmUgy0FSbkiOWkXYiLk0aL0TmFFC7TAmAk9jJN3fOihAr8jUBNEmRjttfvd5KlGyXNLjix/eBvXwhl+lrye5oLAJa5JleLQAK0bdo8zTZ2CNaULsa2YGsNpfppA3/wAa2hQsqeQT7WXTPaLEfpw5/xM3o6Trz2gQsB8OR5ZWHtLUvki391RxDKXGt0cMwbQ9Nx39C0zC1R2NJj0SWO3r6qF9GAEkaIhAF5aJtqECk7gFBR3gNguPfBOHlQFTjWkoN1YJsSGlfHEvsvI4ug6UJsr1pBnaL36rQA6pKN9YXt0/f53KCWPwMUV8oyd4Dp7g3ChPkWcFa295ZYjBxTT89DM+qNF9tgIDVczJvmcYcyvwDmsOqJf+LfUXZb3G
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(376002)(346002)(136003)(366004)(451199021)(9686003)(82960400001)(6506007)(38100700002)(26005)(186003)(83380400001)(85182001)(2906002)(5660300002)(478600001)(54906003)(86362001)(8676002)(41300700001)(6486002)(6666004)(316002)(6512007)(8936002)(66556008)(66476007)(6916009)(66946007)(4326008);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dHZFZTZQeHF5QzM3WjdoNHV0TTJJdUZXajVnSHJEYzV0enRzSXVnUldrb3lT?=
 =?utf-8?B?V0FtU212YnIxODgzNDBNM3FRNVdtb3EzY2lkSlY0eUZBNkMrZDhIYUFyZXlq?=
 =?utf-8?B?TVF6Mm43OUwrUmlaVkdPSi95WHFjVDBvRi9vc3I0VWwzK0JnMzRWWVZEZWVT?=
 =?utf-8?B?S09YTkYvY3ZoK2d2K29kZG1tRU9nZENuSG5Wd3c1WkVXaVJZOUovNHhDZU9V?=
 =?utf-8?B?dnNiT0xjODZVaUdLOTRXSmpYNGRtUExNME5rUzBoV3JMNUtjUzhwZjNJVzJQ?=
 =?utf-8?B?OFRSYjV5ZzlmWEhmck80RmhLSTBCVU96NWlVeGJweVVLSVpMbVpENlNwYzBL?=
 =?utf-8?B?R2ROKzIxNVhvNmQydG81MDBWaDZDQmwrNFplUEFPempSUC9OQlVyOEgrQUQy?=
 =?utf-8?B?b05HRUpoZUJ4SlduU2s2eExKMjdTZU5oRUVWaDRkLzN6VEltZ0NacXhmVnFH?=
 =?utf-8?B?SFNUaExqbkpXMk5zS21wZnVSTzR0NjdpQnh1RjZhMTNXK1Vtc0NoblMwZmdP?=
 =?utf-8?B?VGh0anQzeUtIZGJDQmdJalpSc3hOcm8wdFJVZkNyenFncXBuYzdLdDZ3bEov?=
 =?utf-8?B?b0hvOVNUU2J1clEyMDlRUDY5YzlKOGozZjAzSmRuYVgyZ3FlWkdDNGlCelNP?=
 =?utf-8?B?d2R5cXA0MlMwTzVXM2wxVGtRbXdpdzdFdVBKRTRYcTVFd1lDdTZxdTJhVjNP?=
 =?utf-8?B?cWFoaWo0RTg1N1dLSWJ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MQZldvTuBY/IY+NulQ5r0OdPz6K7WlRz2DKrEA1SSE6HtutQtaZbTLzD9Dd4iYN4ec5GgJ2CKfvuf13YDxT5nXI4nTE1Ud8c47Q0Z+WsTMsnQh1drAiuFO2EsbNNB0PqG1Sb/Ex5hGchLPwFNlBphtW2bCm2svLU6KBuiMqEWyStW3qEhYvvM/nKXcJjJ42zc/IbOUBMW1Vdd0eIN/PVpD7f8d/rseMMuljh9uJY4yKWwvtQ6D6DZgVqZj6VGxwv6koQdD8yxFNtxtBmpgqk0+KWSbxk2o+2SX49vnHS7noXcg/+WFVnwO+Y0s7AOfPZlEndCB2d70HU3VCHSbVbaD9M3PjZbnprPZI2cKgDY+kWhlysUDYEHmv+FQliHzxFDxiKe0eit9OWbHgZfkcdC7D5k+6j704hQ/NRxraTT/Rftj7PcRPx6K8rKLNZvXfL+VeF4LLefeQkZA6rax7fphG/rLNGXYu0xS8V/NA3PeMj8m/OyH5vN1zXvOcUnf4XXNphlX8JblyLVJYP5rl7HbKXzs6AaiOFrFgs
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 26259a3f-2d5f-4688-555b-08db86b3d9b9
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 10:52:03.2516
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 3g5AKFPbBL852BU6Fy1Ml8aeE4YsJFC8L+Qh10DsuZ5OLKTxJMdq1kezmAoYJXm3/6qQ6Z/3vCiSsNs4VCIFUg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR03MB6941

On Mon, Jul 17, 2023 at 11:31:57AM +0200, Jan Beulich wrote:
> While the referenced commit came without any update to the public header
> (which doesn't clarify how the upper address bits are used), the
> intention looks to have been that bits 12..19 and 40..63 form the pIRQ.
> Negative values simply make no sense, and pirq_info() also generally
> wants invoking with an unsigned (and not just positive) value.
> 
> Since the line was pointed out by Eclair, address Misra rule 7.2 at the
> same time, by adding the missing U suffix.
> 
> Fixes: 88fccdd11ca0 ("xen: event channel remapping for emulated MSIs")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

I have a question below, but not related to the change here.

> 
> --- a/xen/arch/x86/hvm/irq.c
> +++ b/xen/arch/x86/hvm/irq.c
> @@ -383,7 +383,7 @@ int hvm_inject_msi(struct domain *d, uin
>  
>      if ( !vector )
>      {
> -        int pirq = ((addr >> 32) & 0xffffff00) | dest;
> +        unsigned int pirq = ((addr >> 32) & 0xffffff00U) | dest;
>  
>          if ( pirq > 0 )

I do wonder whether this check is also accurate, as pIRQ 0 could be a
valid value.  Should it instead use INVALID_PIRQ?

Since there's no specification or documentation how this is supposed
to work it's hard to tell.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 11:16:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 11:16:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564422.881857 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLMCp-0001jD-Ke; Mon, 17 Jul 2023 11:15:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564422.881857; Mon, 17 Jul 2023 11:15:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLMCp-0001j6-Ht; Mon, 17 Jul 2023 11:15:55 +0000
Received: by outflank-mailman (input) for mailman id 564422;
 Mon, 17 Jul 2023 11:10:23 +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
 <SRS0=RoUN=DD=arm.com=liviu.dudau@srs-se1.protection.inumbo.net>)
 id 1qLM7T-0001eL-1m
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 11:10:23 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTP
 id 8322f2eb-2492-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 13:10:18 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BEE541596
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 04:11:00 -0700 (PDT)
Received: from e110455-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com
 [10.121.207.14])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 016EA3F67D
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 04:10:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8322f2eb-2492-11ee-8611-37d641c3527e
Date: Mon, 17 Jul 2023 12:07:47 +0100
From: Liviu Dudau <liviu.dudau@arm.com>
To: Rob Herring <robh@kernel.org>
Cc: David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Jagan Teki <jagan@amarulasolutions.com>,
	Liu Ying <victor.liu@nxp.com>, Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>, Inki Dae <inki.dae@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Lucas Stach <l.stach@pengutronix.de>,
	Russell King <linux+etnaviv@armlinux.org.uk>,
	Christian Gmeiner <christian.gmeiner@gmail.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Tian Tao <tiantao6@hisilicon.com>,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Yongqin Liu <yongqin.liu@linaro.org>,
	John Stultz <jstultz@google.com>,
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	Paul Cercueil <paul@crapouillou.net>, Qiang Yu <yuq825@gmail.com>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Rob Clark <robdclark@gmail.com>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Dmitry B aryshkov <dmitry.baryshkov@linaro.org>,
	Sean Paul <sean@poorly.run>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Marek Vasut <marex@denx.de>, Stefan Agner <stefan@agner.ch>,
	Sam Ravnborg <sam@ravnborg.org>,
	Jerry Han <hanxu5@huaqin.corp-partner.google.com>,
	Icenowy Zheng <icenowy@aosc.io>, Ondrej Jirman <megi@xff.cz>,
	Javier Martinez Canillas <javierm@redhat.com>,
	Guido =?utf-8?Q?G=C3=BCnther?= <agx@sigxcpu.org>,
	Purism Kernel Team <kernel@puri.sm>,
	Jianhua Lu <lujianhua000@gmail.com>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>,
	Artur Weber <aweber.kernel@gmail.com>,
	Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	Steven Price <steven.price@arm.com>,
	Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>,
	Emma Anholt <emma@anholt.net>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Sandy Huang <hjc@rock-chips.com>,
	Heiko =?utf-8?Q?St=C3=BCbner?= <heiko@sntech.de>,
	Orson Zhai <orsonzhai@gmail.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Alain Volmat <alain.volmat@foss.st.com>,
	Yannick Fertre <yannick.fertre@foss.st.com>,
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
	Philippe Cornu <philippe.cornu@foss.st.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Chen-Yu Tsai <wens@csie.org>, Samuel Holland <samuel@sholland.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Mikko Perttunen <mperttunen@nvidia.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Jyri Sarha <jyri.sarha@iki.fi>, Tomi Valkeinen <tomba@kernel.org>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	devicetree@vger.kernel.org, Ondrej Jirman <megous@megous.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, etnaviv@lists.freedesktop.org,
	linux-samsung-soc@vger.kernel.org, linux-mips@vger.kernel.org,
	lima@lists.freedesktop.org, linux-mediatek@lists.infradead.org,
	linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org,
	linux-rpi-kernel@lists.infradead.org,
	linux-renesas-soc@vger.kernel.org,
	linux-rockchip@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] drm: Explicitly include correct DT includes
Message-ID: <ZLUhA1yxQQONA0eL@e110455-lin.cambridge.arm.com>
References: <20230714174545.4056287-1-robh@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230714174545.4056287-1-robh@kernel.org>

On Fri, Jul 14, 2023 at 11:45:34AM -0600, Rob Herring wrote:
> The DT of_device.h and of_platform.h date back to the separate
> of_platform_bus_type before it as merged into the regular platform bus.
> As part of that merge prepping Arm DT support 13 years ago, they
> "temporarily" include each other. They also include platform_device.h
> and of.h. As a result, there's a pretty much random mix of those include
> files used throughout the tree. In order to detangle these headers and
> replace the implicit includes with struct declarations, users need to
> explicitly include the correct includes.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> 
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
> index cc7664c95a54..14ee79becacb 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
> @@ -6,7 +6,7 @@
>   */
>  #include <linux/io.h>
>  #include <linux/iommu.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/of_graph.h>
>  #include <linux/of_reserved_mem.h>
>  #include <linux/platform_device.h>
> diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
> index c03cfd57b752..a5a9534d4353 100644
> --- a/drivers/gpu/drm/arm/malidp_drv.c
> +++ b/drivers/gpu/drm/arm/malidp_drv.c
> @@ -12,6 +12,7 @@
>  #include <linux/of_device.h>
>  #include <linux/of_graph.h>
>  #include <linux/of_reserved_mem.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/debugfs.h>
>

For the komeda and malidp drivers:

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

Best regards,
Liviu


> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_cec.c b/drivers/gpu/drm/bridge/adv7511/adv7511_cec.c
> index 99964f5a5457..2a6b91f752cb 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_cec.c
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_cec.c
> @@ -7,7 +7,6 @@
>  
>  #include <linux/device.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
>  #include <linux/slab.h>
>  #include <linux/clk.h>
>  
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> index 2254457ab5d0..b9957da0f55a 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> @@ -9,7 +9,7 @@
>  #include <linux/device.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/slab.h>
>  
>  #include <media/cec.h>
> diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
> index f50d65f54314..7457d38622b0 100644
> --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
> +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
> @@ -14,8 +14,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/iopoll.h>
>  #include <linux/module.h>
> -#include <linux/of_address.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/of_graph.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
> diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> index f6822dfa3805..4aff817f82ce 100644
> --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> @@ -29,7 +29,6 @@
>  #include <linux/media-bus-format.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/phy/phy.h>
>  #include <linux/phy/phy-dp.h>
>  #include <linux/platform_device.h>
> diff --git a/drivers/gpu/drm/bridge/chipone-icn6211.c b/drivers/gpu/drm/bridge/chipone-icn6211.c
> index 8bfce21d6b90..d205e755e524 100644
> --- a/drivers/gpu/drm/bridge/chipone-icn6211.c
> +++ b/drivers/gpu/drm/bridge/chipone-icn6211.c
> @@ -17,7 +17,7 @@
>  #include <linux/i2c.h>
>  #include <linux/media-bus-format.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/regmap.h>
>  #include <linux/regulator/consumer.h>
>  
> diff --git a/drivers/gpu/drm/bridge/display-connector.c b/drivers/gpu/drm/bridge/display-connector.c
> index f7f436cf96e0..08bd5695ddae 100644
> --- a/drivers/gpu/drm/bridge/display-connector.c
> +++ b/drivers/gpu/drm/bridge/display-connector.c
> @@ -10,7 +10,6 @@
>  #include <linux/module.h>
>  #include <linux/mutex.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/platform_device.h>
>  #include <linux/regulator/consumer.h>
>  
> diff --git a/drivers/gpu/drm/bridge/fsl-ldb.c b/drivers/gpu/drm/bridge/fsl-ldb.c
> index b8e52156b07a..0e4bac7dd04f 100644
> --- a/drivers/gpu/drm/bridge/fsl-ldb.c
> +++ b/drivers/gpu/drm/bridge/fsl-ldb.c
> @@ -8,7 +8,6 @@
>  #include <linux/mfd/syscon.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/of_graph.h>
>  #include <linux/platform_device.h>
>  #include <linux/regmap.h>
> diff --git a/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c b/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c
> index 386032a02599..21471a9a28b2 100644
> --- a/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c
> +++ b/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c
> @@ -9,9 +9,9 @@
>  #include <linux/mfd/syscon.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/of_graph.h>
>  #include <linux/phy/phy.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/regmap.h>
>  
> diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c
> index c806576b1e22..7984da9c0a35 100644
> --- a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c
> +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c
> @@ -12,6 +12,7 @@
>  #include <linux/of_device.h>
>  #include <linux/of_graph.h>
>  #include <linux/phy/phy.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/regmap.h>
>  
> diff --git a/drivers/gpu/drm/bridge/lontium-lt9211.c b/drivers/gpu/drm/bridge/lontium-lt9211.c
> index aa8d47e7f40d..4d404f5ef87e 100644
> --- a/drivers/gpu/drm/bridge/lontium-lt9211.c
> +++ b/drivers/gpu/drm/bridge/lontium-lt9211.c
> @@ -16,7 +16,6 @@
>  #include <linux/i2c.h>
>  #include <linux/media-bus-format.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
>  #include <linux/of_graph.h>
>  #include <linux/regmap.h>
>  #include <linux/regulator/consumer.h>
> diff --git a/drivers/gpu/drm/bridge/lvds-codec.c b/drivers/gpu/drm/bridge/lvds-codec.c
> index 67368f23d4aa..8c5668dca0c4 100644
> --- a/drivers/gpu/drm/bridge/lvds-codec.c
> +++ b/drivers/gpu/drm/bridge/lvds-codec.c
> @@ -7,7 +7,6 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/of_graph.h>
>  #include <linux/platform_device.h>
>  #include <linux/regulator/consumer.h>
> diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
> index 4a5f5c4f5dcc..8d54091ec66e 100644
> --- a/drivers/gpu/drm/bridge/nwl-dsi.c
> +++ b/drivers/gpu/drm/bridge/nwl-dsi.c
> @@ -16,8 +16,8 @@
>  #include <linux/module.h>
>  #include <linux/mux/consumer.h>
>  #include <linux/of.h>
> -#include <linux/of_platform.h>
>  #include <linux/phy/phy.h>
> +#include <linux/platform_device.h>
>  #include <linux/regmap.h>
>  #include <linux/reset.h>
>  #include <linux/sys_soc.h>
> diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c b/drivers/gpu/drm/bridge/parade-ps8622.c
> index c9b6cb7678e3..ae3ab9262ef1 100644
> --- a/drivers/gpu/drm/bridge/parade-ps8622.c
> +++ b/drivers/gpu/drm/bridge/parade-ps8622.c
> @@ -12,7 +12,6 @@
>  #include <linux/i2c.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/pm.h>
>  #include <linux/regulator/consumer.h>
>  
> diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c
> index 043b8109e64a..46b2c5027690 100644
> --- a/drivers/gpu/drm/bridge/samsung-dsim.c
> +++ b/drivers/gpu/drm/bridge/samsung-dsim.c
> @@ -16,8 +16,9 @@
>  #include <linux/delay.h>
>  #include <linux/irq.h>
>  #include <linux/media-bus-format.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/phy/phy.h>
> +#include <linux/platform_device.h>
>  
>  #include <video/mipi_display.h>
>  
> diff --git a/drivers/gpu/drm/bridge/simple-bridge.c b/drivers/gpu/drm/bridge/simple-bridge.c
> index d85d9ee463b8..cbe8e778d7c7 100644
> --- a/drivers/gpu/drm/bridge/simple-bridge.c
> +++ b/drivers/gpu/drm/bridge/simple-bridge.c
> @@ -8,8 +8,9 @@
>  
>  #include <linux/gpio/consumer.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/of_graph.h>
> +#include <linux/platform_device.h>
>  #include <linux/regulator/consumer.h>
>  
>  #include <drm/drm_atomic_helper.h>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 9d6dcaf317a1..9df19d7b8445 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -14,7 +14,7 @@
>  #include <linux/irq.h>
>  #include <linux/module.h>
>  #include <linux/mutex.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/pinctrl/consumer.h>
>  #include <linux/regmap.h>
>  #include <linux/dma-mapping.h>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> index b2efecf7d160..5cc9a63a65ff 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> @@ -13,7 +13,7 @@
>  #include <linux/debugfs.h>
>  #include <linux/iopoll.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/reset.h>
>  
> diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> index 7e9f4ec8e780..061e8bd5915d 100644
> --- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> +++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> @@ -31,7 +31,7 @@
>  #include <linux/i2c.h>
>  #include <linux/media-bus-format.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/of_graph.h>
>  #include <linux/regmap.h>
>  #include <linux/regulator/consumer.h>
> diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
> index 6252ac01e945..14201f73aab1 100644
> --- a/drivers/gpu/drm/drm_mipi_dsi.c
> +++ b/drivers/gpu/drm/drm_mipi_dsi.c
> @@ -27,6 +27,7 @@
>  
>  #include <linux/device.h>
>  #include <linux/module.h>
> +#include <linux/of.h>
>  #include <linux/of_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/slab.h>
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> index de8c9894967c..bbc9c54871f4 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> @@ -8,8 +8,8 @@
>  #include <linux/delay.h>
>  #include <linux/dma-fence.h>
>  #include <linux/dma-mapping.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/regulator/consumer.h>
> diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> index 2867b39fa35e..4d986077738b 100644
> --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> @@ -12,7 +12,7 @@
>  #include <linux/iopoll.h>
>  #include <linux/irq.h>
>  #include <linux/mfd/syscon.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/regmap.h>
> diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> index 3126f735dedc..0156a5e94435 100644
> --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> @@ -12,7 +12,6 @@
>  #include <linux/kernel.h>
>  #include <linux/of.h>
>  #include <linux/of_address.h>
> -#include <linux/of_device.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
> index fc81f728e6ba..69ea33cae651 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
> @@ -8,7 +8,8 @@
>   */
>  
>  #include <linux/component.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
>  
>  #include <drm/bridge/samsung-dsim.h>
>  #include <drm/drm_probe_helper.h>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> index 7f4a0be03dd1..8dde7b1e9b35 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> @@ -12,7 +12,6 @@
>  #include <linux/kernel.h>
>  #include <linux/mfd/syscon.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/regmap.h>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
> index 8706f377c349..ffb327c5139e 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
> @@ -12,7 +12,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/io.h>
>  #include <linux/kernel.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/sizes.h>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_scaler.c b/drivers/gpu/drm/exynos/exynos_drm_scaler.c
> index 20608e9780ce..f2b8b09a6b4e 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_scaler.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_scaler.c
> @@ -11,7 +11,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/io.h>
>  #include <linux/kernel.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  
> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
> index b7c11bdce2c8..f3aaa4ea3e68 100644
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> @@ -21,8 +21,8 @@
>  #include <linux/irq.h>
>  #include <linux/kernel.h>
>  #include <linux/mfd/syscon.h>
> +#include <linux/of.h>
>  #include <linux/of_address.h>
> -#include <linux/of_device.h>
>  #include <linux/of_graph.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index 8d333db813b7..b302392ff0d7 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -18,7 +18,6 @@
>  #include <linux/kernel.h>
>  #include <linux/ktime.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/regulator/consumer.h>
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> index 9c5d49bf40c9..711f7ce9894a 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> @@ -11,9 +11,9 @@
>   *	Xinwei Kong <kong.kongxinwei@hisilicon.com>
>   */
>  
> -#include <linux/of_platform.h>
>  #include <linux/component.h>
>  #include <linux/module.h>
> +#include <linux/of.h>
>  #include <linux/of_graph.h>
>  #include <linux/platform_device.h>
>  
> diff --git a/drivers/gpu/drm/imx/dcss/dcss-dev.c b/drivers/gpu/drm/imx/dcss/dcss-dev.c
> index 5d1779ab65c0..4f3af0dfb344 100644
> --- a/drivers/gpu/drm/imx/dcss/dcss-dev.c
> +++ b/drivers/gpu/drm/imx/dcss/dcss-dev.c
> @@ -4,8 +4,9 @@
>   */
>  
>  #include <linux/clk.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/of_graph.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/slab.h>
>  #include <drm/drm_bridge_connector.h>
> @@ -198,7 +199,7 @@ struct dcss_dev *dcss_dev_create(struct device *dev, bool hdmi_output)
>  
>  	dcss->of_port = of_graph_get_port_by_id(dev->of_node, 0);
>  	if (!dcss->of_port) {
> -		dev_err(dev, "no port@0 node in %s\n", dev->of_node->full_name);
> +		dev_err(dev, "no port@0 node in %pOF\n", dev->of_node);
>  		ret = -ENODEV;
>  		goto clks_err;
>  	}
> diff --git a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
> index 277ead6a459a..22b65f4a0e30 100644
> --- a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
> +++ b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
> @@ -19,8 +19,8 @@
>  #include <linux/bitfield.h>
>  #include <linux/clk.h>
>  #include <linux/dma-mapping.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
>  #include <linux/platform_device.h>
>  
>  #define IMX21LCDC_LSSAR         0x0000 /* LCDC Screen Start Address Register */
> diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> index 5ec75e9ba499..8dbd4847d3a6 100644
> --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> @@ -14,7 +14,7 @@
>  #include <linux/media-bus-format.h>
>  #include <linux/module.h>
>  #include <linux/mutex.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/of_reserved_mem.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm.h>
> diff --git a/drivers/gpu/drm/ingenic/ingenic-ipu.c b/drivers/gpu/drm/ingenic/ingenic-ipu.c
> index 7a43505011a5..6d236547f611 100644
> --- a/drivers/gpu/drm/ingenic/ingenic-ipu.c
> +++ b/drivers/gpu/drm/ingenic/ingenic-ipu.c
> @@ -14,7 +14,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
> +#include <linux/platform_device.h>
>  #include <linux/regmap.h>
>  #include <linux/time.h>
>  
> diff --git a/drivers/gpu/drm/lima/lima_drv.c b/drivers/gpu/drm/lima/lima_drv.c
> index 39cab4a55f57..39c725958ef3 100644
> --- a/drivers/gpu/drm/lima/lima_drv.c
> +++ b/drivers/gpu/drm/lima/lima_drv.c
> @@ -2,7 +2,8 @@
>  /* Copyright 2017-2019 Qiang Yu <yuq825@gmail.com> */
>  
>  #include <linux/module.h>
> -#include <linux/of_platform.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
>  #include <linux/uaccess.h>
>  #include <linux/slab.h>
>  #include <linux/pm_runtime.h>
> diff --git a/drivers/gpu/drm/logicvc/logicvc_drm.c b/drivers/gpu/drm/logicvc/logicvc_drm.c
> index c35c453fd025..e6b68c2e249b 100644
> --- a/drivers/gpu/drm/logicvc/logicvc_drm.c
> +++ b/drivers/gpu/drm/logicvc/logicvc_drm.c
> @@ -10,8 +10,8 @@
>  #include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/of_address.h>
> -#include <linux/of_device.h>
>  #include <linux/of_reserved_mem.h>
> +#include <linux/platform_device.h>
>  #include <linux/regmap.h>
>  #include <linux/types.h>
>  
> diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c
> index a8cd86c06c14..5d68d0f27212 100644
> --- a/drivers/gpu/drm/mcde/mcde_drv.c
> +++ b/drivers/gpu/drm/mcde/mcde_drv.c
> @@ -471,7 +471,7 @@ static const struct of_device_id mcde_of_match[] = {
>  static struct platform_driver mcde_driver = {
>  	.driver = {
>  		.name           = "mcde",
> -		.of_match_table = of_match_ptr(mcde_of_match),
> +		.of_match_table = mcde_of_match,
>  	},
>  	.probe = mcde_probe,
>  	.remove = mcde_remove,
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_aal.c b/drivers/gpu/drm/mediatek/mtk_disp_aal.c
> index 434e8a9ce8ab..cdbec79474d1 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_aal.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_aal.c
> @@ -6,8 +6,7 @@
>  #include <linux/clk.h>
>  #include <linux/component.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> -#include <linux/of_irq.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/soc/mediatek/mtk-cmdq.h>
>  
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c b/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c
> index 1773379b2439..7c5e04ee5b9f 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_ccorr.c
> @@ -6,8 +6,7 @@
>  #include <linux/clk.h>
>  #include <linux/component.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> -#include <linux/of_irq.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/soc/mediatek/mtk-cmdq.h>
>  
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_color.c b/drivers/gpu/drm/mediatek/mtk_disp_color.c
> index cac9206079e7..0b9b4b06d19c 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_color.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_color.c
> @@ -6,8 +6,7 @@
>  #include <linux/clk.h>
>  #include <linux/component.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> -#include <linux/of_irq.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/soc/mediatek/mtk-cmdq.h>
>  
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c
> index c844942603f7..7746dceadb20 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c
> @@ -6,8 +6,7 @@
>  #include <linux/clk.h>
>  #include <linux/component.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> -#include <linux/of_irq.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/soc/mediatek/mtk-cmdq.h>
>  
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_merge.c b/drivers/gpu/drm/mediatek/mtk_disp_merge.c
> index 6428b6203ffe..bea8a0d8040a 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_merge.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_merge.c
> @@ -5,8 +5,7 @@
>  
>  #include <linux/clk.h>
>  #include <linux/component.h>
> -#include <linux/of_device.h>
> -#include <linux/of_irq.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/reset.h>
>  #include <linux/soc/mediatek/mtk-cmdq.h>
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> index 8f52cc1f3fba..73320a7425cd 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> @@ -10,8 +10,7 @@
>  #include <linux/clk.h>
>  #include <linux/component.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> -#include <linux/of_irq.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/soc/mediatek/mtk-cmdq.h>
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> index c0a38f5217ee..878575bb9671 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> @@ -7,8 +7,9 @@
>  #include <drm/drm_of.h>
>  #include <linux/clk.h>
>  #include <linux/component.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/of_address.h>
> +#include <linux/of_platform.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/reset.h>
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c
> index d4df17ad600a..a12c05786d28 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c
> @@ -8,8 +8,7 @@
>  #include <linux/clk.h>
>  #include <linux/component.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> -#include <linux/of_irq.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/soc/mediatek/mtk-cmdq.h>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
> index 948a53f1f4b3..28bdb1f427ff 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dpi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
> @@ -10,7 +10,6 @@
>  #include <linux/kernel.h>
>  #include <linux/media-bus-format.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/of_graph.h>
>  #include <linux/pinctrl/consumer.h>
>  #include <linux/platform_device.h>
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> index d40142842f85..8a43656ecc30 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> @@ -6,6 +6,7 @@
>  #include <linux/clk.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/mailbox_controller.h>
> +#include <linux/of.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/soc/mediatek/mtk-cmdq.h>
>  #include <linux/soc/mediatek/mtk-mmsys.h>
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> index 6dcb4ba2466c..e01427717912 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> @@ -7,8 +7,9 @@
>  #include <linux/component.h>
>  #include <linux/iommu.h>
>  #include <linux/module.h>
> -#include <linux/of_address.h>
> +#include <linux/of.h>
>  #include <linux/of_platform.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/dma-mapping.h>
>  
> diff --git a/drivers/gpu/drm/mediatek/mtk_ethdr.c b/drivers/gpu/drm/mediatek/mtk_ethdr.c
> index 73dc4da3ba3b..db7ac666ec5e 100644
> --- a/drivers/gpu/drm/mediatek/mtk_ethdr.c
> +++ b/drivers/gpu/drm/mediatek/mtk_ethdr.c
> @@ -7,7 +7,7 @@
>  #include <drm/drm_framebuffer.h>
>  #include <linux/clk.h>
>  #include <linux/component.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/of_address.h>
>  #include <linux/platform_device.h>
>  #include <linux/reset.h>
> diff --git a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
> index e06db6e56b5f..4806bdd4b8fa 100644
> --- a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
> +++ b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
> @@ -6,8 +6,7 @@
>  #include <drm/drm_fourcc.h>
>  #include <linux/clk.h>
>  #include <linux/component.h>
> -#include <linux/of_address.h>
> -#include <linux/of_device.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/soc/mediatek/mtk-cmdq.h>
> diff --git a/drivers/gpu/drm/meson/meson_drv.h b/drivers/gpu/drm/meson/meson_drv.h
> index b23009a3380f..3f9345c14f31 100644
> --- a/drivers/gpu/drm/meson/meson_drv.h
> +++ b/drivers/gpu/drm/meson/meson_drv.h
> @@ -9,7 +9,6 @@
>  
>  #include <linux/device.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/regmap.h>
>  
>  struct drm_crtc;
> diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
> index 3d046878ce6c..63206535de65 100644
> --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
> +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
> @@ -9,8 +9,9 @@
>  #include <linux/component.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/of_graph.h>
> +#include <linux/platform_device.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/reset.h>
>  
> diff --git a/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c b/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c
> index 57447abf1a29..e5fe4e994f43 100644
> --- a/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c
> +++ b/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c
> @@ -7,9 +7,10 @@
>  
>  #include <linux/clk.h>
>  #include <linux/kernel.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
>  #include <linux/of_graph.h>
> +#include <linux/platform_device.h>
>  #include <linux/reset.h>
>  #include <linux/phy/phy.h>
>  #include <linux/bitfield.h>
> diff --git a/drivers/gpu/drm/meson/meson_encoder_dsi.c b/drivers/gpu/drm/meson/meson_encoder_dsi.c
> index 812e172dec63..3f93c70488ca 100644
> --- a/drivers/gpu/drm/meson/meson_encoder_dsi.c
> +++ b/drivers/gpu/drm/meson/meson_encoder_dsi.c
> @@ -7,7 +7,6 @@
>  
>  #include <linux/kernel.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
>  #include <linux/of_graph.h>
>  
>  #include <drm/drm_atomic_helper.h>
> diff --git a/drivers/gpu/drm/meson/meson_encoder_hdmi.c b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
> index 53231bfdf7e2..9913971fa5d2 100644
> --- a/drivers/gpu/drm/meson/meson_encoder_hdmi.c
> +++ b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
> @@ -9,8 +9,10 @@
>  #include <linux/component.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/of_graph.h>
> +#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/reset.h>
>  
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> index 5deb79924897..b20ef6c8ea26 100644
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> @@ -3,6 +3,8 @@
>  
>  #include <linux/clk.h>
>  #include <linux/interconnect.h>
> +#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_domain.h>
>  #include <linux/pm_opp.h>
>  #include <soc/qcom/cmd-db.h>
> diff --git a/drivers/gpu/drm/msm/dp/dp_audio.c b/drivers/gpu/drm/msm/dp/dp_audio.c
> index 1245c7aa49df..4a2e479723a8 100644
> --- a/drivers/gpu/drm/msm/dp/dp_audio.c
> +++ b/drivers/gpu/drm/msm/dp/dp_audio.c
> @@ -6,7 +6,7 @@
>  
>  #define pr_fmt(fmt)	"[drm-dp] %s: " fmt, __func__
>  
> -#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
>  
>  #include <drm/display/drm_dp_helper.h>
>  #include <drm/drm_edid.h>
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
> index 3f6dfb4f9d5a..4c6d73e24bb5 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
> @@ -10,7 +10,7 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/interrupt.h>
>  #include <linux/mfd/syscon.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/of_graph.h>
>  #include <linux/of_irq.h>
>  #include <linux/pinctrl/consumer.h>
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> index 3132105a2a43..60509fb39710 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> @@ -7,6 +7,8 @@
>  
>  #include <linux/of_irq.h>
>  #include <linux/of_gpio.h>
> +#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
>  
>  #include <drm/drm_bridge_connector.h>
>  #include <drm/drm_of.h>
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy.c
> index 9780107e1cc9..3e00fb8190b2 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy.c
> @@ -3,7 +3,8 @@
>   * Copyright (c) 2016, The Linux Foundation. All rights reserved.
>   */
>  
> -#include <linux/of_device.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
>  
>  #include "hdmi.h"
>  
> diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c
> index 05648c910c68..6bf6c4a0f550 100644
> --- a/drivers/gpu/drm/msm/msm_mdss.c
> +++ b/drivers/gpu/drm/msm/msm_mdss.c
> @@ -10,6 +10,8 @@
>  #include <linux/irqchip.h>
>  #include <linux/irqdesc.h>
>  #include <linux/irqchip/chained_irq.h>
> +#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/reset.h>
>  
> diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c
> index c9d8cbb21407..5e8dc88efea1 100644
> --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c
> +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c
> @@ -10,7 +10,6 @@
>  #include <linux/io.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/of_graph.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
> diff --git a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c
> index 1cc0f1d09684..662c7bcbe6e5 100644
> --- a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c
> +++ b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c
> @@ -11,7 +11,8 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/media-bus-format.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
>  #include <linux/regmap.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/spi/spi.h>
> diff --git a/drivers/gpu/drm/panel/panel-auo-a030jtn01.c b/drivers/gpu/drm/panel/panel-auo-a030jtn01.c
> index 3c976a98de6a..6c86ebf2cad7 100644
> --- a/drivers/gpu/drm/panel/panel-auo-a030jtn01.c
> +++ b/drivers/gpu/drm/panel/panel-auo-a030jtn01.c
> @@ -11,8 +11,8 @@
>  #include <linux/device.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/media-bus-format.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
>  #include <linux/regmap.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/spi/spi.h>
> diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
> index d879b3b14c48..11b64acbe8a9 100644
> --- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c
> +++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
> @@ -10,7 +10,6 @@
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  
>  #include <linux/gpio/consumer.h>
>  #include <linux/regulator/consumer.h>
> diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> index dc276c346fd1..5ac926281d2c 100644
> --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> @@ -8,7 +8,6 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/regulator/consumer.h>
>  
>  #include <drm/drm_connector.h>
> diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c b/drivers/gpu/drm/panel/panel-dsi-cm.c
> index ba17bcc4461c..6b3f4d664d2a 100644
> --- a/drivers/gpu/drm/panel/panel-dsi-cm.c
> +++ b/drivers/gpu/drm/panel/panel-dsi-cm.c
> @@ -11,7 +11,7 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/jiffies.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/regulator/consumer.h>
>  
>  #include <drm/drm_connector.h>
> diff --git a/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c b/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c
> index 76572c922983..986e3e192881 100644
> --- a/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c
> +++ b/drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c
> @@ -7,7 +7,6 @@
>  #include <linux/delay.h>
>  #include <linux/mod_devicetable.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
>  #include <linux/regulator/consumer.h>
>  
>  #include <drm/drm_mipi_dsi.h>
> diff --git a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c
> index df493da50afe..48e3acaecdf3 100644
> --- a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c
> +++ b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c
> @@ -11,7 +11,7 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/delay.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/regulator/consumer.h>
>  
>  #define FEIYANG_INIT_CMD_LEN	2
> diff --git a/drivers/gpu/drm/panel/panel-himax-hx8394.c b/drivers/gpu/drm/panel/panel-himax-hx8394.c
> index d4fb5d1b295b..c73243d85de7 100644
> --- a/drivers/gpu/drm/panel/panel-himax-hx8394.c
> +++ b/drivers/gpu/drm/panel/panel-himax-hx8394.c
> @@ -15,7 +15,7 @@
>  #include <linux/media-bus-format.h>
>  #include <linux/mod_devicetable.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/regulator/consumer.h>
>  
>  #include <video/mipi_display.h>
> diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> index 3dfafa585127..61c872f0f7ca 100644
> --- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> @@ -22,7 +22,8 @@
>  #include <linux/bitops.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
>  #include <linux/regmap.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/spi/spi.h>
> diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9341.c b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c
> index 3fdf884b3257..3574681891e8 100644
> --- a/drivers/gpu/drm/panel/panel-ilitek-ili9341.c
> +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c
> @@ -23,7 +23,7 @@
>  #include <linux/delay.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/spi/spi.h>
>  
> diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
> index 1ec696adf9de..72dbb8184280 100644
> --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
> +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
> @@ -9,7 +9,7 @@
>  #include <linux/errno.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  
>  #include <linux/gpio/consumer.h>
>  #include <linux/regulator/consumer.h>
> diff --git a/drivers/gpu/drm/panel/panel-innolux-ej030na.c b/drivers/gpu/drm/panel/panel-innolux-ej030na.c
> index b2b0ebc9e943..8fdbda59be48 100644
> --- a/drivers/gpu/drm/panel/panel-innolux-ej030na.c
> +++ b/drivers/gpu/drm/panel/panel-innolux-ej030na.c
> @@ -11,7 +11,8 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/media-bus-format.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
>  #include <linux/regmap.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/spi/spi.h>
> diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> index 9992d0d4c0e5..485178a99910 100644
> --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> @@ -7,7 +7,6 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/regulator/consumer.h>
>  
>  #include <video/mipi_display.h>
> diff --git a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c b/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c
> index 323c33c9c37a..4879835fe101 100644
> --- a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c
> +++ b/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c
> @@ -16,7 +16,7 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/delay.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/regulator/consumer.h>
>  
>  #define JD9365DA_INIT_CMD_LEN		2
> diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
> index d2efd887484b..d41482d3a34f 100644
> --- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
> +++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
> @@ -8,7 +8,6 @@
>  #include <linux/media-bus-format.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/regulator/consumer.h>
>  
>  #include <video/display_timing.h>
> diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
> index de8758c30e6e..6c46985237c6 100644
> --- a/drivers/gpu/drm/panel/panel-lvds.c
> +++ b/drivers/gpu/drm/panel/panel-lvds.c
> @@ -10,7 +10,7 @@
>  
>  #include <linux/gpio/consumer.h>
>  #include <linux/module.h>
> -#include <linux/of_platform.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/slab.h>
> diff --git a/drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c b/drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c
> index 26d358b9b85a..799c2161fc85 100644
> --- a/drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c
> +++ b/drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c
> @@ -18,7 +18,6 @@
>  #include <linux/media-bus-format.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/spi/spi.h>
>  
> diff --git a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
> index 9243b2ad828d..ea4a6bf6d35b 100644
> --- a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
> +++ b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
> @@ -10,7 +10,7 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/media-bus-format.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/regulator/consumer.h>
>  
>  #include <video/mipi_display.h>
> diff --git a/drivers/gpu/drm/panel/panel-newvision-nv3051d.c b/drivers/gpu/drm/panel/panel-newvision-nv3051d.c
> index a07958038ffd..ad98dd9322b4 100644
> --- a/drivers/gpu/drm/panel/panel-newvision-nv3051d.c
> +++ b/drivers/gpu/drm/panel/panel-newvision-nv3051d.c
> @@ -13,7 +13,7 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/media-bus-format.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/regulator/consumer.h>
>  
>  #include <video/display_timing.h>
> diff --git a/drivers/gpu/drm/panel/panel-newvision-nv3052c.c b/drivers/gpu/drm/panel/panel-newvision-nv3052c.c
> index cf078f0d3cd3..71e57de6d8b2 100644
> --- a/drivers/gpu/drm/panel/panel-newvision-nv3052c.c
> +++ b/drivers/gpu/drm/panel/panel-newvision-nv3052c.c
> @@ -11,7 +11,8 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/media-bus-format.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/spi/spi.h>
>  #include <video/mipi_display.h>
> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35510.c b/drivers/gpu/drm/panel/panel-novatek-nt35510.c
> index 493c3c23f0d6..d6dceb858008 100644
> --- a/drivers/gpu/drm/panel/panel-novatek-nt35510.c
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt35510.c
> @@ -26,7 +26,7 @@
>  #include <linux/bitops.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/regmap.h>
>  #include <linux/regulator/consumer.h>
>  
> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35560.c b/drivers/gpu/drm/panel/panel-novatek-nt35560.c
> index cc7f96d70826..5bbea734123b 100644
> --- a/drivers/gpu/drm/panel/panel-novatek-nt35560.c
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt35560.c
> @@ -18,7 +18,6 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/regulator/consumer.h>
>  
>  #include <video/mipi_display.h>
> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35950.c b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
> index 8b108ac80b55..412ca84d0581 100644
> --- a/drivers/gpu/drm/panel/panel-novatek-nt35950.c
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
> @@ -8,7 +8,7 @@
>  #include <linux/delay.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/of_graph.h>
>  #include <linux/regulator/consumer.h>
>  
> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36523.c b/drivers/gpu/drm/panel/panel-novatek-nt36523.c
> index c3befa7f253d..9632b9e95b71 100644
> --- a/drivers/gpu/drm/panel/panel-novatek-nt36523.c
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt36523.c
> @@ -9,7 +9,7 @@
>  #include <linux/delay.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/of_graph.h>
>  #include <linux/regulator/consumer.h>
>  
> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36672a.c b/drivers/gpu/drm/panel/panel-novatek-nt36672a.c
> index 73bcffa1e0c1..33fb3d715e54 100644
> --- a/drivers/gpu/drm/panel/panel-novatek-nt36672a.c
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt36672a.c
> @@ -16,7 +16,6 @@
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  
>  #include <linux/gpio/consumer.h>
>  #include <linux/pinctrl/consumer.h>
> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt39016.c b/drivers/gpu/drm/panel/panel-novatek-nt39016.c
> index f58cfb10b58a..059260262b5a 100644
> --- a/drivers/gpu/drm/panel/panel-novatek-nt39016.c
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt39016.c
> @@ -12,7 +12,6 @@
>  #include <linux/media-bus-format.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/regmap.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/spi/spi.h>
> diff --git a/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c b/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c
> index e46be5014d42..c415dacf1816 100644
> --- a/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c
> +++ b/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c
> @@ -12,7 +12,6 @@
>  #include <linux/media-bus-format.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/regmap.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/spi/spi.h>
> diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> index 90ea91e4311d..4618c892cdd6 100644
> --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> @@ -47,7 +47,6 @@
>  #include <linux/media-bus-format.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/of_graph.h>
>  #include <linux/pm.h>
>  
> diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c
> index 008e2b0d6652..79f611963c61 100644
> --- a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c
> +++ b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c
> @@ -11,7 +11,7 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/delay.h>
> -#include <linux/of_device.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/module.h>
>  
>  struct s6d16d0 {
> diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c b/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c
> index 102e1fc7ee38..0755f85a44bd 100644
> --- a/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c
> +++ b/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c
> @@ -11,7 +11,6 @@
>  #include <linux/module.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  
>  #include <video/mipi_display.h>
>  #include <drm/drm_mipi_dsi.h>
> diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c
> index 39eef3dce7c9..639a4fdf57bb 100644
> --- a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c
> +++ b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c
> @@ -12,7 +12,7 @@
>  #include <linux/delay.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/regulator/consumer.h>
>  
>  #include <drm/drm_mipi_dsi.h>
> diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c
> index ed3895e4ca5e..a89d925fdfb2 100644
> --- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c
> +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c
> @@ -6,7 +6,7 @@
>  
>  #include <linux/module.h>
>  #include <linux/delay.h>
> -#include <linux/of_device.h>
> +#include <linux/mod_devicetable.h>
>  
>  #include <drm/drm_mipi_dsi.h>
>  #include <drm/drm_print.h>
> diff --git a/drivers/gpu/drm/panel/panel-samsung-sofef00.c b/drivers/gpu/drm/panel/panel-samsung-sofef00.c
> index 1ebb79e3103c..cbf9607dd576 100644
> --- a/drivers/gpu/drm/panel/panel-samsung-sofef00.c
> +++ b/drivers/gpu/drm/panel/panel-samsung-sofef00.c
> @@ -8,7 +8,6 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/backlight.h>
>  
> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7701.c b/drivers/gpu/drm/panel/panel-sitronix-st7701.c
> index 7eae83aa0ea1..0459965e1b4f 100644
> --- a/drivers/gpu/drm/panel/panel-sitronix-st7701.c
> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7701.c
> @@ -12,7 +12,7 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/delay.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/regulator/consumer.h>
>  
>  #include <video/mipi_display.h>
> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> index 3aa31f3d6157..6a3945639535 100644
> --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> @@ -13,7 +13,7 @@
>  #include <linux/media-bus-format.h>
>  #include <linux/mod_devicetable.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/regulator/consumer.h>
>  
>  #include <video/display_timing.h>
> diff --git a/drivers/gpu/drm/panel/panel-sony-td4353-jdi.c b/drivers/gpu/drm/panel/panel-sony-td4353-jdi.c
> index 8d8813dbaa45..1bde2f01786b 100644
> --- a/drivers/gpu/drm/panel/panel-sony-td4353-jdi.c
> +++ b/drivers/gpu/drm/panel/panel-sony-td4353-jdi.c
> @@ -14,7 +14,6 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/regulator/consumer.h>
>  
>  #include <video/mipi_display.h>
> diff --git a/drivers/gpu/drm/panel/panel-truly-nt35597.c b/drivers/gpu/drm/panel/panel-truly-nt35597.c
> index b31cffb660a7..4f4009f9fe25 100644
> --- a/drivers/gpu/drm/panel/panel-truly-nt35597.c
> +++ b/drivers/gpu/drm/panel/panel-truly-nt35597.c
> @@ -7,7 +7,7 @@
>  #include <linux/delay.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/of_graph.h>
>  #include <linux/pinctrl/consumer.h>
>  #include <linux/regulator/consumer.h>
> diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> index ec228c269146..c2806e4fd553 100644
> --- a/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> +++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> @@ -5,7 +5,7 @@
>  
>  #include <linux/delay.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/regulator/consumer.h>
>  
> diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
> index bbada731bbbd..20c25c836198 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_drv.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
> @@ -4,8 +4,9 @@
>  /* Copyright 2019 Collabora ltd. */
>  
>  #include <linux/module.h>
> -#include <linux/of_platform.h>
> +#include <linux/of.h>
>  #include <linux/pagemap.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <drm/panfrost_drm.h>
>  #include <drm/drm_drv.h>
> diff --git a/drivers/gpu/drm/pl111/pl111_versatile.c b/drivers/gpu/drm/pl111/pl111_versatile.c
> index 00c3ebd32359..1e4b28d03f4d 100644
> --- a/drivers/gpu/drm/pl111/pl111_versatile.c
> +++ b/drivers/gpu/drm/pl111/pl111_versatile.c
> @@ -15,6 +15,7 @@
>  #include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/of_platform.h>
> +#include <linux/platform_device.h>
>  #include <linux/regmap.h>
>  #include <linux/vexpress.h>
>  
> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c
> index 1ffde19cb87f..3904b0cca814 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c
> @@ -12,7 +12,7 @@
>  #include <linux/io.h>
>  #include <linux/mm.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm.h>
>  #include <linux/slab.h>
> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> index adfb36b0e815..9ff4537c26c8 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> @@ -20,8 +20,10 @@
>  
>  #include <linux/device.h>
>  #include <linux/dma-buf.h>
> +#include <linux/of.h>
>  #include <linux/of_graph.h>
>  #include <linux/of_platform.h>
> +#include <linux/platform_device.h>
>  #include <linux/wait.h>
>  
>  #include "rcar_du_crtc.h"
> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> index 45c05d0ffc70..9cbb5e6e2cba 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> @@ -22,6 +22,7 @@
>  #include <linux/bitops.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/of_platform.h>
> +#include <linux/platform_device.h>
>  #include <linux/scatterlist.h>
>  #include <linux/slab.h>
>  #include <linux/videodev2.h>
> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c
> index e10e4d4b89a2..db2e6f16f954 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c
> @@ -12,7 +12,6 @@
>  #include <linux/math64.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/of_graph.h>
>  #include <linux/platform_device.h>
>  #include <linux/reset.h>
> diff --git a/drivers/gpu/drm/renesas/rcar-du/rzg2l_mipi_dsi.c b/drivers/gpu/drm/renesas/rcar-du/rzg2l_mipi_dsi.c
> index aa95b85a2964..8048bdca2d6c 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rzg2l_mipi_dsi.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rzg2l_mipi_dsi.c
> @@ -10,7 +10,6 @@
>  #include <linux/iopoll.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/of_graph.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> index ad2d3ae7e621..255e6eab8544 100644
> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> @@ -10,8 +10,9 @@
>  
>  #include <linux/component.h>
>  #include <linux/mfd/syscon.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/of_graph.h>
> +#include <linux/platform_device.h>
>  #include <linux/regmap.h>
>  #include <linux/reset.h>
>  #include <linux/clk.h>
> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> index 917e79951aac..2744d8f4a6fa 100644
> --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> @@ -12,7 +12,9 @@
>  #include <linux/mfd/syscon.h>
>  #include <linux/module.h>
>  #include <linux/of_device.h>
> +#include <linux/of_platform.h>
>  #include <linux/phy/phy.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/regmap.h>
>  
> diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c
> index 9afb889963c1..751e694b39cd 100644
> --- a/drivers/gpu/drm/rockchip/inno_hdmi.c
> +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
> @@ -11,9 +11,10 @@
>  #include <linux/err.h>
>  #include <linux/hdmi.h>
>  #include <linux/mfd/syscon.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/module.h>
>  #include <linux/mutex.h>
> -#include <linux/of_device.h>
> +#include <linux/platform_device.h>
>  
>  #include <drm/drm_atomic_helper.h>
>  #include <drm/drm_edid.h>
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> index d97f2edc646b..01954a0b5696 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> @@ -7,6 +7,7 @@
>   */
>  
>  #include <linux/dma-mapping.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/module.h>
>  #include <linux/of_graph.h>
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index a530ecc4d207..86fd9f51c692 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -12,7 +12,6 @@
>  #include <linux/log2.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/overflow.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> index ca73b8ccc29f..583df4d22f7e 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> @@ -13,7 +13,6 @@
>  #include <linux/mfd/syscon.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/of_graph.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
> diff --git a/drivers/gpu/drm/sprd/sprd_dpu.c b/drivers/gpu/drm/sprd/sprd_dpu.c
> index b96fc6837b0d..48183bbd0590 100644
> --- a/drivers/gpu/drm/sprd/sprd_dpu.c
> +++ b/drivers/gpu/drm/sprd/sprd_dpu.c
> @@ -9,10 +9,8 @@
>  #include <linux/io.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_address.h>
> -#include <linux/of_device.h>
>  #include <linux/of_graph.h>
> -#include <linux/of_irq.h>
> +#include <linux/platform_device.h>
>  #include <linux/wait.h>
>  #include <linux/workqueue.h>
>  
> diff --git a/drivers/gpu/drm/sprd/sprd_drm.c b/drivers/gpu/drm/sprd/sprd_drm.c
> index be60c0d546a3..0aa39156f2fa 100644
> --- a/drivers/gpu/drm/sprd/sprd_drm.c
> +++ b/drivers/gpu/drm/sprd/sprd_drm.c
> @@ -5,10 +5,11 @@
>  
>  #include <linux/component.h>
>  #include <linux/dma-mapping.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/module.h>
>  #include <linux/mutex.h>
>  #include <linux/of_graph.h>
> -#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
>  
>  #include <drm/drm_atomic_helper.h>
>  #include <drm/drm_drv.h>
> diff --git a/drivers/gpu/drm/sprd/sprd_dsi.c b/drivers/gpu/drm/sprd/sprd_dsi.c
> index ab0e5cce7adb..d7b143a75601 100644
> --- a/drivers/gpu/drm/sprd/sprd_dsi.c
> +++ b/drivers/gpu/drm/sprd/sprd_dsi.c
> @@ -5,10 +5,8 @@
>  
>  #include <linux/component.h>
>  #include <linux/module.h>
> -#include <linux/of_address.h>
> -#include <linux/of_device.h>
> -#include <linux/of_irq.h>
> -#include <linux/of_graph.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
>  #include <video/mipi_display.h>
>  
>  #include <drm/drm_atomic_helper.h>
> diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
> index 1b87b5899f9e..deb75b61e4cf 100644
> --- a/drivers/gpu/drm/sti/sti_drv.c
> +++ b/drivers/gpu/drm/sti/sti_drv.c
> @@ -8,7 +8,9 @@
>  #include <linux/dma-mapping.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
> +#include <linux/of.h>
>  #include <linux/of_platform.h>
> +#include <linux/platform_device.h>
>  
>  #include <drm/drm_atomic.h>
>  #include <drm/drm_atomic_helper.h>
> diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
> index cb4404b3ce62..e507739ced0c 100644
> --- a/drivers/gpu/drm/stm/drv.c
> +++ b/drivers/gpu/drm/stm/drv.c
> @@ -10,8 +10,9 @@
>  
>  #include <linux/component.h>
>  #include <linux/dma-mapping.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/module.h>
> -#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  
>  #include <drm/drm_aperture.h>
> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> index b8be4c1db423..5576fdae4962 100644
> --- a/drivers/gpu/drm/stm/ltdc.c
> +++ b/drivers/gpu/drm/stm/ltdc.c
> @@ -14,7 +14,6 @@
>  #include <linux/interrupt.h>
>  #include <linux/media-bus-format.h>
>  #include <linux/module.h>
> -#include <linux/of_address.h>
>  #include <linux/of_graph.h>
>  #include <linux/pinctrl/consumer.h>
>  #include <linux/platform_device.h>
> diff --git a/drivers/gpu/drm/sun4i/sun4i_frontend.c b/drivers/gpu/drm/sun4i/sun4i_frontend.c
> index 799ab7460ae5..e156a9e97fd8 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_frontend.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_frontend.c
> @@ -7,7 +7,7 @@
>  #include <linux/clk.h>
>  #include <linux/component.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/regmap.h>
> diff --git a/drivers/gpu/drm/sun4i/sun4i_frontend.h b/drivers/gpu/drm/sun4i/sun4i_frontend.h
> index 2e7b76e50c2b..61c24088772c 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_frontend.h
> +++ b/drivers/gpu/drm/sun4i/sun4i_frontend.h
> @@ -8,6 +8,7 @@
>  #define _SUN4I_FRONTEND_H_
>  
>  #include <linux/list.h>
> +#include <linux/mod_devicetable.h>
>  
>  #define SUN4I_FRONTEND_EN_REG			0x000
>  #define SUN4I_FRONTEND_EN_EN				BIT(0)
> diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
> index c0df5e892fa7..ac4e07142378 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
> @@ -10,7 +10,7 @@
>  #include <linux/i2c.h>
>  #include <linux/iopoll.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/regmap.h>
> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> index 6a52fb12cbfb..662027f137a6 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> @@ -10,9 +10,9 @@
>  #include <linux/ioport.h>
>  #include <linux/media-bus-format.h>
>  #include <linux/module.h>
> -#include <linux/of_address.h>
> -#include <linux/of_device.h>
> -#include <linux/of_irq.h>
> +#include <linux/of.h>
> +#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
>  #include <linux/regmap.h>
>  #include <linux/reset.h>
>  
> diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
> index 7cab4213a680..a450f33fb02a 100644
> --- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
> +++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
> @@ -5,7 +5,7 @@
>  
>  #include <linux/component.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  
>  #include <drm/drm_modeset_helper_vtables.h>
> diff --git a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c
> index ca53b5e9fffc..4fa69c463dc4 100644
> --- a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c
> +++ b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c
> @@ -4,8 +4,9 @@
>   */
>  
>  #include <linux/delay.h>
> -#include <linux/of_address.h>
> +#include <linux/of.h>
>  #include <linux/of_platform.h>
> +#include <linux/platform_device.h>
>  
>  #include "sun8i_dw_hdmi.h"
>  
> diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c
> index 11d5244a5aa5..dac442f94128 100644
> --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
> +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
> @@ -10,8 +10,10 @@
>  #include <linux/component.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/module.h>
> +#include <linux/of.h>
>  #include <linux/of_device.h>
>  #include <linux/of_graph.h>
> +#include <linux/platform_device.h>
>  #include <linux/reset.h>
>  
>  #include <drm/drm_atomic_helper.h>
> diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
> index da97682b6835..a7cb2b0ffb02 100644
> --- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
> +++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
> @@ -7,7 +7,7 @@
>  #include <linux/device.h>
>  #include <linux/io.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/of_graph.h>
>  #include <linux/platform_device.h>
>  
> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
> index 6e78416e64b0..13b182ab905f 100644
> --- a/drivers/gpu/drm/tegra/dc.c
> +++ b/drivers/gpu/drm/tegra/dc.c
> @@ -11,7 +11,8 @@
>  #include <linux/iommu.h>
>  #include <linux/interconnect.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_domain.h>
>  #include <linux/pm_opp.h>
>  #include <linux/pm_runtime.h>
> diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c
> index 4d2677dcd831..96a8afcab3ef 100644
> --- a/drivers/gpu/drm/tegra/dpaux.c
> +++ b/drivers/gpu/drm/tegra/dpaux.c
> @@ -8,7 +8,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/io.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/pinctrl/pinconf-generic.h>
>  #include <linux/pinctrl/pinctrl.h>
>  #include <linux/pinctrl/pinmux.h>
> diff --git a/drivers/gpu/drm/tegra/gr2d.c b/drivers/gpu/drm/tegra/gr2d.c
> index 50f77fddda54..4c55133467a0 100644
> --- a/drivers/gpu/drm/tegra/gr2d.c
> +++ b/drivers/gpu/drm/tegra/gr2d.c
> @@ -7,7 +7,8 @@
>  #include <linux/delay.h>
>  #include <linux/iommu.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/reset.h>
>  
> diff --git a/drivers/gpu/drm/tegra/gr3d.c b/drivers/gpu/drm/tegra/gr3d.c
> index c026c2c916c1..2768f8f073ed 100644
> --- a/drivers/gpu/drm/tegra/gr3d.c
> +++ b/drivers/gpu/drm/tegra/gr3d.c
> @@ -9,7 +9,7 @@
>  #include <linux/host1x.h>
>  #include <linux/iommu.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_domain.h>
>  #include <linux/pm_opp.h>
> diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
> index 6eac54ae1205..00be307ca070 100644
> --- a/drivers/gpu/drm/tegra/hdmi.c
> +++ b/drivers/gpu/drm/tegra/hdmi.c
> @@ -10,7 +10,8 @@
>  #include <linux/hdmi.h>
>  #include <linux/math64.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_opp.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/regulator/consumer.h>
> diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c
> index 916857361a91..1af5f8318d91 100644
> --- a/drivers/gpu/drm/tegra/hub.c
> +++ b/drivers/gpu/drm/tegra/hub.c
> @@ -9,8 +9,8 @@
>  #include <linux/host1x.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/of_graph.h>
> +#include <linux/of_platform.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/reset.h>
> diff --git a/drivers/gpu/drm/tegra/nvdec.c b/drivers/gpu/drm/tegra/nvdec.c
> index ae78a81e5eef..f821e36111a7 100644
> --- a/drivers/gpu/drm/tegra/nvdec.c
> +++ b/drivers/gpu/drm/tegra/nvdec.c
> @@ -11,8 +11,6 @@
>  #include <linux/iopoll.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
> -#include <linux/of_platform.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/reset.h>
> diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
> index abd6e3b92293..93471b70e180 100644
> --- a/drivers/gpu/drm/tegra/sor.c
> +++ b/drivers/gpu/drm/tegra/sor.c
> @@ -8,7 +8,7 @@
>  #include <linux/debugfs.h>
>  #include <linux/io.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/regulator/consumer.h>
> diff --git a/drivers/gpu/drm/tegra/vic.c b/drivers/gpu/drm/tegra/vic.c
> index da7a038dca20..5da989ac700e 100644
> --- a/drivers/gpu/drm/tegra/vic.c
> +++ b/drivers/gpu/drm/tegra/vic.c
> @@ -10,8 +10,6 @@
>  #include <linux/iommu.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
> -#include <linux/of_platform.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/reset.h>
> diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c
> index dca077411f77..da6b2b01f7bd 100644
> --- a/drivers/gpu/drm/tidss/tidss_dispc.c
> +++ b/drivers/gpu/drm/tidss/tidss_dispc.c
> @@ -15,8 +15,6 @@
>  #include <linux/module.h>
>  #include <linux/mfd/syscon.h>
>  #include <linux/of.h>
> -#include <linux/of_graph.h>
> -#include <linux/of_device.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/regmap.h>
> diff --git a/drivers/gpu/drm/tidss/tidss_drv.c b/drivers/gpu/drm/tidss/tidss_drv.c
> index 3f5f27fb6ebc..1f06a6284770 100644
> --- a/drivers/gpu/drm/tidss/tidss_drv.c
> +++ b/drivers/gpu/drm/tidss/tidss_drv.c
> @@ -5,7 +5,7 @@
>   */
>  
>  #include <linux/console.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/module.h>
>  #include <linux/pm_runtime.h>
>  
> diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
> index bef9d45ef1df..7b30e4675559 100644
> --- a/drivers/gpu/drm/vc4/vc4_crtc.c
> +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
> @@ -31,7 +31,8 @@
>  
>  #include <linux/clk.h>
>  #include <linux/component.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  
>  #include <drm/drm_atomic.h>
> diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
> index e68c07d86040..333f77609dba 100644
> --- a/drivers/gpu/drm/vc4/vc4_dpi.c
> +++ b/drivers/gpu/drm/vc4/vc4_dpi.c
> @@ -22,8 +22,8 @@
>  #include <linux/clk.h>
>  #include <linux/component.h>
>  #include <linux/media-bus-format.h>
> -#include <linux/of_graph.h>
> -#include <linux/of_platform.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/platform_device.h>
>  #include "vc4_drv.h"
>  #include "vc4_regs.h"
>  
> diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
> index 823395c23cc3..272c6503aac9 100644
> --- a/drivers/gpu/drm/vc4/vc4_drv.c
> +++ b/drivers/gpu/drm/vc4/vc4_drv.c
> @@ -26,7 +26,7 @@
>  #include <linux/dma-mapping.h>
>  #include <linux/io.h>
>  #include <linux/module.h>
> -#include <linux/of_platform.h>
> +#include <linux/of_device.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  
> diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
> index 9e0c355b236f..46f28e04cefc 100644
> --- a/drivers/gpu/drm/vc4/vc4_dsi.c
> +++ b/drivers/gpu/drm/vc4/vc4_dsi.c
> @@ -25,8 +25,9 @@
>  #include <linux/dma-mapping.h>
>  #include <linux/dmaengine.h>
>  #include <linux/io.h>
> +#include <linux/of.h>
>  #include <linux/of_address.h>
> -#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  
>  #include <drm/drm_atomic_helper.h>
> diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
> index 5261526d286f..a9515eb7b587 100644
> --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
> +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
> @@ -41,8 +41,8 @@
>  #include <linux/component.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/i2c.h>
> +#include <linux/of.h>
>  #include <linux/of_address.h>
> -#include <linux/of_platform.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/rational.h>
>  #include <linux/reset.h>
> diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c
> index c5abdec03103..136fb4f4fe7a 100644
> --- a/drivers/gpu/drm/vc4/vc4_txp.c
> +++ b/drivers/gpu/drm/vc4/vc4_txp.c
> @@ -9,8 +9,8 @@
>  
>  #include <linux/clk.h>
>  #include <linux/component.h>
> -#include <linux/of_graph.h>
> -#include <linux/of_platform.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  
>  #include <drm/drm_atomic.h>
> diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c
> index d6e6a1a22eba..26441be41265 100644
> --- a/drivers/gpu/drm/vc4/vc4_vec.c
> +++ b/drivers/gpu/drm/vc4/vc4_vec.c
> @@ -21,8 +21,8 @@
>  #include <drm/drm_simple_kms_helper.h>
>  #include <linux/clk.h>
>  #include <linux/component.h>
> -#include <linux/of_graph.h>
> -#include <linux/of_platform.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  
>  #include "vc4_drv.h"
> diff --git a/drivers/gpu/drm/xen/xen_drm_front.c b/drivers/gpu/drm/xen/xen_drm_front.c
> index 90996c108146..a83f054d0a8b 100644
> --- a/drivers/gpu/drm/xen/xen_drm_front.c
> +++ b/drivers/gpu/drm/xen/xen_drm_front.c
> @@ -11,7 +11,6 @@
>  #include <linux/delay.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
>  
>  #include <drm/drm_atomic_helper.h>
>  #include <drm/drm_drv.h>
> diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c
> index c35eac1116f5..71ec1e7f657a 100644
> --- a/drivers/gpu/ipu-v3/ipu-common.c
> +++ b/drivers/gpu/ipu-v3/ipu-common.c
> @@ -18,7 +18,7 @@
>  #include <linux/irq.h>
>  #include <linux/irqchip/chained_irq.h>
>  #include <linux/irqdomain.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/of_graph.h>
>  
>  #include <drm/drm_fourcc.h>
> -- 
> 2.40.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    Â¯\_(ãƒ„)_/Â¯


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 11:49:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 11:49:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564452.881866 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLMjM-0005Sq-6Q; Mon, 17 Jul 2023 11:49:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564452.881866; Mon, 17 Jul 2023 11:49:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLMjM-0005Sj-3P; Mon, 17 Jul 2023 11:49:32 +0000
Received: by outflank-mailman (input) for mailman id 564452;
 Mon, 17 Jul 2023 11:49:30 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLMjK-0005SZ-Hz; Mon, 17 Jul 2023 11:49:30 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLMjK-0003pM-7h; Mon, 17 Jul 2023 11:49:30 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLMjJ-0004fv-Qf; Mon, 17 Jul 2023 11:49:29 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLMjJ-00065z-QL; Mon, 17 Jul 2023 11:49:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=TDw0+iTFoq3qFQ14Z1Em58Zob7+ldX1Q9Kye0ZSXfKs=; b=Z/4/A7OdQVjmr+HtkcpQ9710q0
	Ko9kxFNxgulLp+TOi98cW67oadA4sgRFB7WMlJGhiqVeWOUGmtqbaFfjzsfrSLlDpM4r80u6n6kOu
	IuL3uTU8enCAUHW0akBnRG6H1mZGTJ1D12aMYvvHpbI/sahSL1Jz2O7CnwhrPdDoAM2E=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181835-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181835: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=813da5f0e73b8cbd2ac3c7922506e58c28cd736d
X-Osstest-Versions-That:
    xen=d27d274ffab06b42e5680073db11b592d282d53d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 17 Jul 2023 11:49:29 +0000

flight 181835 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181835/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  813da5f0e73b8cbd2ac3c7922506e58c28cd736d
baseline version:
 xen                  d27d274ffab06b42e5680073db11b592d282d53d

Last test of basis   181798  2023-07-14 17:01:54 Z    2 days
Testing same since   181835  2023-07-17 09:01:59 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Federico Serafini <federico.serafini@bugseng.com>
  Gianluca Luparini <gianluca.luparini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>
  Simone Ballarin <simone.ballarin@bugseng.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   d27d274ffa..813da5f0e7  813da5f0e73b8cbd2ac3c7922506e58c28cd736d -> smoke


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 11:50:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 11:50:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564455.881877 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLMjg-0005rR-FD; Mon, 17 Jul 2023 11:49:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564455.881877; Mon, 17 Jul 2023 11:49:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLMjg-0005rK-C9; Mon, 17 Jul 2023 11:49:52 +0000
Received: by outflank-mailman (input) for mailman id 564455;
 Mon, 17 Jul 2023 11:49:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLMje-0005nK-Sa
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 11:49:50 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on2060f.outbound.protection.outlook.com
 [2a01:111:f400:fe16::60f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 08511dc5-2498-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 13:49:49 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS4PR04MB9340.eurprd04.prod.outlook.com (2603:10a6:20b:4e8::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 11:49:46 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 11:49:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 08511dc5-2498-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Iyl1Oo8DB/kCRdv0R84EN5n7GDu0dtuzo7OtTj4H5XHw5wEcYGsCULLStxBcM4mlP4mipYatrm6cATI7eBxbPubQcQ6vHLzGTjYm8nUkOwcOibCGcaft8ELtaJV836IjlUpsP/bYkW9Xqb+mtV3pnYI8ViCnBV9A/XZJYN4fkBPT4QrpK6PEa/8rEsKlEvARQJ7A5wTXKkY6/gK2soasOGFIk4uO5dlcgJfv59l/j/UQx7fDmmku+1+vmc0DTet3ZiHlOHBtfuEffENeX/i3OPaG5s0tnET24XaHJJ7TCNIqPZaf+KhPJZYYLNGNG7vK0xIqNzm0I+Y5eja7PgggMA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=G2hGiGSrw+OF/jiEOTj/fWw3gTtw4oQnJMlMtS2g2eo=;
 b=jnfZl6zcAsEuVaoP/IvEMGjQgdQwrexHulLCdRCEYshAziY1xx1eiORVwK5rbHwmuA7mIIFt6ccNidD0Vz/VNBtg4zjsjVihn2HA2M5ADvbLbwaGosPoOG5M+KKjEUlOqv8mC7LEu3XwH5PCTg3dPftdrYbdnTDsTEJps1knNkOV5ahU47oBK5tc047NS2+dYUqyUIjgkh7SrW30dGVuGDtyDItktCz5JeEMPE7eL41lP4y0VLhhUUyLZ+TCmBKSHiJF6boNDFSTQ/OZln1mN1fAOlTK/G2K8dC2xTMpHfnRgG9u8yq506C7vhMVjTDm97/sVIXHIEItH5kKVvBjNg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=G2hGiGSrw+OF/jiEOTj/fWw3gTtw4oQnJMlMtS2g2eo=;
 b=I/16AX3aoY6n3wnXIpKb6Vuzyx4B1rBr7e7EAIujMg2xOLTUjGEOVP7L2ZLxFG6p9IjFIevmE2bG70bGHWaFN84oMJgMfPheNQqvugty/W4nYqOa7wlohrzkqO9G21hl33YyHpKertqz6h71PonwUurPYZGDvqHv2ejUWts0adaSm0SP69Iw7UYIOlFJnhzFJ+TmPjMdy4wqe8Ag2Q2BUmI+4tJt51L6NTAY10C2sGSN4h1AvUra+MHQR2Sewfj+ZdyqBLTcODnHulf6PT8HrmU5r6juOfdBtKXUBOT5QCcEuBVA38L1JnHZNn+VHpxeAdQXeWBpa79uwNFabQ8HMQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <f254729d-1b6c-8aaf-98d5-c1b739519081@suse.com>
Date: Mon, 17 Jul 2023 13:49:43 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] x86/HVM: adjust pIRQ calculation in hvm_inject_msi()
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 Simone Ballarin <simone.ballarin@bugseng.com>,
 Gianluca Luparini <gianluca.luparini@bugseng.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <5cfda162-07a3-8a02-4511-b0578b12dbc2@suse.com>
 <ZLUdTB_gZjRzhpJe@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZLUdTB_gZjRzhpJe@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0140.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9e::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS4PR04MB9340:EE_
X-MS-Office365-Filtering-Correlation-Id: ad36f198-9379-40c2-bcce-08db86bbeaeb
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	n2qOyv6lxsTcOao3IjmMeP8QhiJqTOUvxg6ZKbtXF+abvopnK5TMNmGfy0SYDa9PffoObCOGHQEp1xHGLHCnYnEDhGSc5zQ85yKSqXyo67uINsxwpMzaSQVMld8j0ypL4WVf2IwJaGLaorL/bBCTd8vTkrC2WuGE8X9sD319/bUb0NVyiMlqi8pdI8e9OVuk1i3+M24W/L3k3kfSrsQQOvR3nRdKEvG/Ql8SUX7AZQ3wITVwbqj15wGOiysbXz3hrDcPai6YZ7LxmUIqa9ASmqyxihRhijUUuyYQwH4ykcn2rBOFTLwstbrbdEXdMwWFnLGhUPqH9DOYoWw15TwThkIWVjGYlffCClv/Y5NR4Z6nyQSCTMVNGdIC27dKjAZCZP0gyJuTDtY6DFCiewu/meMAa1SOb82W3Hs54OI0Wdkuu8cMWI1PN1yeGr8sW5eEUvdhdX6xFX2VZhb5gOCIbqFhtwPUG+Qk7OMM3BxQr6joH6ej0Yfjb+MSVeJmkvxmDRFxQ9NCvwkOXc3JmPvBCeNpVlumogTwkfTTGSCCdcXkUej139QaCyQNgVaEGLSCXtlRM2vhE7mPfiKF2Qh73ctWnhnBOxR2zdcD/5Q4tBiAQLQjYhLb5bD1xpwJ3bY97XoZgEuEQiVfNlR54j0Qnw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(366004)(39860400002)(396003)(136003)(451199021)(41300700001)(8676002)(8936002)(26005)(53546011)(6506007)(54906003)(478600001)(66946007)(66556008)(66476007)(4326008)(6916009)(316002)(6512007)(36756003)(6666004)(6486002)(38100700002)(31686004)(86362001)(83380400001)(2906002)(31696002)(2616005)(5660300002)(186003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?N0tBOWZlVjVGNm1mOUszSGo1K3J0MmZNamVzb1lSRUNSU25xRDh2ek9jVzc1?=
 =?utf-8?B?N0V0L0h3d0lnUStSK3FEK2Ewd1VNUWtaR01ZNG5LZ0VpT1Z4UGFGdDl0Wmhh?=
 =?utf-8?B?d2Y4akNoVmpkT2pjQjE1VjNMU2JsWGw2Wm5XMWxqRldJOC91bm1EdjFBNTM4?=
 =?utf-8?B?Qi9PVVF0d0YvaTJPY0NLRjZqeXByNk5UQ2ZaKys0SlcvZzhhNHM2Y3pMeFUw?=
 =?utf-8?B?ekd3WTErMnh3U0pXQmIrbUlDUHVIUzgrR3dTaUNNSWNOZjI2NGQzUHpqaWtC?=
 =?utf-8?B?Vmx5N291VmVOQ3JBWFN5V3R4NDUrUE5oNzk5YkVaalZGTjZZMHF0TG1uYjhh?=
 =?utf-8?B?U3dpekxPd2kwVE5CY0s1bEc4a085L1h3bUMwbEtiT3h4anNrOU5mbjFzdVVX?=
 =?utf-8?B?b1dWSWRzV3BMTnRLT00vMlNMOUxRVWJVaE13UFBQLzdsdERBTmhnQ3dJRlJJ?=
 =?utf-8?B?d2F1NWVnN1dhVTMrNVlpekkwWjhVbmNiUkhtemVEN0xKckNXcU0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ZIbEpqb3dqelBkZEg1c3UvMFRvb0Z3M0R5YTRrTytxeUcwb1l5?=
 =?utf-8?B?dlpSQUdsdmhrZVBzeDY1YlByWDJjYzNXNjF5dU9xWW1yN3Q2NGdtUE1PbkUv?=
 =?utf-8?B?cVYrSWNDTll0RXQ5TGY2WURhcDNoWVl0VWxtZGJKZ2I2MGRjRllDSk15SjMy?=
 =?utf-8?B?OEEzTk80TW1HeHBhbktHbmh5UzlEVWVOTE94OVdpQUtpQ0ozczB0VWg0WDI3?=
 =?utf-8?B?d1BZWlBIQ1FYdXMrKzRBdXdoOU1SWko0UTJVN2J4Wm0vM0FyQlRMWC9uKzRk?=
 =?utf-8?B?VldMUXorWU5ObmYwVUs2cTRpVHVqMnhyQWpRUzloamo0cmFnVGxMaHJWWG40?=
 =?utf-8?B?UTZrNHZvaTVoT0c1akJMa2U1VnNWdVl3QURUTlozeHR5b1Z6cFNiZEVlQ0Zr?=
 =?utf-8?B?MzN0RTBFaStPSjJtTEg0bWdFWXZvZTdnQ2pFTW9nd3RHaXIzRFBocEpXZk5T?=
 =?utf-8?B?Q085QmRGYXNiaWVVRThKalJSdVR3S05ZcENBb040UjNpcm5nUDdLS1FjUVN2?=
 =?utf-8?B?RzRxUi9kaDc5RUhQVjlLQzBzL3FpcGEzVDJoM1VJRkpsT3B4SWFYdFFEdUxm?=
 =?utf-8?B?L1RZN1pxVVhHNzlxeTFhR0NRZS9nWjA0TlI2bGNVS0ZSM0dIUEkyK0lRcXBz?=
 =?utf-8?B?ekd3cUE2U2c4MkdXZjYyZzJZeTNiTW1RT3oyMzlJc1Y1dzhjU3U2bWIzejNY?=
 =?utf-8?Q?K6iDxv1P3lcVy/cS51pK+9MP1?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ad36f198-9379-40c2-bcce-08db86bbeaeb
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 11:49:46.2977
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 7JeNSWuaSG41rSK58sKe2b4wQc/TTEayX3tBIWX3pTfTF5YCT7U4vmFJODYTsJrhbHS10jMM2kVt+UakaNquBA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9340

On 17.07.2023 12:51, Roger Pau MonnÃ© wrote:
> On Mon, Jul 17, 2023 at 11:31:57AM +0200, Jan Beulich wrote:
>> While the referenced commit came without any update to the public header
>> (which doesn't clarify how the upper address bits are used), the
>> intention looks to have been that bits 12..19 and 40..63 form the pIRQ.
>> Negative values simply make no sense, and pirq_info() also generally
>> wants invoking with an unsigned (and not just positive) value.
>>
>> Since the line was pointed out by Eclair, address Misra rule 7.2 at the
>> same time, by adding the missing U suffix.
>>
>> Fixes: 88fccdd11ca0 ("xen: event channel remapping for emulated MSIs")
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Acked-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

Thanks.

> I have a question below, but not related to the change here.
> 
>>
>> --- a/xen/arch/x86/hvm/irq.c
>> +++ b/xen/arch/x86/hvm/irq.c
>> @@ -383,7 +383,7 @@ int hvm_inject_msi(struct domain *d, uin
>>  
>>      if ( !vector )
>>      {
>> -        int pirq = ((addr >> 32) & 0xffffff00) | dest;
>> +        unsigned int pirq = ((addr >> 32) & 0xffffff00U) | dest;
>>  
>>          if ( pirq > 0 )
> 
> I do wonder whether this check is also accurate, as pIRQ 0 could be a
> valid value.  Should it instead use INVALID_PIRQ?

I think 0 is okay to use here, as the low IRQs (at least the 16 ISA
ones) are all 1:1 mapped to their "machine" (i.e. Xen's) IRQ numbers.
And IRQ0 is always the timer, never given to guests (not even to
Dom0).

If we wanted to use INVALID_PIRQ here, we'd first need to make this
part of the public interface.

> Since there's no specification or documentation how this is supposed
> to work it's hard to tell.

Indeed.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 11:50:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 11:50:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564446.881886 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLMkB-0007Hp-Ob; Mon, 17 Jul 2023 11:50:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564446.881886; Mon, 17 Jul 2023 11:50:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLMkB-0007Hf-LU; Mon, 17 Jul 2023 11:50:23 +0000
Received: by outflank-mailman (input) for mailman id 564446;
 Mon, 17 Jul 2023 11:36:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=2MJZ=DD=ideasonboard.com=kieran.bingham@srs-se1.protection.inumbo.net>)
 id 1qLMWN-0004NL-Ke
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 11:36:07 +0000
Received: from perceval.ideasonboard.com (perceval.ideasonboard.com
 [213.167.242.64]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1d0d9a98-2496-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 13:36:05 +0200 (CEST)
Received: from pendragon.ideasonboard.com
 (aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net [82.37.23.78])
 by perceval.ideasonboard.com (Postfix) with ESMTPSA id AC0DD16C4;
 Mon, 17 Jul 2023 13:35:09 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1d0d9a98-2496-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;
	s=mail; t=1689593710;
	bh=Q3mYfdnpaLKlY8/jxmRm80QstU9e0PZzEci91ZZE1j4=;
	h=In-Reply-To:References:Subject:From:Cc:To:Date:From;
	b=D34b2nk3MBeIsD4Hh9go1cz7KYgQfaVb0QwyTeWrvQudhj3fcvsR86k18n5c2Eh/a
	 11cp7FnDEwboNqdfvQSni7J+NuSf4nawSesO0QfLQ1Tb/Qq/1vhrC/00e2IYaQomU7
	 muczhfhcRx636pqbzTWg6NH753X76UJuCpEmbpUo=
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
In-Reply-To: <20230714174545.4056287-1-robh@kernel.org>
References: <20230714174545.4056287-1-robh@kernel.org>
Subject: Re: [PATCH] drm: Explicitly include correct DT includes
From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Cc: devicetree@vger.kernel.org, Ondrej Jirman <megous@megous.com>, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, etnaviv@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-mips@vger.kernel.org, lima@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, linux-rpi-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, xen-devel@lists.xenproject.org
To: Abhinav Kumar <quic_abhinavk@quicinc.com>, Alain Volmat <alain.volmat@foss.st.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, Alim Akhtar <alim.akhtar@samsung.com>, Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>, Andrzej Hajda <andrzej.hajda@intel.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Artur Weber <aweber.kernel@gmail.com>, Baolin Wang <baolin.wang@linux.alibaba.com>, Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, Chen-Yu Tsai <wens@csie.org>, Christian Gmeiner <christian.gmeiner@gmail.com>, Chun-Kuang Hu <chunkuang.hu@kernel.org>, Chunyan Zhang <zhang.lyra@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@gmail.com>, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, Emma Anholt <emma@anholt.net>, Fabio Estevam <festevam@gmail.com>, Florian Fainelli <florian.fainelli@broadcom.com>, Guido =?utf-8?q?G=C3=BCnther?= <agx@sigxcpu.org>, Heiko =?utf-8?q?St=C3=BCbner?= <heiko@sntech.de>, Icenow
 y Zheng <icenowy@aosc.io>, Inki Dae <inki.dae@samsung.com>, Jagan Teki <jagan@amarulasolutions.com>, Javier Martinez Canillas <javierm@redhat.com>, Jernej Skrabec <jernej.skrabec@gmail.com>, Jerome Brunet <jbrunet@baylibre.com>, Jerry Han <hanxu5@huaqin.corp-partner.google.com>, Jianhua Lu <lujianhua000@gmail.com>, John Stultz <jstultz@google.com>, Jonas Karlman <jonas@kwiboo.se>, Jonathan Hunter <jonathanh@nvidia.com>, Jyri Sarha <jyri.sarha@iki.fi>, Kevin Hilman <khilman@baylibre.com>, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, Kyungmin Park <kyungmin.park@samsung.com>, Laurent Pinchart <Laurent.pinchart@ideasonboard.com>, Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>, Linus Walleij <linus.walleij@linaro.org>, Liu Ying <victor.liu@nxp.com>, Liviu Dudau <liviu.dudau@arm.com>, Lucas Stach <l.stach@pengutronix.de>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Marek Szyprowski <m.szyprowski@samsung.com>, Marek Vasut <marex@denx.de>, Marijn Suijten <marijn.suijten@
 somainline.org>, Martin Blumenstingl <martin.blumenstingl@googlemail.com>, Matthias Brugger <matthias.bgg@gmail.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Maxime Ripard <mripard@kernel.org>, Mikko Perttunen <mperttunen@nvidia.com>, NXP Linux Team <linux-imx@nxp.com>, Neil Armstrong <neil.armstrong@linaro.org>, Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, Ondrej Jirman <megi@xff.cz>, Orson Zhai <orsonzhai@gmail.com>, Paul Cercueil <paul@crapouillou.net>, Paul Kocialkowski <paul.kocialkowski@bootlin.com>, Pengutronix Kernel Team <kernel@pengutronix.de>, Philipp Zabel <p.zabel@pengutronix.de>, Philippe Cornu <philippe.cornu@foss.st.com>, Purism Kernel Team <kernel@puri.sm>, Qiang Yu <yuq825@gmail.com>, Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>, Rob Clark <robdclark@gmail.com>, Rob Herring <robh@kernel.org>, Robert Foss <rfoss@kernel.org>, Russell King <linux+etnaviv@armlinux.org.uk>, Sam Ravnborg <sam@ravnborg.org>, Samuel Holland <samuel@sholland.org
 >, Sandy Huang <hjc@rock-chips.com>, Sascha Hauer <s.hauer@pengutronix.de>, Sean Paul <sean@poorly.run>, Seung-Woo Kim <sw0312.kim@samsung.com>, Shawn Guo <shawnguo@kernel.org>, Stefan Agner <stefan@agner.ch>, Steven Price <steven.price@arm.com>, Sumit Semwal <sumit.semwal@linaro.org>, Thierry Reding <thierry.reding@gmail.com>, Thomas Zimmermann <tzimmermann@suse.de>, Tian Tao <tiantao6@hisilicon.com>, Tomeu Vizoso <tomeu.vizoso@collabora.com>, Tomi Valkeinen <tomba@kernel.org>, Xinliang Liu <xinliang.liu@linaro.org>, Xinwei Kong <kong.kongxinwei@hisilicon.com>, Yannick Fertre <yannick.fertre@foss.st.com>, Yongqin Liu <yongqin.liu@linaro.org>
Date: Mon, 17 Jul 2023 12:35:59 +0100
Message-ID: <168959375926.3515353.7529038208688306372@Monstersaurus>
User-Agent: alot/0.10

Quoting Rob Herring (2023-07-14 18:45:34)
> The DT of_device.h and of_platform.h date back to the separate
> of_platform_bus_type before it as merged into the regular platform bus.
> As part of that merge prepping Arm DT support 13 years ago, they
> "temporarily" include each other. They also include platform_device.h
> and of.h. As a result, there's a pretty much random mix of those include
> files used throughout the tree. In order to detangle these headers and
> replace the implicit includes with struct declarations, users need to
> explicitly include the correct includes.
>=20
> Signed-off-by: Rob Herring <robh@kernel.org>

>  drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c         | 2 +-
>  drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c         | 2 ++
>  drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c         | 1 +
>  drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c       | 1 -
>  drivers/gpu/drm/renesas/rcar-du/rzg2l_mipi_dsi.c      | 1 -

For drivers/gpu/drm/renesas/rcar-du/

> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c b/drivers/gpu/=
drm/renesas/rcar-du/rcar_du_drv.c
> index 1ffde19cb87f..3904b0cca814 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c
> @@ -12,7 +12,7 @@
>  #include <linux/io.h>
>  #include <linux/mm.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm.h>
>  #include <linux/slab.h>
> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c b/drivers/gpu/=
drm/renesas/rcar-du/rcar_du_kms.c
> index adfb36b0e815..9ff4537c26c8 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> @@ -20,8 +20,10 @@
> =20
>  #include <linux/device.h>
>  #include <linux/dma-buf.h>
> +#include <linux/of.h>
>  #include <linux/of_graph.h>
>  #include <linux/of_platform.h>
> +#include <linux/platform_device.h>
>  #include <linux/wait.h>
> =20
>  #include "rcar_du_crtc.h"
> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/=
drm/renesas/rcar-du/rcar_du_vsp.c
> index 45c05d0ffc70..9cbb5e6e2cba 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> @@ -22,6 +22,7 @@
>  #include <linux/bitops.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/of_platform.h>
> +#include <linux/platform_device.h>
>  #include <linux/scatterlist.h>
>  #include <linux/slab.h>
>  #include <linux/videodev2.h>
> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c b/drivers/gp=
u/drm/renesas/rcar-du/rcar_mipi_dsi.c
> index e10e4d4b89a2..db2e6f16f954 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c
> @@ -12,7 +12,6 @@
>  #include <linux/math64.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/of_graph.h>
>  #include <linux/platform_device.h>
>  #include <linux/reset.h>
> diff --git a/drivers/gpu/drm/renesas/rcar-du/rzg2l_mipi_dsi.c b/drivers/g=
pu/drm/renesas/rcar-du/rzg2l_mipi_dsi.c
> index aa95b85a2964..8048bdca2d6c 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rzg2l_mipi_dsi.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rzg2l_mipi_dsi.c
> @@ -10,7 +10,6 @@
>  #include <linux/iopoll.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_device.h>
>  #include <linux/of_graph.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 11:52:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 11:52:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564464.881897 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLMls-0007vy-4O; Mon, 17 Jul 2023 11:52:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564464.881897; Mon, 17 Jul 2023 11:52:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLMls-0007vr-1T; Mon, 17 Jul 2023 11:52:08 +0000
Received: by outflank-mailman (input) for mailman id 564464;
 Mon, 17 Jul 2023 11:52:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLMlq-0007vT-Fr
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 11:52:06 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2062e.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::62e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 59a72d89-2498-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 13:52:05 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB9675.eurprd04.prod.outlook.com (2603:10a6:10:307::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 11:52:03 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 11:52:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 59a72d89-2498-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Xam5R/J7gGlLvqFiUNOxQP/WkFWtNnyHmVivgchabfgR+JyYz59w4p+nmLuPrYfwBMOopcXjg8YbwBcYsupuCWebtd3uYXG8YDrk07ZmXDbLbft4Q7CkEHrFawvdd8Zyj7Ifqe46LK6Z/mnFD9tzOneEvBSbIcEWX0ITjCAXj563XAEmNykaagnRl56ORGLjmxgvCy0SZ21D7j6PVZ3DA4I5IWyInSqy2oVBpdJlZg0B+eh45RX3rEwe/8ZLozy4wPAL+6bPXilS9HeBHSDUHMm+4aRB75Y9/tlr/5qRAN+Dhzy6YWe+xKLlDhdtp3gQCCRamQKSZ9y+AdJ3d+0xuw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=gVBzIRKhDWPWD4lcUpcjO3vCJbP0ot4R2AJ0zXXGXZs=;
 b=fpyhyOvQJTOLfeaoxUURkZPJ2GJa7vP3v0A3QyA32cMky3zknkvFxAjKWjsz4kJEpGIaN9JBBdKLQYi9Y2dTok0tOi1wTw567fHGHD25kQGUb8XgM03zxmIsnIxIhLAMi7pp+xtpI0xxMGD479kX4cku6rSxKMAn4a5Fn4ArnUOzUq6r8OuWlWSTpzLNPQBM++xHaddOFLr2ljcllM88T80AhBwVYHpNWIAzxWLgeRkZarfI2tAnTeF28lOjp5fTWcW5hAdqU90i6QyoOl3dK2JjrePufAODgE+wxYe9LnYAxRBBQRnEDjU63S2RoO9SkgpRFgZcQgL92R3a7SJs8g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=gVBzIRKhDWPWD4lcUpcjO3vCJbP0ot4R2AJ0zXXGXZs=;
 b=S58G2yI3HwjTnjjRxK5EWh9HHtiE5FTwrMzURJIOtnwNMXrUPOCpW2IU4p04m8j/TwvThgONLFSTSp0mJuq1HqSo59UkOoQBCjl/Wbx9ZvTsueU2zNK+1gPPZ/mjIHGwjZX28RtYPehFlcgAeoAn2LoZLnaXN+CPRsmQpIM3VjuZq+lQTtnR+o4PYd7obSX2g0EZyAKMWYMgYi4D/rgOeA3vlAjlmAQo0ZrSbI3ATWLEKBAD1SDYw1NFTR1eK2va/ZD56cdl1ZwcKdAjv1lpyvFJTagP6+AlBxzGwh+ReX64y+7UjjYHbOFtJ6RLgd6mKV+tJup64lCqlY++CFQNVA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ee342a26-5f26-0e47-06a6-c74fdb3270d6@suse.com>
Date: Mon, 17 Jul 2023 13:52:01 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] x86: drop old (32-bit-only) MSR definitions
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Simone Ballarin <simone.ballarin@bugseng.com>,
 Gianluca Luparini <gianluca.luparini@bugseng.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <df2c3154-2e8b-194a-ec1e-472819bbf026@suse.com>
 <38707d09-92a3-2807-4bf0-167be5c3bb15@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <38707d09-92a3-2807-4bf0-167be5c3bb15@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0268.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b5::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB9675:EE_
X-MS-Office365-Filtering-Correlation-Id: afb41cf9-d93a-41f0-abb0-08db86bc3ce8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	9lozIEIvGR3oTcBijjurCxB7+smoxmkb8I9a0K9E2mSSK12XADwzzV8+1uhAwqv8ntAhu1yi4xlG1+MCO48H4tgQMzbeEf3iB39Zs6hZllP0F3xaHDBaVzezh+MhmyLAHYladsS6S2tnaHZhTAwEQFJFCV80c/Ey/4B/H4O1HZpa6x0tUqQs4F6jZChhyLe75de4M2ph6eCj1nuenG2IE/Ab3J3SiwbWOQEaCiUhTNC/sxutVxwkfqOhj+Yl4OeHHwWau9GmhcKG+Vp9iQPQo6yEMjYs8CDytfR8jwuDBlLANMusLXQ3Wrl2+I2BPVDB4KTBTLMJSemPINE388xu5/CHqDo5DlcbuLLziwHbItVxGtKktopuyxNpY6lFwWgIcIHwW7v8VG46cTWsAynIEyy7EcBzYunwDuo9J2T2VAKnBYStsyWDOBivZkW83h1xvZXuNG9KYtbOY29HmkWYRFBUgVbc75+bKpQXjxmC3KTlR9/VaOjFQtTNr5QuSPcQrNTEW+GjBTIk/xW2zryDsKUpERfcRCqax0EsAwCuGRGC72wvVZ4rWq1YNg0KMJ/9SPDpu1D1l+ai593+BGyoq21bZtf8ii9r80Sc8hN2ysDkF6NApdOdUIPXUXE7/ZNy6I+KXt/LOxsx+FyK18U7gdPNGT8x0PXcx1XqZH1dB8ABTOXhkyu/6/VGh2NZ1BS1r6x0C+WiULs+lHeH2GTuMw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(376002)(366004)(39860400002)(136003)(451199021)(54906003)(38100700002)(6486002)(41300700001)(8936002)(478600001)(5660300002)(8676002)(66476007)(66946007)(316002)(4326008)(66556008)(6916009)(2616005)(186003)(6512007)(26005)(6506007)(53546011)(86362001)(31696002)(36756003)(4744005)(2906002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?S2FVc3l5MEFGOU14TXhZNmtPUmQzRWpDSUhpcEpFNmMzY3hjZ1VCcS85ZnBS?=
 =?utf-8?B?Lzc1d2FEajBsTW1CUUtHWHEwN2RiTittUlBoUiswc3Ria05weHA0NzBTcVNF?=
 =?utf-8?B?NzB5N0loUDZBN2t4NUhQOTlZOXNGUVFEdDY0QmhpSE42eVBvTDViVHgyZUgy?=
 =?utf-8?B?NU82VDRUam9OcG52YVNFUjdiVEFWZGdTdHY1ZnlWQVY2YUhLRHlPVmhka09H?=
 =?utf-8?B?ZkdkYldia0RPeVBrUlhRaWRSTnB2T3ZpZ1RVU1JxMVdneThqR3hXYkZGQTdD?=
 =?utf-8?B?eFEzckpZL3p6N0V4WjdGc1Q4aHVjcnkrOHJRKzJUcHVkSGV0SkJrU3B6azFN?=
 =?utf-8?B?Tk1FeGhkWjVqdEU3K1Y5WVlieVRzcG9zbUM3M21oSi92dFI3QzUvWUkyK1M1?=
 =?utf-8?B?d1EwRDJSZ3N4NU95dTVibHprcGlXb250dWJEajdoRmVBOEpNUHVwWXRSMm1V?=
 =?utf-8?B?dkRuSWFkUkZoVzA2Rk9rZ0trWEY3a0UvbjMwOEdob3d1eG1sNFhVNFJ3dUo5?=
 =?utf-8?B?MUhMV0ZBOHlOUFBhV2ozSiszZFY0dmExdzBzcEJZR1FMM0QwTVNkQ3NNTEFa?=
 =?utf-8?B?TnhxMDRTMHg2NTJnYVFFd0U3aHVYM1NpUE4wNS81WXdnSjJMU0ROWW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kUVVjTGNuRmZyM0NaN3lrYTlxZEk2dXA0QTduQmpUU3JUTFFu?=
 =?utf-8?B?V1poWElJRHQ4TEtyTlRwT2JUYnF4ZEhDZGRpQ0VrVktmY1UvUjlqSHVweUkz?=
 =?utf-8?B?bG0yZDRFQ25sbHkxLzYvSnA1dzNxTDZoVzlOb3pPT0U1dkcrUHd6MmYvdlBP?=
 =?utf-8?B?cmMrRmpHVzNVUE1PWHREdlRidVhSZUIvM0llMTNMbHVGYmtEemtpaW5sYjh4?=
 =?utf-8?B?QklDbjNlVFU0RnUyY2xKQ0F2TVdqQW52a09ETGVUV1VyZjcrNnhYaHMxb2t1?=
 =?utf-8?B?dXJIREVmQkJDRktOdDMwM2NhUlNya3lxaGFwWUlyclFjTEdnZGkrVWQ5NmFB?=
 =?utf-8?B?TjhpU2pCdHM0c2xlUWg3Z2I2eXZ1bE9iR09aTE83a1lSSDVIS0VlVytzVk94?=
 =?utf-8?B?ZFF2LzRacG5Xc3Zmb2VlVnZqdzNQWk1GaHBISXgwS0VtWTRnOFgwUGdIZjU1?=
 =?utf-8?B?SFRUK1ZUd0xTalVBSzZrMHVJYmFqR3dRK3g4WS9aUFh3ZXZ0ZS92blppZlZr?=
 =?utf-8?B?bFJIWjUxYWZwV3BYQXBVUnFlSWMvN00xUGdNYmsrekg0NmU5STlsbVc0Nzdm?=
 =?utf-8?Q?qDkZJfC4m6Q96H3x8SL1hB8NH?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: afb41cf9-d93a-41f0-abb0-08db86bc3ce8
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 11:52:03.8022
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 76H5o6EPOndZbWiHp3CmXoP3L7P+XZAuNPVlK0zdyGB20M3u9swrE4MvDBx/qy6uqEsLCZz8r48id1zg3FUquQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9675

On 17.07.2023 12:33, Andrew Cooper wrote:
> On 17/07/2023 10:17 am, Jan Beulich wrote:
>>  /* Intel defined MSRs. */
>> -#define MSR_IA32_P5_MC_ADDR		0x00000000
>> -#define MSR_IA32_P5_MC_TYPE		0x00000001
> 
> These are architectural.Â  They still exist in all Intel and AMD CPUs.
> 
> I'd suggest keeping them, because I think we're required to expose them
> when advertising MCA.

We have them twice, and I've kept the instances without IA32 in their names
(at the very top of the file, i.e. already in the "new style" section).

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 12:05:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 12:05:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564470.881906 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLMyO-0001Ed-Bp; Mon, 17 Jul 2023 12:05:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564470.881906; Mon, 17 Jul 2023 12:05:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLMyO-0001EW-8l; Mon, 17 Jul 2023 12:05:04 +0000
Received: by outflank-mailman (input) for mailman id 564470;
 Mon, 17 Jul 2023 12:05:03 +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
 <SRS0=RVQe=DD=citrix.com=prvs=555fa4c0e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qLMyN-0001EQ-8l
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 12:05:03 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 265e2e79-249a-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 14:04:59 +0200 (CEST)
Received: from mail-dm6nam11lp2173.outbound.protection.outlook.com (HELO
 NAM11-DM6-obe.outbound.protection.outlook.com) ([104.47.57.173])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 17 Jul 2023 08:04:51 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by CO3PR03MB6805.namprd03.prod.outlook.com (2603:10b6:303:164::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 12:04:49 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 12:04:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 265e2e79-249a-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689595499;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=Yw2fT//jPo29Atg0bU+qyUqaCuA/pFQ8uIlHl1MHB4w=;
  b=RGi89E+ygk2/WNY4zz76f/80SMv7RCSRBpRJewPP19u5uc4D2aLi+ctv
   FauuBeZOyStBszR/tamGDmY/BvwFipa00+SlCsgmWkUY/uBHl4nV1otOq
   yKuEfySjVK5iQYD2YCM91K96Ha0k6Sctp317jd3GKNv7FbMjPV1SxMtaS
   M=;
X-IronPort-RemoteIP: 104.47.57.173
X-IronPort-MID: 119037680
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:YMNQpqImzQFe3HZ5FE+R95QlxSXFcZb7ZxGr2PjKsXjdYENShjQGz
 mUcUGiDa63eNmamfNFwatu28x9V6JHRyddqTAplqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws
 Jb5rta31GWNglaYCUpKrfrawP9TlK6q4mhA4QVhPakjUGL2zBH5MrpOfcldEFOgKmVkNrbSb
 /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/
 jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5OD2Bv+
 sQJEQkNdwyAuPK2xeu8RvFz05FLwMnDZOvzu1lG5BSAVLMKZM6GRK/Ho9hFwD03m8ZCW+7EY
 NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/dopTGMl2Sd05C0WDbRUsaNSshP2F6Ru
 0rN/njjAwFcP9uaodaA2iv117eUwn2rAOr+EpWg069m3kCUxVApIx9IdXG24vm320mXDoc3x
 0s8v3BGQbIJ3E6hQ8T5Xha4iGWZpRNaUN1Ve8Ul7Cmdx6yS5ByWbkAUQzgEZNE4ucseQT0xy
 kTPj97vHSZosrCeVTSa7Lj8kN+pES0cLGtHaSpaSwIAuoDnuNtq0UmJSct/GqmoiNGzASv33
 z2BsCk5gfMUkNIP0KK4u1vAhlpAu6T0c+L83S2PNkrN0++zTNXNi1CAgbQD0ct9EQ==
IronPort-HdrOrdr: A9a23:vDZ29ayjNYMEy3tE8SSrKrPwKL1zdoMgy1knxilNoH1uHvBw8v
 rEoB1173DJYVoqNk3I++rhBEDwexLhHPdOiOF6UItKNzOW21dAQrsSibfK8nnNHDD/6/4Y9Y
 oISdkYNDQoNykZsS8t2njcL+od
X-Talos-CUID: 9a23:uND07m0BihWUvMPISDsUp7xfI84kU3Ll3U7pI1akCll5SLjMTlOI5/Yx
X-Talos-MUID: 9a23:YMDoPQVTkbpJDcnq/CfJ1T08KcBr356FCh4tu5hFu8fVMgUlbg==
X-IronPort-AV: E=Sophos;i="6.01,211,1684814400"; 
   d="scan'208";a="119037680"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=fyBPczmtAVrK2GlXmwnk04h46A5TOppFKhTP5PBiINW3LZYTmfn3f30xp40jCQb4XZHi7vo8N1wANKPwFZRauY/lS76T7AsOqip1eumpby3jIAMillnchKQjYygCa8asi3EjV+pK6RYCololSBRDVnw1j6HTBzb0SN1ZaJbqE3PpQWLyPcBEQsP5bkx4Om5t/oviNJEbMWe+3rGO/MNgUFnkKoLXRjQ25u2P0j2QExKAfNpQ2HE/1MOTt6N5gBMr9cB7MI4ytnfBgqmffVOyckHnGUPlsJ0rtqA3gt6qBgjKWzxkWcchCGRn/7P4Mw2JJ2q87CRH5Q8ytYoS/Lg14g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=XMI8lmCXzA0GS2WCI1Jd+uwIR0Mxm5ObKw2ug0sl1z8=;
 b=ZN2KLGl638k5hKpw99ai2VNW3gSe85Tr1s86q+C6FkWVPcN/+3RO2l/MrcN2mjb2QPqBtQuKUxg4uXjGqSEzJvp1npI0rjpjJXuapb4xeXRAY4BHxy8u+csDoGbxC62SO54TDN4rAj1/NIMfP6QKijqAX+cEL6F+jgZJRLGTwpMimiIPL2LfNnUgD93nY5Q/V+UgNZt/TxB795ljtak5xrsntGvYtf2+/OBGKtDb1hBahYDK5s9yyhGzA0NthGOxqZxxlzNBStYlmCYwxrwHTGUWSZJgpsnBfRGOn1da2hV9HVZ3xljwTuRcRA5gSt4u6AC98mBfrR1x14CM2EiFZg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XMI8lmCXzA0GS2WCI1Jd+uwIR0Mxm5ObKw2ug0sl1z8=;
 b=lOgC8hdBgtQx9J0vt53QFoX42Igy5xvQ5yjX2Uaps2vUq1UHAHRnpnn1Rt14tH1dfRsb/KCwTYhvlIwZIwqmfSmz1vkK71Yw6hOdNnnyOflJq6s7zBkZV895V57BMsSmGBSiQf2Y5Jk5+1lAr5SeKM6n8lN6WNg39xgUNnvI6RM=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Mon, 17 Jul 2023 14:04:41 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] x86/ioapic: sanitize IO-APIC pins before enabling the
 local APIC
Message-ID: <ZLUuWRUeGY29a-ML@MacBook-Air-de-Roger.local>
References: <ZK1S1V71ZUIPjKqZ@MacBook-Air-de-Roger.local>
 <eb2e3b57-a423-cf52-0192-a344db33a58f@suse.com>
 <ZK6wcpHnh5OgHv4R@MacBook-Air-de-Roger.local>
 <d84482f4-8be6-e514-58a7-a529890c8feb@suse.com>
 <ZK7JwEhrB-70nlla@MacBook-Air-de-Roger.local>
 <6d0ed712-0807-33b6-1586-a0588086c3a7@suse.com>
 <ZK_gHltq-1se3fau@MacBook-Air-de-Roger.local>
 <c2de675d-b4cd-1040-efa2-1b8b90448d90@suse.com>
 <ZLFyVugKWItJklcu@MacBook-Air-de-Roger.local>
 <2a2c1e47-767a-4029-bbc3-b809b0baaf75@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <2a2c1e47-767a-4029-bbc3-b809b0baaf75@suse.com>
X-ClientProxiedBy: LO2P265CA0022.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:62::34) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|CO3PR03MB6805:EE_
X-MS-Office365-Filtering-Correlation-Id: a8f62e6a-12f1-4cb7-ee96-08db86be04b6
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	JT15NSE2mzxGd9AYiocUDvL1RKFRdha38CS6XS03BWAUZlIH7y71v1zcN3g92AR6tzdq3ysNfBv4ra6I6dOIYeGJdoeJT6FCgW3PNDg43RyVzGNOcYQyoZ6iPV2EcMVtAxTR4vXoWaJnTBKcRjDnj4NhpETn8X6tySWfBNhTwcMdO/y5JkPxojtpwz/rat+WMOttlft2WA5Qsf2Qia6AorwhywMTooyEHpaKxBwDDT0MZa5O5/bYAtcBSz7BmjhqDBlANU4tsxLs0Ev28tXVqplxxZl0OF5O9boP/Kn6IRRRZUGjCQuZnmZXX8t/m6xI0CKCJ51OO3sQirvt4NpI/4mb402M8NlLLxXI6uPJSXbc3jo+yQTbFtUZ5rzCTuOPKdNAummnYkufgSmhwTrxZSu4KK7sOCfZ2SwWE/CHLznuE3bfc8OVvL6g1KkLp1MBHw+tkW4F4A27mZrzGEPQ5wKak66S9P9IiOc2QD1P0MKfbs9SvI10KNl3V3ikpP4B4dk9MChQNb70wR19qGcfyymPuYm52tgLNhSbkAJWrPAV4LDMA29Yy7DHFnm4cwSG
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(39860400002)(136003)(366004)(396003)(451199021)(6486002)(6506007)(26005)(9686003)(53546011)(6512007)(85182001)(86362001)(38100700002)(186003)(82960400001)(8936002)(8676002)(2906002)(41300700001)(478600001)(5660300002)(4326008)(316002)(6916009)(66556008)(66476007)(66946007)(54906003)(66899021)(6666004);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TS9XRDAvVkV0aXo1bWVHR055SDBaZGVrYXptcHhZUW9mMC9JTHNtb2JMVnNR?=
 =?utf-8?B?dkpWZW5hM0NyYUJVY0o1SnZ2VlNFY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04I6+8HJcHbZ8uGGOwbVrrceIOQVTzim/iBv87l11w31vr0G4a7jQGqpib3Vxzq/zCjUmZBQlq69sprHXCg5F11a+yhY9L6JVrKuwYVN+CDIskUkYLjvg/GEGRmnurSV1oP/UYLeGFTLqqhpdd6pnifhvrcf23BCIVCu52M4gXb+QadiPUvHe61pWEr3WceLoMgc/oS7al5ocKfDYhHXM2ngYq64zRKt+epl6DD8S7BLWxsNsCUfvhfAJ30MRI+Q==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a8f62e6a-12f1-4cb7-ee96-08db86be04b6
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 12:04:48.7258
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: E703fqXgHQmHKBuP4/VbRgON3pR4e4Uie+MzlfR7l6hMzWIZVzgPYR1Hj+hEbYqp+eJyhDjM/GDnWaRf402R0w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO3PR03MB6805

On Mon, Jul 17, 2023 at 08:40:05AM +0200, Jan Beulich wrote:
> On 14.07.2023 18:05, Roger Pau MonnÃ© wrote:
> > On Thu, Jul 13, 2023 at 02:18:29PM +0200, Jan Beulich wrote:
> >> On 13.07.2023 13:29, Roger Pau MonnÃ© wrote:
> >>> So to recap, I think we are in agreement that calling enable_IO_APIC()
> >>> just ahead of the call to setup_local_APIC() is the preferred
> >>> solution?
> >>
> >> Well, yes and no. My preferred course of action for the issue at hand
> >> would be to convert RTE 0 to ExtInt (under the mentioned set of
> >> conditions). I agree though that we also want to move the masking of
> >> RTEs, and for that I further agree with the placement mentioned above.
> > 
> > So I hacked up a change to set pin 0 to ExtINT mode (and avoid doing
> > the masking early), and I got:
> > 
> > (XEN) spurious 8259A interrupt: IRQ7.
> > 
> > This was a single interrupt, but still I think the masking is the
> > critical part to get backported.
> 
> One way to look at it, yes. My perspective is different though: If
> there truly is a (spurious or not) IRQ at the 8259, then it needs
> dealing with sooner or later (in the process of booting). Aiui if
> we masked pin 0 initially and then later unmasked it (after
> switching to ExtInt, if not set so by firmware), we'd still see a
> spurious IRQ7.

Hm, I see.  I'm not very familiar with 8259, I was expecting that
maybe we would mask the IRQ before getting such spurious injection,
but I'm not even sure that's possible or whether it would work.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 12:08:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 12:08:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564473.881917 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLN1U-0001qu-Pa; Mon, 17 Jul 2023 12:08:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564473.881917; Mon, 17 Jul 2023 12:08:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLN1U-0001qn-Mh; Mon, 17 Jul 2023 12:08:16 +0000
Received: by outflank-mailman (input) for mailman id 564473;
 Mon, 17 Jul 2023 12:08:15 +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
 <SRS0=LRey=DD=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qLN1T-0001qf-Ka
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 12:08:15 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9a38d7a3-249a-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 14:08:12 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.163.206.54])
 by support.bugseng.com (Postfix) with ESMTPSA id ACDCB4EE0739;
 Mon, 17 Jul 2023 14:08:08 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9a38d7a3-249a-11ee-8611-37d641c3527e
Message-ID: <5da7ae40-35c7-7f93-824f-42a0712cdcf1@bugseng.com>
Date: Mon, 17 Jul 2023 14:08:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally
 uninitialized variables
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <1ad20473a031eca75db4007bdc169616b512ef44.1689329728.git.nicola.vetrini@bugseng.com>
 <97d8a796-f790-8efc-1d89-def1f1193e61@xen.org>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <97d8a796-f790-8efc-1d89-def1f1193e61@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 14/07/23 15:00, Julien Grall wrote:
> Hi Nicola,
> 
> On 14/07/2023 12:49, Nicola Vetrini wrote:
>> This patch aims to fix some occurrences of possibly uninitialized
>> variables, that may be read before being written. This behaviour would
>> violate MISRA C:2012 Rule 9.1, besides being generally undesirable.
>>
>> In all the analyzed cases, such accesses were actually safe, but it's
>> quite difficult to prove so by automatic checking, therefore a safer
>> route is to change the code so as to avoid the behaviour from occurring,
>> while preserving the semantics.
>>
>> To achieve this goal, I adopted the following strategies:
> 
> Please let's at least one patch per strategy. I would also consider some 
> of the rework separate so they can go in regardless the decision for the 
> SAF-*.
> 
>>
>> - Add a suitably formatted local deviation comment
>> Â Â  (as indicated in 'docs/misra/documenting-violations.rst')
>> Â Â  to exempt the following line from checking.
>>
>> - Provide an initialization for the variable at the declaration.
>>
>> - Substitute a goto breaking out of control flow logic with a 
>> semantically
>> Â Â  equivalent do { .. } while(0).
> 
> As I already mentioned in private, it is unclear to me how you decided 
> which strategy to use. I still think we need to define our policy before 
> changing the code. Otherwise, it is going to be difficult to decide for 
> new code.
> 

The main point of this RFC is doing so. From what I gathered, it's not 
an easy task: sometimes there are no 'safe' values to initialize 
variables to and sometimes there is no easy way to prove that indeed 
something is always initialized or not accessed at all.

>>
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>> ---
>> Â  docs/misra/safe.jsonÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  8 +++++++
>> Â  xen/arch/arm/arm64/lib/find_next_bit.c |Â  1 +
>> Â  xen/arch/arm/bootfdt.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  6 +++++
>> Â  xen/arch/arm/decode.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  2 ++
>> Â  xen/arch/arm/domain_build.cÂ Â Â Â Â Â Â Â Â Â Â  | 29 ++++++++++++++++++----
>> Â  xen/arch/arm/efi/efi-boot.hÂ Â Â Â Â Â Â Â Â Â Â  |Â  6 +++--
>> Â  xen/arch/arm/gic-v3-its.cÂ Â Â Â Â Â Â Â Â Â Â Â Â  |Â  9 ++++---
>> Â  xen/arch/arm/mm.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  1 +
>> Â  xen/arch/arm/p2m.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  | 33 +++++++++++++++-----------
>> Â  9 files changed, 69 insertions(+), 26 deletions(-)
>>
>> diff --git a/docs/misra/safe.json b/docs/misra/safe.json
>> index e3c8a1d8eb..244001f5be 100644
>> --- a/docs/misra/safe.json
>> +++ b/docs/misra/safe.json
>> @@ -12,6 +12,14 @@
>> Â Â Â Â Â Â Â Â Â  },
>> Â Â Â Â Â Â Â Â Â  {
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  "id": "SAF-1-safe",
>> +Â Â Â Â Â Â Â Â Â Â Â  "analyser": {
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  "eclair": "MC3R1.R9.1"
>> +Â Â Â Â Â Â Â Â Â Â Â  },
>> +Â Â Â Â Â Â Â Â Â Â Â  "name": "Rule 9.1: initializer not needed",
>> +Â Â Â Â Â Â Â Â Â Â Â  "text": "The following local variables are possibly 
>> subject to being read before being written, but code inspection 
>> ensured that the control flow in the construct where they appear 
>> ensures that no such event may happen."
> I am bit concerned which such statement because the code instance was 
> today with the current code. This could change in the future and 
> invalide the reasoning.
> 
> It is not clear to me if we have any mechanism to prevent that. If we 
> don't, then I think we need to drastically reduce the number of time 
> this is used (there are a bit too much for my taste).
> 

Indeed, the purpose of such a deviation is that the sound 
overapproximation computed by the tool requires a human to look at the 
code and think twice before modifying it (i.e., if ever that code is 
touched, the reviewer ought to assess whether that justification still 
holds or some other thing should be done about it.

>> +Â Â Â Â Â Â Â  },
>> +Â Â Â Â Â Â Â  {
>> +Â Â Â Â Â Â Â Â Â Â Â  "id": "SAF-2-safe",
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  "analyser": {},
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  "name": "Sentinel",
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  "text": "Next ID to be used"
>> diff --git a/xen/arch/arm/arm64/lib/find_next_bit.c 
>> b/xen/arch/arm/arm64/lib/find_next_bit.c
>> index ca6f82277e..51b852c595 100644
>> --- a/xen/arch/arm/arm64/lib/find_next_bit.c
>> +++ b/xen/arch/arm/arm64/lib/find_next_bit.c
>> @@ -67,6 +67,7 @@ unsigned long find_next_zero_bit(const unsigned long 
>> *addr, unsigned long size,
>> Â  {
>> Â Â Â Â Â  const unsigned long *p = addr + BIT_WORD(offset);
>> Â Â Â Â Â  unsigned long result = offset & ~(BITS_PER_LONG-1);
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  unsigned long tmp;
> 
> This is a file that was copied as-is from Linux. I thought we exclude them.

There was an expansion location in the report that caused that file to 
appear in the output. Thanks for reporting it.

> 
> Anyway, can you provide some details why Eclair thinks this is may be 
> used unitialized?

The problem lies in the goto skipping out of control flow structures. It 
can't be refactored with a "do { tmp=...; break; } while(0)", as done 
elsewhere, because there are two distinct labels in there, so the 
semantics would be altered. The same comment applies in other instances 
as well.

> 
>> Â Â Â Â Â  if (offset >= size)
>> diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
>> index 2673ad17a1..1292a64e8d 100644
>> --- a/xen/arch/arm/bootfdt.c
>> +++ b/xen/arch/arm/bootfdt.c
>> @@ -34,6 +34,7 @@ static bool __init device_tree_node_matches(const 
>> void *fdt, int node,
>> Â  static bool __init device_tree_node_compatible(const void *fdt, int 
>> node,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const char *match)
>> Â  {
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  int len, l;
> 
> It is unclear to me whether the SAF-* applies to 'len' or 'l'.

Just len, they need to be two separate declarations if it is agreed not 
to initialize it. Good catch.

> 
>> Â Â Â Â Â  const void *prop;
>> @@ -169,7 +170,9 @@ int __init device_tree_for_each_node(const void 
>> *fdt, int node,
>> Â Â Â Â Â Â  */
>> Â Â Â Â Â  int depth = 0;
>> Â Â Â Â Â  const int first_node = node;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  u32 address_cells[DEVICE_TREE_MAX_DEPTH];
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  u32 size_cells[DEVICE_TREE_MAX_DEPTH];
> 
> I have never sent formally, but in the past I proposed to rework the 
> code so {address, size}_cells[0] would be initialized before the loop. 
> See 
> https://lore.kernel.org/all/ea06f2ac-4ac1-4a6f-bda6-e775a7e68699@xen.org/.
> 
> Do you think this would help?

If that initialization is applied to all the array elements yes, because 
the Amplification of R9.1 says:
"For the purposes of this rule, an array element or structure member 
shall be considered as a discrete
object".
Otherwise, initializing just the first element does not improve the 
situation in any way, and this is currently not within of the analysis 
capabilities of ECLAIR.

> 
>> Â Â Â Â Â  int ret;
>> @@ -249,8 +252,10 @@ static void __init process_multiboot_node(const 
>> void *fdt, int node,
>> Â Â Â Â Â  const __be32 *cell;
>> Â Â Â Â Â  bootmodule_kind kind;
>> Â Â Â Â Â  paddr_t start, size;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  int len;
>> Â Â Â Â Â  /* sizeof("/chosen/") + DT_MAX_NAME + '/' + DT_MAX_NAME + '/0' 
>> => 92 */
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1*/
>> Â Â Â Â Â  char path[92];
> 
> So the two above, is one category of issue. The variables are passed as 
> argument of function which will fill them.
> 
> Can Eclair look at the callers, if so, can we consider to always 
> initialize the values in the callee?
> 
> This would reduce the number of SAF-*. There are a few other examples 
> like that below. So I will skip them for now.
> 
> [...]
> 

If the value is always initialized in the callee, then there's no 
problem configuring ECLAIR so that it knows that this parameter is 
always written, and therefore any subsequent use in the caller is ok.

Another possibility is stating that a function never reads the pointee 
before writing to it (it may or may not write it, but if it doesn't, 
then the pointee is not read either). The 'strncmp' after 'fdt_get_path' 
does get in the way, though, because this property is not strong enough 
to ensure that we can use 'path' after returning from the function.

>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>> index d0d6be922d..d43f86c2f0 100644
>> --- a/xen/arch/arm/domain_build.c
>> +++ b/xen/arch/arm/domain_build.c
>> @@ -62,7 +62,7 @@ custom_param("dom0_mem", parse_dom0_mem);
>> Â  int __init parse_arch_dom0_param(const char *s, const char *e)
>> Â  {
>> -Â Â Â  long long val;
>> +Â Â Â  long long val = LLONG_MAX;
> 
> Can you explain why you decided to initialize rather than SAF-? For 
> clarity, I am not asking to switch to SAF-, I am mainly interested what 
> were your though process.
> 

I saw that putting a large enough value here would be out of range and 
trigger the printk even if the conditional leads to somehow enter the if 
branch with an invalid value.

>> Â Â Â Â Â  if ( !parse_signed_integer("sve", s, e, &val) )
>> Â Â Â Â Â  {
>> @@ -1077,6 +1077,7 @@ static void __init 
>> assign_static_memory_11(struct domain *d,
>> Â  static int __init handle_linux_pci_domain(struct kernel_info *kinfo,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const struct 
>> dt_device_node *node)
>> Â  {
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  uint16_t segment;
>> Â Â Â Â Â  int res;
>> @@ -1351,6 +1352,7 @@ static int __init make_memory_node(const struct 
>> domain *d,
>> Â Â Â Â Â  unsigned int i;
>> Â Â Â Â Â  int res, reg_size = addrcells + sizecells;
>> Â Â Â Â Â  int nr_cells = 0;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1*/
>> Â Â Â Â Â  __be32 reg[NR_MEM_BANKS * 4 /* Worst case addrcells + sizecells 
>> */];
>> Â Â Â Â Â  __be32 *cells;
>> @@ -1578,6 +1580,7 @@ static int __init find_unallocated_memory(const 
>> struct kernel_info *kinfo,
>> Â Â Â Â Â  struct rangeset *unalloc_mem;
>> Â Â Â Â Â  paddr_t start, end;
>> Â Â Â Â Â  unsigned int i;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  int res;
>> Â Â Â Â Â  dt_dprintk("Find unallocated memory for extended regions\n");
>> @@ -1727,6 +1730,7 @@ static int __init find_memory_holes(const struct 
>> kernel_info *kinfo,
>> Â Â Â Â Â  dt_for_each_device_node( dt_host, np )
>> Â Â Â Â Â  {
>> Â Â Â Â Â Â Â Â Â  unsigned int naddr;
>> +Â Â Â Â Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â Â Â Â Â  paddr_t addr, size;
>> Â Â Â Â Â Â Â Â Â  naddr = dt_number_of_address(np);
>> @@ -1976,9 +1980,11 @@ static int __init make_cpus_node(const struct 
>> domain *d, void *fdt)
>> Â Â Â Â Â  const struct dt_device_node *npcpu;
>> Â Â Â Â Â  unsigned int cpu;
>> Â Â Â Â Â  const void *compatible = NULL;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  u32 len;
>> Â Â Â Â Â  /* Placeholder for cpu@ + a 32-bit hexadecimal number + \0 */
>> Â Â Â Â Â  char buf[13];
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  u32 clock_frequency;
>> Â Â Â Â Â  /* Keep the compiler happy with -Og */
>> Â Â Â Â Â  bool clock_valid = false;
>> @@ -2104,6 +2110,7 @@ static int __init make_gic_node(const struct 
>> domain *d, void *fdt,
>> Â Â Â Â Â  const struct dt_device_node *gic = dt_interrupt_controller;
>> Â Â Â Â Â  int res = 0;
>> Â Â Â Â Â  const void *addrcells, *sizecells;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  u32 addrcells_len, sizecells_len;
>> Â Â Â Â Â  /*
>> @@ -2179,6 +2186,7 @@ static int __init make_timer_node(const struct 
>> kernel_info *kinfo)
>> Â Â Â Â Â  int res;
>> Â Â Â Â Â  unsigned int irq[MAX_TIMER_PPI];
>> Â Â Â Â Â  gic_interrupt_t intrs[3];
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  u32 clock_frequency;
>> Â Â Â Â Â  bool clock_valid;
>> @@ -2511,6 +2519,7 @@ static int __init handle_device(struct domain 
>> *d, struct dt_device_node *dev,
>> Â Â Â Â Â  unsigned int naddr;
>> Â Â Â Â Â  unsigned int i;
>> Â Â Â Â Â  int res;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  paddr_t addr, size;
>> Â Â Â Â Â  bool own_device = !dt_device_for_passthrough(dev);
>> Â Â Â Â Â  /*
>> @@ -2779,6 +2788,7 @@ static int __init make_gicv2_domU_node(struct 
>> kernel_info *kinfo)
>> Â  {
>> Â Â Â Â Â  void *fdt = kinfo->fdt;
>> Â Â Â Â Â  int res = 0;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1*/
>> Â Â Â Â Â  __be32 reg[(GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS) * 2];
>> Â Â Â Â Â  __be32 *cells;
>> Â Â Â Â Â  const struct domain *d = kinfo->d;
>> @@ -2914,6 +2924,7 @@ static int __init make_vpl011_uart_node(struct 
>> kernel_info *kinfo)
>> Â Â Â Â Â  void *fdt = kinfo->fdt;
>> Â Â Â Â Â  int res;
>> Â Â Â Â Â  gic_interrupt_t intr;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1*/
>> Â Â Â Â Â  __be32 reg[GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS];
>> Â Â Â Â Â  __be32 *cells;
>> Â Â Â Â Â  struct domain *d = kinfo->d;
>> @@ -3435,6 +3446,7 @@ static void __init initrd_load(struct 
>> kernel_info *kinfo)
>> Â Â Â Â Â  paddr_t paddr, len;
>> Â Â Â Â Â  int node;
>> Â Â Â Â Â  int res;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  __be32 val[2];
>> Â Â Â Â Â  __be32 *cellp;
>> Â Â Â Â Â  void __iomem *initrd;
>> @@ -3514,6 +3526,7 @@ static int __init get_evtchn_dt_property(const 
>> struct dt_device_node *np,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  uint32_t *port, uint32_t 
>> *phandle)
>> Â  {
>> Â Â Â Â Â  const __be32 *prop = NULL;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  uint32_t len;
>> Â Â Â Â Â  prop = dt_get_property(np, "xen,evtchn", &len);
>> @@ -3538,10 +3551,13 @@ static int __init get_evtchn_dt_property(const 
>> struct dt_device_node *np,
>> Â  static int __init alloc_domain_evtchn(struct dt_device_node *node)
>> Â  {
>> Â Â Â Â Â  int rc;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  uint32_t domU1_port, domU2_port, remote_phandle;
>> Â Â Â Â Â  struct dt_device_node *remote_node;
>> Â Â Â Â Â  const struct dt_device_node *p1_node, *p2_node;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  struct evtchn_alloc_unbound alloc_unbound;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  struct evtchn_bind_interdomain bind_interdomain;
>> Â Â Â Â Â  struct domain *d1 = NULL, *d2 = NULL;
>> @@ -3789,11 +3805,12 @@ static int __init construct_domain(struct 
>> domain *d, struct kernel_info *kinfo)
>> Â  static int __init alloc_xenstore_evtchn(struct domain *d)
>> Â  {
>> -Â Â Â  evtchn_alloc_unbound_t alloc;
>> +Â Â Â  evtchn_alloc_unbound_t alloc = {
>> +Â Â Â Â Â Â Â  .dom = d->domain_id,
>> +Â Â Â Â Â Â Â  .remote_dom = hardware_domain->domain_id
>> +Â Â Â  };
>> Â Â Â Â Â  int rc;
>> -Â Â Â  alloc.dom = d->domain_id;
>> -Â Â Â  alloc.remote_dom = hardware_domain->domain_id;
> 
> It is not clear why this is modified. There are only two fields in 
> 'alloc' and they are both initialized.
> 

There are three fields in the struct, and the third is clearly to be set 
by an initalization function. If, as above with 'path', the init 
function ensures that the third field is always written then there's no 
problem, otherwise this initialization prevents any use of an 
uninitialized port.

struct evtchn_alloc_unbound {
      /* IN parameters */
      domid_t dom, remote_dom;
      /* OUT parameters */
      evtchn_port_t port;
};
typedef struct evtchn_alloc_unbound evtchn_alloc_unbound_t;

>> Â Â Â Â Â  rc = evtchn_alloc_unbound(&alloc, 0);
>> Â Â Â Â Â  if ( rc )
>> Â Â Â Â Â  {
>> @@ -3810,8 +3827,9 @@ static int __init construct_domU(struct domain *d,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const struct dt_device_node *node)
>> Â  {
>> Â Â Â Â Â  struct kernel_info kinfo = {};
>> -Â Â Â  const char *dom0less_enhanced;
>> +Â Â Â  const char *dom0less_enhanced = NULL;
> 
> If you look at the user below, all the callers assume dom0less_enhanced 
> will be non-NULL. So it is unclear to me how this value is safer.
>  > Looking at the code, I wonder whether we should convert
> dt_property_read_string() to use ERR_PTR(). So we could remove the last 
> argument and return it instead.

Is relying on that assumption somehow safer? The suggestion to remove 
the last parameter seems better.

> 
>> Â Â Â Â Â  int rc;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  u64 mem;
>> Â Â Â Â Â  u32 p2m_mem_mb;
>> Â Â Â Â Â  unsigned long p2m_pages;
>> @@ -3939,6 +3957,7 @@ void __init create_domUs(void)
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  .grant_opts = 
>> XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
>> Â Â Â Â Â Â Â Â Â  };
>> Â Â Â Â Â Â Â Â Â  unsigned int flags = 0U;
>> +Â Â Â Â Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â Â Â Â Â  uint32_t val;
>> Â Â Â Â Â Â Â Â Â  int rc;
>> diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
>> index bb64925d70..25f39364d1 100644
>> --- a/xen/arch/arm/efi/efi-boot.h
>> +++ b/xen/arch/arm/efi/efi-boot.h
>> @@ -117,6 +117,7 @@ static int __init setup_chosen_node(void *fdt, int 
>> *addr_cells, int *size_cells)
>> Â  static int __init fdt_set_reg(void *fdt, int node, int addr_cells,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  int size_cells, uint64_t addr, 
>> uint64_t len)
>> Â  {
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  __be32 val[4]; /* At most 2 64 bit values to be stored */
>> Â Â Â Â Â  __be32 *cellp;
>> @@ -308,7 +309,7 @@ fdt_set_fail:
>> Â  static void __init *fdt_increase_size(struct file *fdtfile, int 
>> add_size)
>> Â  {
>> Â Â Â Â Â  EFI_STATUS status;
>> -Â Â Â  EFI_PHYSICAL_ADDRESS fdt_addr;
>> +Â Â Â  EFI_PHYSICAL_ADDRESS fdt_addr = 0;
>> Â Â Â Â Â  int fdt_size;
>> Â Â Â Â Â  int pages;
>> Â Â Â Â Â  void *new_fdt;
>> @@ -433,7 +434,7 @@ static void __init efi_arch_cfg_file_late(const 
>> EFI_LOADED_IMAGE *image,
>> Â  static void *__init efi_arch_allocate_mmap_buffer(UINTN map_size)
>> Â  {
>> -Â Â Â  void *ptr;
>> +Â Â Â  void *ptr = NULL;
>> Â Â Â Â Â  EFI_STATUS status;
>> Â Â Â Â Â  status = efi_bs->AllocatePool(EfiLoaderData, map_size, &ptr);
>> @@ -538,6 +539,7 @@ static void __init efi_arch_handle_module(const 
>> struct file *file,
>> Â  {
>> Â Â Â Â Â  int node;
>> Â Â Â Â Â  int chosen;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  int addr_len, size_len;
>> Â Â Â Â Â  if ( file == &dtbfile )
>> diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
>> index 3aa4edda10..aa0180ab5b 100644
>> --- a/xen/arch/arm/gic-v3-its.c
>> +++ b/xen/arch/arm/gic-v3-its.c
>> @@ -192,8 +192,7 @@ static int its_send_cmd_mapc(struct host_its *its, 
>> uint32_t collection_id,
>> Â Â Â Â Â  cmd[0] = GITS_CMD_MAPC;
>> Â Â Â Â Â  cmd[1] = 0x00;
>> -Â Â Â  cmd[2] = encode_rdbase(its, cpu, collection_id);
>> -Â Â Â  cmd[2] |= GITS_VALID_BIT;
>> +Â Â Â  cmd[2] = encode_rdbase(its, cpu, collection_id) | GITS_VALID_BIT;
> 
> Hmmm... How is this even considered as unitialized variable?
> 

The analysis here could use some more precision, but the modified 
construct is entirely equivalent.

>> Â Â Â Â Â  cmd[3] = 0x00;
>> Â Â Â Â Â  return its_send_command(its, cmd);
>> @@ -215,9 +214,7 @@ static int its_send_cmd_mapd(struct host_its *its, 
>> uint32_t deviceid,
>> Â Â Â Â Â  }
>> Â Â Â Â Â  cmd[0] = GITS_CMD_MAPD | ((uint64_t)deviceid << 32);
>> Â Â Â Â Â  cmd[1] = size_bits;
>> -Â Â Â  cmd[2] = itt_addr;
>> -Â Â Â  if ( valid )
>> -Â Â Â Â Â Â Â  cmd[2] |= GITS_VALID_BIT;
>> +Â Â Â  cmd[2] = itt_addr | (valid ? GITS_VALID_BIT : 0x00);
> 
> Same here.
> 
>> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
>> index c688227abd..a36068b2d8 100644
>> --- a/xen/arch/arm/mm.c
>> +++ b/xen/arch/arm/mm.c
>> @@ -935,6 +935,7 @@ static int xen_pt_update_entry(mfn_t root, 
>> unsigned long virt,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_t mfn, unsigned int target,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned int flags)
>> Â  {
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  int rc;
>> Â Â Â Â Â  unsigned int level;
>> Â Â Â Â Â  lpae_t *table;
>> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
>> index de32a2d638..83c56cf1cb 100644
>> --- a/xen/arch/arm/p2m.c
>> +++ b/xen/arch/arm/p2m.c
>> @@ -496,16 +496,18 @@ mfn_t p2m_get_entry(struct p2m_domain *p2m, 
>> gfn_t gfn,
>> Â Â Â Â Â  lpae_t entry, *table;
>> Â Â Â Â Â  int rc;
>> Â Â Â Â Â  mfn_t mfn = INVALID_MFN;
>> -Â Â Â  p2m_type_t _t;
>> +Â Â Â  p2m_type_t _t = p2m_invalid;
>> Â Â Â Â Â  DECLARE_OFFSETS(offsets, addr);
>> Â Â Â Â Â  ASSERT(p2m_is_locked(p2m));
>> Â Â Â Â Â  BUILD_BUG_ON(THIRD_MASK != PAGE_MASK);
>> Â Â Â Â Â  /* Allow t to be NULL */
>> -Â Â Â  t = t ?: &_t;
>> -
>> -Â Â Â  *t = p2m_invalid;
>> +Â Â Â  if( t ) {
>> +Â Â Â Â Â Â Â  *t = _t;
>> +Â Â Â  } else {
>> +Â Â Â Â Â Â Â  t = &_t;
>> +Â Â Â  }
> What was the problem with the previous code?
> 
> This is also not conformant to Xen coding style.
> 

The problem is that _t may be uninitialized, hence assigning its address 
to t could be problematic. Another way to address this is to initialize 
_t to a bad value and use this variable in the body, then assign to t 
based on the value just before returning. Point taken on the coding style.

>> Â Â Â Â Â  if ( valid )
>> Â Â Â Â Â Â Â Â Â  *valid = false;
>> @@ -1031,6 +1033,7 @@ static int __p2m_set_entry(struct p2m_domain *p2m,
>> Â Â Â Â Â  unsigned int level = 0;
>> Â Â Â Â Â  unsigned int target = 3 - (page_order / XEN_PT_LPAE_SHIFT);
>> Â Â Â Â Â  lpae_t *entry, *table, orig_pte;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  int rc;
> 
> Can you provide some details why Eclair thinks it is unitialized?

Same issue with gotos explained above, can't be refactored because of 
the for enclosing the goto.

> 
>> Â Â Â Â Â  /* A mapping is removed if the MFN is invalid. */
>> Â Â Â Â Â  bool removing_mapping = mfn_eq(smfn, INVALID_MFN);
>> @@ -1483,6 +1486,7 @@ static inline int p2m_remove_mapping(struct 
>> domain *d,
>> Â  {
>> Â Â Â Â Â  struct p2m_domain *p2m = p2m_get_hostp2m(d);
>> Â Â Â Â Â  unsigned long i;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  int rc;
> 
> 
> Can you provide some details why Eclair thinks it is unitialized?
> 

Same as above.

>> Â Â Â Â Â  p2m_write_lock(p2m);
>> @@ -1685,20 +1689,21 @@ static int p2m_alloc_vmid(struct domain *d)
>> Â Â Â Â Â  ASSERT(nr != INVALID_VMID);
>> -Â Â Â  if ( nr == MAX_VMID )
>> -Â Â Â  {
>> -Â Â Â Â Â Â Â  rc = -EBUSY;
>> -Â Â Â Â Â Â Â  printk(XENLOG_ERR "p2m.c: dom%d: VMID pool exhausted\n", 
>> d->domain_id);
>> -Â Â Â Â Â Â Â  goto out;
>> -Â Â Â  }
>> +Â Â Â  do {
> 
> I don't understand this change. How is this making better for Eclair?
> 

This is an example where the goto can be eliminated, which in turn 
allows to automatically check the correctness.

>> +Â Â Â Â Â  if ( nr == MAX_VMID )
>> +Â Â Â Â Â  {
>> +Â Â Â Â Â Â Â Â Â  rc = -EBUSY;
>> +Â Â Â Â Â Â Â Â Â  printk(XENLOG_ERR "p2m.c: dom%d: VMID pool exhausted\n", 
>> d->domain_id);
>> +Â Â Â Â Â Â Â Â Â  break;
>> +Â Â Â Â Â  }
>> -Â Â Â  set_bit(nr, vmid_mask);
>> +Â Â Â Â Â  set_bit(nr, vmid_mask);
>> -Â Â Â  p2m->vmid = nr;
>> +Â Â Â Â Â  p2m->vmid = nr;
>> -Â Â Â  rc = 0;
>> +Â Â Â Â Â Â Â Â Â Â Â  rc = 0;
>> +Â Â Â Â Â Â Â  } while ( 0 );
>> -out:
>> Â Â Â Â Â  spin_unlock(&vmid_alloc_lock);
>> Â Â Â Â Â  return rc;
>> Â  }
> 


Considering all of the replies above, a first draft of a strategy/policy 
I can think of is having:

- Initializer functions that always write their parameter, so that the 
strongest "pointee always written" property can be stated. This causes 
all further uses to be marked safe.

- Initialize the variable when there exists a known safe value that does 
not alter the semantics of the function. The initialization does not 
need to be at the declaration, but doing so simplifies the code.

- Deviate all cases where any of the previous does not apply, with a 
comment deviation that refers to a justification reporting that the code 
has been checked to respect the rule (keep in mind that _violations_ to 
a Mandatory rule such as R9.1 are not allowed to claim MISRA compliance).

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 12:16:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 12:16:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564487.881927 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLN9G-0003QJ-O9; Mon, 17 Jul 2023 12:16:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564487.881927; Mon, 17 Jul 2023 12:16:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLN9G-0003QC-LI; Mon, 17 Jul 2023 12:16:18 +0000
Received: by outflank-mailman (input) for mailman id 564487;
 Mon, 17 Jul 2023 12:16:17 +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
 <SRS0=LRey=DD=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qLN9F-0003Q6-Hr
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 12:16:17 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b9ae96b8-249b-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 14:16:15 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.163.206.54])
 by support.bugseng.com (Postfix) with ESMTPSA id 38E694EE0739;
 Mon, 17 Jul 2023 14:16:12 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b9ae96b8-249b-11ee-8611-37d641c3527e
Message-ID: <2bc64be1-10c0-d064-a5a2-1f076b596e6e@bugseng.com>
Date: Mon, 17 Jul 2023 14:16:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
Content-Language: en-US
To: Julien Grall <julien@xen.org>, Luca Fancellu <Luca.Fancellu@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 "xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
 "ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
 "consulting@bugseng.com" <consulting@bugseng.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
 <d1ccb5e1-d122-88df-e46a-39494b6d6d12@xen.org>
 <299D0BAE-D15E-4260-AF3E-8D84CF058083@arm.com>
 <528fb310-f469-e449-d1c3-269fa7dec750@xen.org>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <528fb310-f469-e449-d1c3-269fa7dec750@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 16/07/23 18:50, Julien Grall wrote:
> Hi,
> 
> On 16/07/2023 10:20, Luca Fancellu wrote:
>>> On 14 Jul 2023, at 14:05, Julien Grall <julien@xen.org> wrote:
>>>
>>> Hi,
>>>
>>> On 14/07/2023 12:49, Nicola Vetrini wrote:
>>>> The macro 'testop' expands to a function that declares the local
>>>> variable 'oldbit', which is written before being set, but is such a
>>>> way that is not amenable to automatic checking.
>>>
>>> The code is pretty straightforward. So I am not entirely sure why 
>>> Eclair is not happy. Is it because the value is set by assembly code?

Exactly. The reason why I didn't just state that oldbit is always 
written or never read before being written in that function is that I 
was unsure about the meaning of the assembly.

>>
>> Hi Julien,
>>
>> Yes I agree that itâ€™s strange, do you think that that if at line 97 we 
>> initialize oldbit to zero, it would solve the issue?
> 
> At the moment, I am not entirely happy to zero oldbit because we have 
> other places in Xen where we need assembly instructions to read a value 
> (e.g. READ_SYSREG()).
> 
> So I would first like to understand why Eclair can't cope with it.
> 
> Cheers,
> 

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 12:23:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 12:23:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564494.881937 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLNGS-0004wZ-F0; Mon, 17 Jul 2023 12:23:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564494.881937; Mon, 17 Jul 2023 12:23:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLNGS-0004wS-C7; Mon, 17 Jul 2023 12:23:44 +0000
Received: by outflank-mailman (input) for mailman id 564494;
 Mon, 17 Jul 2023 12:23:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=FdAb=DD=citrix.com=prvs=555bb5b00=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qLNGQ-0004wM-Oa
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 12:23:42 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c23b872a-249c-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 14:23:40 +0200 (CEST)
Received: from mail-mw2nam10lp2100.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.100])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 17 Jul 2023 08:23:22 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by CH0PR03MB5987.namprd03.prod.outlook.com (2603:10b6:610:e2::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 12:23:20 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780%5]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 12:23:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c23b872a-249c-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689596620;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=6uCl18GswcnARF2LG8ri7XpBSfCjE1NkWSDpmyffwcQ=;
  b=NywgoeKoNsZSURW51QiNtoXq3BmelAmVcJlH5h3U78jOqrEikTqrMBeU
   HywLpfqz4nta7xelw5osPSsxsmWm5Qe5bEyv2ph2cbA3+SKdY8ZC3A57h
   l/NmElQsF7AHXst5ntOlg2Ntw3mbpvvp8agW0qv4pHAW0lq+hpjaTxQjj
   M=;
X-IronPort-RemoteIP: 104.47.55.100
X-IronPort-MID: 116328911
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:oVfXH6qbWknRDJ7ideqf5Pt6Yj1eBmLgZBIvgKrLsJaIsI4StFCzt
 garIBnSbveCN2r0eNF/YNy39UgO78TSmNU1GQA5+Xo1Ey4T+ZuZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weBziZNVfrzGInqR5fGatgMdgKFb
 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo
 OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay
 RAXAGs3Uyu/tfOw+uiicsx2pfYAEsf1PLpK7xmMzRmBZRonabbqZvySoPpnhnI3jM0IGuvCb
 c0EbzYpdA7HfxBEJlYQDtQ5gfusgX78NTZfrTp5p4JuuzSVkFM3jeWraYKNEjCJbZw9ckKwj
 2TK5WnmRDodM8SS02Gt+XOwnO7f2yj8Xer+EZXhr6Ax2g3CnzV75Bs+WWmin97moxOEQM9GJ
 1IFxSlpnJJj+xn+JjX6d1jiyJKehTYeUddNF+wx6CmW17HZpQ2eAwAsUTppeNEg8sgsSlQCz
 V6MmNXkQzZmtLmcU3Ob3r2Joii/PydTJmgHDQcLTAID58Toqcc3kwrGVNdlEYa/k9LuFDf/h
 TuNqUAWnK4PhMQG06G6+1HvgD+2oJXNCAkv6W3/Tm+jqw90eoOhT4ip8kTAq+ZNKp6DSVuMt
 2RCnNKRhN3iFrmInS2JBeASRreg4q/dNCWG2AY3WZ486z6q5nivO5hK5y1zL1toNcBCfiL1Z
 EjUukVa45o70GaWUJKbqrmZU6wCpZUM3/y/Dpg4svImjkBNSTK6
IronPort-HdrOrdr: A9a23:/+89HqkEDJ/C5sdAUX3HJeTA2FjpDfIq3DAbv31ZSRFFG/Fw8P
 re+8jztCWE7gr5PUtKpTnuAse9qB/nhP1ICPcqTNOftXjd2VdARbsKheffKhLbdBEWndQ86U
 4PSdkdNDW5ZWIRsS6xiDPULz7BqOP3lZyVuQ==
X-Talos-CUID: 9a23:BOyXgW3fbGbR5xk4lLz18LxfQfoYSUHv3XHqeVaALHxKep6rR0GQwfYx
X-Talos-MUID: 9a23:czBs4wVx1eZB2vnq/DPenQ9Fa+412b+zEUwTgKoF/Pi+ZCMlbg==
X-IronPort-AV: E=Sophos;i="6.01,211,1684814400"; 
   d="scan'208";a="116328911"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=REfUc/gPUAlGieIAl6m9CDz6O0Jm5p5xFAwesI9mbb2hbF1riLh0HJXuYdlsetleh4s7U1sEQmdzed2slpwKpvuovfRGlAPVKf9AckSrCU97fBdsIbCLFmUsCkDescj6Ew7QeKi9y+o+TupDmMfU6Pas59W9CQNg84C/pRpsx0JP//6nEW50I1HQ/gFNq+lmE75DNrBPZ5CULwVyEQfet56XSn8TTzKbdbKyBbFMZrETuKXh96kUTJT4I0f3++xHwPhXjsGGEVXTCOZdcj3aQkPnTVJrGXFSR2v2WuqNIQ23KnrMezPXEmu9EUKNOvf8pILysESDphA7t8GBkqG8uQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=fwNToH4q43CeZZFee+7DNm2NRKC4m0ZgSi8ZqdbLa5k=;
 b=UF3Z3DqHxhl6CCmRdXRzfABzelQR9WBN8U1VVu0X8H7J12hQfD4raN3Qvi9Cv2BW013k4u8L4gBJNOdG7bqV+SNiu/rQdw7/Gry9zcqZf+ScoHJtJ2XkNfHdB26SlLU+BAoHWCzsk4ng0TNsayLOpUmQQvGPlbj1oU16AnL5sf4Ynq++tlz22r6gAehctAlNFwGnqQn5YcAYHUWqUNbQKz3U+rTJNffYUNjGnn8ohA9S6j7Qin8MwPfP/qz2GSohim79s7lSH1uzjpgjxnNdL/WEVKuzTq8Q7OteeJKjWJETj5RvWyXB+xUC6Ascfh9hQLVClyk8VZlJWcneNv24tA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fwNToH4q43CeZZFee+7DNm2NRKC4m0ZgSi8ZqdbLa5k=;
 b=CRNr5Zsff655dXb+3hidWGq1+p2spvsKEKQyIUZiQKBpoEK76mlflZxn+I/wFZK5TC4XJHG8T8eA+13kWuB3u7LwY6eidN3n6Nz8as7J/SfJ3fKtsXn9c+ZQWWbjjz88As0Cu8Ezz687XmM7TRvOGeQxgZ0IP5Z84K8CS+KGcOQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <214bdf26-9f30-7ee2-e59f-e8f0c96937ee@citrix.com>
Date: Mon, 17 Jul 2023 13:23:13 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH] x86: drop old (32-bit-only) MSR definitions
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>
Cc: Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Simone Ballarin <simone.ballarin@bugseng.com>,
 Gianluca Luparini <gianluca.luparini@bugseng.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <df2c3154-2e8b-194a-ec1e-472819bbf026@suse.com>
 <38707d09-92a3-2807-4bf0-167be5c3bb15@citrix.com>
 <ee342a26-5f26-0e47-06a6-c74fdb3270d6@suse.com>
In-Reply-To: <ee342a26-5f26-0e47-06a6-c74fdb3270d6@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P265CA0149.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:9::17) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|CH0PR03MB5987:EE_
X-MS-Office365-Filtering-Correlation-Id: 88fbfba8-33b6-4f70-f8a5-08db86c09ad2
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Yb7jktjJbzy7i6ofxwWWQw91mRRkmV7xtCeQwOmx3WWeajuNfOSQvFMrz/iZH/NWoo4DUTgnMbKAFKKsQiM6747cf+FqIRyv9ogiVPi7YvZorguVzS7QkxCPWdOKTrvZQ31dWOs8OIQIDlSB8w7sPJnPenfgaP1nF97ng6iaaPrUf/SUN3r964ukWkfzs88PXoZDSw9TWjMZ9Qf/fQmdLkG5nKwK+BVsHrOF3V03pJQmRFd0EztfKfFRVVsY9gIrq3fqIMnKEifavf31ijl8uxyQMp19annvGx6lSMjsR5Yk4rN+XRYx9k/xIIe5HDLDQOHFTOE/fZ3IYHJ/173ygx3Q+VKJU0Ny24r9wd4JoT4/7LYX/6L1iZlMhehL6GYPS77QNDYyzNRwBaAi6feIb8fPCvYkDMKeHmEDIAoQtlo22371JpNcW4fGlwvdAR746kFq8vOlMmbnobbf+0DKYXA1n6JSQ2uhhBEo7Px4O2tlCX+79OTM702wX5+61OYCtBgJ0yQsM0JxMp49z3Xq03Xi35/T4/kTPpIDg2PgUFqr0IlAw5aaUICt5cBklvPawtoyE+ju+jb0mUVUrKpgxO9Yq58rX3LNixNJAN5VlAmxVCMfAt/M4r9z+Yb/4WTwmC5Iz8kAb/Nx60FwGv7jXA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(136003)(366004)(396003)(39860400002)(451199021)(31686004)(478600001)(6486002)(6666004)(54906003)(31696002)(86362001)(2906002)(4744005)(53546011)(36756003)(186003)(6506007)(2616005)(26005)(6512007)(316002)(38100700002)(82960400001)(66556008)(4326008)(6916009)(66946007)(66476007)(41300700001)(8936002)(8676002)(5660300002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?REo2dmVMRmhZanZJd1FabVh5U1lHZVl3eDRoV0oyVERJbk5Jb2NBbVJuMHlI?=
 =?utf-8?B?R2NYQStjeWNwRW04QmpHUFRFZFBjWGliQzBRcG9nQ014dTJVT0ttdlVMOHN0?=
 =?utf-8?B?ajFlQXdwNmlPNHpwY1Nzc01oUmdtVWhIWjIxeEc3OVlNVFpadlkwQ25VU0Qz?=
 =?utf-8?B?ME5hZWdFekJmaTE2SUZXYWVBaCt0bWluWkhjakc4UXlxeUJCTTF4NGZBTXIz?=
 =?utf-8?B?c2EwdnlzdCsycm40U3RzZE9aR0ZDM3FKbFVjbncrZVRGSHZtQWNyb0JaK2oz?=
 =?utf-8?B?UHRTWlR5ejBuZDZ3aGs4L2R2ZW9mQ0tNbGkvOGVHZFZocXVxZmNnUjNoS1pV?=
 =?utf-8?B?TVhLRVVkSGtMRlZBSGttdlhhRG81T005QlNkbWp3K0s1NVZEd2VDRWlLazg1?=
 =?utf-8?B?OE5OVkxxN3N3eVU2ZzkzSXdLWHV5ZktKaWJpOXYzVmZYdjlxbWhuSmJuN0s4?=
 =?utf-8?B?M2FJWmUrWkllYUFEV2gvNmxYcUFYcjZOMFdyemRkR1FTWWpDdjRHV0xNT0dq?=
 =?utf-8?B?T2dOTFdwck9IbjZxTURzazNEY0pQTFBwcFBZZzNZS1drdEZxcUVxRndCSy8x?=
 =?utf-8?B?YjlhV2tYcGJkL25zNVRpOTA1ZG5ieEVxS2F5UmIvdG1mRDV2N0pONTVOd2x4?=
 =?utf-8?B?TmpuTkJTTTBsZDdsMktJQmpaZTlYTVltd21heVp6NGIzb01ybHJ6VzdSMEFS?=
 =?utf-8?B?em92OEdvcjMvQ29JYkswcjZMUWp3Yk5aZjFtT3Vocnl2OTRVdC9PV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R2iwib8ahCIy6K0UuX3hfc6bZ7XsMQCfngmrldnjx/WFSpzgT/tkY0uIQtVkL1HZqBzbts/ci+fM1AZIW1q+ar1MwbMrBWHB+4OwSS4vCdh/6YoBYWBTbBAIa0bJ28XNOLKU8e07Ewb2wrr+GKaou6KKh71cFDlNefj8KOSetMLcRrdjX5eAOXuCuGIdUmac5rg/nmKFaFT/dP8SPrSJB4nav2kL9/+GYA1M07XMLh77OxM6yXkV7CPX1rTzhicSMOEHRK3f0gHkp8kD5/KRTXCpnxER/BUMqACq8Os23/Uf9N82ZR46X1mC8HpbXuELVMY7y4ZsLfYBsrc2tip47AaGz1P/UOqZAnOWZCBCHoB5kg3QCfRjU9pvvv7XYMPSEN0DVE4AakpHtOgtQoqCgY1s6rU2BxXzfH26s18PoOiWwOvy2S+lLgLeuNV8DB/ScJQgALT61a/C12FVdngyc7KvmV8zHEy1YjrClJOjge32u2f+5c8Yhkof9FuH2EdKHLVuWXpYOEtA2JEi2y8/aXlYqQ3nLiGpCO7geUfN5DqScsRtXvmzeH4Qi
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 88fbfba8-33b6-4f70-f8a5-08db86c09ad2
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 12:23:19.5046
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: vZZLWC84ThGoMkpFIY5ez0Ag4Uh01v57rNQdLEcznjblDMSljALt0PjeNpn0pi5gl3t++LRlcwT/XFm6vGEMj/lYpPTLkYegFQ68AsB2axY=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR03MB5987

On 17/07/2023 12:52 pm, Jan Beulich wrote:
> On 17.07.2023 12:33, Andrew Cooper wrote:
>> On 17/07/2023 10:17 am, Jan Beulich wrote:
>>>  /* Intel defined MSRs. */
>>> -#define MSR_IA32_P5_MC_ADDR		0x00000000
>>> -#define MSR_IA32_P5_MC_TYPE		0x00000001
>> These are architectural.Â  They still exist in all Intel and AMD CPUs.
>>
>> I'd suggest keeping them, because I think we're required to expose them
>> when advertising MCA.
> We have them twice, and I've kept the instances without IA32 in their names
> (at the very top of the file, i.e. already in the "new style" section).

Ah ok.

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 12:24:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 12:24:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564495.881947 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLNGf-0005EL-MY; Mon, 17 Jul 2023 12:23:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564495.881947; Mon, 17 Jul 2023 12:23:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLNGf-0005EC-Jv; Mon, 17 Jul 2023 12:23:57 +0000
Received: by outflank-mailman (input) for mailman id 564495;
 Mon, 17 Jul 2023 12:23:56 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=HNI8=DD=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qLNGe-0004wM-Py
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 12:23:56 +0000
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
 [2a00:1450:4864:20::62e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cc8a16d8-249c-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 14:23:56 +0200 (CEST)
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-9891c73e0fbso910431666b.1
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 05:23:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cc8a16d8-249c-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689596635; x=1692188635;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=LGCp6f7Mw5KvfRfDIg00T++t7Y382z3wCSngcbz0yHA=;
        b=b3vrmuXAw/YPSMAUPnIkoLWe3nzg8Qar3zKhzc129h0pRSEBIBx/NNR0pSqtSkPVlF
         sgH3wpncxBueQv/MWQ/a/NqSWE1OPajDakgkGRLRErOWEjOSmP3Yl2mM3um0U+K2jx24
         8fPBWiAGYzqg8FtkBbWYvCm9wVBlS++8ZbVsWQtHAbh+bG1eSrt0UO/esUXm3ZBIk4GE
         wTrG+wbMCppy0LCX7uCsbybLQ5yKsYX8XZVlRphkeinHbzaQxeSW6YPhzOEkTUXW5c40
         CNlzbewKLbjqJ9/nUjp4vMlfvUa+ZC/oi+Wd4jMkyP7BxvDRrwHC++hQ8PQiqFSSee4S
         4yNQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689596635; x=1692188635;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=LGCp6f7Mw5KvfRfDIg00T++t7Y382z3wCSngcbz0yHA=;
        b=C1/A9UFx+DbNX+56Anu36V+aco5c0B8mTZoYlakKDhGiX4bYkDNXo3wDGrp7Swfodv
         57DatDGNAt9uq753fEo7C/FX1JZ9QgKDprfiVMucOs3I1sLJNHe5HOXDavrMwb1m98cL
         Q2yy8K+HsVBXqegOpbEI5UWnP0wSKmS5x8krbFtrtV0rWfsZKaZPECEda6zJHJj1nCpg
         x6DTzBqzhkNqKust7ZzNnhu0WOLusf6vjNIpk5dIuDvDz0/oMKWSXXDb0Xd/wtVtB8l2
         eLENTx97jNaN0VJFhfBu3TRLB7MIY+gmWVlepQTu1m+fYLT78jPjRzS+r66CsB7QxUS2
         +06Q==
X-Gm-Message-State: ABy/qLaVAQf+SCY2bUcELtbc86fQHuHRfZnNCYOnmaM7VOo8XyY+uiu0
	8EPXwqhzcZT98E0yG/bL0xCauRtFsLqHUG3Lvkw=
X-Google-Smtp-Source: APBJJlGeRbETzJLdzlq9FfardnZ5654DsXaZZ3iUrBNUrAdGv5tlMjBwvgw1hUlHGRvv6+hWPoul4pcYk06W2hmPyRM=
X-Received: by 2002:a17:907:ea6:b0:96a:2dd7:2ee0 with SMTP id
 ho38-20020a1709070ea600b0096a2dd72ee0mr11385984ejc.5.1689596635310; Mon, 17
 Jul 2023 05:23:55 -0700 (PDT)
MIME-Version: 1.0
References: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com> <6f462a2f-2e91-6397-a527-18eeade19476@suse.com>
In-Reply-To: <6f462a2f-2e91-6397-a527-18eeade19476@suse.com>
From: Jason Andryuk <jandryuk@gmail.com>
Date: Mon, 17 Jul 2023 08:23:43 -0400
Message-ID: <CAKf6xpvCFyQOqzekw7hV++yMPBDRCZxTagMQ7Fvbq244RrR9CA@mail.gmail.com>
Subject: Re: [PATCH 1/3] x86: allow Kconfig control over psABI level
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 12, 2023 at 8:34=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wro=
te:
>
> Newer hardware offers more efficient and/or flexible and/or capable
> instructions, some of which we can make good use of in the hypervisor
> as well. Allow a basic way (no alternatives patching) of enabling their
> use. Of course this means that hypervisors thus built won't work
> anymore on older, less capable hardware.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Jason Andryuk <jandryuk@gmail.com>

With two comments.

> ---
> TBD: Should we, just like for NX, add an early check in assembly code,
>      to have a "clean" failure rather than a random crash?

That is less confusing than a random crash.

> Whereas the baseline -> v2 step isn't much of a difference (we'll gain
> more there by a subsequent patch), v2 -> v3, while presumably (or shall
> I say hopefully) faster, yields an overall growth of .text size by (in
> my build) about 2k. The primary reason for this appear to be conversions
> of SHL-by-immediate to SHLX.
>
> --- a/xen/arch/x86/Kconfig
> +++ b/xen/arch/x86/Kconfig
> @@ -118,6 +118,36 @@ config HVM
>
>           If unsure, say Y.
>
> +choice
> +       prompt "base psABI level"
> +       default X86_64_BASELINE
> +       help
> +         The psABI defines 4 levels of ISA extension sets as a coarse gr=
anular
> +         way of identifying advanced functionality that would be uniform=
ly
> +         available in respectively newer hardware.  While v4 is not real=
ly of
> +         interest for Xen, the others can be selected here, making the
> +         resulting Xen no longer work on older hardware.  This option wo=
n't
> +         have any effect if the toolchain doesn't support the distinctio=
n.
> +
> +         If unsure, stick to the default.
> +
> +config X86_64_BASELINE
> +       bool "baseline"
> +
> +config X86_64_V2
> +       bool "v2"
> +       help
> +         This enables POPCNT and CX16, besides other extensions which ar=
e of
> +         no interest here.
> +
> +config X86_64_V3
> +       bool "v3"
> +       help
> +         This enables BMI, BMI2, LZCNT, and MOVBE, besides other extensi=
ons
> +         which are of no interest here.

Would it make sense to try and specify models?  According to this:
https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels

x86-64-v2
(circa 2009: Nehalem and Jaguar)
Atom Silvermont (2013)
VIA Nano and Eden "C" (2015)

x86-64-v3
(circa 2015: Haswell and Excavator)
Atom Gracemont (2021)

Regards,
Jason


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 12:31:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 12:31:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564501.881958 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLNNY-00070m-FG; Mon, 17 Jul 2023 12:31:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564501.881958; Mon, 17 Jul 2023 12:31:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLNNY-00070f-Ab; Mon, 17 Jul 2023 12:31:04 +0000
Received: by outflank-mailman (input) for mailman id 564501;
 Mon, 17 Jul 2023 12:31:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=HNI8=DD=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qLNNX-00070Z-Hr
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 12:31:03 +0000
Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com
 [2a00:1450:4864:20::52b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cab87ca8-249d-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 14:31:02 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-51e5da802afso6372510a12.3
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 05:31:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cab87ca8-249d-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689597062; x=1692189062;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=qR1QziKbFpEjM+LGQZgiDvw+B/UR2SRtOhz1++3Ej6w=;
        b=fzkKF8TWGTmxtEjEiy5DrtKHON5Lcz2ZwHOJK2rahBTIDCE+jm8iZ//xFNKolAa01Z
         yxkJLUpwXQEC+smz8sHruWUczhUGM89MC/K5HaTogE9LoUTZuL+QNMFHqlGLtfyNLG7v
         22qsTe6vL7VjCdU/+s+R3gGCO+nZD6t8dZkKh2xWLaTOL/aMm3SrYlshWLp0y+aUlXMd
         h8nmVp3GmNMUcNJZf5TF63i/jwzsUQ3fnZIiinqU1/iuSXq/0tAE7IfPtTZYtZbtZ7mY
         in7wsqPE1/Qg1iwVyXmR1MnKUIfQlW5jSg/rigIUXRBo9MxPEBSLLOKCH3I4mNRYD9kh
         62Ng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689597062; x=1692189062;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=qR1QziKbFpEjM+LGQZgiDvw+B/UR2SRtOhz1++3Ej6w=;
        b=CcefBDWPI7ZEannsOdvPbcbua0JYMwRzkdGb7lY1xz3jfCi+m+rtm800/ZBJCrxU6A
         jDDCtjSTZE50gyOdeBRspeSxMVXZ+W6WrjANaBJkf/AEC5l/lCZFP+NsNzhsM88p5jXh
         /ALqKkv7t34wRxJHcdV3MVZpMc3Yw8jEO0zYK5EIv3FB03xzxPpyTWuP+U4fT5jjo3eV
         sOlkpz7dWuwu47cDVp4XwWSyZSl8nCrsv20aOoaCa9scevV0Tu8dJITJNOFH5IqZuUAt
         YAIFqGz6ZslGZzIB6AMftKaeyp0TsqNairh59dvxVb/QnBWLRQaHuT9WcOXxIr9Z8oPp
         NSFA==
X-Gm-Message-State: ABy/qLbFOYuYGUwEgVJo6dMZb8VbQRGEWzGu/EP782Maef3ZOg3JlHBU
	5wSDj3WFSbdvVqKPXLicFmLDBH28AIpBVjNGG0Q=
X-Google-Smtp-Source: APBJJlEYKk1kRRIw21N0g98D8UDcIeb42QmbZjlZEdIyhh71z8HOttLhmJwix2yBf1zRsFnvzvVoBPR+/bEovTKalCI=
X-Received: by 2002:a50:ed8e:0:b0:51d:d280:6c51 with SMTP id
 h14-20020a50ed8e000000b0051dd2806c51mr12440673edr.1.1689597061973; Mon, 17
 Jul 2023 05:31:01 -0700 (PDT)
MIME-Version: 1.0
References: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com> <3e1cea22-dde5-c723-5ebb-78a54b128b56@suse.com>
In-Reply-To: <3e1cea22-dde5-c723-5ebb-78a54b128b56@suse.com>
From: Jason Andryuk <jandryuk@gmail.com>
Date: Mon, 17 Jul 2023 08:30:50 -0400
Message-ID: <CAKf6xpsuQV_FEhH-Ni5S4LL=Zg1QE8zCSWGOR6iV_tmYhVq6Ng@mail.gmail.com>
Subject: Re: [PATCH 2/3] x86: use POPCNT for hweight<N>() when available
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 12, 2023 at 8:34=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wro=
te:
>
> This is faster than using the software implementation, and the insn is
> available on all half-way recent hardware. Use the respective compiler
> builtins when available.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Jason Andryuk <jandryuk@gmail.com>


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 12:36:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 12:36:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564505.881967 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLNSO-0007cG-0q; Mon, 17 Jul 2023 12:36:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564505.881967; Mon, 17 Jul 2023 12:36:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLNSN-0007c9-Tz; Mon, 17 Jul 2023 12:36:03 +0000
Received: by outflank-mailman (input) for mailman id 564505;
 Mon, 17 Jul 2023 12:36:02 +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
 <SRS0=HNI8=DD=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qLNSM-0007c3-SZ
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 12:36:02 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7c85b206-249e-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 14:36:00 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-51e28cac164so11738325a12.1
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 05:36:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7c85b206-249e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689597360; x=1692189360;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=ZOI5v/53cNhHYZBOmxy8qgfrDHV0aa7/dZv/ZdGpk+Q=;
        b=ohYjSNWMNOTH0RPWqR1uPI95zBfWAsLNxbqiQdBo3wy1R+ZGoNz7nznglFNyeElsXd
         xIX3xn5KIWJ8O8PnOMFS/Rk/3gaULq93ZU8f2HNvcyCBT8TYLO8PPa2HMob91mGNTk/S
         6k2XniZrMWw1G5XkN06EBiyjB0sfnmru+0TVYYuIVkLRLaxPMLkVK/sFoTutk3G2owtA
         bSp+z2VUZfySbXn4xgSwY9l9fDCnSfqtJcQYHiui1745+WkrEx7Yyw6fjcYT3bbq2vha
         yhovZFKGVV/j7ebAWSDlD7dOrLHpouYSf4f0GlDmg/RMSwHf4dTAttEzjCt2jBDDtJyN
         uHGQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689597360; x=1692189360;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=ZOI5v/53cNhHYZBOmxy8qgfrDHV0aa7/dZv/ZdGpk+Q=;
        b=EtgcDBzqlUrUUfFdrmZRRLFo04uyEuwnjqScvBuzk9pU1e92Av8/yR6msgD6MXyrAB
         7dAQCHuWpmrb3oOuMOvJZuJFDMqP2rGhzoJY6ouMpvvItQpljbPaH8lVCGYWSWGbXMc0
         wIs8rHId6sljdfrn+a2cpjTXk53zgnwlZ3qizfRITlYjeuhZX4y9FneKBUo7rLY2G16m
         kygCLZjEgTxBtdZCfA+P5IUh8G38PNqbnYY/SxSt0elx/mXRK5kjw2NnYJZ/hJOiu0N1
         EVIyNbJjKR8lKLNp5l94pgNzBIEBqH3vOocgRek0FaP4JHXmkUbTtU7d4dvQ9EHr/C94
         QLcw==
X-Gm-Message-State: ABy/qLZnW9P8+WWNJleFRIK61S6h0xas4sSbYy3M+y9xvpIPjDWQBEhl
	vQAY259eZEpCUjgZLJdeFOvzaqKGdmwXIWeExcc=
X-Google-Smtp-Source: APBJJlHC58R/28FJeEayiRoRyEXLFlYmLLCrwYyY8EzIesA2R1pZxo/n444JXocjGWVCONeyRepIkpoiNDMxWn7Vp/o=
X-Received: by 2002:a05:6402:27c9:b0:51e:5898:a23d with SMTP id
 c9-20020a05640227c900b0051e5898a23dmr11478322ede.5.1689597360225; Mon, 17 Jul
 2023 05:36:00 -0700 (PDT)
MIME-Version: 1.0
References: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com> <60e79cc5-ad07-81e9-e7e6-f97a73a4df62@suse.com>
In-Reply-To: <60e79cc5-ad07-81e9-e7e6-f97a73a4df62@suse.com>
From: Jason Andryuk <jandryuk@gmail.com>
Date: Mon, 17 Jul 2023 08:35:48 -0400
Message-ID: <CAKf6xpt9RTA7sef_QBM=y2gcZURcGzCpU9itUwCD5EPDTtukqA@mail.gmail.com>
Subject: Re: [PATCH 3/3] x86: short-circuit certain cpu_has_* when
 x86-64-v{2,3} are in effect
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 12, 2023 at 8:36=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wro=
te:
>
> Certain fallback code can be made subject to DCE this way. Note that
> CX16 has no compiler provided manifest constant, so CONFIG_* are used
> there instead. Note also that we don't have cpu_has_movbe nor
> cpu_has_lzcnt (aka cpu_has_abm).
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Jason Andryuk <jandryuk@gmail.com>

One thought below.

> ---
> Of course we could use IS_ENABLED(CONFIG_X86_64_V<n>) everywhere, but as
> CX16 shows this isn't necessarily better than the #if/#else approach
> based on compiler-provided manifest constants. While not really intended
> to be used that way, it looks as if we could also use
> IS_ENABLED(__POPCNT__) and alike.
>
> We could go further and also short-circuit SSE*, AVX and alike, which we
> don't use outside of the emulator.
>
> --- a/xen/arch/x86/include/asm/cpufeature.h
> +++ b/xen/arch/x86/include/asm/cpufeature.h
> @@ -76,13 +76,19 @@ static inline bool boot_cpu_has(unsigned
>  #define cpu_has_eist            boot_cpu_has(X86_FEATURE_EIST)
>  #define cpu_has_ssse3           boot_cpu_has(X86_FEATURE_SSSE3)
>  #define cpu_has_fma             boot_cpu_has(X86_FEATURE_FMA)
> -#define cpu_has_cx16            boot_cpu_has(X86_FEATURE_CX16)
> +#define cpu_has_cx16            (IS_ENABLED(CONFIG_X86_64_V2) || \
> +                                 IS_ENABLED(CONFIG_X86_64_V3) || \
> +                                 boot_cpu_has(X86_FEATURE_CX16))

If you think there may be more ABI selections in the future, it might
be better to express the "V$N" numerically and check >=3D 2.  Or you can
add a Kconfig CONFIG_X86_64_CX16 and select that as appropriate.  But
if there aren't going to be more of these, then this is fine.

Regards,
Jason


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 12:43:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 12:43:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564513.881977 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLNZK-0000mH-U2; Mon, 17 Jul 2023 12:43:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564513.881977; Mon, 17 Jul 2023 12:43:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLNZK-0000mA-Ps; Mon, 17 Jul 2023 12:43:14 +0000
Received: by outflank-mailman (input) for mailman id 564513;
 Mon, 17 Jul 2023 12:43:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLNZJ-0000lc-EJ
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 12:43:13 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2055.outbound.protection.outlook.com [40.107.13.55])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7dca2683-249f-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 14:43:12 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB8380.eurprd04.prod.outlook.com (2603:10a6:10:243::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 12:42:43 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 12:42:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7dca2683-249f-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KpKPbqWv5RagIKH/xBOLGGFi1Q8k21PUukeyW63kJfW1JmTghDke0tqzbuZpC2CJQOQhUSqPOEOSbcv+VqcJJWKsW4iFlJTv7hl8xr2RqQ5236Xrdctd9ufcO8L4PloOTuN2/oB2m9GR/BQXQQ6CRxgELsNMUIlG0Is3TME6NDQfnhR2aTZAfsbt5TyMjUwuv2Pi816AH+YrTSqUgCBPwQyZ3PwSrmFFYvLHav3ZNRfeBD2ce0J5DaWrMrW6Y7a97VcBnQWkJsl3oPnhNMvLTxH18oBgn2Wv+7jrMUpaPASSWIo7ijKwWcjvoZTkpDedf4JhkBadHAvhv2k8rQvfFw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MQzy9L28lTIyH174AXLHeWgoOFrApuF0WR5Lp+a/hmM=;
 b=PkEiehIJNGIRkttDLlG8Lh7gC7byn4y/fEXzuKPYGj230YARSFNJh6CEd5hnBc3O622Bs0SlDxYK3hJlMmZRxC2ms/zhUYcz418iYujR2DnhtCbdId9amQpurKAzy3/DCptJcWFXwLciqVdJkw3zyC71YcDFy2j/DEnr9OaZYlUovJuNJKQ54yWnMwiP4pjFxFRnF6mByWmYKsA7Ji6QwVre92gUoeVWqSvLugSL/EFQv2ALAD4MFVJ8kcYHSdzoWVatqHFeykMNNCp6t/0X88L0dnewc6Y9ii3CujACeTeXkGOeWRXmsyaNvMd7WjW3/zisyYz/lsqUu/qNbiDoFw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MQzy9L28lTIyH174AXLHeWgoOFrApuF0WR5Lp+a/hmM=;
 b=XwArCfFFRAxuyjmrigtHVYwoLJfxXbpDlkOe1SY07R4k5LUu2CDQL3CPGi2+GgTMfP7zmV2ZG8pB8XmsjSKkh8AKkENIRjxeYYZ/yVH4hL4av17a8iehtXptwUKi/DHFzx0aL2Xw5BQ2CAI1fULZFtnkxFhy9c15sqXdbMXyue0uXhcmz77S0rKmIwPXvaNrydtZuEAXzbgViGE0LG5bsBpnutImv4IeJYlX31gXETBrXtVJvvbUOAbJQ3QD1uXvzED3g1iqOniRlTAwrmylWMdq1ABvuaq+OTvtxq89zaJASsMxVFIyOEdW/9baCnVOSH5nYu/EHLRoPcOo7Ta0rA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <747d6fc3-f20e-924d-5eab-5c387ffe439e@suse.com>
Date: Mon, 17 Jul 2023 14:42:41 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: Violations of mandatory MISRA C:2012 Rule 19.1 in X86_64 build
Content-Language: en-US
To: Roberto Bagnara <roberto.bagnara@bugseng.com>
References: <fa2bc5da-b866-05ac-409f-c26e025428c3@bugseng.com>
Cc: xen-devel@lists.xenproject.org
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <fa2bc5da-b866-05ac-409f-c26e025428c3@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0068.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4b::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB8380:EE_
X-MS-Office365-Filtering-Correlation-Id: edfb141d-73fa-4672-15e1-08db86c35086
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	acDZBdUYN4zxQSGlsfyoX1U/p2XUBQztU+tFC9XUFs0ih7yhy3eL5P1Z95D+cYY9XsXBrBlvxHFEvfqUI0yf8SYuZonktZs1jfRcS+xURT1wvekAIWkczsuvmBDbb2vKK4UsEtGxSgoWZg50mVhM/IDbjEuI1AIKqoP3uS/r85prOHmtBtscpbCyrxIl6oRRbx5cZuBchUKITzp0OR+qRkim2xwsLnndYYtzbNHwL45ewVbA7AicX3e9cYp+9XAapUfUHdjj7K4wSLM5pafSoRWHUfaa3Pg9aznWj186OHzDVe3ZVooCjFjrzyaX5oja+VLRrf1zpMWUU0HGWgJ9B5e00NCSqibvoca9lClSx60vWdI6jVRKtpiXjntwYXuSBffv08AHsOt6DBtlv0SO2atf6o/8jJyWq6u6v1cAOd+XpLVu7GN0q2knIg8hER9RvGdwleekBtcZRNWs6hXk7Yt3jFY7vV8jNGX4oJDw28hWDwYXONX8vHxQHs/zZn22LltHNwPRWMEJUnxLatawJUnp+IaJ2CnAQMdpYozFSzlOXcd67U7rGyXWFw2Q8B5JkwMi6yX76tsMBUgJp3VyE1o7OahD0Ao5T0iQ7w2sSBPsHCmdISCsx+jhn9hFit3VxJOWSD2eUuJXxtH37A9nIw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(396003)(136003)(39860400002)(346002)(451199021)(38100700002)(6486002)(478600001)(41300700001)(5660300002)(8676002)(8936002)(66946007)(66476007)(6916009)(66556008)(316002)(4326008)(2616005)(83380400001)(186003)(6512007)(966005)(53546011)(6506007)(26005)(86362001)(31696002)(36756003)(2906002)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RSs5QjJRc2JNbmcrczhoUXFPZUpJb2UvcVJvWjVxcmhHR2VqanRMMWpzZDkr?=
 =?utf-8?B?TGp5QzJBbytCczlsN1l2QWJGU1QzNUR3bTdaOFM2VjUvNlRHVDNvRkJHMDVP?=
 =?utf-8?B?S0pCU3BOaWZHSC9iR3dqdW4rUVBDZ3hBRnR6U3JQMkNYTEVqV3pzZ2wrZmhu?=
 =?utf-8?B?SWZ5N3laek5EcDlhbEUrUnJHNFRJUnQwWU5PT1VzTWRJZlA1NTRIbUFhSHlY?=
 =?utf-8?B?UFhicEdhMGJXclZCMVVtZkxvNGltSTE5VDBZTDZkWUVaTzE2MkQvWUxiS3hJ?=
 =?utf-8?B?ZHJtQVlKeHlUek8vQm9ESkllOEFMbnJ2WldOV0pnSXNSWWsvY01ZV0drd3Bt?=
 =?utf-8?B?ak1lVThiRGk1NlVaTDRzSTNaNU9taGpRZThBT1Exd29IYUV5eURjTk9JemVp?=
 =?utf-8?B?WVFHUG1IU3FLblk5eUdzRmo5d1RlN2pzU1dyTldoTVJXclpuNDVnbTNuMUh3?=
 =?utf-8?B?TFVaVUdtZ0d6OXRKenh2dzlDeFVRdEt3dWxvQTdSMjZ3UzRRRlRYc2ozbEFw?=
 =?utf-8?B?Y0NtdEtocWZ5cG1kS3pkMUh4Z2x6S045Y04yaFZyT2s1VlA5c3pQY2tRTUdC?=
 =?utf-8?B?UldxN3NBLzVmaGg1cHlJSG5IZzJTbUwrZDRYVVNyRWFMZ0YzbHhHVEVQT1Iv?=
 =?utf-8?B?SFdvWFpnMEdSbkgwRmMyVll5OGw5bE5zOEFLWFJQZmJnby9i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utf-8?B?MEE5Z2VuR3FTa0ljWHV3MklEbU9hdzJENUEra0FKMEhiT0N6NWpmaGJvVC9C?=
 =?utf-8?B?eXpoZFRkdUFaRTBseDU1ZGh6Z2ZaVDNWNldXSklVRjlMRkxJMzFJNzI3NWFI?=
 =?utf-8?B?VFBjbHhTMHRUeGk3K050SjlENWl5WDBZaXRNMWFab3hGeDNCcm1SOW9NUmJK?=
 =?utf-8?B?RCswbXJpUU1odGppTzRBMy93YVp1dldVOEpkaXFNUkxYcDVGUFZuTmU1b21w?=
 =?utf-8?B?VmRUdHh1RE9FSFhYS0QxWXlud0lXNTgxamtXb0ptQWZ6cFBkUVUzMGxIc0xC?=
 =?utf-8?B?TnVYTS9LUGZpYTlvdXh3VnVYZnRuQnFZSC9TdlRpcGdJaFhRQ0hKVEY5L2ta?=
 =?utf-8?B?eWh5OUM0NUJ5ZGdiZjFtb3lhRnNBWDdYeUk0UWJPYTkwdHV2WGhVaVFaS0t2?=
 =?utf-8?B?UjRNakwvajZXTGlhYXl5UisrdkVKVE00cUhGUTd5NHYvMGhaNEc5WGpyeFMw?=
 =?utf-8?B?QjNINzJEaXo0SGYvVS9senVCYXhnWHFjR3U5YStXZDQ0bmNZR3p5SERSZEJz?=
 =?utf-8?Q?kJX/ozt+sb9IhVlwAu/bF/n47?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: edfb141d-73fa-4672-15e1-08db86c35086
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 12:42:43.2933
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 7CiB18TBD1rtaUcbEIwwwHDWSLj8LIls6bVy41U2gg8yW8bxMo/UwoDUFxB7OlMhuJsoxFG0gLDKyOH/5mzVJg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8380

On 11.07.2023 18:40, Roberto Bagnara wrote:
> Mandatory Rule 19.1 (An object shall not be assigned or copied to an
> overlapping object) is directly targeted at two undefined behaviors,
> one of which is the subject of 6.5.16.1p3, namely:
> 
>    If the value being stored in an object is read from another object
>    that overlaps in any way the storage of the first object, then the
>    overlap shall be exact and the two objects shall have qualified or
>    unqualified versions of a compatible type; otherwise, the behavior
>    is undefined.
> 
> You can see a number of definite violations in the X86_64 build
> at this link:
> 
>    https://saas.eclairit.com:3787/fs/var/local/eclair/XEN.ecdf/ECLAIR_normal/origin/staging/X86_64-Set1/149/PROJECT.ecd;/by_service/MC3R1.R19.1.html

After having agreed among the x86 maintainers to switch to using casts
there, I tried to access this list again, just to find that now I'm
getting back "Cannot open database". I know you said this would go
away after a couple of weeks, but it's less than one wee that has
passed. I'll try to go from memory when making the patch, but of
course I may miss instances ...

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 12:48:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 12:48:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564518.881986 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLNe4-0001PI-F5; Mon, 17 Jul 2023 12:48:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564518.881986; Mon, 17 Jul 2023 12:48:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLNe4-0001PB-Bl; Mon, 17 Jul 2023 12:48:08 +0000
Received: by outflank-mailman (input) for mailman id 564518;
 Mon, 17 Jul 2023 12:48:07 +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
 <SRS0=RVQe=DD=citrix.com=prvs=555fa4c0e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qLNe3-0001Oj-0G
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 12:48:07 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2a5c6e98-24a0-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 14:48:04 +0200 (CEST)
Received: from mail-mw2nam10lp2107.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.107])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 17 Jul 2023 08:48:00 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB5567.namprd03.prod.outlook.com (2603:10b6:a03:28d::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.28; Mon, 17 Jul
 2023 12:47:55 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 12:47:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2a5c6e98-24a0-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689598084;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=/1zRujvZB+xvZ7jM7A2XS7RXrolrp3u9+0+1/MrUd9E=;
  b=NItKFKx/1xgRMWKnAVHYK03vtt5Oq15SZKEeW6tQ+a7O4hdBfgHnh9Do
   kEf0OMNuNppLxiU1hu17uCtf0o25c1dyfQEgxqLqIU2tQtsOOZAAyBGzg
   A09eoqpI2hGnLv4EVYPswO0C8Hb8CPLiWi4WuKKTbj9znKbavxbRnQC6e
   E=;
X-IronPort-RemoteIP: 104.47.55.107
X-IronPort-MID: 116473852
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:WQOb4qAjB+T7UBVW/9viw5YqxClBgxIJ4kV8jS/XYbTApGkqhjVWy
 mdJDGmCPaqPZzbwc9l1Oti29ktT68KGyoc2QQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h
 yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs
 t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GxB4QRnDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS
 uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada
 jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIwuedKDUQe7
 fgjETEGTxGyq9q65K+Xc7w57igjBJGD0II3nFhFlGmcKMl8BJfJTuPN+MNS2yo2ioZWB/HCa
 sEFaD1pKhPdfxlIPVRRA5U79AuqriCnL3sE9xTI+Oxuuze7IA9ZidABNPLPfdOHX4NNl1uwr
 WPa5WXpRBodMbRzzBLcqyzw2bSfwHmTtIQ6EuO46P16jFmv32lMIhsvf3yKqt7isxvrMz5YA
 wlOksY0loAw/kG2Stj2XzWjvWWJ+BUbXrJ4A+A8rQ2A1KfQywKYHXQfCC5MbsQ8s807TiBs0
 UWG9/v2ARR/vbvTTmiSnp+PrDa1PyVTJ2YGYSYeTA0t6cTsu4w1gVTESdMLOKG0h9vxBDr5h
 TSXtCEkhrMSpcQW2L62+1+BiDWpzrDSVRI87AjTWmOj7yt6aZSjaoju7kLUhcusN66cR1iF+
 X0bwc6X6blWCYnXzXTSBuIQALuu+vCJdiXGhkJiFIUg8DLr/GO/eYdX43d1I0IB3ts4RAIFq
 XT74Wt5jKK/9lPzBUOrS+pd0/gX8JU=
IronPort-HdrOrdr: A9a23:cSr54aokiHNiBdfQ5hk8oGoaV5oweYIsimQD101hICG9Ffbo9f
 xG/c5rtiMc5wx6ZJhNo7290ey7L080lqQU3WByB9iftWDd0QPCEGgI1+rfKlPbdxHDyg==
X-Talos-CUID: 9a23:QahvqWPpIsSc/e5DGyha+GtEAsQeS3zW7XbhD3e0LXtFcejA
X-Talos-MUID: 9a23:yoFUQAUz+1gJPo7q/DmyhC9hJMts372rV2oLqL8hisKjbhUlbg==
X-IronPort-AV: E=Sophos;i="6.01,211,1684814400"; 
   d="scan'208";a="116473852"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=f50m+bAsX4B+zQeKMSdBczgynViXKZDXKzFBK+1xGxltFc7JdUBBCnO4i0UaMM5JQ/AK0RJSduSKzV45hV2niDmaHU9BLflxVofrG2USxp9vQHhzb7YaRFuFo07W4b83BLmEmv0Fan8rnLqAwCPEEOJES6IdrVjIC695bnwwO8MQRX0+6phVom3GbhSAQYh5FuCLEXBdtBqG6flS/ras2RsS22zO/yVr2vml3C4OtNGQWXAyfNhACEsWRJHq2CqNPVIuSjeiDzmAXksO1I9bpj64P1RTCEOZPbZHGFhcl5pbEyuGwKypGcJXpKJhhi7I7TsDhtZIPPXLMC6bJrDPcg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ozRtPdw8dBfKo/xT+r1wXFtk9WR06Jl6ff4YMjmpPnk=;
 b=EX5XAsYXbkQghTh0ftWfWqMKA230NAF5CMm0syfBRlFq+KAR0k2PNe67Wy9iHx61U2lp9PxHL2NEvVWnR2aodhyzqcV1PM1lDYIAsODEnMrxhxUnztE9aAsGJ0gL2b8/NUdDAsQDrD+w5+yfVjJxURH4HxC3VI6VSgDYwUSLx1wMYxfDb4dwLUUIayWmJURZo84tq/LBM2/MiTn3vpxnNckOE3Ow+8lEvfQeR1gG5Qedfj1wu2pZlAvfhWhHAD0lM7B3Fol3XeKYGwSguNHZ3OYDPwzDwqa0T4ZKa7EzWem5x8XzwYWtq7uZ7MRUunoJhdsVM49g1/cGj7GFVPo/Sw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ozRtPdw8dBfKo/xT+r1wXFtk9WR06Jl6ff4YMjmpPnk=;
 b=K46DQbJMbVZJLxqk2CwEVHyEah/xMR3XGJiWJ8J3e82ZlDeS5b1ZTxrRyKVnlJynSjxQUCui0uI7gpIqTuam9/YPjQR2qKDYZ5sz37PeXE6KanKRjft+g3+wH4okO36i3+VXICmuVDVTAk+b3poEYGH1ipZm+JmLLCio1fBMdS8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Mon, 17 Jul 2023 14:47:49 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH] x86/HVM: adjust pIRQ calculation in hvm_inject_msi()
Message-ID: <ZLU4deYP4lwVYpFs@MacBook-Air-de-Roger.local>
References: <5cfda162-07a3-8a02-4511-b0578b12dbc2@suse.com>
 <ZLUdTB_gZjRzhpJe@MacBook-Air-de-Roger.local>
 <f254729d-1b6c-8aaf-98d5-c1b739519081@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <f254729d-1b6c-8aaf-98d5-c1b739519081@suse.com>
X-ClientProxiedBy: LO3P123CA0014.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:ba::19) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5567:EE_
X-MS-Office365-Filtering-Correlation-Id: 01cb404d-0033-4a4e-701a-08db86c40aa3
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	YDME9epreLVZ2RrM+DQAstG4kNYaOwFM+QyJbtfaN/AGnGC0AwdPfAuaEwXpnx4KOm0DPBQfIj5ZemXSVidVQxQfDJsjVUstempRbBTfUzDWlQIDh2Yt2C2uTx0YkYZR6xarrgtjb5AYqMi6zvb6hu8p7Z5eGbz/FGtBwhYaac+UOpNAM3lQcNe0hTtmaYlCub0ZRewtm+ab4l8x9Iy4MHyQfcuLAPADug57IoxGDpuvIjh4wquld4kS/Dx7/MnQPgiKrvcInTbGKDLISWP/3MUeIe3TieFT1mzcvFhzyps9eWOaGVzx/ketM+WeukNIZ9/uZZtu06KDIiMl9+p37opzOMDGbA7VrvS7G+EtFCVQe/MGCbbK9f55cW+aLvz0+x1SRRF3gwLL5a17975KMqmwdflis+gIQyMYyZFGbTax2wN/S1WMEf2orI4JEiRDXiKYF9LJqDKGT8sWEEyNX+InzT6K5a626L2nWW2hwdip/3GMH2Zz5nAgQM5COqG1JHrBgl2R9SVjwl93Mf1LhC4s5HFf9ACm4hceI4gQ7W+qua4TdqHn7qqAG9y8VOGn
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(366004)(376002)(39860400002)(396003)(451199021)(82960400001)(6666004)(478600001)(83380400001)(186003)(26005)(6506007)(53546011)(6512007)(9686003)(6916009)(8676002)(4326008)(41300700001)(2906002)(316002)(5660300002)(6486002)(86362001)(8936002)(54906003)(66946007)(85182001)(38100700002)(66556008)(66476007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RW5qaFk5NnNuTmNJbWozYmd2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rePHMzXg8lhiUSehtZIzQRhMX30dh89BIZffpYrNvppPXXvR4ruiwXP8HzJNWcK66YIPODz2ZXlpcnurpzZohPfnJuwMBVhg8qCmGX6nvZIF7VwWJHZJEsVWiuacc4q4lCoDNzTTuYVdCGMup5Pp9cXMfsf5szc9FP5mJ7nmybyHiXY7UiV/81Q6uRw4h9Q8vygAT7MD37eeHfJ0kb9co/Uqx/GakVgBlqkJcSO3VARMag8JQawoByzfu3nsxYr2o0nKx2kWR/ahFS/kQq7KeaH0hNXfn//QjHCrxb36lQnIZh7UMz6J7O7ZN9YOM/Kp1sPskbmTED+Ucdc6F/7U61BY0XODwYTDDh4UDyy89pZISdurHAqLIllrb7EtFJaNCyHm8rxsWl5E5UwYmZQySr8mT1OiEC8w4fwLNily9
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 01cb404d-0033-4a4e-701a-08db86c40aa3
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 12:47:55.6420
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 1uLZ7udzsJ0enZ/384Bg7akCQl4ylerR0dwfZELGRyL7XJgxXn49+xRsb379BbxO3aNNPAxECM4cgZSG6PidXA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5567

On Mon, Jul 17, 2023 at 01:49:43PM +0200, Jan Beulich wrote:
> On 17.07.2023 12:51, Roger Pau MonnÃ© wrote:
> > On Mon, Jul 17, 2023 at 11:31:57AM +0200, Jan Beulich wrote:
> >> While the referenced commit came without any update to the public header
> >> (which doesn't clarify how the upper address bits are used), the
> >> intention looks to have been that bits 12..19 and 40..63 form the pIRQ.
> >> Negative values simply make no sense, and pirq_info() also generally
> >> wants invoking with an unsigned (and not just positive) value.
> >>
> >> Since the line was pointed out by Eclair, address Misra rule 7.2 at the
> >> same time, by adding the missing U suffix.
> >>
> >> Fixes: 88fccdd11ca0 ("xen: event channel remapping for emulated MSIs")
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> > 
> > Acked-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> 
> Thanks.
> 
> > I have a question below, but not related to the change here.
> > 
> >>
> >> --- a/xen/arch/x86/hvm/irq.c
> >> +++ b/xen/arch/x86/hvm/irq.c
> >> @@ -383,7 +383,7 @@ int hvm_inject_msi(struct domain *d, uin
> >>  
> >>      if ( !vector )
> >>      {
> >> -        int pirq = ((addr >> 32) & 0xffffff00) | dest;
> >> +        unsigned int pirq = ((addr >> 32) & 0xffffff00U) | dest;
> >>  
> >>          if ( pirq > 0 )
> > 
> > I do wonder whether this check is also accurate, as pIRQ 0 could be a
> > valid value.  Should it instead use INVALID_PIRQ?
> 
> I think 0 is okay to use here, as the low IRQs (at least the 16 ISA
> ones) are all 1:1 mapped to their "machine" (i.e. Xen's) IRQ numbers.
> And IRQ0 is always the timer, never given to guests (not even to
> Dom0).

I'm kind of confused by this not being dom0, but rather an
HVM guest, so pIRQ 0 of that HVM guest should be available to the
guest itself?

IOW: the possible values here should be the full pIRQ range, as there
are never Xen owned pIRQs in the context of an HVM guest.  One further
limitation is that even in that case pIRQs for (guest) GSIs would
still be identity mapped, so GSI 0 won't be a suitable pIRQ for an MSI
source.

The usage of pIRQs here even for emulated devices makes me very
confused.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 12:52:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 12:52:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564522.881996 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLNhw-0002s3-Um; Mon, 17 Jul 2023 12:52:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564522.881996; Mon, 17 Jul 2023 12:52:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLNhw-0002rw-SB; Mon, 17 Jul 2023 12:52:08 +0000
Received: by outflank-mailman (input) for mailman id 564522;
 Mon, 17 Jul 2023 12:52:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=LRey=DD=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qLNhv-0002ra-Gq
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 12:52:07 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bbdcb5a6-24a0-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 14:52:06 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.163.206.54])
 by support.bugseng.com (Postfix) with ESMTPSA id 1925A4EE0739;
 Mon, 17 Jul 2023 14:52:04 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bbdcb5a6-24a0-11ee-b23a-6b7b168915f2
Message-ID: <60cc8da1-47ef-fc0b-d77d-a8a559a2dbd3@bugseng.com>
Date: Mon, 17 Jul 2023 14:51:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: Violations of mandatory MISRA C:2012 Rule 19.1 in X86_64 build
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>,
 Roberto Bagnara <roberto.bagnara@bugseng.com>
Cc: xen-devel@lists.xenproject.org
References: <fa2bc5da-b866-05ac-409f-c26e025428c3@bugseng.com>
 <747d6fc3-f20e-924d-5eab-5c387ffe439e@suse.com>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <747d6fc3-f20e-924d-5eab-5c387ffe439e@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 17/07/23 14:42, Jan Beulich wrote:
> On 11.07.2023 18:40, Roberto Bagnara wrote:
>> Mandatory Rule 19.1 (An object shall not be assigned or copied to an
>> overlapping object) is directly targeted at two undefined behaviors,
>> one of which is the subject of 6.5.16.1p3, namely:
>>
>>     If the value being stored in an object is read from another object
>>     that overlaps in any way the storage of the first object, then the
>>     overlap shall be exact and the two objects shall have qualified or
>>     unqualified versions of a compatible type; otherwise, the behavior
>>     is undefined.
>>
>> You can see a number of definite violations in the X86_64 build
>> at this link:
>>
>>     https://saas.eclairit.com:3787/fs/var/local/eclair/XEN.ecdf/ECLAIR_normal/origin/staging/X86_64-Set1/149/PROJECT.ecd;/by_service/MC3R1.R19.1.html
> 
> After having agreed among the x86 maintainers to switch to using casts
> there, I tried to access this list again, just to find that now I'm
> getting back "Cannot open database". I know you said this would go
> away after a couple of weeks, but it's less than one wee that has
> passed. I'll try to go from memory when making the patch, but of
> course I may miss instances ...
> 
> Jan
> 

I can generate a new database with just this rule, and we will 
definitely extend the period these artifacts will remain available.

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 13:10:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 13:10:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564531.882006 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLNz1-0004gY-Ck; Mon, 17 Jul 2023 13:09:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564531.882006; Mon, 17 Jul 2023 13:09:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLNz1-0004gR-9v; Mon, 17 Jul 2023 13:09:47 +0000
Received: by outflank-mailman (input) for mailman id 564531;
 Mon, 17 Jul 2023 13:09:46 +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
 <SRS0=lGkF=DD=invisiblethingslab.com=marmarek@srs-se1.protection.inumbo.net>)
 id 1qLNz0-0004gL-7X
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 13:09:46 +0000
Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com
 [66.111.4.28]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3178706a-24a3-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 15:09:43 +0200 (CEST)
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailout.nyi.internal (Postfix) with ESMTP id CF87F5C010E;
 Mon, 17 Jul 2023 09:09:41 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute6.internal (MEProxy); Mon, 17 Jul 2023 09:09:41 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 17 Jul 2023 09:09:40 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3178706a-24a3-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-transfer-encoding
	:content-type:content-type:date:date:from:from:in-reply-to
	:message-id:mime-version:reply-to:sender:subject:subject:to:to;
	 s=fm2; t=1689599381; x=1689685781; bh=mpvWE9oHvqFP1EWwyWR59TenP
	vomXtGlD9kPruGRJDg=; b=rhvxBv+vJyC8ed2GgfjP17wMDFN49H/rNiQWCOovn
	I68JFG+qlpsQ5huocJz5TQVROpP2RpdO6V8NidTYSiytv6LUsAIvUCZaC1UwoRnY
	aNXDQDxZZ9MB+Naml7X7lJkeXC9d2Be0wG+jAHx+j/6WFojD1yBktr+BEOkspuTp
	E+nWCgJZT2yOxTDgKt5SBT7yLEsdn5fnh8bU4BeB4EP7fhn83drzXqPcvCqw5//2
	IGD0Dq0g/8yDS0oQYnrlj8ZSooEc5OXMnHdJcoiLXkNubDt3x2UDyJAEih9KyYds
	ABhdwoc2CpSMEs5nRDUKT+e0KEntDhdQVfBe6Ikn3F6/Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-transfer-encoding
	:content-type:content-type:date:date:feedback-id:feedback-id
	:from:from:in-reply-to:message-id:mime-version:reply-to:sender
	:subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender
	:x-me-sender:x-sasl-enc; s=fm3; t=1689599381; x=1689685781; bh=m
	pvWE9oHvqFP1EWwyWR59TenPvomXtGlD9kPruGRJDg=; b=CYSZuv182dZCbBUC3
	ajeC5ZOBpx/fqS/dZk34alwR7qnDFTP3QG67nV/VikiSabcLg3cWzOHQ1uMpgjpT
	dVCE4iIWLS4X+PLS6qkpGBM5uYPyfd0h8jEQR5i97iVA5vAayzxbPmDTiBOvOlYp
	/kM/6kM8FWWfgwrS7LhQo/RBolkmtvAIa3ZFl4FUPtCyhEYVM+AKYWJStnhJmPqX
	ygxk8vw+aT8m66dHGhlVsIhoN2uNbx0NoDNL28ariZY6vCdnteT8MBVq7eQk2SdT
	LpGtbXOekfmMy5JWvYLGfznoSVmxZA5UyFdJ58qB53ph7NjwChjlx+/AMRZoGKwD
	OGkHw==
X-ME-Sender: <xms:lT21ZHSEW8i9Q0SDbpyddZeeA9ZhGDDjtz_XLzh5riWRtuwRYm1ENw>
    <xme:lT21ZIy53YK2ltSeLeniyy8i3tfCvelEGUhiytYqzceth6XabyGb43uTpP7pv4AP3
    KPZVMNdtG5nBw>
X-ME-Received: <xmr:lT21ZM0gjFlPhSyQPsen3ZckyXrBv-aiUHuRFteLzozbb2l3P992mxD1DfbPoCqy5N18oY2HvMz-yaNMwSHRCJnc1Fswq2yneI9QsKZ6OI7lMedJvC8->
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgedvgdeitdcutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpefhvfevufffkffogggtgfesthekredtredtjeenucfhrhhomhepofgrrhgvkhcu
    ofgrrhgtiiihkhhofihskhhiqdfikphrvggtkhhiuceomhgrrhhmrghrvghksehinhhvih
    hsihgslhgvthhhihhnghhslhgrsgdrtghomheqnecuggftrfgrthhtvghrnhepleekhfdu
    leetleelleetteevfeefteffkeetteejheelgfegkeelgeehhfdthedvnecuvehluhhsth
    gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehi
    nhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh
X-ME-Proxy: <xmx:lT21ZHCRAU4RjE5MA32CoZDyQf8dNXGlfUH3oCqaaEQ6Ty4Z0YU8aw>
    <xmx:lT21ZAhR2Q5vf34oQRsmtdUwu-WwYYM2XBQ8Z8qDtQKCE_EyOyHLVQ>
    <xmx:lT21ZLpMm7XkPvMLiLyjAj65Po1yOdu2med67YYNiGv-Wprz6W0FVA>
    <xmx:lT21ZMZaD7iudbpRXXlWUCt8vga4P2QespsGu8UAslF0GwIz-ti6Vg>
Feedback-ID: i1568416f:Fastmail
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: xen-devel@lists.xenproject.org
Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH] automation: avoid duplicated builds of staging branch
Date: Mon, 17 Jul 2023 15:09:14 +0200
Message-ID: <20230717130925.28183-1-marmarek@invisiblethingslab.com>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

"staging" branch is mirrored (automatically or manually) to several
repositories. Avoid building it several times to not waste runner
resources.

Signed-off-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
---
 .gitlab-ci.yml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c8bd7519d5fb..c3b05e32636b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,6 +2,12 @@ stages:
   - build
   - test
 
+workflow:
+  rules:
+    - if: '$CI_COMMIT_REF_NAME == "staging" && $CI_PROJECT_NAMESPACE != "xen-project"'
+      when: never
+    - when: always
+
 include:
   - 'automation/gitlab-ci/build.yaml'
   - 'automation/gitlab-ci/test.yaml'
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 13:14:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 13:14:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564539.882017 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLO3i-0006CI-26; Mon, 17 Jul 2023 13:14:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564539.882017; Mon, 17 Jul 2023 13:14:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLO3h-0006CB-Va; Mon, 17 Jul 2023 13:14:37 +0000
Received: by outflank-mailman (input) for mailman id 564539;
 Mon, 17 Jul 2023 13:14:36 +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
 <SRS0=FdAb=DD=citrix.com=prvs=555bb5b00=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qLO3g-0006C1-Br
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 13:14:36 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id de58f592-24a3-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 15:14:34 +0200 (CEST)
Received: from mail-mw2nam12lp2041.outbound.protection.outlook.com (HELO
 NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.41])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 17 Jul 2023 09:14:23 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by SA1PR03MB7056.namprd03.prod.outlook.com (2603:10b6:806:325::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 13:14:21 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780%5]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 13:14:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: de58f592-24a3-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689599674;
  h=message-id:date:subject:to:cc:references:from:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=+JoHWxd0mWPlrRMFBfbJ7K40eTzwMVUkMLMRWfSgvcE=;
  b=d+bua+7M2cqoKZfueaGIkfrtHgoNeZEmLOSjEAcwPg2wdlNE7+2zKbct
   l5FZo/MYMdxIdUJB6EXA6kN0KO62fJDB0q9wEYJ9H9WG73WWPQqjH0+in
   11nb44NNhbgCX5EVNldT6qu3qEkPwUpeWEr2ZrymfT2SmNMQYG3I0vbwA
   8=;
X-IronPort-RemoteIP: 104.47.66.41
X-IronPort-MID: 115753022
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:YWl2fqhLQI4E2Pw78fYRdGHyX161ihEKZh0ujC45NGQN5FlHY01je
 htvDW2PbKuONDT0Kdx3aY2y/UNVup6Bm9I3Sgtk/is0Figb9cadCdqndUqhZCn6wu8v7q5Ex
 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv
 cKai8DEMRqu1iUc3lg8sspvkzsx+qyr0N8klgZmP6sT4waBzyB94K83fsldEVOpGuG4IcbiL
 wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ
 OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+
 tRfFQACYhehvNuH66nkccRX1tYAcPL0adZ3VnFIlVk1DN4AaLWaGeDv2oUd2z09wMdTAfzZe
 swVLyJ1awjNaAFOPVFRD48imOCvhT/0dDgwRFC9/PJrpTSMilIvluS0WDbWUoXiqcF9t0CUv
 G/ZuU/+BQkXLoe3wjuZ6HO8wOTImEsXXapLTeDnq6Uy2gf7Kmo7Cj8mS0ThvNCFyQ23ed1AJ
 BEy5g4glP1nnKCsZpynN/Gim1aBtwQZUsBdEMU77h+M0ave5wuFBmkCQSVFYdZgv8gzLRQ62
 1nMk973CDhHtLyOVWnb5rqStSm1OyUeMSkFfyBsZQAM+dXkrak4hwjDSdslG6mw5vXuAi35y
 T2OqCk4hp0QgNQN2qH9+krI6xqnoZ3MTxIp6x/MdnKo6BtjY4yobJDu7kLUhcusN66cR1iF+
 X0bwc6X6blUCYnXzHDUBuIQALuu+vCJdiXGhkJiFIUg8DLr/GO/eYdX43d1I0IB3ts4RAIFq
 XT74Wt5jKK/9lPwBUOrS+pd0/gX8JU=
IronPort-HdrOrdr: A9a23:C4Rs66A8VEIhm6vlHemW55DYdb4zR+YMi2TDgXoBLiC9Ffbo9P
 xG/c566faasl0ssR0b8+xoW5PgfZq/z/FICNIqTNOftWDd0QOVxedZgLcKqAePJ8SRzIJgPQ
 gLSdkZNDVdZ2IK7/oTQWODYrMd/OU=
X-Talos-CUID: 9a23:40nvuWMWv84yF+5DHxRX+0ITOPscQ1bGk0z9GB+qKjpSV+jA
X-Talos-MUID: =?us-ascii?q?9a23=3A2NfGkQ5hg6Gq6Qk77CRMDFYcxoxqwZSwFxoQuKl?=
 =?us-ascii?q?F+MCmOjN/ZhGBqDqOF9o=3D?=
X-IronPort-AV: E=Sophos;i="6.01,211,1684814400"; 
   d="scan'208";a="115753022"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=W95i21I/YJYVwYdzhGzZpdfrDbvBImrdKFGpWeN1eH7371nQDkI+C2kBzbNms73rFkVilIMmL4DosFtd1nagB7X/Su15FZcs7Bw2ag+MCW0d0eHQh1hUoKdWCMLXiKLjeoReaQCFACnQN2GBZ4vgjzileVYz6DkFDzA6lsAMluDBoh7oKCbqEnSqSkDRrAnkzpLy74LqxmfVtVUBjLhEakzQcuxx8BVmFz6lobBDygrp78eTiLcTGJP4wCQRrjo3yz3dS7SoxAOmbS8Vy6vwb2FlWMFBX8BoWxD6d0twBFc8GLo6iEncSEKk0+295W8Z7awe3Dx/1hZ4sqnk/X4zeQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=xHZrwrJvMpH5U9bxsIskuSofd7Bh61t53/2vJsGvyWM=;
 b=adYmreCTzWjxay/fP2hVvHpXPhO8XGrD3R4QfI7B9c+znMeo8pojCJEaywEjW4Jk8LOhTz03/BClxFHZI34yePJDfme1LWwHneNP1uBV/uN8iNHItLTTB7FahsqqwWJ4v99pt8+ukyLWTn2vBAYwV7bjuJSnOTW9P9wTjtwazMBT9z87k2h4ovoPGhO6J/ho0GUzDhM+Z/0a1p8vUmn8K4d9JbcJC3pMIAfeVveZ2xZCEUtPooIQ6gwbsrof6TEobeFKFU00RQ2YPpgNDj/knFOxPBMRHVHhaZ33WI4xL5uyWE40fM3daGX7R7ZQ0QUl3STf4VHCwv7+yXS5kNN01A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=xHZrwrJvMpH5U9bxsIskuSofd7Bh61t53/2vJsGvyWM=;
 b=sxVs4bcQaDzBzcfC7oFuHgVKa7Ed5ybFyMP1OPXOzxqhyLSvzHWkP88xPxAedu1novni0QKMPZnKAxYYJMGf9QpilhYjUDCbsTkKK5O0VWuq0le4rY1UbTbEgUlT6babUtu0NI9eqpSkSkeF6fok91CkT2EaxGRqUAlvbUNwTxE=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <cf7ac648-dbef-80bb-986b-3fe0daef855a@citrix.com>
Date: Mon, 17 Jul 2023 14:14:14 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] automation: avoid duplicated builds of staging branch
Content-Language: en-GB
To: =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
Cc: Doug Goldstein <cardoe@cardoe.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "committers@xenproject.org" <committers@xenproject.org>
References: <20230717130925.28183-1-marmarek@invisiblethingslab.com>
From: Andrew Cooper <andrew.cooper3@citrix.com>
In-Reply-To: <20230717130925.28183-1-marmarek@invisiblethingslab.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0111.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:192::8) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|SA1PR03MB7056:EE_
X-MS-Office365-Filtering-Correlation-Id: 89a92c31-44df-456b-c48f-08db86c7bb97
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	yI+yEP3eijtWCVN+Pmxbhj1uXhxS+Ke53ZK8NKNAvIQtnyEIqQa6NNWpUO4ZZa/An0GzHLBLeuYRJlbCVw/q51cxVRWdlO51T/KGVG79Qq6sYEhcjoSdvlW8bn7D9mZgsAC3mDgobeL2TMDeTM5Y3mDM4QNKGiT2zcHqm2nx73d3uqOlvtXjj5Zjmkt1G8fLnmFiGF3dCC+DMti4Pn2JJrf18NqOd0no72+lqNBad7bwhTh9QZsDIdDMLllxbTH0RJugdN7HUbPzFWTr+z+2PqT/tbZA5ScLfCtPsnjS8LWLc91iQESYKC8rLgd5qmJb6M1WNaidH8ZCQk6gOeQAxQm6uBoiFEDhK6sZQeG3UDJsag5qoW8dMbDTgTzkmMsU1MTMakBsKr3mE6lRrTxZxiirzcxhwBkDqhle3tbBplxZ8wFKNj5Gcm/N67nD4BMiYn9GyKnTIxOHMTHoO07GOkkm/UDn6+k1wf+GdjqtqE42MH32lLerLNblMttN12Dn+9aDNJjIqBsBYmjEBeH1OkpLL0c0DgJlLpiYKFsDnmdz5QK6HaSQjkQ7TYfI3avL7AdajK9Li4A66DwtvVpxbj5RWRMHYEDi8dMyTbbiotRVUrA+BuENILOuIFKjqLDwk+bpZpOxDFwic4dtHtGG1w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(376002)(346002)(396003)(136003)(39860400002)(451199021)(41300700001)(8936002)(8676002)(26005)(53546011)(6506007)(54906003)(82960400001)(478600001)(66556008)(66476007)(66946007)(4326008)(316002)(6512007)(36756003)(6666004)(6486002)(38100700002)(31686004)(86362001)(2906002)(31696002)(2616005)(5660300002)(186003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eE9hQ3plMmxoOWNxcldOd0VESVFXVDZNQmU0T0JjbktZbGwwelNJUDIrbHJN?=
 =?utf-8?B?dGR6Um42a1ZlWGtIbWlRbzRlc0lZVU1ReXNpN2VrMjZOaUpaalhjQ0xYRzRx?=
 =?utf-8?B?aEx6NWwyaklWbk5uSlp1YmpYeHNFTWZUS3NyN2Mvb3JjSHA3RFNxS3RnbWJD?=
 =?utf-8?B?RXNPNENRQysreFZrOWEreGxkK294QWVLVklvTEczejVQWnA3SUlpVDUwSE4z?=
 =?utf-8?B?eWhBS3Z4dFEwOUoyYWgzOFJtWmE0L29NNkRMSVFTaHdTMVhRWlVRWlpsalg4?=
 =?utf-8?B?Nm1Jb21zZjB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FSOTJvSVJmZ2xsbllTMTZ5?=
 =?utf-8?B?RHVOcmJaYmxXblJnM2xRTk00ZlE2eG5zd3pYRDRQVUI2di9LeHgyYUVOQUhs?=
 =?utf-8?B?bHlnMGdjMHJueCt2eUIzcE8rbEdydEtOVXhGTjZ1WUZranVpQkVMa3N4YjF6?=
 =?utf-8?B?MmdXZ0pXMEV4OUtpdWtycjk1aVJvNzlSaXFFS3IraFJtVytEOHhQcytQRXNw?=
 =?utf-8?B?ZmhjZStnQVRCazJiSkNWS0ovdUt4YmlpbUZZODMxNEdZUUVGc2RCVDJkamtM?=
 =?utf-8?B?aExtOVlmR052QVorWTVEeUtXODBSckUvWlVUNlpaRFVkdi83SHRjeXJYRmFk?=
 =?utf-8?B?d2dTWjlOUFl4b2RCVThJMmRUb0YxblQzRjFTZVdFSlBqZEhnelFRZXZGeGhl?=
 =?utf-8?B?NkplUXJxRVZtb1R5Q0ZZNnFweXRURGlicG1CRTdzZ1M0Tzh1Z1B2RDh4U2ow?=
 =?utf-8?B?Y00weUFGQktSV21QSTNaaUpZcExsbVNBR0s1QTJXUEFaaWtveGZ0b2ExbnVU?=
 =?utf-8?B?YlNsZmNwemZLaWtUV3l0Z0NOSUhzUmFGd0dFbEpJNjZNZXVML3J6SUZDMUpa?=
 =?utf-8?B?L2R4Z2pRbG44RW5qK2dnZTFRdXYvdWF4U1NXMWZ1Q2lyVkJCKzJoM2wxKzFt?=
 =?utf-8?Q?KExnQ64pt5sV6WX?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 89a92c31-44df-456b-c48f-08db86c7bb97
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 13:14:20.9593
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: sJg7jLeK7Tp1znm73rxuS1SvIKRXeWEy2nZoNUBNzu/2mR6MQoerbvoMoHLfNjolnNhZV9khFXYj7soRqFkKKzfbPZ+DwsYM2wtpAKOrLr8=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB7056

On 17/07/2023 2:09 pm, Marek Marczykowski-GÃ³recki wrote:
> "staging" branch is mirrored (automatically or manually) to several
> repositories. Avoid building it several times to not waste runner
> resources.
>
> Signed-off-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
> ---
>  .gitlab-ci.yml | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index c8bd7519d5fb..c3b05e32636b 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -2,6 +2,12 @@ stages:
>    - build
>    - test
>  
> +workflow:
> +  rules:
> +    - if: '$CI_COMMIT_REF_NAME == "staging" && $CI_PROJECT_NAMESPACE != "xen-project"'
> +      when: never
> +    - when: always

If we're doing this for staging, we should include staging-* and
stable-*.Â  They're all the same from this point of view.

However, this does need double checking with the committers who use
gitlab regularly (CC'd).Â  This doesn't happen to interfere with my
commit workflow (I use a separate branch called for-staging), but I
can't talk for others.

~Andrew


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 13:29:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 13:29:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564547.882030 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOHM-0007wJ-9D; Mon, 17 Jul 2023 13:28:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564547.882030; Mon, 17 Jul 2023 13:28:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOHM-0007wC-60; Mon, 17 Jul 2023 13:28:44 +0000
Received: by outflank-mailman (input) for mailman id 564547;
 Mon, 17 Jul 2023 13:28:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLOHK-0007w6-76
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 13:28:42 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on062d.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::62d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d7bf63ba-24a5-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 15:28:40 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8437.eurprd04.prod.outlook.com (2603:10a6:20b:3dd::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Mon, 17 Jul
 2023 13:28:37 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 13:28:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d7bf63ba-24a5-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=oXID7mp+5l1mKDQcxBTWKQPNouQPnHanWLKx1Y34j8aFSgJutcVgNeC1II+tmMBFxXICP+NuqkEdlOSX3VMgqYHpEnrSVBVGVvjpUC6ldSziPtLxTH/gzElGFGCytzI/owyI/TCkmNxRcVlaj9U6zkwH9BrRpdkp3xy8zBfhGvOuXr00COmfFbv1cWRKjK0aQV5+Ns3JGD/Grti128Ba5pJwodA+EIVpxw9/LnhhBiI8SHy9b1krsV82q/PV9XcLqWCuJek0hLfaz6RbgiWSnsXZJ7Xuw2IhmCr9cSUNQyJqIE+FBXIIwp6zEOSjrUKXNqJTRiu7orOMnp0EvGdT7g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=N/HE45oGB3HWWTTSd4kpzuJKOLzZoQZxXNOEKT/VmU4=;
 b=Y5fxWJTUSsFdJ3aC92SwUTuY2+dap5AWwNAyqnvZe3/PgKnZWxVyfD5vNKJSxXQh/aw/zj73Wi/jiJlcDvHEjF8xG1JjrNcorkj0Rafg0eeTHcgmhJ840Ysyz0ANLS3i+/r0wJuZCKaYcB97zg77oybyJ1dIjZP+2DonUKG38Dj202AdRNCaWSbGJcRHCPohQFrq4wESBtDpdWKKhND2v9bIyZonbKKdGgc1dv3W/CQcvJvu5rlWlzmEkEeYxeUxHcTXm0Z0ovEtYKjY0biCi5OnNzo4wenRcxZjHvDL3B6KXY+BqdhfXwifl9EhixTkbrJ3cHq8kdvW/F92029RSQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=N/HE45oGB3HWWTTSd4kpzuJKOLzZoQZxXNOEKT/VmU4=;
 b=LsE+n7NGQCATgqzMeqvQEZq/v2H0HoEf8PQISj8bobp9281VYY795SK8Za9WF0L8qFpjRnh/5ds39vZVVqMfHDtfUPB+7mMq1KQuRWynQEEc7u+FnaPFypFgWt5c27RNaUCohLDaYYnbzMwllyag6COiJvAah53iqt5PVgVu8S3tC6SAxqD6HmXSl6oSspVIMJCrv5gbiQeMXUADZc7iQONUOfhzHplmbetDg5R7SOg1IGDx4KqkUT+HB+itf1CFwlyL91AW4Iq+Gy3nreSxg5D9UTism2tcibD4EIxdsoh7l2lt/J4Dg7wJ46jWWFVYotOqidOE/raF2nQHO8HxYQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <76bf2955-7aed-dc6a-a5ea-4dd68064ce0c@suse.com>
Date: Mon, 17 Jul 2023 15:28:35 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] x86/HVM: adjust pIRQ calculation in hvm_inject_msi()
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 Simone Ballarin <simone.ballarin@bugseng.com>,
 Gianluca Luparini <gianluca.luparini@bugseng.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <5cfda162-07a3-8a02-4511-b0578b12dbc2@suse.com>
 <ZLUdTB_gZjRzhpJe@MacBook-Air-de-Roger.local>
 <f254729d-1b6c-8aaf-98d5-c1b739519081@suse.com>
 <ZLU4deYP4lwVYpFs@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZLU4deYP4lwVYpFs@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0138.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:96::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8437:EE_
X-MS-Office365-Filtering-Correlation-Id: 1fceaaaf-926e-406b-0ec6-08db86c9ba5f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	d6mP4UDaIuAQJDAmb4kzr23gwRl7DMrMUhu2jx0nAsPbMx6xQBcFH6f/5Qwv7x0iAh17it6qbTFrweqDhMUkOc+IPQgr8a07Sf8xgHua4RlovIZLh9S8c2x+QmuimMNvpdphSxnZPOjzzT/UT1QVNVxJe8bYIGOpJYwCv4aViZxYPssFyb3Zt2yNnQZTL7pW1HLCbo3d11tEQCnuAjNeC3/+qQ8VgdW682+6AOulFb4ceDrp213hO+G7i5vmWv53vkjR6uvG5vMYOHGAt7sf80NQzjgzMDed9c/+hcR4k8aX5Jy29qFEVwhXnL+ueD2KSZTl9R8ZPVEULJeKbF+2H5OtEreB1bcxUTbBkuh/hghyvkRP44EKHntCW4e8VyRK1LRyVrn8ykPE861SmYpPxpAAuJZxM53r2DdXFWJfQhnxK6sidFmmIOE1AIAkmuoul3eLTSzbaGHlJu6/b2EPjFY+1hq76phShXNg/cWveSuhYG3WkQGr9F2lIU0fTkeO1Yo4hLcPKH5yu+69r5vAIqDlDFTcb4NElBwaO8N0a+RpmA0FHhZ4m5qT+6zI7p3UIHorQ0IMRa07pcMgjJWoNiWtUwwu1wECHoToH+FkEGZ4hpY0FoKkdUcXlPF7UWjx34+KZIAnrr7OAmvmPNkOfw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(39860400002)(396003)(136003)(366004)(376002)(451199021)(36756003)(31696002)(38100700002)(2906002)(478600001)(6486002)(41300700001)(53546011)(6506007)(26005)(54906003)(6512007)(8676002)(8936002)(316002)(86362001)(66946007)(31686004)(66556008)(5660300002)(4326008)(66476007)(6916009)(2616005)(83380400001)(186003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?K2J6V1Zsc1hpZG8yZFFSZHMva0wwSmxYa1g2cDg3QUxBSFR2QW9wN2FGVnRi?=
 =?utf-8?B?UmJsT0thUXk1bXQvLzNsK3RwbjJCbDFUQUR1VnVSNyt3NlNaM1pDRnVyc1NF?=
 =?utf-8?B?ZWgramRON0tHL0xzS2FDL3I3dHdPeTFPbmlaZTVOV0Z4QmVldjNnYUFpTHVu?=
 =?utf-8?B?SnlXN1BIVG1MWUxLNVMwTkVWYmpQQTd2L3oxUWdsYUpwVXJtK1Q0Syt5ODBD?=
 =?utf-8?B?NlRjOUR1QitFKzRwaEF2bmNmYkNiSW05ZVJCcDNrdkxmc0FEeXV4blNIVllX?=
 =?utf-8?B?VXJ2dHorK2JKY1o5WVE5W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24yMGtVYVYyZ1BE?=
 =?utf-8?B?c2RhdzQwTlBNM3djSWF3bERLYnU5MzE2TWZIZDFzZ1VDR3dZeE1WSDZXK2Fx?=
 =?utf-8?Q?E64CvVpiTg5L4zyHL645LI3AH?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1fceaaaf-926e-406b-0ec6-08db86c9ba5f
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 13:28:37.8076
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 7+73r/qIK40FWiZF8qr/q0W1Gvf+u84DkZYv/MYgJIOs1fRyMzkg1I37lyicEDLoVh9nqrLmecM+Wlds4me0VA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8437

On 17.07.2023 14:47, Roger Pau MonnÃ© wrote:
> On Mon, Jul 17, 2023 at 01:49:43PM +0200, Jan Beulich wrote:
>> On 17.07.2023 12:51, Roger Pau MonnÃ© wrote:
>>> On Mon, Jul 17, 2023 at 11:31:57AM +0200, Jan Beulich wrote:
>>>> While the referenced commit came without any update to the public header
>>>> (which doesn't clarify how the upper address bits are used), the
>>>> intention looks to have been that bits 12..19 and 40..63 form the pIRQ.
>>>> Negative values simply make no sense, and pirq_info() also generally
>>>> wants invoking with an unsigned (and not just positive) value.
>>>>
>>>> Since the line was pointed out by Eclair, address Misra rule 7.2 at the
>>>> same time, by adding the missing U suffix.
>>>>
>>>> Fixes: 88fccdd11ca0 ("xen: event channel remapping for emulated MSIs")
>>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>>
>>> Acked-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
>>
>> Thanks.
>>
>>> I have a question below, but not related to the change here.
>>>
>>>>
>>>> --- a/xen/arch/x86/hvm/irq.c
>>>> +++ b/xen/arch/x86/hvm/irq.c
>>>> @@ -383,7 +383,7 @@ int hvm_inject_msi(struct domain *d, uin
>>>>  
>>>>      if ( !vector )
>>>>      {
>>>> -        int pirq = ((addr >> 32) & 0xffffff00) | dest;
>>>> +        unsigned int pirq = ((addr >> 32) & 0xffffff00U) | dest;
>>>>  
>>>>          if ( pirq > 0 )
>>>
>>> I do wonder whether this check is also accurate, as pIRQ 0 could be a
>>> valid value.  Should it instead use INVALID_PIRQ?
>>
>> I think 0 is okay to use here, as the low IRQs (at least the 16 ISA
>> ones) are all 1:1 mapped to their "machine" (i.e. Xen's) IRQ numbers.
>> And IRQ0 is always the timer, never given to guests (not even to
>> Dom0).
> 
> I'm kind of confused by this not being dom0, but rather an
> HVM guest, so pIRQ 0 of that HVM guest should be available to the
> guest itself?

pIRQ is a Xen concept; Xen assigns them, for the guest to use them in
(e.g.) hypercalls. As long as Xen hands out 0 only ever for (guest)
GSI 0, all should be fine. That said, ...

> IOW: the possible values here should be the full pIRQ range, as there
> are never Xen owned pIRQs in the context of an HVM guest.  One further
> limitation is that even in that case pIRQs for (guest) GSIs would
> still be identity mapped, so GSI 0 won't be a suitable pIRQ for an MSI
> source.
> 
> The usage of pIRQs here even for emulated devices makes me very
> confused.

... I'm with you here; I'm not convinced this logic is sound.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 13:35:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 13:35:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564551.882040 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOO0-00010q-0E; Mon, 17 Jul 2023 13:35:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564551.882040; Mon, 17 Jul 2023 13:35:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLONz-00010j-T7; Mon, 17 Jul 2023 13:35:35 +0000
Received: by outflank-mailman (input) for mailman id 564551;
 Mon, 17 Jul 2023 13:35:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLONx-00010d-Uh
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 13:35:33 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2047.outbound.protection.outlook.com [40.107.7.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cd8ea0b4-24a6-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 15:35:32 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS1PR04MB9582.eurprd04.prod.outlook.com (2603:10a6:20b:471::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Mon, 17 Jul
 2023 13:35:03 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 13:35:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cd8ea0b4-24a6-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=G1pacMSTvMgMte4W+JS7eBFFO0ozcvCD8c0BzYO1BXk8D/kHP1XGMgUeLZrscfHv4Y80n0Y7P7shTrt77BWQEUYsRlsD8oCAuvZWPaUSb0+q4nx/KtaZML2zRgvXRl5Y7N2sgcYzoDbnauRCFjRHL5lEAKjqu4lG/DV6RI/U66zLht5kLC2g/kUi8UcHb6A84WVkLFCQeGzaaDjQw2FAKhDNKwfVyzekWAk1Or5JyG6Bw+5UsScQ+t5/Uw7iRP6/4i2EKe18kUnSHUjAQJ787dFnH49kHNxw4fVHpyKPfHeqA+R/B4fxkxjd7Ije6jlpHSwHqavG3/SMguTKx3D0pg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=RzwQTFjZ57qzFp07BpNhwxBISUTlC0GUMABmg8ADWpw=;
 b=F+U8ClBTF2tckBpKQ9h9ZAiLHJ5Wfk14qWHuUEVacHq68SuQlUC0pcEGk5i2vU7uUsw3SOZ+k34mTxVqckaR3UDub/imjlQPCX0Ya7ayOyd3TfcZH6sw/Ky4iM5FPzsgq/FgKrpMrinv1xFFlSfJhMVfB++pGHg6jnVHch28+AP1Oa3DqQFDwr8N3uCxgJdsAYbAM2J7tFoMIBWAGA41rH9kJk9VDjioUqhOhisgvxyV2n9z5P68ItSKt7oym2P8S+Do5v4vvyiU81H0nACBz3W6nYurYWLuP6xQ4Clf2nPZO3SWRO3nwJhzVcGBTdWIFotcaozmu0J5GbtScYT+CQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RzwQTFjZ57qzFp07BpNhwxBISUTlC0GUMABmg8ADWpw=;
 b=tQTNPJP0n1Lz8nD+z1vTNpPI9s8TbRjEPk9n6gGUQwPr5U61zqDTb9jEyEV1Wcl6fiIecYC2hpRpI4NETzWb2WtPKtUAxvtoRORE4vn9dOyPqZ0+CnZwnffgvqMIzU22JXiRxS/DwL8jOVbMKFrAbfg/wp9lJrm3vmXlvqyxkb8BsHjTEjTM/pgtsWqFDlsLLso8gmLC/yU7CSmIbUrbH5RxkP9otE5O6O42/uoRpGFsQjkGvCGfrjITwkthBP9B6tKAVhPrYtuyYVEpJqMPaDi9xprRNyfoK+Pz12b5sbwH5W7E+EcF7Yqe7SrA49F3qhX0VprnidCBKnv+GI3FaQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3f413bfc-ba5d-5370-f474-8036f5f1c02f@suse.com>
Date: Mon, 17 Jul 2023 15:35:00 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 1/3] x86: allow Kconfig control over psABI level
Content-Language: en-US
To: Jason Andryuk <jandryuk@gmail.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com>
 <6f462a2f-2e91-6397-a527-18eeade19476@suse.com>
 <CAKf6xpvCFyQOqzekw7hV++yMPBDRCZxTagMQ7Fvbq244RrR9CA@mail.gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <CAKf6xpvCFyQOqzekw7hV++yMPBDRCZxTagMQ7Fvbq244RrR9CA@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0143.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:96::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS1PR04MB9582:EE_
X-MS-Office365-Filtering-Correlation-Id: d0ee5211-0cdd-44b0-d9f1-08db86caa032
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	ANFXjEf0AvtYIuvDoS3IuBxFiUi8bw6q3YvlCKNciUxyFPDwQ9UahcYSEwh1JAkOGe4ZwmdycDJW/H+yZk7GJ2ORoIQ7tRVRYST6pIK8syRn+picODs9a78hIHBUwQ4oAarEnig11NS3uezj6vX2drC2qje6tgwZxgwBkttMRpunMICMdNz17GjfIsa8vDwu/PuQ/saBEwMvcI3jgr9htr494J5Wulk1RujQ9z9EWIav8hEgOBU4m877hPnXaEafr2a4I18fgWkP7zhjCh2p0NAvz44/7xX55Fkw88Gdu7bYfBWVKoCRNB2ichMvH216Pn34J7Eoxk08ufowQ/UTFADR7Ra0IZVj6QCphxGx3BFNnNDOMG2t/hamOl448jITbcp/oDkOOdFdVzH3jRZTJ0XxleJGjFVE2KgAzFK4rUQct3G35knbupriRlEwVbojYVplq92IebL9o6hU6vDrjPbEIYJK5ZfAgyF3ii4qbdVSjDmysDUV9g7i2XyuiB3jwwwxukwQNkI8GbdPOvb53Se8qJnplX8XdWad4vzE5FtEaMmJPxFTraztVbYz2ygy8bmxCgEcdPab3l+WkXdakTHC6xOdOXmfCNWQYMK5qf9TooPq2ImnJmktqVS0OVO6Vph4Zvb8JKMOI1EhPRhzpA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(136003)(396003)(376002)(39860400002)(346002)(451199021)(478600001)(6486002)(54906003)(186003)(53546011)(6506007)(26005)(6512007)(966005)(2906002)(41300700001)(4326008)(316002)(66556008)(66946007)(5660300002)(36756003)(8936002)(8676002)(66476007)(38100700002)(6916009)(86362001)(31696002)(2616005)(83380400001)(31686004)(66899021)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bnFZRUNJSUxFSTVVbjk0Qlc1RDU3QUl2RWxkMjFqVnBsSFhJdjJmNHd0a25k?=
 =?utf-8?B?cGduYUNHQ28vU0lYdzhZeTdob3FXQ3pNU1pZdjBRKzlhMzZ3ZFBsWlhQTzgr?=
 =?utf-8?B?QzdMRTdmeTYzR2l5VkxUUnZlRDBJeUpJRlN5Y1ExZXExdnJpZzgzMlFHMDF4?=
 =?utf-8?B?Tmx6WWJNMWx4Z1krWUJPWnZFMmh0d2ZSYWp6UFN4NUJZUEtUcGZiSFVhNVZm?=
 =?utf-8?B?Y2dZclAzZG5JTDZkVXdhQW5rSTdGUjRYa2M4a29MNS9HRHorQkhPa0tKdUo1?=
 =?utf-8?B?ZkQ4T2NmMnJRNTJ5cnMwYmdaenBFbWQ1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=?utf-8?B?V1BvUlBDcUc2c3NmOFZjaS9mbm9ZUjc4anAwa0lWSG5vMFI2a1BqSjdjY2Np?=
 =?utf-8?Q?DLjUVFeeOCJ7bkasWfRLEdtY3?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d0ee5211-0cdd-44b0-d9f1-08db86caa032
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 13:35:03.3335
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: aqKQHfon3oJSK2kNXUMIDfwxE8di2fx5Uletb+0OR/OXCMGuyRhoT7cbGQ6rw3NQvJMW0Kw9TXU/h78bQKWitw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9582

On 17.07.2023 14:23, Jason Andryuk wrote:
> On Wed, Jul 12, 2023 at 8:34â€¯AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> Newer hardware offers more efficient and/or flexible and/or capable
>> instructions, some of which we can make good use of in the hypervisor
>> as well. Allow a basic way (no alternatives patching) of enabling their
>> use. Of course this means that hypervisors thus built won't work
>> anymore on older, less capable hardware.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Reviewed-by: Jason Andryuk <jandryuk@gmail.com>

Thanks.

> With two comments.
> 
>> ---
>> TBD: Should we, just like for NX, add an early check in assembly code,
>>      to have a "clean" failure rather than a random crash?
> 
> That is less confusing than a random crash.

Of course. My thinking behind not doing this right away was that people
aren't supposed to use such a hypervisor on incapable hardware. So we
would likely add code for something which ought to never happen. Still
for v2 I guess I'll add such code (then of course invalidating your R-b
again); in the worst case it should be easy to rip out again from the
patch.

>> --- a/xen/arch/x86/Kconfig
>> +++ b/xen/arch/x86/Kconfig
>> @@ -118,6 +118,36 @@ config HVM
>>
>>           If unsure, say Y.
>>
>> +choice
>> +       prompt "base psABI level"
>> +       default X86_64_BASELINE
>> +       help
>> +         The psABI defines 4 levels of ISA extension sets as a coarse granular
>> +         way of identifying advanced functionality that would be uniformly
>> +         available in respectively newer hardware.  While v4 is not really of
>> +         interest for Xen, the others can be selected here, making the
>> +         resulting Xen no longer work on older hardware.  This option won't
>> +         have any effect if the toolchain doesn't support the distinction.
>> +
>> +         If unsure, stick to the default.
>> +
>> +config X86_64_BASELINE
>> +       bool "baseline"
>> +
>> +config X86_64_V2
>> +       bool "v2"
>> +       help
>> +         This enables POPCNT and CX16, besides other extensions which are of
>> +         no interest here.
>> +
>> +config X86_64_V3
>> +       bool "v3"
>> +       help
>> +         This enables BMI, BMI2, LZCNT, and MOVBE, besides other extensions
>> +         which are of no interest here.
> 
> Would it make sense to try and specify models?  According to this:
> https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels
> 
> x86-64-v2
> (circa 2009: Nehalem and Jaguar)
> Atom Silvermont (2013)
> VIA Nano and Eden "C" (2015)
> 
> x86-64-v3
> (circa 2015: Haswell and Excavator)
> Atom Gracemont (2021)

I'm not sure how useful this would be without supplying a reasonably
complete list of models. I don't think we can expect people to be aware
of the sequence of model names, without which specifying just the first
respective models isn't very useful.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 13:38:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 13:38:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564559.882052 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOQu-0001iw-J4; Mon, 17 Jul 2023 13:38:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564559.882052; Mon, 17 Jul 2023 13:38:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOQu-0001ip-GG; Mon, 17 Jul 2023 13:38:36 +0000
Received: by outflank-mailman (input) for mailman id 564559;
 Mon, 17 Jul 2023 13:38:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLOQt-0001if-Bc
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 13:38:35 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on2061d.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::61d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 394a6007-24a7-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 15:38:33 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8334.eurprd04.prod.outlook.com (2603:10a6:102:1cc::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Mon, 17 Jul
 2023 13:38:31 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 13:38:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 394a6007-24a7-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=inmJ/KS55mcf/coa2FEp8Fy170v+ZOaHaMhYKDUmnT6QvDfmmUMpeBGj0RHden9vj46tBUIH3yA2CpaEsoHL2YtrQUl012IP8q7SCHH6qK9fJDPx6SbN8fm9yFpHI6YTCi+3M40D9NYoi/UCcoGWAi9jtqL3BP+GGnjYvBU1prsw6GOmvvIhji+rDt/QyWeSUoG091JFF3rCXwkPIxxo+VxM88FQzzS88TulrXF1cRGmsYPlg56Di1kBhl3tvq6KbTGyWUwOBiFtHXldJSLTitLd94xTjsTuzzwu+3AcHisP4+h4YAXl/QMKN4IIqTl5fVHzzZWZzb91ciDdAz/1kQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=bh+DerWxjcV2fBc4UQ5cv/e7uwkaIgO/C3ikGXVp2yQ=;
 b=SrQGkFs+yiky0gkOjEixSB/vZ21B1DjGQYCnpIEy8GynhXyKAFhtHg9wm18mj+ENoKMANAY2ponYK4lGjAr6wGQ5YdIVqcJAXgNawhu0+QXdX9I3peBTI9Ulcjd3c/Zwt/5G9nNd21IbSfCWxrHnVtRcijV5srT6otS/yRVxPsIPQQb8AZlN2PSQA+pjHn9aw52Po7rc5lmMrcu8olwyrr1oP3oF5fbU6B9kHKHIcwDZQFuwruDYEWMJzhiA0U4Ei4Ploh3/7JHD3JrziJByK4l6MFZJh4XOKPqzWnhs8X/NYDi6IbinpNO0zViuMJgrl1Q9fhfjACxCWUxDi1BT7Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=bh+DerWxjcV2fBc4UQ5cv/e7uwkaIgO/C3ikGXVp2yQ=;
 b=a0vQA3KwG65fvoW7UK5WnUq5AqILpN/5VANCEThXF+R/bDMz/Z2JNQSnQ7XJZwSWu1hS7FIGNudOJ9ei1ySmfhF7xuGr4QwbsKpDliRd2TPVS9+3YDNUgCj/YyQgI1LUewEll7mrEEysCxBlgNpsiQgfBng3jPpaT+GO9AOoEE3A2TQPXkZ/rcUph3ETr78uOz6GBJC7aovrX6HoPTg9C9qKE0DVNJacDllqv/4WNQrohu8sbJjvbQ2zWhcyTnWcKryU0AagTD9v3cDBIVYrcgVhMm+G7N6yI21pOXUYvlJG59rB2X6dpozwEVVvnI5VV1c/kGoLQ7eo/uxNYPkqlA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <40039335-8df7-cda6-c69c-cc94e80cb164@suse.com>
Date: Mon, 17 Jul 2023 15:38:29 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 3/3] x86: short-circuit certain cpu_has_* when
 x86-64-v{2,3} are in effect
Content-Language: en-US
To: Jason Andryuk <jandryuk@gmail.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com>
 <60e79cc5-ad07-81e9-e7e6-f97a73a4df62@suse.com>
 <CAKf6xpt9RTA7sef_QBM=y2gcZURcGzCpU9itUwCD5EPDTtukqA@mail.gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <CAKf6xpt9RTA7sef_QBM=y2gcZURcGzCpU9itUwCD5EPDTtukqA@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0121.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9d::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8334:EE_
X-MS-Office365-Filtering-Correlation-Id: e065c9e4-ff80-4703-4407-08db86cb1c5e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Dn6IQbiCF9SqHVJwbFP4Gx7CVxEPqFHqlrX+5pz7mGG6+edX37m6U8OM1jIoJHZN3+NxI1QTYfORfTxgCkTkli/lwTZrKzTeEoMpj8cbKSZCtP3yqgH1FVjqcKgkmByU6RQgi2W7LiybTRLcznDsABpxjxSjkWIQCF5Wj5wxOMpO5H/IdSJom/TuB7MocvMg++SSYDGoZ33hexUrmWRrnitCLoulgJoQK7UsbJCA4td5OkvCGFRiWkW9EnpT0J2rEM8mWrsufsHZHkznqXy2VKFvArMPaJS3nHgyAVemrXm06tTRblRzU4cV4DGpiBHgzUAwt0KPLgk52GxVQ3mS4b9MRrUIHJAvia0K49zdt6ryVGQqrxdhyvAsAqrORn81oJgwH8rly+TJRTUkIkmgET90SacKbQsTaaT37CXfvTU9IJ2VRRwfWlS0V4rAeNVRYCfMh7i7XkJnFP6tzQ5rWmO5e27ROX+9JakqX/RQOMmNcP/56pWidJir4CxXo/9D3hmk4d7HxoNWyPzu9lp2MKf39K91WWhV8a5sChXPgmdRQW02QI8CziFNDjIsfqxSLaYHuX56IUEQ8T7YBbfWkogzjAYi9cezB2h7BM6RdqobfpTj6zFactE0Jxk/MhQ8EG1fqN6MaCYohwJcwzU4pw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(136003)(396003)(376002)(39860400002)(346002)(451199021)(478600001)(6486002)(54906003)(186003)(53546011)(6506007)(26005)(6512007)(2906002)(41300700001)(4326008)(316002)(66556008)(66946007)(5660300002)(36756003)(8936002)(8676002)(66476007)(38100700002)(6916009)(86362001)(31696002)(2616005)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QzdNWlVFc0VrZTR6SGd5cW5uQ1JJK3RYb1o4cnFwL3ZEaTdLWE9UUXU2OEpj?=
 =?utf-8?B?cUp1NzNidVdQMW5aVzRidkU2aEtPNU5WWDFlYlZMV2RCQWsyMzdZREhQUUpy?=
 =?utf-8?B?eFFLeWhvV2x5dDVHcnVPTU8zVTBabFdCM0lRQlRNR2ord3NjK3BscTVPRmlL?=
 =?utf-8?B?UitudnkvbUh4dTUydkNvWEJEb1o1d1RibnZMZXorMFpZblpqLzZpbkdEenlL?=
 =?utf-8?B?YzlLbVh5b3V3bFRCUTRjWk9HRUV5NW5IUi9tTGIxQjZFZXNvRmhOc0VxVGNX?=
 =?utf-8?B?RDFOVitCaTZMWlJHR2xVSklDNXJxWDdlTkplZDNkbDRjMG04b3NzMHQx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Ly9kRlVaREdXL3N2ZXgzSmczbXZaZjRR?=
 =?utf-8?Q?LzMphqNFptzi3Ah2mAIhcgPNI?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e065c9e4-ff80-4703-4407-08db86cb1c5e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 13:38:31.6579
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: p6MixsjYLWRJfdGu7+zb/dGuM7QvhCB56yur1wYMySGFCYwprooOzrw3fkZ/xoMq2Qv5VDDFZstMtmpm+cgSWg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8334

On 17.07.2023 14:35, Jason Andryuk wrote:
> On Wed, Jul 12, 2023 at 8:36â€¯AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> Certain fallback code can be made subject to DCE this way. Note that
>> CX16 has no compiler provided manifest constant, so CONFIG_* are used
>> there instead. Note also that we don't have cpu_has_movbe nor
>> cpu_has_lzcnt (aka cpu_has_abm).
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Reviewed-by: Jason Andryuk <jandryuk@gmail.com>

Thanks.

>> --- a/xen/arch/x86/include/asm/cpufeature.h
>> +++ b/xen/arch/x86/include/asm/cpufeature.h
>> @@ -76,13 +76,19 @@ static inline bool boot_cpu_has(unsigned
>>  #define cpu_has_eist            boot_cpu_has(X86_FEATURE_EIST)
>>  #define cpu_has_ssse3           boot_cpu_has(X86_FEATURE_SSSE3)
>>  #define cpu_has_fma             boot_cpu_has(X86_FEATURE_FMA)
>> -#define cpu_has_cx16            boot_cpu_has(X86_FEATURE_CX16)
>> +#define cpu_has_cx16            (IS_ENABLED(CONFIG_X86_64_V2) || \
>> +                                 IS_ENABLED(CONFIG_X86_64_V3) || \
>> +                                 boot_cpu_has(X86_FEATURE_CX16))
> 
> If you think there may be more ABI selections in the future, it might
> be better to express the "V$N" numerically and check >= 2.  Or you can
> add a Kconfig CONFIG_X86_64_CX16 and select that as appropriate.  But
> if there aren't going to be more of these, then this is fine.

I was thinking this same way: If more appear (which aren't SIMD-only,
like v4 is), we can use a numeric CONFIG_*, but for now it's good
enough (and slightly simpler) this way.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 13:40:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 13:40:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564562.882062 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOSd-00038w-To; Mon, 17 Jul 2023 13:40:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564562.882062; Mon, 17 Jul 2023 13:40:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOSd-00038p-RH; Mon, 17 Jul 2023 13:40:23 +0000
Received: by outflank-mailman (input) for mailman id 564562;
 Mon, 17 Jul 2023 13:40:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qLOSc-00038j-KE
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 13:40:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLOSb-0007IE-Oy; Mon, 17 Jul 2023 13:40:21 +0000
Received: from [54.239.6.185] (helo=[192.168.23.25])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLOSb-0000LS-Dz; Mon, 17 Jul 2023 13:40:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=Byq9k7kJYUr5XjyQagzFYtWyXG1nmgWqnyppc/Mcdc0=; b=ILks74Kjr+D58TJuv+Nqjj37gg
	auP/QIoeFYexG5O0gp7vJCQ0IweI/TxjPILpB3aEiVdrJloULKl31OJhxjpqDbBvjHeD3X51ezQ/l
	5Tb6C7jtwJZsWyYJBMoCy9jbac52Pzf6lzdzSjLBImMRORdTWZcBdHKUnoy9AP0TVqVE=;
Message-ID: <9cac9bc5-ad55-3bcd-b645-a30a5b863b3f@xen.org>
Date: Mon, 17 Jul 2023 14:40:18 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally
 uninitialized variables
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <1ad20473a031eca75db4007bdc169616b512ef44.1689329728.git.nicola.vetrini@bugseng.com>
 <97d8a796-f790-8efc-1d89-def1f1193e61@xen.org>
 <5da7ae40-35c7-7f93-824f-42a0712cdcf1@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <5da7ae40-35c7-7f93-824f-42a0712cdcf1@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Nicola,

On 17/07/2023 13:08, Nicola Vetrini wrote:
> On 14/07/23 15:00, Julien Grall wrote:
>> Hi Nicola,
>>
>> On 14/07/2023 12:49, Nicola Vetrini wrote:
>>> This patch aims to fix some occurrences of possibly uninitialized
>>> variables, that may be read before being written. This behaviour would
>>> violate MISRA C:2012 Rule 9.1, besides being generally undesirable.
>>>
>>> In all the analyzed cases, such accesses were actually safe, but it's
>>> quite difficult to prove so by automatic checking, therefore a safer
>>> route is to change the code so as to avoid the behaviour from occurring,
>>> while preserving the semantics.
>>>
>>> To achieve this goal, I adopted the following strategies:
>>
>> Please let's at least one patch per strategy. I would also consider 
>> some of the rework separate so they can go in regardless the decision 
>> for the SAF-*.
>>
>>>
>>> - Add a suitably formatted local deviation comment
>>> Â Â  (as indicated in 'docs/misra/documenting-violations.rst')
>>> Â Â  to exempt the following line from checking.
>>>
>>> - Provide an initialization for the variable at the declaration.
>>>
>>> - Substitute a goto breaking out of control flow logic with a 
>>> semantically
>>> Â Â  equivalent do { .. } while(0).
>>
>> As I already mentioned in private, it is unclear to me how you decided 
>> which strategy to use. I still think we need to define our policy 
>> before changing the code. Otherwise, it is going to be difficult to 
>> decide for new code.
>>
> 
> The main point of this RFC is doing so. From what I gathered, it's not 
> an easy task: sometimes there are no 'safe' values to initialize 
> variables to and sometimes there is no easy way to prove that indeed 
> something is always initialized or not accessed at all.

But you wrote the code. So you should be able to explain how you took 
the decision between one and the others.

Also, even if this is an RFC, it would have been good to summarize any 
discussion that happened in private and if there were concern try to 
come up with ideas or at least listing the concerns after '---.

> 
>>>
>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>> ---
>>> Â  docs/misra/safe.jsonÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  8 +++++++
>>> Â  xen/arch/arm/arm64/lib/find_next_bit.c |Â  1 +
>>> Â  xen/arch/arm/bootfdt.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  6 +++++
>>> Â  xen/arch/arm/decode.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  2 ++
>>> Â  xen/arch/arm/domain_build.cÂ Â Â Â Â Â Â Â Â Â Â  | 29 ++++++++++++++++++----
>>> Â  xen/arch/arm/efi/efi-boot.hÂ Â Â Â Â Â Â Â Â Â Â  |Â  6 +++--
>>> Â  xen/arch/arm/gic-v3-its.cÂ Â Â Â Â Â Â Â Â Â Â Â Â  |Â  9 ++++---
>>> Â  xen/arch/arm/mm.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  1 +
>>> Â  xen/arch/arm/p2m.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  | 33 +++++++++++++++-----------
>>> Â  9 files changed, 69 insertions(+), 26 deletions(-)
>>>
>>> diff --git a/docs/misra/safe.json b/docs/misra/safe.json
>>> index e3c8a1d8eb..244001f5be 100644
>>> --- a/docs/misra/safe.json
>>> +++ b/docs/misra/safe.json
>>> @@ -12,6 +12,14 @@
>>> Â Â Â Â Â Â Â Â Â  },
>>> Â Â Â Â Â Â Â Â Â  {
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  "id": "SAF-1-safe",
>>> +Â Â Â Â Â Â Â Â Â Â Â  "analyser": {
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  "eclair": "MC3R1.R9.1"
>>> +Â Â Â Â Â Â Â Â Â Â Â  },
>>> +Â Â Â Â Â Â Â Â Â Â Â  "name": "Rule 9.1: initializer not needed",
>>> +Â Â Â Â Â Â Â Â Â Â Â  "text": "The following local variables are possibly 
>>> subject to being read before being written, but code inspection 
>>> ensured that the control flow in the construct where they appear 
>>> ensures that no such event may happen."
>> I am bit concerned which such statement because the code instance was 
>> today with the current code. This could change in the future and 
>> invalide the reasoning.
>>
>> It is not clear to me if we have any mechanism to prevent that. If we 
>> don't, then I think we need to drastically reduce the number of time 
>> this is used (there are a bit too much for my taste).
>>
> 
> Indeed, the purpose of such a deviation is that the sound 
> overapproximation computed by the tool requires a human to look at the 
> code and think twice before modifying it (i.e., if ever that code is 
> touched, the reviewer ought to assess whether that justification still 
> holds or some other thing should be done about it.

Your assumption is the reviewer will notice there is an existing 
devitation and be able to assess it has changed. I view this assumption 
as risky in the long term.

Have you investigate to improve the automatic tooling?

> 
>>> +Â Â Â Â Â Â Â  },
>>> +Â Â Â Â Â Â Â  {
>>> +Â Â Â Â Â Â Â Â Â Â Â  "id": "SAF-2-safe",
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  "analyser": {},
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  "name": "Sentinel",
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  "text": "Next ID to be used"
>>> diff --git a/xen/arch/arm/arm64/lib/find_next_bit.c 
>>> b/xen/arch/arm/arm64/lib/find_next_bit.c
>>> index ca6f82277e..51b852c595 100644
>>> --- a/xen/arch/arm/arm64/lib/find_next_bit.c
>>> +++ b/xen/arch/arm/arm64/lib/find_next_bit.c
>>> @@ -67,6 +67,7 @@ unsigned long find_next_zero_bit(const unsigned 
>>> long *addr, unsigned long size,
>>> Â  {
>>> Â Â Â Â Â  const unsigned long *p = addr + BIT_WORD(offset);
>>> Â Â Â Â Â  unsigned long result = offset & ~(BITS_PER_LONG-1);
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  unsigned long tmp;
>>
>> This is a file that was copied as-is from Linux. I thought we exclude 
>> them.
> 
> There was an expansion location in the report that caused that file to 
> appear in the output. Thanks for reporting it.
> 
>>
>> Anyway, can you provide some details why Eclair thinks this is may be 
>> used unitialized?
> 
> The problem lies in the goto skipping out of control flow structures. It 
> can't be refactored with a "do { tmp=...; break; } while(0)", as done 
> elsewhere, because there are two distinct labels in there, so the 
> semantics would be altered. The same comment applies in other instances 
> as well.
> 
>>
>>> Â Â Â Â Â  if (offset >= size)
>>> diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
>>> index 2673ad17a1..1292a64e8d 100644
>>> --- a/xen/arch/arm/bootfdt.c
>>> +++ b/xen/arch/arm/bootfdt.c
>>> @@ -34,6 +34,7 @@ static bool __init device_tree_node_matches(const 
>>> void *fdt, int node,
>>> Â  static bool __init device_tree_node_compatible(const void *fdt, int 
>>> node,
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const char *match)
>>> Â  {
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  int len, l;
>>
>> It is unclear to me whether the SAF-* applies to 'len' or 'l'.
> 
> Just len, they need to be two separate declarations if it is agreed not 
> to initialize it. Good catch.
> 
>>
>>> Â Â Â Â Â  const void *prop;
>>> @@ -169,7 +170,9 @@ int __init device_tree_for_each_node(const void 
>>> *fdt, int node,
>>> Â Â Â Â Â Â  */
>>> Â Â Â Â Â  int depth = 0;
>>> Â Â Â Â Â  const int first_node = node;
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  u32 address_cells[DEVICE_TREE_MAX_DEPTH];
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  u32 size_cells[DEVICE_TREE_MAX_DEPTH];
>>
>> I have never sent formally, but in the past I proposed to rework the 
>> code so {address, size}_cells[0] would be initialized before the loop. 
>> See 
>> https://lore.kernel.org/all/ea06f2ac-4ac1-4a6f-bda6-e775a7e68699@xen.org/.
>>
>> Do you think this would help?
> 
> If that initialization is applied to all the array elements yes, because 
> the Amplification of R9.1 says:
> "For the purposes of this rule, an array element or structure member 
> shall be considered as a discrete
> object".
> Otherwise, initializing just the first element does not improve the 
> situation in any way, and this is currently not within of the analysis 
> capabilities of ECLAIR.

Any plan to improve ECLAIR?

> 
>>
>>> Â Â Â Â Â  int ret;
>>> @@ -249,8 +252,10 @@ static void __init process_multiboot_node(const 
>>> void *fdt, int node,
>>> Â Â Â Â Â  const __be32 *cell;
>>> Â Â Â Â Â  bootmodule_kind kind;
>>> Â Â Â Â Â  paddr_t start, size;
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  int len;
>>> Â Â Â Â Â  /* sizeof("/chosen/") + DT_MAX_NAME + '/' + DT_MAX_NAME + '/0' 
>>> => 92 */
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1*/
>>> Â Â Â Â Â  char path[92];
>>
>> So the two above, is one category of issue. The variables are passed 
>> as argument of function which will fill them.
>>
>> Can Eclair look at the callers, if so, can we consider to always 
>> initialize the values in the callee?
>>
>> This would reduce the number of SAF-*. There are a few other examples 
>> like that below. So I will skip them for now.
>>
>> [...]
>>
> 
> If the value is always initialized in the callee, then there's no 
> problem configuring ECLAIR so that it knows that this parameter is 
> always written, and therefore any subsequent use in the caller is ok.
> 
> Another possibility is stating that a function never reads the pointee 
> before writing to it (it may or may not write it, but if it doesn't, 
> then the pointee is not read either). The 'strncmp' after 'fdt_get_path' 
> does get in the way, though, because this property is not strong enough 
> to ensure that we can use 'path' after returning from the function.

I am not sure I fully understand what you wrote. Can you provide a C 
example?

> 
>>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>>> index d0d6be922d..d43f86c2f0 100644
>>> --- a/xen/arch/arm/domain_build.c
>>> +++ b/xen/arch/arm/domain_build.c
>>> @@ -62,7 +62,7 @@ custom_param("dom0_mem", parse_dom0_mem);
>>> Â  int __init parse_arch_dom0_param(const char *s, const char *e)
>>> Â  {
>>> -Â Â Â  long long val;
>>> +Â Â Â  long long val = LLONG_MAX;
>>
>> Can you explain why you decided to initialize rather than SAF-? For 
>> clarity, I am not asking to switch to SAF-, I am mainly interested 
>> what were your though process.
>>
> 
> I saw that putting a large enough value here would be out of range and 
> trigger the printk even if the conditional leads to somehow enter the if 
> branch with an invalid value.

Ok. This wants to be documented on top of the assignment.

> 
>>> Â Â Â Â Â  if ( !parse_signed_integer("sve", s, e, &val) )
>>> Â Â Â Â Â  {
>>> @@ -1077,6 +1077,7 @@ static void __init 
>>> assign_static_memory_11(struct domain *d,
>>> Â  static int __init handle_linux_pci_domain(struct kernel_info *kinfo,
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const struct 
>>> dt_device_node *node)
>>> Â  {
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  uint16_t segment;
>>> Â Â Â Â Â  int res;
>>> @@ -1351,6 +1352,7 @@ static int __init make_memory_node(const struct 
>>> domain *d,
>>> Â Â Â Â Â  unsigned int i;
>>> Â Â Â Â Â  int res, reg_size = addrcells + sizecells;
>>> Â Â Â Â Â  int nr_cells = 0;
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1*/
>>> Â Â Â Â Â  __be32 reg[NR_MEM_BANKS * 4 /* Worst case addrcells + sizecells 
>>> */];
>>> Â Â Â Â Â  __be32 *cells;
>>> @@ -1578,6 +1580,7 @@ static int __init find_unallocated_memory(const 
>>> struct kernel_info *kinfo,
>>> Â Â Â Â Â  struct rangeset *unalloc_mem;
>>> Â Â Â Â Â  paddr_t start, end;
>>> Â Â Â Â Â  unsigned int i;
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  int res;
>>> Â Â Â Â Â  dt_dprintk("Find unallocated memory for extended regions\n");
>>> @@ -1727,6 +1730,7 @@ static int __init find_memory_holes(const 
>>> struct kernel_info *kinfo,
>>> Â Â Â Â Â  dt_for_each_device_node( dt_host, np )
>>> Â Â Â Â Â  {
>>> Â Â Â Â Â Â Â Â Â  unsigned int naddr;
>>> +Â Â Â Â Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â Â Â Â Â  paddr_t addr, size;
>>> Â Â Â Â Â Â Â Â Â  naddr = dt_number_of_address(np);
>>> @@ -1976,9 +1980,11 @@ static int __init make_cpus_node(const struct 
>>> domain *d, void *fdt)
>>> Â Â Â Â Â  const struct dt_device_node *npcpu;
>>> Â Â Â Â Â  unsigned int cpu;
>>> Â Â Â Â Â  const void *compatible = NULL;
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  u32 len;
>>> Â Â Â Â Â  /* Placeholder for cpu@ + a 32-bit hexadecimal number + \0 */
>>> Â Â Â Â Â  char buf[13];
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  u32 clock_frequency;
>>> Â Â Â Â Â  /* Keep the compiler happy with -Og */
>>> Â Â Â Â Â  bool clock_valid = false;
>>> @@ -2104,6 +2110,7 @@ static int __init make_gic_node(const struct 
>>> domain *d, void *fdt,
>>> Â Â Â Â Â  const struct dt_device_node *gic = dt_interrupt_controller;
>>> Â Â Â Â Â  int res = 0;
>>> Â Â Â Â Â  const void *addrcells, *sizecells;
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  u32 addrcells_len, sizecells_len;
>>> Â Â Â Â Â  /*
>>> @@ -2179,6 +2186,7 @@ static int __init make_timer_node(const struct 
>>> kernel_info *kinfo)
>>> Â Â Â Â Â  int res;
>>> Â Â Â Â Â  unsigned int irq[MAX_TIMER_PPI];
>>> Â Â Â Â Â  gic_interrupt_t intrs[3];
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  u32 clock_frequency;
>>> Â Â Â Â Â  bool clock_valid;
>>> @@ -2511,6 +2519,7 @@ static int __init handle_device(struct domain 
>>> *d, struct dt_device_node *dev,
>>> Â Â Â Â Â  unsigned int naddr;
>>> Â Â Â Â Â  unsigned int i;
>>> Â Â Â Â Â  int res;
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  paddr_t addr, size;
>>> Â Â Â Â Â  bool own_device = !dt_device_for_passthrough(dev);
>>> Â Â Â Â Â  /*
>>> @@ -2779,6 +2788,7 @@ static int __init make_gicv2_domU_node(struct 
>>> kernel_info *kinfo)
>>> Â  {
>>> Â Â Â Â Â  void *fdt = kinfo->fdt;
>>> Â Â Â Â Â  int res = 0;
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1*/
>>> Â Â Â Â Â  __be32 reg[(GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS) * 
>>> 2];
>>> Â Â Â Â Â  __be32 *cells;
>>> Â Â Â Â Â  const struct domain *d = kinfo->d;
>>> @@ -2914,6 +2924,7 @@ static int __init make_vpl011_uart_node(struct 
>>> kernel_info *kinfo)
>>> Â Â Â Â Â  void *fdt = kinfo->fdt;
>>> Â Â Â Â Â  int res;
>>> Â Â Â Â Â  gic_interrupt_t intr;
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1*/
>>> Â Â Â Â Â  __be32 reg[GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS];
>>> Â Â Â Â Â  __be32 *cells;
>>> Â Â Â Â Â  struct domain *d = kinfo->d;
>>> @@ -3435,6 +3446,7 @@ static void __init initrd_load(struct 
>>> kernel_info *kinfo)
>>> Â Â Â Â Â  paddr_t paddr, len;
>>> Â Â Â Â Â  int node;
>>> Â Â Â Â Â  int res;
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  __be32 val[2];
>>> Â Â Â Â Â  __be32 *cellp;
>>> Â Â Â Â Â  void __iomem *initrd;
>>> @@ -3514,6 +3526,7 @@ static int __init get_evtchn_dt_property(const 
>>> struct dt_device_node *np,
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  uint32_t *port, uint32_t 
>>> *phandle)
>>> Â  {
>>> Â Â Â Â Â  const __be32 *prop = NULL;
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  uint32_t len;
>>> Â Â Â Â Â  prop = dt_get_property(np, "xen,evtchn", &len);
>>> @@ -3538,10 +3551,13 @@ static int __init 
>>> get_evtchn_dt_property(const struct dt_device_node *np,
>>> Â  static int __init alloc_domain_evtchn(struct dt_device_node *node)
>>> Â  {
>>> Â Â Â Â Â  int rc;
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  uint32_t domU1_port, domU2_port, remote_phandle;
>>> Â Â Â Â Â  struct dt_device_node *remote_node;
>>> Â Â Â Â Â  const struct dt_device_node *p1_node, *p2_node;
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  struct evtchn_alloc_unbound alloc_unbound;
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  struct evtchn_bind_interdomain bind_interdomain;
>>> Â Â Â Â Â  struct domain *d1 = NULL, *d2 = NULL;
>>> @@ -3789,11 +3805,12 @@ static int __init construct_domain(struct 
>>> domain *d, struct kernel_info *kinfo)
>>> Â  static int __init alloc_xenstore_evtchn(struct domain *d)
>>> Â  {
>>> -Â Â Â  evtchn_alloc_unbound_t alloc;
>>> +Â Â Â  evtchn_alloc_unbound_t alloc = {
>>> +Â Â Â Â Â Â Â  .dom = d->domain_id,
>>> +Â Â Â Â Â Â Â  .remote_dom = hardware_domain->domain_id
>>> +Â Â Â  };
>>> Â Â Â Â Â  int rc;
>>> -Â Â Â  alloc.dom = d->domain_id;
>>> -Â Â Â  alloc.remote_dom = hardware_domain->domain_id;
>>
>> It is not clear why this is modified. There are only two fields in 
>> 'alloc' and they are both initialized.
>>
> 
> There are three fields in the struct, and the third is clearly to be set 
> by an initalization function. If, as above with 'path', the init 
> function ensures that the third field is always written then there's no 
> problem, otherwise this initialization prevents any use of an 
> uninitialized port.
> > struct evtchn_alloc_unbound {
>  Â Â Â Â  /* IN parameters */
>  Â Â Â Â  domid_t dom, remote_dom;
>  Â Â Â Â  /* OUT parameters */
>  Â Â Â Â  evtchn_port_t port;
> };
> typedef struct evtchn_alloc_unbound evtchn_alloc_unbound_t;

Ah, I didn't spot the third field because it was defined on the same 
line. I would prefer if the value is explicitely initialized to 0.

Also, I think this ought to be in a separate patch (with other similar 
pattern).

>>> Â Â Â Â Â  rc = evtchn_alloc_unbound(&alloc, 0);
>>> Â Â Â Â Â  if ( rc )
>>> Â Â Â Â Â  {
>>> @@ -3810,8 +3827,9 @@ static int __init construct_domU(struct domain *d,
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const struct dt_device_node *node)
>>> Â  {
>>> Â Â Â Â Â  struct kernel_info kinfo = {};
>>> -Â Â Â  const char *dom0less_enhanced;
>>> +Â Â Â  const char *dom0less_enhanced = NULL;
>>
>> If you look at the user below, all the callers assume 
>> dom0less_enhanced will be non-NULL. So it is unclear to me how this 
>> value is safer.
>> Â > Looking at the code, I wonder whether we should convert
>> dt_property_read_string() to use ERR_PTR(). So we could remove the 
>> last argument and return it instead.
> 
> Is relying on that assumption somehow safer? 

I am assuming you are referring to "If you look at the user below, all 
the callers assume dom0less_enhanced will be non-NULL". Note that I 
didn't suggest it is safer. I am only pointed out that you didn't 
specify how this was better in the context of the code.

> The suggestion to remove 
> the last parameter seems better.
> 
>>
>>> Â Â Â Â Â  int rc;
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  u64 mem;
>>> Â Â Â Â Â  u32 p2m_mem_mb;
>>> Â Â Â Â Â  unsigned long p2m_pages;
>>> @@ -3939,6 +3957,7 @@ void __init create_domUs(void)
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  .grant_opts = 
>>> XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
>>> Â Â Â Â Â Â Â Â Â  };
>>> Â Â Â Â Â Â Â Â Â  unsigned int flags = 0U;
>>> +Â Â Â Â Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â Â Â Â Â  uint32_t val;
>>> Â Â Â Â Â Â Â Â Â  int rc;
>>> diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
>>> index bb64925d70..25f39364d1 100644
>>> --- a/xen/arch/arm/efi/efi-boot.h
>>> +++ b/xen/arch/arm/efi/efi-boot.h
>>> @@ -117,6 +117,7 @@ static int __init setup_chosen_node(void *fdt, 
>>> int *addr_cells, int *size_cells)
>>> Â  static int __init fdt_set_reg(void *fdt, int node, int addr_cells,
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  int size_cells, uint64_t addr, 
>>> uint64_t len)
>>> Â  {
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  __be32 val[4]; /* At most 2 64 bit values to be stored */
>>> Â Â Â Â Â  __be32 *cellp;
>>> @@ -308,7 +309,7 @@ fdt_set_fail:
>>> Â  static void __init *fdt_increase_size(struct file *fdtfile, int 
>>> add_size)
>>> Â  {
>>> Â Â Â Â Â  EFI_STATUS status;
>>> -Â Â Â  EFI_PHYSICAL_ADDRESS fdt_addr;
>>> +Â Â Â  EFI_PHYSICAL_ADDRESS fdt_addr = 0;
>>> Â Â Â Â Â  int fdt_size;
>>> Â Â Â Â Â  int pages;
>>> Â Â Â Â Â  void *new_fdt;
>>> @@ -433,7 +434,7 @@ static void __init efi_arch_cfg_file_late(const 
>>> EFI_LOADED_IMAGE *image,
>>> Â  static void *__init efi_arch_allocate_mmap_buffer(UINTN map_size)
>>> Â  {
>>> -Â Â Â  void *ptr;
>>> +Â Â Â  void *ptr = NULL;
>>> Â Â Â Â Â  EFI_STATUS status;
>>> Â Â Â Â Â  status = efi_bs->AllocatePool(EfiLoaderData, map_size, &ptr);
>>> @@ -538,6 +539,7 @@ static void __init efi_arch_handle_module(const 
>>> struct file *file,
>>> Â  {
>>> Â Â Â Â Â  int node;
>>> Â Â Â Â Â  int chosen;
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  int addr_len, size_len;
>>> Â Â Â Â Â  if ( file == &dtbfile )
>>> diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
>>> index 3aa4edda10..aa0180ab5b 100644
>>> --- a/xen/arch/arm/gic-v3-its.c
>>> +++ b/xen/arch/arm/gic-v3-its.c
>>> @@ -192,8 +192,7 @@ static int its_send_cmd_mapc(struct host_its 
>>> *its, uint32_t collection_id,
>>> Â Â Â Â Â  cmd[0] = GITS_CMD_MAPC;
>>> Â Â Â Â Â  cmd[1] = 0x00;
>>> -Â Â Â  cmd[2] = encode_rdbase(its, cpu, collection_id);
>>> -Â Â Â  cmd[2] |= GITS_VALID_BIT;
>>> +Â Â Â  cmd[2] = encode_rdbase(its, cpu, collection_id) | GITS_VALID_BIT;
>>
>> Hmmm... How is this even considered as unitialized variable?
>>
> 
> The analysis here could use some more precision, but the modified 
> construct is entirely equivalent.

I agree that they are equivalent. But in general, we don't change the 
style of the construct without explaining why.

In this case, the first step would be to improve Eclair.

> 
>>> Â Â Â Â Â  cmd[3] = 0x00;
>>> Â Â Â Â Â  return its_send_command(its, cmd);
>>> @@ -215,9 +214,7 @@ static int its_send_cmd_mapd(struct host_its 
>>> *its, uint32_t deviceid,
>>> Â Â Â Â Â  }
>>> Â Â Â Â Â  cmd[0] = GITS_CMD_MAPD | ((uint64_t)deviceid << 32);
>>> Â Â Â Â Â  cmd[1] = size_bits;
>>> -Â Â Â  cmd[2] = itt_addr;
>>> -Â Â Â  if ( valid )
>>> -Â Â Â Â Â Â Â  cmd[2] |= GITS_VALID_BIT;
>>> +Â Â Â  cmd[2] = itt_addr | (valid ? GITS_VALID_BIT : 0x00);
>>
>> Same here.
>>
>>> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
>>> index c688227abd..a36068b2d8 100644
>>> --- a/xen/arch/arm/mm.c
>>> +++ b/xen/arch/arm/mm.c
>>> @@ -935,6 +935,7 @@ static int xen_pt_update_entry(mfn_t root, 
>>> unsigned long virt,
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_t mfn, unsigned int target,
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned int flags)
>>> Â  {
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  int rc;
>>> Â Â Â Â Â  unsigned int level;
>>> Â Â Â Â Â  lpae_t *table;
>>> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
>>> index de32a2d638..83c56cf1cb 100644
>>> --- a/xen/arch/arm/p2m.c
>>> +++ b/xen/arch/arm/p2m.c
>>> @@ -496,16 +496,18 @@ mfn_t p2m_get_entry(struct p2m_domain *p2m, 
>>> gfn_t gfn,
>>> Â Â Â Â Â  lpae_t entry, *table;
>>> Â Â Â Â Â  int rc;
>>> Â Â Â Â Â  mfn_t mfn = INVALID_MFN;
>>> -Â Â Â  p2m_type_t _t;
>>> +Â Â Â  p2m_type_t _t = p2m_invalid;
>>> Â Â Â Â Â  DECLARE_OFFSETS(offsets, addr);
>>> Â Â Â Â Â  ASSERT(p2m_is_locked(p2m));
>>> Â Â Â Â Â  BUILD_BUG_ON(THIRD_MASK != PAGE_MASK);
>>> Â Â Â Â Â  /* Allow t to be NULL */
>>> -Â Â Â  t = t ?: &_t;
>>> -
>>> -Â Â Â  *t = p2m_invalid;
>>> +Â Â Â  if( t ) {
>>> +Â Â Â Â Â Â Â  *t = _t;
>>> +Â Â Â  } else {
>>> +Â Â Â Â Â Â Â  t = &_t;
>>> +Â Â Â  }
>> What was the problem with the previous code?
>>
>> This is also not conformant to Xen coding style.
>>
> 
> The problem is that _t may be uninitialized, hence assigning its address 
> to t could be problematic.

But the value is set right after. IOW, there is no read between. So how 
is this prob

> Another way to address this is to initialize 
> _t to a bad value and use this variable in the body, then assign to t 
> based on the value just before returning.

IHMO, neither solution are ideal. I think we should investigate whether 
Eclair can be improved.

[...]

>>> Â Â Â Â Â  if ( valid )
>>> Â Â Â Â Â Â Â Â Â  *valid = false;
>>> @@ -1031,6 +1033,7 @@ static int __p2m_set_entry(struct p2m_domain *p2m,
>>> Â Â Â Â Â  unsigned int level = 0;
>>> Â Â Â Â Â  unsigned int target = 3 - (page_order / XEN_PT_LPAE_SHIFT);
>>> Â Â Â Â Â  lpae_t *entry, *table, orig_pte;
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  int rc;
>>
>> Can you provide some details why Eclair thinks it is unitialized?
> 
> Same issue with gotos explained above, can't be refactored because of 
> the for enclosing the goto.
> 
>>
>>> Â Â Â Â Â  /* A mapping is removed if the MFN is invalid. */
>>> Â Â Â Â Â  bool removing_mapping = mfn_eq(smfn, INVALID_MFN);
>>> @@ -1483,6 +1486,7 @@ static inline int p2m_remove_mapping(struct 
>>> domain *d,
>>> Â  {
>>> Â Â Â Â Â  struct p2m_domain *p2m = p2m_get_hostp2m(d);
>>> Â Â Â Â Â  unsigned long i;
>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>> Â Â Â Â Â  int rc;
>>
>>
>> Can you provide some details why Eclair thinks it is unitialized?
>>
> 
> Same as above.
> 
>>> Â Â Â Â Â  p2m_write_lock(p2m);
>>> @@ -1685,20 +1689,21 @@ static int p2m_alloc_vmid(struct domain *d)
>>> Â Â Â Â Â  ASSERT(nr != INVALID_VMID);
>>> -Â Â Â  if ( nr == MAX_VMID )
>>> -Â Â Â  {
>>> -Â Â Â Â Â Â Â  rc = -EBUSY;
>>> -Â Â Â Â Â Â Â  printk(XENLOG_ERR "p2m.c: dom%d: VMID pool exhausted\n", 
>>> d->domain_id);
>>> -Â Â Â Â Â Â Â  goto out;
>>> -Â Â Â  }
>>> +Â Â Â  do {
>>
>> I don't understand this change. How is this making better for Eclair?
>>
> 
> This is an example where the goto can be eliminated, which in turn 
> allows to automatically check the correctness.
If you want to eliminate the 'goto' then they are better way to do it. Like:

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index bc9c3ae25693..8771679dd5fc 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -186,16 +186,14 @@ int p2m_alloc_vmid(struct domain *d)
      {
          rc = -EBUSY;
          printk(XENLOG_ERR "p2m.c: dom%d: VMID pool exhausted\n", 
d->domain_id);
-        goto out;
+    }
+    else
+    {
+        set_bit(nr, vmid_mask);
+        p2m->vmid = nr;
+        rc = 0;
      }

-    set_bit(nr, vmid_mask);
-
-    p2m->vmid = nr;
-
-    rc = 0;
-
-out:
      spin_unlock(&vmid_alloc_lock);
      return rc;
  }

I have a slight preference with the goto version, but I could accept it 
if Eclair can't cope with the construct. In any case, this is the sort 
of change that deserve its own patch as you want to explain why Eclair 
can't cope with such construct (I don't view it as complex).

> 
>>> +Â Â Â Â Â  if ( nr == MAX_VMID )
>>> +Â Â Â Â Â  {
>>> +Â Â Â Â Â Â Â Â Â  rc = -EBUSY;
>>> +Â Â Â Â Â Â Â Â Â  printk(XENLOG_ERR "p2m.c: dom%d: VMID pool exhausted\n", 
>>> d->domain_id);
>>> +Â Â Â Â Â Â Â Â Â  break;
>>> +Â Â Â Â Â  }
>>> -Â Â Â  set_bit(nr, vmid_mask);
>>> +Â Â Â Â Â  set_bit(nr, vmid_mask);
>>> -Â Â Â  p2m->vmid = nr;
>>> +Â Â Â Â Â  p2m->vmid = nr;
>>> -Â Â Â  rc = 0;
>>> +Â Â Â Â Â Â Â Â Â Â Â  rc = 0;
>>> +Â Â Â Â Â Â Â  } while ( 0 );
>>> -out:
>>> Â Â Â Â Â  spin_unlock(&vmid_alloc_lock);
>>> Â Â Â Â Â  return rc;
>>> Â  }
>>
> 
> 
> Considering all of the replies above, a first draft of a strategy/policy 
> I can think of is having:
> 
> - Initializer functions that always write their parameter, so that the 
> strongest "pointee always written" property can be stated. This causes 
> all further uses to be marked safe.
> 
> - Initialize the variable when there exists a known safe value that does 
> not alter the semantics of the function. The initialization does not 
> need to be at the declaration, but doing so simplifies the code.

As I mentionned in private there are two risks with that:
  1. You silence compiler to spot other issues
  2. You may now get warning from Coverity if it spots you set a value 
that get overwritten before its first use.

So I think such approach should be used with parcimony. Instead, we 
should look at reworking the code when possible.

> 
> - Deviate all cases where any of the previous does not apply, with a 
> comment deviation that refers to a justification reporting that the code 
> has been checked to respect the rule (keep in mind that _violations_ to 
> a Mandatory rule such as R9.1 are not allowed to claim MISRA compliance).

See above for my concern about adding so many deviations. But I am 
confused with what you wrote. If the rule is mandatory, then why are you 
trying to add deviation in Xen? Who is going to solve them to make Xen 
MISRA compliant?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 13:44:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 13:44:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564567.882072 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOWJ-0003nK-HH; Mon, 17 Jul 2023 13:44:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564567.882072; Mon, 17 Jul 2023 13:44:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOWJ-0003nD-Ed; Mon, 17 Jul 2023 13:44:11 +0000
Received: by outflank-mailman (input) for mailman id 564567;
 Mon, 17 Jul 2023 13:44:09 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLOWH-0003n3-N0; Mon, 17 Jul 2023 13:44:09 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLOWH-0007PB-8f; Mon, 17 Jul 2023 13:44:09 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLOWG-0003eH-TM; Mon, 17 Jul 2023 13:44:08 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLOWG-0007ZE-Sn; Mon, 17 Jul 2023 13:44:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=RlqaOYp5SxmOuUJMjU9PV7sfX46p1lyhLu2oBhr1x7w=; b=zL77Ojt7Y4rJDw+Uu2awcAHimN
	avrt8qT+2rTBAt+9FA4uRf7aHUkPMZASw5h0tU4E6bDqUga1V9pMhSrti2Nj5CBx2mYg0A42TIyZm
	qUbW15kky8be3SRiwVI+LOxk6EcAQ5a49xOfrlH3cwDeg7YO3yVcStmaxGx0m75hIb04=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181810-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181810: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-xl-vhd:guest-start:fail:heisenbug
    xen-unstable:test-amd64-i386-xl-qemuu-ovmf-amd64:xen-install:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=d27d274ffab06b42e5680073db11b592d282d53d
X-Osstest-Versions-That:
    xen=d27d274ffab06b42e5680073db11b592d282d53d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 17 Jul 2023 13:44:08 +0000

flight 181810 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181810/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-vhd      13 guest-start      fail in 181801 pass in 181810
 test-amd64-i386-xl-qemuu-ovmf-amd64  7 xen-install         fail pass in 181801

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181801
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181801
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181801
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181801
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181801
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181801
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181801
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181801
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181801
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181801
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181801
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181801
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 xen                  d27d274ffab06b42e5680073db11b592d282d53d
baseline version:
 xen                  d27d274ffab06b42e5680073db11b592d282d53d

Last test of basis   181810  2023-07-15 06:34:58 Z    2 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 13:45:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 13:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564572.882082 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOX9-0004KD-Rv; Mon, 17 Jul 2023 13:45:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564572.882082; Mon, 17 Jul 2023 13:45:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOX9-0004K6-Oe; Mon, 17 Jul 2023 13:45:03 +0000
Received: by outflank-mailman (input) for mailman id 564572;
 Mon, 17 Jul 2023 13:45:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLOX8-0004Js-Do; Mon, 17 Jul 2023 13:45:02 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLOX8-0007QP-Ct; Mon, 17 Jul 2023 13:45:02 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLOX8-0003fx-49; Mon, 17 Jul 2023 13:45:02 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLOX8-0008Vv-3T; Mon, 17 Jul 2023 13:45:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Ttq6hgMmgZ1ViKGlRoVwaWyYnPCkbVgIeH3x0GdtVH8=; b=rVlj7C79VB/3qwtdafwsGKdPYR
	T0/q2xIk72diGHMY75qLTy0UZSWXDq0TSsbiRFsjdhbEch9XNOm6FRJVgoSYUw///v/UsUBIjGw2a
	Ih5fCh6MVFs0xip8IJqbiK7zULHqiJCi6D9lkzQHJfnrXx8YjnH5ky7Y/sObUTIEsb1c=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181833-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181833: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=39ded59c09a38cb17cee498fca9f390c4deca98a
X-Osstest-Versions-That:
    ovmf=3399f64588428010d48c754f3743bdc8131fa270
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 17 Jul 2023 13:45:02 +0000

flight 181833 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181833/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 39ded59c09a38cb17cee498fca9f390c4deca98a
baseline version:
 ovmf                 3399f64588428010d48c754f3743bdc8131fa270

Last test of basis   181830  2023-07-17 04:42:10 Z    0 days
Testing same since   181833  2023-07-17 06:40:44 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Ceping Sun <cepingx.sun@intel.com>
  Gerd Hoffmann <kraxel@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   3399f64588..39ded59c09  39ded59c09a38cb17cee498fca9f390c4deca98a -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 13:46:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 13:46:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564577.882092 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOXv-0004sW-3k; Mon, 17 Jul 2023 13:45:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564577.882092; Mon, 17 Jul 2023 13:45:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOXv-0004sP-1G; Mon, 17 Jul 2023 13:45:51 +0000
Received: by outflank-mailman (input) for mailman id 564577;
 Mon, 17 Jul 2023 13:45:49 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qLOXt-0004sF-Qy
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 13:45:49 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLOXt-0007Ro-37; Mon, 17 Jul 2023 13:45:49 +0000
Received: from [54.239.6.185] (helo=[192.168.23.25])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLOXs-0000gJ-Qz; Mon, 17 Jul 2023 13:45:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=FLR4dplDpUC6ZXveFYhYw5cA7ylv9KJfGNAf6Xjr5bU=; b=6PzeuLG4mCBLGLOEChR3hclCgm
	ZDu7+yeuhLd5yhQSnrqTzMxPZg4ABnT1Y9diFPVhlEkmPu4H1d++5AomE1giwqBb6J2TE9Gl91bkC
	jRlkJBN51282YH8i3bAVXXvI9gqPmichEpA5SxPKPQ8qaPzahXDkKEGlGhhjOY9RZwMw=;
Message-ID: <47629f09-92ef-24e5-365e-0d1b8f723bd2@xen.org>
Date: Mon, 17 Jul 2023 14:45:46 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 Luca Fancellu <Luca.Fancellu@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 "xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
 "ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
 "consulting@bugseng.com" <consulting@bugseng.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
 <d1ccb5e1-d122-88df-e46a-39494b6d6d12@xen.org>
 <299D0BAE-D15E-4260-AF3E-8D84CF058083@arm.com>
 <528fb310-f469-e449-d1c3-269fa7dec750@xen.org>
 <2bc64be1-10c0-d064-a5a2-1f076b596e6e@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <2bc64be1-10c0-d064-a5a2-1f076b596e6e@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 17/07/2023 13:16, Nicola Vetrini wrote:
> 
> 
> On 16/07/23 18:50, Julien Grall wrote:
>> Hi,
>>
>> On 16/07/2023 10:20, Luca Fancellu wrote:
>>>> On 14 Jul 2023, at 14:05, Julien Grall <julien@xen.org> wrote:
>>>>
>>>> Hi,
>>>>
>>>> On 14/07/2023 12:49, Nicola Vetrini wrote:
>>>>> The macro 'testop' expands to a function that declares the local
>>>>> variable 'oldbit', which is written before being set, but is such a
>>>>> way that is not amenable to automatic checking.
>>>>
>>>> The code is pretty straightforward. So I am not entirely sure why 
>>>> Eclair is not happy. Is it because the value is set by assembly code?
> 
> Exactly.

I am a bit puzzled. There are other values read from assembly (e.g. 
READ_SYSREG(), read_atomic()) within Xen. This is including 'res' in the 
same function. So can you elaborate, why 'oldbit' is a problem but not 
the others?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 13:49:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 13:49:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564581.882102 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLObG-0005a3-IZ; Mon, 17 Jul 2023 13:49:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564581.882102; Mon, 17 Jul 2023 13:49:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLObG-0005Zw-Fu; Mon, 17 Jul 2023 13:49:18 +0000
Received: by outflank-mailman (input) for mailman id 564581;
 Mon, 17 Jul 2023 13:49:16 +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
 <SRS0=RVQe=DD=citrix.com=prvs=555fa4c0e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qLObE-0005Zo-Hi
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 13:49:16 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b63e3f7d-24a8-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 15:49:14 +0200 (CEST)
Received: from mail-sn1nam02lp2042.outbound.protection.outlook.com (HELO
 NAM02-SN1-obe.outbound.protection.outlook.com) ([104.47.57.42])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 17 Jul 2023 09:49:02 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB6549.namprd03.prod.outlook.com (2603:10b6:a03:386::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 13:49:00 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 13:48:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b63e3f7d-24a8-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689601754;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=cvwfUO5wNu8Z2w8B3/uQVdK9NMclrI1QtWw4wmaKY/I=;
  b=GNTFFDteFBlvtofKzEOAq9iwNCJtAOy4pT8/U03bQlw8Ug1GjVrdXLfR
   pfiEqGIMDkkGwzAkjY4iAPXWVrty/6vqDpt9oX+oaW5lfVdqBUsH2nhuV
   Z+6GJUkAMZbS+oPABXCTnXiljH1tJWueHgAUcjqRt5zPOg+VKXacf85aL
   s=;
X-IronPort-RemoteIP: 104.47.57.42
X-IronPort-MID: 119051349
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:CgVq+6MIBhKOVcTvrR2AlsFynXyQoLVcMsEvi/4bfWQNrUoq32AEx
 jdOWmCGbKnfMzbxeI91PIrn9kxVvpLUytcwGwto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v
 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/
 Nj/uKUzAnf8s9JPGjxSs/vrRC9H5qyo42tH5wNmPJingXeF/5UrJMNHTU2OByOQrrl8RoaSW
 +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ
 HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0tlMK2JW9
 uEIFDAISxS4v8mdyo68c+Y506zPLOGzVG8ekldJ6GmDSM0AGNXESaiM4sJE1jAtgMwIBezZe
 8cSdTtoalLHfgFLPVAUTpk5mY9EhFGmK2Ee9A3T+PVxvzK7IA9ZidABNPLPfdOHX4NNl1uwr
 WPa5WXpRBodMbRzzBLcqyP027aUwXKTtIQ6FKaY39cx336oyjYwMBYYd3KwsablhRvrMz5YA
 wlOksY0loAi+UruQtTjUhmQpH+fogVaS9dWC/c96gyG1uzT+QnxLncAZi5MbpohrsBebT4lz
 FiShPvyGCdi9raSTBqgGqy8qDqzPW0OKzYEbCpcFw8duYG/+sc0kw7FSctlHOitlNrpFDrsw
 jeM6i8jm7EUis1N3KK+lbzavw+RSlHyZlZdzm3qsqiNt2uVuKbNi1SU1GXm
IronPort-HdrOrdr: A9a23:Qef5Aqykf3thkdQ4ghChKrPw3L1zdoMgy1knxilNoHxuH/Bw9v
 re+8jzsCWftN9/Yh4dcLy7VpVoBEmslqKdgrNhWYtKPjOHhILAFugLgbcKgQeQeREWntQ36U
 4KSdkaNDSfNzlHZcaR2njFLz4jquP3j5xBU43lvglQpQIBUdAQ0+9gYDzrdHGf3GN9dOAE/J
 z33Ls/mxOQPU45Q+6cHXc/U+3Kt7Tw5e/biU5vPW9e1OGW5wnYk4LHLw==
X-Talos-CUID: 9a23:d3sYqWxB40qyIFtxfwRiBgUrIeoman7A3EvQJmq8Ml5CY7epTmafrfY=
X-Talos-MUID: 9a23:CfX65AjDXc2dUbJz+KIZL8MpNNxIyo31V2M2nc8lg8KKFwV7K2jBg2Hi
X-IronPort-AV: E=Sophos;i="6.01,211,1684814400"; 
   d="scan'208";a="119051349"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=UiFJvCTYMdnHYwZpwstOjBKQXQKjPFYXU9dffbBvh5BeaSmwPgFZdw+ZhEEpYRJZI5dPau9dBjD0IJIneQvaDQGHPds3A9m8mTlLfQpq2BQ4QHXQ07BCY0ZMxIvV+tpUW+uY95oHMp24ihVsgLDJNWzWVjpWUEgJFWzqeWd2ofxJFVSRI0gEhAyFD4Jf4pmD3aujo46A1T0u1kE+Xs4oz6+KTWwMK8B/rUq2neQD6URe2Q1BtTkVo7+tlRkfM8ZKS6blkCrXBANj3452Ha51eJZgcA55aMKZ5WCvc9GbzU9i1rLg+oOWWcMD3eLCMPiCbec34V1bdjmcJyVLTIZvkQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7mcp3wEPnZ7rV3MUjZ1ALwGHSE+qdvWmUUEoyZC9CGY=;
 b=IgFYsZC/6wPt2FInIq2Igon3pdYlfXfM+P4s9nKEE2QhTKPbQkMGA/74w2tm6xjVGFGXBZRJmzrSyhLtI4+N1znEa7e7rTmdizy2i7n4uHZZCL9jTWr63IPOI6HvJDQywmaI+VZ+ykL0tnzRo1eL2OhwkGmktOw1zQSrZC+mPekVEbNnEjqzL2YK5+byijRN66qSPTSyxM4HQy4huk9J3C6x5Zp4UtIPIFCoehl6RulWGzd9FmbMibUxuo2PWWn2Rr4GJtzmMj+SLZ6sqZjJKp0XJmfK6mPydv6Ogxay/+AumkLXBsuO22f2tjzqShzF8GgPLdDIMvcMw4quVUpZQg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7mcp3wEPnZ7rV3MUjZ1ALwGHSE+qdvWmUUEoyZC9CGY=;
 b=Js1z3sjA2AA+5iZJWTE2zKV/yPSIwucnrC7Kh+JWpUkOo968lOzWgCIDyTh56n/vwxtmxY/vaBjuypz3kMgPazWKK+ybwZHP1dL3FRGzxcusUo0FdtvH5aJiuEckp5BWWCqEbe96IeIneRVJ0uIXffa2R5yZQzEMEa0tqLrjYtQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Mon, 17 Jul 2023 15:48:53 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v2 1/6] libs/guest: introduce support for setting guest
 MSRs
Message-ID: <ZLVGxe8mrvThUXJ8@MacBook-Air-de-Roger.local>
References: <20230711092230.15408-1-roger.pau@citrix.com>
 <20230711092230.15408-2-roger.pau@citrix.com>
 <6cb49c4c-b355-38a0-5d96-9ca4938ac145@citrix.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <6cb49c4c-b355-38a0-5d96-9ca4938ac145@citrix.com>
X-ClientProxiedBy: LO2P265CA0148.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:9::16) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB6549:EE_
X-MS-Office365-Filtering-Correlation-Id: 018364de-6616-48bb-6792-08db86cc92b2
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	50OYaoK/38huoAZFqTb4b4ag36FSfuMH49y3CuSlQwG8+zV3GWv3PQgKS1tdYuQU2htBcfZJ6hpYtUneCSlq7s/OqmWNbmhCimARdJmYTT9Sa3G7e7pPj/JICJBzHT7ocymStSIEkb4A5rpoLu53YLSkpGJSpUS6vYIJzx+BK5pUgUJxP6cF7Cdc6b3Ak//AKwy/vB6jk+WUBEdLAtRy2XpXJ4JjlAgNnppPye1IjOvGpZrq8+XdwI3v0hm53S8Fukh8Zd8MQkjO4IKk55Fzxt4zo37AhZo0gN9CV2tF/OKMNAEyehUYawQKPU8uQfUmUfF1aXf20hM7g8LwsM/vB6RJWc4+GZcslDtZNpyeyVDT8fEM4DFxkhea+XtnGbFHM2RXAkjyjagXd+wCVUdJz0gMl6tnbu1UO9PQ8CEn3I6Mx6bmM2JZzwgBfeou8hGmNehFD2Bqq18IZZqTpD1b7MHEjwXN+kZlB3glcWiE5r9nPwAYYZ28HfWwiHNiZOLm+Xj9f93KjoaN5u0tpo1TYjK15noJm5HC8kRmeCNjK3DPUy7qKF2bqFjf89cSR/px
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(396003)(346002)(366004)(39860400002)(451199021)(26005)(478600001)(82960400001)(6506007)(53546011)(6486002)(6512007)(9686003)(6666004)(41300700001)(8936002)(6862004)(66476007)(5660300002)(66556008)(4326008)(6636002)(316002)(38100700002)(8676002)(66946007)(86362001)(2906002)(186003)(85182001)(54906003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bXYreC9haWsvWGZ6VExoL3gzQkZlUCtUMG9kRC9JdnBwMUtoejNhbXlnNmx6?=
 =?utf-8?B?dnZTT3V1VUFrWXBuNlJmeTV1WTl5aVRmVWFNVFRxMFBKZHJ6UG9nQjVxY3ZT?=
 =?utf-8?B?N2V1bHlVbmtuL2RCYlk2NEM4Qys0Rmd2cFRwc3lLclJleU50QkU5TGIrSmlP?=
 =?utf-8?B?T3o4cElQUzdiSFBQaTJCdkxBNHp4d0RZU241QlpMSHU5WThkZE9IRGdWemQy?=
 =?utf-8?B?UzFyQ1BRdlpxSjZrTVRUWC92OUpWRDNKdmxvcHkwZ1E2bFNWcE5ndC9HcVU5?=
 =?utf-8?B?TTk4bTJIZnRHakVTam1IOWdSTjJmdXdBK0pmRVpncjJXajV0UHF3eW5yWGpM?=
 =?utf-8?B?NnZNSGtVZWlyT3dINndUSFExS0pCTE5lekRKV3ZDTWRzWDdic2FBVUZuNGxO?=
 =?utf-8?B?dDdXMHB4eG9NckNpd2hKV05YS05nNnZyaXJIYWpWeGhVOX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Hop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	t7cXFNAwTksLDWADwz90hMu/PlEw5nYP9ML2MIpA08wlpDVh+TJAPW30l+N9dd2AdgaxS0J/rhK0F0vYeK7Q58A/38ucDUG9rzGCIZQ9y5+jR69Q3WCrpm9AW+0tFsYc9a8eZXFF9Q1Vxqc6BcYlYFoxQsAHa1hchHbRdkkLQgntVhhO08cSJv7pM3t/TFnHDW1+Aw0IajwNJ4N8DSRa55YoegmbdlJsLBRmFZso+Gmc64XIhKeMG5Ua8XKFltaPQFakuwnJtDyrY9jXmo+wnQy61MubwmNJOm8IYsIF6P8f+N9aQ5YHqVOMW3ggFddwupMjBz1ijVbwPnJailk2txnCs8xbMApe9PZVmQQFSKXZY7QziTaVHJzGIVeKY0lEqPAvqChosqfmbP69j2bI44HZfdicakmsz6zFM2QWEhwzunNnfyeFWp8eUGA7cnUtussCQfWUzpj1j3d/hZ6V4QhacsqOyFU9mZmoLJQMCxttg25qfh+Tm9s+fMNSyjt2MjQtw3fNjZqdT/Bmrib5oIx9j+lZf/FMa+OkH4QDS4P7gBUcxV8aD8az67sB6skVcqmF/mn4OkfG+EYVuN1D7uYpxmcWXFHrlJVMPEN1/weyRmE4bIDaMM+fb3b/7cbTNfvQbe22vSd6cEYEW7Kce/13d/gsZs2uv1SUuUcpMp6XxV++FqX3hoWwU0tTa55zNdda5Fo7K4v9uGqrKI1syUnbCCQo6CwtkHMrl+yR/1bRNpUAa/MasNkxfKiQlW1NN63zt/rkk9uRB2TcJN1Tt0CbhO0r+ChVPBBv7/adkdiyZfiWHPiUgsDNB/OfqK4q
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 018364de-6616-48bb-6792-08db86cc92b2
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 13:48:59.7874
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: E9KmrVS1C0OeOLadZDTYYl8gPOpCyy61zoRtDfJHVTUBgGCuU+XLj+AWisv7tlebI9kCkOSIGRTk4pednVnPQg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB6549

On Thu, Jul 13, 2023 at 04:14:30PM +0100, Andrew Cooper wrote:
> On 11/07/2023 10:22 am, Roger Pau Monne wrote:
> > diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c
> > index 5b035223f4f5..5e5c8124dd74 100644
> > --- a/tools/libs/guest/xg_cpuid_x86.c
> > +++ b/tools/libs/guest/xg_cpuid_x86.c
> > @@ -423,10 +423,169 @@ static int xc_cpuid_xend_policy(
> >      return rc;
> >  }
> >  
> > +static int compare_msr(const void *l, const void *r)
> > +{
> > +    const xen_msr_entry_t *lhs = l;
> > +    const xen_msr_entry_t *rhs = r;
> > +
> > +    if ( lhs->idx == rhs->idx )
> > +        return 0;
> > +
> > +    return lhs->idx < rhs->idx ? -1 : 1;
> 
> The sum total of logic here is just
> 
> return lhs->idx - rhs->idx;
> 
> (I think.Â  Double check which way around the subtraction works.)

Since MSR index is a 32bit value, what about one index being ~0u and
the other 0u: the result would then wrongly be -1 ((int)(~0u - 0u)),
when it should instead be a positive value to denote the left hand
side is greater than the right hand side.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 14:00:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 14:00:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564592.882112 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOlX-0007CE-LT; Mon, 17 Jul 2023 13:59:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564592.882112; Mon, 17 Jul 2023 13:59:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOlX-0007C7-Ie; Mon, 17 Jul 2023 13:59:55 +0000
Received: by outflank-mailman (input) for mailman id 564592;
 Mon, 17 Jul 2023 13:59:55 +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 <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLOlX-0007C1-6Q
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 13:59:55 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on2061e.outbound.protection.outlook.com
 [2a01:111:f400:fe13::61e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 338f20a4-24aa-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 15:59:52 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB8PR04MB6825.eurprd04.prod.outlook.com (2603:10a6:10:112::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 13:59:50 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 13:59:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 338f20a4-24aa-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KPC7EmbbzjpNI6mbQZAOAFHtEKHL3sUU1+f+vC9/A9tg+76QFkud//xl0EwSBwMOdWYNuRuW3ZJDETxaRnmsUMvRVtRktP5sn9ik6FmCor3H8KcDSag87sEEriM2hwn65Gbi9voHSHyoB86NCWVqWJ137A98jKVn5VoHRl313+RD27Gnhx7cMp4M/mbvbF8PpPuG6ac3SsQ8B+osfi/MHsoafSxywwxKUNzh9zuPINm47VphOVcB0YRGaR9UX55rv47PbkCD8GsCaRvuXiDE9NCu/I7cImww5mzV2dsnpMAlbSS3Fp2zScRHO9l7n3ChzcNCC37A6XF96SG/uc95tg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=hDOT4txEf9S3aTzHJgVmN46yiEOzZHCUO5YUeLGivGw=;
 b=Z2ohyKBxByu8eu2c1QPuL470ljRH0ZpGDTeS3MULf62QedSROaGZVrjqEqqFhrRX6DHmk8B6AexlzuHL9ZwsMs0wuXiw7+taS5FLJCJoJJcz7vmoZshN7atPN0wtRZpiSEm5i7SO36ElugE9arVzlfgcHCC/qsbcmhnGcWZWPvsYOab0NC70l/BDImKbT1bhHmnWbyh/p1q7KXa+KpidX9fYq/2MgQ70mzHokEf42BrPx8/nJlMk92M3VD7MuKO6h61naLE9HByox78i2StrmgGDNRt1gIA6mRHtU8sGzMzZwIjeytbp+kqMGUIC6J6Kq6ZPDbdsb7Ag4yTwQGzW5A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=hDOT4txEf9S3aTzHJgVmN46yiEOzZHCUO5YUeLGivGw=;
 b=B9olksETMgSb+XWMDkqWSH6Spvu1afbTRayj9x/s124+576H/+wC1D9gfrbIl/9Nq1HzUeOI9Q24l3Irl7g9fSzKDcWE1xZdPJpJbxeg/metMd5B7TXPQwNL4eCAHo3wpTSD7vwzUfHP7S4pDMku6ZBw9oxC39MawXPKaam9/ZNEMpp8b/Na9V27SRTVocijXlZ/tmJiGwJ4LzeHtDdFyrzmVDzsxDRrS1K8Ggy7m+IH0TYkV18uWtJdMCWOIPRpfg9bVXxPNvwC8EitDhSRNhViMvMsKsiSimcxkkFSRHjYVceJAg2VbixKgMO/GT8sy5p1g2fV6PhtA/yuoU0RlA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <f24d12ec-3edc-5aea-f399-05ed52ec1cbc@suse.com>
Date: Mon, 17 Jul 2023 15:59:47 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
Content-Language: en-US
To: Luca Fancellu <Luca.Fancellu@arm.com>,
 Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 "xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
 "ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
 "consulting@bugseng.com" <consulting@bugseng.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
 <CB1B8DB0-7708-454D-9E73-171CA894E304@arm.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <CB1B8DB0-7708-454D-9E73-171CA894E304@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0106.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a8::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB8PR04MB6825:EE_
X-MS-Office365-Filtering-Correlation-Id: 6a32ac89-eaef-4b5b-b159-08db86ce1659
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	/sgyiPA/6bQb9gzMgLGVsWR/hUKarbQDv+kGjpP6DcxQH9hS2QsZ0QVIHYn2NCksMvxvmlCNLewUZlnLl3TmEQ2Jc1m/Qw4r/nGAj3OPzpte/q2vr2e5dZhydA0eG6OMy5vJnmiVk7TALURlCsUJsBfJYe5PsTykAU3SNM8ctzPRnWgehQs/EU1u41etI0+mPOSJzgSm4tx+gdhusSvyeJPtifJTTldtLkvzCR7DWf6IqxEOP8WTPvsZu8mpIl8aAZYDAuxw4Za4zNu8C4Yq15zV5KN3I/itZIX07u3bLbd3znoDjGALK+NyrJIKWXAYEZHUGBY++sBqLGBJBMuvaRvrgOMlIdyKkATHh/m4l68X/dhKBfvgqK1DXYAx3fFS5H6OvRIKTnrM0WT9MVikmDZHxslKHlx7541JGEKx/thVJe2x68UVfsdNdJkVwBriTyp7QNju08HWswlJEuTVu6FH0rUAyD2Lp145tdSbGmwgoYDo6+ZbcHZ3smbyv5mI+HtcWqzIucw5LUsUu96ZHBa8AowCsk7BbQvQf/1GN4SMxOegr/tdnWLv+DdIBLY1Mdl6wdbNWWsTyr6jAwNxEqOVLdtH+a0BVvJpqkK5Xe7CK80oSPbbZJ7Oa7GQqiqrsQxMwZC8Z/VSm+TI3tPmEg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(346002)(396003)(366004)(136003)(451199021)(6486002)(6506007)(53546011)(26005)(6512007)(36756003)(2616005)(83380400001)(31696002)(86362001)(38100700002)(186003)(8676002)(8936002)(2906002)(41300700001)(478600001)(7416002)(4326008)(316002)(5660300002)(66946007)(66476007)(66556008)(54906003)(110136005)(31686004)(6666004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UTZFUlRqYktzdGQzbHRoQjMwdVFUS2xqanY2Q2x5Nk9tQmtMc3NuV3NieVFu?=
 =?utf-8?B?aXJ5MnZGVTVNbVNqcTZwNXZBd25WZUFtZmN6VnV0ZzArQzdkSVZ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l4Vk9hOFdsa1FDR1QyMDNLVlFocEFPTVM4VkNlbllGVGR5?=
 =?utf-8?B?NVhoQWJoQXZUL280eExmVGtQWTQxNDAvNnlaM0R4YnBlZ05hSklmUHdyd0JK?=
 =?utf-8?B?amRKTjRuMVlOYjlYSDBDbFRpcVFKckkvd3VnQUNmbDFGeGpMSzFOakxmbitj?=
 =?utf-8?B?bkhhVFlBRDRzLzU4WGtTT1lVaEt2WWVEU2FWVTBlckJNQ3ZxZDI2TnpESS9L?=
 =?utf-8?B?RnFhOFJpMGtvWndIUlh4QjJHWTV0R1g2Z0p1YSsxd1poL29mQUNHZmJqQ0lF?=
 =?utf-8?Q?IA/+wmFZYZ7PfnijNfK1sjGU0?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6a32ac89-eaef-4b5b-b159-08db86ce1659
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 13:59:50.0680
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Ts5zJ4txgIo6ArWDlRxmwvY4Y5nqUp78471v9lh03tADWgJ5BknfFu3ssfwl1EOpDPPhjUdwIElXjLEOcJOcKw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6825

On 14.07.2023 16:20, Luca Fancellu wrote:
> 
> 
>> On 14 Jul 2023, at 12:49, Nicola Vetrini <nicola.vetrini@bugseng.com> wrote:
>>
>> The macro 'testop' expands to a function that declares the local
>> variable 'oldbit', which is written before being set, but is such a
>> way that is not amenable to automatic checking.
>>
>> Therefore, a deviation comment, is introduced to document this situation.
>>
>> A similar reasoning applies to macro 'guest_testop'.
>>
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>> ---
>> docs/misra/safe.json                     | 16 ++++++++++++++++
>> xen/arch/arm/arm64/lib/bitops.c          |  3 +++
>> xen/arch/arm/include/asm/guest_atomics.h |  3 +++
>> 3 files changed, 22 insertions(+)
>>
>> diff --git a/docs/misra/safe.json b/docs/misra/safe.json
>> index 244001f5be..4cf7cbf57b 100644
>> --- a/docs/misra/safe.json
>> +++ b/docs/misra/safe.json
>> @@ -20,6 +20,22 @@
>>         },
>>         {
>>             "id": "SAF-2-safe",
>> +            "analyser": {
>> +                "eclair": "MC3R1.R9.1"
>> +            },
>> +            "name": "Rule 9.1: initializer not needed",
>> +            "text": "The following local variables are possibly subject to being read before being written, but code inspection ensured that the control flow in the construct where they appear ensures that no such event may happen."
>> +        },
>> +        {
>> +            "id": "SAF-3-safe",
>> +            "analyser": {
>> +                "eclair": "MC3R1.R9.1"
>> +            },
>> +            "name": "Rule 9.1: initializer not needed",
>> +            "text": "The following local variables are possibly subject to being read before being written, but code inspection ensured that the control flow in the construct where they appear ensures that no such event may happen."
>> +        },
> 
> Since the rule and the justification are the same, you can declare only once and use the same tag on top of the offending lines, so /* SAF-2-safe MC3R1.R9.1 */,

+1

I'm puzzled by the wording vs comment placement though: The comments
are inserted ahead of the macro invocations, so there are no "following
local variables". Plus does this imply the comment would suppress the
checking on _all_ of them, rather than just the one that was confirmed
to be safe? What if another new one was added, that actually introduces
a problem?

> also, I remember some maintainers not happy about the misra rule being put after the tag, now I donâ€™t recall who

Me, at least. The annotations should be tool-agnostic imo, or else the
more tools we use, the longer these comments might get.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 14:07:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 14:07:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564598.882123 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOsJ-0000OX-CO; Mon, 17 Jul 2023 14:06:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564598.882123; Mon, 17 Jul 2023 14:06:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOsJ-0000OQ-8j; Mon, 17 Jul 2023 14:06:55 +0000
Received: by outflank-mailman (input) for mailman id 564598;
 Mon, 17 Jul 2023 14:06:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLOsH-0000OC-Ov
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 14:06:53 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on0616.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::616])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2e28983a-24ab-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 16:06:53 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8080.eurprd04.prod.outlook.com (2603:10a6:102:1c9::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Mon, 17 Jul
 2023 14:06:51 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 14:06:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2e28983a-24ab-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BSRPvNlcme3jzqx6cWnn4PyHbCeQrTqhPyXfuwUL/r2PrlusvoSOAvskkuTzMi31Oc37SxQ0Q+EtkWoJ4lLPZQt0C94v0FkPRtEh569R7UGZrSyaNw6klS40DEdxZL2dOVBNiZ38oaM/OGhjV6oTDVWcySUYy7ZfhhTFZHCHJCgW1pOI2kKqRf7IiAsRRH9rILbeZMxGmuoMeMAkS8EfhWlDPGxZgguzsgK7dm1+fXnYnI4sPVyUs9ww1QN4N8137BRz1+HRLM+Dvw3utOtXKqMV0JcTuJ2iwotuHxHzyLXCp8DiA2/uwPn6thjrEDGOL1+qvBZwrz/RHEWSGYOHcA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=fDQwFQvoBbaOdP0pTUMUdLxHIzx+97Dnw/VxFzR7lOw=;
 b=mRzIuElab8BERFOlQP1c1oOjMaPwNA4XjotwC8gPBvx0SzJZp/7bb9ZRdOd4+opx6RVmj3cvAzmvDq/+pPejX3lh6HuL0R/fZmNb4lef4bBM+PckWIU673hes5ojxB2ipJIMXWYrTSC4Lri/KNkLiUobpuT4wLoGRevePu96pHUsFjhyeErIrPDONnxJd3BuJp3u91jWUWUtVT8Bi0zZXYqZ6uy676o3alsSua22M5Z9sa4ZTKJd4I236r0IFs4SvNNBEeDNAe2bBC2lWJFDcOKoYi9TzeDyLTJeMFVnmKmfNHAJRgnDpElmKMGBwObKrT+8FtprBvO9uUYXXNeqrQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fDQwFQvoBbaOdP0pTUMUdLxHIzx+97Dnw/VxFzR7lOw=;
 b=FQq1+rm0Gay0wDMKzzbZWBRpVyObtS1TQ6vcSUXT4G1g/Gd8YYiDpCv6tEo3lf4XW/w/4NrqyYJbwmUqsdJXn2csZyLIXFi/0KvcXRGSQAcLMeW7kfxFAN4Cg80TgFNxuTLZMmqsxTrEsMAFmY35YZI+pfrVXJZmcsTH9WU9Hgh0ZXI+ezspO+taE0jFnVXcgC5IVSu8rD4yuXsAEP87yUnlrCcBwto3sxkNQ/I3o24qLrDnWTNVyH10uKPdL5432VzfscB5LZUH1Lb3zhOPgluLKNwArrxFc9Hscy3U4/Cm+eButhEudMcMmeOKZHxpFs5MvZYMtH9Ybnaf+BlXcA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <c89d59de-4aaa-7b60-181d-5c3658181b3a@suse.com>
Date: Mon, 17 Jul 2023 16:06:48 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 "xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
 "ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
 "consulting@bugseng.com" <consulting@bugseng.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Luca Fancellu <Luca.Fancellu@arm.com>, Julien Grall <julien@xen.org>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
 <d1ccb5e1-d122-88df-e46a-39494b6d6d12@xen.org>
 <299D0BAE-D15E-4260-AF3E-8D84CF058083@arm.com>
 <528fb310-f469-e449-d1c3-269fa7dec750@xen.org>
 <2bc64be1-10c0-d064-a5a2-1f076b596e6e@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <2bc64be1-10c0-d064-a5a2-1f076b596e6e@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0072.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4b::23) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8080:EE_
X-MS-Office365-Filtering-Correlation-Id: 5484958b-e5a3-4172-3503-08db86cf112f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	P9vX/63WarB6wMO89hSa6ZuZHqv5/Vf8svCmG5iGCrxj+7F7hxpI0d/pDJNaeNfM7JdZbm2qXiR3RdsKlM75EJInkdlqcbdw2LsqhJb9pbl31TZUl2x4RwDbGB+6XQAPrUrf2koE8niX7WeX1DFvylv4PUMI5GfQaRAyBc5OGS4+Mw7h4h+hW+blRYxRuU63oT8aQfFlsjjROeMOI3uUjKvyJh9EZNFPQrQmwmiDTKBbP4FEp0eyJTNcgvbdtBFktu/oxNk8A0qJYRL5+ltGSH3RxWQDt4rh/abFZgEFxxoT2B0NsplPrpQ72kjLfMB06KyuB6Wb/GLaMl4RuS8mwBavTrJcB6wGbs0o9lh95e30elXS3Qr6tfyo0WHTOcHnBKKdZ3/L1ac7ef+Njw4IhGytUnfqFHMjXuO25PgBEUO+dw2aMYvRV//Q5NcQEVNRI7cPBmf2KUSc9hOltRu6D3KHeKmgC/hTz3+1PDpwm9GnXkE1H4qBYj10/6TfVwwl2xJt63zVfclocL2Jqos0yewIAKUEj/7csD2zTiGrB7OUUn52WvqW8oVTeyMAhJmOaFuDof4PC5Qf13TT4/QqB+Y8PBCRictt6T+kSo8mncIKidvBaP+mrpiAb75Y0638PtGLRmV4M/Zu92uit0Pkew==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(396003)(136003)(346002)(366004)(39860400002)(451199021)(54906003)(38100700002)(6486002)(41300700001)(478600001)(8676002)(8936002)(5660300002)(66556008)(66476007)(6916009)(66946007)(316002)(4326008)(2616005)(186003)(6512007)(53546011)(6506007)(26005)(31696002)(86362001)(36756003)(7416002)(2906002)(31686004)(66899021)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam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FJVL2xKZEQ3cWJPZFp3K05ybFdYUjht?=
 =?utf-8?B?Ky92Ukt5ZjdPQnJSVXd0eXVxK2kvejJZQ3V1S04zaVVOVlh1MFhWallpUlA3?=
 =?utf-8?B?N3U3L1FmL3l6NnJTbVBPNXlISjByZXVETytNaVZ4VGE5ekVDNWZMUnZqSUlN?=
 =?utf-8?B?RzVsMEYyUE9JSTZleTZnWHk1UWNRSE1KOFZ1MlRrQjhqa0hMZHdVR3cxYlVD?=
 =?utf-8?B?bHM0d01QRE1ySW9HMWVVeEFudlJkV3NaNGhLVGZlSk5vOVpsT2Y3QllldUVV?=
 =?utf-8?B?YVVRK20zWHVNQkRtVDQvK0NJQlpmSXFwY3lzaGNXWDhua0N6RjF4ZDJCeENY?=
 =?utf-8?B?M3hZbDF5Y20wVnAvSEUreERaWmM1TE93M1hYcTRPakxaNDZOTThQQlYvdU4v?=
 =?utf-8?Q?fSqyrKIhV4Whly6POlICTOucd?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5484958b-e5a3-4172-3503-08db86cf112f
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 14:06:50.8677
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 4agYxlvHTx7fMtJZO6Ba01vFaQ7cfxMq+N9bau8wxkcbSOLh52ptSiD2Elx0tI+L8LYjBxsIsU9NN9+LaUCdsg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8080

On 17.07.2023 14:16, Nicola Vetrini wrote:
> On 16/07/23 18:50, Julien Grall wrote:
>> On 16/07/2023 10:20, Luca Fancellu wrote:
>>>> On 14 Jul 2023, at 14:05, Julien Grall <julien@xen.org> wrote:
>>>> On 14/07/2023 12:49, Nicola Vetrini wrote:
>>>>> The macro 'testop' expands to a function that declares the local
>>>>> variable 'oldbit', which is written before being set, but is such a
>>>>> way that is not amenable to automatic checking.
>>>>
>>>> The code is pretty straightforward. So I am not entirely sure why 
>>>> Eclair is not happy. Is it because the value is set by assembly code?
> 
> Exactly. The reason why I didn't just state that oldbit is always 
> written or never read before being written in that function is that I 
> was unsure about the meaning of the assembly.

So I'm pretty sure the tool wouldn't take apart the string literal passed
first to the asm(). Instead I expect it goes from the operands specified,
which for oldbit is "=&r". There's nothing conditional here, so if the
tool didn't trust that outputs are written, it would need to flag such an
issue on about any asm() having outputs.

I hope the issue isn't that the tool doesn't properly deal with the
do/while.

In any event: I may misremember earlier discussions, but isn't this a
pretty obvious false positive? In which case didn't we mean to flag
those as such (because really an improved checking tool could avoid them)?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 14:09:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 14:09:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564602.882133 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOu9-00010V-NQ; Mon, 17 Jul 2023 14:08:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564602.882133; Mon, 17 Jul 2023 14:08:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOu9-00010O-KQ; Mon, 17 Jul 2023 14:08:49 +0000
Received: by outflank-mailman (input) for mailman id 564602;
 Mon, 17 Jul 2023 14:08:48 +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
 <SRS0=lGkF=DD=invisiblethingslab.com=marmarek@srs-se1.protection.inumbo.net>)
 id 1qLOu8-00010G-5N
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 14:08:48 +0000
Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com
 [66.111.4.28]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 71341c7c-24ab-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 16:08:45 +0200 (CEST)
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailout.nyi.internal (Postfix) with ESMTP id E90335C0060;
 Mon, 17 Jul 2023 10:08:44 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute6.internal (MEProxy); Mon, 17 Jul 2023 10:08:44 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 17 Jul 2023 10:08:43 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 71341c7c-24ab-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm2; t=
	1689602924; x=1689689324; bh=m9oqMhqnoeMdWiCbbw4c3C/aQeXDruEUsX7
	6H3GQr8U=; b=DKPSg1epPNTDOtLhKj8M62S0evSvCvmm0Ck3fWrv+lHEWZ1/tXF
	B4H0fNXgmPdAwNH6AbsmZvDl/3DdSqingcpG5teoeVOmnFXDdXAdZHpLZ7G9RYwJ
	fgl56WLy4g5QrWyWMSe9D+PhcTQVP//fhLAbQ3S7acQh4GiN0hq2RC7S1IFVf3KV
	M8JbqvNla/02wCnsp1K6xNph+GOBhpyN26qc8Qk3L+6MHYfbhZPjUMGniDFp8cXW
	Amm49A/XcAhrJ0PGjMwNaP48IY+DEpgUZzRqvBYtBV4DslmMSSD1w+dViSKPTaj2
	6g9xsE/yisp0G7/+u1DZEvkXkIx9P3a3PZw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1689602924; x=1689689324; bh=m9oqMhqnoeMdW
	iCbbw4c3C/aQeXDruEUsX76H3GQr8U=; b=tuXtyELr2RhW/jqTEbHw0zo0gEkqL
	uhlAVrfLEus0K6/HeDEFPgzLxqkA+S2NO77XXiHGXxdL/5GcU7TVECEtv7IZA+4N
	zUpwxNZegZqwBOXcMo10fMOKZfxwap+hj/iulgRzj+04JpSnO1ogg/OoaoAZ3dI9
	tMGWvGbDIPiTG0zXLcnsFm1i6ztArBGalgrKEaqAA4oLxKyAoo2BPc9NcxNldLik
	9++rIn1OyzMCWCjVw+sApEYYN4B1+PUrkH1ASFMTPDF/5bjaa5n3T5v/vtPCoC9n
	uURxd6M/IDevcg1wguEsh1OVajRQroiinMVKUQAQpe5lh5MU7CxAjNwFQ==
X-ME-Sender: <xms:bEu1ZAFRECPrVbVWDkJgN2SfPFrfLK37uRIJagocVsR34vpMq_ggHA>
    <xme:bEu1ZJV_m2m4L1ZxZIcF0sC7McbaMtO_iN4wfRXPnJeGE_XmNX_Xr9kzN9g-zBo8N
    1Q9ge6d7B13zA>
X-ME-Received: <xmr:bEu1ZKKIkXYdeyY6isgSRbHqTHs9CWb7Fd4oXE5kExUwQ1J8JCGbqNyvOoLhe4RgklvEEA0M3-M7oT7M_AeDCoJvgNfYRqkU-CY>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgedvgdejvdcutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpeffhffvvefukfhfgggtuggjsehgtdorredttdejnecuhfhrohhmpeforghrvghk
    ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh
    hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpedttedv
    hfekudetvdelffeguedtkeethfethfffhfefteeghfeigeelvddttdektdenucevlhhush
    htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhes
    ihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm
X-ME-Proxy: <xmx:bEu1ZCEl9PKvG51ieUO8dYc39EhV8BRirZjsDWOcuIID7KVCidrD4w>
    <xmx:bEu1ZGU5_9-7xFgvgopTjnwCHHtUTk6wXYjzEcMLB4TH4rxTp4z2yw>
    <xmx:bEu1ZFPKPq2WQgAS8mHYIYgMz44QqLEOVUR130gBF6BeoZFsKTA7oQ>
    <xmx:bEu1ZDgu8CdBpcLnO-CYIPTmCs62uh41zi3KQxhvXhR_Yicc3EoExg>
Feedback-ID: i1568416f:Fastmail
Date: Mon, 17 Jul 2023 16:08:38 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org, Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	"committers@xenproject.org" <committers@xenproject.org>
Subject: Re: [PATCH] automation: avoid duplicated builds of staging branch
Message-ID: <ZLVLaPeyOwDYYUXL@mail-itl>
References: <20230717130925.28183-1-marmarek@invisiblethingslab.com>
 <cf7ac648-dbef-80bb-986b-3fe0daef855a@citrix.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="qAyLTvoh5LXBy8b6"
Content-Disposition: inline
In-Reply-To: <cf7ac648-dbef-80bb-986b-3fe0daef855a@citrix.com>


--qAyLTvoh5LXBy8b6
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Mon, 17 Jul 2023 16:08:38 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org, Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	"committers@xenproject.org" <committers@xenproject.org>
Subject: Re: [PATCH] automation: avoid duplicated builds of staging branch

On Mon, Jul 17, 2023 at 02:14:14PM +0100, Andrew Cooper wrote:
> On 17/07/2023 2:09 pm, Marek Marczykowski-G=C3=B3recki wrote:
> > "staging" branch is mirrored (automatically or manually) to several
> > repositories. Avoid building it several times to not waste runner
> > resources.
> >
> > Signed-off-by: Marek Marczykowski-G=C3=B3recki <marmarek@invisiblething=
slab.com>
> > ---
> >  .gitlab-ci.yml | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> > index c8bd7519d5fb..c3b05e32636b 100644
> > --- a/.gitlab-ci.yml
> > +++ b/.gitlab-ci.yml
> > @@ -2,6 +2,12 @@ stages:
> >    - build
> >    - test
> > =20
> > +workflow:
> > +  rules:
> > +    - if: '$CI_COMMIT_REF_NAME =3D=3D "staging" && $CI_PROJECT_NAMESPA=
CE !=3D "xen-project"'
> > +      when: never
> > +    - when: always
>=20
> If we're doing this for staging, we should include staging-* and
> stable-*.=C2=A0 They're all the same from this point of view.
>=20
> However, this does need double checking with the committers who use
> gitlab regularly (CC'd).=C2=A0 This doesn't happen to interfere with my
> commit workflow (I use a separate branch called for-staging), but I
> can't talk for others.

I'd like to avoid broad patterns like staging-* or stable-* here, I'm
pretty sure people do use branches like staging-X.Y-something. While it
would be possible to exclude them by listing exact names, I'm not sure
if it's worth it, given the push frequency to them (few times a month)
and those being mirrored to less repositories (only FuSa fork?).

--=20
Best Regards,
Marek Marczykowski-G=C3=B3recki
Invisible Things Lab

--qAyLTvoh5LXBy8b6
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmS1S2gACgkQ24/THMrX
1yyqXQgAh9RrCvMyGaiVyNa8GPpOg1JFXADhtiCzfrtWLNGP3pBWtGDgLX2um6t2
R7D0VPpA/OI7KAW5MNi8gbxQts8MS7c4BZruHAKyiqJtgJCPcmb+k2/1asj/Hiaw
d8KsaAuyz82tKzYhCqnlMA7vqEFlMCW+gpTIklIApUdeve++GEk1Vdh3vy7387Jk
BZXseAjxrN/66AYX1ci0BCD/n+QMxG5SI07lVY98FB778cKltJjet6vEGCWKGB4Y
2eyw93wrzdpt7eiOyOWlRpC2qyre2wkMub41Z7bxW5KAEy5Eq8dZIkh0nMPT48GT
ZwYv5WQ+YWMimUTX02wHheIgFDhn4g==
=1J3g
-----END PGP SIGNATURE-----

--qAyLTvoh5LXBy8b6--


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 14:14:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 14:14:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564611.882143 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOzE-0002XC-EB; Mon, 17 Jul 2023 14:14:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564611.882143; Mon, 17 Jul 2023 14:14:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLOzE-0002X5-Ax; Mon, 17 Jul 2023 14:14:04 +0000
Received: by outflank-mailman (input) for mailman id 564611;
 Mon, 17 Jul 2023 14:14:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLOzC-0002Wz-Q8
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 14:14:02 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2043.outbound.protection.outlook.com [40.107.13.43])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2d79b58f-24ac-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 16:14:01 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8685.eurprd04.prod.outlook.com (2603:10a6:102:21c::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Mon, 17 Jul
 2023 14:13:32 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 14:13:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2d79b58f-24ac-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=YiUKpPrcLXxWnlUYJJnwqozIfa8Ld9bXe5wUL/eXrzgBt4pHDvFVCsL+WA4x+vnnhhBlB/wQz8WWNVI7I+Ep14nB7HyAOyVns742FYgd2bOul3P/Ob8r/u6cMzs9NktCj1qaGohV79m9VC+2qw19LWmfJbEUgEdPguNaSNTYph2W+JBXwrM6FriF3bmocLNWHi3VBJ7lVPJi+cKonwYgEFfuT/gvpEbdQghaLS5Phllqyzkbd5m4W6NQv1HdP5nZqvxbecAoiKW8nY6adM5nXybHiiP+6y48U2dXwNqauJ5n8Zpg39YtLxBAgfRZ5dL6M5mF2lTwxBaCkkcKlJ1UXg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=fZMrEW7j9/0Rv29bQJ4p6Vlp0AxJhC0sEjVBAeejoBw=;
 b=P02miAwgUlgWIUXmOmR4A3BRLiOoRlyol9Mo6DeZ15pfRCG4eE3SfHKyEiy1sYLxrfKFH6Cozw7sD01mhVT+83XTOn8s24NL32iJ0SR+EWbHh+91p0mkMrhhNaKMrhampeaHq2xY5IoOs15+qVJMdd49RoUqtI2t4iLjZtW+aSB5HTuWmMfLwIRZg4ReyKv7LlT7OxK8KDQTqn00vE5U9pJZk9xmtueorLoMm8EKw6R9VddaBe54Grncmb+y6ydmzEbL+RIBV6fmqLBQkjj3uZID3vToGTSH+Ee+Qg2c/cNnjs7IQe17omGGhz/FBmdQDgF/yZSBb2azoHRlYMNtwg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fZMrEW7j9/0Rv29bQJ4p6Vlp0AxJhC0sEjVBAeejoBw=;
 b=gnxDtPSnOvWejpN2Oz7xh3+R0FhmNrGNsm0kC9D/GXc97UD+2YN+It/FGM9pYHS+wDZykGxrFkAabFzB+GeEK8rFrO8IAmovpz700PcetB3YvEp/unFn3YsMNJUbNioozffxfV0t0xn5k72UATXpondN/UbqJk7Pj5DrIyASG2sYzxyCUrBOC2onrBHv/fMKTWTcigj41iErCvR9PPO0BdhM8as/wxTOIhVnD/SK2MXdOhJSawHI9qbB572T/LzD5oyuj+U6O9gRQ3W0eVKH0Go7YYKFZ3DAP8erOcfXnQmUgWaf6L/FQP1uv0YBHqIbBt1Yft1xk8WHlq2D2wDB7g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <dd24472e-757b-a398-8ece-4e353a28ed1b@suse.com>
Date: Mon, 17 Jul 2023 16:13:29 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Roberto Bagnara <roberto.bagnara@bugseng.com>,
 Nicola Vetrini <nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86: avoid Misra Rule 19.1 violations
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0191.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a4::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8685:EE_
X-MS-Office365-Filtering-Correlation-Id: 944b30c3-21d5-4f5f-9868-08db86d00063
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Q1fuwDae3JFnAYLtoBJ5qZ6P0cKf8vUcJqzNSsV8rkHIMOxNhhv9VwedtBsqQncMaHYd9Nl6vj1jF9+7XMl6APvvnl2Aua2Pd0+dCctGkt2xWtkYBOM5Zn14McEBQ/nBZZGnTfu+8yI+Kccoq2kduoSrSLn+4JyKw7dUkGY6zaeYXFnnxNpDcnlKnVBFSHny20Fz3tkHjTsy9U7290OkTdJ8F6r6jG6LC2JV/fZfQbG0iekfgdritprcx7EIeeT/MJlUkIxme8q9lYCTYFu48vDFK1ragnXGrxx1yUKxjse0aq+n43M9Z5Su9p2DC+6E/6Fqafqn0EKL3I63xHIrk3lKiMub72uJbCWgXeCwhMnPhY399dbscV/XB5vqs+X+MYg8uB9tko95wxHJG6aLoVpODsdmWkjYZPiTLEi4twhaTrp4NJrIh9JjDAJhGZ+f58dmn8GuJyUH4/MGM7Rc58WCSRJtfn9KKnpIf5A18OlS2cDwJ9UhiiNLpKNTkOyCieyBs+XXfFSzsC7dhV+S9hP2ZFBhGlSVFUPY23NdYOohbhVCi5mpEhrasOdYXrFgiiVgEHvhY73t1Rvi6UH7ylkSlAqbPMhGEWQ8yPq2VjROfMve7viM/g1X4CNmADY/eY3xjo2bnB/h1s8kvrHDSQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(396003)(346002)(39860400002)(366004)(136003)(451199021)(31696002)(6506007)(83380400001)(38100700002)(186003)(26005)(478600001)(6512007)(6666004)(6486002)(54906003)(8676002)(41300700001)(66476007)(2906002)(8936002)(66556008)(6916009)(66946007)(316002)(4326008)(5660300002)(36756003)(2616005)(86362001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dHpnTGRmTXEvQXVBWVlRUnlBUHRNUGFadUd2TUYxaTYyRlFHT2I5YVpuSmpX?=
 =?utf-8?B?QTFOM0Q5RnAxVUE1dXI5RTEwYXVhNDU5VHl6dUFubzRoSWg0YjdicUdoQ3pi?=
 =?utf-8?B?RWxHS0QwM0lYVk9EMEc2WHBvUmpLS0JTaHpKc2tpT1pkM1pnbVNBSVBacHg2?=
 =?utf-8?B?VmF3T3IrTm5jaEo5czhBYTZhNDlXd0k5RUxQS0orTkc3N0Fad1pYL3g1VVhh?=
 =?utf-8?B?ZjhKeHlWMlZYS2RoTmxwWWlGZU0ramxFVlBobTZjTlBHYXQ0bFFHUmwvSlVt?=
 =?utf-8?B?THMvVEt4VDFyU1VvOStuRGlBRjZvY1ZwYkZRSFFmZ0ordXRteHJ6bGhURjFR?=
 =?utf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NDRlWE5LVG9T?=
 =?utf-8?Q?5chXHH0eIEZm+8YWJKMs4SgdI?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 944b30c3-21d5-4f5f-9868-08db86d00063
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 14:13:32.1898
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: NXRwJxzW1Mn4+CL87uRzirdMPiVNzBsqERb4HxyY6JcYFhPJW3wlLQAwowDwretIm7+uog+6hoocM8ocp/TAxQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8685

Not exactly overlapping accesses to objects on the left and right hand
sides of an assignment are generally UB, and hence disallowed by Misra.
While in the specific cases we're talking about here no actual UB can
result as long as the compiler doesn't act actively "maliciously", let's
still switch to using casts combined with exactly overlapping accesses.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Oddly enough in my (release) build using gcc12 I actually see emulator
code shrink by about 40 bytes. Diff-ing the disassembly I can't really
attribute this to the particular changes, but instead it looks like
certain scheduling, inlining, and code folding decisions are done
differently.

--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3860,7 +3860,7 @@ void hvm_ud_intercept(struct cpu_user_re
 
             /* Zero the upper 32 bits of %rip if not in 64bit mode. */
             if ( !(hvm_long_mode_active(cur) && cs->l) )
-                regs->rip = regs->eip;
+                regs->rip = (uint32_t)regs->rip;
 
             add_taint(TAINT_HVM_FEP);
 
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1420,7 +1420,7 @@ static void cf_check svm_inject_event(co
      */
     if ( !((vmcb_get_efer(vmcb) & EFER_LMA) && vmcb->cs.l) )
     {
-        regs->rip = regs->eip;
+        regs->rip = (uint32_t)regs->rip;
         vmcb->nextrip = (uint32_t)vmcb->nextrip;
     }
 
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -4760,7 +4760,7 @@ out:
                 regs->rip = (long)(regs->rip << (64 - VADDR_BITS)) >>
                             (64 - VADDR_BITS);
             else
-                regs->rip = regs->eip;
+                regs->rip = (uint32_t)regs->rip;
         }
         else
             domain_crash(v->domain);
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -503,8 +503,8 @@ static inline void put_loop_count(
         if ( mode_64bit() && ad_bytes == 4 )                            \
         {                                                               \
             _regs.r(cx) = 0;                                            \
-            if ( using_si ) _regs.r(si) = _regs.esi;                    \
-            if ( using_di ) _regs.r(di) = _regs.edi;                    \
+            if ( using_si ) _regs.r(si) = (uint32_t)_regs.r(si);        \
+            if ( using_di ) _regs.r(di) = (uint32_t)_regs.r(di);        \
         }                                                               \
         goto complete_insn;                                             \
     }                                                                   \
@@ -1984,9 +1984,9 @@ x86_emulate(
     case 0x98: /* cbw/cwde/cdqe */
         switch ( op_bytes )
         {
-        case 2: _regs.ax = (int8_t)_regs.al; break; /* cbw */
+        case 2: _regs.ax = (int8_t)_regs.ax; break; /* cbw */
         case 4: _regs.r(ax) = (uint32_t)(int16_t)_regs.ax; break; /* cwde */
-        case 8: _regs.r(ax) = (int32_t)_regs.eax; break; /* cdqe */
+        case 8: _regs.r(ax) = (int32_t)_regs.r(ax); break; /* cdqe */
         }
         break;
 
@@ -8377,7 +8377,7 @@ x86_emulate(
 
     /* Zero the upper 32 bits of %rip if not in 64-bit mode. */
     if ( !mode_64bit() )
-        _regs.r(ip) = _regs.eip;
+        _regs.r(ip) = (uint32_t)_regs.r(ip);
 
     /* Should a singlestep #DB be raised? */
     if ( rc == X86EMUL_OKAY && singlestep && !ctxt->retire.mov_ss )


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 14:17:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 14:17:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564614.882153 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLP2i-0003AC-Sp; Mon, 17 Jul 2023 14:17:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564614.882153; Mon, 17 Jul 2023 14:17:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLP2i-0003A5-Q0; Mon, 17 Jul 2023 14:17:40 +0000
Received: by outflank-mailman (input) for mailman id 564614;
 Mon, 17 Jul 2023 14:17:39 +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
 <SRS0=LRey=DD=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qLP2h-00039z-0g
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 14:17:39 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ae18138f-24ac-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 16:17:37 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.163.206.54])
 by support.bugseng.com (Postfix) with ESMTPSA id 1661B4EE0737;
 Mon, 17 Jul 2023 16:17:31 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ae18138f-24ac-11ee-8611-37d641c3527e
Message-ID: <d01fe137-756e-5a0c-4f7c-35895606c1fa@bugseng.com>
Date: Mon, 17 Jul 2023 16:17:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 "xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
 "ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
 "consulting@bugseng.com" <consulting@bugseng.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Luca Fancellu <Luca.Fancellu@arm.com>, Julien Grall <julien@xen.org>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
 <d1ccb5e1-d122-88df-e46a-39494b6d6d12@xen.org>
 <299D0BAE-D15E-4260-AF3E-8D84CF058083@arm.com>
 <528fb310-f469-e449-d1c3-269fa7dec750@xen.org>
 <2bc64be1-10c0-d064-a5a2-1f076b596e6e@bugseng.com>
 <c89d59de-4aaa-7b60-181d-5c3658181b3a@suse.com>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <c89d59de-4aaa-7b60-181d-5c3658181b3a@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 17/07/23 16:06, Jan Beulich wrote:
> On 17.07.2023 14:16, Nicola Vetrini wrote:
>> On 16/07/23 18:50, Julien Grall wrote:
>>> On 16/07/2023 10:20, Luca Fancellu wrote:
>>>>> On 14 Jul 2023, at 14:05, Julien Grall <julien@xen.org> wrote:
>>>>> On 14/07/2023 12:49, Nicola Vetrini wrote:
>>>>>> The macro 'testop' expands to a function that declares the local
>>>>>> variable 'oldbit', which is written before being set, but is such a
>>>>>> way that is not amenable to automatic checking.
>>>>>
>>>>> The code is pretty straightforward. So I am not entirely sure why
>>>>> Eclair is not happy. Is it because the value is set by assembly code?
>>
>> Exactly. The reason why I didn't just state that oldbit is always
>> written or never read before being written in that function is that I
>> was unsure about the meaning of the assembly.
> 
> So I'm pretty sure the tool wouldn't take apart the string literal passed
> first to the asm(). Instead I expect it goes from the operands specified,
> which for oldbit is "=&r". There's nothing conditional here, so if the
> tool didn't trust that outputs are written, it would need to flag such an
> issue on about any asm() having outputs.
> 
> I hope the issue isn't that the tool doesn't properly deal with the
> do/while.
> 
> In any event: I may misremember earlier discussions, but isn't this a
> pretty obvious false positive? In which case didn't we mean to flag
> those as such (because really an improved checking tool could avoid them)?
> 
> Jan
> 

Actually, given that the function indeed always writes oldbit in the asm 
instruction, I can state that this post-condition holds for the function.

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 14:18:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 14:18:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564620.882162 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLP3A-0003eg-4a; Mon, 17 Jul 2023 14:18:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564620.882162; Mon, 17 Jul 2023 14:18:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLP3A-0003eZ-1u; Mon, 17 Jul 2023 14:18:08 +0000
Received: by outflank-mailman (input) for mailman id 564620;
 Mon, 17 Jul 2023 14:18:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=peYT=DD=citrix.com=prvs=555f7cff5=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qLP39-0003RA-3m
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 14:18:07 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id be727ee2-24ac-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 16:18:05 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: be727ee2-24ac-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689603485;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=UJMyvEEmIjIbPLQ3Zyo8P65ouEn3wRNR82i0jvI+GIc=;
  b=e3ks1QkPVNhsuXV7iCj23GIhTnb0tzz7TDzioTOSMTArrW1DvcKoTLJe
   1q50RBj9AzKWEept4tfDullHO1fL7mLouvSV3YiteRiF4fJLQplDPKXbP
   mhrKsjKrBX9pYxPfO4QJ+CZIRc396BilV+85D4pfLYplWSLac3r4zOMfK
   A=;
Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 116488458
X-Ironport-Server: esa3.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:GpzE46NwYgZ8AyPvrR3/l8FynXyQoLVcMsEvi/4bfWQNrUog3jEHy
 2NLC2+Ba/qCY2Lzetsjat6/oE8GusWEytJmSwto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v
 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/
 Nj/uKUzAnf8s9JPGjxSs/vrRC9H5qyo42tH5wNmPJingXeF/5UrJMNHTU2OByOQrrl8RoaSW
 +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ
 HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0vRoBENvz
 OAqFDlORRKsiu6b/rHqF8A506zPLOGzVG8eknRpzDWfBvc6W5HTBa7N4Le03h9p2JoIR6yHI
 ZNEN3w2Nk+ojx5nYz/7DLo3mvuogX/uNSVVsluPqYI84nTJzRw327/oWDbQUoXTG5kFzhrF9
 goq+UzWDhs9D5uQwwCq61CJicDzsHzme6Q7QejQGvlC3wTImz175ActfUu2p7y1h1CzX/pbK
 lcI4Ww+oK4q7kupQ9LhGRqirxa5UgU0AoQKVbdgsUfUl/SSulzCboQZctJfQM45se0XfCAY6
 lbKtNHGCDBCjr7EFFvIo994sgiO1TgpwX4qPHFUHFZfsoW98OnfnTqUEI89TffdYsndXGipn
 mvU9HVWa6A715Zj6kmtwbzQb9tATLDtRxV92AjYV3nNAuhRNN/8PNzABbQ2AJ99wGelorqp5
 iJsdzC2trxmMH10vHXlrB8xNL+o/e2ZFzbXnERiGZIsnxz0pS7yINsKvG0jeho0WirhRdMOS
 BaO0T69GbcJZCf6BUOJS9nZ5zsWIVjISo2+C6G8gitmaZltbg6XlByClmbJt10BZHMEyPllU
 b/CKJbEMJrvIfg/pNZAb7tHgOBDK+FX7T+7eK0XODz8i+XDOyHOEO1t3ZnnRrlR0Z5oaT79q
 753X/ZmAT0GOAEiSkE7KbIuEG0=
IronPort-HdrOrdr: A9a23:aNZ2iq5bZS7mtu0qCwPXwAzXdLJyesId70hD6qkQc3Fom62j5q
 WTdZEgvyMc5wx/ZJhNo7690cq7MBHhHPxOgbX5VI3KNGXbUQOTR72KhrGSoAEIdReeygZcv5
 0QCZSXCrfLfCVHZRCR2njFLz4iquP3j5xBnY3lvhNQpZkBUdAZ0+9+YDzrdXFedU19KrcSMo
 GT3cZDryrIQwVtUizqbkN1OdQqvrfw5evbXSI=
X-Talos-CUID: 9a23:32ys5mzOszD0gQWaK4nrBgUGBcUHU0TB/kvZYGS6JmtlZYOWGAK5rfY=
X-Talos-MUID: =?us-ascii?q?9a23=3A0ETYXA5ny30zm7/1JmZvigDSxoxH766JMwcCm68?=
 =?us-ascii?q?pouuhOgNMFmiArxKeF9o=3D?=
X-IronPort-AV: E=Sophos;i="6.01,211,1684814400"; 
   d="scan'208";a="116488458"
From: Anthony PERARD <anthony.perard@citrix.com>
To: <xen-devel@lists.xenproject.org>
CC: Roger Pau Monne <roger.pau@citrix.com>, Anthony PERARD
	<anthony.perard@citrix.com>
Subject: [OSSTEST PATCH] ts-xen-build-prep: force use of git protocol v2
Date: Mon, 17 Jul 2023 15:17:45 +0100
Message-ID: <20230717141745.33470-1-anthony.perard@citrix.com>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain

Recent version of QEMU (to be 8.1) started to use meson subproject to
clone extra repo. With the example of the subproject "dtc", they do a
shallow clone with a sha1. Meson end up running:

    git fetch --depth 1 origin b6910bec11614980a21e46fbccc35934b671bd81

This command fails. I think the error message is something like "the
remote end hung up unexpectedly", on Debian Buster. A more useful
message with more recent version of git seems to be "couldn't find
remote ref".

If we allow git to communicate with the protocol v2, then the shallow
clone works. But git on buster still use v1 by default. Force it to
use v2.

This needs a git-cache-proxy version that can allow to switch to v2 of
the protocol. A bug is open upstream to track this change:
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1040476

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---

Notes:
    I've already apply the patch to our git-cache-proxy version in the
    testlab.
    
    Also, I've been using this osstest patch a few times, and none of my
    flights broke because if it, so I guess git-protocol v2 work well enough
    in buster, even if it isn't the default yet in this git version.

 Osstest/TestSupport.pm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 360cfdea..f0e087aa 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -3254,6 +3254,14 @@ sub gitcache_setup ($) {
         insteadOf = ${proxy}$urlprefix
 END
     }
+
+    # Adding mandadory use of Git protocol v2
+    # necessary on buster when building QEMU v8.1
+    $gitcfg .= <<END;
+[protocol]
+	version = 2
+END
+
     target_putfilecontents_stash($ho,30,$gitcfg,"/home/osstest/.gitconfig",
                                  'home-osstest-gitconfig');
 }
-- 
Anthony PERARD



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 14:19:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 14:19:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564623.882172 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLP3x-0004Fo-DR; Mon, 17 Jul 2023 14:18:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564623.882172; Mon, 17 Jul 2023 14:18:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLP3x-0004Fh-Al; Mon, 17 Jul 2023 14:18:57 +0000
Received: by outflank-mailman (input) for mailman id 564623;
 Mon, 17 Jul 2023 14:18:56 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLP3w-0004FR-1k
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 14:18:56 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on20631.outbound.protection.outlook.com
 [2a01:111:f400:fe16::631])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dc4ee748-24ac-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 16:18:55 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB8979.eurprd04.prod.outlook.com (2603:10a6:20b:42e::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 14:18:52 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 14:18:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dc4ee748-24ac-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Gu8kYuM2JX70fkP7sPPTy+9hIUC6XxdPTInF+Dv/vIpSGBFVUIWMc3bBDBlMM82u9WBaG5n20B0ekos7gRR2c/vb3YobSOw5ComvnCtpb+ktZV10aTwfkiy/7gXHStX5NI7PzqOLynr8LC7pcg6yfevQ6Y5MU4mAKLoaZZ+uzJWXQ1Slp/77tsUFQrOWznL73zw8vmbNWCUBBqs6mv9X9ySDB21Kkm/GReLR0wVhnCJ3dtdsRyBl8k95RaL1MOxB5EYhNMa6rVP61TAXeq0ZvhE66SahBhaT3BNDgsi4B2MaVCMU7R4Aoq6jrt0D1X2CbpjPzUNWhtBOrUu5+sWnzA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=tuCRAFGTJjX+O7Q9upuBdqcebOL1clejJevbyHOYW7U=;
 b=Y/BO+eJ6didkn0EkhD+YF5mZrrj/Lb71vk/cG9X0mA1Z82CKrD2PGpoo2ZVHg6y7HRL/dAmD6vOUO4J9hESqiM1JOnXpcut5BJWzHcxUt2Lf3QMF3yf8XXeCH4+PGlf02AxjE4Vm5QXdXENeDsgSBfzMOGXWD+yvAJS2CCqyfST+e+ciR1On6mlKkV1Zc5QPJ2Vc25Ik0DClD69WAswqIaATWEmPpz3SFmMcmmRugam8C+HWq0WXid8XPsrKNn+qekILQyOh6X3lKJYZFmqKrHbHy2naPISJQmDVu16GmMmGLMB+EC0LRaUiRNV1U9IP3Dz4hykz1oURDmDnueCOTQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=tuCRAFGTJjX+O7Q9upuBdqcebOL1clejJevbyHOYW7U=;
 b=nPm90ROfs7/5yz7mJ6xylqj2nSpjACziRJMsKlesKSS+eJJYDBKcbZFglBZAjSqbXe0zRODhKG662GkNw1PLz/rn2OfNtuyfIE2l09F789wreQO/5+AXXf6hI180QiArMOp1TrAOjE2Jrt/dYma7bzub5iXJK2HlRsITevqPXlx9vV1Z6up7kY/usYMF83mS9KARlHDaTVRI5/le4RgVID6gJcmNQNVQI0ebniLfYIvfBHk2qpamw0EhR6WV65umMUfJFdDn9b+3FYcqJrad269rXQC1sSIJCM/v2auvZUfg/h3ypteZ7Df79Fh3sYwvDqCO36AOUUrnWxiZXbo4PA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <a84dec51-bad1-bb36-9be9-fbf343987e11@suse.com>
Date: Mon, 17 Jul 2023 16:18:50 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v3 9/8] common: honor CONFIG_CC_SPLIT_SECTIONS also for
 assembly functions
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Bobby Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
 <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
In-Reply-To: <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0195.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a4::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB8979:EE_
X-MS-Office365-Filtering-Correlation-Id: 7212d941-238c-4221-5021-08db86d0bf6a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	PPmGgFwTFK628vuaR5TeHoshEUf65kQOVupv0qQjVkG+sG2+85vfB/aC23sW+QR8YewdWsmsdbXcds+mc+l73dRP6M02xxRwfm9yFFVmaFJQucwxi3WHhtjuMbkafZPr8iLNnNq6nEV1/BU33u4sWTpS5panGNW4/PaxDc29j58cmv+kfH8fKdxvxqS5lXaP2+AMOnIHcmUJZwegy331BVtYJQOWfd4KE4DUeW4nsSfBKVlI6H994z0QVxRtOYfcvUnHX28pebuc49zPp00OFCsMy0TOpCgbo+wc1m+WvbdjvWGrD/61wL/PegebiDeCZcSD2sWNeU/qkWCzIOf64R5ljQNvvgXe7vfpFELx+csbBZjnSKQIVsJL+fPBNLC0VZBpfskU8kV7qy+DVYlFfNZXjxPaQuHIGnlwx6THIhQUHmYQT3waRCCG8cGz8cZawqXXsZevZKJpqPg/jQv+qicVO5PsKno1SD3oW1IPmj7dyB5gGkGtNtsN4vefxTu3G1HE9XUqWISi+fbivntym700a1bdwtoXS5zp4IYxv6q4bjwXC16NRn1sN046KmBL4hM27f9u3N1fIEMze9BL0y3es7L/TQJFanT7IErMfrQgH6rd8AUfK2pdMHgmOAynFC65UrJ/dO8FUWf5hqsUtA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(346002)(366004)(136003)(396003)(451199021)(31686004)(6486002)(54906003)(478600001)(83380400001)(2616005)(36756003)(31696002)(2906002)(186003)(6506007)(86362001)(6512007)(26005)(38100700002)(66476007)(66556008)(6916009)(66946007)(41300700001)(4326008)(316002)(5660300002)(8936002)(8676002)(7416002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SEZFRVY0SW1wVkNwc2pqaU1Sd3ozaWtVRG1ESThFS1JSN3IzTHpnR3N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T3Nk?=
 =?utf-8?B?SXdJY2FaTXk2aTV6cklXSUV1RFFWME9EU2cvaWp0RkpVTFNxSEk5eDRJUE9W?=
 =?utf-8?B?aGd6alhrNUZpTzg0SDl4cHRCM2VkOHRyUDRnWEFoZkVzUmlCeDBQNVQ2anNK?=
 =?utf-8?B?RGw4OENtWi9RRmI2MEJ2cHk2NWZkYUp3Ymtab1BrQTRucG5HNHA4VWF3WS9T?=
 =?utf-8?B?Qjh1YVcrQ0dMWVVHVnVKTkdtdHprK2o5RzVEUm1ObUlXYkJIMDRzYUpidEpz?=
 =?utf-8?B?WmR0bHdZTHA3WW9rbVRPaDRJVFRqQnd5ZVpxb2VFSklZajNqR0c5VkUzcDkx?=
 =?utf-8?Q?EMjn3ODrNGjxsl2cehPwg7qxw?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7212d941-238c-4221-5021-08db86d0bf6a
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 14:18:52.6983
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ygw5Gx3bUQ3MTGFzzd81u8CnjgZO4fBtQ8MArH1rYCupmTLdtgwJ8kEAH4DOfcAF97iCh/KVIwlKDhajnrz5kw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8979

Leverage the new infrastructure in xen/linkage.h to also switch to per-
function sections (when configured), deriving the specific name from the
"base" section in use at the time FUNC() is invoked.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
RFC: Since we use .subsection in UNLIKELY_START(), a perhaps not really
     wanted side effect of this change is that respective out-of-line
     code now moves much closer to its original (invoking) code.

Note that we'd need to split DATA() in order to separate r/w and r/o
contributions. Further splitting might be needed to also support more
advanced attributes (e.g. merge), hence why this isn't done right here.
Sadly while a new section's name can be derived from the presently in
use, its attributes cannot be. Hence perhaps the only thing we can do is
give DATA() a 2nd mandatory parameter. Then again I guess most data
definitions could be moved to C anyway.

--- a/xen/Makefile
+++ b/xen/Makefile
@@ -399,6 +399,9 @@ AFLAGS += -D__ASSEMBLY__
 
 $(call cc-option-add,AFLAGS,CC,-Wa$(comma)--noexecstack)
 
+# Check to see whether the assmbler supports the --sectname-subst option.
+$(call cc-option-add,AFLAGS,CC,-Wa$$(comma)--sectname-subst -DHAVE_AS_SECTNAME_SUBST)
+
 LDFLAGS-$(call ld-option,--warn-rwx-segments) += --no-warn-rwx-segments
 
 CFLAGS += $(CFLAGS-y)
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -154,6 +154,9 @@ SECTIONS
   .init.text : {
        _sinittext = .;
        *(.init.text)
+#ifdef CONFIG_CC_SPLIT_SECTIONS
+       *(.init.text.*)
+#endif
        _einittext = .;
        . = ALIGN(PAGE_SIZE);        /* Avoid mapping alt insns executable */
        *(.altinstr_replacement)
--- a/xen/arch/ppc/xen.lds.S
+++ b/xen/arch/ppc/xen.lds.S
@@ -106,6 +106,9 @@ SECTIONS
     DECL_SECTION(.init.text) {
         _sinittext = .;
         *(.init.text)
+#ifdef CONFIG_CC_SPLIT_SECTIONS
+        *(.init.text.*)
+#endif
         _einittext = .;
         . = ALIGN(PAGE_SIZE);        /* Avoid mapping alt insns executable */
     } :text
--- a/xen/arch/riscv/xen.lds.S
+++ b/xen/arch/riscv/xen.lds.S
@@ -92,6 +92,9 @@ SECTIONS
     .init.text : {
         _sinittext = .;
         *(.init.text)
+#ifdef CONFIG_CC_SPLIT_SECTIONS
+        *(.init.text.*)
+#endif
         _einittext = .;
         . = ALIGN(PAGE_SIZE);        /* Avoid mapping alt insns executable */
     } :text
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -86,6 +86,9 @@ SECTIONS
        . = ALIGN(PAGE_SIZE);
        _stextentry = .;
        *(.text.entry)
+#ifdef CONFIG_CC_SPLIT_SECTIONS
+       *(.text.entry.*)
+#endif
        . = ALIGN(PAGE_SIZE);
        _etextentry = .;
 
@@ -214,6 +217,9 @@ SECTIONS
 #endif
        _sinittext = .;
        *(.init.text)
+#ifdef CONFIG_CC_SPLIT_SECTIONS
+       *(.init.text.*)
+#endif
        *(.text.startup)
        _einittext = .;
        /*
--- a/xen/include/xen/linkage.h
+++ b/xen/include/xen/linkage.h
@@ -21,6 +21,14 @@
 
 #define SYM_ALIGN(algn...) .balign algn
 
+#if defined(HAVE_AS_SECTNAME_SUBST) && defined(CONFIG_CC_SPLIT_SECTIONS)
+# define SYM_PUSH_SECTION(name, attr) \
+         .pushsection %S.name, attr, %progbits; \
+         .equ .Lsplit_section, 1
+#else
+# define SYM_PUSH_SECTION(name, attr)
+#endif
+
 #define SYM_L_GLOBAL(name) .globl name; .hidden name
 #define SYM_L_WEAK(name)   .weak name
 #define SYM_L_LOCAL(name)  /* nothing */
@@ -35,7 +43,14 @@
         SYM_ALIGN(algn);                          \
         name:
 
-#define END(name) .size name, . - name
+#define END(name) \
+        .size name, . - name; \
+        .ifdef .Lsplit_section; \
+            .if .Lsplit_section; \
+                .popsection; \
+                .equ .Lsplit_section, 0; \
+            .endif; \
+        .endif
 
 /*
  * CODE_FILL in particular may need to expand to nothing (e.g. for RISC-V), in
@@ -49,6 +64,7 @@
 #endif
 
 #define FUNC(name, algn...) \
+        SYM_PUSH_SECTION(name, "ax"); \
         SYM(name, FUNC, GLOBAL, DO_CODE_ALIGN(algn))
 #define LABEL(name, algn...) \
         SYM(name, NONE, GLOBAL, DO_CODE_ALIGN(algn))
@@ -56,6 +72,7 @@
         SYM(name, DATA, GLOBAL, LASTARG(DATA_ALIGN, ## algn), DATA_FILL)
 
 #define FUNC_LOCAL(name, algn...) \
+        SYM_PUSH_SECTION(name, "ax"); \
         SYM(name, FUNC, LOCAL, DO_CODE_ALIGN(algn))
 #define LABEL_LOCAL(name, algn...) \
         SYM(name, NONE, LOCAL, DO_CODE_ALIGN(algn))



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 14:21:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 14:21:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564627.882182 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLP69-0005m5-V0; Mon, 17 Jul 2023 14:21:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564627.882182; Mon, 17 Jul 2023 14:21:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLP69-0005ly-SJ; Mon, 17 Jul 2023 14:21:13 +0000
Received: by outflank-mailman (input) for mailman id 564627;
 Mon, 17 Jul 2023 14:21:12 +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
 <SRS0=RVQe=DD=citrix.com=prvs=555fa4c0e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qLP67-0005ls-VZ
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 14:21:12 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2b5c9f4c-24ad-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 16:21:08 +0200 (CEST)
Received: from mail-bn8nam11lp2169.outbound.protection.outlook.com (HELO
 NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.169])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 17 Jul 2023 10:20:58 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by DS7PR03MB5383.namprd03.prod.outlook.com (2603:10b6:5:2ca::21) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 14:20:51 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 14:20:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2b5c9f4c-24ad-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689603668;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=ikubuGN4M/Jba5bb1Rky3BjPvDWYeDvUznTRsNfeVIc=;
  b=fZ8r17Lun812rSRVn90DYIe1zE+SAkzXw5FqQWhoniiB3QXs8QEtVv+x
   o3mZHYzBCDRca9awBCyMNb5NZ4zgyFR7mUqciIaYOXTZdn4OeMo/YiTeD
   UUE7hyCq2KvqCVz/myFXLa+kKXB78CkygEhslE3l8fPv/fTl69BOUc72W
   Y=;
X-IronPort-RemoteIP: 104.47.58.169
X-IronPort-MID: 115763255
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:sPcfzK0jmca1trZaWPbD5fdwkn2cJEfYwER7XKvMYLTBsI5bp2EPn
 TQWXTvUb/7eYWP1e41wb4nloxlQsMXQzYNgGwdspC1hF35El5HIVI+TRqvS04F+DeWYFR46s
 J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo
 tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5gNnOqgS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL
 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ
 OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfOEwX+
 Ls1Jz83Yz+Itse0y4C6VbRyiZF2RCXrFNt3VnBI6xj8VK9ja7aTBqLA6JlfwSs6gd1IEbDGf
 c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxqsy6Kkl0ZPLvFabI5fvSQQspYhACAr
 3/u9GXlGBAKcteYzFJp91r137KQw3ihBd96+LuQx+VnrXeP22UoMkMxUVCno/u2l2i4VIcKQ
 6AT0m90xUQoz2S7Q9+4UxCmrXqsuh8HR8EWA+A88BuKyKff/0CeHGdsZiFFQMwrsokxXzNC/
 l2GhdTyHhR0raaYD3ma89+pQSiaPCEUKSoIY38CRA5cut37+tht31TIU8ppF7OzgpvtAzbsz
 juWrS84wbIOkcoM0Kb99lfC696xmqX0oscOzl2/dgqYAslRPeZJu6TABYDn0Mt9
IronPort-HdrOrdr: A9a23:CmK3qqO0iTU3EMBcTgWjsMiBIKoaSvp037BK7S1MoH1uA6mlfq
 WV9sjzuiWatN98Yh8dcLO7Scu9qBHnlaKdiLN5VduftWHd01dAR7sSjrcKrQeAJ8X/nNQtr5
 uJccJFeaDN5Y4Rt7eH3OG6eexQv+Vu6MqT9IPjJ+8Gd3ATV0lnhT0JbTqzIwlNayRtI4E2L5
 aY7tovnUvaRZxGBv7LYEXsRoL41qT2qK4=
X-Talos-CUID: 9a23:phgy1m016cmwAQ7iinxjHrxfI+18fzrww3jqLmCzOENrQ4+UVgKO9/Yx
X-Talos-MUID: =?us-ascii?q?9a23=3APWNzSg6hNxgYtwixn81WYfi7xoxZ+KmDIlwQmK4?=
 =?us-ascii?q?85e6APjByOTiAqjK4F9o=3D?=
X-IronPort-AV: E=Sophos;i="6.01,211,1684814400"; 
   d="scan'208";a="115763255"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=E+ber1v6AJ1k7E8g6tZRvcXEXOFI1ikKzcJWF2M16ZEKvPskAwi+k6rk1HiSuffLRabMnBB69sqzl41aP6aYF8N04TJMV2sTmlAIPwKONY2aPK1hnF+DYVl0hFFr9Bnbl2Fv73MzHZnaxUYHMtdR845aCn06gSdHX+vkpScERE2FA3coYH+/rEp/Y5GMh/eH6q4uRhnnUDG4vzZtyQZc4w8C1qWv5meaUzKOx25o4rnI9e1gtNC3A2dU6FmpQyUFDKr126kWsAbWp2JVI5zIkSxFfHohPQe6RuLTvmUuNKNWEvZ42vCm91OqKWrZ0Yy0c66lYPnR0t7gMF4EC8WI/w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=EXj86JbXyHsIAEWITJIySJ0bWw1hmjcuwe63E4Zzk+M=;
 b=CY8DMsDnkD9HajkTanOHXB+kV0YXSL1E+XxHw2/8u1c1GJ/VikPt9HsP9wqof0lzUmkkSGGRccLoIuC9XyrB2nMuldznPqGOOxJdxVL4bp37Tc4S2FkA4DTN8UoZhfCh3YyGz+k1yb9CRwOurs+DCRqqfAviARFCuadCG6H3ZsgCXrlMeK8ahqxzvYsLeplwVApD7QD01DcQjlDpBJPhgdPqO/91uvOKIaVA7iS+tpv/Wl7zUkz91vu8bNl2ZY+KYOZYEsQdP1M834stl8hksiZg9QISheGhIQ/tYWvAmwT/AGtD49cMNFCskGRG7dNyapxMVGhaFCbzz07yu7YSTg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=EXj86JbXyHsIAEWITJIySJ0bWw1hmjcuwe63E4Zzk+M=;
 b=e3N5gpCK1DtB81K0kf97WQJXxl+xtCuJw1U1uq03/ZOHvqH8rMpBmVcvhxyzTqsRZ29dFLU6GSWRh2G6fFYlUk6ZPJG+DVFctDjY+4ZlmPKIiLtutMhcYIVwcV/VSW16mIp1IDR9bUcmNYsEc5WpqbRTQxnGS4Z6LQz5V2U99K8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Mon, 17 Jul 2023 16:20:46 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v2 1/6] libs/guest: introduce support for setting guest
 MSRs
Message-ID: <ZLVOPouSilDLdWFu@MacBook-Air-de-Roger.local>
References: <20230711092230.15408-1-roger.pau@citrix.com>
 <20230711092230.15408-2-roger.pau@citrix.com>
 <45c89e03-fe3d-43f0-9f2b-de11ae4fd539@perard>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <45c89e03-fe3d-43f0-9f2b-de11ae4fd539@perard>
X-ClientProxiedBy: LO4P265CA0075.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2bd::16) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|DS7PR03MB5383:EE_
X-MS-Office365-Filtering-Correlation-Id: f15d82f4-7cc4-4ee6-1d4f-08db86d1061f
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	VlzNC8osIVKAXphoISbiSynGzrhhefk4ytt0o9zjWHc7TQOol1xmIFkm8p7XbaHr8oe3uMOpsPKSbZRvCJo7Z3KOvJAJjPEMThGF/4P/7BrG4io95fJfwEvFC5paqJuvOS2JZNWRL1fdhX1fb2XtBDqvr7QGJderLc06QXLV95c2mc+Ke4lgListoTWAFrzjqXQqpWz7JmF7Gxxh2clO1fKzwNTC0u4zyIXcZwJ1HmoUE/PC33JGCh5zHSu/+Liocwa3fwFhnRZVWUN2oI+0gJnGBp8lLuuqUVFlNgEIq55qIyrM/ijY2GK/lXYKMuyD4QlVwOjtq46IREaV+nYVjBZRiPVx2TWvYBvl0O9NaaNphDf1wPttGmYw6ETkGGz281hsiqcGYjpCQRxmjtLEUUys8YexydJ7x6VrXF44BLvzhZbjqc/1ogap2ehHM+RRLRZ83RXAoWI4UP2rnqr0vGgsn2YuJx+IJua9NNmshvJZn02LTeekWt9dz96Ig/i3vpD1/NFvkVEFP466SNG0AE3fiwgfye234E89jpCx90Yh+5hfAxC5bHCHNU1uSFSl
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(366004)(136003)(346002)(376002)(451199021)(478600001)(6666004)(6486002)(54906003)(6506007)(186003)(26005)(6512007)(316002)(9686003)(2906002)(41300700001)(6636002)(4326008)(66946007)(66476007)(5660300002)(6862004)(8936002)(8676002)(66556008)(38100700002)(82960400001)(86362001)(85182001)(83380400001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VHZwaWprK0JHLzZzeUNMM012OCtEdDcxV1JncEVxWW41d2RZVGcyZVJNWEdC?=
 =?utf-8?B?N1BEbjJUVndQNDdWWU5FK3BUL3kzUXFBaWVvbjlQUlRWWHJTb1A4dTNoV3dG?=
 =?utf-8?B?aHpUL2xYdUxQUzh4THhiVzVTakoyM2xMZkMwTnlKNnBpL05BNHRyMC96a2ZU?=
 =?utf-8?B?d2pXUUdndy9QOTNIa0hFZ1FJYVhmVmxmUnBKRlJ4VTdJbjF5WnRiNC9JYWJW?=
 =?utf-8?B?MXI3NEQwemRQMzR4YlFkcmo1QUxiUEpUNzlpaXNVbmxuK0ZVeWhHaEVRVmxX?=
 =?utf-8?B?ZnlXVGVDVlEvNjNrRHRxb3FJNUVSWFFWZDYzY3Z0ZlBJdDB3MENVVUw1Q2tD?=
 =?utf-8?B?N3plekR4NDFucFFYR3ZzT3luMG9TWEJkT1N3VjgwSUlxb2xCOCtXZzUwYm5J?=
 =?utf-8?B?MDJKN3B4Nm12VHhtWVV5MUh5TXM1SmE4cEhtdHZpMnBGTUsxN1A0ZzdLNUtG?=
 =?utf-8?B?bCtDSnIrelRNM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pam-ExternalHop-MessageData-0:
	PeP9YJqDwcZfthNm8HM9r3bUTTPBObAfwmM7js7edp9m8lHaoXogJGgGmqiybfDdAFyo9P1dpaMcjHYvesuCEQmXTVNybFRFzogaBIDJIXw/oZQNAP4ZDL+smv4Damzv7S1NvQ/1lt/Fk/zM/CtqZ6UppB3XG4f1lBmKGlCL6hFUQacpW7qLXj/V4oCkYy8axjh9A2J3EO6Dzr+7wRlSahnrMzqsYUX2JA+AkLPmdb2XBrhxXtNlOLH0UFnh3m+nQ3DT0OWNl1Bz1fjXUpk8ClPQc1kjKcTX8XMFUj4/zg9CJ9h8OYJ5yZT95FCYeCO22ptn1bzsysH0GhwkaMWELaGYgivTHUV7MquQa7eBThsgW/wfxGFz600aRdCAl7Hv6H5o0rfjl327I0cuyFvvvkiBLWOXj3S6hfKn8AS6oa2BnB9UGRaLRzUzy6qB8z4eczSieP7OukQTxkRTS073XpdH7PiuF0a05IT/f9Oqw//ASeaJJ0xo2FOLKcTwEzVsfill83/4gkSDlSD91ghysK/VRF7eD5yuQAnQng9HqyLRbAB6NC8/eQvlaJ1gQ+I672oOg2kTiO+AdQjO+pfSarDcGF6QXL1DP+OZ7JNjwoZr9ieWTjJ/DXJltar00OPZ9c//cWfRURg6rz04MABtOvbdEavKidcsb3ZoRPDQ5t37KpRMdLyAReLSmAC+QYrljT/1PVM6NbUv/hsRcGEdqj4L4X42QXUF9zyNLU8UDITNBM8DEm+BbGKHB4bFnFz4oM1NCJb2zMl2/5OMWziTbLXte8F75Jx5Bklvzcnb4y5/eExQpEOTvk07pAGWF0du
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f15d82f4-7cc4-4ee6-1d4f-08db86d1061f
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 14:20:51.4363
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: fK7b9Urmwx6LNVKYfQtY68UjeG4bH90uHYQQf1W/clpnylO6VsKZ/GH4GlcWUojl2b9kgAX/LgUNH+cYFlkJAQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR03MB5383

On Wed, Jul 12, 2023 at 03:34:23PM +0100, Anthony PERARD wrote:
> On Tue, Jul 11, 2023 at 11:22:25AM +0200, Roger Pau Monne wrote:
> > diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c
> > index 5b035223f4f5..5e5c8124dd74 100644
> > --- a/tools/libs/guest/xg_cpuid_x86.c
> > +++ b/tools/libs/guest/xg_cpuid_x86.c
> > +static int xc_msr_policy(xc_interface *xch, domid_t domid,
> > +                         const struct xc_msr *msr)
> > +{
> [...]
> > +
> > +    rc = -ENOMEM;
> 
> This `rc' value looks unused, should it be moved to the if true block?

This is mostly copy&paste from the cpuid counterpart, some parts of
the code tend to use this kind of error assignation, but it only makes
sense when the if is the code block is a single line in order to avoid
the braces.  Since here the code block already requires braces, doing
the assign outside is pointless.

> > +    if ( (host = calloc(nr_msrs, sizeof(*host))) == NULL ||
> > +         (def  = calloc(nr_msrs, sizeof(*def)))  == NULL ||
> > +         (cur  = calloc(nr_msrs, sizeof(*cur)))  == NULL )
> > +    {
> > +        ERROR("Unable to allocate memory for %u CPUID leaves", nr_leaves);
> > +        goto fail;
> > +    }
> > +
> > +    /* Get the domain's current policy. */
> > +    nr_leaves = 0;
> > +    nr_cur = nr_msrs;
> > +    rc = get_domain_cpu_policy(xch, domid, &nr_leaves, NULL, &nr_cur, cur);
> [...]
> > +    for ( ; msr->index != XC_MSR_INPUT_UNUSED; ++msr )
> > +    {
> > +        xen_msr_entry_t *cur_msr = find_msr(cur, nr_cur, msr->index);
> > +        const xen_msr_entry_t *def_msr = find_msr(def, nr_def, msr->index);
> > +        const xen_msr_entry_t *host_msr = find_msr(host, nr_host, msr->index);
> > +        unsigned int i;
> > +
> > +        if ( cur_msr == NULL || def_msr == NULL || host_msr == NULL )
> > +        {
> > +            ERROR("Missing MSR %#x", msr->index);
> > +            rc = -ENOENT;
> > +            goto fail;
> > +        }
> > +
> > +        for ( i = 0; i < ARRAY_SIZE(msr->policy) - 1; i++ )
> > +        {
> > +            bool val;
> > +
> > +            if ( msr->policy[i] == '1' )
> > +                val = true;
> > +            else if ( msr->policy[i] == '0' )
> > +                val = false;
> > +            else if ( msr->policy[i] == 'x' )
> > +                val = test_bit(63 - i, &def_msr->val);
> > +            else if ( msr->policy[i] == 'k' )
> > +                val = test_bit(63 - i, &host_msr->val);
> > +            else
> > +            {
> > +                ERROR("Bad character '%c' in policy string '%s'",
> > +                      msr->policy[i], msr->policy);
> 
> Would it be useful to also display msr->index?

Why not, will add it.

> > +                rc = -EINVAL;
> > +                goto fail;
> > +            }
> > +
> > +            clear_bit(63 - i, &cur_msr->val);
> > +            if ( val )
> > +                set_bit(63 - i, &cur_msr->val);
> 
> Does this need to be first clear then set? A opposed to just do one or
> the other.

Will adjust, I assume some people prefer 3 lines instead of 4 if you
use and if ... else ...?

> > +        }
> > +    }
> > +
> > +    /* Feed the transformed policy back up to Xen. */
> > +    rc = xc_set_domain_cpu_policy(xch, domid, 0, NULL, nr_cur, cur,
> > +                                  &err_leaf, &err_subleaf, &err_msr);
> > +    if ( rc )
> > +    {
> > +        PERROR("Failed to set d%d's policy (err leaf %#x, subleaf %#x, msr %#x)",
> > +               domid, err_leaf, err_subleaf, err_msr);
> > +        rc = -errno;
> > +        goto fail;
> > +    }
> > +
> > +    /* Success! */
> > +
> > + fail:
> 
> Even if this label is only used on "fail", the code path is also use on
> success. So a label named "out" might be more appropriate.
> 
> > +    free(cur);
> > +    free(def);
> > +    free(host);
> > +
> > +    return rc;
> > +}
> > +
> 
> In any case, patch looks fine to me:
> Acked-by: Anthony PERARD <anthony.perard@citrix.com>

Will make the adjustments requested.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 14:29:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 14:29:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564636.882193 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPE7-0006V2-R2; Mon, 17 Jul 2023 14:29:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564636.882193; Mon, 17 Jul 2023 14:29:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPE7-0006Uv-My; Mon, 17 Jul 2023 14:29:27 +0000
Received: by outflank-mailman (input) for mailman id 564636;
 Mon, 17 Jul 2023 14:29:25 +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
 <SRS0=RVQe=DD=citrix.com=prvs=555fa4c0e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qLPE5-0006Ui-Te
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 14:29:25 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 51deded1-24ae-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 16:29:23 +0200 (CEST)
Received: from mail-mw2nam10lp2102.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.102])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 17 Jul 2023 10:29:04 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by MN2PR03MB5359.namprd03.prod.outlook.com (2603:10b6:208:19f::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Mon, 17 Jul
 2023 14:29:02 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 14:29:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 51deded1-24ae-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689604163;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=hvOqyatdiCgk7nvsXNlhH6UVzhaeOHf2sURXN/jW8vs=;
  b=Cjo5zpkxqkQKJVoPnjYsBJ5FML5raFWpsZOBNQfv6UPEQrxYSTVeo1ZL
   1fzinTkdxJRWtBmcA8RW0QcnPLSpuRJn3vUnsncb4ZN0pWR71wE61UEPd
   6FxbAJ4RmOGuGbVe9RQ71dP30TjitGk3oItXylkv2R1FOoq9o6pIVIZmI
   4=;
X-IronPort-RemoteIP: 104.47.55.102
X-IronPort-MID: 116897425
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:UTkfrq/agI2Bx7HGSOi4DrUDpn+TJUtcMsCJ2f8bNWPcYEJGY0x3n
 GpJDWqGOfuNNzehc4oiaIznpkxU7ZDTmNcxG1Y4pCA8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s
 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk
 d7pqojUNUTNNwRcawr40Ird7ks21BjOkGlA5AdmOqkU5Aa2e0Q9V/rzG4ngdxMUfaEMdgKKb
 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk
 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklK6
 tJGeB8tYCmegr6R3e+xZ+xqms4KeZyD0IM34hmMzBn/JNN/GdXmfP+P4tVVmjAtmspJAPDSI
 dIDbiZiZwjBZBsJPUoLDJU5n6GjgXyXnz9w8QrJ4/ZopTWOilUpitABM/KMEjCObd9SkUuC4
 HrP4kzyAw0ANczZwj2Amp6prraWw3OqB95ISdVU8NY7vE+KykIhDCQYXHWDpP7oplS8Wetmf
 hl8Fi0G6PJaGFaQZsnwWVi0rWCJujYYWsFMCKsq5QeV0K3W7g2FQG8eQVZpd9gOpMIwAzsw2
 TehndzzAid0mKaIUn/b/bCRxQ5eIgAQJG4GICobFw0M5oC7pJlp10qVCNF+DKSyk9v5Xynqx
 CyHpzQ/gLNVitMX06K8/hbMhDfESoX1czPZLz7/BgqNhj6Vrqb8PtLABYTzhRqYELukcw==
IronPort-HdrOrdr: A9a23:wD9Ab6yvQbix3fn/gi+/KrPw2r1zdoMgy1knxilNoHxuH/BwWf
 rPoB17726TtN91YhsdcL+7V5VoLUmzyXcx2/hyAV7AZniAhILLFvAA0WKK+VSJdxEWtNQtsJ
 uIG5IUNDSaNykfsS+V2miF+9ZL+qj5zEir792usUuEm2tRGtBdBwQSMHfqLqVvLjM2fKbQjP
 Cnl7d6TzzLQwVuUu2LQkMrcsLkvNPxmJfvcXc9dmIaAFnnt0LS1FbieSLopCsjbw==
X-Talos-CUID: =?us-ascii?q?9a23=3AEkOjymgQ9K5hN+Df9vsxB34TTjJudmLzkif/A0G?=
 =?us-ascii?q?BFGM1b6DIQ3KV/r9uup87?=
X-Talos-MUID: =?us-ascii?q?9a23=3A2M7fcA0j1P28Gkn6qyXvG9TmKzUjspi8EUwjo5E?=
 =?us-ascii?q?/tcCqDSl3ahuHjjaOe9py?=
X-IronPort-AV: E=Sophos;i="6.01,211,1684814400"; 
   d="scan'208";a="116897425"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=F5RnHSANWcIxHKBTkTmYjQcpNaZcqsBbzx8z+SBeJaY5iKKAtcJJ3sEcWurGplwHC5OQegTop9T6ea51m3BiWKn8fxkj2sDA2Bphb+h+RdUW7nzcTqxZGdtvYVez2BvDX6+K5yL2y4yH4LeKq1+EXp8WSnDjlLrn4gYycTtJEslOJUfyKf+SAFljeOlbxvEFgTW8uM8h/xaEcBeuFHnYy37nGx6ObhxmQZrhlV+mjKBJQDwNLcXS5o+L6vBkm1ZDbgleP4nME7679fbMUVR77rIiyrLuD1c1LdlThMeZ+4OokCP+vj5htARoJrb8V5gVuQIC/I4P8LKa5w/3tvpG3Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yJ1w9wuX23Q+6WKucGQPqKdzXJcPHrWF0OGteN2yJD0=;
 b=VWDkBNj1bzHqK1NxmGd9nOt2tGLSEgwGjhBOC0PXk+GbS2uYcPpKm8m7R5orBrIrynLMoEkhrzJp2TGt5bJLccH4BeqTb6vcosH6gFAF17hIOTPLkFQCdjkOaxUcGXMCyGX9x+IDQjeQ5FOnkzLEpOFxT6qOaFhiHq2HSsOfZ37GgllAg8Sd/yCmIuyozNu4OUhmhSRPFz93tIgl9ocnwlD5uGvE6cBRjGpoAxDtOEVeYmARcS2E0Qi17VBcdAqZnn0qw/nGpUpIKtyL9MEIaD+FKuCle8P3DrOAaAOUKXEiU0BI5LlUnDLpiklU1hAbfKc3Y/Ck4l8Ad7mUPY4tTg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yJ1w9wuX23Q+6WKucGQPqKdzXJcPHrWF0OGteN2yJD0=;
 b=rw2dUE16sDjjcTUDPR98Y2W7GigZTJoSY2Ab0dr8S7uWb6dVQXVAZj32pAndMNPwZhJvj57bpWiHB7bVD0l9ENX//m7sz3UmJKdM998d8AQCFJnDLL7VTo66nfZjeEJwN56fniL1KxkncWEa6VizOJpnPLfceQHBVhmhe2983gQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Mon, 17 Jul 2023 16:28:54 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v2 2/6] libxl: change the type of libxl_cpuid_policy_list
Message-ID: <ZLVQJghZ-ZAIHeUJ@MacBook-Air-de-Roger.local>
References: <20230711092230.15408-1-roger.pau@citrix.com>
 <20230711092230.15408-3-roger.pau@citrix.com>
 <c4df983f-d53a-468b-8ee0-f6f4d048d6c0@perard>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <c4df983f-d53a-468b-8ee0-f6f4d048d6c0@perard>
X-ClientProxiedBy: LO4P123CA0273.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:195::8) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|MN2PR03MB5359:EE_
X-MS-Office365-Filtering-Correlation-Id: 44ed7dc6-dc16-40a7-2f7d-08db86d2291b
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Om47qhYKJrDBxlM3+sJA34vwfrkNnwDFlb+bmWrQgUTREidRvbGwJFIA/RJKYYl2AVC5W2rpq6kYk9HwlZfLxKZj7lHRqZ1LNgy7pXgWH6znmH8PYwlgjasJN8SzD8yPimYeG0FecG3FHV/EeAXoh2y2hbinxROF69fI8D+/PMmqYLQWQVluORIRrAfj1mGMVKM+Gy4OuwX9dd9Qe1jgRyi5ozeJn8rctZ9nzUDx46Zt574cnLe7Uxw/QKPGjDMUdW7Ap05STRgeq5rH/Fx1SlUomfagueF+PI952vEGnq7cnBZZwiH4xCSgugP7x3gZhTBUuuFnaGzd0mL3/B1RA765cP++OwbtHWKEvjuh3e2pXs2hVHmWE0YcxFuyeanps9OhDDXlHNCI3FUPqrGgUo4kdE0RvW3viP8b+ZjLUCTX/Bs68oKO5131/zLuDUPcSpyk8WID7r53Xq8wZtQJmjc9VWVLZxHwbBi6YAIm55Z7SuRRfV8KX3J1X+3xKLzmfjTH1Nic7WscDEpmIV8JBUCtQ0WIrm4UxRVbYBe8vfNlUzkHVgPIbFBzba4YQGPb
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(136003)(346002)(366004)(39860400002)(451199021)(54906003)(82960400001)(38100700002)(6666004)(6486002)(41300700001)(478600001)(6862004)(8676002)(8936002)(5660300002)(66556008)(66476007)(66946007)(316002)(6636002)(4326008)(186003)(6512007)(6506007)(26005)(9686003)(86362001)(85182001)(2906002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NUM0V2xBbUlRNXRtZ0xvZTJ5ZkV4dzhqbnRBcG1TNEkrZzRhaTJEdktNdGhC?=
 =?utf-8?B?REt1Tzh2aEJ2UjFtQVIwSDNrRHY5Wk9zU1k3SnZObjdsVlJnZksyN3kveWZF?=
 =?utf-8?B?aE5HYStla29XTjFEUFVnVTFOMTE5Y3BuWXhnZkhUMkx5WU1iWFRLVEdFYU1h?=
 =?utf-8?B?MlJ5YVNraUdIRzgwTnVsZFNjNUp1SjZqVC8yUURlMWVMRnE0MDkrQnUwZm1t?=
 =?utf-8?B?QVYwQjBtVzhGSkFjRElaQTdxd2o0SStJdkQ4MXhJdHFxWGkxdzMrcnQrZXZs?=
 =?utf-8?B?LzVpY1h2NS9HeXJFRWtIVy9jZUNlb3JrSjJKNlNOTkl4bktObE1QM0R1dlZW?=
 =?utf-8?B?UzB5cGtOa2VmdWJXaEhoczhPQitsWldTT0x3RDA4M0RMNFZLZnFDVXc4Rk9I?=
 =?utf-8?B?ZUJrSXRYNXFHbFFWUFUrODhJcHMySHFCVWlCa05NOU5XaUxxWVF6b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kCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	mBhISW3v0hLpjtQiyz44wGCYRm8STGdKoC2/ykqmdILTWWggrvEm4881KhIrdofZYr3910DI3MiPDfaCCzMutpJ/jv5j1z8fLHBrfCDrmiFO3JTjLtMI87iZ9EyJXCtUER5owwj6pqypdkJ+0qkV/4qcVJXo+05GAtYmVNj5vek/kmZTK9GRgWSzX3dczk3DEOVfTQ9E2t4pXo3CcpMalE+SMOx99iQlODK4UPPNrvLysx9okH070Q/yfj5x/lBM8OE3GV3jw3mnwPAZJ3Ig2N0/CsrsIyv0RH3V3l0UqCO3q3gcsWwZr8zuGUmqFSNE9iqOYsvWYH823mFDJ5ttIv7BJ9PHWudcM02yrfxmdv3+l4u1ES/VNNpuwD4WxcOD11LvBgwxmcvurxlT8VIzHWLt88Ac8Myldg2wqNdLoaHW75jhPfMozPUF6WlzKNPenAF/Wp2tRVmLkdtGRQwJECSgsjBDfzYOB0HGo5oAXDNg8wB675hFq4O2D3j+zNhH9gT7GbcREfCEtYAPj2drzab7ef1QIlXt82yZ7s9CMC2GrVKcrEmTAbHwgQxAOo5dVMmREgJNw1teAnf/YA0lNbc7f+M36fOvJi0jvW13n/axWw7y3vaOYziAvrTr9BZiX/HSvUtaSuAL9cVG3sohYOX60aWucn2L9RLKVf1xgZSvrLfCWMwY1Yl+ehXX3QlaFc5lxLVhscfyv2yRlXAi3X65lPNOBJf4fErBS4u8gvfM3ru3sd/guDqJXroKqBbKGs+XiDoNXUbPudhD6bMohAd1kiF0LwCjEP7v87t2+G8XS+AY/jLM50y3oLrUvgb+
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 44ed7dc6-dc16-40a7-2f7d-08db86d2291b
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 14:29:01.9967
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: rJUNl3k38P7Zq8hLautBUmw49ZzuSHUCmC449HmUSE+WxE4pQ8K/cWaAVktXBTNIS8oUJdo9btxoBilU69i+KQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR03MB5359

On Wed, Jul 12, 2023 at 05:02:03PM +0100, Anthony PERARD wrote:
> On Tue, Jul 11, 2023 at 11:22:26AM +0200, Roger Pau Monne wrote:
> > -void libxl_cpuid_dispose(libxl_cpuid_policy_list *p_cpuid_list)
> > +void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl)
> >  {
> > -    int i, j;
> > -    libxl_cpuid_policy_list cpuid_list = *p_cpuid_list;
> > +    libxl_cpuid_policy_list policy = *pl;
> >  
> > -    if (cpuid_list == NULL)
> > +    if (policy == NULL)
> >          return;
> > -    for (i = 0; cpuid_list[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
> > -        for (j = 0; j < 4; j++)
> > -            if (cpuid_list[i].policy[j] != NULL) {
> > -                free(cpuid_list[i].policy[j]);
> > -                cpuid_list[i].policy[j] = NULL;
> > -            }
> > +
> > +    if (policy->cpuid) {
> > +        unsigned int i, j;
> > +        struct xc_xend_cpuid *cpuid_list = policy->cpuid;
> > +
> > +        for (i = 0; cpuid_list[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
> > +            for (j = 0; j < 4; j++)
> > +                if (cpuid_list[i].policy[j] != NULL) {
> > +                    free(cpuid_list[i].policy[j]);
> > +                    cpuid_list[i].policy[j] = NULL;
> > +                }
> 
> This looks like a lot of work. We could just call
> free(cpuid_list[i].policy[j]) and that's all, as cpuid_list will be gone
> right after the loop.

I wasn't planning on changing the code, as this is just indentation
movement, but will do.

> Also, please add {} for the second "for ()" loop.
> 
> > +        }
> > +        free(policy->cpuid);
> >      }
> 
> Beside some the coding style pointing out, the patch looks fine:
> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 14:33:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 14:33:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564632.882203 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPHX-0007yK-An; Mon, 17 Jul 2023 14:32:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564632.882203; Mon, 17 Jul 2023 14:32:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPHX-0007yD-81; Mon, 17 Jul 2023 14:32:59 +0000
Received: by outflank-mailman (input) for mailman id 564632;
 Mon, 17 Jul 2023 14:27:51 +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 <SRS0=00af=DD=kernel.org=robh@srs-se1.protection.inumbo.net>)
 id 1qLPCZ-0006T8-1Y
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 14:27:51 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1a030052-24ae-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 16:27:48 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 08BA96111D
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 14:27:47 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58404C433CC
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 14:27:46 +0000 (UTC)
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-3fbc5d5742eso47972615e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 07:27:46 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1a030052-24ae-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689604066;
	bh=rkLKjJGA9W9V1hgJstWBCmZrxpmjuvUsbHV5ieMMp8c=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc:From;
	b=R78TGMx+tLPLYyhLeXOeLisKHqJ4pXJMz8qJAAvAVzmXbsDoXwXoXaZSpzjaITIWH
	 NEi/xoCmqGfa20qvVXPEMvKwl326d/1GD+r0wy0tbLsteWINDN3EkzI8BMNNhJkYnl
	 enqDgQEyOVjUNdl2swwcP4aEGFFhieuz0nePlhvul5MWRzVoiDya3+AVpEV0JyHGKW
	 ZUj5FB8Q9CzmgJaEfcPr31sXvswO2GyLPv9nXk1ad5GixA+xWMSxlJsXLWK1UpY+b6
	 RDHkvctYNbAqGaDlR/BYehPh+CMqP6Kti6ZBl/zxw6Hv77olsBadr7zTnetwdsCg7x
	 9vMPJYOcjNvcg==
X-Gm-Message-State: ABy/qLadAnM8BCbOFl99L+T1sYJ0foD54MRHCZouZu6dk49aa1MogbhX
	B2q7Szmf7p3jJXNjRKycXJpSnYirQbeYb0Z8cw==
X-Google-Smtp-Source: APBJJlFSY1EKmbumZhe1Fkfe0qsodiNyBdGN/d2gmlGF1ZwWgImoQ1RpodF7t1ooNJHJiRju6eg8DIGKKeloqUgo0eo=
X-Received: by 2002:a2e:8945:0:b0:2b9:48f1:b195 with SMTP id
 b5-20020a2e8945000000b002b948f1b195mr576527ljk.44.1689604043579; Mon, 17 Jul
 2023 07:27:23 -0700 (PDT)
MIME-Version: 1.0
References: <20230714174545.4056287-1-robh@kernel.org> <114500369.nniJfEyVGO@phil>
In-Reply-To: <114500369.nniJfEyVGO@phil>
From: Rob Herring <robh@kernel.org>
Date: Mon, 17 Jul 2023 08:27:10 -0600
X-Gmail-Original-Message-ID: <CAL_JsqJMo4LHRmsfRQAr-j6oNESbS=q+eFU+B7e720emjf+8nA@mail.gmail.com>
Message-ID: <CAL_JsqJMo4LHRmsfRQAr-j6oNESbS=q+eFU+B7e720emjf+8nA@mail.gmail.com>
Subject: Re: [PATCH] drm: Explicitly include correct DT includes
To: Heiko Stuebner <heiko@sntech.de>
Cc: Liviu Dudau <liviu.dudau@arm.com>, David Airlie <airlied@gmail.com>, 
	Daniel Vetter <daniel@ffwll.ch>, Andrzej Hajda <andrzej.hajda@intel.com>, 
	Neil Armstrong <neil.armstrong@linaro.org>, Robert Foss <rfoss@kernel.org>, 
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>, Jonas Karlman <jonas@kwiboo.se>, 
	Jernej Skrabec <jernej.skrabec@gmail.com>, Jagan Teki <jagan@amarulasolutions.com>, 
	Liu Ying <victor.liu@nxp.com>, Shawn Guo <shawnguo@kernel.org>, 
	Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, 
	Fabio Estevam <festevam@gmail.com>, NXP Linux Team <linux-imx@nxp.com>, Inki Dae <inki.dae@samsung.com>, 
	Marek Szyprowski <m.szyprowski@samsung.com>, 
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, 
	Thomas Zimmermann <tzimmermann@suse.de>, Lucas Stach <l.stach@pengutronix.de>, 
	Russell King <linux+etnaviv@armlinux.org.uk>, 
	Christian Gmeiner <christian.gmeiner@gmail.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, 
	Kyungmin Park <kyungmin.park@samsung.com>, 
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, Alim Akhtar <alim.akhtar@samsung.com>, 
	Xinliang Liu <xinliang.liu@linaro.org>, Tian Tao <tiantao6@hisilicon.com>, 
	Xinwei Kong <kong.kongxinwei@hisilicon.com>, Sumit Semwal <sumit.semwal@linaro.org>, 
	Yongqin Liu <yongqin.liu@linaro.org>, John Stultz <jstultz@google.com>, 
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>, Paul Cercueil <paul@crapouillou.net>, 
	Qiang Yu <yuq825@gmail.com>, Paul Kocialkowski <paul.kocialkowski@bootlin.com>, 
	Linus Walleij <linus.walleij@linaro.org>, Chun-Kuang Hu <chunkuang.hu@kernel.org>, 
	Philipp Zabel <p.zabel@pengutronix.de>, Matthias Brugger <matthias.bgg@gmail.com>, 
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, 
	Kevin Hilman <khilman@baylibre.com>, Jerome Brunet <jbrunet@baylibre.com>, 
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>, Rob Clark <robdclark@gmail.com>, 
	Abhinav Kumar <quic_abhinavk@quicinc.com>, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, 
	Sean Paul <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>, 
	Marek Vasut <marex@denx.de>, Stefan Agner <stefan@agner.ch>, Sam Ravnborg <sam@ravnborg.org>, 
	Jerry Han <hanxu5@huaqin.corp-partner.google.com>, Icenowy Zheng <icenowy@aosc.io>, 
	Ondrej Jirman <megi@xff.cz>, Javier Martinez Canillas <javierm@redhat.com>, =?UTF-8?Q?Guido_G=C3=BCnther?= <agx@sigxcpu.org>, 
	Purism Kernel Team <kernel@puri.sm>, Jianhua Lu <lujianhua000@gmail.com>, 
	Florian Fainelli <florian.fainelli@broadcom.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Artur Weber <aweber.kernel@gmail.com>, Tomeu Vizoso <tomeu.vizoso@collabora.com>, 
	Steven Price <steven.price@arm.com>, Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>, 
	Emma Anholt <emma@anholt.net>, Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>, 
	Sandy Huang <hjc@rock-chips.com>, Orson Zhai <orsonzhai@gmail.com>, 
	Baolin Wang <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>, 
	Alain Volmat <alain.volmat@foss.st.com>, Yannick Fertre <yannick.fertre@foss.st.com>, 
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>, 
	Philippe Cornu <philippe.cornu@foss.st.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, 
	Alexandre Torgue <alexandre.torgue@foss.st.com>, Chen-Yu Tsai <wens@csie.org>, 
	Samuel Holland <samuel@sholland.org>, Thierry Reding <thierry.reding@gmail.com>, 
	Mikko Perttunen <mperttunen@nvidia.com>, Jonathan Hunter <jonathanh@nvidia.com>, 
	Jyri Sarha <jyri.sarha@iki.fi>, Tomi Valkeinen <tomba@kernel.org>, 
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, devicetree@vger.kernel.org, 
	Ondrej Jirman <megous@megous.com>, dri-devel@lists.freedesktop.org, 
	linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, 
	etnaviv@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, 
	linux-mips@vger.kernel.org, lima@lists.freedesktop.org, 
	linux-mediatek@lists.infradead.org, linux-amlogic@lists.infradead.org, 
	linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
	linux-rpi-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, 
	linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, 
	linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, 
	xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sun, Jul 16, 2023 at 3:26=E2=80=AFAM Heiko Stuebner <heiko@sntech.de> wr=
ote:
>
> Am Freitag, 14. Juli 2023, 19:45:34 CEST schrieb Rob Herring:
> > The DT of_device.h and of_platform.h date back to the separate
> > of_platform_bus_type before it as merged into the regular platform bus.
> > As part of that merge prepping Arm DT support 13 years ago, they
> > "temporarily" include each other. They also include platform_device.h
> > and of.h. As a result, there's a pretty much random mix of those includ=
e
> > files used throughout the tree. In order to detangle these headers and
> > replace the implicit includes with struct declarations, users need to
> > explicitly include the correct includes.
> >
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
>
> [...]
>
> > diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/=
gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> > index 917e79951aac..2744d8f4a6fa 100644
> > --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> > +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> > @@ -12,7 +12,9 @@
> >  #include <linux/mfd/syscon.h>
> >  #include <linux/module.h>
> >  #include <linux/of_device.h>
> > +#include <linux/of_platform.h>
> >  #include <linux/phy/phy.h>
> > +#include <linux/platform_device.h>
> >  #include <linux/pm_runtime.h>
> >  #include <linux/regmap.h>
>
> I'm not sure if I'm just misreading something, but in all other places
> of_device.h gets removed while here is stays as an include. Is this
> correct this way?

Yes, because of_match_device() is used.

Rob


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 14:36:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 14:36:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564645.882212 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPKx-000085-Po; Mon, 17 Jul 2023 14:36:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564645.882212; Mon, 17 Jul 2023 14:36:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPKx-00007y-Mu; Mon, 17 Jul 2023 14:36:31 +0000
Received: by outflank-mailman (input) for mailman id 564645;
 Mon, 17 Jul 2023 14:36:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=RVQe=DD=citrix.com=prvs=555fa4c0e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qLPKx-00007s-2C
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 14:36:31 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4ff1fb16-24af-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 16:36:29 +0200 (CEST)
Received: from mail-mw2nam10lp2108.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.108])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 17 Jul 2023 10:36:21 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by BLAPR03MB5618.namprd03.prod.outlook.com (2603:10b6:208:294::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Mon, 17 Jul
 2023 14:36:18 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 14:36:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4ff1fb16-24af-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689604589;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=zzF2tLxL7wnHTD0WitPj413cxkzP5KQ8HS4icFEuIQo=;
  b=RaVDuhs5qd/zP3QqI2Ba1j/K5WhlHtCmb0Gn3Qoqv8980XL9j4Kdhl4+
   AYAZ0LCGOvAPsE7+gD/mRo77AZU37RgI55ZRkFC1D+TZ82VXXRiqMfzBP
   lWPAzmDil0Us76OvwEVOB/5igOd57+8wDhegVHi2sAE7uX2yRZqX/syMy
   Q=;
X-IronPort-RemoteIP: 104.47.55.108
X-IronPort-MID: 115178328
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:CGaurqwxEYH+U/AomFp6t+cTxyrEfRIJ4+MujC+fZmUNrF6WrkVWm
 zNOUT2CM6uLNzHxfIp0ad/n/UIC75OAmtc3Tgdr+CAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhPK8T5TcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KVpNy
 /w/bwENUjCSh+S0n7TkScJJtv12eaEHPKtH0p1h5RfwKK9+BLX8GeDN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjWVlVQhuFTuGIO9ltiiX8Jak1zev
 mvb12/4HgsbJJqUzj/tHneE37aSxHyrA9hCfFG+3v5LmHKi/2g0MRobT3+Qq6Kjrk6HX+sKf
 iT4/QJr98De7neDXtT7GhG1vnOAlhodQMZLVf037hmXzajZ6BrfAXILJhZebPQ2uclwQiYlv
 neLkMnuHidHq6CORDSW8bL8kN+pES0cLGtHYDBeSwIAuoHnuNtq1kKJSct/GqmoiNGzASv33
 z2BsCk5gfMUkNIP0KK4u1vAhlpAu6T0c+L83S2PNkrN0++zTNXNi1CAgbQD0ct9EQ==
IronPort-HdrOrdr: A9a23:38eJLq3J+1Tlxvh2xIjflQqjBEIkLtp133Aq2lEZdPU0SKGlfq
 GV7ZMmPHrP4gr5N0tOpTntAse9qDbnhP1ICOoqTNOftWvd2FdARbsKheffKn/bak/DH4Zmvp
 uIGJIObeEYY2IasS77ijPIb+rJwrO8gd+VbTG19QYSceloAZsQnjuQEmygYytLrJEtP+tCKH
 KbjPA33gaISDAsQemQIGIKZOTHr82jruOaXfZXbyRXkDVnlFmTmcXHLyQ=
X-Talos-CUID: 9a23:+/WCxmNR30HiNe5DYypZ9GlTK8AZUmzdynWPJRC7IkNZcejA
X-Talos-MUID: =?us-ascii?q?9a23=3AaIe5VQ0f1IO5q2qr1pYkATeMCjUj44W2J3E0lbI?=
 =?us-ascii?q?/vMSeEQd6YC25jA2ze9py?=
X-IronPort-AV: E=Sophos;i="6.01,211,1684814400"; 
   d="scan'208";a="115178328"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=X3EjOnqP+lKa13o4QM8vjpMjt1Eud6jqD5caCm7KIK+iWyjd6IQ7DL/DxcSAtvjkRGYfjyFVhJPiKEMbVQhi4SeEhyrBXEdt+2jp9bYYgUqHASusivsk4hrWx+/UJHq86nGKuOxuEpM7x2V1zJblrc3RoNL3doWAs2ujVxj7k7s6dPSIeB/IuT1K3Vzq7uu8FPfkbtX0TCbhWRb0INw+M7R2KRxcSRkCejr+oK5UNLXz+dH23uI9AkltjSqnI7d7KKotuLOosHph6Pdg039nq0lh3lGoGxbhJQUYT/dlb0gBqfmqIM19ghbqJeLPHEU81HgUgsDZvRJPCYkkGGW6+Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MfmyvjuK3TGcXoVu8TBn4BNtQvpWL548nD6P46bKv9w=;
 b=KL9c5VY+WLobzx04KZuQJF3lU6evOiIon0j/CNSP3SUDz0AXu6fRiX9LRWJpZK7lAKtcLFaXEykz9OZSjpNbt1FGwk0UoMGGrg2pBMC+kSLK6B3xNQULODhsjFcLvhtkZasYQUkEkktYUp/kb1bnBLcT8Isd1S+qhZubQaVtAuxS0LGQCb1H7YfprjO0F9CODdIjUxLwXvvnx1EpA7hTVMXxhjl3lL5nWrP45ok8jZnES6/i6R6U1o9A+c+u4xwfsN80jnrt5w51jrWgl76OqV/jmHlP8MfJsHWTkJ7VofkKsmTYJR4xQNZ3lwGkoLD8XwEtQh3crd0QZCrrl2yOUQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MfmyvjuK3TGcXoVu8TBn4BNtQvpWL548nD6P46bKv9w=;
 b=NoUQ70jEcdbYIC653wvKbauR7rgg2gLi2FMJ2wggC3ebUqMELjarQHvCacELse7dp2jKo7hrXDlwjkCzby+PlnmuDWNEktUTgy7vlnQG9YrEmk8aM4P/IG5wEJdajNFKEwBtaFblZlCTSDAk2BC+DPvVQGhJ3juRkCUqxS8p8h4=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Mon, 17 Jul 2023 16:36:11 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v2 3/6] libxl: introduce MSR data in libxl_cpuid_policy
Message-ID: <ZLVR23KbddRHrC5z@MacBook-Air-de-Roger.local>
References: <20230711092230.15408-1-roger.pau@citrix.com>
 <20230711092230.15408-4-roger.pau@citrix.com>
 <d7be70e8-611c-4f7d-a585-2a00b1513a92@perard>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <d7be70e8-611c-4f7d-a585-2a00b1513a92@perard>
X-ClientProxiedBy: LO4P123CA0455.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1aa::10) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|BLAPR03MB5618:EE_
X-MS-Office365-Filtering-Correlation-Id: c506a535-bb7f-414d-682e-08db86d32e3d
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	YNyrJfSabpUeQPbPJNf9xFHTQZHYTzDlP+X+68kGrL89NKWWuvsbtF2ImHidO372K8hVK0knMQD/PMy0TwCRFJe86M5B7mPNuuezisr3qhV8+3gzWc7brmPaVp7ANz/dtJvPC2D8I4K/Purn1lPSqFoLKrtSaoTOPrv3H8V6v1IBIDa7JV3LQzkTYd6hsKmY+V8tnwyOOQkQImc+fp1YI6ZdkS2P39l4wHEoSev7BblUgfWSoWZb8Tm0lrESjan687pGMTyq80w500f9lEM8U4NtgiFD0ngEP2JUR6q/kyZyCxmBoTD8oAjXk60njZUfYIhSVxKJOuGh8UDPHjxzMbZg/EiidvhfDmpOlUmG9r+3b6I9R/PEj0WetSFF98o+woqEmQBDkpEo1MUwHdasI7NdMGk/+eVgwN6cjLwsm23MlDE1MkZ+UgCYb0yeZpg+oxJgcCVK2lNEtEp/qV2BxgFNhaFnHBVR4G1u45xDyu12F1ktDLSaZkvSsEXGNkm5LAtA+U8rDUe7uVzTjI+UBMN1ZFdlbUy6eVZBgFfcg2mIdjMhVxKdfB89itoFtCrJ
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(396003)(376002)(366004)(39860400002)(451199021)(6862004)(8676002)(41300700001)(82960400001)(86362001)(5660300002)(8936002)(38100700002)(316002)(6636002)(4326008)(83380400001)(66899021)(9686003)(66556008)(66476007)(66946007)(2906002)(85182001)(478600001)(54906003)(6486002)(6666004)(6512007)(186003)(26005)(6506007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NzNUVGhTbXROS2s3OWRRdkQ1T05RZ3ZiY1I2bWowWFBqeVkyckVYcVh5RDkx?=
 =?utf-8?B?LzQ2Yms0YklySVFlVU1KRWVQZXcycWhKQnJLa1BZWGVmeitseVQ0aWFydTFO?=
 =?utf-8?B?QlVqSW1zWUozUVRMSFNFSHJKNTlmNktPYm1ob1lQalRnUmN4UUdtNjdNdUZP?=
 =?utf-8?B?L2JSU2ppS01FcitTNllKZWNyRVgzaTdzRFovcDF0R0tpdy9ZOFNFUkV2VG1t?=
 =?utf-8?B?UitDWm9JU0pRN2piT2MxS2VyZnR1Qlg3enJWS1NlRTlGYytMcXpsWGg1UFFO?=
 =?utf-8?B?YzhFYXV1L1hTanZhZWN3dHBGa0tKdzZXVmkwNnp6Q3ZUanRqaWVFN0xzZ1Q4?=
 =?utf-8?B?cERxbjk5YVh5eTJjL3FubVU3S2lGOC9wbElOS2FWMjhoV3FIb2VPamFjMFVG?=
 =?utf-8?B?aTFnYkxkSmpwcTRkRnY3bW16cTJDa0JOeDVoNG5hN3VhenV5ZWVydTNhTEps?=
 =?utf-8?B?RnlSSG1jenp2OTg0MGY3T2JWVU5JdGxXSjhNbVhWdDA2bzhuM1JxV0ZDZllL?=
 =?utf-8?B?aWMyYm9yaWhWRV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Me2Gf+XNKup4ZqliaYp9BCGcJkTJMc2HNUe4QFEHaMv+g3/ep+h7qdgogjOuvmCJThQujsfR37TrY+4NbpVBD86+shCt7POo+O74SnuFLf/3romzE0hMre3/yEZyf5qCRLztkcDINdpjbgUouJ0xrNLD841O2JrAtT3TN/g9YgevpERlo6NxCQALyEyIxfUF4eNByyRli+dPsCmOi0a84posHvDnJp+mD9w3NEooEhWiulb4LguxpznJhy3Uqb8Zlyk5IlNm/oqsgcpY8Bfw5q0TCLa0LW8AK/IUvpdB51k8elFLwm8AyFGQyEUgqKZ2PmJNgAQ39vQ3VDrtk6DU7/gYZ137tJF1so3yVbhtvUuZzib3Z/VYNvrvZMQMlPerz+RhkxLn/HBKRB/Rf4dtAin9v0eeNk9ofrbX8PCz4uWcEahypHDfopV4LoCQCePZ0Vg8YF8yvELK39uzenVm5fi/80P9pgsjz9fCYXeu/sDIi6VlwSo6fX2uBrpxUKJQ22Mc32HPWN2TbQqzWjXrTOAHFnDfMk4IBjgmt95QNGCrMWMeqqf+4G/9ahmLTVk4jppChHCPyPphA7eoeehzBQx3fwwY+DzaUqOAJbZRNSQYmzxJh+quoTEQtTghLhT9hM8YS5cgvfVy+JnCC2/X72S8OeExUzJjfjUWrdBSwZD+iwIJCJLZdhXA9G4J1ruSupsXYZ/ispky/5DDHdtmM3/2ToJZRJnt4lnCjA/prQ2G8nXscZv5Jsu9HcobTjhaMTHll6I7c
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c506a535-bb7f-414d-682e-08db86d32e3d
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 14:36:17.8067
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Ig73PxI+XbVHyGxD1sQmJPjzG8uaIkw6BobMZUP1xXxH/4e97M2FbLeaozXNW1wf+Zl0gwlvexXOMpLEsiwoGg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR03MB5618

On Wed, Jul 12, 2023 at 05:39:01PM +0100, Anthony PERARD wrote:
> On Tue, Jul 11, 2023 at 11:22:27AM +0200, Roger Pau Monne wrote:
> > Add a new array field to libxl_cpuid_policy in order to store the MSR
> > policies.
> > 
> > Note that libxl_cpuid_policy_list_{copy,length,parse_json,gen_json}
> > are not adjusted to deal with the new MSR array now part of
> > libxl_cpuid_policy_list.
> 
> Why? Isn't this going to be an issue? Or maybe that going to be dealt
> with in a future patch?

I'm unsure what's the point of those?  The CPUID/MSR data is passed as
a migration stream record from the hypervisor, so I don't see much
point into converting it into json.  It also seems quite complex, and
can't likely we done without breaking (or adjusting) the current
format.

My plan was to leave this unimplemented and if someone is in
interested in having the data in json they can as well implement it.

Would you be OK if I add a note to the commit message that
implementing json marshalling is left to implement for interested
parties?

> > 
> > Adding the MSR data in the libxl_cpuid_policy_list type is done so
> > that existing users can seamlessly pass MSR features as part of the
> > CPUID data, without requiring the introduction of a separate
> > domain_build_info field, and a new set of handlers functions.
> > 
> > Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> > ---
> >  tools/libs/light/libxl_cpuid.c    | 6 +++++-
> >  tools/libs/light/libxl_internal.h | 1 +
> >  2 files changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
> > index 724cb4f182d4..65cad28c3ef0 100644
> > --- a/tools/libs/light/libxl_cpuid.c
> > +++ b/tools/libs/light/libxl_cpuid.c
> > @@ -40,6 +40,9 @@ void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl)
> >          free(policy->cpuid);
> >      }
> >  
> > +    if (policy->msr)
> 
> You don't need to test for NULL, you can call free() in this case as
> well.

Right, thanks, will adjust.

Roger.


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 14:41:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 14:41:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564649.882232 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPPG-0001u7-IQ; Mon, 17 Jul 2023 14:40:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564649.882232; Mon, 17 Jul 2023 14:40:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPPG-0001u0-FO; Mon, 17 Jul 2023 14:40:58 +0000
Received: by outflank-mailman (input) for mailman id 564649;
 Mon, 17 Jul 2023 14:40:56 +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
 <SRS0=7PMI=DD=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qLPPE-0001ez-Ns
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 14:40:56 +0000
Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com
 [2a00:1450:4864:20::12f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ef0ed431-24af-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 16:40:54 +0200 (CEST)
Received: by mail-lf1-x12f.google.com with SMTP id
 2adb3069b0e04-4fb5bcb9a28so7148089e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 07:40:54 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 d15-20020ac25ecf000000b004fa52552c7csm2836284lfq.151.2023.07.17.07.40.52
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 07:40:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ef0ed431-24af-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689604854; x=1692196854;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=QBlRt/eLkcOx9/rMqbNC3rpBXs9fe5vg/Iz41dVCAXo=;
        b=R0OJOGSGMRA3L5xJ+g+VuuKu0HRCRpEVVse9yDLzxhrQiukS0imsKDGd/jfQ1bHFc6
         jxN/rG68t6fjg/txNQ9fbijDiq+As73FaRMH4sIaDfCQy5PwswRv6/Cy5R9Z+dI7+1qr
         9psyTc2Rq0in8QUM0S1X9yl4t8bI0lgpwhQv1y3bfdc8zByUwq+0Pzp2e696rpGnXY7h
         4VDlkbXpTFdfF/GDiZsP7TieFlQXWcHJIjCbXx1j09t468vnjafCLxXTcar57/ru/W0n
         Uca+GnxPV4qAQ9jTyLtXxLPHyR2mV3xC8zRAAfMd0sLvwruR0OVx5bMiyajnPBrMWZ8p
         /CeQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689604854; x=1692196854;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=QBlRt/eLkcOx9/rMqbNC3rpBXs9fe5vg/Iz41dVCAXo=;
        b=lySPXmPM55/4kUb+xr2GoTpz9uiHQFHS3/+xY2gCypLTGTb/anvbmWN0tRnTdaC+A0
         OrP+K+bvy1a7HehovjX5eoqpYhlVeFxkWxFfEsl0NzlnYn10EG/TgAXYz9FNer+4QwB+
         d7JMNf0JQTOI/g+aVXLqlT4aILfzKrM3mI+fyS0uoJQKl/zPqESUuBruV+TsmbJU1RDi
         l9KOkJRJ9P0/hZsMUouBx5YOUBUEcnURrRhtLJricceZW/fWU/Dc4yynjk6VlmhHvSIf
         IDbLIzO/vk/3lYf39A8I3jwkFvmGXXrZmjQJDdpTPjK3UCdHLw1T54VpgMeupJFRtbz3
         4ibg==
X-Gm-Message-State: ABy/qLb3k1B5SBHpt2z5/vEp6VXLm65q/JkHZigdviNgyTnWCKr0nfD6
	jfqoWt5Cb+atcEPfix+y6rI696UUWviP+Key
X-Google-Smtp-Source: APBJJlGGmL52hKjGshCyBxap3Fa+CABXdk1a/uTuedrch+jlr9tf8MywdLBMlbuZBkudVs+Ko0NWNA==
X-Received: by 2002:a05:6512:39cb:b0:4fd:c884:51fc with SMTP id k11-20020a05651239cb00b004fdc88451fcmr235633lfu.58.1689604853382;
        Mon, 17 Jul 2023 07:40:53 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>
Subject: [PATCH v3 0/3] xen/riscv: introduce identity mapping
Date: Mon, 17 Jul 2023 17:40:47 +0300
Message-ID: <cover.1689604562.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The patch series introduces things necessary to implement identity mapping:
  1. Make identity mapping for the entire Xen.
  2. Enable MMU.
  3. Jump to the virtual address world
  4. Remove identity mapping.

Also current patch series introduces the calculation of physical offset before
MMU is enabled as access to physical offset will be calculated wrong after
MMU will be enabled because access to phys_off variable is PC-relative and
in the case when linker address != load address, it will cause MMU fault.

The reason for this patch series can be found here:
https://lore.kernel.org/xen-devel/4e336121-fc0c-b007-bf7b-430352563d55@citrix.com/

---
Changes in V3:
 - Update the patch series message.
 - The following patches were merged to staging so droped from the patch series:
   * xen/riscv: add .sbss section to .bss
   * xen/riscv: introduce reset_stack() function
   * xen/riscv: move extern of cpu0_boot_stack to header
   * xen/riscv: add SPDX tags
 - move save/restore of a0/a1 registers from patch 4 to patch 2 ( numbers are
   from the previous patch series version )
 - add SPDX tag in config.h
 - update definition of PGTBL_INITIAL_COUNT taking into account identity mapping.
 - refactor remove_identity_mapping() function.
 - add explanatory comments in xen.lds.S and mm.c.
---
Changes in V2:
 - update the patch series message.
 - drop patches from the previous version of the patch series:
   * xen/riscv: add __ASSEMBLY__ guards". ( merged )
   * xen/riscv: make sure that identity mapping isn't bigger then page size
     ( entire Xen is 1:1 mapped so there is no need for the checks from the patch )
 - add .sbss.* and put it befor .bss* .
 - move out reset_stack() to .text section.
 - add '__ro_after_init' for phys_offset variable.
 - add '__init' for calc_phys_offset().
 - declaring variable phys_off as non static as it will be used in head.S.
 - update definition of PGTBL_INITIAL_COUNT and the comment above.
 - code style fixes.
 - remove id_addrs array becase entire Xen is mapped.
 - reverse condition for cycle inside remove_identity_mapping().
 - fix page table walk in remove_identity_mapping().
 - save hart_id and dtb_addr before call MMU related C functions
 - use phys_offset variable instead of doing calcultations to get phys offset
   in head.S file. ( it can be easily done as entire Xen is 1:1 mapped now )
 - declare enable_muu() as __init.
 - Update SPDX tags.
 - Add Review-By/Suggested-By for some patches.
 - code style fixes.

Oleksii Kurochko (3):
  xen/riscv: add SPDX tag to config.h
  xen/riscv: introduce function for physical offset calculation
  xen/riscv: introduce identity mapping

 xen/arch/riscv/include/asm/config.h |   2 +
 xen/arch/riscv/include/asm/mm.h     |   5 +-
 xen/arch/riscv/mm.c                 | 116 ++++++++++++++++++----------
 xen/arch/riscv/riscv64/head.S       |  36 +++++++++
 xen/arch/riscv/setup.c              |  14 +---
 xen/arch/riscv/xen.lds.S            |   4 +
 6 files changed, 125 insertions(+), 52 deletions(-)

-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 14:41:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 14:41:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564650.882238 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPPG-0001xd-Sq; Mon, 17 Jul 2023 14:40:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564650.882238; Mon, 17 Jul 2023 14:40:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPPG-0001wr-NN; Mon, 17 Jul 2023 14:40:58 +0000
Received: by outflank-mailman (input) for mailman id 564650;
 Mon, 17 Jul 2023 14:40:56 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7PMI=DD=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qLPPE-0001et-OU
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 14:40:56 +0000
Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com
 [2a00:1450:4864:20::131])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id efff9087-24af-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 16:40:56 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-4fb761efa7aso7191250e87.0
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 07:40:56 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 d15-20020ac25ecf000000b004fa52552c7csm2836284lfq.151.2023.07.17.07.40.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 07:40:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: efff9087-24af-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689604855; x=1692196855;
        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=ThvgRboCSDvEXREJE4U7nta8TE4rl24QuMRMslv53Fs=;
        b=baas+kJb+izOVZb1HqVPerYDBD5um4bsPdwHvTdQcUoRklgfIMyNP4Jldgk/PYT31P
         qnGD2DECyCR9D7iWXOAnoMnvPWN/46/QNfE5ykbRXb+uHKYcFcvY2iQgDVcfm6S7x+pB
         5Ws7MZtVK3UtUF+Xn4nLvV+DlBjZmF8JT0GT8OFKz4+y5SXnKeSXlSVSY9mXAD+ObXT0
         do+GApBZa+ZKZJRfHnRpgZuqgZS72wVtYwwH659IFnXn7eobyW8/5UoS8g5S4ZiFTgNz
         CwkYw6wOGtWTw1OCV0u8uNpvQAQUSjHaLruxzBx3AGmjdiyPPzu/uJmOTVQEwS9ycG8D
         TwVg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689604855; x=1692196855;
        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=ThvgRboCSDvEXREJE4U7nta8TE4rl24QuMRMslv53Fs=;
        b=ZQdki3jVDYLWWnhvRrvqVbKQ84i3ieaEhbcyv63nKslp6n9PnCxFSHRWYY2umxtL1L
         g36y+RA151hZfnKRT+47ElUa5zwQyOCpcqVpBkyw9AOjp1y2hqDBXp7jMuJN60S2qzPN
         kWp/FsJ+7sGC+G7eewiBCckXdLUXxS98b3FIIutT+I+xiaBrxeD/D1LK5pZE7QGQQdBx
         7Rysi5w882YReoYfqxQ63+f+aI2sDWXBIZCXGxVbE5MlrvrPdqFGHosu3MheMlNt1te+
         QkIRhG94u+QGj5IVUaCsqwGRziENg7ug6kRNqW33+4bmfqfFLnEhlOZa1D4zdU4oPG1m
         ig1A==
X-Gm-Message-State: ABy/qLYtR4kHovp4O39tgm7OGt2XevJAzAEzIjjzdYvc/tMp/pmtSiaw
	EdxBq1EeVIJHdl5hvp84R4NegvOfWuoBTest
X-Google-Smtp-Source: APBJJlGu1YQLCviMcAIgoznHE/5aMvL6olLbw4P9LoNcE05IS4TGDEjo1zWxrA3877a0svdcuTeyFQ==
X-Received: by 2002:a05:6512:2813:b0:4fd:bdf8:9326 with SMTP id cf19-20020a056512281300b004fdbdf89326mr2509197lfb.67.1689604855144;
        Mon, 17 Jul 2023 07:40:55 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>
Subject: [PATCH v3 3/3] xen/riscv: introduce identity mapping
Date: Mon, 17 Jul 2023 17:40:50 +0300
Message-ID: <8c69050d7b1f42df5e776ca9494164a4d15f2d52.1689604562.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1689604562.git.oleksii.kurochko@gmail.com>
References: <cover.1689604562.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The way how switch to virtual address was implemented in the
commit e66003e7be ("xen/riscv: introduce setup_initial_pages")
isn't safe enough as:
* enable_mmu() depends on hooking all exceptions
  and pagefault.
* Any exception other than pagefault, or not taking a pagefault
  causes it to malfunction, which means you will fail to boot
  depending on where Xen was loaded into memory.

Instead of the proposed way of switching to virtual addresses was
decided to use identity mapping of the entrire Xen and after
switching to virtual addresses identity mapping is removed from
page-tables.
Since it is not easy to keep track where the identity map was mapped,
so we will look for the top-most entry exclusive to the identity
map and remove it.

Fixes: e66003e7be ("xen/riscv: introduce setup_initial_pages")
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
Changes in V3:
 - remove unrelated to the patch changes ( SPDX tags in config.h ).
 - update definition of PGTBL_INITIAL_COUNT taking into account identity mapping.
 - refactor remove_identity_mapping() function.
 - add explanatory comments in xen.lds.S and mm.c.
 - update commit message.
 - move save/restore of a0/a1 registers to [PATCH v2 2/3] xen/riscv: introduce
   function for physical offset calculation.
---
Changes in V2:
  - update definition of PGTBL_INITIAL_COUNT and the comment above.
  - code style fixes.
  - 1:1 mapping for entire Xen.
  - remove id_addrs array becase entire Xen is mapped.
  - reverse condition for cycle inside remove_identity_mapping().
  - fix page table walk in remove_identity_mapping().
  - update the commit message.
  - add Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
  - save hart_id and dtb_addr before call MMU related C functions.
  - use phys_offset variable instead of doing calcultations to get phys offset
    in head.S file. ( it can be easily done as entire Xen is 1:1 mapped )
  - declare enable_muu() as __init.
---
 xen/arch/riscv/include/asm/mm.h |  3 +-
 xen/arch/riscv/mm.c             | 98 +++++++++++++++++++++------------
 xen/arch/riscv/riscv64/head.S   | 22 ++++++++
 xen/arch/riscv/setup.c          | 14 +----
 xen/arch/riscv/xen.lds.S        |  4 ++
 5 files changed, 92 insertions(+), 49 deletions(-)

diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index d9c4205103..085eaab7fb 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -13,7 +13,8 @@ extern unsigned char cpu0_boot_stack[];
 void setup_initial_pagetables(void);
 
 void enable_mmu(void);
-void cont_after_mmu_is_enabled(void);
+
+void remove_identity_mapping(void);
 
 void calc_phys_offset(void);
 
diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index c84a8a7c3c..34cd62eefe 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -25,6 +25,12 @@ unsigned long __ro_after_init phys_offset;
 #define LOAD_TO_LINK(addr) ((unsigned long)(addr) - phys_offset)
 #define LINK_TO_LOAD(addr) ((unsigned long)(addr) + phys_offset)
 
+/*
+ * Should be removed as soon as enough headers will be merged for inclusion of
+ * <xen/lib.h>.
+ */
+#define ARRAY_SIZE(arr)		(sizeof(arr) / sizeof((arr)[0]))
+
 /*
  * It is expected that Xen won't be more then 2 MB.
  * The check in xen.lds.S guarantees that.
@@ -35,8 +41,10 @@ unsigned long __ro_after_init phys_offset;
  *
  * It might be needed one more page table in case when Xen load address
  * isn't 2 MB aligned.
+ *
+ * CONFIG_PAGING_LEVELS page tables are needed for identity mapping.
  */
-#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) + 1)
+#define PGTBL_INITIAL_COUNT (CONFIG_PAGING_LEVELS * 2 + 1)
 
 pte_t __section(".bss.page_aligned") __aligned(PAGE_SIZE)
 stage1_pgtbl_root[PAGETABLE_ENTRIES];
@@ -75,6 +83,7 @@ static void __init setup_initial_mapping(struct mmu_desc *mmu_desc,
     unsigned int index;
     pte_t *pgtbl;
     unsigned long page_addr;
+    bool is_identity_mapping = map_start == pa_start;
 
     if ( (unsigned long)_start % XEN_PT_LEVEL_SIZE(0) )
     {
@@ -108,16 +117,18 @@ static void __init setup_initial_mapping(struct mmu_desc *mmu_desc,
             {
                 unsigned long paddr = (page_addr - map_start) + pa_start;
                 unsigned int permissions = PTE_LEAF_DEFAULT;
+                unsigned long addr = is_identity_mapping
+                                     ? page_addr : LINK_TO_LOAD(page_addr);
                 pte_t pte_to_be_written;
 
                 index = pt_index(0, page_addr);
 
-                if ( is_kernel_text(LINK_TO_LOAD(page_addr)) ||
-                     is_kernel_inittext(LINK_TO_LOAD(page_addr)) )
-                    permissions =
-                        PTE_EXECUTABLE | PTE_READABLE | PTE_VALID;
+                if ( is_kernel_text(addr) ||
+                     is_kernel_inittext(addr) )
+                        permissions =
+                            PTE_EXECUTABLE | PTE_READABLE | PTE_VALID;
 
-                if ( is_kernel_rodata(LINK_TO_LOAD(page_addr)) )
+                if ( is_kernel_rodata(addr) )
                     permissions = PTE_READABLE | PTE_VALID;
 
                 pte_to_be_written = paddr_to_pte(paddr, permissions);
@@ -211,6 +222,10 @@ void __init setup_initial_pagetables(void)
     unsigned long linker_start  = LOAD_TO_LINK(load_start);
     unsigned long linker_end    = LOAD_TO_LINK(load_end);
 
+    /*
+     * If the overlapping check will be removed then remove_identity_mapping()
+     * logic should be updated.
+     */
     if ( (linker_start != load_start) &&
          (linker_start <= load_end) && (load_start <= linker_end) )
     {
@@ -232,22 +247,18 @@ void __init setup_initial_pagetables(void)
                           linker_start,
                           linker_end,
                           load_start);
+
+    if ( linker_start == load_start )
+        return;
+
+    setup_initial_mapping(&mmu_desc,
+                          load_start,
+                          load_end,
+                          load_start);
 }
 
-void __init noreturn noinline enable_mmu()
+void __init enable_mmu(void)
 {
-    /*
-     * Calculate a linker time address of the mmu_is_enabled
-     * label and update CSR_STVEC with it.
-     * MMU is configured in a way where linker addresses are mapped
-     * on load addresses so in a case when linker addresses are not equal
-     * to load addresses, after MMU is enabled, it will cause
-     * an exception and jump to linker time addresses.
-     * Otherwise if load addresses are equal to linker addresses the code
-     * after mmu_is_enabled label will be executed without exception.
-     */
-    csr_write(CSR_STVEC, LOAD_TO_LINK((unsigned long)&&mmu_is_enabled));
-
     /* Ensure page table writes precede loading the SATP */
     sfence_vma();
 
@@ -255,25 +266,40 @@ void __init noreturn noinline enable_mmu()
     csr_write(CSR_SATP,
               PFN_DOWN((unsigned long)stage1_pgtbl_root) |
               RV_STAGE1_MODE << SATP_MODE_SHIFT);
+}
 
-    asm volatile ( ".p2align 2" );
- mmu_is_enabled:
-    /*
-     * Stack should be re-inited as:
-     * 1. Right now an address of the stack is relative to load time
-     *    addresses what will cause an issue in case of load start address
-     *    isn't equal to linker start address.
-     * 2. Addresses in stack are all load time relative which can be an
-     *    issue in case when load start address isn't equal to linker
-     *    start address.
-     *
-     * We can't return to the caller because the stack was reseted
-     * and it may have stash some variable on the stack.
-     * Jump to a brand new function as the stack was reseted
-     */
+void __init remove_identity_mapping(void)
+{
+    unsigned int i;
+    pte_t *pgtbl;
+    unsigned int index, xen_index;
+    unsigned long load_start = LINK_TO_LOAD(_start);
+
+    for ( pgtbl = stage1_pgtbl_root, i = CONFIG_PAGING_LEVELS; i; i-- )
+    {
+        index = pt_index(i - 1, load_start);
+        xen_index = pt_index(i - 1, XEN_VIRT_START);
+
+        if ( index != xen_index )
+        {
+            /* remove after it will be possible to include <xen/lib.h> */
+            #define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
+
+            unsigned long load_end = LINK_TO_LOAD(_end);
+            unsigned long pt_level_size = XEN_PT_LEVEL_SIZE(i - 1);
+            unsigned long xen_size = ROUNDUP(load_end - load_start, pt_level_size);
+            unsigned long page_entries_num = xen_size / pt_level_size;
+
+            while ( page_entries_num-- )
+                pgtbl[index++].pte = 0;
+
+            break;
 
-    switch_stack_and_jump((unsigned long)cpu0_boot_stack + STACK_SIZE,
-                          cont_after_mmu_is_enabled);
+            #undef ROUNDUP
+        }
+
+        pgtbl = (pte_t *)pte_to_paddr(pgtbl[index]);
+    }
 }
 
 /*
diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S
index 9015d06233..41983ffe63 100644
--- a/xen/arch/riscv/riscv64/head.S
+++ b/xen/arch/riscv/riscv64/head.S
@@ -39,6 +39,28 @@ ENTRY(start)
 
         jal     calc_phys_offset
 
+        jal     setup_initial_pagetables
+
+        jal     enable_mmu
+
+        la      t1, phys_offset
+        REG_L   t1, (t1)
+
+        /* Calculate proper VA after jump from 1:1 mapping */
+        la      t0, .L_primary_switched
+        sub     t0, t0, t1
+
+        /* Jump from 1:1 mapping world */
+        jr      t0
+
+.L_primary_switched:
+        /*
+         * cpu0_boot_stack address is 1:1 mapping related so it should be
+         * recalculated after jump from 1:1 mapping world as 1:1 mapping
+         * will be removed soon in start_xen().
+         */
+        jal     reset_stack
+
         /* restore bootcpu_id and dtb address */
         mv      a0, s0
         mv      a1, s1
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index dde8fb898b..6593f601c1 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -13,20 +13,10 @@ unsigned char __initdata cpu0_boot_stack[STACK_SIZE]
 void __init noreturn start_xen(unsigned long bootcpu_id,
                                paddr_t dtb_addr)
 {
-    early_printk("Hello from C env\n");
-
-    setup_initial_pagetables();
-
-    enable_mmu();
-
-    for ( ;; )
-        asm volatile ("wfi");
+    remove_identity_mapping();
 
-    unreachable();
-}
+    early_printk("Hello from C env\n");
 
-void __init noreturn cont_after_mmu_is_enabled(void)
-{
     early_printk("All set up\n");
 
     for ( ;; )
diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S
index 9064852173..31ccebadcb 100644
--- a/xen/arch/riscv/xen.lds.S
+++ b/xen/arch/riscv/xen.lds.S
@@ -173,4 +173,8 @@ ASSERT(IS_ALIGNED(__bss_end,        POINTER_ALIGN), "__bss_end is misaligned")
 ASSERT(!SIZEOF(.got),      ".got non-empty")
 ASSERT(!SIZEOF(.got.plt),  ".got.plt non-empty")
 
+/*
+ * Changing the size of Xen binary can require an update of
+ * PGTBL_INITIAL_COUNT.
+ */
 ASSERT(_end - _start <= MB(2), "Xen too large for early-boot assumptions")
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 14:41:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 14:41:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564648.882224 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPPF-0001fH-C3; Mon, 17 Jul 2023 14:40:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564648.882224; Mon, 17 Jul 2023 14:40:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPPF-0001fA-7K; Mon, 17 Jul 2023 14:40:57 +0000
Received: by outflank-mailman (input) for mailman id 564648;
 Mon, 17 Jul 2023 14:40:56 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7PMI=DD=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qLPPE-0001et-5Y
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 14:40:56 +0000
Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com
 [2a00:1450:4864:20::131])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ef4b8576-24af-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 16:40:54 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-4fb73ba3b5dso7391572e87.1
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 07:40:54 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 d15-20020ac25ecf000000b004fa52552c7csm2836284lfq.151.2023.07.17.07.40.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 07:40:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ef4b8576-24af-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689604854; x=1692196854;
        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=86bE+p7Hxw5Gz73vFM8aRB3dE1wjdojg3oCvM9iMbYA=;
        b=ktGc+eaqEDQhLhlXkpPMkf8Yup9uv3ZZhwUvwN09uESTm9HKRL9YoDUgcoHLb2btJt
         N/aN0QXVuew9ot5rVdeWLyZajsMS07pr0I4ATaBkTsE8DksgpciHsqZwDEfu/VpXwhyd
         PdQm/rPTPI88Yp6UJ1PrUCbWawknzNBVtZgoO9736rURXADiQrAWDbwpjdqqFmNoWXmk
         roLAgLTnAznXXMf/nTdheqrlMSL0Ee09cLyJ1EpbCRZYnEBrpijqSO7bcdENedKxXGTv
         huiJH7CXoOb/wEzTD83e4Bq9+mCNdIoSchG+yBuoz5h4p0qY/PTIkH3PjknX/JDvdOJp
         Mh9w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689604854; x=1692196854;
        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=86bE+p7Hxw5Gz73vFM8aRB3dE1wjdojg3oCvM9iMbYA=;
        b=ehAjnrq5Mb9QOtDXpm7IAEbDWrqgFv+zmZ6OGuQFsz/QgGWRjvSSMx6gTuO9/zsJdW
         X/NAbNvK4TF5C5tQLef+7OlFRVfb3OMHJF89AWcUjATPl9mU98IxqeVlAJAVJ/VMI73r
         TNeLEqJ6b+DyxsbiXVM3y05qtrWoQaYqDvPLQlsMGRkC+OYqql4oy5plWSqjPMXQat14
         eisGtFXCOdNesL58+azC05zdhkE7XQj5zAEOAwLpP+8Z5mUp5jcAR2562OnRdziyoMto
         35LjDSmPdQ70nDmvZcNKI6PswJARqhzQRJzIwKfSt/rwACyKozOSRfSk2CN6QOv/go5r
         MfLQ==
X-Gm-Message-State: ABy/qLZ0Jme0Br5mr5QwxrAlDF0BGsKtAW6yU33BB/3Rm/tgVw1LBezR
	6JvonDMG0FXc53qIYBT3KRSsvRdcXTfn0BTx
X-Google-Smtp-Source: APBJJlExYZ0gpssEtZnQNPUbtq40+5t2KLQdYzOLL8k+/bK9K37XH766j4UGRGKf4M95Z6MdWC8O7w==
X-Received: by 2002:a05:6512:39d2:b0:4f6:3000:94a0 with SMTP id k18-20020a05651239d200b004f6300094a0mr9538264lfu.61.1689604853957;
        Mon, 17 Jul 2023 07:40:53 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>
Subject: [PATCH v3 1/3] xen/riscv: add SPDX tag to config.h
Date: Mon, 17 Jul 2023 17:40:48 +0300
Message-ID: <2e4580f06b0b9d3b98e70536e3b2b990ec4269a0.1689604562.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1689604562.git.oleksii.kurochko@gmail.com>
References: <cover.1689604562.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V3:
 - new patch
---
 xen/arch/riscv/include/asm/config.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/asm/config.h
index 38862df0b8..fa90ae0898 100644
--- a/xen/arch/riscv/include/asm/config.h
+++ b/xen/arch/riscv/include/asm/config.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
 #ifndef __RISCV_CONFIG_H__
 #define __RISCV_CONFIG_H__
 
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 14:41:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 14:41:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564651.882245 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPPH-00027B-8a; Mon, 17 Jul 2023 14:40:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564651.882245; Mon, 17 Jul 2023 14:40:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPPH-00025T-4f; Mon, 17 Jul 2023 14:40:59 +0000
Received: by outflank-mailman (input) for mailman id 564651;
 Mon, 17 Jul 2023 14:40:57 +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
 <SRS0=7PMI=DD=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qLPPF-0001ez-CU
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 14:40:57 +0000
Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com
 [2a00:1450:4864:20::12c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id efa3b88a-24af-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 16:40:55 +0200 (CEST)
Received: by mail-lf1-x12c.google.com with SMTP id
 2adb3069b0e04-4f122ff663eso7234949e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 07:40:55 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 d15-20020ac25ecf000000b004fa52552c7csm2836284lfq.151.2023.07.17.07.40.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 07:40:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: efa3b88a-24af-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689604855; x=1692196855;
        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=z/2F9nnRVGFmm2tz+bdsw6Ss/1KfKE3SpzTYZVGLTXE=;
        b=lqUs0GUk7T/Gmfti/vLam1duKm80RulBZAv5/pC438w509C/VdzpUtRARpk1mdtS8O
         LVVsWdNfrBqTzDiIZhfUiqE/+QyQEA4CVZuSgXUTp0BPXHTmgmEvkGcD5s26E2HfsU2k
         U6ap/WfqpbIMaazzLbi0+IRO5lGNiOYiAH0VIKFJ4f8CExAdRfEj4N87vuR41htGlOgq
         5IOt1wKxw5afMuqob/p88EbavgD70kEj1Rvhu+gGDdoMz1+4tGV1C2FyyctOGkFQ4//J
         edGoXgMPM55VcGS99TCOs8A+e4jcF8soCMKk0fyMAK60r/Un0Vc4Wasi2oPTeyA3QW6c
         vDdQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689604855; x=1692196855;
        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=z/2F9nnRVGFmm2tz+bdsw6Ss/1KfKE3SpzTYZVGLTXE=;
        b=lSuTScOs2V+oeAeQB1MrxU0d2e+gpQ1twZ+UE7pWg/h1vyFavcl03sQS6pG8VOtCxe
         WDLW/TFgVUE5IGjOkzPwuaVdIx2aIMSlm46N26YVYDzUkPNzEIx5OwAYq9domU+2rLpg
         iJVp/O8qftu9T+9cIOSkNmfzznmm5U4T0DfJEOEUmtuSzlfhMlnItIeeIZAIxtlnSmj1
         fAEnmV0yHDiOu+RfB9wUm2c1sraLrURDfH02TUFN+kYV/ZrEBhB5wA8+NxQfyofK2/M7
         UsidH2e/33fSGygTBUIlaDXGpeawqRGzbYt5iFjUrSfeZ/ECeSi2Vh8jc5VY8Olspx8j
         lIWQ==
X-Gm-Message-State: ABy/qLYrsMY1OZmBpaNlPWMPJXlONrhRs5jhmD6ZwtiT7LZB6e2AiDB8
	FgZSUrn3FWFIbf5qq+FY1SoSbyp9dS0k0Yqv
X-Google-Smtp-Source: APBJJlFbutT6L4rml+gTbWHiN8ncHVcF6LtvPPIHXQ+IgNKQ+o4+k4iQ8zhsq57OXAtV6O45uHT+og==
X-Received: by 2002:a05:6512:b17:b0:4fb:c67e:b067 with SMTP id w23-20020a0565120b1700b004fbc67eb067mr7689109lfu.66.1689604854547;
        Mon, 17 Jul 2023 07:40:54 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>
Subject: [PATCH v3 2/3] xen/riscv: introduce function for physical offset calculation
Date: Mon, 17 Jul 2023 17:40:49 +0300
Message-ID: <f86724014bf5234f22cd18e7b3da8e8aa83e1e08.1689604562.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1689604562.git.oleksii.kurochko@gmail.com>
References: <cover.1689604562.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The function was introduced to calculate and save physical
offset before MMU is enabled because access to start() is
PC-relative and in case of linker_addr != load_addr it will
result in incorrect value in phys_offset.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V3:
 - save/restore of a0/a1 registers before C first function call.
---
Changes in V2:
  - add __ro_after_init for phys_offset variable.
  - remove double blank lines.
  - add __init for calc_phys_offset().
  - update the commit message.
  - declaring variable phys_off as non static as it will be used in head.S.
---
 xen/arch/riscv/include/asm/mm.h |  2 ++
 xen/arch/riscv/mm.c             | 18 +++++++++++++++---
 xen/arch/riscv/riscv64/head.S   | 14 ++++++++++++++
 3 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 5e3ac5cde3..d9c4205103 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -15,4 +15,6 @@ void setup_initial_pagetables(void);
 void enable_mmu(void);
 void cont_after_mmu_is_enabled(void);
 
+void calc_phys_offset(void);
+
 #endif /* _ASM_RISCV_MM_H */
diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index fddb3cd0bd..c84a8a7c3c 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
+#include <xen/cache.h>
 #include <xen/compiler.h>
 #include <xen/init.h>
 #include <xen/kernel.h>
@@ -19,9 +20,10 @@ struct mmu_desc {
     pte_t *pgtbl_base;
 };
 
-#define PHYS_OFFSET ((unsigned long)_start - XEN_VIRT_START)
-#define LOAD_TO_LINK(addr) ((addr) - PHYS_OFFSET)
-#define LINK_TO_LOAD(addr) ((addr) + PHYS_OFFSET)
+unsigned long __ro_after_init phys_offset;
+
+#define LOAD_TO_LINK(addr) ((unsigned long)(addr) - phys_offset)
+#define LINK_TO_LOAD(addr) ((unsigned long)(addr) + phys_offset)
 
 /*
  * It is expected that Xen won't be more then 2 MB.
@@ -273,3 +275,13 @@ void __init noreturn noinline enable_mmu()
     switch_stack_and_jump((unsigned long)cpu0_boot_stack + STACK_SIZE,
                           cont_after_mmu_is_enabled);
 }
+
+/*
+ * calc_phys_offset() should be used before MMU is enabled because access to
+ * start() is PC-relative and in case when load_addr != linker_addr phys_offset
+ * will have an incorrect value
+ */
+void __init calc_phys_offset(void)
+{
+    phys_offset = (unsigned long)start - XEN_VIRT_START;
+}
diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S
index 2c0304646a..9015d06233 100644
--- a/xen/arch/riscv/riscv64/head.S
+++ b/xen/arch/riscv/riscv64/head.S
@@ -29,6 +29,20 @@ ENTRY(start)
 
         jal     reset_stack
 
+        /*
+         * save hart_id and dtb_base as a0 and a1 register can be used
+         * by C code ( f.e. setup_initial_pagetables will update a0 and
+         * a1 )
+         */
+        mv      s0, a0
+        mv      s1, a1
+
+        jal     calc_phys_offset
+
+        /* restore bootcpu_id and dtb address */
+        mv      a0, s0
+        mv      a1, s1
+
         tail    start_xen
 
         .section .text, "ax", %progbits
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 14:46:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 14:46:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564666.882263 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPUp-0003zZ-24; Mon, 17 Jul 2023 14:46:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564666.882263; Mon, 17 Jul 2023 14:46:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPUo-0003zS-Um; Mon, 17 Jul 2023 14:46:42 +0000
Received: by outflank-mailman (input) for mailman id 564666;
 Mon, 17 Jul 2023 14:46:42 +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
 <SRS0=RVQe=DD=citrix.com=prvs=555fa4c0e=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qLPUo-0003zK-1I
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 14:46:42 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ba7ae29a-24b0-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 16:46:37 +0200 (CEST)
Received: from mail-dm6nam11lp2176.outbound.protection.outlook.com (HELO
 NAM11-DM6-obe.outbound.protection.outlook.com) ([104.47.57.176])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 17 Jul 2023 10:46:34 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by MW4PR03MB6363.namprd03.prod.outlook.com (2603:10b6:303:11e::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Mon, 17 Jul
 2023 14:46:32 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 14:46:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ba7ae29a-24b0-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689605197;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=AKc1rayZswtsI6jewBKzEIGp5stt7lwKm0+5C4FcIWQ=;
  b=AKxHB/ji6DKbiw61nsVFl84PTRZiicRHCoMocg2t73ctTeBDKNTHeVji
   KdRqmdxcg8fGP7mtBIAxgMt8bYPsodgdxZ+A9YFj/u7CzYzNwsomi+Koj
   HoqnViGHme8vLKo2W5z1WDwn7d0i///51ecjtFIAcngT0+wIjKW0b8ZsY
   M=;
X-IronPort-RemoteIP: 104.47.57.176
X-IronPort-MID: 116348375
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:CUiE4agBkJQ3ivKnX8Hm7TWuX161RBEKZh0ujC45NGQN5FlHY01je
 htvUGmHOaqIZ2Oge95yaYi0/BxXu8LWn9U1TgporiA2Rngb9cadCdqndUqhZCn6wu8v7q5Ex
 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv
 cKai8DEMRqu1iUc3lg8sspvkzsx+qyr0N8klgZmP6sT4waBzyB94K83fsldEVOpGuG4IcbiL
 wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ
 OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+
 tQAEzkGcy2gjti1/4++VulQ3dQaApHSadZ3VnFIlVk1DN4AaLWaGuDmwIEd2z09wMdTAfzZe
 swVLyJ1awjNaAFOPVFRD48imOCvhT/0dDgwRFC9/PJrpTSMilEuluGybrI5efTTLSlRtlyfq
 W/cuXzwHzkRNcCFyCrD+XWp7gPKtXqiBtlORObnq5aGhnW1z2AdJiQRCmCyvKjhq2+fR/AFI
 nQtr39GQa8asRbDosPGdw21pjuIswARX/JUEvYm80edx6zM+QGbC2MYCDlbZ7QOq8seVTEsk
 FiTkLvBBzN1t6aOYWmA7brSpjS3URX5NkcHbC4ACAcAvd/qpdhqigqVF4k9VqmoktfyBDf8h
 SiQqzQzjKkSishN0Lin+VfAgHSnoZ2hohMJ2zg7l1mNtmtRDLNJraTxgbQHxZ6s9Lqkc2Q=
IronPort-HdrOrdr: A9a23:xMXQca+CKT9BmEQY6lduk+AoI+orL9Y04lQ7vn2ZKSY5TiX4rb
 HIoB1/73XJYVkqN03I9ervBEDEewK+yXcX2/h0AV7BZmnbUQKTRekP0WKh+UyDJ8SXzIVgPM
 xbAs1D4bPLbGSTjazBkXWF+9RL+qj5zEh/792usUuETmtRGtBdBx8SMHf8LqXvLjM2f6bQEv
 Cnl7N6jgvlQ1s7ROKhCEIIWuDSzue76a4PMXY9dmYaABDlt0LS1ILH
X-Talos-CUID: =?us-ascii?q?9a23=3AZAO+sWpf/j38AIrtClpcc4DmUdgee3bA8VTZGUy?=
 =?us-ascii?q?HNGN1SIHOWWa+oJoxxg=3D=3D?=
X-Talos-MUID: 9a23:iTOGYAhlpYTc1bANzDU4I8MpEs5k7YqXDx82mIhX4+ilFDBSYT6ltWHi
X-IronPort-AV: E=Sophos;i="6.01,211,1684814400"; 
   d="scan'208";a="116348375"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CTrML7wCtpbGGMtThBoC9kAN7An2olRq7dDXqmwBoRVgnVuxyhhwA4mRtIT+zfxWeaGLI+JP0LKQoRGdUvEypi/IwzA0rL8FQm1a2smgWPBi/ncOb5yObDzBBdk/h6I+uKbjENKyzWE/VsKLVtD3FxWKmTc5gl7fHrLw+Kp6pRY4MNB6SP5n0OiaTgxtHMZ19ooEwl3YWgT5eB8HYDsMARIZi8jQIEifhbwOtbOTUauZbUxrJm26ECSeOC/RK+AJtujAcKGLq9DMM6GADa4IwGKXue6mI9yKrmW+coZAjAqUduJhRqBolalwtUA8+mILUtijfKzVCvJGwxTGQdls4w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=9XE6hngjyvDPrBecSEUxnjPDwhFaAoQ10IEUjLKS+y8=;
 b=oebvgRgMI9wWQEKuhVvIEFJOFE4fUq8w9stlwr4zHuupq/AXU3sP2sArG1tgVJxF5XhyB7ERQLs91gGBG8I/npgAshf0A/BhGVd0jAXLX9hGc5BZAXwlHaVxoln7XX7V2hOGhmv6hrQ2PU+RrzU3GR0eUKl05aEjBbB11kZ7YpJ3vu1G7/oNNnc82O80tgmjwyXtqNRPqiXpUJu7McI1x3qyUCvbaW2FhOhZFrwW3kj3RSvFFscq6oVWFY75oS+qzkQbvwnsOOr15AXEbSgBhNnb8ywNLOdFkXiwSx3Z0AtiyKauGypFlBdvA39FTegIsE8oFuk5S01Z1GRrplYxng==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=9XE6hngjyvDPrBecSEUxnjPDwhFaAoQ10IEUjLKS+y8=;
 b=JY4QO+Jems+ChQNr0EDAd81P3tJBN4U6VrWwiOwVccXGdwV43940XCQxBZzpgCpTiCr2DzNCS3u+f24f9XQljrZBoUtxyh3cYsXwXXean+KkB0Mx1C1g3RWL0GWTHelL5W223ZCw9qjJnCHj4MmUIgFZvJ1xX5t3c1J3js2DjzQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Mon, 17 Jul 2023 16:46:25 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v2 6/6] libxl: add support for parsing MSR features
Message-ID: <ZLVUQdM3XtclUw5l@MacBook-Air-de-Roger.local>
References: <20230711092230.15408-1-roger.pau@citrix.com>
 <20230711092230.15408-7-roger.pau@citrix.com>
 <48d5ca83-d14b-44e1-9431-5324118eacb7@perard>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <48d5ca83-d14b-44e1-9431-5324118eacb7@perard>
X-ClientProxiedBy: LO4P123CA0050.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:152::19) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|MW4PR03MB6363:EE_
X-MS-Office365-Filtering-Correlation-Id: fe3a6fb8-29ba-4355-0955-08db86d49c31
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	XBILFz6voRX0x/PTKZmH97rBtQ2JV3fPHSjF0FJ6V550//tA3+dLHgpW2iJiOLkQrzsEvEHk8oZCvT4kv9uDYEzXtF8DZ4kASMZJ957TnPu1vfJQIllqbDyXA9GggaeG+7V+H300IhiDUpgmmmzuUPPkMcvJgHOdIghfDtzj/zjb/RM+FgHE/R3r3MzAaOIT74zhIbR6d43NWztyW3Lw6jtupmIIcy1WaexLcMAZTH5luT7JfrxhFCxxcmzTFEHHFcAm2OUaa1/xAdZKp2qv5Dh2ehHbIBYl6stBzRN239f8MxLkoU4plKSXJG8fKtav1BqZn5Q+lZ4aXlf9I+04EzpC8mwdUMBfmV3uZvRzLoHQzRokqPH2G2slxrQ89zg43pmApaw8aeaHMap27Ww4so1VwxnYD24+pVqtvBsRvfAylJPhFR7t/PvZP0k5HEadPiuB/YCTIwLMj1aZJIcPNhc/BbGhZPUtuScv8jqyzK4Wkc8A9qrI/mujNAKDulDUlu26frj2VLWhtMQU99+cYw/2JACEWfeHzA1nX95xDxL/z2yWHyPtjJ8MHCcFdIf9
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(366004)(346002)(396003)(376002)(39860400002)(451199021)(8676002)(41300700001)(66476007)(6862004)(66946007)(2906002)(66556008)(8936002)(9686003)(6666004)(6486002)(54906003)(85182001)(86362001)(6636002)(4326008)(316002)(5660300002)(6512007)(38100700002)(6506007)(83380400001)(186003)(26005)(82960400001)(478600001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MzJMajJ0dTFFOE4rek5FWHd0emY2Rz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mcli/O2T9I30hu/1WtE5SnrhQHBMl4ipC1syn9CR4MUXTpkf24DumFESyoSowfofyu9OHRijWjM3A9INUmcZyn9Om8T2fSaT1YoUGiu5Kd/BtrSrzRfaojQiKnQ7xWCp1Lm6COO721zVGd1SuPp4BrxDrBFbYl8GEpQuJrcflXZMM+3VXgMWcjKospstre9r/Yf/sSWpjSb8FyVlvXg2joVXQ2vfnezeLubHi/QcIKk7GO7bwfp8+JPZLN9mo1yPEsHNzkIX6Ldu78JRhO8wvh2I9cV4iwE4NfUf5GieVA6/Oi/EYOpWuS9XGc2GlGuthsl99cxpKKnGYxqoP7dFvPRJRIZ
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: fe3a6fb8-29ba-4355-0955-08db86d49c31
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 14:46:31.7405
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: i9wNQ/iOnS3GFQeXKh+IwYKkct+kz3dKHLICR5vqGPCzQZBrEI3alQFeZgLLrogzb3aLoTxEyOf2wBcAYtSi5A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR03MB6363

On Thu, Jul 13, 2023 at 11:39:53AM +0100, Anthony PERARD wrote:
> On Tue, Jul 11, 2023 at 11:22:30AM +0200, Roger Pau Monne wrote:
> > diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
> > index b1c4f8f2f45b..86a08f29a19c 100644
> > --- a/tools/libs/light/libxl_cpuid.c
> > +++ b/tools/libs/light/libxl_cpuid.c
> > @@ -158,6 +158,57 @@ static int cpuid_add(libxl_cpuid_policy_list *policy,
> >      return 0;
> >  }
> >  
> > +static struct xc_msr *msr_find_match(libxl_cpuid_policy_list *pl, uint32_t index)
> > +{
> > +    unsigned int i = 0;
> > +    libxl_cpuid_policy_list policy = *pl;
> > +
> > +    if (policy == NULL)
> > +        policy = *pl = calloc(1, sizeof(*policy));
> > +
> > +    if (policy->msr != NULL)
> > +        for (i = 0; policy->msr[i].index != XC_MSR_INPUT_UNUSED; i++)
> 
> Could you add { } for this two blocks? One line after a if() without { }
> is ok, but not more.

Sure.

> > +            if (policy->msr[i].index == index)
> > +                return &policy->msr[i];
> > +
> > +    policy->msr = realloc(policy->msr, sizeof(struct xc_msr) * (i + 2));
> > +    policy->msr[i].index = index;
> > +    memset(policy->msr[i].policy, 'x', ARRAY_SIZE(policy->msr[0].policy) - 1);
> 
> Is this "array_size() - 1" correct? The -1 need to go, right?
> 
> > +    policy->msr[i].policy[ARRAY_SIZE(policy->msr[0].policy) - 1] = '\0';
> 
> Is it for convenience? Maybe for easier debugging (printf)? Also, I
> guess having a NUL at the end mean the -1 on the previous statement kind
> of useful.

Yes, it's also to match the format of the policy string used by
xc_xend_cpuid, which also has a terminating zero.

Are you OK with this?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 14:59:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 14:59:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564675.882273 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPgd-0005lI-6q; Mon, 17 Jul 2023 14:58:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564675.882273; Mon, 17 Jul 2023 14:58:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPgd-0005lB-3s; Mon, 17 Jul 2023 14:58:55 +0000
Received: by outflank-mailman (input) for mailman id 564675;
 Mon, 17 Jul 2023 14:58:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLPgb-0005l5-QL
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 14:58:53 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20629.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::629])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 712d2ee1-24b2-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 16:58:52 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM8PR04MB7218.eurprd04.prod.outlook.com (2603:10a6:20b:1d9::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Mon, 17 Jul
 2023 14:58:49 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 14:58:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 712d2ee1-24b2-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=bh0vG7yO+97d/69SQ9kw6t1j0s6engY/m4BNr86+IGqqRuTOei+LVonot5lzCw8ibZquzl8pkIOVGp52H2PA/yVNq35a8p3zu1rrnnp5zlW3KB5nMcgFNXvG4A8zSz9hlKWMRDh+BS1n94J37TzhzXMUMN/xWCP52xTejFxbGrmtM3XkXWXsQFFKT3wCplcZEO6vimDNFjsmHYZiRO7+byvPihYrPxjhPL3gibiMakQ69PbxaP0T85+iWXy/OR7u3UibfmnjY+S/ACEL49L3HBh9efK9rX0062/LSzlAn/W7RT/GbmWIH4F+0lMRNvgZdqQMRd/3v27f4octaD4FZA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=kZPoecbJRYlRk6sfmVlBwFwGvOQqhrFi6GDzPvdfhZQ=;
 b=CI+3Xnf9BGTCZbkup+QH5Yn9JvtuDJ8BFc5u6JPkHI0RF3DFsVkj79KarOTkeX97BaWHI8cxbamOfG/2BFzGbIhzrR3TV8DOP0fnpVYTGcukAtTfZPLREH5Z8XCF+ruJ1NXrQ5/d29HUjRwWIZ3gr0b9ClUPXEIYAAR+rXiEsLk5ltg38uIeJBcEW9+27HIhBsMUxPtRb6+BXR/NoTZFHMyb4ibb2LXIMmvsqQQUZ29KexXPjxz7V9SJZsv6xTpdJG4k+XSaCYNlqINQ5pAGP9s89GA867D/jrNo6nC7gMFIIMHaVC7ycimTOm8CaOVf+UCQzGvF/y/EUdXQ+yhx4Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=kZPoecbJRYlRk6sfmVlBwFwGvOQqhrFi6GDzPvdfhZQ=;
 b=wdUuXdTIatUlV4z3YqgSD9eG6Ha1SvEP58zJFJpMID8MTBbFJ22gzp/rQgDHdyei9gX17N9f9ZEYybluCOHK1PJ3cvj4bg7d5cHni4F1/VolaalRgmHVbhk0TDN56niUluGZQZNdOVN+8vxt3VNd0Q1QBswyFMUsn6Pa/gUHcWAY+ZcrhucBEGXZ8FxeM3XpyIIedWQM9VZJndBjPKvn43XqC1zU5v8idBLZr8747I5QzV6PzTDV2mdQSmel0wqv98n6Z3weIV3lij5Dy1fQPdKU+IGLBYhhxhy378OzxAtw0/EbaDhcIU03nF5JFg1OocRncdrxGUCK5mCACiDmvw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <5cec8802-a109-2a0c-10e2-803fdfcb9cf1@suse.com>
Date: Mon, 17 Jul 2023 16:58:46 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 2/3] xen/riscv: introduce function for physical offset
 calculation
Content-Language: en-US
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1689604562.git.oleksii.kurochko@gmail.com>
 <f86724014bf5234f22cd18e7b3da8e8aa83e1e08.1689604562.git.oleksii.kurochko@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <f86724014bf5234f22cd18e7b3da8e8aa83e1e08.1689604562.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0062.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4b::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM8PR04MB7218:EE_
X-MS-Office365-Filtering-Correlation-Id: eabcb529-f446-46f1-914f-08db86d653d0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	dYLIDCW2B+hnwH3d3jJ6ws9ObMGZtHTKv424lorS0iE6eQ7nR1TiWE6XgzTSiQCuoaPP6fJFoHiMlhqbV7DX9KOmUhUPeuSupaWfUYo2F0arv5ftl0aucNkeC81pv+Iw6WO67XWb4ZIEh9TxzcEGzDQANK2ZAytrZVsCGx1DsoFyLJ1nwSfwnwD0XO7Veo1DmGk4C27sfasyrVOZVkzDBIu2MiIKlSV/gbn9fO3sirgP6saZCUGtWxd/KT5sjR8gs+oZK0P+dTYodFea15o9oLzr9OQ/ebGrFtvOfN0+sr1UHIm2vK3idBhrRMPagogp8fxcwmGbpt6nyz4jOMLS0EfI+JtJSk1gL1c9MSFaK+AK8L4oA3DImPFHUkod5ry8Oi/zt6lJBE0rXyI1kh5CfxboFIOdN1gRUnSNmsXT2wtMcHh5fUUL1uNWFTsFgKiEmxaPsuD803zCQATrznwQ/caN/wwOfvT7TVEFYNTwkeR1kdZStGljgVycEoicWZBpxouDhq7E4LBYl9N97wn8yyS8i9xjxC60vXL0ERTDgLvSuiwanu7w6Q45hDnMPBCXixPOruxwemqLwYy9f6uovo+BU5c5rq0CR9EdHZ+2/IbXoTB9YX3Keyq7JN47VA+ty0udRY7WDHEcoddpPw//Dw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(346002)(136003)(39860400002)(376002)(451199021)(31686004)(2906002)(54906003)(478600001)(6666004)(6486002)(36756003)(8676002)(4326008)(316002)(41300700001)(6916009)(66556008)(66476007)(8936002)(66946007)(83380400001)(38100700002)(6512007)(5660300002)(86362001)(31696002)(53546011)(26005)(2616005)(186003)(6506007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZHg1N3E5dkRoZzJxWEF2VTFhL25IaHVreTkyV2l1R2xERTlsRktMN1FndHpY?=
 =?utf-8?B?ekNOTDAzSnhwa1B6ZjRwMDhLcVdvdDQ5cXdLcWlBMWsxcWdZZGZlSkczbHVC?=
 =?utf-8?B?TTkvQ3dhdS9wOG9JWEJLdDdwRFF4VDVvL3o3VG51ZGxickJlaUIzZWdodHY3?=
 =?utf-8?B?RUJRYXBaSVh4K3VuK0daV2k2MUFVRlhlWlc5NVlIQ3lPL3FHRmptcFZkUGFN?=
 =?utf-8?B?eFI2S1Q3SEVWeGRCRExxOHdRamtaL1ROZk8wNUZPWVNlMEJrRXRvc0FEaWFn?=
 =?utf-8?B?cldKOHJmOFlCMlk1MGlaeTBkM0NqSUlXV0k4TUJlTm1nMm04OXNhd0pFNXIy?=
 =?utf-8?B?MVVnejZyRWYxbVh6UTZnOFVxenJqMmJMVnJSMzRZbUR3WDJxR1htZ2lweGNC?=
 =?utf-8?B?V3U3TU1zZkRnczNLUXZZUURvRTY0TVcyNTFpUnJjWWxyVWg2OTZsWjVNOHh2?=
 =?utf-8?B?QjUzYm1WS01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04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 14:58:49.1715
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ZTvaTmFUokEjr+8q6PjNYmMBV3NVhBy+8d5Y32cwdaArb5CJgCDDJw1wXXO1+jaCJLgJAFn7v0HDuyaZW840pg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7218

On 17.07.2023 16:40, Oleksii Kurochko wrote:
> The function was introduced to calculate and save physical
> offset before MMU is enabled because access to start() is
> PC-relative and in case of linker_addr != load_addr it will
> result in incorrect value in phys_offset.
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
> Changes in V3:
>  - save/restore of a0/a1 registers before C first function call.
> ---
> Changes in V2:
>   - add __ro_after_init for phys_offset variable.
>   - remove double blank lines.
>   - add __init for calc_phys_offset().
>   - update the commit message.
>   - declaring variable phys_off as non static as it will be used in head.S.
> ---
>  xen/arch/riscv/include/asm/mm.h |  2 ++
>  xen/arch/riscv/mm.c             | 18 +++++++++++++++---
>  xen/arch/riscv/riscv64/head.S   | 14 ++++++++++++++
>  3 files changed, 31 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
> index 5e3ac5cde3..d9c4205103 100644
> --- a/xen/arch/riscv/include/asm/mm.h
> +++ b/xen/arch/riscv/include/asm/mm.h
> @@ -15,4 +15,6 @@ void setup_initial_pagetables(void);
>  void enable_mmu(void);
>  void cont_after_mmu_is_enabled(void);
>  
> +void calc_phys_offset(void);
> +
>  #endif /* _ASM_RISCV_MM_H */
> diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
> index fddb3cd0bd..c84a8a7c3c 100644
> --- a/xen/arch/riscv/mm.c
> +++ b/xen/arch/riscv/mm.c
> @@ -1,5 +1,6 @@
>  /* SPDX-License-Identifier: GPL-2.0-only */
>  
> +#include <xen/cache.h>
>  #include <xen/compiler.h>
>  #include <xen/init.h>
>  #include <xen/kernel.h>
> @@ -19,9 +20,10 @@ struct mmu_desc {
>      pte_t *pgtbl_base;
>  };
>  
> -#define PHYS_OFFSET ((unsigned long)_start - XEN_VIRT_START)
> -#define LOAD_TO_LINK(addr) ((addr) - PHYS_OFFSET)
> -#define LINK_TO_LOAD(addr) ((addr) + PHYS_OFFSET)
> +unsigned long __ro_after_init phys_offset;
> +
> +#define LOAD_TO_LINK(addr) ((unsigned long)(addr) - phys_offset)
> +#define LINK_TO_LOAD(addr) ((unsigned long)(addr) + phys_offset)
>  
>  /*
>   * It is expected that Xen won't be more then 2 MB.
> @@ -273,3 +275,13 @@ void __init noreturn noinline enable_mmu()
>      switch_stack_and_jump((unsigned long)cpu0_boot_stack + STACK_SIZE,
>                            cont_after_mmu_is_enabled);
>  }
> +
> +/*
> + * calc_phys_offset() should be used before MMU is enabled because access to
> + * start() is PC-relative and in case when load_addr != linker_addr phys_offset
> + * will have an incorrect value
> + */
> +void __init calc_phys_offset(void)
> +{
> +    phys_offset = (unsigned long)start - XEN_VIRT_START;
> +}
> diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S
> index 2c0304646a..9015d06233 100644
> --- a/xen/arch/riscv/riscv64/head.S
> +++ b/xen/arch/riscv/riscv64/head.S
> @@ -29,6 +29,20 @@ ENTRY(start)
>  
>          jal     reset_stack
>  
> +        /*
> +         * save hart_id and dtb_base as a0 and a1 register can be used
> +         * by C code ( f.e. setup_initial_pagetables will update a0 and
> +         * a1 )

I'd recommend dropping the part in parentheses - for one the function
doesn't exist yet, and then you're merely restating what the ABI has.

> +         */
> +        mv      s0, a0
> +        mv      s1, a1
> +
> +        jal     calc_phys_offset
> +
> +        /* restore bootcpu_id and dtb address */

Is the first name here intentionally different from that in the other
comment (where it's "hart_id")?

Jan

> +        mv      a0, s0
> +        mv      a1, s1
> +
>          tail    start_xen
>  
>          .section .text, "ax", %progbits



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 15:18:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 15:18:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564680.882282 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPyz-0008MM-NY; Mon, 17 Jul 2023 15:17:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564680.882282; Mon, 17 Jul 2023 15:17:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLPyz-0008MF-Ky; Mon, 17 Jul 2023 15:17:53 +0000
Received: by outflank-mailman (input) for mailman id 564680;
 Mon, 17 Jul 2023 15:17:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=fcy7=DD=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qLPyy-0008M9-Rp
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 15:17:52 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 186e562a-24b5-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 17:17:51 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-51d95aed33aso6218154a12.3
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 08:17:51 -0700 (PDT)
Received: from EMEAENGAAD19049. (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 v9-20020aa7d649000000b0051def9be785sm10052903edr.85.2023.07.17.08.17.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 08:17:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 186e562a-24b5-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689607071; x=1692199071;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=pl+agShOZLQ/uSctIG4q0BsztpV+2qGnqQ8/faLyzW4=;
        b=hLnVSrDVuAP0IwAdpoqmr75sEJVeUlF/9a5k1M24xIV2GBDwx//awoI1Qdf68cx86A
         5rwpktR1K9nt3KEvM5+UYdtNbLSr/YmID3kqz6QOkZ09bEiWBW8YYH0bu1BpmR8+RhqD
         MRvCBrhlEzszRVinC8aAymD02quJAK+Twlesk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689607071; x=1692199071;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=pl+agShOZLQ/uSctIG4q0BsztpV+2qGnqQ8/faLyzW4=;
        b=fu30XLm2nUrwwDoZh7pJkPi1iUu8rGN5OrA0cA9LlXTSE1GzkDzO2lSlXfjjLcW0EC
         OehchztAL7mQxQb22k/OrKQZrhtfnelCy4vCZYhUarDNpV8zr0ETjz8mt1EYlosVrgdp
         rJRljDZknasMt6MD8p6uyr3I4BHYpejzwIzVuLecsoEBcm3GSA5iNd7IOGsNFrywGv5K
         RWguAULH2Wmq2odLxbQWNMmafbZe+PgHhWLWgkPMTDl+0i/6hyWn8KTQsWYICorvU+CK
         V/kqoXRiUFoPv016CgvjNR/EKbF7yh/bxviThwaVbsC/vViWTGj3dKt1Hg8gP49uhG61
         o8pA==
X-Gm-Message-State: ABy/qLb46JIG88y4zRNWpbsBe5BUGXVLs/CZSMR2YlWoJ3gmx4SyJ3EN
	JTjh4HqBn7BQqxOrAmEoS2xm1A==
X-Google-Smtp-Source: APBJJlEEJFdaBi59YX9+o1l54fwMJXX3riFuG0WK/iLcx1n8IbRgTabJYMeV6CecUtkSgsI+7n0UZg==
X-Received: by 2002:aa7:de0a:0:b0:51c:dd99:a211 with SMTP id h10-20020aa7de0a000000b0051cdd99a211mr10640186edv.27.1689607070863;
        Mon, 17 Jul 2023 08:17:50 -0700 (PDT)
Message-ID: <64b55b9e.a70a0220.f2728.ad3a@mx.google.com>
X-Google-Original-Message-ID: <ZLVbnQmiHfRP70cB@EMEAENGAAD19049.>
Date: Mon, 17 Jul 2023 16:17:49 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v3] mm/pdx: Add comments throughout the codebase for pdx
References: <20230707160759.12132-1-alejandro.vallejo@cloud.com>
 <646ce8b8-7a8c-88c1-2b1e-76a721e6f164@suse.com>
 <64b1232a.050a0220.898b.6177@mx.google.com>
 <6519818f-d31e-d588-6613-3671cc7427d4@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <6519818f-d31e-d588-6613-3671cc7427d4@suse.com>

On Fri, Jul 14, 2023 at 12:36:11PM +0200, Jan Beulich wrote:
> On 14.07.2023 12:27, Alejandro Vallejo wrote:
> > On Thu, Jul 13, 2023 at 05:12:09PM +0200, Jan Beulich wrote:
> >> On 07.07.2023 18:07, Alejandro Vallejo wrote:
> >>> --- a/xen/include/xen/mm.h
> >>> +++ b/xen/include/xen/mm.h
> >>> @@ -31,6 +31,17 @@
> >>>   *   (i.e. all devices assigned to) a guest share a single DMA address space
> >>>   *   and, by default, Xen will ensure dfn == pfn.
> >>>   *
> >>> + * pdx: Page InDeX
> >>> + *   Indices into the frame table holding the per-page's book-keeping
> >>> + *   metadata. A compression scheme may be used, so there's a possibly non
> >>> + *   identity mapping between valid(mfn) <-> valid(pdx). See the comments
> >>> + *   in pdx.c for an in-depth explanation of that mapping. This also has a
> >>> + *   knock-on effect on the directmap, as "compressed" pfns have no
> >>> + *   corresponding mapped frames.
> >>
> >> Didn't you mean to keep the directmap part optional,
> > I did.
> > 
> >> which would call for saying "may" here (twice)?
> > That paragraph as-is doesn't really mandate a directmap. It merely state
> > that there are knock-on effects on directmap indexing, not that there's
> > always a directmap to index.
> > 
> >> Yet then ...
> >>
> >>
> >>> --- a/xen/include/xen/pdx.h
> >>> +++ b/xen/include/xen/pdx.h
> >>> @@ -1,6 +1,73 @@
> >>>  #ifndef __XEN_PDX_H__
> >>>  #define __XEN_PDX_H__
> >>>  
> >>> +/*
> >>> + * PDX (Page inDeX)
> >>> + *
> >>> + * This file deals with optimisations pertaining to frame table and
> >>> + * directmap indexing, A pdx is an index into the frame table, which
> >>> + * typically also means an index into the directmap[1]. However, having an
> >>> + * identity relationship between mfn and pdx could waste copious amounts of
> >>> + * memory in empty frame table entries and page tables. There are some
> >>> + * techniques to bring memory wastage down.
> >>> + *
> >>> + * [1] Some ports apply further modifications to a pdx before indexing the
> >>> + *     directmap. This doesn't change the fact that the same compression
> >>> + *     present in the frame table is also present in the directmap
> >>> + *     whenever said map is present.
> >>
> >> .. you mention it here as non-optional as well. Didn't you tell me that
> >> Arm doesn't use compressed indexes into the directmap?
> >>
> >> Jan
> > 
> > The [1] note states "whenever said map is present", meaning that it may not
> > be present. Saying it's optional is a stretch though. It's not like we can
> > choose right now.
> > 
> >> Didn't you tell me that Arm doesn't use compressed indexes into the directmap?
> > arm32 doesn't have a directmap at all. arm64 uses biased pdx as indices
> > (they are offset by a constant), so they are still subject to compression.
> 
> Hmm, then our understanding of "optional" was differing: I understood
> "use of compressed indexes is optional", when you apparently meant
> "the use of a directmap is optional". If this is the case, then I
> agree with the chosen wording. (Nevertheless using the suggested "may"
> wouldn't yield and incorrect outcome.)
> 
> Jan

Like this?

```
 * pdx: Page InDeX
 *   Indices into the frame table holding the per-page's book-keeping
 *   metadata. A compression scheme may be used, so there's a possibly non
 *   identity mapping between valid(mfn) <-> valid(pdx). See the comments
 *   in pdx.c for an in-depth explanation of that mapping. This also may
 *   have a knock-on effect on the directmap, as "compressed" pfns may not
 *   have corresponding mapped frames.
```

If so, sure. I don't mind either way. I'm happy for those 2 _may_s to be added. 

Thanks,
Alejandro


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 15:24:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 15:24:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564688.882293 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQ5X-0001NH-EB; Mon, 17 Jul 2023 15:24:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564688.882293; Mon, 17 Jul 2023 15:24:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQ5X-0001NA-At; Mon, 17 Jul 2023 15:24:39 +0000
Received: by outflank-mailman (input) for mailman id 564688;
 Mon, 17 Jul 2023 15:24:38 +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 <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLQ5W-0001N4-Co
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 15:24:38 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2061a.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::61a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 09602ff2-24b6-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 17:24:36 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8458.eurprd04.prod.outlook.com (2603:10a6:102:1d9::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 15:24:33 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 15:24:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 09602ff2-24b6-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=jZM/uUKVdguBYJ7ZqbFHJhK6bYjmm1aaXuLtt6wVAMVILnVa7SsMZ0FhxYafeLPKeV69JsGknLvUg3hFSb3Qx4l7CScwF5QNwqtZPV1sYJ42vYvr3+oXbLwtkFjXVhfqEzfp/EusQq/lfg9Fyvr3Xe0fN+hkqwks42S8uqvB8BpOcuAFPDQoIixx6bVIW3zERyvyCdFUIhm81vNP1opYBHXfWDu4hNmmh7ozkTeGnPLhOwh2ykFn5HqLfbpRz1z6XcW8FHstXG5wo7wKuJoDapYrELwuuGwcp5PUoC3+HfDRrzBY0mrTlJFCL/GJx/4diT6q6cKBVRiIy+RxPbAABw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=rETN4uDzWMvRWpBX8XEP1iUCSlsZMqna6EL42TzTo+M=;
 b=n7usenqI0EkbeZ1H3v5+NQ9KjlBEDlaUsQGRy82tGPUBT0enEbLZlGLFmOXg91vHgYkROij0/WATZtopEbNE3B8/fwgBWkxgKeBSwYIp8DL484C5xLlufrkCc7v1Ure3260rI5jR2UnCJXgE/1VKWmn8gcbMLfK3/ZbXa/q6OVgKvnCjH7fJM0MjWCB+/ndr4/EJ1jD6T/uNxhb1xtrybt5H7lH0H3p6PqqeSYDSQWN1JWS7tH+CBrL1Mf3oxf+lp0PvWywCmNkyvMPpIT4GIoIZKYLrxBPqKcOeqJN+N9Mp8zH7LncPHnFdJxmNLBFyQwZfmyWFM4o/f0fl0zJb7w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=rETN4uDzWMvRWpBX8XEP1iUCSlsZMqna6EL42TzTo+M=;
 b=NPJri493GCPjR9/Aji/J00lOh5jStsC/5Qhkf3WmR3XZMszXJdB5MdhKcFji6at4RnnbY8ai+CXUB5gLbwq6sx8pAN6RsbV6pylYKXkt59t2lPzvslXywY3hukKuOatBl1fZ2jaHhGQSdceVqpcB7RkQ2iCBDWF+NV/dDKgnW0J+FqGIsRlUhgglgNg2BoUl/Yn9JY2m8n6CQPL3mLfmPBLRbOL5MIkqUyIK5PeCGRH9yafcn6A8dXdD62fh7NFURZ1nkxCRB5vBFQ1gIGm8Z3YroPCEmObCz7EeIJqJ9x0rdABcvDki9iJWzQrXNEJ28tGxG5Ueo/IzZKWw78b3Gw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ceb81450-90ff-ffbe-431c-37bc60c7946a@suse.com>
Date: Mon, 17 Jul 2023 17:24:30 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 1/2] restrict concept of pIRQ to x86
Content-Language: en-US
To: Julien Grall <julien@xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <85e59fd5-9a06-48b4-ba7e-81865d44e332@suse.com>
 <98f51b96-8a1c-7f33-b4d3-1744174df465@suse.com>
 <0cd9d94b-0a8d-a3e1-d683-04fac1572750@xen.org>
 <8cdf9179-7b3f-5a52-ff02-8ededbe03e0c@suse.com>
 <4a6bd691-95e1-ad15-1054-b43460c85b32@xen.org>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <4a6bd691-95e1-ad15-1054-b43460c85b32@xen.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0177.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b4::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8458:EE_
X-MS-Office365-Filtering-Correlation-Id: b0cfe4f7-b8cf-4f87-ef6b-08db86d9ec49
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	+HbqkUZInYNIf/mf2QxMTmf/IZgPR+8Kcf6W/PPYpXRxgrM648HQA3WcVaSqcF9zJ4CngbpfzCbg4HlA3C8Q0/Crx5d21GY9Hj8QXFELgfnnfcecZoRvkXMYX3j2aUtyeAHHwedA2cGIR3UnORTOvFVL48PT08czX+GIS2WFAwQwsck8w6zbPMfo4pdwgS1j2KMAQQRp1a17+QJS7gYgUWZH3zJKuHH0IqGM5cP1mtfJkYg1M8cXxg7hoKQg4IkBZ1bl9kFRwXg1Tar+YGI1ibIUaA84iDzNZKW5pBY/DIXr+QqHfGfN1DQPNWUgYnKRiDmMjGrUdXDa2J4XYgzWvTWyxGigA3Tz8iuzD1NkVe3AdD6YY+9iiWjdUQXMIi9tXJFGpzAro8p3GcGpTfTaEYDHvFtJTklox9QcIXOFaN0o7EbGUw0ujfa8qAxzGG0TW0wen/Xh7mFi2Uy/RyHE4yThxFzm3RrSRpq/VgMMjXWfJaT+M5V83QLmIfG190I2Hp1yNzc9APxAzxyUE93A8qmZBS51aFYGypdjIJvOwkBqxvXkcC5S5XbeBSY8GoM8bgUEs4Y1tLFJwznRR9Gt/iHyQSEUzFC7JZUpNkSDNrRxQ8BojgtW+Y8QiqXJz1fYkd2Go8cCHrV1FlqhZWcRsg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(376002)(366004)(39860400002)(136003)(451199021)(54906003)(38100700002)(6486002)(41300700001)(478600001)(8676002)(8936002)(5660300002)(66476007)(6916009)(66556008)(66946007)(316002)(4326008)(2616005)(186003)(83380400001)(6512007)(53546011)(26005)(6506007)(31696002)(86362001)(36756003)(2906002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cU02Tkw5dDlqN2FGcXY0WnhoemlFVVBUam1GUFVST0FuRk5CZzEraWdwbU42?=
 =?utf-8?B?aTlrdkptUW05VzM5OFBQcTFTUVI5SXEvdUdVZzNiNlNvUWVtWVZvdVNCTVdn?=
 =?utf-8?B?aVpXLzRGb0JmWndZeHF6L3hDMDZPTGJaaXhlekZHS2c0ZUxCczNINnVTREFt?=
 =?utf-8?B?Z0RWQnhHWGFaT1EyOC91WmJL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utf-8?B?cjRFMlhTQUZMOXh4clIzelBDcWdzQzBuSmpuMGNsbUZ1ZTBEZ0p1NEdldnBq?=
 =?utf-8?B?eXBmN1F4eElIQ3p2MzJQR00wWmRLWXl5UlV6eGd4bFRaemNITldYancraHph?=
 =?utf-8?B?Mm56REx2SnI0Zi92aWlGYWZWTnU4dnpkNGpKTW9IY2RlQ3A4YkE3WU5EaytQ?=
 =?utf-8?Q?upzshYF1GVZADIz3KmBLT3Sy2?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b0cfe4f7-b8cf-4f87-ef6b-08db86d9ec49
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 15:24:33.4426
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: mmVIM65u1be/uhwi6pRVilru4x0s3IQKt2lomAvfpVj3+jby5+oGU0zAEX8AOhRJIxX7827lFOedVu/bR4G72Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8458

On 14.07.2023 11:28, Julien Grall wrote:
> On 11/07/2023 13:29, Jan Beulich wrote:
>> On 10.07.2023 22:59, Julien Grall wrote:
>>>> ---
>>>> I'm not really certain about XEN_DOMCTL_irq_permission: With pIRQ-s not
>>>> used, the prior pIRQ -> IRQ translation cannot have succeeded on Arm, so
>>>> quite possibly the entire domctl is unused there? Yet then how is access
>>>> to particular device IRQs being granted/revoked?
>>
>> (Leaving this in context, as it'll be relevant for the last comment you
>> gave.)
> 
> Sorry I missed this comment.
> 
>  > so quite possibly the entire domctl is unused there?
> 
> You are right, the domctl permission is not used on Arm.
> 
>  >  Yet then how is access to particular device IRQs being granted/revoked?
> 
> At the moment, a device can only be attached at domain creation and 
> detached when the domain is destroyed. Also, only the toolstack can map 
> IRQs. So we don't need to worry for granting/revoking IRQs.

Thanks for clarifying.

>>>> --- a/xen/common/domctl.c
>>>> +++ b/xen/common/domctl.c
>>>> @@ -683,11 +683,13 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
>>>>            unsigned int pirq = op->u.irq_permission.pirq, irq;
>>>>            int allow = op->u.irq_permission.allow_access;
>>>>    
>>>> +#ifdef CONFIG_HAS_PIRQ
>>>>            if ( pirq >= current->domain->nr_pirqs )
>>>>            {
>>>>                ret = -EINVAL;
>>>>                break;
>>>>            }
>>>> +#endif
>>>
>>> This #ifdef reads a little bit strange. If we can get away with the
>>> check for Arm, then why can't when CONFIG_HAS_PIRQ=y? Overall, a comment
>>> would be helpful.
>>
>> As per the post-commit-message remark first of all I need to understand
>> why things were the way they were, and why (whether) that was correct
>> (or at least entirely benign) for Arm in the first place. Only then I'll
>> (hopefully) be in the position of putting a sensible comment here.
>>
>> One thing is clear, I suppose: Without the #ifdef the code wouldn't
>> build. Yet imo if things all matched up, it should have been buildable
>> either way already in the past. Hence the questions.
> 
> Right, it would not build. But does this check really matter even in the 
> case where CONFIG_HAS_PIRQ=y? Looking at the code, it sounds like more 
> an optimization/a way to return a different error code if there value is 
> too high. For the domctl, it doesn't seem to be worth it, the more if we 
> need to add #ifdef.

I wouldn't call it an optimization. The check has always been there, with
b72cea07db32 transforming it (largely) into what we have today. In fact
in an initial attempt I had gone further and also #ifdef-ed out the
pirq_access_permitted() (and iirc the pirq variable altogether), seeing
that without HAS_PIRQ the incoming field can only sensibly hold an IRQ.
But then I thought that this would be going too far, leading to me
undoing part of the change.

If we dropped the check, we'd start relying on domain_pirq_to_irq()
(invoked by pirq_access_permitted()) to always fail cleanly for an out-
of-range input. While I think that holds, it would still feel a little
like making the code (slightly) less robust. But yes, I think doing so
would be an option. (Still I also think that returning EINVAL for
obviously out-of-range values is somewhat better than EPERM.) Yet then
...

> With that, the rest of the domctl should mostly work for Arm.

..., taking into account also your clarification at the top, I wonder
whether we shouldn't #ifdef out the entire subop.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 15:26:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 15:26:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564693.882303 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQ7U-00020W-Su; Mon, 17 Jul 2023 15:26:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564693.882303; Mon, 17 Jul 2023 15:26:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQ7U-00020P-Pr; Mon, 17 Jul 2023 15:26:40 +0000
Received: by outflank-mailman (input) for mailman id 564693;
 Mon, 17 Jul 2023 15:26:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLQ7T-00020F-E1
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 15:26:39 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on2060b.outbound.protection.outlook.com
 [2a01:111:f400:7d00::60b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 526287b5-24b6-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 17:26:38 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS5PR04MB9854.eurprd04.prod.outlook.com (2603:10a6:20b:673::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Mon, 17 Jul
 2023 15:26:36 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 15:26:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 526287b5-24b6-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=UOWal60g7JqN2Dwdjau/eEo0roAp0PQISj+sk3AawR/rGfD1VtP85gpyh7IAJT0AesC9mFySo9L0gx/txYCJPiTwbfbAB8gKPSuU68le0o6uJDsQzLrsqQrTI0P0xNH6Matf8D4abgXa+CLY1Dc0tOnOOeEtIZszVCHtBCiS5KgifGShIugkpq4LDF/55cIEVz+TC34E6ojhYkFiFwnawNTsVnLwgV6ucusVDqqAuAJdpv4uKoBsKr4tvQhBSZP8X1DoSY/5P5FUwRquwjrXx/ZoqEpcZrc9qKhjJHcDfE3bOdib6vt2VdASf9cTDhKpnJ8puHk7BjpjSeh7ZQ5DYw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=fFizzRq6ubBUv8UnCTIZeEGNkuJ58yYStXVp4GsQk9I=;
 b=duh2Iw/FQjv0/INP53xz8Dh/qdTOmWEKG6DmxGKXssUKBAxPKoV+/6FEO2XA6DbRQuRGWqcVS7VJTclp1FqPrJTlHIRswQdDerjFCbkK+7aOsXBB3+AeqVHmbcx9vLjoucFeqCTA/MQD+M0ciLHlos5XbF1Fb3TSug/qil24WEXJvhE+lRnelqEsxAadjJoWMH+qDOaI2uqrdOjtgJAyKfsELKyo/qcIelvdXSf/JtjkGNaA0ZmK4cTVUpWC1E9DpsGLdECAVhicTq/0N/bjabOUOHzgJ7sXgImrEi/sHzSY3hsHERccMUiqNp3b3875pFUkb9q+u+nvlhSrZ7FD3w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fFizzRq6ubBUv8UnCTIZeEGNkuJ58yYStXVp4GsQk9I=;
 b=Vga/xrD9DX7AWjlSIRPvfN/Hge4ekt6BiXWxnG5NjMCO0Cg9jGIABNkspoWurpmyH/7lHNrF0+M7+l8yPed5NO1XxHTYbZRI2Tjk/ayRyab8O3MXTE/F9z0s6Sb0+5MWjmudmcHmqFD3av++myL/Y+7U/xik6L8xNbExI2TN5ZXiBmmzsel5dQ61NZxbMkY5OdWwBFuj94yLmORtmVNCHlxbDj6Wfn5/R+ElIG9hVBRBp9CBzggyIt8d70c1LOkPYjU1QxxLtpuZ437dSwFF+cgk35GcRmQbTNhAHOmsO40ITHls8seeqH8WFVIw81ZMcjvvKK5+rGQEnGEAz7Y64A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <8577f99b-7c35-e433-3418-cf8c7dd47f9c@suse.com>
Date: Mon, 17 Jul 2023 17:26:33 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3] mm/pdx: Add comments throughout the codebase for pdx
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230707160759.12132-1-alejandro.vallejo@cloud.com>
 <646ce8b8-7a8c-88c1-2b1e-76a721e6f164@suse.com>
 <64b1232a.050a0220.898b.6177@mx.google.com>
 <6519818f-d31e-d588-6613-3671cc7427d4@suse.com>
 <64b55b9e.a70a0220.f2728.ad3a@mx.google.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <64b55b9e.a70a0220.f2728.ad3a@mx.google.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0072.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:49::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS5PR04MB9854:EE_
X-MS-Office365-Filtering-Correlation-Id: edf718e7-7f4e-4dd1-8b7f-08db86da3569
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	6+jEZRndZxUvMm4UZecn82qY35cbVut9vl1vWsjZcqoveWFrSSyraMdjLrP2h2J/+Nz5A0D/n9XQmUJiCVw54bfa1UHhluq53YOho0p6WAFCucPHq1KU3GEjHEC39GmWXqQf4+Kl8Cqv2A9EZOm161ChOf1i3J4SadbQ5W4OFxC6JxYky3CNGNEngjcofF/EhCsphxsTHSOdOioEOngrpNIYnBLcNCua2etZtd37TV/rRsMFGBnuqqpXjDKFAayLQKnCUpWKgdCYPsfxtVZqWf3tSlfBke5VWyw3pX70KvQFa5oFBOKbwukyOt78Omjzr8AKHIoGSwWh0XRS29bw5HqNCnDWGoeVZqCwHAfYE7ZGOct/75nR81ZVLgzgo1aVHiif5MjHKWiAPjhfjXtZgtzbbogGCDMfHCzt9ZvT0v4qvUdTT55/8ODbg+5EvrKV/Q1ghtnmLG3L+HtO4Xu7GlhiorOSou8RtmFIdoHoAdWZr8waijPJKRN5cyv5CLkZC8658cuvyeyvbrKu4JSeUcMNrsy8plfg/e3A7psPjezSiyiP987LCGtbBrbNB8AzGKqubQM6WU92ZXhEIStcRxq+jooFgvtzR6w3DEk+RgXYtKnDRhfx9Hufj3kQ/X1DOvFDgWoHZGBlGWt4CeOGOA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(136003)(376002)(396003)(39860400002)(451199021)(478600001)(6486002)(6666004)(54906003)(186003)(53546011)(6506007)(26005)(6512007)(2906002)(316002)(41300700001)(6916009)(66946007)(4326008)(66556008)(8676002)(5660300002)(8936002)(38100700002)(66476007)(36756003)(86362001)(31696002)(2616005)(66899021)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NGZKMWE2cDZ0cDVjVXFOUXBRMVNnYXF5SWRiL2xI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nlSdXZ6NGRkaXhTU0x4SFExcVlnNTl1N3FYQnZE?=
 =?utf-8?B?Tzc1Y245YjJzdWl3YzVIN04vd3h0bFEweEUrUlVpdzZ5aXpTV1BHcDJ1VnJU?=
 =?utf-8?B?c0Q4R2ZoWGUxdi9PVThmUXgwU1JSeFJVbVJDV3lQNVd4TWNWR0w4anhseGxp?=
 =?utf-8?B?bHIvVHJkcDdtSytDQ0hlZjRObElxNkNlWW1WNXhnb1l2Qk5FejBDWHYvcDNa?=
 =?utf-8?B?SkkvNzZpTjgvakZNdjE4ZVlCOXdIcnF1Vmh2WjVEdVowMmE0M3RLMXlnaGw2?=
 =?utf-8?B?bGNvVVZSMHZLR3NHQjBRSTU4NmN5Ly9YUGVVck5jNnNpaFBhRVEyd3RTNEsv?=
 =?utf-8?Q?dBGBpkmg6qNL439hF55OVrZyk?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: edf718e7-7f4e-4dd1-8b7f-08db86da3569
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 15:26:36.1113
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: iJ5J4YA1pbv94xMwT+Cy6gjDoVkSeT93S9ZQJXH8G71DBYaMvkuDCfwhIoBSfSa0aoCycwXVZKt+pDeSt/1rhA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB9854

On 17.07.2023 17:17, Alejandro Vallejo wrote:
> On Fri, Jul 14, 2023 at 12:36:11PM +0200, Jan Beulich wrote:
>> On 14.07.2023 12:27, Alejandro Vallejo wrote:
>>> On Thu, Jul 13, 2023 at 05:12:09PM +0200, Jan Beulich wrote:
>>>> On 07.07.2023 18:07, Alejandro Vallejo wrote:
>>>>> --- a/xen/include/xen/mm.h
>>>>> +++ b/xen/include/xen/mm.h
>>>>> @@ -31,6 +31,17 @@
>>>>>   *   (i.e. all devices assigned to) a guest share a single DMA address space
>>>>>   *   and, by default, Xen will ensure dfn == pfn.
>>>>>   *
>>>>> + * pdx: Page InDeX
>>>>> + *   Indices into the frame table holding the per-page's book-keeping
>>>>> + *   metadata. A compression scheme may be used, so there's a possibly non
>>>>> + *   identity mapping between valid(mfn) <-> valid(pdx). See the comments
>>>>> + *   in pdx.c for an in-depth explanation of that mapping. This also has a
>>>>> + *   knock-on effect on the directmap, as "compressed" pfns have no
>>>>> + *   corresponding mapped frames.
>>>>
>>>> Didn't you mean to keep the directmap part optional,
>>> I did.
>>>
>>>> which would call for saying "may" here (twice)?
>>> That paragraph as-is doesn't really mandate a directmap. It merely state
>>> that there are knock-on effects on directmap indexing, not that there's
>>> always a directmap to index.
>>>
>>>> Yet then ...
>>>>
>>>>
>>>>> --- a/xen/include/xen/pdx.h
>>>>> +++ b/xen/include/xen/pdx.h
>>>>> @@ -1,6 +1,73 @@
>>>>>  #ifndef __XEN_PDX_H__
>>>>>  #define __XEN_PDX_H__
>>>>>  
>>>>> +/*
>>>>> + * PDX (Page inDeX)
>>>>> + *
>>>>> + * This file deals with optimisations pertaining to frame table and
>>>>> + * directmap indexing, A pdx is an index into the frame table, which
>>>>> + * typically also means an index into the directmap[1]. However, having an
>>>>> + * identity relationship between mfn and pdx could waste copious amounts of
>>>>> + * memory in empty frame table entries and page tables. There are some
>>>>> + * techniques to bring memory wastage down.
>>>>> + *
>>>>> + * [1] Some ports apply further modifications to a pdx before indexing the
>>>>> + *     directmap. This doesn't change the fact that the same compression
>>>>> + *     present in the frame table is also present in the directmap
>>>>> + *     whenever said map is present.
>>>>
>>>> .. you mention it here as non-optional as well. Didn't you tell me that
>>>> Arm doesn't use compressed indexes into the directmap?
>>>>
>>>> Jan
>>>
>>> The [1] note states "whenever said map is present", meaning that it may not
>>> be present. Saying it's optional is a stretch though. It's not like we can
>>> choose right now.
>>>
>>>> Didn't you tell me that Arm doesn't use compressed indexes into the directmap?
>>> arm32 doesn't have a directmap at all. arm64 uses biased pdx as indices
>>> (they are offset by a constant), so they are still subject to compression.
>>
>> Hmm, then our understanding of "optional" was differing: I understood
>> "use of compressed indexes is optional", when you apparently meant
>> "the use of a directmap is optional". If this is the case, then I
>> agree with the chosen wording. (Nevertheless using the suggested "may"
>> wouldn't yield and incorrect outcome.)
> 
> Like this?
> 
> ```
>  * pdx: Page InDeX
>  *   Indices into the frame table holding the per-page's book-keeping
>  *   metadata. A compression scheme may be used, so there's a possibly non
>  *   identity mapping between valid(mfn) <-> valid(pdx). See the comments
>  *   in pdx.c for an in-depth explanation of that mapping. This also may
>  *   have a knock-on effect on the directmap, as "compressed" pfns may not
>  *   have corresponding mapped frames.
> ```
> 
> If so, sure. I don't mind either way. I'm happy for those 2 _may_s to be added. 

Yes please.

Thanks, Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 15:28:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 15:28:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564696.882313 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQ9H-0002fB-8e; Mon, 17 Jul 2023 15:28:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564696.882313; Mon, 17 Jul 2023 15:28:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQ9H-0002f4-5w; Mon, 17 Jul 2023 15:28:31 +0000
Received: by outflank-mailman (input) for mailman id 564696;
 Mon, 17 Jul 2023 15:28:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=LRey=DD=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qLQ9F-0002ew-GF
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 15:28:29 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 93b014b2-24b6-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 17:28:27 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.163.206.54])
 by support.bugseng.com (Postfix) with ESMTPSA id DECE14EE0737;
 Mon, 17 Jul 2023 17:28:22 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 93b014b2-24b6-11ee-b23a-6b7b168915f2
Message-ID: <3356b44e-a596-8cff-afd9-66bbcca53b30@bugseng.com>
Date: Mon, 17 Jul 2023 17:28:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
To: Jan Beulich <jbeulich@suse.com>, Luca Fancellu <Luca.Fancellu@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 "xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
 "ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
 "consulting@bugseng.com" <consulting@bugseng.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
 <CB1B8DB0-7708-454D-9E73-171CA894E304@arm.com>
 <f24d12ec-3edc-5aea-f399-05ed52ec1cbc@suse.com>
Content-Language: en-US
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <f24d12ec-3edc-5aea-f399-05ed52ec1cbc@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 17/07/23 15:59, Jan Beulich wrote:
> On 14.07.2023 16:20, Luca Fancellu wrote:
>>
>>
>>> On 14 Jul 2023, at 12:49, Nicola Vetrini <nicola.vetrini@bugseng.com> wrote:
>>>
>>> The macro 'testop' expands to a function that declares the local
>>> variable 'oldbit', which is written before being set, but is such a
>>> way that is not amenable to automatic checking.
>>>
>>> Therefore, a deviation comment, is introduced to document this situation.
>>>
>>> A similar reasoning applies to macro 'guest_testop'.
>>>
>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>> ---
>>> docs/misra/safe.json                     | 16 ++++++++++++++++
>>> xen/arch/arm/arm64/lib/bitops.c          |  3 +++
>>> xen/arch/arm/include/asm/guest_atomics.h |  3 +++
>>> 3 files changed, 22 insertions(+)
>>>
>>> diff --git a/docs/misra/safe.json b/docs/misra/safe.json
>>> index 244001f5be..4cf7cbf57b 100644
>>> --- a/docs/misra/safe.json
>>> +++ b/docs/misra/safe.json
>>> @@ -20,6 +20,22 @@
>>>          },
>>>          {
>>>              "id": "SAF-2-safe",
>>> +            "analyser": {
>>> +                "eclair": "MC3R1.R9.1"
>>> +            },
>>> +            "name": "Rule 9.1: initializer not needed",
>>> +            "text": "The following local variables are possibly subject to being read before being written, but code inspection ensured that the control flow in the construct where they appear ensures that no such event may happen."
>>> +        },
>>> +        {
>>> +            "id": "SAF-3-safe",
>>> +            "analyser": {
>>> +                "eclair": "MC3R1.R9.1"
>>> +            },
>>> +            "name": "Rule 9.1: initializer not needed",
>>> +            "text": "The following local variables are possibly subject to being read before being written, but code inspection ensured that the control flow in the construct where they appear ensures that no such event may happen."
>>> +        },
>>
>> Since the rule and the justification are the same, you can declare only once and use the same tag on top of the offending lines, so /* SAF-2-safe MC3R1.R9.1 */,
> 
> +1
> 
> I'm puzzled by the wording vs comment placement though: The comments
> are inserted ahead of the macro invocations, so there are no "following
> local variables". Plus does this imply the comment would suppress the
> checking on _all_ of them, rather than just the one that was confirmed
> to be safe? What if another new one was added, that actually introduces
> a problem?
> 
>> also, I remember some maintainers not happy about the misra rule being put after the tag, now I donâ€™t recall who
> 
> Me, at least. The annotations should be tool-agnostic imo, or else the
> more tools we use, the longer these comments might get.
> 
> Jan

No problem for both: Given the earlier remarks by Julien on patch 1/4, I 
think we can devise something along the lines of

/* SAF-x-safe MISRA:C 2012 Rule 9.1 <Justification> */
int var;

and then write a generic justification in docs/misra/safe.json, while
<Justification> contains a specific one (e.g., this loop does so and so 
to ensure that no access to unset variables happens). Thus any 
modification to that variable would give who submits the patch and the 
reviewer a chance to spot any inconsistency when the code is modified.

However, given my other response to this same patch, this does not apply 
here specifically.

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 15:31:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 15:31:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564702.882322 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQCF-00045K-MA; Mon, 17 Jul 2023 15:31:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564702.882322; Mon, 17 Jul 2023 15:31:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQCF-00045D-JS; Mon, 17 Jul 2023 15:31:35 +0000
Received: by outflank-mailman (input) for mailman id 564702;
 Mon, 17 Jul 2023 15:31:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4oQA=DD=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1qLQCD-000457-PR
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 15:31:33 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on20624.outbound.protection.outlook.com
 [2a01:111:f400:fe59::624])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 01afcece-24b7-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 17:31:32 +0200 (CEST)
Received: from SN6PR12MB2621.namprd12.prod.outlook.com (2603:10b6:805:73::15)
 by CH3PR12MB8185.namprd12.prod.outlook.com (2603:10b6:610:123::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Mon, 17 Jul
 2023 15:31:28 +0000
Received: from SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::4541:2a3d:737d:b194]) by SN6PR12MB2621.namprd12.prod.outlook.com
 ([fe80::4541:2a3d:737d:b194%5]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 15:31:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 01afcece-24b7-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=IXu0Ep1f3TjU6PkRNoSZmdK5MfSLQ2ObeiamdrE6uQo0WaRe6l58sQSMxF++TUwhFlko773orT05MQZ96vU5NULxqwOVu14GKqpTEnfZJA++J00/ImK5qIubL6Jag1dghW4np26o8Kun3Cc1ttRXlcWs3XT7nHMdgAY0JkhxJz3BKS6TH3+VdTJZ4gQZlvwBtpnq/PAgYPhDHZEh4/1z92SmLIOHJjmkeD1df0UpGM2RzRn5qIM4niydaXfI6C3PPmkAO4fKs2Ic6n+FjQL8WY53kXOdDb14f9NQ3IT1CDb4DNiZpGKDciVWqFyV1VzCPguB5JMMKn+u0pVfs0fF6g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=VLaD+0ThcHVK2/31hvO4n7RuN4Tigg93pMW/x7rwHpg=;
 b=mBh7ziIizl8hHtfYAm+n9nzP5M54G3CqUXBhqHZ3xMjky5qEkdGOecQB4GFdSwgzsI2td+U+GTbSLmeuShdSaeYlGLiuzh32TlPHlXX+5l6v8Md/AVj+LH/y36zY2R1aDT9Rv2Zu9t11Rfql4IxSk2CSwHmobx1srjaCzlGphgPVej57Qyp0cB7UK9kgOfa/JXQVnCOoVeO5VqtlQDLyrbgsZ34ZzxO107Qq0YdjXdE9ZlJeYoYJXOqQgstB5ZWRxLfYZ//B9jnIEOmtmlNWiD0rANJ9YONzhlbpQ4rhq8IgT9mv+YF5FbiNloFMAwvBZKT5PNlUav3EZFquS/w09g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=VLaD+0ThcHVK2/31hvO4n7RuN4Tigg93pMW/x7rwHpg=;
 b=sWeOot6bOCw+wSBtZRgAhP8zCUdC+YOcv2Ch6EdsmGgg+wxgbN4/aZt/lyiRka9coqB0G1WtajOFlyOFYHWjWFewtvIBWtmzxPQgrA5V8ladZPqFPlAkiPn9W0f3i3gBKu34tgScMZKvpsezS6aQjkKMHDfbzmyihD6tjBhp7DQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <9dd7e04e-92d9-bd90-dd66-0f8eefefc4a8@amd.com>
Date: Mon, 17 Jul 2023 16:31:21 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: U-Boot on XEN - dcache off
To: Michal Simek <michal.simek@amd.com>,
 "Stabellini, Stefano" <stefano.stabellini@amd.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Michal Orzel <michal.orzel@amd.com>,
 Stewart Hildebrand <stewart.hildebrand@amd.com>,
 "Garhwal, Vikram" <vikram.garhwal@amd.com>, Xenia.Ragiadakou@amd.com
References: <8929cafc-ea9c-35c9-e4a4-3c7ad2d1acc1@amd.com>
 <b60f4cb0-2a82-4227-de23-c59436cb47ef@amd.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <b60f4cb0-2a82-4227-de23-c59436cb47ef@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0548.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:319::11) To SN6PR12MB2621.namprd12.prod.outlook.com
 (2603:10b6:805:73::15)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN6PR12MB2621:EE_|CH3PR12MB8185:EE_
X-MS-Office365-Filtering-Correlation-Id: 5a179f62-d025-425c-2d81-08db86dae34c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	MiqqSmDRC1T8RKa+thAvTza/3xg+Jtz5eukC5nisz8k+UUbwOyPmUMse1R9JsxYFpGthF57in6sW10rShdSJOuX7DRfeu1C8VeMBfalAa+0Us4b6Iq/b5m2rYtWbO5f0NFqRGbd3362ktjM/e6yNyNfZvwhWvp0/YrKcFB+rR0Wm2TUM999vXBHX0DLnxl/TybgAVieWkgjyKaD2g05TDxqmeZKGMJrT8Ow/QA/YscwTIBGyjP3JHZ4sOO9WU1UtpOdXxQttRjVN33+SCLorQiXZw+kuR2FuNeJfoYgY+HXFpfrpXrPSVtb2fofjkV2MtfZj0Mxt+zDm3xSxp/wW6uOUKw7onkvIJ2VbALsz5uxS989bGPdQm7RjNp/2pj2nIX46NDugf195lMFLn8M7tmeey7+w21l+xri8rGk/oRqWOzqJD2AWxXsKJCRl+iuHqOem57WGqCQrOQwq0qxObMuu/C+v594MnOBoszYpdeZyojVuEsNlSlyNZNDI4OFfg+dCYI04Xy9RPtNoYFV7qzhl+r9PVD/g+h9wopiqnt98G6ZvrTAS7pMbrRJSTF6iahR2QJJyLHUhxfelF4/wpFkgE2WnsI18nfBRuR28x+DU2DD9LR2LNIzSOZqkOEh0h5/QjSJLTbia+Y7LQzTXxOeTqyLNy+3OiFZmPc8DEUA=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2621.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(366004)(376002)(136003)(39860400002)(451199021)(31686004)(478600001)(110136005)(6486002)(6666004)(54906003)(83380400001)(2616005)(66574015)(36756003)(31696002)(2906002)(26005)(6506007)(186003)(53546011)(966005)(6512007)(38100700002)(66946007)(66556008)(66476007)(4326008)(316002)(41300700001)(8676002)(8936002)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TW9meERnUmtWV0ZxVkh2S212bVlvT2RrTWpmLzJSd0EreWErZ0pTVGdPOVBw?=
 =?utf-8?B?dGFMN2h6dXlVczBUVDZtNUk0NXFPdTVVaVFyZmcyaTRERnRnRmw5NkczU1p5?=
 =?utf-8?B?QWN1WXloYVhzN2E4dTBNTHRaclNqSS80ajJuQy9hM2FyRWJRMVRwSDJMZWFN?=
 =?utf-8?B?N3dnQmsyL1ZPR285NzRvSXlUVmZNSGY0RDMyOThyL05WUnJSRWhLTzQydkpI?=
 =?utf-8?B?emdTYkFEc0p3ZXVCb1lpS2dxditrcU5EelgzV2R6dVlpRXpscFMzaFNJUFBY?=
 =?utf-8?B?OGJicWNJMmY5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hVajU4?=
 =?utf-8?B?THRjT2dJNisrR1dGMDdlTmFtTUtpTVRxWngxSmtOMG5veHhhUGlvMTlIcENO?=
 =?utf-8?Q?FSloLlHhULiUqMBz5coXru5NW?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5a179f62-d025-425c-2d81-08db86dae34c
X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2621.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 15:31:27.9953
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Pe8Fftx/GF4HefIaxC6IobLfmbIt1XJQcU2t/bKmKNRD1/SQLaeougtbS/lUyuT1yZgDNAKNEPtu+DSY7GNd1g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8185

+ xen-devel (Since the question is related to Xen on Arm in general).

Hi Michal,

Julien/Stefano/Bertrand - Please feel free to add in.

On 14/07/2023 15:14, Michal Simek wrote:
> +xen
>
> On 7/14/23 16:11, Michal Simek wrote:
>> Hi Stefano,
>>
>> I am playing with running u-boot on the top of xen 
>> (xenguest_arm64_defconfig) based on ask from Kris to run QNX on the 
>> top of it.
>> In past we found that QNX requires to have DCACHE off before it's start.
>> Chris found in past that dcache off is not working and he passed this 
>> to us to take look at it more.
>>
>> That's why I enabled cache commands to be able to run dcache off and 
>> see the hang as Kris.
>> I found one interesting commit created by Marc for Android which were 
>> taken back to u-boot upstream. It is talking about KVM and I barely 
>> understand what he is talking about.
>> I of course enabled this option to try it and behavior is the same.
>> That's why my question is what Xen is doing in connection to dcache 
>> operations.

WRT cache operations, Refer 
https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=53b705d02cec03861044e673536586bd1b2443bd 


WhenÂ theÂ dataÂ abortÂ isÂ causedÂ dueÂ toÂ cacheÂ maintenanceÂ forÂ anÂ address,
thereÂ areÂ threeÂ scenarios:-

1.Â AddressÂ belongingÂ toÂ aÂ nonÂ emulatedÂ regionÂ -Â ForÂ this,Â XenÂ should
setÂ theÂ correspondingÂ bitÂ inÂ theÂ translationÂ tableÂ entryÂ toÂ validÂ and
returnÂ toÂ theÂ guestÂ toÂ retryÂ theÂ instruction.Â ThisÂ canÂ happenÂ sometimes
asÂ XenÂ needÂ toÂ setÂ theÂ translationÂ tableÂ entryÂ toÂ invalid.Â (forÂ eg
'Break-Before-Make'Â sequence).Â XenÂ returnsÂ toÂ theÂ guestÂ toÂ retryÂ the
instruction.

2.Â AddressÂ belongsÂ toÂ anÂ emulatedÂ regionÂ -Â XenÂ shouldÂ ignoreÂ the
instructionÂ (ieÂ incrementÂ theÂ PC)Â andÂ returnÂ toÂ theÂ guest.

3.Â AddressÂ isÂ invalidÂ -Â XenÂ shouldÂ forwardÂ theÂ dataÂ abortÂ toÂ theÂ guest.

>> Do you know what by-VA cache maintenance operations are?

These are cache operations by virtual address. Refer 
https://developer.arm.com/documentation/den0024/a/Caches/Cache-maintenance

The cache operations (invalidate, clean, zero) can be performed in any 
of the three ways :-

1. all - The entire cache is affected

2. VA - Cache line that contains a certain virtual address is affected.

3. Set/way :- Cache line selected by its position in the cache structure.

>>
>>
>> commit 46dc54287031759c03c68902283d92076938305c
>> Author:Â Â Â Â  Marc Zyngier <maz@kernel.org>
>> AuthorDate: Thu Feb 9 04:54:27 2023 +0800
>> Commit:Â Â Â Â  Tom Rini <trini@konsulko.com>
>> CommitDate: Mon Mar 6 17:03:55 2023 -0500
>>
>> Â Â Â Â  arm: cpu: Add optional CMOs by VA
>>
>> Â Â Â Â  Exposing set/way cache maintenance to a virtual machine is 
>> unsafe, not
>> Â Â Â Â  least because the instructions are not permission-checked but also
>> Â Â Â Â  because they are not broadcast between CPUs. Consequently, KVM 
>> traps and
>> Â Â Â Â  emulates such maintenance in the host kernel using by-VA operations 

I am not sure if Xen behave in same way (ie traps and emulates *all* 
cache maintenance instructions).

@Julien, Stefano, Bertrand - Do you know more about this ?

>> and
>> Â Â Â Â  looping over the stage-2 page-tables. However, when running under
>> Â Â Â Â  protected KVM, these instructions are not able to be emulated 
>> and will
>> Â Â Â Â  instead result in an exception being delivered to the guest.
>>
>> Â Â Â Â  Introduce CONFIG_CMO_BY_VA_ONLY so that virtual platforms can 
>> select
>> Â Â Â Â  this option and perform by-VA cache maintenance instead of using 
>> the
>> Â Â Â Â  set/way instructions.
>>
>> Â Â Â Â  Signed-off-by: Marc Zyngier <maz@kernel.org>
>> Â Â Â Â  Signed-off-by: Will Deacon <willdeacon@google.com>
>> Â Â Â Â  Signed-off-by: Pierre-ClÃ©ment Tosi <ptosi@google.com>
>> Â Â Â Â  [ Paul: pick from the Android tree. Fixup Pierre's commit. And 
>> fix some
>> Â Â Â Â Â Â  checkpatch warnings. Rebased to upstream. ]
>> Â Â Â Â  Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
>> Â Â Â Â  Cc: Tom Rini <trini@konsulko.com>
>> Â Â Â Â  Link: 
>> https://android.googlesource.com/platform/external/u-boot/+/db5507f47f4f57f766d52f753ff2cc761afc213b
>> Â Â Â Â  Link: 
>> https://android.googlesource.com/platform/external/u-boot/+/2baf54e743380a1e4a6bc2dbdde020a2e783ff67
>>
>>
>> Code ends when it tries to call
>> set_sctlr(sctlr & ~(CR_C|CR_M));
>>
>> Here is implementation. I confirm EL level which is obviously EL1.
>>
>> 180 static inline void set_sctlr(unsigned long val)
>> 181 {
>> 182Â Â Â Â Â Â Â Â  unsigned int el;
>> 183
>> 184Â Â Â Â Â Â Â Â  el = current_el();
>> 185Â Â Â Â Â Â Â Â  if (el == 1)
>> 186Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  asm volatile("msr sctlr_el1, %0" : : "r" (val) : 
>> "cc");
>> 187Â Â Â Â Â Â Â Â  else if (el == 2)
>> 188Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  asm volatile("msr sctlr_el2, %0" : : "r" (val) : 
>> "cc");
>> 189Â Â Â Â Â Â Â Â  else
>> 190Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  asm volatile("msr sctlr_el3, %0" : : "r" (val) : 
>> "cc");
>> 191
>> 192Â Â Â Â Â Â Â Â  asm volatile("isb");
>> 193 }
>>
>> Is there any reason why it is not possible to clear to sctlr_el1 
>> CR_C/CR_M - cache disabling, MMU disabling?

Not sure IIUC,Â  sctlr_el1 CR_C/CR_M are being cleared to disable D 
cache/MMU. Did I miss something ?

- Ayan

>> I checked already that u-boot starts with cache off/mmu off and when 
>> tables are setup bits are setup.
>>
>> Thanks,
>> Michal


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 15:39:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 15:39:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564707.882332 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQJD-0004qM-HU; Mon, 17 Jul 2023 15:38:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564707.882332; Mon, 17 Jul 2023 15:38:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQJD-0004qF-Es; Mon, 17 Jul 2023 15:38:47 +0000
Received: by outflank-mailman (input) for mailman id 564707;
 Mon, 17 Jul 2023 15:38:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLQJC-0004q9-6B
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 15:38:46 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0609.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::609])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 036ef0a1-24b8-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 17:38:45 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB7863.eurprd04.prod.outlook.com (2603:10a6:20b:2a8::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 15:38:42 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 15:38:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 036ef0a1-24b8-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=j0bBugJ02KXN4tZq2VV+cyPeqL5slpZTti+Y3YUBTwj5/kRxvtrRk60Y+wG7Mul7msgP9IpQcCwqh+CemSf8P3BTog9DAgcfZ3MWmspr1YljBObDS9tuSSdYRL1OPEAKFQKpTPc7yY/QQ/AlB0zZiOTb29DJflcy/tcKwtPV2v6rE24RwpiY4dtaXDBhhfl2gh7ApDsQV0qFOmOq2vnq4OBFb2ZU/n5wVgZCVuYVtvfJ7/0yoLIu6KWNUHJfUkO1SrOCpoyMZlJ/wdzCtltpre23bEOCrIS4WmGtVixfQ/PO3tseYjp9/H/aXAOAbca+EreErMmcZPRoSIE3Sz1QPQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yoDIoWb9uqbJ5DSc/yd9xNBXFHWJFWzUNhu1LXcVW2Q=;
 b=VZ02S/DJd8Vd88wxRX/ixHAS44FpFRUX9yhJTCBwqEa5GAqXrDk4KsxucrT5tGrmfqE9cRuvzhFxdCHkOJUM9D91DNgQJue8njDtAOMR4gb/nUQWUXQ1Tl8fXbEVYwzErP+FQzVdu9Oan9UUcN7jiLpJhE35O3yVuRZRz9FvPc0eGiJXgrjT+InEaAk6B/ycgCFADVn7sQ8e5pfj8D4RJNQ0X9PhEYiB5wjh4F3X5D6dV6a5zRQYR5JgNrqNS65mtBdou2drxTaNwDOgVxTQosCwGGfk3qlC1W4Y63IssGxKdhGZLQ8h99/fuFxr7csj3BWYzyPejD/y0VpVIEG20Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yoDIoWb9uqbJ5DSc/yd9xNBXFHWJFWzUNhu1LXcVW2Q=;
 b=ef9EFK1Hu4bJjje6PyCpy3vFxMYhJpVG50A+zfnftDGKyfGwdDZCUC67dccR7EmXwqZC2/Dx0pc+geL/K8OGT97A5JIERp51EfxKRUr7zkVeuQHLB5V5yta5yq7ZAH2M2/GecFpPk3pG67W9kZpX02QnPnrNaAexnbe/EEIEROPFwFHlSyL+FRKGDE3v69L8Np+D89ohZ/vx8K3B1v3XM930kuVzS83TtPMCRwj11SF6fIzxX9sOrCigPbed8Tuzj7X3QGXB4uzDqZNF1CxZ7F6XXmMikpaLWq9HoCJBXNo9rUujSNCJIoO6FXAknaYnxdWGe7umBANanz3A6siQTQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <7f6feb8b-29fe-7a7f-8965-20a12b4dfb25@suse.com>
Date: Mon, 17 Jul 2023 17:38:40 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 1/3] xen/ppc: Set up a basic C environment
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1688670018.git.sanastasio@raptorengineering.com>
 <8c79f498ffcb0837ff18640dbaf5b66f79186574.1688670018.git.sanastasio@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <8c79f498ffcb0837ff18640dbaf5b66f79186574.1688670018.git.sanastasio@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0243.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:af::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB7863:EE_
X-MS-Office365-Filtering-Correlation-Id: 4c825494-deb2-4197-0e7e-08db86dbe685
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	qVR2ZdPoXsRil4AzPJ32fzdT9Gt9T8X9wh0qSCJ9pvobJ387eGafgjhz2QwKb6bInYKv0VlvZ8FPpEVagUBiwd/ob0dSrSGHuy2CjG+ZwCiBE8RVWChA8rUKQFUsgYUmTS2CAYjQFP7d8L2Yw1cs+KGpk98OMPjDRk373QeEKXGuUfl4lN61sIT500V7WaVDkpLnI43h7hN82h4rKf2Md6gduLqgpeNAA5eD5ouJW5cNsPmnAygW2VcpJ+UmMt6Fqyic5wonoyylM3J8wPr3ACvurovaR69t8TOtcwpBHQDTYahf4jj1Ow+Xx88rkZwOzPu52/8ZOsxFARBnobXeyj2MTim48am0twCe8x7+3y2bfK9CULUcdgHuuVtRmXCo2vJ6Y2v5cLMCw9/T+EnLdwTXw1UzKJdKsJfc3veDCHcufXQyjKJ2wEntsIXn8rDC4lpONnYqAQDPr1dKFzMTNgPdyzSlSkLztdRf4ahujDgI5KdHXR9g1LRiiE/L/zYoUeFLQ3LhP8X/arshMLcE4XQFoBWjpFGNPoN/mikW7STCaZo6oEQpj1HGEZmjwEGQzkerRXmrEgVXLaSkH3E0Wo4d5HBTv1TfX/sIzUHq45yqhx5M8wUu0eaI+OjKXZe0F2Ss4g+CFvKK8ML8AAVRsA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(136003)(376002)(396003)(39860400002)(366004)(451199021)(36756003)(86362001)(38100700002)(2906002)(478600001)(4326008)(6486002)(54906003)(53546011)(6506007)(26005)(6512007)(8676002)(8936002)(316002)(41300700001)(31696002)(66946007)(31686004)(5660300002)(66556008)(6916009)(2616005)(83380400001)(66476007)(186003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QjhyS0EwQUFWV3BMbnNIbDdkTG8vVlFiY3FNNitwWmcwbGdRamRlRS9iZXZF?=
 =?utf-8?B?M3RMaUVRNURTOTBwZkV4aVBKVlJINDc4ZENKU3EyZ3RhTStUUWZpTnk1VC9s?=
 =?utf-8?B?UWExdkdsYTlIdnRTNStUdW8zU3k1MXJ5ek1xbDBtUkR4VlhmMVpqeHVhSUpK?=
 =?utf-8?B?cXVMRXNkeVBaRjE4Q1N6STBRd3IxMjhpdVNGZXNkVVlFeStmRW1hNkFiY0hM?=
 =?utf-8?B?bnRtVTJZWUVsTFVRSDR5UmN0bVlOcmNLcW8wcG0yODhXcWE3TzEydWtpOFRJ?=
 =?utf-8?B?OEFKRUFoamc4NUlhTHNkWXo3TmY4UFBZanF5K3dwRmxFd1pqSk8ydVJMTUJ3?=
 =?utf-8?B?cjAvbmRRcG1STmVQMm1DTVhUSU50RUloTzdCMml4RXhuSFN0cm5xeHljRU1q?=
 =?utf-8?B?am5UWkE0RjMvdFl0YnczV3JlbHNEUnQ1OVBuMExGNXdJOURaRWVUYTBEU3dh?=
 =?utf-8?B?dHk5ai9OZzQxbFBaaVRXZlhLNlpuZ3E3UkRqSy9nRWVOU0JUNC9YSWJVcjFU?=
 =?utf-8?B?dXVMckFkZWRUckZXamU2T1hMeXpkeFlXRFprUUc3Z09DandmcWFuaDRqeU00?=
 =?utf-8?B?ei9kSDBSaXB0RGZ5ZUtCeDZCY0VBaDdTWXhmZ01uMW1UbDdaMTFJak1yM3l4?=
 =?utf-8?B?WUVVUzBkNDZod2grbGVCRDJuOW5hcG0yTVhXUThMVnpiSit6eCtLSmFIYTVG?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3h3RDVVd3dYbFFaK2hiNVZxanc5VnBSQ0lqbVMzdUM1?=
 =?utf-8?B?L3pQNUM0em1KL210ZFV2d2laV3VaV2NqaFhWRDBZRGIwd3JTbldEZHkwaW1X?=
 =?utf-8?B?RVl5d21VMkZHbzErUnZMVFE0cnk4VUdaWGRGUHdwdFhUVmduTGNWRithRjZp?=
 =?utf-8?B?S3NPUnk1cnJ1ZmpFNU1IRXVURm9SalBsZU94WTg3aFJrZGZyVU1QUmJYcDNQ?=
 =?utf-8?B?WURpWUhzT28rUHAyOG1hbzZ2MzFDMWx0MExBVHpycE9FZWUxbktXa3lTVlpH?=
 =?utf-8?B?bVBCaFJJN2hLZkFDODBBcklwUzA0d1RwSzgvdmFDalB4SDZ5TThZcVNpV3VF?=
 =?utf-8?B?T0d5VUJGOUtVVXY3UDBsTHAyQzc5Wkhra1lSUHBncGwrVGRYZDhncVQxekJI?=
 =?utf-8?B?cmo4dzd6ZHpUR3hqSGJVWEpWZncwSlFtcW1TNUtLbnJydnVFSmVMdkppaW04?=
 =?utf-8?B?ZDVsQTFrV1c1ZHBwUlEyVzBjREdRMVI1Y2hmSGZnbUdESXpzTlJ5dXFZUW1K?=
 =?utf-8?Q?g3MyaQo/QyDnczEmSNAqNNLBU?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4c825494-deb2-4197-0e7e-08db86dbe685
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 15:38:42.7524
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: y8bZxgD1x05+i2JO8X2wUaV6w1upCzhxq1VSKbYmhScooubEIynGHqV5AX8HHORItInQkqwKEQ41kH22/N5O5Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7863

On 06.07.2023 21:04, Shawn Anastasio wrote:
> --- a/xen/arch/ppc/include/asm/config.h
> +++ b/xen/arch/ppc/include/asm/config.h
> @@ -43,7 +43,7 @@
>  
>  #define SMP_CACHE_BYTES (1 << 6)
>  
> -#define STACK_ORDER 2
> +#define STACK_ORDER 0
>  #define STACK_SIZE  (PAGE_SIZE << STACK_ORDER)

In which way is this related to the change at hand? Aren't you going to
need to undo this rather sooner than later?

> --- a/xen/arch/ppc/ppc64/head.S
> +++ b/xen/arch/ppc/ppc64/head.S
> @@ -1,30 +1,30 @@
>  /* SPDX-License-Identifier: GPL-2.0-or-later */
>  
> +#include <asm/asm-defns.h>
> +
>      .section .text.header, "ax", %progbits
>  
>  ENTRY(start)
>      /*
> -     * Depending on how we were booted, the CPU could be running in either
> -     * Little Endian or Big Endian mode. The following trampoline from Linux
> -     * cleverly uses an instruction that encodes to a NOP if the CPU's
> -     * endianness matches the assumption of the assembler (LE, in our case)
> -     * or a branch to code that performs the endian switch in the other case.
> +     * NOTE: argument registers (r3-r9) must be preserved until the C entrypoint
>       */
> -    tdi 0, 0, 0x48    /* Reverse endian of b . + 8          */
> -    b . + 44          /* Skip trampoline if endian is good  */
> -    .long 0xa600607d  /* mfmsr r11                          */
> -    .long 0x01006b69  /* xori r11,r11,1                     */
> -    .long 0x00004039  /* li r10,0                           */
> -    .long 0x6401417d  /* mtmsrd r10,1                       */
> -    .long 0x05009f42  /* bcl 20,31,$+4                      */
> -    .long 0xa602487d  /* mflr r10                           */
> -    .long 0x14004a39  /* addi r10,r10,20                    */
> -    .long 0xa6035a7d  /* mtsrr0 r10                         */
> -    .long 0xa6037b7d  /* mtsrr1 r11                         */
> -    .long 0x2400004c  /* rfid                               */
> -
> -    /* Now that the endianness is confirmed, continue */
> -1:  b 1b
> +    FIXUP_ENDIAN
> +
> +    /* set up the TOC pointer */
> +    LOAD_IMM32(%r2, .TOC.)
> +
> +    /* set up the initial stack */
> +    LOAD_IMM32(%r1, cpu0_boot_stack)

Wouldn't this (and perhaps also .TOC.) better be calculated in a
PC-relative manner? Or is the plan to have Xen linked to an address
below 4Gb?

> +    li %r11, 0
> +    stdu %r11, -STACK_FRAME_OVERHEAD(%r1)
> +
> +    /* call the C entrypoint */
> +    bl start_xen
> +
> +    /* should never return */
> +    trap
>  
>      .size start, . - start
>      .type start, %function
> +
> +    .section .init.data, "aw", @progbits

What's this good for when no data follows?

> --- /dev/null
> +++ b/xen/arch/ppc/setup.c
> @@ -0,0 +1,19 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +#include <xen/init.h>
> +
> +/* Xen stack for bringing up the first CPU. */
> +unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZE);

This yields the entire array as zero-initialized. At which point I
don't see a need for the store in head.S.

> +/* Macro to adjust thread priority for hardware multithreading */
> +#define HMT_very_low()  asm volatile (" or %r31, %r31, %r31 ")

Nit: Style. Wants to be

#define HMT_very_low()  asm volatile ( "or %r31, %r31, %r31" )

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 15:46:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 15:46:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564712.882342 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQQl-0006KE-Cd; Mon, 17 Jul 2023 15:46:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564712.882342; Mon, 17 Jul 2023 15:46:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQQl-0006K7-A0; Mon, 17 Jul 2023 15:46:35 +0000
Received: by outflank-mailman (input) for mailman id 564712;
 Mon, 17 Jul 2023 15:46:34 +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 <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLQQj-0006K1-Vt
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 15:46:33 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2051.outbound.protection.outlook.com [40.107.7.51])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 19bd1b15-24b9-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 17:46:31 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM8PR04MB7908.eurprd04.prod.outlook.com (2603:10a6:20b:24c::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 15:46:02 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 15:46:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 19bd1b15-24b9-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=FR3KG2H8uR3HW5K7OV7mF/E7fTF0HW1eTVtl0ZF4bxyCLYKvk0E6SRhdPwxs8vqKcR8RVMqtzw6XfdbE0L56kdN+dpdgVB3xuVO7f80yfPI+gf3nUVcRXS93TXIC4ptOzx8hFn/c60et3OhoMMZhCvYjjUud5hwikQ2xsULcJwrztVzMFbRrn/zOg8RYLCXO8VoZKi3YGoUJwtsvk6kLXMq6OTZIyKGS7W2Q9wKNsRvF+WwpmMe0xUC4A3NDkO1yXSi17WGHaundsPdqeYHq0LTw5bfHpb3tjS/4cLMkjYtfcancHpS5KB1Ce9b5reu63gxSay+jvaHTh76j04AU6Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=NpLexldcu4MmDHL8LiHJAOQH6PDsJ6m6CBOmsX8QNS8=;
 b=Y39lZmJgeBoedPEc4Nrv8iZTXqDUqpEkyqqfBJsLZ9AQImhgOpg0Uiad/mP7Iva12kmrhzvqw0K07RbwuMv7lgEbY+3vx3Vsrg3s3FGVLXpziu38OU/o4mSQ06iJg0XBrkT+4b33il2d97CmYmrTtMEtEY1JK2lXnd1VjX8yXPu4RPqdltpcB6JfAAusRRdvkDBeomeb35adCYD97ZDA3Zx6tpIt+R2CujhMmh7L4/7CayuEfwRqWJSNQ8sesS/zu4w1tz66HIeuqdKZZEZYbRWyRw40/GR60DRzK9ejqRfHL84nFpumHX/+8Ie5dP6OmwnCAwV7eoZJBro7EQHybg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=NpLexldcu4MmDHL8LiHJAOQH6PDsJ6m6CBOmsX8QNS8=;
 b=ZNqJgiZk8p7CUQOLoN+AQbwT+1XRt+IeLUkAwrAM63HbV0hqdBlxfn4TAnUg44oFsdaeblia2q42a2PyBhotxKyfaGzJMfZ0wjd9WCrTs4zpWm8TK0IpB7HsoWryllPlQdkImQr1z1Oa6mSqKk+Jen/aWJ9Ja9ppuHfFj3NIetD57Gf4LwOmESESqZG4B0u4izcnk4gTaxp65r3aty/TTbPPQ91LgtfqkJ5lIj1dSFj7MtxsAchKW2v+psH+GibOT5t8GOSHomfxz4WMbNhp+P9LdinGgY6099IC+IhDUPc02zBu4qnzd7FpDLe3bjWmn1SBm7qK4aIkDp+VVa3+7A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <996e3d7d-96db-2f3d-8f4e-0805a2c60a6f@suse.com>
Date: Mon, 17 Jul 2023 17:46:00 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 "xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
 "ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
 "consulting@bugseng.com" <consulting@bugseng.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Luca Fancellu <Luca.Fancellu@arm.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
 <CB1B8DB0-7708-454D-9E73-171CA894E304@arm.com>
 <f24d12ec-3edc-5aea-f399-05ed52ec1cbc@suse.com>
 <3356b44e-a596-8cff-afd9-66bbcca53b30@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <3356b44e-a596-8cff-afd9-66bbcca53b30@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0036.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:14::23) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM8PR04MB7908:EE_
X-MS-Office365-Filtering-Correlation-Id: 5f726f30-b9bb-4f68-8396-08db86dcecbb
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	KPQ4yJbuB753Xa4HM5wsREnLpUpdBJbVgU3oKsBicPuaLcekNgS/qqzMHqcrJqLPoAoLaZFIrPBOOtVy5rY1KRO+TZW3+Tv1B5zp1JEOUEyVJN6cl0NvlAWozNwGYEYVGsDSLgBcfvo8Zu4OLTcw0n3Ug+Auawp4SGJXeG45vCxz42cajn86y82Jz8ghijK++yhl3NICN9GH5veYUYj8uoDnqQM/+xayImm0zlL6dsUHSv6di/j9ZoOjdH8QY0a+MPwd+UMxhuA5KyuZUwKGHC+Iry2CbzzP5O2SIehqjar0h+UW8yMfb47khQoUV/uaUPGRGLnxygfVlKOPBhDe0owm3Tx1yYR1lRH9vJSA/DAVcPNWiWCwJwjHVjMSlBywLKxIT/l0ppfhrToP6Qjy16xDFY/2YoRJ642ofzeoYnTqt1PT5yhxPfRVO4y7Jh9cC366yKr041JspWXVnYRgFtqcxM/s21U0U2qdmHirkIhrM/Xj3eo78dghHy3ZKzHqw33z8p174/BPu902sQuViqzSVzUeUib1zjzLL1X7xcdHgmy6Q/jfEhxTjoCpFZwpjNgtaRg0idV8DeagjLlwFfkzcmGzUoeU6BVSZ2AH1HaWPPJPP/okKdLNfv5ymtAUI45bMUSMnwfNl3BRfP3LwgVKKqZ+SV+iy+AiDZ2OTwXuYMRezC7ZlBWc8bGjbM8L7XKoC5FJCvp4oHVEV5o0AA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(39860400002)(366004)(376002)(396003)(346002)(451199021)(31686004)(31696002)(86362001)(2906002)(36756003)(7416002)(6512007)(186003)(83380400001)(6506007)(53546011)(26005)(38100700002)(6486002)(54906003)(316002)(5660300002)(66476007)(6916009)(66946007)(66556008)(2616005)(4326008)(478600001)(41300700001)(8936002)(8676002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SENPa254MjhKYndWUWZvVnMyWms2cXEyVzNvTzFPdnhwazNnUUMyZzJIQTJs?=
 =?utf-8?B?ZjFIRUZyNEhyUkhBd201S0M4OW5MUmZaR1ZqdzFGdkpMZFpCbGZvOGRBOEpt?=
 =?utf-8?B?T1hmdkNqcU4xWUoyWWNQRnVvcmh2SVNiOS9yRm9KUk10S3BJbG1IaXo2bGNX?=
 =?utf-8?B?RGk1bzNtNzhQRDN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zbm5kVFpZNWliSDNQNjF4eWxsNzVYM05PNlRqMUk3YitZZW54Rk9JN25i?=
 =?utf-8?B?dU1ERWlhb0VmMlBvVG9Wc1I4Q2FNVWZxYzM2cTRRUW1ERVAxbTZaOUhEZEMy?=
 =?utf-8?B?WURUSUNTUXpxM2ppZnJQTmhzMEsza2ZHMHpSTEtIK2V3OGNQWWx3WXBtWGJi?=
 =?utf-8?Q?fXxLxpaPLODd/VvwmJk6WSYyl?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5f726f30-b9bb-4f68-8396-08db86dcecbb
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 15:46:02.6736
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: PeJDdoBafsQQcLXGR1dK0+aGePWtHtTwPWzbQJfEBunVFeJIBoOFqHOs7BuvE6zQ8aWh336roI/dE91wAvwXgA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7908

On 17.07.2023 17:28, Nicola Vetrini wrote:
> 
> 
> On 17/07/23 15:59, Jan Beulich wrote:
>> On 14.07.2023 16:20, Luca Fancellu wrote:
>>>
>>>
>>>> On 14 Jul 2023, at 12:49, Nicola Vetrini <nicola.vetrini@bugseng.com> wrote:
>>>>
>>>> The macro 'testop' expands to a function that declares the local
>>>> variable 'oldbit', which is written before being set, but is such a
>>>> way that is not amenable to automatic checking.
>>>>
>>>> Therefore, a deviation comment, is introduced to document this situation.
>>>>
>>>> A similar reasoning applies to macro 'guest_testop'.
>>>>
>>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>>> ---
>>>> docs/misra/safe.json                     | 16 ++++++++++++++++
>>>> xen/arch/arm/arm64/lib/bitops.c          |  3 +++
>>>> xen/arch/arm/include/asm/guest_atomics.h |  3 +++
>>>> 3 files changed, 22 insertions(+)
>>>>
>>>> diff --git a/docs/misra/safe.json b/docs/misra/safe.json
>>>> index 244001f5be..4cf7cbf57b 100644
>>>> --- a/docs/misra/safe.json
>>>> +++ b/docs/misra/safe.json
>>>> @@ -20,6 +20,22 @@
>>>>          },
>>>>          {
>>>>              "id": "SAF-2-safe",
>>>> +            "analyser": {
>>>> +                "eclair": "MC3R1.R9.1"
>>>> +            },
>>>> +            "name": "Rule 9.1: initializer not needed",
>>>> +            "text": "The following local variables are possibly subject to being read before being written, but code inspection ensured that the control flow in the construct where they appear ensures that no such event may happen."
>>>> +        },
>>>> +        {
>>>> +            "id": "SAF-3-safe",
>>>> +            "analyser": {
>>>> +                "eclair": "MC3R1.R9.1"
>>>> +            },
>>>> +            "name": "Rule 9.1: initializer not needed",
>>>> +            "text": "The following local variables are possibly subject to being read before being written, but code inspection ensured that the control flow in the construct where they appear ensures that no such event may happen."
>>>> +        },
>>>
>>> Since the rule and the justification are the same, you can declare only once and use the same tag on top of the offending lines, so /* SAF-2-safe MC3R1.R9.1 */,
>>
>> +1
>>
>> I'm puzzled by the wording vs comment placement though: The comments
>> are inserted ahead of the macro invocations, so there are no "following
>> local variables". Plus does this imply the comment would suppress the
>> checking on _all_ of them, rather than just the one that was confirmed
>> to be safe? What if another new one was added, that actually introduces
>> a problem?
>>
>>> also, I remember some maintainers not happy about the misra rule being put after the tag, now I donâ€™t recall who
>>
>> Me, at least. The annotations should be tool-agnostic imo, or else the
>> more tools we use, the longer these comments might get.
> 
> No problem for both: Given the earlier remarks by Julien on patch 1/4, I 
> think we can devise something along the lines of
> 
> /* SAF-x-safe MISRA:C 2012 Rule 9.1 <Justification> */
> int var;
> 
> and then write a generic justification in docs/misra/safe.json, while
> <Justification> contains a specific one (e.g., this loop does so and so 
> to ensure that no access to unset variables happens).

But that still mentions the rule. What if a new MISRA:C 2025 appears,
with different rule numbers? I don't mind the comment mentioning, in
a sufficiently terse way, what problem is circumvented. But I don't
think tools or specifications should be referenced here. That's the
purpose of the referenced "database" entry.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 15:50:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 15:50:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564710.882352 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQUO-0007ot-SK; Mon, 17 Jul 2023 15:50:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564710.882352; Mon, 17 Jul 2023 15:50:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQUO-0007om-PN; Mon, 17 Jul 2023 15:50:20 +0000
Received: by outflank-mailman (input) for mailman id 564710;
 Mon, 17 Jul 2023 15:40:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=damT=DD=kernel.org=rfoss@srs-se1.protection.inumbo.net>)
 id 1qLQKX-0006DV-Qt
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 15:40:09 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 349f065a-24b8-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 17:40:08 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 9F46561166
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 15:40:06 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 931A3C611A5
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 15:40:05 +0000 (UTC)
Received: by mail-oa1-f53.google.com with SMTP id
 586e51a60fabf-1b0419f758eso3617961fac.1
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 08:40:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 349f065a-24b8-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689608405;
	bh=tF/K12dcb1AtR13XQY0pq3bgmoCAiVfZHpGq03H1+sk=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc:From;
	b=mX8RhJfEol8SKSIZYImvm3vgYGg2QOjrhEImVy70eQw9yFGHJhacPYnLrSEjLcXVH
	 lsK1foH9DnVkOrz0XgrZvShJMkw35zdZXkm28OGXKxZAPZQPWjnMqmD7u1K/6wWyrF
	 KESSOxDGgUcHfAUMGWeNgAp8rP61IeLKmYc7IOGocR2yzizGnLQn+2LOPOUV3VN8RI
	 nXJsuiRAgYTOZFEMemZolvUrK9EbLD+pNe2um6lCwrS0nGmoypnFT87DTWspO0tENT
	 6g2YWD6p/fpzoiD+byVvvn8YboH7BuhPrNAUEc3aLc7yE8lROrZtFeZkeMUjss/bxz
	 8gUvf0rnNUAvw==
X-Gm-Message-State: ABy/qLZ9qen2BEU7hLd72owiWq3gmNWB6jyLBZRZeZ9omdok8mAZGJ5a
	saIwsmqvgYVCTx2f589sMWSDVWISZU92vRZySqh0bg==
X-Google-Smtp-Source: APBJJlHs9bNlVGErzzDkG3ITNYPrBi9bcbK5hB2pZ5ku9OA6MncccRQ7QQDddVXbZVn5Z/tCXP76UHYBqks/PFSJBmQ=
X-Received: by 2002:a17:90b:1095:b0:263:3567:f99 with SMTP id
 gj21-20020a17090b109500b0026335670f99mr13011407pjb.15.1689608384033; Mon, 17
 Jul 2023 08:39:44 -0700 (PDT)
MIME-Version: 1.0
References: <20230714174545.4056287-1-robh@kernel.org> <114500369.nniJfEyVGO@phil>
 <CAL_JsqJMo4LHRmsfRQAr-j6oNESbS=q+eFU+B7e720emjf+8nA@mail.gmail.com>
In-Reply-To: <CAL_JsqJMo4LHRmsfRQAr-j6oNESbS=q+eFU+B7e720emjf+8nA@mail.gmail.com>
From: Robert Foss <rfoss@kernel.org>
Date: Mon, 17 Jul 2023 17:39:32 +0200
X-Gmail-Original-Message-ID: <CAN6tsi5wOhptw4PgP2etkC5KYh_5cfOXZuVhsN6YCMiqn15hog@mail.gmail.com>
Message-ID: <CAN6tsi5wOhptw4PgP2etkC5KYh_5cfOXZuVhsN6YCMiqn15hog@mail.gmail.com>
Subject: Re: [PATCH] drm: Explicitly include correct DT includes
To: Rob Herring <robh@kernel.org>
Cc: Heiko Stuebner <heiko@sntech.de>, Liviu Dudau <liviu.dudau@arm.com>, 
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, 
	Andrzej Hajda <andrzej.hajda@intel.com>, Neil Armstrong <neil.armstrong@linaro.org>, 
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>, Jonas Karlman <jonas@kwiboo.se>, 
	Jernej Skrabec <jernej.skrabec@gmail.com>, Jagan Teki <jagan@amarulasolutions.com>, 
	Liu Ying <victor.liu@nxp.com>, Shawn Guo <shawnguo@kernel.org>, 
	Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, 
	Fabio Estevam <festevam@gmail.com>, NXP Linux Team <linux-imx@nxp.com>, Inki Dae <inki.dae@samsung.com>, 
	Marek Szyprowski <m.szyprowski@samsung.com>, 
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, 
	Thomas Zimmermann <tzimmermann@suse.de>, Lucas Stach <l.stach@pengutronix.de>, 
	Russell King <linux+etnaviv@armlinux.org.uk>, 
	Christian Gmeiner <christian.gmeiner@gmail.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, 
	Kyungmin Park <kyungmin.park@samsung.com>, 
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, Alim Akhtar <alim.akhtar@samsung.com>, 
	Xinliang Liu <xinliang.liu@linaro.org>, Tian Tao <tiantao6@hisilicon.com>, 
	Xinwei Kong <kong.kongxinwei@hisilicon.com>, Sumit Semwal <sumit.semwal@linaro.org>, 
	Yongqin Liu <yongqin.liu@linaro.org>, John Stultz <jstultz@google.com>, 
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>, Paul Cercueil <paul@crapouillou.net>, 
	Qiang Yu <yuq825@gmail.com>, Paul Kocialkowski <paul.kocialkowski@bootlin.com>, 
	Linus Walleij <linus.walleij@linaro.org>, Chun-Kuang Hu <chunkuang.hu@kernel.org>, 
	Philipp Zabel <p.zabel@pengutronix.de>, Matthias Brugger <matthias.bgg@gmail.com>, 
	AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, 
	Kevin Hilman <khilman@baylibre.com>, Jerome Brunet <jbrunet@baylibre.com>, 
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>, Rob Clark <robdclark@gmail.com>, 
	Abhinav Kumar <quic_abhinavk@quicinc.com>, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, 
	Sean Paul <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>, 
	Marek Vasut <marex@denx.de>, Stefan Agner <stefan@agner.ch>, Sam Ravnborg <sam@ravnborg.org>, 
	Jerry Han <hanxu5@huaqin.corp-partner.google.com>, Icenowy Zheng <icenowy@aosc.io>, 
	Ondrej Jirman <megi@xff.cz>, Javier Martinez Canillas <javierm@redhat.com>, =?UTF-8?Q?Guido_G=C3=BCnther?= <agx@sigxcpu.org>, 
	Purism Kernel Team <kernel@puri.sm>, Jianhua Lu <lujianhua000@gmail.com>, 
	Florian Fainelli <florian.fainelli@broadcom.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Artur Weber <aweber.kernel@gmail.com>, Tomeu Vizoso <tomeu.vizoso@collabora.com>, 
	Steven Price <steven.price@arm.com>, Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>, 
	Emma Anholt <emma@anholt.net>, Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>, 
	Sandy Huang <hjc@rock-chips.com>, Orson Zhai <orsonzhai@gmail.com>, 
	Baolin Wang <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>, 
	Alain Volmat <alain.volmat@foss.st.com>, Yannick Fertre <yannick.fertre@foss.st.com>, 
	Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>, 
	Philippe Cornu <philippe.cornu@foss.st.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, 
	Alexandre Torgue <alexandre.torgue@foss.st.com>, Chen-Yu Tsai <wens@csie.org>, 
	Samuel Holland <samuel@sholland.org>, Thierry Reding <thierry.reding@gmail.com>, 
	Mikko Perttunen <mperttunen@nvidia.com>, Jonathan Hunter <jonathanh@nvidia.com>, 
	Jyri Sarha <jyri.sarha@iki.fi>, Tomi Valkeinen <tomba@kernel.org>, 
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, devicetree@vger.kernel.org, 
	Ondrej Jirman <megous@megous.com>, dri-devel@lists.freedesktop.org, 
	linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, 
	etnaviv@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, 
	linux-mips@vger.kernel.org, lima@lists.freedesktop.org, 
	linux-mediatek@lists.infradead.org, linux-amlogic@lists.infradead.org, 
	linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
	linux-rpi-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, 
	linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, 
	linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, 
	xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Jul 17, 2023 at 4:27=E2=80=AFPM Rob Herring <robh@kernel.org> wrote=
:
>
> On Sun, Jul 16, 2023 at 3:26=E2=80=AFAM Heiko Stuebner <heiko@sntech.de> =
wrote:
> >
> > Am Freitag, 14. Juli 2023, 19:45:34 CEST schrieb Rob Herring:
> > > The DT of_device.h and of_platform.h date back to the separate
> > > of_platform_bus_type before it as merged into the regular platform bu=
s.
> > > As part of that merge prepping Arm DT support 13 years ago, they
> > > "temporarily" include each other. They also include platform_device.h
> > > and of.h. As a result, there's a pretty much random mix of those incl=
ude
> > > files used throughout the tree. In order to detangle these headers an=
d
> > > replace the implicit includes with struct declarations, users need to
> > > explicitly include the correct includes.
> > >
> > > Signed-off-by: Rob Herring <robh@kernel.org>
> > > ---
> >
> > [...]
> >
> > > diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/driver=
s/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> > > index 917e79951aac..2744d8f4a6fa 100644
> > > --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> > > +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> > > @@ -12,7 +12,9 @@
> > >  #include <linux/mfd/syscon.h>
> > >  #include <linux/module.h>
> > >  #include <linux/of_device.h>
> > > +#include <linux/of_platform.h>
> > >  #include <linux/phy/phy.h>
> > > +#include <linux/platform_device.h>
> > >  #include <linux/pm_runtime.h>
> > >  #include <linux/regmap.h>
> >
> > I'm not sure if I'm just misreading something, but in all other places
> > of_device.h gets removed while here is stays as an include. Is this
> > correct this way?
>
> Yes, because of_match_device() is used.
>
> Rob
>

For drivers/gpu/drm/bridge/

Acked-by: Robert Foss <rfoss@kernel.org>


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 16:00:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 16:00:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564721.882363 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQdu-0001QU-TI; Mon, 17 Jul 2023 16:00:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564721.882363; Mon, 17 Jul 2023 16:00:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQdu-0001QN-QI; Mon, 17 Jul 2023 16:00:10 +0000
Received: by outflank-mailman (input) for mailman id 564721;
 Mon, 17 Jul 2023 16:00:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=OuH4=DD=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qLQds-0001Q1-NT
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 16:00:08 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fea42a2c-24ba-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 18:00:06 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 37D2882866D1;
 Mon, 17 Jul 2023 11:00:04 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id v3nomEdnxO0X; Mon, 17 Jul 2023 11:00:03 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id DBFAE8285AF8;
 Mon, 17 Jul 2023 11:00:02 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id 6RfTliW6wtWj; Mon, 17 Jul 2023 11:00:02 -0500 (CDT)
Received: from [10.11.0.2] (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 8283A8285AF0;
 Mon, 17 Jul 2023 11:00:02 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fea42a2c-24ba-11ee-b23a-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com DBFAE8285AF8
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1689609602; bh=uTU8lD0bifweRhIffd7gxqa1k05FO2jioX6eJl/ozL8=;
	h=Message-ID:Date:MIME-Version:To:From;
	b=QCzWv1rRP6ySQK6tEtGzgjfhNUX/uAHiyyuBJjhtNYgPOE5dcNTWFEwLP+gyPYtH/
	 eveJf5pxv29d2hrNMIjBV5MKte6e38S2ThnOorZZ2q0tyH2G75LXbq5Nto0b4RLl+y
	 tTNnKC+LySIyrp4JxjeC2s4kcxr4OG/OW401A6rY=
X-Virus-Scanned: amavisd-new at rptsys.com
Message-ID: <dc64009d-53d5-6bd2-14ab-be2481523b0f@raptorengineering.com>
Date: Mon, 17 Jul 2023 11:00:01 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v3 1/3] xen/ppc: Set up a basic C environment
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1688670018.git.sanastasio@raptorengineering.com>
 <8c79f498ffcb0837ff18640dbaf5b66f79186574.1688670018.git.sanastasio@raptorengineering.com>
 <7f6feb8b-29fe-7a7f-8965-20a12b4dfb25@suse.com>
From: Shawn Anastasio <sanastasio@raptorengineering.com>
In-Reply-To: <7f6feb8b-29fe-7a7f-8965-20a12b4dfb25@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 7/17/23 10:38 AM, Jan Beulich wrote:
> On 06.07.2023 21:04, Shawn Anastasio wrote:
>> --- a/xen/arch/ppc/include/asm/config.h
>> +++ b/xen/arch/ppc/include/asm/config.h
>> @@ -43,7 +43,7 @@
>>  
>>  #define SMP_CACHE_BYTES (1 << 6)
>>  
>> -#define STACK_ORDER 2
>> +#define STACK_ORDER 0
>>  #define STACK_SIZE  (PAGE_SIZE << STACK_ORDER)
> 
> In which way is this related to the change at hand? Aren't you going to
> need to undo this rather sooner than later?

I noticed the stack order being too large when I moved the stack
declaration to .c per Andrew's recommendation for v2. Since we're using
64k pages, I don't see why the stack would need to be this big. A quick
look at ARM shows they have a stack order of 3, which would yield a
stack size of just 32k.

>> --- a/xen/arch/ppc/ppc64/head.S
>> +++ b/xen/arch/ppc/ppc64/head.S
>> @@ -1,30 +1,30 @@
>>  /* SPDX-License-Identifier: GPL-2.0-or-later */
>>  
>> +#include <asm/asm-defns.h>
>> +
>>      .section .text.header, "ax", %progbits
>>  
>>  ENTRY(start)
>>      /*
>> -     * Depending on how we were booted, the CPU could be running in either
>> -     * Little Endian or Big Endian mode. The following trampoline from Linux
>> -     * cleverly uses an instruction that encodes to a NOP if the CPU's
>> -     * endianness matches the assumption of the assembler (LE, in our case)
>> -     * or a branch to code that performs the endian switch in the other case.
>> +     * NOTE: argument registers (r3-r9) must be preserved until the C entrypoint
>>       */
>> -    tdi 0, 0, 0x48    /* Reverse endian of b . + 8          */
>> -    b . + 44          /* Skip trampoline if endian is good  */
>> -    .long 0xa600607d  /* mfmsr r11                          */
>> -    .long 0x01006b69  /* xori r11,r11,1                     */
>> -    .long 0x00004039  /* li r10,0                           */
>> -    .long 0x6401417d  /* mtmsrd r10,1                       */
>> -    .long 0x05009f42  /* bcl 20,31,$+4                      */
>> -    .long 0xa602487d  /* mflr r10                           */
>> -    .long 0x14004a39  /* addi r10,r10,20                    */
>> -    .long 0xa6035a7d  /* mtsrr0 r10                         */
>> -    .long 0xa6037b7d  /* mtsrr1 r11                         */
>> -    .long 0x2400004c  /* rfid                               */
>> -
>> -    /* Now that the endianness is confirmed, continue */
>> -1:  b 1b
>> +    FIXUP_ENDIAN
>> +
>> +    /* set up the TOC pointer */
>> +    LOAD_IMM32(%r2, .TOC.)
>> +
>> +    /* set up the initial stack */
>> +    LOAD_IMM32(%r1, cpu0_boot_stack)
> 
> Wouldn't this (and perhaps also .TOC.) better be calculated in a
> PC-relative manner? Or is the plan to have Xen linked to an address
> below 4Gb?

As mentioned previously, I am planning to enable the PIC code model in
my next series in order to accommodate booting on the PowerNV firmware
type which has a different load address. That patch will change the
initial TOC load to a simulated PC-relative one (pre-POWER10 doesn't
have proper PC-relative loads/stores) and the rest to TOC-relative.

>> +    li %r11, 0
>> +    stdu %r11, -STACK_FRAME_OVERHEAD(%r1)
>> +
>> +    /* call the C entrypoint */
>> +    bl start_xen
>> +
>> +    /* should never return */
>> +    trap
>>  
>>      .size start, . - start
>>      .type start, %function
>> +
>> +    .section .init.data, "aw", @progbits
> 
> What's this good for when no data follows?

Good catch. With the stack no longer declared in head.S this is
unnecessary. Will remove in v3.

>> --- /dev/null
>> +++ b/xen/arch/ppc/setup.c
>> @@ -0,0 +1,19 @@
>> +/* SPDX-License-Identifier: GPL-2.0-or-later */
>> +#include <xen/init.h>
>> +
>> +/* Xen stack for bringing up the first CPU. */
>> +unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZE);
> 
> This yields the entire array as zero-initialized. At which point I
> don't see a need for the store in head.S.

Okay, fair enough. Given that the array is zero-initialized the stdu
could be replaced with an `addi %r1, %r1, -STACK_FRAME_OVERHEAD`, and
the load of zero to %r11 could be deferred to the second patch in this
series where it's used in the .bss clearing loop.

That said I don't really see the harm with keeping the standard
idiomatic `stdu` for the initial stack frame setup. Other than
performance, which isn't a concern here in early setup code.

>> +/* Macro to adjust thread priority for hardware multithreading */
>> +#define HMT_very_low()  asm volatile (" or %r31, %r31, %r31 ")
> 
> Nit: Style. Wants to be
> 
> #define HMT_very_low()  asm volatile ( "or %r31, %r31, %r31" )

Will fix in v3.

> Jan

Thanks,
Shawn


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 16:03:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 16:03:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564733.882419 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQh7-00038N-EN; Mon, 17 Jul 2023 16:03:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564733.882419; Mon, 17 Jul 2023 16:03:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQh7-00037B-8D; Mon, 17 Jul 2023 16:03:29 +0000
Received: by outflank-mailman (input) for mailman id 564733;
 Mon, 17 Jul 2023 16:03:27 +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
 <SRS0=fcy7=DD=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qLQh5-0002Zo-Ih
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 16:03:27 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 764ff69d-24bb-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 18:03:25 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-5216569f9e3so4831001a12.0
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 09:03:25 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net
 (default-46-102-197-194.interdsl.co.uk. [46.102.197.194])
 by smtp.gmail.com with ESMTPSA id
 bo28-20020a0564020b3c00b0051df5bd1cd8sm10099050edb.65.2023.07.17.09.03.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 09:03:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 764ff69d-24bb-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689609805; x=1692201805;
        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=HhpWCn/ri7wmy6U70OoVzKYS333ZuYeUMZy4TaZcJGg=;
        b=LC8OXhHYu2epObgaJF1GN8yE+taRZmj2Deix//fzqFxnm4zzgTsSRxqKU35v6fbcaY
         Fo3dh22EUX1fPQx8YgXsJt8gWAY5OeKljz9zY2CL4yNl9ksag1Y0Q0Wy4rmZSqD07dSt
         OHNePmKyjiZElFKHZrs6C2QYd+1pzVU4Ppjjo=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689609805; x=1692201805;
        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=HhpWCn/ri7wmy6U70OoVzKYS333ZuYeUMZy4TaZcJGg=;
        b=dWAR5Hhju0ANpEtpW7+pxIjBSgcO24xiYdOa1+j/KjroscnrIWpD3J7VXbSzF889Qd
         neXSPIZZrJ2D+JWdttDqptH0e8cTwaCS8mWcMr/u+sSiqAJGz1KzvKqcUuZGjgUazosG
         40fvk1r3Cs8KBryJKh9DU9jmIagUYdNvWQ1EOnIOU4JWplTjfqM+WurlXlLSDdb0Fe6g
         puGHCkYSn5A9vmxDI6ne8/3QYGdtb88O3D+EncWIdYLGFBvhvlktGZDEh1FfJZoHYlrn
         VB/HvuCrXdZRYCHJhpsUspCnVyXdIdeO4zAD+CCdrQZKUs+PjTG064Id0YxD1iJHKMnM
         jhpg==
X-Gm-Message-State: ABy/qLY/mgRNmWM0A2KTZPakhNB2WXJyWDZweNRnGLb+q6GK6l8rXIAg
	9h8N7aAdTF61BMygIGS5HFuwchzlSwoZNugTIYg=
X-Google-Smtp-Source: APBJJlFnFUUmOQ+wqt6dusKepCAatkVsCd0yz8EvIbApX95MNtQnG6lkA4Vb2tobteJBuPe+BusbqA==
X-Received: by 2002:a05:6402:335:b0:51e:288d:2a27 with SMTP id q21-20020a056402033500b0051e288d2a27mr12091129edw.11.1689609805273;
        Mon, 17 Jul 2023 09:03:25 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH 6/8] mm/pdx: Standardize region validation wrt pdx compression
Date: Mon, 17 Jul 2023 17:03:16 +0100
Message-Id: <20230717160318.2113-7-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Regions must be occasionally validated for pdx compression validity. That
is, whether any of the machine addresses spanning the region have a bit set
in the pdx "hole" (which is expected to always contain zeroes). There are
a few such tests through the code, and they all check for different things.

This patch replaces all such occurences with a call to a centralized
function that checks a region for validity.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
 xen/arch/x86/x86_64/mm.c |  2 +-
 xen/common/efi/boot.c    |  6 +++---
 xen/common/pdx.c         | 13 +++++++++++--
 xen/include/xen/pdx.h    |  9 +++++++++
 4 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 60db439af3..914e65c26c 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -1168,7 +1168,7 @@ static int mem_hotadd_check(unsigned long spfn, unsigned long epfn)
     if ( (spfn | epfn) & ((1UL << PAGETABLE_ORDER) - 1) )
         return 0;
 
-    if ( (spfn | epfn) & pfn_hole_mask )
+    if ( !pdx_is_region_compressible(spfn, epfn) )
         return 0;
 
     /* Make sure the new range is not present now */
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 24169b7b50..b098a8c030 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -14,6 +14,7 @@
 #include <xen/multiboot.h>
 #include <xen/param.h>
 #include <xen/pci_regs.h>
+#include <xen/pdx.h>
 #include <xen/pfn.h>
 #if EFI_PAGE_SIZE != PAGE_SIZE
 # error Cannot use xen/pfn.h here!
@@ -1647,7 +1648,7 @@ static bool __init cf_check ram_range_valid(unsigned long smfn, unsigned long em
 {
     unsigned long sz = pfn_to_pdx(emfn - 1) / PDX_GROUP_COUNT + 1;
 
-    return !(smfn & pfn_hole_mask) &&
+    return pdx_is_region_compressible(smfn, emfn) &&
            find_next_bit(pdx_group_valid, sz,
                          pfn_to_pdx(smfn) / PDX_GROUP_COUNT) < sz;
 }
@@ -1759,8 +1760,7 @@ void __init efi_init_memory(void)
             prot |= _PAGE_NX;
 
         if ( pfn_to_pdx(emfn - 1) < (DIRECTMAP_SIZE >> PAGE_SHIFT) &&
-             !(smfn & pfn_hole_mask) &&
-             !((smfn ^ (emfn - 1)) & ~pfn_pdx_bottom_mask) )
+             pdx_is_region_compressible(smfn, emfn))
         {
             if ( (unsigned long)mfn_to_virt(emfn - 1) >= HYPERVISOR_VIRT_END )
                 prot &= ~_PAGE_GLOBAL;
diff --git a/xen/common/pdx.c b/xen/common/pdx.c
index 99d4a90a50..72845e4bab 100644
--- a/xen/common/pdx.c
+++ b/xen/common/pdx.c
@@ -88,7 +88,7 @@ bool __mfn_valid(unsigned long mfn)
 }
 
 /* Sets all bits from the most-significant 1-bit down to the LSB */
-static uint64_t __init fill_mask(uint64_t mask)
+static uint64_t fill_mask(uint64_t mask)
 {
     while (mask & (mask + 1))
         mask |= mask + 1;
@@ -96,6 +96,15 @@ static uint64_t __init fill_mask(uint64_t mask)
     return mask;
 }
 
+bool pdx_is_region_compressible(unsigned long smfn, unsigned long emfn)
+{
+    uint64_t base = smfn << PAGE_SHIFT;
+    uint64_t len = (emfn - smfn) << PAGE_SHIFT;
+
+    return !(smfn & pfn_hole_mask) &&
+           !(pdx_region_mask(base, len) & ~ma_va_bottom_mask);
+}
+
 /* We don't want to compress the low MAX_ORDER bits of the addresses. */
 uint64_t __init pdx_init_mask(uint64_t base_addr)
 {
@@ -103,7 +112,7 @@ uint64_t __init pdx_init_mask(uint64_t base_addr)
                          (uint64_t)1 << (MAX_ORDER + PAGE_SHIFT)) - 1);
 }
 
-uint64_t __init pdx_region_mask(uint64_t base, uint64_t len)
+uint64_t pdx_region_mask(uint64_t base, uint64_t len)
 {
     /*
      * We say a bit "moves" in a range if there exist 2 addresses in that
diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h
index f8ca0f5821..5378e664c2 100644
--- a/xen/include/xen/pdx.h
+++ b/xen/include/xen/pdx.h
@@ -77,6 +77,15 @@ extern unsigned long pfn_top_mask, ma_top_mask;
                          (sizeof(*frame_table) & -sizeof(*frame_table)))
 extern unsigned long pdx_group_valid[];
 
+/**
+ * Validate a region's compatibility with the current compression runtime
+ *
+ * @param smfn Start mfn
+ * @param emfn End mfn (non-inclusive)
+ * @return True iff the region can be used with the current compression
+ */
+bool pdx_is_region_compressible(unsigned long smfn, unsigned long emfn);
+
 /**
  * Calculates a mask covering "moving" bits of all addresses of a region
  *
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 16:03:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 16:03:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564732.882412 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQh7-00032l-3R; Mon, 17 Jul 2023 16:03:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564732.882412; Mon, 17 Jul 2023 16:03:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQh6-00030p-RD; Mon, 17 Jul 2023 16:03:28 +0000
Received: by outflank-mailman (input) for mailman id 564732;
 Mon, 17 Jul 2023 16:03:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=fcy7=DD=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qLQh5-00027B-4c
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 16:03:27 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 75f1a2cd-24bb-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 18:03:25 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-51e56749750so6312473a12.0
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 09:03:25 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net
 (default-46-102-197-194.interdsl.co.uk. [46.102.197.194])
 by smtp.gmail.com with ESMTPSA id
 bo28-20020a0564020b3c00b0051df5bd1cd8sm10099050edb.65.2023.07.17.09.03.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 09:03:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 75f1a2cd-24bb-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689609804; x=1692201804;
        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=EaOSzOKwnaNDbtFFGDCLrWszAMCEvLERpiHBsiwXmN8=;
        b=VvXSrWXjavQXI5yrEBMvKrTHVuE2itZE0f9oFhSLvAVAI1RTJGLVA3uqhxBzf3MMSh
         zTyK49m5celffRs4jobunADI5Kc3uv3YaHzbiP4iy9ONqjGDUNA2QMg69bXyvuq5wjl5
         3MYXJd4ATPjuKvZGXB/uxLoB04zVq8sxvM1l0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689609804; x=1692201804;
        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=EaOSzOKwnaNDbtFFGDCLrWszAMCEvLERpiHBsiwXmN8=;
        b=dAjb9EUzeNiNBZDLzdWNmgn7m776iSFuQt1W4/ANG5Y7cDJnc7MMEBHdGkwFwCkLo+
         h6qty6M6LhX+0eUqis74GlNhtN7UKC51JyV0qB7mCkN5xnOXYumwv2UBx5nfeIxGbV7Z
         aIwnY5k3We7LBYir2RDTFQu/PiGaRy998fgOKZnPGvZYb2IO1bAD4BN5y2cDHWovQGdN
         BzjViPuWxES8GI3p+XlFFdUGXyJobFyvgA2NdUnpSslQVarS5DdJ3XKRMh3rrCJniWdO
         oxEtSsmO3Tdb9pFLGzCA1sBPWECbYUW2yY7GlVJki2KEuoIXZ879VRhNlfQd4Fdkaa2m
         EZRQ==
X-Gm-Message-State: ABy/qLYFMYNfCPmq2Hojanoxe2gc4y1dXKDxeisgK+xiEFNRHrXqKGYR
	rlv5+jd38kd2qR6cXcEm7YxDyJETIvdh09JF+cs=
X-Google-Smtp-Source: APBJJlHxlHXDnujOKuyyvPzhR1A6cx4oXng80WRe0d6aM0pVJeTuzQusY90cvxRft80tFLU+BAPBZA==
X-Received: by 2002:a05:6402:8c2:b0:51d:ece5:afd9 with SMTP id d2-20020a05640208c200b0051dece5afd9mr12464346edz.21.1689609804717;
        Mon, 17 Jul 2023 09:03:24 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Wei Liu <wl@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH 5/8] mm: Factor out the pdx compression logic in ma/va converters
Date: Mon, 17 Jul 2023 17:03:15 +0100
Message-Id: <20230717160318.2113-6-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This patch factors out the pdx compression logic hardcoded in both ports
for the maddr<->vaddr conversion functions.

Touches both x86 and arm ports.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
 xen/arch/arm/include/asm/mm.h          |  3 +--
 xen/arch/x86/include/asm/x86_64/page.h | 28 +++++++++++---------------
 xen/include/xen/pdx.h                  | 25 +++++++++++++++++++++++
 3 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index 1a83f41879..78cb23858a 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -320,8 +320,7 @@ static inline void *maddr_to_virt(paddr_t ma)
            (DIRECTMAP_SIZE >> PAGE_SHIFT));
     return (void *)(XENHEAP_VIRT_START -
                     (directmap_base_pdx << PAGE_SHIFT) +
-                    ((ma & ma_va_bottom_mask) |
-                     ((ma & ma_top_mask) >> pfn_pdx_hole_shift)));
+                    maddr_to_directmapoff(ma));
 }
 #endif
 
diff --git a/xen/arch/x86/include/asm/x86_64/page.h b/xen/arch/x86/include/asm/x86_64/page.h
index 53faa7875b..b589c93e77 100644
--- a/xen/arch/x86/include/asm/x86_64/page.h
+++ b/xen/arch/x86/include/asm/x86_64/page.h
@@ -36,26 +36,22 @@ static inline unsigned long __virt_to_maddr(unsigned long va)
 {
     ASSERT(va < DIRECTMAP_VIRT_END);
     if ( va >= DIRECTMAP_VIRT_START )
-        va -= DIRECTMAP_VIRT_START;
-    else
-    {
-        BUILD_BUG_ON(XEN_VIRT_END - XEN_VIRT_START != GB(1));
-        /* Signed, so ((long)XEN_VIRT_START >> 30) fits in an imm32. */
-        ASSERT(((long)va >> (PAGE_ORDER_1G + PAGE_SHIFT)) ==
-               ((long)XEN_VIRT_START >> (PAGE_ORDER_1G + PAGE_SHIFT)));
-
-        va += xen_phys_start - XEN_VIRT_START;
-    }
-    return (va & ma_va_bottom_mask) |
-           ((va << pfn_pdx_hole_shift) & ma_top_mask);
+        return directmapoff_to_maddr(va - DIRECTMAP_VIRT_START);
+
+    BUILD_BUG_ON(XEN_VIRT_END - XEN_VIRT_START != GB(1));
+    /* Signed, so ((long)XEN_VIRT_START >> 30) fits in an imm32. */
+    ASSERT(((long)va >> (PAGE_ORDER_1G + PAGE_SHIFT)) ==
+           ((long)XEN_VIRT_START >> (PAGE_ORDER_1G + PAGE_SHIFT)));
+
+    return xen_phys_start + va - XEN_VIRT_START;
 }
 
 static inline void *__maddr_to_virt(unsigned long ma)
 {
-    ASSERT(pfn_to_pdx(ma >> PAGE_SHIFT) < (DIRECTMAP_SIZE >> PAGE_SHIFT));
-    return (void *)(DIRECTMAP_VIRT_START +
-                    ((ma & ma_va_bottom_mask) |
-                     ((ma & ma_top_mask) >> pfn_pdx_hole_shift)));
+    /* Offset in the direct map, accounting for pdx compression */
+    size_t va_offset = maddr_to_directmapoff(ma);
+    ASSERT(va_offset < DIRECTMAP_SIZE);
+    return (void *)(DIRECTMAP_VIRT_START + va_offset);
 }
 
 /* read access (should only be used for debug printk's) */
diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h
index 67ae20e89c..f8ca0f5821 100644
--- a/xen/include/xen/pdx.h
+++ b/xen/include/xen/pdx.h
@@ -158,6 +158,31 @@ static inline unsigned long pdx_to_pfn(unsigned long pdx)
 #define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
 #define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
 
+/**
+ * Computes the offset into the direct map of an maddr
+ *
+ * @param ma Machine address
+ * @return Offset on the direct map where that
+ *         machine address can be accessed
+ */
+static inline unsigned long maddr_to_directmapoff(uint64_t ma)
+{
+    return ((ma & ma_top_mask) >> pfn_pdx_hole_shift) |
+           (ma & ma_va_bottom_mask);
+}
+
+/**
+ * Computes a machine address given a direct map offset
+ *
+ * @param offset Offset into the direct map
+ * @return Corresponding machine address of that virtual location
+ */
+static inline uint64_t directmapoff_to_maddr(unsigned long offset)
+{
+    return ((offset << pfn_pdx_hole_shift) & ma_top_mask) |
+           (offset & ma_va_bottom_mask);
+}
+
 /**
  * Initializes global variables with information about the compressible
  * range of the current memory regions.
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 16:03:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 16:03:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564734.882429 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQh8-0003PN-7d; Mon, 17 Jul 2023 16:03:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564734.882429; Mon, 17 Jul 2023 16:03:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQh7-0003Lw-V7; Mon, 17 Jul 2023 16:03:29 +0000
Received: by outflank-mailman (input) for mailman id 564734;
 Mon, 17 Jul 2023 16:03:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=fcy7=DD=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qLQh6-00027B-4o
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 16:03:28 +0000
Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com
 [2a00:1450:4864:20::12d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 773057de-24bb-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 18:03:27 +0200 (CEST)
Received: by mail-lf1-x12d.google.com with SMTP id
 2adb3069b0e04-4fcd615d7d6so6903860e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 09:03:27 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net
 (default-46-102-197-194.interdsl.co.uk. [46.102.197.194])
 by smtp.gmail.com with ESMTPSA id
 bo28-20020a0564020b3c00b0051df5bd1cd8sm10099050edb.65.2023.07.17.09.03.26
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 09:03:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 773057de-24bb-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689609806; x=1692201806;
        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=7QGfkDVjG71aom9bAterc/1wKh4jZEIowYjFqXVaWh0=;
        b=J9UFqD4U6/+xFXgvL/eHS1K3ZsRFfObmThVd0Sx3haPrf1u/4zdURKFRc5ZJ9k+yI3
         YbgVQ52ZFPB0UzsfMDnMrO+RojCfSZFbkTfIoBA6QTHyKQ/aSMngs1hVScSzvRMxXnub
         bDv923akwd+wLhxzq2A0UDY7tLIKqbIPS/vwc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689609806; x=1692201806;
        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=7QGfkDVjG71aom9bAterc/1wKh4jZEIowYjFqXVaWh0=;
        b=W/FJiTum4ljF8alLQao5viIJ3dKu/DiVSdbzT4MxVsd1aJU3yBrM0ZRdBhiWlnci+1
         sTs8f+qa5HqbHXqdfKyyK+y5qHOSVhSNFq3S6GwhXjojSczi8hEkoSrD5hyRGn+SjGRr
         cBeH/X97cKiwPcLEhJ+6H7NE29WCQPPIq3Rsi4nWVjB2nUmc7krF4C/4mob4mGE0FKSu
         yRf9eIbrWzb4tSJhMGoNbPCel4UcYJd0FaKvOm9TlJNlKVaDKG3yvjQYWSiqokr8cTxP
         oKaZ2BmaxB9lfxEYOjm2QxzkUCsqRPS5hmKZ46zhf6IPsd7L0sKDNkvE3mgu/LdQIpGV
         Fi4g==
X-Gm-Message-State: ABy/qLa/BcmUYZ79Jc37Pq8Y+Grj3lLs7uvaX8rAzV+u0VLXsGvPD3HU
	wEvaNJJY4tZOWNlFi0aBapl3agKj29xUcZPKypw=
X-Google-Smtp-Source: APBJJlF5hBqYxBEdbU/CdUkMNf+ZWkqlphrHQ0PjL8lO0H04R4PCEvyaCbBP88krTvazp26SQzFivA==
X-Received: by 2002:a05:6512:2822:b0:4fc:dcff:773b with SMTP id cf34-20020a056512282200b004fcdcff773bmr12474057lfb.3.1689609806597;
        Mon, 17 Jul 2023 09:03:26 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH 8/8] pdx: Add CONFIG_HAS_PDX_COMPRESSION as a Kconfig option
Date: Mon, 17 Jul 2023 17:03:18 +0100
Message-Id: <20230717160318.2113-9-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds a new compile-time flag to allow disabling pdx compression and
compiles out compression-related code/data. It also shorts the pdx<->pfn
conversion macros and creates stubs for masking fucntions.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
 xen/arch/x86/domain.c | 19 +++++++++++++------
 xen/common/Kconfig    | 10 ++++++++++
 xen/common/pdx.c      | 15 +++++++++++----
 xen/include/xen/pdx.h | 34 ++++++++++++++++++++++++++++++++++
 4 files changed, 68 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 39c2153165..c818ccc4d5 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -458,7 +458,7 @@ void domain_cpu_policy_changed(struct domain *d)
     }
 }
 
-#ifndef CONFIG_BIGMEM
+#if !defined(CONFIG_BIGMEM) && defined(CONFIG_HAS_PDX_COMPRESSION)
 /*
  * The hole may be at or above the 44-bit boundary, so we need to determine
  * the total bit count until reaching 32 significant (not squashed out) bits
@@ -485,13 +485,20 @@ static unsigned int __init noinline _domain_struct_bits(void)
 struct domain *alloc_domain_struct(void)
 {
     struct domain *d;
-#ifdef CONFIG_BIGMEM
-    const unsigned int bits = 0;
-#else
+
     /*
-     * We pack the PDX of the domain structure into a 32-bit field within
-     * the page_info structure. Hence the MEMF_bits() restriction.
+     * Without CONFIG_BIGMEM, we pack the PDX of the domain structure into
+     * a 32-bit field within the page_info structure. Hence the MEMF_bits()
+     * restriction. With PDX compression in place the number of bits must
+     * be calculated at runtime, but it's fixed otherwise.
+     *
+     * On systems with CONFIG_BIGMEM there's no packing, and so there's no
+     * such restriction.
      */
+#if defined(CONFIG_BIGMEM) || !defined(CONFIG_HAS_PDX_COMPRESSION)
+    const unsigned int bits = IS_ENABLED(CONFIG_BIGMEM) ? 0 :
+                                                          32 + PAGE_SHIFT;
+#else
     static unsigned int __read_mostly bits;
 
     if ( unlikely(!bits) )
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 40ec63c4b2..6605a60ff7 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -23,6 +23,16 @@ config GRANT_TABLE
 
 	  If unsure, say Y.
 
+config HAS_PDX_COMPRESSION
+	bool "PDX (Page inDeX) compression support"
+	default ARM
+	help
+	  PDX compression is a technique that allows the hypervisor to
+	  represent physical addresses in a very space-efficient manner.
+	  This is very helpful reducing memory wastage in systems with
+	  memory banks with base addresses far from each other, but carrier
+	  a performance cost.
+
 config ALTERNATIVE_CALL
 	bool
 
diff --git a/xen/common/pdx.c b/xen/common/pdx.c
index cc963a3cb3..d0fac9d7c7 100644
--- a/xen/common/pdx.c
+++ b/xen/common/pdx.c
@@ -31,11 +31,15 @@ unsigned long __read_mostly pdx_group_valid[BITS_TO_LONGS(
 
 bool __mfn_valid(unsigned long mfn)
 {
-    if ( unlikely(evaluate_nospec(mfn >= max_page)) )
+    bool invalid = mfn >= max_page;
+#ifdef CONFIG_HAS_PDX_COMPRESSION
+    invalid |= mfn & pfn_hole_mask;
+#endif
+
+    if ( unlikely(evaluate_nospec(invalid)) )
         return false;
-    return likely(!(mfn & pfn_hole_mask)) &&
-           likely(test_bit(pfn_to_pdx(mfn) / PDX_GROUP_COUNT,
-                           pdx_group_valid));
+
+    return test_bit(pfn_to_pdx(mfn) / PDX_GROUP_COUNT, pdx_group_valid);
 }
 
 void set_pdx_range(unsigned long smfn, unsigned long emfn)
@@ -49,6 +53,8 @@ void set_pdx_range(unsigned long smfn, unsigned long emfn)
         __set_bit(idx, pdx_group_valid);
 }
 
+#ifdef CONFIG_HAS_PDX_COMPRESSION
+
 /*
  * Diagram to make sense of the following variables. The masks and shifts
  * are done on mfn values in order to convert to/from pdx:
@@ -178,6 +184,7 @@ void __init pfn_pdx_hole_setup(unsigned long mask)
     pfn_top_mask        = ~(pfn_pdx_bottom_mask | pfn_hole_mask);
     ma_top_mask         = pfn_top_mask << PAGE_SHIFT;
 }
+#endif /* CONFIG_HAS_PDX_COMPRESSION */
 
 
 /*
diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h
index ce27177b56..5531890d1c 100644
--- a/xen/include/xen/pdx.h
+++ b/xen/include/xen/pdx.h
@@ -98,6 +98,8 @@ bool __mfn_valid(unsigned long mfn);
 #define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
 #define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
 
+#ifdef CONFIG_HAS_PDX_COMPRESSION
+
 extern unsigned long pfn_pdx_bottom_mask, ma_va_bottom_mask;
 extern unsigned int pfn_pdx_hole_shift;
 extern unsigned long pfn_hole_mask;
@@ -225,7 +227,39 @@ static inline uint64_t directmapoff_to_maddr(unsigned long offset)
  *             position marks a potentially compressible bit.
  */
 void pfn_pdx_hole_setup(unsigned long mask);
+#else /* CONFIG_HAS_PDX_COMPRESSION */
+
+/* Without PDX compression we can skip some computations */
+
+/* pdx<->pfn == identity */
+#define pdx_to_pfn(x) (x)
+#define pfn_to_pdx(x) (x)
+
+/* directmap is indexed by by maddr */
+#define maddr_to_directmapoff(x) (x)
+#define directmapoff_to_maddr(x) (x)
+
+static inline bool pdx_is_region_compressible(unsigned long smfn,
+                                              unsigned long emfn)
+{
+    return true;
+}
+
+static inline uint64_t pdx_init_mask(uint64_t base_addr)
+{
+    return 0;
+}
+
+static inline uint64_t pdx_region_mask(uint64_t base, uint64_t len)
+{
+    return 0;
+}
+
+static inline void pfn_pdx_hole_setup(unsigned long mask)
+{
+}
 
+#endif /* CONFIG_HAS_PDX_COMPRESSION */
 #endif /* __XEN_PDX_H__ */
 
 /*
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 16:03:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 16:03:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564727.882374 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQh2-00028W-Dq; Mon, 17 Jul 2023 16:03:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564727.882374; Mon, 17 Jul 2023 16:03:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQh2-00028O-8v; Mon, 17 Jul 2023 16:03:24 +0000
Received: by outflank-mailman (input) for mailman id 564727;
 Mon, 17 Jul 2023 16:03:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=fcy7=DD=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qLQh1-00027B-3e
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 16:03:23 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 743676f2-24bb-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 18:03:22 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-51bece5d935so6718380a12.1
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 09:03:22 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net
 (default-46-102-197-194.interdsl.co.uk. [46.102.197.194])
 by smtp.gmail.com with ESMTPSA id
 bo28-20020a0564020b3c00b0051df5bd1cd8sm10099050edb.65.2023.07.17.09.03.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 09:03:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 743676f2-24bb-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689609802; x=1692201802;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=To9L4rpbWvu0aRYnNzcVhBGhI7VK7vgBTkVqxpmKYmw=;
        b=K/hSzCf4hIlZpf3r+4F6dG6oFM55W7NG1aIMlJIv7MV/h1/NYLLwcByEK6/dNPJWs+
         A2GTmaai4tuY0qA//bFSQePeK9rhRXV2kWaldtIwFQ/6mVeUw6ahKpt7U0N24gZFn3OW
         2QdVE/lm+Y304a7/+dl89Hd3zSO///BsGXBl0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689609802; x=1692201802;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=To9L4rpbWvu0aRYnNzcVhBGhI7VK7vgBTkVqxpmKYmw=;
        b=RzwZ+O1K+mDVb55ZeltCNF3s6QrCxECJ6ZhhMnBu7y70nbjJ4np2ClBuC8R7JyVKS/
         PrpOUAvexv+IcDcw5AZibJtHp5v6Z1dPc0YDcR86tNT9AyBB0eb/SeixaWeIEJmrtUgn
         g4ED7+dxdeAXg8xuTI8zPwjowHvVGeazUKjBhXKZ2r+R/BJA9iw3wBWZULf63UuboE1K
         GkIobf8Zb+PxvOhqIE3shOtIPL4MraH2TPeSisaVWicifdp7gbIoeXBZZA0IgXyJMw0M
         I0si0oO7R/gBhG2mHWjWO3C7W80hrcurO4WMoOZnP6pFYTAeggnrZDo4+LOmLsjZhNMv
         JfKw==
X-Gm-Message-State: ABy/qLbXIcboSNDnBb3qCIBleSVHljXfTh3DqXHF72xIzBTWncILU8oD
	6alAPesXioBYWfSm6PfKBYWdIHPMo2scOGsvocg=
X-Google-Smtp-Source: APBJJlGeLACk9RQWJyLIcChGa01ydrn8+ODAdtstcXaohJ2FGMttmM0HwFg8pRybA33B7sZhJtKcuw==
X-Received: by 2002:aa7:ca56:0:b0:521:788f:66ff with SMTP id j22-20020aa7ca56000000b00521788f66ffmr6579861edt.23.1689609801700;
        Mon, 17 Jul 2023 09:03:21 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH 0/8] Make PDX compression optional
Date: Mon, 17 Jul 2023 17:03:10 +0100
Message-Id: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Currently there's a CONFIG_HAS_PDX Kconfig option, but it's impossible to
disable it because the whole codebase performs unconditional
compression/decompression operations on addresses. This has the
unfortunate side effect that systems without a need for compression still
have to pay the performance impact of juggling bits on every pfn<->pdx
conversion (this requires reading several global variables). This series
attempts to:

  * Leave the state of pdx and pdx compression documented
  * Factor out compression so it _can_ be removed through Kconfig
  * Make it so compression is disabled on x86 and enabled on both Aarch32
    and Aarch64 by default.

Series summary:

Patch 1 documents the current general understanding of the pdx concept and
        pdx compression in particular
Patch 2 makes a clarification in ARM code to explain some discrepancies
        between the concept of "directmap" in arm32 and arm64 relevant to
        this series (i.e: why this series doesn't touch arm32 in directmap
        accesses).
Patch 3 Marks the pdx compression globals as ro_after_init
Patch 4 Gets rid of the current CONFIG_HAS_PDX option because (a) the name
        is misleading (b) cannot be removed in its current form.
Patch 5 Moves hard-coded compression-related logic to helper functions
Patch 6 Refactors all instances of regions being validated for pdx
        compression conformance so it's done through a helper
Patch 7 Non-functional reorder in order to simplify the patch 8 diff
Patch 8 Adds new Kconfig option to compile out PDX compression

Alejandro Vallejo (8):
  mm/pdx: Add comments throughout the codebase for pdx
  arm/mm: Document the differences between arm32 and arm64 directmaps
  pdx: Mark pdx hole description globals readonly after boot
  build: Remove CONFIG_HAS_PDX
  mm: Factor out the pdx compression logic in ma/va converters
  mm/pdx: Standardize region validation wrt pdx compression
  pdx: Reorder pdx.[ch]
  pdx: Add CONFIG_HAS_PDX_COMPRESSION as a Kconfig option

 xen/arch/arm/Kconfig                   |   1 -
 xen/arch/arm/include/asm/mm.h          |  30 ++-
 xen/arch/x86/Kconfig                   |   1 -
 xen/arch/x86/domain.c                  |  19 +-
 xen/arch/x86/include/asm/x86_64/page.h |  28 ++-
 xen/arch/x86/x86_64/mm.c               |   2 +-
 xen/common/Kconfig                     |  13 +-
 xen/common/Makefile                    |   2 +-
 xen/common/efi/boot.c                  |   6 +-
 xen/common/pdx.c                       | 120 +++++++++---
 xen/include/xen/mm.h                   |  11 ++
 xen/include/xen/pdx.h                  | 241 +++++++++++++++++++++++--
 12 files changed, 405 insertions(+), 69 deletions(-)

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 16:03:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 16:03:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564728.882383 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQh3-0002NQ-Kh; Mon, 17 Jul 2023 16:03:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564728.882383; Mon, 17 Jul 2023 16:03:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQh3-0002NJ-Gk; Mon, 17 Jul 2023 16:03:25 +0000
Received: by outflank-mailman (input) for mailman id 564728;
 Mon, 17 Jul 2023 16:03:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=fcy7=DD=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qLQh2-00027B-3i
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 16:03:24 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 74e3c3c0-24bb-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 18:03:23 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-51e28b299adso6556664a12.2
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 09:03:23 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net
 (default-46-102-197-194.interdsl.co.uk. [46.102.197.194])
 by smtp.gmail.com with ESMTPSA id
 bo28-20020a0564020b3c00b0051df5bd1cd8sm10099050edb.65.2023.07.17.09.03.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 09:03:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 74e3c3c0-24bb-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689609803; x=1692201803;
        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=8akak382Pvkzk8smYZShsg8P//0dNcL1l5JC56gewGo=;
        b=aBkBGRY5kmrQNcoLDo1E1l5XfJc7Yybzdet93GHz0y0BV+O9N+Y4ug/Xpz3GXRAVVM
         qql+KrY9+5VhMJKMtzGPgLdCcJqqMzyRZHAMbtiqqxkBe4W7XaSOYuYIYUh0fAlWcRzG
         qMT5/f0naP6oGbd9ebD9X09zH4hmI+ct9w+4I=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689609803; x=1692201803;
        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=8akak382Pvkzk8smYZShsg8P//0dNcL1l5JC56gewGo=;
        b=g9afuXjSlhHeEDbo9hG5tdU0pr0uv9WE1fv5gaPRIEf5HVeUEIF7dLgBeCLP/7id2S
         8bjatQkkXQRg1l3YeekrTvN0oDQyWzknwEBxvfhnsKH+MXUnrKUrWSJDPJIpfKgu28V+
         VysXmrVPdVznn1hIB1Utmz1cRtRdt8JOkaIie8jlXwZGHWVRnTF9X82W4Jw3o+TAe225
         m07iWVo/dzTIhT27QJHOsp7R2z8Sn9pI2STC5YgjhMAxchFHw/BR0RCkg1JrchUCJhR8
         3up2WbzrJA3m6lTifNdKjcgNdJNU+rSXmmFb2h2aJqZYBmUIGIxd8wZVQFoXkInwAuMt
         DrOQ==
X-Gm-Message-State: ABy/qLa8V1CwbtjYejjzD3hfH3URO+wNdwwk6KB7weH4nRAuaDl9/IZ1
	mfCdAfYPNuJUW4tMwRckc/SnRnDMhM/F/Ts8fZ8=
X-Google-Smtp-Source: APBJJlFXq+YuZi7U2G9yLDx7wuxCaHoDw+Wc30wPyNw4rp1n8ZvEtJGZgBqr3VCUNh5wuoEqCh5dfA==
X-Received: by 2002:aa7:cd16:0:b0:51b:c714:a2a1 with SMTP id b22-20020aa7cd16000000b0051bc714a2a1mr11744396edw.7.1689609802826;
        Mon, 17 Jul 2023 09:03:22 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH 2/8] arm/mm: Document the differences between arm32 and arm64 directmaps
Date: Mon, 17 Jul 2023 17:03:12 +0100
Message-Id: <20230717160318.2113-3-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

arm32 merely covers the XENHEAP, whereas arm64 currently covers anything in
the frame table. These comments highlight why arm32 doesn't need to account for PDX
compression in its __va() implementation while arm64 does.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
 xen/arch/arm/include/asm/mm.h | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index 4262165ce2..1a83f41879 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -280,6 +280,19 @@ static inline paddr_t __virt_to_maddr(vaddr_t va)
 #define virt_to_maddr(va)   __virt_to_maddr((vaddr_t)(va))
 
 #ifdef CONFIG_ARM_32
+/**
+ * Find the virtual address corresponding to a machine address
+ *
+ * Only memory backing the XENHEAP has a corresponding virtual address to
+ * be found. This is so we can save precious virtual space, as it's in
+ * short supply on arm32. This mapping is not subject to PDX compression
+ * because XENHEAP is known to be physically contiguous and can't hence
+ * jump over the PDX hole. This means we can avoid the roundtrips
+ * converting to/from pdx.
+ *
+ * @param ma Machine address
+ * @return Virtual address mapped to `ma`
+ */
 static inline void *maddr_to_virt(paddr_t ma)
 {
     ASSERT(is_xen_heap_mfn(maddr_to_mfn(ma)));
@@ -287,6 +300,20 @@ static inline void *maddr_to_virt(paddr_t ma)
     return (void *)(unsigned long) ma + XENHEAP_VIRT_START;
 }
 #else
+/**
+ * Find the virtual address corresponding to a machine address
+ *
+ * The directmap covers all conventional memory accesible by the
+ * hypervisor. This means it's subject to PDX compression.
+ *
+ * More specifically to arm64, the directmap mappings start at the first
+ * GiB boundary containing valid RAM. This means there's an extra offset
+ * applied (directmap_base_pdx) on top of the regular PDX compression
+ * logic.
+ *
+ * @param ma Machine address
+ * @return Virtual address mapped to `ma`
+ */
 static inline void *maddr_to_virt(paddr_t ma)
 {
     ASSERT((mfn_to_pdx(maddr_to_mfn(ma)) - directmap_base_pdx) <
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 16:03:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 16:03:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564735.882433 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQh8-0003US-LY; Mon, 17 Jul 2023 16:03:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564735.882433; Mon, 17 Jul 2023 16:03:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQh8-0003Sr-Ap; Mon, 17 Jul 2023 16:03:30 +0000
Received: by outflank-mailman (input) for mailman id 564735;
 Mon, 17 Jul 2023 16:03:28 +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
 <SRS0=fcy7=DD=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qLQh6-0002Zo-B9
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 16:03:28 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 76c48538-24bb-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 18:03:26 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-4fba74870abso7440332e87.0
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 09:03:26 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net
 (default-46-102-197-194.interdsl.co.uk. [46.102.197.194])
 by smtp.gmail.com with ESMTPSA id
 bo28-20020a0564020b3c00b0051df5bd1cd8sm10099050edb.65.2023.07.17.09.03.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 09:03:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 76c48538-24bb-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689609806; x=1692201806;
        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=UgGX9V3xdVqjoBF9z1oNCiSxRVEcUKRWlOAV3af9M+4=;
        b=BNbG3GmEohiD+wkcErA+NgY75lkbwVbS38Sr2VrBTPEoBpQzxWm2irAT5/NNR58loy
         VVWQyPj/JrHX6BVI4DDkeX39jDBSk8Xm5uew71HUJi8cNb09gjRwGnzvSaJV66BSYtsm
         K0TUkLCyM6roQlTDVMYddaI90/ailSkcp5ouU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689609806; x=1692201806;
        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=UgGX9V3xdVqjoBF9z1oNCiSxRVEcUKRWlOAV3af9M+4=;
        b=Zl3p13GSvqSMARnDjBv+FkRr8kEjCSFOD29gQhA5Ah4vrkJGwsKjMicHdhJDxQk7HQ
         FBEIghyYHO2XIaVv9VXNt0FqKLcMT0a5LMrM4U0Cry2a+LkENJLHttL99dFht7gXskyB
         Xkdu0RzH6uqTpGOcvDQrd9vBExWQSEPCr+aILVUNlvLdM0jC96YH6lUhF3B6I6qJOUFH
         sMkhUZpDHStz4VwX6fumoaVIbLGcoFHfbztdb9bZA2JL5+DtUar2qnL9IdpXFcAfqEOp
         1SL3oCgImdh3LpG9ydFZGH6snTK9/X6QfY0TsNBB6EbzOndh5apKhf7vIhJ5Dg0JXx+Z
         BXMg==
X-Gm-Message-State: ABy/qLYaj8EbemCz/smQ1BjA9PT79cBOAE9X0G3BKztE7oF4Xm5nPcPU
	KEhZvXKq+IKnEXp/UTDzUWSymqC1U4JU0YeJnek=
X-Google-Smtp-Source: APBJJlFJxGwk4jlCMhmmUrOdLTtWrCITKqaYX+v7ey5mw1dcyCM/XhITGM6eD6gFd8eNs+sa/JQ8sQ==
X-Received: by 2002:a05:6512:711:b0:4fb:751a:98d5 with SMTP id b17-20020a056512071100b004fb751a98d5mr7144788lfs.18.1689609805885;
        Mon, 17 Jul 2023 09:03:25 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [PATCH 7/8] pdx: Reorder pdx.[ch]
Date: Mon, 17 Jul 2023 17:03:17 +0100
Message-Id: <20230717160318.2113-8-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The next patch compiles out compression-related chunks, and it's helpful to
have them grouped together beforehand.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
 xen/common/pdx.c      | 58 +++++++++++++++++++++----------------------
 xen/include/xen/pdx.h | 37 +++++++++++++++++++++------
 2 files changed, 59 insertions(+), 36 deletions(-)

diff --git a/xen/common/pdx.c b/xen/common/pdx.c
index 72845e4bab..cc963a3cb3 100644
--- a/xen/common/pdx.c
+++ b/xen/common/pdx.c
@@ -20,6 +20,35 @@
 #include <xen/bitops.h>
 #include <xen/nospec.h>
 
+/**
+ * Maximum (non-inclusive) usable pdx. Must be
+ * modifiable after init due to memory hotplug
+ */
+unsigned long __read_mostly max_pdx;
+
+unsigned long __read_mostly pdx_group_valid[BITS_TO_LONGS(
+    (FRAMETABLE_NR + PDX_GROUP_COUNT - 1) / PDX_GROUP_COUNT)] = { [0] = 1 };
+
+bool __mfn_valid(unsigned long mfn)
+{
+    if ( unlikely(evaluate_nospec(mfn >= max_page)) )
+        return false;
+    return likely(!(mfn & pfn_hole_mask)) &&
+           likely(test_bit(pfn_to_pdx(mfn) / PDX_GROUP_COUNT,
+                           pdx_group_valid));
+}
+
+void set_pdx_range(unsigned long smfn, unsigned long emfn)
+{
+    unsigned long idx, eidx;
+
+    idx = pfn_to_pdx(smfn) / PDX_GROUP_COUNT;
+    eidx = (pfn_to_pdx(emfn - 1) + PDX_GROUP_COUNT) / PDX_GROUP_COUNT;
+
+    for ( ; idx < eidx; ++idx )
+        __set_bit(idx, pdx_group_valid);
+}
+
 /*
  * Diagram to make sense of the following variables. The masks and shifts
  * are done on mfn values in order to convert to/from pdx:
@@ -47,12 +76,6 @@
  * ones.
  */
 
-/**
- * Maximum (non-inclusive) usable pdx. Must be
- * modifiable after init due to memory hotplug
- */
-unsigned long __read_mostly max_pdx;
-
 /** Mask for the lower non-compressible bits of an mfn */
 unsigned long __ro_after_init pfn_pdx_bottom_mask = ~0UL;
 
@@ -75,18 +98,6 @@ unsigned long __ro_after_init pfn_hole_mask = 0;
 /** Number of bits of the "compressible" bit slice of an mfn */
 unsigned int __ro_after_init pfn_pdx_hole_shift = 0;
 
-unsigned long __read_mostly pdx_group_valid[BITS_TO_LONGS(
-    (FRAMETABLE_NR + PDX_GROUP_COUNT - 1) / PDX_GROUP_COUNT)] = { [0] = 1 };
-
-bool __mfn_valid(unsigned long mfn)
-{
-    if ( unlikely(evaluate_nospec(mfn >= max_page)) )
-        return false;
-    return likely(!(mfn & pfn_hole_mask)) &&
-           likely(test_bit(pfn_to_pdx(mfn) / PDX_GROUP_COUNT,
-                           pdx_group_valid));
-}
-
 /* Sets all bits from the most-significant 1-bit down to the LSB */
 static uint64_t fill_mask(uint64_t mask)
 {
@@ -127,17 +138,6 @@ uint64_t pdx_region_mask(uint64_t base, uint64_t len)
     return fill_mask(base ^ (base + len - 1));
 }
 
-void set_pdx_range(unsigned long smfn, unsigned long emfn)
-{
-    unsigned long idx, eidx;
-
-    idx = pfn_to_pdx(smfn) / PDX_GROUP_COUNT;
-    eidx = (pfn_to_pdx(emfn - 1) + PDX_GROUP_COUNT) / PDX_GROUP_COUNT;
-
-    for ( ; idx < eidx; ++idx )
-        __set_bit(idx, pdx_group_valid);
-}
-
 void __init pfn_pdx_hole_setup(unsigned long mask)
 {
     unsigned int i, j, bottom_shift = 0, hole_shift = 0;
diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h
index 5378e664c2..ce27177b56 100644
--- a/xen/include/xen/pdx.h
+++ b/xen/include/xen/pdx.h
@@ -68,15 +68,41 @@
  */
 
 extern unsigned long max_pdx;
-extern unsigned long pfn_pdx_bottom_mask, ma_va_bottom_mask;
-extern unsigned int pfn_pdx_hole_shift;
-extern unsigned long pfn_hole_mask;
-extern unsigned long pfn_top_mask, ma_top_mask;
 
 #define PDX_GROUP_COUNT ((1 << PDX_GROUP_SHIFT) / \
                          (sizeof(*frame_table) & -sizeof(*frame_table)))
 extern unsigned long pdx_group_valid[];
 
+/**
+ * Mark [smfn, emfn) as allocatable in the frame table
+ *
+ * @param smfn Start mfn
+ * @param emfn End mfn
+ */
+void set_pdx_range(unsigned long smfn, unsigned long emfn);
+
+/**
+ * Invoked to determine if an mfn has an associated valid frame table entry
+ *
+ * In order for it to be legal it must pass bounds, grouping and
+ * compression sanity checks.
+ *
+ * @param mfn To-be-checked mfn
+ * @return True iff all checks pass
+ */
+bool __mfn_valid(unsigned long mfn);
+
+#define page_to_pdx(pg)  ((pg) - frame_table)
+#define pdx_to_page(pdx) gcc11_wrap(frame_table + (pdx))
+
+#define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
+#define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
+
+extern unsigned long pfn_pdx_bottom_mask, ma_va_bottom_mask;
+extern unsigned int pfn_pdx_hole_shift;
+extern unsigned long pfn_hole_mask;
+extern unsigned long pfn_top_mask, ma_top_mask;
+
 /**
  * Validate a region's compatibility with the current compression runtime
  *
@@ -164,9 +190,6 @@ static inline unsigned long pdx_to_pfn(unsigned long pdx)
            ((pdx << pfn_pdx_hole_shift) & pfn_top_mask);
 }
 
-#define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
-#define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
-
 /**
  * Computes the offset into the direct map of an maddr
  *
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 16:03:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 16:03:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564729.882393 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQh4-0002co-Qo; Mon, 17 Jul 2023 16:03:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564729.882393; Mon, 17 Jul 2023 16:03:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQh4-0002ca-Nd; Mon, 17 Jul 2023 16:03:26 +0000
Received: by outflank-mailman (input) for mailman id 564729;
 Mon, 17 Jul 2023 16:03:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=fcy7=DD=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qLQh3-00027B-41
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 16:03:25 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 74ad8102-24bb-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 18:03:23 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-52176fdad9dso3906486a12.0
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 09:03:23 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net
 (default-46-102-197-194.interdsl.co.uk. [46.102.197.194])
 by smtp.gmail.com with ESMTPSA id
 bo28-20020a0564020b3c00b0051df5bd1cd8sm10099050edb.65.2023.07.17.09.03.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 09:03:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 74ad8102-24bb-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689609802; x=1692201802;
        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=BW+fp2cFFWVe/TGuiikouZekFdJrXU/1zeYhc/QEe/k=;
        b=bXNCVYC4zG2I77SeoN40sQkO3gZHN++CNGlR10/+7GAJV/JWL4E/DBSiQwn2xLXqz2
         S+0zh8ADYioSbPkvErW8rtDhLY3i3iotarf0Lb+ivTtBmpBFZUZXA6RAS2KCl+DF7+vE
         7o39ish/VPGMWkTfCEOEqi2/0gm/g7jtpzBi4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689609802; x=1692201802;
        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=BW+fp2cFFWVe/TGuiikouZekFdJrXU/1zeYhc/QEe/k=;
        b=girtGy7x32kAS9menGf39NpLZqJT7CWGDq2ap10ngR57xKuq7E50UP9pTqT3SsC/cj
         xKCEoxhM6OwEw4/4r34QKd/24FO8Wq9Vqj5EtJQCvfpAmy7otVMEyo8xHeB5UALasN2c
         +3PcN6iwr3F8BdLw2ju0P6N8fMEJoB330U0CYrxRJbpZG3fDgYAyQD5rvvEZ0DJCzhwh
         FPSmRWdVKAZjbpZM+umm0JX4vdOHjwGy0K9Skou4qeb+8fWRrT1u8edQrw7bHiwg7ZyN
         s7KCvcq1LYmfl5bu+oQEsHeD9UxIZMqu97iC4vB5EZyk/cz7TxdgPFWyi9UB4+3Lep7j
         v8Ew==
X-Gm-Message-State: ABy/qLY6YoEeTtTrlq3NUSIRRFNB3gmDHtgQsKa7+/UCDLiGoIvoO51S
	g501gvG0xf+AI8bDD1R+mL8pUj2lTcWKCk0YO38=
X-Google-Smtp-Source: APBJJlEx2LPDE6+tT77cmeCuRYNMOmeajBP0fDfUkbbY3LwD4Pi0hrl0Jv0rdvL7OZnWkG8c3fqWPA==
X-Received: by 2002:aa7:d991:0:b0:51e:253e:1e0c with SMTP id u17-20020aa7d991000000b0051e253e1e0cmr182713eds.25.1689609802321;
        Mon, 17 Jul 2023 09:03:22 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [PATCH 1/8] mm/pdx: Add comments throughout the codebase for pdx
Date: Mon, 17 Jul 2023 17:03:11 +0100
Message-Id: <20230717160318.2113-2-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Document the behaviour of the pdx machinery in Xen. Some logic is fairly
opaque and hard to follow without it being documented anywhere. This
explains the rationale behind compression and its relationship to
frametable indexing and directmap management.

While modifying the file:
  * Convert u64 -> uint64_t
  * Remove extern keyword from function prototypes

No functional change.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
This would've been v4 of the previously standalone patch:

v4:
  * Adds 2 "may"s to mm.h as requested
---
 xen/common/pdx.c      |  59 +++++++++++++++++-
 xen/include/xen/mm.h  |  11 ++++
 xen/include/xen/pdx.h | 139 ++++++++++++++++++++++++++++++++++++++++--
 3 files changed, 202 insertions(+), 7 deletions(-)

diff --git a/xen/common/pdx.c b/xen/common/pdx.c
index c91875fabe..ec64d3d2ef 100644
--- a/xen/common/pdx.c
+++ b/xen/common/pdx.c
@@ -20,13 +20,56 @@
 #include <xen/bitops.h>
 #include <xen/nospec.h>
 
-/* Parameters for PFN/MADDR compression. */
+/*
+ * Diagram to make sense of the following variables. The masks and shifts
+ * are done on mfn values in order to convert to/from pdx:
+ *
+ *                      pfn_hole_mask
+ *                      pfn_pdx_hole_shift (mask bitsize)
+ *                      |
+ *                 |---------|
+ *                 |         |
+ *                 V         V
+ *         --------------------------
+ *         |HHHHHHH|000000000|LLLLLL| <--- mfn
+ *         --------------------------
+ *         ^       ^         ^      ^
+ *         |       |         |------|
+ *         |       |             |
+ *         |       |             pfn_pdx_bottom_mask
+ *         |       |
+ *         |-------|
+ *             |
+ *             pfn_top_mask
+ *
+ * ma_{top,va_bottom}_mask is simply a shifted pfn_{top,pdx_bottom}_mask,
+ * where ma_top_mask has zeroes shifted in while ma_va_bottom_mask has
+ * ones.
+ */
+
+/** Maximum (non-inclusive) usable pdx */
 unsigned long __read_mostly max_pdx;
+
+/** Mask for the lower non-compressible bits of an mfn */
 unsigned long __read_mostly pfn_pdx_bottom_mask = ~0UL;
+
+/** Mask for the lower non-compressible bits of an maddr or vaddr */
 unsigned long __read_mostly ma_va_bottom_mask = ~0UL;
+
+/** Mask for the higher non-compressible bits of an mfn */
 unsigned long __read_mostly pfn_top_mask = 0;
+
+/** Mask for the higher non-compressible bits of an maddr or vaddr */
 unsigned long __read_mostly ma_top_mask = 0;
+
+/**
+ * Mask for a pdx compression bit slice.
+ *
+ *  Invariant: valid(mfn) implies (mfn & pfn_hole_mask) == 0
+ */
 unsigned long __read_mostly pfn_hole_mask = 0;
+
+/** Number of bits of the "compressible" bit slice of an mfn */
 unsigned int __read_mostly pfn_pdx_hole_shift = 0;
 
 unsigned long __read_mostly pdx_group_valid[BITS_TO_LONGS(
@@ -42,7 +85,7 @@ bool __mfn_valid(unsigned long mfn)
 }
 
 /* Sets all bits from the most-significant 1-bit down to the LSB */
-static u64 __init fill_mask(u64 mask)
+static uint64_t __init fill_mask(uint64_t mask)
 {
     while (mask & (mask + 1))
         mask |= mask + 1;
@@ -57,8 +100,18 @@ uint64_t __init pdx_init_mask(uint64_t base_addr)
                          (uint64_t)1 << (MAX_ORDER + PAGE_SHIFT)) - 1);
 }
 
-u64 __init pdx_region_mask(u64 base, u64 len)
+uint64_t __init pdx_region_mask(uint64_t base, uint64_t len)
 {
+    /*
+     * We say a bit "moves" in a range if there exist 2 addresses in that
+     * range that have that bit both set and cleared respectively. We want
+     * to create a mask of _all_ moving bits in this range. We do this by
+     * comparing the first and last addresses in the range, discarding the
+     * bits that remain the same (this is logically an XOR operation). The
+     * MSB of the resulting expression is the most significant moving bit
+     * in the range. Then it's a matter of setting every bit in lower
+     * positions in order to get the mask of moving bits.
+     */
     return fill_mask(base ^ (base + len - 1));
 }
 
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index b0dc3ba9c9..962ef216fd 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -31,6 +31,17 @@
  *   (i.e. all devices assigned to) a guest share a single DMA address space
  *   and, by default, Xen will ensure dfn == pfn.
  *
+ * pdx: Page InDeX
+ *   Indices into the frame table holding the per-page's book-keeping
+ *   metadata. A compression scheme may be used, so there's a possibly non
+ *   identity mapping between valid(mfn) <-> valid(pdx). See the comments
+ *   in pdx.c for an in-depth explanation of that mapping. This may also
+ *   have a knock-on effect on the directmap, as "compressed" pfns may not have
+ *   corresponding mapped frames.
+ *
+ * maddr: Machine Address
+ *   The physical address that corresponds to an mfn
+ *
  * WARNING: Some of these terms have changed over time while others have been
  * used inconsistently, meaning that a lot of existing code does not match the
  * definitions above.  New code should use these terms as described here, and
diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h
index 9fcfb0ce52..de5439a5e5 100644
--- a/xen/include/xen/pdx.h
+++ b/xen/include/xen/pdx.h
@@ -1,6 +1,72 @@
 #ifndef __XEN_PDX_H__
 #define __XEN_PDX_H__
 
+/*
+ * PDX (Page inDeX)
+ *
+ * This file deals with optimisations pertaining to frame table and
+ * directmap indexing, A pdx is an index into the frame table, which
+ * typically also means an index into the directmap[1]. However, having an
+ * identity relationship between mfn and pdx could waste copious amounts of
+ * memory in empty frame table entries and page tables. There are some
+ * techniques to bring memory wastage down.
+ *
+ * [1] Some ports apply further modifications to a pdx before indexing the
+ *     directmap. This doesn't change the fact that the same compression
+ *     present in the frame table is also present in the directmap
+ *     whenever said map is present.
+ *
+ * ## PDX grouping
+ *
+ * The frame table may have some sparsity even on systems where the memory
+ * banks are tightly packed. This is due to system quirks (like the PCI
+ * hole) which might introduce several GiB of unused page frame numbers
+ * that uselessly waste memory in the frame table. PDX grouping addresses
+ * this by keeping a bitmap of the ranges in the frame table containing
+ * invalid entries and not allocating backing memory for them.
+ *
+ * ## PDX compression
+ *
+ * This is a technique to avoid wasting memory on machines known to have
+ * split their machine address space in several big discontinuous and highly
+ * disjoint chunks.
+ *
+ * In its uncompressed form the frame table must have book-keeping metadata
+ * structures for every page between [0, max_mfn) (whether they are backed
+ * by RAM or not), and a similar condition exists for the direct map. We
+ * know some systems, however, that have some sparsity in their address
+ * space, leading to a lot of wastage in the form of unused frame table
+ * entries.
+ *
+ * This is where compression becomes useful. The idea is to note that if
+ * you have several big chunks of memory sufficiently far apart you can
+ * ignore the middle part of the address because it will always contain
+ * zeroes.
+ *
+ * i.e:
+ *   Consider 2 regions of memory. One starts at 0 while the other starts
+ *   at offset 2^off_h. Furthermore, let's assume both regions are smaller
+ *   than 2^off_l. This means that all addresses between [2^off_l, 2^off_h)
+ *   are invalid and we can assume them to be zero on all valid addresses.
+ *
+ *                 off_h     off_l
+ *                 |         |
+ *                 V         V
+ *         --------------------------
+ *         |HHHHHHH|000000000|LLLLLL| <--- mfn
+ *         --------------------------
+ *           ^ |
+ *           | | (de)compression by adding/removing "useless" zeroes
+ *           | V
+ *         ---------------
+ *         |HHHHHHHLLLLLL| <--- pdx
+ *         ---------------
+ *
+ * This scheme also holds for multiple regions, where HHHHHHH acts as
+ * the region identifier and LLLLLL fully contains the span of every
+ * region involved.
+ */
+
 #ifdef CONFIG_HAS_PDX
 
 extern unsigned long max_pdx;
@@ -13,22 +79,78 @@ extern unsigned long pfn_top_mask, ma_top_mask;
                          (sizeof(*frame_table) & -sizeof(*frame_table)))
 extern unsigned long pdx_group_valid[];
 
-extern uint64_t pdx_init_mask(u64 base_addr);
-extern u64 pdx_region_mask(u64 base, u64 len);
+/**
+ * Calculates a mask covering "moving" bits of all addresses of a region
+ *
+ * The i-th bit of the mask must be set if there's 2 different addresses
+ * in the region that have different j-th bits. where j >= i.
+ *
+ * e.g:
+ *       base=0x1B00000000
+ *   len+base=0x1B00042000
+ *
+ *   ought to return 0x000007FFFF, which implies that every bit position
+ *   with a zero in the mask remains unchanged in every address of the
+ *   region.
+ *
+ * @param base Base address of the region
+ * @param len  Size in octets of the region
+ * @return Mask of moving bits at the bottom of all the region addresses
+ */
+uint64_t pdx_region_mask(uint64_t base, uint64_t len);
 
-extern void set_pdx_range(unsigned long smfn, unsigned long emfn);
+/**
+ * Creates the mask to start from when calculating non-compressible bits
+ *
+ * This function is intimately related to pdx_region_mask(), and together
+ * they are meant to calculate the mask of non-compressible bits given the
+ * current memory map.
+ *
+ * @param base_addr Address of the first maddr in the system
+ * @return An integer of the form 2^n - 1
+ */
+uint64_t pdx_init_mask(uint64_t base_addr);
+
+/**
+ * Mark [smfn, emfn) as accesible in the frame table
+ *
+ * @param smfn Start mfn
+ * @param emfn End mfn
+ */
+void set_pdx_range(unsigned long smfn, unsigned long emfn);
 
 #define page_to_pdx(pg)  ((pg) - frame_table)
 #define pdx_to_page(pdx) gcc11_wrap(frame_table + (pdx))
 
+/**
+ * Invoked to determine if an mfn has an associated valid frame table entry
+ *
+ * In order for it to be legal it must pass bounds, grouping and
+ * compression sanity checks.
+ *
+ * @param mfn To-be-checked mfn
+ * @return True iff all checks pass
+ */
 bool __mfn_valid(unsigned long mfn);
 
+/**
+ * Map pfn to its corresponding pdx
+ *
+ * @param pfn Frame number
+ * @return Obtained pdx after compressing the pfn
+ */
 static inline unsigned long pfn_to_pdx(unsigned long pfn)
 {
     return (pfn & pfn_pdx_bottom_mask) |
            ((pfn & pfn_top_mask) >> pfn_pdx_hole_shift);
 }
 
+/**
+ * Map a pdx to its corresponding pfn
+ *
+ * @param pdx Page index
+ * @return Obtained pfn after decompressing the pdx
+ */
 static inline unsigned long pdx_to_pfn(unsigned long pdx)
 {
     return (pdx & pfn_pdx_bottom_mask) |
@@ -38,7 +160,16 @@ static inline unsigned long pdx_to_pfn(unsigned long pdx)
 #define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
 #define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
 
-extern void pfn_pdx_hole_setup(unsigned long);
+/**
+ * Initializes global variables with information about the compressible
+ * range of the current memory regions.
+ *
+ * @param mask This mask is the biggest pdx_mask of every region in the
+ *             system ORed with all base addresses of every region in the
+ *             system. This results in a mask where every zero in a bit
+ *             position marks a potentially compressible bit.
+ */
+void pfn_pdx_hole_setup(unsigned long mask);
 
 #endif /* HAS_PDX */
 #endif /* __XEN_PDX_H__ */
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 16:03:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 16:03:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564730.882403 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQh6-0002tQ-AD; Mon, 17 Jul 2023 16:03:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564730.882403; Mon, 17 Jul 2023 16:03:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQh6-0002tD-5k; Mon, 17 Jul 2023 16:03:28 +0000
Received: by outflank-mailman (input) for mailman id 564730;
 Mon, 17 Jul 2023 16:03:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=fcy7=DD=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qLQh4-00027B-4J
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 16:03:26 +0000
Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com
 [2a00:1450:4864:20::52b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 75277e3a-24bb-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 18:03:23 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-51e619bcbf9so6491891a12.3
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 09:03:23 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net
 (default-46-102-197-194.interdsl.co.uk. [46.102.197.194])
 by smtp.gmail.com with ESMTPSA id
 bo28-20020a0564020b3c00b0051df5bd1cd8sm10099050edb.65.2023.07.17.09.03.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 09:03:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 75277e3a-24bb-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689609803; x=1692201803;
        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=r1Ds6GpX99KKIP7Xn+WLKam0uM2qlDi/O2AccjIBDFI=;
        b=kzQU5pUvrMIxMWwKhNFFloQfT3Fid9QUqdqwmdmy2o74vkeIaW9smWYYfEV9sACSS6
         NZhlaU8DWiYfNw6psxWBx/XqBRkzYy7pKoWsYLbmA6N6hISS+k/vuUicJ4saBmwQ4ECx
         4pCcUVmbDIGfqVSAJ4cSxxzuJ/IjuvshhA9vc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689609803; x=1692201803;
        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=r1Ds6GpX99KKIP7Xn+WLKam0uM2qlDi/O2AccjIBDFI=;
        b=BN4z2FxhydydOExwPeTorzEj2veQK+Hb0Q6deiW217Shyd6ofDw1sbeMHPyGBp1JO2
         i4B+HS/fFmaMC1m9UzEjSgF+a8ryavhDw0foc7+gO8eZB/ujpYEVbJ4Ao6854hgEDOlz
         Wqi+1HsMwg4/JmcJ9oZDFtMMXNYwJR/skZWQY45OkQnFFh6cdMhez2BF06x8mW0m8Nt3
         J2hkZnX7DZVN2Gdv3kEVGTUlM43tW4u7GZV3LVBWHevfPd83VWCKJQvnv0lzHkmHImEG
         nhn2gFa5S2mwkFFYUh6bYeAiAIGOjd3lf8IgRLw6AnNREq0Al+PXOkE5Qnx7LlOfR5Fi
         1kvQ==
X-Gm-Message-State: ABy/qLaJ2rRS5ewuPJmXG8FU1PBNtdMxvB4RFHQqkld+obL7rKoE8K8R
	O7RWT3JCWxcLOuNlYYhHS4dmi1KItgbRSKnxAWg=
X-Google-Smtp-Source: APBJJlGXMxR+Y48i+AvaPfZNSSbKNoQ9OV+wgR9SMk5t9XhKnZ+4VMKWcARiO9Bct80MeXVomlzdgw==
X-Received: by 2002:aa7:d5ca:0:b0:51d:a181:d78e with SMTP id d10-20020aa7d5ca000000b0051da181d78emr10646412eds.27.1689609803427;
        Mon, 17 Jul 2023 09:03:23 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [PATCH 3/8] pdx: Mark pdx hole description globals readonly after boot
Date: Mon, 17 Jul 2023 17:03:13 +0100
Message-Id: <20230717160318.2113-4-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

They define where the compressible area of valid mfns is, and all of them
are populated on boot (with the exception of max_pdx, that's updated on
memory hotplug).

No functional change.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
 xen/common/pdx.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/common/pdx.c b/xen/common/pdx.c
index ec64d3d2ef..99d4a90a50 100644
--- a/xen/common/pdx.c
+++ b/xen/common/pdx.c
@@ -47,30 +47,33 @@
  * ones.
  */
 
-/** Maximum (non-inclusive) usable pdx */
+/**
+ * Maximum (non-inclusive) usable pdx. Must be
+ * modifiable after init due to memory hotplug
+ */
 unsigned long __read_mostly max_pdx;
 
 /** Mask for the lower non-compressible bits of an mfn */
-unsigned long __read_mostly pfn_pdx_bottom_mask = ~0UL;
+unsigned long __ro_after_init pfn_pdx_bottom_mask = ~0UL;
 
 /** Mask for the lower non-compressible bits of an maddr or vaddr */
-unsigned long __read_mostly ma_va_bottom_mask = ~0UL;
+unsigned long __ro_after_init ma_va_bottom_mask = ~0UL;
 
 /** Mask for the higher non-compressible bits of an mfn */
-unsigned long __read_mostly pfn_top_mask = 0;
+unsigned long __ro_after_init pfn_top_mask = 0;
 
 /** Mask for the higher non-compressible bits of an maddr or vaddr */
-unsigned long __read_mostly ma_top_mask = 0;
+unsigned long __ro_after_init ma_top_mask = 0;
 
 /**
  * Mask for a pdx compression bit slice.
  *
  *  Invariant: valid(mfn) implies (mfn & pfn_hole_mask) == 0
  */
-unsigned long __read_mostly pfn_hole_mask = 0;
+unsigned long __ro_after_init pfn_hole_mask = 0;
 
 /** Number of bits of the "compressible" bit slice of an mfn */
-unsigned int __read_mostly pfn_pdx_hole_shift = 0;
+unsigned int __ro_after_init pfn_pdx_hole_shift = 0;
 
 unsigned long __read_mostly pdx_group_valid[BITS_TO_LONGS(
     (FRAMETABLE_NR + PDX_GROUP_COUNT - 1) / PDX_GROUP_COUNT)] = { [0] = 1 };
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 16:03:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 16:03:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564731.882407 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQh6-0002vU-JW; Mon, 17 Jul 2023 16:03:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564731.882407; Mon, 17 Jul 2023 16:03:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQh6-0002v1-Du; Mon, 17 Jul 2023 16:03:28 +0000
Received: by outflank-mailman (input) for mailman id 564731;
 Mon, 17 Jul 2023 16:03:26 +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
 <SRS0=fcy7=DD=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qLQh4-0002Zo-LD
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 16:03:26 +0000
Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com
 [2a00:1450:4864:20::131])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 75af6146-24bb-11ee-8611-37d641c3527e;
 Mon, 17 Jul 2023 18:03:24 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-4fb73ba3b5dso7599782e87.1
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 09:03:24 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net
 (default-46-102-197-194.interdsl.co.uk. [46.102.197.194])
 by smtp.gmail.com with ESMTPSA id
 bo28-20020a0564020b3c00b0051df5bd1cd8sm10099050edb.65.2023.07.17.09.03.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 09:03:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 75af6146-24bb-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689609804; x=1692201804;
        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=v0IhxmE72AYW3LaZbJhXXAiAR4Fd8XXkCy6sjFZ0aFM=;
        b=FtvKo5PCq617lmKRFyV0zgLNB30iOSu8auC6E2SOys3Xyqd1Rucss97XPbNM20PqXT
         SPQfBQbbQObshwWPAkZzbmIPg7N436jBLf7+3WQ6DXGTXHjCtYZmCRrZvig/7frXOgdI
         M+3JpXTV8FmMP83cXmg0nAcyJtUv1ZZtuwFNA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689609804; x=1692201804;
        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=v0IhxmE72AYW3LaZbJhXXAiAR4Fd8XXkCy6sjFZ0aFM=;
        b=kAxBWSDNE5fv6w2AE3R8M8A1mWUG2Z3t1OkRZnGz5Lo+Uxp3mLSdOMpUcrIfdR9o1J
         QgfaKZWCw3EFUS+OUSEPFR1MlwUNwj0e8KtyxPPDwifmKYpgrrIYIl3QEXzJOKP99/9e
         bhtI0hJG5cMvFwhHjicZdMsuko6FOxVxU7JHbUeuWeTT0/yehL+UWCLOROwmI/8M9TtI
         WkXjy2P7QAez7W4J9WLUT70n+LIyQW7YrgUO2Y9qG+H8eSOcnt2iThPmMDGth4ASLMvE
         7tf4EicvigZawKi6E1QhmZi4+gNurGt38rBp+ja72qdZxXdzm1Thv1enRGrpdBQIrPiE
         oBwQ==
X-Gm-Message-State: ABy/qLZx+Ob8gHrCSWaT1GcWIlyOEATiV3b6w/DqNjkBKrOrHynawk/i
	CPevNMJCwyLDPN6pb5fwoNf8AYF2HPavChTT/Yw=
X-Google-Smtp-Source: APBJJlGlOoLPXXCdptae0m4OTaZqL/bcr7BbXfoZ/2PlFQ6YxvMLg3XpFG5LN6Zp4BtfhPEDporJiw==
X-Received: by 2002:a05:6512:3194:b0:4f9:586b:dba6 with SMTP id i20-20020a056512319400b004f9586bdba6mr10059097lfe.10.1689609804064;
        Mon, 17 Jul 2023 09:03:24 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Wei Liu <wl@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH 4/8] build: Remove CONFIG_HAS_PDX
Date: Mon, 17 Jul 2023 17:03:14 +0100
Message-Id: <20230717160318.2113-5-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

It's set everywhere and can't be turned off because it's presence is
assumed in several parts of the codebase. This is an initial patch towards
adding a more fine-grained CONFIG_HAS_PDX_COMPRESSION that can actually be
disabled on systems that don't typically benefit from it.

No functional change.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
 xen/arch/arm/Kconfig  | 1 -
 xen/arch/x86/Kconfig  | 1 -
 xen/common/Kconfig    | 3 ---
 xen/common/Makefile   | 2 +-
 xen/include/xen/pdx.h | 3 ---
 5 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 439cc94f33..ea1949fbaa 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -14,7 +14,6 @@ config ARM
 	select HAS_ALTERNATIVE
 	select HAS_DEVICE_TREE
 	select HAS_PASSTHROUGH
-	select HAS_PDX
 	select HAS_PMAP
 	select HAS_UBSAN
 	select IOMMU_FORCE_PT_SHARE
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 92f3a627da..30df085d96 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -24,7 +24,6 @@ config X86
 	select HAS_PASSTHROUGH
 	select HAS_PCI
 	select HAS_PCI_MSI
-	select HAS_PDX
 	select HAS_SCHED_GRANULARITY
 	select HAS_UBSAN
 	select HAS_VPCI if HVM
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index dd8d7c3f1c..40ec63c4b2 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -53,9 +53,6 @@ config HAS_IOPORTS
 config HAS_KEXEC
 	bool
 
-config HAS_PDX
-	bool
-
 config HAS_PMAP
 	bool
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 46049eac35..0020cafb8a 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -29,7 +29,7 @@ obj-y += multicall.o
 obj-y += notifier.o
 obj-$(CONFIG_NUMA) += numa.o
 obj-y += page_alloc.o
-obj-$(CONFIG_HAS_PDX) += pdx.o
+obj-y += pdx.o
 obj-$(CONFIG_PERF_COUNTERS) += perfc.o
 obj-bin-$(CONFIG_HAS_PMAP) += pmap.init.o
 obj-y += preempt.o
diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h
index de5439a5e5..67ae20e89c 100644
--- a/xen/include/xen/pdx.h
+++ b/xen/include/xen/pdx.h
@@ -67,8 +67,6 @@
  * region involved.
  */
 
-#ifdef CONFIG_HAS_PDX
-
 extern unsigned long max_pdx;
 extern unsigned long pfn_pdx_bottom_mask, ma_va_bottom_mask;
 extern unsigned int pfn_pdx_hole_shift;
@@ -171,7 +169,6 @@ static inline unsigned long pdx_to_pfn(unsigned long pdx)
  */
 void pfn_pdx_hole_setup(unsigned long mask);
 
-#endif /* HAS_PDX */
 #endif /* __XEN_PDX_H__ */
 
 /*
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 17 16:17:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 16:17:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564761.882463 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQup-0008MN-9M; Mon, 17 Jul 2023 16:17:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564761.882463; Mon, 17 Jul 2023 16:17:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLQup-0008MG-6J; Mon, 17 Jul 2023 16:17:39 +0000
Received: by outflank-mailman (input) for mailman id 564761;
 Mon, 17 Jul 2023 16:17:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLQuo-0008MA-0e
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 16:17:38 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0621.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::621])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 70f580ab-24bd-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 18:17:36 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VI1PR04MB7101.eurprd04.prod.outlook.com (2603:10a6:800:12e::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 16:17:33 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 16:17:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 70f580ab-24bd-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=UpYYylBoabO4ciDwjj+hpptOjmBtBA58ob67AhBRT45qGyve7culiR3OjaliEF580ErBqESA4Wz9IvThwghgbR2vKrpg3TcBj5leqRtzJRRhrtuvKaA0zhXdr8qig6vVIQODFSTKS5WaxFX3tqPyGZHjhkcNCoOeumCDTf4HG7g36TnEB/MCaQBKcTv88JAknse0q6mVFnL02M6ENA89XTZz11W4ER08jywkG2NrG6M41MskLRYjQ3jLZC1tAKI1O4XTjo2aDdqEuKgvVvntFjPwmd6gRgXjDouikD2cXGvj9kxWaWuV/tboGTgYiIG43LXIlm/c+5Co93b+WeXNHQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=dfMQ76dMLG7HqkhZ0Nido2jSKPWGnx/9sf/gMnJarZo=;
 b=AYCxNtUkn/6cyHMVfPisj/u9ROYQdOByeGmp7YPbchnqgo/xb81fosAVhLuC4Fhn7LvQFMTzxJDDErHmCxqhUVodX5tWnOuCEFpc4qoTRDZwHfbxE+y/Gmbgwi7YiyBovLZn2M23IwYe29vQ4cXDomvpElpg/Z0+jtbgd/jVd44/tcyFFAky8mjLRLvxePNLa/g4Aj64c+1C3Cp+74sxYuGNeKIEyvVWqK2ZFXud5vRPsT1sCPMC4I4Jhken9kao2MaeQ3x42HN0IuGEElwZfGdGAR0ndr1AmPnRSPwB90O8abd6apx7aIHnLJVMhFKUmDrX49BKMPJYzn7R6Litag==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=dfMQ76dMLG7HqkhZ0Nido2jSKPWGnx/9sf/gMnJarZo=;
 b=F9eKZS8S6NHwYK/LH17GlbcSzSkTYYCy1bnmvzqSVw4nhJzTDd2alh6v8NLoPadxnecIumiEPZZAc3PZNB4It4mCVX+OwjuJfGsFx4J5JqB+mfHY3SdM8Lue6v8r1XaR0dFMJQY9bTkDfjXBy2Q9+adZLwaawTrmNTrkDQ+HiXuVqI9hUbvz3NIEgq0N+jPzlB1QdiJco0G/KQUZ461N/SP2qFpTQnHrvIvA+v/ZNlrV3y/WvshTc0hdNXVlf2HFgRzYPl2WRjKN68d/pilLPbeYwXfSTq07LMzFCjzqudSEA0Bt9fsTE49BrSQqIIUejUCDIsvrgNNFtmfwFL63wg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <aa58706f-5033-ef33-5202-bcc418bedb86@suse.com>
Date: Mon, 17 Jul 2023 18:17:31 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 2/3] xen/ppc: Implement early serial printk on pseries
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1688670018.git.sanastasio@raptorengineering.com>
 <85172d385a730e196999b366207e2b2e8a261906.1688670018.git.sanastasio@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <85172d385a730e196999b366207e2b2e8a261906.1688670018.git.sanastasio@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0094.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a9::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VI1PR04MB7101:EE_
X-MS-Office365-Filtering-Correlation-Id: dc213b22-cac8-42b5-c321-08db86e153ca
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	jNb16BF81fTLkGp3wTtbXH7qS4eFLleEp6LHM1fqhIUP1Aty5tS+uNMJX8CxiM6sGHiwzHxGAhXAIzA7LWKifCARhhRVWKWHV3Gy54P1TobdDnzezSTi2MGI25aUHP2OKM8/8vdisziKn+e5jfpfz2xPn6Nz/44cVzveS00HTPWSJX52wSxFLJIOXRSVaVRnbeT1CaITdmfZGQcHA8m5pTjI4gEdbM0XyrmQqOJx6fiyO9TLulg8X2KwAmqzZP6nku9fc9/JuNM0kDVcMq6XgtV4H96UbGcgNffpPO2ik8PVnX7OZVsh8r5SAQPC6ulrwS0o0XvRyFEmhxr8kgxiEhY4+Nhh0Ugk2xBPWQfGftusr+BpTxUpb3zuwklvg3RMCrx66+hxhiEygk1lrM4lE/IdtzuPA90anFqsFl+2U8ET/76KZyCEMU40JFtxZyHavcX46zc0HQEK96tKIlNUlWXE6IvfVZlga6psPFYBlbhS2T3JGgTfccAanD2ggZWqqNPtlwOYX2Cs5GJZLro2C1mds3B7SWxU4tePkNJcWgY8/De3FSvIJVucoVaH1ysmldsrKlzj6AN65cbT/37hyLwb/+1CoWjnLF1l7zk51C5DrFZIfmi1zpH7bbSJ+5yvkoQmOLcLxrtOraebAussaA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(39860400002)(366004)(376002)(396003)(346002)(451199021)(31686004)(31696002)(86362001)(2906002)(30864003)(36756003)(6512007)(186003)(83380400001)(6506007)(53546011)(26005)(38100700002)(6486002)(54906003)(316002)(5660300002)(66476007)(6916009)(66946007)(66556008)(2616005)(4326008)(478600001)(41300700001)(8936002)(8676002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dzA1Nmlxd085NWV6SXdQc2NrdFRSTWdNY1ZWYXdpQ0ZseTR3SDVSbS9ZZmcy?=
 =?utf-8?B?V25sc1N1NUt4OHp2MkdOVFEveFl2ZnptNHpnNmVuZW1OMi9ISWFDYmJXVmlu?=
 =?utf-8?B?eUdHNGN4MkFzaTk5Wk50U2VWNUw3QVBQZ0lDanllVTZWVGN5MG9MQjk1bzVt?=
 =?utf-8?B?Q3dPR2ptVUswcTBLdkhtSEpLRm4rQzFmeWVVLzR2WndzbmxVRDdFQUNSSUNt?=
 =?utf-8?B?SjhFNU1XbXhlOEd1RzNpSnUzWTBvNG1LQWdPd3dPaWdGbnM4ajFXTE1KZnpy?=
 =?utf-8?B?UVYzYWt1T0lEbnZIblEyRGNDbnByOFI1cXlKNVgrK1psVzlXM0ZGYnJSWWI5?=
 =?utf-8?B?YnluZXdzM3FWR1V1V3RHNFlPNmlxYmthZ3RoUnIwMUE5WDI1RmdMVFgwK3FM?=
 =?utf-8?B?SEZFL2sxdGh3Ym9mOXR1N2JsYmRJeW9ENWxKTWZxdWtKWnZnd3JtRHhNN0hx?=
 =?utf-8?B?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B8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 16:17:33.6582
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: rcPavaUXeicBKyS2jETYUixN28HkCWuk7kpmhxAIXZPpY7EChb9R/zg7QrajfJyWV41Oqz3II82Boaj5bxL3Kg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7101

On 06.07.2023 21:04, Shawn Anastasio wrote:
> --- a/xen/arch/ppc/Makefile
> +++ b/xen/arch/ppc/Makefile
> @@ -1,5 +1,7 @@
>  obj-$(CONFIG_PPC64) += ppc64/
>  
> +obj-y += boot-of.init.o
> +obj-$(CONFIG_EARLY_PRINTK) += early_printk.o

While in this case I could accept the name as is to be the same as Arm's,
as said before it would be nice if new files could avoid underscores (and
use dashes instead) unless strictly required by something.

Also, with boot-of.c using early_printk.c, shouldn't the latter also
build into early_printk.init.o?

> --- /dev/null
> +++ b/xen/arch/ppc/boot-of.c
> @@ -0,0 +1,100 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * Copyright IBM Corp. 2005, 2006, 2007

Judging from the years the file was taken from somewhere. Is the license
there permitting "2.0 or later"? (For files [partly] taken from somewhere,
a clarification as to the originals' licenses would be helpful to have in
the description, or maybe in the post-commit-message area.)

> + * Copyright Raptor Engineering, LLC
> + *
> + * Authors: Jimi Xenidis <jimix@watson.ibm.com>
> + *          Hollis Blanchard <hollisb@us.ibm.com>
> + *          Shawn Anastasio <sanastasio@raptorengineering.com>
> + */
> +
> +#include <xen/init.h>
> +#include <xen/stdarg.h>
> +#include <xen/types.h>
> +#include <asm/boot.h>
> +#include <asm/byteorder.h>
> +#include <asm/early_printk.h>
> +
> +#define ADDR(x) (uint32_t)(unsigned long)(x)

Besides needing to be wrapped in parentheses, this likely needs a comment:
It is hard to see how in 64-bit code uint32_t can suffice as an address.
Unless (see the question on patch 1) you intend to link/run Xen at an
address firmly below 4Gb, now and going forward.

> +/* OF entrypoint*/
> +static unsigned long __initdata of_vec;
> +
> +/* OF device handles*/
> +static int __initdata bof_chosen;
> +static int __initdata of_out;
> +
> +static int __init of_call(const char *service, uint32_t nargs, uint32_t nrets,
> +                   int32_t rets[], ...)

Nit: Indentation.

> +{
> +    int rc;
> +    va_list args;
> +    int i;

unsigned int?

> +    struct of_service s = { 0 };
> +
> +    s.ofs_service = cpu_to_be32(ADDR(service));
> +    s.ofs_nargs = cpu_to_be32(nargs);
> +    s.ofs_nrets = cpu_to_be32(nrets);
> +
> +    /* copy all the params into the args array */

Nit: Style (comments want to start with a capital letter). Again below.

> +    va_start(args, rets);
> +
> +    for ( i = 0; i < nargs; i++ )
> +        s.ofs_args[i] = cpu_to_be32(va_arg(args, uint32_t));
> +
> +    va_end(args);
> +
> +    rc = enter_of(&s, of_vec);
> +
> +    /* copy all return values to the output rets array */
> +    for ( i = 0; i < nrets; i++ )
> +        rets[i] = be32_to_cpu(s.ofs_args[i + nargs]);
> +
> +    return rc;
> +}
> +
> +static int __init of_finddevice(const char *devspec)
> +{
> +    int rets[1] = { OF_FAILURE };

Hmm, of_call() uses int32_t. Again below several times.

> +    of_call("finddevice", 1, 1, rets, devspec);

This could do with using ARRAY_SIZE(rets). Same again below.

Also don't you need to wrap devspec in ADDR()? Similar issues
then again below.

> +    return rets[0];
> +}
> +
> +static int __init of_getprop(int ph, const char *name, void *buf, uint32_t buflen)
> +{
> +    int rets[1] = { OF_FAILURE };
> +
> +    of_call("getprop", 4, 1, rets, ph, ADDR(name), buf, buflen);
> +    return rets[0];
> +}
> +
> +int __init of_write(int ih, const char *addr, uint32_t len)
> +{
> +    int rets[1] = { OF_FAILURE };
> +
> +    of_call("write", 3, 1, rets, ih, addr, len);
> +    return rets[0];
> +}
> +
> +static void __init of_putchar(char c)
> +{
> +    if ( c == '\n' )
> +    {
> +        char buf = '\r';
> +        of_write(of_out, &buf, 1);
> +    }
> +    of_write(of_out, &c, 1);
> +}
> +
> +void __init boot_of_init(unsigned long vec)
> +{
> +    of_vec = vec;
> +
> +    /* Get a handle to the default console */
> +    bof_chosen = of_finddevice("/chosen");
> +    of_getprop(bof_chosen, "stdout", &of_out, sizeof(of_out));
> +    of_out = be32_to_cpu(of_out);
> +
> +    early_printk_init(of_putchar);
> +}

Considering that bof_chosen is used just here, why does it need to be
a file-scope variable?

> --- /dev/null
> +++ b/xen/arch/ppc/early_printk.c
> @@ -0,0 +1,28 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +#include <xen/init.h>
> +#include <asm/boot.h>
> +
> +static void (*putchar_func)(char);

__initdata? (Connected to the question of building into .init.o.)

> --- /dev/null
> +++ b/xen/arch/ppc/include/asm/processor.h
> @@ -0,0 +1,139 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * Copyright IBM Corp. 2005, 2006, 2007
> + * Copyright Raptor Engineering, LLC
> + *
> + * Authors: Hollis Blanchard <hollisb@us.ibm.com>
> + *          Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
> + *          Timothy Pearson <tpearson@raptorengineering.com>
> + *          Shawn Anastasio <sanastasio@raptorengineering.com>
> + */
> +
> +#ifndef _ASM_PPC_PROCESSOR_H
> +#define _ASM_PPC_PROCESSOR_H
> +
> +#include <xen/config.h>

No need to - this is force-included by the Makefile machinery.

> +#include <xen/types.h>

Note this. Why ...

> +#define IOBMP_BYTES          8192
> +#define IOBMP_INVALID_OFFSET 0x8000
> +
> +/* Processor Version Register (PVR) field extraction */
> +
> +#define PVR_VER(pvr) (((pvr) >> 16) & 0xFFFF) /* Version field */
> +#define PVR_REV(pvr) (((pvr) >> 0) & 0xFFFF)  /* Revison field */
> +
> +#define __is_processor(pv) (PVR_VER(mfspr(SPRN_PVR)) == (pv))
> +
> +/*
> + * IBM has further subdivided the standard PowerPC 16-bit version and
> + * revision subfields of the PVR for the PowerPC 403s into the following:
> + */
> +
> +#define PVR_FAM(pvr)  (((pvr) >> 20) & 0xFFF) /* Family field */
> +#define PVR_MEM(pvr)  (((pvr) >> 16) & 0xF)   /* Member field */
> +#define PVR_CORE(pvr) (((pvr) >> 12) & 0xF)   /* Core field */
> +#define PVR_CFG(pvr)  (((pvr) >> 8) & 0xF)    /* Configuration field */
> +#define PVR_MAJ(pvr)  (((pvr) >> 4) & 0xF)    /* Major revision field */
> +#define PVR_MIN(pvr)  (((pvr) >> 0) & 0xF)    /* Minor revision field */
> +
> +/* Processor Version Numbers */
> +
> +#define PVR_403GA    0x00200000
> +#define PVR_403GB    0x00200100
> +#define PVR_403GC    0x00200200
> +#define PVR_403GCX   0x00201400
> +#define PVR_405GP    0x40110000
> +#define PVR_STB03XXX 0x40310000
> +#define PVR_NP405H   0x41410000
> +#define PVR_NP405L   0x41610000
> +#define PVR_601      0x00010000
> +#define PVR_602      0x00050000
> +#define PVR_603      0x00030000
> +#define PVR_603e     0x00060000
> +#define PVR_603ev    0x00070000
> +#define PVR_603r     0x00071000
> +#define PVR_604      0x00040000
> +#define PVR_604e     0x00090000
> +#define PVR_604r     0x000A0000
> +#define PVR_620      0x00140000
> +#define PVR_740      0x00080000
> +#define PVR_750      PVR_740
> +#define PVR_740P     0x10080000
> +#define PVR_750P     PVR_740P
> +#define PVR_7400     0x000C0000
> +#define PVR_7410     0x800C0000
> +#define PVR_7450     0x80000000
> +#define PVR_8540     0x80200000
> +#define PVR_8560     0x80200000
> +/*
> + * For the 8xx processors, all of them report the same PVR family for
> + * the PowerPC core. The various versions of these processors must be
> + * differentiated by the version number in the Communication Processor
> + * Module (CPM).
> + */
> +#define PVR_821  0x00500000
> +#define PVR_823  PVR_821
> +#define PVR_850  PVR_821
> +#define PVR_860  PVR_821
> +#define PVR_8240 0x00810100
> +#define PVR_8245 0x80811014
> +#define PVR_8260 PVR_8240
> +
> +/* 64-bit processors */
> +#define PVR_NORTHSTAR 0x0033
> +#define PVR_PULSAR    0x0034
> +#define PVR_POWER4    0x0035
> +#define PVR_ICESTAR   0x0036
> +#define PVR_SSTAR     0x0037
> +#define PVR_POWER4p   0x0038
> +#define PVR_970       0x0039
> +#define PVR_POWER5    0x003A
> +#define PVR_POWER5p   0x003B
> +#define PVR_970FX     0x003C
> +#define PVR_POWER6    0x003E
> +#define PVR_POWER7    0x003F
> +#define PVR_630       0x0040
> +#define PVR_630p      0x0041
> +#define PVR_970MP     0x0044
> +#define PVR_970GX     0x0045
> +#define PVR_POWER7p   0x004A
> +#define PVR_POWER8E   0x004B
> +#define PVR_POWER8NVL 0x004C
> +#define PVR_POWER8    0x004D
> +#define PVR_POWER9    0x004E
> +#define PVR_POWER10   0x0080
> +#define PVR_BE        0x0070
> +#define PVR_PA6T      0x0090
> +
> +/* Macro to adjust thread priority for hardware multithreading */
> +#define HMT_very_low()  asm volatile (" or %r31, %r31, %r31 ")
> +
> +#ifndef __ASSEMBLY__
> +
> +#include <xen/types.h>

... another time here? Or is the first one perhaps too early?

> +/* User-accessible registers: nost of these need to be saved/restored
> + * for every nested Xen invocation. */

Nit: Comment style. Multi-line comments want to be

/*
 * User-accessible registers: most of these need to be saved/restored
 * for every nested Xen invocation.
 */

(also note the s/nost/most/ I did)

> --- a/xen/arch/ppc/ppc64/head.S
> +++ b/xen/arch/ppc/ppc64/head.S
> @@ -18,6 +18,15 @@ ENTRY(start)
>      li %r11, 0
>      stdu %r11, -STACK_FRAME_OVERHEAD(%r1)
>  
> +    /* clear .bss */
> +    LOAD_IMM32(%r14, __bss_start)
> +    LOAD_IMM32(%r15, __bss_end)

Question regarding addressing again.

> --- /dev/null
> +++ b/xen/arch/ppc/ppc64/of-call.S
> @@ -0,0 +1,83 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * Adapted from Linux's arch/powerpc/kernel/entry_64.S, with the
> + * following copyright notice:
> + *
> + *  PowerPC version
> + *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
> + *  Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
> + *    Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
> + *  Adapted for Power Macintosh by Paul Mackerras.
> + *  Low-level exception handlers and MMU support
> + *  rewritten by Paul Mackerras.
> + *    Copyright (C) 1996 Paul Mackerras.
> + *  MPC8xx modifications Copyright (C) 1997 Dan Malek (dmalek@jlc.net).
> + */
> +
> +#include <asm/asm-offsets.h>
> +#include <asm/asm-defns.h>
> +#include <asm/msr.h>
> +
> +/* size of minimum stack frame that can hold an entire cpu_user_regs struct */
> +#define STACK_SWITCH_FRAME_SIZE UREGS_sizeof
> +
> +    .section .init.text, "ax", @progbits
> +
> +ENTRY(enter_of)
> +    mflr %r0
> +    std %r0, 16(%r1)
> +    stdu %r1,-STACK_SWITCH_FRAME_SIZE(%r1) /* Save SP and create stack space */
> +
> +    /*
> +     * Because PROM is running in 32b mode, it clobbers the high order half
> +     * of all registers that it saves.  We therefore save those registers
> +     * PROM might touch to the stack.  (%r0, %r3-%r13 are caller saved)
> +     */
> +    SAVE_GPR(2, %r1)
> +    SAVE_GPR(13, %r1)
> +    SAVE_NVGPRS(%r1)
> +    mfcr %r10
> +    mfmsr %r11
> +    std %r10, UREGS_cr(%r1)
> +    std %r11, UREGS_msr(%r1)
> +
> +    /* Put PROM address in SRR0 */
> +    mtsrr0 %r4
> +
> +    /* Setup our trampoline return addr in LR */
> +    bcl 20, 31,.+4
> +0:  mflr %r4
> +    addi %r4, %r4,(1f - 0b)

Nit: Missing blank after last comma. I also wonder whether the parentheses
are doing any good here.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 16:24:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 16:24:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564768.882472 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLR17-0001Mu-1Z; Mon, 17 Jul 2023 16:24:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564768.882472; Mon, 17 Jul 2023 16:24:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLR16-0001Mn-Uq; Mon, 17 Jul 2023 16:24:08 +0000
Received: by outflank-mailman (input) for mailman id 564768;
 Mon, 17 Jul 2023 16:24:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=fcy7=DD=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qLR15-0001Me-M3
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 16:24:07 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 59a92b12-24be-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 18:24:06 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-9936b3d0286so674324066b.0
 for <xen-devel@lists.xenproject.org>; Mon, 17 Jul 2023 09:24:06 -0700 (PDT)
Received: from EMEAENGAAD19049. (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 dk7-20020a170906f0c700b009931a3adf64sm9541063ejb.17.2023.07.17.09.24.05
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Jul 2023 09:24:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 59a92b12-24be-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689611045; x=1692203045;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=XUIH2ZIe8VQsTXV7gRCJU6VoOH6iTYGs97G/4I4CzPc=;
        b=cJRYFoo0K2DpnQu3VCl09TnL+w6XAc2wP0y5h+I0Ev/l/PMvHTxVNAxOXVkMqID88a
         TsWOmyARtW+a9YgCkCIOltcrDGscubafrw5KlWcZxaBYtQHU93uifdRsc1N/s24hvWvd
         enfJrLoq1fFh1oBTk0/b/CrOtO5/LgphtxI5s=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689611045; x=1692203045;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=XUIH2ZIe8VQsTXV7gRCJU6VoOH6iTYGs97G/4I4CzPc=;
        b=XNbjrowBKpZ2YZno52vjqwIfZ4wRShaQt07jpjcw6gTULo1pIXxlhOsvmBDI7c9SbU
         zcTARB8ssSRRSn5ZzAa690OnXGIIwgqOhbaddZ4fgC7c1ZgbeKjw83HjvWGTmZ8uYS/b
         YL/OL9sgnu5B5Ofx+fkv4X0eFxWCY5kEBprV7fJ6YUjGCB+YlMDrLeOLAuz4/oPP6Yle
         CNBHLcWhwQidObhazyCLKVbrnU/Qc+2L7N9u6cKhfiZydzYgzHsw6Rx8HXnm45cL0vhO
         TbawQqzceO9F1lIG1mE03VvUEXU0l7luiUf3zRFFzfpguvs0BaZmO7WrJS5BvpDS/Rar
         VZEA==
X-Gm-Message-State: ABy/qLZHp0X3l8wTfi/0ow5jMOB5c1haJoK+OafzjAPvrAsCU1WbNUP1
	BuqDBVbpONcMiXYN5ldmV/GU15gNUGmcIFK/7wo=
X-Google-Smtp-Source: APBJJlH6lWTRfn8QxE3FvhYjXRQPmYqtZuws9xYEumtn9jnhnQGPr2nrntxe/xTaIvZ592LJs/VgwA==
X-Received: by 2002:a17:906:4710:b0:994:4f6a:dbb with SMTP id y16-20020a170906471000b009944f6a0dbbmr8519754ejq.27.1689611045579;
        Mon, 17 Jul 2023 09:24:05 -0700 (PDT)
Message-ID: <64b56b25.170a0220.6a4ba.993c@mx.google.com>
X-Google-Original-Message-ID: <ZLVrJGBnCMQkGcIe@EMEAENGAAD19049.>
Date: Mon, 17 Jul 2023 17:24:04 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH 7/8] pdx: Reorder pdx.[ch]
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-8-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20230717160318.2113-8-alejandro.vallejo@cloud.com>

On Mon, Jul 17, 2023 at 05:03:17PM +0100, Alejandro Vallejo wrote:
> The next patch compiles out compression-related chunks, and it's helpful to
> have them grouped together beforehand.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> ---
>  xen/common/pdx.c      | 58 +++++++++++++++++++++----------------------
>  xen/include/xen/pdx.h | 37 +++++++++++++++++++++------
>  2 files changed, 59 insertions(+), 36 deletions(-)
> 
> [snip]
>
> diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h
> index 5378e664c2..ce27177b56 100644
> --- a/xen/include/xen/pdx.h
> +++ b/xen/include/xen/pdx.h
> @@ -68,15 +68,41 @@
>   */
>  
>  extern unsigned long max_pdx;
> -extern unsigned long pfn_pdx_bottom_mask, ma_va_bottom_mask;
> -extern unsigned int pfn_pdx_hole_shift;
> -extern unsigned long pfn_hole_mask;
> -extern unsigned long pfn_top_mask, ma_top_mask;
>  
>  #define PDX_GROUP_COUNT ((1 << PDX_GROUP_SHIFT) / \
>                           (sizeof(*frame_table) & -sizeof(*frame_table)))
>  extern unsigned long pdx_group_valid[];
>  
> +/**
> + * Mark [smfn, emfn) as allocatable in the frame table
> + *
> + * @param smfn Start mfn
> + * @param emfn End mfn
> + */
> +void set_pdx_range(unsigned long smfn, unsigned long emfn);
> +
> +/**
> + * Invoked to determine if an mfn has an associated valid frame table entry
> + *
> + * In order for it to be legal it must pass bounds, grouping and
> + * compression sanity checks.
> + *
> + * @param mfn To-be-checked mfn
> + * @return True iff all checks pass
> + */
> +bool __mfn_valid(unsigned long mfn);
> +
> +#define page_to_pdx(pg)  ((pg) - frame_table)
> +#define pdx_to_page(pdx) gcc11_wrap(frame_table + (pdx))
> +
> +#define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
> +#define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
> +
> +extern unsigned long pfn_pdx_bottom_mask, ma_va_bottom_mask;
> +extern unsigned int pfn_pdx_hole_shift;
> +extern unsigned long pfn_hole_mask;
> +extern unsigned long pfn_top_mask, ma_top_mask;
> +
>  /**
>   * Validate a region's compatibility with the current compression runtime
>   *
> @@ -164,9 +190,6 @@ static inline unsigned long pdx_to_pfn(unsigned long pdx)
>             ((pdx << pfn_pdx_hole_shift) & pfn_top_mask);
>  }
>  
> -#define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
> -#define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
> -
>  /**
>   * Computes the offset into the direct map of an maddr
>   *
> -- 
> 2.34.1
The latest rebase messed up this patch. set_pdx_range(), __mfn_valid() and
the page_to_pdx()/pdx_to_page() macros should be removed in order for the
additions to make sense. Re-running GitLab with that now...

Alejandro




From xen-devel-bounces@lists.xenproject.org Mon Jul 17 16:24:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 16:24:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564772.882483 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLR1b-0001uN-Eu; Mon, 17 Jul 2023 16:24:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564772.882483; Mon, 17 Jul 2023 16:24:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLR1b-0001uG-BF; Mon, 17 Jul 2023 16:24:39 +0000
Received: by outflank-mailman (input) for mailman id 564772;
 Mon, 17 Jul 2023 16:24:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hD51=DD=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLR1Z-0001Me-Lv
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 16:24:37 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0630.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::630])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6c0936c3-24be-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 18:24:37 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VI1PR04MB7101.eurprd04.prod.outlook.com (2603:10a6:800:12e::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul
 2023 16:24:34 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023
 16:24:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6c0936c3-24be-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=QOi4TxYRDB94qwcMqYHebXsGLIDpjNf+vW/bVjIRsujJstQV8C0dSUH+7c3UF4y/g0ZsypHiG5F5kYy/BN2h6actjtNB+LEYEtZr+sSDPIgND6+5yIeUggv1o+MlBgAQEXzSYMMbMfSsM9lMTeRcig2ckFt9idAkBKi+XttDi+kh2bhqGn93SjNNqH8fkC6zpIidXNxXxpNcx3LXWhwzLBq7wGt3M0CNuMSHVOsVjn9HWM1xTJHbXXLcQxukm3T9gqQ458rJEi03UyOUVfVpjBnaFq3IE4FaMIhXWM0pnkvbasFa7IBLBZYamtL55ZfPlFT79J9LN8HOdTNpRAVW7g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=dL2eJQhfm87bvNPNP4TtVruaJ6w0fga5D8CfSX+4Mz0=;
 b=loNsMIGHh+lsUbpyHYtF/vznhM3migelvo8JlTjL9dXlNLQMRLQLEtlTdalPoURPC/QKco6W0rORgk7OmPMzxRbLDTHzyTLe8oCKyErU+v4xKFBIrmuuwp/DHDjdoZ5UgNj3/JpOfRhrFp0H1jEl6JDVkKHbUAfrUXCMPEInGPzkw03jr4VzTXLT6DnuftWgYeSeAKGpbSwYNFpgxZItIDilnljeaxE8iv1veylI26tUYplSzvxF7G4eAzvj49xYdXCpIopH6LQbidZnQ7cM8t+mEc7Q9J2isuf8GeiEJXxXn05hbB1SfM7vua5qDUZM4S9prG8hcL99via0bW/66g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=dL2eJQhfm87bvNPNP4TtVruaJ6w0fga5D8CfSX+4Mz0=;
 b=tc5xm13ckfqUxv8t3GDVE1ngGIDGp7MPO8Fw0gPY2312/27QOqKx479mjZ4fJzZY863ALOyt1z1rjxRvRbkKopnl4HV5sy6pfmX3ubG/dyRduJIBT3fI5WrjuFe51cftiM0xXDL5k8a8OMai0Mehd/GRSLD+VGVAKfUFMKXT36mEZKZPyN+sRB7ZXxU+IalI53Oo2sfENvOO3ZRs9fnkqUot6U+EOyuLCAl5XrwLa1wXowNtPccG58oxdcQGfUXIyG/b81+sRgji5GOdQDGP1Lu8G9vPkkmN7+wEjWCUV17L0tGmG/wL9Q7hP54358zIJ3MkbaVoL0pawdHlvr+mxQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <caa41c6d-6863-1e24-b3a7-58ac7c1a311b@suse.com>
Date: Mon, 17 Jul 2023 18:24:32 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 1/3] xen/ppc: Set up a basic C environment
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1688670018.git.sanastasio@raptorengineering.com>
 <8c79f498ffcb0837ff18640dbaf5b66f79186574.1688670018.git.sanastasio@raptorengineering.com>
 <7f6feb8b-29fe-7a7f-8965-20a12b4dfb25@suse.com>
 <dc64009d-53d5-6bd2-14ab-be2481523b0f@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <dc64009d-53d5-6bd2-14ab-be2481523b0f@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0086.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1f::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VI1PR04MB7101:EE_
X-MS-Office365-Filtering-Correlation-Id: abb4df33-30d1-4ffb-dc1b-08db86e24edb
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	iq6fHqNCvr1YxE4qflHbZotpWDQ6y/xUypd2jmW1VDDYsSRJFj+UWmHCQmkO9ULbtgpoO0N5OfHRKfuJOmAOjuqFWTcW+dhXY0x/Mgce/fMnNlNz81BMkcNboqWxcYSuwxsJkTgIcCF4xdAHrMnGJYqw6Gn/2YX9/KwEvO5/9VpZtQ3PrpoKUyRk9uGhWrHrN8CkcMj3v5PvPrQ1ErCHoJYQltLKHrdz/0L37SoszcFEfhUt8KMgRrOcpbSVmcgQbtfFfmOwAHx9bGypl5mR58qJORGAMJXrOA75ILz2jQHwwb6zQFk0fGny7x8QMb1ki01+R6HZnuQ1No6rtqShY7LECVWsUc0f9aovStRzUjua+36XoIBxmcl5zig2q86rRCxREdeb+1XqDmoF6H8eFL9G5mJls59kHs9CiTUPn863ws5ZEo2RfdZ/p7p7Vr0q2oY9YbLifNdmuhQQ/Vx+ArIMHbeoKaVf4JfkTTZISgXLfSQmc77uMGqyVSabhv39741p4G6aP+buq/ainj4jMGrV/5a2tQxMWTseB4jQPAEzJvrPYwkITixplv6iOzYxYVTVe2G9n+UptMhWTFCCDo330VZFExSDUAS6tLTrVXZQAiA7C1G1zQWG4bfdR8sky2Xq/mQ1T9PyuSD+RfxCrA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(39860400002)(366004)(376002)(396003)(346002)(451199021)(31686004)(31696002)(86362001)(2906002)(36756003)(6512007)(186003)(83380400001)(6506007)(53546011)(26005)(38100700002)(6486002)(54906003)(316002)(5660300002)(66476007)(6916009)(66946007)(66556008)(2616005)(4326008)(478600001)(41300700001)(8936002)(8676002)(45980500001)(43740500002);DIR:OUT;SFP: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SjFOQWFwaGdZ?=
 =?utf-8?B?OU54U0pNQ2pYRUNXZmFjd240WHBlQ2UrY3c2a3J1RFI4NkdwMkMxdmg2bGYy?=
 =?utf-8?B?WHNxUS96a2xzc0hHYjVTN0ZNN2I5bmxJRFY5VCs4ZVR5ZzNjZVFWTDVyVVQv?=
 =?utf-8?B?c1o2WnVrR0NLK1lZcTgzQzdJRUswOGRENDBMS2xuc1ZWK0RLOHBDNGFaTDhD?=
 =?utf-8?B?U28ySWZrNEl6cS9GT2dzL2VVOVBrVlJscGt5L3FML0pob0lsUHYyY2w0RUNl?=
 =?utf-8?B?b1dTVTFYOGNnZGhEajlKUktOMVdxbU1WbTFidTZpZkwvYy9WQmVuRTJORHVC?=
 =?utf-8?B?S004eU5Mc1FiY2JkMmVmWWJnTzBYSm02ODI0YWVzK0FRL2YrYm9RQlU1YVpj?=
 =?utf-8?B?VVdZc2h6SG9UTjJOVUp6ekpuRmZyV0NPT3VnWE1ZQVhGUzgrd2tvWjVsWENJ?=
 =?utf-8?Q?0YlfV74g+7HheqQgtriu/2scP?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: abb4df33-30d1-4ffb-dc1b-08db86e24edb
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 16:24:34.7745
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ATygnMQvrOzkVwzxzfEUf2nbdit8NxVbzXhhQ8DHd6byOjJbkjB85hurZuJE5RjIRzqJBT75K0OsVvQ5IqYenw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7101

On 17.07.2023 18:00, Shawn Anastasio wrote:
> On 7/17/23 10:38 AM, Jan Beulich wrote:
>> On 06.07.2023 21:04, Shawn Anastasio wrote:
>>> --- a/xen/arch/ppc/include/asm/config.h
>>> +++ b/xen/arch/ppc/include/asm/config.h
>>> @@ -43,7 +43,7 @@
>>>  
>>>  #define SMP_CACHE_BYTES (1 << 6)
>>>  
>>> -#define STACK_ORDER 2
>>> +#define STACK_ORDER 0
>>>  #define STACK_SIZE  (PAGE_SIZE << STACK_ORDER)
>>
>> In which way is this related to the change at hand? Aren't you going to
>> need to undo this rather sooner than later?
> 
> I noticed the stack order being too large when I moved the stack
> declaration to .c per Andrew's recommendation for v2. Since we're using
> 64k pages, I don't see why the stack would need to be this big. A quick
> look at ARM shows they have a stack order of 3, which would yield a
> stack size of just 32k.

Oh, I forgot page size is 64k. May I suggest to have a BUILD_BUG_ON()
somewhere, such that switching to e.g. 4k pages (the need for which
cannot be ruled out yet) will make obvious that an adjustment is
necessary. (Alternatively accommodate this case here right away.)

>>> --- a/xen/arch/ppc/ppc64/head.S
>>> +++ b/xen/arch/ppc/ppc64/head.S
>>> @@ -1,30 +1,30 @@
>>>  /* SPDX-License-Identifier: GPL-2.0-or-later */
>>>  
>>> +#include <asm/asm-defns.h>
>>> +
>>>      .section .text.header, "ax", %progbits
>>>  
>>>  ENTRY(start)
>>>      /*
>>> -     * Depending on how we were booted, the CPU could be running in either
>>> -     * Little Endian or Big Endian mode. The following trampoline from Linux
>>> -     * cleverly uses an instruction that encodes to a NOP if the CPU's
>>> -     * endianness matches the assumption of the assembler (LE, in our case)
>>> -     * or a branch to code that performs the endian switch in the other case.
>>> +     * NOTE: argument registers (r3-r9) must be preserved until the C entrypoint
>>>       */
>>> -    tdi 0, 0, 0x48    /* Reverse endian of b . + 8          */
>>> -    b . + 44          /* Skip trampoline if endian is good  */
>>> -    .long 0xa600607d  /* mfmsr r11                          */
>>> -    .long 0x01006b69  /* xori r11,r11,1                     */
>>> -    .long 0x00004039  /* li r10,0                           */
>>> -    .long 0x6401417d  /* mtmsrd r10,1                       */
>>> -    .long 0x05009f42  /* bcl 20,31,$+4                      */
>>> -    .long 0xa602487d  /* mflr r10                           */
>>> -    .long 0x14004a39  /* addi r10,r10,20                    */
>>> -    .long 0xa6035a7d  /* mtsrr0 r10                         */
>>> -    .long 0xa6037b7d  /* mtsrr1 r11                         */
>>> -    .long 0x2400004c  /* rfid                               */
>>> -
>>> -    /* Now that the endianness is confirmed, continue */
>>> -1:  b 1b
>>> +    FIXUP_ENDIAN
>>> +
>>> +    /* set up the TOC pointer */
>>> +    LOAD_IMM32(%r2, .TOC.)
>>> +
>>> +    /* set up the initial stack */
>>> +    LOAD_IMM32(%r1, cpu0_boot_stack)
>>
>> Wouldn't this (and perhaps also .TOC.) better be calculated in a
>> PC-relative manner? Or is the plan to have Xen linked to an address
>> below 4Gb?
> 
> As mentioned previously, I am planning to enable the PIC code model in
> my next series in order to accommodate booting on the PowerNV firmware
> type which has a different load address. That patch will change the
> initial TOC load to a simulated PC-relative one (pre-POWER10 doesn't
> have proper PC-relative loads/stores) and the rest to TOC-relative.

Okay. Perhaps worth mentioning in the description, so the question
won't need asking again. What about addresses being confined to 32
bits, though?

>>> --- /dev/null
>>> +++ b/xen/arch/ppc/setup.c
>>> @@ -0,0 +1,19 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-or-later */
>>> +#include <xen/init.h>
>>> +
>>> +/* Xen stack for bringing up the first CPU. */
>>> +unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZE);
>>
>> This yields the entire array as zero-initialized. At which point I
>> don't see a need for the store in head.S.
> 
> Okay, fair enough. Given that the array is zero-initialized the stdu
> could be replaced with an `addi %r1, %r1, -STACK_FRAME_OVERHEAD`, and
> the load of zero to %r11 could be deferred to the second patch in this
> series where it's used in the .bss clearing loop.
> 
> That said I don't really see the harm with keeping the standard
> idiomatic `stdu` for the initial stack frame setup. Other than
> performance, which isn't a concern here in early setup code.

I'm not going to insist that you switch, but as you can see this can
raise questions.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 16:30:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 16:30:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564778.882493 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLR7E-0003Y0-4y; Mon, 17 Jul 2023 16:30:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564778.882493; Mon, 17 Jul 2023 16:30:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLR7E-0003Xt-0K; Mon, 17 Jul 2023 16:30:28 +0000
Received: by outflank-mailman (input) for mailman id 564778;
 Mon, 17 Jul 2023 16:30:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLR7D-0003Xi-B6; Mon, 17 Jul 2023 16:30:27 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLR7D-0004uq-22; Mon, 17 Jul 2023 16:30:27 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLR7C-0004PG-MK; Mon, 17 Jul 2023 16:30:26 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLR7C-0000wU-Lp; Mon, 17 Jul 2023 16:30:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=R2Hke1LtoLiYXJHUDmO5DeSRldRijNUVM3oYSE+oGvU=; b=InDJxo5iDIjvOWy4fgeSGMfDOB
	AvQ6MxCwcHRwFr3QjcubnqgYIHlBZbpxl/X8+CMybot3GSPch5pl7vfYzILWmpJBWr/bA0Fn2fXR9
	h0l6Iz9mUYSoFUOIqH7gGzcfXUTfa1KNy3HQH26q5oPkYLEgcyycOo8Fnwg8TfQcFs/Y=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181831-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.16-testing test] 181831: regressions - trouble: fail/pass/starved
X-Osstest-Failures:
    xen-4.16-testing:test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-install:fail:regression
    xen-4.16-testing:test-amd64-i386-xl-qemuu-ws16-amd64:xen-install:fail:heisenbug
    xen-4.16-testing:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt:hosts-allocate:starved:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt-qcow2:hosts-allocate:starved:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-arndale:hosts-allocate:starved:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-vhd:hosts-allocate:starved:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt-raw:hosts-allocate:starved:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl:hosts-allocate:starved:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-credit1:hosts-allocate:starved:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-credit2:hosts-allocate:starved:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-multivcpu:hosts-allocate:starved:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-rtds:hosts-allocate:starved:nonblocking
X-Osstest-Versions-This:
    xen=606331e6562f7b64ef0be1fd2596423c0ae209da
X-Osstest-Versions-That:
    xen=b0806d84d48d983d40a29534e663652887287a78
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 17 Jul 2023 16:30:26 +0000

flight 181831 xen-4.16-testing real [real]
flight 181848 xen-4.16-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181831/
http://logs.test-lab.xenproject.org/osstest/logs/181848/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict 7 xen-install fail REGR. vs. 180918

Tests which are failing intermittently (not blocking):
 test-amd64-i386-xl-qemuu-ws16-amd64  7 xen-install  fail pass in 181848-retest

Tests which did not succeed, but are not blocking:
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop   fail in 181848 like 180918
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180918
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180918
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180918
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 180918
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180918
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180918
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 180918
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 180918
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt      3 hosts-allocate               starved  n/a
 test-armhf-armhf-libvirt-qcow2  3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-arndale   3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-vhd       3 hosts-allocate               starved  n/a
 test-armhf-armhf-libvirt-raw  3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl           3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-credit1   3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-credit2   3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-multivcpu  3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-rtds      3 hosts-allocate               starved  n/a

version targeted for testing:
 xen                  606331e6562f7b64ef0be1fd2596423c0ae209da
baseline version:
 xen                  b0806d84d48d983d40a29534e663652887287a78

Last test of basis   180918  2023-05-23 13:08:46 Z   55 days
Testing same since   181831  2023-07-17 06:36:55 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alejandro Vallejo <alejandro.vallejo@cloud.com>
  Anthony PERARD <anthony.perard@citrix.com>
  Olaf Hering <olaf@aepfle.de>
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          starved 
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  starved 
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  starved 
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  starved 
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         fail    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     starved 
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                starved 
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               starved 
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 starved 
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     starved 
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      starved 
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 606331e6562f7b64ef0be1fd2596423c0ae209da
Author: Roger Pau MonnÃ© <roger.pau@citrix.com>
Date:   Mon Jul 17 08:34:33 2023 +0200

    iommu/amd-vi: fix checking for Invalidate All support in amd_iommu_resume()
    
    The iommu local variable does not point to to a valid amd_iommu element
    after the call to for_each_amd_iommu().  Instead check whether any IOMMU
    on the system doesn't support Invalidate All in order to perform the
    per-domain and per-device flushes.
    
    Fixes: 9c46139de889 ('amd iommu: Support INVALIDATE_IOMMU_ALL command.')
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5ecbb779748a56495f2c892f0610d57dd623c7cd
    master date: 2023-06-13 14:41:32 +0200

commit d3065bf0a83e02032d0900566fa8605d8865073d
Author: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Date:   Mon Jul 17 08:34:11 2023 +0200

    x86/microcode: Add missing unlock in microcode_update_helper()
    
    microcode_update_helper() may return early while holding
    cpu_add_remove_lock, hence preventing any writers from taking it again.
    
    Leave through the `put` label instead so it's properly released.
    
    Fixes: 5ed12565aa32 ("microcode: rendezvous CPUs in NMI handler and load ucode")
    Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: b35b22acb887f682efe8385b3df165220bc84c86
    master date: 2023-06-05 16:11:10 +0100

commit c15221e45c0ffafdbb9faafd1a07ffb054b2cde3
Author: Roger Pau MonnÃ© <roger.pau@citrix.com>
Date:   Mon Jul 17 08:32:34 2023 +0200

    vpci/header: cope with devices not having vpci allocated
    
    When traversing the list of pci devices assigned to a domain cope with
    some of them not having the vpci struct allocated. It should be
    possible for the hardware domain to have read-only devices assigned
    that are not handled by vPCI, such support will be added by further
    patches.
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: ee045f3a4a6dddb09f5aa96a50cceaae97d3245f
    master date: 2023-05-26 09:18:37 +0200

commit c9c8b20ebcb5a75b40da34f541ff226cac70dd22
Author: Olaf Hering <olaf@aepfle.de>
Date:   Mon Jul 17 08:32:19 2023 +0200

    tools: convert bitfields to unsigned type
    
    clang complains about the signed type:
    
    implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
    
    Backport: Dropped the libxenvchan change, for the original commit saying
    
    "The potential ABI change in libxenvchan is covered by the Xen version
     based SONAME."
    
    which won't hold on stable trees.
    master commit: 99ab02f63ea813f2e467a39a7736bf460a3f3495
    master date: 2023-05-16 20:03:02 +0100
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 16:55:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 16:55:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564792.882506 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLRVF-0006MF-7R; Mon, 17 Jul 2023 16:55:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564792.882506; Mon, 17 Jul 2023 16:55:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLRVF-0006M8-4F; Mon, 17 Jul 2023 16:55:17 +0000
Received: by outflank-mailman (input) for mailman id 564792;
 Mon, 17 Jul 2023 16:55:16 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLRVE-0006Lx-8O; Mon, 17 Jul 2023 16:55:16 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLRVE-0005Sp-7Y; Mon, 17 Jul 2023 16:55:16 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLRVE-0005uB-0e; Mon, 17 Jul 2023 16:55:16 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLRVE-0008Ed-08; Mon, 17 Jul 2023 16:55:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=RCVvgZBJH8otjTO/q7jpa2wfnP/j0xmdyyydPFafNgg=; b=WiZPw2YGBLRegLRWWwcvaHP25s
	l9RL+nqi24YQWYoNkHiNxYNlsiQIwcgTe47S/ts6htY1d4/jGfsPkyg+vBklAY33yeNMWgO0I2VZy
	mj77SaMGUjmT38ORsrXtyow1kNcRbSckZsgBUVuvbF0nAcPpnLixJRhFcLFyTZ0daKP4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181842-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181842: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=e04cc8a08df3574bd7d5f7860008f1625e28f8b1
X-Osstest-Versions-That:
    xen=813da5f0e73b8cbd2ac3c7922506e58c28cd736d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 17 Jul 2023 16:55:16 +0000

flight 181842 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181842/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  e04cc8a08df3574bd7d5f7860008f1625e28f8b1
baseline version:
 xen                  813da5f0e73b8cbd2ac3c7922506e58c28cd736d

Last test of basis   181835  2023-07-17 09:01:59 Z    0 days
Testing same since   181842  2023-07-17 12:01:58 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Julien Grall <jgrall@amazon.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   813da5f0e7..e04cc8a08d  e04cc8a08df3574bd7d5f7860008f1625e28f8b1 -> smoke


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 18:33:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 18:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564815.882521 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLT1f-0000gr-1P; Mon, 17 Jul 2023 18:32:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564815.882521; Mon, 17 Jul 2023 18:32:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLT1e-0000gk-UI; Mon, 17 Jul 2023 18:32:50 +0000
Received: by outflank-mailman (input) for mailman id 564815;
 Mon, 17 Jul 2023 18:32:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=OuH4=DD=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qLT1d-0000ge-CE
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 18:32:49 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 50dff741-24d0-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 20:32:47 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id B71B2828553E;
 Mon, 17 Jul 2023 13:32:41 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id kGNqfTIEOa3t; Mon, 17 Jul 2023 13:32:36 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id D51F7828554F;
 Mon, 17 Jul 2023 13:32:36 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id H8uGhZsZUwB9; Mon, 17 Jul 2023 13:32:36 -0500 (CDT)
Received: from [10.11.0.2] (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id E5C09828553E;
 Mon, 17 Jul 2023 13:32:35 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 50dff741-24d0-11ee-b23a-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com D51F7828554F
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1689618756; bh=51UpnSRCW6jh/dVXIZm6T1eerOBoBwe6mbLBAvYjTfk=;
	h=Message-ID:Date:MIME-Version:To:From;
	b=aitt1+gHNC849ds3/jwctaA6kZ3dvwDzm25NVT2J6xKts0dB0R1Hk3ZXdzvVpLtp/
	 fF6ejQUPVNl6ty4hjiteh43TWcLCoqYCzyq/0fnmcKlbP6nAoZidGeV1pkpP+rNAJU
	 pbe3kpOHNVOe2BK6+MsKtvlITLejldgKqy1jRY2s=
X-Virus-Scanned: amavisd-new at rptsys.com
Message-ID: <2fa2837d-37f4-aa28-6ca8-2e28b6f44181@raptorengineering.com>
Date: Mon, 17 Jul 2023 13:32:35 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v3 2/3] xen/ppc: Implement early serial printk on pseries
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1688670018.git.sanastasio@raptorengineering.com>
 <85172d385a730e196999b366207e2b2e8a261906.1688670018.git.sanastasio@raptorengineering.com>
 <aa58706f-5033-ef33-5202-bcc418bedb86@suse.com>
From: Shawn Anastasio <sanastasio@raptorengineering.com>
In-Reply-To: <aa58706f-5033-ef33-5202-bcc418bedb86@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 7/17/23 11:17 AM, Jan Beulich wrote:
> On 06.07.2023 21:04, Shawn Anastasio wrote:
>> --- a/xen/arch/ppc/Makefile
>> +++ b/xen/arch/ppc/Makefile
>> @@ -1,5 +1,7 @@
>>  obj-$(CONFIG_PPC64) += ppc64/
>>  
>> +obj-y += boot-of.init.o
>> +obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
> 
> While in this case I could accept the name as is to be the same as Arm's,
> as said before it would be nice if new files could avoid underscores (and
> use dashes instead) unless strictly required by something.
> 
> Also, with boot-of.c using early_printk.c, shouldn't the latter also
> build into early_printk.init.o?

Yes, good point. I'll change it to early_printk.init.o.

>> --- /dev/null
>> +++ b/xen/arch/ppc/boot-of.c
>> @@ -0,0 +1,100 @@
>> +/* SPDX-License-Identifier: GPL-2.0-or-later */
>> +/*
>> + * Copyright IBM Corp. 2005, 2006, 2007
> 
> Judging from the years the file was taken from somewhere. Is the license
> there permitting "2.0 or later"? (For files [partly] taken from somewhere,
> a clarification as to the originals' licenses would be helpful to have in
> the description, or maybe in the post-commit-message area.)

The original license of the file that this was derived from
(xen/arch/powerpc/boot_of.c from Xen 3.2) is GPL v2.0 or later.

In any case where I'm deriving code from existing files, I'm always
using the original license of the derived code. Should I still clarify
this in the header comment?

>> + * Copyright Raptor Engineering, LLC
>> + *
>> + * Authors: Jimi Xenidis <jimix@watson.ibm.com>
>> + *          Hollis Blanchard <hollisb@us.ibm.com>
>> + *          Shawn Anastasio <sanastasio@raptorengineering.com>
>> + */
>> +
>> +#include <xen/init.h>
>> +#include <xen/stdarg.h>
>> +#include <xen/types.h>
>> +#include <asm/boot.h>
>> +#include <asm/byteorder.h>
>> +#include <asm/early_printk.h>
>> +
>> +#define ADDR(x) (uint32_t)(unsigned long)(x)
> 
> Besides needing to be wrapped in parentheses, this likely needs a comment:
> It is hard to see how in 64-bit code uint32_t can suffice as an address.
> Unless (see the question on patch 1) you intend to link/run Xen at an
> address firmly below 4Gb, now and going forward.

Calls to the Open Firmware client interface necessitate that the CPU be
running with both the MMU off and in 32-bit mode (MSR_SF unset).
Obviously these two criteria will not always be true for Xen itself, but
we can guarantee that Xen's physical address lies below 4GB. In fact,
the mere act of being booted by Open Firmware should guarantee that this
is the case.

This also came up earlier, but the Open Firmware interface will only
need to be used during early boot. Once the MMU is up it shouldn't be
necessary to use it, but if it does end up being required this could be
changed to use __pa() or equivalent (plus the uint32_t cast).

I'll definitely add a comment explaining the situation, as well as the
extra parenthesis.

>> +/* OF entrypoint*/
>> +static unsigned long __initdata of_vec;
>> +
>> +/* OF device handles*/
>> +static int __initdata bof_chosen;
>> +static int __initdata of_out;
>> +
>> +static int __init of_call(const char *service, uint32_t nargs, uint32_t nrets,
>> +                   int32_t rets[], ...)
> 
> Nit: Indentation.

Will fix.

>> +{
>> +    int rc;
>> +    va_list args;
>> +    int i;
> 
> unsigned int?

I might as well change it to uint32_t to be in line with nargs.

> 
>> +    struct of_service s = { 0 };
>> +
>> +    s.ofs_service = cpu_to_be32(ADDR(service));
>> +    s.ofs_nargs = cpu_to_be32(nargs);
>> +    s.ofs_nrets = cpu_to_be32(nrets);
>> +
>> +    /* copy all the params into the args array */
> 
> Nit: Style (comments want to start with a capital letter). Again below.

Will fix.

>> +    va_start(args, rets);
>> +
>> +    for ( i = 0; i < nargs; i++ )
>> +        s.ofs_args[i] = cpu_to_be32(va_arg(args, uint32_t));
>> +
>> +    va_end(args);
>> +
>> +    rc = enter_of(&s, of_vec);
>> +
>> +    /* copy all return values to the output rets array */
>> +    for ( i = 0; i < nrets; i++ )
>> +        rets[i] = be32_to_cpu(s.ofs_args[i + nargs]);
>> +
>> +    return rc;
>> +}
>> +
>> +static int __init of_finddevice(const char *devspec)
>> +{
>> +    int rets[1] = { OF_FAILURE };
> 
> Hmm, of_call() uses int32_t. Again below several times.

Good catch. I'll switch all of these to int32_t for consistency.

> 
>> +    of_call("finddevice", 1, 1, rets, devspec);
> 
> This could do with using ARRAY_SIZE(rets). Same again below.

Sure, will do this.

> Also don't you need to wrap devspec in ADDR()? Similar issues
> then again below.

Yes, good catch. I'll fix this and the other bare pointers.

>> +    return rets[0];
>> +}
>> +
>> +static int __init of_getprop(int ph, const char *name, void *buf, uint32_t buflen)
>> +{
>> +    int rets[1] = { OF_FAILURE };
>> +
>> +    of_call("getprop", 4, 1, rets, ph, ADDR(name), buf, buflen);
>> +    return rets[0];
>> +}
>> +
>> +int __init of_write(int ih, const char *addr, uint32_t len)
>> +{
>> +    int rets[1] = { OF_FAILURE };
>> +
>> +    of_call("write", 3, 1, rets, ih, addr, len);
>> +    return rets[0];
>> +}
>> +
>> +static void __init of_putchar(char c)
>> +{
>> +    if ( c == '\n' )
>> +    {
>> +        char buf = '\r';
>> +        of_write(of_out, &buf, 1);
>> +    }
>> +    of_write(of_out, &c, 1);
>> +}
>> +
>> +void __init boot_of_init(unsigned long vec)
>> +{
>> +    of_vec = vec;
>> +
>> +    /* Get a handle to the default console */
>> +    bof_chosen = of_finddevice("/chosen");
>> +    of_getprop(bof_chosen, "stdout", &of_out, sizeof(of_out));
>> +    of_out = be32_to_cpu(of_out);
>> +
>> +    early_printk_init(of_putchar);
>> +}
> 
> Considering that bof_chosen is used just here, why does it need to be
> a file-scope variable?

Good point. The original code had it as a file-scope variable to be used
by other routines, but I've pruned them from this version which only
does the bare-minimum required for console printing. I'll change this to
a function-scoped variable.

>> --- /dev/null
>> +++ b/xen/arch/ppc/early_printk.c
>> @@ -0,0 +1,28 @@
>> +/* SPDX-License-Identifier: GPL-2.0-only */
>> +#include <xen/init.h>
>> +#include <asm/boot.h>
>> +
>> +static void (*putchar_func)(char);
> 
> __initdata? (Connected to the question of building into .init.o.)

Since I'm going to change this to build to .init.o, would this
automatically be put into the correct .init section? Would it still be
preferable style-wise to mark it as __initdata?

>> --- /dev/null
>> +++ b/xen/arch/ppc/include/asm/processor.h
>> @@ -0,0 +1,139 @@
>> +/* SPDX-License-Identifier: GPL-2.0-or-later */
>> +/*
>> + * Copyright IBM Corp. 2005, 2006, 2007
>> + * Copyright Raptor Engineering, LLC
>> + *
>> + * Authors: Hollis Blanchard <hollisb@us.ibm.com>
>> + *          Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
>> + *          Timothy Pearson <tpearson@raptorengineering.com>
>> + *          Shawn Anastasio <sanastasio@raptorengineering.com>
>> + */
>> +
>> +#ifndef _ASM_PPC_PROCESSOR_H
>> +#define _ASM_PPC_PROCESSOR_H
>> +
>> +#include <xen/config.h>
> 
> No need to - this is force-included by the Makefile machinery.

Ah, thanks. I'll remove this.

>> +#include <xen/types.h>
> 
> Note this. Why ...

See below

> 
>> +#define IOBMP_BYTES          8192
>> +#define IOBMP_INVALID_OFFSET 0x8000
>> +
>> +/* Processor Version Register (PVR) field extraction */
>> +
>> +#define PVR_VER(pvr) (((pvr) >> 16) & 0xFFFF) /* Version field */
>> +#define PVR_REV(pvr) (((pvr) >> 0) & 0xFFFF)  /* Revison field */
>> +
>> +#define __is_processor(pv) (PVR_VER(mfspr(SPRN_PVR)) == (pv))
>> +
>> +/*
>> + * IBM has further subdivided the standard PowerPC 16-bit version and
>> + * revision subfields of the PVR for the PowerPC 403s into the following:
>> + */
>> +
>> +#define PVR_FAM(pvr)  (((pvr) >> 20) & 0xFFF) /* Family field */
>> +#define PVR_MEM(pvr)  (((pvr) >> 16) & 0xF)   /* Member field */
>> +#define PVR_CORE(pvr) (((pvr) >> 12) & 0xF)   /* Core field */
>> +#define PVR_CFG(pvr)  (((pvr) >> 8) & 0xF)    /* Configuration field */
>> +#define PVR_MAJ(pvr)  (((pvr) >> 4) & 0xF)    /* Major revision field */
>> +#define PVR_MIN(pvr)  (((pvr) >> 0) & 0xF)    /* Minor revision field */
>> +
>> +/* Processor Version Numbers */
>> +
>> +#define PVR_403GA    0x00200000
>> +#define PVR_403GB    0x00200100
>> +#define PVR_403GC    0x00200200
>> +#define PVR_403GCX   0x00201400
>> +#define PVR_405GP    0x40110000
>> +#define PVR_STB03XXX 0x40310000
>> +#define PVR_NP405H   0x41410000
>> +#define PVR_NP405L   0x41610000
>> +#define PVR_601      0x00010000
>> +#define PVR_602      0x00050000
>> +#define PVR_603      0x00030000
>> +#define PVR_603e     0x00060000
>> +#define PVR_603ev    0x00070000
>> +#define PVR_603r     0x00071000
>> +#define PVR_604      0x00040000
>> +#define PVR_604e     0x00090000
>> +#define PVR_604r     0x000A0000
>> +#define PVR_620      0x00140000
>> +#define PVR_740      0x00080000
>> +#define PVR_750      PVR_740
>> +#define PVR_740P     0x10080000
>> +#define PVR_750P     PVR_740P
>> +#define PVR_7400     0x000C0000
>> +#define PVR_7410     0x800C0000
>> +#define PVR_7450     0x80000000
>> +#define PVR_8540     0x80200000
>> +#define PVR_8560     0x80200000
>> +/*
>> + * For the 8xx processors, all of them report the same PVR family for
>> + * the PowerPC core. The various versions of these processors must be
>> + * differentiated by the version number in the Communication Processor
>> + * Module (CPM).
>> + */
>> +#define PVR_821  0x00500000
>> +#define PVR_823  PVR_821
>> +#define PVR_850  PVR_821
>> +#define PVR_860  PVR_821
>> +#define PVR_8240 0x00810100
>> +#define PVR_8245 0x80811014
>> +#define PVR_8260 PVR_8240
>> +
>> +/* 64-bit processors */
>> +#define PVR_NORTHSTAR 0x0033
>> +#define PVR_PULSAR    0x0034
>> +#define PVR_POWER4    0x0035
>> +#define PVR_ICESTAR   0x0036
>> +#define PVR_SSTAR     0x0037
>> +#define PVR_POWER4p   0x0038
>> +#define PVR_970       0x0039
>> +#define PVR_POWER5    0x003A
>> +#define PVR_POWER5p   0x003B
>> +#define PVR_970FX     0x003C
>> +#define PVR_POWER6    0x003E
>> +#define PVR_POWER7    0x003F
>> +#define PVR_630       0x0040
>> +#define PVR_630p      0x0041
>> +#define PVR_970MP     0x0044
>> +#define PVR_970GX     0x0045
>> +#define PVR_POWER7p   0x004A
>> +#define PVR_POWER8E   0x004B
>> +#define PVR_POWER8NVL 0x004C
>> +#define PVR_POWER8    0x004D
>> +#define PVR_POWER9    0x004E
>> +#define PVR_POWER10   0x0080
>> +#define PVR_BE        0x0070
>> +#define PVR_PA6T      0x0090
>> +
>> +/* Macro to adjust thread priority for hardware multithreading */
>> +#define HMT_very_low()  asm volatile (" or %r31, %r31, %r31 ")
>> +
>> +#ifndef __ASSEMBLY__
>> +
>> +#include <xen/types.h>
> 
> ... another time here? Or is the first one perhaps too early?

Yes, the first include was a mistake -- this is the intended location.
Will fix.

> 
>> +/* User-accessible registers: nost of these need to be saved/restored
>> + * for every nested Xen invocation. */
> 
> Nit: Comment style. Multi-line comments want to be
> 
> /*
>  * User-accessible registers: most of these need to be saved/restored
>  * for every nested Xen invocation.
>  */
> 
> (also note the s/nost/most/ I did)

Will fix.

> 
>> --- a/xen/arch/ppc/ppc64/head.S
>> +++ b/xen/arch/ppc/ppc64/head.S
>> @@ -18,6 +18,15 @@ ENTRY(start)
>>      li %r11, 0
>>      stdu %r11, -STACK_FRAME_OVERHEAD(%r1)
>>  
>> +    /* clear .bss */
>> +    LOAD_IMM32(%r14, __bss_start)
>> +    LOAD_IMM32(%r15, __bss_end)
> 
> Question regarding addressing again.

Hopefully the above explanation answered your questions, but just to
summarize: Xen will always reside within the first 4G of physical
address space.

Also, as mentioned in your review of patch 1/3, this will soon be
changed to use TOC-relative addressing instead of immediate addressing.

> 
>> --- /dev/null
>> +++ b/xen/arch/ppc/ppc64/of-call.S
>> @@ -0,0 +1,83 @@
>> +/* SPDX-License-Identifier: GPL-2.0-or-later */
>> +/*
>> + * Adapted from Linux's arch/powerpc/kernel/entry_64.S, with the
>> + * following copyright notice:
>> + *
>> + *  PowerPC version
>> + *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
>> + *  Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
>> + *    Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
>> + *  Adapted for Power Macintosh by Paul Mackerras.
>> + *  Low-level exception handlers and MMU support
>> + *  rewritten by Paul Mackerras.
>> + *    Copyright (C) 1996 Paul Mackerras.
>> + *  MPC8xx modifications Copyright (C) 1997 Dan Malek (dmalek@jlc.net).
>> + */
>> +
>> +#include <asm/asm-offsets.h>
>> +#include <asm/asm-defns.h>
>> +#include <asm/msr.h>
>> +
>> +/* size of minimum stack frame that can hold an entire cpu_user_regs struct */
>> +#define STACK_SWITCH_FRAME_SIZE UREGS_sizeof
>> +
>> +    .section .init.text, "ax", @progbits
>> +
>> +ENTRY(enter_of)
>> +    mflr %r0
>> +    std %r0, 16(%r1)
>> +    stdu %r1,-STACK_SWITCH_FRAME_SIZE(%r1) /* Save SP and create stack space */
>> +
>> +    /*
>> +     * Because PROM is running in 32b mode, it clobbers the high order half
>> +     * of all registers that it saves.  We therefore save those registers
>> +     * PROM might touch to the stack.  (%r0, %r3-%r13 are caller saved)
>> +     */
>> +    SAVE_GPR(2, %r1)
>> +    SAVE_GPR(13, %r1)
>> +    SAVE_NVGPRS(%r1)
>> +    mfcr %r10
>> +    mfmsr %r11
>> +    std %r10, UREGS_cr(%r1)
>> +    std %r11, UREGS_msr(%r1)
>> +
>> +    /* Put PROM address in SRR0 */
>> +    mtsrr0 %r4
>> +
>> +    /* Setup our trampoline return addr in LR */
>> +    bcl 20, 31,.+4
>> +0:  mflr %r4
>> +    addi %r4, %r4,(1f - 0b)
> 
> Nit: Missing blank after last comma. I also wonder whether the parentheses
> are doing any good here.

Will fix the blank. The parentheses here are also unnecessary, so I can
remove them.

> Jan

Thanks,
Shawn


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 18:41:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 18:41:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564818.882532 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLT9W-0002Gg-RQ; Mon, 17 Jul 2023 18:40:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564818.882532; Mon, 17 Jul 2023 18:40:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLT9W-0002GZ-OT; Mon, 17 Jul 2023 18:40:58 +0000
Received: by outflank-mailman (input) for mailman id 564818;
 Mon, 17 Jul 2023 18:40:58 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=OuH4=DD=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qLT9W-0002GT-B9
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 18:40:58 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 777d6123-24d1-11ee-b23a-6b7b168915f2;
 Mon, 17 Jul 2023 20:40:57 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 3441B8285276;
 Mon, 17 Jul 2023 13:40:56 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id lBgqF4VjJr-Q; Mon, 17 Jul 2023 13:40:55 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 8C8CB8285369;
 Mon, 17 Jul 2023 13:40:55 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id urAnRz0L1yQL; Mon, 17 Jul 2023 13:40:55 -0500 (CDT)
Received: from [10.11.0.2] (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 175CD8285276;
 Mon, 17 Jul 2023 13:40:55 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 777d6123-24d1-11ee-b23a-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 8C8CB8285369
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1689619255; bh=ytMlalgUdh22Dcv879tSLhGfuYKmeqRGZBjRsBHDBk0=;
	h=Message-ID:Date:MIME-Version:From:To;
	b=NQGmforffxUHqNSIKExKxiqkQP9MbYZSzOy5eeM7lE0Xg6W984cC/vpVjOTzqIyIM
	 BVzBaN2y7S/y5wVg+joDM80HlClc5V+unQGWuT22RcSPfI96HS++4Jl4zbTGExJNMp
	 OPVsi2hrmHj2Y6JVejC3HhnfdJ6xq10v+boXi9/c=
X-Virus-Scanned: amavisd-new at rptsys.com
Message-ID: <7e01fe7f-59ee-1fb3-fb9f-8013491b72a3@raptorengineering.com>
Date: Mon, 17 Jul 2023 13:40:54 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v3 2/3] xen/ppc: Implement early serial printk on pseries
Content-Language: en-US
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1688670018.git.sanastasio@raptorengineering.com>
 <85172d385a730e196999b366207e2b2e8a261906.1688670018.git.sanastasio@raptorengineering.com>
 <aa58706f-5033-ef33-5202-bcc418bedb86@suse.com>
 <2fa2837d-37f4-aa28-6ca8-2e28b6f44181@raptorengineering.com>
In-Reply-To: <2fa2837d-37f4-aa28-6ca8-2e28b6f44181@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Quick followup,

On 7/17/23 1:32 PM, Shawn Anastasio wrote:
> On 7/17/23 11:17 AM, Jan Beulich wrote:
>> This could do with using ARRAY_SIZE(rets). Same again below.
> 
> Sure, will do this.

ARRAY_SIZE is defined in <xen/lib.h> which can't yet be included due to
missing headers. I could copy its definition into this file along with a
TODO comment to fix it once the include works.

If I were to go down that route, I'd also probably not include the
__must_be_array assertion and related machinery that the <xen/lib.h>
version has, since it'd require a large portion of <xen/lib.h> to be
copy/pasted.


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 19:17:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 19:17:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564822.882542 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLTiY-00061C-Hl; Mon, 17 Jul 2023 19:17:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564822.882542; Mon, 17 Jul 2023 19:17:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLTiY-000615-Em; Mon, 17 Jul 2023 19:17:10 +0000
Received: by outflank-mailman (input) for mailman id 564822;
 Mon, 17 Jul 2023 19:17:09 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLTiX-00060v-KZ; Mon, 17 Jul 2023 19:17:09 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLTiX-0000cN-9L; Mon, 17 Jul 2023 19:17:09 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLTiX-000430-2m; Mon, 17 Jul 2023 19:17:09 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLTiX-0007c1-2G; Mon, 17 Jul 2023 19:17:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ZMkU/fCWIPsdtHPNkfwJd/e+nthijGKisCnvgwgL04Y=; b=mrAGjLxUKTJ9l9BFItOUQoWdlq
	CoNfx0OrWwUsO26C5u6oPhNFcLcMUYQnYde8Az1lrvL0cMAsTcMg28iMYzvtj0IeP42UZ6Kfwghy3
	Ecl324SwIz3H2adu2YPduDS9a4CWvHMBBe+MQTF16/HWdo7B/NF6WwqObfo7JmEUbPmA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181822-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181822: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-amd:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-credit1:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=b6e6cc1f78c772e952495b7416c9ac9029f9390c
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 17 Jul 2023 19:17:09 +0000

flight 181822 linux-linus real [real]
flight 181853 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181822/
http://logs.test-lab.xenproject.org/osstest/logs/181853/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-pvhv2-amd 20 guest-localmigrate/x10 fail pass in 181853-retest
 test-amd64-amd64-xl-credit1 22 guest-start/debian.repeat fail pass in 181853-retest
 test-amd64-amd64-xl-qemuu-ovmf-amd64 18 guest-localmigrate/x10 fail pass in 181853-retest
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 18 guest-localmigrate/x10 fail pass in 181853-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                b6e6cc1f78c772e952495b7416c9ac9029f9390c
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   91 days
Failing since        180281  2023-04-17 06:24:36 Z   91 days  178 attempts
Testing same since   181822  2023-07-15 12:41:27 Z    2 days    1 attempts

------------------------------------------------------------
3771 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 628948 lines long.)


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 20:41:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 20:41:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564840.882555 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLV1f-0007eA-Px; Mon, 17 Jul 2023 20:40:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564840.882555; Mon, 17 Jul 2023 20:40:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLV1f-0007e3-NI; Mon, 17 Jul 2023 20:40:59 +0000
Received: by outflank-mailman (input) for mailman id 564840;
 Mon, 17 Jul 2023 20:40:59 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qLV1e-0007dv-UP
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 20:40:58 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLV1d-0002hN-WF; Mon, 17 Jul 2023 20:40:58 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLV1d-0006nj-Pn; Mon, 17 Jul 2023 20:40:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=xnBMSisHP56m2fXP1o+etHLART964t123ZoOCcxrJqs=; b=ExIA1PtEufi6N7Kgfu7aNzTXqh
	RzEIJOmvFa9EujUWoV3p2D4Xm5m4wmqYic+uJIijSgAFGffvB0XFws/Evzr5EC15/zem5nufuP3QW
	HlMzGVvNDDFjpUZMb9kT9plggCFH4UmkY5jDnbalV8UeP+lZGjxKidicvgsxI6aTzbWs=;
Message-ID: <76cb0f23-ebcb-2c51-2312-c926b0d6d570@xen.org>
Date: Mon, 17 Jul 2023 21:40:55 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 14/07/2023 12:49, Nicola Vetrini wrote:
> The macro 'testop' expands to a function that declares the local
> variable 'oldbit', which is written before being set, but is such a
> way that is not amenable to automatic checking.
> 
> Therefore, a deviation comment, is introduced to document this situation.
> 
> A similar reasoning applies to macro 'guest_testop'.

Would you be able to check if the code below (only compile tested so 
far) would silence Eclair?

diff --git a/xen/arch/arm/arm64/lib/bitops.c 
b/xen/arch/arm/arm64/lib/bitops.c
index 20e3f3d6ceaf..f7a10b790f2a 100644
--- a/xen/arch/arm/arm64/lib/bitops.c
+++ b/xen/arch/arm/arm64/lib/bitops.c
@@ -64,13 +64,15 @@ bool name##_timeout(int nr, volatile void *p, 
unsigned int max_try)         \
  }

  #define testop(name, instr) 
      \
-static always_inline bool int_##name(int nr, volatile void *p, int 
*oldbit, \
-                                     bool timeout, unsigned int 
max_try)    \
+static always_inline int int_##name(int nr, volatile void *p, 
     \
+                                    bool allow_timeout, bool *timeout, 
     \
+                                    unsigned int max_try) 
     \
  { 
      \
      volatile uint32_t *ptr = (uint32_t *)p + BITOP_WORD((unsigned 
int)nr);  \
      unsigned int bit = (unsigned int)nr % BITOP_BITS_PER_WORD; 
      \
      const uint32_t mask = BITOP_MASK(bit); 
      \
      unsigned long res, tmp; 
      \
+    int oldbit; 
     \
 
      \
      do 
      \
      { 
      \
@@ -79,27 +81,30 @@ static always_inline bool int_##name(int nr, 
volatile void *p, int *oldbit, \
          "   lsr     %w1, %w3, %w5 // Save old value of bit\n" 
      \
          "   " __stringify(instr) "  %w3, %w3, %w4 // Toggle bit\n" 
      \
          "   stlxr   %w0, %w3, %2\n" 
      \
-        : "=&r" (res), "=&r" (*oldbit), "+Q" (*ptr), "=&r" (tmp) 
     \
+        : "=&r" (res), "=&r" (oldbit), "+Q" (*ptr), "=&r" (tmp) 
     \
          : "r" (mask), "r" (bit) 
      \
          : "memory"); 
      \
 
      \
          if ( !res ) 
      \
              break; 
      \
-    } while ( !timeout || ((--max_try) > 0) ); 
     \
+    } while ( !allow_timeout || ((--max_try) > 0) ); 
     \
 
      \
      dmb(ish); 
      \
 
      \
-    *oldbit &= 1; 
     \
+    ASSERT(!allow_timeout || timeout); 
     \
+    if ( timeout ) 
     \
+        *timeout = !res; 
     \
+    else if ( !res ) 
     \
+        ASSERT_UNREACHABLE(); 
     \
 
      \
-    return !res; 
     \
+    return (oldbit & 1); 
     \
  } 
      \
 
      \
  int name(int nr, volatile void *p) 
      \
  { 
      \
      int oldbit; 
      \
 
      \
-    if ( !int_##name(nr, p, &oldbit, false, 0) ) 
     \
-        ASSERT_UNREACHABLE(); 
     \
+    oldbit = int_##name(nr, p, false, NULL, 0); 
     \
 
      \

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 20:45:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 20:45:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564843.882564 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLV5u-0008Fs-Bv; Mon, 17 Jul 2023 20:45:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564843.882564; Mon, 17 Jul 2023 20:45:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLV5u-0008Fl-90; Mon, 17 Jul 2023 20:45:22 +0000
Received: by outflank-mailman (input) for mailman id 564843;
 Mon, 17 Jul 2023 20:45:20 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qLV5s-0008Ff-SN
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 20:45:20 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLV5r-0002mv-Gf; Mon, 17 Jul 2023 20:45:19 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLV5r-00074R-Ao; Mon, 17 Jul 2023 20:45:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:
	References:Cc:To:From:Subject:MIME-Version:Date:Message-ID;
	bh=8rXnZt+NJdqovxuQinuh1Jwi84LtZoiCAQgyn3qV8sQ=; b=M3aHOE127H/+MKwGEeUlLt0dyd
	LhSR7FNd8pvRbEIVvyXV/S2McQRVNS/nnijVWBW06VuKVB6gdMsjCbEmRi9S0/YZggYfNJbE3uMDJ
	3JhqLGiU6V2aWYpJGtaRgr4HTre1C3CV7C6YSnkSMStl+tlgXI7DL6jxVds8gywo80ZU=;
Message-ID: <8617ddae-02f6-981f-73fc-50be2e24ea64@xen.org>
Date: Mon, 17 Jul 2023 21:45:16 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
From: Julien Grall <julien@xen.org>
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
 <76cb0f23-ebcb-2c51-2312-c926b0d6d570@xen.org>
In-Reply-To: <76cb0f23-ebcb-2c51-2312-c926b0d6d570@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 17/07/2023 21:40, Julien Grall wrote:
> On 14/07/2023 12:49, Nicola Vetrini wrote:
>> The macro 'testop' expands to a function that declares the local
>> variable 'oldbit', which is written before being set, but is such a
>> way that is not amenable to automatic checking.
>>
>> Therefore, a deviation comment, is introduced to document this situation.
>>
>> A similar reasoning applies to macro 'guest_testop'.
> 
> Would you be able to check if the code below (only compile tested so 
> far) would silence Eclair?

Hmmm.. I think my e-mail client mangled the diff. Here an unmangled 
version if needed:

http://paste.debian.net/1286154/

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 20:58:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 20:58:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564849.882578 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLVIK-0001Y6-Db; Mon, 17 Jul 2023 20:58:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564849.882578; Mon, 17 Jul 2023 20:58:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLVIK-0001Xz-AP; Mon, 17 Jul 2023 20:58:12 +0000
Received: by outflank-mailman (input) for mailman id 564849;
 Mon, 17 Jul 2023 20:58:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLVIJ-0001Xp-3E; Mon, 17 Jul 2023 20:58:11 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLVII-00038w-O3; Mon, 17 Jul 2023 20:58:10 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLVII-0002ox-AA; Mon, 17 Jul 2023 20:58:10 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLVII-0004uS-9l; Mon, 17 Jul 2023 20:58:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Jp0+G/xcAxEC7ZSVju1zs5xQOg6jqYnKbBI6yTIO8cc=; b=uPKo12jI79Gs3FOrUyO+QLJs2C
	bh1LjNk1jKYChGCOVrJnL/87V9WHCEjT2hgBdwjmyuc8oD7Qw1orEOyPOKCeE55oYr5KrX4lWsRwb
	WzwDFgaU4mxXhxtGFadHj+uz6sc8Y2g3S65Wa3o3UrINbcVUmSvkNbCidSHXj0wVveNE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181847-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181847: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=4d1014093fbf1ae2788caaad8e70eabb15720ce4
X-Osstest-Versions-That:
    ovmf=39ded59c09a38cb17cee498fca9f390c4deca98a
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 17 Jul 2023 20:58:10 +0000

flight 181847 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181847/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 4d1014093fbf1ae2788caaad8e70eabb15720ce4
baseline version:
 ovmf                 39ded59c09a38cb17cee498fca9f390c4deca98a

Last test of basis   181833  2023-07-17 06:40:44 Z    0 days
Testing same since   181847  2023-07-17 14:10:50 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
  Abner Chang <abner.chang@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   39ded59c09..4d1014093f  4d1014093fbf1ae2788caaad8e70eabb15720ce4 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 21:16:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 21:16:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564857.882587 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLVZR-00046Y-RW; Mon, 17 Jul 2023 21:15:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564857.882587; Mon, 17 Jul 2023 21:15:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLVZR-00046R-Ob; Mon, 17 Jul 2023 21:15:53 +0000
Received: by outflank-mailman (input) for mailman id 564857;
 Mon, 17 Jul 2023 21:15:51 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qLVZP-00046L-IU
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 21:15:51 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLVZO-0003Ss-9t; Mon, 17 Jul 2023 21:15:50 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLVZN-0008BH-Tq; Mon, 17 Jul 2023 21:15:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:Subject:
	From:References:Cc:To:MIME-Version:Date:Message-ID;
	bh=85Uyqi5kwNoieffVkJ30q7XMYNGiQtJVzRIuY8pl29E=; b=o0JftoQRe35emosbUM/tVL0TbQ
	oMEjPUhRZEfqX6vieXZZuh/FAq97kCAXZyTE/HRF754i2tQxoprvP/Euvs3kEEa/4q0EL6PEb2x3k
	NkG3ZUWsDJmmGc2W+8XMaWFmBwsLm0lQU9B06sS3toQwT+zabloaR+n5GiKB/tZ1LJzk=;
Message-ID: <f38ecc34-4e4d-8142-50a1-a54097a909a0@xen.org>
Date: Mon, 17 Jul 2023 22:15:47 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <1ad20473a031eca75db4007bdc169616b512ef44.1689329728.git.nicola.vetrini@bugseng.com>
From: Julien Grall <julien@xen.org>
Subject: Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally
 uninitialized variables
In-Reply-To: <1ad20473a031eca75db4007bdc169616b512ef44.1689329728.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Nicola,

I am currently looking at the code to check if we can avoid some SAF-*. 
But I need some clarification on the usage.

On 14/07/2023 12:49, Nicola Vetrini wrote:
> @@ -2914,6 +2924,7 @@ static int __init make_vpl011_uart_node(struct kernel_info *kinfo)
>       void *fdt = kinfo->fdt;
>       int res;
>       gic_interrupt_t intr;

This value will be passed to set_interrupt() which contains the 
following code:

__be32 *cells = interrupt;
[...]
dt_set_cells(&cells, ....);

Where  gic_interrupt_t is:

typedef __be32 gic_interrupt[3];

This is very similar to the pattern in ...

> +    /* SAF-1-safe MC3R1.R9.1*/
>       __be32 reg[GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS];
>       __be32 *cells;
>       struct domain *d = kinfo->d;
> @@ -3435,6 +3446,7 @@ static void __init initrd_load(struct kernel_info *kinfo)
>       paddr_t paddr, len;
>       int node;
>       int res;
> +    /* SAF-1-safe MC3R1.R9.1 */
>       __be32 val[2];

... here.

cellp = (__be32 *)val;
dt_set_cell(&cellp, ..., load_addr);

Would you be able to explain why Eclair is complaining for this one but 
not the previous one?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 21:40:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 21:40:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564861.882597 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLVxZ-0007hB-Ig; Mon, 17 Jul 2023 21:40:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564861.882597; Mon, 17 Jul 2023 21:40:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLVxZ-0007h4-FI; Mon, 17 Jul 2023 21:40:49 +0000
Received: by outflank-mailman (input) for mailman id 564861;
 Mon, 17 Jul 2023 21:40:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qLVxX-0007gy-Rr
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 21:40:47 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLVxW-00041j-RR; Mon, 17 Jul 2023 21:40:46 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLVxW-0000aQ-LA; Mon, 17 Jul 2023 21:40:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:Subject:
	From:References:Cc:To:MIME-Version:Date:Message-ID;
	bh=LEj/+BmcgpJrKV+CFhomaeEd1/O5kI/2Eyv9HxX8JFw=; b=qOUR8gkVZIVB5d6/u15eVww9on
	kJvCOVwoHYidSPMx9tEINbSyxJxbezv77S+uu4TwJjgXoBF62S9gfDVpckTZzxVd6kl5a42XI7RbF
	0uA1RF8PQdM486o4yhkclWxX5fhXcS+HKsAF+f4GKErLeCIhckxekr4PWVcEqSPpi048=;
Message-ID: <b8220443-3d9a-671f-b18e-011a761bc771@xen.org>
Date: Mon, 17 Jul 2023 22:40:45 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-2-jgross@suse.com>
From: Julien Grall <julien@xen.org>
Subject: Re: [PATCH v2 01/18] tools/xenstore: explicitly specify create or
 modify for tdb_store()
In-Reply-To: <20230710065947.4201-2-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 10/07/2023 07:59, Juergen Gross wrote:
> Instead of using TDB_REPLACE for either creating or modifying a TDB
> entry, use either TDB_INSERT or TDB_MODIFY when calling tdb_store().
> 
> At higher function levels use the abstract flag values NODE_CREATE

Were you meant to replace 'flag' with 'mode'?

[...]

> diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
> index 334f1609f1..0655073de7 100644
> --- a/tools/xenstore/xenstored_transaction.c
> +++ b/tools/xenstore/xenstored_transaction.c
> @@ -290,7 +290,8 @@ int access_node(struct connection *conn, struct node *node,
>   			i->check_gen = true;
>   			if (node->generation != NO_GENERATION) {
>   				set_tdb_key(i->trans_name, &local_key);
> -				ret = write_node_raw(conn, &local_key, node, true);
> +				ret = write_node_raw(conn, &local_key, node,
> +						     NODE_CREATE, true);
>   				if (ret)
>   					goto err;
>   				i->ta_node = true;
> @@ -363,6 +364,7 @@ static int finalize_transaction(struct connection *conn,
>   	TDB_DATA key, ta_key, data;
>   	struct xs_tdb_record_hdr *hdr;
>   	uint64_t gen;
> +	int flag;

I think this should be 'enum write_node_mode mode'. Also, can't the 
variable be defined a bit below in the if ( ... )?

>   
>   	list_for_each_entry_safe(i, n, &trans->accessed, list) {
>   		if (i->check_gen) {
> @@ -405,8 +407,10 @@ static int finalize_transaction(struct connection *conn,
>   					  ta_key.dsize + data.dsize);
>   				hdr = (void *)data.dptr;
>   				hdr->generation = ++generation;
> +				flag = (i->generation == NO_GENERATION)
> +				       ? NODE_CREATE : NODE_MODIFY;
>   				*is_corrupt |= do_tdb_write(conn, &key, &data,
> -							    NULL, true);
> +							    NULL, flag, true);
>   				talloc_free(data.dptr);
>   				if (do_tdb_delete(conn, &ta_key, NULL))
>   					*is_corrupt = true;

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 21:46:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 21:46:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564864.882607 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLW2u-0008In-4c; Mon, 17 Jul 2023 21:46:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564864.882607; Mon, 17 Jul 2023 21:46:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLW2u-0008Ig-27; Mon, 17 Jul 2023 21:46:20 +0000
Received: by outflank-mailman (input) for mailman id 564864;
 Mon, 17 Jul 2023 21:46:19 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qLW2t-0008Ia-4k
 for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 21:46:19 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLW2r-00047e-Qe; Mon, 17 Jul 2023 21:46:17 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLW2r-0000ne-JX; Mon, 17 Jul 2023 21:46:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=Z5WDx2imJXBTPB2UzUn1DlCH7XKK991dTHu8ydM9tko=; b=L8eTNhDekGHE/d+iO0v4RuL5JS
	J6bwgB2iGOQfoNte4SJkEX7IL5VISNyti0cpi4TFfHO7oIYl1e8BEvSmPc298zGQzLx3cP/RaHb8s
	fjpF58HMsUGZts2y/TKOOkM7r+9Rt44SVYAwKlKpOZphJOrfVSPmQn0dzjg8OKPXo7D4=;
Message-ID: <5d108900-f3dc-f974-c02b-3f0b099ccfba@xen.org>
Date: Mon, 17 Jul 2023 22:46:16 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v2 04/18] tools/xenstore: rename do_tdb_delete() and
 change parameter type
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-5-jgross@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230710065947.4201-5-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 10/07/2023 07:59, Juergen Gross wrote:
> Rename do_tdb_delete() to db_delete() and replace the key parameter
> with db_name specifying the name of the node in the data base.
> 
> This is in preparation to replace TDB with a more simple data storage.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 21:58:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 21:58:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564872.882638 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLWEW-0001nQ-CQ; Mon, 17 Jul 2023 21:58:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564872.882638; Mon, 17 Jul 2023 21:58:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLWEW-0001nJ-9O; Mon, 17 Jul 2023 21:58:20 +0000
Received: by outflank-mailman (input) for mailman id 564872;
 Mon, 17 Jul 2023 21:58:18 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLWEU-0001n9-T6; Mon, 17 Jul 2023 21:58:18 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLWEU-0004TB-Jv; Mon, 17 Jul 2023 21:58:18 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLWEU-0006b2-81; Mon, 17 Jul 2023 21:58:18 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLWEU-0001mG-7Z; Mon, 17 Jul 2023 21:58:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=RB66PvEldY8XlBiZ9DPzAOLSCsDdPsuaCrikM1Br3dw=; b=j6DF3nNZFqBLVyUKrX8ibjCHZ7
	6q7JbwVHSZxy1pu6LVoseIBfCqj0YKq8CIE2mqzvSu8ZvRTSWLuq2rjyAYamzq8mdibCH9LyWXGWo
	dJmuQzuazH/RpTOTvVia8HLwHZRytUoTzOHdSErAejFWzExWL9KZXzfpoNHWlpqRFAJA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181832-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.17-testing test] 181832: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-4.17-testing:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=71792ec9af49f94dd3fcb581310106aa5156150f
X-Osstest-Versions-That:
    xen=47eb94123035a2987dd1e328e9adec6db36e7fb3
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 17 Jul 2023 21:58:18 +0000

flight 181832 xen-4.17-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181832/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 180919
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 180919
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 180919
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180919
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180919
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 180919
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 180919
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 180919
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 180919
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180919
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180919
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180919
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  71792ec9af49f94dd3fcb581310106aa5156150f
baseline version:
 xen                  47eb94123035a2987dd1e328e9adec6db36e7fb3

Last test of basis   180919  2023-05-23 13:08:47 Z   55 days
Testing same since   181832  2023-07-17 06:37:00 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alejandro Vallejo <alejandro.vallejo@cloud.com>
  Anthony PERARD <anthony.perard@citrix.com>
  Olaf Hering <olaf@aepfle.de>
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   47eb941230..71792ec9af  71792ec9af49f94dd3fcb581310106aa5156150f -> stable-4.17


From xen-devel-bounces@lists.xenproject.org Mon Jul 17 23:14:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Jul 2023 23:14:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564886.882648 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLXPv-0002Mc-Vi; Mon, 17 Jul 2023 23:14:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564886.882648; Mon, 17 Jul 2023 23:14:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLXPv-0002MV-Sm; Mon, 17 Jul 2023 23:14:11 +0000
Received: by outflank-mailman (input) for mailman id 564886;
 Mon, 17 Jul 2023 23:14:10 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLXPu-0002ML-U0; Mon, 17 Jul 2023 23:14:10 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLXPu-00064c-M3; Mon, 17 Jul 2023 23:14:10 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLXPu-0002kE-4b; Mon, 17 Jul 2023 23:14:10 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLXPu-0004bo-48; Mon, 17 Jul 2023 23:14:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=AwCONNBiQWdi3YiC7rYPrwi4C8Wap2dPlJ4InSKQ3G8=; b=vMMpiV6WcYC1Bo4bdCGM56FZip
	25Te/N6M9MUb6XZFI68B1JrWnTASl4Df6vyc7/tYzebCOfzG3GkW9GdmCgQaFJzDWNH//54e97cJF
	xD2FM9Hs1qwChZ/BdlIvwtreV4KSAKNEQoMKRU/0sprvmL2FBxIIY/f7XfAaGtQh+AMU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181841-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-upstream-4.17-testing test] 181841: regressions - trouble: blocked/fail/pass/starved
X-Osstest-Failures:
    qemu-upstream-4.17-testing:test-amd64-i386-xl-qemuu-ws16-amd64:xen-install:fail:regression
    qemu-upstream-4.17-testing:build-arm64-pvops:kernel-build:fail:regression
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-raw:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-xsm:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit1:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit2:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-thunderx:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-vhd:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-xsm:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-qcow2:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-raw:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-multivcpu:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-rtds:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-vhd:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit2:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit1:hosts-allocate:starved:nonblocking
X-Osstest-Versions-This:
    qemuu=eeaede60ffb1760c06850cae562d104e4f98c859
X-Osstest-Versions-That:
    qemuu=b746458e1ce1bec85e58b458386f8b7a0bedfaa6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 17 Jul 2023 23:14:10 +0000

flight 181841 qemu-upstream-4.17-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181841/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-xl-qemuu-ws16-amd64  7 xen-install       fail REGR. vs. 175008
 build-arm64-pvops             6 kernel-build             fail REGR. vs. 175008

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-libvirt-raw  1 build-check(1)               blocked  n/a
 test-arm64-arm64-libvirt-xsm  1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl           1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-credit1   1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-credit2   1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-thunderx  1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-vhd       1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-xsm       1 build-check(1)               blocked  n/a
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 175008
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 175008
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 175008
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 175008
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt      3 hosts-allocate               starved  n/a
 test-armhf-armhf-libvirt-qcow2  3 hosts-allocate               starved  n/a
 test-armhf-armhf-libvirt-raw  3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-multivcpu  3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-rtds      3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-vhd       3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-credit2   3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-credit1   3 hosts-allocate               starved  n/a

version targeted for testing:
 qemuu                eeaede60ffb1760c06850cae562d104e4f98c859
baseline version:
 qemuu                b746458e1ce1bec85e58b458386f8b7a0bedfaa6

Last test of basis   175008  2022-12-01 11:10:52 Z  228 days
Testing same since   181841  2023-07-17 11:41:16 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Haochen Tong <i@hexchain.org>
  Jason Wang <jasowang@redhat.com>
  Miroslav Rezanina <mrezanin@redhat.com>
  Thomas Huth <thuth@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            fail    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          blocked 
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 blocked 
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      blocked 
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  blocked 
 test-armhf-armhf-xl-credit1                                  starved 
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  blocked 
 test-armhf-armhf-xl-credit2                                  starved 
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     starved 
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                starved 
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               starved 
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 blocked 
 test-armhf-armhf-libvirt-raw                                 starved 
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     starved 
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 blocked 
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      blocked 
 test-armhf-armhf-xl-vhd                                      starved 
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit eeaede60ffb1760c06850cae562d104e4f98c859
Author: Miroslav Rezanina <mrezanin@redhat.com>
Date:   Wed Nov 9 10:57:13 2022 -0500

    qemu-img: remove unused variable
    
    Variable block_count used in img_dd function is only incremented but never read.
    This causes 'Unused but set variable' warning on Clang 15.0.1 compiler.
    
    Removing the variable to prevent the warning.
    
    Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <e86d5b57f9d13bde995c616a533b876f1fb8a527.1668009030.git.mrezanin@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    (cherry picked from commit 0f48c47c679bc29fceb3a67283ee3b78175524bf)

commit 83b8b039db0efefd851dc62160728a69b36e09aa
Author: Miroslav Rezanina <mrezanin@redhat.com>
Date:   Wed Nov 9 10:57:12 2022 -0500

    tulip: Remove unused variable
    
    Variable n used in tulip_idblock_crc function is only incremented but never read.
    This causes 'Unused but set variable' warning on Clang 15.0.1 compiler.
    
    Removing the variable to prevent the warning.
    
    Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <02e1560d115c208df32236df8916fed98429fda1.1668009030.git.mrezanin@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    (cherry picked from commit 6083dcad80743718620a3f8a72fb76ea8b7c28ca)

commit 7385a130d841aeaf39e8773af869eb54cc7d6a7f
Author: Miroslav Rezanina <mrezanin@redhat.com>
Date:   Wed Nov 9 10:57:11 2022 -0500

    rtl8139: Remove unused variable
    
    Variable send_count used in rtl8139_cplus_transmit_one function is only
    incremented but never read. This causes 'Unused but set variable' warning
    on Clang 15.0.1 compiler.
    
    Removing the variable to prevent the warning.
    
    Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <15a32dd06c492216cbf27cd3ddcbe1e9afb8d8f5.1668009030.git.mrezanin@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    (cherry picked from commit 7d7238c72b983cff5064734349d2d45be9c6282c)

commit 27ca28d169038bf7fe70341c4cbb8fddd3791e8b
Author: Haochen Tong <i@hexchain.org>
Date:   Sat May 28 03:06:58 2022 +0800

    ebpf: replace deprecated bpf_program__set_socket_filter
    
    bpf_program__set_<TYPE> functions have been deprecated since libbpf 0.8.
    Replace with the equivalent bpf_program__set_type call to avoid a
    deprecation warning.
    
    Signed-off-by: Haochen Tong <i@hexchain.org>
    Reviewed-by: Zhang Chen <chen.zhang@intel.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
    (cherry picked from commit a495eba03c31c96d6a0817b13598ce2219326691)


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 00:14:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 00:14:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564902.882663 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLYLm-0001S8-89; Tue, 18 Jul 2023 00:13:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564902.882663; Tue, 18 Jul 2023 00:13:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLYLm-0001S1-51; Tue, 18 Jul 2023 00:13:58 +0000
Received: by outflank-mailman (input) for mailman id 564902;
 Tue, 18 Jul 2023 00:13:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLYLk-0001Rr-IC; Tue, 18 Jul 2023 00:13:56 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLYLk-00081n-Ef; Tue, 18 Jul 2023 00:13:56 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLYLk-0006Jw-6H; Tue, 18 Jul 2023 00:13:56 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLYLk-0001ys-5p; Tue, 18 Jul 2023 00:13:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=sspdiNVeSlq8MXOyves0JjyyudrS64vV4DE0l4u1GDI=; b=lM4xt1Nj+VN1T79p4awimIO7tm
	TQQvQ72hYj+7Jb0rIMrQN83Yxr7H3vFzNF4j5lTzfueXiRLFFS4onWZHtDiqJX/HFVM9IXd/MHqlY
	7qKyakPG/z7xuY0zvGtMqWm2ZSq8TKLBm2/oOHyeM9d4S+ThDCK0ZvXPrhYL1YqLD3yc=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181836-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 181836: tolerable FAIL - PUSHED
X-Osstest-Failures:
    libvirt:test-amd64-i386-libvirt-pair:xen-install/src_host:fail:heisenbug
    libvirt:test-amd64-i386-libvirt-pair:xen-install/dst_host:fail:heisenbug
    libvirt:test-amd64-i386-libvirt-raw:guest-start:fail:heisenbug
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=36b247b908e50534a8450909f87bb3f0216a9ff7
X-Osstest-Versions-That:
    libvirt=14026db9b0e25739ea30685bd643ff23aca30588
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 18 Jul 2023 00:13:56 +0000

flight 181836 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181836/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-libvirt-pair 10 xen-install/src_host fail in 181808 pass in 181836
 test-amd64-i386-libvirt-pair 11 xen-install/dst_host fail in 181808 pass in 181836
 test-amd64-i386-libvirt-raw  13 guest-start                fail pass in 181808

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt   16 saverestore-support-check fail blocked in 181789
 test-amd64-i386-libvirt-raw 14 migrate-support-check fail in 181808 never pass
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181789
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181789
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 libvirt              36b247b908e50534a8450909f87bb3f0216a9ff7
baseline version:
 libvirt              14026db9b0e25739ea30685bd643ff23aca30588

Last test of basis   181789  2023-07-14 04:21:56 Z    3 days
Testing same since   181808  2023-07-15 04:18:52 Z    2 days    2 attempts

------------------------------------------------------------
People who touched revisions under test:
  Tim Small <tim@seoss.co.uk>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  fail    
 test-amd64-amd64-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   14026db9b0..36b247b908  36b247b908e50534a8450909f87bb3f0216a9ff7 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 04:15:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 04:15:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564919.882689 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLc6v-0000ut-5b; Tue, 18 Jul 2023 04:14:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564919.882689; Tue, 18 Jul 2023 04:14:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLc6v-0000ul-0C; Tue, 18 Jul 2023 04:14:53 +0000
Received: by outflank-mailman (input) for mailman id 564919;
 Tue, 18 Jul 2023 04:14:51 +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 <SRS0=WIxp=DE=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qLc6t-0000uf-BZ
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 04:14:51 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a2685dba-2521-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 06:14:48 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 8B6242195A;
 Tue, 18 Jul 2023 04:14:48 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 672AD133FE;
 Tue, 18 Jul 2023 04:14:48 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id CYW/F7gRtmS8UgAAMHmgww
 (envelope-from <jgross@suse.com>); Tue, 18 Jul 2023 04:14:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a2685dba-2521-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1689653688; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=vD2t1urQH5l+SYTp0ezw6dTUAiS6qwJlS9UuxjANu9w=;
	b=Gzbb4KwuZQsfzl8ahPotT1wVumdyDwLMxi8riAUHYYRMls15+HQdyo06KAlAc+zVuP+Rjj
	Kk/EDmMzkrELBt330ETFYEHaZ5fL1++LKZaRMaYazvqRY3aPB1bs5zZBFc4qbfvYJaFouO
	z1TWkxHBNu9nYemcWq071VITy2pWQ+s=
Message-ID: <2f808135-54a9-4e53-8a2e-f5c741f5fc22@suse.com>
Date: Tue, 18 Jul 2023 06:14:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 01/18] tools/xenstore: explicitly specify create or
 modify for tdb_store()
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-2-jgross@suse.com>
 <b8220443-3d9a-671f-b18e-011a761bc771@xen.org>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <b8220443-3d9a-671f-b18e-011a761bc771@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------ZqQRxsKUR06uVfvAylVk30Ul"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------ZqQRxsKUR06uVfvAylVk30Ul
Content-Type: multipart/mixed; boundary="------------JpWL0j0nddhMAM6OdA745pBN";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <2f808135-54a9-4e53-8a2e-f5c741f5fc22@suse.com>
Subject: Re: [PATCH v2 01/18] tools/xenstore: explicitly specify create or
 modify for tdb_store()
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-2-jgross@suse.com>
 <b8220443-3d9a-671f-b18e-011a761bc771@xen.org>
In-Reply-To: <b8220443-3d9a-671f-b18e-011a761bc771@xen.org>

--------------JpWL0j0nddhMAM6OdA745pBN
Content-Type: multipart/mixed; boundary="------------gE9nUIiFojlPHORKstRIunMX"

--------------gE9nUIiFojlPHORKstRIunMX
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMTcuMDcuMjMgMjM6NDAsIEp1bGllbiBHcmFsbCB3cm90ZToNCj4gSGkgSnVlcmdlbiwN
Cj4gDQo+IE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3cml0ZV9ub2RlX21v
ZGUgbW9kZScuIEFsc28sIGNhbid0IHRoZSB2YXJpYWJsZSBiZSANCj4gZGVmaW5lZCBhIGJp
dCBiZWxvdyBpbiB0aGUgaWYgKCAuLi4gKT8NCg0KWWVzIHRvIGJvdGguDQoNCg0KSnVlcmdl
bg0K
--------------gE9nUIiFojlPHORKstRIunMX
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5RnNVUJbvoPHZ8SlM4KWm8rG+lIkGurq
q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U8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------gE9nUIiFojlPHORKstRIunMX--

--------------JpWL0j0nddhMAM6OdA745pBN--

--------------ZqQRxsKUR06uVfvAylVk30Ul
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmS2EbcFAwAAAAAACgkQsN6d1ii/Ey8K
wwf8CBtFsfat2+wmguJGH0PaJPKc6kru8iAkemFo83qSOIROwRJBne37jhpYaePEY3rnXxbloMSR
C2oX1tvbEgCUJCEbIxMnqiB3Kg+bEPTnNdKoerJf9Hx32rJ41gBZW8hcRUzLA92i0YD2Lfe9Lhj2
BA5mS/Kn2skZ6Vmrmh/6I8wEAOGCWmp+gOMd/s92oGAOHXnlqjzLNhiMYLLq+Rg77gQj4A7hQrke
1qgTeEYby1Me/swh7ppe5L2mBdCbeI73frkA8iIm9xIjyERarmxTFqacMCBhmXJWttcDf3wOLvNl
5S4QnxLgif6Zzp/uKDhlRoIxqASBjlI8zYpinbrhlw==
=YuYc
-----END PGP SIGNATURE-----

--------------ZqQRxsKUR06uVfvAylVk30Ul--


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 05:05:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 05:05:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564929.882698 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLctb-0007Gn-TU; Tue, 18 Jul 2023 05:05:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564929.882698; Tue, 18 Jul 2023 05:05:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLctb-0007Gg-QU; Tue, 18 Jul 2023 05:05:11 +0000
Received: by outflank-mailman (input) for mailman id 564929;
 Tue, 18 Jul 2023 05:05:10 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLcta-0007GW-KT; Tue, 18 Jul 2023 05:05:10 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLcta-0005LO-EY; Tue, 18 Jul 2023 05:05:10 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLcta-0007Ly-2a; Tue, 18 Jul 2023 05:05:10 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLcta-0002OB-1q; Tue, 18 Jul 2023 05:05:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=3bdW8xmfzUfjKG2AxyPS9gk8ZtAegG2aEoD3ab9/ul4=; b=H6lIj/iNwmCd1oykwynE2y/Yrr
	LX5owb9Wa81La4PTvIC5BF+xxSyzXF4j7M1rnos/DjpFBVCG6Rt1CoQnVBDLM1sodn+D2mGUlkNsh
	BVp1ZOrVyrji2dxx8DS0XQeIjN4d4+kpVDSupS9rBQAij72OFM8xveSaHKA+VuwZZcn8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181843-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-upstream-4.16-testing test] 181843: tolerable FAIL - PUSHED
X-Osstest-Failures:
    qemu-upstream-4.16-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-upstream-4.16-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.16-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.16-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    qemu-upstream-4.16-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-4.16-testing:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=c02cb236b5e4a76cf74e641cc35a0e3ebd3e52f3
X-Osstest-Versions-That:
    qemuu=62dd49f2172fb7dfe8d4223bfa45aede05155328
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 18 Jul 2023 05:05:10 +0000

flight 181843 qemu-upstream-4.16-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181843/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 174136
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 174136
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 174136
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 174136
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 174136
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 174136
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 174136
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 174136
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass

version targeted for testing:
 qemuu                c02cb236b5e4a76cf74e641cc35a0e3ebd3e52f3
baseline version:
 qemuu                62dd49f2172fb7dfe8d4223bfa45aede05155328

Last test of basis   174136  2022-10-20 14:10:54 Z  270 days
Testing same since   181843  2023-07-17 13:09:33 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Anthony PERARD <anthony.perard@citrix.com>
  Dr. David Alan Gilbert <dgilbert@redhat.com>
  Miroslav Rezanina <mrezanin@redhat.com>
  Thomas Huth <thuth@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/qemu-xen.git
   62dd49f217..c02cb236b5  c02cb236b5e4a76cf74e641cc35a0e3ebd3e52f3 -> stable-4.16


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 06:09:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 06:09:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564939.882728 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLdtI-0006BN-Mp; Tue, 18 Jul 2023 06:08:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564939.882728; Tue, 18 Jul 2023 06:08:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLdtI-0006BG-K4; Tue, 18 Jul 2023 06:08:56 +0000
Received: by outflank-mailman (input) for mailman id 564939;
 Tue, 18 Jul 2023 06:08:54 +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 <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLdtG-0006BA-Qj
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 06:08:54 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on20601.outbound.protection.outlook.com
 [2a01:111:f400:fe16::601])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 901e7218-2531-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 08:08:50 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU2PR04MB8712.eurprd04.prod.outlook.com (2603:10a6:10:2df::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Tue, 18 Jul
 2023 06:08:47 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 06:08:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 901e7218-2531-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=lVP/OsEc4uNAt9CVHXgkHnvWGhJn9WKYk9q2mB+j/vRcmF4hjoPWxCAlCnUWsgQ/V3/MYyS4FXE03Vst/kJ7MfzyBpogfPCOzuE5EwXSug6FdGRpUbboEVWAAf6x6EQsjshmUasZ0GguhLnYSesrTrWrQrsaEFeMQ471lJwwHGmZN0jFuR8QUSTOjDL06pDLWbZa5VEpR9ZOfS2o1Tdz3NHXOjVwEtr6GrjYpNd9e8hiav5x8Qvhb0LzkhxcyOL7sbSgxzur4x5h/55CmgXX7sWlZSjwEaiCKlQz3D3Pjskejet1rB8XhmzJePE17hNnuNTDjMoDrCUFd1yBmyG16g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=vBP945K6cV1Bfs2/WNmVrWUT6t1IWGcRBzEU6qkqe9A=;
 b=TNJJEXfrugxfmXTkNXDAr3Q+1hqRqTEcgm5NDtjYmhg+8RcedW6tItekPZHH05iNySTRAGlKviRdR1Vljvlve5zPA2M4jCwF1w/oyGDhwLb93COcphE0gCh8Ifk3A1LKrXUFr8vyT7LwJcoDlJpjO46JEcMUzHq+f/pPeVO651IiaE7LDAUtb3MCoLQGPEJDu8KXoYjhgEJyEhjoYe4Cv2tUtTLHdsv2WtDRygO7pCBFjEgelBAySivFY4XWt7M2j+OmYyFywCcseR0TvmFjGZmYQ3rIPEXyoa6jxAfiOJ+qwNHEjJPhUxrZgwwESgxEwCgLTfSJ3vbIM78s8FwMkA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=vBP945K6cV1Bfs2/WNmVrWUT6t1IWGcRBzEU6qkqe9A=;
 b=XqdTBc3lC2su0+pXkMCjw9Ey9Q2HPxW/uAjipRwuMU7XHI6vj9Q0KypDNOuU+1grav2H4HR363xSY/fc4PGzmc1xWLgA9O2JNGe9MZZrFZf9v2i/DwKiuTqDALfAQ7QPOn6/hFr07m1/5FbzvizojRDb3aHfvP/OYLj1Yex0cs3q3B7ofmrELxPbQ8RPxrIoGRDV6K55Ysfhe+2qxxzDYKD0VTELbeA49J+ZIuJk7Zof2y0ZTowpli9HNIg/oAGXWtvogNCSkJDJ4gxSL8BLmAwju3j35Q1CrbLkpB2Dtb/ScVmhIkO9l6VaF5pdIkoLC1vd4klGnfPb0/77kQN6CQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e66d6dac-46d6-2626-1652-f9fec21e6e75@suse.com>
Date: Tue, 18 Jul 2023 08:08:45 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 1/3] x86: allow Kconfig control over psABI level
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com>
 <6f462a2f-2e91-6397-a527-18eeade19476@suse.com>
In-Reply-To: <6f462a2f-2e91-6397-a527-18eeade19476@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0177.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9f::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU2PR04MB8712:EE_
X-MS-Office365-Filtering-Correlation-Id: 55477d38-4705-47a8-f041-08db875572c4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	+IxBn44dqrLD3bqFM0OQ/fIspNpG8x8qBhdTwbNpLr4LevJsFkpRpCdE19CXKZdTIEWmp65jve6e1m+h7R5MFXKN+Yw1HOl/01s2KfgvUNnQKky5nzCmaFMTfyin1/w8c0Gkxr+UuFDoE2iyegST8z+GSMvDZQJuuux5lgqFdUFrkbANHKtMeekjkFFfBW+TK7sZBf7NCayPgs4ehdzl17m4FNsw22+GJy/uBEctm8HH2xS4TeO02/EbuxCDl2gd7EBXiLHEx4NUo0pYWbcaUeM0b1nN5VSp0if+gvfpNlDvotQs9ohwjoilVLpVC/mKYyUe4pBsOT5W3jDPjsULFIqNHvddeaeE4klJ5tXfj9vkhN/BWeEZ46kW9+19uZ/4aRkpSSb1OUI59gjdZocLCzQp8fOGuD/VcyQodS0j4jxTw5zNpSjOYvdmemncdoWNUjFgxzL3idHC7KX0pxT+Ygkqhj/zHXZBksPxex61hQZdYmTTCAS/ftpDec0ThHTtqu5gBUBIXVzpr23aYb++Za6GT5BO+TKfgF6l8k6XgxOlvs700H1xJwLyWlrerhdbVtsqQ2imwdJdyRfS5z5rMoh0zJZ8WYYjIgt9x7bVKHqr/82R0fetHzbkmqZetPnQ2lxVkra6MTVBUz0vLCjgZA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(39860400002)(396003)(376002)(366004)(136003)(451199021)(6916009)(2616005)(66946007)(83380400001)(66556008)(66476007)(4326008)(6486002)(316002)(6512007)(54906003)(186003)(478600001)(53546011)(6506007)(26005)(2906002)(36756003)(86362001)(31696002)(41300700001)(5660300002)(8676002)(8936002)(38100700002)(31686004)(66899021)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?R0hySmdlbGZNaTUwcXlOWjZpSWhQTnFEa2wwSlNHcllhdDVyYVE0Ly9jc3A5?=
 =?utf-8?B?N2N4S0IrcnI0WEpxUlAvU3ZVVkx6YnRaNUdhSGZkUzYzZy9pV2ovcWF3cHZK?=
 =?utf-8?B?ekY0MEtySDZPNXpvRlYwUTVtNkVQRzBwV1BQODVZK2xwSXo1ODczYVBYOXlX?=
 =?utf-8?B?VjZCT3dXR0hHWEd6MEMyTkJFWVFTNFhDQStzSEJYMVZBQXpsSTlJTGVOVkJq?=
 =?utf-8?B?REZvUFNTNUpkc3NUTmtjOGdoQmJ4OXI4MkMwbHhJNmNiZERMQnFDV0pZdWdK?=
 =?utf-8?B?dkJBdVR1Zk1lOFJUUFdUek95dS9ka2lnY3dJVVZXbFpDQkZaWmtzbUVZNkFa?=
 =?utf-8?B?YXF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VZTGFqSmVBa01Y?=
 =?utf-8?Q?mHVuMWzk8Z/DDhkyqmllIfvT3?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 55477d38-4705-47a8-f041-08db875572c4
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 06:08:47.2238
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: fq7KTgfmaQ0HaMGsh/Kk5ary5vC7KFe60AvFuf8yB9mOr/LOsKRK6iHUQzQsgIT2/b06HcnJiDeHYhH+WkvvdA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8712

On 12.07.2023 14:33, Jan Beulich wrote:
> Newer hardware offers more efficient and/or flexible and/or capable
> instructions, some of which we can make good use of in the hypervisor
> as well. Allow a basic way (no alternatives patching) of enabling their
> use. Of course this means that hypervisors thus built won't work
> anymore on older, less capable hardware.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> TBD: Should we, just like for NX, add an early check in assembly code,
>      to have a "clean" failure rather than a random crash?

TBD: While older compilers (apparently gcc10 and older; not sure about
     clang) won't recognize -march=x86-64-v2 etc, we could fall back to
     passing -mpopcnt and alike explicitly.

Jan

> Whereas the baseline -> v2 step isn't much of a difference (we'll gain
> more there by a subsequent patch), v2 -> v3, while presumably (or shall
> I say hopefully) faster, yields an overall growth of .text size by (in
> my build) about 2k. The primary reason for this appear to be conversions
> of SHL-by-immediate to SHLX.
> 
> --- a/xen/arch/x86/Kconfig
> +++ b/xen/arch/x86/Kconfig
> @@ -118,6 +118,36 @@ config HVM
>  
>  	  If unsure, say Y.
>  
> +choice
> +	prompt "base psABI level"
> +	default X86_64_BASELINE
> +	help
> +	  The psABI defines 4 levels of ISA extension sets as a coarse granular
> +	  way of identifying advanced functionality that would be uniformly
> +	  available in respectively newer hardware.  While v4 is not really of
> +	  interest for Xen, the others can be selected here, making the
> +	  resulting Xen no longer work on older hardware.  This option won't
> +	  have any effect if the toolchain doesn't support the distinction.
> +
> +	  If unsure, stick to the default.
> +
> +config X86_64_BASELINE
> +	bool "baseline"
> +
> +config X86_64_V2
> +	bool "v2"
> +	help
> +	  This enables POPCNT and CX16, besides other extensions which are of
> +	  no interest here.
> +
> +config X86_64_V3
> +	bool "v3"
> +	help
> +	  This enables BMI, BMI2, LZCNT, and MOVBE, besides other extensions
> +	  which are of no interest here.
> +
> +endchoice
> +
>  config XEN_SHSTK
>  	bool "Supervisor Shadow Stacks"
>  	depends on HAS_AS_CET_SS
> --- a/xen/arch/x86/arch.mk
> +++ b/xen/arch/x86/arch.mk
> @@ -36,6 +36,10 @@ CFLAGS += -mno-red-zone -fpic
>  # the SSE setup for variadic function calls.
>  CFLAGS += -mno-mmx -mno-sse $(call cc-option,$(CC),-mskip-rax-setup)
>  
> +# Enable the selected baseline ABI, if supported by the compiler.
> +CFLAGS-$(CONFIG_X86_64_V2) += $(call cc-option,$(CC),-march=x86-64-v2)
> +CFLAGS-$(CONFIG_X86_64_V3) += $(call cc-option,$(CC),-march=x86-64-v3)
> +
>  ifeq ($(CONFIG_INDIRECT_THUNK),y)
>  # Compile with gcc thunk-extern, indirect-branch-register if available.
>  CFLAGS-$(CONFIG_CC_IS_GCC) += -mindirect-branch=thunk-extern
> 
> 



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 06:36:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 06:36:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564948.882739 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLeJn-0001On-T1; Tue, 18 Jul 2023 06:36:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564948.882739; Tue, 18 Jul 2023 06:36:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLeJn-0001Og-Q2; Tue, 18 Jul 2023 06:36:19 +0000
Received: by outflank-mailman (input) for mailman id 564948;
 Tue, 18 Jul 2023 06:36:18 +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 <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLeJm-0001OK-7A
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 06:36:18 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on0602.outbound.protection.outlook.com
 [2a01:111:f400:fe02::602])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 64e088d4-2535-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 08:36:15 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by GVXPR04MB9829.eurprd04.prod.outlook.com (2603:10a6:150:116::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 06:36:10 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 06:36:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 64e088d4-2535-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=jfrdtbL9b7iiKP3estehZXeBILrvsqsX6aelgIcUItX4ao06b66tJTJiQddrnmnPnHkGr8KSXJHvnnjWQanBtbCiAYHeZZ9fc1ebpqyAXNQub4MuKyX8PQctWrcTJY3wsldB64Nal4SftA1QNQsaa+M84DKLV3LX/3Bfh5wgIlfCMO59n18hYH8GXpE1Ak0N7lShnzq7pxBo/XKTs5tNLfKIf0JuNdYhlXp5TIU692jpsdIYOrZw/N2ylk3365kY+wXZyMJ8WyjDg0AviK8v51SW3Ypwkm0LVH2cm9ePnX6/jGW0TfxZDC8pdzlsF41bWXheKwEfGOiLXBU/2sgz0Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BQ/+bUmx2536GniYyG6eaVXeGjg5PPAQtO81R1U27r8=;
 b=LzKhiFyBZQ04h6FSJKCKPWbQ6ZuNWlr2Wk/8YQrMUDrWMsrqqOeLnCiOMI5JFBb6pkoKh/tImNHySyr8pHDxheeMNNMXL0VLC0ZMM5ULE2YApTqWYqwtxaqNclv7WYvcA/hi8ilQfDfp/9e3Z90a/bq9+POAwt3XKP1asVbc76acE7gGWNxXIrCTK1b2CMuJgmemvUWsGlSeQurhFiW7A/hN5a/VhPZX/l+/V7MDSQgP5zqUtVQ9wEgMLVil6LuCZA3K8dadKHrsCASli0z/xvwCOSSq9P4/P437PUI8uf+zm9iFRencKOcCOPptdXIfL0ycS283Buuteau69HWjow==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BQ/+bUmx2536GniYyG6eaVXeGjg5PPAQtO81R1U27r8=;
 b=NtTzx3oByg7gpDzGsx8twK8mqJhTv3UTcnv6R521og/vH8QZe76nFNdifhyXnsOIEqu/jHid+98NPSomXXmf9FtIea4XUBCpusc6ArvUOrDZuFez38LiwEkHQxOnZeBNG1b22Efd/lcDN0f8eJYzkJpEUgTCuDnXajrRzhUndpzAHRX9jzhjYzaXH8ZBtqGfCxYuaH4El9HPXs04hiB3P94Jd8kLL032l+OP3eETdaqyotOMYYR+XzwKXTXcTX0Bzw0rcQu4J7c4SqbpV/tgaCTWLWHFU3ApVcvO1PjZtUeJBbN7ppLRkadRu96JED3iYg+by5hcfN7ZkYaUJ1mLRw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <2976d08f-3b09-a999-b5ea-817f8175c599@suse.com>
Date: Tue, 18 Jul 2023 08:36:08 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 2/3] xen/ppc: Implement early serial printk on pseries
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1688670018.git.sanastasio@raptorengineering.com>
 <85172d385a730e196999b366207e2b2e8a261906.1688670018.git.sanastasio@raptorengineering.com>
 <aa58706f-5033-ef33-5202-bcc418bedb86@suse.com>
 <2fa2837d-37f4-aa28-6ca8-2e28b6f44181@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <2fa2837d-37f4-aa28-6ca8-2e28b6f44181@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0173.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a0::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|GVXPR04MB9829:EE_
X-MS-Office365-Filtering-Correlation-Id: e113521e-f324-459d-f006-08db87594650
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Fshr9vMDVmw5/wJKRCsGLcEwdgcA89IP+KKrBaQDstcNZ9N5ezhyLA0EmPquVilXIeFQ4GjLxDA5X7cXuV2g2nkca98hxilYA0qAjzbtvs4N5LM7Vflua1lx7DB3FTU+P+s89wVPKYCK4woLzzZUbK8bNSl7SXwKApeSPIV0H1pETiamYs/7aOp9aTXIlu7BDHJEYw1ofHGKGyqNlzyhedxqeMNpIacITPsZwynUEAwfzYO6/HDVE0TEuqVSiWAYU8KmGdeBd8p7dt6QHS9kEFdCO+OJxICXFITWB1qxeAq0u6/4nd6O5r9RvHclPE1NwKNZRTyzxiKHzxBW5OSOKiE6B/5PTfcQ/OT4teV6sGmNPCvbYPR8IPD6NYhEIWBPZRym+KoA7tPv+X7FZ6+GByU+9oT2exunDdy1R+aVj9O0S4VFZ/IRBt6OG4rIh1D2YwLsYqzso0/6vHDzlcL+1VLCZvfiRPVRR/hYdcdeUrbF4Arl7FvQBQVdF8+r54EkQHyQRuKz9hkV9/p8e7ESDRFVIwkNd+h3IP6i50tOd/5pt/mHKZBywSIyIx+xi3wQ7afY4+VjGniasU0+jmu47JzkfafYt1E2tjUA6ZIZtbbvdJEQ3t4N4dp9s+BKOHZrh7viio0CRQwUdeN8kJCQwQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(396003)(136003)(39860400002)(346002)(451199021)(86362001)(8936002)(316002)(66556008)(5660300002)(4326008)(8676002)(31686004)(66946007)(41300700001)(2906002)(478600001)(6486002)(26005)(6512007)(54906003)(6506007)(53546011)(186003)(6916009)(83380400001)(2616005)(66476007)(38100700002)(36756003)(31696002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VGN4bkdscGd2Vzd6Z1h3MlE3cWlFSkwwZVpRYW1MTHZpM0VNUHBVVTA3b2NN?=
 =?utf-8?B?dVBHc0dNUmZqVTVsWWJtbFZ0Sm16Y0Q4d3cybzJxenFJQ1piWngwL21iQW5i?=
 =?utf-8?B?MnNtMkpJdU52Rm55YXdwRTRzS3Fpd3FQeVQ3OE5SZjY3YmdMYm1EMnIzZFRM?=
 =?utf-8?B?M0c4cjZnWVdUNGVkRml6MVgyRmp6VUd5c25XMytyVWNaRHhyaU0xSFowcWdr?=
 =?utf-8?B?M0hjU3ZCQWJuTWxkckJnR0hzYjNKempWQnVTQXlQTjZBWDA4djUvTm9GQ2ll?=
 =?utf-8?B?TGFJZWYzK1NxTm5GZ0lNTFJIemlqWTBQMGcrNGVCNm83bm5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NHoyaWFydlk3ZWE2Z2hLY1JxRDRQenNvT2lNQ05ldThV?=
 =?utf-8?Q?Ydn9Fd/E/wIz/X8wvzrvFIJ02?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e113521e-f324-459d-f006-08db87594650
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 06:36:10.6082
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Ok5JUr8B+ChRqDtGvLBOVRX5PQ/XsXYUHqxSVoWSzPgm8aM8yT3lfLgtd3+VG1yjkRTTFG77P2inSHi+G0WQKQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9829

On 17.07.2023 20:32, Shawn Anastasio wrote:
> On 7/17/23 11:17 AM, Jan Beulich wrote:
>> On 06.07.2023 21:04, Shawn Anastasio wrote:
>>> --- /dev/null
>>> +++ b/xen/arch/ppc/boot-of.c
>>> @@ -0,0 +1,100 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-or-later */
>>> +/*
>>> + * Copyright IBM Corp. 2005, 2006, 2007
>>
>> Judging from the years the file was taken from somewhere. Is the license
>> there permitting "2.0 or later"? (For files [partly] taken from somewhere,
>> a clarification as to the originals' licenses would be helpful to have in
>> the description, or maybe in the post-commit-message area.)
> 
> The original license of the file that this was derived from
> (xen/arch/powerpc/boot_of.c from Xen 3.2) is GPL v2.0 or later.
> 
> In any case where I'm deriving code from existing files, I'm always
> using the original license of the derived code. Should I still clarify
> this in the header comment?

I think it would be good to mention explicitly, as 2.0-only is the
common expectation.

>>> +/* OF entrypoint*/
>>> +static unsigned long __initdata of_vec;
>>> +
>>> +/* OF device handles*/
>>> +static int __initdata bof_chosen;
>>> +static int __initdata of_out;
>>> +
>>> +static int __init of_call(const char *service, uint32_t nargs, uint32_t nrets,
>>> +                   int32_t rets[], ...)
>>
>> Nit: Indentation.
> 
> Will fix.
> 
>>> +{
>>> +    int rc;
>>> +    va_list args;
>>> +    int i;
>>
>> unsigned int?
> 
> I might as well change it to uint32_t to be in line with nargs.

Please don't. See ./CODING_STYLE for when it is okay to use fixed-
width types.

>>> +    va_start(args, rets);
>>> +
>>> +    for ( i = 0; i < nargs; i++ )
>>> +        s.ofs_args[i] = cpu_to_be32(va_arg(args, uint32_t));
>>> +
>>> +    va_end(args);
>>> +
>>> +    rc = enter_of(&s, of_vec);
>>> +
>>> +    /* copy all return values to the output rets array */
>>> +    for ( i = 0; i < nrets; i++ )
>>> +        rets[i] = be32_to_cpu(s.ofs_args[i + nargs]);
>>> +
>>> +    return rc;
>>> +}
>>> +
>>> +static int __init of_finddevice(const char *devspec)
>>> +{
>>> +    int rets[1] = { OF_FAILURE };
>>
>> Hmm, of_call() uses int32_t. Again below several times.
> 
> Good catch. I'll switch all of these to int32_t for consistency.

Here, for example, it is (because of being used to interface with
firmware).

>>> --- /dev/null
>>> +++ b/xen/arch/ppc/early_printk.c
>>> @@ -0,0 +1,28 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-only */
>>> +#include <xen/init.h>
>>> +#include <asm/boot.h>
>>> +
>>> +static void (*putchar_func)(char);
>>
>> __initdata? (Connected to the question of building into .init.o.)
> 
> Since I'm going to change this to build to .init.o, would this
> automatically be put into the correct .init section? Would it still be
> preferable style-wise to mark it as __initdata?

No, it would complain that .data or .bss is non-empty. Automatic
conversion occurs only for things you can't control at the source
level, e.g. string literals.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 06:41:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 06:41:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564951.882749 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLeOj-0002wG-FD; Tue, 18 Jul 2023 06:41:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564951.882749; Tue, 18 Jul 2023 06:41:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLeOj-0002w9-CL; Tue, 18 Jul 2023 06:41:25 +0000
Received: by outflank-mailman (input) for mailman id 564951;
 Tue, 18 Jul 2023 06:41:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLeOh-0002w3-JA
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 06:41:23 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on2060b.outbound.protection.outlook.com
 [2a01:111:f400:7d00::60b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1bc99047-2536-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 08:41:22 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB7626.eurprd04.prod.outlook.com (2603:10a6:10:201::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 06:41:20 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 06:41:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1bc99047-2536-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=I8acpD8sfyKEZLZNqLjfn0U32cYq12cmEUvGS8w27c5k5tRcopLcPUHHukS6GcWzUmCqU9Li0MrsZ9fzfRVAepEQwkrq6PUnlHvwQY6KURqvO3lgS9T4ScFrsmHc6neBvom1vuANrzuNEaCMWP+gjYzSDw9HhfaunbrB4Blh5ndZmhvCe6op8QWeJzY7P5Tkxgk2LpyMUrOXKb4z63cqtVziKzRkvDwpyXDGVklJ6JiKVYhLwRRp4o0rEdnWiev+QrM7NxXaV/TJcaW6zWpgZpioEX1EIAP/se92sD+VT+vOyskQP9s83vKsLdw04YbwBarZe3hL1JvJ7ndSlHjmVg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=rA7UTSu9LQtNU+NdEy7mQ8uuODWbKRlS/Zmmie54Nes=;
 b=FTkDpAJEGMJmICUzoCV9nnD360OR5+uZM3ApYNYRAUnkD85g1b1c0KNfX2V/5SmVeo9G4teEGd1pEhcDS8Bboo30EQwtTCnTyEU3d95Qd7X4Riu6VxcIjadrrPkM+ZSYzu2IsaY/43jmOYU0zjmzmXj4DaArQtJ+1D03ejMwgsr18jr2anZEPUQ7hhsxFLSw5OgJxOoPPcFXrhr8vIEEYhLEm/uEjoSy1aW3mXSwpF2GkGcbgVZd9TrFuAUQXuh/CEUC0UfSGP2EtAg4PgwbZ7amz8tDz7zDhdDKuiyUIcoHY2JSBmyomeBxFI2iYJW19HpVfxKsLKNJOEdMUKNsdQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=rA7UTSu9LQtNU+NdEy7mQ8uuODWbKRlS/Zmmie54Nes=;
 b=nKT3Y2HRu4ncbx40eIE0pkZz+XCbfDfZQ9In3pnvoXWF2cNfr9aWCcmeLJK409iyhWEp377moUt8eHI8uQaTbnDX78OYEhYOkVccmH2m0LZ1UMArgT9qFqXW1X3CC4yoT53bJR2g5UGb8QyvhWonKJrTfdcrvw9xdBuyRduqXXof+UspwwLbq4UTSXoWppOMQk3uyQtDtaKRBlv+lMl/bjD1xyg7h8RxzMYuQJe8sYZW8zt1xUOhnkOrDNu6ezKuXsbMJ+LhDZsFq2KvkZQk/6u5F/lzi2zg/DfSZanvvvRIkt0gPj+U4TAggL/6IaeywZTXENEyK3YuFU88q4kexg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <1ae9fe4b-d36d-4dbe-bc1a-ac5d78513690@suse.com>
Date: Tue, 18 Jul 2023 08:41:17 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 2/3] xen/ppc: Implement early serial printk on pseries
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1688670018.git.sanastasio@raptorengineering.com>
 <85172d385a730e196999b366207e2b2e8a261906.1688670018.git.sanastasio@raptorengineering.com>
 <aa58706f-5033-ef33-5202-bcc418bedb86@suse.com>
 <2fa2837d-37f4-aa28-6ca8-2e28b6f44181@raptorengineering.com>
 <7e01fe7f-59ee-1fb3-fb9f-8013491b72a3@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <7e01fe7f-59ee-1fb3-fb9f-8013491b72a3@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0175.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9f::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB7626:EE_
X-MS-Office365-Filtering-Correlation-Id: 908b2365-8043-4f43-c8c0-08db8759feba
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	TZdRiiac3pequujdkbACuSxUDPHWkT3rU0n+jGGbS9qH+4EFU6u0mSCT2yRaxeQOVrjz+KR3kSTp0w4sbbv20psSdciREhGkdRzlm+OsCRCll+y8u14Oy7EPRbHOXPop9KcLJeOStSvOhaJZdENd/p4kjq5eh91k9s3BjuTWnkCPs5gNq49Err7WzL79Kbg/AP2DvOY4mIkEKdproxc1r0GhR2eftHClLWrtKaJ0kBsFZRhkt4V6SrNozqRtggymGASzLGAHcFAr9GYX5fJzNTwzC3rrUx/S7HzZ46LfnaeW8wmiu8fKzQebqah5SQGmyP9/5XeZALlaIA+s7LCXBvVq6cTr63yoaxDgldB5WBnBlPgDFnvJOWpOBy1YmwSMm7sVyTkwveBHYGkaMjBc1BCsoJTWRJ1ZLRq0hhZGJSh04NezsB3yVF/87OQBi+4s9Aq1qHRreJozl/zxqr7JbOj525vK0C4NrKAFv8tx9Y9VTo7uSUZeQDTBOOkYs60U6S5WLr9QErtg8NWke1disJKc362hgp+uxOqCncp1J0MiooNEPek53ZDE1BN6KcHFXPsQDUHnPW5VV7HTy7etuPXETlRUCGSt9Z5kGyb8TAsknWKlPZp2e8LRgY7ttcex
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(346002)(39860400002)(376002)(136003)(451199021)(478600001)(5660300002)(66556008)(66946007)(66476007)(54906003)(4326008)(316002)(6916009)(8936002)(2906002)(8676002)(41300700001)(31686004)(66899021)(6512007)(966005)(26005)(53546011)(6486002)(6506007)(38100700002)(186003)(2616005)(36756003)(31696002)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cEN4NlYvd2FiWTUzeHkyOWt5V2tRUzF5NlJxY0JUQ3lCMXJpK0JyUm1tdlNT?=
 =?utf-8?B?dTdwaXhydXVFd0hJMnhYekl3Mzc4S1d4Ymp2THFUWFZab2p0VlgwUFZrZFZz?=
 =?utf-8?B?NFBFcEJUVjBWbHo2KzltL2hBMlBoZWdCRlhzMVA3MWF6VGNQVnZyQngvbUJo?=
 =?utf-8?B?WnBRdktTKzVybkdKSFdYSWp2K0szYkxBNml6WTFreGVNSVNwZDdFaXpXT2xR?=
 =?utf-8?B?T09YN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0Y3R2?=
 =?utf-8?B?WmZUQnpBSmJYVWdScFhOWGtmd1BoMXQ3UEU0MG95dUxtKytrbU1Qc3Q1dW1h?=
 =?utf-8?B?Z2p5SGpaa1Bwb01XRDZ0MkkyVmdlZmsrcExVWk5Nc2xUc0szZHBGUTNtOWkw?=
 =?utf-8?Q?uVH4gdAW0WTK4Y7ge0a3MsYbf?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 908b2365-8043-4f43-c8c0-08db8759feba
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 06:41:19.9555
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: zzNCaXmtMInjTxd986E7bZMPrv4PyPnIWJct2PFYwv9cAGRxHlnSnoDFGL7BrbbQpynQf9VRBSbN5grNv8KFxA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7626

On 17.07.2023 20:40, Shawn Anastasio wrote:
> Quick followup,
> 
> On 7/17/23 1:32 PM, Shawn Anastasio wrote:
>> On 7/17/23 11:17 AM, Jan Beulich wrote:
>>> This could do with using ARRAY_SIZE(rets). Same again below.
>>
>> Sure, will do this.
> 
> ARRAY_SIZE is defined in <xen/lib.h> which can't yet be included due to
> missing headers. I could copy its definition into this file along with a
> TODO comment to fix it once the include works.
> 
> If I were to go down that route, I'd also probably not include the
> __must_be_array assertion and related machinery that the <xen/lib.h>
> version has, since it'd require a large portion of <xen/lib.h> to be
> copy/pasted.

You (like anyone else) could review (and then offer R-b) my "common:
move a few macros out of xen/lib.h" [1]. That's of course only a tiny
first step (covering little more that what I need in that series). You
(or I or anyone else) could then put a patch on top moving ARRAY_SIZE()
(and its prereqs) to the new header as well. Since the new header has
no other prereqs, it should be usable as is, without the need for any
arch headers, both here and similarly in the RISC-V work.

Jan

[1] https://lists.xen.org/archives/html/xen-devel/2023-07/msg00582.html


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 07:10:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 07:10:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564956.882758 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLeqx-0006i6-IO; Tue, 18 Jul 2023 07:10:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564956.882758; Tue, 18 Jul 2023 07:10:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLeqx-0006hz-Fl; Tue, 18 Jul 2023 07:10:35 +0000
Received: by outflank-mailman (input) for mailman id 564956;
 Tue, 18 Jul 2023 07:10:34 +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
 <SRS0=SEr0=DE=linaro.org=dan.carpenter@srs-se1.protection.inumbo.net>)
 id 1qLeqw-0006ht-7e
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 07:10:34 +0000
Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com
 [2a00:1450:4864:20::42e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2e02d076-253a-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 09:10:30 +0200 (CEST)
Received: by mail-wr1-x42e.google.com with SMTP id
 ffacd0b85a97d-314313f127fso5007592f8f.1
 for <xen-devel@lists.xenproject.org>; Tue, 18 Jul 2023 00:10:30 -0700 (PDT)
Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id
 n13-20020a5d4c4d000000b002c70ce264bfsm1479819wrt.76.2023.07.18.00.10.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 18 Jul 2023 00:10:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2e02d076-253a-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689664230; x=1692256230;
        h=content-disposition:mime-version:message-id:subject:cc:to:from:date
         :from:to:cc:subject:date:message-id:reply-to;
        bh=EAk25XI6DF+N/RPwc8jvnN7pt/+H6p4ailHynx2WFBY=;
        b=fKPp3Kjb476K4raOQMzlahVzTiPv86QitTfCXSJS1PguBUEx5dY2RlFMObVYR2CWWa
         u/dJVvkABXNAT/4KGpyFUbmcEhuV8enyNwnpO7xGB0bq7I5ddnyu7bpEEWu0PBEa5boA
         +h7buBcCM5EFSUsOW9wOl2NRfNwXe2+SW9ZFO1a9J0Vd+lJfxM/POPBFuVwWvSicDoS1
         ZjQLd5eHAcpSEm467YzdpMcEtAAgNHE1Z3OFG7DIfJJmNtc4puhdA3RA7wW95aVFtHcP
         0V5lgolFPwBmjVANX+j6bXRGHWBzdDp0sFcPuq2DSBuQ4hemCQM2MPqThSiEow3hltlO
         5GBQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689664230; x=1692256230;
        h=content-disposition:mime-version:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=EAk25XI6DF+N/RPwc8jvnN7pt/+H6p4ailHynx2WFBY=;
        b=D5sf5yjKErozP9ZHrzio7RHHlnOmz79CI4rqnafJ0ohsAaz0OcXxX2RyKznSXXZQn8
         Tpt+jMvxd7KGvSqBAMjSIXuSieg2etOpVTV72xaes6+bufBzIWdTGLNhCTBIhdhMWadw
         AF6mdfGKL6GGePMvAdNqkxWPmo2P3fNj6DDXUU9LSgyTz5FRrVnQFhNB9yjss11rgVh5
         +JbYGbepjbCj2GG7FB5AQiq5vAlS8QSDqjxJcJS21dsb2txFgWPnGjaqvNSPGkGuUodp
         3r1ec6p6iC/QRw1BsbRkXj3SzEiKDegcuW9Aayik2dd5hEyz5+acJaSLJT1/yEGWWluU
         3JMw==
X-Gm-Message-State: ABy/qLbaWy+iYaBBDZuIew3dWZqJUJsCbCy2PFHlTkfHCaO7FJALTx3u
	yfsb9tZd3CwwVol4dmweJ21Jig==
X-Google-Smtp-Source: APBJJlGI8sFdzt89T0UCfXf2kYOa86Emn3lFEswP9Pp2SLzE28zuWii99UdVr425OMOm2qjesP53nA==
X-Received: by 2002:a05:6000:150:b0:313:ede8:9f13 with SMTP id r16-20020a056000015000b00313ede89f13mr11735959wrx.32.1689664230189;
        Tue, 18 Jul 2023 00:10:30 -0700 (PDT)
Date: Tue, 18 Jul 2023 10:10:24 +0300
From: Dan Carpenter <dan.carpenter@linaro.org>
To: jgross@suse.com
Cc: xen-devel@lists.xenproject.org
Subject: [bug report] xen/scsifront: harden driver against malicious backend
Message-ID: <00e862be-00c9-4089-bd9c-61c72aad27d5@moroto.mountain>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello Juergen Gross,

This is a semi-automatic email about new static checker warnings.

The patch 6d1c2f48f3fc: "xen/scsifront: harden driver against
malicious backend" from Apr 28, 2022, leads to the following Smatch
complaint:

    drivers/scsi/xen-scsifront.c:746 scsifront_sdev_configure()
    warn: variable dereferenced before check 'info' (see line 743)

drivers/scsi/xen-scsifront.c
   738  static int scsifront_sdev_configure(struct scsi_device *sdev)
   739  {
   740          struct vscsifrnt_info *info = shost_priv(sdev->host);
   741          int err;
   742  
   743          if (info->host_active == STATE_ERROR)
                    ^^^^^^^^^^^^^^^^^
The patch assumes that shost_priv() can't return NULL

   744                  return -EIO;
   745  
   746          if (info && current == info->curr) {
                    ^^^^
But the old code assumes it can.  Probably info can't be NULL and this
check can be deleted?

   747                  err = xenbus_printf(XBT_NIL, info->dev->nodename,
   748                                info->dev_state_path, "%d", XenbusStateConnected);
   749                  if (err) {
   750                          xenbus_dev_error(info->dev, err,
   751                                  "%s: writing dev_state_path", __func__);
   752                          return err;
   753                  }
   754          }
   755  
   756          return 0;
   757  }

regards,
dan carpenter


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 07:26:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 07:26:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.564963.882769 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLf6T-0008Of-V4; Tue, 18 Jul 2023 07:26:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 564963.882769; Tue, 18 Jul 2023 07:26:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLf6T-0008OY-Re; Tue, 18 Jul 2023 07:26:37 +0000
Received: by outflank-mailman (input) for mailman id 564963;
 Tue, 18 Jul 2023 07:26:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4bXZ=DE=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qLf6S-0008OS-JG
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 07:26:36 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6c81c1a2-253c-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 09:26:34 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.161.123.45])
 by support.bugseng.com (Postfix) with ESMTPSA id A59734EE0C88;
 Tue, 18 Jul 2023 09:26:32 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6c81c1a2-253c-11ee-b23a-6b7b168915f2
Message-ID: <283befdf-d338-5637-78e7-94b018d53a5e@bugseng.com>
Date: Tue, 18 Jul 2023 09:26:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally
 uninitialized variables
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <1ad20473a031eca75db4007bdc169616b512ef44.1689329728.git.nicola.vetrini@bugseng.com>
 <f38ecc34-4e4d-8142-50a1-a54097a909a0@xen.org>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <f38ecc34-4e4d-8142-50a1-a54097a909a0@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 17/07/23 23:15, Julien Grall wrote:
> Hi Nicola,
> 
> I am currently looking at the code to check if we can avoid some SAF-*. 
> But I need some clarification on the usage.
> 
> On 14/07/2023 12:49, Nicola Vetrini wrote:
>> @@ -2914,6 +2924,7 @@ static int __init make_vpl011_uart_node(struct 
>> kernel_info *kinfo)
>> Â Â Â Â Â  void *fdt = kinfo->fdt;
>> Â Â Â Â Â  int res;
>> Â Â Â Â Â  gic_interrupt_t intr;
> 
> This value will be passed to set_interrupt() which contains the 
> following code:
> 
> __be32 *cells = interrupt;
> [...]
> dt_set_cells(&cells, ....);
> 
> WhereÂ  gic_interrupt_t is:
> 
> typedef __be32 gic_interrupt[3];
> 
> This is very similar to the pattern in ...
> 
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1*/
>> Â Â Â Â Â  __be32 reg[GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS];
>> Â Â Â Â Â  __be32 *cells;
>> Â Â Â Â Â  struct domain *d = kinfo->d;
>> @@ -3435,6 +3446,7 @@ static void __init initrd_load(struct 
>> kernel_info *kinfo)
>> Â Â Â Â Â  paddr_t paddr, len;
>> Â Â Â Â Â  int node;
>> Â Â Â Â Â  int res;
>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>> Â Â Â Â Â  __be32 val[2];
> 
> ... here.
> 
> cellp = (__be32 *)val;
> dt_set_cell(&cellp, ..., load_addr);
> 
> Would you be able to explain why Eclair is complaining for this one but 
> not the previous one?
> 
> Cheers,
> 

It did complain, but I specified an always_write property on the first 
parameter of set_interrupt, because dt_set_cell does always write it 
trough the argument cells. (there are three calls to dt_set_cell, which 
means that the array is fully initialized).
The difference is that initrd_load calls dt_set_cell directly. 
dt_set_cell does indeed initialize val[2], but only because it's called 
with the appropriate size. If the latter is wrapped in a function or 
macro, then I can add the same property as above and avoid the deviation.

Regards,

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 09:14:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 09:14:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565003.882789 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLgmc-00057j-7C; Tue, 18 Jul 2023 09:14:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565003.882789; Tue, 18 Jul 2023 09:14:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLgmc-00057c-42; Tue, 18 Jul 2023 09:14:14 +0000
Received: by outflank-mailman (input) for mailman id 565003;
 Tue, 18 Jul 2023 09:14:13 +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 <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLgmb-00057W-9S
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:14:13 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20621.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::621])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7494331a-254b-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 11:14:10 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS1PR04MB9502.eurprd04.prod.outlook.com (2603:10a6:20b:4d0::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Tue, 18 Jul
 2023 09:14:09 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 09:14:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7494331a-254b-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=oewPEfAXJNlTowQQMZdG/DjE/qIyxPXNFpEVtsrlMooFZnOuqBtblWzEhdwUZwuX1S9cCcaeiptedwNXNZWI3rXC12Eggr+Z4NKaWJ5jYcY0gcmWr/RHc4py9WaGa8ocfFygeCbZqaSwLYBJrxLOnDixG0YpueLCXM8dKX84JNcsHEjn01q0xp6CGxRW/0WjYUZvHTjVTVYMdJJZ+6ev9oUL7IqIgD0KjaVjwq4Oi2iNCqWc5wkwZKxQ5F5b+n+uPMM0txUT6FJcUJlJxjbO4/+kKprbxIRfYNtnTw0CLlf80e3vAgBTbYd8RHoj6NboVA5hXHdZp0Em+bUiLPu2pA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=tJ1FVgIZBVoTuDolSqCm/u+wGurjeArm99H4buP9cCk=;
 b=a6NV/3H1B/aGawAe6W7tynb9op6xFGN/cdsHQ0oXpKW/1qD0GkaZtMDqaOj6gPHYI0vIrCcJuR/okGG+5GvSkIHUTgYKjpKRhYn9MKD5cogqOhjXC++wUAaIlNwrrDQKAT6SHKgEnGT5xHOlSFZ3eOO3wxD+TaBfWhHYoUvmAQxvnJaqjVPvdwBvJS7FaL7xgjuX9le4XKnmnljbmPHQuO73UP/WjZUgNGawvEHT+lbpgSPnZsu4M5uK1UOcgGToyR+VL4iWNgE2I353iHWpmLnvUOBUJwTh3BSn+2HsP+YQefXHnZcMfx6AF8HXlf/ST33AWXoSX3LQR/5gZZ9atw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=tJ1FVgIZBVoTuDolSqCm/u+wGurjeArm99H4buP9cCk=;
 b=Gw/QXOMRX9pbPJzVmjAEZtY48h/dXqqn5GZosP9drJYh03iO1NXkyPJ3R1ramMrNnJODSFL+K3rhcozSp33xI8xOHXeUywbfDtmZQ9yOzgpXhDT3tw8S2LJOvkVNyR10G7nLOqY6PD0f7bPPiLIQGteT3Y7HMYAGquo1d34N4ocAgWwTfVrKdj48z6C1xJT1gX+ml8Yl/eY3o9NpNm0T3GbAL4pmKEOcVo2E1r96Ibu6QZWWH4FM2DTd7JGXf4ySsjz9bU9zreDcSfPycwB1J9BR2BadFeU614Yj4XHvWlA6hNvipEnfyPECJNqu4JmgMC7yEcC0+qtkYhK5nL+cLw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <24b08aaa-cc1b-bb86-b5f1-b16f1cdd2533@suse.com>
Date: Tue, 18 Jul 2023 11:14:07 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 1/8] mm/pdx: Add comments throughout the codebase for pdx
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-2-alejandro.vallejo@cloud.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230717160318.2113-2-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0268.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b5::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS1PR04MB9502:EE_
X-MS-Office365-Filtering-Correlation-Id: 0acdb469-0abc-4a82-9264-08db876f580d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	k4VKinUKATD8xG1m+Pdnakzw2BY7IR8aEij8GsUMszwfTCMfwbsUOOeXA53Plbqx5qh+YQ3Iy9oXRrtuSo5UN6oju9tdFGx+rkkHY+vmNJ/ysyOSMZSSYiuLZfNN9g+rmnAmfE9WtoirAV8hIQNcIZIapAwqIv3JR5vk4GqdjRwGpf0pvMhVuilh0lXKMlwt0osmVD44FG7+JEgcQXwregqR31O3uaYTpTBhB685RB+rXwPXpy6zKwtrOBxF800mEs2lz/kEgvi5mwworor4gCZDEFc0XCa4DqgI+HhnOskbb8XRXhp3LacjAUFld4YhT2xSrpu8CyLSjw/XJKhfpPpP+N0LttrDJME/jVXja2FG8Oa9hK7KFin6/L5PpQpfhKc1zqxEU4m9mPSqW2cfmelsT9RudDkBmiopK8EWAlmeIM8xyHKXb3pgxNx7t+ob8ZHzsqUX+dg7w/3BehIMvIUbFW/JlmT6N3EC3Yagizj3m51W8PAzZP/LziiaFtYNHV4b7TV2ATbwaAh1hOQkxID+k0icfOHE3Zz1vYxIrwCCsu7dLfzxteNRfV4rd1G5FXzUZfHrLKndjRcOioPx3BJV3QHqhQqBhSaspPXRURlhev7qr+Rrf7uUcbo9GxAdtycPBA03wWc00bAjM9Jz7w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(136003)(366004)(376002)(396003)(39860400002)(451199021)(54906003)(478600001)(6486002)(6506007)(186003)(26005)(53546011)(6512007)(2906002)(4744005)(316002)(66556008)(6916009)(41300700001)(4326008)(66946007)(8936002)(8676002)(5660300002)(38100700002)(66476007)(36756003)(86362001)(31696002)(2616005)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QlVFbkp4NXBtOFRtWm9EdGhJUlJYc3ZudWovTWdwajVzQ3BWN3ROZDlTQ05p?=
 =?utf-8?B?US83MXJYZkI1UDQ4OWJTanFZWWl5SzVUbmNSelJpZFZ1WWxzTG9uQWFjOFQ2?=
 =?utf-8?B?RDV3Vmp2Y2tKa3ZKQUxqVWp4T052TDRnUWRjR2hJcTZpNndqV1IwbFhpVjd3?=
 =?utf-8?B?S1BJTEl0Q1p4L28wL0Y4eVZ6VFFhanR2ZXRtdmNQSit5RTY1bmNKd3NLbTFx?=
 =?utf-8?B?MFpCN1RTOUhmWjB5eW1jOXZ4OEZOZFJJK0JrQXlwKzRLQjZHcjIrZlkxYk5j?=
 =?utf-8?B?SmtNeWhxczdXR1JUUnJaNm1HSlcvRWJxWXN5U3FHZkZtZmNqUWIvRENVbFJO?=
 =?utf-8?B?OEdPOFdQMkI4N0toSktxUnZLM1FSWERyZ3pnWktPY0cxSVVyTEhZYlNEMGdp?=
 =?utf-8?B?aGN3S0VoS0tweXhVbVU1c1NaUXVTV0NZdzZaY1N4UHNmeFNCYk1UVkFIajFI?=
 =?utf-8?B?aXY0TTFHNENaclhSL2ZwWGszRkdaaTlmemE3Tld3UGhTTzFFcFh6MWI2bXlG?=
 =?utf-8?B?YngwazgrbmRFNmtZRWFyVy85elNRT09OV3NOUFJ6Y2M2aExiSXdEbmVtM3la?=
 =?utf-8?B?eVpheUN2UHkyS3IrczVOL1l1YW1FM2xJbEhELzhzUjAvTGNMWlRVQUM1cDFh?=
 =?utf-8?B?amZXWjNxdVNidVhNenFNcWRkd3pRbFFaRG5WYzltTXVLdlBtYVhYbnFxNDlt?=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U1c2RDcXlyQ20xM0RSeGNmWStnLytiRkEyYWVCM0li?=
 =?utf-8?B?ZFBHZWxVUEdFOXA3T2tkY3hmTEVsTE1PRWNKanQrSWdPR0RaZ2o2c0VNWVBn?=
 =?utf-8?B?K3FQczZwMlhnT2FaN3pOcVRoVjJHSzlPTTYwdWIzMFZ0M2FlUnZrNFNMVksy?=
 =?utf-8?B?RElGVGVONDBVWGFPWlRqZzI4NFNDR0VoYytraVVjUmdLR3ZiNVV0L2g5NXRk?=
 =?utf-8?B?UWxHSFVLMTBpUm5HMEp1aWZBZGQ4N0ZkMi9US0p2Z0xMU3ZpcUNKcklxTmxm?=
 =?utf-8?B?WkRLbmdqSkd4ZGhqSmxtckxCNDZWZkZ3MzkrUzEwUm9pZGFFSmwrRVZYSmJO?=
 =?utf-8?B?N3VEMzIvbjdXTHZnWmtIME45OFA3UENMMDhIQzFMbmRMeFlET1Z3UmNMN1Js?=
 =?utf-8?B?dTBUdzZlemRiMHF4ek5DalhXMTdJNUhRR29iMWtNalB2bXBCYzkrdnZpVkZa?=
 =?utf-8?B?M0V6WkxucE43MEduZkVJZHZDY0VvTnpmdTZJM0JObkhQMFBqMFNwYkxXaXhW?=
 =?utf-8?Q?IH58OGcqosh+QQbviRoJMrwKh?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0acdb469-0abc-4a82-9264-08db876f580d
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 09:14:09.2418
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: wnkql9qj9KRr3qDYjRguXx0KcUmTZmMCPiSmqT5RFAUz5BfhiUDOMrD6XVGKhiV5QDkgDB4PEyWkQoOkHuOnzw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9502

On 17.07.2023 18:03, Alejandro Vallejo wrote:
> Document the behaviour of the pdx machinery in Xen. Some logic is fairly
> opaque and hard to follow without it being documented anywhere. This
> explains the rationale behind compression and its relationship to
> frametable indexing and directmap management.
> 
> While modifying the file:
>   * Convert u64 -> uint64_t
>   * Remove extern keyword from function prototypes
> 
> No functional change.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Tue Jul 18 09:14:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 09:14:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565002.882779 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLgma-0004sx-0X; Tue, 18 Jul 2023 09:14:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565002.882779; Tue, 18 Jul 2023 09:14:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLgmZ-0004sq-T3; Tue, 18 Jul 2023 09:14:11 +0000
Received: by outflank-mailman (input) for mailman id 565002;
 Tue, 18 Jul 2023 09:14:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=UwZh=DE=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qLgmY-0004sk-HV
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:14:10 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0620.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::620])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7301fcfd-254b-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 11:14:08 +0200 (CEST)
Received: from DB7PR05CA0020.eurprd05.prod.outlook.com (2603:10a6:10:36::33)
 by AM8PR08MB6468.eurprd08.prod.outlook.com (2603:10a6:20b:360::11) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Tue, 18 Jul
 2023 09:14:04 +0000
Received: from DBAEUR03FT004.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:36:cafe::1e) by DB7PR05CA0020.outlook.office365.com
 (2603:10a6:10:36::33) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33 via Frontend
 Transport; Tue, 18 Jul 2023 09:14:04 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT004.mail.protection.outlook.com (100.127.142.103) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.24 via Frontend Transport; Tue, 18 Jul 2023 09:14:03 +0000
Received: ("Tessian outbound 997ae1cc9f47:v145");
 Tue, 18 Jul 2023 09:14:02 +0000
Received: from ee74b8148921.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 7690EFA7-EFF4-404B-8BEA-8ABD91A8B9C8.1; 
 Tue, 18 Jul 2023 09:13:55 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ee74b8148921.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 18 Jul 2023 09:13:55 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by AM0PR08MB5393.eurprd08.prod.outlook.com (2603:10a6:208:18c::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Tue, 18 Jul
 2023 09:13:52 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::c78c:c78a:5ab9:570c]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::c78c:c78a:5ab9:570c%4]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 09:13:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7301fcfd-254b-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=m0XePkEbSWTJC5UIvpPzrh3dN9VnBa8rDJpqduGckaM=;
 b=0qtx2+SQwEoPJJ+9q0fh4RdIJZdEsecAV4Si4zGzYJO9JYQEhPfIHGxqImCFQH7wE+N6VWk+rc0NroWNMhVHWYt0QOk8TIXCFqmd4/R3LSiYZPdSJXIzW/69GqlHT3BWt4ErBdT0PL8myND+QyS+wOWxLrUHHbE3K/ejwpfKL04=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: cb3a192d12837cc5
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=AKOT80SddKV+XYl5btqnbBXTMZ4YIL4VrKaSGN8Y400VI93NancgP9xh/jkx9mcFEbsuwZHXYe5lT81HYH5PIAtyXjxtrKiGAyV+TbohiPntMZZE4CSRKgjWQykOVmO6FhygCCg+xoPjpB9+ffohJ9Gr12gIALmbc5VokwqwlJuqmeob6En4RXIq8+gGmfaMY+gx86lpLNcYmMfNfmw4u+2DpAy2n3wjs/kdoKeSnW4WSzQteHi4pvNmBKnOcwg4htgaaThsj+AvEPXf4WKcvqrm2LRQ+sGS/4ROCcZ0Q3gt+lCe7ygUEZt0zP8wB1rwYfKOqrWrBTmnIGcnRWiFPA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=m0XePkEbSWTJC5UIvpPzrh3dN9VnBa8rDJpqduGckaM=;
 b=QFUmAwQ5TkpH4kVEUU6pgmtIbrubaV66yuBD+BYQkey7N6gbWY7+52+Fxe3qerKzLBoXNCHIRxmI7rX9wIK8SvQv517EOTB6Z+PBm21Y9gNSgWNcZFgNTjyY/T8jzdkKM/hca461pVi9Zwhcf1++MoMdQR8dc3kw9mir/yzo46dZEBAKeiR/XJbUej4H+Ff8W9W2ho0FWXp7jyYs8BAzRCG8bltn9bBSvEwJobynWL7xl7otfkZOY7ZdvamfwQVZUAmKW6AxNxLTWscUIMSTu0lxxQHSJFfhz/JLpEmvHt9N/lKuRTmep69FZ9qEGJCDA22pTg7lZxS2/6Fx03p0Gw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=m0XePkEbSWTJC5UIvpPzrh3dN9VnBa8rDJpqduGckaM=;
 b=0qtx2+SQwEoPJJ+9q0fh4RdIJZdEsecAV4Si4zGzYJO9JYQEhPfIHGxqImCFQH7wE+N6VWk+rc0NroWNMhVHWYt0QOk8TIXCFqmd4/R3LSiYZPdSJXIzW/69GqlHT3BWt4ErBdT0PL8myND+QyS+wOWxLrUHHbE3K/ejwpfKL04=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, George Dunlap
	<george.dunlap@citrix.com>, Bertrand Marquis <Bertrand.Marquis@arm.com>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
Subject: Experiments with clang-format and exclude-list.json
Thread-Topic: Experiments with clang-format and exclude-list.json
Thread-Index: AQHZuVgq6e+RULLXRkC5kSYhxnT0mQ==
Date: Tue, 18 Jul 2023 09:13:50 +0000
Message-ID: <505E6BDD-823F-4337-8FB9-C3294D180E74@arm.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|AM0PR08MB5393:EE_|DBAEUR03FT004:EE_|AM8PR08MB6468:EE_
X-MS-Office365-Filtering-Correlation-Id: 7e151ccf-ce95-46a6-f4a6-08db876f546b
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 cGVSPsyedCh7N7cDZxwG8qrmuejIEeaK3b+DHsbS1qhNtGzLatwPwC/MozsygDfU4u3O3tdmTmVGmDumAidv5elpQT4F8MKWfgIokaB50QlhwGwEv3fWRx3w0tmLOp4IRfBSBJptuMH40eXhq25+vr5zmpXML7U+FEKDLfGblW3TK9/2z5Q3OHU4WIRojpg9PJygc1konIMruhf+cskgLuLfTu2rLGyFXMUPIVQNrGyX7Ih3HlG7e2Pmaa96qRTTFAV3ZZbQM2CubjlmQxIOenjYBJQQkCL8mM4VzHIKQv7Lg3Fun/SY/oJRC9rqkeqTAebbJ15mpp6gKjYaXGwtFm8FY2T55O4ABCKrZUPOnuloo9GhcvAtugPuKBX/x/b+ilC0B/6gdIj040+zCIby1SV6KOh7a/etvE5dJj8gZhLXTxxjaTThuMLkYTHxVu9ws9VZUx5OqGqBnGOlY04jHzYVQnRDcBoOkyQXxH9bxrMOtN8Lc7sM/41no+xNOpfg33R9Mq8cKmgYcgrUa2/eCtKmDF802MUN8eetqW0Np6u+dDuRQZ5jZirgX+4/igKwmDP7tILJvMcskQPcUVmhtLUzxYmO2lmPCHU3E+2TWgZPIB036Cl4L/e4MGUU54H4KoENi1cQjF5fwg+qSX4atHomvTwdRJ/DvJ0d0NBmEjbtAss/VOZgZ71Yt9E6FsKztM5nGPDH/B/bn4b46kAuYw==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(376002)(366004)(136003)(396003)(451199021)(6486002)(6506007)(26005)(36756003)(122000001)(86362001)(2616005)(83380400001)(38070700005)(38100700002)(33656002)(186003)(6512007)(54906003)(8676002)(8936002)(4744005)(2906002)(41300700001)(478600001)(91956017)(4326008)(76116006)(316002)(6916009)(64756008)(66476007)(66446008)(5660300002)(66946007)(66556008)(71200400001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <D9A1C9A3645AC84C93507E5C5773F6E4@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5393
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT004.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	519739aa-16f7-4dc5-c926-08db876f4cf1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	+ur0YLSPZf59K6x9rWGGbbkfnIjV1llgj7ObcFA1N2JWWqJom+yyKSiEoUEIAKHBU0OW6np37rCHIXd/I93u/oeMkjRAGHDxCLsMSVN83Y8jrU71NuNISvFCWiC+Ed/LRuDs60wxNevKWVYlf0CiZfvvofkfSEQeAuGpVt4umhG5Z1ngVUWi8GQ9lSdhMreGGNaBH2Oa2MH4DLI/QBrKNsLMiQ/o63m3UJSrYe0R1HMZNVFf+Qh6FKhn1zM7y4Nssk9ukS6RxAXGHE0i50IAk8gG22ls5fMk1rRTsfmRvjj7r190KhHxAAilm/uokw5aCZZMJxfc0NrBTZscM9pZY5syZiv5BHB/DeCOIqjo9Jqy71iv6tmi1ZxRTd0sZaYayKn1LpJ3FBs0o/M403g17JmLlx+Q7WlOGf+PvQY90Awwo9JG8PYoYr2lGnRK8G46jqbkb0eRwpX/4xbRIHV3VM4DO1x1UsI13XyE7bQtZ/NqACfyCrBDzNNBV2KGcZK0NvTOrKohEXlO9JrxD1ZxcQSmVjavvTMPDgE779RN0LRHYIj6ebni7n/VXyj3eoC3NPvIrs77yst/RqqQOz/xridHGlY97gIQvToPImJKNrGCiubI7v7dXmz8dOO6vl0i8/Q2NcsUuial7UkSy/QxZkwaLC3sWgFJF3JzthjFpCOzKmwe1dTF4hGWbVmW7gOdT7LjaCw+QkFw6kLs/yRUKTD9pC7p/GyC1/ssbWkF4nSuDHi9mUH+8mAK0b/O+938
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(39860400002)(396003)(376002)(451199021)(82310400008)(46966006)(40470700004)(36840700001)(40480700001)(36756003)(33656002)(81166007)(40460700003)(82740400003)(356005)(2906002)(478600001)(6486002)(41300700001)(4744005)(107886003)(6506007)(26005)(6512007)(54906003)(8936002)(316002)(86362001)(70586007)(70206006)(5660300002)(4326008)(8676002)(6916009)(336012)(2616005)(47076005)(36860700001)(83380400001)(186003);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 09:14:03.0381
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 7e151ccf-ce95-46a6-f4a6-08db876f546b
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT004.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6468

SGkgYWxsLA0KDQpJ4oCZdmUgZG9uZSBzb21lIGV4cGVyaW1lbnQgd2l0aCBjbGFuZy1mb3JtYXQg
YW5kIHRoZSBoeXBlcnZpc29yIGNvZGUgKHhlbi94ZW4vKiopLCBJIGhhZCB0aGUgbmVlZCB0byBl
eGNsdWRlIHNvbWUgZmlsZXMgZnJvbSB0aGUgdG9vbA0KYW5kIEkgdGhvdWdodCB0byB1c2UgdGhl
IGV4Y2x1ZGUtbGlzdC5qc29uLCBidXQgc2luY2UgaXQgd2FzIGludGVuZGVkIGZvciBNSVNSQSwg
SeKAmW0gbm93IGFza2luZyB5b3VyIGZlZWRiYWNrIGFib3V0IHRoYXQuDQoNCkluIG15IG9waW5p
b24gaXQgY291bGQgbWFrZSBzZW5zZSwgYmVjYXVzZSB3aXRoIHRoYXQgbGlzdCB3ZSBhcmUgZXhj
bHVkaW5nIGV2ZXJ5dGhpbmcgdGhhdCBpcyBleHRlcm5hbCBhbmQgbm90IGFkb3B0aW5nIHRoZSBY
ZW4NCmNvZGluZyBzdHlsZS4NCg0KRG8geW91IGhhdmUgYW4gb3BpbmlvbiBvbiB0aGF0PyBDYW4g
aXQgYmUgb25lIGZpbGU/IE9yIHNob3VsZCBpdCBiZSBhIHNlcGFyYXRlIGZpbGUgb25seSBmb3Ig
dGhlIGNvZGluZyBzdHlsZSBleGNsdXNpb24/DQoNCkNoZWVycywNCkx1Y2ENCg0K


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 09:15:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 09:15:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565008.882799 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLgnS-0005tG-H3; Tue, 18 Jul 2023 09:15:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565008.882799; Tue, 18 Jul 2023 09:15:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLgnS-0005t9-Dj; Tue, 18 Jul 2023 09:15:06 +0000
Received: by outflank-mailman (input) for mailman id 565008;
 Tue, 18 Jul 2023 09:15:05 +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 <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLgnR-0005lz-Lb
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:15:05 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20603.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::603])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9410e02e-254b-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 11:15:03 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8761.eurprd04.prod.outlook.com (2603:10a6:20b:408::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Tue, 18 Jul
 2023 09:15:01 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 09:15:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9410e02e-254b-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=AJI+4pauSxbGNa8+AKAHhCyoVywNiW2rzCJkNPzIDvNNENMouLbB962mYyjwcUcD8kvmQHO3TQxItol3092ftSZ54VExVpAlyh7nLp8m1cuS6H1uVUHbBhykBJQOmtHiMs3Wqike4nU3opeVdbbfR/15RLhXo6svn2HRliG589MZKlguwgGZrLzftcIHy0S0drp4usTkSHfyejrdXvXkGiU4f6guMHPxElRwPGgOmAZGFA/+1tQEF86ePsk22lJUzV1IioUQx5Lywml5uHrENNMUHhZmfV0CQmuEMnJSiwsXOz3Cyso4cYH3qm4dJBSMY+8cYockQiDgYNGnZSWVcA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0Br4lVDld5EVIIi1pUlzhwHlG0TyfjQ8LZmA1YZFyws=;
 b=em5zEIEK8v3SJ0vOSzlekPekXBeMRR9TN+L1F13X1/fvU0Le5UhpzoK5lU9cTmX90A/SgO6SmoB/JfPWxHZM7ypUdVQH0+BZaFiemLGh3Z8pu/lQ4Z9rYfPpMCIrvUCIO4qBEKHmx9OuiE0QT+OhU/bvrWhx0Sm1lkG/CR+lotloPvwSWo8pV4ZFGYeQ+/0USrSRerEso7zaWVGG+sFU44BuG8koDjScDLcj45kwwCrmtxfuQnSE84wfkOL27Qfk8BZL5geoVf65rgfS9pGODj9g+52mwEgpD82RsEQIf+BGTa46ggVt8FkOR5QuXH+odHNXTMBHM+apn+0dZJ7oSw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0Br4lVDld5EVIIi1pUlzhwHlG0TyfjQ8LZmA1YZFyws=;
 b=exXLu6i2YcDEe/r5f2gwZIYc2uHkF+y9LyCxt4gCjrYw5UMrEGVlHpVWLhx4P3zePJYwlvL8NaFiUZOuPcd+zhKwRw+W2Infkn2Vzh/Qi5WIspPVj+HFSz9g3thPrOEENx9hEjYGTBK81xe0w4lI9wXXzLh+y1PeH4DyruhX7V0EIlKo+Rn+71EEFBS8k11FMJGQx38j4cPiRr5EbSlvnjyfJMz/mlSUR47OcVRXb7R7JGOa98LNB9q9aUhAuFgHiLcodikZ/pGaXe+BT7uPLy/nXEqceGeHfBiWWMwYKXJ9/bhuLX51ae8n20b//mAQ9dbRTK4Y3VOn2ZNRQswg+A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <8cb13c75-9840-b7fe-6a07-71186a068b94@suse.com>
Date: Tue, 18 Jul 2023 11:14:59 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 3/8] pdx: Mark pdx hole description globals readonly after
 boot
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-4-alejandro.vallejo@cloud.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230717160318.2113-4-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0270.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b5::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8761:EE_
X-MS-Office365-Filtering-Correlation-Id: 883c222e-9eec-4343-9a70-08db876f7767
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	BwW/TCHvihGC5hWVpjh4rLmdhBhPibnSQtx/RptBW/3o0ADYj5n0BPXwlB55GDbXQD98V5wygMita6iGspu7Qvk+AKJvWUsBRpGhwoAqoSOQ0uLk9v4fCjFt1joqU7ZARKyiqHqyQTbqiLZ6mXz0YIoEnQnpuDbDW0IZzTb08CIqU2lVfYz486xUCtaJKvY/RbWrnFgFdujx/V6ApfT+TP25oDMh6nvr4qgcPYXTZasgpYB8egs1gU62Pd+R64seFbXuSHpGBCKkiIrCHLEajbuaC7+obpK6z0LPgHjQTQTX1If9m8BmXVgsOJylqw036uhAj7C2A213DKmnxTYB9AthVwXFHcNDUIT0SYsVqnDRGNEqA0xvEGQxnvlru92nyDXAhZ3VAvSgTyOYfeTTsEWX4eFTv/kdP0QPbNtoijlQzrPfAC1QML68Hrz/dzlEVayxE8gKJEr8bVRJmd6ZQz+wdF0r19jx3fge9KCss5ZONg5WXqae5/B5HUaW1pnl4SA18sqbTsn22G67CoJFyX6qDbMm15UBvM85yvgAhQTqYo8iJdfbOfPsJM1NTYKwnLwMz0sdSSrzUZG+qR0tv3PkAO2rjHn9keZQU2z+JfDnmq8FFuJNBoPlZRxUDjcvc3/XWQ7BVbHWPhmJyOOozA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(396003)(39860400002)(136003)(366004)(376002)(451199021)(31686004)(6506007)(186003)(26005)(53546011)(54906003)(478600001)(6512007)(6486002)(36756003)(86362001)(31696002)(83380400001)(2616005)(316002)(4326008)(66946007)(66556008)(66476007)(41300700001)(5660300002)(8936002)(6916009)(8676002)(4744005)(2906002)(38100700002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bnVLNXhPMVc0ZjZGNjRNc1E2M2NjaXpFaUlOSGdVUzJKRWVNaDBOdEpFdnk5?=
 =?utf-8?B?TXArZlQ2aytFN3U4ODBlNmwxY2Zia2RaK0R1aTFzVWZjRWJIOFAraUxsUTB3?=
 =?utf-8?B?N3hTdXFMd1JFZE4zVDhZMFY2bTM0WGVUT0tISG5ZZFN1OUo5OXd1U1lHOEVh?=
 =?utf-8?B?RzZMSGRGcXo5a0ZiWEt0ekJ6cnQzeG9CYWN3dlhzKzlxeGpsYzJQS2QybHBq?=
 =?utf-8?B?NzA2eTk3SHhjWEdDd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?B?YktlcTBRMnk5ek1oTUdtZEp5T2lLemNsVExVZWRiT00xQWZ2NCtGTUJ6d3JI?=
 =?utf-8?B?aDYxdExwcDVudWFOWHNkb1dBMjBMVC9Xa3g2TjM4QzZlcWpmbG12RnhBN2t4?=
 =?utf-8?Q?aD1tqOGKOAPA3ipqoCGA/d3bH?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 883c222e-9eec-4343-9a70-08db876f7767
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 09:15:01.8901
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: BY+WXsMphpr2a5bjoJ5+6HCn2GrGED8XnyIFDGiVbJWWLiW0kdkO6Q+f2DRTxJnwQaZg+JwEWoeyYbVGSPpdsQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8761

On 17.07.2023 18:03, Alejandro Vallejo wrote:
> They define where the compressible area of valid mfns is, and all of them
> are populated on boot (with the exception of max_pdx, that's updated on
> memory hotplug).
> 
> No functional change.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Tue Jul 18 09:20:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 09:20:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565014.882809 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLgsH-0007SS-6I; Tue, 18 Jul 2023 09:20:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565014.882809; Tue, 18 Jul 2023 09:20:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLgsH-0007Ry-33; Tue, 18 Jul 2023 09:20:05 +0000
Received: by outflank-mailman (input) for mailman id 565014;
 Tue, 18 Jul 2023 09:20:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLgsG-0007CJ-0o
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:20:04 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on20619.outbound.protection.outlook.com
 [2a01:111:f400:fe13::619])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 464a5a9c-254c-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 11:20:02 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU2PR04MB8791.eurprd04.prod.outlook.com (2603:10a6:10:2e2::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Tue, 18 Jul
 2023 09:19:59 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 09:19:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 464a5a9c-254c-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=dKFDXSBufWa4z5msnKa0EuiFrFJuHkTUQPs5dYoubd7Ut87Sd0DrRD15uNB4nL4BEmGJDh05PceAy/wgDZ7zk2uHl0CPLzu3ez1OdHQgiw6WufW6LKiuBN2Yhn5cQFrXpC+rK5SYyrMDy8e0ED0WBbAscZeAVFgb7YV7CVmFVLBut+q/ZdCqvnDQFSmZRuY+bw1NEQDzj3vp7v0SWtDKowIfpDTH3h2uaofyMvHnIv511oYT/2XsV9wnBTvRVi8PZYRD1aGY0hZDgGCb2Rwb0dGTwJrIwRWXucex+Dh3k/iu/y0jrRSGg3s4+chTSxrvpqMmCGjqXMbu5UaI1Xdf2w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=EQCE1f9ksBOKVEgge7qIuKKq9qO4QWavw3NBoBaHnME=;
 b=LovbGuOmNL4rozw5Mp1+ZWmjtAWVCuG7hmR78gIx58onqZxmKgtI+MUUSgBaNo6+RxOfrFHS0w2hv4AYwZ34JHX1DJ8nwAH1LYwRINcOKPqZLOB/x/EMWANlDCuU7q97cZ9z//PUjiCv51W2u5rs4DCNRofB9M4AF3I0DojiZxGde58guz70sGMOe4ruvpCTByoMxUeDO+bOcAc1rrHpIRb6n8gV41dQ/jT6+ur66Gq37ZLRsoJd8Z4kH6Qxi0/jlu/jSG3/TJS+7REbTlztrI21/OfD+vh6vIXI4fVs7TF0faD4l7cobLS40GKrQf5GudC35TE6Jff+s/6uVkbp4g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=EQCE1f9ksBOKVEgge7qIuKKq9qO4QWavw3NBoBaHnME=;
 b=bb4aGRG2LA9Ercbkduva/DLD3n2fAXT8I5xwJoMUll1PtOxVQWIzSlpFtFqN6X5dqU91r8Ko3fDptPqUIX0Q6Mzd9xwTcHrisXlbqIA//zIxJlGL8h5CqnvY4gIp1IWoX3ai84JArEWIC4mOuokTc8QEd1oNhGRqnN4bVurnaIahhMNVEcJ4YDYnpLXwknWmIJgrUrgqmqV9YqYDB69eZxM1wP2ZSp+giYJ0A6bKm1NN9NQPnqP5TDWSma0+R4hQi71YKvpz4v2nWZb5225tq1Ni33IvkMgtBvNxijYZE8Z7LgCpnrUBIYrNOZuzJMM8StuQUSUW26vEZTeRnfM9Ng==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <7e5bd2a4-d810-cc48-cf43-3ad64e501d55@suse.com>
Date: Tue, 18 Jul 2023 11:19:57 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 4/8] build: Remove CONFIG_HAS_PDX
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-5-alejandro.vallejo@cloud.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230717160318.2113-5-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0249.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:af::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU2PR04MB8791:EE_
X-MS-Office365-Filtering-Correlation-Id: bbf77b40-e3ed-48f6-3cb8-08db877028fc
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	zv8il2pYX53MIw+Frhk7VGJqGYpnk1eDpsw3e0GwPpn3ci3URcNZSkL0TCVWyrMMPPJiIEJ8xlejTQ/lsTueLm4X+ynIY00CuQO304NPHvuL5C33IGNKYZC8Ui28aWJfTQz/d/RMhIEFpTbqysuQ5WRSNBd59qrLbNGTWZeJNCdgaavl/i2oLCr0omM0JysAoTWmrnAfY5ZYs0+EwLeOPlLsToD3op2Q2bIm3k7P6iW+rnf4nJKSfvesfgr2Q5K8p0DyP9A5o3e2kdaRBQFZ4+dW52Wvxm8FGijkD0ZuJdTgn7JjT4wrYjTnY5YT9Sx8+gUcau5omJfpfIaPqUWx8p9lqfmBj08XmzdnTtQ0L9rQua/CPYwJMNmmRVUaFI88dLVTy0q3JoWklBPkZJp7JdyVOCnJLcqaNeNAgdK+MdPcAT/vKeZO+/3DKCQ3TyrYjdiR9ycUW6bV//djWQe93LXjTtpQ2ArNvUco23od3vr0y5N9I2yMIMJHESuCVBGh+6CCh+ZfUvuyYIT6zy+MuSpBtYhNVHEehR/2o0NnebAleqowu9wD3mjUhAxDJ8ySB7+bvIXmg750kg77RZVPotcCtFb5IFMXvZsSXOjSq2u6OvpHOfGS4fnUzJ2fcTzqZeB5TueHeh1SFFsBs45DKw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(346002)(376002)(396003)(39860400002)(451199021)(31686004)(66899021)(6916009)(66556008)(83380400001)(2616005)(41300700001)(5660300002)(36756003)(86362001)(31696002)(7416002)(8676002)(8936002)(38100700002)(6512007)(316002)(6486002)(54906003)(66476007)(66946007)(4326008)(2906002)(4744005)(478600001)(186003)(53546011)(6506007)(26005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?S1phTkJ2ckp5N05RV0Y3MDJpUjJENTNBVDZEZ2dKKy9QUXI0NjhtUThCWVQv?=
 =?utf-8?B?bzJOc1FTTTFtUnd2SnNvR3dLZjJSZ3AwMUVMUjI5a04xRjBXbEV5NGtabi9V?=
 =?utf-8?B?SlpINjBnSEMvOGhwM1hMVFR5cTFOK1JIdkNXYjNoLzI3TjE0MzB1NDAvUW4w?=
 =?utf-8?B?VnlURnJzbDM2cmFxR2NxMkdsNGorbkRzYUxkcTdpeTM4dXFzaVNmSVpHZlUz?=
 =?utf-8?B?NldFaEZUMytiVHpOYndvbWlHV2J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B?VG9lVFoyZUc3bDZWQi9QR3VvWU41bElRYVVsQVRHUWNFSmg0ZjBzZEdaUTNW?=
 =?utf-8?B?c2xBaytsVm9aMHdSMHh6Q2o4VUk4SGNTa2FHNUIrRVJtZDFOcFRySXZLN1Zw?=
 =?utf-8?Q?vugfB2qCulZprhKHqVw2Br9BG?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bbf77b40-e3ed-48f6-3cb8-08db877028fc
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 09:19:59.8129
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Uf11eJ4tYXvxLzGH2weXR6GjG6xn+rRlrlrcT8wK/lMwq5/+07LT+R7Pn8bEDX9Fi7phdpBuwRPeAbFmiLlSXg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8791

On 17.07.2023 18:03, Alejandro Vallejo wrote:
> It's set everywhere and can't be turned off because it's presence is
> assumed in several parts of the codebase. This is an initial patch towards
> adding a more fine-grained CONFIG_HAS_PDX_COMPRESSION that can actually be
> disabled on systems that don't typically benefit from it.
> 
> No functional change.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>

On its own I don't think this is okay, as it's unclear whether it would
affect RISC-V or PPC in a negative way. If at all, it should only go in
together with the later re-introduction of a CONFIG_*. Still I question
whether that new CONFIG_HAS_PDX_COMPRESSION (which imo ought to be
CONFIG_PDX_COMPRESSION) then wouldn't better depend on the arch-selected
HAS_PDX, such that it wouldn't wrongly be offered to choose a value when
compression isn't supported in the first place.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 09:23:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 09:23:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565018.882818 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLgvh-0008BY-KV; Tue, 18 Jul 2023 09:23:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565018.882818; Tue, 18 Jul 2023 09:23:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLgvh-0008BR-Ha; Tue, 18 Jul 2023 09:23:37 +0000
Received: by outflank-mailman (input) for mailman id 565018;
 Tue, 18 Jul 2023 09:23:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=c9jt=DE=citrix.com=prvs=5561f9d71=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qLgvf-0008BL-W5
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:23:36 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c387baa8-254c-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 11:23:34 +0200 (CEST)
Received: from mail-dm6nam12lp2175.outbound.protection.outlook.com (HELO
 NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.175])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 18 Jul 2023 05:23:24 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB6682.namprd03.prod.outlook.com (2603:10b6:a03:401::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.26; Tue, 18 Jul
 2023 09:23:20 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 09:23:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c387baa8-254c-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689672214;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=XVkU1XfdVEIvw3mZ8pbaWLFSbMFhOl+4y7A/y5C1Dq4=;
  b=d3wA1RMjY6NyHLFuJyxZMqUPrl+cqKcUAoKtyhroBDT35NpmVN+69Rac
   72DnjST/gjBw3E2QR0DHdl0EW9mRDYO+VBAKj48Aol9U0gyrJUnnJnIig
   o/oOQzUVtxdOyQ5fufjFx28tvPYTr9uMVjq/NhBV2HXOXUEc4Hx+bYEQs
   I=;
X-IronPort-RemoteIP: 104.47.59.175
X-IronPort-MID: 115274066
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundM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gspbnmJE42igfHGebTM2dKYRJd
 6z5tdnuzHlQngedMK9b0N1JdTrlpnklI/GfRVDPBIs6BCPgTS0gYSKaCSw71MxUy5v3bxnym
 TOkxX46qK/99m3xwTRzXW71eUnpPLRjvVCGe2RgYwuJjLghh3AXvUYZ4G/
X-Talos-CUID: 9a23:NKbbXWwszjbm85hRzc1oBgUYFucrc3qF3E7/GH+jB0h0UKKOR025rfY=
X-Talos-MUID: =?us-ascii?q?9a23=3Aud4IOA9rBf1IvHYnfovvyxCQf/ZDxp+BT2wgrZc?=
 =?us-ascii?q?PksyaZCx+ZRHEnTviFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,213,1684814400"; 
   d="scan'208";a="115274066"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=J8sNwryxuySbuT9pNmYR1k96eBexGTtkb2ku+IRQeXIcXOsDvHugRW+97nXevoGRInz4s/C2xrgFZlu5CwNiSB2ATRezeiGcP9odimtCTmmTx1+rqMS2/EbczxsTSNIoMTgV1TzZJWrAx1kXYn+rywvqy9Me1Kzk+bDLhUGl5TMDDdhdZixeCrnTDtqEu0zTiSNFqANbEql/uiT0QcB4G1Y5/49c2n+GNIehzQ/rwjpITYPT6ukLskuUmu8TNnc87903T0OcrjPD/KRtopWCkA5fNqqMvF0ZouEWEXCmdpXs4M30ATgbm7xcCHl01bxqEj0zUX31tBwL0JGS7CgWgw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7rKHUeiYisf/q/yzFUZJCgj5s4jO4cu7ZwD//Ugdv08=;
 b=hTbRQSnsr15i47BIr3Cgqt6Ro6jwDqcYZxEQusl7AoueRt1EES49rBuOEbwpE3wG8dWL7M2ImL6WQH/FE17jJcvrQZFJMblRtLVkekukIO6GDFs5lXIwSe0QduVswvYcW2H43wEPoGg89RCkQw2EEbhML3YQBwBb2Q9eTfLPMPZy638cAn4tPmOwj4q9C7j3YzPUGGMQkqk6TxeCOUx/IEOYArpwwTWiLywPZ/2piKzqb2U4TzdauXwgwX0glFAlRD0KcmOZr66h+6YkKsGp1kvyz141d8vbHlX/AvcOwYNO1y2Zi70vtHJgJa9ApyimJIYXF7ANnrq8rXmqo6HJhw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7rKHUeiYisf/q/yzFUZJCgj5s4jO4cu7ZwD//Ugdv08=;
 b=fCDJ+7NbD9PaaP8iIlswINK9p0ev7ImXfgBD3Dvw6hos+jVr2Msd7+XXug9Sc+GYAKC7gUoTW8mO/uGRzCIZhGBodTqTXfIiCpc5PRhjOVKjQGSEpC01LIZoxQ3QnN5dVe2PzTarJ3ioaJEleJ773bKsGyrleCcM1FDmf/7ZETc=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Tue, 18 Jul 2023 11:23:13 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: xen-devel@lists.xenproject.org
Subject: Re: [OSSTEST PATCH] ts-xen-build-prep: force use of git protocol v2
Message-ID: <ZLZaAQu7gD5Y0KZa@MacBook-Air-de-Roger.local>
References: <20230717141745.33470-1-anthony.perard@citrix.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230717141745.33470-1-anthony.perard@citrix.com>
X-ClientProxiedBy: LO2P265CA0501.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:13b::8) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB6682:EE_
X-MS-Office365-Filtering-Correlation-Id: 16985a79-37d5-4027-60f6-08db8770a06c
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	RaZJxFKMehar7mk5ePG/JoRSV3JMQb+Qb4PZ1zEQefyeCBoPHW2tXia5kfb2aQVbnlISEzRCDnmX/wK5aZjMXKaIxEn0Iere7nWFhNSaXc2Ez8UQ+niQCgSDq8E2XOFc/1V7Tr+5aPmXVyfr7bYt8fna6tXBA1+7X82EoKxFEC8oq+AOYZy4cY75fQkeN7NVTVVwnR1Ehg7lqyUTDB4P+19Is9gTMxBMmZiEfoocufZwpJmQeUP/2FiySupOXSggY6l1Kjlz2ml4ksZTB0pyfk8DCH4Yjquzp7OBNjS14BcDrGzD7pOnH20fDB0NeVw1wJqx5CmHJbIZuqY8Mt71ab4XhTcCMVgQ0CjEB3zzbqsjNGlBND3GrtrucqrstIP920AsOTrtyQ++GnNoWiP6RTvl9Y0CdKADdvCiveukU4naZ1jmgWh+KhhDndHFcxgQgwILvCAc+vt+4U+nOCNwM4cCo3dtVZE9O950pfH0VHeB/qOhK0oN9S3HJ2ii9z4wZkuvJIGcULx6On+kzJfMjhTkbmGvD0yVvRxeP7gj+ec=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(366004)(396003)(136003)(39860400002)(376002)(451199021)(41300700001)(4326008)(66946007)(66476007)(6636002)(66556008)(316002)(2906002)(478600001)(6862004)(8676002)(8936002)(5660300002)(6666004)(6486002)(966005)(9686003)(6512007)(26005)(85182001)(186003)(83380400001)(38100700002)(82960400001)(6506007)(86362001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TzJKdjgzYzkxb0NOM1Y4ak93V05IWGFiMnhSYS9nSlRpZEdkbnZiSW5waVc4?=
 =?utf-8?B?eXdpNERJVEpldWR6TU00WVVHQnNLS1VxWWZQQmZHcnIzdkhKeCtFU1ZJcWNQ?=
 =?utf-8?B?SWlLZHJmQUZwbTNzekhzTC9VWFk5VDEzTUJFQ0hLN0F2NFkwUHEzNjZBSEtN?=
 =?utf-8?B?R2pKdmdTMVQrNEY0YjRScXQrTlZrcW5mTHNINTVTWVJ5SVdUS0dJaEpLN3A3?=
 =?utf-8?B?cThpVURXT0U1QmhNVko1NVlTZEdEZHg1YStIVEpmUDFaVFVRWUFtRnVSV0dm?=
 =?utf-8?B?WFlmaTd5amlWczM1SmZSMmpLMk5rbjZaWGdwUjk0TEZnbWs1TGpCbENsNW1K?=
 =?utf-8?B?UDRFVHJad2J3M1VDYW01L3VMT2JUL2QwSjBNRWFQOHVBMlJ6eVlPTEtYMTAv?=
 =?utf-8?B?cWp0Z01XY09uY0xmNzluSHM1b3ZBL29xRWdiV013OGdMR0hkWDBlTDVqT2Nv?=
 =?utf-8?B?WW5HbEJ0MFFEd1kxdjRhNzhESlhHMHRYU3BHeUVXRlBhbTZ5ZnVPVERpVFpU?=
 =?utf-8?B?NlJOTWY0eXBkU3RURlFNd2owR1AxYVYzOTlHZk1jQUU4Q244TS9telBJUHkz?=
 =?utf-8?B?SHp2WVpwQU5CeHNWZjZEY2REWVBXczZQMnlGRlBpVTFDN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OFoAjp8/JKuXhErhVX4EJwIg4uA4/061aZTfbty/yvMHUHhiSqJeJH17gqbaTUOxq7y5rnWnkFzrF0oBkuN2Q6GcXqFlorVpYVXbhG66IG4Qbvpf2PgKFO+MdDwUoEh5SantpqNyUzBpC3y/bdl2UwmieFMA3Frfiebh6w2SWzITPSR9r0kJ6zcdzWxe4iiCgY/7modLqyBpO2sTNLes4YfVCCdV5rKL4NeR5cwA6dVOBYdtEMfxHryKvAiSGYL6PS8UQwxZpJ7A9x9m39a/LolvD/YEwmdFIl4BjIW5htlMthTkSaZf0Ev0JzXNFJVVOK9Cq92MlHnfgME1qk9rOGvAUaxeEz0aXBi6dadP1DHVkkuIVwNw4igSVXo53OE5AfFjsS1P9JAh+yeeNv4g7e7EYNIFe0D/r+cPD/a+OcdgINtMaiZHe0wPYtTyO6COUI1oStGshid0+6OunLyIkihEaFMesAIq8Mf+fhfGAz3BcIQO5YKSL1Qh3kRtTdosQiFbUZ0s3n1+NkBOeuPgiYqsfBUZXmSYWWHIXE0IhwV5VLHMyTa3g==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 16985a79-37d5-4027-60f6-08db8770a06c
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 09:23:20.2196
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: A2MuQIzXUeIKvVvWZbW7YKgL9w38J3fTmwZ44Nr4VR7VJdd21oPUIvykiHbJqMKXNSvxrFc+irIsUTTTJjKwzQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB6682

On Mon, Jul 17, 2023 at 03:17:45PM +0100, Anthony PERARD wrote:
> Recent version of QEMU (to be 8.1) started to use meson subproject to
> clone extra repo. With the example of the subproject "dtc", they do a
> shallow clone with a sha1. Meson end up running:
> 
>     git fetch --depth 1 origin b6910bec11614980a21e46fbccc35934b671bd81
> 
> This command fails. I think the error message is something like "the
> remote end hung up unexpectedly", on Debian Buster. A more useful
> message with more recent version of git seems to be "couldn't find
> remote ref".
> 
> If we allow git to communicate with the protocol v2, then the shallow
> clone works. But git on buster still use v1 by default. Force it to
> use v2.
> 
> This needs a git-cache-proxy version that can allow to switch to v2 of
> the protocol. A bug is open upstream to track this change:
>     https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1040476
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Acked-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 09:27:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 09:27:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565025.882849 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLgyz-0000q1-P9; Tue, 18 Jul 2023 09:27:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565025.882849; Tue, 18 Jul 2023 09:27:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLgyz-0000pq-ML; Tue, 18 Jul 2023 09:27:01 +0000
Received: by outflank-mailman (input) for mailman id 565025;
 Tue, 18 Jul 2023 09:27:00 +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
 <SRS0=UwZh=DE=arm.com=luca.fancellu@srs-se1.protection.inumbo.net>)
 id 1qLgyy-0000LP-1t
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:27:00 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTP
 id 3df795e6-254d-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 11:26:58 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 40931FEC;
 Tue, 18 Jul 2023 02:27:41 -0700 (PDT)
Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.1])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 299CF3F67D;
 Tue, 18 Jul 2023 02:26:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3df795e6-254d-11ee-8611-37d641c3527e
From: Luca Fancellu <luca.fancellu@arm.com>
To: xen-devel@lists.xenproject.org
Cc: wei.chen@arm.com,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH 2/2] xen/misra: diff-report.py: fix function invocation
Date: Tue, 18 Jul 2023 10:26:36 +0100
Message-Id: <20230718092637.2433974-3-luca.fancellu@arm.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230718092637.2433974-1-luca.fancellu@arm.com>
References: <20230718092637.2433974-1-luca.fancellu@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Fix the invocation of invoke_command() that takes an optional
parameter for the exception type, but in the code the error
message template was passed instead, so fix it passing a new
exception type.

Fixes: 1d7c45f895b6 ("xen/misra: diff-report.py: add report patching feature")
Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/scripts/diff-report.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/scripts/diff-report.py b/xen/scripts/diff-report.py
index 636f98f5eebe..a1fe6bc2fccd 100755
--- a/xen/scripts/diff-report.py
+++ b/xen/scripts/diff-report.py
@@ -13,6 +13,10 @@ from xen_analysis.settings import repo_dir
 from xen_analysis.utils import invoke_command
 
 
+class DiffReportError(Exception):
+    pass
+
+
 def log_info(text, end='\n'):
     # type: (str, str) -> None
     global args
@@ -97,7 +101,7 @@ def main(argv):
             git_diff = invoke_command(
                 "git --git-dir={}/.git diff -C -C {}..{}"
                 .format(repo_dir, args.baseline_rev, args.report_rev),
-                True, "Error occured invoking:\n{}\n\n{}"
+                True, DiffReportError, "Error occured invoking:\n{}\n\n{}"
             )
             diff_source = git_diff.splitlines(keepends=True)
         if diff_source:
@@ -105,7 +109,7 @@ def main(argv):
             diffs = UnifiedFormatParser(diff_source)
             debug.debug_print_parsed_diff(diffs)
             log_info(" [OK]")
-    except (ReportError, UnifiedFormatParseError) as e:
+    except (DiffReportError, ReportError, UnifiedFormatParseError) as e:
         print("ERROR: {}".format(e))
         sys.exit(1)
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 09:27:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 09:27:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565023.882829 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLgyy-0000Ln-3R; Tue, 18 Jul 2023 09:27:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565023.882829; Tue, 18 Jul 2023 09:27:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLgyy-0000Lg-0T; Tue, 18 Jul 2023 09:27:00 +0000
Received: by outflank-mailman (input) for mailman id 565023;
 Tue, 18 Jul 2023 09:26:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=UwZh=DE=arm.com=luca.fancellu@srs-se1.protection.inumbo.net>)
 id 1qLgyx-0000LV-BX
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:26:59 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTP
 id 3da6c0a6-254d-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 11:26:57 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 63D9FD75;
 Tue, 18 Jul 2023 02:27:40 -0700 (PDT)
Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.1])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4CB803F67D;
 Tue, 18 Jul 2023 02:26:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3da6c0a6-254d-11ee-b23a-6b7b168915f2
From: Luca Fancellu <luca.fancellu@arm.com>
To: xen-devel@lists.xenproject.org
Cc: wei.chen@arm.com,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH 1/2] xen/misra: diff-report.py: Fix UnifiedFormatParser change line registration
Date: Tue, 18 Jul 2023 10:26:35 +0100
Message-Id: <20230718092637.2433974-2-luca.fancellu@arm.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230718092637.2433974-1-luca.fancellu@arm.com>
References: <20230718092637.2433974-1-luca.fancellu@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Fix the line number on the registration of a 'remove' change type when
consecutive 'remove' changes are registered.

Currently the algorithm registers consecutive 'remove' changes at the same
line it encounter the first one, 'add' changes type are not affected by the
bug.

Fixes: 1d7c45f895b6 ("xen/misra: diff-report.py: add report patching feature")
Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
---
 .../xen_analysis/diff_tool/unified_format_parser.py        | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/xen/scripts/xen_analysis/diff_tool/unified_format_parser.py b/xen/scripts/xen_analysis/diff_tool/unified_format_parser.py
index 8b3fbc318df7..6c506caeafce 100644
--- a/xen/scripts/xen_analysis/diff_tool/unified_format_parser.py
+++ b/xen/scripts/xen_analysis/diff_tool/unified_format_parser.py
@@ -144,6 +144,7 @@ class UnifiedFormatParser(object):
         file_linenum = 0
         hunk_a_linemax = 0
         hunk_b_linemax = 0
+        consecutive_remove = 0
         diff_elem = None
         parse_state = ParserState.FIND_DIFF_HEADER
         ChangeMode = ChangeSet.ChangeMode
@@ -210,14 +211,18 @@ class UnifiedFormatParser(object):
                 if (hunk_b_linemax > 0) and line.startswith("+"):
                     diff_elem.add_change(file_linenum, ChangeType.ADD)
                     hunk_b_linemax -= 1
+                    consecutive_remove = 0
                 elif (hunk_a_linemax > 0) and line.startswith("-"):
-                    diff_elem.add_change(file_linenum, ChangeType.REMOVE)
+                    diff_elem.add_change(file_linenum + consecutive_remove,
+                                         ChangeType.REMOVE)
                     hunk_a_linemax -= 1
                     file_linenum -= 1
+                    consecutive_remove += 1
                 elif ((hunk_a_linemax + hunk_b_linemax) > 0) and \
                         line.startswith(" "):
                     hunk_a_linemax -= 1 if (hunk_a_linemax > 0) else 0
                     hunk_b_linemax -= 1 if (hunk_b_linemax > 0) else 0
+                    consecutive_remove = 0
 
                 if (hunk_a_linemax + hunk_b_linemax) <= 0:
                     parse_state = ParserState.FIND_HUNK_OR_DIFF_HEADER
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 09:27:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 09:27:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565024.882833 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLgyy-0000Oa-Bm; Tue, 18 Jul 2023 09:27:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565024.882833; Tue, 18 Jul 2023 09:27:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLgyy-0000Nn-6p; Tue, 18 Jul 2023 09:27:00 +0000
Received: by outflank-mailman (input) for mailman id 565024;
 Tue, 18 Jul 2023 09:26:59 +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
 <SRS0=UwZh=DE=arm.com=luca.fancellu@srs-se1.protection.inumbo.net>)
 id 1qLgyx-0000LP-L2
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:26:59 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTP
 id 3d078aca-254d-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 11:26:56 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8683B2F4;
 Tue, 18 Jul 2023 02:27:39 -0700 (PDT)
Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.1])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 667DB3F67D;
 Tue, 18 Jul 2023 02:26:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3d078aca-254d-11ee-8611-37d641c3527e
From: Luca Fancellu <luca.fancellu@arm.com>
To: xen-devel@lists.xenproject.org
Cc: wei.chen@arm.com,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH 0/2] diff-report bugfix
Date: Tue, 18 Jul 2023 10:26:34 +0100
Message-Id: <20230718092637.2433974-1-luca.fancellu@arm.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This serie has some bugfix for some issues found on the diff-report.py tool
during usage of its module or by luck by code inspection.

Luca Fancellu (2):
  xen/misra: diff-report.py: Fix UnifiedFormatParser change line
    registration
  xen/misra: diff-report.py: fix function invocation

 xen/scripts/diff-report.py                                | 8 ++++++--
 .../xen_analysis/diff_tool/unified_format_parser.py       | 7 ++++++-
 2 files changed, 12 insertions(+), 3 deletions(-)

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 09:30:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 09:30:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565041.882859 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLh1x-0002wU-7X; Tue, 18 Jul 2023 09:30:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565041.882859; Tue, 18 Jul 2023 09:30:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLh1x-0002vl-3W; Tue, 18 Jul 2023 09:30:05 +0000
Received: by outflank-mailman (input) for mailman id 565041;
 Tue, 18 Jul 2023 09:30:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=88xE=DE=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qLh1v-0002a7-Cm
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:30:03 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on0607.outbound.protection.outlook.com
 [2a01:111:f400:fe02::607])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id abd53cb4-254d-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 11:30:02 +0200 (CEST)
Received: from DUZPR01CA0243.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4b5::11) by AS8PR08MB10221.eurprd08.prod.outlook.com
 (2603:10a6:20b:63e::16) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Tue, 18 Jul
 2023 09:29:59 +0000
Received: from DBAEUR03FT019.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4b5:cafe::fd) by DUZPR01CA0243.outlook.office365.com
 (2603:10a6:10:4b5::11) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33 via Frontend
 Transport; Tue, 18 Jul 2023 09:29:59 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT019.mail.protection.outlook.com (100.127.142.129) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.33 via Frontend Transport; Tue, 18 Jul 2023 09:29:59 +0000
Received: ("Tessian outbound f9124736ff4f:v145");
 Tue, 18 Jul 2023 09:29:59 +0000
Received: from 6adc37988c29.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 4E93CB6E-CE9B-49EC-A7B4-35F222C46891.1; 
 Tue, 18 Jul 2023 09:29:52 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6adc37988c29.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 18 Jul 2023 09:29:52 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com (2603:10a6:208:104::24)
 by VE1PR08MB5646.eurprd08.prod.outlook.com (2603:10a6:800:1a9::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 09:29:50 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854]) by AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854%3]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 09:29:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: abd53cb4-254d-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=K8/ZEmILh4dJGcS0LKb7dHCk2B0qJMepv4YyPjgTj5g=;
 b=+KpFR4mET26kF/tie94Jz84XOLbZMA3oReqgVdeyEw1NkxW384TOL9GvD1WlElgK5dyoskRa2AZ11gfVIMMhwbEi9GAViN7jaLUfUY63TCE9o9228ILMpKSpPV3NPvH7yO53xa/JHj6cpuDmaizHii447ZJLC1kdJGf62ZIke8k=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 17601c4c6a3a368b
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Kp3EVIcF1ckUWl8EQguRYaHBCh6N5ugAS4GXFInMxn5hbpIQdthrV/J8mcMp3TGzoIxUaQJDhQ8hiF+gZ5CbSdRz8pUK5hzrB1A+NfdrpfbqLVvy5N2oLlKUlSqHySH0SUOtIBIu+4aKRO8KPP5azqWxrKbuEMNRCJOr9W7ZslNDnYWg3QNm1eh63zzVqIfIhXURs4neLP2DbQ5cxNZoAmvas8GvgTLuVl2ntiJS2JO7JSN4CEoL5PsFfDawqybSZofyO+2NKeyYK5ZqtPRUcrVFdjYqoXm7XgSDb39C2qikSPkFpasFKcxMIZy/lu7KKh1SvnUhJv1j/ljk3mcARA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=K8/ZEmILh4dJGcS0LKb7dHCk2B0qJMepv4YyPjgTj5g=;
 b=kpSjTWgx+3wGK26ro/se9Ysp78i5LZ8Y9BoCZ7IMKmAqXtbegbq1k2tW5ic3X8S1CBoapJy1gmMBmbzpStAe70aYNJxKZsBSOzo0LMVLyCF2vyobZ58tAPNPiIbinTphCimWFKOUai6lGipVJvz9tK2hiGdDNl4MuRdtsp1suPa57U5SdiEXn34vs7G73HF4/V4brqedPWz1cfahBHFSiu5M0nwzDFk2dndO/vpq8UPIS+7JCGdB07+CaWptPXMttwUMCijqY7hEM+v7vlyRyyRWa0JpfwJJDLshjECvnX0fTpMHDAe1+0r0GC0pwPLvKXlo35e0+9pJuxFFbWmpVg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=K8/ZEmILh4dJGcS0LKb7dHCk2B0qJMepv4YyPjgTj5g=;
 b=+KpFR4mET26kF/tie94Jz84XOLbZMA3oReqgVdeyEw1NkxW384TOL9GvD1WlElgK5dyoskRa2AZ11gfVIMMhwbEi9GAViN7jaLUfUY63TCE9o9228ILMpKSpPV3NPvH7yO53xa/JHj6cpuDmaizHii447ZJLC1kdJGf62ZIke8k=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>
Subject: Re: [XEN PATCH v10 04/24] xen/arm: tee: add a primitive FF-A mediator
Thread-Topic: [XEN PATCH v10 04/24] xen/arm: tee: add a primitive FF-A
 mediator
Thread-Index: AQHZuH9Qs/YHnqnvzkGuhUSzNiJMga+/Q8GA
Date: Tue, 18 Jul 2023 09:29:49 +0000
Message-ID: <CF2AB21D-B2A5-4B65-91D1-21FA16530048@arm.com>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-5-jens.wiklander@linaro.org>
In-Reply-To: <20230717072107.753304-5-jens.wiklander@linaro.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM0PR08MB3778:EE_|VE1PR08MB5646:EE_|DBAEUR03FT019:EE_|AS8PR08MB10221:EE_
X-MS-Office365-Filtering-Correlation-Id: 8df1e729-4c7e-4b51-872f-08db87718e78
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 ChjHZOZrNAqmn7HjsGOuZlBZX8T5grUb3FtNcJ0N5dbJgJXrdpoKhg3k65tmxxxjxZEo9qFjE9vMpLlCRNW4VWEpyoT7iSmhQ1/v8GWUs5FTNy/MSftFg2LM7y5gGJpifZffKck/VVf+nX8qcpYnv89CV4Xpvijdl+J7GIYATseAJdrEAyYC+CyLXu63w+Gb9ISkcbvMD9awQr6YDfKH8HQ/7fTDYd+mCl+vFVMg2YdujhrfPFanC0uWbtNJixNu6lvl2jUL7AXLHJrFgL6Imv7jcWUWOJHG5xPU4A2lqXzruEs/9+NIEldql9AMClJzu9Q+4ALuMzXSg3ctrxtr+bBCraqx8GukaggxP+2S87NLaAOjRmeAO4Q9dDmHimrBf2zERUx/eeT/Cji4BDt22yGpgpf4Di8OLowRaY5T+HMRQskZSViy4EltSN6gajNACzGmtUool43VJOHElirF6meUwBaxNDyoqIKjsnMQ6LzoItK1Fe7i1in2BWe/0kjFy+1gVEkWhDOrUIuNuCiOQtAbDw8x3R40qqUMIvAh5StgatAuL+JSodjYA6w2Kc6Urz8wIAiolw63e3Wli4qrWRc0HX+S7DjO5eR0EMTM7MR5B3fYiYLENJ2qnAF0DQWT
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB3778.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(39860400002)(396003)(366004)(136003)(451199021)(2616005)(53546011)(41300700001)(6506007)(316002)(6512007)(966005)(83380400001)(186003)(6486002)(478600001)(122000001)(71200400001)(4326008)(6916009)(76116006)(66476007)(66946007)(91956017)(66556008)(64756008)(66446008)(38100700002)(33656002)(86362001)(8676002)(2906002)(8936002)(36756003)(54906003)(38070700005)(5660300002)(30864003)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <E1E8184D605F3F41945A6DF7576FD4C1@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5646
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT019.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	3273c79f-0ee6-430a-e7ff-08db877188b3
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	oIs/4R0sCSHVVReg4H9NUFD/aSZ6aYQ2A9z9I4OKaJ8+EHHTmIAdQqQ16xW663+L0bfKEdgSdMy+Vn/ikELaFdAxnXcy2dNgA0z4XwqHKRbBZr3vEEKllABmt2F5HgAXsJ/fpgYhilbehCQet0hLy7ljrsJPBEnQQ7Udliqk5jFBkvRCt9M38mvfQFktZYtHkcW9UOWKXN0p/7dwIR67oHa+6cy1xZmsaNemShGTN8daQ4Odzk4qTh86d9tsP4vnRZLEAcY8joHDcchRZLm6Uh8O8nw0+jPzXDER9vzl6EoTZCXV01FPK3caK1EmOQkJeyBGq4ThbNzulPkG1XYU4/R2ELGz+HsR0suvLjvKV6Yan7FQE+Lb6RIUipfRF8raTJV4khgW7rSfAcEpQ7t7Oa2ezY2UeQFvGk9tiH/vGtem8e4r3nLbHp58wRT/10ZvYw47NqGB9bA+9DT1mnHwELzkL9Kv45lFsdXaJJUhJDDQae7gxEwykCBJ7cC2chzankLAhCAfa/QxVmC/ZJC9pRq+OfnYWenLAsd3SiQpE1aA6/ZxgWx2QHQKuSZrBjsZ+Ldlvb9wo+R8w2QVzGGT8wz+kIJcVqTGYaUpAxbesS6Mv431e39DdARzUMlQs4/mcJ/znNzO/XEtWMmtWRurYeeN8m2b4VGthNcx0P6CjsdaL1aJLCTen6rNX4CjJltG8Q0qPEU5IPGarRnvODkkGZWr/RHgUxWQuEQBUUgTPmQ=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(376002)(346002)(82310400008)(451199021)(40470700004)(36840700001)(46966006)(36860700001)(478600001)(356005)(36756003)(33656002)(40480700001)(86362001)(82740400003)(40460700003)(81166007)(6486002)(70586007)(966005)(54906003)(6512007)(6862004)(30864003)(8676002)(8936002)(316002)(41300700001)(70206006)(4326008)(5660300002)(336012)(2616005)(6506007)(186003)(26005)(53546011)(107886003)(47076005)(83380400001)(2906002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 09:29:59.4218
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 8df1e729-4c7e-4b51-872f-08db87718e78
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT019.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB10221

Hi Jens,

> On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> wrot=
e:
>=20
> Adds a FF-A version 1.1 [1] mediator to communicate with a Secure
> Partition in secure world.
>=20
> This commit brings in only the parts needed to negotiate FF-A version
> number with guest and SPMC.
>=20
> [1] https://developer.arm.com/documentation/den0077/e
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> xen/arch/arm/include/asm/psci.h    |   4 +
> xen/arch/arm/include/asm/tee/ffa.h |  35 +++++
> xen/arch/arm/tee/Kconfig           |  11 ++
> xen/arch/arm/tee/Makefile          |   1 +
> xen/arch/arm/tee/ffa.c             | 225 +++++++++++++++++++++++++++++
> xen/arch/arm/vsmc.c                |  17 ++-
> xen/include/public/arch-arm.h      |   1 +
> 7 files changed, 291 insertions(+), 3 deletions(-)
> create mode 100644 xen/arch/arm/include/asm/tee/ffa.h
> create mode 100644 xen/arch/arm/tee/ffa.c
>=20
> diff --git a/xen/arch/arm/include/asm/psci.h b/xen/arch/arm/include/asm/p=
sci.h
> index 832f77afff3a..4780972621bb 100644
> --- a/xen/arch/arm/include/asm/psci.h
> +++ b/xen/arch/arm/include/asm/psci.h
> @@ -24,6 +24,10 @@ void call_psci_cpu_off(void);
> void call_psci_system_off(void);
> void call_psci_system_reset(void);
>=20
> +/* Range of allocated PSCI function numbers */
> +#define PSCI_FNUM_MIN_VALUE                 _AC(0,U)
> +#define PSCI_FNUM_MAX_VALUE                 _AC(0x1f,U)
> +
> /* PSCI v0.2 interface */
> #define PSCI_0_2_FN32(nr) ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL,        =
     \
>                                              ARM_SMCCC_CONV_32,          =
     \
> diff --git a/xen/arch/arm/include/asm/tee/ffa.h b/xen/arch/arm/include/as=
m/tee/ffa.h
> new file mode 100644
> index 000000000000..44361a4e78e4
> --- /dev/null
> +++ b/xen/arch/arm/include/asm/tee/ffa.h
> @@ -0,0 +1,35 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * xen/arch/arm/include/asm/tee/ffa.h
> + *
> + * Arm Firmware Framework for ARMv8-A(FFA) mediator
> + *
> + * Copyright (C) 2023  Linaro Limited
> + */
> +
> +#ifndef __ASM_ARM_TEE_FFA_H__
> +#define __ASM_ARM_TEE_FFA_H__
> +
> +#include <xen/const.h>
> +#include <xen/kconfig.h>
> +
> +#include <asm/smccc.h>
> +#include <asm/types.h>
> +
> +#define FFA_FNUM_MIN_VALUE              _AC(0x60,U)
> +#define FFA_FNUM_MAX_VALUE              _AC(0x86,U)
> +
> +static inline bool is_ffa_fid(uint32_t fid)
> +{
> +    uint32_t fn =3D fid & ARM_SMCCC_FUNC_MASK;
> +
> +    return fn >=3D FFA_FNUM_MIN_VALUE && fn <=3D FFA_FNUM_MAX_VALUE;
> +}
> +
> +#ifdef CONFIG_FFA
> +#define FFA_NR_FUNCS    12
> +#else
> +#define FFA_NR_FUNCS    0
> +#endif
> +
> +#endif /*__ASM_ARM_TEE_FFA_H__*/
> diff --git a/xen/arch/arm/tee/Kconfig b/xen/arch/arm/tee/Kconfig
> index 392169b2559d..923f08ba8cb7 100644
> --- a/xen/arch/arm/tee/Kconfig
> +++ b/xen/arch/arm/tee/Kconfig
> @@ -8,3 +8,14 @@ config OPTEE
>  virtualization-enabled OP-TEE present. You can learn more
>  about virtualization for OP-TEE at
>  https://optee.readthedocs.io/architecture/virtualization.html
> +
> +config FFA
> + bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
> + default n
> + depends on ARM_64
> + help
> +  This option enables a minimal FF-A mediator. The mediator is
> +  generic as it follows the FF-A specification [1], but it only
> +  implements a small subset of the specification.
> +
> +  [1] https://developer.arm.com/documentation/den0077/latest
> diff --git a/xen/arch/arm/tee/Makefile b/xen/arch/arm/tee/Makefile
> index 982c87968447..58a1015e40e0 100644
> --- a/xen/arch/arm/tee/Makefile
> +++ b/xen/arch/arm/tee/Makefile
> @@ -1,2 +1,3 @@
> +obj-$(CONFIG_FFA) +=3D ffa.o
> obj-y +=3D tee.o
> obj-$(CONFIG_OPTEE) +=3D optee.o
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> new file mode 100644
> index 000000000000..927c4d33a380
> --- /dev/null
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -0,0 +1,225 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * xen/arch/arm/tee/ffa.c
> + *
> + * Arm Firmware Framework for ARMv8-A (FF-A) mediator
> + *
> + * Copyright (C) 2023  Linaro Limited
> + */
> +
> +#include <xen/bitops.h>
> +#include <xen/domain_page.h>
> +#include <xen/errno.h>
> +#include <xen/init.h>
> +#include <xen/lib.h>
> +#include <xen/sched.h>
> +#include <xen/sizes.h>
> +#include <xen/types.h>
> +
> +#include <asm/event.h>
> +#include <asm/regs.h>
> +#include <asm/smccc.h>
> +#include <asm/tee/ffa.h>
> +#include <asm/tee/tee.h>
> +
> +/* Error codes */
> +#define FFA_RET_OK                      0
> +#define FFA_RET_NOT_SUPPORTED           -1
> +#define FFA_RET_INVALID_PARAMETERS      -2
> +#define FFA_RET_NO_MEMORY               -3
> +#define FFA_RET_BUSY                    -4
> +#define FFA_RET_INTERRUPTED             -5
> +#define FFA_RET_DENIED                  -6
> +#define FFA_RET_RETRY                   -7
> +#define FFA_RET_ABORTED                 -8
> +
> +/* FFA_VERSION helpers */
> +#define FFA_VERSION_MAJOR_SHIFT         16U
> +#define FFA_VERSION_MAJOR_MASK          0x7FFFU
> +#define FFA_VERSION_MINOR_SHIFT         0U
> +#define FFA_VERSION_MINOR_MASK          0xFFFFU
> +#define MAKE_FFA_VERSION(major, minor)  \
> +        ((((major) & FFA_VERSION_MAJOR_MASK) << FFA_VERSION_MAJOR_SHIFT)=
 | \
> +         ((minor) & FFA_VERSION_MINOR_MASK))
> +
> +#define FFA_VERSION_1_0         MAKE_FFA_VERSION(1, 0)
> +#define FFA_VERSION_1_1         MAKE_FFA_VERSION(1, 1)
> +/* The minimal FF-A version of the SPMC that can be supported */
> +#define FFA_MIN_SPMC_VERSION    FFA_VERSION_1_1
> +
> +/*
> + * This is the version we want to use in communication with guests and S=
Ps.
> + * During negotiation with a guest or a SP we may need to lower it for
> + * that particular guest or SP.
> + */
> +#define FFA_MY_VERSION_MAJOR    1U
> +#define FFA_MY_VERSION_MINOR    1U
> +#define FFA_MY_VERSION          MAKE_FFA_VERSION(FFA_MY_VERSION_MAJOR, \
> +                                                 FFA_MY_VERSION_MINOR)
> +
> +/* Function IDs */
> +#define FFA_ERROR                       0x84000060U
> +#define FFA_SUCCESS_32                  0x84000061U
> +#define FFA_VERSION                     0x84000063U
> +
> +struct ffa_ctx {
> +    /* FF-A version used by the guest */
> +    uint32_t guest_vers;
> +};
> +
> +/* Negotiated FF-A version to use with the SPMC */
> +static uint32_t __ro_after_init ffa_version;
> +
> +static bool ffa_get_version(uint32_t *vers)
> +{
> +    const struct arm_smccc_1_2_regs arg =3D {
> +        .a0 =3D FFA_VERSION,
> +        .a1 =3D FFA_MY_VERSION,
> +    };
> +    struct arm_smccc_1_2_regs resp;
> +
> +    arm_smccc_1_2_smc(&arg, &resp);
> +    if ( resp.a0 =3D=3D FFA_RET_NOT_SUPPORTED )
> +    {
> +        gprintk(XENLOG_ERR, "ffa: FFA_VERSION returned not supported\n")=
;
> +        return false;
> +    }
> +
> +    *vers =3D resp.a0;
> +
> +    return true;
> +}
> +
> +static void set_regs(struct cpu_user_regs *regs, register_t v0, register=
_t v1,
> +                     register_t v2, register_t v3, register_t v4, regist=
er_t v5,
> +                     register_t v6, register_t v7)
> +{
> +        set_user_reg(regs, 0, v0);
> +        set_user_reg(regs, 1, v1);
> +        set_user_reg(regs, 2, v2);
> +        set_user_reg(regs, 3, v3);
> +        set_user_reg(regs, 4, v4);
> +        set_user_reg(regs, 5, v5);
> +        set_user_reg(regs, 6, v6);
> +        set_user_reg(regs, 7, v7);
> +}
> +
> +static void handle_version(struct cpu_user_regs *regs)
> +{
> +    struct domain *d =3D current->domain;
> +    struct ffa_ctx *ctx =3D d->arch.tee;
> +    uint32_t vers =3D get_user_reg(regs, 1);
> +
> +    if ( vers < FFA_VERSION_1_1 )
> +        vers =3D FFA_VERSION_1_0;
> +    else
> +        vers =3D FFA_VERSION_1_1;
> +
> +    ctx->guest_vers =3D vers;
> +    set_regs(regs, vers, 0, 0, 0, 0, 0, 0, 0);
> +}
> +
> +static bool ffa_handle_call(struct cpu_user_regs *regs)
> +{
> +    uint32_t fid =3D get_user_reg(regs, 0);
> +    struct domain *d =3D current->domain;
> +    struct ffa_ctx *ctx =3D d->arch.tee;
> +
> +    if ( !ctx )
> +        return false;
> +
> +    switch ( fid )
> +    {
> +    case FFA_VERSION:
> +        handle_version(regs);
> +        return true;
> +
> +    default:
> +        gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
> +        return false;
> +    }
> +}
> +
> +static int ffa_domain_init(struct domain *d)
> +{
> +    struct ffa_ctx *ctx;
> +
> +    if ( !ffa_version )
> +        return -ENODEV;
> +
> +    ctx =3D xzalloc(struct ffa_ctx);
> +    if ( !ctx )
> +        return -ENOMEM;
> +
> +    d->arch.tee =3D ctx;
> +
> +    return 0;
> +}
> +
> +/* This function is supposed to undo what ffa_domain_init() has done */
> +static int ffa_domain_teardown(struct domain *d)
> +{
> +    struct ffa_ctx *ctx =3D d->arch.tee;
> +
> +    if ( !ctx )
> +        return 0;
> +
> +    XFREE(d->arch.tee);
> +
> +    return 0;
> +}
> +
> +static int ffa_relinquish_resources(struct domain *d)
> +{
> +    return 0;
> +}
> +
> +static bool ffa_probe(void)
> +{
> +    uint32_t vers;
> +    unsigned int major_vers;
> +    unsigned int minor_vers;
> +
> +    /*
> +     * psci_init_smccc() updates this value with what's reported by EL-3
> +     * or secure world.
> +     */
> +    if ( smccc_ver < ARM_SMCCC_VERSION_1_2 )
> +    {
> +        printk(XENLOG_ERR
> +               "ffa: unsupported SMCCC version %#x (need at least %#x)\n=
",
> +               smccc_ver, ARM_SMCCC_VERSION_1_2);
> +        return false;
> +    }
> +
> +    if ( !ffa_get_version(&vers) )
> +        return false;
> +
> +    if ( vers < FFA_MIN_SPMC_VERSION || vers > FFA_MY_VERSION )
> +    {
> +        printk(XENLOG_ERR "ffa: Incompatible version %#x found\n", vers)=
;
> +        return false;
> +    }
> +
> +    major_vers =3D (vers >> FFA_VERSION_MAJOR_SHIFT) & FFA_VERSION_MAJOR=
_MASK;
> +    minor_vers =3D vers & FFA_VERSION_MINOR_MASK;
> +    printk(XENLOG_INFO "ARM FF-A Mediator version %u.%u\n",
> +           FFA_MY_VERSION_MAJOR, FFA_MY_VERSION_MINOR);
> +    printk(XENLOG_INFO "ARM FF-A Firmware version %u.%u\n",
> +           major_vers, minor_vers);
> +
> +    ffa_version =3D vers;
> +
> +    return true;
> +}
> +
> +static const struct tee_mediator_ops ffa_ops =3D
> +{
> +    .probe =3D ffa_probe,
> +    .domain_init =3D ffa_domain_init,
> +    .domain_teardown =3D ffa_domain_teardown,
> +    .relinquish_resources =3D ffa_relinquish_resources,
> +    .handle_call =3D ffa_handle_call,
> +};
> +
> +REGISTER_TEE_MEDIATOR(ffa, "FF-A", XEN_DOMCTL_CONFIG_TEE_FFA, &ffa_ops);
> diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c
> index cd68fa80e98a..7f2f5eb9ce3d 100644
> --- a/xen/arch/arm/vsmc.c
> +++ b/xen/arch/arm/vsmc.c
> @@ -15,6 +15,7 @@
> #include <asm/monitor.h>
> #include <asm/regs.h>
> #include <asm/smccc.h>
> +#include <asm/tee/ffa.h>
> #include <asm/tee/tee.h>
> #include <asm/traps.h>
> #include <asm/vpsci.h>
> @@ -24,7 +25,7 @@
> #define XEN_SMCCC_FUNCTION_COUNT 3
>=20
> /* Number of functions currently supported by Standard Service Service Ca=
lls. */
> -#define SSSC_SMCCC_FUNCTION_COUNT (3 + VPSCI_NR_FUNCS)
> +#define SSSC_SMCCC_FUNCTION_COUNT (3 + VPSCI_NR_FUNCS + FFA_NR_FUNCS)
>=20
> static bool fill_uid(struct cpu_user_regs *regs, xen_uuid_t uuid)
> {
> @@ -188,13 +189,23 @@ static bool handle_existing_apis(struct cpu_user_re=
gs *regs)
>     return do_vpsci_0_1_call(regs, fid);
> }
>=20
> +static bool is_psci_fid(uint32_t fid)
> +{
> +    uint32_t fn =3D fid & ARM_SMCCC_FUNC_MASK;
> +
> +    return fn >=3D PSCI_FNUM_MIN_VALUE && fn <=3D PSCI_FNUM_MAX_VALUE;
> +}
> +
> /* PSCI 0.2 interface and other Standard Secure Calls */
> static bool handle_sssc(struct cpu_user_regs *regs)
> {
>     uint32_t fid =3D (uint32_t)get_user_reg(regs, 0);
>=20
> -    if ( do_vpsci_0_2_call(regs, fid) )
> -        return true;
> +    if ( is_psci_fid(fid) )
> +        return do_vpsci_0_2_call(regs, fid);
> +
> +    if ( is_ffa_fid(fid) )
> +        return tee_handle_call(regs);
>=20
>     switch ( fid )
>     {
> diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.=
h
> index 38311f559581..c6449893e493 100644
> --- a/xen/include/public/arch-arm.h
> +++ b/xen/include/public/arch-arm.h
> @@ -296,6 +296,7 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
>=20
> #define XEN_DOMCTL_CONFIG_TEE_NONE      0
> #define XEN_DOMCTL_CONFIG_TEE_OPTEE     1
> +#define XEN_DOMCTL_CONFIG_TEE_FFA       2
>=20
> struct xen_arch_domainconfig {
>     /* IN/OUT */
> --=20
> 2.34.1
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 09:32:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 09:32:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565044.882869 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLh4K-0003d3-JL; Tue, 18 Jul 2023 09:32:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565044.882869; Tue, 18 Jul 2023 09:32:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLh4K-0003cw-Fv; Tue, 18 Jul 2023 09:32:32 +0000
Received: by outflank-mailman (input) for mailman id 565044;
 Tue, 18 Jul 2023 09:32:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=88xE=DE=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qLh4I-0003cn-Rw
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:32:30 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2077.outbound.protection.outlook.com [40.107.13.77])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 03e2bb86-254e-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 11:32:30 +0200 (CEST)
Received: from DU2PR04CA0290.eurprd04.prod.outlook.com (2603:10a6:10:28c::25)
 by DU0PR08MB8090.eurprd08.prod.outlook.com (2603:10a6:10:3e9::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.28; Tue, 18 Jul
 2023 09:31:54 +0000
Received: from DBAEUR03FT016.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:28c:cafe::37) by DU2PR04CA0290.outlook.office365.com
 (2603:10a6:10:28c::25) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33 via Frontend
 Transport; Tue, 18 Jul 2023 09:31:54 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT016.mail.protection.outlook.com (100.127.142.204) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.33 via Frontend Transport; Tue, 18 Jul 2023 09:31:54 +0000
Received: ("Tessian outbound ba2f3d95109c:v145");
 Tue, 18 Jul 2023 09:31:54 +0000
Received: from 18c611d46daa.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 6BC555C7-97A8-4AE6-A9AB-5EFF955ACAA1.1; 
 Tue, 18 Jul 2023 09:31:47 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 18c611d46daa.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 18 Jul 2023 09:31:47 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com (2603:10a6:208:104::24)
 by VE1PR08MB5646.eurprd08.prod.outlook.com (2603:10a6:800:1a9::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 09:31:45 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854]) by AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854%3]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 09:31:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 03e2bb86-254e-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5nkxybcKz/kKqitIA/L3d1MUkjLXX2JEm/+eTdp61zk=;
 b=aSn12jnfFX3nasbfh9/DJvlLCIp2LIfFbh13lkeEnmSrLkfLbSfrNkm9Pg/62hPj7WvQ9BlHLHwHoZK0qpplmNtjTqnBAUPhehW1y35sN5rNxq1kRU7pKHNLsywsAhvsHrzoRz2ZgdqKM7919DsOT8mA95G0zQNOfAn2ylT12kM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 441db6f728790835
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=fUHuB5/3xxpPxZtvVnUBd4RFCTGDhVQBrJC64c+TDBD6Bn8yia3ChBWXQlEyW0RSRHk1mlnF/neopP9Baf6LaJkvIc4Y2383a7PiDATbIsFReed0FPOMRcWkAjLRaeSTpTSRz9jn2BasTLqvdzOLm4KTL655PK4dkfFSSkMncmNvnJVl3NLnUUWmU2VIjUQ65UQA5kcBR7Kr4ku2FM3dUBLWUzccM0xYNHPIQyv2IVsXLEJjoUb2Pbe4m3D0uiyOr1VFpWITBzgojjMBk1mJD7CeplRVZklh35TjmlOxFPywtbT3Nwfko6B2GgQ4laddhlxpfWTW4o94G97eCasPWQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5nkxybcKz/kKqitIA/L3d1MUkjLXX2JEm/+eTdp61zk=;
 b=mnHPPR3f58xq3qcjzTwNj1HaCY8DO2v7NkhHf1Q03QdFW+wa5XxGG4/2kEHTN0aXAn70Bt1PbcJFUjCmW78N2lHF6CPrMqiZDTIZEGNOt8eaWSHELW8gfUgjg6mCu/NMNWAsjT5FtwrSsTNvQpy0sCTcLfS402/H5yg75BsL7xJnkK8d2OvfwBOmPHFwDTY9EEm4rIH2dEzjlzRT/9ME2hhoBOnW9U6U3YMCbHOgy1r3KZPLy6hi4RVjNjCm8U4pfiyp+jgeALgxLOVURb0pY7pha7fqKxJnhwfPE5zBUtGQcAX14U2f4dOe6Y3QSzogG3b9SuqWXjfXMm3az5B2Gw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5nkxybcKz/kKqitIA/L3d1MUkjLXX2JEm/+eTdp61zk=;
 b=aSn12jnfFX3nasbfh9/DJvlLCIp2LIfFbh13lkeEnmSrLkfLbSfrNkm9Pg/62hPj7WvQ9BlHLHwHoZK0qpplmNtjTqnBAUPhehW1y35sN5rNxq1kRU7pKHNLsywsAhvsHrzoRz2ZgdqKM7919DsOT8mA95G0zQNOfAn2ylT12kM=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>, Henry Wang
	<Henry.Wang@arm.com>
Subject: Re: [XEN PATCH v10 06/24] xen/arm: ffa: add flags for
 FFA_PARTITION_INFO_GET
Thread-Topic: [XEN PATCH v10 06/24] xen/arm: ffa: add flags for
 FFA_PARTITION_INFO_GET
Thread-Index: AQHZuH9UcezrZ1Z5z0iYCGhuk3ABB6+/REoA
Date: Tue, 18 Jul 2023 09:31:45 +0000
Message-ID: <6858FD7A-9F24-497E-B976-E21B776CF18B@arm.com>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-7-jens.wiklander@linaro.org>
In-Reply-To: <20230717072107.753304-7-jens.wiklander@linaro.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM0PR08MB3778:EE_|VE1PR08MB5646:EE_|DBAEUR03FT016:EE_|DU0PR08MB8090:EE_
X-MS-Office365-Filtering-Correlation-Id: 5d939ca0-2075-4052-1c04-08db8771d2f2
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 fspfLjQTINQFUFAZE6zssZ3V2ZN5uLIIRrm9KAQCv2V7NIAJ/FqfapKP/rvC7OQQoRbG7ciV/1YxqFxyI334nJcX2bKGZSCQB0r5YxZ7tUdkDLTLT3XdH2rRqBsxsU3yZMcjNHHzbvOlkah8gfACkmSGkrE/MulYltz0EwrLWOpDN0lk2uKwm8fN0WfNBdj2g+VP9kwGfdNWDrRws2CtqBGM9YBYKWwWa+zAhx9cOdDU9uA+4d/1MNyGXzhtACADW18zGSo8JCNHTnQ7WWnWFQGWKn9Lc+0PlUL6Aqrfw5rLqKGmdiNF+7m6EhzWzPlqEehbD8pj+/UYGzkhjBB24ZgPYely6hM2FR/JDotfviSRoSER9eKoweV2zKFsDfegizRibRer1gt2hPqVwdhvhoWOxLK66L2zTi7BKQC9e6Whs5lqaw3VE3tmKNSMZLbrnRbTrAakUPV11zxNav4TLgujZtIqFkocIGNgRwGzd/ZJYaywJgNJt9Bm6qkZKx+ABH1pVzfqC0HyW/Nrg5qYXttkfiwStqg23kdudOKwL6GEzhOo3D3229GOjg85hXJ4iusAsueOW8lqG0tO6cg1EavvNm/1ns33y9/Gy2XN0cAiXpnrTLQM3UAo0XqyO2D24gtzdxnNbDUjihP7QpwYwA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB3778.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(39860400002)(396003)(366004)(136003)(451199021)(2616005)(53546011)(41300700001)(6506007)(316002)(6512007)(83380400001)(186003)(6486002)(478600001)(122000001)(71200400001)(4326008)(6916009)(76116006)(66476007)(66946007)(91956017)(66556008)(64756008)(66446008)(38100700002)(33656002)(86362001)(8676002)(2906002)(8936002)(36756003)(54906003)(38070700005)(5660300002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <FA1BD542C3A2074FB5335536FF1C9B86@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5646
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT016.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	b73629bd-e2e5-4c62-cb01-08db8771cd7e
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	EWWHA3/l8On9r/bcfpuXOezdwDNSEtJg+u351mUaR+C0lOFMCNmpgIgoKnPueYiCAPYOdedVXm2A6WLyiN58XbgYVeNrvC3hWCdL0PFjqeZn4xlgwwuTanFRyeifPqOrh2nN0ehyQ1MNct/yRID/T+TwN73GnTFCjRtERFJgwJCXDCqJlWjhd8z7ExduhKULvO4ottbHQWRGE7SfO7pFohBqzZ8fyU3MymaPNoWxQyt0Uzct1N5AFKVi3BoN62CDGkJDO+pUuEB1rHgCVEysoCqQF4VNKgvrgq0dawqa9knrSw8MkbKoQeFB8kquBC4y/bTfX+rXNfwcY8jRyZ4Bms8o/FavVecYD7F3PfSfDbVkOkm3CFwcQFxV54l/L9gSQIv7Urvy9ZD+sTWYzGrHaKdDhGqhmWLyW5LNNt4j+fPjRP5HaW/AgBAWDRvvdrhFoLif2JWdWNEwqvYvmwumgh/8IJb2T2hvd4r9tEAsEoOCw4ScCGQRRvgxeyojucUdwwS5pEQ4m6x1FioKdCA8xU7OymuLWNgyLrEARWrctSTDDMxwu5vpcRQy+B9Pj1je5NT5OsnKCLonl9Upo9KlCVgypKO4+EAUuz0p6NNZZQiJPE/ewNBnL7N+31goODkJdVHyalcAwm3YYQZQzvnN2yoFAj/O4G/bOte+KS9hKe9XSt939rOc/IO6IC6QK6mV6RpWSNx7sRMhLFbjnGGgFYKwendj947F9fFa4LnWb7D12xk+3G2U9mGPL58vtLUx
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(136003)(346002)(396003)(451199021)(82310400008)(40470700004)(46966006)(36840700001)(86362001)(6486002)(53546011)(336012)(186003)(36860700001)(40460700003)(82740400003)(356005)(316002)(40480700001)(4326008)(70206006)(70586007)(6512007)(36756003)(26005)(41300700001)(6506007)(81166007)(2616005)(54906003)(2906002)(47076005)(83380400001)(5660300002)(33656002)(478600001)(6862004)(8676002)(8936002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 09:31:54.3193
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 5d939ca0-2075-4052-1c04-08db8771d2f2
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT016.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8090

Hi Jens,

> On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> wrot=
e:
>=20
> According to DEN0077A version 1.1 REL0, section 13.8, defines
> flags used for the function FFA_PARTITION_INFO_GET.
>=20
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> Reviewed-by: Henry Wang <Henry.Wang@arm.com>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> xen/arch/arm/tee/ffa.c | 34 ++++++++++++++++++++++++++++++++++
> 1 file changed, 34 insertions(+)
>=20
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> index 2296e3115beb..c1dead73d1f2 100644
> --- a/xen/arch/arm/tee/ffa.c
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -57,6 +57,40 @@
> #define FFA_MY_VERSION          MAKE_FFA_VERSION(FFA_MY_VERSION_MAJOR, \
>                                                  FFA_MY_VERSION_MINOR)
>=20
> +/*
> + * Flags to determine partition properties in FFA_PARTITION_INFO_GET ret=
urn
> + * message:
> + * BIT(0): Supports receipt of direct requests
> + * BIT(1): Can send direct requests
> + * BIT(2): Can send and receive indirect messages
> + * BIT(3): Supports receipt of notifications
> + * BIT(4-5): Partition ID is a PE endpoint ID
> + * BIT(6): Partition must be informed about each VM that is created by
> + *         the Hypervisor
> + * BIT(7): Partition must be informed about each VM that is destroyed by
> + *         the Hypervisor
> + * BIT(8): Partition runs in the AArch64 execution state else AArch32
> + *         execution state
> + */
> +#define FFA_PART_PROP_DIRECT_REQ_RECV   BIT(0, U)
> +#define FFA_PART_PROP_DIRECT_REQ_SEND   BIT(1, U)
> +#define FFA_PART_PROP_INDIRECT_MSGS     BIT(2, U)
> +#define FFA_PART_PROP_RECV_NOTIF        BIT(3, U)
> +#define FFA_PART_PROP_IS_TYPE_MASK      (3U << 4)
> +#define FFA_PART_PROP_IS_PE_ID          (0U << 4)
> +#define FFA_PART_PROP_IS_SEPID_INDEP    (1U << 4)
> +#define FFA_PART_PROP_IS_SEPID_DEP      (2U << 4)
> +#define FFA_PART_PROP_IS_AUX_ID         (3U << 4)
> +#define FFA_PART_PROP_NOTIF_CREATED     BIT(6, U)
> +#define FFA_PART_PROP_NOTIF_DESTROYED   BIT(7, U)
> +#define FFA_PART_PROP_AARCH64_STATE     BIT(8, U)
> +
> +/*
> + * Flag used as parameter to FFA_PARTITION_INFO_GET to return partition
> + * count only.
> + */
> +#define FFA_PARTITION_INFO_GET_COUNT_FLAG BIT(0, U)
> +
> /* Function IDs */
> #define FFA_ERROR                       0x84000060U
> #define FFA_SUCCESS_32                  0x84000061U
> --=20
> 2.34.1
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 09:33:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 09:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565047.882879 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLh5N-0004Ec-0T; Tue, 18 Jul 2023 09:33:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565047.882879; Tue, 18 Jul 2023 09:33:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLh5M-0004EV-Tx; Tue, 18 Jul 2023 09:33:36 +0000
Received: by outflank-mailman (input) for mailman id 565047;
 Tue, 18 Jul 2023 09:33:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLh5M-0004EL-32
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:33:36 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2043.outbound.protection.outlook.com [40.107.13.43])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2a7497e0-254e-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 11:33:35 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB7737.eurprd04.prod.outlook.com (2603:10a6:10:1e5::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Tue, 18 Jul
 2023 09:33:05 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 09:33:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2a7497e0-254e-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=UlZp49RVm+VSFxacMa5vtK0Ao5hX3EbADM+u0/IX41kIZ3bORpbMSjlRDdx+6Q9r7E6ICxDp+zRWGzvaBRSiDdiGN0baqK0JFiSt0XF5J0Ip2AMaT+bsOXXjSwHL/l8sxabvoMcFDhWEBbWsI74YJfJXSpXCjnWjOlZXVwEMyfPJeZ7wCZwoTCRM9T1/E4KrX/l7k9I/MX6srxMcZvN+sSKBK3JA4gSDLsMfUSmYREoLa7yR+epSXYvwZFAdKaEjSOYiN/BUfmEsfwA1MS8DSBw4ckS2+jnYqjizPGFoldXZVdlrWvPnj6pIZvs3uR0EPkVcyBSUQpFJxE5G2lXeAg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=RP2dXm2eXieX/ufdiLz07SKqSRZfYZRY1a5RBUMzF9g=;
 b=IB7yibi7wx4Xxk54ATzXUcWHOz9mDXGoKEg9FEGXqNdwHXg5M+x5olHeO0qqIDdV9Mg5KUThnit4v8H/hUn5+AMCohCqYnbxmGTWk51099PoK13LDUCD+Ux3A3zQN+b5xL4mMNFlYIBUqFkCWZig5Xyd9mHdpapDEev3nfwkK+cLUIZ+zHA7yg7FuMQYlJO8VC6NuSoej66su4aGyVPPQGLJJA9+hhtvCT5NbIyL+nR8Yiupq/fQUZtDdTukviIT7xp6S2qr3tZbNsIvQGD3ufTnKpnSULO72l8D3aVB0MTs04IV0Opp0jcwEvrJdvp+3MoSSN1L6/mRfeRG+osSuQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RP2dXm2eXieX/ufdiLz07SKqSRZfYZRY1a5RBUMzF9g=;
 b=AIn7mHXH/MA6QwQhP9VEj1QtO2wC/Cf2TbfHmg1HrZAyzJX7qyGQ3uuS67P8R7W+LiCJwyRurWcgu53i1uvOym2P7rEgCMxQtfbfTsedlThPtdL6oaQGD94f+JLkUNtHEJ3fKizNO63RXpW3ph3zXuCoh0RWFuZQs79KSMa+917Ve8ytJphDGTyT366ddzzwyEh1hfHSEoqhaEmEMARlRR0oCnpGAQKvUUVRa2O50F/02bNxnCHHQyIUF0lm6tLbA9AmqQkwDbr6utn4qgnyYGcU9mo5zu6m7nQSYzBeukivWCxVp3Ie2Luk4WNa31/cFtg08g+M4rQiGWfZDlU6cA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <7ad1dc72-3b1b-fa7f-8ce4-dd7973c8da93@suse.com>
Date: Tue, 18 Jul 2023 11:33:03 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 0/8] Make PDX compression optional
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0260.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b5::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB7737:EE_
X-MS-Office365-Filtering-Correlation-Id: 34dcfbc3-5316-4010-c9b6-08db8771fd34
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	9hAl2p8d7NTPEYpiZLpXZYcVvmELVZ8+8ptlL2fkuPMqm/FDOzZQi2LGlxoXmyOt18Jx7D/Q92u+Tv+kAttLG+ywSrTaGp7jQzHIaHqfWqnohIPdEwccTF+vKCqHPBgAShQ3YhYhYhw8qhEL2z3LD72hXgFv7SmhtWDjT2MpK4C+JTDSxABp5bVXRV2MtZRtzMpF5NL7Ayy9A9LN7adItNy0G58NMvECLy2Oe9rkG0VZZpUNCGmhxckAUV2cIHZXiBX2CJDjHF+2QQA7w8rL2v1sHCwZqApM6dxJeqTVHy8ZGn7enzECXUWXIc/hT7HJbG0oErlKmdetcULgxcXBXAO0YSpQ0ZXLZni3XIMiR9z81brAwFz2QDmlsp7qG4zX00GXtxbE9oLFOWk/OfHWaD/r95m1zyJYNCSwC4ke1NykTpASYgLXdvgxvlbOvdpysyvmb7NZuSgjnPzitQzmQ1Iq/oQrQ1s0g4eJfx2psXc2GUX2WpB54wHdeY9Gftnmklv44HI6sP3vbgoLzGSiXOfDjLm9GULcBroiVfrQwrxEwGC3l3aosN+fyNhzYUfWTsJoTGwh/+bFVpk2X/yDOqeUsvplYrbeExOP0I8AvLl28RZ6duSq+EqScvDUMzpcXhgJoXPPMjINDOuKbNcdng==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(136003)(39860400002)(376002)(346002)(451199021)(54906003)(6486002)(478600001)(7416002)(5660300002)(8936002)(8676002)(2906002)(36756003)(86362001)(31696002)(4326008)(38100700002)(6916009)(66476007)(66556008)(66946007)(41300700001)(316002)(53546011)(6506007)(26005)(186003)(2616005)(6512007)(966005)(31686004)(83380400001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?czUrSGpWMlQxSkpVVDQ4ditjZFQzQjQwalBWTU54Z3lqMS9XWFlyNHNWWVhT?=
 =?utf-8?B?dnc0YVpTa3NuR1FHNUZtZnR1SmI0U2c5d0NUcUNoczFwajlYdHpSTGR4N1E5?=
 =?utf-8?B?UGptTG1BeFFiQnFTZHJjQS80YmhlOHJaOXBsTFZQdzA1L015NW1IQ2U3Qmkr?=
 =?utf-8?B?cTgzWmhlT2dQTkJnbVdySnJydDUweTBQai9Gc0ttQnRTWUpJQW80eE84NzQ1?=
 =?utf-8?B?NnJUaFZ2NjUzVzZqYTVpcU41SnhYTFUrU3Bibmp6SnBiQ0loQjQ0WUxmck5Y?=
 =?utf-8?B?bFl2ck1FMk5ZRXdqa2wrYndHUytjc1hUYnNQYms4endTMnBNb1VsdElXN3Zm?=
 =?utf-8?B?TzMrcndzUitrcUVoYitmS0Y4Sk9LbGlwc0ZXd3dkQnBhRjFUSGtvMS85T0J4?=
 =?utf-8?B?ckdBTnNRUkt1ZThKNDNiUkI3QnBsSWtueVV2RkpxTXZLdmFoYUNIK1JZTFMw?=
 =?utf-8?B?ZVNudk9GUklkdVpNekRPZXpWY1RVUy9UQlZ6SjFOSG11bjVGMzhhN0drMGNr?=
 =?utf-8?B?aU1oTCtPRGxYOThjUDV3MVZlMVY5eUFzcURIRmtqWFVWUUpNa3RXMDkyNEJJ?=
 =?utf-8?B?MzBHNlZUMkVZNFhLWDhjamR0bFRubmhudGdiWGlRU3JPeXk0aFZtNzNBOGVY?=
 =?utf-8?B?aHBMeEtkNzg5Z2pTcEprSG93aDY4SFByczg2M2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dXMHA5YStma0tN?=
 =?utf-8?B?VUs2d0crei9nWHltMG12SldhZEh3QXN2NEp3bktzc08vRWt5Z0kxTjRpK1Yv?=
 =?utf-8?B?L2RMa1JFd2l2SHk2R2U5VGJUZ00zSUF6WGNma3hoV2ljNmQ1eitaT1VDOVNR?=
 =?utf-8?B?Y3YrLzFKNnpEVks0VkJ5ay9Qb2MrUllOTjJvR1VXODErdVZpUVBEMWg0L0xL?=
 =?utf-8?B?TFJjR2xNNnM1b3czaEcwUy80RzlacFBLb0lxbytYenVvRTdGZHBMMjNMMmNW?=
 =?utf-8?B?RjZuekMrRWJTRVRhWjBQVkZJN3lmZXAxQXJSNEtIWStjeHpQTG9aYnlHcC9S?=
 =?utf-8?B?K2t4YWFndEk3QU9YTkdQaFk5Zmd5N0VZN3hlZ2d0SGlzVU1TckJoZFBBVU8y?=
 =?utf-8?B?d09DbFpudkdpUFIyWkhuNzNjRmZmRXpVVTc2L1ZTVThkL25xcmN6b1hTTS9N?=
 =?utf-8?B?TUZSbWxvc2Q5cTJPZ2VzNUtJMlovNUphaHZnNWljQ2d1VE1tRjN4dnRKOUk5?=
 =?utf-8?B?UjZzcEFqalJFbTJMNVJNZVd1bThPdnlsbnlZeWJPK2t1RzVCaHB5SUlnQzhL?=
 =?utf-8?Q?NjWXp410rAsqOHSjnt0X2Gpwe?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 34dcfbc3-5316-4010-c9b6-08db8771fd34
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 09:33:05.3105
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: noIur7BQOKLRcySYOPJ2QnFSJfItdZp/a+zn1y8u2hWof6qjlGWRpphzuBcN5acBmtDgS+B0T0d1DXhilE/9rA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7737

On 17.07.2023 18:03, Alejandro Vallejo wrote:
> Currently there's a CONFIG_HAS_PDX Kconfig option, but it's impossible to
> disable it because the whole codebase performs unconditional
> compression/decompression operations on addresses. This has the
> unfortunate side effect that systems without a need for compression still
> have to pay the performance impact of juggling bits on every pfn<->pdx
> conversion (this requires reading several global variables). This series
> attempts to:
> 
>   * Leave the state of pdx and pdx compression documented
>   * Factor out compression so it _can_ be removed through Kconfig
>   * Make it so compression is disabled on x86 and enabled on both Aarch32
>     and Aarch64 by default.

I disagree with this choice of default for x86. To avoid surprising
downstreams, this should at best be a two-step process: Keep the
default as Y right now, and switch to N a couple of releases later.

But that's only the simple / mechanical side. Considering my earlier
effort to reduce / remove the involved overhead dynamically at
runtime (which you may or may not be aware of; see [2]), I view a
compile time choice as less desirable. At the very least I would
expect some justification towards this build time choice being
acceptable / reasonable despite the earlier effort towards greater
flexibility. Only such would be likely to have me merely defer to
other x86 maintainers, rather than outright objecting.

Jan

[2] https://lists.xenproject.org/archives/html/xen-devel/2018-09/msg01616.html


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 09:33:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 09:33:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565050.882889 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLh5j-0004hr-9u; Tue, 18 Jul 2023 09:33:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565050.882889; Tue, 18 Jul 2023 09:33:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLh5j-0004hk-7C; Tue, 18 Jul 2023 09:33:59 +0000
Received: by outflank-mailman (input) for mailman id 565050;
 Tue, 18 Jul 2023 09:33: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
 <SRS0=88xE=DE=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qLh5i-0004fd-6i
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:33:58 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2045.outbound.protection.outlook.com [40.107.7.45])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3734d598-254e-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 11:33:56 +0200 (CEST)
Received: from AM0PR01CA0142.eurprd01.prod.exchangelabs.com
 (2603:10a6:208:168::47) by GV2PR08MB8296.eurprd08.prod.outlook.com
 (2603:10a6:150:be::19) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.28; Tue, 18 Jul
 2023 09:33:26 +0000
Received: from AM7EUR03FT054.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:208:168:cafe::ce) by AM0PR01CA0142.outlook.office365.com
 (2603:10a6:208:168::47) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend
 Transport; Tue, 18 Jul 2023 09:33:26 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT054.mail.protection.outlook.com (100.127.140.133) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.33 via Frontend Transport; Tue, 18 Jul 2023 09:33:25 +0000
Received: ("Tessian outbound 997ae1cc9f47:v145");
 Tue, 18 Jul 2023 09:33:25 +0000
Received: from ea69b31679df.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 F3FA705D-14A4-493D-A28E-56C1A2A41341.1; 
 Tue, 18 Jul 2023 09:33:14 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ea69b31679df.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 18 Jul 2023 09:33:14 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com (2603:10a6:208:104::24)
 by VE1PR08MB5646.eurprd08.prod.outlook.com (2603:10a6:800:1a9::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 09:33:12 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854]) by AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854%3]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 09:33:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3734d598-254e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0Tbv1FKb9waQ6bfaBtm0gETPPGX9DNMmKySPDtTCDXs=;
 b=Y2o4wfQKbpsnpBZi1i9Bgn1t0mqO59TLz/FNYkkeZLH+rfsbc87Ob6SthXjpnNOBx51HL1IRtGW0JZMWoWE32ztlUtlxJTINVxBbq/ur76Fm7t7Ki5WZkEFQEYz4IUrWIiUKkUOPRoP5YQjWF05/ih6UwtaxxuFP+xMxXmv81iE=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 1f760bb9ffd1f118
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=huVZsB6raCyBeSjwB7sgOO5d7s0XUxXL7yorm216AmcPwedof2iIqfJLBnbhhO1wXquBjNabSqeNhfVQ2S7ULOCOEu8/INmZj2LAXJiMTvSD19PwmdSSdqUzy/JCkk+XbnRdDkrN4WTumyFjP0yl0yurB/IZGFnggjG8no57TiFVQ8b5bKSG92flkXcPQ8JmLSHsDUQlj0eP4wuznPRzphGUopCblQlyEAgxHgMTBwP4NEJC8e2ck0HA7sgZecfrSiexvAqExcS2bpITvxZ/0/NUq4PFAJgCaolKb9qU906qEUqeZ+TM3m9Lzx15wSiSEsjMf1QnW9PkLb4LMXj1tA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0Tbv1FKb9waQ6bfaBtm0gETPPGX9DNMmKySPDtTCDXs=;
 b=gc4bt+C7iQdbsdXjktU+JQiIBQp75H6a/xOafj+y4EEi626q1wj4YcPXv62Cq3v0XPfl4PKIrKtzomjOY3QglOhS4WaMI5j0q1jIWqUS02m3L52t61Polr5eHRfiilowC0iJ6BTJn0Shv2GYkghP6xL3waIoLh8QqiAQVtvadNUQ7zRn+niuM0MvbP4YP/LJllujXan8MFb4AK2/OHqE4rezg33QMC/A21cio7MrB+a994/9Z9epIbAtQT0HH/uBL3YDpfxi5pO7tQPJS83HYPuV7m37fkXlEo5hQFPeIIb1phmXIyQ3BEP7TL7RV4KhWramhbKEo4bJSB9uss/I2w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0Tbv1FKb9waQ6bfaBtm0gETPPGX9DNMmKySPDtTCDXs=;
 b=Y2o4wfQKbpsnpBZi1i9Bgn1t0mqO59TLz/FNYkkeZLH+rfsbc87Ob6SthXjpnNOBx51HL1IRtGW0JZMWoWE32ztlUtlxJTINVxBbq/ur76Fm7t7Ki5WZkEFQEYz4IUrWIiUKkUOPRoP5YQjWF05/ih6UwtaxxuFP+xMxXmv81iE=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>, Henry Wang
	<Henry.Wang@arm.com>
Subject: Re: [XEN PATCH v10 07/24] xen/arm: ffa: add defines for framework
 direct request/response messages
Thread-Topic: [XEN PATCH v10 07/24] xen/arm: ffa: add defines for framework
 direct request/response messages
Thread-Index: AQHZuH9VLJxUidniTESByzUbqPoASa+/RLGA
Date: Tue, 18 Jul 2023 09:33:11 +0000
Message-ID: <71CE2D23-EA20-4216-A448-EBECE0564875@arm.com>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-8-jens.wiklander@linaro.org>
In-Reply-To: <20230717072107.753304-8-jens.wiklander@linaro.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM0PR08MB3778:EE_|VE1PR08MB5646:EE_|AM7EUR03FT054:EE_|GV2PR08MB8296:EE_
X-MS-Office365-Filtering-Correlation-Id: 27bb4bec-85d7-4a32-0213-08db87720969
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 /CJwQHUs1ngDZCS+ImxiF6PHUfa6lJGl8Io2t0+YyN41eVWeG/+8H1SO5EUnzVB5vITf0hRmweDMF908z/ZcTjbzwRKitfpz0EJ+7DC7p6jiuGXYMxOzVtFOh9W99mG7iytMWY3JPrr+Miah9dCK0FZY9XeCcY3jbR2G1AuZTIyJWPz/2/F5qY5BjErzcQVTnNwcyoFjW2slfwwyqWbDg9DUrxoNoPZK8s7QQCDs83ZG7p3Yw8Lgg4gd/ewxwS4iAsAfrDtlXfwvBuOcpLLiFq46LzgJczKlVi8LcRCmu20aQCYncKQCcOhtxiar58ie9vLieKPNenWlVbSs+OVEkv/Cn8HH4SnZs5henKWXS6J5msIuQ6hnjJzRdklKQhBzW60UbvsrvCe5iuo1x/EwcLfxNZGiOeMVVjOvd6qNvZ7sOwfycFwvKFe/h0aZtag2FBWhLPTO7ZnjbU45EYfrgNfL4Yx0w7+1qS3k+LPNpJ2uvI9d3G3vISBjAqN3gdMfLUpHfap+oX8EnIAZ8I1ZJm6ijzNJLosVGsxUwHgTQfKpZZTKPXUtfRcN7BcisDQhYcjre5RdR7yDhNrbIFZyJR79zHJWeTnmuZICnY0WhqhyvOiU6qqd1NJnGuhlF+gy7cxxdyApsWnWAjWZ+Ed/AQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB3778.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(39860400002)(396003)(366004)(136003)(451199021)(2616005)(53546011)(41300700001)(6506007)(316002)(6512007)(83380400001)(186003)(6486002)(478600001)(122000001)(71200400001)(4326008)(6916009)(76116006)(66476007)(66946007)(91956017)(66556008)(64756008)(66446008)(38100700002)(33656002)(15650500001)(86362001)(8676002)(2906002)(8936002)(36756003)(54906003)(38070700005)(5660300002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <FC830DB1AA2D5B45849FAFA40346AF89@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5646
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT054.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	cd955d8b-e8f7-4f87-ad0d-08db87720143
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	GmgAnjzYn8dFE2903d/lL/9lGC+drfYy6OZknt5c6SMXygx+jzXapb0tU52CVJsDkyfKNPnKOV0/kvt04IvC9MlDfABh5qkNYWWn72bfhOpbrNfFfxlmcmM4kXADic21HMAHGIergO7x+T8U+BROXWxtY/aerPgQZIK/lcpleHZzh2Ds6MJYsu/t+/7YFjX3wGKWJPDIoOwHbWqFOJu0N/sl5sSAJkeqzs+HGBV+HyqtyT3evwWls+R4pEvRMt8nPEQzUAWUkgbc6zRDJvZQux+WBcv1OCBzDCMdo7bT7/ZgINBol1KpoChQyA6Q05f0Eo3Zdmx3pgVU1oMmZ9NqwMa5RkHPZGWyZEc1qcksxtawl+6PCwiQ6Q6d8ZuZxrw6RDpnR+rDsW/MpfD04s2X+n2coDgQCvy1LlhxM0mFiI4rqdfEjq0bnT9qWcjTqcXHkaYX+8Ty2OjrrA7LpdRw797rhT8p9x8QlnVNOEmig+iq+xdc53Ub1BwIZSBMORnh7Qye1TFnvfRAR6xDwp7eozict++xsRtoAEXcVFZhVtH4a2kz9ebPNYpgE/tqc4dGLBJ7ogJyYJ10k9hn/kRd4r29jnfU9Ysxunie9hOQJkzUsdqJ4wYueCW4GXQbJgkg/z55uJcrtBtSwbhIHGnsB9GAnJxCUb1jRHTIbv86nzZO3Iw/66A3QHXzOubHazcmH6CAnOgO6+ymDO/hmWIGSeAK8alwMVl5XMJwXh/q11ZIYCEv3cGE1YKRg8PYUx4A
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(39860400002)(396003)(136003)(451199021)(82310400008)(46966006)(40470700004)(36840700001)(316002)(4326008)(70206006)(41300700001)(2906002)(47076005)(70586007)(40460700003)(40480700001)(54906003)(33656002)(86362001)(478600001)(8676002)(6862004)(8936002)(356005)(81166007)(82740400003)(36860700001)(6506007)(26005)(53546011)(36756003)(6512007)(6486002)(83380400001)(5660300002)(336012)(186003)(2616005)(15650500001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 09:33:25.6486
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 27bb4bec-85d7-4a32-0213-08db87720969
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT054.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8296

Hi Jens,

> On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> wrot=
e:
>=20
> According to DEN0077A version 1.1 REL0, section 18.3, Table 18.{21, 25,
> 26, 27, 28}, add defines for framework direct request/response messages.
>=20
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> Reviewed-by: Henry Wang <Henry.Wang@arm.com>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> xen/arch/arm/tee/ffa.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>=20
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> index c1dead73d1f2..56a0a10c1e99 100644
> --- a/xen/arch/arm/tee/ffa.c
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -57,6 +57,19 @@
> #define FFA_MY_VERSION          MAKE_FFA_VERSION(FFA_MY_VERSION_MAJOR, \
>                                                  FFA_MY_VERSION_MINOR)
>=20
> +/*
> + * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
> + * BIT(31): Framework or partition message
> + * BIT(7-0): Message type for frameworks messages
> + */
> +#define FFA_MSG_FLAG_FRAMEWORK          BIT(31, U)
> +#define FFA_MSG_TYPE_MASK               0xFFU;
> +#define FFA_MSG_PSCI                    0x0U
> +#define FFA_MSG_SEND_VM_CREATED         0x4U
> +#define FFA_MSG_RESP_VM_CREATED         0x5U
> +#define FFA_MSG_SEND_VM_DESTROYED       0x6U
> +#define FFA_MSG_RESP_VM_DESTROYED       0x7U
> +
> /*
>  * Flags to determine partition properties in FFA_PARTITION_INFO_GET retu=
rn
>  * message:
> --=20
> 2.34.1
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 09:35:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 09:35:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565053.882899 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLh6l-0005LP-Ij; Tue, 18 Jul 2023 09:35:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565053.882899; Tue, 18 Jul 2023 09:35:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLh6l-0005LI-Fy; Tue, 18 Jul 2023 09:35:03 +0000
Received: by outflank-mailman (input) for mailman id 565053;
 Tue, 18 Jul 2023 09:35:01 +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
 <SRS0=88xE=DE=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qLh6j-0005L6-Lt
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:35:01 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2060c.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::60c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5cc0b65a-254e-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 11:34:59 +0200 (CEST)
Received: from DUZPR01CA0025.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:46b::13) by PA4PR08MB6256.eurprd08.prod.outlook.com
 (2603:10a6:102:e6::20) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Tue, 18 Jul
 2023 09:34:48 +0000
Received: from DBAEUR03FT037.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:46b:cafe::50) by DUZPR01CA0025.outlook.office365.com
 (2603:10a6:10:46b::13) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32 via Frontend
 Transport; Tue, 18 Jul 2023 09:34:48 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT037.mail.protection.outlook.com (100.127.142.208) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.33 via Frontend Transport; Tue, 18 Jul 2023 09:34:48 +0000
Received: ("Tessian outbound ba2f3d95109c:v145");
 Tue, 18 Jul 2023 09:34:48 +0000
Received: from 44dc659f22bd.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 98DDDD9C-EBA5-4968-B97F-F3B9865AE9AD.1; 
 Tue, 18 Jul 2023 09:34:37 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 44dc659f22bd.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 18 Jul 2023 09:34:37 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com (2603:10a6:208:104::24)
 by DB9PR08MB6412.eurprd08.prod.outlook.com (2603:10a6:10:23d::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 09:34:36 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854]) by AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854%3]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 09:34:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5cc0b65a-254e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=i/g4k9D9SvR5mKHxvJhhHBkmqMlgOSwvcoxhNKuGuP4=;
 b=ddOKPqt5qvi5i5H3N2ZCy0pSJxqg/P73EPxhOmPSzlpoRDKWKHeIQr4kv/pJRsu+Dj1ja/L7OyA268oouS1YfptrZL6ZzgrBSJR/52uEQEp5zxIjmi1N/P4hqJKfEIh6YczLxPz9h6JZAtBlY256ch80kd0/TJ2kLmyz3H8u0f4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 75667ec8af444dca
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=axxv49FL0jpi2XNei41+FW2eUaR6UnH74tsSRhIWz+HdRruK0TIREEVlUkgAly4La63O4H7KU9CF6n+ZmnXk73Ctgv/YSeX5NjyH6d/pIwXNZ3WurjqeMmnZNOc8/uXPkCV8KedngSDMjfGGSHAJ12UJw1YOou2SjinsXpAHHHw7n5+z9Pncjj56JuZJlq3W3TGuYwxkI7XUGkz3w0Xyltq2E+rPAVvtUBjj1q41U41UvXwfFk4SH2gPmNdpgg1FXbYStrUdjDhxI2+QCqtP2M5kJEuuXTzZxSbEL3hJBRfFd7NPGef9uPu5eu9L/gpEE28UDdS9RnfaV5bPTl2O+A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=i/g4k9D9SvR5mKHxvJhhHBkmqMlgOSwvcoxhNKuGuP4=;
 b=BdteZDbx6vBGZ20KQM2cYSzFwTSIX2e8NHvYeNBOs34p2D13kj1+yf0nogZWo+CnKs59viFL0ySA3k4cz0s9qfE+X8OCIu2zf74qfK60/Y32gCm7N4gZ5BK8IGBrVAdqQar61uEpCFLKSDAz9k/s6ldQPAAZEYinfrO3owQbocK9oPmzeRRHNOvo2MUCPH8iFWTOFiLPFkmHaUQ7xUdAGrN0mv8O0gm5mYtObT31JlhGW5pkbS23HAenACDAKtb01tXvVwJXySzo8O/Lt/waJ94wTUqhpi8qtCJYh4Z9eaISm97ccLGgdFGnljZFIcDUSz5b7sG1pF+67XM6zZSxGg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=i/g4k9D9SvR5mKHxvJhhHBkmqMlgOSwvcoxhNKuGuP4=;
 b=ddOKPqt5qvi5i5H3N2ZCy0pSJxqg/P73EPxhOmPSzlpoRDKWKHeIQr4kv/pJRsu+Dj1ja/L7OyA268oouS1YfptrZL6ZzgrBSJR/52uEQEp5zxIjmi1N/P4hqJKfEIh6YczLxPz9h6JZAtBlY256ch80kd0/TJ2kLmyz3H8u0f4=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>
Subject: Re: [XEN PATCH v10 09/24] xen/arm: ffa: add support for FFA_ID_GET
Thread-Topic: [XEN PATCH v10 09/24] xen/arm: ffa: add support for FFA_ID_GET
Thread-Index: AQHZuH9UE3hx62s6skKCeGk62Jh6i6+/RRWA
Date: Tue, 18 Jul 2023 09:34:35 +0000
Message-ID: <468942F1-A41C-4152-9745-9E6205CCDA1A@arm.com>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-10-jens.wiklander@linaro.org>
In-Reply-To: <20230717072107.753304-10-jens.wiklander@linaro.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM0PR08MB3778:EE_|DB9PR08MB6412:EE_|DBAEUR03FT037:EE_|PA4PR08MB6256:EE_
X-MS-Office365-Filtering-Correlation-Id: 7fd3d75b-06bc-4e0c-2dd0-08db87723ac4
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 MGM8RAgNiDFUX5WsIq9gO3w6OevuTc3c+GzIDZRQOk7ZXrX6jUZocFRhhdEgjD9LcG7zhRiN/53WcbZQPPJcWNLTK229j1nHnlWY7YhoDyBlUpblybcPXooHbaEWzKYukh8XOkY42Xtz1E9nq/rTJPWPLGn1KnytceU12I3XTRXi/R87N0zjA7f6UYF3f6ged5BV9Xu6fGBCuMwJnlVfI7nAXStodqmIi+4BIISyLsL0ILIMm8RgPM+5JuMFl2iA8URvrQ2J/N+Ke1DRFCX+2oU+FZCMjNvoprOcUFwXlMencnG20zAzlJfIRD00XFyHm1dgqiVUGhDGFERlK6OIkYQGxvIy8XYfRGjzKXVPblyAk2vl1AGaqgexzDLLAdWBU8hTRsJoAd5AuaL7Nk2TJ/7idbTx9/1NaiDmQOWG2PNdpyu4XS3oRJMrOAPzsSIFtP5u36FQEvGS3SJZSgNK6L80Qzxt1GQsyYEpCTbuqvI3aRAWBGFkcB4qWv1BNE2r6pAYBfncHZUL5W5IA3d+DCFctOIPYaoGbN4VNgP/3EZOCzzQxY1wR35zcOGQeaFlyXubTtapotXx0Y3vC/CW9jf0783yBYPO01SkZG+Nn/gn48LMcxOoDBlR3YdmZfANbIcUhiPJFfkcUL99BQBU0A==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB3778.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(396003)(346002)(39860400002)(376002)(136003)(451199021)(91956017)(478600001)(66556008)(66946007)(66476007)(64756008)(54906003)(5660300002)(4326008)(66446008)(6916009)(316002)(76116006)(8676002)(8936002)(2906002)(41300700001)(71200400001)(6506007)(6512007)(53546011)(6486002)(33656002)(38100700002)(186003)(2616005)(36756003)(122000001)(38070700005)(86362001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <074D4CD228B45D408FF2AD5F008525A4@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6412
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT037.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	89fcd673-684c-450f-950d-08db87723343
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	95AVwxQInuhSLcY13vV6o2nEQp6H6RH/ihGaQtYlJZRz/pIQ8tsWWSrHSEnAsRn6QGqxPzxIsZeXXxJEpjTXFZ6cKOLwne85KrssPxbNg81UrGfUVBDrisVA0GkhE4Sa6kC0t5g0Z0k9TSuzggmjOq08FPxisuocdBq1LgCwDn4rwaB8mdUjyOPObJmXlw7w9H2RbehtKdt7Kly6pSrOGIzsTGz20I4uJlx+mtH0F5kTneRLDqBCDEUdcJU4Wbixn7ybULxOL8m/rzmqBfASJwCEJ/gPgGH1BJjI+I9ypPu6s/vmkMKmwZuzeLzHekSIWAtPQvvIMle7SKUH9xYwTHeA38j+RY7RG1u6W3Bdb4+w9b6S74/b82APLqxKarUceHLzJa3c0W9dvHOUxhlzgXNuU2UScUXLiLGMsGvy1XqWRmdYDG0uxeDnq6ZLWmOARh1gK2OxpqQZcnsi4lz0FmgM+y/uYxkgiPGmGrpGmFscd/B4CUGZQtjXy2r6oyzrZrszrxu6F7qHpFZjyUv3txp5U4mgZaCEKo+n5X/baxU1HOI4Q3stQVJ6c/7QSFst+zZQ1D5fsafWuoT+Nmubv7gjsXvXD7WcIoeOqoBKgN3IYNFcxwYbKnEZxLmSj1EDwm/H9AYWMRs0fpFvHLOsH0zmpmMPYBwL1uIlLUM6CkDDxpw92mSc62Qafftw6REoLML+W7HeHVa7j7Q9z3UH0g8s1wW4cflnyi3Lo3p7g1yt22rg8P0en0x86z2gz6CM
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(376002)(396003)(346002)(82310400008)(451199021)(46966006)(40470700004)(36840700001)(86362001)(2906002)(33656002)(36756003)(40460700003)(40480700001)(6512007)(2616005)(186003)(36860700001)(336012)(47076005)(26005)(6506007)(53546011)(82740400003)(81166007)(6486002)(356005)(70206006)(54906003)(316002)(70586007)(5660300002)(478600001)(4326008)(6862004)(41300700001)(8936002)(8676002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 09:34:48.4857
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 7fd3d75b-06bc-4e0c-2dd0-08db87723ac4
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT037.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6256

Hi Jens,

> On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> wrot=
e:
>=20
> Adds support for the FF-A function FFA_ID_GET to return the ID of the
> calling client.
>=20
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> xen/arch/arm/tee/ffa.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>=20
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> index f0a2715d4bbf..e157ed20ad8b 100644
> --- a/xen/arch/arm/tee/ffa.c
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -181,6 +181,12 @@ static bool ffa_get_version(uint32_t *vers)
>     return true;
> }
>=20
> +static uint16_t get_vm_id(const struct domain *d)
> +{
> +    /* +1 since 0 is reserved for the hypervisor in FF-A */
> +    return d->domain_id + 1;
> +}
> +
> static void set_regs(struct cpu_user_regs *regs, register_t v0, register_=
t v1,
>                      register_t v2, register_t v3, register_t v4, registe=
r_t v5,
>                      register_t v6, register_t v7)
> @@ -195,6 +201,12 @@ static void set_regs(struct cpu_user_regs *regs, reg=
ister_t v0, register_t v1,
>         set_user_reg(regs, 7, v7);
> }
>=20
> +static void set_regs_success(struct cpu_user_regs *regs, uint32_t w2,
> +                             uint32_t w3)
> +{
> +    set_regs(regs, FFA_SUCCESS_32, 0, w2, w3, 0, 0, 0, 0);
> +}
> +
> static void handle_version(struct cpu_user_regs *regs)
> {
>     struct domain *d =3D current->domain;
> @@ -224,6 +236,9 @@ static bool ffa_handle_call(struct cpu_user_regs *reg=
s)
>     case FFA_VERSION:
>         handle_version(regs);
>         return true;
> +    case FFA_ID_GET:
> +        set_regs_success(regs, get_vm_id(d), 0);
> +        return true;
>=20
>     default:
>         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
> @@ -237,6 +252,12 @@ static int ffa_domain_init(struct domain *d)
>=20
>     if ( !ffa_version )
>         return -ENODEV;
> +     /*
> +      * We can't use that last possible domain ID or get_vm_id() would c=
ause
> +      * an overflow.
> +      */
> +    if ( d->domain_id >=3D UINT16_MAX)
> +        return -ERANGE;
>=20
>     ctx =3D xzalloc(struct ffa_ctx);
>     if ( !ctx )
> --=20
> 2.34.1
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 09:35:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 09:35:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565055.882908 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLh71-0005ju-UU; Tue, 18 Jul 2023 09:35:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565055.882908; Tue, 18 Jul 2023 09:35:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLh71-0005jn-Ru; Tue, 18 Jul 2023 09:35:19 +0000
Received: by outflank-mailman (input) for mailman id 565055;
 Tue, 18 Jul 2023 09:35:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/lOh=DE=citrix.com=prvs=556a0cea9=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qLh70-0005JI-69
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:35:18 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 66c7b297-254e-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 11:35:17 +0200 (CEST)
Received: from mail-co1nam11lp2175.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.175])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 18 Jul 2023 05:35:14 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by BN8PR03MB4978.namprd03.prod.outlook.com (2603:10b6:408:78::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Tue, 18 Jul
 2023 09:35:11 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 09:35:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 66c7b297-254e-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689672916;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=R9Llah/rnHWUiuHEiuseJgOjWEtVvLHXOHIcdnT5pNM=;
  b=coC92TSRcqv5V2b29XHFA+qN2JKhhG2ALgBaM2xbXaBeXKMmzXfDO3QE
   p8yApFMUj59wjLXIBEpJ1DY3r/R23O8STwkgy4nwaKKj/yKP9/Hvh8zPA
   av8HkfVsUtbWjuAC489Xujcu8QZf64XCsadyqW39p4TPdgqux04GYjKc7
   w=;
X-IronPort-RemoteIP: 104.47.56.175
X-IronPort-MID: 115275188
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:VlO0vKlAdjaJNCEPs/VdeJXo5gwnJ0RdPkR7XQ2eYbSJt1+Wr1Gzt
 xIZXT2Ba63fMGP0KtxxPo+yoUMFscPSx4NgTwY+/ngyRSMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5Q+GzhH5MbpETU2PByqgKmVrNrbSq
 9brlNmR4m7f9hExPdKp+p6TnpoiG+O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q?ZgPWZDx5VGRKBrwSUcrZyfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,213,1684814400"; 
   d="scan'208";a="115275188"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BLdkYhCa+pfsznKie0ftPQuLP9QHnv52HDmlr2NXr7rQN6dZjzVRPBp5dRmGlTywT2v5awANbZJR35UPNaINC40Dra1t0qpnSR7wyY8l2MEEuJ72GhkCTlAAnQ9nfFy22XjZrtnZ7CPl3j/zGmkPn5LYU5XRAOPue9FjUuxKOs3j9gK+owQZDSXwMcJ2rpdKYlKIVVgPzH2P5yS6Z1OAAY5d+N98PVtNM3n5ehW349581pek6jmA0vvvIm5TzdswmCs/sC//hX1g6Lwzddxwqh5APmyLfhc5jtJMpd5ZI+Q9etc6r5If7AeolJmW1ylfWGvhVxF3m/qGRYHeYNR0tw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=TtLv1TAeU+RBC6K3oID2uq6T2gCwle8imeXUz77rNpA=;
 b=Yk7u9VcKOHorsnbg6iF/orazo0BhzR59cJvJo5wFrUZq4rdxU68OdtcBjhjgauE9vJgLv49IfUGAD/e3PArQmUe3+nQ4hH4xenv4XGj1bb/0SHJFgpGet8l+7MMZLnlwTHQSnn33taOvtWACLvSYupuGGvj75M++cuuZ3KWHs2AWP6FG7gh2Za48EgD8yJMV5CZxm+EWuoIFkNNiG44Xf+9RSR1PdqYQG3blPtLJb50/keJjwNHmLJczBiBQGj1UALATNCRV/x5ELoBZ/U3sIJZMKS4Kp0akt4/Etz1ZB+eZgYbKSrdnjF99DnphQavQs5WpBVoa7xBQiopEK9wwuA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=TtLv1TAeU+RBC6K3oID2uq6T2gCwle8imeXUz77rNpA=;
 b=jUFiN9HrHf1n3oo7VQHoSX8SDW5nhqJTfE0AZhJ5OeuH/ohFkxLfzZqfsVRUOYCND82KXDilhjIvB9cOd5pDR0rAUPIdRCDfktvM30YExgxl7Qcxw9AFchd8DqL1ZzM0x61fWAzT/Mq9oZ9CcTR3CpVZsgLZcCBaIWJweA3TZVo=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <c06920d5-763e-a141-cd68-dedcecd33da8@citrix.com>
Date: Tue, 18 Jul 2023 10:35:03 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH 4/8] build: Remove CONFIG_HAS_PDX
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-5-alejandro.vallejo@cloud.com>
 <7e5bd2a4-d810-cc48-cf43-3ad64e501d55@suse.com>
In-Reply-To: <7e5bd2a4-d810-cc48-cf43-3ad64e501d55@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P265CA0054.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:60::18) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|BN8PR03MB4978:EE_
X-MS-Office365-Filtering-Correlation-Id: b8cf134a-e45b-4ffc-5120-08db87724823
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Kph7wplM5GBUKwmWRcwOcCFGUMieP66ywJm8G1+zjh8ScnU2x7hCYjfZta/SwBXvCEaU8m1jN09VCgFLyjiOD/Rf5WzpezKNtATWofzbQd0kELwlfPju4Ua6ggzP5H97YYjvYUOBcKQTbUKIINSdwX10h8IGqkQJryB23ctLVad4B+uZ91dwbIvjMPGO/4v6AL7ptMMeh7CJ1R1QF4ruz0aBfabrulaXtu7lPW3o94Svp/1dgO9KCgHMQejJ7wBbYCAcho8jBIuSjqdF92dBBplDRBcwrMPLrzW9gmIc3Y5z6IdfG5pC6mTXF8636b12R8aPrf5eL7Yi+lVdJTBPIrYzu8y+7DaCorK0yvQBkX4EhnrUC4GCefc0WTlEdAYr5So5+cg1s/thkEHz2EQOpRcM4iF7O7xUpzoAlOPJuexySONc/gZdHHKlRoEzHvHaoyuaP2hVOROTXI4MYFbgppcaf4P3Q3cKxAwT5w/mvVYo2M2r6PmwOExSLX0C88jIgzwBKaRrI0noQ7UlcFyTn/ZHUySMUfUBMEQKsdPgERAlXYiAYIlIwGq0ZoqhPZh8GyAcqWzxfgsic2Z5Rk5Z03R1MetAT0B/68bLVBsvbmioDL9/YXxciycazKKiqnAW4+OsKuwi8VFDnsZdRxkvgg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(366004)(376002)(396003)(346002)(451199021)(7416002)(31686004)(31696002)(86362001)(2906002)(36756003)(66899021)(6512007)(2616005)(186003)(83380400001)(26005)(6506007)(53546011)(38100700002)(82960400001)(6486002)(6666004)(110136005)(54906003)(316002)(5660300002)(478600001)(66556008)(66476007)(66946007)(4326008)(41300700001)(8936002)(8676002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TWZkUVlhR0YwaEFRUHFCeE5yc25LaWpHZ29CRmxrNXo4Vm5kRFBkSlBKRytW?=
 =?utf-8?B?Tkh4OXg4aWVqVlVlQkd0c1hnRWc2ZmpjRGlvSjRJSmsxNjJiTTQzNVpueU1u?=
 =?utf-8?B?M2ZseTFoM1JyWGo1bURPYjRmRG5JSDY1Ty9KNnU4TzZ0R1JKRU1nL0ovaEND?=
 =?utf-8?B?OVNlMmd4Z3NLNXZ4ZWx4Z29FTXIxbjNybWVlV1ExTWRXZWUrem9wc0l5Ulp4?=
 =?utf-8?B?V1BZSUI0L3ZUVDF6OWtIZlcrMkdQRFFmTGdwL2xIQ2tYdktqVE54SFZuRkFi?=
 =?utf-8?B?YW5ka3pSeFFGN0QvTnc2NW1zMlFlelIxV3VBQ2FJRHpId1hkSnFuVDB1b25O?=
 =?utf-8?B?eHdoeVJ2Q0Z2SkdXaTV4NE9nVGtIVjM3S2NROXRaMFB1YThJSzFqb3VzaFl5?=
 =?utf-8?B?VFhnVU1iWGdVN3JjekJ1ZFd4NS9RQWwrV3MzOHF5R3pDL2lKV0ZKY1ljWk82?=
 =?ut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ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	Szyl7PpYGamaXmXN1S2C2z9oALqMDH04fJQ7KGEUG0tvDn9U6EDgjuXc92K3Mqu9DAof7CbDVMqnwG7udjz85jbC+Gh4WZRqeFjPoCpVptAGkEpIZMJ4LAJ9DEEdGI2KPz+y34o2bqPloZZJnl2aR/SFNpaDOwi7/gtXy8zeMMnpJak/QNLqJPY+VIjUd3TUrlJ5rE974nLPk5L7gBFCM1rEmnleyJUESx5igdnKezPwZJkHUFQdU6O75AMnpLXGacFl2ZqXuo+cyjtP64c38KFcikZmqXOdWsuijyIsqG3f7WU5xfxgeiX1GBNOgGwBIW6VT2fIgrFp9ZzRLrV8xYBBNXCCiZ4FbrJwstqN4zL1e6fGeRzQ3B4IXi7FvTvKd8Q91MmVX1VP4vdDYvWUj2/BuekdcLTPiesTVB35LLZMHSRjnxsSOVraboM72xJvv15OdAG3LxOjaBWi8V3V2jibd4KwR1q25pCCWfT/01vOtvKhWc5+ZrDmy2lnRphIJkM7zNJPGBqj4pd95lAZeenWyE03q4eZ19w4b9uHj46hAEsmGz+RhLVrBDS6r/xdp1sJa06j2SqrpEVnZ/VNqPoaZOOvT7hna8hTIYpRoyfzADbFyiRw0P1ZKBIkEnuldyHZXWt50aA0uiegqqv7xO/qEC5jovx63J2NLrVckIZL03kBX69VaFG0AbMaeUWpL6WCH2c8tuIDlhNj1GSHGAPLS0+3jqZoXtIa/McOlZ5LKpgJKP36mdZ+x9OMb6jgGJzKvyrVyYM2vOMN63z5q0qWTXzJhyT/SYSQTudRJO0qF1nw67enTnH/hwomSaqH72pbXmwjZH+PhVxOmdBtXWTsBHb8lIRdF0B22kmLfhhMEeVFFuAZHCDq04cemeVPO86gyl/rRSGpVhzyGpV8EGBw93C4MMfbzmFRDy7jqRk=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b8cf134a-e45b-4ffc-5120-08db87724823
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 09:35:11.2299
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Hg76KoHD0GfuoXLC9116C3aR+li7MGGWSLmYbWFrhTaY4vf94N1SbIMgo/Q9ZuYMO2OiV02BHBV2gAjbzF/tW6T2fse/0U6Z8ChBzI78X4Q=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR03MB4978

On 18/07/2023 10:19 am, Jan Beulich wrote:
> On 17.07.2023 18:03, Alejandro Vallejo wrote:
>> It's set everywhere and can't be turned off because it's presence is
>> assumed in several parts of the codebase. This is an initial patch towards
>> adding a more fine-grained CONFIG_HAS_PDX_COMPRESSION that can actually be
>> disabled on systems that don't typically benefit from it.
>>
>> No functional change.
>>
>> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> On its own I don't think this is okay, as it's unclear whether it would
> affect RISC-V or PPC in a negative way.

Neither could compile without layering violations of PDX logic in common
code, and neither have got that far yet.

Now is an excellent time to be doing this, because it removes work for
RISC-V/PPC...

>  If at all, it should only go in
> together with the later re-introduction of a CONFIG_*. Still I question
> whether that new CONFIG_HAS_PDX_COMPRESSION (which imo ought to be
> CONFIG_PDX_COMPRESSION) then wouldn't better depend on the arch-selected
> HAS_PDX, such that it wouldn't wrongly be offered to choose a value when
> compression isn't supported in the first place.

... although I do agree that the resulting option shouldn't be user
selectable.Â  It's a property of the architecture, not something a user
should be worrying about.

I also don't see why this patch needs to come here in the series.Â  The
main refactoring in the following two patches looks to be independent.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 09:38:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 09:38:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565062.882919 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLh9w-0006hW-Cg; Tue, 18 Jul 2023 09:38:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565062.882919; Tue, 18 Jul 2023 09:38:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLh9w-0006hP-9e; Tue, 18 Jul 2023 09:38:20 +0000
Received: by outflank-mailman (input) for mailman id 565062;
 Tue, 18 Jul 2023 09:38:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLh9v-0006hJ-Mi
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:38:19 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2061d.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::61d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d379fb34-254e-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 11:38:18 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB8055.eurprd04.prod.outlook.com (2603:10a6:20b:2a4::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 09:38:16 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 09:38:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d379fb34-254e-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=UTR70kA3V7yh9k4xl79qZJzaf1EYHJJSUIA462krSkEIMXF3a/lTmHp1QLtI9zQht5Fey9Qcb6fmYEYdKSH7SPiL6TGOe72K+zJ0NYbFtLwVquq6oRxGLMWMs895x7BtBTY3ep2lrhJZ2nVKMF/piRRaCb598AnSj3pbq6T8qD9crqL1xttJWf4iRJkYEL7zCcwqP5a+LnKMGZDaNLVJOKdadTfitfEau0ifIVg1CSpw4Tv7HRiBf/itAiTm8oQvaB9JM/chenlOmvM8k0K9EwtZEyvi+TWHxDxzm9dMsJwmO1n4/x7lJaNDpFmIui8fGO1ErH1jZCmTPgANRWbaIw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Q7TwtBQMoB/ADHaeR/9vVOecR+8XvixG9mM/INkO07M=;
 b=iQBwHx8i+Yq6X9joAr+LNihf8RxnAoQf5AB62Ut182bjZtdqzRWf9sO50BZcbN4jihRZisiBVWoGPb91RrS0EyMkPwuRuEFdelqcWWF5Tz41sK/rVgjimgFNK5kPmBn6ICCNUMjr0tYA4BVfRszHnUiYaTr5gVLhGbjJ0iWt06YxjCGLzQh/+QCdO7GiGXPywT3i9NY7fexrjepf8MYXit+s0/ZNYAi8TN82emPWsPbj3zx6UIwetJFQJtMiIbSbK501nXYuw7HOMPnMpMBrGZdBb4Ndu4Km26+V4yELaFnxCNGZYPITj/Lc0E2/QRRt2Zt23f0zXvAdVfR5HRSJig==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Q7TwtBQMoB/ADHaeR/9vVOecR+8XvixG9mM/INkO07M=;
 b=O7IiB3mxbm2zhl39DwVneWozIFHnOkqNbmzXkL5W9XQwEwArxZoLdCPHTep3gzhJJuM9xDIjE7MXCXwo/9tpBr63kzsnyG9voL/2PhhzET7rVTsFAIra7bRHHNtR/Og0nt4v/M4L3a1iJ9oKXR5cnwYPeiQCohvDsH70b7hoVKz0Arr2WeDRCdORMFW1pbZmk+lSzMQrw6LPWDUOjmqbRRTeh+qdh5qZ55XyvuWENJijWICTtExERWl6YM/v/yE7RWg7PhrCz9gQcE/ca8/T7G4d4fc0e9L2uT+z4ovmlRBG4SP9RVW5Uujc2VQ2CYgjat9iu9CeEMafBRh0+Ak6qA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <d9cd0bfa-52f9-94a3-0226-aa85d49a58a5@suse.com>
Date: Tue, 18 Jul 2023 11:38:14 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 4/8] build: Remove CONFIG_HAS_PDX
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-5-alejandro.vallejo@cloud.com>
 <7e5bd2a4-d810-cc48-cf43-3ad64e501d55@suse.com>
 <c06920d5-763e-a141-cd68-dedcecd33da8@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <c06920d5-763e-a141-cd68-dedcecd33da8@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0151.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a2::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB8055:EE_
X-MS-Office365-Filtering-Correlation-Id: 4ca5d9b0-0ca4-4e0e-67f0-08db8772b69e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	HOKVS9e8htInIJfsmtt+e90h2eeGNuAVPvQ129RFYW4DY2cXcKke5r01W0+X0Kx1EM4Mbvz3XeSppOHCxuxe8LQqNOhfPVGEmQ5poqHzYNR0A++mQM1x6Og79H3ueRDSReM/pUHeWm/jV+78cEZKTVXNG4PHHs7R/YMBiy5MqimJIN84sB2vblY77rhacgZU8ijnJ+lcyyLkyxEtVEVcg+hdw/I79pHAk4JCz4mgLF/dXHaYA8MsofrCwAb0pBgLjcaG9mqMga1bDoGB9t7oJJSlMX2rhZo5W6B8P4ipl1f7Y0KIO3Uzj0udhu7b8mL2F0BtbWhxIV/mlEnQuTRArZTZqZg1kzXLvN1PHVpO/3XzTPU/9xoGDsEbnzeEJkMbsSrfwRtS+VvbwgqXy9N+vX6mQ8iaC0lQu0dvX6t1bK+dE8+KULMQftbQzyKNLXi0/Kx17I9qR8WNGgi6XaQPQkiVcMWd1l8OmWvhtL8PP39FS47SpB44L7DsJbOu4JhzYCbcYO8MvKEq7ibW6sCfZ8hPDONbJcfvWMSbsQh3NDu/rNRWOFYB4mPi1T2XZXxOVFjBHdZLUTJV/13w4rpxjk1NxffYHcsLWHkScvg/F6Y8EbrMhU8d2fk8J6+JbHbVOH3BlhdcqocMGHnWxZ3qVg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(396003)(39860400002)(376002)(136003)(451199021)(478600001)(5660300002)(66556008)(66946007)(66476007)(54906003)(4326008)(7416002)(316002)(6916009)(8936002)(2906002)(8676002)(41300700001)(31686004)(66899021)(6512007)(26005)(53546011)(6486002)(6506007)(38100700002)(186003)(2616005)(83380400001)(36756003)(31696002)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZUN4VVlEWXB2dXpzcTQ5YkVoNU1xZngxZUszWFo0d0dYUjFSb2VCSHF1dDRp?=
 =?utf-8?B?ZGYwNW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OTB5OGpt?=
 =?utf-8?B?cVRXTU56cHZNMTR1SklCYzI5UUhIVlBtV241bi9xOFlFQ2FpbnZpNXVCVnQ4?=
 =?utf-8?B?L3hKTUw4MC9peVIyZzR5MDZ0dG5rSEMvOWIyTGNVNVZLcFJuRFRXb2xlKzhv?=
 =?utf-8?B?VUhQdm5BTHlNRmNpSFJxNFRRYlNxM2dtUGEvRkdndDlXUzluQXliUkY5UTd5?=
 =?utf-8?B?aGVHaldaSkc1bWlRaXd4MmZOUFpRWkczTDAzYmtsTFlRZlBEaG9WUWJYekRl?=
 =?utf-8?B?SDJGOGs1ajZTcnFWOVQ2TGwrRGxacVZBRmpmdXhRSWU2amFjUXZlcHR6UDdo?=
 =?utf-8?Q?FmP1Tk0yx1r870BREIbgz++Qq?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4ca5d9b0-0ca4-4e0e-67f0-08db8772b69e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 09:38:16.3753
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: MJ0zMkjClZidR5Bvs8uWnPoOqLRDqAO/4JJFbku8bvvdoB30qqzhADBWgkV/EwudCevHUQxAvKq1Iwd59Sk37A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8055

On 18.07.2023 11:35, Andrew Cooper wrote:
> On 18/07/2023 10:19 am, Jan Beulich wrote:
>> On 17.07.2023 18:03, Alejandro Vallejo wrote:
>>> It's set everywhere and can't be turned off because it's presence is
>>> assumed in several parts of the codebase. This is an initial patch towards
>>> adding a more fine-grained CONFIG_HAS_PDX_COMPRESSION that can actually be
>>> disabled on systems that don't typically benefit from it.
>>>
>>> No functional change.
>>>
>>> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
>> On its own I don't think this is okay, as it's unclear whether it would
>> affect RISC-V or PPC in a negative way.
> 
> Neither could compile without layering violations of PDX logic in common
> code, and neither have got that far yet.
> 
> Now is an excellent time to be doing this, because it removes work for
> RISC-V/PPC...
> 
>>  If at all, it should only go in
>> together with the later re-introduction of a CONFIG_*. Still I question
>> whether that new CONFIG_HAS_PDX_COMPRESSION (which imo ought to be
>> CONFIG_PDX_COMPRESSION) then wouldn't better depend on the arch-selected
>> HAS_PDX, such that it wouldn't wrongly be offered to choose a value when
>> compression isn't supported in the first place.
> 
> ... although I do agree that the resulting option shouldn't be user
> selectable.Â  It's a property of the architecture, not something a user
> should be worrying about.

I disagree. Exotic x86 hardware may or may not want supporting, which
can only be determined by the build meister, as long as this is indeed
meant to become a build-time decision (rather than a runtime one; see
my response to the cover letter of this series).

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 09:41:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 09:41:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565067.882929 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLhCg-00086z-QZ; Tue, 18 Jul 2023 09:41:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565067.882929; Tue, 18 Jul 2023 09:41:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLhCg-00086s-NS; Tue, 18 Jul 2023 09:41:10 +0000
Received: by outflank-mailman (input) for mailman id 565067;
 Tue, 18 Jul 2023 09:41:09 +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
 <SRS0=88xE=DE=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qLhCf-00086m-4r
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:41:09 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20629.outbound.protection.outlook.com
 [2a01:111:f400:7d00::629])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 36dc2fe0-254f-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 11:41:05 +0200 (CEST)
Received: from AS8PR04CA0108.eurprd04.prod.outlook.com (2603:10a6:20b:31e::23)
 by DU2PR08MB10278.eurprd08.prod.outlook.com (2603:10a6:10:46e::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 09:41:01 +0000
Received: from AM7EUR03FT028.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:31e:cafe::d) by AS8PR04CA0108.outlook.office365.com
 (2603:10a6:20b:31e::23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33 via Frontend
 Transport; Tue, 18 Jul 2023 09:41:01 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT028.mail.protection.outlook.com (100.127.140.192) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.33 via Frontend Transport; Tue, 18 Jul 2023 09:41:01 +0000
Received: ("Tessian outbound d7adc65d10b4:v145");
 Tue, 18 Jul 2023 09:41:00 +0000
Received: from d981e9ea6945.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 57A75E16-5699-4DD9-88C8-A4A01964C508.1; 
 Tue, 18 Jul 2023 09:40:54 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d981e9ea6945.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 18 Jul 2023 09:40:54 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com (2603:10a6:208:104::24)
 by DBAPR08MB5799.eurprd08.prod.outlook.com (2603:10a6:10:1b2::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Tue, 18 Jul
 2023 09:40:50 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854]) by AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854%3]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 09:40:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 36dc2fe0-254f-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LDTHrnnzxsjF2Hi2xpDRiUukTviJjYC1+sFjJkHuKRE=;
 b=WN5ZNNFuMjb4v22A8ZDR3fXHInAox/Qa39DjpgRobKGaT+oCbigoY63xq82EA7MD2pXm9bbYykuXBEc2ZbeEDqIQeUvhCc7SEras8KOSDvmhOHDrcX+L4Dj9NQdH6c4bFHd7FdVDKKwfJ8gPVBMltijs+S0kS1iwZ1b7dPYE8Io=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 4bfd6b6de167d627
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=B8F+IChycBnYiB277Tl9P7cpDx1fHfOQQTQHFDf+Ih38r1E5SQcePd8gnAr4M68z1lyb+4lnQVP4ZiToaA1VUB6OM1Ziwy97fPtXpLytHAYFgPZNygbmE+fawu41w3C+/pKMFSJy+wsFIZ/XzsOBxKuWwlEOTW6jskRrlPCcHmxPpkTS0k1aSJeJiKuBs8jK4wu0o2oRPdV8XU7zfysCY8HuRxDRufmjo7DJ4UbBryXYUCOopfqHcx0X7oSHHjYWH7l+7QFBfajOmyTI+I8SgeXdepqOZzc9wOJ7NbM6CCfa42konzfLaM+0coDSvHyDPvzJVsTBj8GBhyacdWI+Kw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LDTHrnnzxsjF2Hi2xpDRiUukTviJjYC1+sFjJkHuKRE=;
 b=UAa5XwJGgRIn+oFgZc5WHXum2d5S5abIHhqc17TOp87R3kCYpGO4wIOckR8mTLljMIhfVBonY5mn8LumzzIiCKcIOzdKQMMwwFXR91apljtngKWf+95grRWltaKiWy1FhJiCo4lsWZutRkQ5bZFSq3CJ4u6w5WTm9ux9QDqabrjt7WlD0ZOX7IEeRafgdw2ME9300nUyUfIcE8vuAYtsJ8V5YNz9OlpZxEWCDGCeLB0d2iI2nSZwMzCspE1a4q4WhfT7iuhHnFiTuts6OcCelVo6etccVqxmZSlJs5O4OcEqUvxvHmutDylVfwyFJE/l2DapmUHGxzslqVy2EZz/IQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LDTHrnnzxsjF2Hi2xpDRiUukTviJjYC1+sFjJkHuKRE=;
 b=WN5ZNNFuMjb4v22A8ZDR3fXHInAox/Qa39DjpgRobKGaT+oCbigoY63xq82EA7MD2pXm9bbYykuXBEc2ZbeEDqIQeUvhCc7SEras8KOSDvmhOHDrcX+L4Dj9NQdH6c4bFHd7FdVDKKwfJ8gPVBMltijs+S0kS1iwZ1b7dPYE8Io=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>, Henry Wang
	<Henry.Wang@arm.com>
Subject: Re: [XEN PATCH v10 10/24] xen/arm: ffa: add direct request support
Thread-Topic: [XEN PATCH v10 10/24] xen/arm: ffa: add direct request support
Thread-Index: AQHZuH9YxaQWTIKBm0KO8pMFE2i5Wa+/RtOA
Date: Tue, 18 Jul 2023 09:40:49 +0000
Message-ID: <BA9E08C6-6379-4B21-A254-E68C8E71917A@arm.com>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-11-jens.wiklander@linaro.org>
In-Reply-To: <20230717072107.753304-11-jens.wiklander@linaro.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM0PR08MB3778:EE_|DBAPR08MB5799:EE_|AM7EUR03FT028:EE_|DU2PR08MB10278:EE_
X-MS-Office365-Filtering-Correlation-Id: d6249f28-f608-45bb-9a6c-08db877318f1
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 G4n9SFMGmlmFn5CdQ3FjrdLczIFiNjOgx16pLBAZ/eFHbjuUIVVzM/jZ6zL841OzuvltUQ2MQsjEjw3D2hgIjNNuLnpfvWq9pgJ8E59QyjaWD0rGZdaAxA7ZTO6ZVTzjAsVP90fflajNy0gn06oHDZazkqS5LNXjEywxjbAtE8zXgih3sn+velMQAaDBgZ9p4j8xMB3egaFNg9VrP0Jd5SlgIm8P/WHcwXkp7GRwIhLy655cxS2GZIFhbS7xw3X3PT7tOxdmaMexrqc+XDOm8bAjW5nCH7oRWh6ZkDsNWhOBuVPo9IBu3cC/bbDMRRZ7VsW5NJt7+cgPrTZ24XUQlGOcR7CSMGbtjeHjLlvh5J3BibzbzO3+aRZX1jx3YyJsWZdeSK1JajTWXSev2KZ8IfbXk9KuWLhWJZw/TkPLsEA/Xun7G2CFz2UPDqbSNGYg87W5SiZ2lXxylTcQN+1reUwgm90vmrsebDhzzBw30VFRolMixfWpLjKskeh0RF6aHVKFyD8C0I50FmcOiw364Ygw/rjKZVm+vXZmSTpDmIGEH/C0UDyROEG6BL8fGJ5N0U+74KrzMlAMxy8EGjJUBY5+C3llcxU84TndQtWN8t59P8Fu8uJC8x4eEGQ25lajaSPP0yqbTdWPQAJFJiv7bA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB3778.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(376002)(346002)(39860400002)(136003)(451199021)(66556008)(64756008)(66446008)(66476007)(54906003)(86362001)(186003)(66946007)(76116006)(6916009)(4326008)(91956017)(478600001)(41300700001)(316002)(6512007)(6486002)(71200400001)(38100700002)(8676002)(8936002)(38070700005)(5660300002)(6506007)(83380400001)(36756003)(2616005)(2906002)(122000001)(53546011)(33656002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <6FA0ED457BE30343BFE0DB2CDC3D221A@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5799
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT028.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	30188c16-7ac1-44f7-4bf4-08db877311d1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	/NCIUy/RwQKh/dnAei6ByLZ3VFNrTTXffOHIYh4C3X9BpYVHQ7LwH6cqAEXdR4ywdrnMrAIT3lW7/Iw/lLauy8CTUSFQDAddB1ajSuRWhyUcbG1a0yntUmKF74MqTOfuUHqjajQeU9I+Qw7mDzIEwIn8JKv0ONsfgVnf15oXhNxG2MQMXpQGSeF49DCmATZWKS1Kr8AFD802DtzyqNQ2Y9R4YzN++kVwhRRJnzUdBdDlX5uZRNiYbBVQvVT5NLrrS0iu1ypZ6AqOhGvDteFNVhRIpByfvyF/qYIl94J/ZDEIxuGZ3r8zxQ7h1Wzoyq45eAkgWfj15yqtwJ+SAEY269AAtCrvHMcsaf5a84LByDimA82c8dJ7JWLDlcTvSw++fkir5tWhQ0un9s9CgKLzRBmAEJg5yrNutVaCjoSJhjYxDmVR37DuR/pbithEAN0y88fJX+CRhtG6bqsV+DjL8wMBAPzZ701xPA9sll9qGhbuKFPH/3gIFH3bW+Zux97ct70XXXDFH9jsuqx+/LpXpfvVOTnngNrciu58vAFV76FD6f1ix4/f/p4ph+HDFiOol7au0L+1NVETYxVWoBZKdFqjPfK/AsQHSSlGwQXrFqQmXayLnyCOS+zlqZZAD6hqbF6sr9PRUK3B+SNemoBCUD7jKjN5f5rpalPNwircxm3oLc1K1J4uxfRrWIN17kWkO8HjjVOHhJA+o7q8FIOLNfj+nm0njHONtaHVBivisfCbvQdkLEfR6YuvR9PtwKsh
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(396003)(136003)(39860400002)(451199021)(82310400008)(46966006)(36840700001)(40470700004)(6486002)(54906003)(478600001)(82740400003)(36860700001)(83380400001)(47076005)(2616005)(33656002)(40460700003)(86362001)(40480700001)(70586007)(2906002)(186003)(6506007)(336012)(53546011)(6512007)(26005)(356005)(81166007)(70206006)(6862004)(41300700001)(4326008)(316002)(36756003)(8676002)(8936002)(5660300002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 09:41:01.1751
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d6249f28-f608-45bb-9a6c-08db877318f1
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT028.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB10278

Hi Jens,

> On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> wrot=
e:
>=20
> Adds support for sending a FF-A direct request. Checks that the SP also
> supports handling a 32-bit direct request. 64-bit direct requests are
> not used by the mediator itself so there is not need to check for that.
>=20
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> Reviewed-by: Henry Wang <Henry.Wang@arm.com>
> ---
> xen/arch/arm/tee/ffa.c | 113 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 113 insertions(+)
>=20
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> index e157ed20ad8b..e05d58cf7755 100644
> --- a/xen/arch/arm/tee/ffa.c
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -181,6 +181,56 @@ static bool ffa_get_version(uint32_t *vers)
>     return true;
> }
>=20
> +static int32_t get_ffa_ret_code(const struct arm_smccc_1_2_regs *resp)
> +{
> +    switch ( resp->a0 )
> +    {
> +    case FFA_ERROR:
> +        if ( resp->a2 )
> +            return resp->a2;
> +        else
> +            return FFA_RET_NOT_SUPPORTED;
> +    case FFA_SUCCESS_32:
> +    case FFA_SUCCESS_64:
> +        return FFA_RET_OK;
> +    default:
> +        return FFA_RET_NOT_SUPPORTED;
> +    }
> +}
> +
> +static int32_t ffa_simple_call(uint32_t fid, register_t a1, register_t a=
2,
> +                               register_t a3, register_t a4)
> +{
> +    const struct arm_smccc_1_2_regs arg =3D {
> +        .a0 =3D fid,
> +        .a1 =3D a1,
> +        .a2 =3D a2,
> +        .a3 =3D a3,
> +        .a4 =3D a4,
> +    };
> +    struct arm_smccc_1_2_regs resp;
> +
> +    arm_smccc_1_2_smc(&arg, &resp);
> +
> +    return get_ffa_ret_code(&resp);
> +}
> +
> +static int32_t ffa_features(uint32_t id)
> +{
> +    return ffa_simple_call(FFA_FEATURES, id, 0, 0, 0);
> +}
> +
> +static bool check_mandatory_feature(uint32_t id)
> +{
> +    int32_t ret =3D ffa_features(id);
> +
> +    if ( ret )
> +        printk(XENLOG_ERR "ffa: mandatory feature id %#x missing: error =
%d\n",
> +               id, ret);
> +
> +    return !ret;
> +}
> +
> static uint16_t get_vm_id(const struct domain *d)
> {
>     /* +1 since 0 is reserved for the hypervisor in FF-A */
> @@ -222,6 +272,57 @@ static void handle_version(struct cpu_user_regs *reg=
s)
>     set_regs(regs, vers, 0, 0, 0, 0, 0, 0, 0);
> }
>=20
> +static void handle_msg_send_direct_req(struct cpu_user_regs *regs, uint3=
2_t fid)
> +{
> +    struct arm_smccc_1_2_regs arg =3D { .a0 =3D fid, };
> +    struct arm_smccc_1_2_regs resp =3D { };
> +    struct domain *d =3D current->domain;
> +    uint32_t src_dst;
> +    uint64_t mask;
> +
> +    if ( smccc_is_conv_64(fid) )
> +        mask =3D GENMASK_ULL(63, 0);
> +    else
> +        mask =3D GENMASK_ULL(31, 0);
> +
> +    src_dst =3D get_user_reg(regs, 1);
> +    if ( (src_dst >> 16) !=3D get_vm_id(d) )
> +    {
> +        resp.a0 =3D FFA_ERROR;
> +        resp.a2 =3D FFA_RET_INVALID_PARAMETERS;
> +        goto out;
> +    }
> +
> +    arg.a1 =3D src_dst;
> +    arg.a2 =3D get_user_reg(regs, 2) & mask;
> +    arg.a3 =3D get_user_reg(regs, 3) & mask;
> +    arg.a4 =3D get_user_reg(regs, 4) & mask;
> +    arg.a5 =3D get_user_reg(regs, 5) & mask;
> +    arg.a6 =3D get_user_reg(regs, 6) & mask;
> +    arg.a7 =3D get_user_reg(regs, 7) & mask;
> +
> +    arm_smccc_1_2_smc(&arg, &resp);
> +    switch ( resp.a0 )
> +    {
> +    case FFA_ERROR:
> +    case FFA_SUCCESS_32:
> +    case FFA_SUCCESS_64:
> +    case FFA_MSG_SEND_DIRECT_RESP_32:
> +    case FFA_MSG_SEND_DIRECT_RESP_64:
> +        break;
> +    default:
> +        /* Bad fid, report back. */
> +        memset(&arg, 0, sizeof(arg));
> +        arg.a0 =3D FFA_ERROR;
> +        arg.a1 =3D src_dst;
> +        arg.a2 =3D FFA_RET_ABORTED;

Those instructions setting arg have no consequence as arg is not used
after. This is probably a left over from the previous loop.

You can either send this back using arm_smcc but I would rather return
a proper error back to the caller by setting properly resp regs.

What do you think ?

Regards
Bertrand


> +    }
> +
> +out:
> +    set_regs(regs, resp.a0, resp.a1 & mask, resp.a2 & mask, resp.a3 & ma=
sk,
> +             resp.a4 & mask, resp.a5 & mask, resp.a6 & mask, resp.a7 & m=
ask);
> +}
> +
> static bool ffa_handle_call(struct cpu_user_regs *regs)
> {
>     uint32_t fid =3D get_user_reg(regs, 0);
> @@ -239,6 +340,10 @@ static bool ffa_handle_call(struct cpu_user_regs *re=
gs)
>     case FFA_ID_GET:
>         set_regs_success(regs, get_vm_id(d), 0);
>         return true;
> +    case FFA_MSG_SEND_DIRECT_REQ_32:
> +    case FFA_MSG_SEND_DIRECT_REQ_64:
> +        handle_msg_send_direct_req(regs, fid);
> +        return true;
>=20
>     default:
>         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
> @@ -331,6 +436,14 @@ static bool ffa_probe(void)
>     printk(XENLOG_INFO "ARM FF-A Firmware version %u.%u\n",
>            major_vers, minor_vers);
>=20
> +    /*
> +     * At the moment domains must support the same features used by Xen.
> +     * TODO: Rework the code to allow domain to use a subset of the
> +     * features supported.
> +     */
> +    if ( !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
> +        return false;
> +
>     ffa_version =3D vers;
>=20
>     return true;
> --=20
> 2.34.1
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 09:43:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 09:43:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565072.882939 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLhEg-0000IW-9V; Tue, 18 Jul 2023 09:43:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565072.882939; Tue, 18 Jul 2023 09:43:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLhEg-0000IL-6r; Tue, 18 Jul 2023 09:43:14 +0000
Received: by outflank-mailman (input) for mailman id 565072;
 Tue, 18 Jul 2023 09:43:13 +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
 <SRS0=88xE=DE=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qLhEf-0000ID-4F
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:43:13 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on062e.outbound.protection.outlook.com
 [2a01:111:f400:fe02::62e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 817903b6-254f-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 11:43:10 +0200 (CEST)
Received: from AM0PR02CA0176.eurprd02.prod.outlook.com (2603:10a6:20b:28e::13)
 by DB9PR08MB10377.eurprd08.prod.outlook.com (2603:10a6:10:3db::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 09:43:01 +0000
Received: from AM7EUR03FT032.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:28e:cafe::96) by AM0PR02CA0176.outlook.office365.com
 (2603:10a6:20b:28e::13) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33 via Frontend
 Transport; Tue, 18 Jul 2023 09:43:01 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT032.mail.protection.outlook.com (100.127.140.65) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.33 via Frontend Transport; Tue, 18 Jul 2023 09:43:00 +0000
Received: ("Tessian outbound f1e964b3a9be:v145");
 Tue, 18 Jul 2023 09:43:00 +0000
Received: from 3dac995c2375.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 A992C3C5-4A2B-402C-939F-BEE0C7CA04E9.1; 
 Tue, 18 Jul 2023 09:42:54 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3dac995c2375.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 18 Jul 2023 09:42:54 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com (2603:10a6:208:104::24)
 by DU0PR08MB9655.eurprd08.prod.outlook.com (2603:10a6:10:447::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 09:42:52 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854]) by AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854%3]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 09:42:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 817903b6-254f-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=PLo76JlBiMGN9yQ+IcEoC33k5ozWBw0p6kk6mDt+Eq4=;
 b=0EIv0szEsb+uw3O+c4WQlBEfcoE/NaqmYEJEJiLvgGunlrpMomdRoo672owVhBI3JhszEOWwvuGgD1DNN8hTgAflsi0QEHOGYxqT3yBCEN09tQescdehPtmjR1miC+MkSRy/YIOdbxuTcCg7Grw2RNsQ3CIOFN9b24k87+1QSwI=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: a658ff11987a8c97
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hrSZl37Stoqux/s6FVzYr168ujGIeMfW+eye8Xgj5/KFyDfAbgGtxjbBwL/LupQH1R2IQO7HPfYRJEAwW46IG3GZJoNFJX1pwKEJqPZd9LHa2i/4qB7jSPg1yY8B1ZRibzOZVhNIzi4G4V4tTmjiqcXxDgC6srwaPnnsEzZzv6bMh/gjWxpSdSw/18WMOIxE3W5ZxbgWLt9V0D+rtI32RXEYDBzug2NZPfdqXvZDrTFF4Ks+E3jEU+YNGUAgIOaQDaccGd6kzySdxs8sh5MrMQCSNM5xBKetZCaHG0XIvnR8YKq06VHCux32zb+N9NYY0k6KQoBp9kyl3kOHMsSUCw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=PLo76JlBiMGN9yQ+IcEoC33k5ozWBw0p6kk6mDt+Eq4=;
 b=h4jDYcSJdSENT6OP+Kp6GFQb/SI21BVcX4Ki4UTvPYrW9HO8NTpK5LspGso+FyVCqYDItl7hwthGsYhq4r3lN4Jtfy1Dj1q/kznJvVBupwuLkP5JZ8PKK6rTjQ77WYbgEI/lbf2J/f5j3dhfVfBRVvzpo0F++myNbC7qhbKG4RYJHbepFLEffRodTwaedHY//AWv1diK837QQBjEOAXx2BY2afetTLT9r+EOo/2gXRCk5sope48h6fUpk1suRqTgk5umDa6NJ/9MSHcM8BkpCehMxl5KnwCa4Zf1Lu0kNnyQ7pyIJW6h8sLtuBKVDzJFVRKkDu9xIJqslG+DcJeJ1Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=PLo76JlBiMGN9yQ+IcEoC33k5ozWBw0p6kk6mDt+Eq4=;
 b=0EIv0szEsb+uw3O+c4WQlBEfcoE/NaqmYEJEJiLvgGunlrpMomdRoo672owVhBI3JhszEOWwvuGgD1DNN8hTgAflsi0QEHOGYxqT3yBCEN09tQescdehPtmjR1miC+MkSRy/YIOdbxuTcCg7Grw2RNsQ3CIOFN9b24k87+1QSwI=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>
Subject: Re: [XEN PATCH v10 11/24] xen/arm: ffa: map SPMC rx/tx buffers
Thread-Topic: [XEN PATCH v10 11/24] xen/arm: ffa: map SPMC rx/tx buffers
Thread-Index: AQHZuH9VJ4u8cEY7e0yX7WDachuwCa+/R2WA
Date: Tue, 18 Jul 2023 09:42:52 +0000
Message-ID: <8EC95462-76E9-48AA-B784-92DC52309240@arm.com>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-12-jens.wiklander@linaro.org>
In-Reply-To: <20230717072107.753304-12-jens.wiklander@linaro.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM0PR08MB3778:EE_|DU0PR08MB9655:EE_|AM7EUR03FT032:EE_|DB9PR08MB10377:EE_
X-MS-Office365-Filtering-Correlation-Id: aad3d7d5-8c72-449a-1c08-08db8773603d
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 L44EtRD4pDb+C+6PK5gT8TZiXu+N3l23rAXFvApkPCZV0OEebYgjlDv51iBuIra+9UEP4fD5CXAPfQHo9p6Rhh8uHdNRAOax2FKVVuOwm30ymXpTZ6fU4dtE9jHolXXV2kqzeQ/IJHrlUJ1+TcvTIh41r1mfgJnNE1aqqkHcThQW2BSUywDw3R97pzVns4cDVzEA3HEdN04MpApADp/VtHFy0ZgcOIy6GRMRrlVdb98JvBz1+o+p1+eVhUftEYHn2SIiGs6F45vt2GB8uS3Cp2lhheSt+Mo+nRkshpDeBYGvFb5crFaMXMbF6E0GS9HECAS/dEGVh4/n761V+1bxBvCMUjhzbonq2dhzj7vTIXDE55Xta6qPQEMQZUc7PxREszNUmocMvBbajwsuYK20tq0V2BT7c5DLyz3WSqGtPQWam4La21aThdK/jb5zoNLXAqMvIG6ZnCNLhQEFNGh6QN03derj7Z8u6b8UPbeisidboFEUNBuPztOtqUXkpIq/hqDJrfq2iYtagse9lb7gls5bwf49vma29UZz1xN1BEH/L6rnvD3+4nL1Rg6rGAcE/r4zqPsOiUo0/a7kWfxgNezzh66DqRh78gQ8Ro75VJVx02ruvJGUpjKSMKYzJYlS37t3HpJXSLE+kduiIFvXhQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB3778.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(136003)(366004)(39860400002)(396003)(451199021)(478600001)(71200400001)(6486002)(91956017)(66556008)(54906003)(83380400001)(38070700005)(86362001)(33656002)(76116006)(2906002)(53546011)(186003)(36756003)(6506007)(2616005)(316002)(6512007)(122000001)(38100700002)(64756008)(6916009)(66446008)(66946007)(66476007)(41300700001)(4326008)(8676002)(8936002)(5660300002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <A251DF7A7AF63D4383D4CBA761A5D6F8@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9655
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT032.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	b2dafdee-209e-4aed-bce2-08db87735b0f
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	GK54cJ2hZv/62vMvKJHBVzymQJsPYAsT8uxhVEho07rG+tR7ZVD9xhrEUf5j9vuUDW6A5/f8MCXPSHaDBRkV/SlJCxS/S3Aw5jSMeXAReFegilrN5Y+aKpYkX5DS22sY5X4yCJAZK0UujsbG9QjXmPsBpTwZfZg59v1t81cgRLQRpd8GHRJ36VVzJkjo+3prPLhXvDRlZBTxAxWK8fbyD4Vt0DDfrlFSLh071IrnEfxztEOwX691m0DZMYXMNJZhYMybaiRe8s2zznGD42pKcwDuvkKjYQuNTp1JfIETGfjJa/ftMqhdl4lwdSTTy0OMbtuHNw9EAXY8JMFxbBkMsaALWOg22Y+jJm2cTaWUQ28ke8/W2xzh7+cr3i1agGaVYvFyxhzf+oNW/iQFCaClXHNWuVnCPttays3gpDzwetnhaZADzzJ8tG2T2muMXZiQp4mt11KJH9ak20JNUz8EkjaUk6eH3pf9So/4w0u98KH1ERRmFyCmAjjw5wx7zmSV1jq8Dc8JLE88wlGJiBakJPYeaYuefZmtFsVbJLukG8b+b8fRIxmcWvU6ypvkaWctn1BNmhJFetudok+7Cd8BgSgdtylYMWe2W0Zm9VJu7fF444vdwMCxKScjDlcUsm3Ks7wedHjmh1KNXJ4jIxgCi5lFr2bs5iKLTuSOMuzeTYc+lcdGSLX+MpmaWdoMwGOtKYM6OwrtjPxaLeWFvLta6NcR4szD1/Q4IRt2J9/C0xRGc8GusTCVypJ9PT/X8Kil
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(136003)(376002)(396003)(451199021)(82310400008)(46966006)(40470700004)(36840700001)(36860700001)(41300700001)(316002)(83380400001)(53546011)(336012)(186003)(6512007)(2616005)(26005)(47076005)(6506007)(356005)(40460700003)(6486002)(478600001)(81166007)(82740400003)(54906003)(4326008)(70206006)(70586007)(40480700001)(86362001)(33656002)(5660300002)(6862004)(8676002)(36756003)(2906002)(8936002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 09:43:00.8038
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: aad3d7d5-8c72-449a-1c08-08db8773603d
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT032.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB10377

Hi Jens,

> On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> wrot=
e:
>=20
> When initializing the FF-A mediator map the RX and TX buffers shared with
> the SPMC.
>=20
> These buffer are later used to to transmit data that cannot be passed in
> registers only.
>=20
> Adds a check that the SP supports the needed FF-A features
> FFA_RXTX_MAP_64 and FFA_RXTX_UNMAP.
>=20
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> xen/arch/arm/tee/ffa.c | 50 +++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 49 insertions(+), 1 deletion(-)
>=20
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> index e05d58cf7755..f8ccaabc568d 100644
> --- a/xen/arch/arm/tee/ffa.c
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -12,6 +12,7 @@
> #include <xen/errno.h>
> #include <xen/init.h>
> #include <xen/lib.h>
> +#include <xen/mm.h>
> #include <xen/sched.h>
> #include <xen/sizes.h>
> #include <xen/types.h>
> @@ -67,6 +68,12 @@
>  */
> #define FFA_PAGE_SIZE                   SZ_4K
>=20
> +/*
> + * The number of pages used for each of the RX and TX buffers shared wit=
h
> + * the SPMC.
> + */
> +#define FFA_RXTX_PAGE_COUNT             1
> +
> /*
>  * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
>  * BIT(31): Framework or partition message
> @@ -161,6 +168,13 @@ struct ffa_ctx {
> /* Negotiated FF-A version to use with the SPMC */
> static uint32_t __ro_after_init ffa_version;
>=20
> +/*
> + * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
> + * number of pages used in each of these buffers.
> + */
> +static void *ffa_rx __read_mostly;
> +static void *ffa_tx __read_mostly;
> +
> static bool ffa_get_version(uint32_t *vers)
> {
>     const struct arm_smccc_1_2_regs arg =3D {
> @@ -231,6 +245,12 @@ static bool check_mandatory_feature(uint32_t id)
>     return !ret;
> }
>=20
> +static int32_t ffa_rxtx_map(paddr_t tx_addr, paddr_t rx_addr,
> +                            uint32_t page_count)
> +{
> +    return ffa_simple_call(FFA_RXTX_MAP_64, tx_addr, rx_addr, page_count=
, 0);
> +}
> +
> static uint16_t get_vm_id(const struct domain *d)
> {
>     /* +1 since 0 is reserved for the hypervisor in FF-A */
> @@ -394,6 +414,7 @@ static int ffa_relinquish_resources(struct domain *d)
> static bool ffa_probe(void)
> {
>     uint32_t vers;
> +    int e;
>     unsigned int major_vers;
>     unsigned int minor_vers;
>=20
> @@ -441,12 +462,39 @@ static bool ffa_probe(void)
>      * TODO: Rework the code to allow domain to use a subset of the
>      * features supported.
>      */
> -    if ( !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
> +    if (
> +         !check_mandatory_feature(FFA_RXTX_MAP_64) ||
> +         !check_mandatory_feature(FFA_RXTX_UNMAP) ||
> +         !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
> +        return false;
> +
> +    ffa_rx =3D alloc_xenheap_pages(get_order_from_pages(FFA_RXTX_PAGE_CO=
UNT), 0);
> +    if ( !ffa_rx )
>         return false;
>=20
> +    ffa_tx =3D alloc_xenheap_pages(get_order_from_pages(FFA_RXTX_PAGE_CO=
UNT), 0);
> +    if ( !ffa_tx )
> +        goto err_free_ffa_rx;
> +
> +    e =3D ffa_rxtx_map(__pa(ffa_tx), __pa(ffa_rx), FFA_RXTX_PAGE_COUNT);
> +    if ( e )
> +    {
> +        printk(XENLOG_ERR "ffa: Failed to map rxtx: error %d\n", e);
> +        goto err_free_ffa_tx;
> +    }
>     ffa_version =3D vers;
>=20
>     return true;
> +
> +err_free_ffa_tx:
> +    free_xenheap_pages(ffa_tx, 0);
> +    ffa_tx =3D NULL;
> +err_free_ffa_rx:
> +    free_xenheap_pages(ffa_rx, 0);
> +    ffa_rx =3D NULL;
> +    ffa_version =3D 0;
> +
> +    return false;
> }
>=20
> static const struct tee_mediator_ops ffa_ops =3D
> --=20
> 2.34.1
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 09:43:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 09:43:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565074.882948 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLhFD-0000mD-Hh; Tue, 18 Jul 2023 09:43:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565074.882948; Tue, 18 Jul 2023 09:43:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLhFD-0000m6-F0; Tue, 18 Jul 2023 09:43:47 +0000
Received: by outflank-mailman (input) for mailman id 565074;
 Tue, 18 Jul 2023 09:43:45 +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 <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLhFB-0000kb-Me
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:43:45 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20631.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::631])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9514c759-254f-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 11:43:43 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB8055.eurprd04.prod.outlook.com (2603:10a6:20b:2a4::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 09:43:41 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 09:43:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9514c759-254f-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Zyt9m3FLMEqr/8WBvX9uqde/JDz5r0yL+k8PG0ajTnXqHsWODELj2urDvzo8ca5b6uZ+LRR8CCsMKkbVgZJM3luaLiJzCM7Wz6bx+7+rAxgIKOILRkxgAEKZ3kK5t+WfuTQZWJlIoSIaccq8un5D+6KnPQkVJ52skNM23+vtyznvRu+ksbz9PcoxZ7e4umPi5V50vJ0riDU+vqplOz0kKwwMwR/69wZ/PXmYlG6welvD5t9cliMb/Og/dbkF3havoRgGbSU+05XmZ/tJM5SSFbxdKpjzRgNZ8qVa7m4m1mXpW25x77M1ey9efZlyKTOHbdu7GBQpEEkHafqU7UsR+g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=qWUctEVPj/d7E/ZshGeF44eB425yKRCLn5zMjV0kx3s=;
 b=bcW9EM5v5J0Q4u0RAOezRpSvEdM5gEXtSBEgTMyyb9LySLUAU1EU6PiiGO//Z+wLvIYS/FC8ZZOsKYUW8GA/hPgCoJjNvIjqdPJWjkkDxY9AUKeDPyZMaiAn+U/5hHxQR9eGUv3lKPE2LmbcMP0j+tZyLc6DzAbR4xK3TtZU76W5A4XpjA4UAH49AMvGXQ3jHoiyAlH9/TcZ74fUDYIxPf+gcN6i4FBr+CalUFyOfraihsDYGJ6eUGWsSrzMx54d9oBqnQgY1Em5bL+8YMAy8h9nzeJrCZ6lr7oJrkzQVqxGwJXDvnA0hV7BJlCzmpCYD3MLKYe7QkLWQhkgKcihmg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=qWUctEVPj/d7E/ZshGeF44eB425yKRCLn5zMjV0kx3s=;
 b=vxa0p+xmIfAz8by0pxvmAoyCPXz5yIdDbPCNeBYSkkOu+8031eo2W2cOkMZXtJ6Nelh51DaxhnSsHGM01tK2g7NCJXwUjG0HTmzldEAppdBbboCMyvdothPoHmhb4mtj//R2yHrPSUeJw1mwglhIRqlwkEBcK3mfE3MmGKrVwbQDlKBsUxFIEcpYBANSr56ss5v6Ga2Ving+zUOQe8OyB1PFtK9vwwIsoVdP34fFkAnhKFikwpVOYpeb0/4Z2vCrtohSudkVGvz2dCK4hO0Xg4CgzFaXgDAq1eDuBNPceYO+vv52sczZbgRq0+noL8lcKOg29qd7O398oliRJo5gog==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <040fef3e-9a7f-61bc-13f5-c34f6ffdcb09@suse.com>
Date: Tue, 18 Jul 2023 11:43:39 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: Experiments with clang-format and exclude-list.json
Content-Language: en-US
To: Luca Fancellu <Luca.Fancellu@arm.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <505E6BDD-823F-4337-8FB9-C3294D180E74@arm.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <505E6BDD-823F-4337-8FB9-C3294D180E74@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0102.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9c::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB8055:EE_
X-MS-Office365-Filtering-Correlation-Id: 98192755-e85d-435f-76b3-08db87737826
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	O9qnw8FAEGybstvrcv8aOlTtGamEw1u5OUfLGsi5wSODEEfI7jb0D4pF3SY8yuFyQY7mzNUrOsnAsiIUujJxTPq1LBKSpvLLuqgamEMJMlgBjEvvrsClRyIsXR8CciBvn6r35Me+O/S+R+oQ1LPn+rCrp+DYxJA7szl5fYmaRjaDdt+NYdgg1yFWRPb4NyPXmmaeQCJTJB425wN5xZmXXmxFUGnAzuNYMWs5ljxRc4V3B0R/OXIuc8iHJ0Uz7unrSY260qejE4iC353MXI1YENe0fCRua+xeTjnowiErs0Oi2FTmNqCCMVB2TrkG91CnsdFHJaJq0R+3gqICl587D7XG1l4HlLHaAiQhVYGHh6JSAuve554zShk4SQHGu7BoM7TROtHiFX76LZEWMZg/1EARpLyogmBWpiv8uOg8GKt8fW920M7SueRVpSCn8BKWGE23ayj8gjNeKKs/Eyh1XYL7L/L1Hac53l7f9QO4b+chE2BFmbf8c2bQLrF70L4x//jDwtFtYbLH3/mwV67kXKmrTxktal4XtkRQeKP9k2hwuhAQxSpGUyDSxl7llY2icSOU583lc/qFj8zMUpojRPjMYLCmbq+b+kHxNUZGQIHZ/IzJ8ogOcIPxq11QBs4Wpx1sTyxNJSGjHIYX2KpO1A==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(396003)(39860400002)(376002)(136003)(451199021)(478600001)(5660300002)(66556008)(66946007)(66476007)(54906003)(4326008)(316002)(6916009)(8936002)(2906002)(8676002)(41300700001)(31686004)(66899021)(6512007)(26005)(53546011)(6486002)(6506007)(38100700002)(186003)(2616005)(83380400001)(36756003)(31696002)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-Anti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T?=
 =?utf-8?B?ek1Dek5MVFEyUGltOS8wYUhqSk5HNmJmT2QzOVkvNTBKci8rM1lZT0d2ejNa?=
 =?utf-8?B?UWFQSVNsRTFKUy9FRzU2ZlhWRHkrS0VGWlhCSWsvSS9tc2p5c21GQ1hBeUU2?=
 =?utf-8?B?RGtjNmtrVHZTT0EvMnVkQVBIUlVTSnFIeGgyaW1ER1hLekRFNTB1ODdZdS9r?=
 =?utf-8?B?aTNwT3c1WUpZbmRUY0Vtc2ZPamxSMExTMXlicE5nRm4raTVBWndSS25NMUVj?=
 =?utf-8?B?S2lxaFpVUUZwVDMrSDQ4TjNaRE0rd1orNkhCdmU4VVhPNDlOV21tbXNZR2t4?=
 =?utf-8?B?L3Z4WDJobkFtM3p4M2g1dnlySHNmT1grRE1mSitWNnNMUWRjZjBGQTNJKzJ6?=
 =?utf-8?B?Zmh4UjhSKzlBbW5OSjkvZy9aUjUxZGw1WWc4SHRpYThJZEpsQ3dtYmp1MUpC?=
 =?utf-8?Q?0T4UhpRrZc1JXt2RLjmossrK1?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 98192755-e85d-435f-76b3-08db87737826
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 09:43:41.0765
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: yNDPPxRQQOfAoGzlzO1Xy1sGPfSm/jMMuTm4gJ22fiSeU6YjH3Mwug5Qa0lUbCaHouC3zLkTQnAxfulxec2fVA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8055

On 18.07.2023 11:13, Luca Fancellu wrote:
> Iâ€™ve done some experiment with clang-format and the hypervisor code (xen/xen/**), I had the need to exclude some files from the tool
> and I thought to use the exclude-list.json, but since it was intended for MISRA, Iâ€™m now asking your feedback about that.
> 
> In my opinion it could make sense, because with that list we are excluding everything that is external and not adopting the Xen
> coding style.
> 
> Do you have an opinion on that? Can it be one file? Or should it be a separate file only for the coding style exclusion?

It feels like back when the file was introduced I already commented on
the potential for it to be multi-use, so long as it's actually dealing
with the slightly separate needs. IOW I think it can be one file, but
it needs to allow for files that want excluding from rule checkers, but
not from style ones, and vice versa. Whether specific "comment" wording
would be suitable, or whether instead separate attributes would want
introducing is TBD.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 10:05:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 10:05:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565081.882959 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLhaA-0003ig-8O; Tue, 18 Jul 2023 10:05:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565081.882959; Tue, 18 Jul 2023 10:05:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLhaA-0003iZ-5Y; Tue, 18 Jul 2023 10:05:26 +0000
Received: by outflank-mailman (input) for mailman id 565081;
 Tue, 18 Jul 2023 10:05:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=88xE=DE=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qLha8-0003iT-9Z
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 10:05:24 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on062f.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9bf1ed44-2552-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 12:05:23 +0200 (CEST)
Received: from DUZPR01CA0125.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4bc::17) by AM0PR08MB5313.eurprd08.prod.outlook.com
 (2603:10a6:208:17f::21) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Tue, 18 Jul
 2023 10:05:19 +0000
Received: from DBAEUR03FT032.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4bc:cafe::f5) by DUZPR01CA0125.outlook.office365.com
 (2603:10a6:10:4bc::17) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33 via Frontend
 Transport; Tue, 18 Jul 2023 10:05:19 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT032.mail.protection.outlook.com (100.127.142.185) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.33 via Frontend Transport; Tue, 18 Jul 2023 10:05:19 +0000
Received: ("Tessian outbound f5de790fcf89:v145");
 Tue, 18 Jul 2023 10:05:19 +0000
Received: from 418430abdbd7.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 1FD4F538-6F1C-4D65-B530-731997A7C40D.1; 
 Tue, 18 Jul 2023 10:05:07 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 418430abdbd7.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 18 Jul 2023 10:05:07 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com (2603:10a6:208:104::24)
 by DB9PR08MB6362.eurprd08.prod.outlook.com (2603:10a6:10:25a::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 10:05:04 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854]) by AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854%3]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 10:05:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9bf1ed44-2552-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=k2sn6TXjX9SVIBOnlPuFS5o7VszCt87+7nyoNk+Yv+s=;
 b=dDicXCBSbReJrVEsDiI5gY1p3mjkZCLfinvjM8KoaUiEnyJZ5yPmSRaf4Z0ZJ6jwB5Jp1WBUXswEOlGYkHMqgyhXqXcFhpN6mcZSl/VAdKbwPn2kQA/84OdgT+ifcNATK7ErZiGEGBebnbZtkQJhVq8uRdow2rkfMNW+ORTnCCE=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 88d75ca8eba2c4c4
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Xr9olOqE/ssS6pxwYCFW7CQEDjhoiv/LCK87bcNS7ZhrPZSUyHf8ZbjEcPTxuUMeU5t8wITXyt0dFtl8Q54Eq4YyZA6um/HsrvSreCzxqPl3MIPTDSpiPUn2vbkolfLoBKDLrEmRr4gjSW/bsxGaGJV52rnEIZk73OYIItDjaX8+k7Le0yc1ttoI+L41jDcvrco5K53Q9wPd6cFIJS9GRmPueRKS/70fPRU1uTqaBWIxW5QQIaqjGqmGytmlY2Ek7xlNYzZxnpZJUTgqeGXXuy4NsW5HggTzXz1K5834Hx/Yo3bIwfjibPGXkszgTdL7xPxGU9CaH3G1fw24TIMnvA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=k2sn6TXjX9SVIBOnlPuFS5o7VszCt87+7nyoNk+Yv+s=;
 b=A707MwBo7m0WSx3wDVqEzgGIvnrig7Is3qUOWmWV8fI4r8c8JeVfgcyTbFqqbMGbn4FFx2t88Ugz/9XqX6AQQ1jOf2o5ZtkWx6eUq1QOVzrb1MJ3KfC9OuqC5ygYjubSADduViXOgd7949W7o2V8NNeXoDXBIAayQnWA35GGAY++VemqH06QgwNW0lLcFP8bWvlSaHNOVOnLo0Sa868SBgPx2Jmbi6T9mczJBl6QflEla/oHEzIsvzKsYehLOZzUNer89wNavxbomKLH1GVTunN22GvKtvR877r2nh2llPMEzNie8gKu3N6SAFaEmFMGVOVBBIDV+2QRczkK5iMjhQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=k2sn6TXjX9SVIBOnlPuFS5o7VszCt87+7nyoNk+Yv+s=;
 b=dDicXCBSbReJrVEsDiI5gY1p3mjkZCLfinvjM8KoaUiEnyJZ5yPmSRaf4Z0ZJ6jwB5Jp1WBUXswEOlGYkHMqgyhXqXcFhpN6mcZSl/VAdKbwPn2kQA/84OdgT+ifcNATK7ErZiGEGBebnbZtkQJhVq8uRdow2rkfMNW+ORTnCCE=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>
Subject: Re: [XEN PATCH v10 12/24] xen/arm: ffa: send guest events to Secure
 Partitions
Thread-Topic: [XEN PATCH v10 12/24] xen/arm: ffa: send guest events to Secure
 Partitions
Thread-Index: AQHZuH9Y3GtzhbsKLUy5Uqxsc0bAdq+/TZoA
Date: Tue, 18 Jul 2023 10:05:04 +0000
Message-ID: <98D9585F-AE4B-4AC2-9D3B-BAF5590C0DD7@arm.com>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-13-jens.wiklander@linaro.org>
In-Reply-To: <20230717072107.753304-13-jens.wiklander@linaro.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM0PR08MB3778:EE_|DB9PR08MB6362:EE_|DBAEUR03FT032:EE_|AM0PR08MB5313:EE_
X-MS-Office365-Filtering-Correlation-Id: fc6aacc5-9dd2-40ec-bd9d-08db87767de7
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 F9AK7VF/a4CpDLGjjeQmzrf3Qa3TFy+jXmnY4tv0JWKLYyhUGQDjpOSTQQy4gZzxAc/Y/QD9ypX2D6+O4Orh7ih6AIr5Vcyj0v9b/fqcNnODzCdE6Cx0OagYTiavZRsUaxHVeLv9yXn8EnkygVPDfj9/1jmWpr36Sw0mScu9anRa1BKGaQi/N9dgrH6VF0cpB3j0s0fF27KLY52VuQcWv3OQSgwdaQfCodPW0ezKt8675R1uhC79w+wAj5pdyuntqkA2sQZyk4AOP4qJKdVAuqER/UjM/nJxn3Pe6uOoHNMrtUrwti+/ZkMGat+6tJe6aNzFp39plM8a61pPNjuSDtjXf9vKQfS9zfFH7FY+LNB+mNOSTE5nG4mZ5P+PQHY7fETb6Vjtrb9ag/Yv326pE4SuFrncVj/DToI91NTrv88+Re3Ql676j3bOQuwN/UofCkj2rMN4BqwCv5af0yJVvPqf0ExcGQOQFf8xzTT86QRCJZmlbJtSb/fa5ouLZOYE9qbAGrphuCTrf2i2zSI9Wgqin6LB4ELJg/zZXGzbXN4ytzXD2IMwcZrvVci5rZB18aK6inWbvYs1xzB6DRw08++kR7j0qzlIbLwPOlmII6QxYkir1Sopm0JP3mzpXGP5q6qX8IuxcuC6rZSgYwBYng==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB3778.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(39860400002)(396003)(366004)(346002)(451199021)(6486002)(53546011)(6506007)(6512007)(36756003)(122000001)(2616005)(83380400001)(38070700005)(86362001)(38100700002)(33656002)(186003)(8936002)(8676002)(41300700001)(2906002)(478600001)(91956017)(5660300002)(64756008)(4326008)(76116006)(316002)(6916009)(66446008)(66476007)(66946007)(66556008)(54906003)(66899021)(71200400001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <485E34A84464A54AB05065362EBB865B@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6362
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT032.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	381f4a32-0d91-4f4c-a668-08db87767543
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	8YKc2Wb/bBYml/ishGs+sVTlba0W23VPh76GNQQbWRuxKZUJaBJhtEphkH7xH+pZ32xWW78Edch7sp0tcqsNABZBuqma2b38cSO8vP9OHKTm/7Rzz1io45+h1nOJ4VJhLd/TPvWHy1G5lBbfTUJPyx9xKZ92i/B7SuR3c8l9ioiJI3m8CpA8JPFixPjDb7DoUUdKd5XJ2G3CI1IjBRyKZkHXKdLOIDlAf/FBapHjGfGZNlHFy4hAdbp+I7PlCB8K1U5RN1s0j6zTqFHpxVJC9sMAhqZziUwBhprv8PXbRe+I7TJ694u8woUFGo4QswO7pvSeq2Es0CW7ciJNymn0Yxcrqq/HC3Epq0cU2uuIhJk2Rps8tyOORKeX6WduW+EXc1rAIUz7sF4P3PNajfhigB4tXHUkhBCGNhTKEElZ/FryT0CU5creRjwt7ncBX707yDDS+ylGxN4vVgdj87T61AMpbRI08iynOIZWTv8PaqrAurhwYKGvf9k1QxKHfCvPpdK3Pu7oE1aT4agoj2A34PvdrRY6MUNcLqqZxBXZt4mVTXDeKCU5om+QQkVsSk9zm6MEJtNeNtFWJnaNviCH7IDjwCH4/OeoLbxnSMVnm1p6/dKbAWEt4LIE6/+JEBw3Vre0hwKfPZ9jvRjncvdYhQGUeI3n8N196gwGn3ISTBH/ezcl44Mir/TOExJIskc+S61eSihstBIH9ilMPTFQwoph+WBIyTOKeGLAlVSQ2/XQ3lnNQHf8xVMcVRewONAE
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(39860400002)(376002)(136003)(82310400008)(451199021)(46966006)(40470700004)(36840700001)(66899021)(478600001)(6486002)(54906003)(83380400001)(336012)(2616005)(47076005)(40460700003)(36756003)(86362001)(33656002)(36860700001)(40480700001)(356005)(186003)(2906002)(26005)(6506007)(53546011)(107886003)(6512007)(316002)(6862004)(81166007)(70206006)(70586007)(4326008)(41300700001)(8936002)(8676002)(82740400003)(5660300002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 10:05:19.1130
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: fc6aacc5-9dd2-40ec-bd9d-08db87767de7
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT032.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5313

Hi Jens,

> On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> wrot=
e:
>=20
> The FF-A specification defines framework messages sent as direct
> requests when certain events occurs. For instance when a VM (guest) is
> created or destroyed. Only SPs which have subscribed to these events
> will receive them. An SP can subscribe to these messages in its
> partition properties.
>=20
> Adds a check that the SP supports the needed FF-A features
> FFA_PARTITION_INFO_GET and FFA_RX_RELEASE.
>=20
> The partition properties of each SP is retrieved with
> FFA_PARTITION_INFO_GET which returns the information in our RX buffer.
> Using FFA_PARTITION_INFO_GET changes the owner of the RX buffer to the
> caller (us), so once we're done with the buffer it must be released
> using FFA_RX_RELEASE before another call can be made.
>=20
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> ---
> xen/arch/arm/tee/ffa.c | 233 ++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 231 insertions(+), 2 deletions(-)
>=20
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> index f8ccaabc568d..d755363de686 100644
> --- a/xen/arch/arm/tee/ffa.c
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -160,14 +160,33 @@
> #define FFA_MSG_SEND                    0x8400006EU
> #define FFA_MSG_POLL                    0x8400006AU
>=20
> +/* Partition information descriptor */
> +struct ffa_partition_info_1_1 {
> +    uint16_t id;
> +    uint16_t execution_context;
> +    uint32_t partition_properties;
> +    uint8_t uuid[16];
> +};
> +
> struct ffa_ctx {
>     /* FF-A version used by the guest */
>     uint32_t guest_vers;
> +    /*
> +     * Number of SPs that we have sent a VM created signal to, used in
> +     * ffa_domain_teardown() to know which SPs need to be signalled.
> +     */
> +    uint16_t create_signal_count;
> };
>=20
> /* Negotiated FF-A version to use with the SPMC */
> static uint32_t __ro_after_init ffa_version;
>=20
> +/* SPs subscribing to VM_CREATE and VM_DESTROYED events */
> +static uint16_t *subscr_vm_created __read_mostly;
> +static uint16_t subscr_vm_created_count __read_mostly;
> +static uint16_t *subscr_vm_destroyed __read_mostly;
> +static uint16_t subscr_vm_destroyed_count __read_mostly;
> +
> /*
>  * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
>  * number of pages used in each of these buffers.
> @@ -251,6 +270,87 @@ static int32_t ffa_rxtx_map(paddr_t tx_addr, paddr_t=
 rx_addr,
>     return ffa_simple_call(FFA_RXTX_MAP_64, tx_addr, rx_addr, page_count,=
 0);
> }
>=20
> +static int32_t ffa_partition_info_get(uint32_t w1, uint32_t w2, uint32_t=
 w3,
> +                                      uint32_t w4, uint32_t w5,
> +                                      uint32_t *count)
> +{
> +    const struct arm_smccc_1_2_regs arg =3D {
> +        .a0 =3D FFA_PARTITION_INFO_GET,
> +        .a1 =3D w1,
> +        .a2 =3D w2,
> +        .a3 =3D w3,
> +        .a4 =3D w4,
> +        .a5 =3D w5,
> +    };
> +    struct arm_smccc_1_2_regs resp;
> +    uint32_t ret;
> +
> +    arm_smccc_1_2_smc(&arg, &resp);
> +
> +    ret =3D get_ffa_ret_code(&resp);
> +    if ( !ret )
> +        *count =3D resp.a2;
> +
> +    return ret;
> +}
> +
> +static int32_t ffa_rx_release(void)
> +{
> +    return ffa_simple_call(FFA_RX_RELEASE, 0, 0, 0, 0);
> +}
> +
> +static int32_t ffa_direct_req_send_vm(uint16_t sp_id, uint16_t vm_id,
> +                                      uint8_t msg)
> +{
> +    uint32_t exp_resp =3D FFA_MSG_FLAG_FRAMEWORK;
> +    unsigned int retry_count =3D 0;
> +    int32_t res;
> +
> +    if ( msg =3D=3D FFA_MSG_SEND_VM_CREATED )
> +        exp_resp |=3D FFA_MSG_RESP_VM_CREATED;
> +    else if ( msg =3D=3D FFA_MSG_SEND_VM_DESTROYED )
> +        exp_resp |=3D FFA_MSG_RESP_VM_DESTROYED;
> +    else
> +        return FFA_RET_INVALID_PARAMETERS;
> +
> +    do {
> +        const struct arm_smccc_1_2_regs arg =3D {
> +            .a0 =3D FFA_MSG_SEND_DIRECT_REQ_32,
> +            .a1 =3D sp_id,
> +            .a2 =3D FFA_MSG_FLAG_FRAMEWORK | msg,
> +            .a5 =3D vm_id,
> +        };
> +        struct arm_smccc_1_2_regs resp;
> +
> +        arm_smccc_1_2_smc(&arg, &resp);
> +        if ( resp.a0 !=3D FFA_MSG_SEND_DIRECT_RESP_32 || resp.a2 !=3D ex=
p_resp )
> +        {
> +            /*
> +             * This is an invalid response, likely due to some error in =
the
> +             * implementation of the ABI.
> +             */
> +            return FFA_RET_INVALID_PARAMETERS;
> +        }
> +        res =3D resp.a3;
> +        if ( ++retry_count > 10 )
> +        {
> +            /*
> +             * TODO
> +             * FFA_RET_INTERRUPTED means that the SPMC has a pending
> +             * non-secure interrupt, we need a way of delivering that
> +             * non-secure interrupt.
> +             * FFA_RET_RETRY is the SP telling us that it's temporarily
> +             * blocked from handling the direct request, we need a gener=
ic
> +             * way to deal with this.
> +             * For now in both cases, give up after a few retries.
> +             */
> +            return res;
> +        }
> +    } while ( res =3D=3D FFA_RET_INTERRUPTED || res =3D=3D FFA_RET_RETRY=
 );
> +
> +    return res;
> +}
> +
> static uint16_t get_vm_id(const struct domain *d)
> {
>     /* +1 since 0 is reserved for the hypervisor in FF-A */
> @@ -374,6 +474,8 @@ static bool ffa_handle_call(struct cpu_user_regs *reg=
s)
> static int ffa_domain_init(struct domain *d)
> {
>     struct ffa_ctx *ctx;
> +    unsigned int n;
> +    int32_t res;
>=20
>     if ( !ffa_version )
>         return -ENODEV;
> @@ -387,20 +489,68 @@ static int ffa_domain_init(struct domain *d)
>     ctx =3D xzalloc(struct ffa_ctx);
>     if ( !ctx )
>         return -ENOMEM;
> -

This line removal does not seem to be intended.

>     d->arch.tee =3D ctx;
>=20
> +    for ( n =3D 0; n < subscr_vm_created_count; n++ )
> +    {
> +        res =3D ffa_direct_req_send_vm(subscr_vm_created[n], get_vm_id(d=
),
> +                                     FFA_MSG_SEND_VM_CREATED);
> +        if ( res )
> +        {
> +            printk(XENLOG_ERR "ffa: Failed to report creation of vm_id %=
u to  %u: res %d\n",
> +                   get_vm_id(d), subscr_vm_created[n], res);
> +            ctx->create_signal_count =3D n;
> +            return -EIO;
> +        }
> +    }
> +    ctx->create_signal_count =3D n;

For clarity here, i would do:
signal_count =3D subscr_vm_created_count

> +
>     return 0;
> }
>=20
> +static bool is_in_subscr_list(const uint16_t *subscr, uint16_t start,
> +                              uint16_t end, uint16_t vm_id)
> +{
> +    unsigned int n;
> +
> +    for (n =3D start; n < end; n++)

Coding style, missing spaces

> +    {
> +        if (subscr[n] =3D=3D vm_id)

Coding style, missing spaces

> +            return true;
> +    }
> +
> +    return false;
> +}
> +
> /* This function is supposed to undo what ffa_domain_init() has done */
> static int ffa_domain_teardown(struct domain *d)
> {
>     struct ffa_ctx *ctx =3D d->arch.tee;
> +    unsigned int n;
> +    int32_t res;
>=20
>     if ( !ctx )
>         return 0;
>=20
> +    for ( n =3D 0; n < subscr_vm_destroyed_count; n++ )
> +    {
> +        /*
> +         * Skip SPs subscribed to the VM created event that never was
> +         * notified of the VM creation due to an error during
> +         * ffa_domain_init().
> +         */
> +        if ( is_in_subscr_list(subscr_vm_created, ctx->create_signal_cou=
nt,
> +                               subscr_vm_created_count, get_vm_id(d)) )
> +            continue;

I am not following the logic here and would need some explanations.

A SP is subscribing to be informed of any VM creation, but here you check
the list against the VM ID that is destroyed.

Also a SP could subscribe to be informed of VM destroyed but not VM created=
.=20

In my head the logic should be:
if (signal_count < subscr_vm_created_count)
	for each sp in subscr_vm_created
		if is_in_list subscr_vm_destroyed sp
			send_destroyed
else
	for each subscr_vm_destroyed
		send_destroyed


> +
> +        res =3D ffa_direct_req_send_vm(subscr_vm_destroyed[n], get_vm_id=
(d),
> +                                     FFA_MSG_SEND_VM_DESTROYED);
> +
> +        if ( res )
> +            printk(XENLOG_ERR "ffa: Failed to report destruction of vm_i=
d %u to  %u: res %d\n",
> +                   get_vm_id(d), subscr_vm_destroyed[n], res);
> +    }
> +
>     XFREE(d->arch.tee);
>=20
>     return 0;
> @@ -411,6 +561,81 @@ static int ffa_relinquish_resources(struct domain *d=
)
>     return 0;
> }
>=20
> +static void uninit_subscribers(void)
> +{
> +        subscr_vm_created_count =3D 0;
> +        subscr_vm_destroyed_count =3D 0;
> +        XFREE(subscr_vm_created);
> +        XFREE(subscr_vm_destroyed);
> +}
> +
> +static bool init_subscribers(struct ffa_partition_info_1_1 *fpi, uint16_=
t count)
> +{
> +    uint16_t n;
> +    uint16_t c_pos;
> +    uint16_t d_pos;
> +
> +    subscr_vm_created_count =3D 0;
> +    subscr_vm_destroyed_count =3D 0;
> +    for ( n =3D 0; n < count; n++ )
> +    {
> +        if (fpi[n].partition_properties & FFA_PART_PROP_NOTIF_CREATED)
Coding style: spaces

> +            subscr_vm_created_count++;
> +        if (fpi[n].partition_properties & FFA_PART_PROP_NOTIF_DESTROYED)
Coding style: spaces

Cheers
Bertrand

> +            subscr_vm_destroyed_count++;
> +    }
> +
> +    if ( subscr_vm_created_count )
> +        subscr_vm_created =3D xzalloc_array(uint16_t, subscr_vm_created_=
count);
> +    if ( subscr_vm_destroyed_count )
> +        subscr_vm_destroyed =3D xzalloc_array(uint16_t,
> +                                            subscr_vm_destroyed_count);
> +    if ( (subscr_vm_created_count && !subscr_vm_created) ||
> +         (subscr_vm_destroyed_count && !subscr_vm_destroyed) )
> +    {
> +        printk(XENLOG_ERR "ffa: Failed to allocate subscription lists\n"=
);
> +        uninit_subscribers();
> +        return false;
> +    }
> +
> +    for ( c_pos =3D 0, d_pos =3D 0, n =3D 0; n < count; n++ )
> +    {
> +        if ( fpi[n].partition_properties & FFA_PART_PROP_NOTIF_CREATED )
> +            subscr_vm_created[c_pos++] =3D fpi[n].id;
> +        if ( fpi[n].partition_properties & FFA_PART_PROP_NOTIF_DESTROYED=
 )
> +            subscr_vm_destroyed[d_pos++] =3D fpi[n].id;
> +    }
> +
> +    return true;
> +}
> +
> +static bool init_sps(void)
> +{
> +    bool ret =3D false;
> +    uint32_t count;
> +    int e;
> +
> +    e =3D ffa_partition_info_get(0, 0, 0, 0, 0, &count);
> +    if ( e )
> +    {
> +        printk(XENLOG_ERR "ffa: Failed to get list of SPs: %d\n", e);
> +        goto out;
> +    }
> +
> +    if ( count >=3D UINT16_MAX )
> +    {
> +        printk(XENLOG_ERR "ffa: Impossible number of SPs: %u\n", count);
> +        goto out;
> +    }
> +
> +    ret =3D init_subscribers(ffa_rx, count);
> +
> +out:
> +    ffa_rx_release();
> +
> +    return ret;
> +}
> +
> static bool ffa_probe(void)
> {
>     uint32_t vers;
> @@ -462,7 +687,8 @@ static bool ffa_probe(void)
>      * TODO: Rework the code to allow domain to use a subset of the
>      * features supported.
>      */
> -    if (
> +    if ( !check_mandatory_feature(FFA_PARTITION_INFO_GET) ||
> +         !check_mandatory_feature(FFA_RX_RELEASE) ||
>          !check_mandatory_feature(FFA_RXTX_MAP_64) ||
>          !check_mandatory_feature(FFA_RXTX_UNMAP) ||
>          !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
> @@ -484,6 +710,9 @@ static bool ffa_probe(void)
>     }
>     ffa_version =3D vers;
>=20
> +    if ( !init_sps() )
> +        goto err_free_ffa_tx;
> +
>     return true;
>=20
> err_free_ffa_tx:
> --=20
> 2.34.1
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 10:10:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 10:10:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565085.882969 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLhf7-0005LK-W9; Tue, 18 Jul 2023 10:10:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565085.882969; Tue, 18 Jul 2023 10:10:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLhf7-0005LD-TM; Tue, 18 Jul 2023 10:10:33 +0000
Received: by outflank-mailman (input) for mailman id 565085;
 Tue, 18 Jul 2023 10:10:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=88xE=DE=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qLhf7-0005L7-6u
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 10:10:33 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on060c.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::60c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 54183041-2553-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 12:10:32 +0200 (CEST)
Received: from AM0PR10CA0057.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:150::37)
 by AM9PR08MB5985.eurprd08.prod.outlook.com (2603:10a6:20b:286::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Tue, 18 Jul
 2023 10:10:28 +0000
Received: from AM7EUR03FT037.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:150:cafe::43) by AM0PR10CA0057.outlook.office365.com
 (2603:10a6:20b:150::37) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33 via Frontend
 Transport; Tue, 18 Jul 2023 10:10:28 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT037.mail.protection.outlook.com (100.127.140.225) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.33 via Frontend Transport; Tue, 18 Jul 2023 10:10:27 +0000
Received: ("Tessian outbound f5de790fcf89:v145");
 Tue, 18 Jul 2023 10:10:27 +0000
Received: from d3a93c584bf1.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 857CECA3-CC4E-4E71-A906-3A72E5C0EE34.1; 
 Tue, 18 Jul 2023 10:10:20 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d3a93c584bf1.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 18 Jul 2023 10:10:20 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com (2603:10a6:208:104::24)
 by AM8PR08MB5668.eurprd08.prod.outlook.com (2603:10a6:20b:1d0::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Tue, 18 Jul
 2023 10:10:19 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854]) by AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854%3]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 10:10:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 54183041-2553-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=iVsGkHwFr8tBv0RGAfHqPfsW3VgA8R6qmeJQPCvTvSw=;
 b=k9dh2PwONwthDW7CA3aKPx9PB/Z3Uq15nvT15HytBHSIUp+Jq3+u0LdvqoXlZ0cCF/HNTRcrBao557HgaBXpptapSHy4XSIoKtThQcIt73CpoxxG4v9KQ9xJkD7Uy4o/ewYy0ReVFo96gQce08ZqRy9gEu5YYQuMHcrWZhk9/6A=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: a8c863e103e962b0
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Be+U7AqiRPAWBN1jOoCvQCHl1ZfOdJDroR7eZ0UivDnd/9KqrKtPsJgh8OZTNEgLbZerXYolcfw7bS7U+jQp5aNT5bZFUMIHJ0Dfv1MH5bx3opxVsIwNztMx24rwSBZ6b108RjIrEgo/cjytufsuhwegv2rUgC9vA/WzfcShvGfo7w/bJE/633AubsQ2903VSvUG8xrLHcRqUe0SBvRWhEi9yBqYyOGO/LnLojljteOhMTXSE4VHJv2JmKxVi9AXZmAPL9xRf3qZ/5X6X6uEJvDImgjISNwVy1vSVPlV1FV/c8mHlv5zNKFkn0DHuqVkcQ1pM1a6UvvTboByyvMy/g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=iVsGkHwFr8tBv0RGAfHqPfsW3VgA8R6qmeJQPCvTvSw=;
 b=gzgRmjPWa5cnPnRaDXzoVd9w08/7UcjhSi4/DpAFXCJB0sj23JFF0plvNnhorhiouabKTj5NTTG2TGm1ACdYtuZOULfFPAgFKu5EP5QK3qgge3KYxbCtos7tCkb2uKm2gwVGwPv5Bc4z0UfKZNL50vuEPsqGqIxrQktqaU6hs1JChFPZRsscJblzZ0cXBtSqz9snSHwQtmeKibEPi+C7yEKKCJ3FBiQfrroeFlt+xN8Sr34atGMQyLIPJ77+acoiWFqxZlhx1sEA4C979u+2jGgwVXaCG+1cNpMf8UDT2SCSAfIf/VFY2nuWHoLjAcCnz2GXczCDRkG+WDS6sGyAyA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=iVsGkHwFr8tBv0RGAfHqPfsW3VgA8R6qmeJQPCvTvSw=;
 b=k9dh2PwONwthDW7CA3aKPx9PB/Z3Uq15nvT15HytBHSIUp+Jq3+u0LdvqoXlZ0cCF/HNTRcrBao557HgaBXpptapSHy4XSIoKtThQcIt73CpoxxG4v9KQ9xJkD7Uy4o/ewYy0ReVFo96gQce08ZqRy9gEu5YYQuMHcrWZhk9/6A=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>
Subject: Re: [XEN PATCH v10 13/24] xen/arm: ffa: support mapping guest RX/TX
 buffers
Thread-Topic: [XEN PATCH v10 13/24] xen/arm: ffa: support mapping guest RX/TX
 buffers
Thread-Index: AQHZuH9XcNt8RODY5EiyyRkk5td9s6+/TxAA
Date: Tue, 18 Jul 2023 10:10:18 +0000
Message-ID: <88B6CFB1-81B3-4B55-AF8E-2BA8970CA5BB@arm.com>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-14-jens.wiklander@linaro.org>
In-Reply-To: <20230717072107.753304-14-jens.wiklander@linaro.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM0PR08MB3778:EE_|AM8PR08MB5668:EE_|AM7EUR03FT037:EE_|AM9PR08MB5985:EE_
X-MS-Office365-Filtering-Correlation-Id: 5bfabb94-6062-4f07-8d84-08db877735fe
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 cDNtH47YWzp5NLeiTXDERpfKiceIGjQ2i36q3YJNoLanSvfdWiGJk3s8ttwRp6QYoaG9suD+Mt73XUqCKopQwaiTyX6ATq9xX+vmqZXFr1bThAVGBGKmbeU/UeIgYB9zi+MXCICsSgZS4oYAU5CPw6E1WHPg00MJ0PDnFHkzKzk8bIGbMVaakSUhPQSkasdXR7+jMfK1q/ceBPfHDLqBCuPlc5Uz3NzR9c8wXdX3BU2eZqWwVYLa+WhDuYgWsYcS7pG9jusx6fVJGPXJ3OZAmWM7MTrRrTqzda3cCSznFuW/cj2DhxuxRMqbcxSd62JKRLHyHVgFy3njLpmpmO80wzZR4aULwncT8zzx5TZWyhSBkydbd8I9ZrHVBK6Aip93Ddx/769tn2RAX7oEIxtT+YIrjE+EPgN8iPP7ufJzJ+IoR314t7or94RQ2f3cye1Xin5NjIOqluoJCmGUzN8VyWhjE+hFMRmLcee6CeI35WQcFOJRfKGyerPo+cOJlL69HBs7G4Hrr1AjR3nuHduAWQ7/CV/vout9sji9JYiIt7WIow+Zt98kUaK32Px80qzoCsZ0ZFaiMeiGpjOlVJ1+6mUcvUncmuwqgs9ygzvieeuPgiVJzSu/SHH8mRPfre/iBAdhgJz9RFpyXmyFUUAIOA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB3778.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(376002)(346002)(136003)(396003)(39860400002)(451199021)(54906003)(478600001)(71200400001)(6486002)(91956017)(83380400001)(76116006)(6506007)(186003)(53546011)(6512007)(2906002)(64756008)(316002)(66556008)(6916009)(41300700001)(4326008)(66446008)(66946007)(8936002)(8676002)(5660300002)(38100700002)(122000001)(66476007)(36756003)(86362001)(38070700005)(2616005)(33656002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <DD0CED81456ECF4C82910F04850B03EA@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5668
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT037.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	79adfa69-ab09-4089-8680-08db8777309b
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	VvQiddQzYhzjmCojIBToG1uCg9k8sqxlAhM+gszSYxl073fWNkBEX6yGbnMAoa2feLyvdRUuCMBIhdw0LBj2m7JZRLYGoV2Ln4I2LZ+AgST0oq7ELImd1Sd872Jplxpuff0g1h9cF+wpEMtA5Uq8/kuq35Po2jLGlPmZuZq4XOgSJkPZRToJfwQOB52ce3ivOhMSVpP48f5hc42x4cIqIjcQmCzrubTd7Z++WicawwqyxEmGHmVy4/RCOMWm7YJj8DJlWeBqECshSyrwJt9wDEiPSGyJQ7o3W5FYg/mh88OyDixawpEXSEniSDz6KSOF2onfozmrUIbgf+IZW2zjMlEGwXF48TDBiY/h9JRulrY0rrXb4FdyJYDcJSoMUS5IZdv0jvFdqLNzmXktZU29b/Ybybd1auZqOuqv2rU4Fq8thmWAyyh9CiM3des85Me/7QlP3Czy/YvTRkkQo00nltwnSnFYNoNRybHXVx9MnNu9ORBgaPo34HTaQHS9gLIx6FFiiF97rLwEGSUITNNNFY8jjIZ/TppKV7S7HMNY8NpO8vzcHpsn2tt1V7QRoaPv+fay/J2DPOMpQz9bdM25zbgqAJUYS6stFVhTT085zsyNSsRTUy14KKsjP5bQQzw1kmELF4WeQekUku1oXOAN6N8jS9Z5vV0GSj4+Db8lMWYzgf0qT/CHUoKNY+JETrA/0Y8+8dkdZFuI6NqAC6dg5V1DtWl/3+zNtqeWPoBmxpt0xiwns6T+dMOqIDzbls8T
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(396003)(376002)(39860400002)(451199021)(82310400008)(40470700004)(36840700001)(46966006)(40480700001)(36756003)(33656002)(81166007)(82740400003)(40460700003)(356005)(478600001)(2906002)(6486002)(41300700001)(107886003)(53546011)(6506007)(26005)(6512007)(54906003)(6862004)(8936002)(316002)(86362001)(70586007)(70206006)(5660300002)(4326008)(8676002)(336012)(2616005)(47076005)(36860700001)(83380400001)(186003);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 10:10:27.9008
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 5bfabb94-6062-4f07-8d84-08db877735fe
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT037.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB5985

Hi Jens,

> On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> wrot=
e:
>=20
> Adds support in the mediator to map and unmap the RX and TX buffers
> provided by the guest using the two FF-A functions FFA_RXTX_MAP and
> FFA_RXTX_UNMAP.
>=20
> These buffer are later used to transmit data that cannot be passed in
> registers only.
>=20
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> ---
> xen/arch/arm/tee/ffa.c | 138 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 138 insertions(+)
>=20
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> index d755363de686..ffabb5ed0a80 100644
> --- a/xen/arch/arm/tee/ffa.c
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -74,6 +74,12 @@
>  */
> #define FFA_RXTX_PAGE_COUNT             1
>=20
> +/*
> + * Limits the number of pages RX/TX buffers guests can map.

Typo: s/Limits/Limit/

> + * TODO support a larger number.
> + */
> +#define FFA_MAX_RXTX_PAGE_COUNT         1
> +
> /*
>  * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
>  * BIT(31): Framework or partition message
> @@ -169,6 +175,12 @@ struct ffa_partition_info_1_1 {
> };
>=20
> struct ffa_ctx {
> +    void *rx;
> +    const void *tx;
> +    struct page_info *rx_pg;
> +    struct page_info *tx_pg;
> +    /* Number of 4kB pages in each of rx/rx_pg and tx/tx_pg */
> +    unsigned int page_count;
>     /* FF-A version used by the guest */
>     uint32_t guest_vers;
>     /*
> @@ -176,6 +188,7 @@ struct ffa_ctx {
>      * ffa_domain_teardown() to know which SPs need to be signalled.
>      */
>     uint16_t create_signal_count;
> +    bool rx_is_free;
> };
>=20
> /* Negotiated FF-A version to use with the SPMC */
> @@ -371,6 +384,11 @@ static void set_regs(struct cpu_user_regs *regs, reg=
ister_t v0, register_t v1,
>         set_user_reg(regs, 7, v7);
> }
>=20
> +static void set_regs_error(struct cpu_user_regs *regs, uint32_t error_co=
de)
> +{
> +    set_regs(regs, FFA_ERROR, 0, error_code, 0, 0, 0, 0, 0);
> +}
> +
> static void set_regs_success(struct cpu_user_regs *regs, uint32_t w2,
>                              uint32_t w3)
> {
> @@ -392,6 +410,106 @@ static void handle_version(struct cpu_user_regs *re=
gs)
>     set_regs(regs, vers, 0, 0, 0, 0, 0, 0, 0);
> }
>=20
> +static uint32_t handle_rxtx_map(uint32_t fid, register_t tx_addr,
> +                                register_t rx_addr, uint32_t page_count)
> +{
> +    uint32_t ret =3D FFA_RET_INVALID_PARAMETERS;
> +    struct domain *d =3D current->domain;
> +    struct ffa_ctx *ctx =3D d->arch.tee;
> +    struct page_info *tx_pg;
> +    struct page_info *rx_pg;
> +    p2m_type_t t;
> +    void *rx;
> +    void *tx;
> +
> +    if ( !smccc_is_conv_64(fid) )
> +    {
> +        /*
> +         * Calls using the 32-bit calling convention must ignore the upp=
er
> +         * 32 bits in the argument registers.
> +         */
> +        tx_addr &=3D UINT32_MAX;
> +        rx_addr &=3D UINT32_MAX;
> +    }
> +
> +    if ( page_count > FFA_MAX_RXTX_PAGE_COUNT )
> +    {
> +        printk(XENLOG_ERR "ffa: RXTX_MAP: error: %u pages requested (lim=
it %u)\n",
> +               page_count, FFA_MAX_RXTX_PAGE_COUNT);
> +        return FFA_RET_NOT_SUPPORTED;
> +    }
> +
> +    /* Already mapped */
> +    if ( ctx->rx )
> +        return FFA_RET_DENIED;
> +
> +    tx_pg =3D get_page_from_gfn(d, gfn_x(gaddr_to_gfn(tx_addr)), &t, P2M=
_ALLOC);
> +    if ( !tx_pg )
> +        return FFA_RET_INVALID_PARAMETERS;

Please add a newline here

> +    /* Only normal RW RAM for now */
> +    if ( t !=3D p2m_ram_rw )
> +        goto err_put_tx_pg;
> +
> +    rx_pg =3D get_page_from_gfn(d, gfn_x(gaddr_to_gfn(rx_addr)), &t, P2M=
_ALLOC);
> +    if ( !tx_pg )
> +        goto err_put_tx_pg;

Please add a newline here

> +    /* Only normal RW RAM for now */
> +    if ( t !=3D p2m_ram_rw )
> +        goto err_put_rx_pg;
> +
> +    tx =3D __map_domain_page_global(tx_pg);
> +    if ( !tx )
> +        goto err_put_rx_pg;
> +
> +    rx =3D __map_domain_page_global(rx_pg);
> +    if ( !rx )
> +        goto err_unmap_tx;
> +
> +    ctx->rx =3D rx;
> +    ctx->tx =3D tx;
> +    ctx->rx_pg =3D rx_pg;
> +    ctx->tx_pg =3D tx_pg;
> +    ctx->page_count =3D page_count;
> +    ctx->rx_is_free =3D true;
> +    return FFA_RET_OK;
> +
> +err_unmap_tx:
> +    unmap_domain_page_global(tx);
> +err_put_rx_pg:
> +    put_page(rx_pg);
> +err_put_tx_pg:
> +    put_page(tx_pg);
> +
> +    return ret;
> +}
> +
> +static void rxtx_unmap(struct ffa_ctx *ctx)
> +{
> +    unmap_domain_page_global(ctx->rx);
> +    unmap_domain_page_global(ctx->tx);
> +    put_page(ctx->rx_pg);
> +    put_page(ctx->tx_pg);
> +    ctx->rx =3D NULL;
> +    ctx->tx =3D NULL;
> +    ctx->rx_pg =3D NULL;
> +    ctx->tx_pg =3D NULL;
> +    ctx->page_count =3D 0;
> +    ctx->rx_is_free =3D false;
> +}
> +
> +static uint32_t handle_rxtx_unmap(void)
> +{
> +    struct domain *d =3D current->domain;
> +    struct ffa_ctx *ctx =3D d->arch.tee;
> +
> +    if ( !ctx->rx )
> +        return FFA_RET_INVALID_PARAMETERS;
> +
> +    rxtx_unmap(ctx);
> +
> +    return FFA_RET_OK;
> +}
> +
> static void handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32=
_t fid)
> {
>     struct arm_smccc_1_2_regs arg =3D { .a0 =3D fid, };
> @@ -448,6 +566,7 @@ static bool ffa_handle_call(struct cpu_user_regs *reg=
s)
>     uint32_t fid =3D get_user_reg(regs, 0);
>     struct domain *d =3D current->domain;
>     struct ffa_ctx *ctx =3D d->arch.tee;
> +    int e;
>=20
>     if ( !ctx )
>         return false;
> @@ -460,6 +579,22 @@ static bool ffa_handle_call(struct cpu_user_regs *re=
gs)
>     case FFA_ID_GET:
>         set_regs_success(regs, get_vm_id(d), 0);
>         return true;
> +    case FFA_RXTX_MAP_32:
> +    case FFA_RXTX_MAP_64:
> +        e =3D handle_rxtx_map(fid, get_user_reg(regs, 1), get_user_reg(r=
egs, 2),
> +                            get_user_reg(regs, 3));
> +        if ( e )
> +            set_regs_error(regs, e);
> +        else
> +            set_regs_success(regs, 0, 0);
> +        return true;
> +    case FFA_RXTX_UNMAP:
> +        e =3D handle_rxtx_unmap();
> +        if ( e )
> +            set_regs_error(regs, e);
> +        else
> +            set_regs_success(regs, 0, 0);
> +        return true;
>     case FFA_MSG_SEND_DIRECT_REQ_32:
>     case FFA_MSG_SEND_DIRECT_REQ_64:
>         handle_msg_send_direct_req(regs, fid);
> @@ -551,6 +686,9 @@ static int ffa_domain_teardown(struct domain *d)
>                    get_vm_id(d), subscr_vm_destroyed[n], res);
>     }
>=20
> +    if ( ctx->rx )
> +        rxtx_unmap(ctx);
> +
>     XFREE(d->arch.tee);
>=20
>     return 0;
> --=20
> 2.34.1
>=20

Cheers
Bertrand




From xen-devel-bounces@lists.xenproject.org Tue Jul 18 10:22:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 10:22:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565090.882978 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLhqO-0006yk-2Q; Tue, 18 Jul 2023 10:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565090.882978; Tue, 18 Jul 2023 10:22:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLhqN-0006yd-Uv; Tue, 18 Jul 2023 10:22:11 +0000
Received: by outflank-mailman (input) for mailman id 565090;
 Tue, 18 Jul 2023 10:22:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=88xE=DE=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qLhqM-0006yX-MV
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 10:22:10 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on061b.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::61b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f34d48a4-2554-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 12:22:09 +0200 (CEST)
Received: from AS4P195CA0002.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:5e2::6)
 by DU0PR08MB8042.eurprd08.prod.outlook.com (2603:10a6:10:3e6::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 10:22:05 +0000
Received: from AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:5e2:cafe::9a) by AS4P195CA0002.outlook.office365.com
 (2603:10a6:20b:5e2::6) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33 via Frontend
 Transport; Tue, 18 Jul 2023 10:22:05 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT013.mail.protection.outlook.com (100.127.140.191) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.33 via Frontend Transport; Tue, 18 Jul 2023 10:22:05 +0000
Received: ("Tessian outbound f1e964b3a9be:v145");
 Tue, 18 Jul 2023 10:22:05 +0000
Received: from e9ec91e7b19f.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 87F7D2B3-4356-4200-AE4C-E56D34FD1753.1; 
 Tue, 18 Jul 2023 10:21:58 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e9ec91e7b19f.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 18 Jul 2023 10:21:58 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com (2603:10a6:208:104::24)
 by AS8PR08MB9364.eurprd08.prod.outlook.com (2603:10a6:20b:5ab::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 10:21:55 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854]) by AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854%3]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 10:21:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f34d48a4-2554-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=gKfTXqcIkG7wvy24x4435IHOuEQhDz69tFHffTq02O0=;
 b=U+ZMpzW7nS7S8QP6S1E9rLEtXyKA4OKVVxF2nb5bgl0iY7InqTZIcIxp47/t+J1P76X6WzkcfLSqdF0Mq6HPbHn7K/dst9lmyX6oNuEtIVMHq18zyShf5Km0dsE6QMlYyP+j7tMpNH/haAuwsDJqVMsFEW1CTQm8WfMkMgdN7BU=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 0b8aa35ec9dc67d0
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hgn4sN3WqW0F6vRUMEo8qCiO9VLCV/jlpMz6+uNNX3pM1siccBV8+e96oqzxU8nhRCFixqGJci+DAzeTpqwY/6rTZ5XJ+eEAUnF3y1AnSW6HVA8A10nsKOgqIzssjJCAT63NetijonGodKejmnvShSex3ad4pQ95X9zI9Q9nWGNUx4uSxZRa2vQgOsyKhtkU6CfuPkfQV1xey+fweiExyBN7tf0PF/Clx1cFW7zNHbLFrt+kT68/k0or4pv/NMdMXDaSs1QLHJP3falJHzQrQuepBIyXVdzP3o+hRO5QwyU2KfXhpXk5xmD1su4ImJjyJaGcK08baJWGba95DT1ymQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=gKfTXqcIkG7wvy24x4435IHOuEQhDz69tFHffTq02O0=;
 b=HpZybrIv+ROkJ3yTJMJZ314M7m6v6qlYHUB3OznRJYLzd54aJ8xqHQ7aw+1i7SeZeloQ7RxmhM9zDy8wCG5xIWloxfQpK5ip5/BBFKH5rCdXeHIjkPMU01R5x327szBUYzuFjvpMZItpReXGu8i6hvPaL0n7mYo8xiBDEQln69ju1BHS/hRtqV+sFOktfTMDjg2Q4UvkwWs1qpGHECHczI146jylr6lcZZSughSwPIHRVy0zEbn2kabf4Ef5cms+Wi7sDORT1unyPJi7E8gb1AN4ZDM3tyiik2573qo3DbU5Og6h+Lyhv+p8sYNHirPr5T3ng+36TViuJJ5we2pHyw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=gKfTXqcIkG7wvy24x4435IHOuEQhDz69tFHffTq02O0=;
 b=U+ZMpzW7nS7S8QP6S1E9rLEtXyKA4OKVVxF2nb5bgl0iY7InqTZIcIxp47/t+J1P76X6WzkcfLSqdF0Mq6HPbHn7K/dst9lmyX6oNuEtIVMHq18zyShf5Km0dsE6QMlYyP+j7tMpNH/haAuwsDJqVMsFEW1CTQm8WfMkMgdN7BU=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>
Subject: Re: [XEN PATCH v10 14/24] xen/arm: ffa: support guest
 FFA_PARTITION_INFO_GET
Thread-Topic: [XEN PATCH v10 14/24] xen/arm: ffa: support guest
 FFA_PARTITION_INFO_GET
Thread-Index: AQHZuH9YF/Z3OeEtnU6SqiWq2d4poa+/Uk+A
Date: Tue, 18 Jul 2023 10:21:55 +0000
Message-ID: <D09E02DC-DE2A-4876-B5E7-10DD131EC98F@arm.com>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-15-jens.wiklander@linaro.org>
In-Reply-To: <20230717072107.753304-15-jens.wiklander@linaro.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM0PR08MB3778:EE_|AS8PR08MB9364:EE_|AM7EUR03FT013:EE_|DU0PR08MB8042:EE_
X-MS-Office365-Filtering-Correlation-Id: 83450ee3-983d-42ac-29a3-08db8778d5a3
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 DahoaX6RMTv1IqfGlCxUnzaZf7hggiOLSFKKXosllA9c6Jpo7LMfcjQVwBzSO8U9MA+M0rMwaxOKWA1kj3Eu4+l/HG+atuy6FiBseKf5+bBRYD3+khrIjdGGXzlpUp26H5nOamPPHLNX6vJ9AcJgqcdcWdskR3R6tUhcBeoP6UjPJOOAzDHfgcEGIbmIwTsp/aSsIILWfJuVCSHYImPWhGEHC3X5mUse9j5HYgaBinXkEvk5zusaqORsWzytcWFEt2F+NQEVsYK9g1o9sBhzaHGe51qEhjxAPspWa9MbXt5ZfB3SopcVkFQB/oCa2VZsJOLx6NNREPIDeKLfxrdnzLSIPh3BjFzpJKRSr/uGubcCnOrqlsHmvz27OxyjMz44MYuaPCz5QowIdZwK+5IW/jyXnPddiDv3rZnJuN+D+hfrM+IQnvw5tSzyMNUCjSMxwcQbHjsZ/XJ3osQNlZuijsIt9FA2mkBAwihZhEsn+rckTAxxE7EV50iV79tcHWnr4M+Xjew3WtUWv/Vo2vSOpGJVSk+qfWtFUlq2osHA5JBAgSYyyFwaI1B3L8GJqktNhhaaSCGtfZ3eskusjcSGqTrO7VW7vc3kULNlknHtqHJCjOskhQ9bAJwD4BlxWFbUpOqt24TeR7j1nJRjlM8QwQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB3778.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(396003)(366004)(39860400002)(376002)(451199021)(66556008)(54906003)(478600001)(71200400001)(6486002)(91956017)(53546011)(6506007)(186003)(36756003)(2616005)(316002)(6512007)(2906002)(76116006)(4326008)(66946007)(66476007)(41300700001)(66446008)(5660300002)(8676002)(8936002)(122000001)(64756008)(6916009)(38100700002)(86362001)(38070700005)(83380400001)(33656002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <32D48C7FFFD6AF4A96CCA62A5ABCA5CC@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9364
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	0d3a9ebe-c31c-4b33-86a2-08db8778cfe0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	jMyUxmgcOmh+lbCknxBADrzaKRHrCXwHp5SlKy7VooD6AYo2vq1kb7T6BHaKjxF1goxztsi7n+mbR+iRe64Mrje2CK8sBG3WQ3zZoCgafSxT76fNmsk2RVLy8LqkNuye/Pi4yQBuK62GeJE6gV0Kqyy6vHPJiM2J69kY+hTVmWlfPYdsaFGPnnKHDQSCkXHjfHtUgQa50wuZx9jr5OcOykE2DaXRvb8aLKm7k+IPCKu8l0d5Klp451ETm9AZOP5iesLNMTXuYoQt99z3B3kxwxwtQVXxkEJG/S1hA+TQeRvN9C8u0TNL790/w9b1vTSudHt2pbpSoPMuGW0wUt4rCMNOxXfc2SdSmtX8l1Iwpq6yw7xnlyrYy7fiDZM7AYDfi+Vj5d2gtwfCO4rPRa82BrpSNBxpX70Ip7okoFzrA4dtgn5Q1OX64H9LYgGGrmZHOmuCrSuz4ZtzGJ77EYVL51Sr8a7PeHtx8i+ZtiueYuy4DPvsaW8azdJMtqdKwT47nZNJJDcNozrUCr/RiL7yagBcbGsS5wRdukd2jHrF6JCxoWrNkIbijL0f8x8w8NSXwNQzo+yc0oUsbgohoWGWPs5KwJIYe31hRArPUt0S2qS9NWbXG4y2WNxu89D+5oz6gt/P2xBtkvO2mD17d8BHamCsS/sVUvceZuIJ0osEDMMLOXeQ+GfsSLv3uIEqLGYodO/z/47L588kNQNA4oU8+kMKpc3W7lFI/rLTaGXlFxmbp+aKZGkoSqP0rXhgKhvt
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(39860400002)(346002)(396003)(82310400008)(451199021)(40470700004)(36840700001)(46966006)(86362001)(2906002)(33656002)(36756003)(40460700003)(40480700001)(47076005)(2616005)(36860700001)(6512007)(186003)(336012)(6506007)(26005)(53546011)(82740400003)(356005)(81166007)(6486002)(54906003)(83380400001)(478600001)(70206006)(4326008)(8676002)(316002)(41300700001)(6862004)(8936002)(70586007)(5660300002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 10:22:05.2341
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 83450ee3-983d-42ac-29a3-08db8778d5a3
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8042

Hi Jens,

> On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> wrot=
e:
>=20
> Adds support in the mediator to handle FFA_PARTITION_INFO_GET requests
> from a guest. The requests are forwarded to the SPMC and the response is
> translated according to the FF-A version in use by the guest.
>=20
> Using FFA_PARTITION_INFO_GET changes the owner of the RX buffer to the
> caller (the guest in this case), so once it is done with the buffer it
> must be released using FFA_RX_RELEASE before another call can be made.
>=20
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> ---
> xen/arch/arm/tee/ffa.c | 131 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 131 insertions(+)
>=20
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> index ffabb5ed0a80..d5748b9ce88c 100644
> --- a/xen/arch/arm/tee/ffa.c
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -166,7 +166,18 @@
> #define FFA_MSG_SEND                    0x8400006EU
> #define FFA_MSG_POLL                    0x8400006AU
>=20
> +/*
> + * Structs below ending with _1_0 are defined in FF-A-1.0-REL and
> + * struct ending with _1_1 are defined in FF-A-1.1-REL0.

Nit: For coherency, second line should be "Structs" instead of "struct"

> + */
> +
> /* Partition information descriptor */
> +struct ffa_partition_info_1_0 {
> +    uint16_t id;
> +    uint16_t execution_context;
> +    uint32_t partition_properties;
> +};
> +
> struct ffa_partition_info_1_1 {
>     uint16_t id;
>     uint16_t execution_context;
> @@ -189,6 +200,7 @@ struct ffa_ctx {
>      */
>     uint16_t create_signal_count;
>     bool rx_is_free;
> +    spinlock_t lock;
> };
>=20
> /* Negotiated FF-A version to use with the SPMC */
> @@ -203,9 +215,15 @@ static uint16_t subscr_vm_destroyed_count __read_mos=
tly;
> /*
>  * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
>  * number of pages used in each of these buffers.
> + *
> + * The RX buffer is protected from concurrent usage with ffa_rx_buffer_l=
ock.
> + * Note that the SPMC is also tracking the ownership of our RX buffer so
> + * for calls which uses our RX buffer to deliver a result we must call
> + * ffa_rx_release() to let the SPMC know that we're done with the buffer=
.
>  */
> static void *ffa_rx __read_mostly;
> static void *ffa_tx __read_mostly;
> +static DEFINE_SPINLOCK(ffa_rx_buffer_lock);
>=20
> static bool ffa_get_version(uint32_t *vers)
> {
> @@ -510,6 +528,100 @@ static uint32_t handle_rxtx_unmap(void)
>     return FFA_RET_OK;
> }
>=20
> +static int32_t handle_partition_info_get(uint32_t w1, uint32_t w2, uint3=
2_t w3,
> +                                         uint32_t w4, uint32_t w5,
> +                                         uint32_t *count)
> +{
> +    int32_t ret =3D FFA_RET_DENIED;
> +    struct domain *d =3D current->domain;
> +    struct ffa_ctx *ctx =3D d->arch.tee;
> +
> +    /*
> +     * FF-A v1.0 has w5 MBZ while v1.1 allows
> +     * FFA_PARTITION_INFO_GET_COUNT_FLAG to be non-zero.
> +     */

You should add something to say that the INFO_GET_COUNT does
not use the rxtx buffer to explain why you do the call directly in this cas=
e.

Reading the code as is, on might wonder why this case is different.

How about:
FFA_PARTITION_INFO_GET_COUNT is only using registers and not
the rxtx buffer so do the partition_info_get directly.

> +    if ( w5 =3D=3D FFA_PARTITION_INFO_GET_COUNT_FLAG &&
> +         ctx->guest_vers =3D=3D FFA_VERSION_1_1 )
> +        return ffa_partition_info_get(w1, w2, w3, w4, w5, count);
> +    if ( w5 )
> +        return FFA_RET_INVALID_PARAMETERS;
> +
> +    if ( !ffa_rx )
> +        return FFA_RET_DENIED;
> +
> +    spin_lock(&ctx->lock);
> +    if ( !ctx->page_count || !ctx->rx_is_free )
> +        goto out;
> +    spin_lock(&ffa_rx_buffer_lock);
> +    ret =3D ffa_partition_info_get(w1, w2, w3, w4, w5, count);
> +    if ( ret )
> +        goto out_rx_buf_unlock;
> +    /*
> +     * ffa_partition_info_get() succeeded so we now own the RX buffer we
> +     * share with the SPMC. We must give it back using ffa_rx_release()
> +     * once we've copied the content.
> +     */
> +
> +    if ( ctx->guest_vers =3D=3D FFA_VERSION_1_0 )
> +    {
> +        size_t n;
> +        struct ffa_partition_info_1_1 *src =3D ffa_rx;
> +        struct ffa_partition_info_1_0 *dst =3D ctx->rx;
> +
> +        if ( ctx->page_count * FFA_PAGE_SIZE < *count * sizeof(*dst) )
> +        {
> +            ret =3D FFA_RET_NO_MEMORY;
> +            goto out_rx_release;
> +        }
> +
> +        for ( n =3D 0; n < *count; n++ )
> +        {
> +            dst[n].id =3D src[n].id;
> +            dst[n].execution_context =3D src[n].execution_context;
> +            dst[n].partition_properties =3D src[n].partition_properties;
> +        }
> +    }
> +    else
> +    {
> +        size_t sz =3D *count * sizeof(struct ffa_partition_info_1_1);
> +
> +        if ( ctx->page_count * FFA_PAGE_SIZE < sz )
> +        {
> +            ret =3D FFA_RET_NO_MEMORY;
> +            goto out_rx_release;
> +        }
> +
> +
> +        memcpy(ctx->rx, ffa_rx, sz);
> +    }
> +    ctx->rx_is_free =3D false;
> +out_rx_release:
> +    ffa_rx_release();
> +out_rx_buf_unlock:
> +    spin_unlock(&ffa_rx_buffer_lock);
> +out:
> +    spin_unlock(&ctx->lock);
> +
> +    return ret;
> +}
> +
> +static int32_t handle_rx_release(void)
> +{
> +    int32_t ret =3D FFA_RET_DENIED;
> +    struct domain *d =3D current->domain;
> +    struct ffa_ctx *ctx =3D d->arch.tee;
> +
> +    spin_lock(&ctx->lock);
> +    if ( !ctx->page_count || ctx->rx_is_free )
> +        goto out;
> +    ret =3D FFA_RET_OK;
> +    ctx->rx_is_free =3D true;
> +out:
> +    spin_unlock(&ctx->lock);
> +
> +    return ret;
> +}
> +
> static void handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32=
_t fid)
> {
>     struct arm_smccc_1_2_regs arg =3D { .a0 =3D fid, };
> @@ -566,6 +678,7 @@ static bool ffa_handle_call(struct cpu_user_regs *reg=
s)
>     uint32_t fid =3D get_user_reg(regs, 0);
>     struct domain *d =3D current->domain;
>     struct ffa_ctx *ctx =3D d->arch.tee;
> +    uint32_t count;
>     int e;
>=20
>     if ( !ctx )
> @@ -595,6 +708,24 @@ static bool ffa_handle_call(struct cpu_user_regs *re=
gs)
>         else
>             set_regs_success(regs, 0, 0);
>         return true;
> +    case FFA_PARTITION_INFO_GET:
> +        e =3D handle_partition_info_get(get_user_reg(regs, 1),
> +                                      get_user_reg(regs, 2),
> +                                      get_user_reg(regs, 3),
> +                                      get_user_reg(regs, 4),
> +                                      get_user_reg(regs, 5), &count);
> +        if ( e )
> +            set_regs_error(regs, e);
> +        else
> +            set_regs_success(regs, count, 0);
> +        return true;
> +    case FFA_RX_RELEASE:
> +        e =3D handle_rx_release();
> +        if ( e )
> +            set_regs_error(regs, e);
> +        else
> +            set_regs_success(regs, 0, 0);
> +        return true;
>     case FFA_MSG_SEND_DIRECT_REQ_32:
>     case FFA_MSG_SEND_DIRECT_REQ_64:
>         handle_msg_send_direct_req(regs, fid);
> --=20
> 2.34.1
>=20

Cheers
Bertrand



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 11:07:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 11:07:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565118.882989 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLiY7-0003jk-Hi; Tue, 18 Jul 2023 11:07:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565118.882989; Tue, 18 Jul 2023 11:07:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLiY7-0003jd-EY; Tue, 18 Jul 2023 11:07:23 +0000
Received: by outflank-mailman (input) for mailman id 565118;
 Tue, 18 Jul 2023 11:07:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ju50=DE=invisiblethingslab.com=simon@srs-se1.protection.inumbo.net>)
 id 1qLiY5-0003jE-IA
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 11:07:21 +0000
Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com
 [64.147.123.25]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 41edb092-255b-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 13:07:18 +0200 (CEST)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.west.internal (Postfix) with ESMTP id 60084320091E;
 Tue, 18 Jul 2023 07:07:15 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute5.internal (MEProxy); Tue, 18 Jul 2023 07:07:16 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 18 Jul 2023 07:07:11 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 41edb092-255b-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-transfer-encoding
	:content-type:date:date:from:from:in-reply-to:message-id
	:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t=
	1689678434; x=1689764834; bh=06VFn0AKXaUmDl0g9lGMmMwV0wNkTJc37cc
	SZ2ARUwc=; b=Nj/JcjwzUHuQv+4at+dqi0CnXtiR2xGlQTOcK0iCSuqTL4Vd/u+
	osEVS1+IWT+Bu6RgebydRctLMGyd45mPBgcDASBqVVS/xhy+W8sHvd2USHncBbBq
	hn0pu9b4MtO+VWKW2Uk1HY8MqlpSHN4Waf46vYwrEWBD7KiHu+CouAGP/NI2QQqs
	rQo5caR8CfKKi+x4kxHk5fbhNdhemXgCRFO0wg/0JRzPs5A8cY6h4T1GT4lHttj8
	pAeq90es7fNyxT84RF+iWBpXxjVKZH3+A8CU9ydiA+kZQUfXhes50ZRgSQb3rkS2
	pRZZyEC8c35r2QYtWZLntESBwhfhbEDdh8A==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-transfer-encoding
	:content-type:date:date:feedback-id:feedback-id:from:from
	:in-reply-to:message-id:mime-version:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1689678434; x=1689764834; bh=06VFn0AKXaUmD
	l0g9lGMmMwV0wNkTJc37ccSZ2ARUwc=; b=C5UhMlWSHsJsSU3QUHmeaMbZBw1hh
	hFXEHvyCTC6RAreynoI+74BiolCG6IBbCyGnIujJS2J44VtVqmKr8O0U0TEuRo8D
	dzIeIEO3ioA/KVMU+Aeqbu1Z9V0wPLiJhLGPr4BexIoA0INsKjq1p49rEgN+8BZ6
	0wFgGS0W/LDJ9gHdSP+twMLTmdikawRLDChc/yUfx29xzJbs1vdgZLAQ+AfoB79O
	tV5/0NJnNFkXb0umbbBZfqtBxxWA0bE5k5qZwjlAkADzh+dLOqS28JFfP0BK/iro
	C2hOpZzk8/YkBkzCYDZ7okivVfVLLM8OWh/peNR5RlToMHSXHPO+GOUog==
X-ME-Sender: <xms:YnK2ZHgDJfY8gDy8XH_MsaY2ZA1MCynPLhm_6vhhRfnAvK0y5IOhZw>
    <xme:YnK2ZEBmdpmYd9JFGzadDApaGJSVUW81Lnmh9_G1KDTl7uBprXZAhpMXcJ7ZdQDau
    Ti0-8DspTvFxtI>
X-ME-Received: <xmr:YnK2ZHFhp3Gnvc1tPB89X9v8qQQrRAZnGcY7HCnCaNd9X97E4E75zJtuGQ8>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgeeggdefhecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuihhmohhnucfi
    rghishgvrhcuoehsihhmohhnsehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh
    eqnecuggftrfgrthhtvghrnhepueevheegtdefgeefuddvfeduueduffffffejveeugeef
    udefiedugedugeevudfgnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhush
    htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsihhmohhnsehinhhv
    ihhsihgslhgvthhhihhnghhslhgrsgdrtghomh
X-ME-Proxy: <xmx:YnK2ZERv39zovWtIxiVDnI7-y0zKziDrF1dHp2QU38yEyfWFayU6CQ>
    <xmx:YnK2ZEw8DZCYcyM4AdjA1E12xRvpAyehD2DM8Tloe1kQOETxcjlJEQ>
    <xmx:YnK2ZK6QxTgjDWUL1j-WZXO0rr9vN-HvXeZaBWkvFQJIEteNuSH4EA>
    <xmx:YnK2ZOvl76B6zDWD_kR3cnyknJFEwHHK4v9v8zPogCOyF9H0nmpD0w>
Feedback-ID: idc5945a3:Fastmail
From: Simon Gaiser <simon@invisiblethingslab.com>
To: xen-devel@lists.xenproject.org
Cc: Simon Gaiser <simon@invisiblethingslab.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [RFC XEN PATCH] x86/mwait-idle: Use ACPI for CPUs without hardcoded C-state table
Date: Tue, 18 Jul 2023 13:04:53 +0200
Message-Id: <aef138a50aaa769fceb2002dd56de437f1b8c456.1689674757.git.simon@invisiblethingslab.com>
X-Mailer: git-send-email 2.40.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

mwait-idle includes a hardcoded config for many CPUs. But some are
missing, for example Tiger Lake. Linux' driver reads the config from
ACPI in those cases. This adds this to Xen's implementation.

The Linux driver also has a feature to combine the internal table with
the infos from ACPI. This is not implemented here, for CPUs with
internal config nothing is changed.

Signed-off-by: Simon Gaiser <simon@invisiblethingslab.com>
---

Sending this as RFC to get feedback on implementing it this way. I tried
to keep this change small and to avoid changing the existing code path
for CPUs with a config included in the driver. On the other hand this
makes it look a bit hacky.

I'm not quite sure if initializing mwait-idle in set_cx_pminfo this way
is correct. For example set_cx has some smp_wmb call I'm not sure when
it's needed, so might be very well missing something.

What also surprised me is that the existing code in mwait-idle first
calls cpuidle_current_governor->enable(processor_powers[cpu]) and later
setup the C-state config in processor_powers[cpu]. This seems the be the
wrong order (but, I think, current not important since
menu_enable_device doesn't use that part of the struct).

When I brought up the topic of this patch the first time Jan had an
interesting questions [1]:

> It hasn't become clear to me why Linux now has two CPU idle drivers
> consuming ACPI data (intel_idle and the purely ACPI-based one).

I'm not quite sure either. Linux' intel_idle.c states:

    intel_idle is a cpuidle driver that loads on all Intel CPUs with
    MWAIT in lieu of the legacy ACPI processor_idle driver.  The intent
    is to make Linux more efficient on these processors, as intel_idle
    knows more than ACPI, as well as make Linux more immune to ACPI BIOS
    bugs.

The commit that first added ACPI support to the Linux driver [2] says:

    The main functional difference between intel_idle with this change
    and the ACPI processor driver is that the former sets the target
    residency to be equal to the exit latency (provided by _CST) for
    C1-type C-states and to 3 times the exit latency value for the other
    C-state types, whereas the latter obtains the target residency by
    multiplying the exit latency by the same number (2 by default) for
    all C-state types.  Therefore it is expected that in general using
    the former instead of the latter on the same system will lead to
    improved energy-efficiency.

This sounds less impressive and doesn't explain why not to just change
the standard ACPI driver to use the better latency settings. On the
Linux what might play also a role is that the mwait driver also gained
the option to combine the internal settings with what it reads from
ACPI. That would be probably harder to include in the generic ACPI
driver.

This also raises the option to change the latency setting in Xen's
generic ACPI driver for the affected CPUs instead of touching
mwait-idle.

Currently I'm interested in this driver mainly for S0ix support. I did
nearly all my testing while using the mwait-idle driver to keep
differences to Linux as small as possible. (At first by hacking in some
config for the Tiger Lake CPU of my test system. Now with this patch.).
At some point I observed worse S0ix residency with Xen's generic ACPI
idle driver than with mwait-idle. But when I tried to reproduce this for
writing this e-mail I wasn't able to reproduce this measurement and got
the same residency for both idle drivers. So either I did messed up my
previous measurements or I have some unaccounted changes in my test
setup.

[1]: https://lore.kernel.org/xen-devel/f6c27788-bdd9-e5b1-a874-7f48a27c66a9@suse.com
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=18734958e9bfbc055805d110a38dc76307eba742

 xen/arch/x86/acpi/cpu_idle.c       |  58 +++++++++++-----
 xen/arch/x86/cpu/mwait-idle.c      | 108 ++++++++++++++++++++++++-----
 xen/arch/x86/include/asm/cpuidle.h |   2 +-
 3 files changed, 134 insertions(+), 34 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 427c8c89c5..0a357acc58 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -78,6 +78,7 @@
 static void cf_check lapic_timer_nop(void) { }
 void (*__read_mostly lapic_timer_off)(void);
 void (*__read_mostly lapic_timer_on)(void);
+static struct notifier_block cpu_nfb;
 
 bool lapic_timer_init(void)
 {
@@ -1313,6 +1314,26 @@ static void print_cx_pminfo(uint32_t cpu, struct xen_processor_power *power)
 #define print_cx_pminfo(c, p)
 #endif
 
+
+static void repark_cpu(int cpu_id)
+{
+    uint32_t apic_id = x86_cpu_to_apicid[cpu_id];
+
+    /*
+     * If we've just learned of more available C states, wake the CPU if
+     * it's parked, so it can go back to sleep in perhaps a deeper state.
+     */
+    if ( park_offline_cpus && apic_id != BAD_APICID )
+    {
+        unsigned long flags;
+
+        local_irq_save(flags);
+        apic_wait_icr_idle();
+        apic_icr_write(APIC_DM_NMI | APIC_DEST_PHYSICAL, apic_id);
+        local_irq_restore(flags);
+    }
+}
+
 long set_cx_pminfo(uint32_t acpi_id, struct xen_processor_power *power)
 {
     XEN_GUEST_HANDLE(xen_processor_cx_t) states;
@@ -1360,24 +1381,27 @@ long set_cx_pminfo(uint32_t acpi_id, struct xen_processor_power *power)
         set_cx(acpi_power, &xen_cx);
     }
 
-    if ( !cpu_online(cpu_id) )
-    {
-        uint32_t apic_id = x86_cpu_to_apicid[cpu_id];
-
-        /*
-         * If we've just learned of more available C states, wake the CPU if
-         * it's parked, so it can go back to sleep in perhaps a deeper state.
-         */
-        if ( park_offline_cpus && apic_id != BAD_APICID )
-        {
-            unsigned long flags;
-
-            local_irq_save(flags);
-            apic_wait_icr_idle();
-            apic_icr_write(APIC_DM_NMI | APIC_DEST_PHYSICAL, apic_id);
-            local_irq_restore(flags);
+    if ( cpu_id == 0 && pm_idle_save == NULL ) {
+        /* Now that we have the ACPI info from dom0, try again to setup
+         * mwait-idle*/
+        ret = mwait_idle_init(&cpu_nfb, true);
+        if (ret >= 0) {
+            unsigned int cpu;
+            /* mwait-idle took over, call it's initializer for all CPUs*/
+            for_each_present_cpu ( cpu )
+            {
+                cpu_nfb.notifier_call(&cpu_nfb, CPU_UP_PREPARE, (void *)(long)cpu);
+                cpu_nfb.notifier_call(&cpu_nfb, CPU_ONLINE, (void *)(long)cpu);
+                if ( !cpu_online(cpu) ) {
+                    repark_cpu(cpu);
+                }
+            }
+            return 0;
         }
     }
+
+    if ( !cpu_online(cpu_id) )
+        repark_cpu(cpu_id);
     else if ( cpuidle_current_governor->enable )
     {
         ret = cpuidle_current_governor->enable(acpi_power);
@@ -1677,7 +1701,7 @@ static int __init cf_check cpuidle_presmp_init(void)
     if ( !xen_cpuidle )
         return 0;
 
-    mwait_idle_init(&cpu_nfb);
+    mwait_idle_init(&cpu_nfb, false);
     cpu_nfb.notifier_call(&cpu_nfb, CPU_UP_PREPARE, cpu);
     cpu_nfb.notifier_call(&cpu_nfb, CPU_ONLINE, cpu);
     register_cpu_notifier(&cpu_nfb);
diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 9e981e7e26..df37224fd9 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -71,13 +71,15 @@
 #undef PREFIX
 #define PREFIX "mwait-idle: "
 
+#define pr_err(fmt...) printk(KERN_ERR fmt)
+
 #ifdef DEBUG
 # define pr_debug(fmt...) printk(KERN_DEBUG fmt)
 #else
 # define pr_debug(fmt...)
 #endif
 
-static __initdata bool opt_mwait_idle = true;
+static bool opt_mwait_idle = true;
 boolean_param("mwait-idle", opt_mwait_idle);
 
 static unsigned int mwait_substates;
@@ -92,7 +94,7 @@ static unsigned int mwait_substates;
  * exclusive C-states, this parameter has no effect.
  */
 static unsigned int __ro_after_init preferred_states_mask;
-static char __initdata preferred_states[64];
+static char preferred_states[64];
 string_param("preferred-cstates", preferred_states);
 
 #define LAPIC_TIMER_ALWAYS_RELIABLE 0xFFFFFFFF
@@ -1151,6 +1153,9 @@ static const struct idle_cpu idle_cpu_snr = {
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
+static struct idle_cpu __read_mostly idle_cpu_acpi = {
+};
+
 #define ICPU(model, cpu) \
 	{ X86_VENDOR_INTEL, 6, INTEL_FAM6_ ## model, X86_FEATURE_ALWAYS, \
 	  &idle_cpu_ ## cpu}
@@ -1436,21 +1441,92 @@ static void __init mwait_idle_state_table_update(void)
 	}
 }
 
-static int __init mwait_idle_probe(void)
+static int mwait_idle_state_table_from_acpi(void) {
+	// Linux tries every CPU until it finds one that declares FFH as entry
+	// method for all C-states in it's ACPI table. It assumes that the
+	// config is identical for all CPUs. So let's just check the first CPU.
+
+	int rc = -EINVAL;
+	struct acpi_processor_power *acpi_power = processor_powers[0];
+	struct cpuidle_state *state_table = xzalloc_array(
+			struct cpuidle_state,
+			acpi_power->count + 1 /* NULL at end */ - 1 /* no C0 */
+			);
+
+	if (state_table == NULL) {
+		pr_err(PREFIX "failed to allocate state table\n");
+		rc = -ENOMEM;
+		goto ret;
+	}
+
+	for (unsigned int cstate = 1; cstate < acpi_power->count; ++cstate) {
+		struct acpi_processor_cx *acpi_cx = &acpi_power->states[cstate];
+		struct cpuidle_state *idle_cx = &state_table[cstate - 1];
+		if (acpi_cx->entry_method != ACPI_CSTATE_EM_FFH) {
+			pr_debug(PREFIX "ACPI based config not usable: Entry method for C-state %u isn't FFH\n", cstate);
+			rc = -ENODEV;
+			goto ret;
+		}
+
+		snprintf(idle_cx->name, sizeof(idle_cx->name), "C%u", cstate);
+
+		idle_cx->flags = MWAIT2flg(acpi_cx->address);
+		if (acpi_cx->type > ACPI_STATE_C2)
+			idle_cx->flags |= CPUIDLE_FLAG_TLB_FLUSHED;
+		// Like Linux we don't set CPUIDLE_FLAG_IBRS
+
+		idle_cx->exit_latency = acpi_cx->latency;
+
+		idle_cx->target_residency = acpi_cx->latency;
+		if (acpi_cx->type > ACPI_STATE_C1)
+			idle_cx->target_residency *= 3;
+	}
+
+	idle_cpu_acpi.state_table = state_table;
+	rc = 0;
+	pr_debug(PREFIX "config read from ACPI\n");
+
+ret:
+	if (rc < 0 && state_table != NULL) {
+		xfree(state_table);
+	}
+	return rc;
+}
+
+static int mwait_idle_probe(bool from_acpi)
 {
 	unsigned int eax, ebx, ecx;
-	const struct x86_cpu_id *id = x86_match_cpu(intel_idle_ids);
 	const char *str;
 
-	if (!id) {
-		pr_debug(PREFIX "does not run on family %d model %d\n",
-			 boot_cpu_data.x86, boot_cpu_data.x86_model);
-		return -ENODEV;
-	}
+	if (from_acpi) {
+		int rc;
 
-	if (!boot_cpu_has(X86_FEATURE_MONITOR)) {
-		pr_debug(PREFIX "Please enable MWAIT in BIOS SETUP\n");
-		return -ENODEV;
+		if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL ||
+		    boot_cpu_data.x86 != 6 ||
+		    !boot_cpu_has(X86_FEATURE_MONITOR)) {
+			pr_debug(PREFIX "skipping ACPI check on unsupported CPU\n");
+			return -ENODEV;
+		}
+
+		rc = mwait_idle_state_table_from_acpi();
+		if (rc < 0)
+			return rc;
+
+		icpu = &idle_cpu_acpi;
+	} else {
+		const struct x86_cpu_id *id = x86_match_cpu(intel_idle_ids);
+		if (!id) {
+			pr_debug(PREFIX "no interal config for family %d model %d\n",
+				 boot_cpu_data.x86, boot_cpu_data.x86_model);
+			return -ENODEV;
+		}
+
+		if (!boot_cpu_has(X86_FEATURE_MONITOR)) {
+			pr_debug(PREFIX "Please enable MWAIT in BIOS SETUP\n");
+			return -ENODEV;
+		}
+
+		icpu = id->driver_data;
 	}
 
 	if (boot_cpu_data.cpuid_level < CPUID_MWAIT_LEAF)
@@ -1470,7 +1546,6 @@ static int __init mwait_idle_probe(void)
 
 	pr_debug(PREFIX "MWAIT substates: %#x\n", mwait_substates);
 
-	icpu = id->driver_data;
 	cpuidle_state_table = icpu->state_table;
 
 	if (boot_cpu_has(X86_FEATURE_ARAT))
@@ -1515,7 +1590,8 @@ static int __init mwait_idle_probe(void)
 	if (str[0])
 		printk("unrecognized \"preferred-cstates=%s\"\n", str);
 
-	mwait_idle_state_table_update();
+	if (!from_acpi)
+		mwait_idle_state_table_update();
 
 	return 0;
 }
@@ -1624,14 +1700,14 @@ static int cf_check mwait_idle_cpu_init(
 	return NOTIFY_DONE;
 }
 
-int __init mwait_idle_init(struct notifier_block *nfb)
+int mwait_idle_init(struct notifier_block *nfb, bool from_acpi)
 {
 	int err;
 
 	if (pm_idle_save)
 		return -ENODEV;
 
-	err = mwait_idle_probe();
+	err = mwait_idle_probe(from_acpi);
 	if (!err && !boot_cpu_has(X86_FEATURE_ARAT)) {
 		hpet_broadcast_init();
 		if (xen_cpuidle < 0 && !hpet_broadcast_is_available())
diff --git a/xen/arch/x86/include/asm/cpuidle.h b/xen/arch/x86/include/asm/cpuidle.h
index 3edd7a75d2..f8913c7304 100644
--- a/xen/arch/x86/include/asm/cpuidle.h
+++ b/xen/arch/x86/include/asm/cpuidle.h
@@ -15,7 +15,7 @@ extern void (*lapic_timer_on)(void);
 
 extern uint64_t (*cpuidle_get_tick)(void);
 
-int mwait_idle_init(struct notifier_block *);
+int mwait_idle_init(struct notifier_block *, bool);
 int cpuidle_init_cpu(unsigned int cpu);
 void cf_check default_dead_idle(void);
 void cf_check acpi_dead_idle(void);
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 11:15:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 11:15:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565124.882999 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLifH-0005CN-9Y; Tue, 18 Jul 2023 11:14:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565124.882999; Tue, 18 Jul 2023 11:14:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLifH-0005CG-6f; Tue, 18 Jul 2023 11:14:47 +0000
Received: by outflank-mailman (input) for mailman id 565124;
 Tue, 18 Jul 2023 11:14:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=agjq=DE=citrix.com=prvs=55665d270=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qLifG-0005CA-4z
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 11:14:46 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4b35763d-255c-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 13:14:44 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4b35763d-255c-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689678883;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:content-transfer-encoding:in-reply-to;
  bh=H0sf74qDQKrwVRyEDdS7iWnmtZ2Fml7U03kG8T2HpA4=;
  b=TJnEZcO92Rfd/9sSzuGV97cDqo4o+Pi6k9Jl8vcj0+dgayghf/k088KE
   GuS60YbTFUgXdzL8nq3LTxPXDBirMnUOpQ9ZWPZ8hHSOrjee4EgvIw5yb
   FKg/co+PoxYQ7M0QTnd3vHrb7LOrhBXotRE67VyNAp2IY00wSRp5MEgd4
   g=;
Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 119170195
X-Ironport-Server: esa4.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:bJHDEaowUg+HQosABIhtLhMHCBReBmILZRIvgKrLsJaIsI4StFCzt
 garIBmAaP3YNDahLop/PNmy8k5Uu5XXx9dqSAA4qSE2EC9EopuZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weBzilNVvrzGInqR5fGatgMdgKFb
 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo
 OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX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CUID: 9a23:/f50hmzp0dRGTrTnqO0tBgVEGpgcKHnh4E7UGG+qEyFPdp+ke1iprfY=
X-Talos-MUID: 9a23:tOw6TAW+jZwhfH7q/CDn3zVhEptN3/T0D2sAmK0vqvCvawUlbg==
X-IronPort-AV: E=Sophos;i="6.01,214,1684814400"; 
   d="scan'208";a="119170195"
Date: Tue, 18 Jul 2023 12:14:36 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
CC: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>, Juergen Gross
	<jgross@suse.com>
Subject: Re: [PATCH v2 3/6] libxl: introduce MSR data in libxl_cpuid_policy
Message-ID: <1571d2d1-0a5e-49e9-b2f2-84af65e2d0cf@perard>
References: <20230711092230.15408-1-roger.pau@citrix.com>
 <20230711092230.15408-4-roger.pau@citrix.com>
 <d7be70e8-611c-4f7d-a585-2a00b1513a92@perard>
 <ZLVR23KbddRHrC5z@MacBook-Air-de-Roger.local>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <ZLVR23KbddRHrC5z@MacBook-Air-de-Roger.local>

On Mon, Jul 17, 2023 at 04:36:11PM +0200, Roger Pau Monné wrote:
> On Wed, Jul 12, 2023 at 05:39:01PM +0100, Anthony PERARD wrote:
> > On Tue, Jul 11, 2023 at 11:22:27AM +0200, Roger Pau Monne wrote:
> > > Add a new array field to libxl_cpuid_policy in order to store the MSR
> > > policies.
> > > 
> > > Note that libxl_cpuid_policy_list_{copy,length,parse_json,gen_json}
> > > are not adjusted to deal with the new MSR array now part of
> > > libxl_cpuid_policy_list.
> > 
> > Why? Isn't this going to be an issue? Or maybe that going to be dealt
> > with in a future patch?
> 
> I'm unsure what's the point of those?  The CPUID/MSR data is passed as
> a migration stream record from the hypervisor, so I don't see much
> point into converting it into json.  It also seems quite complex, and
> can't likely we done without breaking (or adjusting) the current
> format.

I think this data is used when the machine reboots. I've only try to
edit the file "/var/lib/xen/userdata-d.*" and it change which cpu flags
where available in the machine after a reboot. You could maybe confirm
that when you change an msr value, it is actually conserved across
reboot.

> My plan was to leave this unimplemented and if someone is in
> interested in having the data in json they can as well implement it.
> 
> Would you be OK if I add a note to the commit message that
> implementing json marshalling is left to implement for interested
> parties?

My guess is, we will have to think of something and add the msr into
json, even if it's done in a separate patch.

Cheers,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 11:26:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 11:26:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565127.883009 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLiqV-0006qd-Ay; Tue, 18 Jul 2023 11:26:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565127.883009; Tue, 18 Jul 2023 11:26:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLiqV-0006qW-73; Tue, 18 Jul 2023 11:26:23 +0000
Received: by outflank-mailman (input) for mailman id 565127;
 Tue, 18 Jul 2023 11:26:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=agjq=DE=citrix.com=prvs=55665d270=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qLiqU-0006qA-LF
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 11:26:22 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id eac72130-255d-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 13:26:21 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eac72130-255d-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689679580;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:content-transfer-encoding:in-reply-to;
  bh=4gMrvFmGzJbbiK2O12iR5qtLnHaPJ/TowwpBPBFcl7k=;
  b=Qd44ieppTIJEEV5VHYYw+4bU3/0tutsE66wQEMbbHOmFrVgRGF5s3GBZ
   TMut8/QTgCemi/a/mlDWhK0tBiggyQgc2pxo67SEwKHkeAmXihM79MMTz
   xGnU9u+YsnqHMUqoMHhklW6vWRfTCxJVLk5fFXDNr8YirSLTZ4NIrPSMw
   M=;
Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 115285157
X-Ironport-Server: esa5.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:rVhEVaBrqwYyBBVW/zrjw5YqxClBgxIJ4kV8jS/XYbTApDkl1T1Vx
 msaWziHbqqMY2b1ed5+boS09UxUuZOEmINiQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h
 yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmY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DstV00zEX/kB9WHVpm6yj+v
 xG/c5rsCMc7Qx6ZJhOo7+90cW7L080lqQFg7X5X43DYOCOggLBQL2KhbGI/9SKIVycygcy78
 Zdm6gVMqyLMbB55/yKnTVRxbwbsaW6GKPDv5ag8590JzsaD52Jd21Ce36m+ksdfnggObMJUK
 Cyy+BgvDSadXEefq2AdwI4t7iqnaysqHr+CyR2fiIa1A==
X-Talos-CUID: =?us-ascii?q?9a23=3AUs1Vr2gpawr+TpdR7tujb8bNtjJudSbW6mXXIFC?=
 =?us-ascii?q?CBThCC6a6U1OS+KZWqp87?=
X-Talos-MUID: 9a23:cgQ81gqgLIiit6NHU5MezxhDP8R33LS1MV4muM82pNmfFgEuYTjI2Q==
X-IronPort-AV: E=Sophos;i="6.01,214,1684814400"; 
   d="scan'208";a="115285157"
Date: Tue, 18 Jul 2023 12:26:05 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
CC: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>, Juergen Gross
	<jgross@suse.com>
Subject: Re: [PATCH v2 6/6] libxl: add support for parsing MSR features
Message-ID: <d9671c90-b787-4839-9b6c-bd79a320d6a4@perard>
References: <20230711092230.15408-1-roger.pau@citrix.com>
 <20230711092230.15408-7-roger.pau@citrix.com>
 <48d5ca83-d14b-44e1-9431-5324118eacb7@perard>
 <ZLVUQdM3XtclUw5l@MacBook-Air-de-Roger.local>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <ZLVUQdM3XtclUw5l@MacBook-Air-de-Roger.local>

On Mon, Jul 17, 2023 at 04:46:25PM +0200, Roger Pau Monné wrote:
> On Thu, Jul 13, 2023 at 11:39:53AM +0100, Anthony PERARD wrote:
> > On Tue, Jul 11, 2023 at 11:22:30AM +0200, Roger Pau Monne wrote:
> > > diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
> > > index b1c4f8f2f45b..86a08f29a19c 100644
> > > --- a/tools/libs/light/libxl_cpuid.c
> > > +++ b/tools/libs/light/libxl_cpuid.c
> > > @@ -158,6 +158,57 @@ static int cpuid_add(libxl_cpuid_policy_list *policy,
> > >      return 0;
> > >  }
> > >  
> > > +static struct xc_msr *msr_find_match(libxl_cpuid_policy_list *pl, uint32_t index)
> > > +{
> > > +    unsigned int i = 0;
> > > +    libxl_cpuid_policy_list policy = *pl;
> > > +
> > > +    if (policy == NULL)
> > > +        policy = *pl = calloc(1, sizeof(*policy));
> > > +
> > > +    if (policy->msr != NULL)
> > > +        for (i = 0; policy->msr[i].index != XC_MSR_INPUT_UNUSED; i++)
> > 
> > Could you add { } for this two blocks? One line after a if() without { }
> > is ok, but not more.
> 
> Sure.
> 
> > > +            if (policy->msr[i].index == index)
> > > +                return &policy->msr[i];
> > > +
> > > +    policy->msr = realloc(policy->msr, sizeof(struct xc_msr) * (i + 2));
> > > +    policy->msr[i].index = index;
> > > +    memset(policy->msr[i].policy, 'x', ARRAY_SIZE(policy->msr[0].policy) - 1);
> > 
> > Is this "array_size() - 1" correct? The -1 need to go, right?
> > 
> > > +    policy->msr[i].policy[ARRAY_SIZE(policy->msr[0].policy) - 1] = '\0';
> > 
> > Is it for convenience? Maybe for easier debugging (printf)? Also, I
> > guess having a NUL at the end mean the -1 on the previous statement kind
> > of useful.
> 
> Yes, it's also to match the format of the policy string used by
> xc_xend_cpuid, which also has a terminating zero.
> 
> Are you OK with this?

Yes.

With the other style change done:
Acked-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 11:31:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 11:31:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565130.883019 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLivD-0008Ou-Ry; Tue, 18 Jul 2023 11:31:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565130.883019; Tue, 18 Jul 2023 11:31:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLivD-0008On-P5; Tue, 18 Jul 2023 11:31:15 +0000
Received: by outflank-mailman (input) for mailman id 565130;
 Tue, 18 Jul 2023 11:31:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLivC-0008Od-Vj; Tue, 18 Jul 2023 11:31:14 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLivC-0006bU-Nh; Tue, 18 Jul 2023 11:31:14 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLivC-0002dP-Ak; Tue, 18 Jul 2023 11:31:14 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLivC-0005Eo-A5; Tue, 18 Jul 2023 11:31:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=YYrY3WuZgJIMnVU9n+Q2rPw0G8pg9+LEib7h2N8Vt5Y=; b=MNBv9HdeV58Lht8HE6uAW3mSY+
	V44eXxc7l1XfMsOfMw1cENZkMZ7vC8so6ATRBUXdJ7Xh9qXS92ryijvXWJEm/tepW24TOXm6ibxk7
	AYW3oRqKUELbxN/bZnrYm02UzJ37JWrQkRD6Eh9eGW/rcXN/zIqJq5kIA0boOnnsaDZs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181846-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181846: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-examine-uefi:xen-install:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qcow2:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-amd64-i386-xl-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=813da5f0e73b8cbd2ac3c7922506e58c28cd736d
X-Osstest-Versions-That:
    xen=d27d274ffab06b42e5680073db11b592d282d53d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 18 Jul 2023 11:31:14 +0000

flight 181846 xen-unstable real [real]
flight 181871 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181846/
http://logs.test-lab.xenproject.org/osstest/logs/181871/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-examine-uefi  6 xen-install         fail pass in 181871-retest
 test-amd64-amd64-xl-qcow2 21 guest-start/debian.repeat fail pass in 181871-retest
 test-amd64-i386-xl-vhd 21 guest-start/debian.repeat fail pass in 181871-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181810
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181810
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181810
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181810
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181810
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181810
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181810
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181810
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181810
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181810
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181810
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181810
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 xen                  813da5f0e73b8cbd2ac3c7922506e58c28cd736d
baseline version:
 xen                  d27d274ffab06b42e5680073db11b592d282d53d

Last test of basis   181810  2023-07-15 06:34:58 Z    3 days
Testing same since   181846  2023-07-17 13:46:51 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Federico Serafini <federico.serafini@bugseng.com>
  Gianluca Luparini <gianluca.luparini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>
  Simone Ballarin <simone.ballarin@bugseng.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    fail    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 fail    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   d27d274ffa..813da5f0e7  813da5f0e73b8cbd2ac3c7922506e58c28cd736d -> master


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 11:31:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 11:31:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565133.883029 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLivO-0000Gc-96; Tue, 18 Jul 2023 11:31:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565133.883029; Tue, 18 Jul 2023 11:31:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLivO-0000GV-6D; Tue, 18 Jul 2023 11:31:26 +0000
Received: by outflank-mailman (input) for mailman id 565133;
 Tue, 18 Jul 2023 11:31:24 +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
 <SRS0=cfKK=DE=arm.com=rahul.singh@srs-se1.protection.inumbo.net>)
 id 1qLivM-0000Ff-Q0
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 11:31:24 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTP
 id 9e06d8a1-255e-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 13:31:20 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6A9852F4;
 Tue, 18 Jul 2023 04:32:03 -0700 (PDT)
Received: from e109506.cambridge.arm.com (e109506.cambridge.arm.com
 [10.1.199.62])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B14773F6C4;
 Tue, 18 Jul 2023 04:31:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9e06d8a1-255e-11ee-8611-37d641c3527e
From: Rahul Singh <rahul.singh@arm.com>
To: xen-devel@lists.xenproject.org,
	linux-kernel@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Jane Malalane <jane.malalane@citrix.com>
Subject: [PATCH v3] xen/evtchn: Introduce new IOCTL to bind static evtchn
Date: Tue, 18 Jul 2023 12:31:07 +0100
Message-Id: <ae7329bf1713f83e4aad4f3fa0f316258c40a3e9.1689677042.git.rahul.singh@arm.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Xen 4.17 supportsÂ the creation of static evtchns. To allow user space
application to bind static evtchns introduce new ioctl
"IOCTL_EVTCHN_BIND_STATIC". Existing IOCTL doing more than binding
thatâ€™s why we need to introduce the new IOCTL to only bind the static
event channels.

Static evtchns to be available for use during the lifetime of the
guest. When the application exits, __unbind_from_irq() ends up being
called from release() file operations because of that static evtchns
are getting closed. To avoid closing the static event channel, add the
new bool variable "is_static" in "struct irq_info" to mark the event
channel static when creating the event channel to avoid closing the
static evtchn.

Also, take this opportunity to remove the open-coded version of the
evtchn close in drivers/xen/evtchn.c file and use xen_evtchn_close().

Signed-off-by: Rahul Singh <rahul.singh@arm.com>
---
v3:
 * Remove the open-coded version of the evtchn close in drivers/xen/evtchn.c
v2:
 * Use bool in place u8 to define is_static variable.
 * Avoid closing the static evtchns in error path.
---
 drivers/xen/events/events_base.c | 16 +++++----------
 drivers/xen/evtchn.c             | 35 ++++++++++++++++++++++++--------
 include/uapi/xen/evtchn.h        |  9 ++++++++
 include/xen/events.h             | 11 +++++++++-
 4 files changed, 50 insertions(+), 21 deletions(-)

diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index c7715f8bd452..3bdd5b59661d 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -112,6 +112,7 @@ struct irq_info {
 	unsigned int irq_epoch; /* If eoi_cpu valid: irq_epoch of event */
 	u64 eoi_time;           /* Time in jiffies when to EOI. */
 	raw_spinlock_t lock;
+	bool is_static;           /* Is event channel static */
 
 	union {
 		unsigned short virq;
@@ -815,15 +816,6 @@ static void xen_free_irq(unsigned irq)
 	irq_free_desc(irq);
 }
 
-static void xen_evtchn_close(evtchn_port_t port)
-{
-	struct evtchn_close close;
-
-	close.port = port;
-	if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close) != 0)
-		BUG();
-}
-
 /* Not called for lateeoi events. */
 static void event_handler_exit(struct irq_info *info)
 {
@@ -982,7 +974,8 @@ static void __unbind_from_irq(unsigned int irq)
 		unsigned int cpu = cpu_from_irq(irq);
 		struct xenbus_device *dev;
 
-		xen_evtchn_close(evtchn);
+		if (!info->is_static)
+			xen_evtchn_close(evtchn);
 
 		switch (type_from_irq(irq)) {
 		case IRQT_VIRQ:
@@ -1574,7 +1567,7 @@ int xen_set_irq_priority(unsigned irq, unsigned priority)
 }
 EXPORT_SYMBOL_GPL(xen_set_irq_priority);
 
-int evtchn_make_refcounted(evtchn_port_t evtchn)
+int evtchn_make_refcounted(evtchn_port_t evtchn, bool is_static)
 {
 	int irq = get_evtchn_to_irq(evtchn);
 	struct irq_info *info;
@@ -1590,6 +1583,7 @@ int evtchn_make_refcounted(evtchn_port_t evtchn)
 	WARN_ON(info->refcnt != -1);
 
 	info->refcnt = 1;
+	info->is_static = is_static;
 
 	return 0;
 }
diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c
index c99415a70051..9139a7364df5 100644
--- a/drivers/xen/evtchn.c
+++ b/drivers/xen/evtchn.c
@@ -366,10 +366,10 @@ static int evtchn_resize_ring(struct per_user_data *u)
 	return 0;
 }
 
-static int evtchn_bind_to_user(struct per_user_data *u, evtchn_port_t port)
+static int evtchn_bind_to_user(struct per_user_data *u, evtchn_port_t port,
+			       bool is_static)
 {
 	struct user_evtchn *evtchn;
-	struct evtchn_close close;
 	int rc = 0;
 
 	/*
@@ -402,14 +402,14 @@ static int evtchn_bind_to_user(struct per_user_data *u, evtchn_port_t port)
 	if (rc < 0)
 		goto err;
 
-	rc = evtchn_make_refcounted(port);
+	rc = evtchn_make_refcounted(port, is_static);
 	return rc;
 
 err:
 	/* bind failed, should close the port now */
-	close.port = port;
-	if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close) != 0)
-		BUG();
+	if (!is_static)
+		xen_evtchn_close(port);
+
 	del_evtchn(u, evtchn);
 	return rc;
 }
@@ -456,7 +456,7 @@ static long evtchn_ioctl(struct file *file,
 		if (rc != 0)
 			break;
 
-		rc = evtchn_bind_to_user(u, bind_virq.port);
+		rc = evtchn_bind_to_user(u, bind_virq.port, false);
 		if (rc == 0)
 			rc = bind_virq.port;
 		break;
@@ -482,7 +482,7 @@ static long evtchn_ioctl(struct file *file,
 		if (rc != 0)
 			break;
 
-		rc = evtchn_bind_to_user(u, bind_interdomain.local_port);
+		rc = evtchn_bind_to_user(u, bind_interdomain.local_port, false);
 		if (rc == 0)
 			rc = bind_interdomain.local_port;
 		break;
@@ -507,7 +507,7 @@ static long evtchn_ioctl(struct file *file,
 		if (rc != 0)
 			break;
 
-		rc = evtchn_bind_to_user(u, alloc_unbound.port);
+		rc = evtchn_bind_to_user(u, alloc_unbound.port, false);
 		if (rc == 0)
 			rc = alloc_unbound.port;
 		break;
@@ -536,6 +536,23 @@ static long evtchn_ioctl(struct file *file,
 		break;
 	}
 
+	case IOCTL_EVTCHN_BIND_STATIC: {
+		struct ioctl_evtchn_bind bind;
+		struct user_evtchn *evtchn;
+
+		rc = -EFAULT;
+		if (copy_from_user(&bind, uarg, sizeof(bind)))
+			break;
+
+		rc = -EISCONN;
+		evtchn = find_evtchn(u, bind.port);
+		if (evtchn)
+			break;
+
+		rc = evtchn_bind_to_user(u, bind.port, true);
+		break;
+	}
+
 	case IOCTL_EVTCHN_NOTIFY: {
 		struct ioctl_evtchn_notify notify;
 		struct user_evtchn *evtchn;
diff --git a/include/uapi/xen/evtchn.h b/include/uapi/xen/evtchn.h
index 7fbf732f168f..aef2b75f3413 100644
--- a/include/uapi/xen/evtchn.h
+++ b/include/uapi/xen/evtchn.h
@@ -101,4 +101,13 @@ struct ioctl_evtchn_restrict_domid {
 	domid_t domid;
 };
 
+/*
+ * Bind statically allocated @port.
+ */
+#define IOCTL_EVTCHN_BIND_STATIC			\
+	_IOC(_IOC_NONE, 'E', 7, sizeof(struct ioctl_evtchn_bind))
+struct ioctl_evtchn_bind {
+	unsigned int port;
+};
+
 #endif /* __LINUX_PUBLIC_EVTCHN_H__ */
diff --git a/include/xen/events.h b/include/xen/events.h
index ac1281c5ead6..95970a2f7695 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -69,7 +69,7 @@ int xen_set_irq_priority(unsigned irq, unsigned priority);
 /*
  * Allow extra references to event channels exposed to userspace by evtchn
  */
-int evtchn_make_refcounted(evtchn_port_t evtchn);
+int evtchn_make_refcounted(evtchn_port_t evtchn, bool is_static);
 int evtchn_get(evtchn_port_t evtchn);
 void evtchn_put(evtchn_port_t evtchn);
 
@@ -141,4 +141,13 @@ void xen_init_IRQ(void);
 
 irqreturn_t xen_debug_interrupt(int irq, void *dev_id);
 
+static inline void xen_evtchn_close(evtchn_port_t port)
+{
+	struct evtchn_close close;
+
+	close.port = port;
+	if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close) != 0)
+		BUG();
+}
+
 #endif	/* _XEN_EVENTS_H */

base-commit: fdf0eaf11452d72945af31804e2a1048ee1b574c
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 12:27:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 12:27:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565159.883050 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLjnH-0006ww-Jy; Tue, 18 Jul 2023 12:27:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565159.883050; Tue, 18 Jul 2023 12:27:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLjnH-0006wp-HJ; Tue, 18 Jul 2023 12:27:07 +0000
Received: by outflank-mailman (input) for mailman id 565159;
 Tue, 18 Jul 2023 12:27:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ju50=DE=invisiblethingslab.com=simon@srs-se1.protection.inumbo.net>)
 id 1qLjnG-0006wj-HX
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 12:27:06 +0000
Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com
 [66.111.4.29]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 664f7fa7-2566-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 14:27:04 +0200 (CEST)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.nyi.internal (Postfix) with ESMTP id 8A5DC5C00C6;
 Tue, 18 Jul 2023 08:27:02 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute5.internal (MEProxy); Tue, 18 Jul 2023 08:27:02 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 18 Jul 2023 08:26:59 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 664f7fa7-2566-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-transfer-encoding
	:content-type:date:date:from:from:in-reply-to:message-id
	:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t=
	1689683222; x=1689769622; bh=YFBvQZCZXCQyk2yAL1JH/rTyKUf8cV2OMD+
	8hmUkdlQ=; b=Aflh+P7clq66lTjzWw9Oo8vcgXT3/af615rCFyDTtn5bb8baq/M
	fhfAVHRnHHiQsTJlFdEDVHa1+UyWuzuD7G/Rd5lgsW3Bne6JOHR3uOHpYMlu9IeG
	65Xw+nfLd9Jmu2s/azXxCfWk0iyruOMkfo70ZZKpEnu2ur9bE1gA/KFsFpMhc96M
	MOihjeSdPbDt1ZGoHHE/NPEHHAGsU1c7hnTdTr3XRLadZT6OLFs8Q058VRqien4f
	Ty92sXypNQEOUJLak+T1S2h47+V5a9HT/VJvpZ1MmvsMn+hZXVwR7xzQdhml2MNb
	TlNv+VoE4cfl4HhnTlwocfMgSm99rfpITgA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-transfer-encoding
	:content-type:date:date:feedback-id:feedback-id:from:from
	:in-reply-to:message-id:mime-version:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1689683222; x=1689769622; bh=YFBvQZCZXCQyk
	2yAL1JH/rTyKUf8cV2OMD+8hmUkdlQ=; b=GeVNPjjizJWJzsykU/cF+9CIO/Fqa
	h0aWzeipnw7r22d7pryObNc8mVEYE1DrhkLrJ/nVNsTndIekCkJJKgjk4oRStu7P
	9/WOtrzivTdNUIdth5ZwKaioSGQqQ2BK/9zTxATMZR4o+WIKErVkMZQNyr4JjGAw
	Wj+25YGRo+IMUFms0LN6ZzscpuQQ/nY7p67FqwKxfkwkoTSUdjwenld69S7AGpLg
	Gvh+ut6gTuPBzRQ7isxzDKcx481L/W8ptwa9VuXlrwDuMH9+jt0WJK1MbhUUcgyi
	fHIBA3p8l/m/IY3+DnqAMZI7JMSmXD6Wh0suwweR0jLYx13ThnblPaUaQ==
X-ME-Sender: <xms:FoW2ZD1FJLppeHAPtk1MVXf1waoyeWnlNwdFkM7EEibGrqQijZuDGw>
    <xme:FoW2ZCFl2NlijkNKk7xqspq4WlHIs0U-3E8fkDhAlSypfULL06z_0V9W0Nu6vTAFq
    XqtI3keikByB0o>
X-ME-Received: <xmr:FoW2ZD4Ny_tvcjn45EiXG4ek-4kmzmepy8Pk5yQyBnH2S-mTMxW390tu1ogZ8AAheBTU8_5GcQsJhg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgeeggdehtdcutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuihhmohhnucfi
    rghishgvrhcuoehsihhmohhnsehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh
    eqnecuggftrfgrthhtvghrnhepueevheegtdefgeefuddvfeduueduffffffejveeugeef
    udefiedugedugeevudfgnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhush
    htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsihhmohhnsehinhhv
    ihhsihgslhgvthhhihhnghhslhgrsgdrtghomh
X-ME-Proxy: <xmx:FoW2ZI3DZeEYEX6az0oa8YWM8luF-ddw5VAdDwKisJR42N3e2Pu4Cg>
    <xmx:FoW2ZGG1RC52G09QXZOPnbrMKBBgmlM3q1kMIIVN0AhKQ1O0L2bviw>
    <xmx:FoW2ZJ_8iEIU_jRct9Q6Jnj5Uapal-DmFHEq2-1Wm-PZS-IMk7_Biw>
    <xmx:FoW2ZChYMnoByX7mzTD6jq9eGWSV4chd2d1R1q0glITJx57SYlVvjw>
Feedback-ID: idc5945a3:Fastmail
From: Simon Gaiser <simon@invisiblethingslab.com>
To: xen-devel@lists.xenproject.org
Cc: Simon Gaiser <simon@invisiblethingslab.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [XEN PATCH] x86/hpet: Disable legacy replacement mode after IRQ test if not needed
Date: Tue, 18 Jul 2023 14:26:03 +0200
Message-Id: <20230718122603.2002-1-simon@invisiblethingslab.com>
X-Mailer: git-send-email 2.40.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As far as I understand the HPET legacy mode is not required on systems
with ARAT after the timer IRQ test. For previous discussion see [1].
Keeping it enabled prevents reaching S0ix residency.

Link: https://lore.kernel.org/xen-devel/cb408368-077d-edb5-b4ad-f80086db48c1@invisiblethingslab.com/ # [1]
Signed-off-by: Simon Gaiser <simon@invisiblethingslab.com>
---
 xen/arch/x86/io_apic.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 9b8a972cf5..ea98d717d0 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1966,6 +1966,10 @@ static void __init check_timer(void)
 
             if ( timer_irq_works() )
             {
+                if ( boot_cpu_has(X86_FEATURE_ARAT) ) {
+                    printk(XENLOG_INFO "IRQ test with HPET Legacy Replacement Mode worked. Disabling it again.\n");
+                    hpet_disable_legacy_replacement_mode();
+                }
                 local_irq_restore(flags);
                 return;
             }
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 12:28:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 12:28:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565157.883060 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLjoj-0007c6-UD; Tue, 18 Jul 2023 12:28:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565157.883060; Tue, 18 Jul 2023 12:28:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLjoj-0007bz-Ra; Tue, 18 Jul 2023 12:28:37 +0000
Received: by outflank-mailman (input) for mailman id 565157;
 Tue, 18 Jul 2023 12:26:24 +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
 <SRS0=sJ2J=DE=mediatek.com=yang.xu@srs-se1.protection.inumbo.net>)
 id 1qLjmZ-0006w6-Tc
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 12:26:24 +0000
Received: from mailgw02.mediatek.com (unknown [210.61.82.184])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4a151a28-2566-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 14:26:19 +0200 (CEST)
Received: from mtkmbs14n2.mediatek.inc [(172.21.101.76)] by
 mailgw02.mediatek.com (envelope-from <yang.xu@mediatek.com>)
 (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256)
 with ESMTP id 279153221; Tue, 18 Jul 2023 20:26:09 +0800
Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by
 mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.2.1118.26; Tue, 18 Jul 2023 20:26:08 +0800
Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by
 mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id
 15.2.1118.26 via Frontend Transport; Tue, 18 Jul 2023 20:26:08 +0800
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4a151a28-2566-11ee-8611-37d641c3527e
X-UUID: 46b03d28256611eeb20a276fd37b9834-20230718
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk;
	h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=ulPwwsf65Hc4Ar5APFwltWA1+P9Wk9qu3MwmPW4ZbME=;
	b=LGCmYrk9h//PIFtlaNaLW98fNCMrJLT9ypoNzhN9WwHckJgmZfcF7fHW6CMkkIgvvBYbH1xU3rFCvOQ04tuvQ1I6BnrTzH0oFJBXsJbq4LAOJMDu3olKXow3MynhYD8oXeCaiG2JEDKQvb+zoiRhKbLuMkfY74kL+rTSPE4JzRc=;
X-CID-UNFAMILIAR: 1
X-CID-P-RULE: Release_Ham
X-CID-O-INFO: VERSION:1.1.28,REQID:832639cd-3b0e-41f2-a4e4-3c6c07a41fa2,IP:0,U
	RL:0,TC:0,Content:0,EDM:0,RT:0,SF:59,FILE:0,BULK:0,RULE:Release_Ham,ACTION
	:release,TS:59
X-CID-INFO: VERSION:1.1.28,REQID:832639cd-3b0e-41f2-a4e4-3c6c07a41fa2,IP:0,URL
	:0,TC:0,Content:0,EDM:0,RT:0,SF:59,FILE:0,BULK:0,RULE:Release_HamU,ACTION:
	release,TS:59
X-CID-META: VersionHash:176cd25,CLOUDID:d9f5bbdc-dc79-4898-9235-1134b97257a8,B
	ulkID:230718202612VD7TQ9MQ,BulkQuantity:0,Recheck:0,SF:16|19|48|101|29|28|
	100|102,TC:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:
	nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0
X-CID-BVR: 0,NGT
X-CID-BAS: 0,NGT,0,_
X-CID-FACTOR: TF_CID_SPAM_SDM,TF_CID_SPAM_USA,TF_CID_SPAM_FSD,TF_CID_SPAM_SNR
X-UUID: 46b03d28256611eeb20a276fd37b9834-20230718
From: <yang.xu@mediatek.com>
To: <xen-devel@lists.xenproject.org>
CC: Yang Xu <yang.xu@mediatek.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH] docs/misc: fix document typo
Date: Tue, 18 Jul 2023 12:25:29 +0000
Message-ID: <20230718122529.19912-1-yang.xu@mediatek.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-MTK: N

From: Yang Xu <yang.xu@mediatek.com>

Fix document typo for more accurate meaning

Signed-off-by: Yang Xu <yang.xu@mediatek.com>
---
 docs/misc/xen-makefiles/makefiles.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/misc/xen-makefiles/makefiles.rst b/docs/misc/xen-makefiles/makefiles.rst
index 04bc72601c..bc2f932fbc 100644
--- a/docs/misc/xen-makefiles/makefiles.rst
+++ b/docs/misc/xen-makefiles/makefiles.rst
@@ -68,7 +68,7 @@ Descending down in directories
 
 	It is good practice to use a `CONFIG_` variable when assigning directory
 	names. This allows the build system to totally skip the directory if the
-	corresponding `CONFIG_` option is 'y'.
+	corresponding `CONFIG_` option is not set to 'y'.
 
 Compilation flags
 -----------------
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 12:28:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 12:28:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565166.883071 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLjot-0007tL-54; Tue, 18 Jul 2023 12:28:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565166.883071; Tue, 18 Jul 2023 12:28:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLjot-0007tC-2D; Tue, 18 Jul 2023 12:28:47 +0000
Received: by outflank-mailman (input) for mailman id 565166;
 Tue, 18 Jul 2023 12:28:45 +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 <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLjor-0007sb-6T
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 12:28:45 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20631.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::631])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a1d75d80-2566-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 14:28:43 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM7PR04MB6824.eurprd04.prod.outlook.com (2603:10a6:20b:10e::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Tue, 18 Jul
 2023 12:28:40 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 12:28:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a1d75d80-2566-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=S0xJj81S/j8On/MwJ7FfTXURIHQziS38iCRVPTZnBO2SUm9xbuTOEEqH/kM1odAbhlNuSrkuEkz7QKq1w1m9Kab/OPIFXeEPCIWKwVhRdM2r6BXxFTnEkIbxk94/AxFvDKFjEZMmgI9kC+g+RHVc/1hdwXlHjdux75B6p8aGFWfSL5x9WAz28MTzQzS016mqq6pWYuYOPSS8+hU5krDHArQovM/tVdv9jfucYhya08DWpFrku0yGbt5vvbVcGhkm+cLrNVi9aOJjep8BQprLwqKC5aJdaSLrdO4Tgg7cK71xFvsajii5pXlUhCZOuYN9q97mmckn6hD+FVh9oeI+gA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=E8bPWAHfb+LPyIbI/ckJfh9FRrzz4ViytW7wCxnj1PM=;
 b=d3hDoItIc84Gevsc+qmzzXOCSn9nCq06KY2kbJP3BbBKzYUdUwKcJNE7r310qlU+Oa3hKDPtcoYo4Y8t26ciaLFmQ3zhTIcyKp3sZXXtybab6xdYX+Aw0Cf7RHu2HNMECuiZi7PbeVjMp8D/bEh+EgxUo/0u36XjVegc+kit2x20WGmnt6kCzp7Fg6cGUFcuxW2vakNtg8CCYCz5UvQwDp3HnfzJnbX1/S/Be5OyCZDcKk3t98hzuTsubT0cldSbnkeZ8Jhmh4QtlPCOw8M/8+j5KMF/rg5G/FfqiDWMfNVJGBfev8P6bzwitouVqUaRThhW3czaqqLNgRety0I5lA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=E8bPWAHfb+LPyIbI/ckJfh9FRrzz4ViytW7wCxnj1PM=;
 b=ipD90Nn+nowQUi11pGBY6Q1OAi64BfWAo2gyCvO6YraQlscYfpizTV4l83DuZQM04389ULwnNr2o0HTtWPFPlZtxIiJ23etX4T7C3DW2+c/vYxz1D4tK+IChQXIAA6FYPfIiRlR/XLsiOetB2Xf2wm0k2gojaWojYxfgZCRAecPFtj+Wz1bbuP4jRulJ90JlaGSYrzu0loaYZw2Yp6SdAdt5t+1KyQfJbwLrp+QQyerHDa3GUaUWWe/rOIEmcTJRtSLgs1uaCYC5bxiC/S/MOwM7zPmVZkj1othT2f0Rk+veYkisNQw8V3TeP6bcH+NNrcp0KSnxzPeB1P2qjpUd+Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <39bc9028-cd1b-8dab-f575-8de791414a3c@suse.com>
Date: Tue, 18 Jul 2023 14:28:38 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 9/8] common: honor CONFIG_CC_SPLIT_SECTIONS also for
 assembly functions
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Bobby Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
 <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
 <a84dec51-bad1-bb36-9be9-fbf343987e11@suse.com>
In-Reply-To: <a84dec51-bad1-bb36-9be9-fbf343987e11@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0064.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:93::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM7PR04MB6824:EE_
X-MS-Office365-Filtering-Correlation-Id: c9af9bec-47d3-475f-0130-08db878a84ad
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	bgIrpzHL02E/MBXjJU9OAPh/NpPzl6OtmrdGqRbtzyWz895VxGeZR22m5m0nZw4ewRqAJ+8es/twSu1Wx6rmMtxag3WenOHZ1b1z/Amjw4PS0qTJjrA6FLlinQke4wsmenwPQ2+67Ns9pUFuUBgi47Wq8lmP8gKqzRQ7TRmPZDn3PrSEEG1lPZStzpUb1ZZIHFhV4VcqJUeGMWdkoAFrQedSOqv+KFCF8+YmuhQprx6WfmVghhz+xG0zUfn3D8vdIc55n2Ucj1HOyrbzvi7BMoMT2BXJm/8nFY6G205+JnzDeXAio89HFHDAcVY6fOw/FLAGi7m+vHeTkRywrZv70j/2MWsGYieg+RQfVrorK0ti+witqgRabEHRs4ngqkNiiRH4GSbk6aCxqUVY1Rh/54WAFaocETxVFXLXgvM07Epv6x5UdzBt9XZJBHmV5id1uJol09yNlpkFHzPFT18D/Db+HR+HCdiNJz9jGVH4d+k4sXKwkoQT34xJpYUG7FkFiDv+SkDAZqjE1aTAMb+3veYW8LQ8BY5w7s5+H8eLKURPIg+1uccFgbWzHRDvHyhNFxfBO94X5TuBty/4jn4c/WMTkTKMsW7kWBwmQfcMWXWdRaJ1n3NWGWliRNrQsFwfafxEWL3LBiQMfURwRpPSGg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(376002)(366004)(39860400002)(136003)(451199021)(478600001)(26005)(6506007)(53546011)(6512007)(6486002)(8676002)(8936002)(83380400001)(7416002)(5660300002)(2616005)(316002)(4326008)(6916009)(41300700001)(86362001)(31696002)(2906002)(31686004)(186003)(38100700002)(36756003)(66946007)(54906003)(66556008)(66476007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?OGVNNGRIRkVzTmFUa09EOXVaL1lpK3ZSR3ZJSy9Ib3pKVlgzOFNST2QrVVhs?=
 =?utf-8?B?YXJ4Qm41VnpkVk54YUZ4am5jSlpaekZndUQ0YkV4aFdoek5lRHFLeTRGN3Y4?=
 =?utf-8?B?UHoySFluSUluZ0Z2bi9uOFd1cVBMeUVUZ25CM1haRFVFYkRVV0VZcFQ2NXZi?=
 =?utf-8?B?TVNYRDcyWSswRGlJSkJkYXJmMVdYODZaQ3piU3liaytnM2FuVThpODZqN3VP?=
 =?utf-8?B?SC9NNEptOW9nZk9xanY1UUdrcDhOOXgrUXRDS3NkZ0Y2UXpKMHNJdHluc2xv?=
 =?utf-8?B?OVJmNU9rbnBPNC9rcGV0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 =?utf-8?B?RXExK2RzTUpzc2s2cnBHVG5veFJCSTkxN2NjTDlTVW9zaGRpdmNKR2ZiclFK?=
 =?utf-8?Q?NXOeU6HYP1jrD3tsyOYRy5Lzx?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c9af9bec-47d3-475f-0130-08db878a84ad
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 12:28:40.6785
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: g5zNXaLFpA+q7P8Zak+GfG/pB9j251v+6Tird2z7SXW2vmZzqJp+taeKA/6fAsG7xd1UPI5f9iycSpMruQlT3A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6824

On 17.07.2023 16:18, Jan Beulich wrote:
> Leverage the new infrastructure in xen/linkage.h to also switch to per-
> function sections (when configured), deriving the specific name from the
> "base" section in use at the time FUNC() is invoked.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

This additional change

--- a/Config.mk
+++ b/Config.mk
@@ -115,7 +115,7 @@ cc-option = $(shell if test -z "`echo 'v
 # Usage: $(call cc-option-add CFLAGS,CC,-march=winchip-c6)
 cc-option-add = $(eval $(call cc-option-add-closure,$(1),$(2),$(3)))
 define cc-option-add-closure
-    ifneq ($$(call cc-option,$$($(2)),$(3),n),n)
+    ifneq ($$(call cc-option,$$($(2)),$(firstword $(3)),n),n)
         $(1) += $(3)
     endif
 endef

is needed for ...

> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -399,6 +399,9 @@ AFLAGS += -D__ASSEMBLY__
>  
>  $(call cc-option-add,AFLAGS,CC,-Wa$(comma)--noexecstack)
>  
> +# Check to see whether the assmbler supports the --sectname-subst option.
> +$(call cc-option-add,AFLAGS,CC,-Wa$$(comma)--sectname-subst -DHAVE_AS_SECTNAME_SUBST)

... the pair of options passed in one go here to work (when old
gas is in use). Of course something with the same overall effect,
but less impactful might do. E.g. $(filter-out -D%,$(3)) instead
of $(firstword (3)). Thoughts anyone?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 12:44:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 12:44:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565175.883081 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLk3l-0002Ip-Gp; Tue, 18 Jul 2023 12:44:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565175.883081; Tue, 18 Jul 2023 12:44:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLk3l-0002Ii-DA; Tue, 18 Jul 2023 12:44:09 +0000
Received: by outflank-mailman (input) for mailman id 565175;
 Tue, 18 Jul 2023 12:44:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=c9jt=DE=citrix.com=prvs=5561f9d71=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qLk3j-0002IO-Gl
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 12:44:07 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c6cd3c83-2568-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 14:44:05 +0200 (CEST)
Received: from mail-mw2nam04lp2173.outbound.protection.outlook.com (HELO
 NAM04-MW2-obe.outbound.protection.outlook.com) ([104.47.73.173])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 18 Jul 2023 08:44:02 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by CH2PR03MB5317.namprd03.prod.outlook.com (2603:10b6:610:9c::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Tue, 18 Jul
 2023 12:44:00 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 12:44:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c6cd3c83-2568-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689684245;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=fcX1i0yf1nk6ewWn6P+aoOiC71E0Ma4dunC5WfGx96k=;
  b=MvFe/c78IKY6NWpvwwK6XYsaoR5Vx3NficYxOpDMXWX45AGINu1ZgIfh
   rHH4gKvYpF6Z+FVLEJsNfRSqeUWzaYYxM6y9W15sHmcJqDX4Qp44DhT+x
   nZ7qe5TchMhICDOFU9DTFoxN42+OXG+THR++n81R+fDvKp+ANVH/cY9kJ
   4=;
X-IronPort-RemoteIP: 104.47.73.173
X-IronPort-MID: 116465646
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:fqpdqqsqGRIxIrdJrY+KbNXcEOfnVHBfMUV32f8akzHdYApBsoF/q
 tZmKTzSaKyDZzGneY9xbI3ioEMBvJ+Bxt81Sgo++y1gFXgb+JbJXdiXEBz9bniYRiHhoOCLz
 O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQqIu
 Nfjy+XSI1bg0DNvWo4uw/vrRChH4rKq4Vv0gnRkPaoQ5ACHxyFPZH4iDfrZw0XQE9E88tGSH
 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9
 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG
 fMwJgokaymF3dKM7JWjaet12e18IerMI9ZK0p1g5Wmx4fcOZ7nmG/mPwOACmTA6i4ZJAOrUY
 NcfZXx3dhPcbhZTO1ARTpUjgOOvgXq5eDpdwL6XjfNvvy6Pk0oui/60b4G9lt+iHK25mm6Co
 W3L5SLhCwwyP92D0zuVtHmrg4cjmAuiAdxOSuDmqqACbFu7wWtIOURIdGWAuuCo2kS7ZPUOM
 xQp0397xUQ13AnxJjXnZDWorXjBshMCVt54F+wh9BrL2qfS+xyeBGUPUnhGctNOnM08SCEu1
 1SJt8j0HjEpu7qQIVqC8p+EoDX0PjIaRVLufgcBRAoBptz8+oc6i0qTSs45SfHuyNroBTv33
 jaG6jAkgKkehtIK0KP9+k3bhzWrpd7CSQtdChjrY19JJzhRPOaND7FEI3CChRqcBO51lmW8g
 UU=
IronPort-HdrOrdr: A9a23:N76fK6r4a+JS3Iafiq6EnAwaV5rbeYIsimQD101hICG9Evb0qy
 nOpoV96faQslwssR4b9uxoVJPvfZqYz+8X3WBzB8bHYOCFgguVxehZhOOP/9SjIVydygc078
 xdmsNFebjN5DZB7PoT4GODYqodKNvsytHWuQ8JpU0dMz2DaMtbnnZE4h7wKDwReOHfb6BJbq
 Z14KB81kOdUEVSVOuXLF8fUdPOotXa/aiWHCLvV3YcmXGzZSrD0s+ALySl
X-Talos-CUID: 9a23:Iixw9W5Y6u3z5CICmtss+nQ9H/kjKE3n4FDIAE2hVk82RZ6yVgrF
X-Talos-MUID: =?us-ascii?q?9a23=3AXEUUWAxCR5ltMNzNMB+y2KLIEwKaqKOpU3FUz7Q?=
 =?us-ascii?q?4gNKdJHx6Pgi63Szvf6Zyfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,214,1684814400"; 
   d="scan'208";a="116465646"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=il78Ji7u5ABSPTwNDiuFrsYmbuol6Op13GhmYSQoFlRLaWkKP/BJNqDjbWq4jTDtPLzL+rqOI1PhgFBi8uNf69dAFbF3Bj8DLxSXVd2kX/bCabjxoGK3IaV6JH88bB2RXPgkWHzQHSrLJVswg56wiXpFhtZv8VXJayf9m7N1iA8UxF5b4zo98zOrhwm23hqGd0/Ood5izZHuH/oegZv+/nAE2JqyXcTvOg0wh1piL0ZofzYyhwGuEnvrJmuwqF9KcS/KPVLyBWbi2o8wn9mHDG4sco1FnJ0GnMSZwaVQS8OlyWkqsJQVk/GUWIxoKaGgIQRHO4jWwZqgLlOSWiqkjA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/lDf3HGgdgOwPdxea2uOADARo6YV2zcr4Bg6cHDoLRU=;
 b=RoJRwD+pqXbg73q5SZWIXIhhNd7pQxmQbFxNfQ/1+GUl/78PrypeopXm44krwTOD1OsX6l4C7o3Ed9cYn7PFXxtr+zPVYmzDMYymbEAlHZO113qkKXE7rk/+k+7yUY27oZ7znb43x31NoZ+0Ji9ReOldUz+lh+2nUmpiRNumoo63hKqBVUdZFkXw3ilHZ86tAIUV7VHXVNoTuY3zrfQ31/fvt5hleqIYleQKx4SHatyO3o7cRfCqEcOWgLI/fTASi0Tp1qjznHa6xegV3kFBiqfQmWkX2UxD8MtnOldFUq6AgqVG5SrJJiDRTQaiQqexiB/76Z6AE2JiNgmq5Cushw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/lDf3HGgdgOwPdxea2uOADARo6YV2zcr4Bg6cHDoLRU=;
 b=FWB8OfmOwMZ47Wlj5b8UsmAFh2e3JojltKFZQUuXQX6rvoIPHxQWLgca7B7TWZnTAU+UpqZSt974VQtDMKYN88xzDAtY8QSsre8JabUMA4JOQubsQZBSaXmcr9osjmKk9aajtC1hynnfDFmIyYtt7//hmbqL1+1RpSg49HtOU0U=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v2 2/5] x86/ioapic: RTE modifications must use ioapic_write_entry
Date: Tue, 18 Jul 2023 14:43:31 +0200
Message-ID: <20230718124334.36548-3-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230718124334.36548-1-roger.pau@citrix.com>
References: <20230718124334.36548-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO6P123CA0037.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:2fe::9) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|CH2PR03MB5317:EE_
X-MS-Office365-Filtering-Correlation-Id: e3760484-2356-4757-eb9c-08db878ca8f1
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	JRv8nrwCb8tHYmK8cwbPgMw/LhhluD1XynxsVaJffOuca6vtQUkc9PLNIieMBo2zVvaSOqfG+pZS3c7a0lQ1Kw4QRyii3A2kwSNOe/9kjEDlQrmJJKMzfiuqib40q5/RHFYiiYHra97Gp1WnhzkuvZWWrUAtWEcHgc9yBDfRSwKU3FJTsw/s1WGcaB2PEmia5Ky8n8ofynM+gplFQqs+P6xs0FukUNRdC4inVNxaGW75YiJb7jKr5YMmqfbb+NlOc2CdEVpgIJefAsClJVg8jPUw3arRIrY5mFf22jU9HmTPYRIjebTsJW5jJGnxMDK71LznL3sb2lZmeNVoeZmn6WFuIGshXRjKb8HqinmZzZ8FdAUqOk5D3LdXDDD4Esl51VIpb5ObWmc4VkXltAahRgr9mJCjYSnYvDR/5LECBbFQXuJ+T0buzMC5cbemGfyUUHbnQx/Tv/srMsX1bCuMaYHSaP6T5DoBPlBq/xNLWxL7s/XQWq2vxxGoz8dwF/JNgwQO5LGwQbEwnntF7X18lpNoZIfh+YNYgsfVsHlxtT4T3mobQQoYwLlh8+7Xrl2j
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(136003)(396003)(39860400002)(346002)(451199021)(86362001)(2906002)(36756003)(186003)(6512007)(38100700002)(83380400001)(6506007)(1076003)(26005)(54906003)(82960400001)(6486002)(6666004)(4326008)(6916009)(66556008)(66476007)(2616005)(66946007)(316002)(8676002)(478600001)(8936002)(5660300002)(41300700001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MmxBR1Rwall3Z2Yrd2ZBQlFqdjM3WTlHcEhLb0FEL00xTjFPaE04NklwL1VM?=
 =?utf-8?B?d0V1MFVMdGIwOVRYWGdNZFJMSzlFcGxOZmxlRzFmTHVmRUtvczJzcmVRL29u?=
 =?utf-8?B?ZnM3Vmp2SFdqVVdHSXZFdDhCR3ZQVk5TV1BzbmpPa0E0WHNtWW5UbkRvdHhs?=
 =?utf-8?B?Zkx5R2U5M0NLOG5QTmdDVXNlemxtTHNFd0l1dzZiTVdnMno5OUNjbzU2cXp0?=
 =?utf-8?B?Zm1HeisxV3F5cjl1R1ZCVGpSU0pELzdneExwdVB1ZjR1MjhESDRVM3U1WFEv?=
 =?utf-8?B?QUZtQVZIS0lGWVpRYi9lbGUwdkFIbWdMWS9Yb3plRE5OM2tvd3NOSVhnWC9s?=
 =?utf-8?B?WDV5NmQ1L1o4cnVHaE5IeVhFTGZvMkFNSE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WFZJOUFuVkduQ29MVFpXNHRkd2llUDNJOEc5?=
 =?utf-8?B?akE9PQ==?=
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	ypfeDCWk7wvBc3oY3QvlBEeTMlfufMX9ZKyGu7ALcnSyHeeDWeXEwVSR8crVirvYBNNGxhT/mdXASshbJhXHSfLA2DUdB0eBdmjScFUT/EeUzjqfynjauUMVvivddawFjo/hn5n8nWC74QkkPLDzdydKIv6eyofbAoIPwqvdiadmoLnMZ8FPPquPdJd3/+VnFAgTqkJ9ZuyD4PM7cucDkSszBsDV3gr41CM2JTGAYqenxv4JG/2EHjHWDkskSRO7MJIm/YYX/QGtN9jMr+dvp7i1HWLVHJjvQatZQIw/gwrzxZvwwuXla521B/dI7DTf8nLdxBNUpAipG4luGke9NhKLKk0biaTUi+F75QLK77muafQgBYowUl0IYUDRohsSLpXbawHHmKvclEalEpMsc0x1YBNntp7AK0VJPQTE/wYRJ32GMKmnfzBP87Wlr6O2GH87KNof1cmBqh7Rcjs/TMNbHD8AMeaZ6Xwl6pukAHGaqGQN8CsbRXDAgn7ReurKwKaP32x0aMxOOzelpaxqgg6NrhzBeY83EJn3ECNhCCzXibNtLOSaZNWd3OKDBMqjOv1ZlfFt7PFDB3S2nGPBBQnO1dLd1UUG/4koj43Y7zWlyOS9S76OGVP1TGbmlZWGYzc9HApKxIrquDjnEXc63eaZObxaSfZ6oOgqb0CUPdh7MIgoMpoixoatqxr3TN9oeUSwEd3ruyr1jjo4m3IVZyiYf7FNTZZzfZRvnmdusYalyddqqhhimbUY3Jh4i129FDfwQhjmxXebHTQOzg7G//jsHoaXmXqp5+UcYZ3cv+sMcXKFTStezu52APuo7jgaGU1skaksPj2tUkhAAlyXaQ==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e3760484-2356-4757-eb9c-08db878ca8f1
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 12:44:00.5149
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 00YNS6VH3gkg/mAnZGqYwRn7wgmaSCdULAusWXkSMfZzYplvkK5eykPtzbA+3/7ie8PN71itYAX4dMs8iZ6q2A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR03MB5317

Do not allow to write to RTE registers using io_apic_write and instead
require changes to RTE to be performed using ioapic_write_entry.

This is in preparation for passing the full contents of the RTE to the
IOMMU interrupt remapping handlers, so remapping entries for IO-APIC
RTEs can be updated atomically when possible.

While immediately this commit might expand the number of MMIO accesses
in order to update an IO-APIC RTE, further changes will benefit from
getting the full RTE value passed to the IOMMU handlers, as the logic
is greatly simplified when the IOMMU handlers can get the complete RTE
value in one go.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
Changes since v1:
 - Reinstate io_apic_modify().
 - Expand commit message.
---
 xen/arch/x86/include/asm/io_apic.h       |  8 ++---
 xen/arch/x86/io_apic.c                   | 37 ++++++++++++------------
 xen/drivers/passthrough/amd/iommu_intr.c |  6 ----
 3 files changed, 22 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/include/asm/io_apic.h b/xen/arch/x86/include/asm/io_apic.h
index 4c4777b68a51..9165da2281ae 100644
--- a/xen/arch/x86/include/asm/io_apic.h
+++ b/xen/arch/x86/include/asm/io_apic.h
@@ -162,8 +162,8 @@ static inline void __io_apic_write(unsigned int apic, unsigned int reg, unsigned
 
 static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value)
 {
-    if ( ioapic_reg_remapped(reg) )
-        return iommu_update_ire_from_apic(apic, reg, value);
+    /* RTE writes must use ioapic_write_entry. */
+    BUG_ON(reg >= 0x10);
     __io_apic_write(apic, reg, value);
 }
 
@@ -173,8 +173,8 @@ static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned i
  */
 static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value)
 {
-    if ( ioapic_reg_remapped(reg) )
-        return iommu_update_ire_from_apic(apic, reg, value);
+    /* RTE writes must use ioapic_write_entry. */
+    BUG_ON(reg >= 0x10);
     *(IO_APIC_BASE(apic) + 4) = value;
 }
 
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index aada2ef96c62..85b4b4c6bc98 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -269,15 +269,15 @@ void __ioapic_write_entry(
 {
     union entry_union eu = { .entry = e };
 
-    if ( raw )
+    if ( raw || !iommu_intremap )
     {
         __io_apic_write(apic, 0x11 + 2 * pin, eu.w2);
         __io_apic_write(apic, 0x10 + 2 * pin, eu.w1);
     }
     else
     {
-        io_apic_write(apic, 0x11 + 2 * pin, eu.w2);
-        io_apic_write(apic, 0x10 + 2 * pin, eu.w1);
+        iommu_update_ire_from_apic(apic, 0x11 + 2 * pin, eu.w2);
+        iommu_update_ire_from_apic(apic, 0x10 + 2 * pin, eu.w1);
     }
 }
 
@@ -433,16 +433,17 @@ static void modify_IO_APIC_irq(unsigned int irq, unsigned int enable,
                                unsigned int disable)
 {
     struct irq_pin_list *entry = irq_2_pin + irq;
-    unsigned int pin, reg;
 
     for (;;) {
-        pin = entry->pin;
+        unsigned int pin = entry->pin;
+        struct IO_APIC_route_entry rte;
+
         if (pin == -1)
             break;
-        reg = io_apic_read(entry->apic, 0x10 + pin*2);
-        reg &= ~disable;
-        reg |= enable;
-        io_apic_modify(entry->apic, 0x10 + pin*2, reg);
+        rte = __ioapic_read_entry(entry->apic, pin, false);
+        rte.raw &= ~(uint64_t)disable;
+        rte.raw |= enable;
+        __ioapic_write_entry(entry->apic, pin, false, rte);
         if (!entry->next)
             break;
         entry = irq_2_pin + entry->next;
@@ -584,16 +585,16 @@ set_ioapic_affinity_irq(struct irq_desc *desc, const cpumask_t *mask)
             dest = SET_APIC_LOGICAL_ID(dest);
         entry = irq_2_pin + irq;
         for (;;) {
-            unsigned int data;
+            struct IO_APIC_route_entry rte;
+
             pin = entry->pin;
             if (pin == -1)
                 break;
 
-            io_apic_write(entry->apic, 0x10 + 1 + pin*2, dest);
-            data = io_apic_read(entry->apic, 0x10 + pin*2);
-            data &= ~IO_APIC_REDIR_VECTOR_MASK;
-            data |= MASK_INSR(desc->arch.vector, IO_APIC_REDIR_VECTOR_MASK);
-            io_apic_modify(entry->apic, 0x10 + pin*2, data);
+            rte = __ioapic_read_entry(entry->apic, pin, false);
+            rte.dest.dest32 = dest;
+            rte.vector = desc->arch.vector;
+            __ioapic_write_entry(entry->apic, pin, false, rte);
 
             if (!entry->next)
                 break;
@@ -2127,10 +2128,8 @@ void ioapic_resume(void)
             reg_00.bits.ID = mp_ioapics[apic].mpc_apicid;
             __io_apic_write(apic, 0, reg_00.raw);
         }
-        for (i = 0; i < nr_ioapic_entries[apic]; i++, entry++) {
-            __io_apic_write(apic, 0x11+2*i, *(((int *)entry)+1));
-            __io_apic_write(apic, 0x10+2*i, *(((int *)entry)+0));
-        }
+        for (i = 0; i < nr_ioapic_entries[apic]; i++, entry++)
+            __ioapic_write_entry(apic, i, true, *entry);
     }
     spin_unlock_irqrestore(&ioapic_lock, flags);
 }
diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index 9e6be3be3515..f32c418a7e49 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -361,12 +361,6 @@ void cf_check amd_iommu_ioapic_update_ire(
     struct amd_iommu *iommu;
     unsigned int idx;
 
-    if ( !iommu_intremap )
-    {
-        __io_apic_write(apic, reg, value);
-        return;
-    }
-
     idx = ioapic_id_to_index(IO_APIC_ID(apic));
     if ( idx == MAX_IO_APICS )
         return;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 12:44:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 12:44:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565176.883087 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLk3l-0002PK-T7; Tue, 18 Jul 2023 12:44:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565176.883087; Tue, 18 Jul 2023 12:44:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLk3l-0002Mw-OW; Tue, 18 Jul 2023 12:44:09 +0000
Received: by outflank-mailman (input) for mailman id 565176;
 Tue, 18 Jul 2023 12:44:08 +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
 <SRS0=c9jt=DE=citrix.com=prvs=5561f9d71=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qLk3k-0002IP-5j
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 12:44:08 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c6d744cc-2568-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 14:44:05 +0200 (CEST)
Received: from mail-mw2nam04lp2172.outbound.protection.outlook.com (HELO
 NAM04-MW2-obe.outbound.protection.outlook.com) ([104.47.73.172])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 18 Jul 2023 08:43:57 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by CH2PR03MB5317.namprd03.prod.outlook.com (2603:10b6:610:9c::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Tue, 18 Jul
 2023 12:43:54 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 12:43:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c6d744cc-2568-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689684245;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=vXSrjScc4stYZjmMBMkswDIFJ2P93wZXbU9NQNneoJ8=;
  b=F52PhCtIoC3KAHeCPnwmcqQD8JGcRBT8bMvw2UcvJQJnE7TqMI6S/pxn
   FZLyEDGqms+NRqeahOpqo1v/qyJ3IfDqkcp2xiwdpVj1ssgP+j/ERmJ5T
   r00fjubUJKU+B7peJP537W47SpUYiXW16nNOe503im9uI0Tq+ACYZiJMn
   A=;
X-IronPort-RemoteIP: 104.47.73.172
X-IronPort-MID: 115292209
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:0G2DL6DpdZGfShVW/xXiw5YqxClBgxIJ4kV8jS/XYbTApDgrgjUEn
 GYcW2DUbP/fMWGgKNp3Ydyxp08FuZLXmNdgQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h
 yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs
 t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GxB7gRkDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS
 uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada
 jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIw9NxxGG1Lr
 q0iNxstRDyjn8OGmrekRbw57igjBJGD0II3nFhFlW2cKMl8BJfJTuPN+MNS2yo2ioZWB/HCa
 sEFaD1pKhPdfxlIPVRRA5U79AuqriCnL3sE9xTK/uxuvDK7IA9ZidABNPLPfdOHX4NNl1uwr
 WPa5WXpRBodMbRzzBLcqy/217WVxXKTtIQ6EeSIqtxHmXiv3DYpNkAVaEaY+9qXhRvrMz5YA
 wlOksY0loAi+UruQtTjUhmQpH+fogVaS9dWC/c96gyG1uzT+QnxLmoOQyNFadcmnNQrXjFs3
 ViM9/v2ARR/vbvTTmiSnp+XoC2zP24JLGYETS4CUQYBpdLkpekOYgnnS99iFOuwkYfzEDSon
 zSS9nFh3fMUkNIB0Li98RbfmTWwq5PVTwkzoALKQmai6QA/b4mgD2C11WXmAT97BN7xZjG8U
 LIswKByMMhm4UmxqRGw
IronPort-HdrOrdr: A9a23:6XV+RqBjTO7IerXlHemG55DYdb4zR+YMi2TDj3oBLSC8cqSj+/
 xG785rsiMc6QxhIE3I/OrqBEDuexPhHPJOi7X5eI3SOTUO21HYV72Kj7GSoAEIcheWntK1l5
 0QEZSWY+eeMbEOt6fHCX6DferIruPrzEniv5a5854kd3ASV51d
X-Talos-CUID: =?us-ascii?q?9a23=3A9NchwWiOtXSLtn2/psmRfYw/9TJufEfb1XvVeB6?=
 =?us-ascii?q?CFk1JYpG1UX6goqZ7nJ87?=
X-Talos-MUID: 9a23:biDFUQuHpxlgBtxPUs2ngWhSaOVF+oGSEho3r8gFhtSnbw9eNGLI
X-IronPort-AV: E=Sophos;i="6.01,214,1684814400"; 
   d="scan'208";a="115292209"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=gDXOX7TtFSkifTo0kBLSqHcNlNKY8CcolHXSvFpDQLIMDooRajsE2nxdicim01grsyYOC0NvMZLl++M9gpDZIQ8JyAN/FXZ0ct6BGF2LCHoCJtYjNeED1bjwjVnPnGOp/Trc+WapeQzaj/bG8pXWa3+99AS/UD2yAiIZxcu2U+E+WcSN0ex0n89bL0WGigP8pW2vSVNikNByC+2uUBrfbhPvZnqblbgbCtwIWZcTzkKSL7tisXwJVrKo/wSt36Kq1JrpwOHL3NC7Bfaqmy6V+u7Xz61K5iPOawchxm9j28bqq5962bPbqn4DUjlAFfH58vEnuJfIbH377WGfOHYzfw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Vw1gRyZwe4JBxeOfmYftsFVgq9VUuHpZanmEFCLtcvk=;
 b=dkoR00na7YFZNzaVQxZT7G72BXhNNUjI+jwjmBDv7q1Yaky+GMW3W8iv2g4PKhx2cBaTzdDca7aHemqJg3ILTveC7YyNbLegFs/La1fxz3WDzeG9jbKvQAKgymq9SB9596lZ3ca+rMd2x4hkb/WhDurRI2/3AL4VNnPIGBdO3njXPRDXdLCEiukESLi3hIi8K1OKPzXLg8+WGwl2himXxcpUWabD9+/lngH5DqdgwrbrDWBDEY1BLkZgAWrBJ+PiC0JkwFXkT7/PeKXatfipd9NstIgYnsM6xYNz9n1KZJK8Bu7005UXzFLM6L8KB7NfejEjH8M+eBRDxmxQGstQsw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Vw1gRyZwe4JBxeOfmYftsFVgq9VUuHpZanmEFCLtcvk=;
 b=u98aMxQWVUxx73FDkgg1jK9mLnW2JA5G70us1tK7mBpTRH+ngmNNfEkL4Xh4RJ39pbCSYWXoqcPKOQD9C59q+NC0h0wX5ulrVgq1gx8sYuVxrjRFJdVcgxXbyBWv7QWlf8OZ9UQOa6ch38fR7MuIrwAsQakE67WhWe8ygX31ZEA=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>,
	Kevin Tian <kevin.tian@intel.com>
Subject: [PATCH v2 1/5] x86/ioapic: add a raw field to RTE struct
Date: Tue, 18 Jul 2023 14:43:30 +0200
Message-ID: <20230718124334.36548-2-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230718124334.36548-1-roger.pau@citrix.com>
References: <20230718124334.36548-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0088.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2bc::7) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|CH2PR03MB5317:EE_
X-MS-Office365-Filtering-Correlation-Id: 1d16aa5c-ce59-4f06-14e5-08db878ca587
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	daRqWS4XeaatqH4m54Z1HGB9fvjpoWTws3l1TAe+tO6umm/tZXhAKXk7mFtZqnVGRunMEyYxkhUsPdYXoKbnmhEoQ3OV+qTGBJpo+gZBGnuWQXp0z6K3nPEqohWcSNyHI0mR0UR13As8rHIMJlv8rnKETjmbncUgxymuYTyq1RzoCKkeAamav7N+eTZzoicB7mjP63u0mHBJjjZ7J/bXoKa4SWcS2iEOkbRw0XekyRwNtBVKOJC5IsYDLYsqZ2k99JhxB0C9hpv5fnswvmxGQT5q8sLYB3bzKSvCkLQcpu6p0eHKAUA9LY/VoPAbEUhiKkI9lu6GMUm80yALOqOVncQz/LZkx8p4dyHL2/hiunKaqt4buRPY9FFqOCsyulz8Shj9XbGyc8LAntlZNXirKT1Z6/7g6Fnk20s0XmfRGPPblvzSncHmxOdTl2DjwHprje1N5gdh2owRorvK7wrnxlp5twgikvWdVjc+V1QmifDhPDsUrIP2sIPA6exxiEHInbFnP9asDOMTFS5VYR4Ugr75jzPd52JfbATev7u9y16uSUNDSZXtRq/s12+ZVF8t
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(136003)(396003)(39860400002)(346002)(451199021)(86362001)(2906002)(36756003)(186003)(6512007)(38100700002)(83380400001)(6506007)(1076003)(26005)(54906003)(82960400001)(6486002)(6666004)(4326008)(6916009)(66556008)(66476007)(2616005)(66946007)(316002)(8676002)(478600001)(8936002)(5660300002)(41300700001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Z1NpSzY4TzdPM3RiMUIrWm0wTDJvbUMwN3ZIeXRTZTRDK0ZDT1VrZkZOTk45?=
 =?utf-8?B?RWZZb3pCTlA2QUpudGY1WElPUTd2YlowZVRObU9yS2ovYUNhL1FqTEx2UXU1?=
 =?utf-8?B?d1h5anZkc3IxNzlDcjQwOHdoOTZ3ZllHclZEN2FEVG9tbmtpVkZaTHdlcmdZ?=
 =?utf-8?B?aElKYU0xS1ByWkhJMlgvaU5GOThMT1N6cm9YdFY1ZXVXcE51N0ZYMnBUeXhr?=
 =?utf-8?B?aUVTUE5Kdmd5VnhvZFZLNUNxNHBxQUErUEhzazhuME41c0VjaDJKSWRCSDJi?=
 =?utf-8?B?cFpud0E4eTllWDFEaGt5Rk80bkdLMlFJV3gweGtQWTQ1cmdyL2ZkeWRlbVU5?=
 =?utf-8?B?YVFhSWpxN3FMdjlmUi85OTZHYTA1b2JDazQ0NWJwbC8wMWFvS3g5TTNJWWNS?=
 =?utf-8?B?bnQ1UGViZVBmZHlkOGNTUTJ5YWlzd0VkMlRoSUd2eE1HdTdGaklpa3ZLTEdJ?=
 =?utf-8?B?bUhib2Fhc0xtaWd6T05Ga0dmQU9lRWp4cnRobUMrT0FPazFla1dHaVNpWXZ2?=
 =?utf-8?B?aTNIdXB3ZXJJU0RGM1R2WHQ3ck9naG9iUWxDYUJmdCtIc3VWTDcwM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Kya75w0gfjrO1+01r1mzl9kw1D4WbiC+EuC0YXkR+varbVS6yaUeEbMHhgnoqgcADHrrGgwY6srnTsTaUfcrAAUSyVLaIsiLwZIIOra1oyxgD1XbWhrbr+GIVbCOm+djMkfsbBDqWewJuhdl87wt2Max4qWcn1ECAJGWtosLyTBBHx139/wlXBKrc+9IAKSTR0oMmbWg2bJ+gNyo1H7efsuYD4EU+dMgVt3EM4I1/rG8e/EqhnjygNoYAK04yGWnqN54w4c8SwENBUzD21w0fjeXujcmwTiVgzV3JvBsfLG2mu1NNzmNDz4tUxIITqMvX5QATRmQHCCQiSfItpP15v7+GHTGq/Cmk05PEAVTgRDvoB+UNKM8u6nRMKHPzT+57pLrHGD5vpbVmHulkjdx5pJwnYShri3iKK+wdsz27DVv2KluLRIyKNvNZKWH3yicvarhECgDz2jdf+cH5eAfaKaxLjugw2oh0lK0SFP2hfDa5bfD3UEK3OhODNIZYg3Pg7GXu2q6Sck760eCE3o/UkqmnjDQBKy3tpQ7DkXukOU/zfIl1ydYZiuWy5RpWIjayV2QLJUOR21JoPd/sSxBBpYqr+FR/RMvbU6Poz9Rn6SXGHBWVrL6yChLzSdKqZY3vsbsxwuBnILgkfdTUzhgOhGQHzwsE4hvYH1MOs7/7Cy6QKm+978koYBFL/V3+5gXL+yrq60itCUn/BJmRYC8WNMzHnLBa9N6DgaKz2upgUqALpXfGltlL0V6BV8GgxmchefoppPRK19wvTTmOXu+bVjytd9oxv4VI=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1d16aa5c-ce59-4f06-14e5-08db878ca587
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 12:43:54.6981
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: BfQu1GSpfCI5N1cDc4NULRHlzOqP7x7+t7k83QFMQFGmJkEB+e/DE4LqlGRwcntC69i3BTaJd//d6Lyn2261yw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR03MB5317

Further changes will require access to the full RTE as a single value
in order to pass it to IOMMU interrupt remapping handlers.

No functional change intended.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
Changes since v1:
 - Fix initializers.
---
Tested on gitlab CI, builds on all compilers used there.
---
 xen/arch/x86/include/asm/io_apic.h       | 57 +++++++++++++-----------
 xen/arch/x86/io_apic.c                   |  2 +-
 xen/drivers/passthrough/amd/iommu_intr.c |  4 +-
 xen/drivers/passthrough/vtd/intremap.c   |  4 +-
 4 files changed, 35 insertions(+), 32 deletions(-)

diff --git a/xen/arch/x86/include/asm/io_apic.h b/xen/arch/x86/include/asm/io_apic.h
index bd8cb95f46b1..4c4777b68a51 100644
--- a/xen/arch/x86/include/asm/io_apic.h
+++ b/xen/arch/x86/include/asm/io_apic.h
@@ -90,35 +90,38 @@ enum ioapic_irq_destination_types {
 };
 
 struct IO_APIC_route_entry {
-    unsigned int vector:8;
-    unsigned int delivery_mode:3; /*
-                                   * 000: FIXED
-                                   * 001: lowest prio
-                                   * 111: ExtINT
-                                   */
-    unsigned int dest_mode:1;     /* 0: physical, 1: logical */
-    unsigned int delivery_status:1;
-    unsigned int polarity:1;      /* 0: low, 1: high */
-    unsigned int irr:1;
-    unsigned int trigger:1;       /* 0: edge, 1: level */
-    unsigned int mask:1;          /* 0: enabled, 1: disabled */
-    unsigned int __reserved_2:15;
-
     union {
         struct {
-            unsigned int __reserved_1:24;
-            unsigned int physical_dest:4;
-            unsigned int __reserved_2:4;
-        } physical;
-
-        struct {
-            unsigned int __reserved_1:24;
-            unsigned int logical_dest:8;
-        } logical;
-
-        /* used when Interrupt Remapping with EIM is enabled */
-        unsigned int dest32;
-    } dest;
+            unsigned int vector:8;
+            unsigned int delivery_mode:3; /*
+                                           * 000: FIXED
+                                           * 001: lowest prio
+                                           * 111: ExtINT
+                                           */
+            unsigned int dest_mode:1;     /* 0: physical, 1: logical */
+            unsigned int delivery_status:1;
+            unsigned int polarity:1;      /* 0: low, 1: high */
+            unsigned int irr:1;
+            unsigned int trigger:1;       /* 0: edge, 1: level */
+            unsigned int mask:1;          /* 0: enabled, 1: disabled */
+            unsigned int __reserved_2:15;
+
+            union {
+                struct {
+                    unsigned int __reserved_1:24;
+                    unsigned int physical_dest:4;
+                    unsigned int __reserved_2:4;
+                } physical;
+
+                struct {
+                    unsigned int __reserved_1:24;
+                    unsigned int logical_dest:8;
+                } logical;
+                unsigned int dest32;
+            } dest;
+        };
+        uint64_t raw;
+    };
 };
 
 /*
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 25a08b1ea6c6..aada2ef96c62 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2360,7 +2360,7 @@ int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval)
 int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
 {
     int apic, pin, irq, ret, pirq;
-    struct IO_APIC_route_entry rte = { 0 };
+    struct IO_APIC_route_entry rte = { };
     unsigned long flags;
     struct irq_desc *desc;
 
diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index f4de09f43180..9e6be3be3515 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -352,8 +352,8 @@ static int update_intremap_entry_from_ioapic(
 void cf_check amd_iommu_ioapic_update_ire(
     unsigned int apic, unsigned int reg, unsigned int value)
 {
-    struct IO_APIC_route_entry old_rte = { 0 };
-    struct IO_APIC_route_entry new_rte = { 0 };
+    struct IO_APIC_route_entry old_rte = { };
+    struct IO_APIC_route_entry new_rte = { };
     unsigned int rte_lo = (reg & 1) ? reg - 1 : reg;
     unsigned int pin = (reg - 0x10) / 2;
     int seg, bdf, rc;
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index b39bc832821a..786388b4d9c7 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -419,7 +419,7 @@ unsigned int cf_check io_apic_read_remap_rte(
 {
     unsigned int ioapic_pin = (reg - 0x10) / 2;
     int index;
-    struct IO_xAPIC_route_entry old_rte = { 0 };
+    struct IO_xAPIC_route_entry old_rte = { };
     int rte_upper = (reg & 1) ? 1 : 0;
     struct vtd_iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic));
 
@@ -442,7 +442,7 @@ void cf_check io_apic_write_remap_rte(
     unsigned int apic, unsigned int reg, unsigned int value)
 {
     unsigned int ioapic_pin = (reg - 0x10) / 2;
-    struct IO_xAPIC_route_entry old_rte = { 0 };
+    struct IO_xAPIC_route_entry old_rte = { };
     struct IO_APIC_route_remap_entry *remap_rte;
     unsigned int rte_upper = (reg & 1) ? 1 : 0;
     struct vtd_iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic));
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 12:44:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 12:44:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565178.883111 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLk3p-00033T-Jg; Tue, 18 Jul 2023 12:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565178.883111; Tue, 18 Jul 2023 12:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLk3p-00033I-Fx; Tue, 18 Jul 2023 12:44:13 +0000
Received: by outflank-mailman (input) for mailman id 565178;
 Tue, 18 Jul 2023 12:44:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=c9jt=DE=citrix.com=prvs=5561f9d71=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qLk3o-0002IO-0N
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 12:44:12 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c9f6ce7c-2568-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 14:44:10 +0200 (CEST)
Received: from mail-mw2nam04lp2170.outbound.protection.outlook.com (HELO
 NAM04-MW2-obe.outbound.protection.outlook.com) ([104.47.73.170])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 18 Jul 2023 08:44:08 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by CH2PR03MB5317.namprd03.prod.outlook.com (2603:10b6:610:9c::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Tue, 18 Jul
 2023 12:44:06 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 12:44:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c9f6ce7c-2568-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689684250;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=bh4Z8vh88aCCNmW7xSNaFT+TLYRAGdh+7EtGhKnpcyM=;
  b=T3+eCNkH1KA8sO28YAwi2QJL9Mrd1NOZ40LeUjQrzVfQZGzX/TojYIQ5
   MZzJ91c1/TAPAzlLfSra4n72OneajZaxXmRmMRiLWsFDzaRLMiXUew6Ty
   RjYVcOgEBcEB0TiJw6o2EXJLQE8D3uFjmZLKvJfVXbOZeiwmrKtWdzKED
   M=;
X-IronPort-RemoteIP: 104.47.73.170
X-IronPort-MID: 116607369
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:pkF6K60OGAyN9HQq8fbD5cxwkn2cJEfYwER7XKvMYLTBsI5bpz1Rz
 GEYDTzUOvmNZWTwc9pyaoXg8RgFsJ7TzIViGgtupC1hF35El5HIVI+TRqvS04F+DeWYFR46s
 J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo
 tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5gNnNagR1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL
 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+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ector9901; d=microsoft.com; cv=none;
 b=frMre0DkL8Z2df4GtYAhzvLnCvUb0L6IvV6p/crGziD9vBgZfwCrL5Nhz4TE2OfJdF3PCj33YM2i1ewPLXN9RR7i5jUu5KgxWzLjcHfoYUaQAxbWzV9faYTwc50zkrtwr4UV1XkXSU8d8sALtU/Ii5WB+g7IgZKKKT6fpn9gt00n5YDFUKREjHfMN0P+d++OxEVIQQguSgad7o+xnObLNEceKZyHgMhldWrMa7b2V2pFgasQnFHY8ZzFO1TKCgCL+eZD+E6BwWF/qGXdRkzZFvtoJkRGJL/xLzZJ+g9NbMDhwqXb2DAGQTvn0ci7+MjTFJf0Z2v2t3Tf/H9CHwEyLg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OCnIUZuAFwbePOekwR0bgT5Rjf2c+Q+JJrHWHdx6kO0=;
 b=IrDALT/XZpG2n/fvfNo5ZxW7JijijjUt7j075TR7+926W7h51577+K7nkwq0hd8tXS12qOP4+iQC6PfeavFi9bHOsyf5uQM6sAcFZMYDP41um49kBBOiXXEnYELN7RfQwrgDkRXdrj94neecCSz6R+MAvl9gleUPIFPHoVaz2iQaVEt6aqWBd+DvRHbd2x6QhiVuh4O/A5i5CM3ggLBYLPVsG9KVhEzWNJqVv4rzUuBsGz/73uu4TxNdd92MEcQ32QVFDdGfzePjb5WT3X/akVULeukgYhMENoxfjR/kGybIZO4kbIRnBnlQozZnCcw6nEO+lpXjPA57cahXlHgbJw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OCnIUZuAFwbePOekwR0bgT5Rjf2c+Q+JJrHWHdx6kO0=;
 b=uGGPEAjrHXznKiE0oPw1THGDb4yVeOLWcqPY2nAX7YFK73OzMMNG0Vyh1i9/JgtbFHqRaqI82r3PtVVfZkIXf7T6sDnmzFswdV3ZSTZB7Y+lEBITuic2iTRjiQu2b3K/C+V95Hl9zGz0scf4IJQn4enxiC7uue2OasF3THaol+I=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Kevin Tian <kevin.tian@intel.com>
Subject: [PATCH v2 3/5] iommu/vtd: rename io_apic_read_remap_rte() local variable
Date: Tue, 18 Jul 2023 14:43:32 +0200
Message-ID: <20230718124334.36548-4-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230718124334.36548-1-roger.pau@citrix.com>
References: <20230718124334.36548-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0492.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1ab::11) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|CH2PR03MB5317:EE_
X-MS-Office365-Filtering-Correlation-Id: 2213edac-1ba4-4ced-8998-08db878cac42
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	KTkk4fFLWFl0JTz0fL28sVhatrjvHho3OszrtnhhdUnQMovRASaBJNn7o3ObzknWANNFOpM0VybsOpnRqE2g+E6H/zF+BpzBnwQ7kXQtWgTDMSAJRK2f1KKCjxPUSOb9jlh/9IENxxIRSTJk0z0t7ljH8AHTInNSg9PIz9EZvZnV0By5xadmXETk+cDRIojwT+vYJ8P9CAslbwM6cLnxDwsDLMgdimcvlLXCH8QnyqSkbMIDkFwcWU7/jCKdy6+ajxCNFGxbOKxNEvS8eKogDSGQPCXrdOu/ZA7RSHW0Ic9rQr5dWdJgH2g0xSERYK/SKMEfnuNI/ETzXGjynn2uFEH8+5IvFaztFYkqgclZeaW1WkakI/9RnISvjdoQ2hv9volKFmtuQTE7dnXfOA+czXGdhJOtDQpvkjnq+LGuIUiSzl6jIGGaIsUBd2tDLsWoNqh9OvSnHJHeEv7DpjsHA89AEISwFdeyWxgGxNlWDS9gP7MOo81MEdinT8juM4glb4y4MZGBb0O8how36j98eSiu1tJ3AbXl2Aq5I0NGCoxUaKNGq2aHjTP7TpINsidI
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(136003)(396003)(39860400002)(346002)(451199021)(86362001)(2906002)(36756003)(186003)(6512007)(38100700002)(83380400001)(6506007)(1076003)(26005)(54906003)(82960400001)(6486002)(6666004)(4326008)(6916009)(66556008)(66476007)(2616005)(66946007)(316002)(8676002)(478600001)(8936002)(5660300002)(41300700001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?M1JhQkJkUmpyTjRURXFOTjlScjUvdTdRUDlQTDN1b1JMSFFva005c3daSHJn?=
 =?utf-8?B?WHgrSGRpV3p4MGE3SnE3RFlqNUtEVHo0YW81WGZmM2d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ELqlQmobE/kZu6f/T28+bjBHcF6MbeRE4At7tXCkXm9vpO6lesh/JL9nLhKNKR8SydJZWkpB2aTTrD5hr+NwEPCISlyVeO3H0zl8pm1UiVtKNCPY0nt+lhCkZbTd4Zbl52cOosM6Qp0xc01JU4mSkVpstkYXXnWnLgNHIsy9AKZy/h2klJtgDaNqzHofbTqBWN4SKHP4Rfzs4aCN5GAPhxObM5KI+Jex/ZX5AgyBqIgiv190j8cADxcVgqT8CK191w
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2213edac-1ba4-4ced-8998-08db878cac42
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 12:44:06.0689
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: +CX60RyCCa96JW+b/Qz0SjWi7VHBv3y5BE/j2zN5BhoKTYXw+ZS+eQiY011nNQwUYaBKZJXKEyhC9fHC1os6PQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR03MB5317

Preparatory change to unify the IO-APIC pin variable name between
io_apic_read_remap_rte() and amd_iommu_ioapic_update_ire(), so that
the local variable can be made a function parameter with the same name
across vendors.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
Changes since v1:
 - New in this version.
---
 xen/drivers/passthrough/vtd/intremap.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 786388b4d9c7..05df6d5759b1 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -441,14 +441,14 @@ unsigned int cf_check io_apic_read_remap_rte(
 void cf_check io_apic_write_remap_rte(
     unsigned int apic, unsigned int reg, unsigned int value)
 {
-    unsigned int ioapic_pin = (reg - 0x10) / 2;
+    unsigned int pin = (reg - 0x10) / 2;
     struct IO_xAPIC_route_entry old_rte = { };
     struct IO_APIC_route_remap_entry *remap_rte;
     unsigned int rte_upper = (reg & 1) ? 1 : 0;
     struct vtd_iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic));
     int saved_mask;
 
-    old_rte = __ioapic_read_entry(apic, ioapic_pin, true);
+    old_rte = __ioapic_read_entry(apic, pin, true);
 
     remap_rte = (struct IO_APIC_route_remap_entry *) &old_rte;
 
@@ -458,7 +458,7 @@ void cf_check io_apic_write_remap_rte(
     __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
     remap_rte->mask = saved_mask;
 
-    if ( ioapic_rte_to_remap_entry(iommu, apic, ioapic_pin,
+    if ( ioapic_rte_to_remap_entry(iommu, apic, pin,
                                    &old_rte, rte_upper, value) )
     {
         __io_apic_write(apic, reg, value);
@@ -468,7 +468,7 @@ void cf_check io_apic_write_remap_rte(
             __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
     }
     else
-        __ioapic_write_entry(apic, ioapic_pin, true, old_rte);
+        __ioapic_write_entry(apic, pin, true, old_rte);
 }
 
 static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 12:44:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 12:44:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565177.883093 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLk3m-0002Ty-7C; Tue, 18 Jul 2023 12:44:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565177.883093; Tue, 18 Jul 2023 12:44:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLk3m-0002Sc-1a; Tue, 18 Jul 2023 12:44:10 +0000
Received: by outflank-mailman (input) for mailman id 565177;
 Tue, 18 Jul 2023 12:44:08 +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
 <SRS0=c9jt=DE=citrix.com=prvs=5561f9d71=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qLk3k-0002IP-Rc
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 12:44:08 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c74cb906-2568-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 14:44:06 +0200 (CEST)
Received: from mail-dm6nam12lp2176.outbound.protection.outlook.com (HELO
 NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.176])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 18 Jul 2023 08:44:03 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by MN2PR03MB5326.namprd03.prod.outlook.com (2603:10b6:208:1f0::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.23; Tue, 18 Jul
 2023 12:43:50 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 12:43:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c74cb906-2568-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689684245;
  h=from:to:cc:subject:date:message-id:
   content-transfer-encoding:mime-version;
  bh=CkmokN9cANZkR6GyiiDDkF8ng/l/WQMYI2bSbWYvkwg=;
  b=H0ofIijM9/mBjQOwp3Kt/8mtOOown1Eupf7c+QJE/AKNJ0MuX2aQMKms
   glgUpmLkKCbRol7D7jCKVPmT6IxtW2mysXk03UDwuvd+TJSkKBc7gNBFP
   JQJrWfRqAymVJAevXKA63UKxe8tWLb1lRwXa704qZMH0sH3c2FZoti+yj
   w=;
X-IronPort-RemoteIP: 104.47.59.176
X-IronPort-MID: 115292217
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:wkaqTKyd+6DxPzho8PN6t+f1xyrEfRIJ4+MujC+fZmUNrF6WrkUEy
 2tKUGyEbv+KNGH0cogkOdy29RhQsZfQnd42SAVq/CAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhPKAT5jcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KVpJq
 dkkLgIQUjeg2v2J8IOkVfhriMt2eaEHPKtH0p1h5RfwKK98BLzmHeDN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjmVlVMvuFTuGIO9ltiiX8Jak1zev
 mvb12/4HgsbJJqUzj/tHneE37aSx3KhAttNfFG+3twxqlC0w1QxMQ8La1qrhsLp1WOSa90Kf
 iT4/QJr98De7neDXtT7GhG1vnOAlhodQMZLVf037hmXzajZ6BrfAXILJhZDYtE7sM49RRQxy
 0SE2djuAFRHr7m9WX+bsLCOoluaOiULLGlEeS4NSyME5cXupMc4iRenZs5qDaqdntDzXzbqz
 Fi3QDMWgrwSiYsH0vu99FWe2Ta0/MGWEEgy+xndWX+j4kVhfom5aoe06F/dq/FdMIKeSVrHt
 38B8ySD0N0z4Vi2vHTlaI0w8HuBvp5p7BW0bYZTIqQc
IronPort-HdrOrdr: A9a23:jNv+VqBYHB6d1iblHemG55DYdb4zR+YMi2TDj3oBLSC8cqSj+/
 xG785rsiMc6QxhIE3I/OrqBEDuexPhHPJOi7X5eI3SOTUO21HYV72Kj7GSoAEIcheWntK1l5
 0QEZSWY+eeMbEOt6fHCX6DferIruPrzEniv5a5854kd3ASV51d
X-Talos-CUID: 9a23:zR7O7WPQWnBSHu5DYy470XISKN0ZVV6A00jgElCnGGFnR+jA
X-Talos-MUID: 9a23:wevIQwXcwRbkc6Xq/B23rjxFMf9K2razNkEdtq5W5OSoBSMlbg==
X-IronPort-AV: E=Sophos;i="6.01,214,1684814400"; 
   d="scan'208";a="115292217"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=PgQeRyj5g3hI/hDuASni94BQhm8KSAjYmXS00Yg3BdxpMDHr4IUgVpG50r2S11EwTCA0PrehX75qkLNRLs/wbbstON+OkyDXIP1cyvVur/Jri4V4egRMibcmUiybVl/ZDmCPo60N1lLwRREvGGpYVpV4IIDyJBsie2UJ/I6AtAH32iEbQWcGtCrRzdErHjXzPsIbnHokEcOylmoNWbVollXUXXAaJLze326+j5+kWRN9Ni4GQKuTcrqsLV14/l8dJ1ofurVZaVYanObxopei2zHJLNEYV3II6ZadM8BT7koVNvltKLYT/NphXE9dlXELEA62wLkDhZCrGIZg6PazYw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=z8iSW6BR8tHSaCafmxrsbjXhx+JZIcoHj9dYYbMKwRI=;
 b=SmFaQVtNEEt29pRrh2qHWoyZ+qU6s07AJhomnMWseWEbSaH5VWRuae1DaEWLmR3jOGAp0ybdmYJYX7JroyRGE8zvswqdRlWPZRGeKK04HCVOnQU6UQ9gWZ51iXC/Om4GcKFQ9M9yALhua8+daT1WDadAgaxxcAqayhlxGQftOjBzPVnhOuCev99T/g4w6D9NSZObClh2g89SbVkGrbuB7sz5FYp81DIWuNFiCZSpIvc1n/ovqqFsSfOJ7elMuDmMo0gBrY3gwc6Z7QxaiKbfsCujMu7uZr2SOXZqAsWQzyF+lsjwW6XMcjFz69RbllGKzgaRhgcvjygCnndsYAiUuQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=z8iSW6BR8tHSaCafmxrsbjXhx+JZIcoHj9dYYbMKwRI=;
 b=bYzhYv9O1lpL/4xur9PcP9Si+CmHP33Fa3VFu92eTr3aAf9WfVWKizpSj1N0vTeI5R4uP9PsgnKtma9fJEcizfO9cL6Ij2bMOY7EsgiXOYZsWrEoVHSgZS/OqjX69HJBkYAe0QqOkdCVi2Hifs/mdEB7Sk2KN5+hrBUVtl4eAEg=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>,
	Kevin Tian <kevin.tian@intel.com>,
	Paul Durrant <paul@xen.org>
Subject: [PATCH v2 0/5] x86/ioapic: fix edge triggered interrupt migration
Date: Tue, 18 Jul 2023 14:43:29 +0200
Message-ID: <20230718124334.36548-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0322.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:390::16) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|MN2PR03MB5326:EE_
X-MS-Office365-Filtering-Correlation-Id: 3999a059-8bdb-4425-2c4c-08db878ca209
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Sn61c3XbxTLWhxb4GD7HxV+iQI6xoLjq98jPYAJyYcRQ+maIjQrcl6xwOxmJewGKo2z8UqDmWyNYP2jNAq71h7MxQ+aA+ffbM+FVWrIoyhX8Fw6D7logYrBfbzQDV74E36waRtjgpgN3ObWlch9jydbfpUGhvjy/gs30YdgnpAorJF7vtXVvlepEbIt7SSI84ckMkNbF6hCO4+z2CEKm+Bz2dt0Bc9qgp4w3OKb+ZcZciaKd9dhjTX5Cx7Vvv2QHa6dHWxfiAwKiPXdlCuvuJOR288aZnJdPTSvWkvTW4sJgqJVyxTWO/MrMn4lv8adMb9szrW4GqOokF4L44lh/cPdmFrVVqWGZuvZc6UBiVs0+DdbVXu7Mxv+IRKbzLZqb4VSn1CZLuVTYx5EbzOtWRKLiN6zrUOpJxKCnQwVNzvVFKpAxW6s5wVaxtd24LB8SkAAJa//c6yUWbANjKDtaOZ7rxTym+IiQB68FpwNhAwJ1p2x3H3wYGkmrPwJ3tRkR35l9b1DIzQtBWKiHC9KwPHwo9ueq8sgmXtZlCturXEcd04mKfoykUYkSS6OD7V4h
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(366004)(346002)(376002)(396003)(451199021)(2906002)(66899021)(8676002)(8936002)(66556008)(66476007)(6916009)(4326008)(66946007)(316002)(41300700001)(5660300002)(6512007)(26005)(1076003)(6506007)(36756003)(6486002)(186003)(478600001)(6666004)(54906003)(83380400001)(2616005)(82960400001)(86362001)(38100700002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NHBjUTZBNjBBai9WMlNkeWZ1Qk4xbEJPeVhOc01VY3N4VmlXcy9DL0NPa2xZ?=
 =?utf-8?B?YUp4eHhWaGZ6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l2N6OfV3pxmN/i0Z+JrvUsMYB3Zl/hIRTMiWZqKQE2bamN2zT1a1ZsB+G3+tF+Ixhwxmt1LDX8zGqjCWu5b+zn/P3D3Q6+q8iwPhbLOzyEjWX1N4PVHvRo0si7theT0ZNhjEX8FOZ/ndKHnGVz3AEXgXoBLTV0ITCy/PLjEPF0HHA/NlCDjcQiP/vPp1ac1BGfhrohzUZTmbZcIDAXbfb1aq67lcF1Qup4zf7CYFvcMrHbA9s0Q9Rjlqq0houuVCezn82sYcDeBIEj42K7xKjp+FRRTyN04dwFa2Hb5qToneWSiED6tT+2KOg+AliryAiwE=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3999a059-8bdb-4425-2c4c-08db878ca209
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 12:43:49.0037
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: w2XltR3yTr43AbQLWnWgyf+CzO2FWUyj2w796WXPEnk2J1Y83MDZ568+O4bjuNJRxxf5dlEtdvDW5TYcKEL5Mg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR03MB5326

Hello,

Following series attempts to solve the issue with IO-APIC edge triggered
interrupts seeing an inconsistent IRTE when injected while being
migrated.

It's been simplified a bit from the original RFC, and does make the
logic in the IOMMU RTE update handlers cleaner, as those get passed the
full RTE.

When not using interrupt remapping the logic is left as-is.  One further
change would be to mask edge triggered interrupts, as destination and
vector cannot be changed atomically when dealing with plain IO-APIC
RTEs.

Last patch has also been adjusted in order to always to atomic IRTE
updates on AMD.

Thanks, Roger.

Roger Pau Monne (5):
  x86/ioapic: add a raw field to RTE struct
  x86/ioapic: RTE modifications must use ioapic_write_entry
  iommu/vtd: rename io_apic_read_remap_rte() local variable
  x86/iommu: pass full IO-APIC RTE for remapping table update
  amd/iommu: force atomic updates of remapping entries

 xen/arch/x86/include/asm/io_apic.h       |  65 +++++-----
 xen/arch/x86/include/asm/iommu.h         |   3 +-
 xen/arch/x86/io_apic.c                   |  40 +++---
 xen/drivers/passthrough/amd/iommu.h      |   2 +-
 xen/drivers/passthrough/amd/iommu_init.c |  10 ++
 xen/drivers/passthrough/amd/iommu_intr.c | 155 +++--------------------
 xen/drivers/passthrough/vtd/extern.h     |   2 +-
 xen/drivers/passthrough/vtd/intremap.c   | 131 ++++++++++---------
 xen/drivers/passthrough/x86/iommu.c      |   4 +-
 xen/include/xen/iommu.h                  |   3 +-
 10 files changed, 156 insertions(+), 259 deletions(-)

-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 12:44:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 12:44:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565179.883121 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLk42-0003j0-Te; Tue, 18 Jul 2023 12:44:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565179.883121; Tue, 18 Jul 2023 12:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLk42-0003ir-PV; Tue, 18 Jul 2023 12:44:26 +0000
Received: by outflank-mailman (input) for mailman id 565179;
 Tue, 18 Jul 2023 12:44:26 +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
 <SRS0=c9jt=DE=citrix.com=prvs=5561f9d71=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qLk41-0002IP-Ur
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 12:44:26 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d1ffebea-2568-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 14:44:23 +0200 (CEST)
Received: from mail-bn8nam11lp2169.outbound.protection.outlook.com (HELO
 NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.169])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 18 Jul 2023 08:44:21 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by CO6PR03MB6228.namprd03.prod.outlook.com (2603:10b6:5:35c::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 12:44:18 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 12:44:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d1ffebea-2568-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689684263;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=hCgfqa99aIjybw0r0e16yWne8XxslcvUQBLlF7gjjSw=;
  b=QcYIFx4bjvPso54iDLpBPR2JYJX9wqvU5zDTojwqdBn/DPNqeuJdAGaS
   ztsAEl+cPoJcP0dgYkEVdqdIGp/ABoySOSHEEeyNuMMzwIlESqISWhUOp
   yBf6MOSWcJQijXfomONo9uu8LV9lomMrJQhomnhO20UPmVKoScrJ1ZmzP
   I=;
X-IronPort-RemoteIP: 104.47.58.169
X-IronPort-MID: 115292242
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:jKGBsqKlsknkD1m0FE+Rw5QlxSXFcZb7ZxGr2PjKsXjdYENS1mNTy
 2cZC2+Haf+NMGXyeNx3OYrk804H6sDQyIVkQAplqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws
 Jb5rta31GWNglaYCUpKrfrawP9TlK6q4mhA4QVuPaojUGL2zBH5MrpOfcldEFOgKmVkNrbSb
 /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/
 jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c4pXF0U8
 foVdAkgMDzehf7rh7C+aNFz05FLwMnDZOvzu1lG5BSAVLMMZ8CGRK/Ho9hFwD03m8ZCW+7EY
 NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/dnpTGNnWSd05C0WDbRUsaNSshP2F6Ru
 0rN/njjAwFcP9uaodaA2iv127Wex3mnAur+EpW82a5OxwadxFY+IzImU1eqvNCJpGGhDoc3x
 0s8v3BGQbIJ3FymSJzxUgO1pFaAvwUAQJxAHusi8gaPx6HIpQGDCQAsTDRMddgnv88eXiEx2
 xmCmNaBONB0mLicSHbY/LHEqzq3YHERNTVbO35CShYZ6d7+po11lgjIUttoDK+yiJvyBC30x
 DeJ6iM5gt3/kPI26klyxnif6xrEm3QDZlddCtn/No590j5EWQ==
IronPort-HdrOrdr: A9a23:niYq6qodJNnauVOIbxYIdX0aV5oUeYIsimQD101hICG9E/bo9f
 xG+c5xvyMc5wx9ZJheo6HmBEDtex/hHOdOj7X5ZI3MYCDDmE+FaL5P1rHD5RqIIVyaygc+79
 YFT0EWMrSZMbEdt6bHCWKDYrUdKbe8kZxAjN2uqUtQcQ==
X-Talos-CUID: 9a23:vEr0b2734+aYBOUAoNssqhMoQMQjfyHk4Sn8fk2kVCFrTZ+tVgrF
X-Talos-MUID: =?us-ascii?q?9a23=3AnGZT8g1GLnLlsU9jU3Of97iY8zUj54v+LAdWn5c?=
 =?us-ascii?q?8luKrBSp8Kiq0vBqYXdpy?=
X-IronPort-AV: E=Sophos;i="6.01,214,1684814400"; 
   d="scan'208";a="115292242"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=mrOrcUCYGgBITWqHb5MiO8D2RjiZ5/TAPwfSdBLIEwGKXixFnAKbKXudDro36liAZ29023xrAKC1m9dXmYn6tzrlD8+YSPDyQqxPDLvy9I/MlIkQkPk8cXtsS+UVP7zBvM1B8Uq123bdjEgtI8bxiVufm/pRuWxzLgz6WNqpKMeM3RHdnK9OrLFScapI/tlR5+BO+6+V56Qkvf4DkAjUG8uFCOkj4lnyvkM1n3utw5qBdtyq+qwO4wFW25RtJofslftmR/VKkhCbAvT3+g88wwbpOpi1OQ6zBfoYCNUANSHoz/uSj0RJOAS+kyhdbZ8KocQgLp7HGMIWUaToVz4FjQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=8iXg4dFK7b5fi2DFIu2Ng5SgE/oKjRZe5KO1fq6oWYI=;
 b=coNzYb5K0WPWz2eAI7Ay9BiCljd6BE+BUCjMAAEg4AS0qewq6aziMeF2KC/FcAuhPEk9+iHe94v09jbQZrMC5w13RRAI/wAcB+FCEKTeM0OvoZ4gEkcTNYksD3XovzuuOdI3z1leXLAfCkNWUeBYoNU/R06U9EQ7FR4jpq9wElJro5KGmeNpodlPjdITOQ+FL4wnl0CmaS1B1Gn/D/KPiKYZYpHwspdj+LBmkkMpLF9bdoizUJOBoiL8w9I3OfbSxORVn/a0ocLa8jgrO7HKLomBFmk74zoUTA24raWFVf53diXeDy3/Hj6F+6zgEURQo00SEzVmndY1hBNoiVQoWQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=8iXg4dFK7b5fi2DFIu2Ng5SgE/oKjRZe5KO1fq6oWYI=;
 b=plRniVmTRIOYiv0yfZQQ/j9If6juZ1dD2hW2A4fXREBNCgiHAiGHALTXaeKu9+Mx/A+TWp/YMScJ5rHiaW6K/4xcCY75/0TxIoELKs493aDh3BjccX8aEO2ZnM9AuVGHZM0ErG/156YYJ76zOa+06RUmfW8o7Tqb1XmLg4Cafxs=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v2 5/5] amd/iommu: force atomic updates of remapping entries
Date: Tue, 18 Jul 2023 14:43:34 +0200
Message-ID: <20230718124334.36548-6-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230718124334.36548-1-roger.pau@citrix.com>
References: <20230718124334.36548-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0685.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:37b::8) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|CO6PR03MB6228:EE_
X-MS-Office365-Filtering-Correlation-Id: 42d1e4a2-5383-4753-9cc3-08db878cb3c8
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	clir5641M7Bu5qwJaOwC4H5kakyPAq9Gww7UN9bRviMzNt2Kp36CAefGRyuZeZpITBnN3hHJLyaU3CDb+6W4sh3tLt4hgd7z97mfRTo0kkMipnAxQxBJ+AxSgePYQxCCYA2RpRgTm82UMtV3DU4jzr5mKmH/0L1bObFNsV87untf/8Q8arwbZE6DvWpKvpuRLBQXnI1e6n3/p/+iktDuA49pGf4gGVavsO27lRWYJCxKJJ8jgOSb7reBjub+Twr+DWTnDd0LOovhQimnRvHjv2JeaX5aRKiQAuG5arXfMzNKIjSXhfutwGjWyqfXU88gcc8XcHS4HD2H6xnr6N6JGnA/CZkRtXHyXFpswoK/Vuvw6U0zZrqoDNOrC0mDM4iNLEVoTYm4LpK8UMcz4kdKR49PgGP4o06okdgmuqjEOAgY03ugNgp+CqN8hM5ZejGlbclKtQwGJspgWjTL9efUtxEBhuUdialg7Nf7NSItaaQQlO3jyyXmq7NU4xezT3i9p2ygLspc7T+J5GRd9/oPUVjg9lEqBWBub6ReqAaPhMdTAIZvZPHw4kzAPMT1ylQa
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(366004)(346002)(396003)(136003)(376002)(451199021)(54906003)(478600001)(6506007)(26005)(186003)(1076003)(107886003)(6486002)(6666004)(6512007)(2616005)(83380400001)(15650500001)(5660300002)(86362001)(38100700002)(8676002)(8936002)(41300700001)(82960400001)(4326008)(6916009)(316002)(2906002)(36756003)(66946007)(66556008)(66476007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NVZWNm9JTTArOXRDbmwxdnQzMDlXMUJhZ1RXaDJvNHNJeGtsTmliWXRQbVFK?=
 =?utf-8?B?bStQaUw1cjlMNHQ1UGFxcmJMTWJGQjhSaFFhK3l5V1g2RCtUa29KNXc0dEJX?=
 =?utf-8?B?NTFXSFV3bzVvUjlGOUNlTkJpNFY3Q2FWTzNRY3JqZ3pJdGtxTUFGNWMwVFpE?=
 =?utf-8?B?WGhXNG5hVlpSSGplbkRZcFp0Q3daOFFmVTM1dnpiUVFlM0ZyWXl0VGN3UHo3?=
 =?utf-8?B?K0FTVlJ6bytCZzY3a1ZXbDJaa0M3cDVuMURvOWRSeEtZWGV6SnpaQjlUdGl6?=
 =?utf-8?B?RGdRTGVmejQ0eFV4L3lsSm1u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g: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 42d1e4a2-5383-4753-9cc3-08db878cb3c8
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 12:44:18.6826
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: w6uYqf8IyT1/1AJPsvGibuxokpUwa2CnxY6hWhs9al6d2roggPrMYsqEZGGVoujtBGerwxkBOVYw1zrpqMWWZA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR03MB6228

Disable XT (x2APIC) support and thus 128 IRTE entries if cmpxchg16b is
not available, do so in order to avoid having to disable the IRTE (and
possibly loose interrupts) when updating the entry.  Note this also
removes the usage of a while loop in order to disable the entry, since
RemapEn is no longer toggled when updating.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
x2APIC support was added late enough on AMD that CPUs that I believe
all models that have x2APIC must also have CX16.

The AMD-Vi manual contains the following advice in the "2.3.2 Making
Guest Interrupt Virtualization Changes" section:

"""
If RemapEn=1 before the change, the following steps may be followed to
change interrupt virtualization information:
 * Set RemapEn=0 in the entry to disable interrupt virtualization;
   device-initiated interrupt requests for the DeviceID and vector are
   processed as IO_PAGE_FAULT events.
 * Update the fields in the IRTE and invalidate the interrupt table
   (see Section 2.4.5 [INVALIDATE_INTERRUPT_TABLE]).
 * Set RemapEn=1 to virtualize interrupts from the device.
"""

However if the update of the IRTE is done atomically I assume that
setting RemapEn=0 is not longer necessary, and that the
INVALIDATE_INTERRUPT_TABLE command can be executed after the entry has
been (atomically) updated.

Note that on VT-d IRTEs always have a size of 128b, so it's not
possible to use a smaller entry size if CX16 is not available in order
to do atomic updates.
---
 xen/drivers/passthrough/amd/iommu_init.c | 10 +++++
 xen/drivers/passthrough/amd/iommu_intr.c | 57 +++++++-----------------
 2 files changed, 26 insertions(+), 41 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index af6713d2fc02..e276856507a1 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -1417,6 +1417,16 @@ int __init amd_iommu_prepare(bool xt)
             has_xt = false;
     }
 
+    /*
+     * Prevent using 128bit IRTE format if there's no support for cmpxchg16b
+     * to update the entry atomically.
+     */
+    if ( xt && has_xt && !cpu_has_cx16 )
+    {
+        has_xt = false;
+        printk(XENLOG_WARNING "AMD-Vi: x2APIC not supported without CX16\n");
+    }
+
     if ( ivhd_type != ACPI_IVRS_TYPE_HARDWARE )
         iommuv2_enabled = true;
 
diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index bb324eb16da1..4c6122a099f2 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -39,6 +39,7 @@ union irte32 {
 };
 
 union irte128 {
+    __uint128_t raw128;
     uint64_t raw[2];
     struct {
         bool remap_en:1;
@@ -221,15 +222,16 @@ static void update_intremap_entry(const struct amd_iommu *iommu,
                 .vector = vector,
             },
         };
-
-        ASSERT(!entry.ptr128->full.remap_en);
-        entry.ptr128->raw[1] = irte.raw[1];
-        /*
-         * High half needs to be set before low one (containing RemapEn).  See
-         * comment in free_intremap_entry() regarding the choice of barrier.
+        union irte128 old_irte = *entry.ptr128;
+        __uint128_t ret = cmpxchg16b(entry.ptr128, &old_irte, &irte);
+
+         /*
+         * In the above, we use cmpxchg16 to atomically update the 128-bit
+         * IRTE, and the hardware cannot update the IRTE behind us, so
+         * the return value of cmpxchg16 should be the same as old_ire.
+         * This ASSERT validate it.
          */
-        smp_wmb();
-        ACCESS_ONCE(entry.ptr128->raw[0]) = irte.raw[0];
+        ASSERT(ret == old_irte.raw128);
     }
     else
     {
@@ -298,21 +300,12 @@ static int update_intremap_entry_from_ioapic(
 
     entry = get_intremap_entry(iommu, req_id, offset);
 
-    /* The RemapEn fields match for all formats. */
-    while ( iommu->enabled && entry.ptr32->flds.remap_en )
-    {
-        entry.ptr32->flds.remap_en = false;
-        spin_unlock(lock);
-
-        amd_iommu_flush_intremap(iommu, req_id);
-
-        spin_lock(lock);
-    }
-
     update_intremap_entry(iommu, entry, vector, delivery_mode, dest_mode, dest);
 
     spin_unlock_irqrestore(lock, flags);
 
+    amd_iommu_flush_intremap(iommu, req_id);
+
     set_rte_index(rte, offset);
 
     return 0;
@@ -321,7 +314,6 @@ static int update_intremap_entry_from_ioapic(
 void cf_check amd_iommu_ioapic_update_ire(
     unsigned int apic, unsigned int pin, uint64_t raw)
 {
-    struct IO_APIC_route_entry old_rte = { };
     struct IO_APIC_route_entry new_rte = { .raw = raw };
     int seg, bdf, rc;
     struct amd_iommu *iommu;
@@ -343,14 +335,6 @@ void cf_check amd_iommu_ioapic_update_ire(
         return;
     }
 
-    old_rte = __ioapic_read_entry(apic, pin, true);
-    /* mask the interrupt while we change the intremap table */
-    if ( !old_rte.mask )
-    {
-        old_rte.mask = 1;
-        __ioapic_write_entry(apic, pin, true, old_rte);
-    }
-
     /* Update interrupt remapping entry */
     rc = update_intremap_entry_from_ioapic(
              bdf, iommu, &new_rte,
@@ -469,22 +453,13 @@ static int update_intremap_entry_from_msi_msg(
 
     entry = get_intremap_entry(iommu, req_id, offset);
 
-    /* The RemapEn fields match for all formats. */
-    while ( iommu->enabled && entry.ptr32->flds.remap_en )
-    {
-        entry.ptr32->flds.remap_en = false;
-        spin_unlock(lock);
-
-        amd_iommu_flush_intremap(iommu, req_id);
-        if ( alias_id != req_id )
-            amd_iommu_flush_intremap(iommu, alias_id);
-
-        spin_lock(lock);
-    }
-
     update_intremap_entry(iommu, entry, vector, delivery_mode, dest_mode, dest);
     spin_unlock_irqrestore(lock, flags);
 
+    amd_iommu_flush_intremap(iommu, req_id);
+    if ( alias_id != req_id )
+        amd_iommu_flush_intremap(iommu, alias_id);
+
     *data = (msg->data & ~(INTREMAP_MAX_ENTRIES - 1)) | offset;
 
     /*
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 12:44:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 12:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565184.883131 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLk49-0004Np-DW; Tue, 18 Jul 2023 12:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565184.883131; Tue, 18 Jul 2023 12:44:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLk49-0004Mn-7z; Tue, 18 Jul 2023 12:44:33 +0000
Received: by outflank-mailman (input) for mailman id 565184;
 Tue, 18 Jul 2023 12:44:32 +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
 <SRS0=c9jt=DE=citrix.com=prvs=5561f9d71=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qLk48-0002IP-8L
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 12:44:32 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d55173fd-2568-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 14:44:29 +0200 (CEST)
Received: from mail-bn8nam11lp2169.outbound.protection.outlook.com (HELO
 NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.169])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 18 Jul 2023 08:44:21 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by CO6PR03MB6228.namprd03.prod.outlook.com (2603:10b6:5:35c::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 12:44:12 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 12:44:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d55173fd-2568-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689684269;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=QGsl4OT+iTggPUJrovUVSAuwyNeFqK9Pe6BIahwm9qQ=;
  b=EO2UdwYubFl2bMITFV5Sn4Ywg6nMogUSEF0Gc+tfqy7S3df3BFBGSLff
   kjBIivgMD341hgdbcSyV4wRXffngogA3+E+u6e3e2LRs6k/yE9WACmh+W
   U23l98w2+y1R1MmtL+9gkZt37Lz0TQDinbehvJq9glXxI5TgP/PM9PjBS
   4=;
X-IronPort-RemoteIP: 104.47.58.169
X-IronPort-MID: 119178503
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:9XYdM6JYSGuh+MPFFE+RE5QlxSXFcZb7ZxGr2PjKsXjdYENShT0Bz
 mZMXW6Fa/rcYmb2edBzO4238EwCvZ/TyYU3TgRlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws
 Jb5rta31GWNglaYCUpKrfrawP9TlK6q4mhA4QVuPaojUGL2zBH5MrpOfcldEFOgKmVkNrbSb
 /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/
 jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5zAXhQ+
 swULQxSLTfev+2926+6Tflz05FLwMnDZOvzu1lG5BSAVLMMZ8CGRK/Ho9hFwD03m8ZCW+7EY
 NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/dnpTGNnWSd05C0WDbRUsaNSshP2F6Ru
 0rN/njjAwFcP9uaodaA2iv117aQzX6jA+r+EpW/9PVJkgOdx1dPJx0xamGRosSmqxSxDoc3x
 0s8v3BGQbIJ3FymSJzxUgO1pFaAvwUAQJxAHusi8gaPx6HIpQGDCQAsTDRMddgnv88eXiEx2
 xmCmNaBLSNrmK2YTzSa7Lj8hTC/JykTa3MDbCksTA0Z7t2lq4Y25jrXR8tnOL64iJvyAz6Y/
 tyRhC03hrFWh8hb0ay+pAnDm2j1+MmPSRMp7ALKWG7j9hl+eIOue42v7x7c8OpEK4GaCFKGu
 RDohvSj0QzHNrnV/ATlfQnHNOjBCyqtWNEEvWNSIg==
IronPort-HdrOrdr: A9a23:w45Mw6t8ZdnHkdsHU+b/nWLW7skDldV00zEX/kB9WHVpm6uj5r
 +TdZUgpGPJYVMqM03I9uruBED+ewK/yXcY2+cs1M6ZLXHbUQiTTL2Kj7GP/9S6IVycygc178
 4JT0EXMrzN5DNB4PoSjjPTLz7OqOP3iZxBaI/lvgxQpcEDUdAc0+7TMHf/LmRGABhdIZI4EZ
 qa6OpLzgDQA0g/X4CrHF0IRfLKqdHqmfvdEHg7Lg9i6QWHgD+y3rrmGxiUty1uNA9n0PM57W
 PEnmXCl8Gej80=
X-Talos-CUID: 9a23:XV0Gtm/MRpJsFBXeiGGVv0oUA94qQnHY8CiTBBKABm1yVbySWUDFrQ==
X-Talos-MUID: 9a23:Wnw27wZrWpGVHOBTsD3npyM8OsZTv4uuL383u5Y7pOjeOnkl
X-IronPort-AV: E=Sophos;i="6.01,214,1684814400"; 
   d="scan'208";a="119178503"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ZZFQOPbvcaD0YYxeYe6fwavvQPm58Srzz8Or2MuED3Rl74URLMfEvorEhTPgSPL7zYJqxHJG4YpTWeNRn5w51r2kJpjlXNknsaWhVoO2lJYnaiLeqKz4VpwwcWniItmbdqUJA5u/HoKEr7pfztdJNi0LqGlmobzJQ3a0rDteNT9m62mzDE6XWwO5hFzAkjVvz60Olo/LG3J26J1/2LKJWqW/chtXvtjU6MZVLl6P62EyXho6BWoEmfglUKmmJs4hDmrGzSM6S8EhkQ6y5uWSHbZp0yx+prSEb7h117uwQ0I+D1ZXbHFSUuY8H5bHieLsSmMQlX7xoC5qUuNbsaLPcQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=D+ah55pwSKrj0QLPdtYi0rT2uASDXc6qmyPXuOczQlM=;
 b=YmgOxT9A8x0JMoM7GFp8XkzOBkOyk+K7EbmQ8LTRskR4LQyZaLSmyQDSjcXFPLddACn0uAT8Az9yAN5veJF1r8fds/du+YJ1qhgxGd4GLb/7anXUnI+sJSM6AlWlXgT7KPKp1W5EdGsjk2RJUQZm/k+q8mA+md4BYZHC4FbG04bba8BH21z7SQXD8Fu14PVlyeZcLo07eswVxChb2kP1z6FHWZ/JAMl9TLSVQU1xqeHYJ2mzy5PFBTxGXd2YOA+nqg5Hi02U63hWFhy458bd8rK0c3neMOpfc1UiyU0senCEAziqTKR/95NGiq6ZjCoTfwyLA1HpJsV9UBPizz3Yug==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=D+ah55pwSKrj0QLPdtYi0rT2uASDXc6qmyPXuOczQlM=;
 b=vUbbJrORQO5hOxzZ8jJVk6gqHkwjSLHtaXWUgEUaH2ZBYNVl5jkviIkkvQwvtMKE219iqeOfR7yK9sVimd5EUa7FUSNUU0II8gA+kKsqNjIHovbqcnbHFqjOh9p6O76xgxHgx+hWldCrH3TFe+uvDAvZb1nRLojyjPyZB5tc6RA=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>,
	Kevin Tian <kevin.tian@intel.com>,
	Paul Durrant <paul@xen.org>
Subject: [PATCH v2 4/5] x86/iommu: pass full IO-APIC RTE for remapping table update
Date: Tue, 18 Jul 2023 14:43:33 +0200
Message-ID: <20230718124334.36548-5-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230718124334.36548-1-roger.pau@citrix.com>
References: <20230718124334.36548-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0598.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:295::22) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|CO6PR03MB6228:EE_
X-MS-Office365-Filtering-Correlation-Id: 4345a27c-46f0-4ba6-9603-08db878cafe6
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	BUKvqZ0Q75s5d8h54maaX3+fWQkX9C4T2Sc8PmZL5Ps4WW2kpb1NFDWh67rfXcHwmiN8bX4MiT4slMeSxfpEFIVzeddntwq0ipqm91g+Pa5gpt22QzOri+FKS8mfcy1gVsqvdm/kMIvUamaGnBXuewZnB6OYUU2MOUY8+dZRxsVvk/C/qP+3+bfiTCuM0mtJ5lpCtXdrmhg/UGoY/OOesrtJppXN/wd+VFtufl+TwReBugiY5VA2QO/g3JlwfE8GzEiTLBJy07KK6mRe6de9/I9aobhXF612m3gc93l9gMLewWgKUcTkwnO0/tn4l8Xw8gOYuL4fF7IjjkVs48dNgPc7fsCJM7CFPAQnUIT7SIuyLfYh2q2r7V0cYGcAnaZ7EGTmgRN0crPpOcEaVZ/B2ood7n2BvAxvMF13l5dvopqgz7nWHFcAWCkq7hOygE+lEb2Apm5/rZplQCL4oywvdGXu5xjofEU7YeuhfgRqCF+xsR6kuLXfFdnl/vGzzeCD6ju0SURdyZPlGvWY36SuPFiC+Fqppw31W8OAxYyFrtsELeSJtDS7HJewIvWNtS/o
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(366004)(346002)(396003)(136003)(376002)(451199021)(54906003)(478600001)(6506007)(26005)(186003)(1076003)(6486002)(6666004)(6512007)(2616005)(83380400001)(15650500001)(5660300002)(86362001)(38100700002)(8676002)(8936002)(41300700001)(82960400001)(4326008)(6916009)(316002)(2906002)(30864003)(36756003)(66946007)(66556008)(66476007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MHpzNmt6QjkyMFJVWG9EbDR4RHp6OENXb2NuQ2p2ait2VFZrN2VLT2oreGpy?=
 =?utf-8?B?c3FVNyt0dlk0WmErenlUU1BhT1c2RGtQTjRvRmhPTjJHeEJvZFlKQ1o0bmww?=
 =?utf-8?B?SlNkdnoxYUVPaDM5SkY1Z3FFbG8zT29qLyt3czZ6K3o5dzlieVl6WlBaZFkw?=
 =?utf-8?B?QTkyMGQwTkVlMGMzQUdlYm5VTFZOR3luMU5ielloN1YxVmVVUWhWTnRBdzZD?=
 =?utf-8?B?U2FkSDBhRFR5eTZsWkh6djlkaFk1QTFsaTZ6YzlWZVUzb1B0QXJKQXBFMWl4?=
 =?utf-8?B?dUhiMEcxeEZWNUhZSnFha2d4Yy9Id0QrQ3N5UUNBdWMyU2R0S1dZWHhQRHNh?=
 =?utf-8?B?TmZtcGJEYWNtS3V4S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HZYaERQak5iWW9BMmNveDFaTGtOZXg2eTVvRG1WaXN1T1RRUmM4TG9n?=
 =?utf-8?B?Nnc9PQ==?=
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	UdWsIwL6buICfaqKHyido4dGICvIRPpAl4VTQKDWkwyuKR4+zv/cMIvztyNPh5sK+4hPZpDYKsdjiXGCmw9ZfNMVvjasw2SaVDfhQQ63blgFxN5tPxWTAUF8kCWmZW/BlM4CKaDh9z1U8Mlq2Uq37waNvDJek4n9TmX10IEyp+x/4FJW+SEP3fkei8MHRzo5zzs88w/gIpkvHD0dqAiX+boFMGPqMmSedDNcHuPPmaINlUB9L86C42nZzdaHD80QrE4+8dVylhzwB1sXFWdAbDDI0Uv+nr7Gsp2DWg3+f8om3PeRdYWHn1xAX+0/jvjVr8uKHQtJtO/Fld2OepgkMIHPUbFabf22lOCTgnDoXN7H5FOfLy3v+cUOOwwoBM051WKSttZayqo9h/F+dchBJWu12YJMhZhG0Z+/bzgQtId37obbkBArfr7uWs08/4X/p27UFV7PM5uaiHTl+pqx8gRZXQcy0hSo1KcjKKCHIJ+68p1z2bxciSs/b/e6zjbm2LqK2E1tonV7MMH2yOMHyQJmQOVE46Ipz6+I91ow+5bnpxPVeb4B8/FKdR2myqb4+mPfGnFiTIXZgB5s9DYHM8/x2pO/HaUjA9qXMk+WWCN1TI3XBZKZqjWmAfi4bR6lUdenf4NCdZ34sdh72HC217j6HgY5vPYMsAEvbWSA6R04k0EUU5AgI1116ubIu6AyLMKxx15XuUihd9gtVoqE0fLrK2ear3dH+KfULZaKsw897kHqnTsV2GHgxG1g7sR2bDMO0WwcoJD/Y2m1h9VpcxdouaqL7P1TeaLTdcsjXhC/QGt/5jN9U+jd3WS2juHQ6VigRbTVJ/nUyY6w73pB0XlI8llP/8Mn8qcp/Msx8yc=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4345a27c-46f0-4ba6-9603-08db878cafe6
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 12:44:12.0744
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ilWk9tL+rDO78UYMHQ9QCGOfo3z91C6unLHBQ+pxY6Pcvev/1dyfA3FEkVCi8DDvv1tEQxvrco69OkquwF5mjg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR03MB6228

So that the remapping entry can be updated atomically when possible.

Doing such update atomically will avoid Xen having to mask the IO-APIC
pin prior to performing any interrupt movements (ie: changing the
destination and vector fields), as the interrupt remapping entry is
always consistent.

This also simplifies some of the logic on both VT-d and AMD-Vi
implementations, as having the full RTE available instead of half of
it avoids to possibly read and update the missing other half from
hardware.

While there remove the explicit zeroing of new_ire fields in
ioapic_rte_to_remap_entry() and initialize the variable at definition
so all fields are zeroed.  Note fields could be also initialized with
final values at definition, but I found that likely too much to be
done at this time.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
Note that certain combination of changes to the RTE are impossible to
handle atomically. For example changing the vector and/or destination
fields together with the triggering mode is impossible to be performed
atomically (as the destination and vector is set in the IRTE, but the
triggering mode is set in the RTE).  Xen doesn't attempt to perform
such changes in a single update to the RTE anyway, so it's fine.

Naming the iommu_update_ire_from_apic() parameter RTE is not really
correct, as the format of the passed value expands the destination
field to be 32bits (in order to fit an x2APIC ID).  Passing an
IO_APIC_route_entry struct is not possible due to the circular
dependency that would create between io_apic.h and iommu.h.  It might
be possible to move IO_APIC_route_entry declaration to a different
header, but I haven't looked into it.
---
 xen/arch/x86/include/asm/iommu.h         |   3 +-
 xen/arch/x86/io_apic.c                   |   5 +-
 xen/drivers/passthrough/amd/iommu.h      |   2 +-
 xen/drivers/passthrough/amd/iommu_intr.c |  98 ++---------------
 xen/drivers/passthrough/vtd/extern.h     |   2 +-
 xen/drivers/passthrough/vtd/intremap.c   | 127 +++++++++++------------
 xen/drivers/passthrough/x86/iommu.c      |   4 +-
 xen/include/xen/iommu.h                  |   3 +-
 8 files changed, 80 insertions(+), 164 deletions(-)

diff --git a/xen/arch/x86/include/asm/iommu.h b/xen/arch/x86/include/asm/iommu.h
index 0540cd9faa87..eb720205e25e 100644
--- a/xen/arch/x86/include/asm/iommu.h
+++ b/xen/arch/x86/include/asm/iommu.h
@@ -84,7 +84,8 @@ struct iommu_init_ops {
 
 extern const struct iommu_init_ops *iommu_init_ops;
 
-void iommu_update_ire_from_apic(unsigned int apic, unsigned int reg, unsigned int value);
+void iommu_update_ire_from_apic(unsigned int apic, unsigned int pin,
+                                uint64_t rte);
 unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int reg);
 int iommu_setup_hpet_msi(struct msi_desc *);
 
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 85b4b4c6bc98..255ba3e8b073 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -275,10 +275,7 @@ void __ioapic_write_entry(
         __io_apic_write(apic, 0x10 + 2 * pin, eu.w1);
     }
     else
-    {
-        iommu_update_ire_from_apic(apic, 0x11 + 2 * pin, eu.w2);
-        iommu_update_ire_from_apic(apic, 0x10 + 2 * pin, eu.w1);
-    }
+        iommu_update_ire_from_apic(apic, pin, e.raw);
 }
 
 static void ioapic_write_entry(
diff --git a/xen/drivers/passthrough/amd/iommu.h b/xen/drivers/passthrough/amd/iommu.h
index 8bc3c35b1bb1..aa3681a9f2aa 100644
--- a/xen/drivers/passthrough/amd/iommu.h
+++ b/xen/drivers/passthrough/amd/iommu.h
@@ -300,7 +300,7 @@ int cf_check amd_iommu_free_intremap_table(
 unsigned int amd_iommu_intremap_table_order(
     const void *irt, const struct amd_iommu *iommu);
 void cf_check amd_iommu_ioapic_update_ire(
-    unsigned int apic, unsigned int reg, unsigned int value);
+    unsigned int apic, unsigned int pin, uint64_t raw);
 unsigned int cf_check amd_iommu_read_ioapic_from_ire(
     unsigned int apic, unsigned int reg);
 int cf_check amd_iommu_msi_msg_update_ire(
diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index f32c418a7e49..bb324eb16da1 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -247,11 +247,6 @@ static void update_intremap_entry(const struct amd_iommu *iommu,
     }
 }
 
-static inline int get_rte_index(const struct IO_APIC_route_entry *rte)
-{
-    return rte->vector | (rte->delivery_mode << 8);
-}
-
 static inline void set_rte_index(struct IO_APIC_route_entry *rte, int offset)
 {
     rte->vector = (u8)offset;
@@ -267,7 +262,6 @@ static int update_intremap_entry_from_ioapic(
     int bdf,
     struct amd_iommu *iommu,
     struct IO_APIC_route_entry *rte,
-    bool_t lo_update,
     u16 *index)
 {
     unsigned long flags;
@@ -315,31 +309,6 @@ static int update_intremap_entry_from_ioapic(
         spin_lock(lock);
     }
 
-    if ( fresh )
-        /* nothing */;
-    else if ( !lo_update )
-    {
-        /*
-         * Low half of incoming RTE is already in remapped format,
-         * so need to recover vector and delivery mode from IRTE.
-         */
-        ASSERT(get_rte_index(rte) == offset);
-        if ( iommu->ctrl.ga_en )
-            vector = entry.ptr128->full.vector;
-        else
-            vector = entry.ptr32->flds.vector;
-        /* The IntType fields match for both formats. */
-        delivery_mode = entry.ptr32->flds.int_type;
-    }
-    else if ( x2apic_enabled )
-    {
-        /*
-         * High half of incoming RTE was read from the I/O APIC and hence may
-         * not hold the full destination, so need to recover full destination
-         * from IRTE.
-         */
-        dest = get_full_dest(entry.ptr128);
-    }
     update_intremap_entry(iommu, entry, vector, delivery_mode, dest_mode, dest);
 
     spin_unlock_irqrestore(lock, flags);
@@ -350,14 +319,11 @@ static int update_intremap_entry_from_ioapic(
 }
 
 void cf_check amd_iommu_ioapic_update_ire(
-    unsigned int apic, unsigned int reg, unsigned int value)
+    unsigned int apic, unsigned int pin, uint64_t raw)
 {
     struct IO_APIC_route_entry old_rte = { };
-    struct IO_APIC_route_entry new_rte = { };
-    unsigned int rte_lo = (reg & 1) ? reg - 1 : reg;
-    unsigned int pin = (reg - 0x10) / 2;
+    struct IO_APIC_route_entry new_rte = { .raw = raw };
     int seg, bdf, rc;
-    bool saved_mask, fresh = false;
     struct amd_iommu *iommu;
     unsigned int idx;
 
@@ -373,58 +339,23 @@ void cf_check amd_iommu_ioapic_update_ire(
     {
         AMD_IOMMU_WARN("failed to find IOMMU for IO-APIC @ %04x:%04x\n",
                        seg, bdf);
-        __io_apic_write(apic, reg, value);
+        __ioapic_write_entry(apic, pin, true, new_rte);
         return;
     }
 
-    /* save io-apic rte lower 32 bits */
-    *((u32 *)&old_rte) =  __io_apic_read(apic, rte_lo);
-    saved_mask = old_rte.mask;
-
-    if ( reg == rte_lo )
-    {
-        *((u32 *)&new_rte) = value;
-        /* read upper 32 bits from io-apic rte */
-        *(((u32 *)&new_rte) + 1) = __io_apic_read(apic, reg + 1);
-    }
-    else
-    {
-        *((u32 *)&new_rte) = *((u32 *)&old_rte);
-        *(((u32 *)&new_rte) + 1) = value;
-    }
-
-    if ( ioapic_sbdf[idx].pin_2_idx[pin] >= INTREMAP_MAX_ENTRIES )
-    {
-        ASSERT(saved_mask);
-
-        /*
-         * There's nowhere except the IRTE to store a full 32-bit destination,
-         * so we may not bypass entry allocation and updating of the low RTE
-         * half in the (usual) case of the high RTE half getting written first.
-         */
-        if ( new_rte.mask && !x2apic_enabled )
-        {
-            __io_apic_write(apic, reg, value);
-            return;
-        }
-
-        fresh = true;
-    }
-
+    old_rte = __ioapic_read_entry(apic, pin, true);
     /* mask the interrupt while we change the intremap table */
-    if ( !saved_mask )
+    if ( !old_rte.mask )
     {
         old_rte.mask = 1;
-        __io_apic_write(apic, rte_lo, *((u32 *)&old_rte));
+        __ioapic_write_entry(apic, pin, true, old_rte);
     }
 
     /* Update interrupt remapping entry */
     rc = update_intremap_entry_from_ioapic(
-             bdf, iommu, &new_rte, reg == rte_lo,
+             bdf, iommu, &new_rte,
              &ioapic_sbdf[idx].pin_2_idx[pin]);
 
-    __io_apic_write(apic, reg, ((u32 *)&new_rte)[reg != rte_lo]);
-
     if ( rc )
     {
         /* Keep the entry masked. */
@@ -433,20 +364,7 @@ void cf_check amd_iommu_ioapic_update_ire(
         return;
     }
 
-    /* For lower bits access, return directly to avoid double writes */
-    if ( reg == rte_lo )
-        return;
-
-    /*
-     * Unmask the interrupt after we have updated the intremap table. Also
-     * write the low half if a fresh entry was allocated for a high half
-     * update in x2APIC mode.
-     */
-    if ( !saved_mask || (x2apic_enabled && fresh) )
-    {
-        old_rte.mask = saved_mask;
-        __io_apic_write(apic, rte_lo, *((u32 *)&old_rte));
-    }
+    __ioapic_write_entry(apic, pin, true, new_rte);
 }
 
 unsigned int cf_check amd_iommu_read_ioapic_from_ire(
diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 39602d1f88f8..032a7c3b42cd 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -92,7 +92,7 @@ int cf_check intel_iommu_get_reserved_device_memory(
 unsigned int cf_check io_apic_read_remap_rte(
     unsigned int apic, unsigned int reg);
 void cf_check io_apic_write_remap_rte(
-    unsigned int apic, unsigned int reg, unsigned int value);
+    unsigned int apic, unsigned int ioapic_pin, uint64_t raw);
 
 struct msi_desc;
 struct msi_msg;
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 05df6d5759b1..845c180bb39c 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -328,12 +328,11 @@ static int remap_entry_to_ioapic_rte(
 
 static int ioapic_rte_to_remap_entry(struct vtd_iommu *iommu,
     int apic, unsigned int ioapic_pin, struct IO_xAPIC_route_entry *old_rte,
-    unsigned int rte_upper, unsigned int value)
+    struct IO_xAPIC_route_entry new_rte)
 {
     struct iremap_entry *iremap_entry = NULL, *iremap_entries;
-    struct iremap_entry new_ire;
+    struct iremap_entry new_ire = { };
     struct IO_APIC_route_remap_entry *remap_rte;
-    struct IO_xAPIC_route_entry new_rte;
     int index;
     unsigned long flags;
     bool init = false;
@@ -364,48 +363,37 @@ static int ioapic_rte_to_remap_entry(struct vtd_iommu *iommu,
 
     new_ire = *iremap_entry;
 
-    if ( rte_upper )
-    {
-        if ( x2apic_enabled )
-            new_ire.remap.dst = value;
-        else
-            new_ire.remap.dst = (value >> 24) << 8;
-    }
+    if ( x2apic_enabled )
+        new_ire.remap.dst = new_rte.dest.dest32;
     else
-    {
-        *(((u32 *)&new_rte) + 0) = value;
-        new_ire.remap.fpd = 0;
-        new_ire.remap.dm = new_rte.dest_mode;
-        new_ire.remap.tm = new_rte.trigger;
-        new_ire.remap.dlm = new_rte.delivery_mode;
-        /* Hardware require RH = 1 for LPR delivery mode */
-        new_ire.remap.rh = (new_ire.remap.dlm == dest_LowestPrio);
-        new_ire.remap.avail = 0;
-        new_ire.remap.res_1 = 0;
-        new_ire.remap.vector = new_rte.vector;
-        new_ire.remap.res_2 = 0;
-
-        set_ioapic_source_id(IO_APIC_ID(apic), &new_ire);
-        new_ire.remap.res_3 = 0;
-        new_ire.remap.res_4 = 0;
-        new_ire.remap.p = 1;     /* finally, set present bit */
-
-        /* now construct new ioapic rte entry */
-        remap_rte->vector = new_rte.vector;
-        remap_rte->delivery_mode = 0;    /* has to be 0 for remap format */
-        remap_rte->index_15 = (index >> 15) & 0x1;
-        remap_rte->index_0_14 = index & 0x7fff;
-
-        remap_rte->delivery_status = new_rte.delivery_status;
-        remap_rte->polarity = new_rte.polarity;
-        remap_rte->irr = new_rte.irr;
-        remap_rte->trigger = new_rte.trigger;
-        remap_rte->mask = new_rte.mask;
-        remap_rte->reserved = 0;
-        remap_rte->format = 1;    /* indicate remap format */
-    }
-
-    update_irte(iommu, iremap_entry, &new_ire, !init);
+        new_ire.remap.dst = (new_rte.dest.dest32 >> 24) << 8;
+
+    new_ire.remap.dm = new_rte.dest_mode;
+    new_ire.remap.tm = new_rte.trigger;
+    new_ire.remap.dlm = new_rte.delivery_mode;
+    /* Hardware require RH = 1 for LPR delivery mode */
+    new_ire.remap.rh = (new_ire.remap.dlm == dest_LowestPrio);
+    new_ire.remap.vector = new_rte.vector;
+
+    set_ioapic_source_id(IO_APIC_ID(apic), &new_ire);
+    new_ire.remap.p = 1;     /* finally, set present bit */
+
+    /* now construct new ioapic rte entry */
+    remap_rte->vector = new_rte.vector;
+    remap_rte->delivery_mode = 0;    /* has to be 0 for remap format */
+    remap_rte->index_15 = (index >> 15) & 0x1;
+    remap_rte->index_0_14 = index & 0x7fff;
+
+    remap_rte->delivery_status = new_rte.delivery_status;
+    remap_rte->polarity = new_rte.polarity;
+    remap_rte->irr = new_rte.irr;
+    remap_rte->trigger = new_rte.trigger;
+    remap_rte->mask = new_rte.mask;
+    remap_rte->reserved = 0;
+    remap_rte->format = 1;    /* indicate remap format */
+
+    /* If cmpxchg16b is not available the caller must mask the IO-APIC pin. */
+    update_irte(iommu, iremap_entry, &new_ire, !init && cpu_has_cx16);
     iommu_sync_cache(iremap_entry, sizeof(*iremap_entry));
     iommu_flush_iec_index(iommu, 0, index);
 
@@ -439,36 +427,47 @@ unsigned int cf_check io_apic_read_remap_rte(
 }
 
 void cf_check io_apic_write_remap_rte(
-    unsigned int apic, unsigned int reg, unsigned int value)
+    unsigned int apic, unsigned int pin, uint64_t raw)
 {
-    unsigned int pin = (reg - 0x10) / 2;
+    struct IO_xAPIC_route_entry rte = { .raw = raw };
     struct IO_xAPIC_route_entry old_rte = { };
     struct IO_APIC_route_remap_entry *remap_rte;
-    unsigned int rte_upper = (reg & 1) ? 1 : 0;
     struct vtd_iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic));
-    int saved_mask;
-
-    old_rte = __ioapic_read_entry(apic, pin, true);
+    bool masked = true;
+    int rc;
 
     remap_rte = (struct IO_APIC_route_remap_entry *) &old_rte;
 
-    /* mask the interrupt while we change the intremap table */
-    saved_mask = remap_rte->mask;
-    remap_rte->mask = 1;
-    __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
-    remap_rte->mask = saved_mask;
-
-    if ( ioapic_rte_to_remap_entry(iommu, apic, pin,
-                                   &old_rte, rte_upper, value) )
+    if ( !cpu_has_cx16 )
     {
-        __io_apic_write(apic, reg, value);
+       /*
+        * Cannot atomically update the IRTE entry: mask the IO-APIC pin to
+        * avoid interrupts seeing an inconsistent IRTE entry.
+        */
+        old_rte = __ioapic_read_entry(apic, pin, true);
+        if ( !old_rte.mask )
+        {
+            masked = false;
+            old_rte.mask = 1;
+            __ioapic_write_entry(apic, pin, true, old_rte);
+        }
+    }
 
-        /* Recover the original value of 'mask' bit */
-        if ( rte_upper )
-            __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
+    rc = ioapic_rte_to_remap_entry(iommu, apic, pin, &old_rte, rte);
+    if ( rc )
+    {
+        if ( !masked )
+        {
+            /* Recover the original value of 'mask' bit */
+            old_rte.mask = 0;
+            __ioapic_write_entry(apic, pin, true, old_rte);
+        }
+        dprintk(XENLOG_ERR VTDPREFIX,
+                "failed to update IRTE for IO-APIC#%u pin %u: %d\n",
+                apic, pin, rc);
+        return;
     }
-    else
-        __ioapic_write_entry(apic, pin, true, old_rte);
+    __ioapic_write_entry(apic, pin, true, old_rte);
 }
 
 static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
index be71a4c4641c..d290855959f2 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -158,9 +158,9 @@ int iommu_enable_x2apic(void)
 }
 
 void iommu_update_ire_from_apic(
-    unsigned int apic, unsigned int reg, unsigned int value)
+    unsigned int apic, unsigned int pin, uint64_t rte)
 {
-    iommu_vcall(&iommu_ops, update_ire_from_apic, apic, reg, value);
+    iommu_vcall(&iommu_ops, update_ire_from_apic, apic, pin, rte);
 }
 
 unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int reg)
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 405db59971c5..9335cd074cff 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -278,7 +278,8 @@ struct iommu_ops {
     int (*enable_x2apic)(void);
     void (*disable_x2apic)(void);
 
-    void (*update_ire_from_apic)(unsigned int apic, unsigned int reg, unsigned int value);
+    void (*update_ire_from_apic)(unsigned int apic, unsigned int pin,
+                                 uint64_t rte);
     unsigned int (*read_apic_from_ire)(unsigned int apic, unsigned int reg);
 
     int (*setup_hpet_msi)(struct msi_desc *);
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 12:53:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 12:53:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565196.883141 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkCd-0006pb-5S; Tue, 18 Jul 2023 12:53:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565196.883141; Tue, 18 Jul 2023 12:53:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkCd-0006pU-2X; Tue, 18 Jul 2023 12:53:19 +0000
Received: by outflank-mailman (input) for mailman id 565196;
 Tue, 18 Jul 2023 12:53:17 +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
 <SRS0=c9jt=DE=citrix.com=prvs=5561f9d71=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qLkCb-0006pO-PJ
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 12:53:17 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0ea5b852-256a-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 14:53:15 +0200 (CEST)
Received: from mail-dm6nam11lp2173.outbound.protection.outlook.com (HELO
 NAM11-DM6-obe.outbound.protection.outlook.com) ([104.47.57.173])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 18 Jul 2023 08:53:10 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by DM4PR03MB6062.namprd03.prod.outlook.com (2603:10b6:5:391::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.23; Tue, 18 Jul
 2023 12:53:06 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 12:53:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0ea5b852-256a-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689684795;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=jjhGQnTdv0lV3LQ4QNMj1kSCSW5aWhHhMnok7Ucdh/E=;
  b=UanMrCNFtT9wpvK4aPPQ2hWpqlZIZxmtLg+xn151kEmcfl7Q1w10gpsv
   KSLGdlBFUJeawmm2mRE2eTsDOrAx/BOMjoNu5xZznWmy8mKO6EuFQhOuL
   vk3vw0WCzx1PvOi4xjEjluHQEzmBgzZzt/JKGsszy7plkMd2u7j4PzAHN
   c=;
X-IronPort-RemoteIP: 104.47.57.173
X-IronPort-MID: 115883969
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:FmoSVa121AZVAUk3cfbD5TRwkn2cJEfYwER7XKvMYLTBsI5bpzMDz
 zZNWWvUbquJNDOnKY11b4nlp0sB78XUxoAxTgZlpC1hF35El5HIVI+TRqvS04F+DeWYFR46s
 J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo
 tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5gNnNagR1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL
 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ
 OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfW3tky
 flCMxs3cB3Tqv67kbeQF8ZFiZF2RCXrFNt3VnBI6xj8VK9jbbWdBqLA6JlfwSs6gd1IEbDGf
 c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxqvC6Kk1cZPLvFabI5fvSQQspYhACAr
 3/u9GXlGBAKcteYzFJp91r137KfzXiqBtN6+LuQr/9Ij0Cs61UpFiYnR3i6/OmgmkK1VIcKQ
 6AT0m90xUQoz2SwT9z6WTW5pmCFpR8WX9dME+w85xqJw6CS6AGcbkAUQzgEZNE4ucseQT0xy
 kTPj97vHSZosrCeVTSa7Lj8hTG4NDURLGQCTTQZVgZD6N7myKksijrfQ9AlF7S65vXwECv1y
 iqHrwA/gasSls8B06in/VHBjCmor5KPRQkwjjg7RUqg5wJ9IYKgOYqh7AGC6e4addnCCF6co
 HIDhs6SqvgUCo2AnzCMR+NLG6y14/GCM3vXhlsH84QdyglBMkWLJeh4iAyS7m8yWirYUVcFu
 HPuhD4=
IronPort-HdrOrdr: A9a23:D4h0oaGXPof6X4MjpLqEHseALOsnbusQ8zAXPiBKJCC9vPb5qy
 nOpoV86faQslwssR4b9uxoVJPvfZqYz+8W3WBzB8bEYOCFghrKEGgK1+KLrwEIWReOk9K1vZ
 0KT0EUMqyVMbEVt6fHCAnTKade/DGEmprY+9s3GR1WPHBXg6IL1XYINu6CeHcGPTWvnfACZe
 ehDswsnUvZRV0nKv6VK1MiROb5q9jChPvdEGI7705O0nj0sduwgoSKaSSl4g==
X-Talos-CUID: 9a23:jo0Crm3I6+KSC60oiiLR5bxfQNoPTniH11zqPULoJHpkGbi+FHC59/Yx
X-Talos-MUID: 9a23:CrayCASynbNtzy5VRXS1hRNtKfhF2p6wM3EfspRbq9CUOSd/bmI=
X-IronPort-AV: E=Sophos;i="6.01,214,1684814400"; 
   d="scan'208";a="115883969"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=fsQ1dR/tArWYzUumUt0MrXcuX0koHdAHb7bpXYJIGG94BOCjXydCIg+Q7Z6cInzPCIsd2fs8Ho1Xsg97ixUrWt4+bkHM1R5kf5b9QNkhMmslBKo4mxqQwvETBmwXOYZeQcOfC/pszQboxorKmv5HsR/cTf/ReTAf8uyZGSJEQURgxMUogVOg7AWDKoR2MH3areguJ3d1EtTcd/qPd2F6SPD76n+pA/NIHUOb4blI0pA9p2lHJd0Qk3VmwHDXOfoZUHnxIiMrzaqcvhV909OnzX1PhwP9wujW0KPkoKm8os77hyQ8U7nmTfjW8cs5AY08GDq8vMnckzfMnEjMLmrXVA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=jjhGQnTdv0lV3LQ4QNMj1kSCSW5aWhHhMnok7Ucdh/E=;
 b=QJyDsWURjQjGzFjhrr5ZvnKqviQEX/261ZVUF8HbSPhE14GSymd5vEvdICVtmzmMxv1jghmDUcCV1IpxGrgAQxPuuatxLSmTi74dtJMLPSex+gf+J11a4ukUiCZllMSxwgxCnmtJfFPpGQcYclkzOI06OOpUCnMFoOpFTz2XiqWiUPkrioyin1USSB8mT+XFo5yBVxpRcWp47Va0dwKL3hUcCfl+UDPjedRgL4f6Kj701e/0SM0OtsDiAmDpR2MrxY1wjqwEn6u7znMtzm99ByEm9kHciIIEk7aCRodMC/tACEUuY+UpMhwPgLc05JNlXEM1/IE4hS5ncJIvCE51WA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=jjhGQnTdv0lV3LQ4QNMj1kSCSW5aWhHhMnok7Ucdh/E=;
 b=L79OMWQxfwQK8MXeeFJwOnrLkoXGNGB0KYqfeu2O4+TiVt2q6PL+wOuBVjZlrDR40a6fzxMeX5HGlmaVYYrL4t1R6ujqwIMvAQYQUmI98Nx7H5dnZZBUUg+DiLY4kZxm7NeHjG3T6B8Nx5g5NcU3MIeoEfSmRn+vVdNWuGpdzDM=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Tue, 18 Jul 2023 14:53:01 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Simon Gaiser <simon@invisiblethingslab.com>
Cc: xen-devel@lists.xenproject.org, Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: Re: [XEN PATCH] x86/hpet: Disable legacy replacement mode after IRQ
 test if not needed
Message-ID: <ZLaLLe2HFDN5oWUq@MacBook-Air-de-Roger.local>
References: <20230718122603.2002-1-simon@invisiblethingslab.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20230718122603.2002-1-simon@invisiblethingslab.com>
X-ClientProxiedBy: LO2P265CA0016.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:62::28) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|DM4PR03MB6062:EE_
X-MS-Office365-Filtering-Correlation-Id: e4f844b9-114f-4a49-b4ad-08db878dee21
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	wJNZkDHFAm6lWH6UUx+2MZ4KjjB73lRy8TUJZ0ZAN0OSw32IWDxn2qAa+WWFuZCBRCM39qzLo5PtxQXNXb0igrK8vTGKQLVFCKivn1pZAkv6WUakl2txvyacYkH1cBydnm7cW5uo6A3Ls0U/ZngW/EOiGx5APSrF9N2y62HWEagTlS8dNxM4fAeBph2Rqaacnz+UKZGrKn3XE4CsuSIY5ik1sL8+r3Rs2rR9jPBBbIW+kATQ0OT1hJwFpDSe7nssAYrSi4llDIJQZjtSZhfhJcW+qyU7ArB2WlDpcLYsMybL+pf0tuuFCmIai/2Dfv3JDN5hoZKOSU2NxJ3s5Rjm7cg7BR/Yv9E4F8TRh9QEkxOJKCANNPUWmqIuRbceeoiXtQzij+n9dN73KGRoAasNI78U31FMlbSN9S8QJ2GKhVaAAHa0QRAX70jRsysjcdW0T+CfERo0ttdu2G70FUXRTwq1o5can+2LvNOIFjGF0SL9rcsCrrEkq5n0trWCltkA5pZ6UDyuorFnwKjISlUrfW8QmxRA7b+wgy19Bp7X9cvnBjd59++aM1jPGOdCUdtW
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(366004)(346002)(376002)(396003)(451199021)(2906002)(4744005)(8676002)(8936002)(66556008)(66476007)(6916009)(4326008)(66946007)(316002)(41300700001)(5660300002)(6512007)(9686003)(26005)(6506007)(6486002)(186003)(85182001)(478600001)(6666004)(54906003)(83380400001)(82960400001)(86362001)(38100700002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UDlIMXhUVGJzcXpmWHFlUmsvNVc1ZEJSckF4THY3MVNmenlqS2xpSSs1dTdL?=
 =?utf-8?B?WHNwcjhB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wL+E8vmoqBK4SA8DflysdXAvLXm/5k4/Cdk3TFlywIdDMTYkX+RseGW5XxlH1TngInlTuZNRSU12dnPMZkE5+O79QG8zODyC7yXTscZpvi2+3U/qWjpCZy5YPR8vEQ3gF/drOPvnMfGPwOxduD6Hys2N/cvisxxYEqHwusgFE7TPYjX9blTMExjmK/DvphYnJBoOJ4hZvLxc3WNtgDiPrHk7IBw2OrvSpwzIDBRQzkQ7uhyNYH3hkQyxfQMgEa5lM3jylYEowsYyT6PxkfKYCsJxd/02xdr83BoI84INgHN1v2aiYm86TwrSVho2CO1RCmXg8jb8H+w1PWn0DIVpfpWX60IitL1XKfqIFgswB3m3g
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e4f844b9-114f-4a49-b4ad-08db878dee21
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 12:53:05.9235
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: A0+wyumKaeZvbaX3qX7E3R12ybZFY49i0FTJ3yhrOftYZzl+6mK+g8Xnej79HYOOYUDEtBbnGvo/Q/ORSQRdVA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR03MB6062

On Tue, Jul 18, 2023 at 02:26:03PM +0200, Simon Gaiser wrote:
> As far as I understand the HPET legacy mode is not required on systems
> with ARAT after the timer IRQ test.

What's the relation with ARAT here?

It would seem to me that keeping legacy replacement enabled should
only be done when opt_hpet_legacy_replacement > 0, and the currently
modified block is already in a opt_hpet_legacy_replacement < 0 gated
chunk.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 12:58:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 12:58:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565201.883150 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkHQ-0007WY-Rn; Tue, 18 Jul 2023 12:58:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565201.883150; Tue, 18 Jul 2023 12:58:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkHQ-0007WR-OO; Tue, 18 Jul 2023 12:58:16 +0000
Received: by outflank-mailman (input) for mailman id 565201;
 Tue, 18 Jul 2023 12:58:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Rqcw=DE=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qLkHP-0007WL-5G
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 12:58:15 +0000
Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com
 [2a00:1450:4864:20::62d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c17826bc-256a-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 14:58:13 +0200 (CEST)
Received: by mail-ej1-x62d.google.com with SMTP id
 a640c23a62f3a-991da766865so788030766b.0
 for <xen-devel@lists.xenproject.org>; Tue, 18 Jul 2023 05:58:13 -0700 (PDT)
Received: from EMEAENGAAD19049. (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 w21-20020a1709064a1500b00982b204678fsm973598eju.207.2023.07.18.05.58.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 18 Jul 2023 05:58:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c17826bc-256a-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689685093; x=1692277093;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=JjHky2ofynad/3sKJ5swr3/zAEiThMFEONb1eagRRkg=;
        b=Wpbk2MtdA8ZQJ0oEp2ZcZDp6jatDT9ufeHIW0cjaPAfgz+c/hyoM1hxATjnUYgJKQx
         QultYNcPW8kDkywP9IYtv565qMFiz/dEPg4ZjqplUn/m3Ec4zRX1iDwMl6gnTAmQArYj
         VIxvUlM3DMPW51PfsC3Iz8Oz+TuLaCD6EGq/M=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689685093; x=1692277093;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=JjHky2ofynad/3sKJ5swr3/zAEiThMFEONb1eagRRkg=;
        b=EJWB+ISL+UcER561+gqx8QnrV1Kn2zoRvfkS1e5vmi+ItflDPoVsco35wviY7A4pbG
         MdW1f55EvDEl/Mt2cLDbA6ZwZgi5sU0AZbrRVGU/yQTy+TdK0yCxcvzvLyhFNT/kX3St
         YOiy9a1m6+L/gQLbJHPNWA24OIFjv528CjpPPrMiD9/mpBS2Br/SIEW7ak3kY0XraxKz
         EUAnPga4qA44V+DxtbTGJpo5QSBuOy4xqGs6YSkkVuUVAbJaYAgNnZQHREk2wDU/v8t0
         D0htE5Oen3eEV7DCU+jRjEzRZRpI4bv6o4quqWrNh57P83DKYn2AnsUFjUFrBaLiSMdk
         mx7A==
X-Gm-Message-State: ABy/qLa40IWUqsuIGmHJnmn5GY10mntrGUvXGff+H+FW44Mr8lyEsOV0
	ARxuswt7KS7Q9w16E0xMKmp2XA==
X-Google-Smtp-Source: APBJJlEB23mbt/Fzr3lLJJEr4A86A+YbcOqE4lW5Ww70jlxewjVo43p2BxgH5NhC1F1epDezQ7SLSg==
X-Received: by 2002:a17:906:e285:b0:98e:1156:1a35 with SMTP id gg5-20020a170906e28500b0098e11561a35mr11747716ejb.74.1689685093350;
        Tue, 18 Jul 2023 05:58:13 -0700 (PDT)
Message-ID: <64b68c65.170a0220.b0fe3.40f1@mx.google.com>
X-Google-Original-Message-ID: <ZLaMY0qTA9XqWrdb@EMEAENGAAD19049.>
Date: Tue, 18 Jul 2023 13:58:11 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 0/8] Make PDX compression optional
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <7ad1dc72-3b1b-fa7f-8ce4-dd7973c8da93@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <7ad1dc72-3b1b-fa7f-8ce4-dd7973c8da93@suse.com>

On Tue, Jul 18, 2023 at 11:33:03AM +0200, Jan Beulich wrote:
> On 17.07.2023 18:03, Alejandro Vallejo wrote:
> > Currently there's a CONFIG_HAS_PDX Kconfig option, but it's impossible to
> > disable it because the whole codebase performs unconditional
> > compression/decompression operations on addresses. This has the
> > unfortunate side effect that systems without a need for compression still
> > have to pay the performance impact of juggling bits on every pfn<->pdx
> > conversion (this requires reading several global variables). This series
> > attempts to:
> > 
> >   * Leave the state of pdx and pdx compression documented
> >   * Factor out compression so it _can_ be removed through Kconfig
> >   * Make it so compression is disabled on x86 and enabled on both Aarch32
> >     and Aarch64 by default.
> 
> I disagree with this choice of default for x86. To avoid surprising
> downstreams, this should at best be a two-step process: Keep the
> default as Y right now, and switch to N a couple of releases later.
I'm not particularly worried about the default, as that's easy to change
locally for our customers. That said, my .02 on the matter is that it would
be easier to accept (leaving it as Y) if there was some documented case of
the feature being triggered at present on x86. I'd rather turn it off
unless we have strong evidence that it's actually used. Forcing Xen users
to pay the cost of a feature they don't benefit from just feels wrong.

> 
> But that's only the simple / mechanical side. Considering my earlier
> effort to reduce / remove the involved overhead dynamically at
> runtime (which you may or may not be aware of; see [2]),
I wasn't. I'll have a look at the end of the day[3]. Regardless, most of this
series is about containment of compression into known helpers and hopefully
that should be undeniably positive irrespective of how the overhead
reduction is achieved.

> I view a
> compile time choice as less desirable. At the very least I would
> expect some justification towards this build time choice being
> acceptable / reasonable despite the earlier effort towards greater
> flexibility. Only such would be likely to have me merely defer to
> other x86 maintainers, rather than outright objecting.
> 
> Jan
> 
> [2] https://lists.xenproject.org/archives/html/xen-devel/2018-09/msg01616.html

I believe the burden of proof is reversed. Features bring complexity, and
complexity increases the chances of introducing bugs. It's the presence of
a feature that ought to be backed by a proof-of-requirement, not its
absence.

As far as data goes, we're aware of several ARM systems with compressible
memory banks, but no publicly available x86 ones. I'm purposefully leaving
RISC-V and PPC out of this equation, as they may or may not require this,
it's something the maintainers of those ports will have to assess in due
time.

Alejandro

[3] Note that I send this email before reading carefully your 2018 series.


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 13:03:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 13:03:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565210.883164 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkMb-0000jL-Fe; Tue, 18 Jul 2023 13:03:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565210.883164; Tue, 18 Jul 2023 13:03:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkMb-0000jE-D1; Tue, 18 Jul 2023 13:03:37 +0000
Received: by outflank-mailman (input) for mailman id 565210;
 Tue, 18 Jul 2023 13:03:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLkMa-0000j4-Eu; Tue, 18 Jul 2023 13:03:36 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLkMa-0000V4-DI; Tue, 18 Jul 2023 13:03:36 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLkMa-0008AS-1X; Tue, 18 Jul 2023 13:03:36 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLkMa-0006U4-0Z; Tue, 18 Jul 2023 13:03:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=GYvn+BQrC9sZAeB+DV4ANKsGa5xBD6QYHTU23NBjBZM=; b=Ru/iza1yP18bq5iRO6N4C1FrWE
	ui0LPIsdK/ePY/cFyCDmwmaBq9BeR41uaT6JrZNUATRZUHTLH4ThXWYNhsThXdpgayD4T5FAlcXJ0
	sMKzmPlMkYzR5hUNWH6hbem3t0oontOMMWdSXU1pAdugGAyK8Ca0/NA3LjQI1xP/PSxs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181861-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.17-testing test] 181861: tolerable trouble: fail/pass/starved - PUSHED
X-Osstest-Failures:
    xen-4.17-testing:test-amd64-i386-migrupgrade:xen-install/src_host:fail:heisenbug
    xen-4.17-testing:test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict:xen-install:fail:heisenbug
    xen-4.17-testing:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-qcow2:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-raw:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-xsm:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit1:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-thunderx:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-xsm:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-raw:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit1:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-multivcpu:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-rtds:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-vhd:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit2:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-vhd:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-arndale:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit2:hosts-allocate:starved:nonblocking
X-Osstest-Versions-This:
    xen=8f11b6e942dbf02592de2ab3338226f0cd3ee3ac
X-Osstest-Versions-That:
    xen=71792ec9af49f94dd3fcb581310106aa5156150f
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 18 Jul 2023 13:03:36 +0000

flight 181861 xen-4.17-testing real [real]
flight 181873 xen-4.17-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181861/
http://logs.test-lab.xenproject.org/osstest/logs/181873/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-migrupgrade 10 xen-install/src_host fail pass in 181873-retest
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict 7 xen-install fail pass in 181873-retest

Tests which did not succeed, but are not blocking:
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181832
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181832
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181832
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181832
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181832
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181832
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181832
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181832
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181832
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2  3 hosts-allocate               starved  n/a
 test-arm64-arm64-libvirt-raw  3 hosts-allocate               starved  n/a
 test-arm64-arm64-libvirt-xsm  3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl           3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl-credit1   3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl-thunderx  3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl-xsm       3 hosts-allocate               starved  n/a
 test-armhf-armhf-libvirt      3 hosts-allocate               starved  n/a
 test-armhf-armhf-libvirt-raw  3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-credit1   3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-multivcpu  3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-rtds      3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-vhd       3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl-credit2   3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl-vhd       3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl           3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-arndale   3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-credit2   3 hosts-allocate               starved  n/a

version targeted for testing:
 xen                  8f11b6e942dbf02592de2ab3338226f0cd3ee3ac
baseline version:
 xen                  71792ec9af49f94dd3fcb581310106aa5156150f

Last test of basis   181832  2023-07-17 06:37:00 Z    1 days
Testing same since   181861  2023-07-17 22:08:51 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          starved 
 test-armhf-armhf-xl                                          starved 
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 starved 
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      starved 
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  starved 
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  starved 
 test-armhf-armhf-xl-credit1                                  starved 
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  starved 
 test-armhf-armhf-xl-credit2                                  starved 
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         fail    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     starved 
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                starved 
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               starved 
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 starved 
 test-armhf-armhf-libvirt-raw                                 starved 
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     starved 
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 starved 
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      starved 
 test-armhf-armhf-xl-vhd                                      starved 
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   71792ec9af..8f11b6e942  8f11b6e942dbf02592de2ab3338226f0cd3ee3ac -> stable-4.17


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 13:06:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 13:06:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565215.883175 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkPR-0001JU-VB; Tue, 18 Jul 2023 13:06:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565215.883175; Tue, 18 Jul 2023 13:06:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkPR-0001JN-S9; Tue, 18 Jul 2023 13:06:33 +0000
Received: by outflank-mailman (input) for mailman id 565215;
 Tue, 18 Jul 2023 13:06:33 +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 <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLkPQ-0001JD-VC
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 13:06:32 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20622.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::622])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e98200f1-256b-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 15:06:30 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB8564.eurprd04.prod.outlook.com (2603:10a6:20b:423::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Tue, 18 Jul
 2023 13:06:29 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 13:06:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e98200f1-256b-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=jVxI7K4oAj51WXEcyj8XS4K+rW2HmOL5BaB2lp3L9Lzeu45FWvLVAeIicKm5Zp1GIGoQJYd3DAkbg3lwNB0w1ME1cSccjE8UVR07QcpEJANzWqqGsy5EvljSz6joT70/kz+zLI5R1W/61IX040XP3lAg+GYTOhwlYCLTxgJme06sroUB30qHT4se8eQnWZCXuUWsIocfJSZteAJdV5sdiY4IROyza3JbODT5ej2wKEcXE7yyqf7DoivD+YFog2UE3RH4+4oAIC4aPrW20ceU4kyUpCmSbt33QkMyqAj+rUg7ona94ObO+pTw1RvSaJBcP3gXGu4NOx2s4VTO+kCTEQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=wPqPgoT4k8wL5qzUOiHnxa3r8psJx3xRHU/IoqRD888=;
 b=TPZDX1v56VuRSIqwsYQlWFKGaAQjnxCygwj6Z8Sl7s7U3q1gZp7hr1hAJ6FcsheBsFMr9QofAGABTzHoE8hdej3/H0B7Y+39w/+Z/WSmcNU2QFzUJ5/+lRx8HFyoxhEwsg3TS24L8qn3LKlB6otGZHNM0omSH3zeuR/tVLK1GnPKZgW6dDJpLGrQ8IKKYip4DOiOm9yJcjsiL+Fz0vXWDdXcgNNug4Rbmm67Gn5qSaPA5hdG8Sv75IeKnxAMeFNvr87410mdmQr7QYCPYaxOBsKhWvH4uubOK0/hSZOGUh+7kcEhJYb8/3jkFORQyspSX3utWlArn9jErI63DN2OfQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=wPqPgoT4k8wL5qzUOiHnxa3r8psJx3xRHU/IoqRD888=;
 b=Yonv/fRbCCyWjFJNomytsSaiVlsti0U8sNFg+4bxLvSTggpgMPUjLZUeVsD4suTx3vumzmRscYCb92JToLCYanWmPo6hbv0rGFQyilBi7FXErO0AbG2Cx6rjLM6yzEZlDOs4m5WA+tH4og7FJarVlGD/KiwEmne3tV8YhihpiUs5PWLbhfIqZX+UKIuHhOI29pMNjCIVWlUsSxB5RM8UqMv2Tm0JGgXx1TF6m488zVd5noGiWN4ljks3+qySONLr68F9ErhFvgoTtMSDjGrdIRFP46EbDYZtprrQaGz1fGEXex62HVoWObYf67Qd+M+lvB65Pr5WdsTSDRdH62/F0w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <119404f7-8e6d-a3e0-2d29-d34ab78a6a2d@suse.com>
Date: Tue, 18 Jul 2023 15:06:26 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 0/8] Make PDX compression optional
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <7ad1dc72-3b1b-fa7f-8ce4-dd7973c8da93@suse.com>
 <64b68c65.170a0220.b0fe3.40f1@mx.google.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <64b68c65.170a0220.b0fe3.40f1@mx.google.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0165.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a2::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB8564:EE_
X-MS-Office365-Filtering-Correlation-Id: b232bc3c-b73d-451e-4e91-08db878fccc4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	2Q1uwdjynsD4e5IS0P3AxnfKWKPRBpsay35dA1vvgUCU2CZVWAmZt9srJQG09BZtPl3mSk+8lCpiwVlSjpjDUfX8x+73zf/iI9KnF4h7fMunIp1vtqePFkBmmSlcNRBK3JDxAR15vy7dY9ezBasf+unBVnNgxtcl7lHPrvI/gLmNbOJMu6o9svLswlU899RJpzABVsxnCLuQrO8ivOMaz2GUeUVGbwC/7LEK2JgVbYmbeRrC3YQtnCpsIXrSwnVZw7SvktnOKIqsH5ThVc0udQZ1+maX7Om21ujMSCHtBbNahZiN8YlgzX5bFwCbRV1uEJzSCIP32U0uEZgRYzmnYlWfO/2T9z+HJ1P81WUm1Da4d5slVThcG7Ny8EOPyklxpHGVXQWEZ021ZrIjUBKuCyWhXTCwP2R3J+lRv3jTeNKJQAQqPi2pKGxs38TFvA9jF0OTjOae1E0Q494xsGuGL7rHeaL+zRiXjsSxRnuozwuDndye2hOCjLLSK/O+3jr2bqIseM0ClCdLZwrtry4yCVVt2byLNozyYNoGmZe2F+xpjTb9JHgjxH9kjPfK8z4YFAYXFz+qU10ga79dKoQ7JLIZqTKn4wH5uNSrtolD+8gxVtzlrKQmBBspxJbs1Co8i+A119JeQ8bkemVoZ1oSiw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(136003)(39860400002)(396003)(366004)(451199021)(38100700002)(8936002)(8676002)(4744005)(2616005)(2906002)(36756003)(26005)(6506007)(5660300002)(31696002)(53546011)(186003)(86362001)(7416002)(66946007)(6916009)(4326008)(66556008)(54906003)(66476007)(31686004)(6486002)(6666004)(41300700001)(478600001)(6512007)(316002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MCtwUCtteGY5aDZYRUJ2N2dUQVZ4dXJtR1hsNjVhb0JIZW9LY2lad0xyZldl?=
 =?utf-8?B?OXRWQ2ZOTFRIdTJleWVOeGRVQkZqeHBpYTAySzhwU2R2bnJ1Q2NrUjd3azBr?=
 =?utf-8?B?UHNZdGNMSzkvV2x0eHF0bGJSbm45aDhub0xmYUJVWWo2aXNyR0kyalA2UTlM?=
 =?utf-8?B?VENqdE8zOThHRGQzMDhLTkgxS1llRWVDZGpjaDFPakUxMTFScXAxdVV3cmV3?=
 =?utf-8?B?SjNEMUxQMHdqcHd3OUlqRlJhUDlZTnFGdFVrd2JTRDI5MDkrVEU4YXM3bTRR?=
 =?utf-8?B?UUdudjdxbE0yektVL0o0US9jUnAwcTh2Ymsvc0puVlBNa1BlWGhUb3pDYlcr?=
 =?utf-8?B?ckdrbU1meHg4MEZOVmRzZWFEQWZCd1huekxWOS9kQlcxU1dqUWhBbVFSaTBo?=
 =?utf-8?B?QThHUVFCNndCc3Q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network-Message-Id: b232bc3c-b73d-451e-4e91-08db878fccc4
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 13:06:29.0672
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ZC+e0i+lxJ/xPB8sZiPqNC/CBinU+hvYhwi/jEeP/QoJ9MvBmzsw/FB2xEUGIEi389BNJN0LscHlL+boSqTA/g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8564

On 18.07.2023 14:58, Alejandro Vallejo wrote:
> I believe the burden of proof is reversed. Features bring complexity, and
> complexity increases the chances of introducing bugs. It's the presence of
> a feature that ought to be backed by a proof-of-requirement, not its
> absence.

The feature was introduced to support hardware a partner of ours was
working on at the time. Xen wouldn't have worked very well there
without these additions. It is beyond my control or knowledge whether
any such system has ever made it into the public. So at the time of
its introduction, the need for this code was well justified imo.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 13:09:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 13:09:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565219.883185 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkRd-00026z-Dp; Tue, 18 Jul 2023 13:08:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565219.883185; Tue, 18 Jul 2023 13:08:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkRd-00026s-B5; Tue, 18 Jul 2023 13:08:49 +0000
Received: by outflank-mailman (input) for mailman id 565219;
 Tue, 18 Jul 2023 13:08:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=88xE=DE=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qLkRb-00026m-Tw
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 13:08:48 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on20624.outbound.protection.outlook.com
 [2a01:111:f400:fe13::624])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3ad34a3d-256c-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 15:08:47 +0200 (CEST)
Received: from AS9PR05CA0303.eurprd05.prod.outlook.com (2603:10a6:20b:491::6)
 by DU0PR08MB9773.eurprd08.prod.outlook.com (2603:10a6:10:446::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 13:08:35 +0000
Received: from AM7EUR03FT028.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:491:cafe::fb) by AS9PR05CA0303.outlook.office365.com
 (2603:10a6:20b:491::6) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33 via Frontend
 Transport; Tue, 18 Jul 2023 13:08:35 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT028.mail.protection.outlook.com (100.127.140.192) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.33 via Frontend Transport; Tue, 18 Jul 2023 13:08:34 +0000
Received: ("Tessian outbound f9124736ff4f:v145");
 Tue, 18 Jul 2023 13:08:33 +0000
Received: from 41f53deebaa3.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 7C1F6C0C-3DE6-4851-8EBC-993BFC5A6849.1; 
 Tue, 18 Jul 2023 13:08:26 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 41f53deebaa3.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 18 Jul 2023 13:08:26 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com (2603:10a6:208:104::24)
 by DB9PR08MB8625.eurprd08.prod.outlook.com (2603:10a6:10:3d3::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 13:08:25 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854]) by AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854%3]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 13:08:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3ad34a3d-256c-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KIQN5VR6al95yX44zbALQFxPbHH+rmQdO5Pf8w3Ege8=;
 b=8NDvryeXMZtNxZvrZCMb0V/Lsmwmved5Dw3K1vOHtMaebX9IwOzZGcE/jb5mQBo6MX+almr18zJD7bnvPcFWCiHd0rvcQgutfUPL9Q09tLOf139TwJ85xYX2SQsz0SPu8eRK4LR4ledVd7Zdnqje2yYLjXYNwKpCY33RX7XxM0A=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 5a1c1a2d8c05debe
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=UrD3zYfoXczWvuvXwUTbnsfuOfbM8il7ZDvIUizUftlN9RmJNbeLwT4ZnbspiHJWv8lW9wZszcxEKmkqUj8K5LQc+chhtqpk0RbjUGRYvjByOgvUKKRzTlywiNUlxSNLdR/jHGRZ/4H56EQ5zR35LuTKr+Ik3eAf9i/IAdEz/5e/ZyuZiw2n6DK+Vwh/RWgJDOnklvqsLHNm7o5QjCh/Rb/vY+l+2zQcevbmkg0nOf9gExZ+iC6FbxNEM5Fab+v3rZrrLvCz0zouBHBhzr4R9PJQ72YPIF1RBjTOIApadgB/HBXdOsEBUJVdSWmgxLcl1A/82Z0e+p2sViCrmr52xg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=KIQN5VR6al95yX44zbALQFxPbHH+rmQdO5Pf8w3Ege8=;
 b=DuEu5nGSwev1nIGLXoqujFGWzovncWaZtKV3JFpzLWmZMDiiYCXNgQwtA1CASyOXJ+JcmrvxYvXYUZKTEJolUZiSxOdLbLyexrSZxxkU0rTHSaCDjB9XqQRymDa934A/C3/Qs+UsXYfZg6YWFogYYgnCXmkCXVnVp3oI8t6h2VbNUfDf8iAGkL0rjiG1M3tNAGRb1CwGLZU782VzkyjWmiYC3JiKwz/uOKszux48TLWb+X+jxZG1d7F9lCnhcBXONY0dj2qoSWFl1Y3ZLHBa2RGN+0oul6w8hunO28HUY49nLw3BXIEN2+44hC8w3dXi+ssZOSapcAkPglyQYZhGng==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KIQN5VR6al95yX44zbALQFxPbHH+rmQdO5Pf8w3Ege8=;
 b=8NDvryeXMZtNxZvrZCMb0V/Lsmwmved5Dw3K1vOHtMaebX9IwOzZGcE/jb5mQBo6MX+almr18zJD7bnvPcFWCiHd0rvcQgutfUPL9Q09tLOf139TwJ85xYX2SQsz0SPu8eRK4LR4ledVd7Zdnqje2yYLjXYNwKpCY33RX7XxM0A=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>, Henry Wang
	<Henry.Wang@arm.com>
Subject: Re: [XEN PATCH v10 16/24] xen/arm: ffa: add defines for sharing
 memory
Thread-Topic: [XEN PATCH v10 16/24] xen/arm: ffa: add defines for sharing
 memory
Thread-Index: AQHZuH9Y/E5eTczWgkKkQ5tsd+GUtq+/gNMA
Date: Tue, 18 Jul 2023 13:08:25 +0000
Message-ID: <828CC971-7A80-4B11-9C33-508CD4354614@arm.com>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-17-jens.wiklander@linaro.org>
In-Reply-To: <20230717072107.753304-17-jens.wiklander@linaro.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM0PR08MB3778:EE_|DB9PR08MB8625:EE_|AM7EUR03FT028:EE_|DU0PR08MB9773:EE_
X-MS-Office365-Filtering-Correlation-Id: d9e22f80-20cb-4234-64b1-08db87901778
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 +BsEEWMS9uGnP9iImWYlW68zKDrawvsLasWvpvEUc9dcQmS5mkolLaD6ipH+h21zSsPgROTGftrWEtC64vIvwxJqZP1PoBvM4JBchjJezuNJGi6jHmTTFYTATMwZf23cPpi05G0D1i6vbiiAquGk7mdTC3CQP5YEZYBMzyeFMQ6zd79hBbte/WQRBNgH0Rj5D+IF0TRky6GZB6Sq3AFTgjWdEqVGH8/7eZWTyqinkzsEWp7Kf2+Mg4vdQhz/Ot227w3f46nbZUYc8S/qQ5eXArBeuj37v6rByZjYxl3BVLXrKmfCF3fMRMfQ+WB0R8F6tUWboskHEwdlQCUVNcMBQu0OtSCNGalIYMANGj9Pjxzt4GZNrWjJW9lra7BUBSB8mJZMQQijuRffqSF0WoLl5lZvmxPrJR3JWN0o2lcgAG/0e7gJZIFMGiI7twXkrM2uTRQbf9j8vwBBl3nw5hG6s+91u3YE0vNHIy6keFT6OrhGfzayXUA76Zo3UkSGWRbZQ3Srfg+Y2/hfL+v0eSm/pwUKhUkGMHZCacVEufidTDY52Hx7J/zrP90Ymc0YmEMJxIkmI6A6zH4wqN5OYRn9PkAJLL255Kl6Pa+1U/zNVNoA35FTETMrasvduz/W2Kz5Hcp0FGLA3/7ExDZRj3pZjXnZiq61JbeyFF7zSMR8ohA0gYk4VnsQ8DP4fXwVzsZb
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB3778.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(136003)(396003)(346002)(376002)(39860400002)(451199021)(66556008)(54906003)(478600001)(71200400001)(6486002)(91956017)(966005)(6506007)(186003)(36756003)(2616005)(316002)(6512007)(76116006)(53546011)(2906002)(4326008)(66946007)(66476007)(41300700001)(66446008)(5660300002)(8676002)(8936002)(122000001)(64756008)(6916009)(38100700002)(86362001)(38070700005)(83380400001)(33656002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <3282EC87ADDA54409A59BACADDC61801@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8625
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT028.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	afed989c-7937-4cf8-8e0a-08db8790122f
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	eqqiRHEWMJxUen9yGmQ2ub/HqS2S7OYlHDktlEnqZ0LPeVIYqgX+9bfNghzo/x+IkJS4QqxGky8eSI7zSscYtS9oYH1D+7GgrcilZ047cuYvEYrlZvjryB6kRafDC4fkFut7vxohNG33pAx+dE5S5F/3OO4Y/cqrhJY3MQNrV0x6UczjBciQHdTwu9eJ9JQzyX2cy6u8YBAhBSFFPRbgziLrFYfoXAzj/tIsLMGvxIBdZg9+bpKUozOAU3iPfk6X7TuH+bYaxdJ3v6mNkQpfxJ3lxAC7BL9pFpKqgn/9YsEFyJ2D9zFGnpBdp+yX+BiYd0mBWKhhjfgrlgCZzoR81SA34916RzU9I0K1m1ojEI3R0QjGP4O0tFdVZ1VNJYzpiIu3UZFGUsGWp6Cy5XemABQH01MwTz8FtsjkxRTbYdY/85sNxIM+CzNjSjKdlB/SCw/t9sCkuj9djEXXSvdzOL5TDQTf+KLzLMDfGJHUriw4opaBFJAauS3ZYWud6iJXyN0ULPVFXUkVpfjwTcIq7VZjYonmZ+B7FrfhxUSQvwEVaayEBx+4HhBixuBi+ozVUvL/9NCCUTN0NAeBKFCFHRTx7gkjFOubPZQb3tYFF15/Mc3OApKTuAz6AuMVt2cgu9sgsFjTJMVQcwwTnBvmV7QEj+cp+w3k88mCEpiBymrVrOrK2r4FCeT2/37Ly3tV15vBPFWS0RK116vIxpF5ycUMldDDRVjsg8QCcv5B47w/VjIRVFj3n4ixsbuoxbVSCAv4BXGdZMJqPJfYSlHxBA==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(39860400002)(136003)(376002)(451199021)(82310400008)(46966006)(36840700001)(40470700004)(33656002)(40480700001)(6506007)(82740400003)(83380400001)(40460700003)(186003)(26005)(336012)(478600001)(53546011)(6486002)(54906003)(8676002)(41300700001)(6862004)(2906002)(8936002)(70206006)(70586007)(966005)(316002)(36860700001)(4326008)(5660300002)(36756003)(6512007)(2616005)(47076005)(81166007)(86362001)(356005);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 13:08:34.1238
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d9e22f80-20cb-4234-64b1-08db87901778
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT028.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9773

Hi Jens,

> On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> wrot=
e:
>=20
> According to DEN0077A version 1.1 REL0
> - Section 10.9.2 Memory region handle, page 167
> - Table 10.18 at page 175
> - Table 10.15 at page 168
> - Section 10.11.4 Flags usage, page 184-187
> add defines needed for sharing using the function FFA_MEM_SHARE and
> friends.
>=20
> Also add limits for how many shared buffers that a guest can have at
> once and how large a shared buffer can be at most.
>=20
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> Reviewed-by: Henry Wang <Henry.Wang@arm.com>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> xen/arch/arm/tee/ffa.c | 58 ++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 58 insertions(+)
>=20
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> index d5748b9ce88c..e895e355e620 100644
> --- a/xen/arch/arm/tee/ffa.c
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -5,6 +5,14 @@
>  * Arm Firmware Framework for ARMv8-A (FF-A) mediator
>  *
>  * Copyright (C) 2023  Linaro Limited
> + *
> + * References:
> + * FF-A-1.0-REL: FF-A specification version 1.0 available at
> + *               https://developer.arm.com/documentation/den0077/a
> + * FF-A-1.1-REL0: FF-A specification version 1.1 available at
> + *                https://developer.arm.com/documentation/den0077/e
> + * TEEC-1.0C: TEE Client API Specification version 1.0c available at
> + *            https://globalplatform.org/specs-library/tee-client-api-sp=
ecification/
>  */
>=20
> #include <xen/bitops.h>
> @@ -80,6 +88,56 @@
>  */
> #define FFA_MAX_RXTX_PAGE_COUNT         1
>=20
> +/*
> + * Limit for shared buffer size. Please note that this define limits
> + * number of pages.
> + *
> + * FF-A doesn't have any direct requirements on GlobalPlatform or vice
> + * versa, but an implementation can very well use FF-A in order to provi=
de
> + * a GlobalPlatform interface on top.
> + *
> + * Global Platform specification for TEE requires that any TEE
> + * implementation should allow to share buffers with size of at least
> + * 512KB, defined in TEEC-1.0C page 24, Table 4-1,
> + * TEEC_CONFIG_SHAREDMEM_MAX_SIZE.
> + * Due to overhead which can be hard to predict exactly, double this num=
ber
> + * to give a safe margin.
> + */
> +#define FFA_MAX_SHM_PAGE_COUNT          (2 * SZ_512K / FFA_PAGE_SIZE)
> +
> +/*
> + * Limits the number of shared buffers that guest can have at once. This
> + * is to prevent case, when guests trick XEN into exhausting its own
> + * memory by allocating many small buffers. This value has been chosen
> + * arbitrarily.
> + */
> +#define FFA_MAX_SHM_COUNT               32
> +
> +/* FF-A-1.1-REL0 section 10.9.2 Memory region handle, page 167 */
> +#define FFA_HANDLE_HYP_FLAG             BIT(63, ULL)
> +#define FFA_HANDLE_INVALID              0xffffffffffffffffULL
> +
> +/*
> + * Memory attributes: Normal memory, Write-Back cacheable, Inner shareab=
le
> + * Defined in FF-A-1.1-REL0 Table 10.18 at page 175.
> + */
> +#define FFA_NORMAL_MEM_REG_ATTR         0x2fU
> +/*
> + * Memory access permissions: Read-write
> + * Defined in FF-A-1.1-REL0 Table 10.15 at page 168.
> + */
> +#define FFA_MEM_ACC_RW                  0x2U
> +
> +/* FF-A-1.1-REL0 section 10.11.4 Flags usage, page 184-187 */
> +/* Clear memory before mapping in receiver */
> +#define FFA_MEMORY_REGION_FLAG_CLEAR            BIT(0, U)
> +/* Relayer may time slice this operation */
> +#define FFA_MEMORY_REGION_FLAG_TIME_SLICE       BIT(1, U)
> +/* Clear memory after receiver relinquishes it */
> +#define FFA_MEMORY_REGION_FLAG_CLEAR_RELINQUISH BIT(2, U)
> +/* Share memory transaction */
> +#define FFA_MEMORY_REGION_TRANSACTION_TYPE_SHARE (1U << 3)
> +
> /*
>  * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
>  * BIT(31): Framework or partition message
> --=20
> 2.34.1
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 13:19:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 13:19:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565224.883195 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkbc-0003kj-Bo; Tue, 18 Jul 2023 13:19:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565224.883195; Tue, 18 Jul 2023 13:19:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkbc-0003kc-99; Tue, 18 Jul 2023 13:19:08 +0000
Received: by outflank-mailman (input) for mailman id 565224;
 Tue, 18 Jul 2023 13:19:06 +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
 <SRS0=ju50=DE=invisiblethingslab.com=simon@srs-se1.protection.inumbo.net>)
 id 1qLkba-0003kW-Kt
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 13:19:06 +0000
Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com
 [66.111.4.29]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id aa9d8e93-256d-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 15:19:04 +0200 (CEST)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.nyi.internal (Postfix) with ESMTP id A45D45C0193;
 Tue, 18 Jul 2023 09:19:03 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute1.internal (MEProxy); Tue, 18 Jul 2023 09:19:03 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 18 Jul 2023 09:19:01 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aa9d8e93-256d-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-transfer-encoding
	:content-type:date:date:from:from:in-reply-to:message-id
	:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t=
	1689686343; x=1689772743; bh=vQAfZhUrBpa7qA7Trj9KoRSCGHtH50yM51Z
	WOCl4HAs=; b=Mr4+xxhA+W4AB0CdU0J70g9qLPClwRqWruxqizF1f5O4ALU1LNT
	Fe74xAVlM3i2QC2KSMJBR5/Up2pVpWvKeK4pd2iYB2E60R8MkWN2M63mA98M3Kn/
	FvDXcJMqf8RYn24v4QkXzY9U2BbeTJ7V9q9DaWqJ52gC7iaX4dt2GarbpBXvFK5Q
	RWWyQC0d1OYRra+qqM8S1yoHGX407MN+joNtpdyLgrqAlAd5zrTSJIZmDMf8aCDg
	Epu/z8xMEdquHbecx3suFUbAsWQ2nb1g8EMpPux89EMHiPau081UXMxHoHl5RnhZ
	YlPnVNSCCTnBQAr/6vZNS5BKKuzsQ/RxxRQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-transfer-encoding
	:content-type:date:date:feedback-id:feedback-id:from:from
	:in-reply-to:message-id:mime-version:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1689686343; x=1689772743; bh=vQAfZhUrBpa7q
	A7Trj9KoRSCGHtH50yM51ZWOCl4HAs=; b=MXqqICGqBacMiR4Lz23PGtjkMPDOa
	i7MC21MOF1PN0J8ciPfAAbf+WHsVdTV5YXaoCY3YdBsSko8aNIh0v8XSpb3qGF2i
	cM36KsoTrtDQtsCIMpnNJnqdjpk7h/kG8gk5KoXAe5MKsmg0H/xY+kMW1Nu1Rk48
	8RZa4qMOZ15rLnGYoQC3BV6t1a3PKHYbucCZfFjShSqq9ae5oVjVgCGHNoY/HQsc
	M3EUsJ0Y9McFBwQwp+5ezmS2Z/zmvlexY6wJsvJEPfNeA53OUnYZgFXMgTFDVJ0e
	Tab/GsVcv8wb4EbP47Bos9s0SIxqdHScjhqR7y0lB7eXgRyVWwcP3iNfw==
X-ME-Sender: <xms:R5G2ZJoID0DT8p10aZ7sT2S7toyL4ZUDHP_mp4vSDYCnZ_AqAxuzow>
    <xme:R5G2ZLohD4pnkWqzQUiVTz0rHQV8ZZGxQ199UCdW3iEB1Gfhl4ivKHJFvGoqMSsYQ
    _k1Fujupb7Ip4g>
X-ME-Received: <xmr:R5G2ZGPQlrsXXrUrhbzFbRSXV49dsjoNtRkJqJL1Fm1ESYAkj9Q4RV82d_d2_eOIYjILRliUB3IkrlCJ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgeeggdehlecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuihhmohhnucfi
    rghishgvrhcuoehsihhmohhnsehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh
    eqnecuggftrfgrthhtvghrnhepieevhfekveefjedvvdehhfdtudfhieegvdehveeffeet
    heekleejudeuieetudfgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg
    hilhhfrhhomhepshhimhhonhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm
X-ME-Proxy: <xmx:R5G2ZE4Yl5hvv2hmydyEFaFNtlrL06wMNQ43JLPdcqdWg-Y7o5ID3A>
    <xmx:R5G2ZI4xVwAjhx8Du5xssiIzTk9D6mChlOZ8C7y7iUG6yprQoiJi4Q>
    <xmx:R5G2ZMhJdM-Ka1BiZcc1xtf8Q6NthfBzgYbUVBujfyHzyH5C6krfuQ>
    <xmx:R5G2ZD3C2IbtEiFNg4_QpnzFBvf6d0tzP1QdZtUDgwEVQNyYwEsFPg>
Feedback-ID: idc5945a3:Fastmail
From: Simon Gaiser <simon@invisiblethingslab.com>
To: xen-devel@lists.xenproject.org
Cc: Simon Gaiser <simon@invisiblethingslab.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [XEN PATCH] x86/msr: Allow hardware domain to read package C-state residency counters
Date: Tue, 18 Jul 2023 15:17:55 +0200
Message-Id: <946e5494801866c93332cc5d9ec0fa03a4df00d7.1689686046.git.simon@invisiblethingslab.com>
X-Mailer: git-send-email 2.40.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Since it's limited to the hardware domain it should be safe and it's
very useful to have access to this directly in dom0 when debugging power
related things for example S0ix.
---
 xen/arch/x86/include/asm/msr-index.h |  9 +++++++++
 xen/arch/x86/pv/emul-priv-op.c       | 14 ++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 4f861c0bb4..7e7255383d 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -704,4 +704,13 @@
 #define MSR_PKGC9_IRTL			0x00000634
 #define MSR_PKGC10_IRTL			0x00000635
 
+/* Package C-state residency counters */
+#define MSR_PKG_C2_RESIDENCY            0x0000060d
+#define MSR_PKG_C3_RESIDENCY            0x000003f8
+#define MSR_PKG_C6_RESIDENCY            0x000003f9
+#define MSR_PKG_C7_RESIDENCY            0x000003fa
+#define MSR_PKG_C8_RESIDENCY            0x00000630
+#define MSR_PKG_C9_RESIDENCY            0x00000631
+#define MSR_PKG_C10_RESIDENCY           0x00000632
+
 #endif /* __ASM_MSR_INDEX_H */
diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index 142bc4818c..4593295ee2 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -965,6 +965,20 @@ static int cf_check read_msr(
         *val = 0;
         return X86EMUL_OKAY;
 
+    case MSR_PKG_C2_RESIDENCY:
+    case MSR_PKG_C3_RESIDENCY:
+    case MSR_PKG_C6_RESIDENCY:
+    case MSR_PKG_C7_RESIDENCY:
+    case MSR_PKG_C8_RESIDENCY:
+    case MSR_PKG_C9_RESIDENCY:
+    case MSR_PKG_C10_RESIDENCY:
+        if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
+            break;
+        if ( is_hardware_domain(currd) )
+            goto normal;
+        *val = 0;
+        return X86EMUL_OKAY;
+
     case MSR_P6_PERFCTR(0) ... MSR_P6_PERFCTR(7):
     case MSR_P6_EVNTSEL(0) ... MSR_P6_EVNTSEL(3):
     case MSR_CORE_PERF_FIXED_CTR0 ... MSR_CORE_PERF_FIXED_CTR2:
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 13:20:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 13:20:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565231.883205 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkcV-0004aX-Kp; Tue, 18 Jul 2023 13:20:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565231.883205; Tue, 18 Jul 2023 13:20:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkcV-0004a5-HV; Tue, 18 Jul 2023 13:20:03 +0000
Received: by outflank-mailman (input) for mailman id 565231;
 Tue, 18 Jul 2023 13:20:02 +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 <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLkcU-0003kW-0T
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 13:20:02 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on2061b.outbound.protection.outlook.com
 [2a01:111:f400:7d00::61b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cc31cb31-256d-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 15:20:00 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PR3PR04MB7260.eurprd04.prod.outlook.com (2603:10a6:102:8c::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 13:19:58 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 13:19:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cc31cb31-256d-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=HQcI0VG1PaxNQy12xkMXZfaSdCMqWAIQfzEmNNhpGjDBGW1ieT4lEARvjRQQK0c5SQ2IBQ99wY3Wl8Q/eURZf9wpYDQCtLtC8yFdjSEJXQ3bkeFzak2WmIABLpLTWeF+Dd2bbMRxpy8sVjWCIlbvirtb9lGWOE88SgyX1RGnXgqk8AqOV9vrhOnXEAA4zyxYrdGncQ3iKTK3moBDELQerafAnj3DlXfv6QpjTvwaxi3F+XEzWUG5pAFDXO1FwlSwl/Dc7N9hoOo1oQYkEuvEhxq3kseOeFnuY5Zs0uomuKqRJa2ZRkvwOWEMUJOxgjHaViOiV3qIfZd3BmSIGxIRPw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LAYuyBxSmIBnmASGk99SD4iM8FTfM6u4BoEaGoa3eIc=;
 b=DwyGXD1Utn3w1a6WD6SC4Vy4fzMOvdyzwepwA4HuE1BvwQ7g7dzZJ1PdG6/kKLmqdD+0IWB7OIh0A8wbvU/06eAUL9WmB1mKU7SdYsbsyWROGF7c/wuwIbdoiw4buyTFGdQd/P4CvMvoadsjkPamEsZFOohxN0TCmLfI81eRKErn1uqZPkjDhad9k/Ug3PZjK+ItcrJYmoDhMNSoHoMAyPurrs2M4LbQdBmS03OGh/QAk2fYXQ9vABGrNU3uGfrIOdqSGZMmaxznjHQY7VrIq4QRf5o0Pon/UBMCML85mWevD1gMcriGtWDBXXZ5kjUbAz3IgWDxNHPqYIRZCTdA+w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LAYuyBxSmIBnmASGk99SD4iM8FTfM6u4BoEaGoa3eIc=;
 b=xeKkbjvdxn9ceDqdUTL0CFbs3C7gkfXbEKAJEokdLN0lNR5PhHLK/7WiOfJgNtRHU+Lp+/yJLLi6jFpRUy4XGpQbxO698c3uu0/gknRK+p5N12ixDTXIkg2eWsWi5GX47eVnd/PMmwOgeBHx/RCF/Uht01QPbrbG42C5KCGswMrW7MA4OD5CFIzGOY/snqt6AMeVN6y7wiToo/RplWfcP23KaXZlUyEognJsCYIDMoEjDxD3zSXHAbdomzDJxZPGHFaIpi+yPKu/9obXqPsNORlvZSIm541lw3o9n5ApZQ7adr2EdowUz70eWT8IvBO53A9g/MGejvS6tavuga0TLQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <386eb540-8688-1a95-1e75-133bb21223fc@suse.com>
Date: Tue, 18 Jul 2023 15:19:56 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 3/3] x86: Add Kconfig option to require NX bit support
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230629121713.1211-1-alejandro.vallejo@cloud.com>
 <20230629121713.1211-4-alejandro.vallejo@cloud.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230629121713.1211-4-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0087.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1f::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PR3PR04MB7260:EE_
X-MS-Office365-Filtering-Correlation-Id: 66c3a8ef-0f20-4755-8247-08db8791af26
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	YJ5T/c1T+8qpfYBjh7yma57NNbfniJKvyE4HasxvZ6DpGwImjhTz/QjuW3p4bYCMAiC/RgqPwbqjbl8lF/fX4/7M9mb+biB0rpx6+TBxq7KgbyYm/ko6oLaApFoLa/DglN9ji5m8fzO/n6osuFcguamK3/m6BNDRXmYcs+tbADKCa9qhWUjNia3qcpyNIu1L/8TLVrF3H97t5rdzHRmtvMg2cv6u0NMRJL+D0x9LWs7qtGRFAMWkMjwSVloy0/c/hnQe7TbXWp2QaSsJzFdemUmrVfwvfWNY/lh3ragGmAFjcVzqMGD7DD7r4xLGpkl7yq9Tw2QO8ro8wkr9vETbwS+jBYXKPM4/sIdS4m2YuejXn77C0LiV59ceUSBTJZt9YDXBhWdrFTo8r+pdANW7/UUuxM/Q5qwu11PUbOTn3riPcYz5QPqpnZhceGG7TuUcuiHq6E+RrbHAdMnQ4AplN1ALmHVBkfemX4nw4VlfNeEVBp1VhXDYfuIwwks1L7g+EC4cvog+Q8U0X68eufnGTiOwrioWBr0Wwo99b0AvS2YbUez7V91i39FYqgfP2nxK3VkeUQOqDFi0TlchDKs8aTQ5ewAbzNsJ7xhQR7v3G1xrziyCJeWPC7IOVtK1n7PgTNhK8+FlH20FLcWK9NhkYw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(396003)(376002)(366004)(39860400002)(346002)(451199021)(54906003)(38100700002)(6486002)(41300700001)(8936002)(8676002)(316002)(478600001)(5660300002)(66946007)(66476007)(4326008)(66556008)(6916009)(186003)(2616005)(6506007)(6512007)(26005)(53546011)(86362001)(31696002)(36756003)(2906002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bzdnRXQ4NGdmTUJsWWQ5dUFlbUZvSnNxbXhxNCtuNkpDK2ZLQlJCYkVEL21W?=
 =?utf-8?B?T3RPbE9sSXJsa2hpMUxoTGNRMnI3T0VzdXZucHdsZFBZcWp4VmtHb0pBczUz?=
 =?utf-8?B?dEUrSFVoWnNFM0xZN0JCUFlrM0VlN0NzdXZRTTRvNG5NK0d5eERreVN4SGUw?=
 =?utf-8?B?cUtIcXRROUVlWDdldUZyNStkRE5DcXVFV1FZeDVrNjA0U2JGaGFjd0hEMkJY?=
 =?utf-8?B?VVhzNHdBU2FidjFFL0ZkRGd1d3I3YXpQMnUxL0RERVBZdGwrd0ZhcmZvcTZt?=
 =?utf-8?B?Tk5yQ0UwQ2VNWU1heDI2aDJYTUNqeFRCOS8wbHZYbThPa05ObExqNER0RXNR?=
 =?utf-8?B?UVdJckZ3UmUvNXNZQzIxeVRnVzRMTC9Nd0FaWnFURnphdzVwZG1kZFVWbnA3?=
 =?utf-8?B?OEh6cnpPYlhQN1g0TTNiQVpod1dQZk9Id1lNZFVHS0c3aEtCZzhMK0JXV096?=
 =?utf-8?B?UmZ6VjhMbjR4V0wyd0dHdFJCNTBrTUVKT3hvckVJN1lteTBodXJQSmtlTmtw?=
 =?utf-8?B?bVgwdlYyQ0pVODNxWUxITTZyNHRmUDlLZHphSlRYSlROTGxNbDhJTy9kNUNh?=
 =?utf-8?B?b2NHMzdyQzNSSnY3SmRUeHN1Y0RST21WUXVueDNvbW5PRVUxZnZ6b1hEQkpK?=
 =?utf-8?B?QVB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HYUozUlhUMWYxaHk2aFVMTUFNMXRuaVl3TCtERk5P?=
 =?utf-8?B?YTVJVEFVeXVrTFd1SHNYaHN0K0RSdVRpUnRja2xsMExuVGFVTFNGNjJMa3Ny?=
 =?utf-8?B?Y21yb3Voc1JnbU9FRk84YzZKT3JUWVBQVVpiUGJINWxXN2Q0eXgrT01kQm52?=
 =?utf-8?B?b01UdG1BZDd5TzhIb1oyeWNxaWRvMDZhNmJ4cXQvS2tXbWQyWGtNVnFxM1Fj?=
 =?utf-8?B?ZGZIRFNTNldRMUpwR0x4bm9nQ09kMGNSbGxGWmxqS2prS0tuL1hBRzkreTMy?=
 =?utf-8?B?T0EySVBTK3dNYmNHZER2dEQ5Z0lXMlQwYWJTM0EyWnRMOXV4UWZNTDVucTdp?=
 =?utf-8?B?cFhPcytmVlI5Qlk4TElrU3dnVHY4KzZpdmkrK21rWVgvZTJiSEg3aGxsTGtL?=
 =?utf-8?B?cnUyaDZtM1JNWGt4a1RjdFF4NFFBY0R6SVREbUMxSExUQ29xTEZOWkIxVUJj?=
 =?utf-8?B?YzFZSGNVT1E5NmpNU1B4SkVTcmlXRTMrd2FxdjFZOGpIdk1jRWdNUTBuYTZV?=
 =?utf-8?B?eENjNFVpVDNQMENkN0xlZit0RXd6UEMxdEYrYlp1ZjJIM1pJUkMzM1FpOW5n?=
 =?utf-8?Q?RGaeLTdRCRIYFg1qBihkAr2HJ?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 66c3a8ef-0f20-4755-8247-08db8791af26
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 13:19:58.2683
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: CAnme3LByg98k9zKmOaPtDnK8ZWTdqOZh1WUWe7PFxk0pJhBQ2UQTWNhDoVNDZ3iHv54xvfnjlpW6g7++9AKEQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7260

On 29.06.2023 14:17, Alejandro Vallejo wrote:
> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -123,6 +123,7 @@ multiboot2_header:
>  .Lbad_ldr_nih: .asciz "ERR: EFI ImageHandle is not provided by bootloader!"
>  .Lbad_efi_msg: .asciz "ERR: EFI IA-32 platforms are not supported!"
>  .Lbag_alg_msg: .asciz "ERR: Xen must be loaded at a 2Mb boundary!"
> +.Lno_nx_msg:   .asciz "ERR: Not an NX-capable CPU!"
>  
>          .section .init.data, "aw", @progbits
>          .align 4
> @@ -153,6 +154,11 @@ early_error: /* Here to improve the disassembly. */
>  .Lnot_aligned:
>          add     $sym_offs(.Lbag_alg_msg), %esi
>          jmp     .Lget_vtb
> +#ifdef CONFIG_REQUIRE_NX
> +.Lno_nx:
> +        add     $sym_offs(.Lno_nx_msg), %esi
> +        jmp     .Lget_vtb
> +#endif

Since I'm in the process of introducing more such paths (for the x86-64-v<N>
series), I'm curious: Have you actually had success with getting any output
from this code path? I see unreadable output come through serial (provided
it's the normal com1 I/O port location where the serial port is), which
likely is because baud rate wasn't configured yet, and hence I might have
success by changing the config of the receiving side. And I see nothing at
all on the screen. While kind of expected when in graphics mode, I wonder
whether this ever worked, or whether this has simply bitrotted because of
never actually coming into play.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 13:24:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 13:24:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565237.883215 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkgK-0005pU-Bl; Tue, 18 Jul 2023 13:24:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565237.883215; Tue, 18 Jul 2023 13:24:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkgK-0005pN-8Z; Tue, 18 Jul 2023 13:24:00 +0000
Received: by outflank-mailman (input) for mailman id 565237;
 Tue, 18 Jul 2023 13:23:59 +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
 <SRS0=ju50=DE=invisiblethingslab.com=simon@srs-se1.protection.inumbo.net>)
 id 1qLkgJ-0005pF-M0
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 13:23:59 +0000
Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com
 [66.111.4.29]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 595c706c-256e-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 15:23:57 +0200 (CEST)
Received: from compute3.internal (compute3.nyi.internal [10.202.2.43])
 by mailout.nyi.internal (Postfix) with ESMTP id E9F215C0116;
 Tue, 18 Jul 2023 09:23:56 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute3.internal (MEProxy); Tue, 18 Jul 2023 09:23:56 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 18 Jul 2023 09:23:54 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 595c706c-256e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-transfer-encoding
	:content-type:date:date:from:from:in-reply-to:message-id
	:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t=
	1689686636; x=1689773036; bh=wqxSF6NELZQ636ApwfBDInxaNjov5gTRnkU
	+PJvF+Sk=; b=hygdq87r2Sagevlck8AdxFXSvSsYgueq4HGCz+OJQq8Vk4SjTVt
	uqzUvClF0p5Cm0+Jrm4rfZGzgIMwlPgyZlCRMbdxhaQfB6aN1xMxPqMhOgPWXM7K
	5w0jxtrGIyTGeZ7fFgqjJT2YYOTJyioBKrQYmyeaQjou4seSynSFdoBKIBfTpjrM
	8RQE8FaTobe1KtiyXnUopFEMe3FDGeEPpZHNMhy9NN9lAolD9KpvQB5fQXhN5JnF
	LUcnVKa+EGulDOFVAn59xbrjuv4trlKOlTmGMmlJplMTVTI3q1nAr4RzzfVm5FnH
	5Hu9c/ij8CvKycT/nAJaJ7OzpTZs5V6kdMA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-transfer-encoding
	:content-type:date:date:feedback-id:feedback-id:from:from
	:in-reply-to:message-id:mime-version:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1689686636; x=1689773036; bh=wqxSF6NELZQ63
	6ApwfBDInxaNjov5gTRnkU+PJvF+Sk=; b=oFduCKpgRZBoEl9rosOi1V/7R2jqG
	Kkc+ko2RKJRwX/zPSGXft5Wxq8/Kbbmqc39wXzAi3VeA5W8OFu0V9FVFMUMiaNQe
	8yEMtHDa1L25s+jQTM8RnncfTH1uWS14Ltggp6ARiJO0z+xEQFsEV1n5/j5Vo/tV
	ccCxup+LBXnfVx51t0rUY4+IxHsh2FIcRZ77f2F1c4qeYAaZOlSd0alsaSsMiBEY
	Yy3PA0SaTHo0iwev48yv4q8hi9nhxqwoPLQFGlUQPximS7/BBvQcyOisWEiqWpPY
	/HZNgm7/ZSLd5pBah724fOO3qzoW9Ou3E3G80vo5EVpx7cbUS2NeWtohA==
X-ME-Sender: <xms:bJK2ZJR10Ec7sfKVBnzXhmlvPVv9Qcx25zaVKpg5PY9ieWRMcw1vQw>
    <xme:bJK2ZCwky-EsOJqkmgs18JefvXlENDFZ0FnpoJFCSBz2oMY3EXasZpHs7tJa1ccdB
    t631YswSMGLaXc>
X-ME-Received: <xmr:bJK2ZO1G7h0OSSZed6JrBmpMBllKL87qtDTkKXhPAI4ihdKgkbwuOxJt-LS_j0WbZAKbbRKXyAL1yPQp>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgeeggdeitdcutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuihhmohhnucfi
    rghishgvrhcuoehsihhmohhnsehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh
    eqnecuggftrfgrthhtvghrnhepieevhfekveefjedvvdehhfdtudfhieegvdehveeffeet
    heekleejudeuieetudfgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg
    hilhhfrhhomhepshhimhhonhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm
X-ME-Proxy: <xmx:bJK2ZBCNjP9GQNeqk8yR1xj4fME49Z0dk8JH0glNSaLwgzC8dEc6Ig>
    <xmx:bJK2ZCg0mDz4Gux5hEN_FzJzmQtx-HBBy3BpzM_E3J8-7XGjycoeQw>
    <xmx:bJK2ZFrBcNHYIlqWUMluvFMbLV_2sB6m6-H9xh5mI0CmJH_zxVU3eQ>
    <xmx:bJK2ZKeSFogpVlxRArSUtg3jQRTguV3XARabx_6Nx_j5T111EiqlUQ>
Feedback-ID: idc5945a3:Fastmail
From: Simon Gaiser <simon@invisiblethingslab.com>
To: xen-devel@lists.xenproject.org
Cc: Simon Gaiser <simon@invisiblethingslab.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH 2/4] x86/idle: Get PC{8..10} counters for Tiger and Alder Lake
Date: Tue, 18 Jul 2023 15:23:34 +0200
Message-Id: <20230718132334.2087-1-simon@invisiblethingslab.com>
X-Mailer: git-send-email 2.40.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

---
 xen/arch/x86/acpi/cpu_idle.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 557bc6ef86..a6d3175156 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -155,6 +155,12 @@ static void cf_check do_get_hw_residencies(void *arg)
 
     switch ( c->x86_model )
     {
+    /* Tiger Lake */
+    case 0x8C:
+    case 0x8D:
+    /* Alder Lake */
+    case 0x97:
+    case 0x9A:
     /* 4th generation Intel Core (Haswell) */
     case 0x45:
         GET_PC8_RES(hw_res->pc8);
@@ -185,9 +191,6 @@ static void cf_check do_get_hw_residencies(void *arg)
     case 0x6C:
     case 0x7D:
     case 0x7E:
-    /* Tiger Lake */
-    case 0x8C:
-    case 0x8D:
     /* Kaby Lake */
     case 0x8E:
     case 0x9E:
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 13:25:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 13:25:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565243.883224 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkhs-0006PT-Lx; Tue, 18 Jul 2023 13:25:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565243.883224; Tue, 18 Jul 2023 13:25:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkhs-0006PM-JJ; Tue, 18 Jul 2023 13:25:36 +0000
Received: by outflank-mailman (input) for mailman id 565243;
 Tue, 18 Jul 2023 13:25:35 +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
 <SRS0=/lOh=DE=citrix.com=prvs=556a0cea9=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qLkhr-0006PE-7u
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 13:25:35 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 913fc1e9-256e-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 15:25:32 +0200 (CEST)
Received: from mail-bn7nam10lp2104.outbound.protection.outlook.com (HELO
 NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.104])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 18 Jul 2023 09:25:29 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by PH7PR03MB6941.namprd03.prod.outlook.com (2603:10b6:510:156::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.28; Tue, 18 Jul
 2023 13:25:18 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 13:25:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 913fc1e9-256e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689686732;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=mFNs0Q7Ip0zkS6aRrx1P0yIll+0+bJYH3YlsnpVIEVc=;
  b=FbUopz6EecfkeEVBWyRO8whPQoJvZ9OKEw52w4/RvPyBYUJvFpTd0V6d
   Bze0bwYcN4ZDEDE9C4OFFNz7IKo0u32PWVPj6jZP7wHp7yJ6taEvfcCqG
   pT9b02N0NN0voaTotjzpN11q2FRsPypxefSZKVMMOTJf7PuXhzUkPbec/
   w=;
X-IronPort-RemoteIP: 104.47.70.104
X-IronPort-MID: 117024692
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:B/P5z64aNuNVtJWdDmttWgxRtNrGchMFZxGqfqrLsTDasY5as4F+v
 jQcWDzUO/mJNmvyeNwia4yy8EwP6JCAmoJkSgo4rnhhHi5G8cbLO4+Ufxz6V8+wwm8vb2o8t
 plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraCYnsrLeNdYH9JoQp5nOIkiZJfj9G8Agec0
 fv/uMSaM1K+s9JOGjt8B5mr9lU35ZwehBtC5gZlPa8S7AeE/5UoJMl3yZ+ZfiOQrrZ8RoZWd
 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4
 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5m1
 /sfGm8hbw+62s2R7ZOKU7NC3d4bBZy+VG8fkikIITDxK98DGMiGaYOVoNhS0XE3m9xEGuvYa
 4wBcz1zYR/cYhpJfFAKFJY5m+TujX76G9FagAvN+exrvC6MlEooiOSF3Nn9I7RmQe18mEqCq
 32A1GP+GhwAb/SUyCaf82LqjejK9c/+cNtLS+XiqqA72jV/wEQuETIRCV6j/MKAyUfud+pWD
 mYf3xYX+P1aGEuDC4OVsweDiGWFuxkac9tWDewh6QuJx7bU4gCWHWwNRHhKb9lOnN87Q3km2
 0GEm/vtBCdzq/uFRHSF7LCWoDiufy8PIgcqZyUJUA8E6NnLu5wog1TESdMLOLGxps34H3f32
 T/ihC03nbAal8MI/6S941Hcgjioq4TJTwg6/QHeVCSu6QYRWWK+T4mh6Fye5/AfKo+cFwGFp
 CJdw5TY6/0SB5aQkiDLWP8KALyi+/eCNnvbnEJrGJ4isT+q/hZPYLxt3d23H28xWu5sRNMjS
 BK7Vd95jHOLAEaXUA==
IronPort-HdrOrdr: A9a23:7ULnv6D0R2MPCWXlHemL55DYdb4zR+YMi2TDtnoBMSC9F/byqy
 nAppomPHPP5Qr4dhkb+Oxoe5PwJE80lqQFgrX5X43SJTUO0VHAROtfBO3Zsl/d8kbFmdK1u5
 0NT0EwMqyVMbHWt7ec3CCoV/wb6J2s9qSwgOfXyH1gCTttd7pr425CajpzVncGIjV7OQ==
X-Talos-CUID: 9a23:etx4gGBXcmNBAWj6Ewtg83xLNsE6SyDy61rxElbiJz1zcJTAHA==
X-Talos-MUID: =?us-ascii?q?9a23=3Axh114Q//0HuO0oIW0OfDo/uQf/pxzKPyDVhQqqx?=
 =?us-ascii?q?FspmoDSVVETy4sA3iFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,214,1684814400"; 
   d="scan'208";a="117024692"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=M+qakMDy0NvauBO/5Ixx7B+ta7+Ppud8ZXKA1tfOVLW1qFG60AmL6ksby0APmjwgm2NJmAElHncE0orGmM19hNs0OnKSR6jFkc6lzgoEjPTvuvi9Y2JREkCCbRQxf9a1Us/ukoJwMZ7a2roZboiHxzTcUSdBkf6BdosNpX1/r/oQPWuHYRSBSWWEf8sSYCxRj5xfl9aSdYlAjaMKSzrc148Xm7sVQIpOIFCqBfRGFXT67riQrqobnq7FHdpMM+VamA5sAppKmj1dPJulfbOdrqKHkpktIxPhbPRmA3k1qAzRwscYTMMgsV2oFef733ktF+e50hpgrbr0y8AqivfGpA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=mFNs0Q7Ip0zkS6aRrx1P0yIll+0+bJYH3YlsnpVIEVc=;
 b=Dow7A9GOsOCF3rPlXzqyvdCH80/k9vpxp4v5banc/IsKP/UBpvCs4FzX3obHggB3+ZTBsFgEA8mHohdSeCF4v6OWfj2sLROKQLChKMZ8AGtdkccy5wSonaQyYmPMyAPc9nK6LGVu8q986esxJ6fscpk+ViaLzj2QYWXUUyMg1eJ1bQPj6rwslOp28JEM2BBjR21gqgkb1OmwaG1TycP04KJLVgcs0Pr5w/+r+jmfqxdwiV6xV/uSdoUSTS4JcK/+EpJo4aXCGe1O97WQdGN10iq6YFSFRLn7fWJt91IMFjtztqSwXPCE+AvqOHcyILXSScOWF5hK9zhHQ7vSywA95Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=mFNs0Q7Ip0zkS6aRrx1P0yIll+0+bJYH3YlsnpVIEVc=;
 b=kKhmigrlCmoDtvqr24B1eTLtKiTYDkRwT6iRjeiMN7SVACiI9nv2F/sOfwntg3Ie+eLlBSzBle2B5ySpfPk4l0z/4bkwZlq/OMx86J4z6UgZdISeNDF9qGZmunNPvgDnJR1MXI1UcaWI1L2P+NkvgnPp7v/0m5DsAXuZVSjLA0U=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <bfbffbaf-01e9-3b6d-a57b-d1702ee6cf7b@citrix.com>
Date: Tue, 18 Jul 2023 14:25:11 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [XEN PATCH] x86/msr: Allow hardware domain to read package
 C-state residency counters
Content-Language: en-GB
To: Simon Gaiser <simon@invisiblethingslab.com>,
 xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= <marmarek@invisiblethingslab.com>
References: <946e5494801866c93332cc5d9ec0fa03a4df00d7.1689686046.git.simon@invisiblethingslab.com>
In-Reply-To: <946e5494801866c93332cc5d9ec0fa03a4df00d7.1689686046.git.simon@invisiblethingslab.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0687.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:37b::13) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|PH7PR03MB6941:EE_
X-MS-Office365-Filtering-Correlation-Id: 2822fc7a-01fa-4224-8d83-08db87926d83
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Fr+bGNzKlIgcfVQjZfiutzojMETOeHJtMt2aVrUq0aTQ6IiH9i4iImdEvCkHiVgIyhFLhZhR4AECNHt26q94zJJLY1AktPSrPAaja5sdME7hG1KWgw28SvQRVYyCB+21R0W+nlBKCUu+N9vP54AbPIEzvZEr2mw7GftBICPr3SV631qWgeBCc9aqhV5TNr+fCr2Tn9Xw1cLiwBb9K+vGRsiTcb3Yzu2owgGx9nsyH5EQQp5NfRxdEw3DHXW/Bhk6icRlKKdyYjaGEFp55YjNt/+bGTxXqsldGo0j+JeHsU2ywOL+64IHA1CMU0TDEfoDsljc/A1K5eoCzraLWfmz9rGTTmZL6AcJSwBXL7VZ0ka5UUtQXNkqiEvffu+Q2ICDcwpitQ8UYBveH6C3EVUzXu1Nsnj6wHJsTIhD1nMbpEZ9B8qzYNSEruayoHlpBNY9GbquT1Fl1gvkO9j6IAFJOFv3r9DHFrAj2trh+gh5a3thYS4RpEOurA1TlSJGdixjrOl+1a6UwtiYEvHyQLZZQYlGaZ/yLAbYw8zMtxiWEBHdPCpR+XfWg9BxHZm2xLZrkudrNw6jBzgBKCnZDZ44QsoehDInSKqWkoqyPD3iePTclON82amJyh6vuTenL4yP++NIzRM45MMmPm67eJwSjw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(366004)(136003)(39860400002)(376002)(396003)(451199021)(31686004)(53546011)(26005)(82960400001)(38100700002)(6506007)(54906003)(31696002)(478600001)(8936002)(66476007)(4326008)(66556008)(6512007)(66946007)(86362001)(41300700001)(6486002)(6666004)(316002)(8676002)(5660300002)(2616005)(186003)(2906002)(4744005)(36756003)(83380400001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QkovQm5OYWtleEFFNW1DOWcxT0Q4WmoyeWVieDR0WkhXaTZTQ05Nc1hjN1Jk?=
 =?utf-8?B?bXF2eFN4MFZhMWVjOTFmWm1rNC9qdUg5bm5SSTB3bjJnaFB0UmRXa0pLeGRU?=
 =?utf-8?B?NXkyS0djMHNtTUZ6Y1lGSWd1TS8yRW5EdE4xVERYQlBmZC93eVZ0RDQ5NmQx?=
 =?utf-8?B?SVlybWdOaUZmckNnVmJLTEZ2N2o3R2FXcXRGN1JXNkJOT1ZmNHlQTVdGc0g1?=
 =?utf-8?B?cnVKd1FVSlZ3b0NuNW9xSGI4eFVBSk9yY2xVdnZsUjE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//MwVchxYx8z+G0YAXpOv2hO+ZqWuCydfQqT1YMa6Xcx8AF9HJ/TagsJsBH5vUV6F/3goV1npqL1J6XV/B70dQBZA8MZ5qIjzdbPakY0mCrJNO1J5q
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2822fc7a-01fa-4224-8d83-08db87926d83
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 13:25:17.9351
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: CgkLDK/m9+X20Z0z3nD5cVCkcIy+uGDxU0J3YunNhqPDFAIzLNaS72d6xsi221KXkgjjHbRAIWzzIM6KOkdDFlQoxxY3jKX1mI7kxUyVwmE=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR03MB6941

On 18/07/2023 2:17 pm, Simon Gaiser wrote:
> Since it's limited to the hardware domain it should be safe and it's
> very useful to have access to this directly in dom0 when debugging power
> related things for example S0ix.

You need a SoB.

But, this is an area there things are subtly broken.Â  For package-scope
MSRs on single socket systems (which does include client systems), then
this happens to function.

It does not function for core-scoped MSRs, or at all in a multi-socket
system.Â  In such scenarios, dom0 can be rescheduled to a CPU in a
different scope while it thinks it is sampling a single scope.

This is one of the areas where dom0 and Xen end up fighting over the system.

I agree that we want some way for dom0 to get this information, but I'm
afraid it's not as simple as just permitting access to the MSRs like this.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 13:29:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 13:29:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565246.883235 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLklZ-00079T-3O; Tue, 18 Jul 2023 13:29:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565246.883235; Tue, 18 Jul 2023 13:29:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLklZ-00079M-0I; Tue, 18 Jul 2023 13:29:25 +0000
Received: by outflank-mailman (input) for mailman id 565246;
 Tue, 18 Jul 2023 13:29:23 +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
 <SRS0=ju50=DE=invisiblethingslab.com=simon@srs-se1.protection.inumbo.net>)
 id 1qLklX-00078x-1W
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 13:29:23 +0000
Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com
 [66.111.4.29]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 18c19d30-256f-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 15:29:19 +0200 (CEST)
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.nyi.internal (Postfix) with ESMTP id E644F5C0134;
 Tue, 18 Jul 2023 09:29:17 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute4.internal (MEProxy); Tue, 18 Jul 2023 09:29:17 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 18 Jul 2023 09:29:13 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 18c19d30-256f-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm2; t=
	1689686957; x=1689773357; bh=Ouq8tD00YR5lLRXoWDu9BCI9TFkUKzpXjw8
	cIr+gTW0=; b=gfk6K119kWni0dFx4hwlkxNPkVHSiPmexHm8mP69qFhTh5TGHoY
	CbNuKnpwPemb9ja2Ir8O0EhfU/ogWn0TfjT5gJpxa8ramI+ZhQl69+itEXNupuJo
	OnMXhXJLd297snC88PP+3fsKy7jzdzHhdCpfs8gUaJSkQWtzI3zHGI2eclq1L7hz
	cYA3ONowbIeZmD67xXpOdscKjCt4wE/sH+wQ38fnVg7PaEBfoE1XJxRiwC/lnVz0
	A6xTGVlflu+Q4A82bTnkQ9fUqQvEAy1OKChSwBnpUOnldrK/PQv2/n9YYfYImynr
	JDVTychMU4se3xfV+6zJxSPIB19jC/GaQsA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1689686957; x=1689773357; bh=Ouq8tD00YR5lL
	RXoWDu9BCI9TFkUKzpXjw8cIr+gTW0=; b=ogkb3bVKru/SuK4SSIdJqyDP2uh6y
	vvZlUiw8YjObq+Sg3lW4TnOJMh5iDy8VOo7eEo470xTZGi4UKjjYoBfISnoyVYCR
	g2GMbngzqj7/gE1ZK1xxlS84voK+PvO3hvvtPQTcRX9AEuUrdOFGS7kQFrcEuGpt
	67ImocJX9AsyzYBUl9gp/ap9M4R6vZW2zgTbHaDOf9O1hGfhwVbW2VtE6oevUpBb
	C7custI5Dk3bcLdDCe7rOI8ipcRylCniVMJfPb1gzkUaYRsnNOFsR6QZ/Zf9JQtg
	V5SvNzmJcig0aHNtjAZN8oQbDTwVfZo351XoAsW43HkjzPpLZ5VCMftdA==
X-ME-Sender: <xms:rZO2ZCLqKP_EuN3ouJKXD3ljeBycgpw6weEwHXvcWjp9UtaQyfvWyw>
    <xme:rZO2ZKJYFAJ_HkOJKs6E33HLkmPPpxVT6yduBc9CKDJPj_glm2ox5Hm0KR-cS_e2f
    _QlqIoYG3SefVg>
X-ME-Received: <xmr:rZO2ZCuhA1MsHqnQaV3HVPTku4HnmN0lePv7-F_Zbau7_PmJBYyGLQCe5zVaKA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgeeggdeivdcutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpefkffgguffvvehfhfgjtgesghdtreertddtjeenucfhrhhomhepufhimhhonhcu
    ifgrihhsvghruceoshhimhhonhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtoh
    hmqeenucggtffrrghtthgvrhhnpeekueffiedtgeffleeglefhledtfefgiedtveeiffeg
    hffgledtveehhfdugfetveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh
    grihhlfhhrohhmpehsihhmohhnsehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtgho
    mh
X-ME-Proxy: <xmx:rZO2ZHat372iLA8yWC0zwtCU8XYwq0xUZxYJX-6r2N7cs45g2VBBxw>
    <xmx:rZO2ZJajIEeYM_Efdy2gmoq943qXMEIGUKNnNmnzVt0KD5S5MneuOQ>
    <xmx:rZO2ZDAHDf_pweK7uZSGPlmwqotVeVoKAp2gcBd-2N-aKl8vMPNfRQ>
    <xmx:rZO2ZNEivbdq-LBesNKUfevjCq8UFLaHwb92PAHuG3FTukU5oiul0Q>
Feedback-ID: idc5945a3:Fastmail
Message-ID: <36b7e67c-f1c8-11db-aa8a-df4d8d01bb17@invisiblethingslab.com>
Date: Tue, 18 Jul 2023 15:29:04 +0200
MIME-Version: 1.0
Subject: Re: [PATCH 2/4] x86/idle: Get PC{8..10} counters for Tiger and Alder
 Lake
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= <marmarek@invisiblethingslab.com>
References: <20230718132334.2087-1-simon@invisiblethingslab.com>
Content-Language: en-US
From: Simon Gaiser <simon@invisiblethingslab.com>
In-Reply-To: <20230718132334.2087-1-simon@invisiblethingslab.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------OSTiVepPvw0Ci6G3TMfaqXKS"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------OSTiVepPvw0Ci6G3TMfaqXKS
Content-Type: multipart/mixed; boundary="------------RmJ4UyE1bEccMyXc4q0dmRd8";
 protected-headers="v1"
From: Simon Gaiser <simon@invisiblethingslab.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= <marmarek@invisiblethingslab.com>
Message-ID: <36b7e67c-f1c8-11db-aa8a-df4d8d01bb17@invisiblethingslab.com>
Subject: Re: [PATCH 2/4] x86/idle: Get PC{8..10} counters for Tiger and Alder
 Lake
References: <20230718132334.2087-1-simon@invisiblethingslab.com>
In-Reply-To: <20230718132334.2087-1-simon@invisiblethingslab.com>

--------------RmJ4UyE1bEccMyXc4q0dmRd8
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Please excuse the wrong subject prefix. It should have been [XEN PATCH].
This is a single patch.

Simon

--------------RmJ4UyE1bEccMyXc4q0dmRd8--

--------------OSTiVepPvw0Ci6G3TMfaqXKS
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE3E8ezGzG3N1CTQ//kO9xfO/xly8FAmS2k6IACgkQkO9xfO/x
ly9ToxAAkAys64lGrojN0t426LCkL7bVL9FGItCouNSVhDLsOKQnThMmLEi9gorw
4okbNtYzaH6UW+fC8U2EdbpnGhYJ1cOHpXDKTw2Orjb4FpO9Z4eH8z5j3MfuCgjg
hod2XuKLxS/OnqgGO9JJj1O8jH0yZgkxEK6faIVr4aFXXOuiCksmTwenpmCV0wdw
9U6O4ehhLPJgxH9rIIBay1xjP1xtFIWS8j9+VpBOaLIcnJNRTGCoDQXY+wKE28vY
PRflQoNHCaqv1lo1lheXkEmM+MiVbyE7jFPmB2UvLmJ5Vun0fp3inkF2aNOvX/hJ
MFIkEjJwzmEDE8b2M3VHcb0OhW/eO7tqD6S4hUmOySXwSeoMMLKwSSnwnaz032Hp
aamuFsnjKIJqLmwfIXBX5m+0sCnTmmkQDQeciR6B2ocOXAgUz9vPB5jp50tAlDh+
yytWS6fth6k4ZXAXv6D1EtPm8jr3N/pJaKE2yxlD70UoA6kn+u/kyy1fX6is4+87
y0H/ak2T+PTaD7RwiDVfk2oZyG1MkOqL/HkLa7XW6gwqKLgKv7ttcqZvIfUyjG95
vTbT/uo70Ljz4sQb8k4/sGZrUazQGN+uJTRZZ3JjfG9WqeEG14TORu8zJ0W2l4dR
C3oTwzIALFLyX/QJ8FNqTx2uguX4wrbJuCPX92MuYK8QNiefu38=
=+SnM
-----END PGP SIGNATURE-----

--------------OSTiVepPvw0Ci6G3TMfaqXKS--


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 13:31:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 13:31:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565252.883244 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkn6-0008WE-DZ; Tue, 18 Jul 2023 13:31:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565252.883244; Tue, 18 Jul 2023 13:31:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkn6-0008W7-As; Tue, 18 Jul 2023 13:31:00 +0000
Received: by outflank-mailman (input) for mailman id 565252;
 Tue, 18 Jul 2023 13:30:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=9eua=DE=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qLkn5-0008Vz-8u
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 13:30:59 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 53fa211a-256f-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 15:30:57 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.161.123.45])
 by support.bugseng.com (Postfix) with ESMTPSA id 38EF84EE0C88;
 Tue, 18 Jul 2023 15:30:56 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 53fa211a-256f-11ee-b23a-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Tamas K Lengyel <tamas@tklengyel.com>,
	Alexandru Isaila <aisaila@bitdefender.com>,
	Petre Pircalabu <ppircalabu@bitdefender.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: [XEN PATCH] x86: change parameter name of hvm_monitor_msr() declaration
Date: Tue, 18 Jul 2023 15:30:47 +0200
Message-Id: <99289902f337b83f1ea034fa1eff5db5bdae6c46.1689686715.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Change the parameter name of hvm_monitor_msr() declaration from
'value' to 'new_value' to match the corresponding defintion.
This fixes a violation of MISRA C:2012 Rule 8.3 ("All declarations of
an object or function shall use the same names and type qualifiers").

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/arch/x86/include/asm/hvm/monitor.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/hvm/monitor.h b/xen/arch/x86/include/asm/hvm/monitor.h
index 5276b0af08..02021be47b 100644
--- a/xen/arch/x86/include/asm/hvm/monitor.h
+++ b/xen/arch/x86/include/asm/hvm/monitor.h
@@ -25,7 +25,7 @@ bool hvm_monitor_cr(unsigned int index, unsigned long value,
                     unsigned long old);
 #define hvm_monitor_crX(cr, new, old) \
                         hvm_monitor_cr(VM_EVENT_X86_##cr, new, old)
-bool hvm_monitor_msr(unsigned int msr, uint64_t value, uint64_t old_value);
+bool hvm_monitor_msr(unsigned int msr, uint64_t new_value, uint64_t old_value);
 void hvm_monitor_descriptor_access(uint64_t exit_info,
                                    uint64_t vmx_exit_qualification,
                                    uint8_t descriptor, bool is_write);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 13:31:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 13:31:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565259.883255 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLknn-0000g2-RW; Tue, 18 Jul 2023 13:31:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565259.883255; Tue, 18 Jul 2023 13:31:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLknn-0000fv-On; Tue, 18 Jul 2023 13:31:43 +0000
Received: by outflank-mailman (input) for mailman id 565259;
 Tue, 18 Jul 2023 13:31:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLknm-0008Vz-T4
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 13:31:42 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0626.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::626])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6e2b96a8-256f-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 15:31:42 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAWPR04MB9960.eurprd04.prod.outlook.com (2603:10a6:102:38b::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 13:31:39 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 13:31:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6e2b96a8-256f-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=h9z+AmZA1GryZeM4tmY4lNkPS2BMDWWVgWipP4xM4+biQ6g7yHyQJsRThLcFL+8Ob6HlUE6C2FRQjmOEXtvQplBLA2A3nH0tOteOKJq98ZmiDa36DS6fH9wTer4payap+2Fn3ezkqa9AU7C8RiJeUOmvI+tMb57vUV6MopcXr0b6U7xt5jUKsGUfu+lgUuZScC1n69st8BhB1PUAqrtjcYsoMDkJue+7Xn9Eu5tAggPqOpv2O+Y1eH903byh9qLm8vSuPfYKKmKpxDFzYLDp32h0eTgrgYjkodGyTvb/Iw6TxSuJbDIgVJFTD9StTaHUglxu+Y0DTgDtV9cx7velNw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Umhn/UNfEyDPEfccZQ+7Y17IMf8ChaDDd4GeUL7WtlE=;
 b=HR1IsWJPnhNHM/W5N/qCUeq8kv4on+kf/o1duralXcW7lY7ZYEA5OWHxWmZOzlK8F31z8dU1109NOrJAbJ2e3O8yT9b/yJa5yXSD1s0XLGUj/Jm9LgFnDBDkU6VgX3yn8o/MJLmLw9bWDYJIi6SWqpdm598aq10g4LUDm+LyTLM1vzdUoZqP7cdTkv8bKTpWFrkX4gZePmn0PApE+AITOqaiA5bJApu8+nN6CSDzqizsClq9eGf4wv6yLOrsUuPBNzdc/CdZnqkYX1MhHhu/A3HOGOh2oSwbn2vf6MpDXxu98fQD1ozranZtaA3Hrfm4Cy0WhqxyG/FTmnv/zCSoEg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Umhn/UNfEyDPEfccZQ+7Y17IMf8ChaDDd4GeUL7WtlE=;
 b=ahUAwJN5Om/a8L7kxuf6MLQd3o9psTEhMdTgoVlnT68GtCPx/vmS4mlaeu3c9gPYV+Zoo2t8e35jSiO+08v4+BPNckOBAbp9y5+eHyMpFPlSEAEtsZX2QsbSjoBJZYOPgVfpqwgO/kNYYXIcjETtjmpIrUFW+i2/Xbpb45Da+W+TYfvPikN7jO69y6qDj7D91cwSPHwj+vx9GkRDcqq6+4KXwyzatNWheSUMBsdiwv3gox7c2DKm6zfU2LY2vDXSAz3oQ7fVxIqVJeeJeYdOG+Gw3vYIVUN+7hbeF7SP0uvyE1vTrR2phuxQklU81vJ7NKRW7f0khd1KtnZ+zVteiQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <d512a592-24e7-2eca-16ce-7451dc110f64@suse.com>
Date: Tue, 18 Jul 2023 15:31:37 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] x86/msr: Allow hardware domain to read package
 C-state residency counters
Content-Language: en-US
To: Simon Gaiser <simon@invisiblethingslab.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
References: <946e5494801866c93332cc5d9ec0fa03a4df00d7.1689686046.git.simon@invisiblethingslab.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <946e5494801866c93332cc5d9ec0fa03a4df00d7.1689686046.git.simon@invisiblethingslab.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0136.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:96::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAWPR04MB9960:EE_
X-MS-Office365-Filtering-Correlation-Id: edbdca5d-e91f-4959-7dcb-08db879350dd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	urJq08b1APu3Xa4iImEY1H2pZ1AuMZBnvcVe6+XIY+fjQSPQlsV7AwolEYg/OripcArjcUwyt3fv+nfbdztG/O8oeLbxcbyrbK80YYbtJfsJmVZabkmXcmDSSQvwsfQ5CL4DvqMic3Cfm76NHXd8nBRyEOLC6nG9wkqRS6blyOgycCKowsye/2WNS534ul9YsfS4gaB03bVGaKaFOaKMlLfPPFT16aoFR2flYm2N4aV+9uVtlEe9WaeQgMB6hojQ2WqhBru8rFgUWu0gi6qcd+iKtULVICCiv7e3FUFgn5P8akE4Lh8Xc29leR0ikOCzaBq+5lbFYj+cw7JK2ioPvNEa7k5Y7+nO/BLB5a3cSBygs/ccU0eAmdQXJ4jicpopDJPgeVlse79aSoTl6Ut4hwofZ7gnG5yjtztI75tnYNoxmvssHOpNzBv0nobzYdzbFCUhH+/L8NDmWIJ3sKQtus18vfdjPUdfKveP1QSDcF2vv/2BrBz5fKUeK5YmocLS6s6FR268c/2AZgxM77N6VEVaYnXd+ypdd9jcIKaNGUGXzmcCFIyMGvzd0wj+sD45T1SaKm3ujIidGMiK23MKBa2hZpOxW9JxgmsKxNOov2uR6ofi5awDM8NkGynq1OnbLhk4B+0+nS9tqjv91ggt7Q==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(39860400002)(136003)(346002)(396003)(451199021)(31686004)(31696002)(86362001)(36756003)(4744005)(2906002)(2616005)(186003)(6512007)(6506007)(26005)(53546011)(38100700002)(6486002)(54906003)(66556008)(478600001)(316002)(66946007)(66476007)(5660300002)(4326008)(6916009)(41300700001)(8936002)(8676002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?S1RFWE1pQWRvT2xzdVIwUkh6R0dqcHdSNmMxZEJtRjBmZHRucGJLbzRXclNs?=
 =?utf-8?B?Mk1XM0l2cFp2eWNWZys0RUhIQ2ExZHd4bk9hNjJTNGFNY0ZiM2N4UlB1dTN5?=
 =?utf-8?B?eGtML2hhcWVsVnUvTFVjSVRNUXFnMW8xV3dKR3hoZjRoaGtBMkJRcUlNeXRT?=
 =?utf-8?B?MUduYW5EeXlpaDZaOGNQWDNvOE52V0QzdWVDRjRvQkVYNzdBKzZYRkJtZlUr?=
 =?utf-8?B?RUVqOXBMZGptblJsQ3JJdnEvUmt6Y1NiNWdlcERGeU5vSklxbzZBcTlOT3N1?=
 =?utf-8?B?VTcwSzQ5RHdMdDV0ZUkrMlR6UXR2aHlLNjgraVg4dUNBc3ZwclpzbnBTNXUy?=
 =?utf-8?B?b2dScUM4N1BQaGgzOXhob2tBWi9xV08ydmxQcVp5djd4SDh2OTR0WHdzcjdI?=
 =?utf-8?B?LzNKTUYxOGJuNUJxV0d0VVVXdElXNTMxRmZ0WWFuaVFNWUR4SkJDK0szQWZq?=
 =?utf-8?B?N3g4SjdPSVFEQ0twa014emJvSHloMUc5K3FFdmY0RElKT3VQRUgwM3d3SDV4?=
 =?utf-8?B?cmZlc2VweG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llXcDR1eC9y?=
 =?utf-8?B?NExiR1l2UmMzVjB4bHk4MWZCQ2g3WENJR1VKZE8rc2ZLRDJ2QXV6TTRyYm1z?=
 =?utf-8?B?dEltQ3VodEI2czZWekhXZDNwdkl5SG9kNFBWL1JIT0orYWZTZll2ZTMxWkRD?=
 =?utf-8?B?REZPN3BOMnBRbnQ4YWdrbkxaT2FaMWlwc1NFL3g4K3NYcWs0MUxxcHEyUUF0?=
 =?utf-8?B?dHRGMFR5R2xFVnJNOUJjMDRzcW56UDVic0MraGZ2ZGMwNVQzZytoQXVobnlk?=
 =?utf-8?B?VFZabU54dG9GeG1mOWN6TFU2b3kxTC9hYWNzY2xablllZFYvK3JaUnlDWTJP?=
 =?utf-8?B?QlMvNXFiUTVlTlVMM2xlb2NyeXNVVXRzSUNGU2ZGeXkvWEVCQTlLbWFBQjI3?=
 =?utf-8?B?MVB5QzA1UVNLeW9nWGgxbWxOVGQrMGJwcjlxVTVlREp3RGY4dDExYXpqaENE?=
 =?utf-8?B?OXcyaVlzZEl2ZzE3ZGpndVRLekJrTURDRFA3bUtnYS8veng0eTdKZXhDOWJQ?=
 =?utf-8?B?blJaM29KN0hibVU5d0RmbU1kSFFSclFCcVZLREtDZW9yRm1Vb3pHelBjZU1t?=
 =?utf-8?B?SW9SNFIxdzE1RjZycWduQ3VDM2pqUE5Ld0NXYWJqKzN2UFlzMzhiUXhZUVZj?=
 =?utf-8?B?cVY0cTNYVmJ4ZzBoeGZQWE8xd3d5ZDBISTlRMXN6ZGhxa1UvVHdKbDlySTk5?=
 =?utf-8?Q?Pp5+tgouMbSS083ISTbehEzyF?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: edbdca5d-e91f-4959-7dcb-08db879350dd
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 13:31:39.1125
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Qr2kBlUn014PC44/MZZH7kUBNLpNPO3HVnsrkeUZbt6SR7e/JBi0Pup/bgKQiq5poXWG6r6h9Et0l2wgY/dV6A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9960

On 18.07.2023 15:17, Simon Gaiser wrote:
> --- a/xen/arch/x86/pv/emul-priv-op.c
> +++ b/xen/arch/x86/pv/emul-priv-op.c
> @@ -965,6 +965,20 @@ static int cf_check read_msr(
>          *val = 0;
>          return X86EMUL_OKAY;
>  
> +    case MSR_PKG_C2_RESIDENCY:
> +    case MSR_PKG_C3_RESIDENCY:
> +    case MSR_PKG_C6_RESIDENCY:
> +    case MSR_PKG_C7_RESIDENCY:
> +    case MSR_PKG_C8_RESIDENCY:
> +    case MSR_PKG_C9_RESIDENCY:
> +    case MSR_PKG_C10_RESIDENCY:
> +        if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
> +            break;
> +        if ( is_hardware_domain(currd) )
> +            goto normal;
> +        *val = 0;
> +        return X86EMUL_OKAY;

In addition to what Andrew said: Why would we suddenly allow these
reads to succeed for DomU-s?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 13:35:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 13:35:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565262.883265 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkrE-0001KK-Bq; Tue, 18 Jul 2023 13:35:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565262.883265; Tue, 18 Jul 2023 13:35:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkrE-0001KD-96; Tue, 18 Jul 2023 13:35:16 +0000
Received: by outflank-mailman (input) for mailman id 565262;
 Tue, 18 Jul 2023 13:35:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLkrC-0001K7-ND
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 13:35:14 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on2061b.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::61b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ecb07680-256f-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 15:35:13 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8811.eurprd04.prod.outlook.com (2603:10a6:20b:40a::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Tue, 18 Jul
 2023 13:35:11 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 13:35:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ecb07680-256f-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JIJJQPwQ/yMMtlE+x2elF3274LxzNzpRasIQY0upPkIuOST0lxjgqSIcLqiauEFdUi+0jf9BRhktoashpYGMr6l0D6eMBFOs2MjhDeaFCOzzN2nTYTWXCTgJc5qyHo+4dfpyC5lVxUdswex9n7cfK8zdcVq8ZTK8vTO2HnWWWNhDP8Qwg2acPudUw+hDFKdy4ASrzb1398OOm3hPff63xkOsaSZS02YhLAHV5BSqZJ0XB7WnVSoV0l+s/DGO0iy26iyE1b8MCjTus3kQv3L9q1CL10+EBHpAl7/xwid23Bmx6nnw+9gCXwZTISN7kgIOs+cyD50oN2uMBrWSE25raw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=SKNiIAb7UMZ/CQOhwRgB6/YTS04hMOKJYnQBe1pbbUM=;
 b=By2Pntlw/9ueZvVvWKmstWTvlhAAVYXSja4YjYVTUO5KFaXCkWFocY5GCHZQ4GmSKlRm/NSXy4XmxDncd2KGQ869f5X9KngBLjJ4EqCmir2hxmrZWZlcwllQyhWTmp97eP4XCe0ERZYLrELQRXdT5GkfrcHYvNfvJdv6TIuiAK7c9mfwHr3/Rj9c6Aicn+llPkk4nrBNsEg3cZvfEtwMbyUkii9rbL0IUC07mKxFRRJZbWztLcSpbiqKQnZOVL8OIsvL2sARgLep7HtJvFyPkpZ7hnfTUJ/VRHOZU4/JxAb+0hYzyJpMmDl79ShFmev13M/7fLf+i8De54Kv2BwYTA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=SKNiIAb7UMZ/CQOhwRgB6/YTS04hMOKJYnQBe1pbbUM=;
 b=hxebelQqZjoV3oBasJqws60uXfCCtCXezKGxpaKgWOj7VBo0/AsZ9CAe2S4qUl1gOB1L9sBz4yH0QQYw/E4dZ1vJEJpU9E9k1t4hAg0kUfZBfNf/7e7drHb1JU0xQJBUfTzRm2qyQMrOZEmsc6wnl5YwBa46CFmbmyQmfnvJixvVjC69kfCDDa2lNJD/eXwPXA3HzgyUKionwbmLllD2/CJGCxjoO0f5gXEa+O81aDMUpvGLLzkHomCUlmZ6niJFtb65nODpx+8j05mAzHTx4KqpLBMYEQJzb7R/WjXbfmNJH3RAa8fRcIKpwpg7oUaJAiGumZKZcB4T44M1hH2UWw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <aa23a090-1883-008b-e395-2a3bca709258@suse.com>
Date: Tue, 18 Jul 2023 15:35:09 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 2/4] x86/idle: Get PC{8..10} counters for Tiger and Alder
 Lake
Content-Language: en-US
To: Simon Gaiser <simon@invisiblethingslab.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
References: <20230718132334.2087-1-simon@invisiblethingslab.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230718132334.2087-1-simon@invisiblethingslab.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0035.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1c::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8811:EE_
X-MS-Office365-Filtering-Correlation-Id: 99a311cb-ce09-42db-464b-08db8793cf66
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	MrIawZzioBqiwxIFgcotx1RX6Ut0X+znJmCz3t12GhL20WwidVonF77bF8SfE7U08nqTJwtzuIdfweioJKLLoJ4v0euX1us0kYEUEZAbHe89REKIAcobHdn6Ms98ZOrNaAv6CKL+B53zk6W+c14biSJqEQqVrjCQMaRm+DOR1/9CgfyT6UZil/EfyIQnD/W+CskRSi9AtCMYFIT5vWYhDv8LarVlXfM0ENM5vWkFpBAvXLyItZCQtvOZwBRpJTl+FExRB4M+0GFW+L7DMtwMVtqdAkjV/IBM03l9laKFAriWuhscwDZ8vOFZ6+JSKonIsLykpQ1vTQzlXsdpkmFXAyVh3USzfcJHZoeSO2o+lDETzclIBW8FLDwQf9nJLUokZxCBBkJROdAhOP6mxWcPLH/Op7B3xgBqtU1ECINk2hYAQKoUr5xGeC2ArnTD8U1tm/DNZ11HpImuM2hjaRyUAYWjIVJLQt18wY3XYJQ3BWRGMCLpJX8cf6MXc7b8wq2T+iYkTo0K3iHkbdpXas7FiTY2Ubkxc82OtaUB6WuR2/YBmjuEst6WjDFBGfIPyVLfo6shClT9KPhevFGAn/VkwTIq+Ru8RpsGmHqVxQfpG65Zc8gPO9liOWM8iZn1uEsX5ms3/kn2DIeeBo8Ti64+er/gnZT3ZGxSAOucwDdoogCo9VoZnj5z/XXziyYR3bkw
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(136003)(346002)(39860400002)(366004)(396003)(451199021)(54906003)(31686004)(316002)(186003)(8936002)(8676002)(478600001)(66476007)(66556008)(4326008)(6916009)(41300700001)(66946007)(5660300002)(4744005)(2906002)(83380400001)(6486002)(6512007)(86362001)(31696002)(26005)(6506007)(36756003)(2616005)(53546011)(38100700002)(101420200003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZDdySGEwbHZWclkwOUVKUEhLUFVSdlZXaHpPNThBVUJOWVZIMW5qbWpoand2?=
 =?utf-8?B?dTJoL0tlVTBVVEFJTHZwMHFGWTAyQ2Zpd1lNUUxibGE3OElObGpYbTRwV3ZS?=
 =?utf-8?B?M0lDQjdFWjNoVDhkY0JJNFZvUEhLeWFGWlRjZHBpK3AzNHhxdllBWEZjaXRq?=
 =?utf-8?B?bUVNY1IzclVHdmE0b1V2akZvV1N2b1hQRlpsWEJhVlU4R2RUaHZvY2ZaemJJ?=
 =?utf-8?B?ZXNESTFkSFpCQzdFTDhJOWxuRDJJMFdSWDJvckxrVXEzTjUyUkZCcUxIQUlY?=
 =?utf-8?B?TDBITERZb052eDJQbkdoZlpBWXNFSEwvbGk4QndJV2NUcjZ5cDI5c1JQYitt?=
 =?utf-8?B?SjE0K1R0bmJ0Si9lL29EUjFSbXdpM2ZSc25ubG1qVnIxM200eXVYL21xZ0tz?=
 =?utf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id: 99a311cb-ce09-42db-464b-08db8793cf66
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 13:35:11.3504
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Tq4FTmQvZL0+EByThTgR60UgyUYq5wFsRkL8MJ+DPoV5363RzVWPM9LmPSzTmGJztS1RvVRDa97emyXAnagctQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8811

On 18.07.2023 15:23, Simon Gaiser wrote:
> ---
>  xen/arch/x86/acpi/cpu_idle.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

This lacks both S-o-b and a proper description. The latter in
particular because you ...

> --- a/xen/arch/x86/acpi/cpu_idle.c
> +++ b/xen/arch/x86/acpi/cpu_idle.c
> @@ -155,6 +155,12 @@ static void cf_check do_get_hw_residencies(void *arg)
>  
>      switch ( c->x86_model )
>      {
> +    /* Tiger Lake */
> +    case 0x8C:
> +    case 0x8D:
> +    /* Alder Lake */
> +    case 0x97:
> +    case 0x9A:
>      /* 4th generation Intel Core (Haswell) */
>      case 0x45:
>          GET_PC8_RES(hw_res->pc8);
> @@ -185,9 +191,6 @@ static void cf_check do_get_hw_residencies(void *arg)
>      case 0x6C:
>      case 0x7D:
>      case 0x7E:
> -    /* Tiger Lake */
> -    case 0x8C:
> -    case 0x8D:
>      /* Kaby Lake */
>      case 0x8E:
>      case 0x9E:

... don't just add new case labels, but you actually move two. It
wants explaining whether this was outright wrong, or what else
causes the movement.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 13:35:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 13:35:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565264.883274 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkrW-0001iO-K3; Tue, 18 Jul 2023 13:35:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565264.883274; Tue, 18 Jul 2023 13:35:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkrW-0001iH-H4; Tue, 18 Jul 2023 13:35:34 +0000
Received: by outflank-mailman (input) for mailman id 565264;
 Tue, 18 Jul 2023 13:35:32 +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
 <SRS0=Rqcw=DE=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qLkrU-0001eu-NT
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 13:35:32 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f5caca91-256f-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 15:35:29 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-991da766865so793795266b.0
 for <xen-devel@lists.xenproject.org>; Tue, 18 Jul 2023 06:35:29 -0700 (PDT)
Received: from EMEAENGAAD19049. (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 l13-20020a17090615cd00b00993150e5325sm1049075ejd.60.2023.07.18.06.35.28
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 18 Jul 2023 06:35:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f5caca91-256f-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689687328; x=1692279328;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:subject:cc:to:from:date:message-id:from:to
         :cc:subject:date:message-id:reply-to;
        bh=s3Ks21vQ0QD/Q6GX+JHf+tnkI0+MFuZemE5sq0qUotE=;
        b=QoJMATz6yBWruVqSnEibnzWLbzuy9f6Eo+8TZ4YhLuL0uW+eS0hX3cILlFbAOvNg61
         RPP3WbDZanDzZFYz4BRH638z3dIpA/gYjCtWa3dWhpThsAVfQzhgvJzQgzfsnkfm8tep
         +th8DK/QxXs/FhNYcH3ALLVhWtbyyia1Tf+zk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689687328; x=1692279328;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:subject:cc:to:from:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=s3Ks21vQ0QD/Q6GX+JHf+tnkI0+MFuZemE5sq0qUotE=;
        b=cpvzEpq83yu/k0BOIeI40Zxc+B3LZKc1EyDc/RYNP49a+UwqBjV4/TN8WHn6oTLWPN
         0zMK+RBOgmDYwjmbtxW7Kj5DLHCVwX0WHWysRhZnf18wufpQXKK7Tl3/+JKm50LSPzNX
         1Iee+6QOXJN/9T4fxwbDnUEPxeRiCdNRZ4QcsCOYIczVwZNSVArh9gCgTkfdnq/oE231
         sRuprSN7G7lYyPZGJ5q4iYmg8ORvfIwC/jTZTwxYJ4lutsG52NKIvy09eRFT0bsMoVp1
         DqJNXgg7aJu3dA/hcgntAyMGrxXKJnuy0WT23GavaPCMxHny7NrrrQewKsoZtEDkch0F
         eMYA==
X-Gm-Message-State: ABy/qLaqrT7tyL0NJFy6dqj9bQ3jqxDS5fiqfAhBq9q+3wWhoadJsx0m
	RDFvCa3iT+/bnETtwloVbu8dLQ==
X-Google-Smtp-Source: APBJJlGkQAOi7jQ9dASPE0Zg0p0zt8gdNe5MrfCRrN7sbvv8Qfrd7bgP+LsAWmCH/5CwbN+Ubokc+Q==
X-Received: by 2002:a17:907:d0d:b0:988:9b29:5653 with SMTP id gn13-20020a1709070d0d00b009889b295653mr13116302ejc.77.1689687328677;
        Tue, 18 Jul 2023 06:35:28 -0700 (PDT)
Message-ID: <64b69520.170a0220.8de7a.4a1b@mx.google.com>
X-Google-Original-Message-ID: <ZLaVH2yvmivX8cQg@EMEAENGAAD19049.>
Date: Tue, 18 Jul 2023 14:35:27 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 4/8] build: Remove CONFIG_HAS_PDX
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-5-alejandro.vallejo@cloud.com>
 <7e5bd2a4-d810-cc48-cf43-3ad64e501d55@suse.com>
 <c06920d5-763e-a141-cd68-dedcecd33da8@citrix.com>
 <d9cd0bfa-52f9-94a3-0226-aa85d49a58a5@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <d9cd0bfa-52f9-94a3-0226-aa85d49a58a5@suse.com>

On Tue, Jul 18, 2023 at 11:38:14AM +0200, Jan Beulich wrote:
> On 18.07.2023 11:35, Andrew Cooper wrote:
> > On 18/07/2023 10:19 am, Jan Beulich wrote:
> >> On 17.07.2023 18:03, Alejandro Vallejo wrote:
> >>> It's set everywhere and can't be turned off because it's presence is
> >>> assumed in several parts of the codebase. This is an initial patch towards
> >>> adding a more fine-grained CONFIG_HAS_PDX_COMPRESSION that can actually be
> >>> disabled on systems that don't typically benefit from it.
> >>>
> >>> No functional change.
> >>>
> >>> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> >> On its own I don't think this is okay, as it's unclear whether it would
> >> affect RISC-V or PPC in a negative way.
> > 
> > Neither could compile without layering violations of PDX logic in common
> > code, and neither have got that far yet.
> > 
> > Now is an excellent time to be doing this, because it removes work for
> > RISC-V/PPC...
> > 
> >>  If at all, it should only go in
> >> together with the later re-introduction of a CONFIG_*.
I could merge this patch with patch 8. I do feel they tackle different
matters, but when HAS_PDX goes away doesn't matter.

> >> Still I question
> >> whether that new CONFIG_HAS_PDX_COMPRESSION (which imo ought to be
> >> CONFIG_PDX_COMPRESSION)
Sure, I'll change that in v2.

> >> then wouldn't better depend on the arch-selected
> >> HAS_PDX, such that it wouldn't wrongly be offered to choose a value when
> >> compression isn't supported in the first place.
There are several concepts to consider:

  * Frame numbers (mfn)
  * Frame table indices (pdx)
  * Mapping between the 2 (pdx_to_pfn/pfn_to_pdx)

  (I purposefully ignore the directmap. There's a similar argument for it)

An arch opting out of pdx and an arch opting out of pdx compression are in
the exact same situation, except the later has the ability to easily toggle
it back on. Using pdx (_not_ compression) as a first-class type has several
advantages.

  1. It allows common code to deal with pdx too. There are some conversions
     to/from pdx that have to do with arch-specific code calling common
     code or vice-versa. This is particularly bad in the presence of
     compression This is particularly bad in the presence of compression
     because it implies fairly frequent reads of global state.
  2. It allows a port to get pdx-compression for free if it opts into it;
     and more importantly, the ability to toggle it.
  3. Simplifies the compression removal logic. Otherwise #ifdefs need to be
     sprinkled around any architecture that may want to toggle it and
     that's several orders of magnitude more difficult to read.

TL;DR: There is not a benefit in a new port purposefuilly avoiding PDX.
It's just a name for a particular index. It's _compression_ that makes it
have a whacky relationship with mfns and might want toggling.

Incidentally, note that common/numa.c does use PDX.

> > 
> > ... although I do agree that the resulting option shouldn't be user
> > selectable.  It's a property of the architecture, not something a user
> > should be worrying about.
> 
> I disagree. Exotic x86 hardware may or may not want supporting, which
> can only be determined by the build meister, as long as this is indeed
> meant to become a build-time decision (rather than a runtime one; see
> my response to the cover letter of this series).
> 
> Jan
I won't get into x86, because I have never seen such exotic hardware, but
ARM definitely has a lot more heterogeneous system designs where it might
be needed on a system-by-system basis.

Alejandro


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 13:40:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 13:40:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565270.883285 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkw0-0003Tp-4q; Tue, 18 Jul 2023 13:40:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565270.883285; Tue, 18 Jul 2023 13:40:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkw0-0003Ti-1Z; Tue, 18 Jul 2023 13:40:12 +0000
Received: by outflank-mailman (input) for mailman id 565270;
 Tue, 18 Jul 2023 13:40:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Rqcw=DE=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qLkvz-0003Tc-3G
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 13:40:11 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9d3bcc1b-2570-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 15:40:10 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-51e29ede885so8184259a12.3
 for <xen-devel@lists.xenproject.org>; Tue, 18 Jul 2023 06:40:10 -0700 (PDT)
Received: from EMEAENGAAD19049. (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 o6-20020a1709062e8600b009920f18a5f0sm1011317eji.185.2023.07.18.06.40.09
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 18 Jul 2023 06:40:09 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9d3bcc1b-2570-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689687609; x=1692279609;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=t3Pzwf/H01D+13e23r1ClZH4MClNVAtCL1EC6VhI3vg=;
        b=HM7Y2byrdjYoiuHJk4T6rOhZhqK160rlqRWSWzxb4D8FoDLZykO4quKlyUwSxFciTR
         yDBomb1CR7+Q5fBmB2+JMYDtFoecDO5f5l8ch/EmGXPNNx2xWFjQ+SdaFjvZwQgOTypO
         CazbGuvsFuC/t3LJmHSrBn2ylMMdaMqBqkeUo=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689687609; x=1692279609;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=t3Pzwf/H01D+13e23r1ClZH4MClNVAtCL1EC6VhI3vg=;
        b=J95ahYINPTo05iD+vHRvvdVFQ3BIGrss+0hfLY6rmB5xc/Y5IHqJU7vpe4GSGLrayZ
         PVTx4WfloIcnHNaUJvALWOuTkZ3Y42+VPOg/AJnWKJLsDr7zFADe/sNC9ygEVf2FXh2g
         Fsh36NmiweR6Xqwc/IAxWuhilVfp6fOZ9kOtvfKcw7bc/GmmyOXhW9RPlDO0wGKcmoGa
         vm7nxYjd+vuJLq9bCEsRpT2nqFM8BEn3qRBDeBSAEpbzufs9q0B3sPzFaLl4gh90QkX8
         2S9fG2HjudGJNR6QkN9iD+lxPLPg1aEu1qUvnYwVvuWgEuNRDXMbLlMPLjkXtFDHb+Fd
         1IeQ==
X-Gm-Message-State: ABy/qLbpN+hzeqbjjX8+5CvOMEdF9FZ9o/trgGv6+PlQLH3QWOEK9j/H
	YCNEPp68C6yQsb9OtwzPy0n4cw==
X-Google-Smtp-Source: APBJJlH67/xzB0EgoAH+lVGuAgkTUe/uMpZL3APYKq8T45nQUOWjq6T8paz334dSfwzMsxODtvstrw==
X-Received: by 2002:a17:907:3d5:b0:982:8de1:aad9 with SMTP id su21-20020a17090703d500b009828de1aad9mr12303642ejb.64.1689687609616;
        Tue, 18 Jul 2023 06:40:09 -0700 (PDT)
Message-ID: <64b69639.170a0220.5f2ec.42dd@mx.google.com>
X-Google-Original-Message-ID: <ZLaWOOmXiJ629qXY@EMEAENGAAD19049.>
Date: Tue, 18 Jul 2023 14:40:08 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 0/8] Make PDX compression optional
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <7ad1dc72-3b1b-fa7f-8ce4-dd7973c8da93@suse.com>
 <64b68c65.170a0220.b0fe3.40f1@mx.google.com>
 <119404f7-8e6d-a3e0-2d29-d34ab78a6a2d@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <119404f7-8e6d-a3e0-2d29-d34ab78a6a2d@suse.com>

On Tue, Jul 18, 2023 at 03:06:26PM +0200, Jan Beulich wrote:
> On 18.07.2023 14:58, Alejandro Vallejo wrote:
> > I believe the burden of proof is reversed. Features bring complexity, and
> > complexity increases the chances of introducing bugs. It's the presence of
> > a feature that ought to be backed by a proof-of-requirement, not its
> > absence.
> 
> The feature was introduced to support hardware a partner of ours was
> working on at the time. Xen wouldn't have worked very well there
> without these additions. It is beyond my control or knowledge whether
> any such system has ever made it into the public. So at the time of
> its introduction, the need for this code was well justified imo.
> 
> Jan
Oh, of course. I don't question the legitimacy of its introduction at all,
nor do I question the matter of its optional presence. I do question the
default considering the public data we have available.

Alejandro


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 13:42:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 13:42:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565274.883294 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkyA-00045g-Le; Tue, 18 Jul 2023 13:42:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565274.883294; Tue, 18 Jul 2023 13:42:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLkyA-00045Z-Id; Tue, 18 Jul 2023 13:42:26 +0000
Received: by outflank-mailman (input) for mailman id 565274;
 Tue, 18 Jul 2023 13:42:25 +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
 <SRS0=88xE=DE=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qLky9-00045P-6N
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 13:42:25 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on2062e.outbound.protection.outlook.com
 [2a01:111:f400:7d00::62e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id eb86b775-2570-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 15:42:21 +0200 (CEST)
Received: from DUZPR01CA0153.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4bd::6) by AM8PR08MB6354.eurprd08.prod.outlook.com
 (2603:10a6:20b:367::22) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Tue, 18 Jul
 2023 13:42:12 +0000
Received: from DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4bd:cafe::82) by DUZPR01CA0153.outlook.office365.com
 (2603:10a6:10:4bd::6) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33 via Frontend
 Transport; Tue, 18 Jul 2023 13:42:12 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT008.mail.protection.outlook.com (100.127.142.107) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.24 via Frontend Transport; Tue, 18 Jul 2023 13:42:12 +0000
Received: ("Tessian outbound ba2f3d95109c:v145");
 Tue, 18 Jul 2023 13:42:12 +0000
Received: from d4d668943873.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 CE353328-4061-4092-952B-47298B5E631A.1; 
 Tue, 18 Jul 2023 13:42:00 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d4d668943873.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 18 Jul 2023 13:42:00 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com (2603:10a6:208:104::24)
 by GVXPR08MB7678.eurprd08.prod.outlook.com (2603:10a6:150:3e::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 13:41:57 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854]) by AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854%3]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 13:41:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eb86b775-2570-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=i9LnARD1H+0THRDtTWe1Jau08DleXz5nbfWW8rfC+nA=;
 b=C241IYH6qrhvgmLWNTAo9qNd8oZqKuMQuak5405NezPI1FE523aYVYsL4DgkwJVFi9OipsdF9URfrbMYPx2SlWorF80AoI/Qhgxrtl4ybMnnLGzAXVjtP26daJC22Xj5fpAWh67aj62jtpXtO+N6+GiZ2Jv4xBUHVyh3tFZtqII=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 8ea094a56ab8bf2a
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=GI5OfSAUDGy6ch/kOQ8DfTsoJHvUZjHFeFRkWhwDMHwdmRf3Xv0EHtTBqbJ58bSDJD8hTVKd8F1YRI6xCCKeAyQXwy/ji6jOnlsKXuADHqNJFWkEYtAxWvQ0XVVRCkI+/1pxfh0ILeTPXBvprb6p+g5YxptCKfXWKirq72hehwVQnsjO0Gq9jWvLzUIkQOi3wKTIngkPpxGVEzo+3nuYO6I/zeXnO7gFa3DiFBBgCSlVs+WfV6LRQD+m9Whqn4tXNfSXFF1Y+UzmDo+nsHfe9vo6aTNjUAvB82pOGnvDC1OjCbqjXVOpnmFhFcYUjZy22a6fH8CTdJ09ck5hr7RH4g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=i9LnARD1H+0THRDtTWe1Jau08DleXz5nbfWW8rfC+nA=;
 b=NgJ1O5cSqL2DxmfqM/g7Y1FyFpVEfph70QFDWQI/+pq1gKpAhE2DfnMeBKIgjod3wEKHyABlKRhwjNK7ECUOJfrblK83FKq+0gcldQ/6Elvl+5LQ1WamDDcQuJvpMXpB1rIOYDzTXbyIQ1t+OmDfiddZBfhxFGQyo8RwBkQMBg3hY9mJvKgVQ77K1HoYAKKqeQ+Og9lPHo0Px6nO6sW76Yo7jXEeIUpBQdTcUrIgU7yKTEGhvuCwbBPf7PGVrvv5h6iaFETPqThYhe9bMpSuKCh9lZ7tmytVRoXKBx12K887DMYTfPDuMkCNyWIKEccNQX2Btt/euKXO9FjmXSkQDA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=i9LnARD1H+0THRDtTWe1Jau08DleXz5nbfWW8rfC+nA=;
 b=C241IYH6qrhvgmLWNTAo9qNd8oZqKuMQuak5405NezPI1FE523aYVYsL4DgkwJVFi9OipsdF9URfrbMYPx2SlWorF80AoI/Qhgxrtl4ybMnnLGzAXVjtP26daJC22Xj5fpAWh67aj62jtpXtO+N6+GiZ2Jv4xBUHVyh3tFZtqII=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>
Subject: Re: [XEN PATCH v10 18/24] xen/arm: ffa: support sharing memory
Thread-Topic: [XEN PATCH v10 18/24] xen/arm: ffa: support sharing memory
Thread-Index: AQHZuH9ZQoxae0peFECnLnyQIgA236+/ijEA
Date: Tue, 18 Jul 2023 13:41:57 +0000
Message-ID: <CE12BCC6-85E1-4EAB-BBCE-9DB746187B2D@arm.com>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-19-jens.wiklander@linaro.org>
In-Reply-To: <20230717072107.753304-19-jens.wiklander@linaro.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM0PR08MB3778:EE_|GVXPR08MB7678:EE_|DBAEUR03FT008:EE_|AM8PR08MB6354:EE_
X-MS-Office365-Filtering-Correlation-Id: 52060d9a-08bf-42fb-fdcd-08db8794ca5e
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 l9N0d7g7WCxMXxdP01b/PbKMixGmZQ05zf8P99yABYZX0zWm/Gyn7ijecrVL0P3A5ZD+nVkcCE/yyefhhDYbwM29wkfB5Lo87zqpbyZsKLpl9zcOhlo7MjFDVUK8NXz9wY3j5QvqOZWFRgL9V4EvKP8mm/8hAWzMTkt3arz0bgyyWK2u1XUOYZDERBnglauDhRcze1va33zpV1A/ImnVvtXZyH2tM7KW0+Lc7v5yZghgetwm6BjrLOlKNQsAKQ7yXZl3Vq/P517vEU/1IQGVBSIbwunRN+FKtWT5w/99i4zZkb09m284d6MMnEycxMonlqPm30lhnzQyQYXXjCyWgyEP8wMlSQLmkVZk77K0d+iuaLpUNXD2UkOezqgo62HHwMlh4SLMDr9Oehau9GEqVQA5lJ7pdr11c5575Y5Vi84sX6go74jloaVxT+yEnl2r1kgXvzkHJSSQ+xe8f9cy79+ANUZpL3/myIGvBN8QxXibo1E/7dPxGyixAKauxu/X9mM/beYiUMPngSzNXhuUceS7bZPhyLyfLRBpb3CUUiwJcw3dR3GEG1ysDKf1BUo3sYhG1e9pSgAmd3bYQ4X3Nag3Mha4b4SHqCplV2fcfH5cbrXdVI/IQW8bbVw/5OkSAImq4K4O9a9gRkUDBkznSQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB3778.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(136003)(366004)(39860400002)(396003)(451199021)(6486002)(54906003)(91956017)(71200400001)(478600001)(2616005)(83380400001)(33656002)(86362001)(38070700005)(30864003)(2906002)(76116006)(186003)(6506007)(53546011)(6512007)(966005)(38100700002)(122000001)(66476007)(64756008)(66556008)(66446008)(41300700001)(66946007)(4326008)(316002)(6916009)(8676002)(5660300002)(8936002)(36756003)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <48474E768249C74B99079527E1FC9D9F@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB7678
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	79c4072e-0613-4900-1776-08db8794c154
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	WbkRLTVCeBC9HNV8hAOHLkBv8gunSBcR5bMscBVARfM+F936dgzlEZ6WP/8SzwUJI7sxuF2mdEC4NroNHZH5qWwWQm3Ys+OuhQpIXIwjSGVsArbU9od0PQAIm5wPOLUphnNrrZ5UuGUCu1DnZnB1Xfwdk1ES8I6lqPMOaV+qbYRUSqLAhO6KtmC+7g5ePUiWVXD84SsKNQGgDkMX6JwQNJZ08/rSnSTxpXhvs3AeYkdQjo8XchIKPuuchGCYwTV6LPmHnal723aJEttXh9njFwfMonFSOurnPaM3Du8SncyxjDduy36dld4os02wrRO2bIdJ4Pu9m/DTb3o7vVrqb7XmlYLEr7TBjR+pWPFMGBSZDk7OtNRgicU/SQ/lhkv2A7PbvVbmBP72ZHcJHR8iNhoAN+NWHol4GkyVtWzMkFQWcJo8HGvmhWWSe5FhUujwXekvUWw7kbPuzd4avQlAQ+VkGRhpdOktfjKZ6AidaRx2dd875UEhFmnBzT1ENV8zRuhvRtvs7/8ClZ3SMXU46EAIal1yDbIrEIeMhvH+ud62+rReuwYrAcngkXGMBJeT4yDAEXKe2nujVH6zS0M8680xLGhxJNqrZRFSbAI19Yfdx0M/es4kssiLwt/tfmGOo2pxDN5wyvy//XLhqRVlhfABkUGzjGQtoWZkuY1WArKAuOHyzBy7ZhA8hYlgntMo2yTv9cVAO8bzAFdFTrjqP6YPfO5jurLu5QwA/QLj/gs=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(376002)(346002)(136003)(82310400008)(451199021)(36840700001)(40470700004)(46966006)(86362001)(6862004)(316002)(8936002)(5660300002)(8676002)(4326008)(70206006)(70586007)(41300700001)(30864003)(2906002)(478600001)(6486002)(966005)(6512007)(26005)(54906003)(53546011)(6506007)(186003)(336012)(36860700001)(83380400001)(2616005)(47076005)(40480700001)(36756003)(33656002)(40460700003)(81166007)(356005)(82740400003);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 13:42:12.3033
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 52060d9a-08bf-42fb-fdcd-08db8794ca5e
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6354

Hi Jens,

> On 17 Jul 2023, at 09:21, Jens Wiklander <jens.wiklander@linaro.org> wrot=
e:
>=20
> Adds support for a guest to share memory with an SP using FFA_MEM_SHARE.
> Only memory regions small enough to be shared with a single call to
> FFA_MEM_SHARE are supported.
>=20
> With this commit we have a FF-A version 1.1 [1] mediator able to
> communicate with a Secure Partition in secure world using shared memory.
> The secure world must use FF-A version 1.1, but the guest is free to use
> version 1.0 or version 1.1.
>=20
> Adds a check that the SP supports the needed FF-A features
> FFA_MEM_SHARE_64 or FFA_MEM_SHARE_32.
>=20
> [1] https://developer.arm.com/documentation/den0077/latest
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> xen/arch/arm/tee/ffa.c | 486 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 486 insertions(+)
>=20
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> index 03699473cfc5..f3eb84a8e9b7 100644
> --- a/xen/arch/arm/tee/ffa.c
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -297,6 +297,38 @@ struct ffa_mem_transaction_1_1 {
>     uint8_t reserved[12];
> };
>=20
> +/* Calculate offset of struct ffa_mem_access from start of buffer */
> +#define MEM_ACCESS_OFFSET(access_idx) \
> +    ( sizeof(struct ffa_mem_transaction_1_1) + \
> +      ( access_idx ) * sizeof(struct ffa_mem_access) )
> +
> +/* Calculate offset of struct ffa_mem_region from start of buffer */
> +#define REGION_OFFSET(access_count, region_idx) \
> +    ( MEM_ACCESS_OFFSET(access_count) + \
> +      ( region_idx ) * sizeof(struct ffa_mem_region) )
> +
> +/* Calculate offset of struct ffa_address_range from start of buffer */
> +#define ADDR_RANGE_OFFSET(access_count, region_count, range_idx) \
> +    ( REGION_OFFSET(access_count, region_count) + \
> +      ( range_idx ) * sizeof(struct ffa_address_range) )
> +
> +/*
> + * The parts needed from struct ffa_mem_transaction_1_0 or struct
> + * ffa_mem_transaction_1_1, used to provide an abstraction of difference=
 in
> + * data structures between version 1.0 and 1.1. This is just an internal
> + * interface and can be changed without changing any ABI.
> + */
> +struct ffa_mem_transaction_int {
> +    uint16_t sender_id;
> +    uint8_t mem_reg_attr;
> +    uint8_t flags;
> +    uint8_t mem_access_size;
> +    uint8_t mem_access_count;
> +    uint16_t mem_access_offs;
> +    uint64_t handle;
> +    uint64_t tag;
> +};
> +
> /* Endpoint RX/TX descriptor */
> struct ffa_endpoint_rxtx_descriptor_1_0 {
>     uint16_t sender_id;
> @@ -327,9 +359,22 @@ struct ffa_ctx {
>      */
>     uint16_t create_signal_count;
>     bool rx_is_free;
> +    /* Used shared memory objects, struct ffa_shm_mem */
> +    struct list_head shm_list;
> +    /* Number of allocated shared memory object */
> +    unsigned int shm_count;
>     spinlock_t lock;
> };
>=20
> +struct ffa_shm_mem {
> +    struct list_head list;
> +    uint16_t sender_id;
> +    uint16_t ep_id;     /* endpoint, the one lending */
> +    uint64_t handle;    /* FFA_HANDLE_INVALID if not set yet */
> +    unsigned int page_count;
> +    struct page_info *pages[];
> +};
> +
> /* Negotiated FF-A version to use with the SPMC */
> static uint32_t __ro_after_init ffa_version;
>=20
> @@ -351,6 +396,7 @@ static uint16_t subscr_vm_destroyed_count __read_most=
ly;
> static void *ffa_rx __read_mostly;
> static void *ffa_tx __read_mostly;
> static DEFINE_SPINLOCK(ffa_rx_buffer_lock);
> +static DEFINE_SPINLOCK(ffa_tx_buffer_lock);
>=20
> static bool ffa_get_version(uint32_t *vers)
> {
> @@ -457,6 +503,41 @@ static int32_t ffa_rx_release(void)
>     return ffa_simple_call(FFA_RX_RELEASE, 0, 0, 0, 0);
> }
>=20
> +static int32_t ffa_mem_share(uint32_t tot_len, uint32_t frag_len,
> +                             register_t addr, uint32_t pg_count,
> +                             uint64_t *handle)
> +{
> +    struct arm_smccc_1_2_regs arg =3D {
> +        .a0 =3D FFA_MEM_SHARE_64,
> +        .a1 =3D tot_len,
> +        .a2 =3D frag_len,
> +        .a3 =3D addr,
> +        .a4 =3D pg_count,
> +    };
> +    struct arm_smccc_1_2_regs resp;
> +
> +    arm_smccc_1_2_smc(&arg, &resp);
> +
> +    switch ( resp.a0 )
> +    {
> +    case FFA_ERROR:
> +        if ( resp.a2 )
> +            return resp.a2;
> +        else
> +            return FFA_RET_NOT_SUPPORTED;
> +    case FFA_SUCCESS_32:
> +        *handle =3D regpair_to_uint64(resp.a3, resp.a2);
> +        return FFA_RET_OK;
> +    case FFA_MEM_FRAG_RX:
> +        *handle =3D regpair_to_uint64(resp.a2, resp.a1);
> +        if ( resp.a3 > INT32_MAX ) /* Impossible value */
> +            return FFA_RET_ABORTED;
> +        return resp.a3 & INT32_MAX;
> +    default:
> +        return FFA_RET_NOT_SUPPORTED;
> +    }
> +}
> +
> static int32_t ffa_direct_req_send_vm(uint16_t sp_id, uint16_t vm_id,
>                                       uint8_t msg)
> {
> @@ -800,6 +881,403 @@ out:
>              resp.a4 & mask, resp.a5 & mask, resp.a6 & mask, resp.a7 & ma=
sk);
> }
>=20
> +/*
> + * Gets all page and assigns them to the supplied shared memory object. =
If
> + * this function fails then the caller is still expected to call
> + * put_shm_pages() as a cleanup.
> + */
> +static int get_shm_pages(struct domain *d, struct ffa_shm_mem *shm,
> +                         const struct ffa_address_range *range,
> +                         uint32_t range_count, unsigned int start_page_i=
dx,
> +                         unsigned int *last_page_idx)
> +{
> +    unsigned int pg_idx =3D start_page_idx;
> +    gfn_t gfn;
> +    unsigned int n;
> +    unsigned int m;
> +    p2m_type_t t;
> +    uint64_t addr;
> +    uint64_t page_count;
> +
> +    for ( n =3D 0; n < range_count; n++ )
> +    {
> +        page_count =3D read_atomic(&range[n].page_count);
> +        addr =3D read_atomic(&range[n].address);
> +        for ( m =3D 0; m < page_count; m++ )
> +        {
> +            if ( pg_idx >=3D shm->page_count )
> +                return FFA_RET_INVALID_PARAMETERS;
> +
> +            gfn =3D gaddr_to_gfn(addr + m * FFA_PAGE_SIZE);
> +            shm->pages[pg_idx] =3D get_page_from_gfn(d, gfn_x(gfn), &t,
> +   P2M_ALLOC);
> +            if ( !shm->pages[pg_idx] )
> +                return FFA_RET_DENIED;
> +            /* Only normal RW RAM for now */
> +            if ( t !=3D p2m_ram_rw )
> +                return FFA_RET_DENIED;
> +            pg_idx++;
> +        }
> +    }
> +
> +    *last_page_idx =3D pg_idx;
> +
> +    return FFA_RET_OK;
> +}
> +
> +static void put_shm_pages(struct ffa_shm_mem *shm)
> +{
> +    unsigned int n;
> +
> +    for ( n =3D 0; n < shm->page_count && shm->pages[n]; n++ )
> +    {
> +        put_page(shm->pages[n]);
> +        shm->pages[n] =3D NULL;
> +    }
> +}
> +
> +static struct ffa_shm_mem *alloc_ffa_shm_mem(struct ffa_ctx *ctx,
> +                                             unsigned int page_count)
> +{
> +    struct ffa_shm_mem *shm;
> +
> +    if ( page_count >=3D FFA_MAX_SHM_PAGE_COUNT ||
> +         ctx->shm_count >=3D FFA_MAX_SHM_COUNT )
> +        return NULL;
> +
> +    shm =3D xzalloc_flex_struct(struct ffa_shm_mem, pages, page_count);
> +    if ( shm )
> +    {
> +        ctx->shm_count++;
> +        shm->page_count =3D page_count;
> +    }
> +
> +    return shm;
> +}
> +
> +static void free_ffa_shm_mem(struct ffa_ctx *ctx, struct ffa_shm_mem *sh=
m)
> +{
> +    if ( !shm )
> +        return;
> +
> +    ASSERT(ctx->shm_count > 0);
> +    ctx->shm_count--;
> +    put_shm_pages(shm);
> +    xfree(shm);
> +}
> +
> +static void init_range(struct ffa_address_range *addr_range,
> +                       paddr_t pa)
> +{
> +    memset(addr_range, 0, sizeof(*addr_range));
> +    addr_range->address =3D pa;
> +    addr_range->page_count =3D 1;
> +}
> +
> +/*
> + * This function uses the ffa_tx buffer to transmit the memory transacti=
on
> + * descriptor. The function depends ffa_tx_buffer_lock to be used to gua=
rd
> + * the buffer from concurrent use.
> + */
> +static int share_shm(struct ffa_shm_mem *shm)
> +{
> +    const uint32_t max_frag_len =3D FFA_RXTX_PAGE_COUNT * FFA_PAGE_SIZE;
> +    struct ffa_mem_access *mem_access_array;
> +    struct ffa_mem_transaction_1_1 *descr;
> +    struct ffa_address_range *addr_range;
> +    struct ffa_mem_region *region_descr;
> +    const unsigned int region_count =3D 1;
> +    void *buf =3D ffa_tx;
> +    uint32_t frag_len;
> +    uint32_t tot_len;
> +    paddr_t last_pa;
> +    unsigned int n;
> +    paddr_t pa;
> +
> +    ASSERT(spin_is_locked(&ffa_tx_buffer_lock));
> +    ASSERT(shm->page_count);
> +
> +    descr =3D buf;
> +    memset(descr, 0, sizeof(*descr));
> +    descr->sender_id =3D shm->sender_id;
> +    descr->handle =3D shm->handle;
> +    descr->mem_reg_attr =3D FFA_NORMAL_MEM_REG_ATTR;
> +    descr->mem_access_count =3D 1;
> +    descr->mem_access_size =3D sizeof(*mem_access_array);
> +    descr->mem_access_offs =3D MEM_ACCESS_OFFSET(0);
> +
> +    mem_access_array =3D buf + descr->mem_access_offs;
> +    memset(mem_access_array, 0, sizeof(*mem_access_array));
> +    mem_access_array[0].access_perm.endpoint_id =3D shm->ep_id;
> +    mem_access_array[0].access_perm.perm =3D FFA_MEM_ACC_RW;
> +    mem_access_array[0].region_offs =3D REGION_OFFSET(descr->mem_access_=
count, 0);
> +
> +    region_descr =3D buf + mem_access_array[0].region_offs;
> +    memset(region_descr, 0, sizeof(*region_descr));
> +    region_descr->total_page_count =3D shm->page_count;
> +
> +    region_descr->address_range_count =3D 1;
> +    last_pa =3D page_to_maddr(shm->pages[0]);
> +    for ( n =3D 1; n < shm->page_count; last_pa =3D pa, n++ )
> +    {
> +        pa =3D page_to_maddr(shm->pages[n]);
> +        if ( last_pa + FFA_PAGE_SIZE =3D=3D pa )
> +            continue;
> +        region_descr->address_range_count++;
> +    }
> +
> +    tot_len =3D ADDR_RANGE_OFFSET(descr->mem_access_count, region_count,
> +                                region_descr->address_range_count);
> +    if ( tot_len > max_frag_len )
> +        return FFA_RET_NOT_SUPPORTED;
> +
> +    addr_range =3D region_descr->address_range_array;
> +    frag_len =3D ADDR_RANGE_OFFSET(descr->mem_access_count, region_count=
, 1);
> +    last_pa =3D page_to_maddr(shm->pages[0]);
> +    init_range(addr_range, last_pa);
> +    for ( n =3D 1; n < shm->page_count; last_pa =3D pa, n++ )
> +    {
> +        pa =3D page_to_maddr(shm->pages[n]);
> +        if ( last_pa + FFA_PAGE_SIZE =3D=3D pa )
> +        {
> +            addr_range->page_count++;
> +            continue;
> +        }
> +
> +        frag_len +=3D sizeof(*addr_range);
> +        addr_range++;
> +        init_range(addr_range, pa);
> +    }
> +
> +    return ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
> +}
> +
> +static int read_mem_transaction(uint32_t ffa_vers, const void *buf, size=
_t blen,
> +                                struct ffa_mem_transaction_int *trans)
> +{
> +    uint16_t mem_reg_attr;
> +    uint32_t flags;
> +    uint32_t count;
> +    uint32_t offs;
> +    uint32_t size;
> +
> +    if ( ffa_vers >=3D FFA_VERSION_1_1 )
> +    {
> +        const struct ffa_mem_transaction_1_1 *descr;
> +
> +        if ( blen < sizeof(*descr) )
> +            return FFA_RET_INVALID_PARAMETERS;
> +
> +        descr =3D buf;
> +        trans->sender_id =3D descr->sender_id;
> +        mem_reg_attr =3D descr->mem_reg_attr;
> +        flags =3D descr->flags;
> +        trans->handle =3D descr->handle;
> +        trans->tag =3D descr->tag;
> +
> +        count =3D descr->mem_access_count;
> +        size =3D descr->mem_access_size;
> +        offs =3D descr->mem_access_offs;
> +    }
> +    else
> +    {
> +        const struct ffa_mem_transaction_1_0 *descr;
> +
> +        if ( blen < sizeof(*descr) )
> +            return FFA_RET_INVALID_PARAMETERS;
> +
> +        descr =3D buf;
> +        trans->sender_id =3D descr->sender_id;
> +        mem_reg_attr =3D descr->mem_reg_attr;
> +        flags =3D descr->flags;
> +        trans->handle =3D descr->handle;
> +        trans->tag =3D descr->tag;
> +
> +        count =3D descr->mem_access_count;
> +        size =3D sizeof(struct ffa_mem_access);
> +        offs =3D offsetof(struct ffa_mem_transaction_1_0, mem_access_arr=
ay);
> +    }
> +    /*
> +     * Make sure that "descr" which is shared with the guest isn't acces=
sed
> +     * again after this point.
> +     */
> +    barrier();
> +
> +    /*
> +     * We're doing a rough check to see that no information is lost when
> +     * tranfering the values into a struct ffa_mem_transaction_int below=
.
> +     * The fields in struct ffa_mem_transaction_int are wide enough to h=
old
> +     * any valid value so being out of range means that something is wro=
ng.
> +     */
> +    if ( mem_reg_attr > UINT8_MAX || flags > UINT8_MAX || size > UINT8_M=
AX ||
> +        count > UINT8_MAX || offs > UINT16_MAX )
> +        return FFA_RET_INVALID_PARAMETERS;
> +
> +    /* Check that the endpoint memory access descriptor array fits */
> +    if ( size * count + offs > blen )
> +        return FFA_RET_INVALID_PARAMETERS;
> +
> +    trans->mem_reg_attr =3D mem_reg_attr;
> +    trans->flags =3D flags;
> +    trans->mem_access_size =3D size;
> +    trans->mem_access_count =3D count;
> +    trans->mem_access_offs =3D offs;
> +
> +    return 0;
> +}
> +
> +static void handle_mem_share(struct cpu_user_regs *regs)
> +{
> +    uint32_t tot_len =3D get_user_reg(regs, 1);
> +    uint32_t frag_len =3D get_user_reg(regs, 2);
> +    uint64_t addr =3D get_user_reg(regs, 3);
> +    uint32_t page_count =3D get_user_reg(regs, 4);
> +    const struct ffa_mem_region *region_descr;
> +    const struct ffa_mem_access *mem_access;
> +    struct ffa_mem_transaction_int trans;
> +    struct domain *d =3D current->domain;
> +    struct ffa_ctx *ctx =3D d->arch.tee;
> +    struct ffa_shm_mem *shm =3D NULL;
> +    unsigned int last_page_idx =3D 0;
> +    register_t handle_hi =3D 0;
> +    register_t handle_lo =3D 0;
> +    int ret =3D FFA_RET_DENIED;
> +    uint32_t range_count;
> +    uint32_t region_offs;
> +
> +    /*
> +     * We're only accepting memory transaction descriptors via the rx/tx
> +     * buffer.
> +     */
> +    if ( addr )
> +    {
> +        ret =3D FFA_RET_NOT_SUPPORTED;
> +        goto out_set_ret;
> +    }
> +
> +    /* Check that fragment length doesn't exceed total length */
> +    if ( frag_len > tot_len )
> +    {
> +        ret =3D FFA_RET_INVALID_PARAMETERS;
> +        goto out_set_ret;
> +    }
> +
> +    /* We currently only support a single fragment */
> +    if ( frag_len !=3D tot_len )
> +    {
> +        ret =3D FFA_RET_NOT_SUPPORTED;
> +        goto out_set_ret;
> +    }
> +
> +    spin_lock(&ctx->lock);
> +
> +    if ( frag_len > ctx->page_count * FFA_PAGE_SIZE )
> +        goto out_unlock;
> +
> +    ret =3D read_mem_transaction(ctx->guest_vers, ctx->tx, frag_len, &tr=
ans);
> +    if ( ret )
> +        goto out_unlock;
> +
> +    if ( trans.mem_reg_attr !=3D FFA_NORMAL_MEM_REG_ATTR )
> +    {
> +        ret =3D FFA_RET_NOT_SUPPORTED;
> +        goto out_unlock;
> +    }
> +
> +    /* Only supports sharing it with one SP for now */
> +    if ( trans.mem_access_count !=3D 1 )
> +    {
> +        ret =3D FFA_RET_NOT_SUPPORTED;
> +        goto out_unlock;
> +    }
> +
> +    if ( trans.sender_id !=3D get_vm_id(d) )
> +    {
> +        ret =3D FFA_RET_INVALID_PARAMETERS;
> +        goto out_unlock;
> +    }
> +
> +    /* Check that it fits in the supplied data */
> +    if ( trans.mem_access_offs + trans.mem_access_size > frag_len )
> +        goto out_unlock;
> +
> +    mem_access =3D ctx->tx + trans.mem_access_offs;
> +    if ( read_atomic(&mem_access->access_perm.perm) !=3D FFA_MEM_ACC_RW =
)
> +    {
> +        ret =3D FFA_RET_NOT_SUPPORTED;
> +        goto out_unlock;
> +    }
> +
> +    region_offs =3D read_atomic(&mem_access->region_offs);
> +    if ( sizeof(*region_descr) + region_offs > frag_len )
> +    {
> +        ret =3D FFA_RET_NOT_SUPPORTED;
> +        goto out_unlock;
> +    }
> +
> +    region_descr =3D ctx->tx + region_offs;
> +    range_count =3D read_atomic(&region_descr->address_range_count);
> +    page_count =3D read_atomic(&region_descr->total_page_count);
> +
> +    if ( !page_count )
> +    {
> +        ret =3D FFA_RET_INVALID_PARAMETERS;
> +        goto out_unlock;
> +    }
> +
> +    shm =3D alloc_ffa_shm_mem(ctx, page_count);
> +    if ( !shm )
> +    {
> +        ret =3D FFA_RET_NO_MEMORY;
> +        goto out_unlock;
> +    }
> +    shm->sender_id =3D trans.sender_id;
> +    shm->ep_id =3D read_atomic(&mem_access->access_perm.endpoint_id);
> +
> +    /*
> +     * Check that the Composite memory region descriptor fits.
> +     */
> +    if ( sizeof(*region_descr) + region_offs +
> +         range_count * sizeof(struct ffa_address_range) > frag_len )
> +    {
> +        ret =3D FFA_RET_INVALID_PARAMETERS;
> +        goto out;
> +    }
> +
> +    ret =3D get_shm_pages(d, shm, region_descr->address_range_array, ran=
ge_count,
> +                        0, &last_page_idx);
> +    if ( ret )
> +        goto out;
> +    if ( last_page_idx !=3D shm->page_count )
> +    {
> +        ret =3D FFA_RET_INVALID_PARAMETERS;
> +        goto out;
> +    }
> +
> +    /* Note that share_shm() uses our tx buffer */
> +    spin_lock(&ffa_tx_buffer_lock);
> +    ret =3D share_shm(shm);
> +    spin_unlock(&ffa_tx_buffer_lock);
> +    if ( ret )
> +        goto out;
> +
> +    list_add_tail(&shm->list, &ctx->shm_list);
> +
> +    uint64_to_regpair(&handle_hi, &handle_lo, shm->handle);
> +
> +out:
> +    if ( ret )
> +        free_ffa_shm_mem(ctx, shm);
> +out_unlock:
> +    spin_unlock(&ctx->lock);
> +
> +out_set_ret:
> +    if ( ret =3D=3D 0)
> +            set_regs_success(regs, handle_lo, handle_hi);
> +    else
> +            set_regs_error(regs, ret);
> +}
> +
> static bool ffa_handle_call(struct cpu_user_regs *regs)
> {
>     uint32_t fid =3D get_user_reg(regs, 0);
> @@ -857,6 +1335,10 @@ static bool ffa_handle_call(struct cpu_user_regs *r=
egs)
>     case FFA_MSG_SEND_DIRECT_REQ_64:
>         handle_msg_send_direct_req(regs, fid);
>         return true;
> +    case FFA_MEM_SHARE_32:
> +    case FFA_MEM_SHARE_64:
> +        handle_mem_share(regs);
> +        return true;
>=20
>     default:
>         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
> @@ -898,6 +1380,8 @@ static int ffa_domain_init(struct domain *d)
>     }
>     ctx->create_signal_count =3D n;
>=20
> +    INIT_LIST_HEAD(&ctx->shm_list);
> +
>     return 0;
> }
>=20
> @@ -1086,7 +1570,9 @@ static bool ffa_probe(void)
>     if ( !check_mandatory_feature(FFA_PARTITION_INFO_GET) ||
>          !check_mandatory_feature(FFA_RX_RELEASE) ||
>          !check_mandatory_feature(FFA_RXTX_MAP_64) ||
> +         !check_mandatory_feature(FFA_MEM_SHARE_64) ||
>          !check_mandatory_feature(FFA_RXTX_UNMAP) ||
> +         !check_mandatory_feature(FFA_MEM_SHARE_32) ||
>          !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
>         return false;
>=20
> --=20
> 2.34.1
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 13:46:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 13:46:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565278.883304 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLl1x-0004h6-4B; Tue, 18 Jul 2023 13:46:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565278.883304; Tue, 18 Jul 2023 13:46:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLl1x-0004gz-1Q; Tue, 18 Jul 2023 13:46:21 +0000
Received: by outflank-mailman (input) for mailman id 565278;
 Tue, 18 Jul 2023 13:46:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ju50=DE=invisiblethingslab.com=simon@srs-se1.protection.inumbo.net>)
 id 1qLl1v-0004gt-J9
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 13:46:19 +0000
Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com
 [66.111.4.27]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 77d33e74-2571-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 15:46:17 +0200 (CEST)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.nyi.internal (Postfix) with ESMTP id 6275B5C0189;
 Tue, 18 Jul 2023 09:46:16 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute5.internal (MEProxy); Tue, 18 Jul 2023 09:46:16 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 18 Jul 2023 09:46:12 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 77d33e74-2571-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm2; t=
	1689687976; x=1689774376; bh=SlSV5WY5v+5I4D7noJMKg+pWrfdzOuPCv6p
	9EgurUGo=; b=tmxKk6Yx2o6wJr/itlsK2RrZ7+rF6VixdRL60z6nXOxw4UIYGpc
	NDTtT9DySRm5l0kT1MA/lJEinJuiV2/sVNKdcN+Yk200TEl3469xqu6TR3oTO/Mr
	U0u1n0pLGS7a2PA0jYojeWI+K1kuADrId9oQV10CkEudzXC3MVnKVp+KNJ/bGK7K
	JNNjEZ6nDrJEp1Y2zJNjf2VAxeAlzeCl4aaHRCVs8M1xkW+9i6GXIqb0+ARz15/o
	KJE1LsM/KSFcZDsBg53RM5yRnFqtsu+f5qo6QSxgZm+JW9pzjoreKlORLbNJtXxt
	JN9Nvokb+Xv+jRvNZDin7UQwAI5H3FN2MBA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1689687976; x=1689774376; bh=SlSV5WY5v+5I4
	D7noJMKg+pWrfdzOuPCv6p9EgurUGo=; b=q/jEEr6m3X/KxGTaCpLxQXiCWt5Sh
	QOo567IoSNiEs3t2L+pvzDJWNxqHDj/0fJlpWLH/kX+G9VhU4Ub58vPaKJUrgv4x
	jnQqvEtgZAdVMTHSoDVIKJnZVnhy0a42PsOVXDqQ97bF6OH2lyBZ6fpfVISJCWEJ
	zHg4dTAJY80GR2f2yxHCc+VIaA78hqDQbuqiDrxWmF3ZLro+iKFaGgh54iiZr4tA
	r68Li5jj+dl/UAElP9dfismGndyoaLR/Od7SslqTiA9ZoMDqJNZzVAEB0qLcgRuA
	lUZBk2EoDLq9Iij/mK97V9aQ5cWTR0o7b7Zu2478N8t0sqKn58qc/kZ6Q==
X-ME-Sender: <xms:qJe2ZIg5f5PeWQmIrs8DxJW6BJQSMB5WMvvgn9tOzCwa8kDRM-E7vg>
    <xme:qJe2ZBDLMVxo-1hEx4ITlGl6oS-VbiKNSpbxTKnvrDghS6gP_UB6FeutE7BFMfgQ6
    ACN5qOOfLsTT-Q>
X-ME-Received: <xmr:qJe2ZAEuxAe5Bfpain6Y8hTXGlq5jAwXa8xvltqwQFhC5tXU8dmAjcINcMo6TkhFNuA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgeeggdeihecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpefkffgguffvvehfhfgjtgesghdtreertddtjeenucfhrhhomhepufhimhhonhcu
    ifgrihhsvghruceoshhimhhonhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtoh
    hmqeenucggtffrrghtthgvrhhnpeekueffiedtgeffleeglefhledtfefgiedtveeiffeg
    hffgledtveehhfdugfetveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh
    grihhlfhhrohhmpehsihhmohhnsehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtgho
    mh
X-ME-Proxy: <xmx:qJe2ZJToqxua5-kzVXmYCpa4_QPnpn12rH3-OxbwbxL6vzcMD5jo1w>
    <xmx:qJe2ZFzD2jfhZPjHiUh70tae0YT-J9U9mhl1PnneDKkR2v9z4Kduhg>
    <xmx:qJe2ZH5yYLViCAfshlS0nmgP4EJwvfTwC51X0OFhCn4MBHhrr8JaSg>
    <xmx:qJe2ZN9pafxnY9FRh6f99FjAaJvC81_ICVJ3LeFwxr0vUyACOV3qPw>
Feedback-ID: idc5945a3:Fastmail
Message-ID: <2be631d2-95f3-0d7f-ad84-eb9e16d1a39a@invisiblethingslab.com>
Date: Tue, 18 Jul 2023 15:46:05 +0200
MIME-Version: 1.0
Subject: Re: [PATCH 2/4] x86/idle: Get PC{8..10} counters for Tiger and Alder
 Lake
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
References: <20230718132334.2087-1-simon@invisiblethingslab.com>
 <aa23a090-1883-008b-e395-2a3bca709258@suse.com>
From: Simon Gaiser <simon@invisiblethingslab.com>
In-Reply-To: <aa23a090-1883-008b-e395-2a3bca709258@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------31AD7960I2Um0Sv0REX5xkxH"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------31AD7960I2Um0Sv0REX5xkxH
Content-Type: multipart/mixed; boundary="------------6VO490n7npcJWxgrn0QVV4Oo";
 protected-headers="v1"
From: Simon Gaiser <simon@invisiblethingslab.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
Message-ID: <2be631d2-95f3-0d7f-ad84-eb9e16d1a39a@invisiblethingslab.com>
Subject: Re: [PATCH 2/4] x86/idle: Get PC{8..10} counters for Tiger and Alder
 Lake
References: <20230718132334.2087-1-simon@invisiblethingslab.com>
 <aa23a090-1883-008b-e395-2a3bca709258@suse.com>
In-Reply-To: <aa23a090-1883-008b-e395-2a3bca709258@suse.com>

--------------6VO490n7npcJWxgrn0QVV4Oo
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Jan Beulich:
> On 18.07.2023 15:23, Simon Gaiser wrote:
>> ---
>>  xen/arch/x86/acpi/cpu_idle.c | 9 ++++++---
>>  1 file changed, 6 insertions(+), 3 deletions(-)
>=20
> This lacks both S-o-b and a proper description. The latter in
> particular because you ...

Yeah, I also noticed in the meantime, sorry. Will be fixed in v2.

>> --- a/xen/arch/x86/acpi/cpu_idle.c
>> +++ b/xen/arch/x86/acpi/cpu_idle.c
>> @@ -155,6 +155,12 @@ static void cf_check do_get_hw_residencies(void *=
arg)
>> =20
>>      switch ( c->x86_model )
>>      {
>> +    /* Tiger Lake */
>> +    case 0x8C:
>> +    case 0x8D:
>> +    /* Alder Lake */
>> +    case 0x97:
>> +    case 0x9A:
>>      /* 4th generation Intel Core (Haswell) */
>>      case 0x45:
>>          GET_PC8_RES(hw_res->pc8);
>> @@ -185,9 +191,6 @@ static void cf_check do_get_hw_residencies(void *a=
rg)
>>      case 0x6C:
>>      case 0x7D:
>>      case 0x7E:
>> -    /* Tiger Lake */
>> -    case 0x8C:
>> -    case 0x8D:
>>      /* Kaby Lake */
>>      case 0x8E:
>>      case 0x9E:
>=20
> ... don't just add new case labels, but you actually move two. It
> wants explaining whether this was outright wrong, or what else
> causes the movement.

Yes, as the commit message says it get those PC{8..10} counters for
Tiger and Alder Lake. The former already had a label, therefore the
move. I assume that when Tiger Lake was added it was an oversight to not
also read those package C-state counters. I can add that to the commit
messages.

--------------6VO490n7npcJWxgrn0QVV4Oo--

--------------31AD7960I2Um0Sv0REX5xkxH
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE3E8ezGzG3N1CTQ//kO9xfO/xly8FAmS2l58ACgkQkO9xfO/x
ly+IwRAAiz9ysj/AKsnDS6y+Vx42VnCY1LHSPTZTQ/rHLrwA8e/n/xlqquCIbccp
ctjoajqKhKlaW9tNru4aeWwGbxmhqM2Vura4XGb+BFBLSipeUPHsxBkop4mZjSWc
stKd4yiikWZOU6+HczeOU8oX90abNV0pAM1K+AuNW4RlBte9lJ8E3g7rcqtGzaak
4Fz/KUxzUa1d5wmP4OhdCIqrZG/OASOKzTQ/26N8JE0rsJW+YYPHxEd/Ous6Rbg3
YfYi1/Jp9oDE7glUv+UnFas5eBFXy4tDzA2qNuR5tP99RbzETGCC9S2XHtpncGiA
n6FinK+05p9bYzNIk6Lx0zuewqsconOa8YKHELJYVBm/B425FUVAWSrmpU2JSKtU
vedUB5MfMWSyo8N0C3XyLt56f3DX0DJwwaKoS3ZXVZ3wOMZx4vyv9qoO/IR5psxK
Y+p/ayy4gQ4k8+NMTeBohrjX9A5lgUUrIiGrxvanFWf86+G6ey9jdR7UstV1H6Oq
iO6jQIxgk4sj+U5BSHRX2KDPvT7VjKHTFAjKSXQW1GNfgykq3ihVl+h13JNRD5Bi
aL+VKJPfRt9fvJxq3D80imZ0vQyLQIPJovpATleGwr/ZLPGGut1lU0DYocHdyX6E
uAGVWla6l03ltcjo2bo3fhgFgGy55DB9yluqw+96m0pmTj+ZbYc=
=VdJV
-----END PGP SIGNATURE-----

--------------31AD7960I2Um0Sv0REX5xkxH--


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 13:48:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 13:48:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565285.883315 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLl3m-0005TN-Iz; Tue, 18 Jul 2023 13:48:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565285.883315; Tue, 18 Jul 2023 13:48:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLl3m-0005TG-Ff; Tue, 18 Jul 2023 13:48:14 +0000
Received: by outflank-mailman (input) for mailman id 565285;
 Tue, 18 Jul 2023 13:48:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4bXZ=DE=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qLl3l-0005TA-O1
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 13:48:13 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bce056fc-2571-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 15:48:12 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.161.123.45])
 by support.bugseng.com (Postfix) with ESMTPSA id C6C334EE0C88;
 Tue, 18 Jul 2023 15:48:10 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bce056fc-2571-11ee-b23a-6b7b168915f2
Message-ID: <c6d56050-e9f7-3530-02d6-440c337dbdad@bugseng.com>
Date: Tue, 18 Jul 2023 15:48:09 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 "xenia.ragiadakou@amd.com" <xenia.ragiadakou@amd.com>,
 "ayan.kumar.halder@amd.com" <ayan.kumar.halder@amd.com>,
 "consulting@bugseng.com" <consulting@bugseng.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Luca Fancellu <Luca.Fancellu@arm.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
 <CB1B8DB0-7708-454D-9E73-171CA894E304@arm.com>
 <f24d12ec-3edc-5aea-f399-05ed52ec1cbc@suse.com>
 <3356b44e-a596-8cff-afd9-66bbcca53b30@bugseng.com>
 <996e3d7d-96db-2f3d-8f4e-0805a2c60a6f@suse.com>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <996e3d7d-96db-2f3d-8f4e-0805a2c60a6f@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 17/07/23 17:46, Jan Beulich wrote:
> On 17.07.2023 17:28, Nicola Vetrini wrote:
>>
>>
>> On 17/07/23 15:59, Jan Beulich wrote:
>>> On 14.07.2023 16:20, Luca Fancellu wrote:
>>>>
>>>>
>>>>> On 14 Jul 2023, at 12:49, Nicola Vetrini <nicola.vetrini@bugseng.com> wrote:
>>>>>
>>>>> The macro 'testop' expands to a function that declares the local
>>>>> variable 'oldbit', which is written before being set, but is such a
>>>>> way that is not amenable to automatic checking.
>>>>>
>>>>> Therefore, a deviation comment, is introduced to document this situation.
>>>>>
>>>>> A similar reasoning applies to macro 'guest_testop'.
>>>>>
>>>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>>>> ---
>>>>> docs/misra/safe.json                     | 16 ++++++++++++++++
>>>>> xen/arch/arm/arm64/lib/bitops.c          |  3 +++
>>>>> xen/arch/arm/include/asm/guest_atomics.h |  3 +++
>>>>> 3 files changed, 22 insertions(+)
>>>>>
>>>>> diff --git a/docs/misra/safe.json b/docs/misra/safe.json
>>>>> index 244001f5be..4cf7cbf57b 100644
>>>>> --- a/docs/misra/safe.json
>>>>> +++ b/docs/misra/safe.json
>>>>> @@ -20,6 +20,22 @@
>>>>>           },
>>>>>           {
>>>>>               "id": "SAF-2-safe",
>>>>> +            "analyser": {
>>>>> +                "eclair": "MC3R1.R9.1"
>>>>> +            },
>>>>> +            "name": "Rule 9.1: initializer not needed",
>>>>> +            "text": "The following local variables are possibly subject to being read before being written, but code inspection ensured that the control flow in the construct where they appear ensures that no such event may happen."
>>>>> +        },
>>>>> +        {
>>>>> +            "id": "SAF-3-safe",
>>>>> +            "analyser": {
>>>>> +                "eclair": "MC3R1.R9.1"
>>>>> +            },
>>>>> +            "name": "Rule 9.1: initializer not needed",
>>>>> +            "text": "The following local variables are possibly subject to being read before being written, but code inspection ensured that the control flow in the construct where they appear ensures that no such event may happen."
>>>>> +        },
>>>>
>>>> Since the rule and the justification are the same, you can declare only once and use the same tag on top of the offending lines, so /* SAF-2-safe MC3R1.R9.1 */,
>>>
>>> +1
>>>
>>> I'm puzzled by the wording vs comment placement though: The comments
>>> are inserted ahead of the macro invocations, so there are no "following
>>> local variables". Plus does this imply the comment would suppress the
>>> checking on _all_ of them, rather than just the one that was confirmed
>>> to be safe? What if another new one was added, that actually introduces
>>> a problem?
>>>
>>>> also, I remember some maintainers not happy about the misra rule being put after the tag, now I donâ€™t recall who
>>>
>>> Me, at least. The annotations should be tool-agnostic imo, or else the
>>> more tools we use, the longer these comments might get.
>>
>> No problem for both: Given the earlier remarks by Julien on patch 1/4, I
>> think we can devise something along the lines of
>>
>> /* SAF-x-safe MISRA:C 2012 Rule 9.1 <Justification> */
>> int var;
>>
>> and then write a generic justification in docs/misra/safe.json, while
>> <Justification> contains a specific one (e.g., this loop does so and so
>> to ensure that no access to unset variables happens).
> 
> But that still mentions the rule. What if a new MISRA:C 2025 appears,
> with different rule numbers? I don't mind the comment mentioning, in
> a sufficiently terse way, what problem is circumvented. But I don't
> think tools or specifications should be referenced here. That's the
> purpose of the referenced "database" entry.
> 
> Jan

Ok

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 14:04:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 14:04:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565293.883325 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLlJY-00086W-SS; Tue, 18 Jul 2023 14:04:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565293.883325; Tue, 18 Jul 2023 14:04:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLlJY-00086P-PY; Tue, 18 Jul 2023 14:04:32 +0000
Received: by outflank-mailman (input) for mailman id 565293;
 Tue, 18 Jul 2023 14:04:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLlJX-00086J-4d
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 14:04:31 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0608.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::608])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 02b08f3c-2574-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 16:04:29 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8111.eurprd04.prod.outlook.com (2603:10a6:102:1c7::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 14:04:26 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 14:04:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 02b08f3c-2574-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hK27GhChaj5iEhVvr10kuQ7KrK2Lnpn3xn2DGa5xttbB61OzDmVSMUGVESk5rA588g1tpsYcGzOdw46ddN5sINtSqfL+vzrUYIGWVwVRXStyP6Mg8e4gCKtikq2ABqQii/30gaafRtnIbfQXp/obT1sI3vRzWrOSiZVaUsD7QxQtbqNhoOo/f+Bvd9SCp1shGOgXHV1OANMEhBkTw0Foty6VevOqKIO7s+yixknrr3A3lhSyc9K4tyEw9ioWGZp8/rl8+7/1vjLHbiSY/VjAJyDIsfoAvrVgjk4urE13qW4i/KeGHrhub57+gCEJJnth1H7ATp5RpTaZRPNS6AOsow==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+25IvNh56WZG8jpnz8opXrTMLKi925FBHoqVUdLjewc=;
 b=QdZXU9kD2dTtkXKK4D6wcEszG9r4EogY5VCFF2xSHwm9886QD/w1mLZoF/MonFqBkCxR52yjYgaMTQ2PxmEidmkQef6PGpL0mNtelen5SIN0OUPro/5h19KQ9e0DpKBC4tBhpub5qSus9nW50u01xxULr35WKSiFc+B9AWpQIBOKV59h7w32k774jPQJ85F2EJ9lCcYT/fpoAVkt80nNYXvDtSNol9cvTmf+Ww9SsfzujFnk+rlZyJVzWQ3UQ1UZEu8pktOpwyEVDwVv1cfd2G0kvoWkFIfd8nkb70P+d7WLyUZxlYMP33bmv9fNl9c3kA2qgJA16X75YtskjIXM9g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+25IvNh56WZG8jpnz8opXrTMLKi925FBHoqVUdLjewc=;
 b=y9z4kj5c/8NkQEpjXBdJ+32/rUm8SjOssYomcYryLKNhnKHEVb9h1J+Fi0uQIDoEkgfr0ZyJb39VXDb1UR7YvDBHXhNrWle9ou3NF2bQ2jnzgXtmWF8Cdep2JaVD5WujwkB1EDAL3hFDYJrQXTWhyDVd9cIVoh7NCjFlFBwBhRSQn7v+eX4XY1sMKK2Bt0W1eU+AxPmZqA5bz67y5e4P8VFnctKNoXgqGVh2E17xBF0/MI3NoyKpHGKnJ2CiNEBSGiexq5fJ/99tnd6zbMa1yvY54eR3S2m5C3Nep0jPahFPIWCV3xCZOk+T0KCuzYUXFeatOoC4F3rU+U0iX1B+iA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <b6365b9d-47a1-8ab4-37eb-0b821257dbd2@suse.com>
Date: Tue, 18 Jul 2023 16:04:24 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 2/4] x86/idle: Get PC{8..10} counters for Tiger and Alder
 Lake
Content-Language: en-US
To: Simon Gaiser <simon@invisiblethingslab.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
References: <20230718132334.2087-1-simon@invisiblethingslab.com>
 <aa23a090-1883-008b-e395-2a3bca709258@suse.com>
 <2be631d2-95f3-0d7f-ad84-eb9e16d1a39a@invisiblethingslab.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <2be631d2-95f3-0d7f-ad84-eb9e16d1a39a@invisiblethingslab.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0014.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:15::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8111:EE_
X-MS-Office365-Filtering-Correlation-Id: cd878663-64d4-40cc-ec9a-08db8797e547
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	MPoj8Y9h5/ugCVkH5zjiXgym88vQYNa9pDSwB+Q8ARIP5K7kJS8+usxn6QmngnYPgv2YLS4QCuiMhiYim2M4Z0QF0YpHb1Jsn+BGMI9lAauWvl184IFzomrwSDkRS9LIQLRyahGf9FrxG3atYHuRkVDEQulSU1Rn+H1/YOe8vUaaSAujpuzjFQEDYF2FSMEb8lh6fBkdE6qPJmETuU3FzT6rCXVTOrbhPldyQgc6uophlVppOUyA282zAPV/yUy8eko4Di+MbLrUIFIo6RfbqPl7zCpNYr1UhUASlgtCq2qlnrNtRsBFTnI4S8rbdcutG2b6CwjqCc1UZFSZRVHbh2jUoWFVwlsL16u2QdETNgBBN87x7deM1izDdau+t7Vt+f+U6OVk91UrsNeJmLb3SYd+vKs3uklkqzLcBWkhOZXWeTl43ldoq6lmWAQNaCp58EoU+U5htBcebnvhopAXpTcP69mxb0PuCpAuycDZmFJ9i1Jpl/4FdO/wonlKHxUAf+jEZYmpjc4l7obtdd9UfkT5Pc32djZYfGJDbbcs1sqQ124V3kM/BX6SPNkxUsy6BZwgpne7tKYsrF2YhvR+5gEKOHGXFJxOgnJINl3R8kd7E6UK21s4u0XdhJLmzWOx6vgxuOFC2W/ZIZO6ndVDk0URIBoYuE53x+xGR+IX2nwCbzwXEuG7MAqSS2gs1PDr
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(376002)(39860400002)(396003)(366004)(346002)(451199021)(6486002)(53546011)(26005)(6506007)(38100700002)(36756003)(86362001)(2616005)(83380400001)(31696002)(186003)(6512007)(54906003)(8676002)(8936002)(2906002)(41300700001)(478600001)(4326008)(316002)(6916009)(66476007)(5660300002)(66946007)(66556008)(31686004)(101420200003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZFpGb1pyM2pTMXpmU1lTbVd5VU1UQm9UUXVzb0Y2ZDZDQXRoVUVTZkxRQ3Vz?=
 =?utf-8?B?c1NBcVVRcG9lNldsUHdWbE9mY3VDaFJiNXpuY0Fqa3IyTkdrNHpkanRXMERm?=
 =?utf-8?B?WGtHRjBiYmdNV1RlWkdrWWdXcUpPbTkzdmRMVk5JVTdCNk5TMzBZM2lYYUNL?=
 =?utf-8?B?Vjh5RVIzSU03K3llamNVOENWNENpQWYyUnNkVzB6aU9UaENMV21IczJnVW52?=
 =?utf-8?B?ZmJXTzQ3dnhCNE5GN3FsNDZ2SEYzQTdNWDdJenVZdklPUlBIMHFzMkd6TnlJ?=
 =?utf-8?B?RWV1V1NPVW9ja2pCYnYzcUkrSWFCT3M4NFROZ0hKUmt6Vi9yNjFJMnBOWWlH?=
 =?utf-8?B?MWVkVE9VRk9vYWhZYkFzR0l3TUFzTjY0eWE0Wkw5bkRLYTdXSS9NYUhQV0NS?=
 =?utf-8?B?N0Y5R092UW92MTBLczBXV0NSWGV4Z3VQTzJRd2d1dHF4MDZ3ZHZCNmlwQTJv?=
 =?utf-8?B?aU9kUkdEcTArK1h0R2VlU01DQkdjTDc5ZE8wMWhjcXNNUUtyV05YaC9laWhV?=
 =?utf-8?B?TVJxQXFTcTBBTWgzbFdCMUpXK2VRT09Cc1pheW13cU8rYmdnTGlxcmN5WTg3?=
 =?utf-8?B?LzZEaVdyMEN0QkhYZFBiVGJHU1lSRFIxcm9tRFI0b3JUOE9hNHpWZFdCT24v?=
 =?utf-8?B?OX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dxTGxSL2tsVUtnNUE3VytNeEovb2pC?=
 =?utf-8?B?Z1BuMDFXOU5MT0dVZlJMMWFxSmphTlNmd0NjeVpXK1VJKzBtL1pKN2NINXVC?=
 =?utf-8?B?MG4zT2VZMlJ0SGhFRnhmcXg2c1gxS3NQZ0tobXBZZDNOakw2ZDJTMWNRdkVx?=
 =?utf-8?B?K2JRM1JEb05VaEx2ZlU1NlA5MG93WlVpbHgrQlNEMVhQVHh1ZlYyVjdvLzhh?=
 =?utf-8?B?dzNnajIrd01yWjFqVlFMSDFtZURwbExVV2E1OVVqeUFGUlBLbVlzeHhHaE1Z?=
 =?utf-8?B?VDBtUGZodzhrWnBvMTdsQVB4eWVDUVMrOXpRL2lBa0hYMW05N09zRlVPL1Y2?=
 =?utf-8?B?dWh1RG9LTjg1dk4zbUtBVEtseXRnNHoySS9Ua1c1empWQUYwMG9ZazBhOWdj?=
 =?utf-8?B?NEJNWk4rNTV4eTNvdWUwbFZBZXdGUDZNRXVMOUxIOEFLS3JTNy92VnpQc0N6?=
 =?utf-8?B?NHRRd2tIYUdmZmV6dDZ6U3dNVVdPUFExK3R6b3pkMEdJYUtrSGovRThrQnN0?=
 =?utf-8?B?M1ZRZjg2V0dvNHlMZFc4MTI4bnhZaElXYzhyenoxblZ4dkFHaEhrVVU1dXBy?=
 =?utf-8?Q?eSTCB/CBlseKEHKV0cIRgqdwZ?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: cd878663-64d4-40cc-ec9a-08db8797e547
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 14:04:26.0874
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: nUYdgWQ3QizC7/E3NYQcPmc/MchpukZA/HxSOmFHdf0MPFsTyYCbCXtYWFuxyaXih4UnFsDN9uj+BzOLcc2OhA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8111

On 18.07.2023 15:46, Simon Gaiser wrote:
> Jan Beulich:
>> On 18.07.2023 15:23, Simon Gaiser wrote:
>>> ---
>>>  xen/arch/x86/acpi/cpu_idle.c | 9 ++++++---
>>>  1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> This lacks both S-o-b and a proper description. The latter in
>> particular because you ...
> 
> Yeah, I also noticed in the meantime, sorry. Will be fixed in v2.
> 
>>> --- a/xen/arch/x86/acpi/cpu_idle.c
>>> +++ b/xen/arch/x86/acpi/cpu_idle.c
>>> @@ -155,6 +155,12 @@ static void cf_check do_get_hw_residencies(void *arg)
>>>  
>>>      switch ( c->x86_model )
>>>      {
>>> +    /* Tiger Lake */
>>> +    case 0x8C:
>>> +    case 0x8D:
>>> +    /* Alder Lake */
>>> +    case 0x97:
>>> +    case 0x9A:
>>>      /* 4th generation Intel Core (Haswell) */
>>>      case 0x45:
>>>          GET_PC8_RES(hw_res->pc8);
>>> @@ -185,9 +191,6 @@ static void cf_check do_get_hw_residencies(void *arg)
>>>      case 0x6C:
>>>      case 0x7D:
>>>      case 0x7E:
>>> -    /* Tiger Lake */
>>> -    case 0x8C:
>>> -    case 0x8D:
>>>      /* Kaby Lake */
>>>      case 0x8E:
>>>      case 0x9E:
>>
>> ... don't just add new case labels, but you actually move two. It
>> wants explaining whether this was outright wrong, or what else
>> causes the movement.
> 
> Yes, as the commit message says it get those PC{8..10} counters for
> Tiger and Alder Lake.

But that's the problem - there was no commit message.

> The former already had a label, therefore the
> move. I assume that when Tiger Lake was added it was an oversight to not
> also read those package C-state counters.

Or the SDM wasn't clear, and we needed to err on the safe side.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 14:09:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 14:09:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565304.883335 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLlOJ-0000SJ-D1; Tue, 18 Jul 2023 14:09:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565304.883335; Tue, 18 Jul 2023 14:09:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLlOJ-0000SC-A1; Tue, 18 Jul 2023 14:09:27 +0000
Received: by outflank-mailman (input) for mailman id 565304;
 Tue, 18 Jul 2023 14:09:25 +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 <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLlOH-0000S6-Rp
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 14:09:25 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20624.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::624])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b270a718-2574-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 16:09:23 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBAPR04MB7366.eurprd04.prod.outlook.com (2603:10a6:10:1a0::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Tue, 18 Jul
 2023 14:09:22 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 14:09:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b270a718-2574-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=dNQITBep78S0M7QdZBQcg0qaGGLpuz7cqGKYPHuRZ4qb8tlClGToygNn2P72E/R3WithAsdJ7UfawU3YSNgCTLRINTmLYTXY7WAHeqVjix9vr9r/hNfGdXkiSe9X6tn1IHD2iVqmLdx9iFc003v/4WVB2gzxjUlcWeE39YoAeU/WoBpqRdikWb3b9Bs+VmpoO8XSXtjJbzZXqAQ0cHix1ZRBJuXd+IxqxImpKsu6omQhjNKybaXEJlbvSIOf7sXH+TW81WUU+pDACxaVmvJMeF0j7KAOfsB3a3cu+LSzSkTPvt3ewJvyMnZWRNovTMr+M0d2+g7bilmG/Xuz1HmpSA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=N4hh92Sg4gGQ0/L6cznxSDdrRp6l1w8e9FyzrkBObjY=;
 b=W3BTrIyko4tYQ+IPXDVsnmFvno56jA4cJhd49NpZIRoIkMih73hhyA0sEt4IWJyEncYQ9IMdiPqOq5gbAGA1rVl/mRVR3HOZleyvkedFsvdXyjODONR1PVBkM+V03qtnNYSRPCkUCuUosZNRJe3bX87q67f3JZ7/J1HiFjfRB6MkJQ2mx9WbTSt+7mc4obLFB0b3PVwQQG3S2jv7xZ3XAYb+DEcbioIp5oWek1roQI6ihGLPkjdr9EH+G3Dxn5nYFFYH3+otO7lho3j2T2x/R3P/zcAuCszB3/74U9nvEPLEkT4T9+Byg7CrivwtG32rm7L/Ms6hhL79NsMIsg9chw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=N4hh92Sg4gGQ0/L6cznxSDdrRp6l1w8e9FyzrkBObjY=;
 b=cWVOD0J5WLlcQUxpq1JBYKKSN613BiwSYq/WnAkg1sU5mDUHJMqO8pkgE6dKsk7s7OTMsLSYKjOWF2AdWrulm/55isQen6/CJs5aebnpr9XCF7jhlcI4NoJoiOsCkHjElNkiHZRJ1vQZrk9sHUNlTLbFmTX6x6OJjKaNQpLRZIz4E9zu7W4k1j5Z6XEs56kGWGs3LXmSLGIN3jJtNmk4WpuycCMpnMq2NaHuGMQ2acCbW6fL2Iz2mXNJ3kVtl4gCTvFMfqSLxf2v5mF1ceoCmG4XovT2nLmHz7EeO9B1huCrGCNlREWPTufs8Zs2Tmwks4SKGUPQOl9LRFC3Iod1SQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <7ba24ac4-1f20-906c-8e38-6a8b040af35a@suse.com>
Date: Tue, 18 Jul 2023 16:09:19 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 0.5/3] build: make cc-option properly deal with
 unrecognized sub-options
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Anthony Perard <anthony.perard@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
References: <0b45bc88-fe5f-77f1-9f9c-37d9ea1ec73c@suse.com>
 <fe4c01c0-91cd-a303-71e9-96a81e46ddff@suse.com>
In-Reply-To: <fe4c01c0-91cd-a303-71e9-96a81e46ddff@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0247.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:af::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBAPR04MB7366:EE_
X-MS-Office365-Filtering-Correlation-Id: 0042eec8-db12-4e2e-42d6-08db879895ab
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	V9qrGu0ZEFJRmdpGZifyurH2f9i2x4qstp3oOiciQ+dBtof53VFFxwyF2g+f8xt3bwr06dh//8S8I7ZEFti1tbM5dJk693lrhXt5hkRM8EQfk7Mp2Q6CgHViyoQBRhh17+q+mpNsGA5mqVSNrV0I+MY+P2abS2nVcPaQsEVshrTHIIyz8ltewYp5h0BdKihaTVBkNIS1a2lrzB1cWPWoFKkHe72gjIqeezofXHYO2Jo84jIhGO++sxEJmdFoTKZj2fPqvdZTxHPog/SkmuByisNNfoltbObEl7cpktWyVuHpA8wdXVw20SmAt+rObX7iZkIz3bd8BMAcmWQ1dTY4u74CzjxkzHRavrSCW4KhpMV3tVkvWnQMQ1yaBaj4xmlmHJXMJgvYw7zKViz3P+4C6SeV9qAGq2qH4IkjlbyY3MRbyULWUTbtpqISywn3PJ9wu5p0UMxqCYtBKtzKzZGkq7vy/qowDAvrhrIZ7OpFmImkh7Z4k1laDYgTV/BFnu0LDkO7/YTA/z4QClohGtJAJYdFU9A1lfEgoIBhUS5UNrKxoJ8NJKrjB7onF37PoxVLP126vpYnajzulUFFAHziHVTIcKvdWfS7+6X4HgW+Cxla3XAd8FaDH54lIAV3CUpqRpvk9Utctmde/K/6Jbfk+A==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(39860400002)(136003)(346002)(396003)(451199021)(2906002)(8676002)(8936002)(5660300002)(41300700001)(36756003)(86362001)(31696002)(6512007)(6506007)(26005)(53546011)(478600001)(6666004)(6486002)(83380400001)(186003)(31686004)(2616005)(6916009)(4326008)(316002)(54906003)(38100700002)(66476007)(66556008)(66946007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VC9uaUh6blREcm0yL2ZDWi9QcU9hVkNKdnFLbjRORFdlcnVoOXRnd0FpUFBl?=
 =?utf-8?B?U3QyaTNmc0dWVHFIT1dJOU5nNDZFL0lIUkZ3dXAxSW9JUjNqWXhvbko0NjZp?=
 =?utf-8?B?cEdYS1pzTUpZZmdDTzFNY24wYXk5ai9Nbm5wZTBhRWE3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QV09aWVhyUHlmRzk4VWNHa25DeWQrZVYrcUZuaWhN?=
 =?utf-8?B?emF3alhIQmR0Ry9tM3RxUVJOSTNrcndEb0xiR01kRnhiZEpkaHRhQWp6SW1z?=
 =?utf-8?B?djY5emRGRUwvYUVWdDYrazR1V0s0SmVWcFlYcURqTFNlVEx3dzlCZ3Y5WTR3?=
 =?utf-8?B?SHpBVDVwZVdKeDJlOGU0aGQxMXBybTBCbU9aVHRGNG1xNkY0RjFXcUVDQTFR?=
 =?utf-8?Q?pUdiJ0rqDbJHvd6mYd1rVW362?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0042eec8-db12-4e2e-42d6-08db879895ab
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 14:09:22.0232
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ev3BuJIxHtYrw/5Tws20ME1frgUGlVxKvXB+CldFwv59V8o+nZ9UAGQV3VxXTEHKAv8WPlyhYm80QiEVWm73Jw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7366

On 12.07.2023 16:26, Jan Beulich wrote:
> --- a/Config.mk
> +++ b/Config.mk
> @@ -90,9 +90,14 @@ PYTHON_PREFIX_ARG ?= --prefix="$(prefix)
>  # of which would indicate an "unrecognized command-line option" warning/error.
>  #
>  # Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
> -cc-option = $(shell if test -z "`echo 'void*p=1;' | \
> -              $(1) $(2) -c -o /dev/null -x c - 2>&1 | grep -- $(2:-Wa$(comma)%=%) -`"; \
> -              then echo "$(2)"; else echo "$(3)"; fi ;)
> +cc-option = $(shell pat='$(2:-Wa$(comma)%=%)'; \
> +                    opt="$${pat%%=*}" arg="$${pat\#*=}"; \
> +                    if test -z "`echo 'void*p=1;' | \
> +                                 $(1) $(2) -c -o /dev/null -x c - 2>&1 | \
> +                                 grep -e "$$pat" -e "$$arg.*$$opt" -e "$$opt.*$$arg" -`"; \

Sigh. At least some versions of Clang (I'm looking at 7.0.1 right now)
don't quote "-march" in their resulting error message. So I guess all
we can do (without finding a different approach to the checking
altogether) is further relax the grep pattern, to

grep -e "$$pat" -e "$$opt" -e "$$arg" -

Of course this has the increasing risk of getting false positives (i.e.
false negatives for the overall check result).

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 14:14:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 14:14:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565308.883345 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLlSg-0001sI-Tu; Tue, 18 Jul 2023 14:13:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565308.883345; Tue, 18 Jul 2023 14:13:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLlSg-0001sB-QV; Tue, 18 Jul 2023 14:13:58 +0000
Received: by outflank-mailman (input) for mailman id 565308;
 Tue, 18 Jul 2023 14:13: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
 <SRS0=CPt9=DE=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qLlSf-0001s5-Ur
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 14:13:58 +0000
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com
 [2a00:1450:4864:20::134])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 54ba327d-2575-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 16:13:55 +0200 (CEST)
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-4f9fdb0ef35so9665042e87.0
 for <xen-devel@lists.xenproject.org>; Tue, 18 Jul 2023 07:13:55 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 t17-20020ac243b1000000b004faeedbb29dsm461074lfl.64.2023.07.18.07.13.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 18 Jul 2023 07:13:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 54ba327d-2575-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689689635; x=1692281635;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=GrQtZY4wGpbZs2f3zzM1/MVBvwz1MdPu48AEb1m6RVU=;
        b=WBldF0E685DoQ5slsfK2KeYTdKm3d+N25vxLDFeTVZk6sgLEDTDGAKBlF39UlMvwFL
         sm6c+a5vl3sKks8/C28pZZA9UvJnr7Ot9WCnByGy4is67Z97L8hZYaVeU2Pupwc64zhQ
         /DE5iBsQWktsMEjok2z8MBKFvSXqA/ubYFA3ZIz1PxeXdtwfMT612sEhJ/li/BHyzNPe
         Mw2m82DEN6WjJB3QUIrsfKnFr/XORCAws+sFUw3Cx/IjlbyCtfKSYkdOG+DnedMoDQVj
         dQdcOaME0Hagnqd8cckUMgj7fAptB+l7mCvX9WTdME3/U2fhwIhWwQ++XSr4pUPb9iyg
         DewQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689689635; x=1692281635;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=GrQtZY4wGpbZs2f3zzM1/MVBvwz1MdPu48AEb1m6RVU=;
        b=cAnMbH2j7E+YXRIaA3tWDWxtlK1lWDFAhOO6QNMMWnhXzRO0PbdVPNNg5d0NsHxMIO
         KNOyGRc5KFpYL7R9MCvRkPbpZ6yG96xGw0+0C3G4O9LNaaCsFGyIe8hRfZ7hG7vC7yby
         wG8aDwyl2b2HEZbK0HirChUKCmoXTgoXUnCtvAIces8Xj2+/l3iUxvyeSYbV/d/1jAFy
         0Bm8v05yFx5YCKfHNAFc/iiEyiUHVJTj2A3oLNI3oMVLklqPmnx7iv4O02vxYq7NFTvn
         vZWgLR4/h8UejhqmRclX7DUC6uYR/jhusYCL2Lbwpi5aa3tEmRxsyG4s5ahqwqVlSV4/
         CABA==
X-Gm-Message-State: ABy/qLb7TnjlrbP1IlB72tEwUJtJ5gGogOIRY/57PmR4s7q8ovsINIR2
	up9KCSyuciE7YQFK3mhFt1Q9KtW9jyM=
X-Google-Smtp-Source: APBJJlGu8GTu7pnjw7rJwVnlf1DwnDY6SqaHZexRh1Wze4UbsvHc4wPnrXs1DtXYmXNbe1gOEx1zSQ==
X-Received: by 2002:a05:6512:1181:b0:4fb:89b3:3373 with SMTP id g1-20020a056512118100b004fb89b33373mr9139584lfr.43.1689689634729;
        Tue, 18 Jul 2023 07:13:54 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v2] ns16550: add support for polling mode when device tree is used
Date: Tue, 18 Jul 2023 17:13:50 +0300
Message-ID: <ce821c1c81ba69397047daae0b0e6d44893ec28d.1689689630.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

RISC-V doesn't support interrupts for the time being, so it would be nice to
have polling mode.

The patch assumes that polling mode will be used if there is no interrupt
property or the interrupt is equal to some unused UART interrupt number ( look
at the definition of NO_IRQ_POLL in ns16550.c ).

Also, the patch updates other places where '0' ( use NO_IRQ_POLL instead of
'0' ) was used to set that polling mode should be used.
It is possible that interrupt '0' can be used for some architectures as an
legal UART interrupt number ( according to dts files in Linux kernel ).
For example:
https://github.com/torvalds/linux/blob/master/arch/powerpc/boot/dts/ebony.dts#L197

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/drivers/char/ns16550.c | 51 ++++++++++++++++++++++++++++----------
 1 file changed, 38 insertions(+), 13 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 2aed6ec707..2547f53f5a 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -40,6 +40,8 @@
 #include <asm/fixmap.h>
 #endif
 
+#define NO_IRQ_POLL 0
+
 static struct ns16550 {
     int baud, clock_hz, data_bits, parity, stop_bits, fifo_size, irq;
     u64 io_base;   /* I/O port or memory-mapped I/O address. */
@@ -58,7 +60,11 @@ static struct ns16550 {
     struct timer timer;
     struct timer resume_timer;
     unsigned int timeout_ms;
-    bool_t intr_works;
+    enum {
+        intr_off,
+        intr_on,
+        polling,
+    } intr_works;
     bool_t dw_usr_bsy;
 #ifdef NS16550_PCI
     /* PCI card parameters. */
@@ -181,7 +187,7 @@ static void cf_check ns16550_interrupt(
     struct serial_port *port = dev_id;
     struct ns16550 *uart = port->uart;
 
-    uart->intr_works = 1;
+    uart->intr_works = intr_on;
 
     while ( !(ns_read_reg(uart, UART_IIR) & UART_IIR_NOINT) )
     {
@@ -212,7 +218,7 @@ static void cf_check __ns16550_poll(struct cpu_user_regs *regs)
     struct serial_port *port = this_cpu(poll_port);
     struct ns16550 *uart = port->uart;
 
-    if ( uart->intr_works )
+    if ( uart->intr_works == intr_on )
         return; /* Interrupts work - no more polling */
 
     while ( ns_read_reg(uart, UART_LSR) & UART_LSR_DR )
@@ -305,7 +311,8 @@ static void ns16550_setup_preirq(struct ns16550 *uart)
     unsigned char lcr;
     unsigned int  divisor;
 
-    uart->intr_works = 0;
+    if ( uart->intr_works != polling )
+        uart->intr_works = intr_off;
 
     pci_serial_early_init(uart);
 
@@ -394,7 +401,7 @@ static void __init cf_check ns16550_init_irq(struct serial_port *port)
 
 static void ns16550_setup_postirq(struct ns16550 *uart)
 {
-    if ( uart->irq > 0 )
+    if ( uart->intr_works != polling )
     {
         /* Master interrupt enable; also keep DTR/RTS asserted. */
         ns_write_reg(uart,
@@ -472,7 +479,8 @@ static void __init cf_check ns16550_init_postirq(struct serial_port *port)
 
                 if ( rc )
                 {
-                    uart->irq = 0;
+                    uart->irq = NO_IRQ_POLL;
+                    uart->intr_works = polling;
                     if ( msi_desc )
                         msi_free_irq(msi_desc);
                     else
@@ -488,7 +496,7 @@ static void __init cf_check ns16550_init_postirq(struct serial_port *port)
     }
 #endif
 
-    if ( uart->irq > 0 )
+    if ( uart->intr_works != polling )
     {
         uart->irqaction.handler = ns16550_interrupt;
         uart->irqaction.name    = "ns16550";
@@ -595,7 +603,9 @@ static void __init cf_check ns16550_endboot(struct serial_port *port)
 static int __init cf_check ns16550_irq(struct serial_port *port)
 {
     struct ns16550 *uart = port->uart;
-    return ((uart->irq > 0) ? uart->irq : -1);
+
+    return (((uart->intr_works != polling) && (uart->irq >= 0)) ?
+            uart->irq : -1);
 }
 
 static void cf_check ns16550_start_tx(struct serial_port *port)
@@ -1330,9 +1340,12 @@ pci_uart_config(struct ns16550 *uart, bool_t skip_amt, unsigned int idx)
                  * as special only for X86.
                  */
                 if ( uart->irq == 0xff )
-                    uart->irq = 0;
+                {
+                    uart->irq = NO_IRQ_POLL;
+                    uart->intr_works = polling;
+                }
 #endif
-                if ( !uart->irq )
+                if ( uart->intr_works == polling )
                     printk(XENLOG_INFO
                            "ns16550: %pp: no legacy IRQ, using poll mode\n",
                            &PCI_SBDF(0, b, d, f));
@@ -1551,7 +1564,8 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
         {
             conf += 3;
             uart->msi = true;
-            uart->irq = 0;
+            uart->irq = NO_IRQ_POLL;
+            uart->intr_works = polling;
         }
         else
 #endif
@@ -1791,8 +1805,19 @@ static int __init ns16550_uart_dt_init(struct dt_device_node *dev,
     }
 
     res = platform_get_irq(dev, 0);
-    if ( ! res )
-        return -EINVAL;
+    if ( (res < 0 ) || (res == NO_IRQ_POLL) )
+    {
+        printk("ns1650: polling will be used\n");
+
+        /*
+         * If the node doesn't have any interrupt or an interrupt number is
+         * equal to reserved NO_IRQ_POLL, then it means the driver
+         * will want to using polling.
+         */
+        res = NO_IRQ_POLL;
+
+        uart->intr_works = polling;
+    }
     uart->irq = res;
 
     uart->dw_usr_bsy = dt_device_is_compatible(dev, "snps,dw-apb-uart");
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 14:22:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 14:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565313.883355 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLlaP-0003bK-QO; Tue, 18 Jul 2023 14:21:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565313.883355; Tue, 18 Jul 2023 14:21:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLlaP-0003bD-NT; Tue, 18 Jul 2023 14:21:57 +0000
Received: by outflank-mailman (input) for mailman id 565313;
 Tue, 18 Jul 2023 14:21:56 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CPt9=DE=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qLlaO-0003b5-H4
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 14:21:56 +0000
Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com
 [2a00:1450:4864:20::231])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7286d1e0-2576-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 16:21:55 +0200 (CEST)
Received: by mail-lj1-x231.google.com with SMTP id
 38308e7fff4ca-2b708e49059so90133331fa.3
 for <xen-devel@lists.xenproject.org>; Tue, 18 Jul 2023 07:21:55 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 n20-20020a2e86d4000000b002b6e121cf1fsm517683ljj.4.2023.07.18.07.21.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 18 Jul 2023 07:21:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7286d1e0-2576-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689690115; x=1692282115;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=k8HIMpvtruNXSZvbqPmqYdW1IxWDth5PLXIw8/iOSRY=;
        b=KI9zDtfFBYljQNES+q32ai0AAvauta4/td27XyZ49rd9degHAKZ8j6PBtVvYE54nqq
         uoNOecNbTKHFHntke2wPwzRp/kk7W21nmIzPfa0NADMwKD0mhaiOttF/HyP4k5i+fLsA
         qjAg4WsrNxmJEvO5jAgoyJSsQxfmMhavLZgVx641e4UZidJk7z7sIgWqu/qt4TLSMF11
         02riH4+o6nzx6cMryCziupFwQcwrE60UrtTEFgyqLF8DgKtxt9W87S+Dzu6PWx5JR2FA
         /SoeP5vfdfF6p3r05kFOVr7vsh381nARXWe9KIDSK1ViUTxwsTbj0YBTW+rTBWHHRsbG
         FwXw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689690115; x=1692282115;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=k8HIMpvtruNXSZvbqPmqYdW1IxWDth5PLXIw8/iOSRY=;
        b=cL45RnDH7x40yV7KPYjd0X6JJYG5twb3wTTvI+G+P+vwenYX16Giq+iNYT7zXhU0oY
         5tyiIYmqZzQGlnr7zf/vgbpAsgObjxR1OOPEBFTRjYmxLFdJBNITKfCglZzc/0bOkW2Y
         azWNYpTIlup8nBrfFqB4VjrPVFE1Qhga7RVjT+19oW+6esTu+F6LnZ2Djtw0QYJHUFVE
         YNoB2s+U6mh931UnW7nb31risQ97xoEmH5nmBok5bZROWkWehXMsJ8XCzFX2sWLTBbO4
         alqTA2cCVq3SX2lnhPv9ym9rhjRxy6JvkWAMw+4/+6giXTiG/7tECI05BGa/PEMA4c6Q
         q4kw==
X-Gm-Message-State: ABy/qLa/2U33nZtTxWRUXm68y23ONKVwJHmJr1brcj/o6dmirH0KjZtb
	lbJqGR4eOG2SPIwF8WhNHf8=
X-Google-Smtp-Source: APBJJlH2KzFyzXcRyaaFRga1jCq+pv5MHz2pXT8Sq6ayTrHV1wKbMtlehGKtmsKiL18GuYaqtvahQg==
X-Received: by 2002:a2e:9d83:0:b0:2b6:de6d:8148 with SMTP id c3-20020a2e9d83000000b002b6de6d8148mr10321396ljj.31.1689690114676;
        Tue, 18 Jul 2023 07:21:54 -0700 (PDT)
Message-ID: <b40e6b9752ab013381ac65da7ade1351cf63eaaa.camel@gmail.com>
Subject: Re: [PATCH v3 2/3] xen/riscv: introduce function for physical
 offset calculation
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Bob Eshleman
	 <bobbyeshleman@gmail.com>, Alistair Francis <alistair.francis@wdc.com>, 
	Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
Date: Tue, 18 Jul 2023 17:21:53 +0300
In-Reply-To: <5cec8802-a109-2a0c-10e2-803fdfcb9cf1@suse.com>
References: <cover.1689604562.git.oleksii.kurochko@gmail.com>
	 <f86724014bf5234f22cd18e7b3da8e8aa83e1e08.1689604562.git.oleksii.kurochko@gmail.com>
	 <5cec8802-a109-2a0c-10e2-803fdfcb9cf1@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Mon, 2023-07-17 at 16:58 +0200, Jan Beulich wrote:
> On 17.07.2023 16:40, Oleksii Kurochko wrote:
> > The function was introduced to calculate and save physical
> > offset before MMU is enabled because access to start() is
> > PC-relative and in case of linker_addr !=3D load_addr it will
> > result in incorrect value in phys_offset.
> >=20
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> > ---
> > Changes in V3:
> > =C2=A0- save/restore of a0/a1 registers before C first function call.
> > ---
> > Changes in V2:
> > =C2=A0 - add __ro_after_init for phys_offset variable.
> > =C2=A0 - remove double blank lines.
> > =C2=A0 - add __init for calc_phys_offset().
> > =C2=A0 - update the commit message.
> > =C2=A0 - declaring variable phys_off as non static as it will be used i=
n
> > head.S.
> > ---
> > =C2=A0xen/arch/riscv/include/asm/mm.h |=C2=A0 2 ++
> > =C2=A0xen/arch/riscv/mm.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 18 +++++++++++++++---
> > =C2=A0xen/arch/riscv/riscv64/head.S=C2=A0=C2=A0 | 14 ++++++++++++++
> > =C2=A03 files changed, 31 insertions(+), 3 deletions(-)
> >=20
> > diff --git a/xen/arch/riscv/include/asm/mm.h
> > b/xen/arch/riscv/include/asm/mm.h
> > index 5e3ac5cde3..d9c4205103 100644
> > --- a/xen/arch/riscv/include/asm/mm.h
> > +++ b/xen/arch/riscv/include/asm/mm.h
> > @@ -15,4 +15,6 @@ void setup_initial_pagetables(void);
> > =C2=A0void enable_mmu(void);
> > =C2=A0void cont_after_mmu_is_enabled(void);
> > =C2=A0
> > +void calc_phys_offset(void);
> > +
> > =C2=A0#endif /* _ASM_RISCV_MM_H */
> > diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
> > index fddb3cd0bd..c84a8a7c3c 100644
> > --- a/xen/arch/riscv/mm.c
> > +++ b/xen/arch/riscv/mm.c
> > @@ -1,5 +1,6 @@
> > =C2=A0/* SPDX-License-Identifier: GPL-2.0-only */
> > =C2=A0
> > +#include <xen/cache.h>
> > =C2=A0#include <xen/compiler.h>
> > =C2=A0#include <xen/init.h>
> > =C2=A0#include <xen/kernel.h>
> > @@ -19,9 +20,10 @@ struct mmu_desc {
> > =C2=A0=C2=A0=C2=A0=C2=A0 pte_t *pgtbl_base;
> > =C2=A0};
> > =C2=A0
> > -#define PHYS_OFFSET ((unsigned long)_start - XEN_VIRT_START)
> > -#define LOAD_TO_LINK(addr) ((addr) - PHYS_OFFSET)
> > -#define LINK_TO_LOAD(addr) ((addr) + PHYS_OFFSET)
> > +unsigned long __ro_after_init phys_offset;
> > +
> > +#define LOAD_TO_LINK(addr) ((unsigned long)(addr) - phys_offset)
> > +#define LINK_TO_LOAD(addr) ((unsigned long)(addr) + phys_offset)
> > =C2=A0
> > =C2=A0/*
> > =C2=A0 * It is expected that Xen won't be more then 2 MB.
> > @@ -273,3 +275,13 @@ void __init noreturn noinline enable_mmu()
> > =C2=A0=C2=A0=C2=A0=C2=A0 switch_stack_and_jump((unsigned long)cpu0_boot=
_stack +
> > STACK_SIZE,
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 cont_after_mmu_is_enabled);
> > =C2=A0}
> > +
> > +/*
> > + * calc_phys_offset() should be used before MMU is enabled because
> > access to
> > + * start() is PC-relative and in case when load_addr !=3D
> > linker_addr phys_offset
> > + * will have an incorrect value
> > + */
> > +void __init calc_phys_offset(void)
> > +{
> > +=C2=A0=C2=A0=C2=A0 phys_offset =3D (unsigned long)start - XEN_VIRT_STA=
RT;
> > +}
> > diff --git a/xen/arch/riscv/riscv64/head.S
> > b/xen/arch/riscv/riscv64/head.S
> > index 2c0304646a..9015d06233 100644
> > --- a/xen/arch/riscv/riscv64/head.S
> > +++ b/xen/arch/riscv/riscv64/head.S
> > @@ -29,6 +29,20 @@ ENTRY(start)
> > =C2=A0
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 jal=C2=A0=C2=A0=C2=A0=
=C2=A0 reset_stack
> > =C2=A0
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * save hart_id and dt=
b_base as a0 and a1 register can be
> > used
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * by C code ( f.e. se=
tup_initial_pagetables will update
> > a0 and
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * a1 )
>=20
> I'd recommend dropping the part in parentheses - for one the function
> doesn't exist yet, and then you're merely restating what the ABI has.
Thanks. I'll do that.
>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mv=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 s0, a0
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mv=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 s1, a1
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 jal=C2=A0=C2=A0=C2=A0=C2=A0=
 calc_phys_offset
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* restore bootcpu_id and d=
tb address */
>=20
> Is the first name here intentionally different from that in the other
> comment (where it's "hart_id")?
Only one reason for that is that bootcpu_id is used an argument of
start_xen() function. But generally I missed it to sync with the name
above.

Probably it would be better to use 'bootcpu' everywhere instead of
'hart_id' as it is 'architecture independent way' to name CPU.

So I can update the comment above to: 'hart_id ( bootcpu_id )' ( as it
was done in the comment above ENTRY(start) ) or just bootcpu_id.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 14:23:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 14:23:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565316.883365 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLlbj-00048K-4e; Tue, 18 Jul 2023 14:23:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565316.883365; Tue, 18 Jul 2023 14:23:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLlbj-00048D-1L; Tue, 18 Jul 2023 14:23:19 +0000
Received: by outflank-mailman (input) for mailman id 565316;
 Tue, 18 Jul 2023 14:23:18 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qLlbi-000485-1R
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 14:23:18 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLlbh-0002Ts-8V; Tue, 18 Jul 2023 14:23:17 +0000
Received: from [15.248.2.157] (helo=[10.24.67.41])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLlbh-0002gp-2Z; Tue, 18 Jul 2023 14:23:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=l5HQF3ZCa/dBY8S8DXko8dxRN778wHdTjO4sZStdlLw=; b=5vaRLm/3hq9KVDyD6iUX27QJTg
	iVwx5BlB/rDalPTWK5X3sa0aMazxdFbs66wz8bnE63d9KOKWbX/VJDGzdvxMV8Lhz6lxl8niHDjSC
	nBSuKNS2tDW5czxRSpRJlqmQGBnCZsBzeX0iWaOgRYIAtmbYdyBOSnqYiMGTlRrn6yDg=;
Message-ID: <b37b15c6-d7f7-df9d-83c1-337f434a713b@xen.org>
Date: Tue, 18 Jul 2023 15:23:15 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2] ns16550: add support for polling mode when device tree
 is used
Content-Language: en-US
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
References: <ce821c1c81ba69397047daae0b0e6d44893ec28d.1689689630.git.oleksii.kurochko@gmail.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <ce821c1c81ba69397047daae0b0e6d44893ec28d.1689689630.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 18/07/2023 15:13, Oleksii Kurochko wrote:
> RISC-V doesn't support interrupts for the time being, so it would be nice to
> have polling mode.
> 
> The patch assumes that polling mode will be used if there is no interrupt
> property 

As I asked in v1, please explain that this is allowed by the binding and 
provide a link for others to verify.

> or the interrupt is equal to some unused UART interrupt number ( look
> at the definition of NO_IRQ_POLL in ns16550.c ).

Nack. If you want to use polling mode and yet have an interrupts 
property then you should provide the information differently. This would 
either be via the command line or an extra property in the DT node.

If the latter, it would need to be standardized first.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 14:37:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 14:37:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565325.883394 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLlpZ-0006HN-G9; Tue, 18 Jul 2023 14:37:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565325.883394; Tue, 18 Jul 2023 14:37:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLlpZ-0006HG-DV; Tue, 18 Jul 2023 14:37:37 +0000
Received: by outflank-mailman (input) for mailman id 565325;
 Tue, 18 Jul 2023 14:37:35 +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
 <SRS0=88xE=DE=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qLlpX-0006HA-4K
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 14:37:35 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2055.outbound.protection.outlook.com [40.107.7.55])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a00797e0-2578-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 16:37:30 +0200 (CEST)
Received: from DB7PR05CA0016.eurprd05.prod.outlook.com (2603:10a6:10:36::29)
 by GV2PR08MB8049.eurprd08.prod.outlook.com (2603:10a6:150:ae::12) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 14:36:47 +0000
Received: from DBAEUR03FT056.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:36:cafe::8a) by DB7PR05CA0016.outlook.office365.com
 (2603:10a6:10:36::29) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33 via Frontend
 Transport; Tue, 18 Jul 2023 14:36:47 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT056.mail.protection.outlook.com (100.127.142.88) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.33 via Frontend Transport; Tue, 18 Jul 2023 14:36:46 +0000
Received: ("Tessian outbound f1e964b3a9be:v145");
 Tue, 18 Jul 2023 14:36:46 +0000
Received: from e89285c2b7d9.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 3BAD226E-2D45-4DB0-BDE1-06693F476368.1; 
 Tue, 18 Jul 2023 14:36:40 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e89285c2b7d9.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 18 Jul 2023 14:36:40 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com (2603:10a6:208:104::24)
 by VI1PR08MB10050.eurprd08.prod.outlook.com (2603:10a6:800:1c4::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Tue, 18 Jul
 2023 14:36:36 +0000
Received: from AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854]) by AM0PR08MB3778.eurprd08.prod.outlook.com
 ([fe80::5a82:e906:eecd:7854%3]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 14:36:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a00797e0-2578-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KIQN5VR6al95yX44zbALQFxPbHH+rmQdO5Pf8w3Ege8=;
 b=2HL4B+BPgQIGqQJqA1VugXL/yqoXAS9xnBHkUqgIBX2zfkJZhIDyZnaalQbFmZow+g6nma4j+rZxZW8qr61SqE4WaN1XQrYDG/gW/vhbpXciUeh/Q9oDj/3UuUYxZy8QtDzJbj+UqrdEXaAlp4XeXF6pCm64T9twn0QRb0+UWMo=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 0e5fdd48182161e1
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CLscYympgY+IK3UBdW1OUh/SkZgsPt94xdK4p1QbIBmYglJ5vRFBrnfOcBpJKyjsAiUXEF8OAdsJBp6oF3UamuA9XVgIecMHRAbiEjlvJOASOLH4QELO8tW8hld4uKbnlaO9cbnUB3mEUrddqcuzmKmoBE0GDEyouQcGnY5MBvpYAqgAXn2dN2d7LF8WgFRLBTpLhNDh+tMGHosVxDBTxTEC7EaWP5/FMNghC1gFyCrYGS/GXbaK2/zIXgX2BDH9HmD+1/Ie6MzEfn8ZWd1ocsYsl+TM83jMoz71cG2TnAAVznwRvS3E7Rl+8WYnLp0ges3Ls5t/GT4sUxruipEZpg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=KIQN5VR6al95yX44zbALQFxPbHH+rmQdO5Pf8w3Ege8=;
 b=PL4bnDHobUNP7uN5KhLfn6w0TDiVMSqyvwxzSBxlYtqQ18neEBRdbx6P2ZhmwYv1wWeo4vzz2WStxJBz5uu6fB6BNYXgvLkcRtsC78onVsjEfmWDzOJ+JZHsOwLhI47YqTYi2J+Y2USZh2BhGMYwX/8zrzXpw+Hu2ApG6yLuj4W2FOzpyxunT0g4nqOmePSQaR4MEe5PPlit/VA/b8eY8vCTiRV3FgbbqdykI6GiXAzDCIyrh7GiglgHk0Aycr65jx/MhNR50mYVxaVkRLm1URVcSV4UnaWuGuLUqW/PLRIUtEzZkAwAqRVqtzxYWXdFYMqoWwlM6vOxzVf4XnegiA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KIQN5VR6al95yX44zbALQFxPbHH+rmQdO5Pf8w3Ege8=;
 b=2HL4B+BPgQIGqQJqA1VugXL/yqoXAS9xnBHkUqgIBX2zfkJZhIDyZnaalQbFmZow+g6nma4j+rZxZW8qr61SqE4WaN1XQrYDG/gW/vhbpXciUeh/Q9oDj/3UuUYxZy8QtDzJbj+UqrdEXaAlp4XeXF6pCm64T9twn0QRb0+UWMo=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>, Henry Wang
	<Henry.Wang@arm.com>
Subject: Re: [XEN PATCH v10 16/24] xen/arm: ffa: add defines for sharing
 memory
Thread-Topic: [XEN PATCH v10 16/24] xen/arm: ffa: add defines for sharing
 memory
Thread-Index: AQHZuH9Y/E5eTczWgkKkQ5tsd+GUtq+/mXcA
Date: Tue, 18 Jul 2023 14:36:36 +0000
Message-ID: <A742C42E-5861-42EB-91B9-4D74653C6467@arm.com>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-17-jens.wiklander@linaro.org>
In-Reply-To: <20230717072107.753304-17-jens.wiklander@linaro.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM0PR08MB3778:EE_|VI1PR08MB10050:EE_|DBAEUR03FT056:EE_|GV2PR08MB8049:EE_
X-MS-Office365-Filtering-Correlation-Id: fe34f200-fcaa-47ec-dc39-08db879c6a2f
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 3z3JQT6dWGyzd8krBjeJWIgrGRxhJF49zGgDvqQSuMY6m2Ih1v0yBwrEqkz8RHMXUi/u1KTdCkAxYUqsB/eGOdAgaqCHRB4eIoCQtfEtVVvvgwrQCdPFuDWC0+azEb5VQ1n5NUfa+YW+SOVYYK/e/f0YCpdQA8wMax+nqoXAEi9yz/9AHCxlnEdmHkk+eEXSVAjwx/e6NlHMEyEC+S35LgQ/R8V/UNtuG4qR/QRwprYch4DeCjzT5KrUZYr2S3S4mlr6Z/LSTaEBcEdj5uGDVgiUaIbSb2Bf5Ni/zvpb5iKrXRd8Mv/7yRYGdi0aKs5gJLTFtpMUVvcXpeTMkFOImJLG/6LNm8DjY+Ip2eWt9h3F3quNMsmWy9Ais4je4Rp+RHmqf8b5uZGK2L0ERirhi2QOPklGK3K4qICmnJb4ZVohhqPRjVWCt5V37U7qnDxiF5YkdkpBciOvl6kcoJHYvOFviikeOUWmMcTXX1q/4skWmL1TmlMs7lu3ilgnsRlM08s+BcBPN67RqAMDYFxGMQseYuYV7ujHjXnR3TTLqZcMsrkaUb66I9/8ThpaFj5xr+mRz9M83WKFZRIteqAxPLUrlZ2CwrBSqLKBR+sFKqfzOPpDLGd3hBU3MVr2mRcHIhzTyOHNo1XrDlxZpXg/iZIFPp6oFbeDS/nnFTKD/SgBwTQR1hPBSUCb9Nzs9CL9
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB3778.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(366004)(39860400002)(346002)(376002)(451199021)(71200400001)(478600001)(6486002)(91956017)(54906003)(53546011)(186003)(6506007)(6512007)(966005)(2906002)(76116006)(4326008)(316002)(6916009)(66946007)(66556008)(66446008)(41300700001)(8676002)(36756003)(8936002)(5660300002)(38100700002)(122000001)(64756008)(66476007)(33656002)(86362001)(38070700005)(2616005)(83380400001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <B2AA2674BD63CD48903D60F5CAFB2CEF@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB10050
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT056.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	98174eba-a3ea-4c0a-d59b-08db879c63e7
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	ytoIp0aPoZTQe6IIcUDgYkjZ36+Vw/dnvvhzhE+wNVycf9GVPVT7bpOkZ9e9JBjzA8VLhDkWvz+4dQTyo6z7gW/Yqk4l2otEzRUl2rtn+7nKVFh41ruqEBWn3H1mhPMilIYtUCQ8qWio4PcrbpwwcN5WYHgc05eoR4xWlu+0YVBFjdW5m8B2U4oWiY9yrE0c44zmmbIbd4gBr10FQkKT54b2nYA1DJi8MrIVKV2AT/QfZIWBArcHUDJgT8T6d/uYRpahhakfMYHiIjcqse0LgMUsw88xaUtO8eRwtF3CQ7VQ6RRcvuL08JereTKpJ0J7Ffi20IlQz7IIKCrbPrjldAd9vdEO3H4pcJIwW6wmpbKKiDFw48nI5LCwQqEoH327OLCKCKRVvFX6gXYacSMPjj8xhKcX2TLJDHUo0PlR4NuCzMPzJqIWD9UXIv+426q5zxtOL7CQOaTj6hhrcXNxXnDZ4SApFsYvHoIPh5W0kUkCiPuLa97YP5QUtCrQ3UwpwZeNnYhT1N2qD8qmAnniuc1bslSqxbhIgyzaA9tEgZBA8Iq8J1WcM7tCHoiSj9JcMxJ9bzDLyHHxLVRXLzB+9XWE/HJbYjSUsiTNSC+9ieBnrTNGW/Ved1np05SJWaLdcwW8F8weJcwRd16BjMJBeL1vY+stUHtO5rF+cmg0RoGLnsEQp9+Iz9fxGWB4MSC17t267LaKFUzM3jP1vD790rwSTxBm+5aqh1HtXDGimAHT57LsbzLpyT2cICw+o2mAx3ShMjAnqOXx/mGsHFLrng==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(39860400002)(346002)(376002)(451199021)(82310400008)(40470700004)(36840700001)(46966006)(478600001)(6486002)(54906003)(53546011)(186003)(6506007)(6512007)(966005)(26005)(70586007)(2906002)(4326008)(316002)(41300700001)(8676002)(36756003)(8936002)(5660300002)(6862004)(356005)(70206006)(81166007)(336012)(33656002)(86362001)(40460700003)(36860700001)(2616005)(82740400003)(47076005)(83380400001)(40480700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 14:36:46.9070
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: fe34f200-fcaa-47ec-dc39-08db879c6a2f
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT056.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8049

Hi Jens,

> On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> wrot=
e:
>=20
> According to DEN0077A version 1.1 REL0
> - Section 10.9.2 Memory region handle, page 167
> - Table 10.18 at page 175
> - Table 10.15 at page 168
> - Section 10.11.4 Flags usage, page 184-187
> add defines needed for sharing using the function FFA_MEM_SHARE and
> friends.
>=20
> Also add limits for how many shared buffers that a guest can have at
> once and how large a shared buffer can be at most.
>=20
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> Reviewed-by: Henry Wang <Henry.Wang@arm.com>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> xen/arch/arm/tee/ffa.c | 58 ++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 58 insertions(+)
>=20
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> index d5748b9ce88c..e895e355e620 100644
> --- a/xen/arch/arm/tee/ffa.c
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -5,6 +5,14 @@
>  * Arm Firmware Framework for ARMv8-A (FF-A) mediator
>  *
>  * Copyright (C) 2023  Linaro Limited
> + *
> + * References:
> + * FF-A-1.0-REL: FF-A specification version 1.0 available at
> + *               https://developer.arm.com/documentation/den0077/a
> + * FF-A-1.1-REL0: FF-A specification version 1.1 available at
> + *                https://developer.arm.com/documentation/den0077/e
> + * TEEC-1.0C: TEE Client API Specification version 1.0c available at
> + *            https://globalplatform.org/specs-library/tee-client-api-sp=
ecification/
>  */
>=20
> #include <xen/bitops.h>
> @@ -80,6 +88,56 @@
>  */
> #define FFA_MAX_RXTX_PAGE_COUNT         1
>=20
> +/*
> + * Limit for shared buffer size. Please note that this define limits
> + * number of pages.
> + *
> + * FF-A doesn't have any direct requirements on GlobalPlatform or vice
> + * versa, but an implementation can very well use FF-A in order to provi=
de
> + * a GlobalPlatform interface on top.
> + *
> + * Global Platform specification for TEE requires that any TEE
> + * implementation should allow to share buffers with size of at least
> + * 512KB, defined in TEEC-1.0C page 24, Table 4-1,
> + * TEEC_CONFIG_SHAREDMEM_MAX_SIZE.
> + * Due to overhead which can be hard to predict exactly, double this num=
ber
> + * to give a safe margin.
> + */
> +#define FFA_MAX_SHM_PAGE_COUNT          (2 * SZ_512K / FFA_PAGE_SIZE)
> +
> +/*
> + * Limits the number of shared buffers that guest can have at once. This
> + * is to prevent case, when guests trick XEN into exhausting its own
> + * memory by allocating many small buffers. This value has been chosen
> + * arbitrarily.
> + */
> +#define FFA_MAX_SHM_COUNT               32
> +
> +/* FF-A-1.1-REL0 section 10.9.2 Memory region handle, page 167 */
> +#define FFA_HANDLE_HYP_FLAG             BIT(63, ULL)
> +#define FFA_HANDLE_INVALID              0xffffffffffffffffULL
> +
> +/*
> + * Memory attributes: Normal memory, Write-Back cacheable, Inner shareab=
le
> + * Defined in FF-A-1.1-REL0 Table 10.18 at page 175.
> + */
> +#define FFA_NORMAL_MEM_REG_ATTR         0x2fU
> +/*
> + * Memory access permissions: Read-write
> + * Defined in FF-A-1.1-REL0 Table 10.15 at page 168.
> + */
> +#define FFA_MEM_ACC_RW                  0x2U
> +
> +/* FF-A-1.1-REL0 section 10.11.4 Flags usage, page 184-187 */
> +/* Clear memory before mapping in receiver */
> +#define FFA_MEMORY_REGION_FLAG_CLEAR            BIT(0, U)
> +/* Relayer may time slice this operation */
> +#define FFA_MEMORY_REGION_FLAG_TIME_SLICE       BIT(1, U)
> +/* Clear memory after receiver relinquishes it */
> +#define FFA_MEMORY_REGION_FLAG_CLEAR_RELINQUISH BIT(2, U)
> +/* Share memory transaction */
> +#define FFA_MEMORY_REGION_TRANSACTION_TYPE_SHARE (1U << 3)
> +
> /*
>  * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
>  * BIT(31): Framework or partition message
> --=20
> 2.34.1
>=20



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 14:39:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 14:39:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565328.883404 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLlqx-0006nc-Qr; Tue, 18 Jul 2023 14:39:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565328.883404; Tue, 18 Jul 2023 14:39:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLlqx-0006nV-O6; Tue, 18 Jul 2023 14:39:03 +0000
Received: by outflank-mailman (input) for mailman id 565328;
 Tue, 18 Jul 2023 14:39:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLlqw-0006nI-V4; Tue, 18 Jul 2023 14:39:02 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLlqw-0002m4-O8; Tue, 18 Jul 2023 14:39:02 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLlqw-00057Y-6x; Tue, 18 Jul 2023 14:39:02 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLlqw-0005zB-6M; Tue, 18 Jul 2023 14:39:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=aoyi/v0Mddv2XOnnk8UxNdz6OcUbHgryTkKAOLsPOEc=; b=FD62oXy6HBElPuSTDZ3qyLrC8J
	Ab8P92NVWRT1/PJIdS9EOnD2f2W5eYRDDiOkh5nrU0CZxDiaHoZCDkE3/Hq3m9qqK/p+WaRcWNq9C
	T5VwxrzP5luwfUvVgqQVeVSHmuslCro/ZNVtkvIofQkoO3cIGXYfv3KMELpmLk/9LfOI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181851-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.16-testing test] 181851: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-4.16-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=2b12f64f87b326e9434b09f249af5e8b1e287e24
X-Osstest-Versions-That:
    xen=b0806d84d48d983d40a29534e663652887287a78
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 18 Jul 2023 14:39:02 +0000

flight 181851 xen-4.16-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181851/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 180918
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180918
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180918
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 180918
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180918
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 180918
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 180918
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180918
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180918
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 180918
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 180918
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 180918
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  2b12f64f87b326e9434b09f249af5e8b1e287e24
baseline version:
 xen                  b0806d84d48d983d40a29534e663652887287a78

Last test of basis   180918  2023-05-23 13:08:46 Z   56 days
Failing since        181831  2023-07-17 06:36:55 Z    1 days    2 attempts
Testing same since   181851  2023-07-17 16:41:30 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alejandro Vallejo <alejandro.vallejo@cloud.com>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Anthony PERARD <anthony.perard@citrix.com>
  Olaf Hering <olaf@aepfle.de>
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   b0806d84d4..2b12f64f87  2b12f64f87b326e9434b09f249af5e8b1e287e24 -> stable-4.16


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 14:41:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 14:41:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565336.883415 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLlsi-0008Hb-CZ; Tue, 18 Jul 2023 14:40:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565336.883415; Tue, 18 Jul 2023 14:40:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLlsi-0008HU-9B; Tue, 18 Jul 2023 14:40:52 +0000
Received: by outflank-mailman (input) for mailman id 565336;
 Tue, 18 Jul 2023 14:40:51 +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 <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLlsh-0008Gu-4d
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 14:40:51 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on20620.outbound.protection.outlook.com
 [2a01:111:f400:fe12::620])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 162e0009-2579-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 16:40:49 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB9579.eurprd04.prod.outlook.com (2603:10a6:10:306::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Tue, 18 Jul
 2023 14:40:47 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 14:40:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 162e0009-2579-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=oUvC+ZsOyBluH/SPQQew68tVJXrdRowdMK6XQnX2XZoQqr11+tyJ4zpJuBu4ztmb6dMuQXgNuumXl2Bo0W0wQa/BQGpMBsYjhVKhU3Wgq6LUxOe6tAUPd7yYdNtQ1UKQYeX9BCfTMO9dOuK1pgW06n6QmD/HkP82dQAwQvGgc4xiG1XYhUWDxhJ1ypKEqiHMprshW4A712mTW3Pk0rucPuxLs3U5A5zRWhJsjDiD1evrHBylAA+HbfG6MPoVdDs4f15gCYAuM3FR/Jd9yIq920E33JfjCBKEmg2E8b7RkYh1DxZMKULD5NYT3E45hn0qRul2kcZBneuCh/q+fE5J0Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yAAp/79gr9jTiL9SmfRndnx1mM9WxsdljfgrYyBExvA=;
 b=I5r09eyuGldvzNZcm9lgWBEpSgRy1PfBzGY1iSH66aaVC76i/zpytXVe+NbG+lGnkAYIMmDry0InrCUrQ1yb+Hdy+Qputj7yOgB3CxH4oudrXv84VZR2hYIzAUXr21iRjkomHe07AJiMIEeVL5H5mnZr5hnB1R5W5R4xbUOlqiqKBTz5pNHAHEKOMo8wn0g0pejqiYvF3ulnp9mvtyiGu3O3piu8wOqyrimtrSZ76TL2wORFNmhh4F6sgXVfyQo6GNCP4P1iPIgFl23NoHaJ1cIqxus0XaIGpxFWT/mZEn0scjefdqXfcWk8+3udn06N9w6xhkpK8XaPdpFElfXM1Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yAAp/79gr9jTiL9SmfRndnx1mM9WxsdljfgrYyBExvA=;
 b=MbcgrVtHDmEuZSabwWBU3DCxfERw4KntFdKJgebAp8doZNdB0IoSQ0hqzoOHv0KeJU7UMN/9SQpJ/7ues0sKXfVzjR5lotoSbowPooMtnbf1a9GFdEZjCT44JtBIv31YdEudGaDRJyA2cdbSMMA7N6cIMjd2+dqO6//txaFQXH+FIALvH3bB05LQ0HGNyUV6QgvIQABDBv7xBBvxJSySRgQhuibd06JGU6E7cMS3PWODITOlBP1DqCHkset4q+KReSo4dsVa7mTPNyajgWC1A5qUPfYCAUJEngoWLXpb/eZR2/suzkIXjvDYAIlt3E+vFvIBv1UFWO8rahQ7uYsoJw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <449e1832-83f8-a8c6-6137-7d161ac60fe4@suse.com>
Date: Tue, 18 Jul 2023 16:40:44 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2] ns16550: add support for polling mode when device tree
 is used
Content-Language: en-US
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Julien Grall <julien@xen.org>, Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <ce821c1c81ba69397047daae0b0e6d44893ec28d.1689689630.git.oleksii.kurochko@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ce821c1c81ba69397047daae0b0e6d44893ec28d.1689689630.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0165.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a2::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB9579:EE_
X-MS-Office365-Filtering-Correlation-Id: e6769761-56d6-4b0b-5e7d-08db879cf916
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	R9k/AU3qQiIfbxHhYCGaNY8afwvsek4mbQWu6iCAkuLzYMIMJ8UYuheEVzYOhj4MrfB9P8KyzQQOAQw1vHKLtrU5l/Vl5aRx+mFsYLUaKDEP9M3J1UZ8ksBLok9sWqKfwGjsdZGiTT/a0mt5QJGTNdQzwTg0jot1Jtz54mRNM+kxYqT2RCE1jqI+52ZZ8dhaZYutOCWzNdeP86erLMhK75ILbt/QfIoL/Bbt0d1XO+/CnVOGKIKUu8oEAwc9Jc1ac5zpg1XXx6wu4Vm/L7t4Z9Y0jxTNkptArkqBnaEu64/xv38Y8VBaNwnhHW5YCsqbLwUkA18HXj0RYlIsHFFCWwA3c8pP+qBAvP9bkL+gZnz7aSsBYzPlVhgLta5XUeJtL0dppkHFxNyRRDtpDmc0HxtjqVS2Ue2Cgg9K8ahl1/rTLHzkyEC5CEIwA2MQu/qTLAyS05RyyBJZUKi/DcnxtowInLDYVV6G+t4+KiSeW83/kIRFXYNFvhohszRlqvSz4laNH/IFSWYYbuCfTR4b1n0unVElDbw3FG12sHNFHI+ipccC28LpAbmFu3jQTCVMixLzHHMlyftLdefaspZPVPXoME8cB8nu7Dqu+Ybd3XN+myMefYJN6HaZgQgFkEn8AsLQdzc2vFkTsLS9p2kOUw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(366004)(136003)(396003)(39860400002)(451199021)(86362001)(2906002)(31696002)(8676002)(83380400001)(4326008)(8936002)(6916009)(316002)(41300700001)(2616005)(5660300002)(54906003)(66946007)(66556008)(66476007)(38100700002)(36756003)(31686004)(186003)(26005)(6506007)(66899021)(6512007)(53546011)(478600001)(6666004)(6486002)(45980500001)(43740500002);DIR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cisvMjdIaHM5cTJyVnBic1ZaRW85VXhK?=
 =?utf-8?B?aUF3UVVWaWV3M1UwNFExYXdFZkxweGZvbXduMVZMZlNiTlNHc3RaSTVackFu?=
 =?utf-8?B?eklIRVlaSHlsZkE4Tzg3ZFVOQ1NUYll3akhydTFtVnJoRmJsbjgzdTN6R0pj?=
 =?utf-8?B?S3E1R21SbXNuZCtlYm9RRCttNk84TEhPV3lTd1ZVL2VYTlB0Z3M2QWNjZ1Vp?=
 =?utf-8?B?Tm8wTEg3cXRCTk9qcjNwcVY1bFRzVVVzZWN3eWJoVHlaWnFTTzEzd2RwbHh1?=
 =?utf-8?B?WnlOWW5OM21XQzFWV2NiVFR6L3lzbTVHdXVKYzZ4cDdNOThoNnNVMHpZRGhM?=
 =?utf-8?B?Szd1VWUzdFZGTk9pWmcyOU5oRERoUjBsQmpoWTNEcHI1cHNYTThUZmJlOFlj?=
 =?utf-8?B?b1lzZ1N4ZFNPMnRzZCt5dytZSjhnSlZrK2FjVFc5NGpzSFY2ZjN5bmk3aTdj?=
 =?utf-8?Q?AXqR5L+WjzaifowvMI7H7MdMa?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e6769761-56d6-4b0b-5e7d-08db879cf916
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 14:40:46.7769
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: MCkPRPZaGDI8a6STR24CoIWluQl1TcOO+wTffDYvRsiUU4eT8BHqpv50Qs84OYjKRo69qey7uAzDLwEwe/F3+w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9579

On 18.07.2023 16:13, Oleksii Kurochko wrote:
> --- a/xen/drivers/char/ns16550.c
> +++ b/xen/drivers/char/ns16550.c
> @@ -40,6 +40,8 @@
>  #include <asm/fixmap.h>
>  #endif
>  
> +#define NO_IRQ_POLL 0

Do you really need this? I ask because ...

> @@ -595,7 +603,9 @@ static void __init cf_check ns16550_endboot(struct serial_port *port)
>  static int __init cf_check ns16550_irq(struct serial_port *port)
>  {
>      struct ns16550 *uart = port->uart;
> -    return ((uart->irq > 0) ? uart->irq : -1);
> +
> +    return (((uart->intr_works != polling) && (uart->irq >= 0)) ?

... you now use >= here, which includes that special value. As long
as intr_works is always set to "polling", the particular value in
uart->irq shouldn't matter (and hence you wouldn't need to store
anywhere that or any other special value).

> @@ -1330,9 +1340,12 @@ pci_uart_config(struct ns16550 *uart, bool_t skip_amt, unsigned int idx)
>                   * as special only for X86.
>                   */
>                  if ( uart->irq == 0xff )
> -                    uart->irq = 0;
> +                {
> +                    uart->irq = NO_IRQ_POLL;
> +                    uart->intr_works = polling;
> +                }
>  #endif
> -                if ( !uart->irq )
> +                if ( uart->intr_works == polling )

Careful here - we may also have read 0 from PCI_INTERRUPT_LINE, or
forced 0 because we read 0 from PCI_INTERRUPT_PIN. All these cases,
unless provably broken, need to continue to function as they were.

Further you alter parse_positional(), but you leave alone
parse_namevalue_pairs(). I think you're changing the admin (command
line) interface that way, because so far "irq=0" was the way to
request polling. While it may be unavoidable to change that interface
(which will then need noting in ./CHANGELOG.md), you still need to
offer a way to forcibly set polling mode.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 14:44:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 14:44:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565339.883425 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLlwH-0000Rf-TI; Tue, 18 Jul 2023 14:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565339.883425; Tue, 18 Jul 2023 14:44:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLlwH-0000RY-PY; Tue, 18 Jul 2023 14:44:33 +0000
Received: by outflank-mailman (input) for mailman id 565339;
 Tue, 18 Jul 2023 14:44:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLlwH-0000RO-1z; Tue, 18 Jul 2023 14:44:33 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLlwG-0002rw-Kv; Tue, 18 Jul 2023 14:44:32 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLlwG-0005NS-9z; Tue, 18 Jul 2023 14:44:32 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLlwG-0004QL-90; Tue, 18 Jul 2023 14:44:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=iu2rU7XsN1EshJ4drJVaJRzPFWCVi37OAwtqiSBbVE0=; b=dEBuyE87KJ3RpIWML3ApTygQl6
	N85pOASVIffyCJWEwfi9HHhda13ptPvVjEcfgoq2YQaHwhVwq+UV8AmVaP6Y42TqnFiwcza2/gg/B
	e+XovugO1t0PGS34bIHaPGIvEkCEi3mUB5Xz2p5wblQg95m7ydzBChqYX9zKjWjt6N3A=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181874-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181874: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=408a191b749b3d1620ad7ec9c614bab5924530c2
X-Osstest-Versions-That:
    xen=e04cc8a08df3574bd7d5f7860008f1625e28f8b1
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 18 Jul 2023 14:44:32 +0000

flight 181874 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181874/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  408a191b749b3d1620ad7ec9c614bab5924530c2
baseline version:
 xen                  e04cc8a08df3574bd7d5f7860008f1625e28f8b1

Last test of basis   181842  2023-07-17 12:01:58 Z    1 days
Testing same since   181874  2023-07-18 11:00:26 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alejandro Vallejo <alejandro.vallejo@cloud.com>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   e04cc8a08d..408a191b74  408a191b749b3d1620ad7ec9c614bab5924530c2 -> smoke


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 14:50:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 14:50:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565346.883434 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLm27-000280-HW; Tue, 18 Jul 2023 14:50:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565346.883434; Tue, 18 Jul 2023 14:50:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLm27-00027t-Eq; Tue, 18 Jul 2023 14:50:35 +0000
Received: by outflank-mailman (input) for mailman id 565346;
 Tue, 18 Jul 2023 14:50:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=d/qQ=DE=epam.com=prvs=1563b275a8=oleksandr_tyshchenko@srs-se1.protection.inumbo.net>)
 id 1qLm26-00027n-GM
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 14:50:34 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7178b2f5-257a-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 16:50:32 +0200 (CEST)
Received: from pps.filterd (m0174683.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 36IAalta032077;
 Tue, 18 Jul 2023 14:50:16 GMT
Received: from eur01-db5-obe.outbound.protection.outlook.com
 (mail-db5eur01lp2050.outbound.protection.outlook.com [104.47.2.50])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3rwkuf2bm2-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Tue, 18 Jul 2023 14:50:16 +0000
Received: from AM0PR03MB6100.eurprd03.prod.outlook.com (2603:10a6:208:155::13)
 by VI1PR03MB6253.eurprd03.prod.outlook.com (2603:10a6:800:138::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 14:50:10 +0000
Received: from AM0PR03MB6100.eurprd03.prod.outlook.com
 ([fe80::52c2:88f4:353e:4a44]) by AM0PR03MB6100.eurprd03.prod.outlook.com
 ([fe80::52c2:88f4:353e:4a44%4]) with mapi id 15.20.6588.028; Tue, 18 Jul 2023
 14:50:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7178b2f5-257a-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=doNSBVwA+n2RDobVX/KoukkdbckOUOKMbHDjUfr19ia7Gyt/PR91wzWAZ/NhIfFaLkVH1EhgDZk0Wz0ufx0S6+sTHf+mPlersLAd4XAdS3QDdhL/MQ2aXJxYWCCIFoCMn3NWbrXjf64uQGS2LlBb+aRi3gLiHCln9RHEIrk01jXH9PsDufI+NBheMxzCBLADCc/ijqYHktS9nohwAbqDXGbsWibuxqOE0lzxvusF0hdKr6ZXD+tPvcPgPebWh7ea/BRPsGaMdJajlhPe9YdDEJWiwX6KJ3IcqmbF1l1DCs97Ewzhc1VFBylfOhcKCvOHC4sE2z7r0o9RPOUh5XHQWQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=iAeKl1E0tZdICBip/bXZYl5P930x+EXVgz1D+2mFUqc=;
 b=gOnavY8kdybcWU4sBLNoedqgB2+yUqqhpC/fJp9gBO6LIEKXaJJkQBrm5h402mQOIg29JT3ubnGrhfmL5JZZMWJwJCzZk8j+kOHNjX+xfgLfXKjYV3zJ3v//0ydKWKR6QqCvEvYavna2ynM/jkk5idd1yV413sR3/Vn8mufvSbf3hNaJUmxGbG3zN3pYM4MjUB75t4gT8lGXlrPfTR3JBYglr+zXqIn4XsaCQF9EUemR02pMa9ddGNoPIVVYu2uK1IqBzNZtqVIdIM1sqOdE3N/1o2XhYw3HOWpCx86aScuHAjO649gjlXPIMLTdf2ZL52AhYyCULMpK9bup67uQmg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=iAeKl1E0tZdICBip/bXZYl5P930x+EXVgz1D+2mFUqc=;
 b=j9Q4Ia6myi3UUtLY6ZvVLrAQg0IkjcyEfBJxUN2sdsbm7P4uMU++7VDXFzplBXcAPsNWauBobM3nWGpWbjxh3onSYEsgi7BgwfUgMCMwq0+auMurDUcomO8aVFBWFPip7VJT/EN+8II/O1sZznQT2529ZiLH80Bk8P4za+wv/b4SsNc80XXjeQS4oOXHjZZjzrOYHUfyQaAvFYM/mrjkmWY53fvXHym9SAT6uLE//g0nJdyxoXS0Tw0HxXLeiCTitPkrg6dqDKFP+GevyfXvejX47kV/zh9Vl4btcTjU8NVpVElgyfdNGGxcqADGcK/e6mG/KQpE8Mpuks1+HoIrrA==
From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
To: Rahul Singh <rahul.singh@arm.com>,
        "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>,
        "linux-kernel@vger.kernel.org"
	<linux-kernel@vger.kernel.org>
CC: Juergen Gross <jgross@suse.com>,
        Stefano Stabellini
	<sstabellini@kernel.org>,
        Boris Ostrovsky <boris.ostrovsky@oracle.com>,
        David
 Woodhouse <dwmw@amazon.co.uk>,
        Jane Malalane <jane.malalane@citrix.com>
Subject: Re: [PATCH v3] xen/evtchn: Introduce new IOCTL to bind static evtchn
Thread-Topic: [PATCH v3] xen/evtchn: Introduce new IOCTL to bind static evtchn
Thread-Index: AQHZuWtmTJj//uCt6EKYgZEjiCdjM6+/m3CA
Date: Tue, 18 Jul 2023 14:50:09 +0000
Message-ID: <9a917f42-1a22-0c75-459e-db30c17dbe78@epam.com>
References: 
 <ae7329bf1713f83e4aad4f3fa0f316258c40a3e9.1689677042.git.rahul.singh@arm.com>
In-Reply-To: 
 <ae7329bf1713f83e4aad4f3fa0f316258c40a3e9.1689677042.git.rahul.singh@arm.com>
Accept-Language: en-US, ru-RU
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM0PR03MB6100:EE_|VI1PR03MB6253:EE_
x-ms-office365-filtering-correlation-id: caf38915-d167-4282-cb13-08db879e48a1
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 lUxIn1vmKNbfRKmq4Gr9xIJdAU12jPqg7Oly1myVIU0oDmYNFT6cZze+I8xhiTeuM0iIP72lx1vJtmtm2tXbghxpZrUVdWI2Pe6sfFHPkhrvmdzZ/fbuuyzunZeAf1H4m6tgnsr2rmXaoGLh0gpfuKxXFXWVRDi6gEipwvIDgxoeCkrWEvdzRN5yDQ30EarUEf4z9LmByoWmSP0Jbpy/7IMQhJdzHqbF1bWJ7qSPUb2nckwgK4Ohepsa0s4Wj2MSEY2v7bIrkFeKjbwSzNM+LO4A9R7ZvcdkqEe5+FR3/MVF3u6gzBZjlGGIbZIqlG9mDaZpS5vsmqcgYkfceS+LAVKLpWj/kjlUbaBbztpvZ37hM5kVPc4PZabu7gqpXmGRAWFekLudB0T5uCU2YpIo5g/sBYU2sBW4uPrk2/fr/Zq/Y/xQz4qaC3pHPj1RDZC/c8XDCOMcaEy/inBzk/8CBAfIzfpswITeuI+oiqkpydRDZm9nrZuiZM6W38souAq1FYenesvzkFoJeven1TDIVVz5aiBE4oQVxZHy3pmO6cZxNp5XSvPmrChhPYKzLyVqGjmJ2FX2fcOsh48jkCmQKrG8RMtRvlh0ZcWeErPMOhHol62BbX/jdbEc35KJu8ahgDmAtDyBjQdi21C1IntYxA==
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR03MB6100.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(366004)(39860400002)(346002)(376002)(451199021)(110136005)(71200400001)(478600001)(6486002)(54906003)(53546011)(186003)(6506007)(6512007)(26005)(2906002)(76116006)(4326008)(316002)(66946007)(66556008)(66446008)(41300700001)(8676002)(36756003)(8936002)(5660300002)(38100700002)(122000001)(64756008)(66476007)(86362001)(31696002)(38070700005)(2616005)(83380400001)(31686004)(45980500001);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?N0Fua0VwQ2sxTi80Q1N1RzZGRzUyaHhlWnFFZFl0MnhiV0ZYMkNlRDdxUVpV?=
 =?utf-8?B?TTJHaS81dDdQNDZnQ0U2MnhnU3dnNEZQcFU3K1RjY0kydVBFL1Q3TUJCSUY3?=
 =?utf-8?B?US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1cz?=
 =?utf-8?B?U2FsYkpDMkYwcXBXQjFHU0FWdjljTS9ORVg5RUFIbGlKbTlGRUM2TXgraHpy?=
 =?utf-8?B?aGpRM2s1M1B2Y0RPdDJlcFk4WkYvdld2YW91OHBwOEJlNWo3RlZFcnM1Ri9t?=
 =?utf-8?B?RFR4d1Y4VGF3RUhpSy9VK0orWlBvUm12aDY3MW4zRG1NdWZROW4rbTdUeEtH?=
 =?utf-8?B?cWQvT3ZFMmRUenM4WnhVR2szeXhpajNYRkszZXVmditqZFE5YjNHeXN3Yk5p?=
 =?utf-8?B?djM1L0V4R2ZkaCtMS2N6Sm5xcmlDZ2NidjhOR3grMGVPcHcyRm80M1d5bktj?=
 =?utf-8?Q?FuaUfqZ9pbbKcZJMom6+Ij4=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <7198593747993140A9F3BE4C3C1F5528@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AM0PR03MB6100.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: caf38915-d167-4282-cb13-08db879e48a1
X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jul 2023 14:50:09.5700
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: LKdTwtwG9Xs+3YlJDAG1cA5rN+9Z2FZOu5yGbjlt62qIJv2gmmzM7492YPta32rsiVht193i2KZdOfeuDRr/buXjEeSRhE7MIy34LdP7Tog=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB6253
X-Proofpoint-ORIG-GUID: eB1JZC6e361mYFByopMRRHvUpxn0tFKW
X-Proofpoint-GUID: eB1JZC6e361mYFByopMRRHvUpxn0tFKW
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-18_11,2023-07-18_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 suspectscore=0
 clxscore=1011 mlxlogscore=880 adultscore=0 malwarescore=0 spamscore=0
 lowpriorityscore=0 priorityscore=1501 bulkscore=0 impostorscore=0
 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307180136

DQoNCk9uIDE4LjA3LjIzIDE0OjMxLCBSYWh1bCBTaW5naCB3cm90ZToNCg0KDQpIZWxsbyBSYWh1
bA0KDQoNCj4gWGVuIDQuMTcgc3VwcG9ydHPCoHRoZSBjcmVhdGlvbiBvZiBzdGF0aWMgZXZ0Y2hu
cy4gVG8gYWxsb3cgdXNlciBzcGFjZQ0KPiBhcHBsaWNhdGlvbiB0byBiaW5kIHN0YXRpYyBldnRj
aG5zIGludHJvZHVjZSBuZXcgaW9jdGwNCj4gIklPQ1RMX0VWVENITl9CSU5EX1NUQVRJQyIuIEV4
aXN0aW5nIElPQ1RMIGRvaW5nIG1vcmUgdGhhbiBiaW5kaW5nDQo+IHRoYXTigJlzIHdoeSB3ZSBu
ZWVkIHRvIGludHJvZHVjZSB0aGUgbmV3IElPQ1RMIHRvIG9ubHkgYmluZCB0aGUgc3RhdGljDQo+
IGV2ZW50IGNoYW5uZWxzLg0KPiANCj4gU3RhdGljIGV2dGNobnMgdG8gYmUgYXZhaWxhYmxlIGZv
ciB1c2UgZHVyaW5nIHRoZSBsaWZldGltZSBvZiB0aGUNCj4gZ3Vlc3QuIFdoZW4gdGhlIGFwcGxp
Y2F0aW9uIGV4aXRzLCBfX3VuYmluZF9mcm9tX2lycSgpIGVuZHMgdXAgYmVpbmcNCj4gY2FsbGVk
IGZyb20gcmVsZWFzZSgpIGZpbGU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dmlld2VkLWJ5OiBPbGVrc2FuZHIgVHlzaGNoZW5rbyA8b2xla3NhbmRyX3R5c2hjaGVua29AZXBh
bS5jb20+DQoNCj4gdjI6DQo+ICAgKiBVc2UgYm9vbCBpbiBwbGFjZSB1OCB0byBkZWZpbmUgaXNf
c3RhdGljIHZhcmlhYmxlLg0KPiAgICogQXZvaWQgY2xvc2luZyB0aGUgc3RhdGljIGV2dGNobnMg
aW4gZXJyb3IgcGF0aC4NCj4gLS0tDQoNCltzbmlwXQ==


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 15:01:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 15:01:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565349.883445 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLmCE-0003oz-GS; Tue, 18 Jul 2023 15:01:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565349.883445; Tue, 18 Jul 2023 15:01:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLmCE-0003os-D8; Tue, 18 Jul 2023 15:01:02 +0000
Received: by outflank-mailman (input) for mailman id 565349;
 Tue, 18 Jul 2023 15:01:00 +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
 <SRS0=CPt9=DE=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qLmCC-0003om-Qm
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 15:01:00 +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 e7388278-257b-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 17:00:58 +0200 (CEST)
Received: by mail-lj1-x231.google.com with SMTP id
 38308e7fff4ca-2b74209fb60so86881931fa.0
 for <xen-devel@lists.xenproject.org>; Tue, 18 Jul 2023 08:00:58 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 f3-20020a2e9183000000b002b6d576a257sm523768ljg.96.2023.07.18.08.00.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 18 Jul 2023 08:00:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e7388278-257b-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689692458; x=1692284458;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=Ekq5+ly99K9g2OqDH2apliH8ruyp0evpLql2eBptRYw=;
        b=FTuBGhGc4sqMyU07fG3u4RyvKl1PT5SYKmStaEI1Hncn0NSHxBF1hBtiXo/eENTbFZ
         KxEPC80h0VdSy+O/4Y594n53zRXV3Dy3LHrymEt6LF52ePyDH7/9h/+IlE9Uzc/PjloI
         PIISVY6tYUEh38nFxP7E8yY0/TtkG6wQGoEEYqYz9CZbFYAg4gmHguNGBWlSB+DaTmbm
         bbb6Zh7cToGwuic4+tQ889RPnnoycpnPgh6LtwzwUJ7df7B2GeBIkc6uBpPZf79Rs+2b
         uHcA2TE/BYVB8bj4qjQuJOWVWXM/25ho13xpXVYwrMu4hUrs2MO87DGK9W/uxDO0ReIK
         /5zQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689692458; x=1692284458;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=Ekq5+ly99K9g2OqDH2apliH8ruyp0evpLql2eBptRYw=;
        b=gb7Jktv5NCMQiyvkABRA8fhWm3BuiD64yZoW2c5JkMZNli73qZyk+Xm8xNui4uE4c5
         rrjmMMehini18WuzuHuXImSMKvKO8wpf/YdIyfugqFluu+9EjfIWXiaXXvSGnUI97uBL
         1nPjs29/MAp9q9IT1ZDY2J6mCXmLRbATmBNiCLqwGtW4Qpoiii6cdx06H4BzSTnr+Llj
         i4iTL6GBk1nUtpD2uTKZiteCtnxTRGnx/NcGrU1rtbGs8eP3pPMls0mPPiC2XwDO9vNK
         PynJm/FrK0kHAPcjyAcrqQrYOJy3bSrwphGZzallD/TcyJ0UNLtD+DV88Gd66xH+vphH
         xTWw==
X-Gm-Message-State: ABy/qLYaZAZbvcoYRll+FL3z/Ko18W/6n85N8nQqiBJ9jTz6ws1zQmwk
	rJMz4QXU/t3nN4dLTL4IfE1qYz0BNjY=
X-Google-Smtp-Source: APBJJlHx5DtZ6CJqBgGxoPE481/e8kNEPj/bVmtbLSYo1V2koapm5c3HGz2HFISg1/LusEe2H/AhsA==
X-Received: by 2002:a2e:9e89:0:b0:2b6:efcf:1463 with SMTP id f9-20020a2e9e89000000b002b6efcf1463mr10923596ljk.6.1689692457768;
        Tue, 18 Jul 2023 08:00:57 -0700 (PDT)
Message-ID: <346bea980c63d3e56429c63566513c535d04d32b.camel@gmail.com>
Subject: Re: [PATCH v2] ns16550: add support for polling mode when device
 tree is used
From: Oleksii <oleksii.kurochko@gmail.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>,  George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
Date: Tue, 18 Jul 2023 18:00:56 +0300
In-Reply-To: <b37b15c6-d7f7-df9d-83c1-337f434a713b@xen.org>
References: 
	<ce821c1c81ba69397047daae0b0e6d44893ec28d.1689689630.git.oleksii.kurochko@gmail.com>
	 <b37b15c6-d7f7-df9d-83c1-337f434a713b@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Tue, 2023-07-18 at 15:23 +0100, Julien Grall wrote:
>=20
>=20
> On 18/07/2023 15:13, Oleksii Kurochko wrote:
> > RISC-V doesn't support interrupts for the time being, so it would
> > be nice to
> > have polling mode.
> >=20
> > The patch assumes that polling mode will be used if there is no
> > interrupt
> > property=20
>=20
> As I asked in v1, please explain that this is allowed by the binding
> and=20
> provide a link for others to verify.
According to 4.2.2 National Semiconductor 16450/16550 Compatible UART
Requirements from The Devicetree Specification v0.4
(=C2=A0https://www.devicetree.org/specifications/ ) interrupts property
should always present.

So if interrupt property doesn't present in serial node then it should
return -EINVAL:
    res =3D platform_get_irq(dev, 0);
    if ( res < 0 )
    {
        printk("ns16550: Unable to retrieve the IRQ\n");
        return -EINVAL;
    }

>=20
> > or the interrupt is equal to some unused UART interrupt number (
> > look
> > at the definition of NO_IRQ_POLL in ns16550.c ).
>=20
> Nack. If you want to use polling mode and yet have an interrupts=20
> property then you should provide the information differently. This
> would=20
> either be via the command line or an extra property in the DT node.
>=20
> If the latter, it would need to be standardized first.
What does it mean 'standardized'? Do you mean that it should updated
The Devicetree Specification?

I am not sure that I know the process of standardization of such stuff
could you please give me any pointers?

It looks like it will be faster to pass it via the command line as
standardization can consume some time...

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 15:03:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 15:03:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565353.883454 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLmEM-0004QY-Vp; Tue, 18 Jul 2023 15:03:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565353.883454; Tue, 18 Jul 2023 15:03:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLmEM-0004QR-TH; Tue, 18 Jul 2023 15:03:14 +0000
Received: by outflank-mailman (input) for mailman id 565353;
 Tue, 18 Jul 2023 15:03:13 +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 <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLmEL-0004QJ-1g
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 15:03:13 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2060c.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::60c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 35d671f6-257c-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 17:03:10 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU0PR04MB9672.eurprd04.prod.outlook.com (2603:10a6:10:31d::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 15:03:09 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 15:03:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 35d671f6-257c-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=mJXFRY/gKQFHqIuxQi0agpIFJ4I4EOEGzyhO8kHc8gKd9LoD3eSGZRhewYHdanlucmtks2Su58Rfe92QLeH9445FzlRIjachn7e2fBT6zbihWXZPnfZoWP27uDlXguSka9RBzWXaIJMfHF71zJIKc4MjY1dhQ36xukqPZXiTnF3pZGMR57ERHsqCdnsaSkGWOLLFwjPuJRpcVGX2FIAKgJWvJaxpeb30d7iTfQFOvLEi5XXd4+pXYlzYPNCYXGZe8lKlfWOfQ9Jt7/RQYGXu5ljTnnIMVuVg4Dmk0GpzCcB8nMUrrobxCLfGWHcqXR1x9DYGu5b6XVe7S6sBcv34PA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=j7XIIjbdxwU5oe6DH9OpvRRjlDoIeHwh7emp9bepywM=;
 b=DG5903gIt8rA6vMubNRnrDSb+AhwWwZ5A59BijA/egvSHpaUSrxUL8xktRJSdKXCSqOxt/I1QuPiAm5BIkK7A3EhgWbcSCVvdkvO4qY9hSbyZ1AMz0wxPGYYopZ8cEnQ0QsKbEebuxg5009o/Yv7Uvkm1wyRIiK+rbo81WOfVwOiiGm+ZYb7cQXvdPjrJYH92Oo+UuIhr6MGsDtf16SasKT86lRsHReBPj514ttsftMEVtgnLqsQXL0YSQsM/bc07ZP0hmzULHsF18tHOPSAMkLFgn5jnV0lmV4mPLwhqbFO9Q8cLhtas2lWMpERIf4STDKzMjFzJGoJNsUoeEMiog==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=j7XIIjbdxwU5oe6DH9OpvRRjlDoIeHwh7emp9bepywM=;
 b=16534d1JiAMRG5NlRJPn+F7IbMNGAWOD2FjxijXyKjVkTCUKTA4LAx4DCyOZrOaITaeOZHXGNQrF7AQwSXY9V0tbzkG1VMc5/UJwVnnOQuoEvQaP6BFzXATrN5+BxKQO0aDU+HKY1qb4AJTz+n0NkTrHswiJzAaU6A6WuWnomU61uo5kg8uyDU7fWaGHeD5/nGKs62JTeChrQUvq82pRpUqFWcT7AAhT+TGDbKMMa4TQ8tZCzzKILLOc1dKdcfeVDVoH8XBDLH7VccfZznZCKQnrO1kwvGmABXhsNpAhXnUhkoc57G/EwrgJ8Hgo0+pYq9icicOG8jpvIwPSJStmQQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ad53c037-3c1b-ff1a-93df-b79ab2948174@suse.com>
Date: Tue, 18 Jul 2023 17:03:06 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping
Content-Language: en-US
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1689604562.git.oleksii.kurochko@gmail.com>
 <8c69050d7b1f42df5e776ca9494164a4d15f2d52.1689604562.git.oleksii.kurochko@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <8c69050d7b1f42df5e776ca9494164a4d15f2d52.1689604562.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: AM6PR10CA0043.EURPRD10.PROD.OUTLOOK.COM
 (2603:10a6:209:80::20) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU0PR04MB9672:EE_
X-MS-Office365-Filtering-Correlation-Id: 071fcd4b-50e1-4c4c-60de-08db87a0192c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	k/uZ/n7FtTC46KfM6fcE6k+lgDhKPMTz0zF+s0zk2d0y3rTzVWN718GrWBUbLmnK5wCu+41FdSt3booIUSM55x1L55golOl9iWRyv0x5WZh0agKr2rIPMAKi715aREmQcNXNLryjtbtJ363bbPhgtLhFsjgdLCkLT9C22a+paDUUyAEQrF/6wLwfIcuNFA21y+jQYcNcgMkdgmLOSZlCYLgetalje1xwOg61mkybkUV50eqkq7ETHDRyQqVRPnGxMdaVh9WVtRIeeI8pxy/C2YgHa3rZzko9tdYZ8vRXVAImJkco/6D5VsyetWNC+PhDX4dX05BRtjWFJng4mepQi+c6ve66XYlOLM63xUlCv2MpT8HArCUvc9gS/xhThTT7nJ4ngqPv0jTw04nh5qWK5NlMp5XAupWkaiadbR4F810L4Uk5kTNoZPkYyPDhO7ldWaEzSDoptXe++cnWimfhqTOV6or1anXMIA8MFFeeM4Z13vDG8//XE7UEO9TcLyvCCbcMWtyuGe5jvF0/DJsfUrGTwUdbqA2KfwMuSdyhLlrInwDc7WLp8va/uEM5Zg6LgMtqWIk933m+ajVUNKVo4HR70Aj1S1dOsdOWR4roPKbpPTsGanbJz53KM4OjB9cPh+DohQTSjO/rPEYk4wpwvw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(376002)(136003)(346002)(39860400002)(366004)(451199021)(6666004)(6486002)(478600001)(36756003)(8936002)(2906002)(8676002)(5660300002)(54906003)(86362001)(6916009)(66556008)(4326008)(38100700002)(66476007)(66946007)(53546011)(41300700001)(2616005)(316002)(6506007)(31696002)(26005)(31686004)(83380400001)(186003)(966005)(6512007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bzlhUXg0K01NTy81TDdnUitPYWJ4ekxlQnFiNXJkYjJmSGRMZkNwNXFjR3Nk?=
 =?utf-8?B?MUVIZ0JpNVJhN3hSRWNYMERZODZXblo5OXlJY1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TJIWWpIZ244ZmVKUjd1Mm80MnN1R05LRnhoYjNF?=
 =?utf-8?B?ZG1sZFNjQUk3aDFOTWVpLzNyQUpyLzdQQ2NmNkEySWw5Q21rZnVqOXU4ejJR?=
 =?utf-8?B?MHg3aVBGam8zZE0wSGNHc1pJMzRvYWtWaVFzZU9kNmx4QVhBcjJuVUdnUnM0?=
 =?utf-8?B?bVRWS0tkZ1pvRXc5L0N1SVBqTTdTS1NsVVM4RjRNZjl1REJGZE9tNEhDRit2?=
 =?utf-8?B?ZHhCZTdRRi9PQ0VmM3htU09KREJhM2V2Z2F6R1NoT1JKOVJYMlFGS3JlRWlj?=
 =?utf-8?Q?OZWZEhl7a3RQBItg3Iy8rMSlq?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 071fcd4b-50e1-4c4c-60de-08db87a0192c
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 15:03:09.0773
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 9mLTG2531Jc0+yddDWjdXpza4zYZ79LDWR56iJr1aIEu5u8fLd1V0mJxYcfGqX2S0Mf1qz/ZjxP+mlMOP4yLXg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9672

On 17.07.2023 16:40, Oleksii Kurochko wrote:
> The way how switch to virtual address was implemented in the
> commit e66003e7be ("xen/riscv: introduce setup_initial_pages")
> isn't safe enough as:
> * enable_mmu() depends on hooking all exceptions
>   and pagefault.
> * Any exception other than pagefault, or not taking a pagefault
>   causes it to malfunction, which means you will fail to boot
>   depending on where Xen was loaded into memory.
> 
> Instead of the proposed way of switching to virtual addresses was
> decided to use identity mapping of the entrire Xen and after
> switching to virtual addresses identity mapping is removed from
> page-tables.
> Since it is not easy to keep track where the identity map was mapped,
> so we will look for the top-most entry exclusive to the identity
> map and remove it.

Doesn't this paragraph need adjustment now?

> --- a/xen/arch/riscv/mm.c
> +++ b/xen/arch/riscv/mm.c
> @@ -25,6 +25,12 @@ unsigned long __ro_after_init phys_offset;
>  #define LOAD_TO_LINK(addr) ((unsigned long)(addr) - phys_offset)
>  #define LINK_TO_LOAD(addr) ((unsigned long)(addr) + phys_offset)
>  
> +/*
> + * Should be removed as soon as enough headers will be merged for inclusion of
> + * <xen/lib.h>.
> + */
> +#define ARRAY_SIZE(arr)		(sizeof(arr) / sizeof((arr)[0]))

Like said to Shawn for PPC in [1], there's now a pretty easy way to
get this macro available for use here without needing to include
xen/lib.h.

[1] https://lists.xen.org/archives/html/xen-devel/2023-07/msg01081.html

> @@ -35,8 +41,10 @@ unsigned long __ro_after_init phys_offset;
>   *
>   * It might be needed one more page table in case when Xen load address
>   * isn't 2 MB aligned.
> + *
> + * CONFIG_PAGING_LEVELS page tables are needed for identity mapping.
>   */
> -#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) + 1)
> +#define PGTBL_INITIAL_COUNT (CONFIG_PAGING_LEVELS * 2 + 1)

Where did the "- 1" go?

> @@ -255,25 +266,40 @@ void __init noreturn noinline enable_mmu()
>      csr_write(CSR_SATP,
>                PFN_DOWN((unsigned long)stage1_pgtbl_root) |
>                RV_STAGE1_MODE << SATP_MODE_SHIFT);
> +}
>  
> -    asm volatile ( ".p2align 2" );
> - mmu_is_enabled:
> -    /*
> -     * Stack should be re-inited as:
> -     * 1. Right now an address of the stack is relative to load time
> -     *    addresses what will cause an issue in case of load start address
> -     *    isn't equal to linker start address.
> -     * 2. Addresses in stack are all load time relative which can be an
> -     *    issue in case when load start address isn't equal to linker
> -     *    start address.
> -     *
> -     * We can't return to the caller because the stack was reseted
> -     * and it may have stash some variable on the stack.
> -     * Jump to a brand new function as the stack was reseted
> -     */
> +void __init remove_identity_mapping(void)
> +{
> +    unsigned int i;
> +    pte_t *pgtbl;
> +    unsigned int index, xen_index;
> +    unsigned long load_start = LINK_TO_LOAD(_start);
> +
> +    for ( pgtbl = stage1_pgtbl_root, i = CONFIG_PAGING_LEVELS; i; i-- )
> +    {
> +        index = pt_index(i - 1, load_start);
> +        xen_index = pt_index(i - 1, XEN_VIRT_START);
> +
> +        if ( index != xen_index )
> +        {
> +            /* remove after it will be possible to include <xen/lib.h> */
> +            #define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))

ROUNDUP() is even part of the patch that I've submitted already.

> +            unsigned long load_end = LINK_TO_LOAD(_end);
> +            unsigned long pt_level_size = XEN_PT_LEVEL_SIZE(i - 1);
> +            unsigned long xen_size = ROUNDUP(load_end - load_start, pt_level_size);
> +            unsigned long page_entries_num = xen_size / pt_level_size;
> +
> +            while ( page_entries_num-- )
> +                pgtbl[index++].pte = 0;
> +
> +            break;

Unless there's a "not crossing a 2Mb boundary" guarantee somewhere
that I've missed, this "break" is still too early afaict.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 15:12:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 15:12:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565356.883465 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLmMe-000666-QN; Tue, 18 Jul 2023 15:11:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565356.883465; Tue, 18 Jul 2023 15:11:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLmMe-00065z-Mg; Tue, 18 Jul 2023 15:11:48 +0000
Received: by outflank-mailman (input) for mailman id 565356;
 Tue, 18 Jul 2023 15:11:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qLmMd-00065t-4H
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 15:11:47 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLmMc-0003j3-1k; Tue, 18 Jul 2023 15:11:46 +0000
Received: from [15.248.2.157] (helo=[10.24.67.41])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLmMb-00059k-S2; Tue, 18 Jul 2023 15:11:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=5cjKGiRV0bGIIpodIFBH2Ro7CfW2RtTn25viqyVxa44=; b=67vBu0nABq779f2lMZ2YMcz6kF
	+rV9a3vGS/4Oa784AI7btuSNy7odDPZ+WBKTonZ/xd3qr2Rqaa3fPfMRqkyQgB5nUX2Zc0NwAgE1T
	CJqyPHGV3X5+k7N4c2C6r+yV5WLkdsNdzPrv9bpMGmF9snN1URUZn7vh8vUBlarhhD00=;
Message-ID: <9abe0edb-6bc4-0270-a0bd-88634caed88c@xen.org>
Date: Tue, 18 Jul 2023 16:11:44 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2] ns16550: add support for polling mode when device tree
 is used
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>, xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
References: <ce821c1c81ba69397047daae0b0e6d44893ec28d.1689689630.git.oleksii.kurochko@gmail.com>
 <b37b15c6-d7f7-df9d-83c1-337f434a713b@xen.org>
 <346bea980c63d3e56429c63566513c535d04d32b.camel@gmail.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <346bea980c63d3e56429c63566513c535d04d32b.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 18/07/2023 16:00, Oleksii wrote:
> On Tue, 2023-07-18 at 15:23 +0100, Julien Grall wrote:
>>
>>
>> On 18/07/2023 15:13, Oleksii Kurochko wrote:
>>> RISC-V doesn't support interrupts for the time being, so it would
>>> be nice to
>>> have polling mode.
>>>
>>> The patch assumes that polling mode will be used if there is no
>>> interrupt
>>> property
>>
>> As I asked in v1, please explain that this is allowed by the binding
>> and
>> provide a link for others to verify.
> According to 4.2.2 National Semiconductor 16450/16550 Compatible UART
> Requirements from The Devicetree Specification v0.4
> (Â https://www.devicetree.org/specifications/ ) interrupts property
> should always present.

I don't read the spec the same way as you. The property is marked as 
'OR' which means the property is optional but recommended.

Therefore, what you just wrote is enough to justify why we can relax the 
check.

>>
>>> or the interrupt is equal to some unused UART interrupt number (
>>> look
>>> at the definition of NO_IRQ_POLL in ns16550.c ).
>>
>> Nack. If you want to use polling mode and yet have an interrupts
>> property then you should provide the information differently. This
>> would
>> either be via the command line or an extra property in the DT node.
>>
>> If the latter, it would need to be standardized first.
> What does it mean 'standardized'? Do you mean that it should updated
> The Devicetree Specification?

I mean that the binding for the ns16550 in 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings 
should be updated.

I will not accept any code in Xen which use properties that have not 
been accepted by the Linux/Device-Tree community. Unless this is a 
binding "owned" by Xen (e.g. the nodes for dom0less).

> 
> I am not sure that I know the process of standardization of such stuff
> could you please give me any pointers?

In general, this is sending an e-mail to the device-tree mailing with 
your proposal in the form of a patch.

> 
> It looks like it will be faster to pass it via the command line as
> standardization can consume some time...

Well yes. But as usual, it depends on your end goal. For instance, we 
would not want to describe the HW on the command line.

Thinking a bit more, in this case, the command line option is probably 
best because you want to override what's describe in the firmware table.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 15:22:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 15:22:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565365.883474 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLmWU-0007lf-NW; Tue, 18 Jul 2023 15:21:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565365.883474; Tue, 18 Jul 2023 15:21:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLmWU-0007lY-Kx; Tue, 18 Jul 2023 15:21:58 +0000
Received: by outflank-mailman (input) for mailman id 565365;
 Tue, 18 Jul 2023 15:21:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLmWT-0007lS-AE
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 15:21:57 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2055.outbound.protection.outlook.com [40.107.7.55])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d4b56a70-257e-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 17:21:56 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB8041.eurprd04.prod.outlook.com (2603:10a6:10:1e2::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Tue, 18 Jul
 2023 15:21:27 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 15:21:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d4b56a70-257e-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CoVYgoBBYtoQ5RUq34+BDhixwwsFn+5e+Y8Ds13zX5XaFGS/nq+0sE/JMI4X7vALbdrytjrRVNUNI97ujWZ4YP9VTKfxrjB3U4JyUvExzakhe6GybN9CQOUgE5fSGfo2zEPOHWHC/gKh0Dy+3CRE9aINgmNPeqRcUuHBJGOJpTF9pO6JMVkyPgKlUY4G1+H9hn1w3n+zi6HZnJs/Ku5W0zYZjmMDnSu2fGGWdzUD2WYcVys+TP3IBpjeeZo59R02SPY3KlhAAqP6HD5qB0TV09Ewp8RpNgrokq30kVDdiuLs/jGJLYtR7jdnHKFGFeb88PGV3u+113kbJE6yUyvKGg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=uaB69kRt5wfhuIYifwZmcoRhtyVlFv1rZm0xo+VxziE=;
 b=KXhfP90DqYX7JYxBBYXqNqeTiIfJW382od55oZ1QqPZnxutUOeYIijAEaGLJTi8KAhNQoN28oam0AiQhHr/xb7kykuAGpA2kIrv9+5T7wqQ3jqPjL8Zg2uQ1FmpNRxpoF3Po3zdHbN3TFgLcwhCp6H7sCUPvimZA2vcBEX8m+F4heTOCk+zV4o7qXAWlj2W/pm2Ni1OY8T3yen+dHhAvPKtObE8uDiKhDLkRajAY5BxrjX6VZAlsqrkPggluaU5LiceBoF4jItKjnTYvmFoihUCrV4ocUTlv8PLZazWADtC4zTcMTU6+sxpmOWmSIoQ9akknT+6yXVwJgGZaG/SiLQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=uaB69kRt5wfhuIYifwZmcoRhtyVlFv1rZm0xo+VxziE=;
 b=YXIi9jUjFm42twaMs3ktfiN8pjBU9vkxOlU6SaQbOZ9QSstSCTnR2h2b8N7dUxol7EpKFn3bpy2UBhYOmMbM/eM+eIiy/ulwndE6F7CLD1jiv6egsHYxGHDqX9exaiU9rTP8vSEuD9B1ay+dzT0hJUXFD98zXakyMQGN+r1LwSS7ohiGZX2XYZmbec51oCW5IpDN8auD463XlFRVE/H4nyRjNYrGwYR/NY78yqKAIWFFhz37R/u8kytZX+sAD6/YcjKryKPKkPlOO8qvBL2OY0E1X3W3TiQUm4ciSKwYdqKmfr77eRvCjaK0gNtcbBblCZfDsmHlcVA//pclb0KZeg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <10f37ea5-7fa5-976f-3e7b-fc675db20ec0@suse.com>
Date: Tue, 18 Jul 2023 17:21:25 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC XEN PATCH] x86/mwait-idle: Use ACPI for CPUs without
 hardcoded C-state table
Content-Language: en-US
To: Simon Gaiser <simon@invisiblethingslab.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
References: <aef138a50aaa769fceb2002dd56de437f1b8c456.1689674757.git.simon@invisiblethingslab.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <aef138a50aaa769fceb2002dd56de437f1b8c456.1689674757.git.simon@invisiblethingslab.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0003.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB8041:EE_
X-MS-Office365-Filtering-Correlation-Id: ccd3eed3-55dc-4f6e-ce8f-08db87a2a78a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	gtOX+v4eZbEf4Vf+3c156CDhgUkjvZ9VDzdXE5pA2txx92E/B4IzXCcKX22p0n3rs/yn4nJR4/zvzpBsM1+nL5GheR8yk/OAYfb2YAiCWcAZS7i+EOGCYpdWBCCR87iK+eALRN/TIPfh9YUuRRedRjPXje2UVO0LH8TxZd7QpkzTEUMBPebMu0ISRaWFJltmZB/WqSUu0ZskZHKfUk7HAnZqh9mfV3XD/OWKy9xyMaiKxa4NMWP5QK/kNhEK7FXOXXAb3ov2CtOdr/tENtuVhg4DvCmJo7ioIOVXfo9NXi+GCLppeeaHbHED8WByPhHvpKTQ+iaW2s+Aovq3puQgKl1kWL6Wmqp7m29sLT6/fCQncFLRD4sa60xomJ4ZwvS4ndrOfPg6Q79oD7tUKePFMfE/7cKk3ljf6hUmD/UvC50fF5GhICm3aOcUwUXTcRyMtVxA1q6m8LI9B/TCZFwR381vuSeg+zIvPfdxvgP+OGw/1BanYwOtCM00VWcNqu6WaH/AA9QMQcmfhnkT/njPOijmazFYbadV3KRJYDdKYK5LZDoLBPufjr14A8p6bn12EI8DzdowbGidJCJYbhP6yWmaDKLv1rGt+g6XnSKqEgr7Qo35CAqt+FOG+kdoPUAldzaErS8OPktVKyLp/Nixjg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(136003)(39860400002)(376002)(346002)(451199021)(86362001)(2906002)(31696002)(36756003)(31686004)(186003)(83380400001)(26005)(6506007)(53546011)(6486002)(54906003)(478600001)(66476007)(6512007)(6916009)(66556008)(4326008)(66946007)(38100700002)(316002)(41300700001)(2616005)(5660300002)(8676002)(8936002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?c0thcGRoZjVka3dwTFlUaTArSWVoV1lmNWhXaDIySzlIWHVDREdvZ3J1UjFy?=
 =?utf-8?B?d1lCRUh0ck0vQ2dwZUJkbEcvZ2hBWG9Jck1BbFA3UjhtcE5zb1R1bVlJT1du?=
 =?utf-8?B?RTZIa3Z0SkVocnUrSVJ0MGZ2UzkzeVhmTXplRzhSWDJMSVp6aUUzUy9oMzBO?=
 =?utf-8?B?dTB0eFVvNC9adWxFL2pRdmsyWnQxV05VYWdoZFFsaVFqN1VpcFZGUWVQZWtV?=
 =?utf-8?B?aUF6dll4Slc4Z0RvNEd6Q1V3QWs3cjB6L0VmM0RsdW9LQ3ZrSFlDVkZHYXUy?=
 =?utf-8?B?c3Q0bjJ5c2RrRzF5ellPYjRsaE9jSjlKbEJyM3IxZFRJL1huRms4S0JGT2hm?=
 =?utf-8?B?VC9xYmltS0RIYXg3d2Nnakdwd1NWNkVLdlRlUi9IekMybTRoT2NKTVpkeXds?=
 =?utf-8?B?Ni90NURqNWRFeW5QdE5hY216RTQ5ajFSeEtmTUtoZThkUDRzRk5pS3F3ZTRa?=
 =?utf-8?B?RjJWaDJRdjZUaXFoblJBZXZwVjViQXk5OUdwSGtTZ0dlbDArSGtLUkZFekYr?=
 =?utf-8?B?WTV6YlZIWlJ2R093aWZNQmNFMGV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C9yOS9T?=
 =?utf-8?B?M0NTb2dwd1ViWTgybXRlNmdlMUJSVEdhNzdGVVVBamNQVndFWE5XSXdpNkdj?=
 =?utf-8?B?VHVKN1ZGWWYxT0hvZC9MZ1JGK3cvOVE1T0cxUWRjVGVycVZLcmlXTXB2dlFy?=
 =?utf-8?B?ajJ1cWZ3Ny9CeFVwSUZ1c0dzaXkvUXc1Um03YVQyT2t5LzdZT1Z4NnNJVzh4?=
 =?utf-8?B?Q3dKOFBhMTNxVTlLemNjQnV5K3Y1QWRHS1hSQ1FBcjhyalN2ZCt5SjFFRGRq?=
 =?utf-8?B?UjFuODRVYVRDMHFsWENxUmsrYWZuekVzTy9BT2hYZU4rSlR2ZG5HOFp5WHM4?=
 =?utf-8?B?NzcyaVVCN05jNWFLVGVwMkFrYW40cU53M2dPYkMyTEZtY0lKQVBwc04rNlRh?=
 =?utf-8?B?YndMRHkrUXA5YXhsdmRNZEpYMk9wMEdQTlVZMG9DYWJqcDlhcEYzNHRYbFpn?=
 =?utf-8?B?SHczeGYvcDhJYjhETWhPUDFtTEo5N2dvQ3lLbURnQ29ZREUvL1gvQXJEV1RT?=
 =?utf-8?B?Y3RiemVDWHBveG0vVWdFOGxRWE5vWHlZS2VSUFRZcW84VWdrcVJwNWMxdmpj?=
 =?utf-8?B?MytrVkdrbXpjU3dLUlorYzRyOW8zU2JSaTgzYjBtZFQvWW96dTcxKzZhc2o3?=
 =?utf-8?B?R3ZuaFhsc3FaQzZPamlNUDgxSHIrNFNIY2FLQnBlTmNORWZsb2ZONUZnRHJ0?=
 =?utf-8?Q?SKdNZ25y392tq5mQm3vAcgCbz?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ccd3eed3-55dc-4f6e-ce8f-08db87a2a78a
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 15:21:26.9384
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: EEV+cR0oavV2h71l4W75UCtzsHnVwYXiOd4t2k+Kr+3fHMuZ8im1uQCIAvu2BWzuWLoWuQHV1CE2ySgJ/B3J+w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB8041

On 18.07.2023 13:04, Simon Gaiser wrote:
> mwait-idle includes a hardcoded config for many CPUs. But some are
> missing, for example Tiger Lake. Linux' driver reads the config from
> ACPI in those cases. This adds this to Xen's implementation.
> 
> The Linux driver also has a feature to combine the internal table with
> the infos from ACPI. This is not implemented here, for CPUs with
> internal config nothing is changed.
> 
> Signed-off-by: Simon Gaiser <simon@invisiblethingslab.com>
> ---
> 
> Sending this as RFC to get feedback on implementing it this way. I tried
> to keep this change small and to avoid changing the existing code path
> for CPUs with a config included in the driver. On the other hand this
> makes it look a bit hacky.
> 
> I'm not quite sure if initializing mwait-idle in set_cx_pminfo this way
> is correct. For example set_cx has some smp_wmb call I'm not sure when
> it's needed, so might be very well missing something.
> 
> What also surprised me is that the existing code in mwait-idle first
> calls cpuidle_current_governor->enable(processor_powers[cpu]) and later
> setup the C-state config in processor_powers[cpu]. This seems the be the
> wrong order (but, I think, current not important since
> menu_enable_device doesn't use that part of the struct).
> 
> When I brought up the topic of this patch the first time Jan had an
> interesting questions [1]:
> 
>> It hasn't become clear to me why Linux now has two CPU idle drivers
>> consuming ACPI data (intel_idle and the purely ACPI-based one).
> 
> I'm not quite sure either. Linux' intel_idle.c states:
> 
>     intel_idle is a cpuidle driver that loads on all Intel CPUs with
>     MWAIT in lieu of the legacy ACPI processor_idle driver.  The intent
>     is to make Linux more efficient on these processors, as intel_idle
>     knows more than ACPI, as well as make Linux more immune to ACPI BIOS
>     bugs.
> 
> The commit that first added ACPI support to the Linux driver [2] says:
> 
>     The main functional difference between intel_idle with this change
>     and the ACPI processor driver is that the former sets the target
>     residency to be equal to the exit latency (provided by _CST) for
>     C1-type C-states and to 3 times the exit latency value for the other
>     C-state types, whereas the latter obtains the target residency by
>     multiplying the exit latency by the same number (2 by default) for
>     all C-state types.  Therefore it is expected that in general using
>     the former instead of the latter on the same system will lead to
>     improved energy-efficiency.
> 
> This sounds less impressive and doesn't explain why not to just change
> the standard ACPI driver to use the better latency settings. On the
> Linux what might play also a role is that the mwait driver also gained
> the option to combine the internal settings with what it reads from
> ACPI. That would be probably harder to include in the generic ACPI
> driver.
> 
> This also raises the option to change the latency setting in Xen's
> generic ACPI driver for the affected CPUs instead of touching
> mwait-idle.
> 
> Currently I'm interested in this driver mainly for S0ix support. I did
> nearly all my testing while using the mwait-idle driver to keep
> differences to Linux as small as possible. (At first by hacking in some
> config for the Tiger Lake CPU of my test system. Now with this patch.).
> At some point I observed worse S0ix residency with Xen's generic ACPI
> idle driver than with mwait-idle. But when I tried to reproduce this for
> writing this e-mail I wasn't able to reproduce this measurement and got
> the same residency for both idle drivers. So either I did messed up my
> previous measurements or I have some unaccounted changes in my test
> setup.

Taking all together perhaps more of an argument to see about making
the ACPI driver better. If with the same ACPI data the mwait-idle
one can (maybe) achieve better results, surely there's a way for the
ACPI driver to achieve the same, likely with less of a change?

Therefore only a few basic comments.

> @@ -1360,24 +1381,27 @@ long set_cx_pminfo(uint32_t acpi_id, struct xen_processor_power *power)
>          set_cx(acpi_power, &xen_cx);
>      }
>  
> -    if ( !cpu_online(cpu_id) )
> -    {
> -        uint32_t apic_id = x86_cpu_to_apicid[cpu_id];
> -
> -        /*
> -         * If we've just learned of more available C states, wake the CPU if
> -         * it's parked, so it can go back to sleep in perhaps a deeper state.
> -         */
> -        if ( park_offline_cpus && apic_id != BAD_APICID )
> -        {
> -            unsigned long flags;
> -
> -            local_irq_save(flags);
> -            apic_wait_icr_idle();
> -            apic_icr_write(APIC_DM_NMI | APIC_DEST_PHYSICAL, apic_id);
> -            local_irq_restore(flags);
> +    if ( cpu_id == 0 && pm_idle_save == NULL ) {
> +        /* Now that we have the ACPI info from dom0, try again to setup
> +         * mwait-idle*/
> +        ret = mwait_idle_init(&cpu_nfb, true);
> +        if (ret >= 0) {
> +            unsigned int cpu;
> +            /* mwait-idle took over, call it's initializer for all CPUs*/
> +            for_each_present_cpu ( cpu )
> +            {
> +                cpu_nfb.notifier_call(&cpu_nfb, CPU_UP_PREPARE, (void *)(long)cpu);
> +                cpu_nfb.notifier_call(&cpu_nfb, CPU_ONLINE, (void *)(long)cpu);
> +                if ( !cpu_online(cpu) ) {
> +                    repark_cpu(cpu);
> +                }
> +            }

Is this safe against a CPU coming online or going offline?

> --- a/xen/arch/x86/cpu/mwait-idle.c
> +++ b/xen/arch/x86/cpu/mwait-idle.c
> @@ -71,13 +71,15 @@
>  #undef PREFIX
>  #define PREFIX "mwait-idle: "
>  
> +#define pr_err(fmt...) printk(KERN_ERR fmt)
> +
>  #ifdef DEBUG
>  # define pr_debug(fmt...) printk(KERN_DEBUG fmt)
>  #else
>  # define pr_debug(fmt...)
>  #endif
>  
> -static __initdata bool opt_mwait_idle = true;
> +static bool opt_mwait_idle = true;
>  boolean_param("mwait-idle", opt_mwait_idle);

The variable still isn't written post-boot, is it? If so, you
want to use __ro_after_init rather than dropping the placement
attribute altogether.

> @@ -92,7 +94,7 @@ static unsigned int mwait_substates;
>   * exclusive C-states, this parameter has no effect.
>   */
>  static unsigned int __ro_after_init preferred_states_mask;
> -static char __initdata preferred_states[64];
> +static char preferred_states[64];
>  string_param("preferred-cstates", preferred_states);

Same here, I suppose.

> @@ -1151,6 +1153,9 @@ static const struct idle_cpu idle_cpu_snr = {
>  	.c1e_promotion = C1E_PROMOTION_DISABLE,
>  };
>  
> +static struct idle_cpu __read_mostly idle_cpu_acpi = {
> +};

No need for an (empty) initializer.

There are also numerous style issues throughout the patch, which would
want correcting in case there's a convincing argument towards going
this route.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 15:28:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 15:28:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565372.883485 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLmcR-0000Bh-Hh; Tue, 18 Jul 2023 15:28:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565372.883485; Tue, 18 Jul 2023 15:28:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLmcR-0000Ba-Ds; Tue, 18 Jul 2023 15:28:07 +0000
Received: by outflank-mailman (input) for mailman id 565372;
 Tue, 18 Jul 2023 15:28:05 +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
 <SRS0=CPt9=DE=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qLmcP-0000BR-PK
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 15:28:05 +0000
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com
 [2a00:1450:4864:20::132])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id afe69c2a-257f-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 17:28:03 +0200 (CEST)
Received: by mail-lf1-x132.google.com with SMTP id
 2adb3069b0e04-4fb7b2e3dacso9535744e87.0
 for <xen-devel@lists.xenproject.org>; Tue, 18 Jul 2023 08:28:03 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 a10-20020a056512020a00b004fdc7543ab9sm482954lfo.229.2023.07.18.08.28.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 18 Jul 2023 08:28:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: afe69c2a-257f-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689694083; x=1692286083;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=JiW2EnlDfyx9QIBWLGdkYtMADSfm/h1wex3dVbp4WVQ=;
        b=sLp00NYACHprxahouCKAMmMb82X+R59ReDSGt1MVLnfh0IThSeKvT87psZRfDjad1g
         z3jEAkL0HxXfUzRbawtRDMIezJaWFu5eGIAs/7uCWwjruEf7Gsz7/lvwJ5pZtzogITk6
         RlMMduCmj1DjC9x7h36wZbIG1FYnWnPf3zm17avK5jrqpPUSxBKDj1CXf9q+UOpPXn5a
         XEBqEVvMAjQNjmE8OYsepjT+PeVzAnHsQrr/sf/RJMldd00IKbfjvFtR0NqNEDyRQjiK
         If5wA0GCnx9dofwCyJMkGTbZzlDRopqTfBvbJzMK33CrnPeZc+6M3cAn1QaySLBrBiAN
         lqkA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689694083; x=1692286083;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=JiW2EnlDfyx9QIBWLGdkYtMADSfm/h1wex3dVbp4WVQ=;
        b=TCE2EoK42bhxBzzvfsGqU+zMujpD3WGs17ROBlchukQXFUPvAUdXaZ4z9L83x74ERJ
         mCj/tNS1LOHOo36/D5DAHjhfmlFLQDJnq6aBuhMwYGa+mqGtkZiu38pBq9oS6OMjRxU/
         X6N4Gsc76v3TwaxfyoYi6eclW63lHMfAVic2H3A1qMBUqG9Z+hzCddF7LzVhhN5hnHOT
         8UeGgADhjPHp1jJEvJGCVcPOb3cqwmK5BgY5Oqxi/+mqyVeES6Mn7q9mDGT5hwXktNpL
         qDL9zF0GPnCjRjipTYhpJt2VCCYL90N8Uyx7oW6mpfFP65X8Lb9hWAvP1AWpfTZQgSCP
         lEzA==
X-Gm-Message-State: ABy/qLa+uNojqeEkSRGF0LnLWJlM08D8ZRYOBPkyXn9icIpx9qV/Qq8O
	cV25tUrcRFTwBa55LZRWJV3eMEwlHQE=
X-Google-Smtp-Source: APBJJlEBC3Ee/TFE0wbWhoqLzZXoM3geMcKfEL7Bp91hw1hW7AoQ4ODZ3QXhM/bAzZjyzLyZUUSSzw==
X-Received: by 2002:ac2:4da3:0:b0:4f8:6e52:68ae with SMTP id h3-20020ac24da3000000b004f86e5268aemr10176097lfe.31.1689694082762;
        Tue, 18 Jul 2023 08:28:02 -0700 (PDT)
Message-ID: <77182d4831ad99a261cec4053cf6f52713900f2b.camel@gmail.com>
Subject: Re: [PATCH v2] ns16550: add support for polling mode when device
 tree is used
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Julien Grall <julien@xen.org>, Andrew Cooper
 <andrew.cooper3@citrix.com>,  George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, 
 xen-devel@lists.xenproject.org
Date: Tue, 18 Jul 2023 18:28:01 +0300
In-Reply-To: <449e1832-83f8-a8c6-6137-7d161ac60fe4@suse.com>
References: 
	<ce821c1c81ba69397047daae0b0e6d44893ec28d.1689689630.git.oleksii.kurochko@gmail.com>
	 <449e1832-83f8-a8c6-6137-7d161ac60fe4@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Tue, 2023-07-18 at 16:40 +0200, Jan Beulich wrote:
> On 18.07.2023 16:13, Oleksii Kurochko wrote:
> > --- a/xen/drivers/char/ns16550.c
> > +++ b/xen/drivers/char/ns16550.c
> > @@ -40,6 +40,8 @@
> > =C2=A0#include <asm/fixmap.h>
> > =C2=A0#endif
> > =C2=A0
> > +#define NO_IRQ_POLL 0
>=20
> Do you really need this? I ask because ...
>=20
> > @@ -595,7 +603,9 @@ static void __init cf_check
> > ns16550_endboot(struct serial_port *port)
> > =C2=A0static int __init cf_check ns16550_irq(struct serial_port *port)
> > =C2=A0{
> > =C2=A0=C2=A0=C2=A0=C2=A0 struct ns16550 *uart =3D port->uart;
> > -=C2=A0=C2=A0=C2=A0 return ((uart->irq > 0) ? uart->irq : -1);
> > +
> > +=C2=A0=C2=A0=C2=A0 return (((uart->intr_works !=3D polling) && (uart->=
irq >=3D 0)) ?
>=20
> ... you now use >=3D here, which includes that special value. As long
> as intr_works is always set to "polling", the particular value in
> uart->irq shouldn't matter (and hence you wouldn't need to store
> anywhere that or any other special value).
You are right it should matter what is the value of uart->irq in case
when polling mode is set.
>=20
> > @@ -1330,9 +1340,12 @@ pci_uart_config(struct ns16550 *uart, bool_t
> > skip_amt, unsigned int idx)
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * as special only for X86.
> > =C2=A0=C2=A0=C2=A0=C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0 if ( uart->intr_works =3D=3D polling )
>=20
> Careful here - we may also have read 0 from PCI_INTERRUPT_LINE, or
> forced 0 because we read 0 from PCI_INTERRUPT_PIN. All these cases,
> unless provably broken, need to continue to function as they were.
Missed that it should be if (( uart->intr_works =3D=3D polling ) || !uart-
>irq).
>=20
> Further you alter parse_positional(), but you leave alone
> parse_namevalue_pairs(). I think you're changing the admin (command
> line) interface that way, because so far "irq=3D0" was the way to
> request polling. While it may be unavoidable to change that interface
> (which will then need noting in ./CHANGELOG.md), you still need to
> offer a way to forcibly set polling mode.
It think it would be better to pass 'uart_force_polling' ( or kind of )
via command line.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 15:40:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 15:40:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565385.883495 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLmoN-0002ke-KQ; Tue, 18 Jul 2023 15:40:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565385.883495; Tue, 18 Jul 2023 15:40:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLmoN-0002kX-Ga; Tue, 18 Jul 2023 15:40:27 +0000
Received: by outflank-mailman (input) for mailman id 565385;
 Tue, 18 Jul 2023 15:40:26 +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 <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLmoM-0002kA-Lw
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 15:40:26 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20615.outbound.protection.outlook.com
 [2a01:111:f400:7d00::615])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 688263c1-2581-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 17:40:23 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBAPR04MB7400.eurprd04.prod.outlook.com (2603:10a6:10:1b3::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Tue, 18 Jul
 2023 15:40:21 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 15:40:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 688263c1-2581-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=IlP9YKq5WMTz9lrJVM7/r/vs2hV1wC33T0GzD0lCE8LbwIRv0j2YHCy7svl6DFnkvZT6vRuT2/y7Gj4dwjV+qmOmRPZS70ZCHhhpIRXcBdtrUQRNwto3ATidBR40IYsMfkC3m15emzpccIb+OqsNxEasnUrkjZ0uQ7a4gLk2U90Rp5yFtfu3k1d137dbOUvGiFgnuwwewlBxMZ8CuDRF2fk7T7GCfamGdbWSAN1laSzY6rSi0pUyQlwAQVm2ek0u3lq7OHjeNwrXc5/A8EJKoVckqEbCVY7fIS00kXpI1vK7AoqVAL1NklQ6D6mr5NqiFnFeW+3mYLfLgCQRQYIxAg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=iGNqzj5auuECKCtrg/wRT+UMA+m5RQVhzkueY9/jP3o=;
 b=YT7JGXzoqnXOuwW0dTo1kxF9qgJcy7hQGWFRczuRXSp7ko+sU4n+Ri1xFp3FU1zJEQJ4gb36rVCjJ4sIMY8LQxurTP0uuGW98RywnUJAoqOkQvHNiVgvDnLAxvBGqWydUxInlZlV8ghAzUe3pH8y6XAmAaT1D2nfg5f4GNPdWJGdp0VsAgCgjC6moMcXRvhWMtRgOBFauzlht4Mb8SfvyA9sp6m2dCqRPXB1dudRhWiRNedrxrbZgWAqszuGxxhQp64eYBcoS3+upg74oSYBXEcERGVAzFLiTe5OifgQ83On8tsGZpxKD2VBnMN5pQcIknuG103VOxxM3hXyns1f3w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=iGNqzj5auuECKCtrg/wRT+UMA+m5RQVhzkueY9/jP3o=;
 b=soxjhSwWyYbusf+Ih/P7kuUef5588HnBaoDM/PAmeKBvRIiVwoZMopOWbx0ZAXrtwT+rA5cUDzOxUgJWpHWN6hjqZxluvrAVRXslR60ZSBM8IrJsWRyCNTGzmadvTLWcnfXbWUh6c55tdncetViNLUK0ahBCc+N9IdeU0zjaDT+xH+AvSRUmwHUAK9az+5x7tCs8Ab3dFnGM4rjSs1bFQ5U3/ZdwS5Y7eYj7yGCFSb4K2iiQ/WzC3lo4Xes93o3Egu1FPBxnIK0qWM9mxQlWUoeyiqJHSWIi87vB4x/l4o7PdSi5t3FsTGiDVwdy0dcTmTzuN5H2tyJVD36VLg7Gdg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <1bc67bb2-9b01-eb18-eb6a-741067a9b35c@suse.com>
Date: Tue, 18 Jul 2023 17:40:18 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 2/5] x86/ioapic: RTE modifications must use
 ioapic_write_entry
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230718124334.36548-1-roger.pau@citrix.com>
 <20230718124334.36548-3-roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230718124334.36548-3-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0246.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:af::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBAPR04MB7400:EE_
X-MS-Office365-Filtering-Correlation-Id: 44289657-e060-4425-96f8-08db87a54b77
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	5hUMdrxU+EIhkjqaOdIzDA1wh7gXgh4UtAZ3WhIoEF04kTIanHD0GUYnMklHpwGx8xcdnn2z5TxGb0UOQmYWjiE9W7m9Z1mvLocllV1pfuUB2jgaGeodsoR1OYk94QNzcTaZ1Ob8ZXzFOqNX5TTp0kcJ9LyXzXIQ4JUYHB9SHHs1pUjXxhXk+eivv/XWmnUTCYFjzjwWm8XW5xfH2TODVbFATI2/RgRHRFFRH1dzukoH49KqC3kVnmMOQlzUIZ1rqnenGI1GVe1XVQuOnTbGSywQmU+5y/SvSQAFXxaf9zh7Uv+7gJYiUln/fnKipjyAQnTTsDxih8dciJntA/RAliogEvET4htUOFTHnaCwiUfVdsXYEj5zkaOUdKUSdrqHuibftSw4fs2XIVzoVZfPpWSiF0YgriyKGGYqJl5+1BYDY1yxADuxpAgbdAVE6mOVK8HjoW0ueEEORf+SwG4SH8RdsEFO72a+srmz+t/oiXMZ75BKiHAfTjEKL+HjJm5d6CzMLDNh8G7yjuC4X7B1akpSTtq+tCVR9Ww31qL97qTKFxRlKaTERj5B4JVKAFSbosZt4SEP9vSDBzp4qE30sRr5nDT+bujdT4HeHvDO+vGgAIBSGMSjs+07nsYe32nay6smXMTC1e/gvuUJzp1hmA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(376002)(366004)(39860400002)(346002)(136003)(451199021)(8936002)(8676002)(31686004)(66476007)(66556008)(41300700001)(6512007)(6486002)(66946007)(316002)(4326008)(6916009)(5660300002)(54906003)(36756003)(6666004)(2906002)(478600001)(26005)(83380400001)(53546011)(6506007)(2616005)(31696002)(38100700002)(86362001)(186003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 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=?utf-8?B?VE1RdzhOdC92SmpHTSt4QitNQ1RBbWJrYnVCTU14bVEvcTN1amVEcy9UTDd1?=
 =?utf-8?B?Y2habmRudlVTdTlyZUl5SExOaU55YzBOc2pzU1NiZGpRZm1scUJOVFExWWJn?=
 =?utf-8?B?SG4wVk9zZ0tBK2IveUdIR1dPSU1RYjdNK0FNS1NWSXFoVDJuanR2cmZrN3d3?=
 =?utf-8?B?MHZDNnVQWHVpQ3huWk13dDFGYzNSS25pM2NaZ0oxOTBnMUprMkh1Vm9MM0Vm?=
 =?utf-8?B?S1NMTG1zT05MTkJKeVE4cDZtOWMxQ0M4MDFVWjhsbDlDbWZkREpTYTQxOXBw?=
 =?utf-8?B?dVdHZkRWb1lwVGdlSmptMkJRUjVOU1Aram1DZDZYekZVaXorSVFFSER3ZTZR?=
 =?utf-8?B?cy9zVS9KcHkyR201OC90VjkrS0c3M0xLUEJzRUViTlF6MzZrNFBIV1VlQloz?=
 =?utf-8?Q?EYXJiyPongYRX4COqmICrVRFu?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 44289657-e060-4425-96f8-08db87a54b77
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 15:40:21.2130
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ToAB2L29/lp8cq1asTJj5zUjnr/RBXcYqq4Erpl8o5T2bB7LTrWPgqABxT1xpJmkckJOC34XGJiOdbO/RkaECQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7400

On 18.07.2023 14:43, Roger Pau Monne wrote:
> --- a/xen/arch/x86/io_apic.c
> +++ b/xen/arch/x86/io_apic.c
> @@ -269,15 +269,15 @@ void __ioapic_write_entry(
>  {
>      union entry_union eu = { .entry = e };
>  
> -    if ( raw )
> +    if ( raw || !iommu_intremap )
>      {
>          __io_apic_write(apic, 0x11 + 2 * pin, eu.w2);
>          __io_apic_write(apic, 0x10 + 2 * pin, eu.w1);
>      }
>      else
>      {
> -        io_apic_write(apic, 0x11 + 2 * pin, eu.w2);
> -        io_apic_write(apic, 0x10 + 2 * pin, eu.w1);
> +        iommu_update_ire_from_apic(apic, 0x11 + 2 * pin, eu.w2);
> +        iommu_update_ire_from_apic(apic, 0x10 + 2 * pin, eu.w1);
>      }
>  }

I think __ioapic_read_entry() wants updating similarly, so that both
remain consistent.

> @@ -433,16 +433,17 @@ static void modify_IO_APIC_irq(unsigned int irq, unsigned int enable,
>                                 unsigned int disable)
>  {
>      struct irq_pin_list *entry = irq_2_pin + irq;
> -    unsigned int pin, reg;
>  
>      for (;;) {
> -        pin = entry->pin;
> +        unsigned int pin = entry->pin;
> +        struct IO_APIC_route_entry rte;
> +
>          if (pin == -1)
>              break;
> -        reg = io_apic_read(entry->apic, 0x10 + pin*2);
> -        reg &= ~disable;
> -        reg |= enable;
> -        io_apic_modify(entry->apic, 0x10 + pin*2, reg);
> +        rte = __ioapic_read_entry(entry->apic, pin, false);
> +        rte.raw &= ~(uint64_t)disable;
> +        rte.raw |= enable;
> +        __ioapic_write_entry(entry->apic, pin, false, rte);

While this isn't going to happen overly often, ...

> @@ -584,16 +585,16 @@ set_ioapic_affinity_irq(struct irq_desc *desc, const cpumask_t *mask)
>              dest = SET_APIC_LOGICAL_ID(dest);
>          entry = irq_2_pin + irq;
>          for (;;) {
> -            unsigned int data;
> +            struct IO_APIC_route_entry rte;
> +
>              pin = entry->pin;
>              if (pin == -1)
>                  break;
>  
> -            io_apic_write(entry->apic, 0x10 + 1 + pin*2, dest);
> -            data = io_apic_read(entry->apic, 0x10 + pin*2);
> -            data &= ~IO_APIC_REDIR_VECTOR_MASK;
> -            data |= MASK_INSR(desc->arch.vector, IO_APIC_REDIR_VECTOR_MASK);
> -            io_apic_modify(entry->apic, 0x10 + pin*2, data);
> +            rte = __ioapic_read_entry(entry->apic, pin, false);
> +            rte.dest.dest32 = dest;
> +            rte.vector = desc->arch.vector;
> +            __ioapic_write_entry(entry->apic, pin, false, rte);

... this makes me wonder whether there shouldn't be an
__ioapic_modify_entry() capable of suppressing one of the two
writes (but still being handed the full RTE).

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 15:40:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 15:40:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565386.883504 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLmoa-00031u-R2; Tue, 18 Jul 2023 15:40:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565386.883504; Tue, 18 Jul 2023 15:40:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLmoa-00031n-OY; Tue, 18 Jul 2023 15:40:40 +0000
Received: by outflank-mailman (input) for mailman id 565386;
 Tue, 18 Jul 2023 15:40:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CPt9=DE=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qLmoY-00031C-Qz
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 15:40:38 +0000
Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com
 [2a00:1450:4864:20::131])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 712d46c0-2581-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 17:40:37 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-4f122ff663eso9519516e87.2
 for <xen-devel@lists.xenproject.org>; Tue, 18 Jul 2023 08:40:37 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 g21-20020a19ee15000000b004fb76abbc7asm484936lfb.89.2023.07.18.08.40.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 18 Jul 2023 08:40:36 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 712d46c0-2581-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689694837; x=1692286837;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=ZYh0LpM6k57E8n+GrF+g7r7p5SxsWbISKpzRToIME0k=;
        b=eBB5uTlLW/vR3KC4uV4Yc2z3oAF0RsCLHWHvQZ0CKs2ZDh8aSvM0r5QV5xWf7hc6y/
         1FAmwXtjbVJmyLCGSRpvyk333NmlqtRJYy9GP40XOcaK2hS9FaN7kgzk2NasmLdT1vNm
         lU3vKuUxVZKcbbpYrnB1D/q9Sppe2M489HU/MD5oCMpjohfhiyfR7us12ZqU4+vbUQti
         Y4U23+IsPJWF/k/9iB4x/9XtKo2t3jcoP0RkVbn/6SF2oMtY9u2J+pBbhe6o+v8XCh9p
         lYLwikX2RWY1hEj7xy8qQ1ZmeRTOoBlGFCp0WERaXfYPp9L23wcvko6FcJTOd1sxz9Qq
         F+ew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689694837; x=1692286837;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=ZYh0LpM6k57E8n+GrF+g7r7p5SxsWbISKpzRToIME0k=;
        b=QuXGHxqmdCp9tYEeqMhSJGxvW6julojItD76SmaNGBEwB33pxlaZH+H3A71M4UWD9J
         K1qOeP7ZQt1L/we560sy34GPPzCTCxRKn7KbZROQLRi40XlyJo2kPYjwQfDvLSdyuYZB
         n2vttdUh4uwQrrZ/UxVECX8S5VHbfLxGjJZ1m2jSaCo5ep9Hz5sv8H5ZN8EDEYJ/2UqP
         6GXJfYy18LQwG/2gi6iW3ODvmwvm+G12MeVjMwp4nFe03GoJWCVJ8F10aAgVOOV3Na8P
         ndy6xjREETEeqRjwDk6DwOve+SPGdZw5ufJDesdrESJgsoqTcjF7QpHUi1V/0sF0qmIz
         xnmQ==
X-Gm-Message-State: ABy/qLaUgCPKCv5VYc/Y/tYWjwvYWKr9mZ44CJG0sqKHFvUezAvt5598
	+dec0e1/2LgJHhujALsr44g=
X-Google-Smtp-Source: APBJJlHss70iLseUmqK9YV5hlJ3cDRE/Fnu0uk6LBRtfHkStHExaq4kPKPPeikfz3bFeQ/ecXXQ72A==
X-Received: by 2002:a05:6512:1103:b0:4fd:d004:2583 with SMTP id l3-20020a056512110300b004fdd0042583mr1692863lfg.19.1689694836934;
        Tue, 18 Jul 2023 08:40:36 -0700 (PDT)
Message-ID: <0525bc8f7028fe9fcad79aaa864025c1705b8026.camel@gmail.com>
Subject: Re: [PATCH v3 1/8] common: move a few macros out of xen/lib.h
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>, "xen-devel@lists.xenproject.org"
	 <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>, Julien
 Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, George
 Dunlap <george.dunlap@citrix.com>
Date: Tue, 18 Jul 2023 18:40:35 +0300
In-Reply-To: <109efb43-a519-73f6-2a26-2b420090ab2b@suse.com>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
	 <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
	 <109efb43-a519-73f6-2a26-2b420090ab2b@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Mon, 2023-07-10 at 10:51 +0200, Jan Beulich wrote:
> Introduce xen/macros.h for this purpose. For now xen/lib.h simply
> includes xen/macro.h, until consumers can be suitable cleaned up.
>=20
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> v3: New.
>=20
> --- a/xen/include/xen/lib.h
> +++ b/xen/include/xen/lib.h
> @@ -1,26 +1,7 @@
> =C2=A0#ifndef __LIB_H__
> =C2=A0#define __LIB_H__
> =C2=A0
> -#define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
> -
> -#define IS_ALIGNED(val, align) (!((val) & ((align) - 1)))
> -
> -#define DIV_ROUND(n, d) (((n) + (d) / 2) / (d))
> -#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
> -
> -#define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m)))
> -#define MASK_INSR(v, m) (((v) * ((m) & -(m))) & (m))
> -
> -#define count_args_(dot, a1, a2, a3, a4, a5, a6, a7, a8, x, ...) x
> -#define count_args(args...) \
> -=C2=A0=C2=A0=C2=A0 count_args_(., ## args, 8, 7, 6, 5, 4, 3, 2, 1, 0)
> -
> -/* Indirect macros required for expanded argument pasting. */
> -#define PASTE_(a, b) a ## b
> -#define PASTE(a, b) PASTE_(a, b)
> -
> -#define __STR(...) #__VA_ARGS__
> -#define STR(...) __STR(__VA_ARGS__)
> +#include <xen/macros.h>
> =C2=A0
> =C2=A0#ifndef __ASSEMBLY__
> =C2=A0
> --- /dev/null
> +++ b/xen/include/xen/macros.h
> @@ -0,0 +1,34 @@
> +#ifndef __MACROS_H__
> +#define __MACROS_H__
> +
> +#define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
> +
> +#define IS_ALIGNED(val, align) (!((val) & ((align) - 1)))
> +
> +#define DIV_ROUND(n, d) (((n) + (d) / 2) / (d))
> +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
> +
> +#define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m)))
> +#define MASK_INSR(v, m) (((v) * ((m) & -(m))) & (m))
> +
> +#define count_args_(dot, a1, a2, a3, a4, a5, a6, a7, a8, x, ...) x
> +#define count_args(args...) \
> +=C2=A0=C2=A0=C2=A0 count_args_(., ## args, 8, 7, 6, 5, 4, 3, 2, 1, 0)
> +
> +/* Indirect macros required for expanded argument pasting. */
> +#define PASTE_(a, b) a ## b
> +#define PASTE(a, b) PASTE_(a, b)
> +
> +#define __STR(...) #__VA_ARGS__
> +#define STR(...) __STR(__VA_ARGS__)
> +
> +#endif /* __MACROS_H__ */
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
>=20
Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 15:44:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 15:44:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565391.883515 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLmsY-0003s1-Bn; Tue, 18 Jul 2023 15:44:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565391.883515; Tue, 18 Jul 2023 15:44:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLmsY-0003ru-90; Tue, 18 Jul 2023 15:44:46 +0000
Received: by outflank-mailman (input) for mailman id 565391;
 Tue, 18 Jul 2023 15:44:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=g6ux=DE=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qLmsX-0003ro-NU
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 15:44:45 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on2061f.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::61f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 044cd50b-2582-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 17:44:44 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VI1PR04MB6926.eurprd04.prod.outlook.com (2603:10a6:803:133::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul
 2023 15:44:41 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023
 15:44:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 044cd50b-2582-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LdClAfQpOjMEsnKOx3exPirF2iToKsXhyktDB0JKTmn1zq7dB3Y9VFo4dtAzav9JQXJdoUQx6M9GwZ8aAjVXyaEhzwBXrAmt45w08xt99AJ0I9wcamfPKHAHhSJUmzLg0gXzmREsLaPhtTJiJp5fCjGYttH5ciVm2JSQGLrkWDxTT9vXFx3RqnSCzwqrq7r7bBi1Oip/b7RQ2g/Gfi6RavaSl7CRrY9vX63GUwN0PrlAEc6nN8WHqxTcmRBOP6r0g2qHUYQo9b6Dtpf3LxfTCYUWCbFicqIVsC+hBbIpOP7Fh0314WsWzri95Kdtf0arwEOfFltYfbmZEUTRWTPYdQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=fg+U82te4owhA37143CmEc1VKbXPdPq1F16CZLcnFRU=;
 b=Tjgzj1zRPruq8BJlVafKxMpB3J0Ps5NwHWKcD6zor7LYQGqim5ix7LsGa5Q7V75WsNSznSD2mYfPmfzB2CMJTGXA42tgFavwgw920KJ5MVmITIRYFrbm/vg5m4wzyNa5oGq1xbiDas97VqT1vuJIORQ75Kaus2KCMU634F1ZDEzxGoSrVB53c3NOP6rBH2c5tcxaOJhirzAVXd9RY779QNegGYvtNB1z54Rk43/DZ9PjrKxuO88d92LA8sK8Cf6sRlDV9dGF+VWvYX4fGw5TrZl4bkLZ46GQYcciEM5RkNydCBlN2DkCXZZB55jvTIwEBltq5Kk1b4HRS0HceRIHiA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fg+U82te4owhA37143CmEc1VKbXPdPq1F16CZLcnFRU=;
 b=CLYEko9CVX3K1p1IZebKJgJTGkDq7zurUgzrQV0SRODkQoRkGKMRHJqZwHOJKDxQmOSgSgYgFY6Bm45TlO9YMY+gWsz0LMQmOZTmd63ZUF2f1snU38ghRAIDf90y3DqKa7diOX6000zRKOaJPrVLDM45H0u3n0fnHVqtjgc2s3U0uz43yiK1IgUzx3p0EprqBp8WhtqnzXGvUjv7wTMVL3FcHw2YByYxUA3Rcr+QrGfsTLGkG7yX9VcknUT8XM2YzBPo4GEuWdJocSfvk2APbvEHGUqZhPzshzDQpO9P/XSCZXlGEDVrZ3aduh5bMTZPeP4trAWE4XOwGCm+pNwWSg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <a451799f-79a3-b754-b48c-54aec49ef406@suse.com>
Date: Tue, 18 Jul 2023 17:44:37 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 1/5] x86/ioapic: add a raw field to RTE struct
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 Kevin Tian <kevin.tian@intel.com>, xen-devel@lists.xenproject.org
References: <20230718124334.36548-1-roger.pau@citrix.com>
 <20230718124334.36548-2-roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230718124334.36548-2-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0136.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:95::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VI1PR04MB6926:EE_
X-MS-Office365-Filtering-Correlation-Id: e0e46828-57fc-4fc1-e0ac-08db87a5e530
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	KyrEDcZ0OzdnkRR4Og0+0RXAHgTM/PeGDLUf4bW3E+TsK8YENRzgUeH8QqUjtrZ/TqtymjI82YbQOxMjDEaQTjvH9VEYoHLhAmtKIxMmZMroX7AhiTuc3g7Pz9Cy2XOjxs/RpvvQhj4r8La6NbfRe3VxNO9kOlvLtBerrNtxdD+iPHclFo63qHeFoWpTrDcYqeld/zZSaEAbBZf8SXPWhhQ/OeyQgUgKeEl6/gV0o4NtcoDIYIM/2lv8+Urptw69Ba6Ia8QrGcqujQYD4h44gwOMXONCl/v/RqakOdyk8o+DEIriL3ebTE5B4BzmWLOOF0Rdie5Cs8d1KOAVC+z9u7670CzMpv+rDZVEFWpkf+TA7oFh4fsT9ZYlXdIbtnUZ31mjb3hkuPXj8N2KuEjVlVYk9xkHJP0XZl3uaptw+Z6ZiJulL4ic+nhlunJfQqY/tAY1WxNoVyoPuPAPk2np6ZkF1oOsvnH3d8Vf1Yxe/YwwGyCYguOGD6DFN7hzSnE908dT0N3M1xuOE+oWTP/uppI9TnZLqPSApZRjwgN9elJXuZ5gd2AO/u2b3RFFezeQnd3Pou0FfJFG8M5TjrLni5lCgnG1c5rBr+UNi+tiBVa3++R8lHP1fpMy3AK2dKx+INu5UDl84y3dYwqMZzkisQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(39860400002)(366004)(396003)(136003)(451199021)(31686004)(6486002)(54906003)(478600001)(2616005)(83380400001)(31696002)(86362001)(4744005)(2906002)(186003)(6506007)(53546011)(6512007)(26005)(38100700002)(66476007)(66556008)(41300700001)(4326008)(316002)(6916009)(66946007)(8676002)(36756003)(5660300002)(8936002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YnU5OFMwcVBZRklORW52cExYQTIrY3hkNHNLTlUxS085QzZhemxsM1A5V09Y?=
 =?utf-8?B?eUlONjNiNTVaazFSeDg5RlZ3RDFHY1NiUUkrMzFkRWRJSjlJbS9LV3NrZXJ5?=
 =?utf-8?B?Zmp0UGpqbzlPdkxHZTVqek9pU1ZlS3dtMnBhUlQ3N0h6QkNaZWFDOFdPV2FJ?=
 =?utf-8?B?UWVURGNVZzcwTEU1bW92TDNsTkwyVzEzemd4cnFUdUIvb2N0SWk5VFk0MzdF?=
 =?utf-8?B?RnZjVjAwRDdBT08wa1JWbTJPOGxlWTIwYlphaC9taVd3S29MTmE4MXkwVXlq?=
 =?utf-8?B?dHpORGR3WTBmeE5YTU4zaW15K2sz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BBR3Y4eThQOE14eVQ5anVaVkpHSzBxZTRtUG82d2JESzZTaWRq?=
 =?utf-8?Q?PFpjiewn3yN1hS0M3/jAyrxcB?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e0e46828-57fc-4fc1-e0ac-08db87a5e530
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 15:44:38.8878
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: DW5qyq7hmuCjqaa+Qlqf3DZvt4sfJv9WpNohzWbCiWo1juyLrXNb8EhtIr6DV0RHishCEGejEk4zqoTeQQCBDA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6926

On 18.07.2023 14:43, Roger Pau Monne wrote:
> Further changes will require access to the full RTE as a single value
> in order to pass it to IOMMU interrupt remapping handlers.
> 
> No functional change intended.
> 
> Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

As indicated for v1, I'm fine in principle, so
Acked-by: Jan Beulich <jbeulich@suse.com>
but I don't see this (or really any of the prereq changes) go in ahead
of the actual meat of this series (patch 4 and 5, aiui).

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 17:02:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 17:02:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565420.883524 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLo4z-0005jy-Po; Tue, 18 Jul 2023 17:01:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565420.883524; Tue, 18 Jul 2023 17:01:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLo4z-0005jr-N0; Tue, 18 Jul 2023 17:01:41 +0000
Received: by outflank-mailman (input) for mailman id 565420;
 Tue, 18 Jul 2023 17:01:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=N9eI=DE=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1qLo4y-0005jj-59
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 17:01:40 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on20623.outbound.protection.outlook.com
 [2a01:111:f400:fe59::623])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c1aaf364-258c-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 19:01:38 +0200 (CEST)
Received: from MW4PR04CA0379.namprd04.prod.outlook.com (2603:10b6:303:81::24)
 by CY8PR12MB8361.namprd12.prod.outlook.com (2603:10b6:930:7b::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Tue, 18 Jul
 2023 17:01:34 +0000
Received: from CO1NAM11FT076.eop-nam11.prod.protection.outlook.com
 (2603:10b6:303:81:cafe::db) by MW4PR04CA0379.outlook.office365.com
 (2603:10b6:303:81::24) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.23 via Frontend
 Transport; Tue, 18 Jul 2023 17:01:34 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1NAM11FT076.mail.protection.outlook.com (10.13.174.152) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.33 via Frontend Transport; Tue, 18 Jul 2023 17:01:34 +0000
Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 18 Jul
 2023 12:01:33 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB08.amd.com
 (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 18 Jul
 2023 10:01:33 -0700
Received: from [192.168.137.15] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Tue, 18 Jul 2023 12:01:31 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c1aaf364-258c-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hLVFWd/WtqJegE9UEM3hEflCqFGbuGrZyfV7BsmhOsdGTl6ZPegwRj02H64wdl1UrrWuZRAPYaU8+rCpbO9baKnOARGx94/L9xg5x5AGOlxTJfpqPoOFQUKa4BuM94DFZnqY3YW0mdA5ZQgYCxTi+EeU4Y0NZfxueHQUdKfCR2HONSmSDaiU44mBLvaSYXZnTbmZTf5sGYDAPdV3MsZbzF8h6POZDTzEuR7123CxwD63/LHsI1m08JMSuZ6Hd7LTImYo2faicHJuqWLJlexIkH7+Vr2KferPaKtIpmBymzO/jdwnYzPrKqaMB+bpaaPbONkB88xVlrSaqozjEmLUMQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=L0eI4QJl/zvOMtlN85TFWCqI/abwRV2x4VOpktU11ok=;
 b=X5KsU5KztdA5jU3tDKyT04c14CM0IryRHI5MFZ/TXmvUDnjmwqZRsBavNmFx2MI1raaijPGs6tpK83QSUYZxvRYLJnV1n730sDFEFUR7QYZw9LGtEZjk+8reklEHtld0IgJ/GwUwbExtsIcLrdpsYUfP3KzaKLJIew3b1ZCf208NphjlgHpN40TkZHGx92cTwoE4tCH8LTHcBXwsgqE/XcP3dhk2p4jf2UFW3oEZ/RUpiZE32mmzhz9h2K/JP7Da2N3nXad8RQk9Wb9y7Dz1Ifw/MGn9ALFNukJqJB0uIr7LuwktjNYFwO3tQpBfztwJ1YwzeEQuJQfsULfiRLQQew==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=L0eI4QJl/zvOMtlN85TFWCqI/abwRV2x4VOpktU11ok=;
 b=OHgUia+cinvzUvErByNdJbqZ/EPe4JMN6ILV6GaxRMoQ6LGgPtQIpRfZdE6ILLTPwbBv8y5lgvfRDAjVzbwuwI8n3sLHJtTMJSMdTDOmrq6GlmSfxQRw3NT2veHvEnUbZCN0Ztqlmx4wOt4Z5uLLhUYpZz/SBRGlraGldXcTDME=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <a90a2858-c2ea-624b-8095-2e2976e1b34a@amd.com>
Date: Tue, 18 Jul 2023 13:01:31 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
Subject: Re: [PATCH v2 2/3] xen/arm: make has_vpci depend on CONFIG_HAS_VPCI
To: Jan Beulich <jbeulich@suse.com>
CC: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, "Stefano
 Stabellini" <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
	"Bertrand Marquis" <bertrand.marquis@arm.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
	<roger.pau@citrix.com>, Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Artem Mygaiev <artem_mygaiev@epam.com>, Rahul Singh <rahul.singh@arm.com>,
	<xen-devel@lists.xenproject.org>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-3-stewart.hildebrand@amd.com>
 <0dcbc190-2719-6c1d-55d1-4b229dc32e05@suse.com>
Content-Language: en-US
In-Reply-To: <0dcbc190-2719-6c1d-55d1-4b229dc32e05@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1NAM11FT076:EE_|CY8PR12MB8361:EE_
X-MS-Office365-Filtering-Correlation-Id: 68dfcc84-ef37-495d-c98c-08db87b0a478
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	qeji5zZ5G5i2wAlHbcrdmdlE4eLW4pyAmyw3NhR4aMIYWJnuzeK6pz1HKiRUudhigM/Vj9FHg6tL/pg1mHikXrvy+T5YWGEETOpm4xNpS6+PwqbLiW7hA/eZj1x8vXXZzZXXP9u8N0an9Z7FrgLuTUfRIHks1HZKjzNg/t0D+LPbAAk6BjCLbEwPq380qizxyKIkpxgC+IEeidUIOVJL2Lumi4i6bHzEkfUvpX/+nd/nhjg0xSKk7SfUmus5K8/y09/OMwIzDz1TO8S1XK6JSjARbIQSLoO9N1VA4vT8CmkcZ3IRmC5l4nhVcWy8FbVy5tT0pTvC9K1BegO/3k/Kg89oeCNekjZoGDVMwsSEOS3q8Je6pdR3iROu1/FLP5F9oRXTWGw1WXd22w9DDHwJ3fo6GoulLKc7xAIMzGWnu4G47SxfNkm5yVF9m3KaXC/y1PDRLbavNQvhN5ZSXcmcGRaDS0zJ3GnHn8EMSbQg1M/cFgXbr8sG0odmFOd3ndGfaZmwxerfbIg0jZGeAfqQQhHZPRZ1/aNQcKx6Kf7eujiGPjfmUysviuprmzCTDqtIIPftLkQZlEAvtFEnXvLIfpIkFWhtShjm1PctNvbzgzKR52b7E2DEwost6FE10JUk/UCQ92vhkVppx+m74s+WOSWDiHR4aCWVhn6yWGAGyXbwc5QhtJi8Q2XZkKu8TveCcM2V8gy0lb3sCXQQ+rYvCKQLF5i4ehdRrD1Aqz7ECEr5wy6boB5NzIq/XkmTr9EqJOfz60uLMTeSpj+WAG185e1m7Y1LECVaC+vuxT7NUr4=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(376002)(136003)(39860400002)(82310400008)(451199021)(40470700004)(36840700001)(46966006)(31686004)(478600001)(83380400001)(54906003)(426003)(36860700001)(2616005)(47076005)(31696002)(40460700003)(36756003)(86362001)(40480700001)(2906002)(44832011)(186003)(26005)(336012)(53546011)(966005)(316002)(16576012)(81166007)(82740400003)(356005)(70586007)(70206006)(4326008)(6916009)(7416002)(41300700001)(8936002)(8676002)(5660300002)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 17:01:34.4867
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 68dfcc84-ef37-495d-c98c-08db87b0a478
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1NAM11FT076.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8361

On 7/7/23 02:59, Jan Beulich wrote:
> On 07.07.2023 03:47, Stewart Hildebrand wrote:
>> --- a/xen/arch/arm/include/asm/domain.h
>> +++ b/xen/arch/arm/include/asm/domain.h
>> @@ -298,8 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
>>
>>  #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag)
>>
>> -/* vPCI is not available on Arm */
>> -#define has_vpci(d)    ({ (void)(d); false; })
>> +#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); })
> 
> While likely not much of a problem here, I think we should strive to
> write macros such that their arguments are evaluated exactly once in
> all cases (for side effects to occur exactly once). When that's not
> easily possible, so be it, but here it doesn't look problematic to
> swap both sides of the &&.

Thanks for pointing this out. Hmm... I'm considering turning it into a static inline function. This would also satisfy MISRA C:2012 Dir 4.9: "A function should be used in preference to a function-like macro where they are interchangeable" [1].

[1] https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/D_04_09.c


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 17:35:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 17:35:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565423.883535 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLobp-0001Hj-F4; Tue, 18 Jul 2023 17:35:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565423.883535; Tue, 18 Jul 2023 17:35:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLobp-0001Hc-BY; Tue, 18 Jul 2023 17:35:37 +0000
Received: by outflank-mailman (input) for mailman id 565423;
 Tue, 18 Jul 2023 17:35:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=N9eI=DE=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1qLobo-0001HW-6u
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 17:35:36 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on20600.outbound.protection.outlook.com
 [2a01:111:f400:7eae::600])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7ef413b5-2591-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 19:35:33 +0200 (CEST)
Received: from DS7PR06CA0041.namprd06.prod.outlook.com (2603:10b6:8:54::10) by
 DM6PR12MB4353.namprd12.prod.outlook.com (2603:10b6:5:2a6::12) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.32; Tue, 18 Jul 2023 17:35:28 +0000
Received: from DM6NAM11FT113.eop-nam11.prod.protection.outlook.com
 (2603:10b6:8:54:cafe::39) by DS7PR06CA0041.outlook.office365.com
 (2603:10b6:8:54::10) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33 via Frontend
 Transport; Tue, 18 Jul 2023 17:35:28 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 DM6NAM11FT113.mail.protection.outlook.com (10.13.173.5) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.33 via Frontend Transport; Tue, 18 Jul 2023 17:35:28 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 18 Jul
 2023 12:35:27 -0500
Received: from [192.168.137.15] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Tue, 18 Jul 2023 12:35:26 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7ef413b5-2591-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ns+jQAxs0q+y8eAbKZAM8YaqFXuyrUpQDZnXzk79zTsovlxXXTV//fHJfZDDUVRPPEAkOtfyz2KiV8S48IC+MFZJ+8kRfAWDeU+HlzSaKKFSXeUI0v3dJAMwDTP3Jk1euVoFOQ/iisWFXSlPS/UeICoa8ttNLbVyl/5FY/rI6qLEMYBh4nDv6+m5Bxu1fXlP7X4EV4RoaXzpckH1y1dl3sJFhWyKfVVj570lJ5DhcXPLlNnUZkIqcybqe4pl4+qOcfoGEksbbbTm15QoUSSMNSl/RBDPBVljJibXzio96i9p9yOnPPA36k2Ez+HyPoa6+7YvZPx1WDqc/6HukqLk9A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MJKJwh24mPX1Bkhjmep1b5yYgJ1BO09AW7Zvfylv77A=;
 b=kQ/HWuDdeBjorOgrja51CdcvM1ZO2aJuUlSBxiIN36RrQuPEVi1JwzAJQ/Tat+WDM5ZoRbUQmJFDmYz9raWF5H+cV3ZwOwInRY+AGCNF4Nq2GfA7FvQH2dKj0rH0Pe5zlUxAN1N0MQnoH1aECT5ub09sjGUcF/gPuIO+8AmFlvJexo/3gofdaUJc2d7S/GhxOsDxp0EaBDa3v6ujG9UmjTBph1B/49QVIP2vLoCDoLKcql6UVH+Qr7bRPRejlLHwSKaPoHHQcFHtLJfoQrzuLOXgJosSwCXxQO4fE9eGRn6yIXseq7LirjxTo4A4EHi069pXekqehDDwTzWcll/Vag==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MJKJwh24mPX1Bkhjmep1b5yYgJ1BO09AW7Zvfylv77A=;
 b=xbvvquNx1kJCS4hJENeA7IWnATOXDtNoOpnySA0o4pXncUUvwC95aCwuSyUF/0SZOge0gTrmC0SmckXDnR0CYF0RpsKXfvWmIdLY/TrKPbQ75NnY8FxvlVn2Iwh65T6LA7Gm/FjFBEmzM/tJQCtxke8/OIVCJgb/eXiQm6am02A=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <1a8d7024-f881-a3f4-c575-240fb393555f@amd.com>
Date: Tue, 18 Jul 2023 13:35:25 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 1/3] xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig
 option
Content-Language: en-US
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Rahul Singh <rahul.singh@arm.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	=?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Oleksandr Tyshchenko
	<oleksandr_tyshchenko@epam.com>, Artem Mygaiev <artem_mygaiev@epam.com>,
	Stefano Stabellini <stefano.stabellini@amd.com>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-2-stewart.hildebrand@amd.com>
 <041323d2-9114-328f-40c6-f5fed60892a5@xen.org>
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
In-Reply-To: <041323d2-9114-328f-40c6-f5fed60892a5@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DM6NAM11FT113:EE_|DM6PR12MB4353:EE_
X-MS-Office365-Filtering-Correlation-Id: ef3f24c3-2ff2-4d48-32fb-08db87b560a5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	xyxxI0egmuQGzxXEogvzx8+VemaAV2NfmnTgzFeZX8EQZfUgnnjHGNjp4+guF4AkrvrW2z0zlcgxtdQHuO/rwC5/veil/dcY/KSL6zD59MCDrpWhDQOaer0n4lqbtqw1SD0pJaPI/SDcEOs9/oFiXS3Jx6DJhqwgr83J/3yhn8zvSynTod5wj5kMPwC6e+3HqEELb4B7rwDTON4idpTHERG2g1JBgIJUvvuyIpNg8uhSjdYxJ7+zXn0edbLrXmXSbUbZaujk9n84Zkl6m7K/jnaYlfsFFw54tqIzczT9jQy8YPAipDHZMkikexB2VO5DoToRDeQEMRAgbxPgZqZNXDE0wjcL1+ZXu3mj7tnNYtHqE8ycpwAPp5LfaasGS6sQwAGfCgNNVA5ea/I4rArp4XGARZB8Nx66Vt6uzJ0wKRpI8d/qx652ZpNSZ6ZrScVZKl6LqqfZlLS94nxNzxsGo7m9gg0xBLmqhCWzGxs660/jL3Lx2caj7l3SXUdAEdcOV/qfPMYJHXVD8qUpD6NvT4bOYC0u4VnMe4M7nFiwD+7j+e8FKxqaP74FROXpi+LqjMmHY+TKzcKPKkWSPiwiIZTPH356DpxJ25UjWHTDEslzCEWcodMbiK3el0JAds3ljh9PfKlg54MxS4CMmGEcTx75QKPFxLTPQ2WqICEATN+FrPAQFgHOzCiCWndil92tqvXAwKBjiY/LPCkb4NhsNvN2Z3niyKVm5s5u14oceNYa3QJikLM1GCxRc/egrwhlnXLtsGiiTA5FWJoardcLvzYBdvFhgRGZZUIPsU2gvs0=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(376002)(39860400002)(346002)(451199021)(82310400008)(36840700001)(46966006)(40470700004)(40480700001)(40460700003)(54906003)(110136005)(81166007)(16576012)(356005)(82740400003)(70206006)(41300700001)(8676002)(8936002)(316002)(478600001)(5660300002)(70586007)(4326008)(36860700001)(186003)(83380400001)(336012)(2616005)(26005)(53546011)(426003)(47076005)(36756003)(86362001)(31696002)(44832011)(2906002)(31686004)(43740500002)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 17:35:28.2545
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ef3f24c3-2ff2-4d48-32fb-08db87b560a5
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DM6NAM11FT113.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4353

On 7/13/23 14:40, Julien Grall wrote:
> Hi Stewart,
> 
> On 07/07/2023 02:47, Stewart Hildebrand wrote:
>> From: Rahul Singh <rahul.singh@arm.com>
>>
>> Setting CONFIG_PCI_PASSTHROUGH=y will enable PCI passthrough on ARM, even though
>> the feature is not yet complete in the current upstream codebase. The purpose of
>> this is to make it easier to enable the necessary configs (HAS_PCI, HAS_VPCI) for
>> testing and development of PCI passthrough on ARM.
>>
>> Since PCI passthrough on ARM is still work in progress at this time, make it
>> depend on EXPERT.
> 
> While preparing the patch for committing, I noticed that HAS_PASSTHROUGH
> will now allow the user to select one of the IOMMU quarantine options.
> 
> There are three of them right now:
> Â  1. none
> Â  2. basic (i.e. faulting)
> Â  3. scratch page
> 
> The latter is unlikely to work on Arm because we don't setup the scratch
> page. AFAIU, for that, we would need to implement the callback
> quarantine_init().
> 
> I would expect 1 and 2 work. That said, I think 1. would behave like 2.
> because on Arm the device should not be automatically re-assigned to
> dom0. I know this is correct for platform device, but will it be valid
> for PCI as well?

In a system with dom0 where the guest is created from the xl toolstack, we rely on "xl pci-assignable-add". Upon domain destruction, the device automatically gets assigned to domIO. However, there's nothing preventing a user from attempting to invoke "xl pci-assignable-remove", which should assign the device back to dom0, but it is not automatic.

With dom0less, PCI devices are not deassigned from the domU.

> Overall, before enabling HAS_PASSTHROUGH, I think there would be a bit
> of tweaking necessary to at least prevent a user to select the option 3
> (either via Kconfig or the command line). And possibly update the
> Kconfig for IOMMU_QUARANTINE to reflect the behavior on Arm.

OK


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 19:50:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 19:50:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565448.883544 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLqhk-0000N6-0n; Tue, 18 Jul 2023 19:49:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565448.883544; Tue, 18 Jul 2023 19:49:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLqhj-0000Mz-UR; Tue, 18 Jul 2023 19:49:51 +0000
Received: by outflank-mailman (input) for mailman id 565448;
 Tue, 18 Jul 2023 19:49:51 +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
 <SRS0=jxnk=DE=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qLqhj-0000Mt-DX
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 19:49:51 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3fa11e8e-25a4-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 21:49:48 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 220A08285333;
 Tue, 18 Jul 2023 14:49:46 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id xVTA0dMx5qNh; Tue, 18 Jul 2023 14:49:45 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id F3689828535D;
 Tue, 18 Jul 2023 14:49:44 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id 0oVQ3l03KyCi; Tue, 18 Jul 2023 14:49:44 -0500 (CDT)
Received: from [10.11.0.2] (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 5AC3C8285333;
 Tue, 18 Jul 2023 14:49:44 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3fa11e8e-25a4-11ee-8611-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com F3689828535D
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1689709785; bh=O89l9RKgtHV9218UtqijLQ2JUrHWjU82NabzCvrvUeE=;
	h=Message-ID:Date:MIME-Version:To:From;
	b=vl9ym8w69rKdB81ABQ8DtCEeOhTVoC2ZmcvxecOMLLvpgxtEVG4eNOR7LVN0LWU3k
	 +y0cod+P0nfrvkH/aK282bMRoS7gf/dqb+2cBMjJYqY72YDOuqYTURQfiha4TD8rbi
	 a9wmpIqvyttq+/6W36cr4YyUcRsbmNxoT/wOv45c=
X-Virus-Scanned: amavisd-new at rptsys.com
Message-ID: <2da1f2f6-b039-96b3-cb79-f813e6de782e@raptorengineering.com>
Date: Tue, 18 Jul 2023 14:49:43 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v3 1/8] common: move a few macros out of xen/lib.h
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 George Dunlap <george.dunlap@citrix.com>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
 <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
 <109efb43-a519-73f6-2a26-2b420090ab2b@suse.com>
From: Shawn Anastasio <sanastasio@raptorengineering.com>
In-Reply-To: <109efb43-a519-73f6-2a26-2b420090ab2b@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 7/10/23 3:51 AM, Jan Beulich wrote:
> Introduce xen/macros.h for this purpose. For now xen/lib.h simply
> includes xen/macro.h, until consumers can be suitable cleaned up.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> v3: New.
> 
> --- a/xen/include/xen/lib.h
> +++ b/xen/include/xen/lib.h
> @@ -1,26 +1,7 @@
>  #ifndef __LIB_H__
>  #define __LIB_H__
>  
> -#define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
> -
> -#define IS_ALIGNED(val, align) (!((val) & ((align) - 1)))
> -
> -#define DIV_ROUND(n, d) (((n) + (d) / 2) / (d))
> -#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
> -
> -#define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m)))
> -#define MASK_INSR(v, m) (((v) * ((m) & -(m))) & (m))
> -
> -#define count_args_(dot, a1, a2, a3, a4, a5, a6, a7, a8, x, ...) x
> -#define count_args(args...) \
> -    count_args_(., ## args, 8, 7, 6, 5, 4, 3, 2, 1, 0)
> -
> -/* Indirect macros required for expanded argument pasting. */
> -#define PASTE_(a, b) a ## b
> -#define PASTE(a, b) PASTE_(a, b)
> -
> -#define __STR(...) #__VA_ARGS__
> -#define STR(...) __STR(__VA_ARGS__)
> +#include <xen/macros.h>
>  
>  #ifndef __ASSEMBLY__
>  
> --- /dev/null
> +++ b/xen/include/xen/macros.h
> @@ -0,0 +1,34 @@

Should there be an SPDX header here?

> +#ifndef __MACROS_H__
> +#define __MACROS_H__
> +
> +#define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
> +
> +#define IS_ALIGNED(val, align) (!((val) & ((align) - 1)))
> +
> +#define DIV_ROUND(n, d) (((n) + (d) / 2) / (d))
> +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
> +
> +#define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m)))
> +#define MASK_INSR(v, m) (((v) * ((m) & -(m))) & (m))
> +
> +#define count_args_(dot, a1, a2, a3, a4, a5, a6, a7, a8, x, ...) x
> +#define count_args(args...) \
> +    count_args_(., ## args, 8, 7, 6, 5, 4, 3, 2, 1, 0)
> +
> +/* Indirect macros required for expanded argument pasting. */
> +#define PASTE_(a, b) a ## b
> +#define PASTE(a, b) PASTE_(a, b)
> +
> +#define __STR(...) #__VA_ARGS__
> +#define STR(...) __STR(__VA_ARGS__)
> +
> +#endif /* __MACROS_H__ */
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * indent-tabs-mode: nil
> + * End:
> + */

Reviewed-by: Shawn Anastasio <sanastasio@raptorengineering.com>


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 20:18:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 20:18:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565451.883555 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLr93-0004Mk-SD; Tue, 18 Jul 2023 20:18:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565451.883555; Tue, 18 Jul 2023 20:18:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLr93-0004Md-PD; Tue, 18 Jul 2023 20:18:05 +0000
Received: by outflank-mailman (input) for mailman id 565451;
 Tue, 18 Jul 2023 20:18:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ju50=DE=invisiblethingslab.com=simon@srs-se1.protection.inumbo.net>)
 id 1qLr92-0004MX-Lc
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 20:18:04 +0000
Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com
 [66.111.4.28]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2f5ffa72-25a8-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 22:18:02 +0200 (CEST)
Received: from compute2.internal (compute2.nyi.internal [10.202.2.46])
 by mailout.nyi.internal (Postfix) with ESMTP id 64CDF5C0116;
 Tue, 18 Jul 2023 16:17:57 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute2.internal (MEProxy); Tue, 18 Jul 2023 16:17:57 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 18 Jul 2023 16:17:53 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2f5ffa72-25a8-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm2; t=
	1689711477; x=1689797877; bh=5yZUpR+6ZPpUWjcU9SUTuExBXt7D47JD44m
	vzL64O9w=; b=aWt7rrWj1HvCYDVWdaxeFCR3BB9kgv2xtvQwpRfVDx3yldCxeBN
	zacMeG+fkVc5XySPNix7NzxKU97/x1HSU4GbrQQ0Qr+w1IHj3l3sSRZ66QE2qdde
	EPyd7Lp6/BJxFsGLyPjrPq2kZd0N21leGo46udrqsZC/c7hT28MA9jiQ8cXY48yP
	EGZvsLeN1oygSRm5ETSBH8Qmf99oQwmnUH3tkoO4Q9KYkYK+WLYTO86V2C6i+8IO
	bbMTWpbtxWakZ9G6zWJdhSbEASySfbODlI9MLcR0JL1Xvzb9J8tBj6Xoarhtb5Wj
	47yo3AUfL8tEQcBpHd2b6dLrpJ4js9PbWnw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1689711477; x=1689797877; bh=5yZUpR+6ZPpUW
	jcU9SUTuExBXt7D47JD44mvzL64O9w=; b=Kuhj0/Zej1waNv+LlUq2rdfi+bahF
	2mD71tarfYTcrK6jzm2lf39il4aOyIqJz/WP67Jq2+pqcxKPeDUW9THRDkK6rHPz
	omsOiP1y49/7PT2AxLM6uM/qGeHsw2L3LUfeTnQ8T21TYT69gg9O8eMz8GxD8Jb/
	lhiy9NNH82SlRm4c9kAD8TCGj1uVMfzdTPQZVfBK4nVaa26KxsY56RKJc/TKfcgW
	BNWTEy0A04iX2aDDV5Z9ylIpS9gsdx8d7VsqVDEdJqU2d28F4iKCFhikX0wbqYtX
	AI+6PVjNiu37PbUi7nKX2UuLXwdx7GM1+iWGvoPlrHvUe1viDCPsgsEYQ==
X-ME-Sender: <xms:dfO2ZLFFNyr-2BZPvaKArX6nW1HLMal5Xi78fOdnumlIf7frVZTgiQ>
    <xme:dfO2ZIXOR6cgH8H6CDvFhhWoi0PzqnBTq2Gbii_fXyRrQ6O_F5eA4RmCQLOa5JrgA
    xT4LYur_EhWN0c>
X-ME-Received: <xmr:dfO2ZNLEGm3YKVwv6Me4cS-vPs481bT7AH1jc0LSOKcK0M0ZyCm7naVvKNf3qxQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgeeggddugeegucetufdoteggodetrfdotf
    fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
    uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
    cujfgurhepkfffggfuvfevfhfhjggtsehgtderredttdejnecuhfhrohhmpefuihhmohhn
    ucfirghishgvrhcuoehsihhmohhnsehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtg
    homheqnecuggftrfgrthhtvghrnhepudfhfeejveevteehvddtueffuedtteevleelfeek
    tdfhveehvedtieejteetueeinecuffhomhgrihhnpehinhhtvghlrdgtohhmpdhkvghrnh
    gvlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr
    ohhmpehsihhmohhnsehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh
X-ME-Proxy: <xmx:dfO2ZJHltVPpYGxT2X_2c-FbjWJ-qV8dU7pxjd2Y1hEtavH-jPEWNg>
    <xmx:dfO2ZBXJoqwNn-1LR_9F3szqM45eycys4FF2tOZ_UoNLbzk8REm2LA>
    <xmx:dfO2ZEMYO9guUjyeLfygZYdXKG1m-peKhW1aYJLy2h4aOUDx5DnDmQ>
    <xmx:dfO2ZEQjB5hfdmoQnONqBAkfMLhbm6w2rxodHe2t3o_MApMtzr6yPQ>
Feedback-ID: idc5945a3:Fastmail
Message-ID: <683e73d8-037a-5e38-745d-ae1c0e18fc79@invisiblethingslab.com>
Date: Tue, 18 Jul 2023 22:17:45 +0200
MIME-Version: 1.0
Subject: Re: [PATCH 2/4] x86/idle: Get PC{8..10} counters for Tiger and Alder
 Lake
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
References: <20230718132334.2087-1-simon@invisiblethingslab.com>
 <aa23a090-1883-008b-e395-2a3bca709258@suse.com>
 <2be631d2-95f3-0d7f-ad84-eb9e16d1a39a@invisiblethingslab.com>
 <b6365b9d-47a1-8ab4-37eb-0b821257dbd2@suse.com>
From: Simon Gaiser <simon@invisiblethingslab.com>
In-Reply-To: <b6365b9d-47a1-8ab4-37eb-0b821257dbd2@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------XkXusRDb9wd301gW0E277UxX"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------XkXusRDb9wd301gW0E277UxX
Content-Type: multipart/mixed; boundary="------------9AOgAcx0N0K2Er0tVWGl9fk3";
 protected-headers="v1"
From: Simon Gaiser <simon@invisiblethingslab.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
Message-ID: <683e73d8-037a-5e38-745d-ae1c0e18fc79@invisiblethingslab.com>
Subject: Re: [PATCH 2/4] x86/idle: Get PC{8..10} counters for Tiger and Alder
 Lake
References: <20230718132334.2087-1-simon@invisiblethingslab.com>
 <aa23a090-1883-008b-e395-2a3bca709258@suse.com>
 <2be631d2-95f3-0d7f-ad84-eb9e16d1a39a@invisiblethingslab.com>
 <b6365b9d-47a1-8ab4-37eb-0b821257dbd2@suse.com>
In-Reply-To: <b6365b9d-47a1-8ab4-37eb-0b821257dbd2@suse.com>

--------------9AOgAcx0N0K2Er0tVWGl9fk3
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Jan Beulich:
> On 18.07.2023 15:46, Simon Gaiser wrote:
>> Jan Beulich:
>>> On 18.07.2023 15:23, Simon Gaiser wrote:
>>>> ---
>>>>  xen/arch/x86/acpi/cpu_idle.c | 9 ++++++---
>>>>  1 file changed, 6 insertions(+), 3 deletions(-)
>>>
>>> This lacks both S-o-b and a proper description. The latter in
>>> particular because you ...
>>
>> Yeah, I also noticed in the meantime, sorry. Will be fixed in v2.
>>
>>>> --- a/xen/arch/x86/acpi/cpu_idle.c
>>>> +++ b/xen/arch/x86/acpi/cpu_idle.c
>>>> @@ -155,6 +155,12 @@ static void cf_check do_get_hw_residencies(void=
 *arg)
>>>> =20
>>>>      switch ( c->x86_model )
>>>>      {
>>>> +    /* Tiger Lake */
>>>> +    case 0x8C:
>>>> +    case 0x8D:
>>>> +    /* Alder Lake */
>>>> +    case 0x97:
>>>> +    case 0x9A:
>>>>      /* 4th generation Intel Core (Haswell) */
>>>>      case 0x45:
>>>>          GET_PC8_RES(hw_res->pc8);
>>>> @@ -185,9 +191,6 @@ static void cf_check do_get_hw_residencies(void =
*arg)
>>>>      case 0x6C:
>>>>      case 0x7D:
>>>>      case 0x7E:
>>>> -    /* Tiger Lake */
>>>> -    case 0x8C:
>>>> -    case 0x8D:
>>>>      /* Kaby Lake */
>>>>      case 0x8E:
>>>>      case 0x9E:
>>>
>>> ... don't just add new case labels, but you actually move two. It
>>> wants explaining whether this was outright wrong, or what else
>>> causes the movement.
>>
>> Yes, as the commit message says it get those PC{8..10} counters for
>> Tiger and Alder Lake.
>=20
> But that's the problem - there was no commit message.

I'm used to that in git "commit message" refers to the whole thing,
including the "title" (everything till the first blank line. Usually
only a single line. Put into the Subject header by format-patch). And
there it says exactly this, which I considered enough when drafting it.
Will send a v2 with a more verbose description.

>> The former already had a label, therefore the
>> move. I assume that when Tiger Lake was added it was an oversight to n=
ot
>> also read those package C-state counters.
>=20
> Or the SDM wasn't clear, and we needed to err on the safe side.

The SDM [1] seems to be indeed a mess regarding
MSR_PKG_C{8..10}_RESIDENCY. If I didn't missed something in that huge
document it lists PC8 and PC9 only for Intel Core 4th gen with CPUID
06_45H (table 2-31). For PC10 it additionally list Atoms starting with
Goldmont (table 2-12 and references to it).

But it already contradicts itself by listing on page 5002/5003 06_4Fh
(some Xeons) as another model that supports those MSRs. It refers to
table 2-38 there, but that table doesn't contain those MSRs.

Linux' pmc_core [2] and turbostat [3] both use those MSRs on Tiger and
Alder Lake. And on my Tiger Lake test system I get useful data from
there.

Is the code in Linux a good enough reference?

Simon

[1]:
I looked at what's currently linked on Intel's website. "325462-080US"
from "June 2023"
https://cdrdv2.intel.com/v1/dl/getContent/671200

[2]:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/d=
rivers/platform/x86/intel/pmc/core.c?h=3Dv6.4#n44
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/d=
rivers/platform/x86/intel/pmc/tgl.c?h=3Dv6.4#n188
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/d=
rivers/platform/x86/intel/pmc/adl.c?h=3Dv6.4#n291

[3]:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/t=
ools/power/x86/turbostat/turbostat.c?h=3Dv6.4#n5763
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/t=
ools/power/x86/turbostat/turbostat.c?h=3Dv6.4#n5074
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/t=
ools/power/x86/turbostat/turbostat.c?h=3Dv6.4#n5409

--------------9AOgAcx0N0K2Er0tVWGl9fk3--

--------------XkXusRDb9wd301gW0E277UxX
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE3E8ezGzG3N1CTQ//kO9xfO/xly8FAmS282sACgkQkO9xfO/x
ly+3gg/9H4hqwS8YzxXHb9FVzumNrOxhk8FyM3LjfhcsySt0DX+Hk/iCXy7IvOdD
32SWT8Es9jtoWETE7m/1nqrYMX1HEILub+MccLJGYK6M60bs14jwLta2u+kiCilw
KAjRTdcN0oWAkbqSG/iG3CL7eZ6v+47TTr5B6+fdk6HWeQhNW6x4+L6klz6cpCl5
ZySGLmKPJMpUdBl8RJ6hy2TXIFambX/1FggYeGJZBlo3PvgGEFMQmC4yydOqqblL
1BzIiqV8lnRtQ2jdHZsRCZjr7/uwGPtMlrPfQMVL+HqWr+rX9gB4YjYgW74kcZOn
0zXzofp52c57sRiUEqQ1LDAObusXEcuQ6fIzkI4sovdc01rRMJNUo8rcs6GVTCDv
SwIKmf0SSCvlRzLyBKzQnk+N7DJY1pMfIxfTuKBQdNfjgikkMIoxAmSlPzM3DQb5
RRGGMnBOf2DRpYbc2HYESkhvWJuo/dcInAQiAuMf2/kbh4/mNFSxyK2aKa0CW3hY
1wSEUdM6DA0fzFOK5yyY0Z0aA6iIswO9VeOFmCIrxyJ2wIfyeAf69cyuCMa8UYZC
wEvMMA655w0YJ3YPFNaaXTI0u7MTLPB4erkc4/MuvrkMuOjsCAUdzvH2pxKnHIEJ
uwTjW4xlSqo/BUHPnE9nnri1qGSeIZl7yJcsD/uvW1/3lpS0Uf8=
=QJ0B
-----END PGP SIGNATURE-----

--------------XkXusRDb9wd301gW0E277UxX--


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 20:32:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 20:32:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565458.883565 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrMq-0006yj-6o; Tue, 18 Jul 2023 20:32:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565458.883565; Tue, 18 Jul 2023 20:32:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrMq-0006yc-3u; Tue, 18 Jul 2023 20:32:20 +0000
Received: by outflank-mailman (input) for mailman id 565458;
 Tue, 18 Jul 2023 20:32:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jxnk=DE=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qLrMo-0006yG-J9
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 20:32:18 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2e81f482-25aa-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 22:32:16 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id B70CF8285AED;
 Tue, 18 Jul 2023 15:32:14 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id tOLoozPT1EFX; Tue, 18 Jul 2023 15:32:13 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 413978285801;
 Tue, 18 Jul 2023 15:32:13 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id XwmBic4oMqLn; Tue, 18 Jul 2023 15:32:13 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id C14BC8285396;
 Tue, 18 Jul 2023 15:32:12 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2e81f482-25aa-11ee-b23a-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 413978285801
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1689712333; bh=hu0VBkQj2Z11eNO2gz3GrqyEnSUtPkSDbP3E1U420fY=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=NR0kssY9UvU09hQeIL0QAg9WTdu72JL2hyEJIAWrnaeO3XlqUc8plbesgNf9/ijqD
	 QrY7H1g/WUiSXkdQufok2eXpou2rpX2liT3X6hcapiGpCqnzuslPGuVT51sV0Rd5Oc
	 fDGGOeig3v4c/+hsCncllzHhlIWmy67YfTxRmXzU=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v4 0/4] Early serial on Power
Date: Tue, 18 Jul 2023 15:20:21 -0500
Message-Id: <cover.1689710519.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Hello all,

This series adds support for early serial printing on Power, as well as
a simple CI smoke test modeled after the riscv one.

The first patch is responsible for setting up a basic C environment with
an initial stack while the second sets up an Open Firmware serial console
and primitive early_printk infrastructure.

This will currently only run on QEMU pseries VMs, since the firmware
interface on bare metal differs significantly. Support for bare metal
will be added in a future series along with support for the
position-independent code model.

Based on v3 of Jan's "common: move a few macros out of xen/lib.h"
(https://lists.xen.org/archives/html/xen-devel/2023-07/msg00582.html)

Thanks,
Shawn

--
Changes in v4:
  - Add macros.h patch for ARRAY_SIZE
    - Based on v3 of Jan's "common: move a few macros out of xen/lib.h"
  - (head.S) Remove unnecessary '.section .init.data'
  - (head.S) Fixup spacing, remove unnecessary parens
  - (setup.c, processor.h) Fix style of HMT_very_low macro
  - (early_printk.c) Build early_printk.c as .init.o
  - (early_printk.c) Mark putchar_func as __initdata
  - (boot-of.c) Clarify original license in top comment
  - (boot-of.c) Add parens around ADDR macro definition
  - (boot-of.c) Add missing ADDR() for pointer arguments
  - (boot-of.c) Add comment explaining ADDR macro
  - (boot-of.c) Fix style (indentation, comment capitalization)
  - (boot-of.c) Fix type inconsistency in boot-of.c
  - (boot-of.c) Use ARRAY_SIZE instead of hard-coding nrets
  - (boot-of.c) Change bof_chosen variable to function-scope
  - (processor.h) Remove duplicate <xen/types.h> include
  - (processor.h) Remove unnecessary <xen/config.h> include
  - (processor.h) Move HMT_very_low macro to !defined(ASSEMBLY) block
  - (processor.h) Fixup struct cpu_user_regs comment style

Changes in v3:
  - Set up r2 TOC pointer in start
  - Change indirect call to start_xen to a direct one
  - Use 32-bit constant loads for stack pointer, etc. in start
      - Our load address is < 4GB so this works fine
      - In a future series we'll get -fPIC working and change all of
        these immediate address loads to TOC-relative ones.
  - Move .bss initialization to patch 2
  - Move cpu0_boot_stack declaration to setup.c
  - Bump stack size down to one page (64k), previous was way overkill.
  - Remove unnecessary STACK_FRAME_OVERHEAD component from of-call.S
    stack frame size calculation
  - Add assertion that `struct cpu_user_regs` is stack-aligned
  - Move magic `or 31,31,31` to appropriately-named macro
  - Fix formatting of loop in setup.c
  - Add newline in arch/ppc/Makefile to preserve alphabetical ordering
    per group
  - Rebase on staging, including the final version of
    'xen/types: Rework stdint vs __{u,s}$N types'

Changes in v2:
  - Split main patch into two - one for basic C environment setup and
    one for serial
  - Mark OpenFirmware functions and early_printk functions as __init and
    change boot-of.o to boot-of.init.o in Makefile
  - Change <xen/lib.h> include to <xen/stdarg.h> and drop skeleton
    headers that are no longer necessary for build as a result
  - Add loop to clear .bss before jumping to C environment that was
    accidentally excluded from the first series
  - Move common asm macros from processor.h to asm-defns.h
  - Change note in head.S about preserved registers to a multi-line
    comment so it's more noticeable
  - Drop reg-defs.h and use '%'-prefixed register names in assembly
      - This is necessary since -mregnames, which allows standard
        non-prefixed register names without manual macro definitions,
        is not supported by LLVM's assembler.
  - Drop inline asm swab routines in favor of __builtin_bswap family
  - Fix up types.h in accordance with (as of now, unmerged)
    'xen/types: Rework stdint vs __{u,s}$N types'
  - Remove unnecessary braces for single-line statements
  - Remove unnecessary license text when SPDX header is present
  - Fix alphabetical ordering of object declarations in Makefile
  - Drop 'extern' from enter_of prototype, ensure prototypes have
    argument names

Shawn Anastasio (4):
  common: Move a few more standalone macros from xen/lib.h to
    xen/macros.h
  xen/ppc: Set up a basic C environment
  xen/ppc: Implement early serial printk on pseries
  automation: Add smoke test for ppc64le

 automation/gitlab-ci/test.yaml           |  20 ++++
 automation/scripts/qemu-smoke-ppc64le.sh |  27 +++++
 xen/arch/ppc/Kconfig.debug               |   5 +
 xen/arch/ppc/Makefile                    |   4 +
 xen/arch/ppc/boot-of.c                   | 113 +++++++++++++++++++
 xen/arch/ppc/configs/ppc64_defconfig     |   1 +
 xen/arch/ppc/early_printk.c              |  28 +++++
 xen/arch/ppc/include/asm/asm-defns.h     |  57 ++++++++++
 xen/arch/ppc/include/asm/boot.h          |  23 ++++
 xen/arch/ppc/include/asm/byteorder.h     |  12 ++
 xen/arch/ppc/include/asm/config.h        |   5 +-
 xen/arch/ppc/include/asm/early_printk.h  |  15 +++
 xen/arch/ppc/include/asm/msr.h           |  51 +++++++++
 xen/arch/ppc/include/asm/processor.h     | 138 +++++++++++++++++++++++
 xen/arch/ppc/include/asm/types.h         |  21 ++++
 xen/arch/ppc/ppc64/Makefile              |   1 +
 xen/arch/ppc/ppc64/asm-offsets.c         |  59 ++++++++++
 xen/arch/ppc/ppc64/head.S                |  47 ++++----
 xen/arch/ppc/ppc64/of-call.S             |  83 ++++++++++++++
 xen/arch/ppc/setup.c                     |  32 ++++++
 xen/include/xen/lib.h                    |  28 -----
 xen/include/xen/macros.h                 |  32 ++++++
 22 files changed, 753 insertions(+), 49 deletions(-)
 create mode 100755 automation/scripts/qemu-smoke-ppc64le.sh
 create mode 100644 xen/arch/ppc/boot-of.c
 create mode 100644 xen/arch/ppc/early_printk.c
 create mode 100644 xen/arch/ppc/include/asm/asm-defns.h
 create mode 100644 xen/arch/ppc/include/asm/boot.h
 create mode 100644 xen/arch/ppc/include/asm/byteorder.h
 create mode 100644 xen/arch/ppc/include/asm/early_printk.h
 create mode 100644 xen/arch/ppc/include/asm/msr.h
 create mode 100644 xen/arch/ppc/include/asm/processor.h
 create mode 100644 xen/arch/ppc/include/asm/types.h
 create mode 100644 xen/arch/ppc/ppc64/of-call.S
 create mode 100644 xen/arch/ppc/setup.c

--
2.30.2



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 20:32:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 20:32:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565459.883572 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrMq-00072K-HK; Tue, 18 Jul 2023 20:32:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565459.883572; Tue, 18 Jul 2023 20:32:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrMq-00070r-An; Tue, 18 Jul 2023 20:32:20 +0000
Received: by outflank-mailman (input) for mailman id 565459;
 Tue, 18 Jul 2023 20:32:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jxnk=DE=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qLrMp-0006yG-5Q
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 20:32:19 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2f003ff4-25aa-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 22:32:16 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id B549B8285A3B;
 Tue, 18 Jul 2023 15:32:15 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id 0JzLlLKB04kQ; Tue, 18 Jul 2023 15:32:14 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 3FC5C828589A;
 Tue, 18 Jul 2023 15:32:14 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id uGduJ8A_xMO2; Tue, 18 Jul 2023 15:32:13 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 90CB28285396;
 Tue, 18 Jul 2023 15:32:13 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2f003ff4-25aa-11ee-b23a-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 3FC5C828589A
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1689712334; bh=EIrL/yGJUm3I3KmoQSr4XAFX8FSNsnfCUSHA0v9VEX0=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=awckF/T2VruCm78M6GewEgv1R0pAn1K12vqLMPvnqxQypFuWKeAtQvGoonPA85GqU
	 aBp8cBHpsgKW99D9NxfDZsVSCjW6Bz8ZASkvhazZQR/fZOihGZWM06E85+CMgCvMB+
	 p4p4dG5LuuUhDB9sWTxJcjDiwH8CcoNDA64IUhJs=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v4 2/4] xen/ppc: Set up a basic C environment
Date: Tue, 18 Jul 2023 15:20:23 -0500
Message-Id: <6d2a906f3321f4f846ccede25a600a4b85183a38.1689710519.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1689710519.git.sanastasio@raptorengineering.com>
References: <cover.1689710519.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Update ppc64/head.S to set up an initial boot stack, zero the .bss
section, and jump to C.

Also refactor the endian fixup trampoline into its own macro, since it
will need to be used in multiple places, including every time we make a
call into firmware (see next commit).

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/ppc/Makefile                |  2 ++
 xen/arch/ppc/include/asm/asm-defns.h | 40 ++++++++++++++++++++++++++++
 xen/arch/ppc/include/asm/config.h    |  2 +-
 xen/arch/ppc/ppc64/head.S            | 38 +++++++++++++-------------
 xen/arch/ppc/setup.c                 | 19 +++++++++++++
 5 files changed, 80 insertions(+), 21 deletions(-)
 create mode 100644 xen/arch/ppc/include/asm/asm-defns.h
 create mode 100644 xen/arch/ppc/setup.c

diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index 98220648af..530fba2121 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -1,5 +1,7 @@
 obj-$(CONFIG_PPC64) +=3D ppc64/
=20
+obj-y +=3D setup.o
+
 $(TARGET): $(TARGET)-syms
 	cp -f $< $@
=20
diff --git a/xen/arch/ppc/include/asm/asm-defns.h b/xen/arch/ppc/include/=
asm/asm-defns.h
new file mode 100644
index 0000000000..6ea35f6edb
--- /dev/null
+++ b/xen/arch/ppc/include/asm/asm-defns.h
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef _ASM_PPC_ASM_DEFNS_H
+#define _ASM_PPC_ASM_DEFNS_H
+
+/*
+ * Load a 64-bit immediate value into the specified GPR.
+ */
+#define LOAD_IMM64(reg, val)                                            =
     \
+    lis reg, (val) @highest;                                            =
     \
+    ori reg, reg, (val) @higher;                                        =
     \
+    rldicr reg, reg, 32, 31;                                            =
     \
+    oris reg, reg, (val) @h;                                            =
     \
+    ori reg, reg, (val) @l;
+
+#define LOAD_IMM32(reg, val)                                            =
     \
+    lis reg, (val) @h;                                                  =
     \
+    ori reg, reg, (val) @l;                                             =
     \
+
+/*
+ * Depending on how we were booted, the CPU could be running in either
+ * Little Endian or Big Endian mode. The following trampoline from Linux
+ * cleverly uses an instruction that encodes to a NOP if the CPU's
+ * endianness matches the assumption of the assembler (LE, in our case)
+ * or a branch to code that performs the endian switch in the other case=
.
+ */
+#define FIXUP_ENDIAN                                                    =
       \
+    tdi 0, 0, 0x48;   /* Reverse endian of b . + 8          */          =
       \
+    b . + 44;         /* Skip trampoline if endian is good  */          =
       \
+    .long 0xa600607d; /* mfmsr r11                          */          =
       \
+    .long 0x01006b69; /* xori r11,r11,1                     */          =
       \
+    .long 0x00004039; /* li r10,0                           */          =
       \
+    .long 0x6401417d; /* mtmsrd r10,1                       */          =
       \
+    .long 0x05009f42; /* bcl 20,31,$+4                      */          =
       \
+    .long 0xa602487d; /* mflr r10                           */          =
       \
+    .long 0x14004a39; /* addi r10,r10,20                    */          =
       \
+    .long 0xa6035a7d; /* mtsrr0 r10                         */          =
       \
+    .long 0xa6037b7d; /* mtsrr1 r11                         */          =
       \
+    .long 0x2400004c  /* rfid                               */
+
+#endif /* _ASM_PPC_ASM_DEFNS_H */
diff --git a/xen/arch/ppc/include/asm/config.h b/xen/arch/ppc/include/asm=
/config.h
index b9a6814f00..01ca5d0803 100644
--- a/xen/arch/ppc/include/asm/config.h
+++ b/xen/arch/ppc/include/asm/config.h
@@ -43,7 +43,7 @@
=20
 #define SMP_CACHE_BYTES (1 << 6)
=20
-#define STACK_ORDER 2
+#define STACK_ORDER 0
 #define STACK_SIZE  (PAGE_SIZE << STACK_ORDER)
=20
 /* 288 bytes below the stack pointer must be preserved by interrupt hand=
lers */
diff --git a/xen/arch/ppc/ppc64/head.S b/xen/arch/ppc/ppc64/head.S
index 2fcefb40d8..17f4a3e19c 100644
--- a/xen/arch/ppc/ppc64/head.S
+++ b/xen/arch/ppc/ppc64/head.S
@@ -1,30 +1,28 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
=20
+#include <asm/asm-defns.h>
+
     .section .text.header, "ax", %progbits
=20
 ENTRY(start)
     /*
-     * Depending on how we were booted, the CPU could be running in eith=
er
-     * Little Endian or Big Endian mode. The following trampoline from L=
inux
-     * cleverly uses an instruction that encodes to a NOP if the CPU's
-     * endianness matches the assumption of the assembler (LE, in our ca=
se)
-     * or a branch to code that performs the endian switch in the other =
case.
+     * NOTE: argument registers (r3-r9) must be preserved until the C en=
trypoint
      */
-    tdi 0, 0, 0x48    /* Reverse endian of b . + 8          */
-    b . + 44          /* Skip trampoline if endian is good  */
-    .long 0xa600607d  /* mfmsr r11                          */
-    .long 0x01006b69  /* xori r11,r11,1                     */
-    .long 0x00004039  /* li r10,0                           */
-    .long 0x6401417d  /* mtmsrd r10,1                       */
-    .long 0x05009f42  /* bcl 20,31,$+4                      */
-    .long 0xa602487d  /* mflr r10                           */
-    .long 0x14004a39  /* addi r10,r10,20                    */
-    .long 0xa6035a7d  /* mtsrr0 r10                         */
-    .long 0xa6037b7d  /* mtsrr1 r11                         */
-    .long 0x2400004c  /* rfid                               */
-
-    /* Now that the endianness is confirmed, continue */
-1:  b 1b
+    FIXUP_ENDIAN
+
+    /* set up the TOC pointer */
+    LOAD_IMM32(%r2, .TOC.)
+
+    /* set up the initial stack */
+    LOAD_IMM32(%r1, cpu0_boot_stack)
+    li %r11, 0
+    stdu %r11, -STACK_FRAME_OVERHEAD(%r1)
+
+    /* call the C entrypoint */
+    bl start_xen
+
+    /* should never return */
+    trap
=20
     .size start, . - start
     .type start, %function
diff --git a/xen/arch/ppc/setup.c b/xen/arch/ppc/setup.c
new file mode 100644
index 0000000000..9e90a6179a
--- /dev/null
+++ b/xen/arch/ppc/setup.c
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#include <xen/init.h>
+
+/* Xen stack for bringing up the first CPU. */
+unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZ=
E);
+
+/* Macro to adjust thread priority for hardware multithreading */
+#define HMT_very_low()  asm volatile ( "or %r31, %r31, %r31" )
+
+void __init noreturn start_xen(unsigned long r3, unsigned long r4,
+                               unsigned long r5, unsigned long r6,
+                               unsigned long r7)
+{
+    for ( ; ; )
+        /* Set current hardware thread to very low priority */
+        HMT_very_low();
+
+    unreachable();
+}
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 20:32:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 20:32:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565460.883584 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrMr-0007SM-Nb; Tue, 18 Jul 2023 20:32:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565460.883584; Tue, 18 Jul 2023 20:32:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrMr-0007SF-Kv; Tue, 18 Jul 2023 20:32:21 +0000
Received: by outflank-mailman (input) for mailman id 565460;
 Tue, 18 Jul 2023 20:32:19 +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
 <SRS0=jxnk=DE=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qLrMp-0006yH-IK
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 20:32:19 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2edc3385-25aa-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 22:32:16 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 635788285396;
 Tue, 18 Jul 2023 15:32:15 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id t0mjCamFhqmA; Tue, 18 Jul 2023 15:32:13 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 938998285A3B;
 Tue, 18 Jul 2023 15:32:13 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id 7W-CI3l_eoV5; Tue, 18 Jul 2023 15:32:13 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 2B2A5828589A;
 Tue, 18 Jul 2023 15:32:13 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2edc3385-25aa-11ee-8611-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 938998285A3B
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1689712333; bh=weycgpq7UdUBoobNsiQD+7ga0dfxfiI9umDJ8AHZ8kE=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=HMKOJd1VlyEKyKu3om012mBPKf3gWCrvrkJWJqcqogxU1VkLhBZ2BAcYtZ0ebp/oZ
	 L7ORdRGgrulIc+XEdSCrPuiEj8kdKk19AHGEdFvXuVHUv58F12I3+gfxG2V6NTxe4M
	 nDlPrM6rlnmbJTNNptZJYlFbme2ek+rRyNIdFXm0=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v4 1/4] common: Move a few more standalone macros from xen/lib.h to xen/macros.h
Date: Tue, 18 Jul 2023 15:20:22 -0500
Message-Id: <10ce452be68b4f83213f5199a3b84459a479bcda.1689710519.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1689710519.git.sanastasio@raptorengineering.com>
References: <cover.1689710519.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Move a few more macros which have no dependencies on other headers from
xen/lib.h to xen/macros.h. Notably, this includes BUILD_BUG_ON* and
ARRAY_SIZE.
---
 xen/include/xen/lib.h    | 28 ----------------------------
 xen/include/xen/macros.h | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 28 deletions(-)

diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index dae2a1f085..359cfdc784 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -21,24 +21,6 @@
     unlikely(ret_warn_on_);             \
 })
=20
-/* All clang versions supported by Xen have _Static_assert. */
-#if defined(__clang__) || \
-    (__GNUC__ > 4 || (__GNUC__ =3D=3D 4 && __GNUC_MINOR__ >=3D 6))
-/* Force a compilation error if condition is true */
-#define BUILD_BUG_ON(cond) ({ _Static_assert(!(cond), "!(" #cond ")"); }=
)
-
-/* Force a compilation error if condition is true, but also produce a
-   result (of value 0 and type size_t), so the expression can be used
-   e.g. in a structure initializer (or where-ever else comma expressions
-   aren't permitted). */
-#define BUILD_BUG_ON_ZERO(cond) \
-    (sizeof(struct { char c; _Static_assert(!(cond), "!(" #cond ")"); })=
 & 0)
-#else
-#define BUILD_BUG_ON_ZERO(cond) \
-    (sizeof(struct { unsigned u : !(cond); }) & 0)
-#define BUILD_BUG_ON(cond) ((void)BUILD_BUG_ON_ZERO(cond))
-#endif
-
 #ifndef NDEBUG
 #define ASSERT(p) \
     do { if ( unlikely(!(p)) ) assert_failed(#p); } while (0)
@@ -48,16 +30,6 @@
 #define ASSERT_UNREACHABLE() do { } while (0)
 #endif
=20
-#define ABS(_x) ({                              \
-    typeof(_x) __x =3D (_x);                      \
-    (__x < 0) ? -__x : __x;                     \
-})
-
-#define SWAP(_a, _b) \
-   do { typeof(_a) _t =3D (_a); (_a) =3D (_b); (_b) =3D _t; } while ( 0 =
)
-
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]) + __must_be_array(x))
-
 #define __ACCESS_ONCE(x) ({                             \
             (void)(typeof(x))0; /* Scalar typecheck. */ \
             (volatile typeof(x) *)&(x); })
diff --git a/xen/include/xen/macros.h b/xen/include/xen/macros.h
index 7b92d34504..e2832b0e8a 100644
--- a/xen/include/xen/macros.h
+++ b/xen/include/xen/macros.h
@@ -22,6 +22,38 @@
 #define __STR(...) #__VA_ARGS__
 #define STR(...) __STR(__VA_ARGS__)
=20
+#ifndef __ASSEMBLY__
+
+/* All clang versions supported by Xen have _Static_assert. */
+#if defined(__clang__) || \
+    (__GNUC__ > 4 || (__GNUC__ =3D=3D 4 && __GNUC_MINOR__ >=3D 6))
+/* Force a compilation error if condition is true */
+#define BUILD_BUG_ON(cond) ({ _Static_assert(!(cond), "!(" #cond ")"); }=
)
+
+/* Force a compilation error if condition is true, but also produce a
+   result (of value 0 and type size_t), so the expression can be used
+   e.g. in a structure initializer (or where-ever else comma expressions
+   aren't permitted). */
+#define BUILD_BUG_ON_ZERO(cond) \
+    (sizeof(struct { char c; _Static_assert(!(cond), "!(" #cond ")"); })=
 & 0)
+#else
+#define BUILD_BUG_ON_ZERO(cond) \
+    (sizeof(struct { unsigned u : !(cond); }) & 0)
+#define BUILD_BUG_ON(cond) ((void)BUILD_BUG_ON_ZERO(cond))
+#endif
+
+#define ABS(_x) ({                              \
+    typeof(_x) __x =3D (_x);                      \
+    (__x < 0) ? -__x : __x;                     \
+})
+
+#define SWAP(_a, _b) \
+   do { typeof(_a) _t =3D (_a); (_a) =3D (_b); (_b) =3D _t; } while ( 0 =
)
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]) + __must_be_array(x))
+
+#endif /* __ASSEMBLY__ */
+
 #endif /* __MACROS_H__ */
=20
 /*
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 20:32:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 20:32:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565461.883590 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrMs-0007VO-13; Tue, 18 Jul 2023 20:32:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565461.883590; Tue, 18 Jul 2023 20:32:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrMr-0007UV-T8; Tue, 18 Jul 2023 20:32:21 +0000
Received: by outflank-mailman (input) for mailman id 565461;
 Tue, 18 Jul 2023 20:32:19 +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
 <SRS0=jxnk=DE=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qLrMp-0006yH-PJ
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 20:32:19 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2f504cbc-25aa-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 22:32:17 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 24998828589A;
 Tue, 18 Jul 2023 15:32:16 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id Y7otsZ7yXEFE; Tue, 18 Jul 2023 15:32:15 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 435D98285801;
 Tue, 18 Jul 2023 15:32:15 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id cnbo2qalqoqO; Tue, 18 Jul 2023 15:32:14 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 75BE58285396;
 Tue, 18 Jul 2023 15:32:14 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2f504cbc-25aa-11ee-8611-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 435D98285801
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1689712335; bh=t2XSxlE4JcYvYurr+9ZptgwwCybbDwha+GFsOD84g3s=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=kCfArSjN9I/0wwvVWLLqC74ZIlfSiZc8lhVxYa+0s5AYzqjO1f8Ca+yzZrZHt1QKv
	 yPbA4GLrzkA1VUfPiFLeMAYqRv2Kozo9gZbOa3TuFviYM9o+9Lm5mwPVbAZHW3vJLW
	 VsribFbSNmHGFA4oE1va2N5f6GDEt6xCsO71GRxE=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v4 4/4] automation: Add smoke test for ppc64le
Date: Tue, 18 Jul 2023 15:20:25 -0500
Message-Id: <4fcc3b787f481b2d0b8e4b7db492eb81faf04d3f.1689710519.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1689710519.git.sanastasio@raptorengineering.com>
References: <cover.1689710519.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Add an initial smoke test that boots xen on a ppc64/pseries machine and
checks for a magic string. Based on the riscv smoke test.

Eventually the powernv9 (POWER9 bare metal) machine type will want to be
tested as well, but for now we only boot on pseries.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/test.yaml           | 20 ++++++++++++++++++
 automation/scripts/qemu-smoke-ppc64le.sh | 27 ++++++++++++++++++++++++
 2 files changed, 47 insertions(+)
 create mode 100755 automation/scripts/qemu-smoke-ppc64le.sh

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.y=
aml
index d5cb238b0a..45e8ddb7a3 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -71,6 +71,19 @@
   tags:
     - x86_64
=20
+.qemu-ppc64le:
+  extends: .test-jobs-common
+  variables:
+    CONTAINER: debian:bullseye-ppc64le
+    LOGFILE: qemu-smoke-ppc64le.log
+  artifacts:
+    paths:
+      - smoke.serial
+      - '*.log'
+    when: always
+  tags:
+    - x86_64
+
 .xilinx-arm64:
   extends: .test-jobs-common
   variables:
@@ -444,3 +457,10 @@ qemu-smoke-riscv64-gcc:
     - ./automation/scripts/qemu-smoke-riscv64.sh 2>&1 | tee ${LOGFILE}
   needs:
     - archlinux-current-gcc-riscv64-debug
+
+qemu-smoke-ppc64le-pseries-gcc:
+  extends: .qemu-ppc64le
+  script:
+    - ./automation/scripts/qemu-smoke-ppc64le.sh pseries-5.2 2>&1 | tee =
${LOGFILE}
+  needs:
+    - debian-bullseye-gcc-ppc64le-debug
diff --git a/automation/scripts/qemu-smoke-ppc64le.sh b/automation/script=
s/qemu-smoke-ppc64le.sh
new file mode 100755
index 0000000000..eb55221221
--- /dev/null
+++ b/automation/scripts/qemu-smoke-ppc64le.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+set -ex
+
+# machine type from first arg passed directly to qemu -M
+machine=3D$1
+
+# Run the test
+rm -f smoke.serial
+set +e
+
+touch smoke.serial
+
+timeout -k 1 20 \
+qemu-system-ppc64 \
+    -M $machine \
+    -m 2g \
+    -smp 1 \
+    -vga none \
+    -monitor none \
+    -nographic \
+    -serial file:smoke.serial \
+    -kernel binaries/xen
+
+set -e
+(grep -q "Hello, ppc64le!" smoke.serial) || exit 1
+exit 0
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 20:32:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 20:32:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565462.883597 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrMs-0007fS-Ez; Tue, 18 Jul 2023 20:32:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565462.883597; Tue, 18 Jul 2023 20:32:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrMs-0007cN-9d; Tue, 18 Jul 2023 20:32:22 +0000
Received: by outflank-mailman (input) for mailman id 565462;
 Tue, 18 Jul 2023 20:32:21 +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
 <SRS0=jxnk=DE=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qLrMq-0006yH-SS
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 20:32:20 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3013b08d-25aa-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 22:32:18 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 7703E8285801;
 Tue, 18 Jul 2023 15:32:17 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id hsZAzBk4QwVb; Tue, 18 Jul 2023 15:32:14 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 7F34E8285BED;
 Tue, 18 Jul 2023 15:32:14 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id sVZbpvUDzy8u; Tue, 18 Jul 2023 15:32:14 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 005D68285AED;
 Tue, 18 Jul 2023 15:32:13 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3013b08d-25aa-11ee-8611-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 7F34E8285BED
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1689712334; bh=LUqLu0ujdVBKMTpySPERcygZd49iJ7O57vuyRzT2S8g=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=GlahZHDD8W7zRtl1g4pVJhKm8zLgjXN3BNywZ4YoVq2Umnj6LuvgyTZYYLG2BfC9r
	 y5e+2g8cSe4+v8LpjXSBPWqSWQz0fAgSFjl4KSL9qKAMaRJiJEki8UBQWAYhcO8oyN
	 IH4qp0nEgc9UZdSbBCT+Hpr+80d2T627jPR3Xek8=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v4 3/4] xen/ppc: Implement early serial printk on pseries
Date: Tue, 18 Jul 2023 15:20:24 -0500
Message-Id: <7c416ff843ea359bb24b8c954cc079fe1bbaf75f.1689710519.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1689710519.git.sanastasio@raptorengineering.com>
References: <cover.1689710519.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

On typical Power VMs (e.g. QEMU's -M pseries), a variety of services
including an early serial console are provided by Open Firmware.
Implement the required interfaces to call into Open Firmware and write
to the serial console.

Since Open Firmware runs in 32-bit Big Endian mode and Xen runs in
64-bit Little Endian mode, a thunk is required to save/restore
any potentially-clobbered registers as well as to perform the
required endianness switch. Thankfully, linux already has such
a routine, which was imported into ppc64/of-call.S.

Support for bare metal (PowerNV) will be implemented in a future
patch.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/ppc/Kconfig.debug              |   5 +
 xen/arch/ppc/Makefile                   |   2 +
 xen/arch/ppc/boot-of.c                  | 113 +++++++++++++++++++
 xen/arch/ppc/configs/ppc64_defconfig    |   1 +
 xen/arch/ppc/early_printk.c             |  28 +++++
 xen/arch/ppc/include/asm/asm-defns.h    |  17 +++
 xen/arch/ppc/include/asm/boot.h         |  23 ++++
 xen/arch/ppc/include/asm/byteorder.h    |  12 +++
 xen/arch/ppc/include/asm/config.h       |   3 +
 xen/arch/ppc/include/asm/early_printk.h |  15 +++
 xen/arch/ppc/include/asm/msr.h          |  51 +++++++++
 xen/arch/ppc/include/asm/processor.h    | 138 ++++++++++++++++++++++++
 xen/arch/ppc/include/asm/types.h        |  21 ++++
 xen/arch/ppc/ppc64/Makefile             |   1 +
 xen/arch/ppc/ppc64/asm-offsets.c        |  59 ++++++++++
 xen/arch/ppc/ppc64/head.S               |   9 ++
 xen/arch/ppc/ppc64/of-call.S            |  83 ++++++++++++++
 xen/arch/ppc/setup.c                    |  19 +++-
 18 files changed, 597 insertions(+), 3 deletions(-)
 create mode 100644 xen/arch/ppc/boot-of.c
 create mode 100644 xen/arch/ppc/early_printk.c
 create mode 100644 xen/arch/ppc/include/asm/boot.h
 create mode 100644 xen/arch/ppc/include/asm/byteorder.h
 create mode 100644 xen/arch/ppc/include/asm/early_printk.h
 create mode 100644 xen/arch/ppc/include/asm/msr.h
 create mode 100644 xen/arch/ppc/include/asm/processor.h
 create mode 100644 xen/arch/ppc/include/asm/types.h
 create mode 100644 xen/arch/ppc/ppc64/of-call.S

diff --git a/xen/arch/ppc/Kconfig.debug b/xen/arch/ppc/Kconfig.debug
index e69de29bb2..608c9ff832 100644
--- a/xen/arch/ppc/Kconfig.debug
+++ b/xen/arch/ppc/Kconfig.debug
@@ -0,0 +1,5 @@
+config EARLY_PRINTK
+    bool "Enable early printk"
+    default DEBUG
+    help
+      Enables early printk debug messages
diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index 530fba2121..098a4dd0a9 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -1,5 +1,7 @@
 obj-$(CONFIG_PPC64) +=3D ppc64/
=20
+obj-y +=3D boot-of.init.o
+obj-$(CONFIG_EARLY_PRINTK) +=3D early_printk.init.o
 obj-y +=3D setup.o
=20
 $(TARGET): $(TARGET)-syms
diff --git a/xen/arch/ppc/boot-of.c b/xen/arch/ppc/boot-of.c
new file mode 100644
index 0000000000..a06546871e
--- /dev/null
+++ b/xen/arch/ppc/boot-of.c
@@ -0,0 +1,113 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * This file was derived from Xen 3.2's xen/arch/powerpc/boot_of.c,
+ * originally licensed under GPL version 2 or later.
+ *
+ * Copyright IBM Corp. 2005, 2006, 2007
+ * Copyright Raptor Engineering, LLC
+ *
+ * Authors: Jimi Xenidis <jimix@watson.ibm.com>
+ *          Hollis Blanchard <hollisb@us.ibm.com>
+ *          Shawn Anastasio <sanastasio@raptorengineering.com>
+ */
+
+#include <xen/init.h>
+#include <xen/macros.h>
+#include <xen/stdarg.h>
+#include <xen/types.h>
+#include <asm/boot.h>
+#include <asm/byteorder.h>
+#include <asm/early_printk.h>
+
+/*
+ * The Open Firmware client interface is called in 32-bit mode with the =
MMU off,
+ * so any addresses passed to it must be physical addresses under 4GB.
+ *
+ * Since the client interface is only used during early boot before the =
MMU is on
+ * and Xen itself was loaded by Open Firmware (and therefore resides bel=
ow 4GB),
+ * we can achieve the desired result with a simple cast to uint32_t.
+ */
+#define ADDR(x) ((uint32_t)(unsigned long)(x))
+
+/* OF entrypoint*/
+static unsigned long __initdata of_vec;
+
+static int __initdata of_out;
+
+static int __init of_call(const char *service, uint32_t nargs, uint32_t =
nrets,
+                          int32_t rets[], ...)
+{
+    int rc;
+    va_list args;
+    unsigned int i;
+    struct of_service s =3D { 0 };
+
+    s.ofs_service =3D cpu_to_be32(ADDR(service));
+    s.ofs_nargs =3D cpu_to_be32(nargs);
+    s.ofs_nrets =3D cpu_to_be32(nrets);
+
+    /* Copy all the params into the args array */
+    va_start(args, rets);
+
+    for ( i =3D 0; i < nargs; i++ )
+        s.ofs_args[i] =3D cpu_to_be32(va_arg(args, uint32_t));
+
+    va_end(args);
+
+    rc =3D enter_of(&s, of_vec);
+
+    /* Copy all return values to the output rets array */
+    for ( i =3D 0; i < nrets; i++ )
+        rets[i] =3D be32_to_cpu(s.ofs_args[i + nargs]);
+
+    return rc;
+}
+
+static int __init of_finddevice(const char *devspec)
+{
+    int32_t rets[1] =3D { OF_FAILURE };
+
+    of_call("finddevice", 1, ARRAY_SIZE(rets), rets, ADDR(devspec));
+    return rets[0];
+}
+
+static int __init of_getprop(int ph, const char *name, void *buf, uint32=
_t buflen)
+{
+    int32_t rets[1] =3D { OF_FAILURE };
+
+    of_call("getprop", 4, ARRAY_SIZE(rets), rets, ph, ADDR(name), ADDR(b=
uf),
+            buflen);
+    return rets[0];
+}
+
+int __init of_write(int ih, const char *addr, uint32_t len)
+{
+    int32_t rets[1] =3D { OF_FAILURE };
+
+    of_call("write", 3, ARRAY_SIZE(rets), rets, ih, ADDR(addr), len);
+    return rets[0];
+}
+
+static void __init of_putchar(char c)
+{
+    if ( c =3D=3D '\n' )
+    {
+        char buf =3D '\r';
+        of_write(of_out, &buf, 1);
+    }
+    of_write(of_out, &c, 1);
+}
+
+void __init boot_of_init(unsigned long vec)
+{
+    int bof_chosen;
+
+    of_vec =3D vec;
+
+    /* Get a handle to the default console */
+    bof_chosen =3D of_finddevice("/chosen");
+    of_getprop(bof_chosen, "stdout", &of_out, sizeof(of_out));
+    of_out =3D be32_to_cpu(of_out);
+
+    early_printk_init(of_putchar);
+}
diff --git a/xen/arch/ppc/configs/ppc64_defconfig b/xen/arch/ppc/configs/=
ppc64_defconfig
index 8783eb3488..f7cc075e45 100644
--- a/xen/arch/ppc/configs/ppc64_defconfig
+++ b/xen/arch/ppc/configs/ppc64_defconfig
@@ -10,4 +10,5 @@
 CONFIG_PPC64=3Dy
 CONFIG_DEBUG=3Dy
 CONFIG_DEBUG_INFO=3Dy
+CONFIG_EARLY_PRINTK=3Dy
 CONFIG_EXPERT=3Dy
diff --git a/xen/arch/ppc/early_printk.c b/xen/arch/ppc/early_printk.c
new file mode 100644
index 0000000000..781f82133e
--- /dev/null
+++ b/xen/arch/ppc/early_printk.c
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include <xen/init.h>
+#include <asm/boot.h>
+
+static void __initdata (*putchar_func)(char);
+
+void __init early_printk_init(void (*putchar)(char))
+{
+    putchar_func =3D putchar;
+}
+
+void __init early_puts(const char *s, size_t nr)
+{
+    if ( !putchar_func )
+        return;
+
+    while ( nr-- > 0 )
+        putchar_func(*s++);
+}
+
+void __init early_printk(const char *s)
+{
+    if ( !putchar_func )
+        return;
+
+    while ( *s )
+        putchar_func(*s++);
+}
diff --git a/xen/arch/ppc/include/asm/asm-defns.h b/xen/arch/ppc/include/=
asm/asm-defns.h
index 6ea35f6edb..9d7328f4a2 100644
--- a/xen/arch/ppc/include/asm/asm-defns.h
+++ b/xen/arch/ppc/include/asm/asm-defns.h
@@ -37,4 +37,21 @@
     .long 0xa6037b7d; /* mtsrr1 r11                         */          =
       \
     .long 0x2400004c  /* rfid                               */
=20
+
+/* Taken from Linux kernel source (arch/powerpc/boot/crt0.S) */
+.macro OP_REGS op, width, start, end, base, offset
+	.Lreg=3D\start
+	.rept (\end - \start + 1)
+	\op	.Lreg,\offset+\width*.Lreg(\base)
+	.Lreg=3D.Lreg+1
+	.endr
+.endm
+
+#define SAVE_GPRS(start, end, base) OP_REGS std, 8, start, end, base, 0
+#define REST_GPRS(start, end, base) OP_REGS ld, 8, start, end, base, 0
+#define SAVE_GPR(n, base)           SAVE_GPRS(n, n, base)
+#define REST_GPR(n, base)           REST_GPRS(n, n, base)
+#define SAVE_NVGPRS(base)           SAVE_GPRS(14, 31, base)
+#define REST_NVGPRS(base)           REST_GPRS(14, 31, base)
+
 #endif /* _ASM_PPC_ASM_DEFNS_H */
diff --git a/xen/arch/ppc/include/asm/boot.h b/xen/arch/ppc/include/asm/b=
oot.h
new file mode 100644
index 0000000000..9b8a7c43c2
--- /dev/null
+++ b/xen/arch/ppc/include/asm/boot.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef _ASM_PPC_BOOT_H
+#define _ASM_PPC_BOOT_H
+
+#include <xen/types.h>
+
+/* a collection of interfaces used during boot. */
+enum {
+    OF_FAILURE =3D -1,
+    OF_SUCCESS =3D 0,
+};
+
+struct of_service {
+    __be32 ofs_service;
+    __be32 ofs_nargs;
+    __be32 ofs_nrets;
+    __be32 ofs_args[10];
+};
+
+int enter_of(struct of_service *args, unsigned long entry);
+void boot_of_init(unsigned long vec);
+
+#endif /* _ASM_PPC_BOOT_H */
diff --git a/xen/arch/ppc/include/asm/byteorder.h b/xen/arch/ppc/include/=
asm/byteorder.h
new file mode 100644
index 0000000000..2b5f6b9f63
--- /dev/null
+++ b/xen/arch/ppc/include/asm/byteorder.h
@@ -0,0 +1,12 @@
+#ifndef _ASM_PPC_BYTEORDER_H
+#define _ASM_PPC_BYTEORDER_H
+
+#define __arch__swab16 __builtin_bswap16
+#define __arch__swab32 __builtin_bswap32
+#define __arch__swab64 __builtin_bswap64
+
+#define __BYTEORDER_HAS_U64__
+
+#include <xen/byteorder/little_endian.h>
+
+#endif /* _ASM_PPC_BYTEORDER_H */
diff --git a/xen/arch/ppc/include/asm/config.h b/xen/arch/ppc/include/asm=
/config.h
index 01ca5d0803..cb27d2781e 100644
--- a/xen/arch/ppc/include/asm/config.h
+++ b/xen/arch/ppc/include/asm/config.h
@@ -52,6 +52,9 @@
 /* size of minimum stack frame; C code can write into the caller's stack=
 */
 #define STACK_FRAME_OVERHEAD 32
=20
+/* ELFv2 ABI mandates 16 byte alignment */
+#define STACK_ALIGN 16
+
 #endif /* __PPC_CONFIG_H__ */
 /*
  * Local variables:
diff --git a/xen/arch/ppc/include/asm/early_printk.h b/xen/arch/ppc/inclu=
de/asm/early_printk.h
new file mode 100644
index 0000000000..d1d8b416f4
--- /dev/null
+++ b/xen/arch/ppc/include/asm/early_printk.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef _ASM_PPC_EARLY_PRINTK_H
+#define _ASM_PPC_EARLY_PRINTK_H
+
+#include <xen/early_printk.h>
+
+#ifdef CONFIG_EARLY_PRINTK
+void early_printk_init(void (*putchar)(char));
+void early_printk(const char *s);
+#else
+static inline void early_printk_init(void (*putchar)(char)) {}
+static inline void early_printk(const char *s) {}
+#endif
+
+#endif /* _ASM_PPC_EARLY_PRINTK_H */
diff --git a/xen/arch/ppc/include/asm/msr.h b/xen/arch/ppc/include/asm/ms=
r.h
new file mode 100644
index 0000000000..144511e5c3
--- /dev/null
+++ b/xen/arch/ppc/include/asm/msr.h
@@ -0,0 +1,51 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) IBM Corp. 2005
+ * Copyright Raptor Engineering, LLC
+ *
+ * Authors: Jimi Xenidis <jimix@watson.ibm.com>
+ *          Shawn Anastasio <sanastasio@raptorengineering.com>
+ */
+
+#ifndef _ASM_PPC_MSR_H
+#define _ASM_PPC_MSR_H
+
+#include <xen/const.h>
+
+/* Flags in MSR: */
+#define MSR_SF      _AC(0x8000000000000000, ULL)
+#define MSR_TA      _AC(0x4000000000000000, ULL)
+#define MSR_ISF     _AC(0x2000000000000000, ULL)
+#define MSR_HV      _AC(0x1000000000000000, ULL)
+#define MSR_VMX     _AC(0x0000000002000000, ULL)
+#define MSR_MER     _AC(0x0000000000200000, ULL)
+#define MSR_POW     _AC(0x0000000000040000, ULL)
+#define MSR_ILE     _AC(0x0000000000010000, ULL)
+#define MSR_EE      _AC(0x0000000000008000, ULL)
+#define MSR_PR      _AC(0x0000000000004000, ULL)
+#define MSR_FP      _AC(0x0000000000002000, ULL)
+#define MSR_ME      _AC(0x0000000000001000, ULL)
+#define MSR_FE0     _AC(0x0000000000000800, ULL)
+#define MSR_SE      _AC(0x0000000000000400, ULL)
+#define MSR_BE      _AC(0x0000000000000200, ULL)
+#define MSR_FE1     _AC(0x0000000000000100, ULL)
+#define MSR_IP      _AC(0x0000000000000040, ULL)
+#define MSR_IR      _AC(0x0000000000000020, ULL)
+#define MSR_DR      _AC(0x0000000000000010, ULL)
+#define MSR_PMM     _AC(0x0000000000000004, ULL)
+#define MSR_RI      _AC(0x0000000000000002, ULL)
+#define MSR_LE      _AC(0x0000000000000001, ULL)
+
+/* MSR bits set on the systemsim simulator */
+#define MSR_SIM       _AC(0x0000000020000000, ULL)
+#define MSR_SYSTEMSIM _AC(0x0000000010000000, ULL)
+
+/* On a trap, srr1's copy of msr defines some bits as follows: */
+#define MSR_TRAP_FE     _AC(0x0000000000100000, ULL) /* Floating Point E=
xception */
+#define MSR_TRAP_IOP    _AC(0x0000000000080000, ULL) /* Illegal Instruct=
ion */
+#define MSR_TRAP_PRIV   _AC(0x0000000000040000, ULL) /* Privileged Instr=
uction */
+#define MSR_TRAP        _AC(0x0000000000020000, ULL) /* Trap Instruction=
 */
+#define MSR_TRAP_NEXT   _AC(0x0000000000010000, ULL) /* PC is next instr=
uction */
+#define MSR_TRAP_BITS  (MSR_TRAP_FE|MSR_TRAP_IOP|MSR_TRAP_PRIV|MSR_TRAP)
+
+#endif /* _ASM_PPC_MSR_H */
diff --git a/xen/arch/ppc/include/asm/processor.h b/xen/arch/ppc/include/=
asm/processor.h
new file mode 100644
index 0000000000..838d279508
--- /dev/null
+++ b/xen/arch/ppc/include/asm/processor.h
@@ -0,0 +1,138 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright IBM Corp. 2005, 2006, 2007
+ * Copyright Raptor Engineering, LLC
+ *
+ * Authors: Hollis Blanchard <hollisb@us.ibm.com>
+ *          Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
+ *          Timothy Pearson <tpearson@raptorengineering.com>
+ *          Shawn Anastasio <sanastasio@raptorengineering.com>
+ */
+
+#ifndef _ASM_PPC_PROCESSOR_H
+#define _ASM_PPC_PROCESSOR_H
+
+#define IOBMP_BYTES          8192
+#define IOBMP_INVALID_OFFSET 0x8000
+
+/* Processor Version Register (PVR) field extraction */
+
+#define PVR_VER(pvr) (((pvr) >> 16) & 0xFFFF) /* Version field */
+#define PVR_REV(pvr) (((pvr) >> 0) & 0xFFFF)  /* Revison field */
+
+#define __is_processor(pv) (PVR_VER(mfspr(SPRN_PVR)) =3D=3D (pv))
+
+/*
+ * IBM has further subdivided the standard PowerPC 16-bit version and
+ * revision subfields of the PVR for the PowerPC 403s into the following=
:
+ */
+
+#define PVR_FAM(pvr)  (((pvr) >> 20) & 0xFFF) /* Family field */
+#define PVR_MEM(pvr)  (((pvr) >> 16) & 0xF)   /* Member field */
+#define PVR_CORE(pvr) (((pvr) >> 12) & 0xF)   /* Core field */
+#define PVR_CFG(pvr)  (((pvr) >> 8) & 0xF)    /* Configuration field */
+#define PVR_MAJ(pvr)  (((pvr) >> 4) & 0xF)    /* Major revision field */
+#define PVR_MIN(pvr)  (((pvr) >> 0) & 0xF)    /* Minor revision field */
+
+/* Processor Version Numbers */
+
+#define PVR_403GA    0x00200000
+#define PVR_403GB    0x00200100
+#define PVR_403GC    0x00200200
+#define PVR_403GCX   0x00201400
+#define PVR_405GP    0x40110000
+#define PVR_STB03XXX 0x40310000
+#define PVR_NP405H   0x41410000
+#define PVR_NP405L   0x41610000
+#define PVR_601      0x00010000
+#define PVR_602      0x00050000
+#define PVR_603      0x00030000
+#define PVR_603e     0x00060000
+#define PVR_603ev    0x00070000
+#define PVR_603r     0x00071000
+#define PVR_604      0x00040000
+#define PVR_604e     0x00090000
+#define PVR_604r     0x000A0000
+#define PVR_620      0x00140000
+#define PVR_740      0x00080000
+#define PVR_750      PVR_740
+#define PVR_740P     0x10080000
+#define PVR_750P     PVR_740P
+#define PVR_7400     0x000C0000
+#define PVR_7410     0x800C0000
+#define PVR_7450     0x80000000
+#define PVR_8540     0x80200000
+#define PVR_8560     0x80200000
+/*
+ * For the 8xx processors, all of them report the same PVR family for
+ * the PowerPC core. The various versions of these processors must be
+ * differentiated by the version number in the Communication Processor
+ * Module (CPM).
+ */
+#define PVR_821  0x00500000
+#define PVR_823  PVR_821
+#define PVR_850  PVR_821
+#define PVR_860  PVR_821
+#define PVR_8240 0x00810100
+#define PVR_8245 0x80811014
+#define PVR_8260 PVR_8240
+
+/* 64-bit processors */
+#define PVR_NORTHSTAR 0x0033
+#define PVR_PULSAR    0x0034
+#define PVR_POWER4    0x0035
+#define PVR_ICESTAR   0x0036
+#define PVR_SSTAR     0x0037
+#define PVR_POWER4p   0x0038
+#define PVR_970       0x0039
+#define PVR_POWER5    0x003A
+#define PVR_POWER5p   0x003B
+#define PVR_970FX     0x003C
+#define PVR_POWER6    0x003E
+#define PVR_POWER7    0x003F
+#define PVR_630       0x0040
+#define PVR_630p      0x0041
+#define PVR_970MP     0x0044
+#define PVR_970GX     0x0045
+#define PVR_POWER7p   0x004A
+#define PVR_POWER8E   0x004B
+#define PVR_POWER8NVL 0x004C
+#define PVR_POWER8    0x004D
+#define PVR_POWER9    0x004E
+#define PVR_POWER10   0x0080
+#define PVR_BE        0x0070
+#define PVR_PA6T      0x0090
+
+#ifndef __ASSEMBLY__
+
+#include <xen/types.h>
+
+/* Macro to adjust thread priority for hardware multithreading */
+#define HMT_very_low()  asm volatile ( "or %r31, %r31, %r31" )
+
+/*
+ * User-accessible registers: most of these need to be saved/restored
+ * for every nested Xen invocation.
+ */
+struct cpu_user_regs
+{
+    uint64_t gprs[32];
+    uint64_t lr;
+    uint64_t ctr;
+    uint64_t srr0;
+    uint64_t srr1;
+    uint64_t pc;
+    uint64_t msr;
+    uint64_t fpscr;
+    uint64_t xer;
+    uint64_t hid4;  /* debug only */
+    uint64_t dar;   /* debug only */
+    uint32_t dsisr; /* debug only */
+    uint32_t cr;
+    uint32_t __pad; /* good spot for another 32bit reg */
+    uint32_t entry_vector;
+};
+
+#endif
+
+#endif /* _ASM_PPC_PROCESSOR_H */
diff --git a/xen/arch/ppc/include/asm/types.h b/xen/arch/ppc/include/asm/=
types.h
new file mode 100644
index 0000000000..cee08e111a
--- /dev/null
+++ b/xen/arch/ppc/include/asm/types.h
@@ -0,0 +1,21 @@
+/* from xen/arch/x86/include/asm/types.h */
+
+#ifndef _ASM_PPC_TYPES_H
+#define _ASM_PPC_TYPES_H
+
+typedef signed char s8;
+typedef unsigned char u8;
+
+typedef signed short s16;
+typedef unsigned short u16;
+
+typedef signed int s32;
+typedef unsigned int u32;
+
+typedef signed long s64;
+typedef unsigned long u64;
+typedef unsigned long paddr_t;
+#define INVALID_PADDR (~0UL)
+#define PRIpaddr "016lx"
+
+#endif /* _ASM_PPC_TYPES_H */
diff --git a/xen/arch/ppc/ppc64/Makefile b/xen/arch/ppc/ppc64/Makefile
index 3340058c08..f4956daaa9 100644
--- a/xen/arch/ppc/ppc64/Makefile
+++ b/xen/arch/ppc/ppc64/Makefile
@@ -1 +1,2 @@
 obj-y +=3D head.o
+obj-y +=3D of-call.o
diff --git a/xen/arch/ppc/ppc64/asm-offsets.c b/xen/arch/ppc/ppc64/asm-of=
fsets.c
index e69de29bb2..7fc29d5db1 100644
--- a/xen/arch/ppc/ppc64/asm-offsets.c
+++ b/xen/arch/ppc/ppc64/asm-offsets.c
@@ -0,0 +1,59 @@
+/*
+ * Generate definitions needed by assembly language modules.
+ * This code generates raw asm output which is post-processed
+ * to extract and format the required data.
+ */
+
+#include <asm/processor.h>
+
+#define DEFINE(_sym, _val)                                              =
   \
+    asm volatile ("\n.ascii\"=3D=3D>#define " #_sym " %0 /* " #_val " */=
<=3D=3D\"" \
+                  : : "i" (_val) )
+#define BLANK()                                                         =
   \
+    asm volatile ( "\n.ascii\"=3D=3D><=3D=3D\"" : : )
+#define OFFSET(_sym, _str, _mem)                                        =
   \
+    DEFINE(_sym, offsetof(_str, _mem));
+
+/* base-2 logarithm */
+#define __L2(_x)  (((_x) & 0x00000002) ?   1 : 0)
+#define __L4(_x)  (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( =
_x))
+#define __L8(_x)  (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( =
_x))
+#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( =
_x))
+#define LOG_2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(=
_x))
+
+void __dummy__(void)
+{
+    DEFINE(GPR_WIDTH, sizeof(unsigned long));
+    DEFINE(FPR_WIDTH, sizeof(double));
+
+    OFFSET(UREGS_gprs, struct cpu_user_regs, gprs);
+    OFFSET(UREGS_r0, struct cpu_user_regs, gprs[0]);
+    OFFSET(UREGS_r1, struct cpu_user_regs, gprs[1]);
+    OFFSET(UREGS_r13, struct cpu_user_regs, gprs[13]);
+    OFFSET(UREGS_srr0, struct cpu_user_regs, srr0);
+    OFFSET(UREGS_srr1, struct cpu_user_regs, srr1);
+    OFFSET(UREGS_pc, struct cpu_user_regs, pc);
+    OFFSET(UREGS_msr, struct cpu_user_regs, msr);
+    OFFSET(UREGS_lr, struct cpu_user_regs, lr);
+    OFFSET(UREGS_ctr, struct cpu_user_regs, ctr);
+    OFFSET(UREGS_xer, struct cpu_user_regs, xer);
+    OFFSET(UREGS_hid4, struct cpu_user_regs, hid4);
+    OFFSET(UREGS_dar, struct cpu_user_regs, dar);
+    OFFSET(UREGS_dsisr, struct cpu_user_regs, dsisr);
+    OFFSET(UREGS_cr, struct cpu_user_regs, cr);
+    OFFSET(UREGS_fpscr, struct cpu_user_regs, fpscr);
+    DEFINE(UREGS_sizeof, sizeof(struct cpu_user_regs));
+}
+
+/* TODO: Replace with BUILD_BUG_ON + IS_ALIGNED once we can use <xen/lib=
.h> */
+_Static_assert(sizeof(struct cpu_user_regs) % STACK_ALIGN =3D=3D 0,
+               "struct cpu_user_regs not stack aligned!");
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/ppc/ppc64/head.S b/xen/arch/ppc/ppc64/head.S
index 17f4a3e19c..301ba5c8a5 100644
--- a/xen/arch/ppc/ppc64/head.S
+++ b/xen/arch/ppc/ppc64/head.S
@@ -18,6 +18,15 @@ ENTRY(start)
     li %r11, 0
     stdu %r11, -STACK_FRAME_OVERHEAD(%r1)
=20
+    /* clear .bss */
+    LOAD_IMM32(%r14, __bss_start)
+    LOAD_IMM32(%r15, __bss_end)
+1:
+    std %r11, 0(%r14)
+    addi %r14, %r14, 8
+    cmpld %r14, %r15
+    blt 1b
+
     /* call the C entrypoint */
     bl start_xen
=20
diff --git a/xen/arch/ppc/ppc64/of-call.S b/xen/arch/ppc/ppc64/of-call.S
new file mode 100644
index 0000000000..bde89f6aba
--- /dev/null
+++ b/xen/arch/ppc/ppc64/of-call.S
@@ -0,0 +1,83 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Adapted from Linux's arch/powerpc/kernel/entry_64.S, with the
+ * following copyright notice:
+ *
+ *  PowerPC version
+ *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
+ *  Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
+ *    Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
+ *  Adapted for Power Macintosh by Paul Mackerras.
+ *  Low-level exception handlers and MMU support
+ *  rewritten by Paul Mackerras.
+ *    Copyright (C) 1996 Paul Mackerras.
+ *  MPC8xx modifications Copyright (C) 1997 Dan Malek (dmalek@jlc.net).
+ */
+
+#include <asm/asm-offsets.h>
+#include <asm/asm-defns.h>
+#include <asm/msr.h>
+
+/* size of minimum stack frame that can hold an entire cpu_user_regs str=
uct */
+#define STACK_SWITCH_FRAME_SIZE UREGS_sizeof
+
+    .section .init.text, "ax", @progbits
+
+ENTRY(enter_of)
+    mflr %r0
+    std %r0, 16(%r1)
+    stdu %r1,-STACK_SWITCH_FRAME_SIZE(%r1) /* Save SP and create stack s=
pace */
+
+    /*
+     * Because PROM is running in 32b mode, it clobbers the high order h=
alf
+     * of all registers that it saves.  We therefore save those register=
s
+     * PROM might touch to the stack.  (%r0, %r3-%r13 are caller saved)
+     */
+    SAVE_GPR(2, %r1)
+    SAVE_GPR(13, %r1)
+    SAVE_NVGPRS(%r1)
+    mfcr %r10
+    mfmsr %r11
+    std %r10, UREGS_cr(%r1)
+    std %r11, UREGS_msr(%r1)
+
+    /* Put PROM address in SRR0 */
+    mtsrr0 %r4
+
+    /* Setup our trampoline return addr in LR */
+    bcl 20, 31, .+4
+0:  mflr %r4
+    addi %r4, %r4, 1f - 0b
+    mtlr %r4
+
+    /* Prepare a 32-bit mode big endian MSR */
+    LOAD_IMM64(%r12, MSR_SF | MSR_LE)
+    andc %r11, %r11, %r12
+    mtsrr1 %r11
+    rfid
+
+1:  /* Return from OF */
+    FIXUP_ENDIAN
+
+    /* Just make sure that %r1 top 32 bits didn't get corrupt by OF */
+    rldicl %r1, %r1, 0, 32
+
+    /* Restore the MSR (back to 64 bits) */
+    ld %r0, UREGS_msr(%r1)
+    mtmsrd %r0
+    isync
+
+    /* Restore other registers */
+    REST_GPR(2, %r1)
+    REST_GPR(13, %r1)
+    REST_NVGPRS(%r1)
+    ld %r4, UREGS_cr(%r1)
+    mtcr %r4
+
+    addi %r1, %r1, STACK_SWITCH_FRAME_SIZE
+    ld %r0, 16(%r1)
+    mtlr %r0
+    blr
+
+    .size enter_of, . - enter_of
+    .type enter_of, %function
diff --git a/xen/arch/ppc/setup.c b/xen/arch/ppc/setup.c
index 9e90a6179a..7c623a49f5 100644
--- a/xen/arch/ppc/setup.c
+++ b/xen/arch/ppc/setup.c
@@ -1,16 +1,29 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #include <xen/init.h>
+#include <asm/boot.h>
+#include <asm/early_printk.h>
+#include <asm/processor.h>
=20
 /* Xen stack for bringing up the first CPU. */
 unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZ=
E);
=20
-/* Macro to adjust thread priority for hardware multithreading */
-#define HMT_very_low()  asm volatile ( "or %r31, %r31, %r31" )
-
 void __init noreturn start_xen(unsigned long r3, unsigned long r4,
                                unsigned long r5, unsigned long r6,
                                unsigned long r7)
 {
+    if ( r5 )
+    {
+        /* OpenFirmware boot protocol */
+        boot_of_init(r5);
+    }
+    else
+    {
+        /* kexec boot: Unimplemented */
+        __builtin_trap();
+    }
+
+    early_printk("Hello, ppc64le!\n");
+
     for ( ; ; )
         /* Set current hardware thread to very low priority */
         HMT_very_low();
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Tue Jul 18 20:44:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 20:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565476.883615 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrYs-0002XP-Go; Tue, 18 Jul 2023 20:44:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565476.883615; Tue, 18 Jul 2023 20:44:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrYs-0002XI-Dn; Tue, 18 Jul 2023 20:44:46 +0000
Received: by outflank-mailman (input) for mailman id 565476;
 Tue, 18 Jul 2023 20:44:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qLrYq-0002XC-Kr
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 20:44:44 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLrYp-0003ms-GH; Tue, 18 Jul 2023 20:44:43 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLrYp-0006vD-BL; Tue, 18 Jul 2023 20:44:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=yyHnDc0JzFychfpX3WURoH08cSqZpZkBR7B39eXQXpU=; b=QJL0QcHvn2DPU8J7/PvRd+vIpp
	9McCFbjKdHY16PQCS9YDp3TAMt+DQGK6dB8ynk3VW+RptOBzMfgutCVl8SGv+ET34WSeN8Np7PL6N
	vQlgKL/YdP0iean/7BnXrrkIufidiuHRoEFZsnjaQ/oLNMnAH+2J/JkC/4GRHLddvhzo=;
Message-ID: <0084caae-d07a-f319-5082-b6a8ff3be100@xen.org>
Date: Tue, 18 Jul 2023 21:44:41 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v2 05/18] tools/xenstore: rename do_tdb_write() and change
 parameter type
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-6-jgross@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230710065947.4201-6-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 10/07/2023 07:59, Juergen Gross wrote:
> Rename do_tdb_write() to db_write() and replace the key parameter with
> db_name specifying the name of the node in the data base, and the data
> parameter with a data pointer and a length.
> 
> Do the same key parameter type change for write_node_raw(), too.
> 
> This is in preparation to replace TDB with a more simple data storage.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 20:47:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 20:47:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565480.883625 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrbJ-0003MF-1h; Tue, 18 Jul 2023 20:47:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565480.883625; Tue, 18 Jul 2023 20:47:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrbI-0003M8-Uq; Tue, 18 Jul 2023 20:47:16 +0000
Received: by outflank-mailman (input) for mailman id 565480;
 Tue, 18 Jul 2023 20:47:16 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qLrbI-0003Lz-BI
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 20:47:16 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLrbH-0003pH-IC; Tue, 18 Jul 2023 20:47:15 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLrbH-0006yX-Bq; Tue, 18 Jul 2023 20:47:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=tGIRZSeijg/akSjbgvitaZxe8jfjTbwXxoc9mPLpy0o=; b=h1+D1wrWiXswLiAHiQLTMabqby
	+/GNGxd/qCUFssCfDOgODCbML5uvL+r5j0D+fx2a0YQxlX/hlF9B4MbZYshEpXEOY5ybuUDzmVisj
	Mkql27MswFde11toEc3txKEDUYX1n+7hx05M15H1wCc3A2zM+XzA0VgJMaHGklPs27oo=;
Message-ID: <82fabb4c-394d-cf1e-6cb5-cfe0542eec53@xen.org>
Date: Tue, 18 Jul 2023 21:47:14 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v2 07/18] tools/xenstore: add wrapper for tdb_fetch()
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-8-jgross@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230710065947.4201-8-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 10/07/2023 07:59, Juergen Gross wrote:
> Add a wrapper function for tdb_fetch taking the name of the node in
> the data base as a parameter. Let it return a data pointer and the
> length of the data via a length pointer provided as additional
> parameter.
> 
> Move logging of the TDB access from the callers into the wrapper.
> 
> This enables to make set_tdb_key() and tdb_ctx static.
> 
> This is in preparation to replace TDB with a more simple data storage.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 20:49:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 20:49:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565483.883634 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrdR-0004MN-D5; Tue, 18 Jul 2023 20:49:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565483.883634; Tue, 18 Jul 2023 20:49:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrdR-0004MG-9v; Tue, 18 Jul 2023 20:49:29 +0000
Received: by outflank-mailman (input) for mailman id 565483;
 Tue, 18 Jul 2023 20:49:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qLrdP-0004Li-Sa
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 20:49:27 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLrdP-0003zg-83; Tue, 18 Jul 2023 20:49:27 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLrdP-0006zi-3Y; Tue, 18 Jul 2023 20:49:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=z7HqkBEH/2Y/YsO+GRcIiK/QABaoxJ/XsAniPUvUUio=; b=NPAxnJXerpgrxgF2aYICcN2w07
	5bhjzMdGpnAU34+3eh1V6YNSuGhgH9PoHMkqVSx9tJ+ak6oOt/2H1lp3TUJgjbuLhBI3J521GrVL0
	DOAetcPWYhMeUuwSnpzUvXB91a3fh9iqpoH8zu0fTNf/NNOeonRazVTcpcfbsuTF5kdw=;
Message-ID: <446d5bba-e0f0-a4f5-a8dc-7c2428f3a9e3@xen.org>
Date: Tue, 18 Jul 2023 21:49:25 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v2 09/18] tools/xenstore: let hashtable_add() fail in case
 of existing entry
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-10-jgross@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230710065947.4201-10-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 10/07/2023 07:59, Juergen Gross wrote:
> Silently adding another entry with the same key to a hashtable is a
> perfect receipt for later failure with hard to diagnose symptoms.
> 
> Let hashtable_add() fail in case another entry with the same key is
> already existing.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 20:51:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 20:51:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565486.883645 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrei-0005rk-O5; Tue, 18 Jul 2023 20:50:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565486.883645; Tue, 18 Jul 2023 20:50:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrei-0005rd-Km; Tue, 18 Jul 2023 20:50:48 +0000
Received: by outflank-mailman (input) for mailman id 565486;
 Tue, 18 Jul 2023 20:50:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qLreh-0005rL-3B
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 20:50:47 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLreg-00046O-6z; Tue, 18 Jul 2023 20:50:46 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLreg-00070P-1v; Tue, 18 Jul 2023 20:50:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=+L7tvdShi+hOjAsd/cbXmvpSP8a2J0cPz40h9//UzTU=; b=wKiNiDf/UZQtCVpp/dsX6aoa1b
	Jlfx5nyXceLcdTJ3kwSyskIUlHUWRaoKOgPpXHO21u3p2Zro2C+TseV8BqncJ9qyGYSZfx2LWuJ+V
	5djrPmTR529I7jbAnstDXxVGQD0kqj/0ahbjYI52nmDUHRAVyjDnx1skzwEXEmxiPnJ8=;
Message-ID: <f7e623a5-adec-fd99-4c42-fab0d04cd12e@xen.org>
Date: Tue, 18 Jul 2023 21:50:44 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v2 10/18] tools/xenstore: add hashtable_replace() function
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-11-jgross@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230710065947.4201-11-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 10/07/2023 07:59, Juergen Gross wrote:
> For an effective way to replace a hashtable entry add a new function
> hashtable_replace().
> 
> While at it let hashtable_add() fail if an entry with the specified
> key does already exist.

This seems to be a left-over from the previous version.

> 
> This is in preparation to replace TDB with a more simple data storage.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
>   tools/xenstore/hashtable.c | 20 ++++++++++++++++++++
>   tools/xenstore/hashtable.h | 16 ++++++++++++++++
>   2 files changed, 36 insertions(+)
> 
> diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c
> index 29c247f918..0c26a09567 100644
> --- a/tools/xenstore/hashtable.c
> +++ b/tools/xenstore/hashtable.c
> @@ -160,6 +160,7 @@ static struct entry *hashtable_search_entry(const struct hashtable *h,
>   
>       return NULL;
>   }
> +

I think this belong to the previous patch.

>   int hashtable_add(struct hashtable *h, const void *k, void *v)
>   {
>       unsigned int index;
> @@ -204,6 +205,25 @@ void *hashtable_search(const struct hashtable *h, const void *k)
>       return e ? e->v : NULL;
>   }
>   
> +int hashtable_replace(struct hashtable *h, const void *k, void *v)
> +{
> +    struct entry *e;
> +
> +    e = hashtable_search_entry(h, k);
> +    if (!e)
> +        return ENOENT;
> +
> +    if (h->flags & HASHTABLE_FREE_VALUE)
> +    {
> +        talloc_free(e->v);
> +        talloc_steal(e, v);
> +    }
> +
> +    e->v = v;
> +
> +    return 0;
> +}
> +
>   void
>   hashtable_remove(struct hashtable *h, const void *k)
>   {
> diff --git a/tools/xenstore/hashtable.h b/tools/xenstore/hashtable.h
> index 792f6cda7b..214aea1b3d 100644
> --- a/tools/xenstore/hashtable.h
> +++ b/tools/xenstore/hashtable.h
> @@ -51,6 +51,22 @@ create_hashtable(const void *ctx, const char *name,
>   int
>   hashtable_add(struct hashtable *h, const void *k, void *v);
>   
> +/*****************************************************************************
> + * hashtable_replace
> +
> + * @name        hashtable_nsert
> + * @param   h   the hashtable to insert into
> + * @param   k   the key - hashtable claims ownership and will free on removal
> + * @param   v   the value - does not claim ownership
> + * @return      zero for successful insertion
> + *
> + * This function does check for an entry being present before replacing it
> + * with a new value.
> + */
> +
> +int
> +hashtable_replace(struct hashtable *h, const void *k, void *v);
> +
>   /*****************************************************************************
>    * hashtable_search
>      

Chees,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 20:59:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 20:59:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565489.883655 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrmh-0006kJ-FI; Tue, 18 Jul 2023 20:59:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565489.883655; Tue, 18 Jul 2023 20:59:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrmh-0006kC-Ci; Tue, 18 Jul 2023 20:59:03 +0000
Received: by outflank-mailman (input) for mailman id 565489;
 Tue, 18 Jul 2023 20:59:02 +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 <SRS0=WFIX=DE=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qLrmg-0006k6-1x
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 20:59:02 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e9768d80-25ad-11ee-8611-37d641c3527e;
 Tue, 18 Jul 2023 22:58:58 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36IKwhNh024279
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Tue, 18 Jul 2023 16:58:49 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36IKwg5C024278;
 Tue, 18 Jul 2023 13:58:42 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e9768d80-25ad-11ee-8611-37d641c3527e
Date: Tue, 18 Jul 2023 13:58:42 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
        Anthony PERARD <anthony.perard@citrix.com>,
        Marek =?iso-8859-1?Q?Marczykowski-G=F3recki?= <marmarek@invisiblethingslab.com>
Subject: Re: [PATCH] docs/xen-tscmode: remove mention of numeric tsc_mode=
 values
Message-ID: <ZLb9AhaoJDixR7Nf@mattapan.m5p.com>
References: <a8223a339a0b8ff3c0d04fb4ee2913c7558cc131.1689294071.git.ehem+xen@m5p.com>
 <ZLCj62XMBbspMWbY@mail-itl>
 <ZLDErKk8ziBuh1ZJ@mattapan.m5p.com>
 <b3db9387-8139-e7f8-d250-9933e288f9fc@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <b3db9387-8139-e7f8-d250-9933e288f9fc@suse.com>
X-Spam-Status: No, score=0.4 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

On Fri, Jul 14, 2023 at 09:21:59AM +0200, Jan Beulich wrote:
> On 14.07.2023 05:44, Elliott Mitchell wrote:
> > On Fri, Jul 14, 2023 at 03:24:59AM +0200, Marek Marczykowski-Górecki wrote:
> >> On Thu, Jul 13, 2023 at 05:16:40PM -0700, Elliott Mitchell wrote:
> >>> The better to encourage moving to setting via string mode names.
> >>
> >> The numeric values needs to remain documented, otherwise interpreting
> >> pre-existing configs (that may use them) will be tricky.
> > 
> > Problem is the way it is documented tends to encourage continued use of
> > the numeric values (notice how reports irt Zen 4 mention "tsc_mode=1").
> > 
> > `parse_config_data()` suggests the appropriate string value, so nominally
> > that should take care of older configurations.  If "xen-tscmode" really
> > needs to continue mentioning the numeric value, it should be in
> > parentheses and with "old value" to suggest moving away from that.
> 
> I'm not sure about "old" (we can't change the values without breaking
> backwards compatibility), but the numeric values will want mentioning
> alongside their spelled out names.

Then why is there a warning message about numeric tsc_mode in
`parse_config_data()`?

"WARNING: specifying \"tsc_mode\" as an integer is deprecated. "
"Please use the named parameter variant. %s%s%s\n"

Declaring them deprecated suggests it could be removed at some future
point.  This message was added at af3b530c03, over a decade ago.

Though I suspect `tsc_mode` hasn't been heavily used since no one ever
bothered to remove the debugging message.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Tue Jul 18 21:00:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 21:00:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565495.883664 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLroO-0008Al-Po; Tue, 18 Jul 2023 21:00:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565495.883664; Tue, 18 Jul 2023 21:00:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLroO-0008Ac-N6; Tue, 18 Jul 2023 21:00:48 +0000
Received: by outflank-mailman (input) for mailman id 565495;
 Tue, 18 Jul 2023 21:00:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qLroN-0008AW-C4
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 21:00:47 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLroM-0004KX-GY; Tue, 18 Jul 2023 21:00:46 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLroM-0007Ts-Bf; Tue, 18 Jul 2023 21:00:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:Subject:
	From:References:Cc:To:MIME-Version:Date:Message-ID;
	bh=iJHvsMxMbfc3habtfVBOzObgmi2C0sv1/i66HS1c+YI=; b=s+lGq9XeZrbEmHFFPfo0bOCQJk
	XH2k3SB9Dp/0B465L0qRqKwO5wSWASSrdf+ENb7AzKUu2cn5jeIU+MrSJAcs2g9mvdtjyb2NxLgrJ
	wlAYIIi1tFqi1zHc2gR94Chx85qWlcNKFn5AUB4Wn9vKE7agMg6H0IelODtrkK3HvLJ4=;
Message-ID: <47c36d64-3161-cfb5-a34a-7abcf253113b@xen.org>
Date: Tue, 18 Jul 2023 22:00:44 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-12-jgross@suse.com>
From: Julien Grall <julien@xen.org>
Subject: Re: [PATCH v2 11/18] tools/xenstore: drop use of tdb
In-Reply-To: <20230710065947.4201-12-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 10/07/2023 07:59, Juergen Gross wrote:
> -	return (struct xs_tdb_record_hdr *)data.dptr;
> +	*size = sizeof(*hdr) + hdr->num_perms * sizeof(hdr->perms[0]) +
> +		hdr->datalen + hdr->childlen;
> +
> +	p = talloc_size(NULL, *size);
> +	if (!p) {
> +		errno = ENOMEM;
> +		return NULL;
> +	}
> +
> +	trace_tdb("read %s size %zu\n", db_name, *size + strlen(db_name));
> +
> +	/* Return a copy, avoiding a potential modification in the DB. */
> +	memcpy(p, hdr, *size);

The talloc_size() + memcpy() seems to be an open-coded version of 
talloc_memdup(). Can you use it?

The rest looks good to me.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 21:01:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 21:01:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565498.883675 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrpT-0000Hr-4S; Tue, 18 Jul 2023 21:01:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565498.883675; Tue, 18 Jul 2023 21:01:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrpT-0000Hh-0n; Tue, 18 Jul 2023 21:01:55 +0000
Received: by outflank-mailman (input) for mailman id 565498;
 Tue, 18 Jul 2023 21:01:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qLrpR-0000Ha-0G
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 21:01:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLrpQ-0004Lq-BQ; Tue, 18 Jul 2023 21:01:52 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLrpQ-0007ZA-6l; Tue, 18 Jul 2023 21:01:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=ScKwKafu436xpQuaiD4ZzcZyIeMejtMoash/nP04Aw8=; b=zt5KIBu1D71MLpVJUdaE/SqBxQ
	MEXCRqWB6I9PmsMFEiCq4eokOdBogNwlohX8GB2lOi1lSiwaBqnKsLyP8sRl28YAv83pNXZ2C4IQf
	N7AjlfVmx1ZN93CYofkA4MA+lNSU0BsPcAZ4UK1DPg/ksfFvzvoN1Wgg3SXPY0eKeLww=;
Message-ID: <c1c18e03-5a3e-2793-2b42-040b79a47ab9@xen.org>
Date: Tue, 18 Jul 2023 22:01:51 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v2 13/18] tools/xenstore: let db_delete() return void
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-14-jgross@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230710065947.4201-14-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi JUergen,

On 10/07/2023 07:59, Juergen Gross wrote:
> db_delete() only ever is returning 0. Switch it to return void and
> remove all the error handling dealing wit a non-zero return value.
> 
> Suggested-by: Julien Grall <julien@xen.org>
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 21:10:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 21:10:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565501.883685 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrxL-0001aM-Uf; Tue, 18 Jul 2023 21:10:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565501.883685; Tue, 18 Jul 2023 21:10:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLrxL-0001Zk-Qz; Tue, 18 Jul 2023 21:10:03 +0000
Received: by outflank-mailman (input) for mailman id 565501;
 Tue, 18 Jul 2023 21:10:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qLrxL-0001Qw-Bm
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 21:10:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLrxK-0004WH-5n; Tue, 18 Jul 2023 21:10:02 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLrxK-0007qW-0O; Tue, 18 Jul 2023 21:10:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:Subject:
	From:References:Cc:To:MIME-Version:Date:Message-ID;
	bh=E1FVtb8DlyFsQZcfojJ/HfCp09E2q897nlhML+T790g=; b=aJ/wlGN/l66tkkhDikBZ/F5m6S
	qzFdHrEtlxuDxDZAtq5WhdGjMWFzmYhN7qHWJnXpcVIrbddXX69rJ4DppWlhkcAEvPOUKIAlD1DjC
	0tHvEOnPPOIXEIEUB8NyZeCskrpqCCE5cMTECydLM/UvBQmDWb3aD+mU4ryaEWvnjCKU=;
Message-ID: <e68b7364-545b-ff31-3371-3a682603ead7@xen.org>
Date: Tue, 18 Jul 2023 22:10:00 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-15-jgross@suse.com>
From: Julien Grall <julien@xen.org>
Subject: Re: [PATCH v2 14/18] tools/xenstore: move copying of node data out of
 db_fetch()
In-Reply-To: <20230710065947.4201-15-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 10/07/2023 07:59, Juergen Gross wrote:
> Today the node data is copied in db_fetch() on each data base read in
> order to avoid accidental data base modifications when working on a
> node.
> 
> read_node() is the only caller of db_fetch() which isn't freeing the
> returned data area immediately after using it. The other callers don't
> modify the returned data, so they don't need the data to be copied.

This reads as the return value of db_fetch() should be const. This will 
at least make more obvious to the caller that the value is not supposed 
to be modified.

> 
> Move copying of the data into read_node(), resulting in a speedup of
> the other callers due to no memory allocation and no copying being
> needed anymore.
> 
> As db_fetch() can't return any error other than ENOENT now, error
> handling for the callers can be simplified.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
> V2:
> - new patch
> ---
>   tools/xenstore/xenstored_core.c        | 41 ++++++++++----------------
>   tools/xenstore/xenstored_transaction.c |  3 --
>   2 files changed, 16 insertions(+), 28 deletions(-)
> 
> diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
> index 11da470b20..d5c9054fe9 100644
> --- a/tools/xenstore/xenstored_core.c
> +++ b/tools/xenstore/xenstored_core.c
> @@ -557,8 +557,7 @@ static void initialize_fds(int *p_sock_pollfd_idx, int *ptimeout)
>   
>   struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
>   {
> -	const struct xs_tdb_record_hdr *hdr;
> -	struct xs_tdb_record_hdr *p;
> +	struct xs_tdb_record_hdr *hdr;
>   
>   	hdr = hashtable_search(nodes, db_name);
>   	if (!hdr) {
> @@ -569,18 +568,9 @@ struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
>   	*size = sizeof(*hdr) + hdr->num_perms * sizeof(hdr->perms[0]) +
>   		hdr->datalen + hdr->childlen;
>   
> -	p = talloc_size(NULL, *size);
> -	if (!p) {
> -		errno = ENOMEM;
> -		return NULL;
> -	}
> -
>   	trace_tdb("read %s size %zu\n", db_name, *size + strlen(db_name));
>   
> -	/* Return a copy, avoiding a potential modification in the DB. */
> -	memcpy(p, hdr, *size);
> -
> -	return p;
> +	return hdr;
>   }
>   
>   static void get_acc_data(const char *name, struct node_account_data *acc)
> @@ -597,7 +587,6 @@ static void get_acc_data(const char *name, struct node_account_data *acc)
>   			acc->memory = size;
>   			acc->domid = hdr->perms[0].id;
>   		}
> -		talloc_free(hdr);
>   	}
>   }
>   
> @@ -731,30 +720,32 @@ struct node *read_node(struct connection *conn, const void *ctx,
>   	hdr = db_fetch(db_name, &size);
>   
>   	if (hdr == NULL) {
> -		if (errno == ENOENT) {
> -			node->generation = NO_GENERATION;
> -			err = access_node(conn, node, NODE_ACCESS_READ, NULL);
> -			errno = err ? : ENOENT;
> -		} else {
> -			log("DB error on read: %s", strerror(errno));
> -			errno = EIO;
> -		}
> +		node->generation = NO_GENERATION;
> +		err = access_node(conn, node, NODE_ACCESS_READ, NULL);
> +		errno = err ? : ENOENT;
>   		goto error;
>   	}
>   
>   	node->parent = NULL;
> -	talloc_steal(node, hdr);
>   
>   	/* Datalen, childlen, number of permissions */
>   	node->generation = hdr->generation;
>   	node->perms.num = hdr->num_perms;
>   	node->datalen = hdr->datalen;
>   	node->childlen = hdr->childlen;
> +	node->acc.domid = hdr->perms[0].id;
> +	node->acc.memory = size;
> +
> +	/* Copy node data to new memory area, starting with permissions. */
> +	size -= sizeof(*hdr);
> +	node->perms.p = talloc_size(node, size);
> +	if (node->perms.p == NULL) {
> +		errno = ENOMEM;
> +		goto error;
> +	}
> +	memcpy(node->perms.p, hdr->perms, size);
>   
>   	/* Permissions are struct xs_permissions. */

Is this comment still relevant?

> -	node->perms.p = hdr->perms;
> -	node->acc.domid = get_node_owner(node);
> -	node->acc.memory = size;
>   	if (domain_adjust_node_perms(node))
>   		goto error;
>   
> diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
> index 5d7da82aad..e3e05a1d84 100644
> --- a/tools/xenstore/xenstored_transaction.c
> +++ b/tools/xenstore/xenstored_transaction.c
> @@ -365,13 +365,10 @@ static int finalize_transaction(struct connection *conn,
>   		if (i->check_gen) {
>   			hdr = db_fetch(i->node, &size);
>   			if (!hdr) {
> -				if (errno != ENOENT)
> -					return errno;
>   				gen = NO_GENERATION;
>   			} else {
>   				gen = hdr->generation;
>   			}
> -			talloc_free(hdr);
>   			if (i->generation != gen)
>   				return EAGAIN;
>   		}

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 21:35:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 21:35:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565504.883695 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLsMG-0004w7-Ts; Tue, 18 Jul 2023 21:35:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565504.883695; Tue, 18 Jul 2023 21:35:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLsMG-0004w0-RB; Tue, 18 Jul 2023 21:35:48 +0000
Received: by outflank-mailman (input) for mailman id 565504;
 Tue, 18 Jul 2023 21:35:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qLsMF-0004vq-EY
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 21:35:47 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLsME-0005OE-9P; Tue, 18 Jul 2023 21:35:46 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLsME-0000KY-2H; Tue, 18 Jul 2023 21:35:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:Subject:
	From:References:Cc:To:MIME-Version:Date:Message-ID;
	bh=R+hM2T1qEn6KAWkJuJMergNd0eKtNWPMRvuIxsIUfpk=; b=LYbZB9Suz1RrCV/avta/d4v6eF
	f9FmYQwzcQCyHumNMd4XY/hU4wPzV+hseK3MnLB/ha7s3RKpgaQrCh+EogdN7TGoBKEgCxSYie1jC
	X3t0bpM1a5GY1lKKjcvEttt5Sduk2eJhk+RcrPMygO+HN5lpOc6aZT9QeuiNwaT5amFM=;
Message-ID: <64ec2fd3-fcec-6ebf-5924-6b591215e19e@xen.org>
Date: Tue, 18 Jul 2023 22:35:44 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-19-jgross@suse.com>
From: Julien Grall <julien@xen.org>
Subject: Re: [PATCH v2 18/18] tools/xenstore: add nocopy flag to node read
 functions
In-Reply-To: <20230710065947.4201-19-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 10/07/2023 07:59, Juergen Gross wrote:
> Today when reading a node from the data base through read_node(), the
> node data is copied in order to avoid modifying the data base when
> preparing a node update, as otherwise an error might result in an
> inconsistent state.
> 
> There are, however, many cases where such a copy operation isn't
> needed, as the node isn't modified.
> 
> Add a "nocopy" flag to read_node() and get_node*() functions for making
> those cases less memory consuming and more performant.

Reducing memory consumption and improving performance is good. However 
you are now relying on the caller to do the right thing when 'nocopy' is 
true. I believe this is a disaster waiting to happen.

So as it stands, I don't support this approach. The solution I have in 
mind would require that 'struct node' is const for the 'nocopy' case. I 
agree this means more work, but that's the price for reduce the the risk 
of corruption.

> 
> Note that there is one modification of the node data left, which is not
> problematic: domain_adjust_node_perms() might set the "ignore" flag of
> a permission. This does no harm, as such an update of the permissions
> doesn't need to be undone in case of a later processing error.
Even if this is the "ignore" flag, this is definitely not an ideal 
situation. And, AFAICT, this is not even document. I don't to be the 
reader trying to figure out why read_node() and db_fetch() returns a 
slightly different node content :).

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 21:51:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 21:51:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565509.883704 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLsba-0007mU-9l; Tue, 18 Jul 2023 21:51:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565509.883704; Tue, 18 Jul 2023 21:51:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLsba-0007mN-6y; Tue, 18 Jul 2023 21:51:38 +0000
Received: by outflank-mailman (input) for mailman id 565509;
 Tue, 18 Jul 2023 21:51:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ju50=DE=invisiblethingslab.com=simon@srs-se1.protection.inumbo.net>)
 id 1qLsbY-0007mG-VF
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 21:51:37 +0000
Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com
 [66.111.4.28]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 42481d59-25b5-11ee-b23a-6b7b168915f2;
 Tue, 18 Jul 2023 23:51:33 +0200 (CEST)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.nyi.internal (Postfix) with ESMTP id 4984D5C00B3;
 Tue, 18 Jul 2023 17:51:32 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute1.internal (MEProxy); Tue, 18 Jul 2023 17:51:32 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 18 Jul 2023 17:51:28 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 42481d59-25b5-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm2; t=
	1689717092; x=1689803492; bh=BXP9MsmMNtsDSbAv3CYwTjiFEc9entx7JAG
	SpXBlmH0=; b=LcIZDyNwJmsKIt5ql1npDoo7tEVOlG71zqDRGKdzFGCIwwopI39
	2ahYFJ2B9kj86Un7A3YzjNAiuMKuuK8mdnfZMl7XsJL2Ocir2pEu/pd07fSAtcSB
	ALiVqtwW/llW78FL/bbAPBIQjsasVvOwmcYEYBpDOKK5hKc27j8jjATroTSC1Dr2
	Yel94ntPa0bfuR3WrnrkoUmgljuoToP/ryokrbylYmfheHUa+aCM/vCdD+RMKhZc
	aCvaeQxERKPq6N/a2CD9mf9vVlLd4NIQOV0c0qKKGQTSsbXOTXMZPNXeYyxbylAS
	ygEWv7nSxd2dfgKC0e6d9rYiXy93hkrBzXA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1689717092; x=1689803492; bh=BXP9MsmMNtsDS
	bAv3CYwTjiFEc9entx7JAGSpXBlmH0=; b=lSfAAGTaSWA/dgHnv937s5t0/FrjA
	xOmHDQ+TVyYduBMBa7AgUKUt9NhdC7GOJQIUI5Wx6mnNxe1REfJo2Aq5quzv+BNn
	r9pNk/+IeqJgoBOwNk7sKJSCVFWhmXp4L6sCeX3BEkUDRBsVyyWKzmHwNv1G8jnh
	LCYyHG+YKZNZ9O6lan6xY973clduKbuBTkbOnGETdjOZt9hu39+/rK9YJXsmGg4B
	KzC67MM7CnvnS6QZkDFQLqj/03xiehZoaxfm/1zi9nqcKT6z6n1dF4oaAH1IbtWk
	S/SfnJeJMnXXF91LILeLqAr2HLDQCJM7w9fjAVQlKklU6rdNnt8rQF73Q==
X-ME-Sender: <xms:Ywm3ZOi20DHwc2I2Q-vavZj3pYhf_oF_G2ogFB5-gguJC8DCQ3b2pg>
    <xme:Ywm3ZPBsCNCJ_dGUhPGWfO3rcsZMDdZssLrV2WD0UJUokgZsOTRoNJht842nf1dnC
    Vx6j0vtgstWf-g>
X-ME-Received: <xmr:Ywm3ZGFaFqqNhK9ashc4CUFan0oaqDOA6YV8NIILkaeBQgxLgHUGpczK6-aOKA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgeehgddtfecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpefkffgguffvvehfhfgjtgesghdtreertddtjeenucfhrhhomhepufhimhhonhcu
    ifgrihhsvghruceoshhimhhonhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtoh
    hmqeenucggtffrrghtthgvrhhnpeekueffiedtgeffleeglefhledtfefgiedtveeiffeg
    hffgledtveehhfdugfetveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh
    grihhlfhhrohhmpehsihhmohhnsehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtgho
    mh
X-ME-Proxy: <xmx:Ywm3ZHQNBzUHS3Kdu4LlZ2vDZEG3fcN-s4nMVl0FGwxvkW7fmo8ltg>
    <xmx:Ywm3ZLy2SiWro27YGXcxEsl16HqPZIBcCREl7NK8uwHaH8z2d34_7g>
    <xmx:Ywm3ZF5SM_9B0Xs0HaPZrfJ7v4sqZGQLzVGdsoHqOkprKLL64Qpu1w>
    <xmx:ZAm3ZL9lBPVjAm1ww6VVXKZDXBIi1tb7wCUHrGfneYWdwDVty2D2dQ>
Feedback-ID: idc5945a3:Fastmail
Message-ID: <ac77ecba-6804-1d16-60dc-f184e5d31dcb@invisiblethingslab.com>
Date: Tue, 18 Jul 2023 23:51:20 +0200
MIME-Version: 1.0
Subject: Re: [XEN PATCH] x86/hpet: Disable legacy replacement mode after IRQ
 test if not needed
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, Jan Beulich <jbeulich@suse.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= <marmarek@invisiblethingslab.com>
References: <20230718122603.2002-1-simon@invisiblethingslab.com>
 <ZLaLLe2HFDN5oWUq@MacBook-Air-de-Roger.local>
From: Simon Gaiser <simon@invisiblethingslab.com>
In-Reply-To: <ZLaLLe2HFDN5oWUq@MacBook-Air-de-Roger.local>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------X67FO5taO38ffOaFRNu4C91f"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------X67FO5taO38ffOaFRNu4C91f
Content-Type: multipart/mixed; boundary="------------DwesYUbT4AhjqXaqynB78eJ2";
 protected-headers="v1"
From: Simon Gaiser <simon@invisiblethingslab.com>
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, Jan Beulich <jbeulich@suse.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= <marmarek@invisiblethingslab.com>
Message-ID: <ac77ecba-6804-1d16-60dc-f184e5d31dcb@invisiblethingslab.com>
Subject: Re: [XEN PATCH] x86/hpet: Disable legacy replacement mode after IRQ
 test if not needed
References: <20230718122603.2002-1-simon@invisiblethingslab.com>
 <ZLaLLe2HFDN5oWUq@MacBook-Air-de-Roger.local>
In-Reply-To: <ZLaLLe2HFDN5oWUq@MacBook-Air-de-Roger.local>

--------------DwesYUbT4AhjqXaqynB78eJ2
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Roger Pau Monn=C3=A9:
> On Tue, Jul 18, 2023 at 02:26:03PM +0200, Simon Gaiser wrote:
>> As far as I understand the HPET legacy mode is not required on systems=

>> with ARAT after the timer IRQ test.
>=20
> What's the relation with ARAT here?
>=20
> It would seem to me that keeping legacy replacement enabled should
> only be done when opt_hpet_legacy_replacement > 0, and the currently
> modified block is already in a opt_hpet_legacy_replacement < 0 gated
> chunk.

I was concerned that on systems without ARAT cpuidle might rely on HPET
legacy mode being available. See _disable_pit_irq and lapic_timer_init.
But now that I stared at this again, I think that condition isn't
actually needed. If we reach that code we know that we have no working
PIT, but HPET is working. So _disable_pit_irq which is run after
check_timer (__start_xen first calls check_timer via smp_prepare_cpus
and only later disable_pit_irq via do_initcalls) will setup HPET
broadcast, which should succeed since HPET worked previously.

So I guess we can just drop the condition (please double check, that
code is quite tangled and I'm not familiar with it).

Simon

--------------DwesYUbT4AhjqXaqynB78eJ2--

--------------X67FO5taO38ffOaFRNu4C91f
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE3E8ezGzG3N1CTQ//kO9xfO/xly8FAmS3CVoACgkQkO9xfO/x
ly8NuA//cWHloiu+HGskknLnmtn564hW/qtnSF7TrKxaaZiUqaeYz4yuA66AHgP5
deikZsaJ9t/xnbhdpMSZk2hqO+7XVrIjsq/fBV/uvvYy5je4JD6uq52xD3phZO4Z
UoCyoBD+1n8sRhS8468zT0LN0QqcSEktGaWWjgT/d3QzukbmHZRpHq+8Xb6RWrP+
dYJxfmTtUYnKeEmZaKmA9bGbMWCreQvJkrPJaff5ZIilrN0bdeR7ilaMNNWIG64S
VT2vTDmoDwokubmROv+tO+lx9PtFpo6B7HFR8Mt5YI15UNvbF0xE5nwzO/l6n1Kq
WnVc3Hwo6YZ8z/lwoWOVM43J/U/uQUZHgCFRk1cVNmdw0oESL6p+CRfvSfvGX2jU
vq8AvQ2Qy/Q0TDDUO/bpT6wcAen3eJ23JUCYapSV8rgpNkUdH7HdWxUCEhOUb9bP
ZFGJs1FwWAHCKcX2iA2eexU4DD1WoO6lOrWhAZAryksndmHlaC2y52xDAUq4GHJK
Di80IUyTs4mDI+I/wakU3RylnXnyFk3T7UfXvv0z3b8OoykVsBJW81yhfdhN3Ohe
IsnzshJpRxzpGFfwnIrgn1/ens28u16g56Eq1GBDREFGzw2BK4hocko1aaVZ0YGO
0nux02Ywa0acVu7ITCfLfuuZuSAFyCN+u0sb8fRffvClkZzIxtA=
=0C2s
-----END PGP SIGNATURE-----

--------------X67FO5taO38ffOaFRNu4C91f--


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 22:00:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 22:00:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565515.883715 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLsk3-00014M-5N; Tue, 18 Jul 2023 22:00:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565515.883715; Tue, 18 Jul 2023 22:00:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLsk3-00014F-20; Tue, 18 Jul 2023 22:00:23 +0000
Received: by outflank-mailman (input) for mailman id 565515;
 Tue, 18 Jul 2023 22:00:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLsk1-000145-Nj; Tue, 18 Jul 2023 22:00:21 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLsk1-00068h-FS; Tue, 18 Jul 2023 22:00:21 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLsk0-0003CH-R1; Tue, 18 Jul 2023 22:00:21 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLsk0-0000lP-QU; Tue, 18 Jul 2023 22:00:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=kaFTCvZY8W1Zwq/yd6pYymiOVk2oEo3gK3Ye1PUshDY=; b=bv00gTA8855Z/U8vmGCeIcQ6in
	ZWkDB7ESnlk9NJ8r69JTi5qnTPGq4mizVX4zSxLWvgFJxuolHpeUKRpV6ZzlkW+i6ECm/mO15oC8o
	KCRgI6tQf5RKOMdoJNBNGCBMwGAgyA1goarzoLn2kMChiPDWVYIsNUtmHwf6acMz0kkg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181857-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181857: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:debian-install:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-vhd:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=fdf0eaf11452d72945af31804e2a1048ee1b574c
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 18 Jul 2023 22:00:20 +0000

flight 181857 linux-linus real [real]
flight 181885 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181857/
http://logs.test-lab.xenproject.org/osstest/logs/181885/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-shadow   12 debian-install      fail pass in 181885-retest
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 18 guest-localmigrate/x10 fail pass in 181885-retest
 test-amd64-amd64-xl-vhd 21 guest-start/debian.repeat fail pass in 181885-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                fdf0eaf11452d72945af31804e2a1048ee1b574c
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   93 days
Failing since        180281  2023-04-17 06:24:36 Z   92 days  179 attempts
Testing same since   181857  2023-07-17 19:21:51 Z    1 days    1 attempts

------------------------------------------------------------
3778 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 630334 lines long.)


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 22:03:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 22:03:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565520.883725 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLsnT-0001eT-Ld; Tue, 18 Jul 2023 22:03:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565520.883725; Tue, 18 Jul 2023 22:03:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLsnT-0001eL-HG; Tue, 18 Jul 2023 22:03:55 +0000
Received: by outflank-mailman (input) for mailman id 565520;
 Tue, 18 Jul 2023 22:03:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qLsnR-0001eE-Nr
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 22:03:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLsnR-0006Cj-Js; Tue, 18 Jul 2023 22:03:53 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qLsnR-0001MN-F1; Tue, 18 Jul 2023 22:03:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:Subject:
	From:References:Cc:To:MIME-Version:Date:Message-ID;
	bh=tYj57VRNKW4aJQspe4wERb/q2tgkX1f0EjgA2qD+dAk=; b=fRIpBjBd1ZIJiATwowrF4wlZmp
	ps/l/TBcxBj9K6iIls600VUZaaxlEBlWwOrW9rNFU4As+VkPdxvZVEM94WM7yaLOZ5KKSkKYksfQ1
	RdTCc7oM4ndEv8f6qIlYzczkNMmNSiw+s/t/iIwci8V1NJDe2d5O7FeibYxNy9OBIDyk=;
Message-ID: <67bcdc0c-ad4f-43f7-d9ab-f11f937bfe87@xen.org>
Date: Tue, 18 Jul 2023 23:03:51 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
To: Ayan Kumar Halder <ayankuma@amd.com>, Michal Simek
 <michal.simek@amd.com>, "Stabellini, Stefano" <stefano.stabellini@amd.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Michal Orzel <michal.orzel@amd.com>,
 Stewart Hildebrand <stewart.hildebrand@amd.com>,
 "Garhwal, Vikram" <vikram.garhwal@amd.com>, Xenia.Ragiadakou@amd.com
References: <8929cafc-ea9c-35c9-e4a4-3c7ad2d1acc1@amd.com>
 <b60f4cb0-2a82-4227-de23-c59436cb47ef@amd.com>
 <9dd7e04e-92d9-bd90-dd66-0f8eefefc4a8@amd.com>
From: Julien Grall <julien@xen.org>
Subject: Re: U-Boot on XEN - dcache off
In-Reply-To: <9dd7e04e-92d9-bd90-dd66-0f8eefefc4a8@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 17/07/2023 16:31, Ayan Kumar Halder wrote:
> + xen-devel (Since the question is related to Xen on Arm in general).
> On 14/07/2023 15:14, Michal Simek wrote:
>> +xen
>>
>> On 7/14/23 16:11, Michal Simek wrote:
>>> Hi Stefano,
>>>
>>> I am playing with running u-boot on the top of xen 
>>> (xenguest_arm64_defconfig) based on ask from Kris to run QNX on the 
>>> top of it.
>>> In past we found that QNX requires to have DCACHE off before it's start.
>>> Chris found in past that dcache off is not working and he passed this 
>>> to us to take look at it more.

Xen will not prevent the guest to turn off D-cache. BTW, on Armv8, the 
cache is never really off, it is just by-passed. So a guest running with 
MMU/D-Cache off has to be a lot more careful when writing/reading data.

>>>
>>> That's why I enabled cache commands to be able to run dcache off and 
>>> see the hang as Kris.

Can you provide more details on the hang? What is QNX trying to do? 
What's the instruction it is blocked on?

Also, which version of Xen are you using?

>>> I found one interesting commit created by Marc for Android which were 
>>> taken back to u-boot upstream. It is talking about KVM and I barely 
>>> understand what he is talking about.
>>> I of course enabled this option to try it and behavior is the same.
>>> That's why my question is what Xen is doing in connection to dcache 
>>> operations.
> 
> WRT cache operations, Refer 
> https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=53b705d02cec03861044e673536586bd1b2443bd
> 
> WhenÂ theÂ dataÂ abortÂ isÂ causedÂ dueÂ toÂ cacheÂ maintenanceÂ forÂ anÂ address,
> thereÂ areÂ threeÂ scenarios:-

I might be missing some context. From my understanding, Michal is 
referring an hang. This may or may not be a data abort. Do you have more 
details you could share?

[...]

>>>
>>>
>>> commit 46dc54287031759c03c68902283d92076938305c
>>> Author:Â Â Â Â  Marc Zyngier <maz@kernel.org>
>>> AuthorDate: Thu Feb 9 04:54:27 2023 +0800
>>> Commit:Â Â Â Â  Tom Rini <trini@konsulko.com>
>>> CommitDate: Mon Mar 6 17:03:55 2023 -0500
>>>
>>> Â Â Â Â  arm: cpu: Add optional CMOs by VA
>>>
>>> Â Â Â Â  Exposing set/way cache maintenance to a virtual machine is 
>>> unsafe, not
>>> Â Â Â Â  least because the instructions are not permission-checked but also
>>> Â Â Â Â  because they are not broadcast between CPUs. Consequently, KVM 
>>> traps and
>>> Â Â Â Â  emulates such maintenance in the host kernel using by-VA operations 
> 
> I am not sure if Xen behave in same way (ie traps and emulates *all* 
> cache maintenance instructions).
> 
> @Julien, Stefano, Bertrand - Do you know more about this ?

Xen will emulate set/way instructions only when the P2M is not shared 
with the IOMMU (i.e there is no device passthrough for Arm). Otherwise, 
a fault will be injected to the domain. Even when emulating, the 
performance will be quite bad, so it is best to avoid them all together.

By any chance, are you passthrough-ing a device and QNX is using set/way?

> 
>>> and
>>> Â Â Â Â  looping over the stage-2 page-tables. However, when running under
>>> Â Â Â Â  protected KVM, these instructions are not able to be emulated 
>>> and will
>>> Â Â Â Â  instead result in an exception being delivered to the guest.
>>>
>>> Â Â Â Â  Introduce CONFIG_CMO_BY_VA_ONLY so that virtual platforms can 
>>> select
>>> Â Â Â Â  this option and perform by-VA cache maintenance instead of using 
>>> the
>>> Â Â Â Â  set/way instructions.
>>>
>>> Â Â Â Â  Signed-off-by: Marc Zyngier <maz@kernel.org>
>>> Â Â Â Â  Signed-off-by: Will Deacon <willdeacon@google.com>
>>> Â Â Â Â  Signed-off-by: Pierre-ClÃ©ment Tosi <ptosi@google.com>
>>> Â Â Â Â  [ Paul: pick from the Android tree. Fixup Pierre's commit. And 
>>> fix some
>>> Â Â Â Â Â Â  checkpatch warnings. Rebased to upstream. ]
>>> Â Â Â Â  Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
>>> Â Â Â Â  Cc: Tom Rini <trini@konsulko.com>
>>> Â Â Â Â  Link: 
>>> https://android.googlesource.com/platform/external/u-boot/+/db5507f47f4f57f766d52f753ff2cc761afc213b
>>> Â Â Â Â  Link: 
>>> https://android.googlesource.com/platform/external/u-boot/+/2baf54e743380a1e4a6bc2dbdde020a2e783ff67
>>>
>>>
>>> Code ends when it tries to call
>>> set_sctlr(sctlr & ~(CR_C|CR_M));
>>>
>>> Here is implementation. I confirm EL level which is obviously EL1.
>>>
>>> 180 static inline void set_sctlr(unsigned long val)
>>> 181 {
>>> 182Â Â Â Â Â Â Â Â  unsigned int el;
>>> 183
>>> 184Â Â Â Â Â Â Â Â  el = current_el();
>>> 185Â Â Â Â Â Â Â Â  if (el == 1)
>>> 186Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  asm volatile("msr sctlr_el1, %0" : : "r" (val) : 
>>> "cc");
>>> 187Â Â Â Â Â Â Â Â  else if (el == 2)
>>> 188Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  asm volatile("msr sctlr_el2, %0" : : "r" (val) : 
>>> "cc");
>>> 189Â Â Â Â Â Â Â Â  else
>>> 190Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  asm volatile("msr sctlr_el3, %0" : : "r" (val) : 
>>> "cc");
>>> 191
>>> 192Â Â Â Â Â Â Â Â  asm volatile("isb");
>>> 193 }
>>>
>>> Is there any reason why it is not possible to clear to sctlr_el1 
>>> CR_C/CR_M - cache disabling, MMU disabling?

I am not sure I understand the question. The code '& ~(CR_C|CR_M)' which 
means all the bits but C/M will be cleared. IOW, the cache will be 
disabled and the MMU disabled as well.

IIUC, above you said, this is what QNX requires.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 22:39:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 22:39:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565524.883735 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLtLO-0005vH-Fk; Tue, 18 Jul 2023 22:38:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565524.883735; Tue, 18 Jul 2023 22:38:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLtLO-0005vA-B1; Tue, 18 Jul 2023 22:38:58 +0000
Received: by outflank-mailman (input) for mailman id 565524;
 Tue, 18 Jul 2023 22:38:57 +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
 <SRS0=ju50=DE=invisiblethingslab.com=simon@srs-se1.protection.inumbo.net>)
 id 1qLtLM-0005v3-VG
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 22:38:56 +0000
Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com
 [66.111.4.28]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dec0ecd3-25bb-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 00:38:52 +0200 (CEST)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.nyi.internal (Postfix) with ESMTP id C7C3F5C0134;
 Tue, 18 Jul 2023 18:38:51 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute5.internal (MEProxy); Tue, 18 Jul 2023 18:38:51 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 18 Jul 2023 18:38:49 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dec0ecd3-25bb-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm2; t=
	1689719931; x=1689806331; bh=nFyyEH9VlfXlBXqNzRUaguWL5sjGOdyy8v6
	voiXeH1g=; b=iJGbneTJS7cA7H/LQnxng1ItTLP0y36uLSqkPGKKc/bKdA1o/Yu
	72ybAWnXBzkIrioaLFSURlPwkuOSY8fSx2Pfz77FNAo1jz2jkWUIj8o7Cb7t9Luh
	7svFVP9xCixPLmEg/gC1JQTGSxIuy93XZs9vR1vLaYWybonZcCjC66fcMCTk11mh
	3e8bzgRPDM7Km76iwUysJLAxEBqzqBET0SSEZvpp3xcK6uAjYvtCi59BcH4pifZ3
	pyhxlH8WKvGnWOBmqBhwWQOf14BNDjB7d2PPPdxavyTddA/AWAMsdcwExxnoU5jj
	nJRxDSmaxacyl/4FKkt3FdVL+mBfo24DfWg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1689719931; x=1689806331; bh=nFyyEH9VlfXlB
	XqNzRUaguWL5sjGOdyy8v6voiXeH1g=; b=vEai8/PrauZavfg1gsb6n2w2kW3gy
	R+stiwdeFG0hvwb+hunDkUQe5sCHdM4iLa6plgWVK2O2aNLc6K70EVwOxnirlNbm
	O4q9w7OWQByxLmbX9gmVgkkbZk1wC5JG0zi7b1TxGl0VYb4ex+EGzuecfEVuQyQh
	TTCex8f0M1owmOP05KpAwaiP0VDjkPxYIx9qJUbLgH4MJZjqM/DPzuHD1RYOylUz
	Lcxk3pQASGQwG4tLsBYF3gtOOwSNFLIXt1iui8h8x6RXEr4R+TWDCz8e0qayBVRY
	ujgZZ2IqXyqLyiO/kwvmqxmuYLWdURgdwQo4zCpdJczL/rUpZ2Rpir7Jw==
X-ME-Sender: <xms:exS3ZLe-mBStGF2lb4VSlzu1wcLttvGfc75eZua1IUORWnIf30_gjg>
    <xme:exS3ZBO6C8vtwWbL_kEJKIw9U69yWMNiJvBW32mgfx6BtbBu6KU-GODYuNwWE-VF7
    mnYzEf8OtfghWo>
X-ME-Received: <xmr:exS3ZEikD_jGuLkV15jkeL7hzJOpG8g79BsBINIuAPUNamC0c-_xPOCOGZqavdg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgeehgddufecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpefkffgguffvvehfhfgjtgesghdtreertddtjeenucfhrhhomhepufhimhhonhcu
    ifgrihhsvghruceoshhimhhonhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtoh
    hmqeenucggtffrrghtthgvrhhnpeekueffiedtgeffleeglefhledtfefgiedtveeiffeg
    hffgledtveehhfdugfetveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh
    grihhlfhhrohhmpehsihhmohhnsehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtgho
    mh
X-ME-Proxy: <xmx:exS3ZM8OhdNwPP50_C7qYemsjBpyit5oUYOqp1N5WeeJe-u3FghaIg>
    <xmx:exS3ZHsMDQBuPI-TXuxaACEpBN5v9RGvtn8-w5znNmO542iK2GKTmQ>
    <xmx:exS3ZLFuD2tO3HqYfCdV73AOwpT7ZBsXyo37ETilnjR3B-mXiiTnNA>
    <xmx:exS3ZHKZ-jYLZX-DyQvg247qEVIi9yfm37aNbvBLpzZrQx9IJut-ew>
Feedback-ID: idc5945a3:Fastmail
Message-ID: <9b53ef8b-7911-ed45-2160-60e6d553fc69@invisiblethingslab.com>
Date: Wed, 19 Jul 2023 00:38:39 +0200
MIME-Version: 1.0
Subject: Re: [XEN PATCH] x86/msr: Allow hardware domain to read package
 C-state residency counters
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
References: <946e5494801866c93332cc5d9ec0fa03a4df00d7.1689686046.git.simon@invisiblethingslab.com>
 <d512a592-24e7-2eca-16ce-7451dc110f64@suse.com>
From: Simon Gaiser <simon@invisiblethingslab.com>
In-Reply-To: <d512a592-24e7-2eca-16ce-7451dc110f64@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------0rxpIIXHNkyyVoM2hw1G9Mg2"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------0rxpIIXHNkyyVoM2hw1G9Mg2
Content-Type: multipart/mixed; boundary="------------2wrqahpHeSbi3sBPezDeCkd7";
 protected-headers="v1"
From: Simon Gaiser <simon@invisiblethingslab.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
Message-ID: <9b53ef8b-7911-ed45-2160-60e6d553fc69@invisiblethingslab.com>
Subject: Re: [XEN PATCH] x86/msr: Allow hardware domain to read package
 C-state residency counters
References: <946e5494801866c93332cc5d9ec0fa03a4df00d7.1689686046.git.simon@invisiblethingslab.com>
 <d512a592-24e7-2eca-16ce-7451dc110f64@suse.com>
In-Reply-To: <d512a592-24e7-2eca-16ce-7451dc110f64@suse.com>

--------------2wrqahpHeSbi3sBPezDeCkd7
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Jan Beulich:
> On 18.07.2023 15:17, Simon Gaiser wrote:
>> --- a/xen/arch/x86/pv/emul-priv-op.c
>> +++ b/xen/arch/x86/pv/emul-priv-op.c
>> @@ -965,6 +965,20 @@ static int cf_check read_msr(
>>          *val =3D 0;
>>          return X86EMUL_OKAY;
>> =20
>> +    case MSR_PKG_C2_RESIDENCY:
>> +    case MSR_PKG_C3_RESIDENCY:
>> +    case MSR_PKG_C6_RESIDENCY:
>> +    case MSR_PKG_C7_RESIDENCY:
>> +    case MSR_PKG_C8_RESIDENCY:
>> +    case MSR_PKG_C9_RESIDENCY:
>> +    case MSR_PKG_C10_RESIDENCY:
>> +        if ( boot_cpu_data.x86_vendor !=3D X86_VENDOR_INTEL )
>> +            break;
>> +        if ( is_hardware_domain(currd) )
>> +            goto normal;
>> +        *val =3D 0;
>> +        return X86EMUL_OKAY;
>=20
> In addition to what Andrew said: Why would we suddenly allow these
> reads to succeed for DomU-s?

That patch wouldn't actually allow those reads, but fake a 0 response,
or do I miss something. If you mean that behavior: I just mirrored what
is done there in some of the other cases. If you prefer something else,
for example treating it as unimplemented, I can change that.

Simon

--------------2wrqahpHeSbi3sBPezDeCkd7--

--------------0rxpIIXHNkyyVoM2hw1G9Mg2
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE3E8ezGzG3N1CTQ//kO9xfO/xly8FAmS3FHIACgkQkO9xfO/x
ly+yThAAntqMMZFp8JESAhHrcQWwJu2rVw6fedsPnHVREG4pMW3iZbwj948zFAns
ebgIxID/813do1K3HYNTDms0XpjsyKhAK+pDF7iqu26czh6mLTyNN3t9OGwYlZ12
O7xlfEpAZkecL1FjmCDNMHfSx4WXBKTtPBdzECZ/SIegQ84FabyRBbww0rT4vdx9
LChAESBcFiTwmPLiVla8Q5t+DKv0oenz0mUemF/IdFKweGBaxvD9Q45y2BfcbOCX
CyLXP7OqtqWHuAlR+BIELq3KjLEc9wbVQwDXRX1qthzZBGi1mf2HDuGphfIqLq1l
ad/9e7ZRs9ypGpVuNt9+k+vewVWu+QaGaDBgCv/MZ5KIDgafyUT4oEIpCv5YD3Uc
02+YzynDLpXl83TBExxTgWWemG0Qn4hAfth+J/m3o2SqInTqDHUVKficBFfszRRi
GCG5lbRm23b4XND6tOYQrrjvuj5hQGJ7otytYge1w9LbTgFIKKlRKq9fgy6KKWIk
FzXD7OOSkeoFaIkjI77QGg+bP5fYvNiYUy/4y4LA6QWYrDRUPmg/ywV6tfF8EEGO
7Fnm+bKs1TDxjVCYWqV80MLhrOyPgT/gOm3nq4eP6O3aQxtrGADGhZWV64yQx7M2
AEWvlIg6xIvlSKJ9N0MgJG/M2s9hW2iuXhQQbTw3XVpDZ6SI9og=
=rjKt
-----END PGP SIGNATURE-----

--------------0rxpIIXHNkyyVoM2hw1G9Mg2--


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 23:27:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 23:27:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565531.883744 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLu6T-0003jd-29; Tue, 18 Jul 2023 23:27:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565531.883744; Tue, 18 Jul 2023 23:27:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLu6S-0003jW-Vr; Tue, 18 Jul 2023 23:27:36 +0000
Received: by outflank-mailman (input) for mailman id 565531;
 Tue, 18 Jul 2023 23:27:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ju50=DE=invisiblethingslab.com=simon@srs-se1.protection.inumbo.net>)
 id 1qLu6R-0003jQ-M4
 for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 23:27:36 +0000
Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com
 [66.111.4.26]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id aaaa89a8-25c2-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 01:27:33 +0200 (CEST)
Received: from compute3.internal (compute3.nyi.internal [10.202.2.43])
 by mailout.nyi.internal (Postfix) with ESMTP id D08BA5C00E2;
 Tue, 18 Jul 2023 19:27:30 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute3.internal (MEProxy); Tue, 18 Jul 2023 19:27:30 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 18 Jul 2023 19:27:25 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aaaa89a8-25c2-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm2; t=
	1689722850; x=1689809250; bh=Z/Ia6kwxGkTyD0pywGMEPDu50cjjww1I9rj
	PR9g8alQ=; b=XoUtOx6SkP/eP/gUl7/AWGG2ILDwQ18Isk1V4TN4Y0roBxgDXpi
	qyUdXtDyPhSokVeUJqBbt0BFdjiNWZR6VuiGPZ2zdXFj8ippvef+aWfPIG4141kH
	r40b9opqP2P1TMmJFCI44rSBCFe73zaGC7D8SZdrtRa4r3vN9eVT+mlMMCZG1oj8
	TO0fHkLldkYMvaeoejxp4+2HH6AIpYAMML4j/U68y8EQTPIFYvRBMMdVBPo0Cdc7
	RdKfrPlpGv8SvfMTDDKyqzK3aRebqH4BCDcIiU/2QuGHyS7L+cA3pR4Ia+xKoyft
	Ba9h5TTlbNLAq99aKP+NpXMbvkhY2TTCwzg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1689722850; x=1689809250; bh=Z/Ia6kwxGkTyD
	0pywGMEPDu50cjjww1I9rjPR9g8alQ=; b=wErgwMtAjvu8NmnuSkA6VzFslAxNV
	k1WyTX5+PuF1Ur8NnsjRwOvLvIx02aLAhl+mOkZV/zVI89AJJLhU8jB4XHnkQreH
	5fjVjogLRF2w4s403TdlNNRbWEd1CyTaqsH/sx1y/Loc62CNA7SFZ/GYcRK/P85H
	I04lfWyQmBjaNgDksKc5tLp3M9SZdTv0i366B339i36HLoDRIXh9Y7urjfG7cQVc
	Nb9ZTMXK8WyGKX1Q4N69AtmRAq3xKxsj1chrNtIuKvmv3XbsVH87A8O9owo6Bi3L
	XbsmjE0ZfAe509/UTXaMt/GDlB6RAYCEVrm+DUSGx4LkZOUA8yH6GJM4g==
X-ME-Sender: <xms:4R-3ZMvHBmRElQTCuRCZMRQTIm0aiG9STi6jRALX4IbmxI7v4hUVeQ>
    <xme:4R-3ZJePfS9e9GqgPnWF6xQo3SswEyKIT2Zm9R5m6nA767jcvfm6ir1VYrISuZLuC
    pnUaCRK4oMzRkc>
X-ME-Received: <xmr:4R-3ZHwlDFAcJRA6Dfl_K9CoxamSzcht9YHPS7HnCufbWI86j0NwW8BhHQEPFw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgeehgddvvdcutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpefkffgguffvvehfhfgjtgesghdtreertddtjeenucfhrhhomhepufhimhhonhcu
    ifgrihhsvghruceoshhimhhonhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtoh
    hmqeenucggtffrrghtthgvrhhnpeekueffiedtgeffleeglefhledtfefgiedtveeiffeg
    hffgledtveehhfdugfetveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh
    grihhlfhhrohhmpehsihhmohhnsehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtgho
    mh
X-ME-Proxy: <xmx:4R-3ZPPJDFpyJlGRiNSUuh2oXnbWZKdI13z0TTcg7g6czPUetiNMXg>
    <xmx:4R-3ZM8SKvdp-tE19XNsEWv4OBahFS9WOR64cd_NcywHpmYhzAxwDg>
    <xmx:4R-3ZHWYimP3P4JphgLnfOhMEsnwmvpG9t9J76HKi07LiIsFvscnDA>
    <xmx:4h-3ZLa3H4MhE02GVwf3rX9X1HaD_Y2DRt6VDOXnGhAaLvkgIAoTYA>
Feedback-ID: idc5945a3:Fastmail
Message-ID: <60befe01-ab21-4e22-b601-c22a1e8b4ca9@invisiblethingslab.com>
Date: Wed, 19 Jul 2023 01:27:14 +0200
MIME-Version: 1.0
Subject: Re: [XEN PATCH] x86/msr: Allow hardware domain to read package
 C-state residency counters
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= <marmarek@invisiblethingslab.com>
References: <946e5494801866c93332cc5d9ec0fa03a4df00d7.1689686046.git.simon@invisiblethingslab.com>
 <bfbffbaf-01e9-3b6d-a57b-d1702ee6cf7b@citrix.com>
From: Simon Gaiser <simon@invisiblethingslab.com>
In-Reply-To: <bfbffbaf-01e9-3b6d-a57b-d1702ee6cf7b@citrix.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------CzPEsDlGUcKv42Zraq7JTsEz"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------CzPEsDlGUcKv42Zraq7JTsEz
Content-Type: multipart/mixed; boundary="------------8IlCkXLLfAmDl0wCZWuXUbt2";
 protected-headers="v1"
From: Simon Gaiser <simon@invisiblethingslab.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= <marmarek@invisiblethingslab.com>
Message-ID: <60befe01-ab21-4e22-b601-c22a1e8b4ca9@invisiblethingslab.com>
Subject: Re: [XEN PATCH] x86/msr: Allow hardware domain to read package
 C-state residency counters
References: <946e5494801866c93332cc5d9ec0fa03a4df00d7.1689686046.git.simon@invisiblethingslab.com>
 <bfbffbaf-01e9-3b6d-a57b-d1702ee6cf7b@citrix.com>
In-Reply-To: <bfbffbaf-01e9-3b6d-a57b-d1702ee6cf7b@citrix.com>

--------------8IlCkXLLfAmDl0wCZWuXUbt2
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Andrew Cooper:
> On 18/07/2023 2:17 pm, Simon Gaiser wrote:
>> Since it's limited to the hardware domain it should be safe and it's
>> very useful to have access to this directly in dom0 when debugging pow=
er
>> related things for example S0ix.
>=20
> You need a SoB.

Yeah, sorry.

> But, this is an area there things are subtly broken.  For package-scope=

> MSRs on single socket systems (which does include client systems), then=

> this happens to function.
>=20
> It does not function for core-scoped MSRs, or at all in a multi-socket
> system.  In such scenarios, dom0 can be rescheduled to a CPU in a
> different scope while it thinks it is sampling a single scope.
>=20
> This is one of the areas where dom0 and Xen end up fighting over the sy=
stem.
>=20
> I agree that we want some way for dom0 to get this information, but I'm=

> afraid it's not as simple as just permitting access to the MSRs like th=
is.

I see. So a generic solution is not so easy. Also even if there would be
an interface for dom0, my main motivation was to be able to just use
existing code like /sys/kernel/debug/pmc_core/package_cstate_show and
turbostat. You can already read those PC-states via Xen's debug
interface, but that's less convenient.

For those package-scoped MSRs, how about limiting them to single-socket
systems?

Simon

--------------8IlCkXLLfAmDl0wCZWuXUbt2--

--------------CzPEsDlGUcKv42Zraq7JTsEz
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE3E8ezGzG3N1CTQ//kO9xfO/xly8FAmS3H9QACgkQkO9xfO/x
ly+z7Q//T80TA1z1cA6FNKHNBLsH7bvAysYdGjhd9Sk4ZRDYxl3rjdo6Xy7vlBsn
z0v0du1HRZWV9PwmMfPU3AEc183R2+gvE9oaC0wmjBV3vtIs/jeHFfxASckk3VUA
RlQEVP9VU/hSPuEOcPfAYbjYdYKyIC+dotsQiaIrLyS8saxh93nLHsBiExW7+Rcz
ruJ/9KjeE4vGNVAXVwickaAwJFK7XstoKe/WG0TGFBoHzilQqChJueqZqqtju7KX
K/GgFC2lpj1yQpXDzGR+Wvfad0m7TgUDHw8g2IGgV40QjhAflWKpBQZp21uK7uKv
OQZ8mKRo3Ff2pJkg5noRz5Ur6gJYXzYqi+fUx5knXplMKNlWdt1nibnV588tLEuD
/uogtG5wjOTGyAOiffGnhJXa1NRaFOUiacAgpAv+xXR9wAVT0rv5abCXC2KBAiYJ
gQx19fDZtVnhzwTPK9r31jP+BeXH5WqvKZ2cQRT+Kn2TZjzYRt7HTI6HyAu4vmOl
YnCkVzHaiZyeQskWHGK4Zxrds8S/948M0IGDujNRBpbVe19SHpabdvlm6KC2BsHP
7hU1hsLXrGuaxz3kxrvejHSz0621EGlz8QiaiTF0mgPqatXA/Ig0w6mJa/IdpgsM
SGZfhsB+8WlAOhGUJnnVHQvs3G2MV5pD8ZFP8Zy54akNPWv5RhI=
=Q+As
-----END PGP SIGNATURE-----

--------------CzPEsDlGUcKv42Zraq7JTsEz--


From xen-devel-bounces@lists.xenproject.org Tue Jul 18 23:50:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Jul 2023 23:50:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565538.883754 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLuSd-0007PM-R2; Tue, 18 Jul 2023 23:50:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565538.883754; Tue, 18 Jul 2023 23:50:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLuSd-0007PF-OQ; Tue, 18 Jul 2023 23:50:31 +0000
Received: by outflank-mailman (input) for mailman id 565538;
 Tue, 18 Jul 2023 23:50:29 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLuSb-0007Ok-U9; Tue, 18 Jul 2023 23:50:29 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLuSb-0000Hw-KR; Tue, 18 Jul 2023 23:50:29 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLuSb-00082K-7z; Tue, 18 Jul 2023 23:50:29 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLuSb-00014r-7O; Tue, 18 Jul 2023 23:50:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=D0eYi7DC2/AnNaNUaXZUyB44KfSWrCR9Ip6pd2J8ABk=; b=zawfAouOjgJEZfTru2fpKLdXgh
	Qq6GORDdaK29yUVujI0HhnQh4voey0ZIn2AbXU6JJ6GnMpxcdBp2c5sO37S+9qBNfycuJp6SATvJh
	BF7sgdngtb9qzOXHuWYy/6T4VzlXGoMGTutlVzmaCRmW5Qo5XNUMt1vqOqbH+8BhyEtQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181865-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-upstream-4.17-testing test] 181865: regressions - FAIL
X-Osstest-Failures:
    qemu-upstream-4.17-testing:test-amd64-i386-xl-qemuu-ws16-amd64:xen-install:fail:regression
    qemu-upstream-4.17-testing:build-arm64-pvops:kernel-build:fail:regression
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt:guest-start/debian.repeat:fail:heisenbug
    qemu-upstream-4.17-testing:test-amd64-i386-qemuu-rhel6hvm-amd:redhat-install:fail:heisenbug
    qemu-upstream-4.17-testing:test-amd64-i386-xl-vhd:guest-start.2:fail:heisenbug
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit2:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-xsm:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-vhd:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-raw:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit1:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-thunderx:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-xsm:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-raw:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-qcow2:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-rtds:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-multivcpu:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit2:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-vhd:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit1:hosts-allocate:starved:nonblocking
X-Osstest-Versions-This:
    qemuu=eeaede60ffb1760c06850cae562d104e4f98c859
X-Osstest-Versions-That:
    qemuu=b746458e1ce1bec85e58b458386f8b7a0bedfaa6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 18 Jul 2023 23:50:29 +0000

flight 181865 qemu-upstream-4.17-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181865/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-xl-qemuu-ws16-amd64  7 xen-install       fail REGR. vs. 175008
 build-arm64-pvops             6 kernel-build   fail in 181841 REGR. vs. 175008

Tests which are failing intermittently (not blocking):
 test-amd64-i386-libvirt      20 guest-start/debian.repeat  fail pass in 181841
 test-amd64-i386-qemuu-rhel6hvm-amd 12 redhat-install       fail pass in 181841
 test-amd64-i386-xl-vhd       22 guest-start.2              fail pass in 181841

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-xl-credit2   1 build-check(1)           blocked in 181841 n/a
 test-arm64-arm64-libvirt-xsm  1 build-check(1)           blocked in 181841 n/a
 test-arm64-arm64-xl           1 build-check(1)           blocked in 181841 n/a
 test-arm64-arm64-xl-vhd       1 build-check(1)           blocked in 181841 n/a
 test-arm64-arm64-libvirt-raw  1 build-check(1)           blocked in 181841 n/a
 test-arm64-arm64-xl-credit1   1 build-check(1)           blocked in 181841 n/a
 test-arm64-arm64-xl-thunderx  1 build-check(1)           blocked in 181841 n/a
 test-arm64-arm64-xl-xsm       1 build-check(1)           blocked in 181841 n/a
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 175008
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 175008
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 175008
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 175008
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 175008
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 175008
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 175008
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt      3 hosts-allocate           starved in 181841 n/a
 test-armhf-armhf-libvirt-raw  3 hosts-allocate           starved in 181841 n/a
 test-armhf-armhf-libvirt-qcow2  3 hosts-allocate         starved in 181841 n/a
 test-armhf-armhf-xl-rtds      3 hosts-allocate           starved in 181841 n/a
 test-armhf-armhf-xl-multivcpu  3 hosts-allocate          starved in 181841 n/a
 test-armhf-armhf-xl-credit2   3 hosts-allocate           starved in 181841 n/a
 test-armhf-armhf-xl-vhd       3 hosts-allocate           starved in 181841 n/a
 test-armhf-armhf-xl-credit1   3 hosts-allocate           starved in 181841 n/a

version targeted for testing:
 qemuu                eeaede60ffb1760c06850cae562d104e4f98c859
baseline version:
 qemuu                b746458e1ce1bec85e58b458386f8b7a0bedfaa6

Last test of basis   175008  2022-12-01 11:10:52 Z  229 days
Testing same since   181841  2023-07-17 11:41:16 Z    1 days    2 attempts

------------------------------------------------------------
People who touched revisions under test:
  Haochen Tong <i@hexchain.org>
  Jason Wang <jasowang@redhat.com>
  Miroslav Rezanina <mrezanin@redhat.com>
  Thomas Huth <thuth@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit eeaede60ffb1760c06850cae562d104e4f98c859
Author: Miroslav Rezanina <mrezanin@redhat.com>
Date:   Wed Nov 9 10:57:13 2022 -0500

    qemu-img: remove unused variable
    
    Variable block_count used in img_dd function is only incremented but never read.
    This causes 'Unused but set variable' warning on Clang 15.0.1 compiler.
    
    Removing the variable to prevent the warning.
    
    Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <e86d5b57f9d13bde995c616a533b876f1fb8a527.1668009030.git.mrezanin@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    (cherry picked from commit 0f48c47c679bc29fceb3a67283ee3b78175524bf)

commit 83b8b039db0efefd851dc62160728a69b36e09aa
Author: Miroslav Rezanina <mrezanin@redhat.com>
Date:   Wed Nov 9 10:57:12 2022 -0500

    tulip: Remove unused variable
    
    Variable n used in tulip_idblock_crc function is only incremented but never read.
    This causes 'Unused but set variable' warning on Clang 15.0.1 compiler.
    
    Removing the variable to prevent the warning.
    
    Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <02e1560d115c208df32236df8916fed98429fda1.1668009030.git.mrezanin@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    (cherry picked from commit 6083dcad80743718620a3f8a72fb76ea8b7c28ca)

commit 7385a130d841aeaf39e8773af869eb54cc7d6a7f
Author: Miroslav Rezanina <mrezanin@redhat.com>
Date:   Wed Nov 9 10:57:11 2022 -0500

    rtl8139: Remove unused variable
    
    Variable send_count used in rtl8139_cplus_transmit_one function is only
    incremented but never read. This causes 'Unused but set variable' warning
    on Clang 15.0.1 compiler.
    
    Removing the variable to prevent the warning.
    
    Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <15a32dd06c492216cbf27cd3ddcbe1e9afb8d8f5.1668009030.git.mrezanin@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    (cherry picked from commit 7d7238c72b983cff5064734349d2d45be9c6282c)

commit 27ca28d169038bf7fe70341c4cbb8fddd3791e8b
Author: Haochen Tong <i@hexchain.org>
Date:   Sat May 28 03:06:58 2022 +0800

    ebpf: replace deprecated bpf_program__set_socket_filter
    
    bpf_program__set_<TYPE> functions have been deprecated since libbpf 0.8.
    Replace with the equivalent bpf_program__set_type call to avoid a
    deprecation warning.
    
    Signed-off-by: Haochen Tong <i@hexchain.org>
    Reviewed-by: Zhang Chen <chen.zhang@intel.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
    (cherry picked from commit a495eba03c31c96d6a0817b13598ce2219326691)


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 01:08:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 01:08:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565547.883765 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLvfn-0006g1-FU; Wed, 19 Jul 2023 01:08:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565547.883765; Wed, 19 Jul 2023 01:08:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLvfn-0006fu-Cf; Wed, 19 Jul 2023 01:08:11 +0000
Received: by outflank-mailman (input) for mailman id 565547;
 Wed, 19 Jul 2023 01:08:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xxcu=DF=gmail.com=alistair23@srs-se1.protection.inumbo.net>)
 id 1qLvfl-0006fo-Vs
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 01:08:10 +0000
Received: from mail-ua1-x92a.google.com (mail-ua1-x92a.google.com
 [2607:f8b0:4864:20::92a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b7cd713e-25d0-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 03:08:07 +0200 (CEST)
Received: by mail-ua1-x92a.google.com with SMTP id
 a1e0cc1a2514c-7943be26e84so1999175241.2
 for <xen-devel@lists.xenproject.org>; Tue, 18 Jul 2023 18:08:07 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b7cd713e-25d0-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689728885; x=1692320885;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=I6og/N58FRzuJTlGWa3AkEcxU2CWvIy+crK9VlyTw4o=;
        b=KwRoSLX5YtYMVzsbq40Eiyi5IbkjFDVe4xYO1BCeCohHVXJHTvzPD6KT2W1snVyIc7
         xFvOvhUCquS4UOwXqPj5VDM7Og7bIYPcjepnrFse06kOsnbSNK+zh0vJo9syAjhHuaje
         GUXrM0cnZYTvPHcllePzhr2f9Y7L49CHe2H8x5ks9HBPbWjM12egX7MGBOTohBoWDxUZ
         V3r/OkTUEHm5qLEDrl75T/HHcXSrkSRFcwTqpOJKWHkn7MUMtOz+lHBfopQMOA//iqg+
         X99DI9P7ttgy/f+9yoINtNwr+gh4P9930K3uXmsS52bFEfybiuLRrvKhfLV1u3J9UhTG
         cSKg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689728885; x=1692320885;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=I6og/N58FRzuJTlGWa3AkEcxU2CWvIy+crK9VlyTw4o=;
        b=K9Mn0dHsxM8T31DBOEkK/ILRAIpUjE9QlC1AXeOPm4DK+OJ71SJxYORrP+wbNbb34w
         J9iqVXgd5dp78fEUU4cP1jONGoD40MYeRInf6zcUDqym4BQKDiuTIaCbYj3F9CMAaMIL
         xlaB1svFjrVawO4jZfRKagDe5AK+sw9jD9DP3PuxXX3Fw+29SfV5Lr6qQmDsEvWb4hXd
         i8qkdqDf39/Jzd58ahd4DBTeUTkiwHb/7kdARESA6VGeyleWKhN8j7bvTiIDw8jf2wtG
         KdCCWsziwwYoUgWf0LwgAJaSeLUikUaVZQhZ7sOjySRHYrYW0Z8G+GBRwLq+26CGzd5X
         qXyg==
X-Gm-Message-State: ABy/qLYpKIr5yoJFJPEMPZXJjgpYASRDQGOX6XtAjhRbyYjf/vVqzUEe
	ElJy4IFhAPACmvM16vz+Zmit/OjL3GStkyEEb+k=
X-Google-Smtp-Source: APBJJlH/FOnarvy82+U8DKgBgSXFiNj7rujNNHGZQmaDLJ5U0VuNuK+jjhdwWon6Yo6XXuCOx09wdV6X5p7blQB5PzU=
X-Received: by 2002:a67:fa86:0:b0:443:68f5:3c80 with SMTP id
 f6-20020a67fa86000000b0044368f53c80mr7584926vsq.5.1689728885732; Tue, 18 Jul
 2023 18:08:05 -0700 (PDT)
MIME-Version: 1.0
References: <cover.1689604562.git.oleksii.kurochko@gmail.com> <2e4580f06b0b9d3b98e70536e3b2b990ec4269a0.1689604562.git.oleksii.kurochko@gmail.com>
In-Reply-To: <2e4580f06b0b9d3b98e70536e3b2b990ec4269a0.1689604562.git.oleksii.kurochko@gmail.com>
From: Alistair Francis <alistair23@gmail.com>
Date: Wed, 19 Jul 2023 11:07:39 +1000
Message-ID: <CAKmqyKP4nnSr6dM+nbktJBXWqbe_N5BftuS0N78pc40SQnubxQ@mail.gmail.com>
Subject: Re: [PATCH v3 1/3] xen/riscv: add SPDX tag to config.h
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: xen-devel@lists.xenproject.org, Jan Beulich <jbeulich@suse.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, Bob Eshleman <bobbyeshleman@gmail.com>, 
	Alistair Francis <alistair.francis@wdc.com>, Connor Davis <connojdavis@gmail.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 18, 2023 at 12:41=E2=80=AFAM Oleksii Kurochko
<oleksii.kurochko@gmail.com> wrote:
>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
> Changes in V3:
>  - new patch
> ---
>  xen/arch/riscv/include/asm/config.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include=
/asm/config.h
> index 38862df0b8..fa90ae0898 100644
> --- a/xen/arch/riscv/include/asm/config.h
> +++ b/xen/arch/riscv/include/asm/config.h
> @@ -1,3 +1,5 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
>  #ifndef __RISCV_CONFIG_H__
>  #define __RISCV_CONFIG_H__
>
> --
> 2.41.0
>
>


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 01:18:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 01:18:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565550.883774 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLvpR-0008KI-BR; Wed, 19 Jul 2023 01:18:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565550.883774; Wed, 19 Jul 2023 01:18:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLvpR-0008KB-8a; Wed, 19 Jul 2023 01:18:09 +0000
Received: by outflank-mailman (input) for mailman id 565550;
 Wed, 19 Jul 2023 01:18:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=E4h+=DF=invisiblethingslab.com=marmarek@srs-se1.protection.inumbo.net>)
 id 1qLvpQ-0008K5-Hc
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 01:18:08 +0000
Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com
 [64.147.123.25]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1a98c82b-25d2-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 03:18:05 +0200 (CEST)
Received: from compute2.internal (compute2.nyi.internal [10.202.2.46])
 by mailout.west.internal (Postfix) with ESMTP id C02473200924;
 Tue, 18 Jul 2023 21:17:59 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute2.internal (MEProxy); Tue, 18 Jul 2023 21:18:00 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 18 Jul 2023 21:17:57 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1a98c82b-25d2-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm2; t=
	1689729479; x=1689815879; bh=w4PHme9520A6pO5tvVJ90ylKSAA+Z+2idGu
	XO5dyuNo=; b=Z5eyfU1wOyb4M8M1Domw1fxaUGOzFL4g5lIA9XKaG6HRXgJxp9b
	VV+zbdJGH5wM6lwWwe+jcAaROsqOlL9Xvk15PwlfxT9cVXhiGhp+6DT6ogxH6qVB
	KrYsPbc0b9+ohOoZohWhGqgR9TSz4/+nDHX9OpuZoFTZocNzaeoLhQvdPgN7BcDz
	Vq1QEtNk5ny+S1HlgL3s1fypvaeIZA6Eq6ZIeg6LJL46cX/Qz1FOdxcrvgToVjrd
	ZM59gty+Bnb+jL/uugp1ACkzXSPInUk+uLpKAnGn046/f7LU788xyomFJWfzirkO
	zGbogk5T62pxH/B8RTqxVG9cy4TWrNCoPkQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1689729479; x=1689815879; bh=w4PHme9520A6p
	O5tvVJ90ylKSAA+Z+2idGuXO5dyuNo=; b=gLVjS36seVc4XCWgiz96Z1qFNBa2E
	K9DwQyr3a2379PeMKvSmF0xmMwNp5FyX/hwgC6sRsrel13lH/zCbZHBC4Ts5pyAA
	/bdxNkBF5pE6prOy7kSRAh0YxhyWj0bqQVnlbUbhhxzJ2zBMt0kFHIZ8NCsLQ5Fb
	4/WXLO3BUzPqYv7jIxSrl5Xam7qF0IjvveI0w9jJMo9mfO40cnNbYbeJZ5vT0U8n
	Ww+KYHHlEcOXiqqF290zIYpYLXKLyBNHayUQZcrgW3qs2f8A/CXSFVpBKdBn3jSm
	6hMeu7wYcB2O3GiQHPzyoyWRr88purPmxzQJFqAI929oRQS6yQ1+vsJ3g==
X-ME-Sender: <xms:xjm3ZKKpPHyQv8KXWOgH6wtjXvLhlZ5eAZ78sz5gP2th-HS2kKGcBA>
    <xme:xjm3ZCLiiYuqW-XBcp4uVzvP-zh1ipulIQFS9IGADgMQPbaGs0hgIGS0O77MZJChK
    gerGqPeBJxtDw>
X-ME-Received: <xmr:xjm3ZKssmDXqdcV4S_WHjgUVEdra9AXK0NMsQPdfpWSnfhKgm_nzihHCGfU0hhFMdSd-ddBhwyDaRm4BZOM0YCbvFyx2ysQuHIo>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgeehgdeggecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpeffhffvvefukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpeforghrvghk
    ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh
    hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpefgudel
    teefvefhfeehieetleeihfejhfeludevteetkeevtedtvdegueetfeejudenucevlhhush
    htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhes
    ihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm
X-ME-Proxy: <xmx:xzm3ZPYSdEZ3qh7pvJuij8XwlOwj04_tbzBG-z6s1jGPAqbZZOCnMw>
    <xmx:xzm3ZBbbgFNfGT_jtC3QN1Xr7YR7rlw8cQHk1_6QRGDrlQddyIGMdw>
    <xmx:xzm3ZLCo4d9JEiWx0Fcuf5ug4RDOYv2w3wAH7lZOThhyHmgsqJ654g>
    <xmx:xzm3ZFF09JqhxOpBfRhpamCU7TDQgWl29UbNcFyGtpVqeFBnMSjREw>
Feedback-ID: i1568416f:Fastmail
Date: Wed, 19 Jul 2023 03:17:53 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Simon Gaiser <simon@invisiblethingslab.com>
Cc: Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH] x86/msr: Allow hardware domain to read package
 C-state residency counters
Message-ID: <ZLc5woleABLgwY/M@mail-itl>
References: <946e5494801866c93332cc5d9ec0fa03a4df00d7.1689686046.git.simon@invisiblethingslab.com>
 <d512a592-24e7-2eca-16ce-7451dc110f64@suse.com>
 <9b53ef8b-7911-ed45-2160-60e6d553fc69@invisiblethingslab.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="PNjmKUn0RkxWI/eX"
Content-Disposition: inline
In-Reply-To: <9b53ef8b-7911-ed45-2160-60e6d553fc69@invisiblethingslab.com>


--PNjmKUn0RkxWI/eX
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Wed, 19 Jul 2023 03:17:53 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Simon Gaiser <simon@invisiblethingslab.com>
Cc: Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH] x86/msr: Allow hardware domain to read package
 C-state residency counters

On Wed, Jul 19, 2023 at 12:38:39AM +0200, Simon Gaiser wrote:
> Jan Beulich:
> > On 18.07.2023 15:17, Simon Gaiser wrote:
> >> --- a/xen/arch/x86/pv/emul-priv-op.c
> >> +++ b/xen/arch/x86/pv/emul-priv-op.c
> >> @@ -965,6 +965,20 @@ static int cf_check read_msr(
> >>          *val =3D 0;
> >>          return X86EMUL_OKAY;
> >> =20
> >> +    case MSR_PKG_C2_RESIDENCY:
> >> +    case MSR_PKG_C3_RESIDENCY:
> >> +    case MSR_PKG_C6_RESIDENCY:
> >> +    case MSR_PKG_C7_RESIDENCY:
> >> +    case MSR_PKG_C8_RESIDENCY:
> >> +    case MSR_PKG_C9_RESIDENCY:
> >> +    case MSR_PKG_C10_RESIDENCY:
> >> +        if ( boot_cpu_data.x86_vendor !=3D X86_VENDOR_INTEL )
> >> +            break;
> >> +        if ( is_hardware_domain(currd) )
> >> +            goto normal;
> >> +        *val =3D 0;
> >> +        return X86EMUL_OKAY;
> >=20
> > In addition to what Andrew said: Why would we suddenly allow these
> > reads to succeed for DomU-s?
>=20
> That patch wouldn't actually allow those reads, but fake a 0 response,
> or do I miss something. If you mean that behavior: I just mirrored what
> is done there in some of the other cases. If you prefer something else,
> for example treating it as unimplemented, I can change that.

I think Jan meant exactly this difference - faking 0, instead of
failing the read.

--=20
Best Regards,
Marek Marczykowski-G=C3=B3recki
Invisible Things Lab

--PNjmKUn0RkxWI/eX
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmS3OcIACgkQ24/THMrX
1ywN6Qf7BDOZnKBlOuFGyxjFHoAIEaWKDGxYXVWyGzCNHdxWwyT6HsMqbdmcyGtD
Ta3Be8UJ8UlkX29NPV/JYyzROtD1VAiNBsOo+VlAsuyaSn3eYZ7edDRvHJN68iZa
wxBF9FLi/holyWUTf730wVmeOdXtChC0Mmscqqk07U/r+185gmExJ7mf1wm0d7TR
2cIlB5Rum4ZsZ+7unRXtG6mLNX0Mvwo7i9ioq4JQI7yyFxduDgaZZklt3wvZECmO
vf24jb7fkgbXp3T/DcFmd39uSxdlkJ5BsybmXgyy1DCMNc8i2rgJnKBFkZC0q4Oi
dUupc1S8iLoL0i0jMvI6DMkzzUht9Q==
=L1Hz
-----END PGP SIGNATURE-----

--PNjmKUn0RkxWI/eX--


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 02:15:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 02:15:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565561.883785 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLwia-0007Sn-CO; Wed, 19 Jul 2023 02:15:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565561.883785; Wed, 19 Jul 2023 02:15:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLwia-0007Sg-9C; Wed, 19 Jul 2023 02:15:08 +0000
Received: by outflank-mailman (input) for mailman id 565561;
 Wed, 19 Jul 2023 02:15:06 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLwiY-0007SW-PQ; Wed, 19 Jul 2023 02:15:06 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLwiY-00037U-DV; Wed, 19 Jul 2023 02:15:06 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qLwiX-0006EH-VZ; Wed, 19 Jul 2023 02:15:06 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qLwiX-0006PK-Tw; Wed, 19 Jul 2023 02:15:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=h27SpM/1fwLwuwnVuH8Px3yokSRhbbc/TW0ciL4whFc=; b=mfGmeCYIzeDPdamcOoV6ANvh9c
	cqDHpgoFPYHoThE4SGzNvMNWIawbqvSurniMC1UndcWcM2CTAIV5uxunPM4UlpG19P0Tp0rZ7IrQk
	GEnhS/stFKN2nyzR+weKK7Vjnx9479pzWGDbh2w+5AsikfILqGbndLWngSZi2jXKOvPM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181868-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 181868: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=2d7542a8a56126fc18a19713e0e0e81085c622b6
X-Osstest-Versions-That:
    libvirt=36b247b908e50534a8450909f87bb3f0216a9ff7
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 19 Jul 2023 02:15:05 +0000

flight 181868 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181868/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181836
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181836
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181836
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 libvirt              2d7542a8a56126fc18a19713e0e0e81085c622b6
baseline version:
 libvirt              36b247b908e50534a8450909f87bb3f0216a9ff7

Last test of basis   181836  2023-07-17 09:54:03 Z    1 days
Testing same since   181868  2023-07-18 04:20:36 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jonathon Jongsma <jjongsma@redhat.com>
  Mariam Low-Ghelaghutashvili <mariamlow@zusmail.xyz>
  Temuri Doghonadze <temuri.doghonadze@gmail.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   36b247b908..2d7542a8a5  2d7542a8a56126fc18a19713e0e0e81085c622b6 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 05:20:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 05:20:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565568.883794 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLzbl-000580-3B; Wed, 19 Jul 2023 05:20:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565568.883794; Wed, 19 Jul 2023 05:20:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLzbk-00057t-WF; Wed, 19 Jul 2023 05:20:17 +0000
Received: by outflank-mailman (input) for mailman id 565568;
 Wed, 19 Jul 2023 05:20:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Vyro=DF=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qLzbj-00057n-Uu
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 05:20:15 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f03fb835-25f3-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 07:20:13 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id CD8E41F8BB;
 Wed, 19 Jul 2023 05:20:12 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A425A138EE;
 Wed, 19 Jul 2023 05:20:12 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 5xk4Joxyt2QRIQAAMHmgww
 (envelope-from <jgross@suse.com>); Wed, 19 Jul 2023 05:20:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f03fb835-25f3-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1689744012; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=2XP9hWi6MwAWUXvaq2FxfL6Mvji3sc0qi1oSVKf1xtk=;
	b=cpi124Gns3V7/tt2ITGZfsMMEQ/63Lx7H4f7/Tc4zyjVpgXPbEAcNZE4Fg1FaZdB45aHbp
	CnIV5OFazvYbtIows6TOrfqr5V311iYIvrqaU4qkF39TZLu9DeqAHnxjzWfd+9f8tepgZc
	0/g/e27aZa7WvLHTdnVJ/y75x7wD5cY=
Message-ID: <db6a3ba3-85c7-0190-759f-e5bcbd6ef7d9@suse.com>
Date: Wed, 19 Jul 2023 07:20:12 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 10/18] tools/xenstore: add hashtable_replace() function
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-11-jgross@suse.com>
 <f7e623a5-adec-fd99-4c42-fab0d04cd12e@xen.org>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <f7e623a5-adec-fd99-4c42-fab0d04cd12e@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------Da6W1PTy7RJezbeTXS1dxI9s"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------Da6W1PTy7RJezbeTXS1dxI9s
Content-Type: multipart/mixed; boundary="------------CXPMbIRlSQXl4GRCKmKj7UQg";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <db6a3ba3-85c7-0190-759f-e5bcbd6ef7d9@suse.com>
Subject: Re: [PATCH v2 10/18] tools/xenstore: add hashtable_replace() function
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-11-jgross@suse.com>
 <f7e623a5-adec-fd99-4c42-fab0d04cd12e@xen.org>
In-Reply-To: <f7e623a5-adec-fd99-4c42-fab0d04cd12e@xen.org>

--------------CXPMbIRlSQXl4GRCKmKj7UQg
Content-Type: multipart/mixed; boundary="------------4HlQ2nDEQLGtqIaUtTrnwu0Y"

--------------4HlQ2nDEQLGtqIaUtTrnwu0Y
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMTguMDcuMjMgMjI6NTAsIEp1bGllbiBHcmFsbCB3cm90ZToNCj4gSGkgSnVlcmdlbiwN
Cj4gDQo+IE9uIDEwLzA3LzIwMjMgMDc6NTksIEp1ZXJnZW4gR3Jvc3Mgd3JvdGU6DQo+PiBG
b3IgYW4gZWZmZWN0aXZlIHdheSB0byByZXBsYWNlIGEgaGFzaHRhYmxlIGVudHJ5IGFkZCBh
IG5ldyBmdW5jdGlvbg0KPj4gaGFzaHRhYmxlX3JlcGxhY2UoKS4NCj4+DQo+PiBXaGlsZSBh
dCBpdCBsZXQgaGFzaHRhYmxlX2FkZCgpIGZhaWwgaWYgYW4gZW50cnkgd2l0aCB0aGUgc3Bl
Y2lmaWVkDQo+PiBrZXkgZG9lcyBhbHJlYWR5IGV4aXN0Lg0KPiANCj4gVGhpcyBzZWVtcyB0
byBiZSBhIGxlZnQtb3ZlciBmcm9tIHRoZSBwcmV2aW91cyB2ZXJzaW9uLg0KDQpZZXMsIHdp
bGwgcmVtb3ZlIGl0Lg0KDQo+IA0KPj4NCj4+IFRoaXMgaXMgaW4gcHJlcGFyYXRpb24gdG8g
cmVwbGFjZSBUREIgd2l0aCBhIG1vcmUgc2ltcGxlIGRhdGEgc3RvcmFnZS4NCj4+DQo+PiBT
aWduZWQtb2ZmLWJ5OiBKdWVyZ2VuIEdyb3NzIDxqZ3Jvc3NAc3VzZS5jb20+DQo+PiAtLS0N
Cj4+IMKgIHRvb2xzL3hlbnN0b3JlL2hhc2h0YWJsZS5jIHwgMjAgKysrKysrKysrKysrKysr
KysrKysNCj4+IMKgIHRvb2xzL3hlbnN0b3JlL2hhc2h0YWJsZS5oIHwgMTYgKysrKysrKysr
KysrKysrKw0KPj4gwqAgMiBmaWxlcyBjaGFuZ2VkLCAzNiBpbnNlcnRpb25zKCspDQo+Pg0K
Pj4gZGlmZiAtLWdpdCBhL3Rvb2xzL3hlbnN0b3JlL2hhc2h0YWJsZS5jIGIvdG9vbHMveGVu
c3RvcmUvaGFzaHRhYmxlLmMNCj4+IGluZGV4IDI5YzI0N2Y5MTguLjBjMjZhMDk1NjcgMTAw
NjQ0DQo+PiAtLS0gYS90b29scy94ZW5zdG9yZS9oYXNodGFibGUuYw0KPj4gKysrIGIvdG9v
bHMveGVuc3RvcmUvaGFzaHRhYmxlLmMNCj4+IEBAIC0xNjAsNiArMTYwLDcgQEAgc3RhdGlj
IHN0cnVjdCBlbnRyeSAqaGFzaHRhYmxlX3NlYXJjaF9lbnRyeShjb25zdCBzdHJ1Y3QgDQo+
PiBoYXNodGFibGUgKmgsDQo+PiDCoMKgwqDCoMKgIHJldHVybiBOVUxMOw0KPj4gwqAgfQ0K
Pj4gKw0KPiANCj4gSSB0aGluayB0aGlzIGJlbG9uZyB0byB0aGUgcHJldmlvdXMgcGF0Y2gu
DQoNCkluZGVlZCBpdCBkb2VzLA0KDQoNCkp1ZXJnZW4NCg==
--------------4HlQ2nDEQLGtqIaUtTrnwu0Y
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJ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gAyzH6
AOODMBjgfWE9VeCgsrwH3exNAU32gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------4HlQ2nDEQLGtqIaUtTrnwu0Y--

--------------CXPMbIRlSQXl4GRCKmKj7UQg--

--------------Da6W1PTy7RJezbeTXS1dxI9s
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmS3cowFAwAAAAAACgkQsN6d1ii/Ey/T
lQf/dli7n1yElg4XCuso8WdsXV4asYBjxhKLUI+BLkpqceXmaAJnlvT1Vg5sAYq0TmQkNl1sEBjJ
YP89wapM5nYBRnVjaGdp5zIOdr6w5iAUtL2eDD4Rbw4aSmlMi579Hv7/LUo6aHioH2J+fh1q4I8Z
mKEMN3+Wp6DzUuusZ3zX2gtSx0tJulrk8YRVGf1fjUJDJtpTuGgsaJcJsZ/UQHu8qxG6LgxGyJ3j
KjwLdYnFZSniTA2yuyhFwRgkem1b/7y8EdEmdzhE/J93hu6ip2mWZB9bRH32+8ZkvTSWYch0NfcA
9dtcqAhiGtTADN093aamwuq5C7bDfn4DEoLSt39w6Q==
=ZoYQ
-----END PGP SIGNATURE-----

--------------Da6W1PTy7RJezbeTXS1dxI9s--


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 05:30:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 05:30:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565572.883805 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLzls-0006sQ-3n; Wed, 19 Jul 2023 05:30:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565572.883805; Wed, 19 Jul 2023 05:30:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qLzlr-0006sJ-W0; Wed, 19 Jul 2023 05:30:43 +0000
Received: by outflank-mailman (input) for mailman id 565572;
 Wed, 19 Jul 2023 05:30:43 +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 <SRS0=Vyro=DF=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qLzlr-0006sD-7b
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 05:30:43 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 65494a2c-25f5-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 07:30:40 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id CD47B218EE;
 Wed, 19 Jul 2023 05:30:38 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A186E138EE;
 Wed, 19 Jul 2023 05:30:38 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 6TbeJf50t2RpJQAAMHmgww
 (envelope-from <jgross@suse.com>); Wed, 19 Jul 2023 05:30:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 65494a2c-25f5-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1689744638; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=bmv1k5T2JC8mW5NDusryIAMyQynxd8InsGYUsj15BII=;
	b=oBo+nbPTrjKpa8M+IOSUwABRQUQ/qz1pszrJNmuoY03VcxtfXyEyiOvrOP6r6248U0aHcx
	6YmfNmD4De3TiHjxX2Vw1cI9Q4D0ohSwoJirW//M6Zyci7YOYbYI2l7NmO11Qjp5YRuNjb
	VSpVEOD+6QTv848iMkV0ucdwPIkMNlQ=
Message-ID: <bfa195e3-c55b-f1fc-20c8-a7ed98e05e39@suse.com>
Date: Wed, 19 Jul 2023 07:30:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 11/18] tools/xenstore: drop use of tdb
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-12-jgross@suse.com>
 <47c36d64-3161-cfb5-a34a-7abcf253113b@xen.org>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <47c36d64-3161-cfb5-a34a-7abcf253113b@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------y4eE0JptZV5LWX0a5ihgYJu9"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------y4eE0JptZV5LWX0a5ihgYJu9
Content-Type: multipart/mixed; boundary="------------nuy8WyElYkXMlXFUCelZWnLE";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <bfa195e3-c55b-f1fc-20c8-a7ed98e05e39@suse.com>
Subject: Re: [PATCH v2 11/18] tools/xenstore: drop use of tdb
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-12-jgross@suse.com>
 <47c36d64-3161-cfb5-a34a-7abcf253113b@xen.org>
In-Reply-To: <47c36d64-3161-cfb5-a34a-7abcf253113b@xen.org>

--------------nuy8WyElYkXMlXFUCelZWnLE
Content-Type: multipart/mixed; boundary="------------zUSWfwO9YEeqJAIYmkyBb0Kt"

--------------zUSWfwO9YEeqJAIYmkyBb0Kt
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMTguMDcuMjMgMjM6MDAsIEp1bGllbiBHcmFsbCB3cm90ZToNCj4gSGkgSnVlcmdlbiwN
Cj4gDQo+IE9uIDEwLzA3LzIwMjMgMDc6NTksIEp1ZXJnZW4gR3Jvc3Mgd3JvdGU6DQo+PiAt
wqDCoMKgIHJldHVybiAoc3RydWN0IHhzX3RkYl9yZWNvcmRfaGRyICopZGF0YS5kcHRyOw0K
Pj4gK8KgwqDCoCAqc2l6ZSA9IHNpemVvZigqaGRyKSArIGhkci0+bnVtX3Blcm1zICogc2l6
ZW9mKGhkci0+cGVybXNbMF0pICsNCj4+ICvCoMKgwqDCoMKgwqDCoCBoZHItPmRhdGFsZW4g
KyBoZHItPmNoaWxkbGVuOw0KPj4gKw0KPj4gK8KgwqDCoCBwID0gdGFsbG9jX3NpemUoTlVM
TCwgKnNpemUpOw0KPj4gK8KgwqDCoCBpZiAoIXApIHsNCj4+ICvCoMKgwqDCoMKgwqDCoCBl
cnJubyA9IEVOT01FTTsNCj4+ICvCoMKgwqDCoMKgwqDCoCByZXR1cm4gTlVMTDsNCj4+ICvC
oMKgwqAgfQ0KPj4gKw0KPj4gK8KgwqDCoCB0cmFjZV90ZGIoInJlYWQgJXMgc2l6ZSAlenVc
biIsIGRiX25hbWUsICpzaXplICsgc3RybGVuKGRiX25hbWUpKTsNCj4+ICsNCj4+ICvCoMKg
wqAgLyogUmV0dXJuIGEgY29weSwgYXZvaWRpbmcgYSBwb3RlbnRpYWwgbW9kaWZpY2F0aW9u
IGluIHRoZSBEQi4gKi8NCj4+ICvCoMKgwqAgbWVtY3B5KHAsIGhkciwgKnNpemUpOw0KPiAN
Cj4gVGhlIHRhbGxvY19zaXplKCkgKyBtZW1jcHkoKSBzZWVtcyB0byBiZSBhbiBvcGVuLWNv
ZGVkIHZlcnNpb24gb2YgDQo+IHRhbGxvY19tZW1kdXAoKS4gQ2FuIHlvdSB1c2UgaXQ/DQoN
Ck9oLCBnb29kIGlkZWEuDQoNCj4gDQo+IFRoZSByZXN0IGxvb2tzIGdvb2QgdG8gbWUuDQoN
ClRoYW5rcywNCg0KDQpKdWVyZ2VuDQoNCg==
--------------zUSWfwO9YEeqJAIYmkyBb0Kt
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCA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AcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------zUSWfwO9YEeqJAIYmkyBb0Kt--

--------------nuy8WyElYkXMlXFUCelZWnLE--

--------------y4eE0JptZV5LWX0a5ihgYJu9
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmS3dP4FAwAAAAAACgkQsN6d1ii/Ey9t
eQf8Dtw783oyEH9vBoZhewO3/goZRFvh3qyTbIr8vELirurMyIoASGrV/Z0I0QW9kIxwI1yGMqBk
McJz2HHF/rAocJm8RcfDHHCPkG0525Syn2zCpRGtwehTgAOCbVRE7XNWNWOhhntO4RpUKp4C7++P
kvJvr8uUzQnEyck+1iscEgETmmSXseyP+KUgWoPW28k7PBVdlQjdY4CXIjK3fpoKfrPlRCaknwDN
0miYvzkFrEzB9ioRQxarNC8SRT1FMQQblIlNKU5/CJFJEjmPgbRKZsxnhm22BLxNictVS5CiSbpQ
DAetGI/a+j2YYiuAuVdV+0h0ZwmtmRR8LuaHMn867w==
=kMDe
-----END PGP SIGNATURE-----

--------------y4eE0JptZV5LWX0a5ihgYJu9--


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 06:06:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 06:06:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565577.883814 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM0Kp-0002Z9-Iu; Wed, 19 Jul 2023 06:06:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565577.883814; Wed, 19 Jul 2023 06:06:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM0Kp-0002Z2-GL; Wed, 19 Jul 2023 06:06:51 +0000
Received: by outflank-mailman (input) for mailman id 565577;
 Wed, 19 Jul 2023 06:06:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Vyro=DF=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qM0Kn-0002Yw-OU
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 06:06:49 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 72252027-25fa-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 08:06:48 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id CEE38218E3;
 Wed, 19 Jul 2023 06:06:47 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9D81F1361C;
 Wed, 19 Jul 2023 06:06:47 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id kXcCJXd9t2QhNQAAMHmgww
 (envelope-from <jgross@suse.com>); Wed, 19 Jul 2023 06:06:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 72252027-25fa-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1689746807; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=YwbQk5NFbT84RF9nF2OD8KaMAwDuXLV24OxHqWNksxY=;
	b=s/7LnC4NBZSZ65xm4p2OYJdLcbrP302s0ogmizcqHsrDNBy3Neb+v9NgrKPsVs18/ecVim
	rmmOtKu/a4oMI2YDTI1dhpq5qzoqB2eof6gevfCaxzFzCcARlWQRcTmu4j1Cxx0meZX5Xv
	jXxmosDkrP6C8bees5JT4eK1vC4bx4M=
Message-ID: <9e273267-e823-8b59-01db-769b9ef5b1dc@suse.com>
Date: Wed, 19 Jul 2023 08:06:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 14/18] tools/xenstore: move copying of node data out of
 db_fetch()
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-15-jgross@suse.com>
 <e68b7364-545b-ff31-3371-3a682603ead7@xen.org>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <e68b7364-545b-ff31-3371-3a682603ead7@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------SggibFRGBc6ufwBw96RvKyEP"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------SggibFRGBc6ufwBw96RvKyEP
Content-Type: multipart/mixed; boundary="------------MNqDDeG9A4yqcLtPwvyW7hMr";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <9e273267-e823-8b59-01db-769b9ef5b1dc@suse.com>
Subject: Re: [PATCH v2 14/18] tools/xenstore: move copying of node data out of
 db_fetch()
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-15-jgross@suse.com>
 <e68b7364-545b-ff31-3371-3a682603ead7@xen.org>
In-Reply-To: <e68b7364-545b-ff31-3371-3a682603ead7@xen.org>

--------------MNqDDeG9A4yqcLtPwvyW7hMr
Content-Type: multipart/mixed; boundary="------------nAsMwegkqgemdjBbXymipi3w"

--------------nAsMwegkqgemdjBb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pc3Npb25zIGFyZSBz
dHJ1Y3QgeHNfcGVybWlzc2lvbnMuICovDQo+IA0KPiBJcyB0aGlzIGNvbW1lbnQgc3RpbGwg
cmVsZXZhbnQ/DQoNCkkgd2FzIG9uIHRoZSBlZGdlLCB0b28uIFdpdGggeW91IGFza2luZyB0
aGF0IHF1ZXN0aW9uIEknbSBoYXBweSB0byByZW1vdmUNCnRoZSBjb21tZW50Lg0KDQoNCkp1
ZXJnZW4NCg0K
--------------nAsMwegkqgemdjBbXymipi3w
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlv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y2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------nAsMwegkqgemdjBbXymipi3w--

--------------MNqDDeG9A4yqcLtPwvyW7hMr--

--------------SggibFRGBc6ufwBw96RvKyEP
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmS3fXcFAwAAAAAACgkQsN6d1ii/Ey/+
MAf+LPqEdM/A3wZ6RO2fXFC5cjmhn35O3PPfNgGw0eD9SZ5Lx1Pk8JzEFh7qecNcs6icTNCkEOsK
EqUqqTMGhY7vUlw1nJ4neTkHAWrjHrXfUCasVXCJIInWYZ0k3QFEsjHF3MB9X7AcnmHcf57eafFk
7bCkzaAfzU7ZSo9NzZsk8lTuWJGg3MBTQ0qhnIaZmtLAlh1Efy8K/2s5J2Je+/S+o+qg3kTK+wl1
pSdytvVn+Emy4W15GuPqHqt6vHp6a2MEXj32jTiZRw+vERKw6xcWdBDPqkXb+1LSCPRQVM3MJjOV
JvzT90dbDbY33LmBfpUakB5rF3y4rbAYS5U85tx/dw==
=ptuf
-----END PGP SIGNATURE-----

--------------SggibFRGBc6ufwBw96RvKyEP--


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 06:13:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 06:13:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565580.883825 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM0RL-0004Cn-9j; Wed, 19 Jul 2023 06:13:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565580.883825; Wed, 19 Jul 2023 06:13:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM0RL-0004Cg-79; Wed, 19 Jul 2023 06:13:35 +0000
Received: by outflank-mailman (input) for mailman id 565580;
 Wed, 19 Jul 2023 06:13:34 +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 <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM0RJ-0004CD-WD
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 06:13:34 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20610.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::610])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 624d6e1d-25fb-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 08:13:31 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBAPR04MB7223.eurprd04.prod.outlook.com (2603:10a6:10:1a4::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Wed, 19 Jul
 2023 06:13:30 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 06:13:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 624d6e1d-25fb-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ZzajBYHtEypvanAvT4ILeLWDNtWAJ2x8Zh06hKCHGr4CsJso8CMdEHRVDXXjEWqoo5bOP/zOKvf9GNx4252WqMppTYY8kHFueFgs6hJIRtPCj4+jSzCzzr3DhOSDa7RfuZW+yUdpvknuJ7IuFw1eaH2WzMnA0chreALYKJ3xBu+5qxblaagEUAuoMS8dW491P+3WqIBD0v8xA/eMpaORfmoYFZXZk6kZ2XzgYD5poz5H6b8sFSb++vh5r+16NRJMSI8PD5ZSfK9snjDv17sNocqey3RRv+X2QFB2W2MX7L/QwEGIAb7z88y1GI1Jl5D80PiTpZc60cWryVZBFqGvJg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=EkWYARiSVOLsksrPhMJk5Smy0GzNf2Gmjw33xbrrDSc=;
 b=SMaZ8G4e/G//RmQrlkPC0A73InHux4eOaVS6yeEb50HrhSESpJLPaAl0N8lfuhnuLxXmd8btJQ2idXBrsCCORHkvp3wVvRfR5dB1nt/TbmLDmm8rzxUXuwl2ILgzoSkx2IEJoJlU42yivg/yHRNchef+1ZfQ2NrmlL4retSi6rKOw5xRXpO195fj3qnN82VBQM1olltvU78eHfw6qdhcnvon3fd4g3F+xlnIru3wxEvIv+HXxDyHJ5hKFIbWDDsmeXigwefTYykDyUxZV0vy7hlY1gAKy1GftJkQEifVHHEjiK22tuS7UqF23yjCIQI82SSIifgMe+ovagKPQOfKGA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=EkWYARiSVOLsksrPhMJk5Smy0GzNf2Gmjw33xbrrDSc=;
 b=ujiyHNbKUqgyPpWH0/W1d3H1A2ey5kSck/+Uh7zufAErVcTyTQVlBFPlyURd7njgL/hrS6f6fb8J1IOfLWBOxWJVkifHB3BZyKNk5ptZxop7ABZn82PjdQXqLYf+JwCCSLTCxF82SwN+Xnuvgdz+38w2ChoKyCkO0Rcwdu5HSGNvR5iYgIKcOX9zjk1McFs6q39bobqqIsa/XTNgzXhdYBDEQ8l30cRFS4fZI8PXOnucGD2iu6fykdAg+uWDwE/GsiQc6zpn8uiz6SIhartSjhx0IbF22ENewISVjA1+z3guUINi0TkFEoGjpmq2ZCDkw3Hoqh47mVS+1oKhI9ocsA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3c087e81-73f2-b284-d035-807f64b78e6d@suse.com>
Date: Wed, 19 Jul 2023 08:13:27 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 3/3] x86: Add Kconfig option to require NX bit support
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230629121713.1211-1-alejandro.vallejo@cloud.com>
 <20230629121713.1211-4-alejandro.vallejo@cloud.com>
 <386eb540-8688-1a95-1e75-133bb21223fc@suse.com>
In-Reply-To: <386eb540-8688-1a95-1e75-133bb21223fc@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0267.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b5::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBAPR04MB7223:EE_
X-MS-Office365-Filtering-Correlation-Id: c69cab06-4577-4207-5f4f-08db881f459f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	V4nwnJIFQfuLFMtvMCds0ncbyhRsYQevn4zmqqbGI7eT5wH5kD/bdDCYveOAzg6U7mzHgoIf5xK7aqZGC3AKlJzL7SeI0qchwcCLJv67U1Sl3Nbj2KljtaLIbR1bJ9YHuUrW12nVkYveBJkyxYnp2OxzBUaleI+UNxLtvaHdmLlNOJC9wgyrgU0sYmtOXf8SrjJiv9BpOY099dmUy8t50dFUVEO6Jw2UmqDdcOJIk1+3qGOueGbVhjWZ9QHmRH1NVnJg2XMWhkyUoYVjYplHIVL6HzLuE5CLQhYpxlrY9WJZJF1LkD2/9ZnqWddizZup60N5TIdHxYIBD8wCi93O4k7iC7x7GkAmduLjg0C2PjXWZsY26foVhytDgy/mgr43i9qfcTgQrtQQxsX7rc9ShbHhJc6sCpLDGFfrARmwgDVTBzKQVb4gftPbmEotHQZ4d2bV5n5ZToq1MOmu1E5jkur7+q5VYWIWgNIUrfK+6BZvie3wsvUD3EvRfCS9MyJL52ulaJDrLBGfEl91bJSvA+cvJyTfB37c0lBkWsFWty0fTMECNW3FgvaX4IdTykGs1mefmhiaxKxx1gqomZcf4qFRThZX+7Gytd/7Xt35oH5Xu16RbG1wQMQqElyP813lWXiW9shoiYjKZVLHo6OsIQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(136003)(366004)(376002)(346002)(39860400002)(451199021)(8676002)(31686004)(66946007)(66556008)(66476007)(38100700002)(2906002)(8936002)(186003)(5660300002)(41300700001)(316002)(2616005)(54906003)(6512007)(31696002)(86362001)(6916009)(4326008)(478600001)(26005)(6506007)(53546011)(36756003)(6486002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZVd1UTU0bHRjUFhsbWVkeFdWVkFPRGFWQmJGUkVhKzllL2p5N1NOUDI1dGp2?=
 =?utf-8?B?RE9uZ0xWTU9Dc3dpWXltSlZNTVA2Q0Mra0dSZGtZbEQyc04rZGZnWG81T3Bx?=
 =?utf-8?B?aXBXckJxelFFQ1FhSEdQT2FFb3I1eXpwaTNobVc1ZFNBTHhjblgxTjBwY0Iv?=
 =?utf-8?B?bHQwb0ZVQXZJNzJjRE1MV1dkK21qVS9Fb1Bkeko3czdQOWRkOWVUdUJtMDA5?=
 =?utf-8?B?a3BXeFBVMFovOCswMVNIclVOS3BWNkkzWi81bVhybjNlNGVFSGtQbDZIZ3hz?=
 =?utf-8?B?RVVoKytxM3N2cStISk1QcDhCOUVuN3JZcHprWkxaaDZZckJTQVlZMFN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?=
 =?utf-8?Q?+q7YjArsOUwJnR3M+QH6vAKhM?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c69cab06-4577-4207-5f4f-08db881f459f
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 06:13:29.7984
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: z6j7O4X4qN3PpeSo+e+ga6pzaSKcUpSSTToSX5I5h7M2BanW8S9xKutX6ipKG97AucJRt4M8yObEVkMPlJfLTg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7223

On 18.07.2023 15:19, Jan Beulich wrote:
> On 29.06.2023 14:17, Alejandro Vallejo wrote:
>> --- a/xen/arch/x86/boot/head.S
>> +++ b/xen/arch/x86/boot/head.S
>> @@ -123,6 +123,7 @@ multiboot2_header:
>>  .Lbad_ldr_nih: .asciz "ERR: EFI ImageHandle is not provided by bootloader!"
>>  .Lbad_efi_msg: .asciz "ERR: EFI IA-32 platforms are not supported!"
>>  .Lbag_alg_msg: .asciz "ERR: Xen must be loaded at a 2Mb boundary!"
>> +.Lno_nx_msg:   .asciz "ERR: Not an NX-capable CPU!"
>>  
>>          .section .init.data, "aw", @progbits
>>          .align 4
>> @@ -153,6 +154,11 @@ early_error: /* Here to improve the disassembly. */
>>  .Lnot_aligned:
>>          add     $sym_offs(.Lbag_alg_msg), %esi
>>          jmp     .Lget_vtb
>> +#ifdef CONFIG_REQUIRE_NX
>> +.Lno_nx:
>> +        add     $sym_offs(.Lno_nx_msg), %esi
>> +        jmp     .Lget_vtb
>> +#endif
> 
> Since I'm in the process of introducing more such paths (for the x86-64-v<N>
> series), I'm curious: Have you actually had success with getting any output
> from this code path? I see unreadable output come through serial (provided
> it's the normal com1 I/O port location where the serial port is), which
> likely is because baud rate wasn't configured yet, and hence I might have
> success by changing the config of the receiving side. And I see nothing at
> all on the screen. While kind of expected when in graphics mode, I wonder
> whether this ever worked, or whether this has simply bitrotted because of
> never actually coming into play.

Pretty clearly this was broken in the course of adding MB2 support, by
b28044226e1c using %esi as the "relocation base" after already having
clobbered it. I'm working on a fix.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 06:16:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 06:16:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565584.883835 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM0Tz-0004qF-S5; Wed, 19 Jul 2023 06:16:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565584.883835; Wed, 19 Jul 2023 06:16:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM0Tz-0004q8-O2; Wed, 19 Jul 2023 06:16:19 +0000
Received: by outflank-mailman (input) for mailman id 565584;
 Wed, 19 Jul 2023 06:16:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM0Tz-0004q2-1C
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 06:16:19 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20611.outbound.protection.outlook.com
 [2a01:111:f400:7d00::611])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c595841c-25fb-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 08:16:18 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB9571.eurprd04.prod.outlook.com (2603:10a6:102:24e::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Wed, 19 Jul
 2023 06:16:13 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 06:16:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c595841c-25fb-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=SAgtHUzdvm1DFndV0n2b5NIUTwL/tpcMOrF5TaksPsfusTFjEpm3ZJLx3P5Sken3+8ZyKwZbcnQJyVibvK6LkojLRUyvMHlcANFFZL4xxLGjOE/k+eNcSkMKvgRfMGucHs2lkq/++867kwFtGxlrBhNoFSkwoilwlGruSeEySSQpbi3gUBrOqwmxtVQb2K2O+aeIkwskLw/jqzZQTTg92F2hrmvS2fR6Ykx2I953tuD1U83PD4yePbxwO7J0bQzdHnAvYvqGJxlOl4pmZVpkGK4seZpAPWJUd+Ww3l0ZxUBZRLKpo57i72haDuAuWB8oanf355WqXfse0IpZdbD2qQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=GnZqrkBNXtQN0UTDeaL7zdZ/zazlm+WVNy9KrPZqocw=;
 b=YkFNmNzrTiZlj/np4oN1OFxptH35Xh0PH7qGfWvpAoq1JF7NIbsf0zCqHl1dBk8qOvfqYCKsCX7fJwuzuZRwqXkKjYm35tKa4siiFyKYeuOdNJM2E8I2v1lTMy8sLk13B7CH5/M7tkdd4ueyNgrPJqiH5z8rKjBteU/weYQHBIL8NFy3L86MSxmYBOK6Txf9KKX9Cr2YvEDyeGWuM9iU3qSOEx/U0rDLPlMZo3dsAgKBVm6ZFFwWs0zwzKZWekCDwkWAXTKFBhKVf+vUArGQk/0dpXqkDDOKcsJ63QLiaw1OIMzaAM0HYR8wvrR2PxbvUX7UVq316WaNKLftgVuT9g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=GnZqrkBNXtQN0UTDeaL7zdZ/zazlm+WVNy9KrPZqocw=;
 b=yO5Pgxrtra+OLmTrsrDjPL2AeLWsM4Z1ojnMgvm/qMWJKhyjZE9fsocRZJzX2/Ci4SgLSKi1DSVt5tTQ8wgHeq45RZgeS0+P/iPZU3n4gw609k/yVgQeRMYzp9hazL0alvVmRJAAZgzGKQDWtNWGF4KIvB22SuXFSc9cDSPd3W9J+gqZ8nwYEfYhTq5JL7peb+aA5yLhOQRF2SMJs287nvKZr4VZdfyWRC4CXt+K7GXbH/3OIVRI4ncu8FncMmu5JQVNIREE+mv58ZuEHYHP7hnz3G83PwrDWCMZBggCURdi/x0KPcksvEalXKUNQ48yafyKr4Q/fvdIka2IqfmQ3A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3d51c011-d2e2-100d-3097-aa086e7dc582@suse.com>
Date: Wed, 19 Jul 2023 08:16:10 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] x86/msr: Allow hardware domain to read package
 C-state residency counters
Content-Language: en-US
To: =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>,
 Simon Gaiser <simon@invisiblethingslab.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <946e5494801866c93332cc5d9ec0fa03a4df00d7.1689686046.git.simon@invisiblethingslab.com>
 <d512a592-24e7-2eca-16ce-7451dc110f64@suse.com>
 <9b53ef8b-7911-ed45-2160-60e6d553fc69@invisiblethingslab.com>
 <ZLc5woleABLgwY/M@mail-itl>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZLc5woleABLgwY/M@mail-itl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0185.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ab::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB9571:EE_
X-MS-Office365-Filtering-Correlation-Id: 058dee4f-ed9d-4561-4d5f-08db881fa6f2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	6AuJiDu/iEOL4stERd3bs63tyJWAz/v6s/neDgSJG72JWTP2EbEtLxsmnWCcp3H7t2Ik6bUpP8GG+B5n+HFa3HbTMvgz9NGfyEIgMRt1fMV1NUzrDT2Ac4vkqfn5z8fwq0gX3v/JHDrwRA18xReyej9Mwj13kcTonzt+7hzxHxsY6mv3FdRo2zCpCMN0oXZJqQ+EcXEHUK7wYR0a8RJJcHLeZPB6NXmEyI6yp92DAXwyBJHgqIVpJDAdJ7OuhU+mlCvZbt+JjlG3HXY1fW4Q837K2cQ6NcHCOW+sVcIQYp7TcLbo9ZjOn3nqyrDNqaQw+yc82rr/N0JyJ6e9pFoHJWLoeh3/dLFv2XUam4U7kmJ9Zbsx5wkF8akThc98QCmdHx66t3vCIGhphwDXh1QF/shVSNiteDI1D17iNQ/YaiUxvTo2zOZqZsi4vsRCoXtNAtnoOPq6JgSeNNXAGOBULcPd0bwb+AgQcP4sKjgnOfNEGMBox3/uSb2pMrE3CKgSr5qCh9X6CWneB9shnHzF9OEuST8huMMc3oKzHk/PUERd5AhcvIygk+6bBBmmIFHco8XpEOoWF4HpbYYl80Cuuokuyh8ObtppwpOS1x6UOqyZl3DGGL7VmiVy6K6MIaHMDecVCJMC3KfEy2Spzwcn0w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(39860400002)(136003)(366004)(396003)(346002)(451199021)(31686004)(31696002)(86362001)(36756003)(2906002)(2616005)(186003)(6512007)(6506007)(26005)(53546011)(38100700002)(6486002)(110136005)(54906003)(66556008)(478600001)(316002)(5660300002)(66946007)(66476007)(4326008)(41300700001)(8936002)(8676002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Ym1LUWhMcWFTWDdZbEZRNlpySmpKRFI0ZUljcC9RcXk1c3ovSTd4VUc1WmMr?=
 =?utf-8?B?c0hnZStwTmUyZThnR2xmOXArZXMrNzZaNCtQVm1TQmsyK0k2QThYdUFxSFhn?=
 =?utf-8?B?TVR1NTJqWVVmN0c5MFlxUjFpMFVHUWxoZFlVMVUxbEtPc1VuZHo0WnF0WFFX?=
 =?utf-8?B?WUNKeFJXcURMWXNjeFE3bEhhdVl2VHgwUjRMaGQvSCtKQy9oeGpDeCsxS3Ez?=
 =?utf-8?B?UVdkcVhObnlpNUZBOTF6VnZOdHY0WUh1S01UNXBwMGNJcDFET2ptei9kNWsy?=
 =?utf-8?B?UnZnT3UxU1lRcmhRN0FUTGU4ZE4zME1wZmdiVFJoZXExeVhHeE42SGU0amlF?=
 =?utf-8?B?WlFFQkRHZnZYaWVWaVd5ZEp3QzVVWTZpV1hVbGg1UzJSWTFZTExUNDRkWEpi?=
 =?utf-8?B?RWtnVXAxZmJrbTNwNWl5VnVnZHRmSWo0aGR0WUk3UmpESGNLNFR4TWl5eU1y?=
 =?utf-8?B?RGZOaVEvZitOWlZYSjltVXZKUlRpcGN3QVFwUS9haTltWmw5TXpxOUpnbjJV?=
 =?utf-8?B?YjZBU3ovZ3QwSkJlSUZZU0tRWlFIQnU1dlNTc0FhRmpoRmQ5T3pqVDcrV1Vq?=
 =?utf-8?B?NnBvQnNZUmF2TWdRaVJ3V1ZsMFdjeFI3bVh2THZSNSttRlVSQXl1YnVpN2Vx?=
 =?utf-8?B?SDBpYmcvdXZ1TnI4eVBLSkN3M21wMTVvUzVrSGV3aktJWVZWS3JGbXk2S1pC?=
 =?utf-8?B?R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4QWtVSTRMb0hoQ2JEajUvYk5ZN1l3UU00?=
 =?utf-8?B?Mk1rUnJoTzFubmEyUHN3dTRmOStaeXI1djczbTkzVVU4RTdTQnRycGxTTURz?=
 =?utf-8?B?YVdVSUQxOTZRcWoyb1JyMVFxdzB0eWN4RzQybWh4a2JPWVpTUkw1a3RhajBw?=
 =?utf-8?B?TXJMS2JYQjF2S3Y4aW93ejVjUVRxQkkwUkZ2bGpzZUlEMFpFd245OXlLd25P?=
 =?utf-8?B?MkVEbjhma0tuNEdzS2twUUhsbUpQQk0xRFVIQ21KWHRaL3p0VVU1ZGdybkNq?=
 =?utf-8?B?STV4U0ZtanRqcWl3UDFuZk5tamMyU3l2UzNFRFZMcm52UG8rczJWTVJLcG1Y?=
 =?utf-8?B?RlplRXRVVURnWUR1a2lkM21nK2NNcnhFZ0FXMUFkWlVNZUNPeVZlUjBmSlFD?=
 =?utf-8?B?djBta1RIQjJPeWhBZWpiM1R1NStDeU5vWklwTDVQVTUxWko0SlR3eVhHVnVL?=
 =?utf-8?B?eVdGbVdhSHk2aUNueHo5Z1AvYkN4SzBGeXdMb2NOZ3VqMWJvWjA3SUd2WHpL?=
 =?utf-8?Q?g+DLfDJTENXOshvZqQ9MVNcLg?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 058dee4f-ed9d-4561-4d5f-08db881fa6f2
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 06:16:13.0332
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: XrBg6+ptkIJTtMZflUf0X7/SUvu9P9MxwdYB4Nk2JIMbTTmohi4KJFpryjIhFP6OiMf/1eNU2Mx32lXLSsqTPw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9571

On 19.07.2023 03:17, Marek Marczykowski-GÃ³recki wrote:
> On Wed, Jul 19, 2023 at 12:38:39AM +0200, Simon Gaiser wrote:
>> Jan Beulich:
>>> On 18.07.2023 15:17, Simon Gaiser wrote:
>>>> --- a/xen/arch/x86/pv/emul-priv-op.c
>>>> +++ b/xen/arch/x86/pv/emul-priv-op.c
>>>> @@ -965,6 +965,20 @@ static int cf_check read_msr(
>>>>          *val = 0;
>>>>          return X86EMUL_OKAY;
>>>>  
>>>> +    case MSR_PKG_C2_RESIDENCY:
>>>> +    case MSR_PKG_C3_RESIDENCY:
>>>> +    case MSR_PKG_C6_RESIDENCY:
>>>> +    case MSR_PKG_C7_RESIDENCY:
>>>> +    case MSR_PKG_C8_RESIDENCY:
>>>> +    case MSR_PKG_C9_RESIDENCY:
>>>> +    case MSR_PKG_C10_RESIDENCY:
>>>> +        if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
>>>> +            break;
>>>> +        if ( is_hardware_domain(currd) )
>>>> +            goto normal;
>>>> +        *val = 0;
>>>> +        return X86EMUL_OKAY;
>>>
>>> In addition to what Andrew said: Why would we suddenly allow these
>>> reads to succeed for DomU-s?
>>
>> That patch wouldn't actually allow those reads, but fake a 0 response,
>> or do I miss something. If you mean that behavior: I just mirrored what
>> is done there in some of the other cases. If you prefer something else,
>> for example treating it as unimplemented, I can change that.
> 
> I think Jan meant exactly this difference - faking 0, instead of
> failing the read.

Indeed.

Jan



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 06:21:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 06:21:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565587.883845 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM0YQ-0006T8-CC; Wed, 19 Jul 2023 06:20:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565587.883845; Wed, 19 Jul 2023 06:20:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM0YQ-0006T1-91; Wed, 19 Jul 2023 06:20:54 +0000
Received: by outflank-mailman (input) for mailman id 565587;
 Wed, 19 Jul 2023 06:20:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM0YO-0006Sv-VF
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 06:20:52 +0000
Received: from EUR03-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur03on20619.outbound.protection.outlook.com
 [2a01:111:f400:fe1b::619])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 684f8266-25fc-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 08:20:51 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB9571.eurprd04.prod.outlook.com (2603:10a6:102:24e::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Wed, 19 Jul
 2023 06:20:49 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 06:20:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 684f8266-25fc-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LODy5CiWCDQFvStmfkiED9t7ohMKgyzafUqTF5oMaON2w4536gUTE2OB9Jr9zbZXwYNSg9++7HUWg+0MHKL4URV68lbIQ1TsPjOZeJxQ6UzRHY6LOahAcDosWG5kSFhlgRPAyoHdAgZqzvYaER8qxKoWELwy8UG3iT3EZEtahFGtk6OmPUACazEKXso6OTFIw/cp4Ue+e2erXvtZhwGr9oKyDmDoVGBUN5bZpncixRqZPcVXCCwFU6k4YlHYPdvmraqAKjT6wLRHJ9KV8HfWQgFRf0fPZRCV6T1jxwVfkocASPP3cAcalAHHXsaFhXWLuBZQvdXpe+qfQ0/ydmeEug==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=YUSCWpDXcVPScQSMRPKosNRXK8r1O3dIvtD0aGktKWI=;
 b=NifN0BL6CmX2SWrurHxu8raX6tfa9MoqzC2zHtoRjf49UlReKxIajPrhkwp3jHlsqU8HUN0/gPhI6zKIt5BHnKKu3193T6geNpQjRy4KF3yNJc1LAKuPEERLsuVWIyHK17Ego9LgRzRKina/c0fs4K1a7RgEBHXl5+6Ew5h7gnZTRX5yG0wZMVn40St8U4jF/K5D9N64FRz+CcFDZeEMYLzGPXb+rD7xhzE/B77J5v4tdob89jGCqd0TInRhAfk69IxW/y8NElhb54RvagybUzOvUXpKSn8mDBvLkl1vsIotssdAEVYPJ1f2l0ykeeioLrDU70czHKZqM+y9TtI5cg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=YUSCWpDXcVPScQSMRPKosNRXK8r1O3dIvtD0aGktKWI=;
 b=GkQDjfURDzTEO6fa5wP3h+vKPyTuY1Ir2EdUMfvpAbb/XwLtWNBFVi8E/V1DV0hH4pfF2f1F4wdiFiwy2BhcE36CuJH2tbI+UBPmnl6idrz+G3udZDUDwB2VFHrD8ZNpRfx12QJ3mDvxMoMexcYjrXbeeDKtEqPnbAPb4bOH4no+tv5ppT/UrOexp29RPe+k7YV3WY34gNMCqzKVRzHBqYbjrDbwOwrRiCnLyTRsSdQTTe/IePEHGRyWQDch6GhYr0V9qZN31BuF1uotJ2WQYJallUGdoHhmUg1iaLiFVZDivZQtHzkZbnGZ2SZpumbplvWVg2L7yk1hpuj2XR3f0g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <15a30769-4a61-ca22-7b5a-6249186cd8a2@suse.com>
Date: Wed, 19 Jul 2023 08:20:46 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] x86/msr: Allow hardware domain to read package
 C-state residency counters
Content-Language: en-US
To: Simon Gaiser <simon@invisiblethingslab.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org,
 Andrew Cooper <andrew.cooper3@citrix.com>
References: <946e5494801866c93332cc5d9ec0fa03a4df00d7.1689686046.git.simon@invisiblethingslab.com>
 <bfbffbaf-01e9-3b6d-a57b-d1702ee6cf7b@citrix.com>
 <60befe01-ab21-4e22-b601-c22a1e8b4ca9@invisiblethingslab.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <60befe01-ab21-4e22-b601-c22a1e8b4ca9@invisiblethingslab.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0023.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:14::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB9571:EE_
X-MS-Office365-Filtering-Correlation-Id: 34bc5013-5113-400f-f13a-08db88204b92
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	bxMkUEGjud+qVJE34VVsQPtPk0c1be1lKW4MVNVA5FMVyqKxDCqzxY+G9I01mJyto8stLsRZW9fURzsYJ4dWgIiQUrmAz9W4MvAyQuUFJtuQnSvntTltQ1Um/jLpRTC5G9dKqoVwxcdx0s0z0aJheggi+d3zdsvLRL2BtKoeER4JECunj7A/4Mvcoz6TZcUpkXM6GkYje62QhuPziKvshrTk/kae/yGnaU/XXV8gb27YlqApSTq5aGnZFkhebDMsRe3aPIYDpM1VJuuJKkwEo3in+Mz4PznX6DCSBZuq0wxiiPpanJwQTbtIjv8pJILwu+XTnXP/RBtbuy08OV/KjTz4C+dSZuGcBnYyHPN9c2qdIRjtCCSQL3iN5I1kDkFnfYyC5/Em8ojp0sk89fAbk9xVBY3k2jwJu0h9Q8UhK7UZZHw5dMT0w1o0tfDeocbBepnRIuQZu34+RIwPIQYlkjJuJnnCL6ukVJDFRk/PSnPkRnLaNLtLDZbpXJnJ57/mf73a4sKFLvecy7QAI9hiUx45+RXpkszIRoj/5R475L+TM5YRHqBMuPRYYOizZDOZwz8TJ2OAnRceAKBGsX7LEJ9d3EsCbc6S3h1h5fqZN75DhBQCvwl+j9X0fxepV7pgeZ5aWAO00zVM+Kq3ZYwdng==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(366004)(136003)(39860400002)(376002)(451199021)(54906003)(6486002)(38100700002)(6666004)(41300700001)(8676002)(8936002)(66556008)(478600001)(316002)(5660300002)(66946007)(66476007)(6916009)(4326008)(6512007)(186003)(83380400001)(2616005)(26005)(6506007)(53546011)(86362001)(31696002)(2906002)(36756003)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Zjh6ejhCcDg2VmNlSVBJekgxOTlBTjRsYVhTT0hFQlNqUEQxNDQrUk5veHM3?=
 =?utf-8?B?elIvSEJRZ2NCZkJVYTlQTGNUU1JpYXNVUDNlS0RLZSsrZEhRN1puNEVVUmx3?=
 =?utf-8?B?VTNpUGFjOFhSeXM5L3R3a2FPckdRNk1oUGNCaDZteGF5NVdBY0xmZ0Zsaytx?=
 =?utf-8?B?R0NiQ0FXYXBRK1dPUU0rbis1bXFYY2oyYUZPRVo2c1RzL1o0SFIyTzNzN1VD?=
 =?utf-8?B?cWFickRLQkppRWt4aFgyYm9nb3RiR0grOG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g5eTZScTNCL1Z3WlhvU3FUdXlOem91eVp0amJ1T3JZNnZUTU1DT2FP?=
 =?utf-8?B?di8yWSsrenMvVTYvWTFySTVkYnN0M1hsYjRla2d4dzAxRG1wN2dlcmloODBV?=
 =?utf-8?Q?Vr+l+8+046MswuCrdCB82VZMO?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 34bc5013-5113-400f-f13a-08db88204b92
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 06:20:49.2315
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: s6dp+ck/rS6xNXfFFo9LZ8IGeMtBOYa3JWfolrjlpSRxYEPTzDylWkNBmoSzI2ywfMK94KjzZtt3MG3zyFRa/g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9571

On 19.07.2023 01:27, Simon Gaiser wrote:
> Andrew Cooper:
>> On 18/07/2023 2:17 pm, Simon Gaiser wrote:
>>> Since it's limited to the hardware domain it should be safe and it's
>>> very useful to have access to this directly in dom0 when debugging power
>>> related things for example S0ix.
>>
>> You need a SoB.
> 
> Yeah, sorry.
> 
>> But, this is an area there things are subtly broken.  For package-scope
>> MSRs on single socket systems (which does include client systems), then
>> this happens to function.
>>
>> It does not function for core-scoped MSRs, or at all in a multi-socket
>> system.  In such scenarios, dom0 can be rescheduled to a CPU in a
>> different scope while it thinks it is sampling a single scope.
>>
>> This is one of the areas where dom0 and Xen end up fighting over the system.
>>
>> I agree that we want some way for dom0 to get this information, but I'm
>> afraid it's not as simple as just permitting access to the MSRs like this.
> 
> I see. So a generic solution is not so easy. Also even if there would be
> an interface for dom0, my main motivation was to be able to just use
> existing code like /sys/kernel/debug/pmc_core/package_cstate_show and
> turbostat. You can already read those PC-states via Xen's debug
> interface, but that's less convenient.
> 
> For those package-scoped MSRs, how about limiting them to single-socket
> systems?

No, that's all hackery that in the extreme case may be okay to have in
debug builds, but never in release ones. Even having such in debug
builds is problematic, because then we won't routinely test code paths
as used by release builds. When virtualized and trying to access real
MSRs (rather than properly virtualized ones), you need some sort of PV
solution. If you want stuff like that to show up in "standard
interfaces", you'll have to teach the code providing those to use
whatever the (perhaps to be added) PV interface is.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 06:24:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 06:24:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565590.883855 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM0bm-00072K-SQ; Wed, 19 Jul 2023 06:24:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565590.883855; Wed, 19 Jul 2023 06:24:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM0bm-00072D-Oq; Wed, 19 Jul 2023 06:24:22 +0000
Received: by outflank-mailman (input) for mailman id 565590;
 Wed, 19 Jul 2023 06:24:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM0bk-000724-V7
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 06:24:20 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on062b.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e4e3768b-25fc-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 08:24:20 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU0PR04MB9227.eurprd04.prod.outlook.com (2603:10a6:10:352::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Wed, 19 Jul
 2023 06:24:17 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 06:24:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e4e3768b-25fc-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=EtmFgYwZkhz18qJ8jr8wBBirtjB24kJSGBhRCp8jT2LluersSh6JpCo6lyoDltmcbGEPy6A9l34OGJnBxNrC4CnG3J+h7nz7fXF096Yslw6vrptE0h6J4R35YXAiW492d6JVS9VHmgWQ9ZnRsH9DyDhivH1Y281H70tSb+MYjRRF3MYPRIYcjWyiggILEeBkcChazDfHmOSQDESnpZ14SbSTW9EKHbK7feBTJKSzk+BVrua+4pB8Zoeho5SSCflzfzhELtmIVoyrEV5kd/X17eHMTovwF2TVfL4syVDzg+kGila7sCKuA8BfzbUlydvwNd5yK2XE7gShpchVTng2eA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/k7Al9sV22UZjN+ji+a6fYKudxpophtIgISnqoxdZAU=;
 b=GGWKkjCXvkm0v0mU8oDIrB9Gf8l29QWg1TyCcvsiVYFXxSuuA8Q/JZ2oSbvveJBrA0mXPnn4UKCvaSSP2+9dQ8bvxmuBhArkbFJiGj7y5QAfryyK2GAlTQUWtUY8dPH/zNDy0Pr2JgRlOdTZcl39saeREe+qiIMhDtt41OETIOTPm5aRS7DEOGzOPjyJGQAUT53DWlr+VdmcNnOUSanhET5a+KeuX9DVFgOtTrCpRVYUsA9Ob3frI84N8SGuYURrY/0F2iILvJR9gRj+w9a022g8eioyr9ZtfQ3wickdwYJVlbJnG9t8OmvoLSeYsJAx+tf3LiKdPu9xhi0tWMnu4w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/k7Al9sV22UZjN+ji+a6fYKudxpophtIgISnqoxdZAU=;
 b=pkxYSlMTPMfLliIFwNVxyHdK6rq8xH4+2iiY0XLB3CTWKOcUPvcVVN+oxMfJ/C6Yn6Uj5kRhSh06i3eWOyCb+MLLWxqUgeMHVtbFqbMeQds37FEDajB27AegkQiYAoVEof7shpwcH930JQsNXM+a7FEhXQ0zhZfXbFAnhpk+TLU2UtfymWi5W7ZLdy9YitJvn025f+iQPMPUsI1mI0Nm2EEz98tVW9Eqgb/O5+VSpdOwUWshpFGv0KUewPBzJMPx8oF+TarLvLU4tlcl6X7KsYdj8+ZIcMqevAH82+/TBWXDZMFTFzKfoNgX7zWQ9XCWnCuk8TnN1ah19S2hmWMKqw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <98422c1d-ce7f-7700-20f7-54b5e68b63ff@suse.com>
Date: Wed, 19 Jul 2023 08:24:15 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] docs/xen-tscmode: remove mention of numeric tsc_mode=
 values
Content-Language: en-US
To: Elliott Mitchell <ehem+xen@m5p.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
 Anthony PERARD <anthony.perard@citrix.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= <marmarek@invisiblethingslab.com>
References: <a8223a339a0b8ff3c0d04fb4ee2913c7558cc131.1689294071.git.ehem+xen@m5p.com>
 <ZLCj62XMBbspMWbY@mail-itl> <ZLDErKk8ziBuh1ZJ@mattapan.m5p.com>
 <b3db9387-8139-e7f8-d250-9933e288f9fc@suse.com>
 <ZLb9AhaoJDixR7Nf@mattapan.m5p.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZLb9AhaoJDixR7Nf@mattapan.m5p.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0129.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:94::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU0PR04MB9227:EE_
X-MS-Office365-Filtering-Correlation-Id: ea13cf5b-c30d-4de9-94e7-08db8820c7a6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	4UTR0JEG/3yqgop1fDx45d2+tN+Uj0dUVsslXIUmmf5cjrytKhbMXRnV8cMM2nvVInr+PhEQNhvp130hpdVF63zSmimcsJRh6ZmrR2OeYUjGRW4lCQCdqYNhkFeTe8i4vg+hDmxNz3xdk/oW2sVCoq0Hl9CfDg4qE423Wvw6DD/NPud2V+vQP7XXQT4hd8jr2GrDfZ1aN9SbaEarSCKXk8ylU2Ea7Ij8j9nteo28C+SV6aUSmEjoKZ1lHaWCD93uOVRuq+RgCB8OVMOR5iUQfVFHJjIZZWFo3iWGPruQh3OSGSNjRgnhk9voB2hyGd6rDJgZcxcoUh2Du75r+UDst2jabFxjoUz4FbMwHQpq3BsuHDsiguL/wrhz1x3WGJJnkKuisdZuJt1BZiL2XaCYQFk96tLWY4VXV9z4WU/ekfcB8+wbuH/K6wPxs5l3PQD3Zp+AdGJjIiGM3QAotxl0MxzOMpq8cm94k1QOMS48FGpAD4Ov+96XWVfQreluNV6rNszS/lKkx4/m/9VaYF9cqvMyJlyLStf6mRJjfekAgw3XYv/l/SSXWK6gb8MRIWGqKca95KpK9RpAHJq4+dBNsJL35UCpmDExWm65LL171PJcvDEGMRzIM8G23Qys0ViNyWVS5ScrfvhIapd1o37M9w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(396003)(376002)(39860400002)(366004)(346002)(451199021)(54906003)(38100700002)(6486002)(5660300002)(478600001)(8936002)(8676002)(41300700001)(316002)(66556008)(66946007)(4326008)(66476007)(186003)(83380400001)(2616005)(6506007)(6512007)(26005)(53546011)(66574015)(86362001)(31696002)(36756003)(2906002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TlYrc1ZzZVg5M2lsdEQyNnNkWGxFS29BaklBR0FmTXdIMHRISTV2a2dXQWc5?=
 =?utf-8?B?eStsVS9jOE1oVlVKajRXUTMzdkoyY3lueG1Pem1TS2pORnoyQmVNTXhrK1Vx?=
 =?utf-8?B?VTRVcVc0OGlyVGQwVFJidEhWMEdUNVZZMHViZEYweEJINWQ4eHhkdXE3cm92?=
 =?utf-8?B?Vno3QU9MZmJPWWkwR2xNMFkvbnl4M2Q2MStoRFZuOTA4S1VpTlZyNi8rWEQx?=
 =?utf-8?B?Y0NlN0ErOGREMTJEejUwc2VTZFJ3b3RJU1FJUE5saHZ4NEtGUlY2cUhYemFr?=
 =?utf-8?B?a291dlVZeFVnZUFYemJ1dVdKS1U0eThJTEV6cktiUStGeVZNWkw1alJkQUhD?=
 =?utf-8?B?ZnZjamlJT0orbU40cXJpeWdpdUN2YVVIRlJGQTlyUEtzYmhxWDV0d2R3aC9U?=
 =?utf-8?B?Nm1zTyszallUbjcvZzFlTW14UVU1SFhJYUd1WjlVeUtXdWVjaitsZ2xKdHJ6?=
 =?utf-8?B?U1dGTlc4MlBWbjlDQ3lSbEVYVHdTNjBWSE9wOFdnaGk1aEFrTXpXUzFYTHNu?=
 =?utf-8?B?RnR3OS9TMzJVdVQzdFRPaExKem0xYkkydXFrNkdqOG5GMEZlWTBnNlZJeENK?=
 =?utf-8?B?dUN2anVhb1pyTDRDMWlDYk1VazR1MGxRODZIWmwvd0NhUk1NS0dpUkxKeUtm?=
 =?utf-8?B?ajBQQi9jSlhSRC9ZTUxkbkw3SDlFUVF5ZVRqRHFVMEZHbE1ET3VQbGVyUXlx?=
 =?utf-8?B?Zmh1U2tOY1h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b3M0V0VUelFBWWkrTmZMNHVudHlO?=
 =?utf-8?B?RlVUTWlxTUYzSTBQeldoVXdEK253RDBKbUM4RFppK0w3QmIxbkNLUXlWNUJx?=
 =?utf-8?B?aDkzbFpPWDFIZTVZRTNqM28zMyt5NmRXNktCVFlsVmx0clpHRUtsaE9RN2tU?=
 =?utf-8?B?M0lPUmVSUnA5bnNaT2d6VVN0VURNL3Q2QjFVaDZUUHpZOGFZYmZPeGxnSFJJ?=
 =?utf-8?B?aUp6MjRUWEcxN21NcmlIS20vZGtCaFhJWkdNNXgxYkRPc21uSmlBZ1hSTnVa?=
 =?utf-8?B?NnhkbER5dU1JSTNQTDZyQm1weGRDNkczMGtBWUdXUlNTS0VHVFdiN3I0ZXk5?=
 =?utf-8?B?aXZEcm5LR28vejhYSHNwL1pBUWNvUndwMzZpTkp2UXlHcWdNN2R2Z1RENjVP?=
 =?utf-8?B?Z3FLUHRVYitxZmljTThyOGRwKzBiYjNPdFg4RzllQU9heENnRjF0bHdTb3h6?=
 =?utf-8?B?MUcvUUtsa1lrZEUwWFk2WkV3bTl2WGJBT042dnU0ZEN0K0gzZlBzWFZTd2Y1?=
 =?utf-8?Q?vD3FkwWjens2XZa5bUyFU8Kul?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ea13cf5b-c30d-4de9-94e7-08db8820c7a6
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 06:24:17.4277
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: geQExuisqGVuOzR5I/6QeJskg+7JPoe0YuDK4SSXWwUEA2r8CaIOtdpDk3hVZuKXOFzyOuru501rs3x2i0Y7/w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9227

On 18.07.2023 22:58, Elliott Mitchell wrote:
> On Fri, Jul 14, 2023 at 09:21:59AM +0200, Jan Beulich wrote:
>> On 14.07.2023 05:44, Elliott Mitchell wrote:
>>> On Fri, Jul 14, 2023 at 03:24:59AM +0200, Marek Marczykowski-GÃ³recki wrote:
>>>> On Thu, Jul 13, 2023 at 05:16:40PM -0700, Elliott Mitchell wrote:
>>>>> The better to encourage moving to setting via string mode names.
>>>>
>>>> The numeric values needs to remain documented, otherwise interpreting
>>>> pre-existing configs (that may use them) will be tricky.
>>>
>>> Problem is the way it is documented tends to encourage continued use of
>>> the numeric values (notice how reports irt Zen 4 mention "tsc_mode=1").
>>>
>>> `parse_config_data()` suggests the appropriate string value, so nominally
>>> that should take care of older configurations.  If "xen-tscmode" really
>>> needs to continue mentioning the numeric value, it should be in
>>> parentheses and with "old value" to suggest moving away from that.
>>
>> I'm not sure about "old" (we can't change the values without breaking
>> backwards compatibility), but the numeric values will want mentioning
>> alongside their spelled out names.
> 
> Then why is there a warning message about numeric tsc_mode in
> `parse_config_data()`?

I'm afraid this question can only be answered by whoever was involved
in adding the warning.

Jan

> "WARNING: specifying \"tsc_mode\" as an integer is deprecated. "
> "Please use the named parameter variant. %s%s%s\n"
> 
> Declaring them deprecated suggests it could be removed at some future
> point.  This message was added at af3b530c03, over a decade ago.
> 
> Though I suspect `tsc_mode` hasn't been heavily used since no one ever
> bothered to remove the debugging message.
> 
> 



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 06:28:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 06:28:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565594.883865 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM0fs-0007tq-Gt; Wed, 19 Jul 2023 06:28:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565594.883865; Wed, 19 Jul 2023 06:28:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM0fs-0007tj-E6; Wed, 19 Jul 2023 06:28:36 +0000
Received: by outflank-mailman (input) for mailman id 565594;
 Wed, 19 Jul 2023 06:28:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM0fr-0007tN-Fj
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 06:28:35 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on2060f.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::60f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7c6d6919-25fd-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 08:28:34 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM8PR04MB7924.eurprd04.prod.outlook.com (2603:10a6:20b:24d::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Wed, 19 Jul
 2023 06:28:32 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 06:28:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7c6d6919-25fd-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=fT74U3fHwWg0goneAtyBljF+ZgMUpWHOVjWdpJvFfq5oL94HuozhcM0aQLCT8I4PyD+RZI3oyliKjAGseNXNP0DkFrusmtcSo3Y12sIYL2dZ90jg8nDCGMxQzqMRbv4+9j4gcWWdCjvpeJRpyUIVo1ISF9VKL5Qq+L1FtSws62MkRo/wnHRTR33ecfpbn5G0VGkWov8SJlAu2SZsd0m2xF90Q0WFMhdioXSEc2xtmwABHqldiJ/2xUzZQJCBgZ4OZf3U8/X+pJmrKhpeTrAv/RerL/M/2PfC1hGRFknTW3nSACOcDlJUE37gWC/g19q1uZLmVLtEKYFvvJrIlqQu1g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=6cnti6WBD7BbuSt64XJmyACwwfLUPvuFISE9Wd6tksE=;
 b=mdM2Ei4JVwF3ULSRo7jmrpDqGtnoX+h5sphynOMg80VZGqGiAOeBxVz5tfgphhKkP3FiuZqiLnpzKsUme1q/mIxuEw9ncdMUgMZDnx7rEq3+GB8D728++sobiQ3Wb00coIhy562ysILhlfNFwvHCVrJb975nHPl+6nhr9hLl6vmSLaNt+HhuPL2Fv4ag9uWRGqeq/9U7ht8xIQgfmvXKK+LE4nd22QsCo/ACLdmT0DQqZfQFPfmSuP3IsD+S/rnjx0OSGtSnILbwWzNum8INtqKTU0zE/37PGSxvNseMtJWCUnwblzvgcTlNI0APeL437NmkBFuwHRop4HSz+4itKQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=6cnti6WBD7BbuSt64XJmyACwwfLUPvuFISE9Wd6tksE=;
 b=TbnGQDnm+xkPBXkGqkmDJrJcVIbm85PGlKr4l9m5NEicrLFZbJcMjgoEdT8uZ9rSC0xlX73UPD2iUrutbrLOk+ADHYW+q1HjaZHIYT+YD6DoQ0Z+OZWlEif2Ibmh718Aivjc/BoxlEqNjB7h8CrDOU1YmSPgeptVovOGEmf39eUC7RUs2+UmegQm482lBS4SqUM4JDSbl8rKHirktu8gPdBYq31VDfSZhKaF3PPg7G3wB/RTdbgeTmhHxaU1xojMU8q/ZkHWYwCvkomArWY3l4az1vRdAqO3PuZm5+NwAyN1cP4inUzBCaPcL6JHrl7UZaXvWIsvx1tXVqiCaK5kTg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <82d5106a-0fb2-bdc4-7fd5-315287220f73@suse.com>
Date: Wed, 19 Jul 2023 08:28:29 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 1/8] common: move a few macros out of xen/lib.h
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 George Dunlap <george.dunlap@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
 <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
 <109efb43-a519-73f6-2a26-2b420090ab2b@suse.com>
 <2da1f2f6-b039-96b3-cb79-f813e6de782e@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <2da1f2f6-b039-96b3-cb79-f813e6de782e@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0080.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1e::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM8PR04MB7924:EE_
X-MS-Office365-Filtering-Correlation-Id: 8a5395a2-8c12-49be-791e-08db88215f7e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	GWyj4v8sJH7w94yw2jzgxpOr40nWSJpquiDZDzAHzpnjmTbHSgMrw4i7ATdNoYA0H7sbz1HjzWugPb73xV0ZiKT4JnlS6NlpC4lyZH8XyBZCis1QG5jjS1xMJ5ldyOoMwFcctkVlnedV1RKzggdH3rGZrKRrZuaHtqVxgFaegKEJofROaox8MEL+W0EoLx8+pEVZBNijqaSNWWh/V9WU42wFSGINkM5YgPJ0ei34Ies65/rNuXYtASVAVfYfh9PHVumQpSNBtfMrMJGTUGdJLLDcZppkJaCsrPuHR0FqmErLAzz3ncD6WDOdnqNOb9+02wszaKSW66ejd8nKGhXQaeiwmlHkX+Mq94zdvVWRVdSfAxyYaBEem/aVrszxh9QRr83grHwOWsWhMe/bOZ4UMTxGrWMqbGX1+CgOP2fRTSCeKZR/40oyiWuyUyBV0vJ0HIOJ7QDNz5H3Pza/w6frsDGaa3H51X7BTcpehEB8SuTWZxc7dHo4sLuTB/Y03Djr9n8ERaUefT2fw3w5vEgb8WMq2vX2h8QKmVQRWf37u3/ShA1zvgBIhqfm8JS4wZ3VL5N38C0MDCWpOmfxoSYRrfAEfGiC7aQhglW7z5HdCnv1AIt0wOoHIiYL9epLmsKJgEt9gZh/y73i0ctPt3cmyw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(136003)(39860400002)(346002)(376002)(366004)(451199021)(6512007)(53546011)(6506007)(36756003)(38100700002)(66946007)(26005)(5660300002)(66556008)(54906003)(2906002)(86362001)(4326008)(8936002)(6916009)(41300700001)(8676002)(316002)(66476007)(6486002)(31696002)(6666004)(478600001)(2616005)(31686004)(186003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VWJyakYyQkpQbjd4OHZDcGR3UEFvVWJoWHFrbVQxTmVib3VBdlVDWXp2a3ly?=
 =?utf-8?B?MnhQU2hhWWhGWGxZcnlJZ2tyRlRoNXIyMi9uMVU4MU5yODVYUDhZRi9IbUVV?=
 =?utf-8?B?a2k5LzBUTlJOdjk5NzFGTXFGUEJQVldtTS95dU8xQlNYWnRTMUF0TXEzQjdo?=
 =?utf-8?B?R0lWVzFBL1J0cHQ5VUVCdlpZeFdBT1hpWnMrR09mbUIxcHFtZk9xelVqSG0v?=
 =?utf-8?B?blRpYjNiUHpVUkNUV1VlVXQyanBiem1WUnNxNVFhd1U2LzhWaFZyNmVuRGZy?=
 =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NNMFpObnZIMXNLOWpk?=
 =?utf-8?B?WldDM1JYVjNXLy9zRlo3S0JTUWNNeWptVXBybis2aUJldlF1ZCtKaUZwUDgv?=
 =?utf-8?Q?6VFXDIUirL0iwlMiv01/cBoNt?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8a5395a2-8c12-49be-791e-08db88215f7e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 06:28:32.1712
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Y80MC5cG1yzydAAHtNK/5Q6b0KDCvUD4HqcZifWfvkPdODZ6ezg5U2+0/ru8vZcsZRgJxviLxPSGrmDUXx38Qg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7924

On 18.07.2023 21:49, Shawn Anastasio wrote:
> On 7/10/23 3:51 AM, Jan Beulich wrote:
>> --- /dev/null
>> +++ b/xen/include/xen/macros.h
>> @@ -0,0 +1,34 @@
> 
> Should there be an SPDX header here?

Probably, but I wouldn't know which version to use, since lib.h doesn't
have one either. Not putting one there leaves things a clear or vague
as they are for others without the tag (and without a full license
header); putting one there would firmly state something, which then may
be wrong. Therefore I think this will need sorting in (more or less)
one go for all of the "license-free" source files.

>> +#ifndef __MACROS_H__
>> +#define __MACROS_H__
>> +
>> +#define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
>> +
>> +#define IS_ALIGNED(val, align) (!((val) & ((align) - 1)))
>> +
>> +#define DIV_ROUND(n, d) (((n) + (d) / 2) / (d))
>> +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
>> +
>> +#define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m)))
>> +#define MASK_INSR(v, m) (((v) * ((m) & -(m))) & (m))
>> +
>> +#define count_args_(dot, a1, a2, a3, a4, a5, a6, a7, a8, x, ...) x
>> +#define count_args(args...) \
>> +    count_args_(., ## args, 8, 7, 6, 5, 4, 3, 2, 1, 0)
>> +
>> +/* Indirect macros required for expanded argument pasting. */
>> +#define PASTE_(a, b) a ## b
>> +#define PASTE(a, b) PASTE_(a, b)
>> +
>> +#define __STR(...) #__VA_ARGS__
>> +#define STR(...) __STR(__VA_ARGS__)
>> +
>> +#endif /* __MACROS_H__ */
>> +
>> +/*
>> + * Local variables:
>> + * mode: C
>> + * c-file-style: "BSD"
>> + * c-basic-offset: 4
>> + * indent-tabs-mode: nil
>> + * End:
>> + */
> 
> Reviewed-by: Shawn Anastasio <sanastasio@raptorengineering.com>

Thanks.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 06:50:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 06:50:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565597.883875 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM10S-0002KK-6r; Wed, 19 Jul 2023 06:49:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565597.883875; Wed, 19 Jul 2023 06:49:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM10S-0002KD-46; Wed, 19 Jul 2023 06:49:52 +0000
Received: by outflank-mailman (input) for mailman id 565597;
 Wed, 19 Jul 2023 06:49:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Vyro=DF=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qM10R-0002K7-Jl
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 06:49:51 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 74f45db9-2600-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 08:49:50 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id B28631F8BB;
 Wed, 19 Jul 2023 06:49:49 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 88F7B1361C;
 Wed, 19 Jul 2023 06:49:49 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id a+DMH42Ht2RQSQAAMHmgww
 (envelope-from <jgross@suse.com>); Wed, 19 Jul 2023 06:49:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 74f45db9-2600-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1689749389; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=kEJy0oGHVye6UxthBqVCd1onO3FJYeVO7mdaOLNqlv0=;
	b=VCCeOxNLJi9daI00FmYzO/9oBoTZgOHGlCy09UJDME5761XB3saHk3PhULDQIW/FxLdT86
	C5jPxkDCEt2pRT+S479ycXRijpqGKxnI4t8x8Tx5p2G1cAi1Y8hvyPEP93qrAM/46/bMvx
	ru/vKOfg0Il1xux6+69I0s/PtjpYmYs=
Message-ID: <32cd8b9f-8afa-2cde-3815-82edc7052535@suse.com>
Date: Wed, 19 Jul 2023 08:49:48 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-19-jgross@suse.com>
 <64ec2fd3-fcec-6ebf-5924-6b591215e19e@xen.org>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v2 18/18] tools/xenstore: add nocopy flag to node read
 functions
In-Reply-To: <64ec2fd3-fcec-6ebf-5924-6b591215e19e@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------mIJTYrpb9zyUT67yW82sPK7E"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------mIJTYrpb9zyUT67yW82sPK7E
Content-Type: multipart/mixed; boundary="------------rkLr9aeODPwVUkxn26MyCG7P";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <32cd8b9f-8afa-2cde-3815-82edc7052535@suse.com>
Subject: Re: [PATCH v2 18/18] tools/xenstore: add nocopy flag to node read
 functions
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-19-jgross@suse.com>
 <64ec2fd3-fcec-6ebf-5924-6b591215e19e@xen.org>
In-Reply-To: <64ec2fd3-fcec-6ebf-5924-6b591215e19e@xen.org>

--------------rkLr9aeODPwVUkxn26MyCG7P
Content-Type: multipart/mixed; boundary="------------u8KaduSr3UsuuSSALm6LmfCz"

--------------u8KaduSr3UsuuSSALm6LmfCz
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMTguMDcuMjMgMjM6MzUsIEp1bGllbiBHcmFsbCB3cm90ZToNCj4gSGkgSnVlcmdlbiwN
Cj4gDQo+IE9uIDEwLzA3LzIwMjMgMDc6NTksIEp1ZXJnZW4gR3Jvc3Mgd3JvdGU6DQo+PiBU
b2RheSB3aGVuIHJlYWRpbmcgYSBub2RlIGZyb20gdGhlIGRhdGEgYmFzZSB0aHJvdWdoIHJl
YWRfbm9kZSgpLCB0aGUNCj4+IG5vZGUgZGF0YSBpcyBjb3BpZWQgaW4gb3JkZXIgdG8gYXZv
aWQgbW9kaWZ5aW5nIHRoZSBkYXRhIGJhc2Ugd2hlbg0KPj4gcHJlcGFyaW5nIGEgbm9kZSB1
cGRhdGUsIGFzIG90aGVyd2lzZSBhbiBlcnJvciBtaWdodCByZXN1bHQgaW4gYW4NCj4+IGlu
Y29uc2lzdGVudCBzdGF0ZS4NCj4+DQo+PiBUaGVyZSBhcmUsIGhvd2V2ZXIsIG1hbnkgY2Fz
ZXMgd2hlcmUgc3VjaCBhIGNvcHkgb3BlcmF0aW9uIGlzbid0DQo+PiBuZWVkZWQsIG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kIGZvciBnZXRfbm9kZSooKS4NCg0KPiANCj4+DQo+PiBO
b3RlIHRoYXQgdGhlcmUgaXMgb25lIG1vZGlmaWNhdGlvbiBvZiB0aGUgbm9kZSBkYXRhIGxl
ZnQsIHdoaWNoIGlzIG5vdA0KPj4gcHJvYmxlbWF0aWM6IGRvbWFpbl9hZGp1c3Rfbm9kZV9w
ZXJtcygpIG1pZ2h0IHNldCB0aGUgImlnbm9yZSIgZmxhZyBvZg0KPj4gYSBwZXJtaXNzaW9u
LiBUaGlzIGRvZXMgbm8gaGFybSwgYXMgc3VjaCBhbiB1cGRhdGUgb2YgdGhlIHBlcm1pc3Np
b25zDQo+PiBkb2Vzbid0IG5lZWQgdG8gYmUgdW5kb25lIGluIGNhc2Ugb2YgYSBsYXRlciBw
cm9jZXNzaW5nIGVycm9yLg0KPiBFdmVuIGlmIHRoaXMgaXMgdGhlICJpZ25vcmUiIGZsYWcs
IHRoaXMgaXMgZGVmaW5pdGVseSBub3QgYW4gaWRlYWwgc2l0dWF0aW9uLiANCj4gQW5kLCBB
RkFJQ1QsIHRoaXMgaXMgbm90IGV2ZW4gZG9jdW1lbnQuIEkgZG9uJ3QgdG8gYmUgdGhlIHJl
YWRlciB0cnlpbmcgdG8gDQo+IGZpZ3VyZSBvdXQgd2h5IHJlYWRfbm9kZSgpIGFuZCBkYl9m
ZXRjaCgpIHJldHVybnMgYSBzbGlnaHRseSBkaWZmZXJlbnQgbm9kZSANCj4gY29udGVudCA6
KS4NCg0KU28gd291bGQgeW91IGJlIGZpbmUgd2l0aCB0aGUgYWRkaXRpb24gb2YgYSBjb21t
ZW50IGV4cGxhaW5pbmcgdGhlIHNpdHVhdGlvbj8NCg0KDQpKdWVyZ2VuDQoNCg==
--------------u8KaduSr3UsuuSSALm6LmfCz
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer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5D+jLRZQd1Sv27AR+IP3I8U4aqnhLpwhK7MEy9oCILlgZ1QZe49kpcumcZKORmzB
TNh30FVKK1EvmV2xAKDoaEOgQB4iFQLhJCdP1I5aSgM5IVFdn7v5YgEYuJYx37Io
N1EblHI//x/e2AaIHpzK5h88NEawQsaNRpNSrcfbFmAg987ATQRTjHAWAQgAyzH6
AOODMBjgfWE9VeCgsrwH3exNAU32gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------u8KaduSr3UsuuSSALm6LmfCz--

--------------rkLr9aeODPwVUkxn26MyCG7P--

--------------mIJTYrpb9zyUT67yW82sPK7E
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmS3h4wFAwAAAAAACgkQsN6d1ii/Ey/J
Ygf/ZxG1b1HYxLBNte6YP/fBkHCQPm7dPPJGocgWas2oR5FX5un6Iu5Vt78IWpn5+cSc+IeHtmvG
LgjDj4gpLWR5bTUC2c/aslAuhJRwrosxKNm93gQ8mHab1CY0L5undNW1/eIeX/sY3BuzFV5iBjek
L8DXb6H7TN4QZi5N9ixvaj8r33E5QW9yWIhMcWqRB8RhAXVrHhIbsOWsD/nEQjrEDZw7UBI4Kdy7
8Q50o23MXmVl49f5waRmnoELXBdAbsMhqwraTCjJtG97BVcYLT61p2pOfLAFEZSa5tNCaKHzuD5q
V6qcHIZ2UIPvuubyZAeEGUaAnBlEPmmU8Up7lCUR+w==
=pMq4
-----END PGP SIGNATURE-----

--------------mIJTYrpb9zyUT67yW82sPK7E--


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 07:38:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 07:38:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565607.883887 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM1lV-0000H5-RG; Wed, 19 Jul 2023 07:38:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565607.883887; Wed, 19 Jul 2023 07:38:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM1lV-0000Gq-Oh; Wed, 19 Jul 2023 07:38:29 +0000
Received: by outflank-mailman (input) for mailman id 565607;
 Wed, 19 Jul 2023 07:38:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM1lT-0000Gk-Ta
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 07:38:28 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20609.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::609])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3f4a7a05-2607-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 09:38:26 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBAPR04MB7205.eurprd04.prod.outlook.com (2603:10a6:10:1b3::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Wed, 19 Jul
 2023 07:38:24 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 07:38:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3f4a7a05-2607-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=AZ8nVvbL5RDd9X4iHrwCAsv7BdEfdWqFGlv1fJts5zqmOlzyyfyYGx7dkRdFk7uFS/1jzF2PvA1hFKFzw/1UsLsl7D8dFC5J8lcBeW5iZmzN66Zwt2LwPMjTaqZdH8quLuaptuhY2VI35s64mcqdMkdf48mxakNS3+pNMf9NALzfKYBpGYNPRfmrpSfXAFFCZQ9Go4oKatEc+FQq1tx9IUQMBJEgJkyqPmtp4yovfYq/HJ152KwkNdpLxHQbNYtyIRfgAaoj97a+FOp8HqgzHYhNi1RvIDodNYGvLS4Fs597O7qAkwE6LTy0FKfar6QomkhWbtHJqnn0GVIyxinVFw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=uXb4NC6XF0E0BgAu0gjiWqBFwYNC73u24iqA1zZv1OA=;
 b=lKG5DEZaIGw7mLCDrNG8qW4puVnI3mwG+KypYLaOJNiHv8oifDWa3fiyLTv/2Rbp9+nZfjWEaB0XLzt0u8uZa4oZispYS6tvEGZvEBPYpBTE9I6WQO8H3E++gfcYRA41EYHA0gVnS3RKDkz6Ew89erIWPo1NTvZP5cBUaIRRr0HytMkIA2nnUU67ciRTxZAhYyT8D6JCdwVrrkYwb7K5FEr6qAnri4GSjQDhaRNtAWXgEZ2l5UF/7eBgKAF8gRdhrhV3QXZm/xjTm1tDSJ9pH+ZVY+KCNIQAkgCUj2DmBY7AIOXpogEcJ1xy2ROK7vluxnmdtV+aJv33c7+K9dbw8g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=uXb4NC6XF0E0BgAu0gjiWqBFwYNC73u24iqA1zZv1OA=;
 b=PZM60Xy++uNWcU8Fsys2POBF/jOhBlk7DGQMltbhD5t0opSJO4mav17+mwT/aqUiZzAtuNu5CV5W4zTi1/gVhXt3pI16/ZfeOmroxrgdYyMNst/2Pi6YBg0CbmkamwsDuVoMvk3MKDppL5jH5raRGFr3JGI8TwhC9bkMZ7bQSYK5V2AGArN8Od0licaMnMyj3p6xRWSXuKXxxTDaYKh1Sc0Orc7nmSf3KSDmisQWvKTedQXQ/fTZgVchFDyMUl63u29lEgLTaM8LHbagRPF3gswq/xG8cjnwmbUKeAs8cM1KBRWYhXWIxBQh9pSIxs23yqnn+JIHTpxKbPfvmvbtwQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3913c170-09c6-2baf-ed38-5614f8c6cb2e@suse.com>
Date: Wed, 19 Jul 2023 09:38:22 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86: fix early boot output
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0120.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9d::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBAPR04MB7205:EE_
X-MS-Office365-Filtering-Correlation-Id: dc18c008-b461-464a-e846-08db882b2258
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	BJ8OgDn/U+37P5Q5jGz5QYws7luNlQjW6/cRLptGqBVhzqRjQDg2qXzBUOrm7Q481UAKctZy2zTSILzg5G9Cktbn/fHiOOxFVvWcDLkSeE7fJ2p+wxTOBbj7hxUYtLy4qmFKnJbG/IQR8uUIF74g3sOpTeTTAcYgab57stWviOcTO+CDgduP5eKJYARYimjs63e1mbwYzRu1nKde41jfA0igCuS6g9Y+NY/vf8wF3MUmUaM7t+wUiAlDkXGOwOkEzfrLWyWjvmpwz3p49L4QeMvnTXfO/U8aI7Jfbfg9sxlQfN07K1yWdGrdNoUHwlrImRR5Z/oxJXD+iTPMyrtyK84mA+YTKoxGYeAgOdb3fGmT8X8DOwtYemoC2o4lKgy7mjN83ydDPxPg7QQBuilGd9sAPV65i/L0GnWhhBfX+cnxYOH3o7neAL4FqQJADWEkJHiXc+7jdqCF0bxQIsU79zmn4hgB8MYYky5je9pvvjUQbG1aoAOUAnQIMDmpbd8ixT6btP0aVJI4XFCpGkYMKRzKOt9pa8e+gTGFFUrvpuljqiw0hy4YXUyA13MDM4k1FwRvcy2Nj51m081jgYwPudzj+NOfFm39AVLi4vVIMqJRpc6cr/UxBNK3ub8wQLKbepHU/V/qsNPL/d7I6/0JJA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(39860400002)(376002)(346002)(136003)(451199021)(41300700001)(8936002)(31686004)(8676002)(316002)(5660300002)(54906003)(2906002)(478600001)(66476007)(6916009)(66946007)(66556008)(4326008)(6512007)(6506007)(26005)(6486002)(2616005)(38100700002)(186003)(83380400001)(36756003)(86362001)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TGRUYTZneUJJeWpwdFdQVU0rK094M05raE5VR0xDOU9kY1FFTjJKeXYwL1lJ?=
 =?utf-8?B?YnZ4cWFFd21IVVpEbjVuVVkwU2t4ZTRkU0xIcG9EaGZpKzVrY29qNzR4M0Rh?=
 =?utf-8?B?NzVJMC9NVlZueUJ4TmRvTmc0Q2JiUjZrNTBBMmVhRHNrUWVSSmxpbVoxaCtB?=
 =?utf-8?B?NXJZQXRtc29KN1pHOVJQaC9MRXhxdS9ZSk1OQzdVL24veUx0T0U4T2NKbVNa?=
 =?utf-8?B?VUY3Ulh2d0RiNlRJVkxGTzRYR0gyRTQ3elQvSkV1QWZUdTBVdDl0dkxZamdl?=
 =?utf-8?B?MkZUTnM3ZDRWQlpVblFtTVh5MzhHQ1djNkJMa1dvbmc5cUdkR1B3WEtmc1RX?=
 =?utf-8?B?Ukd4ZDd4K0llZkpZaTJFTjNXMU9zWnM4aXp3ZHREdGk4UzFYc2liYitXc2U2?=
 =?utf-8?B?dGJPYXd6N00zaWtBcHlrSEZKZUdnVWFZR2dSaVFlTDBMY2dHMWdVTktuK00v?=
 =?utf-8?B?UzA2dEY2Yitac2lrazFDRnNHUDZUTG94ZE91dDIycFZWY2x1R2pkd1Q2V2h0?=
 =?utf-8?B?dldsT0lManVCckNZR3JpUi9Cei9mak1RbmE0by9RM0Rqc0EyZjJhSUtRNTRu?=
 =?utf-8?B?WHYrc0orS3NRb3FiRFRZU1FjQS8yVzFQaUorZlIyQzdpSjljWlltUHo5VUI2?=
 =?utf-8?B?Z3E0U2FSV0ZzTkVNTG1jeHdCby84a2wrZ2RnQktQbzZJYWlOdVpsU2J3dnJ3?=
 =?utf-8?B?bW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NVRENidGlQZzhWRnlkYlUzUjJwNG1FRHEy?=
 =?utf-8?B?dXhBYnAzNS9XektRRjdPczNIYzZ3MHV6cVdXTllydi9mZXZMenJwWFEydlph?=
 =?utf-8?B?T2FZZndPcGNITzBXaEEzSXdPUHlkbkFoWjVYRkN2eloxY1NXUHQ5TWd6blJX?=
 =?utf-8?B?TW9NdmZ3YWRTR2pWSDkzdjNSeUVtVUNBMW5jZnJ4c1FrdDdCb2RpV0s4MnFs?=
 =?utf-8?B?eFBQMWlwUmxHazRWOHVUUnFuQVMvWVpvUlhkQk1oVHVLeFROeXdLNUZoeXRz?=
 =?utf-8?B?OVMyVjBDdzRLaDJDQzc2SG13MXFMTHBNblEzenRLSTR1ZE4xeFJTdnd6Ymw3?=
 =?utf-8?B?bTMrVkU4emF1OE8vUHlnQUJIdHdxWm45L0JFLzVRckVjNkp0anNJK3pNV1FN?=
 =?utf-8?B?ajN5Y1dNaHpTYW1lUy81L2lYaEtCNVRxVG1EaHpGNjh0UnZzTVZ0RkVGbCsr?=
 =?utf-8?B?T2JmdWo2N290VzUzNjJFN2x6Ti9IM1RocldJZmxaM2FlNzNqN0ZsZmxWT1Uy?=
 =?utf-8?Q?2+8qcJGQCwaoKNNx15h4vEiSx?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: dc18c008-b461-464a-e846-08db882b2258
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 07:38:24.5526
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: K2fP/l0cInEFE9dYmT/VZ4bs4t8u+sk4LNKSl1oX9hlT1uhiPjx3iQhiA9S2r0D4tbKcPVnZFKah/IDsV85pCQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7205

Loading the VGA base address involves sym_esi(), i.e. %esi still needs
to hold the relocation base address. Therefore the address of the
message to output cannot be "passed" in %esi. Put the message offset in
%ecx instead, adding it into %esi _after_ its last use as base address.

Fixes: b28044226e1c ("x86: make Xen early boot code relocatable")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
This also suggests that 78e693cc1232 ("x86/boot: fix early error
output") was only tested for the no-VGA case (i.e. EFI+MB2), and only
for one of the two paths which bypass the loading of %edi at .Lget_vtb
(or the offset load merely was lucky to pick up a zero).

Clearly when using "vga=current" with MB2 when the screen is already in
graphics mode, there will continue to be no visible output.

--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -146,17 +146,17 @@ efi_platform:
 early_error: /* Here to improve the disassembly. */
 
 .Lbad_cpu:
-        add     $sym_offs(.Lbad_cpu_msg), %esi
+        mov     $sym_offs(.Lbad_cpu_msg), %ecx
         jmp     .Lget_vtb
 .Lnot_multiboot:
-        add     $sym_offs(.Lbad_ldr_msg), %esi
+        mov     $sym_offs(.Lbad_ldr_msg), %ecx
         jmp     .Lget_vtb
 .Lnot_aligned:
-        add     $sym_offs(.Lbag_alg_msg), %esi
+        mov     $sym_offs(.Lbag_alg_msg), %ecx
         jmp     .Lget_vtb
 #ifdef CONFIG_REQUIRE_NX
 .Lno_nx:
-        add     $sym_offs(.Lno_nx_msg), %esi
+        mov     $sym_offs(.Lno_nx_msg), %ecx
         jmp     .Lget_vtb
 #endif
 .Lmb2_no_st:
@@ -164,11 +164,11 @@ early_error: /* Here to improve the disa
          * Here we are on EFI platform. vga_text_buffer was zapped earlier
          * because there is pretty good chance that VGA is unavailable.
          */
-        add     $sym_offs(.Lbad_ldr_nst), %esi
+        mov     $sym_offs(.Lbad_ldr_nst), %ecx
         jmp     .Lget_vtb
 .Lmb2_no_ih:
         /* Ditto. */
-        add     $sym_offs(.Lbad_ldr_nih), %esi
+        mov     $sym_offs(.Lbad_ldr_nih), %ecx
         jmp     .Lget_vtb
 .Lmb2_no_bs:
         /*
@@ -176,7 +176,7 @@ early_error: /* Here to improve the disa
          * via start label. Then reliable vga_text_buffer zap is impossible
          * in Multiboot2 scanning loop and we have to zero %edi below.
          */
-        add     $sym_offs(.Lbad_ldr_nbs), %esi
+        mov     $sym_offs(.Lbad_ldr_nbs), %ecx
         xor     %edi,%edi                       # No VGA text buffer
         jmp     .Lprint_err
 .Lmb2_efi_ia_32:
@@ -184,12 +184,15 @@ early_error: /* Here to improve the disa
          * Here we are on EFI IA-32 platform. Then reliable vga_text_buffer zap is
          * impossible in Multiboot2 scanning loop and we have to zero %edi below.
          */
-        add     $sym_offs(.Lbad_efi_msg), %esi
+        mov     $sym_offs(.Lbad_efi_msg), %ecx
         xor     %edi,%edi                       # No VGA text buffer
         jmp     .Lprint_err
 .Lget_vtb:
         mov     sym_esi(vga_text_buffer), %edi
 .Lprint_err:
+        add     %ecx, %esi     # Add string offset to relocation base.
+        # NOTE: No further use of sym_esi() till the end of the "function"!
+1:
         lodsb
         test    %al,%al        # Terminate on '\0' sentinel
         je      .Lhalt
@@ -202,11 +205,11 @@ early_error: /* Here to improve the disa
         mov     %bl,%al
         out     %al,%dx        # Send a character over the serial line
         test    %edi,%edi      # Is the VGA text buffer available?
-        jz      .Lprint_err
+        jz      1b
         stosb                  # Write a character to the VGA text buffer
         mov     $7,%al
         stosb                  # Write an attribute to the VGA text buffer
-        jmp     .Lprint_err
+        jmp     1b
 .Lhalt: hlt
         jmp     .Lhalt
 


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 07:42:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 07:42:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565611.883898 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM1pD-0001m9-FG; Wed, 19 Jul 2023 07:42:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565611.883898; Wed, 19 Jul 2023 07:42:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM1pD-0001m0-Ca; Wed, 19 Jul 2023 07:42:19 +0000
Received: by outflank-mailman (input) for mailman id 565611;
 Wed, 19 Jul 2023 07:42:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM1pC-0001ls-Ah
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 07:42:18 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2062c.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::62c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c8c040e7-2607-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 09:42:17 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBAPR04MB7205.eurprd04.prod.outlook.com (2603:10a6:10:1b3::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Wed, 19 Jul
 2023 07:42:15 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 07:42:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c8c040e7-2607-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Agqbb5QOojnV0ChjlFOxTgaVAFPHGyToCxn1z2N12DimVDjJdgwLgJ0E3smf/wBFwLIcYALArOkEmD25axi8vVtzMggTvUZd2ifM+DFNaUr/XB7eo3rOmdT/uWO4mFLAiwmf3T/3UlkbCibLboYMlDz4Aj2TZX/GcXYx2GlL+hMj10CHUZ5+VE/IXPsEcRApmFEyt8EagTU2oyU8EPq3ItMcrtDGOhMYQ9dQNNOE7spYtYB6ezEaTVV1GUHQ+8A6d4RbE7AHiE0QqBBxIfk3NTYatM1Sr5Fgbj/4YK1zD1Tr5tw6S+aS4atkK/8SGVyOj8wz/LAZ8xfVHWsgtduwHw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=urAS2YzNoRjBY+LetuLyMk9uUgsXBHqnXDX79SaomeE=;
 b=HHWMQ+Ncbfk5nXUJv7QeW59vYMl+gJOsJiC0rsdJrEqauGSsN5WqOw4MBfW9e2Vmv9vGD9koLJ+km0NMxcJilAPN6Ehqoy+nnk732u3WbOs5S7ubFt3sRBXECdWOz4yr3HC+jUl2AoF/eaEr7/Uh1tgrYGcmXdLAdYgUA81PpjZ/6wi1nEozaNCRFUaIqcdd//aP3EUHSfVSPhhkM5zeleNtjANPZGp4zEmmmNVB9q8/4OU1pGGDiLElkZrdt02jWLvYG4v2gA3Wlv3AfNgaGMS5zvn/8e093Xyo8+z0NBIzkI5jfMMS+KFH8qSbcARY5VN2iv2VstzYMpgnddVM+w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=urAS2YzNoRjBY+LetuLyMk9uUgsXBHqnXDX79SaomeE=;
 b=S0Qn5THzTWLb9acK4CMEfke967uIPGBrv2RA9/zFoQ8Mu8i3sRYmTlhDJ0YF1b226faU8rsJJQnaFuhFRO6gQh2WlAYqUG8ZH8CzOmmyxuPw4Rjvx6ltX+sYG+IOVJYJ2mMOa0e+Znxmkn8KPXoPUCQAoCJ4tafWI4BYPkLKErg93QFsDhZoQJfQYmkDU+YLPvDLtfSxwr9GOAt4ON1n1W4L6Qu6RD7qXa/P1JEWHN+gCLFwBMEM8bD3c1gPPos+i5iVzFonfT0BT8hbusuSwYB7lBz/YxgZV5Lh3NhM5JgPnb2QbJuuDwupMOtIGNuWkXFSMVHrY8i1YeeEpDDnrw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <2a86cbbd-ef8f-10d4-e2d5-e806dbaac18c@suse.com>
Date: Wed, 19 Jul 2023 09:42:13 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 2/3] xen/arm: make has_vpci depend on CONFIG_HAS_VPCI
Content-Language: en-US
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Artem Mygaiev <artem_mygaiev@epam.com>, Rahul Singh <rahul.singh@arm.com>,
 xen-devel@lists.xenproject.org
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-3-stewart.hildebrand@amd.com>
 <0dcbc190-2719-6c1d-55d1-4b229dc32e05@suse.com>
 <a90a2858-c2ea-624b-8095-2e2976e1b34a@amd.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <a90a2858-c2ea-624b-8095-2e2976e1b34a@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0151.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:98::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBAPR04MB7205:EE_
X-MS-Office365-Filtering-Correlation-Id: 03c49ba4-6a48-4023-1c03-08db882babdc
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	yCQvUU8ux5T2hstoZub85LRSCO22ZAp1bXHNGo5X3pa+FYfzbCquxe4LEoK5kqzVYuJF4JSC5fGsvmZ64DHxflT6tkhPSPDEktXtf3+wwXsrEB7Cttyoeco+abDZJKN0XnmoWF4/eazU35xc2eNrMFbxIXaBW//xx1WaNSOdMZCVC5Ls9NUeey92FKud+EGvO53ZNqeMl8kkewN60dbZJDDfJLKyzTayexIOBXJ4L8RDAiuDvdDo/3ToDzARiembVX6bYGHZDqj6eNTVZE3M7hgPk3X1coBVdvD8bPMZbR05tsK1zYVBLv8HSEowSsZaEN3ZdalBAdrKsyv1usPKGfXa80xLs81qEfRWAbMIP/dC5Em9ycd4rogseJQhnahc5h9WAuNC0J/eq3DYgFhgz81homsTyHLeGzsL0+UjR5uLQcW6VX5uC5Nzlewu7HlnGsaebs702syjsXkus2w+RFfQBYpTBL45s7qmp+afQnfZ1g498eMwZ8jYo04M7xKew+unvY83BFPGg9DAI26wL8ICtmNwNTATOyhI7wX805Js7csSeFNCcPKiIcPiy2gvUs7SK/+d8tUwkqMSw/5ShiRfQwvdfoF5YVax3vaG+sSGT8UId87uSmBeXcuBLPSgOQRSmMi5r9mCwMwcbd2sBQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(39860400002)(376002)(346002)(136003)(451199021)(41300700001)(8936002)(31686004)(8676002)(316002)(5660300002)(54906003)(2906002)(478600001)(66476007)(6916009)(66946007)(66556008)(7416002)(4326008)(966005)(6512007)(6506007)(53546011)(26005)(6486002)(2616005)(38100700002)(186003)(83380400001)(36756003)(86362001)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eFJyQUp0bk4vUkJPN1cxblozN2RjZFNDL0k5akdMTWV2WWNQZzRmOEVMSFMr?=
 =?utf-8?B?a2UxYkVEVEJDZlRHWTkxZ2MzMmxkcjR2NllhbkZJN1BEY29aWTRIUURqK2o1?=
 =?utf-8?B?c0dtY3p3MTRZVENDaXo2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zYkF6SStyc1NZM0N3ajRIVkNhT0FKQWRucU1aaGJTUnFj?=
 =?utf-8?B?Vm4yRUx2L1JSMEtFMzRvc3RGL3ptT0hyMWUyM3ZYRTBvbTJFN2k5b0F2T012?=
 =?utf-8?B?Q2ZRTS92QWg0Y2NsYXVxOUJlTDVNNVljOFJmcWdCWWNOZkZ2R2VqZkFtVklW?=
 =?utf-8?B?L2o4NWlVQXhsdTEvYTA0RVhYa1V4UnNBMUFvTFpPVkMycWxmYW1JampPZ2o0?=
 =?utf-8?Q?HXrg5oVX9Xj/Iw7XqE3QrSxsW?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 03c49ba4-6a48-4023-1c03-08db882babdc
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 07:42:15.2752
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: qffZENesh5w8It0yxe6IZ5W9KdqLD9oqxa/sBdM9HNpQmb+wFtfQsxFsI4+7K8ZKEQrWas9LYNZCETWQ2vMFlQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7205

On 18.07.2023 19:01, Stewart Hildebrand wrote:
> On 7/7/23 02:59, Jan Beulich wrote:
>> On 07.07.2023 03:47, Stewart Hildebrand wrote:
>>> --- a/xen/arch/arm/include/asm/domain.h
>>> +++ b/xen/arch/arm/include/asm/domain.h
>>> @@ -298,8 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
>>>
>>>  #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag)
>>>
>>> -/* vPCI is not available on Arm */
>>> -#define has_vpci(d)    ({ (void)(d); false; })
>>> +#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); })
>>
>> While likely not much of a problem here, I think we should strive to
>> write macros such that their arguments are evaluated exactly once in
>> all cases (for side effects to occur exactly once). When that's not
>> easily possible, so be it, but here it doesn't look problematic to
>> swap both sides of the &&.
> 
> Thanks for pointing this out. Hmm... I'm considering turning it into a static inline function. This would also satisfy MISRA C:2012 Dir 4.9: "A function should be used in preference to a function-like macro where they are interchangeable" [1].

I don't think that'll work prior to us splitting type definitions into
separate headers. You simply cannot deref d at this point (or in fact at
any point within this header), as struct domain hasn't been defined yet.

Jan

> [1] https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/D_04_09.c



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 07:48:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 07:48:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565614.883908 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM1v5-0002cQ-3B; Wed, 19 Jul 2023 07:48:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565614.883908; Wed, 19 Jul 2023 07:48:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM1v5-0002cJ-0D; Wed, 19 Jul 2023 07:48:23 +0000
Received: by outflank-mailman (input) for mailman id 565614;
 Wed, 19 Jul 2023 07:48:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gZ60=DF=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1qM1v3-0002cD-Mz
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 07:48:21 +0000
Received: from NAM04-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam04on2061d.outbound.protection.outlook.com
 [2a01:111:f400:7e8c::61d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a010b02d-2608-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 09:48:19 +0200 (CEST)
Received: from MW4PR04CA0189.namprd04.prod.outlook.com (2603:10b6:303:86::14)
 by MN0PR12MB5786.namprd12.prod.outlook.com (2603:10b6:208:375::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Wed, 19 Jul
 2023 07:48:14 +0000
Received: from CO1NAM11FT067.eop-nam11.prod.protection.outlook.com
 (2603:10b6:303:86:cafe::6) by MW4PR04CA0189.outlook.office365.com
 (2603:10b6:303:86::14) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.23 via Frontend
 Transport; Wed, 19 Jul 2023 07:48:14 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1NAM11FT067.mail.protection.outlook.com (10.13.174.212) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.34 via Frontend Transport; Wed, 19 Jul 2023 07:48:14 +0000
Received: from cjq-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 19 Jul
 2023 02:48:08 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a010b02d-2608-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=HnsHFoBwbuvIInDPegzUJ4OHYiZdMcVUsBQtsBEN44xI1Gd28z+H0b3IGM0Vfh/hOko6UQu3mQC6gChalYYxsxd29Gl8jE7itfaK/ad+yxS7/qWGc2d7tP2VsGJ9pn+8yzVM96TD80p7J4TkFSEgKlWK83NvslaCE6jhy+KPUNzDt8SFKk/9v17fAKc0FjPL07gAoyHueYEH53PRVvXesKFoNGfYbPIOQ3l9M6vXIcDU2vpWN86ch9Bzrhd9W+T/j++QLAL0IGOe9St/n4XeKKkPspbnGkFl4G8bqmbcwqJ6WNDfszw72jrySxUlgRjjg2TRJtwYNhvK3NKd0gFDgw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=D7zgi8Bt9cY/BXVe0Fdk4OXXzcNBsCIpdX5aoRfuoIM=;
 b=O0H1rKyWaOyrOzc9UxJR+V/URyJCTLUsgLMbCYYg6/dGMvgg3Sf6c33usM5T//0xwNYpVaRRr6fYBp79o2RmuxhyJ3Dw3y5SPfVN5NK5i21IDi63PsXPKGfavaMOS80B42HxUpCwk2ebVQcxPans84gn8agWtn+TEgREmDkx5G1zILllft31WaYcnDHHNSOZ831y/zl3GV6HP+OUfR2YEnptUPP4bsSf2EPc1PUcXI6xWeVEdKeYocutS0WM8qF8851v21WDE86EJltdDVuTIMQMIk40cZjySEGItvNWHJyBhQFdKgDhtGN9n/bnHrYQ6bv+Xqqhj4KFNdWzlKjVWw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=D7zgi8Bt9cY/BXVe0Fdk4OXXzcNBsCIpdX5aoRfuoIM=;
 b=T+Ln31+AohLUDyOQK7QuOIKmgd+E8xjThpSoGWn+yipTLbeiHFjY1AkwHORaaAL5YaqpLwPh56EB1Ony2OdrryI0v2+bJ7yPsIFhdr77zkqeVAjCuVLECtrat0xWNzsvpQbYjo8XP0yTKCzJv2nTfoQpzkiej8jRJDIsQMUx4bk=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jiqian Chen <Jiqian.Chen@amd.com>
To: Gerd Hoffmann <kraxel@redhat.com>, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?=
	<marcandre.lureau@gmail.com>, "Michael S . Tsirkin" <mst@redhat.com>, "Robert
 Beckett" <bob.beckett@collabora.com>, <qemu-devel@nongnu.org>
CC: <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Anthony PERARD <anthony.perard@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>, "Dr . David Alan
 Gilbert" <dgilbert@redhat.com>, Alex Deucher <Alexander.Deucher@amd.com>,
	Christian Koenig <Christian.Koenig@amd.com>, Stewart Hildebrand
	<Stewart.Hildebrand@amd.com>, Xenia Ragiadakou <burzalodowa@gmail.com>,
	Honglei Huang <Honglei1.Huang@amd.com>, Julia Zhang <Julia.Zhang@amd.com>,
	Huang Rui <Ray.Huang@amd.com>, Jiqian Chen <Jiqian.Chen@amd.com>
Subject: [QEMU PATCH v3 0/1] S3 support
Date: Wed, 19 Jul 2023 15:47:25 +0800
Message-ID: <20230719074726.1613088-1-Jiqian.Chen@amd.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com
 (10.181.40.145)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1NAM11FT067:EE_|MN0PR12MB5786:EE_
X-MS-Office365-Filtering-Correlation-Id: 600726fa-98aa-45a8-9c5b-08db882c8235
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	lCMM/3zVKpIRkTmXC79h4uY1TCnAgrZL60cmgfIdnQQTMdzXrdeKsTZ/GxH7M7WhcedbVyXCE7/kypc9e46iQxMXIc73IUfWYp/4MiL8x+uDAcVNxv399/m1IwWfie+cRlkNCGV2I9SVLN7JMjoGx0LjVu/nv+PV/HfHBKeQz5/l8x1WLCtRyCOfwYqvkw2vZvQ8m7WIX5z9GsF30Db6o/dmpAuxGrMSZqjSuqjNFtqaL8cZ1qpHg9wHNULHcmjs3GpUGtUrLiSEZl0uDOOFJMn1eAybfwMqFmg9SoiWaYJX4VsvCJE2SEKcHMK6R9xsS0Qx36TaCPn9UMe6LMXKQ2weju1iC6w6qFRbh+NwXXzkV80TUiYIwA6YwhuLp2w+Y6aRC3TOtETreMB8LJ7oJu4kL2iCnODap5mK2nscsoO58ymfOkJ/K/yyKsuadAxRMe6bx82uPD5UJu7ZOFa0oRY6b6qk4pCIf4gryES4sF0BWqPyKS4bpAekgquxUoiDRzPaDs0q3+xBSUt1Wl6+Dsa65hR5qwtExCk4mtd0vIX/VC1UxkxIQhXlNjOaMtFp+gUXZwLGn+rv1U3R+S4133oLVMUIyiKzBb3I5XautCzWBv+w1y+Hhj1t53df04yBgXOeJ6KkgkWff+hHVdYMQOPnMcaCnXxVYlcFolrakqS70Xhi1P+L07iIRvAqP5EM6py9nWmxCxn9V/uRgh0m6BtOXj5zSkPxA8UYIS20qAzlUb1NWh9r3762jKfLmOvQqUXmgiu8dapT2fKzSSKrfAW/agxdyNxsp9DDrctontA=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(39860400002)(346002)(136003)(451199021)(82310400008)(40470700004)(46966006)(36840700001)(7696005)(1076003)(26005)(966005)(40460700003)(36860700001)(47076005)(83380400001)(336012)(86362001)(426003)(2616005)(16526019)(82740400003)(186003)(81166007)(356005)(36756003)(54906003)(110136005)(478600001)(40480700001)(41300700001)(5660300002)(70586007)(4326008)(70206006)(7416002)(8676002)(316002)(8936002)(6666004)(2906002)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 07:48:14.5984
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 600726fa-98aa-45a8-9c5b-08db882c8235
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1NAM11FT067.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5786

v3:
Hi all,
Thanks for Michael S. Tsirkin's advice. V3 makes below changes:
* Remove changes in file include/standard-headers/linux/virtio_gpu.h
  I am not supposed to edit this file and it will be imported after
  the patches of linux kernel was merged.

Best regards,
Jiqian Chen.

v2:
link,
https://lore.kernel.org/qemu-devel/20230630070016.841459-1-Jiqian.Chen@amd.com/T/#t

Hi all,
Thanks to Marc-AndrÃ© Lureau, Robert Beckett and Gerd Hoffmann for
their advice and guidance. V2 makes below changes:

* Change VIRTIO_CPU_CMD_STATUS_FREEZING to 0x0400 (<0x1000)
* Add virtio_gpu_device_unrealize to destroy resources to solve
  potential memory leak problem. This also needs hot-plug support.
* Add a new feature flag VIRTIO_GPU_F_FREEZING, so that guest and
  host can negotiate whenever freezing is supported or not.

v1:
link,
https://lore.kernel.org/qemu-devel/20230608025655.1674357-1-Jiqian.Chen@amd.com/

Hi all,
I am working to implement virtgpu S3 function on Xen.

Currently on Xen, if we start a guest who enables virtgpu, and then
run "echo mem > /sys/power/state" to suspend guest. And run
"sudo xl trigger <guest id> s3resume" to resume guest. We can find that
the guest kernel comes back, but the display doesn't. It just shown a
black screen.

Through reading codes, I founded that when guest was during suspending,
it called into Qemu to call virtio_gpu_gl_reset. In virtio_gpu_gl_reset,
it destroyed all resources and reset renderer. This made the display
gone after guest resumed.

I think we should keep resources or prevent they being destroyed when
guest is suspending. So, I add a new status named freezing to virtgpu,
and add a new ctrl message VIRTIO_GPU_CMD_STATUS_FREEZING to get
notification from guest. If freezing is set to true, and then Qemu will
realize that guest is suspending, it will not destroy resources and will
not reset renderer. If freezing is set to false, Qemu will do its origin
actions, and has no other impaction.

And now, display can come back and applications can continue their
status after guest resumes.

Jiqian Chen (1):
  virtgpu: do not destroy resources when guest suspend

 hw/display/virtio-gpu-base.c   |  3 ++
 hw/display/virtio-gpu-gl.c     |  9 +++++-
 hw/display/virtio-gpu-virgl.c  |  7 +++++
 hw/display/virtio-gpu.c        | 52 ++++++++++++++++++++++++++++++++--
 hw/virtio/virtio.c             |  3 ++
 include/hw/virtio/virtio-gpu.h |  6 ++++
 6 files changed, 77 insertions(+), 3 deletions(-)

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 07:48:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 07:48:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565615.883919 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM1vB-0002sw-Bg; Wed, 19 Jul 2023 07:48:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565615.883919; Wed, 19 Jul 2023 07:48:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM1vB-0002sn-77; Wed, 19 Jul 2023 07:48:29 +0000
Received: by outflank-mailman (input) for mailman id 565615;
 Wed, 19 Jul 2023 07:48:28 +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
 <SRS0=gZ60=DF=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1qM1vA-0002sD-89
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 07:48:28 +0000
Received: from NAM12-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam12on20622.outbound.protection.outlook.com
 [2a01:111:f400:fe5a::622])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a3506773-2608-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 09:48:25 +0200 (CEST)
Received: from MW4P220CA0013.NAMP220.PROD.OUTLOOK.COM (2603:10b6:303:115::18)
 by CH3PR12MB7545.namprd12.prod.outlook.com (2603:10b6:610:146::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Wed, 19 Jul
 2023 07:48:20 +0000
Received: from CO1NAM11FT046.eop-nam11.prod.protection.outlook.com
 (2603:10b6:303:115:cafe::f8) by MW4P220CA0013.outlook.office365.com
 (2603:10b6:303:115::18) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.23 via Frontend
 Transport; Wed, 19 Jul 2023 07:48:20 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1NAM11FT046.mail.protection.outlook.com (10.13.174.203) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.34 via Frontend Transport; Wed, 19 Jul 2023 07:48:19 +0000
Received: from cjq-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 19 Jul
 2023 02:48:14 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a3506773-2608-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=UN6eSptQJcUMX6fh8WGPYUcYozHpiZ364ti2wzeuFNDKMT69EbACsxs1wQRUmm2aQqJlgyaAdt6c40pz57Ds/x9URcNOiuQDe+hTnq1I8t6r2tOAnjYtDETO9NJwrOjOOUhGwcuMVesaN1Kiz30vl8tdvdStTFhuCbN69O4nBItN/tVubrodX5glSoyeH5XhFuDAapiCw3waUpYC+UdjfyFY/+F/0tTV9UsQ31JHagrbxigjoOCmCMkiIbxU3/M2HX+3aeUTx9l+5wgO338/RUvhsdAes4S0ajJbSikxAtax1WlmO0c8hHm0Oe2+2FePovE5Ltbb+4qZom2bl5zfFw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+DwcABNuip8QDyZ7N2MHhGDI/3D/IA6QWZuUpx+wHHo=;
 b=RAj0naDhHCjKkRVfR8YO42ht1TT3WerWD1AWyHGMqVXcCbOJXgZ4BAiGduE2p1JSTQNqclVEVkhxb8dRiBWj7/N/kS5oNAtM/QI635Vqeevd9sAiVvB/8ZhE9zhjlRMgJLmCaQNv6uYsWgNg5Bs42BirwwyXVsTyqBvGlsj+a8NZDRZ3frYB0L3mBVX0048y1KnO4Pg5ItRn8gV1Ddy1QjlGDlaWrS/XLiq35Fyg/k2jtCyZUFrLWpsJXB4rFcGViZsfMOFijA00pdZcds/QOTJOz9Q3mpX2LlT0uVMQ6gnUJACDcZB0eAPFYdTIEgRmBLdbfAqnooYwsV5vzRj1fA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+DwcABNuip8QDyZ7N2MHhGDI/3D/IA6QWZuUpx+wHHo=;
 b=4IoIbKjqg8RaVZJrgOlEKp55ryJh3X91txbxZfzMJjhk68Y/QTQWdZhTGsN8vjXJQUXF+Q9B/0/0+HL50mzoabYeRsv4i/5RCF83M6qIpiXvr9i6vWI0rnNupzJjgwGnmFwcBr8zThi8Cdb68on9EopAPBHTtxIY8jnTT0hp4AM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jiqian Chen <Jiqian.Chen@amd.com>
To: Gerd Hoffmann <kraxel@redhat.com>, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?=
	<marcandre.lureau@gmail.com>, "Michael S . Tsirkin" <mst@redhat.com>, "Robert
 Beckett" <bob.beckett@collabora.com>, <qemu-devel@nongnu.org>
CC: <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Anthony PERARD <anthony.perard@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>, "Dr . David Alan
 Gilbert" <dgilbert@redhat.com>, Alex Deucher <Alexander.Deucher@amd.com>,
	Christian Koenig <Christian.Koenig@amd.com>, Stewart Hildebrand
	<Stewart.Hildebrand@amd.com>, Xenia Ragiadakou <burzalodowa@gmail.com>,
	Honglei Huang <Honglei1.Huang@amd.com>, Julia Zhang <Julia.Zhang@amd.com>,
	Huang Rui <Ray.Huang@amd.com>, Jiqian Chen <Jiqian.Chen@amd.com>
Subject: [QEMU PATCH v3 0/1] virtgpu: do not destroy resources when guest suspend
Date: Wed, 19 Jul 2023 15:47:26 +0800
Message-ID: <20230719074726.1613088-2-Jiqian.Chen@amd.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230719074726.1613088-1-Jiqian.Chen@amd.com>
References: <20230719074726.1613088-1-Jiqian.Chen@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com
 (10.181.40.145)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1NAM11FT046:EE_|CH3PR12MB7545:EE_
X-MS-Office365-Filtering-Correlation-Id: dab1eb42-cdf9-4986-5856-08db882c856b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	BYvKPXjubJdYafnWoJlwidxb+ajMt0MwQBK3RYdJM/rakCcRcZyEfY4P2t1yhzQabiRbiBeFhMS2xgQqqy77wla73EIsjQR2JSsLGI5fSRK08/gf54pYVptzT+tTIO9/B9QPM0VLhBngssujFiIBq60QE7NFAIyQgg4pSiptC7dOXzWjRY8sMtfu/1T1hVcdd2dDoUBRXYoV8oufmYkDQqAh4mffzfQrWjV6LiJrqMkfiiSuN7waesAK2XKjXkND4ipsN1hMvNS6wMOpHzd46OuyPj+0ZCw8R3ralqclsuGGEUBHwigRO8eR5uFUGH1VeHsopfr2QHpVyiVGM5Vn3KDJPRLmH/qh5B9W5znbSSBjzTBr1aR80ql3EPXVf/AhM6wDQ+nDY4X25itdv9q3JugXxcihzVMMevkimLZ77ih5LiKPcyu4jiwD0tu2TsmVnLp39wJ3fPxugUczQpwd/Jy6v+Qus8pYSBgW24SGxYlJO46CANJGOyMvhil23fu15LCF5EQFjwl2VQ/Oq3yrB9WwzSphybtNiCHKL70HCJJW25WgGnnfIuvhToenLdo0hHi3YQD4By+D2KGzsy8C/D8cNI8BnI+2ngkQnb0LTisC62pGdsD3N3puyGiM4QPh4AfQj0uxd5Z7bgvSxu3Pp4SuDfrvMnMkqZD3nD87K+Te7JNoT1J/B4OxpW8H3es8oJ3nVABe5kjnE+FMLSxoOPG5ZeYbaJFNggLljfT1BApdFFhqpU9Rtaimk6jFcA2y06RpENseeUnkzqwZ1Y2p5g==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(346002)(396003)(136003)(451199021)(82310400008)(46966006)(36840700001)(40470700004)(2906002)(356005)(81166007)(26005)(336012)(426003)(47076005)(83380400001)(36860700001)(16526019)(186003)(1076003)(40480700001)(5660300002)(2616005)(86362001)(40460700003)(82740400003)(8676002)(8936002)(36756003)(15650500001)(7416002)(478600001)(7696005)(6666004)(54906003)(4326008)(316002)(70586007)(41300700001)(70206006)(110136005)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 07:48:19.9838
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: dab1eb42-cdf9-4986-5856-08db882c856b
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1NAM11FT046.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7545

After suspending and resuming guest VM, you will get
a black screen, and the display can't come back.

This is because when guest did suspending, it called
into qemu to call virtio_gpu_gl_reset. In function
virtio_gpu_gl_reset, it destroyed resources and reset
renderer, which were used for display. As a result,
guest's screen can't come back to the time when it was
suspended and only showed black.

So, this patch adds a new ctrl message
VIRTIO_GPU_CMD_STATUS_FREEZING to get notification from
guest. If guest is during suspending, it sets freezing
status of virtgpu to true, this will prevent destroying
resources and resetting renderer when guest calls into
virtio_gpu_gl_reset. If guest is during resuming, it sets
freezing to false, and then virtio_gpu_gl_reset will keep
its origin actions and has no other impaction.

Due to this implemention needs cooperation with guest, so
it added a new feature flag VIRTIO_GPU_F_FREEZING, so
that guest and host can negotiate whenever freezing is
supported or not.

Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
---
 hw/display/virtio-gpu-base.c   |  3 ++
 hw/display/virtio-gpu-gl.c     |  9 +++++-
 hw/display/virtio-gpu-virgl.c  |  7 +++++
 hw/display/virtio-gpu.c        | 52 ++++++++++++++++++++++++++++++++--
 hw/virtio/virtio.c             |  3 ++
 include/hw/virtio/virtio-gpu.h |  6 ++++
 6 files changed, 77 insertions(+), 3 deletions(-)

diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c
index a29f191aa8..d55dc8fdfc 100644
--- a/hw/display/virtio-gpu-base.c
+++ b/hw/display/virtio-gpu-base.c
@@ -215,6 +215,9 @@ virtio_gpu_base_get_features(VirtIODevice *vdev, uint64_t features,
     if (virtio_gpu_blob_enabled(g->conf)) {
         features |= (1 << VIRTIO_GPU_F_RESOURCE_BLOB);
     }
+    if (virtio_gpu_freezing_enabled(g->conf)) {
+        features |= (1 << VIRTIO_GPU_F_FREEZING);
+    }
 
     return features;
 }
diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c
index e06be60dfb..de108f1502 100644
--- a/hw/display/virtio-gpu-gl.c
+++ b/hw/display/virtio-gpu-gl.c
@@ -100,7 +100,14 @@ static void virtio_gpu_gl_reset(VirtIODevice *vdev)
      */
     if (gl->renderer_inited && !gl->renderer_reset) {
         virtio_gpu_virgl_reset_scanout(g);
-        gl->renderer_reset = true;
+        /*
+         * If guest is suspending, we shouldn't reset renderer,
+         * otherwise, the display can't come back to the time when
+         * it was suspended after guest resumed.
+         */
+        if (!virtio_gpu_freezing_enabled(g->parent_obj.conf) || !g->freezing) {
+            gl->renderer_reset = true;
+        }
     }
 }
 
diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c
index 73cb92c8d5..547c4d98ad 100644
--- a/hw/display/virtio-gpu-virgl.c
+++ b/hw/display/virtio-gpu-virgl.c
@@ -464,6 +464,13 @@ void virtio_gpu_virgl_process_cmd(VirtIOGPU *g,
     case VIRTIO_GPU_CMD_GET_EDID:
         virtio_gpu_get_edid(g, cmd);
         break;
+    case VIRTIO_GPU_CMD_STATUS_FREEZING:
+        if (virtio_gpu_freezing_enabled(g->parent_obj.conf)) {
+            virtio_gpu_cmd_status_freezing(g, cmd);
+        } else {
+            cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER;
+        }
+        break;
     default:
         cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
         break;
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 5e15c79b94..54a5e2e57c 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -373,6 +373,16 @@ static void virtio_gpu_resource_create_blob(VirtIOGPU *g,
     QTAILQ_INSERT_HEAD(&g->reslist, res, next);
 }
 
+void virtio_gpu_cmd_status_freezing(VirtIOGPU *g,
+                         struct virtio_gpu_ctrl_command *cmd)
+{
+    struct virtio_gpu_status_freezing sf;
+
+    VIRTIO_GPU_FILL_CMD(sf);
+    virtio_gpu_bswap_32(&sf, sizeof(sf));
+    g->freezing = sf.freezing;
+}
+
 static void virtio_gpu_disable_scanout(VirtIOGPU *g, int scanout_id)
 {
     struct virtio_gpu_scanout *scanout = &g->parent_obj.scanout[scanout_id];
@@ -986,6 +996,13 @@ void virtio_gpu_simple_process_cmd(VirtIOGPU *g,
     case VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING:
         virtio_gpu_resource_detach_backing(g, cmd);
         break;
+    case VIRTIO_GPU_CMD_STATUS_FREEZING:
+        if (virtio_gpu_freezing_enabled(g->parent_obj.conf)) {
+            virtio_gpu_cmd_status_freezing(g, cmd);
+        } else {
+            cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER;
+        }
+        break;
     default:
         cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
         break;
@@ -1344,6 +1361,27 @@ void virtio_gpu_device_realize(DeviceState *qdev, Error **errp)
     QTAILQ_INIT(&g->reslist);
     QTAILQ_INIT(&g->cmdq);
     QTAILQ_INIT(&g->fenceq);
+
+    g->freezing = false;
+}
+
+static void virtio_gpu_device_unrealize(DeviceState *qdev)
+{
+    VirtIOGPU *g = VIRTIO_GPU(qdev);
+    struct virtio_gpu_simple_resource *res, *tmp;
+
+    /*
+     * This is to prevent memory leak in the situation that qemu is
+     * destroyed when guest is suspended. This also need hot-plug
+     * support.
+     */
+    if (virtio_gpu_freezing_enabled(g->parent_obj.conf) && g->freezing) {
+        QTAILQ_FOREACH_SAFE(res, &g->reslist, next, tmp) {
+            virtio_gpu_resource_destroy(g, res);
+        }
+        virtio_gpu_virgl_reset(g);
+    }
+
 }
 
 void virtio_gpu_reset(VirtIODevice *vdev)
@@ -1352,8 +1390,15 @@ void virtio_gpu_reset(VirtIODevice *vdev)
     struct virtio_gpu_simple_resource *res, *tmp;
     struct virtio_gpu_ctrl_command *cmd;
 
-    QTAILQ_FOREACH_SAFE(res, &g->reslist, next, tmp) {
-        virtio_gpu_resource_destroy(g, res);
+    /*
+     * If guest is suspending, we shouldn't destroy resources,
+     * otherwise, the display can't come back to the time when
+     * it was suspended after guest resumed.
+     */
+    if (!virtio_gpu_freezing_enabled(g->parent_obj.conf) || !g->freezing) {
+        QTAILQ_FOREACH_SAFE(res, &g->reslist, next, tmp) {
+            virtio_gpu_resource_destroy(g, res);
+        }
     }
 
     while (!QTAILQ_EMPTY(&g->cmdq)) {
@@ -1425,6 +1470,8 @@ static Property virtio_gpu_properties[] = {
                      256 * MiB),
     DEFINE_PROP_BIT("blob", VirtIOGPU, parent_obj.conf.flags,
                     VIRTIO_GPU_FLAG_BLOB_ENABLED, false),
+    DEFINE_PROP_BIT("freezing", VirtIOGPU, parent_obj.conf.flags,
+                    VIRTIO_GPU_FLAG_FREEZING_ENABLED, false),
     DEFINE_PROP_END_OF_LIST(),
 };
 
@@ -1441,6 +1488,7 @@ static void virtio_gpu_class_init(ObjectClass *klass, void *data)
     vgbc->gl_flushed = virtio_gpu_handle_gl_flushed;
 
     vdc->realize = virtio_gpu_device_realize;
+    vdc->unrealize = virtio_gpu_device_unrealize;
     vdc->reset = virtio_gpu_reset;
     vdc->get_config = virtio_gpu_get_config;
     vdc->set_config = virtio_gpu_set_config;
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index eb6347ab5d..e2ccf50a9e 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -240,6 +240,9 @@ qmp_virtio_feature_map_t virtio_gpu_feature_map[] = {
     FEATURE_ENTRY(VIRTIO_GPU_F_CONTEXT_INIT, \
             "VIRTIO_GPU_F_CONTEXT_INIT: Context types and synchronization "
             "timelines supported"),
+    FEATURE_ENTRY(VIRTIO_GPU_F_FREEZING, \
+            "VIRTIO_GPU_F_FREEZING: Freezing virtio-gpu and keeping resources"
+            "alive is supported."),
     FEATURE_ENTRY(VHOST_F_LOG_ALL, \
             "VHOST_F_LOG_ALL: Logging write descriptors supported"),
     FEATURE_ENTRY(VHOST_USER_F_PROTOCOL_FEATURES, \
diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
index 2e28507efe..53e06e47cb 100644
--- a/include/hw/virtio/virtio-gpu.h
+++ b/include/hw/virtio/virtio-gpu.h
@@ -90,6 +90,7 @@ enum virtio_gpu_base_conf_flags {
     VIRTIO_GPU_FLAG_EDID_ENABLED,
     VIRTIO_GPU_FLAG_DMABUF_ENABLED,
     VIRTIO_GPU_FLAG_BLOB_ENABLED,
+    VIRTIO_GPU_FLAG_FREEZING_ENABLED,
 };
 
 #define virtio_gpu_virgl_enabled(_cfg) \
@@ -102,6 +103,8 @@ enum virtio_gpu_base_conf_flags {
     (_cfg.flags & (1 << VIRTIO_GPU_FLAG_DMABUF_ENABLED))
 #define virtio_gpu_blob_enabled(_cfg) \
     (_cfg.flags & (1 << VIRTIO_GPU_FLAG_BLOB_ENABLED))
+#define virtio_gpu_freezing_enabled(_cfg) \
+    (_cfg.flags & (1 << VIRTIO_GPU_FLAG_FREEZING_ENABLED))
 
 struct virtio_gpu_base_conf {
     uint32_t max_outputs;
@@ -173,6 +176,7 @@ struct VirtIOGPU {
 
     uint64_t hostmem;
 
+    bool freezing;
     bool processing_cmdq;
     QEMUTimer *fence_poll;
     QEMUTimer *print_stats;
@@ -284,5 +288,7 @@ void virtio_gpu_virgl_reset_scanout(VirtIOGPU *g);
 void virtio_gpu_virgl_reset(VirtIOGPU *g);
 int virtio_gpu_virgl_init(VirtIOGPU *g);
 int virtio_gpu_virgl_get_num_capsets(VirtIOGPU *g);
+void virtio_gpu_cmd_status_freezing(VirtIOGPU *g,
+                         struct virtio_gpu_ctrl_command *cmd);
 
 #endif
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 07:53:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 07:53:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565621.883928 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM206-0004eu-30; Wed, 19 Jul 2023 07:53:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565621.883928; Wed, 19 Jul 2023 07:53:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM205-0004en-VM; Wed, 19 Jul 2023 07:53:33 +0000
Received: by outflank-mailman (input) for mailman id 565621;
 Wed, 19 Jul 2023 07:53:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM204-0004eh-7m
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 07:53:32 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0616.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::616])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5a6931b3-2609-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 09:53:31 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB7625.eurprd04.prod.outlook.com (2603:10a6:10:202::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Wed, 19 Jul
 2023 07:53:28 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 07:53:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5a6931b3-2609-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ivWAknSe4nB1a2dpp4NG48Lg0FoxB/GH7X3aZBqaP6Besclkq5a0t9rW1j/Lf03jIC9SbineXgllYwg3XhlcUjpk5BZbXK/QlRDbmU99AKlpGiA3co/2r+zALweMD+nhkO7SN1imgs/kYFmH3Zx9pc6CrFq4bU0tHv69tb+WlpXRy92Bel4IHp9qo4sFPR867HPXuDSLfPsBT3Q+9/Gcf7SY0t9r7xzQamvaPCPY8vOigKlcYCf7Sdv19CWYthXkg1V4TjsyK/067d5S2r8rbfsXhaaJ8N+/7qAe4ufbrZvQAoMCX13vVunzfQNiKpVaJzWrXWwXPBu9s+6N3G00OQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=g83LjZ1bG8j32x90eKP6T4t7w8TZhBkjeY42mGTpuds=;
 b=JhBS41ZgWoROoud4NRU5DQ+wG/SSQ5T+P3VmJ8b7prybihen3JgzScdhmNk8Od/qCdEGK7DzyM35veI3Lk3CRWT4/6IJrzInQ3vPLrJdP8WmG0INtcEv7L2PVYQN27muEtNTzvihesMOFvM0w2lFjladM92pzHhav50m68TD2HMNJm9GDOmBLRXiGjbVjfC/sUPVj/kX8kuTtBzUp7u5MvQ0fV+sWmw4h+sfO+B93baeZQk0UrtaLVS0vpHj4z6vbuAu9V/ROQrU1EVbIUOSXR3kK/kfrWEirXMkDswBCkM58jJnVmgmJCem2zMduA4VcpeAHp304CSW1tXnuPdMBQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=g83LjZ1bG8j32x90eKP6T4t7w8TZhBkjeY42mGTpuds=;
 b=YDgxTt9UFK0jDxiKHeTx40dUsznnzmjiEBqARpHDyib3iF+3WsbdmgeHeybJDeCMSRupjUQMAGXxzr6YoK0dgJ2mh8TSkDeEVOgGDlpZl51JW1PThxRH7+CyvF/0iPdyabPBwHIqUIN2q965bZYDR22/B4EMVPMatPeXqALv0Vw9/1xJpUl/YM82guqHPPgYKWbdKzRLDkznzEaImbw7wQpV55rAEGzBFOXlPr7yi29McatWeyPP4Nj4MZRgLf+o3mmslCvpt468U92FdwXtnDw1GdgpAdtQlufkKs8fYO9fIm3/eRO5HCIVboH0KlOrmT+F076p8CLq4ys0n+cqpQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <528ab0ac-de98-3e18-a9d3-e88a707ea2c7@suse.com>
Date: Wed, 19 Jul 2023 09:53:26 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 2/4] x86/idle: Get PC{8..10} counters for Tiger and Alder
 Lake
Content-Language: en-US
To: Simon Gaiser <simon@invisiblethingslab.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
References: <20230718132334.2087-1-simon@invisiblethingslab.com>
 <aa23a090-1883-008b-e395-2a3bca709258@suse.com>
 <2be631d2-95f3-0d7f-ad84-eb9e16d1a39a@invisiblethingslab.com>
 <b6365b9d-47a1-8ab4-37eb-0b821257dbd2@suse.com>
 <683e73d8-037a-5e38-745d-ae1c0e18fc79@invisiblethingslab.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <683e73d8-037a-5e38-745d-ae1c0e18fc79@invisiblethingslab.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0177.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b4::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB7625:EE_
X-MS-Office365-Filtering-Correlation-Id: 869f3a13-ed56-4833-0cf3-08db882d3cf2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	CmRcPmX6n7DwwpiFB5bAZK6izOU7877Jn+q2Zy0naoog6CO/k4QNY2cWQv0LFsSaQehaHzt8mqj/wwH0TY2URtS65fQt75BsGL8eh9N7shN4s9QB8EfCIEKFW/5wdIn8vRw2gMHyYbZIwkTHylhDHTm53OYqwrZsgKTx2D0M2GYnQlYk5011OFGer99kEqExJYsfROev3wGUd4/m0PULEGxuBzgwN64Fbx33pdBykV+NztTcssvuviP0CmAWE30eQF8aVFv+2iWhj610WAuoslIzFtFY4DUpadh9OodKdpbXA5cPr/1sl21kJCHDNCkcVWh5Fzb43BM5DvFiMwUDP6h3BYV3JowVFAeXfiYj+GaWiE1qbx5DtTufqXTPzux8SY+Jtq7QK4B+P2lYARvNd8We2T5BZ5b0FprsSrueSZscNPjK53jITCYkSU8nknPLsWxoF2WqhiPgmQvDODfLqi0P+WUe6UvSXdARyE0c7WnKFzBbtBLwOX9p7SKfHMz5z7v+lldl7oVX21spDxWDUTszzF3qvbZKM5Y1QFWKfWl30rOUVgwNgYCNXvPR+sae7Sc+9GmGKA+wGjfmMK+p/3tKxGzA8BDkCdzYpwUY1qq58pqt37/onBPD/EJHYbOXaKEdh7B47TCh+2+hisF0icfN89qn64/DjInpl+lQOTs=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(136003)(346002)(39860400002)(396003)(451199021)(31696002)(86362001)(2906002)(36756003)(31686004)(186003)(83380400001)(6506007)(26005)(53546011)(38100700002)(54906003)(6486002)(66946007)(6512007)(4326008)(66476007)(966005)(66556008)(2616005)(316002)(6916009)(478600001)(41300700001)(8936002)(5660300002)(8676002)(101420200003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NVNGcXZidHZnNDI0K2JJcVQ5Nmk4VC8xTkJsbVZCOGFQWm9ZNHA0cVFtaUR6?=
 =?utf-8?B?Nm1MNlhrVW1YWjc0Q0RqRjlPU1pPMUI2NTlEZXRxUDlBK3hEQnFlelJhZUxy?=
 =?utf-8?B?e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zUTkweDNvclBD?=
 =?utf-8?B?aGZjRkwwMEhBb1ZzVGUwT2plSklpV0Vabi9UTnRPMXZEMitBYW5mWGxoOEJQ?=
 =?utf-8?B?ZjVKM2VYaGF0TzU5elBXUzBQUXJyd3c3NFBVZGczMDFNRFhnT3ZuR2w3R29q?=
 =?utf-8?B?amp2YWwvZ2NpY2VqSTlDd0FaMFdYMWV6VzVwL29TM3NQbG5sbGJPaHMyY001?=
 =?utf-8?B?dlBFQk5vYUNyNjYzZE5MUGxNZ1hTSkpQNTkvajlWV21KS25ZNEQzM2I3dWFU?=
 =?utf-8?Q?GlQvIw+M8uHdS4q4G99r/xcYP?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 869f3a13-ed56-4833-0cf3-08db882d3cf2
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 07:53:28.2054
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: P4UZi6h/uOzOV2tUnBEK/aGC3+aoVsJLOqutGAiuv5nKIQ/2t8d5UbNgAq6DF58N+0P/9v18RIXYf3nooY+eiw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7625

On 18.07.2023 22:17, Simon Gaiser wrote:
> Jan Beulich:
>> On 18.07.2023 15:46, Simon Gaiser wrote:
>>> Jan Beulich:
>>>> On 18.07.2023 15:23, Simon Gaiser wrote:
>>>>> ---
>>>>>  xen/arch/x86/acpi/cpu_idle.c | 9 ++++++---
>>>>>  1 file changed, 6 insertions(+), 3 deletions(-)
>>>>
>>>> This lacks both S-o-b and a proper description. The latter in
>>>> particular because you ...
>>>
>>> Yeah, I also noticed in the meantime, sorry. Will be fixed in v2.
>>>
>>>>> --- a/xen/arch/x86/acpi/cpu_idle.c
>>>>> +++ b/xen/arch/x86/acpi/cpu_idle.c
>>>>> @@ -155,6 +155,12 @@ static void cf_check do_get_hw_residencies(void *arg)
>>>>>  
>>>>>      switch ( c->x86_model )
>>>>>      {
>>>>> +    /* Tiger Lake */
>>>>> +    case 0x8C:
>>>>> +    case 0x8D:
>>>>> +    /* Alder Lake */
>>>>> +    case 0x97:
>>>>> +    case 0x9A:
>>>>>      /* 4th generation Intel Core (Haswell) */
>>>>>      case 0x45:
>>>>>          GET_PC8_RES(hw_res->pc8);

One note here: Please follow what we do later in this switch and
maintain roughly time-wise ordering between the case blocks. IOW
you want to insert below the Haswell entry, not above.

>>>>> @@ -185,9 +191,6 @@ static void cf_check do_get_hw_residencies(void *arg)
>>>>>      case 0x6C:
>>>>>      case 0x7D:
>>>>>      case 0x7E:
>>>>> -    /* Tiger Lake */
>>>>> -    case 0x8C:
>>>>> -    case 0x8D:
>>>>>      /* Kaby Lake */
>>>>>      case 0x8E:
>>>>>      case 0x9E:
>>>>
>>>> ... don't just add new case labels, but you actually move two. It
>>>> wants explaining whether this was outright wrong, or what else
>>>> causes the movement.
>>>
>>> Yes, as the commit message says it get those PC{8..10} counters for
>>> Tiger and Alder Lake.
>>
>> But that's the problem - there was no commit message.
> 
> I'm used to that in git "commit message" refers to the whole thing,
> including the "title" (everything till the first blank line. Usually
> only a single line. Put into the Subject header by format-patch). And
> there it says exactly this, which I considered enough when drafting it.
> Will send a v2 with a more verbose description.
> 
>>> The former already had a label, therefore the
>>> move. I assume that when Tiger Lake was added it was an oversight to not
>>> also read those package C-state counters.
>>
>> Or the SDM wasn't clear, and we needed to err on the safe side.
> 
> The SDM [1] seems to be indeed a mess regarding
> MSR_PKG_C{8..10}_RESIDENCY. If I didn't missed something in that huge
> document it lists PC8 and PC9 only for Intel Core 4th gen with CPUID
> 06_45H (table 2-31). For PC10 it additionally list Atoms starting with
> Goldmont (table 2-12 and references to it).
> 
> But it already contradicts itself by listing on page 5002/5003 06_4Fh
> (some Xeons) as another model that supports those MSRs. It refers to
> table 2-38 there, but that table doesn't contain those MSRs.
> 
> Linux' pmc_core [2] and turbostat [3] both use those MSRs on Tiger and
> Alder Lake. And on my Tiger Lake test system I get useful data from
> there.
> 
> Is the code in Linux a good enough reference?

Well, the SDM has to be the primary reference. Linux can be used, sure,
if the respective commits look trustworthy. Note though that if we were
to follow Linux, yet more changes than what you propose would want
doing, afaics.

Note also that personally I wouldn't accept references to a user space
tool (i.e. turbostat) as justification.

Jan

> [1]:
> I looked at what's currently linked on Intel's website. "325462-080US"
> from "June 2023"
> https://cdrdv2.intel.com/v1/dl/getContent/671200
> 
> [2]:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/platform/x86/intel/pmc/core.c?h=v6.4#n44
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/platform/x86/intel/pmc/tgl.c?h=v6.4#n188
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/platform/x86/intel/pmc/adl.c?h=v6.4#n291
> 
> [3]:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/power/x86/turbostat/turbostat.c?h=v6.4#n5763
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/power/x86/turbostat/turbostat.c?h=v6.4#n5074
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/power/x86/turbostat/turbostat.c?h=v6.4#n5409



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 07:59:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 07:59:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565626.883938 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM25P-0005Ug-N6; Wed, 19 Jul 2023 07:59:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565626.883938; Wed, 19 Jul 2023 07:59:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM25P-0005UZ-Jf; Wed, 19 Jul 2023 07:59:03 +0000
Received: by outflank-mailman (input) for mailman id 565626;
 Wed, 19 Jul 2023 07:59:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=K8L3=DF=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qM25N-0005UT-DX
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 07:59:01 +0000
Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com
 [2607:f8b0:4864:20::f33])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1e345f23-260a-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 09:59:00 +0200 (CEST)
Received: by mail-qv1-xf33.google.com with SMTP id
 6a1803df08f44-634a3682c25so44474006d6.3
 for <xen-devel@lists.xenproject.org>; Wed, 19 Jul 2023 00:59:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1e345f23-260a-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689753539; x=1690358339;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=JxClSREVUOwSDRQCQTviMuwSJTtZa3GSEpjzvaG5qsE=;
        b=aVlhdFFjLbVqt7fVMape7n5e0qfPwtwuh6FWk4xPOU/yBFa3AsoSXX2cpRpSr+H8E/
         yLEenfK8YoCvizIB/OJ5bbiBqK/nPL+Eaagoo3Nu8ThCCzym0NSCC2PtGrXDNmH/Sydy
         h3jRLpRBYko3noyT+2q8+9wedH7ENCgEqbJUP79dYl2bu141D7WfmkhJwLIQsPS2uFnC
         v3uSfHc2eS5pAel8P1LBL9xR1CX1Zlukz/hN7UtSZrvMwl+AfKQe/pRHFQBZnjAs2DyW
         tq1kvELR9GrqJ3Yd2b7GV1n7EfXzKvmsHrvLotdapb/0TtblA58PQ0DzqgPRa2gNwXBs
         mQZg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689753539; x=1690358339;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=JxClSREVUOwSDRQCQTviMuwSJTtZa3GSEpjzvaG5qsE=;
        b=eZO6Y22ATHmT+1hixvTIStHHHjVHMln3AyaTijqkbo0nA9b6PWi/jIeXUPt4i4804e
         mqglIY/jMjzJ01WA1cwr8LW7RiS1jzcq/dJ9aGQ1bkNJHoDWRwXjTsar4tN9krsLpBH7
         N7OsHtf7Tvw68608FgvBV/fcwUCsxkMMUWPrAuoJZxt4gnxeQH5PllIB444hSKWpiBjh
         5JYd+2t1GMCHIfLuldfh/G3vV2AG5EhaAAwSzGsFKFEII/oUNzp8o0dNVEWUjqolzPEW
         hPCt/nbzDJMkAUGBsHQl2M9rtg2a8Asook78E7gCtuMSt+4ezNYsNxuaBG9NZm0BMTuS
         D86A==
X-Gm-Message-State: ABy/qLa6Ir1w/M7FHvGboFLdpPCgYHTZJBJ9eiZ/MVPQPZuHNc7YhG64
	vGJiAddox5+yuRgNfJ/680HUygzyZt5c+cGL2Xyo0A==
X-Google-Smtp-Source: APBJJlHUcOAcpILeJ5Y6/fuEzAP55ymFUhWdKNalIEqCm58rZC0/9pj99aZfQCY08gKLXbgX0P1dedZTT99EtsTmdHc=
X-Received: by 2002:a0c:b20f:0:b0:635:dd30:8181 with SMTP id
 x15-20020a0cb20f000000b00635dd308181mr2012848qvd.56.1689753538842; Wed, 19
 Jul 2023 00:58:58 -0700 (PDT)
MIME-Version: 1.0
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-11-jens.wiklander@linaro.org> <BA9E08C6-6379-4B21-A254-E68C8E71917A@arm.com>
In-Reply-To: <BA9E08C6-6379-4B21-A254-E68C8E71917A@arm.com>
From: Jens Wiklander <jens.wiklander@linaro.org>
Date: Wed, 19 Jul 2023 09:58:47 +0200
Message-ID: <CAHUa44EpLHAL9MB-K3=eu6O78bDz3ppRaVfUs_X63VXqR618Ng@mail.gmail.com>
Subject: Re: [XEN PATCH v10 10/24] xen/arm: ffa: add direct request support
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, 
	Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>, 
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici <Marc.Bonnici@arm.com>, 
	Achin Gupta <Achin.Gupta@arm.com>, Henry Wang <Henry.Wang@arm.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Bertrand,

On Tue, Jul 18, 2023 at 11:41=E2=80=AFAM Bertrand Marquis
<Bertrand.Marquis@arm.com> wrote:
>
> Hi Jens,
>
> > On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> wr=
ote:
> >
> > Adds support for sending a FF-A direct request. Checks that the SP also
> > supports handling a 32-bit direct request. 64-bit direct requests are
> > not used by the mediator itself so there is not need to check for that.
> >
> > Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> > Reviewed-by: Henry Wang <Henry.Wang@arm.com>
> > ---
> > xen/arch/arm/tee/ffa.c | 113 +++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 113 insertions(+)
> >
> > diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> > index e157ed20ad8b..e05d58cf7755 100644
> > --- a/xen/arch/arm/tee/ffa.c
> > +++ b/xen/arch/arm/tee/ffa.c
> > @@ -181,6 +181,56 @@ static bool ffa_get_version(uint32_t *vers)
> >     return true;
> > }
> >
> > +static int32_t get_ffa_ret_code(const struct arm_smccc_1_2_regs *resp)
> > +{
> > +    switch ( resp->a0 )
> > +    {
> > +    case FFA_ERROR:
> > +        if ( resp->a2 )
> > +            return resp->a2;
> > +        else
> > +            return FFA_RET_NOT_SUPPORTED;
> > +    case FFA_SUCCESS_32:
> > +    case FFA_SUCCESS_64:
> > +        return FFA_RET_OK;
> > +    default:
> > +        return FFA_RET_NOT_SUPPORTED;
> > +    }
> > +}
> > +
> > +static int32_t ffa_simple_call(uint32_t fid, register_t a1, register_t=
 a2,
> > +                               register_t a3, register_t a4)
> > +{
> > +    const struct arm_smccc_1_2_regs arg =3D {
> > +        .a0 =3D fid,
> > +        .a1 =3D a1,
> > +        .a2 =3D a2,
> > +        .a3 =3D a3,
> > +        .a4 =3D a4,
> > +    };
> > +    struct arm_smccc_1_2_regs resp;
> > +
> > +    arm_smccc_1_2_smc(&arg, &resp);
> > +
> > +    return get_ffa_ret_code(&resp);
> > +}
> > +
> > +static int32_t ffa_features(uint32_t id)
> > +{
> > +    return ffa_simple_call(FFA_FEATURES, id, 0, 0, 0);
> > +}
> > +
> > +static bool check_mandatory_feature(uint32_t id)
> > +{
> > +    int32_t ret =3D ffa_features(id);
> > +
> > +    if ( ret )
> > +        printk(XENLOG_ERR "ffa: mandatory feature id %#x missing: erro=
r %d\n",
> > +               id, ret);
> > +
> > +    return !ret;
> > +}
> > +
> > static uint16_t get_vm_id(const struct domain *d)
> > {
> >     /* +1 since 0 is reserved for the hypervisor in FF-A */
> > @@ -222,6 +272,57 @@ static void handle_version(struct cpu_user_regs *r=
egs)
> >     set_regs(regs, vers, 0, 0, 0, 0, 0, 0, 0);
> > }
> >
> > +static void handle_msg_send_direct_req(struct cpu_user_regs *regs, uin=
t32_t fid)
> > +{
> > +    struct arm_smccc_1_2_regs arg =3D { .a0 =3D fid, };
> > +    struct arm_smccc_1_2_regs resp =3D { };
> > +    struct domain *d =3D current->domain;
> > +    uint32_t src_dst;
> > +    uint64_t mask;
> > +
> > +    if ( smccc_is_conv_64(fid) )
> > +        mask =3D GENMASK_ULL(63, 0);
> > +    else
> > +        mask =3D GENMASK_ULL(31, 0);
> > +
> > +    src_dst =3D get_user_reg(regs, 1);
> > +    if ( (src_dst >> 16) !=3D get_vm_id(d) )
> > +    {
> > +        resp.a0 =3D FFA_ERROR;
> > +        resp.a2 =3D FFA_RET_INVALID_PARAMETERS;
> > +        goto out;
> > +    }
> > +
> > +    arg.a1 =3D src_dst;
> > +    arg.a2 =3D get_user_reg(regs, 2) & mask;
> > +    arg.a3 =3D get_user_reg(regs, 3) & mask;
> > +    arg.a4 =3D get_user_reg(regs, 4) & mask;
> > +    arg.a5 =3D get_user_reg(regs, 5) & mask;
> > +    arg.a6 =3D get_user_reg(regs, 6) & mask;
> > +    arg.a7 =3D get_user_reg(regs, 7) & mask;
> > +
> > +    arm_smccc_1_2_smc(&arg, &resp);
> > +    switch ( resp.a0 )
> > +    {
> > +    case FFA_ERROR:
> > +    case FFA_SUCCESS_32:
> > +    case FFA_SUCCESS_64:
> > +    case FFA_MSG_SEND_DIRECT_RESP_32:
> > +    case FFA_MSG_SEND_DIRECT_RESP_64:
> > +        break;
> > +    default:
> > +        /* Bad fid, report back. */
> > +        memset(&arg, 0, sizeof(arg));
> > +        arg.a0 =3D FFA_ERROR;
> > +        arg.a1 =3D src_dst;
> > +        arg.a2 =3D FFA_RET_ABORTED;
>
> Those instructions setting arg have no consequence as arg is not used
> after. This is probably a left over from the previous loop.
>
> You can either send this back using arm_smcc but I would rather return
> a proper error back to the caller by setting properly resp regs.
>
> What do you think ?

Yeah, it looks like a mistake was introduced in the v8 patch set when
the loop was removed. The intent was to return this error back to the
caller. I'll fix it by replacing "arg" with "resp".

Thanks,
Jens

>
> Regards
> Bertrand
>
>
> > +    }
> > +
> > +out:
> > +    set_regs(regs, resp.a0, resp.a1 & mask, resp.a2 & mask, resp.a3 & =
mask,
> > +             resp.a4 & mask, resp.a5 & mask, resp.a6 & mask, resp.a7 &=
 mask);
> > +}
> > +
> > static bool ffa_handle_call(struct cpu_user_regs *regs)
> > {
> >     uint32_t fid =3D get_user_reg(regs, 0);
> > @@ -239,6 +340,10 @@ static bool ffa_handle_call(struct cpu_user_regs *=
regs)
> >     case FFA_ID_GET:
> >         set_regs_success(regs, get_vm_id(d), 0);
> >         return true;
> > +    case FFA_MSG_SEND_DIRECT_REQ_32:
> > +    case FFA_MSG_SEND_DIRECT_REQ_64:
> > +        handle_msg_send_direct_req(regs, fid);
> > +        return true;
> >
> >     default:
> >         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
> > @@ -331,6 +436,14 @@ static bool ffa_probe(void)
> >     printk(XENLOG_INFO "ARM FF-A Firmware version %u.%u\n",
> >            major_vers, minor_vers);
> >
> > +    /*
> > +     * At the moment domains must support the same features used by Xe=
n.
> > +     * TODO: Rework the code to allow domain to use a subset of the
> > +     * features supported.
> > +     */
> > +    if ( !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
> > +        return false;
> > +
> >     ffa_version =3D vers;
> >
> >     return true;
> > --
> > 2.34.1
> >
>


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 08:06:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 08:06:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565633.883948 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM2CX-0007W1-RF; Wed, 19 Jul 2023 08:06:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565633.883948; Wed, 19 Jul 2023 08:06:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM2CX-0007Vu-OL; Wed, 19 Jul 2023 08:06:25 +0000
Received: by outflank-mailman (input) for mailman id 565633;
 Wed, 19 Jul 2023 08:06:24 +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
 <SRS0=fyAl=DF=citrix.com=prvs=55726f7b7=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qM2CW-0007Vo-JR
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 08:06:24 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2513ecbd-260b-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 10:06:21 +0200 (CEST)
Received: from mail-bn8nam11lp2168.outbound.protection.outlook.com (HELO
 NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.168])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 19 Jul 2023 04:06:17 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by PH0PR03MB5878.namprd03.prod.outlook.com (2603:10b6:510:34::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Wed, 19 Jul
 2023 08:06:15 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 08:06:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2513ecbd-260b-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689753981;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=51e7riYfyV/SlWoUef1zMcA00Ac39QG0n3MgeOluJtI=;
  b=StCpVo5sYpLZvhJ8aV94GtqOlWTImYY45F0algdo4ObGEp3fo5v2gZ/3
   RH1JjmhNwfHjEnHY/mVvz2TjeXxFFJ8kDMNUW72j/MryYI2oCVxKbFWLh
   o8Qa422GYnNNdx+YyRdOtakiHozWx2GQxdHfCm+BSCA180qPdA2qTWTwa
   A=;
X-IronPort-RemoteIP: 104.47.58.168
X-IronPort-MID: 115991452
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:txBfG6kf7STrd7Z5IQSD6Pfo5gysJ0RdPkR7XQ2eYbSJt1+Wr1Gzt
 xIWWmrSbP6KZzChctEgYYy0o0sC6sPVn4VlSwc//CA0FiMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5Q6GzhH5MbpETU2PByqgKmVrNrbSq
 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/
 f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3
 eM3DxMvN0iIvf/swPGeZPFP34cffPC+aevzulk4pd3YJdAPZMmaBo/stZpf1jp2gd1SF/HDY
 cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVkVw3iea9WDbWUoXiqcF9t0CUv
 G/ZuU/+BQkXLoe3wjuZ6HO8wOTImEsXXapLTeDpp6c23Qf7Kmo7OQQJS1udrduFu22/RM5RD
 0kfoyMchP1nnKCsZpynN/Gim1aGtBMBX9tbE8Uh9RqAjKHT5m6xFmUCCzJMdtEinMs3XiAxk
 E+EmcvzAj5iu6HTTmiSnp+LqRuiNC5TKnUNDRLoViMA6tjn5Ys13hTGS486FLbv14OlXzbt3
 zqNsS4ywa0JitIG3Lm6+laBhC+wop/OTUg+4QC/sn+Z0z6VrbWNP+SAgWU3J94ZRGpFZjFtZ
 EQ5pvU=
IronPort-HdrOrdr: A9a23:mIEpd6Bt+4ibFOXlHem755DYdb4zR+YMi2TDsHoQdfU1SK2lfq
 WV954mPHDP+VQssQ4b6LW90cW7LE80lqQa3WByB8bAYOCOggLBEGgI1+TfKlPbdxEW/9QtsZ
 tdTw==
X-Talos-CUID: =?us-ascii?q?9a23=3AuW99lmuyVcqQAQxSiYjFeJhS6Is6XVr+7i6IKHW?=
 =?us-ascii?q?lU2YqbZONagbTxPNdxp8=3D?=
X-Talos-MUID: =?us-ascii?q?9a23=3ABjYhIgxg6E+6G7KXqLgFcWBXjNeaqJW3F14Nt5k?=
 =?us-ascii?q?kh/inNDNsNROYh22+cKZyfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,216,1684814400"; 
   d="scan'208";a="115991452"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=GWuMx2O7cCHN3f0ZAa/lUG2l8QdVgypeZi6tZAWRGRMztPAvu5R7QwQAeR/eZ/Kfg33r2/d1Lct/PD4n+3cJc9A4DrzWxx9FbZhU8EjAdBWba03bAnzU5qS5zMMl0x9Y3JyDyhrUj5i8WRxnOwzg1d7csW5mC6FZLB1FiI9vUWm03HMb5959lbCJGIS2QbZZimAeAsNsiq2BHtJ+s/OX87JZ5W5cOxu7txDdzj1UXcGwJYP72+rZTRntoY0DjzOlk/Hi5Ch30DPwqzt2iHHRmHURiUZIhxL2l/0Nyb8zWoYvDfToBU3oE58SXewsRnDqMpNX29/V0fk3kwZvQaCliA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=iQxWbjEV3drKoWkfyCM++nGf9g/KbOq1967oth5Hpas=;
 b=gvFPBb/uaIrSiTJHZI7h+tBPpnx3iqvrTVIFeBKthShsoAd6jw0AtDDpnL1WRy6uVg20bzFcL39dskNlQwxw/0D7V/tX4a9yzoCClF2pamyLneqwo7dGEfZtbsgvqosm5BOSjqVqzI3jwHOYTY/pVmel9xbW8hhAl5u7Wt1DrYQoe7g59s0SziQRkvCmDLUohUnZnoJauBA3xYx4LAmlGrUxycHg4OYOTg3YhxfqSPrrB9R4SDG4FG3bpWmKu67WkYowvm5V1HVLt1CNET29yMK8MUEzIr7sUiULGep72mHC5TVCDlu81PXponfDu94FgfVW+NWv5gT3tXm0sOr3HA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=iQxWbjEV3drKoWkfyCM++nGf9g/KbOq1967oth5Hpas=;
 b=uiprHp2gEJNeg3WrXOlytRDo+QmMaIgK7Qa0q62Mqudl0o7JVGXRJq1bISud6CUwbqbPi+UCPfcGq+6l/mHNFE1ziAGmH+szOSa2Mbkt+BiiiECufiD1BXB6ywhK42g4TZBmeyrKNF+nvUh9KiMk+TrIW4tXNpJT+lkA1JO7N+c=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <f9e4d896-fcbb-eca3-ed3d-e7ad886dbc0f@citrix.com>
Date: Wed, 19 Jul 2023 09:06:08 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH] x86: fix early boot output
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>
References: <3913c170-09c6-2baf-ed38-5614f8c6cb2e@suse.com>
In-Reply-To: <3913c170-09c6-2baf-ed38-5614f8c6cb2e@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0066.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:153::17) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|PH0PR03MB5878:EE_
X-MS-Office365-Filtering-Correlation-Id: fcc14f85-a14e-4901-5a25-08db882f05c3
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	cAzPLFKTJxTf4qc7HVwjTzaPE2dAgzWTK7NFgYdmivK6NM4q9a8b2HPZHsAFCEhJ0H7y2k1g1HXJNdy5MBbRVSkz0tmZGpkh365Nqh2eSAopH8GbEqP0vPgYOX9PekH/PlWwccFCSzx/TCg82o5WzLNbtWSxXKqoSFcEkzDd+FJ+xbvbExPgNQE4shg5fG8rWEEfdYHF/Jrp0tatb/esmFTQ3NXUfd4tdgpBKcHvcrDow5WvZvTU9DicvvTq0ShY3c0NUKSCSn4CR7iY/S72MxAKDWmwi1HGHlGTT40BDwOd0T2nTHkD12nnTn9VQDdoTXukbnDilLQZ6lFcfhUMz/K6pcR8llvonoWJeXWV0TzCDrI7H/FTbCk8hQv9fkn+vi+VDwxqBeGmtOKR0lYvsC3CSLA5bD72rtl5e5q9EaLN+sAT5o8wG8UJSKIcPFjFRnMTq1hkdKnKdW+aYJWyBQbzjJs+nVR4gtTHpEoOJkGs7WdKKf0vp4PgMQTBcMhFO8MKHItYIZz8MG1zYmpO12Y+fKMuKQvI1bwFjXRtq4OyqDLWcEVQWeUsAwlai53qaPKvcUdcY7fMbhGOokkb+Y/P4Ic5BPIdClGbxMy/WEDsz5lMHrge/uOCnqAo3nKIsABur8wQuMi96q2nyKyoKA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(366004)(39860400002)(346002)(376002)(451199021)(478600001)(110136005)(6666004)(6486002)(53546011)(186003)(6506007)(54906003)(41300700001)(6512007)(107886003)(26005)(2906002)(4326008)(8676002)(5660300002)(66556008)(316002)(8936002)(38100700002)(82960400001)(66946007)(66476007)(31696002)(86362001)(36756003)(83380400001)(2616005)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Nmo2K3NieHFBV0pEdlVwSy9tZStNTlVVWHhJd1JJZm1GcGVoNXBkSlRPWm5W?=
 =?utf-8?B?K3FYWWtJZ1RmNWorZXI4VE5YK3pncUdFRDZjR1JVNGYzL3VNMk5LbDBQTE9m?=
 =?utf-8?B?azVVa2NxVm1uRHlkS2p3WStneTVWZWhxajh3ak5zME1wMm5ETUh0aDVxRlBk?=
 =?utf-8?B?Uno3ZmYvSVJQb3ZYNk42d1ZPSUwwWGN1blg5UGlZWFZCSjNQeXhFNzl1Wkkx?=
 =?utf-8?B?VEN3L1B0bXI4TjJVZk5adDZORjFmaXlLLzhNVVE4MVdNczI0OGdabVhJTGFk?=
 =?utf-8?B?bFBEUXlIbW5MaEttRzBnYysvNm9PVXc5cHNveXVmM0o0TTRKSmZrTmFKaXlR?=
 =?utf-8?B?QUtwOFlrYWxrT0VSQ1RPNTN3VUpISkVYQnpTR01Ea0hQL29kaWg4cElCQTNj?=
 =?utf-8?B?RHdDNXJOcnRacHA4WjcvWk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Y0pU?=
 =?utf-8?B?YVE9PQ==?=
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	GHtewX+y9Y4JuE4S41+eHJn4OctUXgTiGvYA1z4rFX0r2QokF6ScgBCQbv5dDUZ54yvCxLfB4XsdkYKUJYag+G5+lhzHWs+krM5BDAWq144mXued2LSzPICgrxYn2eJKWSQkRWk2RnaxXBnNtRKEhRLk5rBkCmyIScQjuy0Sv5nGOlfP/bmpxAe61ZUCzhaOb6YG1jVEhU5MVqMNz3wLeQPGVFY7AS8/CqVappQpSr/0AQLxMb8tPPx28PBwtQzUy5Q6lW2kqpp7vEEudG7QHpsTmB3+wJ9iQhps2RygMZ9JC770Gp3jUS9vFzeyOteGqxnzY7R2W3g6RA0CWmD7/DrR/z0ka1VhZiTZSCARSfwtcf/eum2ZBfZ4lGwpurcH1VKUTETTXf027bUzXpBBCVSZNVS1uxXACsWHYj2yRdW7aLIzk1zCafXzrj68Ghvq9l7uxG3QzgGyKz+7OEtH7VTs4/zQQi2hYUq2gxee0iap62k0mA1IRDfyflCeh/6oyMl7NAjFYg51NvGWvCpg4Et58GjLF8BSNT6gyIyks0mx6AhfW1jl2oDMziDeG6ks9FB0BIMWbAFubzjz9sZBJX6NVC4UgkCmwm718eriheXb3Xbj3ZtthTOFF3Vor7+MCZNEz7aW4BtTRqGsEK1Nhut/nCVbR8GgTfWX9IEmI3hI21gvtq/HQcnU/3+dwjQynfDgHQ2OnVxejVkknkypJrpxSB7mpVi21Nir5KI+7rhUbms81ChBYgg5P4X3A0vwZTO9xQv7SwdmFUlpluCbkTp6naOXusj4GJZij00PuOyIr9HILC0Kc4naV/Cq21fR
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: fcc14f85-a14e-4901-5a25-08db882f05c3
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 08:06:14.7341
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: VsxIGpE3fGkt8r1J5B2RI/CgVWFr6y3fbcU0/zcQUkVWFIe7s5UvqbhVATJZ02RWqlvLYeTPJIGenIR8MOHpuinMORBXjHh+9E3b4FICqDk=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB5878

On 19/07/2023 8:38 am, Jan Beulich wrote:
> Loading the VGA base address involves sym_esi(), i.e. %esi still needs
> to hold the relocation base address. Therefore the address of the
> message to output cannot be "passed" in %esi. Put the message offset in
> %ecx instead, adding it into %esi _after_ its last use as base address.
>
> Fixes: b28044226e1c ("x86: make Xen early boot code relocatable")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

When I was doing the label cleanup, I did wonder how this worked, given
that it clobbered %esi.Â  I guess this is the answer...

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Although it occurs to me that probably want to (optionally) use one of
the IO-port/Hypercall protocols too to get these messages in PVH boot
case too.

> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -184,12 +184,15 @@ early_error: /* Here to improve the disa
>           * Here we are on EFI IA-32 platform. Then reliable vga_text_buffer zap is
>           * impossible in Multiboot2 scanning loop and we have to zero %edi below.
>           */
> -        add     $sym_offs(.Lbad_efi_msg), %esi
> +        mov     $sym_offs(.Lbad_efi_msg), %ecx
>          xor     %edi,%edi                       # No VGA text buffer
>          jmp     .Lprint_err
>  .Lget_vtb:
>          mov     sym_esi(vga_text_buffer), %edi
>  .Lprint_err:
> +        add     %ecx, %esi     # Add string offset to relocation base.
> +        # NOTE: No further use of sym_esi() till the end of the "function"!

Minor, but I'd phrase this as "Note: sym_esi() no longer useable".

It is obviously limited in scope, but "until the end of the function"
gives an implication that it's fine thereafter which isn't really true.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 08:08:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 08:08:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565638.883958 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM2En-0008Ln-C7; Wed, 19 Jul 2023 08:08:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565638.883958; Wed, 19 Jul 2023 08:08:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM2En-0008Lg-8D; Wed, 19 Jul 2023 08:08:45 +0000
Received: by outflank-mailman (input) for mailman id 565638;
 Wed, 19 Jul 2023 08:08:43 +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 <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM2El-0008LW-Rn
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 08:08:43 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20621.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::621])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 795d71d9-260b-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 10:08:41 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DUZPR04MB10015.eurprd04.prod.outlook.com (2603:10a6:10:4d9::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Wed, 19 Jul
 2023 08:08:40 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 08:08:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 795d71d9-260b-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=K409wA3uhtHazrQ46rFhYeoLsk9gICXD9+0T4UYKMR5cmeNosqTXmRRCsuELqGRlj4Romu5/qaYZGFV3DrrZgcxyNFfG64t0dkaH4WjRL3VmLSC06eVTjL762acJgqcPCDio6gnXVeU2xYtBxOG/wJ7TQZBkEKQ3eks4utuNoXlmnNzuNthMmDU67EsrFo410eWQCleaVZgmen4B6vGO16h5z8y7S2CYT+VtXmLydk0DiA88H4dwUd8YbWuJnnwfWldhZ++67f9z2IDGeMD3HzEf9voIBaT2reFrvnJtixfBxpQeN4pHLHuRBf5m5Cau9reEklKduNbWUJ4XMCb9YQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=aTLgFJWNstHopnT5HXG6kEe/abyzGC77JFD7tO9ND/c=;
 b=HgKccJ/Gx31tq9vnqbFhGTryTPJR86NSXDaYWzJWVwF4m70a5xbOMG7USCT156nS9YmMJfsUcKy9gb867fcmgHUbU7Awt36dHirhUnVK102Vtn74Xo1s6vrUZFSiLXeox3ulEen1mLxgbFVkAZDjpwnYyRIdx4pntAEyEeGD/TnHkuhBPCpl3xEg1rDDZRBh0ltdPx8V5TX+w71EfKNlV5ZfcvFJ3Ril005S6YkgM5EwrklEpg69Lcu0TigYmpCa0xb3yHHj9LrsqfZvWRj0XoMf/OLB5jjKPFOrz3RbvUq7K/6Epa6f5iO/LWSauyXV4eEq/MP8iS3VCG0Kgww9PQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=aTLgFJWNstHopnT5HXG6kEe/abyzGC77JFD7tO9ND/c=;
 b=NA9WwcFc71pR0g3GjPlwFxYU7ODKuQSYPS6E6hnH0Tbx382rfgsI5yVnnVkClYJyubEyfXBZX/9H/aO/GBKvbz9ND+msoQmvkHCCbuO9rPgbRdgZb2+z47XMrKvVRF6w3AD5z79VFE+yIlR3a1jLfcuX2UC+yqimyLL+8HrVQOV/i6lrO2u0JWC87u5rMsHcMD9yOwTxuZeThCC3vZ7PyTZO1GXRg734Gm8bl4Cec52jfMm8QgI9HyS049h9QLvhK2etsG5xgnk0tLJUYyTr26A9Sgj9fupAMCw2Wq3A5k+5W1hvwQ2IoaxKUgpkRSn2Q4JXTuYpqfRosxsIkJ89rA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <0e760026-9883-1eb9-34de-b637ebec0db5@suse.com>
Date: Wed, 19 Jul 2023 10:08:36 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v4 1/4] common: Move a few more standalone macros from
 xen/lib.h to xen/macros.h
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1689710519.git.sanastasio@raptorengineering.com>
 <10ce452be68b4f83213f5199a3b84459a479bcda.1689710519.git.sanastasio@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <10ce452be68b4f83213f5199a3b84459a479bcda.1689710519.git.sanastasio@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0182.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ab::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DUZPR04MB10015:EE_
X-MS-Office365-Filtering-Correlation-Id: 00e30d47-72ba-49dd-a9a0-08db882f5c37
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	/JvD1BVIEQbsPrKBFo949jJPrukM1NzFAVbCfzsIiI13L3hCOJTVPR8g1w3EwfmZOa59gtqS+IFHaddAoJpouJPQuzzHjOCirPSScfWJ5gT2tqYrLEXkrryqGC3SEOdjaVYnq44A23KGYaJqMdfKSDs7TeddNwwI7K9qDUuFixDZzeiJ9PF1EyQcyfvsmf3UrsTNgEauVdgyOKnhP5umOHgdzqIzOHM5VqrFxTDKychYlSEyxkSHIpFlSugzPU3Qk6uXatO0L6r69l+Lip5tszPRg6Udo6F/dc0FNOXIVkzMswTnpolWGRdKlyzoLpCC9i411uMUU15vV/FWLReUC7EAnFg4MdrqVDT5I9/d73UXYp/6SccpKneo8prO8XrANlF9Ty35X1pH3nfmIiEHixSMBGJyZLRe1K4aRAjCerK+hlX3kpmPr9Rt8Rpo7UkqmgcMhm5OVzxNyK0CEQfSL3Apbw77q8Y2FA46JKNRqQSB2vRKDSKD6EXxZaZloZ3yxeaqHhy8rh+U7E+0HOYou5oVAFdIZ3Aw/y2SmInSKe5oignk5gXe3mgbXksRncQQ29oyAA/kILnvyU3CrIyk/wyWW4TOS2IpjuHdkKhMpKSDBb5xU5MpeJK1VlGx9rmDnCX52wb1bTMIo+KZ7U4kNg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(366004)(396003)(136003)(376002)(451199021)(31686004)(36756003)(86362001)(31696002)(2906002)(6512007)(186003)(53546011)(6506007)(26005)(6666004)(6486002)(54906003)(5660300002)(6916009)(316002)(2616005)(66476007)(38100700002)(66946007)(4326008)(8936002)(66556008)(478600001)(41300700001)(8676002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VktoYVpSN2x1Y3EwK2dab2FnWm1ZR1g0Yy90TGFkT3NUQm9kWk1PQVo4RllB?=
 =?utf-8?B?YXJDaDQ1RHZmc3dtZVhFU0Nvd1RhTXlSWWRVcUxBb1gzNlRhTE9tcXpKTXdz?=
 =?utf-8?B?cER5dGVJV3BKT25IaDRNd3RONzNjUU56UFhxYVc4TnlWQ3ovcWRp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MaEV0YmQwRmlaRzg4TWRydzFK?=
 =?utf-8?B?ZWpjZnNxbWRnWGZ6KytUeStXeENIYU9IUkFVVjdiYzdMV1ZZRjZ1YTZRdEVG?=
 =?utf-8?B?M2xGRVV2Uk01bjNyMmhwN3hkeHJTL3IyN2Fxclg1Mkg2QU5pTk9jSGJpcmg2?=
 =?utf-8?B?QWU2cVRTbkRFYmRtMlZ5UGFwakJJenNMUVVJNEY0ZTIyc3pMQjYvT25RR1Rx?=
 =?utf-8?Q?6B24hxwPti9tt/LDnNEqeCtZj?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 00e30d47-72ba-49dd-a9a0-08db882f5c37
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 08:08:39.6546
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: UlK3eaXW5aXWWsyw+whjVQ/uj0KL9cSNg05BEdIgDPHs7RcScTnnhEL1Cf4cfRr63I9+zTkmIAjFmWGiDUHJaQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DUZPR04MB10015

On 18.07.2023 22:20, Shawn Anastasio wrote:
> Move a few more macros which have no dependencies on other headers from
> xen/lib.h to xen/macros.h. Notably, this includes BUILD_BUG_ON* and
> ARRAY_SIZE.
> ---

I would have wanted to put this directly on top of my patch, but
the submission lack S-o-b.

> --- a/xen/include/xen/macros.h
> +++ b/xen/include/xen/macros.h
> @@ -22,6 +22,38 @@
>  #define __STR(...) #__VA_ARGS__
>  #define STR(...) __STR(__VA_ARGS__)
>  
> +#ifndef __ASSEMBLY__
> +
> +/* All clang versions supported by Xen have _Static_assert. */
> +#if defined(__clang__) || \
> +    (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
> +/* Force a compilation error if condition is true */
> +#define BUILD_BUG_ON(cond) ({ _Static_assert(!(cond), "!(" #cond ")"); })
> +
> +/* Force a compilation error if condition is true, but also produce a
> +   result (of value 0 and type size_t), so the expression can be used
> +   e.g. in a structure initializer (or where-ever else comma expressions
> +   aren't permitted). */

While moving this, please correct comment style.

> +#define BUILD_BUG_ON_ZERO(cond) \
> +    (sizeof(struct { char c; _Static_assert(!(cond), "!(" #cond ")"); }) & 0)
> +#else
> +#define BUILD_BUG_ON_ZERO(cond) \
> +    (sizeof(struct { unsigned u : !(cond); }) & 0)
> +#define BUILD_BUG_ON(cond) ((void)BUILD_BUG_ON_ZERO(cond))
> +#endif
> +
> +#define ABS(_x) ({                              \
> +    typeof(_x) __x = (_x);                      \
> +    (__x < 0) ? -__x : __x;                     \
> +})
> +
> +#define SWAP(_a, _b) \
> +   do { typeof(_a) _t = (_a); (_a) = (_b); (_b) = _t; } while ( 0 )

While I won't insist here, it would be nice if we could also get rid of
the bogus leading underscores as these are moved. Arguments here don't
need any, while the local variables want to use trailing underscores,
like we do elsewhere.

With at least the earlier two items taken care of, feel free to also add
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 08:17:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 08:17:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565644.883968 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM2NN-0001dx-5x; Wed, 19 Jul 2023 08:17:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565644.883968; Wed, 19 Jul 2023 08:17:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM2NN-0001dq-3A; Wed, 19 Jul 2023 08:17:37 +0000
Received: by outflank-mailman (input) for mailman id 565644;
 Wed, 19 Jul 2023 08:17:35 +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
 <SRS0=KnqJ=DF=citrix.com=prvs=5573504fe=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qM2NL-0001dR-8Y
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 08:17:35 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b46df22d-260c-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 10:17:32 +0200 (CEST)
Received: from mail-sn1nam02lp2041.outbound.protection.outlook.com (HELO
 NAM02-SN1-obe.outbound.protection.outlook.com) ([104.47.57.41])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 19 Jul 2023 04:17:24 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SA1PR03MB7148.namprd03.prod.outlook.com (2603:10b6:806:33f::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.28; Wed, 19 Jul
 2023 08:17:16 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 08:17:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b46df22d-260c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689754652;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=cH89sucdW3no+s4hD9S1nk6H36jxZkwVef+E7b0QLcg=;
  b=KnIx6P8cNE/6dVbeHEQh+xCHpDVVu53Z/mfXBfVJ4zOIhPTfshCAadUO
   7aro7YHggJOWfx0qPAdoZpzp/NY6G4oZitf15FXM+3YwzZ9yz9QJEuHLJ
   kZXKTeuPCr698oikelLBpvvtoUv8T2XZRPG+i8QZle1WrMVK3piWZaKOl
   Q=;
X-IronPort-RemoteIP: 104.47.57.41
X-IronPort-MID: 116718419
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:RsaZH6vxQC9nCeg5K4J1acbSvOfnVHBfMUV32f8akzHdYApBsoF/q
 tZmKW2FaK7eY2GjeYhyPo+xoUlXu8PTx9NnHVBv/no2FXsU+JbJXdiXEBz9bniYRiHhoOCLz
 O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQqIu
 Nfjy+XSI1bg0DNvWo4uw/vrRChH4rKq4Vv0gnRkPaoQ5ACHxiFMZH4iDfrZw0XQE9E88tGSH
 44v/Jnhlkv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
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=h9CHrj0bpEZyVc23QGLnoGZFAe+L3F/CYtlZjuAd0qIwmObT9hVq0XiFzEk7dWe7J/yj7tkPp1zkTWlr5nogniej7Jt4OH2NHWAkUhwDzG3Keq/TLIpoBw01hJY7HjS1yeHA2yQYjEnPxuP1Ecuiq+dYbQNllxV11YszhO1Oai2txSNDSbAWtKfVzI+1XCTzo4xnoQ4N0iVUSf6VUsJJQvJNiTz4y2CQOI9A4VVDgFy1hO4KnCoGGum9DBn/O9mhGWIlO1bVms++SAEuvAm4tpZ5VvfxyN+uvS3nqyhS4zn/OLwE0MgAKxXM4ucjeWBrU90MabiJAMjdoI90cU3QHA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=XxisrErvsXmxBmJIG4SlnuK6E7NZw1Zrn0X14k5RaV8=;
 b=BOG76Dq5CuIkdHLZUPu41rBY+9Zwgwq0Vyyz/lPMmLhwhfw0/8NNQMCdnxl6XGDInZcnZ1+NnCNiVEQpH5rGigvj8VqdSnVm947inNO2xB7TT3STVnMlkj3YdmcDbVo5EpE/GzIcpIYeqwd3eJ3xh0H6Hsj3ntj/QWAD3Wk/XOGbCfOgXicfnm7HKxyUEhGm5dskDMkDKgiO25nLcCTKnKGqYLGGgksqlPJfn8YykBPZMufM2KH3bZDARi0VwWxQigO0GbHCDlyhga80XzcUTzCeLS3DWgr8iS8a3FYX2zfYzkHqq4lchdSEENmLOcASHBbJfl8xN8C0UWyxuwDDHA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XxisrErvsXmxBmJIG4SlnuK6E7NZw1Zrn0X14k5RaV8=;
 b=hRbW049sm9K3Iv9nnk6YllUCsJLZbN3NILTBF2qCUbEiLuR/t1b7+I3c5tCQ3fqQIHVlbMIByhW6PNg+4zGAgoVpIXDC5WYz8JHR9OFPwobDiWbAIhPUeqXwa2Q20hl5mLEPq5vSDdCqayG4SFvcYLo8FUolI7mh7RFpCuJXu9E=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Wed, 19 Jul 2023 10:17:10 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Wei Liu <wl@xen.org>
Subject: Re: [PATCH] x86: fix early boot output
Message-ID: <ZLecBsa0pD5wPF4s@MacBook-Air-de-Roger.local>
References: <3913c170-09c6-2baf-ed38-5614f8c6cb2e@suse.com>
 <f9e4d896-fcbb-eca3-ed3d-e7ad886dbc0f@citrix.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <f9e4d896-fcbb-eca3-ed3d-e7ad886dbc0f@citrix.com>
X-ClientProxiedBy: LO4P123CA0496.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1ab::15) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA1PR03MB7148:EE_
X-MS-Office365-Filtering-Correlation-Id: 2b9098fe-faca-452a-34d7-08db88308fb3
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	hsakq2kuJQPSOcmf1aBNsspeSavVezpnfFzze3KfC+ekY+KkFXdQsLfJz1UEdMnbpbi7bH7mhvHfYPa4Oz9C9Yf9Qhg2s1qPPqERggljffCqRNvH+m68pmle5d/vZyDfEtRfg2hp07rm05x11tXGLr6Q3r69GnrVcCtiog6NyZlWwcbC0M3hecNvL14D1mUPr27/1lmOIUyBVUTNCdNB9jtEDiosu32dxOQ/Ve06diOjMkwr1aZecKTpTBxtavYy1XongPtsx5ZwydvWHqLU8O3JjMEVhufsqQ/cxawcwP/NG66nTcOmohczfoPcJhR1BYDvwpMCejhkMkId+K2ExgetC3lFF4qHZj5Qjhk1PLJ01xmyppLw+O+weiCs1zKZg5PZtaxCQMaidvtc1fX2AXuvZbDhkJ7vowuZspw7C+ltlzKlpgGcEb2Lg/98gpu96eigonEQS9oPHfZ9Qn6z+teSYrW2Zd1bAalvRJEb3mOki9VsCxQO3LIrau4VnMaFhx6i97DajmpMvUkLvXswPwUhDiLJObARxoF+wHMIVR5E/yPFtBYtfUv57Sp7ejwe
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(376002)(346002)(366004)(136003)(451199021)(9686003)(53546011)(6506007)(26005)(38100700002)(6512007)(186003)(83380400001)(2906002)(85182001)(5660300002)(54906003)(6862004)(478600001)(82960400001)(86362001)(6486002)(316002)(6666004)(41300700001)(66476007)(8936002)(8676002)(66556008)(4326008)(66946007)(6636002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-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frsVg/74lSpOIoWlLHTOte5bL3hX8BtAt0RRdnW9YZJ+Un+ayB8GWrOtLfLxGF3QyN5DQUfTROUGKx8/hniEdKwt45qCqWbS0uMop4x/Dm+T5UmQjaD6Yh5C9PVgFUBCYvv8PrrTLH2h4CUWGtmTGlKD3p/M5J/bGkhQpqUZhVCk4cZZq4WfuTkWfEVhi8/xFvj0+L4BUe7XxTWdgMpkBblDctZ2h1Jjj2Xecl65E30KTKqgMOd9yXf7+MlbMhvwzoydhAv1Nli1+NCxsgCqSc0ffHeovc/QfIOg8sfvnPYGvOm7DA8a3HrvbLIhPPRW3TmRi6AlqDMXaABkp2/3NajVCP9e2Y+Dey+sxfbnVQ3khnYcDp0jyjZXSIq7VIhqaZc7MNRw2VPnN2UaefGsRsHc/XeZTnOJHcpSrlJPhfRk6sVou7w89ZV2uZSO5TEZ4gg
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2b9098fe-faca-452a-34d7-08db88308fb3
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 08:17:15.4786
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: bxHPtXfUo5KFTsr+yvfSzFdXGR/ON652FX+YxXoByExqCfA9N6piJoVFL3ZQf6A9vvacdBJTQgM8fvfHzJq6PQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB7148

On Wed, Jul 19, 2023 at 09:06:08AM +0100, Andrew Cooper wrote:
> On 19/07/2023 8:38 am, Jan Beulich wrote:
> > Loading the VGA base address involves sym_esi(), i.e. %esi still needs
> > to hold the relocation base address. Therefore the address of the
> > message to output cannot be "passed" in %esi. Put the message offset in
> > %ecx instead, adding it into %esi _after_ its last use as base address.
> >
> > Fixes: b28044226e1c ("x86: make Xen early boot code relocatable")
> > Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> When I was doing the label cleanup, I did wonder how this worked, given
> that it clobbered %esi.Â  I guess this is the answer...
> 
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Although it occurs to me that probably want to (optionally) use one of
> the IO-port/Hypercall protocols too to get these messages in PVH boot
> case too.

Using XEN_HVM_DEBUGCONS_IOPORT would be my preference, as it's the
same IO port that's used by QEMU as a debug console.

Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 08:18:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 08:18:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565647.883978 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM2OO-00029V-Ex; Wed, 19 Jul 2023 08:18:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565647.883978; Wed, 19 Jul 2023 08:18:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM2OO-00029O-CG; Wed, 19 Jul 2023 08:18:40 +0000
Received: by outflank-mailman (input) for mailman id 565647;
 Wed, 19 Jul 2023 08:18:39 +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 <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM2ON-00029G-6z
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 08:18:39 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0617.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::617])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dc09b7c9-260c-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 10:18:37 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8591.eurprd04.prod.outlook.com (2603:10a6:102:21a::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Wed, 19 Jul
 2023 08:18:34 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 08:18:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dc09b7c9-260c-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=IsNNqcFN3BtSF7a9OBMndwv/hKzhtxrBTe63bg+x+6L4cOezFga+jy3/bSdxnWA28aWIwaP4+h9nwq2dN+W17KBU6g+WezfVX0I/F8ctFfp+jzIoVlDAEImtCdNzWcRBmtoE5tICwqOo2kA+neZO7yhaqDssEJcyYuTtchjiv+BxaTmkmtj/rzu/u4MXEUwG3CkvQeX4IuD8AETUK1iYxW3+Z6ErbPsTUVwsZPN1Reft1j2cxEAJdCpA2tyYIG5723HRQEsHlQDmLdEe1vPKEETT39GyoQlqIa+kFRj1iBnI3rYZQh0svW4W+J6MyzETtDeK0b+YLK72cbPhZMF0Ug==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=TPNKuFMnJcAtiAwWAFPfnyhTPWJieqK9ZlbNC5TeTeE=;
 b=LVr6hxCFvZGtzO+TYwd3Z3diWomv55MHLxbeXmEtoo8xNZNelBmLCHY02cYQROHLKhGaFyv6sXwY6cUj++yvMQwyczxY5fAXx+/ju+ACTnbwX3EpjZjf/kOtopriw3aO5v3WvdmERwotv5eWg0Yq/xuHZSLeKA/JuJp5elExr5IVKIByos015Asx6QTSl7t5EfVAQNECcC2R5UyUP3HzVWxWc25PVZTYXyNI84YZOIdJUC1zkiHcGBG1hrfUo2vq/Aoj1YvoxzvNQH7yI7HaqonuvyPbkhkSkLsGq/i5+wh3/Hitne3QGPSufYrPMllAYHBn7HOaPf98RyYbYQbBBw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=TPNKuFMnJcAtiAwWAFPfnyhTPWJieqK9ZlbNC5TeTeE=;
 b=SHsy2KmIu5fbw90XALRGzykLmwe2nwWFQkRNZwAt4XJigLZm8BQN1qLE1Uvw/mBW2E+MK5/A1rtAnkJ1hKYBja3ShRtsZc++EFsIvFNWrbibEubcFBIhbSW0Lxl4xO+pVd2L9NvJJ+UNY0UxyCmjr0/Pjh4aJGNK5IVH7CFPsRKN5K6fyPjou79k9DgCq6YBAlPxsePLwRe1n/yE3L4HnsbxkEB7+HWXQ4zDGHLrBL6kP0iu/kV358uhIdkoHw3EULmFkGbC5v0Nh5yXB/fjKLgwRBCvbitm8Z9kmyIkWecfXentqTFLwF6rPgGqTJC5rVlWvO/4lxk581iH1ECEuw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <a974d462-6a7e-39a3-1747-018a519b1fad@suse.com>
Date: Wed, 19 Jul 2023 10:18:32 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] x86: fix early boot output
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <3913c170-09c6-2baf-ed38-5614f8c6cb2e@suse.com>
 <f9e4d896-fcbb-eca3-ed3d-e7ad886dbc0f@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <f9e4d896-fcbb-eca3-ed3d-e7ad886dbc0f@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0073.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1e::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8591:EE_
X-MS-Office365-Filtering-Correlation-Id: d6a893b2-40f0-4e7c-92f2-08db8830bef0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	/03qXYee0ZE+hQ26KdR4rBEbndBnnmYfNrlHGSJJvQ5g7EMyAsrITth+lB/T2K5pSAIaFl0QFm/51gPJ6kHs+mdnVYKIKatjJjJnycskb17GF9lWxeY2BfU51oPrNEW+V/+i2HiEh7wjAIXbC+WyP+02VUr/qnZfMDtMhcjduFC+GaIVQwWHv2mOVONm5UYKcP89/RNxOG+Kyo39Yy7FE4cVhF9LKOkZPFo9sXkcjbqpGQGf9KozLjbUiZAxkZwnRbbtbTgjDyKu8jisSivJ67jYHmHSJjK5Q/fqlI0PMPfddwqDbCjtev8pUFE0rouTE517lHOXeNkrkKksVsz+yBYvKxUcBamg1IHqJx2+EzzViiHDswdwHjY0t/Y5GeWV9/o5TjouErL08Ek4+TgYrhIgj9Ww7Gf83Z7/yip1HVrBmdXcGi/shVefsehoBGCc+i2yzvZr1TRgaorfBh7mN/k+wQcVNA2BRbKWjcWpBMY2v7rd5b/zztU/wTUYlyK/1C9so4AusKdDEKQQsjkFj005ZwawdMA2tE7E9uSHct5n9DJ+erMugPNo1pPy6janq50YyIyiYG5DoSQAW58eNIgw/U9BDmOJabSzqAA+S5AUHAnrFKwSsMIV2c5mhyk/yUUA6aX61ZcL8EKnqHrkKA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(396003)(136003)(376002)(39860400002)(451199021)(478600001)(54906003)(6486002)(53546011)(6506007)(186003)(6512007)(26005)(2906002)(6916009)(66946007)(316002)(4326008)(8936002)(66476007)(5660300002)(8676002)(38100700002)(31696002)(36756003)(83380400001)(2616005)(86362001)(41300700001)(66556008)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
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WOVBSZkRLckht?=
 =?utf-8?B?R0NPSzN3ZGRZV3pNSHByQ2xCOUdzbEUzaVAyT1pmWVFycnhFbTdVVkowUWdo?=
 =?utf-8?B?WlJsU3AvNGRvb2VVSzdhaXRhUDd4Y1RPcHhpb09kUFhRTHJMTlpXdG9vcW5D?=
 =?utf-8?B?RkRVTWt1OWdUcXBxa2VvclBydFdrQXlNdFlGVnljeTlDSXFKcHZVSmE2bkl4?=
 =?utf-8?B?NGw0Zk15d1NPMHlaOWJuMmdSZER0d2dJVit6YnYzZlVtZi9OYWhQcEsxWWZQ?=
 =?utf-8?B?enI1SWFUY2krY0srMUFHYXdpQ0JaZkp3OTQ2UWZ5MENsUFE3S00yM1U0Smxt?=
 =?utf-8?B?bDhGR3FjQU1vaFB2WUtjYjQ2bUp1VG0xdkFKcDl0VnNTSUwwK2FGWmx2Z1ly?=
 =?utf-8?B?bGxyU0Q0RVQraXlVOEw2SXNOM1lIZlp3YVd5dlBJNjM3TGxmZGhsTXVQemF3?=
 =?utf-8?Q?0DKG1G3Dg72BX57oCNni0+zzR?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d6a893b2-40f0-4e7c-92f2-08db8830bef0
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 08:18:34.7168
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: alYmRqVSEi2HwtdZB1VWd7R+Pery64UGrU1lmfBlPcPRUZyGhveIFGuK1Uk5D7IZ1qo6PQWCL8gDsA8Y884QMQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8591

On 19.07.2023 10:06, Andrew Cooper wrote:
> On 19/07/2023 8:38 am, Jan Beulich wrote:
>> Loading the VGA base address involves sym_esi(), i.e. %esi still needs
>> to hold the relocation base address. Therefore the address of the
>> message to output cannot be "passed" in %esi. Put the message offset in
>> %ecx instead, adding it into %esi _after_ its last use as base address.
>>
>> Fixes: b28044226e1c ("x86: make Xen early boot code relocatable")
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> When I was doing the label cleanup, I did wonder how this worked, given
> that it clobbered %esi.Â  I guess this is the answer...
> 
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks.

> Although it occurs to me that probably want to (optionally) use one of
> the IO-port/Hypercall protocols too to get these messages in PVH boot
> case too.

Probably.

>> --- a/xen/arch/x86/boot/head.S
>> +++ b/xen/arch/x86/boot/head.S
>> @@ -184,12 +184,15 @@ early_error: /* Here to improve the disa
>>           * Here we are on EFI IA-32 platform. Then reliable vga_text_buffer zap is
>>           * impossible in Multiboot2 scanning loop and we have to zero %edi below.
>>           */
>> -        add     $sym_offs(.Lbad_efi_msg), %esi
>> +        mov     $sym_offs(.Lbad_efi_msg), %ecx
>>          xor     %edi,%edi                       # No VGA text buffer
>>          jmp     .Lprint_err
>>  .Lget_vtb:
>>          mov     sym_esi(vga_text_buffer), %edi
>>  .Lprint_err:
>> +        add     %ecx, %esi     # Add string offset to relocation base.
>> +        # NOTE: No further use of sym_esi() till the end of the "function"!
> 
> Minor, but I'd phrase this as "Note: sym_esi() no longer useable".
> 
> It is obviously limited in scope, but "until the end of the function"
> gives an implication that it's fine thereafter which isn't really true.

It is very true. The use here is the first out of several dozen. It is
only not true for the code that immediately follows this function (for
an unrelated reason). If this really was the last use, I would have
taken the liberty of adding an #undef. That said, some re-ordering might
help the situation, but that's nothing I'd like to spend time on right
away.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 08:24:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 08:24:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565653.883987 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM2Tv-0003gP-76; Wed, 19 Jul 2023 08:24:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565653.883987; Wed, 19 Jul 2023 08:24:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM2Tv-0003gI-4a; Wed, 19 Jul 2023 08:24:23 +0000
Received: by outflank-mailman (input) for mailman id 565653;
 Wed, 19 Jul 2023 08:24:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8bnZ=DF=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qM2Tt-0003gC-Hd
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 08:24:21 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a880fdd2-260d-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 10:24:20 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.163.72.116])
 by support.bugseng.com (Postfix) with ESMTPSA id 8359E4EE0C89;
 Wed, 19 Jul 2023 10:24:18 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a880fdd2-260d-11ee-b23a-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Paul Durrant <paul@xen.org>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: [XEN PATCH] x86: I/O emulation: fix violations of MISRA C:2012 Rules 8.2 and 8.3
Date: Wed, 19 Jul 2023 10:24:10 +0200
Message-Id: <b6ebf3a49de027981505da63aef594cb0dc42ead.1689691260.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Give a name to unnamed parameters thus fixing violations of
MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
named parameters").
Keep consistency between parameter names used in function declarations
and names used in the corresponding function definitions thus fixing
violations of MISRA C:2012 Rule 8.3 ("All declarations of an object or
function shall use the same names and type qualifiers").

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/arch/x86/include/asm/hvm/emulate.h |  8 ++++----
 xen/arch/x86/include/asm/hvm/io.h      | 14 +++++++-------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/include/asm/hvm/emulate.h b/xen/arch/x86/include/asm/hvm/emulate.h
index d8ba2df4e4..398d0db078 100644
--- a/xen/arch/x86/include/asm/hvm/emulate.h
+++ b/xen/arch/x86/include/asm/hvm/emulate.h
@@ -121,12 +121,12 @@ static inline void hvmemul_cache_destroy(struct vcpu *v)
 {
     XFREE(v->arch.hvm.hvm_io.cache);
 }
-bool hvmemul_read_cache(const struct vcpu *, paddr_t gpa,
+bool hvmemul_read_cache(const struct vcpu *v, paddr_t gpa,
                         void *buffer, unsigned int size);
-void hvmemul_write_cache(const struct vcpu *, paddr_t gpa,
+void hvmemul_write_cache(const struct vcpu *v, paddr_t gpa,
                          const void *buffer, unsigned int size);
-unsigned int hvmemul_cache_disable(struct vcpu *);
-void hvmemul_cache_restore(struct vcpu *, unsigned int token);
+unsigned int hvmemul_cache_disable(struct vcpu *v);
+void hvmemul_cache_restore(struct vcpu *v, unsigned int token);
 /* For use in ASSERT()s only: */
 static inline bool hvmemul_cache_disabled(struct vcpu *v)
 {
diff --git a/xen/arch/x86/include/asm/hvm/io.h b/xen/arch/x86/include/asm/hvm/io.h
index 8df33eb6cc..e5225e75ef 100644
--- a/xen/arch/x86/include/asm/hvm/io.h
+++ b/xen/arch/x86/include/asm/hvm/io.h
@@ -46,17 +46,17 @@ struct hvm_io_handler {
     uint8_t type;
 };
 
-typedef int (*hvm_io_read_t)(const struct hvm_io_handler *,
+typedef int (*hvm_io_read_t)(const struct hvm_io_handler *handler,
                              uint64_t addr,
                              uint32_t size,
                              uint64_t *data);
-typedef int (*hvm_io_write_t)(const struct hvm_io_handler *,
+typedef int (*hvm_io_write_t)(const struct hvm_io_handler *handler,
                               uint64_t addr,
                               uint32_t size,
                               uint64_t data);
-typedef bool_t (*hvm_io_accept_t)(const struct hvm_io_handler *,
+typedef bool_t (*hvm_io_accept_t)(const struct hvm_io_handler *handler,
                                   const ioreq_t *p);
-typedef void (*hvm_io_complete_t)(const struct hvm_io_handler *);
+typedef void (*hvm_io_complete_t)(const struct hvm_io_handler *handler);
 
 struct hvm_io_ops {
     hvm_io_accept_t   accept;
@@ -87,11 +87,11 @@ bool relocate_portio_handler(
 
 void send_timeoffset_req(unsigned long timeoff);
 bool handle_mmio_with_translation(unsigned long gla, unsigned long gpfn,
-                                  struct npfec);
+                                  struct npfec access);
 bool handle_pio(uint16_t port, unsigned int size, int dir);
 void hvm_interrupt_post(struct vcpu *v, int vector, int type);
-void hvm_dpci_eoi(struct domain *d, unsigned int guest_irq);
-void msix_write_completion(struct vcpu *);
+void hvm_dpci_eoi(struct domain *d, unsigned int guest_gsi);
+void msix_write_completion(struct vcpu *v);
 
 #ifdef CONFIG_HVM
 void msixtbl_init(struct domain *d);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 08:27:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 08:27:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565659.883997 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM2XB-0004Ro-Ml; Wed, 19 Jul 2023 08:27:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565659.883997; Wed, 19 Jul 2023 08:27:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM2XB-0004Rh-K5; Wed, 19 Jul 2023 08:27:45 +0000
Received: by outflank-mailman (input) for mailman id 565659;
 Wed, 19 Jul 2023 08:27:44 +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
 <SRS0=K8L3=DF=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qM2XA-0004OR-77
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 08:27:44 +0000
Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com
 [2607:f8b0:4864:20::72e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2076387b-260e-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 10:27:41 +0200 (CEST)
Received: by mail-qk1-x72e.google.com with SMTP id
 af79cd13be357-765a5b93b5bso599878485a.3
 for <xen-devel@lists.xenproject.org>; Wed, 19 Jul 2023 01:27:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2076387b-260e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689755260; x=1690360060;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=rr9LFm0zv91kjmdml4BOofCvvjC4REcpppElj1QqNpk=;
        b=UXY3IB+dXfx7S1NIqKIcCV/ddh7i95nExLL8lmP/kELENJLhnYu9PbOd4e9h7mbM9r
         uxWOXaj8XPIyYwCAaz1L3RVYFqTqVxgguP8XZJj7wJJBm99loZSt9z2V3BLLrC0QNc/G
         f/j3VT/1y9jZ9V3w8XL4JNpisqnnOdxWz48xbWSwOWuax9oY1zWc39/l3XS/vVkv30bG
         XZ5D75Ie+Z4XX5xzEbQoa7f7nJXGi7Bto71AU+/Y1IM7xZKxPYqrJCKpcAKu/5loGup6
         U8r6Do8l6zqFDQoVCva2fSrjFclzGqVUL+lDY/AuD8ougB8WKezCMqk7U76D2Lecq7mT
         rJgQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689755260; x=1690360060;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=rr9LFm0zv91kjmdml4BOofCvvjC4REcpppElj1QqNpk=;
        b=jnASyMpXOqeSlKzdrrANGbpivL/i8bh9ShJg75y5+nnlXNogD8Nc3GROPEsjHx44E5
         iN2c0OUVsqnD90Ob5vNpxfyldnsMf3jGAiJ1PxHarCpwXN7YITeT37uiGrIP4aC0LKCr
         Ga6HZSbyXA2LALyjo7UouyrzJmT6z7kO28caNq6scuUdYwvxk9ORTZuCSt6R6R9/KmqT
         vrepKfrpYMG5Dy8Ty1EDXVstKUpVvXetDqUjIX38oFrZrRagwjEkgkFPdlxH7aA0FHSp
         59WADkN/AZo8PwO5Da9IAk+Ss0cB63VZ+nwd3hCvSnD60fb5pwJtkTwBM7OeqmBfU5iv
         FcWQ==
X-Gm-Message-State: ABy/qLZnnK1cD5KqRkcjYG8NsU9X8N6YVPVtEDdlnnNM/O6VLtrDU1Ro
	83+tRK9s7zk/ne3zt4+uczRG/ytq6+l1/XRRGnV7sg==
X-Google-Smtp-Source: APBJJlENkn47V2wc41ANDo1KfnZ0wK8WPzNFTl/TBUahbVQphJV7vFJO4VFnt9mruxiNcbTdoR9gsYl6RS6SOoMBNpo=
X-Received: by 2002:a05:620a:4306:b0:75d:49cf:102a with SMTP id
 u6-20020a05620a430600b0075d49cf102amr20249386qko.5.1689755260601; Wed, 19 Jul
 2023 01:27:40 -0700 (PDT)
MIME-Version: 1.0
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-13-jens.wiklander@linaro.org> <98D9585F-AE4B-4AC2-9D3B-BAF5590C0DD7@arm.com>
In-Reply-To: <98D9585F-AE4B-4AC2-9D3B-BAF5590C0DD7@arm.com>
From: Jens Wiklander <jens.wiklander@linaro.org>
Date: Wed, 19 Jul 2023 10:27:29 +0200
Message-ID: <CAHUa44HXORpP-vezd849Sv0FzvKq9kqcEMh9f98DZnNFtzNFyg@mail.gmail.com>
Subject: Re: [XEN PATCH v10 12/24] xen/arm: ffa: send guest events to Secure Partitions
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, 
	Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>, 
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici <Marc.Bonnici@arm.com>, 
	Achin Gupta <Achin.Gupta@arm.com>, Andrew Cooper <andrew.cooper3@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Bertrand,

On Tue, Jul 18, 2023 at 12:05=E2=80=AFPM Bertrand Marquis
<Bertrand.Marquis@arm.com> wrote:
>
> Hi Jens,
>
> > On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> wr=
ote:
> >
> > The FF-A specification defines framework messages sent as direct
> > requests when certain events occurs. For instance when a VM (guest) is
> > created or destroyed. Only SPs which have subscribed to these events
> > will receive them. An SP can subscribe to these messages in its
> > partition properties.
> >
> > Adds a check that the SP supports the needed FF-A features
> > FFA_PARTITION_INFO_GET and FFA_RX_RELEASE.
> >
> > The partition properties of each SP is retrieved with
> > FFA_PARTITION_INFO_GET which returns the information in our RX buffer.
> > Using FFA_PARTITION_INFO_GET changes the owner of the RX buffer to the
> > caller (us), so once we're done with the buffer it must be released
> > using FFA_RX_RELEASE before another call can be made.
> >
> > Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> > ---
> > xen/arch/arm/tee/ffa.c | 233 ++++++++++++++++++++++++++++++++++++++++-
> > 1 file changed, 231 insertions(+), 2 deletions(-)
> >
> > diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> > index f8ccaabc568d..d755363de686 100644
> > --- a/xen/arch/arm/tee/ffa.c
> > +++ b/xen/arch/arm/tee/ffa.c
> > @@ -160,14 +160,33 @@
> > #define FFA_MSG_SEND                    0x8400006EU
> > #define FFA_MSG_POLL                    0x8400006AU
> >
> > +/* Partition information descriptor */
> > +struct ffa_partition_info_1_1 {
> > +    uint16_t id;
> > +    uint16_t execution_context;
> > +    uint32_t partition_properties;
> > +    uint8_t uuid[16];
> > +};
> > +
> > struct ffa_ctx {
> >     /* FF-A version used by the guest */
> >     uint32_t guest_vers;
> > +    /*
> > +     * Number of SPs that we have sent a VM created signal to, used in
> > +     * ffa_domain_teardown() to know which SPs need to be signalled.
> > +     */
> > +    uint16_t create_signal_count;
> > };
> >
> > /* Negotiated FF-A version to use with the SPMC */
> > static uint32_t __ro_after_init ffa_version;
> >
> > +/* SPs subscribing to VM_CREATE and VM_DESTROYED events */
> > +static uint16_t *subscr_vm_created __read_mostly;
> > +static uint16_t subscr_vm_created_count __read_mostly;
> > +static uint16_t *subscr_vm_destroyed __read_mostly;
> > +static uint16_t subscr_vm_destroyed_count __read_mostly;
> > +
> > /*
> >  * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
> >  * number of pages used in each of these buffers.
> > @@ -251,6 +270,87 @@ static int32_t ffa_rxtx_map(paddr_t tx_addr, paddr=
_t rx_addr,
> >     return ffa_simple_call(FFA_RXTX_MAP_64, tx_addr, rx_addr, page_coun=
t, 0);
> > }
> >
> > +static int32_t ffa_partition_info_get(uint32_t w1, uint32_t w2, uint32=
_t w3,
> > +                                      uint32_t w4, uint32_t w5,
> > +                                      uint32_t *count)
> > +{
> > +    const struct arm_smccc_1_2_regs arg =3D {
> > +        .a0 =3D FFA_PARTITION_INFO_GET,
> > +        .a1 =3D w1,
> > +        .a2 =3D w2,
> > +        .a3 =3D w3,
> > +        .a4 =3D w4,
> > +        .a5 =3D w5,
> > +    };
> > +    struct arm_smccc_1_2_regs resp;
> > +    uint32_t ret;
> > +
> > +    arm_smccc_1_2_smc(&arg, &resp);
> > +
> > +    ret =3D get_ffa_ret_code(&resp);
> > +    if ( !ret )
> > +        *count =3D resp.a2;
> > +
> > +    return ret;
> > +}
> > +
> > +static int32_t ffa_rx_release(void)
> > +{
> > +    return ffa_simple_call(FFA_RX_RELEASE, 0, 0, 0, 0);
> > +}
> > +
> > +static int32_t ffa_direct_req_send_vm(uint16_t sp_id, uint16_t vm_id,
> > +                                      uint8_t msg)
> > +{
> > +    uint32_t exp_resp =3D FFA_MSG_FLAG_FRAMEWORK;
> > +    unsigned int retry_count =3D 0;
> > +    int32_t res;
> > +
> > +    if ( msg =3D=3D FFA_MSG_SEND_VM_CREATED )
> > +        exp_resp |=3D FFA_MSG_RESP_VM_CREATED;
> > +    else if ( msg =3D=3D FFA_MSG_SEND_VM_DESTROYED )
> > +        exp_resp |=3D FFA_MSG_RESP_VM_DESTROYED;
> > +    else
> > +        return FFA_RET_INVALID_PARAMETERS;
> > +
> > +    do {
> > +        const struct arm_smccc_1_2_regs arg =3D {
> > +            .a0 =3D FFA_MSG_SEND_DIRECT_REQ_32,
> > +            .a1 =3D sp_id,
> > +            .a2 =3D FFA_MSG_FLAG_FRAMEWORK | msg,
> > +            .a5 =3D vm_id,
> > +        };
> > +        struct arm_smccc_1_2_regs resp;
> > +
> > +        arm_smccc_1_2_smc(&arg, &resp);
> > +        if ( resp.a0 !=3D FFA_MSG_SEND_DIRECT_RESP_32 || resp.a2 !=3D =
exp_resp )
> > +        {
> > +            /*
> > +             * This is an invalid response, likely due to some error i=
n the
> > +             * implementation of the ABI.
> > +             */
> > +            return FFA_RET_INVALID_PARAMETERS;
> > +        }
> > +        res =3D resp.a3;
> > +        if ( ++retry_count > 10 )
> > +        {
> > +            /*
> > +             * TODO
> > +             * FFA_RET_INTERRUPTED means that the SPMC has a pending
> > +             * non-secure interrupt, we need a way of delivering that
> > +             * non-secure interrupt.
> > +             * FFA_RET_RETRY is the SP telling us that it's temporaril=
y
> > +             * blocked from handling the direct request, we need a gen=
eric
> > +             * way to deal with this.
> > +             * For now in both cases, give up after a few retries.
> > +             */
> > +            return res;
> > +        }
> > +    } while ( res =3D=3D FFA_RET_INTERRUPTED || res =3D=3D FFA_RET_RET=
RY );
> > +
> > +    return res;
> > +}
> > +
> > static uint16_t get_vm_id(const struct domain *d)
> > {
> >     /* +1 since 0 is reserved for the hypervisor in FF-A */
> > @@ -374,6 +474,8 @@ static bool ffa_handle_call(struct cpu_user_regs *r=
egs)
> > static int ffa_domain_init(struct domain *d)
> > {
> >     struct ffa_ctx *ctx;
> > +    unsigned int n;
> > +    int32_t res;
> >
> >     if ( !ffa_version )
> >         return -ENODEV;
> > @@ -387,20 +489,68 @@ static int ffa_domain_init(struct domain *d)
> >     ctx =3D xzalloc(struct ffa_ctx);
> >     if ( !ctx )
> >         return -ENOMEM;
> > -
>
> This line removal does not seem to be intended.

Right, I'll restore it.

>
> >     d->arch.tee =3D ctx;
> >
> > +    for ( n =3D 0; n < subscr_vm_created_count; n++ )
> > +    {
> > +        res =3D ffa_direct_req_send_vm(subscr_vm_created[n], get_vm_id=
(d),
> > +                                     FFA_MSG_SEND_VM_CREATED);
> > +        if ( res )
> > +        {
> > +            printk(XENLOG_ERR "ffa: Failed to report creation of vm_id=
 %u to  %u: res %d\n",
> > +                   get_vm_id(d), subscr_vm_created[n], res);
> > +            ctx->create_signal_count =3D n;
> > +            return -EIO;
> > +        }
> > +    }
> > +    ctx->create_signal_count =3D n;
>
> For clarity here, i would do:
> signal_count =3D subscr_vm_created_count

OK, I'll update.

>
> > +
> >     return 0;
> > }
> >
> > +static bool is_in_subscr_list(const uint16_t *subscr, uint16_t start,
> > +                              uint16_t end, uint16_t vm_id)
> > +{
> > +    unsigned int n;
> > +
> > +    for (n =3D start; n < end; n++)
>
> Coding style, missing spaces
>
> > +    {
> > +        if (subscr[n] =3D=3D vm_id)
>
> Coding style, missing spaces

I'm fixing the style issues.

>
> > +            return true;
> > +    }
> > +
> > +    return false;
> > +}
> > +
> > /* This function is supposed to undo what ffa_domain_init() has done */
> > static int ffa_domain_teardown(struct domain *d)
> > {
> >     struct ffa_ctx *ctx =3D d->arch.tee;
> > +    unsigned int n;
> > +    int32_t res;
> >
> >     if ( !ctx )
> >         return 0;
> >
> > +    for ( n =3D 0; n < subscr_vm_destroyed_count; n++ )
> > +    {
> > +        /*
> > +         * Skip SPs subscribed to the VM created event that never was
> > +         * notified of the VM creation due to an error during
> > +         * ffa_domain_init().
> > +         */
> > +        if ( is_in_subscr_list(subscr_vm_created, ctx->create_signal_c=
ount,
> > +                               subscr_vm_created_count, get_vm_id(d)) =
)
> > +            continue;
>
> I am not following the logic here and would need some explanations.
>
> A SP is subscribing to be informed of any VM creation, but here you check
> the list against the VM ID that is destroyed.
>
> Also a SP could subscribe to be informed of VM destroyed but not VM creat=
ed.
>
> In my head the logic should be:
> if (signal_count < subscr_vm_created_count)
>         for each sp in subscr_vm_created
>                 if is_in_list subscr_vm_destroyed sp
>                         send_destroyed
> else
>         for each subscr_vm_destroyed
>                 send_destroyed

The call to is_in_subscr_list() will only match SPs that have not yet
received an expected VM creation event. If all SPs subscribed to the
VM creation event have been notified, then is_in_subscr_list() will
match nothing. The idea is that if an SP has subscribed to both create
and destroy events then it might not expect a destroy event unless it
has already received a create event. However, SPs only subscribed to
destroy-events don't care if all create-events have been sent or not,
they should be notified unconditionally.

Does it make sense to you?

>
>
> > +
> > +        res =3D ffa_direct_req_send_vm(subscr_vm_destroyed[n], get_vm_=
id(d),
> > +                                     FFA_MSG_SEND_VM_DESTROYED);
> > +
> > +        if ( res )
> > +            printk(XENLOG_ERR "ffa: Failed to report destruction of vm=
_id %u to  %u: res %d\n",
> > +                   get_vm_id(d), subscr_vm_destroyed[n], res);
> > +    }
> > +
> >     XFREE(d->arch.tee);
> >
> >     return 0;
> > @@ -411,6 +561,81 @@ static int ffa_relinquish_resources(struct domain =
*d)
> >     return 0;
> > }
> >
> > +static void uninit_subscribers(void)
> > +{
> > +        subscr_vm_created_count =3D 0;
> > +        subscr_vm_destroyed_count =3D 0;
> > +        XFREE(subscr_vm_created);
> > +        XFREE(subscr_vm_destroyed);
> > +}
> > +
> > +static bool init_subscribers(struct ffa_partition_info_1_1 *fpi, uint1=
6_t count)
> > +{
> > +    uint16_t n;
> > +    uint16_t c_pos;
> > +    uint16_t d_pos;
> > +
> > +    subscr_vm_created_count =3D 0;
> > +    subscr_vm_destroyed_count =3D 0;
> > +    for ( n =3D 0; n < count; n++ )
> > +    {
> > +        if (fpi[n].partition_properties & FFA_PART_PROP_NOTIF_CREATED)
> Coding style: spaces
>
> > +            subscr_vm_created_count++;
> > +        if (fpi[n].partition_properties & FFA_PART_PROP_NOTIF_DESTROYE=
D)
> Coding style: spaces

I'll fix the style issues.

Thanks,
Jens

>
> Cheers
> Bertrand
>
> > +            subscr_vm_destroyed_count++;
> > +    }
> > +
> > +    if ( subscr_vm_created_count )
> > +        subscr_vm_created =3D xzalloc_array(uint16_t, subscr_vm_create=
d_count);
> > +    if ( subscr_vm_destroyed_count )
> > +        subscr_vm_destroyed =3D xzalloc_array(uint16_t,
> > +                                            subscr_vm_destroyed_count)=
;
> > +    if ( (subscr_vm_created_count && !subscr_vm_created) ||
> > +         (subscr_vm_destroyed_count && !subscr_vm_destroyed) )
> > +    {
> > +        printk(XENLOG_ERR "ffa: Failed to allocate subscription lists\=
n");
> > +        uninit_subscribers();
> > +        return false;
> > +    }
> > +
> > +    for ( c_pos =3D 0, d_pos =3D 0, n =3D 0; n < count; n++ )
> > +    {
> > +        if ( fpi[n].partition_properties & FFA_PART_PROP_NOTIF_CREATED=
 )
> > +            subscr_vm_created[c_pos++] =3D fpi[n].id;
> > +        if ( fpi[n].partition_properties & FFA_PART_PROP_NOTIF_DESTROY=
ED )
> > +            subscr_vm_destroyed[d_pos++] =3D fpi[n].id;
> > +    }
> > +
> > +    return true;
> > +}
> > +
> > +static bool init_sps(void)
> > +{
> > +    bool ret =3D false;
> > +    uint32_t count;
> > +    int e;
> > +
> > +    e =3D ffa_partition_info_get(0, 0, 0, 0, 0, &count);
> > +    if ( e )
> > +    {
> > +        printk(XENLOG_ERR "ffa: Failed to get list of SPs: %d\n", e);
> > +        goto out;
> > +    }
> > +
> > +    if ( count >=3D UINT16_MAX )
> > +    {
> > +        printk(XENLOG_ERR "ffa: Impossible number of SPs: %u\n", count=
);
> > +        goto out;
> > +    }
> > +
> > +    ret =3D init_subscribers(ffa_rx, count);
> > +
> > +out:
> > +    ffa_rx_release();
> > +
> > +    return ret;
> > +}
> > +
> > static bool ffa_probe(void)
> > {
> >     uint32_t vers;
> > @@ -462,7 +687,8 @@ static bool ffa_probe(void)
> >      * TODO: Rework the code to allow domain to use a subset of the
> >      * features supported.
> >      */
> > -    if (
> > +    if ( !check_mandatory_feature(FFA_PARTITION_INFO_GET) ||
> > +         !check_mandatory_feature(FFA_RX_RELEASE) ||
> >          !check_mandatory_feature(FFA_RXTX_MAP_64) ||
> >          !check_mandatory_feature(FFA_RXTX_UNMAP) ||
> >          !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
> > @@ -484,6 +710,9 @@ static bool ffa_probe(void)
> >     }
> >     ffa_version =3D vers;
> >
> > +    if ( !init_sps() )
> > +        goto err_free_ffa_tx;
> > +
> >     return true;
> >
> > err_free_ffa_tx:
> > --
> > 2.34.1
> >
>


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 08:31:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 08:31:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565662.884008 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM2ag-0005uo-6h; Wed, 19 Jul 2023 08:31:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565662.884008; Wed, 19 Jul 2023 08:31:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM2ag-0005uh-3t; Wed, 19 Jul 2023 08:31:22 +0000
Received: by outflank-mailman (input) for mailman id 565662;
 Wed, 19 Jul 2023 08:31:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/CK5=DF=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1qM2ae-0005ub-Dh
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 08:31:20 +0000
Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com
 [2a00:1450:4864:20::42b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a287fdc8-260e-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 10:31:19 +0200 (CEST)
Received: by mail-wr1-x42b.google.com with SMTP id
 ffacd0b85a97d-31716932093so772257f8f.3
 for <xen-devel@lists.xenproject.org>; Wed, 19 Jul 2023 01:31:19 -0700 (PDT)
Received: from [10.95.158.71] (54-240-197-224.amazon.com. [54.240.197.224])
 by smtp.gmail.com with ESMTPSA id
 i2-20020adffc02000000b0030c4d8930b1sm4653587wrr.91.2023.07.19.01.31.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 19 Jul 2023 01:31:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a287fdc8-260e-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689755479; x=1692347479;
        h=content-transfer-encoding:in-reply-to:organization:references:cc:to
         :content-language:subject:reply-to:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=x/GAKGp71OPwPZhKZtQk0oFeFfJJ9W9Zm6F5Df+fF8Q=;
        b=IE+UE8eDzQbwrJUdHN/g7tkKfC9w/UpPvfODFBNSy/sZHvb/Gtm4pqEgkEJmR717l0
         IGRtFYRAXN587sgBmGwFid9ZSYQEc6wD0lgaaIqDkUJVwviWFSPJtrhyyJ2lN2PkoiTQ
         M862Jr8hvNYKTXUDF0VZWpMTWGh1CrPEHY3QhQTh4Ok7Rfpg7oRpGQamrDCehVg6JYbb
         GDtAG12kynaB6/k2PO5obb04X9OrFFOMsOVY6yk/k2AmvWNNb2HifuvDNOuJZb7qoLfm
         0gmYK5mp5f/1vmQwRffyxwdrIZZhzEjMqvq5ByM4Fo8L+PYo8wzA6O96XjxpV/1lw//G
         G5bQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689755479; x=1692347479;
        h=content-transfer-encoding:in-reply-to:organization:references:cc:to
         :content-language:subject:reply-to:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=x/GAKGp71OPwPZhKZtQk0oFeFfJJ9W9Zm6F5Df+fF8Q=;
        b=S/7WLvB5JiI+D66KGOXhPIzP9iyYs7qkAm1gl/NGO5tdo1CxK/O9xMNIwEZfKmlf4d
         iqKsDvbQpLayl/acZvIMae0APGV4BAwNJdm4MoKvC4wCsXPeHoccvx2jquDy58jIyaCX
         y7GJopn2bKkxd09bOAlnKAr5og0IzUosCEwkzTZeEj28RF5IZaHyOTejQb3rrCrnetcg
         G8MVzfYQDcUIs6T9o0Fsec7q0HaO6CoV/rCKOUnv3PDsJ2o5YATwwRNnd/dj4dCapTPG
         j8MbfXeNYDr2Mpav9121KvoLr05/+EG7Fh4DcGzH//RZ255gsaCcukFflmIozOUgqwtm
         HMBw==
X-Gm-Message-State: ABy/qLYHfGRFB/DdNrzxfWiSrCAtcxi9JFUHnnGhOr+ZvwvHQu/QWE5a
	rgFmPX+aR3eWyPXgQ7J8ulA=
X-Google-Smtp-Source: APBJJlHe4a66Y8G9a5v3bJEz8f1pxnmHaHn8z8CvJ7Sosmhs1rJrPLSPT36GM5Kg00GlAORNIZrgNQ==
X-Received: by 2002:adf:e2d2:0:b0:306:46c4:d313 with SMTP id d18-20020adfe2d2000000b0030646c4d313mr1394622wrj.28.1689755478545;
        Wed, 19 Jul 2023 01:31:18 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <f67a9f92-1794-98dd-1e19-e0df30b49dee@xen.org>
Date: Wed, 19 Jul 2023 09:31:16 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Reply-To: paul@xen.org
Subject: Re: [XEN PATCH] x86: I/O emulation: fix violations of MISRA C:2012
 Rules 8.2 and 8.3
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com, Jan Beulich <jbeulich@suse.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
References: <b6ebf3a49de027981505da63aef594cb0dc42ead.1689691260.git.federico.serafini@bugseng.com>
Organization: Xen Project
In-Reply-To: <b6ebf3a49de027981505da63aef594cb0dc42ead.1689691260.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 19/07/2023 09:24, Federico Serafini wrote:
> Give a name to unnamed parameters thus fixing violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names used in function declarations
> and names used in the corresponding function definitions thus fixing
> violations of MISRA C:2012 Rule 8.3 ("All declarations of an object or
> function shall use the same names and type qualifiers").
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> ---
>   xen/arch/x86/include/asm/hvm/emulate.h |  8 ++++----
>   xen/arch/x86/include/asm/hvm/io.h      | 14 +++++++-------
>   2 files changed, 11 insertions(+), 11 deletions(-)
> 

Reviewed-by: Paul Durrant <paul@xen.org>



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 08:32:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 08:32:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565665.884018 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM2be-0006R8-Gq; Wed, 19 Jul 2023 08:32:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565665.884018; Wed, 19 Jul 2023 08:32:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM2be-0006R1-DM; Wed, 19 Jul 2023 08:32:22 +0000
Received: by outflank-mailman (input) for mailman id 565665;
 Wed, 19 Jul 2023 08:32:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM2bd-0006Qt-Ho
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 08:32:21 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20605.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::605])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c63541a5-260e-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 10:32:20 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VI1PR04MB7136.eurprd04.prod.outlook.com (2603:10a6:800:122::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Wed, 19 Jul
 2023 08:32:15 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 08:32:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c63541a5-260e-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=dKNTyQ/qEVL3l2s361cqan1kegxseI5rt0uCLC+qnWVo8UHFgeNvxU4fSCEoAtygfaCVKHI8K7DtYfMXHIWxX1Sah2pVCQVBksM9dI4D1v2d60k9ZSI4idwrnPqPD2Beelp6PW7hXrGJH5twlrSj3tYhuiL7koXd+nmaVCPR66X95Ni7lOESsw7Ye3RtvpGekNjGZfi7yrqPt3vtF3CLeURevRxGBSXzFc/zUuGayQWyPAJ4OKw7dcd31B64FVdX826Ccx0jMEp+B6rKdkQDiCJJHsehFt5IMflWz0cxzCb1lFLIrhafkgcX3c6rCj4kdjlk4QZ7ec2YvY43HhwomA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=n61DsqpUHiVq8H8rkX+AiHC5sfRkczDf6N1bv4EXnI8=;
 b=bvwg2UGfGu8U7m167eryReKdc83uxDlFYmaQhRMUcIjFfNAm4I4Oy4tyGcVBnKz0aPW6pTDACGsf1VbrBicNc3cV6lvhPSVNg+wO/TklxS90URUDyR8SOoLnYuUuqG4Tc4rax3KDmTXqMEMXMxZx+xTLZPPvtdermwJJn7p3cjValJRu1gnAABhpah2sAZq34nqz9RT8lPH7oqfk6Qdustu3+87MJQe/ZlJNtxMPNsN6lTkCfEEhim+GrTibysEJcbmPow275IZNZET8IgKphZNXLlmNtAwd5DEx0/RCGcGd4XWjlmXCxgYr90yaQ/OVxk1ksv/HeBTUbD9P5vbqhw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=n61DsqpUHiVq8H8rkX+AiHC5sfRkczDf6N1bv4EXnI8=;
 b=YeByrFCQ30NlGdAu17E4+qrPMnwNV8cFkYbC5NQhDwgWpKiLGYg0IQC7TJm3pwDSqFYzyOKEl+nFdWenJ/EkgaBr7B92KpdRgDGwZtUt4shNmRO7Ei7TeR2E6UuWOQdJH4uP/CP2mQgcmE5MnqKctsnITC9WrtTu9k2FYxz7QVNJYT/gvxo1VKi52ImZvBuW6l3RwGbmezEqn5jTOo+Sd1WhvDIpXjDGXkTDOkQpNsBxM94HqZ/C64pCTN44Ly9nB1OLsdENgUOPNgGOh7MdK7R4+T5eG6W+5uyu+gEa3SzE5s0N8er7/KBJ7iM5Ky3VlzL7Rnqm5uQZL2U1OCN1cw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <be50867f-a3e4-0230-4ca7-bc24cc30b946@suse.com>
Date: Wed, 19 Jul 2023 10:32:13 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] x86: I/O emulation: fix violations of MISRA C:2012
 Rules 8.2 and 8.3
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, Paul Durrant <paul@xen.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <b6ebf3a49de027981505da63aef594cb0dc42ead.1689691260.git.federico.serafini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <b6ebf3a49de027981505da63aef594cb0dc42ead.1689691260.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0222.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ac::18) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VI1PR04MB7136:EE_
X-MS-Office365-Filtering-Correlation-Id: c378db74-f121-4c1d-ba0f-08db8832a828
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	4/NZnri2XwCfEb0wES0JIQGV4zmyWWFQCXTVbtYYORrxIKASagdC7Hpn159iH21j9wf4iST1qbSSek5ozls1t8FKEPkB3K4JyaWPJfLox8ejrlq3JHPtjGUGf7Za2hPMseD8wgjwNc+oAdF7qPh3K9qbErzvEBIf01V1mDTdJH/iLpHgAMgQnsxAZZt0VZEwcBjtzhPoAcGodTFIyjzV7ieDJK4ZQ979v9Q2qsrZnOEPsTGbzu5czRWBt41Fe2gIJmWSjpCM+JgD6x6JpyppQi/LnsriIaO2HbhR6kt0CPKAjQQASFzcBgjG9+Rk3e3zQAU7njtPIvs/a7W8SZWnfztOxC2AVJcZUrR2S7OblBILAjtZ8e7p6Skc4AHR6pG2d1vfFx1RwVzqeXRpNCxmSOElh+DYjBX1G+un9evgHy6sl/7IH9F26c0epdvNd/WjdUOZukjY3rfkCgKIv5zidLLvW95zwTRz6BOgPY3Vnct+eR5g9j8SpGil+d8C6dVDflRHfW1I73s22mqg6SjFCEy7NEo0KI30DXkNwMQdgM7gw1G23mKzdE6zrjpDXZpgnYnIgJx6t1E+srKqzFFtTAAG9A8No96eCEL92X5nriyczOiiK7y8uZ7u15H7EGbYaNb2V3Q8r/XRmBftndeYCQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(396003)(376002)(39860400002)(346002)(366004)(451199021)(86362001)(31696002)(2906002)(36756003)(7416002)(31686004)(38100700002)(83380400001)(6512007)(186003)(53546011)(6506007)(26005)(54906003)(6486002)(66946007)(8676002)(8936002)(4326008)(66556008)(316002)(66476007)(41300700001)(5660300002)(2616005)(6916009)(478600001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?T0pMVGZxMWhiRlM1Q2J1NXZ0ZURRMlZVd1BFNTgwRzZJU3ZPN25UaXRCNjlz?=
 =?utf-8?B?QXRVWmxiTGxFOXlLWHVHVjNyeWozcG9nKzdFeVZNVWFvNVVEdHUyaExWMlZu?=
 =?utf-8?B?bkJ6Zmd3NU1iWGdDSjEvOUhiMGNYZnhjRmh6aWlZOCs2UnRhNUpWNlpyd3dQ?=
 =?utf-8?B?WFNjZ0ZYc0w2US9Vb2dpR0JWYy83N3BxVWE5YTR5clZtdU5yVHpmOFJDN200?=
 =?utf-8?B?OFpoR1hVblQ0WGRsb1VDdXBMVXNnVWVtQzF4NFhTM3UyUXN1MENzejk3WThz?=
 =?utf-8?B?MzRHcllBbmdJVndWbjE2b1JoY2IrTUxMbkpPV2xPLzFxQlRsc3JBaytvUEc2?=
 =?utf-8?B?dWlGbVVxYWpaKzhsNU5QdHpzUVVsNFQ4cHY4M1QzWUtYUTAzK2huYjdtdXhn?=
 =?utf-8?B?R3kyb2swOENSWlBJbFNYTFRVcnJhZWJ2cHAzRjV5dmxxeWpKNGNhczdZZ3l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change-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 08:32:15.4855
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: mEBJHRmd+wZLBcOhRGZ9H5RAH0N8zqrrQNti0HaQFgGrnh4YlXHQPLxGDQ7woc6d4PW/3hpWRWvzgerrmMPyOg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7136

On 19.07.2023 10:24, Federico Serafini wrote:
> Give a name to unnamed parameters thus fixing violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names used in function declarations
> and names used in the corresponding function definitions thus fixing
> violations of MISRA C:2012 Rule 8.3 ("All declarations of an object or
> function shall use the same names and type qualifiers").
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> ---
>  xen/arch/x86/include/asm/hvm/emulate.h |  8 ++++----
>  xen/arch/x86/include/asm/hvm/io.h      | 14 +++++++-------
>  2 files changed, 11 insertions(+), 11 deletions(-)

If it was just the 2nd file, I'd agree with the "I/O" in the title
(albeit as a minor remark and as mentioned elsewhere, personally I
think double tags in titles are undesirable, and blanks in tags
aren't nice either). So perhaps "x86/HVM/emul:" ?

The code changes themselves look okay to me (no matter that I don't
like some of them), so
Acked-by: Jan Beulich <jbeulich@suse.com>
I'd be happy to make, while committing, whatever title adjustment
that you can agree with.

One other note though (there's no good general place to put it):
I'm also a little unhappy with all of you often using "fix" in the
titles, when you don't really fix any bugs. There are certainly
cases where addressing Misra complaints also fixes bugs, but that's
more the exception than the rule. Could we settle on something
like "eliminate", "address", "avoid", or alike when changes are
merely about style or other aspect which don't really correct
functionality?

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 08:54:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 08:54:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565673.884027 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM2x6-000120-9v; Wed, 19 Jul 2023 08:54:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565673.884027; Wed, 19 Jul 2023 08:54:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM2x6-00011t-7S; Wed, 19 Jul 2023 08:54:32 +0000
Received: by outflank-mailman (input) for mailman id 565673;
 Wed, 19 Jul 2023 08:54:31 +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
 <SRS0=dh/8=DF=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qM2x5-00011n-0r
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 08:54:31 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id deb8bf01-2611-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 10:54:28 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.163.72.116])
 by support.bugseng.com (Postfix) with ESMTPSA id 240454EE0C89;
 Wed, 19 Jul 2023 10:54:27 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: deb8bf01-2611-11ee-8611-37d641c3527e
Message-ID: <4748db4d-d0d7-142c-b547-c285ceb1357c@bugseng.com>
Date: Wed, 19 Jul 2023 10:54:25 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
 <76cb0f23-ebcb-2c51-2312-c926b0d6d570@xen.org>
 <8617ddae-02f6-981f-73fc-50be2e24ea64@xen.org>
Content-Language: en-US
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <8617ddae-02f6-981f-73fc-50be2e24ea64@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 17/07/23 22:45, Julien Grall wrote:
> 
> 
> On 17/07/2023 21:40, Julien Grall wrote:
>> On 14/07/2023 12:49, Nicola Vetrini wrote:
>>> The macro 'testop' expands to a function that declares the local
>>> variable 'oldbit', which is written before being set, but is such a
>>> way that is not amenable to automatic checking.
>>>
>>> Therefore, a deviation comment, is introduced to document this 
>>> situation.
>>>
>>> A similar reasoning applies to macro 'guest_testop'.
>>
>> Would you be able to check if the code below (only compile tested so 
>> far) would silence Eclair?
> 
> Hmmm.. I think my e-mail client mangled the diff. Here an unmangled 
> version if needed:
> 
> http://paste.debian.net/1286154/
> 
> Cheers,
> 

I have a question: wouldn't this patch also imply an update of 
xen/arch/arm/include/asm/guest_atomics.h ?

This in particular is the bit of code that needs to be reworked to use 
the newer *_timeout definition.


bool succeed;

succeed = name##_timeout(nr, p, &oldbit, 

                          this_cpu(guest_safe_atomic_max));

if ( succeed )
         return oldbit;

Probably something similar to


int succeed;

succeed = name##_timeout(nr, p, false, NULL, [...]);
if ( succeed != 0 )
   return succeed;

I'm not really sure whether the third param should be true or false, but 
I assumed false because it's similar to the use in bitops.c

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 09:03:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 09:03:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565680.884037 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM35m-0002n9-4W; Wed, 19 Jul 2023 09:03:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565680.884037; Wed, 19 Jul 2023 09:03:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM35m-0002n2-20; Wed, 19 Jul 2023 09:03:30 +0000
Received: by outflank-mailman (input) for mailman id 565680;
 Wed, 19 Jul 2023 09:03:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8bnZ=DF=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qM35k-0002mu-MX
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 09:03:28 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1fde304d-2613-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 11:03:27 +0200 (CEST)
Received: from [192.168.1.101] (unknown [37.163.72.116])
 by support.bugseng.com (Postfix) with ESMTPSA id 53E624EE0C89;
 Wed, 19 Jul 2023 11:03:26 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1fde304d-2613-11ee-b23a-6b7b168915f2
Message-ID: <716e5ceb-49aa-a83b-b03e-3df199804434@bugseng.com>
Date: Wed, 19 Jul 2023 11:03:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] x86: I/O emulation: fix violations of MISRA C:2012
 Rules 8.2 and 8.3
Content-Language: en-US, it
To: Jan Beulich <jbeulich@suse.com>
Cc: consulting@bugseng.com, Paul Durrant <paul@xen.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <b6ebf3a49de027981505da63aef594cb0dc42ead.1689691260.git.federico.serafini@bugseng.com>
 <be50867f-a3e4-0230-4ca7-bc24cc30b946@suse.com>
From: Federico Serafini <federico.serafini@bugseng.com>
Organization: BUGSENG srl
In-Reply-To: <be50867f-a3e4-0230-4ca7-bc24cc30b946@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 19/07/23 10:32, Jan Beulich wrote:
> On 19.07.2023 10:24, Federico Serafini wrote:
>> Give a name to unnamed parameters thus fixing violations of
>> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
>> named parameters").
>> Keep consistency between parameter names used in function declarations
>> and names used in the corresponding function definitions thus fixing
>> violations of MISRA C:2012 Rule 8.3 ("All declarations of an object or
>> function shall use the same names and type qualifiers").
>>
>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
>> ---
>>   xen/arch/x86/include/asm/hvm/emulate.h |  8 ++++----
>>   xen/arch/x86/include/asm/hvm/io.h      | 14 +++++++-------
>>   2 files changed, 11 insertions(+), 11 deletions(-)
> 
> If it was just the 2nd file, I'd agree with the "I/O" in the title
> (albeit as a minor remark and as mentioned elsewhere, personally I
> think double tags in titles are undesirable, and blanks in tags
> aren't nice either). So perhaps "x86/HVM/emul:" ?

"x86/HVM/emul:" is okay.
I will follow your suggestions in the next patches.

> The code changes themselves look okay to me (no matter that I don't
> like some of them), so
> Acked-by: Jan Beulich <jbeulich@suse.com>
> I'd be happy to make, while committing, whatever title adjustment
> that you can agree with.
> 
> One other note though (there's no good general place to put it):
> I'm also a little unhappy with all of you often using "fix" in the
> titles, when you don't really fix any bugs. There are certainly
> cases where addressing Misra complaints also fixes bugs, but that's
> more the exception than the rule. Could we settle on something
> like "eliminate", "address", "avoid", or alike when changes are
> merely about style or other aspect which don't really correct
> functionality?
> 
> Jan

Sure, "address" seems good to us.
Please, while committing, change the occurrences of "fix" into "address"
for the commit title and and commit description as well
(together with the tag change).

Regards
-- 
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 09:19:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 09:19:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565686.884048 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3La-0004qK-GG; Wed, 19 Jul 2023 09:19:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565686.884048; Wed, 19 Jul 2023 09:19:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3La-0004qD-D6; Wed, 19 Jul 2023 09:19:50 +0000
Received: by outflank-mailman (input) for mailman id 565686;
 Wed, 19 Jul 2023 09:19:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=9vNg=DF=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qM3LY-0004q5-GP
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 09:19:48 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on20628.outbound.protection.outlook.com
 [2a01:111:f400:fe13::628])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 67ce0118-2615-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 11:19:47 +0200 (CEST)
Received: from AS4P195CA0019.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:5d6::6)
 by DU0PR08MB7661.eurprd08.prod.outlook.com (2603:10a6:10:31b::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Wed, 19 Jul
 2023 09:19:43 +0000
Received: from AM7EUR03FT029.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:5d6:cafe::13) by AS4P195CA0019.outlook.office365.com
 (2603:10a6:20b:5d6::6) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24 via Frontend
 Transport; Wed, 19 Jul 2023 09:19:43 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT029.mail.protection.outlook.com (100.127.140.143) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.34 via Frontend Transport; Wed, 19 Jul 2023 09:19:43 +0000
Received: ("Tessian outbound e1fdbe8a48d3:v145");
 Wed, 19 Jul 2023 09:19:42 +0000
Received: from 40a561d98320.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 DCCD4B7A-3D48-4ED6-9F6C-07129B90D700.1; 
 Wed, 19 Jul 2023 09:19:31 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 40a561d98320.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 19 Jul 2023 09:19:31 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by PAWPR08MB10238.eurprd08.prod.outlook.com (2603:10a6:102:365::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.28; Wed, 19 Jul
 2023 09:19:24 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe%4]) with mapi id 15.20.6609.022; Wed, 19 Jul 2023
 09:19:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 67ce0118-2615-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3RKh99aqgDlKrihlXN1caTZl0++ZVVixHR2fiQ010vE=;
 b=AN0FEXzvlnDGMK34Poe5Enl65pvnRC/HSlQFxuFBUT5ZiDqf4VKsZ4wIK+O3wFY65kBE2epBtfUk9ctV+Eig2VJtXdJQIf76C85sTkaniPwPgs5mpE345FaYsYydaJ0YiXaHYcLPMhY5udY2dM1njnF7U7siV1yRn7XPnrKoDhA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 930ea238d5aab9cc
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=nnWYWRoYmG7uvQDv4tZ732wQoqxlCdm/DDDAotxTTUMbae0XtDA7OEQSc6GcmesdV01/vn6vLuUmoZkv5lqKM9cvSdk9bU4A5IVgMn6nzETL6Ew7c6WVqcKU9i/cfNoR3YuYmOeedCotxz3mKmHWOoJ5Ad7lkmrE5oqhcuNQcldN2oo3l7t5CxC5E/hZFw3ALKNsm0aKOSPEebUgIpDHhCmgQxm33ReaLMqT1WJ9MB5Io4eQHP3rVs3x4plG9wzvpEMZI41hKs8c8JGsVHW15Zx2GHr2/KEpzqt7Ab/CPizKnVjaIDZDBQ3dYMbxXQINSreiVtovcht0dCQQ+8Ip7Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3RKh99aqgDlKrihlXN1caTZl0++ZVVixHR2fiQ010vE=;
 b=mVB5TphVRy1FhPMajqymBiZZFAA39BTzXjgCF+db3e42aXL6aqK7f+HL4oqLl45fH38azpAOugGuTkQnQOC5aMthG81QHzIkFn9ai4X6u+R7JSO3RJLGCPUvzVlE+owjBl7bZNk3arFfJNPt36vwm1MPwKCSpN2ypZMdgvzTLSMo8uwo5kBK70mRVVEiDQzTIL8CYo+C/qPoPdlmFRNSj+CInX9wtku7jOd57dEGr/nMPwVDFGBDGvzodwXv59q7xMqXhgrYzDmcHg74TXSkHnRQW17E1vFdgWceVgk3EtAEp/7TkH2VexhdmGqn1tFCZyJ2z0s9VUSiWDO3k0iGsQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3RKh99aqgDlKrihlXN1caTZl0++ZVVixHR2fiQ010vE=;
 b=AN0FEXzvlnDGMK34Poe5Enl65pvnRC/HSlQFxuFBUT5ZiDqf4VKsZ4wIK+O3wFY65kBE2epBtfUk9ctV+Eig2VJtXdJQIf76C85sTkaniPwPgs5mpE345FaYsYydaJ0YiXaHYcLPMhY5udY2dM1njnF7U7siV1yRn7XPnrKoDhA=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>
Subject: Re: [XEN PATCH v10 12/24] xen/arm: ffa: send guest events to Secure
 Partitions
Thread-Topic: [XEN PATCH v10 12/24] xen/arm: ffa: send guest events to Secure
 Partitions
Thread-Index: Adm6Ihv4UFl2xrWmR0uNnCEc0JW1WA==
Date: Wed, 19 Jul 2023 09:19:24 +0000
Message-ID: <413E8FFB-E49A-470C-813D-A84A3EFE0EF2@arm.com>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-13-jens.wiklander@linaro.org>
 <98D9585F-AE4B-4AC2-9D3B-BAF5590C0DD7@arm.com>
 <CAHUa44HXORpP-vezd849Sv0FzvKq9kqcEMh9f98DZnNFtzNFyg@mail.gmail.com>
In-Reply-To:
 <CAHUa44HXORpP-vezd849Sv0FzvKq9kqcEMh9f98DZnNFtzNFyg@mail.gmail.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|PAWPR08MB10238:EE_|AM7EUR03FT029:EE_|DU0PR08MB7661:EE_
X-MS-Office365-Filtering-Correlation-Id: d2629a42-c98a-47ff-22b0-08db88394985
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 MiSH3QjVxWCbkoxBmFyvaYXKD9dUl7W5NpXn9Kfhd9ujWSA+6fe4HjowA69XbxY9lxHKtKWPkXhVuvnaXmnbJtV5rPaa2St6a54Oj6jdVZx+8d9sWjmE1nJLEcNMppHJIN0PObBpQQDUMujbnKozlz1+HgtPdpCZ+A+ZRQAdEXjiH2JStD3AePYC5+6nv8dj3fBSJd39ejUhkuevmY6Xpxlw2RVXw5xW0owfQkJlyTAzLuhSSPmS/CcFOGQeUiaU1n8wvohVX4Nm2zzyIJ+O9PHXVGP2bR65+MedcjHgLFyLfR2cD8sDNSNIvXMvJI0XDJOt1Z1weyQgzaDS0DmlmG7FHdSKIcJyHX+iipZVbWSvT4ZoRRmZa1YqP/u1Y9Rw1PHUh+DsTHQb4OUKOy0Kf13bwbCLHiJMAcq/O0+dXbBr7ql3F+fzks7ukFfvRSsGpJc2HGQ6g/UQ72B6JeAQTmjmBXqNdH9GcOJwYqpeXGj+/b5xC75AepmpnYi8YrYoeWHHgM/PDKGWOn/j2fQ3wNwbNFk7JnVerdaGquVuHJzBHTwx+MbpfbibgQ5chMhfMmBoCo/pB4Z5HhlSvQTNdxlrZN1worWB6spck4CneC7gZo0u1fLfcAxnOVv3kpJJgwn3xAUapVYLepivlVM6Ug==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(366004)(346002)(396003)(39860400002)(451199021)(8676002)(5660300002)(8936002)(316002)(41300700001)(4326008)(76116006)(66446008)(91956017)(6916009)(54906003)(64756008)(478600001)(2906002)(6512007)(6486002)(6506007)(53546011)(186003)(83380400001)(66946007)(66476007)(66556008)(2616005)(66899021)(30864003)(71200400001)(38100700002)(122000001)(86362001)(33656002)(36756003)(38070700005)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <D9C52F8350C2F4498E571213305BFCFE@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB10238
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT029.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	73e8076f-57bf-4e98-89bb-08db88393e73
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	ky3AuuJsOJqeEUu5rqnZHX45Ghct41i7ytpSv4LYMaOMaJ0JiomU7lXanxM0hXkkIIJCPudt0LGTpGSp1u3owZgjWMMBuPoKDDx8cgq5oClTgxiXz25b2qv4ow0RNKn5DAPewyjEmFOGuEfWs8Kd9KkgBYb8aBeAcSqD5F7dvvJnkwAseBeKxYMXEt/w6RyLtVcEJs7wEyz7Ae3Dq4tfn4kii+Bw9BLXdrQ7zi9uBpur1n4gNyhji8OI5cj7a6GFRldHL1jXJy2pcjRkIhmE43iorr3xODkVnjcHuejFS+TMPm4+yVFKbFHkS6j6U0vIKQTiHNCAueqFgXFctoZbeqT5QytxtXfsEUMbnaiPyV2i0Fiqqi50i1gpn+SzaptS2aaNGZWNiSAp3wqPKWLPMGz0QsWtF0O3KZydJNk6qDs6HUZFFY+2aPlyq3eXlG//8IikLBK4+3wK41zx3LZE+QEbEtGHZFQ+wAc5NWPDyvgRvY67eM2LxgCkv+oissRXj8P25i1rLWiyKimgEyyZPauqzRa1/sxkajS07uZKVtx7BKSas/3EYOhj1JbWu56i5448wwLXy2Y55JU8sWkPmFAz189STeN3sgTsNcDM2xT9ytKRXJwyHHSZm+V2nKjacphw2bmOQxWIPaS2ERrjKWyvX18/x+nfLBDV13pXWzkBZDvvkLfbZ7MxBQkZI6GTuyMMk06xtHxwS0RMb9XpG4fnsCzKBBGUu4B6JdL0IHVaD8VUud1/mMYbuPKf3BO2
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(39860400002)(136003)(396003)(451199021)(82310400008)(36840700001)(40470700004)(46966006)(66899021)(478600001)(6486002)(54906003)(47076005)(83380400001)(40460700003)(86362001)(33656002)(40480700001)(30864003)(53546011)(70586007)(2906002)(6506007)(36756003)(186003)(336012)(107886003)(2616005)(82740400003)(316002)(6512007)(81166007)(356005)(26005)(41300700001)(70206006)(36860700001)(5660300002)(8936002)(6862004)(8676002)(4326008);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 09:19:43.0251
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d2629a42-c98a-47ff-22b0-08db88394985
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT029.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7661

SGkgSmVucywNCg0KPiBPbiAxOSBKdWwgMjAyMywgYXQgMTA6MjcsIEplbnMgV2lrbGFuZGVyIDxq
ZW5zLndpa2xhbmRlckBsaW5hcm8ub3JnPiB3cm90ZToNCj4gDQo+IEhpIEJlcnRyYW5kLA0KPiAN
Cj4gT24gVHVlLCBKdWwgMTgsIDIwMjMgYXQgMTI6MDXigK9QTSBCZXJ0cmFuZCBNYXJxdWlzDQo+
IDxCZXJ0cmFuZC5NYXJxdWlzQGFybS5jb20+IHdyb3RlOg0KPj4gDQo+PiBIaSBKZW5zLA0KPj4g
DQo+Pj4gT24gMTcgSnVsIDIwMjMsIGF0IDA5OjIwLCBKZW5zIFdpa2xhbmRlciA8amVucy53aWts
YW5kZXJAbGluYXJvLm9yZz4gd3JvdGU6DQo+Pj4gDQo+Pj4gVGhlIEZGLUEgc3BlY2lmaWNhdGlv
biBkZWZpbmVzIGZyYW1ld29yayBtZXNzYWdlcyBzZW50IGFzIGRpcmVjdA0KPj4+IHJlcXVlc3Rz
IHdoZW4gY2VydGFpbiBldmVudHMgb2NjdXJzLiBGb3IgaW5zdGFuY2Ugd2hlbiBhI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lOw0KPj4+IA0KPj4+
IGVycl9mcmVlX2ZmYV90eDoNCj4+PiAtLQ0KPj4+IDIuMzQuMQ0KDQoNCg==


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 09:37:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 09:37:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565695.884064 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3cO-0007ck-7h; Wed, 19 Jul 2023 09:37:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565695.884064; Wed, 19 Jul 2023 09:37:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3cO-0007cd-4d; Wed, 19 Jul 2023 09:37:12 +0000
Received: by outflank-mailman (input) for mailman id 565695;
 Wed, 19 Jul 2023 09:37:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=9vNg=DF=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qM3cM-0007cX-TP
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 09:37:11 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2062f.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d4618007-2617-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 11:37:09 +0200 (CEST)
Received: from DB9PR01CA0030.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:1d8::35) by GVXPR08MB7896.eurprd08.prod.outlook.com
 (2603:10a6:150:16::8) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Wed, 19 Jul
 2023 09:37:03 +0000
Received: from DBAEUR03FT051.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:1d8:cafe::98) by DB9PR01CA0030.outlook.office365.com
 (2603:10a6:10:1d8::35) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24 via Frontend
 Transport; Wed, 19 Jul 2023 09:37:03 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT051.mail.protection.outlook.com (100.127.142.148) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.34 via Frontend Transport; Wed, 19 Jul 2023 09:37:03 +0000
Received: ("Tessian outbound f9124736ff4f:v145");
 Wed, 19 Jul 2023 09:37:02 +0000
Received: from 15017465e4b6.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 81F5C6EE-87CB-404C-B5F7-B4ADE3DD70C4.1; 
 Wed, 19 Jul 2023 09:36:55 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 15017465e4b6.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 19 Jul 2023 09:36:55 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by DB3PR08MB8796.eurprd08.prod.outlook.com (2603:10a6:10:433::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Wed, 19 Jul
 2023 09:36:53 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe%4]) with mapi id 15.20.6609.022; Wed, 19 Jul 2023
 09:36:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d4618007-2617-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=WhW0PBE0uD7Alal5p0BDuqkb9edI/TMdvIjX65g+pxw=;
 b=RHO3IMI1Acqd+OMMlyQojaNuJvQHnz/Ozbmw+6o6gvxsHWPXe9314HwqZB/XRN3H4Ge2Em03XekFuXKizJ2OwogoUGD0BkVNEBHvnNz3qIWSEPT38UThaWJymfaRpv3c/xiKufRnBrGQTvlmX5284P1tj6uwf2x4U8u71ERDIWg=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 67eb52b194590e72
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=fqbbqQAOHXlvijXF1Sv4AGUzd+LTZHRnHRD41e+aZl+kOwoGimLC9suXZnAkKh1KYTZ213ZTAxui/MlpOhJyMVsCTzaSgG5vOWybFJruqfwmDlW5/KnJlFu8wJQmtZvzZNdOlJxS+D3D2E25f+mKkM3WHGnp2qz0seCpvaiBrFFLjapfdKRTeOvb/TkCoIpTevEmC3ZMYadPG6izcsyOg922n9t3+N08dZUlWz/pgOugBAFEVM15SXdA8Z/3quEzVs9RGaJ+QSarUzMlnThfjWRqzxBZGKMYAFqG2RAkjtfjp2YKmX8JueEyJjh/NhibAKDybVQU/2VhtDjTw3pmLg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=WhW0PBE0uD7Alal5p0BDuqkb9edI/TMdvIjX65g+pxw=;
 b=AhMEH799i+QmBemupTYLP4kBhHJPnQrbZzcuYmp8P3eratmKaAQiStk1+kARPCAoV4rdFv2iToj4NhW3F7JefJXwvzJ4fTIg4C902FAF6EFdS12B1gDk+bVBbR6nMHF9iw2FQnQ8Xw+gbcg51CTxeLKd08mjz1YsObynCRNqhAPXHH+X4GnHndP+tc1aIUpzloCSXPZcptAFEjVw4DnYqdVUs5DZlYsfKLHaQbwBD8lJfpLIgQLjsy6r6wgbr/mezf7RRlniwMDz7ukll8iGqQS5a7xcXhLI7S0ydu2w5PPzjyDk5AHqshlz0+hMSV3DbbRUquIosnkR7HoHBE0Aag==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=WhW0PBE0uD7Alal5p0BDuqkb9edI/TMdvIjX65g+pxw=;
 b=RHO3IMI1Acqd+OMMlyQojaNuJvQHnz/Ozbmw+6o6gvxsHWPXe9314HwqZB/XRN3H4Ge2Em03XekFuXKizJ2OwogoUGD0BkVNEBHvnNz3qIWSEPT38UThaWJymfaRpv3c/xiKufRnBrGQTvlmX5284P1tj6uwf2x4U8u71ERDIWg=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>
Subject: Re: [XEN PATCH v10 20/24] xen/arm: ffa: support sharing large memory
 ranges
Thread-Topic: [XEN PATCH v10 20/24] xen/arm: ffa: support sharing large memory
 ranges
Thread-Index: Adm6JI1IKCrkxlGedEeTT9m/ij46OQ==
Date: Wed, 19 Jul 2023 09:36:53 +0000
Message-ID: <8304EFA9-FA48-4823-B7B0-11311351592B@arm.com>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-21-jens.wiklander@linaro.org>
In-Reply-To: <20230717072107.753304-21-jens.wiklander@linaro.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|DB3PR08MB8796:EE_|DBAEUR03FT051:EE_|GVXPR08MB7896:EE_
X-MS-Office365-Filtering-Correlation-Id: 42a44bbd-476f-435e-770e-08db883bb55b
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 kZjcykhmOUsO87b6QgRjjdN15Mnb9F0LBleC+Bc7G5Jx/hOQQUFCbNdwYimj8XgaAhqccuTNqwOLZsPF3VukxUPS1BHNZHfLDZI6NNNM/VPvmakS5km+sZXDnj6Y2TSD7nva9DiFk0PHQkN+7LsWtdXRSpyPr2hosl6zPA0koEFvMJTsGB89KpvS4HEg3Z8GaY7VHCKRJ8lZjpoaPpS0jky2gsfV/JV7dzqJitdaVU8enZLS+39tAqUdk+2/CdRE0g+rTu6cJhi2uKwOY+4e7c4q9rSXQoD90/gr3MpVnYpvShS9rHJNcD+YehQehdDDaEK9IcQqkRSBbGo3wYNuAGVx9AFUiO/hDWHodsXnAUmCJ3Z7Kce/BaujFqz2OywWWH7PsnlfEDU+9zGMoQvco55KqeOVcOnVghzDuzE7STDbBJKZhPHVIzemzuACORcxI2TFDMKH6/OSwdf9bdXlpiKwwj2/N3tzQWKF/lx2Z/882fqCuJRZMOX10ZgKXc/ENFhvbwbYTpHCve24/3oU9pYcLy8eEFw1JGWceClUlmhJOGli59Qp4+rfWV93X4PqqTaEV3NqMwx0KPq9PTLVadrdFfr8U0d5XqnY4DONu3j3o7QJZappi+o21LLBwdr8XfUku+62xCCVH+U/bZgvkQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(346002)(366004)(376002)(451199021)(86362001)(478600001)(83380400001)(38100700002)(186003)(41300700001)(71200400001)(33656002)(30864003)(54906003)(316002)(53546011)(8676002)(8936002)(6916009)(2906002)(4326008)(122000001)(6512007)(66556008)(64756008)(66946007)(6486002)(66476007)(66446008)(6506007)(91956017)(38070700005)(2616005)(76116006)(36756003)(5660300002)(66899021)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <06FA2F8E5D1B664D9BB6C20254DF5130@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB8796
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT051.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	88ef9e3f-37e3-45a1-7ec6-08db883bafc7
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	dDTWQdOEtu+wScvTkUMFmYRlX1Xg+9U1ERgCkOzsiKpAFkC0bBsyNjA+iMX3/wSCsBMNGezW1WhHY9lrjILC6I2o1gSxMDGVmr6AAK/7Z1TUpaGz6YTGUqCI/WZlRPJnL7fQI/zFtjbU52K1pzkwMMrCyTsSt+mVXh0XISPMHHML3nbBZHbSwFTAw9AwEHykthiGI4NIoy2FzN6egEH/+V9GLwqmfH55fq+OWqayBGtDO4mJtklme619FhKLoszGVBSEJjBcnc2K3pj0b6J7CVTD4JHNXcPYnojn8eN/xIVTDNfUhadAuGCFZTExi9e45VPaevME/emaj9JowNwp1UeLlGr60fZFnMu4/o/7eJl6UiuPV4D/qC2zzZExpbwA2SXBbYCLbvSQ0V2JzYoKNVC/+GGlnoAvDIrzqQIlusjq70dWQ1B070MTV9I3f5G/7vZVctRBPIIB4alzLsAndZthDOLPvU6BZbsRtE8hiVlHbJfB1d2Iwf0Utf+neweafp29SFs4ceXDLnMCqX1wJ8E1PPmZh1Mn3udyrQayP/gbmWTM0aN4dWEXyUFcMzYv+VKqOPXQwXVXHfX/aNn/HrKsGm+wOB9XtllXr3sQJgjbH5jwGwk5JdtU/Sn6sPOh4fcqf3bL0BjvfTwaYzUMAZHbIDm+JmwsPx8D/W8n+ckBUQJDq0tCQFGqn4AUuk0XUUQPb4nWlXGA8DDCq5HzY7BIK457zarW8pJajDJN4gOD1sw4zGN8lg4Eabdjq/xz
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(396003)(136003)(376002)(82310400008)(451199021)(46966006)(36840700001)(40470700004)(86362001)(30864003)(36756003)(2906002)(33656002)(66899021)(40460700003)(40480700001)(2616005)(36860700001)(186003)(6512007)(336012)(83380400001)(47076005)(6506007)(26005)(53546011)(82740400003)(81166007)(6486002)(356005)(70206006)(54906003)(70586007)(478600001)(316002)(5660300002)(4326008)(41300700001)(6862004)(8936002)(8676002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 09:37:03.0019
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 42a44bbd-476f-435e-770e-08db883bb55b
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT051.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB7896

Hi Jens,

> On 17 Jul 2023, at 09:21, Jens Wiklander <jens.wiklander@linaro.org> wrot=
e:
>=20
> Adds support for sharing large memory ranges transmitted in fragments
> using FFA_MEM_FRAG_TX.
>=20
> The implementation is the bare minimum to be able to communicate with
> OP-TEE running as an SPMC at S-EL1.
>=20
> Adds a check that the SP supports the needed FF-A feature
> FFA_MEM_FRAG_TX.
>=20
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> ---
> xen/arch/arm/tee/ffa.c | 253 ++++++++++++++++++++++++++++++++++++++---
> 1 file changed, 240 insertions(+), 13 deletions(-)
>=20
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> index c623c51168b9..ac23b9edc74c 100644
> --- a/xen/arch/arm/tee/ffa.c
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -359,6 +359,8 @@ struct ffa_ctx {
>      */
>     uint16_t create_signal_count;
>     bool rx_is_free;
> +    /* Currently used fragment states, struct mem_frag_state */
> +    struct list_head frag_list;
>     /* Used shared memory objects, struct ffa_shm_mem */
>     struct list_head shm_list;
>     /* Number of allocated shared memory object */
> @@ -375,6 +377,18 @@ struct ffa_shm_mem {
>     struct page_info *pages[];
> };
>=20
> +struct mem_frag_state {
> +    struct list_head list;
> +    struct ffa_shm_mem *shm;
> +    uint32_t range_count;
> +    unsigned int current_page_idx;
> +    unsigned int frag_offset;
> +    unsigned int range_offset;
> +    const uint8_t *buf;
> +    unsigned int buf_size;
> +    struct ffa_address_range range;
> +};

Please add some comments inside this structure as
from reading the code it is not quite clear what is done.

> +
> /* Negotiated FF-A version to use with the SPMC */
> static uint32_t __ro_after_init ffa_version;
>=20
> @@ -538,6 +552,36 @@ static int32_t ffa_mem_share(uint32_t tot_len, uint3=
2_t frag_len,
>     }
> }
>=20
> +static int32_t ffa_mem_frag_tx(uint64_t handle, uint32_t frag_len,
> +                               uint16_t sender_id)
> +{
> +    struct arm_smccc_1_2_regs arg =3D {
> +        .a0 =3D FFA_MEM_FRAG_TX,
> +        .a1 =3D handle & UINT32_MAX,
> +        .a2 =3D handle >> 32,
> +        .a3 =3D frag_len,
> +        .a4 =3D (uint32_t)sender_id << 16,
> +    };
> +    struct arm_smccc_1_2_regs resp;
> +
> +    arm_smccc_1_2_smc(&arg, &resp);
> +
> +    switch ( resp.a0 )
> +    {
> +    case FFA_ERROR:
> +        if ( resp.a2 )
> +            return resp.a2;
> +        else
> +            return FFA_RET_NOT_SUPPORTED;
> +    case FFA_SUCCESS_32:
> +        return FFA_RET_OK;
> +    case FFA_MEM_FRAG_RX:
> +        return resp.a3;
> +    default:
> +            return FFA_RET_NOT_SUPPORTED;
> +    }
> +}
> +
> static int32_t ffa_mem_reclaim(uint32_t handle_lo, uint32_t handle_hi,
>                                uint32_t flags)
> {
> @@ -627,6 +671,14 @@ static void set_regs_success(struct cpu_user_regs *r=
egs, uint32_t w2,
>     set_regs(regs, FFA_SUCCESS_32, 0, w2, w3, 0, 0, 0, 0);
> }
>=20
> +static void set_regs_frag_rx(struct cpu_user_regs *regs, uint32_t handle=
_lo,
> +                             uint32_t handle_hi, uint32_t frag_offset,
> +                             uint16_t sender_id)
> +{
> +    set_regs(regs, FFA_MEM_FRAG_RX, handle_lo, handle_hi, frag_offset,
> +             (uint32_t)sender_id << 16, 0, 0, 0);
> +}
> +
> static void handle_version(struct cpu_user_regs *regs)
> {
>     struct domain *d =3D current->domain;
> @@ -999,6 +1051,8 @@ static int share_shm(struct ffa_shm_mem *shm)
>     paddr_t last_pa;
>     unsigned int n;
>     paddr_t pa;
> +    bool first;
> +    int ret;
>=20
>     ASSERT(spin_is_locked(&ffa_tx_buffer_lock));
>     ASSERT(shm->page_count);
> @@ -1034,13 +1088,23 @@ static int share_shm(struct ffa_shm_mem *shm)
>=20
>     tot_len =3D ADDR_RANGE_OFFSET(descr->mem_access_count, region_count,
>                                 region_descr->address_range_count);
> -    if ( tot_len > max_frag_len )
> -        return FFA_RET_NOT_SUPPORTED;
>=20
> +    /*
> +     * Sharing memory with secure world may have to be done with multipl=
e
> +     * calls depending on how many address ranges will be needed. If we'=
re
> +     * sharing physically contiguous memory we will only need one range =
but
> +     * we will also need to deal with the worst case where all physical
> +     * pages are non-contiguous. For the first batch of address ranges w=
e
> +     * call ffa_mem_share() and for all that follows ffa_mem_frag_tx().
> +     *
> +     * We use frag_len to keep track of how far into the transmit buffer=
 we
> +     * have gone.
> +     */
>     addr_range =3D region_descr->address_range_array;
>     frag_len =3D ADDR_RANGE_OFFSET(descr->mem_access_count, region_count,=
 1);
>     last_pa =3D page_to_maddr(shm->pages[0]);
>     init_range(addr_range, last_pa);
> +    first =3D true;
>     for ( n =3D 1; n < shm->page_count; last_pa =3D pa, n++ )
>     {
>         pa =3D page_to_maddr(shm->pages[n]);
> @@ -1050,12 +1114,34 @@ static int share_shm(struct ffa_shm_mem *shm)
>             continue;
>         }
>=20
> -        frag_len +=3D sizeof(*addr_range);
> -        addr_range++;
> +        if ( frag_len =3D=3D max_frag_len )

This test seem a bit dangerous as there is nothing ensuring that frag_len w=
ill end
up aligned to a page.

I would suggest here to do frag_len + sizeof(*addr_range) > max_frag_len to=
 check
if we can fit or not an extra address range in the area.


> +        {
> +            if ( first )
> +            {
> +                ret =3D ffa_mem_share(tot_len, frag_len, 0, 0, &shm->han=
dle);
> +                first =3D false;
> +            }
> +            else
> +            {
> +                ret =3D ffa_mem_frag_tx(shm->handle, frag_len, shm->send=
er_id);
> +            }
> +            if ( ret <=3D 0 )
> +                return ret;
> +            frag_len =3D sizeof(*addr_range);
> +            addr_range =3D buf;
> +        }
> +        else
> +        {
> +            frag_len +=3D sizeof(*addr_range);
> +            addr_range++;
> +        }
>         init_range(addr_range, pa);
>     }
>=20
> -    return ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
> +    if ( first )
> +        return ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
> +    else
> +        return ffa_mem_frag_tx(shm->handle, frag_len, shm->sender_id);
> }
>=20
> static int read_mem_transaction(uint32_t ffa_vers, const void *buf, size_=
t blen,
> @@ -1132,8 +1218,53 @@ static int read_mem_transaction(uint32_t ffa_vers,=
 const void *buf, size_t blen,
>     return 0;
> }
>=20
> +static int add_mem_share_frag(struct mem_frag_state *s, unsigned int off=
s,
> +                              unsigned int frag_len)
> +{
> +    struct domain *d =3D current->domain;
> +    unsigned int o =3D offs;
> +    unsigned int l;
> +    int ret;
> +
> +    if ( frag_len < o )
> +        return FFA_RET_INVALID_PARAMETERS;
> +
> +    /* Fill up the first struct ffa_address_range */

The magic here after requires some explanation, could you add more details =
in
the comment ?

> +    l =3D min_t(unsigned int, frag_len - o, sizeof(s->range) - s->range_=
offset);
> +    memcpy((uint8_t *)&s->range + s->range_offset, s->buf + o, l);
> +    s->range_offset +=3D l;
> +    o +=3D l;
> +    if ( s->range_offset !=3D sizeof(s->range) )
> +        goto out;

Shouldn't we test this before doing the memcpy ?
Is this an error case ?
What is the expected frag_offset value here ?


> +    s->range_offset =3D 0;
> +
> +    while ( true )
> +    {
> +        ret =3D get_shm_pages(d, s->shm, &s->range, 1, s->current_page_i=
dx,
> +                            &s->current_page_idx);
> +        if ( ret )
> +            return ret;
> +        if ( s->range_count =3D=3D 1 )
> +            return 0;
> +        s->range_count--;
> +        if ( frag_len - o < sizeof(s->range) )
> +            break;
> +        memcpy(&s->range, s->buf + o, sizeof(s->range));
> +        o +=3D sizeof(s->range);
> +    }
> +
> +    /* Collect any remaining bytes for the next struct ffa_address_range=
 */
> +    s->range_offset =3D frag_len - o;
> +    memcpy(&s->range, s->buf + o, frag_len - o);
> +out:
> +    s->frag_offset +=3D frag_len;
> +
> +    return s->frag_offset;
> +}

Overall the processing in this function is not quite clear so we either nee=
d
to add comments to explain it more or find a better way to implement to mak=
e
it a bit clearer.

The implementation for fragmented memory sharing requests here is very
complex and I am not quite feeling confident that it does not contains bugs=
.

As this is not something required to have optee support, I would suggest to
discard this part for now in the support.

What do you think ?

Cheers
Bertrand

> +
> static void handle_mem_share(struct cpu_user_regs *regs)
> {
> +    static uint64_t next_handle =3D FFA_HANDLE_HYP_FLAG;
>     uint32_t tot_len =3D get_user_reg(regs, 1);
>     uint32_t frag_len =3D get_user_reg(regs, 2);
>     uint64_t addr =3D get_user_reg(regs, 3);
> @@ -1168,13 +1299,6 @@ static void handle_mem_share(struct cpu_user_regs =
*regs)
>         goto out_set_ret;
>     }
>=20
> -    /* We currently only support a single fragment */
> -    if ( frag_len !=3D tot_len )
> -    {
> -        ret =3D FFA_RET_NOT_SUPPORTED;
> -        goto out_set_ret;
> -    }
> -
>     spin_lock(&ctx->lock);
>=20
>     if ( frag_len > ctx->page_count * FFA_PAGE_SIZE )
> @@ -1240,6 +1364,36 @@ static void handle_mem_share(struct cpu_user_regs =
*regs)
>     shm->sender_id =3D trans.sender_id;
>     shm->ep_id =3D read_atomic(&mem_access->access_perm.endpoint_id);
>=20
> +    if ( frag_len !=3D tot_len )
> +    {
> +        struct mem_frag_state *s =3D xzalloc(struct mem_frag_state);
> +
> +        if ( !s )
> +        {
> +            ret =3D FFA_RET_NO_MEMORY;
> +            goto out;
> +        }
> +        s->shm =3D shm;
> +        s->range_count =3D range_count;
> +        s->buf =3D ctx->tx;
> +        s->buf_size =3D FFA_RXTX_PAGE_COUNT * FFA_PAGE_SIZE;
> +        ret =3D add_mem_share_frag(s, sizeof(*region_descr)  + region_of=
fs,
> +                                 frag_len);
> +        if ( ret <=3D 0 )
> +        {
> +            xfree(s);
> +            if ( ret < 0 )
> +                goto out;
> +        }
> +        else
> +        {
> +            shm->handle =3D next_handle++;
> +            uint64_to_regpair(&handle_hi, &handle_lo, shm->handle);
> +            list_add_tail(&s->list, &ctx->frag_list);
> +        }
> +        goto out_unlock;
> +    }
> +
>     /*
>      * Check that the Composite memory region descriptor fits.
>      */
> @@ -1278,7 +1432,75 @@ out_unlock:
>     spin_unlock(&ctx->lock);
>=20
> out_set_ret:
> -    if ( ret =3D=3D 0)
> +    if ( ret > 0 )
> +            set_regs_frag_rx(regs, handle_lo, handle_hi, ret, trans.send=
er_id);
> +    else if ( ret =3D=3D 0)
> +            set_regs_success(regs, handle_lo, handle_hi);
> +    else
> +            set_regs_error(regs, ret);
> +}
> +
> +static struct mem_frag_state *find_frag_state(struct ffa_ctx *ctx,
> +                                              uint64_t handle)
> +{
> +    struct mem_frag_state *s;
> +
> +    list_for_each_entry(s, &ctx->frag_list, list)
> +        if ( s->shm->handle =3D=3D handle )
> +            return s;
> +
> +    return NULL;
> +}
> +
> +static void handle_mem_frag_tx(struct cpu_user_regs *regs)
> +{
> +    struct domain *d =3D current->domain;
> +    struct ffa_ctx *ctx =3D d->arch.tee;
> +    uint32_t frag_len =3D get_user_reg(regs, 3);
> +    uint32_t handle_lo =3D get_user_reg(regs, 1);
> +    uint32_t handle_hi =3D get_user_reg(regs, 2);
> +    uint64_t handle =3D regpair_to_uint64(handle_hi, handle_lo);
> +    struct mem_frag_state *s;
> +    uint16_t sender_id =3D 0;
> +    int ret;
> +
> +    spin_lock(&ctx->lock);
> +    s =3D find_frag_state(ctx, handle);
> +    if ( !s )
> +    {
> +        ret =3D FFA_RET_INVALID_PARAMETERS;
> +        goto out;
> +    }
> +    sender_id =3D s->shm->sender_id;
> +
> +    if ( frag_len > s->buf_size )
> +    {
> +        ret =3D FFA_RET_INVALID_PARAMETERS;
> +        goto out_free_s;
> +    }
> +
> +    ret =3D add_mem_share_frag(s, 0, frag_len);
> +    if ( ret < 0 )
> +        goto out_free_s;
> +
> +    /* Note that share_shm() uses our tx buffer */
> +    spin_lock(&ffa_tx_buffer_lock);
> +    ret =3D share_shm(s->shm);
> +    spin_unlock(&ffa_tx_buffer_lock);
> +    if ( ret < 0 )
> +        goto out_free_s;
> +    list_add_tail(&s->shm->list, &ctx->shm_list);
> +out_free_s:
> +    if ( ret < 0 )
> +        free_ffa_shm_mem(ctx, s->shm);
> +    list_del(&s->list);
> +    xfree(s);
> +out:
> +    spin_unlock(&ctx->lock);
> +
> +    if ( ret > 0 )
> +            set_regs_frag_rx(regs, handle_lo, handle_hi, ret, sender_id)=
;
> +    else if ( ret =3D=3D 0)
>             set_regs_success(regs, handle_lo, handle_hi);
>     else
>             set_regs_error(regs, ret);
> @@ -1391,6 +1613,9 @@ static bool ffa_handle_call(struct cpu_user_regs *r=
egs)
>         else
>             set_regs_success(regs, 0, 0);
>         return true;
> +    case FFA_MEM_FRAG_TX:
> +        handle_mem_frag_tx(regs);
> +        return true;
>=20
>     default:
>         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
> @@ -1432,6 +1657,7 @@ static int ffa_domain_init(struct domain *d)
>     }
>     ctx->create_signal_count =3D n;
>=20
> +    INIT_LIST_HEAD(&ctx->frag_list);
>     INIT_LIST_HEAD(&ctx->shm_list);
>=20
>     return 0;
> @@ -1625,6 +1851,7 @@ static bool ffa_probe(void)
>          !check_mandatory_feature(FFA_MEM_SHARE_64) ||
>          !check_mandatory_feature(FFA_RXTX_UNMAP) ||
>          !check_mandatory_feature(FFA_MEM_SHARE_32) ||
> +         !check_mandatory_feature(FFA_MEM_FRAG_TX) ||
>          !check_mandatory_feature(FFA_MEM_RECLAIM) ||
>          !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
>         return false;
> --=20
> 2.34.1
>=20



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 09:39:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 09:39:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565699.884074 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3eU-0008OZ-Jl; Wed, 19 Jul 2023 09:39:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565699.884074; Wed, 19 Jul 2023 09:39:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3eU-0008OS-Gv; Wed, 19 Jul 2023 09:39:22 +0000
Received: by outflank-mailman (input) for mailman id 565699;
 Wed, 19 Jul 2023 09:39:21 +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
 <SRS0=K8L3=DF=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qM3eT-0008OK-1o
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 09:39:21 +0000
Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com
 [2607:f8b0:4864:20::f36])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2184fe1b-2618-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 11:39:18 +0200 (CEST)
Received: by mail-qv1-xf36.google.com with SMTP id
 6a1803df08f44-635e107642fso2723216d6.1
 for <xen-devel@lists.xenproject.org>; Wed, 19 Jul 2023 02:39:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2184fe1b-2618-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689759557; x=1690364357;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=hJM/SKcUHpfyPcOx8o5Myl7kYtFtGW9aQGUS6b6Xx/s=;
        b=qRnj8zEij7rDyFyoZMMp7tC9ZzzWCqx/OVcpjRcF4ARCN47W2UHsihBCqUqeC1+43T
         pJElYRGaakm6EGT6zybZ1xH0Q4562Grm1rdsW3V89fPtE+lwAnPEcDH6WnarZ/Wt7s7e
         8p+ehqysD5MqbdjrGXJtw6hLfljsNYWCgHgsFnFhLjIFFBg3ydQgC9jVrXbrg4zONmDQ
         WfnEMhnYqFkNDluT5jp2FuYRT6KN3uhAuADREOa68sLT+NeahWaGhBs0GMWMS/Qj61Jr
         Ic+QcaDWvo/RmgPAlz1lTiTMbdk22zP56phMJonRLxpKEUnPG0Gncjo25o/8XpZ6M4rc
         wDCw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689759557; x=1690364357;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=hJM/SKcUHpfyPcOx8o5Myl7kYtFtGW9aQGUS6b6Xx/s=;
        b=hNhKTOpKp/hTqiauDm0CZGlxib9WtBlFEBWgv+euCLqZHn6WaRdj/oDxVsrXUll6SN
         CdXQT8dpd37VidZ68hXJcw2Z2KlltVlenUdbAikj+NeDxtm5bV2qDxMQWk8IpMZyC35H
         CYj0WYHLnB+fycOlQHTZ8PngIhymZcOW3L8x1UD797lLrBFOzvCK4m4a7IXkRmd/jcXN
         qyhLXa+tT++eUUkLMkI0+iYu1DWSnnLDChtKXclgiNjc1OC+uhvGAJRbudQ0CS34BDrl
         LebktXoS2gpvs9iJL/1Rj+pOk6Sm2QqyjjnjH8cbH25PpaDinJnx7pfSZ5L/uRYl3zA/
         1v8A==
X-Gm-Message-State: ABy/qLYCa/zEK1l5aPcc4ZHDRz+sYcMYmQ7sOA9r5f96w3uRrXNRf26z
	eime86yzqH0HZGBe488Bk/3ruGkJY/TdFmwWNfVZiA==
X-Google-Smtp-Source: APBJJlEiKP9MObG7n1w9BoDI1g4amd5IhDf4mIy1HFw3Kp6HQkQMxKk6LEMOJAngfiE7K6i/R/uxx+p//+W7NZTtkSY=
X-Received: by 2002:ad4:5cc7:0:b0:636:695:c84c with SMTP id
 iu7-20020ad45cc7000000b006360695c84cmr2244627qvb.20.1689759557315; Wed, 19
 Jul 2023 02:39:17 -0700 (PDT)
MIME-Version: 1.0
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-13-jens.wiklander@linaro.org> <98D9585F-AE4B-4AC2-9D3B-BAF5590C0DD7@arm.com>
 <CAHUa44HXORpP-vezd849Sv0FzvKq9kqcEMh9f98DZnNFtzNFyg@mail.gmail.com> <413E8FFB-E49A-470C-813D-A84A3EFE0EF2@arm.com>
In-Reply-To: <413E8FFB-E49A-470C-813D-A84A3EFE0EF2@arm.com>
From: Jens Wiklander <jens.wiklander@linaro.org>
Date: Wed, 19 Jul 2023 11:39:06 +0200
Message-ID: <CAHUa44HBQXRwQKfu1iHFx3W+dZZNKAZBypDDRr9ycz8OUDUwjw@mail.gmail.com>
Subject: Re: [XEN PATCH v10 12/24] xen/arm: ffa: send guest events to Secure Partitions
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, 
	Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>, 
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici <Marc.Bonnici@arm.com>, 
	Achin Gupta <Achin.Gupta@arm.com>, Andrew Cooper <andrew.cooper3@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi,

On Wed, Jul 19, 2023 at 11:19=E2=80=AFAM Bertrand Marquis
<Bertrand.Marquis@arm.com> wrote:
>
> Hi Jens,
>
> > On 19 Jul 2023, at 10:27, Jens Wiklander <jens.wiklander@linaro.org> wr=
ote:
> >
> > Hi Bertrand,
> >
> > On Tue, Jul 18, 2023 at 12:05=E2=80=AFPM Bertrand Marquis
> > <Bertrand.Marquis@arm.com> wrote:
> >>
> >> Hi Jens,
> >>
> >>> On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> =
wrote:
> >>>
> >>> The FF-A specification defines framework messages sent as direct
> >>> requests when certain events occurs. For instance when a VM (guest) i=
s
> >>> created or destroyed. Only SPs which have subscribed to these events
> >>> will receive them. An SP can subscribe to these messages in its
> >>> partition properties.
> >>>
> >>> Adds a check that the SP supports the needed FF-A features
> >>> FFA_PARTITION_INFO_GET and FFA_RX_RELEASE.
> >>>
> >>> The partition properties of each SP is retrieved with
> >>> FFA_PARTITION_INFO_GET which returns the information in our RX buffer=
.
> >>> Using FFA_PARTITION_INFO_GET changes the owner of the RX buffer to th=
e
> >>> caller (us), so once we're done with the buffer it must be released
> >>> using FFA_RX_RELEASE before another call can be made.
> >>>
> >>> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> >>> ---
> >>> xen/arch/arm/tee/ffa.c | 233 ++++++++++++++++++++++++++++++++++++++++=
-
> >>> 1 file changed, 231 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> >>> index f8ccaabc568d..d755363de686 100644
> >>> --- a/xen/arch/arm/tee/ffa.c
> >>> +++ b/xen/arch/arm/tee/ffa.c
> >>> @@ -160,14 +160,33 @@
> >>> #define FFA_MSG_SEND                    0x8400006EU
> >>> #define FFA_MSG_POLL                    0x8400006AU
> >>>
> >>> +/* Partition information descriptor */
> >>> +struct ffa_partition_info_1_1 {
> >>> +    uint16_t id;
> >>> +    uint16_t execution_context;
> >>> +    uint32_t partition_properties;
> >>> +    uint8_t uuid[16];
> >>> +};
> >>> +
> >>> struct ffa_ctx {
> >>>    /* FF-A version used by the guest */
> >>>    uint32_t guest_vers;
> >>> +    /*
> >>> +     * Number of SPs that we have sent a VM created signal to, used =
in
> >>> +     * ffa_domain_teardown() to know which SPs need to be signalled.
> >>> +     */
> >>> +    uint16_t create_signal_count;
> >>> };
> >>>
> >>> /* Negotiated FF-A version to use with the SPMC */
> >>> static uint32_t __ro_after_init ffa_version;
> >>>
> >>> +/* SPs subscribing to VM_CREATE and VM_DESTROYED events */
> >>> +static uint16_t *subscr_vm_created __read_mostly;
> >>> +static uint16_t subscr_vm_created_count __read_mostly;
> >>> +static uint16_t *subscr_vm_destroyed __read_mostly;
> >>> +static uint16_t subscr_vm_destroyed_count __read_mostly;
> >>> +
> >>> /*
> >>> * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
> >>> * number of pages used in each of these buffers.
> >>> @@ -251,6 +270,87 @@ static int32_t ffa_rxtx_map(paddr_t tx_addr, pad=
dr_t rx_addr,
> >>>    return ffa_simple_call(FFA_RXTX_MAP_64, tx_addr, rx_addr, page_cou=
nt, 0);
> >>> }
> >>>
> >>> +static int32_t ffa_partition_info_get(uint32_t w1, uint32_t w2, uint=
32_t w3,
> >>> +                                      uint32_t w4, uint32_t w5,
> >>> +                                      uint32_t *count)
> >>> +{
> >>> +    const struct arm_smccc_1_2_regs arg =3D {
> >>> +        .a0 =3D FFA_PARTITION_INFO_GET,
> >>> +        .a1 =3D w1,
> >>> +        .a2 =3D w2,
> >>> +        .a3 =3D w3,
> >>> +        .a4 =3D w4,
> >>> +        .a5 =3D w5,
> >>> +    };
> >>> +    struct arm_smccc_1_2_regs resp;
> >>> +    uint32_t ret;
> >>> +
> >>> +    arm_smccc_1_2_smc(&arg, &resp);
> >>> +
> >>> +    ret =3D get_ffa_ret_code(&resp);
> >>> +    if ( !ret )
> >>> +        *count =3D resp.a2;
> >>> +
> >>> +    return ret;
> >>> +}
> >>> +
> >>> +static int32_t ffa_rx_release(void)
> >>> +{
> >>> +    return ffa_simple_call(FFA_RX_RELEASE, 0, 0, 0, 0);
> >>> +}
> >>> +
> >>> +static int32_t ffa_direct_req_send_vm(uint16_t sp_id, uint16_t vm_id=
,
> >>> +                                      uint8_t msg)
> >>> +{
> >>> +    uint32_t exp_resp =3D FFA_MSG_FLAG_FRAMEWORK;
> >>> +    unsigned int retry_count =3D 0;
> >>> +    int32_t res;
> >>> +
> >>> +    if ( msg =3D=3D FFA_MSG_SEND_VM_CREATED )
> >>> +        exp_resp |=3D FFA_MSG_RESP_VM_CREATED;
> >>> +    else if ( msg =3D=3D FFA_MSG_SEND_VM_DESTROYED )
> >>> +        exp_resp |=3D FFA_MSG_RESP_VM_DESTROYED;
> >>> +    else
> >>> +        return FFA_RET_INVALID_PARAMETERS;
> >>> +
> >>> +    do {
> >>> +        const struct arm_smccc_1_2_regs arg =3D {
> >>> +            .a0 =3D FFA_MSG_SEND_DIRECT_REQ_32,
> >>> +            .a1 =3D sp_id,
> >>> +            .a2 =3D FFA_MSG_FLAG_FRAMEWORK | msg,
> >>> +            .a5 =3D vm_id,
> >>> +        };
> >>> +        struct arm_smccc_1_2_regs resp;
> >>> +
> >>> +        arm_smccc_1_2_smc(&arg, &resp);
> >>> +        if ( resp.a0 !=3D FFA_MSG_SEND_DIRECT_RESP_32 || resp.a2 !=
=3D exp_resp )
> >>> +        {
> >>> +            /*
> >>> +             * This is an invalid response, likely due to some error=
 in the
> >>> +             * implementation of the ABI.
> >>> +             */
> >>> +            return FFA_RET_INVALID_PARAMETERS;
> >>> +        }
> >>> +        res =3D resp.a3;
> >>> +        if ( ++retry_count > 10 )
> >>> +        {
> >>> +            /*
> >>> +             * TODO
> >>> +             * FFA_RET_INTERRUPTED means that the SPMC has a pending
> >>> +             * non-secure interrupt, we need a way of delivering tha=
t
> >>> +             * non-secure interrupt.
> >>> +             * FFA_RET_RETRY is the SP telling us that it's temporar=
ily
> >>> +             * blocked from handling the direct request, we need a g=
eneric
> >>> +             * way to deal with this.
> >>> +             * For now in both cases, give up after a few retries.
> >>> +             */
> >>> +            return res;
> >>> +        }
> >>> +    } while ( res =3D=3D FFA_RET_INTERRUPTED || res =3D=3D FFA_RET_R=
ETRY );
> >>> +
> >>> +    return res;
> >>> +}
> >>> +
> >>> static uint16_t get_vm_id(const struct domain *d)
> >>> {
> >>>    /* +1 since 0 is reserved for the hypervisor in FF-A */
> >>> @@ -374,6 +474,8 @@ static bool ffa_handle_call(struct cpu_user_regs =
*regs)
> >>> static int ffa_domain_init(struct domain *d)
> >>> {
> >>>    struct ffa_ctx *ctx;
> >>> +    unsigned int n;
> >>> +    int32_t res;
> >>>
> >>>    if ( !ffa_version )
> >>>        return -ENODEV;
> >>> @@ -387,20 +489,68 @@ static int ffa_domain_init(struct domain *d)
> >>>    ctx =3D xzalloc(struct ffa_ctx);
> >>>    if ( !ctx )
> >>>        return -ENOMEM;
> >>> -
> >>
> >> This line removal does not seem to be intended.
> >
> > Right, I'll restore it.
> >
> >>
> >>>    d->arch.tee =3D ctx;
> >>>
> >>> +    for ( n =3D 0; n < subscr_vm_created_count; n++ )
> >>> +    {
> >>> +        res =3D ffa_direct_req_send_vm(subscr_vm_created[n], get_vm_=
id(d),
> >>> +                                     FFA_MSG_SEND_VM_CREATED);
> >>> +        if ( res )
> >>> +        {
> >>> +            printk(XENLOG_ERR "ffa: Failed to report creation of vm_=
id %u to  %u: res %d\n",
> >>> +                   get_vm_id(d), subscr_vm_created[n], res);
> >>> +            ctx->create_signal_count =3D n;
> >>> +            return -EIO;
> >>> +        }
> >>> +    }
> >>> +    ctx->create_signal_count =3D n;
> >>
> >> For clarity here, i would do:
> >> signal_count =3D subscr_vm_created_count
> >
> > OK, I'll update.
> >
> >>
> >>> +
> >>>    return 0;
> >>> }
> >>>
> >>> +static bool is_in_subscr_list(const uint16_t *subscr, uint16_t start=
,
> >>> +                              uint16_t end, uint16_t vm_id)
> >>> +{
> >>> +    unsigned int n;
> >>> +
> >>> +    for (n =3D start; n < end; n++)
> >>
> >> Coding style, missing spaces
> >>
> >>> +    {
> >>> +        if (subscr[n] =3D=3D vm_id)
> >>
> >> Coding style, missing spaces
> >
> > I'm fixing the style issues.
> >
> >>
> >>> +            return true;
> >>> +    }
> >>> +
> >>> +    return false;
> >>> +}
> >>> +
> >>> /* This function is supposed to undo what ffa_domain_init() has done =
*/
> >>> static int ffa_domain_teardown(struct domain *d)
> >>> {
> >>>    struct ffa_ctx *ctx =3D d->arch.tee;
> >>> +    unsigned int n;
> >>> +    int32_t res;
> >>>
> >>>    if ( !ctx )
> >>>        return 0;
> >>>
> >>> +    for ( n =3D 0; n < subscr_vm_destroyed_count; n++ )
> >>> +    {
> >>> +        /*
> >>> +         * Skip SPs subscribed to the VM created event that never wa=
s
> >>> +         * notified of the VM creation due to an error during
> >>> +         * ffa_domain_init().
> >>> +         */
> >>> +        if ( is_in_subscr_list(subscr_vm_created, ctx->create_signal=
_count,
> >>> +                               subscr_vm_created_count, get_vm_id(d)=
) )
> >>> +            continue;
> >>
> >> I am not following the logic here and would need some explanations.
> >>
> >> A SP is subscribing to be informed of any VM creation, but here you ch=
eck
> >> the list against the VM ID that is destroyed.
> >>
> >> Also a SP could subscribe to be informed of VM destroyed but not VM cr=
eated.
> >>
> >> In my head the logic should be:
> >> if (signal_count < subscr_vm_created_count)
> >>        for each sp in subscr_vm_created
> >>                if is_in_list subscr_vm_destroyed sp
> >>                        send_destroyed
> >> else
> >>        for each subscr_vm_destroyed
> >>                send_destroyed
> >
> > The call to is_in_subscr_list() will only match SPs that have not yet
> > received an expected VM creation event. If all SPs subscribed to the
> > VM creation event have been notified, then is_in_subscr_list() will
> > match nothing. The idea is that if an SP has subscribed to both create
> > and destroy events then it might not expect a destroy event unless it
> > has already received a create event. However, SPs only subscribed to
> > destroy-events don't care if all create-events have been sent or not,
> > they should be notified unconditionally.
> >
> > Does it make sense to you?
>
> The logic makes sense but the code is checking subscriber[n] againt the V=
M ID
> being destroyed which does not make sense.

You're right, I'll update the patch.

> The subscriber list contains a list of SP ID, none of the entries will ma=
tch the VM
> ID being destroyed.
> What needs to be tested is if someone in the created subscribers that was=
 signaled
> already is in the destroy subscribers so that it needs to be signaled.

Yes, I have unfortunately only one SP in my setup.

Thanks,
Jens

>
> Cheers
> Bertrand
>
> >
> >>
> >>
> >>> +
> >>> +        res =3D ffa_direct_req_send_vm(subscr_vm_destroyed[n], get_v=
m_id(d),
> >>> +                                     FFA_MSG_SEND_VM_DESTROYED);
> >>> +
> >>> +        if ( res )
> >>> +            printk(XENLOG_ERR "ffa: Failed to report destruction of =
vm_id %u to  %u: res %d\n",
> >>> +                   get_vm_id(d), subscr_vm_destroyed[n], res);
> >>> +    }
> >>> +
> >>>    XFREE(d->arch.tee);
> >>>
> >>>    return 0;
> >>> @@ -411,6 +561,81 @@ static int ffa_relinquish_resources(struct domai=
n *d)
> >>>    return 0;
> >>> }
> >>>
> >>> +static void uninit_subscribers(void)
> >>> +{
> >>> +        subscr_vm_created_count =3D 0;
> >>> +        subscr_vm_destroyed_count =3D 0;
> >>> +        XFREE(subscr_vm_created);
> >>> +        XFREE(subscr_vm_destroyed);
> >>> +}
> >>> +
> >>> +static bool init_subscribers(struct ffa_partition_info_1_1 *fpi, uin=
t16_t count)
> >>> +{
> >>> +    uint16_t n;
> >>> +    uint16_t c_pos;
> >>> +    uint16_t d_pos;
> >>> +
> >>> +    subscr_vm_created_count =3D 0;
> >>> +    subscr_vm_destroyed_count =3D 0;
> >>> +    for ( n =3D 0; n < count; n++ )
> >>> +    {
> >>> +        if (fpi[n].partition_properties & FFA_PART_PROP_NOTIF_CREATE=
D)
> >> Coding style: spaces
> >>
> >>> +            subscr_vm_created_count++;
> >>> +        if (fpi[n].partition_properties & FFA_PART_PROP_NOTIF_DESTRO=
YED)
> >> Coding style: spaces
> >
> > I'll fix the style issues.
> >
> > Thanks,
> > Jens
> >
> >>
> >> Cheers
> >> Bertrand
> >>
> >>> +            subscr_vm_destroyed_count++;
> >>> +    }
> >>> +
> >>> +    if ( subscr_vm_created_count )
> >>> +        subscr_vm_created =3D xzalloc_array(uint16_t, subscr_vm_crea=
ted_count);
> >>> +    if ( subscr_vm_destroyed_count )
> >>> +        subscr_vm_destroyed =3D xzalloc_array(uint16_t,
> >>> +                                            subscr_vm_destroyed_coun=
t);
> >>> +    if ( (subscr_vm_created_count && !subscr_vm_created) ||
> >>> +         (subscr_vm_destroyed_count && !subscr_vm_destroyed) )
> >>> +    {
> >>> +        printk(XENLOG_ERR "ffa: Failed to allocate subscription list=
s\n");
> >>> +        uninit_subscribers();
> >>> +        return false;
> >>> +    }
> >>> +
> >>> +    for ( c_pos =3D 0, d_pos =3D 0, n =3D 0; n < count; n++ )
> >>> +    {
> >>> +        if ( fpi[n].partition_properties & FFA_PART_PROP_NOTIF_CREAT=
ED )
> >>> +            subscr_vm_created[c_pos++] =3D fpi[n].id;
> >>> +        if ( fpi[n].partition_properties & FFA_PART_PROP_NOTIF_DESTR=
OYED )
> >>> +            subscr_vm_destroyed[d_pos++] =3D fpi[n].id;
> >>> +    }
> >>> +
> >>> +    return true;
> >>> +}
> >>> +
> >>> +static bool init_sps(void)
> >>> +{
> >>> +    bool ret =3D false;
> >>> +    uint32_t count;
> >>> +    int e;
> >>> +
> >>> +    e =3D ffa_partition_info_get(0, 0, 0, 0, 0, &count);
> >>> +    if ( e )
> >>> +    {
> >>> +        printk(XENLOG_ERR "ffa: Failed to get list of SPs: %d\n", e)=
;
> >>> +        goto out;
> >>> +    }
> >>> +
> >>> +    if ( count >=3D UINT16_MAX )
> >>> +    {
> >>> +        printk(XENLOG_ERR "ffa: Impossible number of SPs: %u\n", cou=
nt);
> >>> +        goto out;
> >>> +    }
> >>> +
> >>> +    ret =3D init_subscribers(ffa_rx, count);
> >>> +
> >>> +out:
> >>> +    ffa_rx_release();
> >>> +
> >>> +    return ret;
> >>> +}
> >>> +
> >>> static bool ffa_probe(void)
> >>> {
> >>>    uint32_t vers;
> >>> @@ -462,7 +687,8 @@ static bool ffa_probe(void)
> >>>     * TODO: Rework the code to allow domain to use a subset of the
> >>>     * features supported.
> >>>     */
> >>> -    if (
> >>> +    if ( !check_mandatory_feature(FFA_PARTITION_INFO_GET) ||
> >>> +         !check_mandatory_feature(FFA_RX_RELEASE) ||
> >>>         !check_mandatory_feature(FFA_RXTX_MAP_64) ||
> >>>         !check_mandatory_feature(FFA_RXTX_UNMAP) ||
> >>>         !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
> >>> @@ -484,6 +710,9 @@ static bool ffa_probe(void)
> >>>    }
> >>>    ffa_version =3D vers;
> >>>
> >>> +    if ( !init_sps() )
> >>> +        goto err_free_ffa_tx;
> >>> +
> >>>    return true;
> >>>
> >>> err_free_ffa_tx:
> >>> --
> >>> 2.34.1
>
>


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 09:42:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 09:42:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565703.884084 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3hP-0001Sy-6G; Wed, 19 Jul 2023 09:42:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565703.884084; Wed, 19 Jul 2023 09:42:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3hP-0001Sr-2j; Wed, 19 Jul 2023 09:42:23 +0000
Received: by outflank-mailman (input) for mailman id 565703;
 Wed, 19 Jul 2023 09:42:21 +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 <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM3hN-0001Sj-A4
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 09:42:21 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20621.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::621])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8d5a1a4a-2618-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 11:42:19 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB8PR04MB6794.eurprd04.prod.outlook.com (2603:10a6:10:11b::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Wed, 19 Jul
 2023 09:42:17 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 09:42:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8d5a1a4a-2618-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Lmqxbn+oExjX0Ee7H35g4/2LlRX0jGRNTbhv+eP9NcBPleajXi9r8JkRJrxIV+VcixNgxHOgS5Ep/ppAx0kQLHqlh7PfQb15jnYw1xzLIzvK4xd3AnaiGg/vuT0aDnGk0oK1CcJwtxN0u6rXi7K1R0/bKMypThpZK/pPZy3XpTDDrSNU3V8V3eHsjeVVqetsbrIjbeS4wWZXHTW8bXteO0z2ABguEq5paefRYq4POahoT0x2sFgg+4y0gZDXsg6+QcUMwBTeVitAOFGWZhNGTWZXdNfow4eb/fvJNQet3q/S3WNlqAKhG1D9uvzVzWeO3zqIlNn9h4CKeXa9b5d6YQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=lVIg6Is2hTbioXHkAX30RAEyZDvyYOvOekClTgUjN6E=;
 b=Fr5OIzsEGuAZWyCHpqPhhnEGjU7V49Q1RNEmK7SqAEkLS5gpulC5agDmn+Gykx/7zkYN0rM4vReA1XVYTJpmlcyKgxctWo8JaD7s4Z7hZ7cZAxOvjTFJABvqpUJuv0muRmaTrsZH0L2zizE3aQ1PdAlVGrtYsgtmOVtIRWyGGrKtt2+jPnF981Eqzf0jecjBKMB+KH0ZyY3K+WPC+qD4y7ijNmC9f/ASS9yaOVmiiA5VEjqVhh+mAYf6hZ7M4XNYvmuFnNQl4L7ovcuyJQBLEZ3/pJuiOGqaTJlufDI514lPmvWzeqW86xdFlvTh+oDLynYTc+YGZBZeeTyJeB1JcQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=lVIg6Is2hTbioXHkAX30RAEyZDvyYOvOekClTgUjN6E=;
 b=D6gLStSI11rtIQmJgk3Mrmc1az6S+hPtoAfUHK7XydTBx6vXVyRK9qRBPUBufM6PQqhekCu+Ia3XooQODMc1IOzpcEkJDVRUCCVZMLKbIZ8zp0VDJ9mScRkhaqAlyZWTHtb2kMOSUkKQNk6FS++lzl7ScQwjGxdi5cywYyUvtIrxzkGGIIpO02dnCwbZ9MaFXDoJQFSr7Zfc6daKewqUiAy7KYZp2iiXBM9XVZvlLSDOZjWnPqv6MNVLLAQ28mFlsPzvrgZYTnnKEigIU4Uwq2kKmFSmmi/E0masLoYh9JZ7s900bVEiDn6RT5ZG/ArZFx6VZx9Bg1NWRg3Lrtt67w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <dace10da-f108-fbe5-da4f-0e4497f512d9@suse.com>
Date: Wed, 19 Jul 2023 11:42:14 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2 0/4] x86: allow Kconfig control over psABI level
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Content-Language: en-US
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0095.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9b::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB8PR04MB6794:EE_
X-MS-Office365-Filtering-Correlation-Id: 70f0c40d-5abb-44f4-b342-08db883c7086
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	9M/clh2pOlYzqe5UL4KkgNz0xpjFHfNoI3fwsYJjOsTNgPjOHEWO2fUnLY/3UmUh5W1de9H3piWb7XRT3x9ovs6P5cuSJrFhQOgi+cFt7ftDMDc2B7TX2+z3fZqDATbzlpUdLIV8jTJ6yu1rrU386r4rlXoSPt+liym4YHjYSnhN+hHeiNi85KrUiZ2oxCMEqVfPNllSuXuUCRetvvVHNLXhD4yXmE8heVL0PgPtHAHh1hw8mcIYQhCqaYfe5K4/9RCV/HCMwE/buE6g0GlztPiYDuTeXqMRCWQiV+seq2fRCqSj9JwuA9VWgRr/gVkclEFsJ/Bwx7fGrsaW2TuEfA4IBgCGMIcMNsh1uVKDL8WXHKG32mCCS5Pd8MtyWNTs8PUW0uI8lE2o9da66uB+6Cvx66IZcznjiOG/JPICkfVIryeifyiSaZF/j04mIjdt10ylMphAalCA/cM3jskqL0hqGN/h18Vp5OWISFT3b1XTg/zVzZPmAns4RRNGvO++hBn5rUrCA27C8URYWlt1SHZPE/g+L/pNm73WzvhhXKwF582HYFdE4a86H+4xa8Ezatj2RS9cUOPmvZ9+AioxTsEQgtHwdlAeOI02PgOnXTpCtnhM6hRomC7uKciobCHt7AXpTC6C6Gx1uj2qHRw3yQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(136003)(346002)(39860400002)(376002)(451199021)(5660300002)(4326008)(6916009)(66899021)(66476007)(66556008)(66946007)(41300700001)(8676002)(8936002)(316002)(31696002)(86362001)(36756003)(2906002)(4744005)(6666004)(6486002)(478600001)(31686004)(186003)(26005)(6506007)(6512007)(2616005)(54906003)(38100700002)(45980500001)(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pvdURaUlR2NWVjaXdEWnduNkVNNk1IQStmRGYreEph?=
 =?utf-8?B?SGhKMEJrenBMa3dXYm1LNkRycitxU1BudXhtVXdLNEhCQUtudlhFMkhYSW51?=
 =?utf-8?B?aVM5cmRjeHUrVWRDZ21iS2NSbmY4ZHJUekcxdTI4UFllaTNiWVRLb0l4N2Fh?=
 =?utf-8?B?VjhvNzVlWTY4VkZScjBjT2UrUzRiL3QrR2RjNXE5b08zOHh5N3pNWk1XYTdD?=
 =?utf-8?B?V01ldUp2VDQyRE1hejhhL2NzYW9LSmJnSzRDMnhOOHlYNWg5VUVkbEovZnhJ?=
 =?utf-8?B?Q2V0TG5qMnI3cWlMcFl0S3lvMTVUeWhQSkI1SnBuOVB4MVMwVis1TG94dEt3?=
 =?utf-8?B?YVkxQTFRaWlwZTdDa2wwckErbkh3SHU3dndUdHRva0JvSWhqWHlLaU5WNkJi?=
 =?utf-8?B?TW4rMGdmcmJQcTd0Zkd3Mi9EaFhZc1IxY2J4dnNVenhIdUEvdTM2Q2Nhekwy?=
 =?utf-8?Q?PftPp0R3qQlW3AuQWTJul0gAT?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 70f0c40d-5abb-44f4-b342-08db883c7086
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 09:42:17.1627
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 3DdveuQVVHZgPHY3RqZ5uejV4iMpMbAvAWZh5Leml5WX6utC9yHYD1D50nBnXrUBvE72sbi+ruqBFP2lJHyeiA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6794

As discussed in Prague, with some minor add-ons (patch 2 replacing a much
older patch under the same title).

v2 addresses issues found as well as review feedback; see individual
patches for details. It (patch 2 in particular) raises several new
questions as well, though.

1: build: make cc-option properly deal with unrecognized sub-options
2: allow Kconfig control over psABI level
3: use POPCNT for hweight<N>() when available
4: short-circuit certain cpu_has_* when x86-64-v{2,3} are in effect

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 09:44:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 09:44:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565706.884094 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3iq-000211-GQ; Wed, 19 Jul 2023 09:43:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565706.884094; Wed, 19 Jul 2023 09:43:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3iq-00020u-Dd; Wed, 19 Jul 2023 09:43:52 +0000
Received: by outflank-mailman (input) for mailman id 565706;
 Wed, 19 Jul 2023 09:43:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM3io-00020n-JY
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 09:43:50 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on2061b.outbound.protection.outlook.com
 [2a01:111:f400:fe12::61b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c36ec5bf-2618-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 11:43:49 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB8PR04MB6794.eurprd04.prod.outlook.com (2603:10a6:10:11b::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Wed, 19 Jul
 2023 09:43:48 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 09:43:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c36ec5bf-2618-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=gj0dCoej+ia+2mBWKbvdq2P/GuVb74PigAfecpC1r4t99+8R7WOoqj2Ll2qHvEaFvDFiUzSYL9KJY3RARyyH0K+Lo789GkAj0275ETW6k3JJmFemQhebBKqlr5N8WQl9JuYGSz6iijwP6asMpYCGUopCdTwbNqiun8lOo75VUtNP+DxI0nLbjgwcVJsm7W8h1oq9k49XILis7bJBOBEearAvkDyS+E9iBlPhvpyHqAq7mlFrsY4OKxujAWAhG7+S1p3PqA4UrDJJc9ITAhWazlVyG5VB3rLwNHU0fpbBinjxMch0Bhl2KqqR4wPiRyPgOPr2/TRKfJtoSZ6sjkZlyA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=z83+4fe8wofcAMxwXz+EOVByzKrzaNqIk9SWCUEUwCk=;
 b=Nd0eiKBVRluNQKj9i0Z9ZGs4DI6BPUlrPxuLGsHcpeYFUUsQBVPrBtPhCzCFPgejVFus6R1iiAQ3bS4WitDrqDSqjKn5TwpqcwNwrBx2HbX0fCi6GsPgPgp3NuUCYkE8H61jiDI3RjFeX/F28OuXR3A/+8088GscdtKSuOlLOS+hQMlkBMNWH1FCjAcpyOmPiSuBknnIBObGHNLSCl7FlufqgJrN66FC9OpkQj3O3JcGjnejT2uPTvj3TDxVPlJp58itGul+l1IIPGImBBxZm3/HEsereID1nFukZYYsHLR3baOQM+jInLnKD/zdSNKaO2GfnhfKCxMaGU++/Lfa9Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=z83+4fe8wofcAMxwXz+EOVByzKrzaNqIk9SWCUEUwCk=;
 b=OsHBDF/gbeQHQGvQzCDB309RPIGNrrrjwPc/SJyEP473RKghpR/k4lBuk24sG3mF+rYmZR61I9VMxBeAYbMFidhgHymsHSabkGd2jxNx3y52UXXYP1ph3aGnWqv0Ji6Tp0LONHP+fXdhldU6scj+VXj0L7BkDE6nZtVHDcn6MFIRqHoq6Js/2ljMwe/wwMwUwDhWbxeYoOhz2504osUYqjislX2cVH+14x5Nn09MWJZ4cch7FKJGjeXB+H6+94cKu9JONqGQytoajW1wVOunA2Wr/OZ7iuocUL4H34t6Hk84aAYlkR6wa2M5+K26FDpA2eW6AHmFxx5cN4CBvOsXog==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <b2c0b9ce-7919-8571-cee5-5ee68b7db63c@suse.com>
Date: Wed, 19 Jul 2023 11:43:46 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v2 1/4] build: make cc-option properly deal with unrecognized
 sub-options
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Anthony Perard <anthony.perard@citrix.com>
References: <dace10da-f108-fbe5-da4f-0e4497f512d9@suse.com>
In-Reply-To: <dace10da-f108-fbe5-da4f-0e4497f512d9@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0191.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ab::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB8PR04MB6794:EE_
X-MS-Office365-Filtering-Correlation-Id: 6120a6f5-af45-464e-a427-08db883ca6e0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	XbF75OcSS6tIuDaGpq2ryEJKWCBtsDGjxNbWiTvllQwSMwA0S0P6z6qYbZkGNtTjodLNsZDDFKzXKaMTpVZOB7sbWYWcElY1TlxWutrhe4Fr5AzldlnNaoMa+4J5lTAupAmBUiQNAJOkilddryeXunNXs03SepEn3ZGJn4u91uKgqvgvD1qOUrCJW5ADiJSpfswT+76CzSd9ATgjGelHrqHEiwliPJ557gZKtgFl/vOUdAOHXoY971zb+h5uOX1Ki2HwaQVeTD9nmbs2sKD1a1ZIRYkyKd02ZRkuf8tBSKImkFOvbA6eQ5yABkQeWCO4Y6QKtZNFYussv3DH/VzgKy4Ct+sFd143tBntHTnqzVSKF5D5hmk1DBp/zkOIq2BB0GTZqme5K/I4bAF5cuB4qskTth7UW2pR8PAa/tCNsdNrua6daJDB3duchcCSaDNUsyOiaPoBWBrdkKJxphqQf5t+RSuLe7XgwHfBCBJ9Kvuh49K7bZ0p8Ey0lhU3I0kLAFBekRZtNuqI9F55Hr4SmCf9XOFKPhmrckh1Sz3gdhGoiidj3TVPvMnqnVeZRYP8Oq/6oOrlZh3iWoJ+1Xy84D6IujMXE9N5JtvUAQf79DMEo89/3usnFNHwYQN3VUFjdIR6IHSbwg+pG7uqBvWePw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(136003)(346002)(39860400002)(376002)(451199021)(5660300002)(4326008)(6916009)(66476007)(66556008)(66946007)(41300700001)(8676002)(8936002)(316002)(31696002)(86362001)(36756003)(2906002)(6486002)(478600001)(31686004)(186003)(26005)(6506007)(6512007)(2616005)(54906003)(38100700002)(83380400001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VVN1alAwZklJNDIrZktie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 =?utf-8?B?VDZJdVdCWHdRY1pHNWVXdmo5RXhla2JzUVFsN25UWlorY1h0WGpsME5CNGRT?=
 =?utf-8?B?ck9mZDNkcHEzMEFQY2ROYWdiMlVHMVBnUWI1bnArcExFdUFudkpUdVBNWDhQ?=
 =?utf-8?B?WXZCRWVXNU1tT1hFLzAxSW1QaUd1RlVjenN1Zms5RW9PbzhLRHM4bXJ3VDNu?=
 =?utf-8?B?eTNZUU5Pbkhod0svVWw4WGFvUkRzY1JBQVozT3hXSFpNWGpUQ2RtTTE4b0tP?=
 =?utf-8?B?R2J5UStpUUd6eGFyRWFUMk9NZDhGRG5hR2VtcEZlUTVtRmprelZ4MnlhRDcz?=
 =?utf-8?B?WVRpRnZGZlRxaU5UZ0xVTGZCUWNvWDRUaUNKVENmVkY2dHZPVWdCOU9tcTBj?=
 =?utf-8?Q?ADjlx0MCIPoOlUUQqeKFpUclm?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6120a6f5-af45-464e-a427-08db883ca6e0
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 09:43:48.3209
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: DZZwoADdSmskgi8gXOPs3pEDvooWCc36JHr0remVm6P2BRA1lPHAX7GO6OepSJi4erF6IPDpGnYZKqBBk68EUg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6794

In options like -march=, it may be only the sub-option which is
unrecognized by the compiler. In such an event the error message often
splits option and argument, typically saying something like "bad value
'<argument>' for '<option>'. Extend the grep invocation accordingly,
also accounting for Clang to not mention e.g. -march at all when an
incorrect argument was given for it.

To keep things halfway readable, re-wrap and re-indent the entire
construct.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
In principle -e "$$pat" could now be omitted from the grep invocation,
since if that matches, both $$opt and $$arg will, too. But I thought I'd
leave it for completeness.
---
v2: Further relax grep patterns for clang, which doesn't mention -march
    when complaining about an invalid argument to it.

--- a/Config.mk
+++ b/Config.mk
@@ -90,9 +90,14 @@ PYTHON_PREFIX_ARG ?= --prefix="$(prefix)
 # of which would indicate an "unrecognized command-line option" warning/error.
 #
 # Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
-cc-option = $(shell if test -z "`echo 'void*p=1;' | \
-              $(1) $(2) -c -o /dev/null -x c - 2>&1 | grep -- $(2:-Wa$(comma)%=%) -`"; \
-              then echo "$(2)"; else echo "$(3)"; fi ;)
+cc-option = $(shell pat='$(2:-Wa$(comma)%=%)'; \
+                    opt="$${pat%%=*}" arg="$${pat\#*=}"; \
+                    if test -z "`echo 'void*p=1;' | \
+                                 $(1) $(2) -c -o /dev/null -x c - 2>&1 | \
+                                 grep -e "$$pat" -e "$$opt" -e "$$arg" -`"; \
+                    then echo "$(2)"; \
+                    else echo "$(3)"; \
+                    fi;)
 
 # cc-option-add: Add an option to compilation flags, but only if supported.
 # Usage: $(call cc-option-add CFLAGS,CC,-march=winchip-c6)



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 09:44:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 09:44:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565707.884104 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3jF-0002Rx-OU; Wed, 19 Jul 2023 09:44:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565707.884104; Wed, 19 Jul 2023 09:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3jF-0002Rq-LP; Wed, 19 Jul 2023 09:44:17 +0000
Received: by outflank-mailman (input) for mailman id 565707;
 Wed, 19 Jul 2023 09:44:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM3jE-00020n-8K
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 09:44:16 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20614.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::614])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d28ce73c-2618-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 11:44:15 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PR3PR04MB7404.eurprd04.prod.outlook.com (2603:10a6:102:8f::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.23; Wed, 19 Jul
 2023 09:44:13 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 09:44:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d28ce73c-2618-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=VGOF+FIwUf9k7TpJvcSQwl9bFov7vXUwsNqps1W7+U/a6FKvcT1rcxqWrFhrftHlx3z0MoasJdxImVM+tvjRK3vnb4LG30uVv8arsywdPYaxQ1gUhDyZ+x9UZ1V+wpatvuHJuEt+7X7CNn7eEFsOZZaBZXRGXbSM2yJSnvGcthEPl4kb0JjUI5uYnFST8fZNPEnUePc39UJ9AgbzBIzDLlfiC4zhtriV5r5PrkHtoUVpJzJsIKCGV4gt6tv5oG71y9L5+8eXUm+4U20WpE6zf4kfOBuKLmvoduuWMYsETNYHk5W44wr+v4jkHltcdI4VzhBvoPFBaxME/48o72fMrA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=y/62dXeGLGtd8XVzqmQ/9q/ddkhQ4yGM4klh0gvZiAA=;
 b=JAkdlEm+D9XAFtTMJ5UIixH5fjHwaCmDKUpMQkGO8hXOY5Lpb7xdfKCtFi42SUMuPk88lcm14JQr31UKtPkgbsp35oqdfo32QVfteMIeGPEbyvvr6GleT3ZU2MDKnylvSWIu9CUuCwPJYSaj4xLPoAo+ZlZUbF9AXZN/XYKCjbAffP1WkXXYuObPS+G3JmVP7RmRkfaILoxhEHfGEzQkkV+EVtnJJwNOTgKlAZltihsRyj6rTnsTk0M9A6mMo1jA+UxAICmeFgcOV7xWJQerDUTPTpD4dnh3KJIB6/5984eGYidC8ss3BKyyT13+drFLUTTlVlJWtCY7OeEu0YTRkg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=y/62dXeGLGtd8XVzqmQ/9q/ddkhQ4yGM4klh0gvZiAA=;
 b=mT5JWEFLnGD34ACR1NSNuWxTKKuqoZja54gufFQRuEOD+FR1aR7jE+tE9eYpalE2Bz+YYGg0vigkcOHgIfI0gXGzIfXJpUBjHtU68BtGRrMav0fgXQGhDwbSvujtVRQa6/mVHEg/8T4iTi/VdM0F311rCmVauJL1gXgULau8KxvLWySKbfm+VHUqECx2FsJDG05gLRdldx5Wqu+ANteuvzs9NnLwRjb9yJ6OHZ964bEfKrsZlht+ptX+nOxukHoX6ondF2KiJ1NzchEnz6Smn4g7Hc1U7VzXJO/z6teh+ymmoS1nxruZmW66SQz0Vcqebm7qTYVh7/JglOumI03jag==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <28a84bbd-b0c4-dd80-b9c2-59770d0f54fc@suse.com>
Date: Wed, 19 Jul 2023 11:44:11 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v2 2/4] x86: allow Kconfig control over psABI level
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <dace10da-f108-fbe5-da4f-0e4497f512d9@suse.com>
In-Reply-To: <dace10da-f108-fbe5-da4f-0e4497f512d9@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0181.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ab::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PR3PR04MB7404:EE_
X-MS-Office365-Filtering-Correlation-Id: 849a18dc-f280-4825-f852-08db883cb596
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	2lPJj1tSAfbx4IG49ym4VSnueQcGFxKeYdVzr5zy6/4/k7jimk1QMcDL7r1CXX07KpN5KuXBTn5EiUm9pvXa2rVwJ6UpcVRQ0skqXUMCK0Iqq51km2SohSEjBIJu0ZyNK4qXTakDGiN1IQVDLsHFZCoQeCqJvAbZK9v6BtujS5q4/G860qRbNfbUpNXrCd3OTiku4jfmLjIi0l1zB3hSCsb0O9HEJqfl5gKXzI+IF/vmIAUJMtbIoZc+4f07DunbygTKNEglMaPLZ6dCHmsrmEUkLnYTqYpoi27KoGoXo0gmrsPTPmcH5wXE6IxQpfqpB9/yYPaEEbRtlhAZZyOPFhJSKx8C+jgRgodF20C5HQ9nll4CVM01jnBsj3WA9QXESKCTQsqzBdgnCS/UO0KsWSm4YeqkOl9Rl9ccFfWvOXuwe1BgepoITlo2PyJLfGGB5iY1afcE0Jmtw/v63dpyOYddbDV2kuW+RvguF+d34ZSItuZVojtfe2qUTxlx8ov8C+5WCDq42vTpzdUX9RX6/1xT2jKgcZjBlAn7kfbiMOhKhInG23eXboPcx1VECjuN3SU9vZF8VW5z2rNFx0v7yOjVMYkhsRvAczsYaDkMrdGLBLY2wELQ25fIgJQNSIMuEMlopad28/SgqgkAH9/IAw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(396003)(136003)(366004)(376002)(451199021)(31686004)(66899021)(6486002)(478600001)(54906003)(83380400001)(2616005)(36756003)(31696002)(86362001)(2906002)(26005)(6506007)(186003)(6512007)(38100700002)(6916009)(4326008)(66946007)(66556008)(66476007)(316002)(41300700001)(8676002)(5660300002)(8936002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VkxiMSt2ZURjV01rcVlIYUtjL3RpaFR5NFN5ZXlyYU8vdTVYbEsyaVdyU3ZX?=
 =?utf-8?B?UkI5Ry9TWDA2eE10a0IvK2pWQ1hBa2ptTVNNSG9PNzhqbVZUOVVndHhqTXhU?=
 =?utf-8?B?RnR3empDaVdlY0g3OHQrSE9TaVdnN0RGYk95Qk5MSFZvZm1mWGtHdi9qYjEx?=
 =?utf-8?B?R2R0Y3B6Z2JUUTYvV1oyK2xTZTlwMThWQXFySVZPNWFWdmJROCsxanJpNy8x?=
 =?utf-8?B?NHJ1K1dNQnRKa250L0hRaWdsaVZFbWNjc2d3VDgwR0JqVmU5Wm5NTFE1Vzg3?=
 =?utf-8?B?RC83NGU5LzBaQjJZcG9UOFRtY1hMazM4L1VXclE4L3UwRXUraVVEdE81NXpv?=
 =?utf-8?B?Q3hKeWhDb3NmOTFoYnRTRkdhTlNBSGNmM2Jpak9XUzhtMGtvTTd2WWl5L3Av?=
 =?utf-8?B?ZVY3VjB4a0VkUTVQbTcyMFRZN0JQSDhSVElLRkZPMzhvcVBJODA4d3dseTZ5?=
 =?utf-8?B?QkZnRlhXd1BvUllVa096YUJPS2c1bmtPTmx6R0RSWlpwdDQva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B?eU9CcmFjRE5kMmZadlpnZGgwaGQ3Sldsdmw0dmI5U1hodXB6RStEMFhNc2pL?=
 =?utf-8?B?MmtmK0tBQzJ6MXlVL0VMalVITFJkajVXT0EzWWUrOHBaVGR5eTZCeERaeWha?=
 =?utf-8?B?SlFNanFiN1U3ZXN2QldKa3dpYnREem9PSlZDUW1NcVE4YTJRR0JwMk5hamJu?=
 =?utf-8?B?Z3k0bUZlRExqeXBuMDBTYTdJbzlnM2t5L25hMks1VzdIdHFvSy9HN1NRN29Y?=
 =?utf-8?B?cGx0REE1SU1ld0QwOEZNVXF6UTA1bEJQTzI3NWNxUlUwbTI2em1SaHB2cUtz?=
 =?utf-8?B?SS9lUDJGUnRNaUpMdVlSbUF6aXJvOEhMcDUwYlhJZmJNK1Z3YVJtTVVVd2Z5?=
 =?utf-8?B?TEpia1F5aFQrMUdQVHN3RnJCSnhtclJBaTlDbUIwRDNGV1dQZ3dTTnBpd3dN?=
 =?utf-8?B?Z1EvRnVmcERyaU5QYStqVXQ0UTNKK0o4Yzk3eHdrTEpnWHJCRmthYVpYd3dO?=
 =?utf-8?B?eENEazdmVWt0QXpDRXVsOE51MUxqUHowcHlGdmhjQ2VGYWlST2c2MXF5SzBM?=
 =?utf-8?B?TXZRV24zZTU5ODduSC8zYi95SGJlWVpXUUhqV0xDOU9sc0EzS1NweVhYQzF1?=
 =?utf-8?B?QStjRzFIQWN3MGlFdVYyZm8rbkROQ0cwUHRSZXBucTBJb25YUUZkTUZFUmZV?=
 =?utf-8?B?eDNmZUFhTkZpek9nSWhZTzZPSk1BengzTmhkQm1PMnp5bGJBcThUdStNekVG?=
 =?utf-8?Q?44b9yApk/wbPzCGSiEGIG7vY9?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 849a18dc-f280-4825-f852-08db883cb596
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 09:44:12.9994
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Gp+iEE/dVvSQK2SFWRkOuifGjegMoSMYcR5f/hU6E8mBGUsuE7BFhfXCfAjR7U8WCvnFkHIEEJiaR1LofTctOg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7404

Newer hardware offers more efficient and/or flexible and/or capable
instructions, some of which we can make good use of in the hypervisor
as well. Allow a basic way (no alternatives patching) of enabling their
use. Of course this means that hypervisors thus built won't work
anymore on older, less capable hardware.

Note that in efi_arch_cpu() the filling of 7c0 and 7d0 are forward-
looking; we only require 7b0, but we need to use cpuid_count() anyway.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
TBD: Since older compilers (apparently gcc10 / clang11 and older) won't
     recognize -march=x86-64-v2 etc, we could fall back to passing
     -mpopcnt and alike explicitly.

TBD: While the added assembly code goes strictly from the CONFIG_*
     settings, EFI code uses the compiler provided manifest constants
     where available (just like the subsequent "x86: short-circuit
     certain cpu_has_* when x86-64-v{2,3} are in effect"). While I
     generally prefer it that way, this comes with a downside: If we
     ever started to use one of the ISA extensions in assembly code
     (and then keyed to the CONFIG_* settings), things could break. I
     don't view us doing this as very likely though, as then we'd need
     to have two (or more) variants of such assembly code, which we
     would likely want to avoid. (What I'd like to avoid is using the
     compiler manifest constants in assembly code: In principle we ought
     to filter out any -march= when constructing AFLAGS, and perhaps
     at least all -m... and -f... options. Compilers might rightfully
     complain about their use as inapplicable, much like we've seen for
     -Wl,... when no linking is done.)

TBD: While we don't document most "cpuid=no-*" options (and hence imply
     their use to be unsupported), using e.g. "cpuid=no-popcnt" with a
     V2=y hypervisor clearly can't have the intended effect, and hence
     might perhaps better be flagged in some way.

TBD: v2 also includes LAHF/SAHF. Since we don't use floating point and
     hence FPU insns, we ought to be okay not explicitly checking for
     it. But there is a certain amount of risk of the compiler finding
     some "smart" use for one or both of the insns. However, if we were
     to check the feature, we'd need to account for the quirk that
     init_amd() also works around.

Whereas the baseline -> v2 step isn't much of a difference (we'll gain
more there by a subsequent patch), v2 -> v3, while presumably (or shall
I say hopefully) faster, yields an overall growth of .text size by (in
my build) about 2k. The primary reason for this appear to be conversions
of SHL-by-immediate to SHLX.

The VGA output attempt in early (MB/MB2) boot code does not appear to
work (anymore?). The serial output may work, but only if - without any
setup in Xen - both sides agree on the serial settings (baud rate etc).
Hence the feature checks added on the legacy paths are of limited use.
---
v2: Also cover XSAVE. Add early boot feature checking.

--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -118,6 +118,36 @@ config HVM
 
 	  If unsure, say Y.
 
+choice
+	prompt "base psABI level"
+	default X86_64_BASELINE
+	help
+	  The psABI defines 4 levels of ISA extension sets as a coarse granular
+	  way of identifying advanced functionality that would be uniformly
+	  available in respectively newer hardware.  While v4 is not really of
+	  interest for Xen, the others can be selected here, making the
+	  resulting Xen no longer work on older hardware.  This option won't
+	  have any effect if the toolchain doesn't support the distinction.
+
+	  If unsure, stick to the default.
+
+config X86_64_BASELINE
+	bool "baseline"
+
+config X86_64_V2
+	bool "v2"
+	help
+	  This enables POPCNT and CX16, besides other extensions which are of
+	  no interest here.
+
+config X86_64_V3
+	bool "v3"
+	help
+	  This enables BMI, BMI2, LZCNT, MOVBE, and XSAVE, besides other
+	  extensions which are of no interest here.
+
+endchoice
+
 config XEN_SHSTK
 	bool "Supervisor Shadow Stacks"
 	depends on HAS_AS_CET_SS
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -36,6 +36,10 @@ CFLAGS += -mno-red-zone -fpic
 # the SSE setup for variadic function calls.
 CFLAGS += -mno-mmx -mno-sse $(call cc-option,$(CC),-mskip-rax-setup)
 
+# Enable the selected baseline ABI, if supported by the compiler.
+CFLAGS-$(CONFIG_X86_64_V2) += $(call cc-option,$(CC),-march=x86-64-v2)
+CFLAGS-$(CONFIG_X86_64_V3) += $(call cc-option,$(CC),-march=x86-64-v3)
+
 ifeq ($(CONFIG_INDIRECT_THUNK),y)
 # Compile with gcc thunk-extern, indirect-branch-register if available.
 CFLAGS-$(CONFIG_CC_IS_GCC) += -mindirect-branch=thunk-extern
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -124,6 +124,12 @@ multiboot2_header:
 .Lbad_efi_msg: .asciz "ERR: EFI IA-32 platforms are not supported!"
 .Lbag_alg_msg: .asciz "ERR: Xen must be loaded at a 2Mb boundary!"
 .Lno_nx_msg:   .asciz "ERR: Not an NX-capable CPU!"
+#if defined(CONFIG_X86_64_V2) || defined(CONFIG_X86_64_V3)
+.Lno_x86_64_v2_msg:   .asciz "ERR: Not an x86-64-v2 capable CPU!"
+#endif
+#ifdef CONFIG_X86_64_V3
+.Lno_x86_64_v3_msg:   .asciz "ERR: Not an x86-64-v3 capable CPU!"
+#endif
 
         .section .init.data, "aw", @progbits
         .align 4
@@ -156,9 +162,20 @@ early_error: /* Here to improve the disa
         jmp     .Lget_vtb
 #ifdef CONFIG_REQUIRE_NX
 .Lno_nx:
+        pop     %ecx
         mov     $sym_offs(.Lno_nx_msg), %ecx
         jmp     .Lget_vtb
 #endif
+#if defined(CONFIG_X86_64_V2) || defined(CONFIG_X86_64_V3)
+.Lno_x86_64_v2:
+        mov     $sym_offs(.Lno_x86_64_v2_msg), %ecx
+        jmp     .Lget_vtb
+#endif
+#ifdef CONFIG_X86_64_V3
+.Lno_x86_64_v3:
+        mov     $sym_offs(.Lno_x86_64_v3_msg), %ecx
+        jmp     .Lget_vtb
+#endif
 .Lmb2_no_st:
         /*
          * Here we are on EFI platform. vga_text_buffer was zapped earlier
@@ -657,6 +674,7 @@ trampoline_setup:
         mov     $1, %eax
         cpuid
         mov     %ecx, CPUINFO_FEATURE_OFFSET(X86_FEATURE_HYPERVISOR) + sym_esi(boot_cpu_data)
+        mov     %ecx, %edi
 
         mov     $0x80000000,%eax
         cpuid
@@ -674,6 +692,9 @@ trampoline_setup:
         bt      $cpufeat_bit(X86_FEATURE_LM),%edx
         jnc     .Lbad_cpu
 
+        /* Preserve %ecx for later use. */
+        push    %ecx
+
         /*
          * Check for NX
          *   - If Xen was compiled requiring it simply assert it's
@@ -724,6 +745,36 @@ trampoline_setup:
 .Lno_nx:
 #endif
 
+        /* Restore CPUID[80000001].ecx output. */
+        pop     %ecx
+
+#if defined(CONFIG_X86_64_V2) || defined(CONFIG_X86_64_V3)
+        mov     $cpufeat_mask(X86_FEATURE_POPCNT) | cpufeat_mask(X86_FEATURE_CX16), %eax
+        and     %edi, %eax
+        cmp     $cpufeat_mask(X86_FEATURE_POPCNT) | cpufeat_mask(X86_FEATURE_CX16), %eax
+        jne     .Lno_x86_64_v2
+#endif
+
+#ifdef CONFIG_X86_64_V3
+        mov     $cpufeat_mask(X86_FEATURE_MOVBE) | cpufeat_mask(X86_FEATURE_XSAVE), %eax
+        and     %edi, %eax
+        cmp     $cpufeat_mask(X86_FEATURE_MOVBE) | cpufeat_mask(X86_FEATURE_XSAVE), %eax
+        jne     .Lno_x86_64_v3
+        bt      $cpufeat_bit(X86_FEATURE_ABM), %ecx
+        jnc     .Lno_x86_64_v3
+        xor     %eax, %eax
+        cpuid
+        cmp     $7, %eax
+        jb      .Lno_x86_64_v3
+        mov     $7, %eax
+        xor     %ecx, %ecx
+        cpuid
+        mov     $cpufeat_mask(X86_FEATURE_BMI1) | cpufeat_mask(X86_FEATURE_BMI2), %eax
+        and     %ebx, %eax
+        cmp     $cpufeat_mask(X86_FEATURE_BMI1) | cpufeat_mask(X86_FEATURE_BMI2), %eax
+        jne     .Lno_x86_64_v3
+#endif
+
         /* Stash TSC to calculate a good approximation of time-since-boot */
         rdtsc
         mov     %eax,     sym_esi(boot_tsc_stamp)
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -740,29 +740,53 @@ static void __init efi_arch_handle_modul
 
 static void __init efi_arch_cpu(void)
 {
-    uint32_t eax = cpuid_eax(0x80000000);
+    uint32_t eax = cpuid_eax(0), dummy;
     uint32_t *caps = boot_cpu_data.x86_capability;
 
     boot_tsc_stamp = rdtsc();
 
-    caps[FEATURESET_1c] = cpuid_ecx(1);
+    if ( eax )
+        caps[FEATURESET_1c] = cpuid_ecx(1);
 
-    if ( (eax >> 16) == 0x8000 && eax > 0x80000000 )
-    {
-        caps[FEATURESET_e1d] = cpuid_edx(0x80000001);
-
-        /*
-         * This check purposefully doesn't use cpu_has_nx because
-         * cpu_has_nx bypasses the boot_cpu_data read if Xen was compiled
-         * with CONFIG_REQUIRE_NX
-         */
-        if ( IS_ENABLED(CONFIG_REQUIRE_NX) &&
-             !boot_cpu_has(X86_FEATURE_NX) )
-            blexit(L"This build of Xen requires NX support");
-
-        if ( cpu_has_nx )
-            trampoline_efer |= EFER_NXE;
-    }
+    if ( eax >= 7 )
+        cpuid_count(7, 0, &dummy,
+                    &caps[FEATURESET_7b0],
+                    &caps[FEATURESET_7c0],
+                    &caps[FEATURESET_7d0]);
+
+    eax = cpuid_eax(0x80000000U);
+    if ( (eax >> 16) == 0x8000 && eax > 0x80000000U )
+        cpuid(0x80000001U, &dummy, &dummy,
+              &caps[FEATURESET_e1c], &caps[FEATURESET_e1d]);
+
+    /*
+     * Checks here purposefully don't use cpu_has_* because they bypass
+     * boot_cpu_data reads if Xen was compiled with respective CONFIG_*.
+     */
+#define CHK(ppsym, feat) do {                                        \
+        if ( IS_ENABLED(ppsym) &&                                    \
+             !boot_cpu_has(X86_FEATURE_ ## feat) )                   \
+            blexit(L"This build of Xen requires " #feat " support"); \
+    } while ( false )
+
+    CHK(CONFIG_REQUIRE_NX, NX);
+
+    /* x86-64-v2 */
+    CHK(__POPCNT__, POPCNT);
+    CHK(CONFIG_X86_64_V2, CX16);
+    CHK(CONFIG_X86_64_V3, CX16);
+
+    /* x86-64-v3 */
+    CHK(__ABM__, ABM); /* LZCNT */
+    CHK(__BMI__, BMI1);
+    CHK(__BMI2__, BMI2);
+    CHK(__MOVBE__, MOVBE);
+    CHK(__XSAVE__, XSAVE);
+
+#undef CHK
+
+    if ( cpu_has_nx )
+        trampoline_efer |= EFER_NXE;
 }
 
 static void __init efi_arch_blexit(void)



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 09:44:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 09:44:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565711.884114 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3jd-00032o-4Y; Wed, 19 Jul 2023 09:44:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565711.884114; Wed, 19 Jul 2023 09:44:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3jd-00032f-1y; Wed, 19 Jul 2023 09:44:41 +0000
Received: by outflank-mailman (input) for mailman id 565711;
 Wed, 19 Jul 2023 09:44:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM3jb-00020n-Me
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 09:44:39 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20618.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::618])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e0ced962-2618-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 11:44:39 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PR3PR04MB7404.eurprd04.prod.outlook.com (2603:10a6:102:8f::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.23; Wed, 19 Jul
 2023 09:44:38 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 09:44:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e0ced962-2618-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=fxhycjgnFzL0sauS7AGzGEQFRuZOGE8SGi7fFiBdSy5mvE4g0LlRZin0lJC57tbF9bZFkTfgaqujqdoEKTUQYeWx5ciYzmEz6ba7OZq6yt9MIxbcwZ0xiL2ne3acZLLByPmOIsPPWaomASKcpgXh+kDoHPvPmKv0N/t+MHqHh4qgvJrIlwSOUsB9b3WGJgGkvEJw3EUeD1lRd/sq7sfyb5Mp9hRU78jYJGhPTOWZfeQGox+lio6ggNw0WanlZcrl/VUIyDti9FGd+Lq8FGZCzUeEMjmGg+uVreaT2Qnz6UEpcBOBrcPV4YZiQ+knYBWbMRQS/1yYtV0rpLBEF5Ge7g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4bXX4UWXnWt29w89tvGp0cf+LqZaRKTS56ciKBNCO2k=;
 b=chJPDsN63bGiC5KKPXJoTd/Ee718+TJWIQz+N7KG/UXhGLVojZCGyXcn72ChWvAq40UPzXQbvyt/oeBrJO08GUyzMWx+TW+vOT3qRsa4DoP9HU63rnxmhMfDbGYWl9hwKjemLCwU1IAC+dmMsSVcFPmEcK+E1c7MMyLXMZvflRGyQV5kXl9jgid0Dh+rn6W0IZq83IJoJlNrch81ivk0x/owHrZNXvfXCJPGUk2Ye8aVsKsAMuq+kRc0+17LzuFIu8hiF2m9UwpqoQBToJ5L2f3jgSMVbqwjaWL0foOeynVUmMUe+eYhhSn0PcXCL5FGJodZ/9bqm3zfuVk3TXlCBw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4bXX4UWXnWt29w89tvGp0cf+LqZaRKTS56ciKBNCO2k=;
 b=ITYxGJOpNogGKV1p+LELNBBJb/XBXslDIDzpMOAxbApo3961+6eHdCL/zIaUxFTf+isIPusVYtXwYjqN4nd5HT7up/RZPhNXE62tO9fttBBNfQu2Hlj/F89cSQEDKhKVvx3jokgMrX3ZRm2jRADsHhptG+qgNP9+YlSyu03ReHdvaoWLyi5/YhfjXGp3JUnPIVt0T73rXPbj01Cs+V/Ke7KRnOq751SWp5pAJQJgGgFCeix4QJ8Tr8gjSsj5zIst2yuKIu1uchNLi0O7mEfD5LoqsfSHHIk2s4RZxe0Ve5wIIGyXit5s6Mh14L4uoQ4oe+mizT8S+JtFJEWRkzvwSA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <d1ae6dc1-215c-4953-8937-1b32cc23e308@suse.com>
Date: Wed, 19 Jul 2023 11:44:36 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v2 3/4] x86: use POPCNT for hweight<N>() when available
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <dace10da-f108-fbe5-da4f-0e4497f512d9@suse.com>
In-Reply-To: <dace10da-f108-fbe5-da4f-0e4497f512d9@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0165.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b3::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PR3PR04MB7404:EE_
X-MS-Office365-Filtering-Correlation-Id: 1dc46d60-1cc7-4f3c-f604-08db883cc47c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	p0wJNMSdNYXQzpTy27aJ8wIMdpD7P82qGQaVnWMJJU2YaaqhGir2N23DRQ9tEk4HG2GGT6hQFnyOsx9h5oXnsselb2d2nOLW08qsiiUat5exaoBSJNkN68EY2MSXhOJdVEb3Ga7rnIsWKId6gpPQ/0BBa1BJN2NhiXuhipNRtI0kp8931ZC6Zn2W+evmrdr8Nd5nj6S1/EO+TerzTu/ubWqYvKTVtcjU9CGlzOP92i3fhUkmq0PP4nM//5TnlE18XPlAkAx2PWV45SXb8mBqs/WLODc5FAB/3/WEl8QZyKFO7MJoFNqTWd5xvO23S0LBq6sqtwkK9NVKkmzIpWXq9HrHIGfNnHInef0Kzy/33BAp7wetmYki4yysMvXgK8cOQ9koDFcTUWogaGntmtXt2Gs93nA1BQxXZ+3QkWppZHmgqxxGjuAsQ8WnZ0HhsXQ3HCBiWwn/tFTO+dO3WheV5EQ8wHH5qU7IeDkreYQYt7QqgRh+7KzhakHTiiqbkPUcLew8dxkU8FoxuCkIdi//8utN5vr1qMHwa9VBxajwIuU95BT6yImk0RztRku/l6wP3T6TA2s7K/50HDzhhiyDrqvAKsGF6MeNL7HDKOsFEzfSpNXvwpj0d0ykA8LoOAw79E4/tC2gxCxZRAWxai/85rA8UGzD2+XYMujbqaGvdp2TO+OPM2yfeltDJcZ+T5QW
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(396003)(136003)(366004)(376002)(451199021)(31686004)(6486002)(478600001)(54906003)(2616005)(36756003)(31696002)(86362001)(4744005)(2906002)(26005)(6506007)(186003)(6512007)(38100700002)(6916009)(4326008)(66946007)(66556008)(66476007)(316002)(41300700001)(8676002)(5660300002)(8936002)(16393002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VGJrS1I0MFNZSSs3YmJHM3BObExhRFJ6TEZKeTltZmd0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MzhpcDBDR1pxbHpOWmYzM3hjeWxHamZ6VHdDS2ZKbmtYU2IrVDY1OUlxUk83?=
 =?utf-8?B?SHoxcFJmUkhkekJvWUZ0V1cyTkFndUxhTndkQnBhRkEzcGJTN2JmWGNqTDUz?=
 =?utf-8?B?Ry8yTDVrUXo4TGdXWkJIRkZWd2pZNEtEU1V5UnhEbUlQR3NYVVFRZStEYlpP?=
 =?utf-8?B?S2Y3cGVlcEtLVmYySklucWxwbUh0cUl1TjZVMmhLaVJuTis5YkxPdUpwdk9U?=
 =?utf-8?B?N0NuRyt1Ty9MSStwOEZNQnJVbm1IMDFZVWg2TWtlVXpFV25iZ1F0ZTdKMCtE?=
 =?utf-8?B?ZjNCR01Rb2ZUeUdWT0tWM3NOMm1uRS9KajZBS0M0SFJZblR5NUd1bVkvU2pu?=
 =?utf-8?Q?jwNi5ZNNNBBIwyBON0TM0Y29p?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1dc46d60-1cc7-4f3c-f604-08db883cc47c
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 09:44:38.0031
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 4iWv9d+/OM1sB+c4zMCTer2oZvKkHBDC/YphOlV4zXUrUGq7o/3XEVi7AmjTlou13/XwnSY9bMLVLNRXVRIY2Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7404

This is faster than using the software implementation, and the insn is
available on all half-way recent hardware. Use the respective compiler
builtins when available.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Jason Andryuk <jandryuk@gmail.com>

--- a/xen/arch/x86/include/asm/bitops.h
+++ b/xen/arch/x86/include/asm/bitops.h
@@ -475,9 +475,16 @@ static inline int fls(unsigned int x)
  *
  * The Hamming Weight of a number is the total number of bits set in it.
  */
+#ifdef __POPCNT__
+#define hweight64(x) __builtin_popcountll(x)
+#define hweight32(x) __builtin_popcount(x)
+#define hweight16(x) __builtin_popcount((uint16_t)(x))
+#define hweight8(x)  __builtin_popcount((uint8_t)(x))
+#else
 #define hweight64(x) generic_hweight64(x)
 #define hweight32(x) generic_hweight32(x)
 #define hweight16(x) generic_hweight16(x)
 #define hweight8(x) generic_hweight8(x)
+#endif
 
 #endif /* _X86_BITOPS_H */



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 09:45:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 09:45:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565716.884124 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3k1-0003by-Cn; Wed, 19 Jul 2023 09:45:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565716.884124; Wed, 19 Jul 2023 09:45:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3k1-0003br-9g; Wed, 19 Jul 2023 09:45:05 +0000
Received: by outflank-mailman (input) for mailman id 565716;
 Wed, 19 Jul 2023 09:45:04 +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 <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM3k0-0003bN-6t
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 09:45:04 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2060e.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::60e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ee76222a-2618-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 11:45:02 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PR3PR04MB7404.eurprd04.prod.outlook.com (2603:10a6:102:8f::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.23; Wed, 19 Jul
 2023 09:45:00 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 09:45:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ee76222a-2618-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=dMfRo7QmsXgLzIkGLJiZBqwWm9uvS7YFSJkHgKgPmekiOosLniTuIjazDYBEBdjdc5eFrNnTPySgLBvHXosGSki5S6XFBIYdS82ZnEMw0k9SgmBbw3FVYEMlIvVK1SAIRcAho+YrFR2NjmNuQDQeZJqkuPZehauncDO3kppUdMYPcKaSdBk1Hseo036dQOQIxUCxKx2qNTfA2f1VpaaXsJM9JPgMbTVJ2F/JTQpwQJ5zNumvhbQvkInQxY9ONSd3oUovTkajm1Sei2LW11R2+Y6wp/8t1jojDRPGOjbYTGpP1EbkgxuoQC8RGSXPqWg5B+hSe3EuP+bNSG0HYZMiYA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=L7fll069aCOGhw/Ujfnzc7eYrLnddgaGWv3jfKQz64w=;
 b=TsTvQHFqfbgJdU1pB2H+gYAj/GjP66KGw7cvjf7mhCEwE0jQSho4z48PbvaAYmuGoRHIpT4L5HHgP+G4CiiKWnAHi7mzeCZkGAZxJ15cL+bciLyPj3X45n+aRc60XaVbYOtbwosSRES3J8Pqr8P2j+X5Aa3P9rQ+hxLdck67Ewo6W0K9KsJ9+KTgpVlgYr6j/4/68HtvcxnF53ceEpFiTURllAVOuOkTwSnW+//gkUzt3+8b6vLIsGkRRuPa2zpIaoO+dOflq57J8JgILYZC+qVOImSiDKbj0nx5unncD3oQEVmJZdzII0JmuPKrRGQbGcZFQy9EQej0HNtSHoHkcw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=L7fll069aCOGhw/Ujfnzc7eYrLnddgaGWv3jfKQz64w=;
 b=ZUbi4UF51H2B6Msf3kUDA0flYx4UtPGUBlobZ6KYmy5YXqrIIwHUYeOTIlwccQ7speDPK5H0e3vQ6YaHlC4FfSn6nmHIr+JCQDvfoz8hkC7ofl8J2FMRaryiGdo0giBt6g1urkXnTMh3jlFUhkRGPROx2kIe8FdFkfmOBKWn0UTeEjO8keSwyt5kA5oGxE7JkkI6qWP1qU68aMf81qrpejxc9Z1PNLkK5mXWQQ7MaAb0qkXqtb7QBhs4/aZK1EqA2fucQ+r858Qwi00/XJhLs06mjtNyJFx6OLlSmTK+IUbe3WHmfmXOg9u1ivZ6pKv866CwCJRuYl9Gm16tOOINkw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ad0275d3-7146-b695-dfb8-f9269ce30894@suse.com>
Date: Wed, 19 Jul 2023 11:44:58 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v2 4/4] x86: short-circuit certain cpu_has_* when
 x86-64-v{2,3} are in effect
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <dace10da-f108-fbe5-da4f-0e4497f512d9@suse.com>
In-Reply-To: <dace10da-f108-fbe5-da4f-0e4497f512d9@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0113.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a8::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PR3PR04MB7404:EE_
X-MS-Office365-Filtering-Correlation-Id: 70390515-baba-4c7e-f6fa-08db883cd1a9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	SN3FhBNfC/WpRWz1ZOLtGEqbni9fO3DUjCxsEBbddoXmyXwAenS3K428UPeCm4NDBHGfawO1nFP8CjXwau69AEm99bBg0S9f6Aogcw1qoSQU5ilKXbJGd7bArlgdQifUGJKyGDh7Nsq/cogWrbjkT2nxWlmRolSQAPU3QMWsTNnI6InnegBu/VwQX3n9xkiNiBPtE3MfEoAR6Pwbdu1By5y7tVLv+9fcCJtm5TVlNdWVbHtJTbXbmfiMW9Fk1q4dY0Yn8eRyMub8iCoUkRnHRoGNFtdjCxSW461Ju2sZIuPTOEGjJ2ioMiUs1ea0PJ3F3+X0c8WDi2m2LMynq7sxAClXS9kOs1J4nuehPNkOdrSYEofZ/y4EyMvxCtQoB1rixaUJtbtV66gYsxFEuF89/ieFCKUG+K5NZxx0cNYVF41bumJWP+SyeUlXLWCh45kb+JKDyKFF4dt0qDVv4rcT4+cF0NntJKJIGlVR4J2BpQ3h8vzlBRLtsJuTWCGbBMmEGCMKkCG4Pu+l9zLpYozyKNSlhcQ5QxIjfBRDCoNjj15/lboD41ke4L7Upz+VgfgShI9XEHCDsfRjE517TRXDSQyzJiVa8y3lBBjQVxdF/HxS+7K3+ndv/6QOsWcH8nb7hHWdvnyyfudqJgvAAx28Yw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(396003)(136003)(366004)(376002)(451199021)(31686004)(6486002)(478600001)(54906003)(2616005)(36756003)(31696002)(86362001)(2906002)(26005)(6506007)(186003)(6512007)(38100700002)(6916009)(4326008)(66946007)(66556008)(66476007)(316002)(41300700001)(8676002)(5660300002)(8936002)(43740500002)(45980500001);DIR:OUT;SFP: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VHcXk1WUR5?=
 =?utf-8?B?SzlMaGdXM21DVTU4Z2dTdUpjeEUzc3M3RUtaMEtzU1I2Sm1iTzd2c3ZuMlYz?=
 =?utf-8?B?elkzckZBcjg5c1lFNTNtdXZYbndJQUEzYmlYa2t3akwvOWRTTzFDUGFIQkVt?=
 =?utf-8?B?TUhIZDB0YjhNckFvWEUxQlN2MHNuWHVib29tOGtVVFdDdFVPZVhid2hPbDJj?=
 =?utf-8?B?Umw1bE96TEh0aDFiMnQ0eGIrZ0VrYzEvR0JUMDg3WXA5a2FMd2N5Mk9aQ3Rp?=
 =?utf-8?B?Uk1sZGhQMTJrcFlOQkU2L2wxNEQyU3lpbWxJL2NUdjdvejlWMWNLUDBNSmpB?=
 =?utf-8?B?eEMxTEE2T0FrSUdabkxlSHUyRWpHMVJnZXpHdnRYeStRYTJLamMyQmhhSUhK?=
 =?utf-8?B?MFpZeGJPb05mNHNnQW9PYnVGeHhRNUdQbjVXY0xlWnUvaXIrNWtZQlF1eWxi?=
 =?utf-8?Q?M0uhWrNMW4CT6/Z4uPrlG+sxC?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 70390515-baba-4c7e-f6fa-08db883cd1a9
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 09:45:00.0936
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 073F9Jyyrr5fzEQ0sg1wUtBS9fIPMht82CF5vbPhn22m3nV/698GjRkyB854yGz8IT5TFvepkiMFaQoeSV+DlA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7404

Certain fallback code can be made subject to DCE this way. Note that
CX16 has no compiler provided manifest constant, so CONFIG_* are used
there instead. Note also that we don't have cpu_has_movbe nor
cpu_has_lzcnt (aka cpu_has_abm).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Of course we could use IS_ENABLED(CONFIG_X86_64_V<n>) everywhere, but as
CX16 shows this isn't necessarily better than the #if/#else approach
based on compiler-provided manifest symbols. While not really intended
to be used that way, it looks as if we could also use
IS_ENABLED(__POPCNT__) and alike if we thought this would end up neater
(because of avoiding the #ifdef).

We could go further and also short-circuit SSE*, AVX and alike, which we
don't use outside of the emulator. This then would of course call for
also having a way to select x86-64-v4.
---
v2: Also cover XSAVE.

--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -76,15 +76,25 @@ static inline bool boot_cpu_has(unsigned
 #define cpu_has_eist            boot_cpu_has(X86_FEATURE_EIST)
 #define cpu_has_ssse3           boot_cpu_has(X86_FEATURE_SSSE3)
 #define cpu_has_fma             boot_cpu_has(X86_FEATURE_FMA)
-#define cpu_has_cx16            boot_cpu_has(X86_FEATURE_CX16)
+#define cpu_has_cx16            (IS_ENABLED(CONFIG_X86_64_V2) || \
+                                 IS_ENABLED(CONFIG_X86_64_V3) || \
+                                 boot_cpu_has(X86_FEATURE_CX16))
 #define cpu_has_pdcm            boot_cpu_has(X86_FEATURE_PDCM)
 #define cpu_has_pcid            boot_cpu_has(X86_FEATURE_PCID)
 #define cpu_has_sse4_1          boot_cpu_has(X86_FEATURE_SSE4_1)
 #define cpu_has_sse4_2          boot_cpu_has(X86_FEATURE_SSE4_2)
 #define cpu_has_x2apic          boot_cpu_has(X86_FEATURE_X2APIC)
+#ifdef __POPCNT__
+#define cpu_has_popcnt          true
+#else
 #define cpu_has_popcnt          boot_cpu_has(X86_FEATURE_POPCNT)
+#endif
 #define cpu_has_aesni           boot_cpu_has(X86_FEATURE_AESNI)
+#ifdef __XSAVE__
+#define cpu_has_xsave           true
+#else
 #define cpu_has_xsave           boot_cpu_has(X86_FEATURE_XSAVE)
+#endif
 #define cpu_has_avx             boot_cpu_has(X86_FEATURE_AVX)
 #define cpu_has_f16c            boot_cpu_has(X86_FEATURE_F16C)
 #define cpu_has_rdrand          boot_cpu_has(X86_FEATURE_RDRAND)
@@ -114,11 +124,19 @@ static inline bool boot_cpu_has(unsigned
 #define cpu_has_xsaves          boot_cpu_has(X86_FEATURE_XSAVES)
 
 /* CPUID level 0x00000007:0.ebx */
+#ifdef __BMI__
+#define cpu_has_bmi1            true
+#else
 #define cpu_has_bmi1            boot_cpu_has(X86_FEATURE_BMI1)
+#endif
 #define cpu_has_hle             boot_cpu_has(X86_FEATURE_HLE)
 #define cpu_has_avx2            boot_cpu_has(X86_FEATURE_AVX2)
 #define cpu_has_smep            boot_cpu_has(X86_FEATURE_SMEP)
+#ifdef __BMI2__
+#define cpu_has_bmi2            true
+#else
 #define cpu_has_bmi2            boot_cpu_has(X86_FEATURE_BMI2)
+#endif
 #define cpu_has_invpcid         boot_cpu_has(X86_FEATURE_INVPCID)
 #define cpu_has_rtm             boot_cpu_has(X86_FEATURE_RTM)
 #define cpu_has_pqe             boot_cpu_has(X86_FEATURE_PQE)



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 09:46:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 09:46:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565719.884134 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3lA-0004GR-MU; Wed, 19 Jul 2023 09:46:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565719.884134; Wed, 19 Jul 2023 09:46:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3lA-0004GK-JM; Wed, 19 Jul 2023 09:46:16 +0000
Received: by outflank-mailman (input) for mailman id 565719;
 Wed, 19 Jul 2023 09:46:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=K8L3=DF=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qM3l8-0004G6-Vy
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 09:46:15 +0000
Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com
 [2607:f8b0:4864:20::f35])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 19127ded-2619-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 11:46:13 +0200 (CEST)
Received: by mail-qv1-xf35.google.com with SMTP id
 6a1803df08f44-634f59e7d47so36651106d6.2
 for <xen-devel@lists.xenproject.org>; Wed, 19 Jul 2023 02:46:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 19127ded-2619-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689759972; x=1690364772;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=QIC5XWMIY4srebN43oLmEIGgSwbY2kIXDCSH1F1uzp8=;
        b=Opt3aQkMYsoC3EcMK8+5hSqp0GjLcjEbgPJwXZ9FjBh+o+0FPKgVxbQKhhJyKHmZcF
         GSZDzC8DD6v59x0NEN8yF9GhIzbvaMaLm23ZX9Ouv3dAWnYT+4vlHiJlYTd+dEoFfE1Q
         bMdSrLSLaabYuH+BjjEzl0y1ZXKV7FiY+LYReEdHGkO6VQeTWybiduVyqdPynPmn0aIi
         H/O0IFnxCilWeYoLdWFWAPJrUFQF5AzTUbAHoBN4tdUXeO+1K0YJb+KHvBfJaFuTuAbs
         oxQp0iB3yRDRpBHEqYKKilD1C1eJXzZ6w03gzon/ICrQv4spKocpIOQ1qpjWi4YCMowH
         KbhA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689759972; x=1690364772;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=QIC5XWMIY4srebN43oLmEIGgSwbY2kIXDCSH1F1uzp8=;
        b=YqzOa32lt5kEPbshDp9gWFjNqxVVbuaP0kUyzbYisgTCS5GIdHL7KJIAua7nOOR8nq
         gO7GmwO6aX2lX8Bzs5uwQZkYMXnBZrNtHyAzYEwPKSBR5vjZ4jxHPlZeXU+5RYzqZ5bu
         UiEaKHXxvlNF0l3d1OMdWef2aBD8Y/cWEE9pym+GaKR2dE5uQRAso6euR7jB60JZl/A2
         nECwXsopZZX9A9USC0eQXw3BuffDYhouOQRH/kmudxSKGlmYUI09rHtTV4BmD3zv2Wk2
         1YV0Cwv46VXlJaHcvcxynlvvxx2x3BfbOKpkq0Z5nlRfnIL9NQFlO+tvDqP6gldaUodh
         ixbA==
X-Gm-Message-State: ABy/qLZucgE6REk4rFp3/5JhLl1rrFaOEMT385Mr/Dj04GgNUopSH5/s
	dWItmDZy9Zn4+KAEXxTrgipO6MoaO9phV6Vz+MdZbjuwFnEgxSyl
X-Google-Smtp-Source: APBJJlGD23QcP3bVnQEYNIahp0B64HJ6gwqAxNi1RMBEARRZmOTszNffCcPJzG08aVH46veJwa9yX9GHlMkuA6LOvZg=
X-Received: by 2002:a0c:e093:0:b0:636:60c6:203d with SMTP id
 l19-20020a0ce093000000b0063660c6203dmr4923928qvk.35.1689759972616; Wed, 19
 Jul 2023 02:46:12 -0700 (PDT)
MIME-Version: 1.0
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-14-jens.wiklander@linaro.org> <88B6CFB1-81B3-4B55-AF8E-2BA8970CA5BB@arm.com>
In-Reply-To: <88B6CFB1-81B3-4B55-AF8E-2BA8970CA5BB@arm.com>
From: Jens Wiklander <jens.wiklander@linaro.org>
Date: Wed, 19 Jul 2023 11:46:01 +0200
Message-ID: <CAHUa44G8BkcWv6HSnDW6uMQYSaCrTqoN9YdL9rkWRvDnvqNGzg@mail.gmail.com>
Subject: Re: [XEN PATCH v10 13/24] xen/arm: ffa: support mapping guest RX/TX buffers
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, 
	Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>, 
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici <Marc.Bonnici@arm.com>, 
	Achin Gupta <Achin.Gupta@arm.com>, Andrew Cooper <andrew.cooper3@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Bertrand,

On Tue, Jul 18, 2023 at 12:10=E2=80=AFPM Bertrand Marquis
<Bertrand.Marquis@arm.com> wrote:
>
> Hi Jens,
>
> > On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> wr=
ote:
> >
> > Adds support in the mediator to map and unmap the RX and TX buffers
> > provided by the guest using the two FF-A functions FFA_RXTX_MAP and
> > FFA_RXTX_UNMAP.
> >
> > These buffer are later used to transmit data that cannot be passed in
> > registers only.
> >
> > Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> > ---
> > xen/arch/arm/tee/ffa.c | 138 +++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 138 insertions(+)
> >
> > diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> > index d755363de686..ffabb5ed0a80 100644
> > --- a/xen/arch/arm/tee/ffa.c
> > +++ b/xen/arch/arm/tee/ffa.c
> > @@ -74,6 +74,12 @@
> >  */
> > #define FFA_RXTX_PAGE_COUNT             1
> >
> > +/*
> > + * Limits the number of pages RX/TX buffers guests can map.
>
> Typo: s/Limits/Limit/

OK

>
> > + * TODO support a larger number.
> > + */
> > +#define FFA_MAX_RXTX_PAGE_COUNT         1
> > +
> > /*
> >  * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
> >  * BIT(31): Framework or partition message
> > @@ -169,6 +175,12 @@ struct ffa_partition_info_1_1 {
> > };
> >
> > struct ffa_ctx {
> > +    void *rx;
> > +    const void *tx;
> > +    struct page_info *rx_pg;
> > +    struct page_info *tx_pg;
> > +    /* Number of 4kB pages in each of rx/rx_pg and tx/tx_pg */
> > +    unsigned int page_count;
> >     /* FF-A version used by the guest */
> >     uint32_t guest_vers;
> >     /*
> > @@ -176,6 +188,7 @@ struct ffa_ctx {
> >      * ffa_domain_teardown() to know which SPs need to be signalled.
> >      */
> >     uint16_t create_signal_count;
> > +    bool rx_is_free;
> > };
> >
> > /* Negotiated FF-A version to use with the SPMC */
> > @@ -371,6 +384,11 @@ static void set_regs(struct cpu_user_regs *regs, r=
egister_t v0, register_t v1,
> >         set_user_reg(regs, 7, v7);
> > }
> >
> > +static void set_regs_error(struct cpu_user_regs *regs, uint32_t error_=
code)
> > +{
> > +    set_regs(regs, FFA_ERROR, 0, error_code, 0, 0, 0, 0, 0);
> > +}
> > +
> > static void set_regs_success(struct cpu_user_regs *regs, uint32_t w2,
> >                              uint32_t w3)
> > {
> > @@ -392,6 +410,106 @@ static void handle_version(struct cpu_user_regs *=
regs)
> >     set_regs(regs, vers, 0, 0, 0, 0, 0, 0, 0);
> > }
> >
> > +static uint32_t handle_rxtx_map(uint32_t fid, register_t tx_addr,
> > +                                register_t rx_addr, uint32_t page_coun=
t)
> > +{
> > +    uint32_t ret =3D FFA_RET_INVALID_PARAMETERS;
> > +    struct domain *d =3D current->domain;
> > +    struct ffa_ctx *ctx =3D d->arch.tee;
> > +    struct page_info *tx_pg;
> > +    struct page_info *rx_pg;
> > +    p2m_type_t t;
> > +    void *rx;
> > +    void *tx;
> > +
> > +    if ( !smccc_is_conv_64(fid) )
> > +    {
> > +        /*
> > +         * Calls using the 32-bit calling convention must ignore the u=
pper
> > +         * 32 bits in the argument registers.
> > +         */
> > +        tx_addr &=3D UINT32_MAX;
> > +        rx_addr &=3D UINT32_MAX;
> > +    }
> > +
> > +    if ( page_count > FFA_MAX_RXTX_PAGE_COUNT )
> > +    {
> > +        printk(XENLOG_ERR "ffa: RXTX_MAP: error: %u pages requested (l=
imit %u)\n",
> > +               page_count, FFA_MAX_RXTX_PAGE_COUNT);
> > +        return FFA_RET_NOT_SUPPORTED;
> > +    }
> > +
> > +    /* Already mapped */
> > +    if ( ctx->rx )
> > +        return FFA_RET_DENIED;
> > +
> > +    tx_pg =3D get_page_from_gfn(d, gfn_x(gaddr_to_gfn(tx_addr)), &t, P=
2M_ALLOC);
> > +    if ( !tx_pg )
> > +        return FFA_RET_INVALID_PARAMETERS;
>
> Please add a newline here

OK

>
> > +    /* Only normal RW RAM for now */
> > +    if ( t !=3D p2m_ram_rw )
> > +        goto err_put_tx_pg;
> > +
> > +    rx_pg =3D get_page_from_gfn(d, gfn_x(gaddr_to_gfn(rx_addr)), &t, P=
2M_ALLOC);
> > +    if ( !tx_pg )
> > +        goto err_put_tx_pg;
>
> Please add a newline here

OK

Thanks,
Jens

>
> > +    /* Only normal RW RAM for now */
> > +    if ( t !=3D p2m_ram_rw )
> > +        goto err_put_rx_pg;
> > +
> > +    tx =3D __map_domain_page_global(tx_pg);
> > +    if ( !tx )
> > +        goto err_put_rx_pg;
> > +
> > +    rx =3D __map_domain_page_global(rx_pg);
> > +    if ( !rx )
> > +        goto err_unmap_tx;
> > +
> > +    ctx->rx =3D rx;
> > +    ctx->tx =3D tx;
> > +    ctx->rx_pg =3D rx_pg;
> > +    ctx->tx_pg =3D tx_pg;
> > +    ctx->page_count =3D page_count;
> > +    ctx->rx_is_free =3D true;
> > +    return FFA_RET_OK;
> > +
> > +err_unmap_tx:
> > +    unmap_domain_page_global(tx);
> > +err_put_rx_pg:
> > +    put_page(rx_pg);
> > +err_put_tx_pg:
> > +    put_page(tx_pg);
> > +
> > +    return ret;
> > +}
> > +
> > +static void rxtx_unmap(struct ffa_ctx *ctx)
> > +{
> > +    unmap_domain_page_global(ctx->rx);
> > +    unmap_domain_page_global(ctx->tx);
> > +    put_page(ctx->rx_pg);
> > +    put_page(ctx->tx_pg);
> > +    ctx->rx =3D NULL;
> > +    ctx->tx =3D NULL;
> > +    ctx->rx_pg =3D NULL;
> > +    ctx->tx_pg =3D NULL;
> > +    ctx->page_count =3D 0;
> > +    ctx->rx_is_free =3D false;
> > +}
> > +
> > +static uint32_t handle_rxtx_unmap(void)
> > +{
> > +    struct domain *d =3D current->domain;
> > +    struct ffa_ctx *ctx =3D d->arch.tee;
> > +
> > +    if ( !ctx->rx )
> > +        return FFA_RET_INVALID_PARAMETERS;
> > +
> > +    rxtx_unmap(ctx);
> > +
> > +    return FFA_RET_OK;
> > +}
> > +
> > static void handle_msg_send_direct_req(struct cpu_user_regs *regs, uint=
32_t fid)
> > {
> >     struct arm_smccc_1_2_regs arg =3D { .a0 =3D fid, };
> > @@ -448,6 +566,7 @@ static bool ffa_handle_call(struct cpu_user_regs *r=
egs)
> >     uint32_t fid =3D get_user_reg(regs, 0);
> >     struct domain *d =3D current->domain;
> >     struct ffa_ctx *ctx =3D d->arch.tee;
> > +    int e;
> >
> >     if ( !ctx )
> >         return false;
> > @@ -460,6 +579,22 @@ static bool ffa_handle_call(struct cpu_user_regs *=
regs)
> >     case FFA_ID_GET:
> >         set_regs_success(regs, get_vm_id(d), 0);
> >         return true;
> > +    case FFA_RXTX_MAP_32:
> > +    case FFA_RXTX_MAP_64:
> > +        e =3D handle_rxtx_map(fid, get_user_reg(regs, 1), get_user_reg=
(regs, 2),
> > +                            get_user_reg(regs, 3));
> > +        if ( e )
> > +            set_regs_error(regs, e);
> > +        else
> > +            set_regs_success(regs, 0, 0);
> > +        return true;
> > +    case FFA_RXTX_UNMAP:
> > +        e =3D handle_rxtx_unmap();
> > +        if ( e )
> > +            set_regs_error(regs, e);
> > +        else
> > +            set_regs_success(regs, 0, 0);
> > +        return true;
> >     case FFA_MSG_SEND_DIRECT_REQ_32:
> >     case FFA_MSG_SEND_DIRECT_REQ_64:
> >         handle_msg_send_direct_req(regs, fid);
> > @@ -551,6 +686,9 @@ static int ffa_domain_teardown(struct domain *d)
> >                    get_vm_id(d), subscr_vm_destroyed[n], res);
> >     }
> >
> > +    if ( ctx->rx )
> > +        rxtx_unmap(ctx);
> > +
> >     XFREE(d->arch.tee);
> >
> >     return 0;
> > --
> > 2.34.1
> >
>
> Cheers
> Bertrand
>
>


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 09:50:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 09:50:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565723.884143 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3pE-00060i-Aa; Wed, 19 Jul 2023 09:50:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565723.884143; Wed, 19 Jul 2023 09:50:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3pE-00060b-7t; Wed, 19 Jul 2023 09:50:28 +0000
Received: by outflank-mailman (input) for mailman id 565723;
 Wed, 19 Jul 2023 09:50:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qM3pD-00060U-Ab
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 09:50:27 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qM3pC-0006Yq-9Y; Wed, 19 Jul 2023 09:50:26 +0000
Received: from 54-240-197-228.amazon.com ([54.240.197.228]
 helo=[192.168.5.130]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qM3pC-00041w-2l; Wed, 19 Jul 2023 09:50:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=0wXBCIXZjnVGIQv6/az3CVLZz5KL5jlhAYynZtTHwzQ=; b=G8f53cZlEsOM4U+A17WSA/P/cY
	UyBGmX+uRlTbqC+Zfa/n6Y/84gj4yYGEAJrX/LfGQ1GcQb69aMbW4rV5/3YqMPgcwpoNkaW047zpE
	+oFFDXE9Qk5sVbIyawEqPxS4MrI/DWoRTcKCkKtHUC+IGUcUsrs699Qmq/GDm+X30LGc=;
Message-ID: <4dd81092-af9e-016b-9d28-440d39a02723@xen.org>
Date: Wed, 19 Jul 2023 10:50:23 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable
 inside a macro
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <d06a312944bee7457fa2ac75e0cfef20f0ec430f.1689329728.git.nicola.vetrini@bugseng.com>
 <76cb0f23-ebcb-2c51-2312-c926b0d6d570@xen.org>
 <8617ddae-02f6-981f-73fc-50be2e24ea64@xen.org>
 <4748db4d-d0d7-142c-b547-c285ceb1357c@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <4748db4d-d0d7-142c-b547-c285ceb1357c@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 19/07/2023 09:54, Nicola Vetrini wrote:
> 
> 
> On 17/07/23 22:45, Julien Grall wrote:
>>
>>
>> On 17/07/2023 21:40, Julien Grall wrote:
>>> On 14/07/2023 12:49, Nicola Vetrini wrote:
>>>> The macro 'testop' expands to a function that declares the local
>>>> variable 'oldbit', which is written before being set, but is such a
>>>> way that is not amenable to automatic checking.
>>>>
>>>> Therefore, a deviation comment, is introduced to document this 
>>>> situation.
>>>>
>>>> A similar reasoning applies to macro 'guest_testop'.
>>>
>>> Would you be able to check if the code below (only compile tested so 
>>> far) would silence Eclair?
>>
>> Hmmm.. I think my e-mail client mangled the diff. Here an unmangled 
>> version if needed:
>>
>> http://paste.debian.net/1286154/
>>
>> Cheers,
>>
> 
> I have a question: wouldn't this patch also imply an update of 
> xen/arch/arm/include/asm/guest_atomics.h ?
> 
> This in particular is the bit of code that needs to be reworked to use 
> the newer *_timeout definition.

My patch is not changing the exported *_timeout. It is only changing the 
definition of int_##name which is not exported.

But I have realized that one chunk were missing. Here the new version:

https://paste.debian.net/1286311/

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 09:59:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 09:59:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565728.884154 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3xW-0006s6-3x; Wed, 19 Jul 2023 09:59:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565728.884154; Wed, 19 Jul 2023 09:59:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM3xW-0006rz-0l; Wed, 19 Jul 2023 09:59:02 +0000
Received: by outflank-mailman (input) for mailman id 565728;
 Wed, 19 Jul 2023 09:59:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=K8L3=DF=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qM3xV-0006rt-AI
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 09:59:01 +0000
Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com
 [2607:f8b0:4864:20::f32])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e1c78cb8-261a-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 11:59:00 +0200 (CEST)
Received: by mail-qv1-xf32.google.com with SMTP id
 6a1803df08f44-635dc2f6ef9so41403176d6.3
 for <xen-devel@lists.xenproject.org>; Wed, 19 Jul 2023 02:58:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e1c78cb8-261a-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689760739; x=1690365539;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=GLIi/2d0xR4KmfyRsQNMJ5p+P91jQVTkA+B7bEUNLtg=;
        b=D+YuGmiG46sGauLDBNP9U80we0ZOY5cQtJQCJPFN9+RC156xB9ahcJItplmNlZSKKP
         8LwmbVJbK7LWU9QpdI21teCk9npTIL435awNFNIELvKIFbfIMGN/auD1MfVewkXavrsz
         zld+dsy5zyHeXqm19hXBrO2ru6WdibvUwcUGKuv37B3vSbydjtZ1rsRQUMdvkNaIZFqh
         Kob0QX+V29pX8l4mHYnRV+gPj0EVTaBmXLLIoVyMA8VvxcfEf6z3sKtgBAgGXxNGVJ2h
         BB16VN/XqDTBq5B+6/KCf5FMmSjuf6BKxQmsAaEl8ZIdUF5MA0hNFXOEAAs8AdgA25y7
         wHng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689760739; x=1690365539;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=GLIi/2d0xR4KmfyRsQNMJ5p+P91jQVTkA+B7bEUNLtg=;
        b=C8VyArYjQfErt7tUvDai2WpIc2TXArYWvZaQ5pm02wJgDaAHk5SsQdfcfW9wQWoMaL
         8uOZ/yD98uKMoVmci8X6XQtVTZyb0cITJimgAEk2uB17B0M0pmTqm/C1YHgrxPB/0xIy
         BLyIkT9vYLGb65aBI6wH559xdkXmGH1WzmEaWqWNyOCzU+6hXpcMXhMxmCq68uql4XMV
         ebmHAzPmTnMg11atXrhLAwySNT06cuX+0ZXsAqwLr9rtbtpUoXLoCCSK016EFJd6fckn
         9iWxxevLrX5VRl5RT0SnRBAFIdSFUcNcn+MBXvjDWHf65u/Eu/PAFT3p0ObnKpUSRvpN
         j7YA==
X-Gm-Message-State: ABy/qLZqzZPtg6Ef6SMnzytAzLiqKsCX6r4GTScz9dL3znUH6u3xt8gW
	AqtonUxRnig7W/oCUSQcWcFKzaWVx4pM2tPJS8LDpA==
X-Google-Smtp-Source: APBJJlElJAnCU/3QrXegPttCzz1Hrvs58PavS8bgcALJyG5olU9/01gmNaLyzPs8VM1tMJp3c83mGFpr4KdVdWgeZag=
X-Received: by 2002:a0c:d802:0:b0:635:fa7b:6c22 with SMTP id
 h2-20020a0cd802000000b00635fa7b6c22mr16347642qvj.55.1689760738851; Wed, 19
 Jul 2023 02:58:58 -0700 (PDT)
MIME-Version: 1.0
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-15-jens.wiklander@linaro.org> <D09E02DC-DE2A-4876-B5E7-10DD131EC98F@arm.com>
In-Reply-To: <D09E02DC-DE2A-4876-B5E7-10DD131EC98F@arm.com>
From: Jens Wiklander <jens.wiklander@linaro.org>
Date: Wed, 19 Jul 2023 11:58:47 +0200
Message-ID: <CAHUa44FOR2cqcdF8Sw-U4v05XRWNnLy8xurjyCM4euZqTcrm7g@mail.gmail.com>
Subject: Re: [XEN PATCH v10 14/24] xen/arm: ffa: support guest FFA_PARTITION_INFO_GET
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, 
	Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>, 
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici <Marc.Bonnici@arm.com>, 
	Achin Gupta <Achin.Gupta@arm.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 18, 2023 at 12:22=E2=80=AFPM Bertrand Marquis
<Bertrand.Marquis@arm.com> wrote:
>
> Hi Jens,
>
> > On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> wr=
ote:
> >
> > Adds support in the mediator to handle FFA_PARTITION_INFO_GET requests
> > from a guest. The requests are forwarded to the SPMC and the response i=
s
> > translated according to the FF-A version in use by the guest.
> >
> > Using FFA_PARTITION_INFO_GET changes the owner of the RX buffer to the
> > caller (the guest in this case), so once it is done with the buffer it
> > must be released using FFA_RX_RELEASE before another call can be made.
> >
> > Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> > ---
> > xen/arch/arm/tee/ffa.c | 131 +++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 131 insertions(+)
> >
> > diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> > index ffabb5ed0a80..d5748b9ce88c 100644
> > --- a/xen/arch/arm/tee/ffa.c
> > +++ b/xen/arch/arm/tee/ffa.c
> > @@ -166,7 +166,18 @@
> > #define FFA_MSG_SEND                    0x8400006EU
> > #define FFA_MSG_POLL                    0x8400006AU
> >
> > +/*
> > + * Structs below ending with _1_0 are defined in FF-A-1.0-REL and
> > + * struct ending with _1_1 are defined in FF-A-1.1-REL0.
>
> Nit: For coherency, second line should be "Structs" instead of "struct"

OK

>
> > + */
> > +
> > /* Partition information descriptor */
> > +struct ffa_partition_info_1_0 {
> > +    uint16_t id;
> > +    uint16_t execution_context;
> > +    uint32_t partition_properties;
> > +};
> > +
> > struct ffa_partition_info_1_1 {
> >     uint16_t id;
> >     uint16_t execution_context;
> > @@ -189,6 +200,7 @@ struct ffa_ctx {
> >      */
> >     uint16_t create_signal_count;
> >     bool rx_is_free;
> > +    spinlock_t lock;
> > };
> >
> > /* Negotiated FF-A version to use with the SPMC */
> > @@ -203,9 +215,15 @@ static uint16_t subscr_vm_destroyed_count __read_m=
ostly;
> > /*
> >  * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
> >  * number of pages used in each of these buffers.
> > + *
> > + * The RX buffer is protected from concurrent usage with ffa_rx_buffer=
_lock.
> > + * Note that the SPMC is also tracking the ownership of our RX buffer =
so
> > + * for calls which uses our RX buffer to deliver a result we must call
> > + * ffa_rx_release() to let the SPMC know that we're done with the buff=
er.
> >  */
> > static void *ffa_rx __read_mostly;
> > static void *ffa_tx __read_mostly;
> > +static DEFINE_SPINLOCK(ffa_rx_buffer_lock);
> >
> > static bool ffa_get_version(uint32_t *vers)
> > {
> > @@ -510,6 +528,100 @@ static uint32_t handle_rxtx_unmap(void)
> >     return FFA_RET_OK;
> > }
> >
> > +static int32_t handle_partition_info_get(uint32_t w1, uint32_t w2, uin=
t32_t w3,
> > +                                         uint32_t w4, uint32_t w5,
> > +                                         uint32_t *count)
> > +{
> > +    int32_t ret =3D FFA_RET_DENIED;
> > +    struct domain *d =3D current->domain;
> > +    struct ffa_ctx *ctx =3D d->arch.tee;
> > +
> > +    /*
> > +     * FF-A v1.0 has w5 MBZ while v1.1 allows
> > +     * FFA_PARTITION_INFO_GET_COUNT_FLAG to be non-zero.
> > +     */
>
> You should add something to say that the INFO_GET_COUNT does
> not use the rxtx buffer to explain why you do the call directly in this c=
ase.
>
> Reading the code as is, on might wonder why this case is different.
>
> How about:
> FFA_PARTITION_INFO_GET_COUNT is only using registers and not
> the rxtx buffer so do the partition_info_get directly.

OK, I'll add it.

Thanks,
Jens

>
> > +    if ( w5 =3D=3D FFA_PARTITION_INFO_GET_COUNT_FLAG &&
> > +         ctx->guest_vers =3D=3D FFA_VERSION_1_1 )
> > +        return ffa_partition_info_get(w1, w2, w3, w4, w5, count);
> > +    if ( w5 )
> > +        return FFA_RET_INVALID_PARAMETERS;
> > +
> > +    if ( !ffa_rx )
> > +        return FFA_RET_DENIED;
> > +
> > +    spin_lock(&ctx->lock);
> > +    if ( !ctx->page_count || !ctx->rx_is_free )
> > +        goto out;
> > +    spin_lock(&ffa_rx_buffer_lock);
> > +    ret =3D ffa_partition_info_get(w1, w2, w3, w4, w5, count);
> > +    if ( ret )
> > +        goto out_rx_buf_unlock;
> > +    /*
> > +     * ffa_partition_info_get() succeeded so we now own the RX buffer =
we
> > +     * share with the SPMC. We must give it back using ffa_rx_release(=
)
> > +     * once we've copied the content.
> > +     */
> > +
> > +    if ( ctx->guest_vers =3D=3D FFA_VERSION_1_0 )
> > +    {
> > +        size_t n;
> > +        struct ffa_partition_info_1_1 *src =3D ffa_rx;
> > +        struct ffa_partition_info_1_0 *dst =3D ctx->rx;
> > +
> > +        if ( ctx->page_count * FFA_PAGE_SIZE < *count * sizeof(*dst) )
> > +        {
> > +            ret =3D FFA_RET_NO_MEMORY;
> > +            goto out_rx_release;
> > +        }
> > +
> > +        for ( n =3D 0; n < *count; n++ )
> > +        {
> > +            dst[n].id =3D src[n].id;
> > +            dst[n].execution_context =3D src[n].execution_context;
> > +            dst[n].partition_properties =3D src[n].partition_propertie=
s;
> > +        }
> > +    }
> > +    else
> > +    {
> > +        size_t sz =3D *count * sizeof(struct ffa_partition_info_1_1);
> > +
> > +        if ( ctx->page_count * FFA_PAGE_SIZE < sz )
> > +        {
> > +            ret =3D FFA_RET_NO_MEMORY;
> > +            goto out_rx_release;
> > +        }
> > +
> > +
> > +        memcpy(ctx->rx, ffa_rx, sz);
> > +    }
> > +    ctx->rx_is_free =3D false;
> > +out_rx_release:
> > +    ffa_rx_release();
> > +out_rx_buf_unlock:
> > +    spin_unlock(&ffa_rx_buffer_lock);
> > +out:
> > +    spin_unlock(&ctx->lock);
> > +
> > +    return ret;
> > +}
> > +
> > +static int32_t handle_rx_release(void)
> > +{
> > +    int32_t ret =3D FFA_RET_DENIED;
> > +    struct domain *d =3D current->domain;
> > +    struct ffa_ctx *ctx =3D d->arch.tee;
> > +
> > +    spin_lock(&ctx->lock);
> > +    if ( !ctx->page_count || ctx->rx_is_free )
> > +        goto out;
> > +    ret =3D FFA_RET_OK;
> > +    ctx->rx_is_free =3D true;
> > +out:
> > +    spin_unlock(&ctx->lock);
> > +
> > +    return ret;
> > +}
> > +
> > static void handle_msg_send_direct_req(struct cpu_user_regs *regs, uint=
32_t fid)
> > {
> >     struct arm_smccc_1_2_regs arg =3D { .a0 =3D fid, };
> > @@ -566,6 +678,7 @@ static bool ffa_handle_call(struct cpu_user_regs *r=
egs)
> >     uint32_t fid =3D get_user_reg(regs, 0);
> >     struct domain *d =3D current->domain;
> >     struct ffa_ctx *ctx =3D d->arch.tee;
> > +    uint32_t count;
> >     int e;
> >
> >     if ( !ctx )
> > @@ -595,6 +708,24 @@ static bool ffa_handle_call(struct cpu_user_regs *=
regs)
> >         else
> >             set_regs_success(regs, 0, 0);
> >         return true;
> > +    case FFA_PARTITION_INFO_GET:
> > +        e =3D handle_partition_info_get(get_user_reg(regs, 1),
> > +                                      get_user_reg(regs, 2),
> > +                                      get_user_reg(regs, 3),
> > +                                      get_user_reg(regs, 4),
> > +                                      get_user_reg(regs, 5), &count);
> > +        if ( e )
> > +            set_regs_error(regs, e);
> > +        else
> > +            set_regs_success(regs, count, 0);
> > +        return true;
> > +    case FFA_RX_RELEASE:
> > +        e =3D handle_rx_release();
> > +        if ( e )
> > +            set_regs_error(regs, e);
> > +        else
> > +            set_regs_success(regs, 0, 0);
> > +        return true;
> >     case FFA_MSG_SEND_DIRECT_REQ_32:
> >     case FFA_MSG_SEND_DIRECT_REQ_64:
> >         handle_msg_send_direct_req(regs, fid);
> > --
> > 2.34.1
> >
>
> Cheers
> Bertrand
>


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 10:05:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 10:05:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565731.884165 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM43b-0008Qx-Rf; Wed, 19 Jul 2023 10:05:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565731.884165; Wed, 19 Jul 2023 10:05:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM43b-0008Qq-Mc; Wed, 19 Jul 2023 10:05:19 +0000
Received: by outflank-mailman (input) for mailman id 565731;
 Wed, 19 Jul 2023 10:05:18 +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
 <SRS0=fyAl=DF=citrix.com=prvs=55726f7b7=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qM43a-0008Qk-PP
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 10:05:18 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bfb66566-261b-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 12:05:14 +0200 (CEST)
Received: from mail-dm6nam12lp2168.outbound.protection.outlook.com (HELO
 NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.168])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 19 Jul 2023 06:05:10 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by SJ0PR03MB5919.namprd03.prod.outlook.com (2603:10b6:a03:2d8::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Wed, 19 Jul
 2023 10:05:04 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 10:05:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bfb66566-261b-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689761114;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=sUTJyKDTTHbwqMzisdbhNUa16spItvBINFV6D0pAn+8=;
  b=LJPhvKxk80HbXStlaxbmRhRZep6D8hwsILlPc5pj+Au8hYuB8sfstJK8
   XOhXMYZ51RZszlchNDCqDrAyBCnzYbbiFmiHus9DN0GGqq5Jy7f57zFEL
   2ITce00w9FCs/RXo46R2XGe/d8tsfYAaIIhGsvHJGN4XdoqTjE5xO6OrF
   o=;
X-IronPort-RemoteIP: 104.47.59.168
X-IronPort-MID: 116733452
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:azNzLqooKLvhjRXYxSM2jGMcOw5eBmI1ZBIvgKrLsJaIsI4StFCzt
 garIBnSParbNjDxf4okYNyz804DvJ7Tz983S1Rk/iBhEipHo5uZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weBzihNVfrzGInqR5fGatgMdgKFb
 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo
 OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay
 RAXACtQVRHd2b2H+fGAFNYzge4oAsXpOKpK7xmMzRmBZRonabbqZvyQoPN9gnI3jM0IGuvCb
 c0EbzYpdA7HfxBEJlYQDtQ5gfusgX78NTZfrTp5p4JuuzSVkFM3jemraYSFEjCJbZw9ckKwj
 2TK5WnmRDodM8SS02Gt+XOwnO7f2yj8Xer+EZXhr6A12wbPmzZ75Bs+bFC7/KeWsmeCfcsOE
 khTqhss9/lp6xn+JjX6d1jiyJKehTYeUddNF+wx6CmW17HZpQ2eAwAsXjNHLdArqsIybTgrz
 UOS2cPkAyR1t7+YQm7b8a2bxRutPQAFIGlEYjULJTbp+PHmqYA3yx7KENBqFffvisWvQG+gh
 TeXsCI5mrMfy9YR0Lm29kzGhDTqoYXVSgky5UPcWWfNAh5FWbNJrreAsTDzhcus5q7AJrVdl
 BDoQ/Sj0d0=
IronPort-HdrOrdr: A9a23:pudJl6mFHAb6wWDPBmD7ALEgTAXpDfIH3DAbv31ZSRFFG/Fw9v
 re+cjzsCWf5Qr5N0tNpTntAsa9qArnhOdICOoqTNWftWvd2FdARbsKhbcKpQePJ8SUzJ8/6U
 4PSclD4erLfDxHZJbBizVQy+xQu+VvKprY49s2Ek0dKj2Ct5sQlzuR1DzraHFLeA==
X-Talos-CUID: 9a23:FX3+VG7Y4Oy5pON8bdss7xMvG557LUzkj0yOHBC/I21HRL+RYArF
X-Talos-MUID: =?us-ascii?q?9a23=3AsQN7yQ6KKr63ZiRy/UGXUeELxoxR6KTzVm81uKk?=
 =?us-ascii?q?gopi9MWsgCjXH3W+oF9o=3D?=
X-IronPort-AV: E=Sophos;i="6.01,216,1684814400"; 
   d="scan'208";a="116733452"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=DOqNXjY/Ds9ikYpbkX/7o3XJWl2Kv8Uns1YqWLjTiWklQUPEr+bkhVzmRwvMpW88WUqX33WUSb/k4ZPU0r2Cqu2QtW5lYemB9SEgNeCiP7q+OIEVUZqIKIWhFBWSdmzKOGqXxnJSLkzu3R6VKPVi0qwuHy1nBWUPuNzR6eJxuVs1ULSI4iyP7J0QkS+Ke83/lFqzEPSOLJPsEarM/LgmJnQW1pRAl7woIiowFZ92zwlOdUsvYArFZ53OxV/A4xyz4LYzZfFpiBeTvwX9o9WoZvNe9kumUqxPMV4VFp4hhjaQR7X/bRLAquXvgUUp09tEGnKapfGqPMuk2KJdIu5Wxg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=rlYpYnPJfzYMFldqzB+wsYVPb5M2tzyK6CbsXxYmFNg=;
 b=l79FFGuHqvrYMp5hGuHXPGOJOrTGI++k5qUuuf361JUWMrf3lL3wcDuyfdi3lCy7mcDu6e4wgfy+N05CTxujgvKK3PJTcITqI8G5glqPRANVG9ZY6pAuO4/T5eUrXPij30Jjaq/YJiZU9Rgn5xJf3PbAWr16zssDrTK4Thq1ieCJcPzojzEkCc38aR0Vqf6St496SRrELgiTm9rQu7RbvLE89IT3iqsFyn1xyB2ACcKlKSr6p2S4GFsYD8nA/l8AhGJwcRlWPN1bXJx1p0waCPcIZYplYQPQe3LKRVgR6jlYxk9UBT9cN7+AxFHjdPx0X79bj1XPs4oPljs6Q8ijHg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=rlYpYnPJfzYMFldqzB+wsYVPb5M2tzyK6CbsXxYmFNg=;
 b=UkPF/vFFQFSk14kECTdbziOxNVJqN13A+rBtrcOsM3kQnN5bEGOGcqGajYlW7NHVvwNoVSEW8WMD6hzi2RvsSzApBCPWcnqYvX2UJ/3NbuCFNF+HMk9bMk9e/aLwnO2zmK2fwycP51JN0+qWCo8KEaxxQ2oEL08XbTCHq11SSgE=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <bb671300-543f-3754-b428-73b91ae321a5@citrix.com>
Date: Wed, 19 Jul 2023 11:04:58 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v2 2/4] x86: allow Kconfig control over psABI level
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>
References: <dace10da-f108-fbe5-da4f-0e4497f512d9@suse.com>
 <28a84bbd-b0c4-dd80-b9c2-59770d0f54fc@suse.com>
In-Reply-To: <28a84bbd-b0c4-dd80-b9c2-59770d0f54fc@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P265CA0414.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:a0::18) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|SJ0PR03MB5919:EE_
X-MS-Office365-Filtering-Correlation-Id: 54b9adb5-f240-40ca-c24a-08db883f9f25
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	JEWrqKcmdBr1myWHfa7YWZEdNWyCX/cAy0Cijms71FYvrmX7CJG5ZDEl2hqjrAo/c4xWXT3WFWLumlpEhiUF2Ad4hRtlCh5zjkJOMsaf67BMZWQA1cAT/UfV8LuoAd5b53Svm/plETGgegjr6MvoaDgsH7o8Ybp0yLMAUYjUI1oBqkehlN2w6mAL3eG9j1fyhr9nD151QGyCyzHvifhZH5I6PH8oG/o/9ygoPEL0CAqhrznSgZbfV+0OCqbAGKO6GUzdzTirQJlNS6lDlTuh7BRmGdWeuIwBI3VRGgelA+LmWZMLDOyeoXhnnxQnaYoOabZ0Q5O+DjlpIJoFd0CfPwnLnZOx/8zBUvlK0slNpOEFiScKff3JtSJEfD7fc+5InQvcqgrEDdXilwYCw+lV9VCGjPqrfz7DJ07lIzGWoYeXvssB9VWLy/x3slcsgtH5p3y0fwX1H1ENR6Iv6paW33rFn48NOK1XEwt2vrLSCxuGhEw50MDobF4JkHN2b+pWsGLc5vrBz8I/0SNhG6Q6D2CP6hEifr9gTI83Zl2v3T+TNim33Fphtu7PE1NxntBKpUrKvBWcBJ4mz7lt3BgJknXVSu9MF8SLuhTteK/TrPL++rLfxNX+na/I6mLcW07IIWMCzp2O9cQCKsXDhocbGA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(366004)(376002)(396003)(346002)(451199021)(110136005)(54906003)(478600001)(6486002)(6666004)(53546011)(186003)(6512007)(107886003)(2906002)(26005)(6506007)(41300700001)(66946007)(4326008)(5660300002)(8676002)(8936002)(38100700002)(316002)(82960400001)(86362001)(36756003)(31696002)(2616005)(66556008)(66476007)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?N2R4d214MEhKWnJPWHNlNlAxeXNqVVRJOTRLcjhoa2FoVEt0ZkMxcVhYQnZs?=
 =?utf-8?B?WWZFdkRoZVVUNVhYRkVpUWV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9xS2QQVDHr3pqJVmKV7gdWccH2s4oJQDUzRgw1fFq+XPy2zJCwjwdP7++2CdeewFESQ3d5jfAqJJ0S+4WfC3b+V94FWdH3H6GKr2kzPaWIbvmzc8hTYVI+0YO0AJuE60qqaeuNhSXHLqDkoj6KkfqWu5BoqRCpM/8fT0tW62yUKHzHs3ZHwg7GbnsWcpz8WK1jupbyaTwYOQebLZRbZRcChyroJPCq4M49rVnUV+fEUhZ2xkGtTsLmv9CjLZ09nbY1JrpouosdxJVWVH3s5/Kz26sez3rpWhhEcXmlT6iOBqX0UmLYOU53rE+G+E5TKCelMQwPJcyXsPA==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 54b9adb5-f240-40ca-c24a-08db883f9f25
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 10:05:04.1077
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: JzbdzqcuM9Htpmw9w5lOHRS8i6XR5K3B5PkqgVE2MRUTiREstXmR+xVdtYBly519RdkaiazSolhNRB/I2ONW//GN8T4bdZcqWDIM3ZVNsR4=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5919

On 19/07/2023 10:44 am, Jan Beulich wrote:
> --- a/xen/arch/x86/Kconfig
> +++ b/xen/arch/x86/Kconfig
> @@ -118,6 +118,36 @@ config HVM
>  
>  	  If unsure, say Y.
>  
> +choice
> +	prompt "base psABI level"
> +	default X86_64_BASELINE
> +	help
> +	  The psABI defines 4 levels of ISA extension sets as a coarse granular
> +	  way of identifying advanced functionality that would be uniformly
> +	  available in respectively newer hardware.  While v4 is not really of
> +	  interest for Xen, the others can be selected here, making the
> +	  resulting Xen no longer work on older hardware.  This option won't
> +	  have any effect if the toolchain doesn't support the distinction.
> +
> +	  If unsure, stick to the default.
> +
> +config X86_64_BASELINE
> +	bool "baseline"
> +
> +config X86_64_V2
> +	bool "v2"
> +	help
> +	  This enables POPCNT and CX16, besides other extensions which are of
> +	  no interest here.
> +
> +config X86_64_V3
> +	bool "v3"
> +	help
> +	  This enables BMI, BMI2, LZCNT, MOVBE, and XSAVE, besides other
> +	  extensions which are of no interest here.
> +
> +endchoice
> +
>  config XEN_SHSTK
>  	bool "Supervisor Shadow Stacks"
>  	depends on HAS_AS_CET_SS
> --- a/xen/arch/x86/arch.mk
> +++ b/xen/arch/x86/arch.mk
> @@ -36,6 +36,10 @@ CFLAGS += -mno-red-zone -fpic
>  # the SSE setup for variadic function calls.
>  CFLAGS += -mno-mmx -mno-sse $(call cc-option,$(CC),-mskip-rax-setup)
>  
> +# Enable the selected baseline ABI, if supported by the compiler.
> +CFLAGS-$(CONFIG_X86_64_V2) += $(call cc-option,$(CC),-march=x86-64-v2)
> +CFLAGS-$(CONFIG_X86_64_V3) += $(call cc-option,$(CC),-march=x86-64-v3)

I know we're having severe disagreements over Kconfig compiler checking,
but this patch cannot cannot go in in this form.

You're asking the user unconditionally for the psABI level, then
ignoring the answer on toolchains which don't understand it.

The makefile needs to be unconditional, and the Kconfig options need to
depend on suitable toolchain support.Â  This is the only way we don't get
a false statement written into the .config, and embedded in hypfs.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 10:08:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 10:08:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565735.884174 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM46b-0000rx-Aw; Wed, 19 Jul 2023 10:08:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565735.884174; Wed, 19 Jul 2023 10:08:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM46b-0000rq-7n; Wed, 19 Jul 2023 10:08:25 +0000
Received: by outflank-mailman (input) for mailman id 565735;
 Wed, 19 Jul 2023 10:08:24 +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
 <SRS0=fyAl=DF=citrix.com=prvs=55726f7b7=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qM46a-0000rk-1a
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 10:08:24 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3004a177-261c-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 12:08:21 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3004a177-261c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689761301;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=XIOOnQ4fgim3D5Pq1B3STxqg0s1BCaA46fECZIyfIC0=;
  b=QsJvio9WvXXj/Y/ZTBgp/49O5vC8Q/hUdEsWqmeSuY2e0CAy8Q4z2r0c
   RJoW2qAHdiv/udFwvZlMSzg/V8JhxcGbwszgtShE/ABkMZP4eE/cYgHCz
   0LMrXiBSkeMGvz+VRt0zNQShvbeBIk88WEuFCYJYjnGSNk4M8PW1gegbY
   U=;
Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 119308311
X-Ironport-Server: esa4.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:GTeF8aI/jqJWMNk3FE+R0ZUlxSXFcZb7ZxGr2PjKsXjdYENS1TdWz
 zZMWGyGOfvcZTHxKYxyOoy29koOsJbczdQxSQJlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws
 Jb5rta31GWNglaYCUpKrfrawP9TlK6q4mhA4QVvPakjUGL2zBH5MrpOfcldEFOgKmVkNrbSb
 /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/
 jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5xAGd/2
 uYFEAoVazHfnuWZz5GVdLVV05FLwMnDZOvzu1llxDDdS/0nXYrCU+PB4towMDUY354UW6yEP
 oxANGQpNU6bC/FMEg5/5JYWteGknHTgNRZfr0qYv/Ef6GnP1g1hlrPqNbI5f/TTHJQOxhbD/
 zuuE2LRHUFFPs3GxSG/7XeB2sv1lnzARYkIPejtnhJtqALKnTFCYPEMbnOrrP/8hkOgVtZ3L
 00P5jFovaU07FasTNT2Q1u/unHsljw2VsdUEuY6wBqQ0aeS6AGcbkAbShZRZdpgs9U5LQHGz
 XfQwYmvX2Y29uTIFzTErOz8QS6O1TY9K24EVAAeUDM/+9zC/Jg0oR3sYOg/Kfvg5jHqIg0c0
 wxmvQBn2eVC0pNRh/3mlbzUq2ny/8aUF2bZ8i2SBzv4tV0hOeZJcqTysTDmAeB8wJF1p7Vrl
 FwNgICg4e8HFvlhfwTdEbxWTNlFCxtoWQAwYGKD/LF7rVxBA1b5IehtDMhWfS+FyPosdz7ze
 1P0sghM/pJVN3bCRfYpM9PuU5lykfe/T4mNuhXogjxmOMQZmOivpXwGWKJt9zq1zBhEfV8XZ
 f93jvpA/V5FUP86nVJats8W0KMxxzBW+I8gbcmT8vhT6pLHPCT9Ye5cYDOzghURsPvsTPP9r
 4wOaKNnCnx3DIXDX8Ug2ddMfA5ScSBhWMmeRg4+XrfrHzeK0VoJU5f5qY7NsaQ/90iJvo8kJ
 k2AZ3I=
IronPort-HdrOrdr: A9a23:2VmhkK5nm98fSpb15gPXwOPXdLJyesId70hD6qkRc20xTiX8ra
 rCoB1173PJYVoqN03I4OrwQZVoIkmsl6Kdg7NwAV7KZmCPhILPFu9fBODZsl7d8kPFl9K14p
 0QF5SWWOeaMbGjt7eA3OBjKadH/DBbytHOuQ4D9QYUcei1UdAb0ztE
X-Talos-CUID: =?us-ascii?q?9a23=3AMSZZDmjZ08S5QZvIvc5ospShyDJudHzb/VjKPne?=
 =?us-ascii?q?CEWNIFKSSZlCz1p04qp87?=
X-Talos-MUID: 9a23:T9+R3As1oB58xuxsiM2nm2E9PtYx77+UF0UgzbE8sJa/KCdqEmLI
X-IronPort-AV: E=Sophos;i="6.01,216,1684814400"; 
   d="scan'208";a="119308311"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
	<JBeulich@suse.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>
Subject: [PATCH] x86/mem: Make mem_hotadd_check() more legible
Date: Wed, 19 Jul 2023 11:08:08 +0100
Message-ID: <20230719100808.4046779-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

Introduce a ROUND() macro to mirror ROUNDUP().  Use both to remove all the
opencoded rounding in mem_hotadd_check().  Fix other minor style issues.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>

The compiled binary is identical.
---
 xen/arch/x86/x86_64/mm.c | 31 +++++++++++++------------------
 xen/include/xen/macros.h |  1 +
 2 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 60db439af3ec..38f978cab269 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -1159,10 +1159,10 @@ static int mem_hotadd_check(unsigned long spfn, unsigned long epfn)
 {
     unsigned long s, e, length, sidx, eidx;
 
-    if ( (spfn >= epfn) )
+    if ( spfn >= epfn )
         return 0;
 
-    if (pfn_to_pdx(epfn) > FRAMETABLE_NR)
+    if ( pfn_to_pdx(epfn) > FRAMETABLE_NR )
         return 0;
 
     if ( (spfn | epfn) & ((1UL << PAGETABLE_ORDER) - 1) )
@@ -1172,10 +1172,9 @@ static int mem_hotadd_check(unsigned long spfn, unsigned long epfn)
         return 0;
 
     /* Make sure the new range is not present now */
-    sidx = ((pfn_to_pdx(spfn) + PDX_GROUP_COUNT - 1)  & ~(PDX_GROUP_COUNT - 1))
-            / PDX_GROUP_COUNT;
-    eidx = (pfn_to_pdx(epfn - 1) & ~(PDX_GROUP_COUNT - 1)) / PDX_GROUP_COUNT;
-    if (sidx >= eidx)
+    sidx = ROUNDUP(pfn_to_pdx(spfn),     PDX_GROUP_COUNT) / PDX_GROUP_COUNT;
+    eidx = ROUND  (pfn_to_pdx(epfn - 1), PDX_GROUP_COUNT) / PDX_GROUP_COUNT;
+    if ( sidx >= eidx )
         return 0;
 
     s = find_next_zero_bit(pdx_group_valid, eidx, sidx);
@@ -1186,28 +1185,24 @@ static int mem_hotadd_check(unsigned long spfn, unsigned long epfn)
         return 0;
 
     /* Caculate at most required m2p/compat m2p/frametable pages */
-    s = (spfn & ~((1UL << (L2_PAGETABLE_SHIFT - 3)) - 1));
-    e = (epfn + (1UL << (L2_PAGETABLE_SHIFT - 3)) - 1) &
-            ~((1UL << (L2_PAGETABLE_SHIFT - 3)) - 1);
+    s = ROUND  (spfn, 1UL << (L2_PAGETABLE_SHIFT - 3));
+    e = ROUNDUP(epfn, 1UL << (L2_PAGETABLE_SHIFT - 3));
 
     length = (e - s) * sizeof(unsigned long);
 
-    s = (spfn & ~((1UL << (L2_PAGETABLE_SHIFT - 2)) - 1));
-    e = (epfn + (1UL << (L2_PAGETABLE_SHIFT - 2)) - 1) &
-            ~((1UL << (L2_PAGETABLE_SHIFT - 2)) - 1);
-
-    e = min_t(unsigned long, e,
+    s =     ROUND  (spfn, 1ULL << (L2_PAGETABLE_SHIFT - 2));
+    e = min(ROUNDUP(epfn, 1ULL << (L2_PAGETABLE_SHIFT - 2)),
             (RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START) >> 2);
 
     if ( e > s )
-        length += (e -s) * sizeof(unsigned int);
+        length += (e - s) * sizeof(unsigned int);
 
-    s = pfn_to_pdx(spfn) & ~(PDX_GROUP_COUNT - 1);
-    e = ( pfn_to_pdx(epfn) + (PDX_GROUP_COUNT - 1) ) & ~(PDX_GROUP_COUNT - 1);
+    s = ROUND  (pfn_to_pdx(spfn), PDX_GROUP_COUNT);
+    e = ROUNDUP(pfn_to_pdx(epfn), PDX_GROUP_COUNT);
 
     length += (e - s) * sizeof(struct page_info);
 
-    if ((length >> PAGE_SHIFT) > (epfn - spfn))
+    if ( (length >> PAGE_SHIFT) > (epfn - spfn) )
         return 0;
 
     return 1;
diff --git a/xen/include/xen/macros.h b/xen/include/xen/macros.h
index 7b92d345044d..ceeffcaa95ff 100644
--- a/xen/include/xen/macros.h
+++ b/xen/include/xen/macros.h
@@ -1,6 +1,7 @@
 #ifndef __MACROS_H__
 #define __MACROS_H__
 
+#define ROUND(x, a)   ((x) & ~((a) - 1))
 #define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
 
 #define IS_ALIGNED(val, align) (!((val) & ((align) - 1)))

base-commit: b1c16800e52743d9afd9af62c810f03af16dd942
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 10:10:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 10:10:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565738.884183 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM48L-0002Gc-LL; Wed, 19 Jul 2023 10:10:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565738.884183; Wed, 19 Jul 2023 10:10:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM48L-0002GV-IH; Wed, 19 Jul 2023 10:10:13 +0000
Received: by outflank-mailman (input) for mailman id 565738;
 Wed, 19 Jul 2023 10:10:11 +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
 <SRS0=8bnZ=DF=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qM48J-0002GN-Nm
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 10:10:11 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 70ccd720-261c-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 12:10:09 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.163.72.116])
 by support.bugseng.com (Postfix) with ESMTPSA id 9B72A4EE0C89;
 Wed, 19 Jul 2023 12:10:07 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 70ccd720-261c-11ee-8611-37d641c3527e
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: [XEN PATCH] x86/HVM: address violations of MISRA C:2012 Rules 8.2 and 8.3
Date: Wed, 19 Jul 2023 12:07:16 +0200
Message-Id: <7c89ac0fe44dbd1ba1436a91024efebf2794db40.1689761143.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Give a name to unnamed parameters thus addressing violations of
MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
named parameters").
Keep consistency between parameter names and types used in function
declarations and the ones used in the corresponding function
definitions thus addressing violations of MISRA C:2012 Rule 8.3
("All declarations of an object or function shall use the same names
and type qualifiers").

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/arch/x86/hvm/domain.c              |  2 +-
 xen/arch/x86/hvm/hvm.c                 |  4 ++--
 xen/arch/x86/hvm/rtc.c                 | 12 ++++++------
 xen/arch/x86/hvm/svm/nestedhvm.h       |  2 +-
 xen/arch/x86/hvm/svm/nestedsvm.c       |  2 +-
 xen/arch/x86/hvm/vioapic.c             |  2 +-
 xen/arch/x86/include/asm/hvm/domain.h  |  2 +-
 xen/arch/x86/include/asm/hvm/hvm.h     | 12 ++++++------
 xen/arch/x86/include/asm/hvm/irq.h     | 14 +++++++-------
 xen/arch/x86/include/asm/hvm/save.h    |  4 ++--
 xen/arch/x86/include/asm/hvm/support.h |  2 +-
 11 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/hvm/domain.c b/xen/arch/x86/hvm/domain.c
index 7692ee24c2..7f6e362a70 100644
--- a/xen/arch/x86/hvm/domain.c
+++ b/xen/arch/x86/hvm/domain.c
@@ -100,7 +100,7 @@ static int check_segment(struct segment_register *reg, enum x86_segment seg)
 }
 
 /* Called by VCPUOP_initialise for HVM guests. */
-int arch_set_info_hvm_guest(struct vcpu *v, const vcpu_hvm_context_t *ctx)
+int arch_set_info_hvm_guest(struct vcpu *v, const struct vcpu_hvm_context *ctx)
 {
     const struct domain *d = v->domain;
     struct cpu_user_regs *uregs = &v->arch.user_regs;
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 57363c2ae1..8f19a79f6f 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -319,7 +319,7 @@ static bool pat_valid(uint64_t val)
     return !(any_gt_7 | any_2_or_3);
 }
 
-int hvm_set_guest_pat(struct vcpu *v, uint64_t guest_pat)
+int hvm_set_guest_pat(struct vcpu *v, u64 guest_pat)
 {
     if ( !pat_valid(guest_pat) )
         return 0;
@@ -426,7 +426,7 @@ static void hvm_set_guest_tsc_adjust(struct vcpu *v, u64 tsc_adjust)
         update_vcpu_system_time(v);
 }
 
-u64 hvm_get_guest_tsc_fixed(struct vcpu *v, uint64_t at_tsc)
+u64 hvm_get_guest_tsc_fixed(struct vcpu *v, u64 at_tsc)
 {
     uint64_t tsc;
 
diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index c1ab6c7d58..4a586342ce 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -559,17 +559,17 @@ static inline int from_bcd(RTCState *s, int a)
 
 /* Hours in 12 hour mode are in 1-12 range, not 0-11.
  * So we need convert it before using it*/
-static inline int convert_hour(RTCState *s, int raw)
+static inline int convert_hour(RTCState *s, int hour)
 {
-    int hour = from_bcd(s, raw & 0x7f);
+    int ret = from_bcd(s, hour & 0x7f);
 
     if (!(s->hw.cmos_data[RTC_REG_B] & RTC_24H))
     {
-        hour %= 12;
-        if (raw & 0x80)
-            hour += 12;
+        ret %= 12;
+        if (hour & 0x80)
+            ret += 12;
     }
-    return hour;
+    return ret;
 }
 
 static void rtc_set_time(RTCState *s)
diff --git a/xen/arch/x86/hvm/svm/nestedhvm.h b/xen/arch/x86/hvm/svm/nestedhvm.h
index 43245e13de..eb9c416307 100644
--- a/xen/arch/x86/hvm/svm/nestedhvm.h
+++ b/xen/arch/x86/hvm/svm/nestedhvm.h
@@ -42,7 +42,7 @@ int cf_check nsvm_vcpu_initialise(struct vcpu *v);
 int cf_check nsvm_vcpu_reset(struct vcpu *v);
 int nsvm_vcpu_vmrun(struct vcpu *v, struct cpu_user_regs *regs);
 int cf_check nsvm_vcpu_vmexit_event(struct vcpu *v,
-                                    const struct x86_event *event);
+                                    const struct x86_event *trap);
 uint64_t cf_check nsvm_vcpu_hostcr3(struct vcpu *v);
 bool cf_check nsvm_vmcb_guest_intercepts_event(
     struct vcpu *v, unsigned int vector, int errcode);
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 5d74863268..9b4595f74a 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -1538,7 +1538,7 @@ nestedsvm_vcpu_interrupt(struct vcpu *v, const struct hvm_intack intack)
     return NSVM_INTR_NOTINTERCEPTED;
 }
 
-bool_t
+bool
 nestedsvm_gif_isset(struct vcpu *v)
 {
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index 41e3c4d5e4..4e40d3609a 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -43,7 +43,7 @@
 /* HACK: Route IRQ0 only to VCPU0 to prevent time jumps. */
 #define IRQ0_SPECIAL_ROUTING 1
 
-static void vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int irq);
+static void vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int pin);
 
 static struct hvm_vioapic *addr_vioapic(const struct domain *d,
                                         unsigned long addr)
diff --git a/xen/arch/x86/include/asm/hvm/domain.h b/xen/arch/x86/include/asm/hvm/domain.h
index 02c32cf26d..6e53ce4449 100644
--- a/xen/arch/x86/include/asm/hvm/domain.h
+++ b/xen/arch/x86/include/asm/hvm/domain.h
@@ -47,7 +47,7 @@ struct hvm_pi_ops {
      * Hook into arch_vcpu_block(), which is called
      * from vcpu_block() and vcpu_do_poll().
      */
-    void (*vcpu_block)(struct vcpu *);
+    void (*vcpu_block)(struct vcpu *v);
 };
 
 struct hvm_domain {
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index 3c37f522b9..7943e287cf 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -151,8 +151,8 @@ struct hvm_function_table {
 
     void (*fpu_leave)(struct vcpu *v);
 
-    int  (*get_guest_pat)(struct vcpu *v, u64 *);
-    int  (*set_guest_pat)(struct vcpu *v, u64);
+    int  (*get_guest_pat)(struct vcpu *v, u64 *gpat);
+    int  (*set_guest_pat)(struct vcpu *v, u64 gpat);
 
     void (*set_tsc_offset)(struct vcpu *v, u64 offset, u64 at_tsc);
 
@@ -180,8 +180,8 @@ struct hvm_function_table {
     int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
     void (*handle_cd)(struct vcpu *v, unsigned long value);
     void (*set_info_guest)(struct vcpu *v);
-    void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
-    void (*set_descriptor_access_exiting)(struct vcpu *v, bool);
+    void (*set_rdtsc_exiting)(struct vcpu *v, bool_t enable);
+    void (*set_descriptor_access_exiting)(struct vcpu *v, bool enable);
 
     /* Nested HVM */
     int (*nhvm_vcpu_initialise)(struct vcpu *v);
@@ -282,7 +282,7 @@ int vmsi_deliver(
     uint8_t dest, uint8_t dest_mode,
     uint8_t delivery_mode, uint8_t trig_mode);
 struct hvm_pirq_dpci;
-void vmsi_deliver_pirq(struct domain *d, const struct hvm_pirq_dpci *);
+void vmsi_deliver_pirq(struct domain *d, const struct hvm_pirq_dpci *pirq_dpci);
 int hvm_girq_dest_2_vcpu_id(struct domain *d, uint8_t dest, uint8_t dest_mode);
 
 enum hvm_intblk
@@ -350,7 +350,7 @@ void *hvm_map_guest_frame_rw(unsigned long gfn, bool_t permanent,
                              bool_t *writable);
 void *hvm_map_guest_frame_ro(unsigned long gfn, bool_t permanent);
 void hvm_unmap_guest_frame(void *p, bool_t permanent);
-void hvm_mapped_guest_frames_mark_dirty(struct domain *);
+void hvm_mapped_guest_frames_mark_dirty(struct domain *d);
 
 int hvm_debug_op(struct vcpu *v, int32_t op);
 
diff --git a/xen/arch/x86/include/asm/hvm/irq.h b/xen/arch/x86/include/asm/hvm/irq.h
index 2d136ab99b..1817ca6e2d 100644
--- a/xen/arch/x86/include/asm/hvm/irq.h
+++ b/xen/arch/x86/include/asm/hvm/irq.h
@@ -160,17 +160,17 @@ struct hvm_pirq_dpci {
     struct list_head softirq_list;
 };
 
-void pt_pirq_init(struct domain *, struct hvm_pirq_dpci *);
-bool pt_pirq_cleanup_check(struct hvm_pirq_dpci *);
+void pt_pirq_init(struct domain *d, struct hvm_pirq_dpci *dpci);
+bool pt_pirq_cleanup_check(struct hvm_pirq_dpci *dpci);
 int pt_pirq_iterate(struct domain *d,
-                    int (*cb)(struct domain *,
-                              struct hvm_pirq_dpci *, void *arg),
+                    int (*cb)(struct domain *d,
+                              struct hvm_pirq_dpci *dpci, void *arg),
                     void *arg);
 
 #ifdef CONFIG_HVM
-bool pt_pirq_softirq_active(struct hvm_pirq_dpci *);
+bool pt_pirq_softirq_active(struct hvm_pirq_dpci *pirq_dpci);
 #else
-static inline bool pt_pirq_softirq_active(struct hvm_pirq_dpci *dpci)
+static inline bool pt_pirq_softirq_active(struct hvm_pirq_dpci *pirq_dpci)
 {
     return false;
 }
@@ -211,6 +211,6 @@ void hvm_assert_evtchn_irq(struct vcpu *v);
 void hvm_set_callback_via(struct domain *d, uint64_t via);
 
 struct pirq;
-bool hvm_domain_use_pirq(const struct domain *, const struct pirq *);
+bool hvm_domain_use_pirq(const struct domain *d, const struct pirq *pirq);
 
 #endif /* __ASM_X86_HVM_IRQ_H__ */
diff --git a/xen/arch/x86/include/asm/hvm/save.h b/xen/arch/x86/include/asm/hvm/save.h
index 9d838c48e3..535cf68ed2 100644
--- a/xen/arch/x86/include/asm/hvm/save.h
+++ b/xen/arch/x86/include/asm/hvm/save.h
@@ -36,8 +36,8 @@ void _hvm_write_entry(struct hvm_domain_context *h,
     r; })
 
 /* Unmarshalling: test an entry's size and typecode and record the instance */
-int _hvm_check_entry(struct hvm_domain_context *h, 
-                     uint16_t type, uint32_t len, bool_t strict_length);
+int _hvm_check_entry(struct hvm_domain_context *h,
+                     uint16_t type, uint32_t len, bool strict_length);
 
 /* Unmarshalling: copy the contents in a type-safe way */
 void _hvm_read_entry(struct hvm_domain_context *h,
diff --git a/xen/arch/x86/include/asm/hvm/support.h b/xen/arch/x86/include/asm/hvm/support.h
index 8d4707e58c..ab7de0a43b 100644
--- a/xen/arch/x86/include/asm/hvm/support.h
+++ b/xen/arch/x86/include/asm/hvm/support.h
@@ -135,7 +135,7 @@ int hvm_descriptor_access_intercept(uint64_t exit_info,
                                     unsigned int descriptor, bool is_write);
 int hvm_mov_to_cr(unsigned int cr, unsigned int gpr);
 int hvm_mov_from_cr(unsigned int cr, unsigned int gpr);
-void hvm_ud_intercept(struct cpu_user_regs *);
+void hvm_ud_intercept(struct cpu_user_regs *regs);
 
 /*
  * May return X86EMUL_EXCEPTION, at which point the caller is responsible for
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 10:24:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 10:24:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565744.884194 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM4Lp-00042P-Ra; Wed, 19 Jul 2023 10:24:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565744.884194; Wed, 19 Jul 2023 10:24:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM4Lp-00042I-OD; Wed, 19 Jul 2023 10:24:09 +0000
Received: by outflank-mailman (input) for mailman id 565744;
 Wed, 19 Jul 2023 10:24:09 +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
 <SRS0=fyAl=DF=citrix.com=prvs=55726f7b7=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qM4Lp-00042C-5g
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 10:24:09 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 61f4f291-261e-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 12:24:06 +0200 (CEST)
Received: from mail-dm6nam11lp2174.outbound.protection.outlook.com (HELO
 NAM11-DM6-obe.outbound.protection.outlook.com) ([104.47.57.174])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 19 Jul 2023 06:23:59 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by PH7PR03MB7164.namprd03.prod.outlook.com (2603:10b6:510:2bc::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Wed, 19 Jul
 2023 10:23:54 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 10:23:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 61f4f291-261e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689762246;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=3+7lIY6lPCloV82GYmG0Htrh5lWSXMmWbCIu+4IUVcA=;
  b=eNfcb3+Tkw7xu1crec39SjIXwvrCjnonn1DlJYwi2lyg40IftaomIP37
   Q6IpS+YFXRB3YBATZIkSF5/hX69PMJoC7WEFr9FT/Q5yerDoZmZ4jWVnP
   liWtLuPiP0MyDz9UISGO0hYMQj0vLsSyI+3MkCkxL6vWEIrtsfJcl/LxC
   4=;
X-IronPort-RemoteIP: 104.47.57.174
X-IronPort-MID: 116735452
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:Q1pDIa8/2JXYxps6+pi3DrUDx36TJUtcMsCJ2f8bNWPcYEJGY0x3m
 jNNXT/VaamJYWPxc9pwb4rk8EsGvJfQzYNhTwZv+ys8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s
 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk
 d7pqojUNUTNNwRcawr40Ird7ks21BjOkGlA5AdmOqka5Aa2e0Q9V/rzG4ngdxMUfaEMdgKKb
 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk
 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDkkXx
 fs0JhQ9YSy/jua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6DvZY/N2KMoM293amFa/hZrDv7nZMQq59Ts5WZa/pfVFZll/1RwKqSKuZCIMu10vFkLA
 AkNrCl2B8fSyLgU5hf1VMfhOBFih8Ib1K7qw45y4eoOzQ6pgEC82IIgMMYhXsO75Q7Vt1N4P
 nFKL1hkPVUQtYRdr8VPpZ1fSIZMB2yffvgChPgHb3cLtB0B1vd75rspLkl7uCjf5IFiJM0hZ
 TaSVtd8Wo/YVjnB8GC1IBCtkmlehTLYR39jsVFo5RpsLz1Q7TmdSWFVVA1isOl5/ESGNfSVf
 q/MI9fR/XjMWztE4BU2BCWYegnFVAOFMkO/torUVOHpczGboXsq+zAaf7WYKHgFD41M1mPck
 frnAKDVfmownrbJUMQ2iKhJk8FUnaPga5NLA==
X-Talos-CUID: 9a23:t0Y+kWHMUI+EfIrNqmI+xEk4FOQVfUHhxXPuJmDjEmBCVoGaHAo=
X-Talos-MUID: =?us-ascii?q?9a23=3A23wDvw6edZpEjNXJPk8AANiRxoxa872WDE02jal?=
 =?us-ascii?q?bouilFXdbMTfApx+4F9o=3D?=
X-IronPort-AV: E=Sophos;i="6.01,216,1684814400"; 
   d="scan'208";a="116735452"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=bSPo1oBFMs614CyfeLijD0mvGRX4gSjHT/5Qv+kPJRCLreSDnnGTUTCkncVkBcCJRdqaWBIztrnkV21qSdlz9aKF6+MQGT/axn1CpFGm2i1J7COUnE/i90yh4jV1jaOImFV0UM3nW5nfLbX0ig2I78xSX4KiuokrK8nka0CTtxuDqcljXzp7uydpAkG6Xx4xSPd3UqfVUZYzC3FxGL0u8CsMoR+EuoTR0QS6g8gKNuGp1mVoMSgLY36yyDHOIxiQBPFsUuGZ9uYEtLY5jyeMbdnk8M2jBMoFNQmtu21yZFPviZ/CmahKHQp/heOb3ptKwhakGwr+l9Xo9WJJ66J/dw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3MaJNIasv1HZ9E3S6bYdCo+z4s9eakKt7nL2n+FEAts=;
 b=QCiFzZwnf4e2L779/rLcH5rvKFMnRNQPN0+A7sZDHKCUAAmRZ2AFmn2+Ix6qCqUTQ+hEysYz8K4sFqJm9NRtIv2EEd9RtfVRfPKHuywG53MNvjZ8oHsTIVcJXMwX7dYb8jucNVTd9mPiLXMB7sxtJCAeKHcZ771Nnbr5tp5KC7ssIJTuNORwRTOu8hJM4DagmShF6SddSvfXPXbuK6lj7R05vlgn2j4Yh4qXIzseE1OPYjZ6/CEWgKzsrvGmNJJ/m8jj9mpJTV8o7ARLJoTlmBz1KDiUMcNfVTpra8/Jfuf6BXPV2aVlEhN0sBQDsf+w16XLCHR6t6tftsNvv7ai1g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3MaJNIasv1HZ9E3S6bYdCo+z4s9eakKt7nL2n+FEAts=;
 b=rShKywXQCybLqyT1UzZNuYBznui2nWgh1sLIUwLxLu3iTHjEVr68zSM936XW5ffF7lKG2dBGnd9mrvmaXA5UjmiVdkxOHZCfK/dzPFqls8RoxtkBIz7DaZrgq172tggzt1Gcr6ofaC1jNXyJneSO1rW3asWX/uNzeaqFlZsN8DQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <e0b03fd7-0487-3328-b532-2950c3b1e34b@citrix.com>
Date: Wed, 19 Jul 2023 11:23:47 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [XEN PATCH] x86/HVM: address violations of MISRA C:2012 Rules 8.2
 and 8.3
Content-Language: en-GB
To: Federico Serafini <federico.serafini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com, Jan Beulich <jbeulich@suse.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
References: <7c89ac0fe44dbd1ba1436a91024efebf2794db40.1689761143.git.federico.serafini@bugseng.com>
In-Reply-To: <7c89ac0fe44dbd1ba1436a91024efebf2794db40.1689761143.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0294.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:196::11) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|PH7PR03MB7164:EE_
X-MS-Office365-Filtering-Correlation-Id: 0b7cbf67-3d96-4044-b17c-08db884240a1
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	EvvgLLAAeYezQGSJHzE6NUlwcye3nGTr57kJZLHSF8SrleK0w8IPdAbudc9xC7GMw2m0QE+BsBMVjD3l+vkXk5vqb58r2lLb79PdM7i6Zu4xLSrt5fg4/SqX7ieM097VKx6uzOIEJqplClaMv/JNizbxFeizDzrXftWuHMJWxGjehCY2LOWg9c8t/25Alm4NkIAS79VcQ/SobbmMyG5E/3LviPanNyz1A19NsyFfuWxHTXkdyC9sjb6IMjlzMjKOXBcEcAA6Dg/Ab7w9TaMe0+LJYEvMcjUOjRG+nx0ekMUGgI5qq5mJoff00gjThkCbP4+zCQv3DeyWLYqRoFO1tJ9ARu/ILzzn6i9lVKMYr0KF8GkwQ5EMoVmOLJqNUB7iDvxaixJaetPQ70RmMAc82b8dDJeRm6OkdM4viYbpIre7GOWI028zYItrVo6FCz4ZHj2kIIESLnH2AO7+IeVF1AdWKrqfMEciw72HE1zbPqldpIB6ZgspChyOmV6cyxSeXvehbBotSah5Jeg74d3Yww+4TnhjeqS91V8PYURNWWEhZG/FpVaU8D1Z+su1yr+Gi4NLHl7igoN8BCtph34qRDuQWNegxz0kFw/4VGLnhk5MpQ+ZR+7l2ciYmMMryLLBEQ6GyTHmmrCAF9XPmlFnkw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(396003)(136003)(346002)(376002)(451199021)(31686004)(83380400001)(2616005)(66946007)(66556008)(41300700001)(7416002)(6666004)(5660300002)(8936002)(36756003)(86362001)(31696002)(84970400001)(8676002)(38100700002)(186003)(316002)(6486002)(54906003)(66476007)(4326008)(6506007)(2906002)(82960400001)(6512007)(478600001)(26005)(53546011)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MVBJdUJRNU12SXNuMkQ1WHo5L3VQUXlkeE5BTmFHbm91ZkoxNU4ycTVmSXBa?=
 =?utf-8?B?R0JTL2pnS0dqR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aAwzOymBsiraT/3eCIAWXFke5kjIlQd4aNiOni3EDqQgVHJ5c7tSentlYqlYFgYZllM0Gc4aqnX0eBP7d5c1JmQiPyzWwNcJXQ/RsS2z3xTwd1pFuJcOQKRdGxNUmpRYhBbiUxpfDBR/948VcGSagnGqEnToj5RzMTQW71qq7nNH3/W7OF2bFSYcyTuj5qkaODVDTvTue4iPvG+XMpkXgMFtY7JicOaKEefcbf2txtohjyO8hZfph4uhDw25uo5kBfrmxFuGASoZzJCAko+a6umw0doJvbxw5MzpuaNLxxWJE4zahQ25sViKzgXBlurVuJVdmGwFd6a7Dmw7U/qjJG/LFCutV8ahgb3psksmD80zdN/EgA0vnirYYus+urXyM+VLSerQ6yiQ==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0b7cbf67-3d96-4044-b17c-08db884240a1
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 10:23:53.9323
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: R8JJN3tIl4BybL2/hWsdyJsGOTH4Zkpsi9czoZhAIuwInlhDg1FfRoLEdb2HFgfNyvJKopOf+oOr8F+n7RS8HvWRNcMAotjFGFfmZPU2vNI=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR03MB7164

On 19/07/2023 11:07 am, Federico Serafini wrote:
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index 57363c2ae1..8f19a79f6f 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -319,7 +319,7 @@ static bool pat_valid(uint64_t val)
>      return !(any_gt_7 | any_2_or_3);
>  }
>  
> -int hvm_set_guest_pat(struct vcpu *v, uint64_t guest_pat)
> +int hvm_set_guest_pat(struct vcpu *v, u64 guest_pat)

If there's a u64 vs uint64_t mismatch (or others for that matter),
resolve in the way of the stdint types.Â  That way you're correcting in
the direction of the Xen coding style, rather than away from it.

> diff --git a/xen/arch/x86/hvm/svm/nestedhvm.h b/xen/arch/x86/hvm/svm/nestedhvm.h
> index 43245e13de..eb9c416307 100644
> --- a/xen/arch/x86/hvm/svm/nestedhvm.h
> +++ b/xen/arch/x86/hvm/svm/nestedhvm.h
> @@ -42,7 +42,7 @@ int cf_check nsvm_vcpu_initialise(struct vcpu *v);
>  int cf_check nsvm_vcpu_reset(struct vcpu *v);
>  int nsvm_vcpu_vmrun(struct vcpu *v, struct cpu_user_regs *regs);
>  int cf_check nsvm_vcpu_vmexit_event(struct vcpu *v,
> -                                    const struct x86_event *event);
> +                                    const struct x86_event *trap);

This needs to stay as event.Â  Trap is a related technical term, and
incorrect to use here.Â  (Yes, the implementation of
nsvm_vcpu_vmexit_event() is wrong.)

> diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
> index 3c37f522b9..7943e287cf 100644
> --- a/xen/arch/x86/include/asm/hvm/hvm.h
> +++ b/xen/arch/x86/include/asm/hvm/hvm.h
>      int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
>      void (*handle_cd)(struct vcpu *v, unsigned long value);
>      void (*set_info_guest)(struct vcpu *v);
> -    void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
> -    void (*set_descriptor_access_exiting)(struct vcpu *v, bool);
> +    void (*set_rdtsc_exiting)(struct vcpu *v, bool_t enable);

In this case, we want to swap to bool as well as giving a name in the
prototype.

xen.git/xen$ git grep -w bool_t | wc -l
441

I'm seriously tempted just to do a bulk fix of bool_t to get it over and
done with...

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 10:38:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 10:38:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565750.884204 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM4ZA-00068o-75; Wed, 19 Jul 2023 10:37:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565750.884204; Wed, 19 Jul 2023 10:37:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM4ZA-00068h-2p; Wed, 19 Jul 2023 10:37:56 +0000
Received: by outflank-mailman (input) for mailman id 565750;
 Wed, 19 Jul 2023 10:37:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM4Z8-00068b-8d
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 10:37:54 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0622.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::622])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 501c6514-2620-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 12:37:52 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8896.eurprd04.prod.outlook.com (2603:10a6:102:20f::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Wed, 19 Jul
 2023 10:37:50 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 10:37:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 501c6514-2620-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=DCZIVOOSi5ntzLRQOwPgdYoMpPKe5KTWe8+sW1E9dbM+7zDSDEm7aiLt1g6qpGhTl2yT2FA545kzebqSnLXhbiwXFM74ZxOL2AXpRdhCvuPP1QUCFPzSqIV9hlJzs/LK0E2EMhIim4O7Ns6RDPUbDgfOcbhjc4gVfOUns5d8P8drtKcZDTUaI47yVOyNcICId3iTYivfxI0VFJrseEfa/dznalrSx+hZwC4T2nTDWpXBPWuuaHIR/qO+Whea4X0pjCrfSkBQYLJ2mkfmnobCX8bJtwzr40m1/EEv/QPYxuSi7Mw6WNNKhZIIvNW+MLqHXFYeC3SwCCGQg1iRCOQGPw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=boKYeskBoVVN+9Be6chLP+CVNjavAA4cY9VIWJlCCfE=;
 b=JBGGHbzZ9c4SYeq1dgZmljbaSGrvL5L91pyGvcqVeqeNIR3ZrPHI8vaaTyJUu9l188wYxdhEA0mRvGcUrCIpqY33mEYw7KXFvCJNz2N4qBBucL1W2updfnavNOooDR/MCQY/tYLUPMvO7vySefotNf8/OHqXmxX3pZEPj/PtU3X42wEymXF5GxjhjsBA4T3VrDVbVGQroKfmvdgSN+gXPbJP8dgeeHTO9jzWHm2xSZT99hGR3GfjVdYx3cs2aUaWNZpftNNqNDX0vsV0O/vAGKWrj/d9SgHdYCzICYsb+6ZrYRz1iVtY8M5S5q3LtNmI4mA3RsYlzarlOhUewX+TAQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=boKYeskBoVVN+9Be6chLP+CVNjavAA4cY9VIWJlCCfE=;
 b=2f8Adn6SADtSMjyxHTJWfy/eZx3RhrA2XsyPf4IJRIrDPBzY3GH4jpKMJ79qRd40UD+NADw0M1z0PtPBeRlZFCR7ZXLSM24PoLGcUJCkuZHXFRqd59wdMsdnEIhXkTCAqR0B6VbDrP5G4H5PMhZCUlOPX0uiTK12qGP+k298YGcatpiA10j6WM2JXptQN5XQvuEMsWxfvIFHCgL+6R/0wpRtmgPbKr2RCIgVHAZA1eVKVTwMJjXvv2dHJ0+1OjHBK6BPSGVhCWwl/CYLeE2CIG6sMZ9HqQBJaHKf9CIXyp6Nkyz87AzOaum9uXHGBZiUodCHA5c+oP6Ya/CpCOme0A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <cddab03e-dd17-c684-71cd-5476ffbc0b4d@suse.com>
Date: Wed, 19 Jul 2023 12:37:47 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 4/5] x86/iommu: pass full IO-APIC RTE for remapping
 table update
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 Kevin Tian <kevin.tian@intel.com>, Paul Durrant <paul@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230718124334.36548-1-roger.pau@citrix.com>
 <20230718124334.36548-5-roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230718124334.36548-5-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0191.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ab::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8896:EE_
X-MS-Office365-Filtering-Correlation-Id: cd6521af-ca2a-493a-f952-08db884432d5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	72InLy2U2mCyW98XjeQF0YDQVh1WlBWoUzRnpVRF9dbFOSyQH/8U/AmiSYTUTbQ+SsmKR/wUx/mwYl+D0o47i6ScbDQycX0rtrvp+oDu6zvYS5vBogHLc3gp4CVeU6is1seUs6EWXMRhog3ohDXnL8U/5JL6t5BvvsutAcEJBCstX5SyjvVJJ4Hh+Vq2wabVdLq6qNxvH0EbMlPu5OZS977buqQLm+VTUpLdDd+VBTAmOBxQGAYjWdSuHa7bXrBz/UjGDnTb6TekLsmOUetLjdrSGWQko1r/jyaX6rxheoYbBmN+/rgiz6Nt+c/CdoEhOrgAII5r5UC9hcD8rXBUGvjsloBNTLncNhd0CVbUu0n/jhvSDoFTTqF1KXHdCMbjo/gS0WbGnlG4T+DWhXHZE1xbqd+p3/bTCMEJ7AB7NQlHBb6E70pU/XpkczKvhVn85ujkZnIG+yx/U9xikOddHl+4s/A5rKClEhFD99rJ5164Gds5xZhHhwUdmU8G9jxcxt7fuvR+5/K5uAXq2nUwdf3o3OSU6t39c1rji4g6lkq7KlJw2JcsmqBqQuXNIPU2Y5rW0uY4zD9KD7gCDtS8t/G6l7yMt0AvmRvGzdb11SzTWLvfBlyvzXu6TE9T6KH7j4hGipGfLbVK9qIf6Y9rrw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(39860400002)(376002)(136003)(366004)(346002)(451199021)(38100700002)(36756003)(31696002)(86362001)(31686004)(15650500001)(6486002)(6512007)(478600001)(2906002)(2616005)(26005)(186003)(6506007)(53546011)(41300700001)(6916009)(4326008)(66946007)(8936002)(8676002)(54906003)(66476007)(316002)(66556008)(5660300002)(83380400001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZlVGRzNscmpPVStIWnV4SzdsMkJscXhSd3pIdHozQitCY1BZMnN6cVVIVDN4?=
 =?utf-8?B?dktiVUZzWklxaXQ2MjRiWUhnOTJjb00wcld5Y1JDVVZGbHFiUHNFNTJiQVlj?=
 =?utf-8?B?RU05NTB2ZjZnRXllcEdQMDVCZUk1ZFhHYmtZemhzWXZnamUvS3loRlUvS2Qr?=
 =?utf-8?B?VFNMWnVZc3MvWUJSbzBRTE8yaGRZamZzTVZtV1N0VGRNYmhXU3dJd1A3NmpH?=
 =?utf-8?B?UXJXbD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utf-8?B?dmplb2djTTVPcjIrbWVKOXF3dmlndXNxLzBhWFNYODFDYmFSMnBhT21qeWRN?=
 =?utf-8?B?Z1R4YjI5ZHNsM2grS3NneEJ5b1g0OTRVeUUvOG96ZWkzSU80VkRNc3lXOHZ4?=
 =?utf-8?Q?UI40SvZV26yHfGx0A2oUyvwHp?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: cd6521af-ca2a-493a-f952-08db884432d5
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 10:37:49.6525
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: vOnUPz1mFQfaAFr1KGYv5bxNoNtRDVdNRnMpyxoRP30cbOU419eV1wZCR6MQbEMGJql4kSrJ8luIgDi0u55Syw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8896

On 18.07.2023 14:43, Roger Pau Monne wrote:
> So that the remapping entry can be updated atomically when possible.
> 
> Doing such update atomically will avoid Xen having to mask the IO-APIC
> pin prior to performing any interrupt movements (ie: changing the
> destination and vector fields), as the interrupt remapping entry is
> always consistent.
> 
> This also simplifies some of the logic on both VT-d and AMD-Vi
> implementations, as having the full RTE available instead of half of
> it avoids to possibly read and update the missing other half from
> hardware.
> 
> While there remove the explicit zeroing of new_ire fields in
> ioapic_rte_to_remap_entry() and initialize the variable at definition
> so all fields are zeroed.  Note fields could be also initialized with
> final values at definition, but I found that likely too much to be
> done at this time.
> 
> Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> ---
> Note that certain combination of changes to the RTE are impossible to
> handle atomically. For example changing the vector and/or destination
> fields together with the triggering mode is impossible to be performed
> atomically (as the destination and vector is set in the IRTE, but the
> triggering mode is set in the RTE).  Xen doesn't attempt to perform
> such changes in a single update to the RTE anyway, so it's fine.
> 
> Naming the iommu_update_ire_from_apic() parameter RTE is not really
> correct, as the format of the passed value expands the destination
> field to be 32bits (in order to fit an x2APIC ID).  Passing an
> IO_APIC_route_entry struct is not possible due to the circular
> dependency that would create between io_apic.h and iommu.h.  It might
> be possible to move IO_APIC_route_entry declaration to a different
> header, but I haven't looked into it.
> ---
>  xen/arch/x86/include/asm/iommu.h         |   3 +-
>  xen/arch/x86/io_apic.c                   |   5 +-
>  xen/drivers/passthrough/amd/iommu.h      |   2 +-
>  xen/drivers/passthrough/amd/iommu_intr.c |  98 ++---------------
>  xen/drivers/passthrough/vtd/extern.h     |   2 +-
>  xen/drivers/passthrough/vtd/intremap.c   | 127 +++++++++++------------
>  xen/drivers/passthrough/x86/iommu.c      |   4 +-
>  xen/include/xen/iommu.h                  |   3 +-
>  8 files changed, 80 insertions(+), 164 deletions(-)

Nice diffstat.

> --- a/xen/arch/x86/include/asm/iommu.h
> +++ b/xen/arch/x86/include/asm/iommu.h
> @@ -84,7 +84,8 @@ struct iommu_init_ops {
>  
>  extern const struct iommu_init_ops *iommu_init_ops;
>  
> -void iommu_update_ire_from_apic(unsigned int apic, unsigned int reg, unsigned int value);
> +void iommu_update_ire_from_apic(unsigned int apic, unsigned int pin,
> +                                uint64_t rte);

Much like you have it here, ...

> --- a/xen/drivers/passthrough/amd/iommu.h
> +++ b/xen/drivers/passthrough/amd/iommu.h
> @@ -300,7 +300,7 @@ int cf_check amd_iommu_free_intremap_table(
>  unsigned int amd_iommu_intremap_table_order(
>      const void *irt, const struct amd_iommu *iommu);
>  void cf_check amd_iommu_ioapic_update_ire(
> -    unsigned int apic, unsigned int reg, unsigned int value);
> +    unsigned int apic, unsigned int pin, uint64_t raw);

... could the changed parameter also have "rte" in its name? I don't
mind if it's "raw_rte", to avoid colliding with existing variable
names (in at least the VT-d counterpart).

> @@ -350,14 +319,11 @@ static int update_intremap_entry_from_ioapic(
>  }
>  
>  void cf_check amd_iommu_ioapic_update_ire(
> -    unsigned int apic, unsigned int reg, unsigned int value)
> +    unsigned int apic, unsigned int pin, uint64_t raw)
>  {
>      struct IO_APIC_route_entry old_rte = { };

Looks like the initializer here now isn't needed anymore?

> @@ -364,48 +363,37 @@ static int ioapic_rte_to_remap_entry(struct vtd_iommu *iommu,
>  
>      new_ire = *iremap_entry;
>  
> -    if ( rte_upper )
> -    {
> -        if ( x2apic_enabled )
> -            new_ire.remap.dst = value;
> -        else
> -            new_ire.remap.dst = (value >> 24) << 8;
> -    }
> +    if ( x2apic_enabled )
> +        new_ire.remap.dst = new_rte.dest.dest32;
>      else
> -    {
> -        *(((u32 *)&new_rte) + 0) = value;
> -        new_ire.remap.fpd = 0;
> -        new_ire.remap.dm = new_rte.dest_mode;
> -        new_ire.remap.tm = new_rte.trigger;
> -        new_ire.remap.dlm = new_rte.delivery_mode;
> -        /* Hardware require RH = 1 for LPR delivery mode */
> -        new_ire.remap.rh = (new_ire.remap.dlm == dest_LowestPrio);
> -        new_ire.remap.avail = 0;
> -        new_ire.remap.res_1 = 0;
> -        new_ire.remap.vector = new_rte.vector;
> -        new_ire.remap.res_2 = 0;
> -
> -        set_ioapic_source_id(IO_APIC_ID(apic), &new_ire);
> -        new_ire.remap.res_3 = 0;
> -        new_ire.remap.res_4 = 0;
> -        new_ire.remap.p = 1;     /* finally, set present bit */
> -
> -        /* now construct new ioapic rte entry */
> -        remap_rte->vector = new_rte.vector;
> -        remap_rte->delivery_mode = 0;    /* has to be 0 for remap format */
> -        remap_rte->index_15 = (index >> 15) & 0x1;
> -        remap_rte->index_0_14 = index & 0x7fff;
> -
> -        remap_rte->delivery_status = new_rte.delivery_status;
> -        remap_rte->polarity = new_rte.polarity;
> -        remap_rte->irr = new_rte.irr;
> -        remap_rte->trigger = new_rte.trigger;
> -        remap_rte->mask = new_rte.mask;
> -        remap_rte->reserved = 0;
> -        remap_rte->format = 1;    /* indicate remap format */
> -    }
> -
> -    update_irte(iommu, iremap_entry, &new_ire, !init);
> +        new_ire.remap.dst = (new_rte.dest.dest32 >> 24) << 8;
> +
> +    new_ire.remap.dm = new_rte.dest_mode;
> +    new_ire.remap.tm = new_rte.trigger;
> +    new_ire.remap.dlm = new_rte.delivery_mode;
> +    /* Hardware require RH = 1 for LPR delivery mode */
> +    new_ire.remap.rh = (new_ire.remap.dlm == dest_LowestPrio);
> +    new_ire.remap.vector = new_rte.vector;
> +
> +    set_ioapic_source_id(IO_APIC_ID(apic), &new_ire);
> +    new_ire.remap.p = 1;     /* finally, set present bit */
> +
> +    /* now construct new ioapic rte entry */

Nit: Would you mind correcting comment style here as you touch (unindent)
the line?

> +    remap_rte->vector = new_rte.vector;
> +    remap_rte->delivery_mode = 0;    /* has to be 0 for remap format */
> +    remap_rte->index_15 = (index >> 15) & 0x1;
> +    remap_rte->index_0_14 = index & 0x7fff;
> +
> +    remap_rte->delivery_status = new_rte.delivery_status;
> +    remap_rte->polarity = new_rte.polarity;
> +    remap_rte->irr = new_rte.irr;
> +    remap_rte->trigger = new_rte.trigger;
> +    remap_rte->mask = new_rte.mask;
> +    remap_rte->reserved = 0;
> +    remap_rte->format = 1;    /* indicate remap format */
> +
> +    /* If cmpxchg16b is not available the caller must mask the IO-APIC pin. */
> +    update_irte(iommu, iremap_entry, &new_ire, !init && cpu_has_cx16);

The comment suggests to me that you mean to strengthen the logic, yet
the code change weakens it (the called function BUG()s when "atomic"
is true). Wouldn't this better be "!init && !<old RTE was/is masked>"
anyway?

> @@ -439,36 +427,47 @@ unsigned int cf_check io_apic_read_remap_rte(
>  }
>  
>  void cf_check io_apic_write_remap_rte(
> -    unsigned int apic, unsigned int reg, unsigned int value)
> +    unsigned int apic, unsigned int pin, uint64_t raw)
>  {
> -    unsigned int pin = (reg - 0x10) / 2;
> +    struct IO_xAPIC_route_entry rte = { .raw = raw };
>      struct IO_xAPIC_route_entry old_rte = { };
>      struct IO_APIC_route_remap_entry *remap_rte;
> -    unsigned int rte_upper = (reg & 1) ? 1 : 0;
>      struct vtd_iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic));
> -    int saved_mask;
> -
> -    old_rte = __ioapic_read_entry(apic, pin, true);
> +    bool masked = true;
> +    int rc;
>  
>      remap_rte = (struct IO_APIC_route_remap_entry *) &old_rte;
>  
> -    /* mask the interrupt while we change the intremap table */
> -    saved_mask = remap_rte->mask;
> -    remap_rte->mask = 1;
> -    __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
> -    remap_rte->mask = saved_mask;
> -
> -    if ( ioapic_rte_to_remap_entry(iommu, apic, pin,
> -                                   &old_rte, rte_upper, value) )
> +    if ( !cpu_has_cx16 )
>      {
> -        __io_apic_write(apic, reg, value);
> +       /*
> +        * Cannot atomically update the IRTE entry: mask the IO-APIC pin to
> +        * avoid interrupts seeing an inconsistent IRTE entry.
> +        */
> +        old_rte = __ioapic_read_entry(apic, pin, true);
> +        if ( !old_rte.mask )
> +        {
> +            masked = false;
> +            old_rte.mask = 1;
> +            __ioapic_write_entry(apic, pin, true, old_rte);
> +        }
> +    }
>  
> -        /* Recover the original value of 'mask' bit */
> -        if ( rte_upper )
> -            __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
> +    rc = ioapic_rte_to_remap_entry(iommu, apic, pin, &old_rte, rte);

I realize it has been like this before, but passing &old_rte here is
odd. We already have its properly typed alias: remap_rte. All the
called function does is do the same type cast again. Question is
whether ...

> +    if ( rc )
> +    {
> +        if ( !masked )
> +        {
> +            /* Recover the original value of 'mask' bit */
> +            old_rte.mask = 0;
> +            __ioapic_write_entry(apic, pin, true, old_rte);
> +        }
> +        dprintk(XENLOG_ERR VTDPREFIX,
> +                "failed to update IRTE for IO-APIC#%u pin %u: %d\n",
> +                apic, pin, rc);
> +        return;
>      }
> -    else
> -        __ioapic_write_entry(apic, pin, true, old_rte);
> +    __ioapic_write_entry(apic, pin, true, old_rte);

... the further uses of old_rte then won't end up yet more confusing
than they already are (first and foremost again because of "old" not
being applicable here).

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 10:38:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 10:38:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565753.884216 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM4Zb-0006cb-F2; Wed, 19 Jul 2023 10:38:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565753.884216; Wed, 19 Jul 2023 10:38:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM4Zb-0006cU-CN; Wed, 19 Jul 2023 10:38:23 +0000
Received: by outflank-mailman (input) for mailman id 565753;
 Wed, 19 Jul 2023 10:38:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8bnZ=DF=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qM4ZZ-00068b-KA
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 10:38:21 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 614b3663-2620-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 12:38:21 +0200 (CEST)
Received: from [192.168.1.101] (unknown [37.163.72.116])
 by support.bugseng.com (Postfix) with ESMTPSA id B82114EE0C89;
 Wed, 19 Jul 2023 12:38:19 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 614b3663-2620-11ee-b23a-6b7b168915f2
Message-ID: <c4534f8a-d479-dbcc-ddb1-81eb00b074a2@bugseng.com>
Date: Wed, 19 Jul 2023 12:38:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] x86/HVM: address violations of MISRA C:2012 Rules 8.2
 and 8.3
Content-Language: en-US, it
To: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com, Jan Beulich <jbeulich@suse.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
References: <7c89ac0fe44dbd1ba1436a91024efebf2794db40.1689761143.git.federico.serafini@bugseng.com>
 <e0b03fd7-0487-3328-b532-2950c3b1e34b@citrix.com>
From: Federico Serafini <federico.serafini@bugseng.com>
Organization: BUGSENG srl
In-Reply-To: <e0b03fd7-0487-3328-b532-2950c3b1e34b@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 19/07/23 12:23, Andrew Cooper wrote:
> On 19/07/2023 11:07 am, Federico Serafini wrote:
>> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
>> index 57363c2ae1..8f19a79f6f 100644
>> --- a/xen/arch/x86/hvm/hvm.c
>> +++ b/xen/arch/x86/hvm/hvm.c
>> @@ -319,7 +319,7 @@ static bool pat_valid(uint64_t val)
>>       return !(any_gt_7 | any_2_or_3);
>>   }
>>   
>> -int hvm_set_guest_pat(struct vcpu *v, uint64_t guest_pat)
>> +int hvm_set_guest_pat(struct vcpu *v, u64 guest_pat)
> 
> If there's a u64 vs uint64_t mismatch (or others for that matter),
> resolve in the way of the stdint types.Â  That way you're correcting in
> the direction of the Xen coding style, rather than away from it.

Changing the type in the declaration from u64 to uint64_t
touching hvm.h will lead to inconsistencies with adjacent declarations.
In such cases, should I propagate the change to the adjacent ones
as well?

>> diff --git a/xen/arch/x86/hvm/svm/nestedhvm.h b/xen/arch/x86/hvm/svm/nestedhvm.h
>> index 43245e13de..eb9c416307 100644
>> --- a/xen/arch/x86/hvm/svm/nestedhvm.h
>> +++ b/xen/arch/x86/hvm/svm/nestedhvm.h
>> @@ -42,7 +42,7 @@ int cf_check nsvm_vcpu_initialise(struct vcpu *v);
>>   int cf_check nsvm_vcpu_reset(struct vcpu *v);
>>   int nsvm_vcpu_vmrun(struct vcpu *v, struct cpu_user_regs *regs);
>>   int cf_check nsvm_vcpu_vmexit_event(struct vcpu *v,
>> -                                    const struct x86_event *event);
>> +                                    const struct x86_event *trap);
> 
> This needs to stay as event.Â  Trap is a related technical term, and
> incorrect to use here.Â  (Yes, the implementation of
> nsvm_vcpu_vmexit_event() is wrong.)

Ok.
>> diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
>> index 3c37f522b9..7943e287cf 100644
>> --- a/xen/arch/x86/include/asm/hvm/hvm.h
>> +++ b/xen/arch/x86/include/asm/hvm/hvm.h
>>       int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
>>       void (*handle_cd)(struct vcpu *v, unsigned long value);
>>       void (*set_info_guest)(struct vcpu *v);
>> -    void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
>> -    void (*set_descriptor_access_exiting)(struct vcpu *v, bool);
>> +    void (*set_rdtsc_exiting)(struct vcpu *v, bool_t enable);
> 
> In this case, we want to swap to bool as well as giving a name in the
> prototype.

Ok.

> xen.git/xen$ git grep -w bool_t | wc -l
> 441
> 
> I'm seriously tempted just to do a bulk fix of bool_t to get it over and
> done with...
> 
> ~Andrew

-- 
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 10:39:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 10:39:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565760.884226 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM4ao-0007EN-PE; Wed, 19 Jul 2023 10:39:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565760.884226; Wed, 19 Jul 2023 10:39:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM4ao-0007EG-MO; Wed, 19 Jul 2023 10:39:38 +0000
Received: by outflank-mailman (input) for mailman id 565760;
 Wed, 19 Jul 2023 10:39:36 +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
 <SRS0=sL7T=DF=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qM4am-0007Dg-I3
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 10:39:36 +0000
Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com
 [2a00:1450:4864:20::12c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8d30ee89-2620-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 12:39:34 +0200 (CEST)
Received: by mail-lf1-x12c.google.com with SMTP id
 2adb3069b0e04-4fb863edcb6so11382738e87.0
 for <xen-devel@lists.xenproject.org>; Wed, 19 Jul 2023 03:39:34 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 f25-20020ac251b9000000b004eb0c51780bsm897751lfk.29.2023.07.19.03.39.32
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 19 Jul 2023 03:39:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8d30ee89-2620-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689763174; x=1692355174;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=222jWkyHz8jH/hwrUjdVRK8EWWdHDOdhgdSin3Xrbuk=;
        b=lTT0MvQNPvsV5aH2B+WpoRB4p7t4oMttz7SULWe6UTHVox3m/sLWzj9Q5mJre4vPKC
         2W0Zu2U2FJwypiERqX4qX7pQhp+PvENUfXSqeFMf9Hj/dPQgjhlDIEJ+WSUOGrTw0l8k
         HAivetGr1T04okD7KAtzzRPOJAX1LIDAcs5Zg9CCgFOFgRc8+Bc7ipreC7oa+4GSzAw3
         MB0XCWesGNeAdnsL0KxVgDQ3Ryi0xVW55gNJiNodQ02i/oorkVpBxST586YwWlb+bm0T
         mVmAdfFpMvVy6JCHBJm+0Xjv325z3PgzBJGY3ZqeWVTcBnDxaq2Rncqz/nDmUrlUSb/J
         ieWw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689763174; x=1692355174;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=222jWkyHz8jH/hwrUjdVRK8EWWdHDOdhgdSin3Xrbuk=;
        b=KU+DnTQlwEYZ/rmMxCgDvSmtoKcXHmx8QsVAMj/R8V2P23tSxZgqJu3b9gQx2Qk/p3
         DtGHBxWdHnXb2OcpZgAhvj/plegBeEB/PwNHlWoCRe+qzMfhIdH1E608TH6F7XcN7KbR
         SeGA0+Rjz8r5vTr8MMdRkn9YAP9B9PzbmWCOITUEJfInONM/au4YEWgfF2gFQZMBFTyj
         0pSRpOm1LQF0peohlQkFHe0GxANQ0sOIGCmqKHn1F/a9O7Ea7Kl38dGNaSyqXqNCRyEF
         WKIx7GhOBhUO/oyT08RYtq2ZbLxtvsfg+npHSFMhi/OvCMv7Bx8kmwzdvgQCRJ9bciMo
         lRbg==
X-Gm-Message-State: ABy/qLaiBD7mQXsk17M51s7AefO1qfH6MhgX/fODYT67qwdN+VsG86ZX
	3SNc2llH2D8ZqBlSsCMUsNE=
X-Google-Smtp-Source: APBJJlE9aGLvXPfg91bSqn080WxMj62hS5hvm8sGeuRvrtA2K3Sp4vAszgpoBXXbo5lUfKn+RBcbeQ==
X-Received: by 2002:a19:7712:0:b0:4f9:5ca5:f1a6 with SMTP id s18-20020a197712000000b004f95ca5f1a6mr3457172lfc.17.1689763173755;
        Wed, 19 Jul 2023 03:39:33 -0700 (PDT)
Message-ID: <dbb568a33691b1fed5cb7f8de801a87e4aebbe4d.camel@gmail.com>
Subject: Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Bob Eshleman
	 <bobbyeshleman@gmail.com>, Alistair Francis <alistair.francis@wdc.com>, 
	Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
Date: Wed, 19 Jul 2023 13:39:32 +0300
In-Reply-To: <ad53c037-3c1b-ff1a-93df-b79ab2948174@suse.com>
References: <cover.1689604562.git.oleksii.kurochko@gmail.com>
	 <8c69050d7b1f42df5e776ca9494164a4d15f2d52.1689604562.git.oleksii.kurochko@gmail.com>
	 <ad53c037-3c1b-ff1a-93df-b79ab2948174@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote:
> On 17.07.2023 16:40, Oleksii Kurochko wrote:
> > The way how switch to virtual address was implemented in the
> > commit e66003e7be ("xen/riscv: introduce setup_initial_pages")
> > isn't safe enough as:
> > * enable_mmu() depends on hooking all exceptions
> > =C2=A0 and pagefault.
> > * Any exception other than pagefault, or not taking a pagefault
> > =C2=A0 causes it to malfunction, which means you will fail to boot
> > =C2=A0 depending on where Xen was loaded into memory.
> >=20
> > Instead of the proposed way of switching to virtual addresses was
> > decided to use identity mapping of the entrire Xen and after
> > switching to virtual addresses identity mapping is removed from
> > page-tables.
> > Since it is not easy to keep track where the identity map was
> > mapped,
> > so we will look for the top-most entry exclusive to the identity
> > map and remove it.
>=20
> Doesn't this paragraph need adjustment now?
It should be. Thanks. Ill update it in the next patch version.

>=20
> > --- a/xen/arch/riscv/mm.c
> > +++ b/xen/arch/riscv/mm.c
> > @@ -25,6 +25,12 @@ unsigned long __ro_after_init phys_offset;
> > =C2=A0#define LOAD_TO_LINK(addr) ((unsigned long)(addr) - phys_offset)
> > =C2=A0#define LINK_TO_LOAD(addr) ((unsigned long)(addr) + phys_offset)
> > =C2=A0
> > +/*
> > + * Should be removed as soon as enough headers will be merged for
> > inclusion of
> > + * <xen/lib.h>.
> > + */
> > +#define ARRAY_SIZE(arr)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(sizeof(arr) /
> > sizeof((arr)[0]))
>=20
> Like said to Shawn for PPC in [1], there's now a pretty easy way to
> get this macro available for use here without needing to include
> xen/lib.h.
>=20
> [1]
> https://lists.xen.org/archives/html/xen-devel/2023-07/msg01081.html
Great. It'll be very useful for me so I'll add dependency on the patch
where ARRAY_SIZE and ROUNDUP are moved to <xen/macros.h>.

>=20
> > @@ -35,8 +41,10 @@ unsigned long __ro_after_init phys_offset;
> > =C2=A0 *
> > =C2=A0 * It might be needed one more page table in case when Xen load
> > address
> > =C2=A0 * isn't 2 MB aligned.
> > + *
> > + * CONFIG_PAGING_LEVELS page tables are needed for identity
> > mapping.
> > =C2=A0 */
> > -#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) + 1)
> > +#define PGTBL_INITIAL_COUNT (CONFIG_PAGING_LEVELS * 2 + 1)
>=20
> Where did the "- 1" go?
My fault. Should be:
  #define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS * 2  - 1) + 1)

>=20
> > @@ -255,25 +266,40 @@ void __init noreturn noinline enable_mmu()
> > =C2=A0=C2=A0=C2=A0=C2=A0 csr_write(CSR_SATP,
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 PFN_DOWN((unsigned long)stage1_pgtbl_root) |
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 RV_STAGE1_MODE << SATP_MODE_SHIFT);
> > +}
> > =C2=A0
> > -=C2=A0=C2=A0=C2=A0 asm volatile ( ".p2align 2" );
> > - mmu_is_enabled:
> > -=C2=A0=C2=A0=C2=A0 /*
> > -=C2=A0=C2=A0=C2=A0=C2=A0 * Stack should be re-inited as:
> > -=C2=A0=C2=A0=C2=A0=C2=A0 * 1. Right now an address of the stack is rel=
ative to load
> > time
> > -=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0=C2=A0 addresses what will cause=
 an issue in case of load start
> > address
> > -=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0=C2=A0 isn't equal to linker sta=
rt address.
> > -=C2=A0=C2=A0=C2=A0=C2=A0 * 2. Addresses in stack are all load time rel=
ative which can
> > be an
> > -=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0=C2=A0 issue in case when load s=
tart address isn't equal to
> > linker
> > -=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0=C2=A0 start address.
> > -=C2=A0=C2=A0=C2=A0=C2=A0 *
> > -=C2=A0=C2=A0=C2=A0=C2=A0 * We can't return to the caller because the s=
tack was reseted
> > -=C2=A0=C2=A0=C2=A0=C2=A0 * and it may have stash some variable on the =
stack.
> > -=C2=A0=C2=A0=C2=A0=C2=A0 * Jump to a brand new function as the stack w=
as reseted
> > -=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +void __init remove_identity_mapping(void)
> > +{
> > +=C2=A0=C2=A0=C2=A0 unsigned int i;
> > +=C2=A0=C2=A0=C2=A0 pte_t *pgtbl;
> > +=C2=A0=C2=A0=C2=A0 unsigned int index, xen_index;
> > +=C2=A0=C2=A0=C2=A0 unsigned long load_start =3D LINK_TO_LOAD(_start);
> > +
> > +=C2=A0=C2=A0=C2=A0 for ( pgtbl =3D stage1_pgtbl_root, i =3D CONFIG_PAG=
ING_LEVELS; i;
> > i-- )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 index =3D pt_index(i - 1, l=
oad_start);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 xen_index =3D pt_index(i - =
1, XEN_VIRT_START);
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( index !=3D xen_index )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* =
remove after it will be possible to include
> > <xen/lib.h> */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #de=
fine ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
>=20
> ROUNDUP() is even part of the patch that I've submitted already.
>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uns=
igned long load_end =3D LINK_TO_LOAD(_end);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uns=
igned long pt_level_size =3D XEN_PT_LEVEL_SIZE(i -
> > 1);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uns=
igned long xen_size =3D ROUNDUP(load_end -
> > load_start, pt_level_size);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uns=
igned long page_entries_num =3D xen_size /
> > pt_level_size;
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 whi=
le ( page_entries_num-- )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 pgtbl[index++].pte =3D 0;
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bre=
ak;
>=20
> Unless there's a "not crossing a 2Mb boundary" guarantee somewhere
> that I've missed, this "break" is still too early afaict.
You are right. I have to re-write this part again.
Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 11:03:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 11:03:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565765.884237 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM4xM-0002in-RG; Wed, 19 Jul 2023 11:02:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565765.884237; Wed, 19 Jul 2023 11:02:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM4xM-0002ig-O6; Wed, 19 Jul 2023 11:02:56 +0000
Received: by outflank-mailman (input) for mailman id 565765;
 Wed, 19 Jul 2023 11:02:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=fyAl=DF=citrix.com=prvs=55726f7b7=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qM4xL-0002ia-IE
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 11:02:55 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cded28d3-2623-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 13:02:53 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cded28d3-2623-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689764573;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=QkK8keeBZ42tUpYma4o641af501b1G6fdW+eFxuH8DQ=;
  b=RvOo/MO9vqaxTvGXRy1ldfFb4cKxHX59xdJ7EQCGS+jV+yxHotfoNvfN
   uOGbeFAQh3UwlaT8wjDHl71z6e/lBbjfVkPrHAVu3JtNSAzp69AvHbUxo
   Ii2+QWdT7n3izDRM7zI/IWCFYqWYRu+9sbvKhz2SfQWJhoeAG2L93gy1o
   Y=;
Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 116013071
X-Ironport-Server: esa6.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:0bjzVKIw1e0KBV69FE+R0ZUlxSXFcZb7ZxGr2PjKsXjdYENS0jwAn
 WIWCmyPPa2CYGvzLox1YIm28k9XvJfVy4VjQQRlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr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UY/9YiaTJa7skC8IMji2hC6mlwRA09TyXGra
 +TdaUguSMc1gx9ZJh5o6H6BEDyewKnyXcV2/hbAV7MZniAhILFFuFfBM7ZskXd8k7Fh6RgPM
 VbAs5D4bTLZDAQ56ia3OD7KadY/DDuytHtuQ609QYOcegeUdAF0+4PMHf/LqQZfngkObMJUL
 6nouZXrTupfnoaKu6hAGMeYuTFr9rX0Lr7fB8vHXccmUSzpALtzIS/PwmT3x8YXT8K66wl63
 L5nwvw4bjmm+2nyyXby3TY4/1t6ZfcI5p4dYOxY/ouW3TRYzWTFcRcsnq5zXMISdSUmRgXeR
 /30lUd1opImjbslyqO0GbQMkHboUoTAjnZuBilaDLY0LLEbSN/RtBehZ9Sc3LimjUdlcA536
 RR022DsZ1LSRvGgSTm/tDNEwpnj0yuvBMZ4JguZlFkIP8jgYVq3Psi1VIQFI1FEDPx6YghHu
 UrBMbA5OxOeVffa3zCpGFgzNGlQ3x2R369MwA/k93Q1yITkGFyzkMeysBalnAc9IglQ50B4+
 jfKKxnmLxHU8dTZ6NgA+UKR9exFwX2MFvxGXPXJU6iGLAMOnrLpZKy6LIp5PuycJhN15c2kI
 SpaiIsiYfzQTOdNSSj5uw5zvmWehTNYd3E8LAv26RE
X-Talos-CUID: 9a23:aJe5eWCKwoC90i/6EzJGxmAUR8kpS1zU7n7peGngMmlPabLAHA==
X-Talos-MUID: =?us-ascii?q?9a23=3ANTnxEQ6tTqJnrlLqrKApF5z/xox03aTyFms9t6k?=
 =?us-ascii?q?NtvOmGAloZAif0gyeF9o=3D?=
X-IronPort-AV: E=Sophos;i="6.01,216,1684814400"; 
   d="scan'208";a="116013071"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
	<JBeulich@suse.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>
Subject: [PATCH] xen/x86: Use const char * for string literals (2)
Date: Wed, 19 Jul 2023 12:02:39 +0100
Message-ID: <20230719110239.4065060-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

This hunk was accidentally missing from a previous change.

Fixes: d642c0706678 ("xen/x86: Use const char * for string literals")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>

This was missed because it was mixed up in cmdline mess in __start_xen().
---
 xen/arch/x86/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 74e3915a4dce..2dbe9857aa60 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -968,7 +968,7 @@ static struct domain *__init create_dom0(const module_t *image,
 
 void __init noreturn __start_xen(unsigned long mbi_p)
 {
-    char *memmap_type = NULL;
+    const char *memmap_type = NULL;
     char *cmdline, *kextra, *loader;
     void *bsp_stack;
     struct cpu_info *info = get_cpu_info(), *bsp_info;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 11:11:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 11:11:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565769.884247 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM55r-0004Ro-Lt; Wed, 19 Jul 2023 11:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565769.884247; Wed, 19 Jul 2023 11:11:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM55r-0004Rh-JG; Wed, 19 Jul 2023 11:11:43 +0000
Received: by outflank-mailman (input) for mailman id 565769;
 Wed, 19 Jul 2023 11:11:42 +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
 <SRS0=7Hz6=DF=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qM55q-0004RW-3F
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 11:11:42 +0000
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com
 [2a00:1450:4864:20::130])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0782fbd5-2625-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 13:11:37 +0200 (CEST)
Received: by mail-lf1-x130.google.com with SMTP id
 2adb3069b0e04-4fba1288bbdso11069831e87.1
 for <xen-devel@lists.xenproject.org>; Wed, 19 Jul 2023 04:11:37 -0700 (PDT)
Received: from EMEAENGAAD19049. (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 i14-20020a17090671ce00b0098866a94f14sm2174938ejk.125.2023.07.19.04.11.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 19 Jul 2023 04:11:36 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0782fbd5-2625-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689765097; x=1690369897;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=5Y7iNeASOLCAHxlLBaWvcbKrGIMRiUrIQIuv2nh6jgQ=;
        b=O7m403z+KTV1yb2zkJq5jWbDBVjIh6WMqEQtyfFkymBDZzMQG6oYW2omdJXB0vx0Th
         t2wDIfDHYKxG5zJafROmrK6rvXzHonJHFVlY3LdaploVuQ++IYlyt1tEQZRtJZkR4EKO
         R64C/mlrAWW4x7bw+GxJXh+Rb5r0z7FKf66kc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689765097; x=1690369897;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=5Y7iNeASOLCAHxlLBaWvcbKrGIMRiUrIQIuv2nh6jgQ=;
        b=kknUbsCF2yodBT02OUn4+HmlvwY5BQL1xhsV9grCCAwMkYm0CjV/FZ6iwhBCdADCVt
         Leezjianb1nY/8Ggka+WavYe3Dwse8qU0XPt52y2z79AWq+PK1qS94czUHIkFMN/9SAB
         KIUJn9fO3QiAvBUo+Yuc/4Of1LSopgc5GwgYEGbj6ws5/UTme/opQZgB1d0mGNDBSmpc
         SyrCYLpeJ4GCUovAmEjnyUXaU+IoSBtYud3NULUwt8gD4xX9bpc/o6IbOjxePKFi4plH
         2UV8KSks7mjVwllYpWsYD/+qUdabUrUOr2QkwU+sxkTFtj134F0MWwSQ1heiLBG0UE7B
         ETnA==
X-Gm-Message-State: ABy/qLYTHT8AadJRGaBR2jkfvr5NaXMAY8t5mt2V6VZ8u9tCChDlyfoM
	vofmV5NOSMHBBDsRWF7lLvHzbXLXCh1XCYY1SDI=
X-Google-Smtp-Source: APBJJlFFHbZG/CximVedQvjBFlBk0OC9ddRPGdcLYwD7c0Pl6oJC0paQ5fUE5cKMbMFUyzuicM7Qhw==
X-Received: by 2002:a2e:9583:0:b0:2b5:1b80:263a with SMTP id w3-20020a2e9583000000b002b51b80263amr16566192ljh.47.1689765097264;
        Wed, 19 Jul 2023 04:11:37 -0700 (PDT)
Message-ID: <64b7c4e8.170a0220.4baaf.8ea6@mx.google.com>
X-Google-Original-Message-ID: <ZLfE55y9cjWT689L@EMEAENGAAD19049.>
Date: Wed, 19 Jul 2023 12:11:35 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v3 3/3] x86: Add Kconfig option to require NX bit support
References: <20230629121713.1211-1-alejandro.vallejo@cloud.com>
 <20230629121713.1211-4-alejandro.vallejo@cloud.com>
 <386eb540-8688-1a95-1e75-133bb21223fc@suse.com>
 <3c087e81-73f2-b284-d035-807f64b78e6d@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <3c087e81-73f2-b284-d035-807f64b78e6d@suse.com>

On Wed, Jul 19, 2023 at 08:13:27AM +0200, Jan Beulich wrote:
> On 18.07.2023 15:19, Jan Beulich wrote:
> > On 29.06.2023 14:17, Alejandro Vallejo wrote:
> >> --- a/xen/arch/x86/boot/head.S
> >> +++ b/xen/arch/x86/boot/head.S
> >> @@ -123,6 +123,7 @@ multiboot2_header:
> >>  .Lbad_ldr_nih: .asciz "ERR: EFI ImageHandle is not provided by bootloader!"
> >>  .Lbad_efi_msg: .asciz "ERR: EFI IA-32 platforms are not supported!"
> >>  .Lbag_alg_msg: .asciz "ERR: Xen must be loaded at a 2Mb boundary!"
> >> +.Lno_nx_msg:   .asciz "ERR: Not an NX-capable CPU!"
> >>  
> >>          .section .init.data, "aw", @progbits
> >>          .align 4
> >> @@ -153,6 +154,11 @@ early_error: /* Here to improve the disassembly. */
> >>  .Lnot_aligned:
> >>          add     $sym_offs(.Lbag_alg_msg), %esi
> >>          jmp     .Lget_vtb
> >> +#ifdef CONFIG_REQUIRE_NX
> >> +.Lno_nx:
> >> +        add     $sym_offs(.Lno_nx_msg), %esi
> >> +        jmp     .Lget_vtb
> >> +#endif
> > 
> > Since I'm in the process of introducing more such paths (for the x86-64-v<N>
> > series), I'm curious: Have you actually had success with getting any output
> > from this code path? I see unreadable output come through serial (provided
> > it's the normal com1 I/O port location where the serial port is), which
> > likely is because baud rate wasn't configured yet, and hence I might have
> > success by changing the config of the receiving side. And I see nothing at
> > all on the screen. While kind of expected when in graphics mode, I wonder
> > whether this ever worked, or whether this has simply bitrotted because of
> > never actually coming into play.
I hacked the code to exercise the XD_DISABLE code path, but didn't try to
exercise the failure paths, I'm afraid. Sorry.
> 
> Pretty clearly this was broken in the course of adding MB2 support, by
> b28044226e1c using %esi as the "relocation base" after already having
> clobbered it. I'm working on a fix.
> 
> Jan
Uh-oh. Good catch.

Alejandro


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 11:35:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 11:35:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565777.884256 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM5Sy-0007RD-H4; Wed, 19 Jul 2023 11:35:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565777.884256; Wed, 19 Jul 2023 11:35:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM5Sy-0007R6-EO; Wed, 19 Jul 2023 11:35:36 +0000
Received: by outflank-mailman (input) for mailman id 565777;
 Wed, 19 Jul 2023 11:35:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7Hz6=DF=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qM5Sw-0007R0-Ts
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 11:35:34 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5f41bcdb-2628-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 13:35:33 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-51e99584a82so9297245a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 19 Jul 2023 04:35:33 -0700 (PDT)
Received: from EMEAENGAAD19049. (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 l10-20020a170906414a00b0099304c10fd3sm2185034ejk.196.2023.07.19.04.35.32
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 19 Jul 2023 04:35:32 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5f41bcdb-2628-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689766533; x=1690371333;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:subject:cc:to:from:date:message-id:from:to
         :cc:subject:date:message-id:reply-to;
        bh=j71jneZtuQAsJTv8f5uyNleTabsoYSHT74bsFM2BaOY=;
        b=SyDCUm6b0HJuHL4RM123G0ZpJKsgb+Gs6v96vMpDQbsUG/7HsYRlZcYulIKHWNISEE
         91fRH4oBe0BL6ijdCladr8e39NBO8HjeGfV2m+MbwIOT5Vz/ZWJgmHA6Q4p+8HQF1k8c
         pcWmej5/Th1s6sQBn9Qo6YZz6Q1oalk492TJM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689766533; x=1690371333;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:subject:cc:to:from:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=j71jneZtuQAsJTv8f5uyNleTabsoYSHT74bsFM2BaOY=;
        b=KUFTWMqfSqJRD4uRZDCOvG/omCsZfxBB3ZAJ9P9/+wFwjqTL1J5SP6qoIGwmKGQuTP
         jgiAQilx8oc62gqtFrE8provSDlOXF9ZnEW4cs9L/dKaimYvOtD8hVfnqCAAvR8R5XXX
         u0ipXaolsaP+u0432COb6023WOp+Cb99t44Dg/AqceCfi468izS2UIPrjPe9gb0SV6HS
         HyxPvH618PZ7DEWsiqQyaNclNRTddpx9z7DIhEcqUV26S7DP53vyydjbyTq2Ewx8veIx
         HTtCStyWw7gWzQ9RGG/yTD4SziLlBK28letdXy30lrG9V1Ijpd+OCN5j3jG8eOVzS23b
         A9rw==
X-Gm-Message-State: ABy/qLbtTdD81kFp/9qQmjdAkOf9I4bkamTk2T0qpzNvXYsntkgbo+k2
	RpnrpcYSNyHHQUtHHObckVy1GQ==
X-Google-Smtp-Source: APBJJlEN4xkZQYOC/awY0QQJqFQIMmgzj05wp3rXTFzKxS+Cv6In94CeH0ndBVVmo0ONV9+Gb4r0uQ==
X-Received: by 2002:a17:906:f9c2:b0:989:34a0:45b0 with SMTP id lj2-20020a170906f9c200b0098934a045b0mr2044907ejb.49.1689766533046;
        Wed, 19 Jul 2023 04:35:33 -0700 (PDT)
Message-ID: <64b7ca84.170a0220.758d8.90e0@mx.google.com>
X-Google-Original-Message-ID: <ZLfKgvREje1EwBnF@EMEAENGAAD19049.>
Date: Wed, 19 Jul 2023 12:35:30 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Jan Beulich <JBeulich@suse.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: Re: [PATCH] x86/mem: Make mem_hotadd_check() more legible
References: <20230719100808.4046779-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230719100808.4046779-1-andrew.cooper3@citrix.com>

On Wed, Jul 19, 2023 at 11:08:08AM +0100, Andrew Cooper wrote:
> Introduce a ROUND() macro to mirror ROUNDUP().  Use both to remove all the
> opencoded rounding in mem_hotadd_check().  Fix other minor style issues.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Wei Liu <wl@xen.org>
> 
> The compiled binary is identical.
> ---
>  xen/arch/x86/x86_64/mm.c | 31 +++++++++++++------------------
>  xen/include/xen/macros.h |  1 +
>  2 files changed, 14 insertions(+), 18 deletions(-)
> 
> diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
> index 60db439af3ec..38f978cab269 100644
> --- a/xen/arch/x86/x86_64/mm.c
> +++ b/xen/arch/x86/x86_64/mm.c
> @@ -1159,10 +1159,10 @@ static int mem_hotadd_check(unsigned long spfn, unsigned long epfn)
>  {
>      unsigned long s, e, length, sidx, eidx;
>  
> -    if ( (spfn >= epfn) )
> +    if ( spfn >= epfn )
>          return 0;
>  
> -    if (pfn_to_pdx(epfn) > FRAMETABLE_NR)
> +    if ( pfn_to_pdx(epfn) > FRAMETABLE_NR )
>          return 0;
>  
>      if ( (spfn | epfn) & ((1UL << PAGETABLE_ORDER) - 1) )
> @@ -1172,10 +1172,9 @@ static int mem_hotadd_check(unsigned long spfn, unsigned long epfn)
>          return 0;
>  
>      /* Make sure the new range is not present now */
> -    sidx = ((pfn_to_pdx(spfn) + PDX_GROUP_COUNT - 1)  & ~(PDX_GROUP_COUNT - 1))
> -            / PDX_GROUP_COUNT;
> -    eidx = (pfn_to_pdx(epfn - 1) & ~(PDX_GROUP_COUNT - 1)) / PDX_GROUP_COUNT;
> -    if (sidx >= eidx)
> +    sidx = ROUNDUP(pfn_to_pdx(spfn),     PDX_GROUP_COUNT) / PDX_GROUP_COUNT;
> +    eidx = ROUND  (pfn_to_pdx(epfn - 1), PDX_GROUP_COUNT) / PDX_GROUP_COUNT;
See [1] for both the sidx and eidx lines.
> +    if ( sidx >= eidx )
>          return 0;
>  
>      s = find_next_zero_bit(pdx_group_valid, eidx, sidx);
> @@ -1186,28 +1185,24 @@ static int mem_hotadd_check(unsigned long spfn, unsigned long epfn)
>          return 0;
>  
>      /* Caculate at most required m2p/compat m2p/frametable pages */
> -    s = (spfn & ~((1UL << (L2_PAGETABLE_SHIFT - 3)) - 1));
> -    e = (epfn + (1UL << (L2_PAGETABLE_SHIFT - 3)) - 1) &
> -            ~((1UL << (L2_PAGETABLE_SHIFT - 3)) - 1);
> +    s = ROUND  (spfn, 1UL << (L2_PAGETABLE_SHIFT - 3));
> +    e = ROUNDUP(epfn, 1UL << (L2_PAGETABLE_SHIFT - 3));
>  
>      length = (e - s) * sizeof(unsigned long);
>  
> -    s = (spfn & ~((1UL << (L2_PAGETABLE_SHIFT - 2)) - 1));
> -    e = (epfn + (1UL << (L2_PAGETABLE_SHIFT - 2)) - 1) &
> -            ~((1UL << (L2_PAGETABLE_SHIFT - 2)) - 1);
> -
> -    e = min_t(unsigned long, e,
> +    s =     ROUND  (spfn, 1ULL << (L2_PAGETABLE_SHIFT - 2));
See [1] for s.
> +    e = min(ROUNDUP(epfn, 1ULL << (L2_PAGETABLE_SHIFT - 2)),
>              (RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START) >> 2);
>  
>      if ( e > s )
> -        length += (e -s) * sizeof(unsigned int);
> +        length += (e - s) * sizeof(unsigned int);
>  
> -    s = pfn_to_pdx(spfn) & ~(PDX_GROUP_COUNT - 1);
> -    e = ( pfn_to_pdx(epfn) + (PDX_GROUP_COUNT - 1) ) & ~(PDX_GROUP_COUNT - 1);
> +    s = ROUND  (pfn_to_pdx(spfn), PDX_GROUP_COUNT);
See [1] for s.
> +    e = ROUNDUP(pfn_to_pdx(epfn), PDX_GROUP_COUNT);
>  
>      length += (e - s) * sizeof(struct page_info);
>  
> -    if ((length >> PAGE_SHIFT) > (epfn - spfn))
> +    if ( (length >> PAGE_SHIFT) > (epfn - spfn) )
>          return 0;
>  
>      return 1;
> diff --git a/xen/include/xen/macros.h b/xen/include/xen/macros.h
> index 7b92d345044d..ceeffcaa95ff 100644
> --- a/xen/include/xen/macros.h
> +++ b/xen/include/xen/macros.h
> @@ -1,6 +1,7 @@
>  #ifndef __MACROS_H__
>  #define __MACROS_H__
>  
> +#define ROUND(x, a)   ((x) & ~((a) - 1))
Why not ROUNDDOWN() or ROUND_DOWN()? ROUND() doesn't imply a specific
direction and can be confusing if ROUNDUP is not seen next to it.
>  #define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
>  
>  #define IS_ALIGNED(val, align) (!((val) & ((align) - 1)))
> 
> base-commit: b1c16800e52743d9afd9af62c810f03af16dd942
> -- 
> 2.30.2
> 
> 

[1] The hand-crafted alignment there is going to collide with the efforts
to integrate automatic style checkers. It's also not conveying critical
information, so I'd argue for its removal in the spirit of making future
diffs less intrusive.

Alejandro


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 11:38:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 11:38:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565780.884266 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM5Vn-0008El-UQ; Wed, 19 Jul 2023 11:38:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565780.884266; Wed, 19 Jul 2023 11:38:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM5Vn-0008Ee-Rm; Wed, 19 Jul 2023 11:38:31 +0000
Received: by outflank-mailman (input) for mailman id 565780;
 Wed, 19 Jul 2023 11:38:30 +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
 <SRS0=fyAl=DF=citrix.com=prvs=55726f7b7=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qM5Vm-0008EU-3a
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 11:38:30 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c62b4d83-2628-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 13:38:27 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c62b4d83-2628-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689766707;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=cdykyWCvhm1VHiDSC7vriJlmZ/kQcwKm2xlZFrfOK2c=;
  b=HsfB+65Cr7bKV9GbwDHIz/pwGcBZ6L05WgK57FBdxnifGjb0IWNA8ZLW
   GXMtBo4X0UrPdKa+9c+FPku03NCwFQVeoxfF83V+1YqwP3i0aZsWT38Km
   V82b0V68c3v4/HmavGTkgZdmpVfmPMaNXWkscLH7xjZWI093z6+h5AEvH
   4=;
Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 116016133
X-Ironport-Server: esa6.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:exH2Pqp1MmxoxR/M5BpEm3cb4cxeBmKBZRIvgKrLsJaIsI4StFCzt
 garIBmDMq7cazDxf9Fyb9jnpBsPuMLcyN9jHVY+qSEzQikVo5uZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weBzihNVfrzGInqR5fGatgMdgKFb
 76rIIGRpgvx4xorA9W5pbf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BCQxEdRNdsSy3QAX0vHgen6
 js=
IronPort-HdrOrdr: A9a23:1cjE0aEDkXc85cmHpLqE5seALOsnbusQ8zAXPhZKOHhom62j5q
 KTdZsgvyMc5Ax9ZJhko7690cq7MBDhHPxOjrX5Zo3SOzUO0VHAROpfBMnZogEIcBefygcy78
 tdm6YXMqyUMWRH
X-Talos-CUID: 9a23:VxdgfGFFYS0DlKMTqmI8rGEuBsYkTkSA3W3Bf2aUOGpteaa8HAo=
X-Talos-MUID: 9a23:e/gxWAlWS0Hz7P5GbP35dnpHJoRHvKqPWXomjLQd59WAMxRpPG+S2WE=
X-IronPort-AV: E=Sophos;i="6.01,216,1684814400"; 
   d="scan'208";a="116016133"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
	<JBeulich@suse.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
	Roberto Bagnara <roberto.bagnara@bugseng.com>, Nicola Vetrini
	<nicola.vetrini@bugseng.com>
Subject: [RFC REPOST] xen: Enable -Wwrite-strings
Date: Wed, 19 Jul 2023 12:38:10 +0100
Message-ID: <20230719113810.4066290-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

This is the remainder change to get x86 compiling with -Wwrite-strings.  ARM
still has some cleanup to go.

There are two swamps left.

  1) efi_arch_handle_cmdline().  Swapping name.s for name.cs makes the code
     compile, but only because the underlying union launders the pointer back
     to being mutable.

  2) dom0 cmdline.  There are various string literals which get moved/copied
     around but even with this const-ing, it only compiles because of a
     pointer laundered through strstr().

I think we do want to get Xen to a point where we can compile with
-Wwrite-strings unilaterally active, because it covers a lot of obvious and
simple cases, but that will involve fixing these two swaps and I don't think
we want to just take this patch and call it done.

For ARM, here is a gitlab run from a while back:

  https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/931418508

There's one breakage here:

  In file included from arch/arm/efi/boot.c:700:
  arch/arm/efi/efi-boot.h: In function 'efi_arch_handle_cmdline':
  arch/arm/efi/efi-boot.h:482:16: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
    482 |         name.s = "xen";
        |                ^

which which mirrors the x86 side, but others such as:

  drivers/char/arm-uart.c: In function 'dt_uart_init':
  drivers/char/arm-uart.c:81:17: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
     81 |         options = "";
        |                 ^

which will need looking in to.  Please can someone else look into the ARM
side.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Roberto Bagnara <roberto.bagnara@bugseng.com>
CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/Makefile                          | 2 ++
 xen/arch/x86/dom0_build.c             | 2 +-
 xen/arch/x86/efi/efi-boot.h           | 2 +-
 xen/arch/x86/hvm/dom0_build.c         | 4 ++--
 xen/arch/x86/include/asm/dom0_build.h | 4 ++--
 xen/arch/x86/include/asm/setup.h      | 2 +-
 xen/arch/x86/pv/dom0_build.c          | 2 +-
 xen/arch/x86/setup.c                  | 7 ++++---
 8 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index e8aa66378168..4424460a690a 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -380,6 +380,8 @@ else
 CFLAGS += -fomit-frame-pointer
 endif
 
+CFLAGS += -Wwrite-strings
+
 CFLAGS-$(CONFIG_CC_SPLIT_SECTIONS) += -ffunction-sections -fdata-sections
 
 CFLAGS += -nostdinc -fno-builtin -fno-common
diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 9f5300a3efbb..8b1fcc6471d8 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -564,7 +564,7 @@ int __init dom0_setup_permissions(struct domain *d)
 
 int __init construct_dom0(struct domain *d, const module_t *image,
                           unsigned long image_headroom, module_t *initrd,
-                          char *cmdline)
+                          const char *cmdline)
 {
     int rc;
 
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 92f4cfe8bd11..fb64413e6b39 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -324,7 +324,7 @@ static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
         w2s(&name);
     }
     else
-        name.s = "xen";
+        name.cs = "xen";
     place_string(&mbi.cmdline, name.s);
 
     if ( mbi.cmdline )
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index fd2cbf68bc62..a7ae9c3b046e 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -532,7 +532,7 @@ static paddr_t __init find_memory(
 static int __init pvh_load_kernel(struct domain *d, const module_t *image,
                                   unsigned long image_headroom,
                                   module_t *initrd, void *image_base,
-                                  char *cmdline, paddr_t *entry,
+                                  const char *cmdline, paddr_t *entry,
                                   paddr_t *start_info_addr)
 {
     void *image_start = image_base + image_headroom;
@@ -1177,7 +1177,7 @@ static void __hwdom_init pvh_setup_mmcfg(struct domain *d)
 int __init dom0_construct_pvh(struct domain *d, const module_t *image,
                               unsigned long image_headroom,
                               module_t *initrd,
-                              char *cmdline)
+                              const char *cmdline)
 {
     paddr_t entry, start_info;
     int rc;
diff --git a/xen/arch/x86/include/asm/dom0_build.h b/xen/arch/x86/include/asm/dom0_build.h
index a5f8c9e67f68..107c1ff98367 100644
--- a/xen/arch/x86/include/asm/dom0_build.h
+++ b/xen/arch/x86/include/asm/dom0_build.h
@@ -16,12 +16,12 @@ int dom0_setup_permissions(struct domain *d);
 int dom0_construct_pv(struct domain *d, const module_t *image,
                       unsigned long image_headroom,
                       module_t *initrd,
-                      char *cmdline);
+                      const char *cmdline);
 
 int dom0_construct_pvh(struct domain *d, const module_t *image,
                        unsigned long image_headroom,
                        module_t *initrd,
-                       char *cmdline);
+                       const char *cmdline);
 
 unsigned long dom0_paging_pages(const struct domain *d,
                                 unsigned long nr_pages);
diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index ae0dd3915a61..51fce66607dc 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -35,7 +35,7 @@ int construct_dom0(
     struct domain *d,
     const module_t *kernel, unsigned long kernel_headroom,
     module_t *initrd,
-    char *cmdline);
+    const char *cmdline);
 void setup_io_bitmap(struct domain *d);
 
 unsigned long initial_images_nrpages(nodeid_t node);
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index c99135a5522f..909ee9a899a4 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -358,7 +358,7 @@ int __init dom0_construct_pv(struct domain *d,
                              const module_t *image,
                              unsigned long image_headroom,
                              module_t *initrd,
-                             char *cmdline)
+                             const char *cmdline)
 {
     int i, rc, order, machine;
     bool compatible, compat;
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 2dbe9857aa60..7cdbe595daf7 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -835,7 +835,7 @@ static bool __init loader_is_grub2(const char *loader_name)
     return (p != NULL) && (p[5] != '0');
 }
 
-static char * __init cmdline_cook(char *p, const char *loader_name)
+static const char *__init cmdline_cook(const char *p, const char *loader_name)
 {
     p = p ? : "";
 
@@ -883,7 +883,7 @@ static struct domain *__init create_dom0(const module_t *image,
         },
     };
     struct domain *d;
-    char *cmdline;
+    const char *cmdline;
     domid_t domid;
 
     if ( opt_dom0_pvh )
@@ -969,7 +969,8 @@ static struct domain *__init create_dom0(const module_t *image,
 void __init noreturn __start_xen(unsigned long mbi_p)
 {
     const char *memmap_type = NULL;
-    char *cmdline, *kextra, *loader;
+    const char *cmdline, *loader;
+    char *kextra;
     void *bsp_stack;
     struct cpu_info *info = get_cpu_info(), *bsp_info;
     unsigned int initrdidx, num_parked = 0;

base-commit: b1c16800e52743d9afd9af62c810f03af16dd942
prerequisite-patch-id: 4c64676f65b22476813ddf3241f1c71c024da970
prerequisite-patch-id: 7a565eba5d6054aef78ea9226a6bdeaeab207405
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 11:38:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 11:38:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565781.884277 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM5Vu-0008WI-AF; Wed, 19 Jul 2023 11:38:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565781.884277; Wed, 19 Jul 2023 11:38:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM5Vu-0008WB-7O; Wed, 19 Jul 2023 11:38:38 +0000
Received: by outflank-mailman (input) for mailman id 565781;
 Wed, 19 Jul 2023 11:38:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM5Vt-0008VU-4f
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 11:38:37 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2044.outbound.protection.outlook.com [40.107.13.44])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cb32d503-2628-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 13:38:35 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU2PR04MB8904.eurprd04.prod.outlook.com (2603:10a6:10:2e3::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Wed, 19 Jul
 2023 11:38:04 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 11:38:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cb32d503-2628-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=DG82uEcMRZc/LSokcWf8/F5vq1bJ5EGREiiLiwjJQp4ByVIITGHsnaCPRTwXy0o1dJRmNy5jmBbsvSr+EakuJdYVYZRPJPvAssdVznUsjJ7GxANxF0ptp0tX/dMUo16Zbxg0/T/euENcDPwu9gWUUvVCLE0WEvDXT5OZYmJsNUiXUE42RhxfFHRaL0b4l19XWdkCqJu5juyyAcpeAiwRoKX0lhaa/CbSd/0dBFzHn4wKe3S3Jl1mL+PmNm3Ue1Kdb7eZ/mBuNxEJ/aGu8uh8kNBXUO65yUI1Rfi1OuteB9d+uDJwF5GQ4M92DaD6So76rvP+N7kWfedhSLdOXn3WoA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=YAu+K1yGs6EyfiupcFnDZvDzmMJj/ZtuJmcoKmLMP/s=;
 b=PvFVVlA8Hq4pojMSD1Y+jrG9oXpIu5KJlUNZUaTVpGeHQMMczPe7ZlHo8eNcFiYIFNFXZ7x6LuKy5n4XgMIEPqGvAcIjGvMYGmpCDV4W3ZJ4qofCVPnFb6VGE2s5l7df2otc7RQcAhIhjWRfIpe/xwCkQD5KQFbyVRg6fjA0IH96Ol6urXAkXWlFpHYTZtALjFfmES5Q8ZLDw2XzDYDP2Xq8HW5m3ZuHmsINUjc7HsC7LoMGW4uJ8YwQ1RGFyZZTL7LzNnI6i9XKOsuHcX0RvdE6+J4fuOPAdUB/qmS5SQ9QPI2qlWPlsxvNtzHASt8Yvv28k7hRwLzDhBxSNdWp7g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=YAu+K1yGs6EyfiupcFnDZvDzmMJj/ZtuJmcoKmLMP/s=;
 b=MEMlxvrjs0+yvycure05umBIIq1shSnVPl3jGe24s1M5f0Q/ThFo6/ks2iFfguKZtdNpyctSqeFJXJD0ETkWFyY7RneIKheAgwTM1YM+RwKIchVl+ub6R5YWxKFh90QT+KQv6X5xpvtlBHoc1z7Xba/vRcPXWWsuE9MiWpYnLKNg5h1A0g0ctc0hbqWTyS544SMWHVNH7VAZ7ujqOHpO+/GjnSVtS+2qCemNjDYZiygt8p6q9VW9Q/GYdxr+CD69kHc+GekLL62BmPmc3wSwFcrDg8PC8OH5SbRhvQRMNbjn2ujT3B2PnEpzGGPyaftEcCxgryT3ADhNL/Ql9ARwug==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <5feef533-cfb7-bb17-9439-6efcb2fb9b2a@suse.com>
Date: Wed, 19 Jul 2023 13:38:02 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1689604562.git.oleksii.kurochko@gmail.com>
 <8c69050d7b1f42df5e776ca9494164a4d15f2d52.1689604562.git.oleksii.kurochko@gmail.com>
 <ad53c037-3c1b-ff1a-93df-b79ab2948174@suse.com>
 <dbb568a33691b1fed5cb7f8de801a87e4aebbe4d.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <dbb568a33691b1fed5cb7f8de801a87e4aebbe4d.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0136.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:95::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU2PR04MB8904:EE_
X-MS-Office365-Filtering-Correlation-Id: b0ed1d82-e24a-4914-4048-08db884c9d97
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	E31dVL5SQtRv5JBNLfxAeQDq+ELpoKjJLl5c2yXkgki11apkIONVxGDu9z4sy1+FCuz9DHTPPAEWRU3HDRBOgDOrOhq72k2y72Im5a75XYEGyPKjSOTRW+tDHOhjEB2xLCGoQIMQqYF0JDvCY40u60jZJHIIPDbWBnyhTfiK6tDvDeJ/px/oQr9bjIhI5Eu0Oc6EeptOQ0XG5gwVFGjkiplUvamUyvOX0rFPSzvmHxj+L3eV6ypvRtmF/euFKqMlZ/54MxMQU9oOKAxOt3jVWmqiLCvNaIOQcg5LIfPJHgcr9N2vQ1rq/91Yy9SGbH3/zI11KQboBY9NbOyOCilIsTaV7QNFw++B9T9x6/NemgdPbKJvpwXZ0gcXWXWSt1kmCy6zFp+ygS7+D1QH72QcOuoBlgvgA1uWoMb51jZuOCn9YvJ+xOKyFl7kwsO/4CSlHtETo0u52txVsex/eF1CuIbExv0jNxHf4br23hfifdAWY80UmmXKStGQLIAMr41GdMYbC61+2WkDANrDRRozYA6FWSjDFRV2h6IXAy5sUrCWXyyd0eIS4D/1anYAeW/J7BO1zcs1TOoHWkc9yJ1y3rtal77V/vbZf932JHpDGsOOMJkJSWXJMz0fuV2sQglFl3TbhfFhfJzQNMrShQ2bKw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(376002)(396003)(366004)(136003)(451199021)(31696002)(86362001)(66476007)(31686004)(2906002)(4744005)(8936002)(66556008)(5660300002)(41300700001)(4326008)(8676002)(316002)(6916009)(38100700002)(66946007)(186003)(36756003)(2616005)(54906003)(6506007)(478600001)(53546011)(26005)(6486002)(6512007)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?OGF3ckNZRi9FelQxR2ZHc1BxeEp1UnpiVFAxQ1dKVjJxS3FCZTI2ZjJxcUNB?=
 =?utf-8?B?eTJFck9zZ0hnSTRPaW5Qajg2dkxINXNtaExha2JrUEszenNGYkVJaXFyWDF3?=
 =?utf-8?B?bGxHdE9QUXBYR2VlaEZqdjBoQ2NyT3hYTE0yYlNobzJpY0gzQVN5SWNIOEs1?=
 =?utf-8?B?U2EzQXI4S3lrWlJKMHJmT3lZbHBhd0RuN3dEQm5YaHJwUENpYW5HNWE5OGxN?=
 =?utf-8?B?M2VnclBLMjR2VFBpQ0M5SWNJNnlyMXNLWk5DTHJGcUwycmFKb29rNDJHQmU4?=
 =?utf-8?B?aFhTZE9JcCtQVFJPb0ZsS3VDaXN2Sks2ay9MOXM0NFFZalkzL0NBZnhVL3BS?=
 =?utf-8?B?c05IR0FtdXBLQWZRMWtxWWN6TkIvQ3dWc1dpRzFxeDEzamdhOVg3cVBSVThh?=
 =?utf-8?B?SW5YVFQrZ05oWEpnMFZDNGNkb3d6d3pEWVdWLzNtOHZJTTRxQkdyb1JLdFlt?=
 =?utf-8?B?cmRTSWpDSFc0RjhzYnJNZGs3T3Y3ZU1ieG1nRGpVdURNek9wdnFvcWs4cW5r?=
 =?utf-8?B?YWIxOVZk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h5ZlVjQmpCSU1NM0l6eHJCT3JGQ1pBQ1NJS3A2?=
 =?utf-8?B?emZNNEN4YnpGZ1p6YThWbTArYWNYKzBYdDh2cEovZzFJR3JldHJMMERnV2R3?=
 =?utf-8?B?NVdtbFVJL1hRREF4L0Y5Y1NaOVZLZXRLaU04UkpKRFQxSS9oUjRPRXVpcDM0?=
 =?utf-8?B?bTA3TDh3eGUyTlRhNFNMWFFBejJpQ3ZBT1NMa0dtWGEweWpaWlEvTDFsR3dh?=
 =?utf-8?B?Q1p3Um5oWjF0eWZEUllkZ083S3IwZ0RPTHBqTTI2MUJMRGYvc2M5dGNnNTJS?=
 =?utf-8?B?SDNPeHArNHRidXNENHhRdldrQ1E3VGNNZHJ5YXd0WUNRWWx0dXJidTJuOHIr?=
 =?utf-8?B?VmE2bEhtbkhwVytSMXNBTFpDMGNOTkVCQldNWituZVdKeTNFQ2p5TEp4b1lw?=
 =?utf-8?B?U2w0NFVlSXB0K3FPaHdPNFFORDB3NUlnYXlBTTFmM0ZQQ3JtWllWOVJkTGdT?=
 =?utf-8?B?ZCtJRXo0NWRMdVVWeUxMQkJROGRQcVJyOU1wakY3T2l4WE55RXd3alJFZklh?=
 =?utf-8?B?R1pZRVBzb2pwcGxXbzZ1clRiZ0pUWjRXUkRpTnJVQThFOW1oWmpNYVhFcW1M?=
 =?utf-8?B?VGNJMlVSb3QzdVhPbjRlL3p5OElNcnpoZ0w4aUFrU2VZNVVGZEoyZlRtTnpQ?=
 =?utf-8?B?ajFpajZqRmQxSVRoUFdIaHE3Y1BNbzdBWHI1SnFneTVhODRIelV1WGdXd29s?=
 =?utf-8?Q?q9um99gK9fOOXXYDixzitWc8w?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b0ed1d82-e24a-4914-4048-08db884c9d97
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 11:38:04.7415
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: hz7yuoBrYgrxyy/LwK9Se5JCRfKphQX4C1d5ryjilhxc321l+K/MIM+nxnnBOYZhdGzSl7L3okA0wBDQ2WuEng==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8904

On 19.07.2023 12:39, Oleksii wrote:
> On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote:
>> On 17.07.2023 16:40, Oleksii Kurochko wrote:
>>> @@ -35,8 +41,10 @@ unsigned long __ro_after_init phys_offset;
>>> Â  *
>>> Â  * It might be needed one more page table in case when Xen load
>>> address
>>> Â  * isn't 2 MB aligned.
>>> + *
>>> + * CONFIG_PAGING_LEVELS page tables are needed for identity
>>> mapping.
>>> Â  */
>>> -#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) + 1)
>>> +#define PGTBL_INITIAL_COUNT (CONFIG_PAGING_LEVELS * 2 + 1)
>>
>> Where did the "- 1" go?
> My fault. Should be:
>   #define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS * 2  - 1) + 1)

Why? I'd have expected

#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) * 2 + 1)

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 11:49:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 11:49:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565787.884286 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM5gB-0002Bb-9b; Wed, 19 Jul 2023 11:49:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565787.884286; Wed, 19 Jul 2023 11:49:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM5gB-0002BU-75; Wed, 19 Jul 2023 11:49:15 +0000
Received: by outflank-mailman (input) for mailman id 565787;
 Wed, 19 Jul 2023 11:49:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM5gA-0002BO-82
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 11:49:14 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2054.outbound.protection.outlook.com [40.107.13.54])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4753c116-262a-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 13:49:12 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB9485.eurprd04.prod.outlook.com (2603:10a6:102:27d::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Wed, 19 Jul
 2023 11:48:42 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 11:48:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4753c116-262a-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=RgHl594OUGt86eFuEvhpSRAY6pJi1a3DUN/oigIA+87u5XxnYrpWZ11ATpyxFu/tRHsageLlo9d2Rtz+spmKV5nO7JtgJXDEtos3S0jeCEmSS41M8YWWrXNydJVdQhcIuEck//dX7r4gDqaxVDw1l0Odba93eua15S+uIO96kOMI1AiKteerui2JgqSk0qT/7FPaswtI6Uiz4vxqAk1HRc8lBUMoWFQVodnlbd/0wOwpzugj5xetS0o7Xpiy5Q5Ijz/WxuXTYGUzCmmoQnrxWsoHsEdhHdmMAzFwlmTDFlxpnbahg+mh6Ia4+Jb7wg7wjWY2+NwAy+ozTdmotQE6Sw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=1zy9RzLqtfWBRjBZjD/nbrzMKbpV68sk/06K6TEQtmg=;
 b=CrW1MCRt5Qv5ABNnQXedPJ/sniHRmc/bpXzZS8/MB/RiM4sIbJK47Af/azYDEetcSOqlGp2iZgh+LZFEoO79q91lrDf9DJlXZBEVlezQC/fEwQZWzvv5NjRUuXQebYqbz0jUKfiWX9g5pv53J+p0XxpSO24JQPtu9UF3zXGd3jazLTSxFnvYT3zFLv+XSuFkH9AB2ZtsXxe3HQzOw1q6bK+Qxs+rT2aTRgE54U+ghw/gnY34AxnzyWMOOzePHJSmceCwO0Dzykg/4M8siZje9Cx/wq73E7bFqAnyP/blKpnHGCyYhABXLj9fFD2VWrZekeRIYX4B4fEvYj5bDMfLmA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=1zy9RzLqtfWBRjBZjD/nbrzMKbpV68sk/06K6TEQtmg=;
 b=USvhWBzcxYnI2M9wgCzKlipZCv2LHWuwrwDY97AFA32FwzaMpB2ae9RVi2oBi9+W1ugVk7h8CixyNeK660V6DSMSrOdl/ZjTWCr59gPBM816u5q5RaBSaZm5zN19Q4A1rV1lWgYYN2ael+uqv16pqbSTjJQu/G60f2fh8d53GSzuqhiUrXFGQgJGJc8hFZPZqSwKPU08oPGp+n3j5J6vklb0cdWrgndaBfEBv0mM8ZtK8QM/6K+xgTlbsoTjYIpckZeWIO9UlONCW3qgeb/n4h3YryHkcJqCewi3ogVdnpcBZQ3lMZZcMHezyvqP3n8gP7BuDI0FEH3AaQb6BEXMVw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <59c33c29-3b0d-fad5-d84c-3e00dd79847f@suse.com>
Date: Wed, 19 Jul 2023 13:48:39 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] x86/HVM: address violations of MISRA C:2012 Rules 8.2
 and 8.3
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <7c89ac0fe44dbd1ba1436a91024efebf2794db40.1689761143.git.federico.serafini@bugseng.com>
 <e0b03fd7-0487-3328-b532-2950c3b1e34b@citrix.com>
 <c4534f8a-d479-dbcc-ddb1-81eb00b074a2@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <c4534f8a-d479-dbcc-ddb1-81eb00b074a2@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0146.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:98::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB9485:EE_
X-MS-Office365-Filtering-Correlation-Id: 1bcc9156-4558-4cad-7c79-08db884e19c5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	O4cyZ9U9r3qExT5hZyxeicli1NjuseaMiN0qJwPfy3Doz7GmUokCcRY5jHPCxlZOo94VZs24ciWclRH7DgLWZPefL7VBNNVJD44qDxVbza1I2D3O6cZ3F12T142KmSCXMtlnkV+ZDPnHvVniVRetLoE4bzHS/z8T1iaEaAqLLVP2/pn6E5/cXgJjp+PjxhNFU2oFpSJ9IXkjq302LiLD19ve+o7UYg6hawq9hJg5jJWnZPS69NKQjefFlkzMr/3jy0+WEoiJK9TDnfbnfjT72sNO1rXl3/7Whtg+3+8urpeqLyUQWV/EB6ClhUkMf+ev7VGh2DKAD2dxBNEBbT74fqxq4mAhwJONvojo6Kp+mJz+fzQZq6F2OTToZW2dpykH7oInoh5XvLCxXPB5MrUfsAX3Vmya0yIz2QSfaZd+wYhgQBm93useQ3pm+jZjEEoLAzPitetSM68pcj55Q/q5avKyTvWztlV7RYu0xHvS6m8qUAN69FkxiCTKOHe27FLZsG7d2o3nL5NyGUo3HrE8mW2PE4pD0vQhYe9kyMXtKnhkiPjh774wlKERWw2nMRcrTlskWtJkbeLQtlBvJ645pZQfYrIcrQ82xffuBMN0CWXibuYsZev9/dATgs9fEPsKE+h2U1MxMGJftZUgvlnvzA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(396003)(346002)(136003)(39860400002)(451199021)(66946007)(66556008)(6512007)(6666004)(6486002)(66476007)(2906002)(316002)(53546011)(7416002)(8676002)(8936002)(6916009)(4326008)(36756003)(5660300002)(6506007)(2616005)(38100700002)(186003)(26005)(41300700001)(86362001)(478600001)(31686004)(54906003)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cHJyc3BDOVZ4SGRacFFWS0hqbXY4V3YrZitkSFRmbnErLzhJNGtDRnVaQlFp?=
 =?utf-8?B?S3AvYVEwOXdwZ3NMTmU3ZWR3S1Fwc3oyTk91bEVIMmpueXRIdnZKYmQyQTlm?=
 =?utf-8?B?M2h2OHhVUDZzODZ3N2ErczUyZysrc2EycTJLMVhqUVZuVk5ocjBhd2Y1amJa?=
 =?utf-8?B?YWFLMHd5MzVuUW9yMC9Dbzk1RHVaSW4rLzBrN2ZTdEdHUGlNZWI4RVpyZUIv?=
 =?utf-8?B?SlJHM3BVbUVqdy95WHFYNWZ4QVFENm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UxYNjdhSlgwNjJpbUorWi9TRXk5?=
 =?utf-8?B?S2F1WGdCd2tkZ3ZZOHhCSlJyZ0xPSHc4aTJDTVpQVjZXSGFQSlFLY3JBR3Zr?=
 =?utf-8?Q?GPlmaxXLDJNB+P5HG9L148T32?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1bcc9156-4558-4cad-7c79-08db884e19c5
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 11:48:42.5484
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: qbb/piF4q1JFzvVUNtk084GVW28xytB6LMreSgxQoDR77uO0WlYEf3ZbFKHNCrb0igvxQvncgtWDmmfTQ/qtJw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9485

On 19.07.2023 12:38, Federico Serafini wrote:
> On 19/07/23 12:23, Andrew Cooper wrote:
>> On 19/07/2023 11:07 am, Federico Serafini wrote:
>>> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
>>> index 57363c2ae1..8f19a79f6f 100644
>>> --- a/xen/arch/x86/hvm/hvm.c
>>> +++ b/xen/arch/x86/hvm/hvm.c
>>> @@ -319,7 +319,7 @@ static bool pat_valid(uint64_t val)
>>>       return !(any_gt_7 | any_2_or_3);
>>>   }
>>>   
>>> -int hvm_set_guest_pat(struct vcpu *v, uint64_t guest_pat)
>>> +int hvm_set_guest_pat(struct vcpu *v, u64 guest_pat)
>>
>> If there's a u64 vs uint64_t mismatch (or others for that matter),
>> resolve in the way of the stdint types.Â  That way you're correcting in
>> the direction of the Xen coding style, rather than away from it.
> 
> Changing the type in the declaration from u64 to uint64_t
> touching hvm.h will lead to inconsistencies with adjacent declarations.
> In such cases, should I propagate the change to the adjacent ones
> as well?

Preferably yes, I would say, but I wouldn't make this a hard requirement.
The decls have a pretty bad mix anyway. One thing though: You also fiddle
with hvm_get_guest_tsc_fixed(), and there please also convert the return
type then.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 11:50:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 11:50:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565790.884297 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM5gn-0002gH-JH; Wed, 19 Jul 2023 11:49:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565790.884297; Wed, 19 Jul 2023 11:49:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM5gn-0002gA-G6; Wed, 19 Jul 2023 11:49:53 +0000
Received: by outflank-mailman (input) for mailman id 565790;
 Wed, 19 Jul 2023 11:49:52 +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 <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM5gm-0002ft-3v
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 11:49:52 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2081.outbound.protection.outlook.com [40.107.13.81])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5d705c62-262a-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 13:49:49 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB9485.eurprd04.prod.outlook.com (2603:10a6:102:27d::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Wed, 19 Jul
 2023 11:49:20 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 11:49:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5d705c62-262a-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=fSjIILZcL2Yx1UBFTPa3cZdzw4OiEnCuWB8mEe0DxhkuYElE19Vm+qsqUbjlpeTQGYd4gIJfvt0Ke97PplOKYpzRRAAwV0xm0gf1MEqzSa9lTGK/9TaQ/NsatAyAojQ+4vHtPpZFoHNcGdL/zrShuip/XqvlUs6DhWKX7EXLSdgdxbZ9oYRq7jZmk+GGntTutTwYmLC1Dv7AcINGWQccR+2qvyiw1tGZQp4hLWjEVVEIVary02KuAs1iRCXVB8UXcO9F+rWVtGUx0R3dgElZLBjrD3eO458+GsBCbgKOExT06XpUYtFZ51QzDN5hQ/yh/EVoItiLjOm9wokvmAsQrA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LwOxv1I4WwuFX4ESSMgQPQjzT1Q7GW1/04nr0SYMs/M=;
 b=HvLRr2zGcisKIlKZMOh5aaQEnM4ZzImEdcPiPrejFwy6NgIqyBZDXHUNCkjHJc1S1/7R3OlXmM1g5kOjpqtznaL03St46+3UCQo8udv7lyjJHrItpj9Eco8A8q8FzLFXyU+lKEUWBhgID59gW9scSiHZSQiosJA48w7LBbJGa2eNjMlmRB/JeeIvjM2O13E8gywSXoam1G/0LV47LN4CvCiHnx5pa/TW0L2vgn8kzQNboDCOCI9aNl/zeSPQ1HBVZLcmPlpsMOAI13o365+KIvFR1miEvaD6/vn/hyE8Uo3fPRpPyWH1wt72H7cuiv7B+ENGxr/qx5ozH7a7vgSiaw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LwOxv1I4WwuFX4ESSMgQPQjzT1Q7GW1/04nr0SYMs/M=;
 b=FZtA7jCCchuREx5H5bh8ktUEkTYqkUhhUQUecSOEc6Fs6jzDzT9XBpPlmvBt/ymeGTLDPymksJe2DpUlyG3Rb2faP4hoVb1qxtTEeZTo2NKXWLBABMzknVAnd4BejKdhjre0PBaFmOJmWIepNGULW64DDKSU3hpSR82cfAFQGdR84MXmLrnSGvA3w5zKpNGF0jn1YcT+NsQJLxQLX4Mu2Td0SoCCf/xr2mLwdck8iiltXeGs61ulFnFup4KPOnc5FAx8JBiWj9onHQId8941mEyUjx0pEQFwwhLt4tVzpYCwFA2sCaBUGkVhItAuJ5IRXgZKdtMV4z0sTx5Y19MN2Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <1a11e332-fbfc-4aaf-b824-682eca87d345@suse.com>
Date: Wed, 19 Jul 2023 13:49:18 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] xen/x86: Use const char * for string literals (2)
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
References: <20230719110239.4065060-1-andrew.cooper3@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230719110239.4065060-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0142.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:98::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB9485:EE_
X-MS-Office365-Filtering-Correlation-Id: cd078cd1-edc1-413a-517b-08db884e3074
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	jdYOeYnJDSTO0GlLXNj/+C3VrJdY59bNd0cq92m9v9awe0aIHjpNDx3wvmOPRV50sxlXJPOs2ub6eTekb+iZB87Jn2/k8G1UBa9H3vmOIc7laaPmXz3Cha7ErCRnNfnmLig79F6/Sk2dvAITpvTQAqAfR/NSih1UJ5zN7lAb9Lw/wWvqSHkbKCKqSFNcteZa7FWjykVnaUEH/wpAQVRzA4mAkpfwiB4l8eVkN7GwV17PhKW3zHkEhA5xjOfs3mouYLBnldOtsGkJT6bTQJeF6uIeQjXO9VWe4pF8fqr2X7iV25gHHra7Spa2eY/8IZmptB4qevC9hBVPSNF0131M2huaOPQ2xR2i30pMNzZlr6Kf6fN4br0BEJCoNt3+njpEHB0NZ3g7ApdjfB69z6kyo1tA5aSAbQt76CiZiIMkQoQh+NAOxu4EH3Noru6FZVdrT+wdgfXLj+WyRkZnoPl5byk/Hy6voqMU/5eKrnGYQ2FfgGL0vJNVEJtsfsxK9BNUL2xYAmBYpXPpbNK8e/Bhi30+8dzpF2yz2SWVUJ8lAiEq9so27TQoHvgw+ZMEm6xjLu27vRpqMHk31TFa6Gv+/+qlx4A5qF9b2sxD3EKH9B5VFcNw38qkqCwM6Pq3cUvNx95tACGhSHkkyci/r3aiBg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(396003)(346002)(136003)(39860400002)(451199021)(66946007)(558084003)(66556008)(6512007)(6486002)(66476007)(2906002)(316002)(53546011)(8676002)(8936002)(6916009)(4326008)(36756003)(5660300002)(6506007)(2616005)(38100700002)(186003)(26005)(41300700001)(86362001)(478600001)(31686004)(54906003)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eVIwSFRnQ2VEbG4ybjZYSVdjbUE4dnNnT3MzQUtLNDQ3VnR6dVlNcWFNbEdX?=
 =?utf-8?B?aGdJNHhWOWxGZUk2NUR6bGhLdEZoUUszYitSOWovV25GQnZVRTNiRXdaWDRS?=
 =?utf-8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LbTc5a1J1a1p5UGNRQk92?=
 =?utf-8?B?VDdMc3hYYjk4empJT0ZNeUFMazJGWkswU0NsRlpVbWNkdWJ5T1ZMc0pBZ3lu?=
 =?utf-8?B?eG0rMkY5bHJBK0hYZFlhMmdSVjVGK05UMEZVajV0UHpPQkhSZ2JvUHpKSi9u?=
 =?utf-8?B?eEtDTnBpbjNtRG1BT3A2U01senFyUFNkeGRSYUpGS0pDSFpFMlpxaHBneURZ?=
 =?utf-8?B?SnNMK1EvTkZqS3diZTNIWVd6bXl0L2h5Mnpjajh2Ti9LS1MzenBXMkE0R2pp?=
 =?utf-8?Q?EdyGc/5DX61NqkHADdklRHGiU?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: cd078cd1-edc1-413a-517b-08db884e3074
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 11:49:20.6097
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Lf7pMNV3IXC1seRHwQ7q8fcLUwwGvx9crAbD0AT20GAC1E6NAx3/nxxtBU6Q1pTUAX0ApIS8XAgsqf5TepTkxw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9485

On 19.07.2023 13:02, Andrew Cooper wrote:
> This hunk was accidentally missing from a previous change.
> 
> Fixes: d642c0706678 ("xen/x86: Use const char * for string literals")
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 19 11:57:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 11:57:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565796.884307 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM5oA-0004UJ-Gf; Wed, 19 Jul 2023 11:57:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565796.884307; Wed, 19 Jul 2023 11:57:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM5oA-0004UC-Ci; Wed, 19 Jul 2023 11:57:30 +0000
Received: by outflank-mailman (input) for mailman id 565796;
 Wed, 19 Jul 2023 11:57:28 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qM5o8-0004Jd-8L; Wed, 19 Jul 2023 11:57:28 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qM5o8-00016n-27; Wed, 19 Jul 2023 11:57:28 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qM5o7-00066M-81; Wed, 19 Jul 2023 11:57:27 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qM5o7-0001q3-7X; Wed, 19 Jul 2023 11:57:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=haUFANqhZKhLRTEmA9d8RcKn7soL9IkSTEvQ93k5OmU=; b=VlQ35gpSDLR0c6H16rWylHmjBQ
	psGxxG8MVQSE5kHp5JZfUb1iCaaLpuV52H+KR/a0rSa0KN/XurFUCzyAju1Wzz3AUy5AtEn5qCfSf
	Nb3eZ7Fffz7uc5zfEpspn9EQKAaBrZl1lXu9drClq9/yFomz7Y1ionXYWw5l7fq5yMlI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181893-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181893: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=b1c16800e52743d9afd9af62c810f03af16dd942
X-Osstest-Versions-That:
    xen=408a191b749b3d1620ad7ec9c614bab5924530c2
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 19 Jul 2023 11:57:27 +0000

flight 181893 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181893/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  b1c16800e52743d9afd9af62c810f03af16dd942
baseline version:
 xen                  408a191b749b3d1620ad7ec9c614bab5924530c2

Last test of basis   181874  2023-07-18 11:00:26 Z    1 days
Testing same since   181893  2023-07-19 09:03:36 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   408a191b74..b1c16800e5  b1c16800e52743d9afd9af62c810f03af16dd942 -> smoke


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 11:58:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 11:58:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565801.884317 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM5or-00051i-Pd; Wed, 19 Jul 2023 11:58:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565801.884317; Wed, 19 Jul 2023 11:58:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM5or-00051b-Mg; Wed, 19 Jul 2023 11:58:13 +0000
Received: by outflank-mailman (input) for mailman id 565801;
 Wed, 19 Jul 2023 11:58:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM5oq-0004xg-Du
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 11:58:12 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on062c.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::62c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8866ff7c-262b-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 13:58:11 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VI1PR04MB7134.eurprd04.prod.outlook.com (2603:10a6:800:12e::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Wed, 19 Jul
 2023 11:58:07 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 11:58:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8866ff7c-262b-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=DOYi3fymMqIQ+aUWg0xuBiDh1qcKCP3+8dSBu5jmwjySwrAy1DX81nd7sA0THWcIDYWUkPTpTOO1RGViDkkqQ9Fu8/dkOlXynfcJIF+5ItF474D+hrvVfaEwW2ZZsSCTlAlMu83VIHyQwHfS5kCjettCyd+gN5+gEbJO7xspGPtSteMnFQYuUITFWo+mv0h7G/W67tcD/ecEv2wtyW+k8nBPAkkvDUwVAg4VtrXgxQS+DVRu+UgXgLaUWcolbnQ0bWMO6Yl6606JEmdZ1D3BUDStsqG/5aEGLD1UTtYDupXRvyVHQWPNm4UqwKq+0PqNDfMemUJaP5visOIG0L4zkg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=sU905YrKktMBCfFR15qVudU/8Wy7M4d02lF7wjb0bpw=;
 b=lh4cypj3hcueVJ+QPI4c03iSlpiDyaP41fHWijkPT0EiJoSnW1TQo/275tL8sJxxyEWbtrcmNwF/yWvf6Ttgjxrar/h1Xtb5LRigASdzi/7FYas+2DjFTmv9UcePBfonpgJOjClO5pNTuJzhrJNdjDdDPK7NKjmuyEXK52WqsIt7v6hp91+XO2vo+8mFuPkjRnQ5CGHkUgK1vay4kESDBa/MYEd9z2Id5qBZVYzXWmEikxWNKKFCPEahQ4l58CIsO72S0XotXq6Xz2uEBKIZ5EPkQQp1truRXh93hD0gVua1dkVkvA9VlUZewT4l4jIPBSsv3RsuQklJeLRtz71K6A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=sU905YrKktMBCfFR15qVudU/8Wy7M4d02lF7wjb0bpw=;
 b=zw0+SxSKxVqM7FvewtDlme6HHJ4pkrHJj4QTOLMc2GAEJwzSK2nX8lUI0/j3nxRl/hDS72Yzc42Q3HnzUl8F5wcCNFBz6q3Oy8B2DJj5Lz/9gpl1xyroeztNKi4ZCmWbroVhioR/W7O4QbfHZoZgxVofOtNLQ+76F7MbRDHKSpwCSBRtmIigGKWUDvL/woOdmWozj727jiUB0enMSbw1Ng0jjzdrUHVSDVO3TEICKE23yMnWXz+ydnBHY+XEoUyklzUZGD1BFWc58P1Lf6SWX+nfSvUcORJKiqRX/R68frteNbXBZLatH1vLqYZgCCOhfy7Q+rGHJd9b9qlkRPl/Pg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ebc7fd1e-1766-c767-c958-9f04fb741a59@suse.com>
Date: Wed, 19 Jul 2023 13:58:05 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC REPOST] xen: Enable -Wwrite-strings
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Roberto Bagnara <roberto.bagnara@bugseng.com>,
 Nicola Vetrini <nicola.vetrini@bugseng.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230719113810.4066290-1-andrew.cooper3@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230719113810.4066290-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0110.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a8::6) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VI1PR04MB7134:EE_
X-MS-Office365-Filtering-Correlation-Id: 47d4819f-dd21-447c-a0b9-08db884f6aa9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	rZgyr2Da//J/4raV7mvPm0ijpTmxQpwKnNGmHuCAZFmLECa2ucaPxyxzlxEo6WvtGXFKNZdcRQAwZhXT5RSGo+k8HYes2REKmeWd6AgAbHUrotsZpkoIxqgs6AgXYBKw7TNPxTxWEcTEy7ltkZEQy54YMH+suTcTEmuXl6AzDrsvgSuunm8pCZjhIelfB2THnrXYgetyzCUOZr/EWt/v6pkd+IZKJTsKudOk6/YzIuQNlIX1JtNRfczUmmEyt4aZcz9lCdu0Ebj4Zw6djNWfhfXnmhrX9tV3aUvUKoCoi5ycJ9Xsfo8HonybggZXY+zbbincwtFUE/h0TiYSebbamiJooOnavRQi2c3ggWiEOsd75AoExURMYpHnrdGapUZXdRUYhbNjCXsMbdbGk9OETkuE/axqMuwQ7lxtycKzrFk+krIxHijRO+Y3FwVoizD0seSk1WecIrayyv1IKgL48/wjxaOFsE4f/GZMgc3XIxfUMfSEeROcKyH61/9ah9CNl3G0eTHKUNOOMx6qQBj5JkULDia9+2Kf6JlX/tXLh0g0NehtWYXce/ZYqcoimMD6icXpVDokVtXewnR3bJZ6MJT5orm/jkFa4Fkpl9jEioDsmNu8ZlQzdS+fDdRCy1sTGZ1W81PWMSwmo3GkJhp5xA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(396003)(346002)(376002)(366004)(39860400002)(451199021)(31686004)(478600001)(6486002)(54906003)(2616005)(31696002)(86362001)(36756003)(4744005)(2906002)(186003)(26005)(53546011)(6506007)(6512007)(38100700002)(41300700001)(6916009)(66476007)(66556008)(8936002)(8676002)(4326008)(7416002)(5660300002)(316002)(66946007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eVlFZGJ4WnhIaVpjNkkxSzduVGNaWFdHMUw2V3R2Zk9mNm5FYXNsc2ZZMDA4?=
 =?utf-8?B?M1lCVVVib2IzN2RvN0xhRlhwOXA2dkxSdmJId3doREIzNG9MSk44YTdmUU5m?=
 =?utf-8?B?VkhmbURqVWFnUTN5NWNPcTdIcGFPZUg1aVl5V2U2YnZKdFFCTEZrdDNCN0Mr?=
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ZJVktUOFZIanRSd2tqZ2kz?=
 =?utf-8?B?MVFSMlVUREJoR05oamVTTExSeERJV1ZjN2R3QzU0Ymx1TVhHYnFtV2ZZQ0Zy?=
 =?utf-8?B?R2Zhd2JQa3NOT1JPdUxRTmcvc2tVOFNMM0s1V1ZSL3NUK2QvSHZTS3gzQ0xH?=
 =?utf-8?B?NHo2bHhxZmg2WWsrcWVkQjlwdHVUR1NtdmNDcWN5clpHVUNkVEtuWEllWExo?=
 =?utf-8?Q?kir2uNm7JC/wwnd2zHRgKuVdV?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 47d4819f-dd21-447c-a0b9-08db884f6aa9
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 11:58:07.7514
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: xkbolc8GJhKLl5srbKB8IB3Upob56eBWzg2JogYVqgcvPPbM5RQk/ezLeJ3x4/wRyh0oplJxmtRpGWqd46OK8g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7134

On 19.07.2023 13:38, Andrew Cooper wrote:
> This is the remainder change to get x86 compiling with -Wwrite-strings.  ARM
> still has some cleanup to go.
> 
> There are two swamps left.
> 
>   1) efi_arch_handle_cmdline().  Swapping name.s for name.cs makes the code
>      compile, but only because the underlying union launders the pointer back
>      to being mutable.

To address (part of?) this concern, ...

> --- a/xen/arch/x86/efi/efi-boot.h
> +++ b/xen/arch/x86/efi/efi-boot.h
> @@ -324,7 +324,7 @@ static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
>          w2s(&name);
>      }
>      else
> -        name.s = "xen";
> +        name.cs = "xen";
>      place_string(&mbi.cmdline, name.s);

... how about changing this function invocation to also pass
name.cs? The function already takes const char *, it's just that
there was no "cs" union member back at the time.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 12:02:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 12:02:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565808.884326 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM5t1-0006bj-GV; Wed, 19 Jul 2023 12:02:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565808.884326; Wed, 19 Jul 2023 12:02:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM5t1-0006bc-E0; Wed, 19 Jul 2023 12:02:31 +0000
Received: by outflank-mailman (input) for mailman id 565808;
 Wed, 19 Jul 2023 12:02:30 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qM5t0-0006bT-Gj
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 12:02:30 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qM5sz-0001EQ-Pe; Wed, 19 Jul 2023 12:02:29 +0000
Received: from 54-240-197-236.amazon.com ([54.240.197.236]
 helo=[192.168.5.130]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qM5sz-0001uF-KD; Wed, 19 Jul 2023 12:02:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=EbGOpKUe8Js8Xae9bFXseiofzVf+nv5fHYLonKimEJY=; b=Ix5OR0RhS1rq7KY+PWcQx3semM
	hlQywjOltQ92POIx5h1BArWvTKHsKCAynfcWWwi3DIZxMCm1M96ioJ0KhHAdBcwfM2GaMkse0KjaV
	HxmV4QHqUFyaDJOFIkhGorz6NX6FejhllfGp4QKoeRpY/s2Vcg1N6DXC4Qs5mSFrc/hY=;
Message-ID: <eca3cbf7-6747-6631-d0bc-26ec3faea233@xen.org>
Date: Wed, 19 Jul 2023 13:02:27 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 18/18] tools/xenstore: add nocopy flag to node read
 functions
Content-Language: en-US
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-19-jgross@suse.com>
 <64ec2fd3-fcec-6ebf-5924-6b591215e19e@xen.org>
 <32cd8b9f-8afa-2cde-3815-82edc7052535@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <32cd8b9f-8afa-2cde-3815-82edc7052535@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 19/07/2023 07:49, Juergen Gross wrote:
> On 18.07.23 23:35, Julien Grall wrote:
>> Hi Juergen,
>>
>> On 10/07/2023 07:59, Juergen Gross wrote:
>>> Today when reading a node from the data base through read_node(), the
>>> node data is copied in order to avoid modifying the data base when
>>> preparing a node update, as otherwise an error might result in an
>>> inconsistent state.
>>>
>>> There are, however, many cases where such a copy operation isn't
>>> needed, as the node isn't modified.
>>>
>>> Add a "nocopy" flag to read_node() and get_node*() functions for making
>>> those cases less memory consuming and more performant.
>>
>> Reducing memory consumption and improving performance is good. However 
>> you are now relying on the caller to do the right thing when 'nocopy' 
>> is true. I believe this is a disaster waiting to happen.
>>
>> So as it stands, I don't support this approach. The solution I have in 
>> mind would require that 'struct node' is const for the 'nocopy' case. 
>> I agree this means more work, but that's the price for reduce the the 
>> risk of corruption.
> 
> Fair enough.
> 
> I'll look into splitting read_node() into a direct variant returning a 
> const
> pointer and a variant copying the data. Same will be needed for 
> get_node*().
> 
>>
>>>
>>> Note that there is one modification of the node data left, which is not
>>> problematic: domain_adjust_node_perms() might set the "ignore" flag of
>>> a permission. This does no harm, as such an update of the permissions
>>> doesn't need to be undone in case of a later processing error.
>> Even if this is the "ignore" flag, this is definitely not an ideal 
>> situation. And, AFAICT, this is not even document. I don't to be the 
>> reader trying to figure out why read_node() and db_fetch() returns a 
>> slightly different node content :).
> 
> So would you be fine with the addition of a comment explaining the 
> situation?

I expect that my remark will become moot if we go ahead with splitting 
read_node().

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 12:10:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 12:10:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565816.884337 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM60K-00084P-9y; Wed, 19 Jul 2023 12:10:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565816.884337; Wed, 19 Jul 2023 12:10:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM60K-00084I-5U; Wed, 19 Jul 2023 12:10:04 +0000
Received: by outflank-mailman (input) for mailman id 565816;
 Wed, 19 Jul 2023 12:10:03 +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 <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM60J-0007p8-58
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 12:10:03 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on20620.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::620])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2f735fc1-262d-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 14:10:00 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM7PR04MB7045.eurprd04.prod.outlook.com (2603:10a6:20b:11e::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.27; Wed, 19 Jul
 2023 12:09:57 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 12:09:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2f735fc1-262d-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=W5WILTlvVcaGwysrJweNi6lD+sp7oA6ayT0TaB9+6Mjzz7j55qslk+0sJUIaYwDnjbIPWoZj3b1byZmCtyvKaR3rf5wqXBnP7Y3NS1BEKI1pVv+/mb+SnQZLngtDmA9CtL/ZxfPpYaG4I1s1pNyEu4rh4sWRXGTAjW+07RjCYVfd6rI3r52DmdOJaS48cd2r7/yHydmrjOyMwFHtFmm+boIYj7AOVTFQZFGeqiYRvn5aYWZjUcuLq2q3KdOGIMtqV0O3+4p3Lr3eZw73taNfFha9BKsmDV4DpiFM0WcSID4PEV4Xx7pam2U/HTarQw6sd44h3cTN8W/cMNgHDLIdVw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Zgvzx1+kQfyNFDJjPsTMWl1tEm167XHAuH0ZeoLNMTs=;
 b=kRErIVi0xS0U3tfC7qV+PHuBEQqF7QrmL8YmGIwQ8i6Er7wAR0kPFq5BRHoEhne4FhtoyXAkF7S/GTCP4uu0M309CdPZVantdapAFpxhfBd+f9S1fyjxwYZixvl0ktXr8nsMJ3r5iEraVZFbJeIJ/5i2CvROeZi6W2gwgBG3lC7hrfU40NFcslGBa0PHD4YZHehGPdRwfxSXGg6x2HAylyC42vC+CWbNGwhmxHGyhGq8annlMk4PPUrLUjdBuCDI8M3bUHUKFlGbDF43GTsG0IIcN6vLb73hRjmL2SLNo9msKykWanrNQlib44ZGieLDC9jxikc+NZ8iO+Lx2JpfDQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Zgvzx1+kQfyNFDJjPsTMWl1tEm167XHAuH0ZeoLNMTs=;
 b=ivNYAVh4CYcE2pxGcc6XAhhavjADirjHLqmZVgAMNC28dO74/lq93J2R9mlEjtYJ+J2ZSBesp1wgZKyBD9FIke8fB7pxFxFPnydZJNUABdPq9T8kR357OhfSitoMFHmOtXgnxbhHXTNWKMC8R8ST/ujbYTEMUXCYJyxZG74AyyYrEb8UQ3HNb94WhnAXQ6G2pGEA3ylxCo0nKYzTk4XyfqMLAM9swl4mPh4WfGtNkWorVUnm40r627hAYG7HhbKWLmcsV0WToLkO5us5pWKhb3otlKSSGPd7WcIQMoWUSGziQmUL0+pq3E0Cy7A9jGwS/D9WgEEyke9nGqahShOdqg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <468474ed-60b4-9ff2-83c4-036e1252b99d@suse.com>
Date: Wed, 19 Jul 2023 14:09:55 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] x86/mem: Make mem_hotadd_check() more legible
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu <wl@xen.org>
References: <20230719100808.4046779-1-andrew.cooper3@citrix.com>
 <64b7ca84.170a0220.758d8.90e0@mx.google.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <64b7ca84.170a0220.758d8.90e0@mx.google.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0045.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4a::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM7PR04MB7045:EE_
X-MS-Office365-Filtering-Correlation-Id: c10b8bfd-1925-4d19-fa3e-08db885111e3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	z+hV9CtizYEaNjQf1q1dAj8IA0OXS6HAKVm3KFXN/SOHWqS3sBa7XZK4rQyUxQT9CpERNFV4m5mJv11q5kf1zXkmMIV5ZrqezCOsf+E9wp/jyvDgkjYMXU0iFFMCL4DN1OKSrPe9ilqnJ/tg7E1D5yCEaB6kcUVqMoX51XPDmgk6pXZo1M+xelSH9Cd1ZuNKqt3akZ3FiTxNaZNvvB+/FJeZZZKHmg6wi79FBZD6t/IKhtmlqWFA0iOJ8wDZ9OW6BwFGevhO4sPpcy4SjL6jtTAK3gqJvUDw/ZJHRONIhDPTkojSA+MG8rDClkB8qgcukSut2ptsdD9wl+sQOJMJmrP6DQp4RimH1JyWKhCQrYAHEujc7KecvGoS81+ufTWZO6AFHBZLDI5Ariyx4PkhMzbIEflXoj0ELTefERa24Ysr+4AH9KVIh1NRxUpaDStQDsIy3MAqa6SUrp+5n4N/GKbeiw13g62yFdXi/w8KJf+3NM0Seuj906fKEM7jd8s1HRe8js59aLFZvMOE3c/y+Le+bwb/RAJPNKsocQ0xQKclHvwrChfg+2CX3gkNqUz1AxeXqaEjUpFHTJ6z/MkNqsp19u7hgKVOjvtMFfS7hu+dduwds4VhHMxSFovB/PDrRL0FFLCb4LOLhwf05jxHdQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(366004)(136003)(39860400002)(396003)(451199021)(36756003)(86362001)(31696002)(31686004)(110136005)(478600001)(6486002)(54906003)(38100700002)(2616005)(6506007)(83380400001)(66476007)(186003)(26005)(53546011)(6512007)(4326008)(8936002)(5660300002)(8676002)(2906002)(66946007)(66556008)(316002)(41300700001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?d0hXV3plRDdERUJiY3lCZUJjRldtaGtGb2pTN3huWU9uOExLQXU3N3pCTk15?=
 =?utf-8?B?WFhxWUM1VEZhTGlMZzVNNy9CcjlkbDQwOGRaazQ3R3QzcEg0c3lmbDBpUXVL?=
 =?utf-8?B?ZDJaWDVjeXNnWThCcVJsTlg5b0JWdmtYaDVpV2kzT1hmb3EyMVRnUHRvbGZK?=
 =?utf-8?B?d1RTakc5bjMwQmNEZU5NRTltOHZWNWxaMUt2ejNoSjJPK2xNbVA1NFBxSGVI?=
 =?utf-8?B?WUk0Yng3ZkhWR2JxdWdFNzFXbHVUck0wWDNKVStQUHJxQTlrQm93R0Y5VERt?=
 =?utf-8?B?N2J5amlzcWRaaFUwRlphTitSSmxKSGFxRnpIU0FWa0RlZm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CTmJNWHZJWGFyc09RRWhy?=
 =?utf-8?Q?35WTmxV7g2e+atymbVrXGnoe4?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c10b8bfd-1925-4d19-fa3e-08db885111e3
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 12:09:57.7910
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: f/mjz3oQNmShD6s8VEqlmkxqcKj53gV1Q6rXmC+zaxzllO8uezZVbH2wB2/SkaPWKUnLjdiUcY/EwBjZroELZg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB7045

On 19.07.2023 13:35, Alejandro Vallejo wrote:
> On Wed, Jul 19, 2023 at 11:08:08AM +0100, Andrew Cooper wrote:
>> Introduce a ROUND() macro to mirror ROUNDUP().  Use both to remove all the
>> opencoded rounding in mem_hotadd_check().  Fix other minor style issues.
>>
>> No functional change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Jan Beulich <JBeulich@suse.com>
>> CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
>> CC: Wei Liu <wl@xen.org>
>>
>> The compiled binary is identical.
>> ---
>>  xen/arch/x86/x86_64/mm.c | 31 +++++++++++++------------------
>>  xen/include/xen/macros.h |  1 +
>>  2 files changed, 14 insertions(+), 18 deletions(-)
>>
>> diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
>> index 60db439af3ec..38f978cab269 100644
>> --- a/xen/arch/x86/x86_64/mm.c
>> +++ b/xen/arch/x86/x86_64/mm.c
>> @@ -1159,10 +1159,10 @@ static int mem_hotadd_check(unsigned long spfn, unsigned long epfn)
>>  {
>>      unsigned long s, e, length, sidx, eidx;
>>  
>> -    if ( (spfn >= epfn) )
>> +    if ( spfn >= epfn )
>>          return 0;
>>  
>> -    if (pfn_to_pdx(epfn) > FRAMETABLE_NR)
>> +    if ( pfn_to_pdx(epfn) > FRAMETABLE_NR )
>>          return 0;
>>  
>>      if ( (spfn | epfn) & ((1UL << PAGETABLE_ORDER) - 1) )
>> @@ -1172,10 +1172,9 @@ static int mem_hotadd_check(unsigned long spfn, unsigned long epfn)
>>          return 0;
>>  
>>      /* Make sure the new range is not present now */
>> -    sidx = ((pfn_to_pdx(spfn) + PDX_GROUP_COUNT - 1)  & ~(PDX_GROUP_COUNT - 1))
>> -            / PDX_GROUP_COUNT;
>> -    eidx = (pfn_to_pdx(epfn - 1) & ~(PDX_GROUP_COUNT - 1)) / PDX_GROUP_COUNT;
>> -    if (sidx >= eidx)
>> +    sidx = ROUNDUP(pfn_to_pdx(spfn),     PDX_GROUP_COUNT) / PDX_GROUP_COUNT;
>> +    eidx = ROUND  (pfn_to_pdx(epfn - 1), PDX_GROUP_COUNT) / PDX_GROUP_COUNT;
> See [1] for both the sidx and eidx lines.
>> +    if ( sidx >= eidx )
>>          return 0;
>>  
>>      s = find_next_zero_bit(pdx_group_valid, eidx, sidx);
>> @@ -1186,28 +1185,24 @@ static int mem_hotadd_check(unsigned long spfn, unsigned long epfn)
>>          return 0;
>>  
>>      /* Caculate at most required m2p/compat m2p/frametable pages */
>> -    s = (spfn & ~((1UL << (L2_PAGETABLE_SHIFT - 3)) - 1));
>> -    e = (epfn + (1UL << (L2_PAGETABLE_SHIFT - 3)) - 1) &
>> -            ~((1UL << (L2_PAGETABLE_SHIFT - 3)) - 1);
>> +    s = ROUND  (spfn, 1UL << (L2_PAGETABLE_SHIFT - 3));
>> +    e = ROUNDUP(epfn, 1UL << (L2_PAGETABLE_SHIFT - 3));
>>  
>>      length = (e - s) * sizeof(unsigned long);
>>  
>> -    s = (spfn & ~((1UL << (L2_PAGETABLE_SHIFT - 2)) - 1));
>> -    e = (epfn + (1UL << (L2_PAGETABLE_SHIFT - 2)) - 1) &
>> -            ~((1UL << (L2_PAGETABLE_SHIFT - 2)) - 1);
>> -
>> -    e = min_t(unsigned long, e,
>> +    s =     ROUND  (spfn, 1ULL << (L2_PAGETABLE_SHIFT - 2));
> See [1] for s.
>> +    e = min(ROUNDUP(epfn, 1ULL << (L2_PAGETABLE_SHIFT - 2)),
>>              (RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START) >> 2);
>>  
>>      if ( e > s )
>> -        length += (e -s) * sizeof(unsigned int);
>> +        length += (e - s) * sizeof(unsigned int);
>>  
>> -    s = pfn_to_pdx(spfn) & ~(PDX_GROUP_COUNT - 1);
>> -    e = ( pfn_to_pdx(epfn) + (PDX_GROUP_COUNT - 1) ) & ~(PDX_GROUP_COUNT - 1);
>> +    s = ROUND  (pfn_to_pdx(spfn), PDX_GROUP_COUNT);
> See [1] for s.
>> +    e = ROUNDUP(pfn_to_pdx(epfn), PDX_GROUP_COUNT);
>>  
>>      length += (e - s) * sizeof(struct page_info);
>>  
>> -    if ((length >> PAGE_SHIFT) > (epfn - spfn))
>> +    if ( (length >> PAGE_SHIFT) > (epfn - spfn) )
>>          return 0;
>>  
>>      return 1;
>> diff --git a/xen/include/xen/macros.h b/xen/include/xen/macros.h
>> index 7b92d345044d..ceeffcaa95ff 100644
>> --- a/xen/include/xen/macros.h
>> +++ b/xen/include/xen/macros.h
>> @@ -1,6 +1,7 @@
>>  #ifndef __MACROS_H__
>>  #define __MACROS_H__
>>  
>> +#define ROUND(x, a)   ((x) & ~((a) - 1))
> Why not ROUNDDOWN() or ROUND_DOWN()? ROUND() doesn't imply a specific
> direction and can be confusing if ROUNDUP is not seen next to it.

ROUNDDN() would address some of your blank padding concerns, for ...

>>  #define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))

... being the same length as this then. That said, ...

> [1] The hand-crafted alignment there is going to collide with the efforts
> to integrate automatic style checkers. It's also not conveying critical
> information, so I'd argue for its removal in the spirit of making future
> diffs less intrusive.

... I don't agree here. First of all I don't see why this should
make style checking harder. There's nothing written anywhere that
such alignment padding isn't allowed in our code, so any checker
we want to use would need to tolerate it. Plus while such padding
doesn't convey critical information, it still helps readability.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 12:25:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 12:25:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565819.884347 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM6Ey-0001jl-IM; Wed, 19 Jul 2023 12:25:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565819.884347; Wed, 19 Jul 2023 12:25:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM6Ey-0001je-EJ; Wed, 19 Jul 2023 12:25:12 +0000
Received: by outflank-mailman (input) for mailman id 565819;
 Wed, 19 Jul 2023 12:25:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=fyAl=DF=citrix.com=prvs=55726f7b7=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qM6Ew-0001jY-MU
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 12:25:10 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4bc8aab4-262f-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 14:25:09 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4bc8aab4-262f-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689769509;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=mHyvFWxCWGdqxsZY/Dj4dtue/ppFq+2gHCIJLk+UjEs=;
  b=LxsbvjjE3TSa+AfAQfZBuPEkl0lOEnwSGv/yKO4OQrYhGNLR0/u8jevU
   Yro372Jjx8ulvJj6b3jWyBv918+rpP18rJcebzbdNllPU1n4luYPbuisl
   ROOCUniVRlgN8eIbOAb0ibik0WT+Dj1448dMeJSmcvvEdCkvr8OJGxZqk
   k=;
Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 116603790
X-Ironport-Server: esa2.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:ZeW06aIMRWD6cX+iFE+R0ZUlxSXFcZb7ZxGr2PjKsXjdYENS1TUGy
 GEbDGrUOqyOZWr0e411YYWw9R4EuJTWxtZnT1dlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws
 Jb5rta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EYOCLggqVxcRZnPPfKl7balzDH4xmpM
 FdmsFFYbWcYTcVsS+52njALz9K+qjkzEncv5a7854bd3AOV0gP1WdE4wCgeHFedU1jKL58ML
 e53MBOoD2tYh0sH7aGL0hAe8Xm4/nnsKjtaRkACwVixxKJiVqTmcvHOind+jo7Fxdj5Y0p+W
 /Dnxe8xojLiYDJ9jbsk0v/y9Bztf/awNNFA8CWzugTJTP2jg60ZIJnMofyzAwdkaWKxXJvtP
 TpmR0pOMN+8Dfudny4uh/kwAuI6kdb15ao8y7kvZKqm72EeNslMbs3uWt2SGqn13Yd
X-Talos-CUID: =?us-ascii?q?9a23=3AnobuOWl2SY1OIolqdSdj52B8CwTXOXbX7WnLDG6?=
 =?us-ascii?q?DNUlWErSucFOsoJ1rr+M7zg=3D=3D?=
X-Talos-MUID: =?us-ascii?q?9a23=3AUGTH2A4oro3D0YOsFjRZj3v8xoxvwKqhT38nmqx?=
 =?us-ascii?q?WtsbUMwJZAhSCixqeF9o=3D?=
X-IronPort-AV: E=Sophos;i="6.01,216,1684814400"; 
   d="scan'208";a="116603790"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
	<JBeulich@suse.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>
Subject: [PATCH] x86/hvm: Allow hvm_copy_to_guest_*() to come from const sources
Date: Wed, 19 Jul 2023 13:24:57 +0100
Message-ID: <20230719122457.4067001-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

The work to fix MISRA rule 7.4 (using mutable pointers to string literals)
identifies that string literals do indeed get passed into
hvm_copy_to_guest_linear() by way of the PVH dom0 command line.

This higlights that the copy_to_* helpers really ought to take a const
source.  Update the function types to match, and cast away constness in the
wrappers around __hvm_copy() where HVMCOPY_to_guest is used.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
---
 xen/arch/x86/hvm/hvm.c                 | 11 ++++++-----
 xen/arch/x86/include/asm/hvm/support.h |  4 ++--
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 57363c2ae124..32dcd34f678c 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3401,9 +3401,10 @@ static enum hvm_translation_result __hvm_copy(
 }
 
 enum hvm_translation_result hvm_copy_to_guest_phys(
-    paddr_t paddr, void *buf, unsigned int size, struct vcpu *v)
+    paddr_t paddr, const void *buf, unsigned int size, struct vcpu *v)
 {
-    return __hvm_copy(buf, paddr, size, v,
+    return __hvm_copy((void *)buf /* HVMCOPY_to_guest doesn't modify */,
+                      paddr, size, v,
                       HVMCOPY_to_guest | HVMCOPY_phys, 0, NULL);
 }
 
@@ -3415,11 +3416,11 @@ enum hvm_translation_result hvm_copy_from_guest_phys(
 }
 
 enum hvm_translation_result hvm_copy_to_guest_linear(
-    unsigned long addr, void *buf, unsigned int size, uint32_t pfec,
+    unsigned long addr, const void *buf, unsigned int size, uint32_t pfec,
     pagefault_info_t *pfinfo)
 {
-    return __hvm_copy(buf, addr, size, current,
-                      HVMCOPY_to_guest | HVMCOPY_linear,
+    return __hvm_copy((void *)buf /* HVMCOPY_to_guest doesn't modify */,
+                      addr, size, current, HVMCOPY_to_guest | HVMCOPY_linear,
                       PFEC_page_present | PFEC_write_access | pfec, pfinfo);
 }
 
diff --git a/xen/arch/x86/include/asm/hvm/support.h b/xen/arch/x86/include/asm/hvm/support.h
index 8d4707e58c9c..142e5985642d 100644
--- a/xen/arch/x86/include/asm/hvm/support.h
+++ b/xen/arch/x86/include/asm/hvm/support.h
@@ -59,7 +59,7 @@ enum hvm_translation_result {
  * address range does not map entirely onto ordinary machine memory.
  */
 enum hvm_translation_result hvm_copy_to_guest_phys(
-    paddr_t paddr, void *buf, unsigned int size, struct vcpu *v);
+    paddr_t paddr, const void *buf, unsigned int size, struct vcpu *v);
 enum hvm_translation_result hvm_copy_from_guest_phys(
     void *buf, paddr_t paddr, unsigned int size);
 
@@ -85,7 +85,7 @@ typedef struct pagefault_info
 } pagefault_info_t;
 
 enum hvm_translation_result hvm_copy_to_guest_linear(
-    unsigned long addr, void *buf, unsigned int size, uint32_t pfec,
+    unsigned long addr, const void *buf, unsigned int size, uint32_t pfec,
     pagefault_info_t *pfinfo);
 enum hvm_translation_result hvm_copy_from_guest_linear(
     void *buf, unsigned long addr, unsigned int size, uint32_t pfec,
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 12:28:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 12:28:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565822.884357 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM6IQ-0002XT-0J; Wed, 19 Jul 2023 12:28:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565822.884357; Wed, 19 Jul 2023 12:28:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM6IP-0002XM-TL; Wed, 19 Jul 2023 12:28:45 +0000
Received: by outflank-mailman (input) for mailman id 565822;
 Wed, 19 Jul 2023 12:28:44 +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 <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM6IN-0002XC-Vh
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 12:28:43 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20602.outbound.protection.outlook.com
 [2a01:111:f400:7d00::602])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ca453d4b-262f-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 14:28:40 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PR3PR04MB7292.eurprd04.prod.outlook.com (2603:10a6:102:85::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Wed, 19 Jul
 2023 12:28:36 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 12:28:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ca453d4b-262f-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JvstOa7anT9pniV7cmL5KlFaQIARlMY3ecC7BJl3pY7XTAJSUHTbMCe1+k8DwDD3evz1sQLZcqwUZKQVIyT3UCHk103/NantKebYq7RoF7v0rYeEFrAPRGx9L0eOCvNxAOvbc/zFjY19szgWzpggHAv53PKtZu/p+WYObYLEvjoGk8BrH+CMH7zK8BZjTrs6Y3evJ5LM0oiOPC6H8IsS043NThNOJwp/4/8sAWFbbsFyqeMe/DiDN5vILQQcNUzxiQlrHTSqEOycdfXTmypXPutaecpYUUEDBSmK0R5dwn+2LB7ZvOzARR+7aTjeg5oQzqIvvvLVelbzS13A4Wk4eg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=2nbtjm3If5eDSy+y56CW1wRtxXW938WDjfFg+QN6FgU=;
 b=T0Kt+4T8lizEEJxUd/uXJugS6xqg6KyfSNn6yimeaj7COjNDHD29mnkTMouzgM21T38i161QPHtmv0Xq9v5U6a5F7jjxVZ+XJnzqMKSjwSBnzMpcKJklngNo3RuO90BN7O3rTENmg26YYfvDYifsP2phW71eTP+GPiAipNnMzw8XqnoMpan0nY7HXqwaBkV9Do+uhwADssRZ3WSZHYQ7+t07TI/19L74YKDVFrZug34XnRqUe8+riPYwtiE+kALhFCmFdzAnEbLzIFM24mC9entNlpe/Ob0RZJm16Dk596T+XPZ66r4K3TvvQrs+lnQP8vjDTqi7EbF8tAnw8RVMww==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=2nbtjm3If5eDSy+y56CW1wRtxXW938WDjfFg+QN6FgU=;
 b=re2A0PNovIH13gnVYOu1fR/W4/c3o8y8IWFiznLlCSTXUpXqe82Z6574c1I6bNExJSpRBZDmwRdYiW7FlvSD9rGihlaA41qmuf7OgCCiWFnTUSpZgRY4J6Q3jHdki9xXAryV9Ao+38yPSAWsR3VKCtn1t+OLOlKHusRcosmmeaLPrAwO1/fzpK9yFfpy3KtHtpd39fBTN8Ls+Aol9BpQfZYUptIsdYBiyKj5nCY5Jov7tFik4sIkvoHWUjzQl1yTVdLtngZo0SuZ5jPVn+64qp2W3Ds5zArFEPtrz71Oo3kosH12ol9LQY0Qv1zb4nOQVU5FJNZr+PP0Apzy7pP0nw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <b4559e5d-9736-af7f-bc0b-130a9b391b69@suse.com>
Date: Wed, 19 Jul 2023 14:28:34 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 2/4] x86: allow Kconfig control over psABI level
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <dace10da-f108-fbe5-da4f-0e4497f512d9@suse.com>
 <28a84bbd-b0c4-dd80-b9c2-59770d0f54fc@suse.com>
 <bb671300-543f-3754-b428-73b91ae321a5@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <bb671300-543f-3754-b428-73b91ae321a5@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0105.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a9::20) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PR3PR04MB7292:EE_
X-MS-Office365-Filtering-Correlation-Id: 6cf5c3b8-347b-416d-5464-08db8853acc8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	XfP8zf7hXIeKcnChded/sNI8Y0xx2PzKqUTttFFkbUrn7Ut4+3mR/oRK0WrjDrEaK9etyJCnjv0irkaBdjUOT41EcOAEVSKpmZ9rUmf0ZLveAfAwXAbcxM9uFdt7DIte3rCnQO4mUSgcZl2663Qp4rvwOgNNH87BQu+h4Mfn69TCdJTu6XVfPS1im+KieRi8Mur36AHKCMTYYvv7GQ91kWHCsiGAOqdvlbpcwq5+iDrfV2XqYyHOJGzj3utMD3rDa7eJ+TczdWCz1meWSo0PuGMf4F14fef3/EVOu+bem/mjnVzK0w7QnniexOnYLEFKOvF66E0oV54JemXA2OdBqHjvXTrpMD+5/cvTa5f7lAsCL/I6mV/HCzd4eRP/49GCt4yhAGRmeBOeU9PW33ekpcwjDolrfFanTMNxMbRvv4oqCYzUisJ9yHAmYPOBdnf2gpchSM+1O42bpuNI7ceHZrDK7xSdxXPhxW7cwI4UKQUG1f0sh2BwxCGKD1uojcNc5//VPvl6tCi+KwPiuE/CNvHfVu89OEc+vvRB4tzC2B83AvHpONAcmspyLcbp+ulzRkXpxtt3zw/D2i/O7KMAjGokWReGko4kGQAKNIoJVqOFcR4ESN9rVBBde1sVW/Ofw+HgD10nGmIpNZKG7Iu0Sw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(396003)(136003)(366004)(376002)(451199021)(31686004)(66899021)(6486002)(478600001)(54906003)(83380400001)(2616005)(36756003)(31696002)(86362001)(2906002)(26005)(6506007)(186003)(53546011)(6512007)(38100700002)(6916009)(4326008)(66946007)(66556008)(66476007)(316002)(41300700001)(8676002)(5660300002)(8936002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?b3Q4NFo3dDJxeWhYU1FUcG9sSWt0dmJDa2c4RTIza1JMY3pWYzArdjNrZkVD?=
 =?utf-8?B?MTVOQTRROVdjZEtTaVFjdjJPZHJWQXZnSEJnTE10dmJ6YnhXbkV4N2VKUVBQ?=
 =?utf-8?B?QmU2YUlZSHJjZUphVWFDS25PMEt6MlRRK3VHSDNhbCtYeFVzRFhsUkR6ak8x?=
 =?utf-8?B?NmxrV3czSHBWc2JPM3l4QmxRdms2bjMvZURCY0RNL3piK3llQUtyRE9INUZZ?=
 =?utf-8?B?cWlrR2g2RllFMmtmVXhOQk1ubWkzb1VlQ0Q1TGtCcUVYcUlnS2o0VVYzNU9y?=
 =?utf-8?B?QTMvY0NDQVN2RTg2TURDNzBsS1BYSXM0cG1McWZNN0tzOCtUejFmdzRIMmE1?=
 =?utf-8?B?WndnRW1HcUthTWpSZFd3WG5meEtYdkdnblA3TmNnb1JJcDBmbVlwRVFOaGc2?=
 =?utf-8?B?SVh6WXBkc05xa2c2ckYveGNWbk1SNWllbGxjSjR4aUJlUzg3MU5QWjFwc3Qv?=
 =?utf-8?B?WmdQK2FBWm5DZ2Y2U09kbjVBZ05lUFhVVUEveWpVMTFrclFuQ3hWS3hPUW4r?=
 =?utf-8?B?cHd5eTIyWldWV2sxMUkwVmlTTFVSNGl1T1dOQ2hvZXRidTN6NmNBcUVLUWV2?=
 =?utf-8?B?RmlrMFN6ZW9OQnZ3RVYycFNidVA0WWY1S1BaRG9pd3dvcVEzei9pRlJxaU9w?=
 =?utf-8?B?eHZVQzdYWit4L3hVZnAwUTRIOTZZV0hEcU9mUk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-8?B?T2tFWndnVWZPc0d3SzY4RlQ0MTNrcSsweE1FTlR2dHZXSDRqRDRvSjRxaG1x?=
 =?utf-8?B?ZzNyVldiOW5iTmRHZmVoUndHL1JURDR0QVRqVlZrdmtHZ3RRZGQxVFU2UkFN?=
 =?utf-8?B?dEgyS2dDUjRVV2F2RWxhTFl3dnZSZjdUdzlma3FuZ1RWa2NRZC9yTjYzUlJH?=
 =?utf-8?B?WnEvdnl4eHRBQzdna2IxSE5jUks5RHpxVmxHOWxjQjA3d1ZiYndxVVAyWDRK?=
 =?utf-8?B?cTVoT2JkWFpKaXVyUFVVSWtnTENFVHpiUm1LWXZ0d004RGZtbFJFZktFTVY4?=
 =?utf-8?B?VXdwdXdjZnVZdE1IeHdROGcvR3ZqSm5EZ1RJRURPMklza0Y3S01Xb0VFd09x?=
 =?utf-8?B?N3VJeFlCUmtlNkxuay9nb0U3ZmpPeVlVck1oTHBUZ1huY1NXcjduYXduRHkx?=
 =?utf-8?B?S001cTMvakR0Qk9RZkdsV3VtaENjdHNOcWhSTEJZcGNEQUhGSWFaQ1BVcHZS?=
 =?utf-8?B?b1d6aVI4by9wR2FDN3lCWUFYdWo4NVZ3a1ZtS3BIYmdwVndSa1l1Y3FqTEJK?=
 =?utf-8?Q?Imgls7bWhS2GCRbTLTKIw7H00?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6cf5c3b8-347b-416d-5464-08db8853acc8
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 12:28:36.6652
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 13M0MgHUtv6WrVA7i2aJ9WhYc5sOzhmohWCqGb5FhqH6FCgg84Z/3GrGfmcimZ/KhdoQHvW+Ia+358CMrINCww==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7292

On 19.07.2023 12:04, Andrew Cooper wrote:
> On 19/07/2023 10:44 am, Jan Beulich wrote:
>> --- a/xen/arch/x86/Kconfig
>> +++ b/xen/arch/x86/Kconfig
>> @@ -118,6 +118,36 @@ config HVM
>>  
>>  	  If unsure, say Y.
>>  
>> +choice
>> +	prompt "base psABI level"
>> +	default X86_64_BASELINE
>> +	help
>> +	  The psABI defines 4 levels of ISA extension sets as a coarse granular
>> +	  way of identifying advanced functionality that would be uniformly
>> +	  available in respectively newer hardware.  While v4 is not really of
>> +	  interest for Xen, the others can be selected here, making the
>> +	  resulting Xen no longer work on older hardware.  This option won't
>> +	  have any effect if the toolchain doesn't support the distinction.
>> +
>> +	  If unsure, stick to the default.
>> +
>> +config X86_64_BASELINE
>> +	bool "baseline"
>> +
>> +config X86_64_V2
>> +	bool "v2"
>> +	help
>> +	  This enables POPCNT and CX16, besides other extensions which are of
>> +	  no interest here.
>> +
>> +config X86_64_V3
>> +	bool "v3"
>> +	help
>> +	  This enables BMI, BMI2, LZCNT, MOVBE, and XSAVE, besides other
>> +	  extensions which are of no interest here.
>> +
>> +endchoice
>> +
>>  config XEN_SHSTK
>>  	bool "Supervisor Shadow Stacks"
>>  	depends on HAS_AS_CET_SS
>> --- a/xen/arch/x86/arch.mk
>> +++ b/xen/arch/x86/arch.mk
>> @@ -36,6 +36,10 @@ CFLAGS += -mno-red-zone -fpic
>>  # the SSE setup for variadic function calls.
>>  CFLAGS += -mno-mmx -mno-sse $(call cc-option,$(CC),-mskip-rax-setup)
>>  
>> +# Enable the selected baseline ABI, if supported by the compiler.
>> +CFLAGS-$(CONFIG_X86_64_V2) += $(call cc-option,$(CC),-march=x86-64-v2)
>> +CFLAGS-$(CONFIG_X86_64_V3) += $(call cc-option,$(CC),-march=x86-64-v3)
> 
> I know we're having severe disagreements over Kconfig compiler checking,
> but this patch cannot cannot go in in this form.
> 
> You're asking the user unconditionally for the psABI level, then
> ignoring the answer on toolchains which don't understand it.
> 
> The makefile needs to be unconditional, and the Kconfig options need to
> depend on suitable toolchain support.Â  This is the only way we don't get
> a false statement written into the .config, and embedded in hypfs.

I was tempted to base this on "x86: convert CET tool chain feature checks
to mixed Kconfig/Makefile model", but then it likely wouldn't have stood
a chance to go in either. The technical issues aside that need solving in
that other patch, I still haven't had any feedback on the conceptual
aspects. Yet as said in other contexts, without having the conceptual
side (largely) settled, there's no incentive for me to invest time in
dealing with the technical issues (which surely are solvable).

When raising this aspect, did you pay attention to the first of the TBDs
in the patch? If we were to force build errors (for no real reason, see
below), we should first try those fallbacks, to limit the possible
damage. As mentioned there, support for these -march= forms isn't all
that old.

As to forcing build errors in the first place, that goes against the
intentions with the mixed Kconfig / Makefile checking model. There we
would only issue warnings. Albeit as mentioned in that patch, that's up
for discussion, and a majority may view things differently than I do.
Especially here there's no reason to outright fail builds, though:
.config / hypfs wouldn't really state anything wrong - the binary merely
wouldn't make use of newer insns despite being permitted to.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 12:34:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 12:34:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565826.884367 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM6O5-00042s-PV; Wed, 19 Jul 2023 12:34:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565826.884367; Wed, 19 Jul 2023 12:34:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM6O5-00042l-MQ; Wed, 19 Jul 2023 12:34:37 +0000
Received: by outflank-mailman (input) for mailman id 565826;
 Wed, 19 Jul 2023 12:34:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM6O4-00042f-Ao
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 12:34:36 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on20622.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::622])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9e5b1bc5-2630-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 14:34:35 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS5PR04MB10043.eurprd04.prod.outlook.com (2603:10a6:20b:67f::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Wed, 19 Jul
 2023 12:34:33 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 12:34:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9e5b1bc5-2630-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=SiCu8d3QxuDCo3F8ae2mB6iAD8iEHUUcm80hjFCHW8RqgGKH/9YAdSraAW1CxD+IybJkPlZ/Eho/1pIrfYlauOHv8x/7IPse8wNr8vP4U6e9BWFre+fo6ue+hFY/jyiW0XLsyeR1GwRX9cyDA06pZqmol7i2g8nS7YqsFddHmYZR3qQBWjQici4Cl3wNjS3+GZ96wglpSOlgyTSgbi0ZqJfyoWFWPgrNZriXdEdygX0JCBM0ARO/ndVdGYjqiHpL3omWlJ//cWbCzYIh5kpGNF37Ah8a1PClwo8y0dHegJnjLwlbUUPplEm+uSV8Id4hDGmF6e0kQg7s/Zek8J+ydA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=GebT5ibwqiK8B0jNzdjNV8syz8KD1POtQzM2wkK0Al0=;
 b=Z94Gw3y5TvF5bKNU1VQnj2+QRRVP48ndwUvndYqUbgA45vrXvEquDHJiY1/XcY5Y7LWIhZd6WqrgiS3F8ise2rSkwk/P0G6Y0DeR8C6jMLN+crkTe9Y4+oUn1/3jg7dzI+8g5xotIEZK7FcqtS0kbVLjJZnIe/JScqxxQ4w7jeQcm5MWQ1YcPaNiE7xB3hNiASUyl25PayvQR8JMJdW1WzbAt5opHjeT3pZ4wlJhgqKOOVnMygZ+qkkHFfd3HYjqcKfPJzNEEhnp7Vj44heaAiWc1QciHPAqKi/I6Pp4HDk86IMHdV2Rxp/TY72Lr4FRGEjCE+kiTU69KsxJcC7vVg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=GebT5ibwqiK8B0jNzdjNV8syz8KD1POtQzM2wkK0Al0=;
 b=zyOEWTSlcq3ihYXYL9X8rp5WsyN90KyBmIjazGgmAE3gi9t+uKqJSW7r7jsRn/Cs6jzE6zML8fDP4wOXec9VA/NiqFnzNO9XrdNH7HGRKXnYMt15p5KmE+YCrDxPsYJaT5krFgZ2rtTGOYmc9vqSnlJg0AgSGqwQiOtHWpC1aIR7VxQOJIE9zkl3O7mdKQFtIMM7007SFbe53ypYAJD+kR5tvyDe0Su0o9pGNR+bMXwKeJvPg+8f5D+uOPIQtj+ms+0jANRXhIewkayLzmWF4GeZLn5hZAvNXm7DBVMiMslHEIpmKd5oh98viL8T+MqxcwytteYOCTzhudmJxTyNEQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <eb33c444-934c-6db2-dac5-9e17ed0d1b0a@suse.com>
Date: Wed, 19 Jul 2023 14:34:31 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] x86/hvm: Allow hvm_copy_to_guest_*() to come from const
 sources
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
References: <20230719122457.4067001-1-andrew.cooper3@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230719122457.4067001-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0167.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:99::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS5PR04MB10043:EE_
X-MS-Office365-Filtering-Correlation-Id: b353f17e-f5f6-49e6-7a91-08db88548164
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	zyejbF8Avq8oud4IB26khorYC+LoMZCHuiQurB3YT4HVDsbg8Wn9R7sjYEt/EYxJaya+za4H4dJuTE3rwC8q/ttT5tU29dMZJlemRYuhFt1GMRjM9lDbaz5bWg3r2N0kNcjAcpMF02SykAturNAEkP/wbqUxvsl5q/t+ReqNHGl3VYqr0kX9pTrvHzKZSVp86M5w8CLNqRVWj/S3AsV3SeF9IawHuiURnr5nMxdOE5Ec3Ex6m3xxNvVWllP0pevqlXh7OIGKziXqQo7XHGmECRT1wCfDBSw9XstfQLm3U7nyBt/isM1q2sQ7znGUpyRFxzH3f27zQpGf6ycoodbzDpCzzIYMDzgdln9lg0wnywVKE2JIgvRZIQ+eTBxhX6DzAQCSdOo+U50n7pwnQpqoDwQBzTADRpDNnTCg+NZpDIOnIENQ8kjYtQLjdKqooU6HggjszgyFVsUK2AfDgwhuO3Oc5iA7ka9FXYZQmpUe8DuEcn07yVi5vI1ZLZGwg4jno+Qvnw8f0SqATZwGpMC6N7EWSd/X8dHr4/ZzJYg2Zjy0LYknbBAOUoc8V7e2hmELmYNAxLQPwJ2vimyJ/bv/Hh8yOr+f2CtEAh5DX97caCbEpYjJXEOZHG6dZ1bAk49CTSxV7y68QRtn3gj2GNQXUw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(346002)(366004)(396003)(136003)(451199021)(31686004)(4326008)(6486002)(54906003)(478600001)(2616005)(83380400001)(86362001)(31696002)(4744005)(2906002)(6506007)(186003)(6512007)(53546011)(26005)(316002)(38100700002)(66476007)(41300700001)(66556008)(66946007)(6916009)(36756003)(8676002)(5660300002)(8936002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WnJ2L3JxODRONW5wdnZWNHRLTU9sbkNqRi9tSElXSW1WNkZDOEMzd1ExWU8x?=
 =?utf-8?B?NVczTzJWM2ZRR1FxRXBJTW1ocGdRNE1ycUJxdllFdWtqWG1kNnRCSCs1Q21x?=
 =?utf-8?B?bjBTRFVwY3Vrekg2M3UvVGlGNmtoRmt0eGpzenlXSHBXdXp1RSs4MTNhcmFY?=
 =?utf-8?B?VjdnanhieU5uL2gxU0RTT1NiSU5ocGhZdVRXd1RrTCtBR0pqRFJpbE9mckZK?=
 =?utf-8?B?MEpJcG50MTgxYnl3VlRaVkp2Wk1BU1hUdGJ5eHhOM2k4dHNFZkdUd2g1MHUx?=
 =?utf-8?B?OVk4R3JEN251dThoVm1SU3RoejhtMGNDQVQ0MU1BT04xN0lCL291KzhWaDlN?=
 =?utf-8?B?d3hHek1Qa0Mvd0dFb3ZyMEQzUkFBNzhlZUZpbmJvaGlrZ0svdmZqQmxSOEs4?=
 =?utf-8?B?c3E3L0kvVFcyRlJidVBtQmljaExiTkRjWFdlVWlxZFdrdkRQOFVuazFNK2Z2?=
 =?utf-8?B?ZkdxQkRGNmNMYWJCN2FFYWVCRkQza1lvYm4zUHk4MWVCS3lidWtkbkNqY1Av?=
 =?utf-8?B?VjBoSlZiNmlQdVlmait5MFNRcGE1aW1UZ3IwUEVzTWt6S0dJRm9kcDVEVTNP?=
 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FVVWFQaWVMWVhhbjRBTzNDKzFUSy9lT2xa?=
 =?utf-8?B?dUZTN2p5ODQxTUsrd0Zlb09yTXBjbWZGOUcrOXVsWGNpdW5FNG1RSUtqdjVt?=
 =?utf-8?B?V0lueTRrcXhGNVptNG5XRjZ1S0lycVhpdkRRR0NkVHZHRm9zbDE5OGVMTE1F?=
 =?utf-8?B?Sjl6Yko0Tnh1ZmlHblppV3BDRzNyY0NRZCtJZTRYbXFpUjhQYU5Va2ErRWY5?=
 =?utf-8?B?MmRRYWNXeS9LQkdSTkMrZStQSUZwci9LNkkzZkdIQUp2Ty90OVhiVENpSGJI?=
 =?utf-8?B?ajZhL2hOYUhrK1VreXB0VldHNkhWZllXT28reDk1UHZOSTZpdXkvcUFYcWxy?=
 =?utf-8?B?Q015ZldYTGtZZUFuUU0xdCtOOWRXbGlNTXNPaDJhYnRJdDloVm9xaWFKOC9E?=
 =?utf-8?B?NUFrRmlZZ3lIR041eFFPRHJaQ2Rsb3pOZmRqWFU5NlpTeklWUFg2U2wrVy9l?=
 =?utf-8?B?dFJjbC9PQkpaVkUrTnl1UFRpeEtIcWhnR1RvQklrU1pKN2pZTktzakVQZ1Bp?=
 =?utf-8?B?b0pienptWUdWQkh3TzVjbFU2YWRhSXdMOXpOcHNIZldXS09KUlpUTWIyL2Y5?=
 =?utf-8?B?RWFtZlcrUkRSblViWFB6eW5jVHN0dlVBbjRjWVdlZTErRXBZSkcxSXVDRElM?=
 =?utf-8?Q?/uoPgYDDze5QymmVHU8/3JhUY?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b353f17e-f5f6-49e6-7a91-08db88548164
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 12:34:33.3972
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: wWUWv/7/viozgqV+X7otCKm9H4oOpPVm4qHCmh01F2yyPMeRHa5kVpm9F09ISnb6bSPOiXUmmEf15IVckg2KFA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB10043

On 19.07.2023 14:24, Andrew Cooper wrote:
> The work to fix MISRA rule 7.4 (using mutable pointers to string literals)
> identifies that string literals do indeed get passed into
> hvm_copy_to_guest_linear() by way of the PVH dom0 command line.
> 
> This higlights that the copy_to_* helpers really ought to take a const
> source.  Update the function types to match, and cast away constness in the
> wrappers around __hvm_copy() where HVMCOPY_to_guest is used.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Well, yes, what do you do.

Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 12:47:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 12:47:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565829.884376 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM6Zz-0005oK-Sn; Wed, 19 Jul 2023 12:46:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565829.884376; Wed, 19 Jul 2023 12:46:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM6Zz-0005oD-Pz; Wed, 19 Jul 2023 12:46:55 +0000
Received: by outflank-mailman (input) for mailman id 565829;
 Wed, 19 Jul 2023 12:46:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM6Zy-0005o7-Mb
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 12:46:54 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on20606.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::606])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 55f6aa05-2632-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 14:46:53 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB9128.eurprd04.prod.outlook.com (2603:10a6:20b:44b::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Wed, 19 Jul
 2023 12:46:51 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 12:46:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 55f6aa05-2632-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=SmMLyQcU38SzjlVAtp//jkyfegLwA3vVQOubYrNIyaM/q7LT43afezovQLiAt9Jdm9C/A6VZJ9sH7GwzIvOQs+COguOEsmzzqJb7WMiJm5G4/9bNfzngmqelK6Tgn3UQHjSCS9rdYxiYku/mQa1p523Tw9PQcvA6luIMtewLYXTb/xQTUA30LthPVpKMlcV2DYaksqA90pBgdPoViT5zK/rDZt3xSxh2Dxkr9LYh5TJs5GHJCr/gdwIilVaMMhBHOcm+q7DW4aGQNcFyRDVIXNxDbR6LdhmAYkUcZT2KoTCcFouhjVDrqV6gjuOfn+2ko6BlEi4skjo7JsRdVTXWrg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=1PpEtTjchqtIXbj5lvrqIxEFaxj/Cyma1XqXDqeY4cU=;
 b=ju9ZPC7UOPtiniEYWBIvD83RK++BgBLL5VTMjNzCjv2d+FhvgHhG3kmKmHvgS+nUjmyxqQtBiPwoZ4CE0/w73TGuIOFMgFWQLdSPhXmN0BOQDJ43ggAGrJ/1NjyIHeyt7gPNoJsVAPHn6xP8aaYvxxllaO1eXLjTl67RFoKpkZwSTQFcPwXNpkJEt6RD9vVusT9Z8tUgJ1tQASKL2lcC48nwq7g6QSz9g8/N9BaNi4LiHog5AwSgLPv+1PX2Y5wIun8TQmsS+fW6W6QMgxMxAaDgGEzoEXNSPyYrSlqTAhez3JofTAfkN6hbTNAkh1QAqCDrHLTHald8atsiCJOqyg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=1PpEtTjchqtIXbj5lvrqIxEFaxj/Cyma1XqXDqeY4cU=;
 b=gzX3jC157dnMf4hgH4rBTXAsS1v82hrHpZRCoAGe97ETpKuLeTsHgId4OdHqNgPc1kHmHWXWdZ3eA8VPoMISk/SeWyNis60doiy+9JS6LHlKqzM5Zl7hLg3eIsETTRJWKsrTnNsQehJ7LmwfP37Kjxyy/ZivHw3ZArxkgA44jgGXlyV5PKtUnwD7qlk7DxuwZNgKjvngSm2d9z3mvRUgN0GButeJOaLgXVGRhz94BWpGBLFuE4kYXmpJ21zXidgVFPjhxTXQDQ9arQeNky2Q8jozaqAST4NGtCBR4yV4MiqwgfJqhnaF15OYl20Ja16hn1CB7VrAgWJMOP8CUIQxhg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <824bb5f9-7bf7-9482-ca35-e4d1019ea7bf@suse.com>
Date: Wed, 19 Jul 2023 14:46:49 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 5/5] amd/iommu: force atomic updates of remapping
 entries
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <20230718124334.36548-1-roger.pau@citrix.com>
 <20230718124334.36548-6-roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230718124334.36548-6-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0104.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a9::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB9128:EE_
X-MS-Office365-Filtering-Correlation-Id: 1550dadd-683f-465a-c3c9-08db8856391e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	7WKRvgq+p6vJtUuCw908cdhHQ5sbEJT7HLbqIumoallsym4JUNKW+0UMku+EIHNdRXKy5eRDm1K9EkDhztaN50Qq1jRj5CqEQzZTq4baUXBhACps8L7QxohA7STPF8509Kb+MwcyV1wdEF2IGlraSxtqFeuHYIrftX9Lw3JXcugclFMr4XTIe4Ytt2nO+N0zQGig8tkAYwVmb+Azo3b6/i3AV96jkoW8IdGC4OAf9fqNMB8yEWOYBjYjsTcCuBGLQBo/0KaEdcKHjWbqBjeY0oarXZO629NkZakCe0vqsDiZlxVlUNStManuD2MJYHVcIXnnexYBG7b41OJCanyjtdi/cgIP3wxoDw+U9/0N+VWReaZ9xyPnzGsuCZFvgAGLZ9m55oqjd2gyl3UtvTvTT2fM/61Dw6veLxUP1/khM3QGwEG1Ot9s08Vz5CXpDopxhSrT7yiiUMYhJacgRU2RmPrbO4FynbvhVTiONUOQQJ67RWD1YSYwXgHWc4wyuNTn5Gt+GFTdKnOiR+8z2WKbHh4wPvJii+TiBPnwcmQZycBefq79ujfrPjxQJVgSpo8Yhu6JIyiiPl9smQ4YJWvi0hpf6BA6EBCjw0ejjp9SJtzPS2Hwr2oPwpVGIZUSi2OPODhr5aDwdVoXM4/VOy0NSA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(366004)(396003)(136003)(376002)(451199021)(31686004)(31696002)(86362001)(36756003)(2906002)(15650500001)(2616005)(186003)(6512007)(83380400001)(6506007)(26005)(53546011)(38100700002)(6486002)(66556008)(478600001)(316002)(66946007)(66476007)(5660300002)(4326008)(6916009)(41300700001)(8936002)(8676002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TFRWVjRNMGRqV09qS3lDVXN4Q0lJSjFNcmpNdG1jck9pWDFxSmgxM0J2RnNj?=
 =?utf-8?B?T0ZKWE5yU1EvSkRxS1UxVG9MS2MrT2NMN1Fhb1ZvWlYzZUc4aHlkOUpGbFhT?=
 =?utf-8?B?ZkREallpcmVhaEJFaWhrWEtLK0ZOc3gvS0FOb0Z0cjJNa2taenQ0RUU5cStj?=
 =?utf-8?B?Yzk1SWxWVGFFalRQZUhKZWhFYnp5dElqdnY3cXcwTlQ0czB2dU5idTZiQkRl?=
 =?utf-8?B?MTJZcklkMEk0RnZLNGg5N3ArbmxjSkxRN2puSjJmYVo1V0lNV3ZxYnc1VzVk?=
 =?utf-8?B?WW9lWW01ZEFBR25UaENTTkVrNlc1NzlWbXV3ZjVFM2dkczIva21kd2xPaU5V?=
 =?utf-8?B?QXZ6TEF2UVRsQlNFeWxGeWxwenYrQjJhWEl2a0ZCeXUvenVwMklRcHRWa1gr?=
 =?utf-8?B?TnVWZVlkdE5uSzMxK0tVYzMzMldNU2RMTXZDZ1Vid0QvQzArSlJvUVJEdVR3?=
 =?utf-8?B?MjZoL1U3TFpGcWVucUV0S1E3UDlObDBpejh5WmJYOGg2QXAxTWFnaVVaVy8w?=
 =?utf-8?B?OUFBdGlYbEpneXl5UzlkZ1dCR0xsbUlQMFVhWnRyKzA0TytVWGZFMW8vUEk1?=
 =?utf-8?B?bnkwck5zL0h1T1dOOHFXbUFEakI2YzMweDdhb1hJd2hMVDg1Sk1YSGQ2VERI?=
 =?utf-8?B?dU80SzVsN3BQMDBMaFRrdFNFaFU3czdGYUdsZ29LM2NUSnVqVjUyT2txR3BD?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0ZnVi9qM1c2OEJ0M2V0cnZyZk5sWms4dGduMVkxMkRmeXRCblNXN2ZxMGpF?=
 =?utf-8?B?dDJuWFF5THJBWEJnaGNtZjdvZDBpQlo0YTZEVmhUVXZyOEd6ZDJZRStmWjZE?=
 =?utf-8?B?b0dLWVlaR3lKOFdpNlpQL3o3aFozeXUyVExCRHlkd1lQa1ZlZTBqSGhzR3Jo?=
 =?utf-8?B?d2VJeC9rcFV5a1pGNmZMN3JqdDNLcUVxVWF6QWYvNnk3alRmRE9lWVhEckRI?=
 =?utf-8?B?T0FpUGZ1Mk1NY1I4RXBzUkNOZExvZmxlT3JtRHRBSUM5VnNiSWU0Zng4eFNn?=
 =?utf-8?B?MmFORjlGc0lnQWxiRlRTQSt1WkdOdmZVS0dhNE9oOElrOGhnT2VlY3JMaklk?=
 =?utf-8?B?d0pQSisyNldhS2R2WGdhWFQ1NXZlUUdNU0tNNWs1bjE5WnlPSXcyNEplUncv?=
 =?utf-8?B?VHFpZUpvVjQvUSt6US9jcUhTM3RjWHNZQitTeHdiZFI1MDdEVy9lMFVUYjlk?=
 =?utf-8?B?VWxJRlcwbUFKSHk0ZElrL1plRHJLellQVkV6ZWxiUENpd2ZZTG9Va3haeUVJ?=
 =?utf-8?Q?/ReNzjkPUc+R/HvO9ZuJX5whp?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1550dadd-683f-465a-c3c9-08db8856391e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 12:46:51.1136
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: sSGvi7Ri6uDsH7wo82URqXvjtIlHVPlhK21scEHDM0zfzL0EKQ5Ewe7UE0JbHaPTQ4x7yKmz8EqkYfIn9ujLng==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9128

On 18.07.2023 14:43, Roger Pau Monne wrote:
> Disable XT (x2APIC) support and thus 128 IRTE entries if cmpxchg16b is
> not available, do so in order to avoid having to disable the IRTE (and
> possibly loose interrupts) when updating the entry.  Note this also
> removes the usage of a while loop in order to disable the entry, since
> RemapEn is no longer toggled when updating.
> 
> Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> ---
> x2APIC support was added late enough on AMD that CPUs that I believe
> all models that have x2APIC must also have CX16.
> 
> The AMD-Vi manual contains the following advice in the "2.3.2 Making
> Guest Interrupt Virtualization Changes" section:
> 
> """
> If RemapEn=1 before the change, the following steps may be followed to
> change interrupt virtualization information:
>  * Set RemapEn=0 in the entry to disable interrupt virtualization;
>    device-initiated interrupt requests for the DeviceID and vector are
>    processed as IO_PAGE_FAULT events.
>  * Update the fields in the IRTE and invalidate the interrupt table
>    (see Section 2.4.5 [INVALIDATE_INTERRUPT_TABLE]).
>  * Set RemapEn=1 to virtualize interrupts from the device.
> """
> 
> However if the update of the IRTE is done atomically I assume that
> setting RemapEn=0 is not longer necessary, and that the
> INVALIDATE_INTERRUPT_TABLE command can be executed after the entry has
> been (atomically) updated.

There's one additional prereq to this: The IOMMU also needs to read
128-bit IRTEs atomically. I'm afraid we can't take this for given
without it being said explicitly in the spec (I've just gone through
and looked at all occurrences of "atomic", without finding anything
applicable to IRTEs). If this can be resolved, I think I'm fine with
the patch.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 12:54:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 12:54:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565832.884388 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM6hi-0007VB-Md; Wed, 19 Jul 2023 12:54:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565832.884388; Wed, 19 Jul 2023 12:54:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM6hi-0007V4-IN; Wed, 19 Jul 2023 12:54:54 +0000
Received: by outflank-mailman (input) for mailman id 565832;
 Wed, 19 Jul 2023 12:54:53 +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
 <SRS0=7Hz6=DF=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qM6hh-0007Uy-AZ
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 12:54:53 +0000
Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com
 [2a00:1450:4864:20::632])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 72b20485-2633-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 14:54:50 +0200 (CEST)
Received: by mail-ej1-x632.google.com with SMTP id
 a640c23a62f3a-99313a34b2dso832313566b.1
 for <xen-devel@lists.xenproject.org>; Wed, 19 Jul 2023 05:54:50 -0700 (PDT)
Received: from EMEAENGAAD19049. (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 t19-20020a1709067c1300b00988f168811bsm2317230ejo.135.2023.07.19.05.54.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 19 Jul 2023 05:54:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 72b20485-2633-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689771290; x=1690376090;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=YnZISCSl30HLhKCwlsmkigH+KLcMbv+jSOcCTVz0Oe4=;
        b=adOFosXsUaOqRkC1WtPa6wsRuh/+mqtvBB6ODWAQzpHBvVqyslCNDUSIR7S0/q/n+7
         IArvKYurUotv3TnZ/JosC6yvRRFO0wOYD6yiZXwUSo2AHC7uHdM6MisTNNLOtjRhz72P
         q7kgX5b0q7YHhPOHuQEV6RCS1dKZLR0tWmzK8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689771290; x=1690376090;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=YnZISCSl30HLhKCwlsmkigH+KLcMbv+jSOcCTVz0Oe4=;
        b=EhRj/IMaShKVG1efuQKrV7MibSwcCrzBhRPJz6gR/je/71+ttRK18jyCdBbSBHdlvk
         n8e7A9Mh8tSOTQtDEzXelg3XzBeYx/FKiVA1V8Ffy2IZ+t/Fk1V0vycxfwqfE0h6fohT
         xwmmmQnvgE+sGS2HMK9lCDJfDELc4Azrm4gEQGssKQDerfGV1jyitJ5aFHJJfL5fyrCO
         9jPY0x5TpcOpRrYISuKuCR2oCCrmcnAaRNtqrGfWXUcdcPcWIjo+F2NeAyISz4hlOZSI
         lq5BIQT/dAmxcpPeVa8vehAP+qgEC4pKq960yfU6k+8REjsTfK+sMjYf7Oulfusi5AG9
         S6IQ==
X-Gm-Message-State: ABy/qLbTHt1qNTXHa7uzaih5WjVA1hk+djU4wloaBzItOPBx14hVoEJT
	ILql7jjTx/XlwOKX0RCmKH793A==
X-Google-Smtp-Source: APBJJlEixRXl91mIhNCAqYkQaSVyIPomTdN1UyiygGcNpSeomMWl6MfzG8We+2tBrCO54HZ8aCdCAg==
X-Received: by 2002:a17:907:728f:b0:994:17e3:2753 with SMTP id dt15-20020a170907728f00b0099417e32753mr3022361ejc.26.1689771290078;
        Wed, 19 Jul 2023 05:54:50 -0700 (PDT)
Message-ID: <64b7dd19.170a0220.26387.994f@mx.google.com>
X-Google-Original-Message-ID: <ZLfdGI1h/HwC+YKV@EMEAENGAAD19049.>
Date: Wed, 19 Jul 2023 13:54:48 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: Re: [PATCH] x86/mem: Make mem_hotadd_check() more legible
References: <20230719100808.4046779-1-andrew.cooper3@citrix.com>
 <64b7ca84.170a0220.758d8.90e0@mx.google.com>
 <468474ed-60b4-9ff2-83c4-036e1252b99d@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <468474ed-60b4-9ff2-83c4-036e1252b99d@suse.com>

On Wed, Jul 19, 2023 at 02:09:55PM +0200, Jan Beulich wrote:
> > [1] The hand-crafted alignment there is going to collide with the efforts
> > to integrate automatic style checkers. It's also not conveying critical
> > information, so I'd argue for its removal in the spirit of making future
> > diffs less intrusive.
> 
> ... I don't agree here. First of all I don't see why this should
> make style checking harder. There's nothing written anywhere that
> such alignment padding isn't allowed in our code, so any checker
> we want to use would need to tolerate it. Plus while such padding
> doesn't convey critical information, it still helps readability.
> 
> Jan
Considering the last Xen Summit sessions I think it's reasonable to assume
we do want automatic style checking to become a reality. If we want an
automatic style checker to be eventually introduced I think we should be
mindful of style changes unlikely to be captured by _any_ policy we may end
up having. In particular, alignment of arguments across different
statements on different functions/macros is unsupported on (most?) major
style checkers, and that's highly unlikely to ever change.

In particular, any style checker must follow strict rules in order for it
to yield consistently deterministic results (otherwise it might suffer from
termination issues). Expecting a style checker to automatically generate
heuristics that happen to match our current code configuration is not a
realistic goal, I reckon.

In this sense, having a guideline (i.e: not a rule) about trying to avoid
hand-crafted alignment where the benefit of it is not critical would be
good. In the spirit of making a complicated problem simpler rather than...
well, complicated.

Alejandro


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 13:11:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 13:11:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565838.884397 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM6x9-000207-Vz; Wed, 19 Jul 2023 13:10:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565838.884397; Wed, 19 Jul 2023 13:10:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM6x9-000200-St; Wed, 19 Jul 2023 13:10:51 +0000
Received: by outflank-mailman (input) for mailman id 565838;
 Wed, 19 Jul 2023 13:10:50 +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 <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM6x8-0001zu-8Q
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 13:10:50 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20604.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::604])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ad0a0ef5-2635-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 15:10:47 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS5PR04MB9896.eurprd04.prod.outlook.com (2603:10a6:20b:67d::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Wed, 19 Jul
 2023 13:10:43 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 13:10:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ad0a0ef5-2635-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=QGubNe+PTk3RpcgFVUHcBTTm3SNgPWiV4A17gYtD1yeyH72UJ80rUPBHiXNS9EhfAAf1IzTiSC7p2D+so5fzP8M94VSkMqqQZg2oNn4Cu3F+7Jw+QSNoBBeMce+WGw8b5r/5jMAfcCqCtFzBi0w+wZJowQgr4If+wktFwfh7WOEqPIwih1Hur67e3KjByepFtuRSh7oKzi/j/dncjJ9qnEJFBbzgF6qnfX9ZdWAW0LC2gaVKJUK7n77JKxEzrcJrALwxY4j004r4cOZdo3luJZi6MfdlzcCRa1KOhb5KRw0JOKRYIF1f4JnNfFbad4b2EoZtbotZoH2QexhiqYCfNA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=9nihrLMiEyoI4GBPA78WwCBZHID1xUUoZR9T/b1mXCU=;
 b=GloLooGOVfwsmA4F7cpWhsBga2Y9JlRqLBccB9S4wMNpko5gmVYJlucyHHPlukDQtgKcAMSGB/SD0Q4SkwmeBLdtxyGu6F6Q4bg5PkOHwE9lKeUe+cswIU3Qvb4f7jRE1PaxlQ9TDlZmzhOYFIfjGU4J3jbeQO8LxfH7jOWZMU1JJDAVpZ+s/CYKgxxfxJKzMkj0a4/13C/0/um1DwTg2TnZK49XABvWCMwgJMsDPe58AIx7xEPBcTpfrGOCZVSEzxgDGYqtu+BtkQyvnASeOZrlC5LxUqdwx0+myvQ22aE6OC6EYpHTPEz5ao8iRAyRHqxYz0BHm06mB4o+9dzm+Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=9nihrLMiEyoI4GBPA78WwCBZHID1xUUoZR9T/b1mXCU=;
 b=F4HlBaRpq5Td3yQnsQEnuxnZ/9LS8foYrK3UG/T8vAvERD3fxkBrsNd2LIsQTZCY8PJDZryLfTFDm2QqNP3DPfYpx+GPF2j+kwBq0o6jzVHgaTCvajW3+uyEZdNDEfBYqOuX1yuPD89eUhFuw2P8A8tP5QYSLShwu8meqGclwrdNRVNznQWCYYK3tXXrIKVU2gw4Eyg8Mb/mOR+RX1YafgJuzdfznvfE5yxuMQJqDZBlVszMMsRA2A6cQaEfzEpHoi7J7mrR0F6pzk4LX48vFwBgur048RqTihS4KVeuy6h38lfX1Z+sQe4sHs3gXPxTq2QWXiMmcEaqc3L0gtG6lQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <06a03d44-da26-530e-27db-1bac369bb565@suse.com>
Date: Wed, 19 Jul 2023 15:10:41 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] x86/mem: Make mem_hotadd_check() more legible
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu <wl@xen.org>
References: <20230719100808.4046779-1-andrew.cooper3@citrix.com>
 <64b7ca84.170a0220.758d8.90e0@mx.google.com>
 <468474ed-60b4-9ff2-83c4-036e1252b99d@suse.com>
 <64b7dd19.170a0220.26387.994f@mx.google.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <64b7dd19.170a0220.26387.994f@mx.google.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0134.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9e::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS5PR04MB9896:EE_
X-MS-Office365-Filtering-Correlation-Id: 61a80d26-9229-402a-c4db-08db88598ec3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	1B8cQEOFRgMlIbBR3ipSL5kKBG878nlll2oZ/BEXTqxuIbJTYSp2UD7K+joQCBJFD/E6yGLzD5j4N6EoYJ3cd0rUYiPDSePqtDHNm7RR/B8ATH4MEueLY6h08Pc/Kb568q7loz8//tsc1Y87eLn+LK04Ua4Uq2WEpGJaylTjKnpG3r6g2RLj2n9AWtDkk/cPuMSFAAD4qOhJBf06iPAp7j8UHN5qBZab5FgcSynesXub/VbUqTZDF3FsuU2Q2/qnQdAE9FsqRWLLVPoZ0hV7UlCsfyBvN46TRT93vtW2D6UY6QN1MiUF/K9f1e6xcj3llRdkRWuXpuqnqYgDXZ8VD2thZZRHtKVoV8mDGjwkyy+K3DZcMZN1g5SQyNJOWeBvEFNMyL0q7kDLUhVo2GhprY0Qp4ZOe1kB/wdikHk9LOhRjJOwLEB1/7wSYkzfYPsXISBgGE0TlSSXJSF0u3dpQGNfVzKwo2B4sRr0a+pV9OztEci3FoxV0YEiKRi3rkHt4uP+DwTE8kI9BRyclg0ccbISNjXo54b2uqmzxIYnrSyviWwR8HpSinD4oVukJBhGVkrhveszMpk33CVTJxAotwLwlFGF31YXiot3G6+xCq6axSbLh+Qkb0AoVd0JIOudOkH4rTiwPA94sPTnC5iEHg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(396003)(346002)(376002)(366004)(39860400002)(451199021)(31686004)(478600001)(6486002)(54906003)(2616005)(83380400001)(31696002)(86362001)(36756003)(2906002)(186003)(26005)(53546011)(6506007)(6512007)(38100700002)(41300700001)(6916009)(66476007)(66556008)(8936002)(8676002)(4326008)(5660300002)(316002)(66946007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MHhPaG1VVlRmdk0yQURDNkY0Z0dZMTJna0ErcC8rVDB0amtKa3dUbTd3WmdL?=
 =?utf-8?B?ZnR1dW1tdlBIdzJRaU5Nb25CbW1GMDBvNkluS2ZlNVJLL3p4elAzNWY2ekZv?=
 =?utf-8?B?U3MrZjhDTEVwRXpGQUxEOTNuUFZoc2NqbWlPZ1cwNmd4UTJacG93VHBscGdU?=
 =?utf-8?B?eUJkS2lPejhoWUpsSmtLVjBLUHdTSnp6SmlEdmtHVnFWc293R2lGMlZVTkVD?=
 =?utf-8?B?N2YvMS9GWkc1dWRna0xpWFJFK0Y4Vm9maVZNdlRXTlJKVWs5RlpoVnV5VWxq?=
 =?utf-8?B?Zm5EMlVhL1JKZ3pNcEI1OUpXUnN0TTUyc0Ywa2ZTNStpcVBWZWhvNGt2c3RL?=
 =?utf-8?B?ZjNxdm0yV3R6U2tYUTAwaWV2QTNjQlhFSXM3a2RRNWEwWjNERi92S083TEUx?=
 =?utf-8?B?Sm10MnM4VkdwUUVUSHluQWNtbGZVSGx0QnVOb2NqOHVGdHNDdXdXWHFGTGxJ?=
 =?utf-8?B?bXk2UWV2Y2tKK055bi9zUU9sL25nZWhFZUlsTkRGMTZGK3dySzIvbFZ3anRw?=
 =?utf-8?B?aXZrRmo2VlVpZFFPbjFQZDE1R1BkQjB0bnlQU2NSakZCM24rUmdTR1RsZnVt?=
 =?utf-8?B?WnFpUGlVckNxS3ladGpmNkhmMjhSODllL3FybGI3YjV6QlVMbTh4bGVKaTlR?=
 =?utf-8?B?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UJCNGVxYmZ4T3U4UUEvcmJGNkxEOFRl?=
 =?utf-8?B?dmsyVGpwZHdhMVdIZjRMaEhBK3JaQ05DbGVxd0NhSndObmZPd0thaDFpOUl5?=
 =?utf-8?B?V053WVJScHJKbnltTUc3OHlIUm4zWEFWSTZ0U3JKNStQc1dTeUhRK1I3MEUr?=
 =?utf-8?B?Wm1ZWjRRSTRSYjUyMVVMTXlEbXJ1MUh4Yzc1OGJSUno0YTZLRlZoWEhncEg5?=
 =?utf-8?B?aXlnSlB2Mlc1Q2xMVnI1U2llMXVGTXZ2ZnhNQnJMWUZIMEIrblJ5NVFxb2Ez?=
 =?utf-8?B?cTRwMUJ3TW8vNGgxSjBNWEUwT0o4ZURXRUdHaGVNMmdUazkvQ05WMm1CVTZj?=
 =?utf-8?B?QUlxTUNYZTF5M1hDTy9HaEQxSWpPYm5Mb3B6UmlocjdzRVE5U20yNHc2T0ZG?=
 =?utf-8?B?N3FsQTZINCtZSnk2RFJFaHJFT29VYk9obUpNYmZLcndqMHdHTVI0cGFhRnZr?=
 =?utf-8?B?TlZMQ0pQYlc1MVF4UWwrckhVQmdWWWlSWjZFampEN3pkOWp0UVUrWjRZMkVl?=
 =?utf-8?B?VzlNc2NUVHRjb1JOb2JCa0RBelNpaEtFVzBmcDdQb1FsandlZ1FTNUZoVUFK?=
 =?utf-8?Q?2UoImFQHH7w4SOsL25FVSsHEN?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 61a80d26-9229-402a-c4db-08db88598ec3
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 13:10:43.2818
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: zf4XULC24Zqsu4VYwQJSxXjEETJcshS5Gy5MC3AK1QGjGnGRIyy0ds/ePXWlQ2Q+fzM9KW7eGKzC1/YGAaxwZQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB9896

On 19.07.2023 14:54, Alejandro Vallejo wrote:
> On Wed, Jul 19, 2023 at 02:09:55PM +0200, Jan Beulich wrote:
>>> [1] The hand-crafted alignment there is going to collide with the efforts
>>> to integrate automatic style checkers. It's also not conveying critical
>>> information, so I'd argue for its removal in the spirit of making future
>>> diffs less intrusive.
>>
>> ... I don't agree here. First of all I don't see why this should
>> make style checking harder. There's nothing written anywhere that
>> such alignment padding isn't allowed in our code, so any checker
>> we want to use would need to tolerate it. Plus while such padding
>> doesn't convey critical information, it still helps readability.
>>
> Considering the last Xen Summit sessions I think it's reasonable to assume
> we do want automatic style checking to become a reality. If we want an
> automatic style checker to be eventually introduced I think we should be
> mindful of style changes unlikely to be captured by _any_ policy we may end
> up having. In particular, alignment of arguments across different
> statements on different functions/macros is unsupported on (most?) major
> style checkers, and that's highly unlikely to ever change.
> 
> In particular, any style checker must follow strict rules in order for it
> to yield consistently deterministic results (otherwise it might suffer from
> termination issues). Expecting a style checker to automatically generate
> heuristics that happen to match our current code configuration is not a
> realistic goal, I reckon.

I wasn't thinking of heuristics. I also wasn't expecting a style checker
to actually request adjustments to insert padding where may (seem to be)
missing. What I would expect is that it also doesn't point out such
seemingly excessive padding, requesting it to be dropped. I'll admit that
this may lead to the checking being slightly less useful, because of
potentially not pointing out an issue where there is one, but that would
still seem better to me than involving heuristics.

Jan

> In this sense, having a guideline (i.e: not a rule) about trying to avoid
> hand-crafted alignment where the benefit of it is not critical would be
> good. In the spirit of making a complicated problem simpler rather than...
> well, complicated.
> 
> Alejandro



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 13:16:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 13:16:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565845.884406 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM72L-0002fS-Lk; Wed, 19 Jul 2023 13:16:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565845.884406; Wed, 19 Jul 2023 13:16:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM72L-0002fL-JC; Wed, 19 Jul 2023 13:16:13 +0000
Received: by outflank-mailman (input) for mailman id 565845;
 Wed, 19 Jul 2023 13:16:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM72K-0002fF-Nb
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 13:16:12 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2061d.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::61d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6e22b3cd-2636-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 15:16:11 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS5PR04MB9896.eurprd04.prod.outlook.com (2603:10a6:20b:67d::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Wed, 19 Jul
 2023 13:16:09 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 13:16:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6e22b3cd-2636-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Q2m7Xic/2FVUsF3wd6n6/qI2h8dmPm4GALTHZOFkmF67rf0q+YHUxfLEPGxuUYgpoY626D4kmFcmldUzQDSf9ygVURVo+JE3cBshZBmLQqOMM43Gv572C3d2CUd1JBMf/XLd5HqSZaO2Vn/U6yZr6Ns4e87wRfKxl3vxmq82BHgN+mLiuZdkryYwzc73uP2fsaW7HeLflot5KIsd2Tf7qpE5Q3M0rUMvJmcwYsIx30xogPIRiTqsSL3h/4z5Twik5qAKu5G6U+wgcioXJeOJutoiW4K14YSsOSGnZzbXpqCP7/YQvxKpExk5by8dr9ysWy3UMQxvg4gquMs8LzNXjA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3Bgp+g3AwElj32ctIFKNakFeu2sQhvPuC+/HCzNco4Y=;
 b=V+GZcKW5aZTttr48TA0angjOZZf7FOpw81QGqFP9QBNwKKPSXmWuysrLN77GCfzxhEIG98zkO/6Gds3pPhSolNbgsRz1vczIunPE02OMVV/g7seeCI5ebBfHvGtN4Hvv/WcA744WUYX3Cw1WQ/nIh9xjbVDQ8rAcuf2f9z+FVtgIvouACGNoQ81eGx5lkVPLhhc8SnKdVIt+ljPw6bC4vADlBVuCh7xBr3S6mKt6KEnLfBe+wQBhAQ9gE0ba1pccry0H72drHw8WqXHnd60vyNFDWlv+BjwjkjnVBajn+jhe1XW8yCFdJsKTO8ymtlBWG06iyY6yqizPGejxVFPLDw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3Bgp+g3AwElj32ctIFKNakFeu2sQhvPuC+/HCzNco4Y=;
 b=Qtl0HY3OGhbHLAUkUbzGH/MRQimLtAQE42mVSeOZ7w/82FfOF8sxKiyWo/yKR0u6t0kZDaxzcHkdP0mLKX78Io9FppLWH8fqvsMmqfAVSdT3dYXWeT9aceoIlcbTzcz1si47lGgY7Cpcg4b2k/BjjUXujvA3v5KG38E4L1108+DJB/qxEmuWPy/ZwAAhB/eV7I9I+byWNBARmigessI2lIeJQw/ZiLbqww9wR7SPy/agBfpJwwLe9CJP2FPA2uK7vrVGNtBcjnGR0kWUi1/4hgHiGZuu6crnzbXbR0FQ4Eg+SSXeHLWVK0ZDuJNypClFI7jii9ZgSkWnGUoDt3lr9A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <89590296-8c3e-5099-4f24-a2c52453d398@suse.com>
Date: Wed, 19 Jul 2023 15:16:07 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] x86/mem: Make mem_hotadd_check() more legible
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu <wl@xen.org>
References: <20230719100808.4046779-1-andrew.cooper3@citrix.com>
 <64b7ca84.170a0220.758d8.90e0@mx.google.com>
 <468474ed-60b4-9ff2-83c4-036e1252b99d@suse.com>
 <64b7dd19.170a0220.26387.994f@mx.google.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <64b7dd19.170a0220.26387.994f@mx.google.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0029.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:14::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS5PR04MB9896:EE_
X-MS-Office365-Filtering-Correlation-Id: 31824bd6-6608-4073-26fe-08db885a512e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	OSfWJ4c1yb9dbWH8TptH2HvFcvzZtgtSDa6W6k5f/aqa8apb1zrGyE802wZ6/bLLdT5scdU2Kqumer3YO0lwr+vo5zEAL52AC7Qp0N3GT7Eq1bNQC3G5qp/kuoItYHc6MzgHnRiC5viWzKHUaydNKLPs0yzAxZoOgBn+KLw8R0aXplerWqWkTLT6/NVhxfFdksjwPby46ktX/DEqgXZ/olOA0NrPJ5Pyg/PZnT7d15dBQ6KCM53pXpo6QmyMq3dfyjZszIYk3/JDk4dgNZ0TZUKDYapx4bAVVKYZGqfuli9dc5k4gbJbzb6Df76BgOVRflpTbC7l470IsD9Mdx1BSLxqOnsikTOBzJp125839ku0dM22V8h0MgZiEt0QVvnWJBiFREkJNqyJxtiZeICuEt/+i+wB7pakjlm6mlGqMWcRXg7hlm5KrBbVeGcWNJTikHizEzU9vdVmYzRQSJBMJuR14R0hfdyTaFQnLLq55IplRq4xts9Pa+2dIAaDOWT7d99Ucd0QEQ/OqZU6RfdA1bvCK1DLMNGgUpGIkBWfL88QBRC016QDpKIN6i7j+ZOfTv8kRJAuYwBuNSbWSCH7IkMceuZNkzHNHqsLXAVLE9+hs4p5QFcYhbeoJMPSLrpzeKxOQGDywhd6EYY4BiUNyg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(396003)(346002)(376002)(366004)(39860400002)(451199021)(31686004)(478600001)(6486002)(54906003)(2616005)(31696002)(86362001)(36756003)(2906002)(186003)(26005)(53546011)(6506007)(6512007)(38100700002)(41300700001)(6916009)(66476007)(66556008)(8936002)(8676002)(4326008)(5660300002)(316002)(66946007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MXZUWXBWejJZM0tMTlpnVzNuaWFsOVlid0VGRnB5TThZaEZmV2tYMlBqbHNs?=
 =?utf-8?B?eHNHRVV1SE53dmFyTzVIQ1BwSkR2K0pYL0Nqc2NFYy9lQWNYYnJEQW94RDBh?=
 =?utf-8?B?WHdtMkhVajFrOCtacVF3V2RIWFZ6MU9XcEh6VUp1L1pya0UycjFWdEVPbUpI?=
 =?utf-8?B?YjNxN2ZUZGtOUWxXS3ZSRDllczRGQ2FGMlBYYVIvS3F4MVlQM3dWRkRZVFBL?=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4OFlQcXRHblIvQTkz?=
 =?utf-8?B?Zzh3a2lmSWRrRURTb1JuWEo5a2l1UVo4cGR2eHhKb2MydXlXYnVMMWQyM2xn?=
 =?utf-8?B?WEFuTGNsYWdiVCtzNFBJNldVWkNMTGVNL05KUDJyU3hpOXR3Sms0ekM2a2VR?=
 =?utf-8?Q?TGkzZFcgXkiL5qS7st1SDF4Fj?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 31824bd6-6608-4073-26fe-08db885a512e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 13:16:09.4675
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: FR2EnnJRDJNbGgfgt2G+PejI1qKyhjyrxJ2BOtoltZHFlatbJZckIWWLdmH9rEdcXyakopWZEM3lyxKmB9FEVQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB9896

On 19.07.2023 14:54, Alejandro Vallejo wrote:
> On Wed, Jul 19, 2023 at 02:09:55PM +0200, Jan Beulich wrote:
>>> [1] The hand-crafted alignment there is going to collide with the efforts
>>> to integrate automatic style checkers. It's also not conveying critical
>>> information, so I'd argue for its removal in the spirit of making future
>>> diffs less intrusive.
>>
>> ... I don't agree here. First of all I don't see why this should
>> make style checking harder. There's nothing written anywhere that
>> such alignment padding isn't allowed in our code, so any checker
>> we want to use would need to tolerate it. Plus while such padding
>> doesn't convey critical information, it still helps readability.
>>
> Considering the last Xen Summit sessions I think it's reasonable to assume
> we do want automatic style checking to become a reality.

Oh, just to avoid potential misunderstanding: I certainly agree here.
Just that, like in many other cases where computers (or automation in
more general terms) are involved I think that ...

> If we want an
> automatic style checker to be eventually introduced I think we should be
> mindful of style changes unlikely to be captured by _any_ policy we may end
> up having. In particular, alignment of arguments across different
> statements on different functions/macros is unsupported on (most?) major
> style checkers, and that's highly unlikely to ever change.

... the goal wants to be that computers (or alike) adapt to their
users, not the other way around. Sadly we're still extremely far from
that ...

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 13:18:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 13:18:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565848.884417 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM74J-0003Se-40; Wed, 19 Jul 2023 13:18:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565848.884417; Wed, 19 Jul 2023 13:18:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM74J-0003SX-0D; Wed, 19 Jul 2023 13:18:15 +0000
Received: by outflank-mailman (input) for mailman id 565848;
 Wed, 19 Jul 2023 13:18:14 +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
 <SRS0=fyAl=DF=citrix.com=prvs=55726f7b7=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qM74I-0003SR-7U
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 13:18:14 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b4369fb9-2636-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 15:18:10 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b4369fb9-2636-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689772690;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=PhhiL3zHUc0ntYLcK5me8bbKiX1aq/Dnmbcveep3Abc=;
  b=Bkh0HETqy1jnimWNkqQjOmc5oQHlSPdR0xaJn+X6eBZ2tWkguEA6L4fM
   ByrJAcPHF28Dbq7S0zJ0JKX+THr3C7QWtkx9KyQiYC9Pj26rQ87siCTE7
   Xnex+bBRxyW4IvbUZnIs3IP5rB/LkSMwgoog9ye6Acynq8SshNAQ2zLGp
   M=;
Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 116752627
X-Ironport-Server: esa3.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:CkRIj6OiRiAggQbvrR2bl8FynXyQoLVcMsEvi/4bfWQNrUp3gzYHz
 WQXW2jTPqqMZWr2LtFwbYW08U5Q7JHdnddhGwto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v
 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/
 Nj/uKUzAnf8s9JPGjxSs/vrRC9H5qyo42tH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ra
 yTdZEgviMc5wx/ZJhNo7690cu7IU80hKQV3WB5B97LNmTbUQCTXeJfBOXZslndMhy72ulB1b
 pxN4hSYeeAamSSVPyKgjVQxexQpeW6zA==
X-Talos-CUID: =?us-ascii?q?9a23=3AmbZfamhdRxWvQ1bqcOchYfXngzJuaVbhyUiAEkm?=
 =?us-ascii?q?CKm9HYqCMZHCo6ORfnJ87?=
X-Talos-MUID: 9a23:UjxoUAVmMotSk97q/DTrmRdQKsln34iVGWxWqM4g5JKgFhUlbg==
X-IronPort-AV: E=Sophos;i="6.01,216,1684814400"; 
   d="scan'208";a="116752627"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
	<JBeulich@suse.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>, Daniel Smith
	<dpsmith@apertussolutions.com>, Christopher Clark <christopher@nexfir.com>
Subject: [PATCH RFC] x86/boot: Update construct_dom0() to take a const char *cmdline
Date: Wed, 19 Jul 2023 14:18:02 +0100
Message-ID: <20230719131802.4078609-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

With hvm_copy_to_guest_*() able to use const sources, update construct_dom0()
and friends to pass a const cmdline pointer.  Nothing in these paths have a
reason to be modifying the command line passed in.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Daniel Smith <dpsmith@apertussolutions.com>
CC: Christopher Clark <christopher@nexfir.com>

Slightly RFC.

I'm confused as to why image is const, but the initrd isn't.

Also, I suspect this will interfere with the Hyperlauch work, and I'd be happy
to leave it alone if all of this is being fixed differently anyway.

This is necessary to make the -Wwrite-strings bodge compile, but I'm hoping
that a less-bad solution to the cmdline literals problem would avoid the need
to propagate const through this callpath.
---
 xen/arch/x86/dom0_build.c             | 2 +-
 xen/arch/x86/hvm/dom0_build.c         | 4 ++--
 xen/arch/x86/include/asm/dom0_build.h | 4 ++--
 xen/arch/x86/include/asm/setup.h      | 2 +-
 xen/arch/x86/pv/dom0_build.c          | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 9f5300a3efbb..8b1fcc6471d8 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -564,7 +564,7 @@ int __init dom0_setup_permissions(struct domain *d)
 
 int __init construct_dom0(struct domain *d, const module_t *image,
                           unsigned long image_headroom, module_t *initrd,
-                          char *cmdline)
+                          const char *cmdline)
 {
     int rc;
 
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index fd2cbf68bc62..a7ae9c3b046e 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -532,7 +532,7 @@ static paddr_t __init find_memory(
 static int __init pvh_load_kernel(struct domain *d, const module_t *image,
                                   unsigned long image_headroom,
                                   module_t *initrd, void *image_base,
-                                  char *cmdline, paddr_t *entry,
+                                  const char *cmdline, paddr_t *entry,
                                   paddr_t *start_info_addr)
 {
     void *image_start = image_base + image_headroom;
@@ -1177,7 +1177,7 @@ static void __hwdom_init pvh_setup_mmcfg(struct domain *d)
 int __init dom0_construct_pvh(struct domain *d, const module_t *image,
                               unsigned long image_headroom,
                               module_t *initrd,
-                              char *cmdline)
+                              const char *cmdline)
 {
     paddr_t entry, start_info;
     int rc;
diff --git a/xen/arch/x86/include/asm/dom0_build.h b/xen/arch/x86/include/asm/dom0_build.h
index a5f8c9e67f68..107c1ff98367 100644
--- a/xen/arch/x86/include/asm/dom0_build.h
+++ b/xen/arch/x86/include/asm/dom0_build.h
@@ -16,12 +16,12 @@ int dom0_setup_permissions(struct domain *d);
 int dom0_construct_pv(struct domain *d, const module_t *image,
                       unsigned long image_headroom,
                       module_t *initrd,
-                      char *cmdline);
+                      const char *cmdline);
 
 int dom0_construct_pvh(struct domain *d, const module_t *image,
                        unsigned long image_headroom,
                        module_t *initrd,
-                       char *cmdline);
+                       const char *cmdline);
 
 unsigned long dom0_paging_pages(const struct domain *d,
                                 unsigned long nr_pages);
diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index ae0dd3915a61..51fce66607dc 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -35,7 +35,7 @@ int construct_dom0(
     struct domain *d,
     const module_t *kernel, unsigned long kernel_headroom,
     module_t *initrd,
-    char *cmdline);
+    const char *cmdline);
 void setup_io_bitmap(struct domain *d);
 
 unsigned long initial_images_nrpages(nodeid_t node);
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index c99135a5522f..909ee9a899a4 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -358,7 +358,7 @@ int __init dom0_construct_pv(struct domain *d,
                              const module_t *image,
                              unsigned long image_headroom,
                              module_t *initrd,
-                             char *cmdline)
+                             const char *cmdline)
 {
     int i, rc, order, machine;
     bool compatible, compat;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 13:28:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 13:28:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565852.884426 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM7Dn-0005CO-Vf; Wed, 19 Jul 2023 13:28:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565852.884426; Wed, 19 Jul 2023 13:28:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM7Dn-0005CH-Sn; Wed, 19 Jul 2023 13:28:03 +0000
Received: by outflank-mailman (input) for mailman id 565852;
 Wed, 19 Jul 2023 13:28:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dh/8=DF=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qM7Dl-0005C8-VK
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 13:28:02 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 146ff032-2638-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 15:28:00 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.163.72.116])
 by support.bugseng.com (Postfix) with ESMTPSA id 351C54EE0C89;
 Wed, 19 Jul 2023 15:27:58 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 146ff032-2638-11ee-b23a-6b7b168915f2
Message-ID: <af6157e5-fc71-1df7-cab7-fefa78425d3e@bugseng.com>
Date: Wed, 19 Jul 2023 15:27:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
Subject: Re: [RFC PATCH 3/4] xen/arm: initialize conditionally uninitialized
 local variables
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <c7d2cd46f06f75f8a1810168c508f05d242f831c.1689329728.git.nicola.vetrini@bugseng.com>
 <9ab4ae66-aa72-2426-08e5-cbe44030d7f2@xen.org>
Content-Language: en-US
In-Reply-To: <9ab4ae66-aa72-2426-08e5-cbe44030d7f2@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Sorry for the late reply.

On 14/07/23 15:21, Julien Grall wrote:
> Hi,
> 
> On 14/07/2023 12:49, Nicola Vetrini wrote:
>> This patch aims to fix some occurrences of possibly uninitialized
>> variables, that may be read before being written. This behaviour would
>> violate MISRA C:2012 Rule 9.1, besides being generally undesirable.
>>
>> In all the analyzed cases, such accesses were actually safe, but it's
>> quite difficult to prove so by automatic checking, therefore a safer
>> route is to change the code so as to avoid the behaviour from occurring,
>> while preserving the semantics.
>>
>> An initialization to a safe value is provided to reach this aim.
>>
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>> ---
>> Additional input on which values may be 'safe' in each context is
>> surely welcome, to avoid possibly compromising the correctness of
>> the function semantics.
>> ---
>> Â  xen/arch/arm/cpuerrata.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  6 +++---
>> Â  xen/arch/arm/domctl.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  8 ++++----
>> Â  xen/arch/arm/gic-v3-lpi.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  | 17 +++++++++--------
>> Â  xen/arch/arm/include/asm/p2m.hÂ Â Â Â Â Â Â Â Â Â Â Â Â  | 10 ++++++----
>> Â  xen/arch/arm/platforms/xilinx-zynqmp-eemi.c | 10 ++--------
>> Â  xen/arch/arm/psci.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  | 10 +++++-----
>> Â  xen/drivers/char/pl011.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  2 +-
>> Â  7 files changed, 30 insertions(+), 33 deletions(-)
>>
>> diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
>> index d0658aedb6..14694c6081 100644
>> --- a/xen/arch/arm/cpuerrata.c
>> +++ b/xen/arch/arm/cpuerrata.c
>> @@ -159,7 +159,7 @@ extern char __mitigate_spectre_bhb_loop_start_32[],
>> Â  static int enable_smccc_arch_workaround_1(void *data)
>> Â  {
>> -Â Â Â  struct arm_smccc_res res;
>> +Â Â Â  struct arm_smccc_res res = {0};
> 
> I understand you desire to make happy. But I am not sure that 
> initializing to 0 is the right thing. If the SMCC were not properly 
> setting the register, then we most likely don't want to install the 
> workaround. Instead, we most likely want to warn.
> 
> So you want (int)res.a0 to be negative. We don't care about the other 
> fields.
> 

In principle I'm ok with this, but see below.

>> Â Â Â Â Â  const struct arm_cpu_capabilities *entry = data;
>> Â Â Â Â Â  /*
>> @@ -252,7 +252,7 @@ static int enable_spectre_bhb_workaround(void *data)
>> Â Â Â Â Â  if ( cpus_have_cap(ARM_WORKAROUND_BHB_SMCC_3) )
>> Â Â Â Â Â  {
>> -Â Â Â Â Â Â Â  struct arm_smccc_res res;
>> +Â Â Â Â Â Â Â  struct arm_smccc_res res = {0};
> 
> Same remark here.
> 
>> Â Â Â Â Â Â Â Â Â  if ( smccc_ver < SMCCC_VERSION(1, 1) )
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  goto warn;
>> @@ -393,7 +393,7 @@ DEFINE_PER_CPU_READ_MOSTLY(register_t, 
>> ssbd_callback_required);
>> Â  static bool has_ssbd_mitigation(const struct arm_cpu_capabilities 
>> *entry)
>> Â  {
>> -Â Â Â  struct arm_smccc_res res;
>> +Â Â Â  struct arm_smccc_res res = {0};
> 
> Here you would want (int)res.a0 to be equal to ARM_SMCCC_NOT_SUPPORTED.

I see that ARM_SMCCC_NOT_SUPPORTED is
#define ARM_SMCCC_NOT_SUPPORTED         (-1)

thus an assignment to res.a0 would violate Rule 10.3:
"The value of an expression shall not be assigned to an object with a 
narrower essential type or of a different essential type category."
(signed vs unsigned, and the exception does not apply here).

This rule is not yet under discussion, but I would like to avoid 
knowingly introducing more violations if there's an alternative.

Do the fields of struct arm_smccc_res really need to be unsigned? If 
that's not the case, then I'm happy with the proposed changes.

> 
>> Â Â Â Â Â  bool required;
>> Â Â Â Â Â  if ( smccc_ver < SMCCC_VERSION(1, 1) )
>> diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c
>> index ad56efb0f5..b38fed72be 100644
>> --- a/xen/arch/arm/domctl.c
>> +++ b/xen/arch/arm/domctl.c
>> @@ -29,10 +29,10 @@ static int handle_vuart_init(struct domain *d,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct xen_domctl_vuart_op *vuart_op)
>> Â  {
>> Â Â Â Â Â  int rc;
>> -Â Â Â  struct vpl011_init_info info;
>> -
>> -Â Â Â  info.console_domid = vuart_op->console_domid;
>> -Â Â Â  info.gfn = _gfn(vuart_op->gfn);
>> +Â Â Â  struct vpl011_init_info info = {
>> +Â Â Â Â Â Â Â  .console_domid = vuart_op->console_domid,
>> +Â Â Â Â Â Â Â  .gfn = _gfn(vuart_op->gfn)
>> +Â Â Â  };
> 
> I am not against, this change. But I don't quite understand how this 
> makes Eclair much happier?

It also zero-initializes the third field:

struct vpl011_init_info {
     domid_t console_domid;
     gfn_t gfn;
     evtchn_port_t evtchn;
};


> 
> Also, if this is the desired way, then I think this should be written 
> down in the CODING_STYLE.

This is just a matter of style, I can also set the other field 
explicitly, if you prefer. Either way, it might be a good idea to settle 
this in the CODING_STYLE in a different patch.

> 
>> Â Â Â Â Â  if ( d->creation_finished )
>> Â Â Â Â Â Â Â Â Â  return -EPERM;
>> diff --git a/xen/arch/arm/gic-v3-lpi.c b/xen/arch/arm/gic-v3-lpi.c
>> index eb0a5535e4..12f2af2e4d 100644
>> --- a/xen/arch/arm/gic-v3-lpi.c
>> +++ b/xen/arch/arm/gic-v3-lpi.c
>> @@ -210,7 +210,10 @@ out:
>> Â  void gicv3_lpi_update_host_entry(uint32_t host_lpi, int domain_id,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  uint32_t virt_lpi)
>> Â  {
>> -Â Â Â  union host_lpi *hlpip, hlpi;
>> +Â Â Â  union host_lpi *hlpip, hlpi = {
>> +Â Â Â Â Â Â Â  .virt_lpi = virt_lpi,
>> +Â Â Â Â Â Â Â  .dom_id = domain_id
>> +Â Â Â  };
>> Â Â Â Â Â  ASSERT(host_lpi >= LPI_OFFSET);
>> @@ -218,9 +221,6 @@ void gicv3_lpi_update_host_entry(uint32_t 
>> host_lpi, int domain_id,
>> Â Â Â Â Â  hlpip = &lpi_data.host_lpis[host_lpi / 
>> HOST_LPIS_PER_PAGE][host_lpi % HOST_LPIS_PER_PAGE];
>> -Â Â Â  hlpi.virt_lpi = virt_lpi;
>> -Â Â Â  hlpi.dom_id = domain_id;
>> -
>> Â Â Â Â Â  write_u64_atomic(&hlpip->data, hlpi.data);
>> Â  }
>> @@ -542,14 +542,15 @@ int gicv3_allocate_host_lpi_block(struct domain 
>> *d, uint32_t *first_lpi)
>> Â Â Â Â Â  for ( i = 0; i < LPI_BLOCK; i++ )
>> Â Â Â Â Â  {
>> -Â Â Â Â Â Â Â  union host_lpi hlpi;
>> -
>> Â Â Â Â Â Â Â Â Â  /*
>> Â Â Â Â Â Â Â Â Â Â  * Mark this host LPI as belonging to the domain, but don't 
>> assign
>> Â Â Â Â Â Â Â Â Â Â  * any virtual LPI or a VCPU yet.
>> Â Â Â Â Â Â Â Â Â Â  */
>> -Â Â Â Â Â Â Â  hlpi.virt_lpi = INVALID_LPI;
>> -Â Â Â Â Â Â Â  hlpi.dom_id = d->domain_id;
>> +Â Â Â Â Â Â Â  union host_lpi hlpi = {
>> +Â Â Â Â Â Â Â Â Â Â Â  .virt_lpi = INVALID_LPI,
>> +Â Â Â Â Â Â Â Â Â Â Â  .dom_id = d->domain_id
>> +Â Â Â Â Â Â Â  };
>> +
>> Â Â Â Â Â Â Â Â Â  write_u64_atomic(&lpi_data.host_lpis[chunk][lpi_idx + i].data,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  hlpi.data);
>> diff --git a/xen/arch/arm/include/asm/p2m.h 
>> b/xen/arch/arm/include/asm/p2m.h
>> index 940495d42b..413e2a7add 100644
>> --- a/xen/arch/arm/include/asm/p2m.h
>> +++ b/xen/arch/arm/include/asm/p2m.h
>> @@ -345,7 +345,7 @@ static inline struct page_info *get_page_from_gfn(
>> Â Â Â Â Â  struct domain *d, unsigned long gfn, p2m_type_t *t, p2m_query_t q)
>> Â  {
>> Â Â Â Â Â  mfn_t mfn;
>> -Â Â Â  p2m_type_t _t;
>> +Â Â Â  p2m_type_t _t = p2m_invalid;
>> Â Â Â Â Â  struct page_info *page;
>> Â Â Â Â Â  /*
>> @@ -355,10 +355,12 @@ static inline struct page_info *get_page_from_gfn(
>> Â Â Â Â Â  if ( likely(d != dom_xen) )
>> Â Â Â Â Â Â Â Â Â  return p2m_get_page_from_gfn(d, _gfn(gfn), t);
>> -Â Â Â  if ( !t )
>> +Â Â Â  /* Allow t to be NULL */
>> +Â Â Â  if ( t )
>> +Â Â Â Â Â Â Â  *t = _t;
>> +Â Â Â  else {
>> Â Â Â Â Â Â Â Â Â  t = &_t;
>> -
>> -Â Â Â  *t = p2m_invalid;
>> +Â Â Â  }
> 
> I understand the exist construct is not liked by Eclair. But your new 
> construct is not easily readable by a human. Before I can propose a 
> different approach, can you clarify why Eclair is unhappy this the 
> existing code?
> 

This has been addressed in the reply to patch 1/4.

>> Â Â Â Â Â  /*
>> Â Â Â Â Â Â  * DOMID_XEN sees 1-1 RAM. The p2m_type is based on the type of the
>> diff --git a/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c 
>> b/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
>> index 2053ed7ac5..39d9ab4fa9 100644
>> --- a/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
>> +++ b/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
>> @@ -51,11 +51,11 @@ static inline bool domain_has_reset_access(struct 
>> domain *d, uint32_t rst)
>> Â  bool zynqmp_eemi(struct cpu_user_regs *regs)
>> Â  {
>> -Â Â Â  struct arm_smccc_res res;
>> +Â Â Â  struct arm_smccc_res res = {0};
>> Â Â Â Â Â  uint32_t fid = get_user_reg(regs, 0);
>> Â Â Â Â Â  uint32_t nodeid = get_user_reg(regs, 1);
>> Â Â Â Â Â  unsigned int pm_fn = fid & 0xFFFF;
>> -Â Â Â  enum pm_ret_status ret;
>> +Â Â Â  enum pm_ret_status ret = XST_PM_NO_ACCESS;
> 
> It is not clear to me why Eclair is unhappy here?

Gotos, as explained in the reply to patch 1/4. Since 'ret' here already 
sets a value in every branch, I am in favour of initializing it before 
the switch with that value. The zero-ed 'arm_smccc_res' is ok here?

> 
>> Â Â Â Â Â  switch ( fid )
>> Â Â Â Â Â  {
>> @@ -89,7 +89,6 @@ bool zynqmp_eemi(struct cpu_user_regs *regs)
>> Â Â Â Â Â Â Â Â Â  {
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  gprintk(XENLOG_WARNING,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  "zynqmp-pm: fn=%u No access to node %u\n", 
>> pm_fn, nodeid);
>> -Â Â Â Â Â Â Â Â Â Â Â  ret = XST_PM_NO_ACCESS;
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  goto done;
> 
> I find the new approach less obvious. How about introduce a macro that 
> will set the result and the use replace the two lines with:
> 
> set_result(regs, XST_PM_NO_ACCESS);
> return 0;
> 
> where set_result(regs, ret) is
> 
> set_user_reg(regs, 0, ret)
> 
>> diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
>> index 695d2fa1f1..47e46af608 100644
>> --- a/xen/arch/arm/psci.c
>> +++ b/xen/arch/arm/psci.c
>> @@ -38,7 +38,7 @@ static uint32_t psci_cpu_on_nr;
>> Â  int call_psci_cpu_on(int cpu)
>> Â  {
>> -Â Â Â  struct arm_smccc_res res;
>> +Â Â Â  struct arm_smccc_res res = {0};
> 
> I don't this we should initialize a0 to 0 as this would indicate a 
> success. Instead, we want an invalid value.

Same remark as stated above about the invalid value being negative.

> 
>> Â Â Â Â Â  arm_smccc_smc(psci_cpu_on_nr, cpu_logical_map(cpu), 
>> __pa(init_secondary),
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  &res);
>> @@ -50,7 +50,7 @@ void call_psci_cpu_off(void)
>> Â  {
>> Â Â Â Â Â  if ( psci_ver > PSCI_VERSION(0, 1) )
>> Â Â Â Â Â  {
>> -Â Â Â Â Â Â Â  struct arm_smccc_res res;
>> +Â Â Â Â Â Â Â  struct arm_smccc_res res = {0};
> 
> Same here.
> 
>> Â Â Â Â Â Â Â Â Â  /* If successfull the PSCI cpu_off call doesn't return */
>> Â Â Â Â Â Â Â Â Â  arm_smccc_smc(PSCI_0_2_FN32_CPU_OFF, &res);
>> @@ -73,7 +73,7 @@ void call_psci_system_reset(void)
>> Â  static int __init psci_features(uint32_t psci_func_id)
>> Â  {
>> -Â Â Â  struct arm_smccc_res res;
>> +Â Â Â  struct arm_smccc_res res = {0};
> 
> Same here.
> 
>> Â Â Â Â Â  if ( psci_ver < PSCI_VERSION(1, 0) )
>> Â Â Â Â Â Â Â Â Â  return PSCI_NOT_SUPPORTED;
>> @@ -115,7 +115,7 @@ static void __init psci_init_smccc(void)
>> Â Â Â Â Â  if ( psci_features(ARM_SMCCC_VERSION_FID) != PSCI_NOT_SUPPORTED )
>> Â Â Â Â Â  {
>> -Â Â Â Â Â Â Â  struct arm_smccc_res res;
>> +Â Â Â Â Â Â Â  struct arm_smccc_res res = {0};
> 
> Same here.
> 
>> Â Â Â Â Â Â Â Â Â  arm_smccc_smc(ARM_SMCCC_VERSION_FID, &res);
>> Â Â Â Â Â Â Â Â Â  if ( PSCI_RET(res) != ARM_SMCCC_NOT_SUPPORTED )
>> @@ -168,7 +168,7 @@ static int __init psci_init_0_2(void)
>> Â Â Â Â Â Â Â Â Â  { /* sentinel */ },
>> Â Â Â Â Â  };
>> Â Â Â Â Â  int ret;
>> -Â Â Â  struct arm_smccc_res res;
>> +Â Â Â  struct arm_smccc_res res = {0};
> 
> Same here.
> 
>> Â Â Â Â Â  if ( acpi_disabled )
>> Â Â Â Â Â  {
>> diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
>> index f7bf3ad117..34ce90be52 100644
>> --- a/xen/drivers/char/pl011.c
>> +++ b/xen/drivers/char/pl011.c
>> @@ -285,7 +285,7 @@ static int __init pl011_dt_uart_init(struct 
>> dt_device_node *dev,
>> Â Â Â Â Â  const char *config = data;
>> Â Â Â Â Â  int res;
>> Â Â Â Â Â  paddr_t addr, size;
>> -Â Â Â  uint32_t io_width;
>> +Â Â Â  uint32_t io_width = 0;
> 
> We have many use of dt_property_read_*() within the code base. I would 
> like us te decide of a policy first.
> 

Well, the best outcome for me is if all these functions (i.e., 
dt_property_*, dt_get_property_*) always write the parameter they are 
supposed to set. I understand if this is not always feasible, but the 
alternative is not clean (e.g., deviate or refactor in such a way that 
the code is less readable).

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 13:32:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 13:32:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565863.884437 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM7Hp-0006gH-Ke; Wed, 19 Jul 2023 13:32:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565863.884437; Wed, 19 Jul 2023 13:32:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM7Hp-0006gA-Ht; Wed, 19 Jul 2023 13:32:13 +0000
Received: by outflank-mailman (input) for mailman id 565863;
 Wed, 19 Jul 2023 13:32:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM7Ho-0006g4-OD
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 13:32:12 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20612.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::612])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id aa229af0-2638-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 15:32:11 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU0PR04MB9493.eurprd04.prod.outlook.com (2603:10a6:10:350::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Wed, 19 Jul
 2023 13:32:09 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 13:32:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aa229af0-2638-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ZZM0a+Kit/PrUSv4WAcX2bQVQiee2bQiHCBNa2TkpA/xjuAj1JVmjkYfRJ76vgMKFqZ6fLo1kDYELKRWQKrs1FJcMKhMzoENaDMMGWAvzL+/fETbyPZqj3b3TprTXkCADWIIKRdtbOFZtOUxYmM6ir5r3T/xOK+50k/0JJEY6qUIAyN86jiakPcTQfKS5cJLzhrh1wnnJSro5LTd6eJpi/WOD36hTr0B0VnyiRjRKxKEHNhoOl9Ej5xZv6GGpM2zg6q2/kYb+jc8CqhfBFCi0cLEbfmNpnxM7wFofMd/mJ8+JI3El45HRr/2DMMYlE33RK9c/3F/ronsK7N1znWh0Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5f1k70+30YSCqH+dphjBlx5tcaWKc7vKrEBYeb02Sw4=;
 b=HKZevOTT4G9DfXE8+/B2Xt0xQzFsImMyYMnFsSa7b6MeCchMUZUuD187RwtqoVH0v1EV0+YURKmmep+jNr4goHmb2O6YRksBvhXeuC4tu/oKYbAnkMpXEDYe2BcTTDDOJUYIe4i7i4ebOruT5CN9RH9IFPosGSeY6Ra9jJQB0imOtwukF7Z8yyd1VEiGgM5bh7VLmwS3sNgc9mGCQqY893pKFMtGrWkvuPFyutoGPA6M+/ImoP5mLQR0+FmmhnqQIbDsAdjsCKLNogUy/AF+aIvX1BzhUTwfBFQJXTudo25jUXXyLc1RJhfga2ft2VaarSoUdcYbQ+aewnKqa1kPbw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5f1k70+30YSCqH+dphjBlx5tcaWKc7vKrEBYeb02Sw4=;
 b=hnktsmNtjbfdxGVu+y1KPos4RYz5jPA6ca191XVkS3hYtXO3XSC0LdXzQ9MA1WlrPF2S538aqciHz0NKOEW4wAsYgblGNou2ZoVahxrBTuJVBFEwSiHk4A0DsQLXXMiE9w+8k7I6nF0wcowVjUOzjrU2d+rzGfZuhOvRsZYPFd8E1C6nuWlis44J8+g+xrwF3BAIfUeS/h5xPgV85FpaOC3MoyOsacNgKDwIlHDrk864dv2fVnO1w69mBqQKK6Qg+vtNh3upQ4Kh1GZpAXzFNV8PEsS89O3UKr0tfYzxz117Fk7EIoXKX63nb6DkV1yvSKrv26FLHQrHVaXi3gfMwA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <58ee9410-e758-1503-e3f1-d25989fedc1e@suse.com>
Date: Wed, 19 Jul 2023 15:32:06 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] x86/hpet: Disable legacy replacement mode after IRQ
 test if not needed
Content-Language: en-US
To: Simon Gaiser <simon@invisiblethingslab.com>
Cc: xen-devel@lists.xenproject.org, Andrew Cooper
 <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>
References: <20230718122603.2002-1-simon@invisiblethingslab.com>
 <ZLaLLe2HFDN5oWUq@MacBook-Air-de-Roger.local>
 <ac77ecba-6804-1d16-60dc-f184e5d31dcb@invisiblethingslab.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ac77ecba-6804-1d16-60dc-f184e5d31dcb@invisiblethingslab.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0063.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:49::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU0PR04MB9493:EE_
X-MS-Office365-Filtering-Correlation-Id: 0a9966a1-f588-4f17-fa82-08db885c8cfd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	m+3hJRLf7e5wXWtMYJLYAUIQ9IYrdT0Le3N265fnVVNhkHl0/9PZ7H3YRTDHSq8AaGPPRputOwDx9RVPtBGD1GhkQtzVPA0/RojdWZOnObJEz55Ma0hOGjteXm2V3JF3RB9KUPoS+p1MRdnVNw7H7AwcDQVksRODMvilSKqlIhIW1lP8tuBH4qgYqipqOFLjn+QvCwN4YCX50pdzN5cuJEP0t1ZF7Rvpw3fw1gr4pbq1EbFpOapmWXaJ6E/uDHXyc2wZqCte++7WwQIV1BRWodwBKfX79GP+9s9uQN6npUkI8vwE410A1BbW0rX1G78f42WCP8sJGeWJDALplGztopT5Blv9RrloHrmz7sujcWHsxR4WxqlzCv4iHsd7ocTZjAbu5bFqOa0bKRpwRg5WdKG+YBlsKLAcr6E2B9uYZhgYFburFuVNubxAU4tyGJXRzKPbdVflvFmR15r+xVZtd7dHDxOC575bX8hfoE9rdLISr5yPZs3jyfOQmhH1DsEuE6ikSTZbUdXCghsbEF8zPLm6f8sp8Bq2g7Xb4DFC2nrAWQvWAZYvy5buwhsfdo3IQ3LNRqok4Z1NtLBPr/xwlyDdcTBdf4uwTQ5O2NZBqMLovRSlHp/UiP+qJNjJpjIjNCgMCmboEjjSaLlk5MICJw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(346002)(396003)(39860400002)(136003)(451199021)(2906002)(86362001)(31696002)(26005)(6506007)(186003)(53546011)(83380400001)(2616005)(38100700002)(36756003)(478600001)(6512007)(6666004)(6486002)(54906003)(316002)(41300700001)(66556008)(66476007)(4326008)(6916009)(8936002)(31686004)(8676002)(5660300002)(66946007)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?U3Z6RFdGT3A3bGJrNXAzMWdaR05XNzVOZjgxM3Q1Nitid3JNZXIyWUE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29zeFJkVjRN?=
 =?utf-8?B?cUY2ZnFUSnFOVjNFeE1TYkxhWGhuN3NVamNEUVpYcjRYbWdHK01YQ0s0T3lp?=
 =?utf-8?B?bjJYSDRkNENZVU8vUUtQMFlnM0o0dC9iUmNpdUlxT3d0VUxGUFNremcwRlFI?=
 =?utf-8?B?REZxdFNVQ1lQaVB6bUtHSzZPcnhLRnFsaFBFZmUvRWdTSHgrZmJTVTRFVk5D?=
 =?utf-8?B?RStDWWIxTm4xMHBmN1lCYUZzSzkrTnFwZ3dZTkUvZFkvYlVSbWFweVlORDZn?=
 =?utf-8?B?S1JPd1JLNXZiZDZtOG9mUTd4UDFZM0ptYXFKMWNCcjgwN1llYm5EYnhJbjNl?=
 =?utf-8?Q?5z20X8FteFQfRgN1CWSocsx3G?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0a9966a1-f588-4f17-fa82-08db885c8cfd
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 13:32:08.9425
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: NkcHYxNHW9F0j5arsYjznpRkr6zCu5ZyQ2OZlWci/qM8QzXq6Zsi6seR744XnpC2yYbdSslxFCYh7dpqhWw2rw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9493

On 18.07.2023 23:51, Simon Gaiser wrote:
> Roger Pau MonnÃ©:
>> On Tue, Jul 18, 2023 at 02:26:03PM +0200, Simon Gaiser wrote:
>>> As far as I understand the HPET legacy mode is not required on systems
>>> with ARAT after the timer IRQ test.
>>
>> What's the relation with ARAT here?
>>
>> It would seem to me that keeping legacy replacement enabled should
>> only be done when opt_hpet_legacy_replacement > 0, and the currently
>> modified block is already in a opt_hpet_legacy_replacement < 0 gated
>> chunk.
> 
> I was concerned that on systems without ARAT cpuidle might rely on HPET
> legacy mode being available. See _disable_pit_irq and lapic_timer_init.
> But now that I stared at this again, I think that condition isn't
> actually needed. If we reach that code we know that we have no working
> PIT, but HPET is working. So _disable_pit_irq which is run after
> check_timer (__start_xen first calls check_timer via smp_prepare_cpus
> and only later disable_pit_irq via do_initcalls) will setup HPET
> broadcast, which should succeed since HPET worked previously.
> 
> So I guess we can just drop the condition (please double check, that
> code is quite tangled and I'm not familiar with it).

What you want to respect instead though is opt_hpet_legacy_replacement.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 13:38:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 13:38:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565870.884446 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM7Na-0007Y1-8H; Wed, 19 Jul 2023 13:38:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565870.884446; Wed, 19 Jul 2023 13:38:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM7Na-0007Xu-5i; Wed, 19 Jul 2023 13:38:10 +0000
Received: by outflank-mailman (input) for mailman id 565870;
 Wed, 19 Jul 2023 13:38:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dh/8=DF=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qM7NZ-0007Xo-4v
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 13:38:09 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7ee32a38-2639-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 15:38:08 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.163.72.116])
 by support.bugseng.com (Postfix) with ESMTPSA id CEBDD4EE0C89;
 Wed, 19 Jul 2023 15:38:05 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7ee32a38-2639-11ee-b23a-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>
Subject: [XEN PATCH] xen: address MISRA C:2012 Rule 4.1
Date: Wed, 19 Jul 2023 15:37:57 +0200
Message-Id: <378f18c287cfb65d25b42209c85645a2a10ff9b2.1689763253.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

MISRA C:2012 Rule 4.1 has the following headline:
"Octal and hexadecimal escape sequences shall be terminated."

The string literals modified by this patch contain octal or
hexadecimal escape sequences that are neither terminated by the
end of the literal, nor by the beginning of another escape sequence.

Therefore, such unterminated sequences have been split into a
separate literal as a way to comply with the rule and preserve the
semantics of the code.

No functional changes.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
The choice whether to put a blank between the literals is up to
the maintainers' preference, I chose to do so to improve legibility.
---
 xen/arch/x86/hvm/hvm.c  | 2 +-
 xen/common/decompress.c | 4 ++--
 xen/common/xz/stream.h  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 57363c2ae1..24ccf60d77 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3853,7 +3853,7 @@ void hvm_ud_intercept(struct cpu_user_regs *regs)
                                         cs, &addr) &&
              (hvm_copy_from_guest_linear(sig, addr, sizeof(sig),
                                          walk, NULL) == HVMTRANS_okay) &&
-             (memcmp(sig, "\xf\xbxen", sizeof(sig)) == 0) )
+             (memcmp(sig, "\xf\xb" "xen", sizeof(sig)) == 0) )
         {
             regs->rip += sizeof(sig);
             regs->eflags &= ~X86_EFLAGS_RF;
diff --git a/xen/common/decompress.c b/xen/common/decompress.c
index 989336983f..2c2c2ad877 100644
--- a/xen/common/decompress.c
+++ b/xen/common/decompress.c
@@ -19,13 +19,13 @@ int __init decompress(void *inbuf, unsigned int len, void *outbuf)
     if ( len >= 3 && !memcmp(inbuf, "\x42\x5a\x68", 3) )
         return bunzip2(inbuf, len, NULL, NULL, outbuf, NULL, error);
 
-    if ( len >= 6 && !memcmp(inbuf, "\3757zXZ", 6) )
+    if ( len >= 6 && !memcmp(inbuf, "\375" "7zXZ", 6) )
         return unxz(inbuf, len, NULL, NULL, outbuf, NULL, error);
 
     if ( len >= 2 && !memcmp(inbuf, "\135\000", 2) )
         return unlzma(inbuf, len, NULL, NULL, outbuf, NULL, error);
 
-    if ( len >= 5 && !memcmp(inbuf, "\x89LZO", 5) )
+    if ( len >= 5 && !memcmp(inbuf, "\x89" "LZO", 5) )
         return unlzo(inbuf, len, NULL, NULL, outbuf, NULL, error);
 
     if ( len >= 2 && !memcmp(inbuf, "\x02\x21", 2) )
diff --git a/xen/common/xz/stream.h b/xen/common/xz/stream.h
index d36d0fec64..8d9fbbe1b5 100644
--- a/xen/common/xz/stream.h
+++ b/xen/common/xz/stream.h
@@ -18,7 +18,7 @@
 
 #define STREAM_HEADER_SIZE 12
 
-#define HEADER_MAGIC "\3757zXZ"
+#define HEADER_MAGIC "\375" "7zXZ"
 #define HEADER_MAGIC_SIZE 6
 
 #define FOOTER_MAGIC "YZ"
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 13:44:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 13:44:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565877.884457 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM7TS-0000aL-TM; Wed, 19 Jul 2023 13:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565877.884457; Wed, 19 Jul 2023 13:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM7TS-0000aE-Qg; Wed, 19 Jul 2023 13:44:14 +0000
Received: by outflank-mailman (input) for mailman id 565877;
 Wed, 19 Jul 2023 13:44:13 +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 <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM7TR-0000a8-DC
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 13:44:13 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0612.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::612])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 571a9bea-263a-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 15:44:11 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB7634.eurprd04.prod.outlook.com (2603:10a6:20b:2d5::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Wed, 19 Jul
 2023 13:44:09 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 13:44:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 571a9bea-263a-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=UV46Rh/Efi4X0ylb0LX/3a+jfPjneS4mxhUdarPx0Wd0Cr5KLvnV3FIvGEs4K7SShtH+zxpCmAIF4NqApg9EBSuuvDnrmsSxhHLgUFAepj4y8GKio2hQYx1RPXRn4pAQyTYoxD7PJhsqjgcu5ikiGNUoEkVwLkm7u5YDXO5SVLK5hRfwp3krTxevbHVdqOygWY/OboiSOuOH3776KYMFAA+06+vdZBGnj8FpaIQUPZr6KpSud+2kwxiuAAZZbvZl2B2F17ritdtixDz6hnM1G1cTJiF5DRk+sdxriwmlqLRuAy8Z/ohKA8bI0OO0R0zX4G21uyy0YyCoQLQgDbqNSQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=CDH2XijaVJK3u8I3j4/hzsc3lwCobWMlEVsdpwYOlVw=;
 b=eN9laLIUJk+oaq+UPs0WjFStNp1Vu3wZexCjvT7Upj/IH1Qmy+HO8/4jknRdiLrtmtapgOA4l10rdpawW5BQGFmJx6gMXCzrgb4ny2QEErY5VBG+C87o5GCHYtIyELglR6I3nAlvh/VxkO4RlxfbpievBf2F3g6iIrpiRMjdhbcWN3tK5h0ZbDdCS2QJpwLquNVZXOpGJSpWy9p2AbSVBIFnwUUU7VR/dU4gExYAH1bZR2PP1JTBPvUXRdxy80UCzVcDbHErH+YK8pF62WH5CkfLsRzzPivJbIBe2rQpcvA9Med1O6h+HB+cNFvrLfian5hWUy8dxlKjyE2sCpuu0g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=CDH2XijaVJK3u8I3j4/hzsc3lwCobWMlEVsdpwYOlVw=;
 b=WNG7SRHqvxpdMOgQ9GJgWF8gwg0L3ALHDlxTF+SiAsVRoUEZnLdxujjwq8nt/ySobRkkvuR8/KMCvPA4bYil0878EXRbnBB7Wv2F6vbok7UIb8SkLHetBM8V/TtnEb5UWi3L3KySQ0r4u1t4JAFYjCTleUflkvscvCd4lzqF+/VxDIDYY1ofY01gw4NEC5ooTm9f2NaSdkFPi9E7tgncxmjZwSayUdsWwg4G0b3+L4GAt2F6lH8eNf5utt3sEumIIhfUyPVuhXO/4vvjgAd4X04UPzfhQozIQumnqBJBElLV3Nl1OaOfHSkl3J4+3GiIDjBhG8B13IBASx4JM1jUXQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <122a124a-2392-e681-d0e3-1b4dd210f5c9@suse.com>
Date: Wed, 19 Jul 2023 15:44:06 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v4 2/4] xen/ppc: Set up a basic C environment
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1689710519.git.sanastasio@raptorengineering.com>
 <6d2a906f3321f4f846ccede25a600a4b85183a38.1689710519.git.sanastasio@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <6d2a906f3321f4f846ccede25a600a4b85183a38.1689710519.git.sanastasio@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0102.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a1::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB7634:EE_
X-MS-Office365-Filtering-Correlation-Id: 12beda63-9e39-4103-a4a5-08db885e3a64
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	gGY2Yg9PZ8HEfibokLCZ67No6RvbTiK37AZogs0LRVTM09MhLGll1Ygr1FH0Yhmo9U31gJucUxY5FNJeY0eSxBlPjlq1W85d9ru7k2nR1mmlpDlgyqUEtWVamE9/liPpJG4oEJJxVdP7yyTSOTOjAnKP31ogJZpsTt8WhG20BLgjYhlsFISMA9aHSrHQcSY9l7hMFFgohoKVPaEvlBlVN3q0Zycyh6hjeGORtTpSF6cBhxqcqTPi9moANtxfcXlFqMucJ294bQXwWaRv+X5WmDMLCZubCSGBtBSkojr1F0sM/cKrUq7oC2EqP2us0/wGlGZ7mOMUecQgZ5sbM20rctu7ic0BoxHVxjSK7B5Qdy0nzW4cHxbY8Prkzil3pECubP5E5kZG26broA7XHcmI5FjgPcmGQ5H15ITRZHDGBVXHiaZlGJ5IYRcGtYX/jLkg18/lPBS9ToXEWV9+QcklMX+PC4gq+2t7pFIwcl78AymH11e97ZCUim/YhAKxS28v0S9vzsARYiqegITu/42S0S5ISz9E+MXQl3cDJLiAANUE4EsP2ikxIVpxO/QZdXmysSK+YYiooN+F0J6gOjxGf0ZoF5NjUU/T5gwpaatj+h9DhwoEBQSW9+MntWknCnJd9PFOvubLKKT8tb2QRKv/lA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(39860400002)(136003)(346002)(366004)(376002)(451199021)(86362001)(478600001)(83380400001)(38100700002)(186003)(41300700001)(26005)(31696002)(31686004)(54906003)(316002)(53546011)(8676002)(8936002)(6916009)(2906002)(4326008)(6512007)(66556008)(66946007)(6486002)(66476007)(6666004)(6506007)(2616005)(36756003)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QXZIc1VramFFQlgxd2gxbjZQVytNdnZnUVdOYnlLR01BL2VUSHpoMk4wam5w?=
 =?utf-8?B?M2hjYVl4aUFTb3I5QWhXOVRwVGlXYmlvTzJPYnJJSGo5VVVyOStOSVBtOXlM?=
 =?utf-8?B?SzJZQnFMalMzNEp5ekJVMEp3WWdFalpyUlRZTVBWY1NiVTNyMFJrc2J3REN1?=
 =?utf-8?B?VXpXbE92RFMySTRTdlltZi9PKzB2RTg5NlNKaHlkcXkySzFMcUpCeDBwWGVC?=
 =?utf-8?B?bVBYQmZMWGx0WXBGZVpONGdFQk1CVm1pbm5aR01WZ05TelJvR1Q4ZkhEcHU0?=
 =?utf-8?B?endKaVpvS09EcWJnWk0zeWVheXJ4OXVDU2I2elZIT1FXazRKdlJFRDdsSHAx?=
 =?utf-8?B?MEtFcVljTlhqcXZvQ3BlRWRNVGtSVGl2Si9leEJHbXp1TkVIRWIxeTA4eVRu?=
 =?utf-8?B?dXRxb3puc0hEcTJyeEZuaE9yZlZHREJLbzN3ejhrdDhPc2lvRDhwdEVCYUtB?=
 =?utf-8?B?RWZpWnNKRGwyYU9naVZhd1Y5NGQ3RVIvV1lRaXNBai9MeWM4M0x5YnYyVUI2?=
 =?utf-8?B?UmRJRWdveVJ4c1J1QmRGcW4wNXVNWVRlcEJkZ3Z2NFBlMStSemZjSFU1ZkhD?=
 =?utf-8?B?c1cvUnQ5QUpkVEpBR20yOFBJWnJTRmVVSm9KempNSUVwYWJ3NkpFN0FJL0JD?=
 =?utf-8?B?VTd1THlqTUlwemZaZ1lMY1BQb3Vl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EeTJJNVhsUHNh?=
 =?utf-8?B?ancxR1lzVXZxTC9yMjlxQjl1ZUtUVXRNengxRUgvNmpMNVl5S2NxNk5IZENx?=
 =?utf-8?B?Zm1Ybk1qNWZTMFVDQzBHRjN3OFlXNlRiSHlnWGthU1hra1F2ajEwSUZRZ0ls?=
 =?utf-8?B?OXpHSmNUbGVYMnVuS25EVU4wSWJEdjJPRVZ6bm8xN0FiRXFJTHdUcmVoU1VG?=
 =?utf-8?B?TjZGU09wdEV3Uzl6aCs4dU85OEw0bXZDeGk4b3k4ZzF5TGo3aGtWMk1FN2lj?=
 =?utf-8?B?NFo3UnhUVUpVUU5sYnluelN1MW9ObzUvdktaaU9EUkhwbmlOZ3pkcXFKYjFr?=
 =?utf-8?B?dUQ4YkdpVzkyOFRJMlF5TjhEbDlLWnIwTWdDaVo0TThWWGFIa0tkQzl4Tjdi?=
 =?utf-8?B?aEszdGVoRDZJRkdtRXhBRnNNZGF1aTU1QlpqZHBYeDhxWG1MR2RNU0F0S1NM?=
 =?utf-8?B?SzFYdHRMckRwa1M3L2krV0hyM1RlekhsNnZRY0ZDODh2endTWmhsRXVZK3Vk?=
 =?utf-8?B?bGRMSHQwMzVNd1JITTVCOUh2QW9vK3BjeU13Z3pmM0llSEdaV2tPT0NSYnhu?=
 =?utf-8?Q?9iY9KvIRH0n2ZDtZnRXu0a5ug?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 12beda63-9e39-4103-a4a5-08db885e3a64
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 13:44:09.1966
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: sqf0vQCzQxYVgiTORQ2mk/basHEWwsHSqOzc8yfJnA69GClZl/suRbWCzDy3xspaxz9563lxMD+dWVYySA2RaQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7634

On 18.07.2023 22:20, Shawn Anastasio wrote:
> Update ppc64/head.S to set up an initial boot stack, zero the .bss
> section, and jump to C.
> 
> Also refactor the endian fixup trampoline into its own macro, since it
> will need to be used in multiple places, including every time we make a
> call into firmware (see next commit).

Please avoid statements making relative connections between patches or
commits. You can't know how many commits will end up between both
patches; there's no guarantee any series will be committed all in one
go. (In rare cases, where needed for one reason or another, committers
may be asked to keep things together.)

That said, such statements are much less of a problem if given in the
remarks section, which isn't going to be committed.

> --- a/xen/arch/ppc/include/asm/config.h
> +++ b/xen/arch/ppc/include/asm/config.h
> @@ -43,7 +43,7 @@
>  
>  #define SMP_CACHE_BYTES (1 << 6)
>  
> -#define STACK_ORDER 2
> +#define STACK_ORDER 0

>From the v3 discussion I thought it would follow that the description
gain mention of this change (and the why behind it). Strictly speaking
this could be a separate change (at which point stating the "why"
would hopefully be an obvious part), but I wouldn't want to go as far
as demanding this to be split off.

> --- a/xen/arch/ppc/ppc64/head.S
> +++ b/xen/arch/ppc/ppc64/head.S
> @@ -1,30 +1,28 @@
>  /* SPDX-License-Identifier: GPL-2.0-or-later */
>  
> +#include <asm/asm-defns.h>
> +
>      .section .text.header, "ax", %progbits
>  
>  ENTRY(start)
>      /*
> -     * Depending on how we were booted, the CPU could be running in either
> -     * Little Endian or Big Endian mode. The following trampoline from Linux
> -     * cleverly uses an instruction that encodes to a NOP if the CPU's
> -     * endianness matches the assumption of the assembler (LE, in our case)
> -     * or a branch to code that performs the endian switch in the other case.
> +     * NOTE: argument registers (r3-r9) must be preserved until the C entrypoint
>       */
> -    tdi 0, 0, 0x48    /* Reverse endian of b . + 8          */
> -    b . + 44          /* Skip trampoline if endian is good  */
> -    .long 0xa600607d  /* mfmsr r11                          */
> -    .long 0x01006b69  /* xori r11,r11,1                     */
> -    .long 0x00004039  /* li r10,0                           */
> -    .long 0x6401417d  /* mtmsrd r10,1                       */
> -    .long 0x05009f42  /* bcl 20,31,$+4                      */
> -    .long 0xa602487d  /* mflr r10                           */
> -    .long 0x14004a39  /* addi r10,r10,20                    */
> -    .long 0xa6035a7d  /* mtsrr0 r10                         */
> -    .long 0xa6037b7d  /* mtsrr1 r11                         */
> -    .long 0x2400004c  /* rfid                               */
> -
> -    /* Now that the endianness is confirmed, continue */
> -1:  b 1b
> +    FIXUP_ENDIAN
> +
> +    /* set up the TOC pointer */
> +    LOAD_IMM32(%r2, .TOC.)
> +
> +    /* set up the initial stack */
> +    LOAD_IMM32(%r1, cpu0_boot_stack)

Similarly I had hoped that if not a code comment, a sentence in the
description would appear regarding the (temporary) non-PIC-ness.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 13:52:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 13:52:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565881.884467 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM7bi-0002MJ-O2; Wed, 19 Jul 2023 13:52:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565881.884467; Wed, 19 Jul 2023 13:52:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM7bi-0002MC-Ke; Wed, 19 Jul 2023 13:52:46 +0000
Received: by outflank-mailman (input) for mailman id 565881;
 Wed, 19 Jul 2023 13:52:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8bnZ=DF=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qM7bh-0002M6-0r
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 13:52:45 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 88c1671e-263b-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 15:52:43 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.160.140.35])
 by support.bugseng.com (Postfix) with ESMTPSA id 1D4B64EE0C89;
 Wed, 19 Jul 2023 15:52:42 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 88c1671e-263b-11ee-b23a-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: [XEN PATCH v2] x86/HVM: address violations of MISRA C:2012 Rules 8.2 and 8.3
Date: Wed, 19 Jul 2023 15:52:31 +0200
Message-Id: <589e9c2ef5f13bf0c035b63f7b2e24fbbb878543.1689773180.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Give a name to unnamed parameters thus addressing violations of
MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
named parameters").
Keep consistency between parameter names and types used in function
declarations and the ones used in the corresponding function
definitions, thus addressing violations of MISRA C:2012 Rule 8.3
("All declarations of an object or function shall use the same names
and type qualifiers").

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
Changes in v2:
  - u64 vs uint64_t mismatches are solved in favor of the stdint types.
---
 xen/arch/x86/hvm/domain.c              |  2 +-
 xen/arch/x86/hvm/hvm.c                 |  6 +++---
 xen/arch/x86/hvm/rtc.c                 | 12 ++++++------
 xen/arch/x86/hvm/svm/nestedsvm.c       |  8 ++++----
 xen/arch/x86/hvm/vioapic.c             |  2 +-
 xen/arch/x86/include/asm/hvm/domain.h  |  2 +-
 xen/arch/x86/include/asm/hvm/hvm.h     | 18 +++++++++---------
 xen/arch/x86/include/asm/hvm/irq.h     | 14 +++++++-------
 xen/arch/x86/include/asm/hvm/save.h    |  4 ++--
 xen/arch/x86/include/asm/hvm/support.h |  2 +-
 10 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/xen/arch/x86/hvm/domain.c b/xen/arch/x86/hvm/domain.c
index 7692ee24c2..7f6e362a70 100644
--- a/xen/arch/x86/hvm/domain.c
+++ b/xen/arch/x86/hvm/domain.c
@@ -100,7 +100,7 @@ static int check_segment(struct segment_register *reg, enum x86_segment seg)
 }
 
 /* Called by VCPUOP_initialise for HVM guests. */
-int arch_set_info_hvm_guest(struct vcpu *v, const vcpu_hvm_context_t *ctx)
+int arch_set_info_hvm_guest(struct vcpu *v, const struct vcpu_hvm_context *ctx)
 {
     const struct domain *d = v->domain;
     struct cpu_user_regs *uregs = &v->arch.user_regs;
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 57363c2ae1..28d131a202 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -272,7 +272,7 @@ uint8_t hvm_combine_hw_exceptions(uint8_t vec1, uint8_t vec2)
     return X86_EXC_DF;
 }
 
-void hvm_set_rdtsc_exiting(struct domain *d, bool_t enable)
+void hvm_set_rdtsc_exiting(struct domain *d, bool enable)
 {
     struct vcpu *v;
 
@@ -280,7 +280,7 @@ void hvm_set_rdtsc_exiting(struct domain *d, bool_t enable)
         alternative_vcall(hvm_funcs.set_rdtsc_exiting, v, enable);
 }
 
-void hvm_get_guest_pat(struct vcpu *v, u64 *guest_pat)
+void hvm_get_guest_pat(struct vcpu *v, uint64_t *guest_pat)
 {
     if ( !alternative_call(hvm_funcs.get_guest_pat, v, guest_pat) )
         *guest_pat = v->arch.hvm.pat_cr;
@@ -426,7 +426,7 @@ static void hvm_set_guest_tsc_adjust(struct vcpu *v, u64 tsc_adjust)
         update_vcpu_system_time(v);
 }
 
-u64 hvm_get_guest_tsc_fixed(struct vcpu *v, uint64_t at_tsc)
+uint64_t hvm_get_guest_tsc_fixed(struct vcpu *v, uint64_t at_tsc)
 {
     uint64_t tsc;
 
diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index c1ab6c7d58..4a586342ce 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -559,17 +559,17 @@ static inline int from_bcd(RTCState *s, int a)
 
 /* Hours in 12 hour mode are in 1-12 range, not 0-11.
  * So we need convert it before using it*/
-static inline int convert_hour(RTCState *s, int raw)
+static inline int convert_hour(RTCState *s, int hour)
 {
-    int hour = from_bcd(s, raw & 0x7f);
+    int ret = from_bcd(s, hour & 0x7f);
 
     if (!(s->hw.cmos_data[RTC_REG_B] & RTC_24H))
     {
-        hour %= 12;
-        if (raw & 0x80)
-            hour += 12;
+        ret %= 12;
+        if (hour & 0x80)
+            ret += 12;
     }
-    return hour;
+    return ret;
 }
 
 static void rtc_set_time(RTCState *s)
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 5d74863268..a09b6abaae 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -837,12 +837,12 @@ nsvm_vcpu_vmexit_inject(struct vcpu *v, struct cpu_user_regs *regs,
 }
 
 int cf_check nsvm_vcpu_vmexit_event(
-    struct vcpu *v, const struct x86_event *trap)
+    struct vcpu *v, const struct x86_event *event)
 {
     ASSERT(vcpu_nestedhvm(v).nv_vvmcx != NULL);
 
-    nestedsvm_vmexit_defer(v, VMEXIT_EXCEPTION_DE + trap->vector,
-                           trap->error_code, trap->cr2);
+    nestedsvm_vmexit_defer(v, VMEXIT_EXCEPTION_DE + event->vector,
+                           event->error_code, event->cr2);
     return NESTEDHVM_VMEXIT_DONE;
 }
 
@@ -1538,7 +1538,7 @@ nestedsvm_vcpu_interrupt(struct vcpu *v, const struct hvm_intack intack)
     return NSVM_INTR_NOTINTERCEPTED;
 }
 
-bool_t
+bool
 nestedsvm_gif_isset(struct vcpu *v)
 {
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index 41e3c4d5e4..4e40d3609a 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -43,7 +43,7 @@
 /* HACK: Route IRQ0 only to VCPU0 to prevent time jumps. */
 #define IRQ0_SPECIAL_ROUTING 1
 
-static void vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int irq);
+static void vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int pin);
 
 static struct hvm_vioapic *addr_vioapic(const struct domain *d,
                                         unsigned long addr)
diff --git a/xen/arch/x86/include/asm/hvm/domain.h b/xen/arch/x86/include/asm/hvm/domain.h
index 02c32cf26d..6e53ce4449 100644
--- a/xen/arch/x86/include/asm/hvm/domain.h
+++ b/xen/arch/x86/include/asm/hvm/domain.h
@@ -47,7 +47,7 @@ struct hvm_pi_ops {
      * Hook into arch_vcpu_block(), which is called
      * from vcpu_block() and vcpu_do_poll().
      */
-    void (*vcpu_block)(struct vcpu *);
+    void (*vcpu_block)(struct vcpu *v);
 };
 
 struct hvm_domain {
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index 3c37f522b9..3aa5091f44 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -151,8 +151,8 @@ struct hvm_function_table {
 
     void (*fpu_leave)(struct vcpu *v);
 
-    int  (*get_guest_pat)(struct vcpu *v, u64 *);
-    int  (*set_guest_pat)(struct vcpu *v, u64);
+    int  (*get_guest_pat)(struct vcpu *v, uint64_t *gpat);
+    int  (*set_guest_pat)(struct vcpu *v, uint64_t gpat);
 
     void (*set_tsc_offset)(struct vcpu *v, u64 offset, u64 at_tsc);
 
@@ -180,8 +180,8 @@ struct hvm_function_table {
     int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
     void (*handle_cd)(struct vcpu *v, unsigned long value);
     void (*set_info_guest)(struct vcpu *v);
-    void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
-    void (*set_descriptor_access_exiting)(struct vcpu *v, bool);
+    void (*set_rdtsc_exiting)(struct vcpu *v, bool enable);
+    void (*set_descriptor_access_exiting)(struct vcpu *v, bool enable);
 
     /* Nested HVM */
     int (*nhvm_vcpu_initialise)(struct vcpu *v);
@@ -265,10 +265,10 @@ int hvm_vcpu_cacheattr_init(struct vcpu *v);
 void hvm_vcpu_cacheattr_destroy(struct vcpu *v);
 void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip);
 
-void hvm_get_guest_pat(struct vcpu *v, u64 *guest_pat);
-int hvm_set_guest_pat(struct vcpu *v, u64 guest_pat);
+void hvm_get_guest_pat(struct vcpu *v, uint64_t *guest_pat);
+int hvm_set_guest_pat(struct vcpu *v, uint64_t guest_pat);
 
-u64 hvm_get_guest_tsc_fixed(struct vcpu *v, u64 at_tsc);
+uint64_t hvm_get_guest_tsc_fixed(struct vcpu *v, uint64_t at_tsc);
 
 u64 hvm_scale_tsc(const struct domain *d, u64 tsc);
 u64 hvm_get_tsc_scaling_ratio(u32 gtsc_khz);
@@ -282,7 +282,7 @@ int vmsi_deliver(
     uint8_t dest, uint8_t dest_mode,
     uint8_t delivery_mode, uint8_t trig_mode);
 struct hvm_pirq_dpci;
-void vmsi_deliver_pirq(struct domain *d, const struct hvm_pirq_dpci *);
+void vmsi_deliver_pirq(struct domain *d, const struct hvm_pirq_dpci *pirq_dpci);
 int hvm_girq_dest_2_vcpu_id(struct domain *d, uint8_t dest, uint8_t dest_mode);
 
 enum hvm_intblk
@@ -350,7 +350,7 @@ void *hvm_map_guest_frame_rw(unsigned long gfn, bool_t permanent,
                              bool_t *writable);
 void *hvm_map_guest_frame_ro(unsigned long gfn, bool_t permanent);
 void hvm_unmap_guest_frame(void *p, bool_t permanent);
-void hvm_mapped_guest_frames_mark_dirty(struct domain *);
+void hvm_mapped_guest_frames_mark_dirty(struct domain *d);
 
 int hvm_debug_op(struct vcpu *v, int32_t op);
 
diff --git a/xen/arch/x86/include/asm/hvm/irq.h b/xen/arch/x86/include/asm/hvm/irq.h
index 2d136ab99b..1817ca6e2d 100644
--- a/xen/arch/x86/include/asm/hvm/irq.h
+++ b/xen/arch/x86/include/asm/hvm/irq.h
@@ -160,17 +160,17 @@ struct hvm_pirq_dpci {
     struct list_head softirq_list;
 };
 
-void pt_pirq_init(struct domain *, struct hvm_pirq_dpci *);
-bool pt_pirq_cleanup_check(struct hvm_pirq_dpci *);
+void pt_pirq_init(struct domain *d, struct hvm_pirq_dpci *dpci);
+bool pt_pirq_cleanup_check(struct hvm_pirq_dpci *dpci);
 int pt_pirq_iterate(struct domain *d,
-                    int (*cb)(struct domain *,
-                              struct hvm_pirq_dpci *, void *arg),
+                    int (*cb)(struct domain *d,
+                              struct hvm_pirq_dpci *dpci, void *arg),
                     void *arg);
 
 #ifdef CONFIG_HVM
-bool pt_pirq_softirq_active(struct hvm_pirq_dpci *);
+bool pt_pirq_softirq_active(struct hvm_pirq_dpci *pirq_dpci);
 #else
-static inline bool pt_pirq_softirq_active(struct hvm_pirq_dpci *dpci)
+static inline bool pt_pirq_softirq_active(struct hvm_pirq_dpci *pirq_dpci)
 {
     return false;
 }
@@ -211,6 +211,6 @@ void hvm_assert_evtchn_irq(struct vcpu *v);
 void hvm_set_callback_via(struct domain *d, uint64_t via);
 
 struct pirq;
-bool hvm_domain_use_pirq(const struct domain *, const struct pirq *);
+bool hvm_domain_use_pirq(const struct domain *d, const struct pirq *pirq);
 
 #endif /* __ASM_X86_HVM_IRQ_H__ */
diff --git a/xen/arch/x86/include/asm/hvm/save.h b/xen/arch/x86/include/asm/hvm/save.h
index 9d838c48e3..535cf68ed2 100644
--- a/xen/arch/x86/include/asm/hvm/save.h
+++ b/xen/arch/x86/include/asm/hvm/save.h
@@ -36,8 +36,8 @@ void _hvm_write_entry(struct hvm_domain_context *h,
     r; })
 
 /* Unmarshalling: test an entry's size and typecode and record the instance */
-int _hvm_check_entry(struct hvm_domain_context *h, 
-                     uint16_t type, uint32_t len, bool_t strict_length);
+int _hvm_check_entry(struct hvm_domain_context *h,
+                     uint16_t type, uint32_t len, bool strict_length);
 
 /* Unmarshalling: copy the contents in a type-safe way */
 void _hvm_read_entry(struct hvm_domain_context *h,
diff --git a/xen/arch/x86/include/asm/hvm/support.h b/xen/arch/x86/include/asm/hvm/support.h
index 8d4707e58c..ab7de0a43b 100644
--- a/xen/arch/x86/include/asm/hvm/support.h
+++ b/xen/arch/x86/include/asm/hvm/support.h
@@ -135,7 +135,7 @@ int hvm_descriptor_access_intercept(uint64_t exit_info,
                                     unsigned int descriptor, bool is_write);
 int hvm_mov_to_cr(unsigned int cr, unsigned int gpr);
 int hvm_mov_from_cr(unsigned int cr, unsigned int gpr);
-void hvm_ud_intercept(struct cpu_user_regs *);
+void hvm_ud_intercept(struct cpu_user_regs *regs);
 
 /*
  * May return X86EMUL_EXCEPTION, at which point the caller is responsible for
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 13:58:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 13:58:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565888.884476 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM7gd-0003HN-F0; Wed, 19 Jul 2023 13:57:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565888.884476; Wed, 19 Jul 2023 13:57:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM7gd-0003HG-CM; Wed, 19 Jul 2023 13:57:51 +0000
Received: by outflank-mailman (input) for mailman id 565888;
 Wed, 19 Jul 2023 13:57:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Vyro=DF=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qM7gb-0003HA-O5
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 13:57:49 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3d9e1caa-263c-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 15:57:47 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 786D91FF6F;
 Wed, 19 Jul 2023 13:57:46 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4DBD51361C;
 Wed, 19 Jul 2023 13:57:46 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id ej0jEdrrt2T9NgAAMHmgww
 (envelope-from <jgross@suse.com>); Wed, 19 Jul 2023 13:57:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3d9e1caa-263c-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1689775066; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=+dcoVh2Imd0JCt8381sL4NIu6dgAuqBXMhcvOaYOEko=;
	b=SHyC7f2qgnSHa9zAZ3ZEQernAoRsA61ckM49+rADC/sA6hbPFpxx0bDRtJnqwfBsgBRzVy
	zQP6GrcuB060x9vfL2YrETfPokeuOXrmzxQZbyDRjVGrUtiIplCppMuzoO2j1x8jhVqVdf
	Jf5E/MmypyYQkStjBXw8Eae/6k5Xzn4=
Message-ID: <75b8d969-7f95-7e87-9f9f-7d99c97365e7@suse.com>
Date: Wed, 19 Jul 2023 15:57:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 18/18] tools/xenstore: add nocopy flag to node read
 functions
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-19-jgross@suse.com>
 <64ec2fd3-fcec-6ebf-5924-6b591215e19e@xen.org>
 <32cd8b9f-8afa-2cde-3815-82edc7052535@suse.com>
 <eca3cbf7-6747-6631-d0bc-26ec3faea233@xen.org>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <eca3cbf7-6747-6631-d0bc-26ec3faea233@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------JEdwe5XNr7mCIBK7su86n1Bd"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------JEdwe5XNr7mCIBK7su86n1Bd
Content-Type: multipart/mixed; boundary="------------lhT0Utq61VgYwFfKO0IMK9vm";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <75b8d969-7f95-7e87-9f9f-7d99c97365e7@suse.com>
Subject: Re: [PATCH v2 18/18] tools/xenstore: add nocopy flag to node read
 functions
References: <20230710065947.4201-1-jgross@suse.com>
 <20230710065947.4201-19-jgross@suse.com>
 <64ec2fd3-fcec-6ebf-5924-6b591215e19e@xen.org>
 <32cd8b9f-8afa-2cde-3815-82edc7052535@suse.com>
 <eca3cbf7-6747-6631-d0bc-26ec3faea233@xen.org>
In-Reply-To: <eca3cbf7-6747-6631-d0bc-26ec3faea233@xen.org>

--------------lhT0Utq61VgYwFfKO0IMK9vm
Content-Type: multipart/mixed; boundary="------------tyvmTuSjRYhcf0uBgPw0grbQ"

--------------tyvmTuSjRYhcf0uBgPw0grbQ
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMTkuMDcuMjMgMTQ6MDIsIEp1bGllbiBHcmFsbCB3cm90ZToNCj4gDQo+IA0KPiBPbiAx
OS8wNy8yMDIzIDA3OjQ5LCBKdWVyZ2VuIEdyb3NzIHdyb3RlOg0KPj4gT24gMTguMDcuMjMg
MjM6MzUsIEp1bGllbiBHcmFsbCB3cm90ZToNCj4+PiBIaSBKdWVyZ2VuLA0KPj4+DQo+Pj4g
T24gMTAvMDcvMjAyMyAwNzo1OSwgSnVlcmdlbiBHcm9zcyB3cm90ZToNCj4+Pj4gVG9kYXkg
d2hlbiByZWFkaW5nIGEgbm9kZSBmcm9tIHRoZSBkYXRhIGJhc2UgdGhyb3VnaCByZWFkX25v
ZGUoKSwgdGhlDQo+Pj4+IG5vZGUgZGF0YSBpcyBjb3BpZWQgaW4gb3JkZXIgdG8gYXZvaWQg
bW9kaWZ5aW5nIHRoZSBkYXRhIGJhc2Ugd2hlbg0KPj4+PiBwcmVwYXJpbmcgYSBub2RlIHVw
ZGF0ZSwgYXMgb3RoZXJ3aXNlIGFuIGVycm9yIG1pZ2h0IHJlc3VsdCBpbiBhbg0KPj4+PiBp
bmNvbnNpc3RlbnQgc3RhdGUuDQo+Pj4+DQo+Pj4+IFRoZXJlIGFyZSwgaG93ZXZlciwgbWFu
eSBjYXNlcyB3aGVyZSBzdWNoIGEgY29weSBvcGVyYXRpb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IHdpbGwgYmVjb21lIG1vb3QgaWYgd2UgZ28gYWhlYWQgd2l0
aCBzcGxpdHRpbmcgcmVhZF9ub2RlKCkuDQoNCkkgaGF2ZSBmb3VuZCBhIHNhbmUgc29sdXRp
b24gbWVhbndoaWxlLg0KDQoNCkp1ZXJnZW4NCg0K
--------------tyvmTuSjRYhcf0uBgPw0grbQ
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5RnNVUJbvoPHZ8SlM4KWm8rG+lIkGurq
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vU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------tyvmTuSjRYhcf0uBgPw0grbQ--

--------------lhT0Utq61VgYwFfKO0IMK9vm--

--------------JEdwe5XNr7mCIBK7su86n1Bd
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmS369kFAwAAAAAACgkQsN6d1ii/Ey9N
hAf7Bqi5zSZAU4Fpp1Jb39cjn8OyA9t0agOJteftJ2DVuK5a+9r1t30wBNIo4koQEkCJR9389gNK
AtJiENTWJ5KVq+v26O6RSEdoRmSrwOgPvzJhW8ZvD76gCRJ6senxNwgoTEnDhFXX8tLr9F5moZ/s
zU29nE1npPPvf9Oj/G65riIEmKI3xMvpRc0LP44PN19l9kyHvgOTEd2dp8xuOCXd1UgINPjuR2pT
9UVus8QHrA43BNXFj3QHmBDuloDxbKHljdQjWjjqrH/HAKb8H/bcSwb8wlJzwbLT6AEnG8k9Bi3A
yYybtf8CwnoT6pxLCZg4HKGkryKpaWp71GURfntUiw==
=ysEk
-----END PGP SIGNATURE-----

--------------JEdwe5XNr7mCIBK7su86n1Bd--


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 14:06:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 14:06:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565894.884486 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM7oG-0004pd-75; Wed, 19 Jul 2023 14:05:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565894.884486; Wed, 19 Jul 2023 14:05:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM7oG-0004pW-4G; Wed, 19 Jul 2023 14:05:44 +0000
Received: by outflank-mailman (input) for mailman id 565894;
 Wed, 19 Jul 2023 14:05:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM7oE-0004pQ-Nx
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 14:05:42 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on20619.outbound.protection.outlook.com
 [2a01:111:f400:fe13::619])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5884e540-263d-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 16:05:41 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB8401.eurprd04.prod.outlook.com (2603:10a6:20b:3f3::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Wed, 19 Jul
 2023 14:05:39 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 14:05:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5884e540-263d-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=i21FzI5H8IHIXQAMGBj3Ps2CaJq4OhqOOM1wzU76PMfiKPz3uCxJoLaQYGZNp7dR9/enjhTagUTvOxtexkuvqRwpqA0eA8cvID/4NletrWd2bsvH9wfomUiyOkznJy149hiLPpxkfsi6fJ82vH/64zVYsDphZtAvV8G9RDVnhGWCRuekZWrPu3CNh0CIrNnX8sAU+Tvw72WBtGohpuuITmUEWZPyNuoUdojbwWl2uw8QXwaefQ7eoJNdAFjsOR4Dmsj8G+4Nu8TYRN+efCVtTJgjMP8CMtgJbmsQPLsxb9hmQBDBvu4d238fRsJK5fhIYEugXveoL5eCDs5+w4Mg2A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=iR/uHbFTNyiPmrVvR7D7PJSwy7SEshyigRQxJeSxNik=;
 b=IQgp9GCVOx7oUjXfkEM7gsDlT7nZtt+z9lWsdpm1FkA6/N6Mex5iXDqejFdkmKLgot1sltChdjIYv6MMagKSuSib8KERbGTltd4iY+8+howrkEMhhkzQ8jFVcpm1Kbald/fD7W71dJ87b8ZXkW4/kGSJ97s6aAU9CTHDV7eAGFqNrm9vr5xYiCHf9qq6kkdjKhooTXQx5kS+gkxhrsrQ449XoAGSSYPUYSWw66qSO2IeBhgilwLgfk/dYqCXOGqfFbLH9eecQTU2mRrLN5VCgi8+bTiK3COWJhLud6/uP3m+Cy1umDnaCv3FamqtwN4+/EEHNxp1GtDYEO2FxuXtCw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=iR/uHbFTNyiPmrVvR7D7PJSwy7SEshyigRQxJeSxNik=;
 b=1Xy6kHAdzKow9Kcq8jaodMejAtP8LVaSZlT4FT6WRwa98dt/X+5xHmEhJJkQWl2hZ0u1vgv866HehC1s0GRR730BS++3crVEnXVu1sZiCcTofnhOv+HBwsTB3pSOXHflJVyFUmNNmyHfS40tFQqDaLxz1uXLMjsiNM4ytj4+9CyA+584rxSxVHdD3c1PSJFt0zgLGnUpVvuq2MXozIY9G0Agzdr54FO/YRD/B0+HdsvXgwed0f1AzbzVgwsyHVVmk+EFcr2E9qFTUbdnsJOeNK+jT2niYYy+ks3WJcRpV3fRJ2wfwlBp44qkN2lu39L0kHo9q3iRkdZcxSDfsenhrw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <6d3b7cd6-7d6a-8d28-f1e7-7e939e393445@suse.com>
Date: Wed, 19 Jul 2023 16:05:36 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v4 3/4] xen/ppc: Implement early serial printk on pseries
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1689710519.git.sanastasio@raptorengineering.com>
 <7c416ff843ea359bb24b8c954cc079fe1bbaf75f.1689710519.git.sanastasio@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <7c416ff843ea359bb24b8c954cc079fe1bbaf75f.1689710519.git.sanastasio@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0018.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:15::23) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB8401:EE_
X-MS-Office365-Filtering-Correlation-Id: 8c0a2242-fb58-4a4f-0863-08db88613b14
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	ochOJcbv+TyC0ognu2u1AjsBlJXl5JE28kW+6TrT7H7+ywSxmmTzb7hP9QG92SmU9aUW07Do1tkWiTHJq+qg9WZWgRP7rYwAypNMIKJiO1QBFeZgOx0J1NXlsrUb2l4q3ErmRW8wNph6DLpFxXXfGWV2Y6LdQwPECMbhotNFzgnzI7AN96BPU+6tTEtth98LyGJxnRiqFs6k3vth0Hg4uJkRH+t45Cg3SYa8qakPPTRbJGqnO9pkAidx6VUe8NvVUqx9Uh3mZluDZp7rStevBTQeFC/T1Zf7HgJwCBRux9JXLSuUEfS3SRqf0VP+sEBBJkghQVzFKCwrBR5+/D2/V2IhrCDAksbsz4cp5Ad1jOElFVkr7UZpj/0vySQxgKNInAfP5DAl3E7qvbcasf5X9Vaq4VtG/cfGmI1wQHYh/m8Bocuv16AA1e3D76cKhY5m5aWQP1qLc8f5eyDmzxDnz4/3qe7bq+jWJtkx8tey2uVe0AxA4VaskCc6PF696Vnq4MgdB2Hu+xjdG3PWwlmJgXd4LrsnywVydktHsfSyb/1K9i+Da9A6afSwBoGuAS/1gBGhix7Mi9zpfA6ouU4sbavvV40SMvCJYPzDz3dHHOBWBXXi2+lGpn+Hut9QmTCz/GiEHthTTjM2rusojvSuXg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(346002)(39860400002)(136003)(396003)(451199021)(54906003)(6486002)(478600001)(53546011)(26005)(6506007)(186003)(6512007)(2906002)(5660300002)(66946007)(6916009)(66556008)(66476007)(316002)(8936002)(8676002)(38100700002)(4326008)(31696002)(86362001)(36756003)(83380400001)(2616005)(31686004)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SHUvTFpWcEtJWnR6ZE1xWHlrQUxxNWRTdHpqYVNZL0hNYXROREJyM2hDOS81?=
 =?utf-8?B?OHJ2OUhLWTViZEV4eHVKOEN3azVYSFR4dFlOOCtPWDRUOENDa0lyRlEvaWZk?=
 =?utf-8?B?TzNCVlk3R2p1b0RIeGdPS0VZcWZoTmRTaldLclFBQzJYMjQ2TVQ2RGRmZmxO?=
 =?utf-8?B?by9kMU5CQzRNLzM2UUJXaDBRK3dCcEJFUXFtdHIxZXUyTWpzeHlPa1ZseDVV?=
 =?utf-8?B?NCt3UUtpa1NqOUdsMHpDbVAwb1JVZXdkak1FVlpmdG50dGVlQ3h4dk1uS1lX?=
 =?utf-8?B?UGI0RHhINzV2Mkg4dUtGc2VwRG1UOWRkV3VXc2dvVlZJcFRQUTdPazd3WFZF?=
 =?utf-8?B?TlVEZmp4bkcvOXp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vdyZST12KYgYIGWmmd37?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8c0a2242-fb58-4a4f-0863-08db88613b14
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 14:05:38.8652
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 287lxlQMM2rBpAg65Lpvb1SkSnENTemRE+ocN2A6McFFyF30hw3ml+Q6S4EpQ8QgY1zXwtyh4jpiZ9e5KJr72A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8401

On 18.07.2023 22:20, Shawn Anastasio wrote:
> +void __init boot_of_init(unsigned long vec)
> +{
> +    int bof_chosen;
> +
> +    of_vec = vec;
> +
> +    /* Get a handle to the default console */
> +    bof_chosen = of_finddevice("/chosen");
> +    of_getprop(bof_chosen, "stdout", &of_out, sizeof(of_out));
> +    of_out = be32_to_cpu(of_out);

Can any of these fail, and hence lead to ...

> +    early_printk_init(of_putchar);

... this better not getting invoked?

> --- a/xen/arch/ppc/ppc64/asm-offsets.c
> +++ b/xen/arch/ppc/ppc64/asm-offsets.c
> @@ -0,0 +1,59 @@
> +/*
> + * Generate definitions needed by assembly language modules.
> + * This code generates raw asm output which is post-processed
> + * to extract and format the required data.
> + */
> +
> +#include <asm/processor.h>
> +
> +#define DEFINE(_sym, _val)                                                 \
> +    asm volatile ("\n.ascii\"==>#define " #_sym " %0 /* " #_val " */<==\"" \
> +                  : : "i" (_val) )

Nit: There's a blank missing after the opening paren, which will then want
the 2nd line to be indented by one more character. (Instead, as a matter of
your taste, you may omit the blank between the two colons.)

> +#define BLANK()                                                            \
> +    asm volatile ( "\n.ascii\"==><==\"" : : )
> +#define OFFSET(_sym, _str, _mem)                                           \
> +    DEFINE(_sym, offsetof(_str, _mem));
> +
> +/* base-2 logarithm */
> +#define __L2(_x)  (((_x) & 0x00000002) ?   1 : 0)
> +#define __L4(_x)  (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
> +#define __L8(_x)  (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
> +#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
> +#define LOG_2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x))
> +
> +void __dummy__(void)
> +{
> +    DEFINE(GPR_WIDTH, sizeof(unsigned long));
> +    DEFINE(FPR_WIDTH, sizeof(double));
> +
> +    OFFSET(UREGS_gprs, struct cpu_user_regs, gprs);
> +    OFFSET(UREGS_r0, struct cpu_user_regs, gprs[0]);
> +    OFFSET(UREGS_r1, struct cpu_user_regs, gprs[1]);
> +    OFFSET(UREGS_r13, struct cpu_user_regs, gprs[13]);
> +    OFFSET(UREGS_srr0, struct cpu_user_regs, srr0);
> +    OFFSET(UREGS_srr1, struct cpu_user_regs, srr1);
> +    OFFSET(UREGS_pc, struct cpu_user_regs, pc);
> +    OFFSET(UREGS_msr, struct cpu_user_regs, msr);
> +    OFFSET(UREGS_lr, struct cpu_user_regs, lr);
> +    OFFSET(UREGS_ctr, struct cpu_user_regs, ctr);
> +    OFFSET(UREGS_xer, struct cpu_user_regs, xer);
> +    OFFSET(UREGS_hid4, struct cpu_user_regs, hid4);
> +    OFFSET(UREGS_dar, struct cpu_user_regs, dar);
> +    OFFSET(UREGS_dsisr, struct cpu_user_regs, dsisr);
> +    OFFSET(UREGS_cr, struct cpu_user_regs, cr);
> +    OFFSET(UREGS_fpscr, struct cpu_user_regs, fpscr);
> +    DEFINE(UREGS_sizeof, sizeof(struct cpu_user_regs));
> +}
> +
> +/* TODO: Replace with BUILD_BUG_ON + IS_ALIGNED once we can use <xen/lib.h> */
> +_Static_assert(sizeof(struct cpu_user_regs) % STACK_ALIGN == 0,
> +               "struct cpu_user_regs not stack aligned!");

But patch 1 makes BUILD_BUG_ON() available now.

> --- /dev/null
> +++ b/xen/arch/ppc/ppc64/of-call.S
> @@ -0,0 +1,83 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * Adapted from Linux's arch/powerpc/kernel/entry_64.S, with the
> + * following copyright notice:
> + *
> + *  PowerPC version
> + *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
> + *  Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
> + *    Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
> + *  Adapted for Power Macintosh by Paul Mackerras.
> + *  Low-level exception handlers and MMU support
> + *  rewritten by Paul Mackerras.
> + *    Copyright (C) 1996 Paul Mackerras.
> + *  MPC8xx modifications Copyright (C) 1997 Dan Malek (dmalek@jlc.net).
> + */
> +
> +#include <asm/asm-offsets.h>
> +#include <asm/asm-defns.h>
> +#include <asm/msr.h>
> +
> +/* size of minimum stack frame that can hold an entire cpu_user_regs struct */
> +#define STACK_SWITCH_FRAME_SIZE UREGS_sizeof
> +
> +    .section .init.text, "ax", @progbits
> +
> +ENTRY(enter_of)
> +    mflr %r0
> +    std %r0, 16(%r1)
> +    stdu %r1,-STACK_SWITCH_FRAME_SIZE(%r1) /* Save SP and create stack space */

Nit: A blank after the comma would again be nice.

> +    /*
> +     * Because PROM is running in 32b mode, it clobbers the high order half
> +     * of all registers that it saves.  We therefore save those registers
> +     * PROM might touch to the stack.  (%r0, %r3-%r13 are caller saved)
> +     */
> +    SAVE_GPR(2, %r1)
> +    SAVE_GPR(13, %r1)
> +    SAVE_NVGPRS(%r1)
> +    mfcr %r10
> +    mfmsr %r11
> +    std %r10, UREGS_cr(%r1)
> +    std %r11, UREGS_msr(%r1)
> +
> +    /* Put PROM address in SRR0 */
> +    mtsrr0 %r4
> +
> +    /* Setup our trampoline return addr in LR */
> +    bcl 20, 31, .+4
> +0:  mflr %r4
> +    addi %r4, %r4, 1f - 0b
> +    mtlr %r4
> +
> +    /* Prepare a 32-bit mode big endian MSR */
> +    LOAD_IMM64(%r12, MSR_SF | MSR_LE)
> +    andc %r11, %r11, %r12
> +    mtsrr1 %r11
> +    rfid
> +
> +1:  /* Return from OF */
> +    FIXUP_ENDIAN
> +
> +    /* Just make sure that %r1 top 32 bits didn't get corrupt by OF */
> +    rldicl %r1, %r1, 0, 32
> +
> +    /* Restore the MSR (back to 64 bits) */
> +    ld %r0, UREGS_msr(%r1)
> +    mtmsrd %r0
> +    isync
> +
> +    /* Restore other registers */
> +    REST_GPR(2, %r1)
> +    REST_GPR(13, %r1)
> +    REST_NVGPRS(%r1)
> +    ld %r4, UREGS_cr(%r1)
> +    mtcr %r4
> +
> +    addi %r1, %r1, STACK_SWITCH_FRAME_SIZE
> +    ld %r0, 16(%r1)
> +    mtlr %r0
> +    blr
> +
> +    .size enter_of, . - enter_of
> +    .type enter_of, %function

Before you/we grow more assembly code, may I re-raise a request regarding
readability: I think it would be nice if operands started at a fixed column,
unless the insn mnemonic is unusually long. Where exactly to draw the line
is up to each archtecture; on x86 we use 8 positions from the start of the
mnemonic.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 14:07:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 14:07:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565897.884496 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM7pP-0005Ld-HT; Wed, 19 Jul 2023 14:06:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565897.884496; Wed, 19 Jul 2023 14:06:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM7pP-0005LV-Ep; Wed, 19 Jul 2023 14:06:55 +0000
Received: by outflank-mailman (input) for mailman id 565897;
 Wed, 19 Jul 2023 14:06:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qM7pO-0005LL-Jf
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 14:06:54 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qM7pN-0004FH-4s; Wed, 19 Jul 2023 14:06:53 +0000
Received: from 54-240-197-228.amazon.com ([54.240.197.228]
 helo=[192.168.5.130]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qM7pM-0007Ak-U1; Wed, 19 Jul 2023 14:06:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=cs21xDKuAl5htdEQty3rHproNTj5cFuOLY/wGHzuGo4=; b=SYnwIOB4/s9Id0dSikI0AbPmRa
	NzDOGwlM+3OXImQm3YiNe6TwusbaJ/REPxAFjTfuV1+xUAEkidPr2KiKqILAzlkttCuZNDLYIz/PJ
	Yo081bL1Rut5BPR3J9TvvQnghHrFADbpkv+b5a5TkKo2xyjzYD8bOSXX85vMSY+MCJ4o=;
Message-ID: <d0ea5b5a-e2c6-41dd-39bb-c692af2b8ced@xen.org>
Date: Wed, 19 Jul 2023 15:06:50 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 3/4] xen/arm: initialize conditionally uninitialized
 local variables
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <c7d2cd46f06f75f8a1810168c508f05d242f831c.1689329728.git.nicola.vetrini@bugseng.com>
 <9ab4ae66-aa72-2426-08e5-cbe44030d7f2@xen.org>
 <af6157e5-fc71-1df7-cab7-fefa78425d3e@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <af6157e5-fc71-1df7-cab7-fefa78425d3e@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 19/07/2023 14:27, Nicola Vetrini wrote:
> On 14/07/23 15:21, Julien Grall wrote:
>> Hi,
>>
>> On 14/07/2023 12:49, Nicola Vetrini wrote:
>>> This patch aims to fix some occurrences of possibly uninitialized
>>> variables, that may be read before being written. This behaviour would
>>> violate MISRA C:2012 Rule 9.1, besides being generally undesirable.
>>>
>>> In all the analyzed cases, such accesses were actually safe, but it's
>>> quite difficult to prove so by automatic checking, therefore a safer
>>> route is to change the code so as to avoid the behaviour from occurring,
>>> while preserving the semantics.
>>>
>>> An initialization to a safe value is provided to reach this aim.
>>>
>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>> ---
>>> Additional input on which values may be 'safe' in each context is
>>> surely welcome, to avoid possibly compromising the correctness of
>>> the function semantics.
>>> ---
>>> Â  xen/arch/arm/cpuerrata.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  6 +++---
>>> Â  xen/arch/arm/domctl.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  8 ++++----
>>> Â  xen/arch/arm/gic-v3-lpi.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  | 17 +++++++++--------
>>> Â  xen/arch/arm/include/asm/p2m.hÂ Â Â Â Â Â Â Â Â Â Â Â Â  | 10 ++++++----
>>> Â  xen/arch/arm/platforms/xilinx-zynqmp-eemi.c | 10 ++--------
>>> Â  xen/arch/arm/psci.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  | 10 +++++-----
>>> Â  xen/drivers/char/pl011.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  2 +-
>>> Â  7 files changed, 30 insertions(+), 33 deletions(-)
>>>
>>> diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
>>> index d0658aedb6..14694c6081 100644
>>> --- a/xen/arch/arm/cpuerrata.c
>>> +++ b/xen/arch/arm/cpuerrata.c
>>> @@ -159,7 +159,7 @@ extern char __mitigate_spectre_bhb_loop_start_32[],
>>> Â  static int enable_smccc_arch_workaround_1(void *data)
>>> Â  {
>>> -Â Â Â  struct arm_smccc_res res;
>>> +Â Â Â  struct arm_smccc_res res = {0};
>>
>> I understand you desire to make happy. But I am not sure that 
>> initializing to 0 is the right thing. If the SMCC were not properly 
>> setting the register, then we most likely don't want to install the 
>> workaround. Instead, we most likely want to warn.
>>
>> So you want (int)res.a0 to be negative. We don't care about the other 
>> fields.
>>
> 
> In principle I'm ok with this, but see below.
> 
>>> Â Â Â Â Â  const struct arm_cpu_capabilities *entry = data;
>>> Â Â Â Â Â  /*
>>> @@ -252,7 +252,7 @@ static int enable_spectre_bhb_workaround(void *data)
>>> Â Â Â Â Â  if ( cpus_have_cap(ARM_WORKAROUND_BHB_SMCC_3) )
>>> Â Â Â Â Â  {
>>> -Â Â Â Â Â Â Â  struct arm_smccc_res res;
>>> +Â Â Â Â Â Â Â  struct arm_smccc_res res = {0};
>>
>> Same remark here.
>>
>>> Â Â Â Â Â Â Â Â Â  if ( smccc_ver < SMCCC_VERSION(1, 1) )
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  goto warn;
>>> @@ -393,7 +393,7 @@ DEFINE_PER_CPU_READ_MOSTLY(register_t, 
>>> ssbd_callback_required);
>>> Â  static bool has_ssbd_mitigation(const struct arm_cpu_capabilities 
>>> *entry)
>>> Â  {
>>> -Â Â Â  struct arm_smccc_res res;
>>> +Â Â Â  struct arm_smccc_res res = {0};
>>
>> Here you would want (int)res.a0 to be equal to ARM_SMCCC_NOT_SUPPORTED.
> 
> I see that ARM_SMCCC_NOT_SUPPORTED is
> #define ARM_SMCCC_NOT_SUPPORTEDÂ Â Â Â Â Â Â Â  (-1)
> 
> thus an assignment to res.a0 would violate Rule 10.3:
> "The value of an expression shall not be assigned to an object with a 
> narrower essential type or of a different essential type category."
> (signed vs unsigned, and the exception does not apply here).
> 
> This rule is not yet under discussion, but I would like to avoid 
> knowingly introducing more violations if there's an alternative.
> 
> Do the fields of struct arm_smccc_res really need to be unsigned?

Yes, all the fields represent a register. Also, in this context, only 
the first 32-bit of the register should be taken into account.

That why you will see code using (int)res.a0.

>>> Â Â Â Â Â  bool required;
>>> Â Â Â Â Â  if ( smccc_ver < SMCCC_VERSION(1, 1) )
>>> diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c
>>> index ad56efb0f5..b38fed72be 100644
>>> --- a/xen/arch/arm/domctl.c
>>> +++ b/xen/arch/arm/domctl.c
>>> @@ -29,10 +29,10 @@ static int handle_vuart_init(struct domain *d,
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct xen_domctl_vuart_op *vuart_op)
>>> Â  {
>>> Â Â Â Â Â  int rc;
>>> -Â Â Â  struct vpl011_init_info info;
>>> -
>>> -Â Â Â  info.console_domid = vuart_op->console_domid;
>>> -Â Â Â  info.gfn = _gfn(vuart_op->gfn);
>>> +Â Â Â  struct vpl011_init_info info = {
>>> +Â Â Â Â Â Â Â  .console_domid = vuart_op->console_domid,
>>> +Â Â Â Â Â Â Â  .gfn = _gfn(vuart_op->gfn)
>>> +Â Â Â  };
>>
>> I am not against, this change. But I don't quite understand how this 
>> makes Eclair much happier?
> 
> It also zero-initializes the third field:
> 
> struct vpl011_init_info {
>  Â Â Â  domid_t console_domid;
>  Â Â Â  gfn_t gfn;
>  Â Â Â  evtchn_port_t evtchn;
> };
> 
> 
>>
>> Also, if this is the desired way, then I think this should be written 
>> down in the CODING_STYLE.
> 
> This is just a matter of style, I can also set the other field 
> explicitly, if you prefer.

I am confused. In a previous reply, I thought you said the following 
would also make ECLAIR unhappy:

info.console_domid = <...>;
info.gfn = <...>;
info.evtchn = <...>;

> Either way, it might be a good idea to settle 
> this in the CODING_STYLE in a different patch.

Well... The pattern you complain about is fairly common in Xen and I 
personally prefer to use in some situation over your proposal. So I 
think we need to agree first that your proposal is the way to go before 
modifying the code everywhere.

[...]

>>
>> I understand the exist construct is not liked by Eclair. But your new 
>> construct is not easily readable by a human. Before I can propose a 
>> different approach, can you clarify why Eclair is unhappy this the 
>> existing code?
>>
> 
> This has been addressed in the reply to patch 1/4.

AFAICT the conversation wasn't settled. We will continue there to avoid 
duplication.

> 
>>> Â Â Â Â Â  /*
>>> Â Â Â Â Â Â  * DOMID_XEN sees 1-1 RAM. The p2m_type is based on the type of 
>>> the
>>> diff --git a/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c 
>>> b/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
>>> index 2053ed7ac5..39d9ab4fa9 100644
>>> --- a/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
>>> +++ b/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
>>> @@ -51,11 +51,11 @@ static inline bool domain_has_reset_access(struct 
>>> domain *d, uint32_t rst)
>>> Â  bool zynqmp_eemi(struct cpu_user_regs *regs)
>>> Â  {
>>> -Â Â Â  struct arm_smccc_res res;
>>> +Â Â Â  struct arm_smccc_res res = {0};
>>> Â Â Â Â Â  uint32_t fid = get_user_reg(regs, 0);
>>> Â Â Â Â Â  uint32_t nodeid = get_user_reg(regs, 1);
>>> Â Â Â Â Â  unsigned int pm_fn = fid & 0xFFFF;
>>> -Â Â Â  enum pm_ret_status ret;
>>> +Â Â Â  enum pm_ret_status ret = XST_PM_NO_ACCESS;
>>
>> It is not clear to me why Eclair is unhappy here?
> 
> Gotos, as explained in the reply to patch 1/4. Since 'ret' here already 
> sets a value in every branch, I am in favour of initializing it before 
> the switch with that value. The zero-ed 'arm_smccc_res' is ok here?

I am not in favor of this approach. Have you considered my proposal...

> 
>>
>>> Â Â Â Â Â  switch ( fid )
>>> Â Â Â Â Â  {
>>> @@ -89,7 +89,6 @@ bool zynqmp_eemi(struct cpu_user_regs *regs)
>>> Â Â Â Â Â Â Â Â Â  {
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  gprintk(XENLOG_WARNING,
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  "zynqmp-pm: fn=%u No access to node %u\n", 
>>> pm_fn, nodeid);
>>> -Â Â Â Â Â Â Â Â Â Â Â  ret = XST_PM_NO_ACCESS;
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  goto done;
>>
>> I find the new approach less obvious. How about introduce a macro that 
>> will set the result and the use replace the two lines with:
>>
>> set_result(regs, XST_PM_NO_ACCESS);
>> return 0;
>>
>> where set_result(regs, ret) is
>>
>> set_user_reg(regs, 0, ret)

... here?

[...]

>>> diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
>>> index f7bf3ad117..34ce90be52 100644
>>> --- a/xen/drivers/char/pl011.c
>>> +++ b/xen/drivers/char/pl011.c
>>> @@ -285,7 +285,7 @@ static int __init pl011_dt_uart_init(struct 
>>> dt_device_node *dev,
>>> Â Â Â Â Â  const char *config = data;
>>> Â Â Â Â Â  int res;
>>> Â Â Â Â Â  paddr_t addr, size;
>>> -Â Â Â  uint32_t io_width;
>>> +Â Â Â  uint32_t io_width = 0;
>>
>> We have many use of dt_property_read_*() within the code base. I would 
>> like us te decide of a policy first.
>>
> 
> Well, the best outcome for me is if all these functions (i.e., 
> dt_property_*, dt_get_property_*) always write the parameter they are 
> supposed to set. I understand if this is not always feasible, but the 
> alternative is not clean (e.g., deviate or refactor in such a way that 
> the code is less readable).

I have had a look at the helpers. Here some thoughts

* dt_get_property(): Always setting '*lenp' could result to user 
starting relying on the 'len' rather than the error code. This could 
potentially be mitigated by forcing the code to check the value (i.e. 
adding __must_check).

* dt_property_read_u*(): The best would be to let the user decide what 
would a default sane value by adding an extra parameter.

* dt_property_read_string(): I would return the string and use 
ERR_PTR(...) when there is an error.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 14:13:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 14:13:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565901.884507 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM7w4-00078c-CU; Wed, 19 Jul 2023 14:13:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565901.884507; Wed, 19 Jul 2023 14:13:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM7w4-00078V-8e; Wed, 19 Jul 2023 14:13:48 +0000
Received: by outflank-mailman (input) for mailman id 565901;
 Wed, 19 Jul 2023 14:13:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=qi+E=DF=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qM7w2-00078P-Fd
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 14:13:46 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on2061c.outbound.protection.outlook.com
 [2a01:111:f400:7d00::61c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 78bf063e-263e-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 16:13:45 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB7831.eurprd04.prod.outlook.com (2603:10a6:20b:2a8::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Wed, 19 Jul
 2023 14:13:42 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 14:13:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 78bf063e-263e-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KjXdc2ltqmJqB+CpLPC1NnoLtiGCOYHOTnf4e1l31+NuoRT6LPtw3YB0+sUiX0JewJeEo7aU1TyTMKpi6IPclqGwvJCFjdXQHg41bc4HqseRex/2UOBIG5MZDMAsI4i+prGtZ0DBmBftjo6HA4TvciE7sKGx0YKbaiDNCYaIuGWijIjtJLVAuhPt6hqAFtrLVrt51HXVW1Gq3lZ7itVFkFIUqoFjYymS7qYFBhlEgxYtH3RwWMURWEslYvIebiHkCalACAPLTb4JCcv14dDkTZgLE0f/Cx8ixisnMvM2hqV0cy8mscoe8QMZh+xafENgFDDmW6vhgTTe2EfYzT8kzg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=P1sYICqKnpdu0fmsyevRhCyDcZaOPyWwxqQvjY5Jm84=;
 b=j41qLFYOFR7Sr+WwOWVIIYfN8Nj5S51EryF3J8PE5EAG/ue+rh6W28gY+BZerBjWN+/AGJ82NET4B6WaJmw4al1lZQE89/CEzUwtj7QNCxrD3W5Fj5S8RlqcD+EtPXavoJqSNWPHgjBAzZRtmFuoqdJh5pCh17W67GRCct6OUoBZ2OV4+tnWQArxPVHAQlX5NCzxQjs/p1ftn259ivDW1Ao4m6doItfE1i6Us9tHEJz9Ob+tdLOtLjMtZza/yeEqFBRlw2uae4bJScUsD8eharr58hXGQOi4W9xxT/hyvlb+X6lyuQA/CcCRR51z+uzmrNK8Za9FjnAP54tMNpzvvA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=P1sYICqKnpdu0fmsyevRhCyDcZaOPyWwxqQvjY5Jm84=;
 b=xR6uppPLoBMyVTcc0BytkedoA0btf8v5AfZQbnTp6OcrHZECPcVO1yLaRIRivrCI/GzyCcm8X7fxiv/I/9GtQrxYV+c35TEgnGNtTLh2qW6IrKphLCSNeVy+z2sXvFgdrAMDto3rM3ehrKMXG9Hc27+pPAOhshDD5NpPjxDH5YbH+UsiUcAzsapjNuwDLxfunxIwJttrskCZ4ApoPC83J3wSy2/gRWmFB7pYQG8J8eDf0OqhRiF3EAmiTvuBl9S9RHo+vQ1q8W2NI430mmdR4ykBvksCEplaTL6mcF71+Cx2HyMqO7xeluf7nIQmo3DidPtqUNXBl4uYdGVY8TCzqA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e2dd3b3e-6270-602e-67ad-b7ddb4b1d96e@suse.com>
Date: Wed, 19 Jul 2023 16:13:40 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH RFC] x86/boot: Update construct_dom0() to take a const
 char *cmdline
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Daniel Smith <dpsmith@apertussolutions.com>,
 Christopher Clark <christopher@nexfir.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230719131802.4078609-1-andrew.cooper3@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230719131802.4078609-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0163.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b3::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB7831:EE_
X-MS-Office365-Filtering-Correlation-Id: 5951e3fd-6bad-418b-4a03-08db88625b8a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	p5cc/tUPRdkCRZerat4A53dAaUSWZg8jyln0FLhGG21KtVprrW7dsbPF1flJqDWGMDsl9rJozgqgUI023gzqLSOP5MTDjBKq/ZDbCEMEB2X2sAjDgd7evHeCa6fxZgc5V5y2qETJIp6vo+iIJYOZ5qXD6RmEel8DFV6JUC2veuWJNoPfed6lSMo454ompGb0hJ6U5A8monfXcSKvmO7mX8N0lkt5RIXOt8rR9LM6jTjV2K3ndia/CMtGstSftNp2G+GhsIJqo+OB8OgsD1IIMFSueuldbB7BPccGOROfdSGGFQ/BbmVuhDzrntjWdTrf8Ir2v+jjtHrwaThf8R0xVmr9W7RDwX0HURwtbSo1E/UXa3qHGxvWAvtjkBuduROQ9nO9Mw23j373JHeoU9hjjEN3PHmQiA0aTBIYp6lTd31WITRZl+0P+fpace7ZCOcVxIv+QyvDKDjTNF/tMX1jAtP6GvrhaD9d7EJ1WMFwuuzBT9Z9OjUBGYWAEN7LNvAp/Q2NH551U6XG08ZivUXMauAyhKtk4+lYb0HxVwwKzvkVo94xpZ+Hc9ecCH1YFYOBKDSZbwOk6zSeQuil2ETx86Vcm1wHP9zNCVC0iq9ouAnSlaRPRw/fIXvxnEg3qDrqpGcXcZWgvVwETkvJL0Tklw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(39860400002)(376002)(136003)(366004)(346002)(451199021)(31686004)(38100700002)(6506007)(53546011)(26005)(478600001)(6916009)(54906003)(15650500001)(5660300002)(8936002)(8676002)(4326008)(66476007)(66946007)(66556008)(6512007)(86362001)(41300700001)(6486002)(316002)(31696002)(2616005)(186003)(36756003)(2906002)(83380400001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bXRXNE14RnlubHVOTVVXTkgvVzJvYy9rYjZoZ2hSWWFUN0JQckF5L1hKdlRT?=
 =?utf-8?B?U1NaRFZWQldnTUxuMHNUanhaYUNoYnIyOXdIMVR3NWgzK1Q3WGtNcXV2N2Fo?=
 =?utf-8?B?NjZVZzVMS2x2Nkltd0lSTWVOZTBTaFBqcVp3eHJZYW9NSGlpdlprWXJDNnBT?=
 =?utf-8?B?SWw2dTZhekdGSEx2blk0RkQ0b2t6WHJWUDllZkEvOUF6WisvRlRPY1RnYytQ?=
 =?utf-8?B?ODF6S0hEaE1vNmZ0aUc4Y0p3SGJ3T0tyS0hoSmxSVG1YMUJQYk1majhLS1Zv?=
 =?utf-8?B?bHhNWXJOdytRcE55Z1oycS9SdWdrQzBzZUxxNlpyVzYycTNuNkZzMTdYQTBP?=
 =?utf-8?B?WmpZVEppTFJQZlBoZWxFRS8rbmJ3bFo5bWVQQUlNOXVKSS9udnJtY0txU3BF?=
 =?utf-8?B?MnRlajJ3Z09EOEVNVFBiOWJLb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951e3fd-6bad-418b-4a03-08db88625b8a
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 14:13:42.8356
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: sCNknHQvgBHXlyh4uXmNRAVHDk2CiekSyE5XgJ07MbaQzLkwTm8a11YwNyPgY+4M2CjT0ybIIZt/TKAuRqr5kQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7831

On 19.07.2023 15:18, Andrew Cooper wrote:
> With hvm_copy_to_guest_*() able to use const sources, update construct_dom0()
> and friends to pass a const cmdline pointer.  Nothing in these paths have a
> reason to be modifying the command line passed in.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
> CC: Wei Liu <wl@xen.org>
> CC: Daniel Smith <dpsmith@apertussolutions.com>
> CC: Christopher Clark <christopher@nexfir.com>
> 
> Slightly RFC.
> 
> I'm confused as to why image is const, but the initrd isn't.

dom0_construct_pv() has

            initrd->mod_start = initrd_mfn = mfn_x(page_to_mfn(page));

Looks like dom0_construct_pvh() and pvh_load_kernel() could have
it const-ified.

> This is necessary to make the -Wwrite-strings bodge compile, but I'm hoping
> that a less-bad solution to the cmdline literals problem would avoid the need
> to propagate const through this callpath.

But propagating const through this, like any other, path is a good
thing, isn't it?

If you want to keep it (you appear to be uncertain)
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 14:31:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 14:31:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565905.884518 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM8Ci-0001f1-T7; Wed, 19 Jul 2023 14:31:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565905.884518; Wed, 19 Jul 2023 14:31:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM8Ci-0001eu-OV; Wed, 19 Jul 2023 14:31:00 +0000
Received: by outflank-mailman (input) for mailman id 565905;
 Wed, 19 Jul 2023 14:31:00 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qM8Ci-0001el-G9; Wed, 19 Jul 2023 14:31:00 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qM8Ci-0004s5-5b; Wed, 19 Jul 2023 14:31:00 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qM8Ch-0001T1-FA; Wed, 19 Jul 2023 14:30:59 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qM8Ch-0003qR-Eg; Wed, 19 Jul 2023 14:30:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Xsk4jZMzZGF81o1LoNvsBmQRSncpEXIXy+ckns1uBPk=; b=W+GT2paZIa7n4yKM5baBnb+aor
	OfR+nfZjMxU+vwngJ3MVJAe2a2l+fHSqnd/dPcEgdEgL5FxZtnRV4BnWgj3QBQeGvYgfE66KMVi/D
	OeP25mAF5WHpVD03mnWm+zfHneCgbvVSkmniEIy5pNvDEPyvz94kO/20ePQvxqm4lcFE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181896-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181896: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=08aacbf0560d98929d402af029ac010d35abb3d6
X-Osstest-Versions-That:
    ovmf=4d1014093fbf1ae2788caaad8e70eabb15720ce4
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 19 Jul 2023 14:30:59 +0000

flight 181896 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181896/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 08aacbf0560d98929d402af029ac010d35abb3d6
baseline version:
 ovmf                 4d1014093fbf1ae2788caaad8e70eabb15720ce4

Last test of basis   181847  2023-07-17 14:10:50 Z    2 days
Testing same since   181896  2023-07-19 12:12:15 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Anatol Belski <anbelski@linux.microsoft.com>
  Jianyong Wu <jianyong.wu@arm.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   4d1014093f..08aacbf056  08aacbf0560d98929d402af029ac010d35abb3d6 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 14:45:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 14:45:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565922.884550 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM8R1-0003jM-Bl; Wed, 19 Jul 2023 14:45:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565922.884550; Wed, 19 Jul 2023 14:45:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM8R1-0003jF-8z; Wed, 19 Jul 2023 14:45:47 +0000
Received: by outflank-mailman (input) for mailman id 565922;
 Wed, 19 Jul 2023 14:45:46 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qM8R0-0003j5-9f; Wed, 19 Jul 2023 14:45:46 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qM8R0-0005A1-7H; Wed, 19 Jul 2023 14:45:46 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qM8Qz-0001nn-S9; Wed, 19 Jul 2023 14:45:45 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qM8Qz-0007w9-Rd; Wed, 19 Jul 2023 14:45:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=YPDfzKBVjRKGUFbycjOxZXcyFXmpmoo5ZKuMm6+Dxvo=; b=kBPHW887mZsSBKUs+bEZkfF8Hg
	krvvxeSo96sYgsZrw08738oNJBZ0M2QflEY9ocxNG0rieUspigS8p3bHoJ01O8Bo7vWNAvq0LZN0G
	DDn6lt+c6mEzM7WjrQTJ410pGvfW7M10JBA5DC/Us/HC1xnA7yLwt/bHgYARbTNfr4ms=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181875-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181875: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-xl-qemut-debianhvm-amd64:xen-install:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=e04cc8a08df3574bd7d5f7860008f1625e28f8b1
X-Osstest-Versions-That:
    xen=813da5f0e73b8cbd2ac3c7922506e58c28cd736d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 19 Jul 2023 14:45:45 +0000

flight 181875 xen-unstable real [real]
flight 181899 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181875/
http://logs.test-lab.xenproject.org/osstest/logs/181899/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-xl-qemut-debianhvm-amd64 7 xen-install fail pass in 181899-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181846
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181846
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181846
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181846
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181846
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181846
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181846
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181846
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181846
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181846
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181846
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181846
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 xen                  e04cc8a08df3574bd7d5f7860008f1625e28f8b1
baseline version:
 xen                  813da5f0e73b8cbd2ac3c7922506e58c28cd736d

Last test of basis   181846  2023-07-17 13:46:51 Z    2 days
Testing same since   181875  2023-07-18 11:33:44 Z    1 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Julien Grall <jgrall@amazon.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   813da5f0e7..e04cc8a08d  e04cc8a08df3574bd7d5f7860008f1625e28f8b1 -> master


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 15:21:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 15:21:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565939.884560 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM8ym-0000jD-58; Wed, 19 Jul 2023 15:20:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565939.884560; Wed, 19 Jul 2023 15:20:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM8ym-0000j6-22; Wed, 19 Jul 2023 15:20:40 +0000
Received: by outflank-mailman (input) for mailman id 565939;
 Wed, 19 Jul 2023 15:20:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KnqJ=DF=citrix.com=prvs=5573504fe=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qM8yk-0000ix-0L
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 15:20:38 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ce6303e4-2647-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 17:20:36 +0200 (CEST)
Received: from mail-dm6nam04lp2048.outbound.protection.outlook.com (HELO
 NAM04-DM6-obe.outbound.protection.outlook.com) ([104.47.73.48])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 19 Jul 2023 11:20:33 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SA0PR03MB5596.namprd03.prod.outlook.com (2603:10b6:806:b8::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Wed, 19 Jul
 2023 15:20:30 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 15:20:30 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ce6303e4-2647-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689780036;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=ozS7Tb4gGfmaSI5BHDlpBriK/I7iKRLIOMInolWXJZ4=;
  b=YCKV6OahP7mkYyiZk8Hs3Xrf/wjk4o/B4VFtvdm5/4vtXg2ni24m6yjl
   7dQDkbu6DMp+CrKAp0XdI6oH4q5Pe1vB3GNKtT6L/Ao0JDgszLGp14+Os
   6PZS/G1sAFjM3RHGNW6vkh0XxZ6IXaxKd6C/Lk81LwXwD3SQ00B92gkun
   Q=;
X-IronPort-RemoteIP: 104.47.73.48
X-IronPort-MID: 116626516
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:f88kTq1kkFbWpBKx8vbD5fRwkn2cJEfYwER7XKvMYLTBsI5bpzwBy
 TdKXj2DaffcYzb9coh+PYvi9kIF7J6DyIdmQAc+pC1hF35El5HIVI+TRqvS04F+DeWYFR46s
 J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo
 tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5gNnNKgR1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL
 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ
 OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfCkhr7
 vFAGBc0Uzegt/iZn7zkatBDv5F2RCXrFNt3VnBI6xj8VapjbbWdBqLA6JlfwSs6gd1IEbDGf
 c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxouC6PnGSd05C0WDbRUsaNSshP2F6Ru
 0rN/njjAwFcP9uaodaA2iv12LGVw36iBur+EpWUqOVyj0ao+1UXVhA9BQWSgfaygVSHDoc3x
 0s8v3BGQbIJ3E6hQ8T5Xha4iGWZpRNaUN1Ve8Ul7Cmdx6yS5ByWbkAUQzgEZNE4ucseQT0xy
 kTPj97vHSZosrCeVTSa7Lj8kN+pES0cLGtHaSpaSwIAu4XnuNtr0kKJSct/GqmoiNGzASv33
 z2BsCk5gfMUkNIP0KK4u1vAhlpAu6T0c+L83S2PNkrN0++zTNXNi1CAgbQD0ct9EQ==
IronPort-HdrOrdr: A9a23:E/T4mKw2iN8H2i5GTM5PKrPw1r1zdoMgy1knxilNoHxuH/BwWf
 rPoB17726RtN91YhsdcL+7V5VoLUmzyXcX2/h1AV7BZniEhILAFugLgbcKqweKJ8SUzJ8+6U
 4PSclD4N2bNykGsS75ijPIb+rJFrO8gd+VbeS19QYScelzAZsQiDuQkmygYzZLrA8tP+teKL
 OsovBpihCHYnotYsGyFhA+LpL+T42iruOeXfYebSRXkDWzsQ==
X-Talos-CUID: 9a23:jSBVg2E8OnzhMQjWqmJs3WsPF5gVVUTg61TgOWDnBzlJcZKsHAo=
X-Talos-MUID: 9a23:EbTyrgkptxhZag7L9uQvdnpOatxw7L+VNXkJz5gt65etFSN7MC2k2WE=
X-IronPort-AV: E=Sophos;i="6.01,216,1684814400"; 
   d="scan'208";a="116626516"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=H41xenTo4DTvoGt07uWsvBoLnU8psDvfQlj/jfwAYPp2X31m5r3MTCaWvFgx4sKI85LRI/n5Cvk4m/1O3ZlHYpMMfe4aHbVsfM8tZLOLtOeFXn55WnouQ+LRhf0V77v5dSpZwR/35/nqi4NiSccE4AKpS9KEXXnAgyf2pUxbc/tUquSVHcKPsN4anzOd6xJbg85MJNeEt0J4FozmmhrbpkE/JaeibbyKCVSxdSE+AnIFc+US/4RrgJW4TRn+lngwEc8O4OEiCcATTAeZEPZ4wd1YfRJbieTCYLbQAcZTV50TuXQzPzCyiphDMyrBRHeJ9mHEYCtgwiZ5YapjFb1QEw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=FD0RRnWoxDBvYsETeuXA8Jf8a3WiOG2ldK0TwrHFqUY=;
 b=eTbx5wuL76gXBh2548sHfQRgXCBNgmuhCta1LFlQszOpwFwFK84iM/uQH1UD0fpmIzSzdoGAgCwRkrHrGVAg7rBaeWWeNIjC7ENtAaeHZdpUmFac98LgZRz95sohH2ZqIA4kH/6XXVmqamedWBkjmNCcE/A+5UWJSrgqCH2+zFt/YNoyD3nFI/nVtPfJkqkG/IX2e96O3eMfYyvkBXo77f0TPtBXZPqIlIlGcMdtN6WWLINBcj5hi+d3QJIN0ntIcXWsRos9bzzxehG5ZTXVuAxV0G4Xj5qC/vxPmI657unFvxMXAmqMvOQYmW9ng3VoYrWY0nYrgE+tm9KprlWezg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=FD0RRnWoxDBvYsETeuXA8Jf8a3WiOG2ldK0TwrHFqUY=;
 b=e4XJzWu5qoOvVXu2noH62+TFdGoomo99kxL4O8Bt5NZt7pYI3IrA/3VMuhdd3QxO8lZl9BwYgS3VqqiG6x46vS6Flxkq+MXPnJFZoshjWu5ZJA7uAuCQWpsY8qyeou953Hr1+5vMgMJOAnJFmrNmO0pC88+4ycSGCjSVBa2V86Q=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Wed, 19 Jul 2023 17:20:24 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 2/5] x86/ioapic: RTE modifications must use
 ioapic_write_entry
Message-ID: <ZLf_OJnYjyirT7Ee@MacBook-Air-de-Roger.local>
References: <20230718124334.36548-1-roger.pau@citrix.com>
 <20230718124334.36548-3-roger.pau@citrix.com>
 <1bc67bb2-9b01-eb18-eb6a-741067a9b35c@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <1bc67bb2-9b01-eb18-eb6a-741067a9b35c@suse.com>
X-ClientProxiedBy: LO4P265CA0246.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:350::9) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA0PR03MB5596:EE_
X-MS-Office365-Filtering-Correlation-Id: 15f968f2-a3bd-4c2d-293a-08db886bb00d
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	18n9MiYi1OLbkl5WsnTRBO8GzCyBpSIr86hIS30Y6Xl/TDsJTHOvO8H9l3S1jq9LMEbmor5u2flfkBICyIlujn3Wdlvuse6BwXZrlsDU7jSguqk8tu2qmwLvQqPul8zb4YnQkK2jQBFOOVq+0RSzSMkV8f1tZ36mjzeKFVimFhfTJ5Z2lJbQU3kUCN3AaCbcOsZILlYomfq21Onhs3gbB70oo8qzXmkGDLbwd2L66b0PfGL399iv8qnAln8h6iWf3qXlsAxU67Nqt3ldVfG7QYs/dqGy807xZA/dIIB6Bi0/jU06XXaMwdjyfaYSNwyYSEGARcUprf2R1nLA11yTMQikFv1TiOTA8VF3JVQQp15korESZQoXK8r46vMkh5yDiQxO1AXk4100np2mPcLOr/jx7kvqc2zgMArE6/X8z4I31SYLYUa8DmJrdMnV3rCwmBcVBERzy/V/7KmxYtMv5jg0D2RBZRScxKbC+tA43GALqYTqVJ6dQluPzTPLRjr36rjd90z9hpmyaGV6VVoQE2ELoc7BhvELxM6I3CIfPkN+nHCr9Xa55G3i7A+j9727
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(346002)(376002)(396003)(136003)(451199021)(53546011)(54906003)(478600001)(66899021)(6666004)(9686003)(6512007)(6486002)(186003)(26005)(85182001)(6506007)(86362001)(41300700001)(6916009)(4326008)(316002)(66946007)(66556008)(66476007)(8936002)(8676002)(82960400001)(38100700002)(5660300002)(2906002)(83380400001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NktHamFXeDQvK1NGUlZySEhGZWxGK2ZaUURJZ2pZd1VFNmxBK0dTRmRLZWQ2?=
 =?utf-8?B?bCtFMUNjUFk1UEdSaEx5b0Y3STBQUkFWbTA3ekhYZ2ZSWWZ3Tit1a2hMR1N5?=
 =?utf-8?B?SUordkxKZStmOVpqQTFiaUpIbmJCNGdtVytZNytONUxvL2dyR0lEYUZQd0lC?=
 =?utf-8?B?ZU5IQS9yN285YmlrVFJhZzNpaHNtMkVrLzg1aWttUXcxaUt6MFhqU1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TWRE3HfZI5bP1Gkiyq2u1Gm+CC/zRsBgCcppYPdwQApY2iB3zU
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 15f968f2-a3bd-4c2d-293a-08db886bb00d
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 15:20:30.3126
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: LaIBHnHcKdD3sZyZbiIQj0StFOVhooumod6hihZBvuEZU/PXZHBc7Xl2O0FhVk766nwkU+QK1srPPbgXZMGFfA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR03MB5596

On Tue, Jul 18, 2023 at 05:40:18PM +0200, Jan Beulich wrote:
> On 18.07.2023 14:43, Roger Pau Monne wrote:
> > --- a/xen/arch/x86/io_apic.c
> > +++ b/xen/arch/x86/io_apic.c
> > @@ -269,15 +269,15 @@ void __ioapic_write_entry(
> >  {
> >      union entry_union eu = { .entry = e };
> >  
> > -    if ( raw )
> > +    if ( raw || !iommu_intremap )
> >      {
> >          __io_apic_write(apic, 0x11 + 2 * pin, eu.w2);
> >          __io_apic_write(apic, 0x10 + 2 * pin, eu.w1);
> >      }
> >      else
> >      {
> > -        io_apic_write(apic, 0x11 + 2 * pin, eu.w2);
> > -        io_apic_write(apic, 0x10 + 2 * pin, eu.w1);
> > +        iommu_update_ire_from_apic(apic, 0x11 + 2 * pin, eu.w2);
> > +        iommu_update_ire_from_apic(apic, 0x10 + 2 * pin, eu.w1);
> >      }
> >  }
> 
> I think __ioapic_read_entry() wants updating similarly, so that both
> remain consistent.

My plan was to deal with __ioapic_read_entry() separately, as I would
also like to convert iommu_read_apic_from_ire() to get passed a pin
instead of a register, but I could make your requested adjustment here
for consistency with __ioapic_write_entry().

> > @@ -433,16 +433,17 @@ static void modify_IO_APIC_irq(unsigned int irq, unsigned int enable,
> >                                 unsigned int disable)
> >  {
> >      struct irq_pin_list *entry = irq_2_pin + irq;
> > -    unsigned int pin, reg;
> >  
> >      for (;;) {
> > -        pin = entry->pin;
> > +        unsigned int pin = entry->pin;
> > +        struct IO_APIC_route_entry rte;
> > +
> >          if (pin == -1)
> >              break;
> > -        reg = io_apic_read(entry->apic, 0x10 + pin*2);
> > -        reg &= ~disable;
> > -        reg |= enable;
> > -        io_apic_modify(entry->apic, 0x10 + pin*2, reg);
> > +        rte = __ioapic_read_entry(entry->apic, pin, false);
> > +        rte.raw &= ~(uint64_t)disable;
> > +        rte.raw |= enable;
> > +        __ioapic_write_entry(entry->apic, pin, false, rte);
> 
> While this isn't going to happen overly often, ...
> 
> > @@ -584,16 +585,16 @@ set_ioapic_affinity_irq(struct irq_desc *desc, const cpumask_t *mask)
> >              dest = SET_APIC_LOGICAL_ID(dest);
> >          entry = irq_2_pin + irq;
> >          for (;;) {
> > -            unsigned int data;
> > +            struct IO_APIC_route_entry rte;
> > +
> >              pin = entry->pin;
> >              if (pin == -1)
> >                  break;
> >  
> > -            io_apic_write(entry->apic, 0x10 + 1 + pin*2, dest);
> > -            data = io_apic_read(entry->apic, 0x10 + pin*2);
> > -            data &= ~IO_APIC_REDIR_VECTOR_MASK;
> > -            data |= MASK_INSR(desc->arch.vector, IO_APIC_REDIR_VECTOR_MASK);
> > -            io_apic_modify(entry->apic, 0x10 + pin*2, data);
> > +            rte = __ioapic_read_entry(entry->apic, pin, false);
> > +            rte.dest.dest32 = dest;
> > +            rte.vector = desc->arch.vector;
> > +            __ioapic_write_entry(entry->apic, pin, false, rte);
> 
> ... this makes me wonder whether there shouldn't be an
> __ioapic_modify_entry() capable of suppressing one of the two
> writes (but still being handed the full RTE).

We would then need the original RTE to be passed to
__ioapic_modify_entry() in order for it to decide whether one of the
accesses can be eliminated (as I don't think we want to read the RTE
to check for differences, as we would then perform even more
accesses).

This would only be relevant for systems without IOMMU IRTEs, as
otherwise the IO-APIC RTE gets modified by the IOMMU handlers.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 15:47:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 15:47:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565942.884570 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM9P2-00043A-7b; Wed, 19 Jul 2023 15:47:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565942.884570; Wed, 19 Jul 2023 15:47:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM9P2-000432-4F; Wed, 19 Jul 2023 15:47:48 +0000
Received: by outflank-mailman (input) for mailman id 565942;
 Wed, 19 Jul 2023 15:47:46 +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 <SRS0=NouC=DF=suse.com=pmladek@srs-se1.protection.inumbo.net>)
 id 1qM9P0-00042j-Qg
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 15:47:46 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [2001:67c:2178:6::1c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 96b1ce42-264b-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 17:47:39 +0200 (CEST)
Received: from relay2.suse.de (relay2.suse.de [149.44.160.134])
 by smtp-out1.suse.de (Postfix) with ESMTP id 5738421BFF;
 Wed, 19 Jul 2023 15:47:38 +0000 (UTC)
Received: from suse.cz (unknown [10.100.208.146])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by relay2.suse.de (Postfix) with ESMTPS id D3B1D2C142;
 Wed, 19 Jul 2023 15:47:37 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 96b1ce42-264b-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1689781658; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=6hote0tCM3b928Stqa6vkJdgCZA0THIFFyoL6GFtx0s=;
	b=okcNIO/DpXcihXH+ltovT9WnMieI7BuKZoPyogR5derDll4aoOgKiXSOyrlUXgRiBqABMg
	OEKZkMxtg/IahPkxJT3bdtROMdGtQqu3lwtpV8sGEoMWBZcTZXc1H6mtAbFpM7rwdY355j
	Q7PYZiXghZPu9JiqnE5SXEZORegrvqw=
Date: Wed, 19 Jul 2023 17:47:37 +0200
From: Petr Mladek <pmladek@suse.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: boris.ostrovsky@oracle.com, jgross@suse.com,
	xen-devel@lists.xenproject.org, Luca Miccio <lucmiccio@gmail.com>,
	Stefano Stabellini <stefano.stabellini@xilinx.com>,
	live-patching@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH LINUX v5 2/2] xen: add support for initializing xenstore
 later as HVM domain
Message-ID: <ZLgFmS4TQwGWA7o0@alley>
References: <alpine.DEB.2.22.394.2205131417320.3842@ubuntu-linux-20-04-desktop>
 <20220513211938.719341-2-sstabellini@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20220513211938.719341-2-sstabellini@kernel.org>

On Fri 2022-05-13 14:19:38, Stefano Stabellini wrote:
> From: Luca Miccio <lucmiccio@gmail.com>
> 
> When running as dom0less guest (HVM domain on ARM) the xenstore event
> channel is available at domain creation but the shared xenstore
> interface page only becomes available later on.
> 
> In that case, wait for a notification on the xenstore event channel,
> then complete the xenstore initialization later, when the shared page
> is actually available.
> 
> The xenstore page has few extra field. Add them to the shared struct.
> One of the field is "connection", when the connection is ready, it is
> zero. If the connection is not-zero, wait for a notification.

I see the following warning from free_irq() in 6.5-rc2 when running
livepatching selftests. It does not happen after reverting this patch.

[  352.168453] livepatch: signaling remaining tasks
[  352.173228] ------------[ cut here ]------------
[  352.175563] Trying to free already-free IRQ 0
[  352.177355] WARNING: CPU: 1 PID: 88 at kernel/irq/manage.c:1893 free_irq+0xbf/0x350
[  352.179942] Modules linked in: test_klp_livepatch(EK)
[  352.181621] CPU: 1 PID: 88 Comm: xenbus_probe Kdump: loaded Tainted: G            E K    6.5.0-rc2-default+ #535
[  352.184754] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.15.0-0-g2dd4b9b-rebuilt.opensuse.org 04/01/2014
[  352.188214] RIP: 0010:free_irq+0xbf/0x350
[  352.192211] Code: 7a 08 75 0e e9 36 02 00 00 4c 3b 7b 08 74 5a 48 89 da 48 8b 5a 18 48 85 db 75 ee 44 89 f6 48 c7 c7 58 b0 8b 86 e8 21 0a f5 ff <0f> 0b 48 8b 34 24 4c 89 ef e8 53 bb e3 00 
48 8b 45 40 48 8b 40 78
[  352.200079] RSP: 0018:ffffaf0440b4be80 EFLAGS: 00010086
[  352.201465] RAX: 0000000000000000 RBX: ffff99f105116c80 RCX: 0000000000000003
[  352.203324] RDX: 0000000080000003 RSI: ffffffff8691d4bc RDI: 00000000ffffffff
[  352.204989] RBP: ffff99f100052000 R08: 0000000000000000 R09: c0000000ffff7fff
[  352.206253] R10: ffffaf0440b4bd18 R11: ffffaf0440b4bd10 R12: ffff99f1000521e8
[  352.207451] R13: ffff99f1000520a8 R14: 0000000000000000 R15: ffffffff86f42360
[  352.208787] FS:  0000000000000000(0000) GS:ffff99f15a400000(0000) knlGS:0000000000000000
[  352.210061] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  352.210815] CR2: 00007f8415d56000 CR3: 0000000105e36003 CR4: 0000000000370ee0
[  352.211867] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  352.212912] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  352.213951] Call Trace:
[  352.214390]  <TASK>
[  352.214717]  ? __warn+0x81/0x170
[  352.215436]  ? free_irq+0xbf/0x350
[  352.215906]  ? report_bug+0x10b/0x200
[  352.216408]  ? prb_read_valid+0x17/0x20
[  352.216926]  ? handle_bug+0x44/0x80
[  352.217409]  ? exc_invalid_op+0x13/0x60
[  352.217932]  ? asm_exc_invalid_op+0x16/0x20
[  352.218497]  ? free_irq+0xbf/0x350
[  352.218979]  ? __pfx_xenbus_probe_thread+0x10/0x10
[  352.219600]  xenbus_probe+0x7a/0x80
[  352.221030]  xenbus_probe_thread+0x76/0xc0
[  352.221416]  ? __pfx_autoremove_wake_function+0x10/0x10
[  352.221882]  kthread+0xfd/0x130
[  352.222191]  ? __pfx_kthread+0x10/0x10
[  352.222544]  ret_from_fork+0x2d/0x50
[  352.222893]  ? __pfx_kthread+0x10/0x10
[  352.223260]  ret_from_fork_asm+0x1b/0x30
[  352.223629] RIP: 0000:0x0
[  352.223931] Code: Unable to access opcode bytes at 0xffffffffffffffd6.
[  352.224488] RSP: 0000:0000000000000000 EFLAGS: 00000000 ORIG_RAX: 0000000000000000
[  352.225044] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
[  352.225571] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
[  352.226106] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
[  352.226632] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
[  352.227171] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
[  352.227710]  </TASK>
[  352.227917] irq event stamp: 22
[  352.228209] hardirqs last  enabled at (21): [<ffffffff854240be>] ___slab_alloc+0x68e/0xc80
[  352.228914] hardirqs last disabled at (22): [<ffffffff85fe98fd>] _raw_spin_lock_irqsave+0x8d/0x90
[  352.229546] softirqs last  enabled at (0): [<ffffffff850fc0ee>] copy_process+0xaae/0x1fd0
[  352.230079] softirqs last disabled at (0): [<0000000000000000>] 0x0
[  352.230503] ---[ end trace 0000000000000000 ]---

, where the message "livepatch: signaling remaining tasks" means that
it might send fake signals to non-kthread tasks.

The aim is to force userspace tasks to enter and leave kernel space
so that they might start using the new patched code. It is done
this way:

/*
 * Sends a fake signal to all non-kthread tasks with TIF_PATCH_PENDING set.
 * Kthreads with TIF_PATCH_PENDING set are woken up.
 */
static void klp_send_signals(void)
{
[...]

			/*
			 * Send fake signal to all non-kthread tasks which are
			 * still not migrated.
			 */
			set_notify_signal(task);
[...]

The warning is most likely printed in this condition:

const void *free_irq(unsigned int irq, void *dev_id)
{
	struct irq_desc *desc = irq_to_desc(irq);
	struct irqaction *action;
	const char *devname;

	if (!desc || WARN_ON(irq_settings_is_per_cpu_devid(desc)))
		return NULL;


See below.

> --- a/drivers/xen/xenbus/xenbus_probe.c
> +++ b/drivers/xen/xenbus/xenbus_probe.c
> @@ -750,6 +751,20 @@ static void xenbus_probe(void)
>  {
>  	xenstored_ready = 1;
>  
> +	if (!xen_store_interface) {
> +		xen_store_interface = xen_remap(xen_store_gfn << XEN_PAGE_SHIFT,
> +						XEN_PAGE_SIZE);
> +		/*
> +		 * Now it is safe to free the IRQ used for xenstore late
> +		 * initialization. No need to unbind: it is about to be
> +		 * bound again from xb_init_comms. Note that calling
> +		 * unbind_from_irqhandler now would result in xen_evtchn_close()
> +		 * being called and the event channel not being enabled again
> +		 * afterwards, resulting in missed event notifications.
> +		 */
> +		free_irq(xs_init_irq, &xb_waitq);

Is it possbile that this free_irq(), the fake signal, and the warning
are somehow related, please?

> +	}
> +
>  	/*
>  	 * In the HVM case, xenbus_init() deferred its call to
>  	 * xs_init() in case callbacks were not operational yet.

Best Regards,
Petr


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 15:57:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 15:57:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565946.884580 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM9YZ-00067p-3x; Wed, 19 Jul 2023 15:57:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565946.884580; Wed, 19 Jul 2023 15:57:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM9YZ-00067i-1D; Wed, 19 Jul 2023 15:57:39 +0000
Received: by outflank-mailman (input) for mailman id 565946;
 Wed, 19 Jul 2023 15:57:37 +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
 <SRS0=K8L3=DF=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qM9YX-00067c-Ae
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 15:57:37 +0000
Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com
 [2001:4860:4864:20::2c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f8f66a22-264c-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 17:57:33 +0200 (CEST)
Received: by mail-oa1-x2c.google.com with SMTP id
 586e51a60fabf-1b0156a1c49so5354950fac.0
 for <xen-devel@lists.xenproject.org>; Wed, 19 Jul 2023 08:57:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f8f66a22-264c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689782252; x=1690387052;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=svetkbUc1rTQYh6Z0Ofw6Rk/aQhd8hKQb+XXFFjwwrA=;
        b=LSsNqzmbjJmJRRm5Asej15BsJ6jP2fhwNe28as1vXwmebqIM1dvVUgPtc7cP6hDqwZ
         IvsPslTNkoHsy76hUOAnbnSXdKrX4CVD3gSPf0x6aakfB7Ce5GR2MZqFc8el6qMaCuFT
         92AI4FRkpWOo3R1C6Ritlx3ok1pvfTEsjRhi4h3ABCU9B7UP3LrHWnEGMktBCosRih7s
         6NXjWiHPu90PiFYR6uFKDoSq620y6ONZnNKMKvrNbylFwdo1ai4zyk6amL/0C4sxo4Em
         fHnW5UagI2pDj2PGE2l2O2R1MYW1ccdSb+LcTouLjcBhzPzj56rMTXrdoG88Xf1rqXzP
         x62A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689782252; x=1690387052;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=svetkbUc1rTQYh6Z0Ofw6Rk/aQhd8hKQb+XXFFjwwrA=;
        b=S8RrzVGO2/XH81AIJepvmJCqfFyjrU13BT870mrC/gnrbJDPaa0+LRlQ6DJFtVINJH
         1cHeHS8oaI0oxz0oGnw9q4upq1YIpTvr3tZ6y05q4mp9kfHVapyO43aMpGvi0YrwVjAb
         4VUGzHl/fVZD0XwtZOaxKH/xF+4nE1LAn+0/fhT+gYeLCYC0YuxLE22sALFNE7TvksWH
         k9Bypg6lLYVMMcrrDiW2vctnoPdyPe9/XZOVqxxrmQuujaWM9C33p3S10IfkXYPTv8tS
         3WFU6COrnkRNZmDoJFzzTMuEq/Pry/trnBKZw6z0g6TBUZEXYK25dilmTT+U6DXcY1ms
         ZZjQ==
X-Gm-Message-State: ABy/qLba1luJWGOZNTxRl6ceg8omu69AbUtkcMXOKOIlDNtPEmpQdq/e
	bEIe6/pX6QXVNPqokbOKKn+j+dfN2B3zOqs2gBdZZg==
X-Google-Smtp-Source: APBJJlE7faV8k8I/dHWo//rId4KWKE211+9wKED+v1djAdWFvCeIcBGM7hSzpvZQikRx+TSg0wOQNiRYio8NaVk10hs=
X-Received: by 2002:a05:6870:3929:b0:1b0:48aa:e0a9 with SMTP id
 b41-20020a056870392900b001b048aae0a9mr2949187oap.3.1689782252561; Wed, 19 Jul
 2023 08:57:32 -0700 (PDT)
MIME-Version: 1.0
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-21-jens.wiklander@linaro.org> <8304EFA9-FA48-4823-B7B0-11311351592B@arm.com>
In-Reply-To: <8304EFA9-FA48-4823-B7B0-11311351592B@arm.com>
From: Jens Wiklander <jens.wiklander@linaro.org>
Date: Wed, 19 Jul 2023 17:57:21 +0200
Message-ID: <CAHUa44HSQ1nE8cKyUPwR6RS5-O=M7dhFtbFgUCpCpXEx1KHj4Q@mail.gmail.com>
Subject: Re: [XEN PATCH v10 20/24] xen/arm: ffa: support sharing large memory ranges
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, 
	Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>, 
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici <Marc.Bonnici@arm.com>, 
	Achin Gupta <Achin.Gupta@arm.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Bertrand,

On Wed, Jul 19, 2023 at 11:37=E2=80=AFAM Bertrand Marquis
<Bertrand.Marquis@arm.com> wrote:
>
> Hi Jens,
>
> > On 17 Jul 2023, at 09:21, Jens Wiklander <jens.wiklander@linaro.org> wr=
ote:
> >
> > Adds support for sharing large memory ranges transmitted in fragments
> > using FFA_MEM_FRAG_TX.
> >
> > The implementation is the bare minimum to be able to communicate with
> > OP-TEE running as an SPMC at S-EL1.
> >
> > Adds a check that the SP supports the needed FF-A feature
> > FFA_MEM_FRAG_TX.
> >
> > Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> > ---
> > xen/arch/arm/tee/ffa.c | 253 ++++++++++++++++++++++++++++++++++++++---
> > 1 file changed, 240 insertions(+), 13 deletions(-)
> >
> > diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> > index c623c51168b9..ac23b9edc74c 100644
> > --- a/xen/arch/arm/tee/ffa.c
> > +++ b/xen/arch/arm/tee/ffa.c
> > @@ -359,6 +359,8 @@ struct ffa_ctx {
> >      */
> >     uint16_t create_signal_count;
> >     bool rx_is_free;
> > +    /* Currently used fragment states, struct mem_frag_state */
> > +    struct list_head frag_list;
> >     /* Used shared memory objects, struct ffa_shm_mem */
> >     struct list_head shm_list;
> >     /* Number of allocated shared memory object */
> > @@ -375,6 +377,18 @@ struct ffa_shm_mem {
> >     struct page_info *pages[];
> > };
> >
> > +struct mem_frag_state {
> > +    struct list_head list;
> > +    struct ffa_shm_mem *shm;
> > +    uint32_t range_count;
> > +    unsigned int current_page_idx;
> > +    unsigned int frag_offset;
> > +    unsigned int range_offset;
> > +    const uint8_t *buf;
> > +    unsigned int buf_size;
> > +    struct ffa_address_range range;
> > +};
>
> Please add some comments inside this structure as
> from reading the code it is not quite clear what is done.

OK

>
> > +
> > /* Negotiated FF-A version to use with the SPMC */
> > static uint32_t __ro_after_init ffa_version;
> >
> > @@ -538,6 +552,36 @@ static int32_t ffa_mem_share(uint32_t tot_len, uin=
t32_t frag_len,
> >     }
> > }
> >
> > +static int32_t ffa_mem_frag_tx(uint64_t handle, uint32_t frag_len,
> > +                               uint16_t sender_id)
> > +{
> > +    struct arm_smccc_1_2_regs arg =3D {
> > +        .a0 =3D FFA_MEM_FRAG_TX,
> > +        .a1 =3D handle & UINT32_MAX,
> > +        .a2 =3D handle >> 32,
> > +        .a3 =3D frag_len,
> > +        .a4 =3D (uint32_t)sender_id << 16,
> > +    };
> > +    struct arm_smccc_1_2_regs resp;
> > +
> > +    arm_smccc_1_2_smc(&arg, &resp);
> > +
> > +    switch ( resp.a0 )
> > +    {
> > +    case FFA_ERROR:
> > +        if ( resp.a2 )
> > +            return resp.a2;
> > +        else
> > +            return FFA_RET_NOT_SUPPORTED;
> > +    case FFA_SUCCESS_32:
> > +        return FFA_RET_OK;
> > +    case FFA_MEM_FRAG_RX:
> > +        return resp.a3;
> > +    default:
> > +            return FFA_RET_NOT_SUPPORTED;
> > +    }
> > +}
> > +
> > static int32_t ffa_mem_reclaim(uint32_t handle_lo, uint32_t handle_hi,
> >                                uint32_t flags)
> > {
> > @@ -627,6 +671,14 @@ static void set_regs_success(struct cpu_user_regs =
*regs, uint32_t w2,
> >     set_regs(regs, FFA_SUCCESS_32, 0, w2, w3, 0, 0, 0, 0);
> > }
> >
> > +static void set_regs_frag_rx(struct cpu_user_regs *regs, uint32_t hand=
le_lo,
> > +                             uint32_t handle_hi, uint32_t frag_offset,
> > +                             uint16_t sender_id)
> > +{
> > +    set_regs(regs, FFA_MEM_FRAG_RX, handle_lo, handle_hi, frag_offset,
> > +             (uint32_t)sender_id << 16, 0, 0, 0);
> > +}
> > +
> > static void handle_version(struct cpu_user_regs *regs)
> > {
> >     struct domain *d =3D current->domain;
> > @@ -999,6 +1051,8 @@ static int share_shm(struct ffa_shm_mem *shm)
> >     paddr_t last_pa;
> >     unsigned int n;
> >     paddr_t pa;
> > +    bool first;
> > +    int ret;
> >
> >     ASSERT(spin_is_locked(&ffa_tx_buffer_lock));
> >     ASSERT(shm->page_count);
> > @@ -1034,13 +1088,23 @@ static int share_shm(struct ffa_shm_mem *shm)
> >
> >     tot_len =3D ADDR_RANGE_OFFSET(descr->mem_access_count, region_count=
,
> >                                 region_descr->address_range_count);
> > -    if ( tot_len > max_frag_len )
> > -        return FFA_RET_NOT_SUPPORTED;
> >
> > +    /*
> > +     * Sharing memory with secure world may have to be done with multi=
ple
> > +     * calls depending on how many address ranges will be needed. If w=
e're
> > +     * sharing physically contiguous memory we will only need one rang=
e but
> > +     * we will also need to deal with the worst case where all physica=
l
> > +     * pages are non-contiguous. For the first batch of address ranges=
 we
> > +     * call ffa_mem_share() and for all that follows ffa_mem_frag_tx()=
.
> > +     *
> > +     * We use frag_len to keep track of how far into the transmit buff=
er we
> > +     * have gone.
> > +     */
> >     addr_range =3D region_descr->address_range_array;
> >     frag_len =3D ADDR_RANGE_OFFSET(descr->mem_access_count, region_coun=
t, 1);
> >     last_pa =3D page_to_maddr(shm->pages[0]);
> >     init_range(addr_range, last_pa);
> > +    first =3D true;
> >     for ( n =3D 1; n < shm->page_count; last_pa =3D pa, n++ )
> >     {
> >         pa =3D page_to_maddr(shm->pages[n]);
> > @@ -1050,12 +1114,34 @@ static int share_shm(struct ffa_shm_mem *shm)
> >             continue;
> >         }
> >
> > -        frag_len +=3D sizeof(*addr_range);
> > -        addr_range++;
> > +        if ( frag_len =3D=3D max_frag_len )
>
> This test seem a bit dangerous as there is nothing ensuring that frag_len=
 will end
> up aligned to a page.

flag_len is always a multiple of 16

>
> I would suggest here to do frag_len + sizeof(*addr_range) > max_frag_len =
to check
> if we can fit or not an extra address range in the area.

If we have that check instead, then I'm not sure what we should do
with the part that doesn't belong there.

>
>
> > +        {
> > +            if ( first )
> > +            {
> > +                ret =3D ffa_mem_share(tot_len, frag_len, 0, 0, &shm->h=
andle);
> > +                first =3D false;
> > +            }
> > +            else
> > +            {
> > +                ret =3D ffa_mem_frag_tx(shm->handle, frag_len, shm->se=
nder_id);
> > +            }
> > +            if ( ret <=3D 0 )
> > +                return ret;
> > +            frag_len =3D sizeof(*addr_range);
> > +            addr_range =3D buf;
> > +        }
> > +        else
> > +        {
> > +            frag_len +=3D sizeof(*addr_range);
> > +            addr_range++;
> > +        }
> >         init_range(addr_range, pa);
> >     }
> >
> > -    return ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
> > +    if ( first )
> > +        return ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
> > +    else
> > +        return ffa_mem_frag_tx(shm->handle, frag_len, shm->sender_id);
> > }
> >
> > static int read_mem_transaction(uint32_t ffa_vers, const void *buf, siz=
e_t blen,
> > @@ -1132,8 +1218,53 @@ static int read_mem_transaction(uint32_t ffa_ver=
s, const void *buf, size_t blen,
> >     return 0;
> > }
> >
> > +static int add_mem_share_frag(struct mem_frag_state *s, unsigned int o=
ffs,
> > +                              unsigned int frag_len)
> > +{
> > +    struct domain *d =3D current->domain;
> > +    unsigned int o =3D offs;
> > +    unsigned int l;
> > +    int ret;
> > +
> > +    if ( frag_len < o )
> > +        return FFA_RET_INVALID_PARAMETERS;
> > +
> > +    /* Fill up the first struct ffa_address_range */
>
> The magic here after requires some explanation, could you add more detail=
s in
> the comment ?

OK

>
> > +    l =3D min_t(unsigned int, frag_len - o, sizeof(s->range) - s->rang=
e_offset);
> > +    memcpy((uint8_t *)&s->range + s->range_offset, s->buf + o, l);
> > +    s->range_offset +=3D l;
> > +    o +=3D l;
> > +    if ( s->range_offset !=3D sizeof(s->range) )
> > +        goto out;
>
> Shouldn't we test this before doing the memcpy ?
> Is this an error case ?

No, it's an unusually small fragment but not necessarily an error.

> What is the expected frag_offset value here ?

That depends, usually, I'd expect it to be a multiple of 4k, but the
caller can use different fragment lengths.

>
>
> > +    s->range_offset =3D 0;
> > +
> > +    while ( true )
> > +    {
> > +        ret =3D get_shm_pages(d, s->shm, &s->range, 1, s->current_page=
_idx,
> > +                            &s->current_page_idx);
> > +        if ( ret )
> > +            return ret;
> > +        if ( s->range_count =3D=3D 1 )
> > +            return 0;
> > +        s->range_count--;
> > +        if ( frag_len - o < sizeof(s->range) )
> > +            break;
> > +        memcpy(&s->range, s->buf + o, sizeof(s->range));
> > +        o +=3D sizeof(s->range);
> > +    }
> > +
> > +    /* Collect any remaining bytes for the next struct ffa_address_ran=
ge */
> > +    s->range_offset =3D frag_len - o;
> > +    memcpy(&s->range, s->buf + o, frag_len - o);
> > +out:
> > +    s->frag_offset +=3D frag_len;
> > +
> > +    return s->frag_offset;
> > +}
>
> Overall the processing in this function is not quite clear so we either n=
eed
> to add comments to explain it more or find a better way to implement to m=
ake
> it a bit clearer.
>
> The implementation for fragmented memory sharing requests here is very
> complex and I am not quite feeling confident that it does not contains bu=
gs.

Yeah, I had to debug it a few time before I got it to work. This is
one of the more complicated parts of the specification.

>
> As this is not something required to have optee support, I would suggest =
to
> discard this part for now in the support.
>
> What do you think ?

Sure, we can skip it for now. I'll remove it from the next version of
the patch set.

Thanks,
Jens

>
> Cheers
> Bertrand
>
> > +
> > static void handle_mem_share(struct cpu_user_regs *regs)
> > {
> > +    static uint64_t next_handle =3D FFA_HANDLE_HYP_FLAG;
> >     uint32_t tot_len =3D get_user_reg(regs, 1);
> >     uint32_t frag_len =3D get_user_reg(regs, 2);
> >     uint64_t addr =3D get_user_reg(regs, 3);
> > @@ -1168,13 +1299,6 @@ static void handle_mem_share(struct cpu_user_reg=
s *regs)
> >         goto out_set_ret;
> >     }
> >
> > -    /* We currently only support a single fragment */
> > -    if ( frag_len !=3D tot_len )
> > -    {
> > -        ret =3D FFA_RET_NOT_SUPPORTED;
> > -        goto out_set_ret;
> > -    }
> > -
> >     spin_lock(&ctx->lock);
> >
> >     if ( frag_len > ctx->page_count * FFA_PAGE_SIZE )
> > @@ -1240,6 +1364,36 @@ static void handle_mem_share(struct cpu_user_reg=
s *regs)
> >     shm->sender_id =3D trans.sender_id;
> >     shm->ep_id =3D read_atomic(&mem_access->access_perm.endpoint_id);
> >
> > +    if ( frag_len !=3D tot_len )
> > +    {
> > +        struct mem_frag_state *s =3D xzalloc(struct mem_frag_state);
> > +
> > +        if ( !s )
> > +        {
> > +            ret =3D FFA_RET_NO_MEMORY;
> > +            goto out;
> > +        }
> > +        s->shm =3D shm;
> > +        s->range_count =3D range_count;
> > +        s->buf =3D ctx->tx;
> > +        s->buf_size =3D FFA_RXTX_PAGE_COUNT * FFA_PAGE_SIZE;
> > +        ret =3D add_mem_share_frag(s, sizeof(*region_descr)  + region_=
offs,
> > +                                 frag_len);
> > +        if ( ret <=3D 0 )
> > +        {
> > +            xfree(s);
> > +            if ( ret < 0 )
> > +                goto out;
> > +        }
> > +        else
> > +        {
> > +            shm->handle =3D next_handle++;
> > +            uint64_to_regpair(&handle_hi, &handle_lo, shm->handle);
> > +            list_add_tail(&s->list, &ctx->frag_list);
> > +        }
> > +        goto out_unlock;
> > +    }
> > +
> >     /*
> >      * Check that the Composite memory region descriptor fits.
> >      */
> > @@ -1278,7 +1432,75 @@ out_unlock:
> >     spin_unlock(&ctx->lock);
> >
> > out_set_ret:
> > -    if ( ret =3D=3D 0)
> > +    if ( ret > 0 )
> > +            set_regs_frag_rx(regs, handle_lo, handle_hi, ret, trans.se=
nder_id);
> > +    else if ( ret =3D=3D 0)
> > +            set_regs_success(regs, handle_lo, handle_hi);
> > +    else
> > +            set_regs_error(regs, ret);
> > +}
> > +
> > +static struct mem_frag_state *find_frag_state(struct ffa_ctx *ctx,
> > +                                              uint64_t handle)
> > +{
> > +    struct mem_frag_state *s;
> > +
> > +    list_for_each_entry(s, &ctx->frag_list, list)
> > +        if ( s->shm->handle =3D=3D handle )
> > +            return s;
> > +
> > +    return NULL;
> > +}
> > +
> > +static void handle_mem_frag_tx(struct cpu_user_regs *regs)
> > +{
> > +    struct domain *d =3D current->domain;
> > +    struct ffa_ctx *ctx =3D d->arch.tee;
> > +    uint32_t frag_len =3D get_user_reg(regs, 3);
> > +    uint32_t handle_lo =3D get_user_reg(regs, 1);
> > +    uint32_t handle_hi =3D get_user_reg(regs, 2);
> > +    uint64_t handle =3D regpair_to_uint64(handle_hi, handle_lo);
> > +    struct mem_frag_state *s;
> > +    uint16_t sender_id =3D 0;
> > +    int ret;
> > +
> > +    spin_lock(&ctx->lock);
> > +    s =3D find_frag_state(ctx, handle);
> > +    if ( !s )
> > +    {
> > +        ret =3D FFA_RET_INVALID_PARAMETERS;
> > +        goto out;
> > +    }
> > +    sender_id =3D s->shm->sender_id;
> > +
> > +    if ( frag_len > s->buf_size )
> > +    {
> > +        ret =3D FFA_RET_INVALID_PARAMETERS;
> > +        goto out_free_s;
> > +    }
> > +
> > +    ret =3D add_mem_share_frag(s, 0, frag_len);
> > +    if ( ret < 0 )
> > +        goto out_free_s;
> > +
> > +    /* Note that share_shm() uses our tx buffer */
> > +    spin_lock(&ffa_tx_buffer_lock);
> > +    ret =3D share_shm(s->shm);
> > +    spin_unlock(&ffa_tx_buffer_lock);
> > +    if ( ret < 0 )
> > +        goto out_free_s;
> > +    list_add_tail(&s->shm->list, &ctx->shm_list);
> > +out_free_s:
> > +    if ( ret < 0 )
> > +        free_ffa_shm_mem(ctx, s->shm);
> > +    list_del(&s->list);
> > +    xfree(s);
> > +out:
> > +    spin_unlock(&ctx->lock);
> > +
> > +    if ( ret > 0 )
> > +            set_regs_frag_rx(regs, handle_lo, handle_hi, ret, sender_i=
d);
> > +    else if ( ret =3D=3D 0)
> >             set_regs_success(regs, handle_lo, handle_hi);
> >     else
> >             set_regs_error(regs, ret);
> > @@ -1391,6 +1613,9 @@ static bool ffa_handle_call(struct cpu_user_regs =
*regs)
> >         else
> >             set_regs_success(regs, 0, 0);
> >         return true;
> > +    case FFA_MEM_FRAG_TX:
> > +        handle_mem_frag_tx(regs);
> > +        return true;
> >
> >     default:
> >         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
> > @@ -1432,6 +1657,7 @@ static int ffa_domain_init(struct domain *d)
> >     }
> >     ctx->create_signal_count =3D n;
> >
> > +    INIT_LIST_HEAD(&ctx->frag_list);
> >     INIT_LIST_HEAD(&ctx->shm_list);
> >
> >     return 0;
> > @@ -1625,6 +1851,7 @@ static bool ffa_probe(void)
> >          !check_mandatory_feature(FFA_MEM_SHARE_64) ||
> >          !check_mandatory_feature(FFA_RXTX_UNMAP) ||
> >          !check_mandatory_feature(FFA_MEM_SHARE_32) ||
> > +         !check_mandatory_feature(FFA_MEM_FRAG_TX) ||
> >          !check_mandatory_feature(FFA_MEM_RECLAIM) ||
> >          !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
> >         return false;
> > --
> > 2.34.1
> >
>


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 16:03:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 16:03:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565953.884598 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM9dx-0008HD-UI; Wed, 19 Jul 2023 16:03:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565953.884598; Wed, 19 Jul 2023 16:03:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM9dx-0008H6-RU; Wed, 19 Jul 2023 16:03:13 +0000
Received: by outflank-mailman (input) for mailman id 565953;
 Wed, 19 Jul 2023 16:03:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qM9dx-0008Gw-94; Wed, 19 Jul 2023 16:03:13 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qM9dx-0007UX-7P; Wed, 19 Jul 2023 16:03:13 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qM9dw-0005Gv-Rr; Wed, 19 Jul 2023 16:03:12 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qM9dw-0003ct-RS; Wed, 19 Jul 2023 16:03:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=z1iiqpDIsrgMsSPC6CRpdpad4GXPLxbKOUyCKjEdbtk=; b=mI02fo2Jarnu+vFAn1mOFzfjsT
	A2ucQpRF0UbG7noz2z4r77wpF0L6hR73i1eJuVby6782S9H9vVqNcJRF/k2u76rCOGMnTc12YwaFI
	/+apoBw72Z06WGCykRO5zM1WK0oy/Eqfrwsjr/VZVF285qwa+CYNVXgKqFK8/e0Lz0hg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181882-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.16-testing test] 181882: tolerable trouble: fail/pass/starved - PUSHED
X-Osstest-Failures:
    xen-4.16-testing:test-amd64-i386-xl-qemuu-ws16-amd64:xen-install:fail:heisenbug
    xen-4.16-testing:test-amd64-i386-libvirt:xen-install:fail:heisenbug
    xen-4.16-testing:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt:hosts-allocate:starved:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt-qcow2:hosts-allocate:starved:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt-raw:hosts-allocate:starved:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl:hosts-allocate:starved:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-vhd:hosts-allocate:starved:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-arndale:hosts-allocate:starved:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-multivcpu:hosts-allocate:starved:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-rtds:hosts-allocate:starved:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-credit1:hosts-allocate:starved:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-credit2:hosts-allocate:starved:nonblocking
X-Osstest-Versions-This:
    xen=78f53920f406fe973bb70011ae36d6a53abf6942
X-Osstest-Versions-That:
    xen=2b12f64f87b326e9434b09f249af5e8b1e287e24
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 19 Jul 2023 16:03:12 +0000

flight 181882 xen-4.16-testing real [real]
flight 181900 xen-4.16-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181882/
http://logs.test-lab.xenproject.org/osstest/logs/181900/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-xl-qemuu-ws16-amd64  7 xen-install  fail pass in 181900-retest
 test-amd64-i386-libvirt       7 xen-install         fail pass in 181900-retest

Tests which did not succeed, but are not blocking:
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop   fail in 181900 like 181851
 test-amd64-i386-libvirt     15 migrate-support-check fail in 181900 never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181851
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181851
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181851
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181851
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181851
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181851
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181851
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181851
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt      3 hosts-allocate               starved  n/a
 test-armhf-armhf-libvirt-qcow2  3 hosts-allocate               starved  n/a
 test-armhf-armhf-libvirt-raw  3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl           3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-vhd       3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-arndale   3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-multivcpu  3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-rtds      3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-credit1   3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-credit2   3 hosts-allocate               starved  n/a

version targeted for testing:
 xen                  78f53920f406fe973bb70011ae36d6a53abf6942
baseline version:
 xen                  2b12f64f87b326e9434b09f249af5e8b1e287e24

Last test of basis   181851  2023-07-17 16:41:30 Z    1 days
Testing same since   181882  2023-07-18 14:43:22 Z    1 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Anthony PERARD <anthony.perard@citrix.com>
  Jan Beulich <jbeulich@suse.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          starved 
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  starved 
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  starved 
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  starved 
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     starved 
 test-amd64-i386-libvirt                                      fail    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                starved 
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               starved 
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 starved 
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     starved 
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      starved 
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   2b12f64f87..78f53920f4  78f53920f406fe973bb70011ae36d6a53abf6942 -> stable-4.16


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 16:06:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 16:06:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565958.884607 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM9hK-0000Sj-Dd; Wed, 19 Jul 2023 16:06:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565958.884607; Wed, 19 Jul 2023 16:06:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM9hK-0000Sc-AW; Wed, 19 Jul 2023 16:06:42 +0000
Received: by outflank-mailman (input) for mailman id 565958;
 Wed, 19 Jul 2023 16:06:41 +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
 <SRS0=KnqJ=DF=citrix.com=prvs=5573504fe=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qM9hJ-0000SF-Ja
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 16:06:41 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3d04c11a-264e-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 18:06:38 +0200 (CEST)
Received: from mail-mw2nam04lp2170.outbound.protection.outlook.com (HELO
 NAM04-MW2-obe.outbound.protection.outlook.com) ([104.47.73.170])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 19 Jul 2023 12:06:35 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by BY5PR03MB5186.namprd03.prod.outlook.com (2603:10b6:a03:221::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Wed, 19 Jul
 2023 16:06:33 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023
 16:06:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3d04c11a-264e-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689782798;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=GENVvQZWeuPiNFMDhWJbVl9VbwXhyOoc7JxkXle6YDU=;
  b=GgKyYdw5Gc/jxO3HIC4Bo90Dcn25yE7jXJec+yzvn4YQnV5mGxWWqJbn
   lBMUTWMhE+NeAD2zhEiA72b/Rn/+0Ruh/lOODzsVSF1w5BBTtdSc0IZJE
   J395wVG6jQDXJnPA5taYK7O+0Q6oPZbt1HDNY9OV3RZJZxdH0bkhCf+h2
   I=;
X-IronPort-RemoteIP: 104.47.73.170
X-IronPort-MID: 116632608
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: R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uytHSuQ4L9QYOcekXA5sQiDuRcjzrcXGeszM2YabRva
 Dsg/Z6mw==
X-Talos-CUID: 9a23:JG0LpGAaWlFUn0/6ExNh33EOOuwVSHfAi2bTZHXnDmJmWrLAHA==
X-Talos-MUID: 9a23:GheKoApM//Ett/DKIssezwBhb/9u74GTMR0miJo5vtLZaXxoCSjI2Q==
X-IronPort-AV: E=Sophos;i="6.01,216,1684814400"; 
   d="scan'208";a="116632608"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=i+8SAMUVju0Ti7penZQRQh5E/DZm4Sp40O1Wcine6qk2yv1EF2tp3R0CQr8WskWzJyyWIMbonSDkbUkZNZM3DhRQ7oFhcwpHimgGBexM2gfM6X4jgBNGbeD+QkMtnZrKkxRoMK8n6PHdGKxzSJWMXzAF6xVq7GXnGuLZ3S8p9cShxXjzoOngG/AyrXsvE61DSajtKm4fzgOrvx5Iz8/tytTX0cuGWkj6UzI/X+sE1PugMr/USvdzaKGUbUH7EC5z1V0LYdxl+VI89mnxQd5/JMsMGYOlxdr1rKoiN5WBC6UasQ+sflh5xRVpLcAd4VSHCFLk+NQAaHWOPboMXJOagg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=32viBMl9EE/KLt7NqlmidMJwmBBTveQsFg2kp5PX+2g=;
 b=D4tFVEiq6grkyoOg3SRGZeXgAJz+0MEO/P+vciTw6lfoHYHoWHuQMQ1LVv67F1RrR9II20hdR/gVFGO/Do2cLXJafOfeSCECHw08Sr42pnNsEF8yDTh/tm5GyhxXl8e116zERpswUdjV0F+eIBilfgB0Bc2jq8VoGvtKfeAi0xY6PAxsNPXpG0ZKw9U0Bk4muCsr1yNhqUFHkK9G1/E8NP6pJxCaR+hAuI4X6RtsULLH/hdHcIMZMQDyZgWDoeOD05kMNr3AOtG/X319+2W0B4GZd314lujhhtnck7dLKqmS4goIaOshTNI5TXBw2leTrASHcskSYdpTKHCottjm6w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=32viBMl9EE/KLt7NqlmidMJwmBBTveQsFg2kp5PX+2g=;
 b=eYCWMVeu6wqRT34HT6pKqfwk6TfJ4QrpUd2LGaWenjTN95ibi9emaXx1i2j+P+f+WjaO1cxNv7Iz+ue1gdYr5yvu/u4WRRMjZbUE2Bf2oFWkqoHpei3vGEa0LFtrHJgZvDeiWbGt3uAwTtFJKSBNbjNBs1NqraCbOGP5XEDx3xc=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Wed, 19 Jul 2023 18:06:28 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 5/5] amd/iommu: force atomic updates of remapping
 entries
Message-ID: <ZLgKBKdVh_Z6i4e7@MacBook-Air-de-Roger.local>
References: <20230718124334.36548-1-roger.pau@citrix.com>
 <20230718124334.36548-6-roger.pau@citrix.com>
 <824bb5f9-7bf7-9482-ca35-e4d1019ea7bf@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <824bb5f9-7bf7-9482-ca35-e4d1019ea7bf@suse.com>
X-ClientProxiedBy: LO4P265CA0192.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:311::20) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|BY5PR03MB5186:EE_
X-MS-Office365-Filtering-Correlation-Id: a9b1a8d2-b770-4b05-312f-08db88721f4a
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	yPStdQNB2a7NdSiSnRr/yBohFmX4MivfD1CDAnmPQHJ3AulZezlU+5faDXAEiCLPo3ZgWePHMDofOlpj9QhhocOwiypCArssqzFUdL+vOIUYCfpIuTK7bESv5VTkuSdbOJCHUTjQLebQHEPLMRBFHXyBVECRuQ/CJCcz8yLGsqNT+lpxe0YlgSmQnWNd0h5468jzNood20C60yu2DZurBBh8qT5NS8cTrbG8UfFtMaOzAMdg+Z8jUkStxdzBTLDo6PhD51omLVYc8PBJRjlkHCbBLB5aJUPRro9DVgwZrx8fVe2l3pLlWgmTNRspZP31Bjmjk51SNLKcCsXAQCzlmAarAe3BzuZ7W/5nROhyWmVJQ/jgVzmSXlHqTnp6QjpMOPOw1GzPnf7CJEZDq4bEe8gHgOgKoV1mkZJtwbRKjPwG5D5BC0dipEmAEfWRKada9El/JmKmPFi7ER4cHIZJoTVQZ+ExS9JLtGkXELgKrGrM5zP1ws08TZesLqVipWkmWRDSKYRhNYi8w3qmGBwMQde64C3tsNrOCZOaLADALO51tihI/fy3zMxoTXZ250LK
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(396003)(376002)(136003)(346002)(39860400002)(451199021)(2906002)(15650500001)(478600001)(41300700001)(8936002)(8676002)(66556008)(5660300002)(66476007)(66946007)(6916009)(4326008)(316002)(82960400001)(85182001)(86362001)(186003)(26005)(53546011)(6506007)(6486002)(83380400001)(6512007)(9686003)(38100700002)(6666004);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?U25WK3Y1Rm9OZlRCVVlSbGtXVHdqUGx4TkkyREdjTUVDd0k4dDdLdE83cmpy?=
 =?utf-8?B?aFpRbzVwVzNvUFpMdVVnQ1BoTHBmUHhuY1VqdHE1Q1NKMFhlamZHQktQNVN2?=
 =?utf-8?B?OGp1U0ZzUWg0aTdUYVlNSmFENHJQZ1JMN2dmZ0ZyUkxKcDlHSFpxT3QzKzVZ?=
 =?utf-8?B?NUwzSnJLd3MvcWVXc2tZS0NUTnVpWnBiZ0pEY2hleGE0SUNQYjg5UlRqTVdI?=
 =?utf-8?B?S2JYQmN6aUZXMU83SjlyeExrbWVid0pFcndQMStPd0JDSUw4M3pqdVdaVFRN?=
 =?utf-8?B?RHQ2MDJZbHJsVW5PNnVBMW8wVVNMdlZEa2t3RFp5UmRHNUt1d0lnd3gzVy80?=
 =?utf-8?B?Q0N4K2ZXdTFOMEJrVXplOVZTdGgzOGlNNnloYlI5VVFGb2Q5cW4vTTc3eFh2?=
 =?utf-8?B?Nkd4cGhKQXFJYVhkenh1SW91ajZwci8xbmovRWJFbnVuYzBCQ1M4ckhtclhQ?=
 =?utf-8?B?U1ZITmRRdlVvdENrWlNBeWtteXJDQWhJNkl3Nlp3K2VTeGxaQzNRM3M0R0tO?=
 =?utf-8?B?aHhxYXB6THlEdzRSUzlZaFIxK29KT2VzTkhDKzhiYUY5Q3FiVzJUODRqU3FV?=
 =?utf-8?B?TjRrR1daZFFrODd0TmNtUFdCMkd1QnRTUVRCdHY0bUJxcEpLdXZTRnpyREwr?=
 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vnWCIZ6JCIAeUSxUNxQMMcbIKguCtzLtyMy+T1qEuNcq0SZfyFRBfRXc3dYkFYhGnEnDWNd32Qr4O7DKAms2jrSbZelpfVgRTFsXhb6r2SwRMKLkQu/KeEzovcDPALVWdXOjZpE9GXpTGCau7a9XvvJsvAudWbtFzEu9+tlItDGIhFTwT/+W4fvTrIa3fFJMXKToJfdjLayGR+rMHUqOou46RlUgCVmGp5cDukESiZN4DUpxf73Q8MY9a6QnsZWa4cbwTctikSIK+8/MjNE2hO9NOAoAuS4qrOdTNuQTVYi8EF8V8b+9CnknT8dNoXv/DA7LTurdYGiCSZK2NH5rvQ/gcFESesUMtsVutUFyVUln4gk+NM5+81aGiM9uwn3EM4Qgag30DNou+QRi27kId++9Ese0Avu6vpdc+KIbgKjhRrheU3HDnxTtvitAaAw/a3mJSzqQ/OnCvVYCgmsb4muUsWPKBQlkZK72DGkXb8fo6k7MTtuc+1zAwmXWWM/ZwC6vQntNTDKGYPjFH/9aUdsR73zJkZgyv/fE61KhfmlilY2opKiOBD550abDPzZdk=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a9b1a8d2-b770-4b05-312f-08db88721f4a
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 16:06:33.8557
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: XAxVsGeSJFzCC3IFFiJPcwk3CLAOVNd6Cd1Rr/R1sHXBL/PuZ9haciO8W/w9t0vVR3zL6wFP6NYJU602893RFw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR03MB5186

On Wed, Jul 19, 2023 at 02:46:49PM +0200, Jan Beulich wrote:
> On 18.07.2023 14:43, Roger Pau Monne wrote:
> > Disable XT (x2APIC) support and thus 128 IRTE entries if cmpxchg16b is
> > not available, do so in order to avoid having to disable the IRTE (and
> > possibly loose interrupts) when updating the entry.  Note this also
> > removes the usage of a while loop in order to disable the entry, since
> > RemapEn is no longer toggled when updating.
> > 
> > Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> > ---
> > x2APIC support was added late enough on AMD that CPUs that I believe
> > all models that have x2APIC must also have CX16.
> > 
> > The AMD-Vi manual contains the following advice in the "2.3.2 Making
> > Guest Interrupt Virtualization Changes" section:
> > 
> > """
> > If RemapEn=1 before the change, the following steps may be followed to
> > change interrupt virtualization information:
> >  * Set RemapEn=0 in the entry to disable interrupt virtualization;
> >    device-initiated interrupt requests for the DeviceID and vector are
> >    processed as IO_PAGE_FAULT events.
> >  * Update the fields in the IRTE and invalidate the interrupt table
> >    (see Section 2.4.5 [INVALIDATE_INTERRUPT_TABLE]).
> >  * Set RemapEn=1 to virtualize interrupts from the device.
> > """
> > 
> > However if the update of the IRTE is done atomically I assume that
> > setting RemapEn=0 is not longer necessary, and that the
> > INVALIDATE_INTERRUPT_TABLE command can be executed after the entry has
> > been (atomically) updated.
> 
> There's one additional prereq to this: The IOMMU also needs to read
> 128-bit IRTEs atomically. I'm afraid we can't take this for given
> without it being said explicitly in the spec (I've just gone through
> and looked at all occurrences of "atomic", without finding anything
> applicable to IRTEs). If this can be resolved, I think I'm fine with
> the patch.

Hm, indeed I was taking for granted that the IOMMU will read the entry
atomically.

I was also worried about the IOMMU caching only parts of the IRTE, and
thus even when doing an atomic read of the full entry it could still
get inconsistent data if using previously cached parts of the entry.
The text in INVALIDATE_INTERRUPT_TABLE seems to suggest that IRTE
fields could be cached on a field by field basis.

I will raise a question with AMD in order to try to figure out whether
the IOMMU will do atomic reads, and also cache the full entry.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 16:14:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 16:14:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565962.884618 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM9oA-0002F9-AM; Wed, 19 Jul 2023 16:13:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565962.884618; Wed, 19 Jul 2023 16:13:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qM9oA-0002F2-6c; Wed, 19 Jul 2023 16:13:46 +0000
Received: by outflank-mailman (input) for mailman id 565962;
 Wed, 19 Jul 2023 16:13:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=SgS6=DF=oss.nxp.com=andrei.cherechesu@srs-se1.protection.inumbo.net>)
 id 1qM9o8-0002Ew-S7
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 16:13:44 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0610.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::610])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3b1ddcc9-264f-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 18:13:43 +0200 (CEST)
Received: from VI1PR04MB5056.eurprd04.prod.outlook.com (2603:10a6:803:5a::13)
 by PA4PR04MB7919.eurprd04.prod.outlook.com (2603:10a6:102:c1::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Wed, 19 Jul
 2023 16:13:40 +0000
Received: from VI1PR04MB5056.eurprd04.prod.outlook.com
 ([fe80::a660:f949:7690:2dd0]) by VI1PR04MB5056.eurprd04.prod.outlook.com
 ([fe80::a660:f949:7690:2dd0%3]) with mapi id 15.20.6609.024; Wed, 19 Jul 2023
 16:13:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3b1ddcc9-264f-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=evA06aP37wbQQZ/zOSJWd/TqQwp/WE8c+lddz4Kl0/dYw0Amjfw+mHf/s3lVzxgCn1k0jL6nnil5DF+yd+8eoLB/w8gQbiEDIFd1F5Ic/miu/2QZsZQOHMhImqrZI3jjbi4+mp8S3QxQoZbyV8iK69WTE6U3FlXz8PZo+zYD4wANYUKtmzDSyYbTH93YCh0yu0A0KpKf782785Bw5o5wqUrYH32RFK0Q76XOBSP+5lbRQC6yMqhMMALHuQ4FHduVPyxZzWa6TfYNuVx9P6y7ZeEDJTpDrk9ci97G4hjbF9yRcgkSgb+/bxZahazx1qDNUfO7tk7cTdz6EloqgxQauQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=eqRr919NUlOrmXHdah6Gk+0oOo6JMk67MeDVo6GolN0=;
 b=HiQ993EBEKfZbIacvgvZ2vfIMOvD8aCblp976hMArE44+Hw8BYN2F2ForKwYFd9oGiKquxAphM39qzcaNUxyid02mtWMsbFxdeRs/anvzOchX5Y01c9sPL1+zen0RxnPCQ0/m7Ckl0lLlEweRN6/gPZxqpXRf9ZjyougnsaR47AX24txjNvQlNH2Ueuf1h1C5J7xsKwFA6Syd5eu2VXtqmfTUvVYWOvjBBRgPCvS2cEcqIif73krzhsUWDjTXE0p8ILRjbJmKVDjUM7yCbtOJf0/UagRaWQtUyR/smyNCUzqTE12HewSZZNuq/t3/KykaSyhSg+cxThuDpcQeZUIhg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com;
 dkim=pass header.d=oss.nxp.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com;
 s=selector2-NXP1-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=eqRr919NUlOrmXHdah6Gk+0oOo6JMk67MeDVo6GolN0=;
 b=HWYwXFlI3iDjkTXBlyUs7MubdGvbnxgT/uoG2VVqCt3Hmo/OT6P2XLjAu35AMjB4418H9BOMKEhvJ0DNCeHN2WK4lK9lcNNXHH4P/afNLEU19f//aW8X0iQhAs6J/IvLulrJKp5+4juihuLnXAeuxYreYzgXsrrEnhGkAA7XJD8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=oss.nxp.com;
Message-ID: <62eeff72-c1fb-6932-6797-1b0058c97b03@oss.nxp.com>
Date: Wed, 19 Jul 2023 19:13:22 +0300
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
 Thunderbird/91.8.0
Content-Language: en-US
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, george.mocanu@nxp.com
From: "Andrei Cherechesu (OSS)" <andrei.cherechesu@oss.nxp.com>
Subject: [ARM][xencons] PV Console hangs due to illegal ring buffer accesses
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: AM0PR01CA0177.eurprd01.prod.exchangelabs.com
 (2603:10a6:208:aa::46) To VI1PR04MB5056.eurprd04.prod.outlook.com
 (2603:10a6:803:5a::13)
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: VI1PR04MB5056:EE_|PA4PR04MB7919:EE_
X-MS-Office365-Filtering-Correlation-Id: 2760aac6-b6a2-469b-f8b6-08db88731d65
X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	BPT73KgnogkqqtYp6uAWkxCwYTvFHkkyhXANnridIx1WEefSv+iXRbSDqRnv7QUbBeAyXG/PuRmXDYpnDQhNWnKQ+svYURG6KWfk3hKUxYRqrZo+lyHWHLaKorfMG7ep1CeBPE+R+LZDdYuE8ONTVmmms9LMyB+MgMgEeaugQaidQg1JOdVkoSVUVQVGX+knyer+Nz7kJ6vvHUzwRmkCjAXNZknU7dYmrJegS20OL/JmyfXD6iqiK4wICnJOIPZvqe0zgchKYyZbERwe3lLVez7C9N5Fys1JCjDTyzRZ8/r/5FbOQS/D3deUInVNkyV7O0HTV2NuEGKtV+FcmlrJrwe//2UdBh4F6troGGzzkEBVrHZKvh6/mSXNAEFvIPMCpjib9rf0dyRkSmEMF8nFjXtxM5mp9zSPN3MZqdNBtgyZb9bNX/dCbB5SPbbgkZjXM+AGh/Cuk6N76Zl57kkJiF1libZQN4kk/KZ6aEBbraUc/7o0mGqmjU5Vc4q6SA8RryY+LohlgiBA/pnrg8f8qnFUKvtIyZm9FQ9W9Jz8UoLnQoUKwahWsHfzvW0F91RL4a41Vq0tth714a8j1biJ0CHvxog7uEu3rpdZzNTu/vqKpI2WuL/zQWenxfROzILWRZi08ii1Bd1/TQNeFG7RsQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5056.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(346002)(136003)(39860400002)(396003)(451199021)(966005)(66946007)(6512007)(66556008)(6666004)(6486002)(66476007)(2906002)(316002)(8676002)(6916009)(8936002)(4326008)(5660300002)(6506007)(2616005)(38100700002)(186003)(26005)(41300700001)(86362001)(478600001)(83380400001)(31686004)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Yzl6U2U1REk1aEI1akNQem5CRjRsWlAyWVhJY2NMMDBvQ0YyakhYRDE3SzJT?=
 =?utf-8?B?bVhwbHBGUlZJcCt0cndHWDgwYXZXRFdmd1p0bTA5RWxqcWZlb3BWOUgwUTdV?=
 =?utf-8?B?Qkx6aGV1TE5iaEdOMld6aXdwd0ZlOFhKL0RCdG53bmVRc2krOCtONUF5Qkhi?=
 =?utf-8?B?aStWaTVDeWRaWVZ0UjhQOUtQSkZLVHhnZXlQSkhmNmtFVzVsaFZrT3Rqc1h1?=
 =?utf-8?B?ZmNvYmtBWGh6WlJ4YThldzBSSm1WRFV2UkxJdzRoNHNIT2g4eXltd3hSc3BN?=
 =?utf-8?B?ZTN3VXJmaWtZczI2N1pwWE01eVdnQkdHSXVxQmNDNkcxOG9ZV3ZxYWtkdUZF?=
 =?utf-8?B?QnBFM1FoYUt0SVNQZkFUNStYcTlXQysvUEJlVUwrNzZBRS8vVFdNTExoMXBs?=
 =?utf-8?B?NkdxM0tHaEVERERYZGJLWE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utf-8?B?ZFE9PQ==?=
X-OriginatorOrg: oss.nxp.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2760aac6-b6a2-469b-f8b6-08db88731d65
X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5056.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 16:13:40.1273
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ui8XVCmvslN2IvEpDNzQ+XGnYnRsn6+zV8GKFDoUHWQfTntCk6fZFOLaSJcfqyn99JhaCkbHcsCclnFe7QM826hdcDfhuH56GhfHhdMzdiY=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7919

Hello,

As we're running Xen 4.17 (with platform-related support added) on NXP S32G SoCs (ARMv8), with a custom Linux distribution built through Yocto, and we've set some Xen-based demos up, we encountered some issues which we think might not be related to our hardware. For additional context, the Linux kernel version we're running is 5.15.96-rt (with platform-related support added as well).

The setup to reproduce the problem is fairly simple: after booting a Dom0 (can provide configuration details if needed), we're booting a normal PV DomU with PV Networking. Additionally, the VMs have k3s (Lightweight Kubernetes - version v1.25.8+k3s1: https://github.com/k3s-io/k3s/releases/tag/v1.25.8%2Bk3s1) installed in their rootfs'es.

The problem is that the DomU console hangs (no new output is shown, no input can be sent) some time (non-deterministic, sometimes 5 seconds, other times like 15-20 seconds) after we run the `k3s server` command. We have this command running as part of a sysvinit service, and the same behavior can be observed in that case as well. The k3s version we use is the one mentioned in the paragraph above, but this can be reproduced with other versions as well (i.e., v1.21.11, v1.22.6). If the `k3s server` command is ran in the Dom0 VM, everything works fine. Using DomU as an agent node is also working fine, only when it is run as a server the console problem occurs.

Immediately after the serial console hangs, we can still log in on DomU using SSH, and we can observe the following messages its dmesg:
[   57.905806] xencons: Illegal ring page indices
[   59.399620] xenbus: error -5 while reading message
[   59.399649] xenbus: error -5 while writing message
[   67.353608] xencons: Illegal ring page indices
[   78.027813] IPVS: Registered protocols (TCP, UDP, SCTP, AH, ESP)
[   78.027865] IPVS: Connection hash table configured (size=4096, memory=32Kbytes)
[   78.028038] IPVS: ipvs loaded.
[   78.065479] IPVS: [rr] scheduler registered.
[   78.071249] IPVS: [wrr] scheduler registered.
[   78.084190] IPVS: [sh] scheduler registered.

Sometimes, Xen also dumps some info about expanding the grant tables, after the DomU console becomes unresponsive:
(XEN) common/grant_table.c:1882:d2v1: Expanding d2 grant table from 5 to 6 frames
(XEN) common/grant_table.c:1882:d2v1: Expanding d2 grant table from 6 to 7 frames
(XEN) common/grant_table.c:1882:d2v1: Expanding d2 grant table from 7 to 8 frames


It seems that when spawning the k3s server process, somehow (maybe due to intensive usage) the console ring buffers and the indices used for accessing them become corrupt. But the PV networking still works fine, and the domain is reachable via SSH and can continue to process the workload.

We've not been able so far to figure out why this happens, so any help would be appreciated. If you need other Domain configuration details or any inputs from our side, let us know.

Thank you,
Andrei Cherechesu


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 16:36:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 16:36:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565968.884628 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMA9h-0005Ij-2I; Wed, 19 Jul 2023 16:36:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565968.884628; Wed, 19 Jul 2023 16:36:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMA9g-0005Ic-Vq; Wed, 19 Jul 2023 16:36:00 +0000
Received: by outflank-mailman (input) for mailman id 565968;
 Wed, 19 Jul 2023 16:35:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sL7T=DF=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qMA9f-0005IW-DL
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 16:35:59 +0000
Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com
 [2a00:1450:4864:20::12e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5710cf07-2652-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 18:35:58 +0200 (CEST)
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-4fb77f21c63so11895136e87.2
 for <xen-devel@lists.xenproject.org>; Wed, 19 Jul 2023 09:35:58 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 d15-20020ac25ecf000000b004facdf96283sm1014442lfq.254.2023.07.19.09.35.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 19 Jul 2023 09:35:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5710cf07-2652-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689784558; x=1692376558;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=34HwFqw9v9Zok3ThA1MH7NTmtjrv3Eg0tsKIwTD+vRk=;
        b=EEiHCmlHUXVHUq1dSu3+XCPp7txGtWwIgHWfQC+mUCLLNeP1EePA9zglCj3n0clIlW
         RaPTNMMQzIS6oh6+pyFJzA2rE8ika68ZXxP18wMr/hwYYf2fBZbXQkMWdfLSB5QEDZsp
         Tx6owTyy0HamXPfMAMYvXjyJ70rO7Yd5urMy/pUxVwo6xxbwd+6mSnbdUFp/wOVx+i+V
         gZGkm1jP3PTXtEOQSAhjH5ammrBGyf/vAut1RC9ytb1aXjw7Dp4B15B/OmHQGNdQ9pi0
         jEKKJYX+gjP93pA+yjYjTWW4CrJDH8trPdkpcG0zGHIluKypu/H5I+rr1Y1pfgQdESJl
         5O3A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689784558; x=1692376558;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=34HwFqw9v9Zok3ThA1MH7NTmtjrv3Eg0tsKIwTD+vRk=;
        b=kDD+BRhO/NsGMjSWWAegsHfTcAVJQDdhSlHzIk2ZPVV4jTwIgjKWxWMGT5LhZDHQXi
         ovj2JUHnhTSVDX7W37Rd4FhVMMq8y6wVlhvvwH44EmPz5R5DtfBatr7XsQxLFLE1/Fxh
         9sdbul9PjR19kruiPNxiMiiuMIn6E3MlSZGyT2nTp4bF32k8ZaklFqjFypmahjTjo36P
         kp3pY5XPKYQfpk0EoDQqPSJXehekm247ocQoOFbEGd/VpAMpNqUK+wvpbUMbSZatwaGM
         VOk2O/ma1SQDB8BdlDtpNOPL3lFgL4+bdhcxoBx4xxA07/mwt756mu+RgCMaiSzrcYk0
         6Hhw==
X-Gm-Message-State: ABy/qLbMC1RAVXbUZSPtczbNJDGAwQvCf0/MsKI/eCOxbjT+qhw8waCb
	ZKUJWBDcA4NRWCyPYUtSgyA=
X-Google-Smtp-Source: APBJJlFgQ+YXFkPkGRm8YWgcykonQqnnYeGEyO1PgZPDA8aryggbN+D+HL2L80VmcokR2rW3nmq6DQ==
X-Received: by 2002:a19:e016:0:b0:4f8:596a:4bb7 with SMTP id x22-20020a19e016000000b004f8596a4bb7mr293938lfg.57.1689784557743;
        Wed, 19 Jul 2023 09:35:57 -0700 (PDT)
Message-ID: <30540953fb363fce4dfd59f8a7e709247a9872fd.camel@gmail.com>
Subject: Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Bob Eshleman
	 <bobbyeshleman@gmail.com>, Alistair Francis <alistair.francis@wdc.com>, 
	Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
Date: Wed, 19 Jul 2023 19:35:56 +0300
In-Reply-To: <ad53c037-3c1b-ff1a-93df-b79ab2948174@suse.com>
References: <cover.1689604562.git.oleksii.kurochko@gmail.com>
	 <8c69050d7b1f42df5e776ca9494164a4d15f2d52.1689604562.git.oleksii.kurochko@gmail.com>
	 <ad53c037-3c1b-ff1a-93df-b79ab2948174@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote:
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uns=
igned long load_end =3D LINK_TO_LOAD(_end);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uns=
igned long pt_level_size =3D XEN_PT_LEVEL_SIZE(i -
> > 1);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uns=
igned long xen_size =3D ROUNDUP(load_end -
> > load_start, pt_level_size);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uns=
igned long page_entries_num =3D xen_size /
> > pt_level_size;
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 whi=
le ( page_entries_num-- )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 pgtbl[index++].pte =3D 0;
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bre=
ak;
>=20
> Unless there's a "not crossing a 2Mb boundary" guarantee somewhere
> that I've missed, this "break" is still too early afaict.
If I will add a '2 MB boundary check' for load_start and linker_start
could it be an upstreamable solution?

Something like:
    if ( !IS_ALIGNED(load_start, MB(2) )
	printk("load_start should be 2Mb algined\n");
and
    ASSERT( !IS_ALIGNED(XEN_VIRT_START, MB(2) )
in xen.lds.S.

Then we will have completely different L0 tables for identity mapping
and not identity and the code above will be correct.

~ Oleksii




From xen-devel-bounces@lists.xenproject.org Wed Jul 19 16:49:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 16:49:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565975.884638 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMAMH-0007L7-67; Wed, 19 Jul 2023 16:49:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565975.884638; Wed, 19 Jul 2023 16:49:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMAMH-0007L0-3N; Wed, 19 Jul 2023 16:49:01 +0000
Received: by outflank-mailman (input) for mailman id 565975;
 Wed, 19 Jul 2023 16:49:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sL7T=DF=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qMAMG-0007Ku-Nl
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 16:49:00 +0000
Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com
 [2a00:1450:4864:20::133])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 28be904f-2654-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 18:48:59 +0200 (CEST)
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-4fb9ae4cef6so11845682e87.3
 for <xen-devel@lists.xenproject.org>; Wed, 19 Jul 2023 09:48:59 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 e5-20020ac25465000000b004fb75943ab3sm1020632lfn.258.2023.07.19.09.48.58
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 19 Jul 2023 09:48:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 28be904f-2654-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689785339; x=1692377339;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=bRkjt1pU47JG3qwaqftQ7p/9/ftpSKHb6yI229dMamg=;
        b=Z2+csoLj3v4/Jo6tKgtqr9gcDWzV0N3PTZA9ODCbn5fnWpJtOE0gdJaoE2W73MmC1f
         itT8fr3hT/UXzyX95Ra14N3F/GXsmG2/MxozjkkTEeFo6tVQxBNubi+2VnUrSXBU83yH
         BqIaA1ywLpvf985hp0sAb/E0LpPv9ZWN4JjXaedYT7B7Mn/5QnRY+y8z4WL58LF1uf+Y
         tIVWW3srscrtl/f2UCj0fyhwfR11hzYN749mpLF/GqsRy7/lO+uEFOrRHwbS5ittuwLw
         uUDKNvVrnuJTf7Z/LICc07dyQ3RJo79ZnW0sYTBFF8GW6eOK5l8X/EiMYYAkSYPy+5d6
         OzkQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689785339; x=1692377339;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=bRkjt1pU47JG3qwaqftQ7p/9/ftpSKHb6yI229dMamg=;
        b=MfZtoj5dAwCmGDnlmWoSm+/fpdXu8rvC+mWS3xdSIPCcRbcEoP2sWt06vUew5hFNiB
         qhVlBxtmMwqI0IKiJ4iBLNBBAlj1Bj4Xvuuvh9A6tUHHZRwK0U0xqXMWV6g8o31cR6Yn
         WYaFu4yLJJjT5HtxWSLcmK3DDb2DagueRfoSE4X1haS9i3PLNaheKSTfaaMzfYnZEFkh
         TPbiAw/Cy3h09HIfGJh7AZgoO1U4SSnui/niA9Y0MhTEVSuA3gDhL9D85Mktw3zXLF+2
         bPrN1c9R8plWz5mhb+IDosc9BtG+udMDg8cU9jvoOUxITTFiAptfSocePE4k6kIuXeYG
         defA==
X-Gm-Message-State: ABy/qLb51w5Q8HsY14vLu1JWyBLkAWKMoCD8CUvaEN3gXh3rwo/l2rFJ
	kLYM+9cQbvwt+miuKhWprRg=
X-Google-Smtp-Source: APBJJlGfGcI5En2jxwGfaswlDpNhaGUZZzdpqFgJhulU+lAvUuL6vO1lpHYj1agQXj7WiI3gvalrcw==
X-Received: by 2002:a19:670b:0:b0:4fd:d6ba:73c2 with SMTP id b11-20020a19670b000000b004fdd6ba73c2mr248620lfc.54.1689785338955;
        Wed, 19 Jul 2023 09:48:58 -0700 (PDT)
Message-ID: <a361be821d946c24f76820e657c608b9313131ca.camel@gmail.com>
Subject: Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Bob Eshleman
	 <bobbyeshleman@gmail.com>, Alistair Francis <alistair.francis@wdc.com>, 
	Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
Date: Wed, 19 Jul 2023 19:48:57 +0300
In-Reply-To: <5feef533-cfb7-bb17-9439-6efcb2fb9b2a@suse.com>
References: <cover.1689604562.git.oleksii.kurochko@gmail.com>
	 <8c69050d7b1f42df5e776ca9494164a4d15f2d52.1689604562.git.oleksii.kurochko@gmail.com>
	 <ad53c037-3c1b-ff1a-93df-b79ab2948174@suse.com>
	 <dbb568a33691b1fed5cb7f8de801a87e4aebbe4d.camel@gmail.com>
	 <5feef533-cfb7-bb17-9439-6efcb2fb9b2a@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Wed, 2023-07-19 at 13:38 +0200, Jan Beulich wrote:
> On 19.07.2023 12:39, Oleksii wrote:
> > On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote:
> > > On 17.07.2023 16:40, Oleksii Kurochko wrote:
> > > > @@ -35,8 +41,10 @@ unsigned long __ro_after_init phys_offset;
> > > > =C2=A0 *
> > > > =C2=A0 * It might be needed one more page table in case when Xen
> > > > load
> > > > address
> > > > =C2=A0 * isn't 2 MB aligned.
> > > > + *
> > > > + * CONFIG_PAGING_LEVELS page tables are needed for identity
> > > > mapping.
> > > > =C2=A0 */
> > > > -#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) + 1)
> > > > +#define PGTBL_INITIAL_COUNT (CONFIG_PAGING_LEVELS * 2 + 1)
> > >=20
> > > Where did the "- 1" go?
> > My fault. Should be:
> > =C2=A0 #define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS * 2=C2=A0 - 1=
) + 1)
>=20
> Why? I'd have expected
>=20
> #define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) * 2 + 1)
>=20
I confused myself with definition of PGTBL_INITIAL_COUNT from another
branch so your option is correct.
Thanks.

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 16:49:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 16:49:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565978.884648 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMAN4-0007r0-Fd; Wed, 19 Jul 2023 16:49:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565978.884648; Wed, 19 Jul 2023 16:49:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMAN4-0007qt-CQ; Wed, 19 Jul 2023 16:49:50 +0000
Received: by outflank-mailman (input) for mailman id 565978;
 Wed, 19 Jul 2023 16:49:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=5Pwt=DF=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qMAN3-0007Ku-Am
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 16:49:49 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 446b9b3e-2654-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 18:49:47 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36JGnXA0033956
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Wed, 19 Jul 2023 12:49:39 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36JGnXcG033955;
 Wed, 19 Jul 2023 09:49:33 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 446b9b3e-2654-11ee-b23a-6b7b168915f2
Date: Wed, 19 Jul 2023 09:49:33 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
        Anthony PERARD <anthony.perard@citrix.com>,
        Marek =?iso-8859-1?Q?Marczykowski-G=F3recki?= <marmarek@invisiblethingslab.com>
Subject: Re: [PATCH] docs/xen-tscmode: remove mention of numeric tsc_mode=
 values
Message-ID: <ZLgUHZ7U4s1XOb7v@mattapan.m5p.com>
References: <a8223a339a0b8ff3c0d04fb4ee2913c7558cc131.1689294071.git.ehem+xen@m5p.com>
 <ZLCj62XMBbspMWbY@mail-itl>
 <ZLDErKk8ziBuh1ZJ@mattapan.m5p.com>
 <b3db9387-8139-e7f8-d250-9933e288f9fc@suse.com>
 <ZLb9AhaoJDixR7Nf@mattapan.m5p.com>
 <98422c1d-ce7f-7700-20f7-54b5e68b63ff@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <98422c1d-ce7f-7700-20f7-54b5e68b63ff@suse.com>
X-Spam-Status: No, score=0.4 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

On Wed, Jul 19, 2023 at 08:24:15AM +0200, Jan Beulich wrote:
> On 18.07.2023 22:58, Elliott Mitchell wrote:
> > On Fri, Jul 14, 2023 at 09:21:59AM +0200, Jan Beulich wrote:
> >> On 14.07.2023 05:44, Elliott Mitchell wrote:
> >>> On Fri, Jul 14, 2023 at 03:24:59AM +0200, Marek Marczykowski-Górecki wrote:
> >>>> On Thu, Jul 13, 2023 at 05:16:40PM -0700, Elliott Mitchell wrote:
> >>>>> The better to encourage moving to setting via string mode names.
> >>>>
> >>>> The numeric values needs to remain documented, otherwise interpreting
> >>>> pre-existing configs (that may use them) will be tricky.
> >>>
> >>> Problem is the way it is documented tends to encourage continued use of
> >>> the numeric values (notice how reports irt Zen 4 mention "tsc_mode=1").
> >>>
> >>> `parse_config_data()` suggests the appropriate string value, so nominally
> >>> that should take care of older configurations.  If "xen-tscmode" really
> >>> needs to continue mentioning the numeric value, it should be in
> >>> parentheses and with "old value" to suggest moving away from that.
> >>
> >> I'm not sure about "old" (we can't change the values without breaking
> >> backwards compatibility), but the numeric values will want mentioning
> >> alongside their spelled out names.
> > 
> > Then why is there a warning message about numeric tsc_mode in
> > `parse_config_data()`?
> 
> I'm afraid this question can only be answered by whoever was involved
> in adding the warning.

I already tracked that down, commit af3b530c03 by Ian Campbell.  Appears
Ian Campbell has moved onto other things and may not be readily
accessible.

The messages themselves seem to suggest >10 years ago Ian Campbell wanted
to get rid of the numeric values for tsc_mode.  Problem is one debug
string was left in and the documentation doesn't discourage the numeric
values.  As such they may still be heavily used.

What needs to happen is a decision of which direction to push needs to be
made.  Then that direction needs to be consistently pushed.

Notice the immediately prior message trying to get rid of the
printf-debugging.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Wed Jul 19 16:50:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 16:50:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.565985.884657 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMANm-0000qB-Ny; Wed, 19 Jul 2023 16:50:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 565985.884657; Wed, 19 Jul 2023 16:50:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMANm-0000q4-LC; Wed, 19 Jul 2023 16:50:34 +0000
Received: by outflank-mailman (input) for mailman id 565985;
 Wed, 19 Jul 2023 16:50:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=5Pwt=DF=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qMANl-0007Ku-MK
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 16:50:33 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5fd549e4-2654-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 18:50:33 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36JGoNfd034007
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Wed, 19 Jul 2023 12:50:29 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36JGoN1F034006;
 Wed, 19 Jul 2023 09:50:23 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5fd549e4-2654-11ee-b23a-6b7b168915f2
Message-Id: <cover.1689779749.git.ehem+xen@m5p.com>
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Cc: Juergen Gross <jgross@suse.com>
Date: Wed, 19 Jul 2023 08:15:49 -0700
Subject: [PATCH 0/7] Reducing visibility and cleanup of .cfg parsing symbols
X-Spam-Status: No, score=0.4 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

These patches started as an effort to try to isolate the layers of the
domain configuration file parsing.  Theory being it might be possible to
replace the lowest layer with something better.

I noticed libxlutil.h isn't very consistent.  Some functions were naming
the configuration argument "cfg" and some were leaving it unnamed.  There
were also some very short names.

Then inside tools/libs/util, far too much layer-specific detail was in
the headers and didn't need to be.  Turned out most things in
libxlu_internal.h didn't even need to be in a header.  Then some portions
should have been in other headers since they didn't need to be so
visible.

There are a bunch of headers in tools/libs/util.  Due to their number I
need a guess as to their intended purpose.  I've concluded
"libxlu_internal.h" is meant to be a general utility header for anything
used by multiple layers.  I've concluded the *_i.h headers are meant to
be isolated to specific layers.


Elliott Mitchell (7):
  tools/utils: cleanup formatting of libxlutil.h
  tools/utils: rename "n" arguments to "key"
  tools/utils: move XLU_Operation to libxlu_cfg_i.h.h
  tools/utils: introduce xlu_cfg_printf() function
  tools/utils: move XLU_ConfigSetting & xlu__cfg_set_free() to
    libxl_cfg.c
  tools/utils: remove libxlu_cfg_i.h from libxlu_disk.c
  tools/utils: move remaining lower-layer data from libxlu_internal.h

 tools/include/libxlutil.h         | 31 +++++++++-----------
 tools/libs/util/libxlu_cfg.c      | 37 ++++++++++++++++++++++--
 tools/libs/util/libxlu_cfg_i.h    | 37 +++++++++++++++++++++++-
 tools/libs/util/libxlu_disk.c     | 15 ++++------
 tools/libs/util/libxlu_internal.h | 47 ++-----------------------------
 tools/libs/util/libxlu_pci.c      |  3 +-
 tools/libs/util/libxlu_vif.c      |  4 +--
 7 files changed, 94 insertions(+), 80 deletions(-)

-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 16:51:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 16:51:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566001.884668 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMAOv-0001VA-7a; Wed, 19 Jul 2023 16:51:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566001.884668; Wed, 19 Jul 2023 16:51:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMAOv-0001V3-3q; Wed, 19 Jul 2023 16:51:45 +0000
Received: by outflank-mailman (input) for mailman id 566001;
 Wed, 19 Jul 2023 16:51:44 +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 <SRS0=5Pwt=DF=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qMAOu-0001Uv-1b
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 16:51:44 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 889ccc0f-2654-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 18:51:41 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36JGpFdc034017
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Wed, 19 Jul 2023 12:51:21 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36JGpFiH034016;
 Wed, 19 Jul 2023 09:51:15 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 889ccc0f-2654-11ee-8611-37d641c3527e
Message-Id: <8561fa647a637e78b67a5a9f01f6d93d6a1de2cd.1689779749.git.ehem+xen@m5p.com>
In-Reply-To: <cover.1689779749.git.ehem+xen@m5p.com>
References: <cover.1689779749.git.ehem+xen@m5p.com>
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Cc: Juergen Gross <jgross@suse.com>
Date: Mon, 10 Jul 2023 15:55:30 -0700
Subject: [PATCH 1/7] tools/utils: cleanup formatting of libxlutil.h
X-Spam-Status: No, score=2.5 required=10.0 tests=DATE_IN_PAST_96_XX,
	KHOP_HELO_FCRDNS autolearn=no autolearn_force=no version=3.4.6
X-Spam-Level: **
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

Some arguments included a name, but not all did.  Now use "cfg" for
all uses of XLU_Config * and "list" for uses of XLU_ConfigList *.

Also fix some spaces missing from xlu_cfg_get_defbool()'s prototype.

Rename the "b" argument of xlu_cfg_get_defbool() to "value_r".  Similar
to other functions this is where the returned value is stored.

Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
 tools/include/libxlutil.h | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/tools/include/libxlutil.h b/tools/include/libxlutil.h
index 4dd3c5e92b..fcbe41b15a 100644
--- a/tools/include/libxlutil.h
+++ b/tools/include/libxlutil.h
@@ -40,12 +40,12 @@ XLU_Config *xlu_cfg_init(FILE *report, const char *report_filename);
   /* report_filename is copied; report is saved and must remain valid
    *  until the Config is destroyed. */
 
-int xlu_cfg_readfile(XLU_Config*, const char *real_filename);
-int xlu_cfg_readdata(XLU_Config*, const char *data, int length);
+int xlu_cfg_readfile(XLU_Config *cfg, const char *real_filename);
+int xlu_cfg_readdata(XLU_Config *cfg, const char *data, int length);
   /* If these fail, then it is undefined behaviour to call xlu_cfg_get_...
    * functions.  You have to just xlu_cfg_destroy. */
 
-void xlu_cfg_destroy(XLU_Config*);
+void xlu_cfg_destroy(XLU_Config *cfg);
 
 
 /* All of the following print warnings to "report" if there is a problem.
@@ -56,26 +56,26 @@ void xlu_cfg_destroy(XLU_Config*);
  *   ERANGE   value out of range (from strtol)
  */
 
-int xlu_cfg_get_string(const XLU_Config*, const char *n, const char **value_r,
-                       int dont_warn);
+int xlu_cfg_get_string(const XLU_Config *cfg, const char *n,
+                       const char **value_r, int dont_warn);
 /* free/strdup version */
 int xlu_cfg_replace_string(const XLU_Config *cfg, const char *n,
                            char **value_r, int dont_warn);
-int xlu_cfg_get_long(const XLU_Config*, const char *n, long *value_r,
+int xlu_cfg_get_long(const XLU_Config *cfg, const char *n, long *value_r,
                      int dont_warn);
-int xlu_cfg_get_bounded_long(const XLU_Config*, const char *n, long min,
+int xlu_cfg_get_bounded_long(const XLU_Config *cfg, const char *n, long min,
                              long max, long *value_r, int dont_warn);
-int xlu_cfg_get_defbool(const XLU_Config*, const char *n, libxl_defbool *b,
-                     int dont_warn);
+int xlu_cfg_get_defbool(const XLU_Config *cfg, const char *n,
+                        libxl_defbool *value_r, int dont_warn);
 
-int xlu_cfg_get_list(const XLU_Config*, const char *n,
+int xlu_cfg_get_list(const XLU_Config *cfg, const char *n,
                      XLU_ConfigList **list_r /* may be 0 */,
                      int *entries_r /* may be 0 */,
                      int dont_warn);
   /* there is no need to free *list_r; lifetime is that of the XLU_Config */
 int xlu_cfg_get_list_as_string_list(const XLU_Config *cfg, const char *n,
                                     libxl_string_list *sl, int dont_warn);
-const char *xlu_cfg_get_listitem(const XLU_ConfigList*, int entry);
+const char *xlu_cfg_get_listitem(const XLU_ConfigList *list, int entry);
   /* xlu_cfg_get_listitem cannot fail, except that if entry is
    * out of range it returns 0 (not setting errno) */
 
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 16:52:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 16:52:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566017.884678 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMAPT-000211-H8; Wed, 19 Jul 2023 16:52:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566017.884678; Wed, 19 Jul 2023 16:52:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMAPT-00020t-Ds; Wed, 19 Jul 2023 16:52:19 +0000
Received: by outflank-mailman (input) for mailman id 566017;
 Wed, 19 Jul 2023 16:52:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=5Pwt=DF=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qMAPS-0001nm-5n
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 16:52:18 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9db68d44-2654-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 18:52:16 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36JGq7Lk034023
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Wed, 19 Jul 2023 12:52:13 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36JGq7Tc034022;
 Wed, 19 Jul 2023 09:52:07 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9db68d44-2654-11ee-b23a-6b7b168915f2
Message-Id: <075a60a09c7f99e2d51e5cc4d63aa892dcb75f82.1689779749.git.ehem+xen@m5p.com>
In-Reply-To: <cover.1689779749.git.ehem+xen@m5p.com>
References: <cover.1689779749.git.ehem+xen@m5p.com>
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Cc: Juergen Gross <jgross@suse.com>
Date: Wed, 12 Jul 2023 23:29:59 -0700
Subject: [PATCH 2/7] tools/utils: rename "n" arguments to "key"
X-Spam-Status: No, score=2.5 required=10.0 tests=DATE_IN_PAST_96_XX,
	KHOP_HELO_FCRDNS autolearn=no autolearn_force=no version=3.4.6
X-Spam-Level: **
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

Hopefully make it clearer to others this is the key associated with the
storage value to retrieve.

Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
 tools/include/libxlutil.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/include/libxlutil.h b/tools/include/libxlutil.h
index fcbe41b15a..0ce66c2096 100644
--- a/tools/include/libxlutil.h
+++ b/tools/include/libxlutil.h
@@ -56,24 +56,24 @@ void xlu_cfg_destroy(XLU_Config *cfg);
  *   ERANGE   value out of range (from strtol)
  */
 
-int xlu_cfg_get_string(const XLU_Config *cfg, const char *n,
+int xlu_cfg_get_string(const XLU_Config *cfg, const char *key,
                        const char **value_r, int dont_warn);
 /* free/strdup version */
-int xlu_cfg_replace_string(const XLU_Config *cfg, const char *n,
+int xlu_cfg_replace_string(const XLU_Config *cfg, const char *key,
                            char **value_r, int dont_warn);
-int xlu_cfg_get_long(const XLU_Config *cfg, const char *n, long *value_r,
+int xlu_cfg_get_long(const XLU_Config *cfg, const char *key, long *value_r,
                      int dont_warn);
-int xlu_cfg_get_bounded_long(const XLU_Config *cfg, const char *n, long min,
+int xlu_cfg_get_bounded_long(const XLU_Config *cfg, const char *key, long min,
                              long max, long *value_r, int dont_warn);
-int xlu_cfg_get_defbool(const XLU_Config *cfg, const char *n,
+int xlu_cfg_get_defbool(const XLU_Config *cfg, const char *key,
                         libxl_defbool *value_r, int dont_warn);
 
-int xlu_cfg_get_list(const XLU_Config *cfg, const char *n,
+int xlu_cfg_get_list(const XLU_Config *cfg, const char *key,
                      XLU_ConfigList **list_r /* may be 0 */,
                      int *entries_r /* may be 0 */,
                      int dont_warn);
   /* there is no need to free *list_r; lifetime is that of the XLU_Config */
-int xlu_cfg_get_list_as_string_list(const XLU_Config *cfg, const char *n,
+int xlu_cfg_get_list_as_string_list(const XLU_Config *cfg, const char *key,
                                     libxl_string_list *sl, int dont_warn);
 const char *xlu_cfg_get_listitem(const XLU_ConfigList *list, int entry);
   /* xlu_cfg_get_listitem cannot fail, except that if entry is
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 16:55:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 16:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566042.884687 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMAS1-0002hr-UX; Wed, 19 Jul 2023 16:54:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566042.884687; Wed, 19 Jul 2023 16:54:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMAS1-0002hR-RH; Wed, 19 Jul 2023 16:54:57 +0000
Received: by outflank-mailman (input) for mailman id 566042;
 Wed, 19 Jul 2023 16:54:57 +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 <SRS0=5Pwt=DF=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qMAS1-0002h2-Be
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 16:54:57 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fc26784e-2654-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 18:54:55 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36JGsiRV034053
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Wed, 19 Jul 2023 12:54:50 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36JGsig4034052;
 Wed, 19 Jul 2023 09:54:44 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fc26784e-2654-11ee-8611-37d641c3527e
Message-Id: <f1672fadcddb007f0f4f817625a5d15362743b3a.1689779749.git.ehem+xen@m5p.com>
In-Reply-To: <cover.1689779749.git.ehem+xen@m5p.com>
References: <cover.1689779749.git.ehem+xen@m5p.com>
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Cc: Juergen Gross <jgross@suse.com>
Date: Tue, 18 Jul 2023 16:31:34 -0700
Subject: [PATCH 5/7] tools/utils: move XLU_ConfigSetting & xlu__cfg_set_free()
 to libxl_cfg.c
X-Spam-Status: No, score=1.2 required=10.0 tests=DATE_IN_PAST_12_24,
	KHOP_HELO_FCRDNS autolearn=no autolearn_force=no version=3.4.6
X-Spam-Level: *
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

XLU_ConfigSetting is only used inside libxl_cfg.c, so no need for it in
the internal header.

Similarly, xlu__cfg_set_free() is no longer used outside libxl_cfg.c, so
remove from header and redeclare static.

Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
 tools/libs/util/libxlu_cfg.c      | 10 +++++++++-
 tools/libs/util/libxlu_cfg_i.h    |  1 -
 tools/libs/util/libxlu_internal.h |  8 --------
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/tools/libs/util/libxlu_cfg.c b/tools/libs/util/libxlu_cfg.c
index b2947cbfc9..2979d775a6 100644
--- a/tools/libs/util/libxlu_cfg.c
+++ b/tools/libs/util/libxlu_cfg.c
@@ -25,6 +25,14 @@
 #include "libxlu_cfg_l.h"
 #include "libxlu_cfg_i.h"
 
+typedef struct XLU_ConfigSetting { /* transparent */
+    struct XLU_ConfigSetting *next;
+    char *name;
+    XLU_ConfigValue *value;
+    enum XLU_Operation op;
+    int lineno;
+} XLU_ConfigSetting;
+
 struct XLU_Config {
     XLU_ConfigSetting *settings;
     FILE *report;
@@ -155,7 +163,7 @@ void xlu__cfg_value_free(XLU_ConfigValue *value)
     free(value);
 }
 
-void xlu__cfg_set_free(XLU_ConfigSetting *set) {
+static void xlu__cfg_set_free(XLU_ConfigSetting *set) {
     if (!set) return;
     free(set->name);
     xlu__cfg_value_free(set->value);
diff --git a/tools/libs/util/libxlu_cfg_i.h b/tools/libs/util/libxlu_cfg_i.h
index 3d1e4ed568..7193867422 100644
--- a/tools/libs/util/libxlu_cfg_i.h
+++ b/tools/libs/util/libxlu_cfg_i.h
@@ -26,7 +26,6 @@ enum XLU_Operation {
     XLU_OP_ADDITION,
 };
 
-void xlu__cfg_set_free(XLU_ConfigSetting *set);
 void xlu__cfg_set_store(CfgParseContext*, char *name,
                         enum XLU_Operation op,
                         XLU_ConfigValue *val, int lineno);
diff --git a/tools/libs/util/libxlu_internal.h b/tools/libs/util/libxlu_internal.h
index 2ef5eb7f5e..97303391c6 100644
--- a/tools/libs/util/libxlu_internal.h
+++ b/tools/libs/util/libxlu_internal.h
@@ -49,14 +49,6 @@ struct XLU_ConfigValue {
     YYLTYPE loc;
 };
 
-typedef struct XLU_ConfigSetting { /* transparent */
-    struct XLU_ConfigSetting *next;
-    char *name;
-    XLU_ConfigValue *value;
-    enum XLU_Operation op;
-    int lineno;
-} XLU_ConfigSetting;
-
 typedef struct {
     XLU_Config *cfg;
     int err, lexerrlineno, likely_python;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 16:55:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 16:55:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566056.884697 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMASq-0003Fd-6M; Wed, 19 Jul 2023 16:55:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566056.884697; Wed, 19 Jul 2023 16:55:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMASq-0003FW-3b; Wed, 19 Jul 2023 16:55:48 +0000
Received: by outflank-mailman (input) for mailman id 566056;
 Wed, 19 Jul 2023 16:55:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=5Pwt=DF=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qMASo-00037w-F6
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 16:55:46 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1a4a14f1-2655-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 18:55:45 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36JGtauS034072
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Wed, 19 Jul 2023 12:55:42 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36JGtaU7034071;
 Wed, 19 Jul 2023 09:55:36 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1a4a14f1-2655-11ee-b23a-6b7b168915f2
Message-Id: <4b72ad7c94e325f21849037cfe96eeb0723fa138.1689779749.git.ehem+xen@m5p.com>
In-Reply-To: <cover.1689779749.git.ehem+xen@m5p.com>
References: <cover.1689779749.git.ehem+xen@m5p.com>
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Cc: Juergen Gross <jgross@suse.com>
Date: Tue, 18 Jul 2023 22:02:48 -0700
Subject: [PATCH 6/7] tools/utils: remove libxlu_cfg_i.h from libxlu_disk.c
X-Spam-Status: No, score=1.5 required=10.0 tests=DATE_IN_PAST_06_12,
	KHOP_HELO_FCRDNS autolearn=no autolearn_force=no version=3.4.6
X-Spam-Level: *
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

The upper layer disk string parser doesn't need the internals of the
lower layer file parser.  Split the layers apart.  This is viable due
to the lower-layer internals having been removed from
libxlu_internals.h.

Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
 tools/libs/util/libxlu_disk.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/libs/util/libxlu_disk.c b/tools/libs/util/libxlu_disk.c
index a4d08ab7e9..92da9bd3b1 100644
--- a/tools/libs/util/libxlu_disk.c
+++ b/tools/libs/util/libxlu_disk.c
@@ -1,7 +1,6 @@
 #include "libxlu_internal.h"
 #include "libxlu_disk_l.h"
 #include "libxlu_disk_i.h"
-#include "libxlu_cfg_i.h"
 
 void xlu__disk_err(DiskParseContext *dpc, const char *erroneous,
                    const char *message) {
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 16:57:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 16:57:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566085.884718 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMAUM-0004H9-PH; Wed, 19 Jul 2023 16:57:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566085.884718; Wed, 19 Jul 2023 16:57:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMAUM-0004Gc-Ky; Wed, 19 Jul 2023 16:57:22 +0000
Received: by outflank-mailman (input) for mailman id 566085;
 Wed, 19 Jul 2023 16:57:21 +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 <SRS0=5Pwt=DF=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qMAR9-0001Uv-8S
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 16:54:03 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dc0ad879-2654-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 18:54:01 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36JGrquc034047
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Wed, 19 Jul 2023 12:53:57 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36JGrqGx034046;
 Wed, 19 Jul 2023 09:53:52 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dc0ad879-2654-11ee-8611-37d641c3527e
Message-Id: <a3a352b0ce0038eeaa708ba1db279cc8912ef9ba.1689779749.git.ehem+xen@m5p.com>
In-Reply-To: <cover.1689779749.git.ehem+xen@m5p.com>
References: <cover.1689779749.git.ehem+xen@m5p.com>
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Cc: Juergen Gross <jgross@suse.com>
Date: Thu, 13 Jul 2023 19:01:19 -0700
Subject: [PATCH 4/7] tools/utils: introduce xlu_cfg_printf() function
X-Spam-Status: No, score=2.5 required=10.0 tests=DATE_IN_PAST_96_XX,
	KHOP_HELO_FCRDNS autolearn=no autolearn_force=no version=3.4.6
X-Spam-Level: **
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

Isolate the lower layer configuration handling from the upper layer.  Now
only the lowest layer of configuration handling looks inside XLU_Config.

Also make error messages a bit more consistent.  Now PCI device parsing
will report filename.

Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
Someone else can decide where xlu__disk_err() should have its linebreaks
and indentation.  That string isn't very good.

I'm wondering about the return codes.  *printf() can return errors, but
so many places are ignoring them.  If the output is a console the errors
are fairly unlikely, but full storage does happen.
---
 tools/libs/util/libxlu_cfg.c      | 25 +++++++++++++++++++++++++
 tools/libs/util/libxlu_disk.c     | 14 +++++---------
 tools/libs/util/libxlu_internal.h |  9 +++------
 tools/libs/util/libxlu_pci.c      |  3 +--
 tools/libs/util/libxlu_vif.c      |  4 +---
 5 files changed, 35 insertions(+), 20 deletions(-)

diff --git a/tools/libs/util/libxlu_cfg.c b/tools/libs/util/libxlu_cfg.c
index 874f5abfb9..b2947cbfc9 100644
--- a/tools/libs/util/libxlu_cfg.c
+++ b/tools/libs/util/libxlu_cfg.c
@@ -18,12 +18,19 @@
 #define _GNU_SOURCE
 
 #include <limits.h>
+#include <stdarg.h>
 
 #include "libxlu_internal.h"
 #include "libxlu_cfg_y.h"
 #include "libxlu_cfg_l.h"
 #include "libxlu_cfg_i.h"
 
+struct XLU_Config {
+    XLU_ConfigSetting *settings;
+    FILE *report;
+    char *config_source;
+};
+
 XLU_Config *xlu_cfg_init(FILE *report, const char *report_source) {
     XLU_Config *cfg;
 
@@ -703,6 +710,24 @@ void xlu__cfg_yyerror(YYLTYPE *loc, CfgParseContext *ctx, char const *msg) {
     if (!ctx->err) ctx->err= EINVAL;
 }
 
+int xlu_cfg_printf(XLU_Config *cfg, const char *format, ...)
+{
+	va_list args;
+	int ret;
+
+	if (!cfg || !cfg->report)
+		return EFAULT;
+
+	fwrite(cfg->config_source, 1, strlen(cfg->config_source), cfg->report);
+	fwrite(": ", 2, 1, cfg->report);
+
+	va_start(args, format);
+	ret = vfprintf(cfg->report, format, args);
+	va_end(args);
+
+	return ret;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/util/libxlu_disk.c b/tools/libs/util/libxlu_disk.c
index 1de16a6a06..a4d08ab7e9 100644
--- a/tools/libs/util/libxlu_disk.c
+++ b/tools/libs/util/libxlu_disk.c
@@ -5,13 +5,10 @@
 
 void xlu__disk_err(DiskParseContext *dpc, const char *erroneous,
                    const char *message) {
-    fprintf(dpc->cfg->report,
-            "%s: config parsing error in disk specification: %s"
-            "%s%s%s"
-            " in `%s'\n",
-            dpc->cfg->config_source, message,
-            erroneous?": near `":"", erroneous?erroneous:"", erroneous?"'":"",
-            dpc->spec);
+    xlu_cfg_printf(dpc->cfg,
+            "config parsing error in disk specification: %s%s%s%s in `%s'\n",
+            message, erroneous?": near `":"", erroneous?erroneous:"",
+            erroneous?"'":"", dpc->spec);
     if (!dpc->err) dpc->err= EINVAL;
 }
 
@@ -29,8 +26,7 @@ static int dpc_prep(DiskParseContext *dpc, const char *spec) {
     return 0;
 
  fail:
-    fprintf(dpc->cfg->report, "cannot init disk scanner: %s\n",
-            strerror(errno));
+    xlu_cfg_printf(dpc->cfg, "cannot init disk scanner: %s\n", strerror(errno));
     return e;
 }
 
diff --git a/tools/libs/util/libxlu_internal.h b/tools/libs/util/libxlu_internal.h
index 1f7559ecd9..2ef5eb7f5e 100644
--- a/tools/libs/util/libxlu_internal.h
+++ b/tools/libs/util/libxlu_internal.h
@@ -57,12 +57,6 @@ typedef struct XLU_ConfigSetting { /* transparent */
     int lineno;
 } XLU_ConfigSetting;
 
-struct XLU_Config {
-    XLU_ConfigSetting *settings;
-    FILE *report;
-    char *config_source;
-};
-
 typedef struct {
     XLU_Config *cfg;
     int err, lexerrlineno, likely_python;
@@ -73,6 +67,9 @@ typedef struct {
 #define STRINGIFY(x) #x
 #define TOSTRING(x) STRINGIFY(x)
 
+extern int xlu_cfg_printf(XLU_Config *cfg, const char *format, ...)
+    __attribute__((__format__ (__printf__, 2, 3)));
+
 #endif /*LIBXLU_INTERNAL_H*/
 
 /*
diff --git a/tools/libs/util/libxlu_pci.c b/tools/libs/util/libxlu_pci.c
index 294482c6d7..d6abbc1c1f 100644
--- a/tools/libs/util/libxlu_pci.c
+++ b/tools/libs/util/libxlu_pci.c
@@ -5,8 +5,7 @@
 #include "libxlu_internal.h"
 
 
-#define XLU__PCI_ERR(_c, _x, _a...) \
-    if((_c) && (_c)->report) fprintf((_c)->report, _x, ##_a)
+#define XLU__PCI_ERR(_c, _x, _a...) xlu_cfg_printf((_c), _x, ##_a)
 
 static int parse_bdf(libxl_device_pci *pci, const char *str, const char **endp)
 {
diff --git a/tools/libs/util/libxlu_vif.c b/tools/libs/util/libxlu_vif.c
index ccf0cbdf57..93c449e213 100644
--- a/tools/libs/util/libxlu_vif.c
+++ b/tools/libs/util/libxlu_vif.c
@@ -6,9 +6,7 @@ static const char *vif_bytes_per_sec_re = "^[0-9]+[GMK]?[Bb]/s$";
 static const char *vif_internal_usec_re = "^[0-9]+[mu]?s?$";
 
 static void xlu__vif_err(XLU_Config *cfg, const char *msg, const char *rate) {
-    fprintf(cfg->report,
-            "%s: config parsing error in vif: %s in `%s'\n",
-            cfg->config_source, msg, rate);
+    xlu_cfg_printf(cfg, "config parsing error in vif: %s in `%s'\n", msg, rate);
 }
 
 static int vif_parse_rate_bytes_per_sec(XLU_Config *cfg, const char *bytes,
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 16:57:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 16:57:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566078.884709 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMAUL-0003ym-Jq; Wed, 19 Jul 2023 16:57:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566078.884709; Wed, 19 Jul 2023 16:57:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMAUL-0003yf-Du; Wed, 19 Jul 2023 16:57:21 +0000
Received: by outflank-mailman (input) for mailman id 566078;
 Wed, 19 Jul 2023 16:57:19 +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 <SRS0=5Pwt=DF=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qMAQT-0001Uv-5W
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 16:53:21 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c2feaa43-2654-11ee-8611-37d641c3527e;
 Wed, 19 Jul 2023 18:53:19 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36JGqxYS034041
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Wed, 19 Jul 2023 12:53:05 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36JGqxCQ034040;
 Wed, 19 Jul 2023 09:52:59 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c2feaa43-2654-11ee-8611-37d641c3527e
Message-Id: <6f482f3d54989e4ccce1b651db750c2e789a8886.1689779749.git.ehem+xen@m5p.com>
In-Reply-To: <cover.1689779749.git.ehem+xen@m5p.com>
References: <cover.1689779749.git.ehem+xen@m5p.com>
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Cc: Juergen Gross <jgross@suse.com>
Date: Sun, 9 Jul 2023 16:06:30 -0700
Subject: [PATCH 3/7] tools/utils: move XLU_Operation to libxlu_cfg_i.h.h
X-Spam-Status: No, score=2.5 required=10.0 tests=DATE_IN_PAST_96_XX,
	KHOP_HELO_FCRDNS autolearn=no autolearn_force=no version=3.4.6
X-Spam-Level: **
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

This enumerated value is never used outside of the lowest layer of the
configuration parser.  As such, move to the internal header.

Fixes: a30910bfd7 ("libxlu: Handle += in config files")
Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
I'm unsure whether this is fixing a30910bfd7.  Placing XLU_Operation in
libxlutil.h was certainly erroneous, but it is quite unlikely to directly
result in actual bugs.
---
 tools/include/libxlutil.h      | 5 -----
 tools/libs/util/libxlu_cfg_i.h | 5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/include/libxlutil.h b/tools/include/libxlutil.h
index 0ce66c2096..de57ca4200 100644
--- a/tools/include/libxlutil.h
+++ b/tools/include/libxlutil.h
@@ -25,11 +25,6 @@ enum XLU_ConfigValueType {
     XLU_LIST,
 };
 
-enum XLU_Operation {
-    XLU_OP_ASSIGNMENT = 0,
-    XLU_OP_ADDITION,
-};
-
 /* Unless otherwise stated, all functions return an errno value. */
 typedef struct XLU_Config XLU_Config;
 typedef struct XLU_ConfigList XLU_ConfigList;
diff --git a/tools/libs/util/libxlu_cfg_i.h b/tools/libs/util/libxlu_cfg_i.h
index 4217f5b28d..3d1e4ed568 100644
--- a/tools/libs/util/libxlu_cfg_i.h
+++ b/tools/libs/util/libxlu_cfg_i.h
@@ -21,6 +21,11 @@
 #include "libxlu_internal.h"
 #include "libxlu_cfg_y.h"
 
+enum XLU_Operation {
+    XLU_OP_ASSIGNMENT = 0,
+    XLU_OP_ADDITION,
+};
+
 void xlu__cfg_set_free(XLU_ConfigSetting *set);
 void xlu__cfg_set_store(CfgParseContext*, char *name,
                         enum XLU_Operation op,
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 16:57:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 16:57:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566092.884728 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMAUO-0004Xx-11; Wed, 19 Jul 2023 16:57:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566092.884728; Wed, 19 Jul 2023 16:57:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMAUN-0004Xk-TA; Wed, 19 Jul 2023 16:57:23 +0000
Received: by outflank-mailman (input) for mailman id 566092;
 Wed, 19 Jul 2023 16:57:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=5Pwt=DF=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qMATe-00037w-B5
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 16:56:38 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 392a26b5-2655-11ee-b23a-6b7b168915f2;
 Wed, 19 Jul 2023 18:56:37 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36JGuSsM034084
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Wed, 19 Jul 2023 12:56:34 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36JGuSMU034083;
 Wed, 19 Jul 2023 09:56:28 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 392a26b5-2655-11ee-b23a-6b7b168915f2
Message-Id: <56c1d2d7360945f5507817585c8303ad46072aee.1689779749.git.ehem+xen@m5p.com>
In-Reply-To: <cover.1689779749.git.ehem+xen@m5p.com>
References: <cover.1689779749.git.ehem+xen@m5p.com>
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Cc: Juergen Gross <jgross@suse.com>
Date: Tue, 18 Jul 2023 23:07:20 -0700
Subject: [PATCH 7/7] tools/utils: move remaining lower-layer data from
 libxlu_internal.h
X-Spam-Status: No, score=1.5 required=10.0 tests=DATE_IN_PAST_06_12,
	KHOP_HELO_FCRDNS autolearn=no autolearn_force=no version=3.4.6
X-Spam-Level: *
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

Correcting the order of #includes and data type declarations allows the
remaining lower-layer structures to move to libxlu_cfg_i.h.  Now
libxlu_internal.h is purely generalized routines meant to be shared
between all layers.

Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
 tools/libs/util/libxlu_cfg.c      |  2 +-
 tools/libs/util/libxlu_cfg_i.h    | 31 +++++++++++++++++++++++++++++++
 tools/libs/util/libxlu_internal.h | 30 ------------------------------
 3 files changed, 32 insertions(+), 31 deletions(-)

diff --git a/tools/libs/util/libxlu_cfg.c b/tools/libs/util/libxlu_cfg.c
index 2979d775a6..2913c99478 100644
--- a/tools/libs/util/libxlu_cfg.c
+++ b/tools/libs/util/libxlu_cfg.c
@@ -21,9 +21,9 @@
 #include <stdarg.h>
 
 #include "libxlu_internal.h"
+#include "libxlu_cfg_i.h"
 #include "libxlu_cfg_y.h"
 #include "libxlu_cfg_l.h"
-#include "libxlu_cfg_i.h"
 
 typedef struct XLU_ConfigSetting { /* transparent */
     struct XLU_ConfigSetting *next;
diff --git a/tools/libs/util/libxlu_cfg_i.h b/tools/libs/util/libxlu_cfg_i.h
index 7193867422..1c6a44b60f 100644
--- a/tools/libs/util/libxlu_cfg_i.h
+++ b/tools/libs/util/libxlu_cfg_i.h
@@ -19,6 +19,37 @@
 #define LIBXLU_CFG_I_H
 
 #include "libxlu_internal.h"
+
+struct XLU_ConfigList {
+    int avalues; /* available slots */
+    int nvalues; /* actual occupied slots */
+    XLU_ConfigValue **values;
+};
+
+typedef struct YYLTYPE
+{
+  int first_line;
+  int first_column;
+  int last_line;
+  int last_column;
+} YYLTYPE;
+#define YYLTYPE_IS_DECLARED
+
+struct XLU_ConfigValue {
+    enum XLU_ConfigValueType type;
+    union {
+        char *string;
+        XLU_ConfigList list;
+    } u;
+    YYLTYPE loc;
+};
+
+typedef struct {
+    XLU_Config *cfg;
+    int err, lexerrlineno, likely_python;
+    void *scanner;
+} CfgParseContext;
+
 #include "libxlu_cfg_y.h"
 
 enum XLU_Operation {
diff --git a/tools/libs/util/libxlu_internal.h b/tools/libs/util/libxlu_internal.h
index 97303391c6..7cbb2e632d 100644
--- a/tools/libs/util/libxlu_internal.h
+++ b/tools/libs/util/libxlu_internal.h
@@ -25,36 +25,6 @@
 
 #include "libxlutil.h"
 
-struct XLU_ConfigList {
-    int avalues; /* available slots */
-    int nvalues; /* actual occupied slots */
-    XLU_ConfigValue **values;
-};
-
-typedef struct YYLTYPE
-{
-  int first_line;
-  int first_column;
-  int last_line;
-  int last_column;
-} YYLTYPE;
-#define YYLTYPE_IS_DECLARED
-
-struct XLU_ConfigValue {
-    enum XLU_ConfigValueType type;
-    union {
-        char *string;
-        XLU_ConfigList list;
-    } u;
-    YYLTYPE loc;
-};
-
-typedef struct {
-    XLU_Config *cfg;
-    int err, lexerrlineno, likely_python;
-    void *scanner;
-} CfgParseContext;
-
 
 #define STRINGIFY(x) #x
 #define TOSTRING(x) STRINGIFY(x)
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 19 20:52:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 20:52:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566203.884738 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qME9n-0001c0-EB; Wed, 19 Jul 2023 20:52:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566203.884738; Wed, 19 Jul 2023 20:52:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qME9n-0001br-9p; Wed, 19 Jul 2023 20:52:23 +0000
Received: by outflank-mailman (input) for mailman id 566203;
 Wed, 19 Jul 2023 20:52:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qME9m-0001bi-Vx; Wed, 19 Jul 2023 20:52:22 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qME9m-0005vf-Nw; Wed, 19 Jul 2023 20:52:22 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qME9m-00054x-4v; Wed, 19 Jul 2023 20:52:22 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qME9m-0000qK-4U; Wed, 19 Jul 2023 20:52:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=4fDbxW5RTgNO2DqKZ6OvqcD6nCyIai8iy6OVnmvbhro=; b=u0yKOpbngBABOGhDCvGzBHQatQ
	dpxHKZSEPaGsnbqHImwb/N12yzzmzkI670DVNloK+72aLRlR6p1ZZ6DVj5kQqDfPFrsoJrPKPgNPJ
	ZC9/qwDkkZuLnWa2H/qA0ZGlPs5IH/cNdlxHR8l6aKJWGnPQHOKpIbmxpxTq/lc0tXgA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181907-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181907: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=a52044a9e602bc168cdf5d73a48952bfc9edb521
X-Osstest-Versions-That:
    ovmf=08aacbf0560d98929d402af029ac010d35abb3d6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 19 Jul 2023 20:52:22 +0000

flight 181907 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181907/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 a52044a9e602bc168cdf5d73a48952bfc9edb521
baseline version:
 ovmf                 08aacbf0560d98929d402af029ac010d35abb3d6

Last test of basis   181896  2023-07-19 12:12:15 Z    0 days
Testing same since   181907  2023-07-19 17:44:03 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Gerd Hoffmann <kraxel@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   08aacbf056..a52044a9e6  a52044a9e602bc168cdf5d73a48952bfc9edb521 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 21:10:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 21:10:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566210.884748 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMERA-0004xv-Pj; Wed, 19 Jul 2023 21:10:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566210.884748; Wed, 19 Jul 2023 21:10:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMERA-0004xo-Mr; Wed, 19 Jul 2023 21:10:20 +0000
Received: by outflank-mailman (input) for mailman id 566210;
 Wed, 19 Jul 2023 21:10:19 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMER9-0004xe-CD; Wed, 19 Jul 2023 21:10:19 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMER9-0006I4-3V; Wed, 19 Jul 2023 21:10:19 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMER8-0005nW-NZ; Wed, 19 Jul 2023 21:10:18 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMER8-0007ks-N4; Wed, 19 Jul 2023 21:10:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ZWNg4ROdnBSrmdN2Mw/fUqj+p3u1mkm2crHivCQ/sHM=; b=LHici+BwsFDhiyApXkaLMi4mQG
	4/RL7bX1FmbxXIfFfE3oRmGgb35Jkwt+LYhDgWQFBxYjkTLTlYoJ8J6bfgSwTz/PG7sjvNMOUMnjt
	HmW99i2mr5dxVhjE6wgi2m+lWJq/fKiWNVOZp4xaLvos3SWP567KLZMD3bU2pkBXXYhs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181888-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181888: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-multivcpu:guest-start:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=74f1456c4a5f3d7da4102ecae5c20370f89c6ed1
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 19 Jul 2023 21:10:18 +0000

flight 181888 linux-linus real [real]
flight 181908 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181888/
http://logs.test-lab.xenproject.org/osstest/logs/181908/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-multivcpu 14 guest-start        fail pass in 181908-retest
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 181908-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                74f1456c4a5f3d7da4102ecae5c20370f89c6ed1
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   94 days
Failing since        180281  2023-04-17 06:24:36 Z   93 days  180 attempts
Testing same since   181888  2023-07-18 22:01:59 Z    0 days    1 attempts

------------------------------------------------------------
3784 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 630831 lines long.)


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 22:07:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 22:07:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566225.884758 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMFJk-0003Ig-W4; Wed, 19 Jul 2023 22:06:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566225.884758; Wed, 19 Jul 2023 22:06:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMFJk-0003IZ-Rf; Wed, 19 Jul 2023 22:06:44 +0000
Received: by outflank-mailman (input) for mailman id 566225;
 Wed, 19 Jul 2023 22:06:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=5Pwt=DF=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qMFJj-0003IR-Lu
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 22:06:43 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 890ff670-2680-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 00:06:41 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36JM6NZ3035313
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Wed, 19 Jul 2023 18:06:29 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36JM6MK7035312;
 Wed, 19 Jul 2023 15:06:22 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 890ff670-2680-11ee-b23a-6b7b168915f2
Date: Wed, 19 Jul 2023 15:06:22 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
        Anthony PERARD <anthony.perard@citrix.com>,
        Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH 4/7] tools/utils: introduce xlu_cfg_printf() function
Message-ID: <ZLheXrr33YFd9nPU@mattapan.m5p.com>
References: <cover.1689779749.git.ehem+xen@m5p.com>
 <a3a352b0ce0038eeaa708ba1db279cc8912ef9ba.1689779749.git.ehem+xen@m5p.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <a3a352b0ce0038eeaa708ba1db279cc8912ef9ba.1689779749.git.ehem+xen@m5p.com>
X-Spam-Status: No, score=0.4 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

On Thu, Jul 13, 2023 at 07:01:19PM -0700, Elliott Mitchell wrote:
> 
> diff --git a/tools/libs/util/libxlu_cfg.c b/tools/libs/util/libxlu_cfg.c
> index 874f5abfb9..b2947cbfc9 100644
> --- a/tools/libs/util/libxlu_cfg.c
> +++ b/tools/libs/util/libxlu_cfg.c
> @@ -18,12 +18,19 @@
>  #include "libxlu_cfg_i.h"
>  
> +struct XLU_Config {
> +    XLU_ConfigSetting *settings;
> +    FILE *report;
> +    char *config_source;
> +};

When exploring further, for several places config_source being constant
works better.  The single exception is `xlu_cfg_destroy()` which would
then need to cast it to void *.


> @@ -703,6 +710,24 @@ void xlu__cfg_yyerror(YYLTYPE *loc, CfgParseContext *ctx, char const *msg) {
>      if (!ctx->err) ctx->err= EINVAL;
>  }
>  
> +int xlu_cfg_printf(XLU_Config *cfg, const char *format, ...)
> +{
> +	va_list args;
> +	int ret;
> +
> +	if (!cfg || !cfg->report)
> +		return EFAULT;
> +
> +	fwrite(cfg->config_source, 1, strlen(cfg->config_source), cfg->report);
> +	fwrite(": ", 2, 1, cfg->report);

The spots where this doesn't work so well are in libxlu_cfg.c.  Several
spots in libxlu_cfg.c use a format of "%s:%d: <message>" where the %d is
a line number.

Two approaches come to mind to use `xlu_cfg_printf()` for those.  First,
those messages could be modified to include the space.  Second,
`xlu_cfg_printf()` could merely add the colon, but not the space.

I'm pretty sure the upsides and downsides to those approaches are
obvious.  Only issue is which the maintainers would prefer.

(either messages get modified, or else have to add the space in many
places)


> diff --git a/tools/libs/util/libxlu_internal.h b/tools/libs/util/libxlu_internal.h
> index 1f7559ecd9..2ef5eb7f5e 100644
> --- a/tools/libs/util/libxlu_internal.h
> +++ b/tools/libs/util/libxlu_internal.h
> @@ -73,6 +67,9 @@ typedef struct {
>  #define STRINGIFY(x) #x
>  #define TOSTRING(x) STRINGIFY(x)
>  
> +extern int xlu_cfg_printf(XLU_Config *cfg, const char *format, ...)
> +    __attribute__((__format__ (__printf__, 2, 3)));

Again, after a bit more experimentation, the first argument should be
declared constant.

Hopefully 1-3 go through fine though.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Wed Jul 19 23:32:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 23:32:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566231.884768 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMGe9-0006dD-WB; Wed, 19 Jul 2023 23:31:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566231.884768; Wed, 19 Jul 2023 23:31:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMGe9-0006d6-Se; Wed, 19 Jul 2023 23:31:53 +0000
Received: by outflank-mailman (input) for mailman id 566231;
 Wed, 19 Jul 2023 23:31:52 +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
 <SRS0=+D1l=DF=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMGe8-0006d0-BT
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 23:31:52 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6dd377e0-268c-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 01:31:48 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 09EEE61877;
 Wed, 19 Jul 2023 23:31:45 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56228C433C7;
 Wed, 19 Jul 2023 23:31:43 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6dd377e0-268c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689809504;
	bh=DVA0e9kIvNDQy2uop6SmFT0yIwQ/xiM+n9Fdm/b0yQI=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=acdgQPeJzJFJ1/WUoxMbKDME256jdw4NYoJaokU+6hvdOKcD5PnSGSLQLQ6Uzm0in
	 sySowoHJght6Anhre5bLZOjfR3ta34+oRvEokNMiZGJ5U/T+pjq/0EQKuJoKhcfhe3
	 HTWN82G8RewRKeom1FSCv7hC+ZXjiQEKIkMA66y/TRfYdeNpwPZubzDAyvSdMX3Gj3
	 3D9VZCF3adMHulH0qBzS4DbV7q57sw3Jh2NIwRLBCi6p5H7yAAObFziMKh96+Y9CEL
	 7vhHf9wFgX89dEd41UmSAYAGUQ5TJvrb/w6ShI6IVPL05lDjeE9tY7l9kbPZuDUlw2
	 iZR3hzZhy4xCA==
Date: Wed, 19 Jul 2023 16:31:35 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Luca Fancellu <Luca.Fancellu@arm.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, 
    Bertrand Marquis <Bertrand.Marquis@arm.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: Experiments with clang-format and exclude-list.json
In-Reply-To: <040fef3e-9a7f-61bc-13f5-c34f6ffdcb09@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307191630380.3118466@ubuntu-linux-20-04-desktop>
References: <505E6BDD-823F-4337-8FB9-C3294D180E74@arm.com> <040fef3e-9a7f-61bc-13f5-c34f6ffdcb09@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="8323329-2025689580-1689809503=:3118466"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-2025689580-1689809503=:3118466
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT

On Tue, 18 Jul 2023, Jan Beulich wrote:
> On 18.07.2023 11:13, Luca Fancellu wrote:
> > Iâ€™ve done some experiment with clang-format and the hypervisor code (xen/xen/**), I had the need to exclude some files from the tool
> > and I thought to use the exclude-list.json, but since it was intended for MISRA, Iâ€™m now asking your feedback about that.
> > 
> > In my opinion it could make sense, because with that list we are excluding everything that is external and not adopting the Xen
> > coding style.
> > 
> > Do you have an opinion on that? Can it be one file? Or should it be a separate file only for the coding style exclusion?
> 
> It feels like back when the file was introduced I already commented on
> the potential for it to be multi-use, so long as it's actually dealing
> with the slightly separate needs. IOW I think it can be one file, but
> it needs to allow for files that want excluding from rule checkers, but
> not from style ones, and vice versa. Whether specific "comment" wording
> would be suitable, or whether instead separate attributes would want
> introducing is TBD.

I agree
--8323329-2025689580-1689809503=:3118466--


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 23:34:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 23:34:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566234.884778 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMGge-0007BC-Dy; Wed, 19 Jul 2023 23:34:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566234.884778; Wed, 19 Jul 2023 23:34:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMGge-0007B5-B3; Wed, 19 Jul 2023 23:34:28 +0000
Received: by outflank-mailman (input) for mailman id 566234;
 Wed, 19 Jul 2023 23:34:27 +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
 <SRS0=+D1l=DF=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMGgd-0007Ax-7P
 for xen-devel@lists.xenproject.org; Wed, 19 Jul 2023 23:34:27 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cb2779b6-268c-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 01:34:25 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id BAF4B61839;
 Wed, 19 Jul 2023 23:34:23 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13BB5C433C7;
 Wed, 19 Jul 2023 23:34:21 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cb2779b6-268c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689809663;
	bh=+YbbLSgZK+Uw1AA3E1iarkdRECGhJzsn2L5sDzBb5EU=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=ncXU2k58RXzjiR76+QgOYOj+T7S1K/OmoMUMmliNW/bEBQURpltNU++eIfh0un9KK
	 zgjrv1wZouv7ghyZcfDzZZxcU838i8o1/6s3KoC/teBFVvYYAwQWYCfGU9IeT1ZQgL
	 vExEUOSiS1k1o2Qw0ORL1vYCGfib/Y0T+NZhB8d3r0/E8tmqT96qmiciaSbwc7MH3e
	 F2JTsFBkZOFl+72w6Mf56j9dO8kb2d4s1S+K9prFC0DokHVH6w75XIn9yo4aCDalqj
	 r5iouPo3XofGNUBl+ekkxk9d9W2RXleS6/49nE9LvU2cyOMO1QS226rOWr39q3KX6P
	 qtdg2Lm7GRiwQ==
Date: Wed, 19 Jul 2023 16:34:20 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Yang Xu <yang.xu@mediatek.com>
cc: xen-devel@lists.xenproject.org, Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Wei Liu <wl@xen.org>
Subject: Re: [XEN PATCH] docs/misc: fix document typo
In-Reply-To: <20230718122529.19912-1-yang.xu@mediatek.com>
Message-ID: <alpine.DEB.2.22.394.2307191634110.3118466@ubuntu-linux-20-04-desktop>
References: <20230718122529.19912-1-yang.xu@mediatek.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 18 Jul 2023, yang.xu@mediatek.com wrote:
> From: Yang Xu <yang.xu@mediatek.com>
> 
> Fix document typo for more accurate meaning
> 
> Signed-off-by: Yang Xu <yang.xu@mediatek.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  docs/misc/xen-makefiles/makefiles.rst | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/docs/misc/xen-makefiles/makefiles.rst b/docs/misc/xen-makefiles/makefiles.rst
> index 04bc72601c..bc2f932fbc 100644
> --- a/docs/misc/xen-makefiles/makefiles.rst
> +++ b/docs/misc/xen-makefiles/makefiles.rst
> @@ -68,7 +68,7 @@ Descending down in directories
>  
>  	It is good practice to use a `CONFIG_` variable when assigning directory
>  	names. This allows the build system to totally skip the directory if the
> -	corresponding `CONFIG_` option is 'y'.
> +	corresponding `CONFIG_` option is not set to 'y'.
>  
>  Compilation flags
>  -----------------
> -- 
> 2.25.1
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 19 23:41:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Jul 2023 23:41:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566238.884788 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMGnj-0000dL-8e; Wed, 19 Jul 2023 23:41:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566238.884788; Wed, 19 Jul 2023 23:41:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMGnj-0000dE-5r; Wed, 19 Jul 2023 23:41:47 +0000
Received: by outflank-mailman (input) for mailman id 566238;
 Wed, 19 Jul 2023 23:41:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMGnh-0000cj-Te; Wed, 19 Jul 2023 23:41:45 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMGnh-0001Kq-Hm; Wed, 19 Jul 2023 23:41:45 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMGnh-0003jk-4T; Wed, 19 Jul 2023 23:41:45 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMGnh-0007Dv-3y; Wed, 19 Jul 2023 23:41:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=RIthBuDGdtNFoG8sxOS1BCkQU+TGbiIpyJkwcd23lsY=; b=rNZ82+AkRfTp2M4LawoPR/lc/l
	gwcZYqIBxVq8Nn72bNXRlQMJNpi8/s7Nbgah7YaOJN4eGdz/V6h5ACeiWJlnYff39xKDRyVMmNCYw
	7iAgd2e1jszJ8oYUOc/gec7znS9f+5EXqb3T5dGZq2nrncJ6oSPVkPA06yi8QD3yV2RM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181889-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-upstream-4.17-testing test] 181889: regressions - trouble: fail/pass/starved
X-Osstest-Failures:
    qemu-upstream-4.17-testing:build-arm64-pvops:kernel-build:fail:regression
    qemu-upstream-4.17-testing:test-amd64-i386-xl-vhd:guest-start.2:fail:heisenbug
    qemu-upstream-4.17-testing:test-amd64-i386-xl-qemuu-ws16-amd64:xen-install:fail:heisenbug
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt:guest-start/debian.repeat:fail:heisenbug
    qemu-upstream-4.17-testing:test-amd64-i386-qemuu-rhel6hvm-amd:redhat-install:fail:heisenbug
    qemu-upstream-4.17-testing:test-amd64-i386-xl-vhd:xen-install:fail:heisenbug
    qemu-upstream-4.17-testing:test-amd64-i386-pair:xen-install/src_host:fail:heisenbug
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-xsm:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-raw:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-xsm:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit1:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-thunderx:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-vhd:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit2:build-check(1):blocked:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-qcow2:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-raw:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-rtds:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-vhd:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-arndale:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-multivcpu:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit1:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit2:hosts-allocate:starved:nonblocking
X-Osstest-Versions-This:
    qemuu=eeaede60ffb1760c06850cae562d104e4f98c859
X-Osstest-Versions-That:
    qemuu=b746458e1ce1bec85e58b458386f8b7a0bedfaa6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 19 Jul 2023 23:41:45 +0000

flight 181889 qemu-upstream-4.17-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181889/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-arm64-pvops             6 kernel-build   fail in 181841 REGR. vs. 175008

Tests which are failing intermittently (not blocking):
 test-amd64-i386-xl-vhd       22 guest-start.2    fail in 181865 pass in 181841
 test-amd64-i386-xl-qemuu-ws16-amd64 7 xen-install fail in 181865 pass in 181889
 test-amd64-i386-libvirt 20 guest-start/debian.repeat fail in 181865 pass in 181889
 test-amd64-i386-qemuu-rhel6hvm-amd 12 redhat-install fail in 181865 pass in 181889
 test-amd64-i386-xl-vhd        7 xen-install                fail pass in 181865
 test-amd64-i386-pair         10 xen-install/src_host       fail pass in 181865

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-libvirt-xsm  1 build-check(1)           blocked in 181841 n/a
 test-arm64-arm64-libvirt-raw  1 build-check(1)           blocked in 181841 n/a
 test-arm64-arm64-xl-xsm       1 build-check(1)           blocked in 181841 n/a
 test-arm64-arm64-xl-credit1   1 build-check(1)           blocked in 181841 n/a
 test-arm64-arm64-xl           1 build-check(1)           blocked in 181841 n/a
 test-arm64-arm64-xl-thunderx  1 build-check(1)           blocked in 181841 n/a
 test-arm64-arm64-xl-vhd       1 build-check(1)           blocked in 181841 n/a
 test-arm64-arm64-xl-credit2   1 build-check(1)           blocked in 181841 n/a
 test-armhf-armhf-libvirt 16 saverestore-support-check fail in 181865 like 175008
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check fail in 181865 like 175008
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail in 181865 like 175008
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check fail in 181865 never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check fail in 181865 never pass
 test-armhf-armhf-xl-credit2 15 migrate-support-check fail in 181865 never pass
 test-armhf-armhf-xl-credit2 16 saverestore-support-check fail in 181865 never pass
 test-armhf-armhf-xl-arndale 15 migrate-support-check fail in 181865 never pass
 test-armhf-armhf-xl-arndale 16 saverestore-support-check fail in 181865 never pass
 test-armhf-armhf-xl-credit1 15 migrate-support-check fail in 181865 never pass
 test-armhf-armhf-xl-credit1 16 saverestore-support-check fail in 181865 never pass
 test-armhf-armhf-libvirt    15 migrate-support-check fail in 181865 never pass
 test-armhf-armhf-xl-rtds    15 migrate-support-check fail in 181865 never pass
 test-armhf-armhf-xl         15 migrate-support-check fail in 181865 never pass
 test-armhf-armhf-xl-rtds 16 saverestore-support-check fail in 181865 never pass
 test-armhf-armhf-xl     16 saverestore-support-check fail in 181865 never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check fail in 181865 never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check fail in 181865 never pass
 test-armhf-armhf-xl-vhd     14 migrate-support-check fail in 181865 never pass
 test-armhf-armhf-xl-vhd 15 saverestore-support-check fail in 181865 never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 175008
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 175008
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 175008
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 175008
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 175008
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt      3 hosts-allocate               starved  n/a
 test-armhf-armhf-libvirt-qcow2  3 hosts-allocate               starved  n/a
 test-armhf-armhf-libvirt-raw  3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-rtds      3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-vhd       3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl           3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-arndale   3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-multivcpu  3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-credit1   3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-credit2   3 hosts-allocate               starved  n/a

version targeted for testing:
 qemuu                eeaede60ffb1760c06850cae562d104e4f98c859
baseline version:
 qemuu                b746458e1ce1bec85e58b458386f8b7a0bedfaa6

Last test of basis   175008  2022-12-01 11:10:52 Z  230 days
Testing same since   181841  2023-07-17 11:41:16 Z    2 days    3 attempts

------------------------------------------------------------
People who touched revisions under test:
  Haochen Tong <i@hexchain.org>
  Jason Wang <jasowang@redhat.com>
  Miroslav Rezanina <mrezanin@redhat.com>
  Thomas Huth <thuth@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          starved 
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  starved 
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  starved 
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  starved 
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     starved 
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                starved 
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               starved 
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 starved 
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     starved 
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      starved 
 test-amd64-i386-xl-vhd                                       fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit eeaede60ffb1760c06850cae562d104e4f98c859
Author: Miroslav Rezanina <mrezanin@redhat.com>
Date:   Wed Nov 9 10:57:13 2022 -0500

    qemu-img: remove unused variable
    
    Variable block_count used in img_dd function is only incremented but never read.
    This causes 'Unused but set variable' warning on Clang 15.0.1 compiler.
    
    Removing the variable to prevent the warning.
    
    Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <e86d5b57f9d13bde995c616a533b876f1fb8a527.1668009030.git.mrezanin@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    (cherry picked from commit 0f48c47c679bc29fceb3a67283ee3b78175524bf)

commit 83b8b039db0efefd851dc62160728a69b36e09aa
Author: Miroslav Rezanina <mrezanin@redhat.com>
Date:   Wed Nov 9 10:57:12 2022 -0500

    tulip: Remove unused variable
    
    Variable n used in tulip_idblock_crc function is only incremented but never read.
    This causes 'Unused but set variable' warning on Clang 15.0.1 compiler.
    
    Removing the variable to prevent the warning.
    
    Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <02e1560d115c208df32236df8916fed98429fda1.1668009030.git.mrezanin@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    (cherry picked from commit 6083dcad80743718620a3f8a72fb76ea8b7c28ca)

commit 7385a130d841aeaf39e8773af869eb54cc7d6a7f
Author: Miroslav Rezanina <mrezanin@redhat.com>
Date:   Wed Nov 9 10:57:11 2022 -0500

    rtl8139: Remove unused variable
    
    Variable send_count used in rtl8139_cplus_transmit_one function is only
    incremented but never read. This causes 'Unused but set variable' warning
    on Clang 15.0.1 compiler.
    
    Removing the variable to prevent the warning.
    
    Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <15a32dd06c492216cbf27cd3ddcbe1e9afb8d8f5.1668009030.git.mrezanin@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    (cherry picked from commit 7d7238c72b983cff5064734349d2d45be9c6282c)

commit 27ca28d169038bf7fe70341c4cbb8fddd3791e8b
Author: Haochen Tong <i@hexchain.org>
Date:   Sat May 28 03:06:58 2022 +0800

    ebpf: replace deprecated bpf_program__set_socket_filter
    
    bpf_program__set_<TYPE> functions have been deprecated since libbpf 0.8.
    Replace with the equivalent bpf_program__set_type call to avoid a
    deprecation warning.
    
    Signed-off-by: Haochen Tong <i@hexchain.org>
    Reviewed-by: Zhang Chen <chen.zhang@intel.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
    (cherry picked from commit a495eba03c31c96d6a0817b13598ce2219326691)


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:02:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:02:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566243.884798 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMH74-0004M7-La; Thu, 20 Jul 2023 00:01:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566243.884798; Thu, 20 Jul 2023 00:01:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMH74-0004M0-IS; Thu, 20 Jul 2023 00:01:46 +0000
Received: by outflank-mailman (input) for mailman id 566243;
 Thu, 20 Jul 2023 00:01:44 +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
 <SRS0=1UDO=DG=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMH72-0004Lu-Gl
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:01:44 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9b0d7b3a-2690-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 02:01:42 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id F173261884;
 Thu, 20 Jul 2023 00:01:40 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DE02C43391;
 Thu, 20 Jul 2023 00:01:38 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9b0d7b3a-2690-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689811300;
	bh=AjdGcmprCunfVF4lRNk5Ga7lLcKHXtvT8jajIM9AiUQ=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=XyriQBlCBMIqYhuLlvgZ12LRt5Z7lptqkjHeK/jrRWLpCaOvcK715//T/XWRMYxbX
	 0cumyeioL4H1EM4Qgkad/E6EhixS/SgsYF8yHJj328I2YanjPluWMOwxXU7P6t+Cx6
	 O9b73waVqNZEz4c+Vuws4b/hKdEReQCIEiHn5PiFdjl7xSZ8xOK9NZFXZckN9Q1Zeb
	 xnstTw0DOTxT63gzWgM0DAhUwcvl6YW2FuQhFst7eB3tH6jRs4G9RXOEmu+zs8+eL5
	 IkC8E2mEa/OEf1ZNj0qo+gQ0rXGnjQ6wEPvZay9TdYkfT6CH/b9DbOgD+eD8PEMe4q
	 Qi25yy5IFXapQ==
Date: Wed, 19 Jul 2023 17:01:36 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Tamas K Lengyel <tamas@tklengyel.com>, 
    Alexandru Isaila <aisaila@bitdefender.com>, 
    Petre Pircalabu <ppircalabu@bitdefender.com>, 
    Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <xenia.ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH] x86: change parameter name of hvm_monitor_msr()
 declaration
In-Reply-To: <99289902f337b83f1ea034fa1eff5db5bdae6c46.1689686715.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307191701300.3118466@ubuntu-linux-20-04-desktop>
References: <99289902f337b83f1ea034fa1eff5db5bdae6c46.1689686715.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 18 Jul 2023, Federico Serafini wrote:
> Change the parameter name of hvm_monitor_msr() declaration from
> 'value' to 'new_value' to match the corresponding defintion.
> This fixes a violation of MISRA C:2012 Rule 8.3 ("All declarations of
> an object or function shall use the same names and type qualifiers").
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  xen/arch/x86/include/asm/hvm/monitor.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/x86/include/asm/hvm/monitor.h b/xen/arch/x86/include/asm/hvm/monitor.h
> index 5276b0af08..02021be47b 100644
> --- a/xen/arch/x86/include/asm/hvm/monitor.h
> +++ b/xen/arch/x86/include/asm/hvm/monitor.h
> @@ -25,7 +25,7 @@ bool hvm_monitor_cr(unsigned int index, unsigned long value,
>                      unsigned long old);
>  #define hvm_monitor_crX(cr, new, old) \
>                          hvm_monitor_cr(VM_EVENT_X86_##cr, new, old)
> -bool hvm_monitor_msr(unsigned int msr, uint64_t value, uint64_t old_value);
> +bool hvm_monitor_msr(unsigned int msr, uint64_t new_value, uint64_t old_value);
>  void hvm_monitor_descriptor_access(uint64_t exit_info,
>                                     uint64_t vmx_exit_qualification,
>                                     uint8_t descriptor, bool is_write);
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:22:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566247.884808 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHQv-0007PV-Fq; Thu, 20 Jul 2023 00:22:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566247.884808; Thu, 20 Jul 2023 00:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHQv-0007PO-CP; Thu, 20 Jul 2023 00:22:17 +0000
Received: by outflank-mailman (input) for mailman id 566247;
 Thu, 20 Jul 2023 00:22:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=1UDO=DG=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMHQt-0007PI-W5
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:22:15 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 79762029-2693-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 02:22:14 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 1B519617DB;
 Thu, 20 Jul 2023 00:22:13 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B817C433C7;
 Thu, 20 Jul 2023 00:22:11 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 79762029-2693-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689812532;
	bh=iOhtG18Xjx35RfOoBf0pJWVGi8TqQirc725rJUlwmzk=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=lDAkS2y/rn4oqw1FHxQLNGIklfDbgrJoCMbXTU7b//CGZq15PX6F/Y6htgT7/H+0B
	 4gM9BVSeU4xNQ3Knbc52XgNboDZKrKSKIPZY+p+WRmBK2izjDflj4Yu6dwmRITciQ6
	 03Fb4GjlVMplSqJJpeXni/KCvfD1WRWFe4owrQuSnS7efq/xgUGniAgAX5adsRMYWG
	 LY+4V1vgN4kd6imrz9r20g5h78H+dIf04xQaG+898vINATyKh18QK3rSizEEtR5N8X
	 OwPURvG25OOCPlt6AfYt7kOieFSkynrOlWygY5ESJl3ZD66LF4l59TXtL7UvMC6Av8
	 nlVq06NNKB5OA==
Date: Wed, 19 Jul 2023 17:22:09 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
cc: Rahul Singh <rahul.singh@arm.com>, 
    "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
    "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, 
    Juergen Gross <jgross@suse.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Boris Ostrovsky <boris.ostrovsky@oracle.com>, 
    David Woodhouse <dwmw@amazon.co.uk>, 
    Jane Malalane <jane.malalane@citrix.com>
Subject: Re: [PATCH v3] xen/evtchn: Introduce new IOCTL to bind static
 evtchn
In-Reply-To: <9a917f42-1a22-0c75-459e-db30c17dbe78@epam.com>
Message-ID: <alpine.DEB.2.22.394.2307191722010.3118466@ubuntu-linux-20-04-desktop>
References: <ae7329bf1713f83e4aad4f3fa0f316258c40a3e9.1689677042.git.rahul.singh@arm.com> <9a917f42-1a22-0c75-459e-db30c17dbe78@epam.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="8323329-27211591-1689812531=:3118466"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-27211591-1689812531=:3118466
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT

On Tue, 18 Jul 2023, Oleksandr Tyshchenko wrote:
> On 18.07.23 14:31, Rahul Singh wrote:
> 
> 
> Hello Rahul
> 
> 
> > Xen 4.17 supportsÂ the creation of static evtchns. To allow user space
> > application to bind static evtchns introduce new ioctl
> > "IOCTL_EVTCHN_BIND_STATIC". Existing IOCTL doing more than binding
> > thatâ€™s why we need to introduce the new IOCTL to only bind the static
> > event channels.
> > 
> > Static evtchns to be available for use during the lifetime of the
> > guest. When the application exits, __unbind_from_irq() ends up being
> > called from release() file operations because of that static evtchns
> > are getting closed. To avoid closing the static event channel, add the
> > new bool variable "is_static" in "struct irq_info" to mark the event
> > channel static when creating the event channel to avoid closing the
> > static evtchn.
> > 
> > Also, take this opportunity to remove the open-coded version of the
> > evtchn close in drivers/xen/evtchn.c file and use xen_evtchn_close().
> > 
> > Signed-off-by: Rahul Singh <rahul.singh@arm.com>
> > ---
> > v3:
> >   * Remove the open-coded version of the evtchn close in drivers/xen/evtchn.c
> 
> Thanks!
> 
> Looks like there is one unmentioned change in change-log since v2:
> * Make sure that evtchn hasn't been added yet before binding it in 
> evtchn_ioctl():case IOCTL_EVTCHN_BIND_STATIC
> 
> Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>
--8323329-27211591-1689812531=:3118466--


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:23:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:23:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566250.884817 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHS1-0007v6-Ou; Thu, 20 Jul 2023 00:23:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566250.884817; Thu, 20 Jul 2023 00:23:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHS1-0007uz-M9; Thu, 20 Jul 2023 00:23:25 +0000
Received: by outflank-mailman (input) for mailman id 566250;
 Thu, 20 Jul 2023 00:23:24 +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
 <SRS0=1UDO=DG=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMHS0-0007up-Oe
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:23:24 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a1e2bda4-2693-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 02:23:22 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 02BCE617DB;
 Thu, 20 Jul 2023 00:23:21 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id C82DDC433C8;
 Thu, 20 Jul 2023 00:23:18 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a1e2bda4-2693-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689812600;
	bh=QClN7fgNnxh+r8yNUtg6htkB5pfGF02mh3r8mdJWKY4=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=qDHV/2ueCFWw9fGyDDzDsIV8QaL84wqtk0IOzEkTJNpX3uZcmCOfYHDFLoV+rl1QI
	 C3uu6QYZnCzFOZHkRaG80bR+7Dtb0YJj3czwpdR/s3UxfxtixUFpzKjwlxIfC7GjXO
	 o15E7iiVkujhZeOzeMokU7S/NfwmtbirLZTkNv+7B5i8wQ55/C2a9GexEi1Ru/0DHr
	 xsOGafZf/nbTNpr9kHOIkTVDaODF6imYr9z7E67txDJcc64RmopR6QpKQetMaxE5II
	 2VC6yPWVHRC/INeyeg+D56C4+FUJCRjaVCEc+JE2JzayuGJYTDM70XsYnHEAQibBaW
	 0UvamxrJrKOlw==
Date: Wed, 19 Jul 2023 17:23:16 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org, 
    michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, 
    consulting@bugseng.com, Jan Beulich <jbeulich@suse.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>, 
    Julien Grall <julien@xen.org>
Subject: Re: [XEN PATCH] xen: address MISRA C:2012 Rule 4.1
In-Reply-To: <378f18c287cfb65d25b42209c85645a2a10ff9b2.1689763253.git.nicola.vetrini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307191723090.3118466@ubuntu-linux-20-04-desktop>
References: <378f18c287cfb65d25b42209c85645a2a10ff9b2.1689763253.git.nicola.vetrini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 19 Jul 2023, Nicola Vetrini wrote:
> MISRA C:2012 Rule 4.1 has the following headline:
> "Octal and hexadecimal escape sequences shall be terminated."
> 
> The string literals modified by this patch contain octal or
> hexadecimal escape sequences that are neither terminated by the
> end of the literal, nor by the beginning of another escape sequence.
> 
> Therefore, such unterminated sequences have been split into a
> separate literal as a way to comply with the rule and preserve the
> semantics of the code.
> 
> No functional changes.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> The choice whether to put a blank between the literals is up to
> the maintainers' preference, I chose to do so to improve legibility.
> ---
>  xen/arch/x86/hvm/hvm.c  | 2 +-
>  xen/common/decompress.c | 4 ++--
>  xen/common/xz/stream.h  | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index 57363c2ae1..24ccf60d77 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -3853,7 +3853,7 @@ void hvm_ud_intercept(struct cpu_user_regs *regs)
>                                          cs, &addr) &&
>               (hvm_copy_from_guest_linear(sig, addr, sizeof(sig),
>                                           walk, NULL) == HVMTRANS_okay) &&
> -             (memcmp(sig, "\xf\xbxen", sizeof(sig)) == 0) )
> +             (memcmp(sig, "\xf\xb" "xen", sizeof(sig)) == 0) )
>          {
>              regs->rip += sizeof(sig);
>              regs->eflags &= ~X86_EFLAGS_RF;
> diff --git a/xen/common/decompress.c b/xen/common/decompress.c
> index 989336983f..2c2c2ad877 100644
> --- a/xen/common/decompress.c
> +++ b/xen/common/decompress.c
> @@ -19,13 +19,13 @@ int __init decompress(void *inbuf, unsigned int len, void *outbuf)
>      if ( len >= 3 && !memcmp(inbuf, "\x42\x5a\x68", 3) )
>          return bunzip2(inbuf, len, NULL, NULL, outbuf, NULL, error);
>  
> -    if ( len >= 6 && !memcmp(inbuf, "\3757zXZ", 6) )
> +    if ( len >= 6 && !memcmp(inbuf, "\375" "7zXZ", 6) )
>          return unxz(inbuf, len, NULL, NULL, outbuf, NULL, error);
>  
>      if ( len >= 2 && !memcmp(inbuf, "\135\000", 2) )
>          return unlzma(inbuf, len, NULL, NULL, outbuf, NULL, error);
>  
> -    if ( len >= 5 && !memcmp(inbuf, "\x89LZO", 5) )
> +    if ( len >= 5 && !memcmp(inbuf, "\x89" "LZO", 5) )
>          return unlzo(inbuf, len, NULL, NULL, outbuf, NULL, error);
>  
>      if ( len >= 2 && !memcmp(inbuf, "\x02\x21", 2) )
> diff --git a/xen/common/xz/stream.h b/xen/common/xz/stream.h
> index d36d0fec64..8d9fbbe1b5 100644
> --- a/xen/common/xz/stream.h
> +++ b/xen/common/xz/stream.h
> @@ -18,7 +18,7 @@
>  
>  #define STREAM_HEADER_SIZE 12
>  
> -#define HEADER_MAGIC "\3757zXZ"
> +#define HEADER_MAGIC "\375" "7zXZ"
>  #define HEADER_MAGIC_SIZE 6
>  
>  #define FOOTER_MAGIC "YZ"
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:32:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:32:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566253.884828 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb0-0001JW-Kq; Thu, 20 Jul 2023 00:32:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566253.884828; Thu, 20 Jul 2023 00:32:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb0-0001JP-GJ; Thu, 20 Jul 2023 00:32:42 +0000
Received: by outflank-mailman (input) for mailman id 566253;
 Thu, 20 Jul 2023 00:32:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=5z78=DG=epam.com=prvs=156527e6f7=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qMHay-0001JI-MS
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:32:40 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ed4632e2-2694-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 02:32:38 +0200 (CEST)
Received: from pps.filterd (m0174678.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36JMeiB4017190
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 00:32:37 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2057.outbound.protection.outlook.com [104.47.13.57])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rxgyx9k43-2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 00:32:36 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS8PR03MB7783.eurprd03.prod.outlook.com (2603:10a6:20b:407::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 00:32:31 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6588.035; Thu, 20 Jul 2023
 00:32:30 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ed4632e2-2694-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=fbF0bKnUtZ9ymR4HbSCROfRaaceHqpUNQBH26ssCKQDdJXaQ2tdz4BCa5cvjXfM+2CXyKx5X3M0ZraS5S2oDx+b085zBUffS9YMef3DZocfgryG9Y12hW20xhfnoKTK42HkUCosQ7zFUV5R5gW6VkB/B/74dee2pwziiVl6eKa/LoCXdnsOtrsEMnh61BlCpGhFStB/yPwSqCLbgeKPyVuBJfkDJA1KhzDV0WfbrMtgx0FF4z9lBEdVHekZOky2dN5cdPFtDZlwNMcmEQkGhcKWLAzG6WN9FXLwqczOJIiw5nQsOqNePn7htz6GJoBAsd8Co6fJ2kkBPj5javY1ydw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=JeowWcWPtPbWi0eZ5zqE5dIolWtWXr+/pLHrvWgkYIw=;
 b=EzPRdT+/Lh86sZc6Eq2rPy90VHag5ZaZm2CTy2jcQ5KGL4eXtRdcKge/fjv8qydsBLcQ4vLG7AC8F4ZN58v+B8jva+6dTpJ06coJeQrn9EAi7g7i0JWdt9l5uZ5k9WeLFWex/MFfJgRjXZKF70ACcFCro5HFRY11wWIjOeh21JJhgdxgR2Aw/aBGHI3s+MVZA/0LAJW4S7i8Sccq991JY48V2C8LCj58M+2IsJcPPc4EkXRvboOd6vTk5pf8F+5QBVMu1gGyjjgMdATiviWXaAsfiLnGG1eSjRQM/sQcvBzkf0GbS8iS9JEtC7g+/M/5Q6J2R58A/QFjdGXGAz1Mkw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=JeowWcWPtPbWi0eZ5zqE5dIolWtWXr+/pLHrvWgkYIw=;
 b=Ms3+PTMXxzhiQ/YLHmQS9srZJWqfcr7ksM0HqUTk/6gulYAN7WipaptW414VCQXyyTVAyPIQwgDK/S0IUutNtLLTOXo+NVIQ4dMA0sh2Kt7AjyS7z+SHRMO3dpIRozhKv+zmhTqq8D975MwzT44a36cqphgm4m2qbr7ao6nX0oGcPlAyJCTgiOSoTtD7tYo1+QnSpKUCW7vyMqMtrO6gZrcHKDViKqnANvCwH8LZzpiPVj8uTVlzICCMfgQ3YITVRL4+7Aj++d1wBAFkwpK6nfW+iVEg0DE7e5x9hrTPHPCrhXIu+D53LJM9EE7zefXsVvqc3IBG2fJy0Igd7++A0w==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH v8 00/13] PCI devices passthrough on Arm, part 3
Thread-Topic: [PATCH v8 00/13] PCI devices passthrough on Arm, part 3
Thread-Index: AQHZuqGqn2EU3dWVak6ca3YhrfMkhg==
Date: Thu, 20 Jul 2023 00:32:30 +0000
Message-ID: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-mailer: git-send-email 2.41.0
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS8PR03MB7783:EE_
x-ms-office365-filtering-correlation-id: 321a223e-27e2-4bf1-f2db-08db88b8cd7f
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 43cJlLMRYqHQR/vpUCi5bRyjhiJgd8a6GBG7gCxq+dCimBww/k91Ufjdbtk0YK7SpttfdwO/il0ESazyVhhXBoqafqa4/EowJG6ppWxO/25tHst30F3A36tWZKP+WPex4dVEym9zaKYcN2uSeFMNLg2Qnv3wo1LQnOa8QwLJ2B9PsxqR1YrGO/4k4J4oRE/WRtTYOQEWEBMABRnJfn5DLM1Lvk5yWIbsFfTg9Ke1ZHTHTISSiyY52rYsrBRz9FXLKTD+54PloHLwva0h05+nuuYVOMTOi+cI7xGwReWkaqlcvIy7ElCt5PM2JU/MO2bIbDS1p8BteLvsA2uerVd2Q2mgtYb4iJy6c7oDnXIdQiV4FzaP2jokPusuxCP1QGhzcgqQJ3TlN+Ur2Wyf/duuMPUGQTU8Aa9FWhTkM79C9ySAi64WkkL+C2jtf5yphceXlEWSytkDUFvX1+pWOo7hg31BiXQuXOqW02tgSo9iVZKQ6Ix+UBvaZD3Jc0gpNhnYKC8haSkUXpAaMxyK7ht3mYaD6pEKt10nEnHmlXjJ4R0v/oMLJjIH4QEq08Q4lIhiQO28vI98WyvpCqtJA6iiOPTJFOOBXpR04ZvBxIpm+ZSQcc+iXcdjjViNmGPxrJv2
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(346002)(366004)(396003)(376002)(451199021)(55236004)(26005)(1076003)(6506007)(41300700001)(316002)(83380400001)(2616005)(107886003)(186003)(6512007)(6486002)(122000001)(478600001)(66946007)(71200400001)(4326008)(64756008)(38070700005)(66556008)(76116006)(66476007)(91956017)(6916009)(38100700002)(86362001)(5660300002)(66446008)(8936002)(8676002)(36756003)(2906002);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?aytWMGYveDdVWjRpZFpzVllnNGJXR2d2emhYdnBYY0twdzlPa2JOVFQ2VTdD?=
 =?utf-8?B?VmtRbEQvUE56akxQU2NuVFVXbUpZY0k1YzBSeFd0RDNkbjJSYVZHd2JRRldX?=
 =?utf-8?B?eHl2d0dzRGxQaVI2aU5RQTNMNDNJWUxoSGovZXZZbngyQ3FXVlFJWjNhVDlP?=
 =?utf-8?B?NzJWeGlKUC9XUklKbGJ5cVZlTUVweitHNXh5MFozS1dpb2Nnc1FtRlo3Y0xv?=
 =?utf-8?B?WE9mckdHVldlaThiQUhlYy9Nb2dXQjMraVQ5dTZ0VWJPKysvK3gySEJrR2tz?=
 =?utf-8?B?eC9hMFBUSGhudHRqelkwNjB2ZVRSaTBGWXkvVWh6bjJNMFNTMnpHUFZ1UzhM?=
 =?utf-8?B?SUFnT1NVbmQ5d1c5bUdLc2lSQWtzUTkrRHNjY3JSQ2VuaGl2UlJDK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QWk5SGVQcURZMFRlVURhME9UbDBEb0dqbkdydWs1dWtB?=
 =?utf-8?B?RGc9PQ==?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <50EB4D64EAA452418832C6EE22A4DF46@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 321a223e-27e2-4bf1-f2db-08db88b8cd7f
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 00:32:30.5997
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: FrdkSzRQzh6L9oB1hJZivGbsRzSzmSgnVS6JZ//0Iqw3xO1k2ehiDACqUNCGBrcsHBDy3IaBsji9rU8ZrVNX3lJJx8MZ4oLy3PCKoGuOxLw=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7783
X-Proofpoint-ORIG-GUID: IPVgSiLDSK0xNEr2y08kqCCSqaArlJCI
X-Proofpoint-GUID: IPVgSiLDSK0xNEr2y08kqCCSqaArlJCI
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-19_16,2023-07-19_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0
 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 clxscore=1015
 suspectscore=0 phishscore=0 mlxlogscore=726 malwarescore=0
 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307200002

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MTggKy0NCiB4ZW4vZHJpdmVycy92cGNp
L21zaXguYyAgICAgICAgICAgICAgICAgICAgIHwgIDU2ICsrLQ0KIHhlbi9kcml2ZXJzL3ZwY2kv
dnBjaS5jICAgICAgICAgICAgICAgICAgICAgfCAxNzYgKysrKysrKy0NCiB4ZW4vaW5jbHVkZS94
ZW4vcGNpLmggICAgICAgICAgICAgICAgICAgICAgIHwgICAxICsNCiB4ZW4vaW5jbHVkZS94ZW4v
cmFuZ2VzZXQuaCAgICAgICAgICAgICAgICAgIHwgICA1ICstDQogeGVuL2luY2x1ZGUveGVuL3Nj
aGVkLmggICAgICAgICAgICAgICAgICAgICB8ICAgOSArDQogeGVuL2luY2x1ZGUveGVuL3ZwY2ku
aCAgICAgICAgICAgICAgICAgICAgICB8ICA0MiArLQ0KIDE2IGZpbGVzIGNoYW5nZWQsIDgyOCBp
bnNlcnRpb25zKCspLCAxMjEgZGVsZXRpb25zKC0pDQoNCi0tIA0KMi40MS4wDQo=


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:32:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:32:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566254.884838 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb2-0001Yj-R3; Thu, 20 Jul 2023 00:32:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566254.884838; Thu, 20 Jul 2023 00:32:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb2-0001Yc-NX; Thu, 20 Jul 2023 00:32:44 +0000
Received: by outflank-mailman (input) for mailman id 566254;
 Thu, 20 Jul 2023 00:32:42 +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
 <SRS0=5z78=DG=epam.com=prvs=156527e6f7=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qMHb0-0001JN-Ok
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:32:42 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ed2a2834-2694-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 02:32:38 +0200 (CEST)
Received: from pps.filterd (m0174678.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36JMeiB3017190; Thu, 20 Jul 2023 00:32:36 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2057.outbound.protection.outlook.com [104.47.13.57])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rxgyx9k43-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 20 Jul 2023 00:32:36 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS8PR03MB7783.eurprd03.prod.outlook.com (2603:10a6:20b:407::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 00:32:32 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6588.035; Thu, 20 Jul 2023
 00:32:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ed2a2834-2694-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=geA3nPDtFETcaj7QB62wA2L8PvdYFtir95WHhhHCjM2J8p1+pIz7CEx4pAHjtCP2X1O1eXAyMevTYCAk2iA+05YMXCKfMKbDQK5gTExYv4+xw79J4Lx22UdlUx3cjy6AKUqzEQ+hC5ByBkLKAFSXv9OmmIE4PjnWsZL3ZE7Iwy0Dk1bpE1Td8X6o13pE8y3YCK7s6LsumslZhvwmXtN6HbKYz5eGSR+3t5IAY1XeZn2NjtisBj85dOGZbXIjMigYiNXfidY6BhNRvCKkaMImeD/iUCwiGxY4pNzRzByitZARRdo/2aSfxLLK4Ub5laqqfOdeidQRn69ma493hpPU8Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Unt8egmRvwPUu0glZoccRX4BB5aszaqAV25MRw9Jz1w=;
 b=RFFhrRn6a0MspLZ82RZVpuMhd3S+pTc/hUCtnOqx3xLsMExRhWIcS7AekH6O/djArhQodEMx7GEs84A1EN8Z/sYQP0XmVjU2exzsoaZu2+alXB2DYboZ66kPFiKbeU+QgvxqhSDtFDlp749HF+mY1OBHNWeYhs/VdiiNAE5l+E1w+Ttz2hPluvn61J3ISVW76WOFSYXQmnaYvvoMRPbnbrogCg5eCPI908sgzEa8J62BQaG0YB4vpRvvGq43nqg0BO0GsTJRsBzNRh+XMB0AjGezTjKGOzIIaHPPycdhuKAvp/taEh9MqriuluwvZwSqZY/iZox/cbZhvcecagU/Yw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Unt8egmRvwPUu0glZoccRX4BB5aszaqAV25MRw9Jz1w=;
 b=TmJVbu0/5GJJnLw579OMEjN4V8+nQAmdstF96gdQFjdLHX/U4XQu8wBviwSZoWFx3BDARylSDcokkIXbr9ohQZ/VVBgzeaZdv29I5xUHBPw2KbXorQ63kp6geKoSdbULs0lZSzWAvOgZJx09DDH0pcazW7PHcYeDmstt52VeoDCQjVpCEgbR1DYOPa6nIPexiGaoZWIeaNA5GfMULb7LbeGg/3YHhsTBtnJ7VEFlQ0RZy87t7UpLbjOod6BGmGCAFJN0/LiT+FRrCTdpNTLlvMDoq+gijiP3S8T3kjbM+VuOz+Rfys0ceKl9GK2IEK5qNAaDHuIt/2rKqVDQp37eeA==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
        =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
Subject: [PATCH v8 03/13] vpci: restrict unhandled read/write operations for
 guests
Thread-Topic: [PATCH v8 03/13] vpci: restrict unhandled read/write operations
 for guests
Thread-Index: AQHZuqGrmAJWEwjbUkyUjUzRXQkJ0A==
Date: Thu, 20 Jul 2023 00:32:31 +0000
Message-ID: <20230720003205.1828537-4-volodymyr_babchuk@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
In-Reply-To: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-mailer: git-send-email 2.41.0
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS8PR03MB7783:EE_
x-ms-office365-filtering-correlation-id: 079fc536-4bd1-462a-cae4-08db88b8cec1
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 YliDazfML/9kzzPYPHo1POb0eObPftuP504X69jE80TnIcyZBqPsLmGon9O1mf+8ZX6q8luDZqtKuQzNfTSRmqbGnnkQvaoUqC87UBfr0ZBfoLYavFPJJao4curMIVYnwJs8xpVkmZ/RzU8LXzhyrXhyklq1LVqpN5il7cwIs2BOcwVASlCIybe6LXzd8xynvhOWFZmF58lThOHiKZZJV8gqj1UoiSJJaIjSv7cIukpX/GqEqZQYAR8V9UoDpsQts3bDNwbayWVINnIfIUHXzquuKBFN6dcYWdrFC5hWHYr0idhNFrWqIhbZsnqWM8LlenhZfcdWh58DORMMiXOMw2BGs5t/sguk2AkRGNZZxAE8c9Ta0AJjuFwd2ipnvxeeAauv1U8Q4ZOUyUXN/GvDvksmfcJv1xJVsFHIdpTSQEXX5LQ5828U6KrEfyh8Mnq1R3uAg0sNCGavWsgkD6zCTk6pqc1xWag/ESubdhNy3UjnE1xVtULlRYN6rZJuufSvfMKfDFbtM0LOg7lOYApXLH25IN5wuHwu0XsAHexnzjS0TZHzKMv2pPln17VM4N9coE/bQX+ess93q+LHXglTUnfRPYbrl2D4sejR3Ajnx/zWfvOVyjnKIS7Zjm9HmE7q
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(346002)(366004)(396003)(376002)(451199021)(55236004)(26005)(1076003)(6506007)(41300700001)(316002)(83380400001)(2616005)(186003)(6512007)(6486002)(122000001)(478600001)(66946007)(54906003)(71200400001)(4326008)(64756008)(38070700005)(66556008)(76116006)(66476007)(91956017)(6916009)(38100700002)(86362001)(5660300002)(66446008)(8936002)(8676002)(36756003)(2906002);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?UFlHeUJRb2dSMzhkYkRzalJJUWsyZkJwWk41Q0IzYm1jM2w3SlBVNnhyOVo1?=
 =?utf-8?B?YnUvUU54K095NE5RVVB0d1ZNeHpPRFJYVTVXcSthRzEydWhIWSt4QWJuV25J?=
 =?utf-8?B?QS9YWWcraU8vVEtCeDUrdGwrVDA1TEhiRXdmbmN4YVdzY3g5WFZ4UzFGZHg2?=
 =?utf-8?B?VGk4N3lySExBek9VVE1BaHpBeWQyWURWSlhUdm03dFRZWTlwSHF3eXlpUzda?=
 =?utf-8?B?NDdSZnowUnY5cUR0MzVSa2lCOVFPRVI5eGROWDBqaHoxR2xXbkhJaWd2Y0Z0?=
 =?utf-8?B?SVNOZTZpR1owYUdSOVVWQVI5YlRaaUVYSGxuM3pwSC8xVE15TE54VW03OG5v?=
 =?utf-8?B?MDdSMzdGQjRxMGhRQStOaURHbXg0SHk5MHZKVWFoZmFiK2xZSW5yODIwbHRU?=
 =?utf-8?B?TWN3dHJaeVdsRUhaNHlZc0dnNjZkaXF6WjVwN25kajhwRWtGcXF1S216K3Rp?=
 =?utf-8?B?bDNqOCtud0IvMEtUQVpoZHpKWTFvZ2NGUk9WZ1gva1ZyaDJVVEQxSHVud2Ju?=
 =?utf-8?B?M1V1VXhFK2t6Nzc5eTBlQ1dxRGNDa2g3Tnd1YXJycFpTdzlDN3Bvd0lQZ2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bzNubkdrV1liMTlJVEZBMjFSUENyTjgybkNvZmN5aVdqMUFwbWRqNnVw?=
 =?utf-8?B?dEtyOWh4a0ZmRUFjRVNFTTUzeGR0Q2ZyanpZbFdPcjE0eE1VZjRKa1VXYjJ1?=
 =?utf-8?B?TEljd0lGRCtPdW1tVEp4QWNHd3pERDFUcGZXbjJxcEROSjlXVzNxYkJLaFli?=
 =?utf-8?B?aDF3VlM2cEVpUHBFejFZN2JKTW9GeCtFa3pOMGVXSm9qWUZFYitzQ2xDbEhw?=
 =?utf-8?B?Nzg3ZFBVazYvRzhEMWVSWEczQUxXdllNQzhvVmlLZnBEWmlnZW1sZWIrc0h0?=
 =?utf-8?B?Um5QeGE0ZmZyemI1WDV6RmNGczJ3Ky9ydllDZ0tIQzFMNlg0NXlkM29mTVhi?=
 =?utf-8?B?cmNMVmZtaEFvYnAyampyY2MrVkREMVE3eUFFN1BuQVpEZ3ZDMUUzWC9BN0E5?=
 =?utf-8?B?THlOeWFHZWVERE1YT29naFVNTXNFMW1CVUtId2NWMjF4b0hEQnc2WkRoY3lU?=
 =?utf-8?B?eGZ1cmw2blh5b1hYMnNmMDg1cXpyTHhwdFZoNXhqQ2Qxa2VPTHh0TXNiL1RO?=
 =?utf-8?B?ZVJMbUJ5SVJDZ2QxRHRnZ2w4aHVGOEJVYmlUOFIzTktWeEpuenRNMjdoWG16?=
 =?utf-8?B?OGZoZExreXJrSWhTQ0RaRldzbmNiZ0RSVGM5MFpveUxieUtZaVBxZ2tDNTF0?=
 =?utf-8?B?dmZvSTRKbDNuVHo3bmlITks1M1VMQmk4Yk9RMk9oTTF2QWFCSTNXK09zV0l0?=
 =?utf-8?B?VWc9PQ==?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <513FB179A8D41C4180D34D81C8EA2D34@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 079fc536-4bd1-462a-cae4-08db88b8cec1
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 00:32:31.6418
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: PMfP3jj2zbhu2X3oFr26LYJtxUYAs6EFDgJAURJWY2iAk93qvuH8CrFJU99K8IQAExkucqwW+DjgOAhjQLyPCABVWZg7KRFTSUGHJ2Cykc0=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7783
X-Proofpoint-ORIG-GUID: 1Ip4MEnJV-84fShS-NmeYKZyp_1jFr8g
X-Proofpoint-GUID: 1Ip4MEnJV-84fShS-NmeYKZyp_1jFr8g
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-19_16,2023-07-19_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0
 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 clxscore=1015
 suspectscore=0 phishscore=0 mlxlogscore=999 malwarescore=0
 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307200002

RnJvbTogT2xla3NhbmRyIEFuZHJ1c2hjaGVua28gPG9sZWtzYW5kcl9hbmRydXNoY2hlbmtvQGVw
YW0uY29tPg0KDQpBIGd1ZXN0IHdvdWxkIGJlIGFibGUgdG8gcmVhZCBhbmQgd3JpdGUgdGhvc2Ug
cmVnaXN0ZXJzIHdoaWNoIGFyZSBub3QNCmVtdWxhdGVkIGFuZCBoYXZlIG5vIHJlc3BlY3Rpd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ihjdXJyZW50LT5kb21haW4p
ICkNCisgICAgICAgIHJldHVybjsNCisNCiAgICAgc3dpdGNoICggc2l6ZSApDQogICAgIHsNCiAg
ICAgY2FzZSA0Og0KLS0gDQoyLjQxLjANCg==


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:32:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:32:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566255.884843 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb3-0001ad-6C; Thu, 20 Jul 2023 00:32:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566255.884843; Thu, 20 Jul 2023 00:32:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb2-0001Zq-Va; Thu, 20 Jul 2023 00:32:44 +0000
Received: by outflank-mailman (input) for mailman id 566255;
 Thu, 20 Jul 2023 00:32:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=5z78=DG=epam.com=prvs=156527e6f7=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qMHb0-0001JI-NT
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:32:42 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ef2c5212-2694-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 02:32:41 +0200 (CEST)
Received: from pps.filterd (m0174678.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36JMeiB6017190; Thu, 20 Jul 2023 00:32:38 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2057.outbound.protection.outlook.com [104.47.13.57])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rxgyx9k43-4
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 20 Jul 2023 00:32:38 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS8PR03MB7783.eurprd03.prod.outlook.com (2603:10a6:20b:407::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 00:32:32 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6588.035; Thu, 20 Jul 2023
 00:32:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ef2c5212-2694-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=TxH1RSkGK+hRVuJxMTWcF/mwPOL8tedwFBXn1EVCfoz8eQYQ2veAjpLGgiftfacCcm6ymLNn+gtHTD9Buk4/hhD8zdcN8CDWv3sh4uIGZtxDzO92zGH8CQditvGpwQkkne7UywWjaW2dfFDBTKo6BJaFoMLDGVaZsefNqYMqJpLm9AMjYuWVUjwWeh/sWmAi0hXo6AtZxT0herAEd7snRPKnoaE9/MfPZraQAFYZ35JeryOJgVGBdXlrQIQnFq9nrkcM7R9cIGdqjFa7l49q/92CoF3TtyUwic3y0EOj+xNpsS48ixcFRqc3HIEWOowiubtXLpYtk0D05g2KU+XV7Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=abxFPIgNa+QJErFwy718sKh+mXFlflc8O/+7z9aj10M=;
 b=XlLL/AbwfjZ3YhwkQfAWXJF5vTdB8dcOJEjgbNS+tKfJ3BwjaXdkfp1gNHo/So9O30J96gZJYTKzB+9kYx6Euj4O02R5C9c3Y3BWIMSk9SdTLd5M983c0J47GLciuKXjdSXAse9+ODudlLTuKe4ts/6Y8HK6sr8zAF2met39raZBpTM3Zsqlr/Wq15EYstpgEh1iWFlfUGEL3n9FN/cqS+NsJoYDYKgElCBPj8J93MG5pBieg5Ne0fQGKbFQhshVWR6z0H8be3Cs8RaiKbiz0wO/FPQ9Zz31TaUpdLQTufEOE64exGihU5b7Pp/K66NyW56TxETSs5MWuByQ7wjLlg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=abxFPIgNa+QJErFwy718sKh+mXFlflc8O/+7z9aj10M=;
 b=TyyKgI2SR5Uc4Kkx937N+OftwGWHvc5rC7erAlz8hx7+8OKuSqnR6x/lEroi0WRE6MgnRtdW3/x4XSIhHJ3s5JJBOZQTvdOcQ6aqViZnpQBLH4TIaWx3y2DWgr5boQMEtdE1sLZitllESNzSWTQNr0iCHRZuiwWVo0JufN5X13bOQ0b9tpjTIbBmIzXM92jzOpwEqvO9/tPK+S/Ij6ZPN8fQMtLGVVMozUhrTwMQ05C7upDUy/PhHdIwf78sh9K8l91c4bs37TBNwbhXZmRFUgbZNzUq3+lW3EkEGACMaxovHgHQSnNE79CS8DCmshQG010loZ3tM+0bMn64bMnOhQ==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
        =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>,
        Jan Beulich
	<jbeulich@suse.com>,
        Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Thread-Topic: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Thread-Index: AQHZuqGrLMJPz1ipBEu4urExXp8yiw==
Date: Thu, 20 Jul 2023 00:32:31 +0000
Message-ID: <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
In-Reply-To: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-mailer: git-send-email 2.41.0
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS8PR03MB7783:EE_
x-ms-office365-filtering-correlation-id: 581027c8-a6bc-453c-1cb2-08db88b8ce92
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 8XLhK+cI/Y9/osOHRZyqh+db/Z5my1ZRXPzSGCw7gyTueyTcI6v+cs7vPCHs6a8Bte9fqou3G8uPYHWhcXtagPsIGQT/vcDEPirj31Bi23z6+B89gh4cPNvfVQaVeGSVQZYpTOibaQJatablAGot6FtGj2GtloDDlzMH8lhG1RtIdERw+rta5Sj4433dTEwr9+1wpCuBRPN6ft9DI4lYnea+PtSogtXQshYivv+eluSu4anKjGxmKA8QVLlEvZNa/Q1Pp4eQQjwfcWMoLZxwZH0MkdPB3v5mo9SScecv6THFWL9PFNEWj4KKcvbc4Yt+Hw3sE8LIRXyEk+2Hya+isMZFsb1M5YGpYwFo+DP/hWD5kq/87kESs6JNe0IpIlsMK7ykVCLNzAnj9vxEyRJ06B6hP3MCTNB4/bodePEJuWH8solmaOqkNTSkHkkBDqij6y04XAbFI9cbS1GrBD8ieqUw9qrySgbKV/D8mrxLeXGWgRporTI8YJ3y1lXbyAcQCQXLxGlAgH1bW0iBnPeeQiDKMWCUP/LD//airW2f+Pl8odR+7nVxXpI0xKh+HYftXHkqQdb8swtuEQwhZUaI1gAhMzVpxS2yO/S+WjyEuia0lYubAc7APMIrDr4O2ibgkjgLnWLOHky1+boroXcElw==
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(346002)(366004)(396003)(376002)(451199021)(55236004)(26005)(1076003)(6506007)(41300700001)(316002)(83380400001)(2616005)(107886003)(186003)(6512007)(6486002)(122000001)(478600001)(66946007)(54906003)(71200400001)(4326008)(64756008)(38070700005)(66556008)(76116006)(66476007)(91956017)(6916009)(38100700002)(86362001)(5660300002)(66446008)(8936002)(8676002)(36756003)(30864003)(2906002)(309714004);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messag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5YWWI3Sm02WnNsYk5VZFVMaW45dGhiUUR5ZmxYeUY4?=
 =?utf-8?B?NVE0eGY1cndxeGI1T29Qa0dHeDJBbGtROEVHRDl6ZTJUamtDNzQ2RFo5Y2pp?=
 =?utf-8?B?M3c4WGdMZGVXamIvcVViQ1pTRTN4UCs5RTAveC82UUhOY2lCT21TYjVpK2g2?=
 =?utf-8?B?MmI5UEtoTjYvN3pkaW9FUWFIY3FkN2QzeW1VU2d0OUhZWGVHcjcxM1htWmlZ?=
 =?utf-8?B?ZnZHMGxDRDJ0RFBwc1NIdXVUVHNjL0lBcmh0dlQvM21rVTNJSWhKOEFMeG1S?=
 =?utf-8?B?U0lENDg3aUNEc3dxTDJUb3Q5YlFXaW80TitieHlSMVlpejViOVFVeHBuWWZU?=
 =?utf-8?B?YXVMRXpNTEI4aE0rOWEwOUNUaS9weDBsVkdZV0lXOFR2MEdmV1Z5dzRnaXJ3?=
 =?utf-8?B?cjVRK21ua3VzUDZXYkF5ZmNQYldUaUovYlZDUEFrdVNLNkVUZWdzREVGSFlw?=
 =?utf-8?B?MEE9PQ==?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <B526B0EDCBF07549A7308C9CCF526BAB@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 581027c8-a6bc-453c-1cb2-08db88b8ce92
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 00:32:31.3755
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: BkrJQVEi0+vUpEXg8coxK4v4webME8P0jKt7mpCq1pDwZMW3s3L/0XE2lry/IS9VL37hbKLR8fCDjGh30BJFJEqJWpQCVUZoCx5rhhalqQk=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7783
X-Proofpoint-ORIG-GUID: wS0UN25VQYO8CBIh5be9I2KXNyp6YnQE
X-Proofpoint-GUID: wS0UN25VQYO8CBIh5be9I2KXNyp6YnQE
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-19_16,2023-07-19_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0
 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 clxscore=1015
 suspectscore=0 phishscore=0 mlxlogscore=999 malwarescore=0
 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307200002

RnJvbTogT2xla3NhbmRyIEFuZHJ1c2hjaGVua28gPG9sZWtzYW5kcl9hbmRydXNoY2hlbmtvQGVw
YW0uY29tPg0KDQpVc2UgYSBwcmV2aW91c2x5IGludHJvZHVjZWQgcGVyLWRvbWFpbiByZWFkL3dy
aXRlIGxvY2sgdG8gY2hlY2sNCndoZXRoZXIgdnBjaSBpcyBwcmVzZW50LCBzbyB3ZSBhcmUgc3Vy
ZSB0aGVyZSBhcmUgbm8gYWNjZXNzZXMgdG8gdGhlDQpjb250ZW50cyBvZiB0aGUgdnBjaSBzdHJ1
Y3QgaWYgbm90LiBUaGlzIGxvY2sgY2FuIGJlIHVzZWQgKGFuZCBpbiBhDQpmZXcgY2FzZXMgaXMg
dXNlZCByaWdodCBhd2F5KSBzbyB0aGF0IHZwY2kgcmVtb3ZhbCBjYW4gYmUgcGVyZm9ybWVkDQp3
aGlsZSBob2xkaW5nIHRoZSBsb2NrIGluIHdyaXRlIG1vZGUuIFByZXZpb3VzbHkgc3VjaCByZW1v
dmFs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nBjaV9sb2NrKSApDQorICAgICAgICAg
ICAgY29udGludWU7DQorDQogICAgICAgICBmb3JfZWFjaF9wZGV2ICggZCwgcGRldiApDQogICAg
ICAgICB7DQogICAgICAgICAgICAgY29uc3Qgc3RydWN0IHZwY2lfbXNpICptc2k7DQpAQCAtMzE4
LDE0ICszMjMsMTcgQEAgdm9pZCB2cGNpX2R1bXBfbXNpKHZvaWQpDQogICAgICAgICAgICAgICAg
ICAgICAgKiBob2xkaW5nIHRoZSBsb2NrLg0KICAgICAgICAgICAgICAgICAgICAgICovDQogICAg
ICAgICAgICAgICAgICAgICBwcmludGsoInVuYWJsZSB0byBwcmludCBhbGwgTVNJLVggZW50cmll
czogJWRcbiIsIHJjKTsNCi0gICAgICAgICAgICAgICAgICAgIHByb2Nlc3NfcGVuZGluZ19zb2Z0
aXJxcygpOw0KLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7DQorICAgICAgICAgICAgICAg
ICAgICBnb3RvIHBkZXZfZG9uZTsNCiAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgIH0N
CiANCiAgICAgICAgICAgICBzcGluX3VubG9jaygmcGRldi0+dnBjaS0+bG9jayk7DQorIHBkZXZf
ZG9uZToNCisgICAgICAgICAgICByZWFkX3VubG9jaygmZC0+cGNpX2xvY2spOw0KICAgICAgICAg
ICAgIHByb2Nlc3NfcGVuZGluZ19zb2Z0aXJxcygpOw0KKyAgICAgICAgICAgIHJlYWRfbG9jaygm
ZC0+cGNpX2xvY2spOw0KICAgICAgICAgfQ0KKyAgICAgICAgcmVhZF91bmxvY2soJmQtPnBjaV9s
b2NrKTsNCiAgICAgfQ0KICAgICByY3VfcmVhZF91bmxvY2soJmRvbWxpc3RfcmVhZF9sb2NrKTsN
CiB9DQpkaWZmIC0tZ2l0IGEveGVuL2RyaXZlcnMvdnBjaS9tc2l4LmMgYi94ZW4vZHJpdmVycy92
cGNpL21zaXguYw0KaW5kZXggMjViZGU3NzU4Ni4uOTQ4MTI3NDU3O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HJ1Y3Qg
cGNpX2RldiB7DQogICovDQogDQogdm9pZCBwY2lkZXZzX2xvY2sodm9pZCk7DQoraW50IHBjaWRl
dnNfdHJ5bG9jayh2b2lkKTsNCiB2b2lkIHBjaWRldnNfdW5sb2NrKHZvaWQpOw0KIGJvb2xfdCBf
X211c3RfY2hlY2sgcGNpZGV2c19sb2NrZWQodm9pZCk7DQogDQotLSANCjIuNDEuMA0K


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:32:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:32:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566257.884855 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb3-0001nH-Sv; Thu, 20 Jul 2023 00:32:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566257.884855; Thu, 20 Jul 2023 00:32:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb3-0001lG-KK; Thu, 20 Jul 2023 00:32:45 +0000
Received: by outflank-mailman (input) for mailman id 566257;
 Thu, 20 Jul 2023 00:32:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=5z78=DG=epam.com=prvs=156527e6f7=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qMHb1-0001JI-5H
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:32:43 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ef7930b0-2694-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 02:32:42 +0200 (CEST)
Received: from pps.filterd (m0174678.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36JMeiB8017190; Thu, 20 Jul 2023 00:32:40 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2057.outbound.protection.outlook.com [104.47.13.57])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rxgyx9k43-6
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 20 Jul 2023 00:32:40 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS8PR03MB7783.eurprd03.prod.outlook.com (2603:10a6:20b:407::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 00:32:33 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6588.035; Thu, 20 Jul 2023
 00:32:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ef7930b0-2694-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=YSEuixspl4E2XEB56BGXbHZXRo4kb6jXMQAXgyLmNUE9vkTINhe7m6luyKjgijja+aiHWfjuFtNQ1BByFjlRrVicA2+7p9SqmkRDtrgO3+uxiq5WeghW3SpZwKE5XwASXhwXckWO14+ZgtFyWe+l9yNxup1ZkHYiBYYWCkoE+b801hBZlf2kybXPh1hWDoYwD2So0zudO5turdYPXdG7pCA19aOOYnYANU1f2dz51g/kr77hvFmzjFOcmCmDvq7mkxeNgW2zTLBcvQTF84xIuDxH1Lfx8NQKWkuEwNT1J2++5p36L/fmbAJwPlly3HM019fsYwJCfCKtSHtw2L2LUg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=pnyVf/Quc1OthOHa0YYbOyyYyHBFi9n/oxj2Krygg6Y=;
 b=mM4C+h2U1tqNWIRHFXzDEpV2J6p5+d21YvbuSmYPKDICPIYj7XkmXnQziVtsQeAVFgJRM+Jdd1s1M4WPtccgXKyLCHRssaeuhIt2BgTz/p/KgDMMAp4OTqJSx+Ls74VlsbaC3QVRBPkQJ6jNBNdCZf8bZooUlEp9gVVvKX15XFHL5g7uFbcKabGVSos0eC3xOjFQ0u8roxvIPMUo9gtworAOF8g4C/S0xBNMO3T4+F5rUPmlU9Pttl5JxON2yILcI0tgs7voajnJp3oXAcljcCMq5tQNpELSKuveKkkYSLgNeqkAY8C3zyjJSJ55GgBP4bZzNjUaAmrKG7hhWe5y9A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=pnyVf/Quc1OthOHa0YYbOyyYyHBFi9n/oxj2Krygg6Y=;
 b=BxrKeQvrH7h/FwkxuK8ToDD09fsF6psZJw7cOl+3dU/PrHWNPOCFmTeszWRjBPaXXK1H4pmF8yUsfxrxdMoJ4vHIp7oWfBOjRCUdBzSggYAaWvC9V2NNcVsSOWFPan3hdZZJrSRstmXAniMuQsROjEr53RjQJWhIczFSgV408ynpwfvTQz97crpMZs6LAIkCqYQdFEL3462x0d8prEfuDkazABjsh+b18TCo8ldP8loIynOHkJqv/r9QtCVs9/JMXsxDjlndfCrQBY3EAjuPwGAe2oTh9wsjShmG9f+ggLDoQJLfGhOqZebJANLnSa8EwWgUkbH9In4VlHYJuroI5g==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
        Jan Beulich
	<jbeulich@suse.com>
Subject: [PATCH v8 06/13] rangeset: add RANGESETF_no_print flag
Thread-Topic: [PATCH v8 06/13] rangeset: add RANGESETF_no_print flag
Thread-Index: AQHZuqGsAISBZpl7eEC6l+liOUz9ag==
Date: Thu, 20 Jul 2023 00:32:32 +0000
Message-ID: <20230720003205.1828537-7-volodymyr_babchuk@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
In-Reply-To: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-mailer: git-send-email 2.41.0
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS8PR03MB7783:EE_
x-ms-office365-filtering-correlation-id: d09c8808-874f-4f42-e819-08db88b8cf63
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 NPmnq0ySwCmiCn7Px5F95uf8HA3AJITLpfPTnSGVBO26nPxxOzay2MCT2SWtYfkBQOD7BzMAMczY/BjFZ72NHL8anyOjW5wnpYZBlUdfyTejiiNwXiABfvYEBBWP3kQFLtb2AJ8WfBn7LpMWIZUgYC1CoZsU7Pz93R17zUYXeoTDvaBLb5aUtKDbnaXKgL5aMnx8au+KT88IGlLXaMwCSsbAhzszOCMFO55VoGok8TKAYBr7UVvSf6ZpFCgrqibenOBkBO/LeIUdCzAKYxTCoDuLs5JZPkhmxmWtOX//39m9UECwcBF/8z4rSBj1b8GcjJVrCQHNpbtSo5MJ39VXt2IwvQY/mQNfu12LdUSt0EjJe5ccagkB3yO7ezzxNsq0al89WZWzgFeem36k3qpZZf/fQBVJbx7G7ZfWtEw7kLPd3fDRviaPWieCbZ+VhbSF2PwjHgXzjlrXyh5fFA2SCiFODhJ/FRA/fmQhMHvi2PN8EXeGGCJG1UxAvh8CaC57PHoB5lR5QsOdZk8MYlxaVovgaN01JFciFHCiCWxJUD3jA7cXTs50mw6FlYMWemOEOz3IxDERpFuelUNOsHqkm64aMMoeN4C3kZHw4ZBJO7nrcpDAnJ+1ZPTKM3bQ3uOZ
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(346002)(366004)(396003)(376002)(451199021)(55236004)(26005)(1076003)(6506007)(41300700001)(316002)(83380400001)(2616005)(186003)(6512007)(6486002)(122000001)(478600001)(66946007)(54906003)(71200400001)(4326008)(64756008)(38070700005)(66556008)(76116006)(66476007)(91956017)(6916009)(38100700002)(86362001)(5660300002)(66446008)(8936002)(8676002)(36756003)(2906002);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-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; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d09c8808-874f-4f42-e819-08db88b8cf63
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 00:32:32.6433
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: Uz0QoHWLPj7IXhUmPUqWMrtT2H0W8ncZN1vSFhbVOWoAurBpxD4Tl1v9gva1xOD+yCfQ1mSNy/Yl3ma4f4Czf/DDvyuW1wbs9svYXSBVfc0=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7783
X-Proofpoint-ORIG-GUID: wSC_5BsEzDIb_Nbf8daHlVd-fT0giIVi
X-Proofpoint-GUID: wSC_5BsEzDIb_Nbf8daHlVd-fT0giIVi
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-19_16,2023-07-19_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0
 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 clxscore=1015
 suspectscore=0 phishscore=0 mlxlogscore=999 malwarescore=0
 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307200002

From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

There are range sets which should not be printed, so introduce a flag
which allows marking those as such. Implement relevant logic to skip
such entries while printing.

While at it also simplify the definition of the flags by directly
defining those without helpers.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
Since v5:
- comment indentation (Jan)
Since v1:
- update BUG_ON with new flag
- simplify the definition of the flags
---
 xen/common/rangeset.c      | 5 ++++-
 xen/include/xen/rangeset.h | 5 +++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c
index a6ef264046..f8b909d016 100644
--- a/xen/common/rangeset.c
+++ b/xen/common/rangeset.c
@@ -433,7 +433,7 @@ struct rangeset *rangeset_new(
     INIT_LIST_HEAD(&r->range_list);
     r->nr_ranges =3D -1;
=20
-    BUG_ON(flags & ~RANGESETF_prettyprint_hex);
+    BUG_ON(flags & ~(RANGESETF_prettyprint_hex | RANGESETF_no_print));
     r->flags =3D flags;
=20
     safe_strcpy(r->name, name ?: "(no name)");
@@ -575,6 +575,9 @@ void rangeset_domain_printk(
=20
     list_for_each_entry ( r, &d->rangesets, rangeset_list )
     {
+        if ( r->flags & RANGESETF_no_print )
+            continue;
+
         printk("    ");
         rangeset_printk(r);
         printk("\n");
diff --git a/xen/include/xen/rangeset.h b/xen/include/xen/rangeset.h
index 135f33f606..f7c69394d6 100644
--- a/xen/include/xen/rangeset.h
+++ b/xen/include/xen/rangeset.h
@@ -49,8 +49,9 @@ void rangeset_limit(
=20
 /* Flags for passing to rangeset_new(). */
  /* Pretty-print range limits in hexadecimal. */
-#define _RANGESETF_prettyprint_hex 0
-#define RANGESETF_prettyprint_hex  (1U << _RANGESETF_prettyprint_hex)
+#define RANGESETF_prettyprint_hex   (1U << 0)
+ /* Do not print entries marked with this flag. */
+#define RANGESETF_no_print          (1U << 1)
=20
 bool_t __must_check rangeset_is_empty(
     const struct rangeset *r);
--=20
2.41.0


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:32:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:32:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566262.884906 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb8-00038c-8Y; Thu, 20 Jul 2023 00:32:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566262.884906; Thu, 20 Jul 2023 00:32:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb7-00036L-TT; Thu, 20 Jul 2023 00:32:49 +0000
Received: by outflank-mailman (input) for mailman id 566262;
 Thu, 20 Jul 2023 00:32:46 +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
 <SRS0=5z78=DG=epam.com=prvs=156527e6f7=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qMHb3-0001JN-UN
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:32:46 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f099c095-2694-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 02:32:43 +0200 (CEST)
Received: from pps.filterd (m0174676.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36JJCjt2031890
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 00:32:42 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2059.outbound.protection.outlook.com [104.47.13.59])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rxgcw1sme-2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 00:32:42 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS8PR03MB7783.eurprd03.prod.outlook.com (2603:10a6:20b:407::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 00:32:35 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6588.035; Thu, 20 Jul 2023
 00:32:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f099c095-2694-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=OlEGG5D81kgg0nBGcdBSz1ogsAqZsjDWFf4cz6H77k8C3wI54OBE2EgV7Ln3l1c2Nl7EzOY5HrfHKhgpRurjHYB143QtGgm+ECQaHtqRpPznax3uX9BDPtpYhAJ18OZD1bYMs2dB/tT5WNVXTEcVb9YpbDnOrapL/T64sOmaJaO+83pChlTQJZh47ETyoSNokeSq8xcWd8pDW6hM+4la0Pj+gaWzZOFwM02+KNwA5YsdpVNcf2JAVCilb6QJCoV+pYs4gYQauqRY2jSo9rRpVOtEXs1nDRKM/73VQgEam8J4HecHjO6nbtnSL9MZgKGNOflb6nI4VBqNpDm1qEKObQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=VWkvYfFfLZLgGm2PrjN1dlq8IatJg4jM7gGw7jvqor4=;
 b=WCMng+mW0cs98fl/wbyl+v2M8xp9tPU2Hn4E++SIImsmFXOC8UGPt1hKAz8tZ3qOEAcWVBYRs4aYhiZF1IzqnT0OypdD0KUcmEsip6TiBwV/m1ld0QTnmreddKDl2mVGNsX3o6hkdDqw86bWKM9nQC64g12KgCLGloDNQ5kXwl6I1TwL1ao4/ElL/88frYrJYsCq8k2igWLJQratdzvIZPeABtNT1Q+Au04uOsjsPN7buEXgvkRpz7L4bbVXB4Lgjg4jn6PvjK3PpOBGCeBQP4vPRAGexFk8FapWBLFgO/uADHNPCIQzZRfDKcRYDx4vHGfWaB+eb8C8652316+DBw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=VWkvYfFfLZLgGm2PrjN1dlq8IatJg4jM7gGw7jvqor4=;
 b=k1uBJbL3DJaxjlNCWWpan75impnFIbVKv51FuRW9eq90xY8ehP/o0Bc80fkOq0z7BsQdaE1LDD/PCSHxVdgtIICK07htJbzN0IgsNsAR9tw6rmAG1pPwL7SLXmtMPKhEhtP/ElcMO+3r5cUozVNyLqZHKMVhdJ56TzBA/2vXJucig0dBz658zWJS7r4AV/Vg0ieL2youU46HkNPdi4sj1qo31pa7WqbQxF01U4H5ti1xa5x+tKXioRzAkc8kE7naJq8+MbK1QWyAEgZPUvviFLn7FEOWhPBtt50YlJdeiG/mU32gUoJVWOmq5NI5RZ+vPagAZ7qV5ipHMT0CFocQoQ==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: [PATCH v8 09/13] vpci/header: emulate PCI_COMMAND register for guests
Thread-Topic: [PATCH v8 09/13] vpci/header: emulate PCI_COMMAND register for
 guests
Thread-Index: AQHZuqGsgAu2PWCwAEG/SX7tDNW7DQ==
Date: Thu, 20 Jul 2023 00:32:33 +0000
Message-ID: <20230720003205.1828537-10-volodymyr_babchuk@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
In-Reply-To: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-mailer: git-send-email 2.41.0
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS8PR03MB7783:EE_
x-ms-office365-filtering-correlation-id: 15423d10-3364-4e45-eaf8-08db88b8d06e
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 ldben+njrd6tuRPGDxq0qY2XeS/kQmntw+CyPZ76p+N1wNnbdXIlgKp1VQiJjqDsnKsfij2/glQmBRuxaUal4FSiWsodCGt5Hyj3v4IThkoB6S8A9igj5NtpU39Q4NvBCIKJOkWFyYN5znr2RUDOteB2yt+AUgEU8hrfcrnj362eRaQ5eEfpS3HbZxbHfAMMG2cPAXlxz+vYFnw6vThbMUfYpxh3fzsiwqi04mztJrREb1ZJh/nFbE7BElH/bTsLdlOSZiiDDsJC2iys3ZjmYstZoA1idUTy5dtsIGOOhdGWfxZ7rIBH4uoT1l1cUxvujWc3WsaztQQblxYeBT70jCqyxMZAacAkZYIfR8eHHRrhvRhQIEloOy5Ui+INYeddWL0u2I0x5pGsdfA0tsXkkUdzu/6vtTwQmOISUEv1DOBJh/zi36aDUysVvjbsZ4hB3QCYq4EvIMbBOOYRs2vihhSWpQWqgh051GaTroufuB2L8xGVpEaeBPGOoWSCgspBvdiIt5CXlqLtWx/52hh4v66jl9rZ8JPXbz5Qmarop+TNP9XiGmO74Pnr9KCo1yM584SRh8doee0/XF+U/4ARx7FqMjbAoMCjbOvXqhdOLG4Ld9IC+f956OjCsPaz1iqde5j2JsNWZKbnUd+s+a9GgQ==
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(346002)(366004)(396003)(376002)(451199021)(55236004)(26005)(1076003)(6506007)(41300700001)(316002)(83380400001)(2616005)(107886003)(186003)(966005)(6512007)(6486002)(66899021)(122000001)(478600001)(66946007)(71200400001)(4326008)(64756008)(38070700005)(66556008)(76116006)(66476007)(91956017)(6916009)(38100700002)(86362001)(5660300002)(66446008)(8936002)(8676002)(36756003)(2906002);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?iso-8859-1?Q?/4FzHm0tyoHJlaWPnSdgyHYrg4RR6maXsURkRz5PstfeO5E8bZ4n2WkNtl?=
 =?iso-8859-1?Q?VOfhz48p3cv5aG+Wiuk1mlEJqgHg0/MFj1jDqAchKGxFnEjlFRGquY/tf6?=
 =?iso-8859-1?Q?3ZaxSOe1ND9U3RuHsmaqTYLFQmQEymIk5GcHFWTDoGm4zbEhh15EuJ9kKR?=
 =?iso-8859-1?Q?ZcHOLoCR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/ZCEwCdSdzNOdNkRL43cZgsuJSVbDPGzpnJltmMN?=
 =?iso-8859-1?Q?3Ib1lFSwWAXXQssvq/Nbkbpa5n8ivrrsQZLPdmCCJGQl5D78CFjOALsAF6?=
 =?iso-8859-1?Q?lLFmxpF2Ih0OwZo+twbXAVykP3TyaRmpjhsObQ994cStKGlp02X41ivKdD?=
 =?iso-8859-1?Q?Q1AGl5/oXdOVj0pPAnhpcU54jequptEf1IYSJtx8u/8GZAw72TbAWA4kjg?=
 =?iso-8859-1?Q?0tvi9uVm7RhXGwRA1pRM+K1EtIy1+y/7XG1E6uC9K0IwGXxKVe0eQ3LAmg?=
 =?iso-8859-1?Q?F/6eiSq+2qfaC3pgJp6gCsTWCz6oEPpMs/rCiAAXyPm+chWFS5x2fYqoW5?=
 =?iso-8859-1?Q?YnXQkgDwm2MXotgGmf6/GBYAsNTq3498NdEhJ9yXEWcHHKypCb62l+u0TG?=
 =?iso-8859-1?Q?czwNYZrFOUWydLdI9a0mzjJcffUQX3574JKtsWSpW3YAB9qWZBdsRiDpy3?=
 =?iso-8859-1?Q?dUW7K9CLweYei+1lz+3+e4xMFWPigT3pOyn1Lcnpd5+Bam8gcwwVyH0Nx7?=
 =?iso-8859-1?Q?4SebIG/dUe77dgHoNKDRHDYAYpyQ9jm0l4v2/bKNEjAguqQ77I5eWIbOYR?=
 =?iso-8859-1?Q?/oc+P9BMteXZwNyS1voXVVo3ttLxFOzmg7Uvm6LuGUfxVgPAEaTnmx7A?=
 =?iso-8859-1?Q?=3D=3D?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 15423d10-3364-4e45-eaf8-08db88b8d06e
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 00:32:33.5184
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: nJTWxVu0YK8N81H0kRyPPM/NVmLU6RAwol1YnJg4PH/Dz19fHGrixwwfiGMx4TvIr8BronvI+RwWW6YgmmfEMI5FGiOjgNYY17G6uFcRQ00=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7783
X-Proofpoint-ORIG-GUID: CBU4TaoMcSbmhCGN8vhvLzoC3hWNTWx9
X-Proofpoint-GUID: CBU4TaoMcSbmhCGN8vhvLzoC3hWNTWx9
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-19_16,2023-07-19_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0
 malwarescore=0 mlxlogscore=999 suspectscore=0 phishscore=0 mlxscore=0
 spamscore=0 bulkscore=0 clxscore=1015 impostorscore=0 adultscore=0
 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307200002

From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

Xen and/or Dom0 may have put values in PCI_COMMAND which they expect
to remain unaltered. PCI_COMMAND_SERR bit is a good example: while the
guest's view of this will want to be zero initially, the host having set
it to 1 may not easily be overwritten with 0, or else we'd effectively
imply giving the guest control of the bit. Thus, PCI_COMMAND register needs
proper emulation in order to honor host's settings.

There are examples of emulators [1], [2] which already deal with PCI_COMMAN=
D
register emulation and it seems that at most they care about is the only IN=
Tx
bit (besides IO/memory enable and bus master which are write through).
It could be because in order to properly emulate the PCI_COMMAND register
we need to know about the whole PCI topology, e.g. if any setting in device=
's
command register is aligned with the upstream port etc.
This makes me think that because of this complexity others just ignore that=
.
Neither I think this can easily be done in Xen case.

According to "PCI LOCAL BUS SPECIFICATION, REV. 3.0", section "6.2.2
Device Control" the reset state of the command register is typically 0,
so when assigning a PCI device use 0 as the initial state for the guest's v=
iew
of the command register.

For now our emulation only makes sure INTx is set according to the host
requirements, i.e. depending on MSI/MSI-X enabled state.

This implementation and the decision to only emulate INTx bit for now
is based on the previous discussion at [3].

[1] https://github.com/qemu/qemu/blob/master/hw/xen/xen_pt_config_init.c#L3=
10
[2] https://github.com/projectacrn/acrn-hypervisor/blob/master/hypervisor/h=
w/pci.c#L336
[3] https://patchwork.kernel.org/project/xen-devel/patch/20210903100831.177=
748-9-andr2000@gmail.com/

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
---

Since v6:
- fold guest's logic into cmd_write
- implement cmd_read, so we can report emulated INTx state to guests
- introduce header->guest_cmd to hold the emulated state of the
  PCI_COMMAND register for guests
Since v5:
- add additional check for MSI-X enabled while altering INTX bit
- make sure INTx disabled while guests enable MSI/MSI-X
Since v3:
- gate more code on CONFIG_HAS_MSI
- removed logic for the case when MSI/MSI-X not enabled
---
 xen/drivers/vpci/header.c | 38 +++++++++++++++++++++++++++++++++++++-
 xen/drivers/vpci/msi.c    |  4 ++++
 xen/drivers/vpci/msix.c   |  4 ++++
 xen/include/xen/vpci.h    |  3 +++
 4 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index e1a448b674..ae05d242a5 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -486,11 +486,27 @@ static int modify_bars(const struct pci_dev *pdev, ui=
nt16_t cmd, bool rom_only)
     return 0;
 }
=20
+/* TODO: Add proper emulation for all bits of the command register. */
 static void cf_check cmd_write(
     const struct pci_dev *pdev, unsigned int reg, uint32_t cmd, void *data=
)
 {
     struct vpci_header *header =3D data;
=20
+    if ( !is_hardware_domain(pdev->domain) )
+    {
+        struct vpci_header *header =3D data;
+
+        header->guest_cmd =3D cmd;
+#ifdef CONFIG_HAS_PCI_MSI
+        if ( pdev->vpci->msi->enabled || pdev->vpci->msix->enabled )
+            /*
+             * Guest wants to enable INTx, but it can't be enabled
+             * if MSI/MSI-X enabled.
+             */
+            cmd |=3D PCI_COMMAND_INTX_DISABLE;
+#endif
+    }
+
     /*
      * Let Dom0 play with all the bits directly except for the memory
      * decoding one.
@@ -507,6 +523,19 @@ static void cf_check cmd_write(
         pci_conf_write16(pdev->sbdf, reg, cmd);
 }
=20
+static uint32_t cmd_read(const struct pci_dev *pdev, unsigned int reg,
+                         void *data)
+{
+    if ( !is_hardware_domain(pdev->domain) )
+    {
+        struct vpci_header *header =3D data;
+
+        return header->guest_cmd;
+    }
+
+    return pci_conf_read16(pdev->sbdf, reg);
+}
+
 static void cf_check bar_write(
     const struct pci_dev *pdev, unsigned int reg, uint32_t val, void *data=
)
 {
@@ -713,8 +742,15 @@ static int cf_check init_bars(struct pci_dev *pdev)
         return -EOPNOTSUPP;
     }
=20
+    /*
+     * According to "PCI LOCAL BUS SPECIFICATION, REV. 3.0", section "6.2.=
2
+     * Device Control" the reset state of the command register is
+     * typically all 0's, so this is used as initial value for the guests.
+     */
+    ASSERT(header->guest_cmd =3D=3D 0);
+
     /* Setup a handler for the command register. */
-    rc =3D vpci_add_register(pdev->vpci, vpci_hw_read16, cmd_write, PCI_CO=
MMAND,
+    rc =3D vpci_add_register(pdev->vpci, cmd_read, cmd_write, PCI_COMMAND,
                            2, header);
     if ( rc )
         return rc;
diff --git a/xen/drivers/vpci/msi.c b/xen/drivers/vpci/msi.c
index e63152c224..c37845a949 100644
--- a/xen/drivers/vpci/msi.c
+++ b/xen/drivers/vpci/msi.c
@@ -70,6 +70,10 @@ static void cf_check control_write(
=20
         if ( vpci_msi_arch_enable(msi, pdev, vectors) )
             return;
+
+        /* Make sure guest doesn't enable INTx while enabling MSI. */
+        if ( !is_hardware_domain(pdev->domain) )
+            pci_intx(pdev, false);
     }
     else
         vpci_msi_arch_disable(msi, pdev);
diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 9481274579..eab1661b87 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -97,6 +97,10 @@ static void cf_check control_write(
         for ( i =3D 0; i < msix->max_entries; i++ )
             if ( !msix->entries[i].masked && msix->entries[i].updated )
                 update_entry(&msix->entries[i], pdev, i);
+
+        /* Make sure guest doesn't enable INTx while enabling MSI-X. */
+        if ( !is_hardware_domain(pdev->domain) )
+            pci_intx(pdev, false);
     }
     else if ( !new_enabled && msix->enabled )
     {
diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
index b78dd6512b..6099d2141d 100644
--- a/xen/include/xen/vpci.h
+++ b/xen/include/xen/vpci.h
@@ -87,6 +87,9 @@ struct vpci {
         } bars[PCI_HEADER_NORMAL_NR_BARS + 1];
         /* At most 6 BARS + 1 expansion ROM BAR. */
=20
+        /* Guest view of the PCI_COMMAND register. */
+        uint16_t guest_cmd;
+
         /*
          * Store whether the ROM enable bit is set (doesn't imply ROM BAR
          * is mapped into guest p2m) if there's a ROM BAR on the device.
--=20
2.41.0


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:32:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:32:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566258.884864 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb4-0001yr-Jb; Thu, 20 Jul 2023 00:32:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566258.884864; Thu, 20 Jul 2023 00:32:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb4-0001xR-7d; Thu, 20 Jul 2023 00:32:46 +0000
Received: by outflank-mailman (input) for mailman id 566258;
 Thu, 20 Jul 2023 00:32:43 +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
 <SRS0=5z78=DG=epam.com=prvs=156527e6f7=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qMHb1-0001JN-CE
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:32:43 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ef07d056-2694-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 02:32:41 +0200 (CEST)
Received: from pps.filterd (m0174678.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36JMeiB7017190
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 00:32:39 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2057.outbound.protection.outlook.com [104.47.13.57])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rxgyx9k43-5
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 00:32:39 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS8PR03MB7783.eurprd03.prod.outlook.com (2603:10a6:20b:407::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 00:32:33 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6588.035; Thu, 20 Jul 2023
 00:32:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ef07d056-2694-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=m4IAAEfkzQsbvRlDDa17C5fdwQkIDR8WAyiLrE65raG1Vt67H8W/ArPD72U+7YVRq0vc9FOb3Z8IwXJJdtD5sWxdIzntPVCr/h7PhZq+yxmVeCyZ7qa4IxCipj70HJTsRUNYNfxAz3Dr3ovAVemxPk47AS3XRbxNcyKxoZReQBe6CTTLcN11O/j7FoILajeKJAf/PV6n0MY0vc1ASGoN/EZ32COFCB86FzC6xgcSe413Yg+YqFGSfbmlkFHTnwnuSdn8aHPp4wOIkkTe72xoOP54xSyc56TGV4pWDgKp5Xr32m8AEeJQYvApfn2nnci2HcPSIeONX3fjD78vuRZflQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=47oYdY92/xdhz0lVCilDwn1lYzCxtQyRzltahBREZd4=;
 b=LtCfVutNjdvZIKZOEP4ydcqXJvrobo0WcZfED8ssJCDkpj9yTTTwwrJt512udvDqNCf8TT3YGqj/bW0u25VMF70PyhHYhV/h5xjuXaUSI+naKrjaYG/m/3rsLp9okzXuUp4T2SkoNvdBymsOG6WmC5GLSmdm/YVaRwB4quvg7Jx55EzTLWlf9PLByeE1nhACABjQPnckK1Q8bmDv9bS3FvHS5fS7r3oh5qD3E5EFBv9GcK3WSfCI/cAziEwH0I3lLSKvONiTp/Z/eLyV2HFAKE/rcnZllUV+KMgT2PLsOh7VRbz+lhlr57qZpA1YSYEpCjkx74ZYQ+v1sflo9ylQvw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=47oYdY92/xdhz0lVCilDwn1lYzCxtQyRzltahBREZd4=;
 b=Avez4eDF3dpAmhUCNnbHldRA9tNFpHgdsFjvLvuZqKih3Y2WPKBlG5Xf/AhIPAB/D3GyVgBZU/nP0OgfrQ+UyCrOAhDQYSns0+aTBKLKYW2GoWAEQkDE5tWUI2C8QtvrA4AGWE4swCuZsAcTKphZdDQ3Q/pWzRsAknkz1buTigAE7kHulJrss0cR51wnZX0kApTeNRnl+YFZJ6Y4LWQa2virAMDwOYC0oFMxF4Rfs+iZFMU/Nc7ZDFOEIn0YJinnjjW+4PXWeTbA2GTyBxCQkIEjgOqA3KB/lmKnhLooUjHkaDcVHmaAIg+qBB2CxHxTvN87snyESeX+R6UMvty9vw==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: [PATCH v8 05/13] vpci/header: implement guest BAR register handlers
Thread-Topic: [PATCH v8 05/13] vpci/header: implement guest BAR register
 handlers
Thread-Index: AQHZuqGsyq2xz4eSA0OJuZWqMM1tiQ==
Date: Thu, 20 Jul 2023 00:32:32 +0000
Message-ID: <20230720003205.1828537-6-volodymyr_babchuk@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
In-Reply-To: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-mailer: git-send-email 2.41.0
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS8PR03MB7783:EE_
x-ms-office365-filtering-correlation-id: 14347ab2-45a8-4005-b09b-08db88b8cf2a
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 Nf5JftkPigHZ3pofGPDnsayT2K7vwxoRLIA7KiuSWTOoi2nMxKEnmJ6SuZrVQgjYHi09Vbz2aocIS4r6bViEZPlCUkbAv+jASBRjGGFS8CMmxSKhGVvN40SPSiAJ9Auuajt9GOCWFMO+L95JVjpX55dBGiA+t+lsZgM/2R4B+5micq0P6ho+tEEXutNBFZtWHVOCXYImCORi0cE7EtqOK8o1KlgruEO/puV5vbig+S7ypVBAORKChyIlOKa35n8NqDjg8G90LIV2LhQnskXgBv7OCbjYajXccNsrvLISACGI2mk+HapHU4a6Y3ZEMa9y2Khaxmx1K8crdB6BV7dFVxwm+yIJXf5Q6j15ISON0t1CQIPVaS+wMUv2Trm+zITVqTrs2eHvshbRIWI81M30qLa3KnVSR/ksagK7dHeyFexG+jFR7+AsU/EW3bZxV/yNS1p3B9CnoF9rvV4ACPxHJYxPNWvgUw9VFLuk1E3w1j3WrTrfv1m1dKsrrj7HEF77Bc7mChzQFdWrTNAslJGeLzlWKAgX7DY/Nx7LVd5e7Dw4lkpVttt1qq8gUi+dBsfb8erJkMgs+AGSV4y22f5LYhEqhE1tlqH/xU14OobKSeTEwOzud2TJ1VsT4XZJTsVQ
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(346002)(366004)(396003)(376002)(451199021)(55236004)(26005)(1076003)(6506007)(41300700001)(316002)(83380400001)(2616005)(107886003)(186003)(6512007)(6486002)(122000001)(478600001)(66946007)(71200400001)(4326008)(64756008)(38070700005)(66556008)(76116006)(66476007)(91956017)(6916009)(38100700002)(86362001)(5660300002)(66446008)(8936002)(8676002)(36756003)(2906002);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?iso-8859-1?Q?fwnCYpu+qHtMGGkhWcbpZkbGH7mufrjWPqgc7GzAYpzYazsvyZ5LaseZhu?=
 =?iso-8859-1?Q?GPo6NRCFyQYCJ8toHfuJVvmiTxiEeOugLsNTeYMjxyaPbiB6tn6n58DmKF?=
 =?iso-8859-1?Q?yq9Gf+dRMKNqGV46DimWYC4jLZwSHwRjqCQP9zVHMkOM5UdkKSurbbDgkx?=
 =?iso-8859-1?Q?U9NydCuWtUMRru0j0EJFNuJTSuFnz+jH2FLb+dA+NiBNgb5FIfMxgPGhsp?=
 =?iso-8859-1?Q?BwM/KmpzDtmawzC5JEYNjo28aFUVdWll63D0RY6u1CzizBwK9iTdGiRP4j?=
 =?iso-8859-1?Q?Rto/W9zgaGFu+gbnqH+PJFh8Y/xlg+Q7QjhOZF6ekBiDeqk7ppRftsk84i?=
 =?iso-8859-1?Q?VzK22bnnDlH+KIUWRnb/DVvU/ucQwoYteeCEgVdAHtFpLJOdcxmzigqyKQ?=
 =?iso-8859-1?Q?s8A77GuLksarUsAh31vcOzFUV5x/84u4azmoqn6OLFE5OvSIb1CthPTNph?=
 =?iso-8859-1?Q?6AE6HXLxODXuq9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L+rDY721+RP9bywz4OMURYFFkTTP6DoRKeuhbLtx?=
 =?iso-8859-1?Q?0hDoD86mHLXj2RvwCwTDQbBmzVNX7BzY/pEsMcQF1/235uyS6x46LjQZZw?=
 =?iso-8859-1?Q?owfG/8Wl7V/8es5/6KpQh6hZHVTcTbMdYhW5wgfOeaX4m4hxVLaNLzvfJV?=
 =?iso-8859-1?Q?nWVdjU7qayZS7e12A4z8IArH71/gWmOcuGsxeC2GD1hqjt8WFwWUxu4mVO?=
 =?iso-8859-1?Q?4AtsPl3tNgOBZnUUQcGaZpnCeukzoyTfmWjQdtJNZNGZbGPdQBYtNMshEL?=
 =?iso-8859-1?Q?uBJ8DgDbhBsfCLmSMxwSOep9mLA3Ie4o0K7Gbain+O3fI8k5mP3164Ig?=
 =?iso-8859-1?Q?=3D=3D?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 14347ab2-45a8-4005-b09b-08db88b8cf2a
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 00:32:32.3931
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: w8RWG2bOpi2oQU4HCv4RrlKof3RxWcLf98L+G+4Qk3EGlOHuK81EY1P876O7V8Wb8sbWWlKyZS11XTzRxZy8dpaEkdYMlCnxU5fMX/jBRMA=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7783
X-Proofpoint-ORIG-GUID: KmXizPNq9VrH_mBgkg5SXfcwwxWWp4S5
X-Proofpoint-GUID: KmXizPNq9VrH_mBgkg5SXfcwwxWWp4S5
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-19_16,2023-07-19_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0
 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 clxscore=1015
 suspectscore=0 phishscore=0 mlxlogscore=999 malwarescore=0
 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307200002

From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

Add relevant vpci register handlers when assigning PCI device to a domain
and remove those when de-assigning. This allows having different
handlers for different domains, e.g. hwdom and other guests.

Emulate guest BAR register values: this allows creating a guest view
of the registers and emulates size and properties probe as it is done
during PCI device enumeration by the guest.

All empty, IO and ROM BARs for guests are emulated by returning 0 on
reads and ignoring writes: this BARs are special with this respect as
their lower bits have special meaning, so returning default ~0 on read
may confuse guest OS.

Memory decoding is initially disabled when used by guests in order to
prevent the BAR being placed on top of a RAM region.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
---

Since v6:
- unify the writing of the PCI_COMMAND register on the
  error path into a label
- do not introduce bar_ignore_access helper and open code
- s/guest_bar_ignore_read/empty_bar_read
- update error message in guest_bar_write
- only setup empty_bar_read for IO if !x86
Since v5:
- make sure that the guest set address has the same page offset
  as the physical address on the host
- remove guest_rom_{read|write} as those just implement the default
  behaviour of the registers not being handled
- adjusted comment for struct vpci.addr field
- add guest handlers for BARs which are not handled and will otherwise
  return ~0 on read and ignore writes. The BARs are special with this
  respect as their lower bits have special meaning, so returning ~0
  doesn't seem to be right
Since v4:
- updated commit message
- s/guest_addr/guest_reg
Since v3:
- squashed two patches: dynamic add/remove handlers and guest BAR
  handler implementation
- fix guest BAR read of the high part of a 64bit BAR (Roger)
- add error handling to vpci_assign_device
- s/dom%pd/%pd
- blank line before return
Since v2:
- remove unneeded ifdefs for CONFIG_HAS_VPCI_GUEST_SUPPORT as more code
  has been eliminated from being built on x86
Since v1:
 - constify struct pci_dev where possible
 - do not open code is_system_domain()
 - simplify some code3. simplify
 - use gdprintk + error code instead of gprintk
 - gate vpci_bar_{add|remove}_handlers with CONFIG_HAS_VPCI_GUEST_SUPPORT,
   so these do not get compiled for x86
 - removed unneeded is_system_domain check
 - re-work guest read/write to be much simpler and do more work on write
   than read which is expected to be called more frequently
 - removed one too obvious comment
---
 xen/drivers/vpci/header.c | 156 +++++++++++++++++++++++++++++++-------
 xen/include/xen/vpci.h    |   3 +
 2 files changed, 130 insertions(+), 29 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index 2780fcae72..5dc9b5338b 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -457,6 +457,71 @@ static void cf_check bar_write(
     pci_conf_write32(pdev->sbdf, reg, val);
 }
=20
+static void cf_check guest_bar_write(const struct pci_dev *pdev,
+                                     unsigned int reg, uint32_t val, void =
*data)
+{
+    struct vpci_bar *bar =3D data;
+    bool hi =3D false;
+    uint64_t guest_reg =3D bar->guest_reg;
+
+    if ( bar->type =3D=3D VPCI_BAR_MEM64_HI )
+    {
+        ASSERT(reg > PCI_BASE_ADDRESS_0);
+        bar--;
+        hi =3D true;
+    }
+    else
+    {
+        val &=3D PCI_BASE_ADDRESS_MEM_MASK;
+        val |=3D bar->type =3D=3D VPCI_BAR_MEM32 ? PCI_BASE_ADDRESS_MEM_TY=
PE_32
+                                           : PCI_BASE_ADDRESS_MEM_TYPE_64;
+        val |=3D bar->prefetchable ? PCI_BASE_ADDRESS_MEM_PREFETCH : 0;
+    }
+
+    guest_reg &=3D ~(0xffffffffull << (hi ? 32 : 0));
+    guest_reg |=3D (uint64_t)val << (hi ? 32 : 0);
+
+    guest_reg &=3D ~(bar->size - 1) | ~PCI_BASE_ADDRESS_MEM_MASK;
+
+    /*
+     * Make sure that the guest set address has the same page offset
+     * as the physical address on the host or otherwise things won't work =
as
+     * expected.
+     */
+    if ( (guest_reg & (~PAGE_MASK & PCI_BASE_ADDRESS_MEM_MASK)) !=3D
+         (bar->addr & ~PAGE_MASK) )
+    {
+        gprintk(XENLOG_WARNING,
+                "%pp: ignored BAR %zu write attempting to change page offs=
et\n",
+                &pdev->sbdf, bar - pdev->vpci->header.bars + hi);
+        return;
+    }
+
+    bar->guest_reg =3D guest_reg;
+}
+
+static uint32_t cf_check guest_bar_read(const struct pci_dev *pdev,
+                                        unsigned int reg, void *data)
+{
+    const struct vpci_bar *bar =3D data;
+    bool hi =3D false;
+
+    if ( bar->type =3D=3D VPCI_BAR_MEM64_HI )
+    {
+        ASSERT(reg > PCI_BASE_ADDRESS_0);
+        bar--;
+        hi =3D true;
+    }
+
+    return bar->guest_reg >> (hi ? 32 : 0);
+}
+
+static uint32_t cf_check empty_bar_read(const struct pci_dev *pdev,
+                                        unsigned int reg, void *data)
+{
+    return 0;
+}
+
 static void cf_check rom_write(
     const struct pci_dev *pdev, unsigned int reg, uint32_t val, void *data=
)
 {
@@ -517,6 +582,7 @@ static int cf_check init_bars(struct pci_dev *pdev)
     struct vpci_header *header =3D &pdev->vpci->header;
     struct vpci_bar *bars =3D header->bars;
     int rc;
+    bool is_hwdom =3D is_hardware_domain(pdev->domain);
=20
     ASSERT(rw_is_locked(&pdev->domain->pci_lock));
=20
@@ -558,13 +624,12 @@ static int cf_check init_bars(struct pci_dev *pdev)
         if ( i && bars[i - 1].type =3D=3D VPCI_BAR_MEM64_LO )
         {
             bars[i].type =3D VPCI_BAR_MEM64_HI;
-            rc =3D vpci_add_register(pdev->vpci, vpci_hw_read32, bar_write=
, reg,
-                                   4, &bars[i]);
+            rc =3D vpci_add_register(pdev->vpci,
+                                   is_hwdom ? vpci_hw_read32 : guest_bar_r=
ead,
+                                   is_hwdom ? bar_write : guest_bar_write,
+                                   reg, 4, &bars[i]);
             if ( rc )
-            {
-                pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
-                return rc;
-            }
+                goto fail;
=20
             continue;
         }
@@ -573,6 +638,17 @@ static int cf_check init_bars(struct pci_dev *pdev)
         if ( (val & PCI_BASE_ADDRESS_SPACE) =3D=3D PCI_BASE_ADDRESS_SPACE_=
IO )
         {
             bars[i].type =3D VPCI_BAR_IO;
+
+#ifndef CONFIG_X86
+            if ( !is_hwdom )
+            {
+                rc =3D vpci_add_register(pdev->vpci, empty_bar_read, NULL,
+                                       reg, 4, &bars[i]);
+                if ( rc )
+                    goto fail;
+            }
+#endif
+
             continue;
         }
         if ( (val & PCI_BASE_ADDRESS_MEM_TYPE_MASK) =3D=3D
@@ -584,14 +660,20 @@ static int cf_check init_bars(struct pci_dev *pdev)
         rc =3D pci_size_mem_bar(pdev->sbdf, reg, &addr, &size,
                               (i =3D=3D num_bars - 1) ? PCI_BAR_LAST : 0);
         if ( rc < 0 )
-        {
-            pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
-            return rc;
-        }
+            goto fail;
=20
         if ( size =3D=3D 0 )
         {
             bars[i].type =3D VPCI_BAR_EMPTY;
+
+            if ( !is_hwdom )
+            {
+                rc =3D vpci_add_register(pdev->vpci, empty_bar_read, NULL,
+                                       reg, 4, &bars[i]);
+                if ( rc )
+                    goto fail;
+            }
+
             continue;
         }
=20
@@ -599,34 +681,50 @@ static int cf_check init_bars(struct pci_dev *pdev)
         bars[i].size =3D size;
         bars[i].prefetchable =3D val & PCI_BASE_ADDRESS_MEM_PREFETCH;
=20
-        rc =3D vpci_add_register(pdev->vpci, vpci_hw_read32, bar_write, re=
g, 4,
-                               &bars[i]);
+        rc =3D vpci_add_register(pdev->vpci,
+                               is_hwdom ? vpci_hw_read32 : guest_bar_read,
+                               is_hwdom ? bar_write : guest_bar_write,
+                               reg, 4, &bars[i]);
         if ( rc )
-        {
-            pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
-            return rc;
-        }
+            goto fail;
     }
=20
-    /* Check expansion ROM. */
-    rc =3D pci_size_mem_bar(pdev->sbdf, rom_reg, &addr, &size, PCI_BAR_ROM=
);
-    if ( rc > 0 && size )
+    /* Check expansion ROM: we do not handle ROM for guests. */
+    if ( is_hwdom )
     {
-        struct vpci_bar *rom =3D &header->bars[num_bars];
+        rc =3D pci_size_mem_bar(pdev->sbdf, rom_reg, &addr, &size, PCI_BAR=
_ROM);
+        if ( rc > 0 && size )
+        {
+            struct vpci_bar *rom =3D &header->bars[num_bars];
=20
-        rom->type =3D VPCI_BAR_ROM;
-        rom->size =3D size;
-        rom->addr =3D addr;
-        header->rom_enabled =3D pci_conf_read32(pdev->sbdf, rom_reg) &
-                              PCI_ROM_ADDRESS_ENABLE;
+            rom->type =3D VPCI_BAR_ROM;
+            rom->size =3D size;
+            rom->addr =3D addr;
+            header->rom_enabled =3D pci_conf_read32(pdev->sbdf, rom_reg) &
+                                  PCI_ROM_ADDRESS_ENABLE;
=20
-        rc =3D vpci_add_register(pdev->vpci, vpci_hw_read32, rom_write, ro=
m_reg,
-                               4, rom);
-        if ( rc )
-            rom->type =3D VPCI_BAR_EMPTY;
+            rc =3D vpci_add_register(pdev->vpci, vpci_hw_read32, rom_write=
,
+                                   rom_reg, 4, rom);
+            if ( rc )
+                rom->type =3D VPCI_BAR_EMPTY;
+        }
+    }
+    else
+    {
+        if ( !is_hwdom )
+        {
+            rc =3D vpci_add_register(pdev->vpci, empty_bar_read, NULL,
+                                   rom_reg, 4, &header->bars[num_bars]);
+            if ( rc )
+                goto fail;
+        }
     }
=20
     return (cmd & PCI_COMMAND_MEMORY) ? modify_bars(pdev, cmd, false) : 0;
+
+ fail:
+    pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
+    return rc;
 }
 REGISTER_VPCI_INIT(init_bars, VPCI_PRIORITY_MIDDLE);
=20
diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
index 44296623e1..486a655e8d 100644
--- a/xen/include/xen/vpci.h
+++ b/xen/include/xen/vpci.h
@@ -67,7 +67,10 @@ struct vpci {
     struct vpci_header {
         /* Information about the PCI BARs of this device. */
         struct vpci_bar {
+            /* Physical (host) address. */
             uint64_t addr;
+            /* Guest view of the BAR: address and lower bits. */
+            uint64_t guest_reg;
             uint64_t size;
             enum {
                 VPCI_BAR_EMPTY,
--=20
2.41.0


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:32:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:32:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566256.884849 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb3-0001gC-GK; Thu, 20 Jul 2023 00:32:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566256.884849; Thu, 20 Jul 2023 00:32:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb3-0001ds-9a; Thu, 20 Jul 2023 00:32:45 +0000
Received: by outflank-mailman (input) for mailman id 566256;
 Thu, 20 Jul 2023 00:32:43 +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
 <SRS0=5z78=DG=epam.com=prvs=156527e6f7=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qMHb0-0001JN-Vo
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:32:43 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ee9a29ce-2694-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 02:32:40 +0200 (CEST)
Received: from pps.filterd (m0174678.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36JMeiB5017190; Thu, 20 Jul 2023 00:32:37 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2057.outbound.protection.outlook.com [104.47.13.57])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rxgyx9k43-3
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 20 Jul 2023 00:32:37 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS8PR03MB7783.eurprd03.prod.outlook.com (2603:10a6:20b:407::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 00:32:32 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6588.035; Thu, 20 Jul 2023
 00:32:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ee9a29ce-2694-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=jwMuXJV4hDcgX76yzhHxDh+sOKtQ+0l0jRTb4FOfd4dDit1OA239Nnfnp/Xzf+uqHI/eQMq6UghXSpj6lDxhfqPuPPxF7VvODdudWWTq76HxmjGrOvhKQezbZpI8UEzcgQ3oF5lKoxTE9Tjb6AUvmJiZc2vrOgh5RDVGjeLofur903FeLWDD0y7dzbx8Cfeqv16H6eHqdap127mDHH8d6cA9c/4zMlLLD3UW2Vv1DCNWRPv1tLDVD4yMyhPEudv8+LhAYFSSttwHbEcq0P9evv7h4Bm8tZdQzu09cKkPMCrwbRc/UvYUDP+QwBUUI660cAm1A9PNdHi+4qbynshD/Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=iKqHtyDUDA8wFxvQepqDFxbxA7jnJx0SzIFiYOphyxM=;
 b=eCqwV3mcykF2KIDkepRT2dKaSU+GWKBjiRkSDG8eX/QZbputTmrhKjDG1L3zeOUeMku97chKWeZSuSF7yCoKuMsGFT5RiGLqI2GUrvQfqNaNsjjCiwJXp5/lZ9sboB468v8Nu/NqyOkggViNMFpLKncuZ1JMKI3kHuSLLcuXBNBQT2V3mATXVLFFHTCO0lTWtXsMIC4kfBd2L7DKddfQUYe9yBk1kz8cJPCZ4lDA4Z68OtB6mxBj5VDkKn5DaztGx0xL6MZj6ocPh8jzcNCxoJjo1rlkO2+q7LY4uLnaX0thVUNBHGmvxjjJ/GXoze1EGI9QMTFK4EmTnIvmP00Bew==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=iKqHtyDUDA8wFxvQepqDFxbxA7jnJx0SzIFiYOphyxM=;
 b=ZQBpaN6niSuGrXcawTKRpgYx6qZz/TsfszX99XpaxDmU1xbZMIlCyQEIJ14ER76wiW6amh7zwSyYazPFt1LrjOYp68TcSuLO3M3oGQRyNHZEddd13NAPpeFIl38Qb14bgNXvNcZr0dwlUk7HeQahgVd0mUym+t29V3oNlZBvLszt2jqEw+r6CPMDkihu4aHpQSCm1CLW6UGPXcGX7QLpO9H5FEGUXG6QH1OdDrbsJdCCPevfTlkwKRHXpq70KtXU0nKEuPGOXnABh3VjPfNu2YJBh/TwfxsIw7W9+kHk/5GHYq6ZFFOCkZmu7eIhYGUNe4+4+muQ7pyiL8nHgxF9LA==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
        =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>,
        Jan Beulich
	<jbeulich@suse.com>
Subject: [PATCH v8 01/13] pci: introduce per-domain PCI rwlock
Thread-Topic: [PATCH v8 01/13] pci: introduce per-domain PCI rwlock
Thread-Index: AQHZuqGr3g/gocvkCU2kdSqq613AoQ==
Date: Thu, 20 Jul 2023 00:32:31 +0000
Message-ID: <20230720003205.1828537-2-volodymyr_babchuk@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
In-Reply-To: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-mailer: git-send-email 2.41.0
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS8PR03MB7783:EE_
x-ms-office365-filtering-correlation-id: a41c2575-ed4d-4f4b-0c2a-08db88b8ce60
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 Tza7cq3IoswCttZHApdAfEwDOPMqbHTQnybXZNR+0LOP1FwzPl1Fp7Xmq++1sjFnIX+LohpBHtBhxqtoungcRyyZrc96M+k2ilMpED6Ws6u5PBVoVjSEY+GVkM8ZnNj2yWfOlZZtRX6OvS7SKYFtDpPHdEciGK6BzlfZxLV5pNeTOK2SNuUjaOHQvQb7PZsYWNBJiaazlp9GwCLeZLx28E6Mmybd+M9oIMTSWVwEtpUtbvdqe5odJsp9j/i/H9roOVPZ8OF8j1Jq9OlVOohzpb+PuUMyYzOvobzGRa7YV8DVGsVX9h/UodE2NL2osxYu0Fy+JM7IDM8wGS8ym/bOSAkw8iHmYnH9OYdym++LgsSruy0r42b7NVcyYLiR47++SFujq5QCRL3ZHv9CgHcrvuf0RJgDkehTU2pukiKtYDJ/Xr5vTZrWzIM0NSKjAARxGwq8hdUWFOR+txUgWIDxEYjTc2vgJAmGZm9iqnZgleUOEab9MtTp8pRrqPD4FlJK6Vag4g0EzK9sNxeecAaEPgz/Iwg3GiLnGnzOyxC/Tl8pFo9tBr8mb7NhlgZZowExF/H+m11FAFMTajNUZGQq9OLvJ8tqkTbPY7VVLXO7QD8f9r7DazSGbb6B1UDftIGR
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(346002)(366004)(396003)(376002)(451199021)(55236004)(26005)(1076003)(6506007)(41300700001)(316002)(83380400001)(2616005)(186003)(6512007)(6486002)(122000001)(478600001)(66946007)(54906003)(71200400001)(4326008)(64756008)(38070700005)(66556008)(76116006)(66476007)(91956017)(6916009)(38100700002)(86362001)(5660300002)(66446008)(8936002)(8676002)(36756003)(2906002);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-mess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mlsNEVPb3d6VnR4aWNuRG5nWVVER2tIZ003UGZUK3lz?=
 =?utf-8?B?VDdNWlEydUR2K0N3NFRuMGxnVjFFajhDY1hpRjR6VitHcDBiaHE5QjlJM3RV?=
 =?utf-8?B?bjdKaTZydDY3R0N1TlVTMDZ4ckVkdld1Y2wrRWlVbTV0TUJqeit1NlBNZVhL?=
 =?utf-8?B?RkVwbUVpZjNFaTVKZ25YOUVodzVrS20wN2JmY2szdGdzVi9ab1UyWDlCR3Bj?=
 =?utf-8?B?dE1IUDJXdWVadkFmckM4eGpPMnUxTDRSYnd2QkRJaERJZ2ozV205bVBJV01m?=
 =?utf-8?B?V1hkN0s3bGgrSHkyWDZTS2lTcTI0OXkvVnk2TDNUZTBxVXVvSU5sQ0twbENX?=
 =?utf-8?B?V2FWYlJVU3RjZEVpTFZabHVmNmpXWlVUUHhHdW9WUDNNVDkvWXcrTDlLWG0x?=
 =?utf-8?B?dWRrUlhIUWExa09FNis3RXRYQ0dOcGdERmYxS1ZUd3kzMk1KVUV2MDBFR3N1?=
 =?utf-8?B?R3c9PQ==?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <BF8188A536BF8C4DB477594E2EDEF2C0@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a41c2575-ed4d-4f4b-0c2a-08db88b8ce60
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 00:32:31.0563
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: ON8KfDYwRzy+4rxSN6hp6WFYMVg/DtrqaVKH64tyOp4zqQkL7xpnRGkD4U/zgClCb2ANvCoOtqJl1aKJuxztblui1KYBPBl1jYAKMyZwTjc=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7783
X-Proofpoint-ORIG-GUID: GVDTlzfBD9UJ1hjtXI1V19gWUeRZeGKf
X-Proofpoint-GUID: GVDTlzfBD9UJ1hjtXI1V19gWUeRZeGKf
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-19_16,2023-07-19_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0
 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 clxscore=1015
 suspectscore=0 phishscore=0 mlxlogscore=999 malwarescore=0
 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307200002

QWRkIHBlci1kb21haW4gZC0+cGNpX2xvY2sgdGhhdCBwcm90ZWN0cyBhY2Nlc3MgdG8NCmQtPnBk
ZXZfbGlzdC4gUHVycG9zZSBvZiB0aGlzIGxvY2sgaXMgdG8gZ2l2ZSBndWFyYW50ZWVzIHRvIFZQ
Q0kgY29kZQ0KdGhhdCB1bmRlcmx5aW5nIHBkZXYgd2lsbCBub3QgZGlzYXBwZWFyIHVuZGVyIGZl
ZXQuIFRoaXMgaXMgYSBydy1sb2NrLA0KYnV0IHRoaXMgcGF0Y2ggYWRkcyBvbmx5IHdyaXRlX2xv
Y2soKXMuIFRoZXJlIHdpbGwgYmUgcmVhZF9sb2NrKCkNCnVzZXJzIGluIHRoZSBuZXh0IHBhdGNo
ZXMuDQoNClRoaXMgbG9jayBzaG91bGQgYmUgdGFrZW4gaW4gd3JpdGUgbW9kZSBldmVyeSB0aW1l
IGQtPnBkZXZfbGlzdCBpcw0KYWx0ZXJlZC4gVGhpcyBjb3ZlcnMgYm90aCBhY2Nl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gICAgICB2cGNp
X3JlbW92ZV9kZXZpY2UocGRldik7DQogICAgICAgICAgICAgbGlzdF9kZWwoJnBkZXYtPmRvbWFp
bl9saXN0KTsNCiAgICAgICAgICAgICBwZGV2LT5kb21haW4gPSBOVUxMOw0KKyAgICAgICAgICAg
IHdyaXRlX3VubG9jaygmaGFyZHdhcmVfZG9tYWluLT5wY2lfbG9jayk7DQogICAgICAgICAgICAg
Z290byBvdXQ7DQogICAgICAgICB9DQorICAgICAgICB3cml0ZV91bmxvY2soJmhhcmR3YXJlX2Rv
bWFpbi0+cGNpX2xvY2spOw0KICAgICB9DQogICAgIGVsc2UNCiAgICAgICAgIGlvbW11X2VuYWJs
ZV9kZXZpY2UocGRldik7DQpAQCAtODEyLDExICs4MTgsMTMgQEAgaW50IHBjaV9yZW1vdmVfZGV2
aWNlKHUxNiBzZWcsIHU4IGJ1cywgdTggZGV2Zm4pDQogICAgIGxpc3RfZm9yX2VhY2hfZW50cnkg
KCBwZGV2LCAmcHNlZy0+YWxsZGV2c19saXN0LCBhbGxkZXZzX2xpc3QgKQ0KICAgICAgICAgaWYg
KCBwZGV2LT5idXMgPT0gYnVzICYmIHBkZXYtPmRldmZuID09IGRldmZuICkNCiAgICAgICAgIHsN
CisgICAgICAgICAgICB3cml0ZV9sb2NrKCZwZGV2LT5kb21haW4tPnBjaV9sb2NrKTsNCiAgICAg
ICAgICAgICB2cGNpX3JlbW92ZV9kZXZpY2UocGRldik7DQogICAgICAgICAgICAgcGNpX2NsZWFu
dXBfbXNpKHBkZXYpOw0KICAgICAgICAgICAgIHJldCA9IGlvbW11X3JlbW92ZV9kZXZpY2UocGRl
dik7DQogICAgICAgICAgICAgaWYgKCBwZGV2LT5kb21haW4gKQ0KICAgICAgICAgICAgICAgICBs
aXN0X2RlbCgmcGRldi0+ZG9tYWluX2xpc3QpOw0KKyAgICAgICAgICAgIHdyaXRlX3VubG9jaygm
cGRldi0+ZG9tYWluLT5wY2lfbG9jayk7DQogICAgICAgICAgICAg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dCkgKQ0KICAgICB7DQotICAgICAgICBidXMgPSBwZGV2LT5idXM7DQotICAgICAgICBk
ZXZmbiA9IHBkZXYtPmRldmZuOw0KLSAgICAgICAgcmV0ID0gZGVhc3NpZ25fZGV2aWNlKGQsIHBk
ZXYtPnNlZywgYnVzLCBkZXZmbikgPzogcmV0Ow0KKyAgICAgICAgc3RydWN0IHBjaV9kZXYgKnBk
ZXYgPSBsaXN0X2ZpcnN0X2VudHJ5KCZkLT5wZGV2X2xpc3QsDQorICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHBjaV9kZXYsDQorICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9tYWluX2xpc3QpOw0KKyAg
ICAgICAgdWludDE2X3Qgc2VnID0gcGRldi0+c2VnOw0KKyAgICAgICAgdWludDhfdCBidXMgPSBw
ZGV2LT5idXM7DQorICAgICAgICB1aW50OF90IGRldmZuID0gcGRldi0+ZGV2Zm47DQorICAgICAg
ICBpbnQgcmV0Ow0KKw0KKyAgICAgICAgd3JpdGVfdW5sb2NrKCZkLT5wY2lfbG9jayk7DQorICAg
ICAgICByZXQgPSBkZWFzc2lnbl9kZXZpY2UoZCwgc2VnLCBidXMsIGRldmZuKTsNCisgICAgICAg
IHdyaXRlX2xvY2soJmQtPnBjaV9sb2NrKTsNCisgICAgICAgIGlmICggcmV0ICkNCisgICAgICAg
IHsNCisgICAgICAgICAgICBib29sIHN0aWxsX3ByZXNlbnQgPSBmYWxzZTsNCisgICAgICAgICAg
ICBjb25zdCBzdHJ1Y3QgcGNpX2RldiAqdG1wOw0KKw0KKyAgICAgICAgICAgIC8qDQorICAgICAg
ICAgICAgICogV2UgbmVlZCB0byBjaGVjayBpZiBkZWFzc2lnbl9kZXZpY2UoKSBsZWZ0IG91ciBw
ZGV2IGluDQorICAgICAgICAgICAgICogZG9tYWluJ3MgbGlzdC4gQXMgd2UgZHJvcHBlZCB0aGUg
bG9jaywgd2UgY2FuJ3QgYmUgc3VyZQ0KKyAgICAgICAgICAgICAqIHRoYXQgbGlzdCB3YXNuJ3Qg
cGVybXV0YXRlZCBpbiBzb21lIHJhbmRvbSB3YXksIHNvIHdlDQorICAgICAgICAgICAgICogbmVl
ZCB0byB0cmF2ZXJzZSB0aGUgd2hvbGUgbGlzdC4NCisgICAgICAgICAgICAgKi8NCisgICAgICAg
ICAgICBmb3JfZWFjaF9wZGV2ICggZCwgdG1wICkNCisgICAgICAgICAgICB7DQorICAgICAgICAg
ICAgICAgIGlmICggdG1wID09IHBkZXYgKQ0KKyAgICAgICAgICAgICAgICB7DQorICAgICAgICAg
ICAgICAgICAgICBzdGlsbF9wcmVzZW50ID0gdHJ1ZTsNCisgICAgICAgICAgICAgICAgICAgIGJy
ZWFrOw0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIGlm
ICggc3RpbGxfcHJlc2VudCApDQorICAgICAgICAgICAgICAgIGxpc3RfbW92ZSgmcGRldi0+ZG9t
YWluX2xpc3QsICZmYWlsZWRfcGRldnMpOw0KKyAgICAgICAgICAgIGNvbWJpbmVkX3JldCA9IGNv
bWJpbmVkX3JldD86cmV0Ow0KKyAgICAgICAgfQ0KICAgICB9DQorDQorICAgIGxpc3Rfc3BsaWNl
KCZmYWlsZWRfcGRldnMsICZkLT5wZGV2X2xpc3QpOw0KKyAgICB3cml0ZV91bmxvY2soJmQtPnBj
aV9sb2NrKTsNCiAgICAgcGNpZGV2c191bmxvY2soKTsNCiANCi0gICAgcmV0dXJuIHJldDsNCisg
ICAgcmV0dXJuIGNvbWJpbmVkX3JldDsNCiB9DQogDQogI2RlZmluZSBQQ0lfQ0xBU1NfQlJJREdF
X0hPU1QgICAgMHgwNjAwDQpAQCAtMTEyNSw3ICsxMTY5LDkgQEAgc3RhdGljIGludCBfX2h3ZG9t
X2luaXQgY2ZfY2hlY2sgX3NldHVwX2h3ZG9tX3BjaV9kZ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
bG9jaygmcGRldi0+ZG9tYWluLT5wY2lfbG9jayk7DQorICAgICAgICBsaXN0X2RlbCgmcGRldi0+
ZG9tYWluX2xpc3QpOw0KKyAgICAgICAgd3JpdGVfdW5sb2NrKCZwZGV2LT5kb21haW4tPnBjaV9s
b2NrKTsNCisNCisgICAgICAgIHdyaXRlX2xvY2soJnRhcmdldC0+cGNpX2xvY2spOw0KKyAgICAg
ICAgbGlzdF9hZGQoJnBkZXYtPmRvbWFpbl9saXN0LCAmdGFyZ2V0LT5wZGV2X2xpc3QpOw0KKyAg
ICAgICAgd3JpdGVfdW5sb2NrKCZ0YXJnZXQtPnBjaV9sb2NrKTsNCisNCiAgICAgICAgIHBkZXYt
PmRvbWFpbiA9IHRhcmdldDsNCiAgICAgfQ0KIA0KZGlmZiAtLWdpdCBhL3hlbi9pbmNsdWRlL3hl
bi9zY2hlZC5oIGIveGVuL2luY2x1ZGUveGVuL3NjaGVkLmgNCmluZGV4IDg1MjQyYTczZDMuLjgw
ZGQxNTBiYmYgMTAwNjQ0DQotLS0gYS94ZW4vaW5jbHVkZS94ZW4vc2NoZWQuaA0KKysrIGIveGVu
L2luY2x1ZGUveGVuL3NjaGVkLmgNCkBAIC00NjAsNiArNDYwLDcgQEAgc3RydWN0IGRvbWFpbg0K
IA0KICNpZmRlZiBDT05GSUdfSEFTX1BDSQ0KICAgICBzdHJ1Y3QgbGlzdF9oZWFkIHBkZXZfbGlz
dDsNCisgICAgcndsb2NrX3QgcGNpX2xvY2s7DQogI2VuZGlmDQogDQogI2lmZGVmIENPTkZJR19I
QVNfUEFTU1RIUk9VR0gNCi0tIA0KMi40MS4wDQo=


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:32:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:32:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566261.884896 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb7-0002sw-F2; Thu, 20 Jul 2023 00:32:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566261.884896; Thu, 20 Jul 2023 00:32:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb7-0002qw-63; Thu, 20 Jul 2023 00:32:49 +0000
Received: by outflank-mailman (input) for mailman id 566261;
 Thu, 20 Jul 2023 00:32:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=5z78=DG=epam.com=prvs=156527e6f7=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qMHb3-0001JI-Nt
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:32:45 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f0ca61cf-2694-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 02:32:44 +0200 (CEST)
Received: from pps.filterd (m0174678.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36JMeiBA017190
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 00:32:42 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2057.outbound.protection.outlook.com [104.47.13.57])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rxgyx9k43-8
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 00:32:42 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS8PR03MB7783.eurprd03.prod.outlook.com (2603:10a6:20b:407::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 00:32:34 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6588.035; Thu, 20 Jul 2023
 00:32:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f0ca61cf-2694-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LrLH6BhKTdUsOIh5Cn8RGZLmKJzxnMZJ2Y1k3U7xK0hR/+6EhVcpd5+/b7S/0/hoSuxkCFpKGNya1eyESmKv5D0QtGAsDzWELY9bEz5JS1vj53tJojDCna8hPoYXo0ENIEMehej7N17OV+RZGeG/GKFrbeiHH54EQCzLtmvLNJMcNvYcc1wWiXRJHtVskJvHUXinbCVffT8ImAYfbLfQKvw6CYGecqSmNPksficjpHGGkrh9g5GS5c4ci7y6pi7RPVH+1q/z1FbuvjLT2vlpUOJU3MNPC4vGsYqdB5hqzGwgFCV2pYTBNbzMFKjd9FzwGcc/ejK1YV4ujbh/jd4iCw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=o4qMyvBtfNRc4aBSfSbMUWMhpLQYprUCPRNweR/SKGA=;
 b=SmWOL6VyRR6aisYAoFC4foFiR1bUD5S00WuF63OLs1XBAdGSM7O98Q7S3nL+p5xkfQ9+kvHwZiCBmejOZa7sWJ5HckEgNPtYDYy7q9ZzzeO/ioBJJFOqIBROy4Hjo0cx/ICbd/lYLUqtkSmjLB9iKyN4qqQOy7lXX+sU8aMEJuDLf2FN2jA2Cw+lmQ6e893+/INYlJRvTCm1nV2vKVOz7EUvo2hZ5/LU8ZWy0eH4PPTwgTpFAs73j3IbyMN2mY4+0LJFhqDp1G1SDr8rv8TJ1AjZzmRU6TDvBD1/W+PhUTNhb2c3aYJkJz3sw4B6ld3mJ7CASx4iFUqiusyQ2QNz6A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=o4qMyvBtfNRc4aBSfSbMUWMhpLQYprUCPRNweR/SKGA=;
 b=N8QDd1XQw+ZnMRbWvaozaOmrAo3GbDrL1WldcZPU9USh79lRBR/7zoMbzR+rDa62/DTeW/d2eO8j8GAMgOZnr0mq+Dom27Ccnx8gDuSnx1YJpv99Y25pAHzBxpUFEAcVOCMUOM6LTOGzVThqvqh49/5ApgDliwaXmrho7QMgPUvZh7Mo5I+RudroUmR9VKAr46sBYDU555ZYTLHGY64RlsH464dTkqTVVal6FvIdejWLHH7z1bFsHDZa90CuqDhejy+qgz/khlX4lh9eWENJbDwZd4MGJ9Y008retZjeGX8+ee0fLQFb0RJ1Z+UjSFskc4lfhiVHBEcSit13Us+viw==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: [PATCH v8 08/13] vpci/header: program p2m with guest BAR view
Thread-Topic: [PATCH v8 08/13] vpci/header: program p2m with guest BAR view
Thread-Index: AQHZuqGsvPRRGO0LlUKscysi74kMlA==
Date: Thu, 20 Jul 2023 00:32:33 +0000
Message-ID: <20230720003205.1828537-9-volodymyr_babchuk@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
In-Reply-To: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-mailer: git-send-email 2.41.0
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS8PR03MB7783:EE_
x-ms-office365-filtering-correlation-id: e473c0ba-1993-432a-40b3-08db88b8d001
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 jK/sLJLxamYos2oW3q92xo8y9iSq8/9sIruG+eYYFPU6eyu+SdVCq3Mt4RIXr7kypkzimXa5k6iCtv6/TzXiy/U6XHQoePAUmBly+pyxMBRawbZjaxMT/vyWnieebXV09nc9GcEYOz81598fUEDFzpVtCuOu05I70+v1C6+88Bg+xUlPK9zc2+Un2e57Lpt+hf22hRX+ofCL+MPYYt1ejHWFThDr7UIl+5XnZLwOOhcN6yq5zakB9x13ah2d0X5/e7qA1zqxIFilnp4IytR0MHO3QGwptJRLoijs97y1oZf8+SW2IEZoHKGnKqPHZoX81JEeblkugFk10bGN1XMFFW36n17bjaDR1YbPSH79m5Rv8wpu0MFHBVTAZIsb7KIt0mwlkSTkiHbMRmAz1w1osQ+YV/PPk3OeKpJlxZyXPV6hQcA/2hrZ53g9XaWa8ILC6RC9IPWYR0+VQLn97Mq6ANWjFDDV2rckfkHLTjFlwRwYysJMr74MgLncJqjgqGF6dXWNlsPoFT02PBwpWm0W919s+VMi9/Nks+oJ0iY+UEuii2AQhcsF1tkSDEvVycq15wy95xXqUOewi8lakadZ+qWRF+N9urjhoRcispiIq0re3Hejv5fq6BuWVe5401a0
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(346002)(366004)(396003)(376002)(451199021)(55236004)(26005)(1076003)(6506007)(41300700001)(316002)(83380400001)(2616005)(107886003)(186003)(6512007)(6486002)(122000001)(478600001)(66946007)(71200400001)(4326008)(64756008)(38070700005)(66556008)(76116006)(66476007)(91956017)(6916009)(38100700002)(86362001)(5660300002)(66446008)(8936002)(8676002)(36756003)(2906002);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?iso-8859-1?Q?ITM6ytIAruRUjzvQlxuOsyhDyFE+eaUuACsPV3X8bHVaen/Gg/3mIicHjE?=
 =?iso-8859-1?Q?wGoQU2HATLd37nk4ZDC89r5w3E1EkU+khYqu0Jvoxrbpn/5GSfF1hkXq95?=
 =?iso-8859-1?Q?UBVrNmb8zTHnH6OeNgV5FvzbPGCEfm/MNEfvKGRlfkLtZbH2irud2ZmTUr?=
 =?iso-8859-1?Q?HdkbDpjLFS/1afZRWEiw+/dsts2hYPw5qtD1VRRw7SjHrMKGvH7NoEM2EM?=
 =?iso-8859-1?Q?y1otqVb264P3I6XLgCNGRPOpwBpc+obEif8QvLrP/HXtuxIPY4RdrNka8Y?=
 =?iso-8859-1?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MrExLbb0BPzC7o3w+44t5N/1EibNX3u9fES7U8268AJHMoWROOrNY++3v?=
 =?iso-8859-1?Q?x2r1x4ljuYM1FDSmxPH5CB+HHy5ek4CFHJ6Ok1ND2hrdcUMFEhbp0kgoKQ?=
 =?iso-8859-1?Q?JBPH7WG1fjFGAvIi3dIGYB1XrfL0fWVCNFIYhuZuGNQkisVjqjKtcwRIH2?=
 =?iso-8859-1?Q?hXxBIvPtOiFigfG+jMhiNkBjw0nl/K1p7Ro3Y9arseRuvSPLbX6gKJobxg?=
 =?iso-8859-1?Q?JVSeQQoI4Vrt+ynQvh1oVgflw3u+dCn5fcnYt5gap6axfAkS1NEheVP3eM?=
 =?iso-8859-1?Q?u1HfHieKKW/da6mFlUA89/7P2HwtnKTalzJFjPu6zoQGFfqQ2zr7y1MrWC?=
 =?iso-8859-1?Q?q7WVZvYJKiR4hr4fnX1AYj1Jh00ZdA/sUDcWknqmJnK8Kl79lanevyM6pF?=
 =?iso-8859-1?Q?jTuByJWCtXqMNThX2mW06QPptUXEc3s6AWJrM4t6XZ7V/yhiENAxr5qPCV?=
 =?iso-8859-1?Q?l4W9ZkJSn40KQMXcdpgCZ5Qq5uqdRL0Pr9qY3mw0UunEnOyJt5gMe6eQ?=
 =?iso-8859-1?Q?=3D=3D?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e473c0ba-1993-432a-40b3-08db88b8d001
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 00:32:33.2421
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: yeyPkEV1rHLodU8l+XJTj1Fhts+L6tlnUYju8BkhNVvqcL56MvK/COAhv9+OjINEliTl2ZQmAULxtLFuLeBzvSiPThR2XIMtZP73LxL7ETs=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7783
X-Proofpoint-ORIG-GUID: 0FRUiznFJ4kRDzCYwm57OU7wA6uC2nrp
X-Proofpoint-GUID: 0FRUiznFJ4kRDzCYwm57OU7wA6uC2nrp
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-19_16,2023-07-19_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0
 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 clxscore=1015
 suspectscore=0 phishscore=0 mlxlogscore=999 malwarescore=0
 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307200002

From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

Take into account guest's BAR view and program its p2m accordingly:
gfn is guest's view of the BAR and mfn is the physical BAR value as set
up by the PCI bus driver in the hardware domain.
This way hardware domain sees physical BAR values and guest sees
emulated ones.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
---
Since v5:
- remove debug print in map_range callback
- remove "identity" from the debug print
Since v4:
- moved start_{gfn|mfn} calculation into map_range
- pass vpci_bar in the map_data instead of start_{gfn|mfn}
- s/guest_addr/guest_reg
Since v3:
- updated comment (Roger)
- removed gfn_add(map->start_gfn, rc); which is wrong
- use v->domain instead of v->vpci.pdev->domain
- removed odd e.g. in comment
- s/d%d/%pd in altered code
- use gdprintk for map/unmap logs
Since v2:
- improve readability for data.start_gfn and restructure ?: construct
Since v1:
 - s/MSI/MSI-X in comments
---
 xen/drivers/vpci/header.c | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index eb07fa0bb2..e1a448b674 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -30,6 +30,7 @@
=20
 struct map_data {
     struct domain *d;
+    const struct vpci_bar *bar;
     bool map;
 };
=20
@@ -41,8 +42,21 @@ static int cf_check map_range(
=20
     for ( ; ; )
     {
+        /* Start address of the BAR as seen by the guest. */
+        gfn_t start_gfn =3D _gfn(PFN_DOWN(is_hardware_domain(map->d)
+                                        ? map->bar->addr
+                                        : map->bar->guest_reg));
+        /* Physical start address of the BAR. */
+        mfn_t start_mfn =3D _mfn(PFN_DOWN(map->bar->addr));
         unsigned long size =3D e - s + 1;
=20
+        /*
+         * Ranges to be mapped don't always start at the BAR start address=
, as
+         * there can be holes or partially consumed ranges. Account for th=
e
+         * offset of the current address from the BAR start.
+         */
+        start_gfn =3D gfn_add(start_gfn, s - mfn_x(start_mfn));
+
         /*
          * ARM TODOs:
          * - On ARM whether the memory is prefetchable or not should be pa=
ssed
@@ -52,8 +66,8 @@ static int cf_check map_range(
          * - {un}map_mmio_regions doesn't support preemption.
          */
=20
-        rc =3D map->map ? map_mmio_regions(map->d, _gfn(s), size, _mfn(s))
-                      : unmap_mmio_regions(map->d, _gfn(s), size, _mfn(s))=
;
+        rc =3D map->map ? map_mmio_regions(map->d, start_gfn, size, _mfn(s=
))
+                      : unmap_mmio_regions(map->d, start_gfn, size, _mfn(s=
));
         if ( rc =3D=3D 0 )
         {
             *c +=3D size;
@@ -62,8 +76,8 @@ static int cf_check map_range(
         if ( rc < 0 )
         {
             printk(XENLOG_G_WARNING
-                   "Failed to identity %smap [%lx, %lx] for d%d: %d\n",
-                   map->map ? "" : "un", s, e, map->d->domain_id, rc);
+                   "Failed to %smap [%lx, %lx] for %pd: %d\n",
+                   map->map ? "" : "un", s, e, map->d, rc);
             break;
         }
         ASSERT(rc < size);
@@ -165,6 +179,7 @@ bool vpci_process_pending(struct vcpu *v)
             if ( rangeset_is_empty(bar->mem) )
                 continue;
=20
+            data.bar =3D bar;
             rc =3D rangeset_consume_ranges(bar->mem, map_range, &data);
=20
             if ( rc =3D=3D -ERESTART )
@@ -228,6 +243,7 @@ static int __init apply_map(struct domain *d, const str=
uct pci_dev *pdev,
         if ( rangeset_is_empty(bar->mem) )
             continue;
=20
+        data.bar =3D bar;
         while ( (rc =3D rangeset_consume_ranges(bar->mem, map_range,
                                               &data)) =3D=3D -ERESTART )
         {
--=20
2.41.0


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:32:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:32:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566260.884883 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb6-0002ZN-FW; Thu, 20 Jul 2023 00:32:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566260.884883; Thu, 20 Jul 2023 00:32:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb6-0002Wl-2w; Thu, 20 Jul 2023 00:32:48 +0000
Received: by outflank-mailman (input) for mailman id 566260;
 Thu, 20 Jul 2023 00:32:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=5z78=DG=epam.com=prvs=156527e6f7=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qMHb2-0001JI-Nb
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:32:44 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f00b8948-2694-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 02:32:43 +0200 (CEST)
Received: from pps.filterd (m0174678.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36JMeiB9017190
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 00:32:41 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2057.outbound.protection.outlook.com [104.47.13.57])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rxgyx9k43-7
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 00:32:41 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS8PR03MB7783.eurprd03.prod.outlook.com (2603:10a6:20b:407::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 00:32:34 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6588.035; Thu, 20 Jul 2023
 00:32:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f00b8948-2694-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=nYqEJpvxPZBlTonCwr9TjNiNyZ+rpTnSAEfBNglKZtr188G7UwvqgDBw1xMytIqehwuY+b3W4OOY1nGN/GFOl9ZojPxhKoAnPEbUwHHjTiu5WQmOmZvdfQVFUGpXkthaC6yHvupJx9E3pHF1IQHZD23pj++M43EtNg1xQPeER6/3C/C463rchSDIAAKkd72PKj2l/EEQvnfIB2F0oh6Jm/gkmfkxOZ0YEUCO5OW3nd9SzPcbu51JO5Yp2Rk4ZEpEU+9a4yWIYP4yofLDH1dgDFhq1dn3bJHG1ar5FtLNSRimGM+XpGPK+hwCxpZSFLcpdNnlQFAKvlaRw6TbsgeFAA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=bfSYFj3qCWK47xmolGi8XD+FB4uZs6VedMBJamb2Ugc=;
 b=YW1GaM+YsJ5rRQo1Gi6tsw4/8E3YqmuEcUaRqIud8EgGuVEe14aPx7Oe178L0dWT9/AE0SonYbGpOttEYOUYaUy5GqSlBBgoLhS0T4pGmm+JX8/PT4yrQbUq27fDV44Agei49v2gufcNR40J1jGv1+ykgrUBmkyPDceQyGamCpWVz9rfWyQCNB+++mGieWaJ44k9uvjxLRPVoITKssXhwvJisCJKOyw9m2RXBwma/6P1XnhGkNG/0HnrFFVlvIGXTGYN/rTqHT31uMdqUunBqH3p75XsuGJHlUOGO7VlwAUh+/LZqSq27VyZ0iUeCKP6lajSjBXlrJLbfyFSe/ZpfQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=bfSYFj3qCWK47xmolGi8XD+FB4uZs6VedMBJamb2Ugc=;
 b=NPR0A6/NeRFbFCMCF/wH/kDzC2fdmn+ICsaLvWry6oOyoSP3AzmO2/nB0wu2zmCoPre3rGCo+AxlMkAqC9ZM24AAcTi+CHySrtU/gK6hHefL+SRVBSTD3MRw0rrCHC+890fIA1s5zIFKTysu9pu5q+UncorEPSNwxy14QWJpEU+gXiqS4478aOUqglqpkPIGRdLZDwiwzfDjFMTgD4oGXxgqe0Y8lE3XRlMDU1iwpFj7X6Cj34xZBaCIVpXEiZodY4B/9cO1KGFwJMNQ3qZ5UQwzop28N3Us6RrjxyH/vTFwgZgztC3BhYfN9iC4ovOyCY0a7iz0RMXRulLpOUBGmQ==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: [PATCH v8 07/13] vpci/header: handle p2m range sets per BAR
Thread-Topic: [PATCH v8 07/13] vpci/header: handle p2m range sets per BAR
Thread-Index: AQHZuqGsZnHxruBgBUyW03RT0neDNA==
Date: Thu, 20 Jul 2023 00:32:32 +0000
Message-ID: <20230720003205.1828537-8-volodymyr_babchuk@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
In-Reply-To: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-mailer: git-send-email 2.41.0
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS8PR03MB7783:EE_
x-ms-office365-filtering-correlation-id: 3e92be7c-f784-46f7-965c-08db88b8cf93
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 BK1LdzmU+hqekDAeNPKL4IDn/fEeCCv9qazQv56iSKag8/YWoRUwunYPSdwxh9jK+ajt2XX6FJrLMgtxy2BF7l2JCIlw2K69OER88KEDEZddVsXZR7Jn0kx9VN1WWNwrp1+/jJ9Km4WGEyLOHAykZXaXvdQqxTOy+HWnrtTZEZT/JDg7uZg9kFoaC8wyHkUlte9WAOg7BM1d9yU4twOXv/U8zjIS4k2z7fc1AyP4qGJFAFbd8QcPcWrHo91zAEVlZiMBKxKeCR2CkvXhQtcOnWATpX9S2cccpdQFJs6oirjyB4DEqbBYy+LDAnsG/pS6R/tHWOZSzdqarbji9IIQQJUuGFWEmvrl8sOlR9TUdd3ypWbnfVHCta9X/NEKFvH5uQUc7rFZffkzIzY/Pi8cP6jK7ko4Hzk0owMm6zSjREC4vuUguLnuUyxyqVRhs+cA7/pVxKrVoHFOqyzH6eiaJCEGp+XBGuqXUPxeUFUYPy7CbyFdPp4AEVd2jtI847pwP1s2eFdpmdE4mU9/d8Vg2+pdy6cAjgPZ34tKwaeBdpcnhgDJa9fMUEorsT4EzAf8AKp1jH1eXwOoe195a84ozqciZWZu6Z999STFlcwIT1pchDHXICFtYlwwEtRYvSbo
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(346002)(366004)(396003)(376002)(451199021)(55236004)(26005)(1076003)(6506007)(41300700001)(316002)(83380400001)(2616005)(107886003)(186003)(6512007)(6486002)(122000001)(478600001)(66946007)(71200400001)(4326008)(64756008)(38070700005)(66556008)(76116006)(66476007)(91956017)(6916009)(38100700002)(86362001)(5660300002)(66446008)(8936002)(8676002)(36756003)(30864003)(2906002);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?iso-8859-1?Q?2CqbqWqG/524K9F4nPw4O4wGKQmJmSlw8DyE0zB0mTfVEwo4PxM2m3GAxZ?=
 =?iso-8859-1?Q?1Q3/3mqsh+95o75DmgM3bFH1HO3QbQD6zMb0Qgj7aFxyWGGUcNvGOI6CEM?=
 =?iso-8859-1?Q?jyVsOW7Hh47ihHcjV5Qo5CZSAlXhovur8+Y4bXZhGbAhg5eNyDoR3fSyo8?=
 =?iso-8859-1?Q?aw8LlJJvvwDmq6agYhxLsl1ds7EuQZxBzmcfGe2RAo9ZGY027sllv6SMx1?=
 =?iso-8859-1?Q?my0cb87I6qege6rKD8+s8H8/nnw4N6vtjB6/ha2N8XKC2m7BJGA8hOiLtf?=
 =?iso-8859-1?Q?Jczi3GAbuMhSbNUQDEoJsJVE55/Izeis0qsX80uY4qhfwYy9Lbq+OCC6Rh?=
 =?iso-8859-1?Q?fRQ9M9DcIzGUywpV+4cB5QRxIYGA/vVBJRQokCFdji+V53OrUBiggLJ18I?=
 =?iso-8859-1?Q?p0tAewYF9Wjg9rAtaftbefJnsDLZugBz+MNFkhEqTCdEAh9My+UF1Ya0cS?=
 =?iso-8859-1?Q?GZ92Os5yowwG8RLn79Dd6B95zo/1IU7UgwhGqMhmPBYVRv12jPBosDhwIv?=
 =?iso-8859-1?Q?Ucr4bngASup5VWg1rFQUwvqU/SeAAq3F/ah7PoA6OaaOt45hGNZPQ1jInA?=
 =?iso-8859-1?Q?hEx//Bt8uxy5e9mktAccSWUjQGYZeRpVTcDWwP8eF5l8lEOkrqzLEYdrTb?=
 =?iso-8859-1?Q?wTgJ7uQsQtJHCzzLcE1IlwXaL12w6BUH4niXJ/CpybG/E18xNRQbAsjf10?=
 =?iso-8859-1?Q?DpcD9j+IEDlauaenlwJHjN/gz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weZdI58iyMAuTAJJEiZgCXkl3YF3b?=
 =?iso-8859-1?Q?o/8o3jEzQ5FILRUYFFka/1sdh/ZO7pTVBNYLnJ9QdmzQ9n2g9fYSr/Vg?=
 =?iso-8859-1?Q?=3D=3D?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3e92be7c-f784-46f7-965c-08db88b8cf93
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 00:32:32.9924
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: Oez4NfckEs57RyrUo/1qQTogW9Yip7DfAQWbsDZ2gNJj9eiMpm5G6Nea+VyT5xExOY6Y7NSQMFhCdtJ2zJYv36/VlZP0djs3cbC7gX+YZaU=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7783
X-Proofpoint-ORIG-GUID: v7awCBYqKbbJt-sdSLCk-QjslHKggHmC
X-Proofpoint-GUID: v7awCBYqKbbJt-sdSLCk-QjslHKggHmC
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-19_16,2023-07-19_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0
 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 clxscore=1015
 suspectscore=0 phishscore=0 mlxlogscore=999 malwarescore=0
 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307200002

From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

Instead of handling a single range set, that contains all the memory
regions of all the BARs and ROM, have them per BAR.
As the range sets are now created when a PCI device is added and destroyed
when it is removed so make them named and accounted.

Note that rangesets were chosen here despite there being only up to
3 separate ranges in each set (typically just 1). But rangeset per BAR
was chosen for the ease of implementation and existing code re-usability.

This is in preparation of making non-identity mappings in p2m for the MMIOs=
.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

---
Since v6:
- update according to the new locking scheme
- remove odd fail label in modify_bars
Since v5:
- fix comments
- move rangeset allocation to init_bars and only allocate
  for MAPPABLE BARs
- check for overlap with the already setup BAR ranges
Since v4:
- use named range sets for BARs (Jan)
- changes required by the new locking scheme
- updated commit message (Jan)
Since v3:
- re-work vpci_cancel_pending accordingly to the per-BAR handling
- s/num_mem_ranges/map_pending and s/uint8_t/bool
- ASSERT(bar->mem) in modify_bars
- create and destroy the rangesets on add/remove
---
 xen/drivers/vpci/header.c | 235 ++++++++++++++++++++++++++++----------
 xen/drivers/vpci/vpci.c   |   6 +
 xen/include/xen/vpci.h    |   3 +-
 3 files changed, 181 insertions(+), 63 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index 5dc9b5338b..eb07fa0bb2 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -141,63 +141,106 @@ static void modify_decoding(const struct pci_dev *pd=
ev, uint16_t cmd,
=20
 bool vpci_process_pending(struct vcpu *v)
 {
-    if ( v->vpci.mem )
+    struct pci_dev *pdev =3D v->vpci.pdev;
+
+    if ( !pdev )
+        return false;
+
+    if ( v->vpci.map_pending )
     {
         struct map_data data =3D {
             .d =3D v->domain,
             .map =3D v->vpci.cmd & PCI_COMMAND_MEMORY,
         };
-        int rc =3D rangeset_consume_ranges(v->vpci.mem, map_range, &data);
-
-        if ( rc =3D=3D -ERESTART )
-            return true;
+        struct vpci_header *header =3D &pdev->vpci->header;
+        unsigned int i;
=20
         write_lock(&v->domain->pci_lock);
-        spin_lock(&v->vpci.pdev->vpci->lock);
-        /* Disable memory decoding unconditionally on failure. */
-        modify_decoding(v->vpci.pdev,
-                        rc ? v->vpci.cmd & ~PCI_COMMAND_MEMORY : v->vpci.c=
md,
-                        !rc && v->vpci.rom_only);
-        spin_unlock(&v->vpci.pdev->vpci->lock);
-
-        rangeset_destroy(v->vpci.mem);
-        v->vpci.mem =3D NULL;
-        if ( rc )
-            /*
-             * FIXME: in case of failure remove the device from the domain=
.
-             * Note that there might still be leftover mappings. While thi=
s is
-             * safe for Dom0, for DomUs the domain will likely need to be
-             * killed in order to avoid leaking stale p2m mappings on
-             * failure.
-             */
-            vpci_remove_device(v->vpci.pdev);
+
+        for ( i =3D 0; i < ARRAY_SIZE(header->bars); i++ )
+        {
+            struct vpci_bar *bar =3D &header->bars[i];
+            int rc;
+
+            if ( rangeset_is_empty(bar->mem) )
+                continue;
+
+            rc =3D rangeset_consume_ranges(bar->mem, map_range, &data);
+
+            if ( rc =3D=3D -ERESTART )
+            {
+                write_unlock(&v->domain->pci_lock);
+                return true;
+            }
+
+            spin_lock(&pdev->vpci->lock);
+            /* Disable memory decoding unconditionally on failure. */
+            modify_decoding(pdev, rc ? v->vpci.cmd & ~PCI_COMMAND_MEMORY :
+                                       v->vpci.cmd, !rc && v->vpci.rom_onl=
y);
+            spin_unlock(&pdev->vpci->lock);
+
+            if ( rc )
+            {
+                /*
+                 * FIXME: in case of failure remove the device from the do=
main.
+                 * Note that there might still be leftover mappings. While=
 this
+                 * is safe for Dom0, for DomUs the domain needs to be kill=
ed in
+                 * order to avoid leaking stale p2m mappings on failure.
+                 */
+                v->vpci.map_pending =3D false;
+
+                if ( is_hardware_domain(v->domain) )
+                {
+                    vpci_remove_device(pdev);
+                    write_unlock(&v->domain->pci_lock);
+                }
+                else
+                {
+                    write_unlock(&v->domain->pci_lock);
+                    domain_crash(v->domain);
+                }
+                return false;
+            }
+        }
         write_unlock(&v->domain->pci_lock);
+
+        v->vpci.map_pending =3D false;
     }
=20
+
     return false;
 }
=20
 static int __init apply_map(struct domain *d, const struct pci_dev *pdev,
-                            struct rangeset *mem, uint16_t cmd)
+                            uint16_t cmd)
 {
     struct map_data data =3D { .d =3D d, .map =3D true };
-    int rc;
+    struct vpci_header *header =3D &pdev->vpci->header;
+    int rc =3D 0;
+    unsigned int i;
=20
     ASSERT(rw_is_locked(&d->pci_lock));
=20
-    while ( (rc =3D rangeset_consume_ranges(mem, map_range, &data)) =3D=3D=
 -ERESTART )
+    for ( i =3D 0; i < ARRAY_SIZE(header->bars); i++ )
     {
-        /*
-         * It's safe to drop and reacquire the lock in this context
-         * without risking pdev disappearing because devices cannot be
-         * removed until the initial domain has been started.
-         */
-        read_unlock(&d->pci_lock);
-        process_pending_softirqs();
-        read_lock(&d->pci_lock);
-    }
+        struct vpci_bar *bar =3D &header->bars[i];
=20
-    rangeset_destroy(mem);
+        if ( rangeset_is_empty(bar->mem) )
+            continue;
+
+        while ( (rc =3D rangeset_consume_ranges(bar->mem, map_range,
+                                              &data)) =3D=3D -ERESTART )
+        {
+            /*
+             * It's safe to drop and reacquire the lock in this context
+             * without risking pdev disappearing because devices cannot be
+             * removed until the initial domain has been started.
+             */
+            write_unlock(&d->pci_lock);
+            process_pending_softirqs();
+            write_lock(&d->pci_lock);
+        }
+    }
     if ( !rc )
         modify_decoding(pdev, cmd, false);
=20
@@ -205,10 +248,12 @@ static int __init apply_map(struct domain *d, const s=
truct pci_dev *pdev,
 }
=20
 static void defer_map(struct domain *d, struct pci_dev *pdev,
-                      struct rangeset *mem, uint16_t cmd, bool rom_only)
+                      uint16_t cmd, bool rom_only)
 {
     struct vcpu *curr =3D current;
=20
+    ASSERT(!!rw_is_write_locked(&pdev->domain->pci_lock));
+
     /*
      * FIXME: when deferring the {un}map the state of the device should no=
t
      * be trusted. For example the enable bit is toggled after the device
@@ -216,7 +261,7 @@ static void defer_map(struct domain *d, struct pci_dev =
*pdev,
      * started for the same device if the domain is not well-behaved.
      */
     curr->vpci.pdev =3D pdev;
-    curr->vpci.mem =3D mem;
+    curr->vpci.map_pending =3D true;
     curr->vpci.cmd =3D cmd;
     curr->vpci.rom_only =3D rom_only;
     /*
@@ -230,33 +275,34 @@ static void defer_map(struct domain *d, struct pci_de=
v *pdev,
 static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_=
only)
 {
     struct vpci_header *header =3D &pdev->vpci->header;
-    struct rangeset *mem =3D rangeset_new(NULL, NULL, 0);
     struct pci_dev *tmp, *dev =3D NULL;
     const struct domain *d;
     const struct vpci_msix *msix =3D pdev->vpci->msix;
-    unsigned int i;
+    unsigned int i, j;
     int rc;
+    bool map_pending;
=20
     ASSERT(rw_is_locked(&pdev->domain->pci_lock));
=20
-    if ( !mem )
-        return -ENOMEM;
-
     /*
-     * Create a rangeset that represents the current device BARs memory re=
gion
-     * and compare it against all the currently active BAR memory regions.=
 If
-     * an overlap is found, subtract it from the region to be mapped/unmap=
ped.
+     * Create a rangeset per BAR that represents the current device memory
+     * region and compare it against all the currently active BAR memory
+     * regions. If an overlap is found, subtract it from the region to be
+     * mapped/unmapped.
      *
-     * First fill the rangeset with all the BARs of this device or with th=
e ROM
+     * First fill the rangesets with the BARs of this device or with the R=
OM
      * BAR only, depending on whether the guest is toggling the memory dec=
ode
      * bit of the command register, or the enable bit of the ROM BAR regis=
ter.
      */
     for ( i =3D 0; i < ARRAY_SIZE(header->bars); i++ )
     {
-        const struct vpci_bar *bar =3D &header->bars[i];
+        struct vpci_bar *bar =3D &header->bars[i];
         unsigned long start =3D PFN_DOWN(bar->addr);
         unsigned long end =3D PFN_DOWN(bar->addr + bar->size - 1);
=20
+        if ( !bar->mem )
+            continue;
+
         if ( !MAPPABLE_BAR(bar) ||
              (rom_only ? bar->type !=3D VPCI_BAR_ROM
                        : (bar->type =3D=3D VPCI_BAR_ROM && !header->rom_en=
abled)) ||
@@ -272,14 +318,31 @@ static int modify_bars(const struct pci_dev *pdev, ui=
nt16_t cmd, bool rom_only)
             continue;
         }
=20
-        rc =3D rangeset_add_range(mem, start, end);
+        rc =3D rangeset_add_range(bar->mem, start, end);
         if ( rc )
         {
             printk(XENLOG_G_WARNING "Failed to add [%lx, %lx]: %d\n",
                    start, end, rc);
-            rangeset_destroy(mem);
             return rc;
         }
+
+        /* Check for overlap with the already setup BAR ranges. */
+        for ( j =3D 0; j < i; j++ )
+        {
+            struct vpci_bar *bar =3D &header->bars[j];
+
+            if ( rangeset_is_empty(bar->mem) )
+                continue;
+
+            rc =3D rangeset_remove_range(bar->mem, start, end);
+            if ( rc )
+            {
+                printk(XENLOG_G_WARNING
+                       "Failed to remove overlapping range [%lx, %lx]: %d\=
n",
+                       start, end, rc);
+                return rc;
+            }
+        }
     }
=20
     /* Remove any MSIX regions if present. */
@@ -289,14 +352,21 @@ static int modify_bars(const struct pci_dev *pdev, ui=
nt16_t cmd, bool rom_only)
         unsigned long end =3D PFN_DOWN(vmsix_table_addr(pdev->vpci, i) +
                                      vmsix_table_size(pdev->vpci, i) - 1);
=20
-        rc =3D rangeset_remove_range(mem, start, end);
-        if ( rc )
+        for ( j =3D 0; j < ARRAY_SIZE(header->bars); j++ )
         {
-            printk(XENLOG_G_WARNING
-                   "Failed to remove MSIX table [%lx, %lx]: %d\n",
-                   start, end, rc);
-            rangeset_destroy(mem);
-            return rc;
+            const struct vpci_bar *bar =3D &header->bars[j];
+
+            if ( rangeset_is_empty(bar->mem) )
+                continue;
+
+            rc =3D rangeset_remove_range(bar->mem, start, end);
+            if ( rc )
+            {
+                printk(XENLOG_G_WARNING
+                       "Failed to remove MSIX table [%lx, %lx]: %d\n",
+                       start, end, rc);
+                return rc;
+            }
         }
     }
=20
@@ -341,7 +411,7 @@ static int modify_bars(const struct pci_dev *pdev, uint=
16_t cmd, bool rom_only)
                 unsigned long end =3D PFN_DOWN(bar->addr + bar->size - 1);
=20
                 if ( !bar->enabled ||
-                     !rangeset_overlaps_range(mem, start, end) ||
+                     !rangeset_overlaps_range(bar->mem, start, end) ||
                      /*
                       * If only the ROM enable bit is toggled check agains=
t
                       * other BARs in the same device for overlaps, but no=
t
@@ -350,12 +420,11 @@ static int modify_bars(const struct pci_dev *pdev, ui=
nt16_t cmd, bool rom_only)
                      (rom_only && tmp =3D=3D pdev && bar->type =3D=3D VPCI=
_BAR_ROM) )
                     continue;
=20
-                rc =3D rangeset_remove_range(mem, start, end);
+                rc =3D rangeset_remove_range(bar->mem, start, end);
                 if ( rc )
                 {
                     printk(XENLOG_G_WARNING "Failed to remove [%lx, %lx]: =
%d\n",
                            start, end, rc);
-                    rangeset_destroy(mem);
                     return rc;
                 }
             }
@@ -380,10 +449,23 @@ static int modify_bars(const struct pci_dev *pdev, ui=
nt16_t cmd, bool rom_only)
          * will always be to establish mappings and process all the BARs.
          */
         ASSERT((cmd & PCI_COMMAND_MEMORY) && !rom_only);
-        return apply_map(pdev->domain, pdev, mem, cmd);
+        return apply_map(pdev->domain, pdev, cmd);
     }
=20
-    defer_map(dev->domain, dev, mem, cmd, rom_only);
+    /* Find out how many memory ranges has left after MSI and overlaps. */
+    map_pending =3D false;
+    for ( i =3D 0; i < ARRAY_SIZE(header->bars); i++ )
+        if ( !rangeset_is_empty(header->bars[i].mem) )
+        {
+            map_pending =3D true;
+            break;
+        }
+
+    /* If there's no mapping work write the command register now. */
+    if ( !map_pending )
+        pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
+    else
+        defer_map(dev->domain, dev, cmd, rom_only);
=20
     return 0;
 }
@@ -574,6 +656,19 @@ static void cf_check rom_write(
         rom->addr =3D val & PCI_ROM_ADDRESS_MASK;
 }
=20
+static int bar_add_rangeset(struct pci_dev *pdev, struct vpci_bar *bar, in=
t i)
+{
+    char str[32];
+
+    snprintf(str, sizeof(str), "%pp:BAR%d", &pdev->sbdf, i);
+
+    bar->mem =3D rangeset_new(pdev->domain, str, RANGESETF_no_print);
+    if ( !bar->mem )
+        return -ENOMEM;
+
+    return 0;
+}
+
 static int cf_check init_bars(struct pci_dev *pdev)
 {
     uint16_t cmd;
@@ -657,6 +752,13 @@ static int cf_check init_bars(struct pci_dev *pdev)
         else
             bars[i].type =3D VPCI_BAR_MEM32;
=20
+        rc =3D bar_add_rangeset(pdev, &bars[i], i);
+        if ( rc )
+        {
+            bars[i].type =3D VPCI_BAR_EMPTY;
+            return rc;
+        }
+
         rc =3D pci_size_mem_bar(pdev->sbdf, reg, &addr, &size,
                               (i =3D=3D num_bars - 1) ? PCI_BAR_LAST : 0);
         if ( rc < 0 )
@@ -707,6 +809,15 @@ static int cf_check init_bars(struct pci_dev *pdev)
                                    rom_reg, 4, rom);
             if ( rc )
                 rom->type =3D VPCI_BAR_EMPTY;
+            else
+            {
+                rc =3D bar_add_rangeset(pdev, rom, i);
+                if ( rc )
+                {
+                    rom->type =3D VPCI_BAR_EMPTY;
+                    return rc;
+                }
+            }
         }
     }
     else
diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index a97710a806..ca3505ecb7 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -38,6 +38,8 @@ extern vpci_register_init_t *const __end_vpci_array[];
=20
 void vpci_remove_device(struct pci_dev *pdev)
 {
+    unsigned int i;
+
     ASSERT(rw_is_write_locked(&pdev->domain->pci_lock));
=20
     if ( !has_vpci(pdev->domain) || !pdev->vpci )
@@ -63,6 +65,10 @@ void vpci_remove_device(struct pci_dev *pdev)
             if ( pdev->vpci->msix->table[i] )
                 iounmap(pdev->vpci->msix->table[i]);
     }
+
+    for ( i =3D 0; i < ARRAY_SIZE(pdev->vpci->header.bars); i++ )
+        rangeset_destroy(pdev->vpci->header.bars[i].mem);
+
     xfree(pdev->vpci->msix);
     xfree(pdev->vpci->msi);
     xfree(pdev->vpci);
diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
index 486a655e8d..b78dd6512b 100644
--- a/xen/include/xen/vpci.h
+++ b/xen/include/xen/vpci.h
@@ -72,6 +72,7 @@ struct vpci {
             /* Guest view of the BAR: address and lower bits. */
             uint64_t guest_reg;
             uint64_t size;
+            struct rangeset *mem;
             enum {
                 VPCI_BAR_EMPTY,
                 VPCI_BAR_IO,
@@ -156,9 +157,9 @@ struct vpci {
=20
 struct vpci_vcpu {
     /* Per-vcpu structure to store state while {un}mapping of PCI BARs. */
-    struct rangeset *mem;
     struct pci_dev *pdev;
     uint16_t cmd;
+    bool map_pending : 1;
     bool rom_only : 1;
 };
=20
--=20
2.41.0


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:32:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:32:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566259.884879 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb5-0002Q5-Uv; Thu, 20 Jul 2023 00:32:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566259.884879; Thu, 20 Jul 2023 00:32:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb5-0002Nt-IA; Thu, 20 Jul 2023 00:32:47 +0000
Received: by outflank-mailman (input) for mailman id 566259;
 Thu, 20 Jul 2023 00:32:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=5z78=DG=epam.com=prvs=156527e6f7=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qMHb2-0001JI-10
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:32:44 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f01d57f2-2694-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 02:32:43 +0200 (CEST)
Received: from pps.filterd (m0174676.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36JJCjt1031890
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 00:32:41 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2059.outbound.protection.outlook.com [104.47.13.59])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rxgcw1sme-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 00:32:41 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS8PR03MB7783.eurprd03.prod.outlook.com (2603:10a6:20b:407::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 00:32:33 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6588.035; Thu, 20 Jul 2023
 00:32:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f01d57f2-2694-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=cXJRK6rwzW5HMe0sgsb43DAcB33at01X+Mr9WQROcdlhjpnDWjCXP9rmSLP9IfKPQxmP8gbU+g4OwmpUrgfXPnOewx/YS5qc6kHlNOE6cviAR/RTNAK3+Fxj5RUDw4j5u4yt+gKoDN6eHCp4EJGenWFP0TAYswajCnU7t/heLY1aXuMP8DO/Rl2FCT04c6+Tr6TNBpsCmZD1lmHzBuCM8ayQoByIajPXiwJAaHTEyR8CPqSbH5sTRrhV+wR1EmBcRWWypGslwahaprGUcnOExUGmPLzOEDf3ckQegFUrHtDy3OXLG2Jnhf7T1qMSI06pjLmMs4QRCpYb18oMd2JEWA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MizkqGgd+iTF6D6kSkQzhVLSHfvXaFyO/O67Z15pDNc=;
 b=noR6Odkjrb8yHjw59rTKh3q9h3eJIPW5H99jRtID8J/VsPt/SJ1/2F9l93B9gyd0KHi+cL8YQULWCXGLpuPIohNEb8K20HKr0+C3WAkHlyGU81D/so6oFVxqeTk5MtRgo201FeQKmjwOpeA0rtzXa6mS1pCbA7gm/Bd5Wllj+akDGkqCv23HHGa2u4ZPnUMmDT3nRm7PvHN4hCklPvQB4gSkriOBNJEXTX7pmHypmJnxNPlQU80fcYu2xJpsGwNdH7fxp8iX2z2Zv0A0fxSSGCaG/BscYu8GaK0AVNj2MuG88omCTxyKwStbIOEtzWV+OMZQ/6C6onX6XSd/kfYx9g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MizkqGgd+iTF6D6kSkQzhVLSHfvXaFyO/O67Z15pDNc=;
 b=T+8RkjQGZ8TlgG3f0HqxwkRRnsDXAageIIj5iOjPe1JJFwhGvLNyJ5Cd5C4NdSqp6XtXzXBbxP5aOHOOxyMgFRSKfLTqHxsc04r2ALCfyxDZwudCezltZKZAcW8F3QkSSof7r3vnogI/jYmj+ncIALs3L2mW8ObNLeRoxQs5yfruoFG68oAapF8cB3XUmHREQvD7xDJksmwVVX8MZ0xnT9mttjlHwWp/VXMwixmKVjlaDztisd7TW7oH/sUKX+p0NbIHEhsIPG4r82J0Wqv814WBzMQR+if1VfzKbKabO+RRLA1ba+2aF5dzEn6xY+4UEtk/EoUZmbShctlwXlfu1Q==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: [PATCH v8 04/13] vpci: add hooks for PCI device assign/de-assign
Thread-Topic: [PATCH v8 04/13] vpci: add hooks for PCI device assign/de-assign
Thread-Index: AQHZuqGrBGIo4QxjlkuKy7Wb3D/bwQ==
Date: Thu, 20 Jul 2023 00:32:31 +0000
Message-ID: <20230720003205.1828537-5-volodymyr_babchuk@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
In-Reply-To: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-mailer: git-send-email 2.41.0
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS8PR03MB7783:EE_
x-ms-office365-filtering-correlation-id: 80f4905c-4e6b-424e-0264-08db88b8cefb
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 CbkOUNSSwFztXpVcFoBsryppOmW6mMhJUjydlAhR2KvG51i2nh8KYn999frhttOQD33AXPUEG2IGMKDhTLRg4hlJPWB853VC6IZB0yVK5b/G9xMHouKFFnZGwH3ZiJ57jYik1peZTnNB+vEYNXUnHkm4EPHIzzzZYSy31OwLxOmFIrA2Y+LUxNOlNj2sgo6BDsr5pNRtv6flHE3NUzYXqjLrOChVv8T0XyrMuYeOGh2Nn3b3XOdQXnfG2+6A68kYEeOVy+oq/K++Os8K9OTHrUIELBlXZATTg8RCeFrBGDbbW7t+3HvugoAGzmUHLNlP088kTEPJvYFVNwj6ameLI12Kax6CO9KnZD8ZEtZOW4bPM7xylGrCDdeOyZSngiMCnAfETJJ6ZhKUhSD+E3zF/soVZEabCS73UqJDJ5MSYuAKBIGhQ6+XgbGLtk/h/Mus3CiW3q25N9GBIiQNVK98q0k7IdfjOeRwyVqgtKyV84xgaQPUPHPf/p0DByFlMDUa9I1LDiS46DYFgxEk3HraVr8zF0+T9jKlO+G6VNxt+xK1T1FBGXOzAhA4C71vKIUF6Gx8PyaIMyOPu4XoCwTooeSAM6+IMZ/4rYoU29Z6SFDbJW0D+hI5r0KdhMk8mDGE
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(346002)(366004)(396003)(376002)(451199021)(55236004)(26005)(1076003)(6506007)(41300700001)(316002)(83380400001)(2616005)(107886003)(186003)(6512007)(6486002)(122000001)(478600001)(66946007)(71200400001)(4326008)(64756008)(38070700005)(66556008)(76116006)(66476007)(91956017)(6916009)(38100700002)(86362001)(5660300002)(66446008)(8936002)(8676002)(36756003)(2906002);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?iso-8859-1?Q?FnsETNGgYgV3EtAqO7rg0TLK184/cbwvgu+zIkBnJkdAqZXCNPANihWeXS?=
 =?iso-8859-1?Q?as/PqVY3aHBGOJhRESpwL6a2AZT7EocJ7SphHI+IyaypUwX4CLJKdwC7EP?=
 =?iso-8859-1?Q?TAofAJmicrrlzRm1cJGeAS+O+Kd/da5hgB5lB0KLklEmOIniklS1VULM/M?=
 =?iso-8859-1?Q?F1CSNsYMNUekyWHmQScZMsDn5U8L0ykFiLYsoayBO+F8ZcdPtIaQ8CsxPe?=
 =?iso-8859-1?Q?Zcaab95EV8CVxmtH2fHXA6KDNRCpQRwEI5JvTgKmQBRL5ZM5P9q4MLg361?=
 =?iso-8859-1?Q?DStrxf7eumf0CPtKdzQNYbVzd8Oa2W00KlVPssMcsaIRuU6GtAFvWApCH2?=
 =?iso-8859-1?Q?K9O1EQEchcTr7zm+Rtt/sX2su2bs+G+33CTw/GeWBTOjX/4oP7I22QHkLH?=
 =?iso-8859-1?Q?KBi4sY9pbGEUwCVaFG+AW1Gdo4uSpaFQLtqFitKfDYKQi+9LgyB/kgVfml?=
 =?iso-8859-1?Q?VT6XwC1SXjjBVDh5m96A71Yk32P9m6pla91zoFy+KL6s4PGMFr3EI1td45?=
 =?iso-8859-1?Q?fEQs4T6UsN4bAHCYisGyv5KbQniRKpcw0Gm61epAYLCknmA3ov3Cq140fe?=
 =?iso-8859-1?Q?IFW7FX14sFnXvjyKXHZyaccER1Q4tTOygqEcIfHwKkbwvEYcyeMaUy18ib?=
 =?iso-8859-1?Q?MsVFSEcQXzClslsI3X6ExZKG4JRU3z0cejKSnd6PtCnK03gn3yFquofHfk?=
 =?iso-8859-1?Q?0oHLZ3vrTNbQMLaqj+UDpd5GqhhddzUVKzntyxEomfWka+jWTjw+iYYqe3?=
 =?iso-8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PUDvly1dakUlITVf+JAVjIVnbWXs6F+Pla6itCj5F9uskikocVQ?=
 =?iso-8859-1?Q?=3D=3D?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 80f4905c-4e6b-424e-0264-08db88b8cefb
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 00:32:32.0060
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: PW7Av36w37QxXiylXQkqnmXRHwqPHay44pjY8rUnvXiAWKZtbuKkTEsOC9cNqc170y+GKtcwosZND05F2FT3c2Od02Lkf8u5wBeNYzi81mM=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7783
X-Proofpoint-ORIG-GUID: yiqGwBQ8nkusslf8AHeYd76_d-OHqROd
X-Proofpoint-GUID: yiqGwBQ8nkusslf8AHeYd76_d-OHqROd
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-19_16,2023-07-19_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0
 malwarescore=0 mlxlogscore=999 suspectscore=0 phishscore=0 mlxscore=0
 spamscore=0 bulkscore=0 clxscore=1015 impostorscore=0 adultscore=0
 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307200002

From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

When a PCI device gets assigned/de-assigned some work on vPCI side needs
to be done for that device. Introduce a pair of hooks so vPCI can handle
that.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
---
Since v8:
- removed vpci_deassign_device
Since v6:
- do not pass struct domain to vpci_{assign|deassign}_device as
  pdev->domain can be used
- do not leave the device assigned (pdev->domain =3D=3D new domain) in case
  vpci_assign_device fails: try to de-assign and if this also fails, then
  crash the domain
Since v5:
- do not split code into run_vpci_init
- do not check for is_system_domain in vpci_{de}assign_device
- do not use vpci_remove_device_handlers_locked and re-allocate
  pdev->vpci completely
- make vpci_deassign_device void
Since v4:
 - de-assign vPCI from the previous domain on device assignment
 - do not remove handlers in vpci_assign_device as those must not
   exist at that point
Since v3:
 - remove toolstack roll-back description from the commit message
   as error are to be handled with proper cleanup in Xen itself
 - remove __must_check
 - remove redundant rc check while assigning devices
 - fix redundant CONFIG_HAS_VPCI check for CONFIG_HAS_VPCI_GUEST_SUPPORT
 - use REGISTER_VPCI_INIT machinery to run required steps on device
   init/assign: add run_vpci_init helper
Since v2:
- define CONFIG_HAS_VPCI_GUEST_SUPPORT so dead code is not compiled
  for x86
Since v1:
 - constify struct pci_dev where possible
 - do not open code is_system_domain()
 - extended the commit message
---
 xen/drivers/Kconfig           |  4 ++++
 xen/drivers/passthrough/pci.c | 21 +++++++++++++++++++++
 xen/drivers/vpci/vpci.c       | 18 ++++++++++++++++++
 xen/include/xen/vpci.h        | 15 +++++++++++++++
 4 files changed, 58 insertions(+)

diff --git a/xen/drivers/Kconfig b/xen/drivers/Kconfig
index db94393f47..780490cf8e 100644
--- a/xen/drivers/Kconfig
+++ b/xen/drivers/Kconfig
@@ -15,4 +15,8 @@ source "drivers/video/Kconfig"
 config HAS_VPCI
 	bool
=20
+config HAS_VPCI_GUEST_SUPPORT
+	bool
+	depends on HAS_VPCI
+
 endmenu
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 6f8692cd9c..265d359704 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -885,6 +885,10 @@ static int deassign_device(struct domain *d, uint16_t =
seg, uint8_t bus,
     if ( ret )
         goto out;
=20
+    write_lock(&pdev->domain->pci_lock);
+    vpci_deassign_device(pdev);
+    write_unlock(&pdev->domain->pci_lock);
+
     if ( pdev->domain =3D=3D hardware_domain  )
         pdev->quarantine =3D false;
=20
@@ -1484,6 +1488,10 @@ static int assign_device(struct domain *d, u16 seg, =
u8 bus, u8 devfn, u32 flag)
     if ( pdev->broken && d !=3D hardware_domain && d !=3D dom_io )
         goto done;
=20
+    write_lock(&pdev->domain->pci_lock);
+    vpci_deassign_device(pdev);
+    write_unlock(&pdev->domain->pci_lock);
+
     rc =3D pdev_msix_assign(d, pdev);
     if ( rc )
         goto done;
@@ -1509,6 +1517,19 @@ static int assign_device(struct domain *d, u16 seg, =
u8 bus, u8 devfn, u32 flag)
         rc =3D iommu_call(hd->platform_ops, assign_device, d, devfn,
                         pci_to_dev(pdev), flag);
     }
+    if ( rc )
+        goto done;
+
+    devfn =3D pdev->devfn;
+    write_lock(&pdev->domain->pci_lock);
+    rc =3D vpci_assign_device(pdev);
+    write_unlock(&pdev->domain->pci_lock);
+    if ( rc && deassign_device(d, seg, bus, devfn) )
+    {
+        printk(XENLOG_ERR "%pd: %pp was left partially assigned\n",
+               d, &PCI_SBDF(seg, bus, devfn));
+        domain_crash(d);
+    }
=20
  done:
     if ( rc )
diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index a6d2cf8660..a97710a806 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -107,6 +107,24 @@ int vpci_add_handlers(struct pci_dev *pdev)
=20
     return rc;
 }
+
+#ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
+/* Notify vPCI that device is assigned to guest. */
+int vpci_assign_device(struct pci_dev *pdev)
+{
+    int rc;
+
+    if ( !has_vpci(pdev->domain) )
+        return 0;
+
+    rc =3D vpci_add_handlers(pdev);
+    if ( rc )
+        vpci_deassign_device(pdev);
+
+    return rc;
+}
+#endif /* CONFIG_HAS_VPCI_GUEST_SUPPORT */
+
 #endif /* __XEN__ */
=20
 static int vpci_register_cmp(const struct vpci_register *r1,
diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
index 0b8a2a3c74..44296623e1 100644
--- a/xen/include/xen/vpci.h
+++ b/xen/include/xen/vpci.h
@@ -264,6 +264,21 @@ static inline bool __must_check vpci_process_pending(s=
truct vcpu *v)
 }
 #endif
=20
+#ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
+/* Notify vPCI that device is assigned/de-assigned to/from guest. */
+int vpci_assign_device(struct pci_dev *pdev);
+#define vpci_deassign_device vpci_remove_device
+#else
+static inline int vpci_assign_device(struct pci_dev *pdev)
+{
+    return 0;
+};
+
+static inline void vpci_deassign_device(struct pci_dev *pdev)
+{
+};
+#endif
+
 #endif
=20
 /*
--=20
2.41.0


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:32:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:32:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566263.884918 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb9-0003T7-H4; Thu, 20 Jul 2023 00:32:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566263.884918; Thu, 20 Jul 2023 00:32:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb8-0003OM-Sw; Thu, 20 Jul 2023 00:32:50 +0000
Received: by outflank-mailman (input) for mailman id 566263;
 Thu, 20 Jul 2023 00:32:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=5z78=DG=epam.com=prvs=156527e6f7=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qMHb4-0001JI-Ns
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:32:46 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f0ffb643-2694-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 02:32:44 +0200 (CEST)
Received: from pps.filterd (m0174676.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36JJCjt3031890
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 00:32:43 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2059.outbound.protection.outlook.com [104.47.13.59])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rxgcw1sme-3
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 00:32:43 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS8PR03MB7783.eurprd03.prod.outlook.com (2603:10a6:20b:407::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 00:32:35 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6588.035; Thu, 20 Jul 2023
 00:32:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f0ffb643-2694-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=TmM4Ni51K9+lPW5CTwQ3iRc6+CBnX1wRg4Cz9ZuCUNG0mesjkS7AFqOniuH5vWgKHFGhX8uGBfX6uRxPI+tUq113lzXDIx6o7aGSKNszlYm/7FQyoKSOkDlQkDSnzveGogU1xcA1uyIghyi89x/PmdPrkwUQB/osELWDFNAWnHMNLsyHQSya0eFSPbl9V+aYLvmzVq+snxGL1gjG3cWP7ahMgHEz6XKD190CoLDxrIR4bxoym8OqV0C9L+TztVr1ttOBaGXY8r7hnjJjt0tQMoxcgiTWQ0s/z9IiIQWNs3/bgXo12ioCgH8n23wgBlvOpb0qzI3CQZkt1tIn929IrQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=nFkYMNZ/YSdMjIjhyT2BLIGgyk/+pe/n0+TIrOCbGnw=;
 b=dWUqfBegTH1Pmxrns1UUxQnJQYXDvFMhvxQyz1qXY3CDMa1fgzt1yK98MugOZ+FeBLIqlPDq2s6LfdJcKCm6vJwQ5F+U1vouTw6HCsBCRsvi6iFbjOKDVMwBg5vIXMJaiQQIYucCIF9QsPk3acl+Gw0yEIS9LA1G/ckbWDCsh5sPwLqWHNEXqAeguc3253RKi5utUt86T70hS4m1h2VReuw0/F4hiVjaQPkZfPcH7yf31qp10qL3EEN3rlkL4Yl8PYztuoCPNYXfIs8JCiA4ZIgmMIxNHIOn+dVD5gDMoYFA/hLJzN6sYyr9UletxZ4PwZofe8HYk2vCEq2STAl0yQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=nFkYMNZ/YSdMjIjhyT2BLIGgyk/+pe/n0+TIrOCbGnw=;
 b=rBMwZrAyw/RiXMDkWz+4L0lEW4IvPoG2jEgCFYzHh+e+jbksxL6rsUqk+ospORvrACCe6O0bl7v6A3sReEjZbAInV8Rh5PBRgl5MAGO+RsloM40rGpTczZnZ76r2U1w0bPrlPylhKHQNegLZMLMq5BKt8gqUJq0vh6uYdRAj3BxxriflVeR89PJL+hhIARSmfqMlz1ZGkTkg/PzT+bgBJW7amXnU5P3TsQlj2X49BkM3cScbCUmzKe5q86/doCZLLAC+/muTR+flxgvlKQAxcBT687WMuMzgM7NkCHLwTiqfF+BltbreJVkTQ1RcoWPbiYg1dsVSWg3Fsh4P9canRQ==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: [PATCH v8 10/13] vpci/header: reset the command register when adding
 devices
Thread-Topic: [PATCH v8 10/13] vpci/header: reset the command register when
 adding devices
Thread-Index: AQHZuqGsniCLpx4fUkKP62aGMajP0g==
Date: Thu, 20 Jul 2023 00:32:33 +0000
Message-ID: <20230720003205.1828537-11-volodymyr_babchuk@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
In-Reply-To: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-mailer: git-send-email 2.41.0
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS8PR03MB7783:EE_
x-ms-office365-filtering-correlation-id: 8d9b9ea6-8c06-4c54-993f-08db88b8d09e
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 3nzE4mzoivnSuO+5z+hvlH4XcbbJTSxzQcGi/0oBuZE/ZtX0uiQzB80I6ojQxM2/T0zfufWs3qYBsURI86j4FFaT7T/8gyI9I0Lv9fyUv1PabAeHLbXgzohJI7CU/lzKcOTlfsBL6Yi7VCLMJCA4rJOcZCSCAfO4Yj/Knzbkz2IZv25Dymt3hLvCM2O+Le8pC3UrBMVwqClKK3NAPSnEsiNdL8s5BojczF0VlzNVM+lVacKDvyIWcaQTSWUhTDyL98RZdzFT0/UMpE8GTsDCCg6jow9YLcStFKln/9ros41ilo59EfpDy0ud2Y55rprdHMBkO8Wn3FzgFbooQjoGL92r8NKm/Szwi411xIRekasZ+lV9dZ8EiOkRd8mje2tRHek83ORsEFP0tvmThfL1HTIcYXlbaMneZj8U/1YgVMJ6F+T8884RM7sVaVkgifgyniQQudaGOV4TumB7HejKkIAbZXtc/WBJElpz5muDTd8F2fJUCKMmgCOKmAwpv/geTym0B00ZE8gwF/Bsxuw9VQ917u2ma5S1OPvOVBqmy80J9mfWKgc9oB2O05VApMSG2XATOx+EErszbU2ziT6BuctYZo1v5XSWohZdB9GnPiMALqBO9vgx9lVKVajVAuoX
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(346002)(366004)(396003)(376002)(451199021)(55236004)(26005)(1076003)(6506007)(41300700001)(316002)(83380400001)(2616005)(107886003)(186003)(6512007)(6486002)(122000001)(478600001)(66946007)(71200400001)(4326008)(64756008)(38070700005)(66556008)(76116006)(66476007)(91956017)(6916009)(38100700002)(86362001)(5660300002)(66446008)(8936002)(8676002)(36756003)(2906002);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?iso-8859-1?Q?ewHhk/zGIZ08Be8V9upuaLYFTiZDW2rx2zmulvCSzHmVwP1n5RLGZG7eNo?=
 =?iso-8859-1?Q?irKnXRA6SvJyBYpdXaBk+awdR/Xb9dmAIdYk4X0+cpg4rXhhb6qF0c44jn?=
 =?iso-8859-1?Q?FqpAUl0QlAA5uG1CelZUTwj4RGjXgVNeePaPhc4NZJU5xroUSOFAdq93ht?=
 =?iso-8859-1?Q?ZFhVMHkSCpSuBQHivInP1YAndm3BwrnaS6/hREsuzxv7WT9aSq7apqnVuV?=
 =?iso-8859-1?Q?/hyTIsttMXNW+/zzKR7egbaHmOVQn+Kxyzf5NJ8PdlWPznGbIkLUkLHhGA?=
 =?iso-8859-1?Q?WPgn/GqwBFr4p1BsRc7zwjeZHKqJLqHV2jJhNIUhYhcd8/42Ef/UnvUA9o?=
 =?iso-8859-1?Q?oF5cTitk7d/EETxtykqjd7rdCwZXL4VywHHVEmpYa8bKNTKxUvuxNAlhtX?=
 =?iso-8859-1?Q?IoQ8zl1MTAxRFZmuecBEIVg3rc39j/yRd3rQPM62Fgs0rXCcYI9FfQgkOT?=
 =?iso-8859-1?Q?TBTItiPL2jf6CVXk4uAFVrH5dqL/Q6cZ3nnuTB97e+ZHT0kXH1p/rs7xK5?=
 =?iso-8859-1?Q?uKZWQNMbVMvllwoLz44jpu09jF2uWxcV6NLlX+ZiH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
 =?iso-8859-1?Q?gCn58sAlfElPtC3yerquTVSdnHLuP/GvnlxAk0A2l9drYObVW4O54EgNdZ?=
 =?iso-8859-1?Q?xTNZjAkmZ4kccyRZkvn8izsZVsSwgR7KjzQkHDj2z8sN0efXarcvWEFTLm?=
 =?iso-8859-1?Q?pjit8foO5zfYqMh1iNBvGIg/dY7qRWi/WiotuF8/mpckMIldGzN6rhR2Db?=
 =?iso-8859-1?Q?0fYrdrvyXyMj21b1Gjct9WpdEY7qJ+o43nlF6lwMD50c1WGLV5I64S6g?=
 =?iso-8859-1?Q?=3D=3D?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8d9b9ea6-8c06-4c54-993f-08db88b8d09e
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 00:32:33.7654
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: wfDbTiZneEZiF7NSFGM1VA+CihzfriT78UIupWekvD1JyjNHFjuRqUOSOD6nO2R3WjDRzYmSR3EplkVheqrOqrRIVmT68tnBoHboBBmabS4=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7783
X-Proofpoint-ORIG-GUID: lMPdmvqFV_0bNMCojSfKJrzaUh83neHB
X-Proofpoint-GUID: lMPdmvqFV_0bNMCojSfKJrzaUh83neHB
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-19_16,2023-07-19_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0
 malwarescore=0 mlxlogscore=999 suspectscore=0 phishscore=0 mlxscore=0
 spamscore=0 bulkscore=0 clxscore=1015 impostorscore=0 adultscore=0
 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307200002

From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

Reset the command register when assigning a PCI device to a guest:
according to the PCI spec the PCI_COMMAND register is typically all 0's
after reset, but this might not be true for the guest as it needs
to respect host's settings.
For that reason, do not write 0 to the PCI_COMMAND register directly,
but go through the corresponding emulation layer (cmd_write), which
will take care about the actual bits written.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
---
Since v6:
- use cmd_write directly without introducing emulate_cmd_reg
- update commit message with more description on all 0's in PCI_COMMAND
Since v5:
- updated commit message
Since v1:
 - do not write 0 to the command register, but respect host settings.
---
 xen/drivers/vpci/header.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index ae05d242a5..44a9940fb9 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -749,6 +749,10 @@ static int cf_check init_bars(struct pci_dev *pdev)
      */
     ASSERT(header->guest_cmd =3D=3D 0);
=20
+    /* Reset the command register for guests. */
+    if ( !is_hwdom )
+        cmd_write(pdev, PCI_COMMAND, 0, header);
+
     /* Setup a handler for the command register. */
     rc =3D vpci_add_register(pdev->vpci, cmd_read, cmd_write, PCI_COMMAND,
                            2, header);
--=20
2.41.0


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:32:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:32:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566264.884925 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHbA-0003j7-Af; Thu, 20 Jul 2023 00:32:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566264.884925; Thu, 20 Jul 2023 00:32:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHb9-0003gc-Th; Thu, 20 Jul 2023 00:32:51 +0000
Received: by outflank-mailman (input) for mailman id 566264;
 Thu, 20 Jul 2023 00:32:47 +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
 <SRS0=5z78=DG=epam.com=prvs=156527e6f7=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qMHb5-0001JN-1B
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:32:47 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f145304a-2694-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 02:32:45 +0200 (CEST)
Received: from pps.filterd (m0174678.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36JMeiBB017190
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 00:32:43 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2057.outbound.protection.outlook.com [104.47.13.57])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rxgyx9k43-9
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 00:32:43 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS8PR03MB7783.eurprd03.prod.outlook.com (2603:10a6:20b:407::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 00:32:36 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6588.035; Thu, 20 Jul 2023
 00:32:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f145304a-2694-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=EbmXx/22LKfQRQwLVu7oAp+Y09LuzEaKSN1INqGdI2J44hndpKNfevWbKi3DuHAyyQkXeBGvpJpY4RFOhEiEk55p3yVgwvUJZmeToiIrooS9HVYHQQIKcwiLbmZyclS4ihQgo22PAv3DbpNSajymtQvPEkHVzl7MnIyPafKzuiNEAzIV2/2+NxHUhem1AQfllvSVxfMLORxXsRiQMBqeF9ATu+ywKVJ//t383zISHbBIGshlxc3zlxuW0I+hIeHqzJfL+jbuCRBP8x2R6wZxL/OZKolihWYXmZLev2RwZJpEW8v2wvXdl51KUweKpLou3/Dvt0TShb6Uhetl9MvizA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yKI7dy86L8X5wiqLrmIlzaIxxL726p8ahnVAZh89ZZg=;
 b=WRll1E6h0KeiUgyUnJmi0g8d2h+oEznsETceUb6RfVNZjRrQQxKdXO/7z2PTfX7BxSLo3YZC48vPq5tKyeox5BIoiCuiAm3zSQnh1VDsxSl6BHhb5bmtK48Fx4dMAtmrTpP4dln1zUgXaCm9oysT9HF8lsLSwqYkCZBc3F/3KMj+AwpaR/C7seM1JmKDs0CwpT2R7tacW1PuWICA6L1g2IBTSFFHn5Dy5NykmAMGV9beiADuxwsr2IRdIV5EyLCXYVEJ13OpJXdX0e9yiuGbZMtp8HG0yi0B7yaAF85b2X9Qfxtc05cs4ua8t5meVdvEWCkTrEhbXJmH7gOxk1ciUw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yKI7dy86L8X5wiqLrmIlzaIxxL726p8ahnVAZh89ZZg=;
 b=P0D1qmX0OevASwK/CWkJ+A2BOFfgJpF6nIO5lrhNFxUdy3k0xoLilE+33Fe13qcP8IJA66dUktDFkd8enhonXJGWr0GzbgyzU/PZrMNSZcNkorGOo0nkgVAoLCEcBHxmweATXAj9oa8fOX+Uib1HgQdQ5hmAbnFyBerJzos6PsZPhB923WMTJyA0yWG3l8kO3tvX7Yo2uu+YRaQ2QIQQ1aGH5EVnQwxGL0LSJ181mbQmlFdRPCaXpZ48nvzvCUp1rahivn9cOvBychIamG4hLDTx2wCC0ZxqdWg6pJD7GDMOLQYetyjZY+gqx/CPA9hP4pC/dgDAPIosxuk4U3QP0A==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: [PATCH v8 11/13] vpci: add initial support for virtual PCI bus
 topology
Thread-Topic: [PATCH v8 11/13] vpci: add initial support for virtual PCI bus
 topology
Thread-Index: AQHZuqGtdYewPbeaYUqE4k9SPFwhog==
Date: Thu, 20 Jul 2023 00:32:33 +0000
Message-ID: <20230720003205.1828537-12-volodymyr_babchuk@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
In-Reply-To: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-mailer: git-send-email 2.41.0
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS8PR03MB7783:EE_
x-ms-office365-filtering-correlation-id: 40e488b3-4a91-452a-6e5e-08db88b8d0d5
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 6PGJdDLYhXwsyvAPjswMBSvoufFZdqvQxN87xdbKiF+H5LDXpZbdP5fY8GoTtRLUNzDtbPLS1DCUz+BnAXeEjGsFhmm3xzYtO7IaqZ5cfeQYTZx3I9UroLTLwwPBgz2l9IV6P5tXXDUWN7FTRE0BvPYCWlER22Xs4RBdUmCjI/ubivr8ioEd+AN04giOXfEojChV9Z1VvumOQokyTAi3vh7eZfwxYni9ltpimeXM5tBQ9o0gPhw578Ewf+4VqSRNsEQ5j9dToaM1XYhx9EoUmmpIiMB9vzBtw2XXjeAcePCVoahs6LEXlTGp54CucpRO8k8LE0vUbjpMua0ItaqmVPvMszCLImpJh12pvSuJBFig601Pxfu6/EI1/ob3eYxYU/mj1Fo46ckbZgzLZuiAEGSgbqOo8RWsF4fY5Ss7Zh99K5tGW1cjb5uqpNrlDQN4NwGlMQj6apGtJj3eTWCT4q/v9G3a3C003taXWpZx0wrF5COKFvJrIiiN1rQzHbqdixEA345GiI1XGTYheWjPm0IZuVO9yKbIrX23pkEhVrkeoQh4E95PCp8vl1qdphKeeukQrXAfxkrNnZgb+tHL9lfOiEUEuUmNPGGFkCAbk9Q=
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(346002)(366004)(396003)(376002)(451199021)(55236004)(26005)(1076003)(6506007)(41300700001)(316002)(83380400001)(2616005)(107886003)(186003)(6512007)(6486002)(122000001)(478600001)(66946007)(6666004)(71200400001)(4326008)(64756008)(38070700005)(66556008)(76116006)(66476007)(91956017)(6916009)(38100700002)(86362001)(5660300002)(66446008)(8936002)(8676002)(36756003)(2906002);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?iso-8859-1?Q?36oUKNGtNs106p3sGC1Mt3qchr1vTDTf914cJKzkCaXH3M8CoDnK2k/yx3?=
 =?iso-8859-1?Q?eIQW+41w8IVJ45wQXB9ANB6MYV4t29rU18cz36BKytQR5G9SjKz+5BgHpX?=
 =?iso-8859-1?Q?3ZeyT2JPq4JkZfw6EyfZdVpDZnacJXhY5xcCZVBt9VjP8wrlL8FyDk0Ycw?=
 =?iso-8859-1?Q?cRL5vqcTOe/vM9TNLzLa981GdKd7K21twFV4ywFprFKMNMZajMqfvXOfvh?=
 =?iso-8859-1?Q?4xyR2p0msktZVnYJTrg83f6f9Z+IUqvyrTB0/hIhRxDVZ1p46VdIuFI/Lg?=
 =?iso-8859-1?Q?awwg0ADh8fspP6leo74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QmffLWrrPNus?=
 =?iso-8859-1?Q?Yd6TgpN2/lYuHNJPirFjN1tDKv3p4neNTSCMTSY4ELP1IFNQnNVPXDOq9N?=
 =?iso-8859-1?Q?IA3LneR7H2lq4RXAG9QpVTN9bIqFbdEa0whHVkXEugSYmz8N/5H32GuZDv?=
 =?iso-8859-1?Q?cxOE5Sk9MflUbK4y8Km2JgYs8VuVtWxV/rz08RuXa/Jf42jL2SZ5cWdY8s?=
 =?iso-8859-1?Q?DagDvGuK9rpWw9bHFqHQNyv0Wg9pCKv2fgGmw1Hv3iE0NekMdDd0XLjhWy?=
 =?iso-8859-1?Q?BZpRaulHSssEPHwkfp2KweMt24kXXHBChKZCOq/IoetmFv+3z9FlbbeoH/?=
 =?iso-8859-1?Q?AZvn0vJsjL9RBHPjMsVghWjiOAKwluC7krf5LmOBFLlv8MQ4KcyBLo2GRV?=
 =?iso-8859-1?Q?l46q6301n22XkIqLuXp/Nw01SZx2fwGT41t5FuXWbpzmkbiLyKwJbJAq+V?=
 =?iso-8859-1?Q?KZh4FgqlcpdBZBRbkPU6AjPHlavlRwlqAB7fJzM+t/SbUYQMmDZZP/mA?=
 =?iso-8859-1?Q?=3D=3D?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 40e488b3-4a91-452a-6e5e-08db88b8d0d5
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 00:32:34.0150
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: k84+8ahfRZfxLDIqeXyM/qpkacYmv3X1KEXBSPF3Lj8xewp0T4Uc/22arBwdoywXsURyeQsYFBDdpPIl3aI0NbjIFv/0HB4nAACfIZtVxH4=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7783
X-Proofpoint-ORIG-GUID: q9JJ6ULmBvRj2LdFzvGmWJYkebN7q3t-
X-Proofpoint-GUID: q9JJ6ULmBvRj2LdFzvGmWJYkebN7q3t-
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-19_16,2023-07-19_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0
 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 clxscore=1015
 suspectscore=0 phishscore=0 mlxlogscore=999 malwarescore=0
 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307200002

From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

Assign SBDF to the PCI devices being passed through with bus 0.
The resulting topology is where PCIe devices reside on the bus 0 of the
root complex itself (embedded endpoints).
This implementation is limited to 32 devices which are allowed on
a single PCI bus.

Please note, that at the moment only function 0 of a multifunction
device can be passed through.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
---
Since v8:
- Added write lock in add_virtual_device
Since v6:
- re-work wrt new locking scheme
- OT: add ASSERT(pcidevs_write_locked()); to add_virtual_device()
Since v5:
- s/vpci_add_virtual_device/add_virtual_device and make it static
- call add_virtual_device from vpci_assign_device and do not use
  REGISTER_VPCI_INIT machinery
- add pcidevs_locked ASSERT
- use DECLARE_BITMAP for vpci_dev_assigned_map
Since v4:
- moved and re-worked guest sbdf initializers
- s/set_bit/__set_bit
- s/clear_bit/__clear_bit
- minor comment fix s/Virtual/Guest/
- added VPCI_MAX_VIRT_DEV constant (PCI_SLOT(~0) + 1) which will be used
  later for counting the number of MMIO handlers required for a guest
  (Julien)
Since v3:
 - make use of VPCI_INIT
 - moved all new code to vpci.c which belongs to it
 - changed open-coded 31 to PCI_SLOT(~0)
 - added comments and code to reject multifunction devices with
   functions other than 0
 - updated comment about vpci_dev_next and made it unsigned int
 - implement roll back in case of error while assigning/deassigning devices
 - s/dom%pd/%pd
Since v2:
 - remove casts that are (a) malformed and (b) unnecessary
 - add new line for better readability
 - remove CONFIG_HAS_VPCI_GUEST_SUPPORT ifdef's as the relevant vPCI
    functions are now completely gated with this config
 - gate common code with CONFIG_HAS_VPCI_GUEST_SUPPORT
New in v2
---
 xen/drivers/vpci/vpci.c | 72 ++++++++++++++++++++++++++++++++++++++++-
 xen/include/xen/sched.h |  8 +++++
 xen/include/xen/vpci.h  | 11 +++++++
 3 files changed, 90 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index ca3505ecb7..baaafe4a2a 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -46,6 +46,16 @@ void vpci_remove_device(struct pci_dev *pdev)
         return;
=20
     spin_lock(&pdev->vpci->lock);
+
+#ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
+    if ( pdev->vpci->guest_sbdf.sbdf !=3D ~0 )
+    {
+        __clear_bit(pdev->vpci->guest_sbdf.dev,
+                    &pdev->domain->vpci_dev_assigned_map);
+        pdev->vpci->guest_sbdf.sbdf =3D ~0;
+    }
+#endif
+
     while ( !list_empty(&pdev->vpci->handlers) )
     {
         struct vpci_register *r =3D list_first_entry(&pdev->vpci->handlers=
,
@@ -101,6 +111,10 @@ int vpci_add_handlers(struct pci_dev *pdev)
     INIT_LIST_HEAD(&pdev->vpci->handlers);
     spin_lock_init(&pdev->vpci->lock);
=20
+#ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
+    pdev->vpci->guest_sbdf.sbdf =3D ~0;
+#endif
+
     for ( i =3D 0; i < NUM_VPCI_INIT; i++ )
     {
         rc =3D __start_vpci_array[i](pdev);
@@ -115,6 +129,54 @@ int vpci_add_handlers(struct pci_dev *pdev)
 }
=20
 #ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
+static int add_virtual_device(struct pci_dev *pdev)
+{
+    struct domain *d =3D pdev->domain;
+    pci_sbdf_t sbdf =3D { 0 };
+    unsigned long new_dev_number;
+
+    if ( is_hardware_domain(d) )
+        return 0;
+
+    ASSERT(pcidevs_locked());
+
+    /*
+     * Each PCI bus supports 32 devices/slots at max or up to 256 when
+     * there are multi-function ones which are not yet supported.
+     */
+    if ( pdev->info.is_extfn )
+    {
+        gdprintk(XENLOG_ERR, "%pp: only function 0 passthrough supported\n=
",
+                 &pdev->sbdf);
+        return -EOPNOTSUPP;
+    }
+
+    write_lock(&pdev->domain->pci_lock);
+    new_dev_number =3D find_first_zero_bit(d->vpci_dev_assigned_map,
+                                         VPCI_MAX_VIRT_DEV);
+    if ( new_dev_number >=3D VPCI_MAX_VIRT_DEV )
+    {
+        write_unlock(&pdev->domain->pci_lock);
+        return -ENOSPC;
+    }
+
+    __set_bit(new_dev_number, &d->vpci_dev_assigned_map);
+
+    /*
+     * Both segment and bus number are 0:
+     *  - we emulate a single host bridge for the guest, e.g. segment 0
+     *  - with bus 0 the virtual devices are seen as embedded
+     *    endpoints behind the root complex
+     *
+     * TODO: add support for multi-function devices.
+     */
+    sbdf.devfn =3D PCI_DEVFN(new_dev_number, 0);
+    pdev->vpci->guest_sbdf =3D sbdf;
+    write_unlock(&pdev->domain->pci_lock);
+
+    return 0;
+}
+
 /* Notify vPCI that device is assigned to guest. */
 int vpci_assign_device(struct pci_dev *pdev)
 {
@@ -125,8 +187,16 @@ int vpci_assign_device(struct pci_dev *pdev)
=20
     rc =3D vpci_add_handlers(pdev);
     if ( rc )
-        vpci_deassign_device(pdev);
+        goto fail;
+
+    rc =3D add_virtual_device(pdev);
+    if ( rc )
+        goto fail;
+
+    return 0;
=20
+ fail:
+    vpci_deassign_device(pdev);
     return rc;
 }
 #endif /* CONFIG_HAS_VPCI_GUEST_SUPPORT */
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 80dd150bbf..478bd21f3e 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -461,6 +461,14 @@ struct domain
 #ifdef CONFIG_HAS_PCI
     struct list_head pdev_list;
     rwlock_t pci_lock;
+#ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
+    /*
+     * The bitmap which shows which device numbers are already used by the
+     * virtual PCI bus topology and is used to assign a unique SBDF to the
+     * next passed through virtual PCI device.
+     */
+    DECLARE_BITMAP(vpci_dev_assigned_map, VPCI_MAX_VIRT_DEV);
+#endif
 #endif
=20
 #ifdef CONFIG_HAS_PASSTHROUGH
diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
index 6099d2141d..c55c45f7a1 100644
--- a/xen/include/xen/vpci.h
+++ b/xen/include/xen/vpci.h
@@ -21,6 +21,13 @@ typedef int vpci_register_init_t(struct pci_dev *dev);
=20
 #define VPCI_ECAM_BDF(addr)     (((addr) & 0x0ffff000) >> 12)
=20
+/*
+ * Maximum number of devices supported by the virtual bus topology:
+ * each PCI bus supports 32 devices/slots at max or up to 256 when
+ * there are multi-function ones which are not yet supported.
+ */
+#define VPCI_MAX_VIRT_DEV       (PCI_SLOT(~0) + 1)
+
 #define REGISTER_VPCI_INIT(x, p)                \
   static vpci_register_init_t *const x##_entry  \
                __used_section(".data.vpci." p) =3D x
@@ -155,6 +162,10 @@ struct vpci {
             struct vpci_arch_msix_entry arch;
         } entries[];
     } *msix;
+#ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
+    /* Guest SBDF of the device. */
+    pci_sbdf_t guest_sbdf;
+#endif
 #endif
 };
=20
--=20
2.41.0


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:32:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:32:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566265.884935 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHbB-000430-Aa; Thu, 20 Jul 2023 00:32:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566265.884935; Thu, 20 Jul 2023 00:32:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHbB-00040Y-0P; Thu, 20 Jul 2023 00:32:53 +0000
Received: by outflank-mailman (input) for mailman id 566265;
 Thu, 20 Jul 2023 00:32:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=5z78=DG=epam.com=prvs=156527e6f7=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qMHb5-0001JI-Nu
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:32:47 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f17084d7-2694-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 02:32:45 +0200 (CEST)
Received: from pps.filterd (m0174676.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36JJCjt4031890
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 00:32:43 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2059.outbound.protection.outlook.com [104.47.13.59])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rxgcw1sme-4
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 00:32:43 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS8PR03MB7783.eurprd03.prod.outlook.com (2603:10a6:20b:407::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 00:32:36 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6588.035; Thu, 20 Jul 2023
 00:32:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f17084d7-2694-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Hq9NQ4T9GFEyCjOepuzmQUYB2AOapblkNLljB0ubBBmeeNcth9BzZqzzS8CqFlDtiuV+aoLebFeawm/kMNPPCJ6nxv2kFP1PiPegwGu9MO7GPL5FvBhkS2uQXE8j/O5UAe+7XuNwUQFmsXcQwc67WM+cLXs6QnF1ZpxwhpOfzE/A0UlkUxKI1CnUC/FER0UG9rCjp3zeEis+et37Lny+tFmZo/hrIw46kj2uUc/GCD7rljEO9Oqf94rXMOm/fv1S8vXPBCKzi2L2EdUr3JaTUM5W0DIv6oVvlGNfNnhnBlVH61i+5FrG480AeQ7J07i8XfT+qSFu10sEIzUo33NoFA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=oJF4BGYeq1qshKG9OZht+I75cGYA32L43+SEUEeNDk8=;
 b=MKLqHiqVUweJuEplcHL7CtXNA4Cu7CpARupbUdk3AhVrg30wQqi4mFPhmIwqtYC/66qEY6leSZAIiASxtR3TNgzE5yOyYSFXHuipk4dZkKlCTFVt0j8ykMDUV21yCfXVQYgwVvL6QCtYht50ctTtuocPy5xlwQr1SKRE/o01/UmG7kHEJ8P7QB1PhEBuhO35sCFFR3LO5rzwjaFK6PEmsB5KJCc3XHk63ssmillaFTs0LwF7vkyriSxaZZmHLtyEQRhl/tQrEW6Zz5XRT6ZMhC6NKTFiqaR1Dyo13iaQFlnf+U1YMRIRCqBJc2vM5PLCfwzfuh3fhE2FK7LGKtFk9g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=oJF4BGYeq1qshKG9OZht+I75cGYA32L43+SEUEeNDk8=;
 b=cAqDNUWcf9qr1dkrr+F5JTg8jqEPmB2+AvXdzepu66WHSTHzBzV6xNi116bDrkvw/QKoD38JGiFEdmiLwvIXXxMghcopUMEDE57zPfX/wY/Zy7+Qp2f+g5xFVdwL5uQY6p4oWfsDlAXifJ5tm52cpysSXQhMhjgt3jyhSCdqT3d+jzii78/KHOezI+Ifc4UML3wxTbPGKdWTVVeedjtRj70JrLgyl1IrVQ6bprYMqC/OZbcLHV3hkMhTzqr0+5YnsKuxx0KgS/uSNMup/XOSgTGJcglRcGX514Wg/EhemyLhav0w3WAlHkJba6mKaDfRJeIcUb93yWh7PG15CdYhsQ==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: [PATCH v8 12/13] xen/arm: translate virtual PCI bus topology for
 guests
Thread-Topic: [PATCH v8 12/13] xen/arm: translate virtual PCI bus topology for
 guests
Thread-Index: AQHZuqGt3D08el+/O0KSh2o4KcGPqA==
Date: Thu, 20 Jul 2023 00:32:34 +0000
Message-ID: <20230720003205.1828537-13-volodymyr_babchuk@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
In-Reply-To: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-mailer: git-send-email 2.41.0
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS8PR03MB7783:EE_
x-ms-office365-filtering-correlation-id: 77a64a71-2bb4-4a14-4390-08db88b8d10c
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 Oqgb7QyutVeqAbEUZpCtx0QVejZDeJmyBF1IbYrUlDQCIOWpAMflv84pXv4rHFStmWV+Wh/GXDhxHOtD9wjDBDtVU99/FP/M1ZTv+zIvHGJbvdgnXDuohaHg6pkPAKmEK3qUo1a9wW/Kpp0T4GLmDtix2CP6bO7siWZNywROmANIOVqYaB+EbIAMSwGYV31VfcxI7lh/GovBgmmnhiRSKQemcRDsMt+KL3PpjXu2DDW4Bulrm5vEHTdOVhQuvGZxeZ/xTm+UO9L97kN4IiJKiY3bhnH2bon67G+Xp7/EwxhwqsoYTpEl2exA4DIbjnMFQYHNkByBc8qudCcgIGPXbvDGfWMk4asHAl/eQFEbq6kItVGztcAbohN+u5eDlk1rTrFyDp0EVU8vpz7uDsGxV0JbzcA5EnoTTIDf3JOj9lRJS83Yb9nBJ8nvh45ayJ43yKCy5ajxaSFo0OoOQ52kiMcOMfQfujfHfqh8hvqLU4VJcwVl0wcf7l7Ph4PEvWuRFQRPHhaW5uVDpC6XM5C90xzXVm04V/9ntOSf1ZeXMaBGt8eSYJhhwUjF04lNInZ/JLCeLZP/u9o4eJ2KlIkmE4Uu5EFOdrNCxYKitEJ7I6RRY49UBvbQQ86bM3y0oKZt
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(346002)(366004)(396003)(376002)(451199021)(55236004)(26005)(1076003)(6506007)(41300700001)(316002)(83380400001)(2616005)(107886003)(186003)(6512007)(6486002)(122000001)(478600001)(66946007)(71200400001)(4326008)(64756008)(38070700005)(66556008)(76116006)(66476007)(91956017)(6916009)(38100700002)(86362001)(5660300002)(66446008)(8936002)(8676002)(36756003)(2906002);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?iso-8859-1?Q?XUkEb/Bx0A+PVp0RtUNVkn53Sgv323b/A8GWV1gvBOLywzIwRhmA094H49?=
 =?iso-8859-1?Q?dEJD+jTw8tjpe6gSHKxdCfjtqblm+fBGR6w7BsCfsuczlXjHUAR5MVpLCH?=
 =?iso-8859-1?Q?SzzFK3MOUwcOo/HUi02izrS3ILUSi7OtkYmE44ZOGGzBwn32unb6LrqrQA?=
 =?iso-8859-1?Q?IR5UlP+YaYGIWI311kvmnAuSxu+faVQsMF42UIe5wf9pXxgc1j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QhKvcmYQqKakfaY6y3CF4IMAz1cnUbchhqGLzvSAltE+1J5bunSOijkY?=
 =?iso-8859-1?Q?aRB6HLgNzDbPk7CidDwPRIQUZHEhlB3nqs8PRy+dFM+0KgsleUx5dsAxJy?=
 =?iso-8859-1?Q?yKwMrfEE5LhlCp+ryi4TDjz/a+EjkL/tWKTZZKn5T3Vi5ZBgNuUfHalX7p?=
 =?iso-8859-1?Q?jF9yM28exOGPsfLaLnIUu9UH5NLWtjb/2pxyyg+l6Pr8GBbJ8vdccvexry?=
 =?iso-8859-1?Q?VPeVqj1wx9fGev5hwdca1DIzUq+YyWCqiBR/lYvqJYnXhaJpZLzymULjz4?=
 =?iso-8859-1?Q?Ki8OiJkozSRgP7gokHJQd45zQJP7psx8W2zuyduWaibpCEFBsSP4hhd3vd?=
 =?iso-8859-1?Q?C6/YPkAib2hm2c7bwiJ8iBaglORC8L1hy1o9evmgX/DEeqWGVo/VQD2OG1?=
 =?iso-8859-1?Q?iTIbJ/4pbtSlS78Y+bVPEOYTFILzEtsk7ZMOo9i53S538J+zYZqk1MF2vN?=
 =?iso-8859-1?Q?AA/wHVoGxjqC7uuKW9Y7SVyn2P7klCXB0wLDbfQuWqtTOy/s1EDjbKow+5?=
 =?iso-8859-1?Q?Xx98kMzNTJFFiYbpDHkbcZ0Pm4ZRot6LtY9NejlZehxockna1wkJop3w?=
 =?iso-8859-1?Q?=3D=3D?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 77a64a71-2bb4-4a14-4390-08db88b8d10c
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 00:32:34.8480
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: lSMPc/r6SKKbIIxYjoKQ3VF4smbwheeA3VKxw9l5/4ep8qOJhZ7ShyhEpDEYYq7KimGzXYIrYhPcj7JBK/b8DEXDuj44/MoQUwhOnL+Oz38=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7783
X-Proofpoint-ORIG-GUID: 99B5JOBEbaenm1Hfi0uSRfKSpYSUhGpZ
X-Proofpoint-GUID: 99B5JOBEbaenm1Hfi0uSRfKSpYSUhGpZ
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-19_16,2023-07-19_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0
 malwarescore=0 mlxlogscore=999 suspectscore=0 phishscore=0 mlxscore=0
 spamscore=0 bulkscore=0 clxscore=1015 impostorscore=0 adultscore=0
 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307200002

From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

There are three  originators for the PCI configuration space access:
1. The domain that owns physical host bridge: MMIO handlers are
there so we can update vPCI register handlers with the values
written by the hardware domain, e.g. physical view of the registers
vs guest's view on the configuration space.
2. Guest access to the passed through PCI devices: we need to properly
map virtual bus topology to the physical one, e.g. pass the configuration
space access to the corresponding physical devices.
3. Emulated host PCI bridge access. It doesn't exist in the physical
topology, e.g. it can't be mapped to some physical host bridge.
So, all access to the host bridge itself needs to be trapped and
emulated.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
---
Since v8:
- locks moved out of vpci_translate_virtual_device()
Since v6:
- add pcidevs locking to vpci_translate_virtual_device
- update wrt to the new locking scheme
Since v5:
- add vpci_translate_virtual_device for #ifndef CONFIG_HAS_VPCI_GUEST_SUPPO=
RT
  case to simplify ifdefery
- add ASSERT(!is_hardware_domain(d)); to vpci_translate_virtual_device
- reset output register on failed virtual SBDF translation
Since v4:
- indentation fixes
- constify struct domain
- updated commit message
- updates to the new locking scheme (pdev->vpci_lock)
Since v3:
- revisit locking
- move code to vpci.c
Since v2:
 - pass struct domain instead of struct vcpu
 - constify arguments where possible
 - gate relevant code with CONFIG_HAS_VPCI_GUEST_SUPPORT
New in v2
---
 xen/arch/arm/vpci.c     | 47 +++++++++++++++++++++++++++++++++++++++--
 xen/drivers/vpci/vpci.c | 24 +++++++++++++++++++++
 xen/include/xen/vpci.h  |  7 ++++++
 3 files changed, 76 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/vpci.c b/xen/arch/arm/vpci.c
index 3bc4bb5508..66701465af 100644
--- a/xen/arch/arm/vpci.c
+++ b/xen/arch/arm/vpci.c
@@ -28,10 +28,33 @@ static int vpci_mmio_read(struct vcpu *v, mmio_info_t *=
info,
                           register_t *r, void *p)
 {
     struct pci_host_bridge *bridge =3D p;
-    pci_sbdf_t sbdf =3D vpci_sbdf_from_gpa(bridge, info->gpa);
+    pci_sbdf_t sbdf;
     /* data is needed to prevent a pointer cast on 32bit */
     unsigned long data;
=20
+    ASSERT(!bridge =3D=3D !is_hardware_domain(v->domain));
+
+    sbdf =3D vpci_sbdf_from_gpa(bridge, info->gpa);
+
+    /*
+     * For the passed through devices we need to map their virtual SBDF
+     * to the physical PCI device being passed through.
+     */
+    if ( !bridge )
+    {
+        bool translated;
+
+        read_lock(&v->domain->pci_lock);
+        translated =3D vpci_translate_virtual_device(v->domain, &sbdf);
+        read_unlock(&v->domain->pci_lock);
+
+        if ( !translated )
+        {
+            *r =3D ~0ul;
+            return 1;
+        }
+    }
+
     if ( vpci_ecam_read(sbdf, ECAM_REG_OFFSET(info->gpa),
                         1U << info->dabt.size, &data) )
     {
@@ -48,7 +71,27 @@ static int vpci_mmio_write(struct vcpu *v, mmio_info_t *=
info,
                            register_t r, void *p)
 {
     struct pci_host_bridge *bridge =3D p;
-    pci_sbdf_t sbdf =3D vpci_sbdf_from_gpa(bridge, info->gpa);
+    pci_sbdf_t sbdf;
+
+    ASSERT(!bridge =3D=3D !is_hardware_domain(v->domain));
+
+    sbdf =3D vpci_sbdf_from_gpa(bridge, info->gpa);
+
+    /*
+     * For the passed through devices we need to map their virtual SBDF
+     * to the physical PCI device being passed through.
+     */
+    if ( !bridge )
+    {
+        bool translated;
+
+        read_lock(&v->domain->pci_lock);
+        translated =3D vpci_translate_virtual_device(v->domain, &sbdf);
+        read_unlock(&v->domain->pci_lock);
+
+        if ( !translated )
+            return 1;
+    }
=20
     return vpci_ecam_write(sbdf, ECAM_REG_OFFSET(info->gpa),
                            1U << info->dabt.size, r);
diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index baaafe4a2a..2ce36e811d 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -177,6 +177,30 @@ static int add_virtual_device(struct pci_dev *pdev)
     return 0;
 }
=20
+/*
+ * Find the physical device which is mapped to the virtual device
+ * and translate virtual SBDF to the physical one.
+ * This must hold domain's pci_lock in read mode.
+ */
+bool vpci_translate_virtual_device(struct domain *d, pci_sbdf_t *sbdf)
+{
+    struct pci_dev *pdev;
+
+    ASSERT(!is_hardware_domain(d));
+
+    for_each_pdev( d, pdev )
+    {
+        if ( pdev->vpci && (pdev->vpci->guest_sbdf.sbdf =3D=3D sbdf->sbdf)=
 )
+        {
+            /* Replace guest SBDF with the physical one. */
+            *sbdf =3D pdev->sbdf;
+            return true;
+        }
+    }
+
+    return false;
+}
+
 /* Notify vPCI that device is assigned to guest. */
 int vpci_assign_device(struct pci_dev *pdev)
 {
diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
index c55c45f7a1..7d30fbdd28 100644
--- a/xen/include/xen/vpci.h
+++ b/xen/include/xen/vpci.h
@@ -286,6 +286,7 @@ static inline bool __must_check vpci_process_pending(st=
ruct vcpu *v)
 /* Notify vPCI that device is assigned/de-assigned to/from guest. */
 int vpci_assign_device(struct pci_dev *pdev);
 #define vpci_deassign_device vpci_remove_device
+bool vpci_translate_virtual_device(struct domain *d, pci_sbdf_t *sbdf);
 #else
 static inline int vpci_assign_device(struct pci_dev *pdev)
 {
@@ -295,6 +296,12 @@ static inline int vpci_assign_device(struct pci_dev *p=
dev)
 static inline void vpci_deassign_device(struct pci_dev *pdev)
 {
 };
+
+static inline bool vpci_translate_virtual_device(struct domain *d,
+                                                 pci_sbdf_t *sbdf)
+{
+    return false;
+}
 #endif
=20
 #endif
--=20
2.41.0


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:32:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:32:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566266.884958 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHbH-0005Eu-8f; Thu, 20 Jul 2023 00:32:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566266.884958; Thu, 20 Jul 2023 00:32:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHbH-0005E7-1d; Thu, 20 Jul 2023 00:32:59 +0000
Received: by outflank-mailman (input) for mailman id 566266;
 Thu, 20 Jul 2023 00:32:57 +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
 <SRS0=5z78=DG=epam.com=prvs=156527e6f7=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qMHbF-0001JN-7d
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:32:57 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f775df9f-2694-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 02:32:55 +0200 (CEST)
Received: from pps.filterd (m0174678.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36JMeiBC017190; Thu, 20 Jul 2023 00:32:44 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2057.outbound.protection.outlook.com [104.47.13.57])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rxgyx9k43-10
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 20 Jul 2023 00:32:44 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS8PR03MB7783.eurprd03.prod.outlook.com (2603:10a6:20b:407::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 00:32:37 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6588.035; Thu, 20 Jul 2023
 00:32:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f775df9f-2694-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=MuNNQsPzZyGbm3cQ4i6q7pkUtW05fdJNEW4n3hl5Q1Bz3DAtWbLTjHUXtfPm6yigIm0GrMDcDbyv0FFn/AZu6eHTRaso/eAReMLGAD7RcqfeoSs2VEwRKwdza5PP5S2pVCJkKnezPXLXzVV3jhTlWMdqflnZBG71g5fZYdHCq/7iY0rbXa9SVWVI83HwQdOTSuGELGqS7nmYaxCObSGJ3KM9wtrX3NDXaRQmZyeJ8s2tXQYTZpfE8AJHPpV1LzgsKoTbZiepLbO8mdjrI5p7Nlh15ELwZZD9Wy5dqg5StRneCh8bNFE+e21Mvz2MnI8mCryCTFcGQIMO6tfeRFCQGw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=zOeSMPEmX5pm3X2mdny5gRhNwdhBLZKMFqHNsWU7Urc=;
 b=Zy5UCkwd1PL+YvSbZoS9AprGbpEYwmnF5X48sWWe4KttoPrAcpp2v9UDDUqfOeF7B2O33Eygf/tmSRzWwBmywlOZ/1qJjPUPLcnIm1LtrCa6fEj24Ga8ddra4grxxAalhp0RzchLyxrJksbGOlt0nX8aecwRseCvPI8qiplH6Qg9LJIwieupzDAs9fQljEiDESmWOGFS6wGmukEimw2s9FsmFr81/WkpO+9QcwQUaEoRnE984F1oNitEHUziwXKGANBxhwhUY4GVNAUQAjIxuCnYao64IaKeJAsceaiy8mTbvbWougJahYrJbDMaPGSePywGPOGnWcsRgm3Xp04EKA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=zOeSMPEmX5pm3X2mdny5gRhNwdhBLZKMFqHNsWU7Urc=;
 b=izNF63YXVb0+slPPZDorbJg1hNAt0cHS2Cv5dBZxIXhuEjNmqJ4694OMETo0ixqmMc9+2MVtGPhgpUeQfk7H6VSkI2dzdsVBQlrj2SlZBOr+eQa02TWkxNGWBztZDae/mR88YZDp9HOZSaQYpcjXFr8/fP36x3oJJwpGHfu5YUdEwZsm1+3wHDMOAzujENz/SNTV6JTT2rqjUP1ahornRaRWjHcVJfLLv7DBZWCf8lcycKXhxKL7NkmgsA7/X/k43IaHHKsH6FJyLt7H085GHa+02+G72tkh2cu/kOqmEoBNFXkdNL1uzWI5mXrMRt18gIzSVZFU+c2fnc37AIo/fQ==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
        Julien Grall
	<jgrall@amazon.com>, Julien Grall <julien@xen.org>,
        Stefano Stabellini
	<sstabellini@kernel.org>
Subject: [PATCH v8 13/13] xen/arm: account IO handlers for emulated PCI MSI-X
Thread-Topic: [PATCH v8 13/13] xen/arm: account IO handlers for emulated PCI
 MSI-X
Thread-Index: AQHZuqGuy4TImO+CVUmVm6UGc30HEQ==
Date: Thu, 20 Jul 2023 00:32:35 +0000
Message-ID: <20230720003205.1828537-14-volodymyr_babchuk@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
In-Reply-To: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-mailer: git-send-email 2.41.0
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS8PR03MB7783:EE_
x-ms-office365-filtering-correlation-id: 6ac755eb-59f8-4879-2b37-08db88b8d156
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 oelM7Z1bEuOVBBZ3IYujx3sAcD7DroaJvScaCRnLkjNCsnB0uk2KRPuKFsHcRktevtdSdkEhp9SNUTZbwjRt9IZsbOOHRUkdnO/15J0bvm2AKRtkzlMsOiICScjUQpkFHDbCjWRw/BygXxttNCGbdbMvBLhR2c7G4sTRtS3WwjB0/B2Y/7ygQJC3VnGNCE+l2ZbiJX7Wjt6gffyyVOVmTiJcBC3mugvttRmmqWKuqrTEc3i9DuseRnpZdreqYIv21SETcqtgznjhrQJ/yJvilTJLHBVLoEUG3aUydlRjfLMZxgQTqw/K7ApS6YAkdvO7Z6UcGM1IMRWWVihEB+v1ESHZj2YG59fWFmKjYPDHgsoE1qXqC6m/Fc5gBCAlt8/4bNOJcH705Jt97DGmw5UQsFk3tWuTnj/Qty/OXdJyZ7Dc9S2ktZEaIchsZ9E/VIvXhcBoXB50HORsiBOODPQGeSS/FaPCHipSUMwS6WPwNqFuRDAoUpW9rUfRn1cZv7t6nd3DEcbfcZygYQv/EOe+N3MvIDE4P+wbB7+NJWt3zpfMqc8IDa41nRSk81tAkLTTSSDK/ij1Vhqkr09MP5peASV9Cn7sDNRMnSVpOafJiRPUjNrEQQT4u7qsRZBf792q
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(346002)(366004)(396003)(376002)(451199021)(55236004)(26005)(1076003)(6506007)(41300700001)(316002)(83380400001)(2616005)(186003)(6512007)(6486002)(66899021)(122000001)(478600001)(66946007)(54906003)(71200400001)(4326008)(64756008)(38070700005)(66556008)(76116006)(66476007)(91956017)(6916009)(38100700002)(86362001)(15650500001)(5660300002)(66446008)(8936002)(8676002)(36756003)(2906002);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?iso-8859-1?Q?t+zdmAPD7M+3QdUvGvlMfXmE6GDWI09QK8YTLmkWKKP99bQ9QdfMmSygN2?=
 =?iso-8859-1?Q?cCUT9Sd9/CWkwf1yVwpJdPUyBj4dFmwrQ+NZ1hVMdSZe04C0o4shwXmvUx?=
 =?iso-8859-1?Q?WRGR5slUbKMr8UpkKlWw51uJn84dAXDuH58OBWkSVO6YR66KddJLfGAlSJ?=
 =?iso-8859-1?Q?+fvopaf7eoDEh7P1rlP+E0nZDq0MWbaZzZ0Swik/qv93eP6Shc801/5ZP+?=
 =?iso-8859-1?Q?O+WP8Th1le8qiGPYHJt3o84FmZaEeI47rYfsSQu0hI7QOZSPhn5KkAKaJl?=
 =?iso-8859-1?Q?EcbChHgkDEK/sHIQkG1yUPmQQ+Wzdei6WXFuY3shTFezlkzZhJl+6VE7Sb?=
 =?iso-8859-1?Q?G29PTDwh5xAzChNW3C7DBdPB9MVuEPn95RSxnPKMoYlfR/m0+nu9xpqKfh?=
 =?iso-8859-1?Q?ppow95kQ39jpCI1/baGmSwvqf3EUrF0KQJCq8BluO6wAQWCh+jGIUwHi9P?=
 =?iso-8859-1?Q?dDl3AYJXKjfpFo98UNMAQP3h240QhGPJExLL30nzg9pRVdu6nC3WmYHYkz?=
 =?iso-8859-1?Q?Pxbatzsf7G1Y17W02Y9j6BeV6LWLVdhvEumr1H+PyxZsp/PpvxOold1jw/?=
 =?iso-8859-1?Q?gPOahBP093SuErXKA5GXhf92VGGH7SykdkSjnD9vbDFkcrTDIK4bFJIWUw?=
 =?iso-8859-1?Q?H+j13RWk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Ty9KZbW8mTNro2POYwNiyDw8T9TYIXiog2b?=
 =?iso-8859-1?Q?yZkk6Qz1lAbCPen65t2W/HA+5EL4K0izg58od+niESNmml39PvdDLt4CHN?=
 =?iso-8859-1?Q?1ns6gkkEy7AjbWHgV4iP69/qW8D8jX0ZwiFrjoiby0P11ElTAEy+IP8g?=
 =?iso-8859-1?Q?=3D=3D?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6ac755eb-59f8-4879-2b37-08db88b8d156
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 00:32:35.8123
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: aUbo/Bc74a1N2QfKguoHLKPITtpKvZDZiD5pvtJdbGXHOzLxfZnsuGGCzQiTiPXbP4rbYqwlHcOVqWtPO4xWGnwjs9Vs7WMp0918AaTT1pM=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7783
X-Proofpoint-ORIG-GUID: dy_s8m5gAloB9sJl1xY2va40dAXzmnBl
X-Proofpoint-GUID: dy_s8m5gAloB9sJl1xY2va40dAXzmnBl
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-19_16,2023-07-19_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0
 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 clxscore=1011
 suspectscore=0 phishscore=0 mlxlogscore=659 malwarescore=0
 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307200002

From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

At the moment, we always allocate an extra 16 slots for IO handlers
(see MAX_IO_HANDLER). So while adding IO trap handlers for the emulated
MSI-X registers we need to explicitly tell that we have additional IO
handlers, so those are accounted.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Acked-by: Julien Grall <jgrall@amazon.com>
---
Cc: Julien Grall <julien@xen.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>
---
This actually moved here from the part 2 of the prep work for PCI
passthrough on Arm as it seems to be the proper place for it.

Since v5:
- optimize with IS_ENABLED(CONFIG_HAS_PCI_MSI) since VPCI_MAX_VIRT_DEV is
  defined unconditionally
New in v5
---
 xen/arch/arm/vpci.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/vpci.c b/xen/arch/arm/vpci.c
index 66701465af..cd9f5d0757 100644
--- a/xen/arch/arm/vpci.c
+++ b/xen/arch/arm/vpci.c
@@ -148,6 +148,8 @@ static int vpci_get_num_handlers_cb(struct domain *d,
=20
 unsigned int domain_vpci_get_num_mmio_handlers(struct domain *d)
 {
+    unsigned int count;
+
     if ( !has_vpci(d) )
         return 0;
=20
@@ -168,7 +170,17 @@ unsigned int domain_vpci_get_num_mmio_handlers(struct =
domain *d)
      * For guests each host bridge requires one region to cover the
      * configuration space. At the moment, we only expose a single host br=
idge.
      */
-    return 1;
+    count =3D 1;
+
+    /*
+     * There's a single MSI-X MMIO handler that deals with both PBA
+     * and MSI-X tables per each PCI device being passed through.
+     * Maximum number of emulated virtual devices is VPCI_MAX_VIRT_DEV.
+     */
+    if ( IS_ENABLED(CONFIG_HAS_PCI_MSI) )
+        count +=3D VPCI_MAX_VIRT_DEV;
+
+    return count;
 }
=20
 /*
--=20
2.41.0


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:38:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:38:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566301.884968 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHgp-0001GB-2U; Thu, 20 Jul 2023 00:38:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566301.884968; Thu, 20 Jul 2023 00:38:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHgo-0001G4-VA; Thu, 20 Jul 2023 00:38:42 +0000
Received: by outflank-mailman (input) for mailman id 566301;
 Thu, 20 Jul 2023 00:38:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=1UDO=DG=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMHgo-0001Fy-47
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:38:42 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c54553a4-2695-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 02:38:40 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 40453617CE;
 Thu, 20 Jul 2023 00:38:39 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E6A8C433C8;
 Thu, 20 Jul 2023 00:38:36 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c54553a4-2695-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689813518;
	bh=VyefW/P9BwkGk/xm2hLwzVfkavNa8mkdgU0+WlMAtio=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=ktcg5VgRooqk40lYSkPDNnUflMUQTXaQC+/sKSeDpyOcCjydXzQI3pY7OMUTuVA85
	 FwDYNTI9t495GkAxpdRn9ek4LIVkakmIt6Yiy/yjPpx+A1A/DOPZBK7kXor4FcHc1z
	 bdnxuTrIyFNnLAjfTR1FIHFT1BgSpL3mSc3S8QwDL/HImWcQwyTBaknEXkz3q0lx4m
	 IbKFq0ESliLe0n2VYG2kSPZ7lbOgupvk22QxYVda4+RFOc3GhjKbqhI1p7oWBvpXz6
	 JdNJwCNSjYOseerczKCj2KzIhreaFSk7Y0Atbl/Kvu17RERdh1AQGCsY8qPtuSlAsS
	 gJJwcrFdGSklg==
Date: Wed, 19 Jul 2023 17:38:35 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <xenia.ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH v2] x86/HVM: address violations of MISRA C:2012 Rules
 8.2 and 8.3
In-Reply-To: <589e9c2ef5f13bf0c035b63f7b2e24fbbb878543.1689773180.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307191726340.3118466@ubuntu-linux-20-04-desktop>
References: <589e9c2ef5f13bf0c035b63f7b2e24fbbb878543.1689773180.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 19 Jul 2023, Federico Serafini wrote:
> Give a name to unnamed parameters thus addressing violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names and types used in function
> declarations and the ones used in the corresponding function
> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
> ("All declarations of an object or function shall use the same names
> and type qualifiers").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> ---
> Changes in v2:
>   - u64 vs uint64_t mismatches are solved in favor of the stdint types.
> ---
>  xen/arch/x86/hvm/domain.c              |  2 +-
>  xen/arch/x86/hvm/hvm.c                 |  6 +++---
>  xen/arch/x86/hvm/rtc.c                 | 12 ++++++------
>  xen/arch/x86/hvm/svm/nestedsvm.c       |  8 ++++----
>  xen/arch/x86/hvm/vioapic.c             |  2 +-
>  xen/arch/x86/include/asm/hvm/domain.h  |  2 +-
>  xen/arch/x86/include/asm/hvm/hvm.h     | 18 +++++++++---------
>  xen/arch/x86/include/asm/hvm/irq.h     | 14 +++++++-------
>  xen/arch/x86/include/asm/hvm/save.h    |  4 ++--
>  xen/arch/x86/include/asm/hvm/support.h |  2 +-
>  10 files changed, 35 insertions(+), 35 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/domain.c b/xen/arch/x86/hvm/domain.c
> index 7692ee24c2..7f6e362a70 100644
> --- a/xen/arch/x86/hvm/domain.c
> +++ b/xen/arch/x86/hvm/domain.c
> @@ -100,7 +100,7 @@ static int check_segment(struct segment_register *reg, enum x86_segment seg)
>  }
>  
>  /* Called by VCPUOP_initialise for HVM guests. */
> -int arch_set_info_hvm_guest(struct vcpu *v, const vcpu_hvm_context_t *ctx)
> +int arch_set_info_hvm_guest(struct vcpu *v, const struct vcpu_hvm_context *ctx)
>  {
>      const struct domain *d = v->domain;
>      struct cpu_user_regs *uregs = &v->arch.user_regs;
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index 57363c2ae1..28d131a202 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -272,7 +272,7 @@ uint8_t hvm_combine_hw_exceptions(uint8_t vec1, uint8_t vec2)
>      return X86_EXC_DF;
>  }
>  
> -void hvm_set_rdtsc_exiting(struct domain *d, bool_t enable)
> +void hvm_set_rdtsc_exiting(struct domain *d, bool enable)

This is actually getting hvm_set_rdtsc_exiting out-of-sync with its
declaration in xen/arch/x86/include/asm/hvm/hvm.h ?

Everything else looks good to me



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:41:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:41:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566305.884977 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHja-0002jH-Ik; Thu, 20 Jul 2023 00:41:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566305.884977; Thu, 20 Jul 2023 00:41:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHja-0002jA-Fo; Thu, 20 Jul 2023 00:41:34 +0000
Received: by outflank-mailman (input) for mailman id 566305;
 Thu, 20 Jul 2023 00:41:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=5z78=DG=epam.com=prvs=156527e6f7=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qMHjZ-0002j3-2y
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:41:33 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2b417c11-2696-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 02:41:31 +0200 (CEST)
Received: from pps.filterd (m0174676.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36JJMrqp031902; Thu, 20 Jul 2023 00:41:22 GMT
Received: from eur02-db5-obe.outbound.protection.outlook.com
 (mail-db5eur02lp2104.outbound.protection.outlook.com [104.47.11.104])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3rxgcw1t5a-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 20 Jul 2023 00:41:22 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS4PR03MB8650.eurprd03.prod.outlook.com (2603:10a6:20b:589::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 00:41:18 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6588.035; Thu, 20 Jul 2023
 00:41:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2b417c11-2696-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Lnn3e5N8sPwD2uhw0JChihMTjNoNbR8fH0hY7yfPTjnc5VnJVUFFUJZp1YsXVeilJ3p9xGOUpAHTEWsIWCleHaMpK9+nvuTvyVV7nyxbqjIdjRyVZm1IV2w0C1npfB3w8eblEqzXBY7bOEtY7LUKUHctxwI/ro7HlTT8yCHi5Y126p+WrZ6rhDz5iL5naZKkqWZZslJaNrjCsQe3p0hOKlm1L9KaIqnRTn6OKWld6osrI3y/UTa0/huNkW5/IOi3HR/mRYD3PGRGrxWoNgWw31xqEE35vsIKn4n0M9AUoxurdvoSHnGeWxySGMGRNPXsrweMhHkxcHid3u6fSWSPrQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Rulf/RP7oBEruDr9bd9TTNzHsH02ElpBeA6ViNtKzRM=;
 b=BMskddhvCmXERZie/NwBaYAvIRuFHB5EhtD/nlQGqgXXZESD5xtxgNuOmA6Y+sNtEwN3zptMjfoIy28slNNlaMefOU8sOylvrx4xldEZg/5KyPblGsoz9UCMvvmQO7+T+WTvpXC6/jtC6e1PrzRbEyzW7byxsI1x5FfdsFGkwV1sf5x2YocbzTjyzUkWmZwDcjkUPJ7XXz4C6blsBcBOxFfjHfp8akfo5ri49TG5o3eTGqrO5rM0jmnGoQ0zB+nyDSFAwpgtpyPzR7NMivo6LJBeWnd+5FOKpkCVrZH36+efOLpp6hwLQnYyLtBtk6VSuVWUDoo85yWFna4ziRLA4g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Rulf/RP7oBEruDr9bd9TTNzHsH02ElpBeA6ViNtKzRM=;
 b=H7aXokX1q/BbetclSExhxyfxu10JuA6hR+eQEDLqOzYax8qAtgZR226w8TRBVs/88DCqu4DIV408kHD+akt/PMq6UvHVEB5zZuprfHRVevxv6/6VnfBCbJWmb2NNwHBJ0rPKue74myBMpux0fqCNwr8bispo9mYc0DfEnY6l1FL6Cy4aCqybcwP+A0/JOg5KA1EMt8KE4/j1TUsCFCqr5qeBxRIIbgFLo2RJBTSQokmz9TQjobFSWBuBYl6/BHoT8AaCHHUKkMGcEtn3e7JAnW9nxTUJ6AHmcBbX9fyay3mTY5zR7hVDEk9EjKXVxjyFnaTzgkZQwUDnv62vSxmUAQ==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
        Andrew Cooper
	<andrew.cooper3@citrix.com>,
        George Dunlap <george.dunlap@citrix.com>,
        Jan
 Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
        Stefano
 Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
        Paul Durrant
	<paul@xen.org>,
        =?iso-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>,
        Kevin Tian <kevin.tian@intel.com>,
        Bertrand Marquis
	<bertrand.marquis@arm.com>,
        Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH v8 00/13] PCI devices passthrough on Arm, part 3
Thread-Topic: [PATCH v8 00/13] PCI devices passthrough on Arm, part 3
Thread-Index: AQHZuqGqn2EU3dWVak6ca3YhrfMkhq/Bz9WA
Date: Thu, 20 Jul 2023 00:41:18 +0000
Message-ID: <87mszrfm8i.fsf@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
In-Reply-To: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: mu4e 1.8.9; emacs 28.2
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS4PR03MB8650:EE_
x-ms-office365-filtering-correlation-id: 31a475bd-5ff5-415b-cdf6-08db88ba07e4
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 9AvFMQu1hE1OrSd8z8xk7XzWVk60kIGD/fnFGm2RZXoZy41xsKEvMbnlBUttEaRi67LBBBzX2gxylF/CQrLDpSkgNnhYjjyIjNY8AP/CoHx2xtnRJNFUD1F+fKlTHwMxdLbEuW0N7H6UErDU4XpZGg8T3znwHrKB1njw5hHzGFmBTMPL54wxrOXQqXv7vrxQ2My++1SLa16nbHxNA163ie0J6mI1jaRDaP0mWQ7iJ3WKEJq3qgbjipPzU6TN6JB865BKyGncieNXwJaZyXcs6MW6g9lt8mXGs2cPLQyJ95ferWH/ov3NTjA/Pxoase4KO2pjmcx10+0egAMViCJWjGkNGXbbUqdINkw3Al7GpMRBpAwQTWKh03p1EfnHVl559wwbRxd8IubbJsNojalFwQyPjh7GxaiiELQC7fnB+dAbKaIO46ncO0XC/UZ8Wo1GtzI3Lw1nbrpgTf+rBkqA6SdbfKh3qM4iMU46hw/pzWgRdEAp/9yC6Xed1bS6rBd+vV/xBCoyU0UY7T1MRNVE6+6W/LHia3u7AUnUKXOwxvWELSQmsKK7wry/xUaJqlFn2u/m8SuLViCRSZFTvnFXSyz5cnylJDPE+P+o8ZDSwo1iFRz4W7/BTkCkojKwCJKL
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(376002)(366004)(346002)(136003)(451199021)(6486002)(478600001)(83380400001)(71200400001)(6506007)(26005)(6512007)(55236004)(107886003)(91956017)(38100700002)(64756008)(66476007)(66556008)(66446008)(54906003)(76116006)(66946007)(122000001)(4326008)(6916009)(186003)(2616005)(5660300002)(7416002)(316002)(8936002)(8676002)(38070700005)(86362001)(2906002)(41300700001)(36756003);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?iso-8859-1?Q?smybYYhIJzRhlcDMK/YSc6r+9Bd7VMx1Q46RoQ/WPiKqE3w/stRVeE25+c?=
 =?iso-8859-1?Q?RPqexOVJ3ml/4yab/LRvSltw6BT8+QAvA9qziW3xzqiCOzwU1IstpSYswT?=
 =?iso-8859-1?Q?W/GBo2If5v+0LmvuGPWtedQYl6yI6FWFJ0ETYTr5S0R0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 =?iso-8859-1?Q?GKI4molxehtHiAfE01JvFFpJSDCDauzPX4QGHsrew1qKh1x93WwNfRHDm/?=
 =?iso-8859-1?Q?OlzGYMR/VtoCZ+MQigdGHOahW6HL6+Lqm76ysJYpxxACXeZf0JiSb4Oz43?=
 =?iso-8859-1?Q?oAcSpKC92B8j4bUZzaMyoDSSuNL7rD6wyyzkQ/o8ss4uO/uGr7FFEPGS/2?=
 =?iso-8859-1?Q?UGUE8B1w8TA+EqVQ4/CAAjDf2mSSDoPeCGf7j3Z5tpElXSR1j0z7oEnGO9?=
 =?iso-8859-1?Q?Q3VpOOKFzNka8A4Xg1c1AK5a6078oXKyKHenFAt/2P8U6XokeQYU6PMEFO?=
 =?iso-8859-1?Q?JqrmdHWQhVQcfy/tKIQJuWFjLQL0GdO5yJQOy/fqtfbjn9DKWFEyTka+Tb?=
 =?iso-8859-1?Q?xOacan7ntM5h/iGarjgsN/vHkorbxUnPDlm+v3dfhWzgbtRpWGiD4Q6Bwx?=
 =?iso-8859-1?Q?LwiKhuwEAqaPTLgmZGHB8o1W+VqDHoe3PPGm74em1A6wQQt72quCVMCUC3?=
 =?iso-8859-1?Q?YJKBAZcBwyqRjZsmPaHzNAgZvA47dbH+W51a6vZFeDANluOGcjI787RnLx?=
 =?iso-8859-1?Q?Xu6/kRvoWeaew2fj2acnkBsA07EGAGWfhugj+esVh1tuxqtSuD1Oi+oStX?=
 =?iso-8859-1?Q?cGv0kl0j+tz05bVWzMsDl/7/cffcIvOvbBtbQzHiehrvHQvNb40Yt9Pg?=
 =?iso-8859-1?Q?=3D=3D?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 31a475bd-5ff5-415b-cdf6-08db88ba07e4
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 00:41:18.0739
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: bfMfmPQYjkGx28YZMfn6xOEeQ2e7B3i+fQIlqkKqflwSmPKkwE67lsDUitapF0VDlje+lHSsfR9Z23rwn2C8UNG/6z72RwG9z5oNZD28Se8=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR03MB8650
X-Proofpoint-ORIG-GUID: geUXcCq6BGclhyMBkFH1Lf6T_53xcXwk
X-Proofpoint-GUID: geUXcCq6BGclhyMBkFH1Lf6T_53xcXwk
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-19_16,2023-07-19_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0
 malwarescore=0 mlxlogscore=615 suspectscore=0 phishscore=0 mlxscore=0
 spamscore=0 bulkscore=0 clxscore=1015 impostorscore=0 adultscore=0
 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307200003


Volodymyr Babchuk <volodymyr_babchuk@epam.com> writes:

Hello again,

Looks like I messed up with add_maintainers script and sent this series
without proper CCs. So I am CCing all interested persons only in this
cover letter only.

Sorry for the noise.

> Hello,
>
> This is next version of vPCI rework. Aim of this series is to prepare
> ground for introducing PCI support on ARM platform.
>
> The biggest change from previous, mistakenly named, v7 series is how
> locking is implemented. Instead of d->vpci_rwlock we introduce
> d->pci_lock which has broader scope, as it protects not only domain's
> vpci state, but domain's list of PCI devices as well.
>
> As we discussed in IRC with Roger, it is not feasible to rework all
> the existing code to use the new lock right away. It was agreed that
> any write access to d->pdev_list will be protected by **both**
> d->pci_lock in write mode and pcidevs_lock(). Read access on other
> hand should be protected by either d->pci_lock in read mode or
> pcidevs_lock(). It is expected that existing code will use
> pcidevs_lock() and new users will use new rw lock. Of course, this
> does not mean that new users shall not use pcidevs_lock() when it is
> appropriate.
>
> Apart from locking scheme rework, there are less major fixes in some
> patches, based on the review comments.
>
> Oleksandr Andrushchenko (12):
>   vpci: use per-domain PCI lock to protect vpci structure
>   vpci: restrict unhandled read/write operations for guests
>   vpci: add hooks for PCI device assign/de-assign
>   vpci/header: implement guest BAR register handlers
>   rangeset: add RANGESETF_no_print flag
>   vpci/header: handle p2m range sets per BAR
>   vpci/header: program p2m with guest BAR view
>   vpci/header: emulate PCI_COMMAND register for guests
>   vpci/header: reset the command register when adding devices
>   vpci: add initial support for virtual PCI bus topology
>   xen/arm: translate virtual PCI bus topology for guests
>   xen/arm: account IO handlers for emulated PCI MSI-X
>
> Volodymyr Babchuk (1):
>   pci: introduce per-domain PCI rwlock
>
>  xen/arch/arm/vpci.c                         |  61 ++-
>  xen/arch/x86/hvm/vmsi.c                     |   4 +
>  xen/common/domain.c                         |   1 +
>  xen/common/rangeset.c                       |   5 +-
>  xen/drivers/Kconfig                         |   4 +
>  xen/drivers/passthrough/amd/pci_amd_iommu.c |   9 +-
>  xen/drivers/passthrough/pci.c               |  96 ++++-
>  xen/drivers/passthrough/vtd/iommu.c         |   9 +-
>  xen/drivers/vpci/header.c                   | 453 ++++++++++++++++----
>  xen/drivers/vpci/msi.c                      |  18 +-
>  xen/drivers/vpci/msix.c                     |  56 ++-
>  xen/drivers/vpci/vpci.c                     | 176 +++++++-
>  xen/include/xen/pci.h                       |   1 +
>  xen/include/xen/rangeset.h                  |   5 +-
>  xen/include/xen/sched.h                     |   9 +
>  xen/include/xen/vpci.h                      |  42 +-
>  16 files changed, 828 insertions(+), 121 deletions(-)


--=20
WBR, Volodymyr=


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:55:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566308.884987 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHwS-0004YV-N8; Thu, 20 Jul 2023 00:54:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566308.884987; Thu, 20 Jul 2023 00:54:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHwS-0004YO-KL; Thu, 20 Jul 2023 00:54:52 +0000
Received: by outflank-mailman (input) for mailman id 566308;
 Thu, 20 Jul 2023 00:54:51 +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
 <SRS0=1UDO=DG=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMHwR-0004YI-DI
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:54:51 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 06340791-2698-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 02:54:48 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 36BF66185F;
 Thu, 20 Jul 2023 00:54:47 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 026BDC433C8;
 Thu, 20 Jul 2023 00:54:45 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 06340791-2698-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689814486;
	bh=WbhKu7aZ3CiGcw50z9VWjUGuhKh2hmhy7LJBz4jmGsk=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=SfiFvv/p9jTS+Qh3eeUhuPXm4es0k8oKFENVsfq2cEjClhCRYPK0Px1ppamRCLPB/
	 Y0ERoeTtLks/YDtYJCvvIRc06T48YsW/SI+ZQB78EK7fXAXeO2g6ZxEYCd3h2zjEvG
	 ZgFuy/Ci9YIAQ0guFK4yeSf8/tBNVM4wTMTLt1cIX8vU59vF5xHUyhBIlxY+ufblhk
	 BYhjxkeCHIRuyc8OiuG+q512I4lyREOEalK1sKewkSlOx0px8IV00yQUdmlNBPJUpT
	 1xD0k7kJ1UEf6lh8lQ42DndDf+IeA6Bm8ZBd0d2AhBdAVOJt+JWoT0jY0D7sk0m/Sl
	 UDhTsy5II+Yag==
Date: Wed, 19 Jul 2023 17:54:43 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Luca Fancellu <luca.fancellu@arm.com>
cc: xen-devel@lists.xenproject.org, wei.chen@arm.com, 
    Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH 1/2] xen/misra: diff-report.py: Fix UnifiedFormatParser
 change line registration
In-Reply-To: <20230718092637.2433974-2-luca.fancellu@arm.com>
Message-ID: <alpine.DEB.2.22.394.2307191754370.3118466@ubuntu-linux-20-04-desktop>
References: <20230718092637.2433974-1-luca.fancellu@arm.com> <20230718092637.2433974-2-luca.fancellu@arm.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 18 Jul 2023, Luca Fancellu wrote:
> Fix the line number on the registration of a 'remove' change type when
> consecutive 'remove' changes are registered.
> 
> Currently the algorithm registers consecutive 'remove' changes at the same
> line it encounter the first one, 'add' changes type are not affected by the
> bug.
> 
> Fixes: 1d7c45f895b6 ("xen/misra: diff-report.py: add report patching feature")
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  .../xen_analysis/diff_tool/unified_format_parser.py        | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/scripts/xen_analysis/diff_tool/unified_format_parser.py b/xen/scripts/xen_analysis/diff_tool/unified_format_parser.py
> index 8b3fbc318df7..6c506caeafce 100644
> --- a/xen/scripts/xen_analysis/diff_tool/unified_format_parser.py
> +++ b/xen/scripts/xen_analysis/diff_tool/unified_format_parser.py
> @@ -144,6 +144,7 @@ class UnifiedFormatParser(object):
>          file_linenum = 0
>          hunk_a_linemax = 0
>          hunk_b_linemax = 0
> +        consecutive_remove = 0
>          diff_elem = None
>          parse_state = ParserState.FIND_DIFF_HEADER
>          ChangeMode = ChangeSet.ChangeMode
> @@ -210,14 +211,18 @@ class UnifiedFormatParser(object):
>                  if (hunk_b_linemax > 0) and line.startswith("+"):
>                      diff_elem.add_change(file_linenum, ChangeType.ADD)
>                      hunk_b_linemax -= 1
> +                    consecutive_remove = 0
>                  elif (hunk_a_linemax > 0) and line.startswith("-"):
> -                    diff_elem.add_change(file_linenum, ChangeType.REMOVE)
> +                    diff_elem.add_change(file_linenum + consecutive_remove,
> +                                         ChangeType.REMOVE)
>                      hunk_a_linemax -= 1
>                      file_linenum -= 1
> +                    consecutive_remove += 1
>                  elif ((hunk_a_linemax + hunk_b_linemax) > 0) and \
>                          line.startswith(" "):
>                      hunk_a_linemax -= 1 if (hunk_a_linemax > 0) else 0
>                      hunk_b_linemax -= 1 if (hunk_b_linemax > 0) else 0
> +                    consecutive_remove = 0
>  
>                  if (hunk_a_linemax + hunk_b_linemax) <= 0:
>                      parse_state = ParserState.FIND_HUNK_OR_DIFF_HEADER
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 00:55:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 00:55:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566311.884998 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHxD-00054p-VH; Thu, 20 Jul 2023 00:55:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566311.884998; Thu, 20 Jul 2023 00:55:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMHxD-00054i-Sg; Thu, 20 Jul 2023 00:55:39 +0000
Received: by outflank-mailman (input) for mailman id 566311;
 Thu, 20 Jul 2023 00:55:38 +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
 <SRS0=1UDO=DG=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMHxC-00054V-S6
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 00:55:38 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 22e1cd3b-2698-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 02:55:36 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 666576185F;
 Thu, 20 Jul 2023 00:55:35 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E858C433C8;
 Thu, 20 Jul 2023 00:55:34 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 22e1cd3b-2698-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689814534;
	bh=+qw275kn3Q34BuF4wr/IBRpFm8H5A78DeUfTVsmKwHE=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=SGhfmY1fHKFs/yjn7xzRLPj/QMiycPSk+9xMOPIZry2gNMMWx4IcJfA9ipbXZNqVh
	 Ajemnziu0pBmDGqJgj28KPYYft16LLrHynefjGr2fP4UW1Ab+XJFVlvPeXorXj3LD9
	 Js6c+KnwcqbDLsJgq85wWCaEua304uevtR2Oas70TuE8/qTgTttGPewdTavAkHmKEK
	 1csF0tJC8GeMkQ/u4xfYSUxwXFExF5CCPnyVo8tRdCKeyrOKb5qaS4UHLxX0kYwatw
	 Zn3jcADICyJBny//mTLiiPBotSackxhUUUanVPg3SDOSm5wk2BsDSuOPhjKSatszF7
	 HT/bpypYMzT2g==
Date: Wed, 19 Jul 2023 17:55:32 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Luca Fancellu <luca.fancellu@arm.com>
cc: xen-devel@lists.xenproject.org, wei.chen@arm.com, 
    Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH 2/2] xen/misra: diff-report.py: fix function invocation
In-Reply-To: <20230718092637.2433974-3-luca.fancellu@arm.com>
Message-ID: <alpine.DEB.2.22.394.2307191755250.3118466@ubuntu-linux-20-04-desktop>
References: <20230718092637.2433974-1-luca.fancellu@arm.com> <20230718092637.2433974-3-luca.fancellu@arm.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 18 Jul 2023, Luca Fancellu wrote:
> Fix the invocation of invoke_command() that takes an optional
> parameter for the exception type, but in the code the error
> message template was passed instead, so fix it passing a new
> exception type.
> 
> Fixes: 1d7c45f895b6 ("xen/misra: diff-report.py: add report patching feature")
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  xen/scripts/diff-report.py | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/scripts/diff-report.py b/xen/scripts/diff-report.py
> index 636f98f5eebe..a1fe6bc2fccd 100755
> --- a/xen/scripts/diff-report.py
> +++ b/xen/scripts/diff-report.py
> @@ -13,6 +13,10 @@ from xen_analysis.settings import repo_dir
>  from xen_analysis.utils import invoke_command
>  
>  
> +class DiffReportError(Exception):
> +    pass
> +
> +
>  def log_info(text, end='\n'):
>      # type: (str, str) -> None
>      global args
> @@ -97,7 +101,7 @@ def main(argv):
>              git_diff = invoke_command(
>                  "git --git-dir={}/.git diff -C -C {}..{}"
>                  .format(repo_dir, args.baseline_rev, args.report_rev),
> -                True, "Error occured invoking:\n{}\n\n{}"
> +                True, DiffReportError, "Error occured invoking:\n{}\n\n{}"
>              )
>              diff_source = git_diff.splitlines(keepends=True)
>          if diff_source:
> @@ -105,7 +109,7 @@ def main(argv):
>              diffs = UnifiedFormatParser(diff_source)
>              debug.debug_print_parsed_diff(diffs)
>              log_info(" [OK]")
> -    except (ReportError, UnifiedFormatParseError) as e:
> +    except (DiffReportError, ReportError, UnifiedFormatParseError) as e:
>          print("ERROR: {}".format(e))
>          sys.exit(1)
>  
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 01:46:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 01:46:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566317.885007 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMIkE-0001jc-Jk; Thu, 20 Jul 2023 01:46:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566317.885007; Thu, 20 Jul 2023 01:46:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMIkE-0001jV-Gr; Thu, 20 Jul 2023 01:46:18 +0000
Received: by outflank-mailman (input) for mailman id 566317;
 Thu, 20 Jul 2023 01:46:17 +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
 <SRS0=1UDO=DG=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMIkD-0001jP-7u
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 01:46:17 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 35c0d14e-269f-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 03:46:14 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 3EA24617E0;
 Thu, 20 Jul 2023 01:46:13 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36C8BC433C8;
 Thu, 20 Jul 2023 01:46:11 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 35c0d14e-269f-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689817572;
	bh=yCQUDtL0UqqYZDlbk2aVPDJ5Dl4d0i1KTjXVd9XaAbI=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=hyPiZYh5SdjvHMIO3hNjI7UI3jwcZqwqss3z7rYw4YZ5S7FuVAteyGu5EG74ZSwnw
	 r+UPRKx8FTDsOxHlTADd7OIQ0G60zCM0kVDi3oBhgi0gKPNco4vAg0Bhdak4hEJbyj
	 P8aH85PZC8aXcyk6F9LWZvG02Jx637k0jcHrxmLtkuHCDVznEjdMMm3DSAatLhPDQv
	 KdaFJc9M+d6v6utIOExniAIlmtur1JwZNtzR5sLPuJV0XYhCIUDI+kL8KKReBqzDBo
	 +jIvW6f40SnxFZpWXa+Glb3ARE/VH5z3FVOxsBfI3MO4xZpzmLGWcuc3Ylf93Lc0Vp
	 iEw6MOykz19AQ==
Date: Wed, 19 Jul 2023 18:46:08 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Petr Mladek <pmladek@suse.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, boris.ostrovsky@oracle.com, 
    jgross@suse.com, xen-devel@lists.xenproject.org, 
    Luca Miccio <lucmiccio@gmail.com>, 
    Stefano Stabellini <stefano.stabellini@xilinx.com>, 
    live-patching@vger.kernel.org, Jens Axboe <axboe@kernel.dk>, 
    Peter Zijlstra <peterz@infradead.org>, 
    Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH LINUX v5 2/2] xen: add support for initializing xenstore
 later as HVM domain
In-Reply-To: <ZLgFmS4TQwGWA7o0@alley>
Message-ID: <alpine.DEB.2.22.394.2307191841290.3118466@ubuntu-linux-20-04-desktop>
References: <alpine.DEB.2.22.394.2205131417320.3842@ubuntu-linux-20-04-desktop> <20220513211938.719341-2-sstabellini@kernel.org> <ZLgFmS4TQwGWA7o0@alley>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 19 Jul 2023, Petr Mladek wrote:
> On Fri 2022-05-13 14:19:38, Stefano Stabellini wrote:
> > From: Luca Miccio <lucmiccio@gmail.com>
> > 
> > When running as dom0less guest (HVM domain on ARM) the xenstore event
> > channel is available at domain creation but the shared xenstore
> > interface page only becomes available later on.
> > 
> > In that case, wait for a notification on the xenstore event channel,
> > then complete the xenstore initialization later, when the shared page
> > is actually available.
> > 
> > The xenstore page has few extra field. Add them to the shared struct.
> > One of the field is "connection", when the connection is ready, it is
> > zero. If the connection is not-zero, wait for a notification.
> 
> I see the following warning from free_irq() in 6.5-rc2 when running
> livepatching selftests. It does not happen after reverting this patch.
> 
> [  352.168453] livepatch: signaling remaining tasks
> [  352.173228] ------------[ cut here ]------------
> [  352.175563] Trying to free already-free IRQ 0
> [  352.177355] WARNING: CPU: 1 PID: 88 at kernel/irq/manage.c:1893 free_irq+0xbf/0x350
> [  352.179942] Modules linked in: test_klp_livepatch(EK)
> [  352.181621] CPU: 1 PID: 88 Comm: xenbus_probe Kdump: loaded Tainted: G            E K    6.5.0-rc2-default+ #535
> [  352.184754] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.15.0-0-g2dd4b9b-rebuilt.opensuse.org 04/01/2014
> [  352.188214] RIP: 0010:free_irq+0xbf/0x350
> [  352.192211] Code: 7a 08 75 0e e9 36 02 00 00 4c 3b 7b 08 74 5a 48 89 da 48 8b 5a 18 48 85 db 75 ee 44 89 f6 48 c7 c7 58 b0 8b 86 e8 21 0a f5 ff <0f> 0b 48 8b 34 24 4c 89 ef e8 53 bb e3 00 
> 48 8b 45 40 48 8b 40 78
> [  352.200079] RSP: 0018:ffffaf0440b4be80 EFLAGS: 00010086
> [  352.201465] RAX: 0000000000000000 RBX: ffff99f105116c80 RCX: 0000000000000003
> [  352.203324] RDX: 0000000080000003 RSI: ffffffff8691d4bc RDI: 00000000ffffffff
> [  352.204989] RBP: ffff99f100052000 R08: 0000000000000000 R09: c0000000ffff7fff
> [  352.206253] R10: ffffaf0440b4bd18 R11: ffffaf0440b4bd10 R12: ffff99f1000521e8
> [  352.207451] R13: ffff99f1000520a8 R14: 0000000000000000 R15: ffffffff86f42360
> [  352.208787] FS:  0000000000000000(0000) GS:ffff99f15a400000(0000) knlGS:0000000000000000
> [  352.210061] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [  352.210815] CR2: 00007f8415d56000 CR3: 0000000105e36003 CR4: 0000000000370ee0
> [  352.211867] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [  352.212912] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> [  352.213951] Call Trace:
> [  352.214390]  <TASK>
> [  352.214717]  ? __warn+0x81/0x170
> [  352.215436]  ? free_irq+0xbf/0x350
> [  352.215906]  ? report_bug+0x10b/0x200
> [  352.216408]  ? prb_read_valid+0x17/0x20
> [  352.216926]  ? handle_bug+0x44/0x80
> [  352.217409]  ? exc_invalid_op+0x13/0x60
> [  352.217932]  ? asm_exc_invalid_op+0x16/0x20
> [  352.218497]  ? free_irq+0xbf/0x350
> [  352.218979]  ? __pfx_xenbus_probe_thread+0x10/0x10
> [  352.219600]  xenbus_probe+0x7a/0x80
> [  352.221030]  xenbus_probe_thread+0x76/0xc0
> [  352.221416]  ? __pfx_autoremove_wake_function+0x10/0x10
> [  352.221882]  kthread+0xfd/0x130
> [  352.222191]  ? __pfx_kthread+0x10/0x10
> [  352.222544]  ret_from_fork+0x2d/0x50
> [  352.222893]  ? __pfx_kthread+0x10/0x10
> [  352.223260]  ret_from_fork_asm+0x1b/0x30
> [  352.223629] RIP: 0000:0x0
> [  352.223931] Code: Unable to access opcode bytes at 0xffffffffffffffd6.
> [  352.224488] RSP: 0000:0000000000000000 EFLAGS: 00000000 ORIG_RAX: 0000000000000000
> [  352.225044] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
> [  352.225571] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
> [  352.226106] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
> [  352.226632] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
> [  352.227171] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
> [  352.227710]  </TASK>
> [  352.227917] irq event stamp: 22
> [  352.228209] hardirqs last  enabled at (21): [<ffffffff854240be>] ___slab_alloc+0x68e/0xc80
> [  352.228914] hardirqs last disabled at (22): [<ffffffff85fe98fd>] _raw_spin_lock_irqsave+0x8d/0x90
> [  352.229546] softirqs last  enabled at (0): [<ffffffff850fc0ee>] copy_process+0xaae/0x1fd0
> [  352.230079] softirqs last disabled at (0): [<0000000000000000>] 0x0
> [  352.230503] ---[ end trace 0000000000000000 ]---
> 
> , where the message "livepatch: signaling remaining tasks" means that
> it might send fake signals to non-kthread tasks.
> 
> The aim is to force userspace tasks to enter and leave kernel space
> so that they might start using the new patched code. It is done
> this way:
> 
> /*
>  * Sends a fake signal to all non-kthread tasks with TIF_PATCH_PENDING set.
>  * Kthreads with TIF_PATCH_PENDING set are woken up.
>  */
> static void klp_send_signals(void)
> {
> [...]
> 
> 			/*
> 			 * Send fake signal to all non-kthread tasks which are
> 			 * still not migrated.
> 			 */
> 			set_notify_signal(task);
> [...]
> 
> The warning is most likely printed in this condition:
> 
> const void *free_irq(unsigned int irq, void *dev_id)
> {
> 	struct irq_desc *desc = irq_to_desc(irq);
> 	struct irqaction *action;
> 	const char *devname;
> 
> 	if (!desc || WARN_ON(irq_settings_is_per_cpu_devid(desc)))
> 		return NULL;
> 
> 
> See below.
> 
> > --- a/drivers/xen/xenbus/xenbus_probe.c
> > +++ b/drivers/xen/xenbus/xenbus_probe.c
> > @@ -750,6 +751,20 @@ static void xenbus_probe(void)
> >  {
> >  	xenstored_ready = 1;
> >  
> > +	if (!xen_store_interface) {
> > +		xen_store_interface = xen_remap(xen_store_gfn << XEN_PAGE_SHIFT,
> > +						XEN_PAGE_SIZE);
> > +		/*
> > +		 * Now it is safe to free the IRQ used for xenstore late
> > +		 * initialization. No need to unbind: it is about to be
> > +		 * bound again from xb_init_comms. Note that calling
> > +		 * unbind_from_irqhandler now would result in xen_evtchn_close()
> > +		 * being called and the event channel not being enabled again
> > +		 * afterwards, resulting in missed event notifications.
> > +		 */
> > +		free_irq(xs_init_irq, &xb_waitq);
> 
> Is it possbile that this free_irq(), the fake signal, and the warning
> are somehow related, please?

I don't know how the fake signal could relate to this, but it would seem
that either:
1) free_irq is called twice
2) free_irq is called but xs_init_irq wasn't initialized before

For 2) I can see that xenbus_probe() is called in a few cases where
xs_init_irq wasn't set. Something like the below would make the warning
go away but it would be nice to figure out which one is the code path
taken that originally triggered the warning.


diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index 58b732dcbfb8..b0a6d121f895 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -65,7 +65,7 @@
 #include "xenbus.h"
 
 
-static int xs_init_irq;
+static int xs_init_irq = -1;
 int xen_store_evtchn;
 EXPORT_SYMBOL_GPL(xen_store_evtchn);
 
@@ -762,7 +762,8 @@ static void xenbus_probe(void)
 		 * being called and the event channel not being enabled again
 		 * afterwards, resulting in missed event notifications.
 		 */
-		free_irq(xs_init_irq, &xb_waitq);
+		if (xs_init_irq >= 0)
+			free_irq(xs_init_irq, &xb_waitq);
 	}
 
 	/*


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 02:54:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 02:54:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566322.885017 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMJo8-0002wi-KN; Thu, 20 Jul 2023 02:54:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566322.885017; Thu, 20 Jul 2023 02:54:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMJo8-0002wb-HY; Thu, 20 Jul 2023 02:54:24 +0000
Received: by outflank-mailman (input) for mailman id 566322;
 Thu, 20 Jul 2023 02:54:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMJo7-0002wQ-VL; Thu, 20 Jul 2023 02:54:23 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMJo7-0005Ju-N5; Thu, 20 Jul 2023 02:54:23 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMJo6-0004cu-O4; Thu, 20 Jul 2023 02:54:22 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMJo6-0003f0-NK; Thu, 20 Jul 2023 02:54:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=yLawA1EHzZzhdskczYMpew7fab2Ah+v9nsX8HXyk1kk=; b=oWheUpkpp/gqWLwnWS2LGQwJxk
	X9F3WYbH6immFI5XL/DHT2wOv+CWGY59EaKao9xv5a9FtWKR+UDzjmDHJ29e+o9nmWMoSdG7UkfXC
	8ffXNXXiAwup1lVxJDJ9SK1GxQOBYv2TfBsOeo0MYILwY0n3Ytna4SjlSRewMvtUf+QY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181890-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 181890: tolerable FAIL - PUSHED
X-Osstest-Failures:
    libvirt:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=aece25f66517a327c2a6bde4d06b432d415ed7da
X-Osstest-Versions-That:
    libvirt=2d7542a8a56126fc18a19713e0e0e81085c622b6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 20 Jul 2023 02:54:22 +0000

flight 181890 libvirt real [real]
flight 181915 libvirt real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181890/
http://logs.test-lab.xenproject.org/osstest/logs/181915/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail pass in 181915-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181868
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181868
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181868
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 libvirt              aece25f66517a327c2a6bde4d06b432d415ed7da
baseline version:
 libvirt              2d7542a8a56126fc18a19713e0e0e81085c622b6

Last test of basis   181868  2023-07-18 04:20:36 Z    1 days
Testing same since   181890  2023-07-19 04:20:19 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Boris Fiuczynski <fiuczy@linux.ibm.com>
  Michal Privoznik <mprivozn@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-libvirt-vhd                                 fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   2d7542a8a5..aece25f665  aece25f66517a327c2a6bde4d06b432d415ed7da -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 03:46:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 03:46:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566328.885028 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMKcN-0001OA-GI; Thu, 20 Jul 2023 03:46:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566328.885028; Thu, 20 Jul 2023 03:46:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMKcN-0001O3-C4; Thu, 20 Jul 2023 03:46:19 +0000
Received: by outflank-mailman (input) for mailman id 566328;
 Thu, 20 Jul 2023 03:46:18 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMKcM-0001Nt-6Z; Thu, 20 Jul 2023 03:46:18 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMKcM-0006LU-0Y; Thu, 20 Jul 2023 03:46:18 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMKcL-0006DV-6w; Thu, 20 Jul 2023 03:46:17 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMKcL-0003sH-6W; Thu, 20 Jul 2023 03:46:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=2VM8QWdU2w4OStIYyHhohGhfpVsIxeIE8GVsF6YKJPo=; b=iy4eRkX7StABZiJ28IkHy8GP+E
	A1gZKvipIEbQHaqJ/VJeIse0QnheEEOrmnRvQx7xwUmzUZsaUyhZE8SNSvM+1L1vQ68r2hIUa8qV5
	rGej7PF2EwwqKvzWyc43O/Ymyb+t00XBx0O0RlUAfJiVz1w6Cmc4QDEKbCHlKVpuFV3c=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181916-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181916: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=6510dcf6f71adbe282bff0ba2b236f1d074f819f
X-Osstest-Versions-That:
    ovmf=a52044a9e602bc168cdf5d73a48952bfc9edb521
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 20 Jul 2023 03:46:17 +0000

flight 181916 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181916/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 6510dcf6f71adbe282bff0ba2b236f1d074f819f
baseline version:
 ovmf                 a52044a9e602bc168cdf5d73a48952bfc9edb521

Last test of basis   181907  2023-07-19 17:44:03 Z    0 days
Testing same since   181916  2023-07-20 01:41:49 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  devel@edk2.groups.io <devel@edk2.groups.io>
  Michael D Kinney <michael.d.kinney@intel.com>
  Nickle Wang <nicklew@nvidia.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   a52044a9e6..6510dcf6f7  6510dcf6f71adbe282bff0ba2b236f1d074f819f -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 05:58:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 05:58:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566335.885038 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMMgL-00029R-QS; Thu, 20 Jul 2023 05:58:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566335.885038; Thu, 20 Jul 2023 05:58:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMMgL-00029K-NS; Thu, 20 Jul 2023 05:58:33 +0000
Received: by outflank-mailman (input) for mailman id 566335;
 Thu, 20 Jul 2023 05:58:32 +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 <SRS0=6Xo+=DG=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMMgK-00029E-Ak
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 05:58:32 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20605.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::605])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 72694731-26c2-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 07:58:30 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB9709.eurprd04.prod.outlook.com (2603:10a6:102:26b::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.23; Thu, 20 Jul
 2023 05:58:25 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 05:58:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 72694731-26c2-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=L7bSMAke9mMOP5B8vhhvxtaOKRkKtL4n+4NW/ByXFTFoOCRssdeEpU3rALavFrQ0h5jPIADl9k81qPLKjRl5lRNUqgLVXM2xGjtkCZ6JReaiRv2O+8b7X2wUzCHHbnrDwA8WLIr1HRWHYiD3PQaKxPnFsDqDHrEh/zXsJTYGXYhcU39fF8p64T6gefw6a8yY45mPUhAUtNewSyYVl6PfAKC3ZLTJsGj5iecu5gmEJ1tjGg98wHZHd1fKlF+T0i7oEsA0xoIPBZwX4FwJE618ppnBlJC1hH2Cq1BzEG/bxLyYvkurkMVn00NIYMZoJjef0ytM48p7iqf9TRt1ojMKcg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3vL1z85zPLYEi37XUl/gthOpeiSSFb9tRVWv6syiwM4=;
 b=KS/Hk9WCr4jIBjy/Enl58yuGwipUmQv3GAyqjuD80IV63iHtjqNozIk3LjuW/Mc8Y+KqlSy15s2n7WCISSLu3DwdQtcKttGb4rVguMRg/WXznRANrlwONGXdMs+UE+yAt/xp/w9/3nezfqxuEzK7SGAFDBIu1SyjzqfC5OUQ3G6DLfkRcD3zy4vNZYvQJ3zqQymy6NkCegVp1MlFKo71Un2ZnDvkZVgA9tDQu7dQjZ/kbh0D0bAZY08l/cM21Z09yYBEz07h5j5Epohr2I8E4rERxDZ9pP72HYRd1Es1ML5T0dIlotkzkkbIPLlv3DoudzEfZCc9o9wnIKYzH9tz/Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3vL1z85zPLYEi37XUl/gthOpeiSSFb9tRVWv6syiwM4=;
 b=bj5KCRs1DSpBfNuKQMEUmlFhgH0PaR+jA3dy8av8+tvMaDjKyJWYtFi1wBrY9+Hvqv7FAXaMI2Ovj4VP6wNOXOI0HqMe78vba4Z6Z+dnowTPFu7jwfVGemHZ1+eV8L9g9eT4mkAvaqi6yI7SNBvGyMQHpAWxJTuQRimqjHD//pCALvt2VTZUMrMsNIGWb0wBIuG9NE38Rd7cc9mZkkuxU0aoxeVN9kRW+Rjf8dsTSY7KKyJ9AVBtd28SccZfuyQsTFCQsy7ZFbFpys1jCiUZTaxWgTXzZKuded09OziKRE0nFq2JRD5D152HY3sPf/A9Stoe8BW6xABb4Y2W/VHemw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <c1a3d447-4b4d-cd9f-642d-e30fed088302@suse.com>
Date: Thu, 20 Jul 2023 07:58:22 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1689604562.git.oleksii.kurochko@gmail.com>
 <8c69050d7b1f42df5e776ca9494164a4d15f2d52.1689604562.git.oleksii.kurochko@gmail.com>
 <ad53c037-3c1b-ff1a-93df-b79ab2948174@suse.com>
 <30540953fb363fce4dfd59f8a7e709247a9872fd.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <30540953fb363fce4dfd59f8a7e709247a9872fd.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0132.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9e::6) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB9709:EE_
X-MS-Office365-Filtering-Correlation-Id: 3f1097d3-9a83-4dd6-4f4d-08db88e654d4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	cWWdfHxNR0n4Rcw6FCS3Shjd2Pef+zvU1zWkfJRUWAE7OcPopf6s4G01j3vIQ/IQcJUfFmSf4XpFApzipNU6pF/zv2S0Vsp5N1AeaYN8dZwuUvMseAuST7jxQe5r2Oc8bz0JT76VuZiy0I8MGumXfiFszw8iGtnnamMVES/LJGqYecRoNqxNIw18yMFbmveEbxJyGR+fd+4Jmm8sQyRVlG1LgieFVN9r2o/FF/Jx7rBQxkrFVRJBcYisH88RNRx+TE0BmPeRJPHYm2gFTmQAh3mcFT3AJlKCIfZBy5Cz8fDfgrWho3E9gvIL0AgLxAM7+sSltdOtBFjQHPQ5kmdopV71x/ve1KQorggFfitX6kGUNMwtzVAZ8qp+5oIQ+SdnfQ6R26bjwxxi692ZhAL7bjWyhWb80j0NK4CTyXkBi7Qx/5/6XJ62524ARigqXBcYQmxx1WuEUKuCHtTjzap5HxHOFnCjWiTP7o7yW6KkGuTgU9j1l6wsnglIZ7o88ATTrWP780f00aivzIJkbE0ew6HsD9RwKhSVPts76SBsHH9BYcmVEp3tlkuWOHQNftK+rzrCfAia2F8+2V7xMWvMwAsuOkagWREdcsgFQcu0pAg13vgm+HZN3rPQLO8Z9Hjja9VJvBoK5L4r1sy7SlrZzg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(366004)(376002)(396003)(136003)(346002)(451199021)(41300700001)(66899021)(2906002)(316002)(8936002)(8676002)(5660300002)(36756003)(86362001)(31696002)(6486002)(6666004)(186003)(54906003)(478600001)(53546011)(6506007)(26005)(6512007)(31686004)(2616005)(38100700002)(66946007)(4326008)(6916009)(66556008)(66476007)(83380400001)(43740500002)(45980500001);DIR:OUT;SFP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FDRkJuN292WEZX?=
 =?utf-8?B?QSs3azdqYkRKVUpzemJoZU9uT1JBRTBHOEYzN1VVa1Zjdi9QNkFYcjQ0Mmc5?=
 =?utf-8?B?aUVZNk4yb01jNWdpYWJ5NjdCUGUvWFp3RytxWHM2MlkxWXIrUi9TeTI5ODIy?=
 =?utf-8?B?eGJyeHdENXdOWlZtQ3BIemxxOXFJUk05ak82c1kvSUh5MlRsOFhQU09pVDdl?=
 =?utf-8?B?cHR3V2hlNUE4ZDJLNi93SHl5OVlqb3RGbUlWQzVrQTJRSnJqcEhRY1JJVnpD?=
 =?utf-8?B?MmdiTExxbUd0Sk14ZWJxMnAxay9Ubm01TTkxVitFK1lrdTFGZDFVMlRCMzQ3?=
 =?utf-8?B?VEd5M0liT1hoaHE0RTBkOGxLWWNFRWhyc2NjTHdrRzF2RG5IeWV1dC95KzdM?=
 =?utf-8?B?LzVPeDVxWldGOUltVitDUnNlRVhLamw0TzhGbkVTYkloOHJlaEVKcm0rc2pJ?=
 =?utf-8?Q?pJ1T3oaMLvDvqPNtpp2Xf8pwM?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3f1097d3-9a83-4dd6-4f4d-08db88e654d4
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 05:58:25.1994
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: WL61Lfus8l64L+HKP+YVlSj4qZlSfor7lAuk0hQjzdGvQkjlavOCIhxKZNFT6hgYUkaIn0wih/Bh0g5OtshdjA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9709

On 19.07.2023 18:35, Oleksii wrote:
> On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote:
>>> +Â Â Â Â Â Â Â Â Â Â Â  unsigned long load_end = LINK_TO_LOAD(_end);
>>> +Â Â Â Â Â Â Â Â Â Â Â  unsigned long pt_level_size = XEN_PT_LEVEL_SIZE(i -
>>> 1);
>>> +Â Â Â Â Â Â Â Â Â Â Â  unsigned long xen_size = ROUNDUP(load_end -
>>> load_start, pt_level_size);
>>> +Â Â Â Â Â Â Â Â Â Â Â  unsigned long page_entries_num = xen_size /
>>> pt_level_size;
>>> +
>>> +Â Â Â Â Â Â Â Â Â Â Â  while ( page_entries_num-- )
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  pgtbl[index++].pte = 0;
>>> +
>>> +Â Â Â Â Â Â Â Â Â Â Â  break;
>>
>> Unless there's a "not crossing a 2Mb boundary" guarantee somewhere
>> that I've missed, this "break" is still too early afaict.
> If I will add a '2 MB boundary check' for load_start and linker_start
> could it be an upstreamable solution?
> 
> Something like:
>     if ( !IS_ALIGNED(load_start, MB(2) )
> 	printk("load_start should be 2Mb algined\n");
> and
>     ASSERT( !IS_ALIGNED(XEN_VIRT_START, MB(2) )
> in xen.lds.S.

Arranging for the linked address to be 2Mb-aligned is certainly
reasonable. Whether expecting the load address to also be depends
on whether that can be arranged for (which in turn depends on boot
loader behavior); it cannot be left to "luck".

> Then we will have completely different L0 tables for identity mapping
> and not identity and the code above will be correct.

As long as Xen won't grow beyond 2Mb total. Considering that at
some point you may want to use large page mappings for .text,
.data, and .rodata, that alone would grow Xen to 6 Mb (or really 8,
assuming .init goes separate as well). That's leaving aside the
realistic option of the mere sum of all sections being larger than
2. That said, even Arm64 with ACPI is still quite a bit below 2Mb.
x86 is nearing 2.5 though in even a somewhat limited config;
allyesconfig may well be beyond that already.

Of course you may legitimately leave dealing with that to the
future.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 06:32:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 06:32:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566338.885047 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMND2-0007R8-AX; Thu, 20 Jul 2023 06:32:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566338.885047; Thu, 20 Jul 2023 06:32:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMND2-0007R1-7h; Thu, 20 Jul 2023 06:32:20 +0000
Received: by outflank-mailman (input) for mailman id 566338;
 Thu, 20 Jul 2023 06:32:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6Xo+=DG=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMND1-0007Qv-0A
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 06:32:19 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0615.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::615])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2bd6a6c3-26c7-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 08:32:17 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8392.eurprd04.prod.outlook.com (2603:10a6:102:1c5::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul
 2023 06:32:15 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 06:32:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2bd6a6c3-26c7-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=e93HzS+mEEZj0k7tFoD+ijA6gv5hqIvEkd6sJlW04lf546/pMvOtKmcA83JkuG/klvJB18glQkk+aI4Vu3T5F1AxFeuwYjRj900J/L3aHqu/NarfNArMBhpbdJkzpAt75lIXtJlom25byUf/eaMHxb0rl8+g9uZkxKknVpgryzqZ2W6no7DHjo3WPRvj+NudRMRgg1U9SGrmtEYqkgavEIsnpaJb01uCJTYSoKUXw7RBgIwUfQvmDLMzx92AzljDUWvVtQf3ChHrMifEEnQxZLg+mt2shV37a9h2sBrV4f0De0IrkcDWGNfLGwkBKaHo+MoeV8b38a8NyLxeofY19g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/QrQlmWNReCfKkSixbiF3LTUVtYE7p21S9RunLoKOpE=;
 b=a3UzlQrKoWF2mwPJYpSNuuVIx0ZXgVOanUuPuGzrmTsA4gkzQ1Ya7zWNXduHAQd/Cq4RG/pvSIm+g9Vh3DVX4xz6A0SJfx9XF9Rg2W3SPBJC/2HuODut1VmxKQ5d1yLeb9j+DA7szLfGKQYs5KGRkTpckm/VU6efM0ocpBgzgD0oVlRX8WVg2W11Y8zZNeX1lRuYNraNLR6var/+2fNvwjRiTLOMCa8rCVGT9HDeij6yeWJNOGkKf7CJl93zQcUAv7Ck/KPcX86e6GD5Kq70sSNf0fZROpnGMOG82VvNFZCFOIBmsxUCNbBK4bquToVdkb2qxFeM4v00zS3GbKaiJQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/QrQlmWNReCfKkSixbiF3LTUVtYE7p21S9RunLoKOpE=;
 b=a5blqF8hLMZmwNgawn9DOCvLdI+e1wf3ztCqKtjAEuHByX8ONXN5NuP4oUPk2nMcDqCLY4YCVfZD4nl9Pj9WWWqzyZxkhNGnERnVYyzHqZ8nnT8mDyg1fomDzYw3xfVPKdovqENx0voroNE2F0IOlkzK40ZsNCrhLLakMgOBNC5s9WNA+mdzj1nEjjHmzjObGKHohi6KwOT+HNueui22V25BbXsfNuOYTIXNlBT2P+zpFPqtFBRIiiR3CpxiYM0FYmO3YNvwExFKHAU3g8Mk3HOS7ppd/ejDl9u+b+8OnC+xbHQt5b2K8/Gyx7+45BN/e13rUI35jBfLoD2njjYujg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <898997ee-3a43-da37-9eb4-f78b34d9fb5b@suse.com>
Date: Thu, 20 Jul 2023 08:32:12 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 2/5] x86/ioapic: RTE modifications must use
 ioapic_write_entry
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230718124334.36548-1-roger.pau@citrix.com>
 <20230718124334.36548-3-roger.pau@citrix.com>
 <1bc67bb2-9b01-eb18-eb6a-741067a9b35c@suse.com>
 <ZLf_OJnYjyirT7Ee@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZLf_OJnYjyirT7Ee@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0110.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9c::20) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8392:EE_
X-MS-Office365-Filtering-Correlation-Id: 009bbd39-f91e-4550-0f66-08db88eb0eab
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Pva/wVMwz2XLkS7tqP70IrN2h8mya2F+XINcKfZW3uKY+II6/Kbt0GBEeWWLruEovTfuiT2nKAHcNhOQxnkYbVi14wG0KOYeIFIUZv8QxtYzD3MnbzpY3GTWODjcsT69nHfTzMSvZlyKE3zEMGtBwYVGef762PurDHpHFcLCGd/Lpdl3COkmI/kFpwcpj9TOv2Z3EolUPBiZdOOSuTiHxa/bjBi3kIGq4bZJvJ9BgIOl4oLm9lSSvKG1ypCEvP0AxXX7AQozMU515tCqoRv/HnX5BrwDui5UeetqCeObyC1x4XKBXrn17v6+mc60X61TA951DThCif3qg9kfNh7X9SZfkGzTmzW1kYydD3oPPARdky523rIlLL6S19c9pnIqXZfrDhgJF3fC6dMsfcQ9mJQ2j1OHVUuQVuH6Sw/t/YthigRsDwcrtfl75PpIx3orqxv2PB4JwNkGVvSIsi6tKTWKweWLJipwnaGbYfbnF4sFTtsFT/tre0QyzXg7l4OeYISW+jMaSWA1GF8p7nWJ18GF1bOQ/9WZ0/8k5zPPf3jyAPTKyLkeKZmKjWQ/M7ZWzxzSKBq3FF/77AzzRksfe9RFJB4LN5idPLtFkDe4DHNGfr+nh4iIHALWNlLhTKI7c/y7J8Hg+FRL1CeWcrb/Qg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(136003)(39860400002)(396003)(346002)(451199021)(6486002)(478600001)(54906003)(26005)(53546011)(186003)(6506007)(6512007)(2906002)(66946007)(66476007)(4326008)(5660300002)(8676002)(316002)(6916009)(8936002)(66556008)(38100700002)(41300700001)(86362001)(36756003)(83380400001)(2616005)(31696002)(31686004)(66899021)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?S2dCdnovWTB2T3RtOFpPMVM5eVQwVTRGUEJSc2s1OEhXRVpiaXBRcTkrQ0hS?=
 =?utf-8?B?aGxiSUpNTzdTUGFpUUl1M2FCNjlRNXM3T1ZzY3JlNjBnV3cwSHo0NEw2WUhK?=
 =?utf-8?B?OElCYWtidEtIUERRN1FoTkpsbE5rZ1NtekU1OXR3MTYxTDA3UVU0TmVCVER1?=
 =?utf-8?B?R0VONWZkMkRWcUVDa1k3Tmp0blRrYkhPL2JMR0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dUo1TUkrUDFqSFFCN293bmFLQ1paUWJNNE5rd3lpTUdJZklOUEdDUEdv?=
 =?utf-8?B?bHdBdzROclBPeVhhQzh0WHlHcElkUHVEUUVvbHk2cUY3dzFVVjg2WVRremNO?=
 =?utf-8?B?Z3BJNVlhNFdmYmp0by9UK0dobTZJZ1VocnBza2lMQmpiRE9FazgwUEJ3SEJM?=
 =?utf-8?Q?qwo5Wjxvmqc6jHdS7FDrVZVmT?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 009bbd39-f91e-4550-0f66-08db88eb0eab
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 06:32:14.9089
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: XTV6h0eGLfhEr3cYN/HyBgO/6FFkOgPG8qoX28W/BObeISrjSrKiNwL90MAgjavyf8Cq4K+cLvskYmQrRgLa8g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8392

On 19.07.2023 17:20, Roger Pau MonnÃ© wrote:
> On Tue, Jul 18, 2023 at 05:40:18PM +0200, Jan Beulich wrote:
>> On 18.07.2023 14:43, Roger Pau Monne wrote:
>>> --- a/xen/arch/x86/io_apic.c
>>> +++ b/xen/arch/x86/io_apic.c
>>> @@ -269,15 +269,15 @@ void __ioapic_write_entry(
>>>  {
>>>      union entry_union eu = { .entry = e };
>>>  
>>> -    if ( raw )
>>> +    if ( raw || !iommu_intremap )
>>>      {
>>>          __io_apic_write(apic, 0x11 + 2 * pin, eu.w2);
>>>          __io_apic_write(apic, 0x10 + 2 * pin, eu.w1);
>>>      }
>>>      else
>>>      {
>>> -        io_apic_write(apic, 0x11 + 2 * pin, eu.w2);
>>> -        io_apic_write(apic, 0x10 + 2 * pin, eu.w1);
>>> +        iommu_update_ire_from_apic(apic, 0x11 + 2 * pin, eu.w2);
>>> +        iommu_update_ire_from_apic(apic, 0x10 + 2 * pin, eu.w1);
>>>      }
>>>  }
>>
>> I think __ioapic_read_entry() wants updating similarly, so that both
>> remain consistent.
> 
> My plan was to deal with __ioapic_read_entry() separately, as I would
> also like to convert iommu_read_apic_from_ire() to get passed a pin
> instead of a register, but I could make your requested adjustment here
> for consistency with __ioapic_write_entry().

I would indeed prefer if you did, to avoid the functions going out of
sync.

>>> @@ -433,16 +433,17 @@ static void modify_IO_APIC_irq(unsigned int irq, unsigned int enable,
>>>                                 unsigned int disable)
>>>  {
>>>      struct irq_pin_list *entry = irq_2_pin + irq;
>>> -    unsigned int pin, reg;
>>>  
>>>      for (;;) {
>>> -        pin = entry->pin;
>>> +        unsigned int pin = entry->pin;
>>> +        struct IO_APIC_route_entry rte;
>>> +
>>>          if (pin == -1)
>>>              break;
>>> -        reg = io_apic_read(entry->apic, 0x10 + pin*2);
>>> -        reg &= ~disable;
>>> -        reg |= enable;
>>> -        io_apic_modify(entry->apic, 0x10 + pin*2, reg);
>>> +        rte = __ioapic_read_entry(entry->apic, pin, false);
>>> +        rte.raw &= ~(uint64_t)disable;
>>> +        rte.raw |= enable;
>>> +        __ioapic_write_entry(entry->apic, pin, false, rte);
>>
>> While this isn't going to happen overly often, ...
>>
>>> @@ -584,16 +585,16 @@ set_ioapic_affinity_irq(struct irq_desc *desc, const cpumask_t *mask)
>>>              dest = SET_APIC_LOGICAL_ID(dest);
>>>          entry = irq_2_pin + irq;
>>>          for (;;) {
>>> -            unsigned int data;
>>> +            struct IO_APIC_route_entry rte;
>>> +
>>>              pin = entry->pin;
>>>              if (pin == -1)
>>>                  break;
>>>  
>>> -            io_apic_write(entry->apic, 0x10 + 1 + pin*2, dest);
>>> -            data = io_apic_read(entry->apic, 0x10 + pin*2);
>>> -            data &= ~IO_APIC_REDIR_VECTOR_MASK;
>>> -            data |= MASK_INSR(desc->arch.vector, IO_APIC_REDIR_VECTOR_MASK);
>>> -            io_apic_modify(entry->apic, 0x10 + pin*2, data);
>>> +            rte = __ioapic_read_entry(entry->apic, pin, false);
>>> +            rte.dest.dest32 = dest;
>>> +            rte.vector = desc->arch.vector;
>>> +            __ioapic_write_entry(entry->apic, pin, false, rte);
>>
>> ... this makes me wonder whether there shouldn't be an
>> __ioapic_modify_entry() capable of suppressing one of the two
>> writes (but still being handed the full RTE).
> 
> We would then need the original RTE to be passed to
> __ioapic_modify_entry() in order for it to decide whether one of the
> accesses can be eliminated (as I don't think we want to read the RTE
> to check for differences, as we would then perform even more
> accesses).

I was actually thinking of a 2-bit hint that the caller would pass:
Low half unmodified and high half unmodified.

> This would only be relevant for systems without IOMMU IRTEs, as
> otherwise the IO-APIC RTE gets modified by the IOMMU handlers.

Initially yes. I think there's room there to avoid one half of the
write as well.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 06:38:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 06:38:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566342.885058 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMNIS-0008Po-1I; Thu, 20 Jul 2023 06:37:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566342.885058; Thu, 20 Jul 2023 06:37:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMNIR-0008Ph-Us; Thu, 20 Jul 2023 06:37:55 +0000
Received: by outflank-mailman (input) for mailman id 566342;
 Thu, 20 Jul 2023 06:37:54 +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 <SRS0=o8fF=DG=lst.de=hch@srs-se1.protection.inumbo.net>)
 id 1qMNIQ-0008Pb-2r
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 06:37:54 +0000
Received: from verein.lst.de (verein.lst.de [213.95.11.211])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f1af9e55-26c7-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 08:37:49 +0200 (CEST)
Received: by verein.lst.de (Postfix, from userid 2407)
 id 6AB1267373; Thu, 20 Jul 2023 08:37:44 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f1af9e55-26c7-11ee-8611-37d641c3527e
Date: Thu, 20 Jul 2023 08:37:44 +0200
From: Christoph Hellwig <hch@lst.de>
To: Petr Tesarik <petrtesarik@huaweicloud.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>, James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	"moderated list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>,
	"moderated list:ARM PORT" <linux-arm-kernel@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:MIPS" <linux-mips@vger.kernel.org>,
	"open list:XEN SWIOTLB SUBSYSTEM" <iommu@lists.linux.dev>,
	Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>, petr@tesarici.cz
Subject: Re: [PATCH v4 1/8] swiotlb: make io_tlb_default_mem local to
 swiotlb.c
Message-ID: <20230720063744.GA3842@lst.de>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com> <7f64111986f4f361a2deb4a1a1b6f588e63a851b.1689261692.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <7f64111986f4f361a2deb4a1a1b6f588e63a851b.1689261692.git.petr.tesarik.ext@huawei.com>
User-Agent: Mutt/1.5.17 (2007-11-01)

On Thu, Jul 13, 2023 at 05:23:12PM +0200, Petr Tesarik wrote:
> From: Petr Tesarik <petr.tesarik.ext@huawei.com>
> 
> SWIOTLB implementation details should not be exposed to the rest of the
> kernel. This will allow to make changes to the implementation without
> modifying non-swiotlb code.
> 
> To avoid breaking existing users, provide helper functions for the few
> required fields.
> 
> As a bonus, using a helper function to initialize struct device allows to
> get rid of an #ifdef in driver core.
> 
> Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
> ---
>  arch/arm/xen/mm.c          |  2 +-
>  arch/mips/pci/pci-octeon.c |  2 +-
>  arch/x86/kernel/pci-dma.c  |  2 +-
>  drivers/base/core.c        |  4 +---
>  drivers/xen/swiotlb-xen.c  |  2 +-
>  include/linux/swiotlb.h    | 25 +++++++++++++++++++++++-
>  kernel/dma/swiotlb.c       | 39 +++++++++++++++++++++++++++++++++++++-
>  7 files changed, 67 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c
> index 3d826c0b5fee..0f32c14eb786 100644
> --- a/arch/arm/xen/mm.c
> +++ b/arch/arm/xen/mm.c
> @@ -125,7 +125,7 @@ static int __init xen_mm_init(void)
>  		return 0;
>  
>  	/* we can work with the default swiotlb */
> -	if (!io_tlb_default_mem.nslabs) {
> +	if (!is_swiotlb_allocated()) {
>  		rc = swiotlb_init_late(swiotlb_size_or_default(),
>  				       xen_swiotlb_gfp(), NULL);
>  		if (rc < 0)

I'd much rather move the already initialized check into
swiotlb_init_late, which is a much cleaer interface.

>  	/* we can work with the default swiotlb */
> -	if (!io_tlb_default_mem.nslabs) {
> +	if (!is_swiotlb_allocated()) {
>  		int rc = swiotlb_init_late(swiotlb_size_or_default(),
>  					   GFP_KERNEL, xen_swiotlb_fixup);
>  		if (rc < 0)

.. and would take care of this one as well.

> +bool is_swiotlb_allocated(void)
> +{
> +	return !!io_tlb_default_mem.nslabs;

Nit: no need for the !!, we can rely on the implicit promotion to
bool.  But with the suggestion above the need for this helper
should go away anyway.


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 06:38:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 06:38:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566349.885067 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMNIu-0000SV-9K; Thu, 20 Jul 2023 06:38:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566349.885067; Thu, 20 Jul 2023 06:38:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMNIu-0000SO-6P; Thu, 20 Jul 2023 06:38:24 +0000
Received: by outflank-mailman (input) for mailman id 566349;
 Thu, 20 Jul 2023 06:38:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=o8fF=DG=lst.de=hch@srs-se1.protection.inumbo.net>)
 id 1qMNIt-0000Ks-1J
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 06:38:23 +0000
Received: from verein.lst.de (verein.lst.de [213.95.11.211])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0524f0c6-26c8-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 08:38:22 +0200 (CEST)
Received: by verein.lst.de (Postfix, from userid 2407)
 id B78E368AFE; Thu, 20 Jul 2023 08:38:19 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0524f0c6-26c8-11ee-b23a-6b7b168915f2
Date: Thu, 20 Jul 2023 08:38:19 +0200
From: Christoph Hellwig <hch@lst.de>
To: Petr Tesarik <petrtesarik@huaweicloud.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>, James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	"moderated list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>,
	"moderated list:ARM PORT" <linux-arm-kernel@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:MIPS" <linux-mips@vger.kernel.org>,
	"open list:XEN SWIOTLB SUBSYSTEM" <iommu@lists.linux.dev>,
	Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>, petr@tesarici.cz
Subject: Re: [PATCH v4 2/8] swiotlb: add documentation and rename
 swiotlb_do_find_slots()
Message-ID: <20230720063819.GB3842@lst.de>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com> <11826bfbc148771ab36d0b485558aa52cbdd204f.1689261692.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <11826bfbc148771ab36d0b485558aa52cbdd204f.1689261692.git.petr.tesarik.ext@huawei.com>
User-Agent: Mutt/1.5.17 (2007-11-01)

On Thu, Jul 13, 2023 at 05:23:13PM +0200, Petr Tesarik wrote:
> From: Petr Tesarik <petr.tesarik.ext@huawei.com>
> 
> Add some kernel-doc comments and move the existing documentation of struct
> io_tlb_slot to its correct location. The latter was forgotten in commit
> 942a8186eb445 ("swiotlb: move struct io_tlb_slot to swiotlb.c").
> 
> Use the opportunity to give swiotlb_do_find_slots() a more descriptive
> name, which makes it clear how it differs from swiotlb_find_slots().

Please keep the swiotlb_ prefix.  Otherwise this looks good to me.



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 06:48:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 06:48:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566356.885078 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMNS4-00023k-5p; Thu, 20 Jul 2023 06:47:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566356.885078; Thu, 20 Jul 2023 06:47:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMNS4-00023d-2b; Thu, 20 Jul 2023 06:47:52 +0000
Received: by outflank-mailman (input) for mailman id 566356;
 Thu, 20 Jul 2023 06:47:51 +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 <SRS0=o8fF=DG=lst.de=hch@srs-se1.protection.inumbo.net>)
 id 1qMNS2-00023E-W1
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 06:47:50 +0000
Received: from verein.lst.de (verein.lst.de [213.95.11.211])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 574897e2-26c9-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 08:47:49 +0200 (CEST)
Received: by verein.lst.de (Postfix, from userid 2407)
 id 0C93467373; Thu, 20 Jul 2023 08:47:45 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 574897e2-26c9-11ee-8611-37d641c3527e
Date: Thu, 20 Jul 2023 08:47:44 +0200
From: Christoph Hellwig <hch@lst.de>
To: Petr Tesarik <petrtesarik@huaweicloud.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>, James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	"moderated list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>,
	"moderated list:ARM PORT" <linux-arm-kernel@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:MIPS" <linux-mips@vger.kernel.org>,
	"open list:XEN SWIOTLB SUBSYSTEM" <iommu@lists.linux.dev>,
	Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>, petr@tesarici.cz
Subject: Re: [PATCH v4 8/8] swiotlb: search the software IO TLB only if a
 device makes use of it
Message-ID: <20230720064744.GA4395@lst.de>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com> <a8d31d3fffa0867dce2b44b98dc2714289edfdc9.1689261692.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <a8d31d3fffa0867dce2b44b98dc2714289edfdc9.1689261692.git.petr.tesarik.ext@huawei.com>
User-Agent: Mutt/1.5.17 (2007-11-01)

Any reason this can't just do a list_empty_careful on the list
instead of adding yet another field that grows struct device?


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 06:50:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 06:50:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566363.885088 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMNU9-0002wT-I4; Thu, 20 Jul 2023 06:50:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566363.885088; Thu, 20 Jul 2023 06:50:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMNU9-0002wM-FN; Thu, 20 Jul 2023 06:50:01 +0000
Received: by outflank-mailman (input) for mailman id 566363;
 Thu, 20 Jul 2023 06:50:00 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMNU8-0002wA-4l; Thu, 20 Jul 2023 06:50:00 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMNU7-0003DG-RR; Thu, 20 Jul 2023 06:49:59 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMNU7-0002Xy-Eb; Thu, 20 Jul 2023 06:49:59 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMNU7-00057P-E3; Thu, 20 Jul 2023 06:49:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=piB3ZBUDtOPrF2lCAGPF0ozRGgywbU09xyXoBDRZAMQ=; b=RZ2UeBRNrNU9WfNdUIhQBuEAIF
	Tje6VmVze7ie0Yc5GCd703nLTxMVZNLqxMRs+qM2otDwD74fziqy/d4qb336CgnOAhH/J8RQSazOx
	Cuy7YT8Zt+xb92bAiW4kzN+WQUJnN5ghSa3uv2BFWwlx6u5IASVmo6653aTqis2FRwz8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181901-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 181901: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-i386-libvirt-pair:xen-install/src_host:fail:regression
    qemu-mainline:test-amd64-i386-libvirt-pair:xen-install/dst_host:fail:regression
    qemu-mainline:test-amd64-i386-xl-vhd:guest-localmigrate/x10:fail:regression
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=7a0adc3e05c2bb1cfd450cb73a6da6f7de9ce3f4
X-Osstest-Versions-That:
    qemuu=6972ef1440a9d685482d78672620a7482f2bd09a
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 20 Jul 2023 06:49:59 +0000

flight 181901 qemu-mainline real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181901/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-libvirt-pair 10 xen-install/src_host     fail REGR. vs. 180691
 test-amd64-i386-libvirt-pair 11 xen-install/dst_host     fail REGR. vs. 180691
 test-amd64-i386-xl-vhd       19 guest-localmigrate/x10   fail REGR. vs. 180691

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 180691
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 180691
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 180691
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180691
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 180691
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 180691
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180691
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180691
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass

version targeted for testing:
 qemuu                7a0adc3e05c2bb1cfd450cb73a6da6f7de9ce3f4
baseline version:
 qemuu                6972ef1440a9d685482d78672620a7482f2bd09a

Last test of basis   180691  2023-05-17 10:45:22 Z   63 days
Failing since        180699  2023-05-18 07:21:24 Z   62 days  126 attempts
Testing same since   181901  2023-07-19 14:37:22 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Afonso Bordado <afonsobordado@gmail.com>
  Akihiko Odaki <akihiko.odaki@daynix.com>
  Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
  Alex BennÃ©e <alex.bennee@linaro.org>
  Alex Williamson <alex.williamson@redhat.com>
  Alexander Bulekov <alxndr@bu.edu>
  Alexander Graf <graf@amazon.com>
  Alexander Ivanov <alexander.ivanov@virtuozzo.com>
  Alistair Francis <alistair.francis@wdc.com>
  Anastasia Belova <abelova@astralinux.ru>
  Andrea Bolognani <abologna@redhat.com>
  Andreas Schwab <schwab@suse.de>
  Andrew Jeffery <andrew@aj.id.au>
  Andrew Melnychenko <andrew@daynix.com>
  Ani Sinha <ani@anisinha.ca>
  Ani Sinha <anisinha@redhat.com>
  Anthony PERARD <anthony.perard@citrix.com>
  Anton Johansson <anjo@rev.ng>
  Antonio Caggiano <quic_acaggian@quicinc.com>
  Avihai Horon <avihaih@nvidia.com>
  BALATON Zoltan <balaton@eik.bme.hu>
  Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
  Bernhard Beschow <shentey@gmail.com>
  Bilal Elmoussaoui <belmouss@redhat.com>
  Bin Meng <bin.meng@windriver.com>
  Bin Meng <bmeng@tinylab.org>
  Brian Cain <bcain@quicinc.com>
  Brice Goglin <Brice.Goglin@inria.fr>
  Camilla Conte <cconte@redhat.com>
  Carlos Santos <casantos@redhat.com>
  Chen Baozi <chenbaozi@phytium.com.cn>
  Christian Borntraeger <borntraeger@linux.ibm.com>
  Christian Schoenebeck <qemu_oss@crudebyte.com>
  Christoph Muellner <christoph.muellner@vrull.eu>
  Christoph MÃ¼llner <christoph.muellner@vrull.eu>
  Chuck Zmudzinski <brchuckz@aol.com>
  Cindy Lu <lulu@redhat.com>
  ClÃ©ment Chigot <chigot@adacore.com>
  Corey Minyard <cminyard@mvista.com>
  Cornelia Huck <cohuck@redhat.com>
  CÃ©dric Le Goater <clg@kaod.org>
  CÃ©dric Le Goater <clg@redhat.com>
  Daniel Bertalan <dani@danielbertalan.dev>
  Daniel Henrique Barboza <danielhb413@gmail.com>
  Daniel Henrique Barboza <dbarboza@ventanamicro.com>
  Daniel P. BerrangÃ© <berrange@redhat.com>
  Daniil Kovalev <dkovalev@compiler-toolchain-for.me>
  David Hildenbrand <david@redhat.com>
  David Woodhouse <dwmw@amazon.co.uk>
  Dongwon Kim <dongwon.kim@intel.com>
  Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
  Enze Li <lienze@kylinos.cn>
  Eric Auger <eric.auger@redhat.com>
  Eric Blake <eblake@redhat.com>
  Eric DeVolder <eric.devolder@oracle.com>
  Erico Nunes <ernunes@redhat.com>
  Erik Skultety <eskultet@redhat.com>
  Eugenio PÃ©rez <eperezma@redhat.com>
  Fabiano Rosas <farosas@suse.de>
  Fan Ni <fan.ni@samsung.com>
  Fei Wu <fei2.wu@intel.com>
  Fiona Ebner <f.ebner@proxmox.com>
  Francesco Cagnin <fcagnin@quarkslab.com>
  Francisco Iglesias <frasse.iglesias@gmail.com>
  Frederic Barrat <fbarrat@linux.ibm.com>
  Gavin Shan <gshan@redhat.com>
  Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
  Gregory Price <gourry.memverge@gmail.com>
  Gregory Price <gregory.price@memverge.com>
  Guenter Roeck <linux@roeck-us.net>
  Hanna Czenczek <hreitz@redhat.com>
  Hao Zeng <zenghao@kylinos.cn>
  Hawkins Jiawei <yin31149@gmail.com>
  Helge Deller <deller@gmx.de>
  Henrik Carlqvist <hc1245@poolhem.se>
  Henrik Carlqvist <hc981@poolhem.se>
  Himanshu Chauhan <hchauhan@ventanamicro.com>
  Igor Mammedov <imammedo@redhat.com>
  Ilya Leoshkevich <iii@linux.ibm.com>
  Ira Weiny <ira.weiny@intel.com>
  Isaku Yamahata <isaku.yamahata@intel.com>
  Ivan Klokov <ivan.klokov@syntacore.com>
  Jagannathan Raman <jag.raman@oracle.com>
  Jan Kratochvil <jan@jankratochvil.net>
  Jason Chien <jason.chien@sifive.com>
  Jason Wang <jasowang@redhat.com>
  Jean-Louis Dupond <jean-louis@dupond.be>
  Jean-Philippe Brucker <jean-philippe@linaro.org>
  Jiajie Chen <c@jia.je>
  Jiaxun Yang <jiaxun.yang@flygoat.com>
  Joao Martins <joao.m.martins@oracle.com>
  Joel Stanley <joel@jms.id.au>
  John HÃ¶gberg <john.hogberg@ericsson.com>
  John Snow <jsnow@redhat.com>
  Jonathan Cameron <Jonathan.Cameron@huawei.com>
  Juan Quintela <quintela@redhat.com>
  Junqiang Wang <wangjunqiang@iscas.ac.cn>
  Keqian Zhu <zhukeqian1@huawei.com>
  Kevin Wolf <kwolf@redhat.com>
  Klaus Jensen <k.jensen@samsung.com>
  Konstantin Kostiuk <kkostiuk@redhat.com>
  Lakshmi Bai Raja Subramanian <lakshmi.bai.rajasubramanian@bodhicomputing.com>
  Laszlo Ersek <lersek@redhat.com>
  Laurent Vivier <laurent@vivier.eu>
  Laurent Vivier <lvivier@redhat.com>
  Lei Wang <lei4.wang@intel.com>
  Lei Yang <leiyang@redhat.com>
  Leonardo Bras <leobras@redhat.com>
  LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
  Lucas Dietrich <ld.adecy@gmail.com>
  Lukas Doktor <ldoktor@redhat.com>
  Mads Ynddal <m.ynddal@samsung.com>
  Maksim Davydov <davydov-max@yandex-team.ru>
  Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
  Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
  Marcelo Tosatti <mtosatti@redhat.com>
  Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
  Marcin Nowakowski <marcin.nowakowski@fungible.com>
  Marco Liebel <quic_mliebel@quicinc.com>
  Mario Casquero <mcasquer@redhat.com>
  Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Markus Armbruster <armbru@redhat.com>
  Martin Kaiser <martin@kaiser.cx>
  Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
  Mattias Nissler <mnissler@rivosinc.com>
  Mauro Matteo Cascella <mcascell@redhat.com>
  Max Chou <max.chou@sifive.com>
  Max Filippov <jcmvbkbc@gmail.com>
  Max Fritz <antischmock@googlemail.com>
  Mayuresh Chitale <mchitale@ventanamicro.com>
  Michael S. Tsirkin <mst@redhat.com>
  Michael Tokarev <mjt@tls.msk.ru>
  Michal Privoznik <mprivozn@redhat.com>
  Milan Zamazal <mzamazal@redhat.com>
  Minwoo Im <minwoo.im@samsung.com>
  Mostafa Saleh <smostafa@google.com>
  Narayana Murty N <nnmlinux@linux.ibm.com>
  Nicholas Piggin <npiggin@gmail.com>
  Nicolas Saenz Julienne <nsaenz@amazon.com>
  Niek Linnenbank <nieklinnenbank@gmail.com>
  Niklas Cassel <niklas.cassel@wdc.com>
  Ninad Palsule <ninad@linux.ibm.com>
  Olaf Hering <olaf@aepfle.de>
  Palmer Dabbelt <palmer@rivosinc.com>
  Paolo Bonzini <pbonzini@redhat.com>
  Patrick Venture <venture@google.com>
  Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
  Peng Liang <tcx4c70@gmail.com>
  Peter Maydell <peter.maydell@linaro.org>
  Peter Xu <peterx@redhat.com>
  Philippe Mathieu-DaudÃ© <philmd@linaro.org>
  Philippe Mathieu-DaudÃ© <philmd@redhat.com>
  Pierrick Bouvier <pierrick.bouvier@linaro.org>
  Prasad Pandit <pjp@fedoraproject.org>
  qianfan Zhao <qianfanguijin@163.com>
  Raghu H <raghuhack78@gmail.com>
  Rene Engel <ReneEngel80@emailn.de>
  Richard Henderson <richard.henderson@linaro.org>
  Richard Purdie <richard.purdie@linuxfoundation.org>
  Richard W.M. Jones <rjones@redhat.com>
  Ricky Zhou <ricky@rzhou.org>
  Robbin Ehn <rehn@rivosinc.com>
  Robin Voetter <robin@streamhpc.com>
  Ryan Wendland <wendland@live.com.au>
  Sebastian Ott <sebott@redhat.com>
  Sergey Kambalin <sergey.kambalin@auriga.com>
  Sergio Lopez <slp@redhat.com>
  Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
  Shashi Mallela <shashi.mallela@linaro.org>
  Siarhei Volkau <lis8215@gmail.com>
  Sid Manning <sidneym@quicinc.com>
  Siqi Chen <coc.cyqh@gmail.com>
  Song Gao <gaosong@loongson.cn>
  Stefan Berger <stefanb@linux.ibm.com>
  Stefan Hajnoczi <stefanha@redhat.com>
  Stefano Garzarella <sgarzare@redhat.com>
  Stefano Stabellini <sstabellini@kernel.org>
  Stefano Stabellini <stefano.stabellini@amd.com>
  Steve Sistare <steven.sistare@oracle.com>
  Sunil V L <sunilvl@ventanamicro.com>
  Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
  Tao Su <tao1.su@linux.intel.com>
  Taylor Simpson <tsimpson@quicinc.com>
  Tested-By: Solra Bizna <solra@bizna.name>
  Thomas Huth <thuth@redhat.com>
  Thomas WeiÃŸschuh <thomas@t-8ch.de>
  Tianrui Zhao <zhaotianrui@loongson.cn>
  timothee.cocault@gmail.com <timothee.cocault@gmail.com>
  TimothÃ©e Cocault <timothee.cocault@gmail.com>
  Tom Lonergan <tom.lonergan@nutanix.com>
  Tommy Wu <tommy.wu@sifive.com>
  Tong Ho <tong.ho@amd.com>
  Tony Krowiak <akrowiak@linux.ibm.com>
  Vanderson M. do Rosario <vandersonmr2@gmail.com>
  Vikram Garhwal <vikram.garhwal@amd.com>
  Viktor Prutyanov <viktor@daynix.com>
  Vitaly Cheptsov <cheptsov@ispras.ru>
  Vivek Kasireddy <vivek.kasireddy@intel.com>
  Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
  Volker RÃ¼melin <vr_qemu@t-online.de>
  Wang Yuquan <wangyuquan1236@phytium.com.cn>
  Weiwei Li <liweiwei@iscas.ac.cn>
  Xiao Wang <xiao.w.wang@intel.com>
  Xinyu Li <lixinyu20s@ict.ac.cn>
  Xuelian Guo <xuelian.guo@intel.com>
  Yang Zhang <yang.zhang@hexintek.com>
  yang.zhang <yang.zhang@hexintek.com>
  YangHang Liu <yanghliu@redhat.com>
  Yin Wang <yin.wang@intel.com>
  Yuquan Wang <wangyuquan1236@phytium.com.cn>
  Zeng Hao <zenghao@kylinos.cn>
  Zhang Huasen <huasenzhang@foxmail.com>
  Zhao Liu <zhao1.liu@intel.com>
  zhenwei pi <pizhenwei@bytedance.com>
  Zhenyu Zhang <zhenyzha@redhat.com>
  Zhenzhong Duan <zhenzhong.duan@intel.com>
  Zhuojia Shen <chaosdefinition@hotmail.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 fail    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 38014 lines long.)


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 06:51:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 06:51:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566369.885097 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMNV9-0004N1-2B; Thu, 20 Jul 2023 06:51:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566369.885097; Thu, 20 Jul 2023 06:51:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMNV8-0004Mu-Ve; Thu, 20 Jul 2023 06:51:02 +0000
Received: by outflank-mailman (input) for mailman id 566369;
 Thu, 20 Jul 2023 06:51:01 +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 <SRS0=6Xo+=DG=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMNV7-0004Ma-9Y
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 06:51:01 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on20615.outbound.protection.outlook.com
 [2a01:111:f400:fe16::615])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c8336724-26c9-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 08:50:59 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB8PR04MB6812.eurprd04.prod.outlook.com (2603:10a6:10:f8::21) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Thu, 20 Jul
 2023 06:50:56 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 06:50:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c8336724-26c9-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=auBNnELcrwK514pEalxTVhNwaf0pwymzwhjUnkaK7fTQbSGYz6EIH5UJzPxdQ/ppgbL+4tBO76t3RAzmf8rFHcvLHDppqF6P1tJ+mXs8cw9scrQeB8vmRpAagglW17l46RB4B4y723FuwepTWewFO+7apMaZ4tlOX6N/iy+4LNWYNpdz1OfEV+IFC5chThSi8s8orcV+2KukU7nNaJ7Uh5radxlXkullkU8hRhJge0ma0WghoeXfeuooMWVGaulGCMLSJNVGW6fRe1Qcvn8WE/ws9SRva5xoqCrlwJi5AoHJ5Q9+tNfekKZsmbK/EJZOkZA+AzdlDjVnntskhRLNWg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=mzPCDQ1G5kYuVruJltocpsHaYbMhVh5OnzVCm18QlOA=;
 b=oc9A6UJ+qJVztLb3QQyWVRCpwSnYeYDT/itVgHJErnxjlaEKh9f4gGsJ+MGpprf6q10J9L/a7KvpkKyMKoh540lQ9r1TfEh4pAApeLKDRyelDxlYICUfoXZuanaKHIpKkG8VM2G0Z62R278hNrodv6ILHSUqV4+vXQxziv8esm0DEqi6fZhCC8UOUFRUDUFfti5wD8fC8BcSrAz2gV8bpos9ytpvEMLV9A1l9i0xE2hS89L2xibyC+HWWzwlxVd59KlXp/F53pBKt0QR9Yx8ZSjpowul5GnskYOBEvWkySUr9+KhnPEMTPYIr6k+T6yteIMZSAuNWEgsIHXmhO1bMg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=mzPCDQ1G5kYuVruJltocpsHaYbMhVh5OnzVCm18QlOA=;
 b=VeQngbPU6ydAJnbUoZcqueJuYbrjlE7YKZRkbpTlyzAkeReKF8mggZwg72q4DufppH6Dp/JwpRzXjmsplKN3DUC0WPzZaANNGvffvBH/fV3fuaySBzxRevDJ7+vxJOdShdzC3q8dRkRI+nFHvkds3O8PPNnni9YtnQOoeSbKY5d60xyfPwgIr2P3Oio26b0q+5UX/Ut5h8f1MpPslxPLz99Achf2WDBGkqZ32D1JN1gBft6OB0Ajry+lGjb0GRYBwVwf6h9H8REmqnOEDS+LLx4ERSVlX4Ti9m8V+E/soxM2sj4wgUZg7e7tMVzwG3aobOW9RLkBoymKZWlPPI9H5w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <414b65eb-1c28-7303-f9fe-cfe5713b9056@suse.com>
Date: Thu, 20 Jul 2023 08:50:54 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 11/13] vpci: add initial support for virtual PCI bus
 topology
Content-Language: en-US
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-12-volodymyr_babchuk@epam.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230720003205.1828537-12-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0108.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9c::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB8PR04MB6812:EE_
X-MS-Office365-Filtering-Correlation-Id: 21e31d00-3789-44c0-5c86-08db88edaaf0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	tzKiHRZCSRof8CV6DgRXaRq6Vb9hLPL1unfOQOZKOLhbWkdobb/6ooZNHY5xxGTkc12NdfONPuXor/EHut8MdCZLhNKrH+YE4kKfyMA3aCI4vvpn9Xj1bPFHEWGIUpOHkTlRd7a+LBJWBVhbjgP5byEtOYJFkPk4DP5anKTTWKUPFlFNLeVZCqSWmj4sjxrOnAwVEDDR7IhfNWQIP3LOaIf/gjKZyUkPJMPr7w1mj55CUWoJPGZTIbEhjmYcYKtsIY9RjL0k8aAW8HeaAup+mkU0baGB9rOZImfqeX7M55gMO0MEExG9ZGCpdujQCFx9sB0/evaCvOW1AyztlQMA8MJjZ39XH64QkUJyinPJLq+KJLxR+1GlqFPTTtxkdEe/PydTnUI6OBfhkCueqP/E/9R79pAyuRXfHOUROvjvLLgK8nurODph1aiMU+DzmcvdQYxZ5JCF75iRlOJlL4hSLBH/ZYuCJyB9xDyDlteHmdMe/iVvFmknLiVxrBoDDnaC6mkWnkPD06Mtb5cyudQ8zSqv5Os3RtN0wCz0SGgXfYiUt+YxWtdpPrpxyOKqvC5mxB49olSmXmfmGBgExFTPQe2s5wa6iuGrgPQ7lK3XknqMcgFv366ABOSWQxA6W2Xf82+FUB+bxk11wksroYLJrw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(136003)(366004)(346002)(376002)(396003)(451199021)(31686004)(186003)(316002)(2616005)(36756003)(5660300002)(8676002)(8936002)(54906003)(6486002)(26005)(6916009)(4326008)(6506007)(53546011)(41300700001)(83380400001)(66946007)(478600001)(38100700002)(2906002)(86362001)(31696002)(6512007)(66476007)(66556008)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aDhHaWJKaFlLTy9ZdTh5OVFxK3hWSmFHbFZRNjZxdlhHV05RMys3RG5LMXZo?=
 =?utf-8?B?NTFFdmlaTHhET29lMTlkR2NtUVk3MlNmL0FWV2pOZmNLdUVlakVhQkhlWnFl?=
 =?utf-8?B?NXZTMnc0M0NTWGJQUjBvSi9IZFd3M2RBbWxtNDF0cG14NE80enpLbWo1K010?=
 =?utf-8?B?eFVvL1NnSnU5dm5jSHkraWhDWkhkSllGMG5rd1BjNHI5dTM3SFR6dW5PN1Yz?=
 =?utf-8?B?SzEwTlBrN0djT2MvTldOSzV6bHprQ2hjYk5TcTQ2V2tobGxGM2F2VXdnZXU3?=
 =?utf-8?B?MFhXYWRhM2tRZmRoUDUwZDUvaGJwajVYSGduUHJkR0FRSE1TMVI2OTQ5eGVM?=
 =?utf-8?B?WHE2Ym5iaVc0bnVYVFpFZmZ1WkF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-8?Q?MoE/DTewcnyYXY/yHGl1y2C2Q?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 21e31d00-3789-44c0-5c86-08db88edaaf0
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 06:50:56.0595
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: R6UEg/3B/IBc8Aozu/m7PBM9nRlqsYifQtq2e5Cwa3kblX5acBIBIAtVTkJlziz3iMYWO5i+6XmWVlBACp/shQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6812

On 20.07.2023 02:32, Volodymyr Babchuk wrote:
> --- a/xen/drivers/vpci/vpci.c
> +++ b/xen/drivers/vpci/vpci.c
> @@ -46,6 +46,16 @@ void vpci_remove_device(struct pci_dev *pdev)
>          return;
>  
>      spin_lock(&pdev->vpci->lock);
> +
> +#ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
> +    if ( pdev->vpci->guest_sbdf.sbdf != ~0 )
> +    {
> +        __clear_bit(pdev->vpci->guest_sbdf.dev,
> +                    &pdev->domain->vpci_dev_assigned_map);
> +        pdev->vpci->guest_sbdf.sbdf = ~0;
> +    }
> +#endif

The lock acquired above is not ...

> @@ -115,6 +129,54 @@ int vpci_add_handlers(struct pci_dev *pdev)
>  }
>  
>  #ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
> +static int add_virtual_device(struct pci_dev *pdev)
> +{
> +    struct domain *d = pdev->domain;
> +    pci_sbdf_t sbdf = { 0 };
> +    unsigned long new_dev_number;
> +
> +    if ( is_hardware_domain(d) )
> +        return 0;
> +
> +    ASSERT(pcidevs_locked());
> +
> +    /*
> +     * Each PCI bus supports 32 devices/slots at max or up to 256 when
> +     * there are multi-function ones which are not yet supported.
> +     */
> +    if ( pdev->info.is_extfn )
> +    {
> +        gdprintk(XENLOG_ERR, "%pp: only function 0 passthrough supported\n",
> +                 &pdev->sbdf);
> +        return -EOPNOTSUPP;
> +    }
> +
> +    write_lock(&pdev->domain->pci_lock);
> +    new_dev_number = find_first_zero_bit(d->vpci_dev_assigned_map,
> +                                         VPCI_MAX_VIRT_DEV);
> +    if ( new_dev_number >= VPCI_MAX_VIRT_DEV )
> +    {
> +        write_unlock(&pdev->domain->pci_lock);
> +        return -ENOSPC;
> +    }
> +
> +    __set_bit(new_dev_number, &d->vpci_dev_assigned_map);

... the same as the one held here, so the bitmap still isn't properly
protected afaics, unless the intention is to continue to rely on
the global PCI lock (assuming that one's held in both cases, which I
didn't check it is). Conversely it looks like the vPCI lock isn't
held here. Both aspects may be intentional, but the locks being
acquired differing requires suitable code comments imo.

I've also briefly looked at patch 1, and I'm afraid that still lacks
commentary about intended lock nesting. That might be relevant here
in case locking visible from patch / patch context isn't providing
the full picture.

> +    /*
> +     * Both segment and bus number are 0:
> +     *  - we emulate a single host bridge for the guest, e.g. segment 0
> +     *  - with bus 0 the virtual devices are seen as embedded
> +     *    endpoints behind the root complex
> +     *
> +     * TODO: add support for multi-function devices.
> +     */
> +    sbdf.devfn = PCI_DEVFN(new_dev_number, 0);
> +    pdev->vpci->guest_sbdf = sbdf;
> +    write_unlock(&pdev->domain->pci_lock);

With the above I also wonder whether this lock can't (and hence
should) be dropped a little earlier (right after fiddling with the
bitmap).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 06:52:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 06:52:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566372.885108 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMNWR-0004vx-Cq; Thu, 20 Jul 2023 06:52:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566372.885108; Thu, 20 Jul 2023 06:52:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMNWR-0004vq-AH; Thu, 20 Jul 2023 06:52:23 +0000
Received: by outflank-mailman (input) for mailman id 566372;
 Thu, 20 Jul 2023 06:52:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=o8fF=DG=lst.de=hch@srs-se1.protection.inumbo.net>)
 id 1qMNWP-0004vb-I8
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 06:52:21 +0000
Received: from verein.lst.de (verein.lst.de [213.95.11.211])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f916fcf6-26c9-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 08:52:20 +0200 (CEST)
Received: by verein.lst.de (Postfix, from userid 2407)
 id 666CB67373; Thu, 20 Jul 2023 08:52:16 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f916fcf6-26c9-11ee-b23a-6b7b168915f2
Date: Thu, 20 Jul 2023 08:52:16 +0200
From: Christoph Hellwig <hch@lst.de>
To: Petr Tesarik <petrtesarik@huaweicloud.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>, James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	"moderated list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>,
	"moderated list:ARM PORT" <linux-arm-kernel@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:MIPS" <linux-mips@vger.kernel.org>,
	"open list:XEN SWIOTLB SUBSYSTEM" <iommu@lists.linux.dev>,
	Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>, petr@tesarici.cz
Subject: Re: [PATCH v4 0/8] Allow dynamic allocation of software IO TLB
 bounce buffers
Message-ID: <20230720065216.GB4395@lst.de>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
User-Agent: Mutt/1.5.17 (2007-11-01)

Just to add a highlevel comment here after I feel like I need a little
more time to review the guts.

I'm still pretty concerned about the extra list that needs to be
consulted in is_swiotlb_buffer, but I can't really think of
anything better.  Maybe an xarray has better cache characteristics,
but that one requires even more allocations in the low-level dma map
path.

One thing I'd like to see for the next version is to make the
new growing code a config option at least for now.  It is a pretty
big change of the existing swiotlb behavior, and I want people to opt
into it conciously.  Maybe we can drop the option again after a few
years once everything has settled.


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 06:54:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 06:54:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566378.885118 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMNYC-0005W1-Np; Thu, 20 Jul 2023 06:54:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566378.885118; Thu, 20 Jul 2023 06:54:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMNYC-0005Vu-L6; Thu, 20 Jul 2023 06:54:12 +0000
Received: by outflank-mailman (input) for mailman id 566378;
 Thu, 20 Jul 2023 06:54:11 +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 <SRS0=6Xo+=DG=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMNYB-0005VI-Ba
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 06:54:11 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20602.outbound.protection.outlook.com
 [2a01:111:f400:7d00::602])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 39fbf777-26ca-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 08:54:09 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB7617.eurprd04.prod.outlook.com (2603:10a6:20b:286::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul
 2023 06:54:07 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 06:54:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 39fbf777-26ca-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=DECQIz602xp+9BS2Dqmc143170jNb2qL5KNLvEUQVEAdtgOYWrknTfcyBknbGiZxgmGhI4Eng3mouFumd7Y/q73OE5sOhNXW6tD76AEHr5oTaqhsKnVczOPNEmSOjSLF2K/AkJhbw+h38TACP3X06BZm964JcyWyqowYGvvPliFyf1RvAbEMp2zKS/D7hoDeWMRjAVV/fyCjUhw4HAMcEf6arB+4lTP3HJDERt35dou+cCpKOKllS1IO7M43DoWIyr+2kSjDSlgjz6pY/XJ1Y/7AvyI9nsF7w9PFrwndtgF1GBweKS6gNT55T+Jxo37C7QFvn+ueV5nPlrsPwT8V9w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=e1p7v/xnAfS3GdvV0n3XaCjPonJf4p36L4CnTiaPwEo=;
 b=G7ysDjnGLk5C0tJCEKdCjmkUCpkahvR9jaxqf3LmNqRyVREh7bVCjHmsqi8Ngc7Rhje9bqnSy1GoXvY0B03VL6KsrloAf2U0IdKmUrdhjc+kfEJfusXazlZH1zzZ3qEoeNJPXvn45/rQ7nvamTHY+OD+B+feNIe0xG24jMY7AnxB4GiGmaPVd+h0o+d7iEiSw4MOn35pTZW38aylfqXtP8AlUcHAV3Rbng594TvqMXJuFKttCBMA7PTl4fXkdsWJtlp0Y1daCpdSWhoLeYCEUQq37pcX6UyhjY0kC3jbJT8+G2Dyb6B6D9b6kxDwww3u5sqJpeYo2NRi23t4fwY72g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=e1p7v/xnAfS3GdvV0n3XaCjPonJf4p36L4CnTiaPwEo=;
 b=SHr2JqybKSiMkq7T8sm0SnXB/+wyKOPgTwvkf/HZRuk+X86OV7XXlmTU3nvZ1sTnZRCA8uP90CZtUbXaoJ9uW7x62o13AcXY4PTy+8J80D7ihdFIoXhCxV2FKgPuLfd9HWiAUsxrOwOIhxMfiTN8xO9f9ZPOVs8s8OUr8mp3aGAicOzeVeCPc2bTZpy9wZ08F6vM+BJ8FK44VrH/lrL8ZXO0rzrtj3twSZjP6OjDlKSA5W1gs3Q048a2PVjCFp3SsXUprykjkTZXXEXqe3yDc5Tz0pPrmzxotSpf+LT5ZVxQ158gRGzp0MIUNyVmYWdPCeqyDBibOVaJrzyxoObpWA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3249fd7b-e58e-0400-7087-06460a38f177@suse.com>
Date: Thu, 20 Jul 2023 08:54:05 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 12/13] xen/arm: translate virtual PCI bus topology for
 guests
Content-Language: en-US
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-13-volodymyr_babchuk@epam.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230720003205.1828537-13-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0083.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1f::21) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB7617:EE_
X-MS-Office365-Filtering-Correlation-Id: 7cb5e209-0e80-4da8-fd7b-08db88ee1cfe
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	fGh/D4byJ8s7xmBiLK6Z6BR1mE5Bc+VaHaCOScTmC254x49ek7X1IDIeFou0hvKpzCx3Xa4alOVRgKwV9Zzei/eqDfr8pMFr1lYskBzaQY4zXzjxSyVu9Tdi5qB+USVjaCwhJfqR1Wm95HbNVRosj3Ww+lJCPb7v2rnPt26d2Z50BilVe0IhvIwKdN87ALgyPl8AkEujWlFsGXAgeUbF/6oZFJ1+G6x4BTnELhN3vm4UlwfkXfpKp+rBS/3lmWrV71n3xuVr7K7xgDiUQQ70e8DgzcTyyWVdPOy0VNyQPDMsNhcKbYI/emvMsMEK5EHrSVgDhkYqR3YE6dCgtBtmLXUxqafHkERRooQLkNsDrXamAsvCW1/MmyJb2WazArtCkks2DJTcd6OEoCowyQCtyEVSptWcfDz/K0OF2pGTDEZTX8yve4wd/n3YcT67T7SP2Z2/L6c0qIXCMiYoR8ttPhoCBg9+wD+ITfySxxXB13Uam7m9XQSETUMn25gwehuhu8hb0CDPJRny3PES4gFYG+/4dVa4jlaVaBEFFW2d4QWamPTzQDJp+/0BFFXiMzLq/AmO/YnY5G9CNZxpjXcdwp9NfVQ/MqfB406j+3Uek+o6YCjaH3eOdtC+kpUL9XrqaGtCvLwrh8Pzoa+4lzksCw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(136003)(39860400002)(376002)(346002)(451199021)(31696002)(36756003)(86362001)(38100700002)(186003)(31686004)(478600001)(6506007)(26005)(41300700001)(66946007)(66476007)(4326008)(66556008)(6916009)(5660300002)(316002)(2616005)(8936002)(8676002)(83380400001)(6512007)(6486002)(53546011)(4744005)(2906002)(54906003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData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L3RRckY2ejZOeGNJekRHR0w5QmlkUzhGbUZvUHJVT28yTXNX?=
 =?utf-8?B?N0RqVDk5d09uYmtiQXRwN3laOGoxL0h0S3AwZEloYWp5ZHY3bHNFODlGVlJa?=
 =?utf-8?B?dkt4QngyNzhMNzAwUmlEVW1iS1B0U1JmTUFnNzh5T0ppRGRKZ0s5Tk9iUE0r?=
 =?utf-8?B?K2NwT1QxU3JpMmoxNlNnZFFielBPOTc0c0tlTFBWdXU3dXQyWTFSMkI0VGNN?=
 =?utf-8?B?ZENaSGVFNlFleWhTNVIwZ3RRaU1SdzNrNFpUVlFsWmxOMlhTdlRteVVKY09C?=
 =?utf-8?B?K0hDb1dkQTBaSmM1Y0JVWUl6WVZsY2s3VlFLQk53bVBzTzFHMHBuaFhKb0U2?=
 =?utf-8?B?dHRCbmlWRGN3NXdseXRLZUhQQ1N6dTZaNWhQOUxwbkUxSDdSSWN2L0hXeWx2?=
 =?utf-8?Q?5ktMrQC7Xecr6wBmNdldcDBlc?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7cb5e209-0e80-4da8-fd7b-08db88ee1cfe
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 06:54:07.4057
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 1DJIacmoTMDUwI7qu0fPdO+TWNck57oxKlXluZId2TH7A0wl+1itG5wRTju0wMboLfke/pbzQq1T+zbU9wBfVQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7617

On 20.07.2023 02:32, Volodymyr Babchuk wrote:
> --- a/xen/drivers/vpci/vpci.c
> +++ b/xen/drivers/vpci/vpci.c
> @@ -177,6 +177,30 @@ static int add_virtual_device(struct pci_dev *pdev)
>      return 0;
>  }
>  
> +/*
> + * Find the physical device which is mapped to the virtual device
> + * and translate virtual SBDF to the physical one.
> + * This must hold domain's pci_lock in read mode.

How about an assertion to that effect?

> + */
> +bool vpci_translate_virtual_device(struct domain *d, pci_sbdf_t *sbdf)
> +{
> +    struct pci_dev *pdev;
> +
> +    ASSERT(!is_hardware_domain(d));
> +
> +    for_each_pdev( d, pdev )

Nit: Style (either you consider for_each_pdev a [pseudo-]keyword or you
don't; depending on that there's either a blank missing or there are two
too many).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 07:11:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 07:11:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566383.885131 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMNok-00009G-49; Thu, 20 Jul 2023 07:11:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566383.885131; Thu, 20 Jul 2023 07:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMNok-000099-0R; Thu, 20 Jul 2023 07:11:18 +0000
Received: by outflank-mailman (input) for mailman id 566383;
 Thu, 20 Jul 2023 07:11:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6Xo+=DG=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMNoj-000093-7c
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 07:11:17 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2061d.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::61d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9d18103a-26cc-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 09:11:14 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB7692.eurprd04.prod.outlook.com (2603:10a6:10:1f6::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Thu, 20 Jul
 2023 07:11:12 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 07:11:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9d18103a-26cc-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=gbcoTjpxPWGkE39TTubxurx/Fj2TrLMRpM2OUrG61Kvp/g+6haHxb4iWNnescCLok5Vw3pIA+wG8vBOt/6BU8NZvNYlyTza+MshFzVB07IGzAKZ5E7AHmkYuXGSBp0f0o8dbCJPGPRvwxRntazl56VuvaJrCNZlY4pEUSZRVDES9RLPoPXVptctJhyKffv4Gs81fZ7B4V4h/nvO8LoHIBPOemXd42IARJwLra9GRegWKNrbCeY6Evk6DS63Lq6DHnrni6uJe3xHFWT3+e6Bm7LPoJSggf/Cfi9Rs6rVyo1I3NBI617uFdAvheA318Vk1LvyZMrnIO/xvHpKMq9gtbQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OjeOukCp0k3daKKrD7pGpG70FVirYbBKiZlD/ku4tRI=;
 b=jqQL7ZyiHpnOOv22MK6WIrvMbcsfJF5DLi45+T+ZFNqmqTldQcYMcSum2yiPKTca2V9ZZTl/YkFZ1qnameC+mNsnghg7aCS26IND7H8u+mZjhNxyyO+gBhrRkZxPy+qNB3Wn26tLc2MQIERTU8J4xCdZor6MvWinIoPNpomNiWq7XN8LdKkXgj45VugwiW4IBSIyi/XkEOX8ML4BN2wmt46u4qfZqLMjfaUQPskN2JxBoaHsKFunHzW9FJWNIZfw8vlg5HuKXSsTBNLlTOcJL+diUQxyjoRtcwT89hFnYFWCBNIGwjXKsIJ3v5vGD5lhrHyJU2dxjERTrYYlhjHFFQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OjeOukCp0k3daKKrD7pGpG70FVirYbBKiZlD/ku4tRI=;
 b=2UTs1kHZSCKxTLbI1xrISoLhDSgcGcoa4onZvVcR4xzmVMBud/ehkk9DeZ1izSGfLT75XCT5pFgqXIiQtlTeJ5Kkw9UwjV8D4G2qL9ba846LDwMhsWBgonGMmput/bCfO0nHXvtfubXcW4okZbTbyRKFEOwZj/vzv13W/W1Xt9tW43HBvyEEUpsmKbpmpGm8nkLp+skKSwCyR52BFg8QMN+sf527f4/Ijfg9AUSUR75sXJ8yLWRk9rg+hOZnLbfDJZkluxa8/AHvbAq++7ghIpbWC3Ze3Sz25QYO6cXdautbnqTqbL7d0q6em3DcO0hT6v2uwkj8GSVEJ4jHPTah+A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e983103a-be32-7a77-4d7e-6d5559443f56@suse.com>
Date: Thu, 20 Jul 2023 09:11:10 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Federico Serafini <federico.serafini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86/vRTC: move and tidy convert_hour() and {to,from}_bcd()
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0065.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:93::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB7692:EE_
X-MS-Office365-Filtering-Correlation-Id: 4fac908e-80bf-4c2f-fec5-08db88f0802a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	KdUb1b+JOoAky0NEZIGFiCd006ttjyERf1LzQCE7hhXAYr38vVKyYqhwlbIHNNcK/08QjrUQ47m+aQZxaAD3O1XlL+bkWh3NM9aQA4o//Adr2gcjALlBzd1CuW6TtFUPKNcDea+ipfmX/FDQ6BgpM7A1UGmgfYWs4cp5FowDnyf9K4BjTu+/5JYrwO9SCOQhMyromm+AUoNk6LJI4YpEmGVDuurZlYEyzMM7cKvMt8v1ZuDdyuN4yP6P+YL/jB9vXrI0Fd7652rLheYdmMXAQn63oqjnIWRKwa2bio5pB3ACCaZEPOrMOZ4ib4Q4MxCwCq6L6Fu0IHCmKxM8fY9o20Pi2HS1CZA3jTX86OEFSE3L4j3FvQ7NS2rnOySt8ZwD8FSzJzZf2neNen5nmqS3mdQDH9g6vNJhW8M8zXDK8BPpwlOsSkfgpHpxMeCQlIwq+vvbsWcoIZTESdfQPgR8MqrPJWjqX9xHfyFlNdgHWnmh9lAZm4B3rjR0zqSbzR5HeQ4GyYel1uqFqZC/b6tBMwcNn7lXq2Qi+O4YOo97hlfdcZ/9us/wlttK1cS0oCb2IGpexfvFqRClvainlw0m/ebs9orsuSSeEuNOu9no/jLJlOJgKV+2PKOivdPSZSWvSkxXBUe1YUR9pdZta1usyw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(396003)(346002)(136003)(366004)(451199021)(2906002)(83380400001)(2616005)(36756003)(31696002)(86362001)(38100700002)(6916009)(66476007)(66556008)(66946007)(316002)(26005)(41300700001)(186003)(6506007)(4326008)(31686004)(478600001)(6512007)(6486002)(54906003)(8936002)(8676002)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?REtxbm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zFlM1dpSmRXUlRI?=
 =?utf-8?B?T3R3bVVZLzB6RDhuWjVtVjdIc2JZU1c1RFJGY3lWWThLb1YvWDEvanI1VW9B?=
 =?utf-8?B?TnlxZWdHcUtBWERrVFNUeS90bm92U29pUTVqQmdjM0VCTUJIcmRjTEh3bVh4?=
 =?utf-8?B?K1RXTStqKzlkQWJVaTZIZm5YNzBEZkRqY09jdEtvTDNpcXpVVmExeFcvTkpj?=
 =?utf-8?B?cjd6N3R6VHQ3QkJkVGZVYWdBTUtzcnBPM1FYeEc4T1AzMmFhdVJjLzBXek1K?=
 =?utf-8?B?TDlxR0RRRFQyajQ0QmdySWZNcTVLQy9LUFN4ZmFtUHR3dWtvTklscDl0cVpH?=
 =?utf-8?B?UTFZS2ZtUzB3ak5iQmRKUlJQNmQ0b3NVWFBuTkZQNndqcWZ0cW1NQ3VCTUg3?=
 =?utf-8?Q?exh6gHv3RJgNJRcdvGZDo65lE?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4fac908e-80bf-4c2f-fec5-08db88f0802a
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 07:11:12.8273
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: k9/2XjQnVuCs/rdbTvDWFlFycvudo+jitgyzLkU+8FF/bVHHj8Fa8OcCvSAqWIq6olAjCGA1Ib+/+oeFqNdcxw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7692

This is to avoid the need for forward declarations, which in turn
addresses a violation of MISRA C:2012 Rule 8.3 ("All declarations of an
object or function shall use the same names and type qualifiers").

While doing so,
- drop inline (leaving the decision to the compiler),
- add const,
- add unsigned,
- correct style.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -58,8 +58,6 @@ enum rtc_mode {
 
 static void rtc_copy_date(RTCState *s);
 static void rtc_set_time(RTCState *s);
-static inline int from_bcd(RTCState *s, int a);
-static inline int convert_hour(RTCState *s, int hour);
 
 static void rtc_update_irq(RTCState *s)
 {
@@ -246,6 +244,40 @@ static void cf_check rtc_update_timer2(v
     spin_unlock(&s->lock);
 }
 
+static unsigned int to_bcd(const RTCState *s, unsigned int a)
+{
+    if ( s->hw.cmos_data[RTC_REG_B] & RTC_DM_BINARY )
+        return a;
+
+    return ((a / 10) << 4) | (a % 10);
+}
+
+static unsigned int from_bcd(const RTCState *s, unsigned int a)
+{
+    if ( s->hw.cmos_data[RTC_REG_B] & RTC_DM_BINARY )
+        return a;
+
+    return ((a >> 4) * 10) + (a & 0x0f);
+}
+
+/*
+ * Hours in 12 hour mode are in 1-12 range, not 0-11. So we need convert it
+ * before use.
+ */
+static unsigned int convert_hour(const RTCState *s, unsigned int raw)
+{
+    unsigned int hour = from_bcd(s, raw & 0x7f);
+
+    if ( !(s->hw.cmos_data[RTC_REG_B] & RTC_24H) )
+    {
+        hour %= 12;
+        if ( raw & 0x80 )
+            hour += 12;
+    }
+
+    return hour;
+}
+
 /* handle alarm timer */
 static void alarm_timer_update(RTCState *s)
 {
@@ -541,37 +573,6 @@ static int rtc_ioport_write(void *opaque
     return 1;
 }
 
-static inline int to_bcd(RTCState *s, int a)
-{
-    if ( s->hw.cmos_data[RTC_REG_B] & RTC_DM_BINARY )
-        return a;
-    else
-        return ((a / 10) << 4) | (a % 10);
-}
-
-static inline int from_bcd(RTCState *s, int a)
-{
-    if ( s->hw.cmos_data[RTC_REG_B] & RTC_DM_BINARY )
-        return a;
-    else
-        return ((a >> 4) * 10) + (a & 0x0f);
-}
-
-/* Hours in 12 hour mode are in 1-12 range, not 0-11.
- * So we need convert it before using it*/
-static inline int convert_hour(RTCState *s, int raw)
-{
-    int hour = from_bcd(s, raw & 0x7f);
-
-    if (!(s->hw.cmos_data[RTC_REG_B] & RTC_24H))
-    {
-        hour %= 12;
-        if (raw & 0x80)
-            hour += 12;
-    }
-    return hour;
-}
-
 static void rtc_set_time(RTCState *s)
 {
     struct tm *tm = &s->current_tm;


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 07:13:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 07:13:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566387.885141 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMNqo-0000l0-IJ; Thu, 20 Jul 2023 07:13:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566387.885141; Thu, 20 Jul 2023 07:13:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMNqo-0000kt-Fa; Thu, 20 Jul 2023 07:13:26 +0000
Received: by outflank-mailman (input) for mailman id 566387;
 Thu, 20 Jul 2023 07:13:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6Xo+=DG=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMNqn-0000kn-Km
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 07:13:25 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on20617.outbound.protection.outlook.com
 [2a01:111:f400:fe12::617])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ea5148f7-26cc-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 09:13:24 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS1PR04MB9263.eurprd04.prod.outlook.com (2603:10a6:20b:4c5::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Thu, 20 Jul
 2023 07:13:16 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 07:13:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ea5148f7-26cc-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BjCOn6IEB0ARLj0fkx45+oh6eC5r1HnuK2WUigGpdlTCbdp6aYI8Ee7jG1zMsrrk3qbdVVkHfkn+ek9AxYxI5P1E0PNKL3h9nceyaw6CxaIBBVLDB2Ktp+f91ViI7lfShfJTNlB14eEvVLQvRZDch20Es8jJZ25BCUnYeHLQqFWVOGBQa1FRYUNGxTkcFzRv5IBLDGDz8NKe6OKUVUKRmB7sbt4XDepeunQkXKWBoch26nrLhyDZzmUFyqprc+kkK8B+LBnAQ0FyGAZF3sygF+55O/C56TpS6957xBkqrecrG+gFH5HR0A7q/CAxVk2c8ZgAYsS7KgjxwbXxfO2Cdw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=rSOexzgjdj3jGYtL4tQirhvoCQIqOI32M5rUFJgXD9Q=;
 b=lo/8IcqD/cqyZP6lde4cTdJVoZMjHiubm1Nbg7bXIgluMkxdruMAOTTFHUDgY/D1oPgcRbrfoveWKHAdkHGobssBPaXcUY6x6nQOBrgDIhP1E+bCnGYZjfmh6m2iOSZdK1WWPldl94PBiVCPNJSeepoH5l7ryPuOs3I9ESqAIYBAH8B1xEBCFWFiizl1P7zR5itZIP+DsKe87q6M0kQoNVOplLsbCznVRyp94xCHld/wSdY+0E8swa+xoDj1IdvWkUlsknRM6dxM+hHcdy7tVcmWx193RfOg7+nBbfDo6fRtXwMyG4Kigi9aVqADwwtIKOq+kDYyvT7FeBXGrC6hGg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=rSOexzgjdj3jGYtL4tQirhvoCQIqOI32M5rUFJgXD9Q=;
 b=UwQnrDvWsfgyIwy+dKsePp9LxQakZzMttYq/qKDUSEpBLF+45hcy8CWScOhMo3NhAsnIxZyWEt0ed35UtyHrjwcxTwmHMxKdWxQO0LiFblQ6fXwU6zJ6x9wfCaKpWRFQZEum+pwTLh0jK59XOhT9CeIU0s7NbQdGR288Sw9+ocKGngMqf54dgTtyK6fC+A4m0gJ8OB1g9XNoDiufPr4bPNpY353hXDu8I9aFQxYVobdhitV8hTOJ0moaHq2WJA79zSVqgvNI4zThT/AhY8+24SAtSq8Qy3OKh7yhzcBux3mXR5mDktXfrKXGN+fGmRtiKGF7XcQ7/E/5Nk6PMz069A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <2ffe60a1-83dd-c027-6924-029b36b9a4eb@suse.com>
Date: Thu, 20 Jul 2023 09:13:13 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v2] x86/HVM: address violations of MISRA C:2012 Rules
 8.2 and 8.3
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <589e9c2ef5f13bf0c035b63f7b2e24fbbb878543.1689773180.git.federico.serafini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <589e9c2ef5f13bf0c035b63f7b2e24fbbb878543.1689773180.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0152.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:98::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS1PR04MB9263:EE_
X-MS-Office365-Filtering-Correlation-Id: f3b1821d-718f-4dfb-82d2-08db88f0c975
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Uk3Vwy6P0PebBwXA+01fG5aJV46FgUp/DACUobYuKiOE+ZTzxbryQ4xsYWgBzdGfFn9Qhl/1Ro13VjooOdef87XyzaU0+F9XwXhN5wlia1LQqqjyFRHjt4DD6qLdcYZsY0I9W49772bA9+7XgYkZA1IrDxprsaDEgavrOPmAQ/MBo4Y4k2ph7Ff6fTWp6KtL/YZ70iwzSIxVYB7G/F1mvwz1R5eOVAzbxh+ESsCIBRr/r7keDocuINg9oDcDCFZeQrMVAc1amxTpD/jLbLmXPW1f7chhYf6srtzQ9MgpnUY4u2G2Tt+6gnH3fFLUdQQT5bAYczZsO8BGcarCip/tnY1TcalZzxTJn6uEfglEl4YIkDcSpLtK9mCuFqd8IIPI5Kwepr3fquDQAap7J/eYAfgg3dzgOGJCS+M/xocIIYLQDXlGfYVbSGMzpyoyZTGK8qfHXnacQH+tRMjSQWfPz5hKtILfe34UgWWy6UIDwKMUV/oJB1GTlA/uwaBxCZORTlt9ZI13fegG8xe59/4LJDIQbX11cdX/UX2PQbC7SVbhEf+2r/BuVZ7sGKZ/Y4iEILvU3Twx4qmXtwko/lkmlaj8DPCeL39ZFl2ZoBlVCsZ5BhvS1t5ZWhp8LZmyYYmcaER5vzIIlwzrtQbX9QsRMQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(136003)(346002)(376002)(366004)(39860400002)(451199021)(31686004)(478600001)(6486002)(54906003)(2616005)(86362001)(31696002)(36756003)(4744005)(2906002)(186003)(53546011)(26005)(6506007)(6512007)(41300700001)(6916009)(66476007)(66556008)(38100700002)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OUZMa2RnSzdKK1RwMHh4?=
 =?utf-8?B?TzY0TnZqMHpsVlBkV0g4UGZrSElFSlBJT0JkUlJRK2FwdG9vU0xEaVpZN2lx?=
 =?utf-8?B?UVR4SEdIMzZPaDNqSkhwYWhXVTNab3g1dGxadXlMV0NmM1lVU0JRY2g3ZHpM?=
 =?utf-8?B?UDNVTy9IVDJlRDhDbHp2OG8vcnFJMlVyV3lsd3ZVZXJpSiszdXZDRXZmbExH?=
 =?utf-8?B?dEptRXVCU2dpR0pMK2JUUFZGWGtIcnBhUmxvVW5tWHdNLzRUZm04NkorSWxy?=
 =?utf-8?B?MGVCUUt0d0RoenU0dTBsU0RIM1dtZGtaU3RlK3FMNnRPME94ZXFtdTI0WFJa?=
 =?utf-8?B?SDc2dmdhOC9wV2VCdDEvbTNLYUxMemwxRDFvU2dURWdXN0ZPaWkwTVJrcU5w?=
 =?utf-8?B?SVdqa3g1L0lwc2xkWXQ3aWYxZXVicmtlUEZudjlIYktaS2NVVWVYWktpZHFX?=
 =?utf-8?B?OFNrWExockdMQ3lJOHVReU5saXZMY1JBVGNUeVNXSUlOUUU4amNuRDQyUnVx?=
 =?utf-8?Q?H/TsPvnS4mM9ddw3VCyNEDmV+?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f3b1821d-718f-4dfb-82d2-08db88f0c975
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 07:13:15.7541
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Wydh9hbfyqG++2dys6FDb1LqzKsL3cmBebgi/7r1R9kKBYm85ZwMixAVj9sMrktGFRYcWf1aWyi4141CKpcgww==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9263

On 19.07.2023 15:52, Federico Serafini wrote:
> --- a/xen/arch/x86/hvm/rtc.c
> +++ b/xen/arch/x86/hvm/rtc.c
> @@ -559,17 +559,17 @@ static inline int from_bcd(RTCState *s, int a)
>  
>  /* Hours in 12 hour mode are in 1-12 range, not 0-11.
>   * So we need convert it before using it*/
> -static inline int convert_hour(RTCState *s, int raw)
> +static inline int convert_hour(RTCState *s, int hour)
>  {
> -    int hour = from_bcd(s, raw & 0x7f);
> +    int ret = from_bcd(s, hour & 0x7f);
>  
>      if (!(s->hw.cmos_data[RTC_REG_B] & RTC_24H))
>      {
> -        hour %= 12;
> -        if (raw & 0x80)
> -            hour += 12;
> +        ret %= 12;
> +        if (hour & 0x80)
> +            ret += 12;
>      }
> -    return hour;
> +    return ret;
>  }

I've just sent an alternative correction for this.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 07:30:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 07:30:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566390.885151 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMO7S-0003qj-Vu; Thu, 20 Jul 2023 07:30:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566390.885151; Thu, 20 Jul 2023 07:30:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMO7S-0003qc-Sr; Thu, 20 Jul 2023 07:30:38 +0000
Received: by outflank-mailman (input) for mailman id 566390;
 Thu, 20 Jul 2023 07:30:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=g0r7=DG=aepfle.de=olaf@srs-se1.protection.inumbo.net>)
 id 1qMO7R-0003qW-D9
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 07:30:37 +0000
Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de
 [81.169.146.165]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 50cf516c-26cf-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 09:30:35 +0200 (CEST)
Received: from sender by smtp.strato.de (RZmta 49.6.4 AUTH)
 with ESMTPSA id m4dd28z6K7U787t
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits))
 (Client did not present a certificate);
 Thu, 20 Jul 2023 09:30:07 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 50cf516c-26cf-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; t=1689838208; cv=none;
    d=strato.com; s=strato-dkim-0002;
    b=nt++gSxgDWjDASW5mySw0msxmOyJhB94ESyZz0s+G+0wn36MBPl1KahtSAsuqP1LpQ
    zlBaKgmSxfQrOQT2iNzOm/tbYXnafVaKU/pFVoAnhJnZyReosysoSVI6kGX/rp/ltB0N
    n1j3IEUzg9V9udc1hv3mPlvQ3g426ZKbDoDp5RHWpDQNfGGcCfPBdox6xsTFmIYpDIOU
    OiX0NE3zei7k7s/DH8jyGjyqe/cij2QC+KUEtq4jg1OhQl83czWWvv7FjpC1zlaaiM9j
    4NEF+NffHQrFEC6ODWwnCRagcj9VVLfyzeT2IbZB4Lm52Bq4Id5g7HnQjfaJmjREf+vX
    yL4A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1689838208;
    s=strato-dkim-0002; d=strato.com;
    h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender;
    bh=s6JOIe6z0BGLizUkWvs50G1BxwJlwHY/usYL8TDGJJQ=;
    b=tkPOSQ+XGulCL7l9K5Y0Dj5foshApchvDzcawRfRn5xVYz2feIgCS132sO8jkWsn3U
    k/RUMfIWgMfLnaso/R55MJBagC7oMaL2mMjwU/FJhTn8XtYmLd4bh9juRjyrYTMdcJn0
    eMwjVE3hITcYH1BMcFb+UyPjU5mOOPEzEkGJ2aeHdwXXU5FPj+vX6YIbza0DqxPWhpD/
    lE9iqnSjtlkP7CbVuIIenvRVMks9ay79+AvGixTJTGTrG/GKrCDNeb3SCMBOuyTmfkVU
    k70HSXkWXbczh9G2kbxU23XFOuE2XyKSA5I1yJo6wIJsJAL7mn9+4N4p7t5AFj45Vge+
    R7EA==
ARC-Authentication-Results: i=1; strato.com;
    arc=none;
    dkim=none
X-RZG-CLASS-ID: mo01
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1689838208;
    s=strato-dkim-0002; d=aepfle.de;
    h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender;
    bh=s6JOIe6z0BGLizUkWvs50G1BxwJlwHY/usYL8TDGJJQ=;
    b=Pg7dl3uOyiwb2WHUo+moHH8AJJcRqvG9mps45rimReWmosvCr9pZ+D9EebcxPx01Ol
    Jm5mfVu7p1WRrhgCmXs32f8LnTI2Q03s3iAX91gNq3s6tXrDQp5L8FzVta50unLx5O9w
    4mw8IFmGaAfzqSIZvQpfbdveXIpBeZ0a79zyke6ycv0pYqDp5SZ7nV+Aw0HwBQkjbXDD
    pnHs2JuGj0BrMoV/AU0BXpv0q0c+hYGPosmNnYJpUrh/IDR2Py4uz0HuziSStfxUQwcI
    P9d7iqMJUFEAQSRUQ/ReJMS87zYIGd29GZlEG7WEa65uJdeG9JdPyuAVzEB5whdqTYHd
    8oeA==
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1689838208;
    s=strato-dkim-0003; d=aepfle.de;
    h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender;
    bh=s6JOIe6z0BGLizUkWvs50G1BxwJlwHY/usYL8TDGJJQ=;
    b=kuvg1FQIiKO2T3hQYBSyRc34OLOFcuLX7vZClxpNLskQOgIeBhhw7/heBXSLDwd9OS
    rakpphXSHdyjVlmcZvCQ==
X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzpIG0mv9coXAg4x/Q77Ep0tacRDpd3C7x0fRU/XAhBUWjct55BrKA=="
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xenproject.org,
	qemu-devel@nongnu.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Anthony Perard <anthony.perard@citrix.com>,
	Paul Durrant <paul@xen.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Eduardo Habkost <eduardo@habkost.net>
Subject: [PATCH v1] xen-platform: do full PCI reset during unplug of IDE devices
Date: Thu, 20 Jul 2023 09:29:50 +0200
Message-Id: <20230720072950.20198-1-olaf@aepfle.de>
X-Mailer: git-send-email 2.35.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="us-ascii"

The IDE unplug function needs to reset the entire PCI device, to make
sure all state is initialized to defaults. This is done by calling
pci_device_reset, which resets not only the chip specific registers, but
also all PCI state. This fixes "unplug" in a Xen HVM domU with the
modular legacy xenlinux PV drivers.

Commit ee358e919e38 ("hw/ide/piix: Convert reset handler to
DeviceReset") changed the way how the the disks are unplugged. Prior
this commit the PCI device remained unchanged. After this change,
piix_ide_reset is exercised after the "unplug" command, which was not
the case prior that commit. This function resets the command register.
As a result the ata_piix driver inside the domU will see a disabled PCI
device. The generic PCI code will reenable the PCI device. On the qemu
side, this runs pci_default_write_config/pci_update_mappings. Here a
changed address is returned by pci_bar_address, this is the address
which was truncated in piix_ide_reset. In case of a Xen HVM domU, the
address changes from 0xc120 to 0xc100. This truncation was a bug in
piix_ide_reset, which was fixed in commit 230dfd9257 ("hw/ide/piix:
properly initialize the BMIBA register"). If pci_xen_ide_unplug had used
pci_device_reset, the PCI registers would have been properly reset, and
commit ee358e919e38 would have not introduced a regression for this
specific domU environment.

While the unplug is supposed to hide the IDE disks, the changed BMIBA
address broke the UHCI device. In case the domU has an USB tablet
configured, to recive absolute pointer coordinates for the GUI, it will
cause a hang during device discovery of the partly discovered USB hid
device. Reading the USBSTS word size register will fail. The access ends
up in the QEMU piix-bmdma device, instead of the expected uhci device.
Here a byte size request is expected, and a value of ~0 is returned. As
a result the UCHI driver sees an error state in the register, and turns
off the UHCI controller.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 hw/i386/xen/xen_platform.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
index 57f1d742c1..17457ff3de 100644
--- a/hw/i386/xen/xen_platform.c
+++ b/hw/i386/xen/xen_platform.c
@@ -164,8 +164,9 @@ static void pci_unplug_nics(PCIBus *bus)
  *
  * [1] https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=docs/misc/hvm-emulated-unplug.pandoc
  */
-static void pci_xen_ide_unplug(DeviceState *dev, bool aux)
+static void pci_xen_ide_unplug(PCIDevice *d, bool aux)
 {
+    DeviceState *dev = DEVICE(d);
     PCIIDEState *pci_ide;
     int i;
     IDEDevice *idedev;
@@ -195,7 +196,7 @@ static void pci_xen_ide_unplug(DeviceState *dev, bool aux)
             blk_unref(blk);
         }
     }
-    device_cold_reset(dev);
+    pci_device_reset(d);
 }
 
 static void unplug_disks(PCIBus *b, PCIDevice *d, void *opaque)
@@ -210,7 +211,7 @@ static void unplug_disks(PCIBus *b, PCIDevice *d, void *opaque)
 
     switch (pci_get_word(d->config + PCI_CLASS_DEVICE)) {
     case PCI_CLASS_STORAGE_IDE:
-        pci_xen_ide_unplug(DEVICE(d), aux);
+        pci_xen_ide_unplug(d, aux);
         break;
 
     case PCI_CLASS_STORAGE_SCSI:



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 07:34:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 07:34:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566396.885161 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOBU-0004Qm-Fw; Thu, 20 Jul 2023 07:34:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566396.885161; Thu, 20 Jul 2023 07:34:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOBU-0004Qf-Ci; Thu, 20 Jul 2023 07:34:48 +0000
Received: by outflank-mailman (input) for mailman id 566396;
 Thu, 20 Jul 2023 07:34:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=o2HW=DG=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qMOBS-0004QZ-U4
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 07:34:46 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e5ca102e-26cf-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 09:34:45 +0200 (CEST)
Received: from [192.168.1.101] (unknown [37.162.143.190])
 by support.bugseng.com (Postfix) with ESMTPSA id 716754EE0C89;
 Thu, 20 Jul 2023 09:34:44 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e5ca102e-26cf-11ee-b23a-6b7b168915f2
Message-ID: <6b557858-b45c-71aa-97c1-d901c04358b6@bugseng.com>
Date: Thu, 20 Jul 2023 09:34:42 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v2] x86/HVM: address violations of MISRA C:2012 Rules
 8.2 and 8.3
Content-Language: en-US, it
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
 Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
References: <589e9c2ef5f13bf0c035b63f7b2e24fbbb878543.1689773180.git.federico.serafini@bugseng.com>
 <alpine.DEB.2.22.394.2307191726340.3118466@ubuntu-linux-20-04-desktop>
From: Federico Serafini <federico.serafini@bugseng.com>
Organization: BUGSENG srl
In-Reply-To: <alpine.DEB.2.22.394.2307191726340.3118466@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 20/07/23 02:38, Stefano Stabellini wrote:
> On Wed, 19 Jul 2023, Federico Serafini wrote:
>>   
>> -void hvm_set_rdtsc_exiting(struct domain *d, bool_t enable)
>> +void hvm_set_rdtsc_exiting(struct domain *d, bool enable)
> 
> This is actually getting hvm_set_rdtsc_exiting out-of-sync with its
> declaration in xen/arch/x86/include/asm/hvm/hvm.h ?

You are right, I missed it, thank you.

-- 
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 07:36:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 07:36:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566404.885171 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMODL-00051A-S3; Thu, 20 Jul 2023 07:36:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566404.885171; Thu, 20 Jul 2023 07:36:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMODL-000513-OK; Thu, 20 Jul 2023 07:36:43 +0000
Received: by outflank-mailman (input) for mailman id 566404;
 Thu, 20 Jul 2023 07:36:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=o2HW=DG=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qMODL-00050c-Er
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 07:36:43 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2bd7805b-26d0-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 09:36:42 +0200 (CEST)
Received: from [192.168.1.101] (unknown [37.162.143.190])
 by support.bugseng.com (Postfix) with ESMTPSA id CAC844EE0C89;
 Thu, 20 Jul 2023 09:36:41 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2bd7805b-26d0-11ee-b23a-6b7b168915f2
Message-ID: <c09a3d2c-efe7-8071-84ba-1e27883e079a@bugseng.com>
Date: Thu, 20 Jul 2023 09:36:41 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v2] x86/HVM: address violations of MISRA C:2012 Rules
 8.2 and 8.3
Content-Language: en-US, it
To: Jan Beulich <jbeulich@suse.com>
Cc: consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <589e9c2ef5f13bf0c035b63f7b2e24fbbb878543.1689773180.git.federico.serafini@bugseng.com>
 <2ffe60a1-83dd-c027-6924-029b36b9a4eb@suse.com>
From: Federico Serafini <federico.serafini@bugseng.com>
Organization: BUGSENG srl
In-Reply-To: <2ffe60a1-83dd-c027-6924-029b36b9a4eb@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 20/07/23 09:13, Jan Beulich wrote:
> On 19.07.2023 15:52, Federico Serafini wrote:
>> --- a/xen/arch/x86/hvm/rtc.c
>> +++ b/xen/arch/x86/hvm/rtc.c
>> @@ -559,17 +559,17 @@ static inline int from_bcd(RTCState *s, int a)
>>   
>>   /* Hours in 12 hour mode are in 1-12 range, not 0-11.
>>    * So we need convert it before using it*/
>> -static inline int convert_hour(RTCState *s, int raw)
>> +static inline int convert_hour(RTCState *s, int hour)
>>   {
>> -    int hour = from_bcd(s, raw & 0x7f);
>> +    int ret = from_bcd(s, hour & 0x7f);
>>   
>>       if (!(s->hw.cmos_data[RTC_REG_B] & RTC_24H))
>>       {
>> -        hour %= 12;
>> -        if (raw & 0x80)
>> -            hour += 12;
>> +        ret %= 12;
>> +        if (hour & 0x80)
>> +            ret += 12;
>>       }
>> -    return hour;
>> +    return ret;
>>   }
> 
> I've just sent an alternative correction for this.
> 
> Jan

I will send a v3 removing my changes to this function.

-- 
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 07:44:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 07:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566410.885180 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOKS-0006q5-Gm; Thu, 20 Jul 2023 07:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566410.885180; Thu, 20 Jul 2023 07:44:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOKS-0006py-Dm; Thu, 20 Jul 2023 07:44:04 +0000
Received: by outflank-mailman (input) for mailman id 566410;
 Thu, 20 Jul 2023 07:44:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BeWc=DG=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qMOKR-0006ps-EW
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 07:44:03 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 314bc6f7-26d1-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 09:44:01 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.162.143.190])
 by support.bugseng.com (Postfix) with ESMTPSA id 2818F4EE0C89;
 Thu, 20 Jul 2023 09:44:00 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 314bc6f7-26d1-11ee-b23a-6b7b168915f2
Message-ID: <870b0720-77f2-5bf8-71eb-e460dceeb0ee@bugseng.com>
Date: Thu, 20 Jul 2023 09:43:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
Subject: Re: [RFC PATCH 3/4] xen/arm: initialize conditionally uninitialized
 local variables
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <c7d2cd46f06f75f8a1810168c508f05d242f831c.1689329728.git.nicola.vetrini@bugseng.com>
 <9ab4ae66-aa72-2426-08e5-cbe44030d7f2@xen.org>
 <af6157e5-fc71-1df7-cab7-fefa78425d3e@bugseng.com>
 <d0ea5b5a-e2c6-41dd-39bb-c692af2b8ced@xen.org>
Content-Language: en-US
In-Reply-To: <d0ea5b5a-e2c6-41dd-39bb-c692af2b8ced@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 19/07/23 16:06, Julien Grall wrote:
> Hi,
> 
> On 19/07/2023 14:27, Nicola Vetrini wrote:
>> On 14/07/23 15:21, Julien Grall wrote:
>>> Hi,
>>>
>>> On 14/07/2023 12:49, Nicola Vetrini wrote:
>>>> This patch aims to fix some occurrences of possibly uninitialized
>>>> variables, that may be read before being written. This behaviour would
>>>> violate MISRA C:2012 Rule 9.1, besides being generally undesirable.
>>>>
>>>> In all the analyzed cases, such accesses were actually safe, but it's
>>>> quite difficult to prove so by automatic checking, therefore a safer
>>>> route is to change the code so as to avoid the behaviour from 
>>>> occurring,
>>>> while preserving the semantics.
>>>>
>>>> An initialization to a safe value is provided to reach this aim.
>>>>
>>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>>> ---
>>>> Additional input on which values may be 'safe' in each context is
>>>> surely welcome, to avoid possibly compromising the correctness of
>>>> the function semantics.
>>>> ---
>>>> Â  xen/arch/arm/cpuerrata.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  6 +++---
>>>> Â  xen/arch/arm/domctl.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  8 ++++----
>>>> Â  xen/arch/arm/gic-v3-lpi.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  | 17 +++++++++--------
>>>> Â  xen/arch/arm/include/asm/p2m.hÂ Â Â Â Â Â Â Â Â Â Â Â Â  | 10 ++++++----
>>>> Â  xen/arch/arm/platforms/xilinx-zynqmp-eemi.c | 10 ++--------
>>>> Â  xen/arch/arm/psci.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  | 10 +++++-----
>>>> Â  xen/drivers/char/pl011.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  2 +-
>>>> Â  7 files changed, 30 insertions(+), 33 deletions(-)
>>>>
>>>> diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
>>>> index d0658aedb6..14694c6081 100644
>>>> --- a/xen/arch/arm/cpuerrata.c
>>>> +++ b/xen/arch/arm/cpuerrata.c
>>>> @@ -159,7 +159,7 @@ extern char __mitigate_spectre_bhb_loop_start_32[],
>>>> Â  static int enable_smccc_arch_workaround_1(void *data)
>>>> Â  {
>>>> -Â Â Â  struct arm_smccc_res res;
>>>> +Â Â Â  struct arm_smccc_res res = {0};
>>>
>>> I understand you desire to make happy. But I am not sure that 
>>> initializing to 0 is the right thing. If the SMCC were not properly 
>>> setting the register, then we most likely don't want to install the 
>>> workaround. Instead, we most likely want to warn.
>>>
>>> So you want (int)res.a0 to be negative. We don't care about the other 
>>> fields.
>>>
>>
>> In principle I'm ok with this, but see below.
>>
>>>> Â Â Â Â Â  const struct arm_cpu_capabilities *entry = data;
>>>> Â Â Â Â Â  /*
>>>> @@ -252,7 +252,7 @@ static int enable_spectre_bhb_workaround(void 
>>>> *data)
>>>> Â Â Â Â Â  if ( cpus_have_cap(ARM_WORKAROUND_BHB_SMCC_3) )
>>>> Â Â Â Â Â  {
>>>> -Â Â Â Â Â Â Â  struct arm_smccc_res res;
>>>> +Â Â Â Â Â Â Â  struct arm_smccc_res res = {0};
>>>
>>> Same remark here.
>>>
>>>> Â Â Â Â Â Â Â Â Â  if ( smccc_ver < SMCCC_VERSION(1, 1) )
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  goto warn;
>>>> @@ -393,7 +393,7 @@ DEFINE_PER_CPU_READ_MOSTLY(register_t, 
>>>> ssbd_callback_required);
>>>> Â  static bool has_ssbd_mitigation(const struct arm_cpu_capabilities 
>>>> *entry)
>>>> Â  {
>>>> -Â Â Â  struct arm_smccc_res res;
>>>> +Â Â Â  struct arm_smccc_res res = {0};
>>>
>>> Here you would want (int)res.a0 to be equal to ARM_SMCCC_NOT_SUPPORTED.
>>
>> I see that ARM_SMCCC_NOT_SUPPORTED is
>> #define ARM_SMCCC_NOT_SUPPORTEDÂ Â Â Â Â Â Â Â  (-1)
>>
>> thus an assignment to res.a0 would violate Rule 10.3:
>> "The value of an expression shall not be assigned to an object with a 
>> narrower essential type or of a different essential type category."
>> (signed vs unsigned, and the exception does not apply here).
>>
>> This rule is not yet under discussion, but I would like to avoid 
>> knowingly introducing more violations if there's an alternative.
>>
>> Do the fields of struct arm_smccc_res really need to be unsigned?
> 
> Yes, all the fields represent a register. Also, in this context, only 
> the first 32-bit of the register should be taken into account.
> 
> That why you will see code using (int)res.a0.
> 

If the purpose of defining it to -1 is to have the value 
0xffffffffffffffff, then it could be defined as ~0UL.

>>>> Â Â Â Â Â  bool required;
>>>> Â Â Â Â Â  if ( smccc_ver < SMCCC_VERSION(1, 1) )
>>>> diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c
>>>> index ad56efb0f5..b38fed72be 100644
>>>> --- a/xen/arch/arm/domctl.c
>>>> +++ b/xen/arch/arm/domctl.c
>>>> @@ -29,10 +29,10 @@ static int handle_vuart_init(struct domain *d,
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct xen_domctl_vuart_op *vuart_op)
>>>> Â  {
>>>> Â Â Â Â Â  int rc;
>>>> -Â Â Â  struct vpl011_init_info info;
>>>> -
>>>> -Â Â Â  info.console_domid = vuart_op->console_domid;
>>>> -Â Â Â  info.gfn = _gfn(vuart_op->gfn);
>>>> +Â Â Â  struct vpl011_init_info info = {
>>>> +Â Â Â Â Â Â Â  .console_domid = vuart_op->console_domid,
>>>> +Â Â Â Â Â Â Â  .gfn = _gfn(vuart_op->gfn)
>>>> +Â Â Â  };
>>>
>>> I am not against, this change. But I don't quite understand how this 
>>> makes Eclair much happier?
>>
>> It also zero-initializes the third field:
>>
>> struct vpl011_init_info {
>> Â Â Â Â  domid_t console_domid;
>> Â Â Â Â  gfn_t gfn;
>> Â Â Â Â  evtchn_port_t evtchn;
>> };
>>
>>
>>>
>>> Also, if this is the desired way, then I think this should be written 
>>> down in the CODING_STYLE.
>>
>> This is just a matter of style, I can also set the other field 
>> explicitly, if you prefer.
> 
> I am confused. In a previous reply, I thought you said the following 
> would also make ECLAIR unhappy:
>  > info.console_domid = <...>;
> info.gfn = <...>;
> info.evtchn = <...>;
>

If I did (I can't find it right now, but I'll try to dig it up), I'd say 
that I was either wrong or I forgot to mention some other field that 
wasn't initialized by the series of statements.

>> Either way, it might be a good idea to settle this in the CODING_STYLE 
>> in a different patch.
> 
> Well... The pattern you complain about is fairly common in Xen and I 
> personally prefer to use in some situation over your proposal. So I 
> think we need to agree first that your proposal is the way to go before 
> modifying the code everywhere.
> 
> [...]
> 
>>>
>>> I understand the exist construct is not liked by Eclair. But your new 
>>> construct is not easily readable by a human. Before I can propose a 
>>> different approach, can you clarify why Eclair is unhappy this the 
>>> existing code?
>>>
>>
>> This has been addressed in the reply to patch 1/4.
> 
> AFAICT the conversation wasn't settled. We will continue there to avoid 
> duplication.
> 

Sure.

>>
>>>> Â Â Â Â Â  /*
>>>> Â Â Â Â Â Â  * DOMID_XEN sees 1-1 RAM. The p2m_type is based on the type 
>>>> of the
>>>> diff --git a/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c 
>>>> b/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
>>>> index 2053ed7ac5..39d9ab4fa9 100644
>>>> --- a/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
>>>> +++ b/xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
>>>> @@ -51,11 +51,11 @@ static inline bool 
>>>> domain_has_reset_access(struct domain *d, uint32_t rst)
>>>> Â  bool zynqmp_eemi(struct cpu_user_regs *regs)
>>>> Â  {
>>>> -Â Â Â  struct arm_smccc_res res;
>>>> +Â Â Â  struct arm_smccc_res res = {0};
>>>> Â Â Â Â Â  uint32_t fid = get_user_reg(regs, 0);
>>>> Â Â Â Â Â  uint32_t nodeid = get_user_reg(regs, 1);
>>>> Â Â Â Â Â  unsigned int pm_fn = fid & 0xFFFF;
>>>> -Â Â Â  enum pm_ret_status ret;
>>>> +Â Â Â  enum pm_ret_status ret = XST_PM_NO_ACCESS;
>>>
>>> It is not clear to me why Eclair is unhappy here?
>>
>> Gotos, as explained in the reply to patch 1/4. Since 'ret' here 
>> already sets a value in every branch, I am in favour of initializing 
>> it before the switch with that value. The zero-ed 'arm_smccc_res' is 
>> ok here?
> 
> I am not in favor of this approach. Have you considered my proposal...
> 
>>
>>>
>>>> Â Â Â Â Â  switch ( fid )
>>>> Â Â Â Â Â  {
>>>> @@ -89,7 +89,6 @@ bool zynqmp_eemi(struct cpu_user_regs *regs)
>>>> Â Â Â Â Â Â Â Â Â  {
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  gprintk(XENLOG_WARNING,
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  "zynqmp-pm: fn=%u No access to node %u\n", 
>>>> pm_fn, nodeid);
>>>> -Â Â Â Â Â Â Â Â Â Â Â  ret = XST_PM_NO_ACCESS;
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  goto done;
>>>
>>> I find the new approach less obvious. How about introduce a macro 
>>> that will set the result and the use replace the two lines with:
>>>
>>> set_result(regs, XST_PM_NO_ACCESS);
>>> return 0;
>>>
>>> where set_result(regs, ret) is
>>>
>>> set_user_reg(regs, 0, ret)
> 
> ... here?

Sorry, I missed it when looking at the reply. I'll look into it, but it 
seems good. It would remove the need for the local variable, if I 
understand it correctly.

> 
> [...]
> 
>>>> diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
>>>> index f7bf3ad117..34ce90be52 100644
>>>> --- a/xen/drivers/char/pl011.c
>>>> +++ b/xen/drivers/char/pl011.c
>>>> @@ -285,7 +285,7 @@ static int __init pl011_dt_uart_init(struct 
>>>> dt_device_node *dev,
>>>> Â Â Â Â Â  const char *config = data;
>>>> Â Â Â Â Â  int res;
>>>> Â Â Â Â Â  paddr_t addr, size;
>>>> -Â Â Â  uint32_t io_width;
>>>> +Â Â Â  uint32_t io_width = 0;
>>>
>>> We have many use of dt_property_read_*() within the code base. I 
>>> would like us te decide of a policy first.
>>>
>>
>> Well, the best outcome for me is if all these functions (i.e., 
>> dt_property_*, dt_get_property_*) always write the parameter they are 
>> supposed to set. I understand if this is not always feasible, but the 
>> alternative is not clean (e.g., deviate or refactor in such a way that 
>> the code is less readable).
> 
> I have had a look at the helpers. Here some thoughts
> 
> * dt_get_property(): Always setting '*lenp' could result to user 
> starting relying on the 'len' rather than the error code. This could 
> potentially be mitigated by forcing the code to check the value (i.e. 
> adding __must_check).
>

Note that there is a Directive (D4.10) already in docs/misra/rules.rst 
that prescribes the caller to check return values:
"If a function returns error information, then that error information 
shall be tested" (by checking we mean testing it in some way, but as is 
the case for many directives, the checking this is not fully automated).

> * dt_property_read_u*(): The best would be to let the user decide what 
> would a default sane value by adding an extra parameter.
>  > * dt_property_read_string(): I would return the string and use
> ERR_PTR(...) when there is an error.
> 

Ok, good.

Regards,

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 07:53:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 07:53:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566417.885191 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOTW-0000Jt-FZ; Thu, 20 Jul 2023 07:53:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566417.885191; Thu, 20 Jul 2023 07:53:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOTW-0000Jm-CI; Thu, 20 Jul 2023 07:53:26 +0000
Received: by outflank-mailman (input) for mailman id 566417;
 Thu, 20 Jul 2023 07:53:24 +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
 <SRS0=o2HW=DG=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qMOTU-0000Je-Oh
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 07:53:24 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7f1a568b-26d2-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 09:53:21 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.162.143.190])
 by support.bugseng.com (Postfix) with ESMTPSA id 0FCF64EE0C89;
 Thu, 20 Jul 2023 09:53:19 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7f1a568b-26d2-11ee-8611-37d641c3527e
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: [XEN PATCH v3] x86/HVM: address violations of MISRA C:2012 Rules 8.2 and 8.3
Date: Thu, 20 Jul 2023 09:53:13 +0200
Message-Id: <129cc9919d8664e95812791a91ecb14fcc70b946.1689839462.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Give a name to unnamed parameters thus addressing violations of
MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
named parameters").
Keep consistency between parameter names and types used in function
declarations and the ones used in the corresponding function
definitions, thus addressing violations of MISRA C:2012 Rule 8.3
("All declarations of an object or function shall use the same names
and type qualifiers").

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
Changes in v3:
  - removed changes to convert_hour() (Jan took care of it);
  - modified also hvm_set_rdtsc_exiting() declaration;
  - modified also svm_intercept_msr() declaration.
---
Changes in v2:
  - u64 vs uint64_t mismatches are solved in favor of the stdint types;
  - adapted parameter names of nsvm_vcpu_vmexit_event() definition to
    the names used in its declaration.
---

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/arch/x86/hvm/domain.c               |  2 +-
 xen/arch/x86/hvm/hvm.c                  |  6 +++---
 xen/arch/x86/hvm/svm/nestedsvm.c        |  8 ++++----
 xen/arch/x86/hvm/vioapic.c              |  2 +-
 xen/arch/x86/include/asm/hvm/domain.h   |  2 +-
 xen/arch/x86/include/asm/hvm/hvm.h      | 20 ++++++++++----------
 xen/arch/x86/include/asm/hvm/irq.h      | 14 +++++++-------
 xen/arch/x86/include/asm/hvm/save.h     |  4 ++--
 xen/arch/x86/include/asm/hvm/support.h  |  2 +-
 xen/arch/x86/include/asm/hvm/svm/vmcb.h |  2 +-
 10 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/xen/arch/x86/hvm/domain.c b/xen/arch/x86/hvm/domain.c
index 7692ee24c2..7f6e362a70 100644
--- a/xen/arch/x86/hvm/domain.c
+++ b/xen/arch/x86/hvm/domain.c
@@ -100,7 +100,7 @@ static int check_segment(struct segment_register *reg, enum x86_segment seg)
 }
 
 /* Called by VCPUOP_initialise for HVM guests. */
-int arch_set_info_hvm_guest(struct vcpu *v, const vcpu_hvm_context_t *ctx)
+int arch_set_info_hvm_guest(struct vcpu *v, const struct vcpu_hvm_context *ctx)
 {
     const struct domain *d = v->domain;
     struct cpu_user_regs *uregs = &v->arch.user_regs;
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 57363c2ae1..28d131a202 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -272,7 +272,7 @@ uint8_t hvm_combine_hw_exceptions(uint8_t vec1, uint8_t vec2)
     return X86_EXC_DF;
 }
 
-void hvm_set_rdtsc_exiting(struct domain *d, bool_t enable)
+void hvm_set_rdtsc_exiting(struct domain *d, bool enable)
 {
     struct vcpu *v;
 
@@ -280,7 +280,7 @@ void hvm_set_rdtsc_exiting(struct domain *d, bool_t enable)
         alternative_vcall(hvm_funcs.set_rdtsc_exiting, v, enable);
 }
 
-void hvm_get_guest_pat(struct vcpu *v, u64 *guest_pat)
+void hvm_get_guest_pat(struct vcpu *v, uint64_t *guest_pat)
 {
     if ( !alternative_call(hvm_funcs.get_guest_pat, v, guest_pat) )
         *guest_pat = v->arch.hvm.pat_cr;
@@ -426,7 +426,7 @@ static void hvm_set_guest_tsc_adjust(struct vcpu *v, u64 tsc_adjust)
         update_vcpu_system_time(v);
 }
 
-u64 hvm_get_guest_tsc_fixed(struct vcpu *v, uint64_t at_tsc)
+uint64_t hvm_get_guest_tsc_fixed(struct vcpu *v, uint64_t at_tsc)
 {
     uint64_t tsc;
 
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 5d74863268..a09b6abaae 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -837,12 +837,12 @@ nsvm_vcpu_vmexit_inject(struct vcpu *v, struct cpu_user_regs *regs,
 }
 
 int cf_check nsvm_vcpu_vmexit_event(
-    struct vcpu *v, const struct x86_event *trap)
+    struct vcpu *v, const struct x86_event *event)
 {
     ASSERT(vcpu_nestedhvm(v).nv_vvmcx != NULL);
 
-    nestedsvm_vmexit_defer(v, VMEXIT_EXCEPTION_DE + trap->vector,
-                           trap->error_code, trap->cr2);
+    nestedsvm_vmexit_defer(v, VMEXIT_EXCEPTION_DE + event->vector,
+                           event->error_code, event->cr2);
     return NESTEDHVM_VMEXIT_DONE;
 }
 
@@ -1538,7 +1538,7 @@ nestedsvm_vcpu_interrupt(struct vcpu *v, const struct hvm_intack intack)
     return NSVM_INTR_NOTINTERCEPTED;
 }
 
-bool_t
+bool
 nestedsvm_gif_isset(struct vcpu *v)
 {
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index 41e3c4d5e4..4e40d3609a 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -43,7 +43,7 @@
 /* HACK: Route IRQ0 only to VCPU0 to prevent time jumps. */
 #define IRQ0_SPECIAL_ROUTING 1
 
-static void vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int irq);
+static void vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int pin);
 
 static struct hvm_vioapic *addr_vioapic(const struct domain *d,
                                         unsigned long addr)
diff --git a/xen/arch/x86/include/asm/hvm/domain.h b/xen/arch/x86/include/asm/hvm/domain.h
index 02c32cf26d..6e53ce4449 100644
--- a/xen/arch/x86/include/asm/hvm/domain.h
+++ b/xen/arch/x86/include/asm/hvm/domain.h
@@ -47,7 +47,7 @@ struct hvm_pi_ops {
      * Hook into arch_vcpu_block(), which is called
      * from vcpu_block() and vcpu_do_poll().
      */
-    void (*vcpu_block)(struct vcpu *);
+    void (*vcpu_block)(struct vcpu *v);
 };
 
 struct hvm_domain {
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index 3c37f522b9..6d53713fc3 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -151,8 +151,8 @@ struct hvm_function_table {
 
     void (*fpu_leave)(struct vcpu *v);
 
-    int  (*get_guest_pat)(struct vcpu *v, u64 *);
-    int  (*set_guest_pat)(struct vcpu *v, u64);
+    int  (*get_guest_pat)(struct vcpu *v, uint64_t *gpat);
+    int  (*set_guest_pat)(struct vcpu *v, uint64_t gpat);
 
     void (*set_tsc_offset)(struct vcpu *v, u64 offset, u64 at_tsc);
 
@@ -180,8 +180,8 @@ struct hvm_function_table {
     int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
     void (*handle_cd)(struct vcpu *v, unsigned long value);
     void (*set_info_guest)(struct vcpu *v);
-    void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
-    void (*set_descriptor_access_exiting)(struct vcpu *v, bool);
+    void (*set_rdtsc_exiting)(struct vcpu *v, bool enable);
+    void (*set_descriptor_access_exiting)(struct vcpu *v, bool enable);
 
     /* Nested HVM */
     int (*nhvm_vcpu_initialise)(struct vcpu *v);
@@ -265,10 +265,10 @@ int hvm_vcpu_cacheattr_init(struct vcpu *v);
 void hvm_vcpu_cacheattr_destroy(struct vcpu *v);
 void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip);
 
-void hvm_get_guest_pat(struct vcpu *v, u64 *guest_pat);
-int hvm_set_guest_pat(struct vcpu *v, u64 guest_pat);
+void hvm_get_guest_pat(struct vcpu *v, uint64_t *guest_pat);
+int hvm_set_guest_pat(struct vcpu *v, uint64_t guest_pat);
 
-u64 hvm_get_guest_tsc_fixed(struct vcpu *v, u64 at_tsc);
+uint64_t hvm_get_guest_tsc_fixed(struct vcpu *v, uint64_t at_tsc);
 
 u64 hvm_scale_tsc(const struct domain *d, u64 tsc);
 u64 hvm_get_tsc_scaling_ratio(u32 gtsc_khz);
@@ -282,7 +282,7 @@ int vmsi_deliver(
     uint8_t dest, uint8_t dest_mode,
     uint8_t delivery_mode, uint8_t trig_mode);
 struct hvm_pirq_dpci;
-void vmsi_deliver_pirq(struct domain *d, const struct hvm_pirq_dpci *);
+void vmsi_deliver_pirq(struct domain *d, const struct hvm_pirq_dpci *pirq_dpci);
 int hvm_girq_dest_2_vcpu_id(struct domain *d, uint8_t dest, uint8_t dest_mode);
 
 enum hvm_intblk
@@ -309,7 +309,7 @@ int hvm_event_needs_reinjection(uint8_t type, uint8_t vector);
 
 uint8_t hvm_combine_hw_exceptions(uint8_t vec1, uint8_t vec2);
 
-void hvm_set_rdtsc_exiting(struct domain *d, bool_t enable);
+void hvm_set_rdtsc_exiting(struct domain *d, bool enable);
 
 enum hvm_task_switch_reason { TSW_jmp, TSW_iret, TSW_call_or_int };
 void hvm_task_switch(
@@ -350,7 +350,7 @@ void *hvm_map_guest_frame_rw(unsigned long gfn, bool_t permanent,
                              bool_t *writable);
 void *hvm_map_guest_frame_ro(unsigned long gfn, bool_t permanent);
 void hvm_unmap_guest_frame(void *p, bool_t permanent);
-void hvm_mapped_guest_frames_mark_dirty(struct domain *);
+void hvm_mapped_guest_frames_mark_dirty(struct domain *d);
 
 int hvm_debug_op(struct vcpu *v, int32_t op);
 
diff --git a/xen/arch/x86/include/asm/hvm/irq.h b/xen/arch/x86/include/asm/hvm/irq.h
index 2d136ab99b..1817ca6e2d 100644
--- a/xen/arch/x86/include/asm/hvm/irq.h
+++ b/xen/arch/x86/include/asm/hvm/irq.h
@@ -160,17 +160,17 @@ struct hvm_pirq_dpci {
     struct list_head softirq_list;
 };
 
-void pt_pirq_init(struct domain *, struct hvm_pirq_dpci *);
-bool pt_pirq_cleanup_check(struct hvm_pirq_dpci *);
+void pt_pirq_init(struct domain *d, struct hvm_pirq_dpci *dpci);
+bool pt_pirq_cleanup_check(struct hvm_pirq_dpci *dpci);
 int pt_pirq_iterate(struct domain *d,
-                    int (*cb)(struct domain *,
-                              struct hvm_pirq_dpci *, void *arg),
+                    int (*cb)(struct domain *d,
+                              struct hvm_pirq_dpci *dpci, void *arg),
                     void *arg);
 
 #ifdef CONFIG_HVM
-bool pt_pirq_softirq_active(struct hvm_pirq_dpci *);
+bool pt_pirq_softirq_active(struct hvm_pirq_dpci *pirq_dpci);
 #else
-static inline bool pt_pirq_softirq_active(struct hvm_pirq_dpci *dpci)
+static inline bool pt_pirq_softirq_active(struct hvm_pirq_dpci *pirq_dpci)
 {
     return false;
 }
@@ -211,6 +211,6 @@ void hvm_assert_evtchn_irq(struct vcpu *v);
 void hvm_set_callback_via(struct domain *d, uint64_t via);
 
 struct pirq;
-bool hvm_domain_use_pirq(const struct domain *, const struct pirq *);
+bool hvm_domain_use_pirq(const struct domain *d, const struct pirq *pirq);
 
 #endif /* __ASM_X86_HVM_IRQ_H__ */
diff --git a/xen/arch/x86/include/asm/hvm/save.h b/xen/arch/x86/include/asm/hvm/save.h
index 9d838c48e3..535cf68ed2 100644
--- a/xen/arch/x86/include/asm/hvm/save.h
+++ b/xen/arch/x86/include/asm/hvm/save.h
@@ -36,8 +36,8 @@ void _hvm_write_entry(struct hvm_domain_context *h,
     r; })
 
 /* Unmarshalling: test an entry's size and typecode and record the instance */
-int _hvm_check_entry(struct hvm_domain_context *h, 
-                     uint16_t type, uint32_t len, bool_t strict_length);
+int _hvm_check_entry(struct hvm_domain_context *h,
+                     uint16_t type, uint32_t len, bool strict_length);
 
 /* Unmarshalling: copy the contents in a type-safe way */
 void _hvm_read_entry(struct hvm_domain_context *h,
diff --git a/xen/arch/x86/include/asm/hvm/support.h b/xen/arch/x86/include/asm/hvm/support.h
index 8d4707e58c..ab7de0a43b 100644
--- a/xen/arch/x86/include/asm/hvm/support.h
+++ b/xen/arch/x86/include/asm/hvm/support.h
@@ -135,7 +135,7 @@ int hvm_descriptor_access_intercept(uint64_t exit_info,
                                     unsigned int descriptor, bool is_write);
 int hvm_mov_to_cr(unsigned int cr, unsigned int gpr);
 int hvm_mov_from_cr(unsigned int cr, unsigned int gpr);
-void hvm_ud_intercept(struct cpu_user_regs *);
+void hvm_ud_intercept(struct cpu_user_regs *regs);
 
 /*
  * May return X86EMUL_EXCEPTION, at which point the caller is responsible for
diff --git a/xen/arch/x86/include/asm/hvm/svm/vmcb.h b/xen/arch/x86/include/asm/hvm/svm/vmcb.h
index a1a8a7fd25..91221ff4e2 100644
--- a/xen/arch/x86/include/asm/hvm/svm/vmcb.h
+++ b/xen/arch/x86/include/asm/hvm/svm/vmcb.h
@@ -607,7 +607,7 @@ void setup_vmcb_dump(void);
 #define MSR_INTERCEPT_READ    1
 #define MSR_INTERCEPT_WRITE   2
 #define MSR_INTERCEPT_RW      (MSR_INTERCEPT_WRITE | MSR_INTERCEPT_READ)
-void svm_intercept_msr(struct vcpu *v, uint32_t msr, int enable);
+void svm_intercept_msr(struct vcpu *v, uint32_t msr, int flags);
 #define svm_disable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr), MSR_INTERCEPT_NONE)
 #define svm_enable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr), MSR_INTERCEPT_RW)
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 07:54:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 07:54:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566423.885201 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOUL-0000pv-PE; Thu, 20 Jul 2023 07:54:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566423.885201; Thu, 20 Jul 2023 07:54:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOUL-0000po-Lc; Thu, 20 Jul 2023 07:54:17 +0000
Received: by outflank-mailman (input) for mailman id 566423;
 Thu, 20 Jul 2023 07:54:16 +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 <SRS0=tOt0=DG=tesarici.cz=petr@srs-se1.protection.inumbo.net>)
 id 1qMOUJ-0000Je-Ri
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 07:54:16 +0000
Received: from bee.tesarici.cz (bee.tesarici.cz [2a03:3b40:fe:2d4::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9dfa7624-26d2-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 09:54:13 +0200 (CEST)
Received: from meshulam.tesarici.cz
 (dynamic-2a00-1028-83b8-1e7a-4427-cc85-6706-c595.ipv6.o2.cz
 [IPv6:2a00:1028:83b8:1e7a:4427:cc85:6706:c595])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (No client certificate requested)
 by bee.tesarici.cz (Postfix) with ESMTPSA id 39C4416840B;
 Thu, 20 Jul 2023 09:54:11 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9dfa7624-26d2-11ee-8611-37d641c3527e
Authentication-Results: mail.tesarici.cz; dmarc=fail (p=none dis=none) header.from=tesarici.cz
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tesarici.cz; s=mail;
	t=1689839651; bh=BJwL8Mo+1mra8+b/CdY/uUP8gohBFG2ZiuHo+xJAYDU=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
	b=r9ToG10AhpvW4JM508uc+NskNEr56L4qZdWR6gmLHKXzFc9vG+58URXqJFCt5425C
	 umoUV7zsftWcrElVcdedthF9VDkO4+3bBrDCQuXmLh1KPmziq8R1WnoVI899D7qecV
	 AHvnvQlRfomek07wT+ReyEhXZcbpk3iv0kSeFD5aNam+LwfNmXDZW3DiFy3ctXRhE6
	 nox25YIAihil1b73FwVDreIAAxgcfmQP6vUBpaxgoyLgYXQ89/NFApOls4l6C9YnmN
	 xSBO+gkN270w/xKtiR/cmS/Jtcbask42UH/KfY9+VRFeZRTjgEGXFGUuG/m2Q8o3WS
	 P7gy5dMRggh0A==
Date: Thu, 20 Jul 2023 09:54:10 +0200
From: Petr =?UTF-8?B?VGVzYcWZw61r?= <petr@tesarici.cz>
To: Christoph Hellwig <hch@lst.de>
Cc: Petr Tesarik <petrtesarik@huaweicloud.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Russell King <linux@armlinux.org.uk>, Thomas
 Bogendoerfer <tsbogend@alpha.franken.de>, Thomas Gleixner
 <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov
 <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "maintainer:X86
 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>, "H. Peter Anvin"
 <hpa@zytor.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Rafael
 J. Wysocki" <rafael@kernel.org>, Juergen Gross <jgross@suse.com>, Oleksandr
 Tyshchenko <oleksandr_tyshchenko@epam.com>, Marek Szyprowski
 <m.szyprowski@samsung.com>, Robin Murphy <robin.murphy@arm.com>, Petr
 Tesarik <petr.tesarik.ext@huawei.com>, Jonathan Corbet <corbet@lwn.net>,
 Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Hans de Goede
 <hdegoede@redhat.com>, James Seo <james@equiv.tech>, James Clark
 <james.clark@arm.com>, Kees Cook <keescook@chromium.org>, "moderated
 list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>, "moderated
 list:ARM PORT" <linux-arm-kernel@lists.infradead.org>, open list
 <linux-kernel@vger.kernel.org>, "open list:MIPS"
 <linux-mips@vger.kernel.org>, "open list:XEN SWIOTLB SUBSYSTEM"
 <iommu@lists.linux.dev>, Roberto Sassu <roberto.sassu@huaweicloud.com>,
 Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH v4 1/8] swiotlb: make io_tlb_default_mem local to
 swiotlb.c
Message-ID: <20230720095410.16832a9e@meshulam.tesarici.cz>
In-Reply-To: <20230720063744.GA3842@lst.de>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
	<7f64111986f4f361a2deb4a1a1b6f588e63a851b.1689261692.git.petr.tesarik.ext@huawei.com>
	<20230720063744.GA3842@lst.de>
X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Thu, 20 Jul 2023 08:37:44 +0200
Christoph Hellwig <hch@lst.de> wrote:

> On Thu, Jul 13, 2023 at 05:23:12PM +0200, Petr Tesarik wrote:
> > From: Petr Tesarik <petr.tesarik.ext@huawei.com>
> > 
> > SWIOTLB implementation details should not be exposed to the rest of the
> > kernel. This will allow to make changes to the implementation without
> > modifying non-swiotlb code.
> > 
> > To avoid breaking existing users, provide helper functions for the few
> > required fields.
> > 
> > As a bonus, using a helper function to initialize struct device allows to
> > get rid of an #ifdef in driver core.
> > 
> > Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
> > ---
> >  arch/arm/xen/mm.c          |  2 +-
> >  arch/mips/pci/pci-octeon.c |  2 +-
> >  arch/x86/kernel/pci-dma.c  |  2 +-
> >  drivers/base/core.c        |  4 +---
> >  drivers/xen/swiotlb-xen.c  |  2 +-
> >  include/linux/swiotlb.h    | 25 +++++++++++++++++++++++-
> >  kernel/dma/swiotlb.c       | 39 +++++++++++++++++++++++++++++++++++++-
> >  7 files changed, 67 insertions(+), 9 deletions(-)
> > 
> > diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c
> > index 3d826c0b5fee..0f32c14eb786 100644
> > --- a/arch/arm/xen/mm.c
> > +++ b/arch/arm/xen/mm.c
> > @@ -125,7 +125,7 @@ static int __init xen_mm_init(void)
> >  		return 0;
> >  
> >  	/* we can work with the default swiotlb */
> > -	if (!io_tlb_default_mem.nslabs) {
> > +	if (!is_swiotlb_allocated()) {
> >  		rc = swiotlb_init_late(swiotlb_size_or_default(),
> >  				       xen_swiotlb_gfp(), NULL);
> >  		if (rc < 0)  
> 
> I'd much rather move the already initialized check into
> swiotlb_init_late, which is a much cleaer interface.
> 
> >  	/* we can work with the default swiotlb */
> > -	if (!io_tlb_default_mem.nslabs) {
> > +	if (!is_swiotlb_allocated()) {
> >  		int rc = swiotlb_init_late(swiotlb_size_or_default(),
> >  					   GFP_KERNEL, xen_swiotlb_fixup);
> >  		if (rc < 0)  
> 
> .. and would take care of this one as well.

Oh, you're right! These are the only two places that look at
io_tlb_default_mem.nslabs, and all they need is to avoid double
initialization. Makes perfect sense to move it inside
swiotlb_init_late().

> > +bool is_swiotlb_allocated(void)
> > +{
> > +	return !!io_tlb_default_mem.nslabs;  
> 
> Nit: no need for the !!, we can rely on the implicit promotion to
> bool.  But with the suggestion above the need for this helper
> should go away anyway.

Eh, yes. I initially declared the return type as int and then forgot to
change the return statement. But as you say, the whole function will go
away entirely.

Petr T


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 07:56:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 07:56:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566426.885211 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOWI-0001Ta-40; Thu, 20 Jul 2023 07:56:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566426.885211; Thu, 20 Jul 2023 07:56:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOWI-0001TT-0z; Thu, 20 Jul 2023 07:56:18 +0000
Received: by outflank-mailman (input) for mailman id 566426;
 Thu, 20 Jul 2023 07:56:16 +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 <SRS0=tOt0=DG=tesarici.cz=petr@srs-se1.protection.inumbo.net>)
 id 1qMOWG-0001TJ-3p
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 07:56:16 +0000
Received: from bee.tesarici.cz (bee.tesarici.cz [77.93.223.253])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e5c499b7-26d2-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 09:56:13 +0200 (CEST)
Received: from meshulam.tesarici.cz
 (dynamic-2a00-1028-83b8-1e7a-4427-cc85-6706-c595.ipv6.o2.cz
 [IPv6:2a00:1028:83b8:1e7a:4427:cc85:6706:c595])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (No client certificate requested)
 by bee.tesarici.cz (Postfix) with ESMTPSA id 8ACD4167A3C;
 Thu, 20 Jul 2023 09:56:10 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e5c499b7-26d2-11ee-8611-37d641c3527e
Authentication-Results: mail.tesarici.cz; dmarc=fail (p=none dis=none) header.from=tesarici.cz
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tesarici.cz; s=mail;
	t=1689839771; bh=8Ywv2iMig4RBperXu5U4nAxs9mWRsMz4nTNC2ZA5BeQ=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
	b=TvTwq7eiLdhXI4GdxjFTYKWrEmyfm37mmR+3HPaAOtwgyoeZTjH/TJU7xP2Mb60SZ
	 07lZHe/lwWgIWKi2G934H68+S1gfxjf82UnXU1T7wzSp3fk55Y8Tyl31ai+AeRuIVb
	 GQhIYRILN1SAI3n8fsJscb9nc+Nr+NQAfyOtmpt0eNfoJDPVmsKA89GxtVR3678nhg
	 WLz4cmystZ68U5HQCCMXXzdUxWnYDcRP2dfv+Ms6KdK+WaIuasC7LQ2dRlZIEGBZII
	 tLUhJIyp4cGIs1iyscAU/6Ioest8+nUs+prvqzBKGx5LOFxVY/LtS0fl1Sqj5A2v/v
	 RlPFbhitLSR8g==
Date: Thu, 20 Jul 2023 09:56:09 +0200
From: Petr =?UTF-8?B?VGVzYcWZw61r?= <petr@tesarici.cz>
To: Christoph Hellwig <hch@lst.de>
Cc: Petr Tesarik <petrtesarik@huaweicloud.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Russell King <linux@armlinux.org.uk>, Thomas
 Bogendoerfer <tsbogend@alpha.franken.de>, Thomas Gleixner
 <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov
 <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "maintainer:X86
 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>, "H. Peter Anvin"
 <hpa@zytor.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Rafael
 J. Wysocki" <rafael@kernel.org>, Juergen Gross <jgross@suse.com>, Oleksandr
 Tyshchenko <oleksandr_tyshchenko@epam.com>, Marek Szyprowski
 <m.szyprowski@samsung.com>, Robin Murphy <robin.murphy@arm.com>, Petr
 Tesarik <petr.tesarik.ext@huawei.com>, Jonathan Corbet <corbet@lwn.net>,
 Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Hans de Goede
 <hdegoede@redhat.com>, James Seo <james@equiv.tech>, James Clark
 <james.clark@arm.com>, Kees Cook <keescook@chromium.org>, "moderated
 list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>, "moderated
 list:ARM PORT" <linux-arm-kernel@lists.infradead.org>, open list
 <linux-kernel@vger.kernel.org>, "open list:MIPS"
 <linux-mips@vger.kernel.org>, "open list:XEN SWIOTLB SUBSYSTEM"
 <iommu@lists.linux.dev>, Roberto Sassu <roberto.sassu@huaweicloud.com>,
 Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH v4 2/8] swiotlb: add documentation and rename
 swiotlb_do_find_slots()
Message-ID: <20230720095609.55b3a642@meshulam.tesarici.cz>
In-Reply-To: <20230720063819.GB3842@lst.de>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
	<11826bfbc148771ab36d0b485558aa52cbdd204f.1689261692.git.petr.tesarik.ext@huawei.com>
	<20230720063819.GB3842@lst.de>
X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Thu, 20 Jul 2023 08:38:19 +0200
Christoph Hellwig <hch@lst.de> wrote:

> On Thu, Jul 13, 2023 at 05:23:13PM +0200, Petr Tesarik wrote:
> > From: Petr Tesarik <petr.tesarik.ext@huawei.com>
> > 
> > Add some kernel-doc comments and move the existing documentation of struct
> > io_tlb_slot to its correct location. The latter was forgotten in commit
> > 942a8186eb445 ("swiotlb: move struct io_tlb_slot to swiotlb.c").
> > 
> > Use the opportunity to give swiotlb_do_find_slots() a more descriptive
> > name, which makes it clear how it differs from swiotlb_find_slots().  
> 
> Please keep the swiotlb_ prefix.  Otherwise this looks good to me.

Will do. Out of curiosity, why does it matter for a static (file-local)
function?

Petr T


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 08:01:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 08:01:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566433.885220 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOb6-0003p3-2C; Thu, 20 Jul 2023 08:01:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566433.885220; Thu, 20 Jul 2023 08:01:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOb5-0003ow-VX; Thu, 20 Jul 2023 08:01:15 +0000
Received: by outflank-mailman (input) for mailman id 566433;
 Thu, 20 Jul 2023 08:01:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=o8fF=DG=lst.de=hch@srs-se1.protection.inumbo.net>)
 id 1qMOb5-0003oq-3T
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 08:01:15 +0000
Received: from verein.lst.de (verein.lst.de [213.95.11.211])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 98910869-26d3-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 10:01:13 +0200 (CEST)
Received: by verein.lst.de (Postfix, from userid 2407)
 id 3931F6732D; Thu, 20 Jul 2023 10:01:11 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 98910869-26d3-11ee-b23a-6b7b168915f2
Date: Thu, 20 Jul 2023 10:01:10 +0200
From: Christoph Hellwig <hch@lst.de>
To: Petr =?utf-8?B?VGVzYcWZw61r?= <petr@tesarici.cz>
Cc: Christoph Hellwig <hch@lst.de>,
	Petr Tesarik <petrtesarik@huaweicloud.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>, James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	"moderated list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>,
	"moderated list:ARM PORT" <linux-arm-kernel@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:MIPS" <linux-mips@vger.kernel.org>,
	"open list:XEN SWIOTLB SUBSYSTEM" <iommu@lists.linux.dev>,
	Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH v4 2/8] swiotlb: add documentation and rename
 swiotlb_do_find_slots()
Message-ID: <20230720080110.GA6358@lst.de>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com> <11826bfbc148771ab36d0b485558aa52cbdd204f.1689261692.git.petr.tesarik.ext@huawei.com> <20230720063819.GB3842@lst.de> <20230720095609.55b3a642@meshulam.tesarici.cz>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230720095609.55b3a642@meshulam.tesarici.cz>
User-Agent: Mutt/1.5.17 (2007-11-01)

On Thu, Jul 20, 2023 at 09:56:09AM +0200, Petr TesaÅ™Ã­k wrote:
> On Thu, 20 Jul 2023 08:38:19 +0200
> Christoph Hellwig <hch@lst.de> wrote:
> 
> > On Thu, Jul 13, 2023 at 05:23:13PM +0200, Petr Tesarik wrote:
> > > From: Petr Tesarik <petr.tesarik.ext@huawei.com>
> > > 
> > > Add some kernel-doc comments and move the existing documentation of struct
> > > io_tlb_slot to its correct location. The latter was forgotten in commit
> > > 942a8186eb445 ("swiotlb: move struct io_tlb_slot to swiotlb.c").
> > > 
> > > Use the opportunity to give swiotlb_do_find_slots() a more descriptive
> > > name, which makes it clear how it differs from swiotlb_find_slots().  
> > 
> > Please keep the swiotlb_ prefix.  Otherwise this looks good to me.
> 
> Will do. Out of curiosity, why does it matter for a static (file-local)
> function?

Because it makes looking at stack traces much easier.


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 08:02:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 08:02:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566440.885231 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOcW-0004Qp-Ht; Thu, 20 Jul 2023 08:02:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566440.885231; Thu, 20 Jul 2023 08:02:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOcW-0004Qi-Ej; Thu, 20 Jul 2023 08:02:44 +0000
Received: by outflank-mailman (input) for mailman id 566440;
 Thu, 20 Jul 2023 08:02:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=tOt0=DG=tesarici.cz=petr@srs-se1.protection.inumbo.net>)
 id 1qMOcV-0004Qa-Cy
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 08:02:43 +0000
Received: from bee.tesarici.cz (bee.tesarici.cz [2a03:3b40:fe:2d4::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ccfac78a-26d3-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 10:02:42 +0200 (CEST)
Received: from meshulam.tesarici.cz
 (dynamic-2a00-1028-83b8-1e7a-4427-cc85-6706-c595.ipv6.o2.cz
 [IPv6:2a00:1028:83b8:1e7a:4427:cc85:6706:c595])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (No client certificate requested)
 by bee.tesarici.cz (Postfix) with ESMTPSA id 3ECD7164269;
 Thu, 20 Jul 2023 10:02:39 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ccfac78a-26d3-11ee-b23a-6b7b168915f2
Authentication-Results: mail.tesarici.cz; dmarc=fail (p=none dis=none) header.from=tesarici.cz
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tesarici.cz; s=mail;
	t=1689840159; bh=D7uejbPnusryYbx96m6L7cjLYp5Gmplm0qfp8geBlY4=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
	b=y5azLUXFqHfPiDcwLhK9RwnD6ejtiZ+5Q02Bj+zd22Fr+LTkHaT722JMUBsOsMObf
	 d/uJjgs0CGt4ina28Lmi+hf5m9guZ+TRvuODDbwcLdrHc3ABi2F9r9nWpfci2kQrla
	 Z2yA0zYxxpDaId3rWBew7EufpvEwO7go1DmYHTMzHoRlZ7WPskE92l6RVNhUeRWnKg
	 fKAg7BCd5Gjf6KvOFOw4bkEQUU4pOxankJGS7I9GPQu8i9MLEdtCZumfu7B6IuuFen
	 OKCplt0boWwWvjkRP8KQZMs+QBemLE/Tga0vCGYkGNdPfyg0bvUJ2CxXY0zZ+Agu45
	 DanUaK6MSjTxA==
Date: Thu, 20 Jul 2023 10:02:38 +0200
From: Petr =?UTF-8?B?VGVzYcWZw61r?= <petr@tesarici.cz>
To: Christoph Hellwig <hch@lst.de>
Cc: Petr Tesarik <petrtesarik@huaweicloud.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Russell King <linux@armlinux.org.uk>, Thomas
 Bogendoerfer <tsbogend@alpha.franken.de>, Thomas Gleixner
 <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov
 <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "maintainer:X86
 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>, "H. Peter Anvin"
 <hpa@zytor.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Rafael
 J. Wysocki" <rafael@kernel.org>, Juergen Gross <jgross@suse.com>, Oleksandr
 Tyshchenko <oleksandr_tyshchenko@epam.com>, Marek Szyprowski
 <m.szyprowski@samsung.com>, Robin Murphy <robin.murphy@arm.com>, Petr
 Tesarik <petr.tesarik.ext@huawei.com>, Jonathan Corbet <corbet@lwn.net>,
 Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Hans de Goede
 <hdegoede@redhat.com>, James Seo <james@equiv.tech>, James Clark
 <james.clark@arm.com>, Kees Cook <keescook@chromium.org>, "moderated
 list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>, "moderated
 list:ARM PORT" <linux-arm-kernel@lists.infradead.org>, open list
 <linux-kernel@vger.kernel.org>, "open list:MIPS"
 <linux-mips@vger.kernel.org>, "open list:XEN SWIOTLB SUBSYSTEM"
 <iommu@lists.linux.dev>, Roberto Sassu <roberto.sassu@huaweicloud.com>,
 Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH v4 8/8] swiotlb: search the software IO TLB only if a
 device makes use of it
Message-ID: <20230720100238.58f11c06@meshulam.tesarici.cz>
In-Reply-To: <20230720064744.GA4395@lst.de>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
	<a8d31d3fffa0867dce2b44b98dc2714289edfdc9.1689261692.git.petr.tesarik.ext@huawei.com>
	<20230720064744.GA4395@lst.de>
X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Thu, 20 Jul 2023 08:47:44 +0200
Christoph Hellwig <hch@lst.de> wrote:

> Any reason this can't just do a list_empty_careful on the list
> instead of adding yet another field that grows struct device?

On which list?

The dma_io_tlb_pools list only contains transient pools, but a device
may use bounce buffers from a regular pool.

The dma_io_tlb_mem.pools list will always be non-empty, unless the
system runs without SWIOTLB.

On a system which does have a SWIOTLB, the flag allows to differentiate
between devices that actually use bounce buffers and devices that do
not (e.g. because they do not have any addressing limitations).

Petr T


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 08:13:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 08:13:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566444.885241 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOmu-0006DU-Hy; Thu, 20 Jul 2023 08:13:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566444.885241; Thu, 20 Jul 2023 08:13:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOmu-0006DN-Ed; Thu, 20 Jul 2023 08:13:28 +0000
Received: by outflank-mailman (input) for mailman id 566444;
 Thu, 20 Jul 2023 08:13:26 +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 <SRS0=tOt0=DG=tesarici.cz=petr@srs-se1.protection.inumbo.net>)
 id 1qMOms-0006DH-OS
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 08:13:26 +0000
Received: from bee.tesarici.cz (bee.tesarici.cz [2a03:3b40:fe:2d4::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4c3d2a0b-26d5-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 10:13:24 +0200 (CEST)
Received: from meshulam.tesarici.cz
 (dynamic-2a00-1028-83b8-1e7a-4427-cc85-6706-c595.ipv6.o2.cz
 [IPv6:2a00:1028:83b8:1e7a:4427:cc85:6706:c595])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (No client certificate requested)
 by bee.tesarici.cz (Postfix) with ESMTPSA id 6B344166DED;
 Thu, 20 Jul 2023 10:13:21 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4c3d2a0b-26d5-11ee-8611-37d641c3527e
Authentication-Results: mail.tesarici.cz; dmarc=fail (p=none dis=none) header.from=tesarici.cz
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tesarici.cz; s=mail;
	t=1689840801; bh=TdK9jcZL8v/p/laoEmi/zALu74q142SxfjUGyouwpT0=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
	b=Ep2iGtb9XwwVXdW8lVyOJuD+PoVmPwq3KvBPAUvyUMDZA5m9uc+OP56Pme9dHmPf9
	 LHSbVYWT2DwuGrfqg10tpCg+WHOsEUxLlBHB4rejKgW1xDrQmwKxTdgmNua/ZkIyCH
	 xxGsUJzTMkwUtfhkUvu+WUcF93Rn0u2BhomMyok4HopTRqI6aPHQIsiOePlRk5yWQs
	 0rokk+4IQ42uMfAuxqVoxMGN1xbcL2Wy/NC1Kaac/sy0+W5qWYGX9kVu6KE8SRnLaq
	 uU+Ds0EbmORD13mcMi4lyS/k6NmlLzUQvS2oeGXNiOQkSfvv6GsyoshWbeWeP6p6QB
	 9UMlHjGDhJ+XA==
Date: Thu, 20 Jul 2023 10:13:20 +0200
From: Petr =?UTF-8?B?VGVzYcWZw61r?= <petr@tesarici.cz>
To: Christoph Hellwig <hch@lst.de>
Cc: Petr Tesarik <petrtesarik@huaweicloud.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Russell King <linux@armlinux.org.uk>, Thomas
 Bogendoerfer <tsbogend@alpha.franken.de>, Thomas Gleixner
 <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov
 <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "maintainer:X86
 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>, "H. Peter Anvin"
 <hpa@zytor.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Rafael
 J. Wysocki" <rafael@kernel.org>, Juergen Gross <jgross@suse.com>, Oleksandr
 Tyshchenko <oleksandr_tyshchenko@epam.com>, Marek Szyprowski
 <m.szyprowski@samsung.com>, Robin Murphy <robin.murphy@arm.com>, Petr
 Tesarik <petr.tesarik.ext@huawei.com>, Jonathan Corbet <corbet@lwn.net>,
 Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Hans de Goede
 <hdegoede@redhat.com>, James Seo <james@equiv.tech>, James Clark
 <james.clark@arm.com>, Kees Cook <keescook@chromium.org>, "moderated
 list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>, "moderated
 list:ARM PORT" <linux-arm-kernel@lists.infradead.org>, open list
 <linux-kernel@vger.kernel.org>, "open list:MIPS"
 <linux-mips@vger.kernel.org>, "open list:XEN SWIOTLB SUBSYSTEM"
 <iommu@lists.linux.dev>, Roberto Sassu <roberto.sassu@huaweicloud.com>,
 Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH v4 0/8] Allow dynamic allocation of software IO TLB
 bounce buffers
Message-ID: <20230720101320.72bbd2fc@meshulam.tesarici.cz>
In-Reply-To: <20230720065216.GB4395@lst.de>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
	<20230720065216.GB4395@lst.de>
X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Thu, 20 Jul 2023 08:52:16 +0200
Christoph Hellwig <hch@lst.de> wrote:

> Just to add a highlevel comment here after I feel like I need a little
> more time to review the guts.
> 
> I'm still pretty concerned about the extra list that needs to be
> consulted in is_swiotlb_buffer, but I can't really think of
> anything better.  Maybe an xarray has better cache characteristics,
> but that one requires even more allocations in the low-level dma map
> path.
> 
> One thing I'd like to see for the next version is to make the
> new growing code a config option at least for now.  It is a pretty
> big change of the existing swiotlb behavior, and I want people to opt
> into it conciously.  Maybe we can drop the option again after a few
> years once everything has settled.

Fine with me. I removed it after all my testing showed no performance
impact as long as the size of the initial SWIOTLB is kept at the
default value (and sufficient for the workload), but it's OK for me if
dynamic SWIOTLB allocations are off by default.

OTOH I'd like to make it a boot-time option rather than build-time
option. Would that be OK for you?

Petr T


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 08:14:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 08:14:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566447.885251 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOnf-0006hN-Pp; Thu, 20 Jul 2023 08:14:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566447.885251; Thu, 20 Jul 2023 08:14:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOnf-0006hG-N0; Thu, 20 Jul 2023 08:14:15 +0000
Received: by outflank-mailman (input) for mailman id 566447;
 Thu, 20 Jul 2023 08:14:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=tOt0=DG=tesarici.cz=petr@srs-se1.protection.inumbo.net>)
 id 1qMOne-0006hA-Ql
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 08:14:14 +0000
Received: from bee.tesarici.cz (bee.tesarici.cz [77.93.223.253])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 68b60d9d-26d5-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 10:14:12 +0200 (CEST)
Received: from meshulam.tesarici.cz
 (dynamic-2a00-1028-83b8-1e7a-4427-cc85-6706-c595.ipv6.o2.cz
 [IPv6:2a00:1028:83b8:1e7a:4427:cc85:6706:c595])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (No client certificate requested)
 by bee.tesarici.cz (Postfix) with ESMTPSA id E0E67168C97;
 Thu, 20 Jul 2023 10:14:10 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 68b60d9d-26d5-11ee-b23a-6b7b168915f2
Authentication-Results: mail.tesarici.cz; dmarc=fail (p=none dis=none) header.from=tesarici.cz
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tesarici.cz; s=mail;
	t=1689840851; bh=xrpHTACrVoZG7MNSm/D8K7vhd21yQrNcC9Y59ZeXRvs=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
	b=3dd5Pavmv3EXKNAnnR95EiSeSQ2THQUdM5wMjtCg0ChzLt/QUmCXzUOB/38fD8mLk
	 pyi6yZ1E36fc6dVkU4iROaJCHSNuoayo36vmhwrxilJg22KieWiuPFpNO9POe83OP6
	 w/LYkzTz/FO9CHthSROhqFP5h1/CyJay2rWag0Ojzfm4NKFwj+3ycKGyMFXaEpi1IM
	 F5e3mTJfOrAF5pYv5RQeB3Ub4VIXhxADABWKFfLAMIOjbP7zZIIzYOwdjf1R1742Ip
	 QjGS92dn0WHV1QT7i2g89YpdooKhVyiSAd2Atp3oB8tlSZc8NdlmEQYo5AhZATkk3W
	 hxtId0DxzzqfA==
Date: Thu, 20 Jul 2023 10:14:09 +0200
From: Petr =?UTF-8?B?VGVzYcWZw61r?= <petr@tesarici.cz>
To: Christoph Hellwig <hch@lst.de>
Cc: Petr Tesarik <petrtesarik@huaweicloud.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Russell King <linux@armlinux.org.uk>, Thomas
 Bogendoerfer <tsbogend@alpha.franken.de>, Thomas Gleixner
 <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov
 <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "maintainer:X86
 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>, "H. Peter Anvin"
 <hpa@zytor.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Rafael
 J. Wysocki" <rafael@kernel.org>, Juergen Gross <jgross@suse.com>, Oleksandr
 Tyshchenko <oleksandr_tyshchenko@epam.com>, Marek Szyprowski
 <m.szyprowski@samsung.com>, Robin Murphy <robin.murphy@arm.com>, Petr
 Tesarik <petr.tesarik.ext@huawei.com>, Jonathan Corbet <corbet@lwn.net>,
 Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Hans de Goede
 <hdegoede@redhat.com>, James Seo <james@equiv.tech>, James Clark
 <james.clark@arm.com>, Kees Cook <keescook@chromium.org>, "moderated
 list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>, "moderated
 list:ARM PORT" <linux-arm-kernel@lists.infradead.org>, open list
 <linux-kernel@vger.kernel.org>, "open list:MIPS"
 <linux-mips@vger.kernel.org>, "open list:XEN SWIOTLB SUBSYSTEM"
 <iommu@lists.linux.dev>, Roberto Sassu <roberto.sassu@huaweicloud.com>,
 Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH v4 2/8] swiotlb: add documentation and rename
 swiotlb_do_find_slots()
Message-ID: <20230720101409.559a2a34@meshulam.tesarici.cz>
In-Reply-To: <20230720080110.GA6358@lst.de>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com>
	<11826bfbc148771ab36d0b485558aa52cbdd204f.1689261692.git.petr.tesarik.ext@huawei.com>
	<20230720063819.GB3842@lst.de>
	<20230720095609.55b3a642@meshulam.tesarici.cz>
	<20230720080110.GA6358@lst.de>
X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Thu, 20 Jul 2023 10:01:10 +0200
Christoph Hellwig <hch@lst.de> wrote:

> On Thu, Jul 20, 2023 at 09:56:09AM +0200, Petr Tesa=C5=99=C3=ADk wrote:
> > On Thu, 20 Jul 2023 08:38:19 +0200
> > Christoph Hellwig <hch@lst.de> wrote:
> >  =20
> > > On Thu, Jul 13, 2023 at 05:23:13PM +0200, Petr Tesarik wrote: =20
> > > > From: Petr Tesarik <petr.tesarik.ext@huawei.com>
> > > >=20
> > > > Add some kernel-doc comments and move the existing documentation of=
 struct
> > > > io_tlb_slot to its correct location. The latter was forgotten in co=
mmit
> > > > 942a8186eb445 ("swiotlb: move struct io_tlb_slot to swiotlb.c").
> > > >=20
> > > > Use the opportunity to give swiotlb_do_find_slots() a more descript=
ive
> > > > name, which makes it clear how it differs from swiotlb_find_slots()=
.   =20
> > >=20
> > > Please keep the swiotlb_ prefix.  Otherwise this looks good to me. =20
> >=20
> > Will do. Out of curiosity, why does it matter for a static (file-local)
> > function? =20
>=20
> Because it makes looking at stack traces much easier.

Got it. Thanks!

Petr T


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 08:22:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 08:22:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566450.885261 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOvx-0000Cr-LK; Thu, 20 Jul 2023 08:22:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566450.885261; Thu, 20 Jul 2023 08:22:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOvx-0000Ck-HL; Thu, 20 Jul 2023 08:22:49 +0000
Received: by outflank-mailman (input) for mailman id 566450;
 Thu, 20 Jul 2023 08:22:48 +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 <SRS0=o8fF=DG=lst.de=hch@srs-se1.protection.inumbo.net>)
 id 1qMOvw-0000Ce-NX
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 08:22:48 +0000
Received: from verein.lst.de (verein.lst.de [213.95.11.211])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9b332c13-26d6-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 10:22:46 +0200 (CEST)
Received: by verein.lst.de (Postfix, from userid 2407)
 id 6B09B6732D; Thu, 20 Jul 2023 10:22:42 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9b332c13-26d6-11ee-8611-37d641c3527e
Date: Thu, 20 Jul 2023 10:22:42 +0200
From: Christoph Hellwig <hch@lst.de>
To: Petr =?utf-8?B?VGVzYcWZw61r?= <petr@tesarici.cz>
Cc: Christoph Hellwig <hch@lst.de>,
	Petr Tesarik <petrtesarik@huaweicloud.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>, James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	"moderated list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>,
	"moderated list:ARM PORT" <linux-arm-kernel@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:MIPS" <linux-mips@vger.kernel.org>,
	"open list:XEN SWIOTLB SUBSYSTEM" <iommu@lists.linux.dev>,
	Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH v4 8/8] swiotlb: search the software IO TLB only if a
 device makes use of it
Message-ID: <20230720082242.GA6932@lst.de>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com> <a8d31d3fffa0867dce2b44b98dc2714289edfdc9.1689261692.git.petr.tesarik.ext@huawei.com> <20230720064744.GA4395@lst.de> <20230720100238.58f11c06@meshulam.tesarici.cz>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230720100238.58f11c06@meshulam.tesarici.cz>
User-Agent: Mutt/1.5.17 (2007-11-01)

On Thu, Jul 20, 2023 at 10:02:38AM +0200, Petr TesaÅ™Ã­k wrote:
> On Thu, 20 Jul 2023 08:47:44 +0200
> Christoph Hellwig <hch@lst.de> wrote:
> 
> > Any reason this can't just do a list_empty_careful on the list
> > instead of adding yet another field that grows struct device?
> 
> On which list?

dev->dma_io_tlb_mem->pools?

> 
> The dma_io_tlb_pools list only contains transient pools, but a device
> may use bounce buffers from a regular pool.

Oh, true.

> The dma_io_tlb_mem.pools list will always be non-empty, unless the
> system runs without SWIOTLB.
> 
> On a system which does have a SWIOTLB, the flag allows to differentiate
> between devices that actually use bounce buffers and devices that do
> not (e.g. because they do not have any addressing limitations).

Ok.


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 08:23:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 08:23:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566456.885270 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOwS-0000iK-SH; Thu, 20 Jul 2023 08:23:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566456.885270; Thu, 20 Jul 2023 08:23:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOwS-0000iD-Pa; Thu, 20 Jul 2023 08:23:20 +0000
Received: by outflank-mailman (input) for mailman id 566456;
 Thu, 20 Jul 2023 08:23:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=o8fF=DG=lst.de=hch@srs-se1.protection.inumbo.net>)
 id 1qMOwR-0000ZF-BV
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 08:23:19 +0000
Received: from verein.lst.de (verein.lst.de [213.95.11.211])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ae688f9c-26d6-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 10:23:18 +0200 (CEST)
Received: by verein.lst.de (Postfix, from userid 2407)
 id C7E1C6732D; Thu, 20 Jul 2023 10:23:16 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ae688f9c-26d6-11ee-b23a-6b7b168915f2
Date: Thu, 20 Jul 2023 10:23:16 +0200
From: Christoph Hellwig <hch@lst.de>
To: Petr =?utf-8?B?VGVzYcWZw61r?= <petr@tesarici.cz>
Cc: Christoph Hellwig <hch@lst.de>,
	Petr Tesarik <petrtesarik@huaweicloud.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>, James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	"moderated list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>,
	"moderated list:ARM PORT" <linux-arm-kernel@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:MIPS" <linux-mips@vger.kernel.org>,
	"open list:XEN SWIOTLB SUBSYSTEM" <iommu@lists.linux.dev>,
	Roberto Sassu <roberto.sassu@huaweicloud.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH v4 0/8] Allow dynamic allocation of software IO TLB
 bounce buffers
Message-ID: <20230720082316.GB6932@lst.de>
References: <cover.1689261692.git.petr.tesarik.ext@huawei.com> <20230720065216.GB4395@lst.de> <20230720101320.72bbd2fc@meshulam.tesarici.cz>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230720101320.72bbd2fc@meshulam.tesarici.cz>
User-Agent: Mutt/1.5.17 (2007-11-01)

On Thu, Jul 20, 2023 at 10:13:20AM +0200, Petr TesaÅ™Ã­k wrote:
> Fine with me. I removed it after all my testing showed no performance
> impact as long as the size of the initial SWIOTLB is kept at the
> default value (and sufficient for the workload), but it's OK for me if
> dynamic SWIOTLB allocations are off by default.
> 
> OTOH I'd like to make it a boot-time option rather than build-time
> option. Would that be OK for you?

I'd really like the config option to not even build the code.  But
a boot time option sounds very useful in addition to that.


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 08:27:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 08:27:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566462.885281 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOzt-0001OY-Bf; Thu, 20 Jul 2023 08:26:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566462.885281; Thu, 20 Jul 2023 08:26:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOzt-0001OR-8J; Thu, 20 Jul 2023 08:26:53 +0000
Received: by outflank-mailman (input) for mailman id 566462;
 Thu, 20 Jul 2023 08:26:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/JYs=DG=citrix.com=prvs=558be806a=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMOzr-0001O5-Gb
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 08:26:51 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2b136641-26d7-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 10:26:49 +0200 (CEST)
Received: from mail-co1nam11lp2174.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.174])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 20 Jul 2023 04:26:45 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB5760.namprd03.prod.outlook.com (2603:10b6:a03:2d3::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul
 2023 08:26:43 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 08:26:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2b136641-26d7-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689841609;
  h=from:to:cc:subject:date:message-id:
   content-transfer-encoding:mime-version;
  bh=9odFqki64rKyeoVPmm6bAKQwz7RRtbjMZwx9nGDnCx4=;
  b=FzK3sh66I4IPWin5Dr0wwV1cuoUFqqaUKVi6Zy5zhN0jyaC4Q9Mp6QYH
   Od9FHd0+Wd726sRkSuVUibyArgalf4oclU5x4+YooXhMLv/mqTrZL3VYH
   JelepN07D73gJ9nrkeJEslHMOi8ubceWpMmpzLPb34cCRhCybxHpkOibb
   k=;
X-IronPort-RemoteIP: 104.47.56.174
X-IronPort-MID: 115538979
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:9/PeAKweDuCGcmpEawV6t+cTxyrEfRIJ4+MujC+fZmUNrF6WrkVRy
 mMdCDiHPP2NamCjKN5wb4nk8xsO6JfTzIdmGgM9qyAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhP6gT5TcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KTFV2
 e4cAw0AVwi8oNjs5uPmE9tUpu12eaEHPKtH0p1h5RfwKK9/BLvkGuDN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjaVlVMtuFTuGIO9ltiiX8Jak1zev
 mvb12/4HgsbJJqUzj/tHneE37aSwHirCd1DfFG+3tdOnFKymzItMkFVVl2SqMGgrGu7BPsKf
 iT4/QJr98De7neDXtT7GhG1vnOAlhodQMZLVf037hmXzajZ6BrfAXILJhZebPQ2uclwQiYlv
 neLkMnuHidHq6CORDSW8bL8kN+pES0cLGtHbihdSwIAuoDnuNtq0U6JSct/GqmoiNGzASv33
 z2BsCk5gfMUkNIP0KK4u1vAhlpAu6T0c+L83S2PNkrN0++zTNTNi1CAgbQD0ct9EQ==
IronPort-HdrOrdr: A9a23:9s1HVawzQFNjMCBELLnuKrPwL71zdoMgy1knxilNoNJuA6ulfq
 GV7ZImPHrP4gr5N0tQ+uxoVJPhfZq+z/9ICOsqTNWftWDd0QPCEGgI1/qG/9SPIVybygef78
 tdmmpFZeEYwWIUsS8y2meFL+o=
X-Talos-CUID: =?us-ascii?q?9a23=3A4Se9Wmip0mjARy6douW/zbNVXDJuImbx3nP7HkK?=
 =?us-ascii?q?BEVlOcuezGALJyptEup87?=
X-Talos-MUID: =?us-ascii?q?9a23=3AEuPETQxSFvgaetpqU+pzR3hRYNiaqI2KFE8szMs?=
 =?us-ascii?q?4gZXHNipZMg+EqhGyHaZyfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,218,1684814400"; 
   d="scan'208";a="115538979"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=e1LVg1QaZRBSVyEnnrIYkbylwATumVSL0KuzLEbsN7E8AvjLN6RKTnfJkoXrSIkYpX61k7/bLtfDqybxkEQ/c68fez7LyQ1JNNMG506FUumyx1qgQ4Q/b1hSgZpFdcoia4JiDFMQTzuk6apOYg66kY8f3uYYKb5+kkHhiE+CXhimzk6BzkRGOI1E370V4zyL7zts0JI10WA6qUB224vkrFbQVC/SVFEKtiON9EQAidZTchiT2l4eUSbDoQ5Er9EIC+oeE+mF66tZ4uVF9ghBQHv7WqGnVgnVc2fOnSyh1uZTa/s0sQ0iKpotd8aTlKHFTR9quoBLiWm3JXcfOq91uQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=CX4VOM1tHRqTye6d547CIc/vhKURIdso6ZiSTA9xbXo=;
 b=Sh2QV5dwk9I7Yqx9Q9EnEmcWTfItm1KDW72QWbBYagUGZ4Vmi+RwjbgQhPMghH5P/CKqQ8r/WQxGg53z+RUwSxFmwhI0N9iITvr6T0jWHMPNibyQuU9GuHaKPDBqxPh6XdO0HNniYKxCHMfls+FACPT35p2mJmLbWtuinLJKVAWCYkBbQxVl/W7miJUq8O98sQY4iYS0VxFbeX7LBiRx8pysvoqnGRk6A7+L8HEgCj5aoF0F4qbDzSIEcXs05a5IBs4KRTISKgtV0Z5PYYpVy6r/uCv8dq9T3VwbtUqBSebPNbWouDKRvbZlrcjQgOS6+H2DbactTMjmaBTrgXIrhQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=CX4VOM1tHRqTye6d547CIc/vhKURIdso6ZiSTA9xbXo=;
 b=lb46wsrk1U3GkhCToJIUiZrJpM/xgqgdTvtLQId69+3RLVvjb9B7TEvw30Ggh22T4jaSacsL71m6cNOCZUO1Q70aSB5Al2gJ+nxSSfAEE3QU5up73KRJXVy2csC0M6umbYMoPk8IjPRm7IBkBnKi6iS/m+9/Coo5+81OTQ2r5mE=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v3 0/6] lib{xc,xl}: support for guest MSR features
Date: Thu, 20 Jul 2023 10:25:34 +0200
Message-ID: <20230720082540.69444-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P265CA0164.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:9::32) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5760:EE_
X-MS-Office365-Filtering-Correlation-Id: 8259ae09-a71b-4ed5-ca4e-08db88fb0c88
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	p9GWxyq9BOOIOskf1CzC947ndc3ZD85pAPN+/XPwrQjs4dLXVJx8mh9QR444HN1XF7mf2iGscL/RmGcxjte+Jl8A6kehho2szqoy6dCP0xdcK/46ZOLDyKz5oOhRpUYDnvQlmi3e2BX+eXWF7LZgrK1pmYq5ZoIGQYYnLK2C8oa2oJpeiJ7OWMOnP/HmGm0GNwD0nNGX+F8LaZDkW8pXrGA2haxbuLLXRdre5X984TY2MyJ3h62O4A9wgCzOwmnHDhNENGZnPfVoF9883rp1Mjaawj1wi+XU6jT7sF1rBFDATy7o6ap/s+iU0PVuSLZxHAKygOOdbFyFeRvpE1djt08mL87DyzhWG+pxOTBbrY5kM+xqBRzJOVxm69Y0mrUYNWp5uHyY8nAxIpoShK2q2YaGr0CUJSUGIQxUqN186h+JT3mYFGirB/cEPQ3/0gejI2JBjprJ90cLHWVTpznM8m4hZNWZB1wlt+dbIQbGYr8VnVdryIAauvA6l3SI/xuNkYgEqVrwpJ6xiRBjVIYOdj6u1i+PWZwcgRLbsfrOo7cTFq+Rp/cDZrcFjENyobpy
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(346002)(136003)(376002)(366004)(451199021)(86362001)(478600001)(83380400001)(1076003)(186003)(38100700002)(41300700001)(26005)(54906003)(6916009)(8676002)(8936002)(316002)(2906002)(4326008)(6512007)(66556008)(66946007)(6666004)(66476007)(6486002)(6506007)(82960400001)(2616005)(36756003)(5660300002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QXhOdHQ3aGV3Y1Nmd3c2akhLOXdEcFRaWkpoL1R2NVdOTTB3M3NXeU4rTC8x?=
 =?utf-8?B?b0kybGJ1aW9XZzZrTFQ2UVo1OURWTzg0MXZ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AIO/ksZ59xcu0Ct/ItIQBJu2AZ2wIg3yrSbtXQO+HlPN0PrFpW31kXTrPB4lxoZUnhbbLMHDqYlCAiQFZCwguUq+RR7UmN/SlvhhpUwffjNIryXzRBkvJ6PzemhtkpG+pbS37WkdX5JCNEjsuWg9aKE209Vj+IefNYDZ9wehDCskIRPIcqUA83q3N8EVCafoDyBYXoPecdyu/556HN+
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8259ae09-a71b-4ed5-ca4e-08db88fb0c88
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 08:26:43.3532
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 0QoYTENKm/GOWxZfnp90VsQhSdupgDQSnqqp2QupJAkGyRMb41LznElfeBx3YKkBCyDJgHUM2sMKyG+OQKpbCw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5760

Hello,

The following series adds support for handling guest MSR features as
defined in arch-x86/cpufeatureset.h.

The end result is the user being able to use such features with the
xl.cfg(5) cpuid option.  This also involves adding support to all the
underlying layers, so both libxl and libxc also get new functionality in
order to properly parse those.

Thanks, Roger.

Roger Pau Monne (6):
  libs/guest: introduce support for setting guest MSRs
  libxl: change the type of libxl_cpuid_policy_list
  libxl: introduce MSR data in libxl_cpuid_policy
  libxl: split logic to parse user provided CPUID features
  libxl: use the cpuid feature names from cpufeatureset.h
  libxl: add support for parsing MSR features

 docs/man/xl.cfg.5.pod.in          |  24 +-
 tools/include/libxl.h             |   8 +-
 tools/include/xenctrl.h           |  21 +-
 tools/libs/guest/xg_cpuid_x86.c   | 169 +++++++-
 tools/libs/light/libxl_cpuid.c    | 662 ++++++++++++++++++------------
 tools/libs/light/libxl_internal.h |   5 +
 tools/libs/light/libxl_types.idl  |   2 +-
 tools/xl/xl_parse.c               |   3 +
 8 files changed, 602 insertions(+), 292 deletions(-)

-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 08:27:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 08:27:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566463.885291 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOzv-0001dv-NZ; Thu, 20 Jul 2023 08:26:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566463.885291; Thu, 20 Jul 2023 08:26:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMOzv-0001do-Kd; Thu, 20 Jul 2023 08:26:55 +0000
Received: by outflank-mailman (input) for mailman id 566463;
 Thu, 20 Jul 2023 08:26:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/JYs=DG=citrix.com=prvs=558be806a=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMOzt-0001O5-DN
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 08:26:53 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2d618f33-26d7-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 10:26:51 +0200 (CEST)
Received: from mail-co1nam11lp2172.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.172])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 20 Jul 2023 04:26:50 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB5760.namprd03.prod.outlook.com (2603:10b6:a03:2d3::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul
 2023 08:26:49 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 08:26:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2d618f33-26d7-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689841611;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=/jv+CyPM3neLkaA4oQq4tIsXoYzSYlUOZobTjS+1d6o=;
  b=JqxdOhGYN9ytGTt38sZIIM2cHsvqD6WsjZ/wBU+NcuGgLQikjCjOJVVs
   RP5pgB9D7rHWgSg9LKjbhEL0fUfwPNwn8FhxVlHiItDAZcVNODkdMAxH5
   f3o6OEn6g+loN0PphL3lJBm3mqMbXxL7w6jg7rwysUDXnvAZKelofMrVF
   c=;
X-IronPort-RemoteIP: 104.47.56.172
X-IronPort-MID: 115538984
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:diGhKaqZsANmw6TTtCh3SEQeA4peBmI8ZBIvgKrLsJaIsI4StFCzt
 garIBmGPfeIMTakKNt/O9u0oRlSvMSHxtRqQQZpqi09E3sV9ZuZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weBzSFNVfrzGInqR5fGatgMdgKFb
 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo
 OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay
 RAXABcwV06dq/mp+oCmUOUzp5QqMeTPGIxK7xmMzRmBZRonabbqZvyToPR/hXI3jM0IGuvCb
 c0EbzYpdA7HfxBEJlYQDtQ5gfusgX78NTZfrTp5p4JuuzSVkFM3jearaYWPEjCJbZw9ckKwv
 GXJ8n6/GhgHHNee1SCE4jSngeqncSbTAdtPSebop6426LGV7kwBDkVNT2KKmtqgh2qea+xcK
 1MV+TV7+MDe82TuFLERRSaQsHOC+xIRRddUO+k78x2WjLrZ5R6DAWoJRSIHb8Yp3OcpQRQ62
 1nPmMnmbRRtv6eSUmm17aqPoHW5Pi19EIMZTSoNTA9A6N66pog210vLVow6T/TzicDpEzbtx
 TzMtDI5m7gYkc8M0eO84EzDhDWv4JPOS2bZ+znqY45s1SshDKbNWmBiwQKzASpoRGpBcmS8g
 Q==
IronPort-HdrOrdr: A9a23:VMB//qMs1pYPBsBcTsKjsMiBIKoaSvp037Dk7TEXdfU1SL3/qy
 nKpp4mPHDP+VUssR0b+exoW5PgfZq/z+8W3WB5B97LNzUO01HYSb2Kg7GSpwEI2BeTygee78
 pdmmRFZ+EYxGIVsfrH
X-Talos-CUID: 9a23:rIq9jm4cCjRNPVFsA9ss03MtRN4JaWLn/mrKLxCZWW90ZZmxRgrF
X-Talos-MUID: =?us-ascii?q?9a23=3AnF0I7QzWjEm8hVEQmvaqL2/kfmeaqIS8DhhWi6w?=
 =?us-ascii?q?3gOqdOAhQCwmejCu2QZByfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,218,1684814400"; 
   d="scan'208";a="115538984"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=OYHZmw3onIMwlx+x2QcGuggvDor1AZLdhwWYsq1bkEXNjtI7XPWLhe6UNNBTky+b83n+a+ZqALGIW+k6DUtm0vzCkPZVKzPW2O9vMc53btgoPcf2kGvR5Ml8OcDrffyRo34/1k7Ga1Em13oIiDqU1FiGjTmfJO6Ow8FbVyedwjHlEXsjLPC9w+kgdDjOP5RCoCrCp9hDERM83z6QlhdllFu2SD+Ofudq2gs9n+H4vyup3vl1ALwM+3Z7PQ0VKl2JU9MbfqkdFRmcs41spMPlcrZcPvguuKv58PWxwsrFKaVEL5kp9iq3fErVEsJxRy3tzN6Eqid1ZKhO1L4pSNX6ig==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=wf40HwzFigWxi5/seuFzBWojNz9BnyuqK0PdkFX/FF4=;
 b=K2nhdNIG5pidwhGsM5yLxAW+81jnANx8QC1Lp23YUlUtxrf4HVSxjYY7fjGXtUl7tObo0qdsw/GaApqsvK6LigD4wOP6BpP2/3FakZydUM0jR0y+aCLvgp9siOLipb4amsfc7GnyPTAuhQMDsHlKmU5wVuv79If74OMnkkIjbWH9K/bsKbqfKcPGpOpln2iuEFRVGe5F3OIeJyYAhqltRuZvDrFb87jFYytIa0spBMsVUvo8UgrVPhPgWZ5Dm6Hyxmgkk0E/uoZC9uiaeGN8uP1kyVVaeGBZA4AeFE7FDVLkVIEdkxf0oroerjgoYdliyTAa2I6GpIerN0H5dlc1Aw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=wf40HwzFigWxi5/seuFzBWojNz9BnyuqK0PdkFX/FF4=;
 b=psy35O/FuEGcFKSbz6pdf4lz8DhsofDj8eWwpzQ4CwdVsPCx5Ma7evjCQweMoZNlMM5B74LwtQjAfINVxqyHVJaAjz5R9aukDIN6/ModqcNYx3EgPli5lF63/SBtAUc6fqcsr/lgD9mTgtg73Tg6ycn5TOy4vS8UE/0+diTi8Y8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v3 1/6] libs/guest: introduce support for setting guest MSRs
Date: Thu, 20 Jul 2023 10:25:35 +0200
Message-ID: <20230720082540.69444-2-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230720082540.69444-1-roger.pau@citrix.com>
References: <20230720082540.69444-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0475.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a8::12) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5760:EE_
X-MS-Office365-Filtering-Correlation-Id: d2415a35-a972-4d4a-0598-08db88fb0fd7
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	kv582ll4mqoAmt7WbnHrrQUfsGik9kNO1b37LohTzBZ0u7jHIzsyPbZ2BYCszPXQ/1cofHNBcCCGsJdEnwW3D4zLqlNdHMO43Hky3LYyDyTKmRUW52NhYfzOdKasG7xXjrQOukO0NlgH38Ev6u90hQtSwNjSIddhQODw6xHcjuSOqCrNKTFUUQpcu2d9q63ziMbRFTmIdp94R5y+xerXEAHSsybjuu51kZI3jy3IKevoDNvG4AHQ+mMgcjxMQ/roKlxj/kjovpLTyDPs0IA+W6Ajh+0jVImFyKvn0QkKb3voKtu5DuIUnBc6BNlSB+sjwiwQwqC36GPjqGRTl8E0hN1CgBuT4aGQ/wkW2dP/lurXi504TriHKQQ3INW0cFtQWGRpbEX6xvMrf17HO3CigBSjI3DUzceUsP+YYr/bYVfAnLMSXc66ywdXHGs2xegpXzxKwY4oSPhtA31R6kfjngGg5TlbaM7laa1QRCLfEzWCuqSYkDO7IzXMLArMKG8XBwqft9Sz5a1fzqRqjZ+WWqA8iHY/IAiILtKFV3IbA88r6HbP77BHZR8Zci64zE9g
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(346002)(136003)(376002)(366004)(451199021)(86362001)(478600001)(83380400001)(1076003)(186003)(38100700002)(41300700001)(26005)(54906003)(6916009)(8676002)(8936002)(316002)(2906002)(4326008)(6512007)(66556008)(66946007)(6666004)(66476007)(6486002)(6506007)(82960400001)(2616005)(36756003)(5660300002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MkxRREg4U0pHcWFleUJhdXR5c2JYaEsxcVVteHlzWmpGQjBOYW9nTlRsK2VF?=
 =?utf-8?B?OTd3MG8yRnZkSWJ1K1FnMUoxeUFZVU81RVY3YWFLWTNnQTFNTnhpbEdoR3Nn?=
 =?utf-8?B?SXpORUs4MHpoWkZ0ZTZpRkUxamlSU0FiMXdvNENGY056VFVyTXk1UzAyRmhV?=
 =?utf-8?B?OG9TS0ZlekJnMTBScHBCWFIvb1QvYzBJS0UreE43T2dzbFlLUlp0bFkrRm1J?=
 =?utf-8?B?WDVnN3FWc2QzaUZvL0dKRm5hSnpQbkt5WEJqZ1psSjZ6YjZUL3Yrc2hIK0pG?=
 =?utf-8?B?MGpZRTJ6TWhydHpxdnJERVgxeXNjRkc0TDZBbzdic2lyYUFUZ0xXdXEvOWVL?=
 =?utf-8?B?R2tKSHFFU3A4eXBuZFp1ZmhzWExBZmpnUGM4WUdMUmVZbWw5VXpxa09rcFFO?=
 =?utf-8?B?LzB0c3E1cW9zT29IS0RwSGxoRENxNU9QK3NiZDQ4OFFkUE5NK1R3M3dVKzUv?=
 =?utf-8?B?aTZHOXZlUDE1UWlXV3VlT2xoeUJnMnNlclhXRmlsTjFlZTNiUFMrVVowVlVs?=
 =?utf-8?B?VXdCaFBmTk0rMklPVUhI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RQYG6yzBzT9BXZKmkzVxMgSuhiZp2txVVlWyxV3wnspdntH8acoRgKBLWf/+FI3Ndmbcezxcim+6rfA/kirROkMRDQn1gjVtIvfCFIxY595iX4qrm0BasJ8WgXsSz7O4y5QEdjxXl3qDz7P7vLb+C1Tuk38YH/hFQf5BogDoqiVIVA6/1ERFtNQ6gsFWh4M00ehfJB0N1ks8A9l1CPadtbuaiVedo/LCujfz8wEiIFKAMhWxDk4BriOEnps01kl6koR9GkU4AUuFYN/XKhcPKV7uYe9Q+wcmGahOttxWlArMd7Rj0k/X0zGoFr63KxGno+uTDp8uqgzPPLoiOHRGilp+XuVH6wWT3LwVhNzn9sat2ZvvUtZGYdL8wqB6t2q1yxwmJOEnuveNLY7qTVG9S3NfiCisdotpus0DVs3O0CReRJaeQTNmQnfEoPbvJNsMe0HmfKWS/dgBbL4aOvU0hJWaJLI5wxqkGJ+2GxkboOge1wcb5Efx6n6LSm1KXsRZMVE+QxUQuo5xD1UNkhe3lhH3Cdd8A1225TiiZX97dBZMmSn4RQwl4cJQxDcGBL8FH55s/TV6eWy7jh3O5lYBRfUA266BPQtfrY5/XeQvPUBrSMr2T+5NARQIX1s8Y4vCqts9x2E1i3vrSGTj0+SbpmiL2mqMZlgv8CBDiZ3bz+YDU2HTPZq81aOQfNlX4rtpQd8XmOncCHHEY7ximFWdtMpwI9BhJVgBZSK+R/D8OuL4nO0S
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d2415a35-a972-4d4a-0598-08db88fb0fd7
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 08:26:48.9311
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Cllahq0gLwpSYYF1HS+fsgfKF8jND9HkO5iBJWm0T5787ydc1j2p71ih2W07hBnyh2kroWo803JwH/Muog6A5g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5760

Like it's done with CPUID, introduce support for passing MSR values to
xc_cpuid_apply_policy().  The chosen format for expressing MSR policy
data matches the current one used for CPUID.  Note that existing
callers of xc_cpuid_apply_policy() can pass NULL as the value for the
newly introduced 'msr' parameter in order to preserve the same
functionality, and in fact that's done in libxl on this patch.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
---
Changes since v2:
 - Some code adjustment, no functional change.
---
 tools/include/xenctrl.h         |  21 +++-
 tools/libs/guest/xg_cpuid_x86.c | 169 +++++++++++++++++++++++++++++++-
 tools/libs/light/libxl_cpuid.c  |   2 +-
 3 files changed, 188 insertions(+), 4 deletions(-)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index dba33d5d0f39..faec1dd82453 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1822,6 +1822,21 @@ struct xc_xend_cpuid {
     char *policy[4];
 };
 
+/*
+ * MSR policy data.
+ *
+ * The format of the policy string is the following:
+ *   '1' -> force to 1
+ *   '0' -> force to 0
+ *   'x' -> we don't care (use default)
+ *   'k' -> pass through host value
+ */
+struct xc_msr {
+    uint32_t index;
+    char policy[65];
+};
+#define XC_MSR_INPUT_UNUSED 0xffffffffu
+
 /*
  * Make adjustments to the CPUID settings for a domain.
  *
@@ -1833,13 +1848,15 @@ struct xc_xend_cpuid {
  * Either pass a full new @featureset (and @nr_features), or adjust individual
  * features (@pae, @itsc, @nested_virt).
  *
- * Then (optionally) apply legacy XEND overrides (@xend) to the result.
+ * Then (optionally) apply legacy XEND CPUID overrides (@xend) or MSR (@msr)
+ * to the result.
  */
 int xc_cpuid_apply_policy(xc_interface *xch,
                           uint32_t domid, bool restore,
                           const uint32_t *featureset,
                           unsigned int nr_features, bool pae, bool itsc,
-                          bool nested_virt, const struct xc_xend_cpuid *xend);
+                          bool nested_virt, const struct xc_xend_cpuid *xend,
+                          const struct xc_msr *msr);
 int xc_mca_op(xc_interface *xch, struct xen_mc *mc);
 int xc_mca_op_inject_v2(xc_interface *xch, unsigned int flags,
                         xc_cpumap_t cpumap, unsigned int nr_cpus);
diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c
index 5b035223f4f5..f2b1e809011d 100644
--- a/tools/libs/guest/xg_cpuid_x86.c
+++ b/tools/libs/guest/xg_cpuid_x86.c
@@ -423,10 +423,170 @@ static int xc_cpuid_xend_policy(
     return rc;
 }
 
+static int compare_msr(const void *l, const void *r)
+{
+    const xen_msr_entry_t *lhs = l;
+    const xen_msr_entry_t *rhs = r;
+
+    if ( lhs->idx == rhs->idx )
+        return 0;
+
+    return lhs->idx < rhs->idx ? -1 : 1;
+}
+
+static xen_msr_entry_t *find_msr(
+    xen_msr_entry_t *msrs, unsigned int nr_msrs,
+    uint32_t index)
+{
+    const xen_msr_entry_t key = { .idx = index };
+
+    return bsearch(&key, msrs, nr_msrs, sizeof(*msrs), compare_msr);
+}
+
+
+static int xc_msr_policy(xc_interface *xch, domid_t domid,
+                         const struct xc_msr *msr)
+{
+    int rc;
+    bool hvm;
+    xc_domaininfo_t di;
+    unsigned int nr_leaves, nr_msrs;
+    uint32_t err_leaf = -1, err_subleaf = -1, err_msr = -1;
+    /*
+     * Three full policies.  The host, default for the domain type,
+     * and domain current.
+     */
+    xen_msr_entry_t *host = NULL, *def = NULL, *cur = NULL;
+    unsigned int nr_host, nr_def, nr_cur;
+
+    if ( (rc = xc_domain_getinfo_single(xch, domid, &di)) < 0 )
+    {
+        PERROR("Failed to obtain d%d info", domid);
+        rc = -errno;
+        goto out;
+    }
+    hvm = di.flags & XEN_DOMINF_hvm_guest;
+
+    rc = xc_cpu_policy_get_size(xch, &nr_leaves, &nr_msrs);
+    if ( rc )
+    {
+        PERROR("Failed to obtain policy info size");
+        rc = -errno;
+        goto out;
+    }
+
+    if ( (host = calloc(nr_msrs, sizeof(*host))) == NULL ||
+         (def  = calloc(nr_msrs, sizeof(*def)))  == NULL ||
+         (cur  = calloc(nr_msrs, sizeof(*cur)))  == NULL )
+    {
+        ERROR("Unable to allocate memory for %u CPUID leaves", nr_leaves);
+        rc = -ENOMEM;
+        goto out;
+    }
+
+    /* Get the domain's current policy. */
+    nr_leaves = 0;
+    nr_cur = nr_msrs;
+    rc = get_domain_cpu_policy(xch, domid, &nr_leaves, NULL, &nr_cur, cur);
+    if ( rc )
+    {
+        PERROR("Failed to obtain d%d current policy", domid);
+        rc = -errno;
+        goto out;
+    }
+
+    /* Get the domain type's default policy. */
+    nr_leaves = 0;
+    nr_def = nr_msrs;
+    rc = get_system_cpu_policy(xch, hvm ? XEN_SYSCTL_cpu_policy_hvm_default
+                                        : XEN_SYSCTL_cpu_policy_pv_default,
+                               &nr_leaves, NULL, &nr_def, def);
+    if ( rc )
+    {
+        PERROR("Failed to obtain %s def policy", hvm ? "hvm" : "pv");
+        rc = -errno;
+        goto out;
+    }
+
+    /* Get the host policy. */
+    nr_leaves = 0;
+    nr_host = nr_msrs;
+    rc = get_system_cpu_policy(xch, XEN_SYSCTL_cpu_policy_host,
+                               &nr_leaves, NULL, &nr_host, host);
+    if ( rc )
+    {
+        PERROR("Failed to obtain host policy");
+        rc = -errno;
+        goto out;
+    }
+
+    for ( ; msr->index != XC_MSR_INPUT_UNUSED; ++msr )
+    {
+        xen_msr_entry_t *cur_msr = find_msr(cur, nr_cur, msr->index);
+        const xen_msr_entry_t *def_msr = find_msr(def, nr_def, msr->index);
+        const xen_msr_entry_t *host_msr = find_msr(host, nr_host, msr->index);
+        unsigned int i;
+
+        if ( cur_msr == NULL || def_msr == NULL || host_msr == NULL )
+        {
+            ERROR("Missing MSR %#x", msr->index);
+            rc = -ENOENT;
+            goto out;
+        }
+
+        for ( i = 0; i < ARRAY_SIZE(msr->policy) - 1; i++ )
+        {
+            bool val;
+
+            if ( msr->policy[i] == '1' )
+                val = true;
+            else if ( msr->policy[i] == '0' )
+                val = false;
+            else if ( msr->policy[i] == 'x' )
+                val = test_bit(63 - i, &def_msr->val);
+            else if ( msr->policy[i] == 'k' )
+                val = test_bit(63 - i, &host_msr->val);
+            else
+            {
+                ERROR("MSR index %#x: bad character '%c' in policy string '%s'",
+                      msr->index, msr->policy[i], msr->policy);
+                rc = -EINVAL;
+                goto out;
+            }
+
+            if ( val )
+                set_bit(63 - i, &cur_msr->val);
+            else
+                clear_bit(63 - i, &cur_msr->val);
+        }
+    }
+
+    /* Feed the transformed policy back up to Xen. */
+    rc = xc_set_domain_cpu_policy(xch, domid, 0, NULL, nr_cur, cur,
+                                  &err_leaf, &err_subleaf, &err_msr);
+    if ( rc )
+    {
+        PERROR("Failed to set d%d's policy (err leaf %#x, subleaf %#x, msr %#x)",
+               domid, err_leaf, err_subleaf, err_msr);
+        rc = -errno;
+        goto out;
+    }
+
+    /* Success! */
+
+ out:
+    free(cur);
+    free(def);
+    free(host);
+
+    return rc;
+}
+
 int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
                           const uint32_t *featureset, unsigned int nr_features,
                           bool pae, bool itsc, bool nested_virt,
-                          const struct xc_xend_cpuid *xend)
+                          const struct xc_xend_cpuid *xend,
+                          const struct xc_msr *msr)
 {
     int rc;
     bool hvm;
@@ -663,6 +823,13 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
     if ( xend && (rc = xc_cpuid_xend_policy(xch, domid, xend)) )
         goto out;
 
+    if ( msr )
+    {
+        rc = xc_msr_policy(xch, domid, msr);
+        if ( rc )
+            goto out;
+    }
+
     rc = 0;
 
 out:
diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index f5ce9f97959c..c96aeb3bce46 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -502,7 +502,7 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
             info->tsc_mode == LIBXL_TSC_MODE_ALWAYS_EMULATE);
 
     r = xc_cpuid_apply_policy(ctx->xch, domid, restore, NULL, 0,
-                              pae, itsc, nested_virt, info->cpuid);
+                              pae, itsc, nested_virt, info->cpuid, NULL);
     if (r)
         LOGEVD(ERROR, -r, domid, "Failed to apply CPUID policy");
 
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 08:27:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 08:27:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566464.885301 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMP02-0001x6-24; Thu, 20 Jul 2023 08:27:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566464.885301; Thu, 20 Jul 2023 08:27:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMP01-0001wx-Ua; Thu, 20 Jul 2023 08:27:01 +0000
Received: by outflank-mailman (input) for mailman id 566464;
 Thu, 20 Jul 2023 08:27:01 +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
 <SRS0=/JYs=DG=citrix.com=prvs=558be806a=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMP01-0001wC-9g
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 08:27:01 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 30b1478a-26d7-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 10:26:58 +0200 (CEST)
Received: from mail-co1nam11lp2172.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.172])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 20 Jul 2023 04:26:56 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB5760.namprd03.prod.outlook.com (2603:10b6:a03:2d3::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul
 2023 08:26:54 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 08:26:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 30b1478a-26d7-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689841618;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=/DjRmCpyR41ndqdeo2ztSdCTQNy5XAVA3JYpNnatIeo=;
  b=ftnWY6hL7VgwqLsQWHpW9uHkZ1sj7j0WYvsNlDgAy4Fj4ycm/wRRfZvW
   31Ib4tDGKldjlw+MFBvQOG7RNHG/EkNH7Ha3PBHee9QaeBgb2ZH6uTeri
   SAoPqskD1Tl7skas/R1Be1y2gwvGudeIBSPTZAmbGFFhnCHiKvNLM9/ra
   w=;
X-IronPort-RemoteIP: 104.47.56.172
X-IronPort-MID: 119438774
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:Ch9616kpu7fNlT+VY510n3To5gylJ0RdPkR7XQ2eYbSJt1+Wr1Gzt
 xIeWW/UbKuLZDDweNtwbY3l80IA6pCGydY3G1Nt+30yESMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5geGzhH5MbpETU2PByqgKmVrNrbSq
 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/
 f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3
 eU3ITEtYwq+vbKd6bLjeswxhpsyHOC+aevzulk4pd3YJdAPZMmaBo7tvJpf1jp2gd1SF/HDY
 cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVkVI3iee3WDbWUoXiqcF9hEGXq
 3iA523kKhobKMae2XyO9XfEaurnxHqqBNlCS+LknhJsqGS612cPLRtOb1vhovK0r0GQeYlwO
 WVBr0LCqoB3riRHVOLVTxC+5XKJoBMYc95RCPEhrhGAzLLO5ASUDXRCSSROAPQ5sOcmSDps0
 UWG9/vrCiZoq6a9Um+G+/GfqjbaBMQOBWoLZCtBRgxc5dDm+dg3lkiWEYwlF7OphNroHz222
 yqNsCU1m7QUi4gMyrm/+lfExTmro/AlUzII2+keZUr9hisRWWJvT9XABYTzhRqYELukcw==
IronPort-HdrOrdr: A9a23:aCMXEahTclZrniC8DD8mkUFGdXBQXtkji2hC6mlwRA09TyVXrb
 HIoB17726TtN91YhsdcL+7Scq9qB/nlaKdgrNxAV7BZniFhILAFugLhrcKqAeQfhEWmNQtsZ
 uIsJITNDQzNzVHZArBjzVQ2uxP/OW6
X-Talos-CUID: 9a23:vKxboG/3ppn1GcCXT8+Vv1c7E8EFf2fg9if7Ck/gOUM0SOKEeXbFrQ==
X-Talos-MUID: =?us-ascii?q?9a23=3ArYQT+QwAMvpmTn1BATxJuho5TmmaqJ2HGUsRtJN?=
 =?us-ascii?q?egcneNid9Hjizrm+YUKZyfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,218,1684814400"; 
   d="scan'208";a="119438774"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=mj6B5YE8huTW1l3U6Wii6rXCReMMG04xbfwLrRwDRGscaB9W2/Rxq5vUgVCcPOpBYYj7n+O9Twi+wjl3bxRPY1hbp/rZyUphN5fm7H0o4oYaEu/rkKps37hdLClNO0NCVUT9A5BdnQO/wyRU0emVVkj9pIrgXUrM4tHJIfRUpFtc5aQ3GLbEX7RXDGdlNR8wjrA9UWOwwKvxh//LQCHoK+DOqoj+LV+6aY0GLDTPMUtXKCMWVyctC8srJNBOd+nbfHbQ2X7udOOgWBmLEQm+66OZ9NKWSoTIvvKJIefqJmkzXc3BjBDnCn/QzgfwACLoRyCMJjdm6LPuvytSUotWbg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OvAgEnMZzKsiO5gFVAUArv65sWJ/koiL8PS5eQmSiJs=;
 b=e2oEeOkYJgPmgfgEC1MHxqbS/+82LlQl2tus4SyYDXdEhEsjNAaei33ZgUh54UrKOTPBikTSvNHj9wiPC/kSE17+xKm86BXWI0ScpYj/sPhoYnrNlG3qI0tggCUHYCD9fN5lSXN5QDQZILEBVv35a4YXE+lTPFT+DwhB9uIxY1A8v20aw69hv5VZ2OqLcc2EZfPlXK19HC9B+O3fZfhFxoPtwKkB7b6lPLPBSroOQvW/IwVhnWHDJInp544I8p5W6/Zq2kaOU1ebjQCmBfOfr93QV6Cr13d2pqBq71rODh4UJlX1EIHVJQtXUPHW5fFc0z/ZL4+SwGKcGvkI47Pkuw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OvAgEnMZzKsiO5gFVAUArv65sWJ/koiL8PS5eQmSiJs=;
 b=QLrMQufRGVVfKDTMPYv+omkwjP5+eIV3lXbpZK07AgvBjBQa7QlWKGJCoe+uhyk10kKPjYo1EOnsLG03Hyg4aLxr6oCegOwI/LA/srngkrg3WU/pURlNxwpz4SfqXoqSywE7v7wGzzcwfFOmKyFz0dFAOSG9XYHvcdR28IL+WP8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v3 2/6] libxl: change the type of libxl_cpuid_policy_list
Date: Thu, 20 Jul 2023 10:25:36 +0200
Message-ID: <20230720082540.69444-3-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230720082540.69444-1-roger.pau@citrix.com>
References: <20230720082540.69444-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0159.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2c7::9) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5760:EE_
X-MS-Office365-Filtering-Correlation-Id: d2e00534-d6a8-4e32-58ad-08db88fb12fa
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	B4uE0kWJPx/DzfZ/csNp1qO8g2z23vKPFWCQCkxOozLbu8qB/BjIjie3ImPL8UgzvwM1dJ3VMiqzY0l2eWAs5sKe0hr4E9lstcp4XvdG/50gGUM3xorZmciJbeQgqI4U8R5rkLz/6P7crEO2cRG8KJ7c7uiQMK3WXF+7koh5aS2T607xXTxjvXRqfx1gGvhC+VVWZ62kvXkV4z8chNDOg9rYfOazhZXHRB0TXoKXdHcNxZsbdXGUFppW2KkDe1UIz1V3a1I1dbl+yKJvS30AXu0T1ATj1Ms1JXfaKT2FSVZYaTATIHubAzHsQf4wvFvR+Kq9qtBQc/2ImRs+nbEAe2McQLWibeFgkWpjptUJw1O3YTbFT5BttD3fzpd25NqrYTf7fgRPaCFQ7/zJIrW7JQ6TjU+f4wqT0jTFomG6Iy1sIbz59XT3npkHZevn5uMPgr3uq3TIwj1WCtNUE0hMS90XfC6yrNKxxi5TnghrV/DdVJBZ2BeuGvB8BIszXFQqpqZynq11LxKeqVAU0a0gVAMEXAFMAEbgkiq++D6MyUERihyqqopnBkYK4B1JF+Iv
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(346002)(136003)(376002)(366004)(451199021)(86362001)(478600001)(83380400001)(1076003)(186003)(38100700002)(41300700001)(26005)(54906003)(6916009)(8676002)(8936002)(316002)(2906002)(4326008)(6512007)(66556008)(66946007)(6666004)(66476007)(6486002)(6506007)(82960400001)(2616005)(36756003)(5660300002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TTEzOTE1V2oxb3ZVeUV2NVZ0OUx0R2VqNiszMFBaRzMwams2aXlYVnQ0QWpB?=
 =?utf-8?B?b29mek9kdUJGK2Q2Ynl4ZEVlOTE3Q2pGVy9XdG5pYVNnM1J3YWM2czFZcm5q?=
 =?utf-8?B?NTFPS1NSbjl5Kzg3UThuTkt6Vjk4MFo4N0VjNTA3UThTY1Z3QnByaFBmcWR5?=
 =?utf-8?B?M01FbURySzBaUCs0bE51bTlmazU0WnM4Sm83RjhrUmpncytmN1FFTUpSNFFq?=
 =?utf-8?B?cHlOWnMzQlk2Vi9kNTkzeGVGNEdwMDVRMlVTTytPcWtKZDU1c3FrZWxwUHdr?=
 =?utf-8?B?QkhZSDJvZjVGdmxJKzl5a2RZQ2lkVkhrUHllZHJNNnVRSTNYdWhHQkpJek9P?=
 =?utf-8?B?SkQ5dGpGQjRNcDdqUE1oV3B1bGF1OWs2N0VjZW1lN2JHQzNmSERCbVQ1RHF3?=
 =?utf-8?B?aUZSb2dhTjYraHdNRVFsVm9DVlBiL2ZYb0VLZVdDVHcrZH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ntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	4vSJAUG/Tj69xWnyJCfUI6agWHNuObh23GeJhXIG/ZnY6yizuwf/PC+6GYi9JIN/vsG0VXT59D9tlOnpnIu4k7sV9mTrsNkwPvfTO6w+A9cmBHzbi1+h7zMmnNmSmhGAqrSEfJcGUpNZd6CqtWIXu3WbtDRg0ZHK/ytOYL8lavfexwUResiq7OXh6O8xFYDjIY/SEZJiTDV9x1FbRw5ACbR8TV/VMI9iLXbaF/Th2JKTQYA+NTcW51991Ai1GS4RyiwWM/zi9X7m7wDQPk29U71aZw+WfF5Iz/y3DplaDeyucSi7I/62rcVF/2h1Sd6nIE4YWvzybKCz+BuWtPoaVq7XaBiYKv7y7sca3xnfeG3jkbZbvkWPrYSbXYu/O/g6hulE6MN3gixlqt5nEAZA0P6fuKjeBvluMP86UGVdmCQhnrzLEPBjSMzJCNsCiV16b7tWs/j7yvzQ9myJM3XnAue1GCYZj4YAbeiUcG7yxyKnNYTlLGh4L6orQzV56rU4bfXPQ1v8vDqaJNTkjWRgX1yo5KFvbUzpKmQXNuymUyvHM6EI+GHLJV9vf8hkV7bCFJtIcXzogVLOeWUH/NoIYcDHjK0RrN8LNcvDGdTxNIxR3VlmuiWR5bQu6FiMX3iL5338d6CkpiddTbv3oXT7RVQ0jtI3mtz1FmZoNHUKK86mavWijF3hYpYPF0auSnKxjhe+XFQRevQjwIBTBGGev/WhOR9zCJG4lEvp9LR5nRD5A06LTI0gBnCRQQJal9IvfkuRoAaHYL1DgexPPTC6zukQ/wuspJYid2Xkm2284wdqZ/jziFlbfDQWr0SSLBKw
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d2e00534-d6a8-4e32-58ad-08db88fb12fa
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 08:26:54.2132
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ztLEp0jOqdlrkrEQMauEoJ6IlX78pwBVEt0tQtsYZds5goEJchQuxSd5zSr5vpUY6aPEbhcXHJXxIQFPrSmsIg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5760

Currently libxl_cpuid_policy_list is an opaque type to the users of
libxl, and internally it's an array of xc_xend_cpuid objects.

Change the type to instead be a structure that contains one array for
CPUID policies, in preparation for it also holding another array for
MSR policies.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
---
Changes since v2:
 - Add braces in the inner loop.
 - Do not set the policy to NULL.
---
 tools/include/libxl.h             |  8 +--
 tools/libs/light/libxl_cpuid.c    | 87 ++++++++++++++++++++-----------
 tools/libs/light/libxl_internal.h |  4 ++
 3 files changed, 63 insertions(+), 36 deletions(-)

diff --git a/tools/include/libxl.h b/tools/include/libxl.h
index cac641a7eba2..f3975ecc021f 100644
--- a/tools/include/libxl.h
+++ b/tools/include/libxl.h
@@ -1455,12 +1455,8 @@ typedef struct {
 void libxl_bitmap_init(libxl_bitmap *map);
 void libxl_bitmap_dispose(libxl_bitmap *map);
 
-/*
- * libxl_cpuid_policy is opaque in the libxl ABI.  Users of both libxl and
- * libxc may not make assumptions about xc_xend_cpuid.
- */
-typedef struct xc_xend_cpuid libxl_cpuid_policy;
-typedef libxl_cpuid_policy * libxl_cpuid_policy_list;
+struct libxl__cpu_policy;
+typedef struct libxl__cpu_policy *libxl_cpuid_policy_list;
 void libxl_cpuid_dispose(libxl_cpuid_policy_list *cpuid_list);
 int libxl_cpuid_policy_list_length(const libxl_cpuid_policy_list *l);
 void libxl_cpuid_policy_list_copy(libxl_ctx *ctx,
diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index c96aeb3bce46..3c8b2a72c0b8 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -19,22 +19,29 @@ int libxl__cpuid_policy_is_empty(libxl_cpuid_policy_list *pl)
     return !libxl_cpuid_policy_list_length(pl);
 }
 
-void libxl_cpuid_dispose(libxl_cpuid_policy_list *p_cpuid_list)
+void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl)
 {
-    int i, j;
-    libxl_cpuid_policy_list cpuid_list = *p_cpuid_list;
+    libxl_cpuid_policy_list policy = *pl;
 
-    if (cpuid_list == NULL)
+    if (policy == NULL)
         return;
-    for (i = 0; cpuid_list[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
-        for (j = 0; j < 4; j++)
-            if (cpuid_list[i].policy[j] != NULL) {
-                free(cpuid_list[i].policy[j]);
-                cpuid_list[i].policy[j] = NULL;
+
+    if (policy->cpuid) {
+        unsigned int i, j;
+        struct xc_xend_cpuid *cpuid_list = policy->cpuid;
+
+        for (i = 0; cpuid_list[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
+            for (j = 0; j < 4; j++) {
+                if (cpuid_list[i].policy[j] != NULL) {
+                    free(cpuid_list[i].policy[j]);
+                }
             }
+        }
+        free(policy->cpuid);
     }
-    free(cpuid_list);
-    *p_cpuid_list = NULL;
+
+    free(policy);
+    *pl = NULL;
     return;
 }
 
@@ -62,11 +69,17 @@ struct cpuid_flags {
 /* go through the dynamic array finding the entry for a specified leaf.
  * if no entry exists, allocate one and return that.
  */
-static libxl_cpuid_policy_list cpuid_find_match(libxl_cpuid_policy_list *list,
-                                          uint32_t leaf, uint32_t subleaf)
+static struct xc_xend_cpuid *cpuid_find_match(libxl_cpuid_policy_list *pl,
+                                              uint32_t leaf, uint32_t subleaf)
 {
+    libxl_cpuid_policy_list policy = *pl;
+    struct xc_xend_cpuid **list;
     int i = 0;
 
+    if (policy == NULL)
+        policy = *pl = calloc(1, sizeof(*policy));
+
+    list = &policy->cpuid;
     if (*list != NULL) {
         for (i = 0; (*list)[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
             if ((*list)[i].input[0] == leaf && (*list)[i].input[1] == subleaf)
@@ -86,7 +99,7 @@ static libxl_cpuid_policy_list cpuid_find_match(libxl_cpuid_policy_list *list,
  * Will overwrite earlier entries and thus can be called multiple
  * times.
  */
-int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
+int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
 {
 #define NA XEN_CPUID_INPUT_UNUSED
     static const struct cpuid_flags cpuid_flags[] = {
@@ -345,7 +358,7 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
     if (flag->name == NULL) {
         return 2;
     }
-    entry = cpuid_find_match(cpuid, flag->leaf, flag->subleaf);
+    entry = cpuid_find_match(policy, flag->leaf, flag->subleaf);
     resstr = entry->policy[flag->reg - 1];
     num = strtoull(val, &endptr, 0);
     flags[flag->length] = 0;
@@ -400,7 +413,7 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
  * the strings for each register were directly exposed to the user.
  * Used for maintaining compatibility with older config files
  */
-int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *cpuid,
+int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *policy,
                                   const char* str)
 {
     char *endptr;
@@ -427,7 +440,7 @@ int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *cpuid,
         return 3;
     }
     str = endptr + 1;
-    entry = cpuid_find_match(cpuid, leaf, subleaf);
+    entry = cpuid_find_match(policy, leaf, subleaf);
     for (str = endptr + 1; *str != 0;) {
         if (str[0] != 'e' || str[2] != 'x') {
             return 4;
@@ -502,7 +515,8 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
             info->tsc_mode == LIBXL_TSC_MODE_ALWAYS_EMULATE);
 
     r = xc_cpuid_apply_policy(ctx->xch, domid, restore, NULL, 0,
-                              pae, itsc, nested_virt, info->cpuid, NULL);
+                              pae, itsc, nested_virt,
+                              info->cpuid ? info->cpuid->cpuid : NULL, NULL);
     if (r)
         LOGEVD(ERROR, -r, domid, "Failed to apply CPUID policy");
 
@@ -527,16 +541,18 @@ static const char *policy_names[4] = { "eax", "ebx", "ecx", "edx" };
  */
 
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
-                                libxl_cpuid_policy_list *pcpuid)
+                                libxl_cpuid_policy_list *pl)
 {
-    libxl_cpuid_policy_list cpuid = *pcpuid;
+    libxl_cpuid_policy_list policy = *pl;
+    struct xc_xend_cpuid *cpuid;
     yajl_gen_status s;
     int i, j;
 
     s = yajl_gen_array_open(hand);
     if (s != yajl_gen_status_ok) goto out;
 
-    if (cpuid == NULL) goto empty;
+    if (policy == NULL || policy->cpuid == NULL) goto empty;
+    cpuid = policy->cpuid;
 
     for (i = 0; cpuid[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
         s = yajl_gen_map_open(hand);
@@ -575,7 +591,7 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
                                         libxl_cpuid_policy_list *p)
 {
     int i, size;
-    libxl_cpuid_policy_list l;
+    struct xc_xend_cpuid *l;
     flexarray_t *array;
 
     if (!libxl__json_object_is_array(o))
@@ -586,8 +602,10 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
         return 0;
 
     size = array->count;
+    *p = libxl__calloc(NOGC, 1, sizeof(**p));
     /* need one extra slot as sentinel */
-    l = *p = libxl__calloc(NOGC, size + 1, sizeof(libxl_cpuid_policy));
+    l = (*p)->cpuid = libxl__calloc(NOGC, size + 1,
+                                    sizeof(struct xc_xend_cpuid));
 
     l[size].input[0] = XEN_CPUID_INPUT_UNUSED;
     l[size].input[1] = XEN_CPUID_INPUT_UNUSED;
@@ -630,8 +648,12 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
 int libxl_cpuid_policy_list_length(const libxl_cpuid_policy_list *pl)
 {
     int i = 0;
-    libxl_cpuid_policy_list l = *pl;
+    const struct xc_xend_cpuid *l;
+
+    if (*pl == NULL)
+        return 0;
 
+    l = (*pl)->cpuid;
     if (l) {
         while (l[i].input[0] != XEN_CPUID_INPUT_UNUSED)
             i++;
@@ -641,20 +663,25 @@ int libxl_cpuid_policy_list_length(const libxl_cpuid_policy_list *pl)
 }
 
 void libxl_cpuid_policy_list_copy(libxl_ctx *ctx,
-                                  libxl_cpuid_policy_list *dst,
-                                  const libxl_cpuid_policy_list *src)
+                                  libxl_cpuid_policy_list *pdst,
+                                  const libxl_cpuid_policy_list *psrc)
 {
+    struct xc_xend_cpuid **dst;
+    struct xc_xend_cpuid *const *src;
     GC_INIT(ctx);
     int i, j, len;
 
-    if (*src == NULL) {
-        *dst = NULL;
+    if (*psrc == NULL) {
+        *pdst = NULL;
         goto out;
     }
 
-    len = libxl_cpuid_policy_list_length(src);
+    *pdst = libxl__calloc(NOGC, 1, sizeof(**pdst));
+    dst = &(*pdst)->cpuid;
+    src = &(*psrc)->cpuid;
+    len = libxl_cpuid_policy_list_length(psrc);
     /* one extra slot for sentinel */
-    *dst = libxl__calloc(NOGC, len + 1, sizeof(libxl_cpuid_policy));
+    *dst = libxl__calloc(NOGC, len + 1, sizeof(struct xc_xend_cpuid));
     (*dst)[len].input[0] = XEN_CPUID_INPUT_UNUSED;
     (*dst)[len].input[1] = XEN_CPUID_INPUT_UNUSED;
 
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index 1cf3d400bfce..ef882cff3912 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -4869,6 +4869,10 @@ int libxl__setresuid(uid_t ruid, uid_t euid, uid_t suid);
 _hidden int libxl__domain_set_paging_mempool_size(
     libxl__gc *gc, libxl_domain_config *d_config, uint32_t domid);
 
+struct libxl__cpu_policy {
+    struct xc_xend_cpuid *cpuid;
+};
+
 #endif
 
 /*
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 08:27:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 08:27:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566465.885311 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMP08-0002Or-Gu; Thu, 20 Jul 2023 08:27:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566465.885311; Thu, 20 Jul 2023 08:27:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMP08-0002Oe-Df; Thu, 20 Jul 2023 08:27:08 +0000
Received: by outflank-mailman (input) for mailman id 566465;
 Thu, 20 Jul 2023 08:27:06 +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
 <SRS0=/JYs=DG=citrix.com=prvs=558be806a=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMP06-0001wC-Oa
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 08:27:06 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 343663dd-26d7-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 10:27:04 +0200 (CEST)
Received: from mail-co1nam11lp2172.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.172])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 20 Jul 2023 04:27:02 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB5760.namprd03.prod.outlook.com (2603:10b6:a03:2d3::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul
 2023 08:27:00 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 08:27:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 343663dd-26d7-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689841624;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=PoGS6PLKgGovzFPQKOOfY9Pvlc4ex9V0H8gcinS47Ag=;
  b=Gt+mtOs3pvo+T0qyH3SMcqraOHRFPeaomUo1zWRO8TB13SFiJMz1zDZW
   JOX7OslVKmaBpoBSXMTZSQ+QwlR37UH354P4JOC+KLSwZi3fbgxzY+z0P
   PHEz/T1wsBLDtfXdIhc01JZ4rRHJ4NZMT+dQRIbyBNKfsd35O+lIhOAl0
   g=;
X-IronPort-RemoteIP: 104.47.56.172
X-IronPort-MID: 115538996
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:e+gJrKLBCU7Ynob6FE+R9ZQlxSXFcZb7ZxGr2PjKsXjdYENS1zADy
 mYdWmzTaPzeM2L8ftB1OYq380wA7cPRm4I3HVdlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws
 Jb5rta31GWNglaYCUpKrfrawP9TlK6q4mhA4QZmPakjUGL2zBH5MrpOfcldEFOgKmVkNrbSb
 /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/
 jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5lE1Bt9
 OIcNwsxRR+niNDmnbOiTLZz05FLwMnDZOvzu1lG5BSAVLMNZsmGRK/Ho9hFwD03m8ZCW+7EY
 NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/dppTGMlmSd05C0WDbRUsaNSshP2F6Ru
 0rN/njjAwFcP9uaodaA2iv127KUzXKqBur+EpW27OBBnkXJ+lUPGR48CFaCm/eHmG6xDoc3x
 0s8v3BGQbIJ3FymSJzxUgO1pFaAvwUAQJxAHusi8gaPx6HIpQGDCQAsUTppeNEg8sgsSlQC1
 FCTmMjyLSdyq7DTQnWYnop4thu3MCkRaGQFPCkNSFJc58G5+d5pyBXSUtxkDai5yMXvHi39y
 CyLqy54gKgPickM1OOw+lWvby+Qm6UlhzUdvm3/Nl9JJCsgDGJ5T+REMWTm0Ms=
IronPort-HdrOrdr: A9a23:1yX65KjIUoG+zzZtwIv9hhCeVHBQXtkji2hC6mlwRA09TyVXrb
 HIoB17726TtN91YhsdcL+7Scq9qB/nlaKdgrNxAV7BZniFhILAFugLhrcKqAeQfhEWmNQtsZ
 uIsJITNDQzNzVHZArBjzVQ2uxP/OW6
X-Talos-CUID: =?us-ascii?q?9a23=3ABPhhamu6pzRLu9ijtnUMK3ZD6Is3YEz+zWnUPHS?=
 =?us-ascii?q?EImlNR4/FFF6J/vx7xp8=3D?=
X-Talos-MUID: 9a23:9JI9gARcABS1sRlkRXTini9JKt8y352yGUMnzJg/gce6Jwx/bmI=
X-IronPort-AV: E=Sophos;i="6.01,218,1684814400"; 
   d="scan'208";a="115538996"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CCRXOicWHAj9nEam5AAl05SmfyylXnGj50Fi3ENH8ZfEu97VZIfuDVJQd2+n5KyxTJiG1zr/+7VZkCdUgHJ25gp8zxHsIVnLDQBdWPbmdK+IxIZaFVd7hnwAl7TZSl/wiVYzIZLya89RfdDDyS6jGEgn/tQGORnzS65VLODcRTTpieH28jxvtENsM6oq+2L7hZQOxNRmw5RGlhGtDsA+esif5glkEf4IKFK+QF3b4IZ0ZOV23lRkMnn8HAGYQNb+uBA894cLcCJp5b5rfQ/fj2E9+c4CLBhcaOrVMZsczuKLojOt4h9DcMvCfXZBYeAm5txf9Oy7Uo1BL7MS794ZgA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=2/LRt01+eEG0RC09vGzKXREvrvgUJopnQM/vveJrCdc=;
 b=JcBDwyO6+8HV7w1+UryyI7sTqZfEy98ACBit3u3og6bcectR8wcd+RsWPSm68egGoRkw6iujZbGkEocgr91gxsiAPMjNTTCOvbHTFb229/VyNFIGHZCcyN92ud2NxuCfbVAuUlJC57KVJ4ifRSMRFUq2WCYg0c/LFIuw6zY1SjfL6w4++KIJn/00sPoP91MOE+g1d4mOrZseLkeFmQIUxS2V3ptlNeo7DU4uIGaQTAoiUHia6ADG67b6S8Hzjn4YvU7h+NBCaF2gn4weNwWWIe3Zhsm5rsxJyOjx54AvlQGyk/+kAVD71UbkkkHn6SEx97aWn6znJFG2/0RxhlM33w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=2/LRt01+eEG0RC09vGzKXREvrvgUJopnQM/vveJrCdc=;
 b=KvlmP9kLvbXZXMd9d2dnHQEDUM5IvH024MLWclhx3pkR1VDxyf9GjWyR+FvXDfpVtdNFDFmZZQ2T0+wn9B3+kwtXkjt1iSKCsHMhMFTkB9KbwDTM6Hcm2VMbRYXXpyG84v/+WMYM0w7ObxbLgDG2DKKkxOBdUreXlmCBXfH+tbU=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v3 3/6] libxl: introduce MSR data in libxl_cpuid_policy
Date: Thu, 20 Jul 2023 10:25:37 +0200
Message-ID: <20230720082540.69444-4-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230720082540.69444-1-roger.pau@citrix.com>
References: <20230720082540.69444-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO3P123CA0004.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:ba::9) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5760:EE_
X-MS-Office365-Filtering-Correlation-Id: 0b1fa335-f0b2-40b0-b4fe-08db88fb168d
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	mpJ5Ulom3cy8Aq5OQEZmw89hFhI9oKQxwCIaJCP9xKeffL6RNVFl5MVIvuxsaqiHzCjHub3YQ5/SieFvQ6vTEDDlKc3U2+iEWGKTVSNRrOhx8hZbF9Kko+xvLAE8UQ5hiWkuM/e9SXNf7YurWwD9tluBywTcSj7jBBkHS6Pg8fNdWdt88ARXQ18FpnhE2ktJnYLydZOc1++J8oLYi1dp20BfuX1fvHJsa293IYFmXcBv0PX+YrdSudm32/JWcg1+weVf3Opb2Dy/NcL1GbLabZ37VzmqMitGEAypuZIn2U90HiPtJ8MC53KXSiUUECvo83L7XermNFiL4FpH46jujvwYlBTqypZXL/hbJjQbjTLr6xVBiqxHr5hLe6PqAK1g5elPjqiukga9Dg9bine2Qk6LHTNqkLUisHNozZ9w1MDYOgNPg56hEOv3WbG8Pt15ZmXqtzCDOXQ91betB8qilbQJ1ZIDgFmhZolZ/8p82mWsxxsHccRgJ60jNKkUpj/3QGlbP8/A6K66L2FVRac31JcCBQ7XW0z7twsLw9dH+OfIWjoYc/lAGxnrShQfmnt3
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(346002)(136003)(376002)(366004)(451199021)(86362001)(478600001)(83380400001)(1076003)(186003)(38100700002)(41300700001)(26005)(54906003)(6916009)(8676002)(8936002)(316002)(2906002)(4326008)(6512007)(66556008)(66946007)(6666004)(66476007)(6486002)(6506007)(82960400001)(2616005)(36756003)(5660300002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QnFhalZzamFld2VJY2VpdnFBbTN1Z1h3YWZ5dHVKdnE1eVc5bjIrZmxwSzJs?=
 =?utf-8?B?bHZCZkREdnE0eGg1TDh0S05ma1VhVUxXTFgxV1JqVzlVcHAzMGVFOWM5UFp2?=
 =?utf-8?B?SHRRNVZTekdXbHBBeGwvNENNL1U1VzVSSGFBUGltOXB2SnlNNlV3ZmprU0Yw?=
 =?utf-8?B?ejFXVERrczlyTUVyYWVEZG5INnMxN3h6QlFDbExQR0twK0E3R1l3bkZvWXJm?=
 =?utf-8?B?aEplU3NVcHlSVmczdUwrRzhGUU5icFY3WVg4VU5ldFJ4M00wb3NDV3FSMzdC?=
 =?utf-8?B?OFYyVEk4RkJHaGMyME5WNldKaHV6K0FySDZIUWplYlJCWlZUNmJ4TDJOdkMy?=
 =?utf-8?B?OVlKcldabVBHaHc2QTlFS2lxRmFCa0Z6eUtqZEU3aFR1c1VrRG90Rzc5UkpQ?=
 =?utf-8?B?UDJ1N1k5QmpmTEZjOVpodUdyVHhBVjBGODRQY1U3WGNGaXRsUG1MRzU5SEJa?=
 =?utf-8?B?TU9qWjFDNlBpejlkcmIySk9OeHE0Yk42OXhOZjJSMDJDaFYvTURmYzAySkgy?=
 =?utf-8?B?cFNMVitNK3lRTTdIeS95QXMvbFExTFVISGMxTzNibnRzYkxmZDlGVVBIRDM1?=
 =?utf-8?B?bHNyRUxxMFU5aE1TYWZDNUxEVWVicTVzRXY3U3o4OHpmVERZSDJ3d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CifSh67z5o15x9z6yxYVCtZuerCZe221sOfQxhNXkI81XW49KhW5YDsnbIPgPQAXkKtmAn0a0BqErXuXxXhKyFOs6blDKpQ/v4PE0+Lbdx8Md+I/SigzMrd5UNRlfqF690InPfZJQzIbxlS1fAQMZcx5fk3og17kBRI4pphwHjj7geBxoeKXjlwpiFdG34UOYb/4eAOgMHv/88/UXJclVoeQgMpKCM1njCu/QR5brCe+uuvmtyTFIcdACVCUAnaukXoCDeJo4NxXZFcPpgimb/tYO8/t53v35SgYvaYCW2cYhyleAZA2H9jlaZJj9NbSBl2NFbZTLCBQAs5uC6SdSduSTXTgr976LZdQAjdE5TifKq2VofhwO+ct/DafSvU9aP1xpU9WfqCyn/D92hxtRDQKBVDYjWUf22Jg1n9ZxAJm/t17yPxMEhWrxt82kZvKF0+wJ+IL3ILuBIIE7X0OS9A8sNsxogLjyh9RrJEQH40IeHNptFdCW23GgZrLcAauriTzYRn1kgtuFJpv6abLPbB4JE3rNRd+NANOrFjHk22pWxHIHql5f7AODDnLFpAHsVrEM6/ui+tn35PxGqJBmWqQPSZJA2hwSqTxDGsw/tAZmIdsbUShdtsesanTFbdFVe/nmelSxfq07FFUSG7zHrqmK7hhukHFz7qJNkLmuMb9K6IW1
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0b1fa335-f0b2-40b0-b4fe-08db88fb168d
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 08:27:00.0946
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: /ZyCqlIVpX1OMka4s1N2f7nNp13P37W2t7QFjQhIuaOrQkrCrV0kIqEnpxEAWh/mXq03wgv+dsU4+uQAjouiHA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5760

Add a new array field to libxl_cpuid_policy in order to store the MSR
policies.

Adding the MSR data in the libxl_cpuid_policy_list type is done so
that existing users can seamlessly pass MSR features as part of the
CPUID data, without requiring the introduction of a separate
domain_build_info field, and a new set of handlers functions.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
Changes since v2:
 - Unconditionally call free().
 - Implement the JSON marshaling functions.
---
It would be nice to rename the json output field to 'cpu_policy'
instead of 'cpuid', so that it looks like:

"cpu_policy": {
    "cpuid": [
        {
            "leaf": 7,
            "subleaf": 0,
            "edx": "xx1xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
        },
        {
            "leaf": 1,
            "ebx": "xxxxxxxxxxxxxxxx00010000xxxxxxxx"
        }
        }
        }
    ],
    "msr": [
        {
            "index": 266,
            "policy": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1xx1x1"
        }
    ]
},

Sadly I have no idea how to do that, and can be done in a followup
change anyway.
---
 tools/libs/light/libxl_cpuid.c    | 142 ++++++++++++++++++++++++++----
 tools/libs/light/libxl_internal.h |   1 +
 tools/libs/light/libxl_types.idl  |   2 +-
 3 files changed, 128 insertions(+), 17 deletions(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index 3c8b2a72c0b8..68b797886642 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -16,7 +16,7 @@
 
 int libxl__cpuid_policy_is_empty(libxl_cpuid_policy_list *pl)
 {
-    return !libxl_cpuid_policy_list_length(pl);
+    return !*pl || (!libxl_cpuid_policy_list_length(pl) && !(*pl)->msr);
 }
 
 void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl)
@@ -40,6 +40,8 @@ void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl)
         free(policy->cpuid);
     }
 
+    free(policy->msr);
+
     free(policy);
     *pl = NULL;
     return;
@@ -516,7 +518,8 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
 
     r = xc_cpuid_apply_policy(ctx->xch, domid, restore, NULL, 0,
                               pae, itsc, nested_virt,
-                              info->cpuid ? info->cpuid->cpuid : NULL, NULL);
+                              info->cpuid ? info->cpuid->cpuid : NULL,
+                              info->cpuid ? info->cpuid->msr : NULL);
     if (r)
         LOGEVD(ERROR, -r, domid, "Failed to apply CPUID policy");
 
@@ -528,16 +531,22 @@ static const char *input_names[2] = { "leaf", "subleaf" };
 static const char *policy_names[4] = { "eax", "ebx", "ecx", "edx" };
 /*
  * Aiming for:
- * [
- *     { 'leaf':    'val-eax',
- *       'subleaf': 'val-ecx',
- *       'eax':     'filter',
- *       'ebx':     'filter',
- *       'ecx':     'filter',
- *       'edx':     'filter' },
- *     { 'leaf':    'val-eax', ..., 'eax': 'filter', ... },
- *     ... etc ...
- * ]
+ * {   'cpuid': [
+ *              { 'leaf':    'val-eax',
+ *                'subleaf': 'val-ecx',
+ *                'eax':     'filter',
+ *                'ebx':     'filter',
+ *                'ecx':     'filter',
+ *                'edx':     'filter' },
+ *              { 'leaf':    'val-eax', ..., 'eax': 'filter', ... },
+ *              ... etc ...
+ *     ],
+ *     'msr': [
+ *            { 'index': 'val-index',
+ *              'policy': 'filter', },
+ *              ... etc ...
+ *     ],
+ * }
  */
 
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
@@ -545,9 +554,16 @@ yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
 {
     libxl_cpuid_policy_list policy = *pl;
     struct xc_xend_cpuid *cpuid;
+    struct xc_msr *msr;
     yajl_gen_status s;
     int i, j;
 
+    s = yajl_gen_map_open(hand);
+    if (s != yajl_gen_status_ok) goto out;
+
+    s = libxl__yajl_gen_asciiz(hand, "cpuid");
+    if (s != yajl_gen_status_ok) goto out;
+
     s = yajl_gen_array_open(hand);
     if (s != yajl_gen_status_ok) goto out;
 
@@ -582,6 +598,39 @@ yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
 
 empty:
     s = yajl_gen_array_close(hand);
+    if (s != yajl_gen_status_ok) goto out;
+
+    s = libxl__yajl_gen_asciiz(hand, "msr");
+    if (s != yajl_gen_status_ok) goto out;
+
+    s = yajl_gen_array_open(hand);
+    if (s != yajl_gen_status_ok) goto out;
+
+    if (!policy || !policy->msr) goto done;
+    msr = policy->msr;
+
+    for (i = 0; msr[i].index != XC_MSR_INPUT_UNUSED; i++) {
+        s = yajl_gen_map_open(hand);
+        if (s != yajl_gen_status_ok) goto out;
+
+        s = libxl__yajl_gen_asciiz(hand, "index");
+        if (s != yajl_gen_status_ok) goto out;
+        s = yajl_gen_integer(hand, msr[i].index);
+        if (s != yajl_gen_status_ok) goto out;
+        s = libxl__yajl_gen_asciiz(hand, "policy");
+        if (s != yajl_gen_status_ok) goto out;
+        s = yajl_gen_string(hand,
+                            (const unsigned char *)msr[i].policy, 64);
+        if (s != yajl_gen_status_ok) goto out;
+
+        s = yajl_gen_map_close(hand);
+        if (s != yajl_gen_status_ok) goto out;
+    }
+
+done:
+    s = yajl_gen_array_close(hand);
+    if (s != yajl_gen_status_ok) goto out;
+    s = yajl_gen_map_close(hand);
 out:
     return s;
 }
@@ -592,17 +641,24 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
 {
     int i, size;
     struct xc_xend_cpuid *l;
+    struct xc_msr *msr;
+    const libxl__json_object *co;
     flexarray_t *array;
 
-    if (!libxl__json_object_is_array(o))
+    if (!libxl__json_object_is_map(o))
         return ERROR_FAIL;
 
-    array = libxl__json_object_get_array(o);
+    co = libxl__json_map_get("cpuid", o, JSON_ARRAY);
+    if (!libxl__json_object_is_array(co))
+        return ERROR_FAIL;
+
+    *p = libxl__calloc(NOGC, 1, sizeof(**p));
+
+    array = libxl__json_object_get_array(co);
     if (!array->count)
-        return 0;
+        goto cpuid_empty;
 
     size = array->count;
-    *p = libxl__calloc(NOGC, 1, sizeof(**p));
     /* need one extra slot as sentinel */
     l = (*p)->cpuid = libxl__calloc(NOGC, size + 1,
                                     sizeof(struct xc_xend_cpuid));
@@ -642,6 +698,40 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
         }
     }
 
+cpuid_empty:
+    co = libxl__json_map_get("msr", o, JSON_ARRAY);
+    if (!libxl__json_object_is_array(co))
+        return ERROR_FAIL;
+
+    array = libxl__json_object_get_array(co);
+    if (!array->count)
+        return 0;
+    size = array->count;
+    /* need one extra slot as sentinel */
+    msr = (*p)->msr = libxl__calloc(NOGC, size + 1, sizeof(struct xc_msr));
+
+    msr[size].index = XC_MSR_INPUT_UNUSED;
+
+    for (i = 0; i < size; i++) {
+        const libxl__json_object *t, *r;
+
+        if (flexarray_get(array, i, (void**)&t) != 0)
+            return ERROR_FAIL;
+
+        if (!libxl__json_object_is_map(t))
+            return ERROR_FAIL;
+
+        r = libxl__json_map_get("index", t, JSON_INTEGER);
+        if (!r) return ERROR_FAIL;
+        msr[i].index = libxl__json_object_get_integer(r);
+        r = libxl__json_map_get("policy", t, JSON_STRING);
+        if (!r) return ERROR_FAIL;
+        if (strlen(libxl__json_object_get_string(r)) !=
+            ARRAY_SIZE(msr[i].policy) - 1)
+            return ERROR_FAIL;
+        strcpy(msr[i].policy, libxl__json_object_get_string(r));
+    }
+
     return 0;
 }
 
@@ -677,6 +767,10 @@ void libxl_cpuid_policy_list_copy(libxl_ctx *ctx,
     }
 
     *pdst = libxl__calloc(NOGC, 1, sizeof(**pdst));
+
+    if (!(*psrc)->cpuid)
+        goto copy_msr;
+
     dst = &(*pdst)->cpuid;
     src = &(*psrc)->cpuid;
     len = libxl_cpuid_policy_list_length(psrc);
@@ -696,6 +790,22 @@ void libxl_cpuid_policy_list_copy(libxl_ctx *ctx,
                 (*dst)[i].policy[j] = NULL;
     }
 
+copy_msr:
+    if ((*psrc)->msr) {
+        const struct xc_msr *msr = (*psrc)->msr;
+
+        for (i = 0; msr[i].index != XC_MSR_INPUT_UNUSED; i++)
+            ;
+        len = i;
+        (*pdst)->msr = libxl__calloc(NOGC, len + 1, sizeof(struct xc_msr));
+        (*pdst)->msr[len].index = XC_MSR_INPUT_UNUSED;
+
+        for (i = 0; i < len; i++) {
+            (*pdst)->msr[i].index = msr[i].index;
+            strcpy((*pdst)->msr[i].policy, msr[i].policy);
+        }
+    }
+
 out:
     GC_FREE;
 }
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index ef882cff3912..b1a7cd9f615b 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -4871,6 +4871,7 @@ _hidden int libxl__domain_set_paging_mempool_size(
 
 struct libxl__cpu_policy {
     struct xc_xend_cpuid *cpuid;
+    struct xc_msr *msr;
 };
 
 #endif
diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
index 9e48bb772646..887824fdd828 100644
--- a/tools/libs/light/libxl_types.idl
+++ b/tools/libs/light/libxl_types.idl
@@ -19,7 +19,7 @@ libxl_mac = Builtin("mac", json_parse_type="JSON_STRING", passby=PASS_BY_REFEREN
 libxl_bitmap = Builtin("bitmap", json_parse_type="JSON_ARRAY", dispose_fn="libxl_bitmap_dispose", passby=PASS_BY_REFERENCE,
                        check_default_fn="libxl_bitmap_is_empty", copy_fn="libxl_bitmap_copy_alloc")
 libxl_cpuid_policy_list = Builtin("cpuid_policy_list", dispose_fn="libxl_cpuid_dispose", passby=PASS_BY_REFERENCE,
-                                  json_parse_type="JSON_ARRAY", check_default_fn="libxl__cpuid_policy_is_empty",
+                                  json_parse_type="JSON_MAP", check_default_fn="libxl__cpuid_policy_is_empty",
                                   copy_fn="libxl_cpuid_policy_list_copy")
 
 libxl_string_list = Builtin("string_list", dispose_fn="libxl_string_list_dispose", passby=PASS_BY_REFERENCE,
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 08:27:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 08:27:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566467.885321 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMP0E-0002pd-Qj; Thu, 20 Jul 2023 08:27:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566467.885321; Thu, 20 Jul 2023 08:27:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMP0E-0002pU-NO; Thu, 20 Jul 2023 08:27:14 +0000
Received: by outflank-mailman (input) for mailman id 566467;
 Thu, 20 Jul 2023 08:27:13 +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
 <SRS0=/JYs=DG=citrix.com=prvs=558be806a=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMP0D-0001wC-1W
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 08:27:13 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 37ecb9dd-26d7-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 10:27:10 +0200 (CEST)
Received: from mail-co1nam11lp2177.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.177])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 20 Jul 2023 04:27:08 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB5760.namprd03.prod.outlook.com (2603:10b6:a03:2d3::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul
 2023 08:27:06 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 08:27:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 37ecb9dd-26d7-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689841630;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=z60meDtNx5jYvrY40BCNAM50IKsscj3nDQMwXvAX/mA=;
  b=cgr0S3a3lVFKsggm+jCO+CsRJfpIEIqeWmDkDNJMSxgQzCnz1TasDm9V
   ba5XReiP6di1n0u/mnpxK3qbisuTXxeMjf2klOklgG8AG53PEJqHFC9nD
   XDXjWeN5uwCGn0JyiN5LUyx7pFp+pE07SqMLXc0x5Z1qiQgCC5VoVqlWU
   g=;
X-IronPort-RemoteIP: 104.47.56.177
X-IronPort-MID: 117268389
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderG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
X-Talos-CUID: 9a23:OguAtWxLYquZAFr0Eul9BgUoPscsclLY906TCEX/IH9oRbS2RUeprfY=
X-Talos-MUID: 9a23:ymgbAQSmvgrALLRcRXT31QtNEcF3zp2QSwMPy7MZlPavFhRJbmI=
X-IronPort-AV: E=Sophos;i="6.01,218,1684814400"; 
   d="scan'208";a="117268389"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=SuvGwHQlA5KWywFZDsOTo8OIOgG+1uQR8+iS/1C60frKPgdsrVL6KipGBr6dvxPYLriufKBfA98QS07p962U1BFT9PhfHVqVbc2eD6+NhVsw3u/NYIL3WjZzfhY/kLVVwHX7wUo1abNmnhuUUBHbC0/CAOxvWMNOeSeepCWSsM1iyhVjjfmEYW+E+9BAzM16MrHhBNmTChoq/DapjhrxUZm7jOLwgp3F6++e7z5XKqSc9PTrk8vlY07J4RL3TecmYzCilnrmw7tMh6TYDbrD3qts15aapuz+20Z4L71DDrI+5pljUJGF6L7fDVXJ0L8jQb02dry5PVbm3S8ac9X/dw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LHmNVAJhwJyrZMNRZ2DJFQDWxfGyOuELk3JbP/xrT3Q=;
 b=FUvZcNT5+HPslFHGsngP2St3wqOGHowKZwVyDibpXsG5GechAYFk5zmDWRXbKdktnXQM/KTuXyzZuV+k5AqcaH2DR9dV7H+/vau4UMQFb6kkOyWfI4xE6vZv4FLHk1Qq+Frft/XBW0BnCPK2BxFqyP3rDR7l32CDwHhcS8ty8FeKkDgu4rE7ZWqwTCmLAW07WQlupITP6M5+5kKKaUa0f8pwX3wwL0J+NGyUH/FFGNWmHJcrAt4yjxqrww1Lv5uh9bI03aK8a4JhbonQrr1mHC06+ljy/cMg+7NgETx9Eeea9K+H/qWC+ZXGKoH/Q3HbZsF4YHKQ2QIRKE4V8VcL2Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LHmNVAJhwJyrZMNRZ2DJFQDWxfGyOuELk3JbP/xrT3Q=;
 b=sTJ2TlGasGqAilrAbMvGvMwSoRTuTY2LocyqtrqvqUETnH9m2Lke48NTLsgo5Dvq+zh3Ve8buhhJrm92UGKeeXz5qLU0Zfs/UYzrRJ3+E2hDjxFYcqEH0ssUXtZYkii1J8rcIjQmS86e49n+Cdzof2uhS2ABM1miAy2JqrJjZC4=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v3 4/6] libxl: split logic to parse user provided CPUID features
Date: Thu, 20 Jul 2023 10:25:38 +0200
Message-ID: <20230720082540.69444-5-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230720082540.69444-1-roger.pau@citrix.com>
References: <20230720082540.69444-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LNXP265CA0048.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:5c::36) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5760:EE_
X-MS-Office365-Filtering-Correlation-Id: 93afaddc-7181-46a9-ed88-08db88fb19fa
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	5A0nSjhlQ7AMcdRVHyK6Qpdp0UUN8UQ9ES0nmA0UJybYx6+QKMDf1MMAxpxUupONFu+soZbTekvdifVpftQ9qjbbxcjtlwgdoROzFR2Dq29iGZd+O3AgNMDHqZ4/ZlR60pDHVpt6LLve9ZiirgU7kqIJKn9qBWiiT/GgfYhDpkzYcV4GHWqQ0DsakSIMB2rBWJEa0HK+nndkFKZ/qcsazMgoBa1MKuztF/3sAjzcuDpcQNmQtJVuCWv1fibG7jqPP/41oY92kgQExdCNS165fDHKkBbIWZy21+6K3ubbDJ/IxGk0wfjTmLOzFlIS80h/eli54uAuv6y89afJYtvcwxTU2RaggxLAmpx7HOgMrhvKa0e8hTxns8b6xWfyp+ezQJ6g6+kJSPPDKNMXZFaSqituBF4R5bp9QNd8AA+00el3Bo2fPGTw3Gb8JR2EsfeBXMVyb+Luhh+cdp5VAk2ukifDQPe8Sxup3Dwy1Gt1NxXFPo6KtryYrnaHZoBwW5r8d3SckZ+wW55S8g+zHsz1bDIu3dvDGmfA141VapEKgZ2HvwUNqok9nSVKa/4ObR/i
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(346002)(136003)(376002)(366004)(451199021)(86362001)(478600001)(83380400001)(1076003)(186003)(38100700002)(41300700001)(26005)(54906003)(6916009)(8676002)(8936002)(316002)(2906002)(4326008)(6512007)(66556008)(66946007)(6666004)(66476007)(6486002)(6506007)(82960400001)(2616005)(36756003)(5660300002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Wk9RNjkrR1AxNGJDZEVIOGhPek5wRGljQ3ZJa1NVbjI4M0p4NHdZeVJrWUNZ?=
 =?utf-8?B?STY0dEtkRlZUWEpSR0JOQi9Ra1BMZlBuMEFYbmhwNmhGRXdPejlnQlNiTXhB?=
 =?utf-8?B?TGFyakZMLzhoYjIrYjNieVQ0YUhNdW1xZWxTK1FCUEdGU0RtUGFJdmZLNGZ5?=
 =?utf-8?B?blZsakQ2RGFxVW5aMVM5WnRhc1pMT2c5Q2ljT0hYdElFWUg5ZFRmSEZ5V2NN?=
 =?utf-8?B?N3FTeUlPYnhLbHJrSWR3dWRzdGlhNTc3RUY4RWN3ZFB2SWFEcWRhWWdxdkJl?=
 =?utf-8?B?MlpVNDBhU0Nab3dvYnoxdEQyWDJsMWxXV2c1dlFITmdLeXBVTTA4S2RQcmlu?=
 =?utf-8?B?NmhLWlZ2ZkpYanAwQ2NnSmFkWExqMGVqbGRpVG9hM0tJR04rL0JzZXdheVF3?=
 =?utf-8?B?ZEx0YSs0U0hNNzBnWTlSYlVvNmVHbHdCQTNJZFJQcmtxTUFVdFZydllZRmlz?=
 =?utf-8?B?c0g5VEhIVytvTnBZQ05FNEpaNElYN3NVRHVWamJZdXdCTkgwV1ZUV1ZVMzMx?=
 =?utf-8?B?dGRPeXZLTXV3d3dZNzBrSU05eVVSMVlmZGJtMFdjc0NTVkZtZy9sSFFrMk1M?=
 =?utf-8?B?Nm83ZTBJMThVSWErVmN0QTJrN1puQVphTUZyczhxVklPUzVuSFFXUHFjWlVV?=
 =?utf-8?B?MjBGTk9NQ0p5SnJucnpOQWZ6UFlxYk02VzBHRTJwVm9HRjlKbnIwOVJqVHdu?=
 =?utf-8?B?bWkyeD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ve+NZQQbr9dTlm3Nf9jIdXCnzA360TB7/kAMA5ZDFVbv+pDZJ0dUVr/dJ1wsW8IXYF07bcIP1mPyWqR2q7hfDAebeCJruO7zlWzy5x5ZUtLGHwktjmVfuCKgNWfgaEPl9OsG6M+O/f9eP2L8z5rB0gtUs3nOFfY1e+hl1jlOWu6tZRx8XhH7AZSCMKO7iGJ7085d7CgMGM+qGXgAGTUL9jZGblpwyQ10EaR4AKILTRZBXtLiEWo00+jReySHqwKKr2BRZdNH4dHmVvqGxzB3gK090XE9ICuaGUMFvHtTmCsfXFjHHXGWAsIcsZSqEe2qmK6HZAD1y+sHvcHtJmUojVA57BpQCztbHV9LEiRopfppVtI9JvdTdiEO1i9WP4UrYJ+hijMvgKjoY7ve7KOA2zF4fsjTs8sP2DhM3A/4so86fSmxy8xEM7X/uo99WQRLyfsT2zUm/A9NMdZ4mgP5cP28+VgC0IVCUTWpbAOZg8H/G9mU3JV/uuztFkrYXHIWoERgWhQ4l8pZRbK6MVHCrWW2WQtcKpwHt4kiJfYiSS8xeuoYjtdOC0/8YDw9p
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 93afaddc-7181-46a9-ed88-08db88fb19fa
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 08:27:06.3522
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: acJ6znnuepME0E9GuGQTcsgDUqaYu88GxjdOHvCSBOixQGCbml74V6VRJnnVtSHTj3Akz65uaxNOP/4dM5UwLg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5760

Move the CPUID value parsers out of libxl_cpuid_parse_config() into a
newly created cpuid_add() local helper.  This is in preparation for
also adding MSR feature parsing support.

No functional change intended.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/light/libxl_cpuid.c | 120 +++++++++++++++++----------------
 1 file changed, 63 insertions(+), 57 deletions(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index 68b797886642..c62247f9bda7 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -96,6 +96,66 @@ static struct xc_xend_cpuid *cpuid_find_match(libxl_cpuid_policy_list *pl,
     return *list + i;
 }
 
+static int cpuid_add(libxl_cpuid_policy_list *policy,
+                     const struct cpuid_flags *flag, const char *val)
+{
+    struct xc_xend_cpuid *entry = cpuid_find_match(policy, flag->leaf,
+                                                   flag->subleaf);
+    unsigned long num;
+    char flags[33], *resstr, *endptr;
+    unsigned int i;
+
+    resstr = entry->policy[flag->reg - 1];
+    num = strtoull(val, &endptr, 0);
+    flags[flag->length] = 0;
+    if (endptr != val) {
+        /* if this was a valid number, write the binary form into the string */
+        for (i = 0; i < flag->length; i++) {
+            flags[flag->length - 1 - i] = "01"[!!(num & (1 << i))];
+        }
+    } else {
+        switch(val[0]) {
+        case 'x': case 'k': case 's':
+            memset(flags, val[0], flag->length);
+            break;
+        default:
+            return 3;
+        }
+    }
+
+    if (resstr == NULL) {
+        resstr = strdup("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
+    }
+
+    /* the family and model entry is potentially split up across
+     * two fields in Fn0000_0001_EAX, so handle them here separately.
+     */
+    if (!strcmp(flag->name, "family")) {
+        if (num < 16) {
+            memcpy(resstr + (32 - 4) - flag->bit, flags + 4, 4);
+            memcpy(resstr + (32 - 8) - 20, "00000000", 8);
+        } else {
+            num -= 15;
+            memcpy(resstr + (32 - 4) - flag->bit, "1111", 4);
+            for (i = 0; i < 7; i++) {
+                flags[7 - i] = "01"[num & 1];
+                num >>= 1;
+            }
+            memcpy(resstr + (32 - 8) - 20, flags, 8);
+        }
+    } else if (!strcmp(flag->name, "model")) {
+        memcpy(resstr + (32 - 4) - 16, flags, 4);
+        memcpy(resstr + (32 - 4) - flag->bit, flags + 4, 4);
+    } else {
+        memcpy(resstr + (32 - flag->length) - flag->bit, flags,
+               flag->length);
+    }
+    entry->policy[flag->reg - 1] = resstr;
+
+    return 0;
+
+}
+
 /* parse a single key=value pair and translate it into the libxc
  * used interface using 32-characters strings for each register.
  * Will overwrite earlier entries and thus can be called multiple
@@ -340,12 +400,8 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
         {NULL, 0, NA, CPUID_REG_INV, 0, 0}
     };
 #undef NA
-    char *sep, *val, *endptr;
-    int i;
+    const char *sep, *val;
     const struct cpuid_flags *flag;
-    struct xc_xend_cpuid *entry;
-    unsigned long num;
-    char flags[33], *resstr;
 
     sep = strchr(str, '=');
     if (sep == NULL) {
@@ -355,60 +411,10 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
     }
     for (flag = cpuid_flags; flag->name != NULL; flag++) {
         if(!strncmp(str, flag->name, sep - str) && flag->name[sep - str] == 0)
-            break;
-    }
-    if (flag->name == NULL) {
-        return 2;
-    }
-    entry = cpuid_find_match(policy, flag->leaf, flag->subleaf);
-    resstr = entry->policy[flag->reg - 1];
-    num = strtoull(val, &endptr, 0);
-    flags[flag->length] = 0;
-    if (endptr != val) {
-        /* if this was a valid number, write the binary form into the string */
-        for (i = 0; i < flag->length; i++) {
-            flags[flag->length - 1 - i] = "01"[!!(num & (1 << i))];
-        }
-    } else {
-        switch(val[0]) {
-        case 'x': case 'k': case 's':
-            memset(flags, val[0], flag->length);
-            break;
-        default:
-            return 3;
-        }
-    }
-
-    if (resstr == NULL) {
-        resstr = strdup("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
+            return cpuid_add(policy, flag, val);
     }
 
-    /* the family and model entry is potentially split up across
-     * two fields in Fn0000_0001_EAX, so handle them here separately.
-     */
-    if (!strncmp(str, "family", sep - str)) {
-        if (num < 16) {
-            memcpy(resstr + (32 - 4) - flag->bit, flags + 4, 4);
-            memcpy(resstr + (32 - 8) - 20, "00000000", 8);
-        } else {
-            num -= 15;
-            memcpy(resstr + (32 - 4) - flag->bit, "1111", 4);
-            for (i = 0; i < 7; i++) {
-                flags[7 - i] = "01"[num & 1];
-                num >>= 1;
-            }
-            memcpy(resstr + (32 - 8) - 20, flags, 8);
-        }
-    } else if (!strncmp(str, "model", sep - str)) {
-        memcpy(resstr + (32 - 4) - 16, flags, 4);
-        memcpy(resstr + (32 - 4) - flag->bit, flags + 4, 4);
-    } else {
-        memcpy(resstr + (32 - flag->length) - flag->bit, flags,
-               flag->length);
-    }
-    entry->policy[flag->reg - 1] = resstr;
-
-    return 0;
+    return 2;
 }
 
 /* parse a single list item from the legacy Python xend syntax, where
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 08:27:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 08:27:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566472.885331 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMP0K-0003TN-9z; Thu, 20 Jul 2023 08:27:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566472.885331; Thu, 20 Jul 2023 08:27:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMP0K-0003Sm-4M; Thu, 20 Jul 2023 08:27:20 +0000
Received: by outflank-mailman (input) for mailman id 566472;
 Thu, 20 Jul 2023 08:27:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/JYs=DG=citrix.com=prvs=558be806a=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMP0J-0001O5-3I
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 08:27:19 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3bbd46d0-26d7-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 10:27:17 +0200 (CEST)
Received: from mail-co1nam11lp2175.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.175])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 20 Jul 2023 04:27:14 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB5760.namprd03.prod.outlook.com (2603:10b6:a03:2d3::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul
 2023 08:27:12 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 08:27:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3bbd46d0-26d7-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689841636;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=hoBKfo+TVeXY+Ru/Ne7C1tp93GStY9RqGnNdAfAsbTI=;
  b=dBdQOsY/2aLw9hemL5ispWK3r5U0KeYva90WpemlpK/P5S+VvtEuI3ee
   UQD7BKAh5qtclbSoEOA5vri32cTz/om45nL1SA8g83beSrAKH+kAWMQQZ
   0qN/qJ/aNHQ0cPLJovWYfi4u2DoFIlm59tacgnrhhllQrJ0zgimX+Y7n2
   g=;
X-IronPort-RemoteIP: 104.47.56.175
X-IronPort-MID: 115539014
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:bd1aqa7Djx95XB4ddkH48AxRtBzGchMFZxGqfqrLsTDasY5as4F+v
 jcZWWmCbqnYYGCkL4gjYYjloBlQvsfSzYRlSlA+rS5mHi5G8cbLO4+Ufxz6V8+wwm8vb2o8t
 plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraCYnsrLeNdYH9JoQp5nOIkiZJfj9G8Agec0
 fv/uMSaM1K+s9JOGjt8B5mr9lU35ZwehBtC5gZlPa8R5AeH/5UoJMl3yZ+ZfiOQrrZ8RoZWd
 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4
 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5m8
 s1ENgkzZwy5mM3rw4njEOVGnZgSFZy+VG8fkikIITDxK98DGMmGaIKToNhS0XE3m9xEGuvYa
 4wBcz1zYR/cYhpJfFAKFJY5m+TujX76G9FagAvN+exrvC6Okkooj+WF3Nn9I7RmQe1PmUmVv
 CTe9nnRCRAGLt2PjzGC9xpAg8eWxH6mA9NKTeHQGvhCqmSrwFIZMkIsbVKBofXot0CeWdZFN
 BlBksYphe1onKCxdfHtUhv9rHOasxo0X9tLD/Z8+AyL0rDT4QuSGi4DVDEpQMMinN87Q3otz
 FDht9HmHzt0q5WOVGmQsLyTqFuP1TM9KGYDYWoPSlID6ty6+YUr1EuQE5BkDbK/icDzFXfo2
 TeWoSMihrIVy8kWy6G8+lOBiDWpznTUcjMICszsdjrNxmtEiESNPuRENXCzAS58Ebuk
IronPort-HdrOrdr: A9a23:ldhHZ6vtSEF9aMqCJf3pHwlj7skDddV00zEX/kB9WHVpmwKj5q
 eTdZUgpHnJYVMqMk3I9urwW5VoLUm9yXcX2+gs1NWZLWvbUQKTRekI0WKI+UyEJ8SRzJ846U
 6iScRD4R/LYGSSQfyU3OBwKbgd/OU=
X-Talos-CUID: =?us-ascii?q?9a23=3AtTtJAmjLgJVb3BN7g+LBUGYE/DJudUyB0k7uKlO?=
 =?us-ascii?q?CFkk0S4bNE1O64/9Vqp87?=
X-Talos-MUID: 9a23:tpfqDAsNb6SjIEj78s2nrghaMvli2fuUMEk3kZlXhsekNyhqJGLI
X-IronPort-AV: E=Sophos;i="6.01,218,1684814400"; 
   d="scan'208";a="115539014"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=TMjjG6dTRwA2mOQPmxcTsZSbAP6OaTYtCfTE5hpLj6wBBNIQn6QIBpWI6+ZC2g58Ht+caQigl1dA9rxZpFWoCKefkiaq6VroVHa1IEOvvgce97R2bIpQ0Vmdzv9YTzABH4nQE/+WRc732y1HAg092ctYZWTMOLsGLq9fB7aZJY4dNZvki6g4l2oCvcmXf1+2mdiOV4do6aSULjgbuZWP91mcJt1rVXNhAQtlb0Ha/S7Oy5e/fKIuGOJ0gRT6uDQOG3PUBr3e6nmb+v8UqmqeMDXOS6eMq2ct4YLgE8UAFLP9jZ5t+j/hRJtmqbW0EQNZ74R5KEqPkjYHqVbQQ+ujrA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Wr+vnLcTbPIrPgM1brYLYBaOkRLAS+kv/AjEfRMs/yA=;
 b=HBmXjtECMkpoM7Y81HgRtHNb4nyuoA0rpVaCAonA8fNfW7oxw3/py5r53oYHC5cpQoX3G7ExSBj+8dMq7x1kXON2N+fn8hr9UKmdsS0oROqAJ8JqtX4keT/snX27S5iMoLd/95XBKvCl3vxBsXIs2laU9ij2/k/CW+9E7OLS06DTSWQ6NGfS8eMo//xRCVi+0Vm3oi6abMMjn82pevJdAYOvMyQHnahfVpNehAaPOnG+7+9H4LeQ7OSJEaolqmeEuJsgx/gEBRY0Gb2lgriNLJ3wLJOz7IRIk1u6RLoPTPchlMECNgTpVjD+i9fmsWRBN+fpfSgFioShadmvymVE9w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Wr+vnLcTbPIrPgM1brYLYBaOkRLAS+kv/AjEfRMs/yA=;
 b=Pq316CvbQUt1kwRczptQJR5fwzW0b4Uh/mJ3Utd6Eg6gfMiRGv2xxQ5ivxSjpLB9W9ezuBl4XfkEHumL3NopDZPT+Q9KyXEjcVZDzDL5pINu+aH30Wbekv4fkR931OUcNJBhTM2bwCiX+/Lm6C+8Nb3r0URcsQQrP9BJ0fo1OJ4=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v3 5/6] libxl: use the cpuid feature names from cpufeatureset.h
Date: Thu, 20 Jul 2023 10:25:39 +0200
Message-ID: <20230720082540.69444-6-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230720082540.69444-1-roger.pau@citrix.com>
References: <20230720082540.69444-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P265CA0005.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:62::17) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5760:EE_
X-MS-Office365-Filtering-Correlation-Id: cf93da26-1f04-49b6-6aea-08db88fb1dd3
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	rMPDAU2mXHxOgRO6AcOxA65zM4UiKlggjYK2jmqgsc6i2vSRqCa9sH3gmNFHZi8xc+b2AuUPFsmMoXSqyk/7tgABtvXNh+rxv1BdyS4/oijboymruxa+im7rhCyaSt4ELM/vYgRoKlqr9eme149/38g/+gahCswmRR5R4Ynns5PLFZ/FBfkJ9o5Q8tI6cZAnqusGF1W7JjJQd6W9gpID6lq6wpPw0KlJHedfTc30JocDA0t8YpWEOtckF4X3gstPCqrOoqO+l8URQKGx9liqFJrKtlfG/Ro99jauX9hULTXRp3DGT/hi1q+oukYlcbqPbsoaeqpuzqtHe9h7f0zTAUleX7SPIwA+Y6VyVAfFqtiUyiFU3RhWS8eD2HkxP4i1K3JZIa7aDPVob8GIEGV5RqVHJbV9WcQ9GiFP0vMLndyj0NpbeX83sliCgzsoc92U2ptGi87LdrxjWK6bgkjF8dojibuxXKHMf9Uuhsae8VxO7FURjmgZc0Il77p/lgDNOFx8rW5ZswWxR12epEuYqlK/5nD2lNCYybtEyQDssS4iFFjVCx/ImxzA9Zg4JLjbZN+nn/y24wsp8dKBwUOZsQCob7PBM+KbbTgayy5fbjU=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(346002)(136003)(376002)(366004)(451199021)(86362001)(478600001)(83380400001)(1076003)(186003)(38100700002)(41300700001)(26005)(30864003)(54906003)(6916009)(8676002)(8936002)(316002)(2906002)(4326008)(6512007)(66556008)(66946007)(6666004)(66476007)(6486002)(6506007)(82960400001)(2616005)(66574015)(36756003)(5660300002)(473944003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UldmQUdJZkhEOVEvRHJ1TmUzVytmZHB5bFVmWmFJRkpHdmRaNFMrZ2lqK2pS?=
 =?utf-8?B?MC9PVXpzWDRiK1pNSllFZG9CeUFCUGpobSthd1JjRVRSMnNTb2VNQjdsZ0tP?=
 =?utf-8?B?dW52akNKV0dBb1NUOWxxVktXWU8xWlg2QkVqZWZjZkh5cGptckN4QnpmMVow?=
 =?utf-8?B?NlJwU1J1VVNndGh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xDqbQ2+P/9XQBZ2KyhvfaIdfckKf0/3qTckOe23eX1Yubm47xx5RT4h4DfVmuqBAUstXvHP/ZHJ/123I166ymDmzWYO7xFY3lOY9cno0NCXkylkwlwkRgYdWGCilZOP7sFYmP5ZFib
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: cf93da26-1f04-49b6-6aea-08db88fb1dd3
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 08:27:12.4568
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: GjMrPipxEm6LBF+8vqa5pwhUxuBukPU1O4GedNm9ih7x8Q+oNWHYTMKzZT1GPokV+Hr/OO7gNh9T3XxYZUGdmw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5760

The current implementation in libxl_cpuid_parse_config() requires
keeping a list of cpuid feature bits that should be mostly in sync
with the contents of cpufeatureset.h.

Avoid such duplication by using the automatically generated list of
cpuid features in INIT_FEATURE_NAMES in order to map feature names to
featureset bits, and then translate from featureset bits into cpuid
leaf, subleaf, register tuple.

Note that the full contents of the previous cpuid translation table
can't be removed.  That's because some feature names allowed by libxl
are not described in the featuresets, or because naming has diverged
and the previous nomenclature is preserved for compatibility reasons.

Should result in no functional change observed by callers, albeit some
new cpuid features will be available as a result of the change.

While there constify cpuid_flags name field.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
---
Changes since v1:
 - const unnamed structure cast.
 - Declare struct feature_name outside the function.
 - Use strcmp.
 - Fix indentation.
 - Add back missing feature name options.
 - Return ERROR_NOMEM if allocation fails.
 - Improve xl.cfg documentation about how to reference the features
   described in the public header.
---
 docs/man/xl.cfg.5.pod.in       |  24 +--
 tools/libs/light/libxl_cpuid.c | 267 ++++++++++++---------------------
 tools/xl/xl_parse.c            |   3 +
 3 files changed, 107 insertions(+), 187 deletions(-)

diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index 3979be2a590a..55161856f4c7 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -2010,24 +2010,16 @@ proccount procpkg stepping
 
 =back
 
-List of keys taking a character:
+List of keys taking a character can be found in the public header file
+L<arch-x86/cpufeatureset.h|https://xenbits.xen.org/docs/unstable/hypercall/x86_64/include,public,arch-x86,cpufeatureset.h.html>
 
-=over 4
-
-3dnow 3dnowext 3dnowprefetch abm acpi adx aes altmovcr8 apic arat avx avx2
-avx512-4fmaps avx512-4vnniw avx512bw avx512cd avx512dq avx512er avx512f
-avx512ifma avx512pf avx512vbmi avx512vl bmi1 bmi2 clflushopt clfsh clwb cmov
-cmplegacy cmpxchg16 cmpxchg8 cmt cntxid dca de ds dscpl dtes64 erms est extapic
-f16c ffxsr fma fma4 fpu fsgsbase fxsr hle htt hypervisor ia64 ibs invpcid
-invtsc lahfsahf lm lwp mca mce misalignsse mmx mmxext monitor movbe mpx msr
-mtrr nodeid nx ospke osvw osxsave pae page1gb pat pbe pcid pclmulqdq pdcm
-perfctr_core perfctr_nb pge pku popcnt pse pse36 psn rdrand rdseed rdtscp rtm
-sha skinit smap smep smx ss sse sse2 sse3 sse4.1 sse4.2 sse4_1 sse4_2 sse4a
-ssse3 svm svm_decode svm_lbrv svm_npt svm_nrips svm_pausefilt svm_tscrate
-svm_vmcbclean syscall sysenter tbm tm tm2 topoext tsc tsc-deadline tsc_adjust
-umip vme vmx wdt x2apic xop xsave xtpr
+The feature names described in C<cpufeatureset.h> should be specified in all
+lowercase letters, and with underscores converted to hyphens.  For example in
+order to reference feature C<LAHF_LM> the string C<lahf-lm> should be used.
 
-=back
+Note that C<clflush> is described as an option that takes a value, and that
+takes precedence over the C<clflush> flag in C<cpufeatureset.h>.  The feature
+flag must be referenced as C<clfsh>.
 
 =back
 
diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index c62247f9bda7..f8b2e45ee681 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -14,6 +14,8 @@
 
 #include "libxl_internal.h"
 
+#include <xen/lib/x86/cpu-policy.h>
+
 int libxl__cpuid_policy_is_empty(libxl_cpuid_policy_list *pl)
 {
     return !*pl || (!libxl_cpuid_policy_list_length(pl) && !(*pl)->msr);
@@ -60,7 +62,7 @@ void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl)
  * Used for the static structure describing all features.
  */
 struct cpuid_flags {
-    char* name;
+    const char *name;
     uint32_t leaf;
     uint32_t subleaf;
     int reg;
@@ -153,7 +155,19 @@ static int cpuid_add(libxl_cpuid_policy_list *policy,
     entry->policy[flag->reg - 1] = resstr;
 
     return 0;
+}
+
+struct feature_name {
+    const char *name;
+    unsigned int bit;
+};
+
+static int search_feature(const void *a, const void *b)
+{
+    const char *key = a;
+    const char *feat = ((const struct feature_name *)b)->name;
 
+    return strcmp(key, feat);
 }
 
 /* parse a single key=value pair and translate it into the libxc
@@ -176,208 +190,42 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
         {"proccount",    0x00000001, NA, CPUID_REG_EBX, 16,  8},
         {"localapicid",  0x00000001, NA, CPUID_REG_EBX, 24,  8},
 
-        {"sse3",         0x00000001, NA, CPUID_REG_ECX,  0,  1},
-        {"pclmulqdq",    0x00000001, NA, CPUID_REG_ECX,  1,  1},
-        {"dtes64",       0x00000001, NA, CPUID_REG_ECX,  2,  1},
-        {"monitor",      0x00000001, NA, CPUID_REG_ECX,  3,  1},
-        {"dscpl",        0x00000001, NA, CPUID_REG_ECX,  4,  1},
-        {"vmx",          0x00000001, NA, CPUID_REG_ECX,  5,  1},
-        {"smx",          0x00000001, NA, CPUID_REG_ECX,  6,  1},
         {"est",          0x00000001, NA, CPUID_REG_ECX,  7,  1},
-        {"tm2",          0x00000001, NA, CPUID_REG_ECX,  8,  1},
-        {"ssse3",        0x00000001, NA, CPUID_REG_ECX,  9,  1},
         {"cntxid",       0x00000001, NA, CPUID_REG_ECX, 10,  1},
-        {"fma",          0x00000001, NA, CPUID_REG_ECX, 12,  1},
         {"cmpxchg16",    0x00000001, NA, CPUID_REG_ECX, 13,  1},
-        {"xtpr",         0x00000001, NA, CPUID_REG_ECX, 14,  1},
-        {"pdcm",         0x00000001, NA, CPUID_REG_ECX, 15,  1},
-        {"pcid",         0x00000001, NA, CPUID_REG_ECX, 17,  1},
-        {"dca",          0x00000001, NA, CPUID_REG_ECX, 18,  1},
         /* Linux uses sse4_{1,2}.  Keep sse4.{1,2} for compatibility */
         {"sse4_1",       0x00000001, NA, CPUID_REG_ECX, 19,  1},
         {"sse4.1",       0x00000001, NA, CPUID_REG_ECX, 19,  1},
         {"sse4_2",       0x00000001, NA, CPUID_REG_ECX, 20,  1},
         {"sse4.2",       0x00000001, NA, CPUID_REG_ECX, 20,  1},
-        {"x2apic",       0x00000001, NA, CPUID_REG_ECX, 21,  1},
-        {"movbe",        0x00000001, NA, CPUID_REG_ECX, 22,  1},
-        {"popcnt",       0x00000001, NA, CPUID_REG_ECX, 23,  1},
-        {"tsc-deadline", 0x00000001, NA, CPUID_REG_ECX, 24,  1},
         {"aes",          0x00000001, NA, CPUID_REG_ECX, 25,  1},
-        {"xsave",        0x00000001, NA, CPUID_REG_ECX, 26,  1},
-        {"osxsave",      0x00000001, NA, CPUID_REG_ECX, 27,  1},
-        {"avx",          0x00000001, NA, CPUID_REG_ECX, 28,  1},
-        {"f16c",         0x00000001, NA, CPUID_REG_ECX, 29,  1},
-        {"rdrand",       0x00000001, NA, CPUID_REG_ECX, 30,  1},
-        {"hypervisor",   0x00000001, NA, CPUID_REG_ECX, 31,  1},
-
-        {"fpu",          0x00000001, NA, CPUID_REG_EDX,  0,  1},
-        {"vme",          0x00000001, NA, CPUID_REG_EDX,  1,  1},
-        {"de",           0x00000001, NA, CPUID_REG_EDX,  2,  1},
-        {"pse",          0x00000001, NA, CPUID_REG_EDX,  3,  1},
-        {"tsc",          0x00000001, NA, CPUID_REG_EDX,  4,  1},
-        {"msr",          0x00000001, NA, CPUID_REG_EDX,  5,  1},
-        {"pae",          0x00000001, NA, CPUID_REG_EDX,  6,  1},
-        {"mce",          0x00000001, NA, CPUID_REG_EDX,  7,  1},
+
         {"cmpxchg8",     0x00000001, NA, CPUID_REG_EDX,  8,  1},
-        {"apic",         0x00000001, NA, CPUID_REG_EDX,  9,  1},
         {"sysenter",     0x00000001, NA, CPUID_REG_EDX, 11,  1},
-        {"mtrr",         0x00000001, NA, CPUID_REG_EDX, 12,  1},
-        {"pge",          0x00000001, NA, CPUID_REG_EDX, 13,  1},
-        {"mca",          0x00000001, NA, CPUID_REG_EDX, 14,  1},
-        {"cmov",         0x00000001, NA, CPUID_REG_EDX, 15,  1},
-        {"pat",          0x00000001, NA, CPUID_REG_EDX, 16,  1},
-        {"pse36",        0x00000001, NA, CPUID_REG_EDX, 17,  1},
         {"psn",          0x00000001, NA, CPUID_REG_EDX, 18,  1},
         {"clfsh",        0x00000001, NA, CPUID_REG_EDX, 19,  1},
-        {"ds",           0x00000001, NA, CPUID_REG_EDX, 21,  1},
-        {"acpi",         0x00000001, NA, CPUID_REG_EDX, 22,  1},
-        {"mmx",          0x00000001, NA, CPUID_REG_EDX, 23,  1},
-        {"fxsr",         0x00000001, NA, CPUID_REG_EDX, 24,  1},
-        {"sse",          0x00000001, NA, CPUID_REG_EDX, 25,  1},
-        {"sse2",         0x00000001, NA, CPUID_REG_EDX, 26,  1},
-        {"ss",           0x00000001, NA, CPUID_REG_EDX, 27,  1},
-        {"htt",          0x00000001, NA, CPUID_REG_EDX, 28,  1},
         {"tm",           0x00000001, NA, CPUID_REG_EDX, 29,  1},
         {"ia64",         0x00000001, NA, CPUID_REG_EDX, 30,  1},
         {"pbe",          0x00000001, NA, CPUID_REG_EDX, 31,  1},
 
         {"arat",         0x00000006, NA, CPUID_REG_EAX,  2,  1},
 
-        {"fsgsbase",     0x00000007,  0, CPUID_REG_EBX,  0,  1},
         {"tsc_adjust",   0x00000007,  0, CPUID_REG_EBX,  1,  1},
-        {"bmi1",         0x00000007,  0, CPUID_REG_EBX,  3,  1},
-        {"hle",          0x00000007,  0, CPUID_REG_EBX,  4,  1},
-        {"avx2",         0x00000007,  0, CPUID_REG_EBX,  5,  1},
-        {"smep",         0x00000007,  0, CPUID_REG_EBX,  7,  1},
-        {"bmi2",         0x00000007,  0, CPUID_REG_EBX,  8,  1},
-        {"erms",         0x00000007,  0, CPUID_REG_EBX,  9,  1},
-        {"invpcid",      0x00000007,  0, CPUID_REG_EBX, 10,  1},
-        {"rtm",          0x00000007,  0, CPUID_REG_EBX, 11,  1},
         {"cmt",          0x00000007,  0, CPUID_REG_EBX, 12,  1},
-        {"mpx",          0x00000007,  0, CPUID_REG_EBX, 14,  1},
-        {"avx512f",      0x00000007,  0, CPUID_REG_EBX, 16,  1},
-        {"avx512dq",     0x00000007,  0, CPUID_REG_EBX, 17,  1},
-        {"rdseed",       0x00000007,  0, CPUID_REG_EBX, 18,  1},
-        {"adx",          0x00000007,  0, CPUID_REG_EBX, 19,  1},
-        {"smap",         0x00000007,  0, CPUID_REG_EBX, 20,  1},
-        {"avx512-ifma",  0x00000007,  0, CPUID_REG_EBX, 21,  1},
-        {"clflushopt",   0x00000007,  0, CPUID_REG_EBX, 23,  1},
-        {"clwb",         0x00000007,  0, CPUID_REG_EBX, 24,  1},
-        {"proc-trace",   0x00000007,  0, CPUID_REG_EBX, 25,  1},
-        {"avx512pf",     0x00000007,  0, CPUID_REG_EBX, 26,  1},
-        {"avx512er",     0x00000007,  0, CPUID_REG_EBX, 27,  1},
-        {"avx512cd",     0x00000007,  0, CPUID_REG_EBX, 28,  1},
-        {"sha",          0x00000007,  0, CPUID_REG_EBX, 29,  1},
-        {"avx512bw",     0x00000007,  0, CPUID_REG_EBX, 30,  1},
-        {"avx512vl",     0x00000007,  0, CPUID_REG_EBX, 31,  1},
-
-        {"prefetchwt1",  0x00000007,  0, CPUID_REG_ECX,  0,  1},
-        {"avx512-vbmi",  0x00000007,  0, CPUID_REG_ECX,  1,  1},
-        {"umip",         0x00000007,  0, CPUID_REG_ECX,  2,  1},
-        {"pku",          0x00000007,  0, CPUID_REG_ECX,  3,  1},
-        {"ospke",        0x00000007,  0, CPUID_REG_ECX,  4,  1},
-        {"avx512-vbmi2", 0x00000007,  0, CPUID_REG_ECX,  6,  1},
-        {"cet-ss",       0x00000007,  0, CPUID_REG_ECX,  7,  1},
-        {"gfni",         0x00000007,  0, CPUID_REG_ECX,  8,  1},
-        {"vaes",         0x00000007,  0, CPUID_REG_ECX,  9,  1},
-        {"vpclmulqdq",   0x00000007,  0, CPUID_REG_ECX, 10,  1},
-        {"avx512-vnni",  0x00000007,  0, CPUID_REG_ECX, 11,  1},
-        {"avx512-bitalg",0x00000007,  0, CPUID_REG_ECX, 12,  1},
-        {"avx512-vpopcntdq",0x00000007,0,CPUID_REG_ECX, 14,  1},
-        {"rdpid",        0x00000007,  0, CPUID_REG_ECX, 22,  1},
-        {"cldemote",     0x00000007,  0, CPUID_REG_ECX, 25,  1},
-        {"pks",          0x00000007,  0, CPUID_REG_ECX, 31,  1},
-
-        {"avx512-4vnniw",0x00000007,  0, CPUID_REG_EDX,  2,  1},
-        {"avx512-4fmaps",0x00000007,  0, CPUID_REG_EDX,  3,  1},
-        {"fsrm",         0x00000007,  0, CPUID_REG_EDX,  4,  1},
-        {"avx512-vp2intersect",0x00000007,0,CPUID_REG_EDX,8, 1},
-        {"srbds-ctrl",   0x00000007,  0, CPUID_REG_EDX,  9,  1},
-        {"md-clear",     0x00000007,  0, CPUID_REG_EDX, 10,  1},
-        {"serialize",    0x00000007,  0, CPUID_REG_EDX, 14,  1},
-        {"tsxldtrk",     0x00000007,  0, CPUID_REG_EDX, 16,  1},
-        {"cet-ibt",      0x00000007,  0, CPUID_REG_EDX, 20,  1},
-        {"avx512-fp16",  0x00000007,  0, CPUID_REG_EDX, 23,  1},
-        {"ibrsb",        0x00000007,  0, CPUID_REG_EDX, 26,  1},
-        {"stibp",        0x00000007,  0, CPUID_REG_EDX, 27,  1},
-        {"l1d-flush",    0x00000007,  0, CPUID_REG_EDX, 28,  1},
-        {"arch-caps",    0x00000007,  0, CPUID_REG_EDX, 29,  1},
-        {"core-caps",    0x00000007,  0, CPUID_REG_EDX, 30,  1},
-        {"ssbd",         0x00000007,  0, CPUID_REG_EDX, 31,  1},
-
-        {"avx-vnni",     0x00000007,  1, CPUID_REG_EAX,  4,  1},
-        {"avx512-bf16",  0x00000007,  1, CPUID_REG_EAX,  5,  1},
-        {"fzrm",         0x00000007,  1, CPUID_REG_EAX, 10,  1},
-        {"fsrs",         0x00000007,  1, CPUID_REG_EAX, 11,  1},
-        {"fsrcs",        0x00000007,  1, CPUID_REG_EAX, 12,  1},
-        {"wrmsrns",      0x00000007,  1, CPUID_REG_EAX, 19,  1},
-        {"avx-ifma",     0x00000007,  1, CPUID_REG_EAX, 23,  1},
-
-        {"avx-vnni-int8",0x00000007,  1, CPUID_REG_EDX,  4,  1},
-        {"avx-ne-convert",0x00000007, 1, CPUID_REG_EDX,  5,  1},
-        {"cet-sss",      0x00000007,  1, CPUID_REG_EDX, 18,  1},
-
-        {"intel-psfd",   0x00000007,  2, CPUID_REG_EDX,  0,  1},
-        {"ipred-ctrl",   0x00000007,  2, CPUID_REG_EDX,  1,  1},
-        {"rrsba-ctrl",   0x00000007,  2, CPUID_REG_EDX,  2,  1},
-        {"ddp-ctrl",     0x00000007,  2, CPUID_REG_EDX,  3,  1},
-        {"bhi-ctrl",     0x00000007,  2, CPUID_REG_EDX,  4,  1},
-        {"mcdt-no",      0x00000007,  2, CPUID_REG_EDX,  5,  1},
 
         {"lahfsahf",     0x80000001, NA, CPUID_REG_ECX,  0,  1},
         {"cmplegacy",    0x80000001, NA, CPUID_REG_ECX,  1,  1},
-        {"svm",          0x80000001, NA, CPUID_REG_ECX,  2,  1},
-        {"extapic",      0x80000001, NA, CPUID_REG_ECX,  3,  1},
         {"altmovcr8",    0x80000001, NA, CPUID_REG_ECX,  4,  1},
-        {"abm",          0x80000001, NA, CPUID_REG_ECX,  5,  1},
-        {"sse4a",        0x80000001, NA, CPUID_REG_ECX,  6,  1},
-        {"misalignsse",  0x80000001, NA, CPUID_REG_ECX,  7,  1},
-        {"3dnowprefetch",0x80000001, NA, CPUID_REG_ECX,  8,  1},
-        {"osvw",         0x80000001, NA, CPUID_REG_ECX,  9,  1},
-        {"ibs",          0x80000001, NA, CPUID_REG_ECX, 10,  1},
-        {"xop",          0x80000001, NA, CPUID_REG_ECX, 11,  1},
-        {"skinit",       0x80000001, NA, CPUID_REG_ECX, 12,  1},
-        {"wdt",          0x80000001, NA, CPUID_REG_ECX, 13,  1},
-        {"lwp",          0x80000001, NA, CPUID_REG_ECX, 15,  1},
-        {"fma4",         0x80000001, NA, CPUID_REG_ECX, 16,  1},
         {"nodeid",       0x80000001, NA, CPUID_REG_ECX, 19,  1},
-        {"tbm",          0x80000001, NA, CPUID_REG_ECX, 21,  1},
-        {"topoext",      0x80000001, NA, CPUID_REG_ECX, 22,  1},
         {"perfctr_core", 0x80000001, NA, CPUID_REG_ECX, 23,  1},
         {"perfctr_nb",   0x80000001, NA, CPUID_REG_ECX, 24,  1},
 
-        {"syscall",      0x80000001, NA, CPUID_REG_EDX, 11,  1},
-        {"nx",           0x80000001, NA, CPUID_REG_EDX, 20,  1},
-        {"mmxext",       0x80000001, NA, CPUID_REG_EDX, 22,  1},
-        {"ffxsr",        0x80000001, NA, CPUID_REG_EDX, 25,  1},
-        {"page1gb",      0x80000001, NA, CPUID_REG_EDX, 26,  1},
-        {"rdtscp",       0x80000001, NA, CPUID_REG_EDX, 27,  1},
-        {"lm",           0x80000001, NA, CPUID_REG_EDX, 29,  1},
-        {"3dnowext",     0x80000001, NA, CPUID_REG_EDX, 30,  1},
-        {"3dnow",        0x80000001, NA, CPUID_REG_EDX, 31,  1},
-
         {"procpkg",      0x00000004,  0, CPUID_REG_EAX, 26,  6},
 
         {"invtsc",       0x80000007, NA, CPUID_REG_EDX,  8,  1},
 
-        {"clzero",       0x80000008, NA, CPUID_REG_EBX,  0,  1},
-        {"rstr-fp-err-ptrs", 0x80000008, NA, CPUID_REG_EBX, 2, 1},
-        {"wbnoinvd",     0x80000008, NA, CPUID_REG_EBX,  9,  1},
-        {"ibpb",         0x80000008, NA, CPUID_REG_EBX, 12,  1},
-        {"ibrs",         0x80000008, NA, CPUID_REG_EBX, 14,  1},
-        {"amd-stibp",    0x80000008, NA, CPUID_REG_EBX, 15,  1},
-        {"ibrs-always",  0x80000008, NA, CPUID_REG_EBX, 16,  1},
-        {"stibp-always", 0x80000008, NA, CPUID_REG_EBX, 17,  1},
-        {"ibrs-fast",    0x80000008, NA, CPUID_REG_EBX, 18,  1},
-        {"ibrs-same-mode", 0x80000008, NA, CPUID_REG_EBX, 19,  1},
-        {"no-lmsl",      0x80000008, NA, CPUID_REG_EBX, 20,  1},
         {"ppin",         0x80000008, NA, CPUID_REG_EBX, 23,  1},
-        {"amd-ssbd",     0x80000008, NA, CPUID_REG_EBX, 24,  1},
-        {"virt-ssbd",    0x80000008, NA, CPUID_REG_EBX, 25,  1},
-        {"ssb-no",       0x80000008, NA, CPUID_REG_EBX, 26,  1},
-        {"psfd",         0x80000008, NA, CPUID_REG_EBX, 28,  1},
         {"btc-no",       0x80000008, NA, CPUID_REG_EBX, 29,  1},
-        {"ibpb-ret",     0x80000008, NA, CPUID_REG_EBX, 30,  1},
 
         {"nc",           0x80000008, NA, CPUID_REG_ECX,  0,  8},
         {"apicidsize",   0x80000008, NA, CPUID_REG_ECX, 12,  4},
@@ -391,17 +239,63 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
         {"svm_pausefilt",0x8000000a, NA, CPUID_REG_EDX, 10,  1},
 
         {"lfence+",      0x80000021, NA, CPUID_REG_EAX,  2,  1},
-        {"nscb",         0x80000021, NA, CPUID_REG_EAX,  6,  1},
-        {"auto-ibrs",    0x80000021, NA, CPUID_REG_EAX,  8,  1},
-        {"cpuid-user-dis", 0x80000021, NA, CPUID_REG_EAX, 17, 1},
 
         {"maxhvleaf",    0x40000000, NA, CPUID_REG_EAX,  0,  8},
 
         {NULL, 0, NA, CPUID_REG_INV, 0, 0}
     };
+    static const struct feature_name features[] = INIT_FEATURE_NAMES;
+    /*
+     * NB: if we switch to using a cpu_policy derived object instead of a
+     * libxl_cpuid_policy_list we could get rid of the featureset -> cpuid leaf
+     * conversion table and use a featureset directly as we have conversions
+     * to/from featureset and cpu_policy.
+     */
+    static const struct {
+        enum { FEAT_CPUID, FEAT_MSR } type;
+        union {
+            struct {
+                uint32_t leaf, subleaf;
+                unsigned int reg;
+            } cpuid;
+            struct {
+                uint32_t index;
+                unsigned int reg;
+            } msr;
+        };
+    } feature_to_policy[] = {
+#define CPUID_ENTRY(l, s, r) \
+    { .type = FEAT_CPUID, .cpuid.leaf = l, .cpuid.subleaf = s, .cpuid.reg = r }
+#define MSR_ENTRY(i, r) \
+    { .type = FEAT_MSR, .msr.index = i, .msr.reg = r }
+        CPUID_ENTRY(0x00000001, NA, CPUID_REG_EDX),
+        CPUID_ENTRY(0x00000001, NA, CPUID_REG_ECX),
+        CPUID_ENTRY(0x80000001, NA, CPUID_REG_EDX),
+        CPUID_ENTRY(0x80000001, NA, CPUID_REG_ECX),
+        CPUID_ENTRY(0x0000000D,  1, CPUID_REG_EAX),
+        CPUID_ENTRY(0x00000007,  0, CPUID_REG_EBX),
+        CPUID_ENTRY(0x00000007,  0, CPUID_REG_ECX),
+        CPUID_ENTRY(0x80000007, NA, CPUID_REG_EDX),
+        CPUID_ENTRY(0x80000008, NA, CPUID_REG_EBX),
+        CPUID_ENTRY(0x00000007,  0, CPUID_REG_EDX),
+        CPUID_ENTRY(0x00000007,  1, CPUID_REG_EAX),
+        CPUID_ENTRY(0x80000021, NA, CPUID_REG_EAX),
+        CPUID_ENTRY(0x00000007,  1, CPUID_REG_EBX),
+        CPUID_ENTRY(0x00000007,  2, CPUID_REG_EDX),
+        CPUID_ENTRY(0x00000007,  1, CPUID_REG_ECX),
+        CPUID_ENTRY(0x00000007,  1, CPUID_REG_EDX),
+        MSR_ENTRY(0x10a, CPUID_REG_EAX),
+        MSR_ENTRY(0x10a, CPUID_REG_EDX),
+#undef MSR_ENTRY
+#undef CPUID_ENTRY
+    };
 #undef NA
     const char *sep, *val;
+    char *name;
     const struct cpuid_flags *flag;
+    const struct feature_name *feat;
+
+    BUILD_BUG_ON(ARRAY_SIZE(feature_to_policy) != FEATURESET_NR_ENTRIES);
 
     sep = strchr(str, '=');
     if (sep == NULL) {
@@ -414,6 +308,37 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
             return cpuid_add(policy, flag, val);
     }
 
+    /* Provide a NUL terminated feature name to the search helper. */
+    name = strndup(str, sep - str);
+    if (name == NULL)
+        return ERROR_NOMEM;
+
+    feat = bsearch(name, features, ARRAY_SIZE(features), sizeof(features[0]),
+                   search_feature);
+    free(name);
+
+    if (feat == NULL)
+        return 2;
+
+    switch (feature_to_policy[feat->bit / 32].type) {
+    case FEAT_CPUID:
+    {
+        struct cpuid_flags f;
+
+        f.name = feat->name;
+        f.leaf = feature_to_policy[feat->bit / 32].cpuid.leaf;
+        f.subleaf = feature_to_policy[feat->bit / 32].cpuid.subleaf;
+        f.reg = feature_to_policy[feat->bit / 32].cpuid.reg;
+        f.bit = feat->bit % 32;
+        f.length = 1;
+
+        return cpuid_add(policy, &f, val);
+    }
+
+    case FEAT_MSR:
+        return 2;
+    }
+
     return 2;
 }
 
diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index f036e56fc239..7bf587455d08 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -2620,6 +2620,9 @@ skip_usbdev:
                 case 3:
                     errstr = "illegal CPUID value (must be: [0|1|x|k|s])";
                     break;
+                case ERROR_NOMEM:
+                    errstr = "out of memory";
+                    break;
                 default:
                     errstr = "unknown error";
                     break;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 08:27:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 08:27:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566473.885341 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMP0N-000491-Pt; Thu, 20 Jul 2023 08:27:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566473.885341; Thu, 20 Jul 2023 08:27:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMP0N-00048t-MC; Thu, 20 Jul 2023 08:27:23 +0000
Received: by outflank-mailman (input) for mailman id 566473;
 Thu, 20 Jul 2023 08:27:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/JYs=DG=citrix.com=prvs=558be806a=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMP0M-0001O5-B3
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 08:27:22 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3ed4a9ee-26d7-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 10:27:21 +0200 (CEST)
Received: from mail-co1nam11lp2171.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.171])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 20 Jul 2023 04:27:20 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB5760.namprd03.prod.outlook.com (2603:10b6:a03:2d3::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul
 2023 08:27:18 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 08:27:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3ed4a9ee-26d7-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689841641;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=XXnoIEPy2cRhu/QaPgs1CH70iHB0p1XBTTphYXH3ckY=;
  b=fUqtaBg7dbb+MW1cYVfTs79b3jH+ikwnS/2rzpk6HI4bRZMpHpz/jxEZ
   +hxyAMYN1CYpHyg4f38UMOdKIdRNqF3Zv0UPVe7C76D3j1rmBUqmvhpb1
   erABy+tKudbkkBQi35PaH4txHA7wEz66E62I8k1JpOApml0ubgP5oUuk3
   g=;
X-IronPort-RemoteIP: 104.47.56.171
X-IronPort-MID: 115539026
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:4UlgYa0HFF2en3nz3fbD5fdwkn2cJEfYwER7XKvMYLTBsI5bp2MDy
 WpKUDyCOfmCMGTzc9Anbt6/px8D7JXQyd5kTARopC1hF35El5HIVI+TRqvS04F+DeWYFR46s
 J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo
 tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5gNkPagS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL
 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ
 OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfHWd32
 sA1GB00SQmOv9nm3quZZfkxr5F2RCXrFNt3VnBI6xj8VK9jareaBqLA6JlfwSs6gd1IEbDGf
 c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxqvS6Kk1UZPLvFabI5fvSQQspYhACAr
 3/u9GXlGBAKcteYzFJp91r137KSxnKjAtx6+LuQxuFJmU/Nx2IvCxQIZVeEq9qojkSRYocKQ
 6AT0m90xUQoz2S7Q9+4UxCmrXqsuh8HR8EWA+A88BuKyKff/0CeHGdsZiFFQMwrsokxXzNC/
 l2GhdTyHhR0raaYD3ma89+pQSiaPCEUKSoJYnYCRA5cut37+ths11TIU8ppF7OzgpvtAzbsz
 juWrS84wbIOkcoM0Kb99lfC696xmqX0oscOzl2/dgqYAslRPuZJu6TABYDn0Mt9
IronPort-HdrOrdr: A9a23:fL1lFKshDPKuy0WyK92XRQr37skDddV00zEX/kB9WHVpmwKj5q
 eTdZUgpHnJYVMqMk3I9urwW5VoLUm9yXcX2+gs1NWZLWvbUQKTRekI0WKI+UyEJ8SRzJ846U
 6iScRD4R/LYGSSQfyU3OBwKbgd/OU=
X-Talos-CUID: 9a23:61A2+WB6U8063gr6EzVhzWEoN/AIS1rEwU/rc1GhK0l5FZTAHA==
X-Talos-MUID: =?us-ascii?q?9a23=3AY9eNzgyWYTz9ZOpmaj/DwmY1aTOaqJSxK1kfz5Q?=
 =?us-ascii?q?Ih8qNKxx8BD2+nTC9bbZyfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,218,1684814400"; 
   d="scan'208";a="115539026"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=K9lJFxO167n6DDG/X+8W77o03XjdwMfTH25MsP1ItfzF9bYR8/jxXfahRXYzZfK2ytHJmkQPP6cJNBG2TNKiUjauzrjYVVE+AXLZPP7Li7A8nAOdIbV8sdQ5TNsOnhJEaYv+DC2GfHILr8kRFJbqLS4Hc1LQlm9B9A9ZDBXLWI6BjxDL3l92SmRxzc6ev2N5wWo0BjHJoJVuQCf73HtPAeOY+u1L6exZqd+BWJJkk9kYzjBFlxCb/kLML+V5bVRp2DIcx8IqCck92g5wzhkiVo6mzGGcxtohjoz807mVlqUIBNO6mUXD1Tvptg8zHnWJtd7YAA8eAWUN56yyBiFu8g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=QaCpjdHP+ibZJJJugwXJB87F7i53rlocJEgAzu7noVg=;
 b=m6zIfmosf83sMkJG5g3C/yFv+vC4ZMHeHu6aAIaiUEs42yeDvREBPxHl3VtSSN76X94rEOoRXxOZFKPwivRY0WmqD+3HxyCvVOHH1pjEG97PdC9e7N3x9O3FnhlDEgDPtFDeRxFId+TAigIlet0FqNmhgLp68CDQ+6Luesd0lggxnKCXd7JJSrqfDDbdkpn57OaMAUtvnQ7a8j134vbxtFjhtcZOApt6ZJUupsfXcgl0QNqJn/TzrpY2sIxJ2JPEviS3ILQBNMhaOEEcKoWM6L7I0Bf32OB3wCafo+id0EXkufVP4egpXZGMa+mFJbGXznBHlI8F23iREaydOR4/lQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QaCpjdHP+ibZJJJugwXJB87F7i53rlocJEgAzu7noVg=;
 b=KlNdtA4xKODJf/bo85J1PcuTSGO8ujKR1Ji31ZMG9kpmetNpGThh20ZO0V+b7mxNcmIX7DIy+otqYqaNL75Ekj33KJ0MZ5KtleFbVNE98N1GODJlc5zhz7b8ne39WA41cVmT24xn+4FwyyOixccc6wUjSyWPepCK8xg6vQvejh8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v3 6/6] libxl: add support for parsing MSR features
Date: Thu, 20 Jul 2023 10:25:40 +0200
Message-ID: <20230720082540.69444-7-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230720082540.69444-1-roger.pau@citrix.com>
References: <20230720082540.69444-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0172.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:18a::15) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5760:EE_
X-MS-Office365-Filtering-Correlation-Id: 23918c70-e80c-41c6-9163-08db88fb212d
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	UZ/5+VG0W5B/cQ28m9JCm6f0xj8EmIYZGhDi0dw05YQlR/kff3c2+t7pOeW3Z9ullDZwtPbhKUTjb+2tkG6zAm/YPl+pClTnA/ivNG3982dq/nt2DraTIWekQuQHLxuJi1sqWut7oNzz6msw7COmAb1Ly+TBDadqIYTg3HgXQs9z3ej+LW0qY1N16amA6tHQetYR/DmqT3rctUrP2iLAZy9FvuvFWb+4amMx7aGGskE9BwWu8a13jZIxwfMDgbA+554aK0lbv5mXoGig2n/OzOgZKx+T1BinMa1g70O+bsxMkIGZoXKkQyWS8WIVRqi+S/tuI3v8XnUz4rsycIq5VVtw8Brr+JXw1Nc1XUWkMuky9wK7V3/fyEgpQu1mDxdXYO+6kx787ku+b+4HweIfdqyGiAzb3xOdfJ3Si56wzxUr8bq2gdZjCp8Q2+O7ktubcM0efs/LeJDxCi9NV9zITWkffYkuUaQwBLTlLHYTJyaT0V77+3Aq3NSdYhRsOITjrG87aD9xkM4jqLv5lAytm8A8JUTdjRqkknKyBGf7hPZO9/aRlUmjUacDUsdtEara
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(346002)(136003)(376002)(366004)(451199021)(86362001)(478600001)(83380400001)(1076003)(186003)(38100700002)(41300700001)(26005)(54906003)(6916009)(8676002)(8936002)(316002)(2906002)(4326008)(6512007)(66556008)(66946007)(6666004)(66476007)(6486002)(6506007)(82960400001)(2616005)(36756003)(5660300002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bHk5TVdTblRZRTBqLzZQb0c1OTBxQ2hNcmxMNHVNL0NMNHhldE1zZjNsVUZj?=
 =?utf-8?B?empCZlF0TUpjYTVYT1Y4SnozU0RlbHZ1THhFS0ExMmlwY25pTXE0UDUvUmhE?=
 =?utf-8?B?VElVbitxVEhzMGlFWmxLbG1jSUIwMDBiZFozTnAvTlYyajFQMG4xSk04RC9P?=
 =?utf-8?B?Rk5OUVdrOThmSERiN3BMZ2VVb3ZhWUtOMlp2MXZrZW9XMkFoWGJlZEFseW96?=
 =?utf-8?B?TExpWWptUFRrUWpMellMbkZ5Mm02QmlLWkJONVFxdzhUSHp0M0Q2dHNIanZN?=
 =?utf-8?B?TEZJdWJJTDFwck5OU2VGN2wrWnh2MXZPUmZCbUl5ckFMNVhmaStieHBKRlBI?=
 =?utf-8?B?dEorMlVObXhOOFJrNWdiUkNaaUFOQU1IcHJ0Y0JrNjlVVW52cDFkVVBUdTR4?=
 =?utf-8?B?SFg3UnBST1o5Rm5rQzdqQW12N3QxNkxPWUxXZGFNMEprbTU1aW1jOEVHeTJz?=
 =?utf-8?B?Uk9EZDlMVGowWkdqZERzbHJQTWVVVytVVFIxTlNKUit6ckRURnVSZjR5RHFo?=
 =?utf-8?B?THh0aXlsN0NHNEo4NGQ1WEsxdVgyNUV0aldHbmNpRDNPRVF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6YnDcha4v6M8zUFRKVqRjuh129UGBM0rIysFYXSnEfdjVywqJ0/6uDIlozjMLwzRVaZtA45xS6YbIq4ndnOt3CmoRvbmQnLQnVlDPxoRdlVKnZ4kPq2WSXhTKSvBSQJZ2tJXmJzIaglA+pDH3Apnfk2erJs6Yji1SMcs6w4EuEdgREv3b3vGKieOu784kCtWfPxXl+r76+E1NUYPLTOG9jWtIJDN29KBJtCVSepWYFqB3Xi4V7WIa1Jk5ehu0M4/lc4+dgLMnjjbEhJzLQzcbhBKxeMHmbz96Fzefrl2CpVVV7EonB9D56pF6ss/5Dn8di2Tj3LbcVAykFC07gkBJE2IKG/Qqb1gqElxAbrlTkg29u1Bo+gugqnlFgqhyzF/W4elqqoj0UhE7mmC07FU5yH9OLBLkoON5claaR1G5DJvBEZLKaUMubCQTncVQbKAB4ALTCPLunZaIn508ungwuU+a4njdPZ1tiq0aEiApN1V/3yI/k8CsvYXWmmXb9edqOoLdzlsKhhlDMrVb+MvWj3QZ0m9NOenFZ2OLPqn4Mx7rsT9wlYjc0N/q40wPZXPThHXntc0ZOBYB+QZyXyjuKXxgm5Sngj9/G+B3UC0UOHizMZ3gV49HK1wywg7JEXNGpx92hCBmqWOeHTgtzY62sxwRoGvAqp0kIddMgvKx0fPcXAx2PPYi8AVagfDHPKyYXIgHJudZBSFoOykY2e5CSlWbnnFyLpP6j
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 23918c70-e80c-41c6-9163-08db88fb212d
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 08:27:18.0487
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: m9WLJr3r12xkh5oa+1mNTP//HfQdzGYSuIRzLqqACLZDOgy9gxiYsNzB77Gy5HO7rvRTA4hmp99Hm4/LfqUIRQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5760

Introduce support for handling MSR features in
libxl_cpuid_parse_config().  The MSR policies are added to the
libxl_cpuid_policy like the CPUID one, which gets passed to
xc_cpuid_apply_policy().

This allows existing users of libxl to provide MSR related features as
key=value pairs to libxl_cpuid_parse_config() without requiring the
usage of a different API.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
---
Changes since v2:
 - Add some braces.
---
 tools/libs/light/libxl_cpuid.c | 64 +++++++++++++++++++++++++++++++++-
 1 file changed, 63 insertions(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index f8b2e45ee681..15fac03a9046 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -157,6 +157,60 @@ static int cpuid_add(libxl_cpuid_policy_list *policy,
     return 0;
 }
 
+static struct xc_msr *msr_find_match(libxl_cpuid_policy_list *pl, uint32_t index)
+{
+    unsigned int i = 0;
+    libxl_cpuid_policy_list policy = *pl;
+
+    if (policy == NULL)
+        policy = *pl = calloc(1, sizeof(*policy));
+
+    if (policy->msr != NULL) {
+        for (i = 0; policy->msr[i].index != XC_MSR_INPUT_UNUSED; i++) {
+            if (policy->msr[i].index == index) {
+                return &policy->msr[i];
+            }
+        }
+    }
+
+    policy->msr = realloc(policy->msr, sizeof(struct xc_msr) * (i + 2));
+    policy->msr[i].index = index;
+    memset(policy->msr[i].policy, 'x', ARRAY_SIZE(policy->msr[0].policy) - 1);
+    policy->msr[i].policy[ARRAY_SIZE(policy->msr[0].policy) - 1] = '\0';
+    policy->msr[i + 1].index = XC_MSR_INPUT_UNUSED;
+
+    return &policy->msr[i];
+}
+
+static int msr_add(libxl_cpuid_policy_list *policy, uint32_t index, unsigned int bit,
+                   const char *val)
+{
+    struct xc_msr *entry = msr_find_match(policy, index);
+
+    /* Only allow options taking a character for MSRs, no values allowed. */
+    if (strlen(val) != 1)
+        return 3;
+
+    switch (val[0]) {
+    case '0':
+    case '1':
+    case 'x':
+    case 'k':
+        entry->policy[63 - bit] = val[0];
+        break;
+
+    case 's':
+        /* Translate s -> k as xc_msr doesn't support the deprecated 's'. */
+        entry->policy[63 - bit] = 'k';
+        break;
+
+    default:
+        return 3;
+    }
+
+    return 0;
+}
+
 struct feature_name {
     const char *name;
     unsigned int bit;
@@ -336,7 +390,15 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
     }
 
     case FEAT_MSR:
-        return 2;
+    {
+        unsigned int bit = feat->bit % 32;
+
+        if (feature_to_policy[feat->bit / 32].msr.reg == CPUID_REG_EDX)
+            bit += 32;
+
+        return msr_add(policy, feature_to_policy[feat->bit / 32].msr.index,
+                       bit, val);
+    }
     }
 
     return 2;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 08:29:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 08:29:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566485.885350 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMP1u-0005ji-4W; Thu, 20 Jul 2023 08:28:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566485.885350; Thu, 20 Jul 2023 08:28:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMP1u-0005jb-1p; Thu, 20 Jul 2023 08:28:58 +0000
Received: by outflank-mailman (input) for mailman id 566485;
 Thu, 20 Jul 2023 08:28:56 +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
 <SRS0=/1Sz=DG=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qMP1s-0005jJ-7F
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 08:28:56 +0000
Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com
 [2a00:1450:4864:20::12d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 76146da0-26d7-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 10:28:53 +0200 (CEST)
Received: by mail-lf1-x12d.google.com with SMTP id
 2adb3069b0e04-4fb863edcb6so768573e87.0
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 01:28:53 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 q4-20020ac25284000000b004fdc6f03c6dsm90561lfm.37.2023.07.20.01.28.52
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 20 Jul 2023 01:28:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 76146da0-26d7-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689841733; x=1690446533;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=smyzLeygPGKA0rC9jUZSOwG5+PJ3VqfR+LpYNKICf34=;
        b=pI0kqj3l2EAq63WBezahXRCys3v7i8qXRkN/sm7J7UTBL7JuA44Mr1M4h2Cbu3mThy
         BJrk1VSLsPNTkCPCIZ41M9Iia4mbDu//5bGwCwH2ie3EtCRxO33/HALdIsl8CUkuIvIr
         z05JYpiJmCBMjZOXFwEzm8s8A+lGnSAG64L+2LODAcIrPFW7CzXpxb3+iMUAmeIc2B4V
         pcRDfO0FrowUnIdRryUeHa8sC8XYJmtcFtzyA2c5kuiVW+jI1mCKCZ7GbVTDfs78HrgC
         1OcX6XWAc/Im9OjrCFvvdj2/PWRQwZqw3h/RcrUlC4RH8n/Sv46A2BqaXF5d2GvnUwie
         G39Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689841733; x=1690446533;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=smyzLeygPGKA0rC9jUZSOwG5+PJ3VqfR+LpYNKICf34=;
        b=QGSGcI1XiWlef/lAYBWyRneCH2ytviToeNvH8pEUw+WTwIhKrnp40k63SqYc3yy6W1
         KCu+MxlFY4tt/JRkh8hcM3ESRZHHELjTMgkLWUpZSlZ8s+hN0MdoujlnbckQLL5SNze6
         wZ7Dq/znjmain/4YrQNQVufpW9VMwznVJLW8eEsn0TkMQSZj+f4wXZLMb8qzdwRGm11m
         merDeHK7ly/bRfg/juQXg7GDq6B71ZjeC0DSmy0iIlpz0ivTEEM3GAk635J7mdn3hGkr
         wUICkEPrZpEdDMdxo/Ybaz2puIhyaVFHOHkLmQ8LTZYT+0Jd/DdMb+JF6vMT9EtpB0z6
         tXhg==
X-Gm-Message-State: ABy/qLYATb1Q/uyfwSoncFhKEbkedCcEaeE/eMzvp3njsAWbwj0ADt9V
	9AAskpSFzlmpbbtA/N4tFSQ=
X-Google-Smtp-Source: APBJJlGc0NVpS61/F2J2toUyXaVZ6uTBwDHrzOHKT6V9DBWm6LEzHwsLpGgKnkDWpnVPNZy5ui+bGA==
X-Received: by 2002:a19:4409:0:b0:4fb:74d6:6154 with SMTP id r9-20020a194409000000b004fb74d66154mr1527230lfa.37.1689841732873;
        Thu, 20 Jul 2023 01:28:52 -0700 (PDT)
Message-ID: <0cbf6a69e8ae08f6b85edcc4f8d53a84e0103d8b.camel@gmail.com>
Subject: Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Bob Eshleman
	 <bobbyeshleman@gmail.com>, Alistair Francis <alistair.francis@wdc.com>, 
	Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
Date: Thu, 20 Jul 2023 11:28:52 +0300
In-Reply-To: <c1a3d447-4b4d-cd9f-642d-e30fed088302@suse.com>
References: <cover.1689604562.git.oleksii.kurochko@gmail.com>
	 <8c69050d7b1f42df5e776ca9494164a4d15f2d52.1689604562.git.oleksii.kurochko@gmail.com>
	 <ad53c037-3c1b-ff1a-93df-b79ab2948174@suse.com>
	 <30540953fb363fce4dfd59f8a7e709247a9872fd.camel@gmail.com>
	 <c1a3d447-4b4d-cd9f-642d-e30fed088302@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Thu, 2023-07-20 at 07:58 +0200, Jan Beulich wrote:
> On 19.07.2023 18:35, Oleksii wrote:
> > On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote:
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 unsigned long load_end =3D LINK_TO_LOAD(_end);
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 unsigned long pt_level_size =3D XEN_PT_LEVEL_SIZE(i
> > > > -
> > > > 1);
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 unsigned long xen_size =3D ROUNDUP(load_end -
> > > > load_start, pt_level_size);
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 unsigned long page_entries_num =3D xen_size /
> > > > pt_level_size;
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 while ( page_entries_num-- )
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 pgtbl[index++].pte =3D 0;
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 break;
> > >=20
> > > Unless there's a "not crossing a 2Mb boundary" guarantee
> > > somewhere
> > > that I've missed, this "break" is still too early afaict.
> > If I will add a '2 MB boundary check' for load_start and
> > linker_start
> > could it be an upstreamable solution?
> >=20
> > Something like:
> > =C2=A0=C2=A0=C2=A0 if ( !IS_ALIGNED(load_start, MB(2) )
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0printk("load_start shou=
ld be 2Mb algined\n");
> > and
> > =C2=A0=C2=A0=C2=A0 ASSERT( !IS_ALIGNED(XEN_VIRT_START, MB(2) )
> > in xen.lds.S.
>=20
> Arranging for the linked address to be 2Mb-aligned is certainly
> reasonable. Whether expecting the load address to also be depends
> on whether that can be arranged for (which in turn depends on boot
> loader behavior); it cannot be left to "luck".
Maybe I didn't quite understand you here, but if Xen has an alignment
check of load address then boot loader has to follow the alignment
requirements of Xen. So it doesn't look as 'luck'.

>=20
> > Then we will have completely different L0 tables for identity
> > mapping
> > and not identity and the code above will be correct.
>=20
> As long as Xen won't grow beyond 2Mb total. Considering that at
> some point you may want to use large page mappings for .text,
> .data, and .rodata, that alone would grow Xen to 6 Mb (or really 8,
> assuming .init goes separate as well). That's leaving aside the
> realistic option of the mere sum of all sections being larger than
> 2. That said, even Arm64 with ACPI is still quite a bit below 2Mb.
> x86 is nearing 2.5 though in even a somewhat limited config;
> allyesconfig may well be beyond that already.
I am missing something about Xen size. Lets assume that Xen will be
mapped using only 4k pagees ( like it is done now ). Then if Xen will
be more then 2Mb then only what will be changed is a number of page
tables so it is only question of changing of PGTBL_INITIAL_COUNT ( in
case of RISC-V).

Could you please explain why Xen will grow to 6/8 MB in case of larger
page mappings? In case of larger page mapping fewer tables are needed.
For example, if we would like to use 2Mb pages then we will stop at L1
page table and write an physical address to L1 page table entry instead
of creating new L0 page table.

>=20
> Of course you may legitimately leave dealing with that to the
> future.
Then I'll send new patch series with updated alignment requirements.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 09:20:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 09:20:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566492.885360 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMPpX-0005NU-SC; Thu, 20 Jul 2023 09:20:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566492.885360; Thu, 20 Jul 2023 09:20:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMPpX-0005NN-Ph; Thu, 20 Jul 2023 09:20:15 +0000
Received: by outflank-mailman (input) for mailman id 566492;
 Thu, 20 Jul 2023 09:20:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMPpW-0005NH-O1
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 09:20:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMPpW-0007ds-AN; Thu, 20 Jul 2023 09:20:14 +0000
Received: from 54-240-197-231.amazon.com ([54.240.197.231]
 helo=[192.168.24.131]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMPpV-0003Du-UL; Thu, 20 Jul 2023 09:20:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=jvifhrBzg7ZW3jPPsl89TSoiFWqaidsXZQg2N+GG++w=; b=yPAvsaeh8esNTbGZCgeKSeB6Xd
	gf8/2olijbwAHOzz4QFhu44rUWpX0rEjg5uQQ2McG3oBbfWHaaMhdXmjvRcRP1QjiAS+Bt6u4J0v2
	1uqYxhQgbe6luIoB6PQ1+uPHcmehuaYlKkpahkSE0SW1uRnmAQyfcahlYoUkWtHr2fcY=;
Message-ID: <2053098f-5311-89ec-294a-aa731f2b01e1@xen.org>
Date: Thu, 20 Jul 2023 10:20:11 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v2 1/3] xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig
 option
Content-Language: en-US
To: Stewart Hildebrand <stewart.hildebrand@amd.com>,
 xen-devel@lists.xenproject.org
Cc: Rahul Singh <rahul.singh@arm.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Artem Mygaiev <artem_mygaiev@epam.com>,
 Stefano Stabellini <stefano.stabellini@amd.com>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-2-stewart.hildebrand@amd.com>
 <041323d2-9114-328f-40c6-f5fed60892a5@xen.org>
 <1a8d7024-f881-a3f4-c575-240fb393555f@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <1a8d7024-f881-a3f4-c575-240fb393555f@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 18/07/2023 18:35, Stewart Hildebrand wrote:
> On 7/13/23 14:40, Julien Grall wrote:
>> Hi Stewart,
>>
>> On 07/07/2023 02:47, Stewart Hildebrand wrote:
>>> From: Rahul Singh <rahul.singh@arm.com>
>>>
>>> Setting CONFIG_PCI_PASSTHROUGH=y will enable PCI passthrough on ARM, even though
>>> the feature is not yet complete in the current upstream codebase. The purpose of
>>> this is to make it easier to enable the necessary configs (HAS_PCI, HAS_VPCI) for
>>> testing and development of PCI passthrough on ARM.
>>>
>>> Since PCI passthrough on ARM is still work in progress at this time, make it
>>> depend on EXPERT.
>>
>> While preparing the patch for committing, I noticed that HAS_PASSTHROUGH
>> will now allow the user to select one of the IOMMU quarantine options.
>>
>> There are three of them right now:
>>  Â  1. none
>>  Â  2. basic (i.e. faulting)
>>  Â  3. scratch page
>>
>> The latter is unlikely to work on Arm because we don't setup the scratch
>> page. AFAIU, for that, we would need to implement the callback
>> quarantine_init().
>>
>> I would expect 1 and 2 work. That said, I think 1. would behave like 2.
>> because on Arm the device should not be automatically re-assigned to
>> dom0. I know this is correct for platform device, but will it be valid
>> for PCI as well?
> 
> In a system with dom0 where the guest is created from the xl toolstack, we rely on "xl pci-assignable-add". Upon domain destruction, the device automatically gets assigned to domIO.

Ok. To clarify, does this mean any DMA will fault, the same as for 
platform device?

> However, there's nothing preventing a user from attempting to invoke "xl pci-assignable-remove", which should assign the device back to dom0, but it is not automatic.

I don't think we want to fully prevent a user to re-assign a device to 
dom0. But we at least want to avoid re-assigning the device to dom0 by 
default. After that a user can reset the device before it gets 
re-assigned to dom0.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 09:30:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 09:30:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566495.885371 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMPzM-0007BV-Pw; Thu, 20 Jul 2023 09:30:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566495.885371; Thu, 20 Jul 2023 09:30:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMPzM-0007BO-ND; Thu, 20 Jul 2023 09:30:24 +0000
Received: by outflank-mailman (input) for mailman id 566495;
 Thu, 20 Jul 2023 09:30:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=1A6n=DG=linaro.org=viresh.kumar@srs-se1.protection.inumbo.net>)
 id 1qMPzL-0007BI-1g
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 09:30:23 +0000
Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com
 [2607:f8b0:4864:20::1035])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0b3a67db-26e0-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 11:30:20 +0200 (CEST)
Received: by mail-pj1-x1035.google.com with SMTP id
 98e67ed59e1d1-262e89a3ee2so270229a91.1
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 02:30:20 -0700 (PDT)
Received: from localhost ([122.172.87.195]) by smtp.gmail.com with ESMTPSA id
 gw15-20020a17090b0a4f00b00267bb769652sm666469pjb.6.2023.07.20.02.30.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 20 Jul 2023 02:30:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0b3a67db-26e0-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689845419; x=1690450219;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=M1SsbgozmtM/pSbOclSq1igA+sXJRO0yU8n0dtU3EnA=;
        b=w6dnXXrPSXBRLxLMpVqr/3HZBtumCOCDZvD7OXMn0TeBbowumPhEv4/0PX7N+pr/sr
         7OkH8x1Uc8Bh7sg74NW63WzbQooZJUmbxmbhaKfpPbZSRVIMZM0VEe1cNHIuOcajUaRi
         FPyA4Gr0WT878Twcdbm0PUrvwIvbGmEfbaPflAJPMQos48II7WKvQxti8mFmjU5Sz57T
         4n8KWDqbWq1UR6Jz/iLxoycqJl1Ak9pkAgaazw6furh8yxep51IaxJ6w7SSQfIrDlge8
         ebfYAbmULWifGJery2nTPHstY6Yvt3STkux4InceNY/c0EG5sNknaP7/KG/BAgRWIczT
         xltQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689845419; x=1690450219;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=M1SsbgozmtM/pSbOclSq1igA+sXJRO0yU8n0dtU3EnA=;
        b=Ue8Vp3JG+OnSAkgrdMC7dlNdofzwRietaJZKB4yzA8f1qW5L6nKPfXiRCZR6A1EkPw
         yPPBFPzQ5oUGBm84iF4EfLaEcYhlXfU4b25+Iq6q1VrqMtpr7ImfEy92f5mJfg1JoxB9
         PZkRKknQ7IBOyn1a15AzW79jaR4lwmbzhe8rHue9KBYSfQXwvVib+/MXb6SZ8pKYTo6N
         72Gma2IJ08amhFEyWF7mpksJEmculG9wqB/mL12K1jVIA1L4EaQxJA3S9R0McDy3F4q1
         lp/nbaqkuOzLSlwrYYiJVNGxTGz/pqNaop3QtXGn63dFSmdxw9CIn1rIYHFr0jSlZIEy
         NVSg==
X-Gm-Message-State: ABy/qLaqepHIRDtMea7KvWe8ck+eyOC11ZbRI/il/slMpwBJhV01ustO
	V1sOBc1YmJ3DA7z9f8fC/XhSMQ==
X-Google-Smtp-Source: APBJJlFS9iR2fkSXP0Axm+wKJmZt34iyTOhoY08p9XO5XN4RgJGtYjDD4Spk2QqaPZnp+wtHnzjvXA==
X-Received: by 2002:a17:90a:df8b:b0:263:70e7:1e17 with SMTP id p11-20020a17090adf8b00b0026370e71e17mr3610728pjv.9.1689845418976;
        Thu, 20 Jul 2023 02:30:18 -0700 (PDT)
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	=?UTF-8?q?Alex=20Benn=C3=A9e?= <alex.bennee@linaro.org>,
	stratos-dev@op-lists.linaro.org,
	Erik Schilling <erik.schilling@linaro.org>,
	Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	xen-devel@lists.xenproject.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH V2 1/2] xen: Update dm_op.h from Xen public header
Date: Thu, 20 Jul 2023 15:00:06 +0530
Message-Id: <c923befe0a016891e7dee3e1ccb3c00d676f2b3d.1689845210.git.viresh.kumar@linaro.org>
X-Mailer: git-send-email 2.31.1.272.g89b43f80a514
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Update the definitions in dm_op.h from Xen public header.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
V1->V2:
- New commit.

 include/xen/interface/hvm/dm_op.h | 445 ++++++++++++++++++++++++++++++
 1 file changed, 445 insertions(+)

diff --git a/include/xen/interface/hvm/dm_op.h b/include/xen/interface/hvm/dm_op.h
index 08d972f87c7b..bc6948fd1815 100644
--- a/include/xen/interface/hvm/dm_op.h
+++ b/include/xen/interface/hvm/dm_op.h
@@ -6,6 +6,451 @@
 #ifndef __XEN_PUBLIC_HVM_DM_OP_H__
 #define __XEN_PUBLIC_HVM_DM_OP_H__
 
+#include <xen/interface/xen.h>
+#include <xen/interface/event_channel.h>
+
+#ifndef uint64_aligned_t
+#define uint64_aligned_t uint64_t
+#endif
+
+/*
+ * IOREQ Servers
+ *
+ * The interface between an I/O emulator and Xen is called an IOREQ Server.
+ * A domain supports a single 'legacy' IOREQ Server which is instantiated if
+ * parameter...
+ *
+ * HVM_PARAM_IOREQ_PFN is read (to get the gfn containing the synchronous
+ * ioreq structures), or...
+ * HVM_PARAM_BUFIOREQ_PFN is read (to get the gfn containing the buffered
+ * ioreq ring), or...
+ * HVM_PARAM_BUFIOREQ_EVTCHN is read (to get the event channel that Xen uses
+ * to request buffered I/O emulation).
+ *
+ * The following hypercalls facilitate the creation of IOREQ Servers for
+ * 'secondary' emulators which are invoked to implement port I/O, memory, or
+ * PCI config space ranges which they explicitly register.
+ */
+
+typedef uint16_t ioservid_t;
+
+/*
+ * XEN_DMOP_create_ioreq_server: Instantiate a new IOREQ Server for a
+ *                               secondary emulator.
+ *
+ * The <id> handed back is unique for target domain. The valur of
+ * <handle_bufioreq> should be one of HVM_IOREQSRV_BUFIOREQ_* defined in
+ * hvm_op.h. If the value is HVM_IOREQSRV_BUFIOREQ_OFF then  the buffered
+ * ioreq ring will not be allocated and hence all emulation requests to
+ * this server will be synchronous.
+ */
+#define XEN_DMOP_create_ioreq_server 1
+
+struct xen_dm_op_create_ioreq_server {
+    /* IN - should server handle buffered ioreqs */
+    uint8_t handle_bufioreq;
+    uint8_t pad[3];
+    /* OUT - server id */
+    ioservid_t id;
+};
+
+/*
+ * XEN_DMOP_get_ioreq_server_info: Get all the information necessary to
+ *                                 access IOREQ Server <id>.
+ *
+ * If the IOREQ Server is handling buffered emulation requests, the
+ * emulator needs to bind to event channel <bufioreq_port> to listen for
+ * them. (The event channels used for synchronous emulation requests are
+ * specified in the per-CPU ioreq structures).
+ * In addition, if the XENMEM_acquire_resource memory op cannot be used,
+ * the emulator will need to map the synchronous ioreq structures and
+ * buffered ioreq ring (if it exists) from guest memory. If <flags> does
+ * not contain XEN_DMOP_no_gfns then these pages will be made available and
+ * the frame numbers passed back in gfns <ioreq_gfn> and <bufioreq_gfn>
+ * respectively. (If the IOREQ Server is not handling buffered emulation
+ * only <ioreq_gfn> will be valid).
+ *
+ * NOTE: To access the synchronous ioreq structures and buffered ioreq
+ *       ring, it is preferable to use the XENMEM_acquire_resource memory
+ *       op specifying resource type XENMEM_resource_ioreq_server.
+ */
+#define XEN_DMOP_get_ioreq_server_info 2
+
+struct xen_dm_op_get_ioreq_server_info {
+    /* IN - server id */
+    ioservid_t id;
+    /* IN - flags */
+    uint16_t flags;
+
+#define _XEN_DMOP_no_gfns 0
+#define XEN_DMOP_no_gfns (1u << _XEN_DMOP_no_gfns)
+
+    /* OUT - buffered ioreq port */
+    evtchn_port_t bufioreq_port;
+    /* OUT - sync ioreq gfn (see block comment above) */
+    uint64_aligned_t ioreq_gfn;
+    /* OUT - buffered ioreq gfn (see block comment above)*/
+    uint64_aligned_t bufioreq_gfn;
+};
+
+/*
+ * XEN_DMOP_map_io_range_to_ioreq_server: Register an I/O range for
+ *                                        emulation by the client of
+ *                                        IOREQ Server <id>.
+ * XEN_DMOP_unmap_io_range_from_ioreq_server: Deregister an I/O range
+ *                                            previously registered for
+ *                                            emulation by the client of
+ *                                            IOREQ Server <id>.
+ *
+ * There are three types of I/O that can be emulated: port I/O, memory
+ * accesses and PCI config space accesses. The <type> field denotes which
+ * type of range* the <start> and <end> (inclusive) fields are specifying.
+ * PCI config space ranges are specified by segment/bus/device/function
+ * values which should be encoded using the DMOP_PCI_SBDF helper macro
+ * below.
+ *
+ * NOTE: unless an emulation request falls entirely within a range mapped
+ * by a secondary emulator, it will not be passed to that emulator.
+ */
+#define XEN_DMOP_map_io_range_to_ioreq_server 3
+#define XEN_DMOP_unmap_io_range_from_ioreq_server 4
+
+struct xen_dm_op_ioreq_server_range {
+    /* IN - server id */
+    ioservid_t id;
+    uint16_t pad;
+    /* IN - type of range */
+    uint32_t type;
+# define XEN_DMOP_IO_RANGE_PORT   0 /* I/O port range */
+# define XEN_DMOP_IO_RANGE_MEMORY 1 /* MMIO range */
+# define XEN_DMOP_IO_RANGE_PCI    2 /* PCI segment/bus/dev/func range */
+    /* IN - inclusive start and end of range */
+    uint64_aligned_t start, end;
+};
+
+#define XEN_DMOP_PCI_SBDF(s,b,d,f) \
+	((((s) & 0xffff) << 16) |  \
+	 (((b) & 0xff) << 8) |     \
+	 (((d) & 0x1f) << 3) |     \
+	 ((f) & 0x07))
+
+/*
+ * XEN_DMOP_set_ioreq_server_state: Enable or disable the IOREQ Server <id>
+ *
+ * The IOREQ Server will not be passed any emulation requests until it is
+ * in the enabled state.
+ * Note that the contents of the ioreq_gfn and bufioreq_gfn (see
+ * XEN_DMOP_get_ioreq_server_info) are not meaningful until the IOREQ Server
+ * is in the enabled state.
+ */
+#define XEN_DMOP_set_ioreq_server_state 5
+
+struct xen_dm_op_set_ioreq_server_state {
+    /* IN - server id */
+    ioservid_t id;
+    /* IN - enabled? */
+    uint8_t enabled;
+    uint8_t pad;
+};
+
+/*
+ * XEN_DMOP_destroy_ioreq_server: Destroy the IOREQ Server <id>.
+ *
+ * Any registered I/O ranges will be automatically deregistered.
+ */
+#define XEN_DMOP_destroy_ioreq_server 6
+
+struct xen_dm_op_destroy_ioreq_server {
+    /* IN - server id */
+    ioservid_t id;
+    uint16_t pad;
+};
+
+/*
+ * XEN_DMOP_track_dirty_vram: Track modifications to the specified pfn
+ *                            range.
+ *
+ * NOTE: The bitmap passed back to the caller is passed in a
+ *       secondary buffer.
+ */
+#define XEN_DMOP_track_dirty_vram 7
+
+struct xen_dm_op_track_dirty_vram {
+    /* IN - number of pages to be tracked */
+    uint32_t nr;
+    uint32_t pad;
+    /* IN - first pfn to track */
+    uint64_aligned_t first_pfn;
+};
+
+/*
+ * XEN_DMOP_set_pci_intx_level: Set the logical level of one of a domain's
+ *                              PCI INTx pins.
+ */
+#define XEN_DMOP_set_pci_intx_level 8
+
+struct xen_dm_op_set_pci_intx_level {
+    /* IN - PCI INTx identification (domain:bus:device:intx) */
+    uint16_t domain;
+    uint8_t bus, device, intx;
+    /* IN - Level: 0 -> deasserted, 1 -> asserted */
+    uint8_t  level;
+};
+
+/*
+ * XEN_DMOP_set_isa_irq_level: Set the logical level of a one of a domain's
+ *                             ISA IRQ lines.
+ */
+#define XEN_DMOP_set_isa_irq_level 9
+
+struct xen_dm_op_set_isa_irq_level {
+    /* IN - ISA IRQ (0-15) */
+    uint8_t  isa_irq;
+    /* IN - Level: 0 -> deasserted, 1 -> asserted */
+    uint8_t  level;
+};
+
+/*
+ * XEN_DMOP_set_pci_link_route: Map a PCI INTx line to an IRQ line.
+ */
+#define XEN_DMOP_set_pci_link_route 10
+
+struct xen_dm_op_set_pci_link_route {
+    /* PCI INTx line (0-3) */
+    uint8_t  link;
+    /* ISA IRQ (1-15) or 0 -> disable link */
+    uint8_t  isa_irq;
+};
+
+/*
+ * XEN_DMOP_modified_memory: Notify that a set of pages were modified by
+ *                           an emulator.
+ *
+ * DMOP buf 1 contains an array of xen_dm_op_modified_memory_extent with
+ * @nr_extents entries.
+ *
+ * On error, @nr_extents will contain the index+1 of the extent that
+ * had the error.  It is not defined if or which pages may have been
+ * marked as dirty, in this event.
+ */
+#define XEN_DMOP_modified_memory 11
+
+struct xen_dm_op_modified_memory {
+    /*
+     * IN - Number of extents to be processed
+     * OUT -returns n+1 for failing extent
+     */
+    uint32_t nr_extents;
+    /* IN/OUT - Must be set to 0 */
+    uint32_t opaque;
+};
+
+struct xen_dm_op_modified_memory_extent {
+    /* IN - number of contiguous pages modified */
+    uint32_t nr;
+    uint32_t pad;
+    /* IN - first pfn modified */
+    uint64_aligned_t first_pfn;
+};
+
+/*
+ * XEN_DMOP_set_mem_type: Notify that a region of memory is to be treated
+ *                        in a specific way. (See definition of
+ *                        hvmmem_type_t).
+ *
+ * NOTE: In the event of a continuation (return code -ERESTART), the
+ *       @first_pfn is set to the value of the pfn of the remaining
+ *       region and @nr reduced to the size of the remaining region.
+ */
+#define XEN_DMOP_set_mem_type 12
+
+struct xen_dm_op_set_mem_type {
+    /* IN - number of contiguous pages */
+    uint32_t nr;
+    /* IN - new hvmmem_type_t of region */
+    uint16_t mem_type;
+    uint16_t pad;
+    /* IN - first pfn in region */
+    uint64_aligned_t first_pfn;
+};
+
+/*
+ * XEN_DMOP_inject_event: Inject an event into a VCPU, which will
+ *                        get taken up when it is next scheduled.
+ *
+ * Note that the caller should know enough of the state of the CPU before
+ * injecting, to know what the effect of injecting the event will be.
+ */
+#define XEN_DMOP_inject_event 13
+
+struct xen_dm_op_inject_event {
+    /* IN - index of vCPU */
+    uint32_t vcpuid;
+    /* IN - interrupt vector */
+    uint8_t vector;
+    /* IN - event type (DMOP_EVENT_* ) */
+    uint8_t type;
+/* NB. This enumeration precisely matches hvm.h:X86_EVENTTYPE_* */
+# define XEN_DMOP_EVENT_ext_int    0 /* external interrupt */
+# define XEN_DMOP_EVENT_nmi        2 /* nmi */
+# define XEN_DMOP_EVENT_hw_exc     3 /* hardware exception */
+# define XEN_DMOP_EVENT_sw_int     4 /* software interrupt (CD nn) */
+# define XEN_DMOP_EVENT_pri_sw_exc 5 /* ICEBP (F1) */
+# define XEN_DMOP_EVENT_sw_exc     6 /* INT3 (CC), INTO (CE) */
+    /* IN - instruction length */
+    uint8_t insn_len;
+    uint8_t pad0;
+    /* IN - error code (or ~0 to skip) */
+    uint32_t error_code;
+    uint32_t pad1;
+    /* IN - type-specific extra data (%cr2 for #PF, pending_dbg for #DB) */
+    uint64_aligned_t cr2;
+};
+
+/*
+ * XEN_DMOP_inject_msi: Inject an MSI for an emulated device.
+ */
+#define XEN_DMOP_inject_msi 14
+
+struct xen_dm_op_inject_msi {
+    /* IN - MSI data (lower 32 bits) */
+    uint32_t data;
+    uint32_t pad;
+    /* IN - MSI address (0xfeexxxxx) */
+    uint64_aligned_t addr;
+};
+
+/*
+ * XEN_DMOP_map_mem_type_to_ioreq_server : map or unmap the IOREQ Server <id>
+ *                                      to specific memory type <type>
+ *                                      for specific accesses <flags>
+ *
+ * For now, flags only accept the value of XEN_DMOP_IOREQ_MEM_ACCESS_WRITE,
+ * which means only write operations are to be forwarded to an ioreq server.
+ * Support for the emulation of read operations can be added when an ioreq
+ * server has such requirement in future.
+ */
+#define XEN_DMOP_map_mem_type_to_ioreq_server 15
+
+struct xen_dm_op_map_mem_type_to_ioreq_server {
+    ioservid_t id;      /* IN - ioreq server id */
+    uint16_t type;      /* IN - memory type */
+    uint32_t flags;     /* IN - types of accesses to be forwarded to the
+                           ioreq server. flags with 0 means to unmap the
+                           ioreq server */
+
+#define XEN_DMOP_IOREQ_MEM_ACCESS_READ (1u << 0)
+#define XEN_DMOP_IOREQ_MEM_ACCESS_WRITE (1u << 1)
+
+    uint64_t opaque;    /* IN/OUT - only used for hypercall continuation,
+                           has to be set to zero by the caller */
+};
+
+/*
+ * XEN_DMOP_remote_shutdown : Declare a shutdown for another domain
+ *                            Identical to SCHEDOP_remote_shutdown
+ */
+#define XEN_DMOP_remote_shutdown 16
+
+struct xen_dm_op_remote_shutdown {
+    uint32_t reason;       /* SHUTDOWN_* => enum sched_shutdown_reason */
+                           /* (Other reason values are not blocked) */
+};
+
+/*
+ * XEN_DMOP_relocate_memory : Relocate GFNs for the specified guest.
+ *                            Identical to XENMEM_add_to_physmap with
+ *                            space == XENMAPSPACE_gmfn_range.
+ */
+#define XEN_DMOP_relocate_memory 17
+
+struct xen_dm_op_relocate_memory {
+    /* All fields are IN/OUT, with their OUT state undefined. */
+    /* Number of GFNs to process. */
+    uint32_t size;
+    uint32_t pad;
+    /* Starting GFN to relocate. */
+    uint64_aligned_t src_gfn;
+    /* Starting GFN where GFNs should be relocated. */
+    uint64_aligned_t dst_gfn;
+};
+
+/*
+ * XEN_DMOP_pin_memory_cacheattr : Pin caching type of RAM space.
+ *                                 Identical to XEN_DOMCTL_pin_mem_cacheattr.
+ */
+#define XEN_DMOP_pin_memory_cacheattr 18
+
+struct xen_dm_op_pin_memory_cacheattr {
+    uint64_aligned_t start; /* Start gfn. */
+    uint64_aligned_t end;   /* End gfn. */
+/* Caching types: these happen to be the same as x86 MTRR/PAT type codes. */
+#define XEN_DMOP_MEM_CACHEATTR_UC  0
+#define XEN_DMOP_MEM_CACHEATTR_WC  1
+#define XEN_DMOP_MEM_CACHEATTR_WT  4
+#define XEN_DMOP_MEM_CACHEATTR_WP  5
+#define XEN_DMOP_MEM_CACHEATTR_WB  6
+#define XEN_DMOP_MEM_CACHEATTR_UCM 7
+#define XEN_DMOP_DELETE_MEM_CACHEATTR (~(uint32_t)0)
+    uint32_t type;          /* XEN_DMOP_MEM_CACHEATTR_* */
+    uint32_t pad;
+};
+
+/*
+ * XEN_DMOP_set_irq_level: Set the logical level of a one of a domain's
+ *                         IRQ lines (currently Arm only).
+ * Only SPIs are supported.
+ */
+#define XEN_DMOP_set_irq_level 19
+
+struct xen_dm_op_set_irq_level {
+    uint32_t irq;
+    /* IN - Level: 0 -> deasserted, 1 -> asserted */
+    uint8_t level;
+    uint8_t pad[3];
+};
+
+/*
+ * XEN_DMOP_nr_vcpus: Query the number of vCPUs a domain has.
+ *
+ * This is the number of vcpu objects allocated in Xen for the domain, and is
+ * fixed from creation time.  This bound is applicable to e.g. the vcpuid
+ * parameter of XEN_DMOP_inject_event, or number of struct ioreq objects
+ * mapped via XENMEM_acquire_resource.
+ */
+#define XEN_DMOP_nr_vcpus 20
+
+struct xen_dm_op_nr_vcpus {
+    uint32_t vcpus; /* OUT */
+};
+
+struct xen_dm_op {
+    uint32_t op;
+    uint32_t pad;
+    union {
+        struct xen_dm_op_create_ioreq_server create_ioreq_server;
+        struct xen_dm_op_get_ioreq_server_info get_ioreq_server_info;
+        struct xen_dm_op_ioreq_server_range map_io_range_to_ioreq_server;
+        struct xen_dm_op_ioreq_server_range unmap_io_range_from_ioreq_server;
+        struct xen_dm_op_set_ioreq_server_state set_ioreq_server_state;
+        struct xen_dm_op_destroy_ioreq_server destroy_ioreq_server;
+        struct xen_dm_op_track_dirty_vram track_dirty_vram;
+        struct xen_dm_op_set_pci_intx_level set_pci_intx_level;
+        struct xen_dm_op_set_isa_irq_level set_isa_irq_level;
+        struct xen_dm_op_set_irq_level set_irq_level;
+        struct xen_dm_op_set_pci_link_route set_pci_link_route;
+        struct xen_dm_op_modified_memory modified_memory;
+        struct xen_dm_op_set_mem_type set_mem_type;
+        struct xen_dm_op_inject_event inject_event;
+        struct xen_dm_op_inject_msi inject_msi;
+        struct xen_dm_op_map_mem_type_to_ioreq_server map_mem_type_to_ioreq_server;
+        struct xen_dm_op_remote_shutdown remote_shutdown;
+        struct xen_dm_op_relocate_memory relocate_memory;
+        struct xen_dm_op_pin_memory_cacheattr pin_memory_cacheattr;
+        struct xen_dm_op_nr_vcpus nr_vcpus;
+    } u;
+};
+
 struct xen_dm_op_buf {
 	GUEST_HANDLE(void) h;
 	xen_ulong_t size;
-- 
2.31.1.272.g89b43f80a514



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 09:30:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 09:30:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566496.885381 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMPzQ-0007R7-7E; Thu, 20 Jul 2023 09:30:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566496.885381; Thu, 20 Jul 2023 09:30:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMPzQ-0007R0-4H; Thu, 20 Jul 2023 09:30:28 +0000
Received: by outflank-mailman (input) for mailman id 566496;
 Thu, 20 Jul 2023 09:30:27 +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
 <SRS0=1A6n=DG=linaro.org=viresh.kumar@srs-se1.protection.inumbo.net>)
 id 1qMPzP-0007QV-2r
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 09:30:27 +0000
Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com
 [2607:f8b0:4864:20::c32])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0d377342-26e0-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 11:30:23 +0200 (CEST)
Received: by mail-oo1-xc32.google.com with SMTP id
 006d021491bc7-55e04a83465so408404eaf.3
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 02:30:23 -0700 (PDT)
Received: from localhost ([122.172.87.195]) by smtp.gmail.com with ESMTPSA id
 z24-20020a63ac58000000b005533b6cb3a6sm697646pgn.16.2023.07.20.02.30.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 20 Jul 2023 02:30:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0d377342-26e0-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689845422; x=1690450222;
        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=BcH5CivD9JzsOs5ChgN7XNfEBbDf+REI+Wos1lw24t8=;
        b=G4+xAS/DXqyFZcvScl0w5XA5rzH993kM9l/G3ndZtXsZtW/GXcXDd4DKu8/2WnTTAW
         EZ6t/Qva9yGXqNII/ta1AulhgSc25T84hvaA46v2jxTiurTyOAycIONJeLXa0PK4d1Lf
         ZrbwrMI5tYtT3G501McQQMhMMVV6HLFpJfIWgO5GFtfvCwSpkmvrs5vCw/vHNoSCk8yy
         BAr9ZSP/lM4IqQLcqguavKxEMhlrzFBeKuyYal55T5NDpfTaElBVUVNzU0CW5uYjDXwr
         Qgw4YvVl+5GqnVYPECYSN6Xmb/BldHkrP0F2xlAOk50GGTB1Stcqr5QiCG1eTTlp48zA
         JnFw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689845422; x=1690450222;
        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=BcH5CivD9JzsOs5ChgN7XNfEBbDf+REI+Wos1lw24t8=;
        b=Sl/h7skPpsjXtL8N+9EYH1JfD9L95WmchSSd4/wS4X77gEIXzFtVn68Rve9q4bRenN
         OBWrXunfb4+UnMB02M5SSje2Hxq6FLr3Yu3cWB10E24uGHA9zGPwP9vI/t2aXBGaG4W2
         xD+bOCj8BlNKwMvdUQXPnFnwEiEMnCqxXj9wz8KdUfHDCLaHcdgt+Ok0+4Ygkzrl9Q5x
         +VBoF39rBVQh1TsgUvn4tACxCzHQe1v43mEF7h8IHDqxVqpzrOzrBMmuh4BiRLmumnUN
         nkxFON2jBbQJmF/dTn/R/ZCEaTvM45UjnPypuwi9XiIcdGAyMjOHnTolH1oLaSG4S/Ii
         Fvdw==
X-Gm-Message-State: ABy/qLaubfy25ozPZsY6q44B5RS0fWlyyCVjWi+cxE3DmeIv9zPzW2Pq
	P76Gee2YkDNIZ3qCBTLLg9MImQ==
X-Google-Smtp-Source: APBJJlG+CFjzGXiDG9FgbefUPlyvLxVAR2IqlwVmKmE22A4uIy0tZdXSIFUpPshlDp4hzVYdSawMVg==
X-Received: by 2002:a05:6358:5925:b0:134:5662:60a with SMTP id g37-20020a056358592500b001345662060amr8854875rwf.6.1689845422464;
        Thu, 20 Jul 2023 02:30:22 -0700 (PDT)
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	=?UTF-8?q?Alex=20Benn=C3=A9e?= <alex.bennee@linaro.org>,
	stratos-dev@op-lists.linaro.org,
	Erik Schilling <erik.schilling@linaro.org>,
	Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	xen-devel@lists.xenproject.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH V2 2/2] xen: privcmd: Add support for irqfd
Date: Thu, 20 Jul 2023 15:00:07 +0530
Message-Id: <a25d5f01fe9b4624aa12cab77abd001044ea02d5.1689845210.git.viresh.kumar@linaro.org>
X-Mailer: git-send-email 2.31.1.272.g89b43f80a514
In-Reply-To: <c923befe0a016891e7dee3e1ccb3c00d676f2b3d.1689845210.git.viresh.kumar@linaro.org>
References: <c923befe0a016891e7dee3e1ccb3c00d676f2b3d.1689845210.git.viresh.kumar@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Xen provides support for injecting interrupts to the guests via the
HYPERVISOR_dm_op() hypercall. The same is used by the Virtio based
device backend implementations, in an inefficient manner currently.

Generally, the Virtio backends are implemented to work with the Eventfd
based mechanism. In order to make such backends work with Xen, another
software layer needs to poll the Eventfds and raise an interrupt to the
guest using the Xen based mechanism. This results in an extra context
switch.

This is not a new problem in Linux though. It is present with other
hypervisors like KVM, etc. as well. The generic solution implemented in
the kernel for them is to provide an IOCTL call to pass the interrupt
details and eventfd, which lets the kernel take care of polling the
eventfd and raising of the interrupt, instead of handling this in user
space (which involves an extra context switch).

This patch adds support to inject a specific interrupt to guest using
the eventfd mechanism, by preventing the extra context switch.

Inspired by existing implementations for KVM, etc..

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
V1->V2:
- Improve error handling.
- Remove the unnecessary usage of list_for_each_entry_safe().
- Restrict the use of XEN_DMOP_set_irq_level to only ARM64.

 drivers/xen/privcmd.c      | 276 ++++++++++++++++++++++++++++++++++++-
 include/uapi/xen/privcmd.h |  14 ++
 2 files changed, 288 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index e2f580e30a86..0debc5482253 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -9,11 +9,16 @@
 
 #define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt
 
+#include <linux/eventfd.h>
+#include <linux/file.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/poll.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/string.h>
+#include <linux/workqueue.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
@@ -833,6 +838,257 @@ static long privcmd_ioctl_mmap_resource(struct file *file,
 	return rc;
 }
 
+/* Irqfd support */
+static struct workqueue_struct *irqfd_cleanup_wq;
+static DEFINE_MUTEX(irqfds_lock);
+static LIST_HEAD(irqfds_list);
+
+struct privcmd_kernel_irqfd {
+	domid_t dom;
+	u8 level;
+	bool error;
+	u32 irq;
+	struct eventfd_ctx *eventfd;
+	struct work_struct shutdown;
+	wait_queue_entry_t wait;
+	struct list_head list;
+	poll_table pt;
+};
+
+static void irqfd_deactivate(struct privcmd_kernel_irqfd *kirqfd)
+{
+	lockdep_assert_held(&irqfds_lock);
+
+	list_del_init(&kirqfd->list);
+	queue_work(irqfd_cleanup_wq, &kirqfd->shutdown);
+}
+
+static void irqfd_shutdown(struct work_struct *work)
+{
+	struct privcmd_kernel_irqfd *kirqfd =
+		container_of(work, struct privcmd_kernel_irqfd, shutdown);
+	u64 cnt;
+
+	eventfd_ctx_remove_wait_queue(kirqfd->eventfd, &kirqfd->wait, &cnt);
+	eventfd_ctx_put(kirqfd->eventfd);
+	kfree(kirqfd);
+}
+
+static void irqfd_inject(struct privcmd_kernel_irqfd *kirqfd)
+{
+	/* Different architectures support this differently */
+	struct xen_dm_op dm_op = {
+#ifdef CONFIG_ARM64
+		.op = XEN_DMOP_set_irq_level,
+		.u.set_irq_level.irq = kirqfd->irq,
+		.u.set_irq_level.level = kirqfd->level,
+#endif
+	};
+	struct xen_dm_op_buf xbufs = {
+		.size = sizeof(dm_op),
+	};
+	u64 cnt;
+	long rc;
+
+	eventfd_ctx_do_read(kirqfd->eventfd, &cnt);
+	set_xen_guest_handle(xbufs.h, &dm_op);
+
+	xen_preemptible_hcall_begin();
+	rc = HYPERVISOR_dm_op(kirqfd->dom, 1, &xbufs);
+	xen_preemptible_hcall_end();
+
+	/* Don't repeat the error message for consecutive failures */
+	if (rc && !kirqfd->error) {
+		pr_err("Failed to configure irq: %d to level: %d for guest domain: %d\n",
+		       kirqfd->irq, kirqfd->level, kirqfd->dom);
+	}
+
+	kirqfd->error = !!rc;
+}
+
+static int
+irqfd_wakeup(wait_queue_entry_t *wait, unsigned int mode, int sync, void *key)
+{
+	struct privcmd_kernel_irqfd *kirqfd =
+		container_of(wait, struct privcmd_kernel_irqfd, wait);
+	__poll_t flags = key_to_poll(key);
+
+	if (flags & EPOLLIN)
+		irqfd_inject(kirqfd);
+
+	if (flags & EPOLLHUP) {
+		mutex_lock(&irqfds_lock);
+		irqfd_deactivate(kirqfd);
+		mutex_unlock(&irqfds_lock);
+	}
+
+	return 0;
+}
+
+static void
+irqfd_poll_func(struct file *file, wait_queue_head_t *wqh, poll_table *pt)
+{
+	struct privcmd_kernel_irqfd *kirqfd =
+		container_of(pt, struct privcmd_kernel_irqfd, pt);
+
+	add_wait_queue_priority(wqh, &kirqfd->wait);
+}
+
+static int privcmd_irqfd_assign(struct privcmd_irqfd *irqfd)
+{
+	struct privcmd_kernel_irqfd *kirqfd, *tmp;
+	struct eventfd_ctx *eventfd;
+	__poll_t events;
+	struct fd f;
+	int ret;
+
+	kirqfd = kzalloc(sizeof(*kirqfd), GFP_KERNEL);
+	if (!kirqfd)
+		return -ENOMEM;
+
+	kirqfd->irq = irqfd->irq;
+	kirqfd->dom = irqfd->dom;
+	kirqfd->level = irqfd->level;
+	INIT_LIST_HEAD(&kirqfd->list);
+	INIT_WORK(&kirqfd->shutdown, irqfd_shutdown);
+
+	f = fdget(irqfd->fd);
+	if (!f.file) {
+		ret = -EBADF;
+		goto error_kfree;
+	}
+
+	eventfd = eventfd_ctx_fileget(f.file);
+	if (IS_ERR(eventfd)) {
+		ret = PTR_ERR(eventfd);
+		goto error_fd_put;
+	}
+
+	kirqfd->eventfd = eventfd;
+
+	/*
+	 * Install our own custom wake-up handling so we are notified via a
+	 * callback whenever someone signals the underlying eventfd.
+	 */
+	init_waitqueue_func_entry(&kirqfd->wait, irqfd_wakeup);
+	init_poll_funcptr(&kirqfd->pt, irqfd_poll_func);
+
+	mutex_lock(&irqfds_lock);
+
+	list_for_each_entry(tmp, &irqfds_list, list) {
+		if (kirqfd->eventfd == tmp->eventfd) {
+			ret = -EBUSY;
+			mutex_unlock(&irqfds_lock);
+			goto error_eventfd;
+		}
+	}
+
+	list_add_tail(&kirqfd->list, &irqfds_list);
+	mutex_unlock(&irqfds_lock);
+
+	/*
+	 * Check if there was an event already pending on the eventfd before we
+	 * registered, and trigger it as if we didn't miss it.
+	 */
+	events = vfs_poll(f.file, &kirqfd->pt);
+	if (events & EPOLLIN)
+		irqfd_inject(kirqfd);
+
+	/*
+	 * Do not drop the file until the kirqfd is fully initialized, otherwise
+	 * we might race against the EPOLLHUP.
+	 */
+	fdput(f);
+	return 0;
+
+error_eventfd:
+	eventfd_ctx_put(eventfd);
+
+error_fd_put:
+	fdput(f);
+
+error_kfree:
+	kfree(kirqfd);
+	return ret;
+}
+
+static int privcmd_irqfd_deassign(struct privcmd_irqfd *irqfd)
+{
+	struct privcmd_kernel_irqfd *kirqfd;
+	struct eventfd_ctx *eventfd;
+
+	eventfd = eventfd_ctx_fdget(irqfd->fd);
+	if (IS_ERR(eventfd))
+		return PTR_ERR(eventfd);
+
+	mutex_lock(&irqfds_lock);
+
+	list_for_each_entry(kirqfd, &irqfds_list, list) {
+		if (kirqfd->eventfd == eventfd) {
+			irqfd_deactivate(kirqfd);
+			break;
+		}
+	}
+
+	mutex_unlock(&irqfds_lock);
+
+	eventfd_ctx_put(eventfd);
+
+	/*
+	 * Block until we know all outstanding shutdown jobs have completed so
+	 * that we guarantee there will not be any more interrupts once this
+	 * deassign function returns.
+	 */
+	flush_workqueue(irqfd_cleanup_wq);
+
+	return 0;
+}
+
+static long privcmd_ioctl_irqfd(struct file *file, void __user *udata)
+{
+	struct privcmd_data *data = file->private_data;
+	struct privcmd_irqfd irqfd;
+
+	if (copy_from_user(&irqfd, udata, sizeof(irqfd)))
+		return -EFAULT;
+
+	/* No other flags should be set */
+	if (irqfd.flags & ~PRIVCMD_IRQFD_FLAG_DEASSIGN)
+		return -EINVAL;
+
+	/* If restriction is in place, check the domid matches */
+	if (data->domid != DOMID_INVALID && data->domid != irqfd.dom)
+		return -EPERM;
+
+	if (irqfd.flags & PRIVCMD_IRQFD_FLAG_DEASSIGN)
+		return privcmd_irqfd_deassign(&irqfd);
+
+	return privcmd_irqfd_assign(&irqfd);
+}
+
+static int privcmd_irqfd_init(void)
+{
+	irqfd_cleanup_wq = alloc_workqueue("privcmd-irqfd-cleanup", 0, 0);
+	if (!irqfd_cleanup_wq)
+		return -ENOMEM;
+
+	return 0;
+}
+
+static void privcmd_irqfd_exit(void)
+{
+	struct privcmd_kernel_irqfd *kirqfd, *tmp;
+
+	mutex_lock(&irqfds_lock);
+
+	list_for_each_entry_safe(kirqfd, tmp, &irqfds_list, list)
+		irqfd_deactivate(kirqfd);
+
+	mutex_unlock(&irqfds_lock);
+
+	destroy_workqueue(irqfd_cleanup_wq);
+}
+
 static long privcmd_ioctl(struct file *file,
 			  unsigned int cmd, unsigned long data)
 {
@@ -868,6 +1124,10 @@ static long privcmd_ioctl(struct file *file,
 		ret = privcmd_ioctl_mmap_resource(file, udata);
 		break;
 
+	case IOCTL_PRIVCMD_IRQFD:
+		ret = privcmd_ioctl_irqfd(file, udata);
+		break;
+
 	default:
 		break;
 	}
@@ -992,15 +1252,27 @@ static int __init privcmd_init(void)
 	err = misc_register(&xen_privcmdbuf_dev);
 	if (err != 0) {
 		pr_err("Could not register Xen hypercall-buf device\n");
-		misc_deregister(&privcmd_dev);
-		return err;
+		goto err_privcmdbuf;
+	}
+
+	err = privcmd_irqfd_init();
+	if (err != 0) {
+		pr_err("irqfd init failed\n");
+		goto err_irqfd;
 	}
 
 	return 0;
+
+err_irqfd:
+	misc_deregister(&xen_privcmdbuf_dev);
+err_privcmdbuf:
+	misc_deregister(&privcmd_dev);
+	return err;
 }
 
 static void __exit privcmd_exit(void)
 {
+	privcmd_irqfd_exit();
 	misc_deregister(&privcmd_dev);
 	misc_deregister(&xen_privcmdbuf_dev);
 }
diff --git a/include/uapi/xen/privcmd.h b/include/uapi/xen/privcmd.h
index d2029556083e..47334bb91a09 100644
--- a/include/uapi/xen/privcmd.h
+++ b/include/uapi/xen/privcmd.h
@@ -98,6 +98,18 @@ struct privcmd_mmap_resource {
 	__u64 addr;
 };
 
+/* For privcmd_irqfd::flags */
+#define PRIVCMD_IRQFD_FLAG_DEASSIGN (1 << 0)
+
+struct privcmd_irqfd {
+	__u32 fd;
+	__u32 flags;
+	__u32 irq;
+	domid_t dom;
+	__u8 level;
+	__u8 pad;
+};
+
 /*
  * @cmd: IOCTL_PRIVCMD_HYPERCALL
  * @arg: &privcmd_hypercall_t
@@ -125,5 +137,7 @@ struct privcmd_mmap_resource {
 	_IOC(_IOC_NONE, 'P', 6, sizeof(domid_t))
 #define IOCTL_PRIVCMD_MMAP_RESOURCE				\
 	_IOC(_IOC_NONE, 'P', 7, sizeof(struct privcmd_mmap_resource))
+#define IOCTL_PRIVCMD_IRQFD					\
+	_IOC(_IOC_NONE, 'P', 8, sizeof(struct privcmd_irqfd))
 
 #endif /* __LINUX_PUBLIC_PRIVCMD_H__ */
-- 
2.31.1.272.g89b43f80a514



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 09:41:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 09:41:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566502.885390 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMQAA-0001Bh-7K; Thu, 20 Jul 2023 09:41:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566502.885390; Thu, 20 Jul 2023 09:41:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMQAA-0001Ba-4n; Thu, 20 Jul 2023 09:41:34 +0000
Received: by outflank-mailman (input) for mailman id 566502;
 Thu, 20 Jul 2023 09:41:33 +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
 <SRS0=1A6n=DG=linaro.org=viresh.kumar@srs-se1.protection.inumbo.net>)
 id 1qMQA9-0001BU-ED
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 09:41:33 +0000
Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com
 [2607:f8b0:4864:20::533])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9ae118f8-26e1-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 11:41:31 +0200 (CEST)
Received: by mail-pg1-x533.google.com with SMTP id
 41be03b00d2f7-557790487feso381997a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 02:41:31 -0700 (PDT)
Received: from localhost ([122.172.87.195]) by smtp.gmail.com with ESMTPSA id
 13-20020a17090a030d00b0025bbe90d3cbsm701388pje.44.2023.07.20.02.41.28
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 20 Jul 2023 02:41:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9ae118f8-26e1-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689846089; x=1690450889;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=+SuzeACTIOA12bslV6UjXteYfQ39xaXxVv1ezDBpkXs=;
        b=DtmmaKnwLz9laGXKWOpGzlZU52NZ8/CNqMm+SIu37ldYik4X1ML5zRZ5K57SWsCd6w
         eXWrqNraWTwl+xaOzPPByQuOjjCIPmp9jQwdjyMaykAKQM8Eyc5KV6SuKZSrHTlcs22E
         6E2g3pc+8QWxhm2zedmaLBx2dyCGGXjXyMTFogar7kv4LzGah70LpzKRFcUpkiCko5e9
         fKfuPhur4Le3xmze3cZhiEPqRamq9jUDssAF3+u7zaECDoDS38Jov5iEsH74RrtLkDW1
         7qPSqgE1XR7812WkIp/U0om45dOz6btF7RyuCjdPebFuDfnO/+CpKHLHpJcUH03sMP2f
         LXfg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689846089; x=1690450889;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=+SuzeACTIOA12bslV6UjXteYfQ39xaXxVv1ezDBpkXs=;
        b=gaVjLYj7geuiPELzZgDiC6h0NPqFXiO48kuhsjZIoaBrkFKspWMKw85HwZSS5yEG8z
         WslKYReIA+kyrQsj/T3Zxmwq/ZG8EWQvaK4Zbquju0XQNEQ9uF/Qps015mzgVY/3mRLw
         oBIYsNtk10v6acLMZtQizmhVjAU9gPx8DUY4bcH7Dh38iqS7jX1Cipd0K5Yovvp4eTuC
         JQMEiezs4O2/wNaXot7zXv7FrJ2lphwrXUR9XAveXWAy9Tt5NRyTpQa7YZ+IKmJR4aVr
         P5GBcjVtVDLlQ7Agl5/kQ8VBZE85s6DtWRHcUG7hbNE/OyxnD09GOuy97TLtQ/jsXGdR
         HrJw==
X-Gm-Message-State: ABy/qLYmZu7eZaLc5f20RxWqA191M/SfB9PL46dQnNf4JQA/yB5W4YD1
	zyYoX0e7nqoRQag1gkVI4z/GWg==
X-Google-Smtp-Source: APBJJlGuE6xqtIRVcarBtL+5N0XK4nCPMj9Vzs4ke5eqWsBK4A0UgqVzdS4XRwcj71761mb9CNXOxQ==
X-Received: by 2002:a17:90b:4a51:b0:263:2495:c27f with SMTP id lb17-20020a17090b4a5100b002632495c27fmr1541541pjb.15.1689846089653;
        Thu, 20 Jul 2023 02:41:29 -0700 (PDT)
Date: Thu, 20 Jul 2023 15:11:27 +0530
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
Cc: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Alex =?utf-8?Q?Benn=C3=A9e?= <alex.bennee@linaro.org>,
	"stratos-dev@op-lists.linaro.org" <stratos-dev@op-lists.linaro.org>,
	Erik Schilling <erik.schilling@linaro.org>,
	Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] xen: privcmd: Add support for irqfd
Message-ID: <20230720094127.zsqpvryj36cbekik@vireshk-i7>
References: <d4e0233524b8c7c48614b09cae4d23f2cdf10988.1689150266.git.viresh.kumar@linaro.org>
 <a5521a9d-72c6-4e03-0fbb-8a37418c32f2@suse.com>
 <97e63191-e2ba-34f6-ca6c-99b9e9841587@epam.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <97e63191-e2ba-34f6-ca6c-99b9e9841587@epam.com>

On 13-07-23, 14:40, Oleksandr Tyshchenko wrote:
> Viresh, great work!

Thanks Oleksandr.

> Do you perhaps have corresponding users-space (virtio backend) example 
> adopted for that feature (I would like to take a look at it if possible)?

This is taken care by the xen-vhost-frontend Rust crate in our case
(which was initially designed based on virtio-disk but has deviated a
lot from it now). Here is the commit of interest. The backends remain
unmodified though.

https://github.com/vireshk/xen-vhost-frontend/commit/d79c419f14c1f54240b3147c342894998c274364

And I have updated the commit with CONFIG_ARM64 thingy..

-- 
viresh


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 09:45:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 09:45:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566505.885400 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMQE5-0001nK-O5; Thu, 20 Jul 2023 09:45:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566505.885400; Thu, 20 Jul 2023 09:45:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMQE5-0001nD-LH; Thu, 20 Jul 2023 09:45:37 +0000
Received: by outflank-mailman (input) for mailman id 566505;
 Thu, 20 Jul 2023 09:45:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/JYs=DG=citrix.com=prvs=558be806a=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMQE4-0001n7-6E
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 09:45:36 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2b14a236-26e2-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 11:45:34 +0200 (CEST)
Received: from mail-bn8nam11lp2169.outbound.protection.outlook.com (HELO
 NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.169])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 20 Jul 2023 05:45:28 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by MW4PR03MB6569.namprd03.prod.outlook.com (2603:10b6:303:128::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul
 2023 09:45:26 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 09:45:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2b14a236-26e2-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689846333;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=WDw17wo2WaEO3ZHwr3foXg5KyzyWBpz8gEFMf7FMqGA=;
  b=GSCaHH2iV3tep1EWyEmk+Cd4vC8v0mc6CJ23FFSrYA7oX/2/MrUzPlpn
   Jyg0GIohsnJADMXBS4MdHZGeXRUcR4R/rrrXRSMuIrIxgBFxk8d7Ox+Mm
   fi75ljbr0Kl4WCavX2QsdI+cZ4Sp9R0CJU0qXhvPJ+LB5EPO1/B9iYmHP
   E=;
X-IronPort-RemoteIP: 104.47.58.169
X-IronPort-MID: 115547412
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:5POsmagvQdDnH/MBqkFy7pb7X161VhEKZh0ujC45NGQN5FlHY01je
 htvWGyHbq6PMGKje9t+O4q2phsC68KGnYRrHgRuqSA0Hikb9cadCdqndUqhZCn6wu8v7q5Ex
 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv
 cKai8DEMRqu1iUc3lg8sspvkzsx+qyr0N8klgZmP6sT4wWGzyB94K83fsldEVOpGuG4IcbiL
 wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ
 OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+
 tREC2xSaRejudic2YnmZtgvvOkhMsD0adZ3VnFIlVk1DN4AaLWaGuDgw48d2z09wMdTAfzZe
 swVLyJ1awjNaAFOPVFRD48imOCvhT/0dDgwRFC9/PJrpTSMilEhluGzYbI5efTTLSlRtlyfq
 W/cuXzwHzkRNcCFyCrD+XWp7gPKtXqiBd9OS+HhrJaGhnWq52kQWEw3DGG54tOe0GCMVesEc
 Ustr39GQa8asRbDosPGdyO/pHmIrxsNQe16Gucx6ByO4qfM6gPfDW8BJhZRZdpjuMIoSDgC0
 l6Sg8ivFTFpqKeSS3+W6vGTtzzaESofIHIGZCQEZRAY+NSlq4Y25i8jVf5mGa+xy9fzSTf5x
 mnTqDBk3utCy8kWy6+84FbLxSq2oYTERRI04QORWX+56gR+Z8iuYInABUXn0Mus5b2xFjGp1
 EXoUeDEhAzSJflhTBCwfdg=
IronPort-HdrOrdr: A9a23:ynv2KqHxiO7KlW1upLqEcceALOsnbusQ8zAXPidKJiC9E/b1qy
 nKpp8mPHDP5gr5J0tQ/OxoVJPhfZq+z/NICOsqTMuftWDd0QPDEGgF1/qA/9SKIVydygcy78
 ZdmnlFebvN5RYTt7eC3OH1e+xQp+Vuv8iT9IPj5n1pUQpdbq1v5w1oPAKWFkZ7XxNGBYMOE4
 aZj/A33QaIc3EKZfK+Cn0PU/PYpt3TopX7ZRULHHccmXSzpCqv8qPzFi6T2BoTOgk/uosK6m
 jEnmXCl92ej80=
X-Talos-CUID: 9a23:sUyZDmyUyARYMyBvI7lgBgVIOZx6dXr98k36OnTlJVcqcpCXV1aPrfY=
X-Talos-MUID: 9a23:yZVPvAaoD1JwxuBTjh7ph2EzFZ5S4eeELxojo5s/4JODDHkl
X-IronPort-AV: E=Sophos;i="6.01,218,1684814400"; 
   d="scan'208";a="115547412"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=DZLld+6ePOxYBEiEOfiutWXS4ttAOaT9X+bG5KNjPs+pXNqwXkhM8zDOC8ZA2Tcl62h4OCd1MDyyeV1cZPlq26dRsRtE87+Jks+mAeTAfgV4VH2043GTOORrUE455H0TopXDyeYi2IIGgsmGXblqgH3xk9t4gti9mF8RLj3TzwStMfRC4QMtshumu3VoIKdC3u/obvnmVNGChHkwJh/UFuD8rNnLVce/iO2EB2YD9u1UmiDj+9BpTrckO1cSfvV1eJxBBJ5xM4M/8A8HNB6K3QPtL3kA4Jjnifx4ryjBEd+kc4Wx6azNuDThyO3YphgdJsqrQpWtECbZdB56oQ8aig==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LE0F85uEAxd62xuUVo0COuuAbEvLmENkGtPEs/UfeaE=;
 b=NBp+Kos4nuKYH7iWPyAAEIFNUaJsK9cgfj8yNftOPZk0dn7DJ/h7dGUBkuWPBUCIb32DFWBkNpyIzL9Sf73ZoRqnHKfppUlfj7Sa7esEvtfM+hHkDYxuO4Nsa3ASLZrmINE2aq7KNwQ7W7YnVlIm4LXEuIpTe4/y9SgA08Nbwq+eKFvi7lw8J5PgRtrWk6g6nAmNuWSJDPkBYfdtyvK9Jniyf9jSNV8ggK+73rTdJHX1hSeJXHmU6JnSbS4Quj7olzN5hZmrjOYVGGokVAVIJBqwMGL9u6mYEYcbS03Z2yE9OSpoX2mGAvn0q/ljXe3h9uuNFUwYrbEDXaM19yd1eA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LE0F85uEAxd62xuUVo0COuuAbEvLmENkGtPEs/UfeaE=;
 b=CmdyhEODBRtBsKQ9j3ytwCUxk3ftWfyzVtolvOQj8G3h217IfagHG3L5fkGFW4FON+zURH6O4vz1haagP9HaraCm0YRUb+K3PPXjazTBzlNEWGhlKJvyFfagHqHm857ytnPjUeertQ+FMi3G1hngjiLomvuWqnHo6oowZQg1l1g=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Thu, 20 Jul 2023 11:45:19 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v8 01/13] pci: introduce per-domain PCI rwlock
Message-ID: <ZLkCL4TbE0sWZjd3@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-2-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230720003205.1828537-2-volodymyr_babchuk@epam.com>
X-ClientProxiedBy: LO4P123CA0102.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:191::17) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|MW4PR03MB6569:EE_
X-MS-Office365-Filtering-Correlation-Id: 207a77ae-cefa-42f5-466c-08db89060b8f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	xSDcIp+W4Q3hKAILX8Z7Nmf9+SAc8Ra+nGSsF9BtL+7i5VX9jDxlxA+w2xaSh/PJPph/6l/2Y8g5BMUrYCLlYan1YR1ZGLToKzRI/6DbBM9Bh0zchNkjY8cdORzCZpOPE+77WYdoiv1qiJuNQuezU4YQonQ5Vp1rVlaUvLHX/B3Uxn37AaJPAMSITf+Z6B27X9zioxhiJzv8ODobP+bbEcfv6K2pNM5j6f9iIawm7Y115u6B0M/ro6F+sizBeKkkijBMvd6KehD/wV98hbWXVvdOUIlOd7DX6NaR1oD392rYp7RXz3juV1TOikVa1iQz85uGZwfZ1XkiZk9b/278VBHN42InL8k54JJvH6dgfC2SxqaeyD/6el0hNbjGeFaLzYY3768mTdl2JKk5sCciX1H8aX/ZtNnPFkITT3rgMybNUQveyLkGJrXsc6mSG9++RLWPKB4TCh0quu0YMpDAX1KpkQoFpJb90xLVreCLzZkKjgBqYjvxqfuD9GlM7Sr0fE2Ac9GK/D60SpK+h46YciiN2OxUMoDOJNYJ97elGWtHZn2hULD6HCaZbgszgEpj
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(136003)(39860400002)(346002)(376002)(396003)(451199021)(2906002)(54906003)(478600001)(66899021)(41300700001)(8676002)(8936002)(5660300002)(66556008)(66476007)(66946007)(4326008)(6916009)(316002)(82960400001)(85182001)(86362001)(26005)(186003)(6506007)(9686003)(6486002)(83380400001)(6512007)(38100700002)(6666004);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Ry9adjRFdTlxb2JPd0YxMjR3WWhQTVdMNzFnVUpBRFl5V09ITjRGQ1FsMStN?=
 =?utf-8?B?YkNIdGhBMWdlNjlRQkZTdjlYbGg4NUVkYXhqcllaMW0zWUFINkd2cUdKS0VE?=
 =?utf-8?B?QUZ0YVFlRGhSamE3ODFOalJnVmdEOURVZ2lOQ1BHVnFVVW5xS0NOZWU5allI?=
 =?utf-8?B?TVVLNUN2L3BRTXFvTDExL0JqZGtBa1QvT0xLbDdVeGhHWjhQaEZzOG9HTUdK?=
 =?utf-8?B?dzY2K1ZycURGRG9rc05EQWQzekFyTytVMXdmTEdZK0h6c0kxY1k5RDg4NUJC?=
 =?utf-8?B?Mk5YdlNFL3o5Mll6bnJvZzY1bjFQeGhVbUhIUUpEQ3FqMXBtbDYwMGJQQ3Zi?=
 =?utf-8?B?bC9nb05MR0Y4TXB5WGJCRkpSK0M1RTNNK0NmbDkvNDZaNXltSkMwT2VaZTdt?=
 =?utf-8?B?ZTdvWjZxODVuT1ltdjQ5b29BUFducm5Bck1lK2Z1WXdsUGpQMXAwV1owK29p?=
 =?utf-8?B?K3Z3MXRoWjhqRGFydExqK2VKUkVUSW9HanRqVFgrNnRuNTZ0amhSRDFTdDdF?=
 =?utf-8?B?L21FR0M0YkVKSHp0bGxZWS9QaUNIa0c3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r668OpI+UYcj2Xq3nAiF/Kz2mIdC1cFksXr5scdwKLvVV6N7uFKdsvZlN3Rzn5mZ7T+LZuXTW23J3YInfg9Gi61/duGZqtiZrXUQ/SLE5uinh0V8kn7X3EQa0KLIkpiAJqVoYTVuTfETrK1yuZpKgF7KH0f58L5x5V2jDPYgc7e/hXXfx18H4aLUI9pmV9R3X4LPl6Cqfd/E4JUieJBro86nStqJ/Ftn0Iq69xA7TZJzzhYPlEeKRieu7yN1EKdlTKjlPbev0rEHYTAPNSIS0py6/YCfG2J60nlLGtMLZXcwiwMLjT9vBMfM70LV1fAmpWelclgjarFufEj8USgCD45aampp3zCLORU0ek3gFM+C/TPQXKm535WGecAUuyPtPVFQY+266E/5dF6DQNB0lPjeBGItppvWrLoOK1pzeEbV/87gXwsgBBP/ZX8b2YpIPhMe9IHm7pEeCvz0n34riyV5CxdRRI4R/dFIiJg9gGqUQtgX7K6ytrmy4Wxq6Unzs2O/7dpoLOJvMDd/YWYdjL0oV0sCMnCUVhU/PZiwBCwR3WI6Iq7ZMdCOiO7+ljSmWwUMkiggiIjQ5oIPj88ZGbXymT37MqrqfAJLNj9Yzh7yiBfflBZ4lwsWM+K7kFVm+pFyDJehdtTk2X+6iBKF9SMXqvtqwl2dX08kvak/EaeuA9slmfby2b202jm2gBD/40cRS17VPx2uI+9hRgLJBcbjbuFeqgnHhQM0Tk5UqFwSpKt8JBsP6ahtx58YEDgi2B90Hzwegob0cKVHQ7iQCAx0Rxj0wQ==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 207a77ae-cefa-42f5-466c-08db89060b8f
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 09:45:26.2596
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: wvU1RTBg87QJN3RNJHcZsZE16OAGwQRdWOYzDClpGW3xOsDoo62rIcqKDxI/hzWK0ttLnwytgzo2Umy5NydZ3g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR03MB6569

On Thu, Jul 20, 2023 at 12:32:31AM +0000, Volodymyr Babchuk wrote:
> Add per-domain d->pci_lock that protects access to
> d->pdev_list. Purpose of this lock is to give guarantees to VPCI code
> that underlying pdev will not disappear under feet. This is a rw-lock,
> but this patch adds only write_lock()s. There will be read_lock()
> users in the next patches.
> 
> This lock should be taken in write mode every time d->pdev_list is
> altered. This covers both accesses to d->pdev_list and accesses to
> pdev->domain_list fields. All write accesses also should be protected
> by pcidevs_lock() as well. Idea is that any user that wants read
> access to the list or to the devices stored in the list should use
> either this new d->pci_lock or old pcidevs_lock(). Usage of any of
> this two locks will ensure only that pdev of interest will not
> disappear from under feet and that the pdev still will be assigned to
> the same domain. Of course, any new users should use pcidevs_lock()
> when it is appropriate (e.g. when accessing any other state that is
> protected by the said lock).

I think this needs a note about the ordering:

"In case both the newly introduced per-domain rwlock and the pcidevs
lock is taken, the later must be acquired first."

> 
> Any write access to pdev->domain_list should be protected by both
> pcidevs_lock() and d->pci_lock in the write mode.

You also protect calls to vpci_remove_device() with the per-domain
pci_lock it seems, and that will need some explanation as it's not
obvious.

> 
> Suggested-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> Suggested-by: Jan Beulich <jbeulich@suse.com>
> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> 
> ---
> 
> Changes in v8:
>  - New patch
> 
> Changes in v8 vs RFC:
>  - Removed all read_locks after discussion with Roger in #xendevel
>  - pci_release_devices() now returns the first error code
>  - extended commit message
>  - added missing lock in pci_remove_device()
>  - extended locked region in pci_add_device() to protect list_del() calls
> ---
>  xen/common/domain.c                         |  1 +
>  xen/drivers/passthrough/amd/pci_amd_iommu.c |  9 ++-
>  xen/drivers/passthrough/pci.c               | 68 +++++++++++++++++----
>  xen/drivers/passthrough/vtd/iommu.c         |  9 ++-
>  xen/include/xen/sched.h                     |  1 +
>  5 files changed, 74 insertions(+), 14 deletions(-)
> 
> diff --git a/xen/common/domain.c b/xen/common/domain.c
> index caaa402637..5d8a8836da 100644
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -645,6 +645,7 @@ struct domain *domain_create(domid_t domid,
>  
>  #ifdef CONFIG_HAS_PCI
>      INIT_LIST_HEAD(&d->pdev_list);
> +    rwlock_init(&d->pci_lock);
>  #endif
>  
>      /* All error paths can depend on the above setup. */
> diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
> index 94e3775506..e2f2e2e950 100644
> --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
> +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
> @@ -476,8 +476,13 @@ static int cf_check reassign_device(
>  
>      if ( devfn == pdev->devfn && pdev->domain != target )
>      {
> -        list_move(&pdev->domain_list, &target->pdev_list);
> -        pdev->domain = target;

You seem to have inadvertently dropped the above line? (and so devices
would keep the previous pdev->domain value)

> +        write_lock(&pdev->domain->pci_lock);
> +        list_del(&pdev->domain_list);
> +        write_unlock(&pdev->domain->pci_lock);
> +
> +        write_lock(&target->pci_lock);
> +        list_add(&pdev->domain_list, &target->pdev_list);
> +        write_unlock(&target->pci_lock);
>      }
>  
>      /*
> diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
> index 95846e84f2..5b4632ead2 100644
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -454,7 +454,9 @@ static void __init _pci_hide_device(struct pci_dev *pdev)
>      if ( pdev->domain )
>          return;
>      pdev->domain = dom_xen;
> +    write_lock(&dom_xen->pci_lock);
>      list_add(&pdev->domain_list, &dom_xen->pdev_list);
> +    write_unlock(&dom_xen->pci_lock);
>  }
>  
>  int __init pci_hide_device(unsigned int seg, unsigned int bus,
> @@ -747,6 +749,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>      ret = 0;
>      if ( !pdev->domain )
>      {
> +        write_lock(&hardware_domain->pci_lock);
>          pdev->domain = hardware_domain;
>          list_add(&pdev->domain_list, &hardware_domain->pdev_list);
>  
> @@ -760,6 +763,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>              printk(XENLOG_ERR "Setup of vPCI failed: %d\n", ret);
>              list_del(&pdev->domain_list);
>              pdev->domain = NULL;
> +            write_unlock(&hardware_domain->pci_lock);

Strictly speaking, this could move one line earlier, as accesses to
pdev->domain are not protected by the d->pci_lock?  Same in other
instances (above and below), as you seem to introduce a pattern to
perform accesses to pdev->domain with the rwlock taken.

>              goto out;
>          }
>          ret = iommu_add_device(pdev);
> @@ -768,8 +772,10 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>              vpci_remove_device(pdev);
>              list_del(&pdev->domain_list);
>              pdev->domain = NULL;
> +            write_unlock(&hardware_domain->pci_lock);
>              goto out;
>          }
> +        write_unlock(&hardware_domain->pci_lock);
>      }
>      else
>          iommu_enable_device(pdev);
> @@ -812,11 +818,13 @@ int pci_remove_device(u16 seg, u8 bus, u8 devfn)
>      list_for_each_entry ( pdev, &pseg->alldevs_list, alldevs_list )
>          if ( pdev->bus == bus && pdev->devfn == devfn )
>          {
> +            write_lock(&pdev->domain->pci_lock);
>              vpci_remove_device(pdev);
>              pci_cleanup_msi(pdev);
>              ret = iommu_remove_device(pdev);
>              if ( pdev->domain )
>                  list_del(&pdev->domain_list);
> +            write_unlock(&pdev->domain->pci_lock);

Here you seem to protect more than strictly required, I would think
only the list_del() would need to be done holding the rwlock?

>              printk(XENLOG_DEBUG "PCI remove device %pp\n", &pdev->sbdf);
>              free_pdev(pseg, pdev);
>              break;
> @@ -887,26 +895,62 @@ static int deassign_device(struct domain *d, uint16_t seg, uint8_t bus,
>  
>  int pci_release_devices(struct domain *d)
>  {
> -    struct pci_dev *pdev, *tmp;
> -    u8 bus, devfn;
> -    int ret;
> +    int combined_ret;
> +    LIST_HEAD(failed_pdevs);
>  
>      pcidevs_lock();
> -    ret = arch_pci_clean_pirqs(d);
> -    if ( ret )
> +    write_lock(&d->pci_lock);
> +    combined_ret = arch_pci_clean_pirqs(d);

Why do you need the per-domain rwlock for arch_pci_clean_pirqs()?
That function doesn't modify the per-domain pdev list.

> +    if ( combined_ret )
>      {
>          pcidevs_unlock();
> -        return ret;
> +        write_unlock(&d->pci_lock);
> +        return combined_ret;

Ideally we would like to keep the same order on unlock, so the rwlock
should be released before the pcidevs lock (unless there's a reason
not to).

>      }
> -    list_for_each_entry_safe ( pdev, tmp, &d->pdev_list, domain_list )
> +
> +    while ( !list_empty(&d->pdev_list) )
>      {
> -        bus = pdev->bus;
> -        devfn = pdev->devfn;
> -        ret = deassign_device(d, pdev->seg, bus, devfn) ?: ret;
> +        struct pci_dev *pdev = list_first_entry(&d->pdev_list,
> +                                                struct pci_dev,
> +                                                domain_list);
> +        uint16_t seg = pdev->seg;
> +        uint8_t bus = pdev->bus;
> +        uint8_t devfn = pdev->devfn;
> +        int ret;
> +
> +        write_unlock(&d->pci_lock);
> +        ret = deassign_device(d, seg, bus, devfn);
> +        write_lock(&d->pci_lock);
> +        if ( ret )
> +        {
> +            bool still_present = false;
> +            const struct pci_dev *tmp;
> +
> +            /*
> +             * We need to check if deassign_device() left our pdev in
> +             * domain's list. As we dropped the lock, we can't be sure
> +             * that list wasn't permutated in some random way, so we
> +             * need to traverse the whole list.
> +             */
> +            for_each_pdev ( d, tmp )
> +            {
> +                if ( tmp == pdev )
> +                {
> +                    still_present = true;
> +                    break;
> +                }
> +            }
> +            if ( still_present )
> +                list_move(&pdev->domain_list, &failed_pdevs);

You can get rid of the still_present variable, and just do:

for_each_pdev ( d, tmp )
    if ( tmp == pdev )
    {
        list_move(&pdev->domain_list, &failed_pdevs);
	break;
    }


> +            combined_ret = combined_ret?:ret;

Nit: missing spaces around the ternary operator.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 10:15:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 10:15:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566509.885410 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMQgY-0006au-5l; Thu, 20 Jul 2023 10:15:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566509.885410; Thu, 20 Jul 2023 10:15:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMQgY-0006an-3A; Thu, 20 Jul 2023 10:15:02 +0000
Received: by outflank-mailman (input) for mailman id 566509;
 Thu, 20 Jul 2023 10:15:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BeWc=DG=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qMQgW-0006ah-OT
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 10:15:00 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 47632a87-26e6-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 12:14:58 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.162.143.190])
 by support.bugseng.com (Postfix) with ESMTPSA id D28534EE0C89;
 Thu, 20 Jul 2023 12:14:55 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 47632a87-26e6-11ee-b23a-6b7b168915f2
Message-ID: <26008624-b00c-ecd2-77e0-3f1cad63db66@bugseng.com>
Date: Thu, 20 Jul 2023 12:14:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
Subject: Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally
 uninitialized variables
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <1ad20473a031eca75db4007bdc169616b512ef44.1689329728.git.nicola.vetrini@bugseng.com>
 <97d8a796-f790-8efc-1d89-def1f1193e61@xen.org>
 <5da7ae40-35c7-7f93-824f-42a0712cdcf1@bugseng.com>
 <9cac9bc5-ad55-3bcd-b645-a30a5b863b3f@xen.org>
Content-Language: en-US
In-Reply-To: <9cac9bc5-ad55-3bcd-b645-a30a5b863b3f@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 17/07/23 15:40, Julien Grall wrote:
> Hi Nicola,
> 
> On 17/07/2023 13:08, Nicola Vetrini wrote:
>> On 14/07/23 15:00, Julien Grall wrote:
>>> Hi Nicola,
>>>
>>> On 14/07/2023 12:49, Nicola Vetrini wrote:
>>>> This patch aims to fix some occurrences of possibly uninitialized
>>>> variables, that may be read before being written. This behaviour would
>>>> violate MISRA C:2012 Rule 9.1, besides being generally undesirable.
>>>>
>>>> In all the analyzed cases, such accesses were actually safe, but it's
>>>> quite difficult to prove so by automatic checking, therefore a safer
>>>> route is to change the code so as to avoid the behaviour from 
>>>> occurring,
>>>> while preserving the semantics.
>>>>
>>>> To achieve this goal, I adopted the following strategies:
>>>
>>> Please let's at least one patch per strategy. I would also consider 
>>> some of the rework separate so they can go in regardless the decision 
>>> for the SAF-*.
>>>
>>>>
>>>> - Add a suitably formatted local deviation comment
>>>> Â Â  (as indicated in 'docs/misra/documenting-violations.rst')
>>>> Â Â  to exempt the following line from checking.
>>>>
>>>> - Provide an initialization for the variable at the declaration.
>>>>
>>>> - Substitute a goto breaking out of control flow logic with a 
>>>> semantically
>>>> Â Â  equivalent do { .. } while(0).
>>>
>>> As I already mentioned in private, it is unclear to me how you 
>>> decided which strategy to use. I still think we need to define our 
>>> policy before changing the code. Otherwise, it is going to be 
>>> difficult to decide for new code.
>>>
>>
>> The main point of this RFC is doing so. From what I gathered, it's not 
>> an easy task: sometimes there are no 'safe' values to initialize 
>> variables to and sometimes there is no easy way to prove that indeed 
>> something is always initialized or not accessed at all.
> 
> But you wrote the code. So you should be able to explain how you took 
> the decision between one and the others.
> 
> Also, even if this is an RFC, it would have been good to summarize any 
> discussion that happened in private and if there were concern try to 
> come up with ideas or at least listing the concerns after '---.
> 

I'll keep this if the need arises in the future.

>>
>>>>
>>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>>> ---
>>>> Â  docs/misra/safe.jsonÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  8 +++++++
>>>> Â  xen/arch/arm/arm64/lib/find_next_bit.c |Â  1 +
>>>> Â  xen/arch/arm/bootfdt.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  6 +++++
>>>> Â  xen/arch/arm/decode.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  2 ++
>>>> Â  xen/arch/arm/domain_build.cÂ Â Â Â Â Â Â Â Â Â Â  | 29 ++++++++++++++++++----
>>>> Â  xen/arch/arm/efi/efi-boot.hÂ Â Â Â Â Â Â Â Â Â Â  |Â  6 +++--
>>>> Â  xen/arch/arm/gic-v3-its.cÂ Â Â Â Â Â Â Â Â Â Â Â Â  |Â  9 ++++---
>>>> Â  xen/arch/arm/mm.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  1 +
>>>> Â  xen/arch/arm/p2m.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  | 33 
>>>> +++++++++++++++-----------
>>>> Â  9 files changed, 69 insertions(+), 26 deletions(-)
>>>>
>>>> diff --git a/docs/misra/safe.json b/docs/misra/safe.json
>>>> index e3c8a1d8eb..244001f5be 100644
>>>> --- a/docs/misra/safe.json
>>>> +++ b/docs/misra/safe.json
>>>> @@ -12,6 +12,14 @@
>>>> Â Â Â Â Â Â Â Â Â  },
>>>> Â Â Â Â Â Â Â Â Â  {
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  "id": "SAF-1-safe",
>>>> +Â Â Â Â Â Â Â Â Â Â Â  "analyser": {
>>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  "eclair": "MC3R1.R9.1"
>>>> +Â Â Â Â Â Â Â Â Â Â Â  },
>>>> +Â Â Â Â Â Â Â Â Â Â Â  "name": "Rule 9.1: initializer not needed",
>>>> +Â Â Â Â Â Â Â Â Â Â Â  "text": "The following local variables are possibly 
>>>> subject to being read before being written, but code inspection 
>>>> ensured that the control flow in the construct where they appear 
>>>> ensures that no such event may happen."
>>> I am bit concerned which such statement because the code instance was 
>>> today with the current code. This could change in the future and 
>>> invalide the reasoning.
>>>
>>> It is not clear to me if we have any mechanism to prevent that. If we 
>>> don't, then I think we need to drastically reduce the number of time 
>>> this is used (there are a bit too much for my taste).
>>>
>>
>> Indeed, the purpose of such a deviation is that the sound 
>> overapproximation computed by the tool requires a human to look at the 
>> code and think twice before modifying it (i.e., if ever that code is 
>> touched, the reviewer ought to assess whether that justification still 
>> holds or some other thing should be done about it.
> 
> Your assumption is the reviewer will notice there is an existing 
> devitation and be able to assess it has changed. I view this assumption 
> as risky in the long term.
> 
> Have you investigate to improve the automatic tooling?
> 

Well, as discussed elsewhere in the thread, a slightly modified version 
of this deviation comment can list the specific reason why such a thing 
was deviated directly at the declaration or where the caution is, if you 
think this is better.

Example:

// <- SAF-x here
int var;

[...]

// <- or HERE
f(&var);

An alternative approach to justification, partly discussed with Stefano 
in private is a macro that looks like an attribute to signal that the 
variable is intentionally uninitialized. This does not have the benefit 
of a written justification with a proper comment or an entry in the json 
file, but is less intrusive and the justification for all occurrences of 
__uninit w.r.t R9.1 would be included in the static analysis tool 
configuration, which would be part of the MISRA compliance 
documentation. This does imply a coarse justification like the one 
above, but if further clarification is needed it can be provided locally 
in the code, as guidance for contributors.

Example:
#define __uninit

__uninit int x;

>>
>>>> +Â Â Â Â Â Â Â  },
>>>> +Â Â Â Â Â Â Â  {
>>>> +Â Â Â Â Â Â Â Â Â Â Â  "id": "SAF-2-safe",
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  "analyser": {},
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  "name": "Sentinel",
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  "text": "Next ID to be used"
>>>> diff --git a/xen/arch/arm/arm64/lib/find_next_bit.c 
>>>> b/xen/arch/arm/arm64/lib/find_next_bit.c
>>>> index ca6f82277e..51b852c595 100644
>>>> --- a/xen/arch/arm/arm64/lib/find_next_bit.c
>>>> +++ b/xen/arch/arm/arm64/lib/find_next_bit.c
>>>> @@ -67,6 +67,7 @@ unsigned long find_next_zero_bit(const unsigned 
>>>> long *addr, unsigned long size,
>>>> Â  {
>>>> Â Â Â Â Â  const unsigned long *p = addr + BIT_WORD(offset);
>>>> Â Â Â Â Â  unsigned long result = offset & ~(BITS_PER_LONG-1);
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  unsigned long tmp;
>>>
>>> This is a file that was copied as-is from Linux. I thought we exclude 
>>> them.
>>
>> There was an expansion location in the report that caused that file to 
>> appear in the output. Thanks for reporting it.
>>
>>>
>>> Anyway, can you provide some details why Eclair thinks this is may be 
>>> used unitialized?
>>
>> The problem lies in the goto skipping out of control flow structures. 
>> It can't be refactored with a "do { tmp=...; break; } while(0)", as 
>> done elsewhere, because there are two distinct labels in there, so the 
>> semantics would be altered. The same comment applies in other 
>> instances as well.
>>
>>>
>>>> Â Â Â Â Â  if (offset >= size)
>>>> diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
>>>> index 2673ad17a1..1292a64e8d 100644
>>>> --- a/xen/arch/arm/bootfdt.c
>>>> +++ b/xen/arch/arm/bootfdt.c
>>>> @@ -34,6 +34,7 @@ static bool __init device_tree_node_matches(const 
>>>> void *fdt, int node,
>>>> Â  static bool __init device_tree_node_compatible(const void *fdt, 
>>>> int node,
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const char *match)
>>>> Â  {
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  int len, l;
>>>
>>> It is unclear to me whether the SAF-* applies to 'len' or 'l'.
>>
>> Just len, they need to be two separate declarations if it is agreed 
>> not to initialize it. Good catch.
>>
>>>
>>>> Â Â Â Â Â  const void *prop;
>>>> @@ -169,7 +170,9 @@ int __init device_tree_for_each_node(const void 
>>>> *fdt, int node,
>>>> Â Â Â Â Â Â  */
>>>> Â Â Â Â Â  int depth = 0;
>>>> Â Â Â Â Â  const int first_node = node;
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  u32 address_cells[DEVICE_TREE_MAX_DEPTH];
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  u32 size_cells[DEVICE_TREE_MAX_DEPTH];
>>>
>>> I have never sent formally, but in the past I proposed to rework the 
>>> code so {address, size}_cells[0] would be initialized before the 
>>> loop. See 
>>> https://lore.kernel.org/all/ea06f2ac-4ac1-4a6f-bda6-e775a7e68699@xen.org/.
>>>
>>> Do you think this would help?
>>
>> If that initialization is applied to all the array elements yes, 
>> because the Amplification of R9.1 says:
>> "For the purposes of this rule, an array element or structure member 
>> shall be considered as a discrete
>> object".
>> Otherwise, initializing just the first element does not improve the 
>> situation in any way, and this is currently not within of the analysis 
>> capabilities of ECLAIR.
> 
> Any plan to improve ECLAIR?
> 

Not in the short term on this. See further below.

>>
>>>
>>>> Â Â Â Â Â  int ret;
>>>> @@ -249,8 +252,10 @@ static void __init process_multiboot_node(const 
>>>> void *fdt, int node,
>>>> Â Â Â Â Â  const __be32 *cell;
>>>> Â Â Â Â Â  bootmodule_kind kind;
>>>> Â Â Â Â Â  paddr_t start, size;
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  int len;
>>>> Â Â Â Â Â  /* sizeof("/chosen/") + DT_MAX_NAME + '/' + DT_MAX_NAME + '/0' 
>>>> => 92 */
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1*/
>>>> Â Â Â Â Â  char path[92];
>>>
>>> So the two above, is one category of issue. The variables are passed 
>>> as argument of function which will fill them.
>>>
>>> Can Eclair look at the callers, if so, can we consider to always 
>>> initialize the values in the callee?
>>>
>>> This would reduce the number of SAF-*. There are a few other examples 
>>> like that below. So I will skip them for now.
>>>
>>> [...]
>>>
>>
>> If the value is always initialized in the callee, then there's no 
>> problem configuring ECLAIR so that it knows that this parameter is 
>> always written, and therefore any subsequent use in the caller is ok.
>>
>> Another possibility is stating that a function never reads the pointee 
>> before writing to it (it may or may not write it, but if it doesn't, 
>> then the pointee is not read either). The 'strncmp' after 
>> 'fdt_get_path' does get in the way, though, because this property is 
>> not strong enough to ensure that we can use 'path' after returning 
>> from the function.
> 
> I am not sure I fully understand what you wrote. Can you provide a C 
> example?
>

void f(int *x) {
   if(x) {
     *x = 10;
     int y =*x; // read the pointee after it's initialized
   } else {
     int z; // in this branch the pointee is not read nor written
   }
   // we can say that f never reads *x before (possibly) writing to it.
}

>>
>>>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>>>> index d0d6be922d..d43f86c2f0 100644
>>>> --- a/xen/arch/arm/domain_build.c
>>>> +++ b/xen/arch/arm/domain_build.c
>>>> @@ -62,7 +62,7 @@ custom_param("dom0_mem", parse_dom0_mem);
>>>> Â  int __init parse_arch_dom0_param(const char *s, const char *e)
>>>> Â  {
>>>> -Â Â Â  long long val;
>>>> +Â Â Â  long long val = LLONG_MAX;
>>>
>>> Can you explain why you decided to initialize rather than SAF-? For 
>>> clarity, I am not asking to switch to SAF-, I am mainly interested 
>>> what were your though process.
>>>
>>
>> I saw that putting a large enough value here would be out of range and 
>> trigger the printk even if the conditional leads to somehow enter the 
>> if branch with an invalid value.
> 
> Ok. This wants to be documented on top of the assignment.
> 

Ok. While testing this I also switched to LONG_MAX, whose definition is 
already available in that file, and does not alter the semantics anyway.

>>
>>>> Â Â Â Â Â  if ( !parse_signed_integer("sve", s, e, &val) )
>>>> Â Â Â Â Â  {
>>>> @@ -1077,6 +1077,7 @@ static void __init 
>>>> assign_static_memory_11(struct domain *d,
>>>> Â  static int __init handle_linux_pci_domain(struct kernel_info *kinfo,
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const struct 
>>>> dt_device_node *node)
>>>> Â  {
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  uint16_t segment;
>>>> Â Â Â Â Â  int res;
>>>> @@ -1351,6 +1352,7 @@ static int __init make_memory_node(const 
>>>> struct domain *d,
>>>> Â Â Â Â Â  unsigned int i;
>>>> Â Â Â Â Â  int res, reg_size = addrcells + sizecells;
>>>> Â Â Â Â Â  int nr_cells = 0;
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1*/
>>>> Â Â Â Â Â  __be32 reg[NR_MEM_BANKS * 4 /* Worst case addrcells + 
>>>> sizecells */];
>>>> Â Â Â Â Â  __be32 *cells;
>>>> @@ -1578,6 +1580,7 @@ static int __init 
>>>> find_unallocated_memory(const struct kernel_info *kinfo,
>>>> Â Â Â Â Â  struct rangeset *unalloc_mem;
>>>> Â Â Â Â Â  paddr_t start, end;
>>>> Â Â Â Â Â  unsigned int i;
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  int res;
>>>> Â Â Â Â Â  dt_dprintk("Find unallocated memory for extended regions\n");
>>>> @@ -1727,6 +1730,7 @@ static int __init find_memory_holes(const 
>>>> struct kernel_info *kinfo,
>>>> Â Â Â Â Â  dt_for_each_device_node( dt_host, np )
>>>> Â Â Â Â Â  {
>>>> Â Â Â Â Â Â Â Â Â  unsigned int naddr;
>>>> +Â Â Â Â Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â Â Â Â Â  paddr_t addr, size;
>>>> Â Â Â Â Â Â Â Â Â  naddr = dt_number_of_address(np);
>>>> @@ -1976,9 +1980,11 @@ static int __init make_cpus_node(const struct 
>>>> domain *d, void *fdt)
>>>> Â Â Â Â Â  const struct dt_device_node *npcpu;
>>>> Â Â Â Â Â  unsigned int cpu;
>>>> Â Â Â Â Â  const void *compatible = NULL;
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  u32 len;
>>>> Â Â Â Â Â  /* Placeholder for cpu@ + a 32-bit hexadecimal number + \0 */
>>>> Â Â Â Â Â  char buf[13];
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  u32 clock_frequency;
>>>> Â Â Â Â Â  /* Keep the compiler happy with -Og */
>>>> Â Â Â Â Â  bool clock_valid = false;
>>>> @@ -2104,6 +2110,7 @@ static int __init make_gic_node(const struct 
>>>> domain *d, void *fdt,
>>>> Â Â Â Â Â  const struct dt_device_node *gic = dt_interrupt_controller;
>>>> Â Â Â Â Â  int res = 0;
>>>> Â Â Â Â Â  const void *addrcells, *sizecells;
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  u32 addrcells_len, sizecells_len;
>>>> Â Â Â Â Â  /*
>>>> @@ -2179,6 +2186,7 @@ static int __init make_timer_node(const struct 
>>>> kernel_info *kinfo)
>>>> Â Â Â Â Â  int res;
>>>> Â Â Â Â Â  unsigned int irq[MAX_TIMER_PPI];
>>>> Â Â Â Â Â  gic_interrupt_t intrs[3];
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  u32 clock_frequency;
>>>> Â Â Â Â Â  bool clock_valid;
>>>> @@ -2511,6 +2519,7 @@ static int __init handle_device(struct domain 
>>>> *d, struct dt_device_node *dev,
>>>> Â Â Â Â Â  unsigned int naddr;
>>>> Â Â Â Â Â  unsigned int i;
>>>> Â Â Â Â Â  int res;
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  paddr_t addr, size;
>>>> Â Â Â Â Â  bool own_device = !dt_device_for_passthrough(dev);
>>>> Â Â Â Â Â  /*
>>>> @@ -2779,6 +2788,7 @@ static int __init make_gicv2_domU_node(struct 
>>>> kernel_info *kinfo)
>>>> Â  {
>>>> Â Â Â Â Â  void *fdt = kinfo->fdt;
>>>> Â Â Â Â Â  int res = 0;
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1*/
>>>> Â Â Â Â Â  __be32 reg[(GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS) 
>>>> * 2];
>>>> Â Â Â Â Â  __be32 *cells;
>>>> Â Â Â Â Â  const struct domain *d = kinfo->d;
>>>> @@ -2914,6 +2924,7 @@ static int __init make_vpl011_uart_node(struct 
>>>> kernel_info *kinfo)
>>>> Â Â Â Â Â  void *fdt = kinfo->fdt;
>>>> Â Â Â Â Â  int res;
>>>> Â Â Â Â Â  gic_interrupt_t intr;
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1*/
>>>> Â Â Â Â Â  __be32 reg[GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS];
>>>> Â Â Â Â Â  __be32 *cells;
>>>> Â Â Â Â Â  struct domain *d = kinfo->d;
>>>> @@ -3435,6 +3446,7 @@ static void __init initrd_load(struct 
>>>> kernel_info *kinfo)
>>>> Â Â Â Â Â  paddr_t paddr, len;
>>>> Â Â Â Â Â  int node;
>>>> Â Â Â Â Â  int res;
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  __be32 val[2];
>>>> Â Â Â Â Â  __be32 *cellp;
>>>> Â Â Â Â Â  void __iomem *initrd;
>>>> @@ -3514,6 +3526,7 @@ static int __init get_evtchn_dt_property(const 
>>>> struct dt_device_node *np,
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  uint32_t *port, uint32_t 
>>>> *phandle)
>>>> Â  {
>>>> Â Â Â Â Â  const __be32 *prop = NULL;
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  uint32_t len;
>>>> Â Â Â Â Â  prop = dt_get_property(np, "xen,evtchn", &len);
>>>> @@ -3538,10 +3551,13 @@ static int __init 
>>>> get_evtchn_dt_property(const struct dt_device_node *np,
>>>> Â  static int __init alloc_domain_evtchn(struct dt_device_node *node)
>>>> Â  {
>>>> Â Â Â Â Â  int rc;
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  uint32_t domU1_port, domU2_port, remote_phandle;
>>>> Â Â Â Â Â  struct dt_device_node *remote_node;
>>>> Â Â Â Â Â  const struct dt_device_node *p1_node, *p2_node;
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  struct evtchn_alloc_unbound alloc_unbound;
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  struct evtchn_bind_interdomain bind_interdomain;
>>>> Â Â Â Â Â  struct domain *d1 = NULL, *d2 = NULL;
>>>> @@ -3789,11 +3805,12 @@ static int __init construct_domain(struct 
>>>> domain *d, struct kernel_info *kinfo)
>>>> Â  static int __init alloc_xenstore_evtchn(struct domain *d)
>>>> Â  {
>>>> -Â Â Â  evtchn_alloc_unbound_t alloc;
>>>> +Â Â Â  evtchn_alloc_unbound_t alloc = {
>>>> +Â Â Â Â Â Â Â  .dom = d->domain_id,
>>>> +Â Â Â Â Â Â Â  .remote_dom = hardware_domain->domain_id
>>>> +Â Â Â  };
>>>> Â Â Â Â Â  int rc;
>>>> -Â Â Â  alloc.dom = d->domain_id;
>>>> -Â Â Â  alloc.remote_dom = hardware_domain->domain_id;
>>>
>>> It is not clear why this is modified. There are only two fields in 
>>> 'alloc' and they are both initialized.
>>>
>>
>> There are three fields in the struct, and the third is clearly to be 
>> set by an initalization function. If, as above with 'path', the init 
>> function ensures that the third field is always written then there's 
>> no problem, otherwise this initialization prevents any use of an 
>> uninitialized port.
>> > struct evtchn_alloc_unbound {
>> Â Â Â Â Â  /* IN parameters */
>> Â Â Â Â Â  domid_t dom, remote_dom;
>> Â Â Â Â Â  /* OUT parameters */
>> Â Â Â Â Â  evtchn_port_t port;
>> };
>> typedef struct evtchn_alloc_unbound evtchn_alloc_unbound_t;
> 
> Ah, I didn't spot the third field because it was defined on the same 
> line. I would prefer if the value is explicitely initialized to 0.
> 
> Also, I think this ought to be in a separate patch (with other similar 
> pattern).
> 

Ok.

>>>> Â Â Â Â Â  rc = evtchn_alloc_unbound(&alloc, 0);
>>>> Â Â Â Â Â  if ( rc )
>>>> Â Â Â Â Â  {
>>>> @@ -3810,8 +3827,9 @@ static int __init construct_domU(struct domain 
>>>> *d,
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const struct dt_device_node *node)
>>>> Â  {
>>>> Â Â Â Â Â  struct kernel_info kinfo = {};
>>>> -Â Â Â  const char *dom0less_enhanced;
>>>> +Â Â Â  const char *dom0less_enhanced = NULL;
>>>
>>> If you look at the user below, all the callers assume 
>>> dom0less_enhanced will be non-NULL. So it is unclear to me how this 
>>> value is safer.
>>> Â > Looking at the code, I wonder whether we should convert
>>> dt_property_read_string() to use ERR_PTR(). So we could remove the 
>>> last argument and return it instead.
>>
>> Is relying on that assumption somehow safer? 
> 
> I am assuming you are referring to "If you look at the user below, all 
> the callers assume dom0less_enhanced will be non-NULL". Note that I 
> didn't suggest it is safer. I am only pointed out that you didn't 
> specify how this was better in the context of the code.
>

This should be probably discussed after deciding on the refactoring 
'dt_property_read_string'

>> The suggestion to remove the last parameter seems better.
>>
>>>
>>>> Â Â Â Â Â  int rc;
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  u64 mem;
>>>> Â Â Â Â Â  u32 p2m_mem_mb;
>>>> Â Â Â Â Â  unsigned long p2m_pages;
>>>> @@ -3939,6 +3957,7 @@ void __init create_domUs(void)
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  .grant_opts = 
>>>> XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
>>>> Â Â Â Â Â Â Â Â Â  };
>>>> Â Â Â Â Â Â Â Â Â  unsigned int flags = 0U;
>>>> +Â Â Â Â Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â Â Â Â Â  uint32_t val;
>>>> Â Â Â Â Â Â Â Â Â  int rc;
>>>> diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
>>>> index bb64925d70..25f39364d1 100644
>>>> --- a/xen/arch/arm/efi/efi-boot.h
>>>> +++ b/xen/arch/arm/efi/efi-boot.h
>>>> @@ -117,6 +117,7 @@ static int __init setup_chosen_node(void *fdt, 
>>>> int *addr_cells, int *size_cells)
>>>> Â  static int __init fdt_set_reg(void *fdt, int node, int addr_cells,
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  int size_cells, uint64_t addr, 
>>>> uint64_t len)
>>>> Â  {
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  __be32 val[4]; /* At most 2 64 bit values to be stored */
>>>> Â Â Â Â Â  __be32 *cellp;
>>>> @@ -308,7 +309,7 @@ fdt_set_fail:
>>>> Â  static void __init *fdt_increase_size(struct file *fdtfile, int 
>>>> add_size)
>>>> Â  {
>>>> Â Â Â Â Â  EFI_STATUS status;
>>>> -Â Â Â  EFI_PHYSICAL_ADDRESS fdt_addr;
>>>> +Â Â Â  EFI_PHYSICAL_ADDRESS fdt_addr = 0;
>>>> Â Â Â Â Â  int fdt_size;
>>>> Â Â Â Â Â  int pages;
>>>> Â Â Â Â Â  void *new_fdt;
>>>> @@ -433,7 +434,7 @@ static void __init efi_arch_cfg_file_late(const 
>>>> EFI_LOADED_IMAGE *image,
>>>> Â  static void *__init efi_arch_allocate_mmap_buffer(UINTN map_size)
>>>> Â  {
>>>> -Â Â Â  void *ptr;
>>>> +Â Â Â  void *ptr = NULL;
>>>> Â Â Â Â Â  EFI_STATUS status;
>>>> Â Â Â Â Â  status = efi_bs->AllocatePool(EfiLoaderData, map_size, &ptr);
>>>> @@ -538,6 +539,7 @@ static void __init efi_arch_handle_module(const 
>>>> struct file *file,
>>>> Â  {
>>>> Â Â Â Â Â  int node;
>>>> Â Â Â Â Â  int chosen;
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  int addr_len, size_len;
>>>> Â Â Â Â Â  if ( file == &dtbfile )
>>>> diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
>>>> index 3aa4edda10..aa0180ab5b 100644
>>>> --- a/xen/arch/arm/gic-v3-its.c
>>>> +++ b/xen/arch/arm/gic-v3-its.c
>>>> @@ -192,8 +192,7 @@ static int its_send_cmd_mapc(struct host_its 
>>>> *its, uint32_t collection_id,
>>>> Â Â Â Â Â  cmd[0] = GITS_CMD_MAPC;
>>>> Â Â Â Â Â  cmd[1] = 0x00;
>>>> -Â Â Â  cmd[2] = encode_rdbase(its, cpu, collection_id);
>>>> -Â Â Â  cmd[2] |= GITS_VALID_BIT;
>>>> +Â Â Â  cmd[2] = encode_rdbase(its, cpu, collection_id) | GITS_VALID_BIT;
>>>
>>> Hmmm... How is this even considered as unitialized variable?
>>>
>>
>> The analysis here could use some more precision, but the modified 
>> construct is entirely equivalent.
> 
> I agree that they are equivalent. But in general, we don't change the 
> style of the construct without explaining why.
> 
> In this case, the first step would be to improve Eclair.
> 

The changes needed for this kind of analysis are not trivial: we've 
looked into this, but there's no easy way to support this in a timely 
manner. I understand that this is an estabilished pattern, but what 
would you think of an initializer using designators?

uint64_t cmd[4] = {
         .[0] = GITS_CMD_MAPC;
         .[1] = 0x00;
         .[2] = encode_rdbase(its, cpu, collection_id) | GITS_VALID_BIT;
         .[3] = 0x00;
}

>>
>>>> Â Â Â Â Â  cmd[3] = 0x00;
>>>> Â Â Â Â Â  return its_send_command(its, cmd);
>>>> @@ -215,9 +214,7 @@ static int its_send_cmd_mapd(struct host_its 
>>>> *its, uint32_t deviceid,
>>>> Â Â Â Â Â  }
>>>> Â Â Â Â Â  cmd[0] = GITS_CMD_MAPD | ((uint64_t)deviceid << 32);
>>>> Â Â Â Â Â  cmd[1] = size_bits;
>>>> -Â Â Â  cmd[2] = itt_addr;
>>>> -Â Â Â  if ( valid )
>>>> -Â Â Â Â Â Â Â  cmd[2] |= GITS_VALID_BIT;
>>>> +Â Â Â  cmd[2] = itt_addr | (valid ? GITS_VALID_BIT : 0x00);
>>>
>>> Same here.
>>>
>>>> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
>>>> index c688227abd..a36068b2d8 100644
>>>> --- a/xen/arch/arm/mm.c
>>>> +++ b/xen/arch/arm/mm.c
>>>> @@ -935,6 +935,7 @@ static int xen_pt_update_entry(mfn_t root, 
>>>> unsigned long virt,
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_t mfn, unsigned int target,
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned int flags)
>>>> Â  {
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  int rc;
>>>> Â Â Â Â Â  unsigned int level;
>>>> Â Â Â Â Â  lpae_t *table;
>>>> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
>>>> index de32a2d638..83c56cf1cb 100644
>>>> --- a/xen/arch/arm/p2m.c
>>>> +++ b/xen/arch/arm/p2m.c
>>>> @@ -496,16 +496,18 @@ mfn_t p2m_get_entry(struct p2m_domain *p2m, 
>>>> gfn_t gfn,
>>>> Â Â Â Â Â  lpae_t entry, *table;
>>>> Â Â Â Â Â  int rc;
>>>> Â Â Â Â Â  mfn_t mfn = INVALID_MFN;
>>>> -Â Â Â  p2m_type_t _t;
>>>> +Â Â Â  p2m_type_t _t = p2m_invalid;
>>>> Â Â Â Â Â  DECLARE_OFFSETS(offsets, addr);
>>>> Â Â Â Â Â  ASSERT(p2m_is_locked(p2m));
>>>> Â Â Â Â Â  BUILD_BUG_ON(THIRD_MASK != PAGE_MASK);
>>>> Â Â Â Â Â  /* Allow t to be NULL */
>>>> -Â Â Â  t = t ?: &_t;
>>>> -
>>>> -Â Â Â  *t = p2m_invalid;
>>>> +Â Â Â  if( t ) {
>>>> +Â Â Â Â Â Â Â  *t = _t;
>>>> +Â Â Â  } else {
>>>> +Â Â Â Â Â Â Â  t = &_t;
>>>> +Â Â Â  }
>>> What was the problem with the previous code?
>>>
>>> This is also not conformant to Xen coding style.
>>>
>>
>> The problem is that _t may be uninitialized, hence assigning its 
>> address to t could be problematic.
> 
> But the value is set right after. IOW, there is no read between. So how 
> is this prob
> 
>> Another way to address this is to initialize _t to a bad value and use 
>> this variable in the body, then assign to t based on the value just 
>> before returning.
> 
> IHMO, neither solution are ideal. I think we should investigate whether 
> Eclair can be improved.
> 
> [...]
> 

I'll see what can be done about it, I'll reply when I have an answer.

>>>> Â Â Â Â Â  if ( valid )
>>>> Â Â Â Â Â Â Â Â Â  *valid = false;
>>>> @@ -1031,6 +1033,7 @@ static int __p2m_set_entry(struct p2m_domain 
>>>> *p2m,
>>>> Â Â Â Â Â  unsigned int level = 0;
>>>> Â Â Â Â Â  unsigned int target = 3 - (page_order / XEN_PT_LPAE_SHIFT);
>>>> Â Â Â Â Â  lpae_t *entry, *table, orig_pte;
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  int rc;
>>>
>>> Can you provide some details why Eclair thinks it is unitialized?
>>
>> Same issue with gotos explained above, can't be refactored because of 
>> the for enclosing the goto.
>>
>>>
>>>> Â Â Â Â Â  /* A mapping is removed if the MFN is invalid. */
>>>> Â Â Â Â Â  bool removing_mapping = mfn_eq(smfn, INVALID_MFN);
>>>> @@ -1483,6 +1486,7 @@ static inline int p2m_remove_mapping(struct 
>>>> domain *d,
>>>> Â  {
>>>> Â Â Â Â Â  struct p2m_domain *p2m = p2m_get_hostp2m(d);
>>>> Â Â Â Â Â  unsigned long i;
>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>> Â Â Â Â Â  int rc;
>>>
>>>
>>> Can you provide some details why Eclair thinks it is unitialized?
>>>
>>
>> Same as above.
>>
>>>> Â Â Â Â Â  p2m_write_lock(p2m);
>>>> @@ -1685,20 +1689,21 @@ static int p2m_alloc_vmid(struct domain *d)
>>>> Â Â Â Â Â  ASSERT(nr != INVALID_VMID);
>>>> -Â Â Â  if ( nr == MAX_VMID )
>>>> -Â Â Â  {
>>>> -Â Â Â Â Â Â Â  rc = -EBUSY;
>>>> -Â Â Â Â Â Â Â  printk(XENLOG_ERR "p2m.c: dom%d: VMID pool exhausted\n", 
>>>> d->domain_id);
>>>> -Â Â Â Â Â Â Â  goto out;
>>>> -Â Â Â  }
>>>> +Â Â Â  do {
>>>
>>> I don't understand this change. How is this making better for Eclair?
>>>
>>
>> This is an example where the goto can be eliminated, which in turn 
>> allows to automatically check the correctness.
> If you want to eliminate the 'goto' then they are better way to do it. 
> Like:
> 
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index bc9c3ae25693..8771679dd5fc 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -186,16 +186,14 @@ int p2m_alloc_vmid(struct domain *d)
>  Â Â Â Â  {
>  Â Â Â Â Â Â Â Â  rc = -EBUSY;
>  Â Â Â Â Â Â Â Â  printk(XENLOG_ERR "p2m.c: dom%d: VMID pool exhausted\n", 
> d->domain_id);
> -Â Â Â Â Â Â Â  goto out;
> +Â Â Â  }
> +Â Â Â  else
> +Â Â Â  {
> +Â Â Â Â Â Â Â  set_bit(nr, vmid_mask);
> +Â Â Â Â Â Â Â  p2m->vmid = nr;
> +Â Â Â Â Â Â Â  rc = 0;
>  Â Â Â Â  }
> 
> -Â Â Â  set_bit(nr, vmid_mask);
> -
> -Â Â Â  p2m->vmid = nr;
> -
> -Â Â Â  rc = 0;
> -
> -out:
>  Â Â Â Â  spin_unlock(&vmid_alloc_lock);
>  Â Â Â Â  return rc;
>  Â }
> 
> I have a slight preference with the goto version, but I could accept it 
> if Eclair can't cope with the construct. In any case, this is the sort 
> of change that deserve its own patch as you want to explain why Eclair 
> can't cope with such construct (I don't view it as complex).
> 

ok

>>
>>>> +Â Â Â Â Â  if ( nr == MAX_VMID )
>>>> +Â Â Â Â Â  {
>>>> +Â Â Â Â Â Â Â Â Â  rc = -EBUSY;
>>>> +Â Â Â Â Â Â Â Â Â  printk(XENLOG_ERR "p2m.c: dom%d: VMID pool exhausted\n", 
>>>> d->domain_id);
>>>> +Â Â Â Â Â Â Â Â Â  break;
>>>> +Â Â Â Â Â  }
>>>> -Â Â Â  set_bit(nr, vmid_mask);
>>>> +Â Â Â Â Â  set_bit(nr, vmid_mask);
>>>> -Â Â Â  p2m->vmid = nr;
>>>> +Â Â Â Â Â  p2m->vmid = nr;
>>>> -Â Â Â  rc = 0;
>>>> +Â Â Â Â Â Â Â Â Â Â Â  rc = 0;
>>>> +Â Â Â Â Â Â Â  } while ( 0 );
>>>> -out:
>>>> Â Â Â Â Â  spin_unlock(&vmid_alloc_lock);
>>>> Â Â Â Â Â  return rc;
>>>> Â  }
>>>
>>
>>
>> Considering all of the replies above, a first draft of a 
>> strategy/policy I can think of is having:
>>
>> - Initializer functions that always write their parameter, so that the 
>> strongest "pointee always written" property can be stated. This causes 
>> all further uses to be marked safe.
>>
>> - Initialize the variable when there exists a known safe value that 
>> does not alter the semantics of the function. The initialization does 
>> not need to be at the declaration, but doing so simplifies the code.
> 
> As I mentionned in private there are two risks with that:
>  Â 1. You silence compiler to spot other issues
>  Â 2. You may now get warning from Coverity if it spots you set a value 
> that get overwritten before its first use.
> 
> So I think such approach should be used with parcimony. Instead, we 
> should look at reworking the code when possible.
> 

Do you think it would help if you look directly at actual cautions to 
spot possible functions that can be refactored?

>>
>> - Deviate all cases where any of the previous does not apply, with a 
>> comment deviation that refers to a justification reporting that the 
>> code has been checked to respect the rule (keep in mind that 
>> _violations_ to a Mandatory rule such as R9.1 are not allowed to claim 
>> MISRA compliance).
> 
> See above for my concern about adding so many deviations. But I am 
> confused with what you wrote. If the rule is mandatory, then why are you 
> trying to add deviation in Xen? Who is going to solve them to make Xen 
> MISRA compliant?
> 

Because only cautions were found, not violations (which cannot be 
deviated). In the former case Xen can say that the code does not violate 
the rule, but it can't be proven by the tool.

Regards,

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 10:18:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 10:18:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566515.885421 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMQkD-0007Y5-QE; Thu, 20 Jul 2023 10:18:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566515.885421; Thu, 20 Jul 2023 10:18:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMQkD-0007Xy-NE; Thu, 20 Jul 2023 10:18:49 +0000
Received: by outflank-mailman (input) for mailman id 566515;
 Thu, 20 Jul 2023 10:18:48 +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 <SRS0=ZAvQ=DG=suse.com=pmladek@srs-se1.protection.inumbo.net>)
 id 1qMQkC-0007Xs-GP
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 10:18:48 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ccf69492-26e6-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 12:18:42 +0200 (CEST)
Received: from relay2.suse.de (relay2.suse.de [149.44.160.134])
 by smtp-out2.suse.de (Postfix) with ESMTP id 762B820645;
 Thu, 20 Jul 2023 10:18:41 +0000 (UTC)
Received: from suse.cz (unknown [10.100.201.202])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by relay2.suse.de (Postfix) with ESMTPS id 06E072C142;
 Thu, 20 Jul 2023 10:18:40 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ccf69492-26e6-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1689848321; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=aC4EMf0YmVU/nLa4wYvP6njVwxOk++DLijA2AcIYsN0=;
	b=RANIbq63ks++oZYz1gm2vIzYS9WL2BDay50CD8BwB7BB6jnCpD6s4S8/5G+hL4zZDlk8tF
	MRmL9LQjj5vybyEtslcSloh0CiiEvzfOR0BCCvEc1QE2LJE9SE1krRacnbXUqKghi6tlid
	jzTXcOzBCfPwsnYwPGr6DgQjVqxTK+M=
Date: Thu, 20 Jul 2023 12:18:40 +0200
From: Petr Mladek <pmladek@suse.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: boris.ostrovsky@oracle.com, jgross@suse.com,
	xen-devel@lists.xenproject.org, Luca Miccio <lucmiccio@gmail.com>,
	Stefano Stabellini <stefano.stabellini@xilinx.com>,
	live-patching@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH LINUX v5 2/2] xen: add support for initializing xenstore
 later as HVM domain
Message-ID: <ZLkKAO09DnM8quG-@alley>
References: <alpine.DEB.2.22.394.2205131417320.3842@ubuntu-linux-20-04-desktop>
 <20220513211938.719341-2-sstabellini@kernel.org>
 <ZLgFmS4TQwGWA7o0@alley>
 <alpine.DEB.2.22.394.2307191841290.3118466@ubuntu-linux-20-04-desktop>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.22.394.2307191841290.3118466@ubuntu-linux-20-04-desktop>

On Wed 2023-07-19 18:46:08, Stefano Stabellini wrote:
> On Wed, 19 Jul 2023, Petr Mladek wrote:
> > On Fri 2022-05-13 14:19:38, Stefano Stabellini wrote:
> > > From: Luca Miccio <lucmiccio@gmail.com>
> > > 
> > > When running as dom0less guest (HVM domain on ARM) the xenstore event
> > > channel is available at domain creation but the shared xenstore
> > > interface page only becomes available later on.
> > > 
> > > In that case, wait for a notification on the xenstore event channel,
> > > then complete the xenstore initialization later, when the shared page
> > > is actually available.
> > > 
> > > The xenstore page has few extra field. Add them to the shared struct.
> > > One of the field is "connection", when the connection is ready, it is
> > > zero. If the connection is not-zero, wait for a notification.
> > 
> > I see the following warning from free_irq() in 6.5-rc2 when running
> > livepatching selftests. It does not happen after reverting this patch.
> > 
> > [  352.168453] livepatch: signaling remaining tasks
> > [  352.173228] ------------[ cut here ]------------
> > [  352.175563] Trying to free already-free IRQ 0
> > [  352.177355] WARNING: CPU: 1 PID: 88 at kernel/irq/manage.c:1893 free_irq+0xbf/0x350
> > [  352.179942] Modules linked in: test_klp_livepatch(EK)
> > [  352.181621] CPU: 1 PID: 88 Comm: xenbus_probe Kdump: loaded Tainted: G            E K    6.5.0-rc2-default+ #535
> > [  352.184754] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.15.0-0-g2dd4b9b-rebuilt.opensuse.org 04/01/2014
> > [  352.188214] RIP: 0010:free_irq+0xbf/0x350
> > [  352.192211] Code: 7a 08 75 0e e9 36 02 00 00 4c 3b 7b 08 74 5a 48 89 da 48 8b 5a 18 48 85 db 75 ee 44 89 f6 48 c7 c7 58 b0 8b 86 e8 21 0a f5 ff <0f> 0b 48 8b 34 24 4c 89 ef e8 53 bb e3 00 
> > 48 8b 45 40 48 8b 40 78
> > [  352.200079] RSP: 0018:ffffaf0440b4be80 EFLAGS: 00010086
> > [  352.201465] RAX: 0000000000000000 RBX: ffff99f105116c80 RCX: 0000000000000003
> > [  352.203324] RDX: 0000000080000003 RSI: ffffffff8691d4bc RDI: 00000000ffffffff
> > [  352.204989] RBP: ffff99f100052000 R08: 0000000000000000 R09: c0000000ffff7fff
> > [  352.206253] R10: ffffaf0440b4bd18 R11: ffffaf0440b4bd10 R12: ffff99f1000521e8
> > [  352.207451] R13: ffff99f1000520a8 R14: 0000000000000000 R15: ffffffff86f42360
> > [  352.208787] FS:  0000000000000000(0000) GS:ffff99f15a400000(0000) knlGS:0000000000000000
> > [  352.210061] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > [  352.210815] CR2: 00007f8415d56000 CR3: 0000000105e36003 CR4: 0000000000370ee0
> > [  352.211867] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> > [  352.212912] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> > [  352.213951] Call Trace:
> > [  352.214390]  <TASK>
> > [  352.214717]  ? __warn+0x81/0x170
> > [  352.215436]  ? free_irq+0xbf/0x350
> > [  352.215906]  ? report_bug+0x10b/0x200
> > [  352.216408]  ? prb_read_valid+0x17/0x20
> > [  352.216926]  ? handle_bug+0x44/0x80
> > [  352.217409]  ? exc_invalid_op+0x13/0x60
> > [  352.217932]  ? asm_exc_invalid_op+0x16/0x20
> > [  352.218497]  ? free_irq+0xbf/0x350
> > [  352.218979]  ? __pfx_xenbus_probe_thread+0x10/0x10
> > [  352.219600]  xenbus_probe+0x7a/0x80
> > [  352.221030]  xenbus_probe_thread+0x76/0xc0
> > [  352.221416]  ? __pfx_autoremove_wake_function+0x10/0x10
> > [  352.221882]  kthread+0xfd/0x130
> > [  352.222191]  ? __pfx_kthread+0x10/0x10
> > [  352.222544]  ret_from_fork+0x2d/0x50
> > [  352.222893]  ? __pfx_kthread+0x10/0x10
> > [  352.223260]  ret_from_fork_asm+0x1b/0x30
> > [  352.223629] RIP: 0000:0x0
> > [  352.223931] Code: Unable to access opcode bytes at 0xffffffffffffffd6.
> > [  352.224488] RSP: 0000:0000000000000000 EFLAGS: 00000000 ORIG_RAX: 0000000000000000
> > [  352.225044] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
> > [  352.225571] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
> > [  352.226106] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
> > [  352.226632] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
> > [  352.227171] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
> > [  352.227710]  </TASK>
> > [  352.227917] irq event stamp: 22
> > [  352.228209] hardirqs last  enabled at (21): [<ffffffff854240be>] ___slab_alloc+0x68e/0xc80
> > [  352.228914] hardirqs last disabled at (22): [<ffffffff85fe98fd>] _raw_spin_lock_irqsave+0x8d/0x90
> > [  352.229546] softirqs last  enabled at (0): [<ffffffff850fc0ee>] copy_process+0xaae/0x1fd0
> > [  352.230079] softirqs last disabled at (0): [<0000000000000000>] 0x0
> > [  352.230503] ---[ end trace 0000000000000000 ]---
> > 
> > , where the message "livepatch: signaling remaining tasks" means that
> > it might send fake signals to non-kthread tasks.
> > 
> > The aim is to force userspace tasks to enter and leave kernel space
> > so that they might start using the new patched code. It is done
> > this way:
> > 
> > /*
> >  * Sends a fake signal to all non-kthread tasks with TIF_PATCH_PENDING set.
> >  * Kthreads with TIF_PATCH_PENDING set are woken up.
> >  */
> > static void klp_send_signals(void)
> > {
> > [...]
> > 
> > 			/*
> > 			 * Send fake signal to all non-kthread tasks which are
> > 			 * still not migrated.
> > 			 */
> > 			set_notify_signal(task);
> > [...]
> > 
> > The warning is most likely printed in this condition:
> > 
> > const void *free_irq(unsigned int irq, void *dev_id)
> > {
> > 	struct irq_desc *desc = irq_to_desc(irq);
> > 	struct irqaction *action;
> > 	const char *devname;
> > 
> > 	if (!desc || WARN_ON(irq_settings_is_per_cpu_devid(desc)))
> > 		return NULL;
> > 
> > 
> > See below.
> > 
> > > --- a/drivers/xen/xenbus/xenbus_probe.c
> > > +++ b/drivers/xen/xenbus/xenbus_probe.c
> > > @@ -750,6 +751,20 @@ static void xenbus_probe(void)
> > >  {
> > >  	xenstored_ready = 1;
> > >  
> > > +	if (!xen_store_interface) {
> > > +		xen_store_interface = xen_remap(xen_store_gfn << XEN_PAGE_SHIFT,
> > > +						XEN_PAGE_SIZE);
> > > +		/*
> > > +		 * Now it is safe to free the IRQ used for xenstore late
> > > +		 * initialization. No need to unbind: it is about to be
> > > +		 * bound again from xb_init_comms. Note that calling
> > > +		 * unbind_from_irqhandler now would result in xen_evtchn_close()
> > > +		 * being called and the event channel not being enabled again
> > > +		 * afterwards, resulting in missed event notifications.
> > > +		 */
> > > +		free_irq(xs_init_irq, &xb_waitq);
> > 
> > Is it possbile that this free_irq(), the fake signal, and the warning
> > are somehow related, please?
> 
> I don't know how the fake signal could relate to this,

In short, the fake signal sets TIF_NOTIFY_SIGNAL and wakes
the kthread. It has special handling in signal_pending().
It causes that wait_interruptible() and friends would prematurely
stop waiting.

It is used primary to speedup/unblock livepatching and some io_uring
operations.

I do not know where exactly it triggers the XEN code.

> but it would seem
> that either:
> 1) free_irq is called twice
> 2) free_irq is called but xs_init_irq wasn't initialized before
> 
> For 2) I can see that xenbus_probe() is called in a few cases where
> xs_init_irq wasn't set. Something like the below would make the warning
> go away but it would be nice to figure out which one is the code path
> taken that originally triggered the warning.

I added some debugging messages and:

  + xenbus_probe() was called in xenbus_probe_thread().

  + xenbus_init() returned early after xen_domain() check so that
    xs_init_irq was never initialized.

Note that I use KVM and not XEN:

[    0.000000] Hypervisor detected: KVM
[...]
[    0.072150] Booting paravirtualized kernel on KVM

Anyway, the warning is not longer printed with the patch below.

> diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
> index 58b732dcbfb8..b0a6d121f895 100644
> --- a/drivers/xen/xenbus/xenbus_probe.c
> +++ b/drivers/xen/xenbus/xenbus_probe.c
> @@ -65,7 +65,7 @@
>  #include "xenbus.h"
>  
>  
> -static int xs_init_irq;
> +static int xs_init_irq = -1;
>  int xen_store_evtchn;
>  EXPORT_SYMBOL_GPL(xen_store_evtchn);
>  
> @@ -762,7 +762,8 @@ static void xenbus_probe(void)
>  		 * being called and the event channel not being enabled again
>  		 * afterwards, resulting in missed event notifications.
>  		 */
> -		free_irq(xs_init_irq, &xb_waitq);
> +		if (xs_init_irq >= 0)
> +			free_irq(xs_init_irq, &xb_waitq);
>  	}
>  
>  	/*

Best Regards,
Petr


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 10:21:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 10:21:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566518.885431 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMQmQ-0000Wz-5i; Thu, 20 Jul 2023 10:21:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566518.885431; Thu, 20 Jul 2023 10:21:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMQmQ-0000Ws-2K; Thu, 20 Jul 2023 10:21:06 +0000
Received: by outflank-mailman (input) for mailman id 566518;
 Thu, 20 Jul 2023 10:21:05 +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
 <SRS0=ZVXH=DG=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qMQmO-0000Wm-UF
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 10:21:05 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on2061e.outbound.protection.outlook.com
 [2a01:111:f400:fe12::61e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1d02d6d4-26e7-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 12:20:59 +0200 (CEST)
Received: from AS9PR06CA0037.eurprd06.prod.outlook.com (2603:10a6:20b:463::21)
 by AS2PR08MB8976.eurprd08.prod.outlook.com (2603:10a6:20b:5fd::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Thu, 20 Jul
 2023 10:20:45 +0000
Received: from AM7EUR03FT064.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:463:cafe::2e) by AS9PR06CA0037.outlook.office365.com
 (2603:10a6:20b:463::21) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24 via Frontend
 Transport; Thu, 20 Jul 2023 10:20:45 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT064.mail.protection.outlook.com (100.127.140.127) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.34 via Frontend Transport; Thu, 20 Jul 2023 10:20:44 +0000
Received: ("Tessian outbound d7adc65d10b4:v145");
 Thu, 20 Jul 2023 10:20:44 +0000
Received: from d062739cb110.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 72A45D2C-1A3A-4749-BB80-0D0D429959B1.1; 
 Thu, 20 Jul 2023 10:20:37 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d062739cb110.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 20 Jul 2023 10:20:37 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by DU2PR08MB10086.eurprd08.prod.outlook.com (2603:10a6:10:46e::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Thu, 20 Jul
 2023 10:20:34 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe%4]) with mapi id 15.20.6609.022; Thu, 20 Jul 2023
 10:20:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1d02d6d4-26e7-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=dpqCwJxErKWnC142hKEsRdr8pshIKgW+TW+ze44pAhw=;
 b=oF5pdagCe22qAzBmlQ45q6S2pLKr8DXSYzSQl3tYF2Zlj0NTmR7LnAs8YJtv+I8p6W8tvn5AOCAtnNjdnStDznIwNVlQJrCySkBOgckQQjL9yWbsqdv6pbo8R/LZwZNfhgotyOeENr6ZX/UBrCnHug4O7PiXV0Fs68XPgzjJn3Q=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: eeaa2731c5432388
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=iiMRT57qUcB6dM/w7oB67gLsRhdTyGKI1+NxGURPDwEn17Z7OGRbxMY8JTbT0fov33eiv6BqyA1bXpQ+5jLuSyhodQCu+bVv2s52CpFfSdYVNwtnve3kHsfm1ITH+OWqUyeLGaM3Qgu1mbc8jYKr/z/J4NY1vs/xmoygcduYYYOO01Vv2fetOvVtZxsbUOAhO7F2Tqobtdh9WyDGD/XaZZCeFeWl+UvErcTDyCUNCWf7ubnhc5x0GLfoxBAsJkBMpQaioVaW9XVW6EuBvgcjabK1+2fCv3ozgFUnv15yE67dAlgPYrH2KhPN6DLF/JsPNxsgUqDrUOTUNpJVYvNlrw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=dpqCwJxErKWnC142hKEsRdr8pshIKgW+TW+ze44pAhw=;
 b=MB8ie6vnxQecKvCRSEM8opf7Amt+A7Vvx0x/uX1K4POjxmaGOm/zN36X6XLdizslTCx6L9D+4RCHAbFaAXJM9nQDbT1OMDl0bXrhVhwX0BF2n+NH4uqKBopz+QBKqLQpyyG1LlNbkXS1EnYjlFfNi7pXxbpVawaLSyg085l0jCdhQ+NsVr1/Jf3u1/oLzqCembqB6gVvAz+WTpDdIkh9FAGn99cMK8BD5ZOINJdsmugoa/X1oLW7A4HnGAAE6a5VR3d1ijOqGiMs1MJvJTPh/e95Y5t2VRbhlBSd6VTJZLP7iV9rcsJiKZCaGvrMsHyyErIEsgzMbILy1X15hOxM+w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=dpqCwJxErKWnC142hKEsRdr8pshIKgW+TW+ze44pAhw=;
 b=oF5pdagCe22qAzBmlQ45q6S2pLKr8DXSYzSQl3tYF2Zlj0NTmR7LnAs8YJtv+I8p6W8tvn5AOCAtnNjdnStDznIwNVlQJrCySkBOgckQQjL9yWbsqdv6pbo8R/LZwZNfhgotyOeENr6ZX/UBrCnHug4O7PiXV0Fs68XPgzjJn3Q=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, Marc Bonnici
	<Marc.Bonnici@arm.com>, Achin Gupta <Achin.Gupta@arm.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>
Subject: Re: [XEN PATCH v10 04/24] xen/arm: tee: add a primitive FF-A mediator
Thread-Topic: [XEN PATCH v10 04/24] xen/arm: tee: add a primitive FF-A
 mediator
Thread-Index: Adm689GhjSkC7NGAbEqy0vn1vOHi5Q==
Date: Thu, 20 Jul 2023 10:20:34 +0000
Message-ID: <FE5A2E30-8737-415E-92B2-B6B7B0BF0CCE@arm.com>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-5-jens.wiklander@linaro.org>
In-Reply-To: <20230717072107.753304-5-jens.wiklander@linaro.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|DU2PR08MB10086:EE_|AM7EUR03FT064:EE_|AS2PR08MB8976:EE_
X-MS-Office365-Filtering-Correlation-Id: d2260fb6-aa1a-4292-6ed8-08db890afa49
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 58qWK91nwJMky/9/0dLf9keIKPrfiQVVlDR5Mx/rsFpldIkjYxbRY5NSWoRsfq+f+25dZ8uCowpXnlTn2oYF/DVA7rw2MknQmva6YDrDFPUUxTkNK946+Ag0PFZdDzR+1Q1z1DVMnSWb+YWPuXX687A+1hrSh4q78MKmFXN62oWnPgJSdsZlYgiLah10hCbzce9bz2ak4FY3EYT5pBhiuYyYml7ccdh+8HMWUy/1mUmnSyP0Bp2zfvbsAmH7I3b2BNcGjKAUrBrLir1VR/3TNYMvM/PMMQszu9thT7hTC0j03+4+2J6XvIeqsY2tBBBkpHg768OA0V+7P3iQNmNaLoQj6CK+n2hLJlaWajk3xlEHvlgnI3frMwN56ztfaWUYQStGYyjUQpCfukFoQxiv3TjgYMoiPCnwBbOfG6d3VW+B/o0doUd8w1QN/Mu37Dm2vaGx1dKVaLzZfX6r7+VSJ7NOVZOBkjbgDATdTSDZRsaEJos2tOZ/Vdh2kMEU+c9ZqyKISS6EOe0nXOucbdBFerN3pzEBa8Olj/SeaYhttLH9kvSyN0EP7BaQbLrDXfAhfRN6/5S9lGs8H3fZz06IGnUGpLqhkq1shOVX2DuAzRnuZzI+8D/UhEOJbD/Vp3Wn
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(136003)(366004)(396003)(39860400002)(451199021)(71200400001)(6486002)(91956017)(66556008)(54906003)(478600001)(83380400001)(33656002)(53546011)(30864003)(38070700005)(86362001)(2906002)(6506007)(5660300002)(186003)(36756003)(966005)(2616005)(316002)(6512007)(64756008)(76116006)(26005)(6916009)(66446008)(8936002)(66476007)(122000001)(38100700002)(66946007)(41300700001)(8676002)(4326008)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <F7F839CEF55B584FB7AE01EA8745C318@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB10086
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT064.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	e6274ad2-3cc3-489f-ea23-08db890af41e
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	+v7mzvSHBJunK+raoNGSxjXV2vWdt/tLn5PRdly9gvu16iWZe4FfEaQgUgv8GuVXmhuFwiz1sHSpHIxDaAMbdoggNbP0MvaB7yPNKvJdW2gWZfZ3P5JcBQybGmEeuqnWzVy8Ak/enxuwbp5dGZYJRtsnTOfA6iMu5SCfLsqCnXm0UOluUfzjf856vCcS70y6iJflbHMZZL3lM82jXmAKMcuRA4BEzISddQui5Pmk22pvhpyVxXGvvir4eAXc/Z+j1ZgTBhpt7QP7cUPVk4wg0nmM40kzJdsEdPAOCOVtBLbDQ0q/IOHXh3dLN8T6sbJz0Rh4D94OiTFHXKiM/YmRMTu0tHAMwHPkgRBFbbOVz2rqip7pN+34e33sFSOepy6lVJkjbazgUrYyQicsxJdhZXLLQI3QJqwQZ8cT1ZrofspGIX7HBDEMtM/x2sFOEo7G1NpmIp4XPr3K+L/aCRPriCOOgKbGum1w6/RXuHNSfTqvPbwo91lauuhOs7QCcfPWZjYch7ArKCvFMouIjkRoBQXkDpK2hEKZzH1ISjboYMOwz7ovEm7wRNhnyVmBuAFd/QQYDZzXByNfafzjWYMJCw6wyvauTdxxDJwQv1xphQSohRZCoz2kH8Bw2iK5k+8AZS0KQPaKWppP9Z+pmS/etiqA+aiSQ7GN1l3Khu7jyoA/2gP3b3xfr6yO4R3EWinWlu7rME5VpoTVfBGd259GFWUPj0Ndmrz2oQ3l3HKitDk=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(136003)(39860400002)(376002)(82310400008)(451199021)(36840700001)(46966006)(40470700004)(478600001)(2906002)(54906003)(6486002)(8676002)(30864003)(36756003)(4326008)(70586007)(70206006)(316002)(8936002)(41300700001)(82740400003)(47076005)(2616005)(83380400001)(336012)(356005)(966005)(81166007)(6512007)(186003)(6506007)(40460700003)(53546011)(86362001)(5660300002)(6862004)(33656002)(107886003)(40480700001)(36860700001)(26005);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 10:20:44.4070
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d2260fb6-aa1a-4292-6ed8-08db890afa49
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT064.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8976

Hi Jens,

> On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> wrot=
e:
>=20
> Adds a FF-A version 1.1 [1] mediator to communicate with a Secure
> Partition in secure world.
>=20
> This commit brings in only the parts needed to negotiate FF-A version
> number with guest and SPMC.
>=20
> [1] https://developer.arm.com/documentation/den0077/e
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> ---
> xen/arch/arm/include/asm/psci.h    |   4 +
> xen/arch/arm/include/asm/tee/ffa.h |  35 +++++
> xen/arch/arm/tee/Kconfig           |  11 ++
> xen/arch/arm/tee/Makefile          |   1 +
> xen/arch/arm/tee/ffa.c             | 225 +++++++++++++++++++++++++++++
> xen/arch/arm/vsmc.c                |  17 ++-
> xen/include/public/arch-arm.h      |   1 +
> 7 files changed, 291 insertions(+), 3 deletions(-)
> create mode 100644 xen/arch/arm/include/asm/tee/ffa.h
> create mode 100644 xen/arch/arm/tee/ffa.c
>=20
> diff --git a/xen/arch/arm/include/asm/psci.h b/xen/arch/arm/include/asm/p=
sci.h
> index 832f77afff3a..4780972621bb 100644
> --- a/xen/arch/arm/include/asm/psci.h
> +++ b/xen/arch/arm/include/asm/psci.h
> @@ -24,6 +24,10 @@ void call_psci_cpu_off(void);
> void call_psci_system_off(void);
> void call_psci_system_reset(void);
>=20
> +/* Range of allocated PSCI function numbers */
> +#define PSCI_FNUM_MIN_VALUE                 _AC(0,U)
> +#define PSCI_FNUM_MAX_VALUE                 _AC(0x1f,U)
> +
> /* PSCI v0.2 interface */
> #define PSCI_0_2_FN32(nr) ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL,        =
     \
>                                              ARM_SMCCC_CONV_32,          =
     \
> diff --git a/xen/arch/arm/include/asm/tee/ffa.h b/xen/arch/arm/include/as=
m/tee/ffa.h
> new file mode 100644
> index 000000000000..44361a4e78e4
> --- /dev/null
> +++ b/xen/arch/arm/include/asm/tee/ffa.h
> @@ -0,0 +1,35 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * xen/arch/arm/include/asm/tee/ffa.h
> + *
> + * Arm Firmware Framework for ARMv8-A(FFA) mediator
> + *
> + * Copyright (C) 2023  Linaro Limited
> + */
> +
> +#ifndef __ASM_ARM_TEE_FFA_H__
> +#define __ASM_ARM_TEE_FFA_H__
> +
> +#include <xen/const.h>
> +#include <xen/kconfig.h>
> +
> +#include <asm/smccc.h>
> +#include <asm/types.h>
> +
> +#define FFA_FNUM_MIN_VALUE              _AC(0x60,U)
> +#define FFA_FNUM_MAX_VALUE              _AC(0x86,U)
> +
> +static inline bool is_ffa_fid(uint32_t fid)
> +{
> +    uint32_t fn =3D fid & ARM_SMCCC_FUNC_MASK;
> +
> +    return fn >=3D FFA_FNUM_MIN_VALUE && fn <=3D FFA_FNUM_MAX_VALUE;
> +}
> +
> +#ifdef CONFIG_FFA
> +#define FFA_NR_FUNCS    12
> +#else
> +#define FFA_NR_FUNCS    0
> +#endif
> +
> +#endif /*__ASM_ARM_TEE_FFA_H__*/
> diff --git a/xen/arch/arm/tee/Kconfig b/xen/arch/arm/tee/Kconfig
> index 392169b2559d..923f08ba8cb7 100644
> --- a/xen/arch/arm/tee/Kconfig
> +++ b/xen/arch/arm/tee/Kconfig
> @@ -8,3 +8,14 @@ config OPTEE
>  virtualization-enabled OP-TEE present. You can learn more
>  about virtualization for OP-TEE at
>  https://optee.readthedocs.io/architecture/virtualization.html
> +
> +config FFA
> + bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
> + default n
> + depends on ARM_64

Even if the tee Makefile is only included if CONFIG_TEE is activated,
the missing dependency on TEE here allows to select FFA without TEE
resulting in a config with FFA activated but not compiled in.

No build error is coming from this, FFA is just not in if selected without =
TEE.

Should be:

depends on ARM_64 && TEE

I am ok if this is fixed on commit and my R-B kept.

Cheers
Bertrand

> + help
> +  This option enables a minimal FF-A mediator. The mediator is
> +  generic as it follows the FF-A specification [1], but it only
> +  implements a small subset of the specification.
> +
> +  [1] https://developer.arm.com/documentation/den0077/latest
> diff --git a/xen/arch/arm/tee/Makefile b/xen/arch/arm/tee/Makefile
> index 982c87968447..58a1015e40e0 100644
> --- a/xen/arch/arm/tee/Makefile
> +++ b/xen/arch/arm/tee/Makefile
> @@ -1,2 +1,3 @@
> +obj-$(CONFIG_FFA) +=3D ffa.o
> obj-y +=3D tee.o
> obj-$(CONFIG_OPTEE) +=3D optee.o
> diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
> new file mode 100644
> index 000000000000..927c4d33a380
> --- /dev/null
> +++ b/xen/arch/arm/tee/ffa.c
> @@ -0,0 +1,225 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * xen/arch/arm/tee/ffa.c
> + *
> + * Arm Firmware Framework for ARMv8-A (FF-A) mediator
> + *
> + * Copyright (C) 2023  Linaro Limited
> + */
> +
> +#include <xen/bitops.h>
> +#include <xen/domain_page.h>
> +#include <xen/errno.h>
> +#include <xen/init.h>
> +#include <xen/lib.h>
> +#include <xen/sched.h>
> +#include <xen/sizes.h>
> +#include <xen/types.h>
> +
> +#include <asm/event.h>
> +#include <asm/regs.h>
> +#include <asm/smccc.h>
> +#include <asm/tee/ffa.h>
> +#include <asm/tee/tee.h>
> +
> +/* Error codes */
> +#define FFA_RET_OK                      0
> +#define FFA_RET_NOT_SUPPORTED           -1
> +#define FFA_RET_INVALID_PARAMETERS      -2
> +#define FFA_RET_NO_MEMORY               -3
> +#define FFA_RET_BUSY                    -4
> +#define FFA_RET_INTERRUPTED             -5
> +#define FFA_RET_DENIED                  -6
> +#define FFA_RET_RETRY                   -7
> +#define FFA_RET_ABORTED                 -8
> +
> +/* FFA_VERSION helpers */
> +#define FFA_VERSION_MAJOR_SHIFT         16U
> +#define FFA_VERSION_MAJOR_MASK          0x7FFFU
> +#define FFA_VERSION_MINOR_SHIFT         0U
> +#define FFA_VERSION_MINOR_MASK          0xFFFFU
> +#define MAKE_FFA_VERSION(major, minor)  \
> +        ((((major) & FFA_VERSION_MAJOR_MASK) << FFA_VERSION_MAJOR_SHIFT)=
 | \
> +         ((minor) & FFA_VERSION_MINOR_MASK))
> +
> +#define FFA_VERSION_1_0         MAKE_FFA_VERSION(1, 0)
> +#define FFA_VERSION_1_1         MAKE_FFA_VERSION(1, 1)
> +/* The minimal FF-A version of the SPMC that can be supported */
> +#define FFA_MIN_SPMC_VERSION    FFA_VERSION_1_1
> +
> +/*
> + * This is the version we want to use in communication with guests and S=
Ps.
> + * During negotiation with a guest or a SP we may need to lower it for
> + * that particular guest or SP.
> + */
> +#define FFA_MY_VERSION_MAJOR    1U
> +#define FFA_MY_VERSION_MINOR    1U
> +#define FFA_MY_VERSION          MAKE_FFA_VERSION(FFA_MY_VERSION_MAJOR, \
> +                                                 FFA_MY_VERSION_MINOR)
> +
> +/* Function IDs */
> +#define FFA_ERROR                       0x84000060U
> +#define FFA_SUCCESS_32                  0x84000061U
> +#define FFA_VERSION                     0x84000063U
> +
> +struct ffa_ctx {
> +    /* FF-A version used by the guest */
> +    uint32_t guest_vers;
> +};
> +
> +/* Negotiated FF-A version to use with the SPMC */
> +static uint32_t __ro_after_init ffa_version;
> +
> +static bool ffa_get_version(uint32_t *vers)
> +{
> +    const struct arm_smccc_1_2_regs arg =3D {
> +        .a0 =3D FFA_VERSION,
> +        .a1 =3D FFA_MY_VERSION,
> +    };
> +    struct arm_smccc_1_2_regs resp;
> +
> +    arm_smccc_1_2_smc(&arg, &resp);
> +    if ( resp.a0 =3D=3D FFA_RET_NOT_SUPPORTED )
> +    {
> +        gprintk(XENLOG_ERR, "ffa: FFA_VERSION returned not supported\n")=
;
> +        return false;
> +    }
> +
> +    *vers =3D resp.a0;
> +
> +    return true;
> +}
> +
> +static void set_regs(struct cpu_user_regs *regs, register_t v0, register=
_t v1,
> +                     register_t v2, register_t v3, register_t v4, regist=
er_t v5,
> +                     register_t v6, register_t v7)
> +{
> +        set_user_reg(regs, 0, v0);
> +        set_user_reg(regs, 1, v1);
> +        set_user_reg(regs, 2, v2);
> +        set_user_reg(regs, 3, v3);
> +        set_user_reg(regs, 4, v4);
> +        set_user_reg(regs, 5, v5);
> +        set_user_reg(regs, 6, v6);
> +        set_user_reg(regs, 7, v7);
> +}
> +
> +static void handle_version(struct cpu_user_regs *regs)
> +{
> +    struct domain *d =3D current->domain;
> +    struct ffa_ctx *ctx =3D d->arch.tee;
> +    uint32_t vers =3D get_user_reg(regs, 1);
> +
> +    if ( vers < FFA_VERSION_1_1 )
> +        vers =3D FFA_VERSION_1_0;
> +    else
> +        vers =3D FFA_VERSION_1_1;
> +
> +    ctx->guest_vers =3D vers;
> +    set_regs(regs, vers, 0, 0, 0, 0, 0, 0, 0);
> +}
> +
> +static bool ffa_handle_call(struct cpu_user_regs *regs)
> +{
> +    uint32_t fid =3D get_user_reg(regs, 0);
> +    struct domain *d =3D current->domain;
> +    struct ffa_ctx *ctx =3D d->arch.tee;
> +
> +    if ( !ctx )
> +        return false;
> +
> +    switch ( fid )
> +    {
> +    case FFA_VERSION:
> +        handle_version(regs);
> +        return true;
> +
> +    default:
> +        gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
> +        return false;
> +    }
> +}
> +
> +static int ffa_domain_init(struct domain *d)
> +{
> +    struct ffa_ctx *ctx;
> +
> +    if ( !ffa_version )
> +        return -ENODEV;
> +
> +    ctx =3D xzalloc(struct ffa_ctx);
> +    if ( !ctx )
> +        return -ENOMEM;
> +
> +    d->arch.tee =3D ctx;
> +
> +    return 0;
> +}
> +
> +/* This function is supposed to undo what ffa_domain_init() has done */
> +static int ffa_domain_teardown(struct domain *d)
> +{
> +    struct ffa_ctx *ctx =3D d->arch.tee;
> +
> +    if ( !ctx )
> +        return 0;
> +
> +    XFREE(d->arch.tee);
> +
> +    return 0;
> +}
> +
> +static int ffa_relinquish_resources(struct domain *d)
> +{
> +    return 0;
> +}
> +
> +static bool ffa_probe(void)
> +{
> +    uint32_t vers;
> +    unsigned int major_vers;
> +    unsigned int minor_vers;
> +
> +    /*
> +     * psci_init_smccc() updates this value with what's reported by EL-3
> +     * or secure world.
> +     */
> +    if ( smccc_ver < ARM_SMCCC_VERSION_1_2 )
> +    {
> +        printk(XENLOG_ERR
> +               "ffa: unsupported SMCCC version %#x (need at least %#x)\n=
",
> +               smccc_ver, ARM_SMCCC_VERSION_1_2);
> +        return false;
> +    }
> +
> +    if ( !ffa_get_version(&vers) )
> +        return false;
> +
> +    if ( vers < FFA_MIN_SPMC_VERSION || vers > FFA_MY_VERSION )
> +    {
> +        printk(XENLOG_ERR "ffa: Incompatible version %#x found\n", vers)=
;
> +        return false;
> +    }
> +
> +    major_vers =3D (vers >> FFA_VERSION_MAJOR_SHIFT) & FFA_VERSION_MAJOR=
_MASK;
> +    minor_vers =3D vers & FFA_VERSION_MINOR_MASK;
> +    printk(XENLOG_INFO "ARM FF-A Mediator version %u.%u\n",
> +           FFA_MY_VERSION_MAJOR, FFA_MY_VERSION_MINOR);
> +    printk(XENLOG_INFO "ARM FF-A Firmware version %u.%u\n",
> +           major_vers, minor_vers);
> +
> +    ffa_version =3D vers;
> +
> +    return true;
> +}
> +
> +static const struct tee_mediator_ops ffa_ops =3D
> +{
> +    .probe =3D ffa_probe,
> +    .domain_init =3D ffa_domain_init,
> +    .domain_teardown =3D ffa_domain_teardown,
> +    .relinquish_resources =3D ffa_relinquish_resources,
> +    .handle_call =3D ffa_handle_call,
> +};
> +
> +REGISTER_TEE_MEDIATOR(ffa, "FF-A", XEN_DOMCTL_CONFIG_TEE_FFA, &ffa_ops);
> diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c
> index cd68fa80e98a..7f2f5eb9ce3d 100644
> --- a/xen/arch/arm/vsmc.c
> +++ b/xen/arch/arm/vsmc.c
> @@ -15,6 +15,7 @@
> #include <asm/monitor.h>
> #include <asm/regs.h>
> #include <asm/smccc.h>
> +#include <asm/tee/ffa.h>
> #include <asm/tee/tee.h>
> #include <asm/traps.h>
> #include <asm/vpsci.h>
> @@ -24,7 +25,7 @@
> #define XEN_SMCCC_FUNCTION_COUNT 3
>=20
> /* Number of functions currently supported by Standard Service Service Ca=
lls. */
> -#define SSSC_SMCCC_FUNCTION_COUNT (3 + VPSCI_NR_FUNCS)
> +#define SSSC_SMCCC_FUNCTION_COUNT (3 + VPSCI_NR_FUNCS + FFA_NR_FUNCS)
>=20
> static bool fill_uid(struct cpu_user_regs *regs, xen_uuid_t uuid)
> {
> @@ -188,13 +189,23 @@ static bool handle_existing_apis(struct cpu_user_re=
gs *regs)
>     return do_vpsci_0_1_call(regs, fid);
> }
>=20
> +static bool is_psci_fid(uint32_t fid)
> +{
> +    uint32_t fn =3D fid & ARM_SMCCC_FUNC_MASK;
> +
> +    return fn >=3D PSCI_FNUM_MIN_VALUE && fn <=3D PSCI_FNUM_MAX_VALUE;
> +}
> +
> /* PSCI 0.2 interface and other Standard Secure Calls */
> static bool handle_sssc(struct cpu_user_regs *regs)
> {
>     uint32_t fid =3D (uint32_t)get_user_reg(regs, 0);
>=20
> -    if ( do_vpsci_0_2_call(regs, fid) )
> -        return true;
> +    if ( is_psci_fid(fid) )
> +        return do_vpsci_0_2_call(regs, fid);
> +
> +    if ( is_ffa_fid(fid) )
> +        return tee_handle_call(regs);
>=20
>     switch ( fid )
>     {
> diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.=
h
> index 38311f559581..c6449893e493 100644
> --- a/xen/include/public/arch-arm.h
> +++ b/xen/include/public/arch-arm.h
> @@ -296,6 +296,7 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
>=20
> #define XEN_DOMCTL_CONFIG_TEE_NONE      0
> #define XEN_DOMCTL_CONFIG_TEE_OPTEE     1
> +#define XEN_DOMCTL_CONFIG_TEE_FFA       2
>=20
> struct xen_arch_domainconfig {
>     /* IN/OUT */
> --=20
> 2.34.1
>=20



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 10:21:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 10:21:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566522.885440 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMQnD-00015n-Gl; Thu, 20 Jul 2023 10:21:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566522.885440; Thu, 20 Jul 2023 10:21:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMQnD-00015g-E2; Thu, 20 Jul 2023 10:21:55 +0000
Received: by outflank-mailman (input) for mailman id 566522;
 Thu, 20 Jul 2023 10:21:54 +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 <SRS0=6Xo+=DG=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMQnB-0000Wm-TN
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 10:21:54 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20608.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::608])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3e28dfa3-26e7-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 12:21:52 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB8833.eurprd04.prod.outlook.com (2603:10a6:20b:42c::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 10:21:49 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 10:21:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3e28dfa3-26e7-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=nUQUR1JaDJR+P70L7t57L55CJQBIE2O7IFbNK0GbYuwH929NeKIF4HnZbItS69wNt4kvVcSELgQDVHlPsneEPG2+RVRG8qztun/wdPCYQdYp5yQPMWDOwAH9PNXYX6kts0a5ERYd2yeFtwI8yx/tAJv8Ukz5vo8hub7cWoPWM7fbDqYFjjuThvoF9+ofREwp6+63iwcRR7NpCmhDEe8/1NAvEvyj04zdxBJZmcc+HZYWNjZiJzr/RhqPVvb1mYevSCpS5qMa6yZxE29z83P7ahwFa9SMFrPjywPXPTDQPf9fvsk/jelc/ij/7YlXlXazsOzmmPjYHIJjQwwuU35Aog==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=KVosn8KbbEh8shoZ5dipkNuZa/OiREsGX1tv/RMnen0=;
 b=Sx24rBSqyUci/EdSejpihaR4ExArYhPEGdhmItt0+6biVW55Prb64YKCQ4noHnWhe6BBWNAPnYrlXo2++8vvIqdJrN86m5Sa9cEyH9+Z+iraCWn4jqc1Fa5KJTlooTNpHH+NXMJ2GUZoQtBwtuOQ6RnyNi+tV7M5/L4SUGvs32AF4eKm+j3jvfN0BvhmrQlp6UowVSjDkXMYG5jaISp1DxpM7HaXDB3sCUztt3nAignpmrXWV+pWVTMzcF2qPJjdh9mBVwC/2iC/ZtNQOBH3gEfF7eeMrbUAUgQtLNKsnER5LIiP80WJ4yf/qUr6M54I0mFvktj55/0/JBZ1lScS7A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KVosn8KbbEh8shoZ5dipkNuZa/OiREsGX1tv/RMnen0=;
 b=bkbpzu9qXCqcs2+1gaK2ibLcM/Rq944Fm6+VleCQtrV4QPO0iOcp2zhykGJaDpw7Gnn7r3YbOluQy03lawgb5hyocD8tUQ3g/1LdFT2BlzOYZeTUbaHYhylcdCnpaJaxZIfr6RCRSI+rHBDRjvTcpR04eT7HqnUYOMqHIp2yPdZ3P44Ko+s7VP5Q2+lVgCb+rU74WaFKUDX59bPJW/Jhy5/OtGSyoRMneFL6nNPi2QE0oGeoQyIQc+JSeZR+eF653IisOSJ1LB6E9kxVcuL/JmpwuBe+o8GlxWoHVXvHfFEwe9R3nR5YIInJb+z0uFqW4lH7JEa3GoZ6FW96amstug==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <f80d9124-4ff5-3553-7ccc-9a6c2205ff6f@suse.com>
Date: Thu, 20 Jul 2023 12:21:46 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 2/4] x86: allow Kconfig control over psABI level
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Anthony Perard <anthony.perard@citrix.com>
References: <dace10da-f108-fbe5-da4f-0e4497f512d9@suse.com>
 <28a84bbd-b0c4-dd80-b9c2-59770d0f54fc@suse.com>
 <bb671300-543f-3754-b428-73b91ae321a5@citrix.com>
 <b4559e5d-9736-af7f-bc0b-130a9b391b69@suse.com>
In-Reply-To: <b4559e5d-9736-af7f-bc0b-130a9b391b69@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0055.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:49::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB8833:EE_
X-MS-Office365-Filtering-Correlation-Id: adbb1e37-27a4-491b-6cbf-08db890b20e1
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	D/w5w5UKZj0ixeiolNitjUd2/Ntasay6oVLI/Mc4QFaA9v6PfXnA+tSVkd8VO4/EI1A+Q8FOBEkslC8yFOCMztlPvwQBHbonq/+q/j2creZjIMHdjj4znCc3xnR7JrerW84SO7Qwvce8MToiOHe1YuB9oyDDXgDayGVMr66lkCL6838Ul5apgSlHli9K3GjHdDhXjmWvF3Seo9s9CbCSQszB5mMrZqHD8eFPAzIpjaUctlB09g/yXY16jk94hWX0A1Iry4bxTVmxgRVYht5nA9NKqueY1TXMz1Csxw8BYIbAYGYhbycLUZW7u1UVasoffh0R6LNtKJGbzAv3lh70qfBRXifmw1y2+b4i7r+Ypc+Ca0Et7cFG8nndCUuPAQ8cyXRM6pFXFkdWBhy1A4+m0Fb55sl1OhY9kds5GNuiQVWctKHgT7vIqHvLYrXYdA4pDIguGVdUX1tQ7+Iz2tDSCvp3Oq59EOf7SG1CTr0R7GZG9R1YJx+xMtOR0ckVHgSIA76u6fXoTCd/1/g3Xb1TiUM4tNGiOC33zAxTjYjZpp/7Ei/b0yMGqwL5cQKhQrjHrpnlL8AE3LmdHn8GyD+G3ovHqK0iqKVqDiP2aMdIy6gDgm+VeDGCnyrtPaQwbTvKLHgeRc8+cj7QJhPig7qT/w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(39860400002)(376002)(396003)(136003)(451199021)(66476007)(6916009)(66556008)(66946007)(4326008)(54906003)(41300700001)(2906002)(316002)(66899021)(8676002)(5660300002)(8936002)(31686004)(478600001)(6666004)(6512007)(6486002)(26005)(6506007)(186003)(2616005)(83380400001)(36756003)(53546011)(38100700002)(86362001)(31696002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WXlGTkVtRDlrclBUNVdaZXZiK0FZUXVCMExLWGV4REs5RlQ1SUJhSW5CeThQ?=
 =?utf-8?B?c1JyWTNHK1UvSEt4ZEJzMUhRcG53N3h1Ulo0TzhCdXZXNEd4azZ6QUhYMXd5?=
 =?utf-8?B?T3NsUnNvV0xTbjE3MG9sY2thNDAzTVFuYTZPc29lOXFYdnBXRzZ2b0VWUENX?=
 =?utf-8?B?dTJIVDU5MmxDWVNkRGRCSUF1MHpEekovdFh5YTd2WUlWWXFyVmgwV1VITFlF?=
 =?utf-8?B?QS93RklrTlpYN2trRUJFM1VGLzRkSTNrRlEvNld4dHF4eWJOVmwrVk1wRWJZ?=
 =?utf-8?B?YnZaU0t5U3JtMnpvdkpqMjNNZTljZ0N0Nnl5K1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aWZva1A0Qmh3Tzl1MXRqZkpoQUR4MWlYc0NBVGVz?=
 =?utf-8?Q?vFBiYqMR+cS7LC5giMB/6NA01?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: adbb1e37-27a4-491b-6cbf-08db890b20e1
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 10:21:49.3881
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: WwVUf88ErLOElH7HXhkfwvdbP8/x2ygwaAKvXe4LvztLDigMRKbfM2AwPXswCCd6q1Lb7nR4g9xkG0JFiFUnxA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8833

On 19.07.2023 14:28, Jan Beulich wrote:
> On 19.07.2023 12:04, Andrew Cooper wrote:
>> On 19/07/2023 10:44 am, Jan Beulich wrote:
>>> --- a/xen/arch/x86/Kconfig
>>> +++ b/xen/arch/x86/Kconfig
>>> @@ -118,6 +118,36 @@ config HVM
>>>  
>>>  	  If unsure, say Y.
>>>  
>>> +choice
>>> +	prompt "base psABI level"
>>> +	default X86_64_BASELINE
>>> +	help
>>> +	  The psABI defines 4 levels of ISA extension sets as a coarse granular
>>> +	  way of identifying advanced functionality that would be uniformly
>>> +	  available in respectively newer hardware.  While v4 is not really of
>>> +	  interest for Xen, the others can be selected here, making the
>>> +	  resulting Xen no longer work on older hardware.  This option won't
>>> +	  have any effect if the toolchain doesn't support the distinction.
>>> +
>>> +	  If unsure, stick to the default.
>>> +
>>> +config X86_64_BASELINE
>>> +	bool "baseline"
>>> +
>>> +config X86_64_V2
>>> +	bool "v2"
>>> +	help
>>> +	  This enables POPCNT and CX16, besides other extensions which are of
>>> +	  no interest here.
>>> +
>>> +config X86_64_V3
>>> +	bool "v3"
>>> +	help
>>> +	  This enables BMI, BMI2, LZCNT, MOVBE, and XSAVE, besides other
>>> +	  extensions which are of no interest here.
>>> +
>>> +endchoice
>>> +
>>>  config XEN_SHSTK
>>>  	bool "Supervisor Shadow Stacks"
>>>  	depends on HAS_AS_CET_SS
>>> --- a/xen/arch/x86/arch.mk
>>> +++ b/xen/arch/x86/arch.mk
>>> @@ -36,6 +36,10 @@ CFLAGS += -mno-red-zone -fpic
>>>  # the SSE setup for variadic function calls.
>>>  CFLAGS += -mno-mmx -mno-sse $(call cc-option,$(CC),-mskip-rax-setup)
>>>  
>>> +# Enable the selected baseline ABI, if supported by the compiler.
>>> +CFLAGS-$(CONFIG_X86_64_V2) += $(call cc-option,$(CC),-march=x86-64-v2)
>>> +CFLAGS-$(CONFIG_X86_64_V3) += $(call cc-option,$(CC),-march=x86-64-v3)
>>
>> I know we're having severe disagreements over Kconfig compiler checking,
>> but this patch cannot cannot go in in this form.
>>
>> You're asking the user unconditionally for the psABI level, then
>> ignoring the answer on toolchains which don't understand it.
>>
>> The makefile needs to be unconditional, and the Kconfig options need to
>> depend on suitable toolchain support.Â  This is the only way we don't get
>> a false statement written into the .config, and embedded in hypfs.
> 
> I was tempted to base this on "x86: convert CET tool chain feature checks
> to mixed Kconfig/Makefile model", but then it likely wouldn't have stood
> a chance to go in either. The technical issues aside that need solving in
> that other patch, I still haven't had any feedback on the conceptual
> aspects. Yet as said in other contexts, without having the conceptual
> side (largely) settled, there's no incentive for me to invest time in
> dealing with the technical issues (which surely are solvable).
> 
> When raising this aspect, did you pay attention to the first of the TBDs
> in the patch? If we were to force build errors (for no real reason, see
> below), we should first try those fallbacks, to limit the possible
> damage. As mentioned there, support for these -march= forms isn't all
> that old.
> 
> As to forcing build errors in the first place, that goes against the
> intentions with the mixed Kconfig / Makefile checking model. There we
> would only issue warnings. Albeit as mentioned in that patch, that's up
> for discussion, and a majority may view things differently than I do.
> Especially here there's no reason to outright fail builds, though:
> .config / hypfs wouldn't really state anything wrong - the binary merely
> wouldn't make use of newer insns despite being permitted to.

In an attempt to fit both your and my expectations, what about another
prereq patch along the lines of the below one, of course then accompanied
by adjustments to this patch (to first try the fallback mentioned, and
then complain - as configured - if that's also not successful)?

Cc-ing other people as well which would be Cc-ed on an eventual proper
submission.

Jan

build: permit Kconfig control over how to deal with unsatisfiable choices

Some options we allow the build admin to select may require new enough
tool chain components to fulfill (partly or entirely). Provide yet
another control to pick what action to take at the end of the build
process - be silent about this, warn, or fail the build.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
This may not be fine grained enough: Optimization settings (like added
by "x86: allow Kconfig control over psABI level") may want dealing with
differently than security relevant ones (like XEN_SHSTK or XEN_IBT).

Whether to do this uniformly at the end of the build is up for
discussion: In the "warn" case we will want the resulting output late,
so it is more likely to be noticed. In the "fail build" case though we
may want the failure to occur early.

--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -64,6 +64,25 @@ config UNSUPPORTED
 	  preview features as defined by SUPPORT.md. (Note that if an option
 	  doesn't depend on UNSUPPORTED it doesn't imply that is supported.)
 
+choice
+	prompt "How to deal with settings which cannot be satisified"
+	default UNSATISFIED_WARNING
+	help
+	  Some selectable options may depend on e.g. tool chain functionality.
+	  Select here how to deal with such when actually building a such
+	  configured hypervisor.
+
+config UNSATISFIED_SILENT
+	bool "silent"
+
+config UNSATISFIED_WARNING
+	bool "emit warnings"
+
+config UNSATISFIED_ERROR
+	bool "fail the build"
+
+endchoice
+
 config LTO
 	bool "Link Time Optimisation"
 	depends on BROKEN
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -588,6 +588,10 @@ $(TARGET): outputmakefile FORCE
 	$(Q)$(MAKE) $(build)=arch/$(SRCARCH) include
 	$(Q)$(MAKE) $(build)=. arch/$(SRCARCH)/include/asm/asm-offsets.h
 	$(Q)$(MAKE) $(build)=. MKRELOC=$(MKRELOC) 'ALL_OBJS=$(ALL_OBJS-y)' 'ALL_LIBS=$(ALL_LIBS-y)' $@
+ifneq ($(CONFIG_UNSATISFIED_SILENT),y)
+	$(Q)$(if $(strip $(XEN_CONFIG_UNSATISFIED)),$(MAKE),:) \
+	    $(build)=. 'XEN_CONFIG_UNSATISFIED=$(XEN_CONFIG_UNSATISFIED)' check_unsatisfied
+endif
 
 SUBDIRS = xsm arch common crypto drivers lib test
 define all_sources
--- a/xen/build.mk
+++ b/xen/build.mk
@@ -88,3 +88,11 @@ targets += prelink.o
 
 $(TARGET): prelink.o FORCE
 	$(Q)$(MAKE) $(build)=arch/$(SRCARCH) $@
+
+PHONY += check_unsatisfied
+check_unsatisfied:
+	$(Q): $(if $(filter y,$(CONFIG_UNSATISFIED_WARNING)), \
+	           $(warning The following selections could not be satisfied:), \
+	           $(shell echo 'The following selections could not be satisfied:' >&2)) \
+	      $(foreach c,$(sort $(XEN_CONFIG_UNSATISFIED)),$(shell echo ' - CONFIG_$c' >&2)) \
+	      $(if $(filter y,$(CONFIG_UNSATISFIED_ERROR)),$(error Failing build))



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 10:30:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 10:30:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566526.885451 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMQvN-0002ys-BC; Thu, 20 Jul 2023 10:30:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566526.885451; Thu, 20 Jul 2023 10:30:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMQvN-0002yl-7q; Thu, 20 Jul 2023 10:30:21 +0000
Received: by outflank-mailman (input) for mailman id 566526;
 Thu, 20 Jul 2023 10:30:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6Xo+=DG=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMQvL-0002yf-Vj
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 10:30:19 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2047.outbound.protection.outlook.com [40.107.7.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6c648274-26e8-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 12:30:19 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8351.eurprd04.prod.outlook.com (2603:10a6:102:1c4::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 10:29:50 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 10:29:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6c648274-26e8-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=AI9gsIUjaccoefN19j/znkzDDzhtPtZjaHg6GAJx+4uckz+GsPbGFppLNiEd0V9rzZkzC0pV8al+vMLr5RXdz6RNV915a7cnMXxjYqm1Urh02/8ahB6D2IsjL+u7UFEfhsB/gdUo+/axfzt+514LUg4b03ROjmYc0sz2KjRVpaJ7gU5PCDjL/1MfN4QwopqkOpFaHzNU+Jc/Yt8odYJkF/0xgit/4zzVBc1/GLxnJ5jx4lJHCdRNVTGd4bTS+LwMvFReyLXz8z4r65YfnADOcPTuLYluSPPNapXJoYHs+5gIdjiGtMvSxs647KHyfkBxl7PIKKFnM7LbXMRGWcThhw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=YLB0PRJaJc1eZsq8HooXBEKKa7biHH/DGQoyvUN0N3I=;
 b=NpE6S1MGcg9qOXuQy1fagdI5ChxdTf5eMaK5MFz/xF5bybDJq+2EAUnslexCZIa4Ks0ae48VQgQ4lU4TtgtPHRDdSbsQNs/D7fXSrIh1EqnGPrmuvNXvoQHvdaDQ9yZHfFNPqa2M16AYDe0f6Ys39564FBLssb44dKwcPFyYVIB2Nvt038KtAaHx2lfgUCeceJrFs2obFBqJ4rM2l85lO7qgYWvsKay4Gxqc7+OUEAyWk6XhcxD4cqnIdtIFbfvei8xJxIfZnFTbTm196MBcULoekhHOYRUT3q80v/9XrryJ+/Opa09sA0ZkC0CF9fayjlW6GYOP9qqHQz7J41okeg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=YLB0PRJaJc1eZsq8HooXBEKKa7biHH/DGQoyvUN0N3I=;
 b=oFxs5kDhDeFCsV5JB+bhQK/nyIzfEOdDFWIhUlaKOPECaIFa4aK1Q2Oo/WIa2ZF0KOr2gnlBwrM4Wtwr8fNd9b566PfoMD2c3DO3K9nTLVxLoUdROb8zzm908ejg8owkpSpGVwgKTh04Y/a+c9V1CEAzLYy+xcGyLZjLJObV6+H/Yk+Uo1NiptrD7zUd69JZadf9BqG8yGqlKzixt8R93+4kMo4+LyAvTHsBmcw9SVKr/WLf3oZmeB7tW9Jt9k7nrUpX+3SXrK5BDGBBLjPWCZqZun1Zj8MieZLpzEwRdjz2IBgXNra2WBvG+viGljvdADvjrcuLvYfEfrYd5F1Xfg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ad72e892-2ec0-5188-f3bc-6d33544c775a@suse.com>
Date: Thu, 20 Jul 2023 12:29:48 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1689604562.git.oleksii.kurochko@gmail.com>
 <8c69050d7b1f42df5e776ca9494164a4d15f2d52.1689604562.git.oleksii.kurochko@gmail.com>
 <ad53c037-3c1b-ff1a-93df-b79ab2948174@suse.com>
 <30540953fb363fce4dfd59f8a7e709247a9872fd.camel@gmail.com>
 <c1a3d447-4b4d-cd9f-642d-e30fed088302@suse.com>
 <0cbf6a69e8ae08f6b85edcc4f8d53a84e0103d8b.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <0cbf6a69e8ae08f6b85edcc4f8d53a84e0103d8b.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0109.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a8::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8351:EE_
X-MS-Office365-Filtering-Correlation-Id: 1b374650-48de-4cfe-3d2e-08db890c3f6a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	RBqDDzOCO7ykYZPNd6hNxQdiIsw9Jrn50YEIB0VBqEJ+EzQxR3XjPTpRhcc4up/VW/8iiI8t5Wro5JxNDwDQ68DhI16BnP9Pk1a3XFlHl3vzB8U0jdKB9hIIvwPxzudv5sbFhMxaRnkw0lBbpNsSU7UkJOlFZczP+ArfgfmzbXHyZNn6CvNPyXiJUxTBM8LoTU390HCjjp250pAEARAy09sr1ETy5YlwV4qkKbcdjDdxSi1L16nuLB2pZKkBVNWwA0P4YhfVRJH9V7pDc3NnIneg/+/KhlzquHi0lsTXpk4SAJXZSWl1eb4KlBlzQjtoSqJM2Y4CbX24wqpQU5q5G68rSLCth4/hsSL4uVNdlTayvCNgGKipmrmeSj6IMRY+sou+2ETlsXfdluFJDiBKmCP5kudSXd+QjIPgcEPlHOEgkY3AxkuK9yno8/VzeJEcWGpr95S0/aLjSzPVLv6skQEIUHE13LoO+qpu42/MDQ3WSJgtJHLz7MwS5tLZVLgdIna9G3OCC7gGYwc/Qa9VlGnLkO02CY71nKeicM/DAbA48eZq3lTQYBB6HUETNpUx+HV1KrvZ0xhacYsoldZAMLwjtiA5imsb4QfAfcAOa1xIskfb6fhRkdDe8lqBXqijA28J5gAcVZ2j884IpFoB+Q==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(136003)(39860400002)(346002)(376002)(396003)(451199021)(53546011)(26005)(66476007)(6506007)(38100700002)(186003)(83380400001)(2616005)(36756003)(2906002)(5660300002)(54906003)(4326008)(478600001)(31696002)(86362001)(6486002)(8676002)(8936002)(6512007)(6916009)(41300700001)(66556008)(316002)(66946007)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cndsUHVSYm04TzVNZGFIZzlGaC8yS3NXa2w5NW5kQS9oLzI0L2ZqL2x4NG9l?=
 =?utf-8?B?bEIrOVg0ZFY1emV0NUcvQWxtMXhsYS83T2NFRzJHcGZGcW9QMXk0YkFFak9q?=
 =?utf-8?B?S0lKVzY3QnpTSnNDc0JxdHpCUkdPQWRUQm4rVDZDMWFJVllOTkRub1NONWZk?=
 =?utf-8?B?b0tQWnpQN3ZKaVVYU3NSanFxcThNVmI2ZHhZTHZMZFM4bnF4M2MwZXYySTBi?=
 =?utf-8?B?RTZha1h4eVZuSFhPcE9BTm1lYngzTVgyQmhFNHJPN0FVUU9CYklpVDJDYkFH?=
 =?utf-8?B?T1Q0Vjljb0lLb3pDT0RDSmFSVE9mYWtCOGxmZnpUazdKK1lMUHdvaW5ObEZX?=
 =?utf-8?B?K1FrQTBRdTJac1RrZFo1cVZaS3hsa0c4ZFJGUGRMMWc2WHhWYzdaYnhJVThC?=
 =?utf-8?B?NmtXeGpCQkhXUWRTNG5jc3Jl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48de-4cfe-3d2e-08db890c3f6a
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 10:29:50.0799
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Mv+W1TQEV00JMrqNa4Dq3hEL4s0r44Fu7CWhbCxbg0lIkTiKn9SxK/oOE2Buz/2UK9AIKCAjGFbl0M1Ml0LYqg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8351

On 20.07.2023 10:28, Oleksii wrote:
> On Thu, 2023-07-20 at 07:58 +0200, Jan Beulich wrote:
>> On 19.07.2023 18:35, Oleksii wrote:
>>> On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote:
>>>>> +Â Â Â Â Â Â Â Â Â Â Â  unsigned long load_end = LINK_TO_LOAD(_end);
>>>>> +Â Â Â Â Â Â Â Â Â Â Â  unsigned long pt_level_size = XEN_PT_LEVEL_SIZE(i
>>>>> -
>>>>> 1);
>>>>> +Â Â Â Â Â Â Â Â Â Â Â  unsigned long xen_size = ROUNDUP(load_end -
>>>>> load_start, pt_level_size);
>>>>> +Â Â Â Â Â Â Â Â Â Â Â  unsigned long page_entries_num = xen_size /
>>>>> pt_level_size;
>>>>> +
>>>>> +Â Â Â Â Â Â Â Â Â Â Â  while ( page_entries_num-- )
>>>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  pgtbl[index++].pte = 0;
>>>>> +
>>>>> +Â Â Â Â Â Â Â Â Â Â Â  break;
>>>>
>>>> Unless there's a "not crossing a 2Mb boundary" guarantee
>>>> somewhere
>>>> that I've missed, this "break" is still too early afaict.
>>> If I will add a '2 MB boundary check' for load_start and
>>> linker_start
>>> could it be an upstreamable solution?
>>>
>>> Something like:
>>> Â Â Â  if ( !IS_ALIGNED(load_start, MB(2) )
>>> Â Â Â Â Â Â Â Â printk("load_start should be 2Mb algined\n");
>>> and
>>> Â Â Â  ASSERT( !IS_ALIGNED(XEN_VIRT_START, MB(2) )
>>> in xen.lds.S.
>>
>> Arranging for the linked address to be 2Mb-aligned is certainly
>> reasonable. Whether expecting the load address to also be depends
>> on whether that can be arranged for (which in turn depends on boot
>> loader behavior); it cannot be left to "luck".
> Maybe I didn't quite understand you here, but if Xen has an alignment
> check of load address then boot loader has to follow the alignment
> requirements of Xen. So it doesn't look as 'luck'.

That depends on (a) the alignment being properly expressed in the
final binary and (b) the boot loader honoring it. (b) is what you
double-check above, emitting a printk(), but I'm not sure about (a)
being sufficiently enforced with just the ASSERT in the linker
script. Maybe I'm wrong, though.

>>> Then we will have completely different L0 tables for identity
>>> mapping
>>> and not identity and the code above will be correct.
>>
>> As long as Xen won't grow beyond 2Mb total. Considering that at
>> some point you may want to use large page mappings for .text,
>> .data, and .rodata, that alone would grow Xen to 6 Mb (or really 8,
>> assuming .init goes separate as well). That's leaving aside the
>> realistic option of the mere sum of all sections being larger than
>> 2. That said, even Arm64 with ACPI is still quite a bit below 2Mb.
>> x86 is nearing 2.5 though in even a somewhat limited config;
>> allyesconfig may well be beyond that already.
> I am missing something about Xen size. Lets assume that Xen will be
> mapped using only 4k pagees ( like it is done now ). Then if Xen will
> be more then 2Mb then only what will be changed is a number of page
> tables so it is only question of changing of PGTBL_INITIAL_COUNT ( in
> case of RISC-V).

And the way you do the tearing down of the transient 1:1 mapping.

> Could you please explain why Xen will grow to 6/8 MB in case of larger
> page mappings? In case of larger page mapping fewer tables are needed.
> For example, if we would like to use 2Mb pages then we will stop at L1
> page table and write an physical address to L1 page table entry instead
> of creating new L0 page table.

When you use 2Mb mappings, then you will want to use separate ones
for .text, .rodata, and .data (plus perhaps .init), to express the
differing permissions correctly. Consequently you'll need more
virtual address space, but - yes - fewer page table pages. And of
course the 1:1 unmapping logic will again be slightly different.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 10:34:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 10:34:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566529.885462 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMQyx-0003Ya-SM; Thu, 20 Jul 2023 10:34:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566529.885462; Thu, 20 Jul 2023 10:34:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMQyx-0003YT-Nr; Thu, 20 Jul 2023 10:34:03 +0000
Received: by outflank-mailman (input) for mailman id 566529;
 Thu, 20 Jul 2023 10:34:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMQyw-0003YN-16
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 10:34:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMQyv-0000xH-Hr; Thu, 20 Jul 2023 10:34:01 +0000
Received: from 54-240-197-239.amazon.com ([54.240.197.239]
 helo=[192.168.24.131]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMQyv-0006Cv-AG; Thu, 20 Jul 2023 10:34:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=T/Fe3Eh2Rsktx395xpMTwguu8JjKlhWxiyLQahpWNnc=; b=n6T8amDkRfLgU8ev6aUxE6Vr+G
	Jlnb5aEdZmUIpRe54XSYdKEjPH6Dezmw9PPJFcTnFzsojkY1PIUKtoCJLqzg/qYrX7DTeoDkrHP6u
	Av73rQAW4Z1js+jvzYyWhUKRGIwBqEZZGFAlLE2CoRkKTj3gf62/6E1zQEL7jsA+A46s=;
Message-ID: <048266d6-a32f-5f4e-984a-8b74de01a1fc@xen.org>
Date: Thu, 20 Jul 2023 11:33:59 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [ARM][xencons] PV Console hangs due to illegal ring buffer
 accesses
Content-Language: en-US
To: "Andrei Cherechesu (OSS)" <andrei.cherechesu@oss.nxp.com>,
 xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, george.mocanu@nxp.com,
 Juergen Gross <jgross@suse.com>
References: <62eeff72-c1fb-6932-6797-1b0058c97b03@oss.nxp.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <62eeff72-c1fb-6932-6797-1b0058c97b03@oss.nxp.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

(+ Juergen)

On 19/07/2023 17:13, Andrei Cherechesu (OSS) wrote:
> Hello,

Hi Andrei,

> As we're running Xen 4.17 (with platform-related support added) on NXP S32G SoCs (ARMv8), with a custom Linux distribution built through Yocto, and we've set some Xen-based demos up, we encountered some issues which we think might not be related to our hardware. For additional context, the Linux kernel version we're running is 5.15.96-rt (with platform-related support added as well).
> 
> The setup to reproduce the problem is fairly simple: after booting a Dom0 (can provide configuration details if needed), we're booting a normal PV DomU with PV Networking. Additionally, the VMs have k3s (Lightweight Kubernetes - version v1.25.8+k3s1: https://github.com/k3s-io/k3s/releases/tag/v1.25.8%2Bk3s1) installed in their rootfs'es.
> 
> The problem is that the DomU console hangs (no new output is shown, no input can be sent) some time (non-deterministic, sometimes 5 seconds, other times like 15-20 seconds) after we run the `k3s server` command. We have this command running as part of a sysvinit service, and the same behavior can be observed in that case as well. The k3s version we use is the one mentioned in the paragraph above, but this can be reproduced with other versions as well (i.e., v1.21.11, v1.22.6). If the `k3s server` command is ran in the Dom0 VM, everything works fine. Using DomU as an agent node is also working fine, only when it is run as a server the console problem occurs.
> 
> Immediately after the serial console hangs, we can still log in on DomU using SSH, and we can observe the following messages its dmesg:
> [   57.905806] xencons: Illegal ring page indices

Looking at Linux code, this message is printed in a couple of place in 
the xenconsole driver.

I would assume that this is printed when reading from the buffer 
(otherwise you would not see any message). Can you confirm it?

Also, can you provide the indices that Linux considers buggy?

Lastly, it seems like the barrier used are incorrect. It should be the 
virt_*() version rather than a plain mb()/wmb(). I don't think it matter 
for arm64 though (I am assuming you are not running 32-bit).

> [   59.399620] xenbus: error -5 while reading message

So this message is coming from the xenbus driver (used to read the 
xenstore ring). This is -EIO, and AFAICT returned when the indices are 
also incorrect.

For this driver, I think there is also a TOCTOU because a compiler is 
free to reload intf->rsp_cons after the check. Moving virt_mb() is 
probably not sufficient. You would also want to use ACCESS_ONCE().

What I find odd is you have two distinct rings (xenconsole and xenbus) 
with similar issues. Above, you said you are using Linux RT. I wonder if 
this has a play into the issue because if I am not mistaken, the two 
functions would now be fully preemptible.

This could expose some races. For instance, there are some missing 
ACCESS_ONCE() (as mentioned above).

In particular, Xenstored (I haven't checked xenconsoled) is using += to 
update intf->rsp_cons. There is no guarantee that the update will be atomic.

Overall, I am not 100% sure what I wrote is related. But that's probably 
a good start of things that can be exacerbated with Linux RT.

> [   59.399649] xenbus: error -5 while writing message

This is in xenbus as well. But this time in the write part. The analysis 
I wrote above for the read part can be applied here.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 10:49:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 10:49:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566533.885472 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMRDD-0005pz-9F; Thu, 20 Jul 2023 10:48:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566533.885472; Thu, 20 Jul 2023 10:48:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMRDD-0005ps-54; Thu, 20 Jul 2023 10:48:47 +0000
Received: by outflank-mailman (input) for mailman id 566533;
 Thu, 20 Jul 2023 10:48:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=o2HW=DG=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qMRDC-0005pm-3t
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 10:48:46 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ff889a9a-26ea-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 12:48:44 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.163.218.169])
 by support.bugseng.com (Postfix) with ESMTPSA id AA7504EE0C89;
 Thu, 20 Jul 2023 12:48:42 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ff889a9a-26ea-11ee-b23a-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: [XEN PATCH] x86/mtrr: address violations of MISRA C:2012 Rule 8.3 on parameter types
Date: Thu, 20 Jul 2023 12:48:36 +0200
Message-Id: <76dba3f8a6a7bc12f15a9e4fc8c73826a08e4b5c.1689849810.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Change parameter types of function declarations to be consistent with
the ones used in the corresponding definitions,
thus addressing violations of MISRA C:2012 Rule 8.3 ("All declarations
of an object or function shall use the same names and type qualifiers").

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/arch/x86/include/asm/mtrr.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/mtrr.h b/xen/arch/x86/include/asm/mtrr.h
index e4f6ca6048..5d57a596ea 100644
--- a/xen/arch/x86/include/asm/mtrr.h
+++ b/xen/arch/x86/include/asm/mtrr.h
@@ -59,9 +59,10 @@ extern int mtrr_del_page(int reg, unsigned long base, unsigned long size);
 extern int mtrr_get_type(const struct mtrr_state *m, paddr_t pa,
                          unsigned int order);
 extern void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi);
-extern u32 get_pat_flags(struct vcpu *v, u32 gl1e_flags, paddr_t gpaddr,
-                  paddr_t spaddr, uint8_t gmtrr_mtype);
-extern unsigned char pat_type_2_pte_flags(unsigned char pat_type);
+extern uint32_t get_pat_flags(struct vcpu *v, uint32_t gl1e_flags,
+                              paddr_t gpaddr, paddr_t spaddr,
+															uint8_t gmtrr_mtype);
+extern uint8_t pat_type_2_pte_flags(uint8_t pat_type);
 extern int hold_mtrr_updates_on_aps;
 extern void mtrr_aps_sync_begin(void);
 extern void mtrr_aps_sync_end(void);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 10:51:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 10:51:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566539.885481 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMRFn-0007En-Kq; Thu, 20 Jul 2023 10:51:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566539.885481; Thu, 20 Jul 2023 10:51:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMRFn-0007Eg-Hr; Thu, 20 Jul 2023 10:51:27 +0000
Received: by outflank-mailman (input) for mailman id 566539;
 Thu, 20 Jul 2023 10:51:26 +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
 <SRS0=kV2r=DG=citrix.com=prvs=558cdb244=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qMRFm-0007EW-1U
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 10:51:26 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5c1e8dda-26eb-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 12:51:21 +0200 (CEST)
Received: from mail-sn1nam02lp2045.outbound.protection.outlook.com (HELO
 NAM02-SN1-obe.outbound.protection.outlook.com) ([104.47.57.45])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 20 Jul 2023 06:51:06 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by BY5PR03MB5048.namprd03.prod.outlook.com (2603:10b6:a03:1e8::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul
 2023 10:51:04 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780%5]) with mapi id 15.20.6609.026; Thu, 20 Jul 2023
 10:51:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5c1e8dda-26eb-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689850281;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=xBiZllQ1ymSMddPnEAVyxLTZp6lUIpuNJ5zv/DmQQSI=;
  b=YvliZKejwuoAJBTLsGRf5QQ5PCA4uF5Vexik53pOHmXrv2CEooH9xF9n
   /V9eMPl/putJmKMff816zoHICdbN1qlDzdGNfUsN5yFLqUVExFm9VBZw/
   8bQ6fgQcucSmJ3DtIsrzuXSQDShEtA3Y0eiaW6AIZsTM9ckKnoGJZuxqN
   8=;
X-IronPort-RemoteIP: 104.47.57.45
X-IronPort-MID: 117283739
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:AyUlwaCV2Aab3RVW/+riw5YqxClBgxIJ4kV8jS/XYbTApDIh0mRSy
 zYZXT3QOfqINjHze4p/bY+19ElQuMXTx9U1QQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h
 yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs
 t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GxC5gRnDRx2lAS2e0c9Xcp3yZ6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uJVZ3L
 hQ12yUmpJLBVeY9R6NreTgZlVPrA6ZsHAimekcgzh2VpYfUqZYqcg68FlOGJkNMSrm4MQMEf
 VoDuvb+PFKGGnqJEzxjy1K+piBT34zFhCJTgwrvdGU6SFfmDRDw04R1KUk7wA93aN4b6MBy/
 XPM6xumr0LZNQRd7hBCOAIRtbyInDRQDrXWVjiYWjPJeUiATbgupT36LI66KWBY5oT1qY/n5
 zHTRdxqXMyQUTzEseDtac7sywleF/NHwgF9/suoqSQ4tbHNf7W2Gy4OR4TevKb0rYi6paxYY
 f1BHpUa8WTWVcGV7w5mTEWYKMiWkX2YPdly+rTZGj+0v4jCreawNAzI8yjbYbFIHIDZl7VJE
 clcXzaGPhgh3rbL0MQxiKhFE/QRg==
X-Talos-CUID: =?us-ascii?q?9a23=3AG2iXyGhAx76oLREre3LM8tbOKjJubG3f4imPeki?=
 =?us-ascii?q?DLkFlGb2pd0aqoIRbjJ87?=
X-Talos-MUID: =?us-ascii?q?9a23=3AzNaZwQ1yGSVZbrXxBO8H8DeUfDUj3JylGhwplrY?=
 =?us-ascii?q?6p+alKBNOZ26X0Ba4Xdpy?=
X-IronPort-AV: E=Sophos;i="6.01,218,1684814400"; 
   d="scan'208";a="117283739"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=nXMHw7ujK7RM5qbgtCVyiQG5Zrix6aypOZpupOeReWXNopQS59fDe4jqHtqy5ffUFvPBNzmH8EHzDhkb1CXpRCQXLhWC7OoasIsMGVsfdAuEruIARdxO8tbuS6RFsmlsRB7TggC95YiRUi/xUys8chFggrcgomD1CoZngMszDQLSfvLi4taNEXunJ6C8vhx4vGTPc+VLzc1/84YuI93Ek86KUDkUb4S5tdXqmLE4qOVJPIM8qcwAhum3Obi5KAcOQWlP17mEQMMZjgi32qhZVIqb+cTAzEr/YlC4YCpFys9+Yc0VqPEgHv9sWNZzugtmtHLaOylMaMTUAturi0v/OQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=xBiZllQ1ymSMddPnEAVyxLTZp6lUIpuNJ5zv/DmQQSI=;
 b=PleXQ86UOq973ew1gowj30H14FP/CHFsb4sGYJeCtgseg96IVZTZ0D2OinXRf8TzMzpylKcYTh5w6V6twGEZbJTRQ0azZp/nkcrMVU+UGaCQbWnQYf8Q38NXjGUbA9Dn3q09mN8lrVWj/3zE23JYC7TEam0GAhyXcWJZTwLyBV+BfZcDAUOxV8daU0k4uK/fmXlLe9BQzRaUEvSQAy6vCV/M5TdqwztlEng4a9KwrSOvplMg1ymnY3zFmFtxd+WDnIbbWHnvU6pVFq1apVV1PGAOQJem+aWij2f+oodAgUpY41smAujL6b8YaaKTeS3rC57VufDSc4N/VfOFkdsfJA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=xBiZllQ1ymSMddPnEAVyxLTZp6lUIpuNJ5zv/DmQQSI=;
 b=ToewWTIrvHohIrYs6oM3rg+G8W7FNexpaJmblox3W65S+O0xyziiHD5vKkB2JLVHecpWKD1eBgw/Oq+PAAcYHl+KcovEPSw4w+lU/tMLm2x85RmqCVEw2HwepZCf/nrA4s/KUeaD6TXcjrDYrMI133zPzWnSFSPLzwUEm8iDB6A=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <c8e4396a-78dd-52c1-6cbf-26263f2456cc@citrix.com>
Date: Thu, 20 Jul 2023 11:50:59 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH] x86/vRTC: move and tidy convert_hour() and
 {to,from}_bcd()
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Federico Serafini <federico.serafini@bugseng.com>
References: <e983103a-be32-7a77-4d7e-6d5559443f56@suse.com>
In-Reply-To: <e983103a-be32-7a77-4d7e-6d5559443f56@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO2P123CA0011.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:a6::23) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|BY5PR03MB5048:EE_
X-MS-Office365-Filtering-Correlation-Id: 135cf575-00f1-4f4a-a0e9-08db890f36de
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	iEf0TPjmcuNU5b2lTyn3cjgUyTLC6T6WB5QbcaDStnEOcsJ3mvSYQe8GiKtI4oASlvwi5YNXVw1pxmfqUSy5Xukood2FMfXUA31YUNZGFJ4VJ2eKn5uxoG0L4r6gM9n2e9IFHD3Tbq87zztJ7OFwFnOMpR4+zvIzRyu8Xfv6CsB6MZet4sEgXmF1PcGQmGjmFfBZLwXBI0fU/bZdIHNiuTkmAzKsjEDkTQaZzXiepvIK7AlYKvyeFAIM/FXbYWW5usytC0poHc3hapDyr4J/6DBthlluXB4QB7nJvC7RbyTGbtP9AZf+p4eL6lcQebO2xnvmxocWvQvjmqfAsq9jbe42qPKjzc84++1Vm36o0WKzWSxxsy8mo/chcKxYcLK+CbezFHX2Xknr3YQLZjNrNejSr7OxJojgO54gUEjsDGUieUs8JU7jvQSDAMJVIsT+m/7xDMVsBjZlnyueAtMfZDd7N3GksbkRo0Vbk3vQfcHI9aQ7Qyc/9FXzRTPyi5LyIMawhLFRfJdfRtQNIggDPsQJY39OcM9RhITNlfOrkJ+tQyMDvumdxtjHUa55ded0IBLJZkePLJxfKEGPp79gLgPkHZR0GpvAzCIrDTeYKMlqlWnX7KZaDLMknl11Gy8JY8we3sMdBIeh0s3ga+i0EA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(39860400002)(396003)(136003)(366004)(451199021)(82960400001)(38100700002)(53546011)(26005)(186003)(6506007)(2616005)(316002)(66476007)(66946007)(66556008)(4326008)(8676002)(6486002)(6512007)(5660300002)(6666004)(8936002)(41300700001)(4744005)(54906003)(2906002)(478600001)(110136005)(31696002)(36756003)(86362001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Y2lJbFJlTFR6R3gwSTQ0T2krVDBNQnVWUEZlcXhnOVlWWkNrNGlxM3ZGNi9Y?=
 =?utf-8?B?eklyUTZDajVzM0doakd1U3c2eTFlcjBzZHB0d2hzWlZmaDU5bHU2ZjRwZWx2?=
 =?utf-8?B?ajVuNkRiQUIxazhsU0ZpdGllOVFlL0d6N0V1YUN1UVd3SlZGN0xiSzZ5bnkz?=
 =?ut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YW2onbh1YrXjjryKpYEgsmscdeZ+PgY28twGV7xfBk1cZywCe4rVgHgWSnPjoK8JlLSxNG2MBRAKT9t0x0dGc8VqTnGihbFxZra3WcA0qpoDU4P1do3uRBHvlVflFkwwE8cuShsiYmHU4LrNiHDZvgjj7jFonUGt38W+ug56HRG1cn0oZF/lNWIwMLhpr/xhL1Lg6iY4flJ4QzmbWxLE4gOzA=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 135cf575-00f1-4f4a-a0e9-08db890f36de
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 10:51:04.5649
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Mm23hwkvhMEH5EBmiHZxy8B/mgIS0+Rio8ncKgvlx5TjiIc2bwVkbC6sp4KAKI0B57dQZGeis5s6p//FaT7pzWCJ4uO3GBSB+OCB968sxlU=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR03MB5048

On 20/07/2023 8:11 am, Jan Beulich wrote:
> This is to avoid the need for forward declarations, which in turn
> addresses a violation of MISRA C:2012 Rule 8.3 ("All declarations of an
> object or function shall use the same names and type qualifiers").
>
> While doing so,
> - drop inline (leaving the decision to the compiler),
> - add const,
> - add unsigned,
> - correct style.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 11:02:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 11:02:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566542.885491 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMRQi-0000h1-Ky; Thu, 20 Jul 2023 11:02:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566542.885491; Thu, 20 Jul 2023 11:02:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMRQi-0000gu-IK; Thu, 20 Jul 2023 11:02:44 +0000
Received: by outflank-mailman (input) for mailman id 566542;
 Thu, 20 Jul 2023 11:02:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMRQh-0000gk-0j; Thu, 20 Jul 2023 11:02:43 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMRQg-0001bb-OZ; Thu, 20 Jul 2023 11:02:42 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMRQg-0003WS-DR; Thu, 20 Jul 2023 11:02:42 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMRQg-000828-Cy; Thu, 20 Jul 2023 11:02:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=rluLHFw4A841OeFEfSv5AAh6mST/5sDskDCQj0f7uy0=; b=zVT4LRjtKIlD+u2+FBwIcRC/wC
	X/U3Y7SFf3HYk2tcvDIFZ+OwGtgjjNacsHF2Zb+G4s5LLUTX7tSe6X3PtD7afEUhWTvRZqUYg0GqY
	P/D19gTsTF1dcjzDLlK8BMoHtGYEKq+6lu7FhoUNVw1DpTPDh8B2c+ZxNLVpDimadmvw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181922-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181922: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=b2de9ec5a759aa4a7ac029cda9079dce077bf856
X-Osstest-Versions-That:
    ovmf=6510dcf6f71adbe282bff0ba2b236f1d074f819f
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 20 Jul 2023 11:02:42 +0000

flight 181922 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181922/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 b2de9ec5a759aa4a7ac029cda9079dce077bf856
baseline version:
 ovmf                 6510dcf6f71adbe282bff0ba2b236f1d074f819f

Last test of basis   181916  2023-07-20 01:41:49 Z    0 days
Testing same since   181922  2023-07-20 08:11:06 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Sheng Wei <w.sheng@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   6510dcf6f7..b2de9ec5a7  b2de9ec5a759aa4a7ac029cda9079dce077bf856 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 11:20:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 11:20:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566547.885501 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMRi4-0003qN-4H; Thu, 20 Jul 2023 11:20:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566547.885501; Thu, 20 Jul 2023 11:20:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMRi4-0003qG-1V; Thu, 20 Jul 2023 11:20:40 +0000
Received: by outflank-mailman (input) for mailman id 566547;
 Thu, 20 Jul 2023 11:20:37 +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
 <SRS0=/JYs=DG=citrix.com=prvs=558be806a=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMRi1-0003q7-Nf
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 11:20:37 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 70d06e0b-26ef-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 13:20:34 +0200 (CEST)
Received: from mail-bn8nam12lp2174.outbound.protection.outlook.com (HELO
 NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.174])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 20 Jul 2023 07:20:31 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by BY5PR03MB5062.namprd03.prod.outlook.com (2603:10b6:a03:1eb::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.23; Thu, 20 Jul
 2023 11:20:28 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 11:20:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 70d06e0b-26ef-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689852034;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=bv8Ohcyj8qQN7Pgt+eSR3WF41mfZC6wNOQ/2e+OO3iY=;
  b=g2L+FDnfSaHq2dQQ0gPdbJQ0jqlNZNgAFJJCdS8jpu5YEpXzuO8yudUt
   MBOlo7eywTkBiArWgNLSop8CGk8K6qdMhqJ3siKuIEgvhFjeGgHXAhu97
   OyUV6rSB/ow0Ibn4yUW2bChoEWCpiwI/LkgAiJgPnhYTIK/7vg+gxkWX2
   8=;
X-IronPort-RemoteIP: 104.47.55.174
X-IronPort-MID: 116730338
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:HsRvFqjQ5xqEl0EhokMaUH4nX161sBEKZh0ujC45NGQN5FlHY01je
 htvCGmBPKqIM2r9fNFxaYzg8k0PvsDRnNZjHAFprSlnQS4b9cadCdqndUqhZCn6wu8v7q5Ex
 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv
 cKai8DEMRqu1iUc3lg8sspvkzsx+qyr0N8klgZmP6sT4wWGzyB94K83fsldEVOpGuG4IcbiL
 wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ
 OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+
 tQZKjoXRxSYvN6c2aiDGrN0mu0fdMfSadZ3VnFIlVk1DN4AaLWaGeDgw48d2z09wMdTAfzZe
 swVLyJ1awjNaAFOPVFRD48imOCvhT/0dDgwRFC9/PJrpTSMilEsluGybLI5efTTLSlRtlyfq
 W/cuXzwHzkRNcCFyCrD+XWp7gPKtXqiBt1JTObjppaGhnWj7DJIKw9Mc2fkqOS1oFHgd/h8G
 0ELr39GQa8asRbDosPGdyO/pHmIrxsNQe16Gucx6ByO4qfM6gPfDW8BJhZRZdpjuMIoSDgC0
 l6Sg8ivFTFpqKeSS3+W6vGTtzzaEQ8RIGwZbCkIVzws5dX5vZozhRLCSNVkOKOth9izEjb1q
 xiIpiUjg7QYjeYQyr62u1vAhlqRSoPhSwc04kDdWDKj5wYgPoq9PdX3tR7c8OpKK5ufQh+Zp
 n8YlsOC7ecIS5aQiCiKR+ZLF7asjxqYDADhbZdUN8FJ31yQF7SLJ+i8PBkWyJ9VD/s5
IronPort-HdrOrdr: A9a23:HQgeLqGLCBI67+oEpLqEi8eALOsnbusQ8zAXPiFKKSC9F/byqy
 nAppkmPHPP4gr5O0tApTn/Asa9qBrnnPZICOIqUYtKMjOJhFeV
X-Talos-CUID: =?us-ascii?q?9a23=3AEihOmWlW4ZGndns0YnlYA4dKY4zXOXzfxm35J1S?=
 =?us-ascii?q?DNUxwUoXFE0eM0Z88nfM7zg=3D=3D?=
X-Talos-MUID: 9a23:iPgoOQjBQBf4OyFpap4LbsMpBO02uIe8UmYxzpwbt+ObawBaGAeQk2Hi
X-IronPort-AV: E=Sophos;i="6.01,218,1684814400"; 
   d="scan'208";a="116730338"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=QnqigWHV2vtkRVIdeWMPjemO84VOuavJk02IOXUIVbIsDdokcznJ8vnjAEojdUCFnmrlzURrhEpHZ/CkEcB4ZGruQ10pf06qSaDsNiiXNTRlf3AMHK341/I00mC5DdqYnP5JTdzxVzfvpSL/59ohFcuLr5l2TSPTy1oPyTRsCWtBhnWYqgUeNxIuBx1Bo+f6/S68kVqcyVhO83IbpQnYEpn+raSnojKHacucZEplf3LtD2KRhn/bq+S6dth6N/xyGh+p+tmwNXHZiKRgv0480dw73W5k/RbL3+Ey+FLPjf8nYwjgNxEnekf8hj3ufauj0nS6yaMJa9bgpyp+20YHTA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=TsuPcO383Qu2k/Kwr1KZEgR0FzOlvcy4CxYtC3If9KM=;
 b=hyS9AEgC/i3QQdkMXtRKRx4C4SM3Ps4Rw6GjJPlknmWpNGkZ49RHqenwFfy2NY+Ff6ufVU/Cc0w1Kj2Wr8ge0aXRwXroRZU+RD+XKg6UEmtPd9ATY83BmGc5WFs2+XoG5Mvk9lm+tIh0OTXyYrzLcvs5NSLA04Jm2QZ0HR/P+VbX7gL7eicI/l1buSQd/uLmrQFvzCb8ItEbZhXKxigO+kietp4YoLhhE8/O+VAmCkrqPJ0Qe3yeksRoAxnXXgprDLfQ7U0aQTXNBGIYQNBaMc6NqgTEciJRYY1+ZROT2IcG4BKuk6R6HwpsdIH0GVCLQSmcupRn6+nYoWjtwhSYSg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=TsuPcO383Qu2k/Kwr1KZEgR0FzOlvcy4CxYtC3If9KM=;
 b=gYynox8SVdi3T8dBx7ecMuc0hEjF/2Y6+CuVK0pdxfCZwf4qU1DjdyAAFvx0225iELUHPN7KT7IgJU+HSRrKVol9nGgJSsdxJNsEDC+kK37HKmK4H/WgCJKRKz3sfZP1wzKE1DUW6qAdgxbjfAdpo+NG1peNXwINjEZdE0/WqIQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Thu, 20 Jul 2023 13:20:22 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Message-ID: <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
X-ClientProxiedBy: LNXP265CA0088.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:76::28) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|BY5PR03MB5062:EE_
X-MS-Office365-Filtering-Correlation-Id: c03b027f-07a7-47e9-7fba-08db89135236
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Vk/yjsHTsNDQv2DPX1KbKhMeMQzbEXf97XrpgAIkMer7RSb1A0LhVtGwVMk0n4CBH7wsqbKp5/fjcQF1OyRNW6/TbjZP5UjyJYZ6ef8x50cBfYwiDXsSqQhP4ITpqjFIus1R51YSCCWZ8FY9Y4LnOcL7KmlbQaD1AQCIWtpoPGBf8YGD/z6G98ytKfzvLBNzuRS7b82Ve28NPCyr4SOyrR9XHbtfYLo4IPiQM5ojxVB6nCfRDNVPfmm/UO+OkYllAaRatUHtp7JddvWLISScBjO+PMKgYVSgQPQtNW9vZ8WGBqxpwAF5LW58fQlQVDIgusseOCKtB+CXKA9DHXg6/+itF01+kyBkHK+1tAqB4YauXT2EBONr77o4RVVI+pDk1cXLIqwThQMkYfTedqzV3gpdRkxE0wF4xSScHv4irFurQ/ZnHKHhoMR7CN4e4/+BeapVw//FEx769GAt2kySE4EL3SNTx7a7ojrOnIX467QTWWhagckSoMYlc8HHmggBHcvQlPHxblLxJ6MT2kEGxnPwKhcHXhlJF8ZDOirpQHnsLcAampZYf5lAxFcOFAg1bKeJxX3TTWmEby7DWcDB+SYo3QOf402y5wXvbQM+wLSpn7+XbANqwjlbh8ywmESH
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(346002)(366004)(39860400002)(396003)(451199021)(316002)(41300700001)(66476007)(6916009)(66946007)(4326008)(66556008)(5660300002)(8936002)(8676002)(83380400001)(86362001)(9686003)(82960400001)(38100700002)(186003)(26005)(6486002)(6506007)(6512007)(85182001)(54906003)(478600001)(6666004)(30864003)(2906002)(309714004);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UVhOVDB2cm0xTDdIQ2pTZUZqVkozYUV1S1BwN2ErOGxFR2dnUmR4VzAwa2dx?=
 =?utf-8?B?RWhJaHBLaHRhK240YjlISlJ4NjVtc0xJL1JMY2oxTW5HbU9oV21iN1F4M3pH?=
 =?utf-8?B?dUNKa1VoU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Y3zrD3o/1F1icqD66vVXlFvZG+b2nZqCdDmbasCLkd7jLmvJ8cgnxjpe9X1qxGL7AtK0uFqhzBd6ZGTMLCj/5Oj/Jt/TtKUTF5OabTWPJ++o/m7/T6ECz8DuKhX6B3su6BJV6Nyj0qX7+GG4tsIhUhCFGk6yBgPG9cxUYkfyh+qvsdHoLYu0wE8lMZtq6LnU7aQxz5+1O3BZnw6u8SgKHqmQpAx01IowClqM7Eg==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c03b027f-07a7-47e9-7fba-08db89135236
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 11:20:28.3119
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: GtcL9JUtlBNG0HY7xhiPqb8b2azsA+qJrDbX+8pImJOc4tivU/OekVR2Ug5gUfzkusvDAqhYWNfEpr87JN7KHw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR03MB5062

On Thu, Jul 20, 2023 at 12:32:31AM +0000, Volodymyr Babchuk wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> 
> Use a previously introduced per-domain read/write lock to check
> whether vpci is present, so we are sure there are no accesses to the
> contents of the vpci struct if not. This lock can be used (and in a
> few cases is used right away) so that vpci removal can be performed
> while holding the lock in write mode. Previously such removal could
> race with vpci_read for example.

This I think needs to state the locking order of the per-domain
pci_lock wrt the vpci->lock.  AFAICT that's d->pci_lock first, then
vpci->lock.

> 1. Per-domain's pci_rwlock is used to protect pdev->vpci structure
> from being removed.
> 
> 2. Writing the command register and ROM BAR register may trigger
> modify_bars to run, which in turn may access multiple pdevs while
> checking for the existing BAR's overlap. The overlapping check, if
> done under the read lock, requires vpci->lock to be acquired on both
> devices being compared, which may produce a deadlock. It is not
> possible to upgrade read lock to write lock in such a case. So, in
> order to prevent the deadlock, use d->pci_lock instead. To prevent
> deadlock while locking both hwdom->pci_lock and dom_xen->pci_lock,
> always lock hwdom first.
> 
> All other code, which doesn't lead to pdev->vpci destruction and does
> not access multiple pdevs at the same time, can still use a
> combination of the read lock and pdev->vpci->lock.
> 
> 3. Drop const qualifier where the new rwlock is used and this is
> appropriate.
> 
> 4. Do not call process_pending_softirqs with any locks held. For that
> unlock prior the call and re-acquire the locks after. After
> re-acquiring the lock there is no need to check if pdev->vpci exists:
>  - in apply_map because of the context it is called (no race condition
>    possible)
>  - for MSI/MSI-X debug code because it is called at the end of
>    pdev->vpci access and no further access to pdev->vpci is made

I assume that's vpci_msix_arch_print(): there are further accesses to
pdev->vpci, but those use the msix local variable, which holds a copy
of the pointer in pdev->vpci->msix, so that last sentence is not true
I'm afraid.

However the code already try to cater for the pdev going away, and
hence it's IMO fine.  IOW: your change doesn't make this any better or
worse.

> 
> 5. Introduce pcidevs_trylock, so there is a possibility to try locking
> the pcidev's lock.

I'm confused by this addition, the more that's no used anywhere.  Can
you defer the addition until the patch that makes use of it?

> 
> 6. Use d->pci_lock around for_each_pdev and pci_get_pdev_by_domain
> while accessing pdevs in vpci code.
> 
> Suggested-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> Suggested-by: Jan Beulich <jbeulich@suse.com>
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> 
> ---
> 
> Changes in v8:
>  - changed d->vpci_lock to d->pci_lock
>  - introducing d->pci_lock in a separate patch
>  - extended locked region in vpci_process_pending
>  - removed pcidevs_lockis vpci_dump_msi()
>  - removed some changes as they are not needed with
>    the new locking scheme
>  - added handling for hwdom && dom_xen case
> ---
>  xen/arch/x86/hvm/vmsi.c       |  4 +++
>  xen/drivers/passthrough/pci.c |  7 +++++
>  xen/drivers/vpci/header.c     | 18 ++++++++++++
>  xen/drivers/vpci/msi.c        | 14 ++++++++--
>  xen/drivers/vpci/msix.c       | 52 ++++++++++++++++++++++++++++++-----
>  xen/drivers/vpci/vpci.c       | 46 +++++++++++++++++++++++++++++--
>  xen/include/xen/pci.h         |  1 +
>  7 files changed, 129 insertions(+), 13 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c
> index 3cd4923060..8c1bd66b9c 100644
> --- a/xen/arch/x86/hvm/vmsi.c
> +++ b/xen/arch/x86/hvm/vmsi.c
> @@ -895,6 +895,8 @@ int vpci_msix_arch_print(const struct vpci_msix *msix)
>  {
>      unsigned int i;
>  
> +    ASSERT(rw_is_locked(&msix->pdev->domain->pci_lock));
> +
>      for ( i = 0; i < msix->max_entries; i++ )
>      {
>          const struct vpci_msix_entry *entry = &msix->entries[i];
> @@ -913,7 +915,9 @@ int vpci_msix_arch_print(const struct vpci_msix *msix)
>              struct pci_dev *pdev = msix->pdev;
>  
>              spin_unlock(&msix->pdev->vpci->lock);
> +            read_unlock(&pdev->domain->pci_lock);
>              process_pending_softirqs();
> +            read_lock(&pdev->domain->pci_lock);

This should be a read_trylock(), much like the spin_trylock() below.

>              /* NB: we assume that pdev cannot go away for an alive domain. */
>              if ( !pdev->vpci || !spin_trylock(&pdev->vpci->lock) )
>                  return -EBUSY;
> diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
> index 5b4632ead2..6f8692cd9c 100644
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -57,6 +57,11 @@ void pcidevs_lock(void)
>      spin_lock_recursive(&_pcidevs_lock);
>  }
>  
> +int pcidevs_trylock(void)
> +{
> +    return spin_trylock_recursive(&_pcidevs_lock);
> +}
> +
>  void pcidevs_unlock(void)
>  {
>      spin_unlock_recursive(&_pcidevs_lock);
> @@ -1144,7 +1149,9 @@ static void __hwdom_init setup_one_hwdom_device(const struct setup_hwdom *ctxt,
>      } while ( devfn != pdev->devfn &&
>                PCI_SLOT(devfn) == PCI_SLOT(pdev->devfn) );
>  
> +    write_lock(&ctxt->d->pci_lock);
>      err = vpci_add_handlers(pdev);
> +    write_unlock(&ctxt->d->pci_lock);
>      if ( err )
>          printk(XENLOG_ERR "setup of vPCI for d%d failed: %d\n",
>                 ctxt->d->domain_id, err);
> diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
> index b41556d007..2780fcae72 100644
> --- a/xen/drivers/vpci/header.c
> +++ b/xen/drivers/vpci/header.c
> @@ -152,6 +152,7 @@ bool vpci_process_pending(struct vcpu *v)
>          if ( rc == -ERESTART )
>              return true;
>  
> +        write_lock(&v->domain->pci_lock);
>          spin_lock(&v->vpci.pdev->vpci->lock);
>          /* Disable memory decoding unconditionally on failure. */
>          modify_decoding(v->vpci.pdev,
> @@ -170,6 +171,7 @@ bool vpci_process_pending(struct vcpu *v)
>               * failure.
>               */
>              vpci_remove_device(v->vpci.pdev);
> +        write_unlock(&v->domain->pci_lock);
>      }

The handling in vpci_process_pending() wrt vpci_remove_device() is
racy and will need some thinking to get it solved.  Your change
doesn't make it any worse, but I would also be fine with adding a note
in the commit message that vpci_process_pending() is not adjusted to
use the new lock because it needs to be reworked first in order to be
safe against a concurrent vpci_remove_device() call.

>  
>      return false;
> @@ -181,8 +183,20 @@ static int __init apply_map(struct domain *d, const struct pci_dev *pdev,
>      struct map_data data = { .d = d, .map = true };
>      int rc;
>  
> +    ASSERT(rw_is_locked(&d->pci_lock));
> +
>      while ( (rc = rangeset_consume_ranges(mem, map_range, &data)) == -ERESTART )
> +    {
> +        /*
> +         * It's safe to drop and reacquire the lock in this context
> +         * without risking pdev disappearing because devices cannot be
> +         * removed until the initial domain has been started.
> +         */
> +        read_unlock(&d->pci_lock);
>          process_pending_softirqs();
> +        read_lock(&d->pci_lock);
> +    }

Since this is init only code you could likely forego the usage of the
locks, but I guess that's more churn than just using them.  In any
case, as this gets called from modify_bars() the locks need to be
dropped/taken in write mode (see comment below).

>      rangeset_destroy(mem);
>      if ( !rc )
>          modify_decoding(pdev, cmd, false);
> @@ -223,6 +237,8 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
>      unsigned int i;
>      int rc;
>  
> +    ASSERT(rw_is_locked(&pdev->domain->pci_lock));

The lock here needs to be taken in write mode I think, so the code can
safely iterate over the contents of each pdev->vpci assigned to the
domain.

> +
>      if ( !mem )
>          return -ENOMEM;
>  
> @@ -502,6 +518,8 @@ static int cf_check init_bars(struct pci_dev *pdev)
>      struct vpci_bar *bars = header->bars;
>      int rc;
>  
> +    ASSERT(rw_is_locked(&pdev->domain->pci_lock));
> +
>      switch ( pci_conf_read8(pdev->sbdf, PCI_HEADER_TYPE) & 0x7f )
>      {
>      case PCI_HEADER_TYPE_NORMAL:
> diff --git a/xen/drivers/vpci/msi.c b/xen/drivers/vpci/msi.c
> index 8f2b59e61a..e63152c224 100644
> --- a/xen/drivers/vpci/msi.c
> +++ b/xen/drivers/vpci/msi.c
> @@ -190,6 +190,8 @@ static int cf_check init_msi(struct pci_dev *pdev)
>      uint16_t control;
>      int ret;
>  
> +    ASSERT(rw_is_write_locked(&pdev->domain->pci_lock));

I'm confused by the difference in lock requirements between
init_bars() and init_msi().  In the former you assert for the lock
being taken in read mode, while the later asserts for write mode.

We want to do initialization in write mode, so that modify_bars()
called by init_bars() has exclusive access to the contents of
pdev->vpci.

> +
>      if ( !pos )
>          return 0;
>  
> @@ -265,7 +267,7 @@ REGISTER_VPCI_INIT(init_msi, VPCI_PRIORITY_LOW);
>  
>  void vpci_dump_msi(void)
>  {
> -    const struct domain *d;
> +    struct domain *d;
>  
>      rcu_read_lock(&domlist_read_lock);
>      for_each_domain ( d )
> @@ -277,6 +279,9 @@ void vpci_dump_msi(void)
>  
>          printk("vPCI MSI/MSI-X d%d\n", d->domain_id);
>  
> +        if ( !read_trylock(&d->pci_lock) )
> +            continue;
> +
>          for_each_pdev ( d, pdev )
>          {
>              const struct vpci_msi *msi;
> @@ -318,14 +323,17 @@ void vpci_dump_msi(void)
>                       * holding the lock.
>                       */
>                      printk("unable to print all MSI-X entries: %d\n", rc);
> -                    process_pending_softirqs();
> -                    continue;
> +                    goto pdev_done;
>                  }
>              }
>  
>              spin_unlock(&pdev->vpci->lock);
> + pdev_done:
> +            read_unlock(&d->pci_lock);
>              process_pending_softirqs();
> +            read_lock(&d->pci_lock);

read_trylock().

This is not very safe, as the list could be modified while the lock is
dropped, but it's a debug key handler so I'm not very concerned.
However we should at least add a comment that this relies on the list
not being altered while the lock is dropped.

>          }
> +        read_unlock(&d->pci_lock);
>      }
>      rcu_read_unlock(&domlist_read_lock);
>  }
> diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
> index 25bde77586..9481274579 100644
> --- a/xen/drivers/vpci/msix.c
> +++ b/xen/drivers/vpci/msix.c
> @@ -147,6 +147,8 @@ static struct vpci_msix *msix_find(const struct domain *d, unsigned long addr)
>  {
>      struct vpci_msix *msix;
>  
> +    ASSERT(rw_is_locked(&d->pci_lock));

Hm, here you are iterating over pdev->vpci->header.bars for multiple
devices, so I think in addition to the pci_lock in read mode we should
also take the vpci->lock for each pdev.

I think I would like to rework msix_find() so it's msix_get() and
returns with the appropriate vpci->lock taken.  Anyway, that's for a
different patch, the usage of the lock in read mode seems correct,
albeit I might want to move the read_lock() call inside of msix_get()
in the future.

> +
>      list_for_each_entry ( msix, &d->arch.hvm.msix_tables, next )
>      {
>          const struct vpci_bar *bars = msix->pdev->vpci->header.bars;
> @@ -163,7 +165,13 @@ static struct vpci_msix *msix_find(const struct domain *d, unsigned long addr)
>  
>  static int cf_check msix_accept(struct vcpu *v, unsigned long addr)
>  {
> -    return !!msix_find(v->domain, addr);
> +    int rc;
> +
> +    read_lock(&v->domain->pci_lock);
> +    rc = !!msix_find(v->domain, addr);
> +    read_unlock(&v->domain->pci_lock);
> +
> +    return rc;
>  }
>  
>  static bool access_allowed(const struct pci_dev *pdev, unsigned long addr,
> @@ -358,21 +366,34 @@ static int adjacent_read(const struct domain *d, const struct vpci_msix *msix,
>  static int cf_check msix_read(
>      struct vcpu *v, unsigned long addr, unsigned int len, unsigned long *data)
>  {
> -    const struct domain *d = v->domain;
> -    struct vpci_msix *msix = msix_find(d, addr);
> +    struct domain *d = v->domain;
> +    struct vpci_msix *msix;
>      const struct vpci_msix_entry *entry;
>      unsigned int offset;
>  
>      *data = ~0ul;
>  
> +    read_lock(&d->pci_lock);
> +
> +    msix = msix_find(d, addr);
>      if ( !msix )
> +    {
> +        read_unlock(&d->pci_lock);
>          return X86EMUL_RETRY;
> +    }
>  
>      if ( adjacent_handle(msix, addr) )
> -        return adjacent_read(d, msix, addr, len, data);
> +    {
> +        int rc = adjacent_read(d, msix, addr, len, data);

Nit: missing newline (here and below).

> +        read_unlock(&d->pci_lock);
> +        return rc;
> +    }
>  
>      if ( !access_allowed(msix->pdev, addr, len) )
> +    {
> +        read_unlock(&d->pci_lock);
>          return X86EMUL_OKAY;
> +    }
>  
>      spin_lock(&msix->pdev->vpci->lock);
>      entry = get_entry(msix, addr);
> @@ -404,6 +425,7 @@ static int cf_check msix_read(
>          break;
>      }
>      spin_unlock(&msix->pdev->vpci->lock);
> +    read_unlock(&d->pci_lock);
>  
>      return X86EMUL_OKAY;
>  }
> @@ -491,19 +513,32 @@ static int adjacent_write(const struct domain *d, const struct vpci_msix *msix,
>  static int cf_check msix_write(
>      struct vcpu *v, unsigned long addr, unsigned int len, unsigned long data)
>  {
> -    const struct domain *d = v->domain;
> -    struct vpci_msix *msix = msix_find(d, addr);
> +    struct domain *d = v->domain;
> +    struct vpci_msix *msix;
>      struct vpci_msix_entry *entry;
>      unsigned int offset;
>  
> +    read_lock(&d->pci_lock);
> +
> +    msix = msix_find(d, addr);
>      if ( !msix )
> +    {
> +        read_unlock(&d->pci_lock);
>          return X86EMUL_RETRY;
> +    }
>  
>      if ( adjacent_handle(msix, addr) )
> -        return adjacent_write(d, msix, addr, len, data);
> +    {
> +        int rc = adjacent_write(d, msix, addr, len, data);
> +        read_unlock(&d->pci_lock);
> +        return rc;
> +    }
>  
>      if ( !access_allowed(msix->pdev, addr, len) )
> +    {
> +        read_unlock(&d->pci_lock);
>          return X86EMUL_OKAY;
> +    }
>  
>      spin_lock(&msix->pdev->vpci->lock);
>      entry = get_entry(msix, addr);
> @@ -579,6 +614,7 @@ static int cf_check msix_write(
>          break;
>      }
>      spin_unlock(&msix->pdev->vpci->lock);
> +    read_unlock(&d->pci_lock);
>  
>      return X86EMUL_OKAY;
>  }
> @@ -665,6 +701,8 @@ static int cf_check init_msix(struct pci_dev *pdev)
>      struct vpci_msix *msix;
>      int rc;
>  
> +    ASSERT(rw_is_write_locked(&pdev->domain->pci_lock));
> +
>      msix_offset = pci_find_cap_offset(pdev->seg, pdev->bus, slot, func,
>                                        PCI_CAP_ID_MSIX);
>      if ( !msix_offset )
> diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
> index d73fa76302..f22cbf2112 100644
> --- a/xen/drivers/vpci/vpci.c
> +++ b/xen/drivers/vpci/vpci.c
> @@ -38,6 +38,8 @@ extern vpci_register_init_t *const __end_vpci_array[];
>  
>  void vpci_remove_device(struct pci_dev *pdev)
>  {
> +    ASSERT(rw_is_write_locked(&pdev->domain->pci_lock));
> +
>      if ( !has_vpci(pdev->domain) || !pdev->vpci )
>          return;
>  
> @@ -73,6 +75,8 @@ int vpci_add_handlers(struct pci_dev *pdev)
>      const unsigned long *ro_map;
>      int rc = 0;
>  
> +    ASSERT(rw_is_write_locked(&pdev->domain->pci_lock));
> +
>      if ( !has_vpci(pdev->domain) )
>          return 0;
>  
> @@ -326,11 +330,12 @@ static uint32_t merge_result(uint32_t data, uint32_t new, unsigned int size,
>  
>  uint32_t vpci_read(pci_sbdf_t sbdf, unsigned int reg, unsigned int size)
>  {
> -    const struct domain *d = current->domain;
> +    struct domain *d = current->domain;
>      const struct pci_dev *pdev;
>      const struct vpci_register *r;
>      unsigned int data_offset = 0;
>      uint32_t data = ~(uint32_t)0;
> +    rwlock_t *lock;
>  
>      if ( !size )
>      {
> @@ -342,11 +347,21 @@ uint32_t vpci_read(pci_sbdf_t sbdf, unsigned int reg, unsigned int size)
>       * Find the PCI dev matching the address, which for hwdom also requires
>       * consulting DomXEN.  Passthrough everything that's not trapped.
>       */
> +    lock = &d->pci_lock;
> +    read_lock(lock);
>      pdev = pci_get_pdev(d, sbdf);
>      if ( !pdev && is_hardware_domain(d) )
> +    {
> +        read_unlock(lock);
> +        lock = &dom_xen->pci_lock;
> +        read_lock(lock);
>          pdev = pci_get_pdev(dom_xen, sbdf);
> +    }
>      if ( !pdev || !pdev->vpci )
> +    {
> +        read_unlock(lock);
>          return vpci_read_hw(sbdf, reg, size);
> +    }
>  
>      spin_lock(&pdev->vpci->lock);
>  
> @@ -392,6 +407,7 @@ uint32_t vpci_read(pci_sbdf_t sbdf, unsigned int reg, unsigned int size)
>          ASSERT(data_offset < size);
>      }
>      spin_unlock(&pdev->vpci->lock);
> +    read_unlock(lock);
>  
>      if ( data_offset < size )
>      {
> @@ -431,10 +447,23 @@ static void vpci_write_helper(const struct pci_dev *pdev,
>               r->private);
>  }
>  
> +/* Helper function to unlock locks taken by vpci_write in proper order */
> +static void unlock_locks(struct domain *d)
> +{
> +    ASSERT(rw_is_locked(&d->pci_lock));
> +
> +    if ( is_hardware_domain(d) )
> +    {
> +        ASSERT(rw_is_locked(&d->pci_lock));
> +        read_unlock(&dom_xen->pci_lock);
> +    }
> +    read_unlock(&d->pci_lock);
> +}
> +
>  void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
>                  uint32_t data)
>  {
> -    const struct domain *d = current->domain;
> +    struct domain *d = current->domain;
>      const struct pci_dev *pdev;
>      const struct vpci_register *r;
>      unsigned int data_offset = 0;
> @@ -447,8 +476,16 @@ void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
>  
>      /*
>       * Find the PCI dev matching the address, which for hwdom also requires
> -     * consulting DomXEN.  Passthrough everything that's not trapped.
> +     * consulting DomXEN. Passthrough everything that's not trapped.
> +     * If this is hwdom, we need to hold locks for both domain in case if
> +     * modify_bars is called()

Typo: the () wants to be at the end of modify_bars().

>       */
> +    read_lock(&d->pci_lock);
> +
> +    /* dom_xen->pci_lock always should be taken second to prevent deadlock */
> +    if ( is_hardware_domain(d) )
> +        read_lock(&dom_xen->pci_lock);

For modify_bars() we also want the locks to be in write mode (at least
the hw one), so that the position of the BARs can't be changed while
modify_bars() is iterating over them.

Is this something that will be done in a followup change?

> +
>      pdev = pci_get_pdev(d, sbdf);
>      if ( !pdev && is_hardware_domain(d) )
>          pdev = pci_get_pdev(dom_xen, sbdf);
> @@ -459,6 +496,8 @@ void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
>  
>          if ( !ro_map || !test_bit(sbdf.bdf, ro_map) )
>              vpci_write_hw(sbdf, reg, size, data);
> +
> +        unlock_locks(d);
>          return;
>      }
>  
> @@ -498,6 +537,7 @@ void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
>          ASSERT(data_offset < size);
>      }
>      spin_unlock(&pdev->vpci->lock);
> +    unlock_locks(d);

There's one issue here, some handlers will cal pcidevs_lock(), which
will result in a lock over inversion, as in the previous patch we
agreed that the locking order was pcidevs_lock first, d->pci_lock
after.

For example the MSI control_write() handler will call
vpci_msi_arch_enable() which takes the pcidevs lock.  I think I will
have to look into using a dedicated lock for MSI related handling, as
that's the only place where I think we have this pattern of taking the
pcidevs_lock after the d->pci_lock.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 11:32:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 11:32:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566553.885523 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMRtM-000666-Iw; Thu, 20 Jul 2023 11:32:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566553.885523; Thu, 20 Jul 2023 11:32:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMRtM-00065v-Fa; Thu, 20 Jul 2023 11:32:20 +0000
Received: by outflank-mailman (input) for mailman id 566553;
 Thu, 20 Jul 2023 11:32:19 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMRtL-00065V-Gt; Thu, 20 Jul 2023 11:32:19 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMRtL-0002GJ-5h; Thu, 20 Jul 2023 11:32:19 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMRtK-0004tz-Mg; Thu, 20 Jul 2023 11:32:18 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMRtK-0000bQ-MA; Thu, 20 Jul 2023 11:32:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=dFD4GYgtbfXBchEn1qatGXk9pIV0uEJdOZ7WZi1/Lq0=; b=yX5G0NNaZXwnIYpzrjFLnK3Y9i
	bx9R8XWbjsh/2epV6y12mIPvRB8K12gxH1mBOBhoOfHP9/FcMDs8icv+GHJiJMYZU3g+6/eKoon7Y
	nbNSCLn5HXB8PaF/ldIICHVCwtXpwvCX3fWH4rdfoOeuEG3tcpi6Ea5Z7B6pDztcIdP4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181923-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181923: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=4bf014c6f7d7cc9a9e017cef0eb5ff4bf27526e9
X-Osstest-Versions-That:
    xen=b1c16800e52743d9afd9af62c810f03af16dd942
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 20 Jul 2023 11:32:18 +0000

flight 181923 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181923/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  4bf014c6f7d7cc9a9e017cef0eb5ff4bf27526e9
baseline version:
 xen                  b1c16800e52743d9afd9af62c810f03af16dd942

Last test of basis   181893  2023-07-19 09:03:36 Z    1 days
Testing same since   181923  2023-07-20 09:02:01 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Federico Serafini <federico.serafini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Luca Fancellu <luca.fancellu@arm.com>
  Stefano Stabellini <sstabellini@kernel.org>
  Tamas K Lengyel <tamas@tklengyel.com>
  Yang Xu <yang.xu@mediatek.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   b1c16800e5..4bf014c6f7  4bf014c6f7d7cc9a9e017cef0eb5ff4bf27526e9 -> smoke


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 11:32:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 11:32:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566552.885514 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMRtJ-0005qr-AJ; Thu, 20 Jul 2023 11:32:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566552.885514; Thu, 20 Jul 2023 11:32:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMRtJ-0005qk-7T; Thu, 20 Jul 2023 11:32:17 +0000
Received: by outflank-mailman (input) for mailman id 566552;
 Thu, 20 Jul 2023 11:32:16 +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
 <SRS0=/JYs=DG=citrix.com=prvs=558be806a=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMRtI-0005qa-AM
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 11:32:16 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 101919a0-26f1-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 13:32:10 +0200 (CEST)
Received: from mail-dm6nam11lp2174.outbound.protection.outlook.com (HELO
 NAM11-DM6-obe.outbound.protection.outlook.com) ([104.47.57.174])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 20 Jul 2023 07:32:08 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by CO6PR03MB6259.namprd03.prod.outlook.com (2603:10b6:5:359::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Thu, 20 Jul
 2023 11:32:06 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 11:32:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 101919a0-26f1-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689852730;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=qkBYpkALUN8qEadm+JA4FoVCVr30vzBtw5/VkogHJoY=;
  b=ganEd10S/8umsADZRs/oWvYUvj0lS9BJqSbM/H7TG1b9rTZIVG65ORN5
   Jktj6Kwj/7l/MGpTioI9vGxuZtLAxZQsUlvP7FxYSDiqvTatpmy+sTetY
   iJL3ADx/we74sAlAV5GU9vtDgnuqOwwDOvp1Lo0ATPJPR/aEFFur3DDlp
   Y=;
X-IronPort-RemoteIP: 104.47.57.174
X-IronPort-MID: 117287329
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort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Mhy72ulB1b
 pxN4hSYeeAaWSSVPyKgjWFLw==
X-Talos-CUID: 9a23:ujmc622TAD2L7M8FIlcEjbxfC580Sjra/VHrL0KXVD5JRZ+IcV6v0fYx
X-Talos-MUID: 9a23:esZclQnp1N9pnFBgKkYEdnpwHcg14p2MDnsilL4s4MqDLRBpZjaC2WE=
X-IronPort-AV: E=Sophos;i="6.01,218,1684814400"; 
   d="scan'208";a="117287329"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KfWF3ELt+U8XYZ760YiU2MfQ+fW9xAc3BMgas1RFXXI6wiY6heupJ/oz9oHkbklIB4JFbzVCgvtip+KBGnEwKScouaSrn69ip3jBvOvnBkY4PVA1PQcWJjLTz8qpuYOqkpLd8z+i0DailaLRFn0+pJHUyzr/BO83ILvij2BlHCip9j3FkbkQfiI9yi4I9SZHoozFJnbCSaUcBo+vC0aaURvaIo8WjFyd7G/oZ1bT2dZUqPN4wHHrXI1fJ86SlV02LAThBynzMFDr6/U9lqE82Dc82A9cXJQ6CuK//dMoi+414zzMrjbMeaXR35f5R8VxBjJjW2EJY2P72N7+225B9A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=c653+j0zoweL4IRJptdfesKu5HCIHmQiVtweC4/qRXU=;
 b=aB7KUcvtrTNB2CMKDxbXPhJH57e7/Nlb8Y2v5zfyj6wuQ2RmX9SOrhwP60qgGVUzbVIrYrMasFQNhWHnNiwuo9A+EFo78RN6ytSxw0opmbJHIwogHaMNeGYibr0z1Noecz5vsvOCkouRHbp/3pnSyq5O0hehkvcgqq/TDK8RjVcR9IHYNJgVePiTLHsRZf1HRTTDRSVx/XTa4Lxj8iywQlGfpBCFVrT6hpi7zyRyZAOvGnSW70n33y/Gk73tolB1pmGSfUs6/IM6Yzhy+PI/lE/x+SubjdtKq731gwrJQx82vx3cSmfI37WJTOmzniYfHd3vtGbefdfySDpp60Wlew==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=c653+j0zoweL4IRJptdfesKu5HCIHmQiVtweC4/qRXU=;
 b=lx6uV7abnxh6b7jn1CR81BHcKU1eUkFrKmZSHJvVheMwdcTWTpDSTedFIrLXWMgMKtKFXUFmXnCcrvtzdbnQMdLFUB90vlH6+EO+P1DPj6w4fq+kKLIik//9N3zp12pgfKES/Tv7Gvcm3KsHpU1kGS5PXO/dxljuEWSn3ITw1KY=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Thu, 20 Jul 2023 13:32:01 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH v8 03/13] vpci: restrict unhandled read/write operations
 for guests
Message-ID: <ZLkbMcRNZ6trjE6X@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-4-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230720003205.1828537-4-volodymyr_babchuk@epam.com>
X-ClientProxiedBy: LO2P265CA0296.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:a5::20) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|CO6PR03MB6259:EE_
X-MS-Office365-Filtering-Correlation-Id: 17d92a9b-d946-4684-17b9-08db8914f269
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	pGytQU2fZEld+2jB0MMSsp4VGa33HkErhQEnV3K9hFCi2RgB2q3/Zyao/QENq2q6MBBT3rZiAjL/mrsvPkoinzTTqPulhdxtXuyBxLA+BXUXn+jR6ZZ2lJwcULAhcq8sUxBpPFc4lY0bf7uT+LCXMzGSgtKnC6JSOQHO121Uw5vOYAV2KlMcNZc2z9LtNDyzm6p6Sir+OTqSq5QoEK/SxI4QT5rGOeFc6jO0dIG7XpwA1WArKmiLbT90cSyrC/VMSKSuidh8MKM3PPV4+9PWaUc8dBmS0683XGY+plBS1Zol4+IrTgmXvezeLOMu3++gsIowXF42KtpUneho2QYl/iEv4KRWzgbU9yRxo4Bz9SRqNSprXgGNRn6mRtQfdU2I9jw5ZKmZdw29oZcbfrBr0mHdbSjzbCtjoO2z+eM4IO/86BjfFHY1S7PIv0NfzqYwHIVHAFCHKOlt3k0O0qu6j4Yr+oTBdMh9ayfjWzi2p7bFTko02ga9cxZSvGubfke5wWYC3lyN0UHu+x4SJPP8dsvSZJ1Nz0D6oOuYWMsf2xCddAtWK/Czvh7T8YCGbRkI
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(396003)(346002)(136003)(366004)(451199021)(2906002)(83380400001)(86362001)(85182001)(82960400001)(38100700002)(26005)(186003)(6506007)(41300700001)(9686003)(6666004)(6512007)(6486002)(6916009)(4326008)(316002)(54906003)(66556008)(66476007)(8936002)(8676002)(66946007)(478600001)(5660300002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TEZuZTRtRTJaanRnQjdtMU1mU0pGdVNCR3A1Q2RUQUc3NjEyMHI4TDdxK0pV?=
 =?utf-8?B?NHdEY3J5eHUvRXFFNmR3N2RpUVpHeEx5VkZQVGJTQ0lmbFljaGliMTZ3VHRO?=
 =?utf-8?B?VmJKS1orQVA4OUd4ZFVaOUR3LzBYTm1NQ0c5d0pjcGx0S2M0RXZLMjBPZjMw?=
 =?utf-8?B?dzBUcHJScHhPWXE4NTYyajRnZ0NxUXVQdHB4UWJXZVpKZ0RMR01HQWJaUmlz?=
 =?utf-8?B?TVVtQjJHT1Nrd1BtN0VKUUF2WTJPNjVjbEgvUEpPUWloTXRUb0Q1bUpHTllu?=
 =?utf-8?B?Y0hTWTFpRmhyU1ZOL1lUWE9kZGVHaFRzMFVIR09EYjExcmcxSE8rNnZQOXN1?=
 =?utf-8?B?cWhlaW5YOC8wQkFSSjNyd3krMzVzQTVVUEZRYlRwOW95SkRHdExZUmsrSHJG?=
 =?utf-8?B?VXMwb09NUnN6SVhkci9Jemh5d0FNU3JiYlNDQ0VjRmRXQ0ZLUjVhQXcremtG?=
 =?utf-8?B?TVFVY2NxZ2VtM3l2YmVYU2dKb0ZNVUZUVTB6d0QxTlRzUGxlWVlqYnh1TkdU?=
 =?utf-8?B?UXZqVDFNNG9ueFZNVGxpZDZJSTNxTkp0TzdGUzBQZm1DYkxYdEk1MllRMXFG?=
 =?utf-8?B?NnBnMmV5Zmd4SGRrbk5sNFBUME5WVE15VDdQekw5T3FqUmJFODNLRVhhZGxJ?=
 =?utf-8?B?ZnUzN01MdFM5YWptTDhWaTQ1dmJMZUZudGxZMXpHVVE3d2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lqqrA6ahT5I0wzjmmTTGtFPJkowGtm3SurxOAM1FDElgN2O9Yc78U4tM8z838VWKIb7Rg7qeRNxDMIwZ82zpEWOb3VQteZAfwA6uYHrnjQ7s9vQqYssFfRyhdKqlnNX/aUzsok6J0quV7ht+4mnmXqenhzO/ZyHJC7dd2a60a7pOrRuaRLmWJEtRRr8B1P/JLZycGffi4RhkT5jj4DjHdKCxRXc4GT2xBnHLqeQL0mVHhlydVDR+5ag8bFCIAvfIP+C+1Nbnr0WrNViWR02lt/ygs7q0V0uo3MQ+3GQxQJA0g9FkjeEiIKUeS94WydrvMx+j7CK4BjVQR98AmtjaJ4YzRRgPLEvP9rxYjR3ekzaGNbHHgGi880WGMnhFMEZ91+MUgBXFGlfcXaNSRgqZ3IOYmVey8wu6SgkpMokX1mfi60+ylFD49SgwU1jt6Lju0qVqzPKgfYLCWVng3PFoRD9GQLXejmTkKP6hu+M772EjRZA7S9ic4zCDs66ZMc8Rrrmjm9nUMg1MednXQcqPbUxSuT7/hcJid+0XHblyhG3daMrRFd9k5MkIdQtg4aMB2KnOICCn1v/8edeqduyfIF9
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 17d92a9b-d946-4684-17b9-08db8914f269
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 11:32:06.5421
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Rs7vsUxIhuIqjjbmLRANNB6noOFDjulZ4DZ7M/OnlNLV1iMdYg30GasPY6zOikgUZEfQdqGXsln6mwVupv0H/A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR03MB6259

On Thu, Jul 20, 2023 at 12:32:31AM +0000, Volodymyr Babchuk wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> 
> A guest would be able to read and write those registers which are not
> emulated and have no respective vPCI handlers, so it will be possible
> for it to access the hardware directly.
> In order to prevent a guest from reads and writes from/to the unhandled
                                                            ^ extra 'the'
> registers make sure only hardware domain can access the hardware directly
> and restrict guests from doing so.
> 
> Suggested-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

Reviewed-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

With the stray change below removed.

> 
> ---
> Since v6:
> - do not use is_hwdom parameter for vpci_{read|write}_hw and use
>   current->domain internally
> - update commit message
> New in v6
> ---
>  xen/drivers/vpci/vpci.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
> index f22cbf2112..a6d2cf8660 100644
> --- a/xen/drivers/vpci/vpci.c
> +++ b/xen/drivers/vpci/vpci.c
> @@ -233,6 +233,10 @@ static uint32_t vpci_read_hw(pci_sbdf_t sbdf, unsigned int reg,
>  {
>      uint32_t data;
>  
> +    /* Guest domains are not allowed to read real hardware. */
> +    if ( !is_hardware_domain(current->domain) )
> +        return ~(uint32_t)0;
> +
>      switch ( size )
>      {
>      case 4:
> @@ -273,9 +277,13 @@ static uint32_t vpci_read_hw(pci_sbdf_t sbdf, unsigned int reg,
>      return data;
>  }
>  
> -static void vpci_write_hw(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
> -                          uint32_t data)
> +static void vpci_write_hw(pci_sbdf_t sbdf, unsigned int reg,
> +                          unsigned int size, uint32_t data)

Unrelated change?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 11:58:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 11:58:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566561.885537 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMSIn-0001js-No; Thu, 20 Jul 2023 11:58:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566561.885537; Thu, 20 Jul 2023 11:58:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMSIn-0001jl-Jv; Thu, 20 Jul 2023 11:58:37 +0000
Received: by outflank-mailman (input) for mailman id 566561;
 Thu, 20 Jul 2023 11:58:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=5mVk=DG=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1qMSIm-0001jf-BA
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 11:58:36 +0000
Received: from NAM04-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam04on2062b.outbound.protection.outlook.com
 [2a01:111:f400:7e8c::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bf43d3d5-26f4-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 13:58:33 +0200 (CEST)
Received: from DS7PR03CA0085.namprd03.prod.outlook.com (2603:10b6:5:3bb::30)
 by MN0PR12MB5785.namprd12.prod.outlook.com (2603:10b6:208:374::17) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Thu, 20 Jul
 2023 11:58:28 +0000
Received: from DM6NAM11FT094.eop-nam11.prod.protection.outlook.com
 (2603:10b6:5:3bb:cafe::9f) by DS7PR03CA0085.outlook.office365.com
 (2603:10b6:5:3bb::30) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28 via Frontend
 Transport; Thu, 20 Jul 2023 11:58:28 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 DM6NAM11FT094.mail.protection.outlook.com (10.13.172.195) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.34 via Frontend Transport; Thu, 20 Jul 2023 11:58:26 +0000
Received: from cjq-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 20 Jul
 2023 06:58:20 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bf43d3d5-26f4-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CES4kZJ7nV9mTACgv9Ldppo2s2itLtnu/WdK+yzk2m7vYSiYieJP3YBbwTquUr1FHW4ux7uyB/m5yeb46D/oThwOCkcJOxAlF1NVkDbr5SQ9vI4D3kxs8NU4k8ekeks6irungSQuUupNX+BfbQeKOOXT/eeLpXp9KIeHUNjhnoXxYoY0FjQD+Vj+h/ITCdCMXa0CYZiCgb7h02Chi+4e4xxhADQIVvIIV8GQOjfMMRN5dcz4joodYrZppsrq16HnaLU+nEhkh3Ys5G4keDhDqs7cvsShEDkNliWSpUMADm7ktPsWbsM1gERakHAVWW1r2dDK/3M2Lufk1pu/83KDvA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=v4lckvljWvieP4FEFItdXnGbxb7FZyvrEokOl/O+d4k=;
 b=O42DBLUNxi3GsEXj0igfMMU4Ro7Cii+HoCki9BswAYHKR1QiUK+pKYZKZqBB4qvGiQXbk51fNguM38tF0s+MTcvCrmV0a2UMdJxy9lOXwxhBjYAPxdUWGH33X+bPtSVN3XYafoQLbv9Y3HDATY4Q2OcU9NTo1mYdPtaKLBF25cYU0A0IpmnrFDkAhtTruBVxjSd1lQyWmj8h98FN7Xw27ZZTtF4FjaXyqLFffvoBRLiPAcmbR8+KrSe6t7ZKXE7QQk50gnxwX5JhKy9W+IE+7v1lj7rrE7eOMp7XY3Bi0qS0TCjGm/fqAAkLyBOaevNUuZ7Nee28jno7ekYx0itReg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=v4lckvljWvieP4FEFItdXnGbxb7FZyvrEokOl/O+d4k=;
 b=pkiAFqCYyBjqgPrUrp4ci3Q/8DzuzUgJpKB7cvZWvZmt9qNYCOr8fSzTa7egET5C+YVjcaU5BNMrG/2QamRKhR5ki64BVFqXdSojJaUzIXyM5sLqRcGnGtMzUqUd1c4UB45Slo3/HR/uZGDdTS2p7791gn76ZpxmGKKHoctfZF8=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jiqian Chen <Jiqian.Chen@amd.com>
To: David Airlie <airlied@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>,
	=?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@gmail.com>, "Gurchetan
 Singh" <gurchetansingh@chromium.org>, Chia-I Wu <olvaffe@gmail.com>, "Juergen
 Gross" <jgross@suse.com>, Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Robert Beckett <bob.beckett@collabora.com>,
	<virtualization@lists.linux-foundation.org>, <linux-kernel@vger.kernel.org>,
	<dri-devel@lists.freedesktop.org>
CC: <xen-devel@lists.xenproject.org>, Alex Deucher
	<Alexander.Deucher@amd.com>, Christian Koenig <Christian.Koenig@amd.com>,
	Stewart Hildebrand <Stewart.Hildebrand@amd.com>, Xenia Ragiadakou
	<burzalodowa@gmail.com>, Honglei Huang <Honglei1.Huang@amd.com>, Julia Zhang
	<Julia.Zhang@amd.com>, Huang Rui <Ray.Huang@amd.com>, Jiqian Chen
	<Jiqian.Chen@amd.com>
Subject: [LINUX KERNEL PATCH v3 0/1] add S3 support for virtgpu
Date: Thu, 20 Jul 2023 19:58:04 +0800
Message-ID: <20230720115805.8206-1-Jiqian.Chen@amd.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com
 (10.181.40.145)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DM6NAM11FT094:EE_|MN0PR12MB5785:EE_
X-MS-Office365-Filtering-Correlation-Id: 4b1fe0be-0d2c-43ec-872c-08db8918a062
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	jXYUFBQ7AEZGF/YlfNS7kzvNQmN6njXu4ny/bPbU3u9ArINBygFdC573q8yhZSs+S/zk3FnO3WE468I7eusXX5gkF8lQ0vOtgxLkr8nTBIjHj6K5uArHs/YorXaZAv9tCbZHArvUVguhwPbHjHSYUAiPSTDZdUsvYYXRxV6tl5EgayFtOvOORgTDW8PH1uO2nABPaMZavPtJgwF18tlw53V/Vff1+zPP/uTqaor0pR7Wk7fKGe3RMrCnFL5r2JwXdmuMfD0pmpUDDl9c2vQPW8CjJoNPt/uTj+u9+sqM6ou7BPsvoUP2g5FyC2XggT2o3qkFL+1q9+LG48mV6dquZbyPZ0Fn5mI0tNx+mUEiXh1ECGOHCipFiZOEAYNyQHlR5MBbPvZ8K3b5OG5kMSRgE/Dk+5s25MFKrRhRb0aVdBSfVzWWdgJgm2UzzzUHlGxELkO0y0aNzowv3KSjb8L38dd9EeNK6PDD2GsWp+P9s7B7U8M01AA30e39mIPPvc4Vr9V1RETU/LuXO+4ZvRDD6qW5NT6uBDYFxx4kq+3UfGnSDG2N2w7Jp549CY6nv5K1t2pbQrR3yRfhQOQaSPCuzzVY0cEnmAoRj6ff7X8Fltz0MEO3/UPBQHclQuP/M9+h092pdifIsw0BmjL0M9iK17MpktSQ8kkRKKnW6W1G2USaaGoYgWPn9tDvkhSE/Q8fFRWM/2b3/TG5JHjf51kkZTCx5BP24IxNC8xTbyS5LN7k33q6j+6eovy+LAygSZcjdOgk+6n/791lSOwYTEzjzwhorV8x1ZapBxNWquijylsjg68eN59Tj3AcY6JN9VWS
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:ErrorRetry;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(396003)(136003)(346002)(82310400008)(451199021)(40470700004)(36840700001)(46966006)(2906002)(36860700001)(40460700003)(83380400001)(47076005)(2616005)(356005)(921005)(86362001)(36756003)(82740400003)(81166007)(40480700001)(4326008)(426003)(70206006)(70586007)(316002)(336012)(41300700001)(1076003)(26005)(16526019)(186003)(478600001)(7696005)(6666004)(966005)(54906003)(8676002)(8936002)(7416002)(110136005)(5660300002)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 11:58:26.5308
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 4b1fe0be-0d2c-43ec-872c-08db8918a062
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DM6NAM11FT094.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5785

v3:
Hi all,
Thanks for Gerd Hoffmann's advice. V3 makes below changes:
* Use enum for freeze mode, so this can be extended with more
  modes in the future.
* Rename functions and paratemers with "_S3" postfix.
And no functional changes.

Best regards,
Jiqian Chen.


v2:

Hi all,
Thanks to Marc-AndrÃ© Lureau, Robert Beckett and Gerd Hoffmann for
their advice and guidance. V2 makes below changes:
* Change VIRTIO_CPU_CMD_STATUS_FREEZING to 0x0400 (<0x1000)
* Add a new feature flag VIRTIO_GPU_F_FREEZING, so that guest and
  host can negotiate whenever freezing is supported or not.

V2 of Qemu patch:
https://lore.kernel.org/qemu-devel/20230630070016.841459-1-Jiqian.Chen@amd.com/T/#t


v1:

link,
https://lore.kernel.org/lkml/20230608063857.1677973-1-Jiqian.Chen@amd.com/

Hi all,
I am working to implement virtgpu S3 function on Xen.

Currently on Xen, if we start a guest who enables virtgpu, and then
run "echo mem > /sys/power/state" to suspend guest. And run
"sudo xl trigger <guest id> s3resume" to resume guest. We can find that
the guest kernel comes back, but the display doesn't. It just shows a
black screen.

In response to the above phenomenon, I have found two problems.

First, if we move mouse on the black screen, guest kernel still sends a
cursor request to Qemu, but Qemu doesn't response. Because when guest
is suspending, it calls device_suspend, and then call into Qemu to call
virtio_reset->__virtio_queue_reset. In __virtio_queue_reset, it clears
all virtqueue information on Qemu end. So, after guest resumes, Qemu
can't get message from virtqueue.

Second, the reason why display can't come back is that when guest is
suspending, it calls into Qemu to call virtio_reset->virtio_gpu_gl_reset.
In virtio_gpu_gl_reset, it destroys all resources and resets renderer,
which are used for display. So after guest resumes, the display can't
come back to the status when guest is suspended.

This patch initializes virtqueue when guest is resuming to solve first
problem. And it notifies Qemu that guest is suspending to prevent Qemu
destroying resources, this is to solve second problem. And then, I can
bring the display back, and everything continues their actions after
guest resumes.

Modifications on Qemu end:
https://lore.kernel.org/qemu-devel/20230608025655.1674357-2-Jiqian.Chen@amd.com/

Jiqian Chen (1):
  virtgpu: init vq during resume and notify qemu guest status

 drivers/gpu/drm/virtio/virtgpu_debugfs.c |  1 +
 drivers/gpu/drm/virtio/virtgpu_drv.c     | 39 ++++++++++++++++++++++++
 drivers/gpu/drm/virtio/virtgpu_drv.h     |  5 +++
 drivers/gpu/drm/virtio/virtgpu_kms.c     | 36 ++++++++++++++++------
 drivers/gpu/drm/virtio/virtgpu_vq.c      | 16 ++++++++++
 include/uapi/linux/virtio_gpu.h          | 19 ++++++++++++
 6 files changed, 107 insertions(+), 9 deletions(-)

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 11:58:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 11:58:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566562.885547 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMSIt-0001zy-3q; Thu, 20 Jul 2023 11:58:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566562.885547; Thu, 20 Jul 2023 11:58:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMSIt-0001zp-13; Thu, 20 Jul 2023 11:58:43 +0000
Received: by outflank-mailman (input) for mailman id 566562;
 Thu, 20 Jul 2023 11:58:41 +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
 <SRS0=5mVk=DG=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1qMSIr-0001z3-6t
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 11:58:41 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on2060e.outbound.protection.outlook.com
 [2a01:111:f400:7eab::60e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c1eaddf4-26f4-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 13:58:37 +0200 (CEST)
Received: from BYAPR07CA0087.namprd07.prod.outlook.com (2603:10b6:a03:12b::28)
 by CY5PR12MB6599.namprd12.prod.outlook.com (2603:10b6:930:41::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Thu, 20 Jul
 2023 11:58:33 +0000
Received: from DM6NAM11FT020.eop-nam11.prod.protection.outlook.com
 (2603:10b6:a03:12b:cafe::26) by BYAPR07CA0087.outlook.office365.com
 (2603:10b6:a03:12b::28) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25 via Frontend
 Transport; Thu, 20 Jul 2023 11:58:32 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 DM6NAM11FT020.mail.protection.outlook.com (10.13.172.224) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6609.25 via Frontend Transport; Thu, 20 Jul 2023 11:58:32 +0000
Received: from cjq-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 20 Jul
 2023 06:58:26 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c1eaddf4-26f4-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=iCq//9NXjn8tb1hFLphvG4x3ueM9vr58jrk4R61oTZp8nkVyVgLaq9CcSJ43SZJhN7BWteCOotEciLAVkGfaMs5aGQBFoBdynYJzJlFFuxHuybwh6tukh+ZUvex9EBk5ibAydppkXLoue5XJSv8DVLgjMoDJt4bLeXMrwBAjFKFAB6Ljsnn2EqqbPUiViFKnHf4eauFsY8BCvd4d8XIAHLg+YmNmqTP5GKvoWH3x828C1DEOmcjnmH41iO0RIGxy/UPk8L4OoWEa8PoSLtnfj1ZvhlTFHzG6RiFyFXxNngmRcAdncwQDSxjnywrBKjue/C4kkJawjvwDonapMu2WkA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=wcZo3bf8z8SwwQG9zNxK76NSvPfAhiyEQDRvnk3eIKo=;
 b=MMSSJuoGXLjD18ssdDQdeUi51d3jOfBeAN6FINIuILA7/MrhNdtpYII+FVgi2F4xGzSAHJ0oWcZLHsDkMZsOgFYTLah1fHv19X3dhBJI2Hz/Tm2uwyxxV2Pi00LRoXQt3B3TmCD80Qq6bLXoC8DdyHp04qRcarb6uAPhK3Z0+XjdQAPk4NDtQA8a6wGqKYxRUVQ2dTLh1t2Yd22WZRdoN8KxWX5styp4WCoNXeX0AkJK4Tmf3pKNVDHH6uCCdi52dmBfaEFshYHSSWAkd/EH5SzW5qbty3MBkUGQ5dAObqPV53BoKydI+OlI+nXQ5Lwis9B5nZY8H4NZBzJbk8Oa3A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=wcZo3bf8z8SwwQG9zNxK76NSvPfAhiyEQDRvnk3eIKo=;
 b=3xM41brXrV41SQi5aGHUg4e8YBp0dtYJsjcpZuX3kZIQXTEyAPImTi8vyfN5Ow+zlDOpGLd51GYxkUKswviSkMfx+fTkB91/XAGa1HYRedKMIGXzWsC1uRhdlIkPQcIiP6jD+svfaGFiw2TxLCbolTpeP2Os2Yma88u25GGuPK4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jiqian Chen <Jiqian.Chen@amd.com>
To: David Airlie <airlied@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>,
	=?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@gmail.com>, "Gurchetan
 Singh" <gurchetansingh@chromium.org>, Chia-I Wu <olvaffe@gmail.com>, "Juergen
 Gross" <jgross@suse.com>, Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Robert Beckett <bob.beckett@collabora.com>,
	<virtualization@lists.linux-foundation.org>, <linux-kernel@vger.kernel.org>,
	<dri-devel@lists.freedesktop.org>
CC: <xen-devel@lists.xenproject.org>, Alex Deucher
	<Alexander.Deucher@amd.com>, Christian Koenig <Christian.Koenig@amd.com>,
	Stewart Hildebrand <Stewart.Hildebrand@amd.com>, Xenia Ragiadakou
	<burzalodowa@gmail.com>, Honglei Huang <Honglei1.Huang@amd.com>, Julia Zhang
	<Julia.Zhang@amd.com>, Huang Rui <Ray.Huang@amd.com>, Jiqian Chen
	<Jiqian.Chen@amd.com>
Subject: [LINUX KERNEL PATCH v3 1/1] virtgpu: init vq during resume and notify qemu guest status
Date: Thu, 20 Jul 2023 19:58:05 +0800
Message-ID: <20230720115805.8206-2-Jiqian.Chen@amd.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230720115805.8206-1-Jiqian.Chen@amd.com>
References: <20230720115805.8206-1-Jiqian.Chen@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com
 (10.181.40.145)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DM6NAM11FT020:EE_|CY5PR12MB6599:EE_
X-MS-Office365-Filtering-Correlation-Id: 70a254fa-62fe-41cb-5368-08db8918a3bf
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	m/6Q4PufneewRpaES0AJdpc9BR71BIZIvXuofHBOmrvME8bcydnYQN634iA/qn02iqsVTd+E4ttm0FuWHhJGJ6R+E0ZE6eYOqG46q3h9PYiEUfE6c1wE5/Ii9Vmxp/ZF6a6+Td/56RGOFo4AiT8pa+/gtwLf6k7otfO2cKCOFAmcnvnqyH18zPh83qSR/OrxN57zcClRHixesYDokFGDFckN5vNSPMisyAgm/ncfjybkYx58+axIZpT9IcYfIKIOElgHrpaY7gHGIMqNvQeQFws7h6pQtFrEdg0xz2coAYwUYxxz8PE+8QP/ZNRJyJR8AO8tSEmGiOc7spcwdHBFEWAU5ApQn18RrqqOjUcICtDYaCNYRrxvCIdm9RUC5sRdW8wdRpZdfawJnxuchZDZTIaU3k+OHXVFGpGGKresLr7YQUXf207QBTUfltowiEbvamRnFOIM4bbLUk+tOjdC+8Pjir3weUmUCj9yWE0NGZi7HRcJyjTTsY5quIRoEJVRbfLR/xxc/7dLFtWMVRfPuQJdD9RxcMXkx6NLAe3hQv+ggopoyPOvcWZ4SvQHAFsnFQujwie+eJ9g+3O8SeKkG3YlC9BMs+lpm25HDVD1ICWa0l+/Sm2BHzaNU352auPtdhvxlLVn5ieG3DYMSeBWsm+kVoyJROTwWFr7XYDiai0bsA/7QvTPGhLkeCH4Tl1YUus57TIhQlwsGdkMXnGr3T6TrC4VAe+Z0FNKWfDNeOvgQC9jnIaRDjbz88BREj8T2GAdTbyH6H8hVnXA3kbdkZVu6gcuC7obsUIA3SQlstY=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(376002)(346002)(39860400002)(82310400008)(451199021)(40470700004)(46966006)(36840700001)(336012)(7696005)(6666004)(26005)(186003)(70586007)(70206006)(316002)(4326008)(40480700001)(41300700001)(1076003)(16526019)(5660300002)(54906003)(110136005)(478600001)(7416002)(8936002)(8676002)(2616005)(356005)(47076005)(426003)(921005)(40460700003)(83380400001)(36860700001)(30864003)(2906002)(81166007)(82740400003)(36756003)(86362001)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 11:58:32.1721
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 70a254fa-62fe-41cb-5368-08db8918a3bf
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DM6NAM11FT020.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6599

This patch solves two problem:

First, when we suspended guest VM, it called into Qemu to call
virtio_reset->__virtio_queue_reset, this cleared all virtuqueue
information of virtgpu on Qemu end. As a result, after guest
resumed, guest sended ctrl/cursor requests to Qemu through
virtqueue, but Qemu can't get requests from the virtqueue now.
In function virtio_queue_notify, vq->vring.desc is NULL.

So, this patch add freeze and restore function for virtgpu driver.
In freeze function, it flushes all virtqueue works and deletes
virtqueues. In restore function, it initializes virtqueues. And
then, Qemu and guest can communicate normally.

Second, when we suspended guest VM, it called into Qemu to call
virtio_reset->virtio_gpu_gl_reset, this destroyed resources and
reset renderer which were used for display. As a result, after
guest resumed, the display can't come back and we only saw a black
screen.

So, this patch add a new ctrl message VIRTIO_GPU_CMD_SET_FREEZE_MODE.
When guest is during suspending, we set freeze mode to freeze_S3 to
notify Qemu that guest entered suspending, and then Qemu will not
destroy resources. When guest is during resuming, we set freeze mode
to unfreeze to notify Qemu that guest exited suspending, and then
Qemu will keep its origin actions. As a result, the display can come
back and everything of guest can come back to the time when guest
was suspended.

Due to this implemention needs cooperation with host Qemu, so it
added a new feature flag VIRTIO_GPU_F_FREEZE_S3, so that guest and
host can negotiate whenever freeze_S3 is supported or not.

Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
---
 drivers/gpu/drm/virtio/virtgpu_debugfs.c |  1 +
 drivers/gpu/drm/virtio/virtgpu_drv.c     | 39 ++++++++++++++++++++++++
 drivers/gpu/drm/virtio/virtgpu_drv.h     |  5 +++
 drivers/gpu/drm/virtio/virtgpu_kms.c     | 36 ++++++++++++++++------
 drivers/gpu/drm/virtio/virtgpu_vq.c      | 16 ++++++++++
 include/uapi/linux/virtio_gpu.h          | 19 ++++++++++++
 6 files changed, 107 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_debugfs.c b/drivers/gpu/drm/virtio/virtgpu_debugfs.c
index 853dd9aa397e..c84fd6d7f5f3 100644
--- a/drivers/gpu/drm/virtio/virtgpu_debugfs.c
+++ b/drivers/gpu/drm/virtio/virtgpu_debugfs.c
@@ -55,6 +55,7 @@ static int virtio_gpu_features(struct seq_file *m, void *data)
 
 	virtio_gpu_add_bool(m, "blob resources", vgdev->has_resource_blob);
 	virtio_gpu_add_bool(m, "context init", vgdev->has_context_init);
+	virtio_gpu_add_bool(m, "freeze_S3", vgdev->has_freeze_S3);
 	virtio_gpu_add_int(m, "cap sets", vgdev->num_capsets);
 	virtio_gpu_add_int(m, "scanouts", vgdev->num_scanouts);
 	if (vgdev->host_visible_region.len) {
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
index add075681e18..83ad0ac82b94 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
@@ -130,6 +130,40 @@ static void virtio_gpu_config_changed(struct virtio_device *vdev)
 	schedule_work(&vgdev->config_changed_work);
 }
 
+#ifdef CONFIG_PM
+static int virtio_gpu_freeze(struct virtio_device *dev)
+{
+	struct drm_device *ddev = dev->priv;
+	struct virtio_gpu_device *vgdev = ddev->dev_private;
+	int ret = 0;
+
+	if (vgdev->has_freeze_S3) {
+		ret = virtio_gpu_cmd_set_freeze_mode(vgdev,
+					VIRTIO_GPU_FREEZE_MODE_FREEZE_S3);
+	}
+	if (!ret) {
+		flush_work(&vgdev->ctrlq.dequeue_work);
+		flush_work(&vgdev->cursorq.dequeue_work);
+		vgdev->vdev->config->del_vqs(vgdev->vdev);
+	}
+	return ret;
+}
+
+static int virtio_gpu_restore(struct virtio_device *dev)
+{
+	struct drm_device *ddev = dev->priv;
+	struct virtio_gpu_device *vgdev = ddev->dev_private;
+	int ret;
+
+	ret = virtio_gpu_init_vqs(dev);
+	if (!ret && vgdev->has_freeze_S3) {
+		ret = virtio_gpu_cmd_set_freeze_mode(vgdev,
+					VIRTIO_GPU_FREEZE_MODE_UNFREEZE);
+	}
+	return ret;
+}
+#endif
+
 static struct virtio_device_id id_table[] = {
 	{ VIRTIO_ID_GPU, VIRTIO_DEV_ANY_ID },
 	{ 0 },
@@ -148,6 +182,7 @@ static unsigned int features[] = {
 	VIRTIO_GPU_F_RESOURCE_UUID,
 	VIRTIO_GPU_F_RESOURCE_BLOB,
 	VIRTIO_GPU_F_CONTEXT_INIT,
+	VIRTIO_GPU_F_FREEZE_S3,
 };
 static struct virtio_driver virtio_gpu_driver = {
 	.feature_table = features,
@@ -156,6 +191,10 @@ static struct virtio_driver virtio_gpu_driver = {
 	.driver.owner = THIS_MODULE,
 	.id_table = id_table,
 	.probe = virtio_gpu_probe,
+#ifdef CONFIG_PM
+	.freeze = virtio_gpu_freeze,
+	.restore = virtio_gpu_restore,
+#endif
 	.remove = virtio_gpu_remove,
 	.config_changed = virtio_gpu_config_changed
 };
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h
index 4126c384286b..231b5a6138b2 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.h
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.h
@@ -246,6 +246,7 @@ struct virtio_gpu_device {
 	bool has_resource_blob;
 	bool has_host_visible;
 	bool has_context_init;
+	bool has_freeze_S3;
 	struct virtio_shm_region host_visible_region;
 	struct drm_mm host_visible_mm;
 
@@ -282,6 +283,7 @@ extern struct drm_ioctl_desc virtio_gpu_ioctls[DRM_VIRTIO_NUM_IOCTLS];
 void virtio_gpu_create_context(struct drm_device *dev, struct drm_file *file);
 
 /* virtgpu_kms.c */
+int virtio_gpu_init_vqs(struct virtio_device *vdev);
 int virtio_gpu_init(struct virtio_device *vdev, struct drm_device *dev);
 void virtio_gpu_deinit(struct drm_device *dev);
 void virtio_gpu_release(struct drm_device *dev);
@@ -425,6 +427,9 @@ virtio_gpu_cmd_set_scanout_blob(struct virtio_gpu_device *vgdev,
 				uint32_t width, uint32_t height,
 				uint32_t x, uint32_t y);
 
+int virtio_gpu_cmd_set_freeze_mode(struct virtio_gpu_device *vgdev,
+				virtio_gpu_freeze_mode_t freeze_mode);
+
 /* virtgpu_display.c */
 int virtio_gpu_modeset_init(struct virtio_gpu_device *vgdev);
 void virtio_gpu_modeset_fini(struct virtio_gpu_device *vgdev);
diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c
index 5a3b5aaed1f3..a762a762f907 100644
--- a/drivers/gpu/drm/virtio/virtgpu_kms.c
+++ b/drivers/gpu/drm/virtio/virtgpu_kms.c
@@ -114,16 +114,33 @@ static void virtio_gpu_get_capsets(struct virtio_gpu_device *vgdev,
 	vgdev->num_capsets = num_capsets;
 }
 
-int virtio_gpu_init(struct virtio_device *vdev, struct drm_device *dev)
+int virtio_gpu_init_vqs(struct virtio_device *vdev)
 {
 	static vq_callback_t *callbacks[] = {
 		virtio_gpu_ctrl_ack, virtio_gpu_cursor_ack
 	};
 	static const char * const names[] = { "control", "cursor" };
+	struct drm_device *dev = vdev->priv;
+	struct virtio_gpu_device *vgdev = dev->dev_private;
+	struct virtqueue *vqs[2];
+	int ret;
+
+	virtio_gpu_init_vq(&vgdev->ctrlq, virtio_gpu_dequeue_ctrl_func);
+	virtio_gpu_init_vq(&vgdev->cursorq, virtio_gpu_dequeue_cursor_func);
+
+	ret = virtio_find_vqs(vgdev->vdev, 2, vqs, callbacks, names, NULL);
+	if (ret) {
+		DRM_ERROR("failed to find virt queues\n");
+		return ret;
+	}
+	vgdev->ctrlq.vq = vqs[0];
+	vgdev->cursorq.vq = vqs[1];
+	return 0;
+}
 
+int virtio_gpu_init(struct virtio_device *vdev, struct drm_device *dev)
+{
 	struct virtio_gpu_device *vgdev;
-	/* this will expand later */
-	struct virtqueue *vqs[2];
 	u32 num_scanouts, num_capsets;
 	int ret = 0;
 
@@ -144,8 +161,6 @@ int virtio_gpu_init(struct virtio_device *vdev, struct drm_device *dev)
 	ida_init(&vgdev->ctx_id_ida);
 	ida_init(&vgdev->resource_ida);
 	init_waitqueue_head(&vgdev->resp_wq);
-	virtio_gpu_init_vq(&vgdev->ctrlq, virtio_gpu_dequeue_ctrl_func);
-	virtio_gpu_init_vq(&vgdev->cursorq, virtio_gpu_dequeue_cursor_func);
 
 	vgdev->fence_drv.context = dma_fence_context_alloc(1);
 	spin_lock_init(&vgdev->fence_drv.lock);
@@ -197,6 +212,9 @@ int virtio_gpu_init(struct virtio_device *vdev, struct drm_device *dev)
 	if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_CONTEXT_INIT)) {
 		vgdev->has_context_init = true;
 	}
+	if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_FREEZE_S3)) {
+		vgdev->has_freeze_S3 = true;
+	}
 
 	DRM_INFO("features: %cvirgl %cedid %cresource_blob %chost_visible",
 		 vgdev->has_virgl_3d    ? '+' : '-',
@@ -207,13 +225,13 @@ int virtio_gpu_init(struct virtio_device *vdev, struct drm_device *dev)
 	DRM_INFO("features: %ccontext_init\n",
 		 vgdev->has_context_init ? '+' : '-');
 
-	ret = virtio_find_vqs(vgdev->vdev, 2, vqs, callbacks, names, NULL);
+	DRM_INFO("features: %cfreeze_S3\n",
+		 vgdev->has_freeze_S3 ? '+' : '-');
+
+	ret = virtio_gpu_init_vqs(vdev);
 	if (ret) {
-		DRM_ERROR("failed to find virt queues\n");
 		goto err_vqs;
 	}
-	vgdev->ctrlq.vq = vqs[0];
-	vgdev->cursorq.vq = vqs[1];
 	ret = virtio_gpu_alloc_vbufs(vgdev);
 	if (ret) {
 		DRM_ERROR("failed to alloc vbufs\n");
diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c
index b1a00c0c25a7..74b34951e4fa 100644
--- a/drivers/gpu/drm/virtio/virtgpu_vq.c
+++ b/drivers/gpu/drm/virtio/virtgpu_vq.c
@@ -1302,3 +1302,19 @@ void virtio_gpu_cmd_set_scanout_blob(struct virtio_gpu_device *vgdev,
 
 	virtio_gpu_queue_ctrl_buffer(vgdev, vbuf);
 }
+
+int virtio_gpu_cmd_set_freeze_mode(struct virtio_gpu_device *vgdev,
+				virtio_gpu_freeze_mode_t freeze_mode)
+{
+	struct virtio_gpu_set_freeze_mode *cmd_p;
+	struct virtio_gpu_vbuffer *vbuf;
+
+	cmd_p = virtio_gpu_alloc_cmd(vgdev, &vbuf, sizeof(*cmd_p));
+	memset(cmd_p, 0, sizeof(*cmd_p));
+
+	cmd_p->hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_SET_FREEZE_MODE);
+	cmd_p->freeze_mode = freeze_mode;
+	virtio_gpu_queue_ctrl_buffer(vgdev, vbuf);
+	virtio_gpu_notify(vgdev);
+	return 0;
+}
\ No newline at end of file
diff --git a/include/uapi/linux/virtio_gpu.h b/include/uapi/linux/virtio_gpu.h
index f556fde07b76..21ca87bf7417 100644
--- a/include/uapi/linux/virtio_gpu.h
+++ b/include/uapi/linux/virtio_gpu.h
@@ -65,6 +65,11 @@
  */
 #define VIRTIO_GPU_F_CONTEXT_INIT        4
 
+/*
+ * VIRTIO_GPU_CMD_SET_FREEZE_MODE
+ */
+#define VIRTIO_GPU_F_FREEZE_S3            5
+
 enum virtio_gpu_ctrl_type {
 	VIRTIO_GPU_UNDEFINED = 0,
 
@@ -100,6 +105,9 @@ enum virtio_gpu_ctrl_type {
 	VIRTIO_GPU_CMD_UPDATE_CURSOR = 0x0300,
 	VIRTIO_GPU_CMD_MOVE_CURSOR,
 
+	/* freeze mode */
+	VIRTIO_GPU_CMD_SET_FREEZE_MODE = 0x0400,
+
 	/* success responses */
 	VIRTIO_GPU_RESP_OK_NODATA = 0x1100,
 	VIRTIO_GPU_RESP_OK_DISPLAY_INFO,
@@ -453,4 +461,15 @@ struct virtio_gpu_resource_unmap_blob {
 	__le32 padding;
 };
 
+/* VIRTIO_GPU_CMD_SET_FREEZE_MODE */
+typedef enum {
+	VIRTIO_GPU_FREEZE_MODE_UNFREEZE = 0,
+	VIRTIO_GPU_FREEZE_MODE_FREEZE_S3 = 3,
+} virtio_gpu_freeze_mode_t;
+
+struct virtio_gpu_set_freeze_mode {
+	struct virtio_gpu_ctrl_hdr hdr;
+	virtio_gpu_freeze_mode_t freeze_mode;
+};
+
 #endif
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 12:08:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 12:08:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566569.885556 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMSSa-0004IY-5a; Thu, 20 Jul 2023 12:08:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566569.885556; Thu, 20 Jul 2023 12:08:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMSSa-0004IR-2n; Thu, 20 Jul 2023 12:08:44 +0000
Received: by outflank-mailman (input) for mailman id 566569;
 Thu, 20 Jul 2023 12:08:43 +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
 <SRS0=5mVk=DG=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1qMSSZ-0004IL-94
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 12:08:43 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on20624.outbound.protection.outlook.com
 [2a01:111:f400:fe5b::624])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2a251b6b-26f6-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 14:08:40 +0200 (CEST)
Received: from SJ0PR13CA0156.namprd13.prod.outlook.com (2603:10b6:a03:2c7::11)
 by DM4PR12MB6088.namprd12.prod.outlook.com (2603:10b6:8:af::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 12:08:36 +0000
Received: from CO1NAM11FT074.eop-nam11.prod.protection.outlook.com
 (2603:10b6:a03:2c7:cafe::2c) by SJ0PR13CA0156.outlook.office365.com
 (2603:10b6:a03:2c7::11) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.20 via Frontend
 Transport; Thu, 20 Jul 2023 12:08:36 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1NAM11FT074.mail.protection.outlook.com (10.13.174.254) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6609.28 via Frontend Transport; Thu, 20 Jul 2023 12:08:36 +0000
Received: from cjq-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 20 Jul
 2023 07:08:31 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2a251b6b-26f6-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=bx+iNGstkIYsdm93IjChgam34Y741kYWQYAs5b1ZvWM+9Fg80nvtp+R0k/3yYHsxjMS+0mNVF/oIo5ovwrktWcj90k7thQnjVnETfqRFdRW6sxZwkjCxfIryiUfoGW7W9DSV26wPZR2wmj799PqPVjYywORUX2sj8plw4nt4mc8TJw+CCWBc5oLXo5wkDM2A901cOR+ZyNBIA3uGdZvokYX3bBNRupqMmUHDNkGFEcUuYQGWfEQ55ZG/rIwPTGli5nvkzqqtuKYkYGZWWpZ3o7huEsjOppL/XVIfZSk1urDPc4xC/0W4PK6+3z+i3cbZW0WLPdPxjE03O+1fCijuvA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=sQ9pj/iaxuUff0x3bnr1X9IpLfVr35JpB2JPJTt6P9c=;
 b=RxGAQrAtoAAP/NWWlV3mLMZpP5WP8OXV/NTUnygIajKL+9NuxlFW/93f/jmv8jisCANIu7tntTutCFP/SdNsyseASUMZZnjcKT4MJdqGjbkjx+ffMHRJY8FZEwVR0xrEWHhwzjjCB7oRK/krqnxgVXmLQ4cYg4nkb+I2UF5VOuzaH0BNz0RV67SGbz/iPmVxitf9qohVxP2zquvdq0Cx/nvd4RetWkSeV4tt+D9IFeDhUszkfclxCtTEue9QTLDQ1psS3htYdsEvifnbfdEJKX+2MV+CKb3Amrtkbz6TgWeAJhrzrgF19CETEqbkznwlpyCrK6Bpm/H/RX/2+pkgrg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=sQ9pj/iaxuUff0x3bnr1X9IpLfVr35JpB2JPJTt6P9c=;
 b=fhDPD2QBwgYspP3RarJbzRnOWvdbgccilado6ER2rdk4UUXDLAjb913Fj0gleQcZ+5la7Jr6FGPzpBO3IKHFbYLkfE1D1S0X4cHrUKyDcxWfcxrNyvUID2RvkwHS5DhZ9tBVxlRN9HLQiW8ExQX3rlz9kRV+SSxkP+wE09KgjUY=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jiqian Chen <Jiqian.Chen@amd.com>
To: Gerd Hoffmann <kraxel@redhat.com>, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?=
	<marcandre.lureau@gmail.com>, "Michael S . Tsirkin" <mst@redhat.com>, "Robert
 Beckett" <bob.beckett@collabora.com>, <qemu-devel@nongnu.org>
CC: <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Anthony PERARD <anthony.perard@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>, "Dr . David Alan
 Gilbert" <dgilbert@redhat.com>, Alex Deucher <Alexander.Deucher@amd.com>,
	Christian Koenig <Christian.Koenig@amd.com>, Stewart Hildebrand
	<Stewart.Hildebrand@amd.com>, Xenia Ragiadakou <burzalodowa@gmail.com>,
	Honglei Huang <Honglei1.Huang@amd.com>, Julia Zhang <Julia.Zhang@amd.com>,
	Huang Rui <Ray.Huang@amd.com>, Jiqian Chen <Jiqian.Chen@amd.com>
Subject: [QEMU PATCH v4 0/1] S3 support
Date: Thu, 20 Jul 2023 20:08:15 +0800
Message-ID: <20230720120816.8751-1-Jiqian.Chen@amd.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com
 (10.181.40.145)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1NAM11FT074:EE_|DM4PR12MB6088:EE_
X-MS-Office365-Filtering-Correlation-Id: cc098db3-75fb-406a-111c-08db891a0bf3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	33wYTmt0JEQfT4p2Tho6l7PnBKGlFvsyDyL+Ln74JnKl3fjDs+C7a1KpWoXmD5+q1tXv04mt897X/36lJVSfUhiJBd4U1FpodRu+0K1Q+SK3w2Mj7XZjhstbCPu0SoYRVAs+sfkLznZmRN4Ah+jC9k8WCx+u/DKdXRfnuQFvHPK55GDVzN3gfUa8dtp+EAXl5iYcVg9EEaAWuNi9ra1MZMaTlIJcbYUsUpPrbyDwI9oA+tEK/yofBr+8ExmO1ODYJxspyveDH/8LHpxpNPoArcNXsizG2klsbxPxcvpAhrgey3QtzEm4I9pzGyk22/8ippoP/V6BJffXtnwt23tWiAJ96FfnyFFBtRNZykxYmQudg2apolTw1D90VfWCAmXRG5U+DMz1QKFYuQd9YQ9Rr/6zWCNQXrTr1y6Q1hTFpkZKcXouAF12jws/UeG0KLA/wZzCe9Xmsb5oBDTDNBP/83bB02HhGGIr803SW2rr/mlfGXYt0aiqyQPnVD5NJ8USrKyn4vcx/4whpNheEq12em/XgfJObN0LFOTxEAkdeqm3AsX8ena1JACtec3VNgt8sZrhKPhQltM9JjICUwXsrnDB0R7KavBjuvSRVXcuzhY36NJSPGSxIFfkcr3JVkvG+xxwd4vYnX4s8H64+qM7jRxL57rOPKo5KNtZfG2iozdnBcJ9w1VqjeB2nvAHe7ETHZYGom4Md9XTGsbz6c0gO0pi8VGNmj8hpw3m8wZtV1RkivDg9oKeJNa3VY1obSJ1YlFQnlclZNgvz65Rz+G+DwwoQqm9XOvrxlCFCbQ6pA0=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(39860400002)(396003)(346002)(82310400008)(451199021)(46966006)(40470700004)(36840700001)(36860700001)(40460700003)(8676002)(8936002)(86362001)(426003)(47076005)(36756003)(2906002)(2616005)(41300700001)(83380400001)(40480700001)(26005)(5660300002)(336012)(186003)(1076003)(16526019)(7416002)(70206006)(70586007)(4326008)(7696005)(82740400003)(110136005)(356005)(6666004)(54906003)(966005)(316002)(81166007)(478600001)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 12:08:36.4284
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: cc098db3-75fb-406a-111c-08db891a0bf3
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1NAM11FT074.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6088

v4:

Hi all,
Thanks for Gerd Hoffmann's advice. V4 makes below changes:
* Use enum for freeze mode, so this can be extended with more
  modes in the future.
* Rename functions and paratemers with "_S3" postfix.
And no functional changes.

latest version on kernel side:
https://lore.kernel.org/lkml/20230720115805.8206-1-Jiqian.Chen@amd.com/T/#t

Best regards,
Jiqian Chen.


v3:
link,
https://lore.kernel.org/qemu-devel/20230719074726.1613088-1-Jiqian.Chen@amd.com/T/#t

Hi all,
Thanks for Michael S. Tsirkin's advice. V3 makes below changes:
* Remove changes in file include/standard-headers/linux/virtio_gpu.h
  I am not supposed to edit this file and it will be imported after
  the patches of linux kernel was merged.


v2:
link,
https://lore.kernel.org/qemu-devel/20230630070016.841459-1-Jiqian.Chen@amd.com/T/#t

Hi all,
Thanks to Marc-AndrÃ© Lureau, Robert Beckett and Gerd Hoffmann for
their advice and guidance. V2 makes below changes:

* Change VIRTIO_CPU_CMD_STATUS_FREEZING to 0x0400 (<0x1000)
* Add virtio_gpu_device_unrealize to destroy resources to solve
  potential memory leak problem. This also needs hot-plug support.
* Add a new feature flag VIRTIO_GPU_F_FREEZING, so that guest and
  host can negotiate whenever freezing is supported or not.

v1:
link,
https://lore.kernel.org/qemu-devel/20230608025655.1674357-1-Jiqian.Chen@amd.com/

Hi all,
I am working to implement virtgpu S3 function on Xen.

Currently on Xen, if we start a guest who enables virtgpu, and then
run "echo mem > /sys/power/state" to suspend guest. And run
"sudo xl trigger <guest id> s3resume" to resume guest. We can find that
the guest kernel comes back, but the display doesn't. It just shown a
black screen.

Through reading codes, I founded that when guest was during suspending,
it called into Qemu to call virtio_gpu_gl_reset. In virtio_gpu_gl_reset,
it destroyed all resources and reset renderer. This made the display
gone after guest resumed.

I think we should keep resources or prevent they being destroyed when
guest is suspending. So, I add a new status named freezing to virtgpu,
and add a new ctrl message VIRTIO_GPU_CMD_STATUS_FREEZING to get
notification from guest. If freezing is set to true, and then Qemu will
realize that guest is suspending, it will not destroy resources and will
not reset renderer. If freezing is set to false, Qemu will do its origin
actions, and has no other impaction.

And now, display can come back and applications can continue their
status after guest resumes.

Jiqian Chen (1):
  virtgpu: do not destroy resources when guest suspend

 hw/display/virtio-gpu-base.c   |  3 ++
 hw/display/virtio-gpu-gl.c     | 10 ++++++-
 hw/display/virtio-gpu-virgl.c  |  7 +++++
 hw/display/virtio-gpu.c        | 55 ++++++++++++++++++++++++++++++++--
 hw/virtio/virtio.c             |  3 ++
 include/hw/virtio/virtio-gpu.h |  6 ++++
 6 files changed, 81 insertions(+), 3 deletions(-)

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 12:08:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 12:08:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566570.885567 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMSSj-0004Zm-Cc; Thu, 20 Jul 2023 12:08:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566570.885567; Thu, 20 Jul 2023 12:08:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMSSj-0004Zf-9p; Thu, 20 Jul 2023 12:08:53 +0000
Received: by outflank-mailman (input) for mailman id 566570;
 Thu, 20 Jul 2023 12:08:52 +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
 <SRS0=5mVk=DG=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1qMSSh-0004IL-U2
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 12:08:52 +0000
Received: from NAM02-SN1-obe.outbound.protection.outlook.com
 (mail-sn1nam02on20607.outbound.protection.outlook.com
 [2a01:111:f400:7ea9::607])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2ecfa3b6-26f6-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 14:08:49 +0200 (CEST)
Received: from MW3PR06CA0005.namprd06.prod.outlook.com (2603:10b6:303:2a::10)
 by SJ0PR12MB6759.namprd12.prod.outlook.com (2603:10b6:a03:44b::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Thu, 20 Jul
 2023 12:08:41 +0000
Received: from CO1NAM11FT108.eop-nam11.prod.protection.outlook.com
 (2603:10b6:303:2a:cafe::44) by MW3PR06CA0005.outlook.office365.com
 (2603:10b6:303:2a::10) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20 via Frontend
 Transport; Thu, 20 Jul 2023 12:08:41 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1NAM11FT108.mail.protection.outlook.com (10.13.175.226) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6588.34 via Frontend Transport; Thu, 20 Jul 2023 12:08:41 +0000
Received: from cjq-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 20 Jul
 2023 07:08:36 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2ecfa3b6-26f6-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Wv/vP5fJoQUUG85kjDRgI4xLWpu3IFwMh71uXQBSIGXonUsAha6h6VnjkV1domcETkFF333vKLcapmSr0Xbtnv4FMDvt6hfkJfEjt2/NoCq/Qn9oVPQzjlqk0gN3GhBqwRrxKwmE+6qRDm5SMn1lmHQQefRARdW5e10VTrry3q6XNoIe8iZ8W02e3MPpQ+3qnieSd/v7ncn9b9AzWqobzTrG6eAE6dgH3B47WMwx+640u3pP+/iweF1IzXmCBCwCf6gs3JEUMsMJ7Aj1nZdn/7ux+cWONCqyno8Hjuyj5otLFlVFb4DvjT3pqu+nfQ4cv1tOXx0CzXZDX+qrekgd+Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/2nnIzFAg5lffgYdIkGPf2VATfRWsO0f+lxrVhiSw00=;
 b=GwvAlVIbDlHKuR3mLgeISOneSAm3+hPhEHZK0KsQkNRSMykSN6smo1XPTITrk0713/0IEbEuMbsEYtbc+oDAruN7C0mVgmYsO1DfN1dYXJawVB69D8XxgFEsJVLkz66TxyLBQ/R39BPRvTDl3uW8ZRHGLNqPEiQOVBAb5ZiIQ1BqqzIEsme1oFeDVYgCmTrOtGVK+xxo3cRfsm+1aKP+E4b1bTjtOXmccs6PGIbtH/bZRJQS0y4AmbZk4ULftI964Sgbn5XaNitsr+K06dCkDnea9A2sRzoqQfH3HRsEp2To8yXpHo9GIANtYh+VNAt84w75wJiguWEsPRfFD6sYGw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/2nnIzFAg5lffgYdIkGPf2VATfRWsO0f+lxrVhiSw00=;
 b=X2/DGAlTg4kfcBGC6UaO5nhV4i4vKwG/6L3Ny5sBSLiPGazriJV9SaYAXi8ibAPQf75f/GDuuKmT/GkCwudU+O50lkSCtd3h/zKttg+lAutulRbhAP+ntymzSbrIAqcndYQ2xA/5iQ45vOxGBSFmm4zReryv/yEIp7s3gFxyOS4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jiqian Chen <Jiqian.Chen@amd.com>
To: Gerd Hoffmann <kraxel@redhat.com>, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?=
	<marcandre.lureau@gmail.com>, "Michael S . Tsirkin" <mst@redhat.com>, "Robert
 Beckett" <bob.beckett@collabora.com>, <qemu-devel@nongnu.org>
CC: <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Anthony PERARD <anthony.perard@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>, "Dr . David Alan
 Gilbert" <dgilbert@redhat.com>, Alex Deucher <Alexander.Deucher@amd.com>,
	Christian Koenig <Christian.Koenig@amd.com>, Stewart Hildebrand
	<Stewart.Hildebrand@amd.com>, Xenia Ragiadakou <burzalodowa@gmail.com>,
	Honglei Huang <Honglei1.Huang@amd.com>, Julia Zhang <Julia.Zhang@amd.com>,
	Huang Rui <Ray.Huang@amd.com>, Jiqian Chen <Jiqian.Chen@amd.com>
Subject: [QEMU PATCH v4 1/1] virtgpu: do not destroy resources when guest suspend
Date: Thu, 20 Jul 2023 20:08:16 +0800
Message-ID: <20230720120816.8751-2-Jiqian.Chen@amd.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230720120816.8751-1-Jiqian.Chen@amd.com>
References: <20230720120816.8751-1-Jiqian.Chen@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com
 (10.181.40.145)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1NAM11FT108:EE_|SJ0PR12MB6759:EE_
X-MS-Office365-Filtering-Correlation-Id: 3979add2-85d1-4123-2c6d-08db891a0ec0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	TF5z2fHXpX3G1PUvhTgnKFcm7zBBlcAfMCjwljsCBLPmS2vC6EK5OGnuLlXVcxtfxdhWb2YPOErx5b7TVO6Ji1x/EdknXN/t7r7jaHW2i2eCkVF/+W5lYMzb0VbReNvxHJq+xWrgSKWfIm/qcYCTNvYqdvmf84fu+2NX8cs0Bg3UMYoRrzgu3eajLsCEG5qYtao6+Q48vv9vSOHkc5Zo2RQ/PNl2m9fGvBGBciVEdntGmbNkLlvwYgPRaAD6cWi+0II7HcTZbAqctywaMf74lyMpWB+yioDFO8X2XUEaB6J+UgBXNq5CwJMjjsQK+7e2awudwxPTcf87vMvyMUfnUZaeJ0IgP67CqCpvRaCXvtLuQRRN4TWBttiC758i3u5qULMXOxgLtjs8v6SQwsmm4ye9LL3Wvod95MYtUwXlO9Wcrz+evbHaf00SoKkCHUjab/h2B39FhKS8a6kV564h6LLzd1ODs89hT49NCPs3IuKPPKfPJSUjMFk6PsGgJgs/Pe/a0FNd1++cPkdc6lCFgHDp1wfVY4ndbmcvowXSzWgISckBgWhAspuMghWPJxB1hMv4sbrxcuTL2aDms6Zl7jB3l4yUi/C2vkUE1Jheo70+vzfqCRC5s7X0d/qMWPfF/Vatt2+XbKzlvarVBgl2gvH97Vwq1QSf5GWJ8LxGt+wwuB2pheZnbA5SPWl8p1fHprsqmeVlMhajUy8f9yaxVmBVV2rARclk/dAy0pP6K1qmAxfWAVvfTwJ2EARgriHzYt7Com6rE2uLfwAyXhJl3g==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(346002)(376002)(396003)(451199021)(82310400008)(46966006)(36840700001)(40470700004)(40480700001)(356005)(82740400003)(86362001)(81166007)(36756003)(47076005)(2906002)(426003)(8936002)(478600001)(8676002)(7416002)(2616005)(36860700001)(40460700003)(83380400001)(5660300002)(6666004)(7696005)(16526019)(15650500001)(1076003)(186003)(26005)(336012)(54906003)(316002)(4326008)(110136005)(70206006)(70586007)(41300700001)(36900700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 12:08:41.1281
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 3979add2-85d1-4123-2c6d-08db891a0ec0
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1NAM11FT108.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6759

After suspending and resuming guest VM, you will get
a black screen, and the display can't come back.

This is because when guest did suspending, it called
into qemu to call virtio_gpu_gl_reset. In function
virtio_gpu_gl_reset, it destroyed resources and reset
renderer, which were used for display. As a result,
guest's screen can't come back to the time when it was
suspended and only showed black.

So, this patch adds a new ctrl message
VIRTIO_GPU_CMD_SET_FREEZE_MODE to get notifications from
guest. If guest is during suspending, it sets freeze mode
of virtgpu to freeze_S3, this will prevent destroying
resources and resetting renderer when guest calls into
virtio_gpu_gl_reset. If guest is during resuming, it sets
freeze mode to unfreeze, and then virtio_gpu_gl_reset
will keep its origin actions and has no other impaction.

Due to this implemention needs cooperation with guest,
so it added a new feature flag VIRTIO_GPU_F_FREEZE_S3, so
that guest and host can negotiate whenever freeze_S3 is
supported or not.

Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
---
 hw/display/virtio-gpu-base.c   |  3 ++
 hw/display/virtio-gpu-gl.c     | 10 ++++++-
 hw/display/virtio-gpu-virgl.c  |  7 +++++
 hw/display/virtio-gpu.c        | 55 ++++++++++++++++++++++++++++++++--
 hw/virtio/virtio.c             |  3 ++
 include/hw/virtio/virtio-gpu.h |  6 ++++
 6 files changed, 81 insertions(+), 3 deletions(-)

diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c
index a29f191aa8..40ae4f9678 100644
--- a/hw/display/virtio-gpu-base.c
+++ b/hw/display/virtio-gpu-base.c
@@ -215,6 +215,9 @@ virtio_gpu_base_get_features(VirtIODevice *vdev, uint64_t features,
     if (virtio_gpu_blob_enabled(g->conf)) {
         features |= (1 << VIRTIO_GPU_F_RESOURCE_BLOB);
     }
+    if (virtio_gpu_freeze_S3_enabled(g->conf)) {
+        features |= (1 << VIRTIO_GPU_F_FREEZE_S3);
+    }
 
     return features;
 }
diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c
index e06be60dfb..cb418dae9a 100644
--- a/hw/display/virtio-gpu-gl.c
+++ b/hw/display/virtio-gpu-gl.c
@@ -100,7 +100,15 @@ static void virtio_gpu_gl_reset(VirtIODevice *vdev)
      */
     if (gl->renderer_inited && !gl->renderer_reset) {
         virtio_gpu_virgl_reset_scanout(g);
-        gl->renderer_reset = true;
+        /*
+         * If guest is suspending, we shouldn't reset renderer,
+         * otherwise, the display can't come back to the time when
+         * it was suspended after guest was resumed.
+         */
+        if (!virtio_gpu_freeze_S3_enabled(g->parent_obj.conf) ||
+            g->freeze_mode == VIRTIO_GPU_FREEZE_MODE_UNFREEZE) {
+            gl->renderer_reset = true;
+        }
     }
 }
 
diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c
index 73cb92c8d5..fc1971be70 100644
--- a/hw/display/virtio-gpu-virgl.c
+++ b/hw/display/virtio-gpu-virgl.c
@@ -464,6 +464,13 @@ void virtio_gpu_virgl_process_cmd(VirtIOGPU *g,
     case VIRTIO_GPU_CMD_GET_EDID:
         virtio_gpu_get_edid(g, cmd);
         break;
+    case VIRTIO_GPU_CMD_SET_FREEZE_MODE:
+        if (virtio_gpu_freeze_S3_enabled(g->parent_obj.conf)) {
+            virtio_gpu_cmd_set_freeze_mode(g, cmd);
+        } else {
+            cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER;
+        }
+        break;
     default:
         cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
         break;
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 5e15c79b94..dcf83379a8 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -373,6 +373,16 @@ static void virtio_gpu_resource_create_blob(VirtIOGPU *g,
     QTAILQ_INSERT_HEAD(&g->reslist, res, next);
 }
 
+void virtio_gpu_cmd_set_freeze_mode(VirtIOGPU *g,
+                         struct virtio_gpu_ctrl_command *cmd)
+{
+    struct virtio_gpu_set_freeze_mode sf;
+
+    VIRTIO_GPU_FILL_CMD(sf);
+    virtio_gpu_bswap_32(&sf, sizeof(sf));
+    g->freeze_mode = sf.freeze_mode;
+}
+
 static void virtio_gpu_disable_scanout(VirtIOGPU *g, int scanout_id)
 {
     struct virtio_gpu_scanout *scanout = &g->parent_obj.scanout[scanout_id];
@@ -986,6 +996,13 @@ void virtio_gpu_simple_process_cmd(VirtIOGPU *g,
     case VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING:
         virtio_gpu_resource_detach_backing(g, cmd);
         break;
+    case VIRTIO_GPU_CMD_SET_FREEZE_MODE:
+        if (virtio_gpu_freeze_S3_enabled(g->parent_obj.conf)) {
+            virtio_gpu_cmd_set_freeze_mode(g, cmd);
+        } else {
+            cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER;
+        }
+        break;
     default:
         cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
         break;
@@ -1344,6 +1361,29 @@ void virtio_gpu_device_realize(DeviceState *qdev, Error **errp)
     QTAILQ_INIT(&g->reslist);
     QTAILQ_INIT(&g->cmdq);
     QTAILQ_INIT(&g->fenceq);
+
+    g->freeze_mode = VIRTIO_GPU_FREEZE_MODE_UNFREEZE;
+}
+
+static void virtio_gpu_device_unrealize(DeviceState *qdev)
+{
+    VirtIOGPU *g = VIRTIO_GPU(qdev);
+    struct virtio_gpu_simple_resource *res, *tmp;
+
+    /*
+     * This is to prevent memory leak in the situation that qemu is
+     * destroyed when guest is suspended. This also need hot-plug
+     * support.
+     */
+    if (virtio_gpu_freeze_S3_enabled(g->parent_obj.conf) &&
+        g->freeze_mode == VIRTIO_GPU_FREEZE_MODE_FREEZE_S3) {
+        QTAILQ_FOREACH_SAFE(res, &g->reslist, next, tmp) {
+            virtio_gpu_resource_destroy(g, res);
+        }
+        virtio_gpu_virgl_reset(g);
+        g->freeze_mode = VIRTIO_GPU_FREEZE_MODE_UNFREEZE;
+    }
+
 }
 
 void virtio_gpu_reset(VirtIODevice *vdev)
@@ -1352,8 +1392,16 @@ void virtio_gpu_reset(VirtIODevice *vdev)
     struct virtio_gpu_simple_resource *res, *tmp;
     struct virtio_gpu_ctrl_command *cmd;
 
-    QTAILQ_FOREACH_SAFE(res, &g->reslist, next, tmp) {
-        virtio_gpu_resource_destroy(g, res);
+    /*
+     * If guest is suspending, we shouldn't destroy resources,
+     * otherwise, the display can't come back to the time when
+     * it was suspended after guest was resumed.
+     */
+    if (!virtio_gpu_freeze_S3_enabled(g->parent_obj.conf) ||
+        g->freeze_mode == VIRTIO_GPU_FREEZE_MODE_UNFREEZE) {
+        QTAILQ_FOREACH_SAFE(res, &g->reslist, next, tmp) {
+            virtio_gpu_resource_destroy(g, res);
+        }
     }
 
     while (!QTAILQ_EMPTY(&g->cmdq)) {
@@ -1425,6 +1473,8 @@ static Property virtio_gpu_properties[] = {
                      256 * MiB),
     DEFINE_PROP_BIT("blob", VirtIOGPU, parent_obj.conf.flags,
                     VIRTIO_GPU_FLAG_BLOB_ENABLED, false),
+    DEFINE_PROP_BIT("freeze_S3", VirtIOGPU, parent_obj.conf.flags,
+                    VIRTIO_GPU_FLAG_FREEZE_S3_ENABLED, false),
     DEFINE_PROP_END_OF_LIST(),
 };
 
@@ -1441,6 +1491,7 @@ static void virtio_gpu_class_init(ObjectClass *klass, void *data)
     vgbc->gl_flushed = virtio_gpu_handle_gl_flushed;
 
     vdc->realize = virtio_gpu_device_realize;
+    vdc->unrealize = virtio_gpu_device_unrealize;
     vdc->reset = virtio_gpu_reset;
     vdc->get_config = virtio_gpu_get_config;
     vdc->set_config = virtio_gpu_set_config;
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index eb6347ab5d..2a3c54f2c4 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -240,6 +240,9 @@ qmp_virtio_feature_map_t virtio_gpu_feature_map[] = {
     FEATURE_ENTRY(VIRTIO_GPU_F_CONTEXT_INIT, \
             "VIRTIO_GPU_F_CONTEXT_INIT: Context types and synchronization "
             "timelines supported"),
+    FEATURE_ENTRY(VIRTIO_GPU_F_FREEZE_S3, \
+            "VIRTIO_GPU_F_FREEZE_S3: Freezing virtio-gpu and keeping resources"
+            "alive is supported."),
     FEATURE_ENTRY(VHOST_F_LOG_ALL, \
             "VHOST_F_LOG_ALL: Logging write descriptors supported"),
     FEATURE_ENTRY(VHOST_USER_F_PROTOCOL_FEATURES, \
diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
index 2e28507efe..141c48080f 100644
--- a/include/hw/virtio/virtio-gpu.h
+++ b/include/hw/virtio/virtio-gpu.h
@@ -90,6 +90,7 @@ enum virtio_gpu_base_conf_flags {
     VIRTIO_GPU_FLAG_EDID_ENABLED,
     VIRTIO_GPU_FLAG_DMABUF_ENABLED,
     VIRTIO_GPU_FLAG_BLOB_ENABLED,
+    VIRTIO_GPU_FLAG_FREEZE_S3_ENABLED,
 };
 
 #define virtio_gpu_virgl_enabled(_cfg) \
@@ -102,6 +103,8 @@ enum virtio_gpu_base_conf_flags {
     (_cfg.flags & (1 << VIRTIO_GPU_FLAG_DMABUF_ENABLED))
 #define virtio_gpu_blob_enabled(_cfg) \
     (_cfg.flags & (1 << VIRTIO_GPU_FLAG_BLOB_ENABLED))
+#define virtio_gpu_freeze_S3_enabled(_cfg) \
+    (_cfg.flags & (1 << VIRTIO_GPU_FLAG_FREEZE_S3_ENABLED))
 
 struct virtio_gpu_base_conf {
     uint32_t max_outputs;
@@ -173,6 +176,7 @@ struct VirtIOGPU {
 
     uint64_t hostmem;
 
+    virtio_gpu_freeze_mode_t freeze_mode;
     bool processing_cmdq;
     QEMUTimer *fence_poll;
     QEMUTimer *print_stats;
@@ -284,5 +288,7 @@ void virtio_gpu_virgl_reset_scanout(VirtIOGPU *g);
 void virtio_gpu_virgl_reset(VirtIOGPU *g);
 int virtio_gpu_virgl_init(VirtIOGPU *g);
 int virtio_gpu_virgl_get_num_capsets(VirtIOGPU *g);
+void virtio_gpu_cmd_set_freeze_mode(VirtIOGPU *g,
+                         struct virtio_gpu_ctrl_command *cmd);
 
 #endif
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 12:16:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 12:16:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566575.885576 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMSa9-0006Ld-4R; Thu, 20 Jul 2023 12:16:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566575.885576; Thu, 20 Jul 2023 12:16:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMSa9-0006LW-1P; Thu, 20 Jul 2023 12:16:33 +0000
Received: by outflank-mailman (input) for mailman id 566575;
 Thu, 20 Jul 2023 12:16:32 +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
 <SRS0=/JYs=DG=citrix.com=prvs=558be806a=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMSa7-0006LQ-Q9
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 12:16:32 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3e79d311-26f7-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 14:16:28 +0200 (CEST)
Received: from mail-bn7nam10lp2101.outbound.protection.outlook.com (HELO
 NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.101])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 20 Jul 2023 08:16:06 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by LV3PR03MB7383.namprd03.prod.outlook.com (2603:10b6:408:1a2::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Thu, 20 Jul
 2023 12:16:03 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 12:16:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3e79d311-26f7-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689855388;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=n6hx+pNvDFrfsBhLJ/QiklBp4LV1mFFncvyBBOa3wHc=;
  b=XigM/isw1egI+EHZ9ij602/TomXiN/tfFwVZzTEc84feOdYqAF+CGQGP
   xTAUDkdPGrRQiXtkui/DjDEXw8Sz75d4MZeit/dd4v99CQIfC4xFlxZHo
   79ZKOriBUPdThL/qaX7L+HaaeKqTx1C9wp9Ar/tqkeeihOTuoq7r/7TpL
   c=;
X-IronPort-RemoteIP: 104.47.70.101
X-IronPort-MID: 117291112
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:/0WsO6mCWO4BFhMmCNFAFSTo5gw6J0RdPkR7XQ2eYbSJt1+Wr1Gzt
 xIZW2vXbvmCZ2GhftolOty/8UsF68ODyIUyT1c5+ylmHiMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5geGzhH5MbpETU2PByqgKmVrNrbSq
 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/
 f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3
 dwYLx5UTzPcvNr1xKOKTehd3cQfdsa+aevzulk4pd3YJdAPZMmbBo/suppf1jp2gd1SF/HDY
 cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVk1Q3ieC0WDbWUoXiqcF9hEGXq
 3iA523kKhobKMae2XyO9XfEaurnxHqkAtNLTeTinhJsqHiv/25IMT0rbnqioMP+hkSVAvddd
 UNBr0LCqoB3riRHVOLVURC0rWSFtRlaQNdKGuM77gClwLfb+AufCS4PSTspQMwrsoo6SCIn0
 neNnsj1Hnp/vbuNU3Wf+7yI6zSoNkA9JmgEfjIAUQoD7PHpvY4ogxTACN1kFcadjNf4BDXxy
 DCitzUlivMYistj/7q/1UDKhXSrvJehZhUu+gzdU2ah7wV4TI2ofYql7R7c9/koBIOYRVmIu
 D4DgdqT6MgHCJ3LnyuIKM0dEbeo7rCfOTLdiFJmHJ483z2o9zioeoU4yDhvLUEvMdsBcCWvY
 EbXtQ5LzJZWMD2haqofXm6qI8EjzKylH9K6UPnRN4JKesIoLFbB+zxyb0mN2WyriFIrjaw0J
 Zacd4CrEGoeDqNkijGxQo/xzIMW+8z3/kuLLbiT8vht+efADJJJYd/p6GezU90=
IronPort-HdrOrdr: A9a23:q2yhHqpgw7fqK298KLlRG+saV5oDeYIsimQD101hICF9WcaT/v
 re58jzGyWE8Qr5OUtQ4exoXZPrfZqyz+8R3WB8B8bBYOCighrKEGgA1+rfKl/baknDH4dmvM
 8KT0E9Mr3N5DNB/KHHCWeDYrAdKRq8nJxAR92y856gd25XgmhbgTtENg==
X-Talos-CUID: =?us-ascii?q?9a23=3AXPpFyWpFwUSXkqsDUXSZgsrmUeAldVOE7VSPGHf?=
 =?us-ascii?q?7DXdYT7ykEl+soqwxxg=3D=3D?=
X-Talos-MUID: 9a23:/iG4AQVU6TCtzZXq/BrQvTM5DedV2IW3CXpKnZ8t4uyGayMlbg==
X-IronPort-AV: E=Sophos;i="6.01,218,1684814400"; 
   d="scan'208";a="117291112"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=C3qaGng52C5ceGYznhSHRt/77CV/Yp9cwAvXVybrDyXzgD+WRcBfy22TMBpAOSsQbUOtuWefWDUw5ZTZNyYUHVa3nijRNu2ZHs2SlsM7VMSzZ17Fv7TzMG8BhZMW0I4Nr3blCiIDH97dfS6aVtH3ltVlgQhUSG9py+MuszZHZBq1e8gP6qTrAmcpGQMLk53qDaQebhNiI0xKD0Hb+C8535OursC1mGQ9oqTU8sKKKoElroSnq+Ym5TVqolBKiLv3b8dXqyg2aqiKSj3Rn2zAGtHzUysr/PNIjo3x7ufdGif7YqfGbYZTMzZsK9JYeGSP0vvx5KGsaIUY6n+MF+IoXg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=WWIpMevzRhdKGXA0bxDmTSuWYuOYOKxMh61YzzmJ6dk=;
 b=APQ5NApeiwGPyB2nCPZxsUim23Y193n68DN1VNvXzfkEL0GEICdCeArmk2g2ujLtd+iz/7F1j/3yo9vDUjUYDzLXG9efPZiHFnp7IR07XoLh6kKA0kAgtY/+ilBwTwznYJ+0yD0lIqVr6vTWKkBpr8Y/KBhRp+x/Bo68V7iL5sMbVY7rDiq2o5DSCsmnaWlZ/U0DqFXaI8nRIY55GvTNiaKtcLCTGp9TFooyXKWKqfcEwbkjWnrAJTBRvU7PLYgFDI7/lNkq+jY4pM0teB32IbjT0R/J+qv2EyyW3FcQipiHo2C4c9hx3x6AiWF53AzxI/lWf6zLnqGjUKyXRpHLuA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=WWIpMevzRhdKGXA0bxDmTSuWYuOYOKxMh61YzzmJ6dk=;
 b=fkyIth07TmbelVRvU4gpA61G6BYM4YfEC3/VdWm+shBsM42xluVZmXBifzFWvRFDXTRoMwwSNRS5XpYxxXxalqIZJJOe7hnZ7qNtbd5rnFrRjOXp0LlaEej81zLQ28EfPiOMS0ro8VfbjnJFsnSwZ0Fdh/uPe6EOi3R9k2l7XT8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Thu, 20 Jul 2023 14:15:58 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH] x86/mtrr: address violations of MISRA C:2012 Rule
 8.3 on parameter types
Message-ID: <ZLklfgA3grgWIT7u@MacBook-Air-de-Roger.local>
References: <76dba3f8a6a7bc12f15a9e4fc8c73826a08e4b5c.1689849810.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <76dba3f8a6a7bc12f15a9e4fc8c73826a08e4b5c.1689849810.git.federico.serafini@bugseng.com>
X-ClientProxiedBy: LO4P265CA0160.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2c7::19) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|LV3PR03MB7383:EE_
X-MS-Office365-Filtering-Correlation-Id: 3e92ce8f-11d3-4ca5-3dc6-08db891b15e6
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	3diZI8xUdUGtx6KL4lAhO7lRDZoqVeGe4Udh06R194hJYCqNuhFNr3tjF8KouuXnNJfeU+HR1v7JvI9S8vbY+Y3AbgiA9bfLQuh9OyvUNwfnfrE2nw2m32swFqdt9i/rVybhWbgzjhxneiVlHoWebQREimiA33JZuxjGNuNZu6wO60FT4H02MB1W+t5OABoIo6YO5EI58Giyw5mrUKo9DNKmoJ8TWy3KBmJ5cUWJGxl1S3fardiW8F6DKIktMJpp6hn5mTC0hRN3Vc9LeBqVwVdyBDiY4noua9pzwSP1e7GxpTHWLsSpCW04aI8LPdiCt7nrkcXvbQID2MCsdih2MKzurkQ8Ayl51JVColvCg55XkKy5kPKsfiglRQOWX29z0xcXK8ymeBoxZfRa68nrj365i0b6+sjK8vF7VMsrjx6sztSEUKfZFpMaYvqElKFMnAJ7HrbFjhakwVyMLiVFHspWVWi9JUygFje8Lam7mQC7QmMTvqdAY08ffinFxKacAm/eMocoodfHBjicyYyvqa5xgMnxyvSuySZZP8/4GC4ITN/rv7c8JBGRkqskJE8f
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(39860400002)(346002)(136003)(366004)(451199021)(6512007)(9686003)(6506007)(26005)(66556008)(66946007)(54906003)(85182001)(38100700002)(66476007)(7416002)(5660300002)(2906002)(316002)(8936002)(8676002)(4326008)(41300700001)(86362001)(6916009)(6486002)(478600001)(6666004)(82960400001)(83380400001)(186003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?M1BmZnh5TTRadmJiL0Ezb040NDBqTmYxNHgrK0ZDcEY5aTRoYmJBcllUbTFM?=
 =?utf-8?B?WDVyeHNmZDF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M5HBWKW0BZM2CfIaEfrLBptCw0eOLjUDDgWtY7I0ED4hozd2WEIi4iCqtIkbDP1byTiZrrMSkdUx+mnI2hYVSdDo94uPyFpO0rx/JtLm4wuieHhbkPOIORi9oHx/yVXZCg9pjgK8kf+CCHWnplko/5utnBa55Of77W1irPLkdZWB/Ps5nxhmxWHbRcpcqGzZBZKBhw2wBmiduqNt5xIHTL942boe3XBWvLLgr1COYMgtCHOEZ+huWfcCbN39pEyMDRYj2nNVZDwJHEbSX4hcaQa5s+0qfeG0JjDg+eNreCNoaVXfJ2XCt0+r2gHD+3TyhQKXeWjXfSOFobwOq3XEfG7oP09hIh/UHwBep11sagPGYQaEF7EoPTxaCZwnu796JfdiZtbNHXcQ==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3e92ce8f-11d3-4ca5-3dc6-08db891b15e6
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 12:16:03.2919
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: UwzQdoA0xJzobkRk3czhXunI8AhzWwDQO1TJ4jVeB353ia6NwB7AO4mOZuLbo8jQWe4TEhm0mSulYPi0UBk+mA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR03MB7383

On Thu, Jul 20, 2023 at 12:48:36PM +0200, Federico Serafini wrote:
> Change parameter types of function declarations to be consistent with
> the ones used in the corresponding definitions,
> thus addressing violations of MISRA C:2012 Rule 8.3 ("All declarations
> of an object or function shall use the same names and type qualifiers").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> ---
>  xen/arch/x86/include/asm/mtrr.h | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/x86/include/asm/mtrr.h b/xen/arch/x86/include/asm/mtrr.h
> index e4f6ca6048..5d57a596ea 100644
> --- a/xen/arch/x86/include/asm/mtrr.h
> +++ b/xen/arch/x86/include/asm/mtrr.h
> @@ -59,9 +59,10 @@ extern int mtrr_del_page(int reg, unsigned long base, unsigned long size);
>  extern int mtrr_get_type(const struct mtrr_state *m, paddr_t pa,
>                           unsigned int order);
>  extern void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi);
> -extern u32 get_pat_flags(struct vcpu *v, u32 gl1e_flags, paddr_t gpaddr,
> -                  paddr_t spaddr, uint8_t gmtrr_mtype);
> -extern unsigned char pat_type_2_pte_flags(unsigned char pat_type);
> +extern uint32_t get_pat_flags(struct vcpu *v, uint32_t gl1e_flags,
> +                              paddr_t gpaddr, paddr_t spaddr,
> +															uint8_t gmtrr_mtype);

Wrong usage of hard tabs.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 12:34:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 12:34:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566580.885587 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMSqr-00012b-Fm; Thu, 20 Jul 2023 12:33:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566580.885587; Thu, 20 Jul 2023 12:33:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMSqr-00012U-Cg; Thu, 20 Jul 2023 12:33:49 +0000
Received: by outflank-mailman (input) for mailman id 566580;
 Thu, 20 Jul 2023 12:33:48 +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
 <SRS0=o2HW=DG=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qMSqq-00012J-5G
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 12:33:48 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id aaa8020b-26f9-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 14:33:45 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.162.143.190])
 by support.bugseng.com (Postfix) with ESMTPSA id 940974EE0C89;
 Thu, 20 Jul 2023 14:33:43 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aaa8020b-26f9-11ee-8611-37d641c3527e
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: [XEN PATCH v2] x86/mtrr: address violations of MISRA C:2012 Rule 8.3 on parameter types
Date: Thu, 20 Jul 2023 14:33:34 +0200
Message-Id: <514c6dbe4ccfa1fdd66f80a0f8c8e248886bdc4e.1689856301.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Change parameter types of function declarations to be consistent with
the ones used in the corresponding definitions,
thus addressing violations of MISRA C:2012 Rule 8.3 ("All declarations
of an object or function shall use the same names and type qualifiers").

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
Changes in v2:
  - removed unwated tabs.
---
 xen/arch/x86/include/asm/mtrr.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/mtrr.h b/xen/arch/x86/include/asm/mtrr.h
index e4f6ca6048..14246e3387 100644
--- a/xen/arch/x86/include/asm/mtrr.h
+++ b/xen/arch/x86/include/asm/mtrr.h
@@ -59,9 +59,10 @@ extern int mtrr_del_page(int reg, unsigned long base, unsigned long size);
 extern int mtrr_get_type(const struct mtrr_state *m, paddr_t pa,
                          unsigned int order);
 extern void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi);
-extern u32 get_pat_flags(struct vcpu *v, u32 gl1e_flags, paddr_t gpaddr,
-                  paddr_t spaddr, uint8_t gmtrr_mtype);
-extern unsigned char pat_type_2_pte_flags(unsigned char pat_type);
+extern uint32_t get_pat_flags(struct vcpu *v, uint32_t gl1e_flags,
+                              paddr_t gpaddr, paddr_t spaddr,
+                              uint8_t gmtrr_mtype);
+extern uint8_t pat_type_2_pte_flags(uint8_t pat_type);
 extern int hold_mtrr_updates_on_aps;
 extern void mtrr_aps_sync_begin(void);
 extern void mtrr_aps_sync_end(void);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 12:36:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 12:36:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566586.885597 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMStq-0001dn-TY; Thu, 20 Jul 2023 12:36:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566586.885597; Thu, 20 Jul 2023 12:36:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMStq-0001dg-Q5; Thu, 20 Jul 2023 12:36:54 +0000
Received: by outflank-mailman (input) for mailman id 566586;
 Thu, 20 Jul 2023 12:36:53 +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
 <SRS0=o2HW=DG=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qMStp-0001da-Oa
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 12:36:53 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1a2099c4-26fa-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 14:36:51 +0200 (CEST)
Received: from [192.168.1.101] (unknown [37.162.143.190])
 by support.bugseng.com (Postfix) with ESMTPSA id E84D64EE0C89;
 Thu, 20 Jul 2023 14:36:50 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1a2099c4-26fa-11ee-8611-37d641c3527e
Message-ID: <22263163-d3f3-eacd-1adc-0fb254ee618b@bugseng.com>
Date: Thu, 20 Jul 2023 14:36:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] x86/mtrr: address violations of MISRA C:2012 Rule 8.3
 on parameter types
Content-Language: en-US, it
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
 Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
References: <76dba3f8a6a7bc12f15a9e4fc8c73826a08e4b5c.1689849810.git.federico.serafini@bugseng.com>
 <ZLklfgA3grgWIT7u@MacBook-Air-de-Roger.local>
From: Federico Serafini <federico.serafini@bugseng.com>
Organization: BUGSENG srl
In-Reply-To: <ZLklfgA3grgWIT7u@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 20/07/23 14:15, Roger Pau MonnÃ© wrote:
> On Thu, Jul 20, 2023 at 12:48:36PM +0200, Federico Serafini wrote:
>> +extern uint32_t get_pat_flags(struct vcpu *v, uint32_t gl1e_flags,
>> +                              paddr_t gpaddr, paddr_t spaddr,
>> +															uint8_t gmtrr_mtype);
> 
> Wrong usage of hard tabs.
> 
> Thanks, Roger.

Sorry, some update must have changed the settings of my editor.
Thanks for reporting.

Regards
-- 
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 12:37:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 12:37:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566592.885606 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMSuJ-0002D1-5J; Thu, 20 Jul 2023 12:37:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566592.885606; Thu, 20 Jul 2023 12:37:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMSuJ-0002Cu-2X; Thu, 20 Jul 2023 12:37:23 +0000
Received: by outflank-mailman (input) for mailman id 566592;
 Thu, 20 Jul 2023 12:37:21 +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
 <SRS0=/JYs=DG=citrix.com=prvs=558be806a=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMSuH-0001da-JP
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 12:37:21 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 29badf22-26fa-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 14:37:19 +0200 (CEST)
Received: from mail-bn7nam10lp2106.outbound.protection.outlook.com (HELO
 NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.106])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 20 Jul 2023 08:36:52 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SA1PR03MB6596.namprd03.prod.outlook.com (2603:10b6:806:1cb::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul
 2023 12:36:49 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 12:36:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 29badf22-26fa-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689856639;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=w1Icpl22nIK7X+cPvedq0tQtlGk2chI8IKZlkTT93Cg=;
  b=AwSzQi0wih0qZ8rlY7BdFQD8gtfq1zwIqvbgbNuoHLhSD4NM4djd2ZDP
   1FK4puwrPaGs5bulXYJB6NChaJBvqZJILYaqaSU4Z4nNn7r62QXBIwbi3
   l0KkBGv7bOkAe5MXO7cpGRlI0nUAnjHfDjE6A5FTWfgaIL5uiy9uB/zsf
   o=;
X-IronPort-RemoteIP: 104.47.70.106
X-IronPort-MID: 116153149
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:AQz1rKy8NLQREluvHqV6t+fwxyrEfRIJ4+MujC+fZmUNrF6WrkVTz
 2QfXG6AOKnfZWvxe9p3OYjg8RwOucWEyoRlHAJq+CAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhP6gT5TcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KXp2r
 MYVFSIyV0qojc3sy7uYRdkx3ct2eaEHPKtH0p1h5RfwKK9+BLrlHODN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvDCVlVQvuFTuGIO9ltiiX8Jak1zev
 mvb12/4HgsbJJqUzj/tHneE37aRxH6gAd5DfFG+3vVh23vP9nAVMgELXFuQq9WJgXfuXesKf
 iT4/QJr98De7neDcN75WBGppW+eiTQVUdFQDu4S5RmEz+zf5APxLngJSHtNZcIrsOcyRCc2z
 RmZktXxHzttvbaJD3WH+d+8ije/OjMcK2MYUgYCQREY+NnooIw1jRXnQ85qFei+ididJN3r6
 zWDrSx7jbNMi8cOjv2/5Qqe22zqoYXVRAko4AmRRnii8g5yeI+iYcqv9ETf6vFDao2eSzFto
 UQ5piRX18hWZbnlqcBHaL5l8G2BjxpdDADhvA==
IronPort-HdrOrdr: A9a23:FlI8v6iC5Q/+AULsp95G0C+lPnBQX7B23DAbv31ZSRFFG/FwyP
 rCoB1L73XJYWgqM03I+eruBEBPewK4yXdQ2/hoAV7CZniehILMFu1fBOTZowEIdxeOldK1kJ
 0QCJSWa+eAcWSS7/yKhzVQeuxIqLfnzEnrv5a5854Ed3AWV0gK1XYcNu/0KDwVeOEQbqBJbq
 Z0q/A30AaISDAyVICWF3MFV+/Mq5nik4/nWwcPA1oK+RSDljSh7Z/9Cly90g0FWz1C7L8++S
 yd+jaJrZmLgrWe8FvxxmXT55NZlJ/IzcZCPtWFjow4OyjhkQGhYaVmQvmnsCouqO+ixV42mJ
 3nogsmPe5093TNF1vF6SfF6k3F6nID+nXiwViXjT/KptH4fiszD45kiZhCehXUxkI8tJUkuZ
 g7ll6xht5yN1ftjS7979/HW1VDkVe1m2Mrlao2g2ZEWYUTRbdNpcg0/V9TEr0HACXmgbpXZt
 VGPYX53rJ7YFmaZ3fWsi1Gx8GtZG06GlO8Tk0LqqWuokprtUE863Fd6N0Un38G+p54YYJD/f
 74PqNhk6wLZtMKbIpmbd1xDvefOyjoe1bhIWiSKVPoGOUsIHTWsaP6570z+aWDZIEI9p0vg5
 7MOWko+VLaQ3ieSPFm4ac7siwkGA6GLHfQI4BlltVEU4THNfTW2XbpciFtryOiy89vcfEzFc
 zDfa6+OMWTXFcGKbw5oDEWZKMiV0X2cPdlz+rTCGj+1v7jG8nNitHxVsr1Cf7ELQsEM1mPck
 frGgKDbvl90g==
X-Talos-CUID: =?us-ascii?q?9a23=3AS/RMJGoyfD+VHhEWTacDhIjmUdsdK0fQ8WXvGhW?=
 =?us-ascii?q?TA0kzQ7S2Rm/No6wxxg=3D=3D?=
X-Talos-MUID: 9a23:cjdJSAYHU+GPl+BTvDS3om1SKMFS/7mnCGsHvaUNgpmCDHkl
X-IronPort-AV: E=Sophos;i="6.01,218,1684814400"; 
   d="scan'208";a="116153149"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ky+M8kRsVgVW1OYlbmWu6+U8DwTWiCb2BTQLdgxxDpYfK2kwWrkjvuvEQXTLazCNiHm3BNaJE550LzXwSz+27PBdU+JbOA7Mv5fS6o1vVcSghT4J2dVpGH4BdvyX5Gkfk2k/wKQAhLciHL8zDurZcocBahrw5ni9O29TKTHcq0Vb2g6j6TntsMaF6NJQk8oeSNG1T9EEPST80xsq3TEIQ8kHEQSjFCDj7fcvYVsHAQ9Nm4UyhGJhJecYlM36FKmKWUFopDEDCVC8600teGFQn74EBHeatJ2g3RPiMhNJBZWb1Z8+/UdVFASTA6eh6D7kk7ra0xYCg8hrKfu2ODqoqA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=bMKNA1yk8WzThkmXJc2a6Z6aKEci9zW9zd7zX3o15Ro=;
 b=DAb6E4a/fB7iq7jE0KaYVZohOF+/HL1YOhfc9jdIppabzYOHOC/oQB9mkBcuhl8HeyWaJaWQzFtuTEbev3OKKwQLfbRd8D85WjqSP1mMEJzssR2uNQkrmn4TkjLrgRy0D/w2DQHrTCPw/tHeJ3YlsRucc7iOFMqyo0v4ogUth5QpwtLoRV7Y1eLEA8Zwz+KckySNVy9L6LJqTrRsdh2ge4X5Ip/iG7Tai+nKYkwrn8kzEWdG02pi7zgkUMT4xVTYypOlG+070GONoPO3FuLItPkwPvS0Sr+XYnuXt7NIrfSjo71fVgPVtqWbWznAL7oVDdERrimCC8U2HpogPELtbA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=bMKNA1yk8WzThkmXJc2a6Z6aKEci9zW9zd7zX3o15Ro=;
 b=vF+n6uMO0lZCfik9b4E7e6v/t5gLU9N6vZZ4udOI5/PPuei+IQM9m/LgW1TSaX9+Oh9lNOH4ttLyAdTV9Trceet59/Ub0Kl/jRC45GZcy17yNtXJXKgaR5jgrxEsT6wMZ/+LYVrdiztvhNm27lvTuF2UweUAlmpM6h7RCZQsOpY=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Thu, 20 Jul 2023 14:36:41 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH v8 04/13] vpci: add hooks for PCI device assign/de-assign
Message-ID: <ZLkqWXJtYlsJ4M61@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-5-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20230720003205.1828537-5-volodymyr_babchuk@epam.com>
X-ClientProxiedBy: LO4P123CA0131.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:193::10) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA1PR03MB6596:EE_
X-MS-Office365-Filtering-Correlation-Id: f64b96b4-534e-46f7-709b-08db891dfc07
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	ScxMfICdXMiJOfU8BO/2zHwhxwRDcQT5Fge3WmN4T0O7LmE11lNi+g0OPEO8JZV4ATc5jtFrMN9dTiwlZQtAAeQjcrUsm0jTOBqK+/e3LZSIuSGym874P8nfXu2e3/R17qx+z98ECnsWk88S9NIwyt6E8U6cg0MoKNZmJOOVP0s3WFqWXZkJurCQi5GTkEqharUWKdk9636STg1txkHgSLHLumT1V0rAWIZ9z8Zl52ODmP0daQw3+hOXZJRmKKckymw0UwKyHNcaf81CYBa0x10KZdHm4cfwVj9MNwIiMVDBinPueoH/YJC+4psA89Y2qhqwItAAei81bFYtgT5n1Ph+sai4EBkliP+/ypavL00rT/RjjRD9BorFWWzuqC/sCPq21R9BsFiXQvFVHHCT2SKlHBIXS5ZuxFp2Q5+HF7MkFxcaS/VAcwYEnGEavk2i3L6cRIh7kfLEEu79+NBtSZXuY+Lsy6wdStZ+SmRbNZJfDaCqsMKGx+r4TyDr5VStBDnhJ342/NOg0XvNNR3mhPY2gDddMCB6dQdJ0Yl8QtiQ80erJjRNa0OL5cp8GOh6
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(136003)(396003)(376002)(39860400002)(346002)(451199021)(66946007)(66476007)(41300700001)(66556008)(4326008)(5660300002)(316002)(6916009)(8936002)(2906002)(54906003)(6486002)(6666004)(9686003)(6506007)(8676002)(186003)(26005)(6512007)(86362001)(85182001)(478600001)(83380400001)(82960400001)(38100700002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dUdMUlhoSUk3NndIT1hrN1JtMTBFRzhJRnNmdUNQM3dsZDdMM1dOK1FFeHVX?=
 =?utf-8?B?ZkdOakhHSnF6NDd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kBuwz1+NzSSg2YUGO5oHTHSjM6X5hUMvNzxQeDR/4t73b8lncd4dKSRzcFSZeuV4+g4T93CvUZE7duMWW9GhF1uCN1baPsZ9u4Mahhk+SbhITKSL6YdihhnxEO1YFI61HNxL9mGu9vdDzDYb8cRpz7WcM7GKzzBqcb8sYCSU0URp72Rk/zGNOYFpaCT0RVEhI+3TdHr7XV+r+SP5UpaimyDlDDr2sj5sM90TKwzfLn0dsSzqzYVuAg+K+mYhtgZdRkwgp/A56HW272l8Guh4
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f64b96b4-534e-46f7-709b-08db891dfc07
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 12:36:48.1763
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: a8UbyZTiGAPXCrF+qJ0NcPNGB9RavUCZad8jp7TrvlpC3whvhW1m5QxqfrUWOPC77oD7kuUvZV+Vt4H0weYDkw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB6596

On Thu, Jul 20, 2023 at 12:32:31AM +0000, Volodymyr Babchuk wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> 
> When a PCI device gets assigned/de-assigned some work on vPCI side needs
> to be done for that device. Introduce a pair of hooks so vPCI can handle
> that.
> 
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> ---
> Since v8:
> - removed vpci_deassign_device
> Since v6:
> - do not pass struct domain to vpci_{assign|deassign}_device as
>   pdev->domain can be used
> - do not leave the device assigned (pdev->domain == new domain) in case
>   vpci_assign_device fails: try to de-assign and if this also fails, then
>   crash the domain
> Since v5:
> - do not split code into run_vpci_init
> - do not check for is_system_domain in vpci_{de}assign_device
> - do not use vpci_remove_device_handlers_locked and re-allocate
>   pdev->vpci completely
> - make vpci_deassign_device void
> Since v4:
>  - de-assign vPCI from the previous domain on device assignment
>  - do not remove handlers in vpci_assign_device as those must not
>    exist at that point
> Since v3:
>  - remove toolstack roll-back description from the commit message
>    as error are to be handled with proper cleanup in Xen itself
>  - remove __must_check
>  - remove redundant rc check while assigning devices
>  - fix redundant CONFIG_HAS_VPCI check for CONFIG_HAS_VPCI_GUEST_SUPPORT
>  - use REGISTER_VPCI_INIT machinery to run required steps on device
>    init/assign: add run_vpci_init helper
> Since v2:
> - define CONFIG_HAS_VPCI_GUEST_SUPPORT so dead code is not compiled
>   for x86
> Since v1:
>  - constify struct pci_dev where possible
>  - do not open code is_system_domain()
>  - extended the commit message
> ---
>  xen/drivers/Kconfig           |  4 ++++
>  xen/drivers/passthrough/pci.c | 21 +++++++++++++++++++++
>  xen/drivers/vpci/vpci.c       | 18 ++++++++++++++++++
>  xen/include/xen/vpci.h        | 15 +++++++++++++++
>  4 files changed, 58 insertions(+)
> 
> diff --git a/xen/drivers/Kconfig b/xen/drivers/Kconfig
> index db94393f47..780490cf8e 100644
> --- a/xen/drivers/Kconfig
> +++ b/xen/drivers/Kconfig
> @@ -15,4 +15,8 @@ source "drivers/video/Kconfig"
>  config HAS_VPCI
>  	bool
>  
> +config HAS_VPCI_GUEST_SUPPORT
> +	bool
> +	depends on HAS_VPCI
> +
>  endmenu
> diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
> index 6f8692cd9c..265d359704 100644
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -885,6 +885,10 @@ static int deassign_device(struct domain *d, uint16_t seg, uint8_t bus,
>      if ( ret )
>          goto out;
>  
> +    write_lock(&pdev->domain->pci_lock);
> +    vpci_deassign_device(pdev);
> +    write_unlock(&pdev->domain->pci_lock);
> +
>      if ( pdev->domain == hardware_domain  )
>          pdev->quarantine = false;
>  
> @@ -1484,6 +1488,10 @@ static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn, u32 flag)
>      if ( pdev->broken && d != hardware_domain && d != dom_io )
>          goto done;
>  
> +    write_lock(&pdev->domain->pci_lock);
> +    vpci_deassign_device(pdev);
> +    write_unlock(&pdev->domain->pci_lock);
> +
>      rc = pdev_msix_assign(d, pdev);
>      if ( rc )
>          goto done;
> @@ -1509,6 +1517,19 @@ static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn, u32 flag)
>          rc = iommu_call(hd->platform_ops, assign_device, d, devfn,
>                          pci_to_dev(pdev), flag);
>      }
> +    if ( rc )
> +        goto done;
> +
> +    devfn = pdev->devfn;
> +    write_lock(&pdev->domain->pci_lock);
> +    rc = vpci_assign_device(pdev);
> +    write_unlock(&pdev->domain->pci_lock);
> +    if ( rc && deassign_device(d, seg, bus, devfn) )
> +    {
> +        printk(XENLOG_ERR "%pd: %pp was left partially assigned\n",
> +               d, &PCI_SBDF(seg, bus, devfn));

&pdev->sbdf?  Then you can get of the devfn usage above.

> +        domain_crash(d);

This seems like a bit different from the other error paths in the
function, isn't it fine to return an error and let the caller handle
the deassign?

Also, if we really need to call deassign_device() we must do so for
all possible phantom devices, see the above loop around
iommu_call(..., assing_device, ...);

> +    }
>  
>   done:
>      if ( rc )
> diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
> index a6d2cf8660..a97710a806 100644
> --- a/xen/drivers/vpci/vpci.c
> +++ b/xen/drivers/vpci/vpci.c
> @@ -107,6 +107,24 @@ int vpci_add_handlers(struct pci_dev *pdev)
>  
>      return rc;
>  }
> +
> +#ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
> +/* Notify vPCI that device is assigned to guest. */
> +int vpci_assign_device(struct pci_dev *pdev)
> +{
> +    int rc;
> +
> +    if ( !has_vpci(pdev->domain) )
> +        return 0;
> +
> +    rc = vpci_add_handlers(pdev);
> +    if ( rc )
> +        vpci_deassign_device(pdev);

Why do you need this handler, vpci_add_handlers() when failing will
already call vpci_remove_device(), which is what
vpci_deassign_device() does.

> +
> +    return rc;
> +}
> +#endif /* CONFIG_HAS_VPCI_GUEST_SUPPORT */
> +
>  #endif /* __XEN__ */
>  
>  static int vpci_register_cmp(const struct vpci_register *r1,
> diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
> index 0b8a2a3c74..44296623e1 100644
> --- a/xen/include/xen/vpci.h
> +++ b/xen/include/xen/vpci.h
> @@ -264,6 +264,21 @@ static inline bool __must_check vpci_process_pending(struct vcpu *v)
>  }
>  #endif
>  
> +#ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
> +/* Notify vPCI that device is assigned/de-assigned to/from guest. */
> +int vpci_assign_device(struct pci_dev *pdev);
> +#define vpci_deassign_device vpci_remove_device
> +#else
> +static inline int vpci_assign_device(struct pci_dev *pdev)
> +{
> +    return 0;
> +};
> +
> +static inline void vpci_deassign_device(struct pci_dev *pdev)
> +{
> +};
> +#endif

I don't think there's much point in introducing new functions, see
above.  I'm fine if the current ones want to be renamed to
vpci_{,de}assign_device(), but adding defines like the above just
makes the code harder to follow.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 13:27:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 13:27:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566599.885618 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMTgu-0001A5-0R; Thu, 20 Jul 2023 13:27:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566599.885618; Thu, 20 Jul 2023 13:27:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMTgt-00019y-ST; Thu, 20 Jul 2023 13:27:35 +0000
Received: by outflank-mailman (input) for mailman id 566599;
 Thu, 20 Jul 2023 13:27:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6Xo+=DG=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMTgt-00019s-58
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 13:27:35 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2062f.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2f1d2a61-2701-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 15:27:33 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8270.eurprd04.prod.outlook.com (2603:10a6:102:1c7::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul
 2023 13:27:31 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 13:27:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2f1d2a61-2701-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KZkf/fnhjWYnNWuFkP3tGGq+ku8hKnfXT7cgy8QBa8j00B2dm0ToRgyYV4Agffd0wS05esY+A83DFp5xODHWO6NQUpkCNEugg7IJhmLETqAAPyZswqPXw9umVDgREdpShYWRh8h76gUlyQ3mkZZ0zkFCpEfC2fPlicTnCqaT4/0VJU0HM1X6PePfSseldjYfMxUzMHxrAIWUTJqgtHcLaHUaMpMTXsZcjxgxldAndrCly6Ni6++ejPMULuQzAE12J+YY9RckMj9ORScfeSJcfNHQZsAjhXVNwiO6b8JCOl+3Ok/enNwKxFYoSibebpvQE02ns/I0/+y7UePXp1zHcw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=rggqXSpnfKDvnqpml8bOxYDB9mTW1feRAlb4rApz+Rw=;
 b=Fq20PDSHFK6aGMrV2s130agncjKNHaApIxRw4vtYRxi5j85neLbt450eFWj5cQ+5qJ2+49rV9ZPDVL3mvTbQhhsHkOlZ2Oxk18FKKcQqYpS7tLmXiEOJcX3czE1BEzcaa7cUUeilCnbq6k6/YRET9Zjr7FBLC1c99RhpZS9Z197Fr8kyHAoYGeERFotsXg8ojevESKopXRQkVL/ZHUEGEUCANHDb9AiiShKLe/IfD3HRcdwKwSk0p4eBnnvLkHpu7Bs5nnO61QliXwox6p2qcqQ7LRSazuxRt0V9YkWDlQWJ2vLDbauK7zCbsBnH3jVIC+5g8YTVB1xaQg/G/S0CcA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=rggqXSpnfKDvnqpml8bOxYDB9mTW1feRAlb4rApz+Rw=;
 b=VvuGpABRv7qQajAUC7FCB1wplbbwgdEsgAebIKbb7CJgEtCa8kqcgnct1rp9jXlxQcPX5y7DDmRiw+sFFhYTNnh7Gcn18slaj0XXJNT1GoGSqpTGzsZ1d0zNwvCzU21fO+LX8m96Ryrhdp6W1uRSaRCJhw9Ub/vzoSgu43ihJnxv9bsjrMpyJb3ZFtr/92tacdPETnRdlxdHGO95Xq7MkqyP6SWU6T3WO3UFe1x6O97DOOwKbQ5Y8meGF3ykYmagTNlCnumKoid1xMkaE9HAyANLiT1vYSCctXZ/1fZFQjKArZH2UZElvCTqrZoFRdrXXUn30qXE4PiFZ/J3i1xcCA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <08ec7e54-1abf-5e1e-e1ee-7026a69e0279@suse.com>
Date: Thu, 20 Jul 2023 15:27:29 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0088.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1e::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8270:EE_
X-MS-Office365-Filtering-Correlation-Id: e1cef171-d53d-4c45-5ee9-08db89251233
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Ngl0o1YqifsTBEWiY+miMw6RFsxgkT364J6cImF4G+WwKWcPUGxchWA6bTROw+y7SoTOdYS8l9F7ToMLhSOYKSqhLUAIFAmWkqWQ30wqwK7t0qY4R2B8rt1ICXlL+9fONYFLsVo7HdjoZWhsONgSjukG5SWzyYkcSH9M5Cbsta35HjE8tOWk9M27hSqnbc/wotFyqLHgQfZcO9YtwQEPEA+TG8N3WPsgRM4qPqVn/tywROZ4Hco0mM5oWhgdFMYbC4c+CXWYxYmolgttVxO838YX5aD8t7J2iqNZ2Z7UqaBK+/WkOsUlYPiwv7R6rmWThVKawE9oO6bSeHw45iTazrWfIVbBcxK75OTkD8i5sjVyFW3mZI62yLQ4EqJvhVaEqZ25ARwJhZr12CFITbGMwcfJcQiU98lmB/2v/JVDqTc0zO5xCs344vAE19VYYTPkjPKGHtiwSkVm4OIOcIXtFt6KsGF1VR+vgEZWTofM5svD8Hox3lNmuoDXDQ+ZbEYYsqwnmD7Shuognz/ZQ8p7osSpQGS3iZpAcQrHFY8KSOQFgtlt86m+NQiQD3BbVW3IH5p5R+dlayFWdt3MOD16fBJue2qXE++TkBQEs0Onu4h296+h4HTUWMO0LUv55DY0OZvCi9RFYCdFXziSWirIlA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(396003)(366004)(136003)(39860400002)(451199021)(86362001)(478600001)(83380400001)(186003)(38100700002)(41300700001)(26005)(31696002)(31686004)(54906003)(8676002)(6916009)(53546011)(8936002)(316002)(2906002)(4326008)(6512007)(66556008)(66946007)(66476007)(6486002)(6506007)(2616005)(36756003)(5660300002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eVVqZGpPbDlKeDlzNHlIZkVGSC83NTVWZmI0VDc5VGZvWWVZM2NyUlRjVkV1?=
 =?utf-8?B?bXRZSDA5QkdOaEpXUG0rR2pWVlFrYjhDdEtNQU4vZHBHK2poVFBueGRTWEFp?=
 =?utf-8?B?ckJiSTBRTWswZmxGeHVkaTR5TFZIZkw5UWlkVFlobkF3OTBBbUpDd2hvb25X?=
 =?utf-8?B?WkZrSmgyb3dhemZOdmVNYWpiZlJvZ2lLM0dDRm8ydXQ3NDU0dEtPQXF0blJJ?=
 =?utf-8?B?dklMaXFrdmtlc0xPT3RTb2o3QklOOVhTeXN5SGh0NE4wR01YbnFEWTRQdWpn?=
 =?utf-8?B?YUgyOUVPZlBBTlJyS3YyTFh5bi9jZzgyeVNhZmdyQzJzalF3L2RxRnI3bVg1?=
 =?utf-8?B?OEtLTVRDT1E2QmdLODlIdlY3WGoyTXA1amZrOUk2OFlvWFpaNzVVV0NqYW1w?=
 =?utf-8?B?Qi9MaUx3RGdGREZEUGFTOWlpNHF0UUtseXlIZDFMNzJXSk9LajlmQkMzK09a?=
 =?utf-8?B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urprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 13:27:31.6447
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: +w2R+DSnPID7U419b09pEbLG5DhItP3593aJmBNAa0xvxmzCEIc9TbQPAbHuKChXHfg/l4sRUiFFMxfZyo9K8w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8270

On 20.07.2023 13:20, Roger Pau MonnÃ© wrote:
> On Thu, Jul 20, 2023 at 12:32:31AM +0000, Volodymyr Babchuk wrote:
>> @@ -447,8 +476,16 @@ void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
>>  
>>      /*
>>       * Find the PCI dev matching the address, which for hwdom also requires
>> -     * consulting DomXEN.  Passthrough everything that's not trapped.
>> +     * consulting DomXEN. Passthrough everything that's not trapped.
>> +     * If this is hwdom, we need to hold locks for both domain in case if
>> +     * modify_bars is called()
> 
> Typo: the () wants to be at the end of modify_bars().
> 
>>       */
>> +    read_lock(&d->pci_lock);
>> +
>> +    /* dom_xen->pci_lock always should be taken second to prevent deadlock */
>> +    if ( is_hardware_domain(d) )
>> +        read_lock(&dom_xen->pci_lock);
> 
> For modify_bars() we also want the locks to be in write mode (at least
> the hw one), so that the position of the BARs can't be changed while
> modify_bars() is iterating over them.

Isn't changing of the BARs happening under the vpci lock? Or else I guess
I haven't understood the description correctly: My reading so far was
that it is only the presence (allocation status / pointer validity) that
is protected by this new lock.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 13:34:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 13:34:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566603.885626 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMTnX-0002en-PB; Thu, 20 Jul 2023 13:34:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566603.885626; Thu, 20 Jul 2023 13:34:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMTnX-0002eg-Mc; Thu, 20 Jul 2023 13:34:27 +0000
Received: by outflank-mailman (input) for mailman id 566603;
 Thu, 20 Jul 2023 13:34:26 +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
 <SRS0=/1Sz=DG=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qMTnW-0002ea-NA
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 13:34:26 +0000
Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com
 [2a00:1450:4864:20::12e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 22a53180-2702-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 15:34:22 +0200 (CEST)
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-4fdd7d09576so1266405e87.0
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 06:34:22 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 y1-20020ac24201000000b004fa35167729sm207302lfh.159.2023.07.20.06.34.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 20 Jul 2023 06:34:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 22a53180-2702-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689860061; x=1690464861;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=eSe7g1/0ty8ZLGeXTV0gG+04JxeYAA1SOw780NbVcqg=;
        b=kBAT9zX35VagErvaLhAoxdJ9vRN8vmMDjRfE/vdpLd7mIFqRjtkGftiDv0446O46PW
         W963+X3/kfAbNjDKTU5Klc83Ue076+7uc1FH3//k9eCp2BMXzR8GWPDp6ruKsHNgtxP5
         B8ufNjOFisK1C3Gkv5xITQrXaD0SMqI69ecZq5U5KSIIs1Kyvi6m0eANX6xXrYA7u5oN
         cRuAeqoVpyr9JZpcZ+w6gkFUz8/69N/YWdEWVIGUF2XV/RmutwSb1WE2qjwEEOoqYXwA
         s+YCaDHHF03vqpJrqvR0AiBlSG02Zlbx9elQsvDb5A7fO6NKagytemJQbiF6wJhehh41
         jqdA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689860061; x=1690464861;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=eSe7g1/0ty8ZLGeXTV0gG+04JxeYAA1SOw780NbVcqg=;
        b=U+wg1q/64ExQ3R+ejqYJBtkWZe9K/imXXBDWB5Qa1yRNEXGcv1+dDVxFLSGQiQwS44
         ERqqcq5Ax+zxRmSJo3RN6hl9UmuOnX7vh/3ZhOmP51D8uyd3oCvtiF6TTU7muq8J+Gz7
         qdePCJBxaInL/dXHv4uSXSv4EI4dksyaqx+IJDr7mvCgBFr4KqyYLZPrAIgUeWjHN/hx
         qbHzT0tgg0XSZ3k0yjiTflL/u0Z2byH32X8vrmYzIkInzcdGJ8QhBOkKq/IT4iUth3zK
         w5bXlux4qffFbW3shBiez5dL8R/hM5kghok/J6s6S63xMbMkoZQJC+kIET85zHV0zl94
         o9Og==
X-Gm-Message-State: ABy/qLYr1tjDu1mVZq9mtj7G+1tg2QDDgPf7fwg8Pb2kiWW6mPRD4EYJ
	b9CZ58Zc9QOqwQ8IMkE3Rz1wprbJ0/k=
X-Google-Smtp-Source: APBJJlENDgW06kKChSI697SrMBHSF36e78wmmjHKtWBqBBpXbunyb+FPyRuSLcH/YCHqMehKSNQQaQ==
X-Received: by 2002:a19:6452:0:b0:4f8:631b:bf77 with SMTP id b18-20020a196452000000b004f8631bbf77mr2097882lfj.22.1689860061072;
        Thu, 20 Jul 2023 06:34:21 -0700 (PDT)
Message-ID: <fce99ab86730de77a82e60efc2c550a3f52a2443.camel@gmail.com>
Subject: Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Bob Eshleman
	 <bobbyeshleman@gmail.com>, Alistair Francis <alistair.francis@wdc.com>, 
	Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
Date: Thu, 20 Jul 2023 16:34:20 +0300
In-Reply-To: <ad72e892-2ec0-5188-f3bc-6d33544c775a@suse.com>
References: <cover.1689604562.git.oleksii.kurochko@gmail.com>
	 <8c69050d7b1f42df5e776ca9494164a4d15f2d52.1689604562.git.oleksii.kurochko@gmail.com>
	 <ad53c037-3c1b-ff1a-93df-b79ab2948174@suse.com>
	 <30540953fb363fce4dfd59f8a7e709247a9872fd.camel@gmail.com>
	 <c1a3d447-4b4d-cd9f-642d-e30fed088302@suse.com>
	 <0cbf6a69e8ae08f6b85edcc4f8d53a84e0103d8b.camel@gmail.com>
	 <ad72e892-2ec0-5188-f3bc-6d33544c775a@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Thu, 2023-07-20 at 12:29 +0200, Jan Beulich wrote:
> On 20.07.2023 10:28, Oleksii wrote:
> > On Thu, 2023-07-20 at 07:58 +0200, Jan Beulich wrote:
> > > On 19.07.2023 18:35, Oleksii wrote:
> > > > On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote:
> > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 unsigned long load_end =3D LINK_TO_LOAD(_end);
> > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 unsigned long pt_level_size =3D
> > > > > > XEN_PT_LEVEL_SIZE(i
> > > > > > -
> > > > > > 1);
> > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 unsigned long xen_size =3D ROUNDUP(load_end -
> > > > > > load_start, pt_level_size);
> > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 unsigned long page_entries_num =3D xen_size /
> > > > > > pt_level_size;
> > > > > > +
> > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 while ( page_entries_num-- )
> > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pgtbl[index++].pte =3D 0;
> > > > > > +
> > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 break;
> > > > >=20
> > > > > Unless there's a "not crossing a 2Mb boundary" guarantee
> > > > > somewhere
> > > > > that I've missed, this "break" is still too early afaict.
> > > > If I will add a '2 MB boundary check' for load_start and
> > > > linker_start
> > > > could it be an upstreamable solution?
> > > >=20
> > > > Something like:
> > > > =C2=A0=C2=A0=C2=A0 if ( !IS_ALIGNED(load_start, MB(2) )
> > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0printk("load_start =
should be 2Mb algined\n");
> > > > and
> > > > =C2=A0=C2=A0=C2=A0 ASSERT( !IS_ALIGNED(XEN_VIRT_START, MB(2) )
> > > > in xen.lds.S.
> > >=20
> > > Arranging for the linked address to be 2Mb-aligned is certainly
> > > reasonable. Whether expecting the load address to also be depends
> > > on whether that can be arranged for (which in turn depends on
> > > boot
> > > loader behavior); it cannot be left to "luck".
> > Maybe I didn't quite understand you here, but if Xen has an
> > alignment
> > check of load address then boot loader has to follow the alignment
> > requirements of Xen. So it doesn't look as 'luck'.
>=20
> That depends on (a) the alignment being properly expressed in the
> final binary and (b) the boot loader honoring it. (b) is what you
> double-check above, emitting a printk(), but I'm not sure about (a)
> being sufficiently enforced with just the ASSERT in the linker
> script. Maybe I'm wrong, though.
It should be enough for current purpose but probably I am missing
something.

>=20
> > > > Then we will have completely different L0 tables for identity
> > > > mapping
> > > > and not identity and the code above will be correct.
> > >=20
> > > As long as Xen won't grow beyond 2Mb total. Considering that at
> > > some point you may want to use large page mappings for .text,
> > > .data, and .rodata, that alone would grow Xen to 6 Mb (or really
> > > 8,
> > > assuming .init goes separate as well). That's leaving aside the
> > > realistic option of the mere sum of all sections being larger
> > > than
> > > 2. That said, even Arm64 with ACPI is still quite a bit below
> > > 2Mb.
> > > x86 is nearing 2.5 though in even a somewhat limited config;
> > > allyesconfig may well be beyond that already.
> > I am missing something about Xen size. Lets assume that Xen will be
> > mapped using only 4k pagees ( like it is done now ). Then if Xen
> > will
> > be more then 2Mb then only what will be changed is a number of page
> > tables so it is only question of changing of PGTBL_INITIAL_COUNT (
> > in
> > case of RISC-V).
>=20
> And the way you do the tearing down of the transient 1:1 mapping.
It looks like removing=C2=A01:1 mapping will be the same.

Let's assume that the size of Xen is 4 MB and that load and linker
ranges don't overlap ( load and linker start address are 2Mb aligned ),
and the=C2=A0difference between them isn't bigger than 1 GB. Then one L2
page table, one L1 page table and two L0 page tables for identity
mapping, and two L0 page tables for non-identity mapping are needed.
Then at L1, we will have different indexes for load_start and
linker_start. So what will be needed is to clean two L1 page table
entries started from some index.

The only issue I see now is that it won't work in case if identity
mapping crosses a 1 Gb boundary. Then for identity mapping, it will be
needed two L1 page tables, and only one of them identity mapping will
be removed.

Do I miss anything else?
Wouldn't it be better to take into account that now?

>=20
> > Could you please explain why Xen will grow to 6/8 MB in case of
> > larger
> > page mappings? In case of larger page mapping fewer tables are
> > needed.
> > For example, if we would like to use 2Mb pages then we will stop at
> > L1
> > page table and write an physical address to L1 page table entry
> > instead
> > of creating new L0 page table.
>=20
> When you use 2Mb mappings, then you will want to use separate ones
> for .text, .rodata, and .data (plus perhaps .init), to express the
> differing permissions correctly. Consequently you'll need more
> virtual address space, but - yes - fewer page table pages. And of
> course the 1:1 unmapping logic will again be slightly different.
Thanks for clarification.

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 13:38:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 13:38:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566607.885640 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMTrr-0003cw-DT; Thu, 20 Jul 2023 13:38:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566607.885640; Thu, 20 Jul 2023 13:38:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMTrr-0003cp-AH; Thu, 20 Jul 2023 13:38:55 +0000
Received: by outflank-mailman (input) for mailman id 566607;
 Thu, 20 Jul 2023 13:38:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMTrp-0003cf-Ot; Thu, 20 Jul 2023 13:38:53 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMTrp-00059d-GZ; Thu, 20 Jul 2023 13:38:53 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMTrp-00009N-4W; Thu, 20 Jul 2023 13:38:53 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMTrp-00029z-44; Thu, 20 Jul 2023 13:38:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Ev28AoGmazCx4IKsmAgMrmQ9J+BMKH1J6tv6t1p6G0g=; b=CxNrSZYy5XlE00M9dO3Ql82AA/
	edAZcSeLBZAvSWjOXIzlCIXtcKRIkiBpDZuu5Kfk2M4XQ6OD6+YO4gYbOh6qnWZcl3U6iqJlszBm3
	P+XZp6Gra9s7J1f+bRbElZ/TJnG3Js5OA3sMNRwMKaeI8PHZjzrLQKnycbdoAu89eoWk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181904-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181904: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-xl-qemuu-debianhvm-i386-xsm:xen-install:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=b1c16800e52743d9afd9af62c810f03af16dd942
X-Osstest-Versions-That:
    xen=e04cc8a08df3574bd7d5f7860008f1625e28f8b1
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 20 Jul 2023 13:38:53 +0000

flight 181904 xen-unstable real [real]
flight 181925 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181904/
http://logs.test-lab.xenproject.org/osstest/logs/181925/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm 7 xen-install fail pass in 181925-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181875
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181875
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181875
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181875
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181875
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181875
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181875
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181875
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181875
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181875
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181875
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181875
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 xen                  b1c16800e52743d9afd9af62c810f03af16dd942
baseline version:
 xen                  e04cc8a08df3574bd7d5f7860008f1625e28f8b1

Last test of basis   181875  2023-07-18 11:33:44 Z    2 days
Testing same since   181904  2023-07-19 14:48:14 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alejandro Vallejo <alejandro.vallejo@cloud.com>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  fail    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   e04cc8a08d..b1c16800e5  b1c16800e52743d9afd9af62c810f03af16dd942 -> master


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 13:52:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 13:52:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566621.885681 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMU4L-0006kE-Uo; Thu, 20 Jul 2023 13:51:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566621.885681; Thu, 20 Jul 2023 13:51:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMU4L-0006k7-SE; Thu, 20 Jul 2023 13:51:49 +0000
Received: by outflank-mailman (input) for mailman id 566621;
 Thu, 20 Jul 2023 13:51:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/JYs=DG=citrix.com=prvs=558be806a=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMU4J-0006k1-G4
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 13:51:47 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8f1a4499-2704-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 15:51:45 +0200 (CEST)
Received: from mail-dm6nam12lp2170.outbound.protection.outlook.com (HELO
 NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.170])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 20 Jul 2023 09:51:19 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SN7PR03MB7273.namprd03.prod.outlook.com (2603:10b6:806:2dd::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.28; Thu, 20 Jul
 2023 13:51:17 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 13:51:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8f1a4499-2704-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689861105;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=91QONlkiI9FBg2xpYdlqxYa5oHQXFiEPy8lwDQNxH1k=;
  b=h/7f2bStgJiQ9F3Z32BshLdS0X8zpGdGE8mecZ21NtuPb8YSRdnQrt5u
   682sXQqbGA9vYHpM8NMO8gssg+dXQwMLviAfWUKIKMIqYQSHvKafu1rX+
   Mf0G7A1w++nIdTobPw2DpSGkyfZfulQLz3VdbUPZS7oDT4knmsfuRnYxQ
   8=;
X-IronPort-RemoteIP: 104.47.59.170
X-IronPort-MID: 116745642
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:U/I3mKrSEGv6WaRsXqS6UaNQWlpeBmLLZBIvgKrLsJaIsI4StFCzt
 garIBmEP6mNZWbxfd11b4myoEhXu5aHmIRgSAU5pH0wEnwV8puZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 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LqLuREyuaWK5EwxmN
 fBjh88N4BY6m/XfEuyvRzxsjOQmwoG2jvH8xu1kHHjqcv2SHYTDNdAv5tQdl/851A7tN9x/a
 pX1ybB3qAnRS/orWDY3ZzlRhtqnk27rT4LlvMStWVWVc87ZKVKpYIS0UtJGNMrHT786qogDO
 5yZfusrcp+QBe/VTT0r2NvyNujUjAaGQqHeFELvoiv3z1fjBlCvj4l7f1auk1F2IM2SpFC6e
 iBGL9vjqtyQsgfar84LPsdQOOsY1a9Dy7kASa3GxDKBasHM3XCp9rc+7Mu/tynf5QO0d8bhI
 nBalVFrmQ/EnieRvFm5Kc7siwlfV/NHggEkqplltpEU/zHNfbW2BS4ORETe5DKmYRbPiXZM8
 zDSq6+TcWTaVcGIrw5rzEWa6MiV0X2b/dly+rTe2j+1v4jebeawdDzQbL0GIfHNwoCdyfWPk
 YjNQKDV/moqHrbF0PFvA==
X-Talos-CUID: 9a23:WFEc4WG5AQjOahCmqmJm9VYkQ8EufEfi81D5DH3pG1ljZo2sHAo=
X-Talos-MUID: 9a23:wzZ3egnVMYEWyIjOXi52dnpDK91x2bzxS3kRvqwBpfaBNCtwZjK02WE=
X-IronPort-AV: E=Sophos;i="6.01,218,1684814400"; 
   d="scan'208";a="116745642"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Hklexdhw6smU5GtrkHa+IKPTadcRbPRsgf06/EB5WH5YQXjnHuVJFnhasOA6XoAh86g6R3FoFf9wW1jTZIypBzJyNiMblxDmULxPOMlLBREoCGpRHj0B8IqdCuTqfGMCrByGzYBEE6V+f79shgZIPIyf1dVBJxnfQrQLouMOfWDVdqGTkIwbrGptxqGEBkRVdZ9ATsyfkQ2BeWjzqAvRwlll0r+L96tVmj4p8UUs+TGwG2ZvYrcpAcLG20RRdqrrydgWi3n+52Wb+A5guBpFRK8kyBSVbbnH+VlU54VIQNTV4QmKqFDrjQ8CubiCDlz0y9xAPsyDDxTbrDi8eGSmFA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=vCQlYJOl/406gLgRUbair3VkQa9t1mHIdjh+qgkBVbw=;
 b=E1NnCTdsy9Wb4B7szy9cfZuWys47EH24PUYQ7PYPUWpoosl27cNiETN0xpXjA46qlv4CzQrqzBPYkjByhfCXYmJ7FLfEQvptaTbsM8p8se7f82nNC749mSx569NPONLNRCC1UPfauX78N9K2AOdxeT/s0U2wAPpQelTMhPBd5gfYj/jZMPsX8gIOd2NQvxE1biNwzF5SbCaziYh5gLM+S9zUe4+qO6qkak0dpLPJWTt9KILhGQ90K+p0ri1U4YVJRp85DInJtspnAiYglebfW2DMy+oFeJ+IJNixdEupwN4foiuqKMw5oTCn28UP3IIdtssGjJTWMsclIBkONewayw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=vCQlYJOl/406gLgRUbair3VkQa9t1mHIdjh+qgkBVbw=;
 b=IceN4FNUMjKVgwNCpdezRwOXxROD8ZAu2UH1mMoc/P1oGBP4+BN8BFgC9S2a3bu+Qv9zm5x+iIMK2/r40nZs+xim+BSfgYOYd/QqOxIPeA5dedm8KQsp8g+CcrOjvXOiEeP76DJAEh3F+QF4iUIN3y5watUhDafbThCvq1XUg18=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Thu, 20 Jul 2023 15:50:58 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Message-ID: <ZLk7wh39Cc3GdIuB@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local>
 <08ec7e54-1abf-5e1e-e1ee-7026a69e0279@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <08ec7e54-1abf-5e1e-e1ee-7026a69e0279@suse.com>
X-ClientProxiedBy: LO2P265CA0420.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:a0::24) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SN7PR03MB7273:EE_
X-MS-Office365-Filtering-Correlation-Id: 322517c2-5cd6-49a4-b027-08db892863d5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	qBTmrfP1Cxq+yD2UMgvrApvs9m3muflH1RXb1ULs39j9JrMKiiua1kdyewLldGCI4bpflRp+aYAWzU8KOv9SM8GLH4Xyz9VFmgWuqXk+3N5Nu3WJUuwxJG16p3bPmMQyovrrQ9i+xrNKpKXk79vRUSzLLxwtJdZPG5+ZuLDyhOOrmP8nj9/J5acrhJvrMKj6ltQnmn5qEXY45x20yNpX4zq1iaK8Qacd2qtTnOZBig/5Bp3XQWMnHGFd8H9iR+TPI21qP+bbBj8cgd1ypOCuNrxPvztTyUb4535xlimpe7kmnRzAXcvYsOrwIIlsAjyY+5oPbauP6KSwrkTA38SPqyY9w94vQNy3xzFyj+Q4Li6LSjAtYQeFdJmZ0bGBGY20zaZJWT/YXTcxHwp/fR7aRdqYdw2k0woVU/p/+67RC+RVnmrw0h8r50pr6dfCzXmWKE1d2+zwCPn9JnMEUq+s4vuOxsCX8oQ6WJvT8C9UOiBgZBgymMz28huYjmTzprnNjjEmU6e75wJopV/fcZ3KI7L3QKUZTprS4okI60YtZSS/6eYvZ9R72iOYA5vZbInS
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(346002)(376002)(396003)(39860400002)(136003)(451199021)(6666004)(9686003)(478600001)(6512007)(86362001)(53546011)(82960400001)(26005)(6506007)(6486002)(4326008)(8676002)(66946007)(54906003)(41300700001)(66556008)(6916009)(2906002)(38100700002)(5660300002)(316002)(66476007)(8936002)(186003)(83380400001)(85182001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bXYzSnNkY0RSdnE4UHd5MVdrY0grQktNUktMb0NWZVhXQmxSdXAyZUFsUUJU?=
 =?utf-8?B?RTdWRnp6ak1FNURURitPU1Jkem8yZEl6YlJydWpwbTFMNjdNYlVqN0YybEQ2?=
 =?utf-8?B?dUJHU091d1ZOWTVOUXFGNEFjNzJGZnZmcHI2b0FtNHA4aE0yTkNPYm1Cd1hm?=
 =?utf-8?B?dFZTRlFkNEZubk9oWVlXRitNRkp0STZESUtIQ0tSN3hiQWxMejNqYmQ4RmJO?=
 =?utf-8?B?UW5yTDhlN1JDOVg5N1pXY283UW1Ma29FZU0xeHo3QWRDbU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wpznlfr2VSkRT3q/MxZgHjobC2ucQwK4P++2xk48qup9gt3zarEGzF7BT2hbbkjC/JfWbnRw==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 322517c2-5cd6-49a4-b027-08db892863d5
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 13:51:17.2719
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: nV06r7ZCUEAbp6+1IxNZlofv7mgoxB258XNhJwwbCdiTFbfxXmn36CpoBW9/ZBgRztCa6rdnibmwuBiL4c1Vxg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR03MB7273

On Thu, Jul 20, 2023 at 03:27:29PM +0200, Jan Beulich wrote:
> On 20.07.2023 13:20, Roger Pau MonnÃ© wrote:
> > On Thu, Jul 20, 2023 at 12:32:31AM +0000, Volodymyr Babchuk wrote:
> >> @@ -447,8 +476,16 @@ void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
> >>  
> >>      /*
> >>       * Find the PCI dev matching the address, which for hwdom also requires
> >> -     * consulting DomXEN.  Passthrough everything that's not trapped.
> >> +     * consulting DomXEN. Passthrough everything that's not trapped.
> >> +     * If this is hwdom, we need to hold locks for both domain in case if
> >> +     * modify_bars is called()
> > 
> > Typo: the () wants to be at the end of modify_bars().
> > 
> >>       */
> >> +    read_lock(&d->pci_lock);
> >> +
> >> +    /* dom_xen->pci_lock always should be taken second to prevent deadlock */
> >> +    if ( is_hardware_domain(d) )
> >> +        read_lock(&dom_xen->pci_lock);
> > 
> > For modify_bars() we also want the locks to be in write mode (at least
> > the hw one), so that the position of the BARs can't be changed while
> > modify_bars() is iterating over them.
> 
> Isn't changing of the BARs happening under the vpci lock?

It is.

> Or else I guess
> I haven't understood the description correctly: My reading so far was
> that it is only the presence (allocation status / pointer validity) that
> is protected by this new lock.

Hm, I see, yes.  I guess it was a previous patch version that also
took care of the modify_bars() issue by taking the lock in exclusive
mode here.

We can always do that later, so forget about that comment (for now).

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 14:07:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 14:07:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566625.885695 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMUJ5-0000Ot-7c; Thu, 20 Jul 2023 14:07:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566625.885695; Thu, 20 Jul 2023 14:07:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMUJ5-0000Om-3v; Thu, 20 Jul 2023 14:07:03 +0000
Received: by outflank-mailman (input) for mailman id 566625;
 Thu, 20 Jul 2023 14:07:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6Xo+=DG=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMUJ4-0000Og-8U
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 14:07:02 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on2062a.outbound.protection.outlook.com
 [2a01:111:f400:fe16::62a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b20962ca-2706-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 16:07:01 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PR3PR04MB7212.eurprd04.prod.outlook.com (2603:10a6:102:8c::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Thu, 20 Jul
 2023 14:06:57 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 14:06:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b20962ca-2706-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=k37neeL/b2ADppTgg0yenLMeJZ/SE373fCDs9Op3FtpvB/jEf1pIIy6XKbuucfr+jjVWSHiWQ+zTqEXH7+VuldL3r6tGtvoxu4XBo3B96aNGIqh1JrgTrHzQ00S7NnHFyFSittzT4NEp5XFBirY6m7XQ2OFw4MwaUgdSU/INZIwgQVOnXQJLt2mRtMnuWAayMrIn/O5ixrD1aXJSMd4/L4xn0U+4Xcsj7SWFh9T8JcDiIztBFAoLXm0i9QITYjTb5UHhdpn7kolth9SVB8iJmMvoHfAbdGAhaxUahrD19vpz8FTYPWFnInq77HVe10tXSx6zEN0asdQmDwZ3nT6zQA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=tXpx28HhuSXyy3ZIGUgg5vvDxd1cieZ6+priZYEauxM=;
 b=PtFN+1asFOA5jRoznJ2mf1VnRpcT//gacbVdGHVXeN++9vWPFlGUNCpX5Fi8tZqG1E36XMMInRaKeNS3PK9V/o+qioQ5Lccf3urPvU+Vohn36LL/HcuQjHcjgLzPhNprpaCTHY4NXR1MZKjv5GzhpV5J7Lg4jQvOiZWr+bCLPFbMGjzkjn3wdBtmZCIpGhRo5DuLuTAPOxr8nWGnjZTdDOypCAzI1gDqxVKXLSodBEhQWZOhKd5FxxwsprnB0YWUVIDbd0wjmPrv2IztfxbIDPhGvBGoU5m1R/iOdcvwK1MC38Gc6OMay9AtOp2qW1ygLQ/CGh6cdRWc99omweMCKA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=tXpx28HhuSXyy3ZIGUgg5vvDxd1cieZ6+priZYEauxM=;
 b=hx5h651LoLCfEKKBviBWT8mwDaqI6sLEWdyR3EDqP5d2TU2cA0+gByfIfu0mFddrWbRZQkEzfhODI00jLBRwl63g8emBLUIiK7VrnstV4tox085VWgoUrjisHXUYV5mttGSY3HiCIoU3bKSodOkKvHfVF3oy6afyg2XWLvAdRFBaw4areGxM96K1ZtP+GC1+xq6rztnYE70Dm9ewqGG40FlXJDMW6nFkFsL40sIvMJGURby243yWjnRCeAB5rgQ9yhCFGzXBrbxywjK0gp5cbIJu4l9BEegnDbtNYWRCXavlTR9yhcgJeqF5YVk26jKoxGGWs5kR/Okvwv+yvTcatw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <5fd13b50-5e9f-162f-0148-0697c6194a4e@suse.com>
Date: Thu, 20 Jul 2023 16:06:55 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1689604562.git.oleksii.kurochko@gmail.com>
 <8c69050d7b1f42df5e776ca9494164a4d15f2d52.1689604562.git.oleksii.kurochko@gmail.com>
 <ad53c037-3c1b-ff1a-93df-b79ab2948174@suse.com>
 <30540953fb363fce4dfd59f8a7e709247a9872fd.camel@gmail.com>
 <c1a3d447-4b4d-cd9f-642d-e30fed088302@suse.com>
 <0cbf6a69e8ae08f6b85edcc4f8d53a84e0103d8b.camel@gmail.com>
 <ad72e892-2ec0-5188-f3bc-6d33544c775a@suse.com>
 <fce99ab86730de77a82e60efc2c550a3f52a2443.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <fce99ab86730de77a82e60efc2c550a3f52a2443.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0024.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:14::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PR3PR04MB7212:EE_
X-MS-Office365-Filtering-Correlation-Id: dd7c8546-e62a-43fe-9157-08db892a946e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	hMZzbeJmhatPq6gOwysvjrPVF92SCmZHviiKd+ggMSG4lTFlxbwuE8N3+C3IwBkle7zLxgbB16Tu8toYIfewdbzgy1gCdz9k9la0hUZ/obkxlZoMkTsnXbJX0lz9Sj6QchM22qmah0SzA8utj3OOUhMu0VQ5XzQ/R2gKRRIHe0dJMACk1MGx79QUKHkOI3BaOU6Dek09toc1gkemnxbS321RavU/oVIhk+ElJj2kRCqrb68ixmIPx3wvvciZJuX1pG9GXY0f/Ntq/JNu1+nCBB+KFRZ+Qg7yYWsTNlQboUbsMnetkylHqRfdl9JmZQ4FESIif8qz3qa4VkH6Z1hBTrVvG87ZcwPWlQxWtsocDdl1TsNALyHxEyABIN5prya6+n0xZNGLSz3EPCT+aPTXbIgLJKDGainNlHymZAQ2YvnW2nJNhEUgDjsiCKMsy2U/6otbIl2mogj2RjGYhZrtZP5Ao8ZTMlWCr96bp5swdl+CWS2qXeZhcIwg3OEfrA7dv9XRCgmzg33Zkfu9M7rQXt8TwDJrWTjpuUGZmSbBVc61Av4jbtcb9Ha9nCg7fni0oxjOlHbDkq+l6wwXtaF/AQsepwxvWcV6GiSfFI0gmawZcxdw0XnzRaBwe9s949T6Y0S+AdsXCDXhiP769XL6Kg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(136003)(396003)(376002)(39860400002)(346002)(451199021)(31686004)(4326008)(6512007)(316002)(41300700001)(26005)(6506007)(186003)(53546011)(54906003)(5660300002)(6486002)(66556008)(66946007)(66476007)(8676002)(8936002)(6916009)(478600001)(2616005)(83380400001)(2906002)(38100700002)(86362001)(36756003)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eEVJbkd5cnU0TUxuUW5NNkM5Z3dEcjlMSVZoTFg5VGMvTHRFbk9MOVkxMHAw?=
 =?utf-8?B?N0RrRlprdDBzRHJDbVdrUDNraUpjOUJGS1FSbGgxVUkrT0E3WnRaWERWQWd2?=
 =?utf-8?B?NGxvMXVnYU9ZbWt5MlVvVCtCRmF3d3JYNjdueTVZNFpFRVVMN2U3MVpUTVZo?=
 =?utf-8?B?Y3ZFeDRZUXErZ1NIZmZ0ODBGdGFJMWRWQjE4NFprQUo0STRxeVhxQkM0dG8y?=
 =?utf-8?B?NTNzajBBV2ppRjZiZXRYdnAxWmx3ZE9POUJoUTBmTFphRnBIZWdGUWhqTDR0?=
 =?utf-8?B?RGtRTHZlcXlFMjJXZHk5L2wrN3FjbHV2UThjcTJDN1MrbmNXVGo3YjlGY0dr?=
 =?utf-8?B?VitaVVIyUmdTRS9TelE3ZGd1THB5YW5ObWJKWEdwbE51Y3BkcnJHU1JoSlVZ?=
 =?utf-8?B?UzROcnl0eCttbEFFR0FzL0tERFJQRjd0U2ZYL0R5ODY4cEVBc3RTcDRYMW14?=
 =?utf-8?B?L3ovZy9ZQTVWSFlzdlZuSnZpNUdaSUJRa2lSRXZGb2ZzTERTY3FDelJaM3U4?=
 =?utf-8?B?OUtYZkJsbG1aQnBOcVNXWXMrZnZ6WW1vRTRJb0pwdnZJcEw2WkthYTJEWEh4?=
 =?utf-8?B?RTM4R0lLMHRaemNtbGRpcjNkQVBwTjZBdXB5RnhIYVFEZXVBS3JoV00rNWs4?=
 =?utf-8?B?NnlyYzNLVCt4ZzRJMzRQSVZidXFTdXM1W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?utf-8?B?a3FTTlNIczhWZE1XV3FnSEF1R21ad0hVUVl6d3ZrKzh4SVh4RXk5Y2ovaGVX?=
 =?utf-8?B?Rm9FL3IwWXV2WWhOU0ZoempvSndJN1J0VWhvS1NzVkZTVnBQdytpb3hRd3NY?=
 =?utf-8?B?bXN0MEpjbVJ5NGVuN3FNeGEweW04VStkN2ZSNHl2bjVXcGwra0o5aVJXMzk0?=
 =?utf-8?B?eloxOEU2TEFIdjNlemVwSE1zZHd5Y3RRNFkxa3JRd1huK1U3dmxpS3c0MEo2?=
 =?utf-8?B?cEJqcDBzeFVhK2lnTDgxa2hrNmx4YjVtdlM4c0g0bmlUakhENk56bE5xeTJQ?=
 =?utf-8?B?Nk1DT0ZHYlczSlhwdVRWMmF0L1UwbmFTYnljU1JYOXBJOFdJU2pUT2VzTFpB?=
 =?utf-8?B?MWYxM1RPZlE3RGRDV1FvQllwYmZNclRIa2hJVWh4eW5jNkYzTWNSV25JTnVj?=
 =?utf-8?B?OE5PcHcxTWxyZWlCTWJHaklCT0srR1hRYWtUdDJjTzk5RXpKT0h2eW1GVXVl?=
 =?utf-8?B?ajhzakxRcVd5RDJhT0xobFFBUzREV3IyQ1BibzhpNlluckY2UHd6U3Jwc1l2?=
 =?utf-8?Q?FlwkJ3haoTdp9ok+l5vqdqq9o?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: dd7c8546-e62a-43fe-9157-08db892a946e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 14:06:57.6843
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: rhqcIW+sm8CbMPf1wxn8vvXy7bEw0Xb0rt9z6tVISMEO5pXqUwWEvZVnh1Aq1xqvD0BsJ02zrO8Si5YEchtRNA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7212

On 20.07.2023 15:34, Oleksii wrote:
> On Thu, 2023-07-20 at 12:29 +0200, Jan Beulich wrote:
>> On 20.07.2023 10:28, Oleksii wrote:
>>> On Thu, 2023-07-20 at 07:58 +0200, Jan Beulich wrote:
>>>> On 19.07.2023 18:35, Oleksii wrote:
>>>>> Then we will have completely different L0 tables for identity
>>>>> mapping
>>>>> and not identity and the code above will be correct.
>>>>
>>>> As long as Xen won't grow beyond 2Mb total. Considering that at
>>>> some point you may want to use large page mappings for .text,
>>>> .data, and .rodata, that alone would grow Xen to 6 Mb (or really
>>>> 8,
>>>> assuming .init goes separate as well). That's leaving aside the
>>>> realistic option of the mere sum of all sections being larger
>>>> than
>>>> 2. That said, even Arm64 with ACPI is still quite a bit below
>>>> 2Mb.
>>>> x86 is nearing 2.5 though in even a somewhat limited config;
>>>> allyesconfig may well be beyond that already.
>>> I am missing something about Xen size. Lets assume that Xen will be
>>> mapped using only 4k pagees ( like it is done now ). Then if Xen
>>> will
>>> be more then 2Mb then only what will be changed is a number of page
>>> tables so it is only question of changing of PGTBL_INITIAL_COUNT (
>>> in
>>> case of RISC-V).
>>
>> And the way you do the tearing down of the transient 1:1 mapping.
> It looks like removingÂ 1:1 mapping will be the same.
> 
> Let's assume that the size of Xen is 4 MB and that load and linker
> ranges don't overlap ( load and linker start address are 2Mb aligned ),
> and theÂ difference between them isn't bigger than 1 GB. Then one L2
> page table, one L1 page table and two L0 page tables for identity
> mapping, and two L0 page tables for non-identity mapping are needed.
> Then at L1, we will have different indexes for load_start and
> linker_start. So what will be needed is to clean two L1 page table
> entries started from some index.
> 
> The only issue I see now is that it won't work in case if identity
> mapping crosses a 1 Gb boundary. Then for identity mapping, it will be
> needed two L1 page tables, and only one of them identity mapping will
> be removed.
> 
> Do I miss anything else?

Looks correct to me.

> Wouldn't it be better to take into account that now?

Sure, it's generally better to avoid leaving traps for someone to
fall into later.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 14:24:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 14:24:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566629.885709 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMUZT-0003at-Lf; Thu, 20 Jul 2023 14:23:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566629.885709; Thu, 20 Jul 2023 14:23:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMUZT-0003am-GZ; Thu, 20 Jul 2023 14:23:59 +0000
Received: by outflank-mailman (input) for mailman id 566629;
 Thu, 20 Jul 2023 14:23: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
 <SRS0=BeWc=DG=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qMUZR-0003ag-TA
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 14:23:58 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0de9ef0d-2709-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 16:23:53 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.162.143.190])
 by support.bugseng.com (Postfix) with ESMTPSA id D03644EE0C89;
 Thu, 20 Jul 2023 16:23:51 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0de9ef0d-2709-11ee-8611-37d641c3527e
Message-ID: <520e15bf-05d0-5808-e318-14524ed78ab3@bugseng.com>
Date: Thu, 20 Jul 2023 16:23:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally
 uninitialized variables
Content-Language: en-US
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <1ad20473a031eca75db4007bdc169616b512ef44.1689329728.git.nicola.vetrini@bugseng.com>
 <97d8a796-f790-8efc-1d89-def1f1193e61@xen.org>
 <5da7ae40-35c7-7f93-824f-42a0712cdcf1@bugseng.com>
 <9cac9bc5-ad55-3bcd-b645-a30a5b863b3f@xen.org>
 <26008624-b00c-ecd2-77e0-3f1cad63db66@bugseng.com>
In-Reply-To: <26008624-b00c-ecd2-77e0-3f1cad63db66@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 20/07/23 12:14, Nicola Vetrini wrote:
> 
> 
> On 17/07/23 15:40, Julien Grall wrote:
>> Hi Nicola,
>>
>> On 17/07/2023 13:08, Nicola Vetrini wrote:
>>> On 14/07/23 15:00, Julien Grall wrote:
>>>> Hi Nicola,
>>>>
>>>> On 14/07/2023 12:49, Nicola Vetrini wrote:
>>>>> This patch aims to fix some occurrences of possibly uninitialized
>>>>> variables, that may be read before being written. This behaviour would
>>>>> violate MISRA C:2012 Rule 9.1, besides being generally undesirable.
>>>>>
>>>>> In all the analyzed cases, such accesses were actually safe, but it's
>>>>> quite difficult to prove so by automatic checking, therefore a safer
>>>>> route is to change the code so as to avoid the behaviour from 
>>>>> occurring,
>>>>> while preserving the semantics.
>>>>>
>>>>> To achieve this goal, I adopted the following strategies:
>>>>
>>>> Please let's at least one patch per strategy. I would also consider 
>>>> some of the rework separate so they can go in regardless the 
>>>> decision for the SAF-*.
>>>>
>>>>>
>>>>> - Add a suitably formatted local deviation comment
>>>>> Â Â  (as indicated in 'docs/misra/documenting-violations.rst')
>>>>> Â Â  to exempt the following line from checking.
>>>>>
>>>>> - Provide an initialization for the variable at the declaration.
>>>>>
>>>>> - Substitute a goto breaking out of control flow logic with a 
>>>>> semantically
>>>>> Â Â  equivalent do { .. } while(0).
>>>>
>>>> As I already mentioned in private, it is unclear to me how you 
>>>> decided which strategy to use. I still think we need to define our 
>>>> policy before changing the code. Otherwise, it is going to be 
>>>> difficult to decide for new code.
>>>>
>>>
>>> The main point of this RFC is doing so. From what I gathered, it's 
>>> not an easy task: sometimes there are no 'safe' values to initialize 
>>> variables to and sometimes there is no easy way to prove that indeed 
>>> something is always initialized or not accessed at all.
>>
>> But you wrote the code. So you should be able to explain how you took 
>> the decision between one and the others.
>>
>> Also, even if this is an RFC, it would have been good to summarize any 
>> discussion that happened in private and if there were concern try to 
>> come up with ideas or at least listing the concerns after '---.
>>
> 
> I'll keep this if the need arises in the future.
> 
>>>
>>>>>
>>>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>>>> ---
>>>>> Â  docs/misra/safe.jsonÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  8 +++++++
>>>>> Â  xen/arch/arm/arm64/lib/find_next_bit.c |Â  1 +
>>>>> Â  xen/arch/arm/bootfdt.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  6 +++++
>>>>> Â  xen/arch/arm/decode.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  2 ++
>>>>> Â  xen/arch/arm/domain_build.cÂ Â Â Â Â Â Â Â Â Â Â  | 29 ++++++++++++++++++----
>>>>> Â  xen/arch/arm/efi/efi-boot.hÂ Â Â Â Â Â Â Â Â Â Â  |Â  6 +++--
>>>>> Â  xen/arch/arm/gic-v3-its.cÂ Â Â Â Â Â Â Â Â Â Â Â Â  |Â  9 ++++---
>>>>> Â  xen/arch/arm/mm.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  1 +
>>>>> Â  xen/arch/arm/p2m.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  | 33 
>>>>> +++++++++++++++-----------
>>>>> Â  9 files changed, 69 insertions(+), 26 deletions(-)
>>>>>
>>>>> diff --git a/docs/misra/safe.json b/docs/misra/safe.json
>>>>> index e3c8a1d8eb..244001f5be 100644
>>>>> --- a/docs/misra/safe.json
>>>>> +++ b/docs/misra/safe.json
>>>>> @@ -12,6 +12,14 @@
>>>>> Â Â Â Â Â Â Â Â Â  },
>>>>> Â Â Â Â Â Â Â Â Â  {
>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  "id": "SAF-1-safe",
>>>>> +Â Â Â Â Â Â Â Â Â Â Â  "analyser": {
>>>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  "eclair": "MC3R1.R9.1"
>>>>> +Â Â Â Â Â Â Â Â Â Â Â  },
>>>>> +Â Â Â Â Â Â Â Â Â Â Â  "name": "Rule 9.1: initializer not needed",
>>>>> +Â Â Â Â Â Â Â Â Â Â Â  "text": "The following local variables are possibly 
>>>>> subject to being read before being written, but code inspection 
>>>>> ensured that the control flow in the construct where they appear 
>>>>> ensures that no such event may happen."
>>>> I am bit concerned which such statement because the code instance 
>>>> was today with the current code. This could change in the future and 
>>>> invalide the reasoning.
>>>>
>>>> It is not clear to me if we have any mechanism to prevent that. If 
>>>> we don't, then I think we need to drastically reduce the number of 
>>>> time this is used (there are a bit too much for my taste).
>>>>
>>>
>>> Indeed, the purpose of such a deviation is that the sound 
>>> overapproximation computed by the tool requires a human to look at 
>>> the code and think twice before modifying it (i.e., if ever that code 
>>> is touched, the reviewer ought to assess whether that justification 
>>> still holds or some other thing should be done about it.
>>
>> Your assumption is the reviewer will notice there is an existing 
>> devitation and be able to assess it has changed. I view this 
>> assumption as risky in the long term.
>>
>> Have you investigate to improve the automatic tooling?
>>
> 
> Well, as discussed elsewhere in the thread, a slightly modified version 
> of this deviation comment can list the specific reason why such a thing 
> was deviated directly at the declaration or where the caution is, if you 
> think this is better.
> 
> Example:
> 
> // <- SAF-x here
> int var;
> 
> [...]
> 
> // <- or HERE
> f(&var);
> 
> An alternative approach to justification, partly discussed with Stefano 
> in private is a macro that looks like an attribute to signal that the 
> variable is intentionally uninitialized. This does not have the benefit 
> of a written justification with a proper comment or an entry in the json 
> file, but is less intrusive and the justification for all occurrences of 
> __uninit w.r.t R9.1 would be included in the static analysis tool 
> configuration, which would be part of the MISRA compliance 
> documentation. This does imply a coarse justification like the one 
> above, but if further clarification is needed it can be provided locally 
> in the code, as guidance for contributors.
> 
> Example:
> #define __uninit
> 
> __uninit int x;
> 
>>>
>>>>> +Â Â Â Â Â Â Â  },
>>>>> +Â Â Â Â Â Â Â  {
>>>>> +Â Â Â Â Â Â Â Â Â Â Â  "id": "SAF-2-safe",
>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  "analyser": {},
>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  "name": "Sentinel",
>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  "text": "Next ID to be used"
>>>>> diff --git a/xen/arch/arm/arm64/lib/find_next_bit.c 
>>>>> b/xen/arch/arm/arm64/lib/find_next_bit.c
>>>>> index ca6f82277e..51b852c595 100644
>>>>> --- a/xen/arch/arm/arm64/lib/find_next_bit.c
>>>>> +++ b/xen/arch/arm/arm64/lib/find_next_bit.c
>>>>> @@ -67,6 +67,7 @@ unsigned long find_next_zero_bit(const unsigned 
>>>>> long *addr, unsigned long size,
>>>>> Â  {
>>>>> Â Â Â Â Â  const unsigned long *p = addr + BIT_WORD(offset);
>>>>> Â Â Â Â Â  unsigned long result = offset & ~(BITS_PER_LONG-1);
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  unsigned long tmp;
>>>>
>>>> This is a file that was copied as-is from Linux. I thought we 
>>>> exclude them.
>>>
>>> There was an expansion location in the report that caused that file 
>>> to appear in the output. Thanks for reporting it.
>>>
>>>>
>>>> Anyway, can you provide some details why Eclair thinks this is may 
>>>> be used unitialized?
>>>
>>> The problem lies in the goto skipping out of control flow structures. 
>>> It can't be refactored with a "do { tmp=...; break; } while(0)", as 
>>> done elsewhere, because there are two distinct labels in there, so 
>>> the semantics would be altered. The same comment applies in other 
>>> instances as well.
>>>
>>>>
>>>>> Â Â Â Â Â  if (offset >= size)
>>>>> diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
>>>>> index 2673ad17a1..1292a64e8d 100644
>>>>> --- a/xen/arch/arm/bootfdt.c
>>>>> +++ b/xen/arch/arm/bootfdt.c
>>>>> @@ -34,6 +34,7 @@ static bool __init device_tree_node_matches(const 
>>>>> void *fdt, int node,
>>>>> Â  static bool __init device_tree_node_compatible(const void *fdt, 
>>>>> int node,
>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const char *match)
>>>>> Â  {
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  int len, l;
>>>>
>>>> It is unclear to me whether the SAF-* applies to 'len' or 'l'.
>>>
>>> Just len, they need to be two separate declarations if it is agreed 
>>> not to initialize it. Good catch.
>>>
>>>>
>>>>> Â Â Â Â Â  const void *prop;
>>>>> @@ -169,7 +170,9 @@ int __init device_tree_for_each_node(const void 
>>>>> *fdt, int node,
>>>>> Â Â Â Â Â Â  */
>>>>> Â Â Â Â Â  int depth = 0;
>>>>> Â Â Â Â Â  const int first_node = node;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  u32 address_cells[DEVICE_TREE_MAX_DEPTH];
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  u32 size_cells[DEVICE_TREE_MAX_DEPTH];
>>>>
>>>> I have never sent formally, but in the past I proposed to rework the 
>>>> code so {address, size}_cells[0] would be initialized before the 
>>>> loop. See 
>>>> https://lore.kernel.org/all/ea06f2ac-4ac1-4a6f-bda6-e775a7e68699@xen.org/.
>>>>
>>>> Do you think this would help?
>>>
>>> If that initialization is applied to all the array elements yes, 
>>> because the Amplification of R9.1 says:
>>> "For the purposes of this rule, an array element or structure member 
>>> shall be considered as a discrete
>>> object".
>>> Otherwise, initializing just the first element does not improve the 
>>> situation in any way, and this is currently not within of the 
>>> analysis capabilities of ECLAIR.
>>
>> Any plan to improve ECLAIR?
>>
> 
> Not in the short term on this. See further below.
> 
>>>
>>>>
>>>>> Â Â Â Â Â  int ret;
>>>>> @@ -249,8 +252,10 @@ static void __init 
>>>>> process_multiboot_node(const void *fdt, int node,
>>>>> Â Â Â Â Â  const __be32 *cell;
>>>>> Â Â Â Â Â  bootmodule_kind kind;
>>>>> Â Â Â Â Â  paddr_t start, size;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  int len;
>>>>> Â Â Â Â Â  /* sizeof("/chosen/") + DT_MAX_NAME + '/' + DT_MAX_NAME + 
>>>>> '/0' => 92 */
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1*/
>>>>> Â Â Â Â Â  char path[92];
>>>>
>>>> So the two above, is one category of issue. The variables are passed 
>>>> as argument of function which will fill them.
>>>>
>>>> Can Eclair look at the callers, if so, can we consider to always 
>>>> initialize the values in the callee?
>>>>
>>>> This would reduce the number of SAF-*. There are a few other 
>>>> examples like that below. So I will skip them for now.
>>>>
>>>> [...]
>>>>
>>>
>>> If the value is always initialized in the callee, then there's no 
>>> problem configuring ECLAIR so that it knows that this parameter is 
>>> always written, and therefore any subsequent use in the caller is ok.
>>>
>>> Another possibility is stating that a function never reads the 
>>> pointee before writing to it (it may or may not write it, but if it 
>>> doesn't, then the pointee is not read either). The 'strncmp' after 
>>> 'fdt_get_path' does get in the way, though, because this property is 
>>> not strong enough to ensure that we can use 'path' after returning 
>>> from the function.
>>
>> I am not sure I fully understand what you wrote. Can you provide a C 
>> example?
>>
> 
> void f(int *x) {
>  Â  if(x) {
>  Â Â Â  *x = 10;
>  Â Â Â  int y =*x; // read the pointee after it's initialized
>  Â  } else {
>  Â Â Â  int z; // in this branch the pointee is not read nor written
>  Â  }
>  Â  // we can say that f never reads *x before (possibly) writing to it.
> }
> 
>>>
>>>>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>>>>> index d0d6be922d..d43f86c2f0 100644
>>>>> --- a/xen/arch/arm/domain_build.c
>>>>> +++ b/xen/arch/arm/domain_build.c
>>>>> @@ -62,7 +62,7 @@ custom_param("dom0_mem", parse_dom0_mem);
>>>>> Â  int __init parse_arch_dom0_param(const char *s, const char *e)
>>>>> Â  {
>>>>> -Â Â Â  long long val;
>>>>> +Â Â Â  long long val = LLONG_MAX;
>>>>
>>>> Can you explain why you decided to initialize rather than SAF-? For 
>>>> clarity, I am not asking to switch to SAF-, I am mainly interested 
>>>> what were your though process.
>>>>
>>>
>>> I saw that putting a large enough value here would be out of range 
>>> and trigger the printk even if the conditional leads to somehow enter 
>>> the if branch with an invalid value.
>>
>> Ok. This wants to be documented on top of the assignment.
>>
> 
> Ok. While testing this I also switched to LONG_MAX, whose definition is 
> already available in that file, and does not alter the semantics anyway.
> 
>>>
>>>>> Â Â Â Â Â  if ( !parse_signed_integer("sve", s, e, &val) )
>>>>> Â Â Â Â Â  {
>>>>> @@ -1077,6 +1077,7 @@ static void __init 
>>>>> assign_static_memory_11(struct domain *d,
>>>>> Â  static int __init handle_linux_pci_domain(struct kernel_info *kinfo,
>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const struct 
>>>>> dt_device_node *node)
>>>>> Â  {
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  uint16_t segment;
>>>>> Â Â Â Â Â  int res;
>>>>> @@ -1351,6 +1352,7 @@ static int __init make_memory_node(const 
>>>>> struct domain *d,
>>>>> Â Â Â Â Â  unsigned int i;
>>>>> Â Â Â Â Â  int res, reg_size = addrcells + sizecells;
>>>>> Â Â Â Â Â  int nr_cells = 0;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1*/
>>>>> Â Â Â Â Â  __be32 reg[NR_MEM_BANKS * 4 /* Worst case addrcells + 
>>>>> sizecells */];
>>>>> Â Â Â Â Â  __be32 *cells;
>>>>> @@ -1578,6 +1580,7 @@ static int __init 
>>>>> find_unallocated_memory(const struct kernel_info *kinfo,
>>>>> Â Â Â Â Â  struct rangeset *unalloc_mem;
>>>>> Â Â Â Â Â  paddr_t start, end;
>>>>> Â Â Â Â Â  unsigned int i;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  int res;
>>>>> Â Â Â Â Â  dt_dprintk("Find unallocated memory for extended regions\n");
>>>>> @@ -1727,6 +1730,7 @@ static int __init find_memory_holes(const 
>>>>> struct kernel_info *kinfo,
>>>>> Â Â Â Â Â  dt_for_each_device_node( dt_host, np )
>>>>> Â Â Â Â Â  {
>>>>> Â Â Â Â Â Â Â Â Â  unsigned int naddr;
>>>>> +Â Â Â Â Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â Â Â Â Â  paddr_t addr, size;
>>>>> Â Â Â Â Â Â Â Â Â  naddr = dt_number_of_address(np);
>>>>> @@ -1976,9 +1980,11 @@ static int __init make_cpus_node(const 
>>>>> struct domain *d, void *fdt)
>>>>> Â Â Â Â Â  const struct dt_device_node *npcpu;
>>>>> Â Â Â Â Â  unsigned int cpu;
>>>>> Â Â Â Â Â  const void *compatible = NULL;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  u32 len;
>>>>> Â Â Â Â Â  /* Placeholder for cpu@ + a 32-bit hexadecimal number + \0 */
>>>>> Â Â Â Â Â  char buf[13];
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  u32 clock_frequency;
>>>>> Â Â Â Â Â  /* Keep the compiler happy with -Og */
>>>>> Â Â Â Â Â  bool clock_valid = false;
>>>>> @@ -2104,6 +2110,7 @@ static int __init make_gic_node(const struct 
>>>>> domain *d, void *fdt,
>>>>> Â Â Â Â Â  const struct dt_device_node *gic = dt_interrupt_controller;
>>>>> Â Â Â Â Â  int res = 0;
>>>>> Â Â Â Â Â  const void *addrcells, *sizecells;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  u32 addrcells_len, sizecells_len;
>>>>> Â Â Â Â Â  /*
>>>>> @@ -2179,6 +2186,7 @@ static int __init make_timer_node(const 
>>>>> struct kernel_info *kinfo)
>>>>> Â Â Â Â Â  int res;
>>>>> Â Â Â Â Â  unsigned int irq[MAX_TIMER_PPI];
>>>>> Â Â Â Â Â  gic_interrupt_t intrs[3];
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  u32 clock_frequency;
>>>>> Â Â Â Â Â  bool clock_valid;
>>>>> @@ -2511,6 +2519,7 @@ static int __init handle_device(struct domain 
>>>>> *d, struct dt_device_node *dev,
>>>>> Â Â Â Â Â  unsigned int naddr;
>>>>> Â Â Â Â Â  unsigned int i;
>>>>> Â Â Â Â Â  int res;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  paddr_t addr, size;
>>>>> Â Â Â Â Â  bool own_device = !dt_device_for_passthrough(dev);
>>>>> Â Â Â Â Â  /*
>>>>> @@ -2779,6 +2788,7 @@ static int __init make_gicv2_domU_node(struct 
>>>>> kernel_info *kinfo)
>>>>> Â  {
>>>>> Â Â Â Â Â  void *fdt = kinfo->fdt;
>>>>> Â Â Â Â Â  int res = 0;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1*/
>>>>> Â Â Â Â Â  __be32 reg[(GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS) 
>>>>> * 2];
>>>>> Â Â Â Â Â  __be32 *cells;
>>>>> Â Â Â Â Â  const struct domain *d = kinfo->d;
>>>>> @@ -2914,6 +2924,7 @@ static int __init 
>>>>> make_vpl011_uart_node(struct kernel_info *kinfo)
>>>>> Â Â Â Â Â  void *fdt = kinfo->fdt;
>>>>> Â Â Â Â Â  int res;
>>>>> Â Â Â Â Â  gic_interrupt_t intr;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1*/
>>>>> Â Â Â Â Â  __be32 reg[GUEST_ROOT_ADDRESS_CELLS + GUEST_ROOT_SIZE_CELLS];
>>>>> Â Â Â Â Â  __be32 *cells;
>>>>> Â Â Â Â Â  struct domain *d = kinfo->d;
>>>>> @@ -3435,6 +3446,7 @@ static void __init initrd_load(struct 
>>>>> kernel_info *kinfo)
>>>>> Â Â Â Â Â  paddr_t paddr, len;
>>>>> Â Â Â Â Â  int node;
>>>>> Â Â Â Â Â  int res;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  __be32 val[2];
>>>>> Â Â Â Â Â  __be32 *cellp;
>>>>> Â Â Â Â Â  void __iomem *initrd;
>>>>> @@ -3514,6 +3526,7 @@ static int __init 
>>>>> get_evtchn_dt_property(const struct dt_device_node *np,
>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  uint32_t *port, uint32_t 
>>>>> *phandle)
>>>>> Â  {
>>>>> Â Â Â Â Â  const __be32 *prop = NULL;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  uint32_t len;
>>>>> Â Â Â Â Â  prop = dt_get_property(np, "xen,evtchn", &len);
>>>>> @@ -3538,10 +3551,13 @@ static int __init 
>>>>> get_evtchn_dt_property(const struct dt_device_node *np,
>>>>> Â  static int __init alloc_domain_evtchn(struct dt_device_node *node)
>>>>> Â  {
>>>>> Â Â Â Â Â  int rc;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  uint32_t domU1_port, domU2_port, remote_phandle;
>>>>> Â Â Â Â Â  struct dt_device_node *remote_node;
>>>>> Â Â Â Â Â  const struct dt_device_node *p1_node, *p2_node;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  struct evtchn_alloc_unbound alloc_unbound;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  struct evtchn_bind_interdomain bind_interdomain;
>>>>> Â Â Â Â Â  struct domain *d1 = NULL, *d2 = NULL;
>>>>> @@ -3789,11 +3805,12 @@ static int __init construct_domain(struct 
>>>>> domain *d, struct kernel_info *kinfo)
>>>>> Â  static int __init alloc_xenstore_evtchn(struct domain *d)
>>>>> Â  {
>>>>> -Â Â Â  evtchn_alloc_unbound_t alloc;
>>>>> +Â Â Â  evtchn_alloc_unbound_t alloc = {
>>>>> +Â Â Â Â Â Â Â  .dom = d->domain_id,
>>>>> +Â Â Â Â Â Â Â  .remote_dom = hardware_domain->domain_id
>>>>> +Â Â Â  };
>>>>> Â Â Â Â Â  int rc;
>>>>> -Â Â Â  alloc.dom = d->domain_id;
>>>>> -Â Â Â  alloc.remote_dom = hardware_domain->domain_id;
>>>>
>>>> It is not clear why this is modified. There are only two fields in 
>>>> 'alloc' and they are both initialized.
>>>>
>>>
>>> There are three fields in the struct, and the third is clearly to be 
>>> set by an initalization function. If, as above with 'path', the init 
>>> function ensures that the third field is always written then there's 
>>> no problem, otherwise this initialization prevents any use of an 
>>> uninitialized port.
>>> > struct evtchn_alloc_unbound {
>>> Â Â Â Â Â  /* IN parameters */
>>> Â Â Â Â Â  domid_t dom, remote_dom;
>>> Â Â Â Â Â  /* OUT parameters */
>>> Â Â Â Â Â  evtchn_port_t port;
>>> };
>>> typedef struct evtchn_alloc_unbound evtchn_alloc_unbound_t;
>>
>> Ah, I didn't spot the third field because it was defined on the same 
>> line. I would prefer if the value is explicitely initialized to 0.
>>
>> Also, I think this ought to be in a separate patch (with other similar 
>> pattern).
>>
> 
> Ok.
> 
>>>>> Â Â Â Â Â  rc = evtchn_alloc_unbound(&alloc, 0);
>>>>> Â Â Â Â Â  if ( rc )
>>>>> Â Â Â Â Â  {
>>>>> @@ -3810,8 +3827,9 @@ static int __init construct_domU(struct 
>>>>> domain *d,
>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const struct dt_device_node *node)
>>>>> Â  {
>>>>> Â Â Â Â Â  struct kernel_info kinfo = {};
>>>>> -Â Â Â  const char *dom0less_enhanced;
>>>>> +Â Â Â  const char *dom0less_enhanced = NULL;
>>>>
>>>> If you look at the user below, all the callers assume 
>>>> dom0less_enhanced will be non-NULL. So it is unclear to me how this 
>>>> value is safer.
>>>> Â > Looking at the code, I wonder whether we should convert
>>>> dt_property_read_string() to use ERR_PTR(). So we could remove the 
>>>> last argument and return it instead.
>>>
>>> Is relying on that assumption somehow safer? 
>>
>> I am assuming you are referring to "If you look at the user below, all 
>> the callers assume dom0less_enhanced will be non-NULL". Note that I 
>> didn't suggest it is safer. I am only pointed out that you didn't 
>> specify how this was better in the context of the code.
>>
> 
> This should be probably discussed after deciding on the refactoring 
> 'dt_property_read_string'
> 
>>> The suggestion to remove the last parameter seems better.
>>>
>>>>
>>>>> Â Â Â Â Â  int rc;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  u64 mem;
>>>>> Â Â Â Â Â  u32 p2m_mem_mb;
>>>>> Â Â Â Â Â  unsigned long p2m_pages;
>>>>> @@ -3939,6 +3957,7 @@ void __init create_domUs(void)
>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  .grant_opts = 
>>>>> XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
>>>>> Â Â Â Â Â Â Â Â Â  };
>>>>> Â Â Â Â Â Â Â Â Â  unsigned int flags = 0U;
>>>>> +Â Â Â Â Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â Â Â Â Â  uint32_t val;
>>>>> Â Â Â Â Â Â Â Â Â  int rc;
>>>>> diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
>>>>> index bb64925d70..25f39364d1 100644
>>>>> --- a/xen/arch/arm/efi/efi-boot.h
>>>>> +++ b/xen/arch/arm/efi/efi-boot.h
>>>>> @@ -117,6 +117,7 @@ static int __init setup_chosen_node(void *fdt, 
>>>>> int *addr_cells, int *size_cells)
>>>>> Â  static int __init fdt_set_reg(void *fdt, int node, int addr_cells,
>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  int size_cells, uint64_t addr, 
>>>>> uint64_t len)
>>>>> Â  {
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  __be32 val[4]; /* At most 2 64 bit values to be stored */
>>>>> Â Â Â Â Â  __be32 *cellp;
>>>>> @@ -308,7 +309,7 @@ fdt_set_fail:
>>>>> Â  static void __init *fdt_increase_size(struct file *fdtfile, int 
>>>>> add_size)
>>>>> Â  {
>>>>> Â Â Â Â Â  EFI_STATUS status;
>>>>> -Â Â Â  EFI_PHYSICAL_ADDRESS fdt_addr;
>>>>> +Â Â Â  EFI_PHYSICAL_ADDRESS fdt_addr = 0;
>>>>> Â Â Â Â Â  int fdt_size;
>>>>> Â Â Â Â Â  int pages;
>>>>> Â Â Â Â Â  void *new_fdt;
>>>>> @@ -433,7 +434,7 @@ static void __init efi_arch_cfg_file_late(const 
>>>>> EFI_LOADED_IMAGE *image,
>>>>> Â  static void *__init efi_arch_allocate_mmap_buffer(UINTN map_size)
>>>>> Â  {
>>>>> -Â Â Â  void *ptr;
>>>>> +Â Â Â  void *ptr = NULL;
>>>>> Â Â Â Â Â  EFI_STATUS status;
>>>>> Â Â Â Â Â  status = efi_bs->AllocatePool(EfiLoaderData, map_size, &ptr);
>>>>> @@ -538,6 +539,7 @@ static void __init efi_arch_handle_module(const 
>>>>> struct file *file,
>>>>> Â  {
>>>>> Â Â Â Â Â  int node;
>>>>> Â Â Â Â Â  int chosen;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  int addr_len, size_len;
>>>>> Â Â Â Â Â  if ( file == &dtbfile )
>>>>> diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
>>>>> index 3aa4edda10..aa0180ab5b 100644
>>>>> --- a/xen/arch/arm/gic-v3-its.c
>>>>> +++ b/xen/arch/arm/gic-v3-its.c
>>>>> @@ -192,8 +192,7 @@ static int its_send_cmd_mapc(struct host_its 
>>>>> *its, uint32_t collection_id,
>>>>> Â Â Â Â Â  cmd[0] = GITS_CMD_MAPC;
>>>>> Â Â Â Â Â  cmd[1] = 0x00;
>>>>> -Â Â Â  cmd[2] = encode_rdbase(its, cpu, collection_id);
>>>>> -Â Â Â  cmd[2] |= GITS_VALID_BIT;
>>>>> +Â Â Â  cmd[2] = encode_rdbase(its, cpu, collection_id) | GITS_VALID_BIT;
>>>>
>>>> Hmmm... How is this even considered as unitialized variable?
>>>>
>>>
>>> The analysis here could use some more precision, but the modified 
>>> construct is entirely equivalent.
>>
>> I agree that they are equivalent. But in general, we don't change the 
>> style of the construct without explaining why.
>>
>> In this case, the first step would be to improve Eclair.
>>
> 
> The changes needed for this kind of analysis are not trivial: we've 
> looked into this, but there's no easy way to support this in a timely 
> manner. I understand that this is an estabilished pattern, but what 
> would you think of an initializer using designators?
> 
> uint64_t cmd[4] = {
>  Â Â Â Â Â Â Â  .[0] = GITS_CMD_MAPC;
>  Â Â Â Â Â Â Â  .[1] = 0x00;
>  Â Â Â Â Â Â Â  .[2] = encode_rdbase(its, cpu, collection_id) | GITS_VALID_BIT;
>  Â Â Â Â Â Â Â  .[3] = 0x00;
> }
> 
>>>
>>>>> Â Â Â Â Â  cmd[3] = 0x00;
>>>>> Â Â Â Â Â  return its_send_command(its, cmd);
>>>>> @@ -215,9 +214,7 @@ static int its_send_cmd_mapd(struct host_its 
>>>>> *its, uint32_t deviceid,
>>>>> Â Â Â Â Â  }
>>>>> Â Â Â Â Â  cmd[0] = GITS_CMD_MAPD | ((uint64_t)deviceid << 32);
>>>>> Â Â Â Â Â  cmd[1] = size_bits;
>>>>> -Â Â Â  cmd[2] = itt_addr;
>>>>> -Â Â Â  if ( valid )
>>>>> -Â Â Â Â Â Â Â  cmd[2] |= GITS_VALID_BIT;
>>>>> +Â Â Â  cmd[2] = itt_addr | (valid ? GITS_VALID_BIT : 0x00);
>>>>
>>>> Same here.
>>>>
>>>>> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
>>>>> index c688227abd..a36068b2d8 100644
>>>>> --- a/xen/arch/arm/mm.c
>>>>> +++ b/xen/arch/arm/mm.c
>>>>> @@ -935,6 +935,7 @@ static int xen_pt_update_entry(mfn_t root, 
>>>>> unsigned long virt,
>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  mfn_t mfn, unsigned int target,
>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned int flags)
>>>>> Â  {
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  int rc;
>>>>> Â Â Â Â Â  unsigned int level;
>>>>> Â Â Â Â Â  lpae_t *table;
>>>>> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
>>>>> index de32a2d638..83c56cf1cb 100644
>>>>> --- a/xen/arch/arm/p2m.c
>>>>> +++ b/xen/arch/arm/p2m.c
>>>>> @@ -496,16 +496,18 @@ mfn_t p2m_get_entry(struct p2m_domain *p2m, 
>>>>> gfn_t gfn,
>>>>> Â Â Â Â Â  lpae_t entry, *table;
>>>>> Â Â Â Â Â  int rc;
>>>>> Â Â Â Â Â  mfn_t mfn = INVALID_MFN;
>>>>> -Â Â Â  p2m_type_t _t;
>>>>> +Â Â Â  p2m_type_t _t = p2m_invalid;
>>>>> Â Â Â Â Â  DECLARE_OFFSETS(offsets, addr);
>>>>> Â Â Â Â Â  ASSERT(p2m_is_locked(p2m));
>>>>> Â Â Â Â Â  BUILD_BUG_ON(THIRD_MASK != PAGE_MASK);
>>>>> Â Â Â Â Â  /* Allow t to be NULL */
>>>>> -Â Â Â  t = t ?: &_t;
>>>>> -
>>>>> -Â Â Â  *t = p2m_invalid;
>>>>> +Â Â Â  if( t ) {
>>>>> +Â Â Â Â Â Â Â  *t = _t;
>>>>> +Â Â Â  } else {
>>>>> +Â Â Â Â Â Â Â  t = &_t;
>>>>> +Â Â Â  }
>>>> What was the problem with the previous code?
>>>>
>>>> This is also not conformant to Xen coding style.
>>>>
>>>
>>> The problem is that _t may be uninitialized, hence assigning its 
>>> address to t could be problematic.
>>
>> But the value is set right after. IOW, there is no read between. So 
>> how is this prob
>>
>>> Another way to address this is to initialize _t to a bad value and 
>>> use this variable in the body, then assign to t based on the value 
>>> just before returning.
>>
>> IHMO, neither solution are ideal. I think we should investigate 
>> whether Eclair can be improved.
>>
>> [...]
>>
> 
> I'll see what can be done about it, I'll reply when I have an answer.
> 

What about this:

-    p2m_type_t _t;
+    p2m_type_t _t = p2m_invalid;
[...]
      t = t ?: &_t;
-    *t = p2m_invalid;
+    *t = _t;

>>>>> Â Â Â Â Â  if ( valid )
>>>>> Â Â Â Â Â Â Â Â Â  *valid = false;
>>>>> @@ -1031,6 +1033,7 @@ static int __p2m_set_entry(struct p2m_domain 
>>>>> *p2m,
>>>>> Â Â Â Â Â  unsigned int level = 0;
>>>>> Â Â Â Â Â  unsigned int target = 3 - (page_order / XEN_PT_LPAE_SHIFT);
>>>>> Â Â Â Â Â  lpae_t *entry, *table, orig_pte;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  int rc;
>>>>
>>>> Can you provide some details why Eclair thinks it is unitialized?
>>>
>>> Same issue with gotos explained above, can't be refactored because of 
>>> the for enclosing the goto.
>>>
>>>>
>>>>> Â Â Â Â Â  /* A mapping is removed if the MFN is invalid. */
>>>>> Â Â Â Â Â  bool removing_mapping = mfn_eq(smfn, INVALID_MFN);
>>>>> @@ -1483,6 +1486,7 @@ static inline int p2m_remove_mapping(struct 
>>>>> domain *d,
>>>>> Â  {
>>>>> Â Â Â Â Â  struct p2m_domain *p2m = p2m_get_hostp2m(d);
>>>>> Â Â Â Â Â  unsigned long i;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  int rc;
>>>>
>>>>
>>>> Can you provide some details why Eclair thinks it is unitialized?
>>>>
>>>
>>> Same as above.
>>>
>>>>> Â Â Â Â Â  p2m_write_lock(p2m);
>>>>> @@ -1685,20 +1689,21 @@ static int p2m_alloc_vmid(struct domain *d)
>>>>> Â Â Â Â Â  ASSERT(nr != INVALID_VMID);
>>>>> -Â Â Â  if ( nr == MAX_VMID )
>>>>> -Â Â Â  {
>>>>> -Â Â Â Â Â Â Â  rc = -EBUSY;
>>>>> -Â Â Â Â Â Â Â  printk(XENLOG_ERR "p2m.c: dom%d: VMID pool exhausted\n", 
>>>>> d->domain_id);
>>>>> -Â Â Â Â Â Â Â  goto out;
>>>>> -Â Â Â  }
>>>>> +Â Â Â  do {
>>>>
>>>> I don't understand this change. How is this making better for Eclair?
>>>>
>>>
>>> This is an example where the goto can be eliminated, which in turn 
>>> allows to automatically check the correctness.
>> If you want to eliminate the 'goto' then they are better way to do it. 
>> Like:
>>
>> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
>> index bc9c3ae25693..8771679dd5fc 100644
>> --- a/xen/arch/arm/p2m.c
>> +++ b/xen/arch/arm/p2m.c
>> @@ -186,16 +186,14 @@ int p2m_alloc_vmid(struct domain *d)
>> Â Â Â Â Â  {
>> Â Â Â Â Â Â Â Â Â  rc = -EBUSY;
>> Â Â Â Â Â Â Â Â Â  printk(XENLOG_ERR "p2m.c: dom%d: VMID pool exhausted\n", 
>> d->domain_id);
>> -Â Â Â Â Â Â Â  goto out;
>> +Â Â Â  }
>> +Â Â Â  else
>> +Â Â Â  {
>> +Â Â Â Â Â Â Â  set_bit(nr, vmid_mask);
>> +Â Â Â Â Â Â Â  p2m->vmid = nr;
>> +Â Â Â Â Â Â Â  rc = 0;
>> Â Â Â Â Â  }
>>
>> -Â Â Â  set_bit(nr, vmid_mask);
>> -
>> -Â Â Â  p2m->vmid = nr;
>> -
>> -Â Â Â  rc = 0;
>> -
>> -out:
>> Â Â Â Â Â  spin_unlock(&vmid_alloc_lock);
>> Â Â Â Â Â  return rc;
>> Â Â }
>>
>> I have a slight preference with the goto version, but I could accept 
>> it if Eclair can't cope with the construct. In any case, this is the 
>> sort of change that deserve its own patch as you want to explain why 
>> Eclair can't cope with such construct (I don't view it as complex).
>>
> 
> ok
> 
>>>
>>>>> +Â Â Â Â Â  if ( nr == MAX_VMID )
>>>>> +Â Â Â Â Â  {
>>>>> +Â Â Â Â Â Â Â Â Â  rc = -EBUSY;
>>>>> +Â Â Â Â Â Â Â Â Â  printk(XENLOG_ERR "p2m.c: dom%d: VMID pool exhausted\n", 
>>>>> d->domain_id);
>>>>> +Â Â Â Â Â Â Â Â Â  break;
>>>>> +Â Â Â Â Â  }
>>>>> -Â Â Â  set_bit(nr, vmid_mask);
>>>>> +Â Â Â Â Â  set_bit(nr, vmid_mask);
>>>>> -Â Â Â  p2m->vmid = nr;
>>>>> +Â Â Â Â Â  p2m->vmid = nr;
>>>>> -Â Â Â  rc = 0;
>>>>> +Â Â Â Â Â Â Â Â Â Â Â  rc = 0;
>>>>> +Â Â Â Â Â Â Â  } while ( 0 );
>>>>> -out:
>>>>> Â Â Â Â Â  spin_unlock(&vmid_alloc_lock);
>>>>> Â Â Â Â Â  return rc;
>>>>> Â  }
>>>>
>>>
>>>
>>> Considering all of the replies above, a first draft of a 
>>> strategy/policy I can think of is having:
>>>
>>> - Initializer functions that always write their parameter, so that 
>>> the strongest "pointee always written" property can be stated. This 
>>> causes all further uses to be marked safe.
>>>
>>> - Initialize the variable when there exists a known safe value that 
>>> does not alter the semantics of the function. The initialization does 
>>> not need to be at the declaration, but doing so simplifies the code.
>>
>> As I mentionned in private there are two risks with that:
>> Â Â 1. You silence compiler to spot other issues
>> Â Â 2. You may now get warning from Coverity if it spots you set a value 
>> that get overwritten before its first use.
>>
>> So I think such approach should be used with parcimony. Instead, we 
>> should look at reworking the code when possible.
>>
> 
> Do you think it would help if you look directly at actual cautions to 
> spot possible functions that can be refactored?
> 
>>>
>>> - Deviate all cases where any of the previous does not apply, with a 
>>> comment deviation that refers to a justification reporting that the 
>>> code has been checked to respect the rule (keep in mind that 
>>> _violations_ to a Mandatory rule such as R9.1 are not allowed to 
>>> claim MISRA compliance).
>>
>> See above for my concern about adding so many deviations. But I am 
>> confused with what you wrote. If the rule is mandatory, then why are 
>> you trying to add deviation in Xen? Who is going to solve them to make 
>> Xen MISRA compliant?
>>
> 
> Because only cautions were found, not violations (which cannot be 
> deviated). In the former case Xen can say that the code does not violate 
> the rule, but it can't be proven by the tool.
> 
> Regards,
> 

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 14:24:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 14:24:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566632.885718 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMUZr-00042C-W8; Thu, 20 Jul 2023 14:24:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566632.885718; Thu, 20 Jul 2023 14:24:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMUZr-000421-SG; Thu, 20 Jul 2023 14:24:23 +0000
Received: by outflank-mailman (input) for mailman id 566632;
 Thu, 20 Jul 2023 14:24:22 +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
 <SRS0=/1Sz=DG=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qMUZq-0003ag-99
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 14:24:22 +0000
Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com
 [2a00:1450:4864:20::232])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1df49159-2709-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 16:24:20 +0200 (CEST)
Received: by mail-lj1-x232.google.com with SMTP id
 38308e7fff4ca-2b700e85950so12031741fa.3
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 07:24:20 -0700 (PDT)
Received: from [192.168.201.189] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 l10-20020ac24a8a000000b004fcdea129b1sm225725lfp.279.2023.07.20.07.24.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 20 Jul 2023 07:24:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1df49159-2709-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689863060; x=1690467860;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=odecI3IRpadtzx+K3kfy4fT9+MoU+kILBnhF4nxnHQk=;
        b=CLJGXa8ElFcU8K6FPJQsvUA0J/8yGiyCCuT+oh6xl/1TxmHbWW3bISs2/FsKIBvwPS
         2LSWn3fPUcL3sKnWAUxY3O4luokj5OIiNEDQJIcM5/fjigbFOWINO+fK6ysgbn57ajnV
         P67IFnbpZ9BBDOdGg8Fo1VNmmcnVAVsJDcA0vrbPTB83oBhmd1dMxdwZ2UDzb27PXFTi
         hmOgFGxMy1YTrFrjL1fPV293WudQrPH2d6hP+eKqGy3Rv/QP8Y/XfDzcVIJMgJBfKbIU
         tvh+V/D7GZuxPHCN67WOlwm0jLUvxAQXQMVAkoHPMcplC1AxDmsWhoah3ONjm3UBIk/o
         EmBg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689863060; x=1690467860;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=odecI3IRpadtzx+K3kfy4fT9+MoU+kILBnhF4nxnHQk=;
        b=DgNqtm7sTlBMHWjHCLSlMaG+lNorVBnW4F4LI1skLXMlUk8gqmQksa7ZlP1+SXJZnV
         I5TlzYGCzuQhbqZGDpufNWLzefy5KnqF6aD6noCkEoegSGzJXFAB3KeTBhVu+nQFhN0m
         AuITOV5o1Glxlccn54QIoIXc/IeJQ886Mr7ow7gCJ8pPJ+wEXqQnFkVjrQ0+HK75qJ58
         KabXSBs2iQ0XfG9ieV6bqP1gBFMCBTd2yWplhm/QmdDa2r7TIrJ5bLStT9slputxtrcc
         GBSU0eB8Al/eiO3+WUtVWSob9qndw4nxH5FtRtElNMHnjoBj2QvwT7DulngeKRCe29Ju
         bmCg==
X-Gm-Message-State: ABy/qLbbtjE3pin1KVj/pEma/MvYzetIDqcjJIJZYhaDAf9N2NUJxFkv
	kOIhg0hVWgO4iIF6M4gn6Co=
X-Google-Smtp-Source: APBJJlHAC4zdKg5KzTMSbjzyybunUxS/rH/FSGkzh9OOrg4Oy1QIyAkORb2OqYDdpImOs7XkBNYOhw==
X-Received: by 2002:ac2:51bb:0:b0:4f8:770f:1b08 with SMTP id f27-20020ac251bb000000b004f8770f1b08mr2540154lfk.13.1689863059776;
        Thu, 20 Jul 2023 07:24:19 -0700 (PDT)
Message-ID: <214e7f5185c08af9e5475cd360b5ca5943c0f806.camel@gmail.com>
Subject: Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Bob Eshleman
	 <bobbyeshleman@gmail.com>, Alistair Francis <alistair.francis@wdc.com>, 
	Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
Date: Thu, 20 Jul 2023 17:24:18 +0300
In-Reply-To: <5fd13b50-5e9f-162f-0148-0697c6194a4e@suse.com>
References: <cover.1689604562.git.oleksii.kurochko@gmail.com>
	 <8c69050d7b1f42df5e776ca9494164a4d15f2d52.1689604562.git.oleksii.kurochko@gmail.com>
	 <ad53c037-3c1b-ff1a-93df-b79ab2948174@suse.com>
	 <30540953fb363fce4dfd59f8a7e709247a9872fd.camel@gmail.com>
	 <c1a3d447-4b4d-cd9f-642d-e30fed088302@suse.com>
	 <0cbf6a69e8ae08f6b85edcc4f8d53a84e0103d8b.camel@gmail.com>
	 <ad72e892-2ec0-5188-f3bc-6d33544c775a@suse.com>
	 <fce99ab86730de77a82e60efc2c550a3f52a2443.camel@gmail.com>
	 <5fd13b50-5e9f-162f-0148-0697c6194a4e@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Thu, 2023-07-20 at 16:06 +0200, Jan Beulich wrote:
> On 20.07.2023 15:34, Oleksii wrote:
> > On Thu, 2023-07-20 at 12:29 +0200, Jan Beulich wrote:
> > > On 20.07.2023 10:28, Oleksii wrote:
> > > > On Thu, 2023-07-20 at 07:58 +0200, Jan Beulich wrote:
> > > > > On 19.07.2023 18:35, Oleksii wrote:
> > > > > > Then we will have completely different L0 tables for
> > > > > > identity
> > > > > > mapping
> > > > > > and not identity and the code above will be correct.
> > > > >=20
> > > > > As long as Xen won't grow beyond 2Mb total. Considering that
> > > > > at
> > > > > some point you may want to use large page mappings for .text,
> > > > > .data, and .rodata, that alone would grow Xen to 6 Mb (or
> > > > > really
> > > > > 8,
> > > > > assuming .init goes separate as well). That's leaving aside
> > > > > the
> > > > > realistic option of the mere sum of all sections being larger
> > > > > than
> > > > > 2. That said, even Arm64 with ACPI is still quite a bit below
> > > > > 2Mb.
> > > > > x86 is nearing 2.5 though in even a somewhat limited config;
> > > > > allyesconfig may well be beyond that already.
> > > > I am missing something about Xen size. Lets assume that Xen
> > > > will be
> > > > mapped using only 4k pagees ( like it is done now ). Then if
> > > > Xen
> > > > will
> > > > be more then 2Mb then only what will be changed is a number of
> > > > page
> > > > tables so it is only question of changing of
> > > > PGTBL_INITIAL_COUNT (
> > > > in
> > > > case of RISC-V).
> > >=20
> > > And the way you do the tearing down of the transient 1:1 mapping.
> > It looks like removing=C2=A01:1 mapping will be the same.
> >=20
> > Let's assume that the size of Xen is 4 MB and that load and linker
> > ranges don't overlap ( load and linker start address are 2Mb
> > aligned ),
> > and the=C2=A0difference between them isn't bigger than 1 GB. Then one L=
2
> > page table, one L1 page table and two L0 page tables for identity
> > mapping, and two L0 page tables for non-identity mapping are
> > needed.
> > Then at L1, we will have different indexes for load_start and
> > linker_start. So what will be needed is to clean two L1 page table
> > entries started from some index.
> >=20
> > The only issue I see now is that it won't work in case if identity
> > mapping crosses a 1 Gb boundary. Then for identity mapping, it will
> > be
> > needed two L1 page tables, and only one of them identity mapping
> > will
> > be removed.
> >=20
> > Do I miss anything else?
>=20
> Looks correct to me.
>=20
> > Wouldn't it be better to take into account that now?
>=20
> Sure, it's generally better to avoid leaving traps for someone to
> fall into later.

Thanks a lot. Then it make sense to update the removing identity
mapping algo.

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 14:30:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 14:30:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566639.885729 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMUfA-0005CD-Ku; Thu, 20 Jul 2023 14:29:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566639.885729; Thu, 20 Jul 2023 14:29:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMUfA-0005C6-Fo; Thu, 20 Jul 2023 14:29:52 +0000
Received: by outflank-mailman (input) for mailman id 566639;
 Thu, 20 Jul 2023 14:29:50 +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
 <SRS0=BeWc=DG=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qMUf8-0005C0-OH
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 14:29:50 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e185c2a1-2709-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 16:29:48 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.162.143.190])
 by support.bugseng.com (Postfix) with ESMTPSA id 576EB4EE0C89;
 Thu, 20 Jul 2023 16:29:46 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e185c2a1-2709-11ee-8611-37d641c3527e
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH] xen/arm: optee: provide an initialization for struct arm_smccc_res
Date: Thu, 20 Jul 2023 16:29:02 +0200
Message-Id: <a86604d6c85a0d516b8e29258ffebb2841dc6aff.1689863236.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The local variables with type 'struct arm_smccc_res' are initialized
just after the declaration to avoid any possible read usage prior
to any write usage, which would constitute a violation of
MISRA C:2012 Rule 9.1.

This is already prevented by suitable checks in the code,
but the correctness of this approach is difficult to prove and
reason about.

Therefore, storing a suitable initial value in those registers
(OPTEE_SMC_RETURN_ENOTAVAIL) will prevent futher checks from
assuming the operation performed by the macro 'arm_smccc_smc'
was completed correctly.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
I was in doubt about the safe value to put in 'optee_relinquish_resources'
therefore I zero-initialized it.
---
 xen/arch/arm/tee/optee.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
index 301d205a36..2c2ae88c28 100644
--- a/xen/arch/arm/tee/optee.c
+++ b/xen/arch/arm/tee/optee.c
@@ -171,6 +171,10 @@ static bool optee_probe(void)
 {
     struct dt_device_node *node;
     struct arm_smccc_res resp;
+    resp.a0 = OPTEE_SMC_RETURN_ENOTAVAIL;
+    resp.a1 = OPTEE_SMC_RETURN_ENOTAVAIL;
+    resp.a2 = OPTEE_SMC_RETURN_ENOTAVAIL;
+    resp.a3 = OPTEE_SMC_RETURN_ENOTAVAIL;
 
     /* Check for entry in dtb */
     node = dt_find_compatible_node(NULL, NULL, "linaro,optee-tz");
@@ -229,6 +233,7 @@ static int optee_domain_init(struct domain *d)
 {
     struct arm_smccc_res resp;
     struct optee_domain *ctx;
+    resp.a0 = OPTEE_SMC_RETURN_ENOTAVAIL;
 
     ctx = xzalloc(struct optee_domain);
     if ( !ctx )
@@ -640,7 +645,7 @@ static void free_optee_shm_buf_pg_list(struct optee_domain *ctx,
 
 static int optee_relinquish_resources(struct domain *d)
 {
-    struct arm_smccc_res resp;
+    struct arm_smccc_res resp = {0};
     struct optee_std_call *call, *call_tmp;
     struct shm_rpc *shm_rpc, *shm_rpc_tmp;
     struct optee_shm_buf *optee_shm_buf, *optee_shm_buf_tmp;
@@ -1169,6 +1174,10 @@ static void do_call_with_arg(struct optee_domain *ctx,
                              register_t a3, register_t a4, register_t a5)
 {
     struct arm_smccc_res res;
+    res.a0 = OPTEE_SMC_RETURN_ENOTAVAIL;
+    res.a1 = OPTEE_SMC_RETURN_ENOTAVAIL;
+    res.a2 = OPTEE_SMC_RETURN_ENOTAVAIL;
+    res.a3 = OPTEE_SMC_RETURN_ENOTAVAIL;
 
     arm_smccc_smc(a0, a1, a2, a3, a4, a5, 0, OPTEE_CLIENT_ID(current->domain),
                   &res);
@@ -1608,6 +1617,8 @@ static void handle_exchange_capabilities(struct cpu_user_regs *regs)
 {
     struct arm_smccc_res resp;
     uint32_t caps;
+    resp.a0 = OPTEE_SMC_RETURN_ENOTAVAIL;
+    resp.a1 = OPTEE_SMC_RETURN_ENOTAVAIL;
 
     /* Filter out unknown guest caps */
     caps = get_user_reg(regs, 1);
@@ -1643,6 +1654,10 @@ static bool optee_handle_call(struct cpu_user_regs *regs)
 {
     struct arm_smccc_res resp;
     struct optee_domain *ctx = current->domain->arch.tee;
+    resp.a0 = OPTEE_SMC_RETURN_ENOTAVAIL;
+    resp.a1 = OPTEE_SMC_RETURN_ENOTAVAIL;
+    resp.a2 = OPTEE_SMC_RETURN_ENOTAVAIL;
+    resp.a3 = OPTEE_SMC_RETURN_ENOTAVAIL;
 
     if ( !ctx )
         return false;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 14:46:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 14:46:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566645.885738 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMUuk-0007zI-TB; Thu, 20 Jul 2023 14:45:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566645.885738; Thu, 20 Jul 2023 14:45:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMUuk-0007zB-Pp; Thu, 20 Jul 2023 14:45:58 +0000
Received: by outflank-mailman (input) for mailman id 566645;
 Thu, 20 Jul 2023 14:45:57 +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 <SRS0=6Xo+=DG=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMUuj-0007z5-1u
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 14:45:57 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on20622.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::622])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 20135349-270c-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 16:45:54 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB7555.eurprd04.prod.outlook.com (2603:10a6:20b:2d6::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul
 2023 14:45:50 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 14:45:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 20135349-270c-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KT5tI1RYypbtc191YVojsjLOc0BjO+akh767hVIa9uyMTV+/DQCQ4KWnB0JlYWnvO72fiQt3jYRiYR4VF3BctUe2oKv0lvg8vqVBQ6k8gS1o6FccuQhgoAfK4fdAtKbXVa352n+7Px+68EJIulDHuKM49/GB1ZZPLz/MBZtca8NUKrdxgMm5wagqXMpannabpEh8VME9RyrNnnV841gAs8cReTvSOB5q0YfUOqdcLL26vrFk4EFRzK4x1LkcTVxjc9EP9Z3cwt9y65RJrbkmOGF3S0Pcc2o/NjIzyMkowpiTSSntTry+BojTjWieTdb8UeFOFlfa6n2tj7YQAmKPlw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=tcI7G2MYlMpaFZn8MK+aXDTAUpVP6WVlouUXqp4E5kk=;
 b=ZdvxPaUh1AAVsZRc0B+SQReRhyOxE77hEd9HbrGGBbUHsMFwThnkS6jHD1abJWiD3Xn1U0TlLVx70572mX1exRLQsvNJbAPWCZBkhyMo+TYe9MkIRq3B0gCfhR1g1Vhnw2Qv0/lwGaCkZwbA3FAMGtcpTHBdNHPXBhCe0IBri6E9e+Xqlg6Arb39QnyW5+cL+nsE5NhjU5tzKsfVcs3AU3y/cVtOaWXRV2LkKTw80wLb4I8dSnazg+eqHHmzAvYDPkMCm2z+df+PyjQIKc73vA+S/Gwu6rp2ae0RfSrERaj2qDns9lvi1RhPMnZyTaSrrpUgzeYVzsFsTxnp98coOg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=tcI7G2MYlMpaFZn8MK+aXDTAUpVP6WVlouUXqp4E5kk=;
 b=CDdVwB/wKkqVavbhyIRLk9DYbX2LeCH7Z+OyP9f8j9l42LvKIXyAPbB+tZjWHE203+js4wZOaym9ys6lM5yhNRw/D5GlKcYQCj/w0dJ895DFu4tK1agMBuNzgydLR8DHYoCQo7nzFmG1HyL+XhAT7s8W2QFjI1KnGTlbO0UMzes5bFHxBMebnXOszcKmXxoOpD3UjLWU8/BEm9ijUJhpuBmIl/KZfkiaRip33U5PQdSGeLUYXtjl04JmQFLg2QDcLENvhh/OEllkLlGjhDsqqcTi0E++AfFduqY5wwwP89yhLlNvxOVDKQ9Da9BAEp2Ae6sdDkgIKQ0cHUpeDfJIRA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e45a3487-fa84-f151-37b8-0102a5b2e65d@suse.com>
Date: Thu, 20 Jul 2023 16:45:48 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v3] x86/HVM: address violations of MISRA C:2012 Rules
 8.2 and 8.3
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
References: <129cc9919d8664e95812791a91ecb14fcc70b946.1689839462.git.federico.serafini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <129cc9919d8664e95812791a91ecb14fcc70b946.1689839462.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0003.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB7555:EE_
X-MS-Office365-Filtering-Correlation-Id: 0cb46a83-973c-4b9e-b798-08db893002cf
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	5MtcpDz5eflMp+f5wAOe1lda7obhi0HFF+aO7W+p1AiTLoLZTIRFD3ipdmkX6R3rD1SKBWjsH7F1HsCQ6LOU3Rop44MyT5qZ27V3x+eoTMS41vrKTW4NC89LMwJ4s4jaHgZQoWLIoGkJDj793BeAcO0JuQ0r2K7yOEfpQuvNcpb3LMjRozkLDbDkSKTF2Tu0iVq3X2Zg2cW1SfH9Q3SKnubUdcvoJXD9r9zXr8Po2Q/Gm/K4cGc/8IsOchj5XPHbSnetSGqjSXGRoxkxI6u3BQ+C86NSee2zYCHN/olkx+Mj/kKQ6VW5/N3sxYELRoa1Whtq3dnVV2KSpAgwGOdmWkmASQk5FZLMSJluK3iWcU3h890ujXPtCDuqVf+refVSrxVlPrlFrF47lG6tnKAND1eEsJIk/MGGlJ4fNUhlshgdF93y8R2spmgNsVAk9PyTuNKF2m1GhlyKJpUmi4dP1A1gd81VpSCn5KisH2WtLzTo2WEystoJmmSEoWNkei/fFnz1mE9be67LMMrTQu4OoVtPDJhG1+H2B+5/hgPiA7HwdLriGOEe/lXZz+nfzeQNkyrojHJC11iypOeIhFuiHqHsWAFtOTdlR5Qr/ZcMxRMM8bsl66TVN9fc5JrZJYKUlvOe7vRSlKGR2k97mdbcmg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(136003)(376002)(396003)(366004)(39860400002)(451199021)(2906002)(6486002)(6512007)(8676002)(8936002)(5660300002)(7416002)(31696002)(31686004)(41300700001)(316002)(38100700002)(4744005)(66946007)(478600001)(6916009)(66556008)(66476007)(4326008)(54906003)(186003)(2616005)(26005)(6506007)(86362001)(36756003)(53546011)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SDY4Mjdveklubm5YY2VqaWQ0U1dqK0RGSVJiZmxKT2VkUDVTazNDdFF1SVRn?=
 =?utf-8?B?aUk5QVd3anNPbHE5ejE3endnOGhNMzBLei9uVUFNM0RwM3prSkN5bFdzLysw?=
 =?utf-8?B?SzMxTkdjM3RjYUpSYktsbVgwaEJLaTNrWDhmQnFpUSsxSUFWQkxxSUFyZWp6?=
 =?utf-8?B?ZGM1bUxRK042QjBiVDdKZXZjWjBwVGpiRzhuQjBlYi9FYjhBRlhUVXh1aE0w?=
 =?utf-8?B?Q1Jyd3ZWY0IxRVNQR1prTkpsQks5TFQwNWp1WGZkaEpQUFJ1UmttWTliMHgw?=
 =?utf-8?B?Mkt5M01odnpTNDIvOHJ4eW5HcnlsRTliczJuaWY0OVRsY2tEdU52QnBqWC9D?=
 =?utf-8?B?QWhsR3h6WjBTQ2F6UlF5TW80Z01zWTc3MnpkcjZxdnJob1RIL0FpeW5Oc3VU?=
 =?utf-8?B?NFJjOXJPUC81djhRNTJZRHBBRDk1MlVLcDFwbkY4TFBJVHNwY0NMMHJyQ3RJ?=
 =?utf-8?B?OXloYjlNZW5nVzJwTmxHcUVjSGg5dVRlQ0RpZ3l4N0R4Y1BzREh1aTl4cVk0?=
 =?utf-8?B?MDk0Lys2ajR1T0IzNjJoUXdaY0RLSFhma0ZjUXpVWGZvOWJBREprbWZIMVNV?=
 =?utf-8?B?THBxUlJCNE9raFZsbTAyK0dodFNja3lMRU9tdlhrbGxXNXdCTUlCcWlLNHZk?=
 =?utf-8?B?Wkl6KzNjRUVqWUhTanVmbmFpTGFaZ0JKdXExVnp3S2RZZ2RnQmF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CNWdhQ3hoZUQzRFJHWHVGeHZOd3p2OW42WVJZOGozRUZpM2N2RE1h?=
 =?utf-8?B?WVZoUkZYbngwK0V2TFpHSkJSYkZxeTRMUnBxV3BLcWFBa0txdDB6WklpYVlG?=
 =?utf-8?B?cERTNmEzckJGZGlybU5BN3pRaSs4ZU1pTlBJcWo5ckNYdmpIUnl6UWhyek14?=
 =?utf-8?B?b201ZWdHZlQyTlVKaEcvTFA3d0VtcFp1L0JjT0pMclJlOVZtK0k1dW94VUhs?=
 =?utf-8?B?Y0R3OW9vL2VFTEx0WGZVRnZldGlkQzFMK1NDMTJEdXd2R1dUdm40RjFGY1JT?=
 =?utf-8?B?eWVaK0NreUdIai9veDBJcUdzOEczdWlqYk9wYkVjZ1VyWjMvZ1ZybFhWQjJV?=
 =?utf-8?B?MEM5ZmVuV084Y0N1N2VKTE9kdlFia051OEVoOGkzY3F5NUxaNnhLWXBGaWlI?=
 =?utf-8?B?cUJSbnVkQ01sSFpuRlBiVmhoOHNqRTBsNXd1dnVVSGJPZUNYMnV0Z1NvUlRN?=
 =?utf-8?B?cHFrNmpNeGxOeExjUDdSUVRydFVYUnVjN0lSTmNpRXc5ZWwvS0JTYmVpY2hx?=
 =?utf-8?Q?qt8xk9qJSNBPj0pLpLj1lzono?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0cb46a83-973c-4b9e-b798-08db893002cf
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 14:45:50.2825
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 22kViThkmpOIHFOu9CMU9phztKdELOE9imj/nxV3jg9AdXH+uepovb533qQgPHM5KDs0hSIA72oWmsCd+kY4Dw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7555

On 20.07.2023 09:53, Federico Serafini wrote:
> Give a name to unnamed parameters thus addressing violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names and types used in function
> declarations and the ones used in the corresponding function
> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
> ("All declarations of an object or function shall use the same names
> and type qualifiers").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Thu Jul 20 15:05:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 15:05:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566648.885748 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVDE-0002kB-GS; Thu, 20 Jul 2023 15:05:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566648.885748; Thu, 20 Jul 2023 15:05:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVDE-0002k4-CA; Thu, 20 Jul 2023 15:05:04 +0000
Received: by outflank-mailman (input) for mailman id 566648;
 Thu, 20 Jul 2023 15:05:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=F2Z1=DG=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qMVDD-0002jy-Em
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 15:05:03 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ccde953e-270e-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 17:05:01 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 4BE072069F;
 Thu, 20 Jul 2023 15:05:01 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1C790138EC;
 Thu, 20 Jul 2023 15:05:01 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id eKp3BR1NuWQJCwAAMHmgww
 (envelope-from <jgross@suse.com>); Thu, 20 Jul 2023 15:05:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ccde953e-270e-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1689865501; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:  content-transfer-encoding:content-transfer-encoding;
	bh=NUCvlbyVM3C9s83ic5gsJCxga3aRHaTw7ZzMi+f7U5E=;
	b=jSmsj7krLV7I6B3RnlQtlBM8idaPXxe15xPPxjaqzF98DA/iwNAl9CUuBxtadsjjTpfDpH
	/UvfE6kehcC2KdnIG2vBLCmOjHCKYX6FKcoPdFHBj9xu5HTuZ6mx3U7Uf8i3kl62ebBjgA
	wWmowCrYMJBTtncX6mqTz7lKCQgTlME=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH] tools/xenstore: fix XSA-417 patch
Date: Thu, 20 Jul 2023 17:04:59 +0200
Message-Id: <20230720150459.31111-1-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The fix for XSA-417 had a bug: domain_alloc_permrefs() will not return
a negative value in case of an error, but a plain errno value.

Note this is not considered to be a security issue, as the only case
where domain_alloc_permrefs() will return an error is a failed memory
allocation. As a guest should not be able to drive Xenstore out of
memory, this is NOT a problem a guest can trigger at will.

Fixes: ab128218225d ("tools/xenstore: fix checking node permissions")
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstore/xenstored_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 31a862b715..a1d3047e48 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1784,7 +1784,7 @@ static int do_set_perms(const void *ctx, struct connection *conn,
 	if (!xenstore_strings_to_perms(perms.p, perms.num, permstr))
 		return errno;
 
-	if (domain_alloc_permrefs(&perms) < 0)
+	if (domain_alloc_permrefs(&perms))
 		return ENOMEM;
 	if (perms.p[0].perms & XS_PERM_IGNORE)
 		return ENOENT;
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 15:07:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 15:07:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566651.885759 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVFC-0003IB-Sy; Thu, 20 Jul 2023 15:07:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566651.885759; Thu, 20 Jul 2023 15:07:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVFC-0003I4-Nx; Thu, 20 Jul 2023 15:07:06 +0000
Received: by outflank-mailman (input) for mailman id 566651;
 Thu, 20 Jul 2023 15:07:05 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/JYs=DG=citrix.com=prvs=558be806a=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMVFB-0003Hw-IN
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 15:07:05 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 14b3b6bd-270f-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 17:07:03 +0200 (CEST)
Received: from mail-dm6nam04lp2047.outbound.protection.outlook.com (HELO
 NAM04-DM6-obe.outbound.protection.outlook.com) ([104.47.73.47])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 20 Jul 2023 11:07:00 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SA3PR03MB7254.namprd03.prod.outlook.com (2603:10b6:806:2fe::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 15:06:58 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 15:06:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 14b3b6bd-270f-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689865623;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=PsbIXgUX3ivx4jE5Al41Xywzw2tIU05AMuEAaJFV6BQ=;
  b=h9yk8LgGE5nXaJWYjnzpytm6eNAoGpwshmagjP02qNc/mfcePQpL/Tgg
   WD+Vq1RoBNMmQmjzGVcqwG5MLwsXcqaoQBcPV9zy+bKqpiJTC5T6sGANX
   HCGW9apeXCdjd5wS83XU/O7x9BFmeE5TiGdcXZ044OAwiXUJf0+84wvl0
   I=;
X-IronPort-RemoteIP: 104.47.73.47
X-IronPort-MID: 116758001
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:/wPkz64v1ZxjZE0Sm3q2ogxRtIHGchMFZxGqfqrLsTDasY5as4F+v
 mtKW2CAafmMMTT8LdB+YYrk/RlQuJ6DzdIyQApp/39kHi5G8cbLO4+Ufxz6V8+wwm8vb2o8t
 plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraCYnsrLeNdYH9JoQp5nOIkiZJfj9G8Agec0
 fv/uMSaM1K+s9JOGjt8B5mr9lU35ZwehBtC5gZlPa8R5AeE/5UoJMl3yZ+ZfiOQrrZ8RoZWd
 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4
 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5m0
 /8mBDUtLTu/gMWY+634b7hMvN8GFZy+VG8fkikIITDxK98DGcyGb4CUoNhS0XE3m9xEGuvYa
 4wBcz1zYR/cYhpJfFAKFJY5m+TujX76G9FagAvN+exrvC6Ml0otj9ABM/KMEjCObd9SkUuC4
 HrP4kzyAw0ANczZwj2Amp6prraWw3ymCNpKTdVU8NZo33DL1GM3ViEHTEu0gMPhrW+0ftF2f
 hl8Fi0G6PJaGFaQZtfwUxCioXWD+AURQdNeEus7wAuQxbHZ5QnfDW8BJhZRZdpjuMIoSDgC0
 l6Sg8ivFTFpqKeSS3+W6vGTtzzaESMSK3QfYTMFSwQt6cTsu4w1gVTESdMLOKy/g8DxGDrw6
 yuXtyV4jLIW5eYU042r8FaBhCijzrDSVRI87AjTWmOj7yt6aZSjaoju7kLUhd5FLY2ZR13Hu
 2IWlsy25eUCS5qKkUSlUOgLHbjv/f+KMTTQiF1oArEo8jjr8HmmFahZ8Th4YkR0N88ePz/gZ
 EPeoytY4ZMVN3yvBZKbeKq0AsUuiKTlS9LsU6iIasIUOsQuMgia4CtpeEicmXj3l1Qhmr0+P
 pHddtuwCXEdCuJsyz/eq/oh7ILHDxsWnQv7La0XBTz6uVZCTBZ5kYs4DWY=
IronPort-HdrOrdr: A9a23:WiWYIa8BuzeDgI+wC7duk+AcI+orL9Y04lQ7vn2ZKSY5TiX4rb
 HKoB1/73XJYVkqN03I9ervBEDiewK/yXcW2+ks1N6ZNWGLhILBFupfBODZsl7d8kPFl9K01c
 1bAtJD4N+bNykGsS4tijPIb+rJw7O8gd+Vbf+19QYIcenzAZsQlzuQDGygYypLbTgDP7UVPr
 yG6PFKojKxEE5nFfhSVhE+Lo7+T8SgruOeXSI7
X-Talos-CUID: =?us-ascii?q?9a23=3AImgzsmkyLIPW8MAY7TVkfx7n6GrXOVve8lvVAwy?=
 =?us-ascii?q?TNWFOZoaKCnrB2Jl/tvM7zg=3D=3D?=
X-Talos-MUID: =?us-ascii?q?9a23=3Acs7DHQ71gB6WIBGz0/ktyMDyxoxqvIn2Gk8pz6k?=
 =?us-ascii?q?XotmLFBYoHBaXqTeeF9o=3D?=
X-IronPort-AV: E=Sophos;i="6.01,219,1684814400"; 
   d="scan'208";a="116758001"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=RfUAlCSEdM1pt7J6ZCB1CUAd8N0wqN5u2s0GO4+caRkyJy6/Hgs0mNobBGsBkkUWQLyJajqiRV5Fc6zUjfb1p/kZSULZqaPMXZoKkPdSZAF50D/sM1AHZCZ9leMKJ/n8zKVr1IK8XpQlLqsYFf3dtl+fGmoyb3vSc9IyrnCHTeD5CYoAobV95cV6GxA3PJfS7kRi2UmMj0BJCc5kqaVuZ5jFe9ZRCk29j0ivwVW+t4pRHgf4OUU9nBf7tEfRQ1dxznvodlTCnW0T/rh/TCVT/PgvclT2/jj/VtfW34C6PE7MssG6r3girK0Oh9br07APOOECX7KMGs/gOXZ3T6dm2Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=kehxbsp7ss62gce3UPTNassI+MHKU6cxMtnPTeORNgo=;
 b=mWzszUzboHVf7CINq8gDaA+6zpS1/t26LjtU4J8c6m+KZ+hjz2E8/VJgQwwVNktY3VNGTqdkPDwUQ/9NG0qp7Qvyhz9cw9/RF7FdlxIJ81GSd6mFBCqCKU3XVH/UlTGiuvlemkG3WbiT+kUP9upZ2s2ospot/9lpSroC8pDEiHxZh7baUUGnt/zuMjdrBMK/0f8NBnJWAxMtjzAh9ZVDNKqB7zHu4Hz0WF3GAuR1tOkuJNbkV6V/5PuDHoRw+CZYdjIBUKBns2qYaxlcpavbzrjOBzmxhcVyJ5Q4OSgrSQM/BqVTbFOhVpLpOQUZhkHX4v5UEwpZgINO7ykjTEEeUw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=kehxbsp7ss62gce3UPTNassI+MHKU6cxMtnPTeORNgo=;
 b=oayYr6kVR0Tky08PPat+6X4alqU72UE/nXZqAQKOYHPG0yEwHHUOxuSpArOuxOTtcTKVuNnN0SBohmqCkFSN4pVHVLF7UGIc8ytm9vgdOa+kjoVTG+KZjVpO/+nN/e9UnRUt7kZ4LXtDZGGwN/6TBBDIQYjAuiwdKR9C1wfb7GE=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Thu, 20 Jul 2023 17:06:53 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH v2] x86/mtrr: address violations of MISRA C:2012 Rule
 8.3 on parameter types
Message-ID: <ZLlNjebB1LITaAWW@MacBook-Air-de-Roger.local>
References: <514c6dbe4ccfa1fdd66f80a0f8c8e248886bdc4e.1689856301.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <514c6dbe4ccfa1fdd66f80a0f8c8e248886bdc4e.1689856301.git.federico.serafini@bugseng.com>
X-ClientProxiedBy: LO4P265CA0189.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:311::15) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA3PR03MB7254:EE_
X-MS-Office365-Filtering-Correlation-Id: 33e24f80-a485-4322-ad76-08db8932f625
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	wz4qur/YdaYCU8q8AEyxAj7xJjLqGS2WRtPujw1o6p0LfuYxITfoW4o+N7ws/9GTvoXCPgarmDNe2U9neZVmg0o00vJQ8FvRXt0tFU+S0oguSE08WDT+lEvs8MoEo0DWrEItsn+MZeqqzMaxaF76r4kyk5TwdFay6dJqNyaBs+B0la4+5AP4OqNJPQLM5/6onkHFm1ydsm5LSQ4XG7PcGoPscWmDI4ufGBK/KZRRxxfoZTcQ3sxr5sma4FRqDickEw7QVNYd644h2n0Pit+wWC0htMlmO9fiCHvffle5AJCxg1b7+ClTfOcLzANvPcyEsWlE2Gq/PCMe4tYD5xbxdhGzmHjISVi6WemAWGDOh4PkjAxRHFutt6JtIgVMtiYiMRbO71Pe8dkQ2NlNULdqhRGNRsgVwPOzk22OWJo+FlBsRP3G98LV/lzZcyzt+BNN3bHK0joBTFVOjT+4iWXZ0lZyH27mhc1Y4oh6Rgg9NZDBLCdRjXNWtIzJFzTFKv64ZsfL4890uL6jDpcFalb7sSgqgM41J/n0Fn+Bi+NxxOGC+++z1q6a1257mFr2NT07
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(346002)(136003)(39860400002)(376002)(451199021)(186003)(85182001)(86362001)(82960400001)(26005)(38100700002)(2906002)(478600001)(54906003)(4744005)(6506007)(7416002)(8936002)(66556008)(8676002)(6512007)(41300700001)(66476007)(5660300002)(6486002)(4326008)(6916009)(316002)(66946007)(6666004)(9686003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZWN5dnJhSlNlOWYzZ2NoMHFtakhvMHRqdFdlREdFdWZNUm9VSUtMOXZ0WUNY?=
 =?utf-8?B?ZWNGTlQrMlRzL0tmaFFRNWJ6SlV3TS9pRkh0UU9LWjRWZFRqak94UHlvTThZ?=
 =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VF/8y9cLNLp0H2oMb+++yuJY76xnWCQebXMnymUgTmB0IHhxDV+RaTELTLNUsHmMAbnBl+b9FdOEdL0Fl2pPlV3I/IOgZYhu/7jM5V+0knMa+P/P5sQ7rficrCR1vUpvpH1iksuUr6JCdlqoQ7/LsQsv6gVqQpj8APDhvvlEMcRy4PLSLR1zNoaaQsiUY9qpSKwm1JhU3I3+M+kSZJ5auC3GaUPOz11QfR8B6YnY35Q9QBNiN3CKslI/IAmXg1jLEdJcXty4M4QzNoJwng/72sCm21awOuVKfJOukWcP/nkksYn4xuQE9+wQgejW/Sz2dHOWQsxEKF2ZvM/NIT7n9zEkOg==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 33e24f80-a485-4322-ad76-08db8932f625
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 15:06:57.6249
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Zj4ruKahL+OptGNAwgMNn5pXG7ObINbLJS72Q6D2s2NvQgdY8qZ/gcg/XAzI4TDQdDGUOCCpu/WMkUAgaiURDA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR03MB7254

On Thu, Jul 20, 2023 at 02:33:34PM +0200, Federico Serafini wrote:
> Change parameter types of function declarations to be consistent with
> the ones used in the corresponding definitions,
> thus addressing violations of MISRA C:2012 Rule 8.3 ("All declarations
> of an object or function shall use the same names and type qualifiers").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Acked-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 15:09:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 15:09:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566655.885768 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVH1-0004I9-B6; Thu, 20 Jul 2023 15:08:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566655.885768; Thu, 20 Jul 2023 15:08:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVH1-0004I2-82; Thu, 20 Jul 2023 15:08:59 +0000
Received: by outflank-mailman (input) for mailman id 566655;
 Thu, 20 Jul 2023 15:08: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 <SRS0=F2Z1=DG=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qMVGz-0004Hu-Vk
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 15:08:57 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 587dd974-270f-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 17:08:56 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id AC1AD21DB7;
 Thu, 20 Jul 2023 15:08:55 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7E7C2138EC;
 Thu, 20 Jul 2023 15:08:55 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 7FRYHQdOuWQ5DQAAMHmgww
 (envelope-from <jgross@suse.com>); Thu, 20 Jul 2023 15:08:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 587dd974-270f-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1689865735; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:  content-transfer-encoding:content-transfer-encoding;
	bh=Mm9z2RuOqoZtdeMxdTy+7Yv+GZAtLc3X7R1vOQMQKZ4=;
	b=ZQylcMZMlaFi9eMmPyvQ9pzmW2gmfRRXsOz/RF8Bx3pEtl5NtwbWgojPxn01SUGQnq07GS
	FT2Ozkm08TgNrIWINe0uxVtfAjHH/JK63sUjr02aEjLJ/ZpySD4w/YCKasmaaTdeNG8tuy
	K5HaV7BhqVIHRHMRZeZ+YtMysbeD8i0=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH] tools/xenstore: fix get_spec_node()
Date: Thu, 20 Jul 2023 17:08:53 +0200
Message-Id: <20230720150853.31368-1-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In case get_spec_node() is being called for a special node starting
with '@' it won't set *canonical_name. This can result in a crash of
xenstored due to dereferencing the uninitialized name in
fire_watches().

This is no security issue as it requires either a privileged caller or
ownership of the special node in question by an unprivileged caller
(which is questionable, as this would make the owner privileged in some
way).

Fixes: d6bb63924fc2 ("tools/xenstore: introduce dummy nodes for special watch paths")
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstore/xenstored_core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index a1d3047e48..790c403904 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1252,8 +1252,11 @@ static struct node *get_spec_node(struct connection *conn, const void *ctx,
 				  const char *name, char **canonical_name,
 				  unsigned int perm)
 {
-	if (name[0] == '@')
+	if (name[0] == '@') {
+		if (canonical_name)
+			*canonical_name = (char *)name;
 		return get_node(conn, ctx, name, perm);
+	}
 
 	return get_node_canonicalized(conn, ctx, name, canonical_name, perm);
 }
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 15:26:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 15:26:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566662.885781 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVXB-00078N-OQ; Thu, 20 Jul 2023 15:25:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566662.885781; Thu, 20 Jul 2023 15:25:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVXB-00078G-Lf; Thu, 20 Jul 2023 15:25:41 +0000
Received: by outflank-mailman (input) for mailman id 566662;
 Thu, 20 Jul 2023 15:25:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6Xo+=DG=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMVXA-00078A-TR
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 15:25:40 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20617.outbound.protection.outlook.com
 [2a01:111:f400:7d00::617])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id aeb505f7-2711-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 17:25:39 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by GVXPR04MB10024.eurprd04.prod.outlook.com (2603:10a6:150:117::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Thu, 20 Jul
 2023 15:25:35 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 15:25:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aeb505f7-2711-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=jSX56l2HT+GVQb50RrKTZ8qUFbllW/k8f7Ze3xaC+rlXlxySRGzigB5ComUf4iwP/B2yPMyTvbN1azN2C34ffEk76ul5S2qrYDz1ZSRqCkNMK6IWJ+uQ6GjJlSr4NQAu5j8a9DitU2NeuMZEJsgAkJLYLsqNGuzy/pr/5cht45rJHPk8EvTggx2lFZS/aU/HyrH2ildG11t/v3npn9W1pBUmfGKWLdr/e85uzwg/VOaklSCBVVmG1MkVfSFGjunCEstdK3ywyvdPY82PUbQxBFKHCqX2NwN4AdesmlwGH8bY1gyOvKtSr5Lc8coTCwiYk2bymF9dJZjFeGilcBkbEQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=o72YJS/1sdXQthRVTF0KP5aExV/SVHvJBGL3szoa2r0=;
 b=eAluaNGVIW0iM/iIxTWHAUwFwII4DUyNWPzfq3IHonCgcnXflEk8N8WMT3HWGHUqi4u66waoRGjvgqez7lVsW03P9/mTnkjGDfCh7O8tl74pG3JTB73xzeXZ08XK520KeuBUkViIom2Xm+YRsz1y1QzgAgV5FfuWZ27vvtJvMYquZ2MvplsMdvnNp5TD23iHzLdimBcI3MGXt1sQlzmiFRDm/5y8nppxgHbh/xuLEowy5mKA8vDmEIHgBVMA4M+fPjwaGPFRXwEqceNN1CJKb4eNOsMhgLUC1THOoPSqP6kmWndX1DOUCqBSsMSVlcd0QiI0YPuAHNtsNtB2kEzdSw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=o72YJS/1sdXQthRVTF0KP5aExV/SVHvJBGL3szoa2r0=;
 b=5e0iDR3Aw+WEfKiL8Y2jnAHK2lH5LFYkJyVExNSL5ThVKGUQElCaU6qx564pKVTWfA/10T5rs/0zHyx0BCqORDsC6nABa0pqqRn1quRSdsbIliBoHry2d4KIYRMYymrqivto/19nK0DzVg2EJEwEW4F0SYD7Ams5sjY0dcXOLDBUw50iTamHzuRLIRIWf1JIRTgNYNJ0F8Q+YOuxJmJPCvOF1d52FbQV+thBy2V6GSjWoITVFxDhQIsKs1S6ya17hNT4En5WSlaKhtDMgNwsllIuWBBJpfYPjaoGLAVtWTDVKauG74qH0vj/Qjnm+C5fIMco3W+0/TEuJQOTZ5rZVg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <4a92d70e-e3f8-c6aa-a72c-19e9849e2836@suse.com>
Date: Thu, 20 Jul 2023 17:25:33 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] xen: address MISRA C:2012 Rule 4.1
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>,
 Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: xen-devel@lists.xenproject.org, michal.orzel@amd.com,
 xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
 Julien Grall <julien@xen.org>
References: <378f18c287cfb65d25b42209c85645a2a10ff9b2.1689763253.git.nicola.vetrini@bugseng.com>
 <alpine.DEB.2.22.394.2307191723090.3118466@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307191723090.3118466@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0103.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9c::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|GVXPR04MB10024:EE_
X-MS-Office365-Filtering-Correlation-Id: 31f736d0-8242-44be-3dd7-08db893590a3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	RZN0xNQ4xM+xCFYFkGJh+KNKZR9dAGWyvzl3Tv1yVvGs/mFDUZqP2fN7kgA3oUtDyVvCTqfX7lyXRwIzpsAyE58Y3xvLpwcy/+fhmnWujhkm8mSUCttGQ6Nk9ZFZsVG/CKisoVdEyDJhJgyJbaDwE6wm9a/XYbWXDuE0wix4lW/v8n40XjeockSeSetqEaHMSmscKcw1TffzwIBLxkdgKzKZNtz7Q+B5tSWP+GIM00LO665Iqlosese9hXOm59ryHmhLh15O58KmIuCImwgG4gI90c193eJPo8Jh7WzbvTk6E90o0fcD5nv3sfAf5vHyTke2Micq1p2i94Ub277PkgqI2k4PukaJ6mubPrEoCh1HLZxwuPFj9nolOeXDbjgFDdN7mz+5HapWQswPtOugmoMJNW1FfpOW1FY8qxTB+vnWzm83bFXm9mRJMp86T9pBBDyJeV8tJJ3ZCFqfHg8QQr9Ife28DG2gU/J3oAPW6WGRGrA0KhG57gRMpHvVIVcJ/70lZSFgA9TiGPgSR2q8la/Au0Wt2/VIgAjXFYyoWBKuO1zHY7KT0AjnYtVv90b1vRsxZrnhyxzkdwerFr3Z9MA0U0PKR5VT1cDpV8BijkoTRyckrqcjV0/k951pQpqEXPR9NtuR+/5AVH6jaGjhEQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(396003)(366004)(346002)(136003)(451199021)(31686004)(6486002)(4326008)(6506007)(66476007)(53546011)(26005)(54906003)(66946007)(478600001)(66556008)(110136005)(86362001)(36756003)(83380400001)(2616005)(186003)(316002)(41300700001)(8936002)(8676002)(5660300002)(31696002)(2906002)(6512007)(38100700002)(7416002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZURGR1pNYnlrVnJpM1cxc0RMTzNaUVE0MWp1OUF0Ump2eGtaZVlWSXpjNElZ?=
 =?utf-8?B?YzRPVjhZTlJrc1FNL0g0MDZTQ2VuSEE3eTlBdEV3OVFJNng3R05oTmE1VkJW?=
 =?utf-8?B?Z2VQaGRHYXZwdWpGV0tRUm9MZFFyd3NHWWx5OVFZVzA4eXZQUWZGTTFPdlp6?=
 =?utf-8?B?WjBjU3Y3WlRQUXQ3NXpOckdtMElrVFNEK3BacWcxejJpb3hPcllmYVpQYWhG?=
 =?utf-8?B?R055YUtvaXJFWWxiZTRHeFBydmV2TjFTei92TzF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B?aDhlMXRLeG05U0tCMnpTSCtxbFFtZ0N3SHQ1cnBINVRFbUNmZTQ0V3FLNjE3?=
 =?utf-8?B?SjJSVFBOS3VwWXI4dE0vanc2Z0wwMzgwL0JCZk1nTFR4SVE1S0J5OW9NRzN4?=
 =?utf-8?Q?0OXkenSK0jz5swUXklUdNBBEu?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 31f736d0-8242-44be-3dd7-08db893590a3
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 15:25:35.7515
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: zfuiYI67O8b/otGzkyBpUvuUbTd2iLQexhFizxI1Bbmu6pA+pXquhCt/bkVW3nR+5DpnHnl0A2m3fCzvSGFhqA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB10024

On 20.07.2023 02:23, Stefano Stabellini wrote:
> On Wed, 19 Jul 2023, Nicola Vetrini wrote:
>> MISRA C:2012 Rule 4.1 has the following headline:
>> "Octal and hexadecimal escape sequences shall be terminated."
>>
>> The string literals modified by this patch contain octal or
>> hexadecimal escape sequences that are neither terminated by the
>> end of the literal, nor by the beginning of another escape sequence.
>>
>> Therefore, such unterminated sequences have been split into a
>> separate literal as a way to comply with the rule and preserve the
>> semantics of the code.
>>
>> No functional changes.
>>
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

In order to get this off the plate
Acked-by: Jan Beulich <jbeulich@suse.com>
albeit I'm not overly happy with ...

>> --- a/xen/arch/x86/hvm/hvm.c
>> +++ b/xen/arch/x86/hvm/hvm.c
>> @@ -3853,7 +3853,7 @@ void hvm_ud_intercept(struct cpu_user_regs *regs)
>>                                          cs, &addr) &&
>>               (hvm_copy_from_guest_linear(sig, addr, sizeof(sig),
>>                                           walk, NULL) == HVMTRANS_okay) &&
>> -             (memcmp(sig, "\xf\xbxen", sizeof(sig)) == 0) )
>> +             (memcmp(sig, "\xf\xb" "xen", sizeof(sig)) == 0) )

... this. Imo it should never have been a string literal here. But
I'm also not really up to making yet another alternative patch.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 15:27:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 15:27:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566665.885790 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVZ5-0007qE-4I; Thu, 20 Jul 2023 15:27:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566665.885790; Thu, 20 Jul 2023 15:27:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVZ5-0007q7-1e; Thu, 20 Jul 2023 15:27:39 +0000
Received: by outflank-mailman (input) for mailman id 566665;
 Thu, 20 Jul 2023 15:27:38 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMVZ4-0007pz-0W
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 15:27:38 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMVZ2-0007qB-Ql; Thu, 20 Jul 2023 15:27:36 +0000
Received: from 54-240-197-231.amazon.com ([54.240.197.231]
 helo=[192.168.24.131]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMVZ2-0004Q4-Cf; Thu, 20 Jul 2023 15:27:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=zPOZzkUv+0+Hjp3+bGH2tbWd5VbuidYLrEOh/8zDmCg=; b=kDvQNC4SJVlIRL8z0RXMf0CcMr
	lHkdBUohNO8zXZmcKnxD1roh1vMvrH9oHb32eKZFcvxvW+ofbNBBiHD5IwF8Hyoy1G8JPDi7pZA5b
	aeZuTGDtkCl2W9RmSfagTO/OqGGK+9NV5ctTkgPar1QSWK5AKbXnHm71KD0mqyABV2O4=;
Message-ID: <9a646bac-6355-7ccd-6e09-e10f942f44af@xen.org>
Date: Thu, 20 Jul 2023 16:27:33 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally
 uninitialized variables
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <1ad20473a031eca75db4007bdc169616b512ef44.1689329728.git.nicola.vetrini@bugseng.com>
 <97d8a796-f790-8efc-1d89-def1f1193e61@xen.org>
 <5da7ae40-35c7-7f93-824f-42a0712cdcf1@bugseng.com>
 <9cac9bc5-ad55-3bcd-b645-a30a5b863b3f@xen.org>
 <26008624-b00c-ecd2-77e0-3f1cad63db66@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <26008624-b00c-ecd2-77e0-3f1cad63db66@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Nicola,

On 20/07/2023 11:14, Nicola Vetrini wrote:
> 
> 
> On 17/07/23 15:40, Julien Grall wrote:
>> Hi Nicola,
>>
>> On 17/07/2023 13:08, Nicola Vetrini wrote:
>>> On 14/07/23 15:00, Julien Grall wrote:
>>>> Hi Nicola,
>>>>
>>>> On 14/07/2023 12:49, Nicola Vetrini wrote:
>>>>> This patch aims to fix some occurrences of possibly uninitialized
>>>>> variables, that may be read before being written. This behaviour would
>>>>> violate MISRA C:2012 Rule 9.1, besides being generally undesirable.
>>>>>
>>>>> In all the analyzed cases, such accesses were actually safe, but it's
>>>>> quite difficult to prove so by automatic checking, therefore a safer
>>>>> route is to change the code so as to avoid the behaviour from 
>>>>> occurring,
>>>>> while preserving the semantics.
>>>>>
>>>>> To achieve this goal, I adopted the following strategies:
>>>>
>>>> Please let's at least one patch per strategy. I would also consider 
>>>> some of the rework separate so they can go in regardless the 
>>>> decision for the SAF-*.
>>>>
>>>>>
>>>>> - Add a suitably formatted local deviation comment
>>>>> Â Â  (as indicated in 'docs/misra/documenting-violations.rst')
>>>>> Â Â  to exempt the following line from checking.
>>>>>
>>>>> - Provide an initialization for the variable at the declaration.
>>>>>
>>>>> - Substitute a goto breaking out of control flow logic with a 
>>>>> semantically
>>>>> Â Â  equivalent do { .. } while(0).
>>>>
>>>> As I already mentioned in private, it is unclear to me how you 
>>>> decided which strategy to use. I still think we need to define our 
>>>> policy before changing the code. Otherwise, it is going to be 
>>>> difficult to decide for new code.
>>>>
>>>
>>> The main point of this RFC is doing so. From what I gathered, it's 
>>> not an easy task: sometimes there are no 'safe' values to initialize 
>>> variables to and sometimes there is no easy way to prove that indeed 
>>> something is always initialized or not accessed at all.
>>
>> But you wrote the code. So you should be able to explain how you took 
>> the decision between one and the others.
>>
>> Also, even if this is an RFC, it would have been good to summarize any 
>> discussion that happened in private and if there were concern try to 
>> come up with ideas or at least listing the concerns after '---.
>>
> 
> I'll keep this if the need arises in the future.
> 
>>>
>>>>>
>>>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>>>> ---
>>>>> Â  docs/misra/safe.jsonÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  8 +++++++
>>>>> Â  xen/arch/arm/arm64/lib/find_next_bit.c |Â  1 +
>>>>> Â  xen/arch/arm/bootfdt.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  6 +++++
>>>>> Â  xen/arch/arm/decode.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  2 ++
>>>>> Â  xen/arch/arm/domain_build.cÂ Â Â Â Â Â Â Â Â Â Â  | 29 ++++++++++++++++++----
>>>>> Â  xen/arch/arm/efi/efi-boot.hÂ Â Â Â Â Â Â Â Â Â Â  |Â  6 +++--
>>>>> Â  xen/arch/arm/gic-v3-its.cÂ Â Â Â Â Â Â Â Â Â Â Â Â  |Â  9 ++++---
>>>>> Â  xen/arch/arm/mm.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  |Â  1 +
>>>>> Â  xen/arch/arm/p2m.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  | 33 
>>>>> +++++++++++++++-----------
>>>>> Â  9 files changed, 69 insertions(+), 26 deletions(-)
>>>>>
>>>>> diff --git a/docs/misra/safe.json b/docs/misra/safe.json
>>>>> index e3c8a1d8eb..244001f5be 100644
>>>>> --- a/docs/misra/safe.json
>>>>> +++ b/docs/misra/safe.json
>>>>> @@ -12,6 +12,14 @@
>>>>> Â Â Â Â Â Â Â Â Â  },
>>>>> Â Â Â Â Â Â Â Â Â  {
>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  "id": "SAF-1-safe",
>>>>> +Â Â Â Â Â Â Â Â Â Â Â  "analyser": {
>>>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  "eclair": "MC3R1.R9.1"
>>>>> +Â Â Â Â Â Â Â Â Â Â Â  },
>>>>> +Â Â Â Â Â Â Â Â Â Â Â  "name": "Rule 9.1: initializer not needed",
>>>>> +Â Â Â Â Â Â Â Â Â Â Â  "text": "The following local variables are possibly 
>>>>> subject to being read before being written, but code inspection 
>>>>> ensured that the control flow in the construct where they appear 
>>>>> ensures that no such event may happen."
>>>> I am bit concerned which such statement because the code instance 
>>>> was today with the current code. This could change in the future and 
>>>> invalide the reasoning.
>>>>
>>>> It is not clear to me if we have any mechanism to prevent that. If 
>>>> we don't, then I think we need to drastically reduce the number of 
>>>> time this is used (there are a bit too much for my taste).
>>>>
>>>
>>> Indeed, the purpose of such a deviation is that the sound 
>>> overapproximation computed by the tool requires a human to look at 
>>> the code and think twice before modifying it (i.e., if ever that code 
>>> is touched, the reviewer ought to assess whether that justification 
>>> still holds or some other thing should be done about it.
>>
>> Your assumption is the reviewer will notice there is an existing 
>> devitation and be able to assess it has changed. I view this 
>> assumption as risky in the long term.
>>
>> Have you investigate to improve the automatic tooling?
>>
> 
> Well, as discussed elsewhere in the thread, a slightly modified version 
> of this deviation comment can list the specific reason why such a thing 
> was deviated directly at the declaration or where the caution is, if you 
> think this is better.
> 
> Example:
> 
> // <- SAF-x here
> int var;
> 
> [...]
> 
> // <- or HERE
> f(&var);
> 
> An alternative approach to justification, partly discussed with Stefano 
> in private is a macro that looks like an attribute to signal that the 
> variable is intentionally uninitialized. This does not have the benefit 
> of a written justification with a proper comment or an entry in the json 
> file, but is less intrusive and the justification for all occurrences of 
> __uninit w.r.t R9.1 would be included in the static analysis tool 
> configuration, which would be part of the MISRA compliance 
> documentation. This does imply a coarse justification like the one 
> above, but if further clarification is needed it can be provided locally 
> in the code, as guidance for contributors.
> 
> Example:
> #define __uninit
> 
> __uninit int x;

IHMO none of the example really help. You are still expecting the 
reviewer/developper to drop __uninit or any comment if the behavior has 
changed.

I don't have a good idea how we can mitigate it other than reworking the 
code in a way that makes both ECLAIR and the maintainers happy. Maybe 
the others will.

[...]

>>>>
>>>>> Â Â Â Â Â  int ret;
>>>>> @@ -249,8 +252,10 @@ static void __init 
>>>>> process_multiboot_node(const void *fdt, int node,
>>>>> Â Â Â Â Â  const __be32 *cell;
>>>>> Â Â Â Â Â  bootmodule_kind kind;
>>>>> Â Â Â Â Â  paddr_t start, size;
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1 */
>>>>> Â Â Â Â Â  int len;
>>>>> Â Â Â Â Â  /* sizeof("/chosen/") + DT_MAX_NAME + '/' + DT_MAX_NAME + 
>>>>> '/0' => 92 */
>>>>> +Â Â Â  /* SAF-1-safe MC3R1.R9.1*/
>>>>> Â Â Â Â Â  char path[92];
>>>>
>>>> So the two above, is one category of issue. The variables are passed 
>>>> as argument of function which will fill them.
>>>>
>>>> Can Eclair look at the callers, if so, can we consider to always 
>>>> initialize the values in the callee?
>>>>
>>>> This would reduce the number of SAF-*. There are a few other 
>>>> examples like that below. So I will skip them for now.
>>>>
>>>> [...]
>>>>
>>>
>>> If the value is always initialized in the callee, then there's no 
>>> problem configuring ECLAIR so that it knows that this parameter is 
>>> always written, and therefore any subsequent use in the caller is ok.
>>>
>>> Another possibility is stating that a function never reads the 
>>> pointee before writing to it (it may or may not write it, but if it 
>>> doesn't, then the pointee is not read either). The 'strncmp' after 
>>> 'fdt_get_path' does get in the way, though, because this property is 
>>> not strong enough to ensure that we can use 'path' after returning 
>>> from the function.
>>
>> I am not sure I fully understand what you wrote. Can you provide a C 
>> example?
>>
> 
> void f(int *x) {
>  Â  if(x) {
>  Â Â Â  *x = 10;
>  Â Â Â  int y =*x; // read the pointee after it's initialized
>  Â  } else {
>  Â Â Â  int z; // in this branch the pointee is not read nor written
>  Â  }
>  Â  // we can say that f never reads *x before (possibly) writing to it.
> }

I am having trouble to understand it in the context of fdt_get_path(). 
Is 'f' meant to be fdt_get_path()?

[...]

>>>>> Â Â Â Â Â  rc = evtchn_alloc_unbound(&alloc, 0);
>>>>> Â Â Â Â Â  if ( rc )
>>>>> Â Â Â Â Â  {
>>>>> @@ -3810,8 +3827,9 @@ static int __init construct_domU(struct 
>>>>> domain *d,
>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const struct dt_device_node *node)
>>>>> Â  {
>>>>> Â Â Â Â Â  struct kernel_info kinfo = {};
>>>>> -Â Â Â  const char *dom0less_enhanced;
>>>>> +Â Â Â  const char *dom0less_enhanced = NULL;
>>>>
>>>> If you look at the user below, all the callers assume 
>>>> dom0less_enhanced will be non-NULL. So it is unclear to me how this 
>>>> value is safer.
>>>> Â > Looking at the code, I wonder whether we should convert
>>>> dt_property_read_string() to use ERR_PTR(). So we could remove the 
>>>> last argument and return it instead.
>>>
>>> Is relying on that assumption somehow safer? 
>>
>> I am assuming you are referring to "If you look at the user below, all 
>> the callers assume dom0less_enhanced will be non-NULL". Note that I 
>> didn't suggest it is safer. I am only pointed out that you didn't 
>> specify how this was better in the context of the code.
>>
> 
> This should be probably discussed after deciding on the refactoring 
> 'dt_property_read_string'

FAOD, I think we should refactor dt_property_read_string(). I am happy 
to write a patch if you want.

[...]

>>> The analysis here could use some more precision, but the modified 
>>> construct is entirely equivalent.
>>
>> I agree that they are equivalent. But in general, we don't change the 
>> style of the construct without explaining why.
>>
>> In this case, the first step would be to improve Eclair.
>>
> 
> The changes needed for this kind of analysis are not trivial: we've 
> looked into this, but there's no easy way to support this in a timely 
> manner. I understand that this is an estabilished pattern, but what 
> would you think of an initializer using designators?
> 
> uint64_t cmd[4] = {
>  Â Â Â Â Â Â Â  .[0] = GITS_CMD_MAPC;
>  Â Â Â Â Â Â Â  .[1] = 0x00;
>  Â Â Â Â Â Â Â  .[2] = encode_rdbase(its, cpu, collection_id) | GITS_VALID_BIT;
>  Â Â Â Â Â Â Â  .[3] = 0x00;
> }

The reability is Ok here. But this may not be the case here. In 
particular...

> 
>>>
>>>>> Â Â Â Â Â  cmd[3] = 0x00;
>>>>> Â Â Â Â Â  return its_send_command(its, cmd);
>>>>> @@ -215,9 +214,7 @@ static int its_send_cmd_mapd(struct host_its 
>>>>> *its, uint32_t deviceid,
>>>>> Â Â Â Â Â  }
>>>>> Â Â Â Â Â  cmd[0] = GITS_CMD_MAPD | ((uint64_t)deviceid << 32);
>>>>> Â Â Â Â Â  cmd[1] = size_bits;
>>>>> -Â Â Â  cmd[2] = itt_addr;
>>>>> -Â Â Â  if ( valid )
>>>>> -Â Â Â Â Â Â Â  cmd[2] |= GITS_VALID_BIT;
>>>>> +Â Â Â  cmd[2] = itt_addr | (valid ? GITS_VALID_BIT : 0x00);
>>>>
>>>> Same here.

here... I much prefer the existing version.

[...]

>>>>> +Â Â Â Â Â  if ( nr == MAX_VMID )
>>>>> +Â Â Â Â Â  {
>>>>> +Â Â Â Â Â Â Â Â Â  rc = -EBUSY;
>>>>> +Â Â Â Â Â Â Â Â Â  printk(XENLOG_ERR "p2m.c: dom%d: VMID pool exhausted\n", 
>>>>> d->domain_id);
>>>>> +Â Â Â Â Â Â Â Â Â  break;
>>>>> +Â Â Â Â Â  }
>>>>> -Â Â Â  set_bit(nr, vmid_mask);
>>>>> +Â Â Â Â Â  set_bit(nr, vmid_mask);
>>>>> -Â Â Â  p2m->vmid = nr;
>>>>> +Â Â Â Â Â  p2m->vmid = nr;
>>>>> -Â Â Â  rc = 0;
>>>>> +Â Â Â Â Â Â Â Â Â Â Â  rc = 0;
>>>>> +Â Â Â Â Â Â Â  } while ( 0 );
>>>>> -out:
>>>>> Â Â Â Â Â  spin_unlock(&vmid_alloc_lock);
>>>>> Â Â Â Â Â  return rc;
>>>>> Â  }
>>>>
>>>
>>>
>>> Considering all of the replies above, a first draft of a 
>>> strategy/policy I can think of is having:
>>>
>>> - Initializer functions that always write their parameter, so that 
>>> the strongest "pointee always written" property can be stated. This 
>>> causes all further uses to be marked safe.
>>>
>>> - Initialize the variable when there exists a known safe value that 
>>> does not alter the semantics of the function. The initialization does 
>>> not need to be at the declaration, but doing so simplifies the code.
>>
>> As I mentionned in private there are two risks with that:
>> Â Â 1. You silence compiler to spot other issues
>> Â Â 2. You may now get warning from Coverity if it spots you set a value 
>> that get overwritten before its first use.
>>
>> So I think such approach should be used with parcimony. Instead, we 
>> should look at reworking the code when possible.
>>
> 
> Do you think it would help if you look directly at actual cautions to 
> spot possible functions that can be refactored?

I have already looked at some. Can we focus on them and see how much it 
helps?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 15:39:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 15:39:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566669.885801 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVkU-0001Zs-AL; Thu, 20 Jul 2023 15:39:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566669.885801; Thu, 20 Jul 2023 15:39:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVkU-0001Zl-7d; Thu, 20 Jul 2023 15:39:26 +0000
Received: by outflank-mailman (input) for mailman id 566669;
 Thu, 20 Jul 2023 15:39:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMVkT-0001Zf-0U
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 15:39:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMVkR-00083T-Qf; Thu, 20 Jul 2023 15:39:23 +0000
Received: from 54-240-197-231.amazon.com ([54.240.197.231]
 helo=[192.168.24.131]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMVkR-00051N-JC; Thu, 20 Jul 2023 15:39:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=2QwYvOKFWbeRSuTcwTUQq6chwDue/EVnVIlhNgAYfbg=; b=A0/hkZxHCOoGvLHfYIHwzDG4ld
	Gd1v55unPtvIuWHzmyAJjvKJ2HzZHTRaAIaDgSxWruB6MOkvBAoHhZW5U7jJQ1n/QUZarwFKTRMRh
	ZrVvN62n6F4YE8bs1LedyUXxwp1B2bdbeI4ga9RkELAOUe7gGF/GTX0OpgWSgA7yBs+4=;
Message-ID: <d35d95fb-f211-3d54-f26a-b57e805e4dfe@xen.org>
Date: Thu, 20 Jul 2023 16:39:20 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally
 uninitialized variables
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <1ad20473a031eca75db4007bdc169616b512ef44.1689329728.git.nicola.vetrini@bugseng.com>
 <97d8a796-f790-8efc-1d89-def1f1193e61@xen.org>
 <5da7ae40-35c7-7f93-824f-42a0712cdcf1@bugseng.com>
 <9cac9bc5-ad55-3bcd-b645-a30a5b863b3f@xen.org>
 <26008624-b00c-ecd2-77e0-3f1cad63db66@bugseng.com>
 <520e15bf-05d0-5808-e318-14524ed78ab3@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <520e15bf-05d0-5808-e318-14524ed78ab3@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

The e-mail is getting quite long. Can you trim the unnecessary bits when 
replying?

On 20/07/2023 15:23, Nicola Vetrini wrote:
>>>> The problem is that _t may be uninitialized, hence assigning its 
>>>> address to t could be problematic.
>>>
>>> But the value is set right after. IOW, there is no read between. So 
>>> how is this prob
>>>
>>>> Another way to address this is to initialize _t to a bad value and 
>>>> use this variable in the body, then assign to t based on the value 
>>>> just before returning.
>>>
>>> IHMO, neither solution are ideal. I think we should investigate 
>>> whether Eclair can be improved.
>>>
>>> [...]
>>>
>>
>> I'll see what can be done about it, I'll reply when I have an answer.
>>
> 
> What about this:
> 
> -Â Â Â  p2m_type_t _t;
> +Â Â Â  p2m_type_t _t = p2m_invalid;
> [...]
>  Â Â Â Â  t = t ?: &_t;
> -Â Â Â  *t = p2m_invalid;
> +Â Â Â  *t = _t;

The resulting code is still quite confusing. I am still not quite sure 
why ECLAIR can't understand the construct. Apologies if this was already 
said, but this thread is getting quite long with many different issues. 
So it is a bit difficult to navigate (which is why I suggested to split 
and have a commit message explaining the rationale for each).

Anyway, if we can't improve Eclair, then my preference would be the 
following:

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index de32a2d638ba..05d65db01b0c 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -496,16 +496,13 @@ mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
      lpae_t entry, *table;
      int rc;
      mfn_t mfn = INVALID_MFN;
-    p2m_type_t _t;
      DECLARE_OFFSETS(offsets, addr);

      ASSERT(p2m_is_locked(p2m));
      BUILD_BUG_ON(THIRD_MASK != PAGE_MASK);

-    /* Allow t to be NULL */
-    t = t ?: &_t;
-
-    *t = p2m_invalid;
+    if ( t )
+        *t = p2m_invalid;

      if ( valid )
          *valid = false;
@@ -549,7 +546,8 @@ mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,

      if ( p2m_is_valid(entry) )
      {
-        *t = entry.p2m.type;
+        if ( t )
+            *t = entry.p2m.type;

          if ( a )
              *a = p2m_mem_access_radix_get(p2m, gfn);

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 15:40:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 15:40:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566672.885811 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVlg-0002xf-K8; Thu, 20 Jul 2023 15:40:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566672.885811; Thu, 20 Jul 2023 15:40:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVlg-0002xY-Gp; Thu, 20 Jul 2023 15:40:40 +0000
Received: by outflank-mailman (input) for mailman id 566672;
 Thu, 20 Jul 2023 15:40:38 +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 <SRS0=6Xo+=DG=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMVle-0002xE-Mq
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 15:40:38 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20608.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::608])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c45904a1-2713-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 17:40:35 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM7PR04MB6792.eurprd04.prod.outlook.com (2603:10a6:20b:dc::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Thu, 20 Jul
 2023 15:40:33 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 15:40:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c45904a1-2713-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=V1jeyl3RxZTUyEokcxIDkqPuPtdPDQ2udbRJcXTS/btmeP/CuiG4DlFVLO1ltaDm5tcb6/UfW6UNSeweBamtzZnPqpNQQxIi8aXj5MFAeIvHK7JRWh5H773wSbWfhzhbSlMugiruP4NAzwOZUvx36IkylB5yhRC9YTLuVAUwGRqU1U6LG7TryiMjfEOCYQR68738X0ifGyyDScDhqUBiqJylYXMUIxx3AR+Y2VqN8AWsXrqkeDINyto3LyIc6/0q88djVEukR9LnRFF2LkIOyd3G18OgjkJ3tH4DRHqOGBMKjPMu4IedsmygGwZtq5SWTpSOwXva6WJn9CBwNn6BVw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=CmmzDOu0Vlix94xgqi+e57VnoUNgKBhEydsZNYZ3n80=;
 b=INej2mkd6XRTjYBxqKILPGDoJVNNBzX0OLbxdoq0ozbn7iL52d68bQHtIXyBOlzJaZaOFd/TBdo3JRIVQ770A1TzAEdFeWHqA2GHVrWvaAj4yWPzVroMJFGCfQPVTlWV5ky8ktye0wZ4pSk2C2iy4z8XptgJoriQizMpiO0mjzY4MdsXrtL8XhYJ6pDFvrM+G0X497NY87LiwNVSYtLE/3mxk2nRPx7uN9FRaSZJqEsHSKrI+qpGz5TRtvB6ReikVWneIwvz6YgK5qp+AG5B34VXqvl3rkJoKzsihz4XOTMSh4cZCzLQ1EQAvXTRH7NQ0HaPQYCfxVsvzWw2ja4rTQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=CmmzDOu0Vlix94xgqi+e57VnoUNgKBhEydsZNYZ3n80=;
 b=Djn3AtmOH7JuCMrFQWiHpoLutbgGl/DTqeG2Fo8K6CpEvVKbvaNbGtGKOtHVjLcOX0pDtCUtWOStol0QjJYOGF4wzkUsBWtsf99yMdaUX0/MBbnuxmIh621hEim4qgAYGXnI9gQY2pfAhUe+Fxkem0LRxr6m0FR4RJ+njzoWRr+HK2PemPpKbNIdZRh+KgmWDClQeeQ3y2Bk1lkYi+v+Zf6X+tJFo1Wa3pvZCfxzDm605QhYnMJK59j2mlRShnje9451lt1/O0vkSlkBNUPjzpeL551YerdOW6C63BR0F0Fft8YkvDG7RW3TFWdeyNDoM/weNcHZkTSk3tJgb1THow==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <b6375b17-7922-66ea-88fd-697fa759f96a@suse.com>
Date: Thu, 20 Jul 2023 17:40:31 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 01/13] pci: introduce per-domain PCI rwlock
Content-Language: en-US
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-2-volodymyr_babchuk@epam.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230720003205.1828537-2-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0203.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a5::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM7PR04MB6792:EE_
X-MS-Office365-Filtering-Correlation-Id: 499f9e51-51e5-44b2-81db-08db8937a774
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	WErXWaQ6vLcMEfvWwnhg5zxn8Q8GwxLX2Ui1z9wVJkdu6Na8WhM4nWZMmkKg17x9yDcidEm8NfIsJxKQGh2icHYcUPCmbvWyc0if15pHeIrwhGaeWGs2prLVZHcADAWtn6D55ILprk8F1L93161SFKNDh9jh0rFicaQ38oO6M1W2zgTP2uCh1JDZx61S5aRkcC3fVvlke/6pI+lgd5Uvq6fvUPLMUBfPmhOn/cm1/b2k7jwR8YBERAVnOz85XmxC3/JFBlM73L3B1ZaPdM3UnJ/cp6WV6WkpPWDcyy1hB1TC7vbQTFlPgWjoXIwdN1GsIYwILylocebKTFfEeqv0tqmnSdr51OxosqkbP0QrLV9Qca+hF70388hu76A82HADPwWQs40u/hPYVczAErR5I0maWXA1w4SVVkFhMHNcGgjJZrMLCfn7M+f3uFoY228qpmtlwCw6xUvZtfB6BO8st2JX63ml9rAtNN0rWpTTaj0rXZ3peYzdyXjdQYrTo4EaYWVHvAwFlemJER0rUtLPburQG8zsBoADRzOabxtYi+2nPaUQLRa1uT02WF8zzUH3g6GpyPtJOgPX/6VCI5s93TVNOXMJwYYqmiauT4TPl9042Y50qxrcgqvHvn5X+FfewesLzJ6n2Kq3PBkzD1FQug==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(396003)(376002)(346002)(39860400002)(451199021)(6512007)(66476007)(26005)(186003)(6916009)(66556008)(66946007)(316002)(4326008)(6486002)(41300700001)(53546011)(6506007)(5660300002)(54906003)(31686004)(478600001)(8936002)(8676002)(2616005)(83380400001)(2906002)(38100700002)(31696002)(36756003)(86362001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?U3VIb2FnM2ZoT2Z5a3IwU3hzTU5CZXl3ZzcxWnFMWDNiV3hMR092cjVlYWxH?=
 =?utf-8?B?aUd2aGV5TVcwKzlURWUyRWMwZnFoTUV0ajRMTGZsMHdjVjZOam1WWURIeUpV?=
 =?utf-8?B?R2tLVlI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-8?B?N21wY0pOM0xmTWtDY2d6ckU0bnRHeDNZWnZJRDdzL2Nrak10UWlWWWtOek5O?=
 =?utf-8?B?aUNCVlREblJYTjVIOEhQbFBxb0cxL2hyeloyejNweHd4enRLb1VKT2NML1Bj?=
 =?utf-8?B?cHNDbFpXU3ZrcFVQL1JYc0swb0tld0ZPeGp6NTkxWlkybWpRUjhhY21iRUxM?=
 =?utf-8?B?SEJ3M1lPY1Nnblk5TW4vcDdZeDl1WENXT2ZPNTdCWjhWRUdGM3l3N081QXBa?=
 =?utf-8?Q?mgC7jm9/kgZYSBi787ivtk808?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 499f9e51-51e5-44b2-81db-08db8937a774
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 15:40:32.9619
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 9Jr40OP6fgJ0fQhDCDYQzNalwMF/3t3Zt7EFNomON0RLt4Ctp8Sw58/Kp+pntQ3uHkN8rPO1DQ/nObUnHM9p9w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6792

On 20.07.2023 02:32, Volodymyr Babchuk wrote:
> --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
> +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
> @@ -476,8 +476,13 @@ static int cf_check reassign_device(
>  
>      if ( devfn == pdev->devfn && pdev->domain != target )
>      {
> -        list_move(&pdev->domain_list, &target->pdev_list);
> -        pdev->domain = target;
> +        write_lock(&pdev->domain->pci_lock);
> +        list_del(&pdev->domain_list);
> +        write_unlock(&pdev->domain->pci_lock);

As mentioned on an earlier version, perhaps better (cheaper) to use
"source" here? (Same in VT-d code then.)

> @@ -747,6 +749,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>      ret = 0;
>      if ( !pdev->domain )
>      {
> +        write_lock(&hardware_domain->pci_lock);
>          pdev->domain = hardware_domain;
>          list_add(&pdev->domain_list, &hardware_domain->pdev_list);
>  
> @@ -760,6 +763,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>              printk(XENLOG_ERR "Setup of vPCI failed: %d\n", ret);
>              list_del(&pdev->domain_list);
>              pdev->domain = NULL;
> +            write_unlock(&hardware_domain->pci_lock);
>              goto out;

In addition to Roger's comments about locking scope: In a case like this
one it would probably also be good to move the printk() out of the locked
area. It can be slow, after all.

Question is why you have this wide a locked area here in the first place:
Don't you need to hold the lock just across the two list operations (but
not in between)?

> @@ -887,26 +895,62 @@ static int deassign_device(struct domain *d, uint16_t seg, uint8_t bus,
>  
>  int pci_release_devices(struct domain *d)
>  {
> -    struct pci_dev *pdev, *tmp;
> -    u8 bus, devfn;
> -    int ret;
> +    int combined_ret;
> +    LIST_HEAD(failed_pdevs);
>  
>      pcidevs_lock();
> -    ret = arch_pci_clean_pirqs(d);
> -    if ( ret )
> +    write_lock(&d->pci_lock);
> +    combined_ret = arch_pci_clean_pirqs(d);
> +    if ( combined_ret )
>      {
>          pcidevs_unlock();
> -        return ret;
> +        write_unlock(&d->pci_lock);
> +        return combined_ret;
>      }
> -    list_for_each_entry_safe ( pdev, tmp, &d->pdev_list, domain_list )
> +
> +    while ( !list_empty(&d->pdev_list) )
>      {
> -        bus = pdev->bus;
> -        devfn = pdev->devfn;
> -        ret = deassign_device(d, pdev->seg, bus, devfn) ?: ret;
> +        struct pci_dev *pdev = list_first_entry(&d->pdev_list,
> +                                                struct pci_dev,
> +                                                domain_list);
> +        uint16_t seg = pdev->seg;
> +        uint8_t bus = pdev->bus;
> +        uint8_t devfn = pdev->devfn;
> +        int ret;
> +
> +        write_unlock(&d->pci_lock);
> +        ret = deassign_device(d, seg, bus, devfn);
> +        write_lock(&d->pci_lock);
> +        if ( ret )
> +        {
> +            bool still_present = false;
> +            const struct pci_dev *tmp;
> +
> +            /*
> +             * We need to check if deassign_device() left our pdev in
> +             * domain's list. As we dropped the lock, we can't be sure
> +             * that list wasn't permutated in some random way, so we
> +             * need to traverse the whole list.
> +             */
> +            for_each_pdev ( d, tmp )
> +            {
> +                if ( tmp == pdev )
> +                {
> +                    still_present = true;
> +                    break;
> +                }
> +            }
> +            if ( still_present )
> +                list_move(&pdev->domain_list, &failed_pdevs);

In order to retain original ordering on the resulting list, perhaps better
list_move_tail()?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 15:44:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 15:44:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566675.885821 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVpa-0003Zw-36; Thu, 20 Jul 2023 15:44:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566675.885821; Thu, 20 Jul 2023 15:44:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVpa-0003Zp-0L; Thu, 20 Jul 2023 15:44:42 +0000
Received: by outflank-mailman (input) for mailman id 566675;
 Thu, 20 Jul 2023 15:44:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BeWc=DG=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qMVpY-0003Zh-4G
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 15:44:40 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 559bf02e-2714-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 17:44:38 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.162.143.190])
 by support.bugseng.com (Postfix) with ESMTPSA id 95C4E4EE0C89;
 Thu, 20 Jul 2023 17:44:36 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 559bf02e-2714-11ee-b23a-6b7b168915f2
Message-ID: <a2e1fb20-ed2c-8ac1-0bc7-716e162ed582@bugseng.com>
Date: Thu, 20 Jul 2023 17:44:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally
 uninitialized variables
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <1ad20473a031eca75db4007bdc169616b512ef44.1689329728.git.nicola.vetrini@bugseng.com>
 <97d8a796-f790-8efc-1d89-def1f1193e61@xen.org>
 <5da7ae40-35c7-7f93-824f-42a0712cdcf1@bugseng.com>
 <9cac9bc5-ad55-3bcd-b645-a30a5b863b3f@xen.org>
 <26008624-b00c-ecd2-77e0-3f1cad63db66@bugseng.com>
 <520e15bf-05d0-5808-e318-14524ed78ab3@bugseng.com>
 <d35d95fb-f211-3d54-f26a-b57e805e4dfe@xen.org>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <d35d95fb-f211-3d54-f26a-b57e805e4dfe@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 20/07/23 17:39, Julien Grall wrote:
> Hi,
> 
> The e-mail is getting quite long. Can you trim the unnecessary bits when 
> replying?
>

Ok.

> On 20/07/2023 15:23, Nicola Vetrini wrote:
>>>>> The problem is that _t may be uninitialized, hence assigning its 
>>>>> address to t could be problematic.
>>>>
>>>> But the value is set right after. IOW, there is no read between. So 
>>>> how is this prob
>>>>
>>>>> Another way to address this is to initialize _t to a bad value and 
>>>>> use this variable in the body, then assign to t based on the value 
>>>>> just before returning.
>>>>
>>>> IHMO, neither solution are ideal. I think we should investigate 
>>>> whether Eclair can be improved.
>>>>
>>>> [...]
>>>>
>>>
>>> I'll see what can be done about it, I'll reply when I have an answer.
>>>
>>
>> What about this:
>>
>> -Â Â Â  p2m_type_t _t;
>> +Â Â Â  p2m_type_t _t = p2m_invalid;
>> [...]
>> Â Â Â Â Â  t = t ?: &_t;
>> -Â Â Â  *t = p2m_invalid;
>> +Â Â Â  *t = _t;
> 
> The resulting code is still quite confusing. I am still not quite sure 
> why ECLAIR can't understand the construct. Apologies if this was already 
> said, but this thread is getting quite long with many different issues. 
> So it is a bit difficult to navigate (which is why I suggested to split 
> and have a commit message explaining the rationale for each).
> 
> Anyway, if we can't improve Eclair, then my preference would be the 
> following:
> 
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index de32a2d638ba..05d65db01b0c 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -496,16 +496,13 @@ mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t 
> gfn,
>  Â Â Â Â  lpae_t entry, *table;
>  Â Â Â Â  int rc;
>  Â Â Â Â  mfn_t mfn = INVALID_MFN;
> -Â Â Â  p2m_type_t _t;
>  Â Â Â Â  DECLARE_OFFSETS(offsets, addr);
> 
>  Â Â Â Â  ASSERT(p2m_is_locked(p2m));
>  Â Â Â Â  BUILD_BUG_ON(THIRD_MASK != PAGE_MASK);
> 
> -Â Â Â  /* Allow t to be NULL */
> -Â Â Â  t = t ?: &_t;
> -
> -Â Â Â  *t = p2m_invalid;
> +Â Â Â  if ( t )
> +Â Â Â Â Â Â Â  *t = p2m_invalid;
> 
>  Â Â Â Â  if ( valid )
>  Â Â Â Â Â Â Â Â  *valid = false;
> @@ -549,7 +546,8 @@ mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
> 
>  Â Â Â Â  if ( p2m_is_valid(entry) )
>  Â Â Â Â  {
> -Â Â Â Â Â Â Â  *t = entry.p2m.type;
> +Â Â Â Â Â Â Â  if ( t )
> +Â Â Â Â Â Â Â Â Â Â Â  *t = entry.p2m.type;
> 
>  Â Â Â Â Â Â Â Â  if ( a )
>  Â Â Â Â Â Â Â Â Â Â Â Â  *a = p2m_mem_access_radix_get(p2m, gfn);
> 

Ok, I'll make a separate patch.

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 15:54:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 15:54:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566681.885831 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVyT-0005TN-Ty; Thu, 20 Jul 2023 15:53:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566681.885831; Thu, 20 Jul 2023 15:53:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVyT-0005TG-QW; Thu, 20 Jul 2023 15:53:53 +0000
Received: by outflank-mailman (input) for mailman id 566681;
 Thu, 20 Jul 2023 15:53:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6Xo+=DG=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMVyS-0005TA-GU
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 15:53:52 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0605.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::605])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9edc2d9e-2715-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 17:53:51 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB8202.eurprd04.prod.outlook.com (2603:10a6:10:24f::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Thu, 20 Jul
 2023 15:53:48 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 15:53:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9edc2d9e-2715-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=GKghWQShmhqpq+6B9514u/yyueJCD4kRrPdRtLXKmm5KPjHz/dAXrYMcoWE8VV23081kvoAUlZF5UF3+Zma9WMCEB/eLybcgH5Z31kEtQekKmGfHFwwdQepovGy8C3ts1uwiTAbBu/1faTL2/tL1BJxi03AB8jQb0O40zyCJ6SebE0DMYKgYgp5GPpTt97PdkI17OIvwTBEEAeOUY8ZzeAWgZk7rRRrDX32JNLRb55gak/231eXyxCLR9V3jgvA06txFLCbjoxlKpaX5TBJd/i1mRwY2jeBkt9RrKDRrYxM5pMyVUpwEJLpMY6xe6NECCmKUBNDgqnuGo1z16oaCiA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=B7kGzGcFIqLmLK/uDdDsCu01j/IB8V3sWF3dtRJ328s=;
 b=jf8bteC7aONJhYdslw8V0EwQqzZ/leg5ydq6hX7OyWJvfh0tE1Wy2C59WBHx/QwHH4Y+H11tZ5bhFz78AeScepPAcp+T7l0DJAVCUu9xrBwGfqrA3A7t6ZN3LTCwIfevX72QZL3SInwI4+UczhpoTcrwWAmhEDKJP9HwtGBamH9M04kTz3wwRegucWZktXCrZ3cz/glHI5oUAw8NvKVzYJuufcGE77BMf+d2SQ6TEq6bV0DQ3wHl/Ox89pF/MqgLAFCix0jCNww4Pdf1NdVGZIpQADwJ+ymg1RjVS/i8v+wMqqwR6TZDcWhiGU1Folp8984zvef6iOtcw1mKGE5YCg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=B7kGzGcFIqLmLK/uDdDsCu01j/IB8V3sWF3dtRJ328s=;
 b=0j7rUlpamI1g03oOLBJqD8gFmAZ0r0dm93dnSOia+Qp317Yak4hi1G6xS9pSmKM55xxolD8WqS9G+PuLm+EOfM0mi7hCZd3phN0Nqs1kkksD0Rq9zkt9ngybQPzVjgp6RvuFiViO/oeDX6wKMLW3C75HdouSmm4fnYTqPuTie09py4j5ZJnTG0G6Tk1pxWyhTy1J5jOAzbrKBzRkWgKSuTwDiA7LElmzrxg36FZGJyscC2rWeV88YdMqsWWFjAWIiZS8bi7ELNMdJynu860hOmbRo40z2NtD0ilKMGEJk4CaQKfyHlnTvtFU0CC5llYl6ShZglKvLGq29Lv2Mdtahg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <13883bae-232a-549d-289f-ccaf25b4c81c@suse.com>
Date: Thu, 20 Jul 2023 17:53:46 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0116.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a8::18) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB8202:EE_
X-MS-Office365-Filtering-Correlation-Id: 91e09779-3fe4-4a46-fa57-08db893981bc
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	lm3yplD5dTUlraGubcepkYSr/X4zDaUG2N+1NPHZ7S45I0sKXBM5v8jyk8ljZgm96a8bh2M28dfSFndG+55ZNOYN464GU3wvt+sv2YTxGyb7y5OVeJFwY0RrYkImUK275JzTdca0T8rxMiy8Rp/+Q3ZXGfBlLN8uWXFXr+WL6oII7iE6gXcqIZW2GCCanhIjg7zLdnxdGHAwh3BsQWsueVduLW1Dkp4KKDTJeVU6k9hg/0RW1IFGqD8eF1du50BKwAvFvaNlElnf/padCREMk8DRdJmY/PnC8p840X6lxHi7iyBeMuTW8vfW7agreLqS70zr07vT+saUhk6IiG0iX0Hb1lZufO3/IKAqUjEIZ3GrPGV/Iph5JfIpcZsh6r3D5IzP31Uh3vFr3ow8JdP6TNXfg9VmcxSlAdy+03HoQ7FkGsGGnI1NXx/IUtSKk5XvbBn7kDKjO5PxC0E+PpDZ4vTvMv/shvHFuUQi4pGy2Fl9KiBPk5BVESLIRNDjBy98WGby7mcvRvPaPemhVSQslnGOJdbzNj7CHA00NTzEniKjH7EiAbYzZ4D+y4P8TFUiei2FNJ799SeMuw2PaEe+x4PIB/lNTvyAuJkQ8D7lumqNrKqBERDJd8PZv0JdpYko1afnT/MCMzkcpeyA4csaIA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(39860400002)(396003)(346002)(366004)(376002)(451199021)(31686004)(186003)(316002)(2616005)(36756003)(5660300002)(8676002)(8936002)(110136005)(54906003)(6486002)(4326008)(26005)(6506007)(53546011)(41300700001)(83380400001)(66946007)(478600001)(38100700002)(31696002)(2906002)(86362001)(4744005)(66556008)(66476007)(6512007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MEhhTHlaMm1OOGtPR3FNREZOVFhVeEk0Uk5EYm5OZ1N5UG5SOWUrUHcwSm05?=
 =?utf-8?B?QkVUenVWdm45N2R5SWFRNUVjNWVFVVF2SGdyQlErTjE5MElGcjd2RjhNRkkz?=
 =?utf-8?B?dnB6OVhXNkluVGZXbldPUjFRWEx0VTRKb2xHcnZOekl3azVpVk4wcjVIODBG?=
 =?utf-8?B?WHRnSS9NR2VlVnNTTkdsWjE0RXB1eGp2clVoMkdzL1FYdUpSR2FmSzN2UFVO?=
 =?utf-8?B?aUVHUUZ2d3FmZGMrTGZySTBFUFlPUnY0Znc1MkY1cThSZk5uR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4UTh1dHVENWVscFFtR3pIQlFCZUFm?=
 =?utf-8?B?RUFhWlEzbDMvdTYvVXE3MGtRcDRoVmMwZUJ4NHdjMnRNVHU0QUU5dzRpS3NC?=
 =?utf-8?Q?XN49szeZXrA/GrGjtitNgi8+i?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 91e09779-3fe4-4a46-fa57-08db893981bc
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 15:53:48.6880
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: C5t3kN2g5EVNps3iYszgyW3LqJx9uX+yGExAMtOgM0EUm17Je5W9Du0tNJspEyBiJUeXj9lW/iRjt77jV9m1pA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8202

On 20.07.2023 13:20, Roger Pau MonnÃ© wrote:
> On Thu, Jul 20, 2023 at 12:32:31AM +0000, Volodymyr Babchuk wrote:
>> @@ -318,14 +323,17 @@ void vpci_dump_msi(void)
>>                       * holding the lock.
>>                       */

Note the comment here.

>>                      printk("unable to print all MSI-X entries: %d\n", rc);
>> -                    process_pending_softirqs();
>> -                    continue;
>> +                    goto pdev_done;
>>                  }
>>              }
>>  
>>              spin_unlock(&pdev->vpci->lock);
>> + pdev_done:
>> +            read_unlock(&d->pci_lock);
>>              process_pending_softirqs();
>> +            read_lock(&d->pci_lock);
> 
> read_trylock().

Plus the same scheme as with the spin lock wants following imo:
vpci_msix_arch_print() returns an error only with (now) both locks
dropped. This then wants reflecting in the comment pointed out
above.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 15:54:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 15:54:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566682.885841 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVyk-0005n7-91; Thu, 20 Jul 2023 15:54:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566682.885841; Thu, 20 Jul 2023 15:54:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMVyk-0005my-5g; Thu, 20 Jul 2023 15:54:10 +0000
Received: by outflank-mailman (input) for mailman id 566682;
 Thu, 20 Jul 2023 15:54:09 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMVyi-0005mI-VL
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 15:54:08 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMVyi-0008TL-0w; Thu, 20 Jul 2023 15:54:08 +0000
Received: from 54-240-197-239.amazon.com ([54.240.197.239]
 helo=[192.168.24.131]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMVyh-0005Sy-Pl; Thu, 20 Jul 2023 15:54:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=SWotC4N6z+R2/7zcjkUZPwA6HLVLWA08lcaVrEZBNIU=; b=YQNBAKsHpueAHZ0sesGpkastPz
	RrQidtLsP6ZF5vNgfAPLH0S7lJW/N3fW/1Nvyd+MziCOKVTp+IqfAcikuB1XFbCZeVBU8qu90xUuz
	l79GSiIgRYCCLR/Pl7iTZZCZiyvGJ2qPGyqrBstjMftMfOQx+ZHsWiq2+TYtWdvXMFzw=;
Message-ID: <b245a0da-0a21-8405-6744-22b86ba994a5@xen.org>
Date: Thu, 20 Jul 2023 16:54:05 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] xen/arm: optee: provide an initialization for struct
 arm_smccc_res
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>
References: <a86604d6c85a0d516b8e29258ffebb2841dc6aff.1689863236.git.nicola.vetrini@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <a86604d6c85a0d516b8e29258ffebb2841dc6aff.1689863236.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Nicola,

On 20/07/2023 15:29, Nicola Vetrini wrote:
> The local variables with type 'struct arm_smccc_res' are initialized
> just after the declaration to avoid any possible read usage prior
> to any write usage, which would constitute a violation of
> MISRA C:2012 Rule 9.1.
> 
> This is already prevented by suitable checks in the code,
> but the correctness of this approach is difficult to prove and
> reason about.

So I looked at the implementation of arm_smccc_smc(). For arm64, it is 
(simplified):

if ( cpus_have_const_cap(ARM_SMCCC_1_1) )
    arm_smccc_1_1_smc(__VA_ARGS__);
else
    arm_smccc_1_0_smc(_VA_ARGS__);

In arm_smccc_1_1_smc(), we will explicitly initialize __res:

if ( ___res )
   *___res = (typeof(*___res)) {r0, r1, r2, r3};


Whereas for arm_smccc_1_0_smc(), we would call assembly function. I 
assuming this is the problem?

I think this is similar to the discussion we had on set_interrupts() and 
dt_set_cells(). If so, couldn't we tell ECLAIR that 
__arm_smccc_1_0_smc() will always initialize *res?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 16:01:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 16:01:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566688.885851 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMW5f-0008UG-Vv; Thu, 20 Jul 2023 16:01:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566688.885851; Thu, 20 Jul 2023 16:01:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMW5f-0008U9-Ss; Thu, 20 Jul 2023 16:01:19 +0000
Received: by outflank-mailman (input) for mailman id 566688;
 Thu, 20 Jul 2023 16:01:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BeWc=DG=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qMW5e-0008Tz-75
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 16:01:18 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a8bd3296-2716-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 18:01:17 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.162.143.190])
 by support.bugseng.com (Postfix) with ESMTPSA id A0A244EE0C89;
 Thu, 20 Jul 2023 18:01:14 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a8bd3296-2716-11ee-b23a-6b7b168915f2
Message-ID: <b5373244-d1e9-f90d-9b56-15897caa87f2@bugseng.com>
Date: Thu, 20 Jul 2023 18:01:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally
 uninitialized variables
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
 <1ad20473a031eca75db4007bdc169616b512ef44.1689329728.git.nicola.vetrini@bugseng.com>
 <97d8a796-f790-8efc-1d89-def1f1193e61@xen.org>
 <5da7ae40-35c7-7f93-824f-42a0712cdcf1@bugseng.com>
 <9cac9bc5-ad55-3bcd-b645-a30a5b863b3f@xen.org>
 <26008624-b00c-ecd2-77e0-3f1cad63db66@bugseng.com>
 <9a646bac-6355-7ccd-6e09-e10f942f44af@xen.org>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <9a646bac-6355-7ccd-6e09-e10f942f44af@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit


>>>> If the value is always initialized in the callee, then there's no 
>>>> problem configuring ECLAIR so that it knows that this parameter is 
>>>> always written, and therefore any subsequent use in the caller is ok.
>>>>
>>>> Another possibility is stating that a function never reads the 
>>>> pointee before writing to it (it may or may not write it, but if it 
>>>> doesn't, then the pointee is not read either). The 'strncmp' after 
>>>> 'fdt_get_path' does get in the way, though, because this property is 
>>>> not strong enough to ensure that we can use 'path' after returning 
>>>> from the function.
>>>
>>> I am not sure I fully understand what you wrote. Can you provide a C 
>>> example?
>>>
>>
>> void f(int *x) {
>> Â Â  if(x) {
>> Â Â Â Â  *x = 10;
>> Â Â Â Â  int y =*x; // read the pointee after it's initialized
>> Â Â  } else {
>> Â Â Â Â  int z; // in this branch the pointee is not read nor written
>> Â Â  }
>> Â Â  // we can say that f never reads *x before (possibly) writing to it.
>> }
> 
> I am having trouble to understand it in the context of fdt_get_path(). 
> Is 'f' meant to be fdt_get_path()?
> 

Yes, exactly. The point is that 'fdt_get_path' surely ensures not to 
read uninitialized addresses from the path array, therefore if the 
strcmp can be somehow incorporated in a function or macro e.g.

int fdt_compare_path(fdt, node, path, str) {
     /* Check that the node is under "/chosen" (first 7 chars of path) */
     ret = fdt_get_path(fdt, node, path, sizeof (path));
     if ( ret != 0 || strncmp(path, "/chosen", 7) )
         return ret;
     return 0;
}

called in bootfdt as fdt_compare_path(fdt, node, path, "/chosen");

then 'fdt_compare_path' has the, shall we say, "no read before write" 
property and because path isn't used anywhere else in 
'process_multiboot_node' that is enough to make ECLAIR happy.

>>
>> This should be probably discussed after deciding on the refactoring 
>> 'dt_property_read_string'
> 
> FAOD, I think we should refactor dt_property_read_string(). I am happy 
> to write a patch if you want.
> 

That would be perfect, I'll ll test it when I see it, so that I can give 
you feedback on that patch directly.

> 
>>>> The analysis here could use some more precision, but the modified 
>>>> construct is entirely equivalent.
>>>
>>> I agree that they are equivalent. But in general, we don't change the 
>>> style of the construct without explaining why.
>>>
>>> In this case, the first step would be to improve Eclair.
>>>
>>
>> The changes needed for this kind of analysis are not trivial: we've 
>> looked into this, but there's no easy way to support this in a timely 
>> manner. I understand that this is an estabilished pattern, but what 
>> would you think of an initializer using designators?
>>
>> uint64_t cmd[4] = {
>> Â Â Â Â Â Â Â Â  .[0] = GITS_CMD_MAPC;
>> Â Â Â Â Â Â Â Â  .[1] = 0x00;
>> Â Â Â Â Â Â Â Â  .[2] = encode_rdbase(its, cpu, collection_id) | GITS_VALID_BIT;
>> Â Â Â Â Â Â Â Â  .[3] = 0x00;
>> }
> 
> The reability is Ok here. But this may not be the case here. In 
> particular...
> 
>>
>>>>
>>>>>> Â Â Â Â Â  cmd[3] = 0x00;
>>>>>> Â Â Â Â Â  return its_send_command(its, cmd);
>>>>>> @@ -215,9 +214,7 @@ static int its_send_cmd_mapd(struct host_its 
>>>>>> *its, uint32_t deviceid,
>>>>>> Â Â Â Â Â  }
>>>>>> Â Â Â Â Â  cmd[0] = GITS_CMD_MAPD | ((uint64_t)deviceid << 32);
>>>>>> Â Â Â Â Â  cmd[1] = size_bits;
>>>>>> -Â Â Â  cmd[2] = itt_addr;
>>>>>> -Â Â Â  if ( valid )
>>>>>> -Â Â Â Â Â Â Â  cmd[2] |= GITS_VALID_BIT;
>>>>>> +Â Â Â  cmd[2] = itt_addr | (valid ? GITS_VALID_BIT : 0x00);
>>>>>
>>>>> Same here.
> 
> here... I much prefer the existing version.
> 

Well, that if can be kept as well. Like this:

cmd = { .[0] = .., .[2] = itt_addr, ... };
if(valid)
   cmd[2] |= GITS_VALID_BIT;

>>>>
>>>> Considering all of the replies above, a first draft of a 
>>>> strategy/policy I can think of is having:
>>>>
>>>> - Initializer functions that always write their parameter, so that 
>>>> the strongest "pointee always written" property can be stated. This 
>>>> causes all further uses to be marked safe.
>>>>
>>>> - Initialize the variable when there exists a known safe value that 
>>>> does not alter the semantics of the function. The initialization 
>>>> does not need to be at the declaration, but doing so simplifies the 
>>>> code.
>>>
>>> As I mentionned in private there are two risks with that:
>>> Â Â 1. You silence compiler to spot other issues
>>> Â Â 2. You may now get warning from Coverity if it spots you set a 
>>> value that get overwritten before its first use.
>>>
>>> So I think such approach should be used with parcimony. Instead, we 
>>> should look at reworking the code when possible.
>>>
>>
>> Do you think it would help if you look directly at actual cautions to 
>> spot possible functions that can be refactored?
> 
> I have already looked at some. Can we focus on them and see how much it 
> helps?
> 

Yes. It would reduce the noise for me too

Regards,

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 16:02:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 16:02:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566694.885860 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMW6c-0000aY-9A; Thu, 20 Jul 2023 16:02:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566694.885860; Thu, 20 Jul 2023 16:02:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMW6c-0000aP-6P; Thu, 20 Jul 2023 16:02:18 +0000
Received: by outflank-mailman (input) for mailman id 566694;
 Thu, 20 Jul 2023 16:02:16 +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
 <SRS0=/JYs=DG=citrix.com=prvs=558be806a=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMW6a-0000Sq-H5
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 16:02:16 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c9ba4be2-2716-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 18:02:13 +0200 (CEST)
Received: from mail-bn7nam10lp2103.outbound.protection.outlook.com (HELO
 NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.103])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 20 Jul 2023 12:02:10 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by MW4PR03MB6459.namprd03.prod.outlook.com (2603:10b6:303:122::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Thu, 20 Jul
 2023 16:02:03 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 16:02:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c9ba4be2-2716-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689868933;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=sOW24vdpwKFlImAKHjJQvLRO2DKrlh5GtlvIV6wNFqE=;
  b=fvJM3oa/CeOB9oUfNjwElLkZi8XMtLpGlgcFAqIhKCeZ8nbvz2pNUl5R
   TzY0Q/P9mGYs/xskye21IIkF10V0tNe59Q00gXNjAnXPSBSpXFILzCH8u
   prmnW45pOH2Dh3n2q1+JlkG1JG9OXMnTN3oQZiu2VK1zfDQoE8I5URdhb
   g=;
X-IronPort-RemoteIP: 104.47.70.103
X-IronPort-MID: 117322273
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:+Dwzsa8lFOHumdan5XAJDrUDR3+TJUtcMsCJ2f8bNWPcYEJGY0x3z
 jMXWWjSb6qMMGLzf49zb4q3p05X75bUmoU1SwI4/yg8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s
 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24Bx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35y08TT58MpZMdV/7yBVUIxqohelO+vGhFACzCFtWHi
X-IronPort-AV: E=Sophos;i="6.01,219,1684814400"; 
   d="scan'208";a="117322273"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KYqWDL3bOjcemU2mL2DwA7oeDAoCV5PFs1133eR4mOCMjfJRdT9vvBubORlmItOKIFPiek4dRhA2Sro8yUVOtwiuxb547WkBCQv8xMcPb9wCh73wOOgkResF1DPRUUFsE6uWG6hVADd2a4yd0RmiOFzBzGCnA6ImrPbbaCLo2F39G0PJLaNFQDjsqgtVc9dbPzmyNk7+sK/EXbkmMnUiLOpJ0LpzdjrjVlKsOLFma2FUGgGaG1rDPE9h3ncVZiKNqejWM8jcxYznbhhiOQkVKRmb54eNKmTmovHR9vGE1B6qsH5wk3aGYXp9VJQTPyeaYQqCu1obNQcSA7WfBKj2FQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0F4oyVHuGXrIGbDQU29D8XIBOfRplyGrR3Oariy3Duc=;
 b=L5gFesAsyRO2xajXNzNlL6Sn/JZI55BPgeft7Q5+9WAyvX6M09xWL4FksKLo+002VBIZ56u1Bbo9XsuPSjFWJkyN8nKFE6iztGid/dhslpgqnANjTKoiJ+JAaV2kn/E+V5eiNik/21JsRcFNhXjpdcnnc7MkbMHnXjeDG5ZqcNQ6lGe5w4nJzTGMIn3t1JGwNpxkzs6f1jJGQix7kCDBR/Q7+Exgrv5t3ZVpx99NjoN9IJdAY+ASCmRKRi3nkw+iNFokpgpAKvrH7vGkxCaCWhPAfS2Aqxokn76ahFfonctqve/bRb92dVlxvOkHttehs3tyq5qWKIThR6WsNO3A0g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0F4oyVHuGXrIGbDQU29D8XIBOfRplyGrR3Oariy3Duc=;
 b=LaeTHatBQucfFBQTOQNaAh7OSxePcK/IGLw1cDLFZdOLI5f8F8hmDI6pFsSG6TokIS/BWdWrC2cOPyN87PXf45NauJWe04uViksA4JV8WNB4NI5lYsaQ8H40meXYBRQY415C9AX2YRa35QldkAySOwDrCbsMqgHLIgPeA3tIGLU=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Thu, 20 Jul 2023 18:01:58 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH v8 05/13] vpci/header: implement guest BAR register
 handlers
Message-ID: <ZLladg9j9PCJE8oC@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-6-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20230720003205.1828537-6-volodymyr_babchuk@epam.com>
X-ClientProxiedBy: LO4P123CA0031.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:151::18) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|MW4PR03MB6459:EE_
X-MS-Office365-Filtering-Correlation-Id: 290d38eb-9bf7-4656-29de-08db893aa85b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	GEKQz7Vm97kobm4/3ZzaBC5G8vec38pp+prOfkE2U/nY1yQsevQj5Sa6ByMmXDbSiCuKmZTYCtRR6F6V7UAGDewfo/BzjZH7rGYY9wu7qAAJ3foU0gdrOasttrQjDMqbSbjv7/OSLiGhLUgd+38TcHh3EpdBaDDscq7pMgx89UrJIO7NiCwYDmG7ctKqs8fcDppH8TIqkamsoFDXLUseyqflcFsSGdn8D4Zx+jwSxROWwyIKGmeZ4ySvMTm3hwiSP44i6I+lWlI4K9QtKGK3zjYM3KTCc8mQW1HA1az13IMV1wlKT8dpK+Z9wkwBGd86Y/O0drpg18xHpqozDKhny7V/IPz8myrcyZ7VqxF+8YUgvCfQkQ0qmEG6cpITerNPPQgDyk3kZKXTTgO9JAqf+R+CkRw3qgboEfH524jz2wTB3ADXWpAwzNJryoMoMbm6mqcaZRuaEh4iRwVtfRmXmCQ2CIX9BM6vXvi1STj2ClOQI9HUn1eqfreE/iSDPGDv/BvozMGXQPMKPqCSboiyJdzccHKm0C+iwSZ4cO3SQ7OUeWIaJafVn+JaILYlPP2z
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(39860400002)(136003)(376002)(366004)(451199021)(2906002)(478600001)(6666004)(66476007)(6486002)(8676002)(85182001)(66556008)(54906003)(41300700001)(66946007)(6916009)(4326008)(8936002)(316002)(83380400001)(82960400001)(6512007)(9686003)(86362001)(186003)(5660300002)(26005)(38100700002)(6506007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-Ant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1TdUOsqyL3QWjEu3MYnpW415AEvS4zgrsSXLQvhfr3vjLgeA5RF8rZN42xdi2iNL0xrXe1I/ci+FRxx3IGHIncO2Nv/ZwnVeIlwgJkXGvFIdkxZhvgFpp87nn18WcYLFaY218GopT5SemMbTlrOMpXByjtZBmyMD98f2dtYovMTAdZooKUMSd20sRWzwMnFSCv5egXJ/EXrO4NtXlxeuZ+buBov0tX5VjKICeJFa+hn6fj3UrlOiaFEcTkTeVK8poZQo5IPXQj3rwjapWbXOEqzOlb933C2Ac8AUe7c+sn071U3sCCnxs2auPZ+4S1vvElCWV+6JE19gvt2V6WadQdbG+qpX8Lu2JsaFYc9OYA3J7rdtnwXetdL37c1/UuSrIhs9aMyg=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 290d38eb-9bf7-4656-29de-08db893aa85b
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 16:02:03.2514
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: bfGgrLfbVxZ6i3EQMOs4v38FUXmk7xuUj0DuWh7beR+cw4yrGMmRxXTOBkrizYUmUcMkU7GDr5uvZuXmbCjFuw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR03MB6459

On Thu, Jul 20, 2023 at 12:32:32AM +0000, Volodymyr Babchuk wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> 
> Add relevant vpci register handlers when assigning PCI device to a domain
> and remove those when de-assigning. This allows having different
> handlers for different domains, e.g. hwdom and other guests.
> 
> Emulate guest BAR register values: this allows creating a guest view
> of the registers and emulates size and properties probe as it is done
> during PCI device enumeration by the guest.
> 
> All empty, IO and ROM BARs for guests are emulated by returning 0 on
> reads and ignoring writes: this BARs are special with this respect as
> their lower bits have special meaning, so returning default ~0 on read
> may confuse guest OS.
> 
> Memory decoding is initially disabled when used by guests in order to
> prevent the BAR being placed on top of a RAM region.

I'm kind of lost on this last sentence, as I don't see the patch
explicitly disabling PCI_COMMAND_MEMORY form the command register.  Is
that more of an expectation on the initial device state?

Maybe there should be some checking in that case then?

> 
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> ---
> 
> Since v6:
> - unify the writing of the PCI_COMMAND register on the
>   error path into a label
> - do not introduce bar_ignore_access helper and open code
> - s/guest_bar_ignore_read/empty_bar_read
> - update error message in guest_bar_write
> - only setup empty_bar_read for IO if !x86
> Since v5:
> - make sure that the guest set address has the same page offset
>   as the physical address on the host
> - remove guest_rom_{read|write} as those just implement the default
>   behaviour of the registers not being handled
> - adjusted comment for struct vpci.addr field
> - add guest handlers for BARs which are not handled and will otherwise
>   return ~0 on read and ignore writes. The BARs are special with this
>   respect as their lower bits have special meaning, so returning ~0
>   doesn't seem to be right
> Since v4:
> - updated commit message
> - s/guest_addr/guest_reg
> Since v3:
> - squashed two patches: dynamic add/remove handlers and guest BAR
>   handler implementation
> - fix guest BAR read of the high part of a 64bit BAR (Roger)
> - add error handling to vpci_assign_device
> - s/dom%pd/%pd
> - blank line before return
> Since v2:
> - remove unneeded ifdefs for CONFIG_HAS_VPCI_GUEST_SUPPORT as more code
>   has been eliminated from being built on x86
> Since v1:
>  - constify struct pci_dev where possible
>  - do not open code is_system_domain()
>  - simplify some code3. simplify
>  - use gdprintk + error code instead of gprintk
>  - gate vpci_bar_{add|remove}_handlers with CONFIG_HAS_VPCI_GUEST_SUPPORT,
>    so these do not get compiled for x86
>  - removed unneeded is_system_domain check
>  - re-work guest read/write to be much simpler and do more work on write
>    than read which is expected to be called more frequently
>  - removed one too obvious comment
> ---
>  xen/drivers/vpci/header.c | 156 +++++++++++++++++++++++++++++++-------
>  xen/include/xen/vpci.h    |   3 +
>  2 files changed, 130 insertions(+), 29 deletions(-)
> 
> diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
> index 2780fcae72..5dc9b5338b 100644
> --- a/xen/drivers/vpci/header.c
> +++ b/xen/drivers/vpci/header.c
> @@ -457,6 +457,71 @@ static void cf_check bar_write(
>      pci_conf_write32(pdev->sbdf, reg, val);
>  }
>  
> +static void cf_check guest_bar_write(const struct pci_dev *pdev,
> +                                     unsigned int reg, uint32_t val, void *data)
> +{
> +    struct vpci_bar *bar = data;
> +    bool hi = false;
> +    uint64_t guest_reg = bar->guest_reg;
> +
> +    if ( bar->type == VPCI_BAR_MEM64_HI )
> +    {
> +        ASSERT(reg > PCI_BASE_ADDRESS_0);
> +        bar--;
> +        hi = true;
> +    }
> +    else
> +    {
> +        val &= PCI_BASE_ADDRESS_MEM_MASK;
> +        val |= bar->type == VPCI_BAR_MEM32 ? PCI_BASE_ADDRESS_MEM_TYPE_32
> +                                           : PCI_BASE_ADDRESS_MEM_TYPE_64;
> +        val |= bar->prefetchable ? PCI_BASE_ADDRESS_MEM_PREFETCH : 0;
> +    }
> +
> +    guest_reg &= ~(0xffffffffull << (hi ? 32 : 0));
> +    guest_reg |= (uint64_t)val << (hi ? 32 : 0);
> +
> +    guest_reg &= ~(bar->size - 1) | ~PCI_BASE_ADDRESS_MEM_MASK;
> +
> +    /*
> +     * Make sure that the guest set address has the same page offset
> +     * as the physical address on the host or otherwise things won't work as
> +     * expected.
> +     */
> +    if ( (guest_reg & (~PAGE_MASK & PCI_BASE_ADDRESS_MEM_MASK)) !=
> +         (bar->addr & ~PAGE_MASK) )
> +    {
> +        gprintk(XENLOG_WARNING,
> +                "%pp: ignored BAR %zu write attempting to change page offset\n",
> +                &pdev->sbdf, bar - pdev->vpci->header.bars + hi);
> +        return;
> +    }
> +
> +    bar->guest_reg = guest_reg;
> +}
> +
> +static uint32_t cf_check guest_bar_read(const struct pci_dev *pdev,
> +                                        unsigned int reg, void *data)
> +{
> +    const struct vpci_bar *bar = data;
> +    bool hi = false;
> +
> +    if ( bar->type == VPCI_BAR_MEM64_HI )
> +    {
> +        ASSERT(reg > PCI_BASE_ADDRESS_0);
> +        bar--;
> +        hi = true;
> +    }
> +
> +    return bar->guest_reg >> (hi ? 32 : 0);
> +}
> +
> +static uint32_t cf_check empty_bar_read(const struct pci_dev *pdev,
> +                                        unsigned int reg, void *data)
> +{
> +    return 0;
> +}
> +
>  static void cf_check rom_write(
>      const struct pci_dev *pdev, unsigned int reg, uint32_t val, void *data)
>  {
> @@ -517,6 +582,7 @@ static int cf_check init_bars(struct pci_dev *pdev)
>      struct vpci_header *header = &pdev->vpci->header;
>      struct vpci_bar *bars = header->bars;
>      int rc;
> +    bool is_hwdom = is_hardware_domain(pdev->domain);
>  
>      ASSERT(rw_is_locked(&pdev->domain->pci_lock));
>  
> @@ -558,13 +624,12 @@ static int cf_check init_bars(struct pci_dev *pdev)
>          if ( i && bars[i - 1].type == VPCI_BAR_MEM64_LO )
>          {
>              bars[i].type = VPCI_BAR_MEM64_HI;
> -            rc = vpci_add_register(pdev->vpci, vpci_hw_read32, bar_write, reg,
> -                                   4, &bars[i]);
> +            rc = vpci_add_register(pdev->vpci,
> +                                   is_hwdom ? vpci_hw_read32 : guest_bar_read,
> +                                   is_hwdom ? bar_write : guest_bar_write,
> +                                   reg, 4, &bars[i]);
>              if ( rc )
> -            {
> -                pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
> -                return rc;
> -            }
> +                goto fail;
>  
>              continue;
>          }
> @@ -573,6 +638,17 @@ static int cf_check init_bars(struct pci_dev *pdev)
>          if ( (val & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_IO )
>          {
>              bars[i].type = VPCI_BAR_IO;
> +
> +#ifndef CONFIG_X86
> +            if ( !is_hwdom )
> +            {
> +                rc = vpci_add_register(pdev->vpci, empty_bar_read, NULL,
> +                                       reg, 4, &bars[i]);

For an empty BAR there's no need to pass &bars[i] around? (same for
all callers that setup empty_bar_read() handlers.

> +                if ( rc )
> +                    goto fail;
> +            }
> +#endif

This might be better done as an IS_ENABLED() check in the introduced
if condition.  Need a bit of a description as to why IO space BARs are
handled as empty BARs for domUs.

> +
>              continue;
>          }
>          if ( (val & PCI_BASE_ADDRESS_MEM_TYPE_MASK) ==
> @@ -584,14 +660,20 @@ static int cf_check init_bars(struct pci_dev *pdev)
>          rc = pci_size_mem_bar(pdev->sbdf, reg, &addr, &size,
>                                (i == num_bars - 1) ? PCI_BAR_LAST : 0);
>          if ( rc < 0 )
> -        {
> -            pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
> -            return rc;
> -        }
> +            goto fail;
>  
>          if ( size == 0 )
>          {
>              bars[i].type = VPCI_BAR_EMPTY;
> +
> +            if ( !is_hwdom )
> +            {
> +                rc = vpci_add_register(pdev->vpci, empty_bar_read, NULL,
> +                                       reg, 4, &bars[i]);
> +                if ( rc )
> +                    goto fail;
> +            }
> +
>              continue;
>          }
>  
> @@ -599,34 +681,50 @@ static int cf_check init_bars(struct pci_dev *pdev)
>          bars[i].size = size;
>          bars[i].prefetchable = val & PCI_BASE_ADDRESS_MEM_PREFETCH;
>  
> -        rc = vpci_add_register(pdev->vpci, vpci_hw_read32, bar_write, reg, 4,
> -                               &bars[i]);
> +        rc = vpci_add_register(pdev->vpci,
> +                               is_hwdom ? vpci_hw_read32 : guest_bar_read,
> +                               is_hwdom ? bar_write : guest_bar_write,
> +                               reg, 4, &bars[i]);
>          if ( rc )
> -        {
> -            pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
> -            return rc;
> -        }
> +            goto fail;
>      }
>  
> -    /* Check expansion ROM. */
> -    rc = pci_size_mem_bar(pdev->sbdf, rom_reg, &addr, &size, PCI_BAR_ROM);
> -    if ( rc > 0 && size )
> +    /* Check expansion ROM: we do not handle ROM for guests. */

Is there any specific reason for not handling ROM BAR for guests?

> +    if ( is_hwdom )
>      {
> -        struct vpci_bar *rom = &header->bars[num_bars];
> +        rc = pci_size_mem_bar(pdev->sbdf, rom_reg, &addr, &size, PCI_BAR_ROM);
> +        if ( rc > 0 && size )
> +        {
> +            struct vpci_bar *rom = &header->bars[num_bars];
>  
> -        rom->type = VPCI_BAR_ROM;
> -        rom->size = size;
> -        rom->addr = addr;
> -        header->rom_enabled = pci_conf_read32(pdev->sbdf, rom_reg) &
> -                              PCI_ROM_ADDRESS_ENABLE;
> +            rom->type = VPCI_BAR_ROM;
> +            rom->size = size;
> +            rom->addr = addr;
> +            header->rom_enabled = pci_conf_read32(pdev->sbdf, rom_reg) &
> +                                  PCI_ROM_ADDRESS_ENABLE;
>  
> -        rc = vpci_add_register(pdev->vpci, vpci_hw_read32, rom_write, rom_reg,
> -                               4, rom);
> -        if ( rc )
> -            rom->type = VPCI_BAR_EMPTY;
> +            rc = vpci_add_register(pdev->vpci, vpci_hw_read32, rom_write,
> +                                   rom_reg, 4, rom);
> +            if ( rc )
> +                rom->type = VPCI_BAR_EMPTY;
> +        }
> +    }
> +    else
> +    {
> +        if ( !is_hwdom )

Extra !is_hwdown?  The condition on the outer if is already is_hwdom,
and this is the else branch.

> +        {
> +            rc = vpci_add_register(pdev->vpci, empty_bar_read, NULL,
> +                                   rom_reg, 4, &header->bars[num_bars]);
> +            if ( rc )
> +                goto fail;
> +        }
>      }
>  
>      return (cmd & PCI_COMMAND_MEMORY) ? modify_bars(pdev, cmd, false) : 0;
> +
> + fail:
> +    pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
> +    return rc;

It might have been better for the usage of the fail label to be
introduced in a pre-patch, as there would then be less changes here
(and the pre-patch would be a non-functional change).

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 16:04:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 16:04:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566698.885870 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMW8e-0001Kz-Rw; Thu, 20 Jul 2023 16:04:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566698.885870; Thu, 20 Jul 2023 16:04:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMW8e-0001Ks-P5; Thu, 20 Jul 2023 16:04:24 +0000
Received: by outflank-mailman (input) for mailman id 566698;
 Thu, 20 Jul 2023 16:04:23 +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 <SRS0=6Xo+=DG=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMW8d-0001Kh-Lm
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 16:04:23 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2047.outbound.protection.outlook.com [40.107.7.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 169b161e-2717-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 18:04:21 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAWPR04MB9934.eurprd04.prod.outlook.com (2603:10a6:102:380::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul
 2023 16:03:52 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 16:03:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 169b161e-2717-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KiUUydj2yQhUK1kBH7AM00xArgxyMsgUAqU6gV9o1slynhOiNXEQH13pLqrvOn7ee3EK81VjmHXMl7Ix534QXQb33sn7I3129eEE+bfXQnYo1bEzOVcPMfEhgmqzlg9VEVABsseJEApilh+BffYIhwNK2eh97AiK6zAxpoJjnTGqAlvIA2WMYKSA68SU3JB2gbUZsOB9Hff7oQkSs8qwZ/k3qxn4+VKyRtAThXSlV+9DxadiRB9BEZspGLW8ldLJEkkaj4Xy8LsaWMZ5UAeQIZuUU4dYjJxhtsqqrDCQ7K3oKot27+wr4DYlC4sSkFumo2jeT/+US/3ahIVvpeJk7Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=RVS9GkmxxyRXh5ZBd7SBuJ0ypvXW562UpVnNEbMpIzE=;
 b=fNPdP+Ml41lxdVnffjDmg/feNaqLWSa0Nelp8b/bDvCQwBe9NlNFSZjiHEXcG6m+HB9di/wNz3RHpPXCah2ByltdHPPfBhrHiKAeKzxyBuinYrTMwbUczYuTZv9WPHWpipwJag8IKSuEuvY0S8FmpEs66kz2mI7IMV9YKS5a9P3hg8h0exSGeeS6P8BRRwNsQztAAO1nNrcAHtCgRk2azXmmw37a4xp2rMGo3CHDBAfOHXkGhAX03UUk9GBQYdzvD3cl9zbqXuTC15TUukCkwuYIFEQuI/h9gBw997IlqYDARwuuJabb2NVpjfWgFehrXI76ZHu2zwiSZp+EsMy3fQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RVS9GkmxxyRXh5ZBd7SBuJ0ypvXW562UpVnNEbMpIzE=;
 b=eG7gtSGoqc/tmYS8WVt9qTRMPoj8SOFMcvynQAQjrxqNQDNDv6igBFt2BldgAtBwQBowha/YTIx+Ep40+ErKwAZrFWMbHj9attfp2TCBqpZMLYBIpE7CxnS+xRF8asxWnSy+NYIKMAOISJ5YhpUyMBBtCzYX12NChrL1BdnFNyOrhpG29Ri7yGjwy3hwPUJbo7m7EXiiGp/xevWFxEVUopylVvWnssDMz+bBuArMZqS1vBO1hPJOVzOva5M7MZkT9Hm4xmTsAa2BgjlAFycCZPYESmNxtNNUaAG8YrPpX1pWyYD+QWU+wZg7FkNKkK5wVkosy7h86i4t2VXHmEMdHw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e9331a8c-69b5-b803-7989-7e3b95b815e4@suse.com>
Date: Thu, 20 Jul 2023 18:03:49 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Content-Language: en-US
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0130.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:97::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAWPR04MB9934:EE_
X-MS-Office365-Filtering-Correlation-Id: d69b0776-6616-4b64-ed1e-08db893ae948
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	WaRvjfVZLUMyap4TyWnrGN8+sTln+iGBnl2ev7uAdXRfZz4to4N41IF/2JSaaZRmdwALovmu7pVwFl1VTA9yHbIsl4w445zSYmwKw3y7VzMSMjmTn4+sFkcTNvFASkE9+SS1hCdTzWCXEv/Bond+P4fY3UFQ/FlPVGUyAualCc5rhJvT8XjXiSDnQe174UiA28NU7+gig+4VrZ4uhpPzSTMsEHa/45GAQdyj2bYuQx/vW74FnCXRLppzDcnx78qlkuhIrF0nFPYU+dqYG0nNQswK1TW0cJ7H3CEOZBtwXN8ujKr/2xwIh9zTcYhztOL/IbUr7AqCL0WWcBkWVTChpJI4rESzJda4GL9ycks67K5HAwVbPhsPHwwGq+ZGngRhzCUllEIEReHo0AFxN/VncNjsaB71YQmdWsA8VPhWMxyrtwW94VabNg2T72ls2U6P+ZAN287MKlyE4yB9U8V1KbhMwHhxKfTai4Rg0qhKU981f0Xqh0JMubNzqzwncjXgROu5PXahObRHsTSgs1mNAdnZoPdJdqkuQlGTgOU1TSovmpTpgJ3mU/cITmfnjQtEORFM9OQLiP/W54h3UVlA+wD/9Q0Xz9xPlTVUDShunGCa+1rCdesoq/VVlmsdcmmnMNj5cHkDudLLcuZRssoSLQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(396003)(366004)(136003)(39860400002)(451199021)(86362001)(478600001)(83380400001)(38100700002)(186003)(41300700001)(26005)(31696002)(4744005)(31686004)(54906003)(53546011)(8676002)(6916009)(8936002)(316002)(2906002)(4326008)(36756003)(6512007)(66556008)(66946007)(6666004)(6486002)(66476007)(6506007)(2616005)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RFh4Ym1DeUJqaDFEdUdtNXNOQjEwMExLc0RiWGczM2JRVjJkejJLZ25oSzA4?=
 =?utf-8?B?S2IzUGlLM2ViTHZXZERRSDh5aWVCaDhyYVBwRVJqY3BObTRsbWhQVTBwOWhh?=
 =?utf-8?B?aEwweVdaWmpGT0xoZmNDS0w0NUgzS1ZuMDRrTmlHbFB0YXh1VWVtbnZmcklB?=
 =?utf-8?B?cjEwVUZRd1ZML2dPOW1lS2RnNGw1U09HemNaRHlJZVIvdkdjM2ZlSUUrZy9D?=
 =?utf-8?B?Qzl3OE5rSGJqcjdDbFRiOFBsSnpuL3lkTnNTM0Y0Ym8vTUZZMFQvdTFiUDRs?=
 =?utf-8?B?eGEvZGRsNHZHK2xBZlVURytUS2VsOXJiQ1B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J1VFBXYXFoN3FETUxROWs3UHd0QUY2dkV2b1VxczdCdHVVemxBaEkz?=
 =?utf-8?Q?ArVDdHTeB4Mfk9+bT8yIu1WHC?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d69b0776-6616-4b64-ed1e-08db893ae948
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 16:03:51.9448
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: TAnyRlvMoZJ055mSpq7Cc1fTmxAZH+b6qRG/l2yTklqxFNncmYK7C0gvEAXra6Jzrb0VcM9z0M8e8FLBtBhSuQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9934

On 20.07.2023 02:32, Volodymyr Babchuk wrote:
> --- a/xen/drivers/vpci/msi.c
> +++ b/xen/drivers/vpci/msi.c
> @@ -190,6 +190,8 @@ static int cf_check init_msi(struct pci_dev *pdev)
>      uint16_t control;
>      int ret;
>  
> +    ASSERT(rw_is_write_locked(&pdev->domain->pci_lock));

I'm afraid I have to ask the opposite question, compared to Roger's:
Why do you need the lock held for write here (and in init_msix())?
Neither list of devices nor the pdev->vpci pointer are being altered.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 16:09:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 16:09:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566702.885884 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMWDP-0002Nk-Gu; Thu, 20 Jul 2023 16:09:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566702.885884; Thu, 20 Jul 2023 16:09:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMWDP-0002Nd-Cy; Thu, 20 Jul 2023 16:09:19 +0000
Received: by outflank-mailman (input) for mailman id 566702;
 Thu, 20 Jul 2023 16:09:17 +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 <SRS0=6Xo+=DG=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMWDN-0002NV-On
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 16:09:17 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0614.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::614])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c58f2985-2717-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 18:09:15 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS4PR04MB9241.eurprd04.prod.outlook.com (2603:10a6:20b:4e0::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Thu, 20 Jul
 2023 16:09:12 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 16:09:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c58f2985-2717-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=PKGsOscJJO95T2SKW5ZLi+JrwStTfVDoFzQ6NG9xNw8+Zqn0LdkfP99U+VwRzQsb/AfNTGQqN2dVbSdy/f2oOBYpuYIo8r6tBT3WAD2PIFW4ZcyU5ji4+3jacHyWTS2f1ILwu3GosU2Q/SoXT32ewz4DAkfWo2ChoDIREAnwUl1+bbhH4ZTEXvD6DlcCl1aeJ51ODEa2jFxvO7p34i6JaLetRuG57AzwppUtGdhFj8Ja6u9NsGGh5MgwwykNf2pXrKEYW/7pzpyj6N7JLCCiUK4CpshXu3Bx7R88yiGzJBIx4ckIwFt4mhuTt8Ej2S+Zi2xZoYjrz9z6Chxvu4ltcg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=REC0gPTAmLm90VzImgSgtbRmFJQgH+0+SI5Iy9RMQRc=;
 b=bJXsMTSY8S3js8WvFAFqZaMQqFCBo9T53Yo87Czc+e0fYvT/+DvCYBWYaST7MHmpU6IycUoI3RxoQ75YApYfnSWpp3gLETa8uYK2vzrkglWRDI5T5185JiHfCg1cqdw/4RzCGcvOiYHLxZS2+o7UHgxvp1csSMmfKm0JEJJGN/rjyERMyv9khQM89pkO6uYXzHXHt5J04x8/qi3KVJrfm6iQMEnCFTep/KreJ4PUS9CMF+QEDUa1DK6pXgTQYgx6PzqrcgQpQCeME9C+eiE9LMogmZ+yfMdUa55w4pG5WKlbccxiioDqXcaWJcMNpGe6dJsZ2Fx9Qj1EZ1DBZBaHiw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=REC0gPTAmLm90VzImgSgtbRmFJQgH+0+SI5Iy9RMQRc=;
 b=Khmueld03rXwY3t1ZdSgqP3RP9MXXQfn/ch202TK3dYf7zk/jt+6WCQlvkhJxIYhjIdv9FJSrVDniwqd7EXQGm9vhz5h7gYjWekhTN+9+ks0eCDyst/BX58ebPWUaCGHeiBB1aKpZwyCAgkTcwvzMwkdJUZKqzZy7ch6oRp06pznDR20Qx1tXQrTY9gx0V4PSNzKo73LiTW0BkRfhV+6RmQM4BLzAhMuc8xKNBkUC42nUPPImfjfs9T/nEbaTpM7brJUrbFPlfon976QGRbfL4GMWtiqadLoSr1y0diPN1/+d6VqI4weVfHsj2GqDlF9zGImH695M99lYtUuj5gufg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <77cdee40-5284-bb40-c29a-54cfcb34af25@suse.com>
Date: Thu, 20 Jul 2023 18:09:09 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Content-Language: en-US
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0200.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a5::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS4PR04MB9241:EE_
X-MS-Office365-Filtering-Correlation-Id: 0e50024b-4df3-4fbc-901e-08db893ba7fe
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	ggwnbbANBfKMXMgub8stbfF6wCKYtQl3JGagomNDnhCPWJaDFhGqylrLJZhK2y2aO84Np1K7NUhU2jsN4bAOgif73BGW8e8GRhCFgY47vhrdz3Sqcr3ZrqjMSVs89QHU0v6J7Eip2sSkRnqWpPRBKTTSNqHlqGOjmmwCfbMa1oOR5R6kRUhVE9g8eP57QCNgpbQ8pPe291M43Kf6YMkLvya9Uw8VjmhT03exSx+l9AriNjQEJY5gJJRSXCFjXSLGp2phiLrAlYPwImgAaFKB5UbTOwTXk5UaEBcZQn/4FlMGbCeU+KJO7VXjwSshHDfzm1FUfJn6MGoMqLqY0sCbWzQnBL1RxBZtD/Za3v2/0IbNtUlRoq4igOeN+zcC6XCNgOZlpApP8YSufEK/Xoglcw1rWzG6CpO/OVzUksBOdLG3y3PwYEmmrzhUxx5WKjMLicLnXcE45M4HK0TeMjkxaC3sQw4IWBEZiNmPB9cyoYk21bixN8n6WxFBeKycu+cUxyGgtg+FwnmO1KFyzPcls+d5Zp6rD4kdYzuMTiSZNx0AQsLN0lviYnFcsfOdVpniDozj8ZvFUi4rO9/GU6QMuO+TMjmymoOn2ayboeh5+XtGNu75baQ7QqBvmaGikIYTrKUHRXBG1gOfHGDwxq6cdA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(396003)(346002)(366004)(39860400002)(136003)(451199021)(2906002)(86362001)(186003)(6506007)(31696002)(26005)(53546011)(83380400001)(2616005)(38100700002)(6512007)(6486002)(54906003)(6916009)(4326008)(316002)(36756003)(66476007)(5660300002)(41300700001)(66556008)(31686004)(478600001)(8676002)(66946007)(8936002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?V2J1SWNya09JSWd6KzRFcWt2Und6dUI5THVqUDBTdUxNNkd6aWI2UHJrak1U?=
 =?utf-8?B?cUJUeFRETHF4aC9OSk04SjVCUGVvWTlXb0ZXQndiamFHeXIzNEZtTVVNdWI0?=
 =?utf-8?B?NG8xN1Fpb3ptV0xGb05RZzhmcTByY3JCSFBwR3FBNklGbFRXNlVWdHdPWk1j?=
 =?utf-8?B?cFAvb1F1Mlp2SHB5TzU1dVJMbHRteXlvbTlCam9YTnE0VHNoMzdjRER2V29m?=
 =?utf-8?B?UmlqVmV0YW43cDhZTUxvVy9hZ1YyOVdvVWpES0tncnpqV2t4aVRueWowSnp0?=
 =?utf-8?B?R2NJUzdHOUtzRXcxYllhbnJBS0JiR1p1V3YwcThWaG9maTdvd3lRN0Fpbisw?=
 =?utf-8?B?c3p4ODR2VTcwczh0MW9KK1Fr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4ezQ6bP6X0THc?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0e50024b-4df3-4fbc-901e-08db893ba7fe
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 16:09:11.8541
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: TxEpPH2I9BqHGOdr6WB2EiA33RgD3jyRg0+HxHMMhNxkYl3g8YGcvgvFbNlUT0D5H1WlxssT0jjtPIXuFVA87A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9241

On 20.07.2023 02:32, Volodymyr Babchuk wrote:
> @@ -431,10 +447,23 @@ static void vpci_write_helper(const struct pci_dev *pdev,
>               r->private);
>  }
>  
> +/* Helper function to unlock locks taken by vpci_write in proper order */
> +static void unlock_locks(struct domain *d)
> +{
> +    ASSERT(rw_is_locked(&d->pci_lock));
> +
> +    if ( is_hardware_domain(d) )
> +    {
> +        ASSERT(rw_is_locked(&d->pci_lock));

Copy-and-past mistake? You've asserted this same condition already above.

> +        read_unlock(&dom_xen->pci_lock);
> +    }
> +    read_unlock(&d->pci_lock);
> +}
> +
>  void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
>                  uint32_t data)
>  {
> -    const struct domain *d = current->domain;
> +    struct domain *d = current->domain;
>      const struct pci_dev *pdev;
>      const struct vpci_register *r;
>      unsigned int data_offset = 0;
> @@ -447,8 +476,16 @@ void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
>  
>      /*
>       * Find the PCI dev matching the address, which for hwdom also requires
> -     * consulting DomXEN.  Passthrough everything that's not trapped.
> +     * consulting DomXEN. Passthrough everything that's not trapped.
> +     * If this is hwdom, we need to hold locks for both domain in case if
> +     * modify_bars is called()
>       */
> +    read_lock(&d->pci_lock);
> +
> +    /* dom_xen->pci_lock always should be taken second to prevent deadlock */
> +    if ( is_hardware_domain(d) )
> +        read_lock(&dom_xen->pci_lock);

But I wonder anyway - can we perhaps get away without acquiring dom_xen's
lock here? Its list isn't altered anymore post-boot, iirc.

> @@ -498,6 +537,7 @@ void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
>          ASSERT(data_offset < size);
>      }
>      spin_unlock(&pdev->vpci->lock);
> +    unlock_locks(d);

In this context the question arises whether the function wouldn't better
be named more specific to its purpose: It's obvious here that it doesn't
unlock all the locks involved.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 16:14:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 16:14:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566707.885894 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMWIR-0003pl-2L; Thu, 20 Jul 2023 16:14:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566707.885894; Thu, 20 Jul 2023 16:14:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMWIQ-0003pe-VJ; Thu, 20 Jul 2023 16:14:30 +0000
Received: by outflank-mailman (input) for mailman id 566707;
 Thu, 20 Jul 2023 16:14:29 +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
 <SRS0=/JYs=DG=citrix.com=prvs=558be806a=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMWIP-0003pY-AE
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 16:14:29 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7e3494a6-2718-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 18:14:26 +0200 (CEST)
Received: from mail-mw2nam12lp2042.outbound.protection.outlook.com (HELO
 NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.42])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 20 Jul 2023 12:14:18 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by MN2PR03MB5006.namprd03.prod.outlook.com (2603:10b6:208:1a4::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Thu, 20 Jul
 2023 16:14:16 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Thu, 20 Jul 2023
 16:14:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7e3494a6-2718-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689869666;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=4c+AGg5lgNWFFMOoxEg4tuEpINgWlOvjczJfPLBLvFI=;
  b=cyxVrld7CPJRuAAl0a2+Fp2rWS1a4cvKxNI8wYZySgYjja7j1OW2rNlR
   rKYQ2U88/0nM4QXWL5DrDqDZkOP+O+UkaVtpu4vo2mVvv+Bzc13W7XME4
   aOIJHkJgeWbzQOjfUVv+yihrbKtJJKmXMGAQhLInZfQ3H+zgKAWW36Jr6
   g=;
X-IronPort-RemoteIP: 104.47.66.42
X-IronPort-MID: 116184633
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:zbxjVq/jWdWsOweIN1VkDrUDUX+TJUtcMsCJ2f8bNWPcYEJGY0x3m
 zceXj3UbP+LN2Khf9BzPYvl8BxTsZOGzdc3T1A//Cw8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s
 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk
 d7pqojUNUTNNwRcawr40Ird7ks21BjOkGlA5AdmOqoT5AW2e0Q9V/rzG4ngdxMUfaEMdgKKb
 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk
 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDkl+1
 KAfNTkyfyyGuNic/ZaybsZtqMA8eZyD0IM34hmMzBn/JNN/G9XmfP+P4tVVmjAtmspJAPDSI
 dIDbiZiZwjBZBsJPUoLDJU5n6GjgXyXnz9w8QrJ4/ZopTaNilAruFTuGIO9ltiiX8Jak1zev
 mvb12/4HgsbJJqUzj/tHneE37aRxHOnBtlJfFG+3q5k22CNgWg3NEdIRECBrsvmyXWSS80Kf
 iT4/QJr98De7neDTNPwQhm5q36spQMHVpxbFOhSwD+Kzq3Y8gOIHF8uRzRKaMElnMIuTDls3
 ViM9/vOATFsq7STRWiq37GYty6pOSMVIGkBYgcJVQIApdLkpekbnh/JC9puDqOxptn0Ai3rh
 SCHqjAkgLcehtJN0L+0lW0rmBqpr5nNCwsqvAPeWzv/6hsjPNL/IYu19VLc8PBMap6DSUWMt
 2QFnM7Y6/0SCZaKl2qGR+Bl8KyV2stp+Qb02TZHd6TNPRz3k5J/Vei8OA1DGXo=
IronPort-HdrOrdr: A9a23:YjbMPalD6ovpPABiwy/5a+GZVQjpDfLo3DAbv31ZSRFFG/Fw9/
 rCoB17726QtN91YhsdcL+7V5VoLUmzyXcX2/hyAV7BZmnbUQKTRekP0WKL+Vbd8kbFh41gPM
 lbEpSXCLfLfCJHZcSR2njELz73quP3jJxBho3lvghQpRkBUdAF0+/gYDzranGfQmN9dP0EPa
 vZ3OVrjRy6d08aa8yqb0N1JNQq97Xw5fTbiQdtPW9f1DWz
X-Talos-CUID: =?us-ascii?q?9a23=3AT04fjmseuZSrK5mrRyvAgZVQ6IsVUyHa0X7vMnO?=
 =?us-ascii?q?9NlxDdZmcbXCR1qd7xp8=3D?=
X-Talos-MUID: =?us-ascii?q?9a23=3AvqxZsQ424//3kgGy4O07Ijnuxow47f+TFgcJtal?=
 =?us-ascii?q?c5difDyNCZHSmoCSoF9o=3D?=
X-IronPort-AV: E=Sophos;i="6.01,219,1684814400"; 
   d="scan'208";a="116184633"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=YgDr00UbT3RrAUGa+2nLhl5CKM1H8jwo4bb++ZGscQjGUVPmbv6sJAFY5RVPXbfCq3ChDCMop7teQ4iFB/yo5SYwWo+cSDdwDInR59XPiyeXTIrLK/tRaPd4BLQTPwTnTc0KE2ryUc7YFAIY9tpffOxSPuEpFQGXuh0RjbK3z4x7LaIHtgyCUtwnOcVtvi4yn+a3EQ5Zv/LWRsM7YRw4pHQjYTEO0pdLmTD1i3ggopG4Luex1btjc9sNf8yTCAslWu5/cAPd49sTY4tdNpkOZltxJMe91+/YCPFKoME+F3xj66q9TuDe2ZZsIQlsfCDmQGhXhZ3tNfMcgRoEznknhQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=S5XqeSpoSMiHGxJV+Hfwi6aytvUycZVxS45ve2ddLmY=;
 b=LskurM+gdbwEM6FO557nLfVU3ilBOg4sqcP2ms1LJ93jLTGyq0E3KFYkx690WFc9FvzXEy3FzHnuwDRjN6GflC3eIFVg5jPaBpJbdzIulAXqPuYxlvqqC+eUnLMSOYwP6C0cA8JWTSPRuq2XGekb8Ht55GV5xgsA0gAM5u0mMhPpDa7mdC9yObH84JkUrIMrGq8h6SrWI+TeAmhkDZKUkux3m1kVvFgpoyqUi5kWZZIoEd8j8neQ14uiTAu0AmrTmkjevEtPUltQHcaZ68Eeg9DVVQ+R9ulEylJyWTlJZ/bT8IDe11zhfH8SJgtBi3g8ifu49DcSE/AEyYzSoJ0x9w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=S5XqeSpoSMiHGxJV+Hfwi6aytvUycZVxS45ve2ddLmY=;
 b=aDAB5BikmX1zY+VPXXf3P5v/9LMs27akLhroHVFf7C2aRkt9gHXnD6YRye0HSwnh9CwiwlTBxgIMVRBZodjZe46eZirFZcVh1R0VNULu2irHxMQSYzSnItVQbExKncTdzLvlLbvYWp/7cpNo0Jo2eyMPidmIo4n+KkdoFMlHoM0=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Thu, 20 Jul 2023 18:14:11 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Message-ID: <ZLldU9ZNM5BRXqeY@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <e9331a8c-69b5-b803-7989-7e3b95b815e4@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <e9331a8c-69b5-b803-7989-7e3b95b815e4@suse.com>
X-ClientProxiedBy: LO4P123CA0129.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:193::8) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|MN2PR03MB5006:EE_
X-MS-Office365-Filtering-Correlation-Id: 0a8e313f-f647-4126-9ab6-08db893c5d26
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	CAD5w7NVFVyNF+xHY6+pHzgyL2KYcxAlCxjeeWNHVI8LfYz5sI+Da1vEDA+H0wqT5pf0gxB2ysUjBIX1h99LgPPGq6KjogBS39JZdWKgOap4ZJnBYGaLyK0XaKeWRu9zUvdPceqaPrm1tPQ93+2sGvndrSkMFcuP4XCz6zKwr5sksobc2776jblPlWJ6CCPSJpOV8DBAxHd2q4ppQsvLZJPgYldFbkvTdpqFbPSW2BL1svUum5rbeayzFRgdj5YscY6nB4RGpvka7GC2KHh72t9tApkMM03MspcVujJnOZl0YmP/xNwV+cGf6VTfBGd2BWzHEYZTXvBRniMBgws0OGMETxSwofgpP0vS+TGvBnkf6mptrsCuO3xIZ1b+7cctWMKWmqRa0z42OXtau59q29TgJnpxQGggf9KKBRf1NwOQDIS/priAtGiDbuToFi5BmUWIPDC/730EzaJpU4cfUudEQKJF5k8anADc4NTpkEkBSz9AKRo4BQ9DWkQgA9aWeP8qbaOHYBr07yJ2EfN1nH1kdwqGPG2AvaKwq4N7mYfH9T6mj0f7BlmGXkYsgXbt
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(376002)(396003)(136003)(366004)(451199021)(2906002)(4744005)(54906003)(478600001)(41300700001)(8936002)(8676002)(5660300002)(66556008)(66476007)(66946007)(4326008)(6916009)(316002)(82960400001)(85182001)(86362001)(26005)(186003)(6506007)(53546011)(9686003)(6486002)(83380400001)(6512007)(38100700002)(6666004);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZzNHZDg0a0F3SEpnenkyc3g5WWwybGMyVjJ5VG5rcmFtYnoxbzVtajcxM3RO?=
 =?utf-8?B?T01JQWh1U2djUW4rTUp4MFFmUCs5bmFwT0Z3cjhGZVVybUZPZ294R2lqYXR1?=
 =?utf-8?B?T1ZKOXFWUk9ZZXp1L1hrVUdCQzI4RHl3eDQ5RXNYbWpu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D6KsMFlRO6G2ZXvKwkcE+NGpLGBsUh/tJYod4xwCJc4sWd7GltGPRhUwlZZCBtvuUfbndxNGryLTvO0tpcrE0sjrdJqwJ5VhmBGSeCdAJkEz8PEHKT3UJCDqbFc8FdvAWvRwKmyos7S6+k++R+2+sGO6DHMZ729z7av7wBIuYVo+OFq+aZ/0ETuPT2VYtFMjGwlP14WX1Czu9Ts78QUg==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0a8e313f-f647-4126-9ab6-08db893c5d26
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 16:14:15.7758
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: B1etd7+qx8lKXJtBYpSuTFXLbcW8XktrmXBbmsXjVsxRrh1HQJVLtLZy5fDKodCOd/fCa/HNICGi7hQGczu0dA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR03MB5006

On Thu, Jul 20, 2023 at 06:03:49PM +0200, Jan Beulich wrote:
> On 20.07.2023 02:32, Volodymyr Babchuk wrote:
> > --- a/xen/drivers/vpci/msi.c
> > +++ b/xen/drivers/vpci/msi.c
> > @@ -190,6 +190,8 @@ static int cf_check init_msi(struct pci_dev *pdev)
> >      uint16_t control;
> >      int ret;
> >  
> > +    ASSERT(rw_is_write_locked(&pdev->domain->pci_lock));
> 
> I'm afraid I have to ask the opposite question, compared to Roger's:
> Why do you need the lock held for write here (and in init_msix())?
> Neither list of devices nor the pdev->vpci pointer are being
> altered.

This is called from vpci_add_handlers() which will acquire (or
requires being called) with the lock in write mode in order to set
pdev->vpci I would assume.  Strictly speaking however the init
handlers don't require the lock in write mode unless we use such
locking to get exclusive access to all the devices assigned to the
domain BARs array for modify_bars().

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 19:56:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 19:56:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566714.885909 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMZke-0000Un-Ac; Thu, 20 Jul 2023 19:55:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566714.885909; Thu, 20 Jul 2023 19:55:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMZke-0000Ug-7x; Thu, 20 Jul 2023 19:55:52 +0000
Received: by outflank-mailman (input) for mailman id 566714;
 Thu, 20 Jul 2023 19:55:51 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMZkd-0000UW-0R; Thu, 20 Jul 2023 19:55:51 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMZkc-0006V5-O8; Thu, 20 Jul 2023 19:55:50 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMZkc-0007jp-6g; Thu, 20 Jul 2023 19:55:50 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMZkc-0005ui-6H; Thu, 20 Jul 2023 19:55:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=nixmUz/u7/QN2gyIf3oCQiqtV3Ko2WbUgN93t+DZPt4=; b=NoIrRHEIQKwqaB5iG6fwgxr9ll
	pATQo82J/eB6eSb/LBYaftTXfIZ4N0v9ohXCZe3ri/4MafnqYniN/9iYR2WsMr2OMUV4jrJlPqPBB
	fcFo4JE+QdOSpVjTYBEUYWObp3G6oF/k6ckjJ2pDuWKcLov8sWubar9IO9rt+THMKlis=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181913-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181913: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-multivcpu:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=bfa3037d828050896ae52f6467b6ca2489ae6fb1
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 20 Jul 2023 19:55:50 +0000

flight 181913 linux-linus real [real]
flight 181930 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181913/
http://logs.test-lab.xenproject.org/osstest/logs/181930/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-win7-amd64  8 xen-boot    fail pass in 181930-retest
 test-amd64-amd64-xl-multivcpu 20 guest-localmigrate/x10 fail pass in 181930-retest
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 18 guest-localmigrate/x10 fail pass in 181930-retest
 test-amd64-amd64-xl-qemut-debianhvm-amd64 18 guest-localmigrate/x10 fail pass in 181930-retest

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop  fail in 181930 like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                bfa3037d828050896ae52f6467b6ca2489ae6fb1
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   95 days
Failing since        180281  2023-04-17 06:24:36 Z   94 days  181 attempts
Testing same since   181913  2023-07-19 21:15:31 Z    0 days    1 attempts

------------------------------------------------------------
3787 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 632105 lines long.)


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 20:06:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 20:06:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566719.885919 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMZuR-0002UK-8l; Thu, 20 Jul 2023 20:05:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566719.885919; Thu, 20 Jul 2023 20:05:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMZuR-0002UD-6A; Thu, 20 Jul 2023 20:05:59 +0000
Received: by outflank-mailman (input) for mailman id 566719;
 Thu, 20 Jul 2023 20:05:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMZuP-0002U5-Vb
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 20:05:58 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMZuP-0006ls-9d; Thu, 20 Jul 2023 20:05:57 +0000
Received: from 54-240-197-231.amazon.com ([54.240.197.231]
 helo=[192.168.24.131]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMZuP-0004GX-2C; Thu, 20 Jul 2023 20:05:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=UYGuI15Lya02fnmoYf9gYL6zksmKOkbyLzT8PTEDDC8=; b=l/XJypQmc1PS7MFiAyBE1k3caY
	ez1yET+zkBF6xq1C4lxbgpNaHSq5hhEUMyIm0wFKVgHMgW9QO1k3lfQ3nkE65BFZFR56PKb+LgIi3
	CNmwdGKMYZ3dS0bw8mBZkJx95kZ7a+qVJOmK/jwT5JpEV9BOb8e/vEA0pCga8asdKlcE=;
Message-ID: <437849e6-08a3-8fac-a594-2003d5b94b41@xen.org>
Date: Thu, 20 Jul 2023 21:05:55 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH 2/8] arm/mm: Document the differences between arm32 and
 arm64 directmaps
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-3-alejandro.vallejo@cloud.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230717160318.2113-3-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Alejandro,

On 17/07/2023 17:03, Alejandro Vallejo wrote:
> arm32 merely covers the XENHEAP, whereas arm64 currently covers anything in
> the frame table. These comments highlight why arm32 doesn't need to account for PDX
> compression in its __va() implementation while arm64 does.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> ---
>   xen/arch/arm/include/asm/mm.h | 27 +++++++++++++++++++++++++++
>   1 file changed, 27 insertions(+)
> 
> diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
> index 4262165ce2..1a83f41879 100644
> --- a/xen/arch/arm/include/asm/mm.h
> +++ b/xen/arch/arm/include/asm/mm.h
> @@ -280,6 +280,19 @@ static inline paddr_t __virt_to_maddr(vaddr_t va)
>   #define virt_to_maddr(va)   __virt_to_maddr((vaddr_t)(va))
>   
>   #ifdef CONFIG_ARM_32
> +/**
> + * Find the virtual address corresponding to a machine address
> + *
> + * Only memory backing the XENHEAP has a corresponding virtual address to
> + * be found. This is so we can save precious virtual space, as it's in
> + * short supply on arm32. This mapping is not subject to PDX compression
> + * because XENHEAP is known to be physically contiguous and can't hence
> + * jump over the PDX hole. This means we can avoid the roundtrips
> + * converting to/from pdx.
> + *
> + * @param ma Machine address
> + * @return Virtual address mapped to `ma`
> + */
>   static inline void *maddr_to_virt(paddr_t ma)
>   {
>       ASSERT(is_xen_heap_mfn(maddr_to_mfn(ma)));
> @@ -287,6 +300,20 @@ static inline void *maddr_to_virt(paddr_t ma)
>       return (void *)(unsigned long) ma + XENHEAP_VIRT_START;
>   }
>   #else
> +/**
> + * Find the virtual address corresponding to a machine address
> + *
> + * The directmap covers all conventional memory accesible by the
> + * hypervisor. This means it's subject to PDX compression.
> + *
> + * More specifically to arm64, the directmap mappings start at the first
> + * GiB boundary containing valid RAM. This means there's an extra offset
> + * applied (directmap_base_pdx) on top of the regular PDX compression
> + * logic.

I find this paragraph a bit confusing to read because it leads to think 
that pdx_to_maddr(directmap_base_pdx) will return a GiB aligned address.

The base PDX corresponds to the start of the first region and the only 
requirement is it should be page-aligned. However, when mapping in the 
virtual address space we also offset the start to ensure that superpage 
can be used (this is where the GiB alignment is used).

That's why XENHEAP_VIRT_START points to directmap_virt_start rather than 
DIRECTMAP_VIRT_START. I think it would make sense to have the logic 
following what you suggest as it would remove a memory read. But I would 
understand if you don't want to take that extra work. :)

So for now, I would suggest to remove "GiB boundary containing".

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 20:26:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 20:26:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566726.885946 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMaE8-0005yO-14; Thu, 20 Jul 2023 20:26:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566726.885946; Thu, 20 Jul 2023 20:26:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMaE7-0005yH-Ub; Thu, 20 Jul 2023 20:26:19 +0000
Received: by outflank-mailman (input) for mailman id 566726;
 Thu, 20 Jul 2023 20:26:18 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMaE6-0005y5-Gv; Thu, 20 Jul 2023 20:26:18 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMaE6-0007IK-FO; Thu, 20 Jul 2023 20:26:18 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMaE6-00007M-0J; Thu, 20 Jul 2023 20:26:18 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMaE5-0007oD-W3; Thu, 20 Jul 2023 20:26:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=7/vOjUAeHEIQZ26sgQA+y0vGP7+ht4eZz3gjfTMLDrU=; b=Cx2lTUR9do1Tw1I9JbeQOY7cqa
	K1Csjs6qkKF2T5dD5r1LBcpnmIkmUzFDctuh+ibSwCMBATzOpS2xkB1irv2w7eaE58JdHig6C0lqN
	2YMaKfUUrmzIRf0cW49mACzJqTUDv7HT/0iLrE2tHpUznVbPWrDtsWELmL+s3B20V7IE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181914-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-upstream-4.17-testing test] 181914: tolerable FAIL - PUSHED
X-Osstest-Failures:
    qemu-upstream-4.17-testing:test-amd64-i386-qemuu-rhel6hvm-amd:redhat-install:fail:heisenbug
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt:guest-start/debian.repeat:fail:heisenbug
    qemu-upstream-4.17-testing:test-amd64-i386-xl-vhd:guest-start.2:fail:heisenbug
    qemu-upstream-4.17-testing:test-amd64-i386-xl-vhd:xen-install:fail:heisenbug
    qemu-upstream-4.17-testing:test-amd64-i386-pair:xen-install/src_host:fail:heisenbug
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-raw:guest-start:fail:heisenbug
    qemu-upstream-4.17-testing:test-amd64-i386-qemuu-rhel6hvm-amd:xen-install:fail:heisenbug
    qemu-upstream-4.17-testing:test-amd64-i386-xl-qemuu-ws16-amd64:xen-install:fail:heisenbug
    qemu-upstream-4.17-testing:test-amd64-i386-freebsd10-amd64:xen-install:fail:heisenbug
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-vhd:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-raw:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-qcow2:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-rtds:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit1:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-multivcpu:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit2:hosts-allocate:starved:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-arndale:hosts-allocate:starved:nonblocking
X-Osstest-Versions-This:
    qemuu=eeaede60ffb1760c06850cae562d104e4f98c859
X-Osstest-Versions-That:
    qemuu=b746458e1ce1bec85e58b458386f8b7a0bedfaa6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 20 Jul 2023 20:26:17 +0000

flight 181914 qemu-upstream-4.17-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181914/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-qemuu-rhel6hvm-amd 12 redhat-install fail in 181865 pass in 181889
 test-amd64-i386-libvirt 20 guest-start/debian.repeat fail in 181865 pass in 181914
 test-amd64-i386-xl-vhd       22 guest-start.2    fail in 181865 pass in 181914
 test-amd64-i386-xl-vhd        7 xen-install      fail in 181889 pass in 181914
 test-amd64-i386-pair     10 xen-install/src_host fail in 181889 pass in 181914
 test-armhf-armhf-libvirt-raw 13 guest-start                fail pass in 181865
 test-amd64-i386-qemuu-rhel6hvm-amd  7 xen-install          fail pass in 181889
 test-amd64-i386-xl-qemuu-ws16-amd64  7 xen-install         fail pass in 181889
 test-amd64-i386-freebsd10-amd64  7 xen-install             fail pass in 181889

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail in 181865 like 175008
 test-armhf-armhf-libvirt-raw 14 migrate-support-check fail in 181865 never pass
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop   fail in 181889 like 175008
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 175008
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 175008
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 175008
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 175008
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 175008
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 175008
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt      3 hosts-allocate           starved in 181889 n/a
 test-armhf-armhf-xl-vhd       3 hosts-allocate           starved in 181889 n/a
 test-armhf-armhf-libvirt-raw  3 hosts-allocate           starved in 181889 n/a
 test-armhf-armhf-libvirt-qcow2  3 hosts-allocate         starved in 181889 n/a
 test-armhf-armhf-xl-rtds      3 hosts-allocate           starved in 181889 n/a
 test-armhf-armhf-xl-credit1   3 hosts-allocate           starved in 181889 n/a
 test-armhf-armhf-xl           3 hosts-allocate           starved in 181889 n/a
 test-armhf-armhf-xl-multivcpu  3 hosts-allocate          starved in 181889 n/a
 test-armhf-armhf-xl-credit2   3 hosts-allocate           starved in 181889 n/a
 test-armhf-armhf-xl-arndale   3 hosts-allocate           starved in 181889 n/a

version targeted for testing:
 qemuu                eeaede60ffb1760c06850cae562d104e4f98c859
baseline version:
 qemuu                b746458e1ce1bec85e58b458386f8b7a0bedfaa6

Last test of basis   175008  2022-12-01 11:10:52 Z  231 days
Testing same since   181841  2023-07-17 11:41:16 Z    3 days    4 attempts

------------------------------------------------------------
People who touched revisions under test:
  Haochen Tong <i@hexchain.org>
  Jason Wang <jasowang@redhat.com>
  Miroslav Rezanina <mrezanin@redhat.com>
  Thomas Huth <thuth@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              fail    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/qemu-xen.git
   b746458e1c..eeaede60ff  eeaede60ffb1760c06850cae562d104e4f98c859 -> stable-4.17


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 21:02:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 21:02:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566732.885956 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMamd-0003Yr-Ps; Thu, 20 Jul 2023 21:01:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566732.885956; Thu, 20 Jul 2023 21:01:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMamd-0003Yk-Mv; Thu, 20 Jul 2023 21:01:59 +0000
Received: by outflank-mailman (input) for mailman id 566732;
 Thu, 20 Jul 2023 21:01:58 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=5Zrf=DG=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qMamc-0003Ye-Br
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 21:01:58 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a5c4be25-2740-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 23:01:54 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 1A6A4828592D;
 Thu, 20 Jul 2023 16:01:50 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id 4K1Mqb2OoRIc; Thu, 20 Jul 2023 16:01:49 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 6E7E5828591A;
 Thu, 20 Jul 2023 16:01:49 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id zOPcqLNKvelT; Thu, 20 Jul 2023 16:01:49 -0500 (CDT)
Received: from [10.11.0.2] (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 104978285360;
 Thu, 20 Jul 2023 16:01:49 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a5c4be25-2740-11ee-b23a-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 6E7E5828591A
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1689886909; bh=BBXupLHE7ezMphtTIJAT0V4n6GT9GziempBUvQ+opOE=;
	h=Message-ID:Date:MIME-Version:To:From;
	b=exeLL5D/PggcyI9Yxv7T8m2ou0+zTPIwoJfqJkSXcc9BhMJZ3NoltC4QOpelsQdlz
	 hAZy45eTpHnB19MlF3OgBt0F9+Lgi9fH736Em2wAYdFFaiG/1kdpZpN3iDOj3qPYb3
	 Ee8GHBGXxDzmG4OyoX+yWc4I7O4cGDW3EG3HOEHY=
X-Virus-Scanned: amavisd-new at rptsys.com
Message-ID: <596297da-a335-6463-a9db-982f649f7183@raptorengineering.com>
Date: Thu, 20 Jul 2023 16:01:48 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v4 3/4] xen/ppc: Implement early serial printk on pseries
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1689710519.git.sanastasio@raptorengineering.com>
 <7c416ff843ea359bb24b8c954cc079fe1bbaf75f.1689710519.git.sanastasio@raptorengineering.com>
 <6d3b7cd6-7d6a-8d28-f1e7-7e939e393445@suse.com>
From: Shawn Anastasio <sanastasio@raptorengineering.com>
In-Reply-To: <6d3b7cd6-7d6a-8d28-f1e7-7e939e393445@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 7/19/23 9:05 AM, Jan Beulich wrote:
> Before you/we grow more assembly code, may I re-raise a request regarding
> readability: I think it would be nice if operands started at a fixed column,
> unless the insn mnemonic is unusually long. Where exactly to draw the line
> is up to each archtecture; on x86 we use 8 positions from the start of the
> mnemonic.

There is quite a large variance in mnemonic length on ppc -- many common
mnemonics only use 2 characters (e.g. ld, mr) while other common ones
use 6+ (e.g. rldicr, the mtspr family, etc.). Enforcing a column size
that's too short would make the longer mnemonics look misaligned and out
of place, but using a longer column length (like 8) that can accommodate
most common mnemonics adds too much space between short mnemonics and
their arguments.

That said if you still feel strongly about this then I am not strongly
opposed to adding an 8-space column alignment.

> Jan

Thanks,
Shawn


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 21:22:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 21:22:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566735.885966 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMb64-0006lk-7B; Thu, 20 Jul 2023 21:22:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566735.885966; Thu, 20 Jul 2023 21:22:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMb64-0006ld-45; Thu, 20 Jul 2023 21:22:04 +0000
Received: by outflank-mailman (input) for mailman id 566735;
 Thu, 20 Jul 2023 21:22:03 +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
 <SRS0=ODwM=DG=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qMb63-0006lX-68
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 21:22:03 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 75845f2f-2743-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 23:21:58 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.99.255])
 by support.bugseng.com (Postfix) with ESMTPSA id 72C1E4EE0C89;
 Thu, 20 Jul 2023 23:21:57 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 75845f2f-2743-11ee-8611-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [XEN PATCH] automation: add ECLAIR pipeline
Date: Thu, 20 Jul 2023 23:20:29 +0200
Message-Id: <eb5fa852f306790160b967787592553d2fdf3de6.1689887842.git.simone.ballarin@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add two pipelines that analyze an ARM64 and a X86_64 build with the
ECLAIR static analyzer on the guidelines contained in Set1.

The tool configuration is kept external to the xen repository for
practical reasons, it will be included in a subsequent phase.

All commits on the xen-project/xen:staging branch will be analyzed
and their artifacts will be stored indefinitely; the integration will
report differential information with respect to the previous analysis.

All commits on other branches or repositories will be analyzed and
only the last ten artifacts will be kept; the integration will report
differential information with respect to the analysis done on the common
ancestor with xen-project/xen:staging (if available).

Currently the pipeline variable ENABLE_ECLAIR_BOT is set to "n".
Doing so disables the generation of comments with the analysis summary
on the commit threads. The variable can be set to "y" if the a masked
variable named ECLAIRIT_TOKEN is set with the impersonation token of
an account with enough privileges to write on all repositories.

Additionaly any repository should be able to read a masked variable
named WTOKEN with the token provided by BUGSENG.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
---
 .gitlab-ci.yml                    |  2 ++
 automation/gitlab-ci/analyze.yaml | 38 +++++++++++++++++++++++++++++++
 automation/scripts/eclair         | 26 +++++++++++++++++++++
 3 files changed, 66 insertions(+)
 create mode 100644 automation/gitlab-ci/analyze.yaml
 create mode 100755 automation/scripts/eclair

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c8bd7519d5..ee5430b8b7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,7 +1,9 @@
 stages:
+  - analyze
   - build
   - test
 
 include:
+  - 'automation/gitlab-ci/analyze.yaml'
   - 'automation/gitlab-ci/build.yaml'
   - 'automation/gitlab-ci/test.yaml'
diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
new file mode 100644
index 0000000000..be96d96e71
--- /dev/null
+++ b/automation/gitlab-ci/analyze.yaml
@@ -0,0 +1,38 @@
+.eclair-analysis:
+  stage: analyze
+  tags:
+    - eclair-analysis
+    - eclair
+    - misrac
+  variables:
+    ECLAIR_OUTPUT_DIR: "ECLAIR_out"
+    ANALYSIS_KIND: "normal"
+    ECLAIR_REPORT_URL: "saas.eclairit.com"
+    ENABLE_ECLAIR_BOT: "n"
+    AUTOPRBRANCH: "staging"
+    AUTOPRREPOSITORY: "xen-project/xen"
+  artifacts:
+    when: always
+    paths:
+      - "${ECLAIR_OUTPUT_DIR}"
+      - '*.log'
+    reports:
+      codequality: gl-code-quality-report.json
+
+eclair-x86_64:
+  extends: .eclair-analysis
+  variables:
+    LOGFILE: "eclair-x86_64.log"
+    VARIANT: "X86_64"
+    RULESET: "Set1"
+  script:
+    - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
+
+eclair-ARM64:
+  extends: .eclair-analysis
+  variables:
+    LOGFILE: "eclair-ARM64.log"
+    VARIANT: "ARM64"
+    RULESET: "Set1"
+  script:
+    - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
diff --git a/automation/scripts/eclair b/automation/scripts/eclair
new file mode 100755
index 0000000000..d7f0845aec
--- /dev/null
+++ b/automation/scripts/eclair
@@ -0,0 +1,26 @@
+#!/bin/bash -eu
+
+# ECLAIR configuration files are maintened by BUGSENG
+export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no"
+[ -d ECLAIR_scripts ] || git clone ssh://git@git.bugseng.com/eclair/scripts/XEN ECLAIR_scripts
+(cd ECLAIR_scripts; git pull --rebase)
+
+ECLAIR_DIR=ECLAIR_scripts/ECLAIR
+ECLAIR_OUTPUT_DIR=$(realpath "${ECLAIR_OUTPUT_DIR}")
+
+ECLAIR_scripts/prepare.sh "${VARIANT}"
+
+ex=0
+"${ECLAIR_DIR}/analyze.sh" "${VARIANT}" "${RULESET}" || ex=$?
+"${ECLAIR_DIR}/action_log.sh" ANALYSIS_LOG \
+                             "ECLAIR analysis log" \
+                             "${ECLAIR_OUTPUT_DIR}/ANALYSIS.log" \
+                             "${ex}"
+"${ECLAIR_DIR}/action_log.sh" REPORT_LOG \
+                             "ECLAIR report log" \
+                             "${ECLAIR_OUTPUT_DIR}/REPORT.log" \
+                             "${ex}"
+[ "${ex}" = 0 ] || exit "${ex}"
+"${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
+
+rm -rf "${ECLAIR_OUTPUT_DIR}/.data"
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 20 21:47:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 21:47:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566741.885976 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMbUK-0001aq-6C; Thu, 20 Jul 2023 21:47:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566741.885976; Thu, 20 Jul 2023 21:47:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMbUK-0001aj-32; Thu, 20 Jul 2023 21:47:08 +0000
Received: by outflank-mailman (input) for mailman id 566741;
 Thu, 20 Jul 2023 21:47:06 +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
 <SRS0=DC1w=DG=gmail.com=christopher.w.clark@srs-se1.protection.inumbo.net>)
 id 1qMbUI-0001ad-25
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 21:47:06 +0000
Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com
 [2a00:1450:4864:20::52a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f67e0493-2746-11ee-8611-37d641c3527e;
 Thu, 20 Jul 2023 23:47:03 +0200 (CEST)
Received: by mail-ed1-x52a.google.com with SMTP id
 4fb4d7f45d1cf-51e619bcbf9so1577581a12.3
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 14:47:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f67e0493-2746-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689889623; x=1690494423;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=52+s2SbNnxxNOwv+Zb60gyCGKTPiz+xuMsadNr5U7Vk=;
        b=G8YX3AGnO7cQuIWYINGlnztxF+yEwntD5yr5GgS+rNL7XQjL0c1XBkc3l75TdsaScu
         pr+icg6TvMNDBn6m4Lrsri+r+/Oqo4SNtwnvOYniw60ivs2lTt15IsbyOWjGRe1akusW
         Ti+YRNTExo5SPtSSIy0UYi09odsSFixZKX4i0yZtJIsPIoFr4t/ngwSFBSf0fJZdL+JR
         SSe1pEe2L0JOb9TTpaXbKcHYUu3Xwk3FB2p5wSUmKumoG+EY1EB2Lim4NnyPXSWAW2ke
         bIj/JYduPmFYl+iTBIBCTCb4Wi9fmpbqddZr6l03WfnU6+nZvzNgBL2vT+1lxQ1skUgt
         gpqQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689889623; x=1690494423;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=52+s2SbNnxxNOwv+Zb60gyCGKTPiz+xuMsadNr5U7Vk=;
        b=OI8OI9wlRd7cQo0yZCvcM2/ISiIUaGEkqq29L5WEBaarhrb5VtcMv01qT8SqovTTmK
         7gT89XfkXLwtM/YsuGWBMdWqYdjL+heGNRpBWZG045AtPOhL017sqS/O7psjT9mxN+zq
         Al/jlrVY+GFJeqc+67yYroqd0VzgbkVj/kNvSvNWLYjjnMdIyLznmg4zeXo36lQK81nL
         oPc2Wvrhp+AACiiOEuOyesozCyfc5C88qBIt/5APUVUG2jCg9GILGbIe2zvwBtqNNl/t
         rDtAcoM1sSQzrTCFzKBPUn7/+yhPwNoZDuzJnBNfdmkMqNnYG+409p7lD4o5GSyp+/Df
         GQZQ==
X-Gm-Message-State: ABy/qLZbqnWI3iMqaUaBmFd/XhWTXX94yFpZZ4gIDsyGKO3m9jgOIoIM
	qckMRBtmCBaVD2od+bP1m7d0l4lsE5bnxs3uoPYGYSkKxGy4vw==
X-Google-Smtp-Source: APBJJlENIfsfJkAnFAzIPF3bfkBisLFEB+2aHO1Zr6gjV2LRBTRCbykUFjF1SHuXtUUO/CyZjgoTJG9B0ydBoIcpHRA=
X-Received: by 2002:a05:6402:1a3c:b0:51a:2c81:72ee with SMTP id
 be28-20020a0564021a3c00b0051a2c8172eemr70508edb.20.1689889621882; Thu, 20 Jul
 2023 14:47:01 -0700 (PDT)
MIME-Version: 1.0
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
 <20230701071835.41599-2-christopher.w.clark@gmail.com> <alpine.DEB.2.22.394.2307081124250.761183@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2307081124250.761183@ubuntu-linux-20-04-desktop>
From: Christopher Clark <christopher.w.clark@gmail.com>
Date: Thu, 20 Jul 2023 14:46:50 -0700
Message-ID: <CACMJ4GZ5-Mg7Tg_H4mCj6EUUbwhhjZYid2V==c71o1fa5VPgOQ@mail.gmail.com>
Subject: Re: [PATCH 01/10] x86 setup: move x86 boot module counting into a new
 boot_info struct
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, 
	Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
	Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, 
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, 
	Bertrand Marquis <bertrand.marquis@arm.com>, Luca Fancellu <luca.fancellu@arm.com>, 
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Rich Persaud <persaur@gmail.com>
Content-Type: multipart/alternative; boundary="0000000000009f3b270600f21682"

--0000000000009f3b270600f21682
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sat, Jul 8, 2023 at 11:30=E2=80=AFAM Stefano Stabellini <sstabellini@ker=
nel.org>
wrote:

> On Sat, 1 Jul 2023, Christopher Clark wrote:
> > An initial step towards a non-multiboot internal representation of boot
> > modules for common code, starting with x86 setup and converting the
> > fields that are accessed for the startup calculations.
> >
> > Introduce a new header, <xen/bootinfo.h>, and populate it with a new
> > boot_info structure initially containing a count of the number of boot
> > modules.
> >
> > The naming of the header, structure and fields is intended to respect
> > the boot structures on Arm -- see arm/include/asm/setup.h -- as part of
> > work towards aligning common architecture-neutral boot logic and
> > structures.
>
> Thanks for aligning the two archs. At some point we should also have ARM
> use the common headers.
>
>
> > No functional change intended.
> >
> > Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
> > Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
> >
> > ---
> > Changes since v1: patch is a subset of v1 series patches 2 and 3.
> >
> >  xen/arch/x86/setup.c       | 58 +++++++++++++++++++++++---------------
> >  xen/include/xen/bootinfo.h | 20 +++++++++++++
> >  2 files changed, 55 insertions(+), 23 deletions(-)
> >  create mode 100644 xen/include/xen/bootinfo.h
> >
> > diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
> > index 74e3915a4d..708639b236 100644
> > --- a/xen/arch/x86/setup.c
> > +++ b/xen/arch/x86/setup.c
> > @@ -1,3 +1,4 @@
> > +#include <xen/bootinfo.h>
> >  #include <xen/init.h>
> >  #include <xen/lib.h>
> >  #include <xen/err.h>
> > @@ -268,7 +269,16 @@ static int __init cf_check parse_acpi_param(const
> char *s)
> >  custom_param("acpi", parse_acpi_param);
> >
> >  static const module_t *__initdata initial_images;
> > -static unsigned int __initdata nr_initial_images;
> > +static struct boot_info __initdata *boot_info;
>
> Why can't this be not a pointer?
>

In a later patch (10/10 in the same series posted), the boot_info pointer
is passed as an argument to start_xen. On x86 there are currently three
different entry points to this that have different environments which must
all be made to behave the same, and passing the argument as a pointer is a
lowest-common-denominater due to the 32bit x86 multiboot entry point.
Additionally another entry point will be coming soon for TrenchBoot.

Defining it as a pointer now where this logic is introduced saves having to
do a conversion of all accesses when the later change is made.

I can add a note about this to the commit message.



>
>
> > +static void __init multiboot_to_bootinfo(multiboot_info_t *mbi)
> > +{
> > +    static struct boot_info __initdata info;
>
> Then we don't need this
>

(see above)

>
>
> > +    info.nr_mods =3D mbi->mods_count;
> > +
> > +    boot_info =3D &info;
>
> And we could just do:
>
>   boot_info.nr_mods =3D mbi->mods_count;
>
> ?
>

(see above)



>
>
> > +}
> >
> >  unsigned long __init initial_images_nrpages(nodeid_t node)
> >  {
> > @@ -277,7 +287,7 @@ unsigned long __init initial_images_nrpages(nodeid_=
t
> node)
> >      unsigned long nr;
> >      unsigned int i;
> >
> > -    for ( nr =3D i =3D 0; i < nr_initial_images; ++i )
> > +    for ( nr =3D i =3D 0; i < boot_info->nr_mods; ++i )
> >      {
> >          unsigned long start =3D initial_images[i].mod_start;
> >          unsigned long end =3D start + PFN_UP(initial_images[i].mod_end=
);
> > @@ -293,7 +303,7 @@ void __init discard_initial_images(void)
> >  {
> >      unsigned int i;
> >
> > -    for ( i =3D 0; i < nr_initial_images; ++i )
> > +    for ( i =3D 0; i < boot_info->nr_mods; ++i )
> >      {
> >          uint64_t start =3D (uint64_t)initial_images[i].mod_start <<
> PAGE_SHIFT;
> >
> > @@ -301,7 +311,7 @@ void __init discard_initial_images(void)
> >                             start +
> PAGE_ALIGN(initial_images[i].mod_end));
> >      }
> >
> > -    nr_initial_images =3D 0;
> > +    boot_info->nr_mods =3D 0;
> >      initial_images =3D NULL;
> >  }
> >
> > @@ -1020,6 +1030,8 @@ void __init noreturn __start_xen(unsigned long
> mbi_p)
> >          mod =3D __va(mbi->mods_addr);
> >      }
> >
> > +    multiboot_to_bootinfo(mbi);
> > +
> >      loader =3D (mbi->flags & MBI_LOADERNAME)
> >          ? (char *)__va(mbi->boot_loader_name) : "unknown";
> >
> > @@ -1127,18 +1139,18 @@ void __init noreturn __start_xen(unsigned long
> mbi_p)
> >             bootsym(boot_edd_info_nr));
> >
> >      /* Check that we have at least one Multiboot module. */
> > -    if ( !(mbi->flags & MBI_MODULES) || (mbi->mods_count =3D=3D 0) )
> > +    if ( !(mbi->flags & MBI_MODULES) || (boot_info->nr_mods =3D=3D 0) =
)
> >          panic("dom0 kernel not specified. Check bootloader
> configuration\n");
> >
> >      /* Check that we don't have a silly number of modules. */
> > -    if ( mbi->mods_count > sizeof(module_map) * 8 )
> > +    if ( boot_info->nr_mods > sizeof(module_map) * 8 )
> >      {
> > -        mbi->mods_count =3D sizeof(module_map) * 8;
> > +        boot_info->nr_mods =3D sizeof(module_map) * 8;
> >          printk("Excessive multiboot modules - using the first %u
> only\n",
> > -               mbi->mods_count);
> > +               boot_info->nr_mods);
> >      }
> >
> > -    bitmap_fill(module_map, mbi->mods_count);
> > +    bitmap_fill(module_map, boot_info->nr_mods);
> >      __clear_bit(0, module_map); /* Dom0 kernel is always first */
> >
> >      if ( pvh_boot )
> > @@ -1311,9 +1323,9 @@ void __init noreturn __start_xen(unsigned long
> mbi_p)
> >      kexec_reserve_area(&boot_e820);
> >
> >      initial_images =3D mod;
> > -    nr_initial_images =3D mbi->mods_count;
> > +    boot_info->nr_mods =3D boot_info->nr_mods;
> >
> > -    for ( i =3D 0; !efi_enabled(EFI_LOADER) && i < mbi->mods_count; i+=
+ )
> > +    for ( i =3D 0; !efi_enabled(EFI_LOADER) && i < boot_info->nr_mods;
> i++ )
> >      {
> >          if ( mod[i].mod_start & (PAGE_SIZE - 1) )
> >              panic("Bootloader didn't honor module alignment request\n"=
);
> > @@ -1337,8 +1349,8 @@ void __init noreturn __start_xen(unsigned long
> mbi_p)
> >           * respective reserve_e820_ram() invocation below. No need to
> >           * query efi_boot_mem_unused() here, though.
> >           */
> > -        mod[mbi->mods_count].mod_start =3D virt_to_mfn(_stext);
> > -        mod[mbi->mods_count].mod_end =3D __2M_rwdata_end - _stext;
> > +        mod[boot_info->nr_mods].mod_start =3D virt_to_mfn(_stext);
> > +        mod[boot_info->nr_mods].mod_end =3D __2M_rwdata_end - _stext;
> >      }
> >
> >      modules_headroom =3D bzimage_headroom(bootstrap_map(mod),
> mod->mod_end);
> > @@ -1398,7 +1410,7 @@ void __init noreturn __start_xen(unsigned long
> mbi_p)
> >          {
> >              /* Don't overlap with modules. */
> >              end =3D consider_modules(s, e, reloc_size + mask,
> > -                                   mod, mbi->mods_count, -1);
> > +                                   mod, boot_info->nr_mods, -1);
> >              end &=3D ~mask;
> >          }
> >          else
> > @@ -1419,7 +1431,7 @@ void __init noreturn __start_xen(unsigned long
> mbi_p)
> >          }
> >
> >          /* Is the region suitable for relocating the multiboot modules=
?
> */
> > -        for ( j =3D mbi->mods_count - 1; j >=3D 0; j-- )
> > +        for ( j =3D boot_info->nr_mods - 1; j >=3D 0; j-- )
> >          {
> >              unsigned long headroom =3D j ? 0 : modules_headroom;
> >              unsigned long size =3D PAGE_ALIGN(headroom + mod[j].mod_en=
d);
> > @@ -1429,7 +1441,7 @@ void __init noreturn __start_xen(unsigned long
> mbi_p)
> >
> >              /* Don't overlap with other modules (or Xen itself). */
> >              end =3D consider_modules(s, e, size, mod,
> > -                                   mbi->mods_count + relocated, j);
> > +                                   boot_info->nr_mods + relocated, j);
> >
> >              if ( highmem_start && end > highmem_start )
> >                  continue;
> > @@ -1456,7 +1468,7 @@ void __init noreturn __start_xen(unsigned long
> mbi_p)
> >          {
> >              /* Don't overlap with modules (or Xen itself). */
> >              e =3D consider_modules(s, e,
> PAGE_ALIGN(kexec_crash_area.size), mod,
> > -                                 mbi->mods_count + relocated, -1);
> > +                                 boot_info->nr_mods + relocated, -1);
> >              if ( s >=3D e )
> >                  break;
> >              if ( e > kexec_crash_area_limit )
> > @@ -1471,7 +1483,7 @@ void __init noreturn __start_xen(unsigned long
> mbi_p)
> >
> >      if ( modules_headroom && !mod->reserved )
> >          panic("Not enough memory to relocate the dom0 kernel image\n")=
;
> > -    for ( i =3D 0; i < mbi->mods_count; ++i )
> > +    for ( i =3D 0; i < boot_info->nr_mods; ++i )
> >      {
> >          uint64_t s =3D (uint64_t)mod[i].mod_start << PAGE_SHIFT;
> >
> > @@ -1540,7 +1552,7 @@ void __init noreturn __start_xen(unsigned long
> mbi_p)
> >                      ASSERT(j);
> >                  }
> >                  map_e =3D boot_e820.map[j].addr + boot_e820.map[j].siz=
e;
> > -                for ( j =3D 0; j < mbi->mods_count; ++j )
> > +                for ( j =3D 0; j < boot_info->nr_mods; ++j )
> >                  {
> >                      uint64_t end =3D pfn_to_paddr(mod[j].mod_start) +
> >                                     mod[j].mod_end;
> > @@ -1616,7 +1628,7 @@ void __init noreturn __start_xen(unsigned long
> mbi_p)
> >          }
> >      }
> >
> > -    for ( i =3D 0; i < mbi->mods_count; ++i )
> > +    for ( i =3D 0; i < boot_info->nr_mods; ++i )
> >      {
> >          set_pdx_range(mod[i].mod_start,
> >                        mod[i].mod_start + PFN_UP(mod[i].mod_end));
> > @@ -1999,8 +2011,8 @@ void __init noreturn __start_xen(unsigned long
> mbi_p)
> >             cpu_has_nx ? XENLOG_INFO : XENLOG_WARNING "Warning: ",
> >             cpu_has_nx ? "" : "not ");
> >
> > -    initrdidx =3D find_first_bit(module_map, mbi->mods_count);
> > -    if ( bitmap_weight(module_map, mbi->mods_count) > 1 )
> > +    initrdidx =3D find_first_bit(module_map, boot_info->nr_mods);
> > +    if ( bitmap_weight(module_map, boot_info->nr_mods) > 1 )
> >          printk(XENLOG_WARNING
> >                 "Multiple initrd candidates, picking module #%u\n",
> >                 initrdidx);
> > @@ -2010,7 +2022,7 @@ void __init noreturn __start_xen(unsigned long
> mbi_p)
> >       * above our heap. The second module, if present, is an initrd
> ramdisk.
> >       */
> >      dom0 =3D create_dom0(mod, modules_headroom,
> > -                       initrdidx < mbi->mods_count ? mod + initrdidx :
> NULL,
> > +                       initrdidx < boot_info->nr_mods ? mod + initrdid=
x
> : NULL,
> >                         kextra, loader);
> >      if ( !dom0 )
> >          panic("Could not set up DOM0 guest OS\n");
> > diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
> > new file mode 100644
> > index 0000000000..6a7d55d20e
> > --- /dev/null
> > +++ b/xen/include/xen/bootinfo.h
> > @@ -0,0 +1,20 @@
> > +#ifndef __XEN_BOOTINFO_H__
> > +#define __XEN_BOOTINFO_H__
> > +
> > +#include <xen/types.h>
>
> I don't think you need types.h right now
>

Ack - thanks


>
>
> > +struct boot_info {
>
> This is what we call struct bootmodules on ARM right? Would it help if
> we used the same name?
>
> I am not asking to make the ARM code common because I think that would
> probably be a lot more work.
>

It becomes clearer to see by the end of the full hyperlaunch v1 series with
the domain builder implemented, but it is also evident by the end of this
series: the core/common boot info for Xen is more than just a set of
bootmodules. This first patch is part of adding functionality to common
incrementally, as a starting point, and reducing this boot info to just a
bootmodules structure is going to be limiting it in this context.

Christopher


>
>
> > +    unsigned int nr_mods;
> > +};
> > +
> > +#endif
> > +
> > +/*
> > + * Local variables:
> > + * mode: C
> > + * c-file-style: "BSD"
> > + * c-basic-offset: 4
> > + * tab-width: 4
> > + * indent-tabs-mode: nil
> > + * End:
> > + */
> > --
> > 2.25.1
> >
> >
>

--0000000000009f3b270600f21682
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Sat, Jul 8, 2023 at 11:30=E2=80=AF=
AM Stefano Stabellini &lt;<a href=3D"mailto:sstabellini@kernel.org">sstabel=
lini@kernel.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad=
ding-left:1ex">On Sat, 1 Jul 2023, Christopher Clark wrote:<br>
&gt; An initial step towards a non-multiboot internal representation of boo=
t<br>
&gt; modules for common code, starting with x86 setup and converting the<br=
>
&gt; fields that are accessed for the startup calculations.<br>
&gt; <br>
&gt; Introduce a new header, &lt;xen/bootinfo.h&gt;, and populate it with a=
 new<br>
&gt; boot_info structure initially containing a count of the number of boot=
<br>
&gt; modules.<br>
&gt; <br>
&gt; The naming of the header, structure and fields is intended to respect<=
br>
&gt; the boot structures on Arm -- see arm/include/asm/setup.h -- as part o=
f<br>
&gt; work towards aligning common architecture-neutral boot logic and<br>
&gt; structures.<br>
<br>
Thanks for aligning the two archs. At some point we should also have ARM<br=
>
use the common headers.<br>
<br>
<br>
&gt; No functional change intended.<br>
&gt; <br>
&gt; Signed-off-by: Christopher Clark &lt;<a href=3D"mailto:christopher.w.c=
lark@gmail.com" target=3D"_blank">christopher.w.clark@gmail.com</a>&gt;<br>
&gt; Signed-off-by: Daniel P. Smith &lt;<a href=3D"mailto:dpsmith@apertusso=
lutions.com" target=3D"_blank">dpsmith@apertussolutions.com</a>&gt;<br>
&gt; <br>
&gt; ---<br>
&gt; Changes since v1: patch is a subset of v1 series patches 2 and 3.<br>
&gt; <br>
&gt;=C2=A0 xen/arch/x86/setup.c=C2=A0 =C2=A0 =C2=A0 =C2=A0| 58 ++++++++++++=
+++++++++++---------------<br>
&gt;=C2=A0 xen/include/xen/bootinfo.h | 20 +++++++++++++<br>
&gt;=C2=A0 2 files changed, 55 insertions(+), 23 deletions(-)<br>
&gt;=C2=A0 create mode 100644 xen/include/xen/bootinfo.h<br>
&gt; <br>
&gt; diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c<br>
&gt; index 74e3915a4d..708639b236 100644<br>
&gt; --- a/xen/arch/x86/setup.c<br>
&gt; +++ b/xen/arch/x86/setup.c<br>
&gt; @@ -1,3 +1,4 @@<br>
&gt; +#include &lt;xen/bootinfo.h&gt;<br>
&gt;=C2=A0 #include &lt;xen/init.h&gt;<br>
&gt;=C2=A0 #include &lt;xen/lib.h&gt;<br>
&gt;=C2=A0 #include &lt;xen/err.h&gt;<br>
&gt; @@ -268,7 +269,16 @@ static int __init cf_check parse_acpi_param(const=
 char *s)<br>
&gt;=C2=A0 custom_param(&quot;acpi&quot;, parse_acpi_param);<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 static const module_t *__initdata initial_images;<br>
&gt; -static unsigned int __initdata nr_initial_images;<br>
&gt; +static struct boot_info __initdata *boot_info;<br>
<br>
Why can&#39;t this be not a pointer?<br></blockquote><div><br></div><div>In=
 a later patch (10/10 in the same series posted), the boot_info pointer is =
passed as an argument to start_xen. On x86 there are currently three differ=
ent entry points to this that have different environments which must all be=
 made to behave the same, and passing the argument as a pointer is a lowest=
-common-denominater due to the 32bit x86 multiboot entry point.<br>Addition=
ally another entry point will be coming soon for TrenchBoot.<br><br>Definin=
g it as a pointer now where this logic is introduced saves having to do a c=
onversion of all accesses when the later change is made.<br><br>I can add a=
 note about this to the commit message.<br></div><div><br></div><div>=C2=A0=
</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;b=
order-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
&gt; +static void __init multiboot_to_bootinfo(multiboot_info_t *mbi)<br>
&gt; +{<br>
&gt; +=C2=A0 =C2=A0 static struct boot_info __initdata info;<br>
<br>
Then we don&#39;t need this<br></blockquote><div><br></div><div>(see above)=
=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
&gt; +=C2=A0 =C2=A0 info.nr_mods =3D mbi-&gt;mods_count;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 boot_info =3D &amp;info;<br>
<br>
And we could just do:<br>
<br>
=C2=A0 boot_info.nr_mods =3D mbi-&gt;mods_count;<br>
<br>
?<br></blockquote><div><br></div><div>(see above)=C2=A0</div><br class=3D"g=
mail-Apple-interchange-newline"><div>=C2=A0</div><blockquote class=3D"gmail=
_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204=
,204);padding-left:1ex">
<br>
<br>
&gt; +}<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 unsigned long __init initial_images_nrpages(nodeid_t node)<br>
&gt;=C2=A0 {<br>
&gt; @@ -277,7 +287,7 @@ unsigned long __init initial_images_nrpages(nodeid=
_t node)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 unsigned long nr;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 unsigned int i;<br>
&gt;=C2=A0 <br>
&gt; -=C2=A0 =C2=A0 for ( nr =3D i =3D 0; i &lt; nr_initial_images; ++i )<b=
r>
&gt; +=C2=A0 =C2=A0 for ( nr =3D i =3D 0; i &lt; boot_info-&gt;nr_mods; ++i=
 )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 unsigned long start =3D initial_imag=
es[i].mod_start;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 unsigned long end =3D start + PFN_UP=
(initial_images[i].mod_end);<br>
&gt; @@ -293,7 +303,7 @@ void __init discard_initial_images(void)<br>
&gt;=C2=A0 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 unsigned int i;<br>
&gt;=C2=A0 <br>
&gt; -=C2=A0 =C2=A0 for ( i =3D 0; i &lt; nr_initial_images; ++i )<br>
&gt; +=C2=A0 =C2=A0 for ( i =3D 0; i &lt; boot_info-&gt;nr_mods; ++i )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 uint64_t start =3D (uint64_t)initial=
_images[i].mod_start &lt;&lt; PAGE_SHIFT;<br>
&gt;=C2=A0 <br>
&gt; @@ -301,7 +311,7 @@ void __init discard_initial_images(void)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0start + PAGE_ALIGN(initial_images[i].mod_=
end));<br>
&gt;=C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 <br>
&gt; -=C2=A0 =C2=A0 nr_initial_images =3D 0;<br>
&gt; +=C2=A0 =C2=A0 boot_info-&gt;nr_mods =3D 0;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 initial_images =3D NULL;<br>
&gt;=C2=A0 }<br>
&gt;=C2=A0 <br>
&gt; @@ -1020,6 +1030,8 @@ void __init noreturn __start_xen(unsigned long m=
bi_p)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 mod =3D __va(mbi-&gt;mods_addr);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 <br>
&gt; +=C2=A0 =C2=A0 multiboot_to_bootinfo(mbi);<br>
&gt; +<br>
&gt;=C2=A0 =C2=A0 =C2=A0 loader =3D (mbi-&gt;flags &amp; MBI_LOADERNAME)<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ? (char *)__va(mbi-&gt;boot_loader_n=
ame) : &quot;unknown&quot;;<br>
&gt;=C2=A0 <br>
&gt; @@ -1127,18 +1139,18 @@ void __init noreturn __start_xen(unsigned long=
 mbi_p)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bootsym(boot_edd_info_n=
r));<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 /* Check that we have at least one Multiboot modul=
e. */<br>
&gt; -=C2=A0 =C2=A0 if ( !(mbi-&gt;flags &amp; MBI_MODULES) || (mbi-&gt;mod=
s_count =3D=3D 0) )<br>
&gt; +=C2=A0 =C2=A0 if ( !(mbi-&gt;flags &amp; MBI_MODULES) || (boot_info-&=
gt;nr_mods =3D=3D 0) )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 panic(&quot;dom0 kernel not specifie=
d. Check bootloader configuration\n&quot;);<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 /* Check that we don&#39;t have a silly number of =
modules. */<br>
&gt; -=C2=A0 =C2=A0 if ( mbi-&gt;mods_count &gt; sizeof(module_map) * 8 )<b=
r>
&gt; +=C2=A0 =C2=A0 if ( boot_info-&gt;nr_mods &gt; sizeof(module_map) * 8 =
)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 mbi-&gt;mods_count =3D sizeof(module_map)=
 * 8;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 boot_info-&gt;nr_mods =3D sizeof(module_m=
ap) * 8;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 printk(&quot;Excessive multiboot mod=
ules - using the first %u only\n&quot;,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mbi-&gt;mods_c=
ount);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0boot_info-&gt;=
nr_mods);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 <br>
&gt; -=C2=A0 =C2=A0 bitmap_fill(module_map, mbi-&gt;mods_count);<br>
&gt; +=C2=A0 =C2=A0 bitmap_fill(module_map, boot_info-&gt;nr_mods);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 __clear_bit(0, module_map); /* Dom0 kernel is alwa=
ys first */<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 if ( pvh_boot )<br>
&gt; @@ -1311,9 +1323,9 @@ void __init noreturn __start_xen(unsigned long m=
bi_p)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 kexec_reserve_area(&amp;boot_e820);<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 initial_images =3D mod;<br>
&gt; -=C2=A0 =C2=A0 nr_initial_images =3D mbi-&gt;mods_count;<br>
&gt; +=C2=A0 =C2=A0 boot_info-&gt;nr_mods =3D boot_info-&gt;nr_mods;<br>
&gt;=C2=A0 <br>
&gt; -=C2=A0 =C2=A0 for ( i =3D 0; !efi_enabled(EFI_LOADER) &amp;&amp; i &l=
t; mbi-&gt;mods_count; i++ )<br>
&gt; +=C2=A0 =C2=A0 for ( i =3D 0; !efi_enabled(EFI_LOADER) &amp;&amp; i &l=
t; boot_info-&gt;nr_mods; i++ )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if ( mod[i].mod_start &amp; (PAGE_SI=
ZE - 1) )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 panic(&quot;Bootloader=
 didn&#39;t honor module alignment request\n&quot;);<br>
&gt; @@ -1337,8 +1349,8 @@ void __init noreturn __start_xen(unsigned long m=
bi_p)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* respective reserve_e820_ram(=
) invocation below. No need to<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* query efi_boot_mem_unused() =
here, though.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 mod[mbi-&gt;mods_count].mod_start =3D vir=
t_to_mfn(_stext);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 mod[mbi-&gt;mods_count].mod_end =3D __2M_=
rwdata_end - _stext;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 mod[boot_info-&gt;nr_mods].mod_start =3D =
virt_to_mfn(_stext);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 mod[boot_info-&gt;nr_mods].mod_end =3D __=
2M_rwdata_end - _stext;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 modules_headroom =3D bzimage_headroom(bootstrap_ma=
p(mod), mod-&gt;mod_end);<br>
&gt; @@ -1398,7 +1410,7 @@ void __init noreturn __start_xen(unsigned long m=
bi_p)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Don&#39;t overlap w=
ith modules. */<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end =3D consider_modul=
es(s, e, reloc_size + mask,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mod, mbi-&gt;mods_c=
ount, -1);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mod, boot_info-&gt;=
nr_mods, -1);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end &amp;=3D ~mask;<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else<br>
&gt; @@ -1419,7 +1431,7 @@ void __init noreturn __start_xen(unsigned long m=
bi_p)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Is the region suitable for reloca=
ting the multiboot modules? */<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 for ( j =3D mbi-&gt;mods_count - 1; j &gt=
;=3D 0; j-- )<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 for ( j =3D boot_info-&gt;nr_mods - 1; j =
&gt;=3D 0; j-- )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 unsigned long headroom=
 =3D j ? 0 : modules_headroom;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 unsigned long size =3D=
 PAGE_ALIGN(headroom + mod[j].mod_end);<br>
&gt; @@ -1429,7 +1441,7 @@ void __init noreturn __start_xen(unsigned long m=
bi_p)<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Don&#39;t overlap w=
ith other modules (or Xen itself). */<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end =3D consider_modul=
es(s, e, size, mod,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mbi-&gt;mods_count =
+ relocated, j);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0boot_info-&gt;nr_mo=
ds + relocated, j);<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if ( highmem_start &am=
p;&amp; end &gt; highmem_start )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 continue=
;<br>
&gt; @@ -1456,7 +1468,7 @@ void __init noreturn __start_xen(unsigned long m=
bi_p)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Don&#39;t overlap w=
ith modules (or Xen itself). */<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 e =3D consider_modules=
(s, e, PAGE_ALIGN(kexec_crash_area.size), mod,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mbi-&gt;mods_count + reloc=
ated, -1);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0boot_info-&gt;nr_mods + re=
located, -1);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if ( s &gt;=3D e )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<b=
r>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if ( e &gt; kexec_cras=
h_area_limit )<br>
&gt; @@ -1471,7 +1483,7 @@ void __init noreturn __start_xen(unsigned long m=
bi_p)<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 if ( modules_headroom &amp;&amp; !mod-&gt;reserved=
 )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 panic(&quot;Not enough memory to rel=
ocate the dom0 kernel image\n&quot;);<br>
&gt; -=C2=A0 =C2=A0 for ( i =3D 0; i &lt; mbi-&gt;mods_count; ++i )<br>
&gt; +=C2=A0 =C2=A0 for ( i =3D 0; i &lt; boot_info-&gt;nr_mods; ++i )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 uint64_t s =3D (uint64_t)mod[i].mod_=
start &lt;&lt; PAGE_SHIFT;<br>
&gt;=C2=A0 <br>
&gt; @@ -1540,7 +1552,7 @@ void __init noreturn __start_xen(unsigned long m=
bi_p)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 ASSERT(j);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 map_e =
=3D boot_e820.map[j].addr + boot_e820.map[j].size;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for ( j =3D 0=
; j &lt; mbi-&gt;mods_count; ++j )<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for ( j =3D 0=
; j &lt; boot_info-&gt;nr_mods; ++j )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 uint64_t end =3D pfn_to_paddr(mod[j].mod_start) +<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mod[j].mod_en=
d;<br>
&gt; @@ -1616,7 +1628,7 @@ void __init noreturn __start_xen(unsigned long m=
bi_p)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 <br>
&gt; -=C2=A0 =C2=A0 for ( i =3D 0; i &lt; mbi-&gt;mods_count; ++i )<br>
&gt; +=C2=A0 =C2=A0 for ( i =3D 0; i &lt; boot_info-&gt;nr_mods; ++i )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 set_pdx_range(mod[i].mod_start,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 mod[i].mod_start + PFN_UP(mod[i].mod_end));<br>
&gt; @@ -1999,8 +2011,8 @@ void __init noreturn __start_xen(unsigned long m=
bi_p)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cpu_has_nx ? XENLOG_INF=
O : XENLOG_WARNING &quot;Warning: &quot;,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cpu_has_nx ? &quot;&quo=
t; : &quot;not &quot;);<br>
&gt;=C2=A0 <br>
&gt; -=C2=A0 =C2=A0 initrdidx =3D find_first_bit(module_map, mbi-&gt;mods_c=
ount);<br>
&gt; -=C2=A0 =C2=A0 if ( bitmap_weight(module_map, mbi-&gt;mods_count) &gt;=
 1 )<br>
&gt; +=C2=A0 =C2=A0 initrdidx =3D find_first_bit(module_map, boot_info-&gt;=
nr_mods);<br>
&gt; +=C2=A0 =C2=A0 if ( bitmap_weight(module_map, boot_info-&gt;nr_mods) &=
gt; 1 )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 printk(XENLOG_WARNING<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;Mul=
tiple initrd candidates, picking module #%u\n&quot;,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0initrdidx=
);<br>
&gt; @@ -2010,7 +2022,7 @@ void __init noreturn __start_xen(unsigned long m=
bi_p)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0* above our heap. The second module, if pres=
ent, is an initrd ramdisk.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0*/<br>
&gt;=C2=A0 =C2=A0 =C2=A0 dom0 =3D create_dom0(mod, modules_headroom,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0initrdidx &lt; mbi-&gt;mods_count ? mod + initrdidx : NULL,<b=
r>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0initrdidx &lt; boot_info-&gt;nr_mods ? mod + initrdidx : NULL=
,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0kextra, loader);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 if ( !dom0 )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 panic(&quot;Could not set up DOM0 gu=
est OS\n&quot;);<br>
&gt; diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h<b=
r>
&gt; new file mode 100644<br>
&gt; index 0000000000..6a7d55d20e<br>
&gt; --- /dev/null<br>
&gt; +++ b/xen/include/xen/bootinfo.h<br>
&gt; @@ -0,0 +1,20 @@<br>
&gt; +#ifndef __XEN_BOOTINFO_H__<br>
&gt; +#define __XEN_BOOTINFO_H__<br>
&gt; +<br>
&gt; +#include &lt;xen/types.h&gt;<br>
<br>
I don&#39;t think you need types.h right now<br></blockquote><div><br></div=
><div>Ack - thanks</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" =
style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa=
dding-left:1ex">
<br>
<br>
&gt; +struct boot_info {<br>
<br>
This is what we call struct bootmodules on ARM right? Would it help if<br>
we used the same name?<br>
<br>
I am not asking to make the ARM code common because I think that would<br>
probably be a lot more work.<br></blockquote><div><br></div><div>It becomes=
 clearer to see by the end of the full hyperlaunch v1 series with the domai=
n builder implemented, but it is also evident by the end of this series: th=
e core/common boot info for Xen is more than just a set of bootmodules. Thi=
s first patch is part of adding functionality to common incrementally, as a=
 starting point, and reducing this boot info to just a bootmodules structur=
e is going to be limiting it in this context.<br></div><div><br></div><div>=
Christopher</div><div>=C2=A0<br></div><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddi=
ng-left:1ex">
<br>
<br>
&gt; +=C2=A0 =C2=A0 unsigned int nr_mods;<br>
&gt; +};<br>
&gt; +<br>
&gt; +#endif<br>
&gt; +<br>
&gt; +/*<br>
&gt; + * Local variables:<br>
&gt; + * mode: C<br>
&gt; + * c-file-style: &quot;BSD&quot;<br>
&gt; + * c-basic-offset: 4<br>
&gt; + * tab-width: 4<br>
&gt; + * indent-tabs-mode: nil<br>
&gt; + * End:<br>
&gt; + */<br>
&gt; -- <br>
&gt; 2.25.1<br>
&gt; <br>
&gt; <br>
</blockquote></div></div>

--0000000000009f3b270600f21682--


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 21:50:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 21:50:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566745.885985 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMbXk-0003RP-Pz; Thu, 20 Jul 2023 21:50:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566745.885985; Thu, 20 Jul 2023 21:50:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMbXk-0003RI-NM; Thu, 20 Jul 2023 21:50:40 +0000
Received: by outflank-mailman (input) for mailman id 566745;
 Thu, 20 Jul 2023 21:50:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=1UDO=DG=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMbXk-0003RC-1s
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 21:50:40 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7645687b-2747-11ee-b23a-6b7b168915f2;
 Thu, 20 Jul 2023 23:50:38 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 0902F61C22;
 Thu, 20 Jul 2023 21:50:37 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98A6FC433C9;
 Thu, 20 Jul 2023 21:50:35 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7645687b-2747-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689889836;
	bh=spXXZGCJnxSNAofX2lqOO60SPjTHVzIo6S1jEOPrj5Y=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=Z9SItGVtKHvEMgwX4x/iJK+8ThaW/y2ZGtWq0E9S4xDROURdvfmDPRUlfoMywEoVc
	 Fhg0GOnCUSvaBhBn6XAprGtQAHiJeWZfQSLSgcT+ka3f0QSX1cvCrjjhgHtTUR/78X
	 JswXH9CWQmxBFJz83vw17R6XQbXpXtTbBrJ9lfnoSIozaCEgQj38mz4/DKAx5dTe6+
	 UQW535QEampMRAZFvbG6UqCIHrq7jaV0UABjI5KFEHNP5ErNFDt9hock5578+UaNus
	 UiSJrBeAfkA9w5ihZ3jXXM1b+mL4nVv5x2a/jNpnukSZh71AIRwYUSr/4zq+zwEjdJ
	 sYpttYcAlohQg==
Date: Thu, 20 Jul 2023 14:50:33 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Federico Serafini <federico.serafini@bugseng.com>
Subject: Re: [PATCH] x86/vRTC: move and tidy convert_hour() and
 {to,from}_bcd()
In-Reply-To: <e983103a-be32-7a77-4d7e-6d5559443f56@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307201450280.3118466@ubuntu-linux-20-04-desktop>
References: <e983103a-be32-7a77-4d7e-6d5559443f56@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 20 Jul 2023, Jan Beulich wrote:
> This is to avoid the need for forward declarations, which in turn
> addresses a violation of MISRA C:2012 Rule 8.3 ("All declarations of an
> object or function shall use the same names and type qualifiers").
> 
> While doing so,
> - drop inline (leaving the decision to the compiler),
> - add const,
> - add unsigned,
> - correct style.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> --- a/xen/arch/x86/hvm/rtc.c
> +++ b/xen/arch/x86/hvm/rtc.c
> @@ -58,8 +58,6 @@ enum rtc_mode {
>  
>  static void rtc_copy_date(RTCState *s);
>  static void rtc_set_time(RTCState *s);
> -static inline int from_bcd(RTCState *s, int a);
> -static inline int convert_hour(RTCState *s, int hour);
>  
>  static void rtc_update_irq(RTCState *s)
>  {
> @@ -246,6 +244,40 @@ static void cf_check rtc_update_timer2(v
>      spin_unlock(&s->lock);
>  }
>  
> +static unsigned int to_bcd(const RTCState *s, unsigned int a)
> +{
> +    if ( s->hw.cmos_data[RTC_REG_B] & RTC_DM_BINARY )
> +        return a;
> +
> +    return ((a / 10) << 4) | (a % 10);
> +}
> +
> +static unsigned int from_bcd(const RTCState *s, unsigned int a)
> +{
> +    if ( s->hw.cmos_data[RTC_REG_B] & RTC_DM_BINARY )
> +        return a;
> +
> +    return ((a >> 4) * 10) + (a & 0x0f);
> +}
> +
> +/*
> + * Hours in 12 hour mode are in 1-12 range, not 0-11. So we need convert it
> + * before use.
> + */
> +static unsigned int convert_hour(const RTCState *s, unsigned int raw)
> +{
> +    unsigned int hour = from_bcd(s, raw & 0x7f);
> +
> +    if ( !(s->hw.cmos_data[RTC_REG_B] & RTC_24H) )
> +    {
> +        hour %= 12;
> +        if ( raw & 0x80 )
> +            hour += 12;
> +    }
> +
> +    return hour;
> +}
> +
>  /* handle alarm timer */
>  static void alarm_timer_update(RTCState *s)
>  {
> @@ -541,37 +573,6 @@ static int rtc_ioport_write(void *opaque
>      return 1;
>  }
>  
> -static inline int to_bcd(RTCState *s, int a)
> -{
> -    if ( s->hw.cmos_data[RTC_REG_B] & RTC_DM_BINARY )
> -        return a;
> -    else
> -        return ((a / 10) << 4) | (a % 10);
> -}
> -
> -static inline int from_bcd(RTCState *s, int a)
> -{
> -    if ( s->hw.cmos_data[RTC_REG_B] & RTC_DM_BINARY )
> -        return a;
> -    else
> -        return ((a >> 4) * 10) + (a & 0x0f);
> -}
> -
> -/* Hours in 12 hour mode are in 1-12 range, not 0-11.
> - * So we need convert it before using it*/
> -static inline int convert_hour(RTCState *s, int raw)
> -{
> -    int hour = from_bcd(s, raw & 0x7f);
> -
> -    if (!(s->hw.cmos_data[RTC_REG_B] & RTC_24H))
> -    {
> -        hour %= 12;
> -        if (raw & 0x80)
> -            hour += 12;
> -    }
> -    return hour;
> -}
> -
>  static void rtc_set_time(RTCState *s)
>  {
>      struct tm *tm = &s->current_tm;
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 22:01:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 22:01:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566748.885995 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMbhZ-0005LH-Nc; Thu, 20 Jul 2023 22:00:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566748.885995; Thu, 20 Jul 2023 22:00:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMbhZ-0005LA-Kz; Thu, 20 Jul 2023 22:00:49 +0000
Received: by outflank-mailman (input) for mailman id 566748;
 Thu, 20 Jul 2023 22:00:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMbhY-0005L4-Or
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 22:00:48 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMbhX-00014r-A1; Thu, 20 Jul 2023 22:00:47 +0000
Received: from 54-240-197-239.amazon.com ([54.240.197.239]
 helo=[192.168.24.131]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMbhX-0000xP-3O; Thu, 20 Jul 2023 22:00:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=ei7UL5AwLAUDYJsz5uKVjU7P0SgMoXbKScbQzPP/lXI=; b=mTDSyHVWVM0yjMNnIaSUX+3hhZ
	4P9XEFYnOJyZAa5hr9CojSHwqxxMdR+mVgFoKY2fQnWR976yJKm2PtroQhHSBLIXrVAoG/CHPQKmI
	OD4Y8Q29O5ozV3Kk0O+JkH0u/EDdtvlh9mNp7hJivw9pKwe/V2wQGTjc/9FV+ewfuBIU=;
Message-ID: <f962d1ce-4cde-e1b5-59b3-5e71d2e83109@xen.org>
Date: Thu, 20 Jul 2023 23:00:44 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH 0/8] Make PDX compression optional
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Alejandro,

Great work!

On 17/07/2023 17:03, Alejandro Vallejo wrote:
> Currently there's a CONFIG_HAS_PDX Kconfig option, but it's impossible to
> disable it because the whole codebase performs unconditional
> compression/decompression operations on addresses. This has the
> unfortunate side effect that systems without a need for compression still
> have to pay the performance impact of juggling bits on every pfn<->pdx
> conversion (this requires reading several global variables). This series
> attempts to:
Just as a datapoint. I applied this to a tree with Live-Update support. 
 From the basic test I did, this is reducing the downtime by 10% :).

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 22:05:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 22:05:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566751.886006 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMbm2-0005wW-A0; Thu, 20 Jul 2023 22:05:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566751.886006; Thu, 20 Jul 2023 22:05:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMbm2-0005wP-7B; Thu, 20 Jul 2023 22:05:26 +0000
Received: by outflank-mailman (input) for mailman id 566751;
 Thu, 20 Jul 2023 22:05:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DC1w=DG=gmail.com=christopher.w.clark@srs-se1.protection.inumbo.net>)
 id 1qMbm1-0005wJ-6K
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 22:05:25 +0000
Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com
 [2a00:1450:4864:20::12e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 865c2fd5-2749-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 00:05:23 +0200 (CEST)
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-4fb7769f15aso2043224e87.0
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 15:05:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 865c2fd5-2749-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689890723; x=1690495523;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=TzsCW0WE4lk1/FbuZcfGinVOAEgKPnTV/Hny/9okUvE=;
        b=g39Ezf+/VACCpycYMs+HzXqzxq5Vg9TJXDXvEVZUEuzoMKM28fDqzlJDd7pRmhHU0k
         sYfYClyHdfT0vffQi/KZ54cFTvFzij/2NTLkKlNfmGY6Ath5G3mfLkcmwYh+Lw/3Gysf
         v3nfqiYaZVwkcSSQq+miSP2Lzxd+6ciQ09ieoqRnKoOfZovRSCBdt1wn4sxdf3XSNF/9
         E+567qlol/06T4B5M9W1uM8B25hQXUNzR1UChTpKeeHTawxfGESD60GC87bDHeY/SbMM
         B4RsY/RZpkkFrdGfSxBFmqE6NOy+r/4mlsV7VxYcGuSTBRzwETIKRnJKPn7gVhu7c07R
         jKMA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689890723; x=1690495523;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=TzsCW0WE4lk1/FbuZcfGinVOAEgKPnTV/Hny/9okUvE=;
        b=WgspoKIWCjzRREae4V/gAu9h0q6QtrQ3e8ENCqEwBJe95Y5XUT+qOj2x845XtPy2uU
         Apia5VI4CIaox3u06rP9Cq4ppQ3ObkmRbvwu5vQ2bWerKAmVpdUdAaQjO2mLyC0Ul/Ge
         r6az/MG2mIuiBE3dh9jjD2m+nh4piaqLYJvr+DgQ3/6uMGAXvyarjM6/SNfdOvdIeDs9
         u7RjEbgkY6d+X5unkcwOVb6spZMOLZnY4/gryxfo1sfKl/aM9HcKnVg2WBnQhPVtRVcN
         UUvhWx1RaOs1eYO7d3frmkra92ChSvs2MDyhaWUX5Z+02Bqduhn6buTPLyeEpfyzWIaI
         NPeA==
X-Gm-Message-State: ABy/qLaq9LGTSWTlyrwaaeDopqNChLHiPCvt99RB5O7m+mFcfSbtTNj6
	Uq8FtzaOTO9CkF8R92wYTyRkYpJuMrqtJBuer/s=
X-Google-Smtp-Source: APBJJlGpuplUY/o6l68vkg9pmFiFFjdbocWOnxYxQh9EoSSTQBJb/16fwj7ynJBGjvpKqFf5NxptdApnIKfeI7PLj5o=
X-Received: by 2002:a05:6512:743:b0:4f8:7568:e94b with SMTP id
 c3-20020a056512074300b004f87568e94bmr4449lfs.56.1689890722858; Thu, 20 Jul
 2023 15:05:22 -0700 (PDT)
MIME-Version: 1.0
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
 <20230701071835.41599-3-christopher.w.clark@gmail.com> <alpine.DEB.2.22.394.2307081134270.761183@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2307081134270.761183@ubuntu-linux-20-04-desktop>
From: Christopher Clark <christopher.w.clark@gmail.com>
Date: Thu, 20 Jul 2023 15:05:10 -0700
Message-ID: <CACMJ4GaVVBGqwGg237qTDU1bnhdGyQaETcxOtRaWMF_MBDEhMw@mail.gmail.com>
Subject: Re: [PATCH 02/10] x86 setup: per-arch bootmodule structure, headroom field
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, 
	Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
	Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, 
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, 
	Bertrand Marquis <bertrand.marquis@arm.com>, Luca Fancellu <luca.fancellu@arm.com>, 
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Rich Persaud <persaur@gmail.com>
Content-Type: multipart/alternative; boundary="0000000000003ecb5b0600f2586d"

--0000000000003ecb5b0600f2586d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sat, Jul 8, 2023 at 12:15=E2=80=AFPM Stefano Stabellini <sstabellini@ker=
nel.org>
wrote:

> On Sat, 1 Jul 2023, Christopher Clark wrote:
> > Next step in incremental work towards adding a non-multiboot internal
> > representation of boot modules, converting the fields being accessed fo=
r
> > the startup calculations.
> >
> > Add a new array of structs for per-boot-module state, though only
> > allocate space for a single array entry in this change since that is al=
l
> > that is required for functionality modified in this patch: moving the
> > headroom field for the image decompression calculation into a new
> > per-arch boot module struct and then using it in x86 dom0 construction.
> >
> > Introduces a per-arch header for x86 for arch-specific boot module
> > structures, and add a member to the common boot module structure for
> > access to it.
> >
> > No functional change intended.
> >
> > Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
> > Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
>
> [...]
>
>
> > diff --git a/xen/arch/x86/include/asm/bootinfo.h
> b/xen/arch/x86/include/asm/bootinfo.h
> > new file mode 100644
> > index 0000000000..a25054f372
> > --- /dev/null
> > +++ b/xen/arch/x86/include/asm/bootinfo.h
> > @@ -0,0 +1,18 @@
> > +#ifndef __ARCH_X86_BOOTINFO_H__
> > +#define __ARCH_X86_BOOTINFO_H__
> > +
> > +struct arch_bootmodule {
> > +    unsigned headroom;
> > +};
> > +
> > +#endif
> > +
> > +/*
> > + * Local variables:
> > + * mode: C
> > + * c-file-style: "BSD"
> > + * c-basic-offset: 4
> > + * tab-width: 4
> > + * indent-tabs-mode: nil
> > + * End:
> > + */
>
> [...]
>
> > diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
> > index 6a7d55d20e..b72ae31a66 100644
> > --- a/xen/include/xen/bootinfo.h
> > +++ b/xen/include/xen/bootinfo.h
> > @@ -3,8 +3,19 @@
> >
> >  #include <xen/types.h>
> >
> > +#ifdef CONFIG_X86
> > +#include <asm/bootinfo.h>
> > +#else
> > +    struct arch_bootmodule { };
> > +#endif
> > +
> > +struct boot_module {
> > +    struct arch_bootmodule *arch;
> > +};
> > +
> >  struct boot_info {
> >      unsigned int nr_mods;
> > +    struct boot_module *mods;
>
> Also here you already made the effort of using the same data structures
> we use on ARM, you might as well use the same names too. Otherwise when
> we try to use them on ARM it will require a rename somewhere.
>

Thanks for the review. We consciously made an effort to derive from the Arm
data structures to ensure that we're able to support the logic that Arm
needs. Arm's bootmodules were a
good start as a means for abstraction, and the design for hyperlaunch was
striving to abstract even further to incorporate x86-ism and hopefully
enough foresight for PPC and Risc-V.

Christopher


>
> >  };
> >
> >  #endif
> > --
> > 2.25.1
> >
> >
>

--0000000000003ecb5b0600f2586d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Sat, Jul 8, 2023 at 12:15=E2=80=AF=
PM Stefano Stabellini &lt;<a href=3D"mailto:sstabellini@kernel.org">sstabel=
lini@kernel.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad=
ding-left:1ex">On Sat, 1 Jul 2023, Christopher Clark wrote:<br>
&gt; Next step in incremental work towards adding a non-multiboot internal<=
br>
&gt; representation of boot modules, converting the fields being accessed f=
or<br>
&gt; the startup calculations.<br>
&gt; <br>
&gt; Add a new array of structs for per-boot-module state, though only<br>
&gt; allocate space for a single array entry in this change since that is a=
ll<br>
&gt; that is required for functionality modified in this patch: moving the<=
br>
&gt; headroom field for the image decompression calculation into a new<br>
&gt; per-arch boot module struct and then using it in x86 dom0 construction=
.<br>
&gt; <br>
&gt; Introduces a per-arch header for x86 for arch-specific boot module<br>
&gt; structures, and add a member to the common boot module structure for<b=
r>
&gt; access to it.<br>
&gt; <br>
&gt; No functional change intended.<br>
&gt; <br>
&gt; Signed-off-by: Christopher Clark &lt;<a href=3D"mailto:christopher.w.c=
lark@gmail.com" target=3D"_blank">christopher.w.clark@gmail.com</a>&gt;<br>
&gt; Signed-off-by: Daniel P. Smith &lt;<a href=3D"mailto:dpsmith@apertusso=
lutions.com" target=3D"_blank">dpsmith@apertussolutions.com</a>&gt;<br>
<br>
[...]<br>
<br>
<br>
&gt; diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/includ=
e/asm/bootinfo.h<br>
&gt; new file mode 100644<br>
&gt; index 0000000000..a25054f372<br>
&gt; --- /dev/null<br>
&gt; +++ b/xen/arch/x86/include/asm/bootinfo.h<br>
&gt; @@ -0,0 +1,18 @@<br>
&gt; +#ifndef __ARCH_X86_BOOTINFO_H__<br>
&gt; +#define __ARCH_X86_BOOTINFO_H__<br>
&gt; +<br>
&gt; +struct arch_bootmodule {<br>
&gt; +=C2=A0 =C2=A0 unsigned headroom;<br>
&gt; +};<br>
&gt; +<br>
&gt; +#endif<br>
&gt; +<br>
&gt; +/*<br>
&gt; + * Local variables:<br>
&gt; + * mode: C<br>
&gt; + * c-file-style: &quot;BSD&quot;<br>
&gt; + * c-basic-offset: 4<br>
&gt; + * tab-width: 4<br>
&gt; + * indent-tabs-mode: nil<br>
&gt; + * End:<br>
&gt; + */<br>
<br>
[...]<br>
<br>
&gt; diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h<b=
r>
&gt; index 6a7d55d20e..b72ae31a66 100644<br>
&gt; --- a/xen/include/xen/bootinfo.h<br>
&gt; +++ b/xen/include/xen/bootinfo.h<br>
&gt; @@ -3,8 +3,19 @@<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 #include &lt;xen/types.h&gt;<br>
&gt;=C2=A0 <br>
&gt; +#ifdef CONFIG_X86<br>
&gt; +#include &lt;asm/bootinfo.h&gt;<br>
&gt; +#else<br>
&gt; +=C2=A0 =C2=A0 struct arch_bootmodule { };<br>
&gt; +#endif<br>
&gt; +<br>
&gt; +struct boot_module {<br>
&gt; +=C2=A0 =C2=A0 struct arch_bootmodule *arch;<br>
&gt; +};<br>
&gt; +<br>
&gt;=C2=A0 struct boot_info {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 unsigned int nr_mods;<br>
&gt; +=C2=A0 =C2=A0 struct boot_module *mods;<br>
<br>
Also here you already made the effort of using the same data structures<br>
we use on ARM, you might as well use the same names too. Otherwise when<br>
we try to use them on ARM it will require a rename somewhere.<br></blockquo=
te><div><br></div><div>Thanks for the review. We consciously made an effort=
 to derive from the Arm data structures to ensure that we&#39;re able to su=
pport the logic that Arm needs. Arm&#39;s bootmodules were a</div>good star=
t as a means for abstraction, and the design for hyperlaunch was striving t=
o abstract even further to incorporate x86-ism and hopefully enough foresig=
ht for PPC and Risc-V.</div><div class=3D"gmail_quote"><br></div><div class=
=3D"gmail_quote">Christopher</div><div class=3D"gmail_quote"><div><br></div=
><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border=
-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
&gt;=C2=A0 };<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 #endif<br>
&gt; -- <br>
&gt; 2.25.1<br>
&gt; <br>
&gt; <br>
</blockquote></div></div>

--0000000000003ecb5b0600f2586d--


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 22:12:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 22:12:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566754.886016 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMbt7-0007ku-WB; Thu, 20 Jul 2023 22:12:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566754.886016; Thu, 20 Jul 2023 22:12:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMbt7-0007kn-TD; Thu, 20 Jul 2023 22:12:45 +0000
Received: by outflank-mailman (input) for mailman id 566754;
 Thu, 20 Jul 2023 22:12:44 +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
 <SRS0=DC1w=DG=gmail.com=christopher.w.clark@srs-se1.protection.inumbo.net>)
 id 1qMbt6-0007kh-H3
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 22:12:44 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8bb0d571-274a-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 00:12:42 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-51e28b299adso1794328a12.2
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 15:12:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8bb0d571-274a-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689891161; x=1690495961;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=fia0k+DTB2r8KZc5nHTVPKsuSqVAuPZDvXVIrBGCUuQ=;
        b=I3QM0is0pCufs9dzrwJap0WY+1FJxhknVOaPDwGUaCJmiFmzAI58894I7+Eh3HaH4j
         Qatzn8iEqtB0Nvt7C300rYveig9KVAlpe7LOPvIQrUDHeDnNH4dY8EyfM423YNgZu0Fo
         mXPrLFYYagk6uDi403ZCAq+qInn7ZVbVQfB9kIni1EEOEUHHSHJm8ViDbR23pqfYvNpJ
         9NxlRF6gButnnSDulDJfoiEpiBH20Dza1ZxpZsZ9UvEcMSiZ4FxzCFzttT/pDgzPtqO4
         xR5apQ2ulFjPKN4WXl8OZtqf4e32U4LET4Zn6NSE1gKciPgkC8QXMf5yspZdAuNTmUs8
         OqfQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689891161; x=1690495961;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=fia0k+DTB2r8KZc5nHTVPKsuSqVAuPZDvXVIrBGCUuQ=;
        b=IyUMHVuAfn6L+CW66xHU2PePc/eutbnckTuf2Z6K/Z+ZcPCWUMLsCbF6KEY2KzCBeW
         zANX55STIa8/mf7awL8TjKfvnTITMSqvUukS2PVX49MYz8KFht0PECCGFklQVtNLDQFI
         zFTBgkfOryrcpxclws6MEnvNLFe/VTaKfqZXmfjMwmuJXgkfhkY2+6mP6eO4+nT7M1F1
         iSLWPfTumkMOV7UG2f9rbq7n7tDQnZwNZ0AAbjE6+o5cqoFDMND0StUjBQpVmdsWPheu
         MmFgb4lqVJoLZ8Fp6WAAcbMRt9ujEG6t2rPxbtp4QUeZtuPqYAmtj2JUEyeg+dz9uZgz
         s+OQ==
X-Gm-Message-State: ABy/qLYpySQ751mAJ2geG9XntX1uYA7Z0Y/9U2vTJusIcevVsFdTDY7c
	4Fof2skfQU7e5Lh+mR9l6BGypx/X2i9A5ud9ApU=
X-Google-Smtp-Source: APBJJlH4WfnY3J5XCy9VXXweyG9sihM0V+HIbUsb3NEkJmBOZeRBwAYBHM+1tcB3nA29RYNjIh8azrB3n4nFAOXqYdQ=
X-Received: by 2002:aa7:dcc7:0:b0:515:1e50:5498 with SMTP id
 w7-20020aa7dcc7000000b005151e505498mr124474edu.15.1689891161481; Thu, 20 Jul
 2023 15:12:41 -0700 (PDT)
MIME-Version: 1.0
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
 <20230701071835.41599-4-christopher.w.clark@gmail.com> <alpine.DEB.2.22.394.2307081144340.761183@ubuntu-linux-20-04-desktop>
 <CACMJ4GYE6PW1SY35dhs4XkXd9ru25igrvMCrh4pJMWEBNNz0YQ@mail.gmail.com>
In-Reply-To: <CACMJ4GYE6PW1SY35dhs4XkXd9ru25igrvMCrh4pJMWEBNNz0YQ@mail.gmail.com>
From: Christopher Clark <christopher.w.clark@gmail.com>
Date: Thu, 20 Jul 2023 15:12:29 -0700
Message-ID: <CACMJ4Gb_ZwKSjP7qzfQj98YQjSpBdFuWzeGQJUNNqst0GdXCOw@mail.gmail.com>
Subject: Re: [PATCH 03/10] x86 setup: change bootstrap map to accept new boot
 module structures
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, 
	Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
	Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, 
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, 
	Bertrand Marquis <bertrand.marquis@arm.com>, Luca Fancellu <luca.fancellu@arm.com>, 
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Rich Persaud <persaur@gmail.com>
Content-Type: multipart/alternative; boundary="00000000000063a6a20600f272fd"

--00000000000063a6a20600f272fd
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 13, 2023 at 11:51=E2=80=AFPM Christopher Clark <
christopher.w.clark@gmail.com> wrote:

>
>
> On Sat, Jul 8, 2023 at 11:47=E2=80=AFAM Stefano Stabellini <sstabellini@k=
ernel.org>
> wrote:
>
>> On Sat, 1 Jul 2023, Christopher Clark wrote:
>> > To convert the x86 boot logic from multiboot to boot module structures=
,
>> > change the bootstrap map function to accept a boot module parameter.
>> >
>> > To allow incremental change from multiboot to boot modules across all
>> > x86 setup logic, provide a temporary inline wrapper that still accepts=
 a
>> > multiboot module parameter and use it where necessary. The wrapper is
>> > placed in a new arch/x86 header <asm/boot.h> to avoid putting a static
>> > inline function into an existing header that has no such functions
>> > already. This new header will be expanded with additional functions in
>> > subsequent patches in this series.
>> >
>> > No functional change intended.
>> >
>> > Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
>> > Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
>> >
>>
>> [...]
>>
>> > diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
>> > index b72ae31a66..eb93cc3439 100644
>> > --- a/xen/include/xen/bootinfo.h
>> > +++ b/xen/include/xen/bootinfo.h
>> > @@ -10,6 +10,9 @@
>> >  #endif
>> >
>> >  struct boot_module {
>> > +    paddr_t start;
>> > +    size_t size;
>>
>> I think size should be paddr_t (instead of size_t) to make sure it is
>> the right size on both 64-bit and 32-bit architectures that support
>> 64-bit addresses.
>>
>
> Thanks, that explanation does make sense - ack.
>

I've come back to reconsider this as it doesn't seem right to me to store a
non-address value (which this will always be) in a type explicitly defined
to hold an address: addresses may have architectural alignment requirements
whereas a size value is just a number of bytes so will not. The point of a
size_t value is that size_t is defined to be large enough to hold the size
of any valid object in memory, so I think this was right as-is.

Christopher



>
> Christopher
>
>
>>
>>
>> >      struct arch_bootmodule *arch;
>> >  };
>>
>

--00000000000063a6a20600f272fd
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jul 13, 2023 at 11:51=E2=80=
=AFPM Christopher Clark &lt;<a href=3D"mailto:christopher.w.clark@gmail.com=
">christopher.w.clark@gmail.com</a>&gt; wrote:<br></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><br></di=
v><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On S=
at, Jul 8, 2023 at 11:47=E2=80=AFAM Stefano Stabellini &lt;<a href=3D"mailt=
o:sstabellini@kernel.org" target=3D"_blank">sstabellini@kernel.org</a>&gt; =
wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sat, 1=
 Jul 2023, Christopher Clark wrote:<br>
&gt; To convert the x86 boot logic from multiboot to boot module structures=
,<br>
&gt; change the bootstrap map function to accept a boot module parameter.<b=
r>
&gt; <br>
&gt; To allow incremental change from multiboot to boot modules across all<=
br>
&gt; x86 setup logic, provide a temporary inline wrapper that still accepts=
 a<br>
&gt; multiboot module parameter and use it where necessary. The wrapper is<=
br>
&gt; placed in a new arch/x86 header &lt;asm/boot.h&gt; to avoid putting a =
static<br>
&gt; inline function into an existing header that has no such functions<br>
&gt; already. This new header will be expanded with additional functions in=
<br>
&gt; subsequent patches in this series.<br>
&gt; <br>
&gt; No functional change intended.<br>
&gt; <br>
&gt; Signed-off-by: Christopher Clark &lt;<a href=3D"mailto:christopher.w.c=
lark@gmail.com" target=3D"_blank">christopher.w.clark@gmail.com</a>&gt;<br>
&gt; Signed-off-by: Daniel P. Smith &lt;<a href=3D"mailto:dpsmith@apertusso=
lutions.com" target=3D"_blank">dpsmith@apertussolutions.com</a>&gt;<br>
&gt; <br>
<br>
[...]<br>
<br>
&gt; diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h<b=
r>
&gt; index b72ae31a66..eb93cc3439 100644<br>
&gt; --- a/xen/include/xen/bootinfo.h<br>
&gt; +++ b/xen/include/xen/bootinfo.h<br>
&gt; @@ -10,6 +10,9 @@<br>
&gt;=C2=A0 #endif<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 struct boot_module {<br>
&gt; +=C2=A0 =C2=A0 paddr_t start;<br>
&gt; +=C2=A0 =C2=A0 size_t size;<br>
<br>
I think size should be paddr_t (instead of size_t) to make sure it is<br>
the right size on both 64-bit and 32-bit architectures that support<br>
64-bit addresses.<br></blockquote><div><br></div><div>Thanks, that explanat=
ion does make sense - ack.</div></div></div></blockquote><div><br></div><di=
v>I&#39;ve come back to reconsider this as it doesn&#39;t seem right to me =
to store a non-address value (which this will always be) in a type explicit=
ly defined to hold an address: addresses may have architectural=C2=A0alignm=
ent requirements whereas a size value is just a number of bytes so will not=
. The point of a size_t value is that size_t is defined to be large enough =
to hold the size of any valid object in memory, so I think this was right a=
s-is.</div><div><br></div><div>Christopher</div><div><br></div><div>=C2=A0<=
/div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bo=
rder-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><di=
v class=3D"gmail_quote"><div><br></div><div>Christopher</div><div>=C2=A0</d=
iv><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bord=
er-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 struct arch_bootmodule *arch;<br>
&gt;=C2=A0 };<br>
</blockquote></div></div>
</blockquote></div></div>

--00000000000063a6a20600f272fd--


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 22:13:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 22:13:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566758.886026 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMbtl-0008IR-Bl; Thu, 20 Jul 2023 22:13:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566758.886026; Thu, 20 Jul 2023 22:13:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMbtl-0008IK-8s; Thu, 20 Jul 2023 22:13:25 +0000
Received: by outflank-mailman (input) for mailman id 566758;
 Thu, 20 Jul 2023 22:13:23 +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
 <SRS0=kV2r=DG=citrix.com=prvs=558cdb244=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qMbtj-0008IA-Is
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 22:13:23 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a1c39dab-274a-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 00:13:20 +0200 (CEST)
Received: from mail-mw2nam04lp2171.outbound.protection.outlook.com (HELO
 NAM04-MW2-obe.outbound.protection.outlook.com) ([104.47.73.171])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 20 Jul 2023 18:13:17 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by BN8PR03MB4947.namprd03.prod.outlook.com (2603:10b6:408:7b::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.26; Thu, 20 Jul
 2023 22:13:15 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::ea9c:844:91b8:a780%5]) with mapi id 15.20.6609.026; Thu, 20 Jul 2023
 22:13:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a1c39dab-274a-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689891200;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=RmjLTghnezze+nyOnyPG/c/N8Q3wwOZyAB0bPZaALzU=;
  b=N87rNx6DSx/oEMoHd0kHtXgwr2zDGfg74viI3VbvlzmkywUWgD1Bzkvx
   /9tS4/X+Njp5d5zCQbEuSjqkhP69K+soPOD93iJDJjJp4+z7BlMEMhuHN
   Xz/pE0CRXrv2oCZt0m6n0IFntfLrbIampPT0uvV/OpQ2khxKLuiV36vqa
   c=;
X-IronPort-RemoteIP: 104.47.73.171
X-IronPort-MID: 116942674
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:Hdl6NK894CnCIZgnwreNDrUDJn+TJUtcMsCJ2f8bNWPcYEJGY0x3n
 zAcXmqOP/jcN2qhLo0nPoSxpEwDsZ/RmtRnSVBupCE8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s
 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk
 d7pqojUNUTNNwRcawr40Ird7ks21BjOkGlA5AdmOqoT5AW2e0Q9V/rzG4ngdxMUfaEMdgKKb
 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk
 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDkkex
 fcTJWkOVCrTpOWz6u/rCcUzmJoKeZyD0IM34hmMzBn/JNN+HdXmfP+P4tVVmjAtmspJAPDSI
 dIDbiZiZwjBZBsJPUoLDJU5n6GjgXyXnz9w8QrJ4/ZopTeIilUuidABM/KMEjCObexTklyVu
 STt+GPhDwtBHNee1SCE4jSngeqncSbTAdtMReHiqKE26LGV7nA4JSYRVXuBm9WgrE6ueZVbE
 hIf2yV7+MDe82TuFLERRSaQomOAvxMac8pdFas98g7l4qPQ7gSQAGQeSXhfYdgiuc0xbTcu0
 UKF2djuAFRHoLCTDH6Q6LqQhTezIjQOa38PYzceSgkI6MWlp5s85jrNRNt+FK++jvXuBCr9h
 TuNqUAWnK4PhMQG06G6+1HvgD+2oJXNCAkv6W3/QWaN/g5/Iom/aOSA41XB8exJKorfS1Cbp
 WUFgOCX9uVIBpaI/ASzR+EKEKCs9uyyGjTWil5yHLEs7z2ovXWkeOhtDCpWIU5oNoMBZmXva
 UqL5QdJvsYMZT2tcLN9ZJ+3B4Iy16/8GN/5V/fSKN1Tfpx2cwzB9yZrDaKN413QfIEXuflXE
 f+mnQyEVB721YwPIOKKetog
IronPort-HdrOrdr: A9a23:WFnsfaPKn44MQMBcTt2jsMiBIKoaSvp037BL7TETdfQ2Gvbzqy
 nKppkmPHPP5wr5OktNpTnaAtjjfZq0z/ccirX5W43NYOCMgguVxe9ZjLff/w==
X-Talos-CUID: =?us-ascii?q?9a23=3A9BTalGhtS5h48mzHnn6qMUeJlDJuIk3Wx3qJIHW?=
 =?us-ascii?q?CWUVuTZfIGRy8p706up87?=
X-Talos-MUID: 9a23:yHWV4goFmRS97/ijLXkezy1JGfxv44SUMmwUt5UWmY6ADHJ7GjjI2Q==
X-IronPort-AV: E=Sophos;i="6.01,219,1684814400"; 
   d="scan'208";a="116942674"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=GRqM/LRmQDSyENmh/bpsv86P85e1ZoxDnB+D1ZW/CRbNpMVVd707HbFmHgwLrFFuxFGVuJiumu2+o6zJN7EVf0xHih2cTCVxyzUG/QASeRLFDnvTTjbaF/8jkFqyVFS+puNO8G+9ZL68bNVCBDUiDqSiXlJTK61KSbMRP8v5PhMWckffxxAMArWVVkMe8KN/2kVv+VEyciwmdww3WxVaRMcbSrCRytkPnVML6C8RVpvIYTtNpkI+flNxYIUBldoDjbsY+hYi8dCM5Nr2N+cesvgY4/sYKr4WKOo0jiZj7sYmjAE1h5eCjOnvfILE3+h0P84RyICaLXqSAjhWik0k+A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=RmjLTghnezze+nyOnyPG/c/N8Q3wwOZyAB0bPZaALzU=;
 b=iSsfsOv1GJntJi/h6eiZ611IyZYU35kH1Jv/nY/an/Kl/dUUgq0cCqdWCIetP0GF+yU8SloaFd3Gwk5RF+CCGI3Do3dBiB42WedoO0IBY6dLIv85fW5eqF+HymIuCMoksl9Fyl+0nKECoe2qNibBGWwy63TVnzE27VY0QIWQ0YhLiDXiChmS7YRqEkBUlLEyZ121wzzCtC9Cdek5IawLMO+LPXuE9gfMu2WG6Tdgo0ciEh6FjDuNnaofOd+/mKBVYTfdYHzCP0V0bAVW0fP1qebp2843j1KS7SnkJxy4R9PRJ6azW856v5Y7W7fUMQSq/0mEvjqJEcgdScOQBG4tPg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RmjLTghnezze+nyOnyPG/c/N8Q3wwOZyAB0bPZaALzU=;
 b=C3B3jIVRG6edZEB7R957LsJlNj253UP1Xpy7V+GAwuyQTxEeJ3iB2hL1Vt1Us3M2BBNPp2zW+l95DWSMx/JOaG2l3va75wXX5cPdiR0B1P7qE2dgQJrZfjJ4ZmERoM7sNLiL9jwAhD4697Xnrjlcv7Qo2ZMDIzZfvOUrw6eO01o=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <e7e05885-01e6-4e65-023b-2361cb84bb8c@citrix.com>
Date: Thu, 20 Jul 2023 23:13:07 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH 0/8] Make PDX compression optional
Content-Language: en-GB
To: Julien Grall <julien@xen.org>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: George Dunlap <george.dunlap@citrix.com>, Jan Beulich
 <jbeulich@suse.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <f962d1ce-4cde-e1b5-59b3-5e71d2e83109@xen.org>
In-Reply-To: <f962d1ce-4cde-e1b5-59b3-5e71d2e83109@xen.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0257.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:194::10) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|BN8PR03MB4947:EE_
X-MS-Office365-Filtering-Correlation-Id: 0f738746-4a2f-4e46-0c32-08db896e830a
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Jt5N5lGM9wgvUY34uKW1YaIykOH0aVQVki0xC9podFLu3QAb796z1WfLbSHCyPCMws+ZKY95YxRDtP7pGMghcYEmO+VHJFWfQrCuuJXncPeHs5E4PCCp/KxXsRrfrl2qQQdsMptaHa8ZDwaOc1AOds89ghBwoVUpoRXQo0q1UcjxqawMQbLRFtb3ULQEvSMjmbbSQ3P+czeb2I/6ALrt3ukAgoOqP/K3fJ3eZDfidb85FZg21icMUXUxrxpgiUOFrP5TUTPXgPUN+xwSUjvw+AcVnBA5opvnKqB//Dk5Q0GnQTAwPHagzYm8U2aGYZyo3lS7AbPyKbsEnWYcPgpxfed59Rb8QZkurypFmlG1hKNQYW0GnVPA3+uygZ7ME1PszflyY5+SNKHu/cs8I6eSvlAm2E6UmDhgULZtOIKhUPGQ730B8AN+DocpAZCaWRSX3X/YAWXC8iwxMKuWnC314p2+W3AP69vGBLDYVjAppAOiT59ullDVBqvKD6IkwxwkK9WoCy2AknF4EOpLieWFtQDLmMOGUQaKuY7f4PVLlYwhirjkw1wDNtrxbt58UoFV0fy0bhBHLilxdp0T5ngCnvfXZJowTpUmUXbSGTv227sFS5L60kJg7ibZnv9J2yuctY1V9oEzexYnBxGLt1peVw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(39860400002)(136003)(376002)(346002)(451199021)(2906002)(83380400001)(2616005)(86362001)(31696002)(36756003)(82960400001)(38100700002)(41300700001)(53546011)(6506007)(107886003)(6486002)(66476007)(66556008)(66946007)(316002)(4326008)(186003)(26005)(6666004)(6512007)(478600001)(7416002)(8936002)(8676002)(54906003)(5660300002)(31686004)(110136005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?S1oxMWl0bXNBK285YjdsbCsvUzFseTlPcmtnVEtUMVl0cWhuRkJzVEJsNFFq?=
 =?utf-8?B?WlRJdlZWeS82LzdMMDVsT1RCQXR0RmFO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kaOZl1n2XHLbi3SpRSucrHGpGzqriYcfw0MENUsqxc3fDoxTAS+O6oYc7QS0Julpeq7r7BDNdPUg7ZGeGZ37OU7srFpcL2m9R6EuARDT2Zy1tETDy7lrTkj8uBjRIuHfHRCxmmjsxTs/zEGJnKovvKzrbNE8IM78di/Q+T01571/xEc/5G0Rib+ypA1TZM51RqeVRV22bwIW6DNuxXeuCsQjwbGitV/Tu4gvvPFJPoAYPLpru2lqmKb9c2WPMfnrEyfCYqrvgMGQOdedjpFbxTpiJZCKbv5LQQHHhI9kkQ/bRFBkrmgocwZWgvjpGDNDUMFu6nVTo2OSOa5ozLo61QPzOge1rvfMmybLMuc1X0WNMOCJC2II0Kpk36ma/u0/0=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0f738746-4a2f-4e46-0c32-08db896e830a
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 22:13:14.3948
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: z+dzlRDa1J+AWk8YW2XExlmXM05SEF7jDUFcTrHYUHzWVdGai4/1hiFObuWkfr5WwRF5JFWzXmfg11PlZ3kAQyAmrXQKE9jgNJGtCl1Pr7g=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR03MB4947

On 20/07/2023 11:00 pm, Julien Grall wrote:
> Hi Alejandro,
>
> Great work!
>
> On 17/07/2023 17:03, Alejandro Vallejo wrote:
>> Currently there's a CONFIG_HAS_PDX Kconfig option, but it's
>> impossible to
>> disable it because the whole codebase performs unconditional
>> compression/decompression operations on addresses. This has the
>> unfortunate side effect that systems without a need for compression
>> still
>> have to pay the performance impact of juggling bits on every pfn<->pdx
>> conversion (this requires reading several global variables). This series
>> attempts to:
> Just as a datapoint. I applied this to a tree with Live-Update
> support. From the basic test I did, this is reducing the downtime by
> 10% :).

I'm not surprised in the slightest.

We've had many cases that prove that compression (of 0 bits, on all x86
systems) is a disaster perf wise, and its used in pretty much every
fastpath in Xen.

Look no further than c/s 564d261687c and the 10% improvements in general
PV runtime too, and that was optimising away one single instance in one
single fastpath.

It's also why I'm not entertaining the concept of leaving it active or
selectable on x86.

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 22:19:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 22:19:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566761.886036 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMbzl-0000vg-Um; Thu, 20 Jul 2023 22:19:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566761.886036; Thu, 20 Jul 2023 22:19:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMbzl-0000vZ-RG; Thu, 20 Jul 2023 22:19:37 +0000
Received: by outflank-mailman (input) for mailman id 566761;
 Thu, 20 Jul 2023 22:19:37 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMbzl-0000vP-FT; Thu, 20 Jul 2023 22:19:37 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMbzl-0001Z0-6e; Thu, 20 Jul 2023 22:19:37 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMbzk-0005WF-Qx; Thu, 20 Jul 2023 22:19:36 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMbzk-0003Tq-QR; Thu, 20 Jul 2023 22:19:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=q8HfO8iqhr1Diqn2QHZtXDSeATZrkaZ19N2MFuX38WI=; b=DnxV36+yAu0ullRBWZFdp7+eBM
	eQIg6uWsnht0Fefs6Y9rZyyIMtIeWYvAsm4Kx4l6DYKN4JojgXtxZuhxUER2AbqrJ8lkg2czjntuX
	kroM5SJTBBq15Mt9mt4gkZES3QrtutJX9g2V2tIoZfAi3LlPip4X4NSp3sjHiz54fLsw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181937-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181937: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=c6b512962e92ae54a895bdfd2147abaf2c9e3e22
X-Osstest-Versions-That:
    ovmf=b2de9ec5a759aa4a7ac029cda9079dce077bf856
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 20 Jul 2023 22:19:36 +0000

flight 181937 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181937/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 c6b512962e92ae54a895bdfd2147abaf2c9e3e22
baseline version:
 ovmf                 b2de9ec5a759aa4a7ac029cda9079dce077bf856

Last test of basis   181922  2023-07-20 08:11:06 Z    0 days
Testing same since   181937  2023-07-20 20:42:43 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Kun Qin <kuqin12@gmail.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   b2de9ec5a7..c6b512962e  c6b512962e92ae54a895bdfd2147abaf2c9e3e22 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 22:29:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 22:29:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566766.886045 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMc9M-0002nY-QC; Thu, 20 Jul 2023 22:29:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566766.886045; Thu, 20 Jul 2023 22:29:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMc9M-0002nR-N8; Thu, 20 Jul 2023 22:29:32 +0000
Received: by outflank-mailman (input) for mailman id 566766;
 Thu, 20 Jul 2023 22:29:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMc9L-0002nL-Fb
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 22:29:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMc9K-0001ij-2S; Thu, 20 Jul 2023 22:29:30 +0000
Received: from 54-240-197-239.amazon.com ([54.240.197.239]
 helo=[192.168.24.131]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMc9J-0001wo-Pn; Thu, 20 Jul 2023 22:29:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=8vuh8PsummUMnmp5Efaj61l3oeghV+IPWTihleeYVEs=; b=fnTVUNlyVH1TuOHDd7uIbyqXT1
	sPqInUGPI6nS0b3vKVTEOtKdmLh/E/C0YnbrcRkZZ1WDZPpQwCoVeTasTnSTeuY8XSN/HSgpP/pLh
	PQILQDDU5jRUawajA1voQtZFZ83Fr8rXHa8JIZDSHy/X3GP9wAJbj9E+nrjOH5FxwhE8=;
Message-ID: <7289237e-5197-a515-959a-023e62dceb14@xen.org>
Date: Thu, 20 Jul 2023 23:29:27 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v10 04/24] xen/arm: tee: add a primitive FF-A mediator
Content-Language: en-US
To: Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Jens Wiklander <jens.wiklander@linaro.org>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Anthony PERARD <anthony.perard@citrix.com>, Juergen Gross <jgross@suse.com>,
 Wei Liu <wl@xen.org>, Marc Bonnici <Marc.Bonnici@arm.com>,
 Achin Gupta <Achin.Gupta@arm.com>, Andrew Cooper <andrew.cooper3@citrix.com>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-5-jens.wiklander@linaro.org>
 <FE5A2E30-8737-415E-92B2-B6B7B0BF0CCE@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <FE5A2E30-8737-415E-92B2-B6B7B0BF0CCE@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Bertrand,

On 20/07/2023 11:20, Bertrand Marquis wrote:
> Hi Jens,
> 
>> On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> wrote:
>>
>> Adds a FF-A version 1.1 [1] mediator to communicate with a Secure
>> Partition in secure world.
>>
>> This commit brings in only the parts needed to negotiate FF-A version
>> number with guest and SPMC.
>>
>> [1] https://developer.arm.com/documentation/den0077/e
>> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
>> ---
>> xen/arch/arm/include/asm/psci.h    |   4 +
>> xen/arch/arm/include/asm/tee/ffa.h |  35 +++++
>> xen/arch/arm/tee/Kconfig           |  11 ++
>> xen/arch/arm/tee/Makefile          |   1 +
>> xen/arch/arm/tee/ffa.c             | 225 +++++++++++++++++++++++++++++
>> xen/arch/arm/vsmc.c                |  17 ++-
>> xen/include/public/arch-arm.h      |   1 +
>> 7 files changed, 291 insertions(+), 3 deletions(-)
>> create mode 100644 xen/arch/arm/include/asm/tee/ffa.h
>> create mode 100644 xen/arch/arm/tee/ffa.c
>>
>> diff --git a/xen/arch/arm/include/asm/psci.h b/xen/arch/arm/include/asm/psci.h
>> index 832f77afff3a..4780972621bb 100644
>> --- a/xen/arch/arm/include/asm/psci.h
>> +++ b/xen/arch/arm/include/asm/psci.h
>> @@ -24,6 +24,10 @@ void call_psci_cpu_off(void);
>> void call_psci_system_off(void);
>> void call_psci_system_reset(void);
>>
>> +/* Range of allocated PSCI function numbers */
>> +#define PSCI_FNUM_MIN_VALUE                 _AC(0,U)
>> +#define PSCI_FNUM_MAX_VALUE                 _AC(0x1f,U)
>> +
>> /* PSCI v0.2 interface */
>> #define PSCI_0_2_FN32(nr) ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL,             \
>>                                               ARM_SMCCC_CONV_32,               \
>> diff --git a/xen/arch/arm/include/asm/tee/ffa.h b/xen/arch/arm/include/asm/tee/ffa.h
>> new file mode 100644
>> index 000000000000..44361a4e78e4
>> --- /dev/null
>> +++ b/xen/arch/arm/include/asm/tee/ffa.h
>> @@ -0,0 +1,35 @@
>> +/* SPDX-License-Identifier: GPL-2.0-only */
>> +/*
>> + * xen/arch/arm/include/asm/tee/ffa.h
>> + *
>> + * Arm Firmware Framework for ARMv8-A(FFA) mediator
>> + *
>> + * Copyright (C) 2023  Linaro Limited
>> + */
>> +
>> +#ifndef __ASM_ARM_TEE_FFA_H__
>> +#define __ASM_ARM_TEE_FFA_H__
>> +
>> +#include <xen/const.h>
>> +#include <xen/kconfig.h>

None of the headers aside xen/config.h will include xen/kconfig.h. The 
former is included everything from the compiler command line. So I have 
removed it.

>> +
>> +#include <asm/smccc.h>
>> +#include <asm/types.h>
>> +
>> +#define FFA_FNUM_MIN_VALUE              _AC(0x60,U)
>> +#define FFA_FNUM_MAX_VALUE              _AC(0x86,U)
>> +
>> +static inline bool is_ffa_fid(uint32_t fid)
>> +{
>> +    uint32_t fn = fid & ARM_SMCCC_FUNC_MASK;
>> +
>> +    return fn >= FFA_FNUM_MIN_VALUE && fn <= FFA_FNUM_MAX_VALUE;
>> +}
>> +
>> +#ifdef CONFIG_FFA
>> +#define FFA_NR_FUNCS    12
>> +#else
>> +#define FFA_NR_FUNCS    0
>> +#endif
>> +
>> +#endif /*__ASM_ARM_TEE_FFA_H__*/
>> diff --git a/xen/arch/arm/tee/Kconfig b/xen/arch/arm/tee/Kconfig
>> index 392169b2559d..923f08ba8cb7 100644
>> --- a/xen/arch/arm/tee/Kconfig
>> +++ b/xen/arch/arm/tee/Kconfig
>> @@ -8,3 +8,14 @@ config OPTEE
>>   virtualization-enabled OP-TEE present. You can learn more
>>   about virtualization for OP-TEE at
>>   https://optee.readthedocs.io/architecture/virtualization.html
>> +
>> +config FFA
>> + bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
>> + default n
>> + depends on ARM_64
> 
> Even if the tee Makefile is only included if CONFIG_TEE is activated,
> the missing dependency on TEE here allows to select FFA without TEE
> resulting in a config with FFA activated but not compiled in.
> 
> No build error is coming from this, FFA is just not in if selected without TEE.
> 
> Should be:
> 
> depends on ARM_64 && TEE
> 
> I am ok if this is fixed on commit and my R-B kept.

I have fixed it and committed up to patch #9. That said, I think it 
would be best if we have a category TEE where both the OPTEE and FFA 
config is under. This will help to make the menuconfig clearer and avoid 
the "depends TEE".

Bertrand, Jens, can one of you have a look?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 22:29:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 22:29:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566767.886056 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMc9b-000374-2Z; Thu, 20 Jul 2023 22:29:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566767.886056; Thu, 20 Jul 2023 22:29:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMc9a-00036x-W4; Thu, 20 Jul 2023 22:29:46 +0000
Received: by outflank-mailman (input) for mailman id 566767;
 Thu, 20 Jul 2023 22:29:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=1UDO=DG=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMc9a-00035M-8T
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 22:29:46 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ec812541-274c-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 00:29:44 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id EF47661C9A;
 Thu, 20 Jul 2023 22:29:42 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id A15B8C433C8;
 Thu, 20 Jul 2023 22:29:41 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ec812541-274c-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689892182;
	bh=TgyheFyvYk5JtANtG7a6wM/AyLXdTH8s9ZGsYiArDgI=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=cGJYLG+orZdFB8yJGw+Jov/Kt+4F/klCMsA7uH+21JxZw+E/PXqV5T+8RHX/Y/5mN
	 o+EI9mJIYCabtN4gDvxh8GiASv/jznHhbOFBMMSIX21jxtdFgQWWhgpm+xgjBl2Ssz
	 VxmGF10e4AfaY2jkOoNmhE1UFazEaBPtqeXOVkXNlUJg5mWWMTitYqZigBXKKqJhlv
	 SCdBjahwU2JqBV4JKQ1pK3AiyWzdfZ6rnhysIeNgKCPLv1iCWy2YzmD6e4bgywhzxV
	 Ug+R7jUzM1lMC/N1v12fBzFiUIsqSbRVPZ7SlkSzR4T4Kvy+6iKKu5u6PXcz8S7aPo
	 T/06nU+YXLCDQ==
Date: Thu, 20 Jul 2023 15:29:38 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Doug Goldstein <cardoe@cardoe.com>, 
    Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [XEN PATCH] automation: add ECLAIR pipeline
In-Reply-To: <eb5fa852f306790160b967787592553d2fdf3de6.1689887842.git.simone.ballarin@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307201507070.3118466@ubuntu-linux-20-04-desktop>
References: <eb5fa852f306790160b967787592553d2fdf3de6.1689887842.git.simone.ballarin@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 20 Jul 2023, Simone Ballarin wrote:
> Add two pipelines that analyze an ARM64 and a X86_64 build with the
> ECLAIR static analyzer on the guidelines contained in Set1.
> 
> The tool configuration is kept external to the xen repository for
> practical reasons, it will be included in a subsequent phase.
> 
> All commits on the xen-project/xen:staging branch will be analyzed
> and their artifacts will be stored indefinitely; the integration will
> report differential information with respect to the previous analysis.
> 
> All commits on other branches or repositories will be analyzed and
> only the last ten artifacts will be kept; the integration will report
> differential information with respect to the analysis done on the common
> ancestor with xen-project/xen:staging (if available).
> 
> Currently the pipeline variable ENABLE_ECLAIR_BOT is set to "n".
> Doing so disables the generation of comments with the analysis summary
> on the commit threads. The variable can be set to "y" if the a masked
> variable named ECLAIRIT_TOKEN is set with the impersonation token of
> an account with enough privileges to write on all repositories.
> 
> Additionaly any repository should be able to read a masked variable
> named WTOKEN with the token provided by BUGSENG.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

Thanks for the patch!

Patchew automatically picked it up from xen-devel and started a pipeline
here:

https://gitlab.com/xen-project/patchew/xen/-/pipelines/939440592

However the eclair-x86_64 job failed with:

ERROR: Uploading artifacts as "archive" to coordinator... 413 Payload
Too Large

Also the eclair-ARM64 job failed but it is not clear to me why.

I think at least initially we should mark the two Eclair jobs with:

  allow_failure: true

until we are sure they work reliably all the time. Otherwise we end up
blocking the whole Xen staging pipeline if we make any mistakes here. We
can remove "allow_failure: true" once we are sure it works well all the
time.


The second thing I noticed is that the build phase didn't start until
the analyze phase was concluded. This is not good because it would
increase the overall time significantly. We need the build/test phases
to start in parallel. To do that you need to add the following change to
this patch:


diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index c401f62d61..f01e2c32bb 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -11,6 +11,7 @@
       - '*.log'
       - '*/*.log'
     when: always
+  needs: []
   except:
     - master
     - smoke



> ---
>  .gitlab-ci.yml                    |  2 ++
>  automation/gitlab-ci/analyze.yaml | 38 +++++++++++++++++++++++++++++++
>  automation/scripts/eclair         | 26 +++++++++++++++++++++
>  3 files changed, 66 insertions(+)
>  create mode 100644 automation/gitlab-ci/analyze.yaml
>  create mode 100755 automation/scripts/eclair
> 
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index c8bd7519d5..ee5430b8b7 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -1,7 +1,9 @@
>  stages:
> +  - analyze
>    - build
>    - test
>  
>  include:
> +  - 'automation/gitlab-ci/analyze.yaml'
>    - 'automation/gitlab-ci/build.yaml'
>    - 'automation/gitlab-ci/test.yaml'
> diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
> new file mode 100644
> index 0000000000..be96d96e71
> --- /dev/null
> +++ b/automation/gitlab-ci/analyze.yaml
> @@ -0,0 +1,38 @@
> +.eclair-analysis:
> +  stage: analyze
> +  tags:
> +    - eclair-analysis
> +    - eclair
> +    - misrac

I would only use 1 tag, eclair-analysis or eclair, up to you


> +  variables:
> +    ECLAIR_OUTPUT_DIR: "ECLAIR_out"
> +    ANALYSIS_KIND: "normal"
> +    ECLAIR_REPORT_URL: "saas.eclairit.com"
> +    ENABLE_ECLAIR_BOT: "n"
> +    AUTOPRBRANCH: "staging"
> +    AUTOPRREPOSITORY: "xen-project/xen"
> +  artifacts:
> +    when: always
> +    paths:
> +      - "${ECLAIR_OUTPUT_DIR}"
> +      - '*.log'
> +    reports:
> +      codequality: gl-code-quality-report.json
> +
> +eclair-x86_64:
> +  extends: .eclair-analysis
> +  variables:
> +    LOGFILE: "eclair-x86_64.log"
> +    VARIANT: "X86_64"
> +    RULESET: "Set1"
> +  script:
> +    - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"

allow_failure: true


> +eclair-ARM64:
> +  extends: .eclair-analysis
> +  variables:
> +    LOGFILE: "eclair-ARM64.log"
> +    VARIANT: "ARM64"
> +    RULESET: "Set1"
> +  script:
> +    - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"

allow_failure: true


> diff --git a/automation/scripts/eclair b/automation/scripts/eclair
> new file mode 100755
> index 0000000000..d7f0845aec
> --- /dev/null
> +++ b/automation/scripts/eclair
> @@ -0,0 +1,26 @@
> +#!/bin/bash -eu
> +
> +# ECLAIR configuration files are maintened by BUGSENG
> +export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no"
> +[ -d ECLAIR_scripts ] || git clone ssh://git@git.bugseng.com/eclair/scripts/XEN ECLAIR_scripts
> +(cd ECLAIR_scripts; git pull --rebase)
> +
> +ECLAIR_DIR=ECLAIR_scripts/ECLAIR
> +ECLAIR_OUTPUT_DIR=$(realpath "${ECLAIR_OUTPUT_DIR}")
> +
> +ECLAIR_scripts/prepare.sh "${VARIANT}"
> +
> +ex=0
> +"${ECLAIR_DIR}/analyze.sh" "${VARIANT}" "${RULESET}" || ex=$?
> +"${ECLAIR_DIR}/action_log.sh" ANALYSIS_LOG \
> +                             "ECLAIR analysis log" \
> +                             "${ECLAIR_OUTPUT_DIR}/ANALYSIS.log" \
> +                             "${ex}"
> +"${ECLAIR_DIR}/action_log.sh" REPORT_LOG \
> +                             "ECLAIR report log" \
> +                             "${ECLAIR_OUTPUT_DIR}/REPORT.log" \
> +                             "${ex}"
> +[ "${ex}" = 0 ] || exit "${ex}"
> +"${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
> +
> +rm -rf "${ECLAIR_OUTPUT_DIR}/.data"
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 22:34:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 22:34:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566773.886065 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMcEK-0004q4-M8; Thu, 20 Jul 2023 22:34:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566773.886065; Thu, 20 Jul 2023 22:34:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMcEK-0004px-JT; Thu, 20 Jul 2023 22:34:40 +0000
Received: by outflank-mailman (input) for mailman id 566773;
 Thu, 20 Jul 2023 22:34:39 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMcEJ-0004pr-2H
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 22:34:39 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMcEI-0001od-3B; Thu, 20 Jul 2023 22:34:38 +0000
Received: from 54-240-197-239.amazon.com ([54.240.197.239]
 helo=[192.168.24.131]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMcEH-0002EY-TI; Thu, 20 Jul 2023 22:34:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=fJRcYabS2lk4HLM2SyiLqij6GQwimGvrDIS/QYNFSDg=; b=Ra+XWXt0B4lxOgEf1PzBJ0L67U
	8VvkLRh6asJwgvlFHPE9sYfvzPAqg1yp3LkE5mDW9NG3OaYKqtKgeHImOeueVqHY5dGAj4O+JSQet
	xUB1XyHs+3bF2f7emCWT7iPJIu5+yQQLJ3pHBjOGEYBOyReBCssdIbdM9ylAcmPT8uqI=;
Message-ID: <6e858280-c778-883c-0f8d-2afa737232fd@xen.org>
Date: Thu, 20 Jul 2023 23:34:36 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH] tools/xenstore: fix XSA-417 patch
Content-Language: en-US
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230720150459.31111-1-jgross@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230720150459.31111-1-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 20/07/2023 16:04, Juergen Gross wrote:
> The fix for XSA-417 had a bug: domain_alloc_permrefs() will not return
> a negative value in case of an error, but a plain errno value.
> 
> Note this is not considered to be a security issue, as the only case
> where domain_alloc_permrefs() will return an error is a failed memory
> allocation. As a guest should not be able to drive Xenstore out of
> memory, this is NOT a problem a guest can trigger at will.
> 
> Fixes: ab128218225d ("tools/xenstore: fix checking node permissions")
> Signed-off-by: Juergen Gross <jgross@suse.com>

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 22:34:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 22:34:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566774.886076 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMcEW-0005BB-UY; Thu, 20 Jul 2023 22:34:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566774.886076; Thu, 20 Jul 2023 22:34:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMcEW-0005B2-RC; Thu, 20 Jul 2023 22:34:52 +0000
Received: by outflank-mailman (input) for mailman id 566774;
 Thu, 20 Jul 2023 22:34:51 +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
 <SRS0=DC1w=DG=gmail.com=christopher.w.clark@srs-se1.protection.inumbo.net>)
 id 1qMcEU-00057s-Rg
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 22:34:51 +0000
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com
 [2a00:1450:4864:20::134])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a14d28bd-274d-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 00:34:46 +0200 (CEST)
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-4fb77f21c63so2092365e87.2
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 15:34:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a14d28bd-274d-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689892487; x=1690497287;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=vvJ7EI3mmE/BYwp7MCuVAIIuBB1Lf/bXwOKArDSPpcA=;
        b=pC/SfHx06xZq1BxUdwZ13TGnpYpmV8UE5g17rJtFDOk7j815xAB89QjgixTtupdxG4
         zth8B7bPM5EaIMahxDkhX4DdtpAAFPJaLTibD5mJfDEE2+pHpvMr/znmNpchXsWbhnWA
         xQ2dDQxxd3/Fe1G6O7Eb7Qaqash8bV15WPd1aM2dZZ0YQxB8ie1QDMImddSmS7Xs0Q4u
         /rTH3+p2ag+YT6KGqyWssiySDnA3QJlL5zgWWA8SWUTEFwMtLBhRqfXLljt+WmKFIFpV
         g7Wu/4K+j6SbVsKeK3UvQA7GtrOIUXGxPaiuGGXwALLte3fmYBDJA9eynwimVj6GJ7Tz
         ahfw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689892487; x=1690497287;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=vvJ7EI3mmE/BYwp7MCuVAIIuBB1Lf/bXwOKArDSPpcA=;
        b=SWLzbcyxnMoZTAxb67nMTpWREP82oqJz5TGl7MONCsJiVOc00XW7cRA8ox6cI9SE6/
         fH7vyQGJJWHobydFp2AhmjAvQbe1JAZ+gQfaBHa9+tp8RP+F222EFIcJZwLUWLtNf3kJ
         sN9FBwL0zT5MYK/Ne/0bgPRSNGZJXYgUslfMM7Lfe/VEfxZ8s7jiaXtAou0UPybxzAXY
         pMY82H7uVbztYOrpsHPOGw9BdnzIJQZrc8uZTbM9TDcWvXxP1Lpz9EY5rP3LQicuv8XX
         kfzdwL0mxfg+wDpat+WAaIEbaDxl9peioHfJ1BnPQBrNo+d01eOWcIN852NFXTKCmZrt
         GE2g==
X-Gm-Message-State: ABy/qLZGKQSuMFxIyU7DcMHr6ky3+h71JV13ivuIi3IipD4jAI+oHvRr
	a3IxfoqLdD6Xlcvuj74/k+prusmSq/fWJiGZZa0=
X-Google-Smtp-Source: APBJJlF7HZj9KIQEfwtiA+te2wXHuEJOGKrLeRJuTc/+M4fQ318Vd4o1Aq2XVnWI3KCtROPSvPwQvw83OJmuGi4hHRA=
X-Received: by 2002:a05:6512:2352:b0:4fd:cfeb:4785 with SMTP id
 p18-20020a056512235200b004fdcfeb4785mr42868lfu.53.1689892486908; Thu, 20 Jul
 2023 15:34:46 -0700 (PDT)
MIME-Version: 1.0
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
 <20230701071835.41599-5-christopher.w.clark@gmail.com> <alpine.DEB.2.22.394.2307081149090.761183@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2307081149090.761183@ubuntu-linux-20-04-desktop>
From: Christopher Clark <christopher.w.clark@gmail.com>
Date: Thu, 20 Jul 2023 15:34:35 -0700
Message-ID: <CACMJ4GaYtk=DiR0CCB7e4BZiFoMKzBKGMxVzKfx4UYPDr3wsHQ@mail.gmail.com>
Subject: Re: [PATCH 04/10] x86 setup: porting dom0 construction logic to boot
 module structures
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, 
	Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
	Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, 
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, 
	Bertrand Marquis <bertrand.marquis@arm.com>, Luca Fancellu <luca.fancellu@arm.com>, 
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Rich Persaud <persaur@gmail.com>
Content-Type: multipart/alternative; boundary="0000000000006413430600f2c11a"

--0000000000006413430600f2c11a
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sat, Jul 8, 2023 at 12:15=E2=80=AFPM Stefano Stabellini <sstabellini@ker=
nel.org>
wrote:

> On Sat, 1 Jul 2023, Christopher Clark wrote:
> > Adjust the PV and PVH dom0 construction entry points to take boot modul=
e
> > structures as parameters, and add further fields to the boot module
> > structures to plumb the data needed to support this use. Populate these
> > from the multiboot module data.
> >
> > This change removes multiboot from the PV and PVH dom0 construction
> logic.
> >
> > Introduce and use new inline accessor functions for navigating the boot
> > module structures.
> >
> > The per-boot-module arrays are expanded from singletons to accommodate
> > all modules, up to a static maximum of 64 modules including Xen that ca=
n
> > be accepted from a bootloader to match the previous value from the
> > module map check.
> >
> > The field that identifies the type of a boot module (kernel, ramdisk,
> > etc) is introduced to the common boot module structure and declared as =
a
> > non-enum integer type to allow the field to be of a known-size and so
> > structure can be packed in a subsequent patch in the series, and it wil=
l
> > then be reconciled with the equivalent Arm boot field type.
> >
> > The command line provided by multiboot for each boot module is added
> > directly to the boot_module structure, which is appropriate for this
> > logic just replacing multiboot.
> >
> > The maximum number of boot modules that a bootloader can provide in
> > addition to the Xen hypervisor is preserved from prior logic with the
> > module_map at 63.
> >
> > Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
> > Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
> >
> > ---
> > Changes since v1: patch is a subset of v1 series patches 2 and 3.
> > - The module_map is kept for now since still in use.
> > - Move the static inline functions into a separate dedicated header.
> > - <mm-frame.h> and <compiler.h> replace prior inclusion of <mm.h>
> >   for simpler dependencies.
> >
> >  xen/arch/x86/dom0_build.c             |  10 +-
> >  xen/arch/x86/hvm/dom0_build.c         |  43 +++---
> >  xen/arch/x86/include/asm/boot.h       |  36 +++++
> >  xen/arch/x86/include/asm/bootinfo.h   |  24 +++
> >  xen/arch/x86/include/asm/dom0_build.h |  13 +-
> >  xen/arch/x86/include/asm/setup.h      |   4 +-
> >  xen/arch/x86/pv/dom0_build.c          |  32 ++--
> >  xen/arch/x86/setup.c                  | 206 +++++++++++++++-----------
> >  xen/include/xen/bootinfo.h            |  27 ++++
> >  9 files changed, 254 insertions(+), 141 deletions(-)
> >
> > diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
> > index 9f5300a3ef..42310202a2 100644
> > --- a/xen/arch/x86/dom0_build.c
> > +++ b/xen/arch/x86/dom0_build.c
> > @@ -4,6 +4,7 @@
> >   * Copyright (c) 2002-2005, K A Fraser
> >   */
> >
> > +#include <xen/bootinfo.h>
> >  #include <xen/init.h>
> >  #include <xen/iocap.h>
> >  #include <xen/libelf.h>
> > @@ -562,9 +563,8 @@ int __init dom0_setup_permissions(struct domain *d)
> >      return rc;
> >  }
> >
> > -int __init construct_dom0(struct domain *d, const module_t *image,
> > -                          unsigned long image_headroom, module_t
> *initrd,
> > -                          char *cmdline)
> > +int __init construct_dom0(struct domain *d, const struct boot_module
> *image,
> > +    struct boot_module *initrd, char *cmdline)
> >  {
> >      int rc;
> >
> > @@ -576,9 +576,9 @@ int __init construct_dom0(struct domain *d, const
> module_t *image,
> >      process_pending_softirqs();
> >
> >      if ( is_hvm_domain(d) )
> > -        rc =3D dom0_construct_pvh(d, image, image_headroom, initrd,
> cmdline);
> > +        rc =3D dom0_construct_pvh(d, image, initrd, cmdline);
> >      else if ( is_pv_domain(d) )
> > -        rc =3D dom0_construct_pv(d, image, image_headroom, initrd,
> cmdline);
> > +        rc =3D dom0_construct_pv(d, image, initrd, cmdline);
> >      else
> >          panic("Cannot construct Dom0. No guest interface available\n")=
;
> >
> > diff --git a/xen/arch/x86/hvm/dom0_build.c
> b/xen/arch/x86/hvm/dom0_build.c
> > index 56fe89632b..c094863bb8 100644
> > --- a/xen/arch/x86/hvm/dom0_build.c
> > +++ b/xen/arch/x86/hvm/dom0_build.c
> > @@ -8,9 +8,9 @@
> >   */
> >
> >  #include <xen/acpi.h>
> > +#include <xen/bootinfo.h>
> >  #include <xen/init.h>
> >  #include <xen/libelf.h>
> > -#include <xen/multiboot.h>
> >  #include <xen/pci.h>
> >  #include <xen/softirq.h>
> >
> > @@ -530,14 +530,13 @@ static paddr_t __init find_memory(
> >      return INVALID_PADDR;
> >  }
> >
> > -static int __init pvh_load_kernel(struct domain *d, const module_t
> *image,
> > -                                  unsigned long image_headroom,
> > -                                  module_t *initrd, void *image_base,
> > -                                  char *cmdline, paddr_t *entry,
> > -                                  paddr_t *start_info_addr)
> > +static int __init pvh_load_kernel(
> > +    struct domain *d, const struct boot_module *image,
> > +    struct boot_module *initrd, void *image_base, char *cmdline,
> paddr_t *entry,
> > +    paddr_t *start_info_addr)
> >  {
> > -    void *image_start =3D image_base + image_headroom;
> > -    unsigned long image_len =3D image->mod_end;
> > +    void *image_start =3D image_base + image->arch->headroom;
> > +    unsigned long image_len =3D image->size;
> >      struct elf_binary elf;
> >      struct elf_dom_parms parms;
> >      paddr_t last_addr;
> > @@ -546,7 +545,7 @@ static int __init pvh_load_kernel(struct domain *d,
> const module_t *image,
> >      struct vcpu *v =3D d->vcpu[0];
> >      int rc;
> >
> > -    if ( (rc =3D bzimage_parse(image_base, &image_start, image_headroo=
m,
> > +    if ( (rc =3D bzimage_parse(image_base, &image_start,
> image->arch->headroom,
> >                               &image_len)) !=3D 0 )
> >      {
> >          printk("Error trying to detect bz compressed kernel\n");
> > @@ -594,7 +593,7 @@ static int __init pvh_load_kernel(struct domain *d,
> const module_t *image,
> >       * simplify it.
> >       */
> >      last_addr =3D find_memory(d, &elf, sizeof(start_info) +
> > -                            (initrd ? ROUNDUP(initrd->mod_end,
> PAGE_SIZE) +
> > +                            (initrd ? ROUNDUP(initrd->size, PAGE_SIZE)=
 +
> >                                        sizeof(mod)
> >                                      : 0) +
> >                              (cmdline ? ROUNDUP(strlen(cmdline) + 1,
> > @@ -608,8 +607,8 @@ static int __init pvh_load_kernel(struct domain *d,
> const module_t *image,
> >
> >      if ( initrd !=3D NULL )
> >      {
> > -        rc =3D hvm_copy_to_guest_phys(last_addr,
> mfn_to_virt(initrd->mod_start),
> > -                                    initrd->mod_end, v);
> > +        rc =3D hvm_copy_to_guest_phys(last_addr,
> maddr_to_virt(initrd->start),
> > +                                    initrd->size, v);
> >          if ( rc )
> >          {
> >              printk("Unable to copy initrd to guest\n");
> > @@ -617,11 +616,11 @@ static int __init pvh_load_kernel(struct domain
> *d, const module_t *image,
> >          }
> >
> >          mod.paddr =3D last_addr;
> > -        mod.size =3D initrd->mod_end;
> > -        last_addr +=3D ROUNDUP(initrd->mod_end, elf_64bit(&elf) ? 8 : =
4);
> > -        if ( initrd->string )
> > +        mod.size =3D initrd->size;
> > +        last_addr +=3D ROUNDUP(initrd->size, elf_64bit(&elf) ? 8 : 4);
> > +        if ( initrd->string.len )
> >          {
> > -            char *str =3D __va(initrd->string);
> > +            char *str =3D initrd->string.bytes;
> >              size_t len =3D strlen(str) + 1;
> >
> >              rc =3D hvm_copy_to_guest_phys(last_addr, str, len, v);
> > @@ -1176,10 +1175,9 @@ static void __hwdom_init pvh_setup_mmcfg(struct
> domain *d)
> >      }
> >  }
> >
> > -int __init dom0_construct_pvh(struct domain *d, const module_t *image,
> > -                              unsigned long image_headroom,
> > -                              module_t *initrd,
> > -                              char *cmdline)
> > +int __init dom0_construct_pvh(
> > +    struct domain *d, const struct boot_module *image,
> > +    struct boot_module *initrd, char *cmdline)
> >  {
> >      paddr_t entry, start_info;
> >      int rc;
> > @@ -1209,9 +1207,8 @@ int __init dom0_construct_pvh(struct domain *d,
> const module_t *image,
> >          return rc;
> >      }
> >
> > -    rc =3D pvh_load_kernel(d, image, image_headroom, initrd,
> > -                         bootstrap_map_multiboot(image),
> > -                         cmdline, &entry, &start_info);
> > +    rc =3D pvh_load_kernel(d, image, initrd, bootstrap_map(image),
> cmdline,
> > +                         &entry, &start_info);
> >      if ( rc )
> >      {
> >          printk("Failed to load Dom0 kernel\n");
> > diff --git a/xen/arch/x86/include/asm/boot.h
> b/xen/arch/x86/include/asm/boot.h
> > index 10b17f12b2..bcf4f2e2e3 100644
> > --- a/xen/arch/x86/include/asm/boot.h
> > +++ b/xen/arch/x86/include/asm/boot.h
> > @@ -19,6 +19,42 @@ static inline void *bootstrap_map_multiboot(const
> module_t *mod)
> >      return bootstrap_map(&bm);
> >  }
> >
> > +static inline unsigned long bootmodule_index(
> > +    const struct boot_info *info, bootmod_type_t bootmod_type,
> > +    unsigned long start)
> > +{
> > +    for ( ; start < info->nr_mods; start++ )
> > +        if ( info->mods[start].bootmod_type =3D=3D bootmod_type )
> > +            return start;
> > +
> > +    return info->nr_mods + 1;
> > +}
> > +
> > +static inline struct boot_module *bootmodule_next(
> > +    const struct boot_info *info, bootmod_type_t bootmod_type)
> > +{
> > +    unsigned long i;
> > +
> > +    for ( i =3D 0; i < info->nr_mods; i++ )
> > +        if ( info->mods[i].bootmod_type =3D=3D bootmod_type )
> > +            return &info->mods[i];
> > +
> > +    return NULL;
> > +}
> > +
> > +static inline void bootmodule_update_start(struct boot_module *bm,
> > +    paddr_t new_start)
> > +{
> > +    bm->start =3D new_start;
> > +    bm->mfn =3D maddr_to_mfn(new_start);
> > +}
> > +
> > +static inline void bootmodule_update_mfn(struct boot_module *bm, mfn_t
> new_mfn)
> > +{
> > +    bm->mfn =3D new_mfn;
> > +    bm->start =3D mfn_to_maddr(new_mfn);
> > +}
> > +
> >  #endif
> >
> >  /*
> > diff --git a/xen/arch/x86/include/asm/bootinfo.h
> b/xen/arch/x86/include/asm/bootinfo.h
> > index a25054f372..30c27980e0 100644
> > --- a/xen/arch/x86/include/asm/bootinfo.h
> > +++ b/xen/arch/x86/include/asm/bootinfo.h
> > @@ -2,9 +2,33 @@
> >  #define __ARCH_X86_BOOTINFO_H__
> >
> >  struct arch_bootmodule {
> > +#define BOOTMOD_FLAG_X86_RELOCATED     1U << 0
> > +    uint32_t flags;
> >      unsigned headroom;
> >  };
> >
> > +struct arch_boot_info {
> > +    uint32_t flags;
> > +#define BOOTINFO_FLAG_X86_CMDLINE      1U << 2
>
> Is this to indicate the presence of the Xen cmdline?
>

Yes; it replaces the previous use of the MBI_CMDLINE flag and is set
whenever MBI_CMDLINE is set when passed from multiboot. This indicates that
a command line has been passed via multiboot.

A comment in the conversion function confirms the intended use of the flag
field:
    /* The BOOTINFO_FLAG_X86_* flags are a 1-1 map to MBI_* */


>
>
> > +#define BOOTINFO_FLAG_X86_MODULES      1U << 3
> > +#define BOOTINFO_FLAG_X86_MEMMAP       1U << 6
> > +#define BOOTINFO_FLAG_X86_LOADERNAME   1U << 9
> > +
> > +    char *boot_loader_name;
> > +
> > +    uint32_t mmap_length;
> > +    paddr_t mmap_addr;
> > +};
> > +
> > +struct __packed mb_memmap {
> > +    uint32_t size;
> > +    uint32_t base_addr_low;
> > +    uint32_t base_addr_high;
> > +    uint32_t length_low;
> > +    uint32_t length_high;
> > +    uint32_t type;
> > +};
> > +
> >  #endif
> >
> >  /*
> > diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
> > index 3b623a4149..f9b04daebd 100644
> > --- a/xen/arch/x86/setup.c
> > +++ b/xen/arch/x86/setup.c
> > @@ -37,6 +37,7 @@
> >  #include <asm/processor.h>
> >  #include <asm/mpspec.h>
> >  #include <asm/apic.h>
> > +#include <asm/boot.h>
> >  #include <asm/msi.h>
> >  #include <asm/desc.h>
> >  #include <asm/paging.h>
> > @@ -59,6 +60,9 @@
> >  #include <asm/prot-key.h>
> >  #include <asm/pv/domain.h>
> >
> > +/* Max number of boot modules a bootloader can provide in addition to
> Xen */
> > +#define MAX_NR_BOOTMODS 63
>
> Call it MAX_MODULES ?
> Like I wrote in the past, you already did the hard work of aligning the
> interfaces, we might as well also use the same names.
>

On the general naming: BOOTMODS is more descriptive in that it indicates an
association between the module and the context it is from: ie. boot, and is
a module handed to the hypervisor by a bootloader (as opposed to say, a
late-loaded module). The term BOOTMOD is also already used within the Arm
source, see: BOOTMOD_MAX_CMDLINE.

On using the same name: following the feedback in the previous round of
reviews this value doesn't include a count of the hypervisor itself; so it
isn't the same thing and so I wouldn't use the same name for it.


>
> [...]
>
> > @@ -1357,12 +1382,14 @@ void __init noreturn __start_xen(unsigned long
> mbi_p)
> >           * respective reserve_e820_ram() invocation below. No need to
> >           * query efi_boot_mem_unused() here, though.
> >           */
> > -        mod[boot_info->nr_mods].mod_start =3D virt_to_mfn(_stext);
> > -        mod[boot_info->nr_mods].mod_end =3D __2M_rwdata_end - _stext;
> > +        bootmodule_update_start(&boot_info->mods[boot_info->nr_mods],
> > +                                virt_to_maddr(_stext));
> > +        boot_info->mods[boot_info->nr_mods].size =3D __2M_rwdata_end -
> _stext;
> >      }
>
> The original code had the end address as "__2M_rwdata_end - _stext"
> while now we have the size as "__2M_rwdata_end - _stext" which is not
> the same?
>

(this was answered by Jan in a previous reply)

>
>
>
> >      boot_info->mods[0].arch->headroom =3D
> > -        bzimage_headroom(bootstrap_map_multiboot(mod), mod->mod_end);
> > +        bzimage_headroom(bootstrap_map(&boot_info->mods[0]),
> > +                         boot_info->mods[0].size);
> >
> >      bootstrap_map(NULL);
> >
>
> [...]
>
>
> > diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
> > index eb93cc3439..2f4284a91f 100644
> > --- a/xen/include/xen/bootinfo.h
> > +++ b/xen/include/xen/bootinfo.h
> > @@ -2,23 +2,50 @@
> >  #define __XEN_BOOTINFO_H__
> >
> >  #include <xen/types.h>
> > +#include <xen/compiler.h>
> > +#include <xen/mm-frame.h>
> >
> >  #ifdef CONFIG_X86
> >  #include <asm/bootinfo.h>
> >  #else
> >      struct arch_bootmodule { };
> > +    struct arch_boot_info { };
> >  #endif
> >
> > +/* Boot module binary type / purpose */
> > +#define BOOTMOD_UNKNOWN     0
> > +#define BOOTMOD_XEN         1
> > +#define BOOTMOD_FDT         2
> > +#define BOOTMOD_KERNEL      3
> > +#define BOOTMOD_RAMDISK     4
> > +#define BOOTMOD_XSM         5
> > +#define BOOTMOD_UCODE       6
> > +#define BOOTMOD_GUEST_DTB   7
> > +typedef unsigned int bootmod_type_t;
> > +
> > +#define BOOTMOD_STRING_MAX_LEN 1024
>
> BOOTMOD_MAX_CMDLINE ?
>

The string associated with a boot module may not be a command line; it
depends on the type of the module, hence BOOTMOD_MAX_STRING was what it was
called in v1 of the hyperlaunch series, and I revised it to this since I
think it's clearer.
ie. There's a purpose to the rename.


>
>
> > +struct boot_string {
>
> struct bootcmdline ?
>

It is similar to bootcmdline in that it stores the contents of the string
provided by the bootloader to associate with a boot module, but the struct
contents differ and the way that it is accessed is different too.

I think it replaces bootcmdline once the new structures are fully in use on
Arm.


>
>
> > +    char bytes[BOOTMOD_STRING_MAX_LEN];
>
> cmdline?
>

It may not be command line, depending on the module type, hence the
interest in using a different term for it.


>
> If the string is \0 terminated we don't need len?
>

This is for generalized strings associated with boot modules supplied by
the bootloader, not just command lines, so additional consideration may be
wanted. This is a defensive mechanism, attackers don't follow
specifications and sometimes people cause bugs.


>
>
> > +    size_t len;
> > +};
> > +
> >  struct boot_module {
> > +    bootmod_type_t bootmod_type;
>
> Why not use a good old enum?
>

The early x86 boot logic that runs in 32-bit mode populates the structures
which are then accessed in the main hypervisor initialization logic in
64-bit mode, and we would like to have a single common definition for the
structures in a header that is useable in both places, so that requires
preparing for fixed-size types in packed structures; an enum isn't
guaranteed to compile to
the same size in those two cases, so doesn't pack. To make transition for
the Arm code easier I can make these definitions closer to the old enum
though.


>
>
> >      paddr_t start;
> > +    mfn_t mfn;
>
> I think mfn should be in arch_bootmodule
>

I think that's ok if it's not needed in non-x86 logic.


>
>
> >      size_t size;
> >
> >      struct arch_bootmodule *arch;
> > +    struct boot_string string;
> >  };
> >
> >  struct boot_info {
> > +    char *cmdline;
>
> Is this for Xen cmdline?


Yes


> While all the other cmdline are in the various
> struct boot_string? Is there any benefit in using the BOOTMOD_XEN for it?
> BOOTMOD_XEN is not used so far, so if you don't end up using it,
> probably not, otherwise it could be considered.
>

ok - I agree that we haven't dropped any use of BOOTMOD_XEN so far but will
keep it in mind.

thanks,

Christopher


>
>
>
>
> >      unsigned int nr_mods;
> >      struct boot_module *mods;
> > +
> > +    struct arch_boot_info *arch;
> >  };
> >
> >  #endif
> > --
> > 2.25.1
> >
> >
>

--0000000000006413430600f2c11a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Sat, Jul 8, 2023 at 12:15=E2=80=AF=
PM Stefano Stabellini &lt;<a href=3D"mailto:sstabellini@kernel.org">sstabel=
lini@kernel.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad=
ding-left:1ex">On Sat, 1 Jul 2023, Christopher Clark wrote:<br>
&gt; Adjust the PV and PVH dom0 construction entry points to take boot modu=
le<br>
&gt; structures as parameters, and add further fields to the boot module<br=
>
&gt; structures to plumb the data needed to support this use. Populate thes=
e<br>
&gt; from the multiboot module data.<br>
&gt; <br>
&gt; This change removes multiboot from the PV and PVH dom0 construction lo=
gic.<br>
&gt; <br>
&gt; Introduce and use new inline accessor functions for navigating the boo=
t<br>
&gt; module structures.<br>
&gt; <br>
&gt; The per-boot-module arrays are expanded from singletons to accommodate=
<br>
&gt; all modules, up to a static maximum of 64 modules including Xen that c=
an<br>
&gt; be accepted from a bootloader to match the previous value from the<br>
&gt; module map check.<br>
&gt; <br>
&gt; The field that identifies the type of a boot module (kernel, ramdisk,<=
br>
&gt; etc) is introduced to the common boot module structure and declared as=
 a<br>
&gt; non-enum integer type to allow the field to be of a known-size and so<=
br>
&gt; structure can be packed in a subsequent patch in the series, and it wi=
ll<br>
&gt; then be reconciled with the equivalent Arm boot field type.<br>
&gt; <br>
&gt; The command line provided by multiboot for each boot module is added<b=
r>
&gt; directly to the boot_module structure, which is appropriate for this<b=
r>
&gt; logic just replacing multiboot.<br>
&gt; <br>
&gt; The maximum number of boot modules that a bootloader can provide in<br=
>
&gt; addition to the Xen hypervisor is preserved from prior logic with the<=
br>
&gt; module_map at 63.<br>
&gt; <br>
&gt; Signed-off-by: Christopher Clark &lt;<a href=3D"mailto:christopher.w.c=
lark@gmail.com" target=3D"_blank">christopher.w.clark@gmail.com</a>&gt;<br>
&gt; Signed-off-by: Daniel P. Smith &lt;<a href=3D"mailto:dpsmith@apertusso=
lutions.com" target=3D"_blank">dpsmith@apertussolutions.com</a>&gt;<br>
&gt; <br>
&gt; ---<br>
&gt; Changes since v1: patch is a subset of v1 series patches 2 and 3.<br>
&gt; - The module_map is kept for now since still in use.<br>
&gt; - Move the static inline functions into a separate dedicated header.<b=
r>
&gt; - &lt;mm-frame.h&gt; and &lt;compiler.h&gt; replace prior inclusion of=
 &lt;mm.h&gt;<br>
&gt;=C2=A0 =C2=A0for simpler dependencies.<br>
&gt; <br>
&gt;=C2=A0 xen/arch/x86/dom0_build.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0|=C2=A0 10 +-<br>
&gt;=C2=A0 xen/arch/x86/hvm/dom0_build.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=
=C2=A0 43 +++---<br>
&gt;=C2=A0 xen/arch/x86/include/asm/boot.h=C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=
=A0 36 +++++<br>
&gt;=C2=A0 xen/arch/x86/include/asm/bootinfo.h=C2=A0 =C2=A0|=C2=A0 24 +++<b=
r>
&gt;=C2=A0 xen/arch/x86/include/asm/dom0_build.h |=C2=A0 13 +-<br>
&gt;=C2=A0 xen/arch/x86/include/asm/setup.h=C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=
=A04 +-<br>
&gt;=C2=A0 xen/arch/x86/pv/dom0_build.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=
=C2=A0 32 ++--<br>
&gt;=C2=A0 xen/arch/x86/setup.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 | 206 +++++++++++++++-----------<br>
&gt;=C2=A0 xen/include/xen/bootinfo.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 |=C2=A0 27 ++++<br>
&gt;=C2=A0 9 files changed, 254 insertions(+), 141 deletions(-)<br>
&gt; <br>
&gt; diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c<br>
&gt; index 9f5300a3ef..42310202a2 100644<br>
&gt; --- a/xen/arch/x86/dom0_build.c<br>
&gt; +++ b/xen/arch/x86/dom0_build.c<br>
&gt; @@ -4,6 +4,7 @@<br>
&gt;=C2=A0 =C2=A0* Copyright (c) 2002-2005, K A Fraser<br>
&gt;=C2=A0 =C2=A0*/<br>
&gt;=C2=A0 <br>
&gt; +#include &lt;xen/bootinfo.h&gt;<br>
&gt;=C2=A0 #include &lt;xen/init.h&gt;<br>
&gt;=C2=A0 #include &lt;xen/iocap.h&gt;<br>
&gt;=C2=A0 #include &lt;xen/libelf.h&gt;<br>
&gt; @@ -562,9 +563,8 @@ int __init dom0_setup_permissions(struct domain *d=
)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 return rc;<br>
&gt;=C2=A0 }<br>
&gt;=C2=A0 <br>
&gt; -int __init construct_dom0(struct domain *d, const module_t *image,<br=
>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 unsigned long image_headroom, module_t *initrd,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 char *cmdline)<br>
&gt; +int __init construct_dom0(struct domain *d, const struct boot_module =
*image,<br>
&gt; +=C2=A0 =C2=A0 struct boot_module *initrd, char *cmdline)<br>
&gt;=C2=A0 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 int rc;<br>
&gt;=C2=A0 <br>
&gt; @@ -576,9 +576,9 @@ int __init construct_dom0(struct domain *d, const =
module_t *image,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 process_pending_softirqs();<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 if ( is_hvm_domain(d) )<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 rc =3D dom0_construct_pvh(d, image, image=
_headroom, initrd, cmdline);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 rc =3D dom0_construct_pvh(d, image, initr=
d, cmdline);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 else if ( is_pv_domain(d) )<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 rc =3D dom0_construct_pv(d, image, image_=
headroom, initrd, cmdline);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 rc =3D dom0_construct_pv(d, image, initrd=
, cmdline);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 else<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 panic(&quot;Cannot construct Dom0. N=
o guest interface available\n&quot;);<br>
&gt;=C2=A0 <br>
&gt; diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_bui=
ld.c<br>
&gt; index 56fe89632b..c094863bb8 100644<br>
&gt; --- a/xen/arch/x86/hvm/dom0_build.c<br>
&gt; +++ b/xen/arch/x86/hvm/dom0_build.c<br>
&gt; @@ -8,9 +8,9 @@<br>
&gt;=C2=A0 =C2=A0*/<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 #include &lt;xen/acpi.h&gt;<br>
&gt; +#include &lt;xen/bootinfo.h&gt;<br>
&gt;=C2=A0 #include &lt;xen/init.h&gt;<br>
&gt;=C2=A0 #include &lt;xen/libelf.h&gt;<br>
&gt; -#include &lt;xen/multiboot.h&gt;<br>
&gt;=C2=A0 #include &lt;xen/pci.h&gt;<br>
&gt;=C2=A0 #include &lt;xen/softirq.h&gt;<br>
&gt;=C2=A0 <br>
&gt; @@ -530,14 +530,13 @@ static paddr_t __init find_memory(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 return INVALID_PADDR;<br>
&gt;=C2=A0 }<br>
&gt;=C2=A0 <br>
&gt; -static int __init pvh_load_kernel(struct domain *d, const module_t *i=
mage,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 unsigned long image_headr=
oom,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 module_t *initrd, void *i=
mage_base,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 char *cmdline, paddr_t *e=
ntry,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 paddr_t *start_info_addr)=
<br>
&gt; +static int __init pvh_load_kernel(<br>
&gt; +=C2=A0 =C2=A0 struct domain *d, const struct boot_module *image,<br>
&gt; +=C2=A0 =C2=A0 struct boot_module *initrd, void *image_base, char *cmd=
line, paddr_t *entry,<br>
&gt; +=C2=A0 =C2=A0 paddr_t *start_info_addr)<br>
&gt;=C2=A0 {<br>
&gt; -=C2=A0 =C2=A0 void *image_start =3D image_base + image_headroom;<br>
&gt; -=C2=A0 =C2=A0 unsigned long image_len =3D image-&gt;mod_end;<br>
&gt; +=C2=A0 =C2=A0 void *image_start =3D image_base + image-&gt;arch-&gt;h=
eadroom;<br>
&gt; +=C2=A0 =C2=A0 unsigned long image_len =3D image-&gt;size;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 struct elf_binary elf;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 struct elf_dom_parms parms;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 paddr_t last_addr;<br>
&gt; @@ -546,7 +545,7 @@ static int __init pvh_load_kernel(struct domain *d=
, const module_t *image,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 struct vcpu *v =3D d-&gt;vcpu[0];<br>
&gt;=C2=A0 =C2=A0 =C2=A0 int rc;<br>
&gt;=C2=A0 <br>
&gt; -=C2=A0 =C2=A0 if ( (rc =3D bzimage_parse(image_base, &amp;image_start=
, image_headroom,<br>
&gt; +=C2=A0 =C2=A0 if ( (rc =3D bzimage_parse(image_base, &amp;image_start=
, image-&gt;arch-&gt;headroom,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&amp;image_len)) !=3D 0 )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 printk(&quot;Error trying to detect =
bz compressed kernel\n&quot;);<br>
&gt; @@ -594,7 +593,7 @@ static int __init pvh_load_kernel(struct domain *d=
, const module_t *image,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0* simplify it.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0*/<br>
&gt;=C2=A0 =C2=A0 =C2=A0 last_addr =3D find_memory(d, &amp;elf, sizeof(star=
t_info) +<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (initrd ? ROUNDUP(initrd-&gt;mod_end, PAGE_SIZ=
E) +<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (initrd ? ROUNDUP(initrd-&gt;size, PAGE_SIZE) =
+<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sizeo=
f(mod)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 : 0) +<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (cmdline ? ROUNDUP(strlen(cmdline) + 1,<=
br>
&gt; @@ -608,8 +607,8 @@ static int __init pvh_load_kernel(struct domain *d=
, const module_t *image,<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 if ( initrd !=3D NULL )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 rc =3D hvm_copy_to_guest_phys(last_addr, =
mfn_to_virt(initrd-&gt;mod_start),<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 initrd-&gt;mod_end=
, v);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 rc =3D hvm_copy_to_guest_phys(last_addr, =
maddr_to_virt(initrd-&gt;start),<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 initrd-&gt;size, v=
);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if ( rc )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 printk(&quot;Unable to=
 copy initrd to guest\n&quot;);<br>
&gt; @@ -617,11 +616,11 @@ static int __init pvh_load_kernel(struct domain =
*d, const module_t *image,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 mod.paddr =3D last_addr;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 mod.size =3D initrd-&gt;mod_end;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 last_addr +=3D ROUNDUP(initrd-&gt;mod_end=
, elf_64bit(&amp;elf) ? 8 : 4);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 if ( initrd-&gt;string )<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 mod.size =3D initrd-&gt;size;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 last_addr +=3D ROUNDUP(initrd-&gt;size, e=
lf_64bit(&amp;elf) ? 8 : 4);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 if ( initrd-&gt;string.len )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 char *str =3D __va(initrd-&=
gt;string);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 char *str =3D initrd-&gt;st=
ring.bytes;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 size_t len =3D strlen(=
str) + 1;<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rc =3D hvm_copy_to_gue=
st_phys(last_addr, str, len, v);<br>
&gt; @@ -1176,10 +1175,9 @@ static void __hwdom_init pvh_setup_mmcfg(struct=
 domain *d)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 }<br>
&gt;=C2=A0 <br>
&gt; -int __init dom0_construct_pvh(struct domain *d, const module_t *image=
,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 unsigned long image_headroom,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 module_t *initrd,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 char *cmdline)<br>
&gt; +int __init dom0_construct_pvh(<br>
&gt; +=C2=A0 =C2=A0 struct domain *d, const struct boot_module *image,<br>
&gt; +=C2=A0 =C2=A0 struct boot_module *initrd, char *cmdline)<br>
&gt;=C2=A0 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 paddr_t entry, start_info;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 int rc;<br>
&gt; @@ -1209,9 +1207,8 @@ int __init dom0_construct_pvh(struct domain *d, =
const module_t *image,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return rc;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 <br>
&gt; -=C2=A0 =C2=A0 rc =3D pvh_load_kernel(d, image, image_headroom, initrd=
,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0bootstrap_map_multiboot(image),<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0cmdline, &amp;entry, &amp;start_info);<br>
&gt; +=C2=A0 =C2=A0 rc =3D pvh_load_kernel(d, image, initrd, bootstrap_map(=
image), cmdline,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0&amp;entry, &amp;start_info);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 if ( rc )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 printk(&quot;Failed to load Dom0 ker=
nel\n&quot;);<br>
&gt; diff --git a/xen/arch/x86/include/asm/boot.h b/xen/arch/x86/include/as=
m/boot.h<br>
&gt; index 10b17f12b2..bcf4f2e2e3 100644<br>
&gt; --- a/xen/arch/x86/include/asm/boot.h<br>
&gt; +++ b/xen/arch/x86/include/asm/boot.h<br>
&gt; @@ -19,6 +19,42 @@ static inline void *bootstrap_map_multiboot(const m=
odule_t *mod)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 return bootstrap_map(&amp;bm);<br>
&gt;=C2=A0 }<br>
&gt;=C2=A0 <br>
&gt; +static inline unsigned long bootmodule_index(<br>
&gt; +=C2=A0 =C2=A0 const struct boot_info *info, bootmod_type_t bootmod_ty=
pe,<br>
&gt; +=C2=A0 =C2=A0 unsigned long start)<br>
&gt; +{<br>
&gt; +=C2=A0 =C2=A0 for ( ; start &lt; info-&gt;nr_mods; start++ )<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 if ( info-&gt;mods[start].bootmod_type =
=3D=3D bootmod_type )<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return start;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 return info-&gt;nr_mods + 1;<br>
&gt; +}<br>
&gt; +<br>
&gt; +static inline struct boot_module *bootmodule_next(<br>
&gt; +=C2=A0 =C2=A0 const struct boot_info *info, bootmod_type_t bootmod_ty=
pe)<br>
&gt; +{<br>
&gt; +=C2=A0 =C2=A0 unsigned long i;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 for ( i =3D 0; i &lt; info-&gt;nr_mods; i++ )<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 if ( info-&gt;mods[i].bootmod_type =3D=3D=
 bootmod_type )<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return &amp;info-&gt;mods[i=
];<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 return NULL;<br>
&gt; +}<br>
&gt; +<br>
&gt; +static inline void bootmodule_update_start(struct boot_module *bm,<br=
>
&gt; +=C2=A0 =C2=A0 paddr_t new_start)<br>
&gt; +{<br>
&gt; +=C2=A0 =C2=A0 bm-&gt;start =3D new_start;<br>
&gt; +=C2=A0 =C2=A0 bm-&gt;mfn =3D maddr_to_mfn(new_start);<br>
&gt; +}<br>
&gt; +<br>
&gt; +static inline void bootmodule_update_mfn(struct boot_module *bm, mfn_=
t new_mfn)<br>
&gt; +{<br>
&gt; +=C2=A0 =C2=A0 bm-&gt;mfn =3D new_mfn;<br>
&gt; +=C2=A0 =C2=A0 bm-&gt;start =3D mfn_to_maddr(new_mfn);<br>
&gt; +}<br>
&gt; +<br>
&gt;=C2=A0 #endif<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 /*<br>
&gt; diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/includ=
e/asm/bootinfo.h<br>
&gt; index a25054f372..30c27980e0 100644<br>
&gt; --- a/xen/arch/x86/include/asm/bootinfo.h<br>
&gt; +++ b/xen/arch/x86/include/asm/bootinfo.h<br>
&gt; @@ -2,9 +2,33 @@<br>
&gt;=C2=A0 #define __ARCH_X86_BOOTINFO_H__<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 struct arch_bootmodule {<br>
&gt; +#define BOOTMOD_FLAG_X86_RELOCATED=C2=A0 =C2=A0 =C2=A01U &lt;&lt; 0<b=
r>
&gt; +=C2=A0 =C2=A0 uint32_t flags;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 unsigned headroom;<br>
&gt;=C2=A0 };<br>
&gt;=C2=A0 <br>
&gt; +struct arch_boot_info {<br>
&gt; +=C2=A0 =C2=A0 uint32_t flags;<br>
&gt; +#define BOOTINFO_FLAG_X86_CMDLINE=C2=A0 =C2=A0 =C2=A0 1U &lt;&lt; 2<b=
r>
<br>
Is this to indicate the presence of the Xen cmdline?<br></blockquote><div><=
br></div><div>Yes; it replaces the previous use of the MBI_CMDLINE flag and=
 is set whenever MBI_CMDLINE is set when passed from multiboot. This indica=
tes that a command line has been passed via multiboot.<br><br>A comment in =
the conversion function confirms the intended use of the flag field:<br>=C2=
=A0 =C2=A0 /* The BOOTINFO_FLAG_X86_* flags are a 1-1 map to MBI_* */<br></=
div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px =
0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
&gt; +#define BOOTINFO_FLAG_X86_MODULES=C2=A0 =C2=A0 =C2=A0 1U &lt;&lt; 3<b=
r>
&gt; +#define BOOTINFO_FLAG_X86_MEMMAP=C2=A0 =C2=A0 =C2=A0 =C2=A01U &lt;&lt=
; 6<br>
&gt; +#define BOOTINFO_FLAG_X86_LOADERNAME=C2=A0 =C2=A01U &lt;&lt; 9<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 char *boot_loader_name;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 uint32_t mmap_length;<br>
&gt; +=C2=A0 =C2=A0 paddr_t mmap_addr;<br>
&gt; +};<br>
&gt; +<br>
&gt; +struct __packed mb_memmap {<br>
&gt; +=C2=A0 =C2=A0 uint32_t size;<br>
&gt; +=C2=A0 =C2=A0 uint32_t base_addr_low;<br>
&gt; +=C2=A0 =C2=A0 uint32_t base_addr_high;<br>
&gt; +=C2=A0 =C2=A0 uint32_t length_low;<br>
&gt; +=C2=A0 =C2=A0 uint32_t length_high;<br>
&gt; +=C2=A0 =C2=A0 uint32_t type;<br>
&gt; +};<br>
&gt; +<br>
&gt;=C2=A0 #endif<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 /*<br>
&gt; diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c<br>
&gt; index 3b623a4149..f9b04daebd 100644<br>
&gt; --- a/xen/arch/x86/setup.c<br>
&gt; +++ b/xen/arch/x86/setup.c<br>
&gt; @@ -37,6 +37,7 @@<br>
&gt;=C2=A0 #include &lt;asm/processor.h&gt;<br>
&gt;=C2=A0 #include &lt;asm/mpspec.h&gt;<br>
&gt;=C2=A0 #include &lt;asm/apic.h&gt;<br>
&gt; +#include &lt;asm/boot.h&gt;<br>
&gt;=C2=A0 #include &lt;asm/msi.h&gt;<br>
&gt;=C2=A0 #include &lt;asm/desc.h&gt;<br>
&gt;=C2=A0 #include &lt;asm/paging.h&gt;<br>
&gt; @@ -59,6 +60,9 @@<br>
&gt;=C2=A0 #include &lt;asm/prot-key.h&gt;<br>
&gt;=C2=A0 #include &lt;asm/pv/domain.h&gt;<br>
&gt;=C2=A0 <br>
&gt; +/* Max number of boot modules a bootloader can provide in addition to=
 Xen */<br>
&gt; +#define MAX_NR_BOOTMODS 63<br>
<br>
Call it MAX_MODULES ?<br>
Like I wrote in the past, you already did the hard work of aligning the<br>
interfaces, we might as well also use the same names.<br></blockquote><div>=
<br></div><div>On the general naming: BOOTMODS is more descriptive in that =
it indicates an association between the module and the context it is from: =
ie. boot, and is a module handed to the hypervisor by a bootloader (as oppo=
sed to say, a late-loaded module). The term BOOTMOD is also already used wi=
thin the Arm source, see: BOOTMOD_MAX_CMDLINE.<br><br>On using the same nam=
e: following the feedback in the previous round of reviews this value doesn=
&#39;t include a count of the hypervisor itself; so it isn&#39;t the same t=
hing and so I wouldn&#39;t use the same name for it.</div><div>=C2=A0</div>=
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
[...]<br>
<br>
&gt; @@ -1357,12 +1382,14 @@ void __init noreturn __start_xen(unsigned long=
 mbi_p)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* respective reserve_e820_ram(=
) invocation below. No need to<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* query efi_boot_mem_unused() =
here, though.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 mod[boot_info-&gt;nr_mods].mod_start =3D =
virt_to_mfn(_stext);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 mod[boot_info-&gt;nr_mods].mod_end =3D __=
2M_rwdata_end - _stext;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 bootmodule_update_start(&amp;boot_info-&g=
t;mods[boot_info-&gt;nr_mods],<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 virt_to_maddr(_stext));<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 boot_info-&gt;mods[boot_info-&gt;nr_mods]=
.size =3D __2M_rwdata_end - _stext;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 }<br>
<br>
The original code had the end address as &quot;__2M_rwdata_end - _stext&quo=
t;<br>
while now we have the size as &quot;__2M_rwdata_end - _stext&quot; which is=
 not<br>
the same?<br></blockquote><div><br></div><div>(this was answered by Jan in =
a previous reply)=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1=
ex">
<br>
<br>
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 boot_info-&gt;mods[0].arch-&gt;headroom =3D<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 bzimage_headroom(bootstrap_map_multiboot(=
mod), mod-&gt;mod_end);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 bzimage_headroom(bootstrap_map(&amp;boot_=
info-&gt;mods[0]),<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0boot_info-&gt;mods[0].size);<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 bootstrap_map(NULL);<br>
&gt;=C2=A0 <br>
<br>
[...]<br>
<br>
<br>
&gt; diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h<b=
r>
&gt; index eb93cc3439..2f4284a91f 100644<br>
&gt; --- a/xen/include/xen/bootinfo.h<br>
&gt; +++ b/xen/include/xen/bootinfo.h<br>
&gt; @@ -2,23 +2,50 @@<br>
&gt;=C2=A0 #define __XEN_BOOTINFO_H__<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 #include &lt;xen/types.h&gt;<br>
&gt; +#include &lt;xen/compiler.h&gt;<br>
&gt; +#include &lt;xen/mm-frame.h&gt;<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 #ifdef CONFIG_X86<br>
&gt;=C2=A0 #include &lt;asm/bootinfo.h&gt;<br>
&gt;=C2=A0 #else<br>
&gt;=C2=A0 =C2=A0 =C2=A0 struct arch_bootmodule { };<br>
&gt; +=C2=A0 =C2=A0 struct arch_boot_info { };<br>
&gt;=C2=A0 #endif<br>
&gt;=C2=A0 <br>
&gt; +/* Boot module binary type / purpose */<br>
&gt; +#define BOOTMOD_UNKNOWN=C2=A0 =C2=A0 =C2=A00<br>
&gt; +#define BOOTMOD_XEN=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A01<br>
&gt; +#define BOOTMOD_FDT=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A02<br>
&gt; +#define BOOTMOD_KERNEL=C2=A0 =C2=A0 =C2=A0 3<br>
&gt; +#define BOOTMOD_RAMDISK=C2=A0 =C2=A0 =C2=A04<br>
&gt; +#define BOOTMOD_XSM=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A05<br>
&gt; +#define BOOTMOD_UCODE=C2=A0 =C2=A0 =C2=A0 =C2=A06<br>
&gt; +#define BOOTMOD_GUEST_DTB=C2=A0 =C2=A07<br>
&gt; +typedef unsigned int bootmod_type_t;<br>
&gt; +<br>
&gt; +#define BOOTMOD_STRING_MAX_LEN 1024<br>
<br>
BOOTMOD_MAX_CMDLINE ?<br></blockquote><div><br></div><div>The string associ=
ated with a boot module may not be a command line; it depends on the type o=
f the module, hence BOOTMOD_MAX_STRING was what it was called in v1 of the =
hyperlaunch series, and I revised it to this since I think it&#39;s clearer=
.<br>ie. There&#39;s a purpose to the rename.<br></div><div>=C2=A0</div><bl=
ockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-lef=
t:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
&gt; +struct boot_string {<br>
<br>
struct bootcmdline ?<br></blockquote><div><br></div><div>It is similar to b=
ootcmdline in that it stores the contents of the string provided by the boo=
tloader to associate with a boot module, but the struct contents differ and=
 the way that it is accessed is different too.<br><br>I think it replaces b=
ootcmdline once the new structures are fully in use on Arm.<br></div><div>=
=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
&gt; +=C2=A0 =C2=A0 char bytes[BOOTMOD_STRING_MAX_LEN];<br>
<br>
cmdline?<br></blockquote><div><br></div><div>It may not be command line, de=
pending on the module type, hence the interest in using a different term fo=
r it.<br></div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"=
margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-lef=
t:1ex">
<br>
If the string is \0 terminated we don&#39;t need len?<br></blockquote><div>=
<br></div><div>This is for generalized strings associated with boot modules=
 supplied by the bootloader, not just command lines, so additional consider=
ation may be wanted. This=C2=A0is a defensive mechanism, attackers don&#39;=
t follow specifications and sometimes people cause bugs.<br></div><div>=C2=
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e=
x;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
&gt; +=C2=A0 =C2=A0 size_t len;<br>
&gt; +};<br>
&gt; +<br>
&gt;=C2=A0 struct boot_module {<br>
&gt; +=C2=A0 =C2=A0 bootmod_type_t bootmod_type;<br>
<br>
Why not use a good old enum?<br></blockquote><div><br></div><div>The early =
x86 boot logic that runs in 32-bit mode populates the structures which are =
then accessed in the main hypervisor initialization logic in 64-bit mode, a=
nd we would like to have a single common definition for the structures in a=
 header that is useable in both places, so that requires preparing for fixe=
d-size types in packed structures; an enum isn&#39;t guaranteed to compile =
to<br>the same size in those two cases, so doesn&#39;t pack. To make transi=
tion for the Arm code easier I can make these definitions closer to the old=
 enum though.<br></div><div>=C2=A0</div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad=
ding-left:1ex">
<br>
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 paddr_t start;<br>
&gt; +=C2=A0 =C2=A0 mfn_t mfn;<br>
<br>
I think mfn should be in arch_bootmodule<br></blockquote><div><br></div><di=
v>I think that&#39;s ok if it&#39;s not needed in non-x86 logic.<br></div><=
div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 size_t size;<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 struct arch_bootmodule *arch;<br>
&gt; +=C2=A0 =C2=A0 struct boot_string string;<br>
&gt;=C2=A0 };<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 struct boot_info {<br>
&gt; +=C2=A0 =C2=A0 char *cmdline;<br>
<br>
Is this for Xen cmdline?</blockquote><div><br></div><div>Yes</div><div>=C2=
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e=
x;border-left:1px solid rgb(204,204,204);padding-left:1ex"> While all the o=
ther cmdline are in the various<br>
struct boot_string? Is there any benefit in using the BOOTMOD_XEN for it?<b=
r>
BOOTMOD_XEN is not used so far, so if you don&#39;t end up using it,<br>
probably not, otherwise it could be considered.<br></blockquote><div><br></=
div><div>ok - I agree that we haven&#39;t dropped any use of BOOTMOD_XEN so=
 far but will keep it in mind.</div><div><br></div><div>thanks,</div><div><=
br></div><div>Christopher</div><div>=C2=A0</div><blockquote class=3D"gmail_=
quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,=
204);padding-left:1ex">
<br>
<br>
<br>
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 unsigned int nr_mods;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 struct boot_module *mods;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 struct arch_boot_info *arch;<br>
&gt;=C2=A0 };<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 #endif<br>
&gt; -- <br>
&gt; 2.25.1<br>
&gt; <br>
&gt; <br>
</blockquote></div></div>

--0000000000006413430600f2c11a--


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 22:44:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 22:44:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566780.886086 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMcNX-0007J9-Sn; Thu, 20 Jul 2023 22:44:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566780.886086; Thu, 20 Jul 2023 22:44:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMcNX-0007J2-Oy; Thu, 20 Jul 2023 22:44:11 +0000
Received: by outflank-mailman (input) for mailman id 566780;
 Thu, 20 Jul 2023 22:44:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=GtTE=DG=invisiblethingslab.com=marmarek@srs-se1.protection.inumbo.net>)
 id 1qMcNV-0007Iw-QO
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 22:44:10 +0000
Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com
 [64.147.123.21]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ecaa09d2-274e-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 00:44:06 +0200 (CEST)
Received: from compute3.internal (compute3.nyi.internal [10.202.2.43])
 by mailout.west.internal (Postfix) with ESMTP id EA5493202ABC;
 Thu, 20 Jul 2023 18:44:00 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute3.internal (MEProxy); Thu, 20 Jul 2023 18:44:01 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 20 Jul 2023 18:43:59 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ecaa09d2-274e-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm3; t=
	1689893040; x=1689979440; bh=uvJ2lRUpS0RozvK7oxH/DvhKOg1op0VChlq
	O8mVoUl0=; b=JPW0juiEg/KuUQEaQP4nwCk/saF2qqSu1vkaYhmzifnda9R+7vU
	WVSkzQpX84WHGuUNrRRWkejjoE/qZV2G8pItK6w4XzAF3lB/7Bj5WEsHrzvgKctg
	1sr+1DM3tyWox7VzGhKiy8FC+W1lKs2xsGuqKnP4wcIvKbtzmECKspdJvN6UNyS0
	gw5VUtyFgE2kEhsYAlyeoV4wsYaf5GDJO3R30UfkARt6m6onrlfJgMW4PBidFQO1
	Rx/6N6X3ngCPlWKYKVPtIoCnzCPHVt33w6IbawSBdwbyBNopDC3cvOKAOS1M8ek3
	CvcMJJZGwwauHWaFhCFkoGQ8Al5YX/zcbPg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1689893040; x=1689979440; bh=uvJ2lRUpS0Roz
	vK7oxH/DvhKOg1op0VChlqO8mVoUl0=; b=r+P6Xt/NzsxzCRj071C1hlJwQkj1h
	oDN33E0nVgDEkgUBzR27qxtR7/3LEY778LW6RnvIZqi+wM2mOY18O4ymENxarPbt
	A3CDgkKHqQ8Ycx0UsPjfb6G6jrZ4CwaBUPIbb3N/zpxieq0mAEQlrm88Ict1PUzA
	u50J+HrqmARZgrU1MlbAbghBqqztHAJC50/+bVDIOiSlgY/sT0r+Tll+y2s1r9if
	5Tr4Lrke/xYZhP7QVdnajpxEeCNCUDneO/ABdJkyijxVZ+H08plfPPRPuOj68gs9
	ktMumA/i5UqzSxokCHvvnGI4O8fvUw/eLHSWY5TVJl4laxp46f3uCiPDw==
X-ME-Sender: <xms:sLi5ZB-5MuP_8XDnPP9UiAmQ8bu7sKiFt7DN3K683Z__ALMbrdJwDw>
    <xme:sLi5ZFvIdCG3oBDc7GWux0Ms-i2VpAyQDOr_TXguByXRqv2LpUci90OVZ9yJox0zw
    DELSr3gUzYIyw>
X-ME-Received: <xmr:sLi5ZPBo_7_YjY09o4u5k4L4nPgHEKOTPs_iMRWXDJTJ2G1uLt86dbJbsjdwFOsBQQ-2WILphjgi-2-_A0YvtKUW8g919enJRcY>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrhedugdduvdcutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpeffhffvvefukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpeforghrvghk
    ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh
    hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpefgudel
    teefvefhfeehieetleeihfejhfeludevteetkeevtedtvdegueetfeejudenucevlhhush
    htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhes
    ihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm
X-ME-Proxy: <xmx:sLi5ZFe6KlodGlx9skqmxW_1lST3CaUzpP6rrgfpz9dfxZVE03_2Fw>
    <xmx:sLi5ZGNFEz4zFw9N0ZzpzrVG9zri-ZvygFEfVQ_8BR-INVbjTxNdOw>
    <xmx:sLi5ZHkZthDFFTJnIy7JqNkqVE-6xEojL3kddYgEvK21-XZwOk8VOQ>
    <xmx:sLi5ZPZ7rjnOOnukeiy3Lh28PUi7Zk0f2UeJH8yz2lppytJQtJ3INQ>
Feedback-ID: i1568416f:Fastmail
Date: Fri, 21 Jul 2023 00:43:55 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [XEN PATCH] automation: add ECLAIR pipeline
Message-ID: <ZLm4q/zhvATqMI55@mail-itl>
References: <eb5fa852f306790160b967787592553d2fdf3de6.1689887842.git.simone.ballarin@bugseng.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="Za4u7niYLOziw1dA"
Content-Disposition: inline
In-Reply-To: <eb5fa852f306790160b967787592553d2fdf3de6.1689887842.git.simone.ballarin@bugseng.com>


--Za4u7niYLOziw1dA
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Fri, 21 Jul 2023 00:43:55 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [XEN PATCH] automation: add ECLAIR pipeline

On Thu, Jul 20, 2023 at 11:20:29PM +0200, Simone Ballarin wrote:
> +# ECLAIR configuration files are maintened by BUGSENG
> +export GIT_SSH_COMMAND=3D"ssh -o StrictHostKeyChecking=3Dno"
> +[ -d ECLAIR_scripts ] || git clone ssh://git@git.bugseng.com/eclair/scri=
pts/XEN ECLAIR_scripts
> +(cd ECLAIR_scripts; git pull --rebase)

I'd suggest to print here commit id of the scripts repo, so the
logs will keep that information.

--=20
Best Regards,
Marek Marczykowski-G=C3=B3recki
Invisible Things Lab

--Za4u7niYLOziw1dA
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmS5uKwACgkQ24/THMrX
1yyrKgf/cRyNsw7Ny4eVJ24X723ieyERbWx7ABwssZZLpdzo8zw0MJ+Cg5DXHexV
0aflj3Ts1pXh7iFTVH+i6N+tASklQwi9v+kWUY6VEZty2hermih/G7MdsxydLS0Z
7KN8YpIVb6uFsIe0tfzSAvG4HuregwmNGxQMLDLzERnLh93mftM86la5eRAvetIm
LQDSkKvT9yP2Y/5F7XvKB3zPq9FxHSpDfNKP6eRw12wWo7FrVSPJ8Hs1+r7ukg6X
i8nyYQYo03Y3xFUywOOYG9zGCe9MqKVym7U73eoAWT+CvnFfkTADV7p7IodgPrQ6
l9oK1j0dO2nMoB+zewYyFYFpFcmfXQ==
=UlR1
-----END PGP SIGNATURE-----

--Za4u7niYLOziw1dA--


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 22:45:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 22:45:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566786.886096 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMcOO-0007q7-4P; Thu, 20 Jul 2023 22:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566786.886096; Thu, 20 Jul 2023 22:45:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMcOO-0007q0-1F; Thu, 20 Jul 2023 22:45:04 +0000
Received: by outflank-mailman (input) for mailman id 566786;
 Thu, 20 Jul 2023 22:45:03 +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
 <SRS0=DC1w=DG=gmail.com=christopher.w.clark@srs-se1.protection.inumbo.net>)
 id 1qMcON-0007bF-Hl
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 22:45:03 +0000
Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com
 [2a00:1450:4864:20::133])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0f32608a-274f-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 00:45:00 +0200 (CEST)
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-4fbf09a9139so2147837e87.2
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 15:45:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0f32608a-274f-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689893101; x=1690497901;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=LNZIyJjieHXqss25LeS5v2p4NTUaN9JllMEq4pGJddI=;
        b=je2AyYkIzNPODyCre6CassnEctV1aS88D+TObgiMXGGkn0bxodkG7v0qZJhSm9wboQ
         PAu4gdJpK6I0WcvBdC8DMyIZ8A87pf/oELboyCYo2y1OwfxF8koJxjtPK0EDh7TmskPz
         xcR/Ly3Rk8ZmtccmzUW2JP2hd4IQ10rQwAqCEyMHtleilanj/eG3CL0zTUnmMQgQAH0g
         Gq8NnewW9i2wgqh1mfjki97ryahHYBDKOceUQ3U/1eqN3CpKzrZTFrAT3OVe7JXgsTaj
         m5mr+7GG5fHGBRADLMrV37KM/iPdgxflM0diprqssKtsfiAnwIIUako68Lj+OypLHGC+
         vVmg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689893101; x=1690497901;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=LNZIyJjieHXqss25LeS5v2p4NTUaN9JllMEq4pGJddI=;
        b=czcgFAdEtXn/DoZGeG7kFi0N7eFnC1Z2LZ8xtz63LFYFPpN3/xGRXpSnSjl9xIF9EA
         4gO6sgP4IuILa0YHnrtI6wyTju2za7BhLb4t0QSANB27zzg4fqmPxWPRDdoarGUwUUfG
         J7QfS1Zkji8aFDBOdLMyB65LXADeD7RfRLKZJEQLGi7jBUcR+3ODIHYJ5CYAep9jMykv
         twHqLmH4NSVE2Ewk4935uCgZAiVtJ8Alvy4pE/NoMjxHwO3JZhBsGrhUpfUVEvxqHXm1
         r/wxgPw1WY4KWwMNre/prmibbd+xeDu/OXW0xtIXwa3ATVg+3r21APNY3LQeiV6ossvJ
         16JQ==
X-Gm-Message-State: ABy/qLavc/Zr6r/37ChWiZsvfMDUg6U7QxGbX/lUfPX3mAJO7+mxZdw2
	ryd22l4RM8bT5qH6jck7JeYRKVikp3YmssUmoIQ=
X-Google-Smtp-Source: APBJJlHYJmfVjQSd5AA2VmOOT1o/zX6AQnPBa5zrp1uO1G4lGFsfBZ8yoCrjV4mTVSAcQk20bOMHMzIDYI+FxIH/OJY=
X-Received: by 2002:a05:6512:328d:b0:4fb:9050:1d92 with SMTP id
 p13-20020a056512328d00b004fb90501d92mr46362lfe.51.1689893100882; Thu, 20 Jul
 2023 15:45:00 -0700 (PDT)
MIME-Version: 1.0
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
 <20230701071835.41599-8-christopher.w.clark@gmail.com> <alpine.DEB.2.22.394.2307081522410.761183@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2307081522410.761183@ubuntu-linux-20-04-desktop>
From: Christopher Clark <christopher.w.clark@gmail.com>
Date: Thu, 20 Jul 2023 15:44:49 -0700
Message-ID: <CACMJ4GbULNDTSQKUOJByv-C5u4ZX+OyhP_+5HmpiAcFU93=RzA@mail.gmail.com>
Subject: Re: [PATCH 07/10] x86 boot: define paddr_t and add macros for
 typedefing struct pointers
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, 
	Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
	Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, 
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, 
	Bertrand Marquis <bertrand.marquis@arm.com>, Luca Fancellu <luca.fancellu@arm.com>, 
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Rich Persaud <persaur@gmail.com>
Content-Type: multipart/alternative; boundary="000000000000fc92070600f2e54a"

--000000000000fc92070600f2e54a
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sat, Jul 8, 2023 at 3:24=E2=80=AFPM Stefano Stabellini <sstabellini@kern=
el.org>
wrote:

> On Sat, 1 Jul 2023, Christopher Clark wrote:
> > Pointer fields within structs need to be defined as fixed size types in
> > the x86 boot build environment. Using a typedef for the field type
> > rather than a struct pointer type enables the type definition to
> > be changed in the 32-bit boot build and the main hypervisor build,
> > allowing for a single common structure definition and a common header
> file.
>
> Sorry for my ignorance, but why?
>
> struct boot_module is not used as part of any ABI, right? It is
> populated by Xen at boot by hand. Why do we need a specific memory
> layout for it?
>

Fair question! In the early x86 boot logic, which runs in 32-bit CPU mode,
struct boot_module is allocated and populated, so the structure needs to be
defined and available to code that is compiled in 32-bit to do that. The
same structures are also accessed later in 64-bit hypervisor logic, and the
memory layout of the structure needs to be the same in both cases, so we
want all the fields to be fixed-width types, and that includes pointers.

These macros help with declaring pointers as always-64-bit-sized struct
fields in a single definition of the struct. They're not strictly necessary
though - providing alternative definitions for typedefs can be used
instead, and I've been looking at doing that since posting this patch.

Christopher



>
>
>
> > Introduces DEFINE_STRUCT_PTR_TYPE and DEFINE_PTR_TYPE which will
> > generate typedefs with a _ptr_t suffix for pointers to the specified
> > type. This is then used in <xen/bootinfo.h> for pointers within structs
> > as preparation for using these headers in the x86 boot build.
> >
> > The 32-bit behaviour is obtained by inclusion of "defs.h" first with a
> > check for such an existing definition on the <xen/types.h> version.
> >
> > paddr_t is used in <xen/bootinfo.h> so a definition is added here to
> > the x86 boot environment defs.h header.
> >
> > Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
> > Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
>
>
> > ---
> > Changes since v2: This is two v2 patches merged into one for v3.
> > Changes since v1: New in v2 of series.
> >
> >  xen/arch/x86/boot/defs.h            |  9 +++++++++
> >  xen/arch/x86/include/asm/bootinfo.h |  4 +++-
> >  xen/include/xen/bootinfo.h          |  9 +++++----
> >  xen/include/xen/types.h             | 11 +++++++++++
> >  4 files changed, 28 insertions(+), 5 deletions(-)
> >
> > diff --git a/xen/arch/x86/boot/defs.h b/xen/arch/x86/boot/defs.h
> > index f9840044ec..bc0f1b5cf8 100644
> > --- a/xen/arch/x86/boot/defs.h
> > +++ b/xen/arch/x86/boot/defs.h
> > @@ -60,4 +60,13 @@ typedef u64 uint64_t;
> >  #define U16_MAX              ((u16)(~0U))
> >  #define UINT_MAX     (~0U)
> >
> > +typedef unsigned long long paddr_t;
> > +
> > +#define DEFINE_STRUCT_PTR_TYPE(struct_name) \
> > +    typedef uint64_t struct_name ## _ptr_t;
> > +
> > +#define DEFINE_PTR_TYPE(type) \
> > +    typedef uint64_t type ## _ptr_t;
> > +DEFINE_PTR_TYPE(char);
> > +
> >  #endif /* __BOOT_DEFS_H__ */
> > diff --git a/xen/arch/x86/include/asm/bootinfo.h
> b/xen/arch/x86/include/asm/bootinfo.h
> > index 30c27980e0..989fb7a1da 100644
> > --- a/xen/arch/x86/include/asm/bootinfo.h
> > +++ b/xen/arch/x86/include/asm/bootinfo.h
> > @@ -6,6 +6,7 @@ struct arch_bootmodule {
> >      uint32_t flags;
> >      unsigned headroom;
> >  };
> > +DEFINE_STRUCT_PTR_TYPE(arch_bootmodule);
> >
> >  struct arch_boot_info {
> >      uint32_t flags;
> > @@ -14,11 +15,12 @@ struct arch_boot_info {
> >  #define BOOTINFO_FLAG_X86_MEMMAP       1U << 6
> >  #define BOOTINFO_FLAG_X86_LOADERNAME   1U << 9
> >
> > -    char *boot_loader_name;
> > +    char_ptr_t boot_loader_name;
> >
> >      uint32_t mmap_length;
> >      paddr_t mmap_addr;
> >  };
> > +DEFINE_STRUCT_PTR_TYPE(arch_boot_info);
> >
> >  struct __packed mb_memmap {
> >      uint32_t size;
> > diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
> > index 2f4284a91f..8389da4f72 100644
> > --- a/xen/include/xen/bootinfo.h
> > +++ b/xen/include/xen/bootinfo.h
> > @@ -35,17 +35,18 @@ struct boot_module {
> >      mfn_t mfn;
> >      size_t size;
> >
> > -    struct arch_bootmodule *arch;
> > +    arch_bootmodule_ptr_t arch;
> >      struct boot_string string;
> >  };
> > +DEFINE_STRUCT_PTR_TYPE(boot_module);
> >
> >  struct boot_info {
> > -    char *cmdline;
> > +    char_ptr_t cmdline;
> >
> >      unsigned int nr_mods;
> > -    struct boot_module *mods;
> > +    boot_module_ptr_t mods;
> >
> > -    struct arch_boot_info *arch;
> > +    arch_boot_info_ptr_t arch;
> >  };
> >
> >  #endif
> > diff --git a/xen/include/xen/types.h b/xen/include/xen/types.h
> > index 6aba80500a..e807ffe255 100644
> > --- a/xen/include/xen/types.h
> > +++ b/xen/include/xen/types.h
> > @@ -71,4 +71,15 @@ typedef bool bool_t;
> >  #define test_and_set_bool(b)   xchg(&(b), true)
> >  #define test_and_clear_bool(b) xchg(&(b), false)
> >
> > +#ifndef DEFINE_STRUCT_PTR_TYPE
> > +#define DEFINE_STRUCT_PTR_TYPE(struct_name) \
> > +    typedef struct struct_name * struct_name ## _ptr_t;
> > +#endif
> > +
> > +#ifndef DEFINE_PTR_TYPE
> > +#define DEFINE_PTR_TYPE(type) \
> > +    typedef type * type ## _ptr_t;
> > +DEFINE_PTR_TYPE(char);
> > +#endif
> > +
> >  #endif /* __TYPES_H__ */
> > --
> > 2.25.1
> >
> >
>

--000000000000fc92070600f2e54a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Sat, Jul 8, 2023 at 3:24=E2=80=AFP=
M Stefano Stabellini &lt;<a href=3D"mailto:sstabellini@kernel.org">sstabell=
ini@kernel.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd=
ing-left:1ex">On Sat, 1 Jul 2023, Christopher Clark wrote:<br>
&gt; Pointer fields within structs need to be defined as fixed size types i=
n<br>
&gt; the x86 boot build environment. Using a typedef for the field type<br>
&gt; rather than a struct pointer type enables the type definition to<br>
&gt; be changed in the 32-bit boot build and the main hypervisor build,<br>
&gt; allowing for a single common structure definition and a common header =
file.<br>
<br>
Sorry for my ignorance, but why?<br>
<br>
struct boot_module is not used as part of any ABI, right? It is<br>
populated by Xen at boot by hand. Why do we need a specific memory<br>
layout for it?<br></blockquote><div><br></div><div>Fair question! In the ea=
rly x86 boot logic, which runs in 32-bit CPU mode, struct boot_module is al=
located and populated, so the structure needs to be defined and available t=
o code that is compiled in 32-bit to do that. The same structures are also =
accessed later in 64-bit hypervisor logic, and the memory layout of the str=
ucture needs to be the same in both cases, so we want all the fields to be =
fixed-width types, and that includes pointers.</div><div><br>These macros h=
elp with declaring pointers as always-64-bit-sized struct fields in a singl=
e definition of the struct. They&#39;re not strictly necessary though - pro=
viding alternative definitions for typedefs can be used instead, and I&#39;=
ve been looking at doing that since posting this patch.<br></div><div><br><=
/div><div>Christopher</div><div><br></div><div>=C2=A0</div><blockquote clas=
s=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid r=
gb(204,204,204);padding-left:1ex">
<br>
<br>
<br>
&gt; Introduces DEFINE_STRUCT_PTR_TYPE and DEFINE_PTR_TYPE which will<br>
&gt; generate typedefs with a _ptr_t suffix for pointers to the specified<b=
r>
&gt; type. This is then used in &lt;xen/bootinfo.h&gt; for pointers within =
structs<br>
&gt; as preparation for using these headers in the x86 boot build.<br>
&gt; <br>
&gt; The 32-bit behaviour is obtained by inclusion of &quot;defs.h&quot; fi=
rst with a<br>
&gt; check for such an existing definition on the &lt;xen/types.h&gt; versi=
on.<br>
&gt; <br>
&gt; paddr_t is used in &lt;xen/bootinfo.h&gt; so a definition is added her=
e to<br>
&gt; the x86 boot environment defs.h header.<br>
&gt; <br>
&gt; Signed-off-by: Christopher Clark &lt;<a href=3D"mailto:christopher.w.c=
lark@gmail.com" target=3D"_blank">christopher.w.clark@gmail.com</a>&gt;<br>
&gt; Signed-off-by: Daniel P. Smith &lt;<a href=3D"mailto:dpsmith@apertusso=
lutions.com" target=3D"_blank">dpsmith@apertussolutions.com</a>&gt;<br>
<br>
<br>
&gt; ---<br>
&gt; Changes since v2: This is two v2 patches merged into one for v3.<br>
&gt; Changes since v1: New in v2 of series.<br>
&gt; <br>
&gt;=C2=A0 xen/arch/x86/boot/defs.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 |=C2=A0 9 +++++++++<br>
&gt;=C2=A0 xen/arch/x86/include/asm/bootinfo.h |=C2=A0 4 +++-<br>
&gt;=C2=A0 xen/include/xen/bootinfo.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=
=C2=A0 9 +++++----<br>
&gt;=C2=A0 xen/include/xen/types.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0| 11 +++++++++++<br>
&gt;=C2=A0 4 files changed, 28 insertions(+), 5 deletions(-)<br>
&gt; <br>
&gt; diff --git a/xen/arch/x86/boot/defs.h b/xen/arch/x86/boot/defs.h<br>
&gt; index f9840044ec..bc0f1b5cf8 100644<br>
&gt; --- a/xen/arch/x86/boot/defs.h<br>
&gt; +++ b/xen/arch/x86/boot/defs.h<br>
&gt; @@ -60,4 +60,13 @@ typedef u64 uint64_t;<br>
&gt;=C2=A0 #define U16_MAX=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
((u16)(~0U))<br>
&gt;=C2=A0 #define UINT_MAX=C2=A0 =C2=A0 =C2=A0(~0U)<br>
&gt;=C2=A0 <br>
&gt; +typedef unsigned long long paddr_t;<br>
&gt; +<br>
&gt; +#define DEFINE_STRUCT_PTR_TYPE(struct_name) \<br>
&gt; +=C2=A0 =C2=A0 typedef uint64_t struct_name ## _ptr_t;<br>
&gt; +<br>
&gt; +#define DEFINE_PTR_TYPE(type) \<br>
&gt; +=C2=A0 =C2=A0 typedef uint64_t type ## _ptr_t;<br>
&gt; +DEFINE_PTR_TYPE(char);<br>
&gt; +<br>
&gt;=C2=A0 #endif /* __BOOT_DEFS_H__ */<br>
&gt; diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/includ=
e/asm/bootinfo.h<br>
&gt; index 30c27980e0..989fb7a1da 100644<br>
&gt; --- a/xen/arch/x86/include/asm/bootinfo.h<br>
&gt; +++ b/xen/arch/x86/include/asm/bootinfo.h<br>
&gt; @@ -6,6 +6,7 @@ struct arch_bootmodule {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 uint32_t flags;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 unsigned headroom;<br>
&gt;=C2=A0 };<br>
&gt; +DEFINE_STRUCT_PTR_TYPE(arch_bootmodule);<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 struct arch_boot_info {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 uint32_t flags;<br>
&gt; @@ -14,11 +15,12 @@ struct arch_boot_info {<br>
&gt;=C2=A0 #define BOOTINFO_FLAG_X86_MEMMAP=C2=A0 =C2=A0 =C2=A0 =C2=A01U &l=
t;&lt; 6<br>
&gt;=C2=A0 #define BOOTINFO_FLAG_X86_LOADERNAME=C2=A0 =C2=A01U &lt;&lt; 9<b=
r>
&gt;=C2=A0 <br>
&gt; -=C2=A0 =C2=A0 char *boot_loader_name;<br>
&gt; +=C2=A0 =C2=A0 char_ptr_t boot_loader_name;<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 uint32_t mmap_length;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 paddr_t mmap_addr;<br>
&gt;=C2=A0 };<br>
&gt; +DEFINE_STRUCT_PTR_TYPE(arch_boot_info);<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 struct __packed mb_memmap {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 uint32_t size;<br>
&gt; diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h<b=
r>
&gt; index 2f4284a91f..8389da4f72 100644<br>
&gt; --- a/xen/include/xen/bootinfo.h<br>
&gt; +++ b/xen/include/xen/bootinfo.h<br>
&gt; @@ -35,17 +35,18 @@ struct boot_module {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 mfn_t mfn;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 size_t size;<br>
&gt;=C2=A0 <br>
&gt; -=C2=A0 =C2=A0 struct arch_bootmodule *arch;<br>
&gt; +=C2=A0 =C2=A0 arch_bootmodule_ptr_t arch;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 struct boot_string string;<br>
&gt;=C2=A0 };<br>
&gt; +DEFINE_STRUCT_PTR_TYPE(boot_module);<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 struct boot_info {<br>
&gt; -=C2=A0 =C2=A0 char *cmdline;<br>
&gt; +=C2=A0 =C2=A0 char_ptr_t cmdline;<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 unsigned int nr_mods;<br>
&gt; -=C2=A0 =C2=A0 struct boot_module *mods;<br>
&gt; +=C2=A0 =C2=A0 boot_module_ptr_t mods;<br>
&gt;=C2=A0 <br>
&gt; -=C2=A0 =C2=A0 struct arch_boot_info *arch;<br>
&gt; +=C2=A0 =C2=A0 arch_boot_info_ptr_t arch;<br>
&gt;=C2=A0 };<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 #endif<br>
&gt; diff --git a/xen/include/xen/types.h b/xen/include/xen/types.h<br>
&gt; index 6aba80500a..e807ffe255 100644<br>
&gt; --- a/xen/include/xen/types.h<br>
&gt; +++ b/xen/include/xen/types.h<br>
&gt; @@ -71,4 +71,15 @@ typedef bool bool_t;<br>
&gt;=C2=A0 #define test_and_set_bool(b)=C2=A0 =C2=A0xchg(&amp;(b), true)<br=
>
&gt;=C2=A0 #define test_and_clear_bool(b) xchg(&amp;(b), false)<br>
&gt;=C2=A0 <br>
&gt; +#ifndef DEFINE_STRUCT_PTR_TYPE<br>
&gt; +#define DEFINE_STRUCT_PTR_TYPE(struct_name) \<br>
&gt; +=C2=A0 =C2=A0 typedef struct struct_name * struct_name ## _ptr_t;<br>
&gt; +#endif<br>
&gt; +<br>
&gt; +#ifndef DEFINE_PTR_TYPE<br>
&gt; +#define DEFINE_PTR_TYPE(type) \<br>
&gt; +=C2=A0 =C2=A0 typedef type * type ## _ptr_t;<br>
&gt; +DEFINE_PTR_TYPE(char);<br>
&gt; +#endif<br>
&gt; +<br>
&gt;=C2=A0 #endif /* __TYPES_H__ */<br>
&gt; -- <br>
&gt; 2.25.1<br>
&gt; <br>
&gt; <br>
</blockquote></div></div>

--000000000000fc92070600f2e54a--


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 22:45:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 22:45:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566789.886106 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMcP6-0008NP-Cw; Thu, 20 Jul 2023 22:45:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566789.886106; Thu, 20 Jul 2023 22:45:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMcP6-0008NG-9s; Thu, 20 Jul 2023 22:45:48 +0000
Received: by outflank-mailman (input) for mailman id 566789;
 Thu, 20 Jul 2023 22:45:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMcP5-0008N2-Hf
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 22:45:47 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMcP4-00020o-I1; Thu, 20 Jul 2023 22:45:46 +0000
Received: from 54-240-197-239.amazon.com ([54.240.197.239]
 helo=[192.168.24.131]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMcP4-0002qQ-CS; Thu, 20 Jul 2023 22:45:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=5OeqasK1yQOuaCS/hZC7U8CYPg+CPk2wdFcfMpR11dk=; b=6rFsujpJ3b9J/9cRcgxFy3pBdZ
	F9HC8W22MWzasWlm6MK1nE3KyIaGn1mUkE/+Um+ARuYODx3LvWCXvezgDzQo7xdNuAdpTrq83+p75
	FGUx3ijTTsqbPFSml0A8c23hbfeEIm27jlwal2qoDTtcf9Id1jBRFlcNwv8QCntzrA24=;
Message-ID: <d19a18c3-128b-2997-e22c-b2f2f6c46083@xen.org>
Date: Thu, 20 Jul 2023 23:45:44 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH] tools/xenstore: fix get_spec_node()
Content-Language: en-US
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230720150853.31368-1-jgross@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230720150853.31368-1-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 20/07/2023 16:08, Juergen Gross wrote:
> In case get_spec_node() is being called for a special node starting
> with '@' it won't set *canonical_name. This can result in a crash of
> xenstored due to dereferencing the uninitialized name in
> fire_watches().
> 
> This is no security issue as it requires either a privileged caller or
> ownership of the special node in question by an unprivileged caller
> (which is questionable, as this would make the owner privileged in some
> way).
> 
> Fixes: d6bb63924fc2 ("tools/xenstore: introduce dummy nodes for special watch paths")
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
>   tools/xenstore/xenstored_core.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
> index a1d3047e48..790c403904 100644
> --- a/tools/xenstore/xenstored_core.c
> +++ b/tools/xenstore/xenstored_core.c
> @@ -1252,8 +1252,11 @@ static struct node *get_spec_node(struct connection *conn, const void *ctx,
>   				  const char *name, char **canonical_name,
>   				  unsigned int perm)
>   {
> -	if (name[0] == '@')
> +	if (name[0] == '@') {
> +		if (canonical_name)
> +			*canonical_name = (char *)name;

eww. Let's not continue the bad practice in Xenstored to cast away the 
const. I will have a look to remove the const and you can rebase your 
patch on top.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 22:57:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 22:57:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566792.886115 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMcaI-0002F3-DB; Thu, 20 Jul 2023 22:57:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566792.886115; Thu, 20 Jul 2023 22:57:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMcaI-0002Ew-A3; Thu, 20 Jul 2023 22:57:22 +0000
Received: by outflank-mailman (input) for mailman id 566792;
 Thu, 20 Jul 2023 22:57:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=5z78=DG=epam.com=prvs=156527e6f7=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qMcaH-00023J-6b
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 22:57:21 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c6c32087-2750-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 00:57:18 +0200 (CEST)
Received: from pps.filterd (m0174682.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36KHu5FD013607; Thu, 20 Jul 2023 22:57:14 GMT
Received: from eur04-db3-obe.outbound.protection.outlook.com
 (mail-db3eur04lp2056.outbound.protection.outlook.com [104.47.12.56])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3ry11tb5jy-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 20 Jul 2023 22:57:14 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS8PR03MB7922.eurprd03.prod.outlook.com (2603:10a6:20b:425::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Thu, 20 Jul
 2023 22:57:11 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6609.026; Thu, 20 Jul 2023
 22:57:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c6c32087-2750-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=IGe7AEADtNv+vXawAdGBElvExWs7y0xxso5OkNWaplvAEazgSYvaSGsxzY5BOO7Bs/4SOY+4f5JqHKlLZriu4mXtfHwdlaLD8iSDM+7YChO0qdu7lvPTgP+a2DTwxOEnU+XgpMrHRvDCuJaG8umf2NCjBJEIPvEHi46OXD6sFzs+dPjDHBBGrRgEJypDcjw+o35SAq19CbLK42LFcEntCS0r+uLmZGrU9BlRgS3SC/42IqVvygXfIRjIzuFXiLeh1et5jkQaFCz4Wg9lHD3dj0YOMyQ2z5G5w9m0Zm4/UyybJDOjxgQLNWNl1MglZfguKcew9n6qANV+Y6pgdTaQ3w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=FZPMfINzEVay3nlZfRNED2DDJH0obTHCi8A4uNLqF1g=;
 b=XC9Ye++0IMZjT8QHXoFqFRBnbF4ZDRrV8ieWBYPulyhy9IJd2Uqkywel45AF4xM+IBQhUk7BURQ3wDFQUqJKeSx65bsKNnKzCSMmu+1F4OKlZYqdduBStqE5eRsj4Vi2sXrjQqF67mkn8oP8StSnWTYeyyiJM6tRUhL57f7J+RHa5PXiwM3WKOK/eEvXBDrteXD85xggoSkqm9g4G1325RjhdH9wbf0YZD46vmD/pvs2PqlzsTwrOgj1CQQdEpZAqRzZ6xrqeMufzFXqFcOFj995PugB+hOnIwXbFvk5G38IGue/zmC0UHKxQA/qzv45nQngnJfSFT5wXqit9y+ouA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=FZPMfINzEVay3nlZfRNED2DDJH0obTHCi8A4uNLqF1g=;
 b=Ghq1lHo0bSHh2Xd0WCW7H49+EoQXJ774oOjv3JthtsgLeaJlCANdrRXZqvy70y5rFqx+AgYtn9zNvgLzee+TgjZDU3Q8h3wLN/ZtNVqw5dcXHty55HX9vjqkN8JYBd08voQIIt3Ax2aLlf77smYD83ytTO8KWyNU3znC6D5yzES2sxRvgUYqi3e75XC+P4l5zHmxwcFtvY5MJDTcBN5/xR+/9PdbRobrTQddcA3r0ZT6Rz7BNluWaLjKUatnXs8iAJCx7FYSEO6TiEXahh4Ch9u6Y/E0TAJDcLRfJXfg/gMufwzLBzppfRkdXTs21hnK+8sVA7LLur9/GANvDODsyg==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
        Jan
 Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v8 01/13] pci: introduce per-domain PCI rwlock
Thread-Topic: [PATCH v8 01/13] pci: introduce per-domain PCI rwlock
Thread-Index: AQHZuqGr3g/gocvkCU2kdSqq613Aoa/CaIaAgADZI4A=
Date: Thu, 20 Jul 2023 22:57:10 +0000
Message-ID: <877cqufayj.fsf@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-2-volodymyr_babchuk@epam.com>
 <ZLkCL4TbE0sWZjd3@MacBook-Air-de-Roger.local>
In-Reply-To: <ZLkCL4TbE0sWZjd3@MacBook-Air-de-Roger.local>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: mu4e 1.8.9; emacs 28.2
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS8PR03MB7922:EE_
x-ms-office365-filtering-correlation-id: 35e2e040-4207-4577-c720-08db8974a666
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 mM2FQE6zUTJmeyRLtNNBtrJPus+aIRPMjpciGvM4AxvhkIy8+Jc6L1PQlqJNeVugwhm68a0JCmveq3lTEv8uUT2opEShAIk7uu4nxqBFcTROZcia4S9En+I1U+XjKz7nNkmVYSKhnM8YQfouWci2/PQbMYQY613cw6Oz3O1f+vSl0V0TUeAS9tWb9txruhX6oTBJt5JJM/mh4AC2LAecxhsk+n09j1hoiE5xKJeIs/0UeMen9m2B3y7hZSCtIdFqnAakNfXNCNTxrBcbton8Qfji/w2ukcoXp++MwRgLDZfolNZoIOVY0NwXxarOq55q7+Pojl819HnM/bQSiDe71/0jnD/gH3zprnLPIjBGf7hk68NE6S4SC/QjDrmOaUaLsIdmxrpGkxZtYQVYwaeoYokIqTJ3viQCPqyU+JYxWFCZhspm4FnOhoqz7mQo9eY4JrPAuJprdgX+rjSSmAfIhh46ZxwKANOfc3b4xztdn0OWNezuaelI89rFULoIDRGSFoPLTcjEOKo5BjtGB9bcRA5Lb9xaitRNoGXxRXGx7cpM42ihl80YS6l8pfqt/6WLeOtfwdNDmFYQZ0A88Z5mE8Rrg9ZJl1Abzo4eF+YAQopQJ5I+WnpW4s2JBPzFwq2/
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(396003)(39860400002)(376002)(366004)(451199021)(55236004)(478600001)(6512007)(6486002)(71200400001)(2616005)(8936002)(26005)(83380400001)(6506007)(186003)(5660300002)(76116006)(2906002)(64756008)(54906003)(66476007)(66446008)(66946007)(4326008)(91956017)(66556008)(6916009)(41300700001)(316002)(8676002)(38070700005)(86362001)(36756003)(38100700002)(122000001)(66899021);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?UnFsVENQT082Y1BBdXlObnBuQ01iK2dXbDc3d1B6NVdrb0hQY0dFWDIza0lj?=
 =?utf-8?B?WVBZcUZaOEJFRTRtbW9WK2d1bXBPKzN2bmgzdGsvMkJ1eGRKRkNSNlYybFRZ?=
 =?utf-8?B?ZktaUlY5Z255eGlsalBwWk10TFlwdGwyT3R3STlDbkhDV2g0MnhUdE9jWF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1CejFjZXNmb2NXalVVYVBZL09jUkpoK1BuN3hrclQzOWZMZzdC?=
 =?utf-8?B?TnNndDk3cnBDSTkrRjVhaVZsT0ZPTGEvUTJYdCtLSlMrVEx3MG8vS0xyTWQz?=
 =?utf-8?B?NFdtVWUyMUpmREZYcjVWZHhGbTdaaXRCODdsL0hPVWZNVDRJeTg5a1VHc1hB?=
 =?utf-8?B?bERHTlhHQ1p1UjVOaTRYeHJNc0RPL0QrcmwyUE5xNi8rR0orOFZMdktnMG1X?=
 =?utf-8?B?TWlqNE02RDNUTmdRWk01MHpBLytZVEpLWGJUOU5YSkxQRFVUQ2s2TWZYQXRD?=
 =?utf-8?B?L0E9PQ==?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <0995E249DB89BA4BBA7853E2810871F3@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 35e2e040-4207-4577-c720-08db8974a666
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 22:57:10.3786
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: JaK8wzfaTf8cAHttisuad0v5yWG+z7GMP8lV1qOIpebmhdyLgxjP8bNV9TCxMcwnVkTa8k20rNiB/0NRmvtASe1uPnRVL2yBbTzitH9Lc0I=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7922
X-Proofpoint-GUID: x0cy3MUKE8iCdfZ9-VrDYSQEKJKv2k01
X-Proofpoint-ORIG-GUID: x0cy3MUKE8iCdfZ9-VrDYSQEKJKv2k01
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-20_10,2023-07-20_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0
 priorityscore=1501 mlxscore=0 phishscore=0 clxscore=1015 impostorscore=0
 adultscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 suspectscore=0
 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307200195

DQpIaSBSb2dlciwNCg0KUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+IHdy
aXRlczoNCg0KPiBPbiBUaHUsIEp1bCAyMCwgMjAyMyBhdCAxMjozMjozMUFNICswMDAwLCBWb2xv
ZHlteXIgQmFiY2h1ayB3cm90ZToNCj4+IEFkZCBwZXItZG9tYWluIGQtPnBjaV9sb2NrIHRoYXQg
cHJvdGVjdHMgYWNjZXNzIHRvDQo+PiBkLT5wZGV2X2xpc3QuIFB1cnBvc2Ugb2YgdGhpcyBsb2Nr
IGlzIHRvIGdpdmUgZ3VhcmFudGVlcyB0byBWUENJIGNvZGUNCj4+IHRoYXQgdW5kZXJseWluZyBw
ZGV2IHdpbGwgbm90IGRpc2FwcGVhciB1bmRlciBmZWV0LiBUaGlzIGlzIGEgcnctbG9jaywNCj4+
IGJ1dCB0aGlzIHBhdGNoIGFkZHMgb25seSB3cml0ZV9sb2NrKClzLiBUaGVyZSB3aWxsIGJlIHJl
YWRfbG9jaygpDQo+PiB1c2VycyBpbiB0aGUgbmV4dCBwYXRjaGVzLg0KPj4gDQo+PiBUaGlzIGxv
Y2sgc2hvdWxkIGJlIHRha2VuIGluIHdyaXRlIG1vZGUgZXZlcnkgdGltZSBkLT5wZGV2X2xpc3Qg
aXMNCj4+IGFsdGVyZWQuIFRoaXMgY292ZXJzIGJvdGggYWNjZXNzZXMgdG8gZC0+cGRldl9saX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o+PiArICAgICAgICByZXQgPSBkZWFzc2lnbl9kZXZpY2UoZCwgc2VnLCBidXMs
IGRldmZuKTsNCj4+ICsgICAgICAgIHdyaXRlX2xvY2soJmQtPnBjaV9sb2NrKTsNCj4+ICsgICAg
ICAgIGlmICggcmV0ICkNCj4+ICsgICAgICAgIHsNCj4+ICsgICAgICAgICAgICBib29sIHN0aWxs
X3ByZXNlbnQgPSBmYWxzZTsNCj4+ICsgICAgICAgICAgICBjb25zdCBzdHJ1Y3QgcGNpX2RldiAq
dG1wOw0KPj4gKw0KPj4gKyAgICAgICAgICAgIC8qDQo+PiArICAgICAgICAgICAgICogV2UgbmVl
ZCB0byBjaGVjayBpZiBkZWFzc2lnbl9kZXZpY2UoKSBsZWZ0IG91ciBwZGV2IGluDQo+PiArICAg
ICAgICAgICAgICogZG9tYWluJ3MgbGlzdC4gQXMgd2UgZHJvcHBlZCB0aGUgbG9jaywgd2UgY2Fu
J3QgYmUgc3VyZQ0KPj4gKyAgICAgICAgICAgICAqIHRoYXQgbGlzdCB3YXNuJ3QgcGVybXV0YXRl
ZCBpbiBzb21lIHJhbmRvbSB3YXksIHNvIHdlDQo+PiArICAgICAgICAgICAgICogbmVlZCB0byB0
cmF2ZXJzZSB0aGUgd2hvbGUgbGlzdC4NCj4+ICsgICAgICAgICAgICAgKi8NCj4+ICsgICAgICAg
ICAgICBmb3JfZWFjaF9wZGV2ICggZCwgdG1wICkNCj4+ICsgICAgICAgICAgICB7DQo+PiArICAg
ICAgICAgICAgICAgIGlmICggdG1wID09IHBkZXYgKQ0KPj4gKyAgICAgICAgICAgICAgICB7DQo+
PiArICAgICAgICAgICAgICAgICAgICBzdGlsbF9wcmVzZW50ID0gdHJ1ZTsNCj4+ICsgICAgICAg
ICAgICAgICAgICAgIGJyZWFrOw0KPj4gKyAgICAgICAgICAgICAgICB9DQo+PiArICAgICAgICAg
ICAgfQ0KPj4gKyAgICAgICAgICAgIGlmICggc3RpbGxfcHJlc2VudCApDQo+PiArICAgICAgICAg
ICAgICAgIGxpc3RfbW92ZSgmcGRldi0+ZG9tYWluX2xpc3QsICZmYWlsZWRfcGRldnMpOw0KPg0K
PiBZb3UgY2FuIGdldCByaWQgb2YgdGhlIHN0aWxsX3ByZXNlbnQgdmFyaWFibGUsIGFuZCBqdXN0
IGRvOg0KPg0KPiBmb3JfZWFjaF9wZGV2ICggZCwgdG1wICkNCj4gICAgIGlmICggdG1wID09IHBk
ZXYgKQ0KPiAgICAgew0KPiAgICAgICAgIGxpc3RfbW92ZSgmcGRldi0+ZG9tYWluX2xpc3QsICZm
YWlsZWRfcGRldnMpOw0KPiAJYnJlYWs7DQo+ICAgICB9DQo+DQo+DQoNClllcCwgdGhhbmtzLg0K
DQoNCi0tIA0KV0JSLCBWb2xvZHlteXI=


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 23:25:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 23:25:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566796.886126 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMd1k-0006VS-LK; Thu, 20 Jul 2023 23:25:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566796.886126; Thu, 20 Jul 2023 23:25:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMd1k-0006VL-Ht; Thu, 20 Jul 2023 23:25:44 +0000
Received: by outflank-mailman (input) for mailman id 566796;
 Thu, 20 Jul 2023 23:25:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=1UDO=DG=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMd1j-0006VF-Fu
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 23:25:43 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bc31e3b7-2754-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 01:25:39 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id E8A8061CBA;
 Thu, 20 Jul 2023 23:25:37 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7684DC433C7;
 Thu, 20 Jul 2023 23:25:36 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bc31e3b7-2754-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689895537;
	bh=pltAmrO30goYJZGPg3bwSoQ75w1SmPjLZB9e58iNaKw=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=T4zr3aJiZaw7S5pFLvpEQcP5xYvN/o8Eg05dTjxG5SHeF/WDNcsgp7YPG6NbvX08c
	 +UxZDN+UZXyA58KsRWv+/9sPFNKN6uJXrwY2XTftscrQqvZF3I1SzH0aBIClmNu/kX
	 F3Vn3ASrIeWP5ODR1/XTVnWggl07/M2Ln4vwYQS1cM5xpv5ZnUJahovrjWIm/m1lwt
	 PiKiWEjGgA45rdqsOkxQKyZtQEgE0cyu5SakpOFY0vA4hhsTJEDLWe0clb6cV+L783
	 iclD75mhKZ+G7tkxr6lasn5oE7jtfZL90bIulO9P1OOhkUOmJfScVCJ26kGSHiWhVS
	 ic+2d6bJzHvuQ==
Date: Thu, 20 Jul 2023 16:25:34 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Julien Grall <julien@xen.org>
cc: "Andrei Cherechesu (OSS)" <andrei.cherechesu@oss.nxp.com>, 
    xen-devel@lists.xenproject.org, 
    Stefano Stabellini <sstabellini@kernel.org>, george.mocanu@nxp.com, 
    Juergen Gross <jgross@suse.com>
Subject: Re: [ARM][xencons] PV Console hangs due to illegal ring buffer
 accesses
In-Reply-To: <048266d6-a32f-5f4e-984a-8b74de01a1fc@xen.org>
Message-ID: <alpine.DEB.2.22.394.2307201609030.3118466@ubuntu-linux-20-04-desktop>
References: <62eeff72-c1fb-6932-6797-1b0058c97b03@oss.nxp.com> <048266d6-a32f-5f4e-984a-8b74de01a1fc@xen.org>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 20 Jul 2023, Julien Grall wrote:
> (+ Juergen)
> 
> On 19/07/2023 17:13, Andrei Cherechesu (OSS) wrote:
> > Hello,
> 
> Hi Andrei,
> 
> > As we're running Xen 4.17 (with platform-related support added) on NXP S32G
> > SoCs (ARMv8), with a custom Linux distribution built through Yocto, and
> > we've set some Xen-based demos up, we encountered some issues which we think
> > might not be related to our hardware. For additional context, the Linux
> > kernel version we're running is 5.15.96-rt (with platform-related support
> > added as well).
> > 
> > The setup to reproduce the problem is fairly simple: after booting a Dom0
> > (can provide configuration details if needed), we're booting a normal PV
> > DomU with PV Networking. Additionally, the VMs have k3s (Lightweight
> > Kubernetes - version v1.25.8+k3s1:
> > https://github.com/k3s-io/k3s/releases/tag/v1.25.8%2Bk3s1) installed in
> > their rootfs'es.
> > 
> > The problem is that the DomU console hangs (no new output is shown, no input
> > can be sent) some time (non-deterministic, sometimes 5 seconds, other times
> > like 15-20 seconds) after we run the `k3s server` command. We have this
> > command running as part of a sysvinit service, and the same behavior can be
> > observed in that case as well. The k3s version we use is the one mentioned
> > in the paragraph above, but this can be reproduced with other versions as
> > well (i.e., v1.21.11, v1.22.6). If the `k3s server` command is ran in the
> > Dom0 VM, everything works fine. Using DomU as an agent node is also working
> > fine, only when it is run as a server the console problem occurs.
> > 
> > Immediately after the serial console hangs, we can still log in on DomU
> > using SSH, and we can observe the following messages its dmesg:
> > [   57.905806] xencons: Illegal ring page indices
> 
> Looking at Linux code, this message is printed in a couple of place in the
> xenconsole driver.
> 
> I would assume that this is printed when reading from the buffer (otherwise
> you would not see any message). Can you confirm it?
> 
> Also, can you provide the indices that Linux considers buggy?
> 
> Lastly, it seems like the barrier used are incorrect. It should be the
> virt_*() version rather than a plain mb()/wmb(). I don't think it matter for
> arm64 though (I am assuming you are not running 32-bit).
> 
> > [   59.399620] xenbus: error -5 while reading message
> 
> So this message is coming from the xenbus driver (used to read the xenstore
> ring). This is -EIO, and AFAICT returned when the indices are also incorrect.
> 
> For this driver, I think there is also a TOCTOU because a compiler is free to
> reload intf->rsp_cons after the check. Moving virt_mb() is probably not
> sufficient. You would also want to use ACCESS_ONCE().
> 
> What I find odd is you have two distinct rings (xenconsole and xenbus) with
> similar issues. Above, you said you are using Linux RT. I wonder if this has a
> play into the issue because if I am not mistaken, the two functions would now
> be fully preemptible.
> 
> This could expose some races. For instance, there are some missing
> ACCESS_ONCE() (as mentioned above).
> 
> In particular, Xenstored (I haven't checked xenconsoled) is using += to update
> intf->rsp_cons. There is no guarantee that the update will be atomic.
> 
> Overall, I am not 100% sure what I wrote is related. But that's probably a
> good start of things that can be exacerbated with Linux RT.
> 
> > [   59.399649] xenbus: error -5 while writing message
> 
> This is in xenbus as well. But this time in the write part. The analysis I
> wrote above for the read part can be applied here.

This is really strange. What is also strange is that somehow the indexes
recover after 10-15 seconds? How is that even possible. Let's say there
is a memory corruption of some sort, maybe due to missing barriers like
Julien suggested, how can it go back to normal after a while?

I am really confused. I would try with regular Linux instead of Linux RT
and also would try to replace all the barriers in
drivers/tty/hvc/hvc_xen.c with their virt_* version to see if we can
narrow down the problem a bit.


Keep in mind that during PV network operations grants are used, which
involve mapping pages at the backend and changing the MMU/IOMMU
pagetables to introduce the new mapping. After the DMA operation,
typically the page is unmapped and removed from the pagetable.

Is it possible that the pagetable change is causing the problem, and
when the mapping is removed everything goes back to normal?

I don't know how that could happen, but the mapping and unmapping of the
page is something ongoing which could break things then go back to
normal. One thing you could try is to force all DMA operations to go via
swiotlb-xen in Linux:

diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c
index 3d826c0b5fee..f78d86f1bb9c 100644
--- a/arch/arm/xen/mm.c
+++ b/arch/arm/xen/mm.c
@@ -112,8 +112,7 @@ bool xen_arch_need_swiotlb(struct device *dev,
         * require a bounce buffer because the device doesn't support coherent
         * memory and we are not able to flush the cache.
         */
-       return (!hypercall_cflush && (xen_pfn != bfn) &&
-               !dev_is_dma_coherent(dev));
+       return true;
 }
 
 static int __init xen_mm_init(void)


Then you can remove any iommu pagetable flushes in Xen:


diff --git a/xen/arch/arm/include/asm/grant_table.h b/xen/arch/arm/include/asm/grant_table.h
index d3c518a926..b72f8391bd 100644
--- a/xen/arch/arm/include/asm/grant_table.h
+++ b/xen/arch/arm/include/asm/grant_table.h
@@ -74,7 +74,7 @@ int replace_grant_host_mapping(uint64_t gpaddr, mfn_t frame,
     page_get_xenheap_gfn(gnttab_status_page(t, i))
 
 #define gnttab_need_iommu_mapping(d)                    \
-    (is_domain_direct_mapped(d) && is_iommu_enabled(d))
+    (0)
 
 #endif /* __ASM_GRANT_TABLE_H__ */
 /*


I don't know how this could be related but it might help narrow down the
problem.


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 23:29:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 23:29:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566799.886136 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMd4s-0007Rk-2Z; Thu, 20 Jul 2023 23:28:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566799.886136; Thu, 20 Jul 2023 23:28:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMd4r-0007Rd-Vo; Thu, 20 Jul 2023 23:28:57 +0000
Received: by outflank-mailman (input) for mailman id 566799;
 Thu, 20 Jul 2023 23:28:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMd4q-0007RT-Oc; Thu, 20 Jul 2023 23:28:56 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMd4q-000351-G6; Thu, 20 Jul 2023 23:28:56 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMd4p-0007lt-Vo; Thu, 20 Jul 2023 23:28:56 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMd4p-0005dn-VG; Thu, 20 Jul 2023 23:28:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=UNhfh1ZgSK75kidUrCVHDfijkuUJFMBsyLX9FWiqVME=; b=cRsDzzoqYqysRZEj9h+Mfo9swy
	0MlrewflkfLGxabOiWizOQVRp/49YZfKicdSko1EOsfEj9qJNu5eqJsRBugapt+wGLbTT4PmyZZZC
	sV7By7Zfhc0K+/SF+z1fii88kXCkZIxbahsEBtYgL8CiDwYE6cd6tbtAgFh1pu2bFG8M=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181917-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 181917: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=fa0d5f4ebc0aa178d9dea278914f9149a4c4af54
X-Osstest-Versions-That:
    libvirt=aece25f66517a327c2a6bde4d06b432d415ed7da
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 20 Jul 2023 23:28:55 +0000

flight 181917 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181917/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181890
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181890
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181890
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 libvirt              fa0d5f4ebc0aa178d9dea278914f9149a4c4af54
baseline version:
 libvirt              aece25f66517a327c2a6bde4d06b432d415ed7da

Last test of basis   181890  2023-07-19 04:20:19 Z    1 days
Testing same since   181917  2023-07-20 04:21:51 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Boris Fiuczynski <fiuczy@linux.ibm.com>
  Han Han <hhan@redhat.com>
  Jonathon Jongsma <jjongsma@redhat.com>
  Michal Privoznik <mprivozn@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   aece25f665..fa0d5f4ebc  fa0d5f4ebc0aa178d9dea278914f9149a4c4af54 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 23:31:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 23:31:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566804.886146 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMd7I-0000Qn-G8; Thu, 20 Jul 2023 23:31:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566804.886146; Thu, 20 Jul 2023 23:31:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMd7I-0000Qg-D6; Thu, 20 Jul 2023 23:31:28 +0000
Received: by outflank-mailman (input) for mailman id 566804;
 Thu, 20 Jul 2023 23:31:26 +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
 <SRS0=1UDO=DG=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMd7G-0000Qa-Ed
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 23:31:26 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8858db9c-2755-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 01:31:22 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 6F77061CBF;
 Thu, 20 Jul 2023 23:31:20 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D472C433CA;
 Thu, 20 Jul 2023 23:31:18 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8858db9c-2755-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689895879;
	bh=oE9QZcmvPVcOSiuYsuycZcR8Tm3RiAzrRkw/xfdsxDg=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=l5DAQcOaI0SPtHdnvGEKgkZ3rGNjB59ePBHi7yJ/P1LFpaKKmozEPph8CazSMn2Hk
	 nZJ0Rnt9FYVD2KoKEasr4cREIzxnnGcwmLafXi1Y5r9s7YJmEE5v5JACdjnwh+MeCo
	 AHFHm7U/T5nPSfpzBehXDZ2ELZoFbaVcO38ZiVIa1PiIxDuQx9XggEbkmnN/n4u2D3
	 2XDT32S5tzn0xyuCMv4PO6CJhg3DqIZiGQgzGGjEVK+KaR65qSi+gfa4aQjrvv19Jh
	 qQ6ZNRlsKAr27GGEyeYVm8MZwtOwCP6Irf33dR9CLv/S1/2cThTfkLhtISYzuzK9aq
	 z6D/rYSSs+RWw==
Date: Thu, 20 Jul 2023 16:31:16 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Petr Mladek <pmladek@suse.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, boris.ostrovsky@oracle.com, 
    jgross@suse.com, xen-devel@lists.xenproject.org, 
    Luca Miccio <lucmiccio@gmail.com>, 
    Stefano Stabellini <stefano.stabellini@xilinx.com>, 
    live-patching@vger.kernel.org, Jens Axboe <axboe@kernel.dk>, 
    Peter Zijlstra <peterz@infradead.org>, 
    Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH LINUX v5 2/2] xen: add support for initializing xenstore
 later as HVM domain
In-Reply-To: <ZLkKAO09DnM8quG-@alley>
Message-ID: <alpine.DEB.2.22.394.2307201629190.3118466@ubuntu-linux-20-04-desktop>
References: <alpine.DEB.2.22.394.2205131417320.3842@ubuntu-linux-20-04-desktop> <20220513211938.719341-2-sstabellini@kernel.org> <ZLgFmS4TQwGWA7o0@alley> <alpine.DEB.2.22.394.2307191841290.3118466@ubuntu-linux-20-04-desktop> <ZLkKAO09DnM8quG-@alley>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 20 Jul 2023, Petr Mladek wrote:
> On Wed 2023-07-19 18:46:08, Stefano Stabellini wrote:
> > On Wed, 19 Jul 2023, Petr Mladek wrote:
> > > On Fri 2022-05-13 14:19:38, Stefano Stabellini wrote:
> > > > From: Luca Miccio <lucmiccio@gmail.com>
> > > > 
> > > > When running as dom0less guest (HVM domain on ARM) the xenstore event
> > > > channel is available at domain creation but the shared xenstore
> > > > interface page only becomes available later on.
> > > > 
> > > > In that case, wait for a notification on the xenstore event channel,
> > > > then complete the xenstore initialization later, when the shared page
> > > > is actually available.
> > > > 
> > > > The xenstore page has few extra field. Add them to the shared struct.
> > > > One of the field is "connection", when the connection is ready, it is
> > > > zero. If the connection is not-zero, wait for a notification.
> > > 
> > > I see the following warning from free_irq() in 6.5-rc2 when running
> > > livepatching selftests. It does not happen after reverting this patch.
> > > 
> > > [  352.168453] livepatch: signaling remaining tasks
> > > [  352.173228] ------------[ cut here ]------------
> > > [  352.175563] Trying to free already-free IRQ 0
> > > [  352.177355] WARNING: CPU: 1 PID: 88 at kernel/irq/manage.c:1893 free_irq+0xbf/0x350
> > > [  352.179942] Modules linked in: test_klp_livepatch(EK)
> > > [  352.181621] CPU: 1 PID: 88 Comm: xenbus_probe Kdump: loaded Tainted: G            E K    6.5.0-rc2-default+ #535
> > > [  352.184754] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.15.0-0-g2dd4b9b-rebuilt.opensuse.org 04/01/2014
> > > [  352.188214] RIP: 0010:free_irq+0xbf/0x350
> > > [  352.192211] Code: 7a 08 75 0e e9 36 02 00 00 4c 3b 7b 08 74 5a 48 89 da 48 8b 5a 18 48 85 db 75 ee 44 89 f6 48 c7 c7 58 b0 8b 86 e8 21 0a f5 ff <0f> 0b 48 8b 34 24 4c 89 ef e8 53 bb e3 00 
> > > 48 8b 45 40 48 8b 40 78
> > > [  352.200079] RSP: 0018:ffffaf0440b4be80 EFLAGS: 00010086
> > > [  352.201465] RAX: 0000000000000000 RBX: ffff99f105116c80 RCX: 0000000000000003
> > > [  352.203324] RDX: 0000000080000003 RSI: ffffffff8691d4bc RDI: 00000000ffffffff
> > > [  352.204989] RBP: ffff99f100052000 R08: 0000000000000000 R09: c0000000ffff7fff
> > > [  352.206253] R10: ffffaf0440b4bd18 R11: ffffaf0440b4bd10 R12: ffff99f1000521e8
> > > [  352.207451] R13: ffff99f1000520a8 R14: 0000000000000000 R15: ffffffff86f42360
> > > [  352.208787] FS:  0000000000000000(0000) GS:ffff99f15a400000(0000) knlGS:0000000000000000
> > > [  352.210061] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > > [  352.210815] CR2: 00007f8415d56000 CR3: 0000000105e36003 CR4: 0000000000370ee0
> > > [  352.211867] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> > > [  352.212912] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> > > [  352.213951] Call Trace:
> > > [  352.214390]  <TASK>
> > > [  352.214717]  ? __warn+0x81/0x170
> > > [  352.215436]  ? free_irq+0xbf/0x350
> > > [  352.215906]  ? report_bug+0x10b/0x200
> > > [  352.216408]  ? prb_read_valid+0x17/0x20
> > > [  352.216926]  ? handle_bug+0x44/0x80
> > > [  352.217409]  ? exc_invalid_op+0x13/0x60
> > > [  352.217932]  ? asm_exc_invalid_op+0x16/0x20
> > > [  352.218497]  ? free_irq+0xbf/0x350
> > > [  352.218979]  ? __pfx_xenbus_probe_thread+0x10/0x10
> > > [  352.219600]  xenbus_probe+0x7a/0x80
> > > [  352.221030]  xenbus_probe_thread+0x76/0xc0
> > > [  352.221416]  ? __pfx_autoremove_wake_function+0x10/0x10
> > > [  352.221882]  kthread+0xfd/0x130
> > > [  352.222191]  ? __pfx_kthread+0x10/0x10
> > > [  352.222544]  ret_from_fork+0x2d/0x50
> > > [  352.222893]  ? __pfx_kthread+0x10/0x10
> > > [  352.223260]  ret_from_fork_asm+0x1b/0x30
> > > [  352.223629] RIP: 0000:0x0
> > > [  352.223931] Code: Unable to access opcode bytes at 0xffffffffffffffd6.
> > > [  352.224488] RSP: 0000:0000000000000000 EFLAGS: 00000000 ORIG_RAX: 0000000000000000
> > > [  352.225044] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
> > > [  352.225571] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
> > > [  352.226106] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
> > > [  352.226632] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
> > > [  352.227171] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
> > > [  352.227710]  </TASK>
> > > [  352.227917] irq event stamp: 22
> > > [  352.228209] hardirqs last  enabled at (21): [<ffffffff854240be>] ___slab_alloc+0x68e/0xc80
> > > [  352.228914] hardirqs last disabled at (22): [<ffffffff85fe98fd>] _raw_spin_lock_irqsave+0x8d/0x90
> > > [  352.229546] softirqs last  enabled at (0): [<ffffffff850fc0ee>] copy_process+0xaae/0x1fd0
> > > [  352.230079] softirqs last disabled at (0): [<0000000000000000>] 0x0
> > > [  352.230503] ---[ end trace 0000000000000000 ]---
> > > 
> > > , where the message "livepatch: signaling remaining tasks" means that
> > > it might send fake signals to non-kthread tasks.
> > > 
> > > The aim is to force userspace tasks to enter and leave kernel space
> > > so that they might start using the new patched code. It is done
> > > this way:
> > > 
> > > /*
> > >  * Sends a fake signal to all non-kthread tasks with TIF_PATCH_PENDING set.
> > >  * Kthreads with TIF_PATCH_PENDING set are woken up.
> > >  */
> > > static void klp_send_signals(void)
> > > {
> > > [...]
> > > 
> > > 			/*
> > > 			 * Send fake signal to all non-kthread tasks which are
> > > 			 * still not migrated.
> > > 			 */
> > > 			set_notify_signal(task);
> > > [...]
> > > 
> > > The warning is most likely printed in this condition:
> > > 
> > > const void *free_irq(unsigned int irq, void *dev_id)
> > > {
> > > 	struct irq_desc *desc = irq_to_desc(irq);
> > > 	struct irqaction *action;
> > > 	const char *devname;
> > > 
> > > 	if (!desc || WARN_ON(irq_settings_is_per_cpu_devid(desc)))
> > > 		return NULL;
> > > 
> > > 
> > > See below.
> > > 
> > > > --- a/drivers/xen/xenbus/xenbus_probe.c
> > > > +++ b/drivers/xen/xenbus/xenbus_probe.c
> > > > @@ -750,6 +751,20 @@ static void xenbus_probe(void)
> > > >  {
> > > >  	xenstored_ready = 1;
> > > >  
> > > > +	if (!xen_store_interface) {
> > > > +		xen_store_interface = xen_remap(xen_store_gfn << XEN_PAGE_SHIFT,
> > > > +						XEN_PAGE_SIZE);
> > > > +		/*
> > > > +		 * Now it is safe to free the IRQ used for xenstore late
> > > > +		 * initialization. No need to unbind: it is about to be
> > > > +		 * bound again from xb_init_comms. Note that calling
> > > > +		 * unbind_from_irqhandler now would result in xen_evtchn_close()
> > > > +		 * being called and the event channel not being enabled again
> > > > +		 * afterwards, resulting in missed event notifications.
> > > > +		 */
> > > > +		free_irq(xs_init_irq, &xb_waitq);
> > > 
> > > Is it possbile that this free_irq(), the fake signal, and the warning
> > > are somehow related, please?
> > 
> > I don't know how the fake signal could relate to this,
> 
> In short, the fake signal sets TIF_NOTIFY_SIGNAL and wakes
> the kthread. It has special handling in signal_pending().
> It causes that wait_interruptible() and friends would prematurely
> stop waiting.
> 
> It is used primary to speedup/unblock livepatching and some io_uring
> operations.
> 
> I do not know where exactly it triggers the XEN code.
> 
> > but it would seem
> > that either:
> > 1) free_irq is called twice
> > 2) free_irq is called but xs_init_irq wasn't initialized before
> > 
> > For 2) I can see that xenbus_probe() is called in a few cases where
> > xs_init_irq wasn't set. Something like the below would make the warning
> > go away but it would be nice to figure out which one is the code path
> > taken that originally triggered the warning.
> 
> I added some debugging messages and:
> 
>   + xenbus_probe() was called in xenbus_probe_thread().
> 
>   + xenbus_init() returned early after xen_domain() check so that
>     xs_init_irq was never initialized.
> 
> Note that I use KVM and not XEN:
> 
> [    0.000000] Hypervisor detected: KVM
> [...]
> [    0.072150] Booting paravirtualized kernel on KVM

Ah! So the issue is that xenbus_init() returns early but
xenbus_probe_initcall() doesn't. So maybe we just need a xen_domain
check in xenbus_probe_initcall too.

diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index 58b732dcbfb8..e9bd3ed70108 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -811,6 +812,9 @@ static int xenbus_probe_thread(void *unused)
 
 static int __init xenbus_probe_initcall(void)
 {
+	if (!xen_domain())
+		return -ENODEV;
+
 	/*
 	 * Probe XenBus here in the XS_PV case, and also XS_HVM unless we
 	 * need to wait for the platform PCI device to come up or


From xen-devel-bounces@lists.xenproject.org Thu Jul 20 23:37:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Jul 2023 23:37:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566808.886156 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMdDB-0001VV-Aa; Thu, 20 Jul 2023 23:37:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566808.886156; Thu, 20 Jul 2023 23:37:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMdDB-0001VO-7R; Thu, 20 Jul 2023 23:37:33 +0000
Received: by outflank-mailman (input) for mailman id 566808;
 Thu, 20 Jul 2023 23:37:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=5z78=DG=epam.com=prvs=156527e6f7=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qMdDA-0001VI-GR
 for xen-devel@lists.xenproject.org; Thu, 20 Jul 2023 23:37:32 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 646a1544-2756-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 01:37:30 +0200 (CEST)
Received: from pps.filterd (m0174681.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36KM1ina021895; Thu, 20 Jul 2023 23:37:28 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2050.outbound.protection.outlook.com [104.47.13.50])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3rxknwnp33-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 20 Jul 2023 23:37:28 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by DB9PR03MB7385.eurprd03.prod.outlook.com (2603:10a6:10:222::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Thu, 20 Jul
 2023 23:37:24 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6609.026; Thu, 20 Jul 2023
 23:37:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 646a1544-2756-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=MepVV0JEgr6+6Oy/aoXcrSiXkJ3Kc8hC7mBjjz2k7bjeZSxzmKt8SySTse4I5t+SAHh0oR/+v9wlvRfvAMt6L5H4+ipUU61xRqLzgJGXd0uNih8Oa+EE0T3Rs8txjaUuVXc1duNQbLhwddADx0t76Y2EQyxw4V0ZGjgcJsFvTHOnx+XJt7zmdAemkZoiD5au24VMgrMB53iVdPYvY4oaglI1jEwg7L8XabzBlmpmBPFKRLD4QA4o8PRvdQCX5B3S9RqFU9TRKT3PbaWUacz/5lrO3pXupcBsbG/xXehotDAtOOVfi1xHSj/GVpsp/vU+a4f+q3h59sfGOa0RKseHKw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=qaYDi3NstrVNCkpkxaVmpvrl7M537rpQ+bzUpN4xTdk=;
 b=eRk4Mz91bAPViOAK73tnFD6RQOKLhSynF7wfU0TNvePOcfTik+EpoDxnmFXa7jLNcCMVG0kzo+JYYO56jLTGhK9ddW8qsEM4peKUPzclla+izmKBPuAH5DCySxqOfL6FYMHM7cn9Cw2luH/uAO8QQTzk4KvwwZmjhKfdIFpxXG/MdRZMcQMcZyB8CkLJCFoQ4Ef5hVAp2DN8hvoZuAGCly70LWbUkYfeLz180gNzH29clNfp+UFZbIr2vt7DTXitGJnqwtQnETWW2VZ49UCztp2E+uvar3dDj0EW0VCwBGhz1LNkJ6S5GtQW1z2c2s4JSYOxSpJXKRN5aiMJuuV1jA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=qaYDi3NstrVNCkpkxaVmpvrl7M537rpQ+bzUpN4xTdk=;
 b=XSS9K7DFTgQhXE9ZtmR4MwlPtVEF3bPXsSZspxWUdczuRHfFSTxLMrdbaNI9oXn3V5jj24eG9O90kC4PUvGmD4Nj86k0I9JO7FDVB0kmLKaFfX7LSLMEXHkGqeQkfWMeo8/rxwlcQVUZUh41FXx00nsXEP9pgb80ggkHGHV/eWTK+8wycBSxfT98YDfjlC3fLOQv3pb26Mz5PiZbf6bVPVnvrAjY7nLtrqM6kTiKxvfrgNc6UyxA7WthfdiuHREkCuSEOHBOZ8x9b9xQF28gDWftvEUH5Yt7e25tGroOhMEFQhQaYCsrWGCuEWFzr3DjGpH6YItxCv8WDZM7/A6w9Q==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: Jan Beulich <jbeulich@suse.com>
CC: =?iso-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>,
        "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v8 01/13] pci: introduce per-domain PCI rwlock
Thread-Topic: [PATCH v8 01/13] pci: introduce per-domain PCI rwlock
Thread-Index: AQHZuqGr3g/gocvkCU2kdSqq613Aoa/Cy8SAgACDMIA=
Date: Thu, 20 Jul 2023 23:37:22 +0000
Message-ID: <87zg3qduj1.fsf@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-2-volodymyr_babchuk@epam.com>
 <b6375b17-7922-66ea-88fd-697fa759f96a@suse.com>
In-Reply-To: <b6375b17-7922-66ea-88fd-697fa759f96a@suse.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: mu4e 1.8.9; emacs 28.2
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|DB9PR03MB7385:EE_
x-ms-office365-filtering-correlation-id: 8a3bcf48-4424-4143-3a13-08db897a446b
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 bILj6+O6KgR4DH51Wi55HW0cAin/FtE24krUCmPaPYKXZFjUuiaaX9yIUVFT77j1Idhiiu+rfgyLJzBI6zgeVxGLMfimVFHdI+mCmvDStFhoa7Bi/hXxCaA/Z6A58t39Xq6gkR41XU6aHDCL0mbQqtwn2BCxRsoEsdGcuu1Xx4SR6EdmS9KwlXLnWQB2yc7uUMlmc/IsnQi6S/Cqc8hbxRuiyj7xLwOEnDL97jSAPoSPa9AQsy49DXEY1UIdzrk2M/ChByuglKQVmnUMHK5dUnaMSfWbmJE6zDM6YwWycyiBddAUeIQVhzCGLTm4R0Dncf3jcoqeR2kS6PYsH9SIEd0B6xuoCfzFxMrwDTzdvXk+P4pOY/3TwGME04zGtqPuX+mODeH8R71w4RG85MyyWDOYJoGj4Pn7xepfTQKVrUF1h0NZMbsuXpSum2oMv4zl1DgRX1aVjKHlYhwL9wG37XZaVGaF8dL/IEqQbJA63FRlcnrklYFaO/GueB2AbRaax4q6Vq8u+n+huM4rK0TTOHCtXM81oqD64+ugEMBy7SL8hNhWf/qbIRm8UDk0yP9/vg7epwIGRTPVH9DIzQ3EAt/7syBlvsxv+iuPGTNMkBH/uz5xl+a8dze5MA/Ujh19
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(396003)(366004)(136003)(39860400002)(451199021)(6486002)(71200400001)(478600001)(38100700002)(122000001)(2906002)(5660300002)(316002)(41300700001)(38070700005)(54906003)(8936002)(8676002)(36756003)(6512007)(2616005)(66446008)(83380400001)(6916009)(26005)(4326008)(66476007)(6506007)(66556008)(64756008)(53546011)(86362001)(55236004)(66946007)(76116006)(186003)(91956017);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?iso-8859-1?Q?AwaZfbwS49UruznDatGYGCv3Sw7wRKdL+ENEQI/vTu6UMcyynTpYtaGgVS?=
 =?iso-8859-1?Q?F7dCj4uSKYjS/Z4dJ3KySrdihlBtHbk2UktV/s7P2np/b3nY2iC2GSqkhe?=
 =?iso-8859-1?Q?bhn/3Fpim21d++xGFIM52gXew6AVRR61vjy29FMbAbRjLd78gs8ZZxygrg?=
 =?iso-8859-1?Q?GrSJLPMILJROw1DZy6dCLF4v4oiPQXKrfMDZTAnA33eXm4gWPz0F9QO7BK?=
 =?iso-8859-1?Q?yJMibdhzfA2OZOMXv42PzBjC14D3rlPaHzoNc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L4mBoN1vB84tC?=
 =?iso-8859-1?Q?6xN9I5Y03phk0GtDZJk6H2jLUJ/6xKOVhNkqW9rpO6WyysOMIF8xLrJwuj?=
 =?iso-8859-1?Q?ieN5RNkEnlMEIIrjtoI5M8wrnAs6d7wTkcsyWDnqnaP/NUMj2buG+eBgxF?=
 =?iso-8859-1?Q?HFlZgRvEpHnBZWkEsaUmr8hD/yxdW7Q3T/nwKHVNe3k8ue/GUSB3uB0Of4?=
 =?iso-8859-1?Q?fAn7spwka9ShNKJNwt1Ct7HZQ5oW4BrzyM8WSTbF/SRB+8d8k55HI6F6lT?=
 =?iso-8859-1?Q?GpPQA4EcIMyL7IO3JFDzMKSjBL+/kaoaL+ynz3ztY8mLuxPdHfcyv+HfoP?=
 =?iso-8859-1?Q?gjXmZhstZrE1qOC1UAkXDRu2LFYM55Z8CcjsL0A7kO3QzNOetgz9Gt2Oi1?=
 =?iso-8859-1?Q?1itn4vuDj0N5RLzm4SQ0NbvE09yZ5w3u2kAnKYf23fHmi801HggmxiJ+1d?=
 =?iso-8859-1?Q?KOEW3QQGM24LXcdbmai/LWgsr5QKZe+TtGS7LsLoZ7idSDpaYhah1mq1Om?=
 =?iso-8859-1?Q?75oG7ZCzE+NqdVSR3olixcNIzp76BxpV+AHHW2D/dST4D06XMenUNvMQ?=
 =?iso-8859-1?Q?=3D=3D?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8a3bcf48-4424-4143-3a13-08db897a446b
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 23:37:22.9783
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: GwFM8bSkNkL0+sIRM9StZxvE0kfGwIpT7Zw2ldhV3XwXfU5sH975IXyqOBPiHvoP/33kJMOUCsebvopVnCqvS4s2Zms1gKxNuR7EeKlJK70=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR03MB7385
X-Proofpoint-ORIG-GUID: ujnrI4VXT58ErsJ8XwzmN_gPKvFO16u3
X-Proofpoint-GUID: ujnrI4VXT58ErsJ8XwzmN_gPKvFO16u3
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-20_10,2023-07-20_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0
 impostorscore=0 mlxscore=0 adultscore=0 phishscore=0 lowpriorityscore=0
 mlxlogscore=792 priorityscore=1501 clxscore=1015 spamscore=0 bulkscore=0
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000
 definitions=main-2307200202


Hi Jan,

Jan Beulich <jbeulich@suse.com> writes:

> On 20.07.2023 02:32, Volodymyr Babchuk wrote:
>> --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
>> +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
>> @@ -476,8 +476,13 @@ static int cf_check reassign_device(
>> =20
>>      if ( devfn =3D=3D pdev->devfn && pdev->domain !=3D target )
>>      {
>> -        list_move(&pdev->domain_list, &target->pdev_list);
>> -        pdev->domain =3D target;
>> +        write_lock(&pdev->domain->pci_lock);
>> +        list_del(&pdev->domain_list);
>> +        write_unlock(&pdev->domain->pci_lock);
>
> As mentioned on an earlier version, perhaps better (cheaper) to use
> "source" here? (Same in VT-d code then.)

Sorry, I saw you comment for the previous version, but missed to include
this change. It will be done in the next version.

>> @@ -747,6 +749,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>>      ret =3D 0;
>>      if ( !pdev->domain )
>>      {
>> +        write_lock(&hardware_domain->pci_lock);
>>          pdev->domain =3D hardware_domain;
>>          list_add(&pdev->domain_list, &hardware_domain->pdev_list);
>> =20
>> @@ -760,6 +763,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>>              printk(XENLOG_ERR "Setup of vPCI failed: %d\n", ret);
>>              list_del(&pdev->domain_list);
>>              pdev->domain =3D NULL;
>> +            write_unlock(&hardware_domain->pci_lock);
>>              goto out;
>
> In addition to Roger's comments about locking scope: In a case like this
> one it would probably also be good to move the printk() out of the locked
> area. It can be slow, after all.
>
> Question is why you have this wide a locked area here in the first place:
> Don't you need to hold the lock just across the two list operations (but
> not in between)?

Strictly speaking yes, we need to hold lock only when operating on the
list. For now. Next patch will use the same lock to protect the VPCI
(de)alloction, so locked region will be extended anyways.

I think, I'll decrease locked area in this patch and increase in the
next one, it will be most logical.


>> @@ -887,26 +895,62 @@ static int deassign_device(struct domain *d, uint1=
6_t seg, uint8_t bus,
>> =20
>>  int pci_release_devices(struct domain *d)
>>  {
>> -    struct pci_dev *pdev, *tmp;
>> -    u8 bus, devfn;
>> -    int ret;
>> +    int combined_ret;
>> +    LIST_HEAD(failed_pdevs);
>> =20
>>      pcidevs_lock();
>> -    ret =3D arch_pci_clean_pirqs(d);
>> -    if ( ret )
>> +    write_lock(&d->pci_lock);
>> +    combined_ret =3D arch_pci_clean_pirqs(d);
>> +    if ( combined_ret )
>>      {
>>          pcidevs_unlock();
>> -        return ret;
>> +        write_unlock(&d->pci_lock);
>> +        return combined_ret;
>>      }
>> -    list_for_each_entry_safe ( pdev, tmp, &d->pdev_list, domain_list )
>> +
>> +    while ( !list_empty(&d->pdev_list) )
>>      {
>> -        bus =3D pdev->bus;
>> -        devfn =3D pdev->devfn;
>> -        ret =3D deassign_device(d, pdev->seg, bus, devfn) ?: ret;
>> +        struct pci_dev *pdev =3D list_first_entry(&d->pdev_list,
>> +                                                struct pci_dev,
>> +                                                domain_list);
>> +        uint16_t seg =3D pdev->seg;
>> +        uint8_t bus =3D pdev->bus;
>> +        uint8_t devfn =3D pdev->devfn;
>> +        int ret;
>> +
>> +        write_unlock(&d->pci_lock);
>> +        ret =3D deassign_device(d, seg, bus, devfn);
>> +        write_lock(&d->pci_lock);
>> +        if ( ret )
>> +        {
>> +            bool still_present =3D false;
>> +            const struct pci_dev *tmp;
>> +
>> +            /*
>> +             * We need to check if deassign_device() left our pdev in
>> +             * domain's list. As we dropped the lock, we can't be sure
>> +             * that list wasn't permutated in some random way, so we
>> +             * need to traverse the whole list.
>> +             */
>> +            for_each_pdev ( d, tmp )
>> +            {
>> +                if ( tmp =3D=3D pdev )
>> +                {
>> +                    still_present =3D true;
>> +                    break;
>> +                }
>> +            }
>> +            if ( still_present )
>> +                list_move(&pdev->domain_list, &failed_pdevs);
>
> In order to retain original ordering on the resulting list, perhaps bette=
r
> list_move_tail()?

Yes, thanks.


--=20
WBR, Volodymyr=


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 00:23:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 00:23:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566811.886165 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMdvf-0000TI-EA; Fri, 21 Jul 2023 00:23:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566811.886165; Fri, 21 Jul 2023 00:23:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMdvf-0000TB-BK; Fri, 21 Jul 2023 00:23:31 +0000
Received: by outflank-mailman (input) for mailman id 566811;
 Fri, 21 Jul 2023 00:23:31 +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
 <SRS0=BzSz=DH=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMdvf-0000T5-0i
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 00:23:31 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cffe5a7b-275c-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 02:23:28 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 257A061CB8;
 Fri, 21 Jul 2023 00:23:27 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59A43C433C7;
 Fri, 21 Jul 2023 00:23:25 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cffe5a7b-275c-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689899006;
	bh=e9pw3Wu++8sH3JJUIceGQdL1jV8FwV7ikMwnMDXbwIo=;
	h=From:To:Cc:Subject:Date:From;
	b=n9HrwVa9dgis9Bg/e/YgzidA3tpx6Za3vKsxNqBVHi5ubQJQaaOigcpICQF2gIRXf
	 cZRz+o7udTeiTwIQp/HXLlS+hUpLG/6pd3U29lbsRXjKNX9bmhm8eEJvW+sDIaLnvG
	 efgscAdphnDGa4svwJO0p4Htyw7uXMw3M4wGWKoky4BMZSgGAv8sCUjCuHy4HICjDh
	 dYFEEdPqpt7xAfgR2rJnXTpmLKTe5hU+ZM+Owbsa9XSp+1vpM2l2w6ZpO+EmDwPl8o
	 VcZiXxFSIJSVCCS8rPdIK3YSNJ7tyn3KJ3qnasjbo91CZBBJm11GHEKghFnIq5HVna
	 iPUgAz+YSqEXw==
From: Stefano Stabellini <sstabellini@kernel.org>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	julien@xen.org,
	sstabellini@kernel.org,
	george.dunlap@citrix.com,
	bertrand.marquis@arm.com,
	Stefano Stabellini <stefano.stabellini@amd.com>
Subject: [PATCH] docs/misra: add Rule 1.1 and 5.6
Date: Thu, 20 Jul 2023 17:23:22 -0700
Message-Id: <20230721002322.3457802-1-sstabellini@kernel.org>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Stefano Stabellini <stefano.stabellini@amd.com>

Rule 1.1 is uncontroversial and we are already following it.

Rule 5.6 has been deemed a good rule to have by the MISRA C group.
However, we do have a significant amount of violations that will take
time to resolve and might require partial deviations in the form of
in-code comments or MISRA C scanners special configurations (ECLAIR).
For new code, we want this rule to apply hence the addition to
docs/misra/rules.rst.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
 docs/misra/rules.rst | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 29a777938a..9406ff0d8f 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -82,6 +82,13 @@ maintainers if you want to suggest a change.
      - Summary
      - Notes
 
+   * - `Rule 1.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_01_01.c>`_
+     - Required
+     - The program shall contain no violations of the standard C syntax
+       and constraints, and shall not exceed the implementation's
+       translation limits
+     -
+
    * - `Rule 1.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_01_03.c>`_
      - Required
      - There shall be no occurrence of undefined or critical unspecified
@@ -156,6 +163,11 @@ maintainers if you want to suggest a change.
        headers (xen/include/public/) are allowed to retain longer
        identifiers for backward compatibility.
 
+   * - `Rule 5.6 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_05_06.c>`_
+     - Required
+     - A typedef name shall be a unique identifier
+     -
+
    * - `Rule 6.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_06_01.c>`_
      - Required
      - Bit-fields shall only be declared with an appropriate type
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 00:40:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 00:40:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566816.886176 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMeC3-0003lf-Ue; Fri, 21 Jul 2023 00:40:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566816.886176; Fri, 21 Jul 2023 00:40:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMeC3-0003lY-RW; Fri, 21 Jul 2023 00:40:27 +0000
Received: by outflank-mailman (input) for mailman id 566816;
 Fri, 21 Jul 2023 00:40:27 +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 <SRS0=nBvy=DH=intel.com=lkp@srs-se1.protection.inumbo.net>)
 id 1qMeC2-0003lR-QP
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 00:40:27 +0000
Received: from mga07.intel.com (mga07.intel.com [134.134.136.100])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2b55a776-275f-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 02:40:21 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 20 Jul 2023 17:40:17 -0700
Received: from lkp-server02.sh.intel.com (HELO 36946fcf73d7) ([10.239.97.151])
 by fmsmga001.fm.intel.com with ESMTP; 20 Jul 2023 17:40:16 -0700
Received: from kbuild by 36946fcf73d7 with local (Exim 4.96)
 (envelope-from <lkp@intel.com>) id 1qMeBq-0006gL-2i;
 Fri, 21 Jul 2023 00:40:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2b55a776-275f-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1689900020; x=1721436020;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=CI0o0+Z4qXXHWD154B+rJnNKHysZxCwTxv7+kXT0cow=;
  b=W2yrvArsLo1Z9emOU5xWql5Z1JgWeCNOkf1t2VCO88LmZxiiewfCEKpU
   8zWV0OjcOnCq0Qa+jTO1KxcXuNVBPGWRRKITC5+eGh6/hZn0dlB0pEV2S
   Q6yUmxKLvg1b2PxQpPvmNYhFY7Yisv+Bx00BrDTHrj8g7PGuxoGXZSKly
   LI/tt7tsKkW3LmR4s4kS39ZtWaBHYDImqjrxiSNe8Y3b73raT1LF3XrP4
   9ApxwdJfV8JGne3UQLVvUp0J7DPuFeTrKQ8+XeLkgR0sMSID4BiY2kADI
   gFoDj4gvYedpiNa/ugA5a+sX6JudHc+00dYyd7k/nQBZ1W56Gw8rG2YbG
   A==;
X-IronPort-AV: E=McAfee;i="6600,9927,10777"; a="433126717"
X-IronPort-AV: E=Sophos;i="6.01,220,1684825200"; 
   d="scan'208";a="433126717"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="868048756"
Date: Fri, 21 Jul 2023 08:38:40 +0800
From: kernel test robot <lkp@intel.com>
To: Viresh Kumar <viresh.kumar@linaro.org>, Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Alex =?iso-8859-1?Q?Benn=E9e?= <alex.bennee@linaro.org>,
	stratos-dev@op-lists.linaro.org,
	Erik Schilling <erik.schilling@linaro.org>,
	Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2 2/2] xen: privcmd: Add support for irqfd
Message-ID: <202307210852.ukq5f98v-lkp@intel.com>
References: <a25d5f01fe9b4624aa12cab77abd001044ea02d5.1689845210.git.viresh.kumar@linaro.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <a25d5f01fe9b4624aa12cab77abd001044ea02d5.1689845210.git.viresh.kumar@linaro.org>

Hi Viresh,

kernel test robot noticed the following build errors:

[auto build test ERROR on xen-tip/linux-next]
[also build test ERROR on linus/master v6.5-rc2 next-20230720]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Viresh-Kumar/xen-privcmd-Add-support-for-irqfd/20230720-173905
base:   https://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git linux-next
patch link:    https://lore.kernel.org/r/a25d5f01fe9b4624aa12cab77abd001044ea02d5.1689845210.git.viresh.kumar%40linaro.org
patch subject: [PATCH V2 2/2] xen: privcmd: Add support for irqfd
config: arm64-randconfig-r026-20230720 (https://download.01.org/0day-ci/archive/20230721/202307210852.ukq5f98v-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20230721/202307210852.ukq5f98v-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307210852.ukq5f98v-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/xen/privcmd.c:961:12: error: call to undeclared function 'eventfd_ctx_fileget'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     961 |         eventfd = eventfd_ctx_fileget(f.file);
         |                   ^
   drivers/xen/privcmd.c:961:12: note: did you mean 'eventfd_ctx_fdget'?
   include/linux/eventfd.h:56:35: note: 'eventfd_ctx_fdget' declared here
      56 | static inline struct eventfd_ctx *eventfd_ctx_fdget(int fd)
         |                                   ^
>> drivers/xen/privcmd.c:961:10: error: incompatible integer to pointer conversion assigning to 'struct eventfd_ctx *' from 'int' [-Wint-conversion]
     961 |         eventfd = eventfd_ctx_fileget(f.file);
         |                 ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   2 errors generated.


vim +/eventfd_ctx_fileget +961 drivers/xen/privcmd.c

   936	
   937	static int privcmd_irqfd_assign(struct privcmd_irqfd *irqfd)
   938	{
   939		struct privcmd_kernel_irqfd *kirqfd, *tmp;
   940		struct eventfd_ctx *eventfd;
   941		__poll_t events;
   942		struct fd f;
   943		int ret;
   944	
   945		kirqfd = kzalloc(sizeof(*kirqfd), GFP_KERNEL);
   946		if (!kirqfd)
   947			return -ENOMEM;
   948	
   949		kirqfd->irq = irqfd->irq;
   950		kirqfd->dom = irqfd->dom;
   951		kirqfd->level = irqfd->level;
   952		INIT_LIST_HEAD(&kirqfd->list);
   953		INIT_WORK(&kirqfd->shutdown, irqfd_shutdown);
   954	
   955		f = fdget(irqfd->fd);
   956		if (!f.file) {
   957			ret = -EBADF;
   958			goto error_kfree;
   959		}
   960	
 > 961		eventfd = eventfd_ctx_fileget(f.file);
   962		if (IS_ERR(eventfd)) {
   963			ret = PTR_ERR(eventfd);
   964			goto error_fd_put;
   965		}
   966	
   967		kirqfd->eventfd = eventfd;
   968	
   969		/*
   970		 * Install our own custom wake-up handling so we are notified via a
   971		 * callback whenever someone signals the underlying eventfd.
   972		 */
   973		init_waitqueue_func_entry(&kirqfd->wait, irqfd_wakeup);
   974		init_poll_funcptr(&kirqfd->pt, irqfd_poll_func);
   975	
   976		mutex_lock(&irqfds_lock);
   977	
   978		list_for_each_entry(tmp, &irqfds_list, list) {
   979			if (kirqfd->eventfd == tmp->eventfd) {
   980				ret = -EBUSY;
   981				mutex_unlock(&irqfds_lock);
   982				goto error_eventfd;
   983			}
   984		}
   985	
   986		list_add_tail(&kirqfd->list, &irqfds_list);
   987		mutex_unlock(&irqfds_lock);
   988	
   989		/*
   990		 * Check if there was an event already pending on the eventfd before we
   991		 * registered, and trigger it as if we didn't miss it.
   992		 */
   993		events = vfs_poll(f.file, &kirqfd->pt);
   994		if (events & EPOLLIN)
   995			irqfd_inject(kirqfd);
   996	
   997		/*
   998		 * Do not drop the file until the kirqfd is fully initialized, otherwise
   999		 * we might race against the EPOLLHUP.
  1000		 */
  1001		fdput(f);
  1002		return 0;
  1003	
  1004	error_eventfd:
  1005		eventfd_ctx_put(eventfd);
  1006	
  1007	error_fd_put:
  1008		fdput(f);
  1009	
  1010	error_kfree:
  1011		kfree(kirqfd);
  1012		return ret;
  1013	}
  1014	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 00:44:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 00:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566818.886185 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMeFR-0004Lh-DP; Fri, 21 Jul 2023 00:43:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566818.886185; Fri, 21 Jul 2023 00:43:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMeFR-0004La-Ao; Fri, 21 Jul 2023 00:43:57 +0000
Received: by outflank-mailman (input) for mailman id 566818;
 Fri, 21 Jul 2023 00:43:56 +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
 <SRS0=7rgW=DH=epam.com=prvs=15665e8a21=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qMeFQ-0004LU-BJ
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 00:43:56 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id aa44e08b-275f-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 02:43:53 +0200 (CEST)
Received: from pps.filterd (m0174682.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36KHsIur013644; Fri, 21 Jul 2023 00:43:52 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2053.outbound.protection.outlook.com [104.47.13.53])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3ry11tbcyj-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Fri, 21 Jul 2023 00:43:52 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by PAVPR03MB9752.eurprd03.prod.outlook.com (2603:10a6:102:311::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Fri, 21 Jul
 2023 00:43:48 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 00:43:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aa44e08b-275f-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=kxwknxcZOJUgpHshiiXafYmULwWywwdunJm2OClk+/mNDZS3VGHTxMxjEDkByjJ7vfqIpt0nNpKKT/h2ow1AR0tTV9ga+5ahHF9LoZ5DXdi3pTSBjcxyIyBvtUOgTibxwHbtHHi4sTtLW6K12ZrhtZV42XbuNtdKi1rJfnImjgzg3Jl/QOZuRF/ZV2cWkmV7KKjx/lmp/stV2Lzl1O6g0rBHnXZVnvF+d3bnwTjin4mSH9agFMpSlSnN60I8BFoOa0OKz7INXxLDAcyF7hgxKdmQhyjqP9ad30kxe5l1erWs5Aqa5uzWjjEcb0M20XVag8SqjtyNLBkBTrbYPxWEOg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=CO17EFDJgsFR9UJhz+9HOaYW0nSUraGFVT/+sQwxqVs=;
 b=Mr+8ommbMrkFalVRnDvy6/8EHSqTv2VU55gE0g5zI92rhUAfK3GjawaYIw67TrpvW4I3EvtdsqOMjzqydhCnxu+AAUMm9ZWHdbYum2lzRRxrHmenHrcLZj/5RgRDz7WeQI7fw7CA7gwX1s7FOZQrA6I2LG1JK39C1t4eQ+nhEnBfa8OB1mxOe1M8QoaeoQzchqDuGanx+iqPHDo9FLzDYOyilKdfH0M0IPxaLZ8y/kU1Xt41tuQywCbg0gK139RCVHHiiEAin6FR0auW0NkDejRMsF7OcwskS36fdcpZBRKKIWmnw/Qy1fzWYN5kL6HQc6ljpgVdEu8g3Je56fQGWQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=CO17EFDJgsFR9UJhz+9HOaYW0nSUraGFVT/+sQwxqVs=;
 b=VU+FlaFM2WL9wA+D+/SVnY9MVyUzbUVNVDiFkMvXG+Rc9t3QYrkFN6rZ9NLUilfgm77opq7X/IR/mJDmzy8BrIrd7F2O9q5ZFe82wYU4CaGZRw5KU9jg2/nvJZkgV1mwC3+T/E5WL6+ariR5n3cY4otONX4Z4jgAhuWXpnmCcyZw9Nn50FnJaKJVLnWMP7v5RVfTC0zVWvnGo5G1xVh8+qKE+3mBx68NcINtn6HzsIVzLM71kXQz+G8BLNv4XFw2Ewp+HvaJP7SWzF3/zjVBcc1zxDgRmYo9kdFVeS1mVF0KUygEvSxvsFBK1F6ryLTL+R4348PrFAHN34Z4vQv1wA==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
        "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v8 11/13] vpci: add initial support for virtual PCI bus
 topology
Thread-Topic: [PATCH v8 11/13] vpci: add initial support for virtual PCI bus
 topology
Thread-Index: AQHZuqGtdYewPbeaYUqE4k9SPFwhoq/CN8sAgAEqGIA=
Date: Fri, 21 Jul 2023 00:43:48 +0000
Message-ID: <87sf9idrgc.fsf@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-12-volodymyr_babchuk@epam.com>
 <414b65eb-1c28-7303-f9fe-cfe5713b9056@suse.com>
In-Reply-To: <414b65eb-1c28-7303-f9fe-cfe5713b9056@suse.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: mu4e 1.8.9; emacs 28.2
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|PAVPR03MB9752:EE_
x-ms-office365-filtering-correlation-id: 53bf8080-e228-48c8-1b9f-08db89838be1
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 gTY69RMnidvQ4xdGdaBQsEFJ6vUZgT13CAluLpJRCu4sGzrLmGm8zEHbNA9eBL2ii012GEIuDtfdmkxOWJAosAAV0PVmAVXvVvPCsFBGqx0lCy/3u+/iNRphM7dGMVtdfTqR58QySfUE8Yg/6HF8hDQIMpST7VY2dn5o2E6nHwMop6s/zcXVHF36tosdhHDk2ZlOS2IW4aBR+tbV62Sa/rrwa2Udw0P2Mi9LMXl8m3URTzEU3jifgNpZvpXwsC+lukKUWvGvMIwHHB9RcGIXsQhs4YUqgGy3qpivLwAYO4ZBfxdADPhW4DAA8+qBG0FActaFQCusBCCUeJ+R1Lgkzq2M06etIudCY2NMzCt0IAFK+4yZBhJ0g1H21NwzienLnJsagknnwcEPZYYHy5p2iWjGax8gQKKvZkKW/dPQZ7WG8aeaPv3N5xDYk/+w+YvbpgCMFb8IYOCSxcwvHwpL4axENgbxHvxQQbX2J5u7SSttCHz6cMsPYFQY5KLUISIN8LFqtcUwg/vld1UxP9mnWfXropTs2dA/f3LfJ3757g6RCqvNHbrbDKoUpKxRhqvZ7g7/vrXoEL6q1lTAQV5X8Abn2nRdbN0OV5vIYO20bIZviBnB8ReY0YRc+697c+Qm
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(346002)(366004)(376002)(396003)(451199021)(76116006)(66446008)(66476007)(186003)(26005)(6512007)(316002)(71200400001)(4326008)(66556008)(91956017)(66946007)(6916009)(64756008)(6486002)(55236004)(53546011)(41300700001)(6506007)(5660300002)(54906003)(8936002)(8676002)(478600001)(2616005)(83380400001)(2906002)(38100700002)(38070700005)(122000001)(36756003)(86362001);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?iso-8859-1?Q?dm2LJ1GGww4o6suAqbL3HfAIqpEFUeRNsyzOS0DPwFgRjZFmsAQucqlpMQ?=
 =?iso-8859-1?Q?77BgFLEQunde4AQ28SiabAb1GRSUbJGmG+mQr1xXjeO8sFE/WUhgcg2V0F?=
 =?iso-8859-1?Q?D07mf5BvF3X/x3gP1BRkwaKqFnmf6mmQ1nNBlPKAUW97xSdCfX0tHCTzXe?=
 =?iso-8859-1?Q?BrQBkHST38vhPtxencuaGiWlyHLnvZnRdNCuNbx1EhloH5L7L4kMpUTgms?=
 =?iso-8859-1?Q?0IZ0MLEwENHqM9CJ9RErxZLk6KLco6nQPYlSTt7LsfdVGrh12RrrUjoe8M?=
 =?iso-8859-1?Q?Aottiz+oxsH1AalPVVhuM1IQUMiVzZV3pBxv0QCNkxehNVIMhS6PLSvhZb?=
 =?iso-8859-1?Q?OV8bDIwU4MNhAay7XjQgQsB0aOMnXzpfjE/D9vv15OHQkUNn+sKBnj6/Tc?=
 =?iso-8859-1?Q?JR3Nh4lMSyV6/dqI1koC0A2IIWgjyqiZnr18wwyR202L7hHwF3pYwQuNtp?=
 =?iso-8859-1?Q?xsxO5qBq+VGiZc4bL8iUK+M4pVY5YMo+JaclRYNmoPzW9puPYXY+wjYFqH?=
 =?iso-8859-1?Q?nZcH7bxiLWA4bx+RXvkial25a9WD/uDTN3N4mX1af6fTG8zDq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?iso-8859-1?Q?HkK9FbO2afcpKrc8hcSUvlarNxp6QeM8Fqga5D4OMX1N0I5n19IVBKdxDJ?=
 =?iso-8859-1?Q?jMby5c779mPZ3E0akOOlsU3D+cUDCCCEOrhIcSdxXb9VTz81c/TFjqmZGS?=
 =?iso-8859-1?Q?xl0jLN8ztE6JFIN85c8pVvNZTJfML1+8LBEw+p3ENH5t7YnY0nQZ5P7NFt?=
 =?iso-8859-1?Q?BoboQ6S8nFDiKmN7dXu6FGBfv5VRE/Amtk5fyCSzQyCRHJRp7jNbk+xw?=
 =?iso-8859-1?Q?=3D=3D?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 53bf8080-e228-48c8-1b9f-08db89838be1
X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 00:43:48.3065
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: DTJxdpSKWqgCGpetfTEikNTUXNPmaTDtiXVgSsSfmv+GafqShklKS5ul5bDxc1L4Bl24Bu0v4OuYBHlhoKog1ot6LsKQoKRX+jkfuh0BpoI=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR03MB9752
X-Proofpoint-GUID: 5HA6wNa7M-rpdlQ5PgLcuAtmTyjFRPo8
X-Proofpoint-ORIG-GUID: 5HA6wNa7M-rpdlQ5PgLcuAtmTyjFRPo8
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-20_12,2023-07-20_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0
 priorityscore=1501 mlxscore=0 phishscore=0 clxscore=1015 impostorscore=0
 adultscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 suspectscore=0
 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307210005


Hi Jan,

Jan Beulich <jbeulich@suse.com> writes:

> On 20.07.2023 02:32, Volodymyr Babchuk wrote:
>> --- a/xen/drivers/vpci/vpci.c
>> +++ b/xen/drivers/vpci/vpci.c
>> @@ -46,6 +46,16 @@ void vpci_remove_device(struct pci_dev *pdev)
>>          return;
>> =20
>>      spin_lock(&pdev->vpci->lock);
>> +
>> +#ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
>> +    if ( pdev->vpci->guest_sbdf.sbdf !=3D ~0 )
>> +    {
>> +        __clear_bit(pdev->vpci->guest_sbdf.dev,
>> +                    &pdev->domain->vpci_dev_assigned_map);
>> +        pdev->vpci->guest_sbdf.sbdf =3D ~0;
>> +    }
>> +#endif
>
> The lock acquired above is not ...

vpci_remove_device() is called when d->pci_lock is already held.

But, I'll move this hunk before spin_lock(&pdev->vpci->lock); we don't
need to hold it while cleaning vpci_dev_assigned_map

>> @@ -115,6 +129,54 @@ int vpci_add_handlers(struct pci_dev *pdev)
>>  }
>> =20
>>  #ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
>> +static int add_virtual_device(struct pci_dev *pdev)
>> +{
>> +    struct domain *d =3D pdev->domain;
>> +    pci_sbdf_t sbdf =3D { 0 };
>> +    unsigned long new_dev_number;
>> +
>> +    if ( is_hardware_domain(d) )
>> +        return 0;
>> +
>> +    ASSERT(pcidevs_locked());
>> +
>> +    /*
>> +     * Each PCI bus supports 32 devices/slots at max or up to 256 when
>> +     * there are multi-function ones which are not yet supported.
>> +     */
>> +    if ( pdev->info.is_extfn )
>> +    {
>> +        gdprintk(XENLOG_ERR, "%pp: only function 0 passthrough supporte=
d\n",
>> +                 &pdev->sbdf);
>> +        return -EOPNOTSUPP;
>> +    }
>> +
>> +    write_lock(&pdev->domain->pci_lock);
>> +    new_dev_number =3D find_first_zero_bit(d->vpci_dev_assigned_map,
>> +                                         VPCI_MAX_VIRT_DEV);
>> +    if ( new_dev_number >=3D VPCI_MAX_VIRT_DEV )
>> +    {
>> +        write_unlock(&pdev->domain->pci_lock);
>> +        return -ENOSPC;
>> +    }
>> +
>> +    __set_bit(new_dev_number, &d->vpci_dev_assigned_map);
>
> ... the same as the one held here, so the bitmap still isn't properly
> protected afaics, unless the intention is to continue to rely on
> the global PCI lock (assuming that one's held in both cases, which I
> didn't check it is). Conversely it looks like the vPCI lock isn't
> held here. Both aspects may be intentional, but the locks being
> acquired differing requires suitable code comments imo.

As I stated above, vpci_remove_device() is called when d->pci_lock is
already held.


> I've also briefly looked at patch 1, and I'm afraid that still lacks
> commentary about intended lock nesting. That might be relevant here
> in case locking visible from patch / patch context isn't providing
> the full picture.
>

There is
    ASSERT(rw_is_write_locked(&pdev->domain->pci_lock));
at the beginning of vpci_remove_device(), which is added by
"vpci: use per-domain PCI lock to protect vpci structure".

I believe, it will be more beneficial to review series from the
beginning.

>> +    /*
>> +     * Both segment and bus number are 0:
>> +     *  - we emulate a single host bridge for the guest, e.g. segment 0
>> +     *  - with bus 0 the virtual devices are seen as embedded
>> +     *    endpoints behind the root complex
>> +     *
>> +     * TODO: add support for multi-function devices.
>> +     */
>> +    sbdf.devfn =3D PCI_DEVFN(new_dev_number, 0);
>> +    pdev->vpci->guest_sbdf =3D sbdf;
>> +    write_unlock(&pdev->domain->pci_lock);
>
> With the above I also wonder whether this lock can't (and hence
> should) be dropped a little earlier (right after fiddling with the
> bitmap).

This is the good observation, thanks.

--=20
WBR, Volodymyr=


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 02:49:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 02:49:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566821.886196 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMgCf-0003Js-Ip; Fri, 21 Jul 2023 02:49:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566821.886196; Fri, 21 Jul 2023 02:49:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMgCf-0003JW-D0; Fri, 21 Jul 2023 02:49:13 +0000
Received: by outflank-mailman (input) for mailman id 566821;
 Fri, 21 Jul 2023 02:49:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMgCe-0003JK-OJ; Fri, 21 Jul 2023 02:49:12 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMgCe-00071e-DB; Fri, 21 Jul 2023 02:49:12 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMgCd-00054R-Vw; Fri, 21 Jul 2023 02:49:12 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMgCd-0006RL-VS; Fri, 21 Jul 2023 02:49:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=3swlgpfs29uWN7iUP6UhGMs4jKD/YRwJ5X9p9+z0gm0=; b=s7k6cCn05tqTdkTuVnE374Ll/A
	dRIY5UDgIJAa0b51gM5Fm0yKhgS5az/gceNW9gtlEECtFaCo72udrHgnzSLA9A+5L6BbgBV3K6ZUM
	eixvCDQuiaPBf1QPGzpt2+C85/WTmH66V22hI/aqFdRRxzLdjd0tK9OyFBkr/xOMNKcA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181941-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181941: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=1ab2ae1610d99423af5b810829959431e43de12d
X-Osstest-Versions-That:
    xen=4bf014c6f7d7cc9a9e017cef0eb5ff4bf27526e9
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 21 Jul 2023 02:49:11 +0000

flight 181941 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181941/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  1ab2ae1610d99423af5b810829959431e43de12d
baseline version:
 xen                  4bf014c6f7d7cc9a9e017cef0eb5ff4bf27526e9

Last test of basis   181923  2023-07-20 09:02:01 Z    0 days
Testing same since   181941  2023-07-20 23:03:34 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Jens Wiklander <jens.wiklander@linaro.org>
  Julien Grall <jgrall@amazon.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   4bf014c6f7..1ab2ae1610  1ab2ae1610d99423af5b810829959431e43de12d -> smoke


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 04:09:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 04:09:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.566829.886206 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMhSR-0006Rq-DR; Fri, 21 Jul 2023 04:09:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 566829.886206; Fri, 21 Jul 2023 04:09:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMhSR-0006Rj-AM; Fri, 21 Jul 2023 04:09:35 +0000
Received: by outflank-mailman (input) for mailman id 566829;
 Fri, 21 Jul 2023 04:09:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=vfIn=DH=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qMhSQ-0006Rd-L1
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 04:09:34 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 65b348a8-277c-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 06:09:33 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id B6A8821A87;
 Fri, 21 Jul 2023 04:09:32 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8CC66134B0;
 Fri, 21 Jul 2023 04:09:32 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id +uWcIPwEumTUWwAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 21 Jul 2023 04:09:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 65b348a8-277c-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1689912572; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=+wb19BdGhpyh4/RvwwArZ9MDpw/UcwPy66NyncwESHE=;
	b=OaSkMorcXd3QrAMy8ehU4CyPPRW7f/gRvSxooMYno3UNaE/t5nrC/rOwRZ4L0DQ/qX41ls
	4OGSaCooFDakiv7hOKZTB7QTpMh0Mh5gSf0hMjfHTR+i4+KZ0CBK4gaJBfK8gJvA7DfckJ
	fC5W1wbFJZW5oWuYAYT2FkiIXMmoGxA=
Message-ID: <adeeeada-6f93-20d5-ef07-61a57d0de206@suse.com>
Date: Fri, 21 Jul 2023 06:09:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH] tools/xenstore: fix get_spec_node()
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230720150853.31368-1-jgross@suse.com>
 <d19a18c3-128b-2997-e22c-b2f2f6c46083@xen.org>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <d19a18c3-128b-2997-e22c-b2f2f6c46083@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------xunum8HqzHpo3zf30U1iVAZE"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------xunum8HqzHpo3zf30U1iVAZE
Content-Type: multipart/mixed; boundary="------------DDAv689UTkI0SewFEu6NhH4R";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <adeeeada-6f93-20d5-ef07-61a57d0de206@suse.com>
Subject: Re: [PATCH] tools/xenstore: fix get_spec_node()
References: <20230720150853.31368-1-jgross@suse.com>
 <d19a18c3-128b-2997-e22c-b2f2f6c46083@xen.org>
In-Reply-To: <d19a18c3-128b-2997-e22c-b2f2f6c46083@xen.org>

--------------DDAv689UTkI0SewFEu6NhH4R
Content-Type: multipart/mixed; boundary="------------S37SVvBaGV6wYoBV02vLBt6f"

--------------S37SVvBaGV6wYoBV02vLBt6f
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjEuMDcuMjMgMDA6NDUsIEp1bGllbiBHcmFsbCB3cm90ZToNCj4gSGkgSnVlcmdlbiwN
Cj4gDQo+IE9uIDIwLzA3LzIwMjMgMTY6MDgsIEp1ZXJnZW4gR3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Qgc2hvdWxkIGJlIHBvc3NpYmxlIHRvIG1ha2Ug
Y2Fub25pY2FsX25hbWUgY29uc3QuIEknbGwgbG9vayBpbnRvIHRoYXQuDQoNCg0KSnVlcmdl
bg0KDQo=
--------------S37SVvBaGV6wYoBV02vLBt6f
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5RnNVUJbvoPHZ8SlM4KWm8rG+lIkGurq
qu5gu8q8ZMKdsdGC4bBxdQKDKHEFExLJK/nRPFmAuGlId1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5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------S37SVvBaGV6wYoBV02vLBt6f--

--------------DDAv689UTkI0SewFEu6NhH4R--

--------------xunum8HqzHpo3zf30U1iVAZE
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmS6BPsFAwAAAAAACgkQsN6d1ii/Ey8D
9gf/ZpFig+LlV3iiyruPfWS//8RKJvJcdtCCgdRVQW6RItaeStbTjF+lIhsab+D/3tOFNmqLfsE6
f0tZNu8OpZV5JW/Cn/7Go2xvYl6piYsgP22tV1mnmpn0wOtFWQTQntT7LHeuE2eQltW1PR+spp1i
iQjaMFm+nZesqcu0hCpyEiaArSo5qDb+OoyMs0sBfMw1ScFQpW/dwLqSQvGvktSlObTZv6QM7DL2
sxXwwL3ePNg+MyEydbHi7YT0YnDD2sqIcSxd43+RKPt1uWt9ne4A5wrvBvk5nuTgNSyQEZfgnM4h
Opey+gK6td9Mv/fbZ0AYl01DjhrApusn6cukkk2kDQ==
=CrW7
-----END PGP SIGNATURE-----

--------------xunum8HqzHpo3zf30U1iVAZE--


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 04:54:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 04:54:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567328.886216 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMiA2-0005cl-M1; Fri, 21 Jul 2023 04:54:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567328.886216; Fri, 21 Jul 2023 04:54:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMiA2-0005ce-IL; Fri, 21 Jul 2023 04:54:38 +0000
Received: by outflank-mailman (input) for mailman id 567328;
 Fri, 21 Jul 2023 04:54:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=b4k+=DH=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1qMiA1-0005cY-Cq
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 04:54:37 +0000
Received: from NAM04-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam04on20618.outbound.protection.outlook.com
 [2a01:111:f400:7e8c::618])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b0bca03e-2782-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 06:54:36 +0200 (CEST)
Received: from BYAPR07CA0030.namprd07.prod.outlook.com (2603:10b6:a02:bc::43)
 by IA1PR12MB8311.namprd12.prod.outlook.com (2603:10b6:208:3fa::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul
 2023 04:54:31 +0000
Received: from DM6NAM11FT027.eop-nam11.prod.protection.outlook.com
 (2603:10b6:a02:bc:cafe::b0) by BYAPR07CA0030.outlook.office365.com
 (2603:10b6:a02:bc::43) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28 via Frontend
 Transport; Fri, 21 Jul 2023 04:54:31 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 DM6NAM11FT027.mail.protection.outlook.com (10.13.172.205) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6609.28 via Frontend Transport; Fri, 21 Jul 2023 04:54:30 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 20 Jul
 2023 23:54:30 -0500
Received: from [192.168.137.15] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.23 via Frontend
 Transport; Thu, 20 Jul 2023 23:54:29 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b0bca03e-2782-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=HcSpQ+OGNAKtrF1HXugAD5VWwb2LglxckMYcshsRAj0Cxm2sBQOoVsmnHFfH+Pc+bldW5QIciuFu5e0au+25Dvq48y7WR7Zxh8LuN4vEKoDOgqH31A9Ay5tbJ2Urw1G5QacEx7rigOFDXvUNiTrA3L4FAEmlOTrn0+gt0aWWFftH065TIA7IMDhZWWrLdwHmqOAXEgQH5yk2rhQoutiH/+AuAAIishypfd1PBgV9x++QJoiCSxZ15yQYpB4mUJ4HRjVA6qUeTgz2P7zkUsF3zD0jOkcH8EfHtXV4Rb/McW2tcUpkM3t0Xjzpj69OVg7VZ93bFwAnPtpDhL0ZMOlBYQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=N4El6l6pMp5WQlZxGqtNTmB12qi+0jy/P8LrSTccuQI=;
 b=fe6yOgo1iw1K4fqNxvct90jJFa8HqpJ02xXld5UGL9ZzL4S85GheLHunKH4bmIvtaBXqe5Ncf91gDp1VhJZPrwsvDO/oX7mgg+17IhgVrkC/uX/gET1j2ez3g67uiZhg0cncRW59GP/VnuygowsN/MU0H1BqTCImB2gNq5a0N6tXvrVprhWl7OVpqFMKfw7LGm8us6J6ASqjroTk9i3rw9AltohwuXPgckCx/n6Q6plvSrmfsK3DC4xjb/PbHGMRsB0+z+jb6YaWEvIrxD0VFwcTVhA5F22oW0sOcruBfgXzkghMqVLqZYelUVFWxywbZUMZHIku/tC/aVqRbtcrhg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=arm.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=N4El6l6pMp5WQlZxGqtNTmB12qi+0jy/P8LrSTccuQI=;
 b=pNm8fucMEzSRSwiUz5OSJ6WXhqRcNMRhRk1MOdHJq72mt6yWzMI9OuHaVs2ZHHOggC/kTyZ3FT8ctMAuVHrlP4BdT0ZOQMynxhn4Z40eoGC/GDSR30m1As8gyuHRkny1+Rf5j8HIF6e9Qa5OF76/ii1SffKCDk4+eWlW8OHXJgA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <38cdc3b4-76de-d657-7fc7-f098ebea9d32@amd.com>
Date: Fri, 21 Jul 2023 00:54:28 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 3/3] [FUTURE] xen/arm: enable vPCI for domUs
To: Rahul Singh <Rahul.Singh@arm.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	=?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Oleksandr Tyshchenko
	<oleksandr_tyshchenko@epam.com>, Artem Mygaiev <artem_mygaiev@epam.com>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-4-stewart.hildebrand@amd.com>
 <9A14CA15-2706-4907-A3D3-9A670CF9BAED@arm.com>
Content-Language: en-US
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
In-Reply-To: <9A14CA15-2706-4907-A3D3-9A670CF9BAED@arm.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DM6NAM11FT027:EE_|IA1PR12MB8311:EE_
X-MS-Office365-Filtering-Correlation-Id: 8f82d0da-3ceb-4012-051c-08db89a691f8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	UE3tRCQpkkwqfRjlZ/d76zo7mciYWbzFIXEX9gkuO8NYPIJrOisdGUVq4Bah5mumUxbM1sTqvfg+LSHL6y/hq5+PSTuRUi7isg3iVFT7/hPp1MdZ6GpshwWueY28JIE4yzf2NwaWkxoD3kSLsF18Jr1RZE2VoWcbGp1d8Ge81dsr3sUZL6gaU9BSPUM2C8ifdDDphnfZJhwlxCQliT00yc8YPgqdZVUc9g+8PmetrB+POL/WCnNCQ55BlER94TN11bqEF++UCx8Lho2SLPtH6KDMh2M35VnAHZSIIgrYVr0rHrmu4wJY4/Si+dO0/jBSxr0qKPce7SQdaHR8L4XUbT6jOYgAI6GTA+W9Jf7dAvD3ibUFZvsxtnlBTp/ucZv4TSPlURJmftg/AMpez6BDTbESWLSeE3OCJUE8PK/0BRDfiHaBioCRNXDzfSMJ/KTCsHIK8euTF2CtDEnlr0C9U2xUcsDwSAY32uRidBv2N2vFzwEyPNk2sU9g8uhTSQfBme/0L0HTU3EIaB+N8W9xFOA+Tw62TEFigw4orxdPBSjoHQP6Mz3CkqGkQis5yiz2+ucU3DTNXiR1DWzRQ72TaxWxzf0VMhr6swv2PZg5qTVVRAqoqE3CWHeZNuol9OiN9wCOjP+y/q7Vou+83OHtjcpdci7xZLXRbeiyIkeAv87OrgyrUF1pJhaNE+juIOcRU6ziDpMlFV56NFVjkLa0OzOzBdzL2VLuDWJGeRwLCTNjSsfL9S5TpCM7VOOO2Rxnr4KZBgOjQInYfDHWJNgfdnZAJA2/7lddkOH7V6zlyOI=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(39860400002)(376002)(396003)(82310400008)(451199021)(36840700001)(46966006)(40470700004)(4326008)(426003)(36860700001)(70586007)(2906002)(6916009)(8676002)(44832011)(5660300002)(966005)(8936002)(356005)(31686004)(31696002)(70206006)(41300700001)(16576012)(47076005)(82740400003)(478600001)(316002)(81166007)(54906003)(40480700001)(186003)(2616005)(26005)(86362001)(40460700003)(36756003)(336012)(66899021)(53546011)(83380400001)(36900700001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 04:54:30.8802
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 8f82d0da-3ceb-4012-051c-08db89a691f8
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DM6NAM11FT027.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8311

On 7/7/23 07:04, Rahul Singh wrote:
> Hi Stewart,
> 
>> On 7 Jul 2023, at 2:47 am, Stewart Hildebrand <Stewart.Hildebrand@amd.com> wrote:
>>
>> Remove is_hardware_domain check in has_vpci, and select HAS_VPCI_GUEST_SUPPORT
>> in Kconfig.
>>
>> [1] https://lists.xenproject.org/archives/html/xen-devel/2023-06/msg00863.html
>>
>> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
>> ---
>> As the tag implies, this patch is not intended to be merged (yet).
>>
>> Note that CONFIG_HAS_VPCI_GUEST_SUPPORT is not currently used in the upstream
>> code base. It will be used by the vPCI series [1]. This patch is intended to be
>> merged as part of the vPCI series.
>>
>> v1->v2:
>> * new patch
>> ---
>> xen/arch/arm/Kconfig              | 1 +
>> xen/arch/arm/include/asm/domain.h | 2 +-
>> 2 files changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>> index 4e0cc421ad48..75dfa2f5a82d 100644
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -195,6 +195,7 @@ config PCI_PASSTHROUGH
>> depends on ARM_64
>> select HAS_PCI
>> select HAS_VPCI
>> + select HAS_VPCI_GUEST_SUPPORT
> 
> I tested this series on top of "SMMU handling for PCIe Passthrough on ARMâ€ series on the N1SDP board
> and observe the SMMUv3 fault.

Thanks for testing this. After a great deal of tinkering, I can reproduce the SMMU fault.

(XEN) smmu: /axi/smmu@fd800000: Unhandled context fault: fsr=0x402, iova=0xf9030040, fsynr=0x12, cb=0

> Enable the Kconfig option PCI_PASSTHROUGH, ARM_SMMU_V3,HAS_ITS and "iommu=onâ€,
> "pci_passthrough_enabled=on" cmd line parameter and after that, there is an SMMU fault
> for the ITS doorbell register access from the PCI devices.
> 
> As there is no upstream support for ARM for vPCI MSI/MSI-X handling because of that SMMU fault is observed.
> 
> Linux Kernel will set the ITS doorbell register( physical address of doorbell register as IOMMU is not enabled in Kernel)
> in PCI config space to set up the MSI-X interrupts, but there is no mapping in SMMU page tables because of that SMMU
> fault is observed. To fix this we need to map the ITS doorbell register to SMMU page tables to avoid the fault.
> 
> We can fix this after setting the mapping for the ITS doorbell offset in the ITS code.
> 
> diff --git a/xen/arch/arm/vgic-v3-its.c b/xen/arch/arm/vgic-v3-its.c
> index 299b384250..8227a7a74b 100644
> --- a/xen/arch/arm/vgic-v3-its.c
> +++ b/xen/arch/arm/vgic-v3-its.c
> @@ -682,6 +682,18 @@ static int its_handle_mapd(struct virt_its *its, uint64_t *cmdptr)
>                                           BIT(size, UL), valid);
>          if ( ret && valid )
>              return ret;
> +
> +        if ( is_iommu_enabled(its->d) ) {
> +            ret = map_mmio_regions(its->d, gaddr_to_gfn(its->doorbell_address),
> +                           PFN_UP(ITS_DOORBELL_OFFSET),
> +                           maddr_to_mfn(its->doorbell_address));
> +            if ( ret < 0 )
> +            {
> +                printk(XENLOG_ERR "GICv3: Map ITS translation register d%d failed.\n",
> +                        its->d->domain_id);
> +                return ret;
> +            }
> +        }
>      }

Thank you, this resolves the SMMU fault. If it's okay, I will include this patch in the next revision of the SMMU series (I see your Signed-off-by is already in the attachment).

> Also as per Julien's request, I tried to set up the IOMMU for the PCI device without
> "pci_passthroigh_enable=on" and without HAS_VPCI everything works as expected
> after applying below patches.
> 
> To test enable kconfig options HAS_PCI, ARM_SMMU_V3 and HAS_ITS and add below
> patches to make it work.
> 
>     â€¢ Set the mapping for the ITS doorbell offset in the ITS code when iommu is enabled.
>     â€¢ Reverted the patch that added the support for pci_passthrough_on.
>     â€¢ Allow MMIO mapping of ECAM space to dom0 when vPCI is not enabled, as of now MMIO
>       mapping for ECAM is based on pci_passthrough_enabled. We need this patch if we want to avoid
>      enabling HAS_VPCI
> 
> Please find the attached patches in case you want to test at your end.
> 
> 
> 
> Regards,
> Rahul
> 
>> default n
>> help
>>  This option enables PCI device passthrough
>> diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
>> index 1a13965a26b8..6e016b00bae1 100644
>> --- a/xen/arch/arm/include/asm/domain.h
>> +++ b/xen/arch/arm/include/asm/domain.h
>> @@ -298,7 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {}
>>
>> #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag)
>>
>> -#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); })
>> +#define has_vpci(d)    ({ (void)(d); IS_ENABLED(CONFIG_HAS_VPCI); })
>>
>> struct arch_vcpu_io {
>>     struct instr_details dabt_instr; /* when the instruction is decoded */
>> --
>> 2.41.0
>>
>>
> 


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 05:51:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 05:51:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567332.886226 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMj2p-0003hg-UQ; Fri, 21 Jul 2023 05:51:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567332.886226; Fri, 21 Jul 2023 05:51:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMj2p-0003hZ-PV; Fri, 21 Jul 2023 05:51:15 +0000
Received: by outflank-mailman (input) for mailman id 567332;
 Fri, 21 Jul 2023 05:51:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMj2p-0003hP-7p; Fri, 21 Jul 2023 05:51:15 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMj2o-0003A9-Sj; Fri, 21 Jul 2023 05:51:14 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMj2o-0000zH-FZ; Fri, 21 Jul 2023 05:51:14 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMj2o-0000II-F4; Fri, 21 Jul 2023 05:51:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=FctWlymhflmGDDXUnr28FyHfCmVIpaoRHCobfXpWfUI=; b=ykgqwm/3zENpqgBUITuqCGs0vj
	UwCCkeg21bGQ2g9PTdtY/7FoY58qHjeYblwQndi+xe1/N6xjOG5hBFf831Oa6JqU3Bw4tq7n9+x9M
	RSJIqmdG6/FJZhUnXf8boqkp+pTwcgGE5Zmk/5eRALUZhGwaLe8F7b3xID0FzDlKH820=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181918-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 181918: tolerable FAIL - PUSHED
X-Osstest-Failures:
    qemu-mainline:test-armhf-armhf-xl-vhd:guest-start:fail:heisenbug
    qemu-mainline:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=2c27fdc7a626408ee2cf30d791aa0b63027c7404
X-Osstest-Versions-That:
    qemuu=6972ef1440a9d685482d78672620a7482f2bd09a
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 21 Jul 2023 05:51:14 +0000

flight 181918 qemu-mainline real [real]
flight 181942 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181918/
http://logs.test-lab.xenproject.org/osstest/logs/181942/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-vhd      13 guest-start         fail pass in 181942-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-vhd     14 migrate-support-check fail in 181942 never pass
 test-armhf-armhf-xl-vhd 15 saverestore-support-check fail in 181942 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 180691
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 180691
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 180691
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180691
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 180691
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 180691
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180691
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180691
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass

version targeted for testing:
 qemuu                2c27fdc7a626408ee2cf30d791aa0b63027c7404
baseline version:
 qemuu                6972ef1440a9d685482d78672620a7482f2bd09a

Last test of basis   180691  2023-05-17 10:45:22 Z   64 days
Failing since        180699  2023-05-18 07:21:24 Z   63 days  127 attempts
Testing same since   181918  2023-07-20 06:54:14 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Afonso Bordado <afonsobordado@gmail.com>
  Akihiko Odaki <akihiko.odaki@daynix.com>
  Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
  Alex BennÃ©e <alex.bennee@linaro.org>
  Alex Williamson <alex.williamson@redhat.com>
  Alexander Bulekov <alxndr@bu.edu>
  Alexander Graf <graf@amazon.com>
  Alexander Ivanov <alexander.ivanov@virtuozzo.com>
  Alistair Francis <alistair.francis@wdc.com>
  Anastasia Belova <abelova@astralinux.ru>
  Andrea Bolognani <abologna@redhat.com>
  Andreas Schwab <schwab@suse.de>
  Andrew Jeffery <andrew@aj.id.au>
  Andrew Melnychenko <andrew@daynix.com>
  Ani Sinha <ani@anisinha.ca>
  Ani Sinha <anisinha@redhat.com>
  Anthony PERARD <anthony.perard@citrix.com>
  Anton Johansson <anjo@rev.ng>
  Antonio Caggiano <quic_acaggian@quicinc.com>
  Avihai Horon <avihaih@nvidia.com>
  BALATON Zoltan <balaton@eik.bme.hu>
  Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
  Bernhard Beschow <shentey@gmail.com>
  Bilal Elmoussaoui <belmouss@redhat.com>
  Bin Meng <bin.meng@windriver.com>
  Bin Meng <bmeng@tinylab.org>
  Brian Cain <bcain@quicinc.com>
  Brice Goglin <Brice.Goglin@inria.fr>
  Camilla Conte <cconte@redhat.com>
  Carlos Santos <casantos@redhat.com>
  Chen Baozi <chenbaozi@phytium.com.cn>
  Christian Borntraeger <borntraeger@linux.ibm.com>
  Christian Schoenebeck <qemu_oss@crudebyte.com>
  Christoph Muellner <christoph.muellner@vrull.eu>
  Christoph MÃ¼llner <christoph.muellner@vrull.eu>
  Chuck Zmudzinski <brchuckz@aol.com>
  Cindy Lu <lulu@redhat.com>
  ClÃ©ment Chigot <chigot@adacore.com>
  Conor Dooley <conor.dooley@microchip.com>
  Corey Minyard <cminyard@mvista.com>
  Cornelia Huck <cohuck@redhat.com>
  CÃ©dric Le Goater <clg@kaod.org>
  CÃ©dric Le Goater <clg@redhat.com>
  Daniel Bertalan <dani@danielbertalan.dev>
  Daniel Henrique Barboza <danielhb413@gmail.com>
  Daniel Henrique Barboza <dbarboza@ventanamicro.com>
  Daniel P. BerrangÃ© <berrange@redhat.com>
  Daniil Kovalev <dkovalev@compiler-toolchain-for.me>
  David Hildenbrand <david@redhat.com>
  David Woodhouse <dwmw@amazon.co.uk>
  Dongwon Kim <dongwon.kim@intel.com>
  Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
  Enze Li <lienze@kylinos.cn>
  Eric Auger <eric.auger@redhat.com>
  Eric Blake <eblake@redhat.com>
  Eric DeVolder <eric.devolder@oracle.com>
  Erico Nunes <ernunes@redhat.com>
  Erik Skultety <eskultet@redhat.com>
  Eugenio PÃ©rez <eperezma@redhat.com>
  Fabiano Rosas <farosas@suse.de>
  Fan Ni <fan.ni@samsung.com>
  Fei Wu <fei2.wu@intel.com>
  Fiona Ebner <f.ebner@proxmox.com>
  Francesco Cagnin <fcagnin@quarkslab.com>
  Francisco Iglesias <frasse.iglesias@gmail.com>
  Frederic Barrat <fbarrat@linux.ibm.com>
  Gavin Shan <gshan@redhat.com>
  Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
  Gregory Price <gourry.memverge@gmail.com>
  Gregory Price <gregory.price@memverge.com>
  Guenter Roeck <linux@roeck-us.net>
  Hanna Czenczek <hreitz@redhat.com>
  Hao Zeng <zenghao@kylinos.cn>
  Hawkins Jiawei <yin31149@gmail.com>
  Helge Deller <deller@gmx.de>
  Henrik Carlqvist <hc1245@poolhem.se>
  Henrik Carlqvist <hc981@poolhem.se>
  Himanshu Chauhan <hchauhan@ventanamicro.com>
  Igor Mammedov <imammedo@redhat.com>
  Ilya Leoshkevich <iii@linux.ibm.com>
  Ira Weiny <ira.weiny@intel.com>
  Isaku Yamahata <isaku.yamahata@intel.com>
  Ivan Klokov <ivan.klokov@syntacore.com>
  Jagannathan Raman <jag.raman@oracle.com>
  Jan Kratochvil <jan@jankratochvil.net>
  Jason Chien <jason.chien@sifive.com>
  Jason Wang <jasowang@redhat.com>
  Jean-Louis Dupond <jean-louis@dupond.be>
  Jean-Philippe Brucker <jean-philippe@linaro.org>
  Jiajie Chen <c@jia.je>
  Jiaxun Yang <jiaxun.yang@flygoat.com>
  Joao Martins <joao.m.martins@oracle.com>
  Joel Stanley <joel@jms.id.au>
  John HÃ¶gberg <john.hogberg@ericsson.com>
  John Snow <jsnow@redhat.com>
  Jonathan Cameron <Jonathan.Cameron@huawei.com>
  Juan Quintela <quintela@redhat.com>
  Junqiang Wang <wangjunqiang@iscas.ac.cn>
  Keqian Zhu <zhukeqian1@huawei.com>
  Kevin Wolf <kwolf@redhat.com>
  Klaus Jensen <k.jensen@samsung.com>
  Konstantin Kostiuk <kkostiuk@redhat.com>
  Lakshmi Bai Raja Subramanian <lakshmi.bai.rajasubramanian@bodhicomputing.com>
  Laszlo Ersek <lersek@redhat.com>
  Laurent Vivier <laurent@vivier.eu>
  Laurent Vivier <lvivier@redhat.com>
  Lei Wang <lei4.wang@intel.com>
  Lei Yang <leiyang@redhat.com>
  Leonardo Bras <leobras@redhat.com>
  LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
  Lucas Dietrich <ld.adecy@gmail.com>
  Lukas Doktor <ldoktor@redhat.com>
  Mads Ynddal <m.ynddal@samsung.com>
  Maksim Davydov <davydov-max@yandex-team.ru>
  Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
  Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
  Marcelo Tosatti <mtosatti@redhat.com>
  Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
  Marcin Nowakowski <marcin.nowakowski@fungible.com>
  Marco Liebel <quic_mliebel@quicinc.com>
  Mario Casquero <mcasquer@redhat.com>
  Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Markus Armbruster <armbru@redhat.com>
  Martin Kaiser <martin@kaiser.cx>
  Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
  Mattias Nissler <mnissler@rivosinc.com>
  Mauro Matteo Cascella <mcascell@redhat.com>
  Max Chou <max.chou@sifive.com>
  Max Filippov <jcmvbkbc@gmail.com>
  Max Fritz <antischmock@googlemail.com>
  Mayuresh Chitale <mchitale@ventanamicro.com>
  Michael S. Tsirkin <mst@redhat.com>
  Michael Tokarev <mjt@tls.msk.ru>
  Michal Privoznik <mprivozn@redhat.com>
  Milan Zamazal <mzamazal@redhat.com>
  Minwoo Im <minwoo.im@samsung.com>
  Mostafa Saleh <smostafa@google.com>
  Narayana Murty N <nnmlinux@linux.ibm.com>
  Nicholas Piggin <npiggin@gmail.com>
  Nicolas Saenz Julienne <nsaenz@amazon.com>
  Niek Linnenbank <nieklinnenbank@gmail.com>
  Niklas Cassel <niklas.cassel@wdc.com>
  Ninad Palsule <ninad@linux.ibm.com>
  Olaf Hering <olaf@aepfle.de>
  Palmer Dabbelt <palmer@rivosinc.com>
  Paolo Bonzini <pbonzini@redhat.com>
  Patrick Venture <venture@google.com>
  Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
  Peng Liang <tcx4c70@gmail.com>
  Peter Maydell <peter.maydell@linaro.org>
  Peter Xu <peterx@redhat.com>
  Philippe Mathieu-DaudÃ© <philmd@linaro.org>
  Philippe Mathieu-DaudÃ© <philmd@redhat.com>
  Pierrick Bouvier <pierrick.bouvier@linaro.org>
  Prasad Pandit <pjp@fedoraproject.org>
  qianfan Zhao <qianfanguijin@163.com>
  Raghu H <raghuhack78@gmail.com>
  Rene Engel <ReneEngel80@emailn.de>
  Richard Henderson <richard.henderson@linaro.org>
  Richard Purdie <richard.purdie@linuxfoundation.org>
  Richard W.M. Jones <rjones@redhat.com>
  Ricky Zhou <ricky@rzhou.org>
  Rob Bradford <rbradford@rivosinc.com>
  Robbin Ehn <rehn@rivosinc.com>
  Robin Voetter <robin@streamhpc.com>
  Ryan Wendland <wendland@live.com.au>
  Sebastian Ott <sebott@redhat.com>
  Sergey Kambalin <sergey.kambalin@auriga.com>
  Sergio Lopez <slp@redhat.com>
  Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
  Shashi Mallela <shashi.mallela@linaro.org>
  Siarhei Volkau <lis8215@gmail.com>
  Sid Manning <sidneym@quicinc.com>
  Siqi Chen <coc.cyqh@gmail.com>
  Song Gao <gaosong@loongson.cn>
  Stefan Berger <stefanb@linux.ibm.com>
  Stefan Hajnoczi <stefanha@redhat.com>
  Stefano Garzarella <sgarzare@redhat.com>
  Stefano Stabellini <sstabellini@kernel.org>
  Stefano Stabellini <stefano.stabellini@amd.com>
  Steve Sistare <steven.sistare@oracle.com>
  Sunil V L <sunilvl@ventanamicro.com>
  Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
  Tao Su <tao1.su@linux.intel.com>
  Taylor Simpson <tsimpson@quicinc.com>
  Tested-By: Solra Bizna <solra@bizna.name>
  Thomas Huth <thuth@redhat.com>
  Thomas WeiÃŸschuh <thomas@t-8ch.de>
  Tianrui Zhao <zhaotianrui@loongson.cn>
  timothee.cocault@gmail.com <timothee.cocault@gmail.com>
  TimothÃ©e Cocault <timothee.cocault@gmail.com>
  Tom Lonergan <tom.lonergan@nutanix.com>
  Tommy Wu <tommy.wu@sifive.com>
  Tong Ho <tong.ho@amd.com>
  Tony Krowiak <akrowiak@linux.ibm.com>
  Vanderson M. do Rosario <vandersonmr2@gmail.com>
  Vikram Garhwal <vikram.garhwal@amd.com>
  Viktor Prutyanov <viktor@daynix.com>
  Vitaly Cheptsov <cheptsov@ispras.ru>
  Vivek Kasireddy <vivek.kasireddy@intel.com>
  Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
  Volker RÃ¼melin <vr_qemu@t-online.de>
  Wang Yuquan <wangyuquan1236@phytium.com.cn>
  Weiwei Li <liweiwei@iscas.ac.cn>
  Xiao Wang <xiao.w.wang@intel.com>
  Xinyu Li <lixinyu20s@ict.ac.cn>
  Xuelian Guo <xuelian.guo@intel.com>
  Yang Zhang <yang.zhang@hexintek.com>
  yang.zhang <yang.zhang@hexintek.com>
  YangHang Liu <yanghliu@redhat.com>
  Yin Wang <yin.wang@intel.com>
  Yuquan Wang <wangyuquan1236@phytium.com.cn>
  Zeng Hao <zenghao@kylinos.cn>
  Zhang Huasen <huasenzhang@foxmail.com>
  Zhao Liu <zhao1.liu@intel.com>
  zhenwei pi <pizhenwei@bytedance.com>
  Zhenyu Zhang <zhenyzha@redhat.com>
  Zhenzhong Duan <zhenzhong.duan@intel.com>
  Zhuojia Shen <chaosdefinition@hotmail.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      fail    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/qemu-xen.git
   6972ef1440..2c27fdc7a6  2c27fdc7a626408ee2cf30d791aa0b63027c7404 -> upstream-tested


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 05:52:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 05:52:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567337.886236 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMj3p-0004Em-BS; Fri, 21 Jul 2023 05:52:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567337.886236; Fri, 21 Jul 2023 05:52:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMj3p-0004Ef-8I; Fri, 21 Jul 2023 05:52:17 +0000
Received: by outflank-mailman (input) for mailman id 567337;
 Fri, 21 Jul 2023 05:52:15 +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 <SRS0=FBlW=DH=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMj3n-0004EX-Oj
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 05:52:15 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20603.outbound.protection.outlook.com
 [2a01:111:f400:7d00::603])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bd0a6b61-278a-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 07:52:12 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB9416.eurprd04.prod.outlook.com (2603:10a6:102:2ab::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 05:52:10 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 05:52:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bd0a6b61-278a-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=R+Gc6HG5tQvk3UAdJyc+/NfhSC76frJ3Mhu88e0QPUpi9uk6KB447zMUPP8cfZ+q6GATdmrspQbuP3I3waUHAXe5WbDd2NhpCwzLE2TKDr0lraKC8UpEYlj+GvG2/qoPU23bz+vqrtGlapl3T/JALT+M5s/NFn2pp6UC2lFlWLpr3Zg5fXKS0AmrOZ4FkBQxSHwSyCYsuIUBRsy7J9F0sumynvc6lA0cAm4j7kAwKayUF8kS++yFSzXFMgNdkRNb9YQbgLWy/zuAnnfkRjIgMZ8T+jyaBY/JE3JqPug2lhIMv3Af9hMyNVwvgmfnrxNcVfVZXXM4pJAlWqL97VR1ow==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=qItS7tULWpEoXGK8qSfHuaaQHSiXsvIKMSCmCACX/Vk=;
 b=neke5Wcc9fQnBgRoAoJ/91zGKwpmyKgGgHrzqLNTOkpZhP/vdyOYD5sEuH7YqzfZrqSO91IjMn5f/zfXIjCa7t1hiCZEwlzhsbUs4MzLGWMp0oWKBklbFMTjHm++Uax8CDCVx4GQ+FiEmBKHN3fyidXxxgdxFSTI9uPuCA4Oa3TvBqTdzAXnOuSFTnvRNfiF/CaOEiyp7EXe5G78NDL2KnUSQ+Ty+TvsuRX/miLTcNxkHfr41tTzQ8o57UU0dbpK9gpL2G6MmKHRjVg2uED6zBggvAiGSgGNqQuMCjlRc3X044VqmVxIWnlLuYTCjj0tFeMBLZEzEmmYSM38EwUwTA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=qItS7tULWpEoXGK8qSfHuaaQHSiXsvIKMSCmCACX/Vk=;
 b=ruhCYCYzrujmBOieXc+elfzydEUeYK3SG4K/l7mTyPbA7Bj/pX8a8H6wAkBGy39O/X/BR20uLJaqCnw7IrUM8MaFAWkpv4OM5NliIqao/4fKuULB/seOVTbgstBnkksDNeOtpNwYsN/p0V1/xr2d16y/0UnkaQ3Ao1l7QwVEcBDZhGiHJFABly2Ie4kwjPdsE7yzkRtg6esH+WFTcD3ZzVYO+nOVui7jlvXhsLXc0kVk2Ssmf0YXXjjrU7xNpRuyEaUQfWMAWhwk5vFk9NPhX82eUdtXdrdc4KnOeMwWpiEsY9GhoTOBzdj/55FXfXtRN/yLM7RuTvhaF5+UWlSTXA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <85494c1e-b56a-7d10-9526-69ad54862bd3@suse.com>
Date: Fri, 21 Jul 2023 07:52:07 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 1/4] build: make cc-option properly deal with
 unrecognized sub-options
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Anthony Perard <anthony.perard@citrix.com>
References: <dace10da-f108-fbe5-da4f-0e4497f512d9@suse.com>
 <b2c0b9ce-7919-8571-cee5-5ee68b7db63c@suse.com>
In-Reply-To: <b2c0b9ce-7919-8571-cee5-5ee68b7db63c@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0033.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:14::20) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB9416:EE_
X-MS-Office365-Filtering-Correlation-Id: 8f60ef38-e1f2-4547-52e1-08db89ae9fce
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	burHLunSJu8vwz/bzk5ypxKUwSo3lbm5m0E571eAduT5l96HoCLPKpbv7lh66RMrlK3xt1UKpf1n+V6nBPGl/JRu7/qkoKqa7zoekIP/Gu8dnAbOJLTLWBAnskAZw9MuS7rW2EViXdlEEGiLTUTI77cMGOBsoPg1iWX6UXACwOTDGHNfSqYO9GPhBo+SVOMrBZ7gR8JebbmKXGTncUiRPyT+6+kuWGSvNEP+W07qR0+OjSgIjaZpl0Jd4DBkAWyzYIK7efnzfxuxFl4C1F1NeFfYz6K4qsHNmsibjpLyUlUgy/joQUu+KwON4jhm9UGBEP+JR7TtsS9X2CIIfcAFd+h0+60IX08rT/P7zCxJFSyiKwAnH0B6tO/r2U/rD3jkccMGf5Femdrhs41CQhpUGTd/JVNZ8emUhXTZd9HjwZKyUkuOCYuM0yyD4R8rcms4D5f+NpNcnhQ5Ikqrk4TX35ej2UkJO7Ds4C9embBxgPFtvmkZXS0eN1fi2j9Wr7lnjzab1qtZGC7FpmHAJ9n0xXSxYst0Kj82cO3ejxpb23qFEYf6OLrDVJmGlo1PjuyawlxU2iCjSWGNqbdfUGvV/gTIpHemIa6s2bAhTa6yYMp3kVMEM8af0CvFkqAFTXSi5Mbcg1GdwjupASaa7qeiJQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(39860400002)(396003)(346002)(366004)(376002)(451199021)(38100700002)(2616005)(36756003)(83380400001)(54906003)(4326008)(66556008)(66476007)(6916009)(2906002)(316002)(66946007)(6512007)(6486002)(478600001)(6666004)(186003)(5660300002)(26005)(41300700001)(8936002)(8676002)(6506007)(53546011)(31696002)(86362001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cW1QRHByWldCV0xsdVFWS09wVWlaZWFnTUZDNmlCcUdyNGpjaHdSZlZPcTY1?=
 =?utf-8?B?NFdFaGFoN3k0WU9HeDF4YUt1NXZwdHNydjBsTkM5SjgybGdndTIyVlhWRlBM?=
 =?utf-8?B?N0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VJRa0NH?=
 =?utf-8?B?TEd1dmlCV0UxSWRHVkxRT0grdEZpd1hkbnduanprbkxCZVhZOWtvL0c2MlJy?=
 =?utf-8?B?WVZqQW14dlFnZzIvTXM1R1FNWUZCaGhaWkFaU0RyRXorOElSdEl3ZzRSWC82?=
 =?utf-8?B?TEdIUEpoYnBHenpybktrTE9WdGhOZGJISFJ3eks0N3laQndoRGxyUE5waXli?=
 =?utf-8?B?aWtNZ1Y1K1NRQ2VvOGxHRGxseGlLbVdnWElmdHUxdkxOcDlmTThDMTFYbVFl?=
 =?utf-8?Q?qRXKzGHgXFBRk3dkV03zfAJDq?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8f60ef38-e1f2-4547-52e1-08db89ae9fce
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 05:52:10.3219
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: L4tfyww3glCU2kjul8H8q6/hblFT5NeCDh9VdjKMy2SpkBxN6Ba7TJ6RBartYAuEu5VGANMCMdHRw1bi8zbtaw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9416

On 19.07.2023 11:43, Jan Beulich wrote:
> In options like -march=, it may be only the sub-option which is
> unrecognized by the compiler. In such an event the error message often
> splits option and argument, typically saying something like "bad value
> '<argument>' for '<option>'. Extend the grep invocation accordingly,
> also accounting for Clang to not mention e.g. -march at all when an
> incorrect argument was given for it.
> 
> To keep things halfway readable, re-wrap and re-indent the entire
> construct.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> In principle -e "$$pat" could now be omitted from the grep invocation,
> since if that matches, both $$opt and $$arg will, too. But I thought I'd
> leave it for completeness.
> ---
> v2: Further relax grep patterns for clang, which doesn't mention -march
>     when complaining about an invalid argument to it.

I wonder whether it would be sufficient (and a little less lax) ...

> --- a/Config.mk
> +++ b/Config.mk
> @@ -90,9 +90,14 @@ PYTHON_PREFIX_ARG ?= --prefix="$(prefix)
>  # of which would indicate an "unrecognized command-line option" warning/error.
>  #
>  # Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
> -cc-option = $(shell if test -z "`echo 'void*p=1;' | \
> -              $(1) $(2) -c -o /dev/null -x c - 2>&1 | grep -- $(2:-Wa$(comma)%=%) -`"; \
> -              then echo "$(2)"; else echo "$(3)"; fi ;)
> +cc-option = $(shell pat='$(2:-Wa$(comma)%=%)'; \
> +                    opt="$${pat%%=*}" arg="$${pat\#*=}"; \
> +                    if test -z "`echo 'void*p=1;' | \
> +                                 $(1) $(2) -c -o /dev/null -x c - 2>&1 | \
> +                                 grep -e "$$pat" -e "$$opt" -e "$$arg" -`"; \

... to check for only $$arg here (which will be the same as $$pat when
there's no = in the full option).

In either case there's likely going to be an issue with options taking
very simple (e.g. plain numeric) arguments.

Jan

> +                    then echo "$(2)"; \
> +                    else echo "$(3)"; \
> +                    fi;)
>  
>  # cc-option-add: Add an option to compilation flags, but only if supported.
>  # Usage: $(call cc-option-add CFLAGS,CC,-march=winchip-c6)
> 
> 



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 05:58:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 05:58:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567341.886246 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMj9I-0004vc-0Z; Fri, 21 Jul 2023 05:57:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567341.886246; Fri, 21 Jul 2023 05:57:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMj9H-0004vV-TW; Fri, 21 Jul 2023 05:57:55 +0000
Received: by outflank-mailman (input) for mailman id 567341;
 Fri, 21 Jul 2023 05:57:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=FBlW=DH=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMj9G-0004vP-NE
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 05:57:54 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on20601.outbound.protection.outlook.com
 [2a01:111:f400:fe16::601])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 87a9e9b0-278b-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 07:57:53 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8682.eurprd04.prod.outlook.com (2603:10a6:20b:43d::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 05:57:50 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 05:57:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 87a9e9b0-278b-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=dbVlv1r75S+DpECCnV/Ou0jNmTPE1fhUGSx9FaBzZ3BT2bhPkDyWEiw/21RjW4L6r9oWTos9jzdoRsmMhl+J73kbNU+LOCdQLEyDK0muyV6zN8h8dP4gDI0cOmUHdDuhT/Mcnu8TSzw+g5ky9F2VTY1bPBPnyA4KsKLdEVCacrtCXc2LrYEXbXGHd7Fd5lRRMGFkWDzXDhUhT0TcHpCKSctuaa8mW9A/X6sUrI4UoQ0+x87p+OUUG1hYcYeP0jjWnDu6C8Hozr6+u3EcpeYlLgTMXtQckCrXFObUWGuO5hAviu1L0hERlfw9csdKaUHDA6exvnn7wRSjnwRO31NGWw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7RKzNKUcgt5uxUNRKvjbWiQ3/p8Fq2It+DQgky1Xi4k=;
 b=f9t7dQj8e0OoThm3TWbFLK3wH9REUe+Q5ke1wOvjOMsjVIfujC7+XPIVFIW6nEChSM17BO9MExd3He3nr2yPB2OLKMdumqI8fYRpTcD1U9NNPAgiAeRiuodqqqMBzsaF+ARjDG4wVuwEx4Y7Yyio3qN8sfA9zWyFXxgh+lcqpClPzjlAckNgcuLpzNEC0KBJb+oLpPso1+lKR96/0fLgEgkGVbbh/33bdWgCgVfcIEiLlZpdDNkcKslPpdSkmcXSZEaMzy3whGMFgZiBZ768GmI5WX01a5Xd24IMnQ6HsjAs6ZeL7yDdlklU9aBObZxjcdjMygUOiH/C1oJ4O1IRzQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7RKzNKUcgt5uxUNRKvjbWiQ3/p8Fq2It+DQgky1Xi4k=;
 b=i1hC8tJy/KDoBH8BS36/eB/QXBleM7Pj33l3Rs8VDIbhexd90cD+R0CU1vJZY8WxsFV5uwmWs0VbZbRmRB+4upH01MYQbrogSYzP04DRtzcIP4YqOxnDbk7BSFyScA0IWquGVc+WI0ylJV50Xzbu/Dl5tq2b62as9EVYl2wR0GXaNZxgkVHB7Zpr3MXoNwofFvAJrRLyuKmc9a2H3XeJN6nSNN2QiTxwJ3ghKBNrN20ydYtuoeNOphp9kRwkDSZ+TgbsFhEaXRhuntLgRsZnIEXbpscKA0fKqFGRcE0SAwfqvWyhzTBDMOXKYYXevBmjREqSL0LL8bab4o1FwYSZoQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <d93c3c89-3332-da3b-9a0d-3ecc4742ba02@suse.com>
Date: Fri, 21 Jul 2023 07:57:47 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v4 3/4] xen/ppc: Implement early serial printk on pseries
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1689710519.git.sanastasio@raptorengineering.com>
 <7c416ff843ea359bb24b8c954cc079fe1bbaf75f.1689710519.git.sanastasio@raptorengineering.com>
 <6d3b7cd6-7d6a-8d28-f1e7-7e939e393445@suse.com>
 <596297da-a335-6463-a9db-982f649f7183@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <596297da-a335-6463-a9db-982f649f7183@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0106.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a3::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8682:EE_
X-MS-Office365-Filtering-Correlation-Id: 857411e1-e08a-4445-10a0-08db89af6a55
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	5hAR0JmzloMoeLmxfmtAZSnAlEMHzpIVX0dBijUJAXQai2FliKY2n5QuS7M89QmAdNAGVeZ3lvfnV+YIh5nb7uBuVn7OD+ZRuehy4oBcyVAdFJt6S7Pjc/PatAN/6FYrUqJa2ox6GosxdfKbjvvC2RXzBjiDWcMwqk57OPl3DMupYbSOVmqnPBSrpfJbPNyVIlGFF3accrVgmbtfxbRKpUH4WhLq5k43IOV899BlGzizGTXexxo/2MecqbE0zwK7VU94HdbO7AfeCq47IZ18LgR93avGuZbBgHGRoowPQK+pchRQjKi8lTzV/mSb+L9ulD0dYf2kkCmfqWKz/JrZJshMpniElmUpmSVo48NmgRmjx909E5dkhmNyw4PYQoipnSN9yfuYwNQQsTbFbrw3Fp+KdtjThMF4dOpdMu9h6HjyltM9nM74+Iz6CDgEDmn6H9bxfV7jsWNjn5uVEpuG2Yj/e0tUp4kPBViO6BmiW89qF6KduuV3LakjN5U7ZrRC4jbPZB/mL9t0vziRe1R1+CB6VH84/p6wA7CJZva2bpywn5YcjsoFKV1VBfHGa4GWemB2zG0NnykMhLWyOHencVVwDzXiqszFUdNRfaXZIIRhW7xmiTohLwBnzLMUMEnfCM/pSwHM25xoNU1e/1mGMg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(396003)(39860400002)(366004)(376002)(346002)(451199021)(6666004)(6486002)(36756003)(2616005)(83380400001)(6506007)(26005)(53546011)(186003)(6512007)(316002)(2906002)(41300700001)(66946007)(6916009)(66556008)(66476007)(5660300002)(86362001)(31696002)(8936002)(8676002)(31686004)(4326008)(54906003)(38100700002)(478600001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dXhmeWVWSWlVUC9RVGlBNUNzWHo5QkdTSlJub0ZhdzQrcmt6aDgvMjA4KzNj?=
 =?utf-8?B?RTRCUS9qNXluQTd2ejZuamJlOWpuV2Y5R0thT0pHQ2IxUnRIODJFMC9wYnpj?=
 =?utf-8?B?dVJsSURMOVZSK3RPVERkeWFaQ2VFSFFpTEhYeS9IRHQ3SVpkVEo4TGNqRnFw?=
 =?utf-8?B?QWNKeU5uK2JzV0d1d1AwK1FpNW9VOGE1bURmbGRSa2g4c0FySUxMSjNOOEdl?=
 =?utf-8?B?UVcvSUw2ZS90SWhsVDVwMkRacnRUSFE0QXorTUZSWE83YW01dTN0aG9yaGtE?=
 =?utf-8?B?dTU0OXcycFplSzM1ZnBrVytOMlF1eXpMZisvVGtFaVNFQklUdE9hT1JCYWJ6?=
 =?utf-8?B?RGFLd3FvV1c3VHl4ck16SE1pbUNRM01QZ2gy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WL8aWNd?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 857411e1-e08a-4445-10a0-08db89af6a55
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 05:57:50.0848
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: zCKVbIwJVx6GKnITPnYf1pwuwPp1vuOwzULOeFgcIK+AN94NElZQLhRmtkboxtZlkwUn1hOpAYbc9F4wgH1Maw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8682

On 20.07.2023 23:01, Shawn Anastasio wrote:
> On 7/19/23 9:05 AM, Jan Beulich wrote:
>> Before you/we grow more assembly code, may I re-raise a request regarding
>> readability: I think it would be nice if operands started at a fixed column,
>> unless the insn mnemonic is unusually long. Where exactly to draw the line
>> is up to each archtecture; on x86 we use 8 positions from the start of the
>> mnemonic.
> 
> There is quite a large variance in mnemonic length on ppc -- many common
> mnemonics only use 2 characters (e.g. ld, mr) while other common ones
> use 6+ (e.g. rldicr, the mtspr family, etc.). Enforcing a column size
> that's too short would make the longer mnemonics look misaligned and out
> of place, but using a longer column length (like 8) that can accommodate
> most common mnemonics adds too much space between short mnemonics and
> their arguments.

Common length is 3 on x86, and as said we use 8.

> That said if you still feel strongly about this then I am not strongly
> opposed to adding an 8-space column alignment.

I certainly think it helps readability a lot. 8 also matches the common
use (fair parts of gas'es testsuite, Linux) of hard tabs.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 06:02:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 06:02:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567344.886256 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMjDu-0006RX-Hl; Fri, 21 Jul 2023 06:02:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567344.886256; Fri, 21 Jul 2023 06:02:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMjDu-0006RQ-Ef; Fri, 21 Jul 2023 06:02:42 +0000
Received: by outflank-mailman (input) for mailman id 567344;
 Fri, 21 Jul 2023 06:02:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=FBlW=DH=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMjDs-0006RK-Lu
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 06:02:40 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on0616.outbound.protection.outlook.com
 [2a01:111:f400:fe02::616])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 31f7af70-278c-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 08:02:38 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by GV1PR04MB9199.eurprd04.prod.outlook.com (2603:10a6:150:2a::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 06:02:36 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 06:02:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 31f7af70-278c-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=OLNzT1sz5rFcOMqgv9gq4qLfdqGwNKbg3SNo+ux799jaYVgGHrMikGBQo5SHaikzhP4kJkn2CIO0qYaEFE54qNPtgQS3Zso1V7e6GYRZbDBm996KEZqlpyZp8T7em637Am40OyqAInPiYCgMdg0SVB1w2YO+A1EkF7l+LjBLGNFQXW9H3Z7Gb2vVWPzpkfK/MWbjx4U3oKRvurrtkTeMKPxwIK5M97pstMA5QpuV9o8zTORoW7CIxBvHUEju/MLq+39vAYSI+74g64pduDNNWujELa9eNgQJeiNy4ZunmESYxLCBQJai36YEDB8OvP0WIMrjfJOLLFZdHyfszqmdOQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/cMAsk5SO/im3WOoikG5RqmhbfUkisohoWRcAjHPFGo=;
 b=doo4UwjgtUO0L7sGuGJa1cXIfBnh4yBvJBm9kc7XINsKTkBnXzjJ6x2NRxx4YDLYs82CAR1MIEwwVqcJhQl9duYx41m1I3o+mBTJ2KJxgGEihJ70SA2Qjcpfl8YyL9WFcA8yJh15Z3RQpVdGHSllcVdd8yLhHItEvDHAVkplkW+/qX9gqcPyX0LBiA8SIxBPBlVSL/CKJaDaTauF28rE0eCFBtozoBsn8ZxmyJeVbieQ7p7TShCrIek0kb67XT+ZriARtSNMQ96OLfr9zo1GGyhjtaMW2Eden+DdAJGXLCstBnC931PXZVCs4cLV7V7G2WzOGUDJtHGJH+E4axCZOQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/cMAsk5SO/im3WOoikG5RqmhbfUkisohoWRcAjHPFGo=;
 b=m1iAw2erK/NcAyM4zKSKuGF+tLnafu0lqhzYEtRD+j6qmcXhPXTMl14D9/Kh8nQgI18xasTv2ZRDHGq24oVA2Au+fzsXadVze7rbShotjTKA2Sh6ZbBXTZGsZ6pLaDLHhnbf3A3fFHXlDGAFlnQ2vMuPw9qC1obDeQuTVptxG5/10WlWF4LX4mHMdgUwSN89J3DN8H1AwCiLdry4u70acJKqrsZw9Gipiy8u499YBfvxKEuCakIHxcy1o2uSD9GK4XfjS5ojdFP1OAGrJQ0+c6jSkyfi8KzDa4KnfDN5t0YHsunyYeqTRon6ejSmeGHPMGEFwuLUlxJOwE1dSaIgug==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <96b95858-c83a-5703-f6b2-6bee852e62e0@suse.com>
Date: Fri, 21 Jul 2023 08:02:33 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <e9331a8c-69b5-b803-7989-7e3b95b815e4@suse.com>
 <ZLldU9ZNM5BRXqeY@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZLldU9ZNM5BRXqeY@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0045.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:48::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|GV1PR04MB9199:EE_
X-MS-Office365-Filtering-Correlation-Id: 30b682ff-2ddd-429c-5753-08db89b014a8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	CIQiru8Rt34CykhWO2wzSxSXSbRj1uNruA3od07mKw965rr36hWq2bv4m+JPq77ZxHVUWJ2OiTLiT15leCCa993iouzsQi3LMIhLhRbAaSxT2BTCXLkeWzFXAPQ5OrE3M2+F+yWv/8PF86PfKYzHQ1+tE52zbFZjXuX+XmyjvUXcktSWhd2LU6zv+wtALzo2pM5aYlr+i0dw5c1wz5kxCEKTxpN64QBfbUeUZ7A+zB/GG4UWhJDih4XfNp9OXLZl8uf9Mn1kYljQl7qb/Rt9txpPD+Ug24mlqoNYzyRcqzbkPsiSfy0OmqeIVBAWAkrSJUT68hno4qUFLZxQ8u/o6xRvPXIqI70WqWkP+DliLVMgIRHaXWghhaMzKwsY3eCzzGP5FjgcqnaQUP4EDEhwKSsLelK51bEEf4n2DnJJ4fof8KaHGdaDjNvIGpN6OuBsjfuckjQpiCzW69m/xK3+EnpPNYL0gPKB1ufX5b366O4r8L12sq5/0x9lfWf9M4WdSdo1WE6jEG7taDoTz8VQX0F9oOoyy+u+6y4ZrZziRMXcnRRmDE/ddMM2DGd/FzUJIYI9npEMHaNSAhKj2hg6iMgfUWNJDbIBLYWFWDczD0K4o1EbdKcViRZ7AZc/1MwtMfAbKk4hybc/C8kQaVnJVg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(376002)(366004)(346002)(39860400002)(136003)(451199021)(31686004)(316002)(2616005)(4326008)(6916009)(83380400001)(36756003)(86362001)(2906002)(31696002)(38100700002)(8676002)(5660300002)(8936002)(66476007)(66556008)(54906003)(6512007)(6486002)(41300700001)(6506007)(26005)(53546011)(186003)(478600001)(6666004)(66946007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QzdNbGY3ZVlLd1JVU0k2ZmlXb1dORTNLSWpPN2wwMEl6MEtZbGdKRy9CRDV0?=
 =?utf-8?B?SUZsWThPQ3haeEpDODRzZDlWZHNJYnJvMTZCZ0ZjZVNQVjArMVNFWjhjaDIv?=
 =?utf-8?B?ZGNpNVNvaS9QY2NaWFRnNll1blIrVzU2ZU1LTldNRTlrUElyZVo4WWY3TG96?=
 =?utf-8?B?S1lpUXJvN3FZVWhEWHZrLzA3U3RXOGNpd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E0OVJFM2xBSVBQTWdWbHE0Mm5iUUFMVDVKTWE5aXVrSnNMRXVHcnZsaUhr?=
 =?utf-8?B?QTRmQVByZ1lPdU9VSHYzU3dDaGxRUENGVFdWNko5Y3p2dm5QVGt4UE1UNndU?=
 =?utf-8?B?MlFnQUlvUUpYOW1CN3dDNHJoejFUNzVsWFdWVGU3anNQcEpCdElDS29TQ0kv?=
 =?utf-8?Q?4Oi0gEf5M+7ncCG5xttgEzCWd?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 30b682ff-2ddd-429c-5753-08db89b014a8
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 06:02:35.7962
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: lEcFfn8YWleE2DNzP7gp6TOiBPLb0PpKpgrvG0VigqqyY1gRnBd/puiUtllowoRPLbqsslLcV95yVujthHgmDQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB9199

On 20.07.2023 18:14, Roger Pau MonnÃ© wrote:
> On Thu, Jul 20, 2023 at 06:03:49PM +0200, Jan Beulich wrote:
>> On 20.07.2023 02:32, Volodymyr Babchuk wrote:
>>> --- a/xen/drivers/vpci/msi.c
>>> +++ b/xen/drivers/vpci/msi.c
>>> @@ -190,6 +190,8 @@ static int cf_check init_msi(struct pci_dev *pdev)
>>>      uint16_t control;
>>>      int ret;
>>>  
>>> +    ASSERT(rw_is_write_locked(&pdev->domain->pci_lock));
>>
>> I'm afraid I have to ask the opposite question, compared to Roger's:
>> Why do you need the lock held for write here (and in init_msix())?
>> Neither list of devices nor the pdev->vpci pointer are being
>> altered.
> 
> This is called from vpci_add_handlers() which will acquire (or
> requires being called) with the lock in write mode in order to set
> pdev->vpci I would assume.

Right.

>  Strictly speaking however the init
> handlers don't require the lock in write mode unless we use such
> locking to get exclusive access to all the devices assigned to the
> domain BARs array for modify_bars().

Aiui in the present model modify_bars() has to use the vpci lock for
protection. Therefore imo in any of the init functions the assertions
should either express the real requirements of those functions, or be
omitted on the basis that they're all called out of add-handlers
anyway.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 06:14:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 06:14:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567348.886266 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMjPF-00080O-Lo; Fri, 21 Jul 2023 06:14:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567348.886266; Fri, 21 Jul 2023 06:14:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMjPF-00080H-IX; Fri, 21 Jul 2023 06:14:25 +0000
Received: by outflank-mailman (input) for mailman id 567348;
 Fri, 21 Jul 2023 06:14:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=FBlW=DH=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMjPE-00080B-A2
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 06:14:24 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on060f.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::60f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d6053cc9-278d-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 08:14:23 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM0PR04MB7041.eurprd04.prod.outlook.com (2603:10a6:208:19a::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.28; Fri, 21 Jul
 2023 06:14:21 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 06:14:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d6053cc9-278d-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Azq1mvIe9Abbo9U2TjUacnmC7FCBb3wC7XeY/s1HJ4MUEqxKMvvAc63tAYWUVaHPHO2uv90IIzhVFpg+LxKgA3NXcjXWexUeg0PDctWUCHw5ynndAZr/PbcWGtklrzrY9YVIM5mwkB1WVsUjZ9gisVPLrC9x5hia3Ro5jmxYNn8UZNrggQ4PNjpIvBMkluHqiFOljaSTlv6tx3Eqz9Qwf6e4UtkMkVRv/XPiWngbSKLOqhUYN39DAb9JCvwSwWh6i7mBJ34iaM+YfKNJfztxHnc7e2ANqTNl/aIdcvstfntRA+gtI2sdobSqU7bb5V+b+NyRfRiRi4Yg36KspLkY0A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ngtzY7KzRhC6pMMna28295OZkJY4Gh8I+QpnU6bveBE=;
 b=g14cCGqYx5IBPuei5sj5anM9c9c6BCoFD1DOkfiJrW5ct49S2oiBTSDW/ecW5wWnltZiS/LSZAj7RaC8mkl3H/QaKGJ//2x55Vd1kMvjgnFcKqdNhiQPrGUfMFSZMlMfreuriN4vvBPB/5HzBNVXC/8Tfg7U76G6Vbp7W5iaaNtn/pLohudrfbIpdAFDzFf4mKp2TkteXio/SrAZ0DiR7wQOYztPcoZfODV5oYX1evclGsEWjTPZ5JWsZ/IBfCrzyMdo+gnsYnsPvcWaI1SdUBj3Ktl5DfmOAzs75wQDLuTsa3bEPq1cpcYMq9OYdjvMOq3DycX/v5Bwwc+u0VUxlg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ngtzY7KzRhC6pMMna28295OZkJY4Gh8I+QpnU6bveBE=;
 b=fYFirGmMzSEZEhBkFvGhhkbPMpFMWCbVUY7goDo/87Ysq10tRsJeZDs6+sfpypOwISHbSsHTuSkj1ryznf6WI0DCuz4LlaAhYAGdf0D98/SsurHT56YPx20cgDgzPO2XbEF0l3lpuLsiJAycrZfD2kk+3/uj7y7GVJV2/JVwyMa5ktZ2wTX6mZO4Ev94FHBksFSekqzjL3yVrdrwN7iZVURNqP/LIZWo8io2UO+CYsXfDXPKWVS1YxKu6mR5/pXm7ozAvA/2Kgog0FDhtM3G7cwC4k9+s24/cyGjs4aUpyvnWJi9rIF6Y2MWWXQCNg6CdnGCIp981o4BgEb0mYS+Zg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <4e0a0fc9-0c1b-4725-5692-de67ee68a980@suse.com>
Date: Fri, 21 Jul 2023 08:14:18 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 03/10] x86 setup: change bootstrap map to accept new boot
 module structures
Content-Language: en-US
To: Christopher Clark <christopher.w.clark@gmail.com>
Cc: xen-devel@lists.xenproject.org,
 Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Luca Fancellu <luca.fancellu@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Rich Persaud <persaur@gmail.com>, Stefano Stabellini <sstabellini@kernel.org>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
 <20230701071835.41599-4-christopher.w.clark@gmail.com>
 <alpine.DEB.2.22.394.2307081144340.761183@ubuntu-linux-20-04-desktop>
 <CACMJ4GYE6PW1SY35dhs4XkXd9ru25igrvMCrh4pJMWEBNNz0YQ@mail.gmail.com>
 <CACMJ4Gb_ZwKSjP7qzfQj98YQjSpBdFuWzeGQJUNNqst0GdXCOw@mail.gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <CACMJ4Gb_ZwKSjP7qzfQj98YQjSpBdFuWzeGQJUNNqst0GdXCOw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0150.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:95::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM0PR04MB7041:EE_
X-MS-Office365-Filtering-Correlation-Id: c181bb68-c6db-4b76-76a1-08db89b1b902
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	XYsf9yNlfZSjJN+RHJzoOzcYfy+y8IqMhEQDpRwIxboFs8VAGdxoKh0Aj3hgqLZNWWjd449Ow+z5B9r6O+iKP7Wz/E/sMvqwNeMl2u4Lx7JtWV5rbY/Jzv4ob+iP9nii/9aNCRVmRId1idii0eYHdM7ILXqpS2oB7+QE+sCGtdRFBGeUhqNK5zT7HlneR5Xw6oYYnVaRJR3s1cRYJV5cIrno18A0DWlt3zL0RnhlFunVu2ODcFNFw4jcatfYBUFycx34v3mq09dw/SEDNNLDMbqI8XnZq3AAhZrdRTYMqdmEyiqHw/ly4l3g34/v0dZ43h3OJ7F3WxFx0DYcj+2OB0Gu6yzPG2k0D3xHc9mpZxOnhT7HjyN+hjorFAUQpLBTHWZCoMZitGUSoOIK5kN0V8UkwXJE2f6gYQHm5FIOK/0f6YYI05dqfZ6AMAZ4FG2UiV2i0Wit73cYXUue10WS0AWHEPrZzFPl4n8V/+zEum61zghlXdVhPu8GHv2H4JSQf5GNtZR9zEnWbNRJZrDbqfalTIrhofO+PrCrAoUoBgV74cPVMwWCSWBD1K26G2DfLiNqZSgyPhG2ewrLJ9gBOPkwsnDuupeRqO6FqTfneeg6RxgjlNq1uChKndk7E+Iz2+nmBeQBW3OA2awKcPy2CA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(136003)(396003)(366004)(39860400002)(346002)(451199021)(41300700001)(8676002)(316002)(7416002)(8936002)(86362001)(2906002)(36756003)(31696002)(5660300002)(6512007)(26005)(6506007)(53546011)(478600001)(2616005)(6666004)(6486002)(83380400001)(186003)(31686004)(38100700002)(4326008)(6916009)(66946007)(54906003)(66476007)(66556008)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?REl3c29yZEM4bDAvbHRRL2UwbnVycEpCb3lnT1FPUEMyN29PVkw5NGd2dDN5?=
 =?utf-8?B?QUlwZE5qMzhZTkdab2N1R2paeEVpMWJmY3IwRTdPbTdiZE5jWDlQRDhjVmZ4?=
 =?utf-8?B?SHV0T2pyai9ROUxBSUlPNmNvZCtBRkxHeTQ4OS9LZlRxa2tpSzFBNzdkNW9j?=
 =?utf-8?B?OG9UdURaQ0MwOFNJUUp0dVlTNENRTCtXRUlEMWdpd0hjL3kwNjRSc3dINWlL?=
 =?utf-8?B?a3ErYnQyV0FsQjIwSlNFSngxRnIyeFk2WHo5T3hsa25WUzUrY2EwSWZTUzZa?=
 =?utf-8?B?Y1V3UFlRNjR1OGo3ZXUxR2k2aUVJekJZWDJjUWFIMG9RVVVFcENUQWNZVHBa?=
 =?utf-8?B?Um4rbnlnK3lTSDcvMVNhaUFxNzBtY2V6VjIyMW5qQzFvTXdJZHdIZ2R4aE9R?=
 =?utf-8?B?eloyR0V1Yy9yUmduN0diNDhMYzZIYXRjcVpNM1d6UWNvYXZobS9QTFZWU1Rh?=
 =?utf-8?B?SmFodUM2cWxxNWhhVDhWSVpTTkdVUUorVEhVa0xabkMyVVpLZ3BEN1JGWHZP?=
 =?utf-8?B?S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yWkFjS211N1VjeTFMRzZk?=
 =?utf-8?B?WUNXYXlVSUZYbkJBSTAyN2svSUw1Nm9WYWhpbXp3VHRXRlBqNjdqaXVkSHc4?=
 =?utf-8?B?Y3JSTGxwbCs0Wjg2Z0tNM09XaWtFd2RSeE9vRlZ2ZWtWNUJSUUhNT3p5RWpV?=
 =?utf-8?B?SXhUQ0RPaWwxaVFmK1JIdGxRNERDK3YzSDBMVDhlMWxPcDhJMnF4RExxZmx6?=
 =?utf-8?B?dXlUd280WWtPT29VdjVMMEhFTnNpR3lMb3V5T2pCd0RRSnJ2T3lYdEhuSGkw?=
 =?utf-8?B?c0hmZ1BPQXVVODdvOFFJTWxGODNqQlE4bm5aZXlIQmd5WE9UaGJkRUtiNVcw?=
 =?utf-8?B?VTF2eVpmUVNscU5DMW8vQWM3eVFUcloyZGg3dzlUVENHVWs5czU1REt6QWdR?=
 =?utf-8?B?Y1ZDalNRRXREVGZzbUZPSGhCZWUxbG9FOTV5VHZrajNMSXJRYURnL1U2c2dT?=
 =?utf-8?B?RUUvVHdQMVVsVmxwMnJOWjFFaC9iZEhjMXBiN1FzcVFxd1YvaXVqT2lWZHR0?=
 =?utf-8?B?QU42dlRUb3d2WWRnN0s3cEdQTmRaZ2t6VlNxN1I0SVFzNXhEMkZyQ0lGQi9V?=
 =?utf-8?B?UGNOT25OTUc2QmdXUktML0NQejQ3M0lRb0VzcytLeGtmdm9ZUUsxYzVuWStN?=
 =?utf-8?B?NExvazA2aG1ncjRjL295aXkxSjJZZlBtTW1TUmptcTQ5MHQ4ZzhSUCszTlJX?=
 =?utf-8?Q?0KxozHAgD/gLu45lVbaWv5zss?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c181bb68-c6db-4b76-76a1-08db89b1b902
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 06:14:21.0182
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Q5JuSqiEBrNzFtfF2WWt3M8y913GwpMLTDHsUF6ejF22E7ZruK0P5aK+VkntVUt+t3j5JD/ppiWGYU2jwY+OWg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7041

On 21.07.2023 00:12, Christopher Clark wrote:
> On Thu, Jul 13, 2023 at 11:51â€¯PM Christopher Clark <
> christopher.w.clark@gmail.com> wrote:
> 
>>
>>
>> On Sat, Jul 8, 2023 at 11:47â€¯AM Stefano Stabellini <sstabellini@kernel.org>
>> wrote:
>>
>>> On Sat, 1 Jul 2023, Christopher Clark wrote:
>>>> To convert the x86 boot logic from multiboot to boot module structures,
>>>> change the bootstrap map function to accept a boot module parameter.
>>>>
>>>> To allow incremental change from multiboot to boot modules across all
>>>> x86 setup logic, provide a temporary inline wrapper that still accepts a
>>>> multiboot module parameter and use it where necessary. The wrapper is
>>>> placed in a new arch/x86 header <asm/boot.h> to avoid putting a static
>>>> inline function into an existing header that has no such functions
>>>> already. This new header will be expanded with additional functions in
>>>> subsequent patches in this series.
>>>>
>>>> No functional change intended.
>>>>
>>>> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
>>>> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
>>>>
>>>
>>> [...]
>>>
>>>> diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
>>>> index b72ae31a66..eb93cc3439 100644
>>>> --- a/xen/include/xen/bootinfo.h
>>>> +++ b/xen/include/xen/bootinfo.h
>>>> @@ -10,6 +10,9 @@
>>>>  #endif
>>>>
>>>>  struct boot_module {
>>>> +    paddr_t start;
>>>> +    size_t size;
>>>
>>> I think size should be paddr_t (instead of size_t) to make sure it is
>>> the right size on both 64-bit and 32-bit architectures that support
>>> 64-bit addresses.
>>>
>>
>> Thanks, that explanation does make sense - ack.
>>
> 
> I've come back to reconsider this as it doesn't seem right to me to store a
> non-address value (which this will always be) in a type explicitly defined
> to hold an address: addresses may have architectural alignment requirements
> whereas a size value is just a number of bytes so will not. The point of a
> size_t value is that size_t is defined to be large enough to hold the size
> of any valid object in memory, so I think this was right as-is.

"Any object in memory" implies virtual addresses (or more generally addresses
which can be used for accessing objects). This isn't the case when considering
physical addresses - there may be far more memory in a system than can be made
accessible all in one go.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 06:24:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 06:24:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567351.886276 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMjYf-00015n-JU; Fri, 21 Jul 2023 06:24:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567351.886276; Fri, 21 Jul 2023 06:24:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMjYf-00015g-Fv; Fri, 21 Jul 2023 06:24:09 +0000
Received: by outflank-mailman (input) for mailman id 567351;
 Fri, 21 Jul 2023 06:24:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=2N6Z=DH=linaro.org=viresh.kumar@srs-se1.protection.inumbo.net>)
 id 1qMjYe-00015X-C7
 for xen-devel@lists.xen.org; Fri, 21 Jul 2023 06:24:08 +0000
Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com
 [2607:f8b0:4864:20::1031])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 318757f1-278f-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 08:24:07 +0200 (CEST)
Received: by mail-pj1-x1031.google.com with SMTP id
 98e67ed59e1d1-263374f2f17so754919a91.0
 for <xen-devel@lists.xen.org>; Thu, 20 Jul 2023 23:24:06 -0700 (PDT)
Received: from localhost ([122.172.87.195]) by smtp.gmail.com with ESMTPSA id
 gw15-20020a17090b0a4f00b00267bb769652sm1864958pjb.6.2023.07.20.23.24.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 20 Jul 2023 23:24:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 318757f1-278f-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689920645; x=1690525445;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=1Az5kk1wz6TEQ8ZYux94QCIBg5jaoSQ3XyOK3pt/uVU=;
        b=ErfbSFGxBRdKfJZZB0PxrB9pJNGQ1ZOQoUV1ThNTT8E03dbZIMlGEbWw1+f9HOLniz
         T0wkAD09y3Et76iMldpGq4YuwAds4R4ZnLHjFidjAnVHHnCykJ0dDvo0hApKCyLNjfnb
         LSCiXEN1fCbsJsnDJ932XVj8kii0QqV7lxIWevsAtpkTO+8uKxCwd5Q/uJcVP7z8kxLQ
         gVCV/69ieJON4pGAiZCLWbkIhvAZRZcmcvCGRcpVtBr7Brp/C9FUWIUmZNmlyOT0avZM
         sQ4JLA6Pck2H8hUpwD7RbR9rEz2hXdUhNkvzQnQ/H4k9YdX2Tlfup5MSFC0hKmo4WLqp
         N6Ew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689920645; x=1690525445;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=1Az5kk1wz6TEQ8ZYux94QCIBg5jaoSQ3XyOK3pt/uVU=;
        b=Vj0MeqkVyZAwhM8DZE9gX1TJRM71HZeWO3qMHG65hA/RSh1gp74u8+eQHAppISOAhG
         bcHjm9twQpQsOCUA384dLESgnhkVUy1tNtmZnYLVUvp4tSj4gdbvkZ8R8vGUnEpYtOIk
         C3FbTqY6qYMA5/NseYzebv09JP1uPNMuXxPFRYX9+u8rXprn3iK7X9/tJ5zFJJ7alOPK
         9+LsaU9JWLmI0YnotMiBDSWbW+FqeMPUS7GQWAECu+a97Q9tAp/E2dbGOjM8XY2byKps
         APtWIXOnjcrac2qJiN6MBrpKtEVpMicckaF7MG7vuyz5+0Pa6el9wLIbbJcfUNdN9Onx
         tFSA==
X-Gm-Message-State: ABy/qLb8H8WaYFsgBBDNB7xwK53spTPvVmIlm1ycA9zPtvhIFcgQQeV6
	NZJuVR3pCHn2JZDoNk2VnAbcBtq1sS8R1CH9tu4=
X-Google-Smtp-Source: APBJJlHvhwk8tK0AJfNOv37UPaKnGAsHdDsahuxcbUWOxbHjeFEO3/f/69W9xZNLuNfkFFfYQp1imQ==
X-Received: by 2002:a17:90a:474e:b0:262:fc42:c7bc with SMTP id y14-20020a17090a474e00b00262fc42c7bcmr617434pjg.32.1689920645384;
        Thu, 20 Jul 2023 23:24:05 -0700 (PDT)
Date: Fri, 21 Jul 2023 11:54:02 +0530
From: Viresh Kumar <viresh.kumar@linaro.org>
To: xen-devel@lists.xen.org, Juergen Gross <jgross@suse.com>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Nick Rosbrook <rosbrookn@gmail.com>, Wei Liu <wl@xen.org>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
	stratos-dev@op-lists.linaro.org,
	Alex =?utf-8?Q?Benn=C3=A9e?= <alex.bennee@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.com>,
	Oleksandr Tyshchenko <olekstysh@gmail.com>,
	Erik Schilling <erik.schilling@linaro.org>
Subject: Re: [PATCH V4] libxl: arm: Add grant_usage parameter for virtio
 devices
Message-ID: <20230721062402.bgu3hzcd33yrlfdg@vireshk-i7>
References: <144a57807d6f3e6c1e9b45215cb4fa5fa4535f10.1688628006.git.viresh.kumar@linaro.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <144a57807d6f3e6c1e9b45215cb4fa5fa4535f10.1688628006.git.viresh.kumar@linaro.org>

On 06-07-23, 12:59, Viresh Kumar wrote:
> Currently, the grant mapping related device tree properties are added if
> the backend domain is not Dom0. While Dom0 is privileged and can do
> foreign mapping for the entire guest memory, it is still desired for
> Dom0 to access guest's memory via grant mappings and hence map only what
> is required.
> 
> This commit adds the "grant_usage" parameter for virtio devices, which
> provides better control over the functionality.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
> V3.1->V4:
> - Added Reviewed-by tags.
> - Other patches from the series are already applied.
> - No code changes.

Hi George / Nick,

Can you guys please review / ack this patch ?

-- 
viresh


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 06:39:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 06:39:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567354.886285 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMjnP-0002g9-Qp; Fri, 21 Jul 2023 06:39:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567354.886285; Fri, 21 Jul 2023 06:39:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMjnP-0002g2-OG; Fri, 21 Jul 2023 06:39:23 +0000
Received: by outflank-mailman (input) for mailman id 567354;
 Fri, 21 Jul 2023 06:39:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=2N6Z=DH=linaro.org=viresh.kumar@srs-se1.protection.inumbo.net>)
 id 1qMjnO-0002fw-D6
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 06:39:22 +0000
Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com
 [2607:f8b0:4864:20::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 523ce1a2-2791-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 08:39:20 +0200 (CEST)
Received: by mail-pl1-x62b.google.com with SMTP id
 d9443c01a7336-1b8b318c5cfso11914315ad.1
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 23:39:20 -0700 (PDT)
Received: from localhost ([122.172.87.195]) by smtp.gmail.com with ESMTPSA id
 13-20020a170902c20d00b001b7ebb6a2d4sm2573471pll.163.2023.07.20.23.39.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 20 Jul 2023 23:39:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 523ce1a2-2791-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689921559; x=1690526359;
        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=aWHdr1UYRJW9VJcQhEmLRZZfGjs4LZPTuEuEN5VniGg=;
        b=HoKbJJZVoe8s84WHtBeOcgYw4WZFlrwiNjuyu0pQIdWVe6mC2MvJBWaW5O7xtyMzOz
         hqfGDomdoMd6icWK/EzF6OQIXJeqF41BFiX3H6w0UkFLowGWUk2oexd0gEYauBySsT5A
         Y8tb7AzGqC89XXPVwdl3scpYfoQFlXhUQpRapww8Q4Yr6VyeMWlvri+k6o2vmef1O/gY
         hSgi6ip6hfofsZhqmxcG3LaerO6wmx8SJYbxfoOXipr9E6TvEU3sA67ybeq4oKSFNTNZ
         nxD687W+/XNWrMD6KT+H1HFnH+id68A5+3/vkyeKtQL+770XKGkPOia0+vipWTB0FDNE
         lulg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689921559; x=1690526359;
        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=aWHdr1UYRJW9VJcQhEmLRZZfGjs4LZPTuEuEN5VniGg=;
        b=G/3r4/yJPRc6/pUuVVsHVRjVDgoOuL5uocReA5XoIr89zvkv3raXL56Yebhw9SMChd
         3c3tSZs6sS2vdD/JzFKdwlkQOOkzl1bNeNUBRgHkUSDOTFus/UmPp89F+qcFhwmcaCx4
         tg2Au3RZ5dVS4AVQPxnLQuxqlzmjU+kybRHM0U44fCBTgKRRh/2crDlP1dKYOSixABbj
         BLMTbIIqrbMvBGk7FScyFiDyDSUda4o5ri12sTJJoNxizkYD4XEmiqZdzkTR9HlprQDi
         5WOM5NCRaBi3jkW3D8BgsLhiKUAN8lHPwqRR7OLU8YoEF4ToZdreaVV5wvEcMpCsPKH1
         iIbg==
X-Gm-Message-State: ABy/qLaTXbK2NXItj8f3hUDk0N+CVV6NIj49po8YzsaA9Hptia8mqgwI
	/N0KqWM0shiK3g8c3Vf+w2Eexw==
X-Google-Smtp-Source: APBJJlFENksIN70Ox7KO10Fsypcj1FJKNqqLpSbBDBOXtyS7l3me2e/S1YHUubPyvwvdVs1ClfxDJQ==
X-Received: by 2002:a17:902:cec6:b0:1b8:53b5:8518 with SMTP id d6-20020a170902cec600b001b853b58518mr1647637plg.63.1689921559181;
        Thu, 20 Jul 2023 23:39:19 -0700 (PDT)
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	=?UTF-8?q?Alex=20Benn=C3=A9e?= <alex.bennee@linaro.org>,
	stratos-dev@op-lists.linaro.org,
	Erik Schilling <erik.schilling@linaro.org>,
	Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	xen-devel@lists.xenproject.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH V2.1 2/2] xen: privcmd: Add support for irqfd
Date: Fri, 21 Jul 2023 12:09:06 +0530
Message-Id: <24293535aaac8a84f836c8fc75c6ce4a2c343f16.1689921432.git.viresh.kumar@linaro.org>
X-Mailer: git-send-email 2.31.1.272.g89b43f80a514
In-Reply-To: <c923befe0a016891e7dee3e1ccb3c00d676f2b3d.1689845210.git.viresh.kumar@linaro.org>
References: <c923befe0a016891e7dee3e1ccb3c00d676f2b3d.1689845210.git.viresh.kumar@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Xen provides support for injecting interrupts to the guests via the
HYPERVISOR_dm_op() hypercall. The same is used by the Virtio based
device backend implementations, in an inefficient manner currently.

Generally, the Virtio backends are implemented to work with the Eventfd
based mechanism. In order to make such backends work with Xen, another
software layer needs to poll the Eventfds and raise an interrupt to the
guest using the Xen based mechanism. This results in an extra context
switch.

This is not a new problem in Linux though. It is present with other
hypervisors like KVM, etc. as well. The generic solution implemented in
the kernel for them is to provide an IOCTL call to pass the interrupt
details and eventfd, which lets the kernel take care of polling the
eventfd and raising of the interrupt, instead of handling this in user
space (which involves an extra context switch).

This patch adds support to inject a specific interrupt to guest using
the eventfd mechanism, by preventing the extra context switch.

Inspired by existing implementations for KVM, etc..

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
V2->V2.1
- Select EVENTFD from Kconfig

V1->V2:
- Improve error handling.
- Remove the unnecessary usage of list_for_each_entry_safe().
- Restrict the use of XEN_DMOP_set_irq_level to only ARM64.

 drivers/xen/Kconfig        |   1 +
 drivers/xen/privcmd.c      | 276 ++++++++++++++++++++++++++++++++++++-
 include/uapi/xen/privcmd.h |  14 ++
 3 files changed, 289 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
index d5d7c402b651..7967393c55a4 100644
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
@@ -261,6 +261,7 @@ config XEN_SCSI_BACKEND
 config XEN_PRIVCMD
 	tristate "Xen hypercall passthrough driver"
 	depends on XEN
+	select EVENTFD
 	default m
 	help
 	  The hypercall passthrough driver allows privileged user programs to
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index e2f580e30a86..0debc5482253 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -9,11 +9,16 @@
 
 #define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt
 
+#include <linux/eventfd.h>
+#include <linux/file.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/poll.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/string.h>
+#include <linux/workqueue.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
@@ -833,6 +838,257 @@ static long privcmd_ioctl_mmap_resource(struct file *file,
 	return rc;
 }
 
+/* Irqfd support */
+static struct workqueue_struct *irqfd_cleanup_wq;
+static DEFINE_MUTEX(irqfds_lock);
+static LIST_HEAD(irqfds_list);
+
+struct privcmd_kernel_irqfd {
+	domid_t dom;
+	u8 level;
+	bool error;
+	u32 irq;
+	struct eventfd_ctx *eventfd;
+	struct work_struct shutdown;
+	wait_queue_entry_t wait;
+	struct list_head list;
+	poll_table pt;
+};
+
+static void irqfd_deactivate(struct privcmd_kernel_irqfd *kirqfd)
+{
+	lockdep_assert_held(&irqfds_lock);
+
+	list_del_init(&kirqfd->list);
+	queue_work(irqfd_cleanup_wq, &kirqfd->shutdown);
+}
+
+static void irqfd_shutdown(struct work_struct *work)
+{
+	struct privcmd_kernel_irqfd *kirqfd =
+		container_of(work, struct privcmd_kernel_irqfd, shutdown);
+	u64 cnt;
+
+	eventfd_ctx_remove_wait_queue(kirqfd->eventfd, &kirqfd->wait, &cnt);
+	eventfd_ctx_put(kirqfd->eventfd);
+	kfree(kirqfd);
+}
+
+static void irqfd_inject(struct privcmd_kernel_irqfd *kirqfd)
+{
+	/* Different architectures support this differently */
+	struct xen_dm_op dm_op = {
+#ifdef CONFIG_ARM64
+		.op = XEN_DMOP_set_irq_level,
+		.u.set_irq_level.irq = kirqfd->irq,
+		.u.set_irq_level.level = kirqfd->level,
+#endif
+	};
+	struct xen_dm_op_buf xbufs = {
+		.size = sizeof(dm_op),
+	};
+	u64 cnt;
+	long rc;
+
+	eventfd_ctx_do_read(kirqfd->eventfd, &cnt);
+	set_xen_guest_handle(xbufs.h, &dm_op);
+
+	xen_preemptible_hcall_begin();
+	rc = HYPERVISOR_dm_op(kirqfd->dom, 1, &xbufs);
+	xen_preemptible_hcall_end();
+
+	/* Don't repeat the error message for consecutive failures */
+	if (rc && !kirqfd->error) {
+		pr_err("Failed to configure irq: %d to level: %d for guest domain: %d\n",
+		       kirqfd->irq, kirqfd->level, kirqfd->dom);
+	}
+
+	kirqfd->error = !!rc;
+}
+
+static int
+irqfd_wakeup(wait_queue_entry_t *wait, unsigned int mode, int sync, void *key)
+{
+	struct privcmd_kernel_irqfd *kirqfd =
+		container_of(wait, struct privcmd_kernel_irqfd, wait);
+	__poll_t flags = key_to_poll(key);
+
+	if (flags & EPOLLIN)
+		irqfd_inject(kirqfd);
+
+	if (flags & EPOLLHUP) {
+		mutex_lock(&irqfds_lock);
+		irqfd_deactivate(kirqfd);
+		mutex_unlock(&irqfds_lock);
+	}
+
+	return 0;
+}
+
+static void
+irqfd_poll_func(struct file *file, wait_queue_head_t *wqh, poll_table *pt)
+{
+	struct privcmd_kernel_irqfd *kirqfd =
+		container_of(pt, struct privcmd_kernel_irqfd, pt);
+
+	add_wait_queue_priority(wqh, &kirqfd->wait);
+}
+
+static int privcmd_irqfd_assign(struct privcmd_irqfd *irqfd)
+{
+	struct privcmd_kernel_irqfd *kirqfd, *tmp;
+	struct eventfd_ctx *eventfd;
+	__poll_t events;
+	struct fd f;
+	int ret;
+
+	kirqfd = kzalloc(sizeof(*kirqfd), GFP_KERNEL);
+	if (!kirqfd)
+		return -ENOMEM;
+
+	kirqfd->irq = irqfd->irq;
+	kirqfd->dom = irqfd->dom;
+	kirqfd->level = irqfd->level;
+	INIT_LIST_HEAD(&kirqfd->list);
+	INIT_WORK(&kirqfd->shutdown, irqfd_shutdown);
+
+	f = fdget(irqfd->fd);
+	if (!f.file) {
+		ret = -EBADF;
+		goto error_kfree;
+	}
+
+	eventfd = eventfd_ctx_fileget(f.file);
+	if (IS_ERR(eventfd)) {
+		ret = PTR_ERR(eventfd);
+		goto error_fd_put;
+	}
+
+	kirqfd->eventfd = eventfd;
+
+	/*
+	 * Install our own custom wake-up handling so we are notified via a
+	 * callback whenever someone signals the underlying eventfd.
+	 */
+	init_waitqueue_func_entry(&kirqfd->wait, irqfd_wakeup);
+	init_poll_funcptr(&kirqfd->pt, irqfd_poll_func);
+
+	mutex_lock(&irqfds_lock);
+
+	list_for_each_entry(tmp, &irqfds_list, list) {
+		if (kirqfd->eventfd == tmp->eventfd) {
+			ret = -EBUSY;
+			mutex_unlock(&irqfds_lock);
+			goto error_eventfd;
+		}
+	}
+
+	list_add_tail(&kirqfd->list, &irqfds_list);
+	mutex_unlock(&irqfds_lock);
+
+	/*
+	 * Check if there was an event already pending on the eventfd before we
+	 * registered, and trigger it as if we didn't miss it.
+	 */
+	events = vfs_poll(f.file, &kirqfd->pt);
+	if (events & EPOLLIN)
+		irqfd_inject(kirqfd);
+
+	/*
+	 * Do not drop the file until the kirqfd is fully initialized, otherwise
+	 * we might race against the EPOLLHUP.
+	 */
+	fdput(f);
+	return 0;
+
+error_eventfd:
+	eventfd_ctx_put(eventfd);
+
+error_fd_put:
+	fdput(f);
+
+error_kfree:
+	kfree(kirqfd);
+	return ret;
+}
+
+static int privcmd_irqfd_deassign(struct privcmd_irqfd *irqfd)
+{
+	struct privcmd_kernel_irqfd *kirqfd;
+	struct eventfd_ctx *eventfd;
+
+	eventfd = eventfd_ctx_fdget(irqfd->fd);
+	if (IS_ERR(eventfd))
+		return PTR_ERR(eventfd);
+
+	mutex_lock(&irqfds_lock);
+
+	list_for_each_entry(kirqfd, &irqfds_list, list) {
+		if (kirqfd->eventfd == eventfd) {
+			irqfd_deactivate(kirqfd);
+			break;
+		}
+	}
+
+	mutex_unlock(&irqfds_lock);
+
+	eventfd_ctx_put(eventfd);
+
+	/*
+	 * Block until we know all outstanding shutdown jobs have completed so
+	 * that we guarantee there will not be any more interrupts once this
+	 * deassign function returns.
+	 */
+	flush_workqueue(irqfd_cleanup_wq);
+
+	return 0;
+}
+
+static long privcmd_ioctl_irqfd(struct file *file, void __user *udata)
+{
+	struct privcmd_data *data = file->private_data;
+	struct privcmd_irqfd irqfd;
+
+	if (copy_from_user(&irqfd, udata, sizeof(irqfd)))
+		return -EFAULT;
+
+	/* No other flags should be set */
+	if (irqfd.flags & ~PRIVCMD_IRQFD_FLAG_DEASSIGN)
+		return -EINVAL;
+
+	/* If restriction is in place, check the domid matches */
+	if (data->domid != DOMID_INVALID && data->domid != irqfd.dom)
+		return -EPERM;
+
+	if (irqfd.flags & PRIVCMD_IRQFD_FLAG_DEASSIGN)
+		return privcmd_irqfd_deassign(&irqfd);
+
+	return privcmd_irqfd_assign(&irqfd);
+}
+
+static int privcmd_irqfd_init(void)
+{
+	irqfd_cleanup_wq = alloc_workqueue("privcmd-irqfd-cleanup", 0, 0);
+	if (!irqfd_cleanup_wq)
+		return -ENOMEM;
+
+	return 0;
+}
+
+static void privcmd_irqfd_exit(void)
+{
+	struct privcmd_kernel_irqfd *kirqfd, *tmp;
+
+	mutex_lock(&irqfds_lock);
+
+	list_for_each_entry_safe(kirqfd, tmp, &irqfds_list, list)
+		irqfd_deactivate(kirqfd);
+
+	mutex_unlock(&irqfds_lock);
+
+	destroy_workqueue(irqfd_cleanup_wq);
+}
+
 static long privcmd_ioctl(struct file *file,
 			  unsigned int cmd, unsigned long data)
 {
@@ -868,6 +1124,10 @@ static long privcmd_ioctl(struct file *file,
 		ret = privcmd_ioctl_mmap_resource(file, udata);
 		break;
 
+	case IOCTL_PRIVCMD_IRQFD:
+		ret = privcmd_ioctl_irqfd(file, udata);
+		break;
+
 	default:
 		break;
 	}
@@ -992,15 +1252,27 @@ static int __init privcmd_init(void)
 	err = misc_register(&xen_privcmdbuf_dev);
 	if (err != 0) {
 		pr_err("Could not register Xen hypercall-buf device\n");
-		misc_deregister(&privcmd_dev);
-		return err;
+		goto err_privcmdbuf;
+	}
+
+	err = privcmd_irqfd_init();
+	if (err != 0) {
+		pr_err("irqfd init failed\n");
+		goto err_irqfd;
 	}
 
 	return 0;
+
+err_irqfd:
+	misc_deregister(&xen_privcmdbuf_dev);
+err_privcmdbuf:
+	misc_deregister(&privcmd_dev);
+	return err;
 }
 
 static void __exit privcmd_exit(void)
 {
+	privcmd_irqfd_exit();
 	misc_deregister(&privcmd_dev);
 	misc_deregister(&xen_privcmdbuf_dev);
 }
diff --git a/include/uapi/xen/privcmd.h b/include/uapi/xen/privcmd.h
index d2029556083e..47334bb91a09 100644
--- a/include/uapi/xen/privcmd.h
+++ b/include/uapi/xen/privcmd.h
@@ -98,6 +98,18 @@ struct privcmd_mmap_resource {
 	__u64 addr;
 };
 
+/* For privcmd_irqfd::flags */
+#define PRIVCMD_IRQFD_FLAG_DEASSIGN (1 << 0)
+
+struct privcmd_irqfd {
+	__u32 fd;
+	__u32 flags;
+	__u32 irq;
+	domid_t dom;
+	__u8 level;
+	__u8 pad;
+};
+
 /*
  * @cmd: IOCTL_PRIVCMD_HYPERCALL
  * @arg: &privcmd_hypercall_t
@@ -125,5 +137,7 @@ struct privcmd_mmap_resource {
 	_IOC(_IOC_NONE, 'P', 6, sizeof(domid_t))
 #define IOCTL_PRIVCMD_MMAP_RESOURCE				\
 	_IOC(_IOC_NONE, 'P', 7, sizeof(struct privcmd_mmap_resource))
+#define IOCTL_PRIVCMD_IRQFD					\
+	_IOC(_IOC_NONE, 'P', 8, sizeof(struct privcmd_irqfd))
 
 #endif /* __LINUX_PUBLIC_PRIVCMD_H__ */
-- 
2.31.1.272.g89b43f80a514



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 06:39:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 06:39:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567355.886296 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMjnj-00031u-7x; Fri, 21 Jul 2023 06:39:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567355.886296; Fri, 21 Jul 2023 06:39:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMjnj-00031n-5H; Fri, 21 Jul 2023 06:39:43 +0000
Received: by outflank-mailman (input) for mailman id 567355;
 Fri, 21 Jul 2023 06:39:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=FBlW=DH=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMjni-0002fw-09
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 06:39:42 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on20630.outbound.protection.outlook.com
 [2a01:111:f400:fe13::630])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5e8a37e9-2791-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 08:39:41 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8733.eurprd04.prod.outlook.com (2603:10a6:102:21d::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul
 2023 06:39:38 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 06:39:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5e8a37e9-2791-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ec3ay5viu9UwOGDrRfS/uzHLbYA4BNzhzwp/VBv825IFHFWw7ywxPeClw9bVNSD+RAuJTG/NJyjk5fpfSN4r62edRRqn6rb6TggFKZwAn8rPHE8rYCcXffvckwE2C2IPIqDMIace9fvXE9chPCAKz9uXvHU20kjBzU2Ony3f4SKGsY6iQGIHq2lQai5+GX2gv6fMja0ymhzoUGqYOBpLZC64RpFah0TAj2O0iJl7OnQ3YwBA5e624mMwbhOPjAc0O9Uf1U1vxWt2L/DSzj8wySdvK+BCRJW/0UdQ+ez47dJQCEkVvZya4rse0VXZhmXDHK5E9U7nEWybakAlicRO1g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=o9NCcKMpSbwUgHA9WwKD5asGHZbQNl87/iW64kIUCu4=;
 b=WMsHMlsYM9hm3I+VjyRZfA0mRbi82eFvtrvdSfN9dW0jayHOmDN5sD0owx92st5zuYCqZubiriQVU1Rk7fz6+ayuV8pFZllDbwXGw7jQbRMmbAV9fLZr4NwsT1RmRISy+9q4oyZubIAI3wcm0AI9SnmQGEykv27xYoWu7CRWm/h8Upx9gSortL9VSon8mVfpReb2utpDYBWqtDk5+7WQyXrF4iLrj23qwwbnj4ex1X5N5pANLS4myCJzsgvqgofLPvi69jrnPmp9yHQ0FIkcRI3Nlj/E7dD+6S2MTZplUCDwGoFgI0LljCfaszJqRwk7Jes4M6ZaAqAViMt8hBQ4Dg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=o9NCcKMpSbwUgHA9WwKD5asGHZbQNl87/iW64kIUCu4=;
 b=GkUt/nD2galrhLQkalseRzLc21VMK6nbB64Ry7uB7VlpnBitE5wHD8QvmgEyZPFWPC5KbGEj6vc3h7ihM3qJZpyZn4VMd0g2AnMm2dAlxkb4sT9h7SlWtCJneyc2V9dUZaGnCKj353detU/OP0JqHv+in1nmreY+68c+6QfH0uu167ePPyDn2Nb1CgheFDTFQj4lhPX4w2vKHQhxw/YxqEzampIrml3rzGo99xYprVkUbJmOLFfOHShBGA/r39X0gCWNWS/lcE1MJLFlJbfGFNN3MC4t1pPqy5d7fQCX3JtzJykxNpVCkh0jjcS3z/ndqfmiEhKlH+V3ZzG3aSeCEw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <94ae50bc-d4e5-3700-dd84-a783afb832e7@suse.com>
Date: Fri, 21 Jul 2023 08:39:35 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] tools/xenstore: fix XSA-417 patch
Content-Language: en-US
To: Julien Grall <julien@xen.org>, Juergen Gross <jgross@suse.com>
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20230720150459.31111-1-jgross@suse.com>
 <6e858280-c778-883c-0f8d-2afa737232fd@xen.org>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <6e858280-c778-883c-0f8d-2afa737232fd@xen.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0117.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a8::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8733:EE_
X-MS-Office365-Filtering-Correlation-Id: e69796fb-f0bc-4ba1-1fb2-08db89b54102
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	VGljGv6EEddSYJahZIBDioLtEM4uW8/IqDUOfcpQeo4W1PMHCwKqgRUfGnJ4zjsceaj3fR+OTtQYahvI9He8dxaCkbcIHR8Uyk/odNf4vYwRpOaSH6Zwbd2hLBbCOWpf4H1zxvVg/R8gUCtaIjGh5pKdBv92vk3qYQVDBgmfPDzAowZ8RsudS4UeI9spBsQEDn9xUSOPKcx0bGN1mFOZe9dlPpWYKrJKBqBvCKEQluirvfB7OdEZaxN3wTPnjmwKlOkTMRhkbU6J+lVG1PmTMEntxkkJe/FJG2uZC7ktAWDLTfpWLr+IcNQI7FcWbpAcPPaZHi953tsAG0lFtCBVELnFEJaQxnOebL7UVAONFX3URhfuJJVxCTkYgFFVSrzU91X+g32en0ZIAz3DDM2/b7Co8Vf7yQdA9Lh+bR5SqXuhm4Tzq+VmbfKB0gms39HAezCtCV+xB7cb/r4/1bmkhruiWmYpFfvpiCtp0FxPkk9AHwfBYcA8plNxalmYodH7DKMFZd18ceqiTW5rPXbCuOCpCrNsEXz8oN0M6KBZdhvAEdNUnJNigIrYXpLozbVcXf8FJxIqUbxkkN1Y9PGqQujLiUV1SOoZmav0/Ok9BJxE0/IeFEQYnZluCqnCG9Xz9JUU/joeuTxsQOmdw4XIQQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(136003)(39860400002)(366004)(396003)(376002)(451199021)(31696002)(86362001)(31686004)(36756003)(54906003)(110136005)(6486002)(478600001)(38100700002)(6506007)(53546011)(2616005)(186003)(6512007)(26005)(83380400001)(2906002)(4326008)(8676002)(8936002)(6636002)(5660300002)(66946007)(66556008)(316002)(41300700001)(66476007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MjFJTEl5b2NTV1J1eDM0M2E1alQ0MndxU2g1eUNyODlDd204aVNVZFRLdDJs?=
 =?utf-8?B?cjdpdDAwTnZhVVpFTnkvRTk1S2Jtd0ZEdC9XM2pmM2hET1RvbUtWUTVqUDBH?=
 =?utf-8?B?RDZweWhDQTVXdFAxcm9YRUlDdkhLVC9sazkvUmhscXAweDJRR21JZTVFVXhj?=
 =?utf-8?B?VW5hd1BmOEJPSGRtcWJOOE56T3piTTlaTHdNNGpoUlJoNi93K1g3VDJBT2FY?=
 =?utf-8?B?OE1ISFpRZ0Q2OE1icDgwSXZVZlZL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?utf-8?B?T0tXRzBNb0prYUUxRDd5TnZjUkhpMkR3dVc0L0pUaGpWTzl3LzZ2MkJIMTZT?=
 =?utf-8?B?dUhYT094K2VzQlh0MkpWc2d4WUZCSXp2TUlOKzlPS3pCVktESWJmMEE4K3Fo?=
 =?utf-8?Q?o0cn6s5s0aWrkWsm+Ev6+aICr?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e69796fb-f0bc-4ba1-1fb2-08db89b54102
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 06:39:37.7015
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: /C3+6rP05nayODFraY7mct23B9YCwVUWBVGQt+AJocKSHT14f/apcRfznccmlZ51sGitw4Gd+tEbhW6tizG5Zg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8733

On 21.07.2023 00:34, Julien Grall wrote:
> On 20/07/2023 16:04, Juergen Gross wrote:
>> The fix for XSA-417 had a bug: domain_alloc_permrefs() will not return
>> a negative value in case of an error, but a plain errno value.
>>
>> Note this is not considered to be a security issue, as the only case
>> where domain_alloc_permrefs() will return an error is a failed memory
>> allocation. As a guest should not be able to drive Xenstore out of
>> memory, this is NOT a problem a guest can trigger at will.
>>
>> Fixes: ab128218225d ("tools/xenstore: fix checking node permissions")
>> Signed-off-by: Juergen Gross <jgross@suse.com>
> 
> Acked-by: Julien Grall <jgrall@amazon.com>

In the interest of not missing to add this to my to-be-backported
collection, I've included this in what I've committed just now. It
correcting an earlier XSA fix, I guess we may want to go as far as
backporting this also to the security-only stable trees (i.e.
through to 4.14 rather than just back to 4.16)?

As an aside - note that 4.14 is about to close.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 06:45:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 06:45:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567361.886305 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMjt3-0004kf-Qx; Fri, 21 Jul 2023 06:45:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567361.886305; Fri, 21 Jul 2023 06:45:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMjt3-0004kY-O8; Fri, 21 Jul 2023 06:45:13 +0000
Received: by outflank-mailman (input) for mailman id 567361;
 Fri, 21 Jul 2023 06:45:12 +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
 <SRS0=2N6Z=DH=linaro.org=viresh.kumar@srs-se1.protection.inumbo.net>)
 id 1qMjt2-0004kS-DG
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 06:45:12 +0000
Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com
 [2607:f8b0:4864:20::22e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2193acb6-2792-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 08:45:10 +0200 (CEST)
Received: by mail-oi1-x22e.google.com with SMTP id
 5614622812f47-3a44cccbd96so1104686b6e.3
 for <xen-devel@lists.xenproject.org>; Thu, 20 Jul 2023 23:45:08 -0700 (PDT)
Received: from localhost ([122.172.87.195]) by smtp.gmail.com with ESMTPSA id
 5-20020a17090a190500b0025bfda134ccsm2045164pjg.16.2023.07.20.23.45.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 20 Jul 2023 23:45:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2193acb6-2792-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1689921907; x=1690526707;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=b/LfJYkEQO7iFSjVsuA5HWx8BcMwmvWUSIH/VsiaNhY=;
        b=Ez9E70yO8yp2Nrol+NXT0Mke3M5rvBP+YO/KnKswLCoXkF216zQoIInLe4Ep+5zWy1
         hTAyPRvbqr/hOGVr0MylrLpX1xTr7HUJq6orU6S4DqpzWgtBU+D7NzXQ40ZIAGu3We8t
         g8eDmWFe9+nrdpFap5YazQIkzjm6G31CJQ3mKOJ2/tGQtVNjz34FnU/RzUZxzxQUWZMi
         E5YagrIKHSO8KwecSbHD4Y7sCbG1Vlfn4F57koeq4UHgukO4zhpyK/OJKB8piKjxCUov
         PShptiK5DNxGbdzO28QNbYRhYrqq7bjVvsqRDEOAX1x4pexnLn/Q6LptkyAeGT7c57J1
         NQhQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689921907; x=1690526707;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=b/LfJYkEQO7iFSjVsuA5HWx8BcMwmvWUSIH/VsiaNhY=;
        b=itGPjgERQraYFwZL3w6C1wai2NURe67jMyMae/NUou89NpwPGijUxNF0MX6QoVHPl6
         3txj7tTdTLhhKIuOSbRTXDku3+z0uhVMa37imO7mRSlYjT7s0whHxyzWOqJWaEm013k3
         GLTfHFGKMMLOt/9XCDGzO88LXG+06lCXZFnYVVbme97aXl7b+utm8MkJbpj7U/Dzak1U
         DhVOCKZwsh9VY5DPBWIssW9G3x+70ZTm6O4sfTq9/hK1H2I9BFLPT+mE9BgSfleuATWW
         VkhmXnv34H3F/OFcSuXBfd056GySkNKLT3aXYUQjl9oyYug17/ZGraXBNFjQlxKjdSyJ
         raQA==
X-Gm-Message-State: ABy/qLaTT3+LEFnv9hMkvhb+RlgrkpjkQVGbQh+RvJyiQnzchZSZPvQZ
	1wZssXmNab+IdGIMm8d9IwCsmA==
X-Google-Smtp-Source: APBJJlFhbxVYQ6v5xUEbXBSZ6k1l/lqhkXK9MEJothL00DZqxDDlrRD312jIeqJx3AoL9I0Fasmuqg==
X-Received: by 2002:a05:6808:bc4:b0:3a1:c108:41b1 with SMTP id o4-20020a0568080bc400b003a1c10841b1mr1596997oik.25.1689921907139;
        Thu, 20 Jul 2023 23:45:07 -0700 (PDT)
Date: Fri, 21 Jul 2023 12:15:04 +0530
From: Viresh Kumar <viresh.kumar@linaro.org>
To: kernel test robot <lkp@intel.com>
Cc: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Alex =?utf-8?Q?Benn=C3=A9e?= <alex.bennee@linaro.org>,
	stratos-dev@op-lists.linaro.org,
	Erik Schilling <erik.schilling@linaro.org>,
	Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2 2/2] xen: privcmd: Add support for irqfd
Message-ID: <20230721064504.llvur2gdgy7eka2j@vireshk-i7>
References: <a25d5f01fe9b4624aa12cab77abd001044ea02d5.1689845210.git.viresh.kumar@linaro.org>
 <202307210852.ukq5f98v-lkp@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <202307210852.ukq5f98v-lkp@intel.com>

On 21-07-23, 08:38, kernel test robot wrote:
> Hi Viresh,
> 
> kernel test robot noticed the following build errors:
> 
> [auto build test ERROR on xen-tip/linux-next]
> [also build test ERROR on linus/master v6.5-rc2 next-20230720]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Viresh-Kumar/xen-privcmd-Add-support-for-irqfd/20230720-173905
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git linux-next
> patch link:    https://lore.kernel.org/r/a25d5f01fe9b4624aa12cab77abd001044ea02d5.1689845210.git.viresh.kumar%40linaro.org
> patch subject: [PATCH V2 2/2] xen: privcmd: Add support for irqfd
> config: arm64-randconfig-r026-20230720 (https://download.01.org/0day-ci/archive/20230721/202307210852.ukq5f98v-lkp@intel.com/config)
> compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
> reproduce: (https://download.01.org/0day-ci/archive/20230721/202307210852.ukq5f98v-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202307210852.ukq5f98v-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
> >> drivers/xen/privcmd.c:961:12: error: call to undeclared function 'eventfd_ctx_fileget'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>      961 |         eventfd = eventfd_ctx_fileget(f.file);

Fixed by selecting EVENTFD. Thanks.

-- 
viresh


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 06:47:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 06:47:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567364.886315 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMjvb-0005Kn-7Q; Fri, 21 Jul 2023 06:47:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567364.886315; Fri, 21 Jul 2023 06:47:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMjvb-0005Kg-4k; Fri, 21 Jul 2023 06:47:51 +0000
Received: by outflank-mailman (input) for mailman id 567364;
 Fri, 21 Jul 2023 06:47:50 +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 <SRS0=FBlW=DH=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMjva-0005Ka-9n
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 06:47:50 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on0603.outbound.protection.outlook.com
 [2a01:111:f400:fe02::603])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 81517f35-2792-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 08:47:48 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM8PR04MB7875.eurprd04.prod.outlook.com (2603:10a6:20b:236::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 06:47:45 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 06:47:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 81517f35-2792-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=dzZjJY6hhXX2aM/lODMG98VA3qeLPjJdRbpQAuVusO6i669oGeE0BeUg9dVMJqcaDjsvjihZ+RF02w3i6otEhRCENtlSw8GjuVGvY4y4v65MMykoPAt5r5GHWdNOtrWus4SGbwNgukjeSIH6ziIh5nC/Q2Hw9TCgGzSZBDOXpYgZCyWFkoEEf23ZP3QA6EsbPNbOA+1kvUP9pD9LhwS2Uns9B1kewphiWy9btQPYBK6Rn01g85JGg4pgUFppYXXMskeA/VHKzo67ryJj1bRxg0qOsU3uCO48SyDYGmcJj4Yin6VuLmReoZJm/Y5FdFqjVo+k8hCLCWghSofIFxCBgQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=YcfVGahNlNID5Wlbevt3ZC6KDLW0OY6KlwdQk4viVF4=;
 b=XQBYCOiXWQIsLx+J/i/ruUjk5GZIt55fBnoJVJQ57Fd4ZR9Xlb4td11y3TkRAW/dh2c4aJ9u3UiRcBVmLwzpQQ46GPGt1iAMsOZVD2fU0nqeQ+nhEa5cZl0xC4CAoG/ojBjD+3Ea8mnQTEjGXOltM7N1TP8fz24VFvVITWglrjXN4Sx8BqJQ9WGA3uBk0oQtbEmxirOxCjQOeOdA4CTMw5eORvkBdDlKG1odIbWijvSnXnb7RFEPrnNteYbv1Gh5QgFNeqcASE7tZWstairXrWTqgA1xZQrekpFxFuCHw01dkNPIA7zQsXsZTwOJxpCafPQdS7hWNL/WpyODXS1a7w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=YcfVGahNlNID5Wlbevt3ZC6KDLW0OY6KlwdQk4viVF4=;
 b=v3p12VSlhUphb4ms7Bgts3KqWIC6S9/b6INTfPIyNb+wOFoVpGbBQM2FkbHGimRFOGrxmpYx5PB27XoS2jj+/GmKQI4aNge1hAj0++oyyi4TSslYedyFJ68nqGa8UROIoDWpMrTR8ehRS55oUSFLoLjUQU3x9OdSvWDNBXuhe42ir/3zqjZHZN3n2QHM7Nt2pIIsw7YhEFxBgnlD1xYXOA6T3DKfSBrxKnMh2Hua0FfwFAS+yVwNrM8/zr+mLp9LPfy9h/h/8UDGulMxZX5TjiNyhM3uyqqDqv4X5aSgNZE4nONzf3/rpAl4AmnKHYHS2WG6Vbc3+Jg20c8WCsXDkw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <795a6937-a50e-91fb-f59e-7a4e3d8f500c@suse.com>
Date: Fri, 21 Jul 2023 08:47:42 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] docs/misra: add Rule 1.1 and 5.6
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: andrew.cooper3@citrix.com, roger.pau@citrix.com, julien@xen.org,
 george.dunlap@citrix.com, bertrand.marquis@arm.com,
 Stefano Stabellini <stefano.stabellini@amd.com>,
 xen-devel@lists.xenproject.org
References: <20230721002322.3457802-1-sstabellini@kernel.org>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230721002322.3457802-1-sstabellini@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0177.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9f::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM8PR04MB7875:EE_
X-MS-Office365-Filtering-Correlation-Id: f62e841a-2168-4f56-c4d9-08db89b663b2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	osQEeDBAOZijAiTFrrD1jJLDLKavj0m02dQhOQ8wvZso1yAXheR6zSavAwCz0snK9Gi3OsDmpQZ32tc+ysHzxdkC7Zst533kSisqYdOXabp4xVIFOSWs8VgeyNQbuwTy4t0wRrssVXXXRSda95NqyNT/C06/JrmApTwFpzRf4aebZfdxKpLQeT/21/HzTMsS118RMAp9davX2fozVEftXXhZH8ULwy3YxIFIlm66mJZsJNx3UQ612D/tQACwbIGDyu4BLf7P1F1Gkpvc2/dieoEr3HHvpshbmY+yU1QPVGHRzi/cyHcJZUzade9jYo+nIyG8I0EAHCxTwkG3TqH5XZGvXxBE+h2rtnIzAMo1ORnKjUDmVXtZTYG/EUb4aWkyPfVu2ibHQ1WYiVtaokKJzg2ZVhncsZkh1mBIXtn6RylStLn5HZKHwH0lHecD9wDB0t//adwnt7uyTchNvndFiDKHA0a7eqcUwwu+yGeNamENlo/WpA0a0i2Noc4Q/KHBVp7jWYPekg+oHhNdQkzKyGrE2A8IBFuPHKtoIuZ6ElNbmkfsLXdtd5Xv3Eidzp0GRxG5Y/qLwOB8+7Tg9l+yRJDPURhk8zLyaJDwn1z1UK8s/bL1gqkGoxsnoGiNCbtPv9Wj/WblGNsn69KmpHfU+g==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(136003)(346002)(396003)(366004)(451199021)(6512007)(478600001)(6486002)(6666004)(2616005)(26005)(186003)(36756003)(6506007)(53546011)(4744005)(2906002)(66476007)(66556008)(6916009)(4326008)(316002)(66946007)(5660300002)(8676002)(8936002)(41300700001)(38100700002)(31696002)(86362001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MkNtODlhVEhWNFJuVEplcnBuM2FCb0JPWVRwS2t1UWpqWEs1SkwwOTN2VnZt?=
 =?utf-8?B?ZWhkVytOeUs3WlZ2YX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UlwaGVXTnorb1NiRm1ibXAvMFRwK0laanJsS05QR3lr?=
 =?utf-8?B?ZWsxRGpSa1FUSTVFajdlU0ZGR0kybXVxUmxYWXU4bTFGWWNiSlVja3NwdGVs?=
 =?utf-8?B?MkV5ZjQ5VUZhT1FjNmx1MkgrdWR3WTFpT3JCSkhhbTdqY09sQ1F2dXJpelJz?=
 =?utf-8?B?ZlJYL09aYXBESmhsSjNBVC94V0NaZEZEcUJPMEQvT3dtSUQ5eVlSK3FJVzBE?=
 =?utf-8?B?cWVWU2l1MWhKQlNoOWx0YlRXd1BLTHRFNmxxVXY0MFAwMkxUSk5FNWFtR3dF?=
 =?utf-8?Q?620SvBFlVnFxfmr5uS2NbGwGn?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f62e841a-2168-4f56-c4d9-08db89b663b2
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 06:47:45.3949
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: SAXc8xXuKRog4rCmXrTIdAowV7aOUY7s7f43p4uW6riuJpfdpp/PAXLhO2oZKx5D1CVO9BiKYTeOUwY5ljGh0w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7875

On 21.07.2023 02:23, Stefano Stabellini wrote:
> From: Stefano Stabellini <stefano.stabellini@amd.com>
> 
> Rule 1.1 is uncontroversial and we are already following it.

Except for our extensive use of compiler extensions. I thought we had
agreed to add a respective remark?

> Rule 5.6 has been deemed a good rule to have by the MISRA C group.
> However, we do have a significant amount of violations that will take
> time to resolve and might require partial deviations in the form of
> in-code comments or MISRA C scanners special configurations (ECLAIR).
> For new code, we want this rule to apply hence the addition to
> docs/misra/rules.rst.

May I ask to insert "generally" ahead of "apply". As mentioned I can
see it becoming necessary to add such in new code, then right away
with deviation and suitably justified.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 06:50:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 06:50:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567366.886326 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMjyL-0006lC-Lq; Fri, 21 Jul 2023 06:50:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567366.886326; Fri, 21 Jul 2023 06:50:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMjyL-0006l5-IK; Fri, 21 Jul 2023 06:50:41 +0000
Received: by outflank-mailman (input) for mailman id 567366;
 Fri, 21 Jul 2023 06:50:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=OIrH=DH=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qMjyK-0006kz-U6
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 06:50:40 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e6f2eba8-2792-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 08:50:39 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.162.18.33])
 by support.bugseng.com (Postfix) with ESMTPSA id D8F394EE0C89;
 Fri, 21 Jul 2023 08:50:36 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e6f2eba8-2792-11ee-b23a-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [XEN PATCH] xen/arm: p2m: refactor 'p2m_get_entry'
Date: Fri, 21 Jul 2023 08:49:58 +0200
Message-Id: <118566cd8b9ebbcedd2b610f5f602cc31c12fd55.1689922099.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This function is refactored to avoid using a
local dummy variable that served as a fallback
if the parameter 't' is NULL.

Storing the address of that variable into 't' caused
static analysis tools not to be able to recognize the
validity of the initialization, and to help with automatic
checking the two usages of 't' have been slightly refactored.

No functional changes.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Suggested-by: Julien Grall <julien@xen.org>
---
 xen/arch/arm/p2m.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index de32a2d638..05d65db01b 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -496,16 +496,13 @@ mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
     lpae_t entry, *table;
     int rc;
     mfn_t mfn = INVALID_MFN;
-    p2m_type_t _t;
     DECLARE_OFFSETS(offsets, addr);
 
     ASSERT(p2m_is_locked(p2m));
     BUILD_BUG_ON(THIRD_MASK != PAGE_MASK);
 
-    /* Allow t to be NULL */
-    t = t ?: &_t;
-
-    *t = p2m_invalid;
+    if ( t )
+        *t = p2m_invalid;
 
     if ( valid )
         *valid = false;
@@ -549,7 +546,8 @@ mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
 
     if ( p2m_is_valid(entry) )
     {
-        *t = entry.p2m.type;
+        if ( t )
+            *t = entry.p2m.type;
 
         if ( a )
             *a = p2m_mem_access_radix_get(p2m, gfn);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 07:05:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 07:05:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567374.886335 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMkCG-0008Rz-00; Fri, 21 Jul 2023 07:05:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567374.886335; Fri, 21 Jul 2023 07:05:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMkCF-0008Rs-TV; Fri, 21 Jul 2023 07:05:03 +0000
Received: by outflank-mailman (input) for mailman id 567374;
 Fri, 21 Jul 2023 07:05:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=So7w=DH=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qMkCE-0008Rm-3Y
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 07:05:02 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2081.outbound.protection.outlook.com [40.107.7.81])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e860bf13-2794-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 09:05:00 +0200 (CEST)
Received: from AS9PR06CA0031.eurprd06.prod.outlook.com (2603:10a6:20b:463::7)
 by AS1PR08MB7452.eurprd08.prod.outlook.com (2603:10a6:20b:4dc::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 07:04:22 +0000
Received: from AM7EUR03FT020.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:463:cafe::6c) by AS9PR06CA0031.outlook.office365.com
 (2603:10a6:20b:463::7) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25 via Frontend
 Transport; Fri, 21 Jul 2023 07:04:22 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT020.mail.protection.outlook.com (100.127.140.196) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6609.28 via Frontend Transport; Fri, 21 Jul 2023 07:04:22 +0000
Received: ("Tessian outbound e1fdbe8a48d3:v145");
 Fri, 21 Jul 2023 07:04:22 +0000
Received: from 5fdc735c9c8c.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 CF68A395-46B1-4FF1-9AA4-DE0EEC465369.1; 
 Fri, 21 Jul 2023 07:04:15 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5fdc735c9c8c.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 21 Jul 2023 07:04:15 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by AM7PR08MB5367.eurprd08.prod.outlook.com (2603:10a6:20b:dd::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 07:04:13 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe%4]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 07:04:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e860bf13-2794-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=n25+3Nh6lWSsuegEl7U23VehCU5dJJi/qzU5jDxHu6c=;
 b=nNXaIhRIR2CDtT7EsOG59q5Sy30vrg6jeiiRzZo+T2sdHUkOYHl3ALmjxKT4tVBqQyzCtI1eBqf8qVfprB7yTELj4SrupMdQtsB021WruzU+bguyU+ME5PX6iK+96Z3j2PSqPvv8i8btoowUUejNB8RiKgMgZEO4JQJHfRt/1Vg=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: cb5a981db509fa1b
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=InKHlQ0A/6gvD+8VV0nZdu66zlvtVGAK5fLGZ5F6oj10OnWRcwybz0H2xq/M9kvQ4KY5i4HpN0QyrFoxkRLW/rJ4QabNN6WxsiFsAWWspk/26k5YxMszOnsQZXMjEnjMASumzxPXgXdGH1wcZOodnXUqeGBnMftGM2+0PD5RuhCUfo4kRg7Hum8ZVR5p7qF/K6jHJGSpPFeDUvTB/O8D/ZN8faB1LWfFcOjQx60FYx/M/LU/fqktKFdpZT4cWKWpZD4I3abinQsLENEmav8Mk0nciCQ4nx8tstFCwxTWtsXwWLHZeGFxLVqszr0d32Pnj1dVpH6+rYeBSm2ILM0Ktw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=n25+3Nh6lWSsuegEl7U23VehCU5dJJi/qzU5jDxHu6c=;
 b=diWUQDsjBhlACYmPp2vVAv96GYjhq0H/U9ySfjENOlNcU2XN/Mmy2hpBFrjQLyqte35Nb65ypBLnXPPyPzwYhMVOACj1V7d/VhdKYxX45JOeZSTXMAF8+NvdRLmfRWmfuLpCQzN05zOVMnLb+NFODc33axr+H4kI0hamBRcAPofMRKfvletE5YoMYYwhVdUwjCw1sFr0U6GMfd+a+u9ADcvpX8g94wN83nBonhzpyWAD8DfZiwYLLDFxpdVQDun2hgpjNcN73UHdFON1x7dpYjzKcERL/0PzD146bqvO5rnzxs6xXox3fuRi72Ngq+iJ7oYgrElXZeQmNfB+SuA90A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=n25+3Nh6lWSsuegEl7U23VehCU5dJJi/qzU5jDxHu6c=;
 b=nNXaIhRIR2CDtT7EsOG59q5Sy30vrg6jeiiRzZo+T2sdHUkOYHl3ALmjxKT4tVBqQyzCtI1eBqf8qVfprB7yTELj4SrupMdQtsB021WruzU+bguyU+ME5PX6iK+96Z3j2PSqPvv8i8btoowUUejNB8RiKgMgZEO4JQJHfRt/1Vg=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
CC: Jens Wiklander <jens.wiklander@linaro.org>, Xen-devel
	<xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Anthony PERARD <anthony.perard@citrix.com>, Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>, Marc Bonnici <Marc.Bonnici@arm.com>, Achin Gupta
	<Achin.Gupta@arm.com>, Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [XEN PATCH v10 04/24] xen/arm: tee: add a primitive FF-A mediator
Thread-Topic: [XEN PATCH v10 04/24] xen/arm: tee: add a primitive FF-A
 mediator
Thread-Index: AQHZuH9Qs/YHnqnvzkGuhUSzNiJMga/CdpeAgADLs4CAAI/HgA==
Date: Fri, 21 Jul 2023 07:04:13 +0000
Message-ID: <1493A958-AB33-4E3D-9298-27B3394A22FD@arm.com>
References: <20230717072107.753304-1-jens.wiklander@linaro.org>
 <20230717072107.753304-5-jens.wiklander@linaro.org>
 <FE5A2E30-8737-415E-92B2-B6B7B0BF0CCE@arm.com>
 <7289237e-5197-a515-959a-023e62dceb14@xen.org>
In-Reply-To: <7289237e-5197-a515-959a-023e62dceb14@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|AM7PR08MB5367:EE_|AM7EUR03FT020:EE_|AS1PR08MB7452:EE_
X-MS-Office365-Filtering-Correlation-Id: 26314cfc-6e17-4842-ac46-08db89b8b5fb
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 8KssSl6pRIQVXOSjEBopK5ywR+na5kgb0XIV82gOjqUN08QClAHoWQSvnC/fc9ZeiDjbb3sT+j+NuUmgH4iJofy9bEMhULmROs/r2GAzWyh2vUEyB47hnnWABBCbgxfwYv4fSvVQHpIhM0jp0VC1rQyQO4UyH5gOsq62WqIZKr3kV5LqEGqCBehIT4xza3dlwmSjy94XZhIZTwFhdrVqw9EdiHMLdUP/Giqkn+E4kRgMOumJg4qzJvXrNtLpVE6KFFYecnSjbbHP/HyeTx3yK5gmpzoNjF3HG0AmnwfHXfdATQ35vNTY3ZikGsc2mpvqKwUh2R49B32f2V2riOwqvDTZAlbct8LU6oau/bYwqM3oWy0hdchfy5Q2ZDOf6BKmASTuNeMVo+JDbLzKxWjO5nxelTL1k5/V4aZKXNJqXfHiFIglcfjjZEXK51qwlw38pxZoGvb0madujDyBAceSc/pUxhqLCVDTgQZPCLj3x7CI3wGmIgeqzXR5CsVJr4zrAr+k4/ANWbh+2VHkgvHIOhgB7IV8DFWLxQNRhNKktA8Iht5DMYw9edIsY0O4oeM7mCuo8px7RuxVDNB5x/4kpLZkPPdGKMECBVXy9b8hx8qvppXj3zCRTbom8BfxbAj+8o0xNWXBZQsw7eEU6dGneg==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(366004)(39860400002)(396003)(376002)(451199021)(6506007)(53546011)(186003)(41300700001)(5660300002)(36756003)(316002)(4326008)(6916009)(54906003)(38070700005)(76116006)(91956017)(64756008)(66446008)(66476007)(66556008)(33656002)(66946007)(478600001)(8936002)(8676002)(71200400001)(38100700002)(966005)(6486002)(6512007)(86362001)(83380400001)(122000001)(2906002)(2616005)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <C3B56CA944EDA041A5F1B037189BA2E3@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5367
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT020.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	360dbe48-6a06-4d37-4df5-08db89b8b0c6
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	7wLpsA4MBD/8HncLfyOEtmQ0jt8UjPmFYpbHdGycgf+utYd+AfPj60ABR2fsazWeQKZimb1aG5N2rVsNPnjTDVptlgAwNHhDNcCSIH46VgIbEqJodWRP4+5jZ062RwXi9zORuw7LrW+5i7CTiEV2MgLQ7euWEfY5tMCtdmo0UzdFKgAiERwS0opsHH1gT1IzvulqNj0uSTulJ6hrEGQoQbjUXRSWO6hh4x/wsSB5Mo53xkbNM6PMFTfspfThrznVTswK/Zz68yetomGYRJtgZSBtmkqT9q4UxSyhK91CcDXqJSPlIocDSDvVDQbQocSMU5wNFGFeCvoB4nMGWvwGcfDwYuy59cMHNbV4lP8YpENHu7f9JgYUdwQjRVisMnLyOv6pT9R7wRbyDNcgR0eXWI3lb/ayYxfmlrn14IIJAhxNr2XnfrV3jI/awPKHmjEKttx1nUzPSWBGPTognbOLcL9nr/mo0mppy3KSIZCy7sbFbY7zv11CAXRqHDFJMeL857omconAOgC8Ooyv3uK7uJRAYN7VZYF1ag7hO30+8mIeZ4G1Iqh8vnwHh9Wpn0VvqoVi9+TPPMsxuLuQOxEB4HhEwuEPXAYr2QfML2/JMG0CjyFpgKDaJjwcmqip8xsk8e4GpfBxOWszIcdAlOTsGcqp7g9YaS6oPWjni9jFOML6bhMt6PHvZEWPaSRQ9abeGxBPukHyf1l4yL0S/lmwjc4+1B8ioYlSCjPpr9RY3Jk=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(136003)(39860400002)(346002)(82310400008)(451199021)(36840700001)(46966006)(40470700004)(2906002)(478600001)(6486002)(54906003)(36756003)(8676002)(41300700001)(316002)(4326008)(70586007)(70206006)(83380400001)(356005)(82740400003)(47076005)(81166007)(40480700001)(966005)(6512007)(86362001)(40460700003)(53546011)(5660300002)(33656002)(8936002)(6862004)(107886003)(26005)(2616005)(186003)(336012)(6506007)(36860700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 07:04:22.2433
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 26314cfc-6e17-4842-ac46-08db89b8b5fb
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT020.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR08MB7452

Hi Julien,

> On 21 Jul 2023, at 00:29, Julien Grall <julien@xen.org> wrote:
>=20
> Hi Bertrand,
>=20
> On 20/07/2023 11:20, Bertrand Marquis wrote:
>> Hi Jens,
>>> On 17 Jul 2023, at 09:20, Jens Wiklander <jens.wiklander@linaro.org> wr=
ote:
>>>=20
>>> Adds a FF-A version 1.1 [1] mediator to communicate with a Secure
>>> Partition in secure world.
>>>=20
>>> This commit brings in only the parts needed to negotiate FF-A version
>>> number with guest and SPMC.
>>>=20
>>> [1] https://developer.arm.com/documentation/den0077/e
>>> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
>>> ---
>>> xen/arch/arm/include/asm/psci.h    |   4 +
>>> xen/arch/arm/include/asm/tee/ffa.h |  35 +++++
>>> xen/arch/arm/tee/Kconfig           |  11 ++
>>> xen/arch/arm/tee/Makefile          |   1 +
>>> xen/arch/arm/tee/ffa.c             | 225 +++++++++++++++++++++++++++++
>>> xen/arch/arm/vsmc.c                |  17 ++-
>>> xen/include/public/arch-arm.h      |   1 +
>>> 7 files changed, 291 insertions(+), 3 deletions(-)
>>> create mode 100644 xen/arch/arm/include/asm/tee/ffa.h
>>> create mode 100644 xen/arch/arm/tee/ffa.c
>>>=20
>>> diff --git a/xen/arch/arm/include/asm/psci.h b/xen/arch/arm/include/asm=
/psci.h
>>> index 832f77afff3a..4780972621bb 100644
>>> --- a/xen/arch/arm/include/asm/psci.h
>>> +++ b/xen/arch/arm/include/asm/psci.h
>>> @@ -24,6 +24,10 @@ void call_psci_cpu_off(void);
>>> void call_psci_system_off(void);
>>> void call_psci_system_reset(void);
>>>=20
>>> +/* Range of allocated PSCI function numbers */
>>> +#define PSCI_FNUM_MIN_VALUE                 _AC(0,U)
>>> +#define PSCI_FNUM_MAX_VALUE                 _AC(0x1f,U)
>>> +
>>> /* PSCI v0.2 interface */
>>> #define PSCI_0_2_FN32(nr) ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL,      =
       \
>>>                                              ARM_SMCCC_CONV_32,        =
       \
>>> diff --git a/xen/arch/arm/include/asm/tee/ffa.h b/xen/arch/arm/include/=
asm/tee/ffa.h
>>> new file mode 100644
>>> index 000000000000..44361a4e78e4
>>> --- /dev/null
>>> +++ b/xen/arch/arm/include/asm/tee/ffa.h
>>> @@ -0,0 +1,35 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-only */
>>> +/*
>>> + * xen/arch/arm/include/asm/tee/ffa.h
>>> + *
>>> + * Arm Firmware Framework for ARMv8-A(FFA) mediator
>>> + *
>>> + * Copyright (C) 2023  Linaro Limited
>>> + */
>>> +
>>> +#ifndef __ASM_ARM_TEE_FFA_H__
>>> +#define __ASM_ARM_TEE_FFA_H__
>>> +
>>> +#include <xen/const.h>
>>> +#include <xen/kconfig.h>
>=20
> None of the headers aside xen/config.h will include xen/kconfig.h. The fo=
rmer is included everything from the compiler command line. So I have remov=
ed it.
>=20
>>> +
>>> +#include <asm/smccc.h>
>>> +#include <asm/types.h>
>>> +
>>> +#define FFA_FNUM_MIN_VALUE              _AC(0x60,U)
>>> +#define FFA_FNUM_MAX_VALUE              _AC(0x86,U)
>>> +
>>> +static inline bool is_ffa_fid(uint32_t fid)
>>> +{
>>> +    uint32_t fn =3D fid & ARM_SMCCC_FUNC_MASK;
>>> +
>>> +    return fn >=3D FFA_FNUM_MIN_VALUE && fn <=3D FFA_FNUM_MAX_VALUE;
>>> +}
>>> +
>>> +#ifdef CONFIG_FFA
>>> +#define FFA_NR_FUNCS    12
>>> +#else
>>> +#define FFA_NR_FUNCS    0
>>> +#endif
>>> +
>>> +#endif /*__ASM_ARM_TEE_FFA_H__*/
>>> diff --git a/xen/arch/arm/tee/Kconfig b/xen/arch/arm/tee/Kconfig
>>> index 392169b2559d..923f08ba8cb7 100644
>>> --- a/xen/arch/arm/tee/Kconfig
>>> +++ b/xen/arch/arm/tee/Kconfig
>>> @@ -8,3 +8,14 @@ config OPTEE
>>>  virtualization-enabled OP-TEE present. You can learn more
>>>  about virtualization for OP-TEE at
>>>  https://optee.readthedocs.io/architecture/virtualization.html
>>> +
>>> +config FFA
>>> + bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
>>> + default n
>>> + depends on ARM_64
>> Even if the tee Makefile is only included if CONFIG_TEE is activated,
>> the missing dependency on TEE here allows to select FFA without TEE
>> resulting in a config with FFA activated but not compiled in.
>> No build error is coming from this, FFA is just not in if selected witho=
ut TEE.
>> Should be:
>> depends on ARM_64 && TEE
>> I am ok if this is fixed on commit and my R-B kept.
>=20
> I have fixed it and committed up to patch #9. That said, I think it would=
 be best if we have a category TEE where both the OPTEE and FFA config is u=
nder. This will help to make the menuconfig clearer and avoid the "depends =
TEE".

Thanks :-)

>=20
> Bertrand, Jens, can one of you have a look?

The fact that both depend on TEE is making both of those appearing under TE=
E in Kconfig and in menuconfig as sub-items of TEE.

But i agree having a menu for those would be nicer and I will propose a pat=
ch for that later today.

Cheers
Bertrand



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 07:28:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 07:28:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567377.886345 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMkYr-0002VP-MT; Fri, 21 Jul 2023 07:28:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567377.886345; Fri, 21 Jul 2023 07:28:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMkYr-0002VI-Jw; Fri, 21 Jul 2023 07:28:25 +0000
Received: by outflank-mailman (input) for mailman id 567377;
 Fri, 21 Jul 2023 07:28:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=OIrH=DH=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qMkYp-0002VC-Pg
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 07:28:23 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2c1691d8-2798-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 09:28:22 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.162.18.33])
 by support.bugseng.com (Postfix) with ESMTPSA id A0A984EE0C89;
 Fri, 21 Jul 2023 09:28:20 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2c1691d8-2798-11ee-b23a-6b7b168915f2
Message-ID: <8891a642-853b-7e1c-6d91-21e09793fd51@bugseng.com>
Date: Fri, 21 Jul 2023 09:28:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] xen/arm: optee: provide an initialization for struct
 arm_smccc_res
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>
References: <a86604d6c85a0d516b8e29258ffebb2841dc6aff.1689863236.git.nicola.vetrini@bugseng.com>
 <b245a0da-0a21-8405-6744-22b86ba994a5@xen.org>
Content-Language: en-US
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <b245a0da-0a21-8405-6744-22b86ba994a5@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 20/07/23 17:54, Julien Grall wrote:
> Hi Nicola,
> 
> On 20/07/2023 15:29, Nicola Vetrini wrote:
>> The local variables with type 'struct arm_smccc_res' are initialized
>> just after the declaration to avoid any possible read usage prior
>> to any write usage, which would constitute a violation of
>> MISRA C:2012 Rule 9.1.
>>
>> This is already prevented by suitable checks in the code,
>> but the correctness of this approach is difficult to prove and
>> reason about.
> 
> So I looked at the implementation of arm_smccc_smc(). For arm64, it is 
> (simplified):
> 
> if ( cpus_have_const_cap(ARM_SMCCC_1_1) )
>  Â Â  arm_smccc_1_1_smc(__VA_ARGS__);
> else
>  Â Â  arm_smccc_1_0_smc(_VA_ARGS__);
> 
> In arm_smccc_1_1_smc(), we will explicitly initialize __res:
> 
> if ( ___res )
>  Â  *___res = (typeof(*___res)) {r0, r1, r2, r3};
> 
> 
> Whereas for arm_smccc_1_0_smc(), we would call assembly function. I 
> assuming this is the problem?
> 
> I think this is similar to the discussion we had on set_interrupts() and 
> dt_set_cells(). If so, couldn't we tell ECLAIR that 
> __arm_smccc_1_0_smc() will always initialize *res?
> 

This is slightly different because of the chained variadic macro 
expansions of arm_smccc_smc. I could have stated that arm_smccc_smc 
initializes its args, but because it's variadic I can't narrow it down 
to a specific index, therefore the property is not correct, because the 
input arguments are instead expected to be read by the macro. The same 
reasoning applies for all variadic macros that have some input and 
output parameters, not just this one.

In the end, if these were fixed-argument functions or macros we can aim 
for that, and that would obsolete this patch.

Regards,

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 07:44:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 07:44:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567383.886355 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMknz-0004ss-TD; Fri, 21 Jul 2023 07:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567383.886355; Fri, 21 Jul 2023 07:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMknz-0004sl-QF; Fri, 21 Jul 2023 07:44:03 +0000
Received: by outflank-mailman (input) for mailman id 567383;
 Fri, 21 Jul 2023 07:44:02 +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
 <SRS0=dNy0=DH=citrix.com=prvs=559993d03=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMkny-0004sd-LG
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 07:44:02 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 598d0cfd-279a-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 09:43:59 +0200 (CEST)
Received: from mail-mw2nam10lp2108.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.108])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 21 Jul 2023 03:43:56 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by MW4PR03MB6603.namprd03.prod.outlook.com (2603:10b6:303:12a::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 07:43:55 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Fri, 21 Jul 2023
 07:43:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 598d0cfd-279a-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689925439;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=yeJrAmxElL62e5LKYhCfnLZ6HRcOgQgNeA308PjnD4w=;
  b=OMNxv2z3Y/oyt3km6Tfy3BrJk5u/UU85n/xIZBdCa5PcseB0XO/BWdbP
   FBzkPuZGFpwT3G6C2aKBPWfx/mSxO/mfNUSn/Fpvj3He4kgkUxBIFXxn+
   eRictWoNdaO0SxJMGw4Dr8Bu1FkJJceDxQYLA3qyDO9aShNmoxsp4oVZ8
   Q=;
X-IronPort-RemoteIP: 104.47.55.108
X-IronPort-MID: 116841522
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:fBYdbqy6oDJLEKcQTUV6t+fnxyrEfRIJ4+MujC+fZmUNrF6WrkUOz
 2IeDG2Ha6zZZWemLtEjYdy+8kJSvcDWzoNkSFY5+SAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhP6gT5zcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPM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ha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=I26TCpBtTQzLCcmgKPxYL2QahkijLHGQQ7bHxM0ENLMfETBsmIjsEdcafXVkkLMK3fhY/qTmmugA+d3w+qPMG8YxwQzTYEhRBsiY+tmJ/+xuTE4wNJOIcLXj/d7q2P/5KdbA4jrzWITCM961mZmELcaAbbEtHlumJstVK/CtLZPild8C8B1zZqPvv3aaSNJzVj/QBbVkzzTKNpgtctDRnPbFx0D5uZ80sd/bdG8tMhBideTGiFY30eeeb7MuN7GuXlSNZW/1zqANp58XowoJuvk/HkOTskz6Kwx7FCvNr8qfLO7qnPbio2cCbeVOQtDV8lFwQNUYNz7mx9jXjxIUng==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4o9FARo0eOG84FGqt1nysGSmKwavLPWF7xFvPEsgPh8=;
 b=d6+H7AjHC0NP6QBzP8XvPOu/8uU9iYjDL7A9dDwyh+hQJ0SQ4lG6OxyQqXXkd9O7gxjtx3ZXRhhN1qJSSrIKtpK5I/N1xqNFgThmNfD4criwepEE9ZzPQzZbnjstAsp7zLSX9tm0S8tuY4FNtq/KQTGFmP8gL93VjhutEuy8STGrGSyFcfvqKIXhWzM+dJtY9ic6cs5D1Whw8WlE/ehVv4Qz+I0ueyjfJzHQbOtg2ZbohJyExr0FkE3LwNT67D3+NpmR9b11SE1gTaD7UcsgY1K9dTn9h8C3A8VaSuXesZf0kVM7z+h+l0MsCp9XrcqhOt273D2yKZ6HzlgsDrgZUA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4o9FARo0eOG84FGqt1nysGSmKwavLPWF7xFvPEsgPh8=;
 b=gSmWdScG3ZzNXf/hazDbD3VmSk17j/K/YauKLWo5Gld0s8F/HFAvx1ujV5g72sTYb3odOksIYIkt3Rqu9qs9Qd5hsj3Na6FW6HTms1FQFnwzEQEOOelBZlttWej9HHf5Qa+llJH/0ut7pn/VGbm2TOC8E1FNTfMp8drFIOk65TU=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 21 Jul 2023 09:43:49 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Message-ID: <ZLo3NY2KX-3fuMGr@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <e9331a8c-69b5-b803-7989-7e3b95b815e4@suse.com>
 <ZLldU9ZNM5BRXqeY@MacBook-Air-de-Roger.local>
 <96b95858-c83a-5703-f6b2-6bee852e62e0@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <96b95858-c83a-5703-f6b2-6bee852e62e0@suse.com>
X-ClientProxiedBy: LO4P265CA0002.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2ad::22) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|MW4PR03MB6603:EE_
X-MS-Office365-Filtering-Correlation-Id: 625ef23b-d378-403e-991d-08db89be3c07
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	loqbrjFMDQemztmjg1KuLudNMNEFdqh6gdutqKH5+cZBUBRYlF5r5v2TCmLOGVcfbVTRhuioa+kDTyIBHVbmoIW77PUxEfrGQ6DFHQ3j57H3csCDAcH1+/uTq7ZzsfU7INlXv8SdbTESwTg/VlnX7zLh9p0amHiQ65xu62iEuoVZcGVvyZ7395mjnD0y+nWXOKbp+vlepO890G5Q9AJ3dcQVwvN7goxF0G/rs76O0Vl1MVo55a2nqBCW/aLlmUIR58Srr0ZKfdH+RuQet5KeXrFD/iv7JTEZO0MhyA7cpLNmdOd1yJhKRJnKOqBi9TD5g5xq2kg+lwaNDH6wUWSa1PAer4a18osAa14Th97dz1z2wxLFBIcyFDANXV/9x1QxeU2GomXg0XTdkwI8yHU3rTVTneSjbAQRp50BCsME5qTjPcU2c0x4B+jBSbyQfpBiyiFtOV+9g1S2hcS4SWfD51rYdOUxLLt5zXY+lDTXhh4v/bEHVTGVEh2/pOPRBiMT2egyVCYM1r2Fe0GmHL0GtxQ90eCK9mxPq7ArVEjx8rM+RcdEeNKCZUn5aFcVp6fG
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(376002)(346002)(136003)(396003)(39860400002)(451199021)(5660300002)(8676002)(8936002)(41300700001)(316002)(2906002)(6916009)(66556008)(66946007)(66476007)(53546011)(6506007)(26005)(38100700002)(86362001)(9686003)(83380400001)(54906003)(6666004)(6486002)(4326008)(85182001)(82960400001)(6512007)(186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w3o5PsxHQCjxeAJPPJl3ciBOOy4zn9exSdGItnjyTbi+llRCL5VuPxqYodPnSZDH75rwFL+BISQKy9Rrpi/TazaYcB4AtXIVEt7N9BSL1XaHc8/myzeiHpeCjmzECq11BRZtuDCKaPaFT4njsXt8CK5LMNdYnyxvn+e3VYbsS8WWPX1wJBMXLzBtGu0EyzDlFrldhKHTtPluJRjFEPv5IRHZtKuNGE7rMDl3T3nGzIKB3KhyYwC8kAbxS5r8IIEsI5dvBDirx2UWqCQhLreMuTHYT6umut2qNLFtVlzDLvAxqr7yxVw6jqi6Bs8/L0N9iVlydQ7fBFeh9w1gj/pUkqanL1b9Lb6m60sbeGW7fdgU6mwzFrg8JijdXxedu+v3DNYzPwkS0vs8oBma7sZlwJWMjD97bFLdhk+3HWS+TWB//pTKwYy9Vj8nOJthFFpoZy4PZLlPGSN9fBlKs36DXK719+NotnNOxftGHq/HKeuhLKzU24fixgrlyBtkw==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 625ef23b-d378-403e-991d-08db89be3c07
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 07:43:54.9535
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 9/XLTITj55vr9QSi//RSYxEUyt4zPW6ElApgwUnHZ/EOUPrfJ0hlIdJhW5v+hxG4n4oAlotIcl8SFjdjouEilg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR03MB6603

On Fri, Jul 21, 2023 at 08:02:33AM +0200, Jan Beulich wrote:
> On 20.07.2023 18:14, Roger Pau MonnÃ© wrote:
> >  Strictly speaking however the init
> > handlers don't require the lock in write mode unless we use such
> > locking to get exclusive access to all the devices assigned to the
> > domain BARs array for modify_bars().
> 
> Aiui in the present model modify_bars() has to use the vpci lock for
> protection.

But the current protection is insufficient, as we only hold the vpci
lock of the current device, but we don't hold the vpci lock of the
other devices when we iterate over in order to find overlapping bars
(or else it wold be an ABBA deadlock situation).

So my suggestion (which can be done later) is to take the newly
introduced per-domain rwlock in exclusive mode for modify_bars() in
order to assert there are no changes to the other devices vpci bar
fields.

> Therefore imo in any of the init functions the assertions
> should either express the real requirements of those functions, or be
> omitted on the basis that they're all called out of add-handlers
> anyway.

I'm happy to omit for the time being.  Iff we agree that modify_bars()
requires the rwlock in exclusive mode then we could add the assertion
there, but not in the init functions themselves.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 07:46:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 07:46:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567387.886365 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMkpy-0005XD-BB; Fri, 21 Jul 2023 07:46:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567387.886365; Fri, 21 Jul 2023 07:46:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMkpy-0005X6-8V; Fri, 21 Jul 2023 07:46:06 +0000
Received: by outflank-mailman (input) for mailman id 567387;
 Fri, 21 Jul 2023 07:46:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMkpw-0005Ww-Jv; Fri, 21 Jul 2023 07:46:04 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMkpw-0005gd-ES; Fri, 21 Jul 2023 07:46:04 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMkpw-000417-02; Fri, 21 Jul 2023 07:46:04 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMkpv-0007sc-Vi; Fri, 21 Jul 2023 07:46:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=UozbeEc3KoIXWxan89R2q4bB2nujBCbGhZu8Oyz8Csc=; b=xd1PActr2gWjrU6yt+5rzp/JpX
	zKQfYw7s8Lic0JuW/fF+XcR5BdclGOu1Gf51Vg/zqtdRluk4Y5TEtS9jP1GkUY1ZX0G6g9ooT0HWH
	6j58/TbCZxJ1TxlgsOXvaolxWWFpNA+u/R/FoiaN4RKrHDk/zNOCvVuKmeWMedY2kTuA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181944-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181944: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=925c445fd37bf529ca78f9d6c416cca37c7e6da5
X-Osstest-Versions-That:
    ovmf=c6b512962e92ae54a895bdfd2147abaf2c9e3e22
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 21 Jul 2023 07:46:03 +0000

flight 181944 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181944/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 925c445fd37bf529ca78f9d6c416cca37c7e6da5
baseline version:
 ovmf                 c6b512962e92ae54a895bdfd2147abaf2c9e3e22

Last test of basis   181937  2023-07-20 20:42:43 Z    0 days
Testing same since   181944  2023-07-21 06:13:48 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Sunil V L <sunilvl@ventanamicro.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   c6b512962e..925c445fd3  925c445fd37bf529ca78f9d6c416cca37c7e6da5 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 08:02:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 08:02:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567396.886375 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMl5e-0008WE-1y; Fri, 21 Jul 2023 08:02:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567396.886375; Fri, 21 Jul 2023 08:02:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMl5d-0008W7-Vh; Fri, 21 Jul 2023 08:02:17 +0000
Received: by outflank-mailman (input) for mailman id 567396;
 Fri, 21 Jul 2023 08:02:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=So7w=DH=arm.com=bertrand.marquis@srs-se1.protection.inumbo.net>)
 id 1qMl5c-0008W1-Ba
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 08:02:16 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTP
 id e76a6f5a-279c-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 10:02:15 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6D4402F4;
 Fri, 21 Jul 2023 01:02:57 -0700 (PDT)
Received: from C3HXLD123V.emea.arm.com (unknown [172.31.20.19])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 35CBA3F67D;
 Fri, 21 Jul 2023 01:02:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e76a6f5a-279c-11ee-b23a-6b7b168915f2
From: Bertrand Marquis <bertrand.marquis@arm.com>
To: xen-devel@lists.xenproject.org
Cc: jens.wiklander@linaro.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH] xen/arm: Move TEE mediators in a kconfig submenu
Date: Fri, 21 Jul 2023 10:02:04 +0200
Message-Id: <a44f74559f52d1fa90a3f77390e7d121c9cd848e.1689926422.git.bertrand.marquis@arm.com>
X-Mailer: git-send-email 2.39.2 (Apple Git-143)
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rework TEE mediators to put them under a submenu in Kconfig.
The submenu is only visible if UNSUPPORTED is activated as all currently
existing mediators are UNSUPPORTED.

While there rework a bit the configuration so that OP-TEE and FF-A
mediators are selecting the generic TEE interface instead of depending
on it.
Make the TEE option hidden as it is of no interest for anyone to select
it without one of the mediators so having them select it instead should
be enough.
Rework makefile inclusion and selection so that generic TEE is included
only when selected and include the tee Makefile all the time making the
directory tee self contained.

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/Kconfig      |  7 -------
 xen/arch/arm/Makefile     |  2 +-
 xen/arch/arm/tee/Kconfig  | 18 ++++++++++++++++--
 xen/arch/arm/tee/Makefile |  2 +-
 4 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 439cc94f3344..fd57a82dd284 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -175,13 +175,6 @@ config ARM64_BTI
 	  Branch Target Identification support.
 	  This feature is not supported in Xen.
 
-config TEE
-	bool "Enable TEE mediators support (UNSUPPORTED)" if UNSUPPORTED
-	default n
-	help
-	  This option enables generic TEE mediators support. It allows guests
-	  to access real TEE via one of TEE mediators implemented in XEN.
-
 source "arch/arm/tee/Kconfig"
 
 config STATIC_SHM
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 7bf07e992046..d47d5c20aa73 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -5,7 +5,7 @@ obj-$(CONFIG_HAS_PCI) += pci/
 ifneq ($(CONFIG_NO_PLAT),y)
 obj-y += platforms/
 endif
-obj-$(CONFIG_TEE) += tee/
+obj-y += tee/
 obj-$(CONFIG_HAS_VPCI) += vpci.o
 
 obj-$(CONFIG_HAS_ALTERNATIVE) += alternative.o
diff --git a/xen/arch/arm/tee/Kconfig b/xen/arch/arm/tee/Kconfig
index 923f08ba8cb7..cecbf7e12b43 100644
--- a/xen/arch/arm/tee/Kconfig
+++ b/xen/arch/arm/tee/Kconfig
@@ -1,7 +1,17 @@
+menu "TEE mediators"
+	visible if UNSUPPORTED
+
+config TEE
+	bool
+	default n
+	help
+	  This option enables generic TEE mediators support. It allows guests
+	  to access real TEE via one of TEE mediators implemented in XEN.
+
 config OPTEE
-	bool "Enable OP-TEE mediator"
+	bool "Enable OP-TEE mediator (UNSUPPORTED)" if UNSUPPORTED
 	default n
-	depends on TEE
+	select TEE
 	help
 	  Enable the OP-TEE mediator. It allows guests to access
 	  OP-TEE running on your platform. This requires
@@ -13,9 +23,13 @@ config FFA
 	bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
 	default n
 	depends on ARM_64
+	select TEE
 	help
 	  This option enables a minimal FF-A mediator. The mediator is
 	  generic as it follows the FF-A specification [1], but it only
 	  implements a small subset of the specification.
 
 	  [1] https://developer.arm.com/documentation/den0077/latest
+
+endmenu
+
diff --git a/xen/arch/arm/tee/Makefile b/xen/arch/arm/tee/Makefile
index 58a1015e40e0..1ef49a271fdb 100644
--- a/xen/arch/arm/tee/Makefile
+++ b/xen/arch/arm/tee/Makefile
@@ -1,3 +1,3 @@
 obj-$(CONFIG_FFA) += ffa.o
-obj-y += tee.o
+obj-$(CONFIG_TEE) += tee.o
 obj-$(CONFIG_OPTEE) += optee.o
-- 
2.39.2 (Apple Git-143)



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 08:32:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 08:32:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567403.886385 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMlYc-0003VP-3a; Fri, 21 Jul 2023 08:32:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567403.886385; Fri, 21 Jul 2023 08:32:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMlYc-0003VI-16; Fri, 21 Jul 2023 08:32:14 +0000
Received: by outflank-mailman (input) for mailman id 567403;
 Fri, 21 Jul 2023 08:32:12 +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 <SRS0=S9Zc=DH=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qMlYa-0003VC-1C
 for xen-devel@lists.xen.org; Fri, 21 Jul 2023 08:32:12 +0000
Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com
 [2a00:1450:4864:20::235])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 146841d8-27a1-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 10:32:08 +0200 (CEST)
Received: by mail-lj1-x235.google.com with SMTP id
 38308e7fff4ca-2b9540031acso24281261fa.3
 for <xen-devel@lists.xen.org>; Fri, 21 Jul 2023 01:32:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 146841d8-27a1-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689928327; x=1690533127;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=PcXYr1vGbRUlETdz1rHapduxUlSSjbwTocp8ZuDsRpM=;
        b=jZV62k+23IfylgoWfzzewQJYJ946lrwT58CYZH8wagy5NFy+Gr03XsY2p89+sI2dTx
         vqRHv/d9GKR16K/n2/nRIYnfJwGTZjeb0G6i1CAUtgjBtsC9DRKWw8Y34PF9PAWeB/Eb
         9u+l6B2Z+CO9irWaEm7K30Xxw3nr5LcCG4FSY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689928327; x=1690533127;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=PcXYr1vGbRUlETdz1rHapduxUlSSjbwTocp8ZuDsRpM=;
        b=R7LZKBEGoMxBI4jbNrJnWVTZ4P8ogX7s66OfVLVfMnke2ysfFSthkecldU42AzvuQr
         eI3j5gRz0ORDmQ0/+iP49GA+n7UjDzJegMKFAv7FTYR35mUCKemTKDglueT65j0yi2R8
         CTRQ/QCaM5i83PdO2Kw0RVeifx7fmBldD2ckqM38rZkkBEcTS1OMgWLPSwt9uqCGB7gJ
         7ZOuYvis+EkXrXiYMDzqcx7GbFGtPBPqC7SchAgszKZBxR2DpFzZ3hzGHAmIkP9ECqJi
         ck9UJO9Ae5yNKu+145l7en4QRv6fuesiYmLcTKo5O2dMh3Kya+3ogH04ZoZ0/xtq8OtH
         xstQ==
X-Gm-Message-State: ABy/qLY90VrZc+UVFXLaMMGqapmruAVjcOQsSPc6FoJVQv0G+5Ko8ewp
	cZGT5eSVswtLeXVZs7jlveQiwOz7CO9nmpKXSI3Seg==
X-Google-Smtp-Source: APBJJlE++yChMN7RWhyMy44K6b7oUZlK4aEkKviRgq9buPW2ugP1ZZobPUN4+AXM92dDJUQdSvYaXMw3SyeQrPGSntM=
X-Received: by 2002:a2e:3002:0:b0:2b6:a3a0:5f7 with SMTP id
 w2-20020a2e3002000000b002b6a3a005f7mr1148653ljw.9.1689928327607; Fri, 21 Jul
 2023 01:32:07 -0700 (PDT)
MIME-Version: 1.0
References: <144a57807d6f3e6c1e9b45215cb4fa5fa4535f10.1688628006.git.viresh.kumar@linaro.org>
In-Reply-To: <144a57807d6f3e6c1e9b45215cb4fa5fa4535f10.1688628006.git.viresh.kumar@linaro.org>
From: George Dunlap <george.dunlap@cloud.com>
Date: Fri, 21 Jul 2023 09:31:56 +0100
Message-ID: <CA+zSX=bfhtk6mTeR83-3vC2CU=Y5EnaGok_JH8_-62u_wCd9DA@mail.gmail.com>
Subject: Re: [PATCH V4] libxl: arm: Add grant_usage parameter for virtio devices
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: xen-devel@lists.xen.org, Juergen Gross <jgross@suse.com>, Julien Grall <julien@xen.org>, 
	Anthony PERARD <anthony.perard@citrix.com>, George Dunlap <george.dunlap@citrix.com>, 
	Nick Rosbrook <rosbrookn@gmail.com>, Wei Liu <wl@xen.org>, 
	Vincent Guittot <vincent.guittot@linaro.org>, stratos-dev@op-lists.linaro.org, 
	=?UTF-8?B?QWxleCBCZW5uw6ll?= <alex.bennee@linaro.org>, 
	Mathieu Poirier <mathieu.poirier@linaro.com>, Oleksandr Tyshchenko <olekstysh@gmail.com>, 
	Erik Schilling <erik.schilling@linaro.org>
Content-Type: multipart/alternative; boundary="000000000000a9c9470600fb1942"

--000000000000a9c9470600fb1942
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 6, 2023 at 8:29=E2=80=AFAM Viresh Kumar <viresh.kumar@linaro.or=
g> wrote:

> Currently, the grant mapping related device tree properties are added if
> the backend domain is not Dom0. While Dom0 is privileged and can do
> foreign mapping for the entire guest memory, it is still desired for
> Dom0 to access guest's memory via grant mappings and hence map only what
> is required.
>
> This commit adds the "grant_usage" parameter for virtio devices, which
> provides better control over the functionality.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
>

Golang bits:
Acked-by: George Dunlap <george.dunlap@cloud.com>

--000000000000a9c9470600fb1942
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jul 6, 2023 at 8:29=E2=80=AFA=
M Viresh Kumar &lt;<a href=3D"mailto:viresh.kumar@linaro.org">viresh.kumar@=
linaro.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">Currently, the grant mapping related device tree properties are =
added if<br>
the backend domain is not Dom0. While Dom0 is privileged and can do<br>
foreign mapping for the entire guest memory, it is still desired for<br>
Dom0 to access guest&#39;s memory via grant mappings and hence map only wha=
t<br>
is required.<br>
<br>
This commit adds the &quot;grant_usage&quot; parameter for virtio devices, =
which<br>
provides better control over the functionality.<br>
<br>
Signed-off-by: Viresh Kumar &lt;<a href=3D"mailto:viresh.kumar@linaro.org" =
target=3D"_blank">viresh.kumar@linaro.org</a>&gt;<br>
Reviewed-by: Anthony PERARD &lt;<a href=3D"mailto:anthony.perard@citrix.com=
" target=3D"_blank">anthony.perard@citrix.com</a>&gt;<br></blockquote><div>=
<br></div><div>Golang bits:</div><div>Acked-by: George Dunlap &lt;<a href=
=3D"mailto:george.dunlap@cloud.com">george.dunlap@cloud.com</a>&gt;</div><d=
iv><br></div></div></div>

--000000000000a9c9470600fb1942--


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 08:39:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 08:39:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567406.886396 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMlfV-00049Z-SQ; Fri, 21 Jul 2023 08:39:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567406.886396; Fri, 21 Jul 2023 08:39:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMlfV-00049S-Ot; Fri, 21 Jul 2023 08:39:21 +0000
Received: by outflank-mailman (input) for mailman id 567406;
 Fri, 21 Jul 2023 08:39:21 +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
 <SRS0=obHh=DH=oss.nxp.com=andrei.cherechesu@srs-se1.protection.inumbo.net>)
 id 1qMlfV-00049M-42
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 08:39:21 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0602.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::602])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 14e52cc8-27a2-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 10:39:18 +0200 (CEST)
Received: from VI1PR04MB5056.eurprd04.prod.outlook.com (2603:10a6:803:5a::13)
 by AS8PR04MB8500.eurprd04.prod.outlook.com (2603:10a6:20b:343::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Fri, 21 Jul
 2023 08:39:16 +0000
Received: from VI1PR04MB5056.eurprd04.prod.outlook.com
 ([fe80::a660:f949:7690:2dd0]) by VI1PR04MB5056.eurprd04.prod.outlook.com
 ([fe80::a660:f949:7690:2dd0%3]) with mapi id 15.20.6609.024; Fri, 21 Jul 2023
 08:39:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 14e52cc8-27a2-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=I55YAN6RpSGEb34AUuc6hjVu0EiY6O6woNeftCwQeniPcj2bWuLg0YAmsRnW5lceDV6WfI2/oBD2imS/BK96zCY+QJ5ksp2/qFHO+Hu+TOiB3UrzRtbqHtM174gvpVLVVP+FfwA2xkl/XdpzEJ35+R0sMIUf/reTphjvuFA1SqtxN6TfxKH84Y8uLlYqvHXM6R0zVSX9v2EFFDDc/8FtTslE1aGBBRnKnUHRvK6zcI5VquQDX3g9TzjZEl30djvUqzzAm/t3+lKmMqAn+RU+wz4ywYG76T+wMSAYcfyUdv5nktd4vvnAOclEQSNY+aNnwdp3sFSLD144vosrx8ZLRw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Et0voL1IBQt1LV3UjVIAZTxo5V33LRBlMutTn7j+dlc=;
 b=GGsjz+OLTGOKzMTluIVyxjo5I0vkpvXp2zg2/C7xoiqwXxZQyAyb4DK9dmosaqK6m7JM3o0+ohuqKSbkctb+XssXu6F+jCgvzXzZglojU60eX+gRIbqNjooV34B7ep/xPmyEBOOG9AjjDGI9OuTPGyA4x3YW2T27QsUj69BdunQscKB+j7UviNxtu9X3zBpOrcSUOf7V8DfYyKgu2fCuBVw1JbjmFZXXsp4SkDfGL3LgFXRLHFdB7S+LnapVFrIEiJFvy9iEjfuVCsMoegSPMK3Ua0zaKZErhyT0OpGKGZPwlJt4YMp7buPEU60mY4CSpVZ1Muj5SuPKuJZZNmmDMA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com;
 dkim=pass header.d=oss.nxp.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com;
 s=selector2-NXP1-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Et0voL1IBQt1LV3UjVIAZTxo5V33LRBlMutTn7j+dlc=;
 b=QyHqvNryJAF3eNmntpREiVLIJLOgGoaGnYOosObY/27PSGc0sfwQ4Y42+90MhtuYcL4nZl38V64z9DriOfLv5qaxKJLFdHut5/0AIvmTFPagBK5ZG9G3GnTrYBrxOOMWKfyMRcjbWrgKBtvCUMBibOJMQHbU99s8gEpnS1hmSck=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=oss.nxp.com;
Message-ID: <d7f16516-a009-27a2-497a-2c48eab3df3e@oss.nxp.com>
Date: Fri, 21 Jul 2023 11:39:13 +0300
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
 Thunderbird/91.8.0
Subject: Re: [ARM][xencons] PV Console hangs due to illegal ring buffer
 accesses
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>
Cc: xen-devel@lists.xenproject.org, george.mocanu@nxp.com,
 Juergen Gross <jgross@suse.com>
References: <62eeff72-c1fb-6932-6797-1b0058c97b03@oss.nxp.com>
 <048266d6-a32f-5f4e-984a-8b74de01a1fc@xen.org>
 <alpine.DEB.2.22.394.2307201609030.3118466@ubuntu-linux-20-04-desktop>
From: "Andrei Cherechesu (OSS)" <andrei.cherechesu@oss.nxp.com>
In-Reply-To: <alpine.DEB.2.22.394.2307201609030.3118466@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: AM0PR06CA0083.eurprd06.prod.outlook.com
 (2603:10a6:208:fa::24) To VI1PR04MB5056.eurprd04.prod.outlook.com
 (2603:10a6:803:5a::13)
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: VI1PR04MB5056:EE_|AS8PR04MB8500:EE_
X-MS-Office365-Filtering-Correlation-Id: aa6b0348-4d2c-4029-a2e2-08db89c5f771
X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	MvrdfadzNhvYByy9CKPiJWFnyofzkDSC81r/IgIhIhj3lhmTt68Z2MHQUscyHtdnKcCC4mpT1DkA8dPBBu8ZHgzY5H9VbpBjG310k+n3xwgrzsTUHtF8KDZnKZ+Xhci80Xar9XIs8+qX2O+kU+Hm6EgNTONM8E4EVe1HmAwjODRuMuLoGY8Q/TTaFV/hcZ8QJ7tcRgP0KRXsXO9vjlyJ8Kgr6AqFmPKDpqaiCjGRamXbM2tG2MU6dt23DA7RM+X6j5rkqDP7JYvkirwTYT6Kmd5k6muSHpMdbgQUJlFUUY+lNSxQibYjRS5iGagjcIhwP5saQRRGzOVBBtuSMhfdUakh77uwDIQZrbYCzPOxN8TlowTPMlgJCkk8nPYJOxgKbngmIU/vAa2zyqnc7QpvQG1fen3Q6fUEYq50YnH+Zewwx1jLx1TG16Jb3GLN5/vyZ/9Wtj4xoH7StyBeEQ2frGmidB73r7sMniwe/hnGRdxsvwenyCWj7diEizkvz3vwiLrf2QXtvy3pSWsngx1AzCz4hCdZroAdAUCfq4VnZ7BXVppoLZLx3r9D/ZxeUCy+fmpiehoNZBUp91IjAqmyWwgW7Km/C6v96U6jz7wGAL+n2lpYRyaHpfTZmY+r9TmtmrEC/dlwcBR3OuOddBwStw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5056.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(366004)(39860400002)(346002)(136003)(451199021)(53546011)(66476007)(478600001)(186003)(6506007)(41300700001)(26005)(6512007)(966005)(110136005)(6486002)(31686004)(316002)(4326008)(5660300002)(8936002)(66556008)(8676002)(66946007)(2906002)(2616005)(83380400001)(38100700002)(31696002)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aWdsS3hkTllNT05qd2IzaTRHT2lhNzdIMnNBaUpaUXMrazBid0tBWTZ0T1ZP?=
 =?utf-8?B?enRIVHBGSE9ZUnZoQTlhcmxuZFM2VHRXcmVLRjFmQXA5dHZWS2dwUGpqZmpi?=
 =?utf-8?B?M3VkRDg2UFBDMnl1M3NHK2NvVyswcjB3cC9zZUhQTVRwVXpobU1LQXpyMHFV?=
 =?utf-8?B?ODlHTHNLSUQrbTU1VTliYVV6SmxBY21oTUFqTFRlZFkwZ2svT2t4L0U5ZUU0?=
 =?utf-8?B?WS9BSnIybWhVU3dJQ3lodUdtcjFRTTdEOFVEZ0xueksxN3IwZVBKTVMxTWpK?=
 =?utf-8?B?ZXphNXI5dytFbXlRMmNRd3ROd0tVaWNML1B0Sk1Na0NUYnpyTnlnR1NmN3Bk?=
 =?utf-8?B?amJaUmdrM3VkUWdlbVlhNmU2d2F5Um1YbDJEZ08rZzdaMDgvY2RFY2FTcTBP?=
 =?utf-8?B?R25GMXorMVRLTU5JWDFKM1lKWjcycHdrTmpOOXRMZWpmOTlobFhYUElqTExC?=
 =?utf-8?B?V01TNjRHY2NnUFc2MkZIdEZwU3hjbU5lTnhDYWlHSlBscjFFdXRMeTIzMHZ6?=
 =?utf-8?B?M010S24veDZnQzE1RDZPalBqR0V4K1BFeWoyYkJLSzRjUllNSjM2U2Q2TDdH?=
 =?utf-8?B?ZGZHNmRjZWREbE1uVjlwRWdKZ2ZjNmRZSFU2L3J2V3dvZmJIaHVYVFlxd1Q4?=
 =?utf-8?B?MFlKeDd3QitNckh2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M2tOZmVkamdLTENq?=
 =?utf-8?B?eVgrQm54eFlyNFhoSTVCWVF5VEZFTjFudTA1ZC9Gd056ejdrYmdYZkhPVzNw?=
 =?utf-8?B?S1ZkWTBFWFJjS2dvcWtGVVd6ZlpsUkVBeml6eUNMTm44dTNRK2w2cm50ZlBK?=
 =?utf-8?B?TjZJeDFKSm5aTU5zazdQWWh3ZTFZOFFWMEViS1hsY2VwcGFHczF5WDZVNHVl?=
 =?utf-8?B?WXFiSDVMWHJWOHdDMEIzUCtDRnkxbkxtUVJLZms4YWdnQUdrQ1VocEcvNjhL?=
 =?utf-8?B?bHpjZVlWSFR3dDJCWE1jUm0rSzFuWTRNa0Zhcld1aU1uY3dZTHZkWnA2aG9v?=
 =?utf-8?B?QkIzbEs1cmJvVlJMZ2JqbUQwdFZVUE5IWHJUa0dMTGtOemlPRUdIMVhrNUpw?=
 =?utf-8?B?UjhYc0FPYXRmVTZIcWlsN1A2Yk5kZnVEM2x2dW9vS2dhdEdnMGMwb0xtaVNO?=
 =?utf-8?B?d3cxU0FnNzNQbzNHaTI5REdFWS9DZFA0VkZlZ1lITmhvdkhIM2p2M0p5dDVC?=
 =?utf-8?B?TmJ4dVFUMlZqak1vV1lXSTQxbXE1YVRGRW1uL0Z4ZEhMcEZVQlBqR3VyN1Zt?=
 =?utf-8?B?NmNsV2pwTnVKbjRaTDV1L2JHb0lIbDViUnYxbGE2NzFNaTNTZWRyVExWeEp6?=
 =?utf-8?B?VUE9PQ==?=
X-OriginatorOrg: oss.nxp.com
X-MS-Exchange-CrossTenant-Network-Message-Id: aa6b0348-4d2c-4029-a2e2-08db89c5f771
X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5056.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 08:39:15.8402
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: A8CfcuRrfLe6/yao4qMAM+Iju6+iRIrkbYsRIJkLFQF8ulIxB5IjpWSpK8Ow3CLHcz7yz65aEv6kNltczRkbL+QWVsmjE9FvmtO0Iwf6BZw=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8500

Hello, Julien, Stefano,

Thank you for your replies.

On 21/07/2023 02:25, Stefano Stabellini wrote:
> 
> On Thu, 20 Jul 2023, Julien Grall wrote:
>> (+ Juergen)
>>
>> On 19/07/2023 17:13, Andrei Cherechesu (OSS) wrote:
>>> Hello,
>>
>> Hi Andrei,
>>
>>> As we're running Xen 4.17 (with platform-related support added) on NXP S32G
>>> SoCs (ARMv8), with a custom Linux distribution built through Yocto, and
>>> we've set some Xen-based demos up, we encountered some issues which we think
>>> might not be related to our hardware. For additional context, the Linux
>>> kernel version we're running is 5.15.96-rt (with platform-related support
>>> added as well).
>>>
>>> The setup to reproduce the problem is fairly simple: after booting a Dom0
>>> (can provide configuration details if needed), we're booting a normal PV
>>> DomU with PV Networking. Additionally, the VMs have k3s (Lightweight
>>> Kubernetes - version v1.25.8+k3s1:
>>> https://github.com/k3s-io/k3s/releases/tag/v1.25.8%2Bk3s1) installed in
>>> their rootfs'es.
>>>
>>> The problem is that the DomU console hangs (no new output is shown, no input
>>> can be sent) some time (non-deterministic, sometimes 5 seconds, other times
>>> like 15-20 seconds) after we run the `k3s server` command. We have this
>>> command running as part of a sysvinit service, and the same behavior can be
>>> observed in that case as well. The k3s version we use is the one mentioned
>>> in the paragraph above, but this can be reproduced with other versions as
>>> well (i.e., v1.21.11, v1.22.6). If the `k3s server` command is ran in the
>>> Dom0 VM, everything works fine. Using DomU as an agent node is also working
>>> fine, only when it is run as a server the console problem occurs.
>>>
>>> Immediately after the serial console hangs, we can still log in on DomU
>>> using SSH, and we can observe the following messages its dmesg:
>>> [   57.905806] xencons: Illegal ring page indices
>>
>> Looking at Linux code, this message is printed in a couple of place in the
>> xenconsole driver.
>>
>> I would assume that this is printed when reading from the buffer (otherwise
>> you would not see any message). Can you confirm it?
>>
>> Also, can you provide the indices that Linux considers buggy?
>>
>> Lastly, it seems like the barrier used are incorrect. It should be the
>> virt_*() version rather than a plain mb()/wmb(). I don't think it matter for
>> arm64 though (I am assuming you are not running 32-bit).
>>
>>> [   59.399620] xenbus: error -5 while reading message
>>
>> So this message is coming from the xenbus driver (used to read the xenstore
>> ring). This is -EIO, and AFAICT returned when the indices are also incorrect.
>>
>> For this driver, I think there is also a TOCTOU because a compiler is free to
>> reload intf->rsp_cons after the check. Moving virt_mb() is probably not
>> sufficient. You would also want to use ACCESS_ONCE().
>>
>> What I find odd is you have two distinct rings (xenconsole and xenbus) with
>> similar issues. Above, you said you are using Linux RT. I wonder if this has a
>> play into the issue because if I am not mistaken, the two functions would now
>> be fully preemptible.
>>
>> This could expose some races. For instance, there are some missing
>> ACCESS_ONCE() (as mentioned above).
>>
>> In particular, Xenstored (I haven't checked xenconsoled) is using += to update
>> intf->rsp_cons. There is no guarantee that the update will be atomic.
>>
>> Overall, I am not 100% sure what I wrote is related. But that's probably a
>> good start of things that can be exacerbated with Linux RT.
>>
>>> [   59.399649] xenbus: error -5 while writing message
>>
>> This is in xenbus as well. But this time in the write part. The analysis I
>> wrote above for the read part can be applied here.
> 
> This is really strange. What is also strange is that somehow the indexes
> recover after 10-15 seconds? How is that even possible. Let's say there
> is a memory corruption of some sort, maybe due to missing barriers like
> Julien suggested, how can it go back to normal after a while?

The console does not go back to normal. I mentioned we get that dmesg output
after logging onto DomU via SSH, so at least the grant tables for PV Networking are not corrupted.
But the normal console is still blocked.

> 
> I am really confused. I would try with regular Linux instead of Linux RT
> and also would try to replace all the barriers in
> drivers/tty/hvc/hvc_xen.c with their virt_* version to see if we can
> narrow down the problem a bit.
> 

Unfortunately, we do not normally run regular Linux and we do not have a
stable regular Linux version with our HW support ported on it. We've been running
Linux RT since 4.14 (or even earlier I think), but this issue has started to happen
since we upgraded to Xen 4.17 (from 4.14), with both Linux RT 5.15 and 5.10.

> 
> Keep in mind that during PV network operations grants are used, which
> involve mapping pages at the backend and changing the MMU/IOMMU
> pagetables to introduce the new mapping. After the DMA operation,
> typically the page is unmapped and removed from the pagetable.
> 
> Is it possible that the pagetable change is causing the problem, and
> when the mapping is removed everything goes back to normal?
> 
> I don't know how that could happen, but the mapping and unmapping of the
> page is something ongoing which could break things then go back to
> normal. One thing you could try is to force all DMA operations to go via
> swiotlb-xen in Linux:
> 
> diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c
> index 3d826c0b5fee..f78d86f1bb9c 100644
> --- a/arch/arm/xen/mm.c
> +++ b/arch/arm/xen/mm.c
> @@ -112,8 +112,7 @@ bool xen_arch_need_swiotlb(struct device *dev,
>          * require a bounce buffer because the device doesn't support coherent
>          * memory and we are not able to flush the cache.
>          */
> -       return (!hypercall_cflush && (xen_pfn != bfn) &&
> -               !dev_is_dma_coherent(dev));
> +       return true;
>  }
> 
>  static int __init xen_mm_init(void)
> 
> 
> Then you can remove any iommu pagetable flushes in Xen:
> 
> 
> diff --git a/xen/arch/arm/include/asm/grant_table.h b/xen/arch/arm/include/asm/grant_table.h
> index d3c518a926..b72f8391bd 100644
> --- a/xen/arch/arm/include/asm/grant_table.h
> +++ b/xen/arch/arm/include/asm/grant_table.h
> @@ -74,7 +74,7 @@ int replace_grant_host_mapping(uint64_t gpaddr, mfn_t frame,
>      page_get_xenheap_gfn(gnttab_status_page(t, i))
> 
>  #define gnttab_need_iommu_mapping(d)                    \
> -    (is_domain_direct_mapped(d) && is_iommu_enabled(d))
> +    (0)
> 
>  #endif /* __ASM_GRANT_TABLE_H__ */
>  /*
> 
> 
> I don't know how this could be related but it might help narrow down the
> problem.

We will try your advice and Julien's, to see if the situation improves.

Thank you very much,
Andrei Cherechesu


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 08:42:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 08:42:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567410.886406 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMliI-0005dp-Ci; Fri, 21 Jul 2023 08:42:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567410.886406; Fri, 21 Jul 2023 08:42:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMliI-0005di-9x; Fri, 21 Jul 2023 08:42:14 +0000
Received: by outflank-mailman (input) for mailman id 567410;
 Fri, 21 Jul 2023 08:42:13 +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
 <SRS0=jBn1=DH=arm.com=Rahul.Singh@srs-se1.protection.inumbo.net>)
 id 1qMliH-0005dc-CZ
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 08:42:13 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on061a.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::61a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7ae5984e-27a2-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 10:42:10 +0200 (CEST)
Received: from DUZPR01CA0248.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4b5::21) by AS8PR08MB6519.eurprd08.prod.outlook.com
 (2603:10a6:20b:31c::11) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 08:42:07 +0000
Received: from DBAEUR03FT037.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4b5::4) by DUZPR01CA0248.outlook.office365.com
 (2603:10a6:10:4b5::21) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25 via Frontend
 Transport; Fri, 21 Jul 2023 08:42:07 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT037.mail.protection.outlook.com (100.127.142.208) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6609.28 via Frontend Transport; Fri, 21 Jul 2023 08:42:06 +0000
Received: ("Tessian outbound 997ae1cc9f47:v145");
 Fri, 21 Jul 2023 08:42:06 +0000
Received: from 814f76e212f1.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 3D3E57C1-88BE-486F-BAEC-F2FF1C1E8EA6.1; 
 Fri, 21 Jul 2023 08:41:59 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 814f76e212f1.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 21 Jul 2023 08:41:59 +0000
Received: from PAXPR08MB7154.eurprd08.prod.outlook.com (2603:10a6:102:207::17)
 by PAVPR08MB9037.eurprd08.prod.outlook.com (2603:10a6:102:325::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 08:41:55 +0000
Received: from PAXPR08MB7154.eurprd08.prod.outlook.com
 ([fe80::a407:eeba:ce4c:92fd]) by PAXPR08MB7154.eurprd08.prod.outlook.com
 ([fe80::a407:eeba:ce4c:92fd%4]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 08:41:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7ae5984e-27a2-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=dFLNDGK6ZdG9qBMPg3KqiLFzH1UEEDw3w59IG3wE7vg=;
 b=+SABfGtQ3fWblFZqWRNOe3N5Tcr/JVBYE64Fdw04vpRFXMtbwAOfihJm08MCAyajL7M4QC5YGfYHJJ13z4vg4s3fjxpE2Wd4sv9pRuVO7j+kTOeNDYVoml+ZoM22tlDvMIpqaDNxYzTrQvbiHtJ8iWSDDFV2UzdONZ2gWIp8gaQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 2e65a338c6165768
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=lhIjJIENMnEIQKo0FPCLVpyUbX6IUKPYlqzo21oxHkvq/8aHd6ZecRCRv0BUdQ9R3Mxw5f+hCvTQJE2f3b0h7OEJoy26ESWaIMq6vlSI4PZ1ASgaYWiSQ5MOTaX0nLQLScWJR/RSpMSBzNPIiciSsMg3+u++VZgfQ0anZd6AJO4Q7N+jOE7wk7zDSkYtGK0yMGkZuVQ126sG6zTn9hRjNZvbdkwmIWdNq0weCQEVr7Um9rRKaH1j3Wsaq/2dw8I7dAlv7rFzOMB+CaZVtMuwLGj+kAogHTe8ekAbPG+r2sxH0zDUMwnex2DvQCwquxGrlKt4AZCuAGU+6d0DnvOSoA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=dFLNDGK6ZdG9qBMPg3KqiLFzH1UEEDw3w59IG3wE7vg=;
 b=fiqEbBrsy+//7TPLNt26tdhGakzR6nKYW1uS8CLMMHkXbx7LIaYPlLMy42AiIdKwrdEqbGD45+nGb1c3PpbykEiUseLhxGcSvI+j6zJuteYzgWUr4BaHMeqg6SswbniOwh+cHPpass3MPJGDPkmAhZrc5lCnvH4hIfUZ0XlWYbU/5GFKuGnLhu+I+MszJxOZR5cmZu4+LJWE+76JWqmNf4qT+rfvmafCgguotvOdBdIKMfUTTSBdLsLrz8S156bsQxxbGR2aJYQx3Z65ExCUDRiAShrTkJxsXDuvVR5FYe+k15fqfZkgkN4p/J7Td6UL2L7MzwxQ5hr/ZafHh/5CAA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=dFLNDGK6ZdG9qBMPg3KqiLFzH1UEEDw3w59IG3wE7vg=;
 b=+SABfGtQ3fWblFZqWRNOe3N5Tcr/JVBYE64Fdw04vpRFXMtbwAOfihJm08MCAyajL7M4QC5YGfYHJJ13z4vg4s3fjxpE2Wd4sv9pRuVO7j+kTOeNDYVoml+ZoM22tlDvMIpqaDNxYzTrQvbiHtJ8iWSDDFV2UzdONZ2gWIp8gaQ=
From: Rahul Singh <Rahul.Singh@arm.com>
To: Stewart Hildebrand <Stewart.Hildebrand@amd.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>, Oleksandr
 Tyshchenko <oleksandr_tyshchenko@epam.com>, Artem Mygaiev
	<artem_mygaiev@epam.com>
Subject: Re: [PATCH v2 3/3] [FUTURE] xen/arm: enable vPCI for domUs
Thread-Topic: [PATCH v2 3/3] [FUTURE] xen/arm: enable vPCI for domUs
Thread-Index: AQHZsHVYKpTUBSn+mE6nlUwGgqsPJ6+uJKeAgBWZSQCAAD9oAA==
Date: Fri, 21 Jul 2023 08:41:54 +0000
Message-ID: <EE71E2CE-0CDE-4A18-B5F5-DF62DC0602AB@arm.com>
References: <20230707014754.51333-1-stewart.hildebrand@amd.com>
 <20230707014754.51333-4-stewart.hildebrand@amd.com>
 <9A14CA15-2706-4907-A3D3-9A670CF9BAED@arm.com>
 <38cdc3b4-76de-d657-7fc7-f098ebea9d32@amd.com>
In-Reply-To: <38cdc3b4-76de-d657-7fc7-f098ebea9d32@amd.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	PAXPR08MB7154:EE_|PAVPR08MB9037:EE_|DBAEUR03FT037:EE_|AS8PR08MB6519:EE_
X-MS-Office365-Filtering-Correlation-Id: 4ebb0f54-ce30-4f3d-1b3d-08db89c65d48
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 m6XiYHiDHqGq0yEn0Q2Bq6AsQqxhR+Sy3QW607t6fsGubQMQ9vhEb0/ieqQ6Hwd0g2kCWpxZ8lO2nq/Tppq8WKZQWDO0ss6kj+xOnS5juvmxKcyfB0HUXjkp6dCykyHyrmeZDiSvTha4LCODgJUgJDO0wgLyqdxVPa6NVNmHovrV/wUNNLevU/Fdm6KMF51KdoVzFQ02bvn6pbEmzxcBhtPhXCvMnIvU1XCzTwDQ7akoacwa+5Zn3S3tMSx0XozZsjwsGwTZNqUAhe4Qj0+/vmGmfyl5xO6BbTX6/MX9Xf3ZdQF2iBSfiCJyhs306aJpzaKiufA3rqq6/u/qlsa7u3VkKNjGh9HYoqskA/nJTbktJI/PuCfYuBqX2BcXmQoA2AQs0c6vWLB8Mpe7HZSm5qt9UCpOGdDSw9PF+J89abWT2IiimjnNlk4whbkwJm2JHINEg06Q/ZE4GbWzTt2Tb+wJoWCpQEP3bpnXDbK6xNeVWv6fAqfgQTmk56lXdtmHQernhQ0Ps2B6n/v83/UbSIgBhbDELwNoGZv3ev34yDUv8uhV6VBGcOMRM6ThcppYMLb1NO9UPMw5dvzexHAQePUl1TC+iFd/cqizdRYkl94r7UiwbODtveSYCCwnmC33
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR08MB7154.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(396003)(346002)(366004)(376002)(451199021)(38100700002)(38070700005)(66899021)(2616005)(36756003)(83380400001)(91956017)(76116006)(66446008)(66556008)(66476007)(4326008)(2906002)(478600001)(316002)(66946007)(6916009)(64756008)(71200400001)(6512007)(6486002)(966005)(54906003)(26005)(186003)(41300700001)(8936002)(8676002)(6506007)(53546011)(5660300002)(122000001)(86362001)(33656002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <320E83BC6FD9CE4BAC6A308CB4ED91FB@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9037
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT037.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	d78557a3-702e-4bd0-3724-08db89c65666
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	XKMU6SIRTI5s8wU0Z2nY9wtMBCa2zobVQtc72i85TFkI0+C4F9PH7wxNrmw2B48hf2g5poSkDTKfr+eM5yTQiWb4eB1nY8QGHW7tKdEzHPQQoxcwatqO1Q/VoHFk4tjATPeHH0fxNHhPqJAHv8A7ryRjvXe2V4S4cTNlTvT5crT+rQoxZclQRjsboYIdFgeyEbO63G8CmJBtcDSkNA2is/KZCHhxgA8H5Sb9cN4jS37PaLGsBz5J1sy4mbAYC0pvkNliIp5MQQ9wY633h3g9YA8gNXtQNreQGm19voJfN97x8D/+92qLPZNIeD5ecPjH2rGRJN9/vv2DJ4gJOCb9SQapm1k/NLh0JTyg1zffK/tFYxfj++o3RbMC3uxRnkL1Iv1QlfCPIHbiN7YePB0kB36Nf1vqfwmwXbGHFpKZb/q4UocacO4tm4ZcFlcKgyneKt2Z6gS+zH1vBk5uO5EVMM5yhc3kzXiKtRn63KflBe/+k2N1j4xXcRESzUibpUiZ3BgksR2wbHio1utCpbeLJLTEd87zYKoBUwN/6L2ehpV2F9knDTfrqUOEuOZSdGNqWTQYgJHXiR2iFE7vT81VHZzPeHvNJoAGLHEGxfpyOHOhTmP5hdo8i4dFbCC9T5aweBQ7ExjJ5ClEYP/mHVW3TBLHMBV0DrgujfzL9MbaFNbbib6yFf80ke2jorrczZqdOSw4Q2BVuMjpWaW8ujb4QDK4abFaK/4KchdAxIU0cQE=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(39860400002)(396003)(376002)(451199021)(82310400008)(46966006)(36840700001)(40470700004)(6506007)(40480700001)(53546011)(26005)(186003)(336012)(107886003)(66899021)(40460700003)(6862004)(41300700001)(5660300002)(36756003)(316002)(4326008)(54906003)(70586007)(70206006)(33656002)(478600001)(8936002)(8676002)(966005)(6486002)(6512007)(82740400003)(86362001)(83380400001)(47076005)(2906002)(2616005)(81166007)(356005)(36860700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 08:42:06.4437
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 4ebb0f54-ce30-4f3d-1b3d-08db89c65d48
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT037.eop-EUR03.prod.protection.outlook.com
X-MS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aCBpZiB3ZSB3YW50
IHRvIGF2b2lkDQo+PiAgICAgZW5hYmxpbmcgSEFTX1ZQQ0kNCj4+IA0KPj4gUGxlYXNlIGZpbmQg
dGhlIGF0dGFjaGVkIHBhdGNoZXMgaW4gY2FzZSB5b3Ugd2FudCB0byB0ZXN0IGF0IHlvdXIgZW5k
Lg0KPj4gDQoNCiANClJlZ2FyZHMsDQpSYWh1bA==


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 08:48:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 08:48:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567413.886415 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMloT-0006Hk-2b; Fri, 21 Jul 2023 08:48:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567413.886415; Fri, 21 Jul 2023 08:48:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMloS-0006Hd-Vz; Fri, 21 Jul 2023 08:48:36 +0000
Received: by outflank-mailman (input) for mailman id 567413;
 Fri, 21 Jul 2023 08:48:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=FBlW=DH=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMloR-0006HT-3v
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 08:48:35 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on20615.outbound.protection.outlook.com
 [2a01:111:f400:fe13::615])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5f0889be-27a3-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 10:48:33 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM0PR04MB7074.eurprd04.prod.outlook.com (2603:10a6:208:196::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 08:48:30 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 08:48:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5f0889be-27a3-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ZRLgz0HnpTlyceeD208nB2++m+jDf0DLbaReyYhX1J2Z1Xm0TSpre5PpTdloWR9fuQzgjxXY36473oIRqwGLI+lm7cDazBGt2uJYNhn+iOm1oNRuX7l/zNQnvFfhCxJ3dsGoh7s88TAcgjXhsREmSFE2fK3LLr4WdHZgFoWlk/1xrfB6gTYB/OE8Quq+33QzEkc3/qNLt+UKHbXn3g4GjAePwZWPPGgV/oOmKLiIiBa50cIrC1jTPjjgW4BTheTGvn47bZq1wUWEve4gZ++g3fXsG0BUcnYImbmfi6QEIyUiy4D/S9unGTo0Ycpcc2A9tu3DD2zZxnkblVT6mk3CJg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7+oZB76d4fwc3fm43fnQwwm3jFf+WcExKC0WCwYj3NE=;
 b=dIdqUPWpRqo/IjdGCkO7XtSxz8d/nhVmCYuOzq6AZsm43GgrlRXiAvdBnKWfSxFeHWmwIUSlB0FDuh+o7MbQuXSW+y2Td8rZS9E7UveBdmVBjKoNreg1pf1r39mgL8AMIqC/2svx6lCWKJi1D0w18jqDGPn8rIeoC5q7S35BqzLWFXjn7kDKrv8nhr6LWggaqX2YItBjxmbxO3bpshRMVVKAt/9YRkKyBlWGa42SoA+sFr9ITirierKm3jWWTjkZhDEz8QM+IMuLZvdGKcs6IGdd16Puph/7/9j109XGvvhSaeRjvnnBfQ/5tCP7ErDHSspsiwSysQXH8RVo+RI+/A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7+oZB76d4fwc3fm43fnQwwm3jFf+WcExKC0WCwYj3NE=;
 b=IY48wEoyE/0vQqpboBJGd0iig0lmMXXDr86TRp4toFKcsk/sufBixqMihIcWjneyzgvOmWQAW+g5V247DHf+IWlKOAYHyITYkfx/MXiUY7jMcBTh3TAaIPwxQ6fj58PseEq1eJD8iEct2Si6yExhEY2J8/P04J6wARrnT7UNGGLLu5idtjTnZD9XgK52CcYRQJSAUoricoYsZHD5cxw/QOYOemmkXBVcqLhwFWpCrQyLaV/1tdv6yhIRU/mvKIZ3K854I5ExhIRGMUxOD2T/beLvsthmd/hIIbA+qJyXZwQ9ENaUfEYL6WXN/zLGsaVCH7pjWamBhgQCxsjusZ1L6w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e2a8ec70-6af1-43e9-42da-2a9b265ebe43@suse.com>
Date: Fri, 21 Jul 2023 10:48:27 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <e9331a8c-69b5-b803-7989-7e3b95b815e4@suse.com>
 <ZLldU9ZNM5BRXqeY@MacBook-Air-de-Roger.local>
 <96b95858-c83a-5703-f6b2-6bee852e62e0@suse.com>
 <ZLo3NY2KX-3fuMGr@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZLo3NY2KX-3fuMGr@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0060.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:93::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM0PR04MB7074:EE_
X-MS-Office365-Filtering-Correlation-Id: b2ed24d9-2cff-4d14-1db0-08db89c741a0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	+d9Tgqgni7VE3TbTiLx2qym2dW9+DzCn9lHQIWe1/rQ2LR41YhfiXBeobVFqL948TLIIJ5al5pehr1iG0MOi3SqhFkjc2nzU33aRkyRYtYBe+2nSvL1r5g2b0/97ZY4BEIeUiqQZO933DmpyPHljjcnA4SuBx2mgCMm2vo+FOEYHYY5dmXiUpVFMABPT5UBXkZm8DL/BGW7dwWuUyRcG0a8yEWXOLt/YXDtCOvSr+vP0KmAIHFVaGXAAoI1HglLLWAfm/vmkzbLna8+e1ZfK+jHBltS0hDzazegCLVRp8xy9mDNu5GBZeGCjW3AarBzvJy6AD1uBnix46iIRd7tMKcJ8wh983KpWPujhmZFl45JHl9Ut0cjgCOUAgkw6Fao2l2/VDZFMKYzdfk5J10QwiLUyixC2zF+6q8sIP8G38BW/hR6WeaRf4E3ZBmN2zrRKwfVJG2siZUi4YUvtfRl6c+RxtUZfhma3L9QE1ny2Nm/SRc/s9IbbzEaHhn+JZu5q4XnL8MYmV4OlCOSHd+j3RDMmnAmY676lKy7tgNdQeTtj+Muf9k/vcOVBHKJukwQoZC56upsvPud6qHuxb9hPK6d3+MqGNifuGpCbjSNTdBhhVxKGrQCEiE7r3L52rMJF1bHOOkGvnTAgazvUTzyOsA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(366004)(396003)(39860400002)(136003)(451199021)(53546011)(8936002)(8676002)(6506007)(41300700001)(26005)(5660300002)(186003)(31686004)(31696002)(86362001)(38100700002)(54906003)(83380400001)(6512007)(6486002)(478600001)(66556008)(66476007)(4326008)(66946007)(316002)(6916009)(2906002)(36756003)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UVJ5THM1dmpHVHBUd2Mza1RRM213TTZoN0ZUZkJTdFpUV0dUNmVrWHJReFo3?=
 =?utf-8?B?YmVDOThZQk9KWXZvejJ1SFl0MzUvVWhYbUpRU0VNcHRkcVlVc0hLczJyVTRs?=
 =?utf-8?B?YVVROTBBOTVJbkcvMTUwRVZUanU5S1hpRlFJVFlibVpuK1d2bDM1ZDJxU0Fx?=
 =?utf-8?B?S3dBVmhIQm81YU1YNnFGMlFCTGZhVW5vT055UlkzQVBjeFFyOG5xbVRXVzVX?=
 =?utf-8?B?R0FIYzlVZ1RXbDRMcEdPNE1KTEhaZ05ZNVBKbjM4V25MYVZUMkRUZ2FGNFJD?=
 =?utf-8?B?V2t5VHZ4dlBGODBRQUFiaUpicGRqanBpRFBrbUhCZGIwbG9ZeGhhT0ZraERQ?=
 =?utf-8?B?Q1ZqcGxZMldhNkZkVjhLQUNQeHBuc0pXL3h4aERxTWNRcDVpbmpRaWNzOUFJ?=
 =?utf-8?B?Z1NCemhyaS91aGgwd3hRWUhoeGtycEF5TWk3VEJIY3FxYys4NW1jS3I2RlBV?=
 =?utf-8?B?cVhNWnlobDFTOUZEaVg0Tzg3Mk96U3FOK0JiZW5nSTRwNWhwSFV4TXozRlNN?=
 =?utf-8?B?ejBoN2JnU0hKTVE4ejVTdjVVMEJaQ09GT0NSN3ZrdGlHNm15djIrdThjM3Ax?=
 =?utf-8?B?WFhJS1FHY0s5UXB0eENJdTZhV2lJbUdwQmFZVkd5NWdHMXNTZVJEVjZodFpX?=
 =?utf-8?B?cEJEdnBYS1N5SE9hdHM1cHdzUXhUTHA0MUlmQnhab0FYNzdTVkMwTndQM2tR?=
 =?utf-8?B?c2NZRjFJZlducDNhWWVKYmV5ekFoMmhBMnQ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9Q?=
 =?utf-8?B?Zjhoc3BiVE02WDMzeGRFQU1JaEZ2dnBZQ1ZNazY2UFdPUlRIS25UWGNaeFlq?=
 =?utf-8?B?UlEydStoUkFoNFdSYURtMStwUHphRVZIRE1GTFRBVERXQXdGdnBTY244NCtF?=
 =?utf-8?B?U25IRmJQOWZjWHI5aEc4UHJ6VStIYkY3Ykl4YStpOFRYWnZua2NBZXQ5L3pk?=
 =?utf-8?B?dEhBQURGM09CWDF4TnlZTUIyM05tQ0QzektnVG1OclNoa2pBN2ZoZStGU0pt?=
 =?utf-8?B?a2tJVjYyeEtBL3Jybm5KY2hObUNpekV2cEpFSW9vaEQ0Q1JRcFNvTGwvY3Nl?=
 =?utf-8?B?QkJSMkpTaFkrM1ZjOXR2d21wR1lPUVd2N1ZNMUY2MnJVN3RwbkdBTHhDUWVH?=
 =?utf-8?B?Rm1Bck16K1hIcTdTKzBFOGt4cFJxdEZPTEppbkYzcXM4eXQ0VkFDZTA2MjQ4?=
 =?utf-8?B?TzJXdHN1NjJJaTczUk0xTFZCQ285cmV4cjhPcGRtYk0veGovODczNFhzOUo1?=
 =?utf-8?Q?FJn0fKBTphqvo9pvRfM/XlIa9?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b2ed24d9-2cff-4d14-1db0-08db89c741a0
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 08:48:29.6965
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: jtGTZMnOyI1MJScJXMxrXbx/GMubRQROidCf6Ihsym0W6koggAAFKCCAzpE6iEFM9LHTL4QKTjTs4dt6/c/nWQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7074

On 21.07.2023 09:43, Roger Pau MonnÃ© wrote:
> On Fri, Jul 21, 2023 at 08:02:33AM +0200, Jan Beulich wrote:
>> On 20.07.2023 18:14, Roger Pau MonnÃ© wrote:
>>>  Strictly speaking however the init
>>> handlers don't require the lock in write mode unless we use such
>>> locking to get exclusive access to all the devices assigned to the
>>> domain BARs array for modify_bars().
>>
>> Aiui in the present model modify_bars() has to use the vpci lock for
>> protection.
> 
> But the current protection is insufficient, as we only hold the vpci
> lock of the current device, but we don't hold the vpci lock of the
> other devices when we iterate over in order to find overlapping bars
> (or else it wold be an ABBA deadlock situation).
> 
> So my suggestion (which can be done later) is to take the newly
> introduced per-domain rwlock in exclusive mode for modify_bars() in
> order to assert there are no changes to the other devices vpci bar
> fields.

I think this makes sense, just that it doesn't belong in this patch.

Jan

>> Therefore imo in any of the init functions the assertions
>> should either express the real requirements of those functions, or be
>> omitted on the basis that they're all called out of add-handlers
>> anyway.
> 
> I'm happy to omit for the time being.  Iff we agree that modify_bars()
> requires the rwlock in exclusive mode then we could add the assertion
> there, but not in the init functions themselves.
> 
> Thanks, Roger.



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 08:52:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 08:52:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567416.886425 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMlsY-0007ir-ET; Fri, 21 Jul 2023 08:52:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567416.886425; Fri, 21 Jul 2023 08:52:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMlsY-0007ik-Bn; Fri, 21 Jul 2023 08:52:50 +0000
Received: by outflank-mailman (input) for mailman id 567416;
 Fri, 21 Jul 2023 08:52:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMlsW-0007ie-RQ
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 08:52:48 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMlsW-0007rw-Ct; Fri, 21 Jul 2023 08:52:48 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMlsW-0004By-7H; Fri, 21 Jul 2023 08:52:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=TlGKmbwX3f8XBlhhUlbOJdwbfnLm07TPPMBsxvnMs5Q=; b=rMFRva9QZu2ktAr2mNGHFVMqC/
	JKH8WdV7FVK5TofM7JxembEF0EQvFSfSb0z9zFBTBUYCDBpvffbhFMRLvpzcXAQC2fcYmB4hW41po
	kZRQqtjgVA3NZz0d1VdaTB+TXLefcrSBafEKPMPnrvgJUMAGZqV5OIKds1gU5ONEGcfE=;
Message-ID: <fa58a361-939c-6114-263f-0640156c235b@xen.org>
Date: Fri, 21 Jul 2023 09:52:46 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH] xen/arm: Move TEE mediators in a kconfig submenu
Content-Language: en-US
To: Bertrand Marquis <bertrand.marquis@arm.com>,
 xen-devel@lists.xenproject.org
Cc: jens.wiklander@linaro.org, Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <a44f74559f52d1fa90a3f77390e7d121c9cd848e.1689926422.git.bertrand.marquis@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <a44f74559f52d1fa90a3f77390e7d121c9cd848e.1689926422.git.bertrand.marquis@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Bertrand,

On 21/07/2023 09:02, Bertrand Marquis wrote:
> Rework TEE mediators to put them under a submenu in Kconfig.
> The submenu is only visible if UNSUPPORTED is activated as all currently
> existing mediators are UNSUPPORTED.
> 
> While there rework a bit the configuration so that OP-TEE and FF-A
> mediators are selecting the generic TEE interface instead of depending
> on it.
> Make the TEE option hidden as it is of no interest for anyone to select
> it without one of the mediators so having them select it instead should
> be enough.
> Rework makefile inclusion and selection so that generic TEE is included
> only when selected and include the tee Makefile all the time making the
> directory tee self contained.
The problem is now we will always recurse to the directory even if there 
is nothing to build. I would rather prefer reducing the build time (even 
if here it would be minimal) over "self-contained" directory.

> 
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>

I wasn't able to apply this patch cleanly on the latest staging.

> ---
>   xen/arch/arm/Kconfig      |  7 -------
>   xen/arch/arm/Makefile     |  2 +-
>   xen/arch/arm/tee/Kconfig  | 18 ++++++++++++++++--
>   xen/arch/arm/tee/Makefile |  2 +-
>   4 files changed, 18 insertions(+), 11 deletions(-)
> 
> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> index 439cc94f3344..fd57a82dd284 100644
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -175,13 +175,6 @@ config ARM64_BTI
>   	  Branch Target Identification support.
>   	  This feature is not supported in Xen.
>   
> -config TEE
> -	bool "Enable TEE mediators support (UNSUPPORTED)" if UNSUPPORTED
> -	default n
> -	help
> -	  This option enables generic TEE mediators support. It allows guests
> -	  to access real TEE via one of TEE mediators implemented in XEN.
> -
>   source "arch/arm/tee/Kconfig"
>   
>   config STATIC_SHM
> diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
> index 7bf07e992046..d47d5c20aa73 100644
> --- a/xen/arch/arm/Makefile
> +++ b/xen/arch/arm/Makefile
> @@ -5,7 +5,7 @@ obj-$(CONFIG_HAS_PCI) += pci/
>   ifneq ($(CONFIG_NO_PLAT),y)
>   obj-y += platforms/
>   endif
> -obj-$(CONFIG_TEE) += tee/
> +obj-y += tee/
>   obj-$(CONFIG_HAS_VPCI) += vpci.o
>   
>   obj-$(CONFIG_HAS_ALTERNATIVE) += alternative.o
> diff --git a/xen/arch/arm/tee/Kconfig b/xen/arch/arm/tee/Kconfig
> index 923f08ba8cb7..cecbf7e12b43 100644
> --- a/xen/arch/arm/tee/Kconfig
> +++ b/xen/arch/arm/tee/Kconfig
> @@ -1,7 +1,17 @@
> +menu "TEE mediators"
> +	visible if UNSUPPORTED
> +
> +config TEE
> +	bool
> +	default n
> +	help
> +	  This option enables generic TEE mediators support. It allows guests
> +	  to access real TEE via one of TEE mediators implemented in XEN.

We don't typically add an 'help' section for non-select option. In fact, 
it looks like menuconfig will not show the 'help'.

> +
>   config OPTEE
> -	bool "Enable OP-TEE mediator"
> +	bool "Enable OP-TEE mediator (UNSUPPORTED)" if UNSUPPORTED

Given this is under 'TEE mediators', do we still need the 'if UNSUPPORTED'?

>   	default n
> -	depends on TEE
> +	select TEE

I was sort of hoping we could remove 'select TEE'. But I understand why 
you did it that way, you have one less selection to do. So I am Ok with 
that.

>   	help
>   	  Enable the OP-TEE mediator. It allows guests to access
>   	  OP-TEE running on your platform. This requires
> @@ -13,9 +23,13 @@ config FFA
>   	bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
>   	default n
>   	depends on ARM_64
> +	select TEE
>   	help
>   	  This option enables a minimal FF-A mediator. The mediator is
>   	  generic as it follows the FF-A specification [1], but it only
>   	  implements a small subset of the specification.
>   
>   	  [1] https://developer.arm.com/documentation/den0077/latest
> +
> +endmenu
> +
> diff --git a/xen/arch/arm/tee/Makefile b/xen/arch/arm/tee/Makefile
> index 58a1015e40e0..1ef49a271fdb 100644
> --- a/xen/arch/arm/tee/Makefile
> +++ b/xen/arch/arm/tee/Makefile
> @@ -1,3 +1,3 @@
>   obj-$(CONFIG_FFA) += ffa.o
> -obj-y += tee.o
> +obj-$(CONFIG_TEE) += tee.o
>   obj-$(CONFIG_OPTEE) += optee.o

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 08:53:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 08:53:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567417.886436 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMlsi-00081K-Sb; Fri, 21 Jul 2023 08:53:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567417.886436; Fri, 21 Jul 2023 08:53:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMlsi-00081D-Oc; Fri, 21 Jul 2023 08:53:00 +0000
Received: by outflank-mailman (input) for mailman id 567417;
 Fri, 21 Jul 2023 08:52:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=FBlW=DH=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMlsh-00080b-9M
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 08:52:59 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0625.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::625])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fd72a8e0-27a3-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 10:52:58 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8260.eurprd04.prod.outlook.com (2603:10a6:20b:3e6::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 08:52:55 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 08:52:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fd72a8e0-27a3-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=IDzal5nlBQpmnKu3c+6yQdtdt/n23Bnkxbx+qaU4Wq72KD2FmU9cPWquiEkqCoXEH3tMrGTpYyPky1UCK1xjpkMdiRWyNFZcpN0DEEUPM25XrGSi70BFtlAQvVsUkL4/T91VouxNHEQLnRUaavSauU4MKq/pU+oogVPr20Yt8byc9ASDVe/ZKcAv0OfH1J6NiKZtLu/6H6nbtRlhpwcmHRcc9o+UMKQgd4gSMeR6lDBYGrhoCCksgGGV7w+PGx86PoWjJFsv+pbOem0zwkDbR1RFS9Vj7TIubcOp9LcCPirklNq2Z8oBCLOi7iK57awLVA/d1xzxb/Z+2/FkWL9M3A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=W44X56DAKZ+FZMFVDZ+C054AFIkKyu11ph2HWTpoH8s=;
 b=I6PNbLw3nqPkclyIcPD+7u6hUuR1r6nUBVfvX6+Y/L+Qq9vkhW3fpastNBqacErHLlflEiiTUX6wGHNnNGn3Q5fmYzbG3xDTagqs8G/nlrjb+tdIfC55hoRlNZEmBy6iQnV8vUYrWPTmIwA1OjEvAc1hPJMPqv5/wE8ouKu8RzdTWx0YxIa26XTENJwUxG3AAnkXeaMpo36RtZMXJQKmm/M5TmygiN78TocivyYzfgYew/qFjylHc0VtzRFEkkV0QUblFxPwJ+yTBCkZrQpDMr8REOBbBixY3kMwsj/fmV6aNiVUXxsv0RH94DhTgTI+3PKlc9y2RU3ueMjuygVqkA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=W44X56DAKZ+FZMFVDZ+C054AFIkKyu11ph2HWTpoH8s=;
 b=KD/xRRlYfenPj2GJ1V+7+EvZU9zMuQazHleqEAFjJYoeAOr7BrPfRpixkBqb0CfymMTskO3UjGzNyHzMUQ0nSXFOsnNFrTLVKPazuQgqyUhqRmF4g3xRFhyXI8lrCFepAz3cbhkl1TQJHn9A64JZIa1B+P32ERyxs/elA/jUT0L6aYHLCaY43YzcPICNuYNIlTqBsUhKBr5TkqfX9tHuj11kc3k3Fv+hHuxqS2qzWelay351hRXzKgXbPo1o9Lbdl51mjuPCKhBiNAcR428hM6bVG1nlUx4/gZX0pRViyD0NUZRQRe9m+FR6Zgp6tts/xdUXhYoCfUYG46l15ef5EQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <cb7b53bc-2440-8619-61ce-39c967b56eb7@suse.com>
Date: Fri, 21 Jul 2023 10:52:52 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] xen/arm: Move TEE mediators in a kconfig submenu
Content-Language: en-US
To: Bertrand Marquis <bertrand.marquis@arm.com>
Cc: jens.wiklander@linaro.org, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, xen-devel@lists.xenproject.org
References: <a44f74559f52d1fa90a3f77390e7d121c9cd848e.1689926422.git.bertrand.marquis@arm.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <a44f74559f52d1fa90a3f77390e7d121c9cd848e.1689926422.git.bertrand.marquis@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0164.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:99::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8260:EE_
X-MS-Office365-Filtering-Correlation-Id: 2c43674d-4289-448a-df9a-08db89c7e024
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	KW6neIfe6rxIaCbqKr6QxFwihUEXvzlkdL3BkseQdWPNnSCL5sctkuMGQH1LM9DfS+2WujoYXcTNahyhQKJZ8w9m6+fbLgqLPP0wmOJem+l8HXIxftVtxAAhEN2+UTRa7pUNuqmQav+k+/MKTK/UhKO6i5RZcPKeIN9jfR1vXA3dFx/FtuwXWS65/frZXdeVPRAVAl13/h8AaDWpSLhyRiry6qJVwavZWB3EzvYwR81iFfD3t0h4T82UhvCrzeV/2g2zhR7ADo6+1NdnQoU5zvl4g8TII6nJH1GezA0VKGlRZHvglAeQnbwZ+e2P/A58YN8rOo7B3qOiKovFlIf7J5tH1fEMDjTvACOePwW9TU4WM2Qiqcnq2iecAqJW8H2+Ohejvh3yMDySNYbDvlvhGyZMmWNwI9WKyH15X/cOVZ45IbC4FV+wx1eyvp2OGP5+ptYpSkG4belIjlpDAsXXFO+BSirAVcym9qxZXMI3XtHG0kro5+gWvOyDlAgCin2vMpXX6a05nrwb2GaeqYvYYn5AmMlqvE5YimzbyOQ0DgUf2DHA7ZZGrJ2dzP7YHP7OfIhnfXxQALhTsxMtXBiSkZEtfto3f8X2s5WcB1FEQk/Xkw6yV+Vq2kQk6BgcKb/ndUZ9YycWQyyncFfoubC7iA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(396003)(346002)(366004)(39860400002)(376002)(451199021)(53546011)(26005)(186003)(6506007)(2616005)(4744005)(2906002)(66556008)(66476007)(316002)(4326008)(6916009)(8676002)(66946007)(8936002)(5660300002)(41300700001)(36756003)(6512007)(6666004)(6486002)(54906003)(478600001)(83380400001)(86362001)(38100700002)(31696002)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aWJKWnh4T2M1STJYaGRqOVVCbTZ6SmJYK1hqRXdTYXNwdEFBeGZFNWFrTkpY?=
 =?utf-8?B?Vy9mT0JQUmZzK2lIbDlqcGRCMEVubGxGeUZzZUNMb0VSN2ovdURZMVl3WlVU?=
 =?utf-8?B?L29aWGxwN0YyWldrYTRaT3UyK1YvUFFzMVFWWkxydTNNS3FtVitkQkJQVjhk?=
 =?utf-8?B?bWVaYUZPVm54MWhrekpkZXpPWkM5QnNHUmhWMGVaeDZvejM3RUNYN3dlTzgy?=
 =?utf-8?B?NjBSUlljVFFoZTVCOUVqN1hmWkVIbnk2ZlpiTXp3ZHVBS01FN0s3MFJKRmdh?=
 =?utf-8?B?SGdmTDJjNkhBN000L3JoU3BoOWpwMTQ5cFg1b0FvZUFPekJGUGFXaG5RK0RE?=
 =?utf-8?B?blpFa3AzOEp5bXFudEVTbjZ6Uk1GOEZJSkR1Y0ZVRFBKK01qWlA1SkQ1ckx4?=
 =?utf-8?B?ejQ0MVVpZFgrT1p4RW5tZk9RY041L1d3ZG5ZRFlLQWc5dUlKVzlpWE5QSWt2?=
 =?utf-8?B?R1N5L2RhVUcvOTV6YTZ1RnNPQjd1OCtJYXpndmJWMk1yNW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-8?B?bWt0dUdic1NnTFJOM3NTTXpBYjJPWVF5L0ZvakpOT0RiaUpWVlZEa3lQOWdh?=
 =?utf-8?B?c1pjMmEvWjRycnBLWEEwakhTazRONXBjTTdsR2xxQ0RTZlFCVmoxN3p3Z25U?=
 =?utf-8?B?VDFkcFZMb2Q0V21WWHZuU2RrZ0hvdVFBM2cvTEhBM00yeFV5RERFRWp0L09V?=
 =?utf-8?B?UDYvcVdmZzRhWUU5a2lRdVIvMjJXUUVsY0lGQmJEbytQazkzNVFXNzVzOEVi?=
 =?utf-8?B?RDM5dzN6RVpCcnBaMGFnSHB1M2VKMUJEbEdYNDFJaGhNRDE2b3YzRVlQblV5?=
 =?utf-8?B?SzVhTlQ0cXdBRHhRMndvU2psajRyakFnUWw5QnVuQ3hoeG5qRlFpVnJrSU54?=
 =?utf-8?B?VlNka3ZsZTArR2RtRlhYM2pnNDc3eUlOUlVPcVRhSWg3a0hxRXpjcnJBMTlP?=
 =?utf-8?B?OHdsU2JDOWY5cDF0Vm5HeGt5UkR6UlNiVEFrK3pxdWNVQWF2bmZ2MDJWL1FW?=
 =?utf-8?B?a3p5djFGOXluQlhQSGdHRjhPb2pYVkNkYmFoa1VBb0ZveHNaMXlocTIyUEFr?=
 =?utf-8?B?MmhnWDB6Wnd5c3J1QmYrV0VlSmN5Wnd5b1pROXBkUzZxYVRWTE1IT0N3dGo0?=
 =?utf-8?B?SzRNQzgwNnZVYklKWlRzaklzZ3JKbzF5L3h1WlFqYU5UV0tmakNoSkJxMWt4?=
 =?utf-8?B?aktIbWdoZ2ZkR2lwRVF0bnlmcnA3bVcvQk5EeXFudjFaUnFNV2tsaFMvZWtt?=
 =?utf-8?Q?bzUp+GffN3yu3j8v5O4khsmk2?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2c43674d-4289-448a-df9a-08db89c7e024
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 08:52:55.6138
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 4yIxzqJsEvxjFl7tGuqMMfx6nJ9xJBrtLM/01Ixr3tn5qeyaeLrsZwCUCdZuBSzyva/Z5WXjV6Wrf58+kdDGQw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8260

On 21.07.2023 10:02, Bertrand Marquis wrote:
> --- a/xen/arch/arm/tee/Kconfig
> +++ b/xen/arch/arm/tee/Kconfig
> @@ -1,7 +1,17 @@
> +menu "TEE mediators"
> +	visible if UNSUPPORTED

With this ...

> +config TEE
> +	bool
> +	default n
> +	help
> +	  This option enables generic TEE mediators support. It allows guests
> +	  to access real TEE via one of TEE mediators implemented in XEN.
> +
>  config OPTEE
> -	bool "Enable OP-TEE mediator"
> +	bool "Enable OP-TEE mediator (UNSUPPORTED)" if UNSUPPORTED

... you shouldn't need the "if" here, and ...

>  	default n
> -	depends on TEE
> +	select TEE
>  	help
>  	  Enable the OP-TEE mediator. It allows guests to access
>  	  OP-TEE running on your platform. This requires
> @@ -13,9 +23,13 @@ config FFA
>  	bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED

... you could drop the one here. I think.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 09:03:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 09:03:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567423.886446 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMm2M-0001S1-Nk; Fri, 21 Jul 2023 09:02:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567423.886446; Fri, 21 Jul 2023 09:02:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMm2M-0001Ru-Jq; Fri, 21 Jul 2023 09:02:58 +0000
Received: by outflank-mailman (input) for mailman id 567423;
 Fri, 21 Jul 2023 09:02:57 +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
 <SRS0=So7w=DH=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qMm2L-0001Ro-NP
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 09:02:57 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20617.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::617])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 613776e3-27a5-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 11:02:55 +0200 (CEST)
Received: from AM0PR04CA0143.eurprd04.prod.outlook.com (2603:10a6:208:55::48)
 by PA4PR08MB6000.eurprd08.prod.outlook.com (2603:10a6:102:ed::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul
 2023 09:02:52 +0000
Received: from AM7EUR03FT012.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:208:55:cafe::54) by AM0PR04CA0143.outlook.office365.com
 (2603:10a6:208:55::48) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28 via Frontend
 Transport; Fri, 21 Jul 2023 09:02:52 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT012.mail.protection.outlook.com (100.127.141.26) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.34 via Frontend Transport; Fri, 21 Jul 2023 09:02:52 +0000
Received: ("Tessian outbound 997ae1cc9f47:v145");
 Fri, 21 Jul 2023 09:02:52 +0000
Received: from 7912ab30982e.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 4002C3EE-2F67-4AE8-BD1E-E7AF024CCD39.1; 
 Fri, 21 Jul 2023 09:02:45 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 7912ab30982e.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 21 Jul 2023 09:02:45 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by AS4PR08MB8166.eurprd08.prod.outlook.com (2603:10a6:20b:58d::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 09:02:43 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe%4]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 09:02:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 613776e3-27a5-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=EyCimDxyDREnBe55TyJyqlo4Ls8VeRuPawGlJiu3bBc=;
 b=Hzyug/iwwFr3C5X1MdTCl6Rb3AhRIVeX2JBCgIEmyDW1UTk0X4hE5OI+FwiyYJ6UXti6U5cZffb3jaJw/seP4uAv9wfLvv1HEj3VW18VNLbfkKBIDIpSWnY/nS6Oisg9d6FCPf/GQcrFgtnn+jWRE6Ex2vY65MxLqvW7L9wTCRw=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 0d19a790824a4b42
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=E048ia2B7cRrF3kj67kW/ix7aR+pghBAUDsDzNx4bzZu5znFzZXrrbuUt46jL5jLHrWZdS2iLG/0toIfThy0nUqHYJdtJvWhfYcqMPKcjnBW4h/DkjDRZ8x8IoqSIT0O/2lA/xyYrxu0jBFodtPO2Rhql6LEF6Z8G8mkC9Mt6iKOxQ86zGSZuUWKAJ8/eoas4ju/nrUAEk09UMP6TckK19Z4jlhaeac/2Q0uSTHtwwQcauCvqwrS/FmXlujnlzi8yPopLFDG6YSQHz4FqPtDgL9QqxG8JkcTZiWSpKCcfLbqGlt5piN2t2WaAzkpAIbywivueArAOB8rmKex4FLIhA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=EyCimDxyDREnBe55TyJyqlo4Ls8VeRuPawGlJiu3bBc=;
 b=fM8o22dhgdnpTlu4vyfpBbrmu6XQvKF+wbratX2YkhMF9GNgUMRi44tyS5E+kUojtGLaiRm6U6rGA/wh8lwmARB41uEoNFl9BK/kPBcnSKigfgPU1ng4LmvyY5Ugzjn7NyXRp7Qm0HqoZtRVq9Zh+ziId/BXPtURtIbsgrAelQ8OSIgAc4AcJQR8uu1SDKohE3n13ZTzDaJfd/eJ2AHHlI6IC4QBqvuz+EZgnt3oDMlUo/9JvaI1KFp2M/u/YHCHq3KlJZQJ8TyU6B/HeoWxuGPFgG793ggUxNPVUcGFv0LjVydt4YmQMJCuq9MIY9L628AZxlzlrseb5AzyytDgpg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=EyCimDxyDREnBe55TyJyqlo4Ls8VeRuPawGlJiu3bBc=;
 b=Hzyug/iwwFr3C5X1MdTCl6Rb3AhRIVeX2JBCgIEmyDW1UTk0X4hE5OI+FwiyYJ6UXti6U5cZffb3jaJw/seP4uAv9wfLvv1HEj3VW18VNLbfkKBIDIpSWnY/nS6Oisg9d6FCPf/GQcrFgtnn+jWRE6Ex2vY65MxLqvW7L9wTCRw=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Jens Wiklander <jens.wiklander@linaro.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] xen/arm: Move TEE mediators in a kconfig submenu
Thread-Topic: [PATCH] xen/arm: Move TEE mediators in a kconfig submenu
Thread-Index: AQHZu6nFJdPelAC9nE2wzAZF/5qPkK/D6iMAgAACsoA=
Date: Fri, 21 Jul 2023 09:02:41 +0000
Message-ID: <DFD07AA0-E7E2-400B-8961-A646E5531DF7@arm.com>
References:
 <a44f74559f52d1fa90a3f77390e7d121c9cd848e.1689926422.git.bertrand.marquis@arm.com>
 <cb7b53bc-2440-8619-61ce-39c967b56eb7@suse.com>
In-Reply-To: <cb7b53bc-2440-8619-61ce-39c967b56eb7@suse.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|AS4PR08MB8166:EE_|AM7EUR03FT012:EE_|PA4PR08MB6000:EE_
X-MS-Office365-Filtering-Correlation-Id: b03ae131-67e9-45c0-06c7-08db89c9440d
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 i84EmMZzl4C6NqQEsRUSU5P/xLn052m1I1FN+pobHXQXovY2NdvTfMQwjwYjL0NmoPRwsLbAJPCasFo2D0ZAwvYBC98yLm9/SuQpycSFvMkn6hH/doI3CpArLHCZMzkjYqiMHjIAFP6OY0y90X71FMlX5EIuVcSrmD2u0iWVCBZgcgwhKFjK2iQ3evCM7U4ofCpMEwbjoLenBviQYs0dHC290vXkiwJ8adNUU/a0D1+kIhfyfhpiQBIZL3Yyf4FOtxmxelcaCFa8LehcXuU0eLBBy48MrJNKQuFkjl06N1vTLXst0d6sCgdSHlOQZL7oJA/jw/sGLNfjRrjZf6xTJsi+COoYL6nIgXCuPJZamNJU+dd+bkaTu/fCRZayRS0gCyYHI0k8TOKkQgeKfIkSBPr/7+35OpeAQDFVzcprvcXA1RgjIGcKZpEQiz+4tZ/1K81vMACQNv1qonlyRn01CKe5FfD0ByBbO4pPESEwOuU3WURRDsGqwt3KTtv8yNhqic5MO2dqGeWjJsWfLBQAWLUkEQkuKaDFjW0v/7lDftkwwcFZyGBoFXTkXcNTA/pQCfHa50OeaXNL2tzK7FO2UHPbwNPx+zPF6axO6jnHb2En9Pe8YddlkpkPloUWn9uZgrQJrUIqk6KwyqUSFR4PzQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(366004)(396003)(39860400002)(136003)(451199021)(53546011)(8936002)(8676002)(6506007)(5660300002)(186003)(41300700001)(122000001)(33656002)(86362001)(38070700005)(38100700002)(83380400001)(71200400001)(54906003)(6512007)(6486002)(66556008)(66476007)(91956017)(76116006)(66446008)(66946007)(6916009)(64756008)(316002)(4326008)(2906002)(478600001)(36756003)(2616005)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <D41F10EAF5B5744FAE01066CFC6AFD0B@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB8166
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT012.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	4b714349-0534-4fed-e726-08db89c93d87
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	websTrnBpuWDD9+QYGRJJA2bgj25rraUDuTAILEaIzDidavaMMeudkMO8Ud8td4BaUCj/U3+EiUsKzHrkfA3jbVNbm/ROuvGr7i+G1RdBbMaCEBxsovkagFwICbm3xYFVczifj3RLkXW/xNjjILIsYmkZwlNW0WlVrnHZXNhQADupaVw7oX+FW30XFj/SFPG8LtseYkwrspvuRcgkxFKA5qa3JwAHzFt2A8YGDp0YA+LA47e0uCkJv2FJ8TC+MVPcFf1jNis1xj5Oy+CD54+1NPEn1WyJcSQEsVBst3gzIdwAN5Tvgfs4KDwOimtgCahHFFS0RA8cJu2ukhnPggYDbqjiDaNthQ0dPna6cS8OcLLHHKfI8LS5qaXoBZ/3SQuHH571dHQd7qpe1+mO2uZtwKWxmQfr7f5zzqS6vUlMDB1ZMLcGC+N2Isa1nH4Enayhjs9Ds5teuZGxbIW6T5c39LlI5r8KQAl9zWpqGc5ywD/lrIoAkPwz1SbsCMrPwdJG1gSWDpuizJP1gIdVIRI5lMQCZVn1C/PDaSEM6og0BCH/yJzSmyU0qDtb/oeXuY/wzHF6Qg9ADDGD9bcJfz34t6SGWT/Z8krnrQOgKRO3f9XR3DV6XT4LtueeOwafTguSzu0TC4CiQUArbiRUAwPOekjlW6CeF2/P7KP6CV/vZ1wuBgSpuoBe1Fzjt+5BecnTKVILkKrFZD/0xoDNHfZcsgKteGt7OVDcFaoGNjnndgclFpmhTUN0uJNNHcLE/YZ
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(376002)(136003)(396003)(82310400008)(451199021)(36840700001)(40470700004)(46966006)(6486002)(54906003)(478600001)(2616005)(36860700001)(86362001)(33656002)(36756003)(83380400001)(40480700001)(47076005)(40460700003)(2906002)(186003)(6506007)(336012)(53546011)(26005)(6512007)(356005)(82740400003)(81166007)(41300700001)(4326008)(70586007)(8936002)(70206006)(5660300002)(8676002)(316002)(6862004);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 09:02:52.5568
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b03ae131-67e9-45c0-06c7-08db89c9440d
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT012.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6000

Hi Jan,

> On 21 Jul 2023, at 10:52, Jan Beulich <jbeulich@suse.com> wrote:
>=20
> On 21.07.2023 10:02, Bertrand Marquis wrote:
>> --- a/xen/arch/arm/tee/Kconfig
>> +++ b/xen/arch/arm/tee/Kconfig
>> @@ -1,7 +1,17 @@
>> +menu "TEE mediators"
>> + visible if UNSUPPORTED
>=20
> With this ...
>=20
>> +config TEE
>> + bool
>> + default n
>> + help
>> +  This option enables generic TEE mediators support. It allows guests
>> +  to access real TEE via one of TEE mediators implemented in XEN.
>> +
>> config OPTEE
>> - bool "Enable OP-TEE mediator"
>> + bool "Enable OP-TEE mediator (UNSUPPORTED)" if UNSUPPORTED
>=20
> ... you shouldn't need the "if" here, and ...
>=20
>> default n
>> - depends on TEE
>> + select TEE
>> help
>>  Enable the OP-TEE mediator. It allows guests to access
>>  OP-TEE running on your platform. This requires
>> @@ -13,9 +23,13 @@ config FFA
>> bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
>=20
> ... you could drop the one here. I think.

visible if is only for the GUI/ncurse display but the if is required
to make sure that a .config file cannot set CONFIG_TEE or
CONFIG_FFA if. UNSUPPORTED is not selected.

Bertrand



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 09:05:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 09:05:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567426.886456 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMm4H-0001zZ-2M; Fri, 21 Jul 2023 09:04:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567426.886456; Fri, 21 Jul 2023 09:04:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMm4G-0001zS-Vq; Fri, 21 Jul 2023 09:04:56 +0000
Received: by outflank-mailman (input) for mailman id 567426;
 Fri, 21 Jul 2023 09:04:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=R0zQ=DH=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qMm4F-0001zM-Jl
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 09:04:55 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a82f50ad-27a5-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 11:04:54 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.162.18.33])
 by support.bugseng.com (Postfix) with ESMTPSA id 8C7B94EE0C89;
 Fri, 21 Jul 2023 11:04:52 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a82f50ad-27a5-11ee-b23a-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: [XEN PATCH] x86/cpu-policy: address violations of MISRA C:2012 Rule 8.3 on parameter names
Date: Fri, 21 Jul 2023 11:04:45 +0200
Message-Id: <912cfe8f5b043bddc80cbf9f75cc0b35e02a6ecd.1689929894.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Change parameter names in function declarations to be consistent with
the ones used in the correponding definitions, thus addressing
violations of MISRA C:2012 Rule 8.3: "All declarations of an object or
function shall use the same names and type qualifiers".

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/include/xen/lib/x86/cpu-policy.h | 29 ++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/xen/include/xen/lib/x86/cpu-policy.h b/xen/include/xen/lib/x86/cpu-policy.h
index 6d5e9edd26..bab3eecda6 100644
--- a/xen/include/xen/lib/x86/cpu-policy.h
+++ b/xen/include/xen/lib/x86/cpu-policy.h
@@ -451,23 +451,24 @@ typedef xen_msr_entry_t msr_entry_buffer_t[];
  * Serialise the CPUID leaves of a cpu_policy object into an array of cpuid
  * leaves.
  *
- * @param policy     The cpu_policy to serialise.
- * @param leaves     The array of leaves to serialise into.
- * @param nr_entries The number of entries in 'leaves'.
+ * @param p            The cpu_policy to serialise.
+ * @param leaves       The array of leaves to serialise into.
+ * @param nr_entries_p The number of entries in 'leaves'.
  * @returns -errno
  *
  * Writes at most CPUID_MAX_SERIALISED_LEAVES.  May fail with -ENOBUFS if the
  * leaves array is too short.  On success, nr_entries is updated with the
  * actual number of leaves written.
  */
-int x86_cpuid_copy_to_buffer(const struct cpu_policy *policy,
-                             cpuid_leaf_buffer_t leaves, uint32_t *nr_entries);
+int x86_cpuid_copy_to_buffer(const struct cpu_policy *p,
+                             cpuid_leaf_buffer_t leaves,
+                             uint32_t *nr_entries_p);
 
 /**
  * Unserialise the CPUID leaves of a cpu_policy object into an array of cpuid
  * leaves.
  *
- * @param policy      The cpu_policy to unserialise into.
+ * @param p           The cpu_policy to unserialise into.
  * @param leaves      The array of leaves to unserialise from.
  * @param nr_entries  The number of entries in 'leaves'.
  * @param err_leaf    Optional hint for error diagnostics.
@@ -481,7 +482,7 @@ int x86_cpuid_copy_to_buffer(const struct cpu_policy *policy,
  * No content validation of in-range leaves is performed.  Synthesised data is
  * recalculated.
  */
-int x86_cpuid_copy_from_buffer(struct cpu_policy *policy,
+int x86_cpuid_copy_from_buffer(struct cpu_policy *p,
                                const cpuid_leaf_buffer_t leaves,
                                uint32_t nr_entries, uint32_t *err_leaf,
                                uint32_t *err_subleaf);
@@ -489,22 +490,22 @@ int x86_cpuid_copy_from_buffer(struct cpu_policy *policy,
 /**
  * Serialise the MSRs of a cpu_policy object into an array.
  *
- * @param policy     The cpu_policy to serialise.
- * @param msrs       The array of msrs to serialise into.
- * @param nr_entries The number of entries in 'msrs'.
+ * @param p            The cpu_policy to serialise.
+ * @param msrs         The array of msrs to serialise into.
+ * @param nr_entries_p The number of entries in 'msrs'.
  * @returns -errno
  *
  * Writes at most MSR_MAX_SERIALISED_ENTRIES.  May fail with -ENOBUFS if the
  * buffer array is too short.  On success, nr_entries is updated with the
  * actual number of msrs written.
  */
-int x86_msr_copy_to_buffer(const struct cpu_policy *policy,
-                           msr_entry_buffer_t msrs, uint32_t *nr_entries);
+int x86_msr_copy_to_buffer(const struct cpu_policy *p,
+                           msr_entry_buffer_t msrs, uint32_t *nr_entries_p);
 
 /**
  * Unserialise the MSRs of a cpu_policy object from an array of msrs.
  *
- * @param policy     The cpu_policy object to unserialise into.
+ * @param p          The cpu_policy object to unserialise into.
  * @param msrs       The array of msrs to unserialise from.
  * @param nr_entries The number of entries in 'msrs'.
  * @param err_msr    Optional hint for error diagnostics.
@@ -518,7 +519,7 @@ int x86_msr_copy_to_buffer(const struct cpu_policy *policy,
  *
  * No content validation is performed on the data stored in the policy object.
  */
-int x86_msr_copy_from_buffer(struct cpu_policy *policy,
+int x86_msr_copy_from_buffer(struct cpu_policy *p,
                              const msr_entry_buffer_t msrs, uint32_t nr_entries,
                              uint32_t *err_msr);
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 09:07:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 09:07:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567432.886465 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMm75-0002cD-FZ; Fri, 21 Jul 2023 09:07:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567432.886465; Fri, 21 Jul 2023 09:07:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMm75-0002c6-Ct; Fri, 21 Jul 2023 09:07:51 +0000
Received: by outflank-mailman (input) for mailman id 567432;
 Fri, 21 Jul 2023 09:07:50 +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
 <SRS0=So7w=DH=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qMm73-0002c0-UK
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 09:07:50 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2061d.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::61d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0f7fa0af-27a6-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 11:07:47 +0200 (CEST)
Received: from DB8PR06CA0047.eurprd06.prod.outlook.com (2603:10a6:10:120::21)
 by PAVPR08MB9860.eurprd08.prod.outlook.com (2603:10a6:102:2f4::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 09:07:43 +0000
Received: from DBAEUR03FT023.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:120:cafe::70) by DB8PR06CA0047.outlook.office365.com
 (2603:10a6:10:120::21) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28 via Frontend
 Transport; Fri, 21 Jul 2023 09:07:43 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT023.mail.protection.outlook.com (100.127.142.253) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.34 via Frontend Transport; Fri, 21 Jul 2023 09:07:43 +0000
Received: ("Tessian outbound ba2f3d95109c:v145");
 Fri, 21 Jul 2023 09:07:43 +0000
Received: from 945dda9b1bc1.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 09A08A93-9E4E-4AC3-9C7F-9F3904517B36.1; 
 Fri, 21 Jul 2023 09:07:37 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 945dda9b1bc1.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 21 Jul 2023 09:07:37 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by AS2PR08MB9810.eurprd08.prod.outlook.com (2603:10a6:20b:605::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul
 2023 09:07:35 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe%4]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 09:07:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0f7fa0af-27a6-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=i4f1rTFssjmFsd+63GZ4Eqi/5EzeTrpFEiKa6FbhcdM=;
 b=p0VWnlajhFgb+ooocA+EiAsr9V35W0mzj7QZDAckboIRzaOnshwkCVAf6KxJOjVtvQ+n1FWFXmWVsKel6RwBe/H2zNmyTx+geyYLqChXnXnOpGd8LG+d3Hm/c5xeBp5jS3updNDRtjoJeFqZIrjvMeVxMDpGBC84QXsrchxqj14=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: bb194719756ccf74
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LsiHbK3oJ6RQ3K3PKUjoSI8/7Nyd949rhyjOS142J9HsRP6XQpVM7EmQPIaQND/6nd9PX9IfUgxe2J9omuGbz2xp80CgvY4J/dQXXx8IzvCTZH636zseS1gVQvusP+IFsw9MCpzi/vuzk81khj+9aSAikXdOrS8+S1WIP3GE+MZITbLab+PHiWCQV3iOmbr13svsQNcfOgrA8XqKAw6w+BhgeS+g58hxp4XPtmvFrYFGPBnsJRzj/iHFsQsro6rg4wOLAjUtxFG4Fe8mfH97m+OFi2IYab4dBS9ewft1dxG7UNVjIfUzO1fdoHBruOlvyhR0j4ZCW7WlBO7wJaMtVA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=i4f1rTFssjmFsd+63GZ4Eqi/5EzeTrpFEiKa6FbhcdM=;
 b=JyMhT1Y3bTRJuyswFw8A0Sz0rUIHTvV/jsfJEMziSgUvm1xp6k/CnQr+1CCXkF2eOft8gEhAu4NqFpM0uLDQDfNAkoIHlWU/M964nPwIIygat/Qzjbohz7luBxx7tL4v43tUpfRKu/cHB+T0pX+BgdnUFfPiytXervvc04C9n/MvEu0CCQYF5aMQfRef0/ChZvVkKGn23KRU4Cq/vlz7ivShl8wTPNGELq5FBzEd1e+yvfASOnUafD4knPRPYWmGQ3aqbVNUsutgTlGO79N0AfrqgEEyuWg6xd1CRlwAjsd1poUFekcdh7UE/qlH6//bvGcwl54ksQA+vGrx4dV5Ug==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=i4f1rTFssjmFsd+63GZ4Eqi/5EzeTrpFEiKa6FbhcdM=;
 b=p0VWnlajhFgb+ooocA+EiAsr9V35W0mzj7QZDAckboIRzaOnshwkCVAf6KxJOjVtvQ+n1FWFXmWVsKel6RwBe/H2zNmyTx+geyYLqChXnXnOpGd8LG+d3Hm/c5xeBp5jS3updNDRtjoJeFqZIrjvMeVxMDpGBC84QXsrchxqj14=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, "jens.wiklander@linaro.org"
	<jens.wiklander@linaro.org>, Stefano Stabellini <sstabellini@kernel.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH] xen/arm: Move TEE mediators in a kconfig submenu
Thread-Topic: [PATCH] xen/arm: Move TEE mediators in a kconfig submenu
Thread-Index: AQHZu6nFJdPelAC9nE2wzAZF/5qPkK/D6hwAgAAEFwA=
Date: Fri, 21 Jul 2023 09:07:35 +0000
Message-ID: <9E2CA0D9-1D1C-439B-BD81-8F4A80D034BD@arm.com>
References:
 <a44f74559f52d1fa90a3f77390e7d121c9cd848e.1689926422.git.bertrand.marquis@arm.com>
 <fa58a361-939c-6114-263f-0640156c235b@xen.org>
In-Reply-To: <fa58a361-939c-6114-263f-0640156c235b@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|AS2PR08MB9810:EE_|DBAEUR03FT023:EE_|PAVPR08MB9860:EE_
X-MS-Office365-Filtering-Correlation-Id: 4c4c23d4-a33f-4a82-6443-08db89c9f162
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 UWLpzgndaVVKQzOYw0NYGvlbuzLskLH9pqB8qhF9fOosgo1r9QneEeEUfd9z1FHNrxr7T0JRTvWcgJKXeJnxdkqIQdRTG2tF6jLtncY2vGCYN0yP9XFacfb4LrPXZCAz8/JZfDhf66kaY5j8oPTwKDAbEyI3iYlrc2h62PoCbaOvh6Jb47T2Z+6TyChi1QDP/Xajk92ea/rJWoeVxbde+dTTOqXisOezPJ20UoAptOEgNxe5eYUReyeBR+6OvoTBjosobXboS1nsMNARVx9l7AUODp4sLqgv3x6jL8abhjmfRMC3Q4wwMUEjdayYBb19pD8eMJ1vJcMcLRoTN/ZKnxlt/SEpjDi96BBDHqGKD4QbjFY0hvOYPG1CxnC7bNlsiakDT3NCl8qXA72OrGvrHC0S9NxcNhtSM0TjTrNEsHnSI64thTCqWyWk1VupPl6EIWRgfwyiEeRMW1b/tx0a4B/gfEyDdUwjgJ0qiBG3av8jIxc2ja/aJWQ/2bbSjSqC9/+NVoN1wcNGRwq4yAClu7MCAy5cBwxUjRsQlVFTWH9Tbub5j5+4/7/LpB6iYx9Z1bnl9bTdkL0cQp5cuoZVM6lzqDmYIpq2cSxStl9gsHo50eSda+So8KXzZJxCYkHA/NiODVDnQPdO9BoKZtrQdQ==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(396003)(376002)(366004)(136003)(451199021)(6486002)(478600001)(91956017)(54906003)(71200400001)(36756003)(83380400001)(2616005)(33656002)(38070700005)(86362001)(2906002)(6512007)(6506007)(186003)(66476007)(53546011)(966005)(66556008)(38100700002)(5660300002)(122000001)(316002)(76116006)(8676002)(66446008)(64756008)(6916009)(8936002)(4326008)(66946007)(41300700001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <E8E11C4C3F358345BBE737B850BFC801@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9810
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT023.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	d0852e8e-334f-4b03-853e-08db89c9ec76
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	xNrvfF/iG9jOPD8xN6KmDUw9N8uUdM0ImOzY6SPeAbnAE8gJ212vBTeL/8ANqZtCzFVhNNmkoD2XAm1LmopFzrDqE5Ospl1bCqosAX9R3lNC8IkPvooQpo+wPt02XqrqG3KalrCVlytGpa/l1kQ5MCI2s2LYETYfKkLIkm2xqrKLR3crHqpec2LGZsyYu6Jgi6V4g8p122St/sqCMwFliJnP/vXB3u+fW68npk8SrMNHtonimb4Mhx5oFmuNH1Ym1e9COdPEuD80WQ9fL2Ykjv0U18p94Pbj3E/aWi6P5/rKXZZLvR/UFUuMLnG5melmt/Jp22MqXVSkdJl71m7M1rxvPah4kuwlLiyBkU4lLfPk56cV33q/MPi68AN/P2CiPO2PR0fzuvY+GBPgfxeupnoM0J7uC0ibPdmIuiaTJBVtn9vDohb5r4Q/gbzB0tqqJIRGeF9g3UMm03ACinnL6o5Fo91iam0UyZcPq6eqPLSipKlz+4TJb7z0qRIpm/7UTlUKkZ+oBupigJyObZ7AAmdmcXN+149ZH2JcjCmXzrMcqQqfvpp7xONkHDEqdxGoOFwWCV2mIvVPWwHbw7KnQC/qEsbtJOXTEScO70vCja+G9Lp93URSxQmB2F5QxF35bE2pDXYmgpUWYgx938H19vNeaQbaz8KvzcZjyTME+fEbcJpuxPGsnDhRiylsVDthlqM5AT34ycwFB91Wa7P2Ft8JtDLKJECMZACuQV7VjTQ=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(376002)(346002)(39860400002)(82310400008)(451199021)(40470700004)(46966006)(36840700001)(40460700003)(47076005)(2616005)(26005)(186003)(336012)(6506007)(107886003)(53546011)(36860700001)(83380400001)(4326008)(70206006)(316002)(70586007)(8676002)(6862004)(8936002)(5660300002)(41300700001)(6512007)(6486002)(966005)(2906002)(478600001)(54906003)(40480700001)(82740400003)(356005)(81166007)(33656002)(86362001)(36756003);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 09:07:43.4089
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 4c4c23d4-a33f-4a82-6443-08db89c9f162
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT023.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9860

Hi Julien,

> On 21 Jul 2023, at 10:52, Julien Grall <julien@xen.org> wrote:
>=20
> Hi Bertrand,
>=20
> On 21/07/2023 09:02, Bertrand Marquis wrote:
>> Rework TEE mediators to put them under a submenu in Kconfig.
>> The submenu is only visible if UNSUPPORTED is activated as all currently
>> existing mediators are UNSUPPORTED.
>> While there rework a bit the configuration so that OP-TEE and FF-A
>> mediators are selecting the generic TEE interface instead of depending
>> on it.
>> Make the TEE option hidden as it is of no interest for anyone to select
>> it without one of the mediators so having them select it instead should
>> be enough.
>> Rework makefile inclusion and selection so that generic TEE is included
>> only when selected and include the tee Makefile all the time making the
>> directory tee self contained.
> The problem is now we will always recurse to the directory even if there =
is nothing to build. I would rather prefer reducing the build time (even if=
 here it would be minimal) over "self-contained" directory.

Makes sense, I will restore the obj-$(CONFIG_TEE) +=3D tee/ in the Makfile.

>=20
>> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
>=20
> I wasn't able to apply this patch cleanly on the latest staging.

I will rebase properly and send a v2.

>=20
>> ---
>>  xen/arch/arm/Kconfig      |  7 -------
>>  xen/arch/arm/Makefile     |  2 +-
>>  xen/arch/arm/tee/Kconfig  | 18 ++++++++++++++++--
>>  xen/arch/arm/tee/Makefile |  2 +-
>>  4 files changed, 18 insertions(+), 11 deletions(-)
>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>> index 439cc94f3344..fd57a82dd284 100644
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -175,13 +175,6 @@ config ARM64_BTI
>>     Branch Target Identification support.
>>     This feature is not supported in Xen.
>>  -config TEE
>> - bool "Enable TEE mediators support (UNSUPPORTED)" if UNSUPPORTED
>> - default n
>> - help
>> -   This option enables generic TEE mediators support. It allows guests
>> -   to access real TEE via one of TEE mediators implemented in XEN.
>> -
>>  source "arch/arm/tee/Kconfig"
>>    config STATIC_SHM
>> diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
>> index 7bf07e992046..d47d5c20aa73 100644
>> --- a/xen/arch/arm/Makefile
>> +++ b/xen/arch/arm/Makefile
>> @@ -5,7 +5,7 @@ obj-$(CONFIG_HAS_PCI) +=3D pci/
>>  ifneq ($(CONFIG_NO_PLAT),y)
>>  obj-y +=3D platforms/
>>  endif
>> -obj-$(CONFIG_TEE) +=3D tee/
>> +obj-y +=3D tee/
>>  obj-$(CONFIG_HAS_VPCI) +=3D vpci.o
>>    obj-$(CONFIG_HAS_ALTERNATIVE) +=3D alternative.o
>> diff --git a/xen/arch/arm/tee/Kconfig b/xen/arch/arm/tee/Kconfig
>> index 923f08ba8cb7..cecbf7e12b43 100644
>> --- a/xen/arch/arm/tee/Kconfig
>> +++ b/xen/arch/arm/tee/Kconfig
>> @@ -1,7 +1,17 @@
>> +menu "TEE mediators"
>> + visible if UNSUPPORTED
>> +
>> +config TEE
>> + bool
>> + default n
>> + help
>> +   This option enables generic TEE mediators support. It allows guests
>> +   to access real TEE via one of TEE mediators implemented in XEN.
>=20
> We don't typically add an 'help' section for non-select option. In fact, =
it looks like menuconfig will not show the 'help'.

Yes i kept that one but it can be removed.
Will clean on v2.

>=20
>> +
>>  config OPTEE
>> - bool "Enable OP-TEE mediator"
>> + bool "Enable OP-TEE mediator (UNSUPPORTED)" if UNSUPPORTED
>=20
> Given this is under 'TEE mediators', do we still need the 'if UNSUPPORTED=
'?

As explained to Jan, i used visible if which does not enforce the dependenc=
y, just a hint for the display.

I thought that it was clearer to keep things like that to make it easier to=
 have one of them supported in the future and i added the visible if just s=
o that there was not an empty menu.

I could also just use a
if UNSUPPORTED
 ...

endif

to surround everything if that is clearer.
Please tell me and i will push a v2.

>=20
>>   default n
>> - depends on TEE
>> + select TEE
>=20
> I was sort of hoping we could remove 'select TEE'. But I understand why y=
ou did it that way, you have one less selection to do. So I am Ok with that=
.

The fact that OPTEE or FFA was hidden before TEE was selected was kind of w=
eird i thought.

An other solution is to keep the select and leave TEE visible but I do not =
really see the reason to select TEE without one of optee or ffa selected so=
 i did it like that.

Cheers
Bertrand

>=20
>>   help
>>     Enable the OP-TEE mediator. It allows guests to access
>>     OP-TEE running on your platform. This requires
>> @@ -13,9 +23,13 @@ config FFA
>>   bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
>>   default n
>>   depends on ARM_64
>> + select TEE
>>   help
>>     This option enables a minimal FF-A mediator. The mediator is
>>     generic as it follows the FF-A specification [1], but it only
>>     implements a small subset of the specification.
>>       [1] https://developer.arm.com/documentation/den0077/latest
>> +
>> +endmenu
>> +
>> diff --git a/xen/arch/arm/tee/Makefile b/xen/arch/arm/tee/Makefile
>> index 58a1015e40e0..1ef49a271fdb 100644
>> --- a/xen/arch/arm/tee/Makefile
>> +++ b/xen/arch/arm/tee/Makefile
>> @@ -1,3 +1,3 @@
>>  obj-$(CONFIG_FFA) +=3D ffa.o
>> -obj-y +=3D tee.o
>> +obj-$(CONFIG_TEE) +=3D tee.o
>>  obj-$(CONFIG_OPTEE) +=3D optee.o
>=20
> Cheers,
>=20
> --=20
> Julien Grall




From xen-devel-bounces@lists.xenproject.org Fri Jul 21 09:09:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 09:09:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567436.886476 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMm8y-0003GC-Vd; Fri, 21 Jul 2023 09:09:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567436.886476; Fri, 21 Jul 2023 09:09:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMm8y-0003G5-Si; Fri, 21 Jul 2023 09:09:48 +0000
Received: by outflank-mailman (input) for mailman id 567436;
 Fri, 21 Jul 2023 09:09:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMm8x-0003Fz-5r
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 09:09:47 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMm8w-0008In-GL; Fri, 21 Jul 2023 09:09:46 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMm8w-00053f-B8; Fri, 21 Jul 2023 09:09:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=9Ol14zLqlx7f7FBIzYEiAmk9nVB+uWh+dsHEbR1RS84=; b=iPex2d5PTb5Vm6PtFxbHf11olO
	LMNYrrufNsl1HSc5lHhS/hLGZRgOAG8igBYRgYrW0GR+OYmuAbKLTNQ10QHU9jTIGVlceqJ9N/cCp
	wq/S9Xlm4OmiUyfElcV3TyPwkvdkoBGD6oLzFAdwBmUpgxyjw5Vko+x01x2OjX3InCpQ=;
Message-ID: <b5dc0491-57b7-6899-28ce-86f932b1fc3a@xen.org>
Date: Fri, 21 Jul 2023 10:09:44 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH] xen/arm: Move TEE mediators in a kconfig submenu
Content-Language: en-US
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 "jens.wiklander@linaro.org" <jens.wiklander@linaro.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <a44f74559f52d1fa90a3f77390e7d121c9cd848e.1689926422.git.bertrand.marquis@arm.com>
 <fa58a361-939c-6114-263f-0640156c235b@xen.org>
 <9E2CA0D9-1D1C-439B-BD81-8F4A80D034BD@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <9E2CA0D9-1D1C-439B-BD81-8F4A80D034BD@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Bertrand,

On 21/07/2023 10:07, Bertrand Marquis wrote:
>> On 21 Jul 2023, at 10:52, Julien Grall <julien@xen.org> wrote:
>>> +
>>>   config OPTEE
>>> - bool "Enable OP-TEE mediator"
>>> + bool "Enable OP-TEE mediator (UNSUPPORTED)" if UNSUPPORTED
>>
>> Given this is under 'TEE mediators', do we still need the 'if UNSUPPORTED'?
> 
> As explained to Jan, i used visible if which does not enforce the dependency, just a hint for the display.
> 
> I thought that it was clearer to keep things like that to make it easier to have one of them supported in the future and i added the visible if just so that there was not an empty menu.

Indeed.

> 
> I could also just use a
> if UNSUPPORTED
>   ...
> 
> endif
> 
> to surround everything if that is clearer.
> Please tell me and i will push a v2.

I am happy with the existing version.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 09:24:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 09:24:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567439.886485 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMmMh-0005iV-3s; Fri, 21 Jul 2023 09:23:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567439.886485; Fri, 21 Jul 2023 09:23:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMmMh-0005iO-18; Fri, 21 Jul 2023 09:23:59 +0000
Received: by outflank-mailman (input) for mailman id 567439;
 Fri, 21 Jul 2023 09:23:57 +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
 <SRS0=So7w=DH=arm.com=bertrand.marquis@srs-se1.protection.inumbo.net>)
 id 1qMmMf-0005iG-HG
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 09:23:57 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTP
 id 4fdc006c-27a8-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 11:23:54 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 348F02F4;
 Fri, 21 Jul 2023 02:24:37 -0700 (PDT)
Received: from C3HXLD123V.emea.arm.com (unknown [172.31.20.19])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 89FFA3F67D;
 Fri, 21 Jul 2023 02:23:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4fdc006c-27a8-11ee-8611-37d641c3527e
From: Bertrand Marquis <bertrand.marquis@arm.com>
To: xen-devel@lists.xenproject.org
Cc: jens.wiklander@linaro.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH v2] xen/arm: Move TEE mediators in a kconfig submenu
Date: Fri, 21 Jul 2023 11:23:49 +0200
Message-Id: <c55ce2891172a696e8a29f8c9bcc9dd33ebe9e50.1689931326.git.bertrand.marquis@arm.com>
X-Mailer: git-send-email 2.39.2 (Apple Git-143)
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rework TEE mediators to put them under a submenu in Kconfig.
The submenu is only visible if UNSUPPORTED is activated as all currently
existing mediators are UNSUPPORTED.

While there rework a bit the configuration so that OP-TEE and FF-A
mediators are selecting the generic TEE interface instead of depending
on it.
Make the TEE option hidden as it is of no interest for anyone to select
it without one of the mediators so having them select it instead should
be enough.
Rework makefile inclusion and selection so that generic TEE is included
only when selected and include the tee Makefile all the time making the
directory tee self contained.

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
Changes in v2:
- only included tee subdirectory in makefile if CONFIG_TEE is selected
  (reverts to state before patch)
- remove help in hidden TEE config
- rebase on top of staging
---
 xen/arch/arm/Kconfig      |  7 -------
 xen/arch/arm/tee/Kconfig  | 17 ++++++++++++++---
 xen/arch/arm/tee/Makefile |  2 +-
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 439cc94f3344..fd57a82dd284 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -175,13 +175,6 @@ config ARM64_BTI
 	  Branch Target Identification support.
 	  This feature is not supported in Xen.
 
-config TEE
-	bool "Enable TEE mediators support (UNSUPPORTED)" if UNSUPPORTED
-	default n
-	help
-	  This option enables generic TEE mediators support. It allows guests
-	  to access real TEE via one of TEE mediators implemented in XEN.
-
 source "arch/arm/tee/Kconfig"
 
 config STATIC_SHM
diff --git a/xen/arch/arm/tee/Kconfig b/xen/arch/arm/tee/Kconfig
index db3ea78faaaa..c5b0f88d7522 100644
--- a/xen/arch/arm/tee/Kconfig
+++ b/xen/arch/arm/tee/Kconfig
@@ -1,7 +1,14 @@
+menu "TEE mediators"
+	visible if UNSUPPORTED
+
+config TEE
+	bool
+	default n
+
 config OPTEE
-	bool "Enable OP-TEE mediator"
+	bool "Enable OP-TEE mediator (UNSUPPORTED)" if UNSUPPORTED
 	default n
-	depends on TEE
+	select TEE
 	help
 	  Enable the OP-TEE mediator. It allows guests to access
 	  OP-TEE running on your platform. This requires
@@ -12,10 +19,14 @@ config OPTEE
 config FFA
 	bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
 	default n
-	depends on ARM_64 && TEE
+	depends on ARM_64
+	select TEE
 	help
 	  This option enables a minimal FF-A mediator. The mediator is
 	  generic as it follows the FF-A specification [1], but it only
 	  implements a small subset of the specification.
 
 	  [1] https://developer.arm.com/documentation/den0077/latest
+
+endmenu
+
diff --git a/xen/arch/arm/tee/Makefile b/xen/arch/arm/tee/Makefile
index 58a1015e40e0..1ef49a271fdb 100644
--- a/xen/arch/arm/tee/Makefile
+++ b/xen/arch/arm/tee/Makefile
@@ -1,3 +1,3 @@
 obj-$(CONFIG_FFA) += ffa.o
-obj-y += tee.o
+obj-$(CONFIG_TEE) += tee.o
 obj-$(CONFIG_OPTEE) += optee.o
-- 
2.39.2 (Apple Git-143)



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 10:00:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 10:00:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567446.886495 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMmw0-0001iQ-Sp; Fri, 21 Jul 2023 10:00:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567446.886495; Fri, 21 Jul 2023 10:00:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMmw0-0001iJ-Pz; Fri, 21 Jul 2023 10:00:28 +0000
Received: by outflank-mailman (input) for mailman id 567446;
 Fri, 21 Jul 2023 10:00:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMmvz-0001iD-Km
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 10:00:27 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMmvz-0001Df-5b; Fri, 21 Jul 2023 10:00:27 +0000
Received: from 54-240-197-239.amazon.com ([54.240.197.239]
 helo=[192.168.21.208]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMmvy-0007QY-U0; Fri, 21 Jul 2023 10:00:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=jK6kYuyf8NB48ZWYA+fBHwyjv7MV6sg36Dnuxp9LNIU=; b=SyibLjLnXkQ2wmG2M/2XBKRxYJ
	LFGq6pHFI45mw7BeqzUkGlMiD5lY7hzMH+xwbG6UKrPM2PluIhfaQ4ibStp5Q3O/kvxZQae36nArE
	c9N+RJSGNSMwKO8F+65oa7n5Gnic8tYgGjAe1eZTVah+w4X4izCZ1rOkb715kWg5AvE8=;
Message-ID: <e6d72d9a-a146-733c-0a9b-016fb291c2ea@xen.org>
Date: Fri, 21 Jul 2023 11:00:25 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v2] xen/arm: Move TEE mediators in a kconfig submenu
Content-Language: en-US
To: Bertrand Marquis <bertrand.marquis@arm.com>,
 xen-devel@lists.xenproject.org
Cc: jens.wiklander@linaro.org, Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <c55ce2891172a696e8a29f8c9bcc9dd33ebe9e50.1689931326.git.bertrand.marquis@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <c55ce2891172a696e8a29f8c9bcc9dd33ebe9e50.1689931326.git.bertrand.marquis@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Bertrand,

On 21/07/2023 10:23, Bertrand Marquis wrote:
> Rework TEE mediators to put them under a submenu in Kconfig.
> The submenu is only visible if UNSUPPORTED is activated as all currently
> existing mediators are UNSUPPORTED.
> 
> While there rework a bit the configuration so that OP-TEE and FF-A
> mediators are selecting the generic TEE interface instead of depending
> on it.
> Make the TEE option hidden as it is of no interest for anyone to select
> it without one of the mediators so having them select it instead should
> be enough.
> Rework makefile inclusion and selection so that generic TEE is included
> only when selected and include the tee Makefile all the time making the
> directory tee self contained.

Is this a left over?

> 
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
> ---
> Changes in v2:
> - only included tee subdirectory in makefile if CONFIG_TEE is selected
>    (reverts to state before patch)
> - remove help in hidden TEE config
> - rebase on top of staging
> ---
>   xen/arch/arm/Kconfig      |  7 -------
>   xen/arch/arm/tee/Kconfig  | 17 ++++++++++++++---
>   xen/arch/arm/tee/Makefile |  2 +-
>   3 files changed, 15 insertions(+), 11 deletions(-)
> 
> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> index 439cc94f3344..fd57a82dd284 100644
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -175,13 +175,6 @@ config ARM64_BTI
>   	  Branch Target Identification support.
>   	  This feature is not supported in Xen.
>   
> -config TEE
> -	bool "Enable TEE mediators support (UNSUPPORTED)" if UNSUPPORTED
> -	default n
> -	help
> -	  This option enables generic TEE mediators support. It allows guests
> -	  to access real TEE via one of TEE mediators implemented in XEN.
> -
>   source "arch/arm/tee/Kconfig"
>   
>   config STATIC_SHM
> diff --git a/xen/arch/arm/tee/Kconfig b/xen/arch/arm/tee/Kconfig
> index db3ea78faaaa..c5b0f88d7522 100644
> --- a/xen/arch/arm/tee/Kconfig
> +++ b/xen/arch/arm/tee/Kconfig
> @@ -1,7 +1,14 @@
> +menu "TEE mediators"
> +	visible if UNSUPPORTED
> +
> +config TEE
> +	bool
> +	default n
> +
>   config OPTEE
> -	bool "Enable OP-TEE mediator"
> +	bool "Enable OP-TEE mediator (UNSUPPORTED)" if UNSUPPORTED
>   	default n
> -	depends on TEE
> +	select TEE
>   	help
>   	  Enable the OP-TEE mediator. It allows guests to access
>   	  OP-TEE running on your platform. This requires
> @@ -12,10 +19,14 @@ config OPTEE
>   config FFA
>   	bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
>   	default n
> -	depends on ARM_64 && TEE
> +	depends on ARM_64
> +	select TEE
>   	help
>   	  This option enables a minimal FF-A mediator. The mediator is
>   	  generic as it follows the FF-A specification [1], but it only
>   	  implements a small subset of the specification.
>   
>   	  [1] https://developer.arm.com/documentation/den0077/latest
> +
> +endmenu
> +
> diff --git a/xen/arch/arm/tee/Makefile b/xen/arch/arm/tee/Makefile
> index 58a1015e40e0..1ef49a271fdb 100644
> --- a/xen/arch/arm/tee/Makefile
> +++ b/xen/arch/arm/tee/Makefile
> @@ -1,3 +1,3 @@
>   obj-$(CONFIG_FFA) += ffa.o
> -obj-y += tee.o
> +obj-$(CONFIG_TEE) += tee.o
>   obj-$(CONFIG_OPTEE) += optee.o

Same here? The rest LGTM and I would be happy to do the changes on commit.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 10:02:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 10:02:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567449.886506 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMmxW-0002EN-6y; Fri, 21 Jul 2023 10:02:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567449.886506; Fri, 21 Jul 2023 10:02:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMmxW-0002EG-3f; Fri, 21 Jul 2023 10:02:02 +0000
Received: by outflank-mailman (input) for mailman id 567449;
 Fri, 21 Jul 2023 10:02:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMmxV-0002EA-Gk
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 10:02:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMmxU-0001Ek-Rk; Fri, 21 Jul 2023 10:02:00 +0000
Received: from 54-240-197-231.amazon.com ([54.240.197.231]
 helo=[192.168.21.208]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMmxU-0007Xa-M2; Fri, 21 Jul 2023 10:02:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=ZDO5Nsb0PpfP+K3tpdK4x4UWrHWyTBVKaMLkPJnbiKY=; b=UninlnJFvxcZCjKXxObA6/0kjo
	rdHmSrcTAZBoZFImjniTm1Hd34sdFO0+1RTsPVABLBIzcoxUdQYxhUfCYCZ3f/8cs4Nyny210/Tnh
	cRHNx+NxfTSRd5+7YK06IARe71lstmwkpfjSDW64LUs0k5KoCVE9vaH8ocRLzlS1xhEI=;
Message-ID: <9c1b7c53-f8da-76a2-cc02-7c72a3030be4@xen.org>
Date: Fri, 21 Jul 2023 11:01:58 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] xen/arm: p2m: refactor 'p2m_get_entry'
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <118566cd8b9ebbcedd2b610f5f602cc31c12fd55.1689922099.git.nicola.vetrini@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <118566cd8b9ebbcedd2b610f5f602cc31c12fd55.1689922099.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Nicola,

I would add "to please ECLAIR" in the commit title.

On 21/07/2023 07:49, Nicola Vetrini wrote:
> This function is refactored to avoid using a
> local dummy variable that served as a fallback
> if the parameter 't' is NULL.
> 
> Storing the address of that variable into 't' caused
> static analysis tools not to be able to recognize the

Can you mention which static analysis tools is not happy and the 
version? This could help us in the future if we decided to revert the patch.

> validity of the initialization, and to help with automatic
> checking the two usages of 't' have been slightly refactored.
> 
> No functional changes.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> Suggested-by: Julien Grall <julien@xen.org>
> ---
>   xen/arch/arm/p2m.c | 10 ++++------
>   1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index de32a2d638..05d65db01b 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -496,16 +496,13 @@ mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
>       lpae_t entry, *table;
>       int rc;
>       mfn_t mfn = INVALID_MFN;
> -    p2m_type_t _t;
>       DECLARE_OFFSETS(offsets, addr);
>   
>       ASSERT(p2m_is_locked(p2m));
>       BUILD_BUG_ON(THIRD_MASK != PAGE_MASK);
>   
> -    /* Allow t to be NULL */
> -    t = t ?: &_t;
> -
> -    *t = p2m_invalid;
> +    if ( t )
> +        *t = p2m_invalid;
>   
>       if ( valid )
>           *valid = false;
> @@ -549,7 +546,8 @@ mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
>   
>       if ( p2m_is_valid(entry) )
>       {
> -        *t = entry.p2m.type;
> +        if ( t )
> +            *t = entry.p2m.type;
>   
>           if ( a )
>               *a = p2m_mem_access_radix_get(p2m, gfn);

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 10:08:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 10:08:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567453.886516 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMn3D-0002sq-Qd; Fri, 21 Jul 2023 10:07:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567453.886516; Fri, 21 Jul 2023 10:07:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMn3D-0002sj-No; Fri, 21 Jul 2023 10:07:55 +0000
Received: by outflank-mailman (input) for mailman id 567453;
 Fri, 21 Jul 2023 10:07:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMn3C-0002sd-55
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 10:07:54 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMn3B-0001Ki-7a; Fri, 21 Jul 2023 10:07:53 +0000
Received: from 54-240-197-231.amazon.com ([54.240.197.231]
 helo=[192.168.21.208]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMn3A-0007mR-VR; Fri, 21 Jul 2023 10:07:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=QmNciW+UFf5AYMt5WO+tKxOBZ7mv3Dv6gmlym972ORg=; b=OziNzBYe1yQ71sDoL2IyAKOjhU
	P8gP+ognZG7J8+9GpDT3TQuxygvv0/qXnzRNnSXwP5K1QVectaIlR/a7BV5TUf/hxBud7rBbRxyEC
	yD/5o8JBdwKxM5/vIT/NT1WL9Rez8di7aJReNWUbKK4E3u1e+iCAsfCjQ+R36ZickI7k=;
Message-ID: <d214397a-bffc-0ce9-8126-7878c74e9981@xen.org>
Date: Fri, 21 Jul 2023 11:07:50 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] xen/arm: optee: provide an initialization for struct
 arm_smccc_res
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>
References: <a86604d6c85a0d516b8e29258ffebb2841dc6aff.1689863236.git.nicola.vetrini@bugseng.com>
 <b245a0da-0a21-8405-6744-22b86ba994a5@xen.org>
 <8891a642-853b-7e1c-6d91-21e09793fd51@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <8891a642-853b-7e1c-6d91-21e09793fd51@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 21/07/2023 08:28, Nicola Vetrini wrote:
> On 20/07/23 17:54, Julien Grall wrote:
>> Hi Nicola,
>>
>> On 20/07/2023 15:29, Nicola Vetrini wrote:
>>> The local variables with type 'struct arm_smccc_res' are initialized
>>> just after the declaration to avoid any possible read usage prior
>>> to any write usage, which would constitute a violation of
>>> MISRA C:2012 Rule 9.1.
>>>
>>> This is already prevented by suitable checks in the code,
>>> but the correctness of this approach is difficult to prove and
>>> reason about.
>>
>> So I looked at the implementation of arm_smccc_smc(). For arm64, it is 
>> (simplified):
>>
>> if ( cpus_have_const_cap(ARM_SMCCC_1_1) )
>> Â Â Â  arm_smccc_1_1_smc(__VA_ARGS__);
>> else
>> Â Â Â  arm_smccc_1_0_smc(_VA_ARGS__);
>>
>> In arm_smccc_1_1_smc(), we will explicitly initialize __res:
>>
>> if ( ___res )
>> Â Â  *___res = (typeof(*___res)) {r0, r1, r2, r3};
>>
>>
>> Whereas for arm_smccc_1_0_smc(), we would call assembly function. I 
>> assuming this is the problem?
>>
>> I think this is similar to the discussion we had on set_interrupts() 
>> and dt_set_cells(). If so, couldn't we tell ECLAIR that 
>> __arm_smccc_1_0_smc() will always initialize *res?
>>
> 
> This is slightly different because of the chained variadic macro 
> expansions of arm_smccc_smc. I could have stated that arm_smccc_smc 
> initializes its args, but because it's variadic I can't narrow it down 
> to a specific index, therefore the property is not correct, because the 
> input arguments are instead expected to be read by the macro. The same 
> reasoning applies for all variadic macros that have some input and 
> output parameters, not just this one.
> 
> In the end, if these were fixed-argument functions or macros we can aim 
> for that, and that would obsolete this patch.

They are all ending up to call a fixed-argument macro 
(__arm_smccc_1_0_smc_7()) and then function __arm_smccc_1_0_smc().

Are you suggesting that this would still not be enough for Eclair?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 10:15:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 10:15:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567456.886526 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMnAi-0004MN-EL; Fri, 21 Jul 2023 10:15:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567456.886526; Fri, 21 Jul 2023 10:15:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMnAi-0004MG-B7; Fri, 21 Jul 2023 10:15:40 +0000
Received: by outflank-mailman (input) for mailman id 567456;
 Fri, 21 Jul 2023 10:15:38 +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
 <SRS0=Ists=DH=gmail.com=thierry.reding@srs-se1.protection.inumbo.net>)
 id 1qMnAg-0004M5-LX
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 10:15:38 +0000
Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com
 [2a00:1450:4864:20::633])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 88eaab0b-27af-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 12:15:36 +0200 (CEST)
Received: by mail-ej1-x633.google.com with SMTP id
 a640c23a62f3a-977e0fbd742so278284866b.2
 for <xen-devel@lists.xenproject.org>; Fri, 21 Jul 2023 03:15:36 -0700 (PDT)
Received: from orome (p200300e41f1bd600f22f74fffe1f3a53.dip0.t-ipconnect.de.
 [2003:e4:1f1b:d600:f22f:74ff:fe1f:3a53])
 by smtp.gmail.com with ESMTPSA id
 o19-20020a17090608d300b0098d2f703408sm1960285eje.118.2023.07.21.03.15.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 21 Jul 2023 03:15:34 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 88eaab0b-27af-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689934536; x=1690539336;
        h=user-agent:in-reply-to:content-disposition:mime-version:references
         :message-id:subject:cc:to:from:date:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Xtjou4bw3TzoaU4pkxO6dL/R//dx1dOT1P8B0FqrHKA=;
        b=Tfm+30DQEJ60lYnGshB1LHllAG8vV6tZJlWJu8MaEzgnMoMC4s8xR3p8apQLvVNXrU
         SsCdfj06a4f9s62gn1+m13FZeT8JIaTbP/QLsdb58Wl+Bx3Sk7VWJYPoYNaVX5mC3+q0
         Rs2KjsZnmNUozrNcZGl15QnXalxAHlU6ZCHrH5lsGabvw9HEXfz1EAYPQdbs9ZtUgGmu
         ODgtKVUF0wY54I/IMZWbmr8tof5c0D/hfoTkIzmRnUg+uw27Hm23MiuKX3PpzfRWwdpX
         JSpcBybDwjUfvHgOaPY78806miQgOTtCRT1cm5IQNhbaumSj/5htxDsdm3D+hUCmwISK
         gyVQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689934536; x=1690539336;
        h=user-agent:in-reply-to:content-disposition:mime-version:references
         :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=Xtjou4bw3TzoaU4pkxO6dL/R//dx1dOT1P8B0FqrHKA=;
        b=j1ijaEPpV6udvTS8anVGzQhWq6fL+60D8nWfNuDepFCZBzK53qNFLIp/rKNAU/VBLV
         7ICuh0liUTQ8IZevOf8Qe0RNVPwc3W9AuuQLY64zoS6dWL4SM1fObBPG4u9q+dP00Id+
         nyyF+pw+lBA2cI0N5pg7GdF8EgiELacwwbeR+pFvos9UidqRhgzJtfmbhIhp/l5mYgML
         07GslQ/VfyGyAdr5zpN3My2kRdUZ/u6Agwj6pPaue8F9LyGJpguHyrJQz7FGHTWmy/me
         mLZAclLRGlYUUWxKzm4GAsXpVLRQiHIXGrKUzT2eGSql3XDx8UrEsNStodGUwhMBhEb2
         yH1Q==
X-Gm-Message-State: ABy/qLZvmbRR/GaH0JccO3UTcVzd1DwNtYjAmkY7eim0TeV9gHoVuu5B
	ue+Y0VfwgZnq/2P7XoOXlQ8=
X-Google-Smtp-Source: APBJJlFMSTNXVoDP1pttaZXsGetq1EYUvcvS8mVgRKzhexw1wKgMd76fhF1INGqDgTxi6Ne6bb3VQA==
X-Received: by 2002:a17:906:7691:b0:991:c566:979 with SMTP id o17-20020a170906769100b00991c5660979mr1229678ejm.36.1689934535180;
        Fri, 21 Jul 2023 03:15:35 -0700 (PDT)
Date: Fri, 21 Jul 2023 12:15:32 +0200
From: Thierry Reding <thierry.reding@gmail.com>
To: Rob Herring <robh@kernel.org>
Cc: Liviu Dudau <liviu.dudau@arm.com>, David Airlie <airlied@gmail.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>, devicetree@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, etnaviv@lists.freedesktop.org,
	linux-samsung-soc@vger.kernel.org, linux-mips@vger.kernel.org,
	lima@lists.freedesktop.org, linux-mediatek@lists.infradead.org,
	linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org,
	linux-rpi-kernel@lists.infradead.org,
	linux-renesas-soc@vger.kernel.org,
	linux-rockchip@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] drm: Explicitly include correct DT includes
Message-ID: <ZLpaYPUI5gPd4jK_@orome>
References: <20230714174545.4056287-1-robh@kernel.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="qaVvuRtXrCn2kCOF"
Content-Disposition: inline
In-Reply-To: <20230714174545.4056287-1-robh@kernel.org>
User-Agent: Mutt/2.2.10 (2023-03-25)


--qaVvuRtXrCn2kCOF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Jul 14, 2023 at 11:45:34AM -0600, Rob Herring wrote:
> The DT of_device.h and of_platform.h date back to the separate
> of_platform_bus_type before it as merged into the regular platform bus.
> As part of that merge prepping Arm DT support 13 years ago, they
> "temporarily" include each other. They also include platform_device.h
> and of.h. As a result, there's a pretty much random mix of those include
> files used throughout the tree. In order to detangle these headers and
> replace the implicit includes with struct declarations, users need to
> explicitly include the correct includes.
>=20
> Signed-off-by: Rob Herring <robh@kernel.org>

[Trimming the recipient list so that Google will let me send this]

Test builds were fine, so I've pushed this to drm-misc now.

Thierry

--qaVvuRtXrCn2kCOF
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAmS6WsQACgkQ3SOs138+
s6HK1A//QgDGQj/2Xez0LhGk60CphNT160FLxq+/4O2qQdzBoldz2WfYizMz+Qyv
OCph/RC4Vp2VJEySeVU8jjojJZtqnu3iVQ9LGC/L7EFFJQOwaNlGusy3FoWAp5i1
tAMhZUBH/QCvLjoc7kQXt+MjZGx/ccGHcmckwnjP1DVERdSUqXtq8VU1FHDxiQ2Q
WfE9WhlNsXzJzcGXKC9qEKcn/OdrvPHgmAMJ7ypyjQ9z1x1/oEsJH6Bj0oIaiF2+
R1Lt+KO5tvnL4ozutwZoHX4rPL9qQ9NvBwvk3DdxxaDs4R5Hhin5rkKhs6SvVbBX
8bOTy7u1WaKQWaGEhGnnQzpaK3bp1n9L9Ooc/VtUaBx1iRZ8EsJmVfdNC8527L14
0pH0DNOHHZDuTKd14C/W8JKsSrMtqPml41UClQC8AQ69iSfq95AbcajnFXcpamF6
nYbTpBL+EOukFj5EJppNc0Bg3R0HdXvz9DmBx0qMt9cFAbq05D+4ke/aTKCDv0nM
eQij9GV8h4g7wsmXWfFYqnbVk2K8G8KqsjEZakqkbUYE0i4tUs+O8g1piw1aXQis
gX6QIVmBbi4PjPh2TWik5FCLogKMIqVDCuUfG/LJIQzypr/7QnSP6XpvyqjWiWua
t1LWo/rbraFTe/hnaRqOUgOfKnfXRN3fZFxHW5CHGIwET0BUK9s=
=UVD4
-----END PGP SIGNATURE-----

--qaVvuRtXrCn2kCOF--


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 10:37:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 10:37:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567460.886536 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMnVR-0006tS-B3; Fri, 21 Jul 2023 10:37:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567460.886536; Fri, 21 Jul 2023 10:37:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMnVR-0006tL-8L; Fri, 21 Jul 2023 10:37:05 +0000
Received: by outflank-mailman (input) for mailman id 567460;
 Fri, 21 Jul 2023 10:37:04 +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
 <SRS0=jBn1=DH=arm.com=Rahul.Singh@srs-se1.protection.inumbo.net>)
 id 1qMnVQ-0006tF-Di
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 10:37:04 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on0623.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::623])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 84f597e9-27b2-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 12:36:59 +0200 (CEST)
Received: from DUZPR01CA0292.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4b7::14) by DBAPR08MB5606.eurprd08.prod.outlook.com
 (2603:10a6:10:1a7::8) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 10:36:54 +0000
Received: from DBAEUR03FT054.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4b7:cafe::9f) by DUZPR01CA0292.outlook.office365.com
 (2603:10a6:10:4b7::14) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28 via Frontend
 Transport; Fri, 21 Jul 2023 10:36:54 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT054.mail.protection.outlook.com (100.127.142.218) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6631.16 via Frontend Transport; Fri, 21 Jul 2023 10:36:54 +0000
Received: ("Tessian outbound f1e964b3a9be:v145");
 Fri, 21 Jul 2023 10:36:54 +0000
Received: from da1145fe2a98.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 7F23F167-B756-4F73-93A9-C7C47C4C85F0.1; 
 Fri, 21 Jul 2023 10:36:47 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id da1145fe2a98.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 21 Jul 2023 10:36:47 +0000
Received: from PAXPR08MB7154.eurprd08.prod.outlook.com (2603:10a6:102:207::17)
 by PAWPR08MB9519.eurprd08.prod.outlook.com (2603:10a6:102:2f1::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 10:36:46 +0000
Received: from PAXPR08MB7154.eurprd08.prod.outlook.com
 ([fe80::a407:eeba:ce4c:92fd]) by PAXPR08MB7154.eurprd08.prod.outlook.com
 ([fe80::a407:eeba:ce4c:92fd%4]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 10:36:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 84f597e9-27b2-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=thf/3fRjPmdmOHYJeagHcFu9W/3eormBtGT2dNpwAlo=;
 b=tfZg8IhDEPKoTgD8z24VRyBBH6xVDbGrEVTePDAf+U9DzphyI1E4gFQyWuteT20arAEfl8wIF3xmN1hh9RarSuBjkdGWVePqtAY55WxIyN9vDVR3HXDUJAWWhag2pzyymi9PNcJPLBXe0v3Y7gsWY5cDO+GvUfEd387zBXMQv/I=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: d1a1332eeeeacd2a
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=bPwKfIyJpxmiWxskWioSuxuamVC1j5hbkPpDLiHgaQVRt+lgAGAXPGBxavXGMrZZVXCZQXijQui5sYfbCmpugFa5UXyCLTbXXV6zfgDnX8Kq5gRklNff4x723E5G43kJxRg/lexZEzK1jahMc3B4Q97mGXATaOiJWhxhC4OBhPOv3FCVoAudH8x+FGgFjkK0WbbQ39dybNm/PhrCaOUCBgTon9EOQUjjKmgXcFLRd7Hf5MzJ6kBVOBYwIB2qNXM9P+4vntRkrkWSIPWNl9eZ4664lFY5FMDTARc1Kh7Iec1+9GvLSzkySo4/BajWQvVWpYkDaLxUTQuYybq6sh/+ZQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=thf/3fRjPmdmOHYJeagHcFu9W/3eormBtGT2dNpwAlo=;
 b=krsDIUrX28jwDVicJibwvlNCLfh+RnGLRcj4SyEfcXvYAc9we6GeA5DjjS5HPsxTIX+dEYATY2ycb3VaGhAIE3ddeSNH3dcTQc+tQIgzB09izvD43TGJKqsw5z97beSL3AP4HStlJ9dhPe/EHbGoqzKqNFxYjWdJZRfeHSIfg2EQTykdYY+XCvqw5LxiJ9d5UfpXpSE1Tr5ODAr66GpecWlh5k4WlzhhH8wxl3E7YT4z2Or/dSahxADYSI270KtHk/USf153IQW1DnhfWgdw5dlHdBMZiyZKtblQczeSR3lVbjWrWi32iQy4Bu6nPu+9FXZhMBNlPhWmw8sV+mRQmA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=thf/3fRjPmdmOHYJeagHcFu9W/3eormBtGT2dNpwAlo=;
 b=tfZg8IhDEPKoTgD8z24VRyBBH6xVDbGrEVTePDAf+U9DzphyI1E4gFQyWuteT20arAEfl8wIF3xmN1hh9RarSuBjkdGWVePqtAY55WxIyN9vDVR3HXDUJAWWhag2pzyymi9PNcJPLBXe0v3Y7gsWY5cDO+GvUfEd387zBXMQv/I=
From: Rahul Singh <Rahul.Singh@arm.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH v8 05/13] vpci/header: implement guest BAR register
 handlers
Thread-Topic: [PATCH v8 05/13] vpci/header: implement guest BAR register
 handlers
Thread-Index: AQHZuqGsyq2xz4eSA0OJuZWqMM1tia/ECRaA
Date: Fri, 21 Jul 2023 10:36:46 +0000
Message-ID: <72733AB9-1912-4C28-A6AC-88D147778E73@arm.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-6-volodymyr_babchuk@epam.com>
In-Reply-To: <20230720003205.1828537-6-volodymyr_babchuk@epam.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	PAXPR08MB7154:EE_|PAWPR08MB9519:EE_|DBAEUR03FT054:EE_|DBAPR08MB5606:EE_
X-MS-Office365-Filtering-Correlation-Id: b3e8010a-9117-4d18-1dd6-08db89d666a5
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 m1hU7AkvwonSv9zR1sZzRL8f5qSN0uvxvPjZQoIkQZorrQ53jvQuViB5FxGd6UUH7ZvqvknHD1vPjZmkvFuN4GO/DFAVqp7I0DzTL9f41f0ssfN96tyrwffkbG4JrJ3CuyckGpLnPze9c0zHb4c6FylFNmaeehEgPknjHm/HA5EvVLl9PsQLdQQhmna+fyF3kKAvZun5xnYw3nA8mY9z2WQc2Z3WfUtvlLV5AdVD9u16lAtkgVfQpDRfTx48tmXYLB21AoF1zuIVqNx5Cg9e4l4eZYrRgo3k7IDdeTnSoxty13SZzAaHmsi7cgqFhp4F3kNKrYq3Co9vZT3pBtXnSJok+WvZFb3N6ujFl5cSmRpVGlPqxfMq+0j4TgicOlFIUcz1E4ARUElVjK8v3lmJ4rWv5Gz1I4xr9d6OchnIgNkEGuzwqiPw7AmBEecUwF7vg4OsztoceOAwua8DxeS7Bxvil/wXCpMZxXkPLBhHbYMIGoIuWEShFyw3RaOVewFLVrLx/WUB8s9QeqEF0ovBC/IXUDdT8zfuMwSKgqUIQcSsxA/shRfoFdN/fESTGTqtaOSBZzFpNn7EU2VbqlDsBFetfOBt5g4xFRkTFFTk/UZmOTd0JO4kCwwEqC8o2IgkZRjIOajgTdERB8qTy0NHGg==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR08MB7154.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(366004)(39860400002)(346002)(376002)(451199021)(38100700002)(38070700005)(2616005)(36756003)(83380400001)(91956017)(76116006)(66446008)(66556008)(66476007)(4326008)(2906002)(478600001)(316002)(66946007)(6916009)(64756008)(71200400001)(6512007)(6486002)(54906003)(26005)(186003)(41300700001)(8936002)(8676002)(6506007)(53546011)(5660300002)(122000001)(86362001)(33656002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <FDDEFDA1ED0993418278F50C488C3843@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9519
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT054.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	fabb51e3-d599-4ccd-76e2-08db89d661d7
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	ic6qZNkZnhfl5lbI5kcv43rIklV57rv4ZeAM0d4tL6WSDrNBydu7ajWaXm1CraazEiamZB24IirTtTk5qWRlesPVlAJZavqgKxf5bbV15Z3Gtfngib6/4BZ6FoKXIEKFXS+PpXhSYcv8zLVRrh7gBo8qxJz9to0jmXppdzpRJmeYoQR0hEABNgutUCVMnPWpM7i5SIZqJcqJor8jMqMI0gCjT0Rut690cSdc0r6/k+zMVT5Ip5UAeCnYOACU3oxVjMUFmai7sYBfOOb3YhSMkv/dWslXVYz9NJyoZSrwnOOgCM62UwjTz6W50Pt/l3yKMM9eLtPGq+ONNo8HdsH7mr6tQPP4KaR7IG97XNrh+N7aojYHI+5UMBUmbbOweFNF792qiHQ+Qu5J872SGicTUq+xDGTzIe/WGDdJQHbhI7gv1lNpxWpJHfpWPTxOTwJX+2f7wb1tlC/F+raLqf5p3BcG57jiEda4peamV23yn9zpZlLV3vJKg0iIS3Cmt28bS7QG3sXE9uGql5eI5+kl63P7WngVkGM/3qawBQyJZeEh1qv+kjUfRi/tHIG2E4ErzgUIli9scKMlqGZnEytuuL8rkxa63FnxTDZ+qaCLag3PgMNpsEu3NMuUj7uv+1XA+r7sTQfvNEDRobfqZqmY01YZDV40VDJIkyUxvQ7to71HiLDRU3bKTdl0Czuqw5qESywwE89NeAuGmgPqGuq7+aB1fR8MNkGhl5H5CXe8kKL8a9KB+SphcvWqGNmyuEgY
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(136003)(39860400002)(376002)(451199021)(82310400008)(46966006)(40470700004)(36840700001)(6506007)(40480700001)(53546011)(336012)(186003)(107886003)(26005)(40460700003)(6862004)(41300700001)(5660300002)(36756003)(316002)(4326008)(70586007)(54906003)(70206006)(33656002)(478600001)(8936002)(8676002)(6486002)(6512007)(82740400003)(86362001)(47076005)(2906002)(2616005)(83380400001)(81166007)(356005)(36860700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 10:36:54.1160
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b3e8010a-9117-4d18-1dd6-08db89d666a5
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT054.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR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AgICAgICAgICAgIGlzX2h3ZG9tID8gdnBjaV9od19yZWFkMzIgOiBndWVzdF9iYXJf
cmVhZCwNCj4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNfaHdkb20gPyBi
YXJfd3JpdGUgOiBndWVzdF9iYXJfd3JpdGUsDQo+ICsgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgIHJlZywgNCwgJmJhcnNbaV0pOw0KPiAgICAgICAgICAgICBpZiAoIHJjICkNCj4g
LSAgICAgICAgICAgIHsNCj4gLSAgICAgICAgICAgICAgICBwY2lfY29uZl93cml0ZTE2KHBkZXYt
PnNiZGYsIFBDSV9DT01NQU5ELCBjbWQpOw0KPiAtICAgICAgICAgICAgICAgIHJldHVybiByYzsN
Cj4gLSAgICAgICAgICAgIH0NCj4gKyAgICAgICAgICAgICAgICBnb3RvIGZhaWw7DQo+IA0KPiAg
ICAgICAgICAgICBjb250aW51ZTsNCj4gICAgICAgICB9DQo+IEBAIC01NzMsNiArNjM4LDE3IEBA
IHN0YXRpYyBpbnQgY2ZfY2hlY2sgaW5pdF9iYXJzKHN0cnVjdCBwY2lfZGV2ICpwZGV2KQ0KPiAg
ICAgICAgIGlmICggKHZhbCAmIFBDSV9CQVNFX0FERFJFU1NfU1BBQ0UpID09IFBDSV9CQVNFX0FE
RFJFU1NfU1BBQ0VfSU8gKQ0KPiAgICAgICAgIHsNCj4gICAgICAgICAgICAgYmFyc1tpXS50eXBl
ID0gVlBDSV9CQVJfSU87DQo+ICsNCj4gKyNpZm5kZWYgQ09ORklHX1g4Ng0KPiArICAgICAgICAg
ICAgaWYgKCAhaXNfaHdkb20gKQ0KPiArICAgICAgICAgICAgew0KPiArICAgICAgICAgICAgICAg
IHJjID0gdnBjaV9hZGRfcmVnaXN0ZXIocGRldi0+dnBjaSwgZW1wdHlfYmFyX3JlYWQsIE5VTEws
DQo+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWcsIDQsICZiYXJz
W2ldKTsNCj4gKyAgICAgICAgICAgICAgICBpZiAoIHJjICkNCj4gKyAgICAgICAgICAgICAgICAg
ICAgZ290byBmYWlsOw0KPiArICAgICAgICAgICAgfQ0KPiArI2VuZGlmDQo+ICsNCj4gICAgICAg
ICAgICAgY29udGludWU7DQo+ICAgICAgICAgfQ0KPiAgICAgICAgIGlmICggKHZhbCAmIFBDSV9C
QVNFX0FERFJFU1NfTUVNX1RZUEVfTUFTSykgPT0NCj4gQEAgLTU4NCwxNCArNjYwLDIwIEBAIHN0
YXRpYyBpbnQgY2ZfY2hlY2sgaW5pdF9iYXJzKHN0cnVjdCBwY2lfZGV2ICpwZGV2KQ0KPiAgICAg
ICAgIHJjID0gcGNpX3NpemVfbWVtX2JhcihwZGV2LT5zYmRmLCByZWcsICZhZGRyLCAmc2l6ZSwN
Cj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGkgPT0gbnVtX2JhcnMgLSAxKSA/IFBD
SV9CQVJfTEFTVCA6IDApOw0KPiAgICAgICAgIGlmICggcmMgPCAwICkNCj4gLSAgICAgICAgew0K
PiAtICAgICAgICAgICAgcGNpX2NvbmZfd3JpdGUxNihwZGV2LT5zYmRmLCBQQ0lfQ09NTUFORCwg
Y21kKTsNCj4gLSAgICAgICAgICAgIHJldHVybiByYzsNCj4gLSAgICAgICAgfQ0KPiArICAgICAg
ICAgICAgZ290byBmYWlsOw0KPiANCj4gICAgICAgICBpZiAoIHNpemUgPT0gMCApDQo+ICAgICAg
ICAgew0KPiAgICAgICAgICAgICBiYXJzW2ldLnR5cGUgPSBWUENJX0JBUl9FTVBUWTsNCj4gKw0K
PiArICAgICAgICAgICAgaWYgKCAhaXNfaHdkb20gKQ0KPiArICAgICAgICAgICAgew0KPiArICAg
ICAgICAgICAgICAgIHJjID0gdnBjaV9hZGRfcmVnaXN0ZXIocGRldi0+dnBjaSwgZW1wdHlfYmFy
X3JlYWQsIE5VTEwsDQo+ICsgICAgICAgICAgICAgICAgICAg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wOw0KfQ0KIA0KUmVnYXJkcywNClJhaHVs


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 10:38:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 10:38:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567464.886546 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMnWu-0007RX-MK; Fri, 21 Jul 2023 10:38:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567464.886546; Fri, 21 Jul 2023 10:38:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMnWu-0007RQ-J3; Fri, 21 Jul 2023 10:38:36 +0000
Received: by outflank-mailman (input) for mailman id 567464;
 Fri, 21 Jul 2023 10:38:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMnWt-0007RG-E5; Fri, 21 Jul 2023 10:38:35 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMnWt-00022c-0k; Fri, 21 Jul 2023 10:38:35 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMnWs-0005gv-MW; Fri, 21 Jul 2023 10:38:34 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMnWs-0001dR-Kd; Fri, 21 Jul 2023 10:38:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=/WRmZAlnzR8i9tZ8w6BtEP7OH95F07vlO2xsv+FSZZM=; b=Wso0riJS1Fd+DEHQl2CrennPG0
	S79L0xg8WgZDFOGZuGGPUib3P1t8tGZq3PYg64QmLqWNlQoDznqC0GmJIGNSTMt0KN6spBuuXZDhn
	s+9oSRhFXqWTaqrcoSrpMlNUcdunM8fCgxtB0dhO8NzLz1Lq+oBmu2OFUuQgewQ2wRlU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181927-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181927: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-libvirt-pair:xen-install/dst_host:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=4bf014c6f7d7cc9a9e017cef0eb5ff4bf27526e9
X-Osstest-Versions-That:
    xen=b1c16800e52743d9afd9af62c810f03af16dd942
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 21 Jul 2023 10:38:34 +0000

flight 181927 xen-unstable real [real]
flight 181950 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181927/
http://logs.test-lab.xenproject.org/osstest/logs/181950/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-libvirt-pair 11 xen-install/dst_host fail pass in 181950-retest
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 181950-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181904
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181904
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181904
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181904
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181904
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181904
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181904
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181904
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181904
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181904
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181904
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181904
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 xen                  4bf014c6f7d7cc9a9e017cef0eb5ff4bf27526e9
baseline version:
 xen                  b1c16800e52743d9afd9af62c810f03af16dd942

Last test of basis   181904  2023-07-19 14:48:14 Z    1 days
Testing same since   181927  2023-07-20 13:41:22 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Federico Serafini <federico.serafini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Luca Fancellu <luca.fancellu@arm.com>
  Stefano Stabellini <sstabellini@kernel.org>
  Tamas K Lengyel <tamas@tklengyel.com>
  Yang Xu <yang.xu@mediatek.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 fail    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   b1c16800e5..4bf014c6f7  4bf014c6f7d7cc9a9e017cef0eb5ff4bf27526e9 -> master


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 10:39:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 10:39:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567469.886556 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMnXO-0007yU-3A; Fri, 21 Jul 2023 10:39:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567469.886556; Fri, 21 Jul 2023 10:39:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMnXO-0007yN-03; Fri, 21 Jul 2023 10:39:06 +0000
Received: by outflank-mailman (input) for mailman id 567469;
 Fri, 21 Jul 2023 10:39:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMnXM-0007y2-TF; Fri, 21 Jul 2023 10:39:04 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMnXM-00024e-SP; Fri, 21 Jul 2023 10:39:04 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMnXM-0005jR-ID; Fri, 21 Jul 2023 10:39:04 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMnXM-0002a5-Hi; Fri, 21 Jul 2023 10:39:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=x04SAI3xoD+9evBP60+6KyOJaDfxMgAu3nIOWQENlw4=; b=JZz1gXcuV9Bgao1Az6izsiBzsC
	wtLALDv4lNW6Q6DBCHq73EVqb8Y0nDLzOZtsZO8tSiuZk2Ab9+n/Uiw/RLYSM0EJ2yxWpXcGZCXUG
	mLMV284U+k586BB8TqLK3tKNRrpHuQ4SVHRKNdqXzHoMgQMnW/6xuougC2guHPHCV2Ng=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181948-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181948: regressions - FAIL
X-Osstest-Failures:
    xen-unstable-smoke:build-arm64-xsm:xen-build:fail:regression
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:build-check(1):blocked:nonblocking
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=0c53c638e16278078371ce028c74693841d7738a
X-Osstest-Versions-That:
    xen=1ab2ae1610d99423af5b810829959431e43de12d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 21 Jul 2023 10:39:04 +0000

flight 181948 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181948/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-arm64-xsm               6 xen-build                fail REGR. vs. 181941

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-xl-xsm       1 build-check(1)               blocked  n/a
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  0c53c638e16278078371ce028c74693841d7738a
baseline version:
 xen                  1ab2ae1610d99423af5b810829959431e43de12d

Last test of basis   181941  2023-07-20 23:03:34 Z    0 days
Testing same since   181948  2023-07-21 07:00:24 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Federico Serafini <federico.serafini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Juergen Gross <jgross@suse.com>
  Julien Grall <jgrall@amazon.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-arm64-xsm                                              fail    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      blocked 
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 0c53c638e16278078371ce028c74693841d7738a
Author: Juergen Gross <jgross@suse.com>
Date:   Fri Jul 21 08:32:43 2023 +0200

    tools/xenstore: fix XSA-417 patch
    
    The fix for XSA-417 had a bug: domain_alloc_permrefs() will not return
    a negative value in case of an error, but a plain errno value.
    
    Note this is not considered to be a security issue, as the only case
    where domain_alloc_permrefs() will return an error is a failed memory
    allocation. As a guest should not be able to drive Xenstore out of
    memory, this is NOT a problem a guest can trigger at will.
    
    Fixes: ab128218225d ("tools/xenstore: fix checking node permissions")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>

commit 65fc6d8c92bc339d8ed874c5821e0e65101f6c52
Author: Federico Serafini <federico.serafini@bugseng.com>
Date:   Fri Jul 21 08:32:15 2023 +0200

    x86/mtrr: address violations of MISRA C:2012 Rule 8.3 on parameter types
    
    Change parameter types of function declarations to be consistent with
    the ones used in the corresponding definitions,
    thus addressing violations of MISRA C:2012 Rule 8.3 ("All declarations
    of an object or function shall use the same names and type qualifiers").
    
    No functional changes.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

commit 652d8fbb8182f0b9a57ba371c24d21e0a981ee07
Author: Federico Serafini <federico.serafini@bugseng.com>
Date:   Fri Jul 21 08:31:42 2023 +0200

    x86/HVM: address violations of MISRA C:2012 Rules 8.2 and 8.3
    
    Give a name to unnamed parameters thus addressing violations of
    MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
    named parameters").
    Keep consistency between parameter names and types used in function
    declarations and the ones used in the corresponding function
    definitions, thus addressing violations of MISRA C:2012 Rule 8.3
    ("All declarations of an object or function shall use the same names
    and type qualifiers").
    
    No functional changes.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>

commit 60576722d0523122ce34c81b91fd1eafac8f7f5f
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri Jul 21 08:31:09 2023 +0200

    x86/vRTC: move and tidy convert_hour() and {to,from}_bcd()
    
    This is to avoid the need for forward declarations, which in turn
    addresses a violation of MISRA C:2012 Rule 8.3 ("All declarations of an
    object or function shall use the same names and type qualifiers").
    
    While doing so,
    - drop inline (leaving the decision to the compiler),
    - add const,
    - add unsigned,
    - correct style.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

commit cd5048353725f37746da231202feaf5b88ceb46a
Author: Nicola Vetrini <nicola.vetrini@bugseng.com>
Date:   Fri Jul 21 08:30:29 2023 +0200

    xen: address MISRA C:2012 Rule 4.1
    
    MISRA C:2012 Rule 4.1 has the following headline:
    "Octal and hexadecimal escape sequences shall be terminated."
    
    The string literals modified by this patch contain octal or
    hexadecimal escape sequences that are neither terminated by the
    end of the literal, nor by the beginning of another escape sequence.
    
    Therefore, such unterminated sequences have been split into a
    separate literal as a way to comply with the rule and preserve the
    semantics of the code.
    
    No functional changes.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 10:46:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 10:46:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567487.886589 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMne0-0001Nk-2T; Fri, 21 Jul 2023 10:45:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567487.886589; Fri, 21 Jul 2023 10:45:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMndz-0001Nd-W0; Fri, 21 Jul 2023 10:45:55 +0000
Received: by outflank-mailman (input) for mailman id 567487;
 Fri, 21 Jul 2023 10:45:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=FBlW=DH=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMndy-0001NV-Av
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 10:45:54 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20610.outbound.protection.outlook.com
 [2a01:111:f400:7d00::610])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c39e4c72-27b3-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 12:45:53 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB8156.eurprd04.prod.outlook.com (2603:10a6:10:246::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul
 2023 10:45:50 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 10:45:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c39e4c72-27b3-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Ld08XqxJT7sM2QVDO8ykPZrz8wPKwAVS0q97AKlCxeY5EiGcU4GlVNmfajA2J9EhSlLz/aLyYdUaMBEP0cg5A8BVzm0tBFvzLNA/DUcT5eysiM15kqfBnlRbwJnXE7vH5nn78JTnEBsvO2I5uxBy+5g2kDzU8dvH62xvrDm/23nLwlM5Lf7Sh9DA1XIX5fQoV1g6cevm2dArp1yUw/aSseBZAHCDz7KqsPFcV87TOLaNG19gjhDlv20jlrx6UA5Z85rA/87/7fQWPp3QIHMmbr5rLlIBDUDYJhGLK7bllPhVPzRXsc5dPXxVrk89L8lpQWt2rPhdfnwtezgFCBmItw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OAIP3lDRJAe/1FYN5CHROmmafD7SbM7hOzIbHZn6KTM=;
 b=kysdVPV/jE3OG9emxsxMzl6rwpBX/DI8Vfyvkgdbi+WcP/l6TIH5lnq95JgjzaggMDkIoSdHndNjO0YlIm3qAn0c3M4V7CcP67QNwzZRAAYew2iRtaU+8bHF/o5E5LcKio5bqpmUyZWTvfi83L/PILw4fXUqF8IVMKJJI8pAKINIbK6gQ+1q3RyuqhtBUZFqjlaGFOzyPN4ULJXtgO2WglRHRvTatUrS+d/CAg6ly2G2I06793b4fi4ttey48mPviXVTL8de1qRBY+pSoMw3SxJ4MiLpMY3WyJ9H68ADSaw14gTuCuliDIRWMyQS/6FmfUyg6kW03ET0ran/B6PvFA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OAIP3lDRJAe/1FYN5CHROmmafD7SbM7hOzIbHZn6KTM=;
 b=X8fFMXY6TUSXI/BOKv3PJjGFc7iXganuM2UEc8wLbTWBi1z8HZ9ThWkX28vbG794+bEZq+MaspgTImF2tjKAVWZJzcx4icXKLj0yQFbICgmOzYcE+7bWvpzRWg9GwKjv7eLyhWEaDmW4XmPHb8bLo5rqeFTb/Fulma3bH7JdCxo8bgCec7fkbFukytGvhPGmBzzqGAAsRCKBZaCJw1khmiozJuo8AYuOOyOgmPckwz/phY7Vrs8eCkHFeXwvUm0MLWjjsTEVo9/jWtu7acEOALOLfX79TbwXEmv1J/yFkGvR4AgYW6xZBdvWPM/y0cS0FhZpJKvGi3z911sbjKmmZQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <6b24847c-5cd2-877a-bc72-16bb732e0ca2@suse.com>
Date: Fri, 21 Jul 2023 12:45:47 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] xen/arm: Move TEE mediators in a kconfig submenu
Content-Language: en-US
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Jens Wiklander <jens.wiklander@linaro.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <a44f74559f52d1fa90a3f77390e7d121c9cd848e.1689926422.git.bertrand.marquis@arm.com>
 <cb7b53bc-2440-8619-61ce-39c967b56eb7@suse.com>
 <DFD07AA0-E7E2-400B-8961-A646E5531DF7@arm.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <DFD07AA0-E7E2-400B-8961-A646E5531DF7@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0106.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a3::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB8156:EE_
X-MS-Office365-Filtering-Correlation-Id: 1901c4ff-7ad0-4ac3-0d47-08db89d7a5f2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	KIDhwRrUxfBL3EzCpqHINWLe07bFOqArrAaSdowQM0E2U9lTtuSayA9YOPWJedw/JopHpdKi1smNbyVqXS2fl2hQogRz7xgPuz3XCxbCOLGICskfAj5GXzs6rKO+gTln5DbnFLR9e56NfA4PRgjZLGLIp4tTpJHZZOlZQIOsKuzMqVJy4kmSF4rgRX6YU93tcJb9fyMg1YOoJXQW2xjpQONe+8I7pdNzvDZnNyi6GWbU9QForlSjuXrsn2GbB4ukpi5UPCKVgtCcEZXg835JeC5EvGXSiseI0x2gs81a/OOCxdsoFf+qu/myNhBz3BcugS0A7YYAqWi0dsdLUzvKcm4+P18v9sss3OR8lRnhI2VYDEzWTnXlqE7oZSUKkCTq3lKPVp447fV3q1DYwhuTV3iYT2ElPfA7+oP69r4dxzVXHmq1YfcRDdYsTIY99h6fmbCcjQRt0OH+xdzGHjtr65cy7UsNgtJFYIffCn+7NLLHjAV69DBQEmI7+6Z8GLgP2peCiUirHAwgkHINYc2dbS1uF+Q5tY55uQAslNjwx75qh5GIigxaO1xIG5L7KDuVkTWowYzCr+BlCR4CmPRIy+iQh7S7f0YNeUXJqQMFA+pELu02Pms413Zk6NP7230b9E8/QHODz2ikYJwj3+OvrQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(136003)(39860400002)(346002)(396003)(366004)(451199021)(36756003)(31696002)(86362001)(2906002)(31686004)(186003)(83380400001)(53546011)(26005)(6506007)(38100700002)(6512007)(6486002)(478600001)(54906003)(6666004)(66556008)(66946007)(4326008)(6916009)(2616005)(316002)(5660300002)(8936002)(66476007)(41300700001)(8676002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZnM1WEVDY0p0VU1yaDNpL095SWUySUhSWnIyM1pZc1FHck9qVkxyMTRWWWxh?=
 =?utf-8?B?ck1pQjlhMlRGVHl3a24rbUo2UXpWYkx4eEJZTFNBL1BWZEw1UnBHK3FqYlJz?=
 =?utf-8?B?REk2OHNYWjR1bGZiTWxiWm9DNVNlNlBIcjY1SE5uMU9GS1lBbDlJb3ZMbFFU?=
 =?utf-8?B?blRzVFE3b1U0QW1xV0Nrbml1V2RXdUhjUlJpMmpORXFJSUdvcEtwdmNBeUtB?=
 =?utf-8?B?UEEzc20vVExYREVPNW5sL0ZvUW9xK1ZJam5BYTRLS3ZTbGZodUhjclArRmRa?=
 =?utf-8?B?QjcvVHZ3MmlBOVViWHF0WkxVUHRjc0NBRlB0VHhwZFRNdTJ0Z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mMk1YTzlncWF5WVY5dk1pRk8yS3lHbFMvcmpzT3Vm?=
 =?utf-8?Q?tVbL8323OEGK4fUc9Gdtzv4Cp?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1901c4ff-7ad0-4ac3-0d47-08db89d7a5f2
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 10:45:49.9765
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: G0wQFxHY6S3JGFO/VGiUTKoq7WxCePzqbrx1ZjOsXNKjmeMy2f5fzeEnZq8qsUaMPH61ndGtg8Cm5ODY18QiMA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8156

On 21.07.2023 11:02, Bertrand Marquis wrote:
>> On 21 Jul 2023, at 10:52, Jan Beulich <jbeulich@suse.com> wrote:
>> On 21.07.2023 10:02, Bertrand Marquis wrote:
>>> --- a/xen/arch/arm/tee/Kconfig
>>> +++ b/xen/arch/arm/tee/Kconfig
>>> @@ -1,7 +1,17 @@
>>> +menu "TEE mediators"
>>> + visible if UNSUPPORTED
>>
>> With this ...
>>
>>> +config TEE
>>> + bool
>>> + default n
>>> + help
>>> +  This option enables generic TEE mediators support. It allows guests
>>> +  to access real TEE via one of TEE mediators implemented in XEN.
>>> +
>>> config OPTEE
>>> - bool "Enable OP-TEE mediator"
>>> + bool "Enable OP-TEE mediator (UNSUPPORTED)" if UNSUPPORTED
>>
>> ... you shouldn't need the "if" here, and ...
>>
>>> default n
>>> - depends on TEE
>>> + select TEE
>>> help
>>>  Enable the OP-TEE mediator. It allows guests to access
>>>  OP-TEE running on your platform. This requires
>>> @@ -13,9 +23,13 @@ config FFA
>>> bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
>>
>> ... you could drop the one here. I think.
> 
> visible if is only for the GUI/ncurse display but the if is required
> to make sure that a .config file cannot set CONFIG_TEE or
> CONFIG_FFA if. UNSUPPORTED is not selected.

Is what you describe "depends on"? "if" controls merely prompt
visibility aiui.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 10:50:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 10:50:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567490.886598 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMniS-0002pY-Ib; Fri, 21 Jul 2023 10:50:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567490.886598; Fri, 21 Jul 2023 10:50:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMniS-0002pR-Fx; Fri, 21 Jul 2023 10:50:32 +0000
Received: by outflank-mailman (input) for mailman id 567490;
 Fri, 21 Jul 2023 10:50:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=FBlW=DH=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMniR-0002pG-0E
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 10:50:31 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on062e.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::62e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 685b699d-27b4-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 12:50:29 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU2PR04MB8950.eurprd04.prod.outlook.com (2603:10a6:10:2e1::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul
 2023 10:50:26 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 10:50:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 685b699d-27b4-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=iX2DCCcDvmngJuaX+C9Eo0nfGRhLOxnGpzTMC/6JdC6FfdJKDwI/RA/kR9hvjFgQQgEi1GMf66qxqXAJN58BD1thCnu3rj+tWjAKhLGlZeYsIlNOm8v9285WNAhix0FNR04IzjJBPuvCuK7fOCfOs83KGNCMHFxG8P+T1XTcb+9rny8RhpU1u+NB/MNSpk/dMSkXJ1I3JmXdo1ytXJJ2/K343zlFNvQXbUhacnhLAhRmr4DZOMnA7k9YLFquE1FwzLbKV9TU1QUYe33vBRTLCsXfXHl+I0JjgtR24xYaQNqloAvxl1h2EHJjiR9M/SMhSeVXO4IRuIMJJrGpAElqsQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5Ntcxhg/KtwPYaAGDIN2bQOBKdO4oDmjQx2D7ckifUM=;
 b=nViarJxg90pbBd9JcvvgcAXe5ZkggL3NcZj6xpAcLNeU83erMepdkltgAjTu5DIVujvguXgJo5IuqSCLLs9hp/j71Dn8h8vd9s4gAGcvwKSTydg3lTNkrmBF3kJaKiKIIGStV6qcWxbddVq62hos7dpBbiMA9GKkV4apcoV03UmdNXnet6E8pXrBc7YlNBlEAo7egX1l3+PRdCRBDSeUCqJ7d05iorxp+rqu9CxxFK0RHeiWb4YwAK1BWfxqEZ/xjwXX09c+bexROqlLuVqiHKo+sRo1VHuHEOenjKPQ5kRM0iQX8/W4ccZ3JPK9fbn/e8nX3RlOyOeu9+5tLALFIA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5Ntcxhg/KtwPYaAGDIN2bQOBKdO4oDmjQx2D7ckifUM=;
 b=fcgvF6gYrWwpOK7s4Yvx5Sn3clVFHnYgPkpHvfq2xGBoBm/reA9RnXVCJtJeSlvoNx0sfSPh1Lb/jmjJpidI1ASjlSJmdkByQmuIoSZ6yBa/q1PslnHMJvgaExsWxD0XevFlUG8Da/9PPoDJgUxRAD1h6RgSsjyedEUkD8v7uKC0DZyCK+gFJ8y80MQK318VZx4huc9nGv/SojDOeC2YxRnzzs99YYxPk78diVJRRfnjYuMOUFBjjumrGv0MiaAtC9PjDZxehevJpUPaW/kycEeG8wrzHAJEkdbL7yEYPN0C5b2o/Yl8syZM5Kiu8uJymozP6kv2/SSbFDihtNgO8A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ec6c97dd-a333-6927-06bf-46ae44f9007d@suse.com>
Date: Fri, 21 Jul 2023 12:50:23 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 05/13] vpci/header: implement guest BAR register
 handlers
Content-Language: en-US
To: Rahul Singh <Rahul.Singh@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-6-volodymyr_babchuk@epam.com>
 <72733AB9-1912-4C28-A6AC-88D147778E73@arm.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <72733AB9-1912-4C28-A6AC-88D147778E73@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0233.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b2::6) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU2PR04MB8950:EE_
X-MS-Office365-Filtering-Correlation-Id: bcb4e2fe-f3d0-48c5-a6f9-08db89d84a92
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	VVlrX3/sh1P9MRT6rDw5afGlePVr2NjfoSfm+8FcGcyg7ideBn4D93v1bWmnpoBPaulLyhf/mSf6aaYOHIn5bjP0XTyGYxCMzBsfemmi+qgh7MHdk4PD/iEl4b+D6OszGeMozEXkaXPdPmvJcWWvraqP93M9FsiuGj+NgKiA2Uc1XgPYcl8JxZMI1qsd/5kDgul+iOAOV3/Cto60SN5FX/j5XT7GE8x6H+ZWa7DSY0jA96wIL3zwXptQcm63QsCKYibjSG+xHuCqKnqa2xYpr4ogX0gEyC1c9NLD18Ubet3rqY4GoLFvRTnhrDwNjLy5TEvVxrjEpX73z/VM30vWj5niXqsx5D9n4D9TtTQeQe5o2jgaqtO9jRdwogSoGSuDcQzsDFLG6vYzO3M2HU1ounGjoVlL+YVUPLBphhVAbhpQVwAs85CAPmW2ghR7k2x7RlHw4gWdWUetvzw6UYcbEcYAGZ1s0GdiHiVjR7FqRKS3+hm5HHzI+EHlTLAmOniB/XA3q0U7Y+ckKk/SRpc8PW4GfzxFp/tv6zgCi1FSjulvvynHWOo1SV78FkoIeoRnZscw2H6CdWklPvoPl9Oks8/2vPsBEYCjqbALnK+vnSL3Aizmiq8d5zXluJsihwJ0i46vEE/oTUNu08EqIn+lpg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(39860400002)(376002)(346002)(136003)(451199021)(36756003)(31696002)(86362001)(31686004)(53546011)(6486002)(6666004)(478600001)(110136005)(54906003)(38100700002)(6506007)(186003)(6512007)(26005)(2616005)(5660300002)(8936002)(8676002)(4326008)(316002)(66556008)(4744005)(2906002)(66476007)(66946007)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-Mess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TRyS2o5bTdo?=
 =?utf-8?B?SWFVUENaMjMrVXdjSnVabHdRNUFDbFJHV294dTNyd3BIZUszaDMvb3Mzd0dQ?=
 =?utf-8?B?WDVkWDk0bmxFR3BmTHFDWVY5aklKNGN6cUI5RXg0K2tRb2l3TVB5ZDd3bkla?=
 =?utf-8?B?N2FINlV3U0dyS1BtM1FaYUVpTG5yOUw5a2sxNTFUcTNpSlRMZVhKNmQzWnBx?=
 =?utf-8?B?dVo5Z1Y4aTZpUkVEOTNqampxdzdjNmdGS3FlVGVnMWVRQWhXeGdzb2lxWnVX?=
 =?utf-8?B?NWR3cWpwcUFSeG9HcWI0enYvRERUQzBrTEVCTGlaMWV1RGYzM2NEejNJZ1hm?=
 =?utf-8?B?dTAvVWVGNFJhMVRVaXQ1OGVhUUlxQmdjMXNoVzNNangvcHpPYlkxZmVpa2dF?=
 =?utf-8?B?MWdyMjJVRFZsOXFQeTNBazluaHJpd3IrQ2R0dmVNUG5WSmJ3RTNMZllLbW56?=
 =?utf-8?Q?VCr0AOSZPtH+wC88pm8zjTN/o?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bcb4e2fe-f3d0-48c5-a6f9-08db89d84a92
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 10:50:26.0979
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: xQYxffo9nXD0gup/MjIAXliCo5r7QAP7hOHDQqRn+cI3Nsq7OMQN3Oj/3td1UqPdvo/Ymso1ut//dji4uDIe2A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8950

On 21.07.2023 12:36, Rahul Singh wrote:
>> On 20 Jul 2023, at 1:32 am, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com> wrote:
>> @@ -599,34 +681,50 @@ static int cf_check init_bars(struct pci_dev *pdev)
>>         bars[i].size = size;
>>         bars[i].prefetchable = val & PCI_BASE_ADDRESS_MEM_PREFETCH;
> 
> I think there is a need to set the BAR mem type and prefetchable bit to the 
> guest_reg also to avoid mismatch when Guest kernel initially read the BARâ€™s.

Perhaps more generally: Shouldn't r/o bits be handed through in almost
all cases?

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 11:50:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 11:50:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567497.886615 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMoeX-0000tK-32; Fri, 21 Jul 2023 11:50:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567497.886615; Fri, 21 Jul 2023 11:50:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMoeW-0000tD-VE; Fri, 21 Jul 2023 11:50:32 +0000
Received: by outflank-mailman (input) for mailman id 567497;
 Fri, 21 Jul 2023 11:50:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dNy0=DH=citrix.com=prvs=559993d03=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMoeU-0000t2-Ds
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 11:50:30 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c81657d4-27bc-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 13:50:28 +0200 (CEST)
Received: from mail-mw2nam10lp2103.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.103])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 21 Jul 2023 07:49:56 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by MN2PR03MB5005.namprd03.prod.outlook.com (2603:10b6:208:1a2::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 11:49:54 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Fri, 21 Jul 2023
 11:49:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c81657d4-27bc-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689940227;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=i/64G+VxsntXQCDfs68RSMXInkh2KmwKsgtD3J+iJ+4=;
  b=cxPGcAYTvVBOg54LOrWm/5RD811uPrt7uL5YHGYXQRXA/0+aiAfTOW/b
   9NGFJmHJhhV8c9jUevMjBSH/gTNiUY+BLSWIt0NsOPVWAGCMerNyiTX7P
   /Znlo/yqpswmIMauQTNYpRpzAXrsLoba0JcRRjNlXj6dlxFac/0MiLwkA
   o=;
X-IronPort-RemoteIP: 104.47.55.103
X-IronPort-MID: 116284130
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:t7M4Jqz5N4P7eMlg5IF6t+fwxyrEfRIJ4+MujC+fZmUNrF6WrkUCm
 jQZC2rQOayOZ2r3L9gnb963pEpX7cfdyNNlHFNv+SAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhP6kT5TcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KW5Jz
 +0aeCkJVTyGl9Om7eqmeNEr2tt2eaEHPKtH0p1h5RfwKK9+BLX8GeDN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjWVlVQquFTuGIO9ltiiX8Jak1zev
 mvb12/4HgsbJJqUzj/tHneE37aRx3OnAdlKfFG+3tgxikev10wtMzEfWXCKitaCkHS+XPsKf
 iT4/QJr98De7neDcN75WBGppW+eiTQVUdFQDu4S5RmEz+zf5APxLngJSHtNZcIrsOcyRCc2z
 RmZktXxHzttvbaJD3WH+d+8ije/OjMcK2MYUgYCQREY+NnooIw1jRXnQ85qFei+ididJN3r6
 zWDrSx7gqpJi8cOjv2/5Qqe22nqoYXVRAko4AmRRnii8g5yeI+iYcqv9ETf6vFDao2eSzFto
 UQ5piRX18hWZbnlqcBHaLhl8G2BjxpdDADhvA==
IronPort-HdrOrdr: A9a23:vBXziKj9b8OWMvMMUbQi0lQ8YXBQXrkji2hC6mlwRA09TyX4ra
 CTdZEgviMc5wx9ZJhNo7q90cq7IE80i6Qb3WB5B97LYOCMggeVxe9Zg7ff/w==
X-Talos-CUID: =?us-ascii?q?9a23=3ASQUvRmqIpNczqWDGHwmx7JXmUc8iSGzfnG7UGGO?=
 =?us-ascii?q?9GVd5ZeWIe2fXpLwxxg=3D=3D?=
X-Talos-MUID: 9a23:HIICmwhKBffhs//GG7BIZsMpEpxi+Zi/KH42vZwKkPivGhdqATeapWHi
X-IronPort-AV: E=Sophos;i="6.01,220,1684814400"; 
   d="scan'208";a="116284130"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=jWd/d/Ddj29TuLW5snPewHW4W3mcrshE8IuVZMWQlDOH5benqbh8W8MWEoSIRTQH07fUfQOhkpPyVqQhPVp9LCjqM1WCx760AW+LYJChiy1bjnBuf0F3PFHKG401lRxUcd2+89t8pTDoqHs8jnSEVdLBrFXebMY9GtMpiNEC+3uaup4k+2AFXDJpRE5BjbeuVzTnxQPjLFvKOwP/hNydRfGMDhW2Wcpq14tuOggEDWK5ENtSEt2IAksWA5Etd37SN9ctC6yfhMAkPJFLmuSuZQypxQBCHeKb0xkifpIt2JUasoqfYP2quRocOmB3ICNBCSxE+AY7+C2g8PAvAco+Pg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=KFVPbUhyJa/3gyeFpGQ8TI2wBK1/1s1wphfArc12J18=;
 b=SRHi3NvejGk6B4LQwa3tiVZs3vksa8XRaCk5aEnhcli8p7qAger/qh3DUZfrVoY+Z6a3lNm7Jl0GiAbPwJ4VrB41x4v7ALKj4aw8A0M+/paXBy8hLmPuuwZq6EsoS/ECdFYmVoTGzY7ewvLRjeYB5T3+huY9nQHYb4YGsT7LLNLJ5nfSwHn7Tic4IhQZlBcgcA/IE/ee8Vtz01aCoHqvHRkPZgCX8PC9hYiEVIcgY/Rw0YpD3VMTsvJfqpQbC5HsERTct8ImGDg4oeZ5D1WA1MKBBFNQYj4JA3oImSgqBo1EQfhthE4O7Rpc0+RSu3XTe448xaS4zZd/Tk06qlSV1w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KFVPbUhyJa/3gyeFpGQ8TI2wBK1/1s1wphfArc12J18=;
 b=HtXMhbmmEI+hdELGTPQbIvua8xf65I1KA/EKM/jheXoAHyI+QJWF0duuFc3T7fzyT9ZvZkuHqbXMHyAAyNrsowTX/ubI0HTehKD6fg46X9cZhMzs0XdwLoKQhFYdcXp/MPWfIos411Ww4ppXbGbu9bSr8QRj9KJvqT8eBsgWmAA=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 21 Jul 2023 13:49:47 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH v8 07/13] vpci/header: handle p2m range sets per BAR
Message-ID: <ZLpw2618XT8X3IA8@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-8-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20230720003205.1828537-8-volodymyr_babchuk@epam.com>
X-ClientProxiedBy: LO4P123CA0197.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a4::22) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|MN2PR03MB5005:EE_
X-MS-Office365-Filtering-Correlation-Id: 86122ec9-aeaf-4ec6-3068-08db89e098d4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	nrDlIQTY3x10ax8k7bW4NxGsUWu7FxcxRuB+otCMqYgMkPEVlDjxGuBCzDamIjQ4wxvxsWtPF7hKBThFLCMUkseeRC79SdBMD329F34+NjlFParX+XIH8sX3Jd5UybeP3rvyRKsDtYOOdLnYcFwEA5zEgwlpHGiRQgkJ/DiONFzF2p181lmx1ksSe1vWIfGIIK1gMP7zky90uTKFt304qr6/gjgJuDaOSwW6hh+sSORIC6X9ViiMKHOeDDFNBaxE2TFFwAVtEhoInjmI0fHMt/AXmCWistFT8T+4HwCNqY37Ytc8s1qtgTWW5a2AbC26jiP9dvcy091TVsq3e3F86WwgCVH8/odtXWrKfGwzuVFzPthBkTYJyV8SRC4KqjaQCCI0Qgxga4Jvps4iHOiAeX1nEIJe3+YxBC4wOQvS+LfRrSGxj0HxoXqz/SN6HxZ9Ts+3uoLN3wOn2EGpWH3qYSF1wJVsgfx2PJeXQVoCkWQ3fu1OjqaxZv+PKRrIJpXmGvbzH5v46nCgmnQAwp0u+Oo3akRjUg4JlTCajDRY4WFFhtBjHMlepi0KyLrzQZ1Y
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(366004)(376002)(396003)(136003)(346002)(451199021)(9686003)(6512007)(6666004)(66946007)(4326008)(6916009)(66556008)(66476007)(85182001)(6486002)(2906002)(54906003)(316002)(478600001)(86362001)(6506007)(83380400001)(186003)(82960400001)(38100700002)(5660300002)(30864003)(8936002)(8676002)(41300700001)(26005);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QUdDaFZiblJ4S0pHanlESnIrRGUycVFzdkVINHc3OGxWbmdpS0toOW9NY1A3?=
 =?utf-8?B?Q3pIN05JTURndXM4NXZnTnZ4eVdnMFdNcjNrRjdPekNMNEplYnM1T0pNdWln?=
 =?utf-8?B?dEVPbDh4c1dLbERkT1cxTTlHMHdkUjhmMUdRNys0SVVXRWF3dVBYQWpqZ3gw?=
 =?utf-8?B?TGhrb205ck12NzJ6dHFqekNoMkhuODJTUHZta25HQTRrdFVqanZSZCt0UTla?=
 =?utf-8?B?TjlucmJMK2lEWE5CRXc4SXNLL21STGpnQkkwaVNuVGNYb2NXS2N4Sk1naTBF?=
 =?utf-8?B?dUg0S0dpcGtOMVRQNGNVcUVFSlNPTjZoU0RqME03dmFXeldSMUVKblMxSmF0?=
 =?utf-8?B?cDBudFh0YnY5b0QvVHZhMWxCaHU4YTZEK0NxS3h2RDlQSHR3cENRWG55Qy9p?=
 =?utf-8?B?M2ZwODQ5MkhJV21kNnNsQXVsS2dobjNoL21KdktjWk1WcFdCYWkrc2M5NVZU?=
 =?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am-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	9lLEf1BjwTF+5G4oKwIp28wJiRwqGB+nbyOV36c6kkOqKjv1RMyMTOl6ZhpDp1ytKzAYpx3j8Z0JPn1Nh8UHiXLN1gV1xNGVlzJuPeSyViabNGmp6CUnAck0ugpdz8Di9EIFW3mYYhtCpsXwapAsD/jfqvDvJr05dGmsuBWortqDSw/AXbRC3SQZ12n2D1nSZ4pF9ZF39j+xIN5reBti7JnTTtgo2ajJbKMJrmEfqT49OhIvm1LOf0jwTu/D8C089nJRMMNOLxyx9s29WwVcwLEh53LRLw6GY1Q3H0KEnG7sCnx0qP4AiBnisCs43sJ0swaqbU4OwfQvABwpZ4mc5JfY8ujTPZO1UfV3IGijVsudcwO6KrDKFY1PlxadVK6sBye+6IQxfkiJ8Sewy/+Ct9Lgb/IxbWY+dF/WevijCE1M1Q1BU9gBKWE1WvmKUP0j4TNn8WUsYotFKDdZLkEoyQzCRqxDYnUR83zDzLL+AI8V/HXbKT2d5EbAVC+UAv6iEh4UpUnD8kn9/zXiMMRqadMW6qW3smJmbmJVmdl32zONE1uY6XiW5FruwhmpoXYTrvBH2KvhKjPMiwPWZOZ6wVLkjV7Drq8UvURMRm06xPF+LvHDKw37EtwWPAAVr18WsYykov7f7eBtzAQGO3IwcCYdxZENx6W+Dak1uI2i90/LPKvp+2NMehfzG1ezkNC8Ps25QWpXi7PmTiaphOhvPl9HCWaDUtVHxUMwkV2f9XFO9dPs6NHhQEwK324Au4tkE30cWI/nXG717ohKg2teWE+biAiYJdOJWVaZxTVOQLQzDmt3mXtjx3ZiTeR/S+Xz
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 86122ec9-aeaf-4ec6-3068-08db89e098d4
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 11:49:53.5085
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 8iH65UvYWYObqT09YRVlB44vFapVv9NsBu+f11SBCrArfedBF0PIoqn084QrQHmujMelb06wCBvR+Rdh//DMOA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR03MB5005

On Thu, Jul 20, 2023 at 12:32:32AM +0000, Volodymyr Babchuk wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> 
> Instead of handling a single range set, that contains all the memory
> regions of all the BARs and ROM, have them per BAR.
> As the range sets are now created when a PCI device is added and destroyed
> when it is removed so make them named and accounted.
> 
> Note that rangesets were chosen here despite there being only up to
> 3 separate ranges in each set (typically just 1). But rangeset per BAR
> was chosen for the ease of implementation and existing code re-usability.
> 
> This is in preparation of making non-identity mappings in p2m for the MMIOs.
> 
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> 
> ---
> Since v6:
> - update according to the new locking scheme
> - remove odd fail label in modify_bars
> Since v5:
> - fix comments
> - move rangeset allocation to init_bars and only allocate
>   for MAPPABLE BARs
> - check for overlap with the already setup BAR ranges
> Since v4:
> - use named range sets for BARs (Jan)
> - changes required by the new locking scheme
> - updated commit message (Jan)
> Since v3:
> - re-work vpci_cancel_pending accordingly to the per-BAR handling
> - s/num_mem_ranges/map_pending and s/uint8_t/bool
> - ASSERT(bar->mem) in modify_bars
> - create and destroy the rangesets on add/remove
> ---
>  xen/drivers/vpci/header.c | 235 ++++++++++++++++++++++++++++----------
>  xen/drivers/vpci/vpci.c   |   6 +
>  xen/include/xen/vpci.h    |   3 +-
>  3 files changed, 181 insertions(+), 63 deletions(-)
> 
> diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
> index 5dc9b5338b..eb07fa0bb2 100644
> --- a/xen/drivers/vpci/header.c
> +++ b/xen/drivers/vpci/header.c
> @@ -141,63 +141,106 @@ static void modify_decoding(const struct pci_dev *pdev, uint16_t cmd,
>  
>  bool vpci_process_pending(struct vcpu *v)
>  {
> -    if ( v->vpci.mem )
> +    struct pci_dev *pdev = v->vpci.pdev;
> +    if ( !pdev )
> +        return false;

I think this check is kind of inverted, you should check for
vpci.map_pending first, and then check that the rest of the fields are
also set (or complain otherwise as something went clearly wrong)?

> +
> +    if ( v->vpci.map_pending )
>      {
>          struct map_data data = {
>              .d = v->domain,
>              .map = v->vpci.cmd & PCI_COMMAND_MEMORY,
>          };
> -        int rc = rangeset_consume_ranges(v->vpci.mem, map_range, &data);
> -
> -        if ( rc == -ERESTART )
> -            return true;
> +        struct vpci_header *header = &pdev->vpci->header;

You need to hold the per-domain rwlock in order to access
pdev->vpci.

> +        unsigned int i;
>  
>          write_lock(&v->domain->pci_lock);

Holding the lock in write mode for the duration of the mapping is
quite aggressive, as the mapping operation could be a long running
one.

Is this only locked in exclusive mode in order to have the right
locking for the vpci_remove_device() call below?

If so we might consider using a different error handling in order to
avoid taking the lock in exclusive mode.

> -        spin_lock(&v->vpci.pdev->vpci->lock);
> -        /* Disable memory decoding unconditionally on failure. */
> -        modify_decoding(v->vpci.pdev,
> -                        rc ? v->vpci.cmd & ~PCI_COMMAND_MEMORY : v->vpci.cmd,
> -                        !rc && v->vpci.rom_only);
> -        spin_unlock(&v->vpci.pdev->vpci->lock);
> -
> -        rangeset_destroy(v->vpci.mem);
> -        v->vpci.mem = NULL;
> -        if ( rc )
> -            /*
> -             * FIXME: in case of failure remove the device from the domain.
> -             * Note that there might still be leftover mappings. While this is
> -             * safe for Dom0, for DomUs the domain will likely need to be
> -             * killed in order to avoid leaking stale p2m mappings on
> -             * failure.
> -             */
> -            vpci_remove_device(v->vpci.pdev);
> +
> +        for ( i = 0; i < ARRAY_SIZE(header->bars); i++ )
> +        {
> +            struct vpci_bar *bar = &header->bars[i];
> +            int rc;
> +
> +            if ( rangeset_is_empty(bar->mem) )
> +                continue;
> +
> +            rc = rangeset_consume_ranges(bar->mem, map_range, &data);
> +
> +            if ( rc == -ERESTART )
> +            {
> +                write_unlock(&v->domain->pci_lock);
> +                return true;
> +            }
> +
> +            spin_lock(&pdev->vpci->lock);
> +            /* Disable memory decoding unconditionally on failure. */
> +            modify_decoding(pdev, rc ? v->vpci.cmd & ~PCI_COMMAND_MEMORY :
> +                                       v->vpci.cmd, !rc && v->vpci.rom_only);

This need to also be moved out of the loop, or else you would be
toggling the memory decoding bit every time a BAR is mapped or
unmapped.  This must be done once all BARs are {un,}mapped (so outside
of the for loop).

You will likely need to keep a call here that disables memory decoding
only if the mapping has failed.

> +            spin_unlock(&pdev->vpci->lock);
> +
> +            if ( rc )
> +            {
> +                /*
> +                 * FIXME: in case of failure remove the device from the domain.
> +                 * Note that there might still be leftover mappings. While this
> +                 * is safe for Dom0, for DomUs the domain needs to be killed in
> +                 * order to avoid leaking stale p2m mappings on failure.
> +                 */

You are already handling the domU case, so the comment needs to be
adjusted, as it's no longer a FIXME.  We might consider to just remove
the comment at once.

> +                v->vpci.map_pending = false;
> +
> +                if ( is_hardware_domain(v->domain) )
> +                {
> +                    vpci_remove_device(pdev);
> +                    write_unlock(&v->domain->pci_lock);
> +                }
> +                else
> +                {
> +                    write_unlock(&v->domain->pci_lock);
> +                    domain_crash(v->domain);
> +                }
> +                return false;
> +            }
> +        }
>          write_unlock(&v->domain->pci_lock);
> +
> +        v->vpci.map_pending = false;
>      }
>  
> +
>      return false;
>  }
>  
>  static int __init apply_map(struct domain *d, const struct pci_dev *pdev,
> -                            struct rangeset *mem, uint16_t cmd)
> +                            uint16_t cmd)
>  {
>      struct map_data data = { .d = d, .map = true };
> -    int rc;
> +    struct vpci_header *header = &pdev->vpci->header;
> +    int rc = 0;
> +    unsigned int i;
>  
>      ASSERT(rw_is_locked(&d->pci_lock));
>  
> -    while ( (rc = rangeset_consume_ranges(mem, map_range, &data)) == -ERESTART )
> +    for ( i = 0; i < ARRAY_SIZE(header->bars); i++ )
>      {
> -        /*
> -         * It's safe to drop and reacquire the lock in this context
> -         * without risking pdev disappearing because devices cannot be
> -         * removed until the initial domain has been started.
> -         */
> -        read_unlock(&d->pci_lock);
> -        process_pending_softirqs();
> -        read_lock(&d->pci_lock);
> -    }
> +        struct vpci_bar *bar = &header->bars[i];
>  
> -    rangeset_destroy(mem);
> +        if ( rangeset_is_empty(bar->mem) )
> +            continue;
> +
> +        while ( (rc = rangeset_consume_ranges(bar->mem, map_range,
> +                                              &data)) == -ERESTART )
> +        {
> +            /*
> +             * It's safe to drop and reacquire the lock in this context
> +             * without risking pdev disappearing because devices cannot be
> +             * removed until the initial domain has been started.
> +             */
> +            write_unlock(&d->pci_lock);
> +            process_pending_softirqs();
> +            write_lock(&d->pci_lock);
> +        }
> +    }
>      if ( !rc )
>          modify_decoding(pdev, cmd, false);
>  
> @@ -205,10 +248,12 @@ static int __init apply_map(struct domain *d, const struct pci_dev *pdev,
>  }
>  
>  static void defer_map(struct domain *d, struct pci_dev *pdev,
> -                      struct rangeset *mem, uint16_t cmd, bool rom_only)
> +                      uint16_t cmd, bool rom_only)
>  {
>      struct vcpu *curr = current;
>  
> +    ASSERT(!!rw_is_write_locked(&pdev->domain->pci_lock));

No need for the double !!.

> +
>      /*
>       * FIXME: when deferring the {un}map the state of the device should not
>       * be trusted. For example the enable bit is toggled after the device
> @@ -216,7 +261,7 @@ static void defer_map(struct domain *d, struct pci_dev *pdev,
>       * started for the same device if the domain is not well-behaved.
>       */
>      curr->vpci.pdev = pdev;
> -    curr->vpci.mem = mem;
> +    curr->vpci.map_pending = true;
>      curr->vpci.cmd = cmd;
>      curr->vpci.rom_only = rom_only;
>      /*
> @@ -230,33 +275,34 @@ static void defer_map(struct domain *d, struct pci_dev *pdev,
>  static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
>  {
>      struct vpci_header *header = &pdev->vpci->header;
> -    struct rangeset *mem = rangeset_new(NULL, NULL, 0);
>      struct pci_dev *tmp, *dev = NULL;
>      const struct domain *d;
>      const struct vpci_msix *msix = pdev->vpci->msix;
> -    unsigned int i;
> +    unsigned int i, j;
>      int rc;
> +    bool map_pending;
>  
>      ASSERT(rw_is_locked(&pdev->domain->pci_lock));
>  
> -    if ( !mem )
> -        return -ENOMEM;
> -
>      /*
> -     * Create a rangeset that represents the current device BARs memory region
> -     * and compare it against all the currently active BAR memory regions. If
> -     * an overlap is found, subtract it from the region to be mapped/unmapped.
> +     * Create a rangeset per BAR that represents the current device memory
> +     * region and compare it against all the currently active BAR memory
> +     * regions. If an overlap is found, subtract it from the region to be
> +     * mapped/unmapped.
>       *
> -     * First fill the rangeset with all the BARs of this device or with the ROM
> +     * First fill the rangesets with the BARs of this device or with the ROM

I think you need to drop the 's' from BARs also.

>       * BAR only, depending on whether the guest is toggling the memory decode
>       * bit of the command register, or the enable bit of the ROM BAR register.
>       */
>      for ( i = 0; i < ARRAY_SIZE(header->bars); i++ )
>      {
> -        const struct vpci_bar *bar = &header->bars[i];
> +        struct vpci_bar *bar = &header->bars[i];
>          unsigned long start = PFN_DOWN(bar->addr);
>          unsigned long end = PFN_DOWN(bar->addr + bar->size - 1);
>  
> +        if ( !bar->mem )
> +            continue;
> +
>          if ( !MAPPABLE_BAR(bar) ||
>               (rom_only ? bar->type != VPCI_BAR_ROM
>                         : (bar->type == VPCI_BAR_ROM && !header->rom_enabled)) ||
> @@ -272,14 +318,31 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
>              continue;
>          }
>  
> -        rc = rangeset_add_range(mem, start, end);
> +        rc = rangeset_add_range(bar->mem, start, end);
>          if ( rc )
>          {
>              printk(XENLOG_G_WARNING "Failed to add [%lx, %lx]: %d\n",
>                     start, end, rc);
> -            rangeset_destroy(mem);
>              return rc;
>          }
> +
> +        /* Check for overlap with the already setup BAR ranges. */
> +        for ( j = 0; j < i; j++ )
> +        {
> +            struct vpci_bar *bar = &header->bars[j];

This is kind of confusing, as you are defining an inner 'bar' variable
that shadows the outside one.  Might be better to name it as prev_bar
or some such, to avoid the shadowing.

> +
> +            if ( rangeset_is_empty(bar->mem) )
> +                continue;
> +
> +            rc = rangeset_remove_range(bar->mem, start, end);
> +            if ( rc )
> +            {
> +                printk(XENLOG_G_WARNING
> +                       "Failed to remove overlapping range [%lx, %lx]: %d\n",
> +                       start, end, rc);

Might as well print the SBDF of the device while at it (same below).

You could also consider using gprintk instead of plain printk, and
avoid the _G_ tag in the log level.

> +                return rc;
> +            }
> +        }
>      }
>  
>      /* Remove any MSIX regions if present. */
> @@ -289,14 +352,21 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
>          unsigned long end = PFN_DOWN(vmsix_table_addr(pdev->vpci, i) +
>                                       vmsix_table_size(pdev->vpci, i) - 1);
>  
> -        rc = rangeset_remove_range(mem, start, end);
> -        if ( rc )
> +        for ( j = 0; j < ARRAY_SIZE(header->bars); j++ )
>          {
> -            printk(XENLOG_G_WARNING
> -                   "Failed to remove MSIX table [%lx, %lx]: %d\n",
> -                   start, end, rc);
> -            rangeset_destroy(mem);
> -            return rc;
> +            const struct vpci_bar *bar = &header->bars[j];
> +
> +            if ( rangeset_is_empty(bar->mem) )
> +                continue;
> +
> +            rc = rangeset_remove_range(bar->mem, start, end);
> +            if ( rc )
> +            {
> +                printk(XENLOG_G_WARNING
> +                       "Failed to remove MSIX table [%lx, %lx]: %d\n",
> +                       start, end, rc);
> +                return rc;
> +            }
>          }
>      }
>  
> @@ -341,7 +411,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
>                  unsigned long end = PFN_DOWN(bar->addr + bar->size - 1);
>  
>                  if ( !bar->enabled ||
> -                     !rangeset_overlaps_range(mem, start, end) ||
> +                     !rangeset_overlaps_range(bar->mem, start, end) ||
>                       /*
>                        * If only the ROM enable bit is toggled check against
>                        * other BARs in the same device for overlaps, but not
> @@ -350,12 +420,11 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
>                       (rom_only && tmp == pdev && bar->type == VPCI_BAR_ROM) )
>                      continue;
>  
> -                rc = rangeset_remove_range(mem, start, end);
> +                rc = rangeset_remove_range(bar->mem, start, end);

Urg, isn't 'bar' here pointing to the remote device BAR, not the BARs
that we want to map?

You need an inner loop that iterates over header->bars, much like you
do to handle the MSI-X table overlaps.

>                  if ( rc )
>                  {
>                      printk(XENLOG_G_WARNING "Failed to remove [%lx, %lx]: %d\n",
>                             start, end, rc);
> -                    rangeset_destroy(mem);
>                      return rc;
>                  }
>              }
> @@ -380,10 +449,23 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
>           * will always be to establish mappings and process all the BARs.
>           */
>          ASSERT((cmd & PCI_COMMAND_MEMORY) && !rom_only);
> -        return apply_map(pdev->domain, pdev, mem, cmd);
> +        return apply_map(pdev->domain, pdev, cmd);
>      }
>  
> -    defer_map(dev->domain, dev, mem, cmd, rom_only);
> +    /* Find out how many memory ranges has left after MSI and overlaps. */
                                          ^ are (I think).
> +    map_pending = false;
> +    for ( i = 0; i < ARRAY_SIZE(header->bars); i++ )
> +        if ( !rangeset_is_empty(header->bars[i].mem) )
> +        {
> +            map_pending = true;
> +            break;
> +        }
> +
> +    /* If there's no mapping work write the command register now. */
> +    if ( !map_pending )
> +        pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
> +    else
> +        defer_map(dev->domain, dev, cmd, rom_only);

This is kind of not strictly required, and different from the current
approach where defer_map() gets called regardless of whether the
rangeset is all empty.

Could be moved to a separate commit.

>  
>      return 0;
>  }
> @@ -574,6 +656,19 @@ static void cf_check rom_write(
>          rom->addr = val & PCI_ROM_ADDRESS_MASK;
>  }
>  
> +static int bar_add_rangeset(struct pci_dev *pdev, struct vpci_bar *bar, int i)

pci_dev should be const, and i unsigned.

> +{
> +    char str[32];
> +
> +    snprintf(str, sizeof(str), "%pp:BAR%d", &pdev->sbdf, i);
> +
> +    bar->mem = rangeset_new(pdev->domain, str, RANGESETF_no_print);
> +    if ( !bar->mem )
> +        return -ENOMEM;
> +
> +    return 0;
> +}
> +
>  static int cf_check init_bars(struct pci_dev *pdev)
>  {
>      uint16_t cmd;
> @@ -657,6 +752,13 @@ static int cf_check init_bars(struct pci_dev *pdev)
>          else
>              bars[i].type = VPCI_BAR_MEM32;
>  
> +        rc = bar_add_rangeset(pdev, &bars[i], i);
> +        if ( rc )
> +        {
> +            bars[i].type = VPCI_BAR_EMPTY;
> +            return rc;
> +        }
> +
>          rc = pci_size_mem_bar(pdev->sbdf, reg, &addr, &size,
>                                (i == num_bars - 1) ? PCI_BAR_LAST : 0);
>          if ( rc < 0 )
> @@ -707,6 +809,15 @@ static int cf_check init_bars(struct pci_dev *pdev)
>                                     rom_reg, 4, rom);
>              if ( rc )
>                  rom->type = VPCI_BAR_EMPTY;
> +            else
> +            {
> +                rc = bar_add_rangeset(pdev, rom, i);
> +                if ( rc )
> +                {
> +                    rom->type = VPCI_BAR_EMPTY;
> +                    return rc;
> +                }

For both of the above: I don't think you need to set the BAR to EMPTY
if you are already returning an error, as the whole vCPI handling will
fail initialization.  Setting to empty only makes sense if we can try
to continue with normal operations.

> +            }
>          }
>      }
>      else
> diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
> index a97710a806..ca3505ecb7 100644
> --- a/xen/drivers/vpci/vpci.c
> +++ b/xen/drivers/vpci/vpci.c
> @@ -38,6 +38,8 @@ extern vpci_register_init_t *const __end_vpci_array[];
>  
>  void vpci_remove_device(struct pci_dev *pdev)
>  {
> +    unsigned int i;
> +
>      ASSERT(rw_is_write_locked(&pdev->domain->pci_lock));
>  
>      if ( !has_vpci(pdev->domain) || !pdev->vpci )
> @@ -63,6 +65,10 @@ void vpci_remove_device(struct pci_dev *pdev)
>              if ( pdev->vpci->msix->table[i] )
>                  iounmap(pdev->vpci->msix->table[i]);
>      }
> +
> +    for ( i = 0; i < ARRAY_SIZE(pdev->vpci->header.bars); i++ )
> +        rangeset_destroy(pdev->vpci->header.bars[i].mem);
> +
>      xfree(pdev->vpci->msix);
>      xfree(pdev->vpci->msi);
>      xfree(pdev->vpci);
> diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
> index 486a655e8d..b78dd6512b 100644
> --- a/xen/include/xen/vpci.h
> +++ b/xen/include/xen/vpci.h
> @@ -72,6 +72,7 @@ struct vpci {
>              /* Guest view of the BAR: address and lower bits. */
>              uint64_t guest_reg;
>              uint64_t size;
> +            struct rangeset *mem;
>              enum {
>                  VPCI_BAR_EMPTY,
>                  VPCI_BAR_IO,
> @@ -156,9 +157,9 @@ struct vpci {
>  
>  struct vpci_vcpu {
>      /* Per-vcpu structure to store state while {un}mapping of PCI BARs. */
> -    struct rangeset *mem;
>      struct pci_dev *pdev;
>      uint16_t cmd;
> +    bool map_pending : 1;

I do wonder whether we really need the map_pending boolean field,
couldn't pdev != NULL be used as a way to signal a pending mapping
operation?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 11:52:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 11:52:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567501.886625 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMogH-0001Ta-I1; Fri, 21 Jul 2023 11:52:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567501.886625; Fri, 21 Jul 2023 11:52:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMogH-0001TT-FA; Fri, 21 Jul 2023 11:52:21 +0000
Received: by outflank-mailman (input) for mailman id 567501;
 Fri, 21 Jul 2023 11:52:20 +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
 <SRS0=dNy0=DH=citrix.com=prvs=559993d03=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMogG-0001TN-6S
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 11:52:20 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 095c5227-27bd-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 13:52:17 +0200 (CEST)
Received: from mail-mw2nam10lp2107.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.107])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 21 Jul 2023 07:52:14 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by MN2PR03MB5005.namprd03.prod.outlook.com (2603:10b6:208:1a2::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 11:52:12 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Fri, 21 Jul 2023
 11:52:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 095c5227-27bd-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689940337;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=doZa06Jgwm5f5h72GODvqx1ChEHBzcGFG4e5G1uSN4s=;
  b=hpJ+uGEn4Yp3RbkSSvQrSmdrZgBJrNmpC02NWhSE11vTuqSEVkr0GFCe
   AT56RmKecYyu3oxQGjqe6GrRzf3sDsrjWn5p2fwLa3tG17QZQjErHvTet
   SlJKRvDv8+qSrX3yApx0vZAGbJAY3eiXWvXbAPD9D4Ev/iM2WcyJcS0Gm
   U=;
X-IronPort-RemoteIP: 104.47.55.107
X-IronPort-MID: 116866458
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:fkkMTqyzhGdrJiiKG1V6t+fYxyrEfRIJ4+MujC+fZmUNrF6WrkUDm
 jYdD2uPaPbcZmqnc4x3OdjkoEJV68fVndQwTgtvrSAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhP6kT5TcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KT1X0
 aU1bzQ0VU6Ope+v442Dd9BLidt2eaEHPKtH0p1h5RfwKK9+BLX8GeDN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjWVlVQuuFTuGIO9ltiiX8Jak1zev
 mvb12/4HgsbJJqUzj/tHneE37aRzX2lBN9CfFG+3tdM0Fyr1G8qMSMPW1KbgtK+ihK/Q/sKf
 iT4/QJr98De7neDTNPwQhm5q36spQMHVpxbFOhSwDuEyrfQpT2YAGcEZjdbbZots8pebQIt0
 liFjtb4HwtFubeeSW+e3rqMpDb0Mi8QRUcSaClBQQYb7t3LpIAokgmJXttlCLSyjND+BXf32
 T/ihA86irYIhMgHzZKS+1zdnimsrZjESA0yzgjPV2fj5QR8DLNJfKSt4FnfqPNfdoCQSwDZu
 GBewpDBqucTEZuKiSqBBv0XG62k7OqENzuahkNzG54m9HKm/HvLkZ1s3QyS7XxBaq4sEQIFq
 meK0e+NzPe/5EeXUJI=
IronPort-HdrOrdr: A9a23:TZvgiawc7CIdok7SIyX8KrPwT71zdoMgy1knxilNoH1uEvBw8v
 rEoB1173LJYVoqMk3I+urgBED/exzhHPdOiOEs1NyZMDUO1lHHEL1f
X-Talos-CUID: 9a23:0J2FrWOqwQDcou5DBDBDrWNTHvkeLHD/wW7zHHeFMEFmV+jA
X-Talos-MUID: =?us-ascii?q?9a23=3AlmHu3A1QJPfPemomHu0eGKL7+jUjyoL+CXgfkqw?=
 =?us-ascii?q?/hdCKPAxTEDCd0DWva9py?=
X-IronPort-AV: E=Sophos;i="6.01,220,1684814400"; 
   d="scan'208";a="116866458"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=lkHDOdDJ9zkg/VaMGS/gmBGUXs0xK+m5zqGFtuJ5yJxz3gIooQwMkK3kAymRSCsaSmzVI/nQEcuB5Mxy8vpjlsF1EkIC8mDc5YSBDgve/FEwL/SIWW7KUE/RtBpycnxssKJMgwKxp/uHeXapf/dELzlvcuYRiXPpapY6JCcZ/Mjfx55dIhNXqeN7ZcoGuXG+jqU2MKbseh1PfhaaRQnYs4iZf3XxgAlPSOVcN3cJkYw+2byi4VAivRP/HJmR1csc7xBsQgPqrcwDpc/ihclT/hHWYOXAZRq0dif5vL/ib6FvaGstWPLXtOLqRKADAxjY0iMnn2TQvp7hV/4bwXYhcg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=k8E/Idi4d0YJndDO0Gly9y7qjFVhI+dmrB1Z7CPJ0/Y=;
 b=kPbsF2znleI18J2saEF12/wvejZyxFrsjNEc84VjkXtL5uOELE3+piWCZF5o93lbNYixzxFE1BGFIKp/E2Y8QQQVGIHeq14m5Pt6TmsQe4j6/hEPL9lAYpjZQofBQloSk8vtOgTQlnBe/RPbdqC2UgEQk+HwUwL/Ji4xZ4e9V5G23BK9SeNd5hEtyPLzLS3R5GnOKEUWcJFQ7INPMArxlqTE7OZrDpGHvVbvykiBJwxHfi3pYGCqhc+92zapVrSMQem50PCAUHhXECPBRMWkZs/p+95z0Z8mlH2xr6ikruGs6Wf/kKifoqnEhzuS+ABNRMkftw17NEMI3kooeg8lQQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=k8E/Idi4d0YJndDO0Gly9y7qjFVhI+dmrB1Z7CPJ0/Y=;
 b=KFr917ZMIXFFTpBjGV23sPe7CA7BFIeACe1Jsb+GD1EuGeTgy/9kPpxgzR1axaHaSjQHDcroLAB37V4V7hsEZFn4JioK4gT6ltnpn8s4UQ3PBP5sUtQETZvxDoiH3e7WUbinir/+nSUMQeLsALidUxWPJ6Q9uXobeCDP/LDdpaI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 21 Jul 2023 13:52:06 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Rahul Singh <Rahul.Singh@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH v8 05/13] vpci/header: implement guest BAR register
 handlers
Message-ID: <ZLpxZhBKcuoGXokB@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-6-volodymyr_babchuk@epam.com>
 <72733AB9-1912-4C28-A6AC-88D147778E73@arm.com>
 <ec6c97dd-a333-6927-06bf-46ae44f9007d@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <ec6c97dd-a333-6927-06bf-46ae44f9007d@suse.com>
X-ClientProxiedBy: LO4P123CA0390.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:18f::17) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|MN2PR03MB5005:EE_
X-MS-Office365-Filtering-Correlation-Id: 95794864-affd-468e-0b56-08db89e0ebaa
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Z80Xt+FDJEmAGnTHNQFUWsthlWdx2wP6CKIkMcentu+TABMVmZqC3344Gx8xVNFpdiUj5eNvmM5trGjmpxOcfXjua9ULbLc2vYikL5gtLBsb5ZLAaAHOIGTvJv/j3Hw+b+me1/C9PVUSlC7ebXmOTnn2UG0XSfBnDUxIegzqTQcbOzr6VTi9WYJAmENtrcnM2fXHdlBqoWV+mcFbp+z4eR+Suu5ZXkmdDuCFpf/eMxHTOniLPURMnJTwXf70oHgXcUcweK7hwMtzrFUcpGx2OWPeWaOSO2O0Mj5BpurEYaWOOdo9FCfYj7f5l4iAZqc/j3V6COthst/PeqU3EetQxIBVUHS6C1uyHNdr1unLHSBJaHGnCluTXL/t5U6vu+Pz0QjKDkiANLJrhXfXt6Kws8jWk7frlOVo5l0nAccHkx9ReUo5XrK1xv4H8JrviCdz1O9qAK+3TdWaPlmWAS64L+NRgr4JY40gOcNTPF6wKn+31onJrcF4UzNKpOlfYnweooVgDMivNRyjO8HKUJCvCWWWUdDGKfm2+xz5/6P4KgeSF6oZ8t1dWXlRO+Wfjiou
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(366004)(376002)(396003)(136003)(346002)(451199021)(9686003)(6512007)(6666004)(66946007)(4326008)(6916009)(66556008)(66476007)(85182001)(6486002)(2906002)(54906003)(316002)(478600001)(86362001)(6506007)(53546011)(186003)(82960400001)(38100700002)(5660300002)(4744005)(8936002)(8676002)(41300700001)(26005);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?V3FTSFlCRit5c3BXeHFhdWdZMHp6ejdqY2hnT0JNRThuTllYdDlwdmVoNUdE?=
 =?utf-8?B?QXpOamgvclRwbE0ycWdXTzhpQnQyWVYrNE9vcVFqYXlJWHhQMFVJZ3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ntsCpbRlZKWsxmxqzGvnrXfUQOf40M6JLB8Y9P6w7WBmnzJr9QZ0TbUw2VxdCX6vZTYPQUTow1pu4CQGX3HE8tmBaUlK4IiCvhTlpVlJBo9RsndTyBqGzUZwtGoatFhRPnKBTRMqwpMOtdxU2UKCy/eE0ADIEIKQWydu7TVL7wl5P3rStPfALn9LKDf9j4G6pokPLJDBVJlaHCGfq+6ySDnHOkR4TSFEOtNop7FHi3j0TATnp6VJKbb6Zpm9y7Fv24YAgU+sMwmgYTeaxkOCNUKjERqrYgIMmqh9rpygAv4bQDLQ2s/mrFDo7nFewdLU1U5dM=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 95794864-affd-468e-0b56-08db89e0ebaa
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 11:52:12.3760
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: WqmZ/fB8gKsV3IHjO1ShpmxIkA7FxypCKR1/YNs8MkdcJTBD7plowUD+wc31p09QEG9hh0ABgOhdwGFhUt/mVA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR03MB5005

On Fri, Jul 21, 2023 at 12:50:23PM +0200, Jan Beulich wrote:
> On 21.07.2023 12:36, Rahul Singh wrote:
> >> On 20 Jul 2023, at 1:32 am, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com> wrote:
> >> @@ -599,34 +681,50 @@ static int cf_check init_bars(struct pci_dev *pdev)
> >>         bars[i].size = size;
> >>         bars[i].prefetchable = val & PCI_BASE_ADDRESS_MEM_PREFETCH;
> > 
> > I think there is a need to set the BAR mem type and prefetchable bit to the 
> > guest_reg also to avoid mismatch when Guest kernel initially read the BARâ€™s.
> 
> Perhaps more generally: Shouldn't r/o bits be handed through in almost
> all cases?

I remember in an earlier version suggesting to store the guest
address, instead of the guest BAR register value.  Then the flags
would be unconditionally added in guest_bar_read() and we wouldn't
need to worry about initializing the register.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 12:17:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 12:17:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567506.886637 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMp42-00048q-MN; Fri, 21 Jul 2023 12:16:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567506.886637; Fri, 21 Jul 2023 12:16:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMp42-00048j-Jm; Fri, 21 Jul 2023 12:16:54 +0000
Received: by outflank-mailman (input) for mailman id 567506;
 Fri, 21 Jul 2023 12:16:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pf5t=DH=arm.com=luca.fancellu@srs-se1.protection.inumbo.net>)
 id 1qMp41-00048d-3u
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 12:16:53 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTP
 id 78750575-27c0-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 14:16:50 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3FFD12F4;
 Fri, 21 Jul 2023 05:17:33 -0700 (PDT)
Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.1])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3C6EF3F6C4;
 Fri, 21 Jul 2023 05:16:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 78750575-27c0-11ee-b23a-6b7b168915f2
From: Luca Fancellu <luca.fancellu@arm.com>
To: xen-devel@lists.xenproject.org
Cc: rahul.singh@arm.com,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [OSSTEST] ts-kernel-build: add kernel kconfig for the Arndale
Date: Fri, 21 Jul 2023 13:16:27 +0100
Message-Id: <20230721121627.1229906-1-luca.fancellu@arm.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The Linux commit 33629d35090f5ce2b1b4ce78aa39954c603536d5 has
removed the 'snps,dwc-ahci' compatible from the generic
AHCI-platform driver control module selected by
CONFIG_SATA_AHCI_PLATFORM.

A new driver, the DWC AHCI SATA platform driver is now implemented
and handles the above compatible when CONFIG_AHCI_DWC is selected.

The module is needed for the Arndale board to have the SATA controller
working, so enable the CONFIG_AHCI_DWC as additional kconfig parameter
in ts-kernel-build.

Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
---
Tested successfully on:
 - arndale-lakeside
 - arndale-metrocentre
 - arndale-westfield

arndale-bluewater must have some HW issue, don't have much more info ATM.
---
 ts-kernel-build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ts-kernel-build b/ts-kernel-build
index 6c8f1d6a..73104874 100755
--- a/ts-kernel-build
+++ b/ts-kernel-build
@@ -245,6 +245,7 @@ setopt CONFIG_SENSORS_LM90 n
 setopt CONFIG_ICS932S401 n
 
 # Enable some additional drivers for Arndale.
+setopt CONFIG_AHCI_DWC y
 setopt CONFIG_PHY_EXYNOS5250_SATA m
 setopt CONFIG_USB_EHCI_EXYNOS m
 setopt CONFIG_USB_OHCI_EXYNOS m
-- 
2.20.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 12:27:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 12:27:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567512.886648 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMpEN-0005fx-LW; Fri, 21 Jul 2023 12:27:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567512.886648; Fri, 21 Jul 2023 12:27:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMpEN-0005fq-IO; Fri, 21 Jul 2023 12:27:35 +0000
Received: by outflank-mailman (input) for mailman id 567512;
 Fri, 21 Jul 2023 12:27:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=So7w=DH=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qMpEM-0005fk-G3
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 12:27:34 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20608.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::608])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f78fb57e-27c1-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 14:27:33 +0200 (CEST)
Received: from DB9PR06CA0014.eurprd06.prod.outlook.com (2603:10a6:10:1db::19)
 by AS2PR08MB8456.eurprd08.prod.outlook.com (2603:10a6:20b:55c::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul
 2023 12:27:30 +0000
Received: from DBAEUR03FT010.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:1db:cafe::c9) by DB9PR06CA0014.outlook.office365.com
 (2603:10a6:10:1db::19) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25 via Frontend
 Transport; Fri, 21 Jul 2023 12:27:30 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT010.mail.protection.outlook.com (100.127.142.78) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.24 via Frontend Transport; Fri, 21 Jul 2023 12:27:30 +0000
Received: ("Tessian outbound f1e964b3a9be:v145");
 Fri, 21 Jul 2023 12:27:30 +0000
Received: from 2dcc4a55ac1e.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 7C203589-AE2F-4FE3-A510-6726FB23B24B.1; 
 Fri, 21 Jul 2023 12:27:23 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2dcc4a55ac1e.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 21 Jul 2023 12:27:22 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by PAWPR08MB9471.eurprd08.prod.outlook.com (2603:10a6:102:2e5::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Fri, 21 Jul
 2023 12:27:19 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe%4]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 12:27:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f78fb57e-27c1-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=f9Zot7rjlz0cVnK4LhEOabZg2vXloiVvRB0vofcpwOI=;
 b=BEk4htsLRE6dtoKMkABFaP+juzott/mwEOdNItzBvQz4fQAGyRmejvbabaqLDVZnFTzlqy8VU6ZCcWNslwWh1artFkJkje5DZvShjKt0ovsGhxbopgTG3P5qdPpAYbh5aAtSBXd6W4WRo+GRYRPuB69a8kh/XNTshblNqcDUE+4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 1963503cd0537c63
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=oHXWwO0MGMBCbb9bzVM3W/eyMMvec8rtTFP/L9gFpSUYZHEFjGrSDKt6NEODDpdAzQvIk5DB3MEfJOLODUVlXBcWgAp12RhqA/FYvgFkjw8hhFSXrWVYR5VPj61U3AoIow2oi0VdzZARr94YHcu1LXNnbPVHk8QEJmo/HwgXdPLHOQrOvZY9dMNTtTHvE8uvYAlKrMRrPjTy6kSlTAgIttSEhRdgf7ePbeOssTgWGr4A67MGjfupF/Vj1CxodygmxFpX2vipi6WG+grQ0mp7sDz2IAY6mGWGktI+Du7uhjMPQ3Lu+d+Ec15Ej7+8HpEJHxZeS/aQickFbliGWHJF0w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=f9Zot7rjlz0cVnK4LhEOabZg2vXloiVvRB0vofcpwOI=;
 b=KMiI2KfqlFa/sPE8QcdDPbO6OTw4rWrFFXUQOkJrX1E95tu4FLtFAlQYMJI8qSXGPEZSn9sDO/3LFK2/DFdSaK+CYBG84bZ0FbS9w1+pweZuL012SLuGx+ROIVvQt106FuFojNUl2H7xoxSVBIproDGh4LiDHZ+epe+cpJfhvAYQYroMurSn3LWQNIaFzxsHyij9rQyGbOmm/2uo6gLsWcdNxxakcoVoVYsiXb4hwqwpGp5w7vV3IZ6xnXSLivS2A+1ztku1Gs7OmDIc6vSyooPeVuVYYkKfoz39F+7y3M+q4u4TTNDMGY8x0x9fXORGT5JB2EkYTsTNiY9yL1Xlmw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=f9Zot7rjlz0cVnK4LhEOabZg2vXloiVvRB0vofcpwOI=;
 b=BEk4htsLRE6dtoKMkABFaP+juzott/mwEOdNItzBvQz4fQAGyRmejvbabaqLDVZnFTzlqy8VU6ZCcWNslwWh1artFkJkje5DZvShjKt0ovsGhxbopgTG3P5qdPpAYbh5aAtSBXd6W4WRo+GRYRPuB69a8kh/XNTshblNqcDUE+4=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Jens Wiklander <jens.wiklander@linaro.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] xen/arm: Move TEE mediators in a kconfig submenu
Thread-Topic: [PATCH] xen/arm: Move TEE mediators in a kconfig submenu
Thread-Index: AQHZu6nFJdPelAC9nE2wzAZF/5qPkK/D6iMAgAACsoCAABzbgIAAHFKA
Date: Fri, 21 Jul 2023 12:27:19 +0000
Message-ID: <C63A942A-AC5D-46CD-81B3-50B6376860E7@arm.com>
References:
 <a44f74559f52d1fa90a3f77390e7d121c9cd848e.1689926422.git.bertrand.marquis@arm.com>
 <cb7b53bc-2440-8619-61ce-39c967b56eb7@suse.com>
 <DFD07AA0-E7E2-400B-8961-A646E5531DF7@arm.com>
 <6b24847c-5cd2-877a-bc72-16bb732e0ca2@suse.com>
In-Reply-To: <6b24847c-5cd2-877a-bc72-16bb732e0ca2@suse.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|PAWPR08MB9471:EE_|DBAEUR03FT010:EE_|AS2PR08MB8456:EE_
X-MS-Office365-Filtering-Correlation-Id: 2bf88495-b56c-480e-85ea-08db89e5da36
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 buVntpmc8AdLRaSQk2b7kMgjJ4TmouF1McPtTzUPP3xPpGJ7yupEe2eJdwbYXKyudf3GZ84zTw4h5IIWCq9Q5d0FcyvBCGQKW17Nl3hwpQoLDLuHBFLe3sGSQYFtP/cQQdg4DC7BFuMhmBF55xbjerd7pEGaN8zViM/LMza/RVSkEVCNy3UliqGLsyKjN05x070aRE4r4dO/qj8VybjZ74sBmrGAM1r439n5nyx5xOEJKnQpsMSUAG7DEFVfHfT8rzRQP0ybI2Slh5PjaVzMx8rI7WqWXY5CRbGnYcXjdFdRVXdEmigtn0Kj8/SnlAarj4qPI5e5lBhxhcZXURliSKIHauInmIOoJjMn/AgDWz31TL0tyAX/tbBExOsmiUGasakYY5ELfI74dQxHuCzH582yvt5lFIxIU6DZ0RhNfHRl2b4NYs5pa1sNLTEajT4j+G/v7nz4f9IOYPLCeYxeDK4JTDxBY/D5vk5GWdIp2Rv6fesNld/c0g/TelOWrxvp8e8Vd66oxRgyVguujivKfx4Mx416ZXfuDmkg/Ox5Hn7s5oXGf2vmisKYK7W4jGNTbrbr4rKkau8G60+HK63DPn+Clmryz6xbJ5J28PdCK608MfavLwZgZHihp+pyAvHIGu3DCauYFCl0ug/AsGqAEl8vPjypkjlMnGegnLFaUl/EzjWAwLDFl2flowcu6PKC
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(346002)(39860400002)(376002)(366004)(451199021)(71200400001)(478600001)(6512007)(6486002)(91956017)(54906003)(186003)(53546011)(6506007)(2906002)(76116006)(41300700001)(6916009)(4326008)(316002)(66556008)(64756008)(5660300002)(8936002)(8676002)(66446008)(2616005)(38100700002)(66476007)(122000001)(66946007)(33656002)(36756003)(38070700005)(86362001)(83380400001)(76704002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <7747BC0EE9DE3D469CC3813D489F669C@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9471
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT010.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	62f91019-8bea-49df-a5d2-08db89e5d3cc
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	W0NY0tlo42m15qiUKX3Xfgoni5bU4Nks3oNetalonG8YkNZMrGrX1qn2WntvE4e7LR6NOgMPB04B/lXbTcz6IxRbN7/3WFBNqpcrQoV9yp6k5uTOlqTvvaQEzQPkjTsf5LSmr8cIQ9R8+nAGPvKBUzswDcztjLes2e5U/WfqFZTU1yGa7G3Uw2P7dGzTGu6IcyCeUn0FCfMoO6FH0GqHxkukaHrmIJWzuwmmVHXsnG4abUgDIRjatEtYRBAtX9epBNHr8MLkUDOQMmeSL0IATnmdn7zc20oGs43E9m6EFufY6g8FUKp2JPdyNgFOLRgvpFBH2XkJifM/GtY0hj/4USZSbpporW/nVIz5Y1wMEMRJsI25tbmquAx7ngbRQA84++k60lioqxzsxbQxn1XtWwSKx4kW/Dg8uDhTHFtAYkecupLK5ris0/6kbEfcmhtkurKjGcjgcV1YegdKuGj5M25JoS+cx762zLlvXMu5jQ7pU7IcQ3ig54/p5MyVd7FWXgfhIYbI83Q5lptBnKXi11pddyihRzqYCQAaF0TubLBdrdlnFjl2PCexhaXPj1ZQxlpKGN0SZMKiGCBxZx9S/w8izlCWXYmEKmTrB07vfJ7+UZaoLplHupsnCLxKbI6ps1sr0Z1dxeC1XSfQOxruE7CmWmaWbhliB5C0PU4ADrahBzUADr0Bv2qP5lJE1cnpfDDZEGBTCvuR/NjI2yWlFJJvpAk8/NlKLrGSMX2G318q1G1pUWMPEpBD24zIW+hmYMWiWkQySQWDhgmpfjaKbQ==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(39860400002)(346002)(136003)(451199021)(82310400008)(46966006)(40470700004)(36840700001)(40480700001)(41300700001)(5660300002)(33656002)(6862004)(8936002)(8676002)(4326008)(40460700003)(70586007)(54906003)(70206006)(86362001)(316002)(82740400003)(356005)(81166007)(2906002)(186003)(2616005)(36756003)(6486002)(53546011)(336012)(26005)(6506007)(6512007)(47076005)(478600001)(36860700001)(83380400001)(76704002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 12:27:30.4423
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 2bf88495-b56c-480e-85ea-08db89e5da36
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT010.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8456

Hi Jan,

> On 21 Jul 2023, at 12:45, Jan Beulich <jbeulich@suse.com> wrote:
>=20
> On 21.07.2023 11:02, Bertrand Marquis wrote:
>>> On 21 Jul 2023, at 10:52, Jan Beulich <jbeulich@suse.com> wrote:
>>> On 21.07.2023 10:02, Bertrand Marquis wrote:
>>>> --- a/xen/arch/arm/tee/Kconfig
>>>> +++ b/xen/arch/arm/tee/Kconfig
>>>> @@ -1,7 +1,17 @@
>>>> +menu "TEE mediators"
>>>> + visible if UNSUPPORTED
>>>=20
>>> With this ...
>>>=20
>>>> +config TEE
>>>> + bool
>>>> + default n
>>>> + help
>>>> +  This option enables generic TEE mediators support. It allows guests
>>>> +  to access real TEE via one of TEE mediators implemented in XEN.
>>>> +
>>>> config OPTEE
>>>> - bool "Enable OP-TEE mediator"
>>>> + bool "Enable OP-TEE mediator (UNSUPPORTED)" if UNSUPPORTED
>>>=20
>>> ... you shouldn't need the "if" here, and ...
>>>=20
>>>> default n
>>>> - depends on TEE
>>>> + select TEE
>>>> help
>>>> Enable the OP-TEE mediator. It allows guests to access
>>>> OP-TEE running on your platform. This requires
>>>> @@ -13,9 +23,13 @@ config FFA
>>>> bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
>>>=20
>>> ... you could drop the one here. I think.
>>=20
>> visible if is only for the GUI/ncurse display but the if is required
>> to make sure that a .config file cannot set CONFIG_TEE or
>> CONFIG_FFA if. UNSUPPORTED is not selected.
>=20
> Is what you describe "depends on"? "if" controls merely prompt
> visibility aiui.

So you think that having  CONFIG_FFA without CONFIG_UNSUPPORTED
would be a valid configuration and the if is only here for the gui ?

I tested that with the following procedure:
- use menuconfig, select UNSUPPORTED and FFA
- edit .config and disable UNSUPPORTED but keep FFA
- build
- CONFIG_FFA is removed from .config

Now what puzzles me is that i did the same but removing the if UNSUPPORTED
for TEE and FFA and i have exactly the same behaviour.

So it seems that "if UNSUPPORTED" and visibility all behave in the same way
as depends on which i was not expecting.

So what should i keep or remove here ?

Cheers
Bertrand

>=20
> Jan



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 12:29:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 12:29:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567515.886658 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMpFg-0006Ch-VB; Fri, 21 Jul 2023 12:28:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567515.886658; Fri, 21 Jul 2023 12:28:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMpFg-0006Ca-SN; Fri, 21 Jul 2023 12:28:56 +0000
Received: by outflank-mailman (input) for mailman id 567515;
 Fri, 21 Jul 2023 12:28:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=So7w=DH=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qMpFf-0006CS-Jw
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 12:28:55 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2060d.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::60d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 281fcf1a-27c2-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 14:28:54 +0200 (CEST)
Received: from AS9PR06CA0517.eurprd06.prod.outlook.com (2603:10a6:20b:49d::21)
 by DB5PR08MB10164.eurprd08.prod.outlook.com (2603:10a6:10:4a1::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Fri, 21 Jul
 2023 12:28:52 +0000
Received: from AM7EUR03FT015.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:49d:cafe::92) by AS9PR06CA0517.outlook.office365.com
 (2603:10a6:20b:49d::21) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25 via Frontend
 Transport; Fri, 21 Jul 2023 12:28:51 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT015.mail.protection.outlook.com (100.127.140.173) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.34 via Frontend Transport; Fri, 21 Jul 2023 12:28:51 +0000
Received: ("Tessian outbound f1e964b3a9be:v145");
 Fri, 21 Jul 2023 12:28:51 +0000
Received: from da644066141b.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 350764D5-F0B2-4785-9399-A069701E5E98.1; 
 Fri, 21 Jul 2023 12:28:44 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id da644066141b.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 21 Jul 2023 12:28:44 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by PAWPR08MB9471.eurprd08.prod.outlook.com (2603:10a6:102:2e5::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Fri, 21 Jul
 2023 12:28:42 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe%4]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 12:28:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 281fcf1a-27c2-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ZzjC3bAZGySvsK62XAcK6kjc+eOkdmMOS3G1/saiQv0=;
 b=EnVbrC3NvMbz6IYf9qczFBXHVokinsaXxrnka37X7pokU6FO1efZTPIi50Zf/YDTmwD00DyOZwXsNtcoGKM9gUDnvpznopoc9wx2JWJkGgkf4K6WT/AoKnEZBFHx82k82tQMcoN9LWhImFEDp2n60atQAfcBxyaEslSZtY+hz5w=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 92ebf5c3d62949a0
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ktO7huNDfg1EiJ5CIyJgj1n79i1tfkVDe//EzbaXDAv41OF5R1foeheY1F9J7SOGMokMEKm0Ejwo+s+igOfqOAHys/WEZq2SQgIKHe9zEaQjsvzlZKPliwlQWOKtOK8C3gnV6x+EiiaO0Db21tA/U2DVMjcOH+C4ILZ/pFNXwzhb+91SGQo5KRkmXf/3K0xRmuuVgd4KlHd/nRBUgiuP3Vq0v0S2q/Z8Ii0Lh9FXkwnO1ydXHzYq2zifwimNtp1DUBWyqgaG+wOtA/wWNS3eq4Y/08Zyk4rCuXRFfTGN3coY+5sryM8H7UXIi+/t8rCTL4E6puCDO7pulMCvvOkwpw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ZzjC3bAZGySvsK62XAcK6kjc+eOkdmMOS3G1/saiQv0=;
 b=fW0TECznAakgrawgktBc0ODE0wd32jvpCdBptNSntqiJhcSmHYMN8YDiy1OlMgVhQbrjJsHUE+r2sJLwofVWI7are7F3IWV1VVORcU121C4ddFuitRUaZkwCUsrv5fiXuN/QbJl12KOrKxid6ziYx81ObWOnEmbcJD2i08ud6bcAfPM6CO9EHxEX/RXc82jQAeTl1S3QOSK8mPzOZypL3CnF2faqExrdehrgSazPoo0VTZ4zWGBus0XsHZjRSRYe+JXnmsdlPOKtnOOGHtYWK2Ij53vMNOBv7kbQJB/Hl/2ezTAsbOjqQAlNNEXjq7euwzdMvynXIZsLuX9qZJJ3Bw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ZzjC3bAZGySvsK62XAcK6kjc+eOkdmMOS3G1/saiQv0=;
 b=EnVbrC3NvMbz6IYf9qczFBXHVokinsaXxrnka37X7pokU6FO1efZTPIi50Zf/YDTmwD00DyOZwXsNtcoGKM9gUDnvpznopoc9wx2JWJkGgkf4K6WT/AoKnEZBFHx82k82tQMcoN9LWhImFEDp2n60atQAfcBxyaEslSZtY+hz5w=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Jens Wiklander
	<jens.wiklander@linaro.org>, Stefano Stabellini <sstabellini@kernel.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH v2] xen/arm: Move TEE mediators in a kconfig submenu
Thread-Topic: [PATCH v2] xen/arm: Move TEE mediators in a kconfig submenu
Thread-Index: AQHZu7UoTgj0ElhTvUC42VsaPH5iba/D/OyAgAApYgA=
Date: Fri, 21 Jul 2023 12:28:42 +0000
Message-ID: <B5883910-D35A-404B-8EBA-8AAB6C093342@arm.com>
References:
 <c55ce2891172a696e8a29f8c9bcc9dd33ebe9e50.1689931326.git.bertrand.marquis@arm.com>
 <e6d72d9a-a146-733c-0a9b-016fb291c2ea@xen.org>
In-Reply-To: <e6d72d9a-a146-733c-0a9b-016fb291c2ea@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|PAWPR08MB9471:EE_|AM7EUR03FT015:EE_|DB5PR08MB10164:EE_
X-MS-Office365-Filtering-Correlation-Id: 3cb79e24-da0a-4f9b-e4ce-08db89e60a74
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 k89mueGeRW8poG+BqYVCD5TFFPZvljb8SkGnyuIAw9H6e7W4yg+aHxGFLoy00RbwSjGXG52jkUKz8C9D25p9g6+QRK8IbXEtDW5XSFD6J1jtGjiDqFNprMsrXeAjoIrURl149hbaOX/KlJcJo/ip6sUfnNFLwN87OSd0M9BVwXScML2/3ae3iikjo1yG1Do8hvNBtxS9Q5CGWS63tnQkMmwDV+qPhIj2e4QZhMhaortFARejE2mFTedRrjTm/7BWikx5iOpuqUjsEc9RwMgJv3KhI9+fZWCcSyaVqopBeEu1uq+xw0wddcjmt/IFNZGbfy3TXg3YHHJN+IYqmWNMn/5gSFZnVn8ZxelU1vpi7yyXQzn6dKWASnxZcVQQZQVy8xImBAW/SCGEp5O14S/rK7QIPE3hO6nWEs75qucQf+SU1dtcov/xLw0E4es9a5sd3cgx2MYkta75laHsDJv+Tp+4uotT5XPzd6mmqHUCy3vT0Mi0egQe+7D9wXB/Q2nJg48dZUZMGqPeFTmSmzNSp1RzP0kehzK6zCtRLQVEBr/tSowdXwUL7o3FmlJZsM8hMctpVoxluQFWODhnLf08Y1dHIpr5fJTQIVtN/qsx21Py1TE3i3m2jkh3MSQDRJZ0sWgZTk9eN1w4M5cr3HNT4Q==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(346002)(39860400002)(376002)(366004)(451199021)(966005)(71200400001)(478600001)(6512007)(6486002)(91956017)(54906003)(186003)(53546011)(6506007)(2906002)(76116006)(41300700001)(6916009)(4326008)(316002)(66556008)(64756008)(5660300002)(8936002)(8676002)(66446008)(2616005)(38100700002)(66476007)(122000001)(66946007)(33656002)(36756003)(38070700005)(86362001)(83380400001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <6925936932FCCF40B5164C88E18BD740@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9471
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT015.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	57d95d4f-d76c-439b-703c-08db89e60510
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	m2hlG5GBskx5Da7Dffk1+FQaXhdkyXTwbeVJ8C8trG+toezFCO0xBxHP9It8+oCVzxfDoFBGrX5+KGtlTgm/STfWMLjba12ZO9xs+8T3WW4wrSZQ6o9AHaNbGJ/MjYW1vN3FY6sHr1OIKmUA7W3wf61jf0Vza6x9I0+M4AJCBIxUkD1TaXFrbuwGIalrY5v8QkVIbk7xUJqh/WDb2cElb0wH3cEPgvzvWwx/W4cejZW1ng96JsP16gTdThvW9bNR6YQyBAI6lhkLTpGtKTYzgXkAHKoTqdXK/yGhhzyAypNUAnbxttlCyYBUt6dVR0k0nLymh2vSUx5FCxP2wSmbTBoZJXVDrcbQcH5JfPOggC+qzns7Ijc+ydsSC72nA79wIhnDosCnyL7D4RNQI9DY+yh3poxD7lcPT4M7cDDDc3ZZSwJuhEXVGMo186fmYy6zziBW0P5Tq/YMGcbzftgwJtK8cfsfQVEGOF+ZAAitLXLe8+tHFRt516BtKVILMRRUU4yCnZJzdMuuSUoci0soE0nDw8W0Wj/y1t2VBXKgWeJ7Di2S93J4E6Q5SYJUubsQPB6+8uGzmeuHl0ovEZiD5/4b7JmbcVMPDF6qGmcohQtjsrik+1G0IKLaifBRaI+RepGoSgRKOJ7jzYBUVnprFuX95wlr73BwWlU+bh7s9rG0F6/IhIQy2JK0F+HfNfnIqHPmUNOQc0gCMRP2GELgtxKf4DMyZmwMf7KjmvNlNLE=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(39860400002)(136003)(346002)(451199021)(82310400008)(36840700001)(46966006)(40470700004)(40460700003)(966005)(4326008)(6486002)(53546011)(6506007)(26005)(107886003)(478600001)(70206006)(54906003)(70586007)(86362001)(33656002)(36756003)(36860700001)(83380400001)(336012)(47076005)(186003)(2616005)(8936002)(41300700001)(5660300002)(316002)(6862004)(40480700001)(6512007)(2906002)(81166007)(8676002)(356005)(82740400003);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 12:28:51.3348
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 3cb79e24-da0a-4f9b-e4ce-08db89e60a74
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT015.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR08MB10164

Hi,

> On 21 Jul 2023, at 12:00, Julien Grall <julien@xen.org> wrote:
>=20
> Hi Bertrand,
>=20
> On 21/07/2023 10:23, Bertrand Marquis wrote:
>> Rework TEE mediators to put them under a submenu in Kconfig.
>> The submenu is only visible if UNSUPPORTED is activated as all currently
>> existing mediators are UNSUPPORTED.
>> While there rework a bit the configuration so that OP-TEE and FF-A
>> mediators are selecting the generic TEE interface instead of depending
>> on it.
>> Make the TEE option hidden as it is of no interest for anyone to select
>> it without one of the mediators so having them select it instead should
>> be enough.
>> Rework makefile inclusion and selection so that generic TEE is included
>> only when selected and include the tee Makefile all the time making the
>> directory tee self contained.
>=20
> Is this a left over?

Oups yes, please remove.

>=20
>> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
>> ---
>> Changes in v2:
>> - only included tee subdirectory in makefile if CONFIG_TEE is selected
>>   (reverts to state before patch)
>> - remove help in hidden TEE config
>> - rebase on top of staging
>> ---
>>  xen/arch/arm/Kconfig      |  7 -------
>>  xen/arch/arm/tee/Kconfig  | 17 ++++++++++++++---
>>  xen/arch/arm/tee/Makefile |  2 +-
>>  3 files changed, 15 insertions(+), 11 deletions(-)
>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>> index 439cc94f3344..fd57a82dd284 100644
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -175,13 +175,6 @@ config ARM64_BTI
>>     Branch Target Identification support.
>>     This feature is not supported in Xen.
>>  -config TEE
>> - bool "Enable TEE mediators support (UNSUPPORTED)" if UNSUPPORTED
>> - default n
>> - help
>> -   This option enables generic TEE mediators support. It allows guests
>> -   to access real TEE via one of TEE mediators implemented in XEN.
>> -
>>  source "arch/arm/tee/Kconfig"
>>    config STATIC_SHM
>> diff --git a/xen/arch/arm/tee/Kconfig b/xen/arch/arm/tee/Kconfig
>> index db3ea78faaaa..c5b0f88d7522 100644
>> --- a/xen/arch/arm/tee/Kconfig
>> +++ b/xen/arch/arm/tee/Kconfig
>> @@ -1,7 +1,14 @@
>> +menu "TEE mediators"
>> + visible if UNSUPPORTED
>> +
>> +config TEE
>> + bool
>> + default n
>> +
>>  config OPTEE
>> - bool "Enable OP-TEE mediator"
>> + bool "Enable OP-TEE mediator (UNSUPPORTED)" if UNSUPPORTED
>>   default n
>> - depends on TEE
>> + select TEE
>>   help
>>     Enable the OP-TEE mediator. It allows guests to access
>>     OP-TEE running on your platform. This requires
>> @@ -12,10 +19,14 @@ config OPTEE
>>  config FFA
>>   bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
>>   default n
>> - depends on ARM_64 && TEE
>> + depends on ARM_64
>> + select TEE
>>   help
>>     This option enables a minimal FF-A mediator. The mediator is
>>     generic as it follows the FF-A specification [1], but it only
>>     implements a small subset of the specification.
>>       [1] https://developer.arm.com/documentation/den0077/latest
>> +
>> +endmenu
>> +
>> diff --git a/xen/arch/arm/tee/Makefile b/xen/arch/arm/tee/Makefile
>> index 58a1015e40e0..1ef49a271fdb 100644
>> --- a/xen/arch/arm/tee/Makefile
>> +++ b/xen/arch/arm/tee/Makefile
>> @@ -1,3 +1,3 @@
>>  obj-$(CONFIG_FFA) +=3D ffa.o
>> -obj-y +=3D tee.o
>> +obj-$(CONFIG_TEE) +=3D tee.o
>>  obj-$(CONFIG_OPTEE) +=3D optee.o
>=20
> Same here? The rest LGTM and I would be happy to do the changes on commit=
.

This one is not, I think it is more logic to keep that one like this so tha=
t if someone
creates a TEE not depending on this it could still put it here without comp=
iling tee.o
for no reason.

Now there is still a discussion around visibility and if UNSUPPORTED that w=
e need
to settle (even though current behaviour is right and as i expected, the ef=
fect of the
"visibility" is not what I expected).

Cheers
Bertrand

>=20
> Cheers,
>=20
> --=20
> Julien Grall




From xen-devel-bounces@lists.xenproject.org Fri Jul 21 12:33:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 12:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567519.886668 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMpK4-0007iY-Lw; Fri, 21 Jul 2023 12:33:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567519.886668; Fri, 21 Jul 2023 12:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMpK4-0007iQ-ID; Fri, 21 Jul 2023 12:33:28 +0000
Received: by outflank-mailman (input) for mailman id 567519;
 Fri, 21 Jul 2023 12:33:27 +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
 <SRS0=dNy0=DH=citrix.com=prvs=559993d03=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMpK3-0007iJ-86
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 12:33:27 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c7fe1fcd-27c2-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 14:33:24 +0200 (CEST)
Received: from mail-dm6nam11lp2176.outbound.protection.outlook.com (HELO
 NAM11-DM6-obe.outbound.protection.outlook.com) ([104.47.57.176])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 21 Jul 2023 08:33:21 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SA0PR03MB5658.namprd03.prod.outlook.com (2603:10b6:806:c0::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 12:33:18 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Fri, 21 Jul 2023
 12:33:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c7fe1fcd-27c2-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689942804;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=ureQDmAb34/07iNbPW+48n/vpU/rYoI8SODgabUAArY=;
  b=hpjfXB6KVblvCpGNNJppTNylNWdaE4Xl0h6bzYcXUHjqeAcMcCfQ/7cL
   CFwh1rpAM5JFusI0CSnhVtjUr4W6Re+vA2TuUbqsandwG/MICiC7SUH+B
   x5cmbvmGJxjttdBCdYq5Fbbx9A+y5uiq1PtmxHSybdjZ6URBkxnZgS0Ek
   4=;
X-IronPort-RemoteIP: 104.47.57.176
X-IronPort-MID: 117427983
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:izkkqq3lM9QHtQ/aXPbD5eZwkn2cJEfYwER7XKvMYLTBsI5bpzcAz
 TRMW2DTbquJN2ajfNokOt7i/UkH6JCBmtJmTlQ6pC1hF35El5HIVI+TRqvS04F+DeWYFR46s
 J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo
 tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5gNkPKgS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL
 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ
 OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfLWQJ1
 adCExQxYB2ngf3p+qq7dcVvmZF2RCXrFNt3VnBI6xj8VK9jbbWdBqLA6JlfwSs6gd1IEbDGf
 c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxqvC6Kk1IZPLvFabI5fvSQQspYhACAr
 3/u9GXlGBAKcteYzFJp91r137CTx3yqCNl6+LuQpqB2ukGf514oOTIsSFiYvOH+tRaDRIcKQ
 6AT0m90xUQoz2SvU9L0GROxpnWJuhoBc9NKFqsx7wTl4rrZ5UOVC3YJShZFacc6r4kmSDoyz
 FiLktj1Qzt1v9W9U3ud67PStjK0Nig9JHUHIyQDSGM4D8LLpYgyilfDS4hlGavs19ntQ2ivn
 XaNsTQ0gKgVgYgTzaKn8FvbgjWq4J/UUgoy4QaRVWWghu9kWLOYi0WTwQCzxZ59wEyxFDFtY
 FBsdxCi0d0z
IronPort-HdrOrdr: A9a23:jSyRE6zQwD/+ESUUe7WlKrPwDb1zdoMgy1knxilNYDd0Vuzdrc
 yqkP4H0wScskd1ZJhGo7290ci7LU80kKQe3WB/B9aftWXdyQmVxatZnPPfKkTbalTDH41mtZ
 uIEZIRNDSYNzETsS+d2njfLz9K+qjlzEnHv4jjJ0wGd3AMV0hr1XYcNu/KKCZLeDU=
X-Talos-CUID: =?us-ascii?q?9a23=3A2IC1KmgUMh2Vls213aMXd9YRMzJuXnia7CyKGGu?=
 =?us-ascii?q?EB2tNTqLKc0eQx49njJ87?=
X-Talos-MUID: 9a23:Thj5NAtmgixCMTeezM2n1G9+DttkwpaVOW83jJYlptHDCnRNJGLI
X-IronPort-AV: E=Sophos;i="6.01,220,1684814400"; 
   d="scan'208";a="117427983"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=SwcG7PYPaFJird6MPY6zWS086xK0ESR2E1cWL6MiMkPJ3b2glmXSooLicI9BwJMRLSuwI4gmrObNvYwdjEoR/LW8myQlW2KmPHtNd0RmPVwsRrcTrik8x6Kv1n/YEfA39ycslyBeLWpXcSa9tnuFv9J6ndlfjOddc96eDKGZkhxOcxBKUcEsh6PR7tJRlUnEBvVy0JkYqxX9rD1kGzMcVvb1dQFmlZo4ZOVnylVHJ8prXJdSEILvdslSR6kxy8Zc+kpkEc/fOLR5v33E8YAvVgGe+Jm88fsOaR65q2nTy0Dr6HLo2nUZc51T0AM33Yek0LeMljiCpTT3VwD8Fh60vA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=quS7JODlCbB3FnrYqh9DRjcgMUiIMuUVidrVDDdDvV8=;
 b=aZTr6pgo2cC2sQD+JdpcjVVPC6fKqf1LjeQXU0BqWooQEFx7VS7ozSpixwmUp3ML9s2LkbMEzLUfrWkdkPBhWf7NT11RiCwacSyzLPxWfHwDpCh/CEgVVxKy9qkbw1w1c9umQed0//k09wDmB2aPc+VZSbEFDgYv839jC8VDMCq9WNaCXKFA7/h+U5yWmfv7ac3NPiHmaSSGfC/PSA3VfZO7dcD/66AH2g5mkttkYHG6TBY35f2SuEtqfW/GJQ9tD6Z3b4yIKAiEGmOHsl+TzD6kCEuB12BnC13OUGgv0/O0n2159J6ZEOHpa1FnyJm0ArNA6mIy7XIWp+QnigNcJQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=quS7JODlCbB3FnrYqh9DRjcgMUiIMuUVidrVDDdDvV8=;
 b=jYLbnARw/CIYKPXfDtpJUamQFrd4oHSw9sQZrvCciW0I7aGFFIRZ0w3ahyHBkSjOfJ3ETUnOt4cc11B3XDUzzFW1jo1d3zvroqmD2IofiK+Lts+td3R+rGPxtb6TRwzm0CHqD5XbMRGLTOO9KpluaRhYvNMqKkhjKFiP74MIGMI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 21 Jul 2023 14:33:12 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Luca Fancellu <luca.fancellu@arm.com>
Cc: xen-devel@lists.xenproject.org, rahul.singh@arm.com
Subject: Re: [OSSTEST] ts-kernel-build: add kernel kconfig for the Arndale
Message-ID: <ZLp7CBp7ZYsYeuu-@MacBook-Air-de-Roger.local>
References: <20230721121627.1229906-1-luca.fancellu@arm.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230721121627.1229906-1-luca.fancellu@arm.com>
X-ClientProxiedBy: LO2P265CA0424.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:a0::28) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA0PR03MB5658:EE_
X-MS-Office365-Filtering-Correlation-Id: 41c901df-d4c9-4a13-7572-08db89e6a965
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	X0y/+0x0clQb7T/rh5kVvVTQ4F8y50cBIjR6r4PKycGaYUcW0k0t77LjP9URNocnsiEN9kBPfLbMtZYAHEFVLbFWoKIqOy2WHnePhxr07ZHiRYRC05eFSRnqJPpo7cPCOnPJnSxSXO7ij7mrj7Rj8a2G/NMNSXNN5kywzzBCQgliTYE3xGc6ijXjYW9z1NclaJEwho5ju/qDMlMvStk0/Kb/rU4iVKUMHuO2LrGOt0H4Mln9EqXdN9403QhzuMgHCOe7QCV5BIt07vACR825eGFr2lhysGUGK1rD+c1v8iMZ9Ef8bzBrahW8buGzO7OO+d9Qut6afRgSdSsOf66Ki3ghRGbCt/QcwRd5T4i2wSnyFnGU9gKzwryN4aMTcX/W0AItlgjp7WZ6jQN/mp4X8zNy+LCIMEuJ+Lq95PZcZKzrMHNVM8cfFVN8Efz9xiQSwAboDazVeysM3WTPmISxgRJuFLvG5ZqRbCEi6B14ZfvSg1HTOmz4Ro1PzcRNuSZ7/JmVlFVvGOXsUTHEa0y2ZwRLGY95fQrDFjjip6JCqmUKTpUo+wtLqNhv8kD0ywcW
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(366004)(136003)(346002)(396003)(451199021)(8676002)(8936002)(186003)(26005)(6506007)(86362001)(6512007)(9686003)(5660300002)(66556008)(66946007)(6666004)(85182001)(478600001)(2906002)(82960400001)(41300700001)(6486002)(38100700002)(4326008)(6916009)(66476007)(316002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?N2VBRC82YlRHN2F4MDFPOUdEREFLRStRdDNHRDdXNFVPakQ5V05MK3RyOWgw?=
 =?utf-8?B?Y2RBdm9GYXZieVA2V1E0M0RPSGRYN0FqODI2Mm44bFowUVBka3BhMU4vdHVX?=
 =?utf-8?B?cHp2MHVmSWlzeExZQVE4R1RwWW5HZ21oeGdEeG5USGZiNUFhejhFNTVrWU9R?=
 =?utf-8?B?bE9hbHhERGRFbUNmRlN6YzB6VEpucE9yRUkyeno5RUhJQmhoRFYzM0psZ3BM?=
 =?utf-8?B?dXhHQ3VEZzF5OHBxOEFsTiszM3lmb1U2a0VSR3VZeGFYcHo2SDJCUDhJVks0?=
 =?utf-8?B?K1I2RC9CTS9Zd3dERXVoenZ5ck9BRTJoZ3JzdHBnZDdjRVpEazhoaFlYZDFl?=
 =?utf-8?B?d1RuQUV5dHlnWjV5UVV4eHUwdDRGVVMvVVAyY3Q5TURvRnVZUnBtRnpNRHUy?=
 =?utf-8?B?TUNOZVYyUEVYYWRWelJrVkx4TDBhdnJRVzdYYStJbWdtQTBHVFFsWVAwWno0?=
 =?utf-8?B?T0VBYlBCeG5EYTI2RFQvQ2MzMG1Zc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:
	GgO5TlVv/bWge63htOQt9/RbJETj4KZa4GyUyNVpKjqAEhipIOGDvnSgWj7DiUHhdTexd9k+n0O0TDuczkFO9IaS6z1qNZeSyEMatZ20LjxtBhIKTpvGGYvLp0IVlk7aDpWr15DWvCxd+EbYqDsPKyA3CoO64jJPLayTjVYaAmFiSOkdwgvQvs0oKwiM5lWy1nB4yrdt2KHDtDRxmvIYRBLjVqzX3r/Lxk9KhM/00ROEUzBjWeuCKLKaFJ3GCCDd5jQCwZD6oDexzDK37I3cpBHntCQa2IZ+ngKalkN6/2JQ7C2AQlX2qnVR5bTvoGmS6zCWOnztH+jwTH8AUPBLGPoz+7+qqKjVf3OAiqZ/Hx8AOHJEJ63Bv1AsJEQ6kdyGVlJoDAUHCBYxNsjdnv636JQQ0/CcGw5lILb/pyy4Sre1ZNg4VgZdB+qcrAjJso/wa9FviXUCLcBPema2J7U7iqLCMK23aiCjLM0q8AWLuDjlrlv47k54WFtJvKnhQNaHX/A17ZMHdCybiEGLcyFdqdMGSt/xPbJBv15RhMBQJnEVc0AQePCpkcoaPeX20PYTge4rAxQ9bX76zEU4K9hko3YrYvL0BnpzxIbgwgBUv2geujnRoi6G9nM+7g2N6uvBW0vpUjfIDZtPaYXrXBrtsV4VdsZbaq3do/E+fXJ8N5xot/CNEO2x3j/CQE6oe2P+T7X2pt76uhJU3vTEBr3Fnq/McwPOi+Mh26klFreJfhn4/YfLa/OHE6k74z5LVUn53xiKZRVbAiYq06tOF76QMaXqwk9g1HB6oAJKQZWf1LQ=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 41c901df-d4c9-4a13-7572-08db89e6a965
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 12:33:18.3442
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: dAMiEnP7PLEVWxBLF0GH5CsDiKAIkq4K+bxZ+W0SfEBUAK0N8mNEDKoi5wE6/akC7Lu1PunOjJeDzP+HrEGALw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR03MB5658

On Fri, Jul 21, 2023 at 01:16:27PM +0100, Luca Fancellu wrote:
> The Linux commit 33629d35090f5ce2b1b4ce78aa39954c603536d5 has
> removed the 'snps,dwc-ahci' compatible from the generic
> AHCI-platform driver control module selected by
> CONFIG_SATA_AHCI_PLATFORM.
> 
> A new driver, the DWC AHCI SATA platform driver is now implemented
> and handles the above compatible when CONFIG_AHCI_DWC is selected.
> 
> The module is needed for the Arndale board to have the SATA controller
> working, so enable the CONFIG_AHCI_DWC as additional kconfig parameter
> in ts-kernel-build.
> 
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>

Acked-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

> ---
> Tested successfully on:
>  - arndale-lakeside
>  - arndale-metrocentre
>  - arndale-westfield
> 
> arndale-bluewater must have some HW issue, don't have much more info ATM.
> ---
>  ts-kernel-build | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/ts-kernel-build b/ts-kernel-build
> index 6c8f1d6a..73104874 100755
> --- a/ts-kernel-build
> +++ b/ts-kernel-build
> @@ -245,6 +245,7 @@ setopt CONFIG_SENSORS_LM90 n
>  setopt CONFIG_ICS932S401 n
>  
>  # Enable some additional drivers for Arndale.
> +setopt CONFIG_AHCI_DWC y

I would have added at the bottom of the Arndale list, but it's easier
for context to see it belongs in the Arndale section.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 12:44:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 12:44:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567522.886677 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMpUm-0000mk-LO; Fri, 21 Jul 2023 12:44:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567522.886677; Fri, 21 Jul 2023 12:44:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMpUm-0000md-Ip; Fri, 21 Jul 2023 12:44:32 +0000
Received: by outflank-mailman (input) for mailman id 567522;
 Fri, 21 Jul 2023 12:44:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMpUl-0000mX-09
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 12:44:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMpUk-0004zl-IJ; Fri, 21 Jul 2023 12:44:30 +0000
Received: from 54-240-197-231.amazon.com ([54.240.197.231]
 helo=[192.168.21.208]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMpUk-0006jw-6K; Fri, 21 Jul 2023 12:44:30 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=vezG7P86YW8rpMLEBrIHMikzp9nyfrYQMYYaAdWSAnc=; b=6eiwZbd+x0Jts70XwCwxadccwp
	lmeHTdsKL1hQT67HPXU4D4El8HIg3VY5280WgzH2YfuNkdLu9SghJ13eWHXd1M91hf78vqpSrRTu1
	zTSIWYD+W1uW+RMl9d034FKhtiQbD9Y6o61Po6QstFdaDBV/aKsBRncV8H1pwxf7rkvY=;
Message-ID: <bf07cb42-eace-333f-4421-c0cfe0087d9a@xen.org>
Date: Fri, 21 Jul 2023 13:44:28 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v2] xen/arm: Move TEE mediators in a kconfig submenu
Content-Language: en-US
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Jens Wiklander <jens.wiklander@linaro.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <c55ce2891172a696e8a29f8c9bcc9dd33ebe9e50.1689931326.git.bertrand.marquis@arm.com>
 <e6d72d9a-a146-733c-0a9b-016fb291c2ea@xen.org>
 <B5883910-D35A-404B-8EBA-8AAB6C093342@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <B5883910-D35A-404B-8EBA-8AAB6C093342@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 21/07/2023 13:28, Bertrand Marquis wrote:
>> On 21 Jul 2023, at 12:00, Julien Grall <julien@xen.org> wrote:
>>
>> Hi Bertrand,
>>
>> On 21/07/2023 10:23, Bertrand Marquis wrote:
>>> Rework TEE mediators to put them under a submenu in Kconfig.
>>> The submenu is only visible if UNSUPPORTED is activated as all currently
>>> existing mediators are UNSUPPORTED.
>>> While there rework a bit the configuration so that OP-TEE and FF-A
>>> mediators are selecting the generic TEE interface instead of depending
>>> on it.
>>> Make the TEE option hidden as it is of no interest for anyone to select
>>> it without one of the mediators so having them select it instead should
>>> be enough.
>>> Rework makefile inclusion and selection so that generic TEE is included
>>> only when selected and include the tee Makefile all the time making the
>>> directory tee self contained.
>>
>> Is this a left over?
> 
> Oups yes, please remove.
> 
>>
>>> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
>>> ---
>>> Changes in v2:
>>> - only included tee subdirectory in makefile if CONFIG_TEE is selected
>>>    (reverts to state before patch)
>>> - remove help in hidden TEE config
>>> - rebase on top of staging
>>> ---
>>>   xen/arch/arm/Kconfig      |  7 -------
>>>   xen/arch/arm/tee/Kconfig  | 17 ++++++++++++++---
>>>   xen/arch/arm/tee/Makefile |  2 +-
>>>   3 files changed, 15 insertions(+), 11 deletions(-)
>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>> index 439cc94f3344..fd57a82dd284 100644
>>> --- a/xen/arch/arm/Kconfig
>>> +++ b/xen/arch/arm/Kconfig
>>> @@ -175,13 +175,6 @@ config ARM64_BTI
>>>      Branch Target Identification support.
>>>      This feature is not supported in Xen.
>>>   -config TEE
>>> - bool "Enable TEE mediators support (UNSUPPORTED)" if UNSUPPORTED
>>> - default n
>>> - help
>>> -   This option enables generic TEE mediators support. It allows guests
>>> -   to access real TEE via one of TEE mediators implemented in XEN.
>>> -
>>>   source "arch/arm/tee/Kconfig"
>>>     config STATIC_SHM
>>> diff --git a/xen/arch/arm/tee/Kconfig b/xen/arch/arm/tee/Kconfig
>>> index db3ea78faaaa..c5b0f88d7522 100644
>>> --- a/xen/arch/arm/tee/Kconfig
>>> +++ b/xen/arch/arm/tee/Kconfig
>>> @@ -1,7 +1,14 @@
>>> +menu "TEE mediators"
>>> + visible if UNSUPPORTED
>>> +
>>> +config TEE
>>> + bool
>>> + default n
>>> +
>>>   config OPTEE
>>> - bool "Enable OP-TEE mediator"
>>> + bool "Enable OP-TEE mediator (UNSUPPORTED)" if UNSUPPORTED
>>>    default n
>>> - depends on TEE
>>> + select TEE
>>>    help
>>>      Enable the OP-TEE mediator. It allows guests to access
>>>      OP-TEE running on your platform. This requires
>>> @@ -12,10 +19,14 @@ config OPTEE
>>>   config FFA
>>>    bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
>>>    default n
>>> - depends on ARM_64 && TEE
>>> + depends on ARM_64
>>> + select TEE
>>>    help
>>>      This option enables a minimal FF-A mediator. The mediator is
>>>      generic as it follows the FF-A specification [1], but it only
>>>      implements a small subset of the specification.
>>>        [1] https://developer.arm.com/documentation/den0077/latest
>>> +
>>> +endmenu
>>> +
>>> diff --git a/xen/arch/arm/tee/Makefile b/xen/arch/arm/tee/Makefile
>>> index 58a1015e40e0..1ef49a271fdb 100644
>>> --- a/xen/arch/arm/tee/Makefile
>>> +++ b/xen/arch/arm/tee/Makefile
>>> @@ -1,3 +1,3 @@
>>>   obj-$(CONFIG_FFA) += ffa.o
>>> -obj-y += tee.o
>>> +obj-$(CONFIG_TEE) += tee.o
>>>   obj-$(CONFIG_OPTEE) += optee.o
>>
>> Same here? The rest LGTM and I would be happy to do the changes on commit.
> 
> This one is not, I think it is more logic to keep that one like this so that if someone
> creates a TEE not depending on this it could still put it here without compiling tee.o
> for no reason.
This seems pretty unlikely to me because the purpose of TEE is to 
provide a generic interface to the common code. At least, the developer 
would need to have a very good reason to diverge.

Also, right now, make will not recurse to the directory tee if 
CONFIG_TEE=n. So I would rather not have this change.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 12:48:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 12:48:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567525.886688 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMpYf-0001OV-62; Fri, 21 Jul 2023 12:48:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567525.886688; Fri, 21 Jul 2023 12:48:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMpYf-0001OO-3L; Fri, 21 Jul 2023 12:48:33 +0000
Received: by outflank-mailman (input) for mailman id 567525;
 Fri, 21 Jul 2023 12:48:32 +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 <SRS0=0odj=DH=suse.com=pmladek@srs-se1.protection.inumbo.net>)
 id 1qMpYe-0001OI-7e
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 12:48:32 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e48c2b77-27c4-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 14:48:30 +0200 (CEST)
Received: from relay2.suse.de (relay2.suse.de [149.44.160.134])
 by smtp-out1.suse.de (Postfix) with ESMTP id 48998218A2;
 Fri, 21 Jul 2023 12:48:29 +0000 (UTC)
Received: from suse.cz (pmladek.tcp.ovpn2.prg.suse.de [10.100.208.146])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by relay2.suse.de (Postfix) with ESMTPS id 9B7942C142;
 Fri, 21 Jul 2023 12:48:28 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e48c2b77-27c4-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1689943709; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=OPAFYCvki0R2yUMG2eLy5Z6FQniLXjJC6TpkA0OHteg=;
	b=DnVoiF3/3b0WjnMWqR8QQZVAebQRIbzRBVKVFHHAPTvAYCtIHxI6ht27OVjpY6pWnxp+rJ
	OBQfNSNg10V81vcAOMZlP8LNogx+sYsBLt6EQQAq/k88/Yqi+bA7NjVbwEDwoh79nP9glr
	gPh4ovB+XigMcs0uQ/x2sBCkwacfO6A=
Date: Fri, 21 Jul 2023 14:48:24 +0200
From: Petr Mladek <pmladek@suse.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: boris.ostrovsky@oracle.com, jgross@suse.com,
	xen-devel@lists.xenproject.org, Luca Miccio <lucmiccio@gmail.com>,
	Stefano Stabellini <stefano.stabellini@xilinx.com>,
	live-patching@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH LINUX v5 2/2] xen: add support for initializing xenstore
 later as HVM domain
Message-ID: <ZLp-mAc1aFEgbVgS@alley>
References: <alpine.DEB.2.22.394.2205131417320.3842@ubuntu-linux-20-04-desktop>
 <20220513211938.719341-2-sstabellini@kernel.org>
 <ZLgFmS4TQwGWA7o0@alley>
 <alpine.DEB.2.22.394.2307191841290.3118466@ubuntu-linux-20-04-desktop>
 <ZLkKAO09DnM8quG-@alley>
 <alpine.DEB.2.22.394.2307201629190.3118466@ubuntu-linux-20-04-desktop>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.22.394.2307201629190.3118466@ubuntu-linux-20-04-desktop>

On Thu 2023-07-20 16:31:16, Stefano Stabellini wrote:
> On Thu, 20 Jul 2023, Petr Mladek wrote:
> > On Wed 2023-07-19 18:46:08, Stefano Stabellini wrote:
> > > On Wed, 19 Jul 2023, Petr Mladek wrote:
> > > > I see the following warning from free_irq() in 6.5-rc2 when running
> > > > livepatching selftests. It does not happen after reverting this patch.
> > > > 
> > > > [  352.168453] livepatch: signaling remaining tasks
> > > > [  352.173228] ------------[ cut here ]------------
> > > > [  352.175563] Trying to free already-free IRQ 0
> > > > [  352.177355] WARNING: CPU: 1 PID: 88 at kernel/irq/manage.c:1893 free_irq+0xbf/0x350
> > > > [  352.179942] Modules linked in: test_klp_livepatch(EK)
> > > > [  352.181621] CPU: 1 PID: 88 Comm: xenbus_probe Kdump: loaded Tainted: G            E K    6.5.0-rc2-default+ #535
> > > > [  352.184754] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.15.0-0-g2dd4b9b-rebuilt.opensuse.org 04/01/2014
> > > > [  352.188214] RIP: 0010:free_irq+0xbf/0x350
[...]
> > > > [  352.213951] Call Trace:
> > > > [  352.214390]  <TASK>
> > > > [  352.214717]  ? __warn+0x81/0x170
> > > > [  352.215436]  ? free_irq+0xbf/0x350
> > > > [  352.215906]  ? report_bug+0x10b/0x200
> > > > [  352.216408]  ? prb_read_valid+0x17/0x20
> > > > [  352.216926]  ? handle_bug+0x44/0x80
> > > > [  352.217409]  ? exc_invalid_op+0x13/0x60
> > > > [  352.217932]  ? asm_exc_invalid_op+0x16/0x20
> > > > [  352.218497]  ? free_irq+0xbf/0x350
> > > > [  352.218979]  ? __pfx_xenbus_probe_thread+0x10/0x10
> > > > [  352.219600]  xenbus_probe+0x7a/0x80
> > > > [  352.221030]  xenbus_probe_thread+0x76/0xc0
> > > > [  352.221416]  ? __pfx_autoremove_wake_function+0x10/0x10
> > > > [  352.221882]  kthread+0xfd/0x130
> > > > [  352.222191]  ? __pfx_kthread+0x10/0x10
> > > > [  352.222544]  ret_from_fork+0x2d/0x50
> > > > [  352.222893]  ? __pfx_kthread+0x10/0x10
> > > > [  352.223260]  ret_from_fork_asm+0x1b/0x30
> > 
> > I do not know where exactly it triggers the XEN code.
> > 
> > > but it would seem
> > > that either:
> > > 1) free_irq is called twice
> > > 2) free_irq is called but xs_init_irq wasn't initialized before
> > > 
> > > For 2) I can see that xenbus_probe() is called in a few cases where
> > > xs_init_irq wasn't set. Something like the below would make the warning
> > > go away but it would be nice to figure out which one is the code path
> > > taken that originally triggered the warning.
> > 
> > I added some debugging messages and:
> > 
> >   + xenbus_probe() was called in xenbus_probe_thread().
> > 
> >   + xenbus_init() returned early after xen_domain() check so that
> >     xs_init_irq was never initialized.
> > 
> > Note that I use KVM and not XEN:
> > 
> > [    0.000000] Hypervisor detected: KVM
> > [...]
> > [    0.072150] Booting paravirtualized kernel on KVM
> 
> Ah! So the issue is that xenbus_init() returns early but
> xenbus_probe_initcall() doesn't. So maybe we just need a xen_domain
> check in xenbus_probe_initcall too.
> 
> diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
> index 58b732dcbfb8..e9bd3ed70108 100644
> --- a/drivers/xen/xenbus/xenbus_probe.c
> +++ b/drivers/xen/xenbus/xenbus_probe.c
> @@ -811,6 +812,9 @@ static int xenbus_probe_thread(void *unused)
>  
>  static int __init xenbus_probe_initcall(void)
>  {
> +	if (!xen_domain())
> +		return -ENODEV;
> +
>  	/*
>  	 * Probe XenBus here in the XS_PV case, and also XS_HVM unless we
>  	 * need to wait for the platform PCI device to come up or

I confirm that this change cures the problem as well. Feel free
to add:

Tested-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 12:58:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 12:58:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567528.886698 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMphx-0002uE-41; Fri, 21 Jul 2023 12:58:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567528.886698; Fri, 21 Jul 2023 12:58:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMphx-0002u7-0X; Fri, 21 Jul 2023 12:58:09 +0000
Received: by outflank-mailman (input) for mailman id 567528;
 Fri, 21 Jul 2023 12:58:08 +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
 <SRS0=So7w=DH=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qMphv-0002u0-Vf
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 12:58:08 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20626.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::626])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3a724bda-27c6-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 14:58:03 +0200 (CEST)
Received: from DUZPR01CA0125.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4bc::17) by DB8PR08MB5450.eurprd08.prod.outlook.com
 (2603:10a6:10:116::22) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 12:57:59 +0000
Received: from DBAEUR03FT020.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4bc:cafe::3a) by DUZPR01CA0125.outlook.office365.com
 (2603:10a6:10:4bc::17) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28 via Frontend
 Transport; Fri, 21 Jul 2023 12:57:59 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT020.mail.protection.outlook.com (100.127.143.27) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.34 via Frontend Transport; Fri, 21 Jul 2023 12:57:59 +0000
Received: ("Tessian outbound d7adc65d10b4:v145");
 Fri, 21 Jul 2023 12:57:59 +0000
Received: from 965718d946b0.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 D593F57C-A0A1-4312-B2B2-3D15B7033F96.1; 
 Fri, 21 Jul 2023 12:57:52 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 965718d946b0.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 21 Jul 2023 12:57:52 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by AS8PR08MB8184.eurprd08.prod.outlook.com (2603:10a6:20b:561::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Fri, 21 Jul
 2023 12:57:45 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe%4]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 12:57:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3a724bda-27c6-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5HWskh0fveJJhMerzTrltd9IHGI51igmE7n2ra54Tmc=;
 b=iXAflzj7hgwGsmOsYq5wOxjutfWc8pobl+XauwhPe8ogT3lX68uEdV1S2oR95T9KTJwdKYUX+BeENtSWFpwZcLh1qG3gfsjVEgWalTpK5+TMrOP8vSm8uiNfbC+PTwh2GqZhPQdOQDtMYFmdrzv+7uMM9rFA9RHKHlhuuYl94mk=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: cf99cb2163f05b23
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=c2kDU5AQxMJO1vKmyYpme+IdMEN/9mj4uw+I1RX4NzH5efFS1Abgm8n6tJsTWNaiv9FJOrHNjMC2ry1pzcpCDnXduIV6K3ErDOFbVMzLPzWgOF6ie7XFHwQ66iFnDKS3oTIATJpGKDBS6cofZGlaQ28605d8BswdVQfNxjRuTlCIKtJFo7lEUWhecCY0nDx9M61Z62/u8QmiLsxVl5ZT3vHJSuehSn+hy76r1QIjrAh39dN4FMVq/fgEt8xL1N1FinyBpK/3i+6ARi+nGgzWJM8xVne9HDBcslWlAVBjmC52zpjFZkUlGQ5S0Ha4BXEXFSWEpkDqobNAFXgxSFEMeA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5HWskh0fveJJhMerzTrltd9IHGI51igmE7n2ra54Tmc=;
 b=aRc/cbex2AW8eJvUROea8BO3fEsAynnFnN7LyuGMgrxXfVezPt+fk3WxNswopTJ3yh7DUuFv0e1Ahieg/4QgyOxo3D7y1HH0Nyvu1iVWIvi/qtOqqHaLN+QFqADYldauMtOiiAlVmFK6T3ROLYuJE4TWdLdddFWnHaXroHBWv3P9T/Qf6ONB1NqOcXkoyzEhZGMGpzMwnMnS+nmb42rIW9Nv0oxdEpkeg4NOTdx1h15IK4+LgNw3Tc2lIj7L+246aHkUAVBketq/wlRzxCXknafvvzZ/EJYp1KBvm85D5b7vU1v1UrV4wNE1jFM0fE0R1napgFT88kJoTkr61F9Vig==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5HWskh0fveJJhMerzTrltd9IHGI51igmE7n2ra54Tmc=;
 b=iXAflzj7hgwGsmOsYq5wOxjutfWc8pobl+XauwhPe8ogT3lX68uEdV1S2oR95T9KTJwdKYUX+BeENtSWFpwZcLh1qG3gfsjVEgWalTpK5+TMrOP8vSm8uiNfbC+PTwh2GqZhPQdOQDtMYFmdrzv+7uMM9rFA9RHKHlhuuYl94mk=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Jens Wiklander
	<jens.wiklander@linaro.org>, Stefano Stabellini <sstabellini@kernel.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH v2] xen/arm: Move TEE mediators in a kconfig submenu
Thread-Topic: [PATCH v2] xen/arm: Move TEE mediators in a kconfig submenu
Thread-Index: AQHZu7UoTgj0ElhTvUC42VsaPH5iba/D/OyAgAApYgCAAAR0AIAAA6qA
Date: Fri, 21 Jul 2023 12:57:45 +0000
Message-ID: <AF6DD999-0121-4AEE-BA01-890AC5E3490C@arm.com>
References:
 <c55ce2891172a696e8a29f8c9bcc9dd33ebe9e50.1689931326.git.bertrand.marquis@arm.com>
 <e6d72d9a-a146-733c-0a9b-016fb291c2ea@xen.org>
 <B5883910-D35A-404B-8EBA-8AAB6C093342@arm.com>
 <bf07cb42-eace-333f-4421-c0cfe0087d9a@xen.org>
In-Reply-To: <bf07cb42-eace-333f-4421-c0cfe0087d9a@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|AS8PR08MB8184:EE_|DBAEUR03FT020:EE_|DB8PR08MB5450:EE_
X-MS-Office365-Filtering-Correlation-Id: dd849cfa-2943-4125-469d-08db89ea1c5b
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 +ci4zqYl2dts8OsIBNq39sPhJ6kokFbzpNLPzzTgPMt0IeTxNJx/HSBqptFzvN2ckrUFoTVI9iLnin0rNzRbsPLOqiXLsKaWReT4zy1+oPipWbEbf6UfcbhaelNWeDan4nqw/OoqI8lRCuTe2tEQ7I4mSC7JP3MTMcaoELnvRpKKRR3Xcu8mMEpm2fRJo/yyRI1ZT2abUI0vtMIzREVUaaSquPTmh8t9Gy2sYLjIQupAkbRqHmb73ixesFGH7t7BQBG+xTz90M5uP0Qeb/Z0cMfbsZKDq49w0yEVcjBuGs/zFNuOSgkq/u69Fqp+t7eLuL72mtzx9uO8pQIsxexgiT3h96hqFhacA0DoVcwd5ATUlNCl+Dg6ELL7WPpbA+wtIHuBvtFE7D6AAFKSpyGTophLFHl6/lukPal2YYvd8QCx9aB7oct6u57STGqEW/CWhu22L5vu44kQa/0SyqjS5JqaxfXXZ+P64aZWwYksikrWVHUjDf4j0BEo1znlx3Om7OaQdhiW8nV57Ji+J8i5tN0uoMyk3YtM9GJcKyXeqbKItm6E5cGlZMpOV2dWnq0LivVgXerbtSiEgDikVjU8NFDIRXUD/qETIIkkK8R6VCE1vCkbXZVmLSVFDX5I/6s8QWzNA0kFOZK3C0JLZu+cQw==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(376002)(39860400002)(136003)(366004)(451199021)(2906002)(83380400001)(2616005)(38070700005)(86362001)(33656002)(36756003)(122000001)(38100700002)(41300700001)(53546011)(6506007)(6486002)(966005)(66446008)(66476007)(76116006)(91956017)(66946007)(6916009)(71200400001)(4326008)(64756008)(316002)(66556008)(26005)(186003)(6512007)(8936002)(8676002)(478600001)(54906003)(5660300002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <DDACD96C1D185141A02394353D431BE5@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8184
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT020.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	b4cc738e-b04f-46fb-0ae2-08db89ea1435
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	+yVehJbByawtV+aqJbpWiGlilxAGR33TH8oCzVAEkzhgzJMRer0btuN8F3jNEBBh5sv86wLGYWrvftsiFAYz52mpWwxDrPzmENS3GdEIn00qIc5vDLHtsr/mKT0ds2aReyQZwNbLkPJjbbhj87Bq/JQJ/2VTdiEGHkw7TkwzNu3tCTHtgBk74TkNZtTmz6B00DK2P7g0a8myANIsnMFDRrL+8Wqtautqw96GT0bzkho3CUzX3vq1hp/iwM1FnNMcokK0lFkZUoxKPiRLo1OIUqo+fr9oZBOuV27s/qDrsectQ/MjJsLXMF1HmVcrmgv4xg8eGm6J4B0IhUikfofjbBOy2ih4k3ecfHemgvfSpPdv0bz4EGGZP+LGFj+KHm2Mh9RGmSv1P74qLiAOiuMpxq/nrnugeDws4T6SQeacFKcuY1LJTu8F1G3thl8hCC/yznyJ2ii4fJwhlsMXy4PBiEJF10jWHOQCGEthpfTpEG4NUZ0/vIZ3Ts5nP9YGGGnicUfNU0Azd+FXX07ndIBXO5zMNRhklqneomtPwzeDb7nl2fTzCKFvzxxm7+4LwHKkJ8FV6fCOg3uME3q8pnOJGoLc1fSIJna/i9dOvUOQ4TtLNqett0VzaCAmleq9LO0JOlvREdgCQCdLWzgRzlsOSxblnfH+MJ52+TwZiuvbq8nEpnczJP2/g1tHlJywFrudnwFPNUIlOkUAFoGqWK1g1A6LWx2XwyME647IAfR+qF0=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(346002)(39860400002)(376002)(82310400008)(451199021)(46966006)(36840700001)(40470700004)(54906003)(6486002)(478600001)(966005)(6512007)(36860700001)(40460700003)(83380400001)(33656002)(86362001)(40480700001)(6862004)(2906002)(2616005)(107886003)(336012)(36756003)(186003)(53546011)(6506007)(47076005)(26005)(82740400003)(81166007)(356005)(70586007)(4326008)(70206006)(316002)(41300700001)(5660300002)(8676002)(8936002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 12:57:59.4153
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: dd849cfa-2943-4125-469d-08db89ea1c5b
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT020.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5450

Hi Julien,

> On 21 Jul 2023, at 14:44, Julien Grall <julien@xen.org> wrote:
>=20
> Hi,
>=20
> On 21/07/2023 13:28, Bertrand Marquis wrote:
>>> On 21 Jul 2023, at 12:00, Julien Grall <julien@xen.org> wrote:
>>>=20
>>> Hi Bertrand,
>>>=20
>>> On 21/07/2023 10:23, Bertrand Marquis wrote:
>>>> Rework TEE mediators to put them under a submenu in Kconfig.
>>>> The submenu is only visible if UNSUPPORTED is activated as all current=
ly
>>>> existing mediators are UNSUPPORTED.
>>>> While there rework a bit the configuration so that OP-TEE and FF-A
>>>> mediators are selecting the generic TEE interface instead of depending
>>>> on it.
>>>> Make the TEE option hidden as it is of no interest for anyone to selec=
t
>>>> it without one of the mediators so having them select it instead shoul=
d
>>>> be enough.
>>>> Rework makefile inclusion and selection so that generic TEE is include=
d
>>>> only when selected and include the tee Makefile all the time making th=
e
>>>> directory tee self contained.
>>>=20
>>> Is this a left over?
>> Oups yes, please remove.
>>>=20
>>>> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
>>>> ---
>>>> Changes in v2:
>>>> - only included tee subdirectory in makefile if CONFIG_TEE is selected
>>>>   (reverts to state before patch)
>>>> - remove help in hidden TEE config
>>>> - rebase on top of staging
>>>> ---
>>>>  xen/arch/arm/Kconfig      |  7 -------
>>>>  xen/arch/arm/tee/Kconfig  | 17 ++++++++++++++---
>>>>  xen/arch/arm/tee/Makefile |  2 +-
>>>>  3 files changed, 15 insertions(+), 11 deletions(-)
>>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>>> index 439cc94f3344..fd57a82dd284 100644
>>>> --- a/xen/arch/arm/Kconfig
>>>> +++ b/xen/arch/arm/Kconfig
>>>> @@ -175,13 +175,6 @@ config ARM64_BTI
>>>>     Branch Target Identification support.
>>>>     This feature is not supported in Xen.
>>>>  -config TEE
>>>> - bool "Enable TEE mediators support (UNSUPPORTED)" if UNSUPPORTED
>>>> - default n
>>>> - help
>>>> -   This option enables generic TEE mediators support. It allows guest=
s
>>>> -   to access real TEE via one of TEE mediators implemented in XEN.
>>>> -
>>>>  source "arch/arm/tee/Kconfig"
>>>>    config STATIC_SHM
>>>> diff --git a/xen/arch/arm/tee/Kconfig b/xen/arch/arm/tee/Kconfig
>>>> index db3ea78faaaa..c5b0f88d7522 100644
>>>> --- a/xen/arch/arm/tee/Kconfig
>>>> +++ b/xen/arch/arm/tee/Kconfig
>>>> @@ -1,7 +1,14 @@
>>>> +menu "TEE mediators"
>>>> + visible if UNSUPPORTED
>>>> +
>>>> +config TEE
>>>> + bool
>>>> + default n
>>>> +
>>>>  config OPTEE
>>>> - bool "Enable OP-TEE mediator"
>>>> + bool "Enable OP-TEE mediator (UNSUPPORTED)" if UNSUPPORTED
>>>>   default n
>>>> - depends on TEE
>>>> + select TEE
>>>>   help
>>>>     Enable the OP-TEE mediator. It allows guests to access
>>>>     OP-TEE running on your platform. This requires
>>>> @@ -12,10 +19,14 @@ config OPTEE
>>>>  config FFA
>>>>   bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
>>>>   default n
>>>> - depends on ARM_64 && TEE
>>>> + depends on ARM_64
>>>> + select TEE
>>>>   help
>>>>     This option enables a minimal FF-A mediator. The mediator is
>>>>     generic as it follows the FF-A specification [1], but it only
>>>>     implements a small subset of the specification.
>>>>       [1] https://developer.arm.com/documentation/den0077/latest
>>>> +
>>>> +endmenu
>>>> +
>>>> diff --git a/xen/arch/arm/tee/Makefile b/xen/arch/arm/tee/Makefile
>>>> index 58a1015e40e0..1ef49a271fdb 100644
>>>> --- a/xen/arch/arm/tee/Makefile
>>>> +++ b/xen/arch/arm/tee/Makefile
>>>> @@ -1,3 +1,3 @@
>>>>  obj-$(CONFIG_FFA) +=3D ffa.o
>>>> -obj-y +=3D tee.o
>>>> +obj-$(CONFIG_TEE) +=3D tee.o
>>>>  obj-$(CONFIG_OPTEE) +=3D optee.o
>>>=20
>>> Same here? The rest LGTM and I would be happy to do the changes on comm=
it.
>> This one is not, I think it is more logic to keep that one like this so =
that if someone
>> creates a TEE not depending on this it could still put it here without c=
ompiling tee.o
>> for no reason.
> This seems pretty unlikely to me because the purpose of TEE is to provide=
 a generic interface to the common code. At least, the developer would need=
 to have a very good reason to diverge.
>=20
> Also, right now, make will not recurse to the directory tee if CONFIG_TEE=
=3Dn. So I would rather not have this change.

Ok will fix in v3.

Cheers
Bertrand

>=20
> Cheers,
>=20
> --=20
> Julien Grall




From xen-devel-bounces@lists.xenproject.org Fri Jul 21 13:06:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 13:06:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567532.886707 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMppi-0004bD-VX; Fri, 21 Jul 2023 13:06:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567532.886707; Fri, 21 Jul 2023 13:06:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMppi-0004b6-Sn; Fri, 21 Jul 2023 13:06:10 +0000
Received: by outflank-mailman (input) for mailman id 567532;
 Fri, 21 Jul 2023 13:06:09 +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
 <SRS0=dNy0=DH=citrix.com=prvs=559993d03=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMpph-0004b0-1S
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 13:06:09 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 596bc526-27c7-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 15:06:06 +0200 (CEST)
Received: from mail-dm6nam12lp2171.outbound.protection.outlook.com (HELO
 NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.171])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 21 Jul 2023 09:06:03 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by DM4PR03MB6062.namprd03.prod.outlook.com (2603:10b6:5:391::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 13:05:59 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Fri, 21 Jul 2023
 13:05:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 596bc526-27c7-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689944766;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=dHbDsbMtoJL7+K8YhHWOVA2z5NN2itLxkFUiz01E3Bk=;
  b=QUGquqZUkLGwYlRiCN7coemld+LlrY0gl9Jj5D2Awf66+073Imy5jsjs
   CVoJg1v3BE3/Dvoy1e9AFdmBNtcddLKNPFydoqFfIhdEz8j0kVT28yjJJ
   SUw4x5OyJn6N+j+M3FDVID90NFjVFiASGVmtpJsyHmhak4ruGn1RsI9O/
   M=;
X-IronPort-RemoteIP: 104.47.59.171
X-IronPort-MID: 117431435
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:rxPXkaB51bthKhVW/+7iw5YqxClBgxIJ4kV8jS/XYbTApGhw0GcEx
 zEfDGvVaaveNGX8e9hyPIrkpk5U65aBy9EyQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h
 yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs
 t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GxC5wRnDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS
 uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada
 jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIw4v4qCHxSy
 acjLz0ofBCYjqG3+b69Rbw57igjBJGD0II3nFhFlGucIdN4BJfJTuPN+MNS2yo2ioZWB/HCa
 sEFaD1pKhPdfxlIPVRRA5U79AuqriCnL3sE9xTI9OxuvDG7IA9ZidABNPLPfdOHX4NNl1uwr
 WPa5WXpRBodMbRzzBLcqy3w3baTxn6TtIQ6T+KEqvlM33eqyXUSVg9LBVees+emhRvrMz5YA
 wlOksY0loAM80isQsj4TgePineOtR4BWPJdC+Q/rgqKz8L88wufQ2QJUDNFQNgnr9MtAywn0
 EeTmNHkDiApt6eaIVq68rqXtjq0NTIiBGkOfzIfTQAF7t/gp6k+lhvKCN1kFcaIYsbdHDjxx
 3WGqXY4jrBK18oTjfzkpBbAni6moYXPQkgt/ALLU2m57wR/Iom4e4iv7lud5vFFRGqEcmS8U
 LE/s5D2xIgz4VulzURhnM1l8GmV2su4
IronPort-HdrOrdr: A9a23:YWbxZqADbVmmKk/lHemP55DYdb4zR+YMi2TDtnoBNCC9F/bzqy
 nAppUmPHPP5wr5cktQ4exoQZPwJ080rKQFm7X5Xo3SPjUO2lHYSL2KtrGSuAEIcheWnoJgPM
 FbAstD4bXLZmSS5vyV3ODXKbYdKA3uytHOuQ6Q9QYVceg7UcxdB0UQMHf/LnFL
X-Talos-CUID: =?us-ascii?q?9a23=3ApYaAjGisoiM42JscI2nn9a/9xzJuamWAxWrMHxS?=
 =?us-ascii?q?DDmtMWr2OQByRwa9inJ87?=
X-Talos-MUID: =?us-ascii?q?9a23=3A/DVCPA3o6ssaWxQRAwPs2ki2hTUjuPuSVEcrzr8?=
 =?us-ascii?q?/tNCFaz4tazu4niqoTdpy?=
X-IronPort-AV: E=Sophos;i="6.01,220,1684814400"; 
   d="scan'208";a="117431435"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=MIGWdsxX+7cVFJgb7qUW1EtDqy3K1KaQtubdcfXaaw2qkgpURJviF1VDm4M0qsuBxwd/6rq7VZNIYBP5nW9MfTAuofXrOUJuSewXY6fKNwJhBthodIS0edPqorDEWfnmtOixL6cLyTawRbJcTZNDBIxUq/voP3Ot6f5xIC3+rYAPjfYJLR5mCS8AfVxUSsE8Cn6QJLLJZ6WzXZCX2xcS5ua6P7GHeB9GmwJhyyc+ezwRlfDI5RN3aeT8Dz7Zz/RgGsS1louMAMDm/0zEL4u7tp8BKaaZqdznjTrafMLiyCiFWnV/NLbR76b0iA+/AqvQzogsYGc2NnMUqGnTxvEKcQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=x7GllXGm02UxznMS/nsqMCo81EILZwbK3P5UuFOnxlQ=;
 b=HmSHkhSi3vz0A29tRi454tADfwu3pRA1pTKmBSvWpo587kqPd4ZLxmmQRks/V0CH16eNinNxcOwyC4pRE5ykm61K+LnFY6PXIb4wWI8Ugvh06j4V9unyK7R5XlEIMCynkCqPPKGdp/pZZ94II+OZCy4jIT0Cj7MzTFS1aJUnvR8cLbtWUcjl+4J94XvjWpL8AKTzJDN9LnZs+SgtFsB3JDeAidWv23csLQw28lZi0aVz+0joPzoDxpEGYVb/rECTrBsDh5qrgrNEyqUALh+eS/xJj1d3wpTwYnXuxRbKtZi7GeHZCoW5VpNpKqtUmVEz3yl5leu3pkk5wBKZb1M5Tg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=x7GllXGm02UxznMS/nsqMCo81EILZwbK3P5UuFOnxlQ=;
 b=De/PTVryqDqZnyHtMM+l5WB2m/OoRi0fe/1bwItvO3xVy+VD6bDkXdmpbeDR8IYBBI1uay0VXwxYq7A7goLyCGnP4JnyldHNulNwnQwmiiZhcW+5J5EERTl/vKtLAqoCPTpY0Shi/yMoTj/5ouaTXuFn3/XuvqAfQzJ12hlvkF4=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 21 Jul 2023 15:05:51 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH v8 08/13] vpci/header: program p2m with guest BAR view
Message-ID: <ZLqCr_ySq41C5w1i@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-9-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20230720003205.1828537-9-volodymyr_babchuk@epam.com>
X-ClientProxiedBy: MR1P264CA0007.FRAP264.PROD.OUTLOOK.COM
 (2603:10a6:501:2e::12) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|DM4PR03MB6062:EE_
X-MS-Office365-Filtering-Correlation-Id: 12d8e829-2adc-4125-f422-08db89eb397f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	19/aJOwFr5dx48s63GMLrmsTeGkCd/+GYNy+ATFYbO8woUypIk6NCFqrgNH2bZJIRrs8G7/Q2TTN0H1jjRYRTXtEpECc9TFwREBGoMoAQfyM15L69/i/VSSVeKMw/HfDDPWb/AzU3DsR+oBfyNx49JYWsaYltP05P22vu/cOodFaI2Xe83LW6R01xCPgvYqO73AQihseI3u+M8sFwtBmdbbQtP0IInmt+4X2GtqF0FnzDBUlBc/VOAiTzVzbhQN3E/XNASevCh6GglfhCu+bejHGRM0SDlvzaGja/NclkHNdJYCjmBQksIvjJHJS8aYamVywobhqIPUkBq4hD4WBe+OvU5Zrg76uy1dt2XTfMlzeM7/YnHM8xVphrpBdZ9/pvSrmKW2vb7OLhngi32mqXjdOV5Hd17r6diWCBhZAN4rkTQwJJnGEEu4741HbzXbYki8qGbuJoa2WArqeNIkJns5z8Vm0a/154l0RjVP5YZDiP2LjfEPU39rz7Jv6h8kkc+yQeLt4PPVPaLD+ssGqjtorcDfegQxzfhDPlhDywZkk947mpvwSUG4cmtfAKkn0
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(39860400002)(396003)(366004)(136003)(451199021)(9686003)(6512007)(82960400001)(38100700002)(83380400001)(6506007)(186003)(26005)(5660300002)(8676002)(41300700001)(8936002)(85182001)(2906002)(6486002)(6666004)(6916009)(66946007)(4326008)(66476007)(66556008)(316002)(54906003)(478600001)(86362001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?M0cyeUpBcGI2Sjd1NVc2cS9JdWhQN3hKbjR2QUtDOEplY3RudmQ0Y3Zlbitq?=
 =?utf-8?B?MFhZLzE3cE1QM2JPUWxjNE92OXhBOFd6cEhqMjljNWdkUUY2bW1QYzZYelJR?=
 =?utf-8?B?QlJ0NHg5RXAvTXFvbGN0TnZWZFpld2ZCVnNBNkhFL2hqcDZwNXFYbDVET0Jt?=
 =?utf-8?B?TGR0QTFRdVdwdXBKSFZwT2J5RmZaRXAvMHpVdGR6TkV3L05aZzlmWmJDVGxp?=
 =?utf-8?B?STlrZmFZMk9EdC84QllvdXRNbDN1bGJCSmcwTmY4RWwyOExVakJZbHVkS2dX?=
 =?utf-8?B?NnY1NUl3MUxOZGtVbFFpS25FN21PeFZMdFdpUW42VjZIQUpKVjV4RXJiV2xL?=
 =?utf-8?B?eXRuVz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TR0dEdXFjMmpzNCsyL2Fv?=
 =?utf-8?B?eUZHSkdXcnlPTmdibVhtbW5aZDRvSzVDY1hKbzZGMmdNY0FzTUV6cG1HNjdS?=
 =?utf-8?B?aVE9PQ==?=
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	lghGTnz3JhayHAzk+SmMSlwOeWcvTS2KnS6Louz40sT6Nm9luOBl1IWrGkRP+1wOd+LdQkSVe1xUA8Got6mKO8DXYWO0fPeSXrU4a85YjDptgn5asG8yrXk/KNNqpFpJg8UXeVfE0hTiL49iQEniJgBiWfneHTHr68Wue8oTqJnq14dCqqEi2H6wkK4HTLu1sM6X5NuJAX2U2px/JaExJwuPRUBpDgQtAJpYXeMNr2UPy93RBJjgbjj+mc/P6zf/9yRapHEXxTg7OQw6hbIvgZDGezbhJ6wUns3PJ9aMJWMImzQRH/lj7sKlsNhPdU//Wvn8dc+Yvz43WSehUvil0Hxs10eB/BqTyZK6p3NSCmHe/cKjEar/Af6H/QNyaDYl9HaKYkOkkLxWc8Xb4Ae39G9uE8olACAnUsYg+TJQ6xTN3iybsqryZg/gBGSt4/pPUgNKR3SAghG4HCypb9Zja66Y6+UVL3Tz96RDaQradZP/JeZW1melFMEDjJCfng8uleDfrqgc2tZqUywUZ7yPvaXQLIeTH3JiTfXfU+DIYKWCTotQm2lsNM6JiMLKHvPTNLecYO2qYJ1ZBVOAi1sQk4xNcyg5XknYt9DgpOOFc4y6y6oCoKsWcSeO27+dQo1yP/N3XB1Qksc9nLt5vZCfBM7rvgDBdw5rM9OlSo/ypL+in/JA7+4TTzZ9F4E0dpcad7odg4Clmkyer2K/KTDXrM++4b5/ybbqsnLLQBA1pKR1NubuvbLqb8tvneDm5u9OalkNa4VWiQ1xOc02FTBY3WyZIj0IfWj9HhsTSkY0Amc=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 12d8e829-2adc-4125-f422-08db89eb397f
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 13:05:58.0857
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: iEqAz7vuc5A6P/S6uSR16+wLFZvuKiSxt0JSOCG2hOjdGogSoKOgJkZrWVwiu8MmaJPM05Ewek8e40B/eEBPEg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR03MB6062

On Thu, Jul 20, 2023 at 12:32:33AM +0000, Volodymyr Babchuk wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> 
> Take into account guest's BAR view and program its p2m accordingly:
> gfn is guest's view of the BAR and mfn is the physical BAR value as set
> up by the PCI bus driver in the hardware domain.

Who sets that value should be left out of the commit message.  On x86
PCI BARs are positioned by the firmware usually.

> This way hardware domain sees physical BAR values and guest sees
> emulated ones.

This last sentence is kind of confusing, I would maybe write:

"Hardware domain continues getting the BARs identity mapped, while for
domUs the BARs are mapped at the requested guest address without
modifying the BAR address in the device PCI config space."

I'm afraid you are missing changes in modify_bars():  the overlaps for
domU should be checked against the guest address of the BAR, not the
host one.  So you need to adjust the code in modify_bars() to use the
newly introduced guest_reg when checking for overlaps in the domU case
(and when populating the rangesets).

> 
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> ---
> Since v5:
> - remove debug print in map_range callback
> - remove "identity" from the debug print
> Since v4:
> - moved start_{gfn|mfn} calculation into map_range
> - pass vpci_bar in the map_data instead of start_{gfn|mfn}
> - s/guest_addr/guest_reg
> Since v3:
> - updated comment (Roger)
> - removed gfn_add(map->start_gfn, rc); which is wrong
> - use v->domain instead of v->vpci.pdev->domain
> - removed odd e.g. in comment
> - s/d%d/%pd in altered code
> - use gdprintk for map/unmap logs
> Since v2:
> - improve readability for data.start_gfn and restructure ?: construct
> Since v1:
>  - s/MSI/MSI-X in comments
> ---
>  xen/drivers/vpci/header.c | 24 ++++++++++++++++++++----
>  1 file changed, 20 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
> index eb07fa0bb2..e1a448b674 100644
> --- a/xen/drivers/vpci/header.c
> +++ b/xen/drivers/vpci/header.c
> @@ -30,6 +30,7 @@
>  
>  struct map_data {
>      struct domain *d;
> +    const struct vpci_bar *bar;
>      bool map;
>  };
>  
> @@ -41,8 +42,21 @@ static int cf_check map_range(
>  
>      for ( ; ; )
>      {
> +        /* Start address of the BAR as seen by the guest. */
> +        gfn_t start_gfn = _gfn(PFN_DOWN(is_hardware_domain(map->d)
> +                                        ? map->bar->addr
> +                                        : map->bar->guest_reg));
> +        /* Physical start address of the BAR. */
> +        mfn_t start_mfn = _mfn(PFN_DOWN(map->bar->addr));
>          unsigned long size = e - s + 1;
>  
> +        /*
> +         * Ranges to be mapped don't always start at the BAR start address, as
> +         * there can be holes or partially consumed ranges. Account for the
> +         * offset of the current address from the BAR start.
> +         */
> +        start_gfn = gfn_add(start_gfn, s - mfn_x(start_mfn));

The rangeset for guests should contain the guest address,
not the physical position of the BAR, so the logic here will be
slightly different (as you will need to adjust the mfn parameter of
{,un}map_mmio_regions() instead).

That's so you can do overlap checking in the guest address space, as
it's where the mappings will be created.

> +
>          /*
>           * ARM TODOs:
>           * - On ARM whether the memory is prefetchable or not should be passed
> @@ -52,8 +66,8 @@ static int cf_check map_range(
>           * - {un}map_mmio_regions doesn't support preemption.
>           */
>  
> -        rc = map->map ? map_mmio_regions(map->d, _gfn(s), size, _mfn(s))
> -                      : unmap_mmio_regions(map->d, _gfn(s), size, _mfn(s));
> +        rc = map->map ? map_mmio_regions(map->d, start_gfn, size, _mfn(s))
> +                      : unmap_mmio_regions(map->d, start_gfn, size, _mfn(s));
>          if ( rc == 0 )
>          {
>              *c += size;
> @@ -62,8 +76,8 @@ static int cf_check map_range(
>          if ( rc < 0 )
>          {
>              printk(XENLOG_G_WARNING
> -                   "Failed to identity %smap [%lx, %lx] for d%d: %d\n",
> -                   map->map ? "" : "un", s, e, map->d->domain_id, rc);
> +                   "Failed to %smap [%lx, %lx] for %pd: %d\n",
> +                   map->map ? "" : "un", s, e, map->d, rc);

I would also print the gfn -> mfn values if it's no longer an identity
map.

>              break;
>          }
>          ASSERT(rc < size);
> @@ -165,6 +179,7 @@ bool vpci_process_pending(struct vcpu *v)
>              if ( rangeset_is_empty(bar->mem) )
>                  continue;
>  
> +            data.bar = bar;

Please init the .bar field at declaration, like it's done for the rest
of the field.  It doesn't matter if the BAR turns out to be empty
(same below).

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 13:08:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 13:08:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567535.886718 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMprh-0005AJ-BC; Fri, 21 Jul 2023 13:08:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567535.886718; Fri, 21 Jul 2023 13:08:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMprh-0005AC-8W; Fri, 21 Jul 2023 13:08:13 +0000
Received: by outflank-mailman (input) for mailman id 567535;
 Fri, 21 Jul 2023 13:08:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=FBlW=DH=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMprf-00059l-5X
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 13:08:11 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on2060a.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::60a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a3a23212-27c7-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 15:08:09 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PR3PR04MB7241.eurprd04.prod.outlook.com (2603:10a6:102:92::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 13:08:06 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 13:08:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a3a23212-27c7-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Mc3DdGP7lnFt++9UkmnJam40DDas2OT80rWfv+xQm/ZpnVRocP/iVgZC15MENu8XHGQGiG6CDnafkiKvE9AgugoRr5kgrj2AYuBKbDBhqnrCG5oMxW9iYm8VKKfsb8nRpX9OE1GuLDgCGDP/4YoOKHFqijBQ8jxFTrxDl8c/3pSVmup/8+nJAJaH32ympVKH077VkJvfVbwfCaL0YcL9n+KDgDUbkvEWNf7CrL1iSAUfEBwkuc4VSIZYF1SJsWXD1arNAfV8RAsJqLR+x40qQ+rrHHQK3oImAFEGVrZkzFikuCodv5RAO9zy8Y6Y0rlall5InbE90L9GsAUhfMTayw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=wO/zXt2A6oeKhu/5wzxD6GGL5EOBASzIU5Bvhpl1mP0=;
 b=EIFBuDV88YeLhOguPIeXjOzhdxs+WRl4XS5P1LbK/uYTsTaR9qleN7nuP3UsE9kEdrNZ7nmNx9Qpi9Rn1J6rx2DvKaayg3Er3oM91QpwPdcM1KEihroebzFnyJQcrV8HzeODU1ULU7DXJ7ppUwZRDVgSl78P1OB+f/foyICKnvE5PWdxRwor2JOdlEYf8DZDGM6I4r107vHUaeqa+071KtTP/6w+kmVNU04wrYU0N447I43ZOIMbBeMj+AGyxlE/cvWxqBJyoFz8uQ/v/+SIiQwc2KA2J7MjffaxcClNP8eLFW09RuAj+UbbUQI0vGV5/S55rYyZNVz2UkNd7rI5iw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=wO/zXt2A6oeKhu/5wzxD6GGL5EOBASzIU5Bvhpl1mP0=;
 b=tZNviXhqmyXuEZ5fyj4f2VfgriD+PBLcrAQsb0BxYIco+khalCLAUOD9S1IHlQx/fBNtP8FDfbvOqKIKtqZ8Xuu9lhYs/3o2yPGs0FID1wu6s6q7jreYRwFr3dE8ZMUR57wB6L1OJadFCpjKdzhjpwGdgtK3WOhanMaatZDp5Vs47X5c+H8CBcuV6IWk3WTFix1XsvnaWm8/f7DlTEE7v10buuALTE/3xlLIqauLMwTbVtjKAtQeeoNPTu8R2hXIA2gGbaqTjWZ1trwbGK5CayV1sFHF2oj0TX2MYLRb/uVcdmQJ7gVl2lPdTokgkdtq/3jU2UrV+Aj8KIDPu1B3Zg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <47ab1431-6a0b-6e74-92ec-8495c6bf8fbd@suse.com>
Date: Fri, 21 Jul 2023 15:08:04 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] xen/arm: Move TEE mediators in a kconfig submenu
Content-Language: en-US
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Jens Wiklander <jens.wiklander@linaro.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <a44f74559f52d1fa90a3f77390e7d121c9cd848e.1689926422.git.bertrand.marquis@arm.com>
 <cb7b53bc-2440-8619-61ce-39c967b56eb7@suse.com>
 <DFD07AA0-E7E2-400B-8961-A646E5531DF7@arm.com>
 <6b24847c-5cd2-877a-bc72-16bb732e0ca2@suse.com>
 <C63A942A-AC5D-46CD-81B3-50B6376860E7@arm.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <C63A942A-AC5D-46CD-81B3-50B6376860E7@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0225.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ac::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PR3PR04MB7241:EE_
X-MS-Office365-Filtering-Correlation-Id: ebbec8bd-812a-4ce6-2615-08db89eb864c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Hr89hdBLKJgvdM9Hj7GKCDcezUsgWITA9q36qrRhZE4CjL7q6PrDMZglO0wER7nvOx9qpypAFyQc0wRusD4rF9xIzfkBGimVr57tCWT+9zZjDrIpOH3aeoXwSCTtL7YzPAUCTey/mk/LnFCs4T71XYZtCdB1U1Zgk9tD6F323jns1W8UShedw8TkSc5nqFogxUb5DaxHnkhp0Gxj37CZMTNNtwI9IGklRqM0k1dyLyWhl/Tq44zj3DImjrvloSUaMPASfSN19/j4Hi7y2j24hFBFXnd3m82how/zBdzsC+eFmSNLowsWdaqOQKYI0ubhqZCVCet/VtxLZFFH/bpVMvkKlxbWz2aPksc9kKAM8OgyuBt4GiiZOSmJYFhxe0pJ6KUEpgZC0EJeOA7UtPvLmhpmqWkwvsIEoKKTFlA9uuvV9XNOQcg9PLOvYv/BVjmRWanXehZmtHZ9myW153zyOOXc1WP34J/d1RV2c+rCm5IBpS+z96dH9r+xUADwYonUT5zghRj3B3QiKHU0OfUS+2128Juhw8DNuYMBKK2ETrk5jI9D1APk0H9yJmlUsIkJ/vM6gK2pGnkA8+F4xFkpwNw6sxtskwL/grHXO/w4PVpLKh3bnuqIyewO/NKutFyeRAPY+/VbnmK8FuT5IrZ+AxZ2tXQj/3dsW8p5j1rg4zjuGcpnX/+LsIIBhc+GPSSc
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(376002)(136003)(39860400002)(366004)(451199021)(31686004)(6512007)(66946007)(4326008)(6916009)(66556008)(66476007)(36756003)(6486002)(2906002)(54906003)(316002)(31696002)(478600001)(86362001)(53546011)(6506007)(83380400001)(2616005)(186003)(38100700002)(5660300002)(8936002)(8676002)(41300700001)(26005)(76704002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RVhCNDh0SHZHKzMxTGJscWk2U1JvYld3cFV5YnNrQkZJSCtraEFRL2ovUlhB?=
 =?utf-8?B?MXlNNThvekllS1hTVnh3VjlqNjNqN0JwaWRrMDFwZHQ4MHF6b0JmeTJvdTN4?=
 =?utf-8?B?TzZHOEdQa2o4ZDRZdTdvNDByRE0zM0xleC9UdlZrOVNKM29PUmprTDErck5Q?=
 =?utf-8?B?UHY3T01DN3Z6WVFWVUhWUU42TU9JdUg0OUpXbnJnNFBCMXVDRnFYSEtVdmFj?=
 =?utf-8?B?dkc3RVkzbXFNb1ZRcW8zaFcxMFhUMHVnWFdXNEp4eGg5Y2l3T2V4TTJoYVpW?=
 =?utf-8?B?NFZtT2NVTDdLMjU0ZlFrRFVQNUFmS0dWT3BZak8wc1JTQjlUOER0NnRYSHQ0?=
 =?utf-8?B?ZXVwTmJJczFxRml3RncwK2NGQVFuSjRnM2Q4RTFSanJlcWRZYkw0NUYwdzZj?=
 =?utf-8?B?bzQycGc4Sk4xL1FoU3A4aGIwVWk4NFRvZlMrbi9zUzlTcGkrL25YU1dMYVY2?=
 =?utf-8?B?VEZJT3laaDRrYWlBK0g0WEJiMWZwUzg0VnV1RHdzT3JIM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
 =?utf-8?B?N29zQWludmdOTmZPSU1SUVFrdjR1M2NhQUFueHFYREVaZDBmcm5wMTlGQXI4?=
 =?utf-8?B?NWJSNWpoaEU2RDlBd0YvV1AvNFF5anpiY1pFZ2FWbG54MjFsQ0JSYlBEZXNQ?=
 =?utf-8?B?RllOTkUvcGlBMjJzenRUSFdUVnBjWUx1KzFzOXUvcy9vQzBWdjk0TEZYN3U1?=
 =?utf-8?B?eWtoaTZpY0ZJRE1NU3c2MUtHczZRaVkzU0x0Tmdyb01vQTZqM1U0ZHNSbkZD?=
 =?utf-8?B?NDVFUnlCVWZ6YVpqQmZOQ3haVGFwMjBSclJNNEVUZDQ3MUtKRXlJeDJlbjk2?=
 =?utf-8?B?OVB0NGVWRHl3eVVHbU1xZUNpQVQyQzhhSGVrMTdPTDBrMG1nSFY2dmNQUWNG?=
 =?utf-8?B?R0N1NlpFYmxsOXhlTHMwcWFKdk4zcStQb24wbzMveXhVbWk3WllkYm50Rk9s?=
 =?utf-8?B?ZTdJWVN0U2treXlNcWg3VXF2OUdraTlzMDN1bUZsdktGOVY0YVhRTm1pRmgz?=
 =?utf-8?B?TFdDd01BZ0p4d1l1SS9LOWNjQ014azdRN09TRTF0cThEUUlLRWwrdXE1RjBS?=
 =?utf-8?B?OERtOWFtR1d0VEU3cStwZlRQUFBlY2RRcHlZamU0L1FxdHZlaDV5SFZsaFNo?=
 =?utf-8?B?RFZWMjZodGZjS215ZXpWNlpjR2tQNVlKdk5WUTVRMUlsakw4d0NXSUQxQXBm?=
 =?utf-8?B?d1hrOG9DNys2Rlo1dEd4amtEcHdFK3NhbWlYNUlXbExhNXhORzNBM05DQisx?=
 =?utf-8?Q?TKpxAbyL9y97CaVL6FJ0AljuB?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ebbec8bd-812a-4ce6-2615-08db89eb864c
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 13:08:06.8089
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: IEvBUYKY7iB6RK48p5ZUbG9mCBuvSLZ+0Z4OnR/Kj7YHkCZdgO5GLKHShnlbAMjvEG+7xEML/16kVfUU8X0fCQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7241

On 21.07.2023 14:27, Bertrand Marquis wrote:
> Hi Jan,
> 
>> On 21 Jul 2023, at 12:45, Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 21.07.2023 11:02, Bertrand Marquis wrote:
>>>> On 21 Jul 2023, at 10:52, Jan Beulich <jbeulich@suse.com> wrote:
>>>> On 21.07.2023 10:02, Bertrand Marquis wrote:
>>>>> --- a/xen/arch/arm/tee/Kconfig
>>>>> +++ b/xen/arch/arm/tee/Kconfig
>>>>> @@ -1,7 +1,17 @@
>>>>> +menu "TEE mediators"
>>>>> + visible if UNSUPPORTED
>>>>
>>>> With this ...
>>>>
>>>>> +config TEE
>>>>> + bool
>>>>> + default n
>>>>> + help
>>>>> +  This option enables generic TEE mediators support. It allows guests
>>>>> +  to access real TEE via one of TEE mediators implemented in XEN.
>>>>> +
>>>>> config OPTEE
>>>>> - bool "Enable OP-TEE mediator"
>>>>> + bool "Enable OP-TEE mediator (UNSUPPORTED)" if UNSUPPORTED
>>>>
>>>> ... you shouldn't need the "if" here, and ...
>>>>
>>>>> default n
>>>>> - depends on TEE
>>>>> + select TEE
>>>>> help
>>>>> Enable the OP-TEE mediator. It allows guests to access
>>>>> OP-TEE running on your platform. This requires
>>>>> @@ -13,9 +23,13 @@ config FFA
>>>>> bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
>>>>
>>>> ... you could drop the one here. I think.
>>>
>>> visible if is only for the GUI/ncurse display but the if is required
>>> to make sure that a .config file cannot set CONFIG_TEE or
>>> CONFIG_FFA if. UNSUPPORTED is not selected.
>>
>> Is what you describe "depends on"? "if" controls merely prompt
>> visibility aiui.
> 
> So you think that having  CONFIG_FFA without CONFIG_UNSUPPORTED
> would be a valid configuration and the if is only here for the gui ?
> 
> I tested that with the following procedure:
> - use menuconfig, select UNSUPPORTED and FFA
> - edit .config and disable UNSUPPORTED but keep FFA
> - build
> - CONFIG_FFA is removed from .config
> 
> Now what puzzles me is that i did the same but removing the if UNSUPPORTED
> for TEE and FFA and i have exactly the same behaviour.
> 
> So it seems that "if UNSUPPORTED" and visibility all behave in the same way
> as depends on which i was not expecting.

Hmm, maybe that's a bug in our variant of kconfig (we didn't sync
for quite some time)?

> So what should i keep or remove here ?

My understanding so far was that "visibility" merely hides all prompts
underneath (but then I use the command line version of the tool, not
menuconfig), so it largely is shorthand for adding "if" to all enclosed
prompts. Therefore I think all the "if UNSUPPORTED" are redundant and
could be dropped. But then I'm also working from the understanding that
"depends on" would behave somewhat differently ...

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 13:24:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 13:24:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567539.886727 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMq7c-0007e0-M6; Fri, 21 Jul 2023 13:24:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567539.886727; Fri, 21 Jul 2023 13:24:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMq7c-0007dt-JZ; Fri, 21 Jul 2023 13:24:40 +0000
Received: by outflank-mailman (input) for mailman id 567539;
 Fri, 21 Jul 2023 13:24:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=FBlW=DH=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMq7b-0007dn-A1
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 13:24:39 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on2061d.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::61d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f0660c79-27c9-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 15:24:37 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS1PR04MB9504.eurprd04.prod.outlook.com (2603:10a6:20b:4c6::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 13:24:35 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 13:24:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f0660c79-27c9-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=RXhCC7DfOq8yUDRGDvTN4kHk0Zc2KZXyQ+R09U5+5RPXxWLoNpgp6DwEcZOBtHPjW2GOCOMRutDMW6hnPiAKJ1Ix8OgPM5/blEXu6wBU5aDG6hs0RSrkIta09ckqGYQf+weUEVGsx9X3yxuyUDVl2H0ynO5FYDDHR9JumCEFWGlmEi9mLBwnSfeTvJSnPDt6KdtfmzePh4wr6IfqcINv1iPPJYbU+oC/UnJEmBT74aXMDt1XsZ2QTGeVOYSVvEfWx+Oa+jldxMpTD27UBKV6vlkA8WFnuAWyrh71RAmbSGqS54eDdMCq719Su6MzHXxXLxfLH5kE3jh5BTjQ9qJRnA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=SL6scpT7Vjwvxd9wo5uPjS1KwEjnYbIgvSSfJSCJ0aM=;
 b=Fwc51eGAz0v9mcJrseYEh2c9U8SUxfIwAQKTOVUcUNZgZtfTyb/eoixbkYZiVRjlKyFnBIKxYlHs8nWQQ/claqPhHz8u3E1L1hg2nzX7hpkkTMj7a4AKzzEAr5O44KArh1GdvMHmXILsQ1aAVXwasNhA62ho41s5V72C+S1ggPLxWkJ02aPDVJOOnEUk+FxRIb3m6FwakvTWO4tirVxckDRsaNDFJo0h4GlV1wXEd4Nrg0AByAkTMl/G9r68EVUv7gY/kKWTCddES2fPZX/qfJdowYCfYSyBZAPxx3nkzrSZFpsAwwRhLiiAZ9jta3AKAUChsATf0EAW/lx+dO1jXw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=SL6scpT7Vjwvxd9wo5uPjS1KwEjnYbIgvSSfJSCJ0aM=;
 b=estyIsmbcT1wGOs4RpoPs+rHLKeGTvIiLvNnYK3vdx6U8Qt5paQiL4C1iLaEFxJQ0Q1nhjSp5cVtAmSZJedbY+VctogDntzENqp/Go5MlafYmXR9RDBoevkya+B5OM742y07Dbup8O4XZ0mN68lQpRWcPeCRStS4gJftenx5ytUrJ33BsI7CoSMNT5gMycgsQSTkSS9qMzqSJsv0a/7Xc3b9H1/+ftiIsrUB1K2ZmdEquhcNh9YL+bfUROIPDSvAfhVob1WUlWGPJAfnkoCuKeFMlVrfOz5UqzHBLrns93QWm/G0N6M86XBvIEExZ1KT0SH1+vlPy07imS8vQPnujg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ceb7d6ad-0292-facf-6ad5-4bd265a8d34d@suse.com>
Date: Fri, 21 Jul 2023 15:24:32 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [OSSTEST] ts-kernel-build: add kernel kconfig for the Arndale
Content-Language: en-US
To: Luca Fancellu <luca.fancellu@arm.com>
Cc: rahul.singh@arm.com, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, xen-devel@lists.xenproject.org
References: <20230721121627.1229906-1-luca.fancellu@arm.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230721121627.1229906-1-luca.fancellu@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0023.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1c::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS1PR04MB9504:EE_
X-MS-Office365-Filtering-Correlation-Id: 21abe68d-abff-4416-6359-08db89edd31a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	2PPE4+CaXtSrEQ8VHR7IDUH1/7xNnC0nlVHmYhqH3ZKto9r81CJ9SPfPAZivVPvbsFgaRC2Vl9X8DR7E150ho0hgh3+rCENBUBGATsbvdetfGT2d5wpP1K0m98ymoHyJp9yUJ/NLVBuDcj5gx8AnQ1Ur0xuh1/MQtsXzncrcGV2cZfXFDKneyWzvGczhZhw/2Gg+c9UiYHtNR/Z/LcbrXiLyYcgj8jotmPAfmaHippe9wYUo+vHJ8UOCfT15/DPiVHDubbFCiztKTfcktTsHfl72OSEfor8V+NkWFWu2znO6TLhWCf6IkATNqZx6kb219AIQq+WbqVpjwrSgFrxNVke0iZwI41LP7tuN8OVHeDQW3imYr8MAQAIPVLN7yjDob8bfqGoAgIiK61nyO+DmS8aZrz8HGfD1iJRVbEa+4Np3AtG6JKyNpYjLKoY1Fax5/M7KngMsoUsD0L8y+1Q9CuSPVaSLF0Bzsyzj5DMQWJR441hmQHBPKImF4VanT/Px1BXPgC09/NWz4o6VlyG/LvUou2GesPubvjtGIB2H6km1lW4UQg2Aph6Wl8oriva7U5kSmhCIPoBCwDtM5ybm5Au8KTVC7RNzKe2/OU0yQ5OO5244lqxjs2z1J7iEC6AvTiE0n7zR3rU/ely/EEGX8A==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(346002)(396003)(39860400002)(376002)(451199021)(8676002)(8936002)(66946007)(316002)(31686004)(4326008)(6916009)(66476007)(66556008)(26005)(186003)(2906002)(4744005)(41300700001)(5660300002)(478600001)(6512007)(6486002)(6506007)(53546011)(36756003)(2616005)(38100700002)(86362001)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bkVpZVpNUmJHNnpQTlVEMDVRblF3R1VaU2FzN3o1TWFVSGpyYzV4ZkJLTlJs?=
 =?utf-8?B?SFVOc2ZOU2MrNzBYdnRtK3NPUW03a2RZamRJb3RRMlhLc0RxL3ZNTHRvQk05?=
 =?utf-8?B?WWcrT3VUaS84ZlNlRnp2VHZoSUE4SmF6NGRFT3dCbFhMbEt4OVVNNFBkQWYx?=
 =?utf-8?B?aFBtakZmWm9nMjlaekZwbGdkTStBMlN0MjZHRVdYYmJNZ1NLMDJNSUJiellO?=
 =?utf-8?B?Z081UFM3aEE1V2VLcHZiZDdid0ZPMXI5bDNqNEluL1IzWk5vUGVteFFCR1U3?=
 =?utf-8?B?ZWFUYmpTT2ZYdmxvTEp4MmdhbXhHcFNzYllkYzlTeFZOQzYvRkpBZmtYb2Ux?=
 =?utf-8?B?TE00NW55cVlHaENFUW8xLzQrNmZPUkVMeVVLQmpnUkNvVjRoWFo2Rm5zbWY4?=
 =?utf-8?B?SGpxNVErU2tweWFZWkR3WkRjLzQvNVBCWnNHWVlGSU4zc2phMm0yM1lLbzNL?=
 =?utf-8?B?WjFHM2dNeE5nVUxtQTZZK01VcnhxSDJWaFVTTnN4ZjgvV1V5SFpSNXVrRGpy?=
 =?utf-8?B?WEVLZGZZaGEvUTgrUjFUOGk3VTBVdVJpdTlwVS9jUExzZTRCZGZ3c2pTUkVQ?=
 =?utf-8?B?YVNSZXZBY1I4N2Z2dmhYYVpDMFk2cT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VS85?=
 =?utf-8?B?ODJUeEp2czFLMmpmb0lpcFJ5LzVnbCtYL2hubS9YU1gzbUdmY2xCb0dTZ2Mr?=
 =?utf-8?B?VXZIMHdHSDFmSkpBdzEwUmJSNXpqdFVxQThmdDVVbjNuRDhDZkREMGRQK1ZY?=
 =?utf-8?B?V0tTaWhhVWE1Wll6RFBBdjR2cFBGRGhhWHRjUnBCaEEycXBCRUFnOVE1M2tH?=
 =?utf-8?B?d2RKNnlEVGtBK1RiQ3h1RFRKakRMUStvRko1R2IydFlVaEF6ZDZxbUtldnZu?=
 =?utf-8?B?VHRqVHR5UHRDYUIrdjN1NWVHM0Q5RWJQV2U5SUxzakU4TTVQcDU2djBkTTdO?=
 =?utf-8?B?YktlZExNNzZISE9GblJ4TFcvb05qVFVLL2phM3Z5YXV4TERiZ1pIYnZRa3Jy?=
 =?utf-8?B?MGJScmFDVGFiVE9xMENoRTkrRlU4YWVGQXExd1NFYW9rT2JaK2RTNTRZaXN4?=
 =?utf-8?B?ZHdJNmYxUlBFOTF0ajkrOVhDM3FyRzhrNmlTRVgrTjlsSWdZTFpMR2lOZmQ1?=
 =?utf-8?B?NFUvL3ZaSm1qNW0ycHBWOVM0dXlCRmpOaTRGZDY5K1hEUEFWTUtIMFJHQTl2?=
 =?utf-8?B?ZXQrUmJWVTh3RG10dG9nbmZrYWxqYnl6MldyTkNOV2V0Q0l4bnoxR1BMcU1L?=
 =?utf-8?Q?Re8cEo0xaEQC6n/o6KasCiGue?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 21abe68d-abff-4416-6359-08db89edd31a
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 13:24:34.6479
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: zhOFHdZwTaRj8l9nMMJXHdgNZnMoorFiv3pSElgcbq+byN5L7e9YUdEZDLB2NDB0i3BYouVkaXjvHvwNeLMknw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9504

On 21.07.2023 14:16, Luca Fancellu wrote:
> The Linux commit 33629d35090f5ce2b1b4ce78aa39954c603536d5 has
> removed the 'snps,dwc-ahci' compatible from the generic
> AHCI-platform driver control module selected by
> CONFIG_SATA_AHCI_PLATFORM.
> 
> A new driver, the DWC AHCI SATA platform driver is now implemented
> and handles the above compatible when CONFIG_AHCI_DWC is selected.
> 
> The module is needed for the Arndale board to have the SATA controller
> working, so enable the CONFIG_AHCI_DWC as additional kconfig parameter
> in ts-kernel-build.

Largely out of curiosity: Since you say "module" here, ...

> --- a/ts-kernel-build
> +++ b/ts-kernel-build
> @@ -245,6 +245,7 @@ setopt CONFIG_SENSORS_LM90 n
>  setopt CONFIG_ICS932S401 n
>  
>  # Enable some additional drivers for Arndale.
> +setopt CONFIG_AHCI_DWC y

... does it really need to be y (and not m) here?

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 13:33:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 13:33:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567543.886737 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMqFY-0000lT-MF; Fri, 21 Jul 2023 13:32:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567543.886737; Fri, 21 Jul 2023 13:32:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMqFY-0000lM-JE; Fri, 21 Jul 2023 13:32:52 +0000
Received: by outflank-mailman (input) for mailman id 567543;
 Fri, 21 Jul 2023 13:32:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dNy0=DH=citrix.com=prvs=559993d03=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMqFX-0000lG-6R
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 13:32:51 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 14b068eb-27cb-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 15:32:49 +0200 (CEST)
Received: from mail-dm6nam10lp2109.outbound.protection.outlook.com (HELO
 NAM10-DM6-obe.outbound.protection.outlook.com) ([104.47.58.109])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 21 Jul 2023 09:32:37 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by MN2PR03MB4959.namprd03.prod.outlook.com (2603:10b6:208:1a3::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 13:32:33 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Fri, 21 Jul 2023
 13:32:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 14b068eb-27cb-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689946369;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=sAv8c7htvHksS147dGgne57b/GiMCNuF05wKzQjJYWI=;
  b=IhY25h8KD1TCFu1hMGY65DShadX3jf8AhIWdD95iMO5xQZ+ZwnrWGKDP
   KcP0+Bc91U6v8Lv8IwAWR86s3mSHZQEx7bHQ/BroKEHiMvTk3PwKZMGul
   +rSWduV4/cFhWsNjme4zxxYJ1mdGvUBJ5zrV1AiwcIMzPWkGJfOD/HZ3E
   0=;
X-IronPort-RemoteIP: 104.47.58.109
X-IronPort-MID: 119612755
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:/z6JwaMoCxEUQjvvrR1ilsFynXyQoLVcMsEvi/4bfWQNrUoj0WQOn
 2RMD2rQMviKN2X3f9snPd639x8PvcCHndFrGQto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v
 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/
 Nj/uKUzAnf8s9JPGjxSs/vrRC9H5qyo42tH5AVmPJingXeF/5UrJMNHTU2OByOQrrl8RoaSW
 +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ
 Hehg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uXRu2sWlWjA2Eg2dSkYPt8SJ23xdnWx/zUEf2MsD901wgq4VWt1B/a
 DJI65onLZBQosfar98Hv4IRY+tBmnEUXv3QRCvyJTcZdI60l722u7KCe8OlZ+XkbQzveoPpK
 g=
X-Talos-CUID: 9a23:lqQ/WG9X29jPNHVR7AGVv0U6G5EcfCbx9lPVLk67L3xmD5+bSlDFrQ==
X-Talos-MUID: 9a23:RiBhhQTZcMA8LB1oRXTmtg54NJxRx5i+S04AlJglhOmuayFZbmI=
X-IronPort-AV: E=Sophos;i="6.01,220,1684814400"; 
   d="scan'208";a="119612755"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ogsUwTFet9R8gsNb1R9746/84bQHX8cmF49lbdE5Z0TCPPrwXIDiF5Wj19dqxyN8G/sOMtmdPrqs4QBrt+7DtqOrf4x8HC82rMo4VCZ6JI7pagmi3V7eaoWAfgwaHbMbvo8QdJQk5wjYJqsjh2cso8rwDf7ACx21Jec9G0+SocuhM/GJDeiR+2dOZ5TCTOCO5D3sNlTtKs2QesiNtzNQ5r4SFX61jpUJHFrgeCYiXsFr8i744/ZUAfsnqIK0nsNdJtlM3DpAML9wKajABkPcJq7cXZ9yw9wkF+YcQnb2/blvmltf7tfjztV6/phODG9TuQ27cFkKtAzTyLGztiBqbA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=DjX4rbUtXODxpR5nBCqzRyvBAlJKx81FKUc1/q/oHVY=;
 b=UnQ/MfMJEaHCLRwW11XR5eD5MsMC/AFYn7rIKUDBJs/1srax6EkLCEmQWdcSYcdVD7YPwwqxvtPRU7dD+d6YQGHV9aqj14kvosQKIWToyn8Q5KJAkH0K+ccutSbz/aS8D8K4DoknTTKDTECM6+5iAj3Xf1uF1X9nvMXmxXADcy4e3MJRyrBnSN32RruY2jiIJlyXEd8YIYMIt7Cm9I2rPpt43jXxeNzVHyFxtePnDH+8Q0SyGzhQD9LIkbtiJEaHHUwlsaKJEnycduaY+Tb/qowTtg817eKiSFZNOrzuSWrAhwfgbKauRhOYZ/l9wSkUpK/NEX1323RvGQhyHat6+g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=DjX4rbUtXODxpR5nBCqzRyvBAlJKx81FKUc1/q/oHVY=;
 b=vdDTCTcfEjMSKnHJplY1y46D2wzSomF+GlTbchCKeNDpBWSu5/0tl/d4ANhJGi4zgGk7rHz1dpWuu7zJ37HkWGh4S0Pc+j4RhnkCNADkMoLHun1T/OdDtzG39YdRib8XXWX7LoPf5oFjg+6+I0UOJCeNHFsYk8LR1wt1uvbOjKg=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 21 Jul 2023 15:32:27 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH v8 09/13] vpci/header: emulate PCI_COMMAND register for
 guests
Message-ID: <ZLqI65gmNj1XDBm4@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-10-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20230720003205.1828537-10-volodymyr_babchuk@epam.com>
X-ClientProxiedBy: LO4P265CA0062.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2af::18) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|MN2PR03MB4959:EE_
X-MS-Office365-Filtering-Correlation-Id: f3e354c0-a4d7-4e0b-6cad-08db89eef03e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	z7erp6L1dxteB39ah88mMbZABbRIXfu2d6t2doLEeefy11QPHnUYwg+8ppFDxdU6Pzk6W38HBovFdmPR7RhhLx/8y9s/TuE9ULc2Bs3J1/sDvxqszsJ49qqaM2HxVUu9usHl49jWc1+TBHWwM9/cG16dkD0SA11ZFWWso89LDti1RQYzZG2tnwft0g+i4w39xOYlxMCXBHzafVewmZEJYfrJVQ6VS4MP1jt23NFag6rhGGaTEgYYftHzUBBsylghVfM3N4WpPQnBnLE0bb2TuIezl8UaMfI65ctbqBHoPf3QJMgaANS9e3xVYHoa8vV+W1PFYcegENaUZ9btDrMJi+vsXQ6G1f5UWDShRqoO7C4KnP86aG4Ua/RDMbZ0q4p+gPXqoKzkwIS5RNqulqpML2r7eG2UJzzl8Fa8kpsIbt9jiXVgM1cHTdt3HVGOv/csF8sILfKTMvvdvTj2aqGdSnczyUxxqfj/oruKMrwuDydbEMKrKyFpOAlmGLfckmLF1/Ri4ek70MgvzyUvmZCrK1Y3gOKqk5EE8YX5xLjsEzDjLISKvSTieRWJRYe/z5Gjg3HUejBTqI9XSIlHmCJPCg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(39860400002)(376002)(396003)(366004)(451199021)(966005)(6486002)(6512007)(6666004)(9686003)(82960400001)(83380400001)(66899021)(6506007)(38100700002)(186003)(26005)(54906003)(316002)(478600001)(66946007)(6916009)(4326008)(86362001)(85182001)(2906002)(66476007)(66556008)(8676002)(8936002)(41300700001)(5660300002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dlp2UG1rYnBrQVp1QXJsazR1TzRZVjh3TS9ZeXFIMHI2UDJJUnpyNnRMS1VD?=
 =?utf-8?B?SC9vWjhZa25teEtNbUdUU2FUbUNCSktMcHZ1N0lEUGtLT0JpZHZRWWExTmJ1?=
 =?utf-8?B?eElvVEZuK3FEd1BqVmRxTUtwc3lJTXBFd2YwTllrSVk4UlJMaWpqUGFEYWk5?=
 =?utf-8?B?ZXJhcFpXYlpkQm9oWVcybWRUeHp2UzkzczVwLzN0M3FETnB0T0wwUEp4dmln?=
 =?utf-8?B?ZWNZbUtqNVFmeVZVTWlMM3VOOEhjbDRodlVvZHJqOGQ4WW1ob2lFeWZoZzFZ?=
 =?utf-8?B?bXpLK1RaQXZYbEdaeGpTMGdGVVdDWklGczBZSlJZSVhybW5OVzNMOW1lZGZ4?=
 =?utf-8?B?aExibVpsQS9uQjE3dllNRnFtOXp2OU1JdUxVMzg2NGxlSXlNcmo1a005YmJ5?=
 =?utf-8?B?K1RpUVhXN0cyR2VCNGV6alc2dkpJcU1NbkNaUmtjTzVLSjd5VkxUcWdjbVFY?=
 =?utf-8?B?SUIzWlVQcXhqQ1lDazFSZkg4TnRqd0RhL0RQMjJ1NVZvZjg2ZlZ1MkxqNk94?=
 =?utf-8?B?cndJOU1xT2pZeHJ6ZjFXY0Y5U0JXQy9WdGtUWWk3MHF1alRkR3l5OURNRHRP?=
 =?utf-8?B?Ykk5ZzVnMT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HXY2Age7Kx1BNMPKvaQTxiuMAZ/eSIaTG9i76wROfszH9UwhA83wJF86mMTVJshwd+nxRileOWa+qDpBv0PmzFhtxtGelSKbVCnyP37xNqP281WtpA5Fo8vd9u2eWDfYfZRx+QzG8Kgfa7PtDZ7QNVjDLx85HoZzSL0lt7tkbuF7EJ3OeQeGIJ5Opej8Skz4ZaR79zmVrscVCcvdMK7AYFQfbGTumGPr3rq4IoEyyWMKqRUDPOukN6uIzEI/nC9itOrz6ITm+LgU4G/i8QNSFCbwj+DDD1lFrmUllK/F1UTTmFHS2YBagiuzq/RnUdoBYaLtXiBZxTZpmOb7FcUQnTadljxufKJXTfSNo5EqWiBmF42NgL0lYN61ln0bq9Qk0fFASetX2mrath/COglYTEX1dMbkhDLjkulWg6pVerOmlC1pExRaUm7MPglL3n1e0A/lSjTr1xoUirtyR/7Ao3XMQ0XfJJ94CunWAaKoVReGXLS8IFWdabPZQVBB0046LPoTFOK72PaVStgspTkueOgyAcRJeykq9+J+o8caft18seoyD8Ff06s3hr49cirI7F6IKRVKM0jyhG2MTzeY2qO7QA3ssKpkZoE5v5IBPFUibAjmCq+b//p0AWOJlp87iBCSUZkQ73gtva2bHDtbes9/qmEuI+fK/ZPJ3SH+A0l57XN3reYbc=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f3e354c0-a4d7-4e0b-6cad-08db89eef03e
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 13:32:33.1151
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 3JXIxJ0g944cJ/PHG2Tj68/HnCM3F+Uf78NtVNJE+cBCgtCg297rkx5LQYwrn5BLffh/olc+EjGia4Ox7w+fUw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR03MB4959

On Thu, Jul 20, 2023 at 12:32:33AM +0000, Volodymyr Babchuk wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> 
> Xen and/or Dom0 may have put values in PCI_COMMAND which they expect
> to remain unaltered. PCI_COMMAND_SERR bit is a good example: while the
> guest's view of this will want to be zero initially, the host having set
> it to 1 may not easily be overwritten with 0, or else we'd effectively
> imply giving the guest control of the bit. Thus, PCI_COMMAND register needs
> proper emulation in order to honor host's settings.

You speak about SERR here, yet in the code all bits are togglable by
domUs.

> There are examples of emulators [1], [2] which already deal with PCI_COMMAND
> register emulation and it seems that at most they care about is the only INTx
                                                                      ^ stray?
> bit (besides IO/memory enable and bus master which are write through).
> It could be because in order to properly emulate the PCI_COMMAND register
> we need to know about the whole PCI topology, e.g. if any setting in device's
> command register is aligned with the upstream port etc.
> 
> This makes me think that because of this complexity others just ignore that.
> Neither I think this can easily be done in Xen case.
> 
> According to "PCI LOCAL BUS SPECIFICATION, REV. 3.0", section "6.2.2
> Device Control" the reset state of the command register is typically 0,
> so when assigning a PCI device use 0 as the initial state for the guest's view
> of the command register.
> 
> For now our emulation only makes sure INTx is set according to the host
> requirements, i.e. depending on MSI/MSI-X enabled state.
> 
> This implementation and the decision to only emulate INTx bit for now
> is based on the previous discussion at [3].
> 
> [1] https://github.com/qemu/qemu/blob/master/hw/xen/xen_pt_config_init.c#L310
> [2] https://github.com/projectacrn/acrn-hypervisor/blob/master/hypervisor/hw/pci.c#L336
> [3] https://patchwork.kernel.org/project/xen-devel/patch/20210903100831.177748-9-andr2000@gmail.com/
> 
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> ---
> 
> Since v6:
> - fold guest's logic into cmd_write
> - implement cmd_read, so we can report emulated INTx state to guests
> - introduce header->guest_cmd to hold the emulated state of the
>   PCI_COMMAND register for guests
> Since v5:
> - add additional check for MSI-X enabled while altering INTX bit
> - make sure INTx disabled while guests enable MSI/MSI-X
> Since v3:
> - gate more code on CONFIG_HAS_MSI
> - removed logic for the case when MSI/MSI-X not enabled
> ---
>  xen/drivers/vpci/header.c | 38 +++++++++++++++++++++++++++++++++++++-
>  xen/drivers/vpci/msi.c    |  4 ++++
>  xen/drivers/vpci/msix.c   |  4 ++++
>  xen/include/xen/vpci.h    |  3 +++
>  4 files changed, 48 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
> index e1a448b674..ae05d242a5 100644
> --- a/xen/drivers/vpci/header.c
> +++ b/xen/drivers/vpci/header.c
> @@ -486,11 +486,27 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
>      return 0;
>  }
>  
> +/* TODO: Add proper emulation for all bits of the command register. */
>  static void cf_check cmd_write(
>      const struct pci_dev *pdev, unsigned int reg, uint32_t cmd, void *data)
>  {
>      struct vpci_header *header = data;
>  
> +    if ( !is_hardware_domain(pdev->domain) )
> +    {
> +        struct vpci_header *header = data;

Why do you need this variable?  You already have 'header' in the outer
scope you can use here.

> +
> +        header->guest_cmd = cmd;
> +#ifdef CONFIG_HAS_PCI_MSI
> +        if ( pdev->vpci->msi->enabled || pdev->vpci->msix->enabled )
> +            /*
> +             * Guest wants to enable INTx, but it can't be enabled
> +             * if MSI/MSI-X enabled.
> +             */
> +            cmd |= PCI_COMMAND_INTX_DISABLE;
> +#endif
> +    }
> +
>      /*
>       * Let Dom0 play with all the bits directly except for the memory
>       * decoding one.

This comments likely needs updating, to reflect that bits not allowed
to domU are already masked.

> @@ -507,6 +523,19 @@ static void cf_check cmd_write(
>          pci_conf_write16(pdev->sbdf, reg, cmd);
>  }
>  
> +static uint32_t cmd_read(const struct pci_dev *pdev, unsigned int reg,
> +                         void *data)
> +{
> +    if ( !is_hardware_domain(pdev->domain) )
> +    {
> +        struct vpci_header *header = data;
> +
> +        return header->guest_cmd;
> +    }
> +
> +    return pci_conf_read16(pdev->sbdf, reg);

Would IMO be simpler as:

const struct vpci_header *header = data;

return is_hardware_domain(pdev->domain) ? pci_conf_read16(pdev->sbdf, reg)
                                        : header->guest_cmd;

In fact I wonder why not make this handler domU specific so that the
hardware domain can continue to use vpci_hw_read16.

> +}
> +
>  static void cf_check bar_write(
>      const struct pci_dev *pdev, unsigned int reg, uint32_t val, void *data)
>  {
> @@ -713,8 +742,15 @@ static int cf_check init_bars(struct pci_dev *pdev)
>          return -EOPNOTSUPP;
>      }
>  
> +    /*
> +     * According to "PCI LOCAL BUS SPECIFICATION, REV. 3.0", section "6.2.2
> +     * Device Control" the reset state of the command register is
> +     * typically all 0's, so this is used as initial value for the guests.
> +     */
> +    ASSERT(header->guest_cmd == 0);

Hm, while that would be the expectation, shouldn't the command register
reflect the current state of the hardware?

I think you want to check 'cmd' so it's sane, and complain otherwise but
propagate the value to the guest view.

> +
>      /* Setup a handler for the command register. */
> -    rc = vpci_add_register(pdev->vpci, vpci_hw_read16, cmd_write, PCI_COMMAND,
> +    rc = vpci_add_register(pdev->vpci, cmd_read, cmd_write, PCI_COMMAND,
>                             2, header);

See comment above about keeping the hw domain using vpci_hw_read16.

>      if ( rc )
>          return rc;
> diff --git a/xen/drivers/vpci/msi.c b/xen/drivers/vpci/msi.c
> index e63152c224..c37845a949 100644
> --- a/xen/drivers/vpci/msi.c
> +++ b/xen/drivers/vpci/msi.c
> @@ -70,6 +70,10 @@ static void cf_check control_write(
>  
>          if ( vpci_msi_arch_enable(msi, pdev, vectors) )
>              return;
> +
> +        /* Make sure guest doesn't enable INTx while enabling MSI. */
> +        if ( !is_hardware_domain(pdev->domain) )
> +            pci_intx(pdev, false);
>      }
>      else
>          vpci_msi_arch_disable(msi, pdev);
> diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
> index 9481274579..eab1661b87 100644
> --- a/xen/drivers/vpci/msix.c
> +++ b/xen/drivers/vpci/msix.c
> @@ -97,6 +97,10 @@ static void cf_check control_write(
>          for ( i = 0; i < msix->max_entries; i++ )
>              if ( !msix->entries[i].masked && msix->entries[i].updated )
>                  update_entry(&msix->entries[i], pdev, i);
> +
> +        /* Make sure guest doesn't enable INTx while enabling MSI-X. */
> +        if ( !is_hardware_domain(pdev->domain) )
> +            pci_intx(pdev, false);

I think here and in the MSI case you want to update the guest view of
the command register if you unconditionally disable INTx.

Maybe just use cmd_write() and let the logic there cache the new
value?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 13:38:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 13:38:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567546.886748 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMqKX-0001NJ-9t; Fri, 21 Jul 2023 13:38:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567546.886748; Fri, 21 Jul 2023 13:38:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMqKX-0001NC-71; Fri, 21 Jul 2023 13:38:01 +0000
Received: by outflank-mailman (input) for mailman id 567546;
 Fri, 21 Jul 2023 13:37:59 +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
 <SRS0=dNy0=DH=citrix.com=prvs=559993d03=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMqKV-0001N6-Q9
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 13:37:59 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cc6ffbdd-27cb-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 15:37:57 +0200 (CEST)
Received: from mail-dm6nam10lp2106.outbound.protection.outlook.com (HELO
 NAM10-DM6-obe.outbound.protection.outlook.com) ([104.47.58.106])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 21 Jul 2023 09:37:54 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by DM6PR03MB5259.namprd03.prod.outlook.com (2603:10b6:5:245::12) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Fri, 21 Jul
 2023 13:37:52 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Fri, 21 Jul 2023
 13:37:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cc6ffbdd-27cb-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689946677;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=ocFNM03bu1GLAWB2YhELFtuETRzhkA7qwTWdavaVb3g=;
  b=AKFK+d99BZQy4akzbzh8ImZGoZ/JHWgZ2kZlXtVCKt1q2fsa3it4yaDj
   pJKVA6dIhp486e4l7wUQh4j+gvPCHj73bqtVs3/AiR6xcOckfh26vvrSf
   wNmQ9q2z5+qGKRyIRdHNIJlp+e0DM+gHwinKfEA7I2DgbnFjD1Ph9PX+X
   I=;
X-IronPort-RemoteIP: 104.47.58.106
X-IronPort-MID: 117435073
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:TUSCG6px2U8TD+toC5IoXshPTmxeBmLfZBIvgKrLsJaIsI4StFCzt
 garIBnUMq3ZZGP2L99za42y8kNXuJTczIQxSVc5qywwFC4T9ZuZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weBzSBNVfrzGInqR5fGatgMdgKFb
 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo
 OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay
 RAXAB8oMiy5vsW5+amQV9NJop0BItj1MbpK7xmMzRmBZRonabbqZvySoPN9gnI3jM0IGuvCb
 c0EbzYpdA7HfxBEJlYQDtQ5gfusgX78NTZfrTp5p4JuuzSVkFM3jeiraYKLEjCJbZw9ckKwv
 GXJ8n6/GhgHHNee1SCE4jSngeqncSbTAdtNSOblrqEx6LGV7mdQJDonCGWWmNee1nyFRvd0A
 lIW6zV7+MDe82TuFLERRSaQnnmAuRINXstKJMcz4gqN16n87h6QAy4PSTspQMwrsoo6SCIn0
 neNnsj1Hnp/vbuNU3Wf+7yI6zSoNkA9CmsPZjQNSwcf1PDlrJsulRLETttlE6mdg8X8HHf7x
 DXikcQlr7AajMpO26Dl+1nC2mqovsKQFlBz4RjLVGW46A8/fJSie4Gj9Vnc67BHMZqdSV6C+
 nMDnqBy8dwzMH1ErwTVKM1lIV1jz6zt3OH06bK3I6Qcyg==
IronPort-HdrOrdr: A9a23:Op9a8qkRkWQoMJUPG7IBI6c9eZPpDfLo3DAbv31ZSRFFG/Fw9/
 rCoB17726QtN91YhsdcL+7V5VoLUmzyXcX2/hyAV7BZmnbUQKTRekP0WKL+Vbd8kbFh41gPM
 lbEpSXCLfLfCJHZcSR2njELz73quP3jJxBho3lvghQpRkBUdAF0+/gYDzranGfQmN9dP0EPa
 vZ3OVrjRy6d08aa8yqb0N1JNQq97Xw5fTbiQdtPW9f1DWz
X-Talos-CUID: =?us-ascii?q?9a23=3AK+VXDmvgbrp755EwB+cO0KRg6IsKVyHh9k73LHa?=
 =?us-ascii?q?jIntTbZnMa1GB5q5dxp8=3D?=
X-Talos-MUID: 9a23:PooLbgniATxf3+gTSWVndnppd+tP0vmQJXkjtsk0gNShHgVuOSaC2WE=
X-IronPort-AV: E=Sophos;i="6.01,220,1684814400"; 
   d="scan'208";a="117435073"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Qc8gVSVBut2vOyXfFQn0pqWO+ecA22EJm/X/VLU7L+sbcftjydeUJqSHG7FLvBSbrvwgKzG/sBXROPC4u+qGC9ZXXN5A45u66i8LeDdcByoIkTfwRkgkGeCZCLV7dGmEayLjSKq9wVkr8hggvU1fDy2SymbaddJNFtJJP0nC6lBWT4y2s5e9s5h0DYlbfZSQ4+ML4BjVr3fn7lB2iTHPn8C9/say36xdnXVpezBU+3ga+HzIK9x5UBCm1xe8mAQaFqnarLEKidpsGTppLqsZ7OseiQWNG0OkYm5RVtGlLbL2vV4aMbCiT5Xr3n0euwcxtziGQyQODTlQmhMgfIHAHA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OGp5KHGWaERW7SP9NXvB2lhSCY8j+ezszZlvZ3qdXjM=;
 b=aXGklbL1sfnbx5QCUf+RnsdryHBU2mA5HhfK5HwlHDSuraXmPz/PzN8y16AID9vJwXLCaA8/+LYGGpaDbMEvoxckovpOUzoAOX98Qw44vhbhiUGOXUdH84Ep2pmB/cqLhonPCVuETyq8f3lJEh4/spvBggSLb0YQySuf73ZCr7rLvJdCTCo3W8INvWABvMB8YHsTadpZJW97dz2ii7ZaodLqlskYEc8LuLxarTKfENH0wfu6z1a8dU9QyEkRZWBQDAX0jT2rXe/j4p6nkQb2IKOdPbabizYixJWLHv1QENwkrzESih47cHzVZexU0M1+uzej2pG1o+/xhdcHinKGog==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OGp5KHGWaERW7SP9NXvB2lhSCY8j+ezszZlvZ3qdXjM=;
 b=kBHA4MtdbgHfMlfRAr6bPwzMXheqBMHNqtt0kQZGkwHJYncpZxPA+ixNHklo3xAEoi70cOBUmHEcm20audEo2d4pBRHonHRViSdlcqI0t6XhQ/tZ3uE6fNs8gTXOcTF4fiZFLTcVSv7WihoHFmkq5PDp1DqFXMkyhfjT0haUQWE=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 21 Jul 2023 15:37:47 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH v8 10/13] vpci/header: reset the command register when
 adding devices
Message-ID: <ZLqKK1Hfg9lL4dfK@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-11-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20230720003205.1828537-11-volodymyr_babchuk@epam.com>
X-ClientProxiedBy: LO3P265CA0007.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:bb::12) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|DM6PR03MB5259:EE_
X-MS-Office365-Filtering-Correlation-Id: 992bdeaf-64bf-4748-49cf-08db89efae7f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	cmVnUScQhN++MUmlPz/l9f3fyfUMDRIt8F5Fhd3njBDtqzqj5s/uhdM15/0bBzLqzdwmpqJdexxLavnYvNuS3WOpafrcsT+Yeg+N8D4BoXf2v0CWgwFZUUAZPUjC23Fmhv+xog6IxsYS8BPSWKWUUFp8O+Do4V42twd+SuGLfD52wb5/p2W5FH3aH0e8Ig5mDahi/1F5nYNXUeUkOZWXnR4XyBjcVU3PpRJhZyUF4eqr0PiyD4awxWeIjxMPSqj6ka4fIfpN1ocjX9g2Kc4ZA4/rJD+xE7xNtG5gZNgZZmat0OPc6VCcdPC7i6jbwHw1OOxlnL2dkOkjbj2ZNRcA86rxZqDI+4E7Wo7PZN9JpGprwavYb1FWAJDdWtlz/k83EiMWMKHkk2RIuexz4XFI7KGSnP5aj8qnc+ZXV996L2uFIjmCnebrfz1iE4XyoCTRH9vsjHRlwfAZiWy8MNGIHqtIOdxUie3LlaPw4bv6qN3BXHY0RkMIdoHXql2HrvWYnZczz/8mHcyv6lx2sz7yGA/KYz6PB6Ud7JQX0re35h36UEDn3FV6R3sLDn30qfou
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(376002)(136003)(39860400002)(396003)(346002)(451199021)(9686003)(186003)(26005)(6506007)(6512007)(83380400001)(66476007)(2906002)(316002)(6916009)(66556008)(66946007)(8936002)(4326008)(5660300002)(8676002)(41300700001)(6486002)(478600001)(6666004)(54906003)(85182001)(38100700002)(82960400001)(86362001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bThkRkQxeVhTSWZaTjZiM2EzLy9DUFNRRUk5bVBvTVJpV1dwZ01yM05rT3Bk?=
 =?utf-8?B?TDZDSUtSenJ2dHRhc1JTek9vL0pKR1R6TTM2YU45TldqSjlyRUFxbmtFVjky?=
 =?utf-8?B?Y2s0UkdVdmlIWmVLc2U2alFwSU0zUGRUZ1lyeDhYRThSeDBGTXd6aW1oU1Er?=
 =?utf-8?B?Q3dNVGpweFdpd1RWS1F2ck9ZUnJYdUt0b1Zqelp2cGI5d05tVVNoWVEyZndR?=
 =?utf-8?B?SjdOWmtFWUgzMjZORWJJSmtjNXZYaVUrYVJPdnMySGJwU2NHak5MekxJSC92?=
 =?utf-8?B?U1RwNE5oMmlDc1FBODJNcEQ5SUViWUcyeUIvUzlNT1cxWmJIYndnbDhqR1M5?=
 =?utf-8?B?VXJVcExiNUVGWjl3WkpVeVpqWnZ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k5NWlSaDhhQU5sb05IR0JaUnRPY2FRMGs0TFppWlR1WW5STlQ5MWlC?=
 =?utf-8?B?Rnc9PQ==?=
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	0yjvAspcQ2o1l6PWapYzf1OHhhLwm+ypIYWwVWzG0MMHIaMHv9RwCzVyTgfWVU8iSQxsFBuz/bGsbekIbi3Y9YRJHmS4nxoKTGVKts46xKydbrjr8VWooEd9uk7NX4TB7BuwEzCjx5P17YhxUCaQb2eqlIUB/upNLBOQD30LoC9ihxxbaiQMVtZoDVH0K6U3MPaoZEeXCqdhD5WGQXAyxH+OVgH5fyXpLmLAjVd5ZpkQ+mIDZqOikhMhuo3cfeeQ10LHi2Iitvj7ni2GwNzb5bWETGCtePbXhyMRRFd5TrdpcTuSjhecJlqFZnTNY3FfDecD/5TzVgLQl9wKMnxUSOe5pVVBhseZH8JG2B8P5E/ZfWMyU8tunItefzjFqTw5kSg9veoWp/Va7bvHcJ8euZHF/CfYcvqWmTQn0o8KJ7pEKoMwLZ+PA+g9QfyFRORXizD7bE5NwlZ0ZZ9hFbKkdWWjDLUK8R4FXgObu3HcScV6D+EOeXLpX3NifTW7/W9NcmNJVxETGKRtHfZS0dVDrhmp2S7pKfy8tGesW+tngXECXhZqjwEPcjmCMUdZO23nCN44q+zIeDxXs1Xx58u56EDaMdQ5hdxFQDEPfMSxV7OaIwkvWlBTaz3BAoDSavWKoTm+v8R7XanOtv2M+AC8mJZwxpGeVDGHBZZHL2fW4qtuIFXRhEYnzxBpWOXAt7zGnkqBu6Zt1yUCUutqPB59hcvcSdr3y0rStbNGXnYx2cqai60ge50J5Bn+c2Ci1fq163rmn0t328URDhTXp8R+pMp6ta97X8iKmBKSBK2m76Y=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 992bdeaf-64bf-4748-49cf-08db89efae7f
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 13:37:52.3832
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: WIBtGlcNScEMvCcfF8INnNZcIK71Cot5QpespFMJZbPM5yJh8aD4P0fa8Ag3wauhoDVmKU0TYsUwGcbZuvi94g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB5259

On Thu, Jul 20, 2023 at 12:32:33AM +0000, Volodymyr Babchuk wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> 
> Reset the command register when assigning a PCI device to a guest:
> according to the PCI spec the PCI_COMMAND register is typically all 0's
> after reset, but this might not be true for the guest as it needs
> to respect host's settings.
> For that reason, do not write 0 to the PCI_COMMAND register directly,
> but go through the corresponding emulation layer (cmd_write), which
> will take care about the actual bits written.
> 
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> ---
> Since v6:
> - use cmd_write directly without introducing emulate_cmd_reg
> - update commit message with more description on all 0's in PCI_COMMAND
> Since v5:
> - updated commit message
> Since v1:
>  - do not write 0 to the command register, but respect host settings.
> ---
>  xen/drivers/vpci/header.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
> index ae05d242a5..44a9940fb9 100644
> --- a/xen/drivers/vpci/header.c
> +++ b/xen/drivers/vpci/header.c
> @@ -749,6 +749,10 @@ static int cf_check init_bars(struct pci_dev *pdev)
>       */
>      ASSERT(header->guest_cmd == 0);
>  
> +    /* Reset the command register for guests. */
> +    if ( !is_hwdom )
> +        cmd_write(pdev, PCI_COMMAND, 0, header);

So the assert just above is no longer needed? (and could be removed
from the previous patch).

As requested on the previous patch, should some message be logged if
the command register is not as expected (0 in this case?)

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 13:38:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 13:38:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567549.886757 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMqKy-0001sw-MN; Fri, 21 Jul 2023 13:38:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567549.886757; Fri, 21 Jul 2023 13:38:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMqKy-0001sp-Ji; Fri, 21 Jul 2023 13:38:28 +0000
Received: by outflank-mailman (input) for mailman id 567549;
 Fri, 21 Jul 2023 13:38:26 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMqKw-0001qC-Jg; Fri, 21 Jul 2023 13:38:26 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMqKw-0006MK-9n; Fri, 21 Jul 2023 13:38:26 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMqKv-00053F-Uw; Fri, 21 Jul 2023 13:38:26 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMqKv-0000nX-UO; Fri, 21 Jul 2023 13:38:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=6ZBOozEAqOZu8R45mKWvFOJmzggy5UgESyA0DyClGeE=; b=vNXs8x/0YdmPzOoAvWOmmLGka0
	kRpIBHA1DNzS7sEDOfp63ni+H4glPxWGrYF+wNCcYDnyysYE6US+HfoVd6VGS6h+Hbz9nD6LkKHr6
	EoBFWBkI7UtT/c9kRzuVkHCIHZ2seyiRlSMQSxUhC6B7DT0/whOpbEKpJWbChH/Wi/uU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181934-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181934: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-multivcpu:guest-start/debian.repeat:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:guest-localmigrate/x10:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:guest-localmigrate/x10:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:guest-localmigrate/x10:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:guest-localmigrate/x10:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:guest-localmigrate/x10:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:guest-start/debianhvm.repeat:fail:regression
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=e599e16c16a16be9907fb00608212df56d08d57b
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 21 Jul 2023 13:38:25 +0000

flight 181934 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181934/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-multivcpu 22 guest-start/debian.repeat fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  20 guest-localmigrate/x10   fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64 19 guest-localmigrate/x10 fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd      19 guest-localmigrate/x10   fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 18 guest-localmigrate/x10 fail REGR. vs. 180278
 test-amd64-amd64-freebsd11-amd64 19 guest-localmigrate/x10 fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 20 guest-start/debianhvm.repeat fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                e599e16c16a16be9907fb00608212df56d08d57b
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   95 days
Failing since        180281  2023-04-17 06:24:36 Z   95 days  182 attempts
Testing same since   181934  2023-07-20 19:57:22 Z    0 days    1 attempts

------------------------------------------------------------
3788 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 632986 lines long.)


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 13:41:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 13:41:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567555.886767 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMqNG-0003Nw-4K; Fri, 21 Jul 2023 13:40:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567555.886767; Fri, 21 Jul 2023 13:40:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMqNG-0003Np-1X; Fri, 21 Jul 2023 13:40:50 +0000
Received: by outflank-mailman (input) for mailman id 567555;
 Fri, 21 Jul 2023 13:40:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dNy0=DH=citrix.com=prvs=559993d03=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMqNE-0003Ng-Gc
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 13:40:48 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 31e03b40-27cc-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 15:40:47 +0200 (CEST)
Received: from mail-mw2nam12lp2049.outbound.protection.outlook.com (HELO
 NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.49])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 21 Jul 2023 09:40:44 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by DM4PR03MB5968.namprd03.prod.outlook.com (2603:10b6:5:38b::10) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 13:40:38 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Fri, 21 Jul 2023
 13:40:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 31e03b40-27cc-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689946847;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=3yh8hYuwQ8o1a0owTvMPwwglVH12b3x0vYMNscXzw7Q=;
  b=fQpklQzOruBitEzt/jvm5fmmmkuV56wHp81jk3MX81fwON9eDp5Ze5LL
   ei7/mR8nejMZw2G1e2vPhVBqM7m4UQmppjntKCBRpNDOjpm05diVyOnK4
   n6NJX6O0kBgU1hRxZWEdP9kTLFyseOrvUwa6M/tsi/bb9HK7XT6F8YOoU
   s=;
X-IronPort-RemoteIP: 104.47.66.49
X-IronPort-MID: 116878719
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:AkySYqjSpAH9Wci8+T9e09OzX161pBEKZh0ujC45NGQN5FlHY01je
 htvWjiDP/vcajD3eo1ybIyxoE0GusXUm9Q2G1c9/ns9FC4b9cadCdqndUqhZCn6wu8v7q5Ex
 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv
 cKai8DEMRqu1iUc3lg8sspvkzsx+qyr0N8klgZmP6sT4wWHzyB94K83fsldEVOpGuG4IcbiL
 wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ
 OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+
 tQaKzQDTS2Hgt6O+62FE/Bin+99E8nkadZ3VnFIlVk1DN4AaLWaGeDv2oUd2z09wMdTAfzZe
 swVLyJ1awjNaAFOPVFRD48imOCvhT/0dDgwRFC9/PJrpTSMilIvluS8WDbWUoXiqcF9hEGXq
 3iA523kKhobKMae2XyO9XfEaurnxHqlCN1CS+TpnhJsqEyQwzFNCzEubHuqhPbmjnHhfdh/C
 mVBr0LCqoB3riRHVOLVYRq8p3KVuw8GbPBZGeY69QKlx7Ld5kCSAW1sZi5MbpkqudE7QRQu1
 0SVhJX5CDp3qrqXRHmBsLCOoluaHiwYLnQLYyMeeiID78P+u4E4jh/JTdFLHba8i5v+HjSY/
 tyRhC03hrFWiNFR0ay+pArDm2j0+smPSRMp7ALKWG7j9hl+eIOue42v7x7c8OpEK4GaCFKGu
 RDohvSj0QzHNrnV/ATlfQnHNOjBCyqtWNEEvWNSIg==
IronPort-HdrOrdr: A9a23:I2YF1a9sV6mXhAUOMltuk+AcI+orL9Y04lQ7vn2ZKSY5TiX4rb
 HKoB1/73XJYVkqN03I9ervBEDiewK/yXcW2+ks1N6ZNWGLhILBFupfBODZsl7d8kPFl9K01c
 1bAtJD4N+bNykGsS4tijPIb+rJw7O8gd+Vbf+19QYIcenzAZsQlzuQDGygYypLbTgDP7UVPr
 yG6PFKojKxEE5nFfhSVhE+Lo7+T8SgruOeXSI7
X-Talos-CUID: 9a23:6bqjIG0T6KWYUWl1AH8gMrxfGMMhfF7gyHLsG3SnNz9wRqS+F2CQ9/Yx
X-Talos-MUID: 9a23:JJoLmgTGJZnfwEjcRXT9hzQ/asRE252OGWUCzpE55O+OFQ1ZbmI=
X-IronPort-AV: E=Sophos;i="6.01,220,1684814400"; 
   d="scan'208";a="116878719"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=g/lmunof5c6llPo9CTQQQbm84SxSBGuNqWJPnmyRtC2DKqgI0zcEOKHeSiYO0ybFcBnP+mT6y6rHYNBztr4gYlIq4bExWzdLycqz1hqNmkSzAyaI/bFbUcdxcjXLCuKsScckE290ReCNot1TCiM+aaR8uD3AG0Uqsy2SIPE6wNc8Oe5sOErldKhpYgbPycpreVRsOR1/WhXZ9WUujkovFM91uzFTGfvaLLqJzrna61ji4alDQjldlu5ECBF6wD3AMswIDTRDk9yJpD4RpzhNQaFSJiFM12E7rkMI7K6gqiKGpBtHw50KrsGS8JmAJyTL89E78kwGhROqR/Q7a7eoPA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=06usSbsssSaieiqulC9C6s+2i5pIJ9QUgxJTZwMYGv4=;
 b=iZWA7GUasRlpIoz8/7DEQqjU/p9frPtDCaDURQNpywopRmqTFfvIv07/x0KmygdWdRoCM6Tfgsn7/qJIlRB2b6DSPy3hGGOrHe7Q0W2I+/764xnCtDV9GIC2ZxvYAckkaOBkuokuVB40HsoruTPU6WN2EvIcZqQyCQrSP3WH6jWc3kbsDXXRTBwZeIxXwNbjNP90MfCO4HftIAeNNn1E17Hg40txjg2Ptn7SkX4AP3GAdYtX5KAxzAQQZ/C9gHG4G0HdIE6toqVDSzfY2b9XFEs76gf5NM1+cjqEGBL60Hx8HHPeg2aQ/NEopmJsF4+xucsu4tMRoorKt/kVLh4AOg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=06usSbsssSaieiqulC9C6s+2i5pIJ9QUgxJTZwMYGv4=;
 b=wf0lmLERQIYVGqMl7s4PcSYi/HAQDSDSi6Kcjh4tvqKFhr1HMi0lgW2NtKh9+0E1iLhlrp0XEfN51k/zw2zuV7PL2jpwfsa566FUwkpz22DqGvl8Dwc87+NlpL1JBZ/S4Kz44tpfH+Hd5EdnUv/sXmkucptYl11KK2ETctUipfQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 21 Jul 2023 15:40:32 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH v8 09/13] vpci/header: emulate PCI_COMMAND register for
 guests
Message-ID: <ZLqK0MBwh66qkpJ8@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-10-volodymyr_babchuk@epam.com>
 <ZLqI65gmNj1XDBm4@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <ZLqI65gmNj1XDBm4@MacBook-Air-de-Roger.local>
X-ClientProxiedBy: LO2P265CA0494.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:13a::19) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|DM4PR03MB5968:EE_
X-MS-Office365-Filtering-Correlation-Id: 16b63c1f-288b-4065-70bb-08db89f01135
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	sTGI46mjLkr5hyiS+uSMl8x6bqVoIPLJJUouiTEbEMvgZjQyj6XP+CmB4EtaTd8AzE94b0lEc7VJE1G69G3p/bwjgImlM3H/kYx39uMPGYk6HG8FETDELApS55yXCjW2aQ39gTQ/n024RjrhODVIzBxNZQzOYGutvEI48hcxfm6tR7aOAouG+9wvM2vTi0t9mzoGzhL2Sb+a0TJygvJjdjJpWOyuOptcTvy6OKqZZhf3DVVuz9ozo60sJYx1SvUWvPZ88dcQIWh8L3s9WM8J6dKw1WA0UvDoHwFBUkbLQcUcaeK93R0NszjdHQF55p4xb83SwY3h86U0GR+m/KSfK8g+TQNsTlVqgFIiqazmtWJqwo54ETpWN/n+O/xmv5WLafCzXrFeYQAtsIRd7/y4SfOd1M56osUMSjl50MDcxvhwIm08iAXJuQ0/6UYj1Z0gR6dDNfCRhWFVQ1Jzz6XCZFOB6ydmy1/RtsjSiKoDKgAaj4k/0sh3kJ1XxcjAwS8skJpCr+RYoiZj+E/vrRpWslIAWuRWsGIsiawyb7WCYyst1Fia/vjI9bFmsgl457Gq
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(39860400002)(376002)(396003)(366004)(451199021)(6486002)(6512007)(6666004)(9686003)(82960400001)(6506007)(38100700002)(186003)(26005)(54906003)(316002)(478600001)(66946007)(6916009)(4326008)(86362001)(85182001)(4744005)(2906002)(66476007)(66556008)(8676002)(8936002)(41300700001)(5660300002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Z2dxTEdLTkdHbkJheFpzRCsvU2ZGb05ZLzNqcnR2b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+UB/N+Lifu6P33fsp3/36b8qGitxyxg8WtsTlJUnlnjHSbUKndyQrGHUgUj92Vw45Fv+iQvq7mpTNi1JaHb4eI7vEDyCa6BUXtSEltllt/HigOUPsGxbUwQQmF2UkNsUNigLIHON4QyWV7SDSNOf+rgJdVTB/qtVqBpy4IIoXHWc+PCI7txVTgiMUByiQB5/H4SY1HvMA5N5Dw6D5/XOoEe9CEDQ3uxNCbmu9XmwOMH2zVjoIuIz+jNYYsRI4f2+NFTr5lvGCIsDMotAvHZGlXXgOaADxSpzb7N9gUruljc/sT2O5UicD/Urm+y80KQ=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 16b63c1f-288b-4065-70bb-08db89f01135
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 13:40:38.1086
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: RRcl+5o8PIjuzSC1Ub5CrNtfUFDwhqcINFAf2LNINVNlfPnxBGh47lIpsvOV0BHqmPZoiX9Mz/biwOAJYhXW9Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR03MB5968

On Fri, Jul 21, 2023 at 03:32:27PM +0200, Roger Pau MonnÃ© wrote:
> On Thu, Jul 20, 2023 at 12:32:33AM +0000, Volodymyr Babchuk wrote:
> > From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> > +    /*
> > +     * According to "PCI LOCAL BUS SPECIFICATION, REV. 3.0", section "6.2.2
> > +     * Device Control" the reset state of the command register is
> > +     * typically all 0's, so this is used as initial value for the guests.
> > +     */
> > +    ASSERT(header->guest_cmd == 0);
> 
> Hm, while that would be the expectation, shouldn't the command register
> reflect the current state of the hardware?
> 
> I think you want to check 'cmd' so it's sane, and complain otherwise but
> propagate the value to the guest view.

In fact asserting that header->guest_cmd == 0 is pointless, as the
structure has just been allocated and zeroed.  We do not assert that
the other fields are also zeroed.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 13:54:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 13:54:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567558.886778 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMqa1-0004uO-8p; Fri, 21 Jul 2023 13:54:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567558.886778; Fri, 21 Jul 2023 13:54:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMqa1-0004uH-54; Fri, 21 Jul 2023 13:54:01 +0000
Received: by outflank-mailman (input) for mailman id 567558;
 Fri, 21 Jul 2023 13:53:59 +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
 <SRS0=dNy0=DH=citrix.com=prvs=559993d03=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMqZz-0004uB-2Z
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 13:53:59 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 081f88e2-27ce-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 15:53:56 +0200 (CEST)
Received: from mail-bn8nam04lp2042.outbound.protection.outlook.com (HELO
 NAM04-BN8-obe.outbound.protection.outlook.com) ([104.47.74.42])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 21 Jul 2023 09:53:41 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by MW4PR03MB6965.namprd03.prod.outlook.com (2603:10b6:303:1a4::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 13:53:37 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Fri, 21 Jul 2023
 13:53:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 081f88e2-27ce-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689947636;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=kGvzQbmJFY93PSR73651zJHLnmDYkErdePgbfn+Oe68=;
  b=PQMZQbrj0bAldo415RjlzPkuLpQa7hpOj/u2LRPwPlKIUECKadeEeoVc
   NY4x7Chx4DXBMtstwSej0KYHpX0ACkO4kw/oVIVad9A91ETdIkcjSzsxG
   vaWK+O6zduyHQN8/fgUGC7Df4s2XEIHpWd4LVWMEQaVY0Ni9NHY+WmaxP
   s=;
X-IronPort-RemoteIP: 104.47.74.42
X-IronPort-MID: 119615847
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:JeTDSKIJcCrw0cnCFE+RFZQlxSXFcZb7ZxGr2PjKsXjdYENS0GAOn
 zFKW23TM63cN2vxeYonYN+0oEgB6J7dxoBnTQRlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws
 Jb5rta31GWNglaYCUpKrfrawP9TlK6q4mhA4QZnPakjUGL2zBH5MrpOfcldEFOgKmVkNrbSb
 /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/
 jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c50XkFp6
 qQhEwo9RRaZtrjm3ZSYcOxz05FLwMnDZOvzu1lG5BSBUbMMZ8CGRK/Ho9hFwD03m8ZCW+7EY
 NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/VrpTSJpOBy+OGF3N79YNuFSN8Thk+Fj
 mnH4374ElcRM9n3JT+tqyv92LaSzX+kMG4UPJqhscNw3WS//VQKMV4dDGS7uvyQiUHrDrqzL
 GRRoELCt5MaykuvSdXsWgyil1SNtBUcRtl4HvUz7UeGza+8yxaUAC0IQyBMbPQitdQqXno62
 1mRhdTrCDdz9rqPRhq10bOZrii7PyQPGkYEaTUZVgsO49Tlo4YbgwrGS5BoF6vdszHuMTT5w
 jTPpi5ugbwW1ZIPz//joQqBhC+wrJ/USAJz/h/QQm+u8gJ+YsiiepCs7l/Yq/1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97YgidlzGeQYByfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,220,1684814400"; 
   d="scan'208";a="119615847"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ilVHyZzi7CIYKvSjMxrvX3KKRLzfo+0f3hvXkR14PXtXd/Ig1ZREMYxFErSKysy8FH4AAZnV/wx06uB4A4WfevempYY7SFeDjYmB+HVH3/K7FumRShZ3jPC5CdAPLArIyWcXzJYNqLZ6m2HPgYWIUKQOFXusE1VD7c1jJPcWyLONCj1/6FnIO3Bmvr3i4/8IhoccE6W38N0mdmEM9d2NsedIJrTBF6KkWoo17hFqOyXn2TLXHtJ05gwbOVSA/l8XfgTW4UVFcE9qH0JmRD2N/dxNwXudLuX2J02dF+a4dtrCh5EsF1ftXN0v1hyw4E9Bjhs+BzbgY5wwvO05h5YyMg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=9Bki3pXulailNmGES+dJJCo9+B1TZeL/qAv6gQDrOuw=;
 b=LPa2XpK7+POOisjmcXHGCmL6uMS4R4bVrMvC2RvmciJUpLZHFnyTuHvwtxLGrg5sUb/Ix+RXD7nO5OXtVf5RTl2CAFK1xz+iP2qNYT955e+9eoHE49g1SYTlv1raO4Y3h4ZyiG9PDFe2FJuLU7diveITh9tbeRFz8vZrCvCBS82gzfmxpjtEVD7zSRxTtIUrchUWA3uO5bAEArw6IOjRZkwzEs5v9wQCQcb2ZL9LJv3LVxy6Cehr1jxSzwm8xtoRYI9EfOw2/8yeqkdQvpsFaixQ8vMwc1dyRzpux8OlwyfMBULTt5EWTHU7aslpXRKbOagJAhOWxpY0cWCiTnPOgw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=9Bki3pXulailNmGES+dJJCo9+B1TZeL/qAv6gQDrOuw=;
 b=MzSgUSpgaJdeXis5x4p1yHMF4w5vxMc+cnwd7TR/6mtvICoXJ/PkxkrPM6wcVTdD9bIy+i49QNSI5ez/8Go20e+hOpQniETf1340OGxV/YrIqgXPsNn+BlzldtXvkt0+7hPjplbQLJ9DSoLLaRb2ynD0K+T6pHkgDUesXh5P//U=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 21 Jul 2023 15:53:31 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH v8 11/13] vpci: add initial support for virtual PCI bus
 topology
Message-ID: <ZLqN22RNEN9Cdk3F@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-12-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20230720003205.1828537-12-volodymyr_babchuk@epam.com>
X-ClientProxiedBy: LO2P265CA0255.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:8a::27) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|MW4PR03MB6965:EE_
X-MS-Office365-Filtering-Correlation-Id: cc389c4d-136e-4092-5eeb-08db89f1e1c0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	rZHml4NhHg8IqJ0XLACymSR9n2vXH8//CwWLHdBVGoxPWBiRTZohlpUJ+DftORmh7R4No4pAgePhbNTzFZEbYAmoHyBXWBLbv316LxXMfZmQrxg+LC0ZakBat2JPJY7WBcFgPSnpokTCghCp1k69tIv8e5rPL6ykZuJPfJ5p2rbCknLYJohhaDZtMI3QTA5LWy/7z60d6DxiP4lC5FweCLXybjZMTJPz6etRlCMPPHMiGkO+SLLck1QLCtCBKDcUrjGSKF4dU3pA2aaZmE/vc8kBYN6jGC5pZU5zlUSeW3nEBxjEBioRB9/vAis0zFA3Nb6695AOgj1zX21QAGTt2nEMeN1En5d7i7B7BIGVj8IdI3AFQavo1WP/lMeQtcSPXYmPuoME+eN9hCU+7Epsj4ZGWEaXcREruCPdv3LVonmenoGjEo3spuLoaMvzJPVIjYjR8QoxmiFlbUsoLBtEFLwD8HEV+5BA0XUMIsUJrd09L499TNwJ51mf9Ptj20JNr4w/s21PRGBH1ro13OYH+XcGoUR9xUnhJ5nmPIyjZI5IrLfaSUSU2wc30i/4Y4b8
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(376002)(39860400002)(366004)(396003)(451199021)(316002)(4326008)(66556008)(6916009)(66946007)(66476007)(85182001)(38100700002)(6486002)(6512007)(6666004)(9686003)(86362001)(54906003)(4744005)(478600001)(2906002)(82960400001)(41300700001)(5660300002)(8936002)(8676002)(186003)(6506007)(83380400001)(26005);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-A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3Ufc6yfoUzieLYiJq8UK6Hck7Q1hbB4Mx+gReYQoZYAaIGyFJrbTOY1VTcvh3qhqm9Cj71bgNMLeGmRQwtQkSMjLejY90xiKEE7b/OkPmp56wKN+SsWiby0QmHlQtk9m+uhuP+3/9Pbr1QpagZTFwiltVLr0iB6tSuRBQy+iytVi50fOG1IGtzgB+EHJ/e8sQpt0I95Qlo6bh7/reTKvECtAhVRyasO//+wGxNIfYFkGztA4QCBZgBLFsiMdw7CXZv/7jjYYYGIQGQPnyeAcbMkUkcYfhAreauGopjx4HuJj5DHtWV/+KSxR0WpFrcLWb0+MxJJh9PMwQz8s4LLn1WQucWJtnybdOrl3BjTlgYQ7MDuRymGRx+5egw9p6dlOt1cxwUDRiXdew=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: cc389c4d-136e-4092-5eeb-08db89f1e1c0
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 13:53:37.6278
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 8tCjFsIWbcHZjMl8GBb+OOn7fle1giDkAvYBeZdjAzE8jfoVr1YvdUpN/ZNw+j4oo4LM6I1N/piYlZ8kt8qAzg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR03MB6965

On Thu, Jul 20, 2023 at 12:32:33AM +0000, Volodymyr Babchuk wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
> index 80dd150bbf..478bd21f3e 100644
> --- a/xen/include/xen/sched.h
> +++ b/xen/include/xen/sched.h
> @@ -461,6 +461,14 @@ struct domain
>  #ifdef CONFIG_HAS_PCI
>      struct list_head pdev_list;
>      rwlock_t pci_lock;
> +#ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
> +    /*
> +     * The bitmap which shows which device numbers are already used by the
> +     * virtual PCI bus topology and is used to assign a unique SBDF to the
> +     * next passed through virtual PCI device.
> +     */
> +    DECLARE_BITMAP(vpci_dev_assigned_map, VPCI_MAX_VIRT_DEV);
> +#endif

I think it would be helpful to state that vpci_dev_assigned_map is
protected by pci_lock (as I understand it's the intention).

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 14:01:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 14:01:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567562.886787 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMqgg-0006XU-2N; Fri, 21 Jul 2023 14:00:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567562.886787; Fri, 21 Jul 2023 14:00:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMqgf-0006XN-W0; Fri, 21 Jul 2023 14:00:53 +0000
Received: by outflank-mailman (input) for mailman id 567562;
 Fri, 21 Jul 2023 14:00:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dNy0=DH=citrix.com=prvs=559993d03=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMqge-0006XH-OB
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 14:00:52 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ff29d584-27ce-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 16:00:51 +0200 (CEST)
Received: from mail-dm6nam10lp2101.outbound.protection.outlook.com (HELO
 NAM10-DM6-obe.outbound.protection.outlook.com) ([104.47.58.101])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 21 Jul 2023 10:00:47 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB5486.namprd03.prod.outlook.com (2603:10b6:a03:28d::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 14:00:44 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Fri, 21 Jul 2023
 14:00:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ff29d584-27ce-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689948050;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=HPs0jO0dgxc3GjGS7waCoLoeQGzAyYKP+W+WJc2h+bI=;
  b=fNI+ds3l6+B/lPPuFVHjcZ7fMNn4Wu2KqBWbER/Il40MkeT2nGuOz8cK
   3lzV5e0Vi13jBCie911GJMw/1wm4GyglhL+v6B1jX6/anH5coklqycSBk
   BwoI/yHvQSBGLeYe4HQZfxW6ekRrwP5y839t2F7iWvb0vSahK+A7vZqxN
   c=;
X-IronPort-RemoteIP: 104.47.58.101
X-IronPort-MID: 116880714
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:P6qP/a8Cr/gZn9sPIinwDrUDR3+TJUtcMsCJ2f8bNWPcYEJGY0x3z
 DdOCG3SPPyOa2r8edx+atm09hlVv8KEnIVjTgdt/Hw8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s
 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk
 d7pqojUNUTNNwRcawr40Ird7ks21BjOkGlA5AdmOqoS5Aa2e0Q9V/rzG4ngdxMUfaEMdgKKb
 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk
 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklkz
 /A7dgAvLSuOhuu6kbm5ZOBAhp08eZyD0IM34hmMzBn/JNN/GdXvZvuP4tVVmjAtmspJAPDSI
 dIDbiZiZwjBZBsJPUoLDJU5n6GjgXyXnz9w8QrJ4/ZopTWDilUpidABM/KMEjCObd9SkUuC4
 HrP4kzyAw0ANczZwj2Amp6prraWw3OrAN1LSNVU8NY2oH3Q+EsWUicmWGu0gKeCqWOwRs9Qf
 hl8Fi0G6PJaGFaQZuf6Wxq0sXuVpCk2UtBbE/A5wAyVw6+S6AGcbkAUQzgEZNE4ucseQT0xy
 kTPj97vHSZosrCeVTSa7Lj8hRS2NCsOJGkOfxgtSwcf/sLjq4E+iBHIZtt7GavzhdrwcQwc2
 BiPpSk6wrkW08gC0vzj+Uid2mr14J/UUgQy+wPbGHq/6R90b5KkYIru7kXH6fFHL8CSSVzpU
 GU4pvVyJdsmVfml/BFhis1RdF11z55p6AHhvGM=
IronPort-HdrOrdr: A9a23:D9eWVat21eeLQXv86tN3IRLQ7skDUNV00zEX/kB9WHVpm5qj5r
 qTddAgpGbJYVEqKRcdcLG7Sc69qBbnn6KdjrNhXotKMDOHhILKFvAH0WKB+UyDJ8SkzJ8k6U
 4IScEXY+EYZmIK6PoSjjPYL/8QhPGa7aayif7a3x5WPHpXgmJbgzuRyDz3LqS7fmZ77FMCeq
 ah2g==
X-Talos-CUID: 9a23:cGnE0G0TCq09WMd1g133urxfMPopUSPt7jTrLk6xBTdiSpOcZV/J5/Yx
X-Talos-MUID: =?us-ascii?q?9a23=3AAcQsww+3a395iWWkHec+XzOQf5tIw+eQL0VXq6U?=
 =?us-ascii?q?Li8alaxdTFjmAkTviFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,220,1684814400"; 
   d="scan'208";a="116880714"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=QrHxPp5EhwhCMjvzV3aVw+MtfStgColXoERm4KfgTmNFgsxIjzk5ddu+pGbACWHVFLHvuqKQdoTxmu6nJ+xvfRTz+xu7jktRgoZ0hKfcxiYjafecMsUZpE+DXeHJxeh2BAqS6I+scYCyRvByCLujJMM+c6YeVuca7xgEW3KY1h0MMHndx0MlA+vGy4kB+3UUqyjrlayPHDzMqxGRlVGiBeXUwKshCwrp/kaBe1WL9zjZ3cJdVRp/PwNGBhLjeNLsFL/E4yug412atxIKN7YKgh1JJgtU7l7rdfTt9p0B77wQEhgOjmKMI1pwp4EXpAa6aAKjw7R0pwULJfLXA3zc0g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=EGCR4WQjahRGD85HAR+HBHPkFJZjYjOYKGK+49iIN4k=;
 b=ZBLCUHo9ROJ1BPnPFGHByYdb5QF+MHbt50HtwvrBphaT3Lxs7z3TKuNiM9t/43ssj/fgb8CZc5iiq+cd54E0Orvgc7Vvzew2M5abH9YhEEZ5QESIlzjt9kVpA0bnJMURo6Kt0ADkKENFFXSWMEmKdQblFGbptgtiEv9+5mvPvIHKzmgm1ER2IZvPsNcNkXfggSYuQSIR530B9xREuS4Ngd0zns2PKyxed04c4zaP+r+Vyq+OkcGQg/cxkY/+mHORvOMelL8JbKMLvAx2OjQtR8JyV/KeIlXcNVffX/M7cZKoORLrF75sUASp2cyzy+JdAqPB0t8oAnZRJWbFinVolQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=EGCR4WQjahRGD85HAR+HBHPkFJZjYjOYKGK+49iIN4k=;
 b=bvLDrFTIbQmZTloxxf19IiqCyStwPOZTPRCn9PCqMwJQyRHcVm7J9YXgtrB103QClWaulh9I4/SnbDw0evenUvgH4ewt73lScC/p1wSv5ZrmNPhQbrbPjObxUsi/F8k6tALMFjrhJyS7CWnv7JTSlxgETjyNH9wMQm/aeaoVYBs=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 21 Jul 2023 16:00:39 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH v8 11/13] vpci: add initial support for virtual PCI bus
 topology
Message-ID: <ZLqPhwEcV6BVrryh@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-12-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20230720003205.1828537-12-volodymyr_babchuk@epam.com>
X-ClientProxiedBy: LO2P265CA0269.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:a1::17) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5486:EE_
X-MS-Office365-Filtering-Correlation-Id: 63207440-952b-47e3-80f7-08db89f2e094
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	/U6GDFJ+dgImlseuHryHJXJyqy17ZGe/RtResxtqd7GEdUG+W4BUcT6HY/4XIFfivyAy4MJIlyebV0fbtIt/iPYrH2ZiAty3ruwC+L86ewhgLCTGqaC5/CF+L+aomsoynuaSehHaxZZqN/pvyCPIm2WwbyPvNUpYvv2WPDExwKLVNXYkb2mxwWR/l0vknWjrSSDUUmhEUMTOn5ZcFibRhtJejg4rCoUMP70iicme25ONjpGM8u8SfnUNZFetnA7ypnHkI2B557rLI2lI7lImBRCuiC32eaPgsWmg2icv3ji5E03WA92OjvkGj464XqiBWmJlSta4OAg8tppqg+hybjKN18CyJPvTtARu4BW45Xpmz3YV+u7sq8mJU1z4SNvaJ/IR+zQbikEBLE6gfBbNBGcLv6SZJCcrkLkT8n6e4La83uU8Qq1sqAJxzePlRIAa6L1vgAN0n3dsem/fkE7numYX9r6URnktJto22lXeMcask8Z8sdDO5Akv625pGwASJr9uBqFnhhTLtkJk8duDhLQh+H0Z5lxWbJ8G02qMdePD0jCx3XPsIQaXQD+WtRkQ
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(136003)(396003)(366004)(376002)(451199021)(26005)(6506007)(38100700002)(82960400001)(186003)(83380400001)(85182001)(9686003)(6512007)(2906002)(5660300002)(4744005)(66556008)(478600001)(86362001)(54906003)(6486002)(6666004)(316002)(41300700001)(66476007)(66946007)(8676002)(4326008)(6916009)(8936002)(66899021);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RUlrYklsMGs4a1FGcGNvb2R3NHQxYnhycEZvNFRPUVpkd00ySEk5clRpNDg0?=
 =?utf-8?B?UW5aMkU1MUYvL2c3L1h0eCt0aGtkbWtmdktYMHFod2xYRGJtV3FaNmtlLzNJ?=
 =?utf-8?B?S3RDVVE0WHhYa3VjK2txMHdTQWNQMWlURzZwR2JyejNzeXJlaTFjZEpqYlFB?=
 =?utf-8?B?WkZKNU1YMktIUGVNMHdBNXJtYlZnUnpQZEFTVGR3ODhUUE9BNnlLTVZTeWxh?=
 =?utf-8?B?WGxyUDJWeUtiQVRBMk5oWkRDTkNLN3IveDVweEREQkJ1VUNZN2hZY0QyVkM5?=
 =?utf-8?B?WDFQcWNBeWRycENiWk5WL3JHN0VJQ2pET25xakZYUXJNa3lIT2JvSTNoWGxm?=
 =?utf-8?B?TCt0R0NBSTdtUEJtc3NLWHlGcXZRMDN3Mk1kclB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nQVR4Qi9yTFQ4S2hxSEF2a0J5U2lsa0lWeCtK?=
 =?utf-8?B?Z2c9PQ==?=
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	mjqUMV9f0pYkrShfswpyoiYspzFxK2U7pzqkhJufFqdAypb7pspul7FG0hasf69Z16WmmvDQLKkMrastuabUs69Lvk13aAhjfEf0WjweS6Og0GNNcdEMFyWDkqG9yR7DwRL4qt9G1Ov4p/SKhU3ATaWPmbDBe2JVyrRwpDppjCAa6xqaU5IIwf1Tm7MfzBeUy76Efc+CMHgZX/NOxSB6B1kqDjxnkhmjc3+xvSWczT65GQHMPzAc5vrnq+zTXAd2SKA9oaUmTRadhgitOkJ9o8zc3wZv+8r2mEY0ApQV1BTbHQUko32HEbPXzh/zhu0XSGpI8XaLxMSJxNc0L8swkqcrcR355m3GLjQQnDP+KZgDt/w9Ml2d9ghl9wsZWDXnJizUs+e6r+YpyRe40KsANLzK8cvLFLxCKK+Y93a2ZpeLptAm4iFDCuTeKnmyWfo1p8J0oaLT+qvggK56bK+GWtY665Dfqkk9dRXvdaHmjueW4s79T9lehjUiTSNMfSBDbykVBebtmp1gp6RyWrXtySIr79OGGWS3x9p+CY6mk+1PHjbUQBt7qWxyEU7sYNtbvYkgoTuD+5LqNa1K8fO0WpRAJTCbLJm1yx8zp/lq9IbGuGc5Tj+Bv2VzA4k+PnhpP26rm8pzEdFy8aZiXvr38hywNkaemS7tsw5yhts5FL1W2h5mFhENEQSkUBwQp7Hy/6lEDtRmF5gJUGRaVRMxS/KYBhO5rQa5smjWMNkQKVn5szES2viCVHzyTOYPrIH7JzBdumOplwAXdPcpsL4trKPvqVtyvRmtPWXHrd27LJQ=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 63207440-952b-47e3-80f7-08db89f2e094
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 14:00:44.8063
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: lzAJI0OsoI3aTCV0drnCsct93ddhcta2wGvbVCp3VLnJnZ6na61vE8vSd8nTU4U/0iLC6u2sRmvK/modEakSbQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5486

On Thu, Jul 20, 2023 at 12:32:33AM +0000, Volodymyr Babchuk wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> 
> Assign SBDF to the PCI devices being passed through with bus 0.
> The resulting topology is where PCIe devices reside on the bus 0 of the
> root complex itself (embedded endpoints).
> This implementation is limited to 32 devices which are allowed on
> a single PCI bus.

I do wonder how this will work with ioreqs, iow: shouldn't it be the
toolstack that selects the virtual slot of the PCI device (in the
guest bus).  Otherwise I see a hard time reconciling how ioreqs and
vPCI can work together if vPCI has it's own (private) view of the bus,
and thinks it has exclusive ownership of it.

It might be something to deal afterwards, but would likely need a TODO
tag in order to realize it needs to be improved.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 14:08:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 14:08:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567565.886798 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMqne-0007C8-QU; Fri, 21 Jul 2023 14:08:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567565.886798; Fri, 21 Jul 2023 14:08:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMqne-0007C1-N8; Fri, 21 Jul 2023 14:08:06 +0000
Received: by outflank-mailman (input) for mailman id 567565;
 Fri, 21 Jul 2023 14:08:05 +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
 <SRS0=So7w=DH=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qMqnd-0007Bv-EC
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 14:08:05 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on060c.outbound.protection.outlook.com
 [2a01:111:f400:fe02::60c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ffc09f3c-27cf-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 16:08:00 +0200 (CEST)
Received: from DB7PR05CA0072.eurprd05.prod.outlook.com (2603:10a6:10:2e::49)
 by PR3PR08MB5786.eurprd08.prod.outlook.com (2603:10a6:102:85::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 14:07:56 +0000
Received: from DBAEUR03FT028.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:2e:cafe::d) by DB7PR05CA0072.outlook.office365.com
 (2603:10a6:10:2e::49) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28 via Frontend
 Transport; Fri, 21 Jul 2023 14:07:56 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT028.mail.protection.outlook.com (100.127.142.236) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6609.28 via Frontend Transport; Fri, 21 Jul 2023 14:07:56 +0000
Received: ("Tessian outbound e1fdbe8a48d3:v145");
 Fri, 21 Jul 2023 14:07:56 +0000
Received: from d12412e26dec.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 E2086BE4-027C-4DBC-83B2-CB295A6596F9.1; 
 Fri, 21 Jul 2023 14:07:50 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d12412e26dec.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 21 Jul 2023 14:07:50 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by AM8PR08MB6577.eurprd08.prod.outlook.com (2603:10a6:20b:355::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 14:07:47 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe%4]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 14:07:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ffc09f3c-27cf-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Sx3dnexRw5NDd9Tu1cAgD+pc9Q6SBtS4JugeJb3CAA4=;
 b=5dvbqkqnFsgsxAQixI7puzMmPp6eoeegjO09+L4hoX9DHAQ3ntoJ/GpCna+WagwY3h/ixoodLyO3SYcoRa3romIlDYzmyOUZWqXkR/n2VwXO+zf3scLmTJMMEiYOoKHgrzlb+3dCVY9hzSOFs9Tj+ojuZxi2AY3R0hUFfmQp1ag=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 4bb054820abf7023
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=YD6806nosYnbLE6o5V5suJSaTDqBz1hSQEW1l06h0YVc3zmkSHku34PJHvc9sL2QcwL4ZCB0sATex6AMOzFL28Ic5RvrhBKSPo+K/bDGJbKs1q8Qd9fbBrvRwLm7uG0uOmzyqBRrSoWcnh6ObrZBxNbNDLpPLFY0vreisXfHjxX+RA41VAR3tgC4y510FvjR3JB9QP1VDBOgzVaziNBh93zpqOV04EdInXuRqu6X2mFyWouNwz0cICp83KKeau94hGgkW6dNSDi8ayw4JGZDMVYR1P7CVHe0phwjFwa9/uxSkIUIbGDydlT22ULJCmt3VGkbA1FkwWCxKuMA8pYhKQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Sx3dnexRw5NDd9Tu1cAgD+pc9Q6SBtS4JugeJb3CAA4=;
 b=WVXmG9xoi+JB4DEn2ug2JppOYJNWLjqThMK6yKhHv0Nya0ZvogQhQf47BvdJVtePdkb7y7TKJwpR/hb4XBQ40KMpsmc880U7kwZI6/5WGU6ZtpD03jYnf2iIy+ZMQKP8/Qsn9gx6k3aDg0COvKFhAeR9FnGNLKOJzwPQap9+yi5aGfNerkBltjtx2MILmKlswWhEEn7GsNg7X2ehS8rhLMaxHdeFGAVI+Ge1QLu0+eTRLdZzAjz/1WBcCrX9K/0IzuCBeIphi9ke6dP90+KTpQcH4wUbsUWy/o8qny/juvZjBql6Mfrn+ObsYjluzXULf4dupt5tUiTUocq2E3DDmA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Sx3dnexRw5NDd9Tu1cAgD+pc9Q6SBtS4JugeJb3CAA4=;
 b=5dvbqkqnFsgsxAQixI7puzMmPp6eoeegjO09+L4hoX9DHAQ3ntoJ/GpCna+WagwY3h/ixoodLyO3SYcoRa3romIlDYzmyOUZWqXkR/n2VwXO+zf3scLmTJMMEiYOoKHgrzlb+3dCVY9hzSOFs9Tj+ojuZxi2AY3R0hUFfmQp1ag=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Jens Wiklander <jens.wiklander@linaro.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] xen/arm: Move TEE mediators in a kconfig submenu
Thread-Topic: [PATCH] xen/arm: Move TEE mediators in a kconfig submenu
Thread-Index:
 AQHZu6nFJdPelAC9nE2wzAZF/5qPkK/D6iMAgAACsoCAABzbgIAAHFKAgAALbgCAABCjAA==
Date: Fri, 21 Jul 2023 14:07:46 +0000
Message-ID: <8ABBDFFB-AE3C-4A8F-8AAA-F0C5EB99C2C3@arm.com>
References:
 <a44f74559f52d1fa90a3f77390e7d121c9cd848e.1689926422.git.bertrand.marquis@arm.com>
 <cb7b53bc-2440-8619-61ce-39c967b56eb7@suse.com>
 <DFD07AA0-E7E2-400B-8961-A646E5531DF7@arm.com>
 <6b24847c-5cd2-877a-bc72-16bb732e0ca2@suse.com>
 <C63A942A-AC5D-46CD-81B3-50B6376860E7@arm.com>
 <47ab1431-6a0b-6e74-92ec-8495c6bf8fbd@suse.com>
In-Reply-To: <47ab1431-6a0b-6e74-92ec-8495c6bf8fbd@suse.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|AM8PR08MB6577:EE_|DBAEUR03FT028:EE_|PR3PR08MB5786:EE_
X-MS-Office365-Filtering-Correlation-Id: 86168117-52df-4598-8eb7-08db89f3e1eb
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 B2IwZ5Kl+jpVEGxv54Z4JLdzGW9jfbK5HcPR5vHxORcgacZoVLiuTSiWeWIbwxMXFEMPWMIcNIwaH8ZqpfMxNz41SwHc5CVxiIpjmx/mD1GfL+2n5CoH/X8a4lspDDrk2aOixuSaLasDNso1aNH8XX3LpWAzOfkstjKHkh6F/UmhDl4/pCPRhGxNWsPoJc4Bui4KvghHEFvBphzTT5aREUBGBociEpTOS7+8oJh6BrL6BiTLGPyxsYtC+KTz0Wk+Dvsi6ibAHUQEx5l3pB2w3tbFL7jOy2CBjl3aglSpfrG6pBUP3PdeL9yNickhMU6x8UVrMIB7DaKo9AAOsJ19IYgeisSK9u/dp7AFqBevVZ3+iaaJkU0QkZGaFE81FvfFDHLwjzwDfmRUonQre0Xd2UT+C6x5v83olMplhjMu0ar587BXFgsoqOyVVgnONK+Z9vYISgXwgMQhxSQwoE/ZaWVk+y8PJ5xgOSiEmg/E5afSZvlTeWQaxsFanbLlx11MY8qPWyVct9u+fMessjcmH7aVOe/bi4qDttiuaxhDnvHZ2Gz8pQjMIbyq0Q03A/qcxpOeK8ELXTLR+hC3aIoKRNwIzuS7wPzSj09Qfjj+I/iquj/uk0Qf29AVhM17FK5op5GxMx7Bg/7c7d5fGx/SlxmDbctq5yQ1L331ITSz/ACWhUlLVz20o+zAzb+MumAH
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(346002)(396003)(39860400002)(136003)(376002)(451199021)(6512007)(122000001)(38100700002)(83380400001)(6506007)(53546011)(186003)(2616005)(26005)(2906002)(33656002)(8676002)(8936002)(5660300002)(36756003)(71200400001)(6486002)(478600001)(38070700005)(4326008)(66446008)(66476007)(66556008)(64756008)(41300700001)(316002)(66946007)(54906003)(76116006)(91956017)(6916009)(86362001)(76704002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <0D41B5E83E0C2D4AA3DC234E8FCB1216@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6577
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT028.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	651c4c3d-86c9-4e7b-1d8e-08db89f3dc5c
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Uz67tALfyDObGETzFkBvKL7T6Fol+WndbNyTj8DsTX7ZWHaZ3/4R1gq4fl7/4emZ4kujTIfK4yk1h6ewBxiUWbrbbWn8kVn5U+MMCQ9jtXA+QWaFaumfcWL2GWhjkIKffewR6kgj8+HhHapNpngRqj8nxoipCAWRXe/d3oMrAVFXTrJc9k8SCIXov1QCjaB9BWsvQ6G6RwTP98d4dpjlnAwNQlHQ4pDyclbMVy96SV/OhugOC+lRw6q0srhcvHM51UD72k41a/Jg5Ai3XLiD1zrgzhBSEBofO61v7Cl+tTdrFzp5v6UO37YKbZGvhe5COcIf03DGMc4xQ9FvqUoADgt41Pcqcw7aCrT05vICVyjcqiF/0RNac24cP2jeIPtXOxewsThiUrecZH0Ln3Xm/3X4m0iEm9IVWyEkYcWGZU1SH+7zgLfyARgD4e4SA+UAaetX4n3Nhd+XG4h9/jKEfm8Ocg0euW2iA8NA+g/XDNV1od37RFKGxWDBJzQVMXSashUCxv7uWTSnGvu+RFMsMPkz7JV52LbVlKjKGhi0iNxJp6g4x9kKrQ6ZTiIekzCRRLzOjZgCRTc6DWUuF0UPbvG8l7lDxoOn6W2GpHueY9/A6hv5J7TqJk+FK7DzzMLFhEMlQ3i4AOnAJ1e6+KGZVVHU3qGqKtunGENhdTvCPIpEONOU4VxZsZyjVPwkKynF/VcpDDS2KUJc4Ldp5iEdrfPuSQkewnhV6pZbmIsTYcgffn/tP5UwJmGNHzRH5LIjIwgue3cXhLShqIAvSxjROA==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(396003)(346002)(136003)(82310400008)(451199021)(46966006)(36840700001)(40470700004)(6486002)(6512007)(478600001)(54906003)(336012)(53546011)(186003)(6506007)(26005)(2906002)(70586007)(41300700001)(2616005)(4326008)(316002)(6862004)(5660300002)(70206006)(8936002)(8676002)(82740400003)(356005)(81166007)(33656002)(36756003)(86362001)(40460700003)(36860700001)(83380400001)(47076005)(40480700001)(76704002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 14:07:56.3270
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 86168117-52df-4598-8eb7-08db89f3e1eb
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT028.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5786

Hi Jan,

> On 21 Jul 2023, at 15:08, Jan Beulich <jbeulich@suse.com> wrote:
>=20
> On 21.07.2023 14:27, Bertrand Marquis wrote:
>> Hi Jan,
>>=20
>>> On 21 Jul 2023, at 12:45, Jan Beulich <jbeulich@suse.com> wrote:
>>>=20
>>> On 21.07.2023 11:02, Bertrand Marquis wrote:
>>>>> On 21 Jul 2023, at 10:52, Jan Beulich <jbeulich@suse.com> wrote:
>>>>> On 21.07.2023 10:02, Bertrand Marquis wrote:
>>>>>> --- a/xen/arch/arm/tee/Kconfig
>>>>>> +++ b/xen/arch/arm/tee/Kconfig
>>>>>> @@ -1,7 +1,17 @@
>>>>>> +menu "TEE mediators"
>>>>>> + visible if UNSUPPORTED
>>>>>=20
>>>>> With this ...
>>>>>=20
>>>>>> +config TEE
>>>>>> + bool
>>>>>> + default n
>>>>>> + help
>>>>>> +  This option enables generic TEE mediators support. It allows gues=
ts
>>>>>> +  to access real TEE via one of TEE mediators implemented in XEN.
>>>>>> +
>>>>>> config OPTEE
>>>>>> - bool "Enable OP-TEE mediator"
>>>>>> + bool "Enable OP-TEE mediator (UNSUPPORTED)" if UNSUPPORTED
>>>>>=20
>>>>> ... you shouldn't need the "if" here, and ...
>>>>>=20
>>>>>> default n
>>>>>> - depends on TEE
>>>>>> + select TEE
>>>>>> help
>>>>>> Enable the OP-TEE mediator. It allows guests to access
>>>>>> OP-TEE running on your platform. This requires
>>>>>> @@ -13,9 +23,13 @@ config FFA
>>>>>> bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
>>>>>=20
>>>>> ... you could drop the one here. I think.
>>>>=20
>>>> visible if is only for the GUI/ncurse display but the if is required
>>>> to make sure that a .config file cannot set CONFIG_TEE or
>>>> CONFIG_FFA if. UNSUPPORTED is not selected.
>>>=20
>>> Is what you describe "depends on"? "if" controls merely prompt
>>> visibility aiui.
>>=20
>> So you think that having  CONFIG_FFA without CONFIG_UNSUPPORTED
>> would be a valid configuration and the if is only here for the gui ?
>>=20
>> I tested that with the following procedure:
>> - use menuconfig, select UNSUPPORTED and FFA
>> - edit .config and disable UNSUPPORTED but keep FFA
>> - build
>> - CONFIG_FFA is removed from .config
>>=20
>> Now what puzzles me is that i did the same but removing the if UNSUPPORT=
ED
>> for TEE and FFA and i have exactly the same behaviour.
>>=20
>> So it seems that "if UNSUPPORTED" and visibility all behave in the same =
way
>> as depends on which i was not expecting.
>=20
> Hmm, maybe that's a bug in our variant of kconfig (we didn't sync
> for quite some time)?

It could be but if it is the case and we update we might end up with
people getting UNSUPPORTED features in where they would not
have been before (because the build is cleaning up .config).

>=20
>> So what should i keep or remove here ?
>=20
> My understanding so far was that "visibility" merely hides all prompts
> underneath (but then I use the command line version of the tool, not
> menuconfig), so it largely is shorthand for adding "if" to all enclosed
> prompts. Therefore I think all the "if UNSUPPORTED" are redundant and
> could be dropped. But then I'm also working from the understanding that
> "depends on" would behave somewhat differently ...

If that is ok with you I would rather keep them so that making one of them
SUPPORTED one day will not end up in wrongly making the other one
supported to. The visible if i added was more to "beautify" a bit when
unsupported is not selected so that we do not have an empty menu.

Cheers
Bertrand


>=20
> Jan




From xen-devel-bounces@lists.xenproject.org Fri Jul 21 14:10:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 14:10:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567567.886807 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMqpd-00008p-4v; Fri, 21 Jul 2023 14:10:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567567.886807; Fri, 21 Jul 2023 14:10:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMqpd-00008i-2D; Fri, 21 Jul 2023 14:10:09 +0000
Received: by outflank-mailman (input) for mailman id 567567;
 Fri, 21 Jul 2023 14:10:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dNy0=DH=citrix.com=prvs=559993d03=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qMqpa-0008VA-WC
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 14:10:07 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 49648e75-27d0-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 16:10:05 +0200 (CEST)
Received: from mail-dm3nam02lp2048.outbound.protection.outlook.com (HELO
 NAM02-DM3-obe.outbound.protection.outlook.com) ([104.47.56.48])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 21 Jul 2023 10:09:51 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ2PR03MB7094.namprd03.prod.outlook.com (2603:10b6:a03:4ff::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 14:09:49 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::38aa:4814:3c7b:78ea%5]) with mapi id 15.20.6588.031; Fri, 21 Jul 2023
 14:09:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 49648e75-27d0-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1689948605;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=tmGFNAh0DXwlYmpV23+dFivminsOr+JdnDfXfDMA89Y=;
  b=fai97Na4Y5h3OyLiDKAwrTAJiEy2PV0DJI8PpAqsdNBuGXxcfAi5dGkV
   7zhjPAdWtVtlORHEU0ZQmaADKGJbqAT+FFQ1KXqJTHq3qTj69mb7Dqyhq
   f1Fj0mgFB2MBf4UHbm+xtjWckFLQPx7/d6ffkrMXppwvfhBcmUVVdbBIf
   g=;
X-IronPort-RemoteIP: 104.47.56.48
X-IronPort-MID: 119619626
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:/ntF1aJRJIH0wZepFE+RFZQlxSXFcZb7ZxGr2PjKsXjdYENS1zUGz
 WsbXGnQPPzcNGv8KNxybdjnpEgPvZSHmoVlQQtlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws
 Jb5rta31GWNglaYCUpKrfrawP9TlK6q4mhA4QZnPakjUGL2zBH5MrpOfcldEFOgKmVkNrbSb
 /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/
 jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5vDSZzx
 fFfFwkdRR2KjsiQ756CYe9F05FLwMnDZOvzu1lG5BSBV7MKZMuGRK/Ho9hFwD03m8ZCW+7EY
 NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/dppTSDpOBy+OGF3N79YNuFSN8Thk+Fj
 mnH4374ElcRM9n3JT+tqyv92Laew3mlMG4UPJeftaFIomy6/zAsFAIRXlSGv/TosnfrDrqzL
 GRRoELCt5MaykuvSdXsWgyil1SNtBUcRtl4HvUz7UeGza+8yxaUAC0IQyBMbPQitdQqXno62
 1mRhdTrCDdz9rqPRhq10bOZrii7PyQPGkYEaTUZVgsO49Tlo4YbgwrGS5BoF6vdszHuMTT5w
 jTPoC1lgbwW1ZQPz//joQCBhC+wrJ/USAJz/h/QQm+u8gJ+YsiiepCs7l/Yq/1HKe51U2W8g
 ZTNoODGhMhmMH1HvHXlrDkldF1x28u4DQ==
IronPort-HdrOrdr: A9a23:hpsijKol+qRmadmuKHJ1YJoaV5rveYIsimQD101hICG9Evb0qy
 nOpoV/6faQslwssR4b9uxoVJPvfZq+z+8W3WByB9eftWDd0QPFEGgL1+DfKlbbak7DH4BmtJ
 uJc8JFeafN5VoRt7eG3OFveexQvOVu88qT9JjjJ28Gd3APV0n5hT0JcjpyFCdNNW57LKt8Lr
 WwzOxdqQGtfHwGB/7LfUXsD4D41rv2fIuNW29+OyIa
X-Talos-CUID: 9a23:UbQiKGFwsaAuXbfJqmJ/+AkpKs1iTUTN53rZKmWeJkpQY7u8HAo=
X-Talos-MUID: 9a23:Ayv0GQUrhFLzmcnq/BXLx25AFvZB2viRFF8Kmpo7pcTVDRUlbg==
X-IronPort-AV: E=Sophos;i="6.01,220,1684814400"; 
   d="scan'208";a="119619626"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=cbiDy7YTFuJCuVtJT2NabQv74hcQgS9sIoU/9FQ1SHC3bWxhJ5d99mgQfU9UVFFz/BQgpSuJ3bjbJP3rChsBw6rTJMb08GPGNt950BsrnUUBp0ggLP0JFxZz6EPvMuMCcf5wP/n/hStqAohWDUVe3xQU9eMjSj6UNSMQOFP0Zq8kXQaKvIsd9MuRbf8CZmjyAsirsxGOR0Z5H65sUvefkEemrOR0tA1xKdEA0GTWMeYEI5ixVHeiIDQ5OPoNgL5IN6NyCICadOZZVo5dQtOUSd+IqejjQnCDGxKImwDzbu+qZTJUOgFuSDNgx3ku624tlySHKQpANbk8HWgnrDTWVQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=86jMzWe3de5VBjC6nF+oPSaKCxPcywDaOC9vNr8jykM=;
 b=be14VrUR67Dk61K8xRoJNkGaHFE4CIqSQjULIDINz/Kqtw6MzBSqth6fyxf2NE9yodDoi9Tl1BdNK4vCZzWvrKXRjTdveLcSSJUlg5hiDM4u78fFZm39q+ah8kAcEJ771ZBvJitBxo+EdZ2kSdWt3PJeZevSDd5OHJ27EEe0BXJBHItYDFcOMjDbpgDA+leYMLrDPDXkSZQGxn/ab0PAjkv7LfuDJaEkBdqITwx5d7yXyhbc0Ntq2umczVOa4Znf+AuLjvVVpST9jO22e2GDLDvMYUzBIumrOI5eaNKoqqbq660h1GOCfeQOKXKxQaMXFCwG50UBOZXg3sDtv1emIA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=86jMzWe3de5VBjC6nF+oPSaKCxPcywDaOC9vNr8jykM=;
 b=iY4Mt2SuwmuRs3B7VwEqWMcEbKMQZiSa3l5DoD4ip0tdt19yMrXIDsOXiak0J14dLn373egCV4EKr39ELbach5Tt4Bgb1fnoOkGtffVxdz1TVe/apw1sy+wjvB1BVHttdydCCsIDclBQKzMObmEzW1y03le07j0pUTY9IDEKhP0=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 21 Jul 2023 16:09:43 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH v8 12/13] xen/arm: translate virtual PCI bus topology for
 guests
Message-ID: <ZLqRp4oiwiaI_-gw@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-13-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20230720003205.1828537-13-volodymyr_babchuk@epam.com>
X-ClientProxiedBy: LO4P265CA0101.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2bc::10) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ2PR03MB7094:EE_
X-MS-Office365-Filtering-Correlation-Id: 1e922db4-145c-424a-3794-08db89f42516
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	zeQXndydWAMfVRdqrjCmUDBX3x6/X+cvItNxdfu16nCfWXPV0bqPKOZo0WVcYlZP2BiSrostwRNdLgdK2WDmwdnpFWv31YejddwzYkB3ReIQz/OYwf32hOf+wD4edUDfORdDnUaRRn1lZmAM0laIcKKTOq1OBv8RSpNPG5jN6oIhtUtVvysFzwrrrGl92lKhmFjrWOxbwZz3Fnq687ZcMpdusc3n2QKBXsn/YEHF5KrbA1Rom24n9FJs49fA9QRYslVtT3RctQ+3vUcxEADlwhyTohPz8unO6+j8aF2O0pd5EQS+9UHoxX8ouLBioRDKv3Ms+rdCZstPGyaeNyRdV6/x/MNiVGYTSfyx7QhNjbxOWyvphcdo3mw5+KU5i20WNAhk/UrnDMbEhiFjzT5GsE1rFf/4oIXkxAEyKdHkneaxU9wGcApiiKVo0afaI597uFaF8mBFTImVSqJRd01QWp4mmKJ3/fhjnhja+gPz4GqXMGqfv4EYmgP/xyXXJKeSa71ZvsaZzYGnAswT/mHhh7IkMTzFq9/cZETH1TSRrKz/MyT7QN1ajHXolcoE65C1
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(136003)(366004)(376002)(39860400002)(451199021)(6486002)(6512007)(6666004)(9686003)(478600001)(54906003)(186003)(6506007)(26005)(2906002)(316002)(41300700001)(66476007)(66946007)(66556008)(5660300002)(4326008)(8936002)(8676002)(6916009)(82960400001)(38100700002)(86362001)(85182001)(83380400001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QWZGUFJLM0szcTBNR1ZYQ1QxaG5BNmd0N0pyTC9Ddkcyb3A3NXdIcSs5alhK?=
 =?utf-8?B?WUtFMzRsaGduOUFiQ0kvMHZoM2RQcDJ3SzJzNXZ1Z2hBTU5DbytoYld3REdZ?=
 =?utf-8?B?Qld5cERBaTFpclF6TzFYdjc2TmVjTkxveVJrTVNUZ1h0bVcyZ0t6ZDRDMFNa?=
 =?utf-8?B?UEY4SWRzUlgrbXFSdlNEWTZzbjhNTW5TQzFIT3UwSHpvR3FaWlJqUzR2ZFFn?=
 =?utf-8?B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OQ0FXZWWIvte5fMIhNfQmIntY0hGHSE3lfa4gJO3OuZCtI7/8iDFNbcmV7vRFaZRZNh/sBUP9j4=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1e922db4-145c-424a-3794-08db89f42516
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 14:09:49.2269
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: e6WmqO8WLSqk3lCvl2reDDR3Xfeo/Matny91i+KGQHaPhTBqS/waYxC5PCE8QyAqWp80/FEXnQjP5TjEctWAoQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR03MB7094

On Thu, Jul 20, 2023 at 12:32:34AM +0000, Volodymyr Babchuk wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> 
> There are three  originators for the PCI configuration space access:
> 1. The domain that owns physical host bridge: MMIO handlers are
> there so we can update vPCI register handlers with the values
> written by the hardware domain, e.g. physical view of the registers
> vs guest's view on the configuration space.
> 2. Guest access to the passed through PCI devices: we need to properly
> map virtual bus topology to the physical one, e.g. pass the configuration
> space access to the corresponding physical devices.
> 3. Emulated host PCI bridge access. It doesn't exist in the physical
> topology, e.g. it can't be mapped to some physical host bridge.
> So, all access to the host bridge itself needs to be trapped and
> emulated.
> 
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> ---
> Since v8:
> - locks moved out of vpci_translate_virtual_device()
> Since v6:
> - add pcidevs locking to vpci_translate_virtual_device
> - update wrt to the new locking scheme
> Since v5:
> - add vpci_translate_virtual_device for #ifndef CONFIG_HAS_VPCI_GUEST_SUPPORT
>   case to simplify ifdefery
> - add ASSERT(!is_hardware_domain(d)); to vpci_translate_virtual_device
> - reset output register on failed virtual SBDF translation
> Since v4:
> - indentation fixes
> - constify struct domain
> - updated commit message
> - updates to the new locking scheme (pdev->vpci_lock)
> Since v3:
> - revisit locking
> - move code to vpci.c
> Since v2:
>  - pass struct domain instead of struct vcpu
>  - constify arguments where possible
>  - gate relevant code with CONFIG_HAS_VPCI_GUEST_SUPPORT
> New in v2
> ---
>  xen/arch/arm/vpci.c     | 47 +++++++++++++++++++++++++++++++++++++++--
>  xen/drivers/vpci/vpci.c | 24 +++++++++++++++++++++
>  xen/include/xen/vpci.h  |  7 ++++++
>  3 files changed, 76 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/arm/vpci.c b/xen/arch/arm/vpci.c
> index 3bc4bb5508..66701465af 100644
> --- a/xen/arch/arm/vpci.c
> +++ b/xen/arch/arm/vpci.c
> @@ -28,10 +28,33 @@ static int vpci_mmio_read(struct vcpu *v, mmio_info_t *info,
>                            register_t *r, void *p)
>  {
>      struct pci_host_bridge *bridge = p;
> -    pci_sbdf_t sbdf = vpci_sbdf_from_gpa(bridge, info->gpa);
> +    pci_sbdf_t sbdf;
>      /* data is needed to prevent a pointer cast on 32bit */
>      unsigned long data;
>  
> +    ASSERT(!bridge == !is_hardware_domain(v->domain));
> +
> +    sbdf = vpci_sbdf_from_gpa(bridge, info->gpa);
> +
> +    /*
> +     * For the passed through devices we need to map their virtual SBDF
> +     * to the physical PCI device being passed through.
> +     */
> +    if ( !bridge )
> +    {
> +        bool translated;
> +
> +        read_lock(&v->domain->pci_lock);
> +        translated = vpci_translate_virtual_device(v->domain, &sbdf);
> +        read_unlock(&v->domain->pci_lock);
> +
> +        if ( !translated )
> +        {
> +            *r = ~0ul;
> +            return 1;
> +        }
> +    }
> +
>      if ( vpci_ecam_read(sbdf, ECAM_REG_OFFSET(info->gpa),
>                          1U << info->dabt.size, &data) )
>      {
> @@ -48,7 +71,27 @@ static int vpci_mmio_write(struct vcpu *v, mmio_info_t *info,
>                             register_t r, void *p)
>  {
>      struct pci_host_bridge *bridge = p;
> -    pci_sbdf_t sbdf = vpci_sbdf_from_gpa(bridge, info->gpa);
> +    pci_sbdf_t sbdf;
> +
> +    ASSERT(!bridge == !is_hardware_domain(v->domain));
> +
> +    sbdf = vpci_sbdf_from_gpa(bridge, info->gpa);
> +
> +    /*
> +     * For the passed through devices we need to map their virtual SBDF
> +     * to the physical PCI device being passed through.
> +     */
> +    if ( !bridge )
> +    {
> +        bool translated;
> +
> +        read_lock(&v->domain->pci_lock);
> +        translated = vpci_translate_virtual_device(v->domain, &sbdf);
> +        read_unlock(&v->domain->pci_lock);

You drop the lock here, so it's possible that returned SBDF is already
stale by the time Xen does scan the domain pdev list again?

I guess it's a minor issue.

> +
> +        if ( !translated )
> +            return 1;
> +    }
>  
>      return vpci_ecam_write(sbdf, ECAM_REG_OFFSET(info->gpa),
>                             1U << info->dabt.size, r);
> diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
> index baaafe4a2a..2ce36e811d 100644
> --- a/xen/drivers/vpci/vpci.c
> +++ b/xen/drivers/vpci/vpci.c
> @@ -177,6 +177,30 @@ static int add_virtual_device(struct pci_dev *pdev)
>      return 0;
>  }
>  
> +/*
> + * Find the physical device which is mapped to the virtual device
> + * and translate virtual SBDF to the physical one.
> + * This must hold domain's pci_lock in read mode.
> + */
> +bool vpci_translate_virtual_device(struct domain *d, pci_sbdf_t *sbdf)
> +{
> +    struct pci_dev *pdev;

const for pdev and d.

> +
> +    ASSERT(!is_hardware_domain(d));
> +
> +    for_each_pdev( d, pdev )
> +    {
> +        if ( pdev->vpci && (pdev->vpci->guest_sbdf.sbdf == sbdf->sbdf) )
> +        {
> +            /* Replace guest SBDF with the physical one. */
> +            *sbdf = pdev->sbdf;

Since you are already iterating over the domain pdev list, won't it be
more helpful to return the pdev?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 14:10:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 14:10:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567570.886818 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMqqL-0000gn-Ge; Fri, 21 Jul 2023 14:10:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567570.886818; Fri, 21 Jul 2023 14:10:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMqqL-0000gg-Dq; Fri, 21 Jul 2023 14:10:53 +0000
Received: by outflank-mailman (input) for mailman id 567570;
 Fri, 21 Jul 2023 14:10:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMqqK-0000fF-1F; Fri, 21 Jul 2023 14:10:52 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMqqJ-0007D2-LV; Fri, 21 Jul 2023 14:10:51 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMqqI-0006xp-T1; Fri, 21 Jul 2023 14:10:50 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMqqI-0001FR-ST; Fri, 21 Jul 2023 14:10:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=0KW0dNjSuzLRi225FLyMd3x3zpk2S2L3kKTHCeolYpw=; b=HshOmH9tnkICSgBZQ1RePVzBmm
	LKTc8hpRT2Ct756WO9n65Yi5gqSEVevuMEvNrhQVXzffUizhotBSFDt9F1g+MBXIzxoVwB+s16JCH
	b/m/1IHILrbbAjPdgs998x28SC2tvr3qIBhsp53xVEETIKlO0IqsECwn5le0jpoMgY4o=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181956-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181956: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=0c53c638e16278078371ce028c74693841d7738a
X-Osstest-Versions-That:
    xen=1ab2ae1610d99423af5b810829959431e43de12d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 21 Jul 2023 14:10:50 +0000

flight 181956 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181956/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  0c53c638e16278078371ce028c74693841d7738a
baseline version:
 xen                  1ab2ae1610d99423af5b810829959431e43de12d

Last test of basis   181941  2023-07-20 23:03:34 Z    0 days
Testing same since   181948  2023-07-21 07:00:24 Z    0 days    2 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Federico Serafini <federico.serafini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Juergen Gross <jgross@suse.com>
  Julien Grall <jgrall@amazon.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   1ab2ae1610..0c53c638e1  0c53c638e16278078371ce028c74693841d7738a -> smoke


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 14:24:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 14:24:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567577.886828 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMr3b-0002O7-MR; Fri, 21 Jul 2023 14:24:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567577.886828; Fri, 21 Jul 2023 14:24:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMr3b-0002O0-Jb; Fri, 21 Jul 2023 14:24:35 +0000
Received: by outflank-mailman (input) for mailman id 567577;
 Fri, 21 Jul 2023 14:24:34 +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 <SRS0=FBlW=DH=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qMr3a-0002Nu-3m
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 14:24:34 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2061c.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::61c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4eee65cd-27d2-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 16:24:32 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by GVXPR04MB9778.eurprd04.prod.outlook.com (2603:10a6:150:110::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul
 2023 14:24:29 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 14:24:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4eee65cd-27d2-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=QdDKkaYMTSiYuOm/17RdPNTeAETc5rBjlbCKnss4TTR91Ai1ErQAwedEOGO51qz2Rhb1Z08MbmpejuX7AxJ2Ttc9oGjKEwDAILVaqZiSuWeZPanG0aOA7boH2FHrn5t3fiFKElfpOcMpflonE41yvMhYEtOuE/7Lcu0G1DpyjtR82UttCRBulw6wMClrnoTbN3OzOygn/SgMNk5zQAMG7Mt7eKSuRzB8ChHvaRQ4/RxYilWnDMAl2qvqU8ILe8EbX7zxgFyS0WS8WoL1kUnhNSd+PGlbAHsqy4DLY0DlkCVxsTn25CQMCHfGExHwxKm+hNcPwftDJx8vdcN1fw+nGQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=upfyQASg5GCgFNr8NCwv5iw6jg70UGhBI6DsBqE85rQ=;
 b=hKa/AaRTCqxWg3rNuI80wpFjptkcs6BIeDg51oQPEOITSBVbVduKCjYPiaLsdAL9FhUGLQ2Ty+jc6FVRGIo7/eRcqUvH4elQRVTGb3UVL30GCoSFxIyd2oKUtLLWx1toS/uLafFTGx9iaj/T27EfwGLJMIy+Aa7DXrFq8bUU6XTamy3c2ppyQ+diIXmgUjStnGZJkpjmZnfpmGWGMBgpZxWR0WZ49R6l0hybQJpYEPF32QvyU/xSUYuLdJOoG1vLiqn3X9pk8FKWJ/Ua8826fLAWSrQc9J0jxmgdQQwOhSt5UviWktYu7iNTF0V4yiwnhq+pcKHUZi57Os1QATfycQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=upfyQASg5GCgFNr8NCwv5iw6jg70UGhBI6DsBqE85rQ=;
 b=o3y75To93Ng552GpUsO9HTR2XWk/eFoFB+suj+MZnroCxYQJwMMGldeG/YnRHjJOLOzD/buOQhgEPedURZBvxzB2Ue+WKiW3EvBY9CpzISuU9ksyyUB0FciKdapBL0bOOsg7wjg3337IEINS611AdSYh8ZQtiZ91CFL5ALeMAzXiYLkVqulojRzsgtgRJ9kGUYzal0t6vQaLv8OCAO98l3WXahtF2rNZXbibTW1iCfaLT8UEpSY7hjyU3YsPvkfba0qIdZh8jm8HThq+SlE1x5F8DIJS9Aocgh9IWS8IbHuPcLY0YD85phprc16jPanwz306iHCW8NeY4haVJkvcHQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <fc1bffbe-c5ce-ba05-ad01-22bb1ff983b7@suse.com>
Date: Fri, 21 Jul 2023 16:24:27 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] xen/arm: Move TEE mediators in a kconfig submenu
Content-Language: en-US
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Jens Wiklander <jens.wiklander@linaro.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <a44f74559f52d1fa90a3f77390e7d121c9cd848e.1689926422.git.bertrand.marquis@arm.com>
 <cb7b53bc-2440-8619-61ce-39c967b56eb7@suse.com>
 <DFD07AA0-E7E2-400B-8961-A646E5531DF7@arm.com>
 <6b24847c-5cd2-877a-bc72-16bb732e0ca2@suse.com>
 <C63A942A-AC5D-46CD-81B3-50B6376860E7@arm.com>
 <47ab1431-6a0b-6e74-92ec-8495c6bf8fbd@suse.com>
 <8ABBDFFB-AE3C-4A8F-8AAA-F0C5EB99C2C3@arm.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <8ABBDFFB-AE3C-4A8F-8AAA-F0C5EB99C2C3@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0060.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:49::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|GVXPR04MB9778:EE_
X-MS-Office365-Filtering-Correlation-Id: 02adf2c4-6618-4e7e-3e4b-08db89f631e2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	RI1hDa3b3Dx11C5yLP5HTm10+wk8XUihbQjrZjbV+RpcLvN4hX2oxov+ZO5y1Hh3y5tNQxfBkqTC3YkXeK8xBkxvo/n8ZCdNj0R++ei82BlMtagA0s3r2IAI9WALIqGZaJuhrML0e1nQrptQ/MJ25xJcD7wv3SqvgFxQPNcTSPXum/1SGFdS7H1jX7xr69q1BunHa5owkC0SBEpLjEH7tURjBBnHM4kbl0sk2t8uVh8FtRpR/gLmuBgs0yWvFcbhae24+0oJG64FI01N2irOfiLxEMX3XDkAzMnFMfeouuN9Ifa/ihBN3wgN11qfJvuOQ5zGQtCPmYvyyw6dcjiIbDLndLJwmRCmybW8FPIX0P34c26w1UCmcLTbuP6YN+b8rZjDJ6MqROivP+zvOxgrUYrPvrEtbUefQeOCPKm2lupAo9VjwyFFZ95u45kDvR9XP4Xw0Z+AZeIx5q+Qb3+qJSvBhELTkawRs393BuMR4r15zJ4MNXhdRoT2F75rWPYK6tSx0MlJeF8n9FnSv+shItfG4/95Nfurk/7AJAYT791RkGE0/+CXQ1uxzxcTx/SZ9zcZzomyFo9duHP/q0y2Ir4dk7at0FG7Ksq8xOObWqQtNKs4RltCMXWt9Kf+bSQFfm9gFxau5fnPPZQw7OzEyOyqv8ns2CjcQZDoVte8doUTAMJv7nHS8ZMqK2MVh0ij
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(136003)(346002)(396003)(376002)(366004)(451199021)(2906002)(54906003)(478600001)(41300700001)(8936002)(8676002)(5660300002)(66556008)(66476007)(66946007)(4326008)(31696002)(6916009)(316002)(26005)(31686004)(2616005)(86362001)(36756003)(186003)(6506007)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3?=
 =?utf-8?B?alJKcWJYb3VzRHFLRzQrM3Z3RVBoWnFVMFpWaWRoQitLMHk1RlRZNzhHaHVS?=
 =?utf-8?B?WjB1Ynl2Q0hGVElOT29VMVlCQS9ETDU3WEJaTzJBK05QM1hlOCtHQ0JJcjhS?=
 =?utf-8?B?ZndjV1M5cFkvNkZYaXNseUNtTGJ5ZVRwRnZHQU9YZThqakc4VWM0UUpRZFNX?=
 =?utf-8?B?RzBpQVo4OVZvZDgzS1hpTWY4UW9jbFd2RnQweEtMOHU2eFdlZk1nbDhtQlR5?=
 =?utf-8?B?dzE3VnZIZGZuek1tdFc1SWIyK1E5YkgzV0dqZDVSaHdnVjQ5WWpURXlMcWgr?=
 =?utf-8?B?eFprWjZSaGV0MlgyU2JlVFBjcE5VL1UyenlvQ1pBVVM4M0JoeCtROENqaDh6?=
 =?utf-8?B?MEk0VVhvREJXR3BwckJRdW1TckhxT1lyYzJMeUhpSGQwWnJtK0Vwb29BME9G?=
 =?utf-8?B?K3UrN2U2Vk1nMkFUdFV3VEF0RXFWd2ZSbUNOVHE2UnA5dnBZdFM3Vk81eTBl?=
 =?utf-8?Q?BQc2eBp2U0/LkYZMVnQzBP4Cf?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 02adf2c4-6618-4e7e-3e4b-08db89f631e2
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 14:24:29.6895
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: oC/zTumzC9RrjK+uQLJcZomXZHlgy0cxSrKtPJr8pIjmP3lMO5mGlZPUZZnC4k61EWJ8pqzWT9s98LYHYbl8WA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9778

On 21.07.2023 16:07, Bertrand Marquis wrote:
>> On 21 Jul 2023, at 15:08, Jan Beulich <jbeulich@suse.com> wrote:
>> On 21.07.2023 14:27, Bertrand Marquis wrote:
>>> So what should i keep or remove here ?
>>
>> My understanding so far was that "visibility" merely hides all prompts
>> underneath (but then I use the command line version of the tool, not
>> menuconfig), so it largely is shorthand for adding "if" to all enclosed
>> prompts. Therefore I think all the "if UNSUPPORTED" are redundant and
>> could be dropped. But then I'm also working from the understanding that
>> "depends on" would behave somewhat differently ...
> 
> If that is ok with you I would rather keep them so that making one of them
> SUPPORTED one day will not end up in wrongly making the other one
> supported to. The visible if i added was more to "beautify" a bit when
> unsupported is not selected so that we do not have an empty menu.

You're the maintainer, so you judge what is best. If I was maintainer, the
primary thing I would ask for is that there be no redundancy. IOW here
either no "if"s or no "visibility".

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 14:26:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 14:26:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567579.886837 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMr4r-0002vP-Vt; Fri, 21 Jul 2023 14:25:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567579.886837; Fri, 21 Jul 2023 14:25:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMr4r-0002vI-TI; Fri, 21 Jul 2023 14:25:53 +0000
Received: by outflank-mailman (input) for mailman id 567579;
 Fri, 21 Jul 2023 14:25:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=R0zQ=DH=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qMr4q-0002v8-Ld
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 14:25:52 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7dda6a21-27d2-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 16:25:50 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.160.253.240])
 by support.bugseng.com (Postfix) with ESMTPSA id 95F9C4EE0C89;
 Fri, 21 Jul 2023 16:25:49 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7dda6a21-27d2-11ee-b23a-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>
Subject: [XEN PATCH] device_tree: address violations of MISRA C:2012 Rules 8.2 and 8.3
Date: Fri, 21 Jul 2023 16:25:41 +0200
Message-Id: <8acb3e1a39c4251a23b59d5c094b7fb39f7a5ed9.1689949312.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Give a name to unnamed parameters thus addressing violations of
MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
named parameters").
Keep consistency between parameter names and types used in function
declarations and the ones used in the corresponding function
definitions, thus addressing violations of MISRA C:2012 Rule 8.3
("All declarations of an object or function shall use the same names
and type qualifiers").

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/common/device_tree.c      | 24 ++++++++++++------------
 xen/include/xen/device_tree.h | 16 ++++++++--------
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 0677193ab3..319f98f8c2 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -85,11 +85,11 @@ struct dt_bus
     unsigned int (*get_flags)(const __be32 *addr);
 };
 
-void dt_get_range(const __be32 **cell, const struct dt_device_node *np,
+void dt_get_range(const __be32 **cellp, const struct dt_device_node *np,
                   u64 *address, u64 *size)
 {
-    *address = dt_next_cell(dt_n_addr_cells(np), cell);
-    *size = dt_next_cell(dt_n_size_cells(np), cell);
+    *address = dt_next_cell(dt_n_addr_cells(np), cellp);
+    *size = dt_next_cell(dt_n_size_cells(np), cellp);
 }
 
 void dt_set_cell(__be32 **cellp, int size, u64 val)
@@ -993,9 +993,9 @@ int dt_device_get_paddr(const struct dt_device_node *dev, unsigned int index,
 }
 
 int dt_for_each_range(const struct dt_device_node *dev,
-                      int (*cb)(const struct dt_device_node *,
+                      int (*cb)(const struct dt_device_node *dev,
                                 uint64_t addr, uint64_t length,
-                                void *),
+                                void *data),
                       void *data)
 {
     const struct dt_device_node *parent = NULL;
@@ -1164,7 +1164,7 @@ unsigned int dt_number_of_irq(const struct dt_device_node *device)
     return (intlen / intsize);
 }
 
-unsigned int dt_number_of_address(const struct dt_device_node *dev)
+unsigned int dt_number_of_address(const struct dt_device_node *device)
 {
     const __be32 *prop;
     u32 psize;
@@ -1173,20 +1173,20 @@ unsigned int dt_number_of_address(const struct dt_device_node *dev)
     int onesize, na, ns;
 
     /* Get parent & match bus type */
-    parent = dt_get_parent(dev);
+    parent = dt_get_parent(device);
     if ( parent == NULL )
         return 0;
 
     bus = dt_match_bus(parent);
     if ( !bus )
         return 0;
-    bus->count_cells(dev, &na, &ns);
+    bus->count_cells(device, &na, &ns);
 
     if ( !DT_CHECK_COUNTS(na, ns) )
         return 0;
 
     /* Get "reg" or "assigned-addresses" property */
-    prop = dt_get_property(dev, bus->addresses, &psize);
+    prop = dt_get_property(device, bus->addresses, &psize);
     if ( prop == NULL )
         return 0;
 
@@ -1197,9 +1197,9 @@ unsigned int dt_number_of_address(const struct dt_device_node *dev)
 }
 
 int dt_for_each_irq_map(const struct dt_device_node *dev,
-                        int (*cb)(const struct dt_device_node *,
-                                  const struct dt_irq *,
-                                  void *),
+                        int (*cb)(const struct dt_device_node *dev,
+                                  const struct dt_irq *dt_irq,
+                                  void *data_cb),
                         void *data)
 {
     const struct dt_device_node *ipar, *tnode, *old = NULL;
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index c2eada7489..e5d4fbc327 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -538,7 +538,7 @@ bool_t dt_machine_is_compatible(const char *compat);
  * Returns a node pointer with refcount incremented, use
  * of_node_put() on it when done.
  */
-struct dt_device_node *dt_find_node_by_name(struct dt_device_node *node,
+struct dt_device_node *dt_find_node_by_name(struct dt_device_node *from,
                                             const char *name);
 
 /**
@@ -639,7 +639,7 @@ unsigned int dt_number_of_address(const struct dt_device_node *device);
  * device-tree node. It's the high level pendant to dt_device_get_raw_irq().
  */
 int dt_device_get_irq(const struct dt_device_node *device, unsigned int index,
-                      struct dt_irq *irq);
+                      struct dt_irq *out_irq);
 
 /**
  * dt_device_get_raw_irq - Resolve an interrupt for a device without translation
@@ -652,7 +652,7 @@ int dt_device_get_irq(const struct dt_device_node *device, unsigned int index,
  */
 int dt_device_get_raw_irq(const struct dt_device_node *device,
                           unsigned int index,
-                          struct dt_raw_irq *irq);
+                          struct dt_raw_irq *out_irq);
 
 /**
  * dt_irq_translate - Translate an irq
@@ -668,9 +668,9 @@ int dt_irq_translate(const struct dt_raw_irq *raw, struct dt_irq *out_irq);
  * @data: Caller data passed to callback
  */
 int dt_for_each_irq_map(const struct dt_device_node *dev,
-                        int (*cb)(const struct dt_device_node *,
-                                  const struct dt_irq *,
-                                  void *),
+                        int (*cb)(const struct dt_device_node *dev,
+                                  const struct dt_irq *irq,
+                                  void *data),
                         void *data);
 
 /**
@@ -680,9 +680,9 @@ int dt_for_each_irq_map(const struct dt_device_node *dev,
  * @data: Caller data passed to callback
  */
 int dt_for_each_range(const struct dt_device_node *dev,
-                      int (*cb)(const struct dt_device_node *,
+                      int (*cb)(const struct dt_device_node *dev,
                                 uint64_t addr, uint64_t length,
-                                void *),
+                                void *data),
                       void *data);
 
 /**
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 14:34:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 14:34:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567591.886848 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMrDE-0004To-Tw; Fri, 21 Jul 2023 14:34:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567591.886848; Fri, 21 Jul 2023 14:34:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMrDE-0004Th-RC; Fri, 21 Jul 2023 14:34:32 +0000
Received: by outflank-mailman (input) for mailman id 567591;
 Fri, 21 Jul 2023 14:34:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=So7w=DH=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1qMrDE-0004Tb-9D
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 14:34:32 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0623.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::623])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b44a4483-27d3-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 16:34:31 +0200 (CEST)
Received: from DUZPR01CA0196.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4b6::23) by AS8PR08MB7861.eurprd08.prod.outlook.com
 (2603:10a6:20b:52c::13) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 14:34:24 +0000
Received: from DBAEUR03FT048.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4b6:cafe::65) by DUZPR01CA0196.outlook.office365.com
 (2603:10a6:10:4b6::23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25 via Frontend
 Transport; Fri, 21 Jul 2023 14:34:23 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT048.mail.protection.outlook.com (100.127.142.200) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6609.28 via Frontend Transport; Fri, 21 Jul 2023 14:34:23 +0000
Received: ("Tessian outbound 95df046a2e2c:v145");
 Fri, 21 Jul 2023 14:34:23 +0000
Received: from 719f1c104e83.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 81537DE2-14F5-450A-A827-6C7C8359A46F.1; 
 Fri, 21 Jul 2023 14:34:17 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 719f1c104e83.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 21 Jul 2023 14:34:17 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com (2603:10a6:20b:85::25)
 by GV1PR08MB8131.eurprd08.prod.outlook.com (2603:10a6:150:91::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Fri, 21 Jul
 2023 14:34:15 +0000
Received: from AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe]) by AM6PR08MB3784.eurprd08.prod.outlook.com
 ([fe80::3cb8:2053:e853:92fe%4]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 14:34:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b44a4483-27d3-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RZCMC/vszV1gc2aSIVmW1r2fT1riDnMdaiaIthroaFA=;
 b=k9Cyrd/HoBjU0yVoPMS4x7UG3Veb3dTr5l9jLAhTFqUrcd61VbTQza7sCwr/a55XEIh1CwUkTj8yAYPWDCuU/GwoUOcvmsIRkHNwHC0DFFEZ8NoiVZOHdUUt3udj8wMN5JpH3DqhSrUyw+LX2p5J+r35QxgZuJTfUO8E29nyIkg=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 3a0b060e0ac7052b
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=HXJeofWsZQL0Zqk9PaITS34vAakyyb18WEIh5l4Aq50srB8XnEdFhif2nnw7f8ywiSJlzOfshXIm8Nf4vSU4eSjcjE1FhD5ytzxPR+RhfbuWgd7R8crxlHQbkAvzhoGV6zKVKwiI0UJM88rwXiMs7QAeQywwm+2JKtFU90TFg/IC8/ATbiIfC5dLqFSkJRjPScB/1opX/8Gv1QZ0Fr3u0M3GzIBG6+1sCKM/oaT439mNfxfSQBTvm1EdSLVytH3QomVYhx6qsGI1bJDzU5ytyGnZTTiCxQ318pyFXkC23JyJapRG/rJNFvmhgGBnXrIARDMutbzKU7kG9WJbKL4vLA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=RZCMC/vszV1gc2aSIVmW1r2fT1riDnMdaiaIthroaFA=;
 b=Zf1+Bg0qoH5evzqY8/u2MlWAFsSvcCXvQmmuvpz4rLXBwBpETgCMllW8UUo7JBBS7l0mLvdg2GzL4HPM28HJEJ1Ocq2Ew6L1PAfszQmOxTwKcxRD7XA84KlALsA132ebLtJft4fGfPeQUOWhFXUozHkQEUqajj7JleSRJbLsAuKGi76HTbNq2OYqHXHRSrUBRx91RY0YXq9moVgWT7nSkOyN/OEuBgtoyGiSwQE706DFG+zZnN6tcgxG8QMWbdHUajW9gBBHDUOQYM9tbel+H95VQLZYvqfBt2Q+ZHMeVSqf9iToLVDvXA0gmicLHK9M0trBiq2FokqnX5n4EnslyA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RZCMC/vszV1gc2aSIVmW1r2fT1riDnMdaiaIthroaFA=;
 b=k9Cyrd/HoBjU0yVoPMS4x7UG3Veb3dTr5l9jLAhTFqUrcd61VbTQza7sCwr/a55XEIh1CwUkTj8yAYPWDCuU/GwoUOcvmsIRkHNwHC0DFFEZ8NoiVZOHdUUt3udj8wMN5JpH3DqhSrUyw+LX2p5J+r35QxgZuJTfUO8E29nyIkg=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Jens Wiklander <jens.wiklander@linaro.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] xen/arm: Move TEE mediators in a kconfig submenu
Thread-Topic: [PATCH] xen/arm: Move TEE mediators in a kconfig submenu
Thread-Index:
 AQHZu6nFJdPelAC9nE2wzAZF/5qPkK/D6iMAgAACsoCAABzbgIAAHFKAgAALbgCAABCjAIAABLWAgAACsAA=
Date: Fri, 21 Jul 2023 14:34:15 +0000
Message-ID: <60BC1EAE-ACE2-4D28-9323-51E03D405B35@arm.com>
References:
 <a44f74559f52d1fa90a3f77390e7d121c9cd848e.1689926422.git.bertrand.marquis@arm.com>
 <cb7b53bc-2440-8619-61ce-39c967b56eb7@suse.com>
 <DFD07AA0-E7E2-400B-8961-A646E5531DF7@arm.com>
 <6b24847c-5cd2-877a-bc72-16bb732e0ca2@suse.com>
 <C63A942A-AC5D-46CD-81B3-50B6376860E7@arm.com>
 <47ab1431-6a0b-6e74-92ec-8495c6bf8fbd@suse.com>
 <8ABBDFFB-AE3C-4A8F-8AAA-F0C5EB99C2C3@arm.com>
 <fc1bffbe-c5ce-ba05-ad01-22bb1ff983b7@suse.com>
In-Reply-To: <fc1bffbe-c5ce-ba05-ad01-22bb1ff983b7@suse.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3784:EE_|GV1PR08MB8131:EE_|DBAEUR03FT048:EE_|AS8PR08MB7861:EE_
X-MS-Office365-Filtering-Correlation-Id: aaba00b6-60b1-4081-0508-08db89f793f5
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 YvPZfCI83leAL7ky0Y063KVNDWSgvlCuTkYPjIA+u7tyeHvmcQz4BVtBlBCX5goaAlUqiNy7v7Iatk+wfhsg+hUhN/F/zxk4EJZwQekzdial3HOn5J8PJWxxuHRJmH4VIXw/0HjT9iHpXwbgIhjaqNRtH5qRqJd5VroUNweIYxSWsxwELVMxGZjlY7AvqKeBd4bWX6OXBj6hTIczPahyRHRDRjmTG9hH0PijFXBUhaFV0xVDLlKlfSHNy4yQx5fkceZT2K3hyzIE22eO2GOQnA5YSQm5JqJqmd2cOXHPGfJq28uy970iQVNFbrK2ahuJj1po6SC4i1YSxnRjsHMvNe1r/RUUTX/lIdbjUQ6un5At4zU1M6QjbP82DM/PEh774N7pvn3Mxl1kuf0vsDpLnaJ1AKoA7uoCLoCQ/PC1djzvWWK5tDnY8tx12leTyFVDPUUPekV7Q22lE5QbXoFMK1+ZQOpXT7D0rqz93lpzeI4Na2ruAVjQxdDWwmKkkFRn2lW7ceXASnyajlCj0YYqTMsNaPHHggp3/L53Npk4vxh4fT6lFtxPeOFWlOrVyz/K35Ybwld2lUiH++mYMjUTJ9FvdMdsEVKoMuSOGCHQrdr3o/BarVTQO+k8+iChTZc7YMQAoAvN+TWN+RD94FyLr14xEAhmJJG5pgy4zo4tCvc=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3784.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(366004)(396003)(376002)(39860400002)(451199021)(91956017)(53546011)(4326008)(6916009)(6486002)(6506007)(26005)(66446008)(66946007)(64756008)(478600001)(76116006)(66476007)(54906003)(66556008)(36756003)(86362001)(33656002)(71200400001)(186003)(83380400001)(2616005)(41300700001)(5660300002)(6512007)(8676002)(8936002)(2906002)(38070700005)(38100700002)(316002)(122000001)(76704002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <4056CB18F8BF434E899C8AAF3DC7E0BE@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8131
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT048.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	420169f8-4b44-48e6-6516-08db89f78efd
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	HSk/k5Tk/+5/6SIHpmpJsvx1e26SnbuStWxdTGt3a9al8iO9DRBRNwPv69RjuncLwUXhY1ffm9vFHX114+p+oZ5D4/cwj0bwuX37JaiMP6feAw3OX5/aF0GKJeVioMfnJUVEVxQsBEBWSUKGtRBSTbJQi6AeaPkLXjbPd0KZvu2R47alz4rsYBUK3DI5kBfa/IcR5cxH24xL89N2EKO3EAtUTZu768ngJDsL5fgw5jnBz9VWV04NX/TL4PNdDyBbpAnNYXT5iWOM2vK5izqDd770rs0xwrTCfaR8l5JVSIZ3vXjG6TebG4c+EWOUdFdUWAbHzZijxG3q4I7Q3L2iXxLKtQkNESWqAphas1CDz5o8K2y230Th4wtmoxA2EWqcLQ6wrXlT4Fqf+m5BACckgcW28K8aUk0/hBHMn7mBuo3IyYoWCKSjWa6Wx1lsNAxu13GpVLed0aOMnzf9K3lOw7woMzrb79WSqmOS6+ABdifAto1wTK45snuu6RvHmcNB9NwNfmXuwe2YBGl740tY94MPWTJpsn14IEiO67k158z2MhVDlFVrzrTG6qGuKXTNLikRrKHbT2fGWZqaBktqOTzc7vuaBH63Hv3UYF3czbODMPYfpnMfp0vhkZjbmT4cCaTMglmb+66iUnTElChgYxX4DwEMZvwQGjTuslkTxMXCm9z3yJKnTZQH0SJcJO/GyUVPfQuUqyE7C6P7+gK8Xe7737pmsijepnJSf/pSr/YUA48VnN34OUZrsqdIy7RFC4Zm7verQV43KQ755mjqLQ==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(39860400002)(136003)(376002)(451199021)(82310400008)(46966006)(40470700004)(36840700001)(6512007)(40480700001)(81166007)(356005)(83380400001)(6506007)(47076005)(53546011)(82740400003)(186003)(2616005)(336012)(26005)(36860700001)(2906002)(33656002)(8676002)(40460700003)(8936002)(6862004)(5660300002)(36756003)(6486002)(478600001)(4326008)(41300700001)(316002)(70206006)(54906003)(70586007)(86362001)(76704002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 14:34:23.5136
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: aaba00b6-60b1-4081-0508-08db89f793f5
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT048.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7861

Hi Jan,

> On 21 Jul 2023, at 16:24, Jan Beulich <jbeulich@suse.com> wrote:
>=20
> On 21.07.2023 16:07, Bertrand Marquis wrote:
>>> On 21 Jul 2023, at 15:08, Jan Beulich <jbeulich@suse.com> wrote:
>>> On 21.07.2023 14:27, Bertrand Marquis wrote:
>>>> So what should i keep or remove here ?
>>>=20
>>> My understanding so far was that "visibility" merely hides all prompts
>>> underneath (but then I use the command line version of the tool, not
>>> menuconfig), so it largely is shorthand for adding "if" to all enclosed
>>> prompts. Therefore I think all the "if UNSUPPORTED" are redundant and
>>> could be dropped. But then I'm also working from the understanding that
>>> "depends on" would behave somewhat differently ...
>>=20
>> If that is ok with you I would rather keep them so that making one of th=
em
>> SUPPORTED one day will not end up in wrongly making the other one
>> supported to. The visible if i added was more to "beautify" a bit when
>> unsupported is not selected so that we do not have an empty menu.
>=20
> You're the maintainer, so you judge what is best. If I was maintainer, th=
e
> primary thing I would ask for is that there be no redundancy. IOW here
> either no "if"s or no "visibility".

In this case i do think that the "if UNSUPPORTED" per entry is important
so that it clear per config entry which ones are unsupported.

So if other arm maintainers agree with your point, i would remove the
"visibility" and keep an empty menu.
But my vote is to keep both.

@julien and Stefano: Any view on that ?

Cheers
Bertrand

>=20
> Jan



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 15:09:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 15:09:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567596.886857 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMrkm-00085G-MP; Fri, 21 Jul 2023 15:09:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567596.886857; Fri, 21 Jul 2023 15:09:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMrkm-000859-Jl; Fri, 21 Jul 2023 15:09:12 +0000
Received: by outflank-mailman (input) for mailman id 567596;
 Fri, 21 Jul 2023 15:09:10 +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
 <SRS0=bkvi=DH=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qMrkk-00084n-SZ
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 15:09:10 +0000
Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com
 [2a00:1450:4864:20::633])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8948728c-27d8-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 17:09:06 +0200 (CEST)
Received: by mail-ej1-x633.google.com with SMTP id
 a640c23a62f3a-9924ac01f98so322997166b.1
 for <xen-devel@lists.xenproject.org>; Fri, 21 Jul 2023 08:09:06 -0700 (PDT)
Received: from EMEAENGAAD19049. (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 mc13-20020a170906eb4d00b00988c0c175c6sm2272381ejb.189.2023.07.21.08.09.05
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 21 Jul 2023 08:09:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8948728c-27d8-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1689952146; x=1690556946;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=sjpbD0hG/VdEHDmZOuXkIsY3klgYFoxMw8k6FKHZP9U=;
        b=MyAYXrHvai4a/9WEWdysYfhGPcaCuYRMV97SKbI/QWvxhpHs6HTjgDy4k9wiPobbid
         y7DJ1kH7bornFFl93ssHpR8La/cJClaqPuFblcxnK7tTkgbAZn0qfef7Bzoce2p+NX5J
         ktv1imIgzXkYEPJ5jtZCiGk3TPOFrBbDY0EU4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689952146; x=1690556946;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=sjpbD0hG/VdEHDmZOuXkIsY3klgYFoxMw8k6FKHZP9U=;
        b=YigrHTp98P9Bq7vnDe/jABDvbKthCEJC1rPG/G5KeJuanuwTwpRe/k7MxcMB5xMv75
         WA9zDrxh0kuWZ9R6S0bGR7JQ+d4I45CA7FV/RdvzF+M2tEzMFZSli15lUsjvo9jHwLhD
         zrRC+FKUabrTEVydACcaltPnjjQB2pfTD3qCIF4gmsMuqKBwezIevVOzNlHggg/qPnoj
         6nthg+dD5uUPKCfdU+XFuYUmGT8ObAQBgNmtR2KTQjBh115b+Ch1zS/J9nIZu1edgyWs
         +ZXXsbbla9et22fQObI1KaRTRR+X3MFanEhT93gGXwO2ORQK5E24O8iSvrwmxBvf94qQ
         uqWw==
X-Gm-Message-State: ABy/qLYoxID3ekGhfBWa8S569n/MnhphSyXr0SEL4b/cZ705fK8asEZy
	p8uFBhiPDCpP3JN5DqN1giiA8g==
X-Google-Smtp-Source: APBJJlH1J3YPLMiCB/DBWu0AwIq4O9qygcgKGmPSsMVOD7Wg0SCWeorfMYih1h+1jYQWvaIen37t5A==
X-Received: by 2002:a17:906:8e:b0:99b:5689:1331 with SMTP id 14-20020a170906008e00b0099b56891331mr1863257ejc.59.1689952146037;
        Fri, 21 Jul 2023 08:09:06 -0700 (PDT)
Message-ID: <64ba9f91.170a0220.bad4d.8728@mx.google.com>
X-Google-Original-Message-ID: <ZLqfjirJEZKZZpJ4@EMEAENGAAD19049.>
Date: Fri, 21 Jul 2023 16:09:02 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Julien Grall <julien@xen.org>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH 2/8] arm/mm: Document the differences between arm32 and
 arm64 directmaps
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-3-alejandro.vallejo@cloud.com>
 <437849e6-08a3-8fac-a594-2003d5b94b41@xen.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <437849e6-08a3-8fac-a594-2003d5b94b41@xen.org>

Hi Julian,

On Thu, Jul 20, 2023 at 09:05:55PM +0100, Julien Grall wrote:
> Hi Alejandro,
> 
> On 17/07/2023 17:03, Alejandro Vallejo wrote:
> > arm32 merely covers the XENHEAP, whereas arm64 currently covers anything in
> > the frame table. These comments highlight why arm32 doesn't need to account for PDX
> > compression in its __va() implementation while arm64 does.
> > 
> > Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> > ---
> >   xen/arch/arm/include/asm/mm.h | 27 +++++++++++++++++++++++++++
> >   1 file changed, 27 insertions(+)
> > 
> > diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
> > index 4262165ce2..1a83f41879 100644
> > --- a/xen/arch/arm/include/asm/mm.h
> > +++ b/xen/arch/arm/include/asm/mm.h
> > @@ -280,6 +280,19 @@ static inline paddr_t __virt_to_maddr(vaddr_t va)
> >   #define virt_to_maddr(va)   __virt_to_maddr((vaddr_t)(va))
> >   #ifdef CONFIG_ARM_32
> > +/**
> > + * Find the virtual address corresponding to a machine address
> > + *
> > + * Only memory backing the XENHEAP has a corresponding virtual address to
> > + * be found. This is so we can save precious virtual space, as it's in
> > + * short supply on arm32. This mapping is not subject to PDX compression
> > + * because XENHEAP is known to be physically contiguous and can't hence
> > + * jump over the PDX hole. This means we can avoid the roundtrips
> > + * converting to/from pdx.
> > + *
> > + * @param ma Machine address
> > + * @return Virtual address mapped to `ma`
> > + */
> >   static inline void *maddr_to_virt(paddr_t ma)
> >   {
> >       ASSERT(is_xen_heap_mfn(maddr_to_mfn(ma)));
> > @@ -287,6 +300,20 @@ static inline void *maddr_to_virt(paddr_t ma)
> >       return (void *)(unsigned long) ma + XENHEAP_VIRT_START;
> >   }
> >   #else
> > +/**
> > + * Find the virtual address corresponding to a machine address
> > + *
> > + * The directmap covers all conventional memory accesible by the
> > + * hypervisor. This means it's subject to PDX compression.
> > + *
> > + * More specifically to arm64, the directmap mappings start at the first
> > + * GiB boundary containing valid RAM. This means there's an extra offset
> > + * applied (directmap_base_pdx) on top of the regular PDX compression
> > + * logic.
> 
> I find this paragraph a bit confusing to read because it leads to think that
> pdx_to_maddr(directmap_base_pdx) will return a GiB aligned address.
> 
> The base PDX corresponds to the start of the first region and the only
> requirement is it should be page-aligned. However, when mapping in the
> virtual address space we also offset the start to ensure that superpage can
> be used (this is where the GiB alignment is used).
> 
> That's why XENHEAP_VIRT_START points to directmap_virt_start rather than
> DIRECTMAP_VIRT_START. I think it would make sense to have the logic
> following what you suggest as it would remove a memory read. But I would
> understand if you don't want to take that extra work. :)
> 
> So for now, I would suggest to remove "GiB boundary containing".
> 
> Cheers,
> 
> -- 
> Julien Grall
Just to make sure it's the wording and not my understanding at fault
(definitely having DIRECTMAP_VIRT_START != directmap_virt_start doesn't do
any favours cognitive load).

/GiB boundary
|
|   /offset=address of 1st region of RAM % 1GiB
|   |
|---------|
V         V
--------------------------------------------------------------------------
| padding |                           directmap                | padding |
--------------------------------------------------------------------------
^         ^
|         |
|         \directmap_virt_start=pdx[directmap_base_pdx]
|
\DIRECTMAP_VIRT_START

In actual words, I considered DIRECTMAP_VIRT_START the beginning of the
directmap, not directmap_virt_start.

If this is it, you probably want to document somewhere what's what. In
particular, you want a big scary message in DIRECTMAP_VIRT_START stating
that it merely delimits the virtual range where the directmap can be, not
where the directmap is, with a "See directmap_virt_start for the address
where the directmap actually starts" message attached.

With that considered I'm happy to amend as you suggested on v2.

IMO, the ARM port should not keep that base pdx variable around, but
integrate it in the pdx logic, so the first valid address always
corresponds to pdx[0]. Then given a pdx it's immediate to find frame table
entries and directmap frames. It would also greatly simplify the definition
of a pdx.

Alejandro


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 15:19:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 15:19:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567599.886868 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMruj-00019S-Ks; Fri, 21 Jul 2023 15:19:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567599.886868; Fri, 21 Jul 2023 15:19:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMruj-00019L-I5; Fri, 21 Jul 2023 15:19:29 +0000
Received: by outflank-mailman (input) for mailman id 567599;
 Fri, 21 Jul 2023 15:19:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=PAjr=DH=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qMruh-00019F-O2
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 15:19:27 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id faa2f3fd-27d9-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 17:19:26 +0200 (CEST)
Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com
 [209.85.217.41])
 by support.bugseng.com (Postfix) with ESMTPSA id C0A274EE0C99
 for <xen-devel@lists.xenproject.org>; Fri, 21 Jul 2023 17:19:25 +0200 (CEST)
Received: by mail-vs1-f41.google.com with SMTP id
 ada2fe7eead31-4438f623370so867881137.3
 for <xen-devel@lists.xenproject.org>; Fri, 21 Jul 2023 08:19:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: faa2f3fd-27d9-11ee-b23a-6b7b168915f2
X-Gm-Message-State: ABy/qLZ47Rem7fpyg8C1QwPoo3ZaEA9juSeWyndMy/rPT0sn3WRLyhcn
	/EjnUIlEAK8NN0RRsdaEgEU2TpdVTZYVJyXmDWE=
X-Google-Smtp-Source: APBJJlHNbRxfAJD0rFsfvb+01SPA1D8fPFMeoIVLCnuVWHi2TKilY9DK1YZAvD7gS0BjW9IBYHcVLtCeac49IJth32A=
X-Received: by 2002:a67:bd04:0:b0:443:90ff:c691 with SMTP id
 y4-20020a67bd04000000b0044390ffc691mr307485vsq.13.1689952764503; Fri, 21 Jul
 2023 08:19:24 -0700 (PDT)
MIME-Version: 1.0
References: <eb5fa852f306790160b967787592553d2fdf3de6.1689887842.git.simone.ballarin@bugseng.com>
 <alpine.DEB.2.22.394.2307201507070.3118466@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2307201507070.3118466@ubuntu-linux-20-04-desktop>
From: Simone Ballarin <simone.ballarin@bugseng.com>
Date: Fri, 21 Jul 2023 17:19:13 +0200
X-Gmail-Original-Message-ID: <CAFHJcJs816ZreXXMK4ZOgxeiqowUJyXLUaBOaR9RE9FxTp+bGg@mail.gmail.com>
Message-ID: <CAFHJcJs816ZreXXMK4ZOgxeiqowUJyXLUaBOaR9RE9FxTp+bGg@mail.gmail.com>
Subject: Re: [XEN PATCH] automation: add ECLAIR pipeline
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
	Doug Goldstein <cardoe@cardoe.com>
Content-Type: multipart/alternative; boundary="000000000000372d54060100caa8"

--000000000000372d54060100caa8
Content-Type: text/plain; charset="UTF-8"

Il giorno ven 21 lug 2023 alle ore 00:29 Stefano Stabellini <
sstabellini@kernel.org> ha scritto:

>
> Patchew automatically picked it up from xen-devel and started a pipeline
> here:
>
> https://gitlab.com/xen-project/patchew/xen/-/pipelines/939440592
>
> However the eclair-x86_64 job failed with:
>
> ERROR: Uploading artifacts as "archive" to coordinator... 413 Payload
> Too Large
>

In the next patch, I will avoid uploading the ECLAIR database in GitLab
artifacts.
Of course, the databases can still be accessed via the links in the
pipeline logs.


>
> Also the eclair-ARM64 job failed but it is not clear to me why.
>

The reason is that the WTOKEN variable is missing. This masked variable
should be set
and visible to *all* repositories (xen-project/xen, xen-project/people/.*).


> I think at least initially we should mark the two Eclair jobs with:
>
>   allow_failure: true
>
> until we are sure they work reliably all the time. Otherwise we end up
> blocking the whole Xen staging pipeline if we make any mistakes here. We
> can remove "allow_failure: true" once we are sure it works well all the
> time.
>

Ok.

>
> The second thing I noticed is that the build phase didn't start until
> the analyze phase was concluded. This is not good because it would
> increase the overall time significantly. We need the build/test phases
> to start in parallel. To do that you need to add the following change to
> this patch:
>
>
> diff --git a/automation/gitlab-ci/build.yaml
> b/automation/gitlab-ci/build.yaml
> index c401f62d61..f01e2c32bb 100644
> --- a/automation/gitlab-ci/build.yaml
> +++ b/automation/gitlab-ci/build.yaml
> @@ -11,6 +11,7 @@
>        - '*.log'
>        - '*/*.log'
>      when: always
> +  needs: []
>    except:
>      - master
>      - smoke
>
> Thanks.

>
> > ---
> >  .gitlab-ci.yml                    |  2 ++
> >  automation/gitlab-ci/analyze.yaml | 38 +++++++++++++++++++++++++++++++
> >  automation/scripts/eclair         | 26 +++++++++++++++++++++
> >  3 files changed, 66 insertions(+)
> >  create mode 100644 automation/gitlab-ci/analyze.yaml
> >  create mode 100755 automation/scripts/eclair
> >
> > diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> > index c8bd7519d5..ee5430b8b7 100644
> > --- a/.gitlab-ci.yml
> > +++ b/.gitlab-ci.yml
> > @@ -1,7 +1,9 @@
> >  stages:
> > +  - analyze
> >    - build
> >    - test
> >
> >  include:
> > +  - 'automation/gitlab-ci/analyze.yaml'
> >    - 'automation/gitlab-ci/build.yaml'
> >    - 'automation/gitlab-ci/test.yaml'
> > diff --git a/automation/gitlab-ci/analyze.yaml
> b/automation/gitlab-ci/analyze.yaml
> > new file mode 100644
> > index 0000000000..be96d96e71
> > --- /dev/null
> > +++ b/automation/gitlab-ci/analyze.yaml
> > @@ -0,0 +1,38 @@
> > +.eclair-analysis:
> > +  stage: analyze
> > +  tags:
> > +    - eclair-analysis
> > +    - eclair
> > +    - misrac
>
> I would only use 1 tag, eclair-analysis or eclair, up to you
>
> Ok.


> > +  variables:
> > +    ECLAIR_OUTPUT_DIR: "ECLAIR_out"
> > +    ANALYSIS_KIND: "normal"
> > +    ECLAIR_REPORT_URL: "saas.eclairit.com"
> > +    ENABLE_ECLAIR_BOT: "n"
> > +    AUTOPRBRANCH: "staging"
> > +    AUTOPRREPOSITORY: "xen-project/xen"
> > +  artifacts:
> > +    when: always
> > +    paths:
> > +      - "${ECLAIR_OUTPUT_DIR}"
> > +      - '*.log'
> > +    reports:
> > +      codequality: gl-code-quality-report.json
> > +
> > +eclair-x86_64:
> > +  extends: .eclair-analysis
> > +  variables:
> > +    LOGFILE: "eclair-x86_64.log"
> > +    VARIANT: "X86_64"
> > +    RULESET: "Set1"
> > +  script:
> > +    - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
>
> allow_failure: true
>
>
> > +eclair-ARM64:
> > +  extends: .eclair-analysis
> > +  variables:
> > +    LOGFILE: "eclair-ARM64.log"
> > +    VARIANT: "ARM64"
> > +    RULESET: "Set1"
> > +  script:
> > +    - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
>
> allow_failure: true
>
>
> > diff --git a/automation/scripts/eclair b/automation/scripts/eclair
> > new file mode 100755
> > index 0000000000..d7f0845aec
> > --- /dev/null
> > +++ b/automation/scripts/eclair
> > @@ -0,0 +1,26 @@
> > +#!/bin/bash -eu
> > +
> > +# ECLAIR configuration files are maintened by BUGSENG
> > +export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no"
> > +[ -d ECLAIR_scripts ] || git clone ssh://
> git@git.bugseng.com/eclair/scripts/XEN ECLAIR_scripts
> > +(cd ECLAIR_scripts; git pull --rebase)
> > +
> > +ECLAIR_DIR=ECLAIR_scripts/ECLAIR
> > +ECLAIR_OUTPUT_DIR=$(realpath "${ECLAIR_OUTPUT_DIR}")
> > +
> > +ECLAIR_scripts/prepare.sh "${VARIANT}"
> > +
> > +ex=0
> > +"${ECLAIR_DIR}/analyze.sh" "${VARIANT}" "${RULESET}" || ex=$?
> > +"${ECLAIR_DIR}/action_log.sh" ANALYSIS_LOG \
> > +                             "ECLAIR analysis log" \
> > +                             "${ECLAIR_OUTPUT_DIR}/ANALYSIS.log" \
> > +                             "${ex}"
> > +"${ECLAIR_DIR}/action_log.sh" REPORT_LOG \
> > +                             "ECLAIR report log" \
> > +                             "${ECLAIR_OUTPUT_DIR}/REPORT.log" \
> > +                             "${ex}"
> > +[ "${ex}" = 0 ] || exit "${ex}"
> > +"${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
> > +
> > +rm -rf "${ECLAIR_OUTPUT_DIR}/.data"
> > --
> > 2.34.1
> >
>


-- 
Simone Ballarin, M.Sc.

Field Application Engineer, BUGSENG (https://bugseng.com
<http://bugseng.com>)

--000000000000372d54060100caa8
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">Il giorno ven 21 lug 2023 alle ore 00=
:29 Stefano Stabellini &lt;<a href=3D"mailto:sstabellini@kernel.org">sstabe=
llini@kernel.org</a>&gt; ha scritto:<br></div><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20=
4);padding-left:1ex">
<br>
Patchew automatically picked it up from xen-devel and started a pipeline<br=
>
here:<br>
<br>
<a href=3D"https://gitlab.com/xen-project/patchew/xen/-/pipelines/939440592=
" rel=3D"noreferrer" target=3D"_blank">https://gitlab.com/xen-project/patch=
ew/xen/-/pipelines/939440592</a><br>
<br>
However the eclair-x86_64 job failed with:<br>
<br>
ERROR: Uploading artifacts as &quot;archive&quot; to coordinator... 413 Pay=
load<br>
Too Large<br></blockquote><div><br></div><div><div class=3D"gmail_quote"><s=
pan class=3D"gmail-HwtZe" lang=3D"en"><span class=3D"gmail-jCAhz gmail-ChMk=
0b"><span class=3D"gmail-ryNqvb">In the next patch, I will avoid uploading =
the ECLAIR database</span></span><span class=3D"gmail-jCAhz"><span class=3D=
"gmail-ryNqvb">
</span></span><span class=3D"gmail-jCAhz gmail-ChMk0b"><span class=3D"gmail=
-ryNqvb">in GitLab artifacts.</span></span></span></div><div class=3D"gmail=
_quote"><span class=3D"gmail-HwtZe" lang=3D"en"><span class=3D"gmail-jCAhz =
gmail-ChMk0b"><span class=3D"gmail-ryNqvb">Of course, the databases can sti=
ll be accessed via the links in the pipeline logs.</span></span></span></di=
v>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px=
 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Also the eclair-ARM64 job failed but it is not clear to me why.<br></blockq=
uote><div><br></div><div>The reason is that the WTOKEN variable is missing.=
 This masked variable should be set</div><div>and visible to *all* reposito=
ries (xen-project/xen, xen-project/people/.*).</div><div><br></div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px=
 solid rgb(204,204,204);padding-left:1ex">
<br>
I think at least initially we should mark the two Eclair jobs with:<br>
<br>
=C2=A0 allow_failure: true<br>
<br>
until we are sure they work reliably all the time. Otherwise we end up<br>
blocking the whole Xen staging pipeline if we make any mistakes here. We<br=
>
can remove &quot;allow_failure: true&quot; once we are sure it works well a=
ll the<br>
time.<br></blockquote><div><br></div><div>Ok. <br></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex">
<br>
The second thing I noticed is that the build phase didn&#39;t start until<b=
r>
the analyze phase was concluded. This is not good because it would<br>
increase the overall time significantly. We need the build/test phases<br>
to start in parallel. To do that you need to add the following change to<br=
>
this patch:<br>
<br>
<br>
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.y=
aml<br>
index c401f62d61..f01e2c32bb 100644<br>
--- a/automation/gitlab-ci/build.yaml<br>
+++ b/automation/gitlab-ci/build.yaml<br>
@@ -11,6 +11,7 @@<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0- &#39;*.log&#39;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0- &#39;*/*.log&#39;<br>
=C2=A0 =C2=A0 =C2=A0when: always<br>
+=C2=A0 needs: []<br>
=C2=A0 =C2=A0except:<br>
=C2=A0 =C2=A0 =C2=A0- master<br>
=C2=A0 =C2=A0 =C2=A0- smoke<br>
<br></blockquote><div>Thanks. <br></div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad=
ding-left:1ex">
<br>
&gt; ---<br>
&gt;=C2=A0 .gitlab-ci.yml=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 |=C2=A0 2 ++<br>
&gt;=C2=A0 automation/gitlab-ci/analyze.yaml | 38 +++++++++++++++++++++++++=
++++++<br>
&gt;=C2=A0 automation/scripts/eclair=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 26 =
+++++++++++++++++++++<br>
&gt;=C2=A0 3 files changed, 66 insertions(+)<br>
&gt;=C2=A0 create mode 100644 automation/gitlab-ci/analyze.yaml<br>
&gt;=C2=A0 create mode 100755 automation/scripts/eclair<br>
&gt; <br>
&gt; diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml<br>
&gt; index c8bd7519d5..ee5430b8b7 100644<br>
&gt; --- a/.gitlab-ci.yml<br>
&gt; +++ b/.gitlab-ci.yml<br>
&gt; @@ -1,7 +1,9 @@<br>
&gt;=C2=A0 stages:<br>
&gt; +=C2=A0 - analyze<br>
&gt;=C2=A0 =C2=A0 - build<br>
&gt;=C2=A0 =C2=A0 - test<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 include:<br>
&gt; +=C2=A0 - &#39;automation/gitlab-ci/analyze.yaml&#39;<br>
&gt;=C2=A0 =C2=A0 - &#39;automation/gitlab-ci/build.yaml&#39;<br>
&gt;=C2=A0 =C2=A0 - &#39;automation/gitlab-ci/test.yaml&#39;<br>
&gt; diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/=
analyze.yaml<br>
&gt; new file mode 100644<br>
&gt; index 0000000000..be96d96e71<br>
&gt; --- /dev/null<br>
&gt; +++ b/automation/gitlab-ci/analyze.yaml<br>
&gt; @@ -0,0 +1,38 @@<br>
&gt; +.eclair-analysis:<br>
&gt; +=C2=A0 stage: analyze<br>
&gt; +=C2=A0 tags:<br>
&gt; +=C2=A0 =C2=A0 - eclair-analysis<br>
&gt; +=C2=A0 =C2=A0 - eclair<br>
&gt; +=C2=A0 =C2=A0 - misrac<br>
<br>
I would only use 1 tag, eclair-analysis or eclair, up to you<br>
<br></blockquote><div>Ok.</div><div>=C2=A0<br></div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,=
204,204);padding-left:1ex">
&gt; +=C2=A0 variables:<br>
&gt; +=C2=A0 =C2=A0 ECLAIR_OUTPUT_DIR: &quot;ECLAIR_out&quot;<br>
&gt; +=C2=A0 =C2=A0 ANALYSIS_KIND: &quot;normal&quot;<br>
&gt; +=C2=A0 =C2=A0 ECLAIR_REPORT_URL: &quot;<a href=3D"http://saas.eclairi=
t.com" rel=3D"noreferrer" target=3D"_blank">saas.eclairit.com</a>&quot;<br>
&gt; +=C2=A0 =C2=A0 ENABLE_ECLAIR_BOT: &quot;n&quot;<br>
&gt; +=C2=A0 =C2=A0 AUTOPRBRANCH: &quot;staging&quot;<br>
&gt; +=C2=A0 =C2=A0 AUTOPRREPOSITORY: &quot;xen-project/xen&quot;<br>
&gt; +=C2=A0 artifacts:<br>
&gt; +=C2=A0 =C2=A0 when: always<br>
&gt; +=C2=A0 =C2=A0 paths:<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 - &quot;${ECLAIR_OUTPUT_DIR}&quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 - &#39;*.log&#39;<br>
&gt; +=C2=A0 =C2=A0 reports:<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 codequality: gl-code-quality-report.json<br>
&gt; +<br>
&gt; +eclair-x86_64:<br>
&gt; +=C2=A0 extends: .eclair-analysis<br>
&gt; +=C2=A0 variables:<br>
&gt; +=C2=A0 =C2=A0 LOGFILE: &quot;eclair-x86_64.log&quot;<br>
&gt; +=C2=A0 =C2=A0 VARIANT: &quot;X86_64&quot;<br>
&gt; +=C2=A0 =C2=A0 RULESET: &quot;Set1&quot;<br>
&gt; +=C2=A0 script:<br>
&gt; +=C2=A0 =C2=A0 - ./automation/scripts/eclair 2&gt;&amp;1 | tee &quot;$=
{LOGFILE}&quot;<br>
<br>
allow_failure: true<br>
<br>
<br>
&gt; +eclair-ARM64:<br>
&gt; +=C2=A0 extends: .eclair-analysis<br>
&gt; +=C2=A0 variables:<br>
&gt; +=C2=A0 =C2=A0 LOGFILE: &quot;eclair-ARM64.log&quot;<br>
&gt; +=C2=A0 =C2=A0 VARIANT: &quot;ARM64&quot;<br>
&gt; +=C2=A0 =C2=A0 RULESET: &quot;Set1&quot;<br>
&gt; +=C2=A0 script:<br>
&gt; +=C2=A0 =C2=A0 - ./automation/scripts/eclair 2&gt;&amp;1 | tee &quot;$=
{LOGFILE}&quot;<br>
<br>
allow_failure: true<br>
<br>
<br>
&gt; diff --git a/automation/scripts/eclair b/automation/scripts/eclair<br>
&gt; new file mode 100755<br>
&gt; index 0000000000..d7f0845aec<br>
&gt; --- /dev/null<br>
&gt; +++ b/automation/scripts/eclair<br>
&gt; @@ -0,0 +1,26 @@<br>
&gt; +#!/bin/bash -eu<br>
&gt; +<br>
&gt; +# ECLAIR configuration files are maintened by BUGSENG<br>
&gt; +export GIT_SSH_COMMAND=3D&quot;ssh -o StrictHostKeyChecking=3Dno&quot=
;<br>
&gt; +[ -d ECLAIR_scripts ] || git clone ssh://<a href=3D"http://git@git.bu=
gseng.com/eclair/scripts/XEN" rel=3D"noreferrer" target=3D"_blank">git@git.=
bugseng.com/eclair/scripts/XEN</a> ECLAIR_scripts<br>
&gt; +(cd ECLAIR_scripts; git pull --rebase)<br>
&gt; +<br>
&gt; +ECLAIR_DIR=3DECLAIR_scripts/ECLAIR<br>
&gt; +ECLAIR_OUTPUT_DIR=3D$(realpath &quot;${ECLAIR_OUTPUT_DIR}&quot;)<br>
&gt; +<br>
&gt; +ECLAIR_scripts/prepare.sh &quot;${VARIANT}&quot;<br>
&gt; +<br>
&gt; +ex=3D0<br>
&gt; +&quot;${ECLAIR_DIR}/analyze.sh&quot; &quot;${VARIANT}&quot; &quot;${R=
ULESET}&quot; || ex=3D$?<br>
&gt; +&quot;${ECLAIR_DIR}/action_log.sh&quot; ANALYSIS_LOG \<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;ECLAIR analysis log&quot; \<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;${ECLAIR_OUTPUT_DIR}/ANALYSIS.log&=
quot; \<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;${ex}&quot;<br>
&gt; +&quot;${ECLAIR_DIR}/action_log.sh&quot; REPORT_LOG \<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;ECLAIR report log&quot; \<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;${ECLAIR_OUTPUT_DIR}/REPORT.log&qu=
ot; \<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;${ex}&quot;<br>
&gt; +[ &quot;${ex}&quot; =3D 0 ] || exit &quot;${ex}&quot;<br>
&gt; +&quot;${ECLAIR_DIR}/action_push.sh&quot; &quot;${WTOKEN}&quot; &quot;=
${ECLAIR_OUTPUT_DIR}&quot;<br>
&gt; +<br>
&gt; +rm -rf &quot;${ECLAIR_OUTPUT_DIR}/.data&quot;<br>
&gt; -- <br>
&gt; 2.34.1<br>
&gt; <br>
</blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre=
fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"l=
tr">Simone Ballarin, M.Sc.<br><br><div>Field Application Engineer, BUGSENG =
(<a href=3D"http://bugseng.com" target=3D"_blank">https://bugseng.com</a>)<=
/div></div></div></div>

--000000000000372d54060100caa8--


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 15:23:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 15:23:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567605.886878 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMry5-0002YJ-3m; Fri, 21 Jul 2023 15:22:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567605.886878; Fri, 21 Jul 2023 15:22:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMry5-0002YC-0J; Fri, 21 Jul 2023 15:22:57 +0000
Received: by outflank-mailman (input) for mailman id 567605;
 Fri, 21 Jul 2023 15:22:56 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=OIrH=DH=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qMry4-0002Y6-Bp
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 15:22:56 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 76ffece1-27da-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 17:22:55 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.162.18.33])
 by support.bugseng.com (Postfix) with ESMTPSA id 01B564EE0C89;
 Fri, 21 Jul 2023 17:22:52 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 76ffece1-27da-11ee-b23a-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [XEN PATCH] xen/arm: mechanical renaming to address MISRA C:2012 Rule 5.3
Date: Fri, 21 Jul 2023 17:22:40 +0200
Message-Id: <164303a2b19336a0e5f934a995d2a9c104035fab.1689952914.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rule 5.3 has the following headline:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope"

The function parameters renamed in this patch are hiding a variable defined
in an enclosing scope or a function identifier.

The following renames have been made:
- s/guest_mode/guest_mode_on/ to distinguish from function 'guest_mode'
- s/struct module_name/struct module_info to distinguish from the homonymous
parameters, since the structure contains more information than just the name.
- s/file_name/file_info in 'xen/arch/arm/efi/efi-boot.h' for consistency with
the previous renaming.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/arm/efi/efi-boot.h | 22 +++++++++++-----------
 xen/arch/arm/traps.c        | 28 ++++++++++++++--------------
 2 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index 3daa63a40d..6126a71400 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -13,7 +13,7 @@ typedef struct {
     unsigned int name_len;
     EFI_PHYSICAL_ADDRESS addr;
     UINTN size;
-} module_name;
+} module_info;
 
 /*
  * Binaries will be translated into bootmodules, the maximum number for them is
@@ -21,7 +21,7 @@ typedef struct {
  */
 #define MAX_UEFI_MODULES (MAX_MODULES - 2)
 static struct file __initdata module_binary;
-static module_name __initdata modules[MAX_UEFI_MODULES];
+static module_info __initdata modules[MAX_UEFI_MODULES];
 static unsigned int __initdata modules_available = MAX_UEFI_MODULES;
 static unsigned int __initdata modules_idx;
 
@@ -622,7 +622,7 @@ static int __init get_module_file_index(const char *name,
 
     for ( i = 0; i < modules_idx; i++ )
     {
-        module_name *mod = &modules[i];
+        module_info *mod = &modules[i];
         if ( (mod->name_len == name_len) &&
              (strncmp(mod->name, name, name_len) == 0) )
         {
@@ -648,7 +648,7 @@ static int __init allocate_module_file(const EFI_LOADED_IMAGE *loaded_image,
                                        const char *name,
                                        unsigned int name_len)
 {
-    module_name *file_name;
+    module_info *file_info;
     CHAR16 *fname;
     union string module_name;
     int ret;
@@ -668,18 +668,18 @@ static int __init allocate_module_file(const EFI_LOADED_IMAGE *loaded_image,
     ret = modules_idx;
 
     /* Save at this index the name of this binary */
-    file_name = &modules[ret];
+    file_info = &modules[ret];
 
     if ( efi_bs->AllocatePool(EfiLoaderData, (name_len + 1) * sizeof(char),
-                              (void**)&file_name->name) != EFI_SUCCESS )
+                              (void**)&file_info->name) != EFI_SUCCESS )
     {
         PrintMessage(L"Error allocating memory for module binary name");
         return ERROR_ALLOC_MODULE_NAME;
     }
 
     /* Save name and length of the binary in the data structure */
-    strlcpy(file_name->name, name, name_len + 1);
-    file_name->name_len = name_len;
+    strlcpy(file_info->name, name, name_len + 1);
+    file_info->name_len = name_len;
 
     /* Get the file system interface. */
     if ( !*dir_handle )
@@ -689,8 +689,8 @@ static int __init allocate_module_file(const EFI_LOADED_IMAGE *loaded_image,
     read_file(*dir_handle, s2w(&module_name), &module_binary, NULL);
 
     /* Save address and size */
-    file_name->addr = module_binary.addr;
-    file_name->size = module_binary.size;
+    file_info->addr = module_binary.addr;
+    file_info->size = module_binary.size;
 
     /* s2w(...) allocates some memory, free it */
     efi_bs->FreePool(module_name.w);
@@ -716,7 +716,7 @@ static int __init handle_module_node(const EFI_LOADED_IMAGE *loaded_image,
     const void *uefi_name_prop;
     char mod_string[24]; /* Placeholder for module@ + a 64-bit number + \0 */
     int uefi_name_len, file_idx, module_compat;
-    module_name *file;
+    module_info *file;
 
     /* Check if the node is a multiboot,module otherwise return */
     module_compat = fdt_node_check_compatible(fdt, module_node_offset,
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index d1ef787638..05860f063c 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -745,7 +745,7 @@ static const char *mode_string(register_t cpsr)
 
 static void show_registers_32(const struct cpu_user_regs *regs,
                               const struct reg_ctxt *ctxt,
-                              bool guest_mode,
+                              bool guest_mode_on,
                               const struct vcpu *v)
 {
 
@@ -754,7 +754,7 @@ static void show_registers_32(const struct cpu_user_regs *regs,
     printk("PC:     %08"PRIx32"\n", regs->pc32);
 #else
     printk("PC:     %08"PRIx32, regs->pc);
-    if ( !guest_mode )
+    if ( !guest_mode_on )
         printk(" %pS", _p(regs->pc));
     printk("\n");
 #endif
@@ -773,7 +773,7 @@ static void show_registers_32(const struct cpu_user_regs *regs,
 #endif
            regs->r12);
 
-    if ( guest_mode )
+    if ( guest_mode_on )
     {
         printk("USR: SP: %08"PRIx32" LR: %"PRIregister"\n",
                regs->sp_usr, regs->lr);
@@ -798,7 +798,7 @@ static void show_registers_32(const struct cpu_user_regs *regs,
 #endif
     printk("\n");
 
-    if ( guest_mode )
+    if ( guest_mode_on )
     {
         printk("     SCTLR: %"PRIregister"\n", ctxt->sctlr_el1);
         printk("       TCR: %"PRIregister"\n", ctxt->tcr_el1);
@@ -822,18 +822,18 @@ static void show_registers_32(const struct cpu_user_regs *regs,
 #ifdef CONFIG_ARM_64
 static void show_registers_64(const struct cpu_user_regs *regs,
                               const struct reg_ctxt *ctxt,
-                              bool guest_mode,
+                              bool guest_mode_on,
                               const struct vcpu *v)
 {
 
     BUG_ON( (regs->cpsr & PSR_MODE_BIT) );
 
     printk("PC:     %016"PRIx64, regs->pc);
-    if ( !guest_mode )
+    if ( !guest_mode_on )
         printk(" %pS", _p(regs->pc));
     printk("\n");
     printk("LR:     %016"PRIx64"\n", regs->lr);
-    if ( guest_mode )
+    if ( guest_mode_on )
     {
         printk("SP_EL0: %016"PRIx64"\n", regs->sp_el0);
         printk("SP_EL1: %016"PRIx64"\n", regs->sp_el1);
@@ -866,7 +866,7 @@ static void show_registers_64(const struct cpu_user_regs *regs,
            regs->x27, regs->x28, regs->fp);
     printk("\n");
 
-    if ( guest_mode )
+    if ( guest_mode_on )
     {
         printk("   ELR_EL1: %016"PRIx64"\n", regs->elr_el1);
         printk("   ESR_EL1: %08"PRIx32"\n", ctxt->esr_el1);
@@ -883,28 +883,28 @@ static void show_registers_64(const struct cpu_user_regs *regs,
 
 static void _show_registers(const struct cpu_user_regs *regs,
                             const struct reg_ctxt *ctxt,
-                            bool guest_mode,
+                            bool guest_mode_on,
                             const struct vcpu *v)
 {
     print_xen_info();
 
     printk("CPU:    %d\n", smp_processor_id());
 
-    if ( guest_mode )
+    if ( guest_mode_on )
     {
         if ( regs_mode_is_32bit(regs) )
-            show_registers_32(regs, ctxt, guest_mode, v);
+            show_registers_32(regs, ctxt, guest_mode_on, v);
 #ifdef CONFIG_ARM_64
         else
-            show_registers_64(regs, ctxt, guest_mode, v);
+            show_registers_64(regs, ctxt, guest_mode_on, v);
 #endif
     }
     else
     {
 #ifdef CONFIG_ARM_64
-        show_registers_64(regs, ctxt, guest_mode, v);
+        show_registers_64(regs, ctxt, guest_mode_on, v);
 #else
-        show_registers_32(regs, ctxt, guest_mode, v);
+        show_registers_32(regs, ctxt, guest_mode_on, v);
 #endif
     }
     printk("  VTCR_EL2: %"PRIregister"\n", READ_SYSREG(VTCR_EL2));
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 15:26:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 15:26:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567612.886888 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMs1a-0003E4-MV; Fri, 21 Jul 2023 15:26:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567612.886888; Fri, 21 Jul 2023 15:26:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMs1a-0003Dx-Ix; Fri, 21 Jul 2023 15:26:34 +0000
Received: by outflank-mailman (input) for mailman id 567612;
 Fri, 21 Jul 2023 15:26:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=OIrH=DH=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qMs1Z-0003Dp-TQ
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 15:26:33 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f8619b04-27da-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 17:26:32 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.162.18.33])
 by support.bugseng.com (Postfix) with ESMTPSA id 7711E4EE0C89;
 Fri, 21 Jul 2023 17:26:30 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f8619b04-27da-11ee-b23a-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [XEN PATCH] efi: mechanical renaming to address MISRA C:2012 Rule 5.3
Date: Fri, 21 Jul 2023 17:26:11 +0200
Message-Id: <4da442b03ba783b4db0e56614bed43ce882a32ae.1689953085.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rule 5.3 has the following headline:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope"

The function parameters renamed in this patch are hiding a variable defined
in an enclosing scope or a function identifier.

The following rename is made:
- s/cfg/config/
to distinguish from the variable 'cfg', which is hidden by the parameter inside
the modified functions.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/common/efi/boot.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 24169b7b50..233639f3bc 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -528,10 +528,10 @@ static char * __init split_string(char *s)
     return NULL;
 }
 
-static char *__init get_value(const struct file *cfg, const char *section,
+static char *__init get_value(const struct file *config, const char *section,
                               const char *item)
 {
-    char *ptr = cfg->str, *end = ptr + cfg->size;
+    char *ptr = config->str, *end = ptr + config->size;
     size_t slen = section ? strlen(section) : 0, ilen = strlen(item);
     bool match = !slen;
 
@@ -821,9 +821,9 @@ static bool __init read_section(const EFI_LOADED_IMAGE *image,
     return true;
 }
 
-static void __init pre_parse(const struct file *cfg)
+static void __init pre_parse(const struct file *config)
 {
-    char *ptr = cfg->str, *end = ptr + cfg->size;
+    char *ptr = config->str, *end = ptr + config->size;
     bool start = true, comment = false;
 
     for ( ; ptr < end; ++ptr )
@@ -844,7 +844,7 @@ static void __init pre_parse(const struct file *cfg)
         else
             start = 0;
     }
-    if ( cfg->size && end[-1] )
+    if ( config->size && end[-1] )
          PrintStr(L"No newline at end of config file,"
                    " last line will be ignored.\r\n");
 }
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 15:29:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 15:29:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567618.886898 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMs4A-0003ny-2h; Fri, 21 Jul 2023 15:29:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567618.886898; Fri, 21 Jul 2023 15:29:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMs49-0003nr-Vs; Fri, 21 Jul 2023 15:29:13 +0000
Received: by outflank-mailman (input) for mailman id 567618;
 Fri, 21 Jul 2023 15:29:13 +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
 <SRS0=OIrH=DH=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qMs49-0003nl-6G
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 15:29:13 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 573f3b66-27db-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 17:29:11 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.162.18.33])
 by support.bugseng.com (Postfix) with ESMTPSA id 1894E4EE0C89;
 Fri, 21 Jul 2023 17:29:09 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 573f3b66-27db-11ee-8611-37d641c3527e
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH] xen/spinlock: mechanically rename parameter name 'debug'
Date: Fri, 21 Jul 2023 17:29:02 +0200
Message-Id: <78255b6c5caaaa02dad638c7d4102ea793a09b88.1689953306.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rule 5.3 has the following headline:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope"

To avoid any confusion resulting from the parameter 'debug'
hiding the homonymous function declared at
'xen/arch/x86/include/asm/processor.h:428'
the rename of parameters s/debug/dbg is performed.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
x86 maintainers CC'ed because the violation is caused by a declaration
in an x86 file, but I reckon it would harm understandability if
a function was renamed to 'dbg'
---
 xen/common/spinlock.c      | 38 +++++++++++++++++++-------------------
 xen/include/xen/spinlock.h |  6 +++---
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index 7f453234a9..d8d2e6ad1a 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -78,7 +78,7 @@ static int __init cf_check lockdebug_init(void)
 }
 presmp_initcall(lockdebug_init);
 
-void check_lock(union lock_debug *debug, bool try)
+void check_lock(union lock_debug *dbg, bool try)
 {
     bool irq_safe = !local_irq_is_enabled();
     unsigned int cpu = smp_processor_id();
@@ -118,12 +118,12 @@ void check_lock(union lock_debug *debug, bool try)
     if ( try && irq_safe )
         return;
 
-    if ( unlikely(debug->irq_safe != irq_safe) )
+    if ( unlikely(dbg->irq_safe != irq_safe) )
     {
         union lock_debug seen, new = { 0 };
 
         new.irq_safe = irq_safe;
-        seen.val = cmpxchg(&debug->val, LOCK_DEBUG_INITVAL, new.val);
+        seen.val = cmpxchg(&dbg->val, LOCK_DEBUG_INITVAL, new.val);
 
         if ( !seen.unseen && seen.irq_safe == !irq_safe )
         {
@@ -137,14 +137,14 @@ void check_lock(union lock_debug *debug, bool try)
         return;
 
     for ( i = 0; i < nr_taken; i++ )
-        if ( taken[i] == debug )
+        if ( taken[i] == dbg )
         {
-            printk("CHECKLOCK FAILURE: lock at %p taken recursively\n", debug);
+            printk("CHECKLOCK FAILURE: lock at %p taken recursively\n", dbg);
             BUG();
         }
 }
 
-static void check_barrier(union lock_debug *debug)
+static void check_barrier(union lock_debug *dbg)
 {
     if ( unlikely(atomic_read(&spin_debug) <= 0) )
         return;
@@ -160,10 +160,10 @@ static void check_barrier(union lock_debug *debug)
      * However, if we spin on an IRQ-unsafe lock with IRQs disabled then that
      * is clearly wrong, for the same reason outlined in check_lock() above.
      */
-    BUG_ON(!local_irq_is_enabled() && !debug->irq_safe);
+    BUG_ON(!local_irq_is_enabled() && !dbg->irq_safe);
 }
 
-void lock_enter(const union lock_debug *debug)
+void lock_enter(const union lock_debug *dbg)
 {
     unsigned int cpu = smp_processor_id();
     const union lock_debug **taken = per_cpu(locks_taken, cpu);
@@ -176,7 +176,7 @@ void lock_enter(const union lock_debug *debug)
     local_irq_save(flags);
 
     if ( *nr_taken < lock_depth_size )
-        taken[(*nr_taken)++] = debug;
+        taken[(*nr_taken)++] = dbg;
     else if ( !max_depth_reached )
     {
         max_depth_reached = true;
@@ -187,7 +187,7 @@ void lock_enter(const union lock_debug *debug)
     local_irq_restore(flags);
 }
 
-void lock_exit(const union lock_debug *debug)
+void lock_exit(const union lock_debug *dbg)
 {
     unsigned int cpu = smp_processor_id();
     const union lock_debug **taken = per_cpu(locks_taken, cpu);
@@ -202,7 +202,7 @@ void lock_exit(const union lock_debug *debug)
 
     for ( i = *nr_taken; i > 0; i-- )
     {
-        if ( taken[i - 1] == debug )
+        if ( taken[i - 1] == dbg )
         {
             memmove(taken + i - 1, taken + i,
                     (*nr_taken - i) * sizeof(*taken));
@@ -217,28 +217,28 @@ void lock_exit(const union lock_debug *debug)
 
     if ( !max_depth_reached )
     {
-        printk("CHECKLOCK released lock at %p not recorded!\n", debug);
+        printk("CHECKLOCK released lock at %p not recorded!\n", dbg);
         WARN();
     }
 
     local_irq_restore(flags);
 }
 
-static void got_lock(union lock_debug *debug)
+static void got_lock(union lock_debug *dbg)
 {
-    debug->cpu = smp_processor_id();
+    dbg->cpu = smp_processor_id();
 
-    lock_enter(debug);
+    lock_enter(dbg);
 }
 
-static void rel_lock(union lock_debug *debug)
+static void rel_lock(union lock_debug *dbg)
 {
     if ( atomic_read(&spin_debug) > 0 )
-        BUG_ON(debug->cpu != smp_processor_id());
+        BUG_ON(dbg->cpu != smp_processor_id());
 
-    lock_exit(debug);
+    lock_exit(dbg);
 
-    debug->cpu = SPINLOCK_NO_CPU;
+    dbg->cpu = SPINLOCK_NO_CPU;
 }
 
 void spin_debug_enable(void)
diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index 0a02a527dc..d303c56f8a 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -22,9 +22,9 @@ union lock_debug {
     };
 };
 #define _LOCK_DEBUG { LOCK_DEBUG_INITVAL }
-void check_lock(union lock_debug *debug, bool try);
-void lock_enter(const union lock_debug *debug);
-void lock_exit(const union lock_debug *debug);
+void check_lock(union lock_debug *dbg, bool try);
+void lock_enter(const union lock_debug *dbg);
+void lock_exit(const union lock_debug *dbg);
 void spin_debug_enable(void);
 void spin_debug_disable(void);
 #else
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 15:32:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 15:32:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567624.886907 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMs6h-0005Dj-FS; Fri, 21 Jul 2023 15:31:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567624.886907; Fri, 21 Jul 2023 15:31:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMs6h-0005Dc-Ck; Fri, 21 Jul 2023 15:31:51 +0000
Received: by outflank-mailman (input) for mailman id 567624;
 Fri, 21 Jul 2023 15:31:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=OIrH=DH=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qMs6f-0005DW-Tc
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 15:31:49 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b552cbbb-27db-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 17:31:49 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.162.18.33])
 by support.bugseng.com (Postfix) with ESMTPSA id C77BA4EE0C89;
 Fri, 21 Jul 2023 17:31:46 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b552cbbb-27db-11ee-b23a-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH] xen/sched: mechanical renaming to address MISRA C:2012 Rule 5.3
Date: Fri, 21 Jul 2023 17:31:36 +0200
Message-Id: <9945fd23b0bb88f3e0c6054a7f992cfa642d3f9f.1689953420.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rule 5.3 has the following headline:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope"

The renaming s/sched_id/scheduler_id of the function defined in
'xen/common/sched/core.c' prevents any hiding of that function
by the many instances of omonymous function parameters.

Similarly, the renames
- s/ops/operations
- s/do_softirq/exec_softirq
- s/loop/it
are introduced for parameter names, to avoid any conflict
with the homonymous variable or function defined in an enclosing
scope.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/common/sched/core.c    | 18 +++++++++---------
 xen/common/sched/credit2.c |  4 ++--
 xen/common/sysctl.c        |  2 +-
 xen/include/xen/sched.h    |  2 +-
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 022f548652..e74b1208bd 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -99,13 +99,13 @@ static void sched_set_affinity(
     struct sched_unit *unit, const cpumask_t *hard, const cpumask_t *soft);
 
 static struct sched_resource *cf_check
-sched_idle_res_pick(const struct scheduler *ops, const struct sched_unit *unit)
+sched_idle_res_pick(const struct scheduler *operations, const struct sched_unit *unit)
 {
     return unit->res;
 }
 
 static void *cf_check
-sched_idle_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
+sched_idle_alloc_udata(const struct scheduler *operations, struct sched_unit *unit,
                        void *dd)
 {
     /* Any non-NULL pointer is fine here. */
@@ -113,12 +113,12 @@ sched_idle_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
 }
 
 static void cf_check
-sched_idle_free_udata(const struct scheduler *ops, void *priv)
+sched_idle_free_udata(const struct scheduler *operations, void *priv)
 {
 }
 
 static void cf_check sched_idle_schedule(
-    const struct scheduler *ops, struct sched_unit *unit, s_time_t now,
+    const struct scheduler *operations, struct sched_unit *unit, s_time_t now,
     bool tasklet_work_scheduled)
 {
     const unsigned int cpu = smp_processor_id();
@@ -2040,8 +2040,8 @@ long do_set_timer_op(s_time_t timeout)
     return 0;
 }
 
-/* sched_id - fetch ID of current scheduler */
-int sched_id(void)
+/* scheduler_id - fetch ID of current scheduler */
+int scheduler_id(void)
 {
     return ops.sched_id;
 }
@@ -2579,7 +2579,7 @@ static void cf_check sched_slave(void)
     struct sched_unit    *prev = vprev->sched_unit, *next;
     s_time_t              now;
     spinlock_t           *lock;
-    bool                  do_softirq = false;
+    bool                  exec_softirq = false;
     unsigned int          cpu = smp_processor_id();
 
     ASSERT_NOT_IN_ATOMIC();
@@ -2604,7 +2604,7 @@ static void cf_check sched_slave(void)
             return;
         }
 
-        do_softirq = true;
+        exec_softirq = true;
     }
 
     if ( !prev->rendezvous_in_cnt )
@@ -2614,7 +2614,7 @@ static void cf_check sched_slave(void)
         rcu_read_unlock(&sched_res_rculock);
 
         /* Check for failed forced context switch. */
-        if ( do_softirq )
+        if ( exec_softirq )
             raise_softirq(SCHEDULE_SOFTIRQ);
 
         return;
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 87a1e31ee9..aba51a7963 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -3884,7 +3884,7 @@ csched2_dump(const struct scheduler *ops)
     list_for_each_entry ( rqd, &prv->rql, rql )
     {
         struct list_head *iter, *runq = &rqd->runq;
-        int loop = 0;
+        int it = 0;
 
         /* We need the lock to scan the runqueue. */
         spin_lock(&rqd->lock);
@@ -3901,7 +3901,7 @@ csched2_dump(const struct scheduler *ops)
 
             if ( svc )
             {
-                printk("\t%3d: ", loop++);
+                printk("\t%3d: ", it++);
                 csched2_dump_unit(prv, svc);
             }
         }
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 0cbfe8bd44..7cabfb0230 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -71,7 +71,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         break;
 
     case XEN_SYSCTL_sched_id:
-        op->u.sched_id.sched_id = sched_id();
+        op->u.sched_id.sched_id = scheduler_id();
         break;
 
     case XEN_SYSCTL_getdomaininfolist:
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 854f3e32c0..bfe714d2e2 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -791,7 +791,7 @@ int  sched_init_domain(struct domain *d, unsigned int poolid);
 void sched_destroy_domain(struct domain *d);
 long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *);
 long sched_adjust_global(struct xen_sysctl_scheduler_op *);
-int  sched_id(void);
+int  scheduler_id(void);
 
 /*
  * sched_get_id_by_name - retrieves a scheduler id given a scheduler name
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 15:38:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 15:38:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567631.886917 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMsCx-0005sK-3m; Fri, 21 Jul 2023 15:38:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567631.886917; Fri, 21 Jul 2023 15:38:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMsCx-0005sD-1J; Fri, 21 Jul 2023 15:38:19 +0000
Received: by outflank-mailman (input) for mailman id 567631;
 Fri, 21 Jul 2023 15:38:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=R0zQ=DH=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qMsCv-0005rl-A3
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 15:38:17 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9c6ea7ae-27dc-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 17:38:16 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.160.253.240])
 by support.bugseng.com (Postfix) with ESMTPSA id 63C824EE0C89;
 Fri, 21 Jul 2023 17:38:15 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9c6ea7ae-27dc-11ee-b23a-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [XEN PATCH] atomic: change parameter name in atomic_cmpxchg() definition
Date: Fri, 21 Jul 2023 17:37:54 +0200
Message-Id: <cace061a0b574d56f9b12a43a7c82276ef56654f.1689953642.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Change parameter name from 'ptr' to 'v' in the function definition thus
addressing violations of MISRA C:2012 Rule 8.3: "All declarations of an
object or function shall use the same names and type qualifiers".

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/arch/arm/include/asm/arm64/atomic.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/include/asm/arm64/atomic.h b/xen/arch/arm/include/asm/arm64/atomic.h
index 2d42567866..4460165295 100644
--- a/xen/arch/arm/include/asm/arm64/atomic.h
+++ b/xen/arch/arm/include/asm/arm64/atomic.h
@@ -105,7 +105,7 @@ static inline void atomic_and(int m, atomic_t *v)
 	: "Ir" (m));
 }
 
-static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
+static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
 {
 	unsigned long tmp;
 	int oldval;
@@ -119,7 +119,7 @@ static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
 "	stxr	%w0, %w4, %2\n"
 "	cbnz	%w0, 1b\n"
 "2:"
-	: "=&r" (tmp), "=&r" (oldval), "+Q" (ptr->counter)
+	: "=&r" (tmp), "=&r" (oldval), "+Q" (v->counter)
 	: "Ir" (old), "r" (new)
 	: "cc");
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 15:44:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 15:44:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567637.886927 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMsJ2-0007LZ-Oq; Fri, 21 Jul 2023 15:44:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567637.886927; Fri, 21 Jul 2023 15:44:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMsJ2-0007LS-M0; Fri, 21 Jul 2023 15:44:36 +0000
Received: by outflank-mailman (input) for mailman id 567637;
 Fri, 21 Jul 2023 15:44:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMsJ2-0007LM-Az
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 15:44:36 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMsJ1-0000to-IG; Fri, 21 Jul 2023 15:44:35 +0000
Received: from 54-240-197-239.amazon.com ([54.240.197.239]
 helo=[192.168.21.208]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMsJ1-0006Iq-Bt; Fri, 21 Jul 2023 15:44:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=3K0ntquEJPgGRY3chu4E0HtaMr0S7IXxsYtQmgCoiBg=; b=urh2IOIY9gRB3mIMjLvqC9EmiJ
	QVNc9CFakWrTjACbWKN0KDFw43zuOxyI1F+xW0tNgdjR9Obps73LFfB0lHcKtRrKZ37M7N/xQTlJA
	1wLSqPa04f9ArPGIT3VaczUAOPTS5qIu8zvGsUqxPkJ+EYPdGjqTNvgFz8XgKZLFBYq4=;
Message-ID: <fa0c651f-2e02-e058-a3e5-efdaced81456@xen.org>
Date: Fri, 21 Jul 2023 16:44:33 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] atomic: change parameter name in atomic_cmpxchg()
 definition
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cace061a0b574d56f9b12a43a7c82276ef56654f.1689953642.git.federico.serafini@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <cace061a0b574d56f9b12a43a7c82276ef56654f.1689953642.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

Title:

Please add "xen/arm: " to clarify this is a patch touching the Arm code.

On 21/07/2023 16:37, Federico Serafini wrote:
> Change parameter name from 'ptr' to 'v' in the function definition thus
> addressing violations of MISRA C:2012 Rule 8.3: "All declarations of an
> object or function shall use the same names and type qualifiers".

The parameters are consistent between arm32 and arm64. Naming wise, any 
reason you picked the x86 name? Personally, I have a slight preference 
to keep 'ptr' because this is more obvious than 'v'.

But I will not strongly argue against it. That said, if you are looking 
for consistency, you should also modify arm32.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 15:54:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 15:54:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567641.886937 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMsSh-0000Qd-Ml; Fri, 21 Jul 2023 15:54:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567641.886937; Fri, 21 Jul 2023 15:54:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMsSh-0000QW-K0; Fri, 21 Jul 2023 15:54:35 +0000
Received: by outflank-mailman (input) for mailman id 567641;
 Fri, 21 Jul 2023 15:54:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMsSg-0000QQ-V1
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 15:54:35 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMsSg-0001FY-BO; Fri, 21 Jul 2023 15:54:34 +0000
Received: from 54-240-197-239.amazon.com ([54.240.197.239]
 helo=[192.168.21.208]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMsSg-0006Y5-20; Fri, 21 Jul 2023 15:54:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=rUoOoweRa5HydyDUpA0mv1S5V7GjblEr08agVZ9dhx0=; b=ll8a6O9hprqgEBNDwSDXcTqy1M
	1xLDNYPx5H128mTunNzuvJcQsV6BifMSozQwCcKGpSTN+IPojqCZU2DCEU+JFIawb91hHhIghHXvk
	kVIM0nLdza0+ivW9gufmOBzfRYQLBMa1fJPHDvD/trGm9qUkcWqFTrIMatl7P9hs/LbY=;
Message-ID: <ae4beda6-bb2d-b494-bc06-ce6475bf3624@xen.org>
Date: Fri, 21 Jul 2023 16:54:31 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] xen/arm: mechanical renaming to address MISRA C:2012
 Rule 5.3
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <164303a2b19336a0e5f934a995d2a9c104035fab.1689952914.git.nicola.vetrini@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <164303a2b19336a0e5f934a995d2a9c104035fab.1689952914.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 21/07/2023 16:22, Nicola Vetrini wrote:
> Rule 5.3 has the following headline:
> "An identifier declared in an inner scope shall not hide an
> identifier declared in an outer scope"
> 
> The function parameters renamed in this patch are hiding a variable defined
> in an enclosing scope or a function identifier.
> 
> The following renames have been made:
> - s/guest_mode/guest_mode_on/ to distinguish from function 'guest_mode'
> - s/struct module_name/struct module_info to distinguish from the homonymous

Typo: Missing '/' after 'module_info'.

> parameters, since the structure contains more information than just the name.
> - s/file_name/file_info in 'xen/arch/arm/efi/efi-boot.h' for consistency with

Same here.

> the previous renaming.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

Assuming there is no other comments, I would be Ok to fix it on commit. So:

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 16:12:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 16:12:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567644.886948 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMsjR-0003P7-5W; Fri, 21 Jul 2023 16:11:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567644.886948; Fri, 21 Jul 2023 16:11:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMsjR-0003P0-2N; Fri, 21 Jul 2023 16:11:53 +0000
Received: by outflank-mailman (input) for mailman id 567644;
 Fri, 21 Jul 2023 16:11:51 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMsjP-0003Os-Gm
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 16:11:51 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMsjN-00024m-L5; Fri, 21 Jul 2023 16:11:49 +0000
Received: from 54-240-197-231.amazon.com ([54.240.197.231]
 helo=[192.168.21.208]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMsjN-0007bD-CP; Fri, 21 Jul 2023 16:11:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=NPrVvjH8UIj7XB0Jr4QlNUCjgndIdetd4JX273Kjdz4=; b=AwdGhAZUQhTwxNXdPXPD/MwudX
	19lmDuY4ZzhGqIuHkAJIdikpocG8DGnbe/BFalUQknf7xEh6uWR3k1o4G9m9XvyG54GlIOvLG0UMt
	1pjNQGx2RcY48ZVOWYO9YGQm/bWAk+aonZsMwZYbJXpuBF6G9hKtDfLueLomcxULK5B0=;
Message-ID: <7dc614f1-c215-f106-38b8-22c0600b0f73@xen.org>
Date: Fri, 21 Jul 2023 17:11:47 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH 5/8] mm: Factor out the pdx compression logic in ma/va
 converters
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-6-alejandro.vallejo@cloud.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230717160318.2113-6-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Alejandro,

On 17/07/2023 17:03, Alejandro Vallejo wrote:
> This patch factors out the pdx compression logic hardcoded in both ports
> for the maddr<->vaddr conversion functions.
> 
> Touches both x86 and arm ports.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> ---
>   xen/arch/arm/include/asm/mm.h          |  3 +--
>   xen/arch/x86/include/asm/x86_64/page.h | 28 +++++++++++---------------
>   xen/include/xen/pdx.h                  | 25 +++++++++++++++++++++++
>   3 files changed, 38 insertions(+), 18 deletions(-)
> 
> diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
> index 1a83f41879..78cb23858a 100644
> --- a/xen/arch/arm/include/asm/mm.h
> +++ b/xen/arch/arm/include/asm/mm.h
> @@ -320,8 +320,7 @@ static inline void *maddr_to_virt(paddr_t ma)
>              (DIRECTMAP_SIZE >> PAGE_SHIFT));
>       return (void *)(XENHEAP_VIRT_START -
>                       (directmap_base_pdx << PAGE_SHIFT) +
> -                    ((ma & ma_va_bottom_mask) |
> -                     ((ma & ma_top_mask) >> pfn_pdx_hole_shift)));
> +                    maddr_to_directmapoff(ma));
>   }
>   #endif
>   
> diff --git a/xen/arch/x86/include/asm/x86_64/page.h b/xen/arch/x86/include/asm/x86_64/page.h
> index 53faa7875b..b589c93e77 100644
> --- a/xen/arch/x86/include/asm/x86_64/page.h
> +++ b/xen/arch/x86/include/asm/x86_64/page.h
> @@ -36,26 +36,22 @@ static inline unsigned long __virt_to_maddr(unsigned long va)
>   {
>       ASSERT(va < DIRECTMAP_VIRT_END);
>       if ( va >= DIRECTMAP_VIRT_START )
> -        va -= DIRECTMAP_VIRT_START;
> -    else
> -    {
> -        BUILD_BUG_ON(XEN_VIRT_END - XEN_VIRT_START != GB(1));
> -        /* Signed, so ((long)XEN_VIRT_START >> 30) fits in an imm32. */
> -        ASSERT(((long)va >> (PAGE_ORDER_1G + PAGE_SHIFT)) ==
> -               ((long)XEN_VIRT_START >> (PAGE_ORDER_1G + PAGE_SHIFT)));
> -
> -        va += xen_phys_start - XEN_VIRT_START;
> -    }
> -    return (va & ma_va_bottom_mask) |
> -           ((va << pfn_pdx_hole_shift) & ma_top_mask);
> +        return directmapoff_to_maddr(va - DIRECTMAP_VIRT_START);
> +
> +    BUILD_BUG_ON(XEN_VIRT_END - XEN_VIRT_START != GB(1));
> +    /* Signed, so ((long)XEN_VIRT_START >> 30) fits in an imm32. */
> +    ASSERT(((long)va >> (PAGE_ORDER_1G + PAGE_SHIFT)) ==
> +           ((long)XEN_VIRT_START >> (PAGE_ORDER_1G + PAGE_SHIFT)));
> +
> +    return xen_phys_start + va - XEN_VIRT_START;
>   }
>   
>   static inline void *__maddr_to_virt(unsigned long ma)
>   {
> -    ASSERT(pfn_to_pdx(ma >> PAGE_SHIFT) < (DIRECTMAP_SIZE >> PAGE_SHIFT));
> -    return (void *)(DIRECTMAP_VIRT_START +
> -                    ((ma & ma_va_bottom_mask) |
> -                     ((ma & ma_top_mask) >> pfn_pdx_hole_shift)));
> +    /* Offset in the direct map, accounting for pdx compression */
> +    size_t va_offset = maddr_to_directmapoff(ma);
> +    ASSERT(va_offset < DIRECTMAP_SIZE);
> +    return (void *)(DIRECTMAP_VIRT_START + va_offset);
>   }
>   
>   /* read access (should only be used for debug printk's) */
> diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h
> index 67ae20e89c..f8ca0f5821 100644
> --- a/xen/include/xen/pdx.h
> +++ b/xen/include/xen/pdx.h
> @@ -158,6 +158,31 @@ static inline unsigned long pdx_to_pfn(unsigned long pdx)
>   #define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
>   #define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
>   
> +/**
> + * Computes the offset into the direct map of an maddr
> + *
> + * @param ma Machine address
> + * @return Offset on the direct map where that
> + *         machine address can be accessed
> + */
> +static inline unsigned long maddr_to_directmapoff(uint64_t ma)
> +{
> +    return ((ma & ma_top_mask) >> pfn_pdx_hole_shift) |
> +           (ma & ma_va_bottom_mask);

NIT: I got a bit confused because your re-order the two operations. I 
guess this was done because it is nicer to read.

Anyway, I have confirmed the logic is still the same (just different 
ordering).

> +}
> +
> +/**
> + * Computes a machine address given a direct map offset
> + *
> + * @param offset Offset into the direct map
> + * @return Corresponding machine address of that virtual location
> + */
> +static inline uint64_t directmapoff_to_maddr(unsigned long offset)
> +{
> +    return ((offset << pfn_pdx_hole_shift) & ma_top_mask) |

'unsigned long' may be 32-bit. So I think you want to cast offset to 
uint64_t.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 16:15:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 16:15:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567648.886957 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMsn7-00044b-P3; Fri, 21 Jul 2023 16:15:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567648.886957; Fri, 21 Jul 2023 16:15:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMsn7-00044U-MG; Fri, 21 Jul 2023 16:15:41 +0000
Received: by outflank-mailman (input) for mailman id 567648;
 Fri, 21 Jul 2023 16:15:40 +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
 <SRS0=R0zQ=DH=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qMsn6-00044M-IM
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 16:15:40 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d3f9efae-27e1-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 18:15:37 +0200 (CEST)
Received: from [172.20.10.2] (unknown [37.160.253.240])
 by support.bugseng.com (Postfix) with ESMTPSA id 689014EE0C89;
 Fri, 21 Jul 2023 18:15:36 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d3f9efae-27e1-11ee-8611-37d641c3527e
Message-ID: <7a051200-a11d-81f9-3efc-ef67a2f494ea@bugseng.com>
Date: Fri, 21 Jul 2023 18:15:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] atomic: change parameter name in atomic_cmpxchg()
 definition
Content-Language: en-US, it
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cace061a0b574d56f9b12a43a7c82276ef56654f.1689953642.git.federico.serafini@bugseng.com>
 <fa0c651f-2e02-e058-a3e5-efdaced81456@xen.org>
From: Federico Serafini <federico.serafini@bugseng.com>
Organization: BUGSENG srl
In-Reply-To: <fa0c651f-2e02-e058-a3e5-efdaced81456@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hello Julien,

On 21/07/23 17:44, Julien Grall wrote:> Title:
> 
> Please add "xen/arm: " to clarify this is a patch touching the Arm code.

Ok.

> On 21/07/2023 16:37, Federico Serafini wrote:
>> Change parameter name from 'ptr' to 'v' in the function definition thus
>> addressing violations of MISRA C:2012 Rule 8.3: "All declarations of an
>> object or function shall use the same names and type qualifiers".
> 
> The parameters are consistent between arm32 and arm64. Naming wise, any 
> reason you picked the x86 name? Personally, I have a slight preference 
> to keep 'ptr' because this is more obvious than 'v'.
I picked 'v' because in xen/arch/arm/include/asm/arm64/atomic.h,
all the parameters having 'atomic_t *' type are named in that way.
The same is true for xen/include/xen/atomic.h.

If you prefer I can go for 'ptr'.

> But I will not strongly argue against it. That said, if you are looking 
> for consistency, you should also modify arm32.
> 
> Cheers,

After deciding what to do, I will propagate the change to arm32.

Regards
-- 
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 16:25:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 16:25:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567654.886968 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMswt-0005es-Lw; Fri, 21 Jul 2023 16:25:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567654.886968; Fri, 21 Jul 2023 16:25:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMswt-0005el-Ik; Fri, 21 Jul 2023 16:25:47 +0000
Received: by outflank-mailman (input) for mailman id 567654;
 Fri, 21 Jul 2023 16:25:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMswr-0005ef-OP
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 16:25:45 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMswq-0002U5-Uw; Fri, 21 Jul 2023 16:25:44 +0000
Received: from 54-240-197-239.amazon.com ([54.240.197.239]
 helo=[192.168.21.208]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMswq-00083M-Ov; Fri, 21 Jul 2023 16:25:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=BV6uiwOgkiThaWJKV9nJWtfuNAZiCVf2yxLumCBVPKM=; b=vhltI0MN5q2+wdd5ok0/bXGy0f
	u25V4gdNXpFAFmGkb4d23gA5gr0bmKfgT7X+ttYEOzHXS3BdYhHBrjSGtflMQvvjuq4B27ieUaxCz
	xE0incVTPiVOmk9D1140rHr5Xsp8j3dNv81MlMoo8iKmteJ+c4E6HwEHxDfb4goAH7kM=;
Message-ID: <b6eea651-319f-27b8-2c69-294ef94c6115@xen.org>
Date: Fri, 21 Jul 2023 17:25:42 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] atomic: change parameter name in atomic_cmpxchg()
 definition
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cace061a0b574d56f9b12a43a7c82276ef56654f.1689953642.git.federico.serafini@bugseng.com>
 <fa0c651f-2e02-e058-a3e5-efdaced81456@xen.org>
 <7a051200-a11d-81f9-3efc-ef67a2f494ea@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <7a051200-a11d-81f9-3efc-ef67a2f494ea@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 21/07/2023 17:15, Federico Serafini wrote:
> Hello Julien,

Hi,

> On 21/07/23 17:44, Julien Grall wrote:> Title:
>>
>> Please add "xen/arm: " to clarify this is a patch touching the Arm code.
> 
> Ok.
> 
>> On 21/07/2023 16:37, Federico Serafini wrote:
>>> Change parameter name from 'ptr' to 'v' in the function definition thus
>>> addressing violations of MISRA C:2012 Rule 8.3: "All declarations of an
>>> object or function shall use the same names and type qualifiers".
>>
>> The parameters are consistent between arm32 and arm64. Naming wise, 
>> any reason you picked the x86 name? Personally, I have a slight 
>> preference to keep 'ptr' because this is more obvious than 'v'.
> I picked 'v' because in xen/arch/arm/include/asm/arm64/atomic.h,
> all the parameters having 'atomic_t *' type are named in that way.
> The same is true for xen/include/xen/atomic.h.

Thanks for the information.

> If you prefer I can go for 'ptr'.

But that would mean changing x86 / common. As you said the other helpers 
are also using 'v'. So I am not sure this is really worth the naming 
argument. Which is why I said I will not strongly argue for it. In fact, 
the only reason I didn't approve this patch is because...

> 
>> But I will not strongly argue against it. That said, if you are 
>> looking for consistency, you should also modify arm32.
>>
>> Cheers,
> 
> After deciding what to do, I will propagate the change to arm32.

... you didn't modify arm32. I should have made it clearer, sorry.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 16:46:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 16:46:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567657.886977 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMtGV-0008F2-9g; Fri, 21 Jul 2023 16:46:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567657.886977; Fri, 21 Jul 2023 16:46:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMtGV-0008Ev-6V; Fri, 21 Jul 2023 16:46:03 +0000
Received: by outflank-mailman (input) for mailman id 567657;
 Fri, 21 Jul 2023 16:46:01 +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
 <SRS0=pf5t=DH=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qMtGT-0008Ep-Rb
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 16:46:01 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20614.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::614])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 105a9780-27e6-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 18:45:57 +0200 (CEST)
Received: from DU2PR04CA0268.eurprd04.prod.outlook.com (2603:10a6:10:28e::33)
 by AS2PR08MB9343.eurprd08.prod.outlook.com (2603:10a6:20b:598::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Fri, 21 Jul
 2023 16:45:53 +0000
Received: from DBAEUR03FT064.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:28e:cafe::98) by DU2PR04CA0268.outlook.office365.com
 (2603:10a6:10:28e::33) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28 via Frontend
 Transport; Fri, 21 Jul 2023 16:45:53 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT064.mail.protection.outlook.com (100.127.143.3) with
 Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.35 via Frontend Transport; Fri, 21 Jul 2023 16:45:52 +0000
Received: ("Tessian outbound ba2f3d95109c:v145");
 Fri, 21 Jul 2023 16:45:52 +0000
Received: from e7f2e2cd2a88.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 895B95DF-3147-4C31-B36C-09AE2C625C56.1; 
 Fri, 21 Jul 2023 16:45:46 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e7f2e2cd2a88.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 21 Jul 2023 16:45:46 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by AS4PR08MB7506.eurprd08.prod.outlook.com (2603:10a6:20b:4f8::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 16:45:44 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::4c7d:6a1:e742:3b1a]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::4c7d:6a1:e742:3b1a%4]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023
 16:45:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 105a9780-27e6-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IO3eQnv1fs9UD9jh5L8BYHoK7voDyvxMDzI2vo71+H8=;
 b=ovWPY7j7U+2PiOipM60nG4cDAXVkjtZzgdPqAZTFhnD8JnkElK7ugRuwcxx9poM4P+jLfB82UzKwqwnnyo9jchjDmyonzTY6mfIVFynIPdPtuDI0jTQBVGbbYq8ncm4AGZBN84nZEiWMRPRjn0l2HzxAOdWbgUbLM2t8vPoQTXc=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 9e9f2f7cddfbf2d5
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=PfM/LqjcZJ1qigmtlexWWuOolbYgsEJvQyKfg1R/56bIE35DEwrofkhUrXMLOxXt+1CyZ+JscpbklMEsJSAhBqdZ9Lw2OmzI0iSrTtp0IJAC7HUO1DhRyECQsTzLiwyoRiRtdjXbtC40JhLQ6wuxmD46SUHE3orj27hPpeXo97Ea9LaZKKi6wrRb3IKSJlQwMXY3HQGciBz1Gu9cvlv5yRakOlUq7Yvy9se0cAxuOcDon2EZ1R2txxD+ivk8uFIaV5ywP/NPWRNUJbolqLq1eEzhbxDGHczHp60VVStEBGQ9ddeZS2BQAdxwOWPh6bnPzeqC/efqLzOpJora0h674Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=IO3eQnv1fs9UD9jh5L8BYHoK7voDyvxMDzI2vo71+H8=;
 b=W7Q9dIZTOijKnjHpTtA1BfQakT5UzYL/H0bFjMf4DT3Icphy8RfVLUQWD/y0H+JOgwfN/t/R/O+S4JxtCj1lg35k+vuy0L1fJOI/8B38V7eBv9PefzZml5n5S4ZJ03/guYipb0biHzlHqKxfJfPhNf8QKenjELg7ZSJ04C0ZAnPmFzmwapSe8pNo89E260kUGX4KsCSMc8J/zFWUAVcbR99IcM20wDEYLQLpwk2BhxMBVp0IkAn8KDhl14TLVqL4quHuLe1CQ858cwRZc9P4m5xl6nDn2lpeeFVSa0dajhGwNNOULrad2zBDZuEG4KKH2dM2eqf7aZSnZxGFwMBTDw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IO3eQnv1fs9UD9jh5L8BYHoK7voDyvxMDzI2vo71+H8=;
 b=ovWPY7j7U+2PiOipM60nG4cDAXVkjtZzgdPqAZTFhnD8JnkElK7ugRuwcxx9poM4P+jLfB82UzKwqwnnyo9jchjDmyonzTY6mfIVFynIPdPtuDI0jTQBVGbbYq8ncm4AGZBN84nZEiWMRPRjn0l2HzxAOdWbgUbLM2t8vPoQTXc=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Rahul Singh <Rahul.Singh@arm.com>, =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?=
	<roger.pau@citrix.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: Re: [OSSTEST] ts-kernel-build: add kernel kconfig for the Arndale
Thread-Topic: [OSSTEST] ts-kernel-build: add kernel kconfig for the Arndale
Thread-Index: AQHZu81JNSQT8M0pukCzoS21u4bdG6/ENcMAgAA4KoA=
Date: Fri, 21 Jul 2023 16:45:44 +0000
Message-ID: <2CA77C15-BA9B-4D98-80A0-B1B7EDE4E48B@arm.com>
References: <20230721121627.1229906-1-luca.fancellu@arm.com>
 <ceb7d6ad-0292-facf-6ad5-4bd265a8d34d@suse.com>
In-Reply-To: <ceb7d6ad-0292-facf-6ad5-4bd265a8d34d@suse.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|AS4PR08MB7506:EE_|DBAEUR03FT064:EE_|AS2PR08MB9343:EE_
X-MS-Office365-Filtering-Correlation-Id: 74b17dd6-6957-4d04-b44a-08db8a09f24a
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 623QHv80aLHe4no2/Qx58Roe7yAgkCSGkRvfasKrgwKPRP1INUh95PbB94ULBKtGB8aZT3j0AJPm3WgV24FmikD151C8efGK5BA/Z8bz6HHmrtWmsMTRbUmkYZwTouP4slplFSzeBNxu2WmYfGTyrgNCfDFcE3JvGTWUif6uqIaWY/LDS3GwJPXzGtTc1AAwcahAQcQbVcCY+YVCjdJvipY4I1HDpryalosCRSPl7VztL7aRra4VIWBgWc/pd1yGS6/M2Y6bMiGzU1HggwcYW7EJqWyl7fcmp1X5y2lhe0VwmMsy/Hl16NTV4pGd7m6w/NYHo8o0R0LkuRhF02HEggD+z3q3UsxvW0Wjcr97eKCsNdGeP3ACClo5CZ9nSWqN+Lf7BY2xw30pd3bvn00LhjTHMnJwTVSNgzFQ+uY+ITAG/8uS/sfjeylUu8YLKTA5XpOvNetPJ4WfLdqULJ0C729zUImyD7NjkCU18qqNbn4qvV+DUMJO7Xaj7xsy2hiXkLGjYpi64TM04wfNhSgFGXIxUCpFR7Bt08QTdq8id962MCg+huA4JqXcW5hR/Wg/k1VtNSNKep0Stdtkp/nhq114Bg3bXkm1PTXujPicSj+WPyFQq4e5Xds70Rvz20jR2CpiIcOq7PieASDNrGAEjg==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(346002)(39860400002)(396003)(136003)(376002)(451199021)(6512007)(122000001)(38100700002)(186003)(2616005)(6506007)(53546011)(26005)(33656002)(2906002)(8676002)(8936002)(5660300002)(71200400001)(36756003)(478600001)(38070700005)(6486002)(316002)(64756008)(66446008)(4326008)(6916009)(41300700001)(66476007)(54906003)(86362001)(66946007)(66556008)(76116006)(91956017)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <FF2A59B700AD3A40B4C0DFEA8E090879@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7506
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT064.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	5c2b7b6c-3e72-4c2b-0bb1-08db8a09ed43
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	tsyCzmijQ9z6MPM1BXbb7ujAvWgiY8ZguPlE1nw5V/HPB5YtOrGiUJNwQMyMnfHZencije0mopzXMVkrhesHKVcT3UmnIfx1e4tEHBg5qhW68hpZippUKwbBU6jrJaH1d4Mm4gO1c5ijf7xRHgPrCLMTCvQgXNX3jAn8LLWr9dBNXuPTWPPFaySW8HkCb3NxPJ1wIk7QZ1vkF6hzc+PUFnRYy+8y+9tOJHNpPTF9Kv09bnKAGSFeJ+TF9+GreITZm++OQAvYnVkaDDAgRuNcWkMrx3As9GhMTjCs7K2+VrGlniA1tQSQOkNTdeys/bT7oUwvyxWo6Z5CG96BIUDeDvubtRebZ9VkCGwFhDCd9z3FUqv3hUvKtGTL/D29Fr2PAO0EA3mfDMh3/bJQCALbquiAU8dzq3ISKKZx/McCBkL3OcJyKBierh9S3exZy2UZ4RSqYz0imwYmtgIWTf5yp8msfF/KzvR8oqCH7a/r/g3ou0fnytKSJ3LrdA98hp/Yhs/xZrQiUcbqwH3sJW47m83Nr8LzIa93qi5/Adw4RMKIHzjO0Dek7TkbVOsVC8t29lUCvg1OGF2nB916SUX+xRIiAuU/5y/DMrmp33NAYhUi0ILi2u4QA8IQ5ly9f7m43DFmAzg8oqZRMDjdzU9Fw4NAD8FbHqX/0wJ30ef+yWYsciV0pfw8gOcjz5P6VPCauy461b9ECA5M0yxikzb7i1CaGA2ifrnreOJCATgPP18=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(39860400002)(376002)(396003)(451199021)(82310400008)(46966006)(40470700004)(36840700001)(40460700003)(8936002)(8676002)(6862004)(33656002)(36860700001)(2906002)(36756003)(6506007)(5660300002)(26005)(2616005)(47076005)(356005)(53546011)(82740400003)(81166007)(186003)(336012)(40480700001)(70586007)(4326008)(70206006)(54906003)(86362001)(6486002)(41300700001)(478600001)(6512007)(316002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 16:45:52.7065
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 74b17dd6-6957-4d04-b44a-08db8a09f24a
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT064.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange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b3Ugc2F5ICJtb2R1bGUiIGhlcmUsIC4uLg0KPiANCj4+
IC0tLSBhL3RzLWtlcm5lbC1idWlsZA0KPj4gKysrIGIvdHMta2VybmVsLWJ1aWxkDQo+PiBAQCAt
MjQ1LDYgKzI0NSw3IEBAIHNldG9wdCBDT05GSUdfU0VOU09SU19MTTkwIG4NCj4+IHNldG9wdCBD
T05GSUdfSUNTOTMyUzQwMSBuDQo+PiANCj4+ICMgRW5hYmxlIHNvbWUgYWRkaXRpb25hbCBkcml2
ZXJzIGZvciBBcm5kYWxlLg0KPj4gK3NldG9wdCBDT05GSUdfQUhDSV9EV0MgeQ0KPiANCj4gLi4u
IGRvZXMgaXQgcmVhbGx5IG5lZWQgdG8gYmUgeSAoYW5kIG5vdCBtKSBoZXJlPw0KDQpJIGRpZG7i
gJl0IHRyeSB3aXRoIG0gYmVmb3JlIGJlY2F1c2UgSSB3YXMgdW5zdXJlIHdoZXJlIHRoZSBrZXJu
ZWwgbW9kdWxlIHdlcmUgcHV0IChpbiB0aGUgZGlzaz8gQnV0IHRoZW4gd2UgbmVlZCB0byByZWFk
IGl0KSwNCmJ1dCBub3cgSSBkaWQgYSB0cnkgd2l0aCDigJht4oCZIGFuZCBpdCB3b3Jrcywgc28g
SSBndWVzcyB0aGUgbW9kdWxlIGFyZSBwdXQgaW4gc29tZSByYW1kaXNrIGluc3RlYWQgb2YgdGhl
IGRpc2sgd2Ugd2FudCB0byByZWFkLg0KDQpUaGFua3MgZm9yIHBvaW50aW5nIHRoYXQgb3V0Lg0K
DQpAUm9nZXIsIGlzIGl0IHBvc3NpYmxlIHRvIGNoYW5nZSBpdCBvbiBjb21taXQgb3Igc2hvdWxk
IEkgc2VuZCBhIHYyPw0KDQpDaGVlcnMsDQpMdWNhDQoNCj4gDQo+IEphbg0KDQo=


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 16:53:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 16:53:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567661.886988 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMtNO-0001I1-1E; Fri, 21 Jul 2023 16:53:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567661.886988; Fri, 21 Jul 2023 16:53:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMtNN-0001Hu-Ty; Fri, 21 Jul 2023 16:53:09 +0000
Received: by outflank-mailman (input) for mailman id 567661;
 Fri, 21 Jul 2023 16:53:09 +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
 <SRS0=NI5b=DH=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qMtNM-0001Ho-VU
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 16:53:08 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0f4c83f4-27e7-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 18:53:05 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 9E8328285590;
 Fri, 21 Jul 2023 11:53:03 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id 7T53_EDlM9kY; Fri, 21 Jul 2023 11:53:02 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 36EA68285957;
 Fri, 21 Jul 2023 11:53:02 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id UrC3dRSvM5h6; Fri, 21 Jul 2023 11:53:02 -0500 (CDT)
Received: from [10.11.0.2] (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id B69C18285590;
 Fri, 21 Jul 2023 11:53:01 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0f4c83f4-27e7-11ee-8611-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 36EA68285957
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1689958382; bh=fYfLF0WSeFnVwXg54J6bA2OQsEwG0Ye0kjBmI9gTu+k=;
	h=Message-ID:Date:MIME-Version:To:From;
	b=tUiIJBauH0acvaYAu2EpsY2bglQDrmvm6l+iDRNcq13+ZNN/FVg1pBGXPpA7GQs1k
	 sqRwP8VEdEwyFMI/J8rDn8rSYaz4dyiL+G4v6lAKSDNRFSU8Ms3v0Gt1Ckh1HlPxK5
	 4JAHoKd8NCkbXJ3HSUP+f8YnAZLbKk+nKMa+7kXM=
X-Virus-Scanned: amavisd-new at rptsys.com
Message-ID: <a7f89b3b-bcd1-6844-b836-40b73a9fa3b0@raptorengineering.com>
Date: Fri, 21 Jul 2023 11:53:01 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v4 3/4] xen/ppc: Implement early serial printk on pseries
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1689710519.git.sanastasio@raptorengineering.com>
 <7c416ff843ea359bb24b8c954cc079fe1bbaf75f.1689710519.git.sanastasio@raptorengineering.com>
 <6d3b7cd6-7d6a-8d28-f1e7-7e939e393445@suse.com>
From: Shawn Anastasio <sanastasio@raptorengineering.com>
In-Reply-To: <6d3b7cd6-7d6a-8d28-f1e7-7e939e393445@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 7/19/23 9:05 AM, Jan Beulich wrote:
> On 18.07.2023 22:20, Shawn Anastasio wrote:
>> +void __init boot_of_init(unsigned long vec)
>> +{
>> +    int bof_chosen;
>> +
>> +    of_vec = vec;
>> +
>> +    /* Get a handle to the default console */
>> +    bof_chosen = of_finddevice("/chosen");
>> +    of_getprop(bof_chosen, "stdout", &of_out, sizeof(of_out));
>> +    of_out = be32_to_cpu(of_out);
> 
> Can any of these fail, and hence lead to ...

These calls are allowed to fail, but their return value in those cases
is well-defined (an invalid handle), so...

> 
>> +    early_printk_init(of_putchar);
> 
> ... this better not getting invoked?

this being invoked is fine even in those cases. It will just result in
the invalid handle being passed to of_write and the firmware will refuse
to service the writes.

>> --- a/xen/arch/ppc/ppc64/asm-offsets.c
>> +++ b/xen/arch/ppc/ppc64/asm-offsets.c
>> @@ -0,0 +1,59 @@
>> +/*
>> + * Generate definitions needed by assembly language modules.
>> + * This code generates raw asm output which is post-processed
>> + * to extract and format the required data.
>> + */
>> +
>> +#include <asm/processor.h>
>> +
>> +#define DEFINE(_sym, _val)                                                 \
>> +    asm volatile ("\n.ascii\"==>#define " #_sym " %0 /* " #_val " */<==\"" \
>> +                  : : "i" (_val) )
> 
> Nit: There's a blank missing after the opening paren, which will then want
> the 2nd line to be indented by one more character. (Instead, as a matter of
> your taste, you may omit the blank between the two colons.)

Will fix.

>> +#define BLANK()                                                            \
>> +    asm volatile ( "\n.ascii\"==><==\"" : : )
>> +#define OFFSET(_sym, _str, _mem)                                           \
>> +    DEFINE(_sym, offsetof(_str, _mem));
>> +
>> +/* base-2 logarithm */
>> +#define __L2(_x)  (((_x) & 0x00000002) ?   1 : 0)
>> +#define __L4(_x)  (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
>> +#define __L8(_x)  (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
>> +#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
>> +#define LOG_2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x))
>> +
>> +void __dummy__(void)
>> +{
>> +    DEFINE(GPR_WIDTH, sizeof(unsigned long));
>> +    DEFINE(FPR_WIDTH, sizeof(double));
>> +
>> +    OFFSET(UREGS_gprs, struct cpu_user_regs, gprs);
>> +    OFFSET(UREGS_r0, struct cpu_user_regs, gprs[0]);
>> +    OFFSET(UREGS_r1, struct cpu_user_regs, gprs[1]);
>> +    OFFSET(UREGS_r13, struct cpu_user_regs, gprs[13]);
>> +    OFFSET(UREGS_srr0, struct cpu_user_regs, srr0);
>> +    OFFSET(UREGS_srr1, struct cpu_user_regs, srr1);
>> +    OFFSET(UREGS_pc, struct cpu_user_regs, pc);
>> +    OFFSET(UREGS_msr, struct cpu_user_regs, msr);
>> +    OFFSET(UREGS_lr, struct cpu_user_regs, lr);
>> +    OFFSET(UREGS_ctr, struct cpu_user_regs, ctr);
>> +    OFFSET(UREGS_xer, struct cpu_user_regs, xer);
>> +    OFFSET(UREGS_hid4, struct cpu_user_regs, hid4);
>> +    OFFSET(UREGS_dar, struct cpu_user_regs, dar);
>> +    OFFSET(UREGS_dsisr, struct cpu_user_regs, dsisr);
>> +    OFFSET(UREGS_cr, struct cpu_user_regs, cr);
>> +    OFFSET(UREGS_fpscr, struct cpu_user_regs, fpscr);
>> +    DEFINE(UREGS_sizeof, sizeof(struct cpu_user_regs));
>> +}
>> +
>> +/* TODO: Replace with BUILD_BUG_ON + IS_ALIGNED once we can use <xen/lib.h> */
>> +_Static_assert(sizeof(struct cpu_user_regs) % STACK_ALIGN == 0,
>> +               "struct cpu_user_regs not stack aligned!");
> 
> But patch 1 makes BUILD_BUG_ON() available now.

Good point, will fix.

>> --- /dev/null
>> +++ b/xen/arch/ppc/ppc64/of-call.S
>> @@ -0,0 +1,83 @@
>> +/* SPDX-License-Identifier: GPL-2.0-or-later */
>> +/*
>> + * Adapted from Linux's arch/powerpc/kernel/entry_64.S, with the
>> + * following copyright notice:
>> + *
>> + *  PowerPC version
>> + *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
>> + *  Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
>> + *    Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
>> + *  Adapted for Power Macintosh by Paul Mackerras.
>> + *  Low-level exception handlers and MMU support
>> + *  rewritten by Paul Mackerras.
>> + *    Copyright (C) 1996 Paul Mackerras.
>> + *  MPC8xx modifications Copyright (C) 1997 Dan Malek (dmalek@jlc.net).
>> + */
>> +
>> +#include <asm/asm-offsets.h>
>> +#include <asm/asm-defns.h>
>> +#include <asm/msr.h>
>> +
>> +/* size of minimum stack frame that can hold an entire cpu_user_regs struct */
>> +#define STACK_SWITCH_FRAME_SIZE UREGS_sizeof
>> +
>> +    .section .init.text, "ax", @progbits
>> +
>> +ENTRY(enter_of)
>> +    mflr %r0
>> +    std %r0, 16(%r1)
>> +    stdu %r1,-STACK_SWITCH_FRAME_SIZE(%r1) /* Save SP and create stack space */
> 
> Nit: A blank after the comma would again be nice.

Will fix.

>> +    /*
>> +     * Because PROM is running in 32b mode, it clobbers the high order half
>> +     * of all registers that it saves.  We therefore save those registers
>> +     * PROM might touch to the stack.  (%r0, %r3-%r13 are caller saved)
>> +     */
>> +    SAVE_GPR(2, %r1)
>> +    SAVE_GPR(13, %r1)
>> +    SAVE_NVGPRS(%r1)
>> +    mfcr %r10
>> +    mfmsr %r11
>> +    std %r10, UREGS_cr(%r1)
>> +    std %r11, UREGS_msr(%r1)
>> +
>> +    /* Put PROM address in SRR0 */
>> +    mtsrr0 %r4
>> +
>> +    /* Setup our trampoline return addr in LR */
>> +    bcl 20, 31, .+4
>> +0:  mflr %r4
>> +    addi %r4, %r4, 1f - 0b
>> +    mtlr %r4
>> +
>> +    /* Prepare a 32-bit mode big endian MSR */
>> +    LOAD_IMM64(%r12, MSR_SF | MSR_LE)
>> +    andc %r11, %r11, %r12
>> +    mtsrr1 %r11
>> +    rfid
>> +
>> +1:  /* Return from OF */
>> +    FIXUP_ENDIAN
>> +
>> +    /* Just make sure that %r1 top 32 bits didn't get corrupt by OF */
>> +    rldicl %r1, %r1, 0, 32
>> +
>> +    /* Restore the MSR (back to 64 bits) */
>> +    ld %r0, UREGS_msr(%r1)
>> +    mtmsrd %r0
>> +    isync
>> +
>> +    /* Restore other registers */
>> +    REST_GPR(2, %r1)
>> +    REST_GPR(13, %r1)
>> +    REST_NVGPRS(%r1)
>> +    ld %r4, UREGS_cr(%r1)
>> +    mtcr %r4
>> +
>> +    addi %r1, %r1, STACK_SWITCH_FRAME_SIZE
>> +    ld %r0, 16(%r1)
>> +    mtlr %r0
>> +    blr
>> +
>> +    .size enter_of, . - enter_of
>> +    .type enter_of, %function

Thanks,
Shawn


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 17:03:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 17:03:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567670.887031 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMtX8-0003bT-A1; Fri, 21 Jul 2023 17:03:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567670.887031; Fri, 21 Jul 2023 17:03:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMtX8-0003XN-2t; Fri, 21 Jul 2023 17:03:14 +0000
Received: by outflank-mailman (input) for mailman id 567670;
 Fri, 21 Jul 2023 17:03:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=NI5b=DH=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qMtX6-0002st-Lj
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 17:03:12 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 78ae5832-27e8-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 19:03:11 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 5A309828595C;
 Fri, 21 Jul 2023 12:03:10 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id LWZtriQeiBlq; Fri, 21 Jul 2023 12:03:07 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id B67A48285A3C;
 Fri, 21 Jul 2023 12:03:07 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id tKj-fC7cowRt; Fri, 21 Jul 2023 12:03:07 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 216818285A06;
 Fri, 21 Jul 2023 12:03:07 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 78ae5832-27e8-11ee-b23a-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com B67A48285A3C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1689958987; bh=49thkP8FJpYosT0RNEvML+dgM4MKq2ZDLUB0IJ8Se+s=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=EeE1KqJuVCFuVditieVBUEpDrbxOD4Wh7GJne68/wsAFGZcSaxsX9PTL9V8C9NA9x
	 Romc0zmu0B7wZnbCnckRhe7T0+naSBG+pfAgcTlZCTW2wUP0xkofv9X7NhoFJmwmqA
	 tnlzF07ZItTc78/oA05XlJSO5voqva8eAm3Nf4jE=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v5 3/4] xen/ppc: Implement early serial printk on pseries
Date: Fri, 21 Jul 2023 12:02:54 -0500
Message-Id: <f326168638ae05f5f387e4fa018ac2ed057bac8c.1689958538.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1689958538.git.sanastasio@raptorengineering.com>
References: <cover.1689958538.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

On typical Power VMs (e.g. QEMU's -M pseries), a variety of services
including an early serial console are provided by Open Firmware.
Implement the required interfaces to call into Open Firmware and write
to the serial console.

Since Open Firmware runs in 32-bit Big Endian mode and Xen runs in
64-bit Little Endian mode, a thunk is required to save/restore
any potentially-clobbered registers as well as to perform the
required endianness switch. Thankfully, linux already has such
a routine, which was imported into ppc64/of-call.S.

Support for bare metal (PowerNV) will be implemented in a future
patch.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/ppc/Kconfig.debug              |   5 +
 xen/arch/ppc/Makefile                   |   2 +
 xen/arch/ppc/boot-of.c                  | 113 +++++++++++++++++++
 xen/arch/ppc/configs/ppc64_defconfig    |   1 +
 xen/arch/ppc/early_printk.c             |  28 +++++
 xen/arch/ppc/include/asm/asm-defns.h    |  17 +++
 xen/arch/ppc/include/asm/boot.h         |  23 ++++
 xen/arch/ppc/include/asm/byteorder.h    |  12 +++
 xen/arch/ppc/include/asm/config.h       |   3 +
 xen/arch/ppc/include/asm/early_printk.h |  15 +++
 xen/arch/ppc/include/asm/msr.h          |  51 +++++++++
 xen/arch/ppc/include/asm/processor.h    | 138 ++++++++++++++++++++++++
 xen/arch/ppc/include/asm/types.h        |  21 ++++
 xen/arch/ppc/ppc64/Makefile             |   1 +
 xen/arch/ppc/ppc64/asm-offsets.c        |  58 ++++++++++
 xen/arch/ppc/ppc64/head.S               |   9 ++
 xen/arch/ppc/ppc64/of-call.S            |  83 ++++++++++++++
 xen/arch/ppc/setup.c                    |  19 +++-
 18 files changed, 596 insertions(+), 3 deletions(-)
 create mode 100644 xen/arch/ppc/boot-of.c
 create mode 100644 xen/arch/ppc/early_printk.c
 create mode 100644 xen/arch/ppc/include/asm/boot.h
 create mode 100644 xen/arch/ppc/include/asm/byteorder.h
 create mode 100644 xen/arch/ppc/include/asm/early_printk.h
 create mode 100644 xen/arch/ppc/include/asm/msr.h
 create mode 100644 xen/arch/ppc/include/asm/processor.h
 create mode 100644 xen/arch/ppc/include/asm/types.h
 create mode 100644 xen/arch/ppc/ppc64/of-call.S

diff --git a/xen/arch/ppc/Kconfig.debug b/xen/arch/ppc/Kconfig.debug
index e69de29bb2..608c9ff832 100644
--- a/xen/arch/ppc/Kconfig.debug
+++ b/xen/arch/ppc/Kconfig.debug
@@ -0,0 +1,5 @@
+config EARLY_PRINTK
+    bool "Enable early printk"
+    default DEBUG
+    help
+      Enables early printk debug messages
diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index 530fba2121..098a4dd0a9 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -1,5 +1,7 @@
 obj-$(CONFIG_PPC64) +=3D ppc64/
=20
+obj-y +=3D boot-of.init.o
+obj-$(CONFIG_EARLY_PRINTK) +=3D early_printk.init.o
 obj-y +=3D setup.o
=20
 $(TARGET): $(TARGET)-syms
diff --git a/xen/arch/ppc/boot-of.c b/xen/arch/ppc/boot-of.c
new file mode 100644
index 0000000000..a06546871e
--- /dev/null
+++ b/xen/arch/ppc/boot-of.c
@@ -0,0 +1,113 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * This file was derived from Xen 3.2's xen/arch/powerpc/boot_of.c,
+ * originally licensed under GPL version 2 or later.
+ *
+ * Copyright IBM Corp. 2005, 2006, 2007
+ * Copyright Raptor Engineering, LLC
+ *
+ * Authors: Jimi Xenidis <jimix@watson.ibm.com>
+ *          Hollis Blanchard <hollisb@us.ibm.com>
+ *          Shawn Anastasio <sanastasio@raptorengineering.com>
+ */
+
+#include <xen/init.h>
+#include <xen/macros.h>
+#include <xen/stdarg.h>
+#include <xen/types.h>
+#include <asm/boot.h>
+#include <asm/byteorder.h>
+#include <asm/early_printk.h>
+
+/*
+ * The Open Firmware client interface is called in 32-bit mode with the =
MMU off,
+ * so any addresses passed to it must be physical addresses under 4GB.
+ *
+ * Since the client interface is only used during early boot before the =
MMU is on
+ * and Xen itself was loaded by Open Firmware (and therefore resides bel=
ow 4GB),
+ * we can achieve the desired result with a simple cast to uint32_t.
+ */
+#define ADDR(x) ((uint32_t)(unsigned long)(x))
+
+/* OF entrypoint*/
+static unsigned long __initdata of_vec;
+
+static int __initdata of_out;
+
+static int __init of_call(const char *service, uint32_t nargs, uint32_t =
nrets,
+                          int32_t rets[], ...)
+{
+    int rc;
+    va_list args;
+    unsigned int i;
+    struct of_service s =3D { 0 };
+
+    s.ofs_service =3D cpu_to_be32(ADDR(service));
+    s.ofs_nargs =3D cpu_to_be32(nargs);
+    s.ofs_nrets =3D cpu_to_be32(nrets);
+
+    /* Copy all the params into the args array */
+    va_start(args, rets);
+
+    for ( i =3D 0; i < nargs; i++ )
+        s.ofs_args[i] =3D cpu_to_be32(va_arg(args, uint32_t));
+
+    va_end(args);
+
+    rc =3D enter_of(&s, of_vec);
+
+    /* Copy all return values to the output rets array */
+    for ( i =3D 0; i < nrets; i++ )
+        rets[i] =3D be32_to_cpu(s.ofs_args[i + nargs]);
+
+    return rc;
+}
+
+static int __init of_finddevice(const char *devspec)
+{
+    int32_t rets[1] =3D { OF_FAILURE };
+
+    of_call("finddevice", 1, ARRAY_SIZE(rets), rets, ADDR(devspec));
+    return rets[0];
+}
+
+static int __init of_getprop(int ph, const char *name, void *buf, uint32=
_t buflen)
+{
+    int32_t rets[1] =3D { OF_FAILURE };
+
+    of_call("getprop", 4, ARRAY_SIZE(rets), rets, ph, ADDR(name), ADDR(b=
uf),
+            buflen);
+    return rets[0];
+}
+
+int __init of_write(int ih, const char *addr, uint32_t len)
+{
+    int32_t rets[1] =3D { OF_FAILURE };
+
+    of_call("write", 3, ARRAY_SIZE(rets), rets, ih, ADDR(addr), len);
+    return rets[0];
+}
+
+static void __init of_putchar(char c)
+{
+    if ( c =3D=3D '\n' )
+    {
+        char buf =3D '\r';
+        of_write(of_out, &buf, 1);
+    }
+    of_write(of_out, &c, 1);
+}
+
+void __init boot_of_init(unsigned long vec)
+{
+    int bof_chosen;
+
+    of_vec =3D vec;
+
+    /* Get a handle to the default console */
+    bof_chosen =3D of_finddevice("/chosen");
+    of_getprop(bof_chosen, "stdout", &of_out, sizeof(of_out));
+    of_out =3D be32_to_cpu(of_out);
+
+    early_printk_init(of_putchar);
+}
diff --git a/xen/arch/ppc/configs/ppc64_defconfig b/xen/arch/ppc/configs/=
ppc64_defconfig
index 8783eb3488..f7cc075e45 100644
--- a/xen/arch/ppc/configs/ppc64_defconfig
+++ b/xen/arch/ppc/configs/ppc64_defconfig
@@ -10,4 +10,5 @@
 CONFIG_PPC64=3Dy
 CONFIG_DEBUG=3Dy
 CONFIG_DEBUG_INFO=3Dy
+CONFIG_EARLY_PRINTK=3Dy
 CONFIG_EXPERT=3Dy
diff --git a/xen/arch/ppc/early_printk.c b/xen/arch/ppc/early_printk.c
new file mode 100644
index 0000000000..781f82133e
--- /dev/null
+++ b/xen/arch/ppc/early_printk.c
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include <xen/init.h>
+#include <asm/boot.h>
+
+static void __initdata (*putchar_func)(char);
+
+void __init early_printk_init(void (*putchar)(char))
+{
+    putchar_func =3D putchar;
+}
+
+void __init early_puts(const char *s, size_t nr)
+{
+    if ( !putchar_func )
+        return;
+
+    while ( nr-- > 0 )
+        putchar_func(*s++);
+}
+
+void __init early_printk(const char *s)
+{
+    if ( !putchar_func )
+        return;
+
+    while ( *s )
+        putchar_func(*s++);
+}
diff --git a/xen/arch/ppc/include/asm/asm-defns.h b/xen/arch/ppc/include/=
asm/asm-defns.h
index 6ea35f6edb..9d7328f4a2 100644
--- a/xen/arch/ppc/include/asm/asm-defns.h
+++ b/xen/arch/ppc/include/asm/asm-defns.h
@@ -37,4 +37,21 @@
     .long 0xa6037b7d; /* mtsrr1 r11                         */          =
       \
     .long 0x2400004c  /* rfid                               */
=20
+
+/* Taken from Linux kernel source (arch/powerpc/boot/crt0.S) */
+.macro OP_REGS op, width, start, end, base, offset
+	.Lreg=3D\start
+	.rept (\end - \start + 1)
+	\op	.Lreg,\offset+\width*.Lreg(\base)
+	.Lreg=3D.Lreg+1
+	.endr
+.endm
+
+#define SAVE_GPRS(start, end, base) OP_REGS std, 8, start, end, base, 0
+#define REST_GPRS(start, end, base) OP_REGS ld, 8, start, end, base, 0
+#define SAVE_GPR(n, base)           SAVE_GPRS(n, n, base)
+#define REST_GPR(n, base)           REST_GPRS(n, n, base)
+#define SAVE_NVGPRS(base)           SAVE_GPRS(14, 31, base)
+#define REST_NVGPRS(base)           REST_GPRS(14, 31, base)
+
 #endif /* _ASM_PPC_ASM_DEFNS_H */
diff --git a/xen/arch/ppc/include/asm/boot.h b/xen/arch/ppc/include/asm/b=
oot.h
new file mode 100644
index 0000000000..9b8a7c43c2
--- /dev/null
+++ b/xen/arch/ppc/include/asm/boot.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef _ASM_PPC_BOOT_H
+#define _ASM_PPC_BOOT_H
+
+#include <xen/types.h>
+
+/* a collection of interfaces used during boot. */
+enum {
+    OF_FAILURE =3D -1,
+    OF_SUCCESS =3D 0,
+};
+
+struct of_service {
+    __be32 ofs_service;
+    __be32 ofs_nargs;
+    __be32 ofs_nrets;
+    __be32 ofs_args[10];
+};
+
+int enter_of(struct of_service *args, unsigned long entry);
+void boot_of_init(unsigned long vec);
+
+#endif /* _ASM_PPC_BOOT_H */
diff --git a/xen/arch/ppc/include/asm/byteorder.h b/xen/arch/ppc/include/=
asm/byteorder.h
new file mode 100644
index 0000000000..2b5f6b9f63
--- /dev/null
+++ b/xen/arch/ppc/include/asm/byteorder.h
@@ -0,0 +1,12 @@
+#ifndef _ASM_PPC_BYTEORDER_H
+#define _ASM_PPC_BYTEORDER_H
+
+#define __arch__swab16 __builtin_bswap16
+#define __arch__swab32 __builtin_bswap32
+#define __arch__swab64 __builtin_bswap64
+
+#define __BYTEORDER_HAS_U64__
+
+#include <xen/byteorder/little_endian.h>
+
+#endif /* _ASM_PPC_BYTEORDER_H */
diff --git a/xen/arch/ppc/include/asm/config.h b/xen/arch/ppc/include/asm=
/config.h
index 01ca5d0803..cb27d2781e 100644
--- a/xen/arch/ppc/include/asm/config.h
+++ b/xen/arch/ppc/include/asm/config.h
@@ -52,6 +52,9 @@
 /* size of minimum stack frame; C code can write into the caller's stack=
 */
 #define STACK_FRAME_OVERHEAD 32
=20
+/* ELFv2 ABI mandates 16 byte alignment */
+#define STACK_ALIGN 16
+
 #endif /* __PPC_CONFIG_H__ */
 /*
  * Local variables:
diff --git a/xen/arch/ppc/include/asm/early_printk.h b/xen/arch/ppc/inclu=
de/asm/early_printk.h
new file mode 100644
index 0000000000..d1d8b416f4
--- /dev/null
+++ b/xen/arch/ppc/include/asm/early_printk.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef _ASM_PPC_EARLY_PRINTK_H
+#define _ASM_PPC_EARLY_PRINTK_H
+
+#include <xen/early_printk.h>
+
+#ifdef CONFIG_EARLY_PRINTK
+void early_printk_init(void (*putchar)(char));
+void early_printk(const char *s);
+#else
+static inline void early_printk_init(void (*putchar)(char)) {}
+static inline void early_printk(const char *s) {}
+#endif
+
+#endif /* _ASM_PPC_EARLY_PRINTK_H */
diff --git a/xen/arch/ppc/include/asm/msr.h b/xen/arch/ppc/include/asm/ms=
r.h
new file mode 100644
index 0000000000..144511e5c3
--- /dev/null
+++ b/xen/arch/ppc/include/asm/msr.h
@@ -0,0 +1,51 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) IBM Corp. 2005
+ * Copyright Raptor Engineering, LLC
+ *
+ * Authors: Jimi Xenidis <jimix@watson.ibm.com>
+ *          Shawn Anastasio <sanastasio@raptorengineering.com>
+ */
+
+#ifndef _ASM_PPC_MSR_H
+#define _ASM_PPC_MSR_H
+
+#include <xen/const.h>
+
+/* Flags in MSR: */
+#define MSR_SF      _AC(0x8000000000000000, ULL)
+#define MSR_TA      _AC(0x4000000000000000, ULL)
+#define MSR_ISF     _AC(0x2000000000000000, ULL)
+#define MSR_HV      _AC(0x1000000000000000, ULL)
+#define MSR_VMX     _AC(0x0000000002000000, ULL)
+#define MSR_MER     _AC(0x0000000000200000, ULL)
+#define MSR_POW     _AC(0x0000000000040000, ULL)
+#define MSR_ILE     _AC(0x0000000000010000, ULL)
+#define MSR_EE      _AC(0x0000000000008000, ULL)
+#define MSR_PR      _AC(0x0000000000004000, ULL)
+#define MSR_FP      _AC(0x0000000000002000, ULL)
+#define MSR_ME      _AC(0x0000000000001000, ULL)
+#define MSR_FE0     _AC(0x0000000000000800, ULL)
+#define MSR_SE      _AC(0x0000000000000400, ULL)
+#define MSR_BE      _AC(0x0000000000000200, ULL)
+#define MSR_FE1     _AC(0x0000000000000100, ULL)
+#define MSR_IP      _AC(0x0000000000000040, ULL)
+#define MSR_IR      _AC(0x0000000000000020, ULL)
+#define MSR_DR      _AC(0x0000000000000010, ULL)
+#define MSR_PMM     _AC(0x0000000000000004, ULL)
+#define MSR_RI      _AC(0x0000000000000002, ULL)
+#define MSR_LE      _AC(0x0000000000000001, ULL)
+
+/* MSR bits set on the systemsim simulator */
+#define MSR_SIM       _AC(0x0000000020000000, ULL)
+#define MSR_SYSTEMSIM _AC(0x0000000010000000, ULL)
+
+/* On a trap, srr1's copy of msr defines some bits as follows: */
+#define MSR_TRAP_FE     _AC(0x0000000000100000, ULL) /* Floating Point E=
xception */
+#define MSR_TRAP_IOP    _AC(0x0000000000080000, ULL) /* Illegal Instruct=
ion */
+#define MSR_TRAP_PRIV   _AC(0x0000000000040000, ULL) /* Privileged Instr=
uction */
+#define MSR_TRAP        _AC(0x0000000000020000, ULL) /* Trap Instruction=
 */
+#define MSR_TRAP_NEXT   _AC(0x0000000000010000, ULL) /* PC is next instr=
uction */
+#define MSR_TRAP_BITS  (MSR_TRAP_FE|MSR_TRAP_IOP|MSR_TRAP_PRIV|MSR_TRAP)
+
+#endif /* _ASM_PPC_MSR_H */
diff --git a/xen/arch/ppc/include/asm/processor.h b/xen/arch/ppc/include/=
asm/processor.h
new file mode 100644
index 0000000000..838d279508
--- /dev/null
+++ b/xen/arch/ppc/include/asm/processor.h
@@ -0,0 +1,138 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright IBM Corp. 2005, 2006, 2007
+ * Copyright Raptor Engineering, LLC
+ *
+ * Authors: Hollis Blanchard <hollisb@us.ibm.com>
+ *          Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
+ *          Timothy Pearson <tpearson@raptorengineering.com>
+ *          Shawn Anastasio <sanastasio@raptorengineering.com>
+ */
+
+#ifndef _ASM_PPC_PROCESSOR_H
+#define _ASM_PPC_PROCESSOR_H
+
+#define IOBMP_BYTES          8192
+#define IOBMP_INVALID_OFFSET 0x8000
+
+/* Processor Version Register (PVR) field extraction */
+
+#define PVR_VER(pvr) (((pvr) >> 16) & 0xFFFF) /* Version field */
+#define PVR_REV(pvr) (((pvr) >> 0) & 0xFFFF)  /* Revison field */
+
+#define __is_processor(pv) (PVR_VER(mfspr(SPRN_PVR)) =3D=3D (pv))
+
+/*
+ * IBM has further subdivided the standard PowerPC 16-bit version and
+ * revision subfields of the PVR for the PowerPC 403s into the following=
:
+ */
+
+#define PVR_FAM(pvr)  (((pvr) >> 20) & 0xFFF) /* Family field */
+#define PVR_MEM(pvr)  (((pvr) >> 16) & 0xF)   /* Member field */
+#define PVR_CORE(pvr) (((pvr) >> 12) & 0xF)   /* Core field */
+#define PVR_CFG(pvr)  (((pvr) >> 8) & 0xF)    /* Configuration field */
+#define PVR_MAJ(pvr)  (((pvr) >> 4) & 0xF)    /* Major revision field */
+#define PVR_MIN(pvr)  (((pvr) >> 0) & 0xF)    /* Minor revision field */
+
+/* Processor Version Numbers */
+
+#define PVR_403GA    0x00200000
+#define PVR_403GB    0x00200100
+#define PVR_403GC    0x00200200
+#define PVR_403GCX   0x00201400
+#define PVR_405GP    0x40110000
+#define PVR_STB03XXX 0x40310000
+#define PVR_NP405H   0x41410000
+#define PVR_NP405L   0x41610000
+#define PVR_601      0x00010000
+#define PVR_602      0x00050000
+#define PVR_603      0x00030000
+#define PVR_603e     0x00060000
+#define PVR_603ev    0x00070000
+#define PVR_603r     0x00071000
+#define PVR_604      0x00040000
+#define PVR_604e     0x00090000
+#define PVR_604r     0x000A0000
+#define PVR_620      0x00140000
+#define PVR_740      0x00080000
+#define PVR_750      PVR_740
+#define PVR_740P     0x10080000
+#define PVR_750P     PVR_740P
+#define PVR_7400     0x000C0000
+#define PVR_7410     0x800C0000
+#define PVR_7450     0x80000000
+#define PVR_8540     0x80200000
+#define PVR_8560     0x80200000
+/*
+ * For the 8xx processors, all of them report the same PVR family for
+ * the PowerPC core. The various versions of these processors must be
+ * differentiated by the version number in the Communication Processor
+ * Module (CPM).
+ */
+#define PVR_821  0x00500000
+#define PVR_823  PVR_821
+#define PVR_850  PVR_821
+#define PVR_860  PVR_821
+#define PVR_8240 0x00810100
+#define PVR_8245 0x80811014
+#define PVR_8260 PVR_8240
+
+/* 64-bit processors */
+#define PVR_NORTHSTAR 0x0033
+#define PVR_PULSAR    0x0034
+#define PVR_POWER4    0x0035
+#define PVR_ICESTAR   0x0036
+#define PVR_SSTAR     0x0037
+#define PVR_POWER4p   0x0038
+#define PVR_970       0x0039
+#define PVR_POWER5    0x003A
+#define PVR_POWER5p   0x003B
+#define PVR_970FX     0x003C
+#define PVR_POWER6    0x003E
+#define PVR_POWER7    0x003F
+#define PVR_630       0x0040
+#define PVR_630p      0x0041
+#define PVR_970MP     0x0044
+#define PVR_970GX     0x0045
+#define PVR_POWER7p   0x004A
+#define PVR_POWER8E   0x004B
+#define PVR_POWER8NVL 0x004C
+#define PVR_POWER8    0x004D
+#define PVR_POWER9    0x004E
+#define PVR_POWER10   0x0080
+#define PVR_BE        0x0070
+#define PVR_PA6T      0x0090
+
+#ifndef __ASSEMBLY__
+
+#include <xen/types.h>
+
+/* Macro to adjust thread priority for hardware multithreading */
+#define HMT_very_low()  asm volatile ( "or %r31, %r31, %r31" )
+
+/*
+ * User-accessible registers: most of these need to be saved/restored
+ * for every nested Xen invocation.
+ */
+struct cpu_user_regs
+{
+    uint64_t gprs[32];
+    uint64_t lr;
+    uint64_t ctr;
+    uint64_t srr0;
+    uint64_t srr1;
+    uint64_t pc;
+    uint64_t msr;
+    uint64_t fpscr;
+    uint64_t xer;
+    uint64_t hid4;  /* debug only */
+    uint64_t dar;   /* debug only */
+    uint32_t dsisr; /* debug only */
+    uint32_t cr;
+    uint32_t __pad; /* good spot for another 32bit reg */
+    uint32_t entry_vector;
+};
+
+#endif
+
+#endif /* _ASM_PPC_PROCESSOR_H */
diff --git a/xen/arch/ppc/include/asm/types.h b/xen/arch/ppc/include/asm/=
types.h
new file mode 100644
index 0000000000..cee08e111a
--- /dev/null
+++ b/xen/arch/ppc/include/asm/types.h
@@ -0,0 +1,21 @@
+/* from xen/arch/x86/include/asm/types.h */
+
+#ifndef _ASM_PPC_TYPES_H
+#define _ASM_PPC_TYPES_H
+
+typedef signed char s8;
+typedef unsigned char u8;
+
+typedef signed short s16;
+typedef unsigned short u16;
+
+typedef signed int s32;
+typedef unsigned int u32;
+
+typedef signed long s64;
+typedef unsigned long u64;
+typedef unsigned long paddr_t;
+#define INVALID_PADDR (~0UL)
+#define PRIpaddr "016lx"
+
+#endif /* _ASM_PPC_TYPES_H */
diff --git a/xen/arch/ppc/ppc64/Makefile b/xen/arch/ppc/ppc64/Makefile
index 3340058c08..f4956daaa9 100644
--- a/xen/arch/ppc/ppc64/Makefile
+++ b/xen/arch/ppc/ppc64/Makefile
@@ -1 +1,2 @@
 obj-y +=3D head.o
+obj-y +=3D of-call.o
diff --git a/xen/arch/ppc/ppc64/asm-offsets.c b/xen/arch/ppc/ppc64/asm-of=
fsets.c
index e69de29bb2..e1129cb0f4 100644
--- a/xen/arch/ppc/ppc64/asm-offsets.c
+++ b/xen/arch/ppc/ppc64/asm-offsets.c
@@ -0,0 +1,58 @@
+/*
+ * Generate definitions needed by assembly language modules.
+ * This code generates raw asm output which is post-processed
+ * to extract and format the required data.
+ */
+
+#include <xen/macros.h>
+#include <asm/processor.h>
+
+#define DEFINE(_sym, _val)                                              =
    \
+    asm volatile ( "\n.ascii\"=3D=3D>#define " #_sym " %0 /* " #_val " *=
/<=3D=3D\"" \
+                   : : "i" (_val) )
+#define BLANK()                                                         =
    \
+    asm volatile ( "\n.ascii\"=3D=3D><=3D=3D\"" : : )
+#define OFFSET(_sym, _str, _mem)                                        =
    \
+    DEFINE(_sym, offsetof(_str, _mem));
+
+/* base-2 logarithm */
+#define __L2(_x)  (((_x) & 0x00000002) ?   1 : 0)
+#define __L4(_x)  (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( =
_x))
+#define __L8(_x)  (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( =
_x))
+#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( =
_x))
+#define LOG_2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(=
_x))
+
+void __dummy__(void)
+{
+    BUILD_BUG_ON(!IS_ALIGNED(sizeof(struct cpu_user_regs), STACK_ALIGN))=
;
+
+    DEFINE(GPR_WIDTH, sizeof(unsigned long));
+    DEFINE(FPR_WIDTH, sizeof(double));
+
+    OFFSET(UREGS_gprs, struct cpu_user_regs, gprs);
+    OFFSET(UREGS_r0, struct cpu_user_regs, gprs[0]);
+    OFFSET(UREGS_r1, struct cpu_user_regs, gprs[1]);
+    OFFSET(UREGS_r13, struct cpu_user_regs, gprs[13]);
+    OFFSET(UREGS_srr0, struct cpu_user_regs, srr0);
+    OFFSET(UREGS_srr1, struct cpu_user_regs, srr1);
+    OFFSET(UREGS_pc, struct cpu_user_regs, pc);
+    OFFSET(UREGS_msr, struct cpu_user_regs, msr);
+    OFFSET(UREGS_lr, struct cpu_user_regs, lr);
+    OFFSET(UREGS_ctr, struct cpu_user_regs, ctr);
+    OFFSET(UREGS_xer, struct cpu_user_regs, xer);
+    OFFSET(UREGS_hid4, struct cpu_user_regs, hid4);
+    OFFSET(UREGS_dar, struct cpu_user_regs, dar);
+    OFFSET(UREGS_dsisr, struct cpu_user_regs, dsisr);
+    OFFSET(UREGS_cr, struct cpu_user_regs, cr);
+    OFFSET(UREGS_fpscr, struct cpu_user_regs, fpscr);
+    DEFINE(UREGS_sizeof, sizeof(struct cpu_user_regs));
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/ppc/ppc64/head.S b/xen/arch/ppc/ppc64/head.S
index 49b3066396..02ff520458 100644
--- a/xen/arch/ppc/ppc64/head.S
+++ b/xen/arch/ppc/ppc64/head.S
@@ -18,6 +18,15 @@ ENTRY(start)
     li      %r11, 0
     stdu    %r11, -STACK_FRAME_OVERHEAD(%r1)
=20
+    /* clear .bss */
+    LOAD_IMM32(%r14, __bss_start)
+    LOAD_IMM32(%r15, __bss_end)
+1:
+    std     %r11, 0(%r14)
+    addi    %r14, %r14, 8
+    cmpld   %r14, %r15
+    blt     1b
+
     /* call the C entrypoint */
     bl      start_xen
=20
diff --git a/xen/arch/ppc/ppc64/of-call.S b/xen/arch/ppc/ppc64/of-call.S
new file mode 100644
index 0000000000..2a2e308f6b
--- /dev/null
+++ b/xen/arch/ppc/ppc64/of-call.S
@@ -0,0 +1,83 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Adapted from Linux's arch/powerpc/kernel/entry_64.S, with the
+ * following copyright notice:
+ *
+ *  PowerPC version
+ *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
+ *  Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
+ *    Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
+ *  Adapted for Power Macintosh by Paul Mackerras.
+ *  Low-level exception handlers and MMU support
+ *  rewritten by Paul Mackerras.
+ *    Copyright (C) 1996 Paul Mackerras.
+ *  MPC8xx modifications Copyright (C) 1997 Dan Malek (dmalek@jlc.net).
+ */
+
+#include <asm/asm-offsets.h>
+#include <asm/asm-defns.h>
+#include <asm/msr.h>
+
+/* size of minimum stack frame that can hold an entire cpu_user_regs str=
uct */
+#define STACK_SWITCH_FRAME_SIZE UREGS_sizeof
+
+    .section .init.text, "ax", @progbits
+
+ENTRY(enter_of)
+    mflr    %r0
+    std     %r0, 16(%r1)
+    stdu    %r1, -STACK_SWITCH_FRAME_SIZE(%r1) /* Save SP and create sta=
ck space */
+
+    /*
+     * Because PROM is running in 32b mode, it clobbers the high order h=
alf
+     * of all registers that it saves.  We therefore save those register=
s
+     * PROM might touch to the stack.  (%r0, %r3-%r13 are caller saved)
+     */
+    SAVE_GPR(2, %r1)
+    SAVE_GPR(13, %r1)
+    SAVE_NVGPRS(%r1)
+    mfcr    %r10
+    mfmsr   %r11
+    std     %r10, UREGS_cr(%r1)
+    std     %r11, UREGS_msr(%r1)
+
+    /* Put PROM address in SRR0 */
+    mtsrr0  %r4
+
+    /* Setup our trampoline return addr in LR */
+    bcl     20, 31, .+4
+0:  mflr    %r4
+    addi    %r4, %r4, 1f - 0b
+    mtlr    %r4
+
+    /* Prepare a 32-bit mode big endian MSR */
+    LOAD_IMM64(%r12, MSR_SF | MSR_LE)
+    andc    %r11, %r11, %r12
+    mtsrr1  %r11
+    rfid
+
+1:  /* Return from OF */
+    FIXUP_ENDIAN
+
+    /* Just make sure that %r1 top 32 bits didn't get corrupt by OF */
+    rldicl  %r1, %r1, 0, 32
+
+    /* Restore the MSR (back to 64 bits) */
+    ld      %r0, UREGS_msr(%r1)
+    mtmsrd  %r0
+    isync
+
+    /* Restore other registers */
+    REST_GPR(2, %r1)
+    REST_GPR(13, %r1)
+    REST_NVGPRS(%r1)
+    ld      %r4, UREGS_cr(%r1)
+    mtcr    %r4
+
+    addi    %r1, %r1, STACK_SWITCH_FRAME_SIZE
+    ld      %r0, 16(%r1)
+    mtlr    %r0
+    blr
+
+    .size enter_of, . - enter_of
+    .type enter_of, %function
diff --git a/xen/arch/ppc/setup.c b/xen/arch/ppc/setup.c
index 9e90a6179a..7c623a49f5 100644
--- a/xen/arch/ppc/setup.c
+++ b/xen/arch/ppc/setup.c
@@ -1,16 +1,29 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #include <xen/init.h>
+#include <asm/boot.h>
+#include <asm/early_printk.h>
+#include <asm/processor.h>
=20
 /* Xen stack for bringing up the first CPU. */
 unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZ=
E);
=20
-/* Macro to adjust thread priority for hardware multithreading */
-#define HMT_very_low()  asm volatile ( "or %r31, %r31, %r31" )
-
 void __init noreturn start_xen(unsigned long r3, unsigned long r4,
                                unsigned long r5, unsigned long r6,
                                unsigned long r7)
 {
+    if ( r5 )
+    {
+        /* OpenFirmware boot protocol */
+        boot_of_init(r5);
+    }
+    else
+    {
+        /* kexec boot: Unimplemented */
+        __builtin_trap();
+    }
+
+    early_printk("Hello, ppc64le!\n");
+
     for ( ; ; )
         /* Set current hardware thread to very low priority */
         HMT_very_low();
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 17:03:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 17:03:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567667.887002 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMtX6-0002wk-9a; Fri, 21 Jul 2023 17:03:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567667.887002; Fri, 21 Jul 2023 17:03:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMtX6-0002vi-5g; Fri, 21 Jul 2023 17:03:12 +0000
Received: by outflank-mailman (input) for mailman id 567667;
 Fri, 21 Jul 2023 17:03:11 +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
 <SRS0=NI5b=DH=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qMtX5-0002su-2M
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 17:03:11 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7735ddd6-27e8-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 19:03:08 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id A9EF38285A38;
 Fri, 21 Jul 2023 12:03:07 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id l0yDkxV9icTe; Fri, 21 Jul 2023 12:03:06 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id A766C82854B9;
 Fri, 21 Jul 2023 12:03:06 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id 48LnXrMlU6Zm; Fri, 21 Jul 2023 12:03:06 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 45715828595C;
 Fri, 21 Jul 2023 12:03:06 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7735ddd6-27e8-11ee-8611-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com A766C82854B9
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1689958986; bh=5BKPx6suFK1+ADUkLZOgesyhysDJmQwNfyKldiRHhA4=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=SURVH41qAVPMC5b5EA14Bdc9QA9CBTpegQPILnyETN2hFEBtoNjwhatpgAtHh9OF6
	 xlBHXdEU9UhAMWhij8jPkceWcAKRtSwa2MdY86Lpu5U7uaL2tID+GBXVjXdJ6D0a8k
	 iF5lXhKKalAfyN8KS0vVOHS8iP+p7MyENxEH8hK0=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v5 1/4] common: Move a few more standalone macros from xen/lib.h to xen/macros.h
Date: Fri, 21 Jul 2023 12:02:52 -0500
Message-Id: <4f4d87438933b39859f8e3e8009092056fe8c885.1689958538.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1689958538.git.sanastasio@raptorengineering.com>
References: <cover.1689958538.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Move a few more macros which have no dependencies on other headers from
xen/lib.h to xen/macros.h. Notably, this includes BUILD_BUG_ON* and
ARRAY_SIZE.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/lib.h    | 28 ----------------------------
 xen/include/xen/macros.h | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 28 deletions(-)

diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index dae2a1f085..359cfdc784 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -21,24 +21,6 @@
     unlikely(ret_warn_on_);             \
 })
=20
-/* All clang versions supported by Xen have _Static_assert. */
-#if defined(__clang__) || \
-    (__GNUC__ > 4 || (__GNUC__ =3D=3D 4 && __GNUC_MINOR__ >=3D 6))
-/* Force a compilation error if condition is true */
-#define BUILD_BUG_ON(cond) ({ _Static_assert(!(cond), "!(" #cond ")"); }=
)
-
-/* Force a compilation error if condition is true, but also produce a
-   result (of value 0 and type size_t), so the expression can be used
-   e.g. in a structure initializer (or where-ever else comma expressions
-   aren't permitted). */
-#define BUILD_BUG_ON_ZERO(cond) \
-    (sizeof(struct { char c; _Static_assert(!(cond), "!(" #cond ")"); })=
 & 0)
-#else
-#define BUILD_BUG_ON_ZERO(cond) \
-    (sizeof(struct { unsigned u : !(cond); }) & 0)
-#define BUILD_BUG_ON(cond) ((void)BUILD_BUG_ON_ZERO(cond))
-#endif
-
 #ifndef NDEBUG
 #define ASSERT(p) \
     do { if ( unlikely(!(p)) ) assert_failed(#p); } while (0)
@@ -48,16 +30,6 @@
 #define ASSERT_UNREACHABLE() do { } while (0)
 #endif
=20
-#define ABS(_x) ({                              \
-    typeof(_x) __x =3D (_x);                      \
-    (__x < 0) ? -__x : __x;                     \
-})
-
-#define SWAP(_a, _b) \
-   do { typeof(_a) _t =3D (_a); (_a) =3D (_b); (_b) =3D _t; } while ( 0 =
)
-
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]) + __must_be_array(x))
-
 #define __ACCESS_ONCE(x) ({                             \
             (void)(typeof(x))0; /* Scalar typecheck. */ \
             (volatile typeof(x) *)&(x); })
diff --git a/xen/include/xen/macros.h b/xen/include/xen/macros.h
index 7b92d34504..d0caae7db2 100644
--- a/xen/include/xen/macros.h
+++ b/xen/include/xen/macros.h
@@ -22,6 +22,40 @@
 #define __STR(...) #__VA_ARGS__
 #define STR(...) __STR(__VA_ARGS__)
=20
+#ifndef __ASSEMBLY__
+
+/* All clang versions supported by Xen have _Static_assert. */
+#if defined(__clang__) || \
+    (__GNUC__ > 4 || (__GNUC__ =3D=3D 4 && __GNUC_MINOR__ >=3D 6))
+/* Force a compilation error if condition is true */
+#define BUILD_BUG_ON(cond) ({ _Static_assert(!(cond), "!(" #cond ")"); }=
)
+
+/*
+ * Force a compilation error if condition is true, but also produce a
+ * result (of value 0 and type size_t), so the expression can be used
+ * e.g. in a structure initializer (or where-ever else comma expressions
+ * aren't permitted).
+ */
+#define BUILD_BUG_ON_ZERO(cond) \
+    (sizeof(struct { char c; _Static_assert(!(cond), "!(" #cond ")"); })=
 & 0)
+#else
+#define BUILD_BUG_ON_ZERO(cond) \
+    (sizeof(struct { unsigned u : !(cond); }) & 0)
+#define BUILD_BUG_ON(cond) ((void)BUILD_BUG_ON_ZERO(cond))
+#endif
+
+#define ABS(x) ({                              \
+    typeof(x) x_ =3D (x);                        \
+    (x_ < 0) ? -x_ : x_;                       \
+})
+
+#define SWAP(a, b) \
+   do { typeof(a) t_ =3D (a); (a) =3D (b); (b) =3D t_; } while ( 0 )
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]) + __must_be_array(x))
+
+#endif /* __ASSEMBLY__ */
+
 #endif /* __MACROS_H__ */
=20
 /*
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 17:03:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 17:03:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567668.887018 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMtX7-0003Mr-FJ; Fri, 21 Jul 2023 17:03:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567668.887018; Fri, 21 Jul 2023 17:03:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMtX7-0003Mk-CI; Fri, 21 Jul 2023 17:03:13 +0000
Received: by outflank-mailman (input) for mailman id 567668;
 Fri, 21 Jul 2023 17:03:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=NI5b=DH=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qMtX5-0002st-Lj
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 17:03:11 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 78305254-27e8-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 19:03:10 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 78E5A828597B;
 Fri, 21 Jul 2023 12:03:09 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id F6KNfYDGUPNK; Fri, 21 Jul 2023 12:03:09 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id DAF03828595C;
 Fri, 21 Jul 2023 12:03:08 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id T3UZyJ_-5EvO; Fri, 21 Jul 2023 12:03:08 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id A9B908285A35;
 Fri, 21 Jul 2023 12:03:07 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 78305254-27e8-11ee-b23a-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com DAF03828595C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1689958988; bh=t2XSxlE4JcYvYurr+9ZptgwwCybbDwha+GFsOD84g3s=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=HkptPHndv8brZtUT0MonN0Vk8eZkwp+Y2J6DlfOsvTzvPaAAZq+8IYcmrK8ByL/fb
	 JqurN/Q8baZqQt6XQZz3szbNwCLYcoFN8jB2QO10mTucK7SwwkKeGtOjHDQO+i+QeJ
	 YUhCNu/NMCYau+fDCrTxjXKdXxc5uKMDfRG8ZyPU=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Shawn Anastasio <sanastasio@raptorengineering.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 4/4] automation: Add smoke test for ppc64le
Date: Fri, 21 Jul 2023 12:02:55 -0500
Message-Id: <ade2e58251c506e4576424082623d9b232a435f9.1689958538.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1689958538.git.sanastasio@raptorengineering.com>
References: <cover.1689958538.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Add an initial smoke test that boots xen on a ppc64/pseries machine and
checks for a magic string. Based on the riscv smoke test.

Eventually the powernv9 (POWER9 bare metal) machine type will want to be
tested as well, but for now we only boot on pseries.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/test.yaml           | 20 ++++++++++++++++++
 automation/scripts/qemu-smoke-ppc64le.sh | 27 ++++++++++++++++++++++++
 2 files changed, 47 insertions(+)
 create mode 100755 automation/scripts/qemu-smoke-ppc64le.sh

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.y=
aml
index d5cb238b0a..45e8ddb7a3 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -71,6 +71,19 @@
   tags:
     - x86_64
=20
+.qemu-ppc64le:
+  extends: .test-jobs-common
+  variables:
+    CONTAINER: debian:bullseye-ppc64le
+    LOGFILE: qemu-smoke-ppc64le.log
+  artifacts:
+    paths:
+      - smoke.serial
+      - '*.log'
+    when: always
+  tags:
+    - x86_64
+
 .xilinx-arm64:
   extends: .test-jobs-common
   variables:
@@ -444,3 +457,10 @@ qemu-smoke-riscv64-gcc:
     - ./automation/scripts/qemu-smoke-riscv64.sh 2>&1 | tee ${LOGFILE}
   needs:
     - archlinux-current-gcc-riscv64-debug
+
+qemu-smoke-ppc64le-pseries-gcc:
+  extends: .qemu-ppc64le
+  script:
+    - ./automation/scripts/qemu-smoke-ppc64le.sh pseries-5.2 2>&1 | tee =
${LOGFILE}
+  needs:
+    - debian-bullseye-gcc-ppc64le-debug
diff --git a/automation/scripts/qemu-smoke-ppc64le.sh b/automation/script=
s/qemu-smoke-ppc64le.sh
new file mode 100755
index 0000000000..eb55221221
--- /dev/null
+++ b/automation/scripts/qemu-smoke-ppc64le.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+set -ex
+
+# machine type from first arg passed directly to qemu -M
+machine=3D$1
+
+# Run the test
+rm -f smoke.serial
+set +e
+
+touch smoke.serial
+
+timeout -k 1 20 \
+qemu-system-ppc64 \
+    -M $machine \
+    -m 2g \
+    -smp 1 \
+    -vga none \
+    -monitor none \
+    -nographic \
+    -serial file:smoke.serial \
+    -kernel binaries/xen
+
+set -e
+(grep -q "Hello, ppc64le!" smoke.serial) || exit 1
+exit 0
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 17:03:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 17:03:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567666.886998 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMtX6-0002tO-12; Fri, 21 Jul 2023 17:03:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567666.886998; Fri, 21 Jul 2023 17:03:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMtX5-0002tH-UP; Fri, 21 Jul 2023 17:03:11 +0000
Received: by outflank-mailman (input) for mailman id 567666;
 Fri, 21 Jul 2023 17:03:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=NI5b=DH=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qMtX5-0002st-0p
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 17:03:11 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 777d4183-27e8-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 19:03:09 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 153F782854B9;
 Fri, 21 Jul 2023 12:03:08 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id xnJemO2A6LkH; Fri, 21 Jul 2023 12:03:06 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 58EA0828597B;
 Fri, 21 Jul 2023 12:03:06 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id 4WoZ_PJhEpRB; Fri, 21 Jul 2023 12:03:06 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id D2BCB82854B9;
 Fri, 21 Jul 2023 12:03:05 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 777d4183-27e8-11ee-b23a-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 58EA0828597B
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1689958986; bh=ZDv3g81mkdDkqDVPk78c0dBzMiqZjC3nBfH519h+Fc4=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=nXyb8unvKcItCZSibarWJzCADfl6p/fNigKNLYVPtlTKgkrZcFGmekanxmhRNtMKn
	 j3Cl2y+43QtyBJERspeK9bCRqBxwM1mBFDqaQgHIBKVm/5oFjd7T7OBrz9UzB2d74M
	 U1QwYY3ooranNJo8OiZiGdmFESeQd1scHX1nv/GY=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v5 0/4] Early serial on Power
Date: Fri, 21 Jul 2023 12:02:51 -0500
Message-Id: <cover.1689958538.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Hello all,

This series adds support for early serial printing on Power, as well as
a simple CI smoke test modeled after the riscv one.

The first patch is responsible for setting up a basic C environment with
an initial stack while the second sets up an Open Firmware serial console
and primitive early_printk infrastructure.

This will currently only run on QEMU pseries VMs, since the firmware
interface on bare metal differs significantly. Support for bare metal
will be added in a future series along with support for the
position-independent code model.

Thanks,
Shawn

--
Changes in v5:
  - (xen/macros.h) Add signoff
  - (xen/macros.h) Fix up comment formatting and macro parameter names
  - (*.S) Use 8-space column alignment for assembly
  - (of-call.S) Add missing space after comma
  - (asm-offsets.c) Fix DEFINE() macro formatting
  - (asm-offsets.c) Replace _Static_assert with BUILD_BUG_ON

Changes in v4:
  - Add macros.h patch for ARRAY_SIZE
    - Based on v3 of Jan's "common: move a few macros out of xen/lib.h"
  - (head.S) Remove unnecessary '.section .init.data'
  - (head.S) Fixup spacing, remove unnecessary parens
  - (setup.c, processor.h) Fix style of HMT_very_low macro
  - (early_printk.c) Build early_printk.c as .init.o
  - (early_printk.c) Mark putchar_func as __initdata
  - (boot-of.c) Clarify original license in top comment
  - (boot-of.c) Add parens around ADDR macro definition
  - (boot-of.c) Add missing ADDR() for pointer arguments
  - (boot-of.c) Add comment explaining ADDR macro
  - (boot-of.c) Fix style (indentation, comment capitalization)
  - (boot-of.c) Fix type inconsistency in boot-of.c
  - (boot-of.c) Use ARRAY_SIZE instead of hard-coding nrets
  - (boot-of.c) Change bof_chosen variable to function-scope
  - (processor.h) Remove duplicate <xen/types.h> include
  - (processor.h) Remove unnecessary <xen/config.h> include
  - (processor.h) Move HMT_very_low macro to !defined(ASSEMBLY) block
  - (processor.h) Fixup struct cpu_user_regs comment style

Changes in v3:
  - Set up r2 TOC pointer in start
  - Change indirect call to start_xen to a direct one
  - Use 32-bit constant loads for stack pointer, etc. in start
      - Our load address is < 4GB so this works fine
      - In a future series we'll get -fPIC working and change all of
        these immediate address loads to TOC-relative ones.
  - Move .bss initialization to patch 2
  - Move cpu0_boot_stack declaration to setup.c
  - Bump stack size down to one page (64k), previous was way overkill.
  - Remove unnecessary STACK_FRAME_OVERHEAD component from of-call.S
    stack frame size calculation
  - Add assertion that `struct cpu_user_regs` is stack-aligned
  - Move magic `or 31,31,31` to appropriately-named macro
  - Fix formatting of loop in setup.c
  - Add newline in arch/ppc/Makefile to preserve alphabetical ordering
    per group
  - Rebase on staging, including the final version of
    'xen/types: Rework stdint vs __{u,s}$N types'

Changes in v2:
  - Split main patch into two - one for basic C environment setup and
    one for serial
  - Mark OpenFirmware functions and early_printk functions as __init and
    change boot-of.o to boot-of.init.o in Makefile
  - Change <xen/lib.h> include to <xen/stdarg.h> and drop skeleton
    headers that are no longer necessary for build as a result
  - Add loop to clear .bss before jumping to C environment that was
    accidentally excluded from the first series
  - Move common asm macros from processor.h to asm-defns.h
  - Change note in head.S about preserved registers to a multi-line
    comment so it's more noticeable
  - Drop reg-defs.h and use '%'-prefixed register names in assembly
      - This is necessary since -mregnames, which allows standard
        non-prefixed register names without manual macro definitions,
        is not supported by LLVM's assembler.
  - Drop inline asm swab routines in favor of __builtin_bswap family
  - Fix up types.h in accordance with (as of now, unmerged)
    'xen/types: Rework stdint vs __{u,s}$N types'
  - Remove unnecessary braces for single-line statements
  - Remove unnecessary license text when SPDX header is present
  - Fix alphabetical ordering of object declarations in Makefile
  - Drop 'extern' from enter_of prototype, ensure prototypes have
    argument names

Shawn Anastasio (4):
  common: Move a few more standalone macros from xen/lib.h to
    xen/macros.h
  xen/ppc: Set up a basic C environment
  xen/ppc: Implement early serial printk on pseries
  automation: Add smoke test for ppc64le

 automation/gitlab-ci/test.yaml           |  20 ++++
 automation/scripts/qemu-smoke-ppc64le.sh |  27 +++++
 xen/arch/ppc/Kconfig.debug               |   5 +
 xen/arch/ppc/Makefile                    |   4 +
 xen/arch/ppc/boot-of.c                   | 113 +++++++++++++++++++
 xen/arch/ppc/configs/ppc64_defconfig     |   1 +
 xen/arch/ppc/early_printk.c              |  28 +++++
 xen/arch/ppc/include/asm/asm-defns.h     |  57 ++++++++++
 xen/arch/ppc/include/asm/boot.h          |  23 ++++
 xen/arch/ppc/include/asm/byteorder.h     |  12 ++
 xen/arch/ppc/include/asm/config.h        |   5 +-
 xen/arch/ppc/include/asm/early_printk.h  |  15 +++
 xen/arch/ppc/include/asm/msr.h           |  51 +++++++++
 xen/arch/ppc/include/asm/processor.h     | 138 +++++++++++++++++++++++
 xen/arch/ppc/include/asm/types.h         |  21 ++++
 xen/arch/ppc/ppc64/Makefile              |   1 +
 xen/arch/ppc/ppc64/asm-offsets.c         |  58 ++++++++++
 xen/arch/ppc/ppc64/head.S                |  47 ++++----
 xen/arch/ppc/ppc64/of-call.S             |  83 ++++++++++++++
 xen/arch/ppc/setup.c                     |  32 ++++++
 xen/include/xen/lib.h                    |  28 -----
 xen/include/xen/macros.h                 |  34 ++++++
 22 files changed, 754 insertions(+), 49 deletions(-)
 create mode 100755 automation/scripts/qemu-smoke-ppc64le.sh
 create mode 100644 xen/arch/ppc/boot-of.c
 create mode 100644 xen/arch/ppc/early_printk.c
 create mode 100644 xen/arch/ppc/include/asm/asm-defns.h
 create mode 100644 xen/arch/ppc/include/asm/boot.h
 create mode 100644 xen/arch/ppc/include/asm/byteorder.h
 create mode 100644 xen/arch/ppc/include/asm/early_printk.h
 create mode 100644 xen/arch/ppc/include/asm/msr.h
 create mode 100644 xen/arch/ppc/include/asm/processor.h
 create mode 100644 xen/arch/ppc/include/asm/types.h
 create mode 100644 xen/arch/ppc/ppc64/of-call.S
 create mode 100644 xen/arch/ppc/setup.c

--
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 17:03:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 17:03:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567669.887023 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMtX7-0003Pr-Pi; Fri, 21 Jul 2023 17:03:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567669.887023; Fri, 21 Jul 2023 17:03:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMtX7-0003PL-L9; Fri, 21 Jul 2023 17:03:13 +0000
Received: by outflank-mailman (input) for mailman id 567669;
 Fri, 21 Jul 2023 17:03:11 +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
 <SRS0=NI5b=DH=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qMtX5-0002su-Nx
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 17:03:11 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 778727c0-27e8-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 19:03:09 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 568D98285A06;
 Fri, 21 Jul 2023 12:03:08 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id KqJ-kWF68Ul5; Fri, 21 Jul 2023 12:03:07 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 15E41828595C;
 Fri, 21 Jul 2023 12:03:07 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id D5wmjkLXSz4k; Fri, 21 Jul 2023 12:03:06 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 9F92882859FC;
 Fri, 21 Jul 2023 12:03:06 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 778727c0-27e8-11ee-8611-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 15E41828595C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1689958987; bh=ot5Ie8UdNaBUzL6s4Mi2/vuXyjwBSH6uhSdPEOjpn9g=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=RRiv+VvCP3dHBFwfujo6kiiJo/OT/XamwmEcBq654mWbgKxTOcNUPMPmLMFfqRh6V
	 VanEdHWFIdM06YGvIay0AL2LRVfYgg3pnlNDH9RLbNIjJN6p1ch8Nyxvv+Kkyxl6Ag
	 tHtY8m+30eMqLe8hJ0rlYFvqPO5hyQW8IV1iMgAU=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v5 2/4] xen/ppc: Set up a basic C environment
Date: Fri, 21 Jul 2023 12:02:53 -0500
Message-Id: <27548375e29c56d87f08be800e38fb85c650568a.1689958538.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1689958538.git.sanastasio@raptorengineering.com>
References: <cover.1689958538.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Update ppc64/head.S to set up an initial boot stack, zero the .bss
section, and jump to C. The required setup is done using 32-bit
immediate address loads for now, but they will be changed to
TOC-relative loads once the position-independent code model is enabled.

Additionally, move the cpu0_boot_stack declaration to setup.c and change
STACK_ORDER from 2 to 0. For now, ppc64 is using 64k pages and thus the
larger STACK_ORDER is unnecessary.

Finally, refactor the endian fixup trampoline into its own macro, since i=
t
will need to be used in multiple places, including every time we make a
call into firmware.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/ppc/Makefile                |  2 ++
 xen/arch/ppc/include/asm/asm-defns.h | 40 ++++++++++++++++++++++++++++
 xen/arch/ppc/include/asm/config.h    |  2 +-
 xen/arch/ppc/ppc64/head.S            | 38 +++++++++++++-------------
 xen/arch/ppc/setup.c                 | 19 +++++++++++++
 5 files changed, 80 insertions(+), 21 deletions(-)
 create mode 100644 xen/arch/ppc/include/asm/asm-defns.h
 create mode 100644 xen/arch/ppc/setup.c

diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index 98220648af..530fba2121 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -1,5 +1,7 @@
 obj-$(CONFIG_PPC64) +=3D ppc64/
=20
+obj-y +=3D setup.o
+
 $(TARGET): $(TARGET)-syms
 	cp -f $< $@
=20
diff --git a/xen/arch/ppc/include/asm/asm-defns.h b/xen/arch/ppc/include/=
asm/asm-defns.h
new file mode 100644
index 0000000000..6ea35f6edb
--- /dev/null
+++ b/xen/arch/ppc/include/asm/asm-defns.h
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef _ASM_PPC_ASM_DEFNS_H
+#define _ASM_PPC_ASM_DEFNS_H
+
+/*
+ * Load a 64-bit immediate value into the specified GPR.
+ */
+#define LOAD_IMM64(reg, val)                                            =
     \
+    lis reg, (val) @highest;                                            =
     \
+    ori reg, reg, (val) @higher;                                        =
     \
+    rldicr reg, reg, 32, 31;                                            =
     \
+    oris reg, reg, (val) @h;                                            =
     \
+    ori reg, reg, (val) @l;
+
+#define LOAD_IMM32(reg, val)                                            =
     \
+    lis reg, (val) @h;                                                  =
     \
+    ori reg, reg, (val) @l;                                             =
     \
+
+/*
+ * Depending on how we were booted, the CPU could be running in either
+ * Little Endian or Big Endian mode. The following trampoline from Linux
+ * cleverly uses an instruction that encodes to a NOP if the CPU's
+ * endianness matches the assumption of the assembler (LE, in our case)
+ * or a branch to code that performs the endian switch in the other case=
.
+ */
+#define FIXUP_ENDIAN                                                    =
       \
+    tdi 0, 0, 0x48;   /* Reverse endian of b . + 8          */          =
       \
+    b . + 44;         /* Skip trampoline if endian is good  */          =
       \
+    .long 0xa600607d; /* mfmsr r11                          */          =
       \
+    .long 0x01006b69; /* xori r11,r11,1                     */          =
       \
+    .long 0x00004039; /* li r10,0                           */          =
       \
+    .long 0x6401417d; /* mtmsrd r10,1                       */          =
       \
+    .long 0x05009f42; /* bcl 20,31,$+4                      */          =
       \
+    .long 0xa602487d; /* mflr r10                           */          =
       \
+    .long 0x14004a39; /* addi r10,r10,20                    */          =
       \
+    .long 0xa6035a7d; /* mtsrr0 r10                         */          =
       \
+    .long 0xa6037b7d; /* mtsrr1 r11                         */          =
       \
+    .long 0x2400004c  /* rfid                               */
+
+#endif /* _ASM_PPC_ASM_DEFNS_H */
diff --git a/xen/arch/ppc/include/asm/config.h b/xen/arch/ppc/include/asm=
/config.h
index b9a6814f00..01ca5d0803 100644
--- a/xen/arch/ppc/include/asm/config.h
+++ b/xen/arch/ppc/include/asm/config.h
@@ -43,7 +43,7 @@
=20
 #define SMP_CACHE_BYTES (1 << 6)
=20
-#define STACK_ORDER 2
+#define STACK_ORDER 0
 #define STACK_SIZE  (PAGE_SIZE << STACK_ORDER)
=20
 /* 288 bytes below the stack pointer must be preserved by interrupt hand=
lers */
diff --git a/xen/arch/ppc/ppc64/head.S b/xen/arch/ppc/ppc64/head.S
index 2fcefb40d8..49b3066396 100644
--- a/xen/arch/ppc/ppc64/head.S
+++ b/xen/arch/ppc/ppc64/head.S
@@ -1,30 +1,28 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
=20
+#include <asm/asm-defns.h>
+
     .section .text.header, "ax", %progbits
=20
 ENTRY(start)
     /*
-     * Depending on how we were booted, the CPU could be running in eith=
er
-     * Little Endian or Big Endian mode. The following trampoline from L=
inux
-     * cleverly uses an instruction that encodes to a NOP if the CPU's
-     * endianness matches the assumption of the assembler (LE, in our ca=
se)
-     * or a branch to code that performs the endian switch in the other =
case.
+     * NOTE: argument registers (r3-r9) must be preserved until the C en=
trypoint
      */
-    tdi 0, 0, 0x48    /* Reverse endian of b . + 8          */
-    b . + 44          /* Skip trampoline if endian is good  */
-    .long 0xa600607d  /* mfmsr r11                          */
-    .long 0x01006b69  /* xori r11,r11,1                     */
-    .long 0x00004039  /* li r10,0                           */
-    .long 0x6401417d  /* mtmsrd r10,1                       */
-    .long 0x05009f42  /* bcl 20,31,$+4                      */
-    .long 0xa602487d  /* mflr r10                           */
-    .long 0x14004a39  /* addi r10,r10,20                    */
-    .long 0xa6035a7d  /* mtsrr0 r10                         */
-    .long 0xa6037b7d  /* mtsrr1 r11                         */
-    .long 0x2400004c  /* rfid                               */
-
-    /* Now that the endianness is confirmed, continue */
-1:  b 1b
+    FIXUP_ENDIAN
+
+    /* set up the TOC pointer */
+    LOAD_IMM32(%r2, .TOC.)
+
+    /* set up the initial stack */
+    LOAD_IMM32(%r1, cpu0_boot_stack)
+    li      %r11, 0
+    stdu    %r11, -STACK_FRAME_OVERHEAD(%r1)
+
+    /* call the C entrypoint */
+    bl      start_xen
+
+    /* should never return */
+    trap
=20
     .size start, . - start
     .type start, %function
diff --git a/xen/arch/ppc/setup.c b/xen/arch/ppc/setup.c
new file mode 100644
index 0000000000..9e90a6179a
--- /dev/null
+++ b/xen/arch/ppc/setup.c
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#include <xen/init.h>
+
+/* Xen stack for bringing up the first CPU. */
+unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZ=
E);
+
+/* Macro to adjust thread priority for hardware multithreading */
+#define HMT_very_low()  asm volatile ( "or %r31, %r31, %r31" )
+
+void __init noreturn start_xen(unsigned long r3, unsigned long r4,
+                               unsigned long r5, unsigned long r6,
+                               unsigned long r7)
+{
+    for ( ; ; )
+        /* Set current hardware thread to very low priority */
+        HMT_very_low();
+
+    unreachable();
+}
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 17:05:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 17:05:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567683.887048 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMtZk-0005iw-Jc; Fri, 21 Jul 2023 17:05:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567683.887048; Fri, 21 Jul 2023 17:05:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMtZk-0005ip-Gq; Fri, 21 Jul 2023 17:05:56 +0000
Received: by outflank-mailman (input) for mailman id 567683;
 Fri, 21 Jul 2023 17:05:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMtZi-0005ig-NK
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 17:05:54 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMtZh-0003OG-Lf; Fri, 21 Jul 2023 17:05:53 +0000
Received: from 54-240-197-231.amazon.com ([54.240.197.231]
 helo=[192.168.21.208]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMtZh-0006oj-DX; Fri, 21 Jul 2023 17:05:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=MjAeznATP3VrlhETPWNmDUS5qb+UQitxxgR3yd6/7vg=; b=Y63uFTa/o8+kUMi+LjMStIzdj3
	dqHjmpqCveW6mA+LwFOgR4nSB7YP8tkZrtkjasguKnZL7yhWlWDcKNYrbe9Vj9k57BHVQky97I3wD
	bYuUsWyqWDvg+nN3BtM7DUJHlCi/0ESMnrZyp2Ib0K6BWQ0VTn6/Gc4KrA57uCZuG7As=;
Message-ID: <1eb58b83-87ee-d738-08b0-948a8b48773a@xen.org>
Date: Fri, 21 Jul 2023 18:05:51 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH 6/8] mm/pdx: Standardize region validation wrt pdx
 compression
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>,
 George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-7-alejandro.vallejo@cloud.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230717160318.2113-7-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Alejandro,

On 17/07/2023 17:03, Alejandro Vallejo wrote:
> Regions must be occasionally validated for pdx compression validity. That
> is, whether any of the machine addresses spanning the region have a bit set
> in the pdx "hole" (which is expected to always contain zeroes). There are
> a few such tests through the code, and they all check for different things.
> 
> This patch replaces all such occurences with a call to a centralized

Typo: s/occurences/occurrences/

> function that checks a region for validity.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> ---
>   xen/arch/x86/x86_64/mm.c |  2 +-
>   xen/common/efi/boot.c    |  6 +++---
>   xen/common/pdx.c         | 13 +++++++++++--
>   xen/include/xen/pdx.h    |  9 +++++++++
>   4 files changed, 24 insertions(+), 6 deletions(-)
> 
> diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
> index 60db439af3..914e65c26c 100644
> --- a/xen/arch/x86/x86_64/mm.c
> +++ b/xen/arch/x86/x86_64/mm.c
> @@ -1168,7 +1168,7 @@ static int mem_hotadd_check(unsigned long spfn, unsigned long epfn)
>       if ( (spfn | epfn) & ((1UL << PAGETABLE_ORDER) - 1) )
>           return 0;
>   
> -    if ( (spfn | epfn) & pfn_hole_mask )
> +    if ( !pdx_is_region_compressible(spfn, epfn) )
>           return 0;
>   
>       /* Make sure the new range is not present now */
> diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
> index 24169b7b50..b098a8c030 100644
> --- a/xen/common/efi/boot.c
> +++ b/xen/common/efi/boot.c
> @@ -14,6 +14,7 @@
>   #include <xen/multiboot.h>
>   #include <xen/param.h>
>   #include <xen/pci_regs.h>
> +#include <xen/pdx.h>
>   #include <xen/pfn.h>
>   #if EFI_PAGE_SIZE != PAGE_SIZE
>   # error Cannot use xen/pfn.h here!
> @@ -1647,7 +1648,7 @@ static bool __init cf_check ram_range_valid(unsigned long smfn, unsigned long em
>   {
>       unsigned long sz = pfn_to_pdx(emfn - 1) / PDX_GROUP_COUNT + 1;
>   
> -    return !(smfn & pfn_hole_mask) &&
> +    return pdx_is_region_compressible(smfn, emfn) &&
>              find_next_bit(pdx_group_valid, sz,
>                            pfn_to_pdx(smfn) / PDX_GROUP_COUNT) < sz;
>   }
> @@ -1759,8 +1760,7 @@ void __init efi_init_memory(void)
>               prot |= _PAGE_NX;
>   
>           if ( pfn_to_pdx(emfn - 1) < (DIRECTMAP_SIZE >> PAGE_SHIFT) &&
> -             !(smfn & pfn_hole_mask) &&
> -             !((smfn ^ (emfn - 1)) & ~pfn_pdx_bottom_mask) )
> +             pdx_is_region_compressible(smfn, emfn))
>           {
>               if ( (unsigned long)mfn_to_virt(emfn - 1) >= HYPERVISOR_VIRT_END )
>                   prot &= ~_PAGE_GLOBAL;
> diff --git a/xen/common/pdx.c b/xen/common/pdx.c
> index 99d4a90a50..72845e4bab 100644
> --- a/xen/common/pdx.c
> +++ b/xen/common/pdx.c
> @@ -88,7 +88,7 @@ bool __mfn_valid(unsigned long mfn)
>   }
>   
>   /* Sets all bits from the most-significant 1-bit down to the LSB */
> -static uint64_t __init fill_mask(uint64_t mask)
> +static uint64_t fill_mask(uint64_t mask)
>   {
>       while (mask & (mask + 1))
>           mask |= mask + 1;
> @@ -96,6 +96,15 @@ static uint64_t __init fill_mask(uint64_t mask)
>       return mask;
>   }
>   
> +bool pdx_is_region_compressible(unsigned long smfn, unsigned long emfn)

For newer interface, I would rather prefer if we use start + size. It is 
easier to reason (you don't have to wonder whether 'emfn' is inclusive 
or not) and avoid issue in the case you are trying to handle a region 
right at the end of the address space as emfn would be 0 in the 
non-inclusive case (not much a concern for MFNs as the last one should 
be invalid, but it makes harder to reason).

> +{
> +    uint64_t base = smfn << PAGE_SHIFT;

On Arm32, physical address are up to 40-bit. So you want to cast smfn to 
uint64_t before shifting. That said, it would be best to use 
pfn_to_paddr() and possibly switch to paddr_t for the type.

Note that I understand that the rest of the PDX code is using uint64_t. 
So I would be ok if you don't want to switch to paddr_t.

> +    uint64_t len = (emfn - smfn) << PAGE_SHIFT;

Same here.

> +
> +    return !(smfn & pfn_hole_mask) &&
> +           !(pdx_region_mask(base, len) & ~ma_va_bottom_mask);
> +}
> +
>   /* We don't want to compress the low MAX_ORDER bits of the addresses. */
>   uint64_t __init pdx_init_mask(uint64_t base_addr)
>   {
> @@ -103,7 +112,7 @@ uint64_t __init pdx_init_mask(uint64_t base_addr)
>                            (uint64_t)1 << (MAX_ORDER + PAGE_SHIFT)) - 1);
>   }
>   
> -uint64_t __init pdx_region_mask(uint64_t base, uint64_t len)
> +uint64_t pdx_region_mask(uint64_t base, uint64_t len)
>   {
>       /*
>        * We say a bit "moves" in a range if there exist 2 addresses in that
> diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h
> index f8ca0f5821..5378e664c2 100644
> --- a/xen/include/xen/pdx.h
> +++ b/xen/include/xen/pdx.h
> @@ -77,6 +77,15 @@ extern unsigned long pfn_top_mask, ma_top_mask;
>                            (sizeof(*frame_table) & -sizeof(*frame_table)))
>   extern unsigned long pdx_group_valid[];
>   
> +/**
> + * Validate a region's compatibility with the current compression runtime
> + *
> + * @param smfn Start mfn
> + * @param emfn End mfn (non-inclusive)
> + * @return True iff the region can be used with the current compression
> + */
> +bool pdx_is_region_compressible(unsigned long smfn, unsigned long emfn);
> +
>   /**
>    * Calculates a mask covering "moving" bits of all addresses of a region
>    *

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 17:17:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 17:17:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567687.887058 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMtl3-0007KR-Rc; Fri, 21 Jul 2023 17:17:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567687.887058; Fri, 21 Jul 2023 17:17:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMtl3-0007KK-Oh; Fri, 21 Jul 2023 17:17:37 +0000
Received: by outflank-mailman (input) for mailman id 567687;
 Fri, 21 Jul 2023 17:17:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=E6wv=DH=epam.com=prvs=15660979e2=oleksandr_tyshchenko@srs-se1.protection.inumbo.net>)
 id 1qMtl2-0007KE-TL
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 17:17:37 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7b1c2b56-27ea-11ee-b23a-6b7b168915f2;
 Fri, 21 Jul 2023 19:17:34 +0200 (CEST)
Received: from pps.filterd (m0174680.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36LGd5pD016817; Fri, 21 Jul 2023 17:17:24 GMT
Received: from eur05-db8-obe.outbound.protection.outlook.com
 (mail-db8eur05lp2109.outbound.protection.outlook.com [104.47.17.109])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3rywqdr303-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Fri, 21 Jul 2023 17:17:24 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com (2603:10a6:10:ed::15)
 by AS8PR03MB9772.eurprd03.prod.outlook.com (2603:10a6:20b:61b::10) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Fri, 21 Jul
 2023 17:17:21 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::11f9:615a:4d9a:a5d2]) by DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::11f9:615a:4d9a:a5d2%6]) with mapi id 15.20.6588.027; Fri, 21 Jul 2023
 17:17:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7b1c2b56-27ea-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=dpUiLZ1N0Q6BS6Eog66kc2cQ8vK2+wMvZXw3pOUDS/a67dOqpQZAAh3Hk7i/TW2KaHFFf0pkwqa5nIDryh/qeUBRPu+et78bYgU9/f9+T2PWDNLUKdicv/eT+295+Xsh9dhHKGTBtZ83Xrhw73hR2E3KWTx8eIM2b6N5zFU+TPJVI6ou1Yllalncku3NnQqeoJlVvFc2rg5hDOhZ/qQp74AUnthJexWnVpudDzjrfsQ49lBal4+GHLkMci1kbFfZQSVivX3hAqt+7kPsK7BBqgFqdQ2a1L49MN54co6sjujWG1KWNVF5NjhQ0ZSmtXio6aTEgdQeAFkcoXHy5RcVhw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=HfIcqW9GgexNsijht0tyEaiScvBY9P0LfsmoQ66ReWk=;
 b=YEJOcKTdEO+gEmubfgGx3/m7Mg2bkN6Qn7eqn83XuHsNHP7z+zDWXUG7WRAuwoYrakIEcGZdwKwWFeT3HJl1ciT+M5FIitNYfI4Npq2eXowchhlsbGl9ISTr9q2qm/gWl07sjZPbAKxOE6cwg3sEcDZVuD/B8Wo/m11TuGi33eW5srmCZIC+yv0qQVjCp6hRc2oIRmyFvlROYIAOpoGjjxglgoaYyQYVncYDza3Nyx2kiaZ3hZvqmYfcURuCbu0QQM2MWzMXqA8hRvsMnKEFyYVB5CUAywA94akCRn4K8/goaZtxN2hzjboOzjgzU0ga2kQh+VMPm5fWluGOgDH/HA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=HfIcqW9GgexNsijht0tyEaiScvBY9P0LfsmoQ66ReWk=;
 b=Epmpxyitk/4mrd7SmOyKeQm28aLQfOuGxNeCAxew+LdSl8UCCssb9L/tiG44hixOspwHiKe0XA/TnnqmxLRSmeoAqHeA/QhOafbmZ9pSvNiCehSPpfpB7OhZl0KLdXLe01NKDrIGZMwSinkiPSikfaT96JCfg97nWegzOn4JKOvSRntIfRi1z59xDlQYo4yBOMfAC+nbSX+NooKXUo863PICb2fCimwWps/InAxltLy102Xes0uhnrN3ZqXFAjMJmY54NsEczvBNXi5OsxvgsCZcQV+fp8fe9yBHLIkgEw4brp/3SaurJnLblyC3gsPFI0HtGzTzyczOBbyVc000Ug==
From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
CC: Juergen Gross <jgross@suse.com>,
        Stefano Stabellini
	<sstabellini@kernel.org>,
        Vincent Guittot <vincent.guittot@linaro.org>,
        =?utf-8?B?QWxleCBCZW5uw6ll?= <alex.bennee@linaro.org>,
        "stratos-dev@op-lists.linaro.org" <stratos-dev@op-lists.linaro.org>,
        Erik
 Schilling <erik.schilling@linaro.org>,
        Manos Pitsidianakis
	<manos.pitsidianakis@linaro.org>,
        Mathieu Poirier
	<mathieu.poirier@linaro.org>,
        "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>,
        "linux-kernel@vger.kernel.org"
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] xen: privcmd: Add support for irqfd
Thread-Topic: [PATCH] xen: privcmd: Add support for irqfd
Thread-Index: AQHZtJ2tw+2Ln+ZUhUa/nIHLslV4fq+3Uo+AgAB0BQCACqzlgIACEa0A
Date: Fri, 21 Jul 2023 17:17:20 +0000
Message-ID: <b126f918-fcd7-dc45-5fa5-eea8309d1b60@epam.com>
References: 
 <d4e0233524b8c7c48614b09cae4d23f2cdf10988.1689150266.git.viresh.kumar@linaro.org>
 <a5521a9d-72c6-4e03-0fbb-8a37418c32f2@suse.com>
 <97e63191-e2ba-34f6-ca6c-99b9e9841587@epam.com>
 <20230720094127.zsqpvryj36cbekik@vireshk-i7>
In-Reply-To: <20230720094127.zsqpvryj36cbekik@vireshk-i7>
Accept-Language: en-US, ru-RU
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DB8PR03MB6108:EE_|AS8PR03MB9772:EE_
x-ms-office365-filtering-correlation-id: 07551415-9849-40e3-543e-08db8a0e57ea
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 hhH2lM3WQV4yOCRJPEE08qHunE4pQNlnP3gsWo5VaY+pr3y0E1Tuxz0vL+Vljp9Ll/TalltUmOcImrR8NGxw6nBQu4N86ScSfd4xt7ebnWQYia29BVSA+ZQ71/wyj21J20stU2MmjLSyB10+MDlAtanlN5l334A5bI1HDU72gTi/iBYD6XF3qhhWHom/IAzn244Kw+7iVbpkvjule+ATXP+uQHOuClIdeQR16q89cySPE7i4cZ4Y8G/jBcEo/RUrxIgHcHcOYiff5QUsMsh2TQ6NrjdOLdnmAlGvRlKXEb5p3lKRGPxqY8SJD3V2jSMod42kVmy4zCKzC0Zq0bzx/bDQhPYxmCyihUuODC4EzPD/hhAr8zo8CO9g70WAstSCUa+3E85NpWz9UhVj3u2Cz5H5l06ZFzgYEB45KCyKVL5di6NtvUYev/Th4T986R6oIdMmSEBSgkg99z2EixNeAiYsabhawo6rtc8Ar/DDM9gNK5RBtjbJip1Cip0KTO9SrdGGV07UCAlPR82SudfPg3DzSZ9Q0zUt+JyzvnDJKQNJnTsD+CDWhHV+MJ6pdQ5ytCAgTf+Ev8faUmyg+JOUg0D4w3el/qmeKDUL7eKepmgRym0Up5oFHRHWC9wiYm6uBZ24x46jnIU5auOmyK7BBg==
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR03MB6108.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(376002)(396003)(136003)(346002)(451199021)(38070700005)(31686004)(31696002)(66446008)(38100700002)(86362001)(122000001)(4744005)(2616005)(36756003)(66476007)(2906002)(71200400001)(8676002)(8936002)(7416002)(478600001)(83380400001)(5660300002)(6486002)(966005)(6512007)(53546011)(26005)(6506007)(186003)(6916009)(54906003)(316002)(4326008)(76116006)(41300700001)(66946007)(91956017)(64756008)(66556008)(45980500001);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?OEZuWittRTV5dkJmWlpkczBoeFFlZFBDOEJTcitmTS9pbGVqN21RTkc1T0xr?=
 =?utf-8?B?aHRpTUNuN1ArQ1NGTVRYUGIzZUxjeHljc3BXV0RIb3ZTOWNvQ2ZpQlQza0Fi?=
 =?utf-8?B?ZzI4ajhEVjN5aG1HWUFJc0diZEttRVNHbHBMV3o3aDFGQzFrS3p2TStnTExX?=
 =?utf-8?B?V0c3ajI0ZWNBMUdiMWpzTXMxR3cxNUZPTDM5cnlUdmx4TUw0cVZER2QzT3c4?=
 =?utf-8?B?eUpRK0ppelNuWWtZYVpLTUlOQ3VsZUlneFJTMzVaNGVHRDdrZFEycy9rZGVu?=
 =?utf-8?B?SzlKTEswcnFlb1RTN0ZkTmsxRVhhSEgrMDNxcGM1aEp5MTJFajd0R2p3TlIv?=
 =?utf-8?B?L2dFL2ZzdHBnaXkrbG4xaDZqRGxCUVRsWGRIUVNsZi9rL2pJZDgrN3lRbWpw?=
 =?utf-8?B?RTJnZS9sMlVaY1k4Q09kTWE3UE9tRUE4aGxqMzdsZ05XYXhnbWlLQitW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text/plain; charset="utf-8"
Content-ID: <C90163E51E2C6645AD5DBDBC7DEFA6F7@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DB8PR03MB6108.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 07551415-9849-40e3-543e-08db8a0e57ea
X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 17:17:21.1693
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: oeYrGgD8AomwW/LAUvsAdBHbU15Jz2RQUM3MK0USsLgWFn2uRVMTUlusagEyaqat+GNK2hCa45kmZoM7Aj/XPimj0lnyThAhLXj9GRfxruU=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB9772
X-Proofpoint-GUID: MzMO3Kk743EXQ_X1rXZIPmf-QDioDhyI
X-Proofpoint-ORIG-GUID: MzMO3Kk743EXQ_X1rXZIPmf-QDioDhyI
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-21_10,2023-07-20_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501
 adultscore=0 suspectscore=0 mlxscore=0 clxscore=1015 impostorscore=0
 phishscore=0 mlxlogscore=999 bulkscore=0 lowpriorityscore=0 spamscore=0
 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307210151

DQoNCk9uIDIwLjA3LjIzIDEyOjQxLCBWaXJlc2ggS3VtYXIgd3JvdGU6DQoNCkhlbGxvIFZpcmVz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CBJIGhhdmUgdXBk
YXRlZCB0aGUgY29tbWl0IHdpdGggQ09ORklHX0FSTTY0IHRoaW5neS4uDQoNClRoYW5rIHlvdSBm
b3IgdGhlIGluZm9ybWF0aW9uIQ==


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 17:52:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 17:52:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567690.887068 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMuIK-0003Uw-Do; Fri, 21 Jul 2023 17:52:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567690.887068; Fri, 21 Jul 2023 17:52:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMuIK-0003Up-Ak; Fri, 21 Jul 2023 17:52:00 +0000
Received: by outflank-mailman (input) for mailman id 567690;
 Fri, 21 Jul 2023 17:51:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qMuII-0003Ui-OW
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 17:51:58 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMuII-0004bo-3b; Fri, 21 Jul 2023 17:51:58 +0000
Received: from 54-240-197-231.amazon.com ([54.240.197.231]
 helo=[192.168.21.208]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qMuIH-0000OO-Sv; Fri, 21 Jul 2023 17:51:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=LbccA50Lk8y09gyB+P5mO7OcxQiFFgZAoZDoVsizGqk=; b=KvdGSPPPpfalf49lzCrUFeRSuT
	TG3j/SRMfb2C7X0yPFyHX2vqesIoOS1sqABuWOzJn0+Z3eTvk8HPQrHFn99lK8QsZkuLPjpQbjs3A
	v0py2TerY6D1NzRXM7uD7dZDkt5szxtz2a/wooSdBy0Wz+5/V2USZZwYJLkFF5JFrBqs=;
Message-ID: <45dd3176-6354-dfbb-a072-c2b9aaa3d0b8@xen.org>
Date: Fri, 21 Jul 2023 18:51:56 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH 2/8] arm/mm: Document the differences between arm32 and
 arm64 directmaps
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-3-alejandro.vallejo@cloud.com>
 <437849e6-08a3-8fac-a594-2003d5b94b41@xen.org>
 <64ba9f91.170a0220.bad4d.8728@mx.google.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <64ba9f91.170a0220.bad4d.8728@mx.google.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Alejandro,

On 21/07/2023 16:09, Alejandro Vallejo wrote:
> On Thu, Jul 20, 2023 at 09:05:55PM +0100, Julien Grall wrote:
>> Hi Alejandro,
>>
>> On 17/07/2023 17:03, Alejandro Vallejo wrote:
>>> arm32 merely covers the XENHEAP, whereas arm64 currently covers anything in
>>> the frame table. These comments highlight why arm32 doesn't need to account for PDX
>>> compression in its __va() implementation while arm64 does.
>>>
>>> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
>>> ---
>>>    xen/arch/arm/include/asm/mm.h | 27 +++++++++++++++++++++++++++
>>>    1 file changed, 27 insertions(+)
>>>
>>> diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
>>> index 4262165ce2..1a83f41879 100644
>>> --- a/xen/arch/arm/include/asm/mm.h
>>> +++ b/xen/arch/arm/include/asm/mm.h
>>> @@ -280,6 +280,19 @@ static inline paddr_t __virt_to_maddr(vaddr_t va)
>>>    #define virt_to_maddr(va)   __virt_to_maddr((vaddr_t)(va))
>>>    #ifdef CONFIG_ARM_32
>>> +/**
>>> + * Find the virtual address corresponding to a machine address
>>> + *
>>> + * Only memory backing the XENHEAP has a corresponding virtual address to
>>> + * be found. This is so we can save precious virtual space, as it's in
>>> + * short supply on arm32. This mapping is not subject to PDX compression
>>> + * because XENHEAP is known to be physically contiguous and can't hence
>>> + * jump over the PDX hole. This means we can avoid the roundtrips
>>> + * converting to/from pdx.
>>> + *
>>> + * @param ma Machine address
>>> + * @return Virtual address mapped to `ma`
>>> + */
>>>    static inline void *maddr_to_virt(paddr_t ma)
>>>    {
>>>        ASSERT(is_xen_heap_mfn(maddr_to_mfn(ma)));
>>> @@ -287,6 +300,20 @@ static inline void *maddr_to_virt(paddr_t ma)
>>>        return (void *)(unsigned long) ma + XENHEAP_VIRT_START;
>>>    }
>>>    #else
>>> +/**
>>> + * Find the virtual address corresponding to a machine address
>>> + *
>>> + * The directmap covers all conventional memory accesible by the
>>> + * hypervisor. This means it's subject to PDX compression.
>>> + *
>>> + * More specifically to arm64, the directmap mappings start at the first
>>> + * GiB boundary containing valid RAM. This means there's an extra offset
>>> + * applied (directmap_base_pdx) on top of the regular PDX compression
>>> + * logic.
>>
>> I find this paragraph a bit confusing to read because it leads to think that
>> pdx_to_maddr(directmap_base_pdx) will return a GiB aligned address.
>>
>> The base PDX corresponds to the start of the first region and the only
>> requirement is it should be page-aligned. However, when mapping in the
>> virtual address space we also offset the start to ensure that superpage can
>> be used (this is where the GiB alignment is used).
>>
>> That's why XENHEAP_VIRT_START points to directmap_virt_start rather than
>> DIRECTMAP_VIRT_START. I think it would make sense to have the logic
>> following what you suggest as it would remove a memory read. But I would
>> understand if you don't want to take that extra work. :)
>>
>> So for now, I would suggest to remove "GiB boundary containing".
>>
>> Cheers,
>>
>> -- 
>> Julien Grall
> Just to make sure it's the wording and not my understanding at fault
> (definitely having DIRECTMAP_VIRT_START != directmap_virt_start doesn't do
> any favours cognitive load).

I take your point. This was recently renamed from xenheap_virt_start to 
directmap_virt_start after the static heap work.

Looking through the code, I think we probably can remove 
directmap_virt_start as, for arm64, it is only used indirectly (via 
XEN_HEAP_VIRT_START) in the virt_to_page() and maddr_to_virt().

This would remove one memory load in the two functions.

>  > /GiB boundary
> |
> |   /offset=address of 1st region of RAM % 1GiB
> |   |
> |---------|
> V         V
> --------------------------------------------------------------------------
> | padding |                           directmap                | padding |
> --------------------------------------------------------------------------
> ^         ^
> |         |
> |         \directmap_virt_start=pdx[directmap_base_pdx]
> |
> \DIRECTMAP_VIRT_START

The drawing is correct.

> 
> In actual words, I considered DIRECTMAP_VIRT_START the beginning of the
> directmap, not directmap_virt_start.

This is where we disagreed on the definition :). Definitely something 
that needs to be documented or removed (see below).

> 
> If this is it, you probably want to document somewhere what's what. In
> particular, you want a big scary message in DIRECTMAP_VIRT_START stating
> that it merely delimits the virtual range where the directmap can be, not
> where the directmap is, with a "See directmap_virt_start for the address
> where the directmap actually starts" message attached.

The uppercase only difference would probably still be confusing. I am 
thinking to remove directmap_virt_start completely because the directmap 
has already hole and we should consider the initial padding as  a hole.

Let me have a look.

> 
> With that considered I'm happy to amend as you suggested on v2.
> 
> IMO, the ARM port should not keep that base pdx variable around, but
> integrate it in the pdx logic, so the first valid address always
> corresponds to pdx[0]. Then given a pdx it's immediate to find frame table
> entries and directmap frames. It would also greatly simplify the definition
> of a pdx.

That's a good idea. However, I don't think I will have the bandwidth to 
look at hacking the PDX code in the near future. Although, I would be 
happy to review patches if someone want to tackle the problem.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 20:46:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 20:46:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567693.887079 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMx1E-0003ZA-GQ; Fri, 21 Jul 2023 20:46:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567693.887079; Fri, 21 Jul 2023 20:46:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMx1E-0003Z3-BB; Fri, 21 Jul 2023 20:46:32 +0000
Received: by outflank-mailman (input) for mailman id 567693;
 Fri, 21 Jul 2023 20:46:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMx1D-0003Yt-86; Fri, 21 Jul 2023 20:46:31 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMx1D-0000St-1u; Fri, 21 Jul 2023 20:46:31 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMx1C-0006l4-Jv; Fri, 21 Jul 2023 20:46:30 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMx1C-0003Q5-HM; Fri, 21 Jul 2023 20:46:30 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Pmtk3UEwvMAxGUO+ZKv6Un0tv5tA3qKSehVE3+tLMIc=; b=2RnGaO+7MWeEjY3oGAabvM5TpR
	RlpRcJLVtLEI4VJFUjlagSmYFikrEIxyqcC4aTjq34T764As4NKDoAVBLdMrxl4CI0aTaM5A7GSkY
	wwU/IQSuPxZ8vqgbBWh74VCaiTb1YFCe57Rxqrm0hMqVWP8xpi2AaqylNztTI2UoEHQE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181943-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 181943: tolerable FAIL - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt-raw:guest-start:fail:heisenbug
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=033c4fcddffd7aaffd0cc7769043d6bdf9f983aa
X-Osstest-Versions-That:
    libvirt=fa0d5f4ebc0aa178d9dea278914f9149a4c4af54
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 21 Jul 2023 20:46:30 +0000

flight 181943 libvirt real [real]
flight 181964 libvirt real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181943/
http://logs.test-lab.xenproject.org/osstest/logs/181964/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-libvirt-raw 13 guest-start         fail pass in 181964-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail in 181964 like 181917
 test-armhf-armhf-libvirt-raw 14 migrate-support-check fail in 181964 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181917
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181917
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass

version targeted for testing:
 libvirt              033c4fcddffd7aaffd0cc7769043d6bdf9f983aa
baseline version:
 libvirt              fa0d5f4ebc0aa178d9dea278914f9149a4c4af54

Last test of basis   181917  2023-07-20 04:21:51 Z    1 days
Testing same since   181943  2023-07-21 04:18:50 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Daniel P. BerrangÃ© <berrange@redhat.com>
  Matt Low <matt@mlow.ca>
  Michal Privoznik <mprivozn@redhat.com>
  Peter Krempa <pkrempa@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   fa0d5f4ebc..033c4fcddf  033c4fcddffd7aaffd0cc7769043d6bdf9f983aa -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 21:20:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 21:20:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567699.887087 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMxXw-00080I-2F; Fri, 21 Jul 2023 21:20:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567699.887087; Fri, 21 Jul 2023 21:20:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMxXv-00080B-Vi; Fri, 21 Jul 2023 21:20:19 +0000
Received: by outflank-mailman (input) for mailman id 567699;
 Fri, 21 Jul 2023 21:20:18 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMxXu-000801-R0; Fri, 21 Jul 2023 21:20:18 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMxXu-0001Nb-IC; Fri, 21 Jul 2023 21:20:18 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qMxXu-000051-4a; Fri, 21 Jul 2023 21:20:18 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qMxXu-00056O-4G; Fri, 21 Jul 2023 21:20:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=AgK6lrpGx+M6ZEGOy8OHZfaO5/sG0MLKfYziUqFSXSA=; b=K69RXGvI2uyCxDUhoU2x4Uw+bP
	IPRQtPg7VMl/2A4051ri0YlJCP9dTpgHpVTsw7jw8+OsMhTgagU10toP1f5x+LSV1KYBVdPkqLPv6
	9xzy4S02CaPb6qOypAhJdEnHm3Gu7a3sAS8Bya3ey8SPcVF6icRhaA0rdaWkWyggm5Qs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181945-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.17-testing test] 181945: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-4.17-testing:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=69611e5b3c43f52ce130b89ac4c6bb1c2aeb25d3
X-Osstest-Versions-That:
    xen=8f11b6e942dbf02592de2ab3338226f0cd3ee3ac
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 21 Jul 2023 21:20:18 +0000

flight 181945 xen-4.17-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181945/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181861
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181861
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181861
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181861
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181861
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181861
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181861
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181861
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181861
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt   16 saverestore-support-check fail starved in 181861
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check fail starved in 181861
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail starved in 181861

version targeted for testing:
 xen                  69611e5b3c43f52ce130b89ac4c6bb1c2aeb25d3
baseline version:
 xen                  8f11b6e942dbf02592de2ab3338226f0cd3ee3ac

Last test of basis   181861  2023-07-17 22:08:51 Z    3 days
Testing same since   181945  2023-07-21 06:36:55 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Anthony PERARD <anthony.perard@citrix.com>
  Jan Beulich <jbeulich@suse.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   8f11b6e942..69611e5b3c  69611e5b3c43f52ce130b89ac4c6bb1c2aeb25d3 -> stable-4.17


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 22:06:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 22:06:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567708.887106 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMyGp-0004GH-Jt; Fri, 21 Jul 2023 22:06:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567708.887106; Fri, 21 Jul 2023 22:06:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMyGp-0004GA-GZ; Fri, 21 Jul 2023 22:06:43 +0000
Received: by outflank-mailman (input) for mailman id 567708;
 Fri, 21 Jul 2023 22:06:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BzSz=DH=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMyGo-0004G4-Bp
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 22:06:42 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dca6022f-2812-11ee-b23a-6b7b168915f2;
 Sat, 22 Jul 2023 00:06:40 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 411F761DA8;
 Fri, 21 Jul 2023 22:06:36 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id D07EBC433C7;
 Fri, 21 Jul 2023 22:06:34 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dca6022f-2812-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689977195;
	bh=pJgkglgc3pvqlVFwe/HeY4tVAnp+vBrGU7p9CGFxkHQ=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=m1RB3xQgBom9XHwmpwD/P23lA0iPsN9L7RTmmkZG0HmCNvCYoBsOnkiU5k8QkdpCx
	 KDg+hjmMT+RIjGRQ+c27h0sKFu+G8jHOjwDHBlLBiX51hTRK+25rswXFS9a+RL7Ziq
	 K34IMyLp1H51U/EmHw/i8MYDTs6uxFFDQQSSl7owTvg+Qu7VFHjcxDcRwF03pbXdR0
	 i0vzCRXHuhkOG6UysDrkMTJ4d2OjSKBpS0lb6ohLBkVDa9EVPkiFYHJ2r8fTG7oIfd
	 d7MmyaK7QP65laQOfl6vLNnNJMOQL9Y1ciiQAGKb+tUEJWGFrwdW1Ey5YD06fXB0DM
	 iNlplp1uyrfyQ==
Date: Fri, 21 Jul 2023 15:06:33 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Andrei Cherechesu (OSS)" <andrei.cherechesu@oss.nxp.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
    xen-devel@lists.xenproject.org, george.mocanu@nxp.com, 
    Juergen Gross <jgross@suse.com>
Subject: Re: [ARM][xencons] PV Console hangs due to illegal ring buffer
 accesses
In-Reply-To: <d7f16516-a009-27a2-497a-2c48eab3df3e@oss.nxp.com>
Message-ID: <alpine.DEB.2.22.394.2307211506110.3118466@ubuntu-linux-20-04-desktop>
References: <62eeff72-c1fb-6932-6797-1b0058c97b03@oss.nxp.com> <048266d6-a32f-5f4e-984a-8b74de01a1fc@xen.org> <alpine.DEB.2.22.394.2307201609030.3118466@ubuntu-linux-20-04-desktop> <d7f16516-a009-27a2-497a-2c48eab3df3e@oss.nxp.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 21 Jul 2023, Andrei Cherechesu (OSS) wrote:
> > I am really confused. I would try with regular Linux instead of Linux RT
> > and also would try to replace all the barriers in
> > drivers/tty/hvc/hvc_xen.c with their virt_* version to see if we can
> > narrow down the problem a bit.
> > 
> 
> Unfortunately, we do not normally run regular Linux and we do not have a
> stable regular Linux version with our HW support ported on it. We've been running
> Linux RT since 4.14 (or even earlier I think), but this issue has started to happen
> since we upgraded to Xen 4.17 (from 4.14), with both Linux RT 5.15 and 5.10.

I saw that George tried both suggestions without making progress.

This is a very difficult bug. If Xen 4.14 works and the issue starts
with Xen 4.17, then I would try to bisect it (try Xen 4.15, 4.16, etc.
until you narrow down the commit).


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 22:08:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 22:08:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567711.887116 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMyIf-0004o1-VG; Fri, 21 Jul 2023 22:08:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567711.887116; Fri, 21 Jul 2023 22:08:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMyIf-0004nu-S3; Fri, 21 Jul 2023 22:08:37 +0000
Received: by outflank-mailman (input) for mailman id 567711;
 Fri, 21 Jul 2023 22:08:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BzSz=DH=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMyIe-0004nm-Pj
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 22:08:36 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 22ca63c5-2813-11ee-b23a-6b7b168915f2;
 Sat, 22 Jul 2023 00:08:35 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 8557E61DA1;
 Fri, 21 Jul 2023 22:08:34 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32C47C433C7;
 Fri, 21 Jul 2023 22:08:32 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 22ca63c5-2813-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689977313;
	bh=2Yfxm2WOf3M1EbeVbgbkDQ78sxZNDLOYz+SBvFVQZMQ=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=Rkqv3915ew2KW/NF2bvscQo7ZVwrl4yQ/y6DKYW1Lgxyv1asnblSR6oCbPuq6BpAa
	 yrj4v55/6d5cAi6kZqI14Z6lOQOQU6a2TPaOzAv9AOpZkGB2EzEC3xgz6CASu8rVjN
	 p2L1hUvWbXi7VfbJ5Wfe8HeRCN7f9+9ASWZQuOv1hrUanRVa6hwEsezsYtaAIHrh/c
	 yFAOPO1Qf40HfKGJRhXnx2LgMlcNFr13JhUMw65QCey6iEEzvRhSstxxdUM93rcIf7
	 kBAsZLv5O/Mpe+MK4RsJk6ALt6WWKGPXs3CucNVUuhiml0gJfbuYQrzkDPbXaDLeBn
	 NcFkQKom+HNRw==
Date: Fri, 21 Jul 2023 15:08:30 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Christopher Clark <christopher.w.clark@gmail.com>, 
    xen-devel@lists.xenproject.org, 
    Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>, 
    Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, 
    Luca Fancellu <luca.fancellu@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Rich Persaud <persaur@gmail.com>, 
    Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH 03/10] x86 setup: change bootstrap map to accept new boot
 module structures
In-Reply-To: <4e0a0fc9-0c1b-4725-5692-de67ee68a980@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307211507530.3118466@ubuntu-linux-20-04-desktop>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com> <20230701071835.41599-4-christopher.w.clark@gmail.com> <alpine.DEB.2.22.394.2307081144340.761183@ubuntu-linux-20-04-desktop> <CACMJ4GYE6PW1SY35dhs4XkXd9ru25igrvMCrh4pJMWEBNNz0YQ@mail.gmail.com>
 <CACMJ4Gb_ZwKSjP7qzfQj98YQjSpBdFuWzeGQJUNNqst0GdXCOw@mail.gmail.com> <4e0a0fc9-0c1b-4725-5692-de67ee68a980@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="8323329-16792519-1689977313=:3118466"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-16792519-1689977313=:3118466
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT

On Fri, 21 Jul 2023, Jan Beulich wrote:
> On 21.07.2023 00:12, Christopher Clark wrote:
> > On Thu, Jul 13, 2023 at 11:51â€¯PM Christopher Clark <
> > christopher.w.clark@gmail.com> wrote:
> > 
> >>
> >>
> >> On Sat, Jul 8, 2023 at 11:47â€¯AM Stefano Stabellini <sstabellini@kernel.org>
> >> wrote:
> >>
> >>> On Sat, 1 Jul 2023, Christopher Clark wrote:
> >>>> To convert the x86 boot logic from multiboot to boot module structures,
> >>>> change the bootstrap map function to accept a boot module parameter.
> >>>>
> >>>> To allow incremental change from multiboot to boot modules across all
> >>>> x86 setup logic, provide a temporary inline wrapper that still accepts a
> >>>> multiboot module parameter and use it where necessary. The wrapper is
> >>>> placed in a new arch/x86 header <asm/boot.h> to avoid putting a static
> >>>> inline function into an existing header that has no such functions
> >>>> already. This new header will be expanded with additional functions in
> >>>> subsequent patches in this series.
> >>>>
> >>>> No functional change intended.
> >>>>
> >>>> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
> >>>> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
> >>>>
> >>>
> >>> [...]
> >>>
> >>>> diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
> >>>> index b72ae31a66..eb93cc3439 100644
> >>>> --- a/xen/include/xen/bootinfo.h
> >>>> +++ b/xen/include/xen/bootinfo.h
> >>>> @@ -10,6 +10,9 @@
> >>>>  #endif
> >>>>
> >>>>  struct boot_module {
> >>>> +    paddr_t start;
> >>>> +    size_t size;
> >>>
> >>> I think size should be paddr_t (instead of size_t) to make sure it is
> >>> the right size on both 64-bit and 32-bit architectures that support
> >>> 64-bit addresses.
> >>>
> >>
> >> Thanks, that explanation does make sense - ack.
> >>
> > 
> > I've come back to reconsider this as it doesn't seem right to me to store a
> > non-address value (which this will always be) in a type explicitly defined
> > to hold an address: addresses may have architectural alignment requirements
> > whereas a size value is just a number of bytes so will not. The point of a
> > size_t value is that size_t is defined to be large enough to hold the size
> > of any valid object in memory, so I think this was right as-is.
> 
> "Any object in memory" implies virtual addresses (or more generally addresses
> which can be used for accessing objects). This isn't the case when considering
> physical addresses - there may be far more memory in a system than can be made
> accessible all in one go.

Right. And I think size_t is defined as 32-bit in Xen which is a
problem.
--8323329-16792519-1689977313=:3118466--


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 22:16:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 22:16:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567716.887125 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMyQX-0006P6-Rc; Fri, 21 Jul 2023 22:16:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567716.887125; Fri, 21 Jul 2023 22:16:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMyQX-0006Oz-Oy; Fri, 21 Jul 2023 22:16:45 +0000
Received: by outflank-mailman (input) for mailman id 567716;
 Fri, 21 Jul 2023 22:16:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BzSz=DH=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMyQW-0006Ot-4W
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 22:16:44 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 44fdcbc5-2814-11ee-b23a-6b7b168915f2;
 Sat, 22 Jul 2023 00:16:42 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 5871561D2F;
 Fri, 21 Jul 2023 22:16:41 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97F52C433C8;
 Fri, 21 Jul 2023 22:16:39 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 44fdcbc5-2814-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689977800;
	bh=UU/KNHtJWPOE4DwMSvwfMbjpQ3D4sVoEwSzL4QdF4O0=;
	h=From:To:Cc:Subject:Date:From;
	b=QJ8Z5plGK9/iRi+qC+XLcZzsNYggCRA3XAY3RKZYgKk4xzMntN3VTDVl4wv7j5CYq
	 vA2OO2R1tPaUeRr99IQiKJv1hH5CwnryWqOkmyOPlsk0JUzTrACDLlvsm3u19RJ+HN
	 UaobQwj6jZMEnbCV0QdKacWCdJ1GBdiwEp2u8MQrTJTr8x1v6SvmN7YyrZKrwDuAk+
	 Q7ynOXOzFUwleQHct52lPPY4CT888bbdcsY6wxo2JcD9rsnBbX4I2ZFl7nYDzm6sVx
	 YKsp4uyr8+2Ee2EQvnBAYUFAn0tnyHYbhtmThDzh+Gm/R7e0328uo9l6wWcb1XafAC
	 vm59BRcYmbfug==
From: Stefano Stabellini <sstabellini@kernel.org>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	julien@xen.org,
	sstabellini@kernel.org,
	george.dunlap@citrix.com,
	bertrand.marquis@arm.com,
	Stefano Stabellini <stefano.stabellini@amd.com>
Subject: [PATCH v2] docs/misra: add Rule 1.1 and 5.6
Date: Fri, 21 Jul 2023 15:16:36 -0700
Message-Id: <20230721221636.3693746-1-sstabellini@kernel.org>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Stefano Stabellini <stefano.stabellini@amd.com>

Rule 1.1 is uncontroversial and we are already following it.

Rule 5.6 has been deemed a good rule to have by the MISRA C group.
However, we do have a significant amount of violations that will take
time to resolve and might require partial deviations in the form of
in-code comments or MISRA C scanners special configurations (ECLAIR).
For new code, we want this rule to generally apply hence the addition to
docs/misra/rules.rst.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>

---
Changes in v2:
- add a note about compiler extensions to Rule 1.1
- add "generally" in the commit message
---
 docs/misra/rules.rst | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 29a777938a..8f0e4d3f25 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -82,6 +82,14 @@ maintainers if you want to suggest a change.
      - Summary
      - Notes
 
+   * - `Rule 1.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_01_01.c>`_
+     - Required
+     - The program shall contain no violations of the standard C syntax
+       and constraints, and shall not exceed the implementation's
+       translation limits
+     - We make use of several compiler extensions as documented by
+       `C-language-toolchain.rst <docs/misra/C-language-toolchain.rst>`_
+
    * - `Rule 1.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_01_03.c>`_
      - Required
      - There shall be no occurrence of undefined or critical unspecified
@@ -156,6 +164,11 @@ maintainers if you want to suggest a change.
        headers (xen/include/public/) are allowed to retain longer
        identifiers for backward compatibility.
 
+   * - `Rule 5.6 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_05_06.c>`_
+     - Required
+     - A typedef name shall be a unique identifier
+     -
+
    * - `Rule 6.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_06_01.c>`_
      - Required
      - Bit-fields shall only be declared with an appropriate type
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 21 22:25:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 22:25:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567720.887136 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMyYd-0007tn-M4; Fri, 21 Jul 2023 22:25:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567720.887136; Fri, 21 Jul 2023 22:25:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMyYd-0007tg-IF; Fri, 21 Jul 2023 22:25:07 +0000
Received: by outflank-mailman (input) for mailman id 567720;
 Fri, 21 Jul 2023 22:25:06 +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
 <SRS0=BzSz=DH=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMyYc-0007ta-Fv
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 22:25:06 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6fa9a200-2815-11ee-8611-37d641c3527e;
 Sat, 22 Jul 2023 00:25:03 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 1105E61DA6;
 Fri, 21 Jul 2023 22:25:03 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id B39B5C433C8;
 Fri, 21 Jul 2023 22:25:01 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6fa9a200-2815-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689978302;
	bh=RHE0mxNohEwFwow60CRuulZInR7LMvCwiWSlLoYZBLY=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=urPjiMJhXOBMRMOlqNDl80YBUOcSGQ3KE8JNiY6feaGSyn0BwLx33nD92qxRhYuna
	 GSh1TPdPT0NRJAeKwJe/jwLlzZMGfG7o8eNCgDSBoY99sJu3mrd0RWnGGlW3VFfV6a
	 qWAsTunoHf0cC8vHhpckvpUJYKQTPYdU5SdRQ44MtWkPOtP0pRal0rITuKMgpPMrAt
	 oP42zlQz3g1EXFuhN7QQVkJnG2+Mrn9+CMn9xq9gyBBJez1qYkrh+Rq4KM3hIMPodt
	 XZE4bd53KwCo4yIpMiYU/4MI31EmIP8IwBlXa7RcQ618UR/UXNRbsrz9YsKgEJ39dp
	 Ufw4VuDbHjzEQ==
Date: Fri, 21 Jul 2023 15:25:00 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Doug Goldstein <cardoe@cardoe.com>
Subject: Re: [XEN PATCH] automation: add ECLAIR pipeline
In-Reply-To: <CAFHJcJs816ZreXXMK4ZOgxeiqowUJyXLUaBOaR9RE9FxTp+bGg@mail.gmail.com>
Message-ID: <alpine.DEB.2.22.394.2307211523540.3118466@ubuntu-linux-20-04-desktop>
References: <eb5fa852f306790160b967787592553d2fdf3de6.1689887842.git.simone.ballarin@bugseng.com> <alpine.DEB.2.22.394.2307201507070.3118466@ubuntu-linux-20-04-desktop> <CAFHJcJs816ZreXXMK4ZOgxeiqowUJyXLUaBOaR9RE9FxTp+bGg@mail.gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="8323329-282688782-1689978302=:3118466"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-282688782-1689978302=:3118466
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT

On Fri, 21 Jul 2023, Simone Ballarin wrote:
> Il giorno ven 21 lug 2023 alle ore 00:29 Stefano Stabellini <sstabellini@kernel.org> ha scritto:
> 
>       Patchew automatically picked it up from xen-devel and started a pipeline
>       here:
> 
>       https://gitlab.com/xen-project/patchew/xen/-/pipelines/939440592
> 
>       However the eclair-x86_64 job failed with:
> 
>       ERROR: Uploading artifacts as "archive" to coordinator... 413 Payload
>       Too Large
> 
> 
> In the next patch, I will avoid uploading the ECLAIR database in GitLab artifacts.
> Of course, the databases can still be accessed via the links in the pipeline logs.
> Â 
> 
>       Also the eclair-ARM64 job failed but it is not clear to me why.
> 
> 
> The reason is that the WTOKEN variable is missing. This masked variable should be set
> and visible to *all* repositories (xen-project/xen, xen-project/people/.*).

OK this is interesting. I added WTOKEN to https://gitlab.com/xen-project
so I assumed it would propagate to all the subprojects like
https://gitlab.com/xen-project/xen,
https://gitlab.com/xen-project/people/sstabellini, etc. but it looks
like it might have to be added manually at every instance.
--8323329-282688782-1689978302=:3118466--


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 22:39:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 22:39:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567723.887145 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMymL-0000zs-Sl; Fri, 21 Jul 2023 22:39:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567723.887145; Fri, 21 Jul 2023 22:39:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMymL-0000zl-Q5; Fri, 21 Jul 2023 22:39:17 +0000
Received: by outflank-mailman (input) for mailman id 567723;
 Fri, 21 Jul 2023 22:39:17 +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
 <SRS0=BzSz=DH=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMymL-0000zN-4f
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 22:39:17 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6a477032-2817-11ee-8611-37d641c3527e;
 Sat, 22 Jul 2023 00:39:13 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 1042961DA7;
 Fri, 21 Jul 2023 22:39:13 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0820BC433C7;
 Fri, 21 Jul 2023 22:39:10 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6a477032-2817-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689979152;
	bh=fBu2vIAo4FEQzspszeHExPOTex37WWemVOEpVGf/hec=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=Z8+62XoxyWFBj02nvPyaLwIoYtTZ1TNOEhq1K6kYEqs7BdFz6yCcC/0dAGAb6pHcI
	 g/jRFfb9HXCuY/o6CEGFjZY/uMERwA646/27PIFIivtDLcdr+mAGA6YUxj9HlbnwBt
	 01OU2hbsILtKPNY3f8ejP5XNgkqyk6ew4FRZLvKFGlph7se43zkZ480iNgodCC4voL
	 2WfR8742UGKai0g3n3ka4snpBvBJbBTVHtg5sX3l1jlA7h9rhXhJzTPhk4PSHyRKU3
	 0q/aOPvWmHL+MyxRNMFYujDmJDQEO4Ob46CIwTcQAs6OLSARFZ/oDHCExRqegNM2d+
	 b0YibygKwxKYQ==
Date: Fri, 21 Jul 2023 15:39:09 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <xenia.ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH] x86/cpu-policy: address violations of MISRA C:2012
 Rule 8.3 on parameter names
In-Reply-To: <912cfe8f5b043bddc80cbf9f75cc0b35e02a6ecd.1689929894.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307211539000.3118466@ubuntu-linux-20-04-desktop>
References: <912cfe8f5b043bddc80cbf9f75cc0b35e02a6ecd.1689929894.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 21 Jul 2023, Federico Serafini wrote:
> Change parameter names in function declarations to be consistent with
> the ones used in the correponding definitions, thus addressing
> violations of MISRA C:2012 Rule 8.3: "All declarations of an object or
> function shall use the same names and type qualifiers".
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  xen/include/xen/lib/x86/cpu-policy.h | 29 ++++++++++++++--------------
>  1 file changed, 15 insertions(+), 14 deletions(-)
> 
> diff --git a/xen/include/xen/lib/x86/cpu-policy.h b/xen/include/xen/lib/x86/cpu-policy.h
> index 6d5e9edd26..bab3eecda6 100644
> --- a/xen/include/xen/lib/x86/cpu-policy.h
> +++ b/xen/include/xen/lib/x86/cpu-policy.h
> @@ -451,23 +451,24 @@ typedef xen_msr_entry_t msr_entry_buffer_t[];
>   * Serialise the CPUID leaves of a cpu_policy object into an array of cpuid
>   * leaves.
>   *
> - * @param policy     The cpu_policy to serialise.
> - * @param leaves     The array of leaves to serialise into.
> - * @param nr_entries The number of entries in 'leaves'.
> + * @param p            The cpu_policy to serialise.
> + * @param leaves       The array of leaves to serialise into.
> + * @param nr_entries_p The number of entries in 'leaves'.
>   * @returns -errno
>   *
>   * Writes at most CPUID_MAX_SERIALISED_LEAVES.  May fail with -ENOBUFS if the
>   * leaves array is too short.  On success, nr_entries is updated with the
>   * actual number of leaves written.
>   */
> -int x86_cpuid_copy_to_buffer(const struct cpu_policy *policy,
> -                             cpuid_leaf_buffer_t leaves, uint32_t *nr_entries);
> +int x86_cpuid_copy_to_buffer(const struct cpu_policy *p,
> +                             cpuid_leaf_buffer_t leaves,
> +                             uint32_t *nr_entries_p);
>  
>  /**
>   * Unserialise the CPUID leaves of a cpu_policy object into an array of cpuid
>   * leaves.
>   *
> - * @param policy      The cpu_policy to unserialise into.
> + * @param p           The cpu_policy to unserialise into.
>   * @param leaves      The array of leaves to unserialise from.
>   * @param nr_entries  The number of entries in 'leaves'.
>   * @param err_leaf    Optional hint for error diagnostics.
> @@ -481,7 +482,7 @@ int x86_cpuid_copy_to_buffer(const struct cpu_policy *policy,
>   * No content validation of in-range leaves is performed.  Synthesised data is
>   * recalculated.
>   */
> -int x86_cpuid_copy_from_buffer(struct cpu_policy *policy,
> +int x86_cpuid_copy_from_buffer(struct cpu_policy *p,
>                                 const cpuid_leaf_buffer_t leaves,
>                                 uint32_t nr_entries, uint32_t *err_leaf,
>                                 uint32_t *err_subleaf);
> @@ -489,22 +490,22 @@ int x86_cpuid_copy_from_buffer(struct cpu_policy *policy,
>  /**
>   * Serialise the MSRs of a cpu_policy object into an array.
>   *
> - * @param policy     The cpu_policy to serialise.
> - * @param msrs       The array of msrs to serialise into.
> - * @param nr_entries The number of entries in 'msrs'.
> + * @param p            The cpu_policy to serialise.
> + * @param msrs         The array of msrs to serialise into.
> + * @param nr_entries_p The number of entries in 'msrs'.
>   * @returns -errno
>   *
>   * Writes at most MSR_MAX_SERIALISED_ENTRIES.  May fail with -ENOBUFS if the
>   * buffer array is too short.  On success, nr_entries is updated with the
>   * actual number of msrs written.
>   */
> -int x86_msr_copy_to_buffer(const struct cpu_policy *policy,
> -                           msr_entry_buffer_t msrs, uint32_t *nr_entries);
> +int x86_msr_copy_to_buffer(const struct cpu_policy *p,
> +                           msr_entry_buffer_t msrs, uint32_t *nr_entries_p);
>  
>  /**
>   * Unserialise the MSRs of a cpu_policy object from an array of msrs.
>   *
> - * @param policy     The cpu_policy object to unserialise into.
> + * @param p          The cpu_policy object to unserialise into.
>   * @param msrs       The array of msrs to unserialise from.
>   * @param nr_entries The number of entries in 'msrs'.
>   * @param err_msr    Optional hint for error diagnostics.
> @@ -518,7 +519,7 @@ int x86_msr_copy_to_buffer(const struct cpu_policy *policy,
>   *
>   * No content validation is performed on the data stored in the policy object.
>   */
> -int x86_msr_copy_from_buffer(struct cpu_policy *policy,
> +int x86_msr_copy_from_buffer(struct cpu_policy *p,
>                               const msr_entry_buffer_t msrs, uint32_t nr_entries,
>                               uint32_t *err_msr);
>  
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 22:49:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 22:49:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567726.887156 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMyvt-0002Tw-QY; Fri, 21 Jul 2023 22:49:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567726.887156; Fri, 21 Jul 2023 22:49:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMyvt-0002Tp-Np; Fri, 21 Jul 2023 22:49:09 +0000
Received: by outflank-mailman (input) for mailman id 567726;
 Fri, 21 Jul 2023 22:49:08 +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
 <SRS0=BzSz=DH=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMyvs-0002Te-Qu
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 22:49:08 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cb42b18f-2818-11ee-8611-37d641c3527e;
 Sat, 22 Jul 2023 00:49:05 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 35E9960DFD;
 Fri, 21 Jul 2023 22:49:05 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF1CDC433C8;
 Fri, 21 Jul 2023 22:49:03 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cb42b18f-2818-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689979744;
	bh=OhDSfPcCU/dNWsuDeAQRfuuMWb+v1GbeXIEFoCD/gqY=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=TWd7/HjDL3/5GODX1BSnO4Ivnct/762MJQEvZB88ywJY9ZBAy7KcfN4lqml1Sk0pO
	 xNGe5M5DAZDEI2jSXEwKBIREBV2MhoAx/m7OKocfnWvR8+VAS4O9aBwhW3wYnOuPVa
	 G7+WBoGFOTuYtNFrFT7tOgioYuZYYI7pSeOnrcUvCmtPdSId41SFWN6KLM+Jam/YrJ
	 lGMyY/D44YTz2L7QKNpIgeSbsk/yPvOUxV/gQDJLO9kTkjXItItjLMoMUG//GSzEaD
	 +rfLGN0dNGc9W1UgAnBfe0AN1jm4d8sU9ZCWxYyu1+35BAt63TpvMfHYLIN+1ljqIG
	 PKbEmn16EONWg==
Date: Fri, 21 Jul 2023 15:49:02 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>
Subject: Re: [XEN PATCH] device_tree: address violations of MISRA C:2012
 Rules 8.2 and 8.3
In-Reply-To: <8acb3e1a39c4251a23b59d5c094b7fb39f7a5ed9.1689949312.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307211541350.3118466@ubuntu-linux-20-04-desktop>
References: <8acb3e1a39c4251a23b59d5c094b7fb39f7a5ed9.1689949312.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 21 Jul 2023, Federico Serafini wrote:
> Give a name to unnamed parameters thus addressing violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names and types used in function
> declarations and the ones used in the corresponding function
> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
> ("All declarations of an object or function shall use the same names
> and type qualifiers").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> ---
>  xen/common/device_tree.c      | 24 ++++++++++++------------
>  xen/include/xen/device_tree.h | 16 ++++++++--------
>  2 files changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 0677193ab3..319f98f8c2 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -85,11 +85,11 @@ struct dt_bus
>      unsigned int (*get_flags)(const __be32 *addr);
>  };
>  
> -void dt_get_range(const __be32 **cell, const struct dt_device_node *np,
> +void dt_get_range(const __be32 **cellp, const struct dt_device_node *np,
>                    u64 *address, u64 *size)
>  {
> -    *address = dt_next_cell(dt_n_addr_cells(np), cell);
> -    *size = dt_next_cell(dt_n_size_cells(np), cell);
> +    *address = dt_next_cell(dt_n_addr_cells(np), cellp);
> +    *size = dt_next_cell(dt_n_size_cells(np), cellp);
>  }
>  
>  void dt_set_cell(__be32 **cellp, int size, u64 val)
> @@ -993,9 +993,9 @@ int dt_device_get_paddr(const struct dt_device_node *dev, unsigned int index,
>  }
>  
>  int dt_for_each_range(const struct dt_device_node *dev,
> -                      int (*cb)(const struct dt_device_node *,
> +                      int (*cb)(const struct dt_device_node *dev,
>                                  uint64_t addr, uint64_t length,
> -                                void *),
> +                                void *data),
>                        void *data)
>  {
>      const struct dt_device_node *parent = NULL;
> @@ -1164,7 +1164,7 @@ unsigned int dt_number_of_irq(const struct dt_device_node *device)
>      return (intlen / intsize);
>  }
>  
> -unsigned int dt_number_of_address(const struct dt_device_node *dev)
> +unsigned int dt_number_of_address(const struct dt_device_node *device)
>  {
>      const __be32 *prop;
>      u32 psize;
> @@ -1173,20 +1173,20 @@ unsigned int dt_number_of_address(const struct dt_device_node *dev)
>      int onesize, na, ns;
>  
>      /* Get parent & match bus type */
> -    parent = dt_get_parent(dev);
> +    parent = dt_get_parent(device);
>      if ( parent == NULL )
>          return 0;
>  
>      bus = dt_match_bus(parent);
>      if ( !bus )
>          return 0;
> -    bus->count_cells(dev, &na, &ns);
> +    bus->count_cells(device, &na, &ns);
>  
>      if ( !DT_CHECK_COUNTS(na, ns) )
>          return 0;
>  
>      /* Get "reg" or "assigned-addresses" property */
> -    prop = dt_get_property(dev, bus->addresses, &psize);
> +    prop = dt_get_property(device, bus->addresses, &psize);
>      if ( prop == NULL )
>          return 0;
>  
> @@ -1197,9 +1197,9 @@ unsigned int dt_number_of_address(const struct dt_device_node *dev)
>  }
>  
>  int dt_for_each_irq_map(const struct dt_device_node *dev,
> -                        int (*cb)(const struct dt_device_node *,
> -                                  const struct dt_irq *,
> -                                  void *),
> +                        int (*cb)(const struct dt_device_node *dev,
> +                                  const struct dt_irq *dt_irq,
> +                                  void *data_cb),

This should be void *data if it needs to match
xen/include/xen/device_tree.h


>                          void *data)
>  {
>      const struct dt_device_node *ipar, *tnode, *old = NULL;
> diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
> index c2eada7489..e5d4fbc327 100644
> --- a/xen/include/xen/device_tree.h
> +++ b/xen/include/xen/device_tree.h
> @@ -538,7 +538,7 @@ bool_t dt_machine_is_compatible(const char *compat);
>   * Returns a node pointer with refcount incremented, use
>   * of_node_put() on it when done.
>   */
> -struct dt_device_node *dt_find_node_by_name(struct dt_device_node *node,
> +struct dt_device_node *dt_find_node_by_name(struct dt_device_node *from,
>                                              const char *name);
>  
>  /**
> @@ -639,7 +639,7 @@ unsigned int dt_number_of_address(const struct dt_device_node *device);
>   * device-tree node. It's the high level pendant to dt_device_get_raw_irq().
>   */
>  int dt_device_get_irq(const struct dt_device_node *device, unsigned int index,
> -                      struct dt_irq *irq);
> +                      struct dt_irq *out_irq);
>  
>  /**
>   * dt_device_get_raw_irq - Resolve an interrupt for a device without translation
> @@ -652,7 +652,7 @@ int dt_device_get_irq(const struct dt_device_node *device, unsigned int index,
>   */
>  int dt_device_get_raw_irq(const struct dt_device_node *device,
>                            unsigned int index,
> -                          struct dt_raw_irq *irq);
> +                          struct dt_raw_irq *out_irq);
>  
>  /**
>   * dt_irq_translate - Translate an irq
> @@ -668,9 +668,9 @@ int dt_irq_translate(const struct dt_raw_irq *raw, struct dt_irq *out_irq);
>   * @data: Caller data passed to callback
>   */
>  int dt_for_each_irq_map(const struct dt_device_node *dev,
> -                        int (*cb)(const struct dt_device_node *,
> -                                  const struct dt_irq *,
> -                                  void *),
> +                        int (*cb)(const struct dt_device_node *dev,
> +                                  const struct dt_irq *irq,

This should be dt_irq for consistency


> +                                  void *data),
>                          void *data);
>  
>  /**
> @@ -680,9 +680,9 @@ int dt_for_each_irq_map(const struct dt_device_node *dev,
>   * @data: Caller data passed to callback
>   */
>  int dt_for_each_range(const struct dt_device_node *dev,
> -                      int (*cb)(const struct dt_device_node *,
> +                      int (*cb)(const struct dt_device_node *dev,
>                                  uint64_t addr, uint64_t length,
> -                                void *),
> +                                void *data),
>                        void *data);
>  
>  /**
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 22:53:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 22:53:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567729.887166 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMz07-0003up-B9; Fri, 21 Jul 2023 22:53:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567729.887166; Fri, 21 Jul 2023 22:53:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMz07-0003ui-82; Fri, 21 Jul 2023 22:53:31 +0000
Received: by outflank-mailman (input) for mailman id 567729;
 Fri, 21 Jul 2023 22:53:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BzSz=DH=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMz05-0003uc-VC
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 22:53:29 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6787b137-2819-11ee-b23a-6b7b168915f2;
 Sat, 22 Jul 2023 00:53:28 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 3847060DFD;
 Fri, 21 Jul 2023 22:53:27 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8973DC433C8;
 Fri, 21 Jul 2023 22:53:25 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6787b137-2819-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689980006;
	bh=B7Zv4Q9nNIv9n7yJ5I6Nu/22QsZDMnbWe6WwC2ptEWE=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=RDGd9OZBPknrv7H0hKErPqH3kIAiWdrzm2iUAqbMJ6FlSqSCS7N7Q7uqWhDFw4avA
	 NbBcoBlPoaLnjpvUMqooOwyLzonE+7axrda6GU9vJkA3EbtQAJR1d6Dt0eaaWM19WG
	 bGFyawJb87P1RUj44o665bjlofmBBaBgP2krjq1H2NaHWiH2pNMJlJSlAmzjOa5gJH
	 zcThy/94Tng/4SsDKWJo0VPHOHIUx2jobsOZLqoc1zMBg3izvoM8yZS4yMLCgkfiIX
	 JwXv/zIbjaRHVks0yhtjICnJd+2zAAzRvPM79Tm+xFJYDnEZWt/V9WjaAK4W++cw5i
	 4qAByC9A3+6GQ==
Date: Fri, 21 Jul 2023 15:53:23 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org, 
    michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, 
    consulting@bugseng.com, Jan Beulich <jbeulich@suse.com>
Subject: Re: [XEN PATCH] efi: mechanical renaming to address MISRA C:2012
 Rule 5.3
In-Reply-To: <4da442b03ba783b4db0e56614bed43ce882a32ae.1689953085.git.nicola.vetrini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307211552340.3118466@ubuntu-linux-20-04-desktop>
References: <4da442b03ba783b4db0e56614bed43ce882a32ae.1689953085.git.nicola.vetrini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 21 Jul 2023, Nicola Vetrini wrote:
> Rule 5.3 has the following headline:
> "An identifier declared in an inner scope shall not hide an
> identifier declared in an outer scope"
> 
> The function parameters renamed in this patch are hiding a variable defined
> in an enclosing scope or a function identifier.
> 
> The following rename is made:
> - s/cfg/config/
> to distinguish from the variable 'cfg', which is hidden by the parameter inside
> the modified functions.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  xen/common/efi/boot.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
> index 24169b7b50..233639f3bc 100644
> --- a/xen/common/efi/boot.c
> +++ b/xen/common/efi/boot.c
> @@ -528,10 +528,10 @@ static char * __init split_string(char *s)
>      return NULL;
>  }
>  
> -static char *__init get_value(const struct file *cfg, const char *section,
> +static char *__init get_value(const struct file *config, const char *section,
>                                const char *item)
>  {
> -    char *ptr = cfg->str, *end = ptr + cfg->size;
> +    char *ptr = config->str, *end = ptr + config->size;
>      size_t slen = section ? strlen(section) : 0, ilen = strlen(item);
>      bool match = !slen;
>  
> @@ -821,9 +821,9 @@ static bool __init read_section(const EFI_LOADED_IMAGE *image,
>      return true;
>  }
>  
> -static void __init pre_parse(const struct file *cfg)
> +static void __init pre_parse(const struct file *config)
>  {
> -    char *ptr = cfg->str, *end = ptr + cfg->size;
> +    char *ptr = config->str, *end = ptr + config->size;
>      bool start = true, comment = false;
>  
>      for ( ; ptr < end; ++ptr )
> @@ -844,7 +844,7 @@ static void __init pre_parse(const struct file *cfg)
>          else
>              start = 0;
>      }
> -    if ( cfg->size && end[-1] )
> +    if ( config->size && end[-1] )
>           PrintStr(L"No newline at end of config file,"
>                     " last line will be ignored.\r\n");
>  }
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 22:57:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 22:57:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567733.887175 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMz3W-0004aS-Sx; Fri, 21 Jul 2023 22:57:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567733.887175; Fri, 21 Jul 2023 22:57:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMz3W-0004aL-QN; Fri, 21 Jul 2023 22:57:02 +0000
Received: by outflank-mailman (input) for mailman id 567733;
 Fri, 21 Jul 2023 22:57:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BzSz=DH=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMz3W-0004aF-Ft
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 22:57:02 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e6449279-2819-11ee-b23a-6b7b168915f2;
 Sat, 22 Jul 2023 00:57:00 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id C1B7160E9D;
 Fri, 21 Jul 2023 22:56:59 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95E09C433C9;
 Fri, 21 Jul 2023 22:56:57 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e6449279-2819-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689980219;
	bh=cODPKSnrGgWhxG3JOMp9/jCWaQjGjpn/HdrXhXLpGd8=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=h7Maiz3ihpz7Ltw1Q2w/2ysNEwj+t9AhofXPu21z8G376VoOlMVBrw8ucoLLzbHN4
	 /q4KhUW3B+fcZRJJMi9plAVIfx4wiGoFUrEC5+azAcUMAtpq4PnieYgZpFdcCrOV38
	 GWA6gJQFi7v/1Yodly90tXl0mwnihNcZDDp29e8INWggbyvpKB5Ps0z9Y9caPfHxuP
	 yxhYsk5VUAgNWPRMq8aFDbYXQ9mn8NpWNSTp92cR6MNLgQVekcupGZk7inA6ssugel
	 zuYMGCdB9R9MiVCGC7gL9SvgaFzImw5sc+bfXKkMLYLEG4idPbK5SXCEG34rUqU/0K
	 J8dI7VMMNp3tA==
Date: Fri, 21 Jul 2023 15:56:55 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org, 
    michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, 
    consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>
Subject: Re: [XEN PATCH] xen/spinlock: mechanically rename parameter name
 'debug'
In-Reply-To: <78255b6c5caaaa02dad638c7d4102ea793a09b88.1689953306.git.nicola.vetrini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307211555510.3118466@ubuntu-linux-20-04-desktop>
References: <78255b6c5caaaa02dad638c7d4102ea793a09b88.1689953306.git.nicola.vetrini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 21 Jul 2023, Nicola Vetrini wrote:
> Rule 5.3 has the following headline:
> "An identifier declared in an inner scope shall not hide an
> identifier declared in an outer scope"
> 
> To avoid any confusion resulting from the parameter 'debug'
> hiding the homonymous function declared at
> 'xen/arch/x86/include/asm/processor.h:428'
> the rename of parameters s/debug/dbg is performed.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> x86 maintainers CC'ed because the violation is caused by a declaration
> in an x86 file, but I reckon it would harm understandability if
> a function was renamed to 'dbg'
> ---
>  xen/common/spinlock.c      | 38 +++++++++++++++++++-------------------
>  xen/include/xen/spinlock.h |  6 +++---
>  2 files changed, 22 insertions(+), 22 deletions(-)
> 
> diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
> index 7f453234a9..d8d2e6ad1a 100644
> --- a/xen/common/spinlock.c
> +++ b/xen/common/spinlock.c
> @@ -78,7 +78,7 @@ static int __init cf_check lockdebug_init(void)
>  }
>  presmp_initcall(lockdebug_init);
>  
> -void check_lock(union lock_debug *debug, bool try)
> +void check_lock(union lock_debug *dbg, bool try)
>  {
>      bool irq_safe = !local_irq_is_enabled();
>      unsigned int cpu = smp_processor_id();
> @@ -118,12 +118,12 @@ void check_lock(union lock_debug *debug, bool try)
>      if ( try && irq_safe )
>          return;
>  
> -    if ( unlikely(debug->irq_safe != irq_safe) )
> +    if ( unlikely(dbg->irq_safe != irq_safe) )
>      {
>          union lock_debug seen, new = { 0 };
>  
>          new.irq_safe = irq_safe;
> -        seen.val = cmpxchg(&debug->val, LOCK_DEBUG_INITVAL, new.val);
> +        seen.val = cmpxchg(&dbg->val, LOCK_DEBUG_INITVAL, new.val);
>  
>          if ( !seen.unseen && seen.irq_safe == !irq_safe )
>          {
> @@ -137,14 +137,14 @@ void check_lock(union lock_debug *debug, bool try)
>          return;
>  
>      for ( i = 0; i < nr_taken; i++ )
> -        if ( taken[i] == debug )
> +        if ( taken[i] == dbg )
>          {
> -            printk("CHECKLOCK FAILURE: lock at %p taken recursively\n", debug);
> +            printk("CHECKLOCK FAILURE: lock at %p taken recursively\n", dbg);
>              BUG();
>          }
>  }
>  
> -static void check_barrier(union lock_debug *debug)
> +static void check_barrier(union lock_debug *dbg)
>  {
>      if ( unlikely(atomic_read(&spin_debug) <= 0) )
>          return;
> @@ -160,10 +160,10 @@ static void check_barrier(union lock_debug *debug)
>       * However, if we spin on an IRQ-unsafe lock with IRQs disabled then that
>       * is clearly wrong, for the same reason outlined in check_lock() above.
>       */
> -    BUG_ON(!local_irq_is_enabled() && !debug->irq_safe);
> +    BUG_ON(!local_irq_is_enabled() && !dbg->irq_safe);
>  }
>  
> -void lock_enter(const union lock_debug *debug)
> +void lock_enter(const union lock_debug *dbg)
>  {
>      unsigned int cpu = smp_processor_id();
>      const union lock_debug **taken = per_cpu(locks_taken, cpu);
> @@ -176,7 +176,7 @@ void lock_enter(const union lock_debug *debug)
>      local_irq_save(flags);
>  
>      if ( *nr_taken < lock_depth_size )
> -        taken[(*nr_taken)++] = debug;
> +        taken[(*nr_taken)++] = dbg;
>      else if ( !max_depth_reached )
>      {
>          max_depth_reached = true;
> @@ -187,7 +187,7 @@ void lock_enter(const union lock_debug *debug)
>      local_irq_restore(flags);
>  }
>  
> -void lock_exit(const union lock_debug *debug)
> +void lock_exit(const union lock_debug *dbg)
>  {
>      unsigned int cpu = smp_processor_id();
>      const union lock_debug **taken = per_cpu(locks_taken, cpu);
> @@ -202,7 +202,7 @@ void lock_exit(const union lock_debug *debug)
>  
>      for ( i = *nr_taken; i > 0; i-- )
>      {
> -        if ( taken[i - 1] == debug )
> +        if ( taken[i - 1] == dbg )
>          {
>              memmove(taken + i - 1, taken + i,
>                      (*nr_taken - i) * sizeof(*taken));
> @@ -217,28 +217,28 @@ void lock_exit(const union lock_debug *debug)
>  
>      if ( !max_depth_reached )
>      {
> -        printk("CHECKLOCK released lock at %p not recorded!\n", debug);
> +        printk("CHECKLOCK released lock at %p not recorded!\n", dbg);
>          WARN();
>      }
>  
>      local_irq_restore(flags);
>  }
>  
> -static void got_lock(union lock_debug *debug)
> +static void got_lock(union lock_debug *dbg)
>  {
> -    debug->cpu = smp_processor_id();
> +    dbg->cpu = smp_processor_id();
>  
> -    lock_enter(debug);
> +    lock_enter(dbg);
>  }
>  
> -static void rel_lock(union lock_debug *debug)
> +static void rel_lock(union lock_debug *dbg)
>  {
>      if ( atomic_read(&spin_debug) > 0 )
> -        BUG_ON(debug->cpu != smp_processor_id());
> +        BUG_ON(dbg->cpu != smp_processor_id());
>  
> -    lock_exit(debug);
> +    lock_exit(dbg);
>  
> -    debug->cpu = SPINLOCK_NO_CPU;
> +    dbg->cpu = SPINLOCK_NO_CPU;
>  }
>  
>  void spin_debug_enable(void)
> diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
> index 0a02a527dc..d303c56f8a 100644
> --- a/xen/include/xen/spinlock.h
> +++ b/xen/include/xen/spinlock.h
> @@ -22,9 +22,9 @@ union lock_debug {
>      };
>  };
>  #define _LOCK_DEBUG { LOCK_DEBUG_INITVAL }
> -void check_lock(union lock_debug *debug, bool try);
> -void lock_enter(const union lock_debug *debug);
> -void lock_exit(const union lock_debug *debug);
> +void check_lock(union lock_debug *dbg, bool try);
> +void lock_enter(const union lock_debug *dbg);
> +void lock_exit(const union lock_debug *dbg);
>  void spin_debug_enable(void);
>  void spin_debug_disable(void);
>  #else
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 23:06:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 23:06:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567737.887185 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMzCV-00067Q-OG; Fri, 21 Jul 2023 23:06:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567737.887185; Fri, 21 Jul 2023 23:06:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMzCV-00067J-Lc; Fri, 21 Jul 2023 23:06:19 +0000
Received: by outflank-mailman (input) for mailman id 567737;
 Fri, 21 Jul 2023 23:06:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BzSz=DH=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMzCU-00067D-6M
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 23:06:18 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 315dfdbb-281b-11ee-b23a-6b7b168915f2;
 Sat, 22 Jul 2023 01:06:16 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 40CE261D2F;
 Fri, 21 Jul 2023 23:06:13 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09FF1C433C8;
 Fri, 21 Jul 2023 23:06:10 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 315dfdbb-281b-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689980772;
	bh=KmLTHDIQH+KQu9Xe53d5fj4x8sC5QD5a5Dt4/v72IHM=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=bI0SemcuMqu3DKEzv5F0q2wfR3H3yUr/BVl4rgijD7Q3CUhYIIW1HCnSn9KUH8ArF
	 VPeUuxb8CeMh3zm010zBmA5gMs4pF5cWfDFCuVeBJHHkvzXE3shCFdbuu4Tnj66u1I
	 f55Xa9Y8MuHVkBhNUNc0GQipOfwDKc8K3dvg9xzCwnt/Uju6Zj6TbIP5poAr+3qJ9V
	 6yv9astYLhFZmNAOUOYCJKz/LZpY+oY3lOHbtJ2MaX7SpHMRoZs+xiQpEU7GXKiDDl
	 b3giR6Ody6e2lxnkPj6cyax32C50D5s6dM/8n4RpyvF/3ZlTRYIxfT9MAd8VTXmnVS
	 BHcA92Pbg27bw==
Date: Fri, 21 Jul 2023 16:06:09 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org, 
    michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, 
    consulting@bugseng.com, George Dunlap <george.dunlap@citrix.com>, 
    Dario Faggioli <dfaggioli@suse.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>
Subject: Re: [XEN PATCH] xen/sched: mechanical renaming to address MISRA
 C:2012 Rule 5.3
In-Reply-To: <9945fd23b0bb88f3e0c6054a7f992cfa642d3f9f.1689953420.git.nicola.vetrini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307211601230.3118466@ubuntu-linux-20-04-desktop>
References: <9945fd23b0bb88f3e0c6054a7f992cfa642d3f9f.1689953420.git.nicola.vetrini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 21 Jul 2023, Nicola Vetrini wrote:
> Rule 5.3 has the following headline:
> "An identifier declared in an inner scope shall not hide an
> identifier declared in an outer scope"
> 
> The renaming s/sched_id/scheduler_id of the function defined in
> 'xen/common/sched/core.c' prevents any hiding of that function
> by the many instances of omonymous function parameters.
> 
> Similarly, the renames
> - s/ops/operations
> - s/do_softirq/exec_softirq
> - s/loop/it
> are introduced for parameter names, to avoid any conflict
> with the homonymous variable or function defined in an enclosing
> scope.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
>  xen/common/sched/core.c    | 18 +++++++++---------
>  xen/common/sched/credit2.c |  4 ++--
>  xen/common/sysctl.c        |  2 +-
>  xen/include/xen/sched.h    |  2 +-
>  4 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
> index 022f548652..e74b1208bd 100644
> --- a/xen/common/sched/core.c
> +++ b/xen/common/sched/core.c
> @@ -99,13 +99,13 @@ static void sched_set_affinity(
>      struct sched_unit *unit, const cpumask_t *hard, const cpumask_t *soft);
>  
>  static struct sched_resource *cf_check
> -sched_idle_res_pick(const struct scheduler *ops, const struct sched_unit *unit)
> +sched_idle_res_pick(const struct scheduler *operations, const struct sched_unit *unit)

nit: code style, now the line is over 80 chars, could be fixed on commit


>  {
>      return unit->res;
>  }
>  
>  static void *cf_check
> -sched_idle_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
> +sched_idle_alloc_udata(const struct scheduler *operations, struct sched_unit *unit,
>                         void *dd)
>  {
>      /* Any non-NULL pointer is fine here. */
> @@ -113,12 +113,12 @@ sched_idle_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
>  }
>  
>  static void cf_check
> -sched_idle_free_udata(const struct scheduler *ops, void *priv)
> +sched_idle_free_udata(const struct scheduler *operations, void *priv)
>  {
>  }
>  
>  static void cf_check sched_idle_schedule(
> -    const struct scheduler *ops, struct sched_unit *unit, s_time_t now,
> +    const struct scheduler *operations, struct sched_unit *unit, s_time_t now,
>      bool tasklet_work_scheduled)
>  {
>      const unsigned int cpu = smp_processor_id();
> @@ -2040,8 +2040,8 @@ long do_set_timer_op(s_time_t timeout)
>      return 0;
>  }
>  
> -/* sched_id - fetch ID of current scheduler */
> -int sched_id(void)
> +/* scheduler_id - fetch ID of current scheduler */
> +int scheduler_id(void)
>  {
>      return ops.sched_id;
>  }
> @@ -2579,7 +2579,7 @@ static void cf_check sched_slave(void)
>      struct sched_unit    *prev = vprev->sched_unit, *next;
>      s_time_t              now;
>      spinlock_t           *lock;
> -    bool                  do_softirq = false;
> +    bool                  exec_softirq = false;

We don't typically use "exec" especially in the context of softirqs.
I would just change it to "softirq".


>      unsigned int          cpu = smp_processor_id();
>  
>      ASSERT_NOT_IN_ATOMIC();
> @@ -2604,7 +2604,7 @@ static void cf_check sched_slave(void)
>              return;
>          }
>  
> -        do_softirq = true;
> +        exec_softirq = true;
>      }
>  
>      if ( !prev->rendezvous_in_cnt )
> @@ -2614,7 +2614,7 @@ static void cf_check sched_slave(void)
>          rcu_read_unlock(&sched_res_rculock);
>  
>          /* Check for failed forced context switch. */
> -        if ( do_softirq )
> +        if ( exec_softirq )
>              raise_softirq(SCHEDULE_SOFTIRQ);
>  
>          return;
> diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
> index 87a1e31ee9..aba51a7963 100644
> --- a/xen/common/sched/credit2.c
> +++ b/xen/common/sched/credit2.c
> @@ -3884,7 +3884,7 @@ csched2_dump(const struct scheduler *ops)
>      list_for_each_entry ( rqd, &prv->rql, rql )
>      {
>          struct list_head *iter, *runq = &rqd->runq;
> -        int loop = 0;
> +        int it = 0;

Nice catch! This is almost a bug fix.


>          /* We need the lock to scan the runqueue. */
>          spin_lock(&rqd->lock);
> @@ -3901,7 +3901,7 @@ csched2_dump(const struct scheduler *ops)
>  
>              if ( svc )
>              {
> -                printk("\t%3d: ", loop++);
> +                printk("\t%3d: ", it++);
>                  csched2_dump_unit(prv, svc);
>              }
>          }
> diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
> index 0cbfe8bd44..7cabfb0230 100644
> --- a/xen/common/sysctl.c
> +++ b/xen/common/sysctl.c
> @@ -71,7 +71,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
>          break;
>  
>      case XEN_SYSCTL_sched_id:
> -        op->u.sched_id.sched_id = sched_id();
> +        op->u.sched_id.sched_id = scheduler_id();

I am confused about this one. There is no global variable or no other
global function named "sched_id". Why do we need to rename sched_id to
scheduler_id?


>          break;
>  
>      case XEN_SYSCTL_getdomaininfolist:
> diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
> index 854f3e32c0..bfe714d2e2 100644
> --- a/xen/include/xen/sched.h
> +++ b/xen/include/xen/sched.h
> @@ -791,7 +791,7 @@ int  sched_init_domain(struct domain *d, unsigned int poolid);
>  void sched_destroy_domain(struct domain *d);
>  long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *);
>  long sched_adjust_global(struct xen_sysctl_scheduler_op *);
> -int  sched_id(void);
> +int  scheduler_id(void);
>  
>  /*
>   * sched_get_id_by_name - retrieves a scheduler id given a scheduler name
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 23:13:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 23:13:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567741.887195 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMzJ9-0007ZG-DK; Fri, 21 Jul 2023 23:13:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567741.887195; Fri, 21 Jul 2023 23:13:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMzJ9-0007Z9-Al; Fri, 21 Jul 2023 23:13:11 +0000
Received: by outflank-mailman (input) for mailman id 567741;
 Fri, 21 Jul 2023 23:13:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BzSz=DH=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMzJ7-0007Z3-M2
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 23:13:09 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 26728197-281c-11ee-b23a-6b7b168915f2;
 Sat, 22 Jul 2023 01:13:07 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 56B5561DA6;
 Fri, 21 Jul 2023 23:13:06 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12038C433C7;
 Fri, 21 Jul 2023 23:13:04 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 26728197-281c-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689981185;
	bh=CQjnTZRieSPJBy5tqH0/lc09aY1+gJmSqr/VPaOnrlY=;
	h=Date:From:To:cc:Subject:From;
	b=oXrwpICt7Kx2mTe9TBiZFnq8H7+GEP3RV0g/Cspqa4gIXWY5xsrmYYDlxwHnmijZm
	 zAbNY16m0wDnOS8TzE4KV4wrEbPCo/8XauKQ6agweVaTXPhFOQubISG7+5GHur6+cg
	 LuPCLClT9+SLC0Lau2aB7+ORomYm0AyvluGo/lxLaZDYGdCOE4vdhYqT6uEzfq+1Go
	 VFCG3WKYCrQkOh06KmhDrTJVVh25rPvmucJ3Ab/hy+lkk3yDjDsUtx+tNbHBuqPv+o
	 WJW2sVQp+EXN81FbPhw8nULubiob2RvJxhoLLtUH0pmDv29BNccTcVehMARfpKjoGV
	 auX/pxaR9wveg==
Date: Fri, 21 Jul 2023 16:13:03 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: jgross@suse.com
cc: sstabellini@kernel.org, oleksandr_tyshchenko@epam.com, 
    xen-devel@lists.xenproject.org, pmladek@suse.com
Subject: [PATCH] xenbus: check xen_domain in xenbus_probe_initcall
Message-ID: <alpine.DEB.2.22.394.2307211609140.3118466@ubuntu-linux-20-04-desktop>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

The same way we already do in xenbus_init.
Fixes the following warning:

[  352.175563] Trying to free already-free IRQ 0
[  352.177355] WARNING: CPU: 1 PID: 88 at kernel/irq/manage.c:1893 free_irq+0xbf/0x350
[...]
[  352.213951] Call Trace:
[  352.214390]  <TASK>
[  352.214717]  ? __warn+0x81/0x170
[  352.215436]  ? free_irq+0xbf/0x350
[  352.215906]  ? report_bug+0x10b/0x200
[  352.216408]  ? prb_read_valid+0x17/0x20
[  352.216926]  ? handle_bug+0x44/0x80
[  352.217409]  ? exc_invalid_op+0x13/0x60
[  352.217932]  ? asm_exc_invalid_op+0x16/0x20
[  352.218497]  ? free_irq+0xbf/0x350
[  352.218979]  ? __pfx_xenbus_probe_thread+0x10/0x10
[  352.219600]  xenbus_probe+0x7a/0x80
[  352.221030]  xenbus_probe_thread+0x76/0xc0

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Tested-by: Petr Mladek <pmladek@suse.com>

diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index 58b732dcbfb8..e9bd3ed70108 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -811,6 +812,9 @@ static int xenbus_probe_thread(void *unused)
 
 static int __init xenbus_probe_initcall(void)
 {
+	if (!xen_domain())
+		return -ENODEV;
+
 	/*
 	 * Probe XenBus here in the XS_PV case, and also XS_HVM unless we
 	 * need to wait for the platform PCI device to come up or


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 23:24:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 23:24:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567745.887206 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMzTz-0000dW-CW; Fri, 21 Jul 2023 23:24:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567745.887206; Fri, 21 Jul 2023 23:24:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMzTz-0000dP-9n; Fri, 21 Jul 2023 23:24:23 +0000
Received: by outflank-mailman (input) for mailman id 567745;
 Fri, 21 Jul 2023 23:24:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BzSz=DH=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMzTx-0000dJ-A7
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 23:24:21 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b7162097-281d-11ee-b23a-6b7b168915f2;
 Sat, 22 Jul 2023 01:24:19 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 382E461DA1;
 Fri, 21 Jul 2023 23:24:18 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC073C433C8;
 Fri, 21 Jul 2023 23:24:15 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b7162097-281d-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689981857;
	bh=prLw98o3vJP9lHSr+Nzaxe/clMP848JoQo1u+ZWOpIE=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=Ox7XTg3FHZoVWenWtZ4UkMJjk59DQS5PekNYHa+bEcHZ/2kbZYYHqeOF3y4jgfLdB
	 Z+nttSnVJc2i08WHAXYswPEcw8kX6PhUOK+LGMNZpGZqjg8uQJpdfKRjZ/56k5U9xm
	 JaMr30lmA0M1AAFSa6XAh4zMl5ebvsXTtPX7XrArPCNY9g9bJFLbItlX+JdotpQmfB
	 u6mgS4Y22t3+O71EZbScglsGwfj/MFxPrUeeE6DzFqDPh+KVtyqEboDwm8yuRn/Ws7
	 MVesZy5/nF8Ky1AdnLcqufW5VF3RvstnsYMXztKUhBCZ/K9SVHo82DMXaEtUy7Wfa+
	 bMVaL2k2GiWgw==
Date: Fri, 21 Jul 2023 16:24:14 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Christopher Clark <christopher.w.clark@gmail.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    xen-devel@lists.xenproject.org, 
    Daniel Smith <dpsmith@apertussolutions.com>, stefano.stabellini@amd.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, 
    Bertrand Marquis <bertrand.marquis@arm.com>, 
    Luca Fancellu <luca.fancellu@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Rich Persaud <persaur@gmail.com>
Subject: Re: [PATCH 01/10] x86 setup: move x86 boot module counting into a
 new boot_info struct
In-Reply-To: <CACMJ4GZ5-Mg7Tg_H4mCj6EUUbwhhjZYid2V==c71o1fa5VPgOQ@mail.gmail.com>
Message-ID: <alpine.DEB.2.22.394.2307211616260.3118466@ubuntu-linux-20-04-desktop>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com> <20230701071835.41599-2-christopher.w.clark@gmail.com> <alpine.DEB.2.22.394.2307081124250.761183@ubuntu-linux-20-04-desktop>
 <CACMJ4GZ5-Mg7Tg_H4mCj6EUUbwhhjZYid2V==c71o1fa5VPgOQ@mail.gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

(You might want to check your email settings because it looks like you
sent an html email)

On Thu, 20 Jul 2023, Christopher Clark wrote:
>       > +struct boot_info {
> 
>       This is what we call struct bootmodules on ARM right? Would it help if
>       we used the same name?
> 
>       I am not asking to make the ARM code common because I think that would
>       probably be a lot more work.

This comment was wrong


> It becomes clearer to see by the end of the full hyperlaunch v1 series with the domain builder implemented, but it is also evident by the
> end of this series: the core/common boot info for Xen is more than just a set of bootmodules. This first patch is part of adding
> functionality to common incrementally, as a starting point, and reducing this boot info to just a bootmodules structure is going to be
> limiting it in this context.

After having read the whole series, it is clear that you made such a
fantastic progress toward unifying all the interfaces, both ARM and x86.
You managed to introduce interfaces so similar to the existing ARM
interfaces, that they are almost the same already. This is way better
than I expected when I wrote that comment to the first patch.

I think we should go the extra mile and move the ARM interfaces to
common, and make any changes needed by x86 there in common and
reflecting the changes back to ARM.

This will also allow us to move more dom0less init code from ARM to
common with fewer changes later on. 


From xen-devel-bounces@lists.xenproject.org Fri Jul 21 23:42:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Jul 2023 23:42:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567748.887216 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMzlK-00032l-R2; Fri, 21 Jul 2023 23:42:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567748.887216; Fri, 21 Jul 2023 23:42:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qMzlK-00032e-OT; Fri, 21 Jul 2023 23:42:18 +0000
Received: by outflank-mailman (input) for mailman id 567748;
 Fri, 21 Jul 2023 23:42:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BzSz=DH=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qMzlK-00032F-48
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 23:42:18 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 38a3b048-2820-11ee-b23a-6b7b168915f2;
 Sat, 22 Jul 2023 01:42:16 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id C407360DFD;
 Fri, 21 Jul 2023 23:42:14 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C590C433C7;
 Fri, 21 Jul 2023 23:42:13 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 38a3b048-2820-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689982934;
	bh=eEAfNLGH4YSMVXUKm0GLF2CIu2/cgnoC9JdRX8Lso3c=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=dfZo7cz0Ppx8UQDB7QYzhKUX6D6j9E6uqgC4rDYuffYpuBS4KX60zYJv6KYo6MRBd
	 t/31qIFEylR6ritV0sAfEnoT3AjYhUnvQNEEvRXuI0dycAhudkuZFJRM9Nj+eFNwDD
	 aA9EFoYs+TuIlmFAmAJHre5Ca9ZdGd1Nw7jV5h7ApnTw0dY64qtlOAf2wPXyeLFsxT
	 5pwULY7vDIB18QqgugLYmErF755Clczcg0npsmfvlgT5D0S+KkFkeAQ7Hf+HQUFahu
	 BeMuCggu3gRK46LXUz3HptGeQDGFL7csM048JgXslSjRpHlj4XhIXB2F1DkmBlS005
	 Vn4L3WxImUTfA==
Date: Fri, 21 Jul 2023 16:42:11 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
cc: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org, 
    Doug Goldstein <cardoe@cardoe.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    "committers@xenproject.org" <committers@xenproject.org>
Subject: Re: [PATCH] automation: avoid duplicated builds of staging branch
In-Reply-To: <ZLVLaPeyOwDYYUXL@mail-itl>
Message-ID: <alpine.DEB.2.22.394.2307211627080.3118466@ubuntu-linux-20-04-desktop>
References: <20230717130925.28183-1-marmarek@invisiblethingslab.com> <cf7ac648-dbef-80bb-986b-3fe0daef855a@citrix.com> <ZLVLaPeyOwDYYUXL@mail-itl>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; BOUNDARY="8323329-460610255-1689982514=:3118466"
Content-ID: <alpine.DEB.2.22.394.2307211635320.3118466@ubuntu-linux-20-04-desktop>

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-460610255-1689982514=:3118466
Content-Type: text/plain; CHARSET=UTF-8
Content-Transfer-Encoding: 8BIT
Content-ID: <alpine.DEB.2.22.394.2307211635321.3118466@ubuntu-linux-20-04-desktop>

On Mon, 17 Jul 2023, Marek Marczykowski-GÃ³recki wrote:
> On Mon, Jul 17, 2023 at 02:14:14PM +0100, Andrew Cooper wrote:
> > On 17/07/2023 2:09 pm, Marek Marczykowski-GÃ³recki wrote:
> > > "staging" branch is mirrored (automatically or manually) to several
> > > repositories. Avoid building it several times to not waste runner
> > > resources.

Hi Marek,

Let me try to understand the use-case a bit better. You would like the
following "staging" branch to run a full pipeline:
https://gitlab.com/xen-project/xen

But if someone under xen-project/people is mirroring
https://gitlab.com/xen-project/xen, this patch is attempting to skip the
additional pipeline. For instance, if I am mirroring staging in my
personal repo:

https://gitlab.com/xen-project/people/sstabellini/xen

We are skipping the additional pipeline there.


Is that correct? If so, it would be easier to ask everyone to make sure
they have "Trigger pipelines for mirror updates" unselected:

https://docs.gitlab.com/ee/user/project/repository/mirror/pull.html#trigger-pipelines-for-mirror-updates


> > > Signed-off-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
> > > ---
> > >  .gitlab-ci.yml | 6 ++++++
> > >  1 file changed, 6 insertions(+)
> > >
> > > diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> > > index c8bd7519d5fb..c3b05e32636b 100644
> > > --- a/.gitlab-ci.yml
> > > +++ b/.gitlab-ci.yml
> > > @@ -2,6 +2,12 @@ stages:
> > >    - build
> > >    - test
> > >  
> > > +workflow:
> > > +  rules:
> > > +    - if: '$CI_COMMIT_REF_NAME == "staging" && $CI_PROJECT_NAMESPACE != "xen-project"'
> > > +      when: never
> > > +    - when: always
> > 
> > If we're doing this for staging, we should include staging-* and
> > stable-*.Â  They're all the same from this point of view.
> > 
> > However, this does need double checking with the committers who use
> > gitlab regularly (CC'd).Â  This doesn't happen to interfere with my
> > commit workflow (I use a separate branch called for-staging), but I
> > can't talk for others.
> 
> I'd like to avoid broad patterns like staging-* or stable-* here, I'm
> pretty sure people do use branches like staging-X.Y-something. While it
> would be possible to exclude them by listing exact names, I'm not sure
> if it's worth it, given the push frequency to them (few times a month)
> and those being mirrored to less repositories (only FuSa fork?).
--8323329-460610255-1689982514=:3118466--


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 00:08:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 00:08:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567752.887225 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN0AN-0006Ds-0C; Sat, 22 Jul 2023 00:08:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567752.887225; Sat, 22 Jul 2023 00:08:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN0AM-0006Dl-Tn; Sat, 22 Jul 2023 00:08:10 +0000
Received: by outflank-mailman (input) for mailman id 567752;
 Sat, 22 Jul 2023 00:08:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DWMX=DI=invisiblethingslab.com=marmarek@srs-se1.protection.inumbo.net>)
 id 1qN0AL-0006Df-Dg
 for xen-devel@lists.xenproject.org; Sat, 22 Jul 2023 00:08:09 +0000
Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com
 [64.147.123.24]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d44eb633-2823-11ee-b23a-6b7b168915f2;
 Sat, 22 Jul 2023 02:08:06 +0200 (CEST)
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailout.west.internal (Postfix) with ESMTP id 0786332009FA;
 Fri, 21 Jul 2023 20:08:02 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute6.internal (MEProxy); Fri, 21 Jul 2023 20:08:03 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
 21 Jul 2023 20:08:01 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d44eb633-2823-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm3; t=
	1689984482; x=1690070882; bh=lo81Z5XiiVt0VQgrdwBS5L2EEO+iG6cybrF
	8gYyRMtM=; b=HwBcIIAEQjcolJxjRNeTdGhp56G+dCalpTVVOA5Kq8AFlRvxCn2
	fqvzBNDhMXV10fCC4hOFbE88OxKP+TJB74cBnX8xWbxbCtrwxY2ieLk0YX/CQ0CO
	VvnZTWmSCuddvvq6k2Mp9HNOwWLsn84EBFf5F+7AEs6PL4+onJ8NfyI0fjwy50Yt
	8D6AmylXJi92TgZRK6pwaHaXL8dHnmdtiNu1ZthuMABe2gNyqQce/4xws+zqgDmU
	HRTI0Cg5/8sC1n54d583VlXoxbpKGZ1O+DyvokZXuRieSUth7xrbrkWFLAQ5W9f1
	88GzaERDyukt0gO3AWwel8DXbBB2rKCj7cw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1689984482; x=1690070882; bh=lo81Z5XiiVt0V
	QgrdwBS5L2EEO+iG6cybrF8gYyRMtM=; b=DhLb7Xsn0UBhXP9X131Yj4lYiIcTf
	Q2y5rOOzlFOoGIbTXtWJoqdfUVRcx74gy1CuET6PEcec67ekkVcuJ0iATyrF740a
	nEtqVh5iSAj54pmBYLKtKoIZQVzhw1U7Oh6ulDhsKu43z7K7A+PU9l1d5rPtz7Vx
	zMopTJPgtqcpbGoXz26cCLWiRNuV/IbMYz7c/baGn2A7W8lgRFg5TLTVx+/9Kk7w
	Y6xKvTUrsyh41H+6wZ/P99OguJfgFmY55G28oOGXzNoWLgrLhTHwnG93oG6adXBK
	EJY9Tkpv9CajQ8xhe8vCnK5PJ9CIEkHf5vLyi2rwcKmC6hcpA0oct8oWw==
X-ME-Sender: <xms:4h27ZFSwHYj9BiSchAEBdb4k_4raxQe6YJ4vtusXmPLM4i1NJVZwDQ>
    <xme:4h27ZOyndU4SbH2x46UK21juooFMf1vWt5eTxL9NsMT0QnQ6Z0rdI8yKDvpSj0i4v
    Mm0uBfNP9RxUA>
X-ME-Received: <xmr:4h27ZK3f5omFkwZkXSc_0aVQrHGKKG7KccCPfH8tIAVnKr0BRDrf5DHmzcMviI5ikpHYvbdUFNkZ5SL_qSmLsEpv1-r2x_uv4xg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrheefgddvlecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpeffhffvvefukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpeforghrvghk
    ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh
    hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeevueej
    teegleelteduueevhfetgfffjeevtddvgfeiveehteehleegueelvdejveenucffohhmrg
    hinhepghhithhlrggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm
    pehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslh
    grsgdrtghomh
X-ME-Proxy: <xmx:4h27ZNAWoqKSClAW0jGUefkg6Vmviva1BK18bJbDZeGEsviXNDC9bg>
    <xmx:4h27ZOhahoOPp_rGyajpGiQud2yEmoE82aheXjciFOcrUXdACA450g>
    <xmx:4h27ZBrBpzSU9HawSUjNVjS6CciJxv3Q5Vtd_8FpSV5S7---73CTNA>
    <xmx:4h27ZBvdGl9rLOCbsz1owt2IpFQfCdZyoJB4zc-6bBlilGoxHcsj-w>
Feedback-ID: i1568416f:Fastmail
Date: Sat, 22 Jul 2023 02:07:57 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org, Doug Goldstein <cardoe@cardoe.com>,
	"committers@xenproject.org" <committers@xenproject.org>
Subject: Re: [PATCH] automation: avoid duplicated builds of staging branch
Message-ID: <ZLsd3tdSvTLwIyt3@mail-itl>
References: <20230717130925.28183-1-marmarek@invisiblethingslab.com>
 <cf7ac648-dbef-80bb-986b-3fe0daef855a@citrix.com>
 <ZLVLaPeyOwDYYUXL@mail-itl>
 <alpine.DEB.2.22.394.2307211627080.3118466@ubuntu-linux-20-04-desktop>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="dxU4tSYp7S118o/5"
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.22.394.2307211627080.3118466@ubuntu-linux-20-04-desktop>


--dxU4tSYp7S118o/5
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Sat, 22 Jul 2023 02:07:57 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org, Doug Goldstein <cardoe@cardoe.com>,
	"committers@xenproject.org" <committers@xenproject.org>
Subject: Re: [PATCH] automation: avoid duplicated builds of staging branch

On Fri, Jul 21, 2023 at 04:42:11PM -0700, Stefano Stabellini wrote:
> On Mon, 17 Jul 2023, Marek Marczykowski-G=C3=B3recki wrote:
> > On Mon, Jul 17, 2023 at 02:14:14PM +0100, Andrew Cooper wrote:
> > > On 17/07/2023 2:09 pm, Marek Marczykowski-G=C3=B3recki wrote:
> > > > "staging" branch is mirrored (automatically or manually) to several
> > > > repositories. Avoid building it several times to not waste runner
> > > > resources.
>=20
> Hi Marek,
>=20
> Let me try to understand the use-case a bit better. You would like the
> following "staging" branch to run a full pipeline:
> https://gitlab.com/xen-project/xen
>=20
> But if someone under xen-project/people is mirroring
> https://gitlab.com/xen-project/xen, this patch is attempting to skip the
> additional pipeline. For instance, if I am mirroring staging in my
> personal repo:
>=20
> https://gitlab.com/xen-project/people/sstabellini/xen
>=20
> We are skipping the additional pipeline there.

Yes.

> Is that correct? If so, it would be easier to ask everyone to make sure
> they have "Trigger pipelines for mirror updates" unselected:
>=20
> https://docs.gitlab.com/ee/user/project/repository/mirror/pull.html#trigg=
er-pipelines-for-mirror-updates

If that's set in gitlab as pull mirror (instead of push from somewhere
else), then that indeed may be enough. But is it really in all those
cases?

> > > > Signed-off-by: Marek Marczykowski-G=C3=B3recki <marmarek@invisiblet=
hingslab.com>
> > > > ---
> > > >  .gitlab-ci.yml | 6 ++++++
> > > >  1 file changed, 6 insertions(+)
> > > >
> > > > diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> > > > index c8bd7519d5fb..c3b05e32636b 100644
> > > > --- a/.gitlab-ci.yml
> > > > +++ b/.gitlab-ci.yml
> > > > @@ -2,6 +2,12 @@ stages:
> > > >    - build
> > > >    - test
> > > > =20
> > > > +workflow:
> > > > +  rules:
> > > > +    - if: '$CI_COMMIT_REF_NAME =3D=3D "staging" && $CI_PROJECT_NAM=
ESPACE !=3D "xen-project"'
> > > > +      when: never
> > > > +    - when: always
> > >=20
> > > If we're doing this for staging, we should include staging-* and
> > > stable-*.=C2=A0 They're all the same from this point of view.
> > >=20
> > > However, this does need double checking with the committers who use
> > > gitlab regularly (CC'd).=C2=A0 This doesn't happen to interfere with =
my
> > > commit workflow (I use a separate branch called for-staging), but I
> > > can't talk for others.
> >=20
> > I'd like to avoid broad patterns like staging-* or stable-* here, I'm
> > pretty sure people do use branches like staging-X.Y-something. While it
> > would be possible to exclude them by listing exact names, I'm not sure
> > if it's worth it, given the push frequency to them (few times a month)
> > and those being mirrored to less repositories (only FuSa fork?).


--=20
Best Regards,
Marek Marczykowski-G=C3=B3recki
Invisible Things Lab

--dxU4tSYp7S118o/5
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmS7Hd4ACgkQ24/THMrX
1ywjewf/R1KUufnfLRhWeuPIU/fKaEk935WklMZwFfdeVf7kqXk4HR5zdkUq+acj
qmfjca9R15IiJMArhUZEKwGDMQwTg1Xih2wtnI+2reDz6Dd5qIxZt8rP11SyCK3K
bhZN6Sue2WDSC2u52BGIVsOk3rqgUqH110ur0U/FJFxoLs6jI5wjHMMo8GfeWdcL
y5Ws0On6CCq0UFHxbjp3Ekg7uAIsqJHxZkJ9pAOFCVZpym53yJSQXoGQPSKqQPVH
L24obYuM2oySJjQBGJFig9xGlL8NFNfVbSiS3i5OiBoGI3BknGVTbugWW+4TEoA+
X3pyZQg/52BkleSGuf0434eScpjKgw==
=qfMs
-----END PGP SIGNATURE-----

--dxU4tSYp7S118o/5--


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 00:14:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 00:14:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567758.887236 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN0GA-0007fK-Lh; Sat, 22 Jul 2023 00:14:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567758.887236; Sat, 22 Jul 2023 00:14:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN0GA-0007fD-Il; Sat, 22 Jul 2023 00:14:10 +0000
Received: by outflank-mailman (input) for mailman id 567758;
 Sat, 22 Jul 2023 00:14:09 +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
 <SRS0=thWI=DI=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qN0G9-0007f0-4M
 for xen-devel@lists.xenproject.org; Sat, 22 Jul 2023 00:14:09 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ab76de93-2824-11ee-8611-37d641c3527e;
 Sat, 22 Jul 2023 02:14:06 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 3028D61DAE;
 Sat, 22 Jul 2023 00:14:05 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id B02F7C433C7;
 Sat, 22 Jul 2023 00:14:03 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ab76de93-2824-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689984844;
	bh=8sKC9ALdSao9tdX0iZmb79JF5NWrKuz1wihTRG1+SYs=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=JjAMBOB49+JbBl28mjnMTk4Gg66EqB8v+KJhva5OAgfghJOOLxss1IGKhI4tSReBu
	 WszjJHqOB2ecCDxISYuNtIH4P8yvTTOsEDPzzGGDHbagUIvOzQG5d8rLPJYUpvDQix
	 PpsyOMPamqqxOaWlJ8QcrT3Xkrm2ules2n98C2MrrYlKM0jNe8eY9Zh7VhVFfm34Os
	 OztYZfthvuPXINPRxZ+05K+KcYhrrvbKhpaXYIsZf/OEPfdCMcbi5TIBb3NEOnAwQV
	 YlncX4UH61lGdQaGrmqJ+J7rQeaaLZj53FVC560iEgedTJIBlKa6RWrKENo+ALejQP
	 tBdXAfBME1AWw==
Date: Fri, 21 Jul 2023 17:14:01 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org, 
    Doug Goldstein <cardoe@cardoe.com>, 
    "committers@xenproject.org" <committers@xenproject.org>
Subject: Re: [PATCH] automation: avoid duplicated builds of staging branch
In-Reply-To: <ZLsd3tdSvTLwIyt3@mail-itl>
Message-ID: <alpine.DEB.2.22.394.2307211712430.3118466@ubuntu-linux-20-04-desktop>
References: <20230717130925.28183-1-marmarek@invisiblethingslab.com> <cf7ac648-dbef-80bb-986b-3fe0daef855a@citrix.com> <ZLVLaPeyOwDYYUXL@mail-itl> <alpine.DEB.2.22.394.2307211627080.3118466@ubuntu-linux-20-04-desktop> <ZLsd3tdSvTLwIyt3@mail-itl>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="8323329-162608396-1689984844=:3118466"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-162608396-1689984844=:3118466
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT

On Sat, 22 Jul 2023, Marek Marczykowski-GÃ³recki wrote:
> On Fri, Jul 21, 2023 at 04:42:11PM -0700, Stefano Stabellini wrote:
> > On Mon, 17 Jul 2023, Marek Marczykowski-GÃ³recki wrote:
> > > On Mon, Jul 17, 2023 at 02:14:14PM +0100, Andrew Cooper wrote:
> > > > On 17/07/2023 2:09 pm, Marek Marczykowski-GÃ³recki wrote:
> > > > > "staging" branch is mirrored (automatically or manually) to several
> > > > > repositories. Avoid building it several times to not waste runner
> > > > > resources.
> > 
> > Hi Marek,
> > 
> > Let me try to understand the use-case a bit better. You would like the
> > following "staging" branch to run a full pipeline:
> > https://gitlab.com/xen-project/xen
> > 
> > But if someone under xen-project/people is mirroring
> > https://gitlab.com/xen-project/xen, this patch is attempting to skip the
> > additional pipeline. For instance, if I am mirroring staging in my
> > personal repo:
> > 
> > https://gitlab.com/xen-project/people/sstabellini/xen
> > 
> > We are skipping the additional pipeline there.
> 
> Yes.
> 
> > Is that correct? If so, it would be easier to ask everyone to make sure
> > they have "Trigger pipelines for mirror updates" unselected:
> > 
> > https://docs.gitlab.com/ee/user/project/repository/mirror/pull.html#trigger-pipelines-for-mirror-updates
> 
> If that's set in gitlab as pull mirror (instead of push from somewhere
> else), then that indeed may be enough. But is it really in all those
> cases?

Yes, it is an option in the pull mirror, by default should be unselected
I believe.
--8323329-162608396-1689984844=:3118466--


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 00:24:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 00:24:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567763.887246 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN0QC-0000jz-Ln; Sat, 22 Jul 2023 00:24:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567763.887246; Sat, 22 Jul 2023 00:24:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN0QC-0000js-IW; Sat, 22 Jul 2023 00:24:32 +0000
Received: by outflank-mailman (input) for mailman id 567763;
 Sat, 22 Jul 2023 00:24:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DWMX=DI=invisiblethingslab.com=marmarek@srs-se1.protection.inumbo.net>)
 id 1qN0QA-0000jm-U4
 for xen-devel@lists.xenproject.org; Sat, 22 Jul 2023 00:24:30 +0000
Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com
 [64.147.123.24]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1ea9ba90-2826-11ee-b23a-6b7b168915f2;
 Sat, 22 Jul 2023 02:24:29 +0200 (CEST)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.west.internal (Postfix) with ESMTP id CE84D3200906;
 Fri, 21 Jul 2023 20:24:26 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute5.internal (MEProxy); Fri, 21 Jul 2023 20:24:27 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
 21 Jul 2023 20:24:25 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1ea9ba90-2826-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm3; t=
	1689985466; x=1690071866; bh=h9BeXBbyXd+JNJTmt8/LKJ+nA8L7HE1pzc3
	5x8Tv9bU=; b=1MTwfSpoOBuiklF2pKqC9s9KfOkTWpxbVMXos7MkVyk3M3zvIr1
	ReW3J6rKgQLeFJ8GAsNKJhqM5rDzZYR+UO85/F8+qjtFr1lICxfuWRmj0pudeM+k
	ayI5Cl0Toms7ah7roWB4A41YUuGSIm7FXDU1UJJeQXt+nVAJazkpqDpYIhzPYdoi
	fN3ZzCL8s4ahVwN/Gf+dS+VxengJmDsvN7PZSisLm3q9dQ3+2leUuBS88Jzc2PFP
	BdAy2LgmeFPjjVuEiu5FdaoHOIoHqcd1uEmVc6hbNRJBpuMTv07uhDQ4CI6bRWA7
	b6soJ9sDLSFgHd0giwkhP7DWGwakSXbrr8w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1689985466; x=1690071866; bh=h9BeXBbyXd+JN
	JTmt8/LKJ+nA8L7HE1pzc35x8Tv9bU=; b=D3qx37UObfRkLxNH3DZxrCsxH0AV5
	5h0B2Ln1IvKIFuexefyJ8NBAzIqgKZMpFpPBDrl1KxfcqyGMOzxjCtJMhmlHmMHz
	OuaekqFP2NwRGavncWBuGVqwIEwS2+ggMC66MAzPErJH1N4LsMFyrTnKuhJdVCF9
	FOWuOjTHQ55nydit+z9FKHBx3ffPVKGzNX0DIjHDX3lrL6SLcB1HocIq47mmijmy
	f1fAMpfGDBuFjXRNOCQh0sp7g3xjvE23mMFSDmBswefkQwBYn/58Kb6XMg9UP94t
	ShLcE5cnh+wML2af24BqVWz50sxVuZe0qEfqKfDjDY0eoF2UuQ0DK35MA==
X-ME-Sender: <xms:uiG7ZFx0M5dalsZCcT5S4EIfu2cnjHRX2-V48Akd7DQL9lCa5PQgaA>
    <xme:uiG7ZFRPOfAawI0ALCFuhERWl1FUat8KordkTOAk4MJngKjzvaOUsag658unkJ001
    W2hyB317LwYBw>
X-ME-Received: <xmr:uiG7ZPWWfLYbLFp9KkaWLKSpJfginCqNm-A1dfTN-tctYMUGHxPn7yRRQUDcyRgCWluNOm2VQT8csPJRNOjcb3A7hmJzCrRj-RI>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrheefgdefvdcutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpeffhffvvefukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpeforghrvghk
    ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh
    hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeevueej
    teegleelteduueevhfetgfffjeevtddvgfeiveehteehleegueelvdejveenucffohhmrg
    hinhepghhithhlrggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm
    pehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslh
    grsgdrtghomh
X-ME-Proxy: <xmx:uiG7ZHjQa4eKTqwGlcQE2RbMQGG0KbLCmD2UF5QDjB7YitBqh34kvA>
    <xmx:uiG7ZHBXFwEqzzdTEmVDo_vDZo8_sVGCGLMzl8Eid4X7UQkcBtT_lQ>
    <xmx:uiG7ZAJ3pas5Gu0irzQCSekxqe0xQPZ8b8PvyzfpfCUnZ_aG_iMElA>
    <xmx:uiG7ZKPiS5MHl180n8kJY5oO0PaqhYtsxEvKGnkNH2FF0WTyv7DTOw>
Feedback-ID: i1568416f:Fastmail
Date: Sat, 22 Jul 2023 02:24:22 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org, Doug Goldstein <cardoe@cardoe.com>,
	"committers@xenproject.org" <committers@xenproject.org>
Subject: Re: [PATCH] automation: avoid duplicated builds of staging branch
Message-ID: <ZLshtl8KKgyR1wlY@mail-itl>
References: <20230717130925.28183-1-marmarek@invisiblethingslab.com>
 <cf7ac648-dbef-80bb-986b-3fe0daef855a@citrix.com>
 <ZLVLaPeyOwDYYUXL@mail-itl>
 <alpine.DEB.2.22.394.2307211627080.3118466@ubuntu-linux-20-04-desktop>
 <ZLsd3tdSvTLwIyt3@mail-itl>
 <alpine.DEB.2.22.394.2307211712430.3118466@ubuntu-linux-20-04-desktop>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="JF/W8SrCh71XL8RF"
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.22.394.2307211712430.3118466@ubuntu-linux-20-04-desktop>


--JF/W8SrCh71XL8RF
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Sat, 22 Jul 2023 02:24:22 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org, Doug Goldstein <cardoe@cardoe.com>,
	"committers@xenproject.org" <committers@xenproject.org>
Subject: Re: [PATCH] automation: avoid duplicated builds of staging branch

On Fri, Jul 21, 2023 at 05:14:01PM -0700, Stefano Stabellini wrote:
> On Sat, 22 Jul 2023, Marek Marczykowski-G=C3=B3recki wrote:
> > On Fri, Jul 21, 2023 at 04:42:11PM -0700, Stefano Stabellini wrote:
> > > On Mon, 17 Jul 2023, Marek Marczykowski-G=C3=B3recki wrote:
> > > > On Mon, Jul 17, 2023 at 02:14:14PM +0100, Andrew Cooper wrote:
> > > > > On 17/07/2023 2:09 pm, Marek Marczykowski-G=C3=B3recki wrote:
> > > > > > "staging" branch is mirrored (automatically or manually) to sev=
eral
> > > > > > repositories. Avoid building it several times to not waste runn=
er
> > > > > > resources.
> > >=20
> > > Hi Marek,
> > >=20
> > > Let me try to understand the use-case a bit better. You would like the
> > > following "staging" branch to run a full pipeline:
> > > https://gitlab.com/xen-project/xen
> > >=20
> > > But if someone under xen-project/people is mirroring
> > > https://gitlab.com/xen-project/xen, this patch is attempting to skip =
the
> > > additional pipeline. For instance, if I am mirroring staging in my
> > > personal repo:
> > >=20
> > > https://gitlab.com/xen-project/people/sstabellini/xen
> > >=20
> > > We are skipping the additional pipeline there.
> >=20
> > Yes.
> >=20
> > > Is that correct? If so, it would be easier to ask everyone to make su=
re
> > > they have "Trigger pipelines for mirror updates" unselected:
> > >=20
> > > https://docs.gitlab.com/ee/user/project/repository/mirror/pull.html#t=
rigger-pipelines-for-mirror-updates
> >=20
> > If that's set in gitlab as pull mirror (instead of push from somewhere
> > else), then that indeed may be enough. But is it really in all those
> > cases?
>=20
> Yes, it is an option in the pull mirror, by default should be unselected
> I believe.

Well, if that's the case, either it got manually enabled on those 4 (?)
forks, or those are using something else for mirroring the staging
branch (in which case, the setting would not help). I can't see this
part of the settings in other's repositories, so I don't know.

--=20
Best Regards,
Marek Marczykowski-G=C3=B3recki
Invisible Things Lab

--JF/W8SrCh71XL8RF
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmS7IbYACgkQ24/THMrX
1yxuNQf/U54xksbUsHKef26JQ2eBFnCk8oz8tUkmWzfSRRec7OtclFbftjvnmKrh
txt8eqdsBoUvJEA+vTyYJRALudLBP6tG7Sd8TmTZnMltb8MZ4elMi2q4zi33Mjft
GHKlC7INDoLc3m6hVEtWSOXJI4RfV3eb2SlDIDBZ0nV3pD81JhQ4x+BpdeKJxhJz
cBxuSxJnQ9JNCubPf46AY2yxpCBu5ltc1T9LiucBArYtdGTvsgM1qohbM64QkW4d
r9+m17nFP2rClIVTy3Mn2YnA6eZrDNRVh/BMVDSEe/H94Q4TYdoN3kd/ZiEGFqGj
SVrNdYuDqqWMDmoL6IyZOiOAXIneig==
=x2R8
-----END PGP SIGNATURE-----

--JF/W8SrCh71XL8RF--


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 00:50:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 00:50:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567773.887259 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN0oo-0003IN-On; Sat, 22 Jul 2023 00:49:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567773.887259; Sat, 22 Jul 2023 00:49:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN0oo-0003IA-Lz; Sat, 22 Jul 2023 00:49:58 +0000
Received: by outflank-mailman (input) for mailman id 567773;
 Sat, 22 Jul 2023 00:49:56 +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
 <SRS0=thWI=DI=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qN0om-0003H4-UW
 for xen-devel@lists.xenproject.org; Sat, 22 Jul 2023 00:49:56 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id abaa3e13-2829-11ee-8611-37d641c3527e;
 Sat, 22 Jul 2023 02:49:54 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id F289B61DAE;
 Sat, 22 Jul 2023 00:49:52 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81ED7C433CA;
 Sat, 22 Jul 2023 00:49:51 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: abaa3e13-2829-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689986992;
	bh=LgQMwlGOLQXVjU9U9x2drQ9jLSZCHIVH1Rk4rpRX6Ao=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=Sm7GEKxGnB+FWitJeq/VBDkKdgQwIZvIwsNHbj0A9fytoYq8AzbyrNwEJIQkGMUdU
	 mF+wHW/IjWHBgRsHyUMiAAeP0JbovAxiXye1WxtREGgF6AK4D/a/BpZtHNteFuRkgI
	 1LKHD7MrXN0Ge5zjkHoYfzY/Wj3daXrwGPD/b3qEkJjh/OgTMpgqcsbL1b1p1oxbbT
	 fmkQAkd5l5ZEGlkdcd+J4gH864zzjGZIsF5xK4LJzZBsMB878CsnlCSqZWfUgtC6zV
	 oFIzwxFiet0uPSYFA6wLKDGLO8pWSpF+iQFia5TI5YBP4Tp25iiEh6dhtQOdVTPGbL
	 xmLnb/fV6UVLg==
Date: Fri, 21 Jul 2023 17:49:49 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org, 
    Doug Goldstein <cardoe@cardoe.com>, 
    "committers@xenproject.org" <committers@xenproject.org>
Subject: Re: [PATCH] automation: avoid duplicated builds of staging branch
In-Reply-To: <ZLshtl8KKgyR1wlY@mail-itl>
Message-ID: <alpine.DEB.2.22.394.2307211749270.3118466@ubuntu-linux-20-04-desktop>
References: <20230717130925.28183-1-marmarek@invisiblethingslab.com> <cf7ac648-dbef-80bb-986b-3fe0daef855a@citrix.com> <ZLVLaPeyOwDYYUXL@mail-itl> <alpine.DEB.2.22.394.2307211627080.3118466@ubuntu-linux-20-04-desktop> <ZLsd3tdSvTLwIyt3@mail-itl>
 <alpine.DEB.2.22.394.2307211712430.3118466@ubuntu-linux-20-04-desktop> <ZLshtl8KKgyR1wlY@mail-itl>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="8323329-1845796540-1689986991=:3118466"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-1845796540-1689986991=:3118466
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT

On Sat, 22 Jul 2023, Marek Marczykowski-GÃ³recki wrote:
> On Fri, Jul 21, 2023 at 05:14:01PM -0700, Stefano Stabellini wrote:
> > On Sat, 22 Jul 2023, Marek Marczykowski-GÃ³recki wrote:
> > > On Fri, Jul 21, 2023 at 04:42:11PM -0700, Stefano Stabellini wrote:
> > > > On Mon, 17 Jul 2023, Marek Marczykowski-GÃ³recki wrote:
> > > > > On Mon, Jul 17, 2023 at 02:14:14PM +0100, Andrew Cooper wrote:
> > > > > > On 17/07/2023 2:09 pm, Marek Marczykowski-GÃ³recki wrote:
> > > > > > > "staging" branch is mirrored (automatically or manually) to several
> > > > > > > repositories. Avoid building it several times to not waste runner
> > > > > > > resources.
> > > > 
> > > > Hi Marek,
> > > > 
> > > > Let me try to understand the use-case a bit better. You would like the
> > > > following "staging" branch to run a full pipeline:
> > > > https://gitlab.com/xen-project/xen
> > > > 
> > > > But if someone under xen-project/people is mirroring
> > > > https://gitlab.com/xen-project/xen, this patch is attempting to skip the
> > > > additional pipeline. For instance, if I am mirroring staging in my
> > > > personal repo:
> > > > 
> > > > https://gitlab.com/xen-project/people/sstabellini/xen
> > > > 
> > > > We are skipping the additional pipeline there.
> > > 
> > > Yes.
> > > 
> > > > Is that correct? If so, it would be easier to ask everyone to make sure
> > > > they have "Trigger pipelines for mirror updates" unselected:
> > > > 
> > > > https://docs.gitlab.com/ee/user/project/repository/mirror/pull.html#trigger-pipelines-for-mirror-updates
> > > 
> > > If that's set in gitlab as pull mirror (instead of push from somewhere
> > > else), then that indeed may be enough. But is it really in all those
> > > cases?
> > 
> > Yes, it is an option in the pull mirror, by default should be unselected
> > I believe.
> 
> Well, if that's the case, either it got manually enabled on those 4 (?)
> forks, or those are using something else for mirroring the staging
> branch (in which case, the setting would not help). I can't see this
> part of the settings in other's repositories, so I don't know.

Do you know the name of those 4 forks? I can help figure it out.
--8323329-1845796540-1689986991=:3118466--


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 01:01:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 01:01:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567776.887269 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN0zf-00089y-Ou; Sat, 22 Jul 2023 01:01:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567776.887269; Sat, 22 Jul 2023 01:01:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN0zf-000895-L6; Sat, 22 Jul 2023 01:01:11 +0000
Received: by outflank-mailman (input) for mailman id 567776;
 Sat, 22 Jul 2023 01:01:11 +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
 <SRS0=DWMX=DI=invisiblethingslab.com=marmarek@srs-se1.protection.inumbo.net>)
 id 1qN0ze-0007gq-UK
 for xen-devel@lists.xenproject.org; Sat, 22 Jul 2023 01:01:10 +0000
Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com
 [64.147.123.24]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3aa9d8be-282b-11ee-8611-37d641c3527e;
 Sat, 22 Jul 2023 03:01:03 +0200 (CEST)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.west.internal (Postfix) with ESMTP id 513C63200915;
 Fri, 21 Jul 2023 21:01:01 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute1.internal (MEProxy); Fri, 21 Jul 2023 21:01:01 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
 21 Jul 2023 21:00:59 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3aa9d8be-282b-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm3; t=
	1689987660; x=1690074060; bh=GcLBQU1lGaT0lerdE79/hPxAYG7jbojAFSe
	n6gNqjg0=; b=q1U2mvHgCL+epm57CYH6jcjVDhUPPy787jLBFNCSapzaR16dfNT
	pGj+tilVn0+yy5RgTLO2vNoAwFfgBz0BCxy7ZxD+heb0yScZgzFiedwhxrm0LELU
	WAQb9XCOuceQFtE8mSDzVjjzf0FgzVJ7+MfUXrCxVcGn1otVhBqGvgQj28rxE1Kr
	dWq58TeMQKZKqJ6Xl6Der8j1l/vxDDr0frs9PWNpYKvcHpw01LemJx6kC7Z8E/Ng
	6p5FdrBdXK1bngkxQbENuk2HGBPtZC/PoAjfqX/PHilkmuWnbKp0qcZUPUprgmGY
	Lw7IqCK61Rshtm4nWsECYl/BbvF5bJqnqHg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1689987660; x=1690074060; bh=GcLBQU1lGaT0l
	erdE79/hPxAYG7jbojAFSen6gNqjg0=; b=u6VHVIOjEcCxQWu1Dq/zjRmo7ktYy
	eSwGJUmVyHt+qfIppe8l6pGZVXL9VjuAXC4a9QzAAEg9tS8/lpAOmdyUREuEpmN7
	wGBGYt5f4lshEzimP5d+u+8HlCcAS2UW4v1rSrETPRArBFbe5WQ1VT2vGWoA5PX/
	TcPD5WdbFgTZLean9p87rHkTSatwhT2nteG2s5BjK4lb6tRxiI0c1bhl6B8Kr48B
	ACvNi9c94TJNO9/3hRKBDPCOP0AhPHcY7+2UPx0a+s9xnDWqAOH4/3uoSAxMX2GI
	mbP9j4VkRRjvwLAxke9ut37qpOYYphIbjScXEE9KVgp5YxYdEMa0JxBGQ==
X-ME-Sender: <xms:TCq7ZH1ZPDXIy0e-ucpTIm00smkj5FzigWhlucBKAFCVAUMb-vRe7Q>
    <xme:TCq7ZGGEShAdkXbq5IfSFta3uKAc-rPNYol_8xMijaJ0TmSxRot4vAHXVbA5hScqE
    ZhuiSi4yiF9hg>
X-ME-Received: <xmr:TCq7ZH7bdQFT8pmalzfmu5SquCrGjv5GUbvkkYW4H6o7zRvcr7kjbbyoLwUVApW5LOkJRSnkQiE1axUar5CSY4giGFuQX51vmBQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrheefgdegtdcutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpeffhffvvefukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpeforghrvghk
    ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh
    hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeevueej
    teegleelteduueevhfetgfffjeevtddvgfeiveehteehleegueelvdejveenucffohhmrg
    hinhepghhithhlrggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm
    pehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslh
    grsgdrtghomh
X-ME-Proxy: <xmx:TCq7ZM0UbWNS3M65v9f_hQ3hSYi0zGEokVloGRqyJLBIzSckFa86Gg>
    <xmx:TCq7ZKHNYYXWCgKD_zjZOU9r1sOvY39Mj8MShcYCtKdyeVR5UEnxGw>
    <xmx:TCq7ZN_PtVg-dM5FYg59TYvTmTTTTR2QSJOfIdAWF0ACC0SpM3Ehag>
    <xmx:TCq7ZPSNYmQmk9ug7UAWxnK9DruuJTEg7N6lsK5_oPDb681WfYLNRA>
Feedback-ID: i1568416f:Fastmail
Date: Sat, 22 Jul 2023 03:00:57 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org, Doug Goldstein <cardoe@cardoe.com>,
	"committers@xenproject.org" <committers@xenproject.org>
Subject: Re: [PATCH] automation: avoid duplicated builds of staging branch
Message-ID: <ZLsqSWXvwxBQK3NG@mail-itl>
References: <20230717130925.28183-1-marmarek@invisiblethingslab.com>
 <cf7ac648-dbef-80bb-986b-3fe0daef855a@citrix.com>
 <ZLVLaPeyOwDYYUXL@mail-itl>
 <alpine.DEB.2.22.394.2307211627080.3118466@ubuntu-linux-20-04-desktop>
 <ZLsd3tdSvTLwIyt3@mail-itl>
 <alpine.DEB.2.22.394.2307211712430.3118466@ubuntu-linux-20-04-desktop>
 <ZLshtl8KKgyR1wlY@mail-itl>
 <alpine.DEB.2.22.394.2307211749270.3118466@ubuntu-linux-20-04-desktop>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="h7eMUhM/gt6xWL96"
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.22.394.2307211749270.3118466@ubuntu-linux-20-04-desktop>


--h7eMUhM/gt6xWL96
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Sat, 22 Jul 2023 03:00:57 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org, Doug Goldstein <cardoe@cardoe.com>,
	"committers@xenproject.org" <committers@xenproject.org>
Subject: Re: [PATCH] automation: avoid duplicated builds of staging branch

On Fri, Jul 21, 2023 at 05:49:49PM -0700, Stefano Stabellini wrote:
> On Sat, 22 Jul 2023, Marek Marczykowski-G=C3=B3recki wrote:
> > On Fri, Jul 21, 2023 at 05:14:01PM -0700, Stefano Stabellini wrote:
> > > On Sat, 22 Jul 2023, Marek Marczykowski-G=C3=B3recki wrote:
> > > > On Fri, Jul 21, 2023 at 04:42:11PM -0700, Stefano Stabellini wrote:
> > > > > On Mon, 17 Jul 2023, Marek Marczykowski-G=C3=B3recki wrote:
> > > > > > On Mon, Jul 17, 2023 at 02:14:14PM +0100, Andrew Cooper wrote:
> > > > > > > On 17/07/2023 2:09 pm, Marek Marczykowski-G=C3=B3recki wrote:
> > > > > > > > "staging" branch is mirrored (automatically or manually) to=
 several
> > > > > > > > repositories. Avoid building it several times to not waste =
runner
> > > > > > > > resources.
> > > > >=20
> > > > > Hi Marek,
> > > > >=20
> > > > > Let me try to understand the use-case a bit better. You would lik=
e the
> > > > > following "staging" branch to run a full pipeline:
> > > > > https://gitlab.com/xen-project/xen
> > > > >=20
> > > > > But if someone under xen-project/people is mirroring
> > > > > https://gitlab.com/xen-project/xen, this patch is attempting to s=
kip the
> > > > > additional pipeline. For instance, if I am mirroring staging in my
> > > > > personal repo:
> > > > >=20
> > > > > https://gitlab.com/xen-project/people/sstabellini/xen
> > > > >=20
> > > > > We are skipping the additional pipeline there.
> > > >=20
> > > > Yes.
> > > >=20
> > > > > Is that correct? If so, it would be easier to ask everyone to mak=
e sure
> > > > > they have "Trigger pipelines for mirror updates" unselected:
> > > > >=20
> > > > > https://docs.gitlab.com/ee/user/project/repository/mirror/pull.ht=
ml#trigger-pipelines-for-mirror-updates
> > > >=20
> > > > If that's set in gitlab as pull mirror (instead of push from somewh=
ere
> > > > else), then that indeed may be enough. But is it really in all those
> > > > cases?
> > >=20
> > > Yes, it is an option in the pull mirror, by default should be unselec=
ted
> > > I believe.
> >=20
> > Well, if that's the case, either it got manually enabled on those 4 (?)
> > forks, or those are using something else for mirroring the staging
> > branch (in which case, the setting would not help). I can't see this
> > part of the settings in other's repositories, so I don't know.
>=20
> Do you know the name of those 4 forks? I can help figure it out.

Looking at "activity" view on gitlab, I see those:
https://gitlab.com/xen-project/fusa/xen-integration
https://gitlab.com/xen-project/people/olkur/xen
https://gitlab.com/xen-project/people/andyhhp/xen

There are few more that have staging branch almost up to date, but seems
to be pushed manually (based on it being not fully up to date) and less
often.

--=20
Best Regards,
Marek Marczykowski-G=C3=B3recki
Invisible Things Lab

--h7eMUhM/gt6xWL96
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmS7KkgACgkQ24/THMrX
1yxhegf8CpIRuscVvz8eu4Peya5tueT3wk+FsEjUf2JrIercZpeFZNW9se2/y9KP
tKQtXv0sii6of1H0pI+YjzPrpo2XFFxAddDhn6xwdP56fVL/EpXjVLJLsRnOkOuQ
VNjQNSifYVosokYFHH+ZtnKUDS0Z4aoheeH6E6CwahBawIBFPDp8BCsmM1vScpXc
1X+CqOCngfDgkAgCYEWMU2rhEKxFFVqmBGdvuYcm1QyKcp2n0yXF2UV10tSzmBcM
kdFq7DjeXY43NWNe1h175Y06fiti1dXPWAPIcZN0lz5I55KJusInBjyW0ivHxOkV
bJxIfhTvMQzuhSTD2a/HGkYjFWtN0g==
=ph9t
-----END PGP SIGNATURE-----

--h7eMUhM/gt6xWL96--


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 01:19:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 01:19:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567783.887278 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN1Go-0005Yp-AU; Sat, 22 Jul 2023 01:18:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567783.887278; Sat, 22 Jul 2023 01:18:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN1Go-0005Yi-7j; Sat, 22 Jul 2023 01:18:54 +0000
Received: by outflank-mailman (input) for mailman id 567783;
 Sat, 22 Jul 2023 01:18:53 +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
 <SRS0=thWI=DI=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qN1Gn-0005Yc-F2
 for xen-devel@lists.xenproject.org; Sat, 22 Jul 2023 01:18:53 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b681ef1e-282d-11ee-8611-37d641c3527e;
 Sat, 22 Jul 2023 03:18:50 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 2639461D2F;
 Sat, 22 Jul 2023 01:18:49 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 823D0C433C8;
 Sat, 22 Jul 2023 01:18:47 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b681ef1e-282d-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1689988728;
	bh=c7voaczwL4C3/cUlCQHFzpdCEJVNGPqDpWzgz0X/TKg=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=rfi+tNHKOU7nF8C05hlAwNLyunhOYfu4aLFIHd6WUIUEaFQuwsOTFZ8k5JXnG1CXi
	 G3ex+iIrGD0+enAu6F3kTVScM25/xQNSnwwl2+no1NuI3mZX07MuftjpNexH/COSk/
	 eYsV6s2B+A0/vnLqv3xunc4jKx+xZLylhqrxXJILbcuPi0tw4Oj3nyPhm3EeLxlerI
	 hBuEJRB+CTAk/Lg+/SP98P6lIFxvQOEGSCR1HxUgYhzc26ZoEr0M8L3jnM2rj3NztP
	 k5ixNDyRDKO3SIheyBEZoAe3o1vaufBWXpm0IZU7Adul2Ve+OWio5yGkdq0PO/8snQ
	 X57z9ppezqbGg==
Date: Fri, 21 Jul 2023 18:18:45 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>, 
    andrew.cooper3@citrix.com, oleksii.kurochko@gmail.com
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org, 
    Doug Goldstein <cardoe@cardoe.com>, 
    "committers@xenproject.org" <committers@xenproject.org>
Subject: Re: [PATCH] automation: avoid duplicated builds of staging branch
In-Reply-To: <ZLsqSWXvwxBQK3NG@mail-itl>
Message-ID: <alpine.DEB.2.22.394.2307211811020.3118466@ubuntu-linux-20-04-desktop>
References: <20230717130925.28183-1-marmarek@invisiblethingslab.com> <cf7ac648-dbef-80bb-986b-3fe0daef855a@citrix.com> <ZLVLaPeyOwDYYUXL@mail-itl> <alpine.DEB.2.22.394.2307211627080.3118466@ubuntu-linux-20-04-desktop> <ZLsd3tdSvTLwIyt3@mail-itl>
 <alpine.DEB.2.22.394.2307211712430.3118466@ubuntu-linux-20-04-desktop> <ZLshtl8KKgyR1wlY@mail-itl> <alpine.DEB.2.22.394.2307211749270.3118466@ubuntu-linux-20-04-desktop> <ZLsqSWXvwxBQK3NG@mail-itl>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; BOUNDARY="8323329-1674952825-1689988449=:3118466"
Content-ID: <alpine.DEB.2.22.394.2307211814130.3118466@ubuntu-linux-20-04-desktop>

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-1674952825-1689988449=:3118466
Content-Type: text/plain; CHARSET=UTF-8
Content-Transfer-Encoding: 8BIT
Content-ID: <alpine.DEB.2.22.394.2307211814131.3118466@ubuntu-linux-20-04-desktop>

Hi Andrew, Oleksii,

Please see below.

It looks like you have configured your personal repositories to mirror
upstream Xen:

https://gitlab.com/xen-project/people/olkur/xen
https://gitlab.com/xen-project/people/andyhhp/xen

Make sure that the option "Trigger pipelines for mirror updates" is
unselected.

If you setup the mirror a long time ago, you might want to stop the
mirror and start it again.

I have just done the same for fusa/xen-integration: I had to go to
settings->repository, stop the existing mirror, and create a new one
making sure "Trigger pipelines for mirror updates" is off.

Cheers,

Stefano



On Sat, 22 Jul 2023, Marek Marczykowski-GÃ³recki wrote:
> On Fri, Jul 21, 2023 at 05:49:49PM -0700, Stefano Stabellini wrote:
> > On Sat, 22 Jul 2023, Marek Marczykowski-GÃ³recki wrote:
> > > On Fri, Jul 21, 2023 at 05:14:01PM -0700, Stefano Stabellini wrote:
> > > > On Sat, 22 Jul 2023, Marek Marczykowski-GÃ³recki wrote:
> > > > > On Fri, Jul 21, 2023 at 04:42:11PM -0700, Stefano Stabellini wrote:
> > > > > > On Mon, 17 Jul 2023, Marek Marczykowski-GÃ³recki wrote:
> > > > > > > On Mon, Jul 17, 2023 at 02:14:14PM +0100, Andrew Cooper wrote:
> > > > > > > > On 17/07/2023 2:09 pm, Marek Marczykowski-GÃ³recki wrote:
> > > > > > > > > "staging" branch is mirrored (automatically or manually) to several
> > > > > > > > > repositories. Avoid building it several times to not waste runner
> > > > > > > > > resources.
> > > > > > 
> > > > > > Hi Marek,
> > > > > > 
> > > > > > Let me try to understand the use-case a bit better. You would like the
> > > > > > following "staging" branch to run a full pipeline:
> > > > > > https://gitlab.com/xen-project/xen
> > > > > > 
> > > > > > But if someone under xen-project/people is mirroring
> > > > > > https://gitlab.com/xen-project/xen, this patch is attempting to skip the
> > > > > > additional pipeline. For instance, if I am mirroring staging in my
> > > > > > personal repo:
> > > > > > 
> > > > > > https://gitlab.com/xen-project/people/sstabellini/xen
> > > > > > 
> > > > > > We are skipping the additional pipeline there.
> > > > > 
> > > > > Yes.
> > > > > 
> > > > > > Is that correct? If so, it would be easier to ask everyone to make sure
> > > > > > they have "Trigger pipelines for mirror updates" unselected:
> > > > > > 
> > > > > > https://docs.gitlab.com/ee/user/project/repository/mirror/pull.html#trigger-pipelines-for-mirror-updates
> > > > > 
> > > > > If that's set in gitlab as pull mirror (instead of push from somewhere
> > > > > else), then that indeed may be enough. But is it really in all those
> > > > > cases?
> > > > 
> > > > Yes, it is an option in the pull mirror, by default should be unselected
> > > > I believe.
> > > 
> > > Well, if that's the case, either it got manually enabled on those 4 (?)
> > > forks, or those are using something else for mirroring the staging
> > > branch (in which case, the setting would not help). I can't see this
> > > part of the settings in other's repositories, so I don't know.
> > 
> > Do you know the name of those 4 forks? I can help figure it out.
> 
> Looking at "activity" view on gitlab, I see those:
> https://gitlab.com/xen-project/fusa/xen-integration
> https://gitlab.com/xen-project/people/olkur/xen
> https://gitlab.com/xen-project/people/andyhhp/xen
> 
> There are few more that have staging branch almost up to date, but seems
> to be pushed manually (based on it being not fully up to date) and less
> often.
> 
> -- 
> Best Regards,
> Marek Marczykowski-GÃ³recki
> Invisible Things Lab
> 
--8323329-1674952825-1689988449=:3118466--


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 02:38:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 02:38:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567786.887289 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN2VZ-0005hJ-Mf; Sat, 22 Jul 2023 02:38:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567786.887289; Sat, 22 Jul 2023 02:38:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN2VZ-0005hB-HK; Sat, 22 Jul 2023 02:38:13 +0000
Received: by outflank-mailman (input) for mailman id 567786;
 Sat, 22 Jul 2023 02:38:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qN2VY-0005h1-LU; Sat, 22 Jul 2023 02:38:12 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qN2VY-0008AY-Gp; Sat, 22 Jul 2023 02:38:12 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qN2VX-0002BT-UG; Sat, 22 Jul 2023 02:38:12 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qN2VX-0001CP-TW; Sat, 22 Jul 2023 02:38:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ZMttflg/3YoKdnVzJBY8r1KB5jcbX9qRQGyLeir3l/k=; b=hERIWD9St9HYrj2tmMemE/n4Yb
	lC8H+WOqnZXpFGdgn//X5t33wPOom9KqB6rqyVerfKz2CMPc+igHyYbXBaK/L4B5HkleQFwDSK4Rn
	D9bPQVZg9MbGyO8xaAalAZ4pDYYFmBOhnIO/fkubnHiIDHnuIDns9aWm54noiKoiEjkk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181952-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 181952: tolerable FAIL - PUSHED
X-Osstest-Failures:
    qemu-mainline:test-armhf-armhf-xl-vhd:xen-boot:fail:heisenbug
    qemu-mainline:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=d1181d29370a4318a9f11ea92065bea6bb159f83
X-Osstest-Versions-That:
    qemuu=2c27fdc7a626408ee2cf30d791aa0b63027c7404
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 22 Jul 2023 02:38:11 +0000

flight 181952 qemu-mainline real [real]
flight 181965 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181952/
http://logs.test-lab.xenproject.org/osstest/logs/181965/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-vhd       8 xen-boot            fail pass in 181965-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-vhd     14 migrate-support-check fail in 181965 never pass
 test-armhf-armhf-xl-vhd 15 saverestore-support-check fail in 181965 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181918
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181918
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181918
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181918
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181918
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181918
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181918
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181918
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 qemuu                d1181d29370a4318a9f11ea92065bea6bb159f83
baseline version:
 qemuu                2c27fdc7a626408ee2cf30d791aa0b63027c7404

Last test of basis   181918  2023-07-20 06:54:14 Z    1 days
Testing same since   181952  2023-07-21 10:07:07 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  "Markus F.X.J. Oberhumer" <markus@oberhumer.com>
  Denis V. Lunev <den@openvz.org>
  Eric Blake <eblake@redhat.com>
  Helge Deller <deller@gmx.de>
  Peter Maydell <peter.maydell@linaro.org>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      fail    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/qemu-xen.git
   2c27fdc7a6..d1181d2937  d1181d29370a4318a9f11ea92065bea6bb159f83 -> upstream-tested


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 05:45:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 05:45:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567589.887300 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN5Qa-0008CN-LQ; Sat, 22 Jul 2023 05:45:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567589.887300; Sat, 22 Jul 2023 05:45:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN5Qa-0008CE-Gw; Sat, 22 Jul 2023 05:45:16 +0000
Received: by outflank-mailman (input) for mailman id 567589;
 Fri, 21 Jul 2023 14:28:48 +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
 <SRS0=icXM=DH=nxp.com=george.mocanu@srs-se1.protection.inumbo.net>)
 id 1qMr7f-0003ZE-TE
 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 14:28:48 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0629.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::629])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e60d798c-27d2-11ee-8611-37d641c3527e;
 Fri, 21 Jul 2023 16:28:45 +0200 (CEST)
Received: from PA4PR04MB9224.eurprd04.prod.outlook.com (2603:10a6:102:2a3::5)
 by DBBPR04MB7865.eurprd04.prod.outlook.com (2603:10a6:10:1e2::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul
 2023 14:28:42 +0000
Received: from PA4PR04MB9224.eurprd04.prod.outlook.com
 ([fe80::8090:c99d:36d1:fd0c]) by PA4PR04MB9224.eurprd04.prod.outlook.com
 ([fe80::8090:c99d:36d1:fd0c%4]) with mapi id 15.20.6609.024; Fri, 21 Jul 2023
 14:28:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e60d798c-27d2-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=I4BEAsbRhyY14PyJZ2Oxnaindd5Jv6Txpy2PNMT58g3Wu6EngT1LZRFbWsd3VfDxKESengt91CHRDNqk/5TOnhfrPxH+latxi19XlL04VChsSBr1R0lj0W+x1zDZLhmZFZMhO6I/WjfHeZBoXTz6aW4sXdop1qd+UhMOt9Tzy9VTa7jAfhLNCiHXKJHP0apPDWZ+ctin29e4dTSgReHj/3A5okvi3xDK2lYGx/nDHzvgH7QR2h+IzbQju6oFz/Fkb3xtNLr64LPjWo+3Q7y74miUBvYTmF6WBoRSj8DUP++LD4nyN5N+xgWGmk1PROm9KXK8UZ7cz3eImO3/B7CyoQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0fkF1gi4yv1anqQphJwiAe5V5eXV4Q9xEOnZXRJ9f4k=;
 b=fc2+KeaXkQLvxNibkpa2AhDOEubzxW3iZp4TPIRbXZHXR1UCQpXamkHdrTa1iU7FpUvyCkMvsGYFQBjWoyjjm+L5WQvwcfV5absjec4pumaYAQe7MFpzUUm+XqHdeb4nnd3k1FhiwZ4FAbiqclvP+9uLlgWRCo9MtN644JE9zfIBGftSx6oCCqy5V3uh7oAdYp8x746Elko92gFb2xBZdNzQ0ZaKUxys01fsVbefS2uxGqXbjaL7yvim2ZuXyW2oHvyG+e+PjAKn3m+MvLWlZcbku7pB/xGydQDF0pKm3qcthoil/8Tk2tpDH8X+DP7SwgcQQ2ghXgc6r+zhZ3chMw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass
 header.d=nxp.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0fkF1gi4yv1anqQphJwiAe5V5eXV4Q9xEOnZXRJ9f4k=;
 b=FmcnHrLpuDVLlCZSJ9697Xtk4VopkWgw9lWzfZia1dK+NtssrbcEVb+CJnFvwb3BYXenIpM25/EJ5q6bjqrUcSFDEpst1KpKktWRjb/Q5X1y0EiIlSMAj8vgSC64nOytYNmUTAGAuenWEMef1Z6WcLkz25lxVOEZWbSzQkqZLBs=
From: George Mocanu <george.mocanu@nxp.com>
To: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>
CC: "Andrei Cherechesu (OSS)" <andrei.cherechesu@oss.nxp.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Juergen
 Gross <jgross@suse.com>
Subject: Re: [ARM][xencons] PV Console hangs due to illegal ring buffer
 accesses
Thread-Topic: [ARM][xencons] PV Console hangs due to illegal ring buffer
 accesses
Thread-Index: AQHZu9+mUGszY5KMlkWI3r1B3a7IQw==
Date: Fri, 21 Jul 2023 14:28:42 +0000
Message-ID:
 <PA4PR04MB9224D6AC1B217212D007D4D0FB3FA@PA4PR04MB9224.eurprd04.prod.outlook.com>
References: <62eeff72-c1fb-6932-6797-1b0058c97b03@oss.nxp.com>
 <048266d6-a32f-5f4e-984a-8b74de01a1fc@xen.org>
 <alpine.DEB.2.22.394.2307201609030.3118466@ubuntu-linux-20-04-desktop>
In-Reply-To:
 <alpine.DEB.2.22.394.2307201609030.3118466@ubuntu-linux-20-04-desktop>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nxp.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: PA4PR04MB9224:EE_|DBBPR04MB7865:EE_
x-ms-office365-filtering-correlation-id: 38eeac72-9771-4832-a0c8-08db89f6c8df
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info:
 qtBMb0qoS7HwsWOe8PI71lKl0UxG1OxAv6LGROmA2mCZ3GzbZJH8BfDzzijvWXK/rn4Nw4nmymmpcmd04cW1HnX/uSqZEl8raUEPHD7k6UrMV1XbgnGw5BPcYsw8PjQdrWr5NjmZFLLU7vUUtAJQ7kW1tPw4Xp6izsB6jAygM6A+bQOUNkVm+qXzN/Nd17EXqhi9uAR5u8yWWRsKl0buIVDlCXizms3Fuid0TJHoBcJ/ENF14JA3v5NTTV8geVOGSJfvqiRx+KOIzb2jxz5I/AtAy7ZMMdPUFbtxDNiejSdPv4FwsvnVRBjXMRTw/NKZB1uqjvv8NQIREGI7CIKrJ0N+FrC0dtI7rZuv+zRMNLBS/yuLNVtvpM61e3Bs/+cTb8sW7vYeFrC0/YciAY4f6NABbxgpIYl2t0CoqDU0M5tvXrNDOeLZJSjTGM+xqLdN+OuWB584asz0+bMdN5oiuY9/EYb4z68nUcWUi+fzmX8CLhkvYU0AXRLohs0pfxMrWj2vwcvUWOK17kuzosliL4fnF0rTbFADVhVDmefiiUPGTiDilmGrJ+5bpShtXxS4QPDhnU2IRdbUT5SpHklepv2Rl2kbxkZuttmpdY5s4RdfjWccGMkBR77D3DDsNSGK
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA4PR04MB9224.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(366004)(346002)(376002)(136003)(396003)(451199021)(55016003)(9686003)(71200400001)(38070700005)(66556008)(64756008)(66446008)(66476007)(4326008)(66946007)(7696005)(2906002)(76116006)(54906003)(110136005)(316002)(478600001)(86362001)(6506007)(53546011)(83380400001)(186003)(122000001)(38100700002)(33656002)(52536014)(5660300002)(8676002)(8936002)(41300700001)(26005)(44832011);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?MpN9fz7A2Nek2gvhxakeKcy2oRM8XHCzpG1kpRMGvKkMC+z1mrmS6nAaQiuD?=
 =?us-ascii?Q?ogAiCOPHs9as5k3OQ0rjb0goWjh2POnR4pBZrboOB835lh505micHozq3ROI?=
 =?us-ascii?Q?l/MLyj4tZeqiVAMtqxnV3t3DaQcYAk3Egzlf9uCZjyOwo3I6BAJhnPXd9t+L?=
 =?us-ascii?Q?biXZonX1q70yv4VL8Z/sn3BgLa3+LrIASl+ZJG/fJ6GdmNBKpbPevX14MZ+z?=
 =?us-ascii?Q?f8+/4cAprWJqcp6/u/p999zTh9LLkETIeDZWxdUtwWHyV5h6tHPjRQI2uiG/?=
 =?us-ascii?Q?krNCDLSdwSSbfr4c2TzAW6Eydz/iA79lmicc/VNwzceGEZMHVTKHKs3wHWXJ?=
 =?us-ascii?Q?SSBVwDe7koY5cy2S9OGJ/fJcsRv6qAF929R7Y4keN8rRlmaC4+88W7ziDwpJ?=
 =?us-ascii?Q?ai5wnO+5Oy88O4M4EDtWiHonOJzs78fTbthb9W2d8Yb4Fcvpc8cDpUjNKilX?=
 =?us-ascii?Q?SzAJMRZtq08SJcHrxyydH+OUmWKE9rLtRiaL64TabrGuVRdaWafmFRhNFelN?=
 =?us-ascii?Q?QRumOaylO0iyRDzmFyKYDzwxTY3ck6qj7fqEpjczSonzTXu2Iemyh0ViOnJt?=
 =?us-ascii?Q?UZZnqwCmxxH+FdgdPlCxtA/tusNJgZenxJYNdjakaGsvaH5mnHPj0R5gOQL5?=
 =?us-ascii?Q?joRxCHaljBUrFXRfChyHrhK/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sor7zOa3LE?=
 =?us-ascii?Q?q3udo/c8ocBe91LHh4k3Zi3P4X9rBUyyb+6GyFpF?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: nxp.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9224.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 38eeac72-9771-4832-a0c8-08db89f6c8df
X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 14:28:42.7573
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 5cUwWK5HYfvChn0d6RVqkXi7KLwVmld6RIn7tmVvfpG9LDWKe3ry2H3nRyrQHAasDN8+hr52XxAUaFKVLK76Xg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7865

Hello, Stefano,=20
Hello, Julien,

Thanks for your suggestions. I gave each of them a try, but it doesn't
look like it brings me anywhere at the moment.

On 21/07/2023 02:25, Stefano Stabellini wrote:
>=20
> On Thu, 20 Jul 2023, Julien Grall wrote:
> > (+ Juergen)
> >
> > On 19/07/2023 17:13, Andrei Cherechesu (OSS) wrote:
> > > Hello,
> >
> > Hi Andrei,
> >
> > > As we're running Xen 4.17 (with platform-related support added) on NX=
P
> S32G
> > > SoCs (ARMv8), with a custom Linux distribution built through Yocto, a=
nd
> > > we've set some Xen-based demos up, we encountered some issues which w=
e think
> > > might not be related to our hardware. For additional context, the Lin=
ux
> > > kernel version we're running is 5.15.96-rt (with platform-related sup=
port
> > > added as well).
> > >
> > > The setup to reproduce the problem is fairly simple: after booting a =
Dom0
> > > (can provide configuration details if needed), we're booting a normal=
 PV
> > > DomU with PV Networking. Additionally, the VMs have k3s (Lightweight
> > > Kubernetes - version v1.25.8+k3s1) installed in
> > > their rootfs'es.
> > >
> > > The problem is that the DomU console hangs (no new output is shown, n=
o input
> > > can be sent) some time (non-deterministic, sometimes 5 seconds, other=
 times
> > > like 15-20 seconds) after we run the `k3s server` command. We have th=
is
> > > command running as part of a sysvinit service, and the same behavior =
can be
> > > observed in that case as well. The k3s version we use is the one ment=
ioned
> > > in the paragraph above, but this can be reproduced with other version=
s as
> > > well (i.e., v1.21.11, v1.22.6). If the `k3s server` command is ran in=
 the
> > > Dom0 VM, everything works fine. Using DomU as an agent node is also w=
orking
> > > fine, only when it is run as a server the console problem occurs.
> > >
> > > Immediately after the serial console hangs, we can still log in on Do=
mU
> > > using SSH, and we can observe the following messages its dmesg:
> > > [   57.905806] xencons: Illegal ring page indices
> >
> > Looking at Linux code, this message is printed in a couple of place in =
the
> > xenconsole driver.
> >
> > I would assume that this is printed when reading from the buffer (other=
wise
> > you would not see any message). Can you confirm it?
> >
> > Also, can you provide the indices that Linux considers buggy?

Adding to what Andrei said previously, we login into the DomU console
to observe its state, and send some input keys to confirm whether it is
in the buggy state. Considering this flow, it looks like this message
comes from the write_console() call. In one instance I started the k3s
server process in the console (disabled the sysvinit service beforehand),
then proceeded to kill it after some time - a message from read_console()
was displayed in that instance. As for the indices, I've dumped them in
a separate message, and they are different always:

[   45.303520] xencons: Illegal ring page indices -- write_console()
[   45.303529] xencons: prod 4289880869, cons 2015782840, intf->out size 20=
48

[   59.203570] xencons: Illegal ring page indices -- write_console()
[   59.203576] xencons: prod 1735287148, cons 1869033263, intf->out size 20=
48

[   40.838740] xencons: Illegal ring page indices -- write_console()
[   40.838753] xencons: prod 1647211507, cons 2923534489, intf->out size 20=
48
[...]
[  126.184299] xencons: Illegal ring page indices -- read_console()
[  126.184317] xencons: prod 127, cons 1815732224, intf->int size 1024

> >
> > Lastly, it seems like the barrier used are incorrect. It should be the
> > virt_*() version rather than a plain mb()/wmb(). I don't think it matte=
r for
> > arm64 though (I am assuming you are not running 32-bit).
> >

Replaced them with the virt_*() relatives, but I couldn't notice any change
in the behavior.

> > > [   59.399620] xenbus: error -5 while reading message
> >
> > So this message is coming from the xenbus driver (used to read the xens=
tore
> > ring). This is -EIO, and AFAICT returned when the indices are also inco=
rrect.
> >
> > For this driver, I think there is also a TOCTOU because a compiler is f=
ree to
> > reload intf->rsp_cons after the check. Moving virt_mb() is probably not
> > sufficient. You would also want to use ACCESS_ONCE().
> >
> > What I find odd is you have two distinct rings (xenconsole and xenbus) =
with
> > similar issues. Above, you said you are using Linux RT. I wonder if thi=
s has a
> > play into the issue because if I am not mistaken, the two functions wou=
ld now
> > be fully preemptible.
> >
> > This could expose some races. For instance, there are some missing
> > ACCESS_ONCE() (as mentioned above).
> >
> > In particular, Xenstored (I haven't checked xenconsoled) is using +=3D =
to update
> > intf->rsp_cons. There is no guarantee that the update will be atomic.
> >
> > Overall, I am not 100% sure what I wrote is related. But that's probabl=
y a
> > good start of things that can be exacerbated with Linux RT.

Added memory barriers wherever I saw the corresponding ring indexes used in
both the xenconsole and xenbus drivers, but nothing changed.

> >
> > > [   59.399649] xenbus: error -5 while writing message
> >
> > This is in xenbus as well. But this time in the write part. The analysi=
s I
> > wrote above for the read part can be applied here.
>=20
> This is really strange. What is also strange is that somehow the indexes
> recover after 10-15 seconds? How is that even possible. Let's say there
> is a memory corruption of some sort, maybe due to missing barriers like
> Julien suggested, how can it go back to normal after a while?
>=20
> I am really confused. I would try with regular Linux instead of Linux RT
> and also would try to replace all the barriers in
> drivers/tty/hvc/hvc_xen.c with their virt_* version to see if we can
> narrow down the problem a bit.
>=20
>=20
> Keep in mind that during PV network operations grants are used, which
> involve mapping pages at the backend and changing the MMU/IOMMU
> pagetables to introduce the new mapping. After the DMA operation,
> typically the page is unmapped and removed from the pagetable.
>=20
> Is it possible that the pagetable change is causing the problem, and
> when the mapping is removed everything goes back to normal?
>=20
> I don't know how that could happen, but the mapping and unmapping of the
> page is something ongoing which could break things then go back to
> normal. One thing you could try is to force all DMA operations to go via
> swiotlb-xen in Linux:
>=20
> diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c
> index 3d826c0b5fee..f78d86f1bb9c 100644
> --- a/arch/arm/xen/mm.c
> +++ b/arch/arm/xen/mm.c
> @@ -112,8 +112,7 @@ bool xen_arch_need_swiotlb(struct device *dev,
>          * require a bounce buffer because the device doesn't support coh=
erent
>          * memory and we are not able to flush the cache.
>          */
> -       return (!hypercall_cflush && (xen_pfn !=3D bfn) &&
> -               !dev_is_dma_coherent(dev));
> +       return true;
>  }
>=20
>  static int __init xen_mm_init(void)
>=20
>=20
> Then you can remove any iommu pagetable flushes in Xen:
>=20
>=20
> diff --git a/xen/arch/arm/include/asm/grant_table.h
> b/xen/arch/arm/include/asm/grant_table.h
> index d3c518a926..b72f8391bd 100644
> --- a/xen/arch/arm/include/asm/grant_table.h
> +++ b/xen/arch/arm/include/asm/grant_table.h
> @@ -74,7 +74,7 @@ int replace_grant_host_mapping(uint64_t gpaddr, mfn_t
> frame,
>      page_get_xenheap_gfn(gnttab_status_page(t, i))
>=20
>  #define gnttab_need_iommu_mapping(d)                    \
> -    (is_domain_direct_mapped(d) && is_iommu_enabled(d))
> +    (0)
>=20
>  #endif /* __ASM_GRANT_TABLE_H__ */
>  /*
>=20
>=20
> I don't know how this could be related but it might help narrow down the
> problem.

Applied your suggestion regarding DMA operations, but we observe the same
behavior (the serial console would hang after some time), besides some new
issues with some other drivers.

We will continue to look into this issue, but if you have some new ideas,
please let us know.

Thank you,
George Mocanu



From xen-devel-bounces@lists.xenproject.org Sat Jul 22 05:45:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 05:45:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567761.887305 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN5Qa-0008Ga-Ua; Sat, 22 Jul 2023 05:45:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567761.887305; Sat, 22 Jul 2023 05:45:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN5Qa-0008FL-Pq; Sat, 22 Jul 2023 05:45:16 +0000
Received: by outflank-mailman (input) for mailman id 567761;
 Sat, 22 Jul 2023 00:21:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=McP0=DI=gmail.com=bagasdotme@srs-se1.protection.inumbo.net>)
 id 1qN0N2-0000hd-Ia
 for xen-devel@lists.xenproject.org; Sat, 22 Jul 2023 00:21:16 +0000
Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com
 [2607:f8b0:4864:20::633])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a9e61c15-2825-11ee-b23a-6b7b168915f2;
 Sat, 22 Jul 2023 02:21:13 +0200 (CEST)
Received: by mail-pl1-x633.google.com with SMTP id
 d9443c01a7336-1b9cd6a0051so16614575ad.1
 for <xen-devel@lists.xenproject.org>; Fri, 21 Jul 2023 17:21:13 -0700 (PDT)
Received: from [192.168.0.104] ([103.131.18.64])
 by smtp.gmail.com with ESMTPSA id
 u3-20020a170902b28300b001b8a897cd26sm4070032plr.195.2023.07.21.17.21.08
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 21 Jul 2023 17:21:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a9e61c15-2825-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1689985272; x=1690590072;
        h=content-transfer-encoding:subject:from:cc:to:content-language
         :user-agent:mime-version:date:message-id:from:to:cc:subject:date
         :message-id:reply-to;
        bh=37jHSLFgAqYIe1fMBFWz3IsmA+NfaKZptfwfcm9yo38=;
        b=Gs4eA0UV6HBbwJ5hg2BaRyy4uj1qAHyXIBoAkpZE2YrJeKb7/vmAvHyckS7UKpc+Gp
         UPpn9pTN0PAD9YyPyyjzN1fKq1JG+V/Q6Lw9S6GDcfBl4ue7lrPfx5pKv+WjYZXNRGdz
         MGn7sBGlJL1jrve4jBXcVJT++IKNqtq4eFPyVVC0gAGLg4VfjIdDb0AT6OHO5fKldUh5
         3wMu0hTiq4yRl1XorhU82JomavcoCtdriR7o6+AR+6zi12yIidoya/lhEphgFFyNGe6h
         JcX1lumhX9XpjK+wcL6CpMosMvsueJGE7pkVO05sDvFNo5K35AsFhnqXaYALyvtxrZtf
         5PVQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1689985272; x=1690590072;
        h=content-transfer-encoding:subject:from:cc:to:content-language
         :user-agent:mime-version:date:message-id:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=37jHSLFgAqYIe1fMBFWz3IsmA+NfaKZptfwfcm9yo38=;
        b=Yspim1LAB6iCHAONccf1CuHPri54R9oWFsLerRSwe4dfxDRCn8P6ofl+gEgJIW+2kL
         tXWZ8MX5TBEO6JsD6RPV3yTzmTZoF5Hnl0vInT9JdmUZCZ1eWWF81gJndNXVVMurpLGj
         OTNbNfexEO3FEYB9KrcmL8KXXHygTc8LxTfWsun6Tw3pLTLHGFHirVCBHK873VrtMvdh
         Q04E3g9QKCcCe0+DBvdy94WUpTC9Ji9v4QbB2qEyY0JfWcCiXQ1iTn6MlqZdRDHeDX+F
         3agEvgRFF0GXqK9Lsn0hqD80wqLSoynLWlwsGUHKapG1ctqYzvRQPjLfhNMufZzRTGq3
         sncA==
X-Gm-Message-State: ABy/qLZxgfuIk5iDTLwNuoCBQA4Shysy/UnZjl9bbce9fBGI03hLH5NW
	JastG9Yf9udBRJepwGH39sc=
X-Google-Smtp-Source: APBJJlFvUvUbyqctdEaJWp5LBniOVhPH/oTRiWJPqf9VtejwknXrcf8LT+ovNOvfvX58H50aeKfJAw==
X-Received: by 2002:a17:903:22c6:b0:1b8:41d4:89f with SMTP id y6-20020a17090322c600b001b841d4089fmr3385302plg.4.1689985271597;
        Fri, 21 Jul 2023 17:21:11 -0700 (PDT)
Message-ID: <7e3841ce-011d-5ba6-9dae-7b14e07b5c4b@gmail.com>
Date: Sat, 22 Jul 2023 07:21:05 +0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Content-Language: en-US
To: Juergen Gross <jgross@suse.com>, Jan Beulich <jbeulich@suse.com>,
 "David S. Miller" <davem@davemloft.net>, sander44 <ionut_n2001@yahoo.com>
Cc: Linux Xen <xen-devel@lists.xenproject.org>,
 Linux BPF <bpf@vger.kernel.org>, Linux Networking <netdev@vger.kernel.org>,
 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
 Linux Regressions <regressions@lists.linux.dev>
From: Bagas Sanjaya <bagasdotme@gmail.com>
Subject: Fwd: UBSAN: index 1 is out of range for type
 'xen_netif_rx_sring_entry [1]'
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Hi,

I notice a regression report on Bugzilla [1]. Quoting from it:

> Hi Kernel Team,
> 
> I rebuild today latest version from mainline repo.
> And i notice issue regarding xen-netfront.c.
> 
> Error:
> [    3.477400] ================================================================================
> [    3.477633] UBSAN: array-index-out-of-bounds in drivers/net/xen-netfront.c:1291:3
> [    3.477858] index 1 is out of range for type 'xen_netif_rx_sring_entry [1]'
> [    3.478085] CPU: 0 PID: 700 Comm: NetworkManager Not tainted 6.5.0-rc2-1-generation1 #3
> [    3.478088] Hardware name: Intel Corporation W2600CR/W2600CR, BIOS SE5C600.86B.02.06.0007.082420181029 01/13/2022
> [    3.478090] Call Trace:
> [    3.478092]  <IRQ>
> [    3.478097]  dump_stack_lvl+0x48/0x70
> [    3.478105]  dump_stack+0x10/0x20
> [    3.478107]  __ubsan_handle_out_of_bounds+0xc6/0x110
> [    3.478114]  xennet_poll+0xa94/0xac0
> [    3.478118]  ? generic_smp_call_function_single_interrupt+0x13/0x20
> [    3.478125]  __napi_poll+0x33/0x200
> [    3.478131]  net_rx_action+0x181/0x2e0
> [    3.478135]  __do_softirq+0xd9/0x346
> [    3.478139]  do_softirq.part.0+0x41/0x80
> [    3.478144]  </IRQ>
> [    3.478145]  <TASK>
> [    3.478146]  __local_bh_enable_ip+0x72/0x80
> [    3.478149]  _raw_spin_unlock_bh+0x1d/0x30
> [    3.478151]  xennet_open+0x75/0x160
> [    3.478154]  __dev_open+0x105/0x1d0
> [    3.478156]  __dev_change_flags+0x1b5/0x230
> [    3.478158]  dev_change_flags+0x27/0x80
> [    3.478160]  do_setlink+0x3d2/0x12b0
> [    3.478164]  ? __nla_validate_parse+0x5b/0xdb0
> [    3.478169]  __rtnl_newlink+0x6f6/0xb10
> [    3.478173]  ? rtnl_newlink+0x2f/0x80
> [    3.478177]  rtnl_newlink+0x48/0x80
> [    3.478180]  rtnetlink_rcv_msg+0x170/0x430
> [    3.478183]  ? fib6_clean_node+0xad/0x190
> [    3.478188]  ? __pfx_rtnetlink_rcv_msg+0x10/0x10
> [    3.478191]  netlink_rcv_skb+0x5d/0x110
> [    3.478195]  rtnetlink_rcv+0x15/0x30
> [    3.478198]  netlink_unicast+0x247/0x390
> [    3.478200]  netlink_sendmsg+0x25e/0x4e0
> [    3.478202]  sock_sendmsg+0xaf/0xc0
> [    3.478204]  ____sys_sendmsg+0x2a9/0x350
> [    3.478206]  ___sys_sendmsg+0x9a/0xf0
> [    3.478212]  ? _copy_from_iter+0x80/0x4a0
> [    3.478217]  __sys_sendmsg+0x89/0xf0
> [    3.478220]  __x64_sys_sendmsg+0x1d/0x30
> [    3.478222]  do_syscall_64+0x5c/0x90
> [    3.478226]  ? do_syscall_64+0x68/0x90
> [    3.478228]  ? ksys_write+0xe6/0x100
> [    3.478232]  ? exit_to_user_mode_prepare+0x49/0x220
> [    3.478236]  ? syscall_exit_to_user_mode+0x1b/0x50
> [    3.478240]  ? do_syscall_64+0x68/0x90
> [    3.478242]  ? do_syscall_64+0x68/0x90
> [    3.478243]  ? irqentry_exit_to_user_mode+0x9/0x30
> [    3.478246]  ? irqentry_exit+0x43/0x50
> [    3.478248]  ? sysvec_xen_hvm_callback+0x4b/0xd0
> [    3.478250]  entry_SYSCALL_64_after_hwframe+0x6e/0xd8
> [    3.478253] RIP: 0033:0x7f973c244e4d
> [    3.478268] Code: 28 89 54 24 1c 48 89 74 24 10 89 7c 24 08 e8 ca ee ff ff 8b 54 24 1c 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 33 44 89 c7 48 89 44 24 08 e8 fe ee ff ff 48
> [    3.478270] RSP: 002b:00007fff4777f470 EFLAGS: 00000293 ORIG_RAX: 000000000000002e
> [    3.478273] RAX: ffffffffffffffda RBX: 00005583087c6480 RCX: 00007f973c244e4d
> [    3.478274] RDX: 0000000000000000 RSI: 00007fff4777f4c0 RDI: 000000000000000c
> [    3.478276] RBP: 00007fff4777f4c0 R08: 0000000000000000 R09: 0000000000000000
> [    3.478277] R10: 0000000000000000 R11: 0000000000000293 R12: 00005583087c6480
> [    3.478279] R13: 00007fff4777f668 R14: 00007fff4777f65c R15: 0000000000000000
> [    3.478283]  </TASK>
> [    3.478284] ================================================================================
> [    3.685513] ================================================================================
> [    3.685751] UBSAN: array-index-out-of-bounds in drivers/net/xen-netfront.c:485:7
> [    3.686111] index 1 is out of range for type 'xen_netif_tx_sring_entry [1]'
> [    3.686379] CPU: 1 PID: 697 Comm: avahi-daemon Not tainted 6.5.0-rc2-1-generation1 #3
> [    3.686381] Hardware name: Intel Corporation W2600CR/W2600CR, BIOS SE5C600.86B.02.06.0007.082420181029 01/13/2022
> [    3.686385] Call Trace:
> [    3.686388]  <TASK>
> [    3.686391]  dump_stack_lvl+0x48/0x70
> [    3.686399]  dump_stack+0x10/0x20
> [    3.686399]  __ubsan_handle_out_of_bounds+0xc6/0x110
> [    3.686403]  xennet_tx_setup_grant+0x1f7/0x230
> [    3.686403]  ? __pfx_xennet_tx_setup_grant+0x10/0x10
> [    3.686403]  gnttab_foreach_grant_in_range+0x5c/0x100
> [    3.686415]  xennet_start_xmit+0x428/0x990
> [    3.686415]  ? kmem_cache_alloc_node+0x1b1/0x3b0
> [    3.686415]  dev_hard_start_xmit+0x68/0x1e0
> [    3.686415]  sch_direct_xmit+0x10b/0x350
> [    3.686415]  __dev_queue_xmit+0x512/0xda0
> [    3.686439]  ? ___neigh_create+0x6cb/0x970
> [    3.686439]  neigh_resolve_output+0x118/0x1e0
> [    3.686446]  ip_finish_output2+0x181/0x540
> [    3.686450]  ? netif_rx_internal+0x46/0x140
> [    3.686456]  __ip_finish_output+0xb6/0x180
> [    3.686456]  ? dev_loopback_xmit+0x86/0x110
> [    3.686456]  ip_finish_output+0x29/0x100
> [    3.686456]  ip_mc_output+0x95/0x2e0
> [    3.686456]  ? __pfx_ip_finish_output+0x10/0x10
> [    3.686456]  ip_send_skb+0x9f/0xb0
> [    3.686456]  udp_send_skb+0x158/0x380
> [    3.686475]  udp_sendmsg+0xb84/0xf20
> [    3.686475]  ? do_sys_poll+0x3a1/0x5f0
> [    3.686483]  ? __pfx_ip_generic_getfrag+0x10/0x10
> [    3.686483]  inet_sendmsg+0x76/0x80
> [    3.686483]  ? inet_sendmsg+0x76/0x80
> [    3.686483]  sock_sendmsg+0xa8/0xc0
> [    3.686483]  ? _copy_from_user+0x30/0xa0
> [    3.686483]  ____sys_sendmsg+0x2a9/0x350
> [    3.686483]  ___sys_sendmsg+0x9a/0xf0
> [    3.686483]  __sys_sendmsg+0x89/0xf0
> [    3.686483]  __x64_sys_sendmsg+0x1d/0x30
> [    3.686483]  do_syscall_64+0x5c/0x90
> [    3.686483]  ? exit_to_user_mode_prepare+0x49/0x220
> [    3.686483]  ? syscall_exit_to_user_mode+0x1b/0x50
> [    3.686483]  ? do_syscall_64+0x68/0x90
> [    3.686483]  ? syscall_exit_to_user_mode+0x1b/0x50
> [    3.686483]  ? do_syscall_64+0x68/0x90
> [    3.686483]  entry_SYSCALL_64_after_hwframe+0x6e/0xd8
> [    3.686483] RIP: 0033:0x7ff365942e13
> [    3.686483] Code: 8b 15 b9 a1 00 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b8 0f 1f 00 64 8b 04 25 18 00 00 00 85 c0 75 14 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 55 c3 0f 1f 40 00 48 83 ec 28 89 54 24 1c 48
> [    3.686483] RSP: 002b:00007ffc7bf1ca78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
> [    3.686483] RAX: ffffffffffffffda RBX: 00005596bd24c900 RCX: 00007ff365942e13
> [    3.686483] RDX: 0000000000000000 RSI: 00007ffc7bf1cb30 RDI: 000000000000000c
> [    3.686483] RBP: 000000000000000c R08: 0000000000000004 R09: 0000000000000019
> [    3.686483] R10: 00007ff365a1ca94 R11: 0000000000000246 R12: 00007ffc7bf1cb30
> [    3.686483] R13: 0000000000000002 R14: 00005596bd235f9c R15: 0000000000000000
> [    3.686483]  </TASK>
> [    3.686483] ================================================================================
> [    3.686858] ================================================================================
> [    3.687190] UBSAN: array-index-out-of-bounds in drivers/net/xen-netfront.c:413:4
> [    3.687501] index 1 is out of range for type 'xen_netif_tx_sring_entry [1]'
> [    3.687800] CPU: 18 PID: 0 Comm: swapper/18 Not tainted 6.5.0-rc2-1-generation1 #3
> [    3.687804] Hardware name: Intel Corporation W2600CR/W2600CR, BIOS SE5C600.86B.02.06.0007.082420181029 01/13/2022
> [    3.687806] Call Trace:
> [    3.687808]  <IRQ>
> [    3.687812]  dump_stack_lvl+0x48/0x70
> [    3.687819]  dump_stack+0x10/0x20
> [    3.687821]  __ubsan_handle_out_of_bounds+0xc6/0x110
> [    3.687827]  xennet_tx_buf_gc+0x34a/0x440
> [    3.687831]  xennet_handle_tx.constprop.0+0x49/0x90
> [    3.687834]  xennet_tx_interrupt+0x32/0x70
> [    3.687837]  __handle_irq_event_percpu+0x4f/0x1b0
> [    3.687842]  handle_irq_event+0x39/0x80
> [    3.687846]  handle_edge_irq+0x8c/0x230
> [    3.687849]  handle_irq_desc+0x40/0x60
> [    3.687851]  generic_handle_irq+0x1f/0x30
> [    3.687854]  handle_irq_for_port+0x8e/0x180
> [    3.687858]  ? _raw_spin_unlock_irqrestore+0x11/0x60
> [    3.687861]  __evtchn_fifo_handle_events+0x221/0x330
> [    3.687866]  evtchn_fifo_handle_events+0xe/0x20
> [    3.687869]  __xen_evtchn_do_upcall+0x72/0xd0
> [    3.687873]  xen_hvm_evtchn_do_upcall+0xe/0x20
> [    3.687876]  __sysvec_xen_hvm_callback+0x53/0x70
> [    3.687880]  sysvec_xen_hvm_callback+0x8d/0xd0
> [    3.687884]  </IRQ>
> [    3.687885]  <TASK>
> [    3.687886]  asm_sysvec_xen_hvm_callback+0x1b/0x20
> [    3.687891] RIP: 0010:pv_native_safe_halt+0xb/0x10
> [    3.687896] Code: 0b 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 eb 07 0f 00 2d 49 cc 33 00 fb f4 <c3> cc cc cc cc 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 55
> [    3.687898] RSP: 0000:ffffad85c0147e08 EFLAGS: 00000246
> [    3.687901] RAX: ffffffffa00d39a0 RBX: 0000000000000002 RCX: 0000000000000000
> [    3.687902] RDX: 0000000000000002 RSI: ffffffffa14d28e0 RDI: ffff920446abda00
> [    3.687904] RBP: ffffad85c0147e18 R08: 0000000000000000 R09: 0000000000000000
> [    3.687905] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000002
> [    3.687906] R13: 0000000000000002 R14: 0000000000000002 R15: ffffffffa14d29c8
> [    3.687909]  ? __pfx_intel_idle_hlt+0x10/0x10
> [    3.687913]  ? intel_idle_hlt+0xc/0x40
> [    3.687916]  cpuidle_enter_state+0xa0/0x730
> [    3.687920]  cpuidle_enter+0x2e/0x50
> [    3.687924]  call_cpuidle+0x23/0x60
> [    3.687928]  do_idle+0x207/0x260
> [    3.687932]  cpu_startup_entry+0x1d/0x20
> [    3.687934]  start_secondary+0x129/0x160
> [    3.687939]  secondary_startup_64_no_verify+0x17e/0x18b
> [    3.687945]  </TASK>
> [    3.687946] ================================================================================
> [    4.624607] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
> [    4.629153] Bridge firewalling registered
> [    4.745355] Initializing XFRM netlink socket
> [    4.794107] loop8: detected capacity change from 0 to 8
> [    7.104544] rfkill: input handler disabled
> [   26.445163] ================================================================================
> [   26.445171] UBSAN: array-index-out-of-bounds in drivers/net/xen-netfront.c:807:4
> [   26.445175] index 109 is out of range for type 'xen_netif_tx_sring_entry [1]'
> [   26.445178] CPU: 8 PID: 1729 Comm: sshd Not tainted 6.5.0-rc2-1-generation1 #3
> [   26.445180] Hardware name: Intel Corporation W2600CR/W2600CR, BIOS SE5C600.86B.02.06.0007.082420181029 01/13/2022
> [   26.445181] Call Trace:
> [   26.445185]  <TASK>
> [   26.445185]  dump_stack_lvl+0x48/0x70
> [   26.445185]  dump_stack+0x10/0x20
> [   26.445200]  __ubsan_handle_out_of_bounds+0xc6/0x110
> [   26.445206]  xennet_start_xmit+0x932/0x990
> [   26.445211]  dev_hard_start_xmit+0x68/0x1e0
> [   26.445216]  sch_direct_xmit+0x10b/0x350
> [   26.445220]  __dev_queue_xmit+0x512/0xda0
> [   26.445224]  ip_finish_output2+0x261/0x540
> [   26.445225]  __ip_finish_output+0xb6/0x180
> [   26.445225]  ip_finish_output+0x29/0x100
> [   26.445234]  ip_output+0x73/0x120
> [   26.445234]  ? __pfx_ip_finish_output+0x10/0x10
> [   26.445238]  ip_local_out+0x61/0x70
> [   26.445238]  __ip_queue_xmit+0x18d/0x470
> [   26.445238]  ip_queue_xmit+0x15/0x30
> [   26.445238]  __tcp_transmit_skb+0xb39/0xcc0
> [   26.445238]  tcp_write_xmit+0x595/0x1570
> [   26.445238]  ? _copy_from_iter+0x80/0x4a0
> [   26.445256]  __tcp_push_pending_frames+0x37/0x110
> [   26.445259]  tcp_push+0x123/0x190
> [   26.445260]  tcp_sendmsg_locked+0xafe/0xed0
> [   26.445264]  tcp_sendmsg+0x2c/0x50
> [   26.445268]  inet_sendmsg+0x42/0x80
> [   26.445268]  sock_write_iter+0x160/0x180
> [   26.445274]  vfs_write+0x397/0x440
> [   26.445274]  ksys_write+0xc9/0x100
> [   26.445274]  __x64_sys_write+0x19/0x30
> [   26.445274]  do_syscall_64+0x5c/0x90
> [   26.445287]  ? syscall_exit_to_user_mode+0x1b/0x50
> [   26.445290]  ? do_syscall_64+0x68/0x90
> [   26.445290]  ? do_syscall_64+0x68/0x90
> [   26.445294]  ? do_syscall_64+0x68/0x90
> [   26.445294]  ? syscall_exit_to_user_mode+0x1b/0x50
> [   26.445298]  ? do_syscall_64+0x68/0x90
> [   26.445300]  ? exc_page_fault+0x94/0x1b0
> [   26.445302]  entry_SYSCALL_64_after_hwframe+0x6e/0xd8
> [   26.445306] RIP: 0033:0x7f26c4c3d473
> [   26.445318] Code: 8b 15 21 2a 0e 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 64 8b 04 25 18 00 00 00 85 c0 75 14 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 55 c3 0f 1f 40 00 48 83 ec 28 48 89 54 24 18
> [   26.445321] RSP: 002b:00007ffdee7b5528 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
> [   26.445321] RAX: ffffffffffffffda RBX: 0000000000000700 RCX: 00007f26c4c3d473
> [   26.445321] RDX: 0000000000000700 RSI: 000055567032e230 RDI: 0000000000000004
> [   26.445321] RBP: 0000555670313d70 R08: fffffffffffffff0 R09: 0000000000000000
> [   26.445321] R10: 0000000000000000 R11: 0000000000000246 R12: 000055566fcb2768
> [   26.445321] R13: 0000000000000000 R14: 0000000000000004 R15: 000055566fc67a80
> [   26.445332]  </TASK>
> [   26.445333] ================================================================================

See Bugzilla for the full thread and attached dmesg.

Anyway, I'm adding it to regzbot:

#regzbot introduced: 8446066bf8c1f9f https://bugzilla.kernel.org/show_bug.cgi?id=217693

Thanks.

[1]: https://bugzilla.kernel.org/show_bug.cgi?id=217693

-- 
An old man doll... just what I always wanted! - Clara


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 06:07:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 06:07:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567800.887319 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN5lT-0002u2-V5; Sat, 22 Jul 2023 06:06:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567800.887319; Sat, 22 Jul 2023 06:06:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN5lT-0002tv-Ot; Sat, 22 Jul 2023 06:06:51 +0000
Received: by outflank-mailman (input) for mailman id 567800;
 Sat, 22 Jul 2023 06:06:50 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qN5lS-0002tl-Ga; Sat, 22 Jul 2023 06:06:50 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qN5lS-00056i-9l; Sat, 22 Jul 2023 06:06:50 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qN5lR-0007GP-Ud; Sat, 22 Jul 2023 06:06:50 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qN5lR-0004H5-U9; Sat, 22 Jul 2023 06:06:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=h5zyV09l2xk/a3Me18vgC5vuH8utzlrUUMPWemU4FfQ=; b=FAM4lUvKrMX+DMBrADaYIhE4L2
	1YZKGx+1IPAVS3YdIwUPhoIXwM0Sq38WnQqt0a8wEzOCx30AqQ/sXLv6PtnsTyQ8wT0CxOmNCRg/L
	N5kIHfvmRWu05G3Io/GJ3U+sz5Qqt2PLG1mrj09B48r3LrtP8SVjsvE29yXGhe10UrtQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181953-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181953: regressions - FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-libvirt-pair:xen-install/src_host:fail:regression
    xen-unstable:test-amd64-i386-examine-bios:xen-install:fail:heisenbug
    xen-unstable:test-amd64-coresched-i386-xl:guest-localmigrate/x10:fail:heisenbug
    xen-unstable:test-amd64-i386-xl-vhd:guest-start.2:fail:heisenbug
    xen-unstable:test-amd64-i386-libvirt-pair:xen-install/dst_host:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=1ab2ae1610d99423af5b810829959431e43de12d
X-Osstest-Versions-That:
    xen=4bf014c6f7d7cc9a9e017cef0eb5ff4bf27526e9
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 22 Jul 2023 06:06:49 +0000

flight 181953 xen-unstable real [real]
flight 181967 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181953/
http://logs.test-lab.xenproject.org/osstest/logs/181967/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-libvirt-pair 10 xen-install/src_host     fail REGR. vs. 181927

Tests which are failing intermittently (not blocking):
 test-amd64-i386-examine-bios  6 xen-install         fail pass in 181967-retest
 test-amd64-coresched-i386-xl 20 guest-localmigrate/x10 fail pass in 181967-retest
 test-amd64-i386-xl-vhd       22 guest-start.2       fail pass in 181967-retest

Tests which did not succeed, but are not blocking:
 test-amd64-i386-libvirt-pair 11 xen-install/dst_host         fail  like 181927
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181927
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181927
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181927
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181927
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181927
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181927
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181927
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181927
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181927
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181927
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181927
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181927
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 xen                  1ab2ae1610d99423af5b810829959431e43de12d
baseline version:
 xen                  4bf014c6f7d7cc9a9e017cef0eb5ff4bf27526e9

Last test of basis   181927  2023-07-20 13:41:22 Z    1 days
Testing same since   181953  2023-07-21 10:42:59 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Jens Wiklander <jens.wiklander@linaro.org>
  Julien Grall <jgrall@amazon.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 fail    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 fail    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 1ab2ae1610d99423af5b810829959431e43de12d
Author: Jens Wiklander <jens.wiklander@linaro.org>
Date:   Mon Jul 17 09:20:52 2023 +0200

    xen/arm: ffa: add support for FFA_ID_GET
    
    Adds support for the FF-A function FFA_ID_GET to return the ID of the
    calling client.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

commit 0dacee5cfbf1576b1ea5f44680c92996f7e4175c
Author: Jens Wiklander <jens.wiklander@linaro.org>
Date:   Mon Jul 17 09:20:51 2023 +0200

    xen/arm: ffa: enforce dependency on 4k pages
    
    Adds a BUILD_BUG_ON() to assert the dependency on 4k pages in the FF-A
    mediator since the current implementation only works if Xen page size is
    the same as the FFA page size.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Henry Wang <Henry.Wang@arm.com>

commit 246fdc288e7a4832b8cc93816850b12cf8e4de91
Author: Jens Wiklander <jens.wiklander@linaro.org>
Date:   Mon Jul 17 09:20:50 2023 +0200

    xen/arm: ffa: add defines for framework direct request/response messages
    
    According to DEN0077A version 1.1 REL0, section 18.3, Table 18.{21, 25,
    26, 27, 28}, add defines for framework direct request/response messages.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Henry Wang <Henry.Wang@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

commit aaa416d425213ab37536088783f802df53af26d4
Author: Jens Wiklander <jens.wiklander@linaro.org>
Date:   Mon Jul 17 09:20:49 2023 +0200

    xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET
    
    According to DEN0077A version 1.1 REL0, section 13.8, defines
    flags used for the function FFA_PARTITION_INFO_GET.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Henry Wang <Henry.Wang@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

commit 9b6af1deb273f320e2d1c507aa1cb17f7356f805
Author: Jens Wiklander <jens.wiklander@linaro.org>
Date:   Mon Jul 17 09:20:48 2023 +0200

    xen/arm: ffa: add remaining SMC function IDs
    
    Adds the remaining SMC function IDs from FF-A 1.1 specification,
    DEN0077A version 1.1 REL0.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Henry Wang <Henry.Wang@arm.com>

commit 38846de2176b991704e3062904d0e2fc455b47b9
Author: Jens Wiklander <jens.wiklander@linaro.org>
Date:   Mon Jul 17 09:20:47 2023 +0200

    xen/arm: tee: add a primitive FF-A mediator
    
    Adds a FF-A version 1.1 [1] mediator to communicate with a Secure
    Partition in secure world.
    
    This commit brings in only the parts needed to negotiate FF-A version
    number with guest and SPMC.
    
    [1] https://developer.arm.com/documentation/den0077/e
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    [jgrall: Make Kconfig depends on TEE + Remove kconfig.h include]
    Acked-by: Julien Grall <jgrall@amazon.com>

commit 3069ecdf362eabfef452d8a29218290ba6d84b48
Author: Jens Wiklander <jens.wiklander@linaro.org>
Date:   Mon Jul 17 09:20:46 2023 +0200

    xen/arm: smccc: add support for SMCCCv1.2 extended input/output registers
    
    SMCCC v1.2 [1] AArch64 allows x0-x17 to be used as both parameter
    registers and result registers for the SMC and HVC instructions.
    
    Arm Firmware Framework for Armv8-A specification makes use of x0-x7 as
    parameter and result registers.
    
    Let us add new interface to support this extended set of input/output
    registers.
    
    This is based on 3fdc0cb59d97 ("arm64: smccc: Add support for SMCCCv1.2
    extended input/output registers") by Sudeep Holla from the Linux kernel
    
    The SMCCC version reported to the VM is bumped to 1.2 in order to support
    handling FF-A messages.
    
    [1] https://developer.arm.com/documentation/den0028/c/?lang=en
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>

commit 12e5c93f9d5503e67b106846d69a7c404a2a01d1
Author: Jens Wiklander <jens.wiklander@linaro.org>
Date:   Mon Jul 17 09:20:45 2023 +0200

    xen/arm: add TEE teardown to arch_domain_teardown()
    
    Adds a progress state for tee_domain_teardown() to be called from
    arch_domain_teardown(). tee_domain_teardown() calls the new callback
    domain_teardown() in struct tee_mediator_ops.
    
    Note that the OP-TEE mediator should be updated in a future patch to use
    the new teardown facility, that is not done here.
    
    Co-developed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

commit 2d775ee651e05596f083e1fe8dfb2ab410369d7d
Author: Andrew Cooper <andrew.cooper3@citrix.com>
Date:   Mon Jul 17 09:20:44 2023 +0200

    xen: Introduce arch_domain_teardown()
    
    Plumb it into domain_teardown().  Provide arch_val in the teardown
    continuation information for use by arch_domain_teardown().
    
    No practical change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 07:08:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 07:08:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567811.887332 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN6ii-0000qa-DR; Sat, 22 Jul 2023 07:08:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567811.887332; Sat, 22 Jul 2023 07:08:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN6ii-0000qT-AI; Sat, 22 Jul 2023 07:08:04 +0000
Received: by outflank-mailman (input) for mailman id 567811;
 Sat, 22 Jul 2023 07:08:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tMan=DI=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qN6ih-0000qN-3O
 for xen-devel@lists.xenproject.org; Sat, 22 Jul 2023 07:08:03 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7ebfc7c3-285e-11ee-b23a-6b7b168915f2;
 Sat, 22 Jul 2023 09:08:01 +0200 (CEST)
Received: from [192.168.31.238] (unknown [147.123.100.131])
 by support.bugseng.com (Postfix) with ESMTPSA id 7E9A94EE0C89;
 Sat, 22 Jul 2023 09:07:59 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7ebfc7c3-285e-11ee-b23a-6b7b168915f2
Message-ID: <8d31545a-dcc9-ef9e-8597-da8435872936@bugseng.com>
Date: Sat, 22 Jul 2023 09:07:57 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] xen/sched: mechanical renaming to address MISRA
 C:2012 Rule 5.3
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, michal.orzel@amd.com,
 xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com,
 George Dunlap <george.dunlap@citrix.com>, Dario Faggioli
 <dfaggioli@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>
References: <9945fd23b0bb88f3e0c6054a7f992cfa642d3f9f.1689953420.git.nicola.vetrini@bugseng.com>
 <alpine.DEB.2.22.394.2307211601230.3118466@ubuntu-linux-20-04-desktop>
Content-Language: en-US
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <alpine.DEB.2.22.394.2307211601230.3118466@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 22/07/23 01:06, Stefano Stabellini wrote:
> On Fri, 21 Jul 2023, Nicola Vetrini wrote:
>> Rule 5.3 has the following headline:
>> "An identifier declared in an inner scope shall not hide an
>> identifier declared in an outer scope"
>>
>> The renaming s/sched_id/scheduler_id of the function defined in
>> 'xen/common/sched/core.c' prevents any hiding of that function
>> by the many instances of omonymous function parameters.
>>
>> Similarly, the renames
>> - s/ops/operations
>> - s/do_softirq/exec_softirq
>> - s/loop/it
>> are introduced for parameter names, to avoid any conflict
>> with the homonymous variable or function defined in an enclosing
>> scope.
>>
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>> ---
>>   xen/common/sched/core.c    | 18 +++++++++---------
>>   xen/common/sched/credit2.c |  4 ++--
>>   xen/common/sysctl.c        |  2 +-
>>   xen/include/xen/sched.h    |  2 +-
>>   4 files changed, 13 insertions(+), 13 deletions(-)
>>
>> diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
>> index 022f548652..e74b1208bd 100644
>> --- a/xen/common/sched/core.c
>> +++ b/xen/common/sched/core.c
>> @@ -99,13 +99,13 @@ static void sched_set_affinity(
>>       struct sched_unit *unit, const cpumask_t *hard, const cpumask_t *soft);
>>   
>>   static struct sched_resource *cf_check
>> -sched_idle_res_pick(const struct scheduler *ops, const struct sched_unit *unit)
>> +sched_idle_res_pick(const struct scheduler *operations, const struct sched_unit *unit)
> 
> nit: code style, now the line is over 80 chars, could be fixed on commit
> 

Ok


>> -/* sched_id - fetch ID of current scheduler */
>> -int sched_id(void)
>> +/* scheduler_id - fetch ID of current scheduler */
>> +int scheduler_id(void)
>>   {
>>       return ops.sched_id;
>>   }
>> @@ -2579,7 +2579,7 @@ static void cf_check sched_slave(void)
>>       struct sched_unit    *prev = vprev->sched_unit, *next;
>>       s_time_t              now;
>>       spinlock_t           *lock;
>> -    bool                  do_softirq = false;
>> +    bool                  exec_softirq = false;
> 
> We don't typically use "exec" especially in the context of softirqs.
> I would just change it to "softirq".
> 

Ok

> 
>>       unsigned int          cpu = smp_processor_id();
>>   
>>       ASSERT_NOT_IN_ATOMIC();
>> @@ -2604,7 +2604,7 @@ static void cf_check sched_slave(void)
>>               return;
>>           }
>>   
>> -        do_softirq = true;
>> +        exec_softirq = true;
>>       }
>>   
>>       if ( !prev->rendezvous_in_cnt )
>> @@ -2614,7 +2614,7 @@ static void cf_check sched_slave(void)
>>           rcu_read_unlock(&sched_res_rculock);
>>   
>>           /* Check for failed forced context switch. */
>> -        if ( do_softirq )
>> +        if ( exec_softirq )
>>               raise_softirq(SCHEDULE_SOFTIRQ);
>>   
>>           return;
>> diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
>> index 87a1e31ee9..aba51a7963 100644
>> --- a/xen/common/sched/credit2.c
>> +++ b/xen/common/sched/credit2.c
>> @@ -3884,7 +3884,7 @@ csched2_dump(const struct scheduler *ops)
>>       list_for_each_entry ( rqd, &prv->rql, rql )
>>       {
>>           struct list_head *iter, *runq = &rqd->runq;
>> -        int loop = 0;
>> +        int it = 0;
> 
> Nice catch! This is almost a bug fix.
> 
> 
>>           /* We need the lock to scan the runqueue. */
>>           spin_lock(&rqd->lock);
>> @@ -3901,7 +3901,7 @@ csched2_dump(const struct scheduler *ops)
>>   
>>               if ( svc )
>>               {
>> -                printk("\t%3d: ", loop++);
>> +                printk("\t%3d: ", it++);
>>                   csched2_dump_unit(prv, svc);
>>               }
>>           }
>> diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
>> index 0cbfe8bd44..7cabfb0230 100644
>> --- a/xen/common/sysctl.c
>> +++ b/xen/common/sysctl.c
>> @@ -71,7 +71,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
>>           break;
>>   
>>       case XEN_SYSCTL_sched_id:
>> -        op->u.sched_id.sched_id = sched_id();
>> +        op->u.sched_id.sched_id = scheduler_id();
> 
> I am confused about this one. There is no global variable or no other
> global function named "sched_id". Why do we need to rename sched_id to
> scheduler_id?
> 

sched_id is also a common parameter name used by functions declared 
where the declaration of function 'sched_id' is also visible, so it's 
entirely equivalent whether to change parameter names or the function 
identifier, but since there's just one usage of the function (in 
'xen/common/sysctl.c') I preferred to make the minimal change in the 
patch. If you prefer this done the other way around, no problem.

> 
>>           break;
>>   
>>       case XEN_SYSCTL_getdomaininfolist:
>> diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
>> index 854f3e32c0..bfe714d2e2 100644
>> --- a/xen/include/xen/sched.h
>> +++ b/xen/include/xen/sched.h
>> @@ -791,7 +791,7 @@ int  sched_init_domain(struct domain *d, unsigned int poolid);
>>   void sched_destroy_domain(struct domain *d);
>>   long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *);
>>   long sched_adjust_global(struct xen_sysctl_scheduler_op *);
>> -int  sched_id(void);
>> +int  scheduler_id(void);
>>   
>>   /*
>>    * sched_get_id_by_name - retrieves a scheduler id given a scheduler name
>> -- 
>> 2.34.1
>>

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 08:17:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 08:17:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567879.887351 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN7nN-0000sc-4y; Sat, 22 Jul 2023 08:16:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567879.887351; Sat, 22 Jul 2023 08:16:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN7nN-0000sV-1R; Sat, 22 Jul 2023 08:16:57 +0000
Received: by outflank-mailman (input) for mailman id 567879;
 Sat, 22 Jul 2023 08:16:56 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=9aU5=DI=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qN7nM-0000sH-7l
 for xen-devel@lists.xenproject.org; Sat, 22 Jul 2023 08:16:56 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1e75c7bb-2868-11ee-b23a-6b7b168915f2;
 Sat, 22 Jul 2023 10:16:55 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id AF8741FD99;
 Sat, 22 Jul 2023 08:16:54 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 83AAA1346D;
 Sat, 22 Jul 2023 08:16:54 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id wffKHnaQu2S/QQAAMHmgww
 (envelope-from <jgross@suse.com>); Sat, 22 Jul 2023 08:16:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1e75c7bb-2868-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690013814; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=r+WpFCfUEhtaV9T33uK5LGEUOuSmGQRC70pWzEcNNf8=;
	b=PL4BgzEcV8HMEYahyguXSL9OxjkC7VJw3fT+6m1olauOsj3mZXQhTV25G1BQO4Tks2FuYq
	W0L4Ghc70d3l5q3/Qr+CAgoILO4qpLMFZM1iONb7oFshSNVQlojYevVaztDaqLurRRk5Uu
	iIea8CrWyYtjVFf5begoNGgm+iY0Gpw=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 1/2] tools/xenstore: add const to the return type of  canonicalize()
Date: Sat, 22 Jul 2023 10:16:45 +0200
Message-Id: <20230722081646.4136-2-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230722081646.4136-1-jgross@suse.com>
References: <20230722081646.4136-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The return type of canonicalize() can be modified to const char *.
This avoids the need to cast the const away from the input parameter.

There need to be quite some other functions modified to take const
parameters in order to avoid further casts.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstore/xenstored_core.c  | 22 ++++++++++++----------
 tools/xenstore/xenstored_core.h  |  3 ++-
 tools/xenstore/xenstored_watch.c | 16 ++++++++++------
 3 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index a1d3047e48..3d3c39bd70 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1216,25 +1216,26 @@ static char *perms_to_strings(const void *ctx, const struct node_perms *perms,
 	return strings;
 }
 
-char *canonicalize(struct connection *conn, const void *ctx, const char *node)
+const char *canonicalize(struct connection *conn, const void *ctx,
+			 const char *node)
 {
 	const char *prefix;
 
 	if (!node || (node[0] == '/') || (node[0] == '@'))
-		return (char *)node;
+		return node;
 	prefix = get_implicit_path(conn);
 	if (prefix)
 		return talloc_asprintf(ctx, "%s/%s", prefix, node);
-	return (char *)node;
+	return node;
 }
 
 static struct node *get_node_canonicalized(struct connection *conn,
 					   const void *ctx,
 					   const char *name,
-					   char **canonical_name,
+					   const char **canonical_name,
 					   unsigned int perm)
 {
-	char *tmp_name;
+	const char *tmp_name;
 
 	if (!canonical_name)
 		canonical_name = &tmp_name;
@@ -1249,7 +1250,7 @@ static struct node *get_node_canonicalized(struct connection *conn,
 }
 
 static struct node *get_spec_node(struct connection *conn, const void *ctx,
-				  const char *name, char **canonical_name,
+				  const char *name, const char **canonical_name,
 				  unsigned int perm)
 {
 	if (name[0] == '@')
@@ -1539,7 +1540,7 @@ static int do_write(const void *ctx, struct connection *conn,
 	unsigned int offset, datalen;
 	struct node *node;
 	char *vec[1] = { NULL }; /* gcc4 + -W + -Werror fucks code. */
-	char *name;
+	const char *name;
 
 	/* Extra "strings" can be created by binary data. */
 	if (get_strings(in, vec, ARRAY_SIZE(vec)) < ARRAY_SIZE(vec))
@@ -1574,7 +1575,7 @@ static int do_mkdir(const void *ctx, struct connection *conn,
 		    struct buffered_data *in)
 {
 	struct node *node;
-	char *name;
+	const char *name;
 
 	node = get_node_canonicalized(conn, ctx, onearg(in), &name,
 				      XS_PERM_WRITE);
@@ -1703,7 +1704,7 @@ static int do_rm(const void *ctx, struct connection *conn,
 {
 	struct node *node;
 	int ret;
-	char *name;
+	const char *name;
 	char *parentname;
 
 	node = get_node_canonicalized(conn, ctx, onearg(in), &name,
@@ -1765,7 +1766,8 @@ static int do_set_perms(const void *ctx, struct connection *conn,
 			struct buffered_data *in)
 {
 	struct node_perms perms, old_perms;
-	char *name, *permstr;
+	const char *name;
+	char *permstr;
 	struct node *node;
 
 	perms.num = xenstore_count_strings(in->buffer, in->used);
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 84a611cbb5..4184a4b7ef 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -224,7 +224,8 @@ void send_event(struct buffered_data *req, struct connection *conn,
 void send_ack(struct connection *conn, enum xsd_sockmsg_type type);
 
 /* Canonicalize this path if possible. */
-char *canonicalize(struct connection *conn, const void *ctx, const char *node);
+const char *canonicalize(struct connection *conn, const void *ctx,
+			 const char *node);
 
 /* Get access permissions. */
 unsigned int perm_for_conn(struct connection *conn,
diff --git a/tools/xenstore/xenstored_watch.c b/tools/xenstore/xenstored_watch.c
index 4195c59e17..f92fbeb73a 100644
--- a/tools/xenstore/xenstored_watch.c
+++ b/tools/xenstore/xenstored_watch.c
@@ -161,7 +161,7 @@ static int destroy_watch(void *_watch)
 }
 
 static int check_watch_path(struct connection *conn, const void *ctx,
-			    char **path, bool *relative)
+			    const char **path, bool *relative)
 {
 	/* Check if valid event. */
 	if (strstarts(*path, "@")) {
@@ -184,8 +184,9 @@ static int check_watch_path(struct connection *conn, const void *ctx,
 	return errno;
 }
 
-static struct watch *add_watch(struct connection *conn, char *path, char *token,
-			       bool relative, bool no_quota_check)
+static struct watch *add_watch(struct connection *conn, const char *path,
+			       const char *token, bool relative,
+			       bool no_quota_check)
 {
 	struct watch *watch;
 
@@ -218,12 +219,14 @@ int do_watch(const void *ctx, struct connection *conn, struct buffered_data *in)
 {
 	struct watch *watch;
 	char *vec[2];
+	const char *path;
 	bool relative;
 
 	if (get_strings(in, vec, ARRAY_SIZE(vec)) != ARRAY_SIZE(vec))
 		return EINVAL;
 
-	errno = check_watch_path(conn, ctx, &(vec[0]), &relative);
+	path = vec[0];
+	errno = check_watch_path(conn, ctx, &path, &relative);
 	if (errno)
 		return errno;
 
@@ -258,7 +261,8 @@ int do_unwatch(const void *ctx, struct connection *conn,
 	       struct buffered_data *in)
 {
 	struct watch *watch;
-	char *node, *vec[2];
+	const char *node;
+	char *vec[2];
 
 	if (get_strings(in, vec, ARRAY_SIZE(vec)) != ARRAY_SIZE(vec))
 		return EINVAL;
@@ -336,7 +340,7 @@ void read_state_watch(const void *ctx, const void *state)
 {
 	const struct xs_state_watch *sw = state;
 	struct connection *conn;
-	char *path, *token;
+	const char *path, *token;
 	bool relative;
 
 	conn = get_connection_by_id(sw->conn_id);
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Sat Jul 22 08:17:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 08:17:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567880.887361 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN7nS-0001Ah-CE; Sat, 22 Jul 2023 08:17:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567880.887361; Sat, 22 Jul 2023 08:17:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN7nS-0001Aa-97; Sat, 22 Jul 2023 08:17:02 +0000
Received: by outflank-mailman (input) for mailman id 567880;
 Sat, 22 Jul 2023 08:17:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=9aU5=DI=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qN7nQ-0000sH-UM
 for xen-devel@lists.xenproject.org; Sat, 22 Jul 2023 08:17:00 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 21ca3d1a-2868-11ee-b23a-6b7b168915f2;
 Sat, 22 Jul 2023 10:17:00 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 4B89B1FD99;
 Sat, 22 Jul 2023 08:17:00 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1AFDA1346D;
 Sat, 22 Jul 2023 08:17:00 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id MZknBXyQu2TGQQAAMHmgww
 (envelope-from <jgross@suse.com>); Sat, 22 Jul 2023 08:17:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 21ca3d1a-2868-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690013820; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=Kd7YFY39EtpfbWA0cD3V6qSiR/q/58pWNd+JYYA4Oc4=;
	b=ZtA5qAX5FeosMEBzMZ5nABWpmR2ywfNbkBQO1fLkDoXxxGNrMgKUOhiUyU699pLl9UXpE5
	exGehh2Ll7i4My3c2/1/lNxnORpyife5CxojsEAiotB3l/SRkFM8sSeXPz7yRsPukAwyIc
	nzZpZ+TajwwMj8LzQRdfXv+OubI8/Ao=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 2/2] tools/xenstore: fix get_spec_node()
Date: Sat, 22 Jul 2023 10:16:46 +0200
Message-Id: <20230722081646.4136-3-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230722081646.4136-1-jgross@suse.com>
References: <20230722081646.4136-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In case get_spec_node() is being called for a special node starting
with '@' it won't set *canonical_name. This can result in a crash of
xenstored due to dereferencing the uninitialized name in
fire_watches().

This is no security issue as it requires either a privileged caller or
ownership of the special node in question by an unprivileged caller
(which is questionable, as this would make the owner privileged in some
way).

Fixes: d6bb63924fc2 ("tools/xenstore: introduce dummy nodes for special watch paths")
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstore/xenstored_core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 3d3c39bd70..749717ec25 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1253,8 +1253,11 @@ static struct node *get_spec_node(struct connection *conn, const void *ctx,
 				  const char *name, const char **canonical_name,
 				  unsigned int perm)
 {
-	if (name[0] == '@')
+	if (name[0] == '@') {
+		if (canonical_name)
+			*canonical_name = name;
 		return get_node(conn, ctx, name, perm);
+	}
 
 	return get_node_canonicalized(conn, ctx, name, canonical_name, perm);
 }
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Sat Jul 22 08:17:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 08:17:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567878.887342 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN7nI-0000di-Um; Sat, 22 Jul 2023 08:16:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567878.887342; Sat, 22 Jul 2023 08:16:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qN7nI-0000db-QM; Sat, 22 Jul 2023 08:16:52 +0000
Received: by outflank-mailman (input) for mailman id 567878;
 Sat, 22 Jul 2023 08:16:51 +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 <SRS0=9aU5=DI=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qN7nH-0000dR-R2
 for xen-devel@lists.xenproject.org; Sat, 22 Jul 2023 08:16:51 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1b484896-2868-11ee-8611-37d641c3527e;
 Sat, 22 Jul 2023 10:16:49 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 25ECB1FD99;
 Sat, 22 Jul 2023 08:16:49 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E98FE1346D;
 Sat, 22 Jul 2023 08:16:48 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id Ey+NN3CQu2SyQQAAMHmgww
 (envelope-from <jgross@suse.com>); Sat, 22 Jul 2023 08:16:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1b484896-2868-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690013809; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:  content-transfer-encoding:content-transfer-encoding;
	bh=fQhOOswQDEVcBnxSyeWGk8qIextgjVPNvxIC0FSoJyg=;
	b=gNQykMOWl9UDkBepexCUvMEH9bpM1fSCuBZKQfjjREIZeZdf9U9qL9ODKqIwavko8tL2h7
	OMP8jsQKsLhfx3DBqkNgT/HNyPWsPGpqJRxFfP9SpL/Ayo+sxP5fNhGWPfq09d2CHQhGQU
	CWS+kxvNJcIJ4ZSeU8IxpAUwU2mueZs=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2 0/2] tools/xenstore: fix get_spec_node()
Date: Sat, 22 Jul 2023 10:16:44 +0200
Message-Id: <20230722081646.4136-1-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Small series to fix a bug in get_spec_node().

Patch 1 is turning several function parameters into const in order to
avoid having to cast away the const attribute in get_spec_node().

Patch 2 is the fix, which is a backport candidate.

Alternatives to this series would be:

- merge the patches into one patch and backport that
- swap the sequence of the patches in order to have less code churn
  when backporting, but re-adding the cast from const to non-cont,
  while backporting only the fix
- leave the series as is and backport both patches
- leave the series as is and use V1 of patch 2 for the backport

Juergen Gross (2):
  tools/xenstore: add const to the return type of  canonicalize()
  tools/xenstore: fix get_spec_node()

 tools/xenstore/xenstored_core.c  | 27 ++++++++++++++++-----------
 tools/xenstore/xenstored_core.h  |  3 ++-
 tools/xenstore/xenstored_watch.c | 16 ++++++++++------
 3 files changed, 28 insertions(+), 18 deletions(-)

-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Sat Jul 22 10:44:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 10:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567910.887378 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNA5Z-0008Uw-Iq; Sat, 22 Jul 2023 10:43:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567910.887378; Sat, 22 Jul 2023 10:43:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNA5Z-0008Up-FY; Sat, 22 Jul 2023 10:43:53 +0000
Received: by outflank-mailman (input) for mailman id 567910;
 Sat, 22 Jul 2023 10:43:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNA5Y-0008Uf-0y; Sat, 22 Jul 2023 10:43:52 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNA5X-0004Vx-KB; Sat, 22 Jul 2023 10:43:51 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNA5X-0003dc-5u; Sat, 22 Jul 2023 10:43:51 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qNA5X-0001eg-56; Sat, 22 Jul 2023 10:43:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=dq0uWY+3molsCKL1eREfyTkZhGTNGuLjKQ/Wb7HtMyY=; b=LXYFND56kJHuORR9a14eK8hsZN
	niEUnFjDwnuJRTrDmLkD2j5hCaE776k0eHKjx7833fZ6tc6WEB8fVLprpQFcwdz6VVYM0vbE6OKkB
	40mX0snzVymrdL9z5Kw6/tS1erXfo+dToBCDP/xyyAeRfqySqM4ZvxF/+gkqXMRh/Xxk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181958-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-upstream-4.17-testing test] 181958: tolerable FAIL - PUSHED
X-Osstest-Failures:
    qemu-upstream-4.17-testing:test-amd64-amd64-qemuu-freebsd12-amd64:guest-localmigrate/x10:fail:heisenbug
    qemu-upstream-4.17-testing:test-amd64-i386-qemuu-rhel6hvm-amd:xen-install:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-xl-qemuu-ws16-amd64:xen-install:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-freebsd10-amd64:xen-install:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-raw:guest-start:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-4.17-testing:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=ffb451126550b22b43b62fb8731a0d78e3376c03
X-Osstest-Versions-That:
    qemuu=eeaede60ffb1760c06850cae562d104e4f98c859
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 22 Jul 2023 10:43:51 +0000

flight 181958 qemu-upstream-4.17-testing real [real]
flight 181971 qemu-upstream-4.17-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181958/
http://logs.test-lab.xenproject.org/osstest/logs/181971/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-qemuu-freebsd12-amd64 19 guest-localmigrate/x10 fail pass in 181971-retest

Tests which did not succeed, but are not blocking:
 test-amd64-i386-qemuu-rhel6hvm-amd  7 xen-install             fail like 181914
 test-amd64-i386-xl-qemuu-ws16-amd64  7 xen-install            fail like 181914
 test-amd64-i386-freebsd10-amd64  7 xen-install                fail like 181914
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181914
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181914
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181914
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181914
 test-armhf-armhf-libvirt-raw 13 guest-start                  fail  like 181914
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181914
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181914
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass

version targeted for testing:
 qemuu                ffb451126550b22b43b62fb8731a0d78e3376c03
baseline version:
 qemuu                eeaede60ffb1760c06850cae562d104e4f98c859

Last test of basis   181914  2023-07-19 23:45:36 Z    2 days
Testing same since   181958  2023-07-21 12:11:13 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Claudio Fontana <cfontana@suse.de>
  CÃ©dric Le Goater <clg@redhat.com>
  Daniel Henrique Barboza <danielhb413@gmail.com>
  Paolo Bonzini <pbonzini@redhat.com>
  Richard Henderson <richard.henderson@linaro.org>
  Stefan Hajnoczi <stefanha@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              fail    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/qemu-xen.git
   eeaede60ff..ffb4511265  ffb451126550b22b43b62fb8731a0d78e3376c03 -> stable-4.17


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 13:00:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 13:00:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567943.887406 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNCDe-0005vY-GE; Sat, 22 Jul 2023 13:00:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567943.887406; Sat, 22 Jul 2023 13:00:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNCDe-0005vR-DZ; Sat, 22 Jul 2023 13:00:22 +0000
Received: by outflank-mailman (input) for mailman id 567943;
 Sat, 22 Jul 2023 13:00:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Nq/f=DI=epam.com=prvs=1567f67e21=oleksandr_tyshchenko@srs-se1.protection.inumbo.net>)
 id 1qNCDc-0005vL-3L
 for xen-devel@lists.xenproject.org; Sat, 22 Jul 2023 13:00:20 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b4571a74-288f-11ee-b23a-6b7b168915f2;
 Sat, 22 Jul 2023 15:00:17 +0200 (CEST)
Received: from pps.filterd (m0174678.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36MCMi5g015320; Sat, 22 Jul 2023 13:00:07 GMT
Received: from eur04-db3-obe.outbound.protection.outlook.com
 (mail-db3eur04lp2057.outbound.protection.outlook.com [104.47.12.57])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3s0f21g1bj-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Sat, 22 Jul 2023 13:00:06 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com (2603:10a6:10:ed::15)
 by AM0PR03MB6290.eurprd03.prod.outlook.com (2603:10a6:20b:15f::19) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.30; Sat, 22 Jul
 2023 13:00:02 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::11f9:615a:4d9a:a5d2]) by DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::11f9:615a:4d9a:a5d2%6]) with mapi id 15.20.6588.027; Sat, 22 Jul 2023
 13:00:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b4571a74-288f-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=lvEQKk5mLVB9YTb2GqU9cgs8Yc2DKK41dnvbSGgBEVwKBETOpbIL5P+wxLPI+u8RAnHmje+sRSoXJ057qLcaj6BTTEffPzwfXA3AkJQgoFZGSS7EDFcGuJsKcyj6oWpL48d4y8zWfg3yublKTfmLRQQ0XhPi0IQMQiSBYe1fhgn67gMKxg6vaeH7DL6+xzuyAnK+Otp7ydmD3NpmLhzXw7HZGMtMFOabHV2dI1LrYSOMbG4q9NLHQkAF4qmbxLRDv/1FnBetO9YDzPTmG070WNZAUp/6aTvZxJ/YxJk9izS1ilbLeFuYPuz1Nc1Zpbk/itLMewh+ykkIzWkkcBBemw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yyQncW3QjF1r9yAUxjyLtg5BVB8a24sKRAj9UFU6RFM=;
 b=CROasv3W34d9XufyPM4hz0cfG2ZaT3PtBgmK/+/LQv7bn3WLtWSo2kYFw45cEjnHfp9YTTSupl0iyrXinaV9cvBgnY4ABFxqHmQ8aJ+uMHX4ixQET4G4l0dcdvOrE5jLkzQlU9c54iYU2B8t5pSisTwOEEkB0lEmggNVOi6QRh6UM6mXDF57LGlWnU+RoPTGRSAnQWsTCKvoOag7PKB2BnlYxm4fXVBC1swle24FIWe5LR0jXQLMbn/X5k+/YFYiE3LGDcd6egMompDIExo4CsvIgFDo4WXCvvWk8w58Np9UrKgiITgtEzI38Io+v0MKzmNoom4PsHkPU+opiTAuGA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yyQncW3QjF1r9yAUxjyLtg5BVB8a24sKRAj9UFU6RFM=;
 b=ZEy6Fb8jNshnMm8WmXqG3eT6n9XVRaylx5SIRBpQHBbQcko3b8SlRfTXA0PlNi64ulpUlnDnSO6SxLdlamZp0wWEpX5j+slwkoZ9oWH7a3ffGJbh9a6x8L3HPnMMZSf+BqQy4Gsetjzlfa/nOZJeVV16ExIc+hjJNCIVHMP4U+eQViRtFx6y8y0H9raZR8oUPF3UWU+yFr8m0dMJ2CkK8lhWieuIuRKsHw2CfSFEuiLp7ii3GXSznBxRTkni2rW7A/n/sqDqu2XSTkGLUqPtXbuh97gIHuKuQIYpB8heSArW0yAC5sAxiQbUHZkBXzJWx9/loHlEGy9TUWnvlUwjig==
From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
To: Stefano Stabellini <sstabellini@kernel.org>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
        "pmladek@suse.com" <pmladek@suse.com>,
        "jgross@suse.com" <jgross@suse.com>
Subject: Re: [PATCH] xenbus: check xen_domain in xenbus_probe_initcall
Thread-Topic: [PATCH] xenbus: check xen_domain in xenbus_probe_initcall
Thread-Index: AQHZvCju+wR/K2O8tkyLPTyf5+laP6/FwIeA
Date: Sat, 22 Jul 2023 13:00:01 +0000
Message-ID: <1fa1bb86-f0a9-62f5-b61a-ffb29daa81f5@epam.com>
References: 
 <alpine.DEB.2.22.394.2307211609140.3118466@ubuntu-linux-20-04-desktop>
In-Reply-To: 
 <alpine.DEB.2.22.394.2307211609140.3118466@ubuntu-linux-20-04-desktop>
Accept-Language: en-US, ru-RU
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DB8PR03MB6108:EE_|AM0PR03MB6290:EE_
x-ms-office365-filtering-correlation-id: 27acd770-5aee-42e4-153e-08db8ab38fd6
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 9/+NFFymxRQZh2G/vX2s6SoOWnm1Qlh6bGy85INuF9HS6KMvDBTDamG7G5jQJ5zI2cE41rllRJ/nTq5/3pJBN/nFsnsXGz9lLwL/GQKr7snZm3lzDdfbwORvBXmk7LZ5H7M0cws78/5vVIaOxvUfJfCnAlyJA0IkZq7i3dRsFcAO9/IMZrN3AhK+S18lEw+Q7n+aP5Q/ISbpm6A5qCTyCLPVFgTFXK6YDcxAAW/2MkA9rvg7BYdsrQVrs6FX2oVHQ6Oy1Gr66GQ6v06WAQkeGbLm69XlX7tfMLpyd0cSE1E4SFpUr4ZJrdZlmKbyjZnrjHCVj383LirDd8oILQ2lWZxpHXukjW2hKTejBZ2SK8g7cx1HfwbPnnKV70dal8W+SscYFJYQzuQIEvIOMd7OGoz5z9r5HZ/F8f4m/N9mRq6iJxVzw0Ay0OjHsah/ya6AJyzDvxBq4r5x9jtIU4TlF0yMFYcyoKJOjpT4YAqvex3g4HGQQIlZiA9DhvjAkYDFxSlvbvvAENIT+6C6i/tRLFY0RQfcSo/gNgyPmOiH14qr1+VteJ1BqA4FtpYU+M60RQj9hqwUkl5fBelf0fwgzvEzD+dkKkRx5Hwwynlq8RO3WqL8K4lz/N/CGzV0d6UgPJX3NWJRCEfCbemjv/RIZw==
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR03MB6108.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(136003)(376002)(346002)(39860400002)(451199021)(2906002)(38100700002)(6512007)(122000001)(83380400001)(186003)(2616005)(26005)(6506007)(53546011)(5660300002)(86362001)(31696002)(8936002)(8676002)(38070700005)(36756003)(71200400001)(478600001)(6486002)(4326008)(6916009)(64756008)(66446008)(66476007)(66556008)(66946007)(76116006)(41300700001)(316002)(54906003)(91956017)(31686004)(45980500001);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?V3YySlJHQld2N05EV01pbitjV3BVdHd6M0ZOWjhSckx2anJXSkR6UFBCQ29M?=
 =?utf-8?B?OE5qREZKWmY0aURjamJZcFAzK28yM0RFUHZDNm5XUXc3WUhwVkVYWjBxOGpK?=
 =?utf-8?B?bWR2dG01UEFhVE42SzZ0ZjVSL0t5ZlJJMG15Y29RVUEvOWhFakdHbE5Zazlo?=
 =?utf-8?B?TEY1SFZDb2pXNDI4RFpoQkg4U0diU21DRFMxK2Q4eEN0SnE4dnJqeml4QlN0?=
 =?utf-8?B?Z2dVek5IZkwwUmFWNkd0emVrYmNJRkRxMDB2bFFmVFRGcktJelRVbVVmdTFO?=
 =?utf-8?B?VWorNWVFMk93bE52d3g3alNRN0Vua2lIQit3anYvZzk0NUcwblFOS1h3MjBn?=
 =?utf-8?B?Q3NEWHFneENnanlWQnlIbzRKOCtwdlJob0o1MFhIL3p0ZHRBMVlpRXFvNHZG?=
 =?utf-8?B?bGUvRWlNKytidVQzOVE5ZmJ2K3BERnEydFhuL1FQN1dRTHVaYXR6NHBZOFNo?=
 =?utf-8?B?TlV5bzFWdktucEZZM3dtT2VIYlpmbDVlKzViZVJ0Q3oxRmk0MlJ0THZWZXk0?=
 =?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encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DB8PR03MB6108.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 27acd770-5aee-42e4-153e-08db8ab38fd6
X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jul 2023 13:00:01.9759
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: OvUUGrYVmRbeBBlG/0c+W8v0/ZBTvgiaRRla3o7CKxtaW2nIpx90RzM/JPa1AFbbIbW17yTWnpBHZ+1YcPyZ+B9JZngw9cu3hTjAUynG2rk=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR03MB6290
X-Proofpoint-ORIG-GUID: 234ol2GAL7Syfjqfw4DnrQ5qCN9c2WYL
X-Proofpoint-GUID: 234ol2GAL7Syfjqfw4DnrQ5qCN9c2WYL
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-22_04,2023-07-20_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0
 impostorscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501
 malwarescore=0 phishscore=0 suspectscore=0 lowpriorityscore=0 bulkscore=0
 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307220116

DQoNCk9uIDIyLjA3LjIzIDAyOjEzLCBTdGVmYW5vIFN0YWJlbGxpbmkgd3JvdGU6DQoNCkhlbGxv
IFN0ZWZhbm8NCg0KDQo+IFRoZSBzYW1lIHdheSB3ZSBhbHJlYWR5IGRvIGluIH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Cj4gICAJICogbmVlZCB0byB3YWl0IGZvciB0aGUgcGxhdGZvcm0gUENJ
IGRldmljZSB0byBjb21lIHVwIG9y


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 13:24:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 13:24:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567956.887417 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNCaw-0008Qc-DM; Sat, 22 Jul 2023 13:24:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567956.887417; Sat, 22 Jul 2023 13:24:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNCaw-0008QV-Ad; Sat, 22 Jul 2023 13:24:26 +0000
Received: by outflank-mailman (input) for mailman id 567956;
 Sat, 22 Jul 2023 13:24:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNCav-0008QL-7V; Sat, 22 Jul 2023 13:24:25 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNCav-0008Lb-1T; Sat, 22 Jul 2023 13:24:25 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNCau-0000Ff-J3; Sat, 22 Jul 2023 13:24:24 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qNCau-0000vP-Ic; Sat, 22 Jul 2023 13:24:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=M5ZBlmT6oFKVpB9SgQhH8JeSS06zz8GUBMQCPyaexEQ=; b=Bh4plPLKYiSNrXcvXii98CCw1+
	gvOPITSg3ovc9AyOcaBdwRGLJ6GHpmvZZlBJRbUlpWD5QLa8nl4EOqrl8P0M17oP0J5l6j8upfmjH
	PPvhQ1onu5ky6PhzZlq4UfgUdWLqkYH2JnHFp9ck80a/zzVWQwacEGUOrIlsU8sW3K1M=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181960-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181960: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-qemuu-nested-amd:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:guest-localmigrate/x10:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:guest-localmigrate/x10:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:guest-start/debianhvm.repeat:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-localmigrate/x10:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:guest-localmigrate/x10:fail:allowable
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=f7e3a1bafdea735050dfde00523cf505dc7fd309
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 22 Jul 2023 13:24:24 +0000

flight 181960 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181960/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm  8 xen-boot fail REGR. vs. 180278
 test-amd64-amd64-qemuu-nested-amd  8 xen-boot            fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  20 guest-localmigrate/x10   fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd      19 guest-localmigrate/x10   fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 20 guest-start/debianhvm.repeat fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 18 guest-localmigrate/x10 fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds     20 guest-localmigrate/x10   fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                f7e3a1bafdea735050dfde00523cf505dc7fd309
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   96 days
Failing since        180281  2023-04-17 06:24:36 Z   96 days  183 attempts
Testing same since   181960  2023-07-21 13:43:27 Z    0 days    1 attempts

------------------------------------------------------------
3798 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 637684 lines long.)


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 15:03:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 15:03:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.567998.887426 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNE8d-0001zy-B1; Sat, 22 Jul 2023 15:03:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 567998.887426; Sat, 22 Jul 2023 15:03:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNE8d-0001zr-87; Sat, 22 Jul 2023 15:03:19 +0000
Received: by outflank-mailman (input) for mailman id 567998;
 Sat, 22 Jul 2023 15:03:18 +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
 <SRS0=Nq/f=DI=epam.com=prvs=1567f67e21=oleksandr_tyshchenko@srs-se1.protection.inumbo.net>)
 id 1qNE8b-0001zl-RZ
 for xen-devel@lists.xenproject.org; Sat, 22 Jul 2023 15:03:17 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e1885e25-28a0-11ee-8611-37d641c3527e;
 Sat, 22 Jul 2023 17:03:15 +0200 (CEST)
Received: from pps.filterd (m0174677.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36ME9V0d005193; Sat, 22 Jul 2023 15:03:09 GMT
Received: from eur02-vi1-obe.outbound.protection.outlook.com
 (mail-vi1eur02lp2046.outbound.protection.outlook.com [104.47.11.46])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3s0f8k0558-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Sat, 22 Jul 2023 15:03:09 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com (2603:10a6:10:ed::15)
 by PAXPR03MB8226.eurprd03.prod.outlook.com (2603:10a6:102:24d::15) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Sat, 22 Jul
 2023 15:03:05 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::11f9:615a:4d9a:a5d2]) by DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::11f9:615a:4d9a:a5d2%6]) with mapi id 15.20.6588.027; Sat, 22 Jul 2023
 15:03:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e1885e25-28a0-11ee-8611-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LB/dBvEqsnFJmPeGzo3/ccJ5l7KfVIx0RdBOyKB+s4mo3dOqcQROTZBq+dsa5qYcZkABz762L3PTLs2hd+wTx3XGFEDFk5RMN8U6TQHkO2jzjis8eqZQEJD0yq1a37M7pxs7fVffib+YgWIVtt/NOggI1WFIBjA8xe+S//q2f7vogNE4VMkeVpLvbxj4YBxPqeqs7rHSjiQ6za/FvmyWnZC2SEmFAAZKQTJx+baAMV/yETQCwC8EpEZdw4mD7op2XA2jf1DbMGGORUReXmDFH8fbdxwxMJixxsKNOBWrv6D2ZB1Gg5kESF/6xiydb4CN69I3t+org0qd810nVa/aVg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+R4ajVG3h6SMNFqmYuOHuTKxByn6UKJrQ1FcwGYWYAM=;
 b=M1zHdZl5Vee6Tq6+gX+LGMKr2EKKEJK8CWZUAKmz+rYbVan+FnHMMcMXZEDcWv/XNkLdeKW2vtJreWkq9FEgtlR1Mn4PXuIY4wu5H9HQRRJfq91ROfaD9k4kG5E96TgyzzysNY24btuTbqLRvRUa0aOkhoXzFIOn8YZr8f7n3Vz08j65Z8mwfGSU363/JcnXX0giFW1f4dYmWxMdqlqlUW2pc84Rd/Y2OgJdWT2NRILK2b8zHU64Ir+UBFlH3HUQ/3eFONGBJvLNWCcYqjurJu5p8cWKpgm8HbMyHQsY9p1mjUMZOn8lK7fy99cADzNzU3pzlOaECOE5+m3UrDEaFQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+R4ajVG3h6SMNFqmYuOHuTKxByn6UKJrQ1FcwGYWYAM=;
 b=W02NSaxKUY8ovifrsVK1b0R4S+XRiutjtFY7lib1BFQMbErNl9y5hp6Pw3nqJpZYKbAUWradFTl/I3SCLStlgWstyrFLGZXNv9xRFSUf3qCWUEpdIsmwFDOR/6qiGcitqLUrDHTKeEtinyT+BPSn1JzI7cKPMxirBEpbMfNDsJLLWagqkRF6EVYKqWPrP8Oiz2ve9uCt80RH5qhgUb+9ePWH6OIjB8DJq8HXkXGeLqkOo1ursFdGZu+dlZktEybU2zKPuIxN/yw1rowClW7z7FfqA4kAiqMTEFQ8zfyC+ZsgnGo8+NWEgnYkEUo+Kf2et44VNS7yQX3Lb9xUope6Xg==
From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
CC: Vincent Guittot <vincent.guittot@linaro.org>,
        =?utf-8?B?QWxleCBCZW5uw6ll?=
	<alex.bennee@linaro.org>,
        "stratos-dev@op-lists.linaro.org"
	<stratos-dev@op-lists.linaro.org>,
        Erik Schilling
	<erik.schilling@linaro.org>,
        Manos Pitsidianakis
	<manos.pitsidianakis@linaro.org>,
        Mathieu Poirier
	<mathieu.poirier@linaro.org>,
        Juergen Gross <jgross@suse.com>,
        "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
        "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
        Stefano
 Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH V2 1/2] xen: Update dm_op.h from Xen public header
Thread-Topic: [PATCH V2 1/2] xen: Update dm_op.h from Xen public header
Thread-Index: AQHZuuzPfJ0NTGNckUyWY+5pgNmcK6/F5WEA
Date: Sat, 22 Jul 2023 15:03:05 +0000
Message-ID: <8fa45eb3-93d8-15bc-d963-57abf1fed16f@epam.com>
References: 
 <c923befe0a016891e7dee3e1ccb3c00d676f2b3d.1689845210.git.viresh.kumar@linaro.org>
In-Reply-To: 
 <c923befe0a016891e7dee3e1ccb3c00d676f2b3d.1689845210.git.viresh.kumar@linaro.org>
Accept-Language: en-US, ru-RU
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DB8PR03MB6108:EE_|PAXPR03MB8226:EE_
x-ms-office365-filtering-correlation-id: 02e3ccad-ea71-4e6f-9820-08db8ac4c091
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 B7GX8foOLleKn3Es9VdiHrltkmt3iYaOXOEy4Q8NdlGRjISReyIZllPSupBbR2vjL0pHY80xov/YVFw1Egh9f3lYLIGnN8/uqDF19GoNrGhjqlDI281YTmc49bugdGSDYWudhU3+cqanv5d/vEomNl3fp/IHDvxfjL/b5SeeGECKI/HC4EBQeDFMUeDbo6UAzN29DXcW11ASTWF9ua5phR17KNoE1rAExo75VdyK+bWOC5KYkJEW+Zk2JapWGKj3iADVZe9m6zhd8oLHzmSxQFC01ZXtfLdAOVXtNHMlYPCLCqLHT3VGCFC7PIJO+FFQIophhJs3h0quUR43su+s7ksdUjbQeSUAiDaFoz663AvVJnxT9OABluRJ4xBSqgaQseQ9nd4cAhzRKgSreNhfmvFePd3aIvpp/bgzBBSATIMp6Ve3VFoODsev+wno6UD7o0LiIswHXwtNHkslNiMltPS0ucdwFJTiQBm5QOJ9pwI3DECrf1hiwD+bkfEZhh0ntMySQ5xw3JaLy29VH/72NnScjuqPglV9cqPTxSdQdNRlTTmoh0RWxPnbxjG7s/0F7lG9s9LLWZLD61pvZFv6LANMJB4rv4+UCyb8VRYQ9BruHfeihjzbdalM/oJ7U6VHI6bUCo/gsI8S9Lyws2U2RHzUfZ6LeRBxN19h69D8kTE=
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR03MB6108.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(136003)(346002)(376002)(39860400002)(451199021)(38100700002)(71200400001)(38070700005)(2616005)(66574015)(36756003)(15650500001)(83380400001)(54906003)(4326008)(66446008)(91956017)(66946007)(6916009)(66556008)(66476007)(2906002)(64756008)(316002)(76116006)(966005)(6512007)(478600001)(6486002)(26005)(7416002)(41300700001)(186003)(5660300002)(8676002)(8936002)(6506007)(53546011)(122000001)(31696002)(86362001)(31686004)(21314003)(45980500001);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?NlhyVXFHZFBMV29wSmlneks4RFBWcGN2Z0ZqV1hrY1NJVDVaNVovK0kyZjhk?=
 =?utf-8?B?Vm9CWlphKzRhNUhXUEEzUGJ0akU5YnBzM2h0K3pJa1VBNEthWjVHbEs4RXBM?=
 =?utf-8?B?YnFTNFJ2cS9rc1ZTT01ranBxSGswNUxhWXUvclVnTFhOVlBWSjNvcHNrTzE1?=
 =?utf-8?B?OSs3U1dzdGUzalJybXQwRTNKcXBLUmRIV1BtL0JsOXNwWG0vRTNscUNHcmV1?=
 =?utf-8?B?Zk9KWW1oSnhmMERQbGEzV3RqUUhYVThjOU1abWliWEVrZ2lVVVJ3WlpIMjVh?=
 =?utf-8?B?M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1NTc1WXh4bCtwdnMr?=
 =?utf-8?B?N2ozU1ZQYU9YWXBrYUtYczRBVlpBRjhrZVpKbFZNaWZsaDI0L1g5a0s1Wk9k?=
 =?utf-8?B?eU8wcjZqZFFOdFgwRUI0MXdSRTNEUnNMdFpKL245WEEweG45dUI2Zk0vOWxB?=
 =?utf-8?Q?QEv32NuQ/NVV/SfOBa+w/G8=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <F20B45FF40744548859B03E143B09FBD@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DB8PR03MB6108.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 02e3ccad-ea71-4e6f-9820-08db8ac4c091
X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jul 2023 15:03:05.1520
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: rPR72xM7FTtF1XTlFiTk7rwLY/fVDiQDL33v68MQc9+MP8g/XytzyTe5ZPuOb/eD+vGwJn3HQkgjbKxvJ6qe4l1H+fktl2NP5SCFGRcCfL4=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR03MB8226
X-Proofpoint-GUID: Yj7-gXBjD7xu9IQURSG_3ZFdmPrhdLy9
X-Proofpoint-ORIG-GUID: Yj7-gXBjD7xu9IQURSG_3ZFdmPrhdLy9
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-22_06,2023-07-20_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxscore=0
 malwarescore=0 adultscore=0 suspectscore=0 phishscore=0 bulkscore=0
 mlxlogscore=949 lowpriorityscore=0 impostorscore=0 spamscore=0
 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307220135

DQoNCk9uIDIwLjA3LjIzIDEyOjMwLCBWaXJlc2ggS3VtYXIgd3JvdGU6DQoNCkhlbGxvIFZpcmVz
aA0KDQoNCj4gVXBkYXRlIHRoZSBkZWZpbml0aW9ucyBpbiBkbV9vcC5oIGZyb20gWGVuIHB1Ymxp
YyBoZWFkZXIuDQoNCkkgdGhpbmssIGl0IHdvdWxkIGJlIGdvb2QgdG8gbWVudGlvbiBleGFjdCBY
ZW4gdmVyc2lvbiAoY29tbWl0KSB3ZSBhcmUgDQpiYXNlZCBvbi4NCg0KSW4gZ2VuZXJhbCBwYXRj
aCBsb29rcyBnb29kIHRvIG1lLCBqdXN0IGEgbm90ZS4NCg0KSSBjb21wYXJlZCB3aXRoIFhlbidz
IHB1YmxpYy9odm0vZG1fb3AuaCBhbmQgbm90aWNlZCBkaWZmZXJlbmNlcy4gSSANCnVuZGVyc3Rh
bmQsIHRoaXMgY2Fubm90IGJlIDEwMCUgdmVyYmF0aW0gY29weSwgYmVjYXVzZSBvZiBoZWFkZXJz
IA0KbG9jYXRpb24sIGVtYWNzIG1hZ2ljcywgR1VFU1RfSEFORExFIHZzIFhFTl9HVUVTVF9IQU5E
TEUuIFRoZSBMaW51eCANCmhlYWRlciBkb2Vzbid0IGNvbnRhaW4gYW55IGFsaWFzZXMgdGhlIFhl
biBoZWFkZXIgaGFzIGZvciBlYWNoICJzdHJ1Y3QgDQp4ZW5fZG1fb3BfeHh4IiwgZm9yIGV4YW1w
bGUgLi4uDQoNCltzbmlwXQ0KDQoNCj4NCj4gKy8qDQo+ICsgKiBYRU5fRE1PUF9jcmVhdGVfaW9y
ZXFfc2VydmVyOiBJbnN0YW50aWF0ZSBhIG5ldyBJT1JFUSBTZXJ2Z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JfdDsNCg0KQW5kICJzdHJ1Y3QgeGVuX2RtX29wIiBkb3du
IHRoZSBmaWxlIHVzZXMgdGhlc2UgYWxpYXNlcyBpbnNpZGUgYSB1bmlvbi4NCg0KSSBhc3N1bWUs
IHdlIGhhdmUgdG8gZGl2ZXJnZSBoZXJlIGluIG9yZGVyIHRvIGZvbGxvdyBhIHJlY29tbWVuZGF0
aW9uDQp0byBhdm9pZCB0eXBlZGVmJ2luZyBzdHJ1Y3RzIGF0IFsxXSwgYW0gSSDRgW9ycmVjdD8g
T3IgaXMgdGhlcmUgYW5vdGhlciANCnJlYXNvbj8NCg0KSSB0aGluaywgaXQgd291bGQgYmUgZ29v
ZCB0byBtZW50aW9uIGEgcmVhc29uIGluIHRoZSBkZXNjcmlwdGlvbi4NCg0KWzFdIGh0dHBzOi8v
d3d3Lmtlcm5lbC5vcmcvZG9jL2h0bWwvdjYuNC9wcm9jZXNzL2NvZGluZy1zdHlsZS5odG1sI3R5
cGVkZWZzDQoNCg0K


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 15:21:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 15:21:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568011.887437 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNEPk-0004UK-SM; Sat, 22 Jul 2023 15:21:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568011.887437; Sat, 22 Jul 2023 15:21:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNEPk-0004UD-PW; Sat, 22 Jul 2023 15:21:00 +0000
Received: by outflank-mailman (input) for mailman id 568011;
 Sat, 22 Jul 2023 15:20:59 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qNEPj-0004U7-Qs
 for xen-devel@lists.xenproject.org; Sat, 22 Jul 2023 15:20:59 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNEPi-0002Vg-T1; Sat, 22 Jul 2023 15:20:58 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNEPi-0004uf-Mi; Sat, 22 Jul 2023 15:20:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:Subject:
	From:References:Cc:To:MIME-Version:Date:Message-ID;
	bh=RbGCztfCAISyM9SEHR7xBGOFvIfKLJrHHUgMEzl6ieg=; b=skoQcH5XefLRb0JIaDR+z25HDB
	1sCzzXB/45DK73AqGVkvo9VCwKlodFe3vxIkA2XG9G8G9fxSW7jYwcRLNx+FlYOxMqTS7XDwHTo1B
	U0+Hn2i3Kue6JPT9tEUogW0Le8iIlghMQO6CwcuvxPbJQcShgtFKrajykqgaMLDX389c=;
Message-ID: <adc0b17a-1d59-8c52-8823-64a0d9ec475b@xen.org>
Date: Sat, 22 Jul 2023 16:20:57 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230722081646.4136-1-jgross@suse.com>
 <20230722081646.4136-2-jgross@suse.com>
From: Julien Grall <julien@xen.org>
Subject: Re: [PATCH v2 1/2] tools/xenstore: add const to the return type of
 canonicalize()
In-Reply-To: <20230722081646.4136-2-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 22/07/2023 09:16, Juergen Gross wrote:
> -static struct watch *add_watch(struct connection *conn, char *path, char *token,
> -			       bool relative, bool no_quota_check)
> +static struct watch *add_watch(struct connection *conn, const char *path,
> +			       const char *token, bool relative,
> +			       bool no_quota_check)
>   {
>   	struct watch *watch;
>   
> @@ -218,12 +219,14 @@ int do_watch(const void *ctx, struct connection *conn, struct buffered_data *in)
>   {
>   	struct watch *watch;
>   	char *vec[2];
> +	const char *path;
>   	bool relative;
>   
>   	if (get_strings(in, vec, ARRAY_SIZE(vec)) != ARRAY_SIZE(vec))
>   		return EINVAL;
>   
> -	errno = check_watch_path(conn, ctx, &(vec[0]), &relative);
> +	path = vec[0];
> +	errno = check_watch_path(conn, ctx, &path, &relative);

 From my understanding, check_watch_path() could update vec[0] which is 
then used below. But with your change, vec[0] would not be updated anymore.

I can see two possible approach:
    1) get_strings() is taking a const as well
    2) replace all use of vec[0] with path

I have a slight preference for the former. But I can also understand 
this is more work. So choose whichever you prefer.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 15:25:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 15:25:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568015.887447 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNEU0-00055O-D6; Sat, 22 Jul 2023 15:25:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568015.887447; Sat, 22 Jul 2023 15:25:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNEU0-00055H-8t; Sat, 22 Jul 2023 15:25:24 +0000
Received: by outflank-mailman (input) for mailman id 568015;
 Sat, 22 Jul 2023 15:25:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qNETy-00055B-QA
 for xen-devel@lists.xenproject.org; Sat, 22 Jul 2023 15:25:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNETx-0002aU-VT; Sat, 22 Jul 2023 15:25:21 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNETx-000582-QY; Sat, 22 Jul 2023 15:25:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=NySikiBv0iLxOOqFl08/w5TaDvl4h0pcfb4ea5KPRfc=; b=2e3CcShirAnyO/aNKRpVMWb+24
	YnIC8ZqW0qnBOCcnbScUD4U9oIxkAA1IPdrWgWbwxeBH0iK1WQXypeXkrfOeSnS3cV4v9v8nEKSiQ
	3LUJCuzkHfhBtLSlOKWE1LwHF30VwpoIA0Mrh+9Y7pi4bZlr733fAyTB5K6pYruyBVCs=;
Message-ID: <9744f55f-9c5d-ad9f-8f32-37de802f7928@xen.org>
Date: Sat, 22 Jul 2023 16:25:20 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v2 2/2] tools/xenstore: fix get_spec_node()
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230722081646.4136-1-jgross@suse.com>
 <20230722081646.4136-3-jgross@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230722081646.4136-3-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 22/07/2023 09:16, Juergen Gross wrote:
> In case get_spec_node() is being called for a special node starting
> with '@' it won't set *canonical_name. This can result in a crash of
> xenstored due to dereferencing the uninitialized name in
> fire_watches().
> 
> This is no security issue as it requires either a privileged caller or
> ownership of the special node in question by an unprivileged caller
> (which is questionable, as this would make the owner privileged in some
> way).
> 
> Fixes: d6bb63924fc2 ("tools/xenstore: introduce dummy nodes for special watch paths")
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 16:45:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 16:45:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568051.887458 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNFie-0005Po-1B; Sat, 22 Jul 2023 16:44:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568051.887458; Sat, 22 Jul 2023 16:44:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNFid-0005Ph-Sk; Sat, 22 Jul 2023 16:44:35 +0000
Received: by outflank-mailman (input) for mailman id 568051;
 Sat, 22 Jul 2023 16:44:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qNFid-0005Pb-81
 for xen-devel@lists.xenproject.org; Sat, 22 Jul 2023 16:44:35 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNFic-0004jh-2F; Sat, 22 Jul 2023 16:44:34 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNFib-00006M-Q0; Sat, 22 Jul 2023 16:44:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:
	References:Cc:To:From:Subject:MIME-Version:Date:Message-ID;
	bh=yuYB436eqH2GU3dKV2QT3D7Wz9PnJv+5Vky4kR/9QmU=; b=MICvJ15nZXtawZYm/O677W5Kbw
	Sd/9LiVj64/ne11qw6mbJsdPuMQUU2WPdXhY02FZooq5bXXR0qpRLjEqCo4H7BP3nJ3HYLG0/5edb
	6W1eqGr6usKnyvYz1yo2UJ4tG0xKzTXEWR/sy4nsJRmX/HVLCYWUuJ5YV0vzw2kjjNpk=;
Message-ID: <e374c950-7dce-2e28-3b4c-946f4a0a2aec@xen.org>
Date: Sat, 22 Jul 2023 17:44:32 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v2 1/2] tools/xenstore: add const to the return type of
 canonicalize()
From: Julien Grall <julien@xen.org>
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230722081646.4136-1-jgross@suse.com>
 <20230722081646.4136-2-jgross@suse.com>
 <adc0b17a-1d59-8c52-8823-64a0d9ec475b@xen.org>
In-Reply-To: <adc0b17a-1d59-8c52-8823-64a0d9ec475b@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 22/07/2023 16:20, Julien Grall wrote:
> Hi Juergen,
> 
> On 22/07/2023 09:16, Juergen Gross wrote:
>> -static struct watch *add_watch(struct connection *conn, char *path, 
>> char *token,
>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  bool relative, bool no_quota_check)
>> +static struct watch *add_watch(struct connection *conn, const char 
>> *path,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const char *token, bool relative,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  bool no_quota_check)
>> Â  {
>> Â Â Â Â Â  struct watch *watch;
>> @@ -218,12 +219,14 @@ int do_watch(const void *ctx, struct connection 
>> *conn, struct buffered_data *in)
>> Â  {
>> Â Â Â Â Â  struct watch *watch;
>> Â Â Â Â Â  char *vec[2];
>> +Â Â Â  const char *path;
>> Â Â Â Â Â  bool relative;
>> Â Â Â Â Â  if (get_strings(in, vec, ARRAY_SIZE(vec)) != ARRAY_SIZE(vec))
>> Â Â Â Â Â Â Â Â Â  return EINVAL;
>> -Â Â Â  errno = check_watch_path(conn, ctx, &(vec[0]), &relative);
>> +Â Â Â  path = vec[0];
>> +Â Â Â  errno = check_watch_path(conn, ctx, &path, &relative);
> 
>  From my understanding, check_watch_path() could update vec[0] which is 
> then used below. But with your change, vec[0] would not be updated anymore.
> 
> I can see two possible approach:
>  Â Â  1) get_strings() is taking a const as well

I have a patch doing this. I will send it on Monday.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 16:54:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 16:54:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568053.887466 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNFsN-0006vh-Sx; Sat, 22 Jul 2023 16:54:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568053.887466; Sat, 22 Jul 2023 16:54:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNFsN-0006va-QE; Sat, 22 Jul 2023 16:54:39 +0000
Received: by outflank-mailman (input) for mailman id 568053;
 Sat, 22 Jul 2023 16:54:39 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qNFsN-0006vU-0x
 for xen-devel@lists.xenproject.org; Sat, 22 Jul 2023 16:54:39 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNFsL-00053k-Tk; Sat, 22 Jul 2023 16:54:37 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNFsL-0004LP-OZ; Sat, 22 Jul 2023 16:54:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:Subject:
	From:References:Cc:To:MIME-Version:Date:Message-ID;
	bh=WIHvDqxK/w00YG+2bUk5WuMFEudgY1zy7MAi+Wsv/cY=; b=UtlkEWeLeOkPOThyudz+F0zbTT
	66uGkZZe5fgVBz/XYy6NkQ8RrLLUV4kBDBa5YxNcG0OMYM7CXlI0wHFP06EkKNld/oTHLz3yBwRWB
	9MXyRW37oFMUOhy2FlsWT2dxq9B1v+vjOayNMm7QinqajVJ+fP9tS1upxpIndPih2RmQ=;
Message-ID: <7604c148-47c5-ce67-d691-4f642b1876a9@xen.org>
Date: Sat, 22 Jul 2023 17:54:36 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230722081646.4136-1-jgross@suse.com>
From: Julien Grall <julien@xen.org>
Subject: Re: [PATCH v2 0/2] tools/xenstore: fix get_spec_node()
In-Reply-To: <20230722081646.4136-1-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 22/07/2023 09:16, Juergen Gross wrote:
> Small series to fix a bug in get_spec_node().
> 
> Patch 1 is turning several function parameters into const in order to
> avoid having to cast away the const attribute in get_spec_node().
> 
> Patch 2 is the fix, which is a backport candidate.
> 
> Alternatives to this series would be:
> 
> - merge the patches into one patch and backport that

AFAIU, this would have the same outcome as applying the two patches but 
it would circumvent the "we don't backport clean-up to stable tree" and 
lose the history.

> - swap the sequence of the patches in order to have less code churn
>    when backporting, but re-adding the cast from const to non-cont,
>    while backporting only the fix

I am not sure I understand this. If you swap the patch, wouldn't the 
const-away cast be needed to compile and allow bisection?

> - leave the series as is and backport both patches

I am split. On one hand, it would be good to harden older Xenstored, on 
the other hand this is not strictly necessary to fix it. So possibly not 
a good option compare to the others.

> - leave the series as is and use V1 of patch 2 for the backpor
It would be my preference. But I would also be happy with swapping patch 
#1 and patch #2 if there is a desire to have a clean cherry-pick.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 17:39:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 17:39:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568066.887478 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNGZp-0002yp-VR; Sat, 22 Jul 2023 17:39:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568066.887478; Sat, 22 Jul 2023 17:39:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNGZp-0002yi-QY; Sat, 22 Jul 2023 17:39:33 +0000
Received: by outflank-mailman (input) for mailman id 568066;
 Sat, 22 Jul 2023 17:39:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNGZo-0002yY-NR; Sat, 22 Jul 2023 17:39:32 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNGZo-0005yV-Fi; Sat, 22 Jul 2023 17:39:32 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNGZo-0001Ez-0p; Sat, 22 Jul 2023 17:39:32 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qNGZn-0002T2-WC; Sat, 22 Jul 2023 17:39:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ygfA1uKzyYENDBYoStXQMTql/fkrWBqqAtRa7PFB0IY=; b=BDMcFHvvpYxPqVMemf3eAgALYv
	MLdkAzZ2rfshXWFLlulvMjei54qqZD+aM6f6MgT0BK8GAjseyX/1GxAwjCsagtn8x/Odhhfk5LDkU
	OYmvsqPtIrzyGD6HRmLbQ5LzR0xVfw4+uj3POwM0TQBckhbrpoJO3ommJ6eyiZQuLyFI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181963-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-upstream-unstable test] 181963: regressions - FAIL
X-Osstest-Failures:
    qemu-upstream-unstable:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:regression
    qemu-upstream-unstable:test-amd64-amd64-dom0pvh-xl-amd:guest-start:fail:nonblocking
    qemu-upstream-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-upstream-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-upstream-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-upstream-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-upstream-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-upstream-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    qemu-upstream-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=698407ef8395521a9a5b15ed9cd0b7e1fc258ded
X-Osstest-Versions-That:
    qemuu=8c51cd970509b97d8378d175646ec32889828158
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 22 Jul 2023 17:39:31 +0000

flight 181963 qemu-upstream-unstable real [real]
flight 181973 qemu-upstream-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181963/
http://logs.test-lab.xenproject.org/osstest/logs/181973/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail REGR. vs. 180030

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-dom0pvh-xl-amd 14 guest-start                fail like 180030
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 180030
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 180030
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180030
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180030
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180030
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt   16 saverestore-support-check fail starved in 180030
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check fail starved in 180030
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail starved in 180030

version targeted for testing:
 qemuu                698407ef8395521a9a5b15ed9cd0b7e1fc258ded
baseline version:
 qemuu                8c51cd970509b97d8378d175646ec32889828158

Last test of basis   180030  2023-03-27 14:09:05 Z  117 days
Testing same since   181963  2023-07-21 15:11:10 Z    1 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Akihiko Odaki <akihiko.odaki@daynix.com>
  Albert Esteve <aesteve@redhat.com>
  Alex BennÃ©e <alex.bennee@linaro.org>
  Alexander Bulekov <alxndr@bu.edu>
  Alistair Francis <alistair.francis@wdc.com>
  Anastasia Belova <abelova@astralinux.ru>
  Ani Sinha <anisinha@redhat.com>
  Anthony PERARD <anthony.perard@citrix.com>
  Anton Johansson <anjo@rev.ng>
  Ard Biesheuvel <ardb@kernel.org>
  Bernhard Beschow <shentey@gmail.com>
  Bin Meng <bin.meng@windriver.com>
  Carlos LÃ³pez <clopez@suse.de>
  Chenyi Qiang <chenyi.qiang@intel.com>
  Christian Schoenebeck <qemu_oss@crudebyte.com>
  Chuck Zmudzinski <brchuckz@aol.com>
  ClÃ©ment Chigot <chigot@adacore.com>
  CÃ©dric Le Goater <clg@kaod.org>
  CÃ©dric Le Goater <clg@redhat.com>
  Daniel Bertalan <dani@danielbertalan.dev>
  Daniel Henrique Barboza <danielhb413@gmail.com>
  Daniel P. BerrangÃ© <berrange@redhat.com>
  Daniil Kovalev <dkovalev@compiler-toolchain-for.me>
  David Daney <david.daney@fungible.com>
  David Hildenbrand <david@redhat.com>
  Dongwon Kim <dongwon.kim@intel.com>
  Dov Murik <dovmurik@linux.ibm.com>
  Dr. David Alan Gilbert &lt;<a href="mailto:dgilbert@redhat.com" target="_blank">dgilbert@redhat.com</a>&gt;<br>
  Dr. David Alan Gilbert <dgilbert@redhat.com>
  Eric Blake <eblake@redhat.com>
  Erico Nunes <ernunes@redhat.com>
  Eugenio PÃ©rez <eperezma@redhat.com>
  Evgeny Iakovlev <eiakovlev@linux.microsoft.com>
  Fiona Ebner <f.ebner@proxmox.com>
  Francisco Iglesias <frasse.iglesias@gmail.com>
  Gerd Hoffmann <kraxel@redhat.com>
  Greg Kurz <groug@kaod.org>
  Guenter Roeck <linux@roeck-us.net>
  Hawkins Jiawei <yin31149@gmail.com>
  Helge Deller <deller@gmx.de>
  Igor Mammedov <imammedo@redhat.com>
  Ilya Leoshkevich <iii@linux.ibm.com>
  Jagannathan Raman <jag.raman@oracle.com>
  Jason Andryuk <jandryuk@gmail.com>
  Jason Wang <jasowang@redhat.com>
  Jiri Pirko <jiri@nvidia.com>
  Juan Quintela <quintela@redhat.com>
  Julia Suvorova <jusual@redhat.com>
  Kevin Wolf <kwolf@redhat.com>
  Klaus Jensen <k.jensen@samsung.com>
  Konstantin Kostiuk <kkostiuk@redhat.com>
  Kostiantyn Kostiuk <kostyanf14@live.com>
  Laszlo Ersek <lersek@redhat.com>
  Laurent Vivier <laurent@vivier.eu>
  Laurent Vivier <lvivier@redhat.com>
  Lei Yang <leiyang@redhat.com>
  LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
  Lukas Straub <lukasstraub2@web.de>
  Lukas Tschoke <lukts330@gmail.com>
  Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
  Mark Somerville <mark@qpok.net>
  Markus Armbruster <armbru@redhat.com>
  Mathis Marion <mathis.marion@silabs.com>
  Mattias Nissler <mnissler@rivosinc.com>
  Mauro Matteo Cascella <mcascell@redhat.com>
  Maxime Coquelin <maxime.coquelin@redhat.com>
  Michael S. Tsirkin <mst@redhat.com>
  Michael Tokarev <mjt@tls.msk.ru>
  Nathan Chancellor <nathan@kernel.org>
  Nicholas Piggin <npiggin@gmail.com>
  Nina Schoetterl-Glausch <nsg@linux.ibm.com>
  Paolo Bonzini <pbonzini@redhat.com>
  Peter Maydell <peter.maydell@linaro.org>
  Peter Xu <peterx@redhat.com>
  Philippe Mathieu-DaudÃ© <philmd@linaro.org>
  Pierrick Bouvier <pierrick.bouvier@linaro.org>
  Prasad Pandit <pjp@fedoraproject.org>
  Richard Henderson <richard.henderson@linaro.org>
  Ryan Wendland <wendland@live.com.au>
  Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
  Shivaprasad G Bhat <sbhat@linux.ibm.com>
  Stefan Hajnoczi <stefanha@redhat.com>
  Tested-By: Solra Bizna <solra@bizna.name>
  Thomas Huth <thuth@redhat.com>
  timothee.cocault@gmail.com <timothee.cocault@gmail.com>
  TimothÃ©e Cocault <timothee.cocault@gmail.com>
  Tommy Wu <tommy.wu@sifive.com>
  Vaibhav Jain <vaibhav@linux.ibm.com>
  Viktor Prutyanov <viktor@daynix.com>
  Vivek Kasireddy <vivek.kasireddy@intel.com>
  Volker RÃ¼melin <vr_qemu@t-online.de>
  Wang Liang <wangliangzz@inspur.com>
  Xinyu Li <lixinyu20s@ict.ac.cn>
  Yajun Wu <yajunw@nvidia.com>
  Yang Zhong <yang.zhong@linux.intel.com>
  Yin Wang <yin.wang@intel.com>
  Yuval Shaia <yuval.shaia.ml@gmail.com>
  Zhenzhong Duan <zhenzhong.duan@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 4562 lines long.)


From xen-devel-bounces@lists.xenproject.org Sat Jul 22 21:40:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Jul 2023 21:40:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568094.887502 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNKKo-0002Mb-3Y; Sat, 22 Jul 2023 21:40:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568094.887502; Sat, 22 Jul 2023 21:40:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNKKo-0002MU-0A; Sat, 22 Jul 2023 21:40:18 +0000
Received: by outflank-mailman (input) for mailman id 568094;
 Sat, 22 Jul 2023 21:40:17 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNKKm-0002MK-Uy; Sat, 22 Jul 2023 21:40:16 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNKKm-0003GC-P6; Sat, 22 Jul 2023 21:40:16 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNKKm-0000y3-7Q; Sat, 22 Jul 2023 21:40:16 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qNKKm-0001jE-6n; Sat, 22 Jul 2023 21:40:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=vCCboPs5pCfyNW2877o9jnu0wH80JRrQGischULcNH4=; b=R/Vgsr8JIbBE/w3sOAMcy0DuOw
	Gy12hosV89fCQms0QS9i1ajXNkVrhs4CwmeOicOpHaMQuXwo4OUKeTuJCQfq+r4ETjRvVbG8X8u7K
	lvU2KRi1O0IPFJycIdTqyrUCZdPiy1nz4t17LwVH5Djkhz0VB6DeCeWyITUi1Hvi6MwI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181966-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 181966: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=6c3ef66cc6d60d35e86206fd7b78178c4d0cbb88
X-Osstest-Versions-That:
    libvirt=033c4fcddffd7aaffd0cc7769043d6bdf9f983aa
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 22 Jul 2023 21:40:16 +0000

flight 181966 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181966/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail blocked in 181943
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181943
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181943
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 libvirt              6c3ef66cc6d60d35e86206fd7b78178c4d0cbb88
baseline version:
 libvirt              033c4fcddffd7aaffd0cc7769043d6bdf9f983aa

Last test of basis   181943  2023-07-21 04:18:50 Z    1 days
Testing same since   181966  2023-07-22 04:21:55 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  GÃ¶ran Uddeborg <goeran@uddeborg.se>
  Han Han <hhan@redhat.com>
  Michal Privoznik <mprivozn@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   033c4fcddf..6c3ef66cc6  6c3ef66cc6d60d35e86206fd7b78178c4d0cbb88 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sun Jul 23 00:07:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 23 Jul 2023 00:07:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568115.887520 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNMcq-00009t-PC; Sun, 23 Jul 2023 00:07:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568115.887520; Sun, 23 Jul 2023 00:07:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNMcq-00009k-Mh; Sun, 23 Jul 2023 00:07:04 +0000
Received: by outflank-mailman (input) for mailman id 568115;
 Sun, 23 Jul 2023 00:07:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=CZhb=DJ=kernel.org=nathan@srs-se1.protection.inumbo.net>)
 id 1qNMcp-00009c-Ej
 for xen-devel@lists.xenproject.org; Sun, 23 Jul 2023 00:07:03 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d8a4717a-28ec-11ee-b23a-6b7b168915f2;
 Sun, 23 Jul 2023 02:07:01 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 3DE4260BCC;
 Sun, 23 Jul 2023 00:07:00 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE215C433C8;
 Sun, 23 Jul 2023 00:06:58 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d8a4717a-28ec-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690070819;
	bh=lqNI3FthrxzR4UIE2SkVJyrmDez/g/Je8RwOANooSwU=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=gBAq2jfyXsJdxFNkJpod2uhwIgYgwTT4+ob/wsHXtF5u/9cikSXGr4pMbXt4O5fYE
	 XMoImsj73V4v/j0Qq9JrRiXgXpawyyHeBet6sEGQ+bZC7RhTmO7gCduFnmzFX8G58/
	 Ujp1L1Y7QdMGzhx2nuukUGng//TXW7bfLFHuVN2N/nLC317aen7UuETWRCOJsGmp+c
	 9HJeIou4jyBxbmGjLhw7Ts4t9u8eQfAeNRC/JNv2k+kz8GGbzDJnBxIwpg1pBU2aB/
	 q6VZ7LuskT7B1134vM/CbGPXqwJixp2v+AabulVJotgvWxBGqgTi4aRoBuPOvkCJl6
	 DQEiyUPSAqthw==
Date: Sat, 22 Jul 2023 17:06:57 -0700
From: Nathan Chancellor <nathan@kernel.org>
To: Bagas Sanjaya <bagasdotme@gmail.com>
Cc: Juergen Gross <jgross@suse.com>, Jan Beulich <jbeulich@suse.com>,
	"David S. Miller" <davem@davemloft.net>,
	sander44 <ionut_n2001@yahoo.com>,
	Linux Xen <xen-devel@lists.xenproject.org>,
	Linux BPF <bpf@vger.kernel.org>,
	Linux Networking <netdev@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Regressions <regressions@lists.linux.dev>,
	keescook@chromium.org, gustavoars@kernel.org
Subject: Re: Fwd: UBSAN: index 1 is out of range for type
 'xen_netif_rx_sring_entry [1]'
Message-ID: <20230723000657.GA878540@dev-arch.thelio-3990X>
References: <7e3841ce-011d-5ba6-9dae-7b14e07b5c4b@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <7e3841ce-011d-5ba6-9dae-7b14e07b5c4b@gmail.com>

On Sat, Jul 22, 2023 at 07:21:05AM +0700, Bagas Sanjaya wrote:
> Hi,
> 
> I notice a regression report on Bugzilla [1]. Quoting from it:
> 
> > Hi Kernel Team,
> > 
> > I rebuild today latest version from mainline repo.
> > And i notice issue regarding xen-netfront.c.
> > 
> > Error:
> > [    3.477400] ================================================================================
> > [    3.477633] UBSAN: array-index-out-of-bounds in drivers/net/xen-netfront.c:1291:3
> > [    3.477858] index 1 is out of range for type 'xen_netif_rx_sring_entry [1]'
> > [    3.478085] CPU: 0 PID: 700 Comm: NetworkManager Not tainted 6.5.0-rc2-1-generation1 #3
> > [    3.478088] Hardware name: Intel Corporation W2600CR/W2600CR, BIOS SE5C600.86B.02.06.0007.082420181029 01/13/2022
> > [    3.478090] Call Trace:
> > [    3.478092]  <IRQ>
> > [    3.478097]  dump_stack_lvl+0x48/0x70
> > [    3.478105]  dump_stack+0x10/0x20
> > [    3.478107]  __ubsan_handle_out_of_bounds+0xc6/0x110
> > [    3.478114]  xennet_poll+0xa94/0xac0
> > [    3.478118]  ? generic_smp_call_function_single_interrupt+0x13/0x20
> > [    3.478125]  __napi_poll+0x33/0x200
> > [    3.478131]  net_rx_action+0x181/0x2e0
> > [    3.478135]  __do_softirq+0xd9/0x346
> > [    3.478139]  do_softirq.part.0+0x41/0x80
> > [    3.478144]  </IRQ>
> > [    3.478145]  <TASK>
> > [    3.478146]  __local_bh_enable_ip+0x72/0x80
> > [    3.478149]  _raw_spin_unlock_bh+0x1d/0x30
> > [    3.478151]  xennet_open+0x75/0x160
> > [    3.478154]  __dev_open+0x105/0x1d0
> > [    3.478156]  __dev_change_flags+0x1b5/0x230
> > [    3.478158]  dev_change_flags+0x27/0x80
> > [    3.478160]  do_setlink+0x3d2/0x12b0
> > [    3.478164]  ? __nla_validate_parse+0x5b/0xdb0
> > [    3.478169]  __rtnl_newlink+0x6f6/0xb10
> > [    3.478173]  ? rtnl_newlink+0x2f/0x80
> > [    3.478177]  rtnl_newlink+0x48/0x80
> > [    3.478180]  rtnetlink_rcv_msg+0x170/0x430
> > [    3.478183]  ? fib6_clean_node+0xad/0x190
> > [    3.478188]  ? __pfx_rtnetlink_rcv_msg+0x10/0x10
> > [    3.478191]  netlink_rcv_skb+0x5d/0x110
> > [    3.478195]  rtnetlink_rcv+0x15/0x30
> > [    3.478198]  netlink_unicast+0x247/0x390
> > [    3.478200]  netlink_sendmsg+0x25e/0x4e0
> > [    3.478202]  sock_sendmsg+0xaf/0xc0
> > [    3.478204]  ____sys_sendmsg+0x2a9/0x350
> > [    3.478206]  ___sys_sendmsg+0x9a/0xf0
> > [    3.478212]  ? _copy_from_iter+0x80/0x4a0
> > [    3.478217]  __sys_sendmsg+0x89/0xf0
> > [    3.478220]  __x64_sys_sendmsg+0x1d/0x30
> > [    3.478222]  do_syscall_64+0x5c/0x90
> > [    3.478226]  ? do_syscall_64+0x68/0x90
> > [    3.478228]  ? ksys_write+0xe6/0x100
> > [    3.478232]  ? exit_to_user_mode_prepare+0x49/0x220
> > [    3.478236]  ? syscall_exit_to_user_mode+0x1b/0x50
> > [    3.478240]  ? do_syscall_64+0x68/0x90
> > [    3.478242]  ? do_syscall_64+0x68/0x90
> > [    3.478243]  ? irqentry_exit_to_user_mode+0x9/0x30
> > [    3.478246]  ? irqentry_exit+0x43/0x50
> > [    3.478248]  ? sysvec_xen_hvm_callback+0x4b/0xd0
> > [    3.478250]  entry_SYSCALL_64_after_hwframe+0x6e/0xd8
> > [    3.478253] RIP: 0033:0x7f973c244e4d
> > [    3.478268] Code: 28 89 54 24 1c 48 89 74 24 10 89 7c 24 08 e8 ca ee ff ff 8b 54 24 1c 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 33 44 89 c7 48 89 44 24 08 e8 fe ee ff ff 48
> > [    3.478270] RSP: 002b:00007fff4777f470 EFLAGS: 00000293 ORIG_RAX: 000000000000002e
> > [    3.478273] RAX: ffffffffffffffda RBX: 00005583087c6480 RCX: 00007f973c244e4d
> > [    3.478274] RDX: 0000000000000000 RSI: 00007fff4777f4c0 RDI: 000000000000000c
> > [    3.478276] RBP: 00007fff4777f4c0 R08: 0000000000000000 R09: 0000000000000000
> > [    3.478277] R10: 0000000000000000 R11: 0000000000000293 R12: 00005583087c6480
> > [    3.478279] R13: 00007fff4777f668 R14: 00007fff4777f65c R15: 0000000000000000
> > [    3.478283]  </TASK>
> > [    3.478284] ================================================================================
> > [    3.685513] ================================================================================
> > [    3.685751] UBSAN: array-index-out-of-bounds in drivers/net/xen-netfront.c:485:7
> > [    3.686111] index 1 is out of range for type 'xen_netif_tx_sring_entry [1]'
> > [    3.686379] CPU: 1 PID: 697 Comm: avahi-daemon Not tainted 6.5.0-rc2-1-generation1 #3
> > [    3.686381] Hardware name: Intel Corporation W2600CR/W2600CR, BIOS SE5C600.86B.02.06.0007.082420181029 01/13/2022
> > [    3.686385] Call Trace:
> > [    3.686388]  <TASK>
> > [    3.686391]  dump_stack_lvl+0x48/0x70
> > [    3.686399]  dump_stack+0x10/0x20
> > [    3.686399]  __ubsan_handle_out_of_bounds+0xc6/0x110
> > [    3.686403]  xennet_tx_setup_grant+0x1f7/0x230
> > [    3.686403]  ? __pfx_xennet_tx_setup_grant+0x10/0x10
> > [    3.686403]  gnttab_foreach_grant_in_range+0x5c/0x100
> > [    3.686415]  xennet_start_xmit+0x428/0x990
> > [    3.686415]  ? kmem_cache_alloc_node+0x1b1/0x3b0
> > [    3.686415]  dev_hard_start_xmit+0x68/0x1e0
> > [    3.686415]  sch_direct_xmit+0x10b/0x350
> > [    3.686415]  __dev_queue_xmit+0x512/0xda0
> > [    3.686439]  ? ___neigh_create+0x6cb/0x970
> > [    3.686439]  neigh_resolve_output+0x118/0x1e0
> > [    3.686446]  ip_finish_output2+0x181/0x540
> > [    3.686450]  ? netif_rx_internal+0x46/0x140
> > [    3.686456]  __ip_finish_output+0xb6/0x180
> > [    3.686456]  ? dev_loopback_xmit+0x86/0x110
> > [    3.686456]  ip_finish_output+0x29/0x100
> > [    3.686456]  ip_mc_output+0x95/0x2e0
> > [    3.686456]  ? __pfx_ip_finish_output+0x10/0x10
> > [    3.686456]  ip_send_skb+0x9f/0xb0
> > [    3.686456]  udp_send_skb+0x158/0x380
> > [    3.686475]  udp_sendmsg+0xb84/0xf20
> > [    3.686475]  ? do_sys_poll+0x3a1/0x5f0
> > [    3.686483]  ? __pfx_ip_generic_getfrag+0x10/0x10
> > [    3.686483]  inet_sendmsg+0x76/0x80
> > [    3.686483]  ? inet_sendmsg+0x76/0x80
> > [    3.686483]  sock_sendmsg+0xa8/0xc0
> > [    3.686483]  ? _copy_from_user+0x30/0xa0
> > [    3.686483]  ____sys_sendmsg+0x2a9/0x350
> > [    3.686483]  ___sys_sendmsg+0x9a/0xf0
> > [    3.686483]  __sys_sendmsg+0x89/0xf0
> > [    3.686483]  __x64_sys_sendmsg+0x1d/0x30
> > [    3.686483]  do_syscall_64+0x5c/0x90
> > [    3.686483]  ? exit_to_user_mode_prepare+0x49/0x220
> > [    3.686483]  ? syscall_exit_to_user_mode+0x1b/0x50
> > [    3.686483]  ? do_syscall_64+0x68/0x90
> > [    3.686483]  ? syscall_exit_to_user_mode+0x1b/0x50
> > [    3.686483]  ? do_syscall_64+0x68/0x90
> > [    3.686483]  entry_SYSCALL_64_after_hwframe+0x6e/0xd8
> > [    3.686483] RIP: 0033:0x7ff365942e13
> > [    3.686483] Code: 8b 15 b9 a1 00 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b8 0f 1f 00 64 8b 04 25 18 00 00 00 85 c0 75 14 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 55 c3 0f 1f 40 00 48 83 ec 28 89 54 24 1c 48
> > [    3.686483] RSP: 002b:00007ffc7bf1ca78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
> > [    3.686483] RAX: ffffffffffffffda RBX: 00005596bd24c900 RCX: 00007ff365942e13
> > [    3.686483] RDX: 0000000000000000 RSI: 00007ffc7bf1cb30 RDI: 000000000000000c
> > [    3.686483] RBP: 000000000000000c R08: 0000000000000004 R09: 0000000000000019
> > [    3.686483] R10: 00007ff365a1ca94 R11: 0000000000000246 R12: 00007ffc7bf1cb30
> > [    3.686483] R13: 0000000000000002 R14: 00005596bd235f9c R15: 0000000000000000
> > [    3.686483]  </TASK>
> > [    3.686483] ================================================================================
> > [    3.686858] ================================================================================
> > [    3.687190] UBSAN: array-index-out-of-bounds in drivers/net/xen-netfront.c:413:4
> > [    3.687501] index 1 is out of range for type 'xen_netif_tx_sring_entry [1]'
> > [    3.687800] CPU: 18 PID: 0 Comm: swapper/18 Not tainted 6.5.0-rc2-1-generation1 #3
> > [    3.687804] Hardware name: Intel Corporation W2600CR/W2600CR, BIOS SE5C600.86B.02.06.0007.082420181029 01/13/2022
> > [    3.687806] Call Trace:
> > [    3.687808]  <IRQ>
> > [    3.687812]  dump_stack_lvl+0x48/0x70
> > [    3.687819]  dump_stack+0x10/0x20
> > [    3.687821]  __ubsan_handle_out_of_bounds+0xc6/0x110
> > [    3.687827]  xennet_tx_buf_gc+0x34a/0x440
> > [    3.687831]  xennet_handle_tx.constprop.0+0x49/0x90
> > [    3.687834]  xennet_tx_interrupt+0x32/0x70
> > [    3.687837]  __handle_irq_event_percpu+0x4f/0x1b0
> > [    3.687842]  handle_irq_event+0x39/0x80
> > [    3.687846]  handle_edge_irq+0x8c/0x230
> > [    3.687849]  handle_irq_desc+0x40/0x60
> > [    3.687851]  generic_handle_irq+0x1f/0x30
> > [    3.687854]  handle_irq_for_port+0x8e/0x180
> > [    3.687858]  ? _raw_spin_unlock_irqrestore+0x11/0x60
> > [    3.687861]  __evtchn_fifo_handle_events+0x221/0x330
> > [    3.687866]  evtchn_fifo_handle_events+0xe/0x20
> > [    3.687869]  __xen_evtchn_do_upcall+0x72/0xd0
> > [    3.687873]  xen_hvm_evtchn_do_upcall+0xe/0x20
> > [    3.687876]  __sysvec_xen_hvm_callback+0x53/0x70
> > [    3.687880]  sysvec_xen_hvm_callback+0x8d/0xd0
> > [    3.687884]  </IRQ>
> > [    3.687885]  <TASK>
> > [    3.687886]  asm_sysvec_xen_hvm_callback+0x1b/0x20
> > [    3.687891] RIP: 0010:pv_native_safe_halt+0xb/0x10
> > [    3.687896] Code: 0b 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 eb 07 0f 00 2d 49 cc 33 00 fb f4 <c3> cc cc cc cc 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 55
> > [    3.687898] RSP: 0000:ffffad85c0147e08 EFLAGS: 00000246
> > [    3.687901] RAX: ffffffffa00d39a0 RBX: 0000000000000002 RCX: 0000000000000000
> > [    3.687902] RDX: 0000000000000002 RSI: ffffffffa14d28e0 RDI: ffff920446abda00
> > [    3.687904] RBP: ffffad85c0147e18 R08: 0000000000000000 R09: 0000000000000000
> > [    3.687905] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000002
> > [    3.687906] R13: 0000000000000002 R14: 0000000000000002 R15: ffffffffa14d29c8
> > [    3.687909]  ? __pfx_intel_idle_hlt+0x10/0x10
> > [    3.687913]  ? intel_idle_hlt+0xc/0x40
> > [    3.687916]  cpuidle_enter_state+0xa0/0x730
> > [    3.687920]  cpuidle_enter+0x2e/0x50
> > [    3.687924]  call_cpuidle+0x23/0x60
> > [    3.687928]  do_idle+0x207/0x260
> > [    3.687932]  cpu_startup_entry+0x1d/0x20
> > [    3.687934]  start_secondary+0x129/0x160
> > [    3.687939]  secondary_startup_64_no_verify+0x17e/0x18b
> > [    3.687945]  </TASK>
> > [    3.687946] ================================================================================
> > [    4.624607] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
> > [    4.629153] Bridge firewalling registered
> > [    4.745355] Initializing XFRM netlink socket
> > [    4.794107] loop8: detected capacity change from 0 to 8
> > [    7.104544] rfkill: input handler disabled
> > [   26.445163] ================================================================================
> > [   26.445171] UBSAN: array-index-out-of-bounds in drivers/net/xen-netfront.c:807:4
> > [   26.445175] index 109 is out of range for type 'xen_netif_tx_sring_entry [1]'
> > [   26.445178] CPU: 8 PID: 1729 Comm: sshd Not tainted 6.5.0-rc2-1-generation1 #3
> > [   26.445180] Hardware name: Intel Corporation W2600CR/W2600CR, BIOS SE5C600.86B.02.06.0007.082420181029 01/13/2022
> > [   26.445181] Call Trace:
> > [   26.445185]  <TASK>
> > [   26.445185]  dump_stack_lvl+0x48/0x70
> > [   26.445185]  dump_stack+0x10/0x20
> > [   26.445200]  __ubsan_handle_out_of_bounds+0xc6/0x110
> > [   26.445206]  xennet_start_xmit+0x932/0x990
> > [   26.445211]  dev_hard_start_xmit+0x68/0x1e0
> > [   26.445216]  sch_direct_xmit+0x10b/0x350
> > [   26.445220]  __dev_queue_xmit+0x512/0xda0
> > [   26.445224]  ip_finish_output2+0x261/0x540
> > [   26.445225]  __ip_finish_output+0xb6/0x180
> > [   26.445225]  ip_finish_output+0x29/0x100
> > [   26.445234]  ip_output+0x73/0x120
> > [   26.445234]  ? __pfx_ip_finish_output+0x10/0x10
> > [   26.445238]  ip_local_out+0x61/0x70
> > [   26.445238]  __ip_queue_xmit+0x18d/0x470
> > [   26.445238]  ip_queue_xmit+0x15/0x30
> > [   26.445238]  __tcp_transmit_skb+0xb39/0xcc0
> > [   26.445238]  tcp_write_xmit+0x595/0x1570
> > [   26.445238]  ? _copy_from_iter+0x80/0x4a0
> > [   26.445256]  __tcp_push_pending_frames+0x37/0x110
> > [   26.445259]  tcp_push+0x123/0x190
> > [   26.445260]  tcp_sendmsg_locked+0xafe/0xed0
> > [   26.445264]  tcp_sendmsg+0x2c/0x50
> > [   26.445268]  inet_sendmsg+0x42/0x80
> > [   26.445268]  sock_write_iter+0x160/0x180
> > [   26.445274]  vfs_write+0x397/0x440
> > [   26.445274]  ksys_write+0xc9/0x100
> > [   26.445274]  __x64_sys_write+0x19/0x30
> > [   26.445274]  do_syscall_64+0x5c/0x90
> > [   26.445287]  ? syscall_exit_to_user_mode+0x1b/0x50
> > [   26.445290]  ? do_syscall_64+0x68/0x90
> > [   26.445290]  ? do_syscall_64+0x68/0x90
> > [   26.445294]  ? do_syscall_64+0x68/0x90
> > [   26.445294]  ? syscall_exit_to_user_mode+0x1b/0x50
> > [   26.445298]  ? do_syscall_64+0x68/0x90
> > [   26.445300]  ? exc_page_fault+0x94/0x1b0
> > [   26.445302]  entry_SYSCALL_64_after_hwframe+0x6e/0xd8
> > [   26.445306] RIP: 0033:0x7f26c4c3d473
> > [   26.445318] Code: 8b 15 21 2a 0e 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 64 8b 04 25 18 00 00 00 85 c0 75 14 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 55 c3 0f 1f 40 00 48 83 ec 28 48 89 54 24 18
> > [   26.445321] RSP: 002b:00007ffdee7b5528 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
> > [   26.445321] RAX: ffffffffffffffda RBX: 0000000000000700 RCX: 00007f26c4c3d473
> > [   26.445321] RDX: 0000000000000700 RSI: 000055567032e230 RDI: 0000000000000004
> > [   26.445321] RBP: 0000555670313d70 R08: fffffffffffffff0 R09: 0000000000000000
> > [   26.445321] R10: 0000000000000000 R11: 0000000000000246 R12: 000055566fcb2768
> > [   26.445321] R13: 0000000000000000 R14: 0000000000000004 R15: 000055566fc67a80
> > [   26.445332]  </TASK>
> > [   26.445333] ================================================================================
> 
> See Bugzilla for the full thread and attached dmesg.
> 
> Anyway, I'm adding it to regzbot:
> 
> #regzbot introduced: 8446066bf8c1f9f https://bugzilla.kernel.org/show_bug.cgi?id=217693
> 
> Thanks.
> 
> [1]: https://bugzilla.kernel.org/show_bug.cgi?id=217693

I doubt it is 8446066bf8c1f9f that causes this. Based on the comment
next to the 'ring[1]' in DEFINE_RING_TYPES() in
include/xen/interface/io/ring.h, this is probably caused/exposed by
commit df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") in
6.5-rc1, which causes that array to no longer be a flexible array but an
array with one element, which would cause UBSAN to complain about an
array access past index one. Adding Kees and Gustavo.

Unfortunately, it seems this file is vendored from Xen, so I assume it
would need to be fixed there then pulled into Linux:

https://github.com/xen-project/xen/tree/master/xen/include/public/io/ring.h

Cheers,
Nathan


From xen-devel-bounces@lists.xenproject.org Sun Jul 23 02:38:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 23 Jul 2023 02:38:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568121.887531 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNOyn-0005Ec-0F; Sun, 23 Jul 2023 02:37:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568121.887531; Sun, 23 Jul 2023 02:37:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNOym-0005EU-Rk; Sun, 23 Jul 2023 02:37:52 +0000
Received: by outflank-mailman (input) for mailman id 568121;
 Sun, 23 Jul 2023 02:37:51 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNOyl-0005EK-9n; Sun, 23 Jul 2023 02:37:51 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNOyk-0000xz-TT; Sun, 23 Jul 2023 02:37:50 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNOyk-00017h-G9; Sun, 23 Jul 2023 02:37:50 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qNOyk-0000GB-Fl; Sun, 23 Jul 2023 02:37:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=7hZ4jvVsRn8ifW8e8+/ROJIUUxg9z96ilAp4/6xgn/o=; b=Y/RQJ+qrrWfGkZ098ssjEgEZc9
	N/imtVSBjGYqdLGmGudcpI9Rf2zL3EudKV4G8VRBgIrL0pDJ0SXQQI2AC3Z+g2uIqAhBM5Io6PMQ1
	AVMeHuFe+bsbbl2qzcTJ4Go9jH0+UeS3kt4uo/36icVBKlGsH8SXC3xTQ6OVSIeFfBFk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181968-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181968: regressions - FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-qemuu-rhel6hvm-amd:xen-install:fail:regression
    xen-unstable:test-amd64-amd64-dom0pvh-xl-amd:guest-localmigrate/x10:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=0c53c638e16278078371ce028c74693841d7738a
X-Osstest-Versions-That:
    xen=4bf014c6f7d7cc9a9e017cef0eb5ff4bf27526e9
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 23 Jul 2023 02:37:50 +0000

flight 181968 xen-unstable real [real]
flight 181979 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181968/
http://logs.test-lab.xenproject.org/osstest/logs/181979/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-qemuu-rhel6hvm-amd  7 xen-install        fail REGR. vs. 181927

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-dom0pvh-xl-amd 20 guest-localmigrate/x10 fail pass in 181979-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181927
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181927
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181927
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181927
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181927
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181927
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181927
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181927
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181927
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181927
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181927
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181927
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 xen                  0c53c638e16278078371ce028c74693841d7738a
baseline version:
 xen                  4bf014c6f7d7cc9a9e017cef0eb5ff4bf27526e9

Last test of basis   181927  2023-07-20 13:41:22 Z    2 days
Failing since        181953  2023-07-21 10:42:59 Z    1 days    2 attempts
Testing same since   181968  2023-07-22 06:13:00 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Federico Serafini <federico.serafini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Jens Wiklander <jens.wiklander@linaro.org>
  Juergen Gross <jgross@suse.com>
  Julien Grall <jgrall@amazon.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-dom0pvh-xl-amd                              fail    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 0c53c638e16278078371ce028c74693841d7738a
Author: Juergen Gross <jgross@suse.com>
Date:   Fri Jul 21 08:32:43 2023 +0200

    tools/xenstore: fix XSA-417 patch
    
    The fix for XSA-417 had a bug: domain_alloc_permrefs() will not return
    a negative value in case of an error, but a plain errno value.
    
    Note this is not considered to be a security issue, as the only case
    where domain_alloc_permrefs() will return an error is a failed memory
    allocation. As a guest should not be able to drive Xenstore out of
    memory, this is NOT a problem a guest can trigger at will.
    
    Fixes: ab128218225d ("tools/xenstore: fix checking node permissions")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>

commit 65fc6d8c92bc339d8ed874c5821e0e65101f6c52
Author: Federico Serafini <federico.serafini@bugseng.com>
Date:   Fri Jul 21 08:32:15 2023 +0200

    x86/mtrr: address violations of MISRA C:2012 Rule 8.3 on parameter types
    
    Change parameter types of function declarations to be consistent with
    the ones used in the corresponding definitions,
    thus addressing violations of MISRA C:2012 Rule 8.3 ("All declarations
    of an object or function shall use the same names and type qualifiers").
    
    No functional changes.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

commit 652d8fbb8182f0b9a57ba371c24d21e0a981ee07
Author: Federico Serafini <federico.serafini@bugseng.com>
Date:   Fri Jul 21 08:31:42 2023 +0200

    x86/HVM: address violations of MISRA C:2012 Rules 8.2 and 8.3
    
    Give a name to unnamed parameters thus addressing violations of
    MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
    named parameters").
    Keep consistency between parameter names and types used in function
    declarations and the ones used in the corresponding function
    definitions, thus addressing violations of MISRA C:2012 Rule 8.3
    ("All declarations of an object or function shall use the same names
    and type qualifiers").
    
    No functional changes.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>

commit 60576722d0523122ce34c81b91fd1eafac8f7f5f
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri Jul 21 08:31:09 2023 +0200

    x86/vRTC: move and tidy convert_hour() and {to,from}_bcd()
    
    This is to avoid the need for forward declarations, which in turn
    addresses a violation of MISRA C:2012 Rule 8.3 ("All declarations of an
    object or function shall use the same names and type qualifiers").
    
    While doing so,
    - drop inline (leaving the decision to the compiler),
    - add const,
    - add unsigned,
    - correct style.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

commit cd5048353725f37746da231202feaf5b88ceb46a
Author: Nicola Vetrini <nicola.vetrini@bugseng.com>
Date:   Fri Jul 21 08:30:29 2023 +0200

    xen: address MISRA C:2012 Rule 4.1
    
    MISRA C:2012 Rule 4.1 has the following headline:
    "Octal and hexadecimal escape sequences shall be terminated."
    
    The string literals modified by this patch contain octal or
    hexadecimal escape sequences that are neither terminated by the
    end of the literal, nor by the beginning of another escape sequence.
    
    Therefore, such unterminated sequences have been split into a
    separate literal as a way to comply with the rule and preserve the
    semantics of the code.
    
    No functional changes.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>

commit 1ab2ae1610d99423af5b810829959431e43de12d
Author: Jens Wiklander <jens.wiklander@linaro.org>
Date:   Mon Jul 17 09:20:52 2023 +0200

    xen/arm: ffa: add support for FFA_ID_GET
    
    Adds support for the FF-A function FFA_ID_GET to return the ID of the
    calling client.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

commit 0dacee5cfbf1576b1ea5f44680c92996f7e4175c
Author: Jens Wiklander <jens.wiklander@linaro.org>
Date:   Mon Jul 17 09:20:51 2023 +0200

    xen/arm: ffa: enforce dependency on 4k pages
    
    Adds a BUILD_BUG_ON() to assert the dependency on 4k pages in the FF-A
    mediator since the current implementation only works if Xen page size is
    the same as the FFA page size.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Henry Wang <Henry.Wang@arm.com>

commit 246fdc288e7a4832b8cc93816850b12cf8e4de91
Author: Jens Wiklander <jens.wiklander@linaro.org>
Date:   Mon Jul 17 09:20:50 2023 +0200

    xen/arm: ffa: add defines for framework direct request/response messages
    
    According to DEN0077A version 1.1 REL0, section 18.3, Table 18.{21, 25,
    26, 27, 28}, add defines for framework direct request/response messages.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Henry Wang <Henry.Wang@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

commit aaa416d425213ab37536088783f802df53af26d4
Author: Jens Wiklander <jens.wiklander@linaro.org>
Date:   Mon Jul 17 09:20:49 2023 +0200

    xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET
    
    According to DEN0077A version 1.1 REL0, section 13.8, defines
    flags used for the function FFA_PARTITION_INFO_GET.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Henry Wang <Henry.Wang@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

commit 9b6af1deb273f320e2d1c507aa1cb17f7356f805
Author: Jens Wiklander <jens.wiklander@linaro.org>
Date:   Mon Jul 17 09:20:48 2023 +0200

    xen/arm: ffa: add remaining SMC function IDs
    
    Adds the remaining SMC function IDs from FF-A 1.1 specification,
    DEN0077A version 1.1 REL0.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Henry Wang <Henry.Wang@arm.com>

commit 38846de2176b991704e3062904d0e2fc455b47b9
Author: Jens Wiklander <jens.wiklander@linaro.org>
Date:   Mon Jul 17 09:20:47 2023 +0200

    xen/arm: tee: add a primitive FF-A mediator
    
    Adds a FF-A version 1.1 [1] mediator to communicate with a Secure
    Partition in secure world.
    
    This commit brings in only the parts needed to negotiate FF-A version
    number with guest and SPMC.
    
    [1] https://developer.arm.com/documentation/den0077/e
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    [jgrall: Make Kconfig depends on TEE + Remove kconfig.h include]
    Acked-by: Julien Grall <jgrall@amazon.com>

commit 3069ecdf362eabfef452d8a29218290ba6d84b48
Author: Jens Wiklander <jens.wiklander@linaro.org>
Date:   Mon Jul 17 09:20:46 2023 +0200

    xen/arm: smccc: add support for SMCCCv1.2 extended input/output registers
    
    SMCCC v1.2 [1] AArch64 allows x0-x17 to be used as both parameter
    registers and result registers for the SMC and HVC instructions.
    
    Arm Firmware Framework for Armv8-A specification makes use of x0-x7 as
    parameter and result registers.
    
    Let us add new interface to support this extended set of input/output
    registers.
    
    This is based on 3fdc0cb59d97 ("arm64: smccc: Add support for SMCCCv1.2
    extended input/output registers") by Sudeep Holla from the Linux kernel
    
    The SMCCC version reported to the VM is bumped to 1.2 in order to support
    handling FF-A messages.
    
    [1] https://developer.arm.com/documentation/den0028/c/?lang=en
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>

commit 12e5c93f9d5503e67b106846d69a7c404a2a01d1
Author: Jens Wiklander <jens.wiklander@linaro.org>
Date:   Mon Jul 17 09:20:45 2023 +0200

    xen/arm: add TEE teardown to arch_domain_teardown()
    
    Adds a progress state for tee_domain_teardown() to be called from
    arch_domain_teardown(). tee_domain_teardown() calls the new callback
    domain_teardown() in struct tee_mediator_ops.
    
    Note that the OP-TEE mediator should be updated in a future patch to use
    the new teardown facility, that is not done here.
    
    Co-developed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

commit 2d775ee651e05596f083e1fe8dfb2ab410369d7d
Author: Andrew Cooper <andrew.cooper3@citrix.com>
Date:   Mon Jul 17 09:20:44 2023 +0200

    xen: Introduce arch_domain_teardown()
    
    Plumb it into domain_teardown().  Provide arch_val in the teardown
    continuation information for use by arch_domain_teardown().
    
    No practical change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Sun Jul 23 04:50:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 23 Jul 2023 04:50:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568132.887543 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNR38-0002Zn-Cw; Sun, 23 Jul 2023 04:50:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568132.887543; Sun, 23 Jul 2023 04:50:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNR38-0002Zg-AD; Sun, 23 Jul 2023 04:50:30 +0000
Received: by outflank-mailman (input) for mailman id 568132;
 Sun, 23 Jul 2023 04:50:28 +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 <SRS0=dWw5=DJ=intel.com=lkp@srs-se1.protection.inumbo.net>)
 id 1qNR36-0002Za-Fd
 for xen-devel@lists.xenproject.org; Sun, 23 Jul 2023 04:50:28 +0000
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6e73c862-2914-11ee-8611-37d641c3527e;
 Sun, 23 Jul 2023 06:50:24 +0200 (CEST)
Received: from orsmga005.jf.intel.com ([10.7.209.41])
 by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 22 Jul 2023 21:50:21 -0700
Received: from lkp-server02.sh.intel.com (HELO 36946fcf73d7) ([10.239.97.151])
 by orsmga005.jf.intel.com with ESMTP; 22 Jul 2023 21:50:18 -0700
Received: from kbuild by 36946fcf73d7 with local (Exim 4.96)
 (envelope-from <lkp@intel.com>) id 1qNR2v-0008qL-0x;
 Sun, 23 Jul 2023 04:50:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6e73c862-2914-11ee-8611-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690087824; x=1721623824;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=/xZW808BrUCeT5DlyP4BVVq4u1ojxXBhWS/KYqOFDsA=;
  b=ISiTbxsKbyR5p8uguNcjrrUoPfxX/89qJJgFXk+Tw/uoRZPACEG0qn+r
   wtzb32bTePlyE6/34cO1GUDoLyk/ET4Rdd5SUUgiBOGwk8rIXvN/1uFiD
   Gm02/CiE0d1LfqBSxz06o4IY1Bb9H6I0bs3XvJCp3Yzqz0RWsbStfKG3H
   xHTU0qqiuAnlA4kt1BCgxID/t4EJ2j0ynkuVS6kKKcMeI7fLMaxJXEvja
   yNDK79telNfZx/z+E78jPMWmbM6FPhbQibI4NVpzWqHbDsGY8nPwckZAK
   B9lYftGbCawITZboBn+V6aWmQTQ/YSHXJ4Ehxc66Ae4jXHfDDIk+H+k/M
   A==;
X-IronPort-AV: E=McAfee;i="6600,9927,10779"; a="370850804"
X-IronPort-AV: E=Sophos;i="6.01,226,1684825200"; 
   d="scan'208";a="370850804"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10779"; a="899131358"
X-IronPort-AV: E=Sophos;i="6.01,226,1684825200"; 
   d="scan'208";a="899131358"
Date: Sun, 23 Jul 2023 12:49:18 +0800
From: kernel test robot <lkp@intel.com>
To: Viresh Kumar <viresh.kumar@linaro.org>, Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: oe-kbuild-all@lists.linux.dev, Viresh Kumar <viresh.kumar@linaro.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Alex =?iso-8859-1?Q?Benn=E9e?= <alex.bennee@linaro.org>,
	stratos-dev@op-lists.linaro.org,
	Erik Schilling <erik.schilling@linaro.org>,
	Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2 2/2] xen: privcmd: Add support for irqfd
Message-ID: <202307231237.JHGxqmdg-lkp@intel.com>
References: <a25d5f01fe9b4624aa12cab77abd001044ea02d5.1689845210.git.viresh.kumar@linaro.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <a25d5f01fe9b4624aa12cab77abd001044ea02d5.1689845210.git.viresh.kumar@linaro.org>

Hi Viresh,

kernel test robot noticed the following build errors:

[auto build test ERROR on xen-tip/linux-next]
[also build test ERROR on linus/master v6.5-rc2 next-20230721]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Viresh-Kumar/xen-privcmd-Add-support-for-irqfd/20230720-173905
base:   https://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git linux-next
patch link:    https://lore.kernel.org/r/a25d5f01fe9b4624aa12cab77abd001044ea02d5.1689845210.git.viresh.kumar%40linaro.org
patch subject: [PATCH V2 2/2] xen: privcmd: Add support for irqfd
config: x86_64-randconfig-r091-20230723 (https://download.01.org/0day-ci/archive/20230723/202307231237.JHGxqmdg-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230723/202307231237.JHGxqmdg-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307231237.JHGxqmdg-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   drivers/xen/privcmd.c: In function 'privcmd_irqfd_assign':
>> drivers/xen/privcmd.c:961:19: error: implicit declaration of function 'eventfd_ctx_fileget'; did you mean 'eventfd_ctx_fdget'? [-Werror=implicit-function-declaration]
     961 |         eventfd = eventfd_ctx_fileget(f.file);
         |                   ^~~~~~~~~~~~~~~~~~~
         |                   eventfd_ctx_fdget
>> drivers/xen/privcmd.c:961:17: warning: assignment to 'struct eventfd_ctx *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     961 |         eventfd = eventfd_ctx_fileget(f.file);
         |                 ^
   cc1: some warnings being treated as errors


vim +961 drivers/xen/privcmd.c

   936	
   937	static int privcmd_irqfd_assign(struct privcmd_irqfd *irqfd)
   938	{
   939		struct privcmd_kernel_irqfd *kirqfd, *tmp;
   940		struct eventfd_ctx *eventfd;
   941		__poll_t events;
   942		struct fd f;
   943		int ret;
   944	
   945		kirqfd = kzalloc(sizeof(*kirqfd), GFP_KERNEL);
   946		if (!kirqfd)
   947			return -ENOMEM;
   948	
   949		kirqfd->irq = irqfd->irq;
   950		kirqfd->dom = irqfd->dom;
   951		kirqfd->level = irqfd->level;
   952		INIT_LIST_HEAD(&kirqfd->list);
   953		INIT_WORK(&kirqfd->shutdown, irqfd_shutdown);
   954	
   955		f = fdget(irqfd->fd);
   956		if (!f.file) {
   957			ret = -EBADF;
   958			goto error_kfree;
   959		}
   960	
 > 961		eventfd = eventfd_ctx_fileget(f.file);
   962		if (IS_ERR(eventfd)) {
   963			ret = PTR_ERR(eventfd);
   964			goto error_fd_put;
   965		}
   966	
   967		kirqfd->eventfd = eventfd;
   968	
   969		/*
   970		 * Install our own custom wake-up handling so we are notified via a
   971		 * callback whenever someone signals the underlying eventfd.
   972		 */
   973		init_waitqueue_func_entry(&kirqfd->wait, irqfd_wakeup);
   974		init_poll_funcptr(&kirqfd->pt, irqfd_poll_func);
   975	
   976		mutex_lock(&irqfds_lock);
   977	
   978		list_for_each_entry(tmp, &irqfds_list, list) {
   979			if (kirqfd->eventfd == tmp->eventfd) {
   980				ret = -EBUSY;
   981				mutex_unlock(&irqfds_lock);
   982				goto error_eventfd;
   983			}
   984		}
   985	
   986		list_add_tail(&kirqfd->list, &irqfds_list);
   987		mutex_unlock(&irqfds_lock);
   988	
   989		/*
   990		 * Check if there was an event already pending on the eventfd before we
   991		 * registered, and trigger it as if we didn't miss it.
   992		 */
   993		events = vfs_poll(f.file, &kirqfd->pt);
   994		if (events & EPOLLIN)
   995			irqfd_inject(kirqfd);
   996	
   997		/*
   998		 * Do not drop the file until the kirqfd is fully initialized, otherwise
   999		 * we might race against the EPOLLHUP.
  1000		 */
  1001		fdput(f);
  1002		return 0;
  1003	
  1004	error_eventfd:
  1005		eventfd_ctx_put(eventfd);
  1006	
  1007	error_fd_put:
  1008		fdput(f);
  1009	
  1010	error_kfree:
  1011		kfree(kirqfd);
  1012		return ret;
  1013	}
  1014	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


From xen-devel-bounces@lists.xenproject.org Sun Jul 23 05:47:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 23 Jul 2023 05:47:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568139.887559 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNRvx-0000Y2-H7; Sun, 23 Jul 2023 05:47:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568139.887559; Sun, 23 Jul 2023 05:47:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNRvx-0000Xv-EZ; Sun, 23 Jul 2023 05:47:09 +0000
Received: by outflank-mailman (input) for mailman id 568139;
 Sun, 23 Jul 2023 05:47:08 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNRvw-0000Xl-3w; Sun, 23 Jul 2023 05:47:08 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNRvv-0005kV-O9; Sun, 23 Jul 2023 05:47:07 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNRvv-0007WS-3f; Sun, 23 Jul 2023 05:47:07 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qNRvv-0000fT-36; Sun, 23 Jul 2023 05:47:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ukJWqg0aTU37CiUbZNeiUUWJIj6yAYn1WLMEA4SrYfI=; b=t+04N+/IRSiAOhtUGfimqZFLT1
	48GJjEvAYsnpmhaTJ4wl0Q2QNwn4okrYF8czChYJKSR8BngiIxEMAuyc+eKEnSU8BEWdYcYOKCtLh
	970q+tNwVQ4ctzfPuhINEg9IvjdCDwRQNbRninGp4KA7Ko9HxSNwfeiPGYAWLbnUmuEY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181972-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181972: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-shadow:guest-localmigrate/x10:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:debian-hvm-install:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:guest-start/debianhvm.repeat:fail:regression
    linux-linus:test-amd64-amd64-xl-vhd:guest-start/debian.repeat:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:guest-start/debianhvm.repeat:fail:regression
    linux-linus:test-amd64-amd64-xl-rtds:guest-start/debian.repeat:fail:allowable
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=d192f5382581d972c4ae1b4d72e0b59b34cadeb9
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 23 Jul 2023 05:47:07 +0000

flight 181972 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181972/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-shadow   20 guest-localmigrate/x10   fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 12 debian-hvm-install fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 14 guest-start/debianhvm.repeat fail REGR. vs. 180278
 test-amd64-amd64-xl-vhd     21 guest-start/debian.repeat fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 20 guest-start/debianhvm.repeat fail REGR. vs. 180278

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds    22 guest-start/debian.repeat fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                d192f5382581d972c4ae1b4d72e0b59b34cadeb9
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   97 days
Failing since        180281  2023-04-17 06:24:36 Z   96 days  184 attempts
Testing same since   181972  2023-07-22 13:29:13 Z    0 days    1 attempts

------------------------------------------------------------
3808 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 639403 lines long.)


From xen-devel-bounces@lists.xenproject.org Sun Jul 23 09:00:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 23 Jul 2023 09:00:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568166.887577 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNUx5-0003yL-CT; Sun, 23 Jul 2023 09:00:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568166.887577; Sun, 23 Jul 2023 09:00:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNUx5-0003yE-9N; Sun, 23 Jul 2023 09:00:31 +0000
Received: by outflank-mailman (input) for mailman id 568166;
 Sun, 23 Jul 2023 09:00:29 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNUx3-0003xx-OB; Sun, 23 Jul 2023 09:00:29 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNUx3-0002Ow-K0; Sun, 23 Jul 2023 09:00:29 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNUx3-00033y-5B; Sun, 23 Jul 2023 09:00:29 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qNUx3-0002Wr-4l; Sun, 23 Jul 2023 09:00:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=2kn0mmAkJuWdIzODHF0341KaOs80e6IUdNg7+fILLDs=; b=gnMqKY/fiy02pRoU35zhjPtWkm
	1h1bgwyiIWkVbM5AuMQ5EoF+VoiWafApUAvGWfLtwSRgHZnj39jX8rzFR8RHuA0t7yinUskFCI95e
	Cjys2f1am4LhFlUlkoB1sgWESYyYGb5/LlvKg0UvCArx1k3vv5tY7/7DdkF/KVtCaLSs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181975-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-upstream-unstable test] 181975: tolerable FAIL - PUSHED
X-Osstest-Failures:
    qemu-upstream-unstable:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    qemu-upstream-unstable:test-amd64-i386-xl-qemuu-ovmf-amd64:xen-install:fail:heisenbug
    qemu-upstream-unstable:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:guest-start/debianhvm.repeat:fail:heisenbug
    qemu-upstream-unstable:test-amd64-amd64-dom0pvh-xl-amd:guest-start:fail:nonblocking
    qemu-upstream-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-upstream-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-upstream-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-upstream-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-upstream-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    qemu-upstream-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-upstream-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=698407ef8395521a9a5b15ed9cd0b7e1fc258ded
X-Osstest-Versions-That:
    qemuu=8c51cd970509b97d8378d175646ec32889828158
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 23 Jul 2023 09:00:29 +0000

flight 181975 qemu-upstream-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181975/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail in 181963 pass in 181975
 test-amd64-i386-xl-qemuu-ovmf-amd64  7 xen-install         fail pass in 181963
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 14 guest-start/debianhvm.repeat fail pass in 181963

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-dom0pvh-xl-amd 14 guest-start      fail in 181963 like 180030
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 180030
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180030
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 180030
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180030
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180030
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt   16 saverestore-support-check fail starved in 180030
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail starved in 180030
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check fail starved in 180030

version targeted for testing:
 qemuu                698407ef8395521a9a5b15ed9cd0b7e1fc258ded
baseline version:
 qemuu                8c51cd970509b97d8378d175646ec32889828158

Last test of basis   180030  2023-03-27 14:09:05 Z  117 days
Testing same since   181963  2023-07-21 15:11:10 Z    1 days    2 attempts

------------------------------------------------------------
People who touched revisions under test:
  Akihiko Odaki <akihiko.odaki@daynix.com>
  Albert Esteve <aesteve@redhat.com>
  Alex BennÃ©e <alex.bennee@linaro.org>
  Alexander Bulekov <alxndr@bu.edu>
  Alistair Francis <alistair.francis@wdc.com>
  Anastasia Belova <abelova@astralinux.ru>
  Ani Sinha <anisinha@redhat.com>
  Anthony PERARD <anthony.perard@citrix.com>
  Anton Johansson <anjo@rev.ng>
  Ard Biesheuvel <ardb@kernel.org>
  Bernhard Beschow <shentey@gmail.com>
  Bin Meng <bin.meng@windriver.com>
  Carlos LÃ³pez <clopez@suse.de>
  Chenyi Qiang <chenyi.qiang@intel.com>
  Christian Schoenebeck <qemu_oss@crudebyte.com>
  Chuck Zmudzinski <brchuckz@aol.com>
  ClÃ©ment Chigot <chigot@adacore.com>
  CÃ©dric Le Goater <clg@kaod.org>
  CÃ©dric Le Goater <clg@redhat.com>
  Daniel Bertalan <dani@danielbertalan.dev>
  Daniel Henrique Barboza <danielhb413@gmail.com>
  Daniel P. BerrangÃ© <berrange@redhat.com>
  Daniil Kovalev <dkovalev@compiler-toolchain-for.me>
  David Daney <david.daney@fungible.com>
  David Hildenbrand <david@redhat.com>
  Dongwon Kim <dongwon.kim@intel.com>
  Dov Murik <dovmurik@linux.ibm.com>
  Dr. David Alan Gilbert &lt;<a href="mailto:dgilbert@redhat.com" target="_blank">dgilbert@redhat.com</a>&gt;<br>
  Dr. David Alan Gilbert <dgilbert@redhat.com>
  Eric Blake <eblake@redhat.com>
  Erico Nunes <ernunes@redhat.com>
  Eugenio PÃ©rez <eperezma@redhat.com>
  Evgeny Iakovlev <eiakovlev@linux.microsoft.com>
  Fiona Ebner <f.ebner@proxmox.com>
  Francisco Iglesias <frasse.iglesias@gmail.com>
  Gerd Hoffmann <kraxel@redhat.com>
  Greg Kurz <groug@kaod.org>
  Guenter Roeck <linux@roeck-us.net>
  Hawkins Jiawei <yin31149@gmail.com>
  Helge Deller <deller@gmx.de>
  Igor Mammedov <imammedo@redhat.com>
  Ilya Leoshkevich <iii@linux.ibm.com>
  Jagannathan Raman <jag.raman@oracle.com>
  Jason Andryuk <jandryuk@gmail.com>
  Jason Wang <jasowang@redhat.com>
  Jiri Pirko <jiri@nvidia.com>
  Juan Quintela <quintela@redhat.com>
  Julia Suvorova <jusual@redhat.com>
  Kevin Wolf <kwolf@redhat.com>
  Klaus Jensen <k.jensen@samsung.com>
  Konstantin Kostiuk <kkostiuk@redhat.com>
  Kostiantyn Kostiuk <kostyanf14@live.com>
  Laszlo Ersek <lersek@redhat.com>
  Laurent Vivier <laurent@vivier.eu>
  Laurent Vivier <lvivier@redhat.com>
  Lei Yang <leiyang@redhat.com>
  LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
  Lukas Straub <lukasstraub2@web.de>
  Lukas Tschoke <lukts330@gmail.com>
  Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
  Mark Somerville <mark@qpok.net>
  Markus Armbruster <armbru@redhat.com>
  Mathis Marion <mathis.marion@silabs.com>
  Mattias Nissler <mnissler@rivosinc.com>
  Mauro Matteo Cascella <mcascell@redhat.com>
  Maxime Coquelin <maxime.coquelin@redhat.com>
  Michael S. Tsirkin <mst@redhat.com>
  Michael Tokarev <mjt@tls.msk.ru>
  Nathan Chancellor <nathan@kernel.org>
  Nicholas Piggin <npiggin@gmail.com>
  Nina Schoetterl-Glausch <nsg@linux.ibm.com>
  Paolo Bonzini <pbonzini@redhat.com>
  Peter Maydell <peter.maydell@linaro.org>
  Peter Xu <peterx@redhat.com>
  Philippe Mathieu-DaudÃ© <philmd@linaro.org>
  Pierrick Bouvier <pierrick.bouvier@linaro.org>
  Prasad Pandit <pjp@fedoraproject.org>
  Richard Henderson <richard.henderson@linaro.org>
  Ryan Wendland <wendland@live.com.au>
  Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
  Shivaprasad G Bhat <sbhat@linux.ibm.com>
  Stefan Hajnoczi <stefanha@redhat.com>
  Tested-By: Solra Bizna <solra@bizna.name>
  Thomas Huth <thuth@redhat.com>
  timothee.cocault@gmail.com <timothee.cocault@gmail.com>
  TimothÃ©e Cocault <timothee.cocault@gmail.com>
  Tommy Wu <tommy.wu@sifive.com>
  Vaibhav Jain <vaibhav@linux.ibm.com>
  Viktor Prutyanov <viktor@daynix.com>
  Vivek Kasireddy <vivek.kasireddy@intel.com>
  Volker RÃ¼melin <vr_qemu@t-online.de>
  Wang Liang <wangliangzz@inspur.com>
  Xinyu Li <lixinyu20s@ict.ac.cn>
  Yajun Wu <yajunw@nvidia.com>
  Yang Zhong <yang.zhong@linux.intel.com>
  Yin Wang <yin.wang@intel.com>
  Yuval Shaia <yuval.shaia.ml@gmail.com>
  Zhenzhong Duan <zhenzhong.duan@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/qemu-xen.git
   8c51cd9705..698407ef83  698407ef8395521a9a5b15ed9cd0b7e1fc258ded -> master


From xen-devel-bounces@lists.xenproject.org Sun Jul 23 15:15:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 23 Jul 2023 15:15:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568313.887642 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNanJ-00080a-3q; Sun, 23 Jul 2023 15:14:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568313.887642; Sun, 23 Jul 2023 15:14:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNanJ-00080T-0w; Sun, 23 Jul 2023 15:14:49 +0000
Received: by outflank-mailman (input) for mailman id 568313;
 Sun, 23 Jul 2023 15:14:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNanI-00080J-4j; Sun, 23 Jul 2023 15:14:48 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNanI-0002Zs-2Q; Sun, 23 Jul 2023 15:14:48 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNanH-0004Ci-J9; Sun, 23 Jul 2023 15:14:47 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qNanH-0002nv-Ij; Sun, 23 Jul 2023 15:14:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=kOk5N9oDri0b5pVcQcj7tbjkxh2bPM6INPgpLx0Lxuo=; b=v+GefddLMH5PJ5Rim8YkyP5bmC
	xABvjEZNRER4NqF9y3zpC5dHD0DxTTYRwR6QuG+rZF36cW2VLFaMTcEkKofARnfqq+nO/yrfUFLr1
	+ham6ndSip4j9rg+QauH9mWQ6lNKJE4/p0V90mE79Ro54yjC7n8skLyYYEG9HFOAary4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181981-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181981: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-qemuu-rhel6hvm-amd:xen-install:fail:heisenbug
    xen-unstable:test-amd64-amd64-dom0pvh-xl-amd:guest-localmigrate/x10:fail:heisenbug
    xen-unstable:test-amd64-i386-migrupgrade:xen-install/src_host:fail:heisenbug
    xen-unstable:test-amd64-i386-examine:xen-install:fail:heisenbug
    xen-unstable:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt-raw:guest-start:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=0c53c638e16278078371ce028c74693841d7738a
X-Osstest-Versions-That:
    xen=4bf014c6f7d7cc9a9e017cef0eb5ff4bf27526e9
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 23 Jul 2023 15:14:47 +0000

flight 181981 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181981/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-qemuu-rhel6hvm-amd 7 xen-install fail in 181968 pass in 181981
 test-amd64-amd64-dom0pvh-xl-amd 20 guest-localmigrate/x10 fail in 181968 pass in 181981
 test-amd64-i386-migrupgrade  10 xen-install/src_host       fail pass in 181968
 test-amd64-i386-examine       6 xen-install                fail pass in 181968
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat  fail pass in 181968
 test-armhf-armhf-libvirt-raw 13 guest-start                fail pass in 181968

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail in 181968 like 181927
 test-armhf-armhf-libvirt-raw 14 migrate-support-check fail in 181968 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181927
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181927
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181927
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181927
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181927
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181927
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181927
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181927
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181927
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181927
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181927
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass

version targeted for testing:
 xen                  0c53c638e16278078371ce028c74693841d7738a
baseline version:
 xen                  4bf014c6f7d7cc9a9e017cef0eb5ff4bf27526e9

Last test of basis   181927  2023-07-20 13:41:22 Z    3 days
Failing since        181953  2023-07-21 10:42:59 Z    2 days    3 attempts
Testing same since   181968  2023-07-22 06:13:00 Z    1 days    2 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Federico Serafini <federico.serafini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Jens Wiklander <jens.wiklander@linaro.org>
  Juergen Gross <jgross@suse.com>
  Julien Grall <jgrall@amazon.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      fail    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   4bf014c6f7..0c53c638e1  0c53c638e16278078371ce028c74693841d7738a -> master


From xen-devel-bounces@lists.xenproject.org Sun Jul 23 21:25:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 23 Jul 2023 21:25:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568361.887653 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNgZF-0002uZ-UD; Sun, 23 Jul 2023 21:24:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568361.887653; Sun, 23 Jul 2023 21:24:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNgZF-0002uS-RG; Sun, 23 Jul 2023 21:24:41 +0000
Received: by outflank-mailman (input) for mailman id 568361;
 Sun, 23 Jul 2023 21:24:40 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNgZE-0002uI-PK; Sun, 23 Jul 2023 21:24:40 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNgZE-0003QM-I3; Sun, 23 Jul 2023 21:24:40 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNgZE-0003zU-5e; Sun, 23 Jul 2023 21:24:40 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qNgZE-0006sU-5E; Sun, 23 Jul 2023 21:24:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=zcAMOpjeL5MqSVU8tNtvKQT1q77l52XpiLjO1JiAmrk=; b=aWHwrloGWC/946+LuP6247AU0X
	ZQhZXX6x1DXx2n/pW2aC/HAJ12D71cM9ea51AU2HDsy3/KcZtDlWqFYLfQO602fKmjQugVRtPGX4x
	6erqbEOEXXCV3JEv0w9frUE+MaFbmjwrAu8AqO7qfpzKGvvCcp9sLgHh74M5Ehx/fllk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181983-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181983: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=c2782531397f5cb19ca3f8f9c17727f1cdf5bee8
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 23 Jul 2023 21:24:40 +0000

flight 181983 linux-linus real [real]
flight 181985 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181983/
http://logs.test-lab.xenproject.org/osstest/logs/181985/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                c2782531397f5cb19ca3f8f9c17727f1cdf5bee8
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   98 days
Failing since        180281  2023-04-17 06:24:36 Z   97 days  185 attempts
Testing same since   181983  2023-07-23 05:52:14 Z    0 days    1 attempts

------------------------------------------------------------
3813 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 640452 lines long.)


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 00:08:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 00:08:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568390.887663 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNj7L-0002da-OM; Mon, 24 Jul 2023 00:08:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568390.887663; Mon, 24 Jul 2023 00:08:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNj7L-0002dT-LU; Mon, 24 Jul 2023 00:08:03 +0000
Received: by outflank-mailman (input) for mailman id 568390;
 Mon, 24 Jul 2023 00:08:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CttD=DK=epam.com=prvs=15690d6cff=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qNj7J-0002dK-H2
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 00:08:01 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 23295923-29b6-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 02:07:59 +0200 (CEST)
Received: from pps.filterd (m0174683.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 36NKvGKS021049;
 Mon, 24 Jul 2023 00:07:53 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2053.outbound.protection.outlook.com [104.47.13.53])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3s12208uq0-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Mon, 24 Jul 2023 00:07:52 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS2PR03MB10193.eurprd03.prod.outlook.com (2603:10a6:20b:5fd::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.30; Mon, 24 Jul
 2023 00:07:49 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6609.032; Mon, 24 Jul 2023
 00:07:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 23295923-29b6-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=bvNSJdgdbARLywpXSnLaNmjgocDyZsfyKm6zscmEBg5Vj8YzLDF0VNHbvKNjN5OHze6N0kFoA55lpvJzRhKmt2QCzXD3VUxznhUW4qA4IrQWE+wCJL07qmRsTQkMF67tgZzNIO3fEwEH46bhQkhEefD6Zch7B3vYjNHCV1X9GB70r7xcTtHFIhNtU3QEoJSSYiXFIq+8MvQ+XNOxwa56XdQsh0atiQT7IdiM2v0Mph8WFIgcgd5mEE6nhZoNLiEM2MrhpJGuvBMfWgkTXrj+5fzUBtLMkzX4ViEK2T7bNg07jhv+WP2KWYC9emXV05E9R0aHiAo1sqaT5Db3apotng==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=wD7/Jabcn1UV7MQK1uTOOIY4SnZey2eDV/1k0Ya8ttE=;
 b=Ki3tb9DkIS88lWAgbMyFGZHdyBMU+ZE4gfg/tFT63eMIOJ1QkXfeFdBbh2HwO97HOJG2Ugd3uN9S5sXqVmN2osaj8ERlvt9e7IawGoPsfgG4aLa390DCBD8x8SIhbGNWrTzfXnzFg22ZmLlbOt2iYMm71pXfGlucZxGovXMlHz77STSssDjuawgL0ppQ8i/l44+56V2S2FpsCzg/Tofu/iOuRsaHYc76hCKOxqgLjv4H2gDQ3I/4CoYJNUfcNAe8PMpj5452TRTbV0ex1xAAw2f8dFe+ZqjCzNGSw5qahdJONMyIFFlo/k0PgRP31e9Cbsg7zQXmcyRMbhIofbVWYg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=wD7/Jabcn1UV7MQK1uTOOIY4SnZey2eDV/1k0Ya8ttE=;
 b=bmFIaF+Cw4OUruAkDjIOp3mu77F8kGD2oUl/Hk47rWzCTi8OJ4QVHItHiK5fIKkNPNkgVXzvuQ3awEOutcKbug8vUfoxsc/ASsKT3e9RyeWjGoNxZDpPykXY6utSt/vfCdtaiWeIEmw/7L8wo5iNDkcg+4u91wwUZzxeS+VVh2WG1DvR4bMrh13FviGeu9CC8YhbuB2ylFF7J6RXvPhewDrcNdnC5N+Tq+hk2Z5DoFoBYx07QVnMgDPT3rr/kFu5eZgTN52VQ2f7WxSi6LoQxcQTc0X5+mPWQ/+is5p3Q9AwfTrJ6OLJ3SftQ8PuQZa7z/Rn+e30bsJOGh9129LBiw==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
CC: Jan Beulich <jbeulich@suse.com>,
        "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>,
        Oleksandr Andrushchenko
	<Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Thread-Topic: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Thread-Index: AQHZuqGrLMJPz1ipBEu4urExXp8yi6/CgxUAgAAjhICAAAaPAIAFYwcA
Date: Mon, 24 Jul 2023 00:07:48 +0000
Message-ID: <87fs5edve5.fsf@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local>
 <08ec7e54-1abf-5e1e-e1ee-7026a69e0279@suse.com>
 <ZLk7wh39Cc3GdIuB@MacBook-Air-de-Roger.local>
In-Reply-To: <ZLk7wh39Cc3GdIuB@MacBook-Air-de-Roger.local>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: mu4e 1.8.9; emacs 28.2
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS2PR03MB10193:EE_
x-ms-office365-filtering-correlation-id: 19ce8c0c-36b9-4646-fd22-08db8bda0402
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 orqBlVaYX+tJsDLi+PoD7SFLWxyGuCGcJKafS9k5ZL0QeBVOqRXCusP0CLdjtcXTNCID2yMGhAkeSGS9VrjB/D42mzLghuvAkMtHUqKO1gl+Orlbc2cDxltSLltJ99KdISATuBNMgTJg9VQ/88leY5EVYfwuDmcHY4RmcLq6Y1ALQpG6NyUE0wxFAXhk5sFKkVw57OVSDf/2/I4vDS6/94Hwx4WlW+2U+tC9ZaCjrU5p+wJlYBKqK2n7DEqeys2E0iVQffNcCDI1JJiEDK2f2f8TBX6cSSTrDs47//JWHl0SnUSQNxrgzqQcSG4HG4GCywkTClgLcQD7XgD/KsHpeTsnqjas7YSyS6mHAR+daPbeF6H9qBVlvAY+bYwO4mQi1MI1+Jq6L5GnTYowQZbTQ4P+Q6p5v0xLlbGX1Ib9hwfndAW5hbUzb0VcBRmrclCELyXA1jYKM0wqyzSssB82FwL2n71/g/8/ZvRWihVd3QPFqstHb4xQAg08x4+Rao//3QWeKwchN17OJvcujhh71EGyduhFmbL1LyiCO0gfRwTcX5mtQfhy2LqiRRG4OySfkdN/xXCYsoz0BqymD96QnfvQCCgltHI8S4fUkQHzjiCPqjQhYNITpH3aNa+vODbP
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(396003)(39860400002)(136003)(346002)(451199021)(6512007)(6486002)(478600001)(91956017)(71200400001)(54906003)(2616005)(55236004)(53546011)(186003)(6506007)(26005)(107886003)(2906002)(316002)(76116006)(41300700001)(66946007)(4326008)(66476007)(6916009)(66556008)(64756008)(5660300002)(8676002)(8936002)(66446008)(38100700002)(122000001)(36756003)(38070700005)(86362001)(83380400001);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?QTJhMnd1V3JYZWgyWlhDSVJkNkhSNXBqK3JkaERaa1R4QzdiUWNrRjFWU3U0?=
 =?utf-8?B?K2w0TWpXVHhWOUFBbHEyamE2UnZnV2xNMkxlVHNsRUFia3hia2hqNXRnQ0Yr?=
 =?utf-8?B?R2JsRU5zUWsxblJTNmFnM0gzQlVVRmlDdFQrQzRQNkEwTVlHUDhTN3Zydjhq?=
 =?utf-8?B?cHVDczFGNVdaQ1doRURyekMvWkZRc25kV2owQjFJZlIvR1E4UCtaQ1dpV1Yx?=
 =?utf-8?B?RGVSUHlsVG01ZytNaGtlRkdseER6VUxpTGhuZFZoSUU1K2VzRjN0NnUyd0Yy?=
 =?utf-8?B?ZVBGbUh0Z21iWE42cDhwejRmTldhakNGb2FoaDYxc043UEo1d1Z1WGNwaEJl?=
 =?utf-8?B?TnNyeTBFdHNwcGJDVU54UTR4a09BTlBqMjkrOHpEd0d1ckRWYjBxajZiSnVa?=
 =?utf-8?B?bFpqdUVZdG5uZnN2THRIS00zR1Q2cGZvR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="utf-8"
Content-ID: <252B72878C8B3641A50DD7F45175DA84@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 19ce8c0c-36b9-4646-fd22-08db8bda0402
X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jul 2023 00:07:48.8889
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: Hyh7q0tS78iu8uEaIdU/BYBSFfP6HR4UdBju0U4pgqEs+vj3uaNFkTM/ytoscdrLvSmmLRWaRSIpQLxxoSkncqeX73Plh4a+WBJiVduV49M=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB10193
X-Proofpoint-GUID: voecXZTw4vBrXREslpOiEhPIY-ciOim2
X-Proofpoint-ORIG-GUID: voecXZTw4vBrXREslpOiEhPIY-ciOim2
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-23_11,2023-07-20_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0
 lowpriorityscore=0 mlxlogscore=989 spamscore=0 malwarescore=0 bulkscore=0
 suspectscore=0 adultscore=0 priorityscore=1501 mlxscore=0 phishscore=0
 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307240000

DQpIaSBSb2dlciwNCg0KUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+IHdy
aXRlczoNCg0KPiBPbiB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J5IHRh
a2luZyB0aGUgbG9jayBpbiBleGNsdXNpdmUNCj4gbW9kZSBoZXJlLg0KPg0KPiBXZSBjYW4gYWx3
YXlzIGRvIHRoYXQgbGF0ZXIsIHNvIGZvcmdldCBhYm91dCB0aGF0IGNvbW1lbnQgKGZvciBub3cp
Lg0KDQpBcmUgeW91IHN1cmU/IEknZCByYXRoZXIgcmV3b3JrIHRoZSBjb2RlIHRvIHVzZSB3cml0
ZSBsb2NrIGluIHRoZQ0KbW9kaWZ5X2JhcnMoKS4gVGhpcyBpcyB3aHkgd2UgYmVnYW4gYWxsIHRo
aXMgam91cm5leSBpbiB0aGUgZmlyc3QgcGxhY2UuDQoNCi0tIA0KV0JSLCBWb2xvZHlteXI=


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 04:19:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 04:19:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568402.887673 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNn2q-0001Ln-IV; Mon, 24 Jul 2023 04:19:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568402.887673; Mon, 24 Jul 2023 04:19:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNn2q-0001Lf-D4; Mon, 24 Jul 2023 04:19:40 +0000
Received: by outflank-mailman (input) for mailman id 568402;
 Mon, 24 Jul 2023 04:19:39 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNn2p-0001LV-4T; Mon, 24 Jul 2023 04:19:39 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNn2o-0004Dy-TG; Mon, 24 Jul 2023 04:19:38 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNn2n-0002GA-PM; Mon, 24 Jul 2023 04:19:37 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qNn2n-0004kF-Mj; Mon, 24 Jul 2023 04:19:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=DQi9WYmZ1WTKPsux8Oivf0SA4uYXGN9LkGrAXIFg87o=; b=BYcFM8mfEQhbKtL6BXyK6OWReq
	wpDFMJ2GAB9kNPlgrFiNQW5jp/5P/KorJVPtQ3B9Z7DubNf1xP1shEiimCbnoLCutT5TI/aQNZKAn
	ZE4A0mwGskW4yB1bWSyqkQsJ7d1nCfPuxAFRIcXsFCs0fKEP6lohGyC9xO5SG6DwzzBQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181986-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181986: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-examine-bios:host-install:broken:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-freebsd12-amd64:guest-localmigrate/x10:fail:regression
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:guest-start/debianhvm.repeat:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:guest-localmigrate/x10:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:guest-start/debianhvm.repeat:fail:regression
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=269f4a4b85a1b61e94bf935b30c56a938e92f585
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 24 Jul 2023 04:19:37 +0000

flight 181986 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181986/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-examine-bios  5 host-install          broken REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64  8 xen-boot    fail REGR. vs. 180278
 test-amd64-amd64-freebsd12-amd64 19 guest-localmigrate/x10 fail REGR. vs. 180278
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 14 guest-start/debianhvm.repeat fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-ovmf-amd64 18 guest-localmigrate/x10 fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-amd64 20 guest-start/debianhvm.repeat fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                269f4a4b85a1b61e94bf935b30c56a938e92f585
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   98 days
Failing since        180281  2023-04-17 06:24:36 Z   97 days  186 attempts
Testing same since   181986  2023-07-23 21:40:11 Z    0 days    1 attempts

------------------------------------------------------------
3815 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-step test-amd64-amd64-examine-bios host-install

Not pushing.

(No revision log; it would be 641271 lines long.)


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 05:07:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 05:07:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568406.887683 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNnnK-00079p-2n; Mon, 24 Jul 2023 05:07:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568406.887683; Mon, 24 Jul 2023 05:07:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNnnK-00079i-00; Mon, 24 Jul 2023 05:07:42 +0000
Received: by outflank-mailman (input) for mailman id 568406;
 Mon, 24 Jul 2023 05:07:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNnnH-00079b-R3
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 05:07:39 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0141dee7-29e0-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 07:07:37 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 2BFFF20488;
 Mon, 24 Jul 2023 05:07:36 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 015B213476;
 Mon, 24 Jul 2023 05:07:35 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id KtRWOhcHvmREIgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 05:07:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0141dee7-29e0-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690175256; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=EuokPu4ognUR5ZFVPKHLs8t+Gf4ukm1xma2Lw7D/Fo0=;
	b=fmQGmgAinCZ0zrWBGVXJepy0xYmbXSxYrwVJgcU43oGYOmeWBMl2Yyu32YZH2QOt6ENKW7
	NQ6tWiaNDGKYhVQXLwrT4crJHCWbiiEmzyyfKwTBeKuNdsoxyJQSQYWjG/fer0ewnkfxr7
	paKaHqoHOugM44L1o3XG2S36LxFFp7Y=
Message-ID: <609d6f0c-8987-2beb-01fc-89a140dd1418@suse.com>
Date: Mon, 24 Jul 2023 07:07:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 0/2] tools/xenstore: fix get_spec_node()
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230722081646.4136-1-jgross@suse.com>
 <7604c148-47c5-ce67-d691-4f642b1876a9@xen.org>
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <7604c148-47c5-ce67-d691-4f642b1876a9@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------b433qyvSEMT4TDa2TMsODKjj"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------b433qyvSEMT4TDa2TMsODKjj
Content-Type: multipart/mixed; boundary="------------TRjsbSvfkIiI9MU304qj0mzx";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <609d6f0c-8987-2beb-01fc-89a140dd1418@suse.com>
Subject: Re: [PATCH v2 0/2] tools/xenstore: fix get_spec_node()
References: <20230722081646.4136-1-jgross@suse.com>
 <7604c148-47c5-ce67-d691-4f642b1876a9@xen.org>
In-Reply-To: <7604c148-47c5-ce67-d691-4f642b1876a9@xen.org>

--------------TRjsbSvfkIiI9MU304qj0mzx
Content-Type: multipart/mixed; boundary="------------5UGJuyB12jIwTMcGPhEePpsV"

--------------5UGJuyB12jIwTMcGPhEePpsV
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjIuMDcuMjMgMTg6NTQsIEp1bGllbiBHcmFsbCB3cm90ZToNCj4gSGkgSnVlcmdlbiwN
Cj4gDQo+IE9uIDIyLzA3LzIwMjMgMDk6MTYsIEp1ZXJnZW4gR3Jvc3Mgd3JvdGU6DQo+PiBT
bWFsbCBzZXJpZXMgdG8gZml4IGEgYnVnIG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AjMSBhbmQgDQo+IHBhdGNoICMyIGlmIHRoZXJlIGlzIGEgZGVzaXJlIHRv
IGhhdmUgYSBjbGVhbiBjaGVycnktcGljay4NCg0KSSdtIGZpbmUgYm90aCB3YXlzLg0KDQoN
Ckp1ZXJnZW4NCg==
--------------5UGJuyB12jIwTMcGPhEePpsV
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5RnNVUJbvoPHZ8SlM4KWm8rG+lIkGurq
qu5gu8q8ZMKdsdGC4b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sdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------5UGJuyB12jIwTMcGPhEePpsV--

--------------TRjsbSvfkIiI9MU304qj0mzx--

--------------b433qyvSEMT4TDa2TMsODKjj
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmS+BxcFAwAAAAAACgkQsN6d1ii/Ey8s
0Qf/bNr3TXM3MvvU9UQjTNM7bpUQwu9h9hD5ig5uMFb7DBIXj1Zf2bBnE+oSp1+ECGPCb9/Y4j4s
HS/0MS3AKC+LaV+Od2yfOhfN+GgVCuxQVBiVbfv+LbAo1rEP7pdeq0FCA52rHQV33k/VcOF82/fV
gFa4m47674IXM7NsQdtO4c/O7C7u0SCNObBiGkqfju+UixuS4JX4om8yyIYK/ZbQO6igT8vYjVKF
OJjWKQ7r+RSVnu5qDjUDa+OoHVA4EhhM78FwbLNz4oWwfOSriiV3SL2Y0o7+xloo8/1IHe170w4H
OOsL/ScFvJUjmycb1cUorQezjsUMCZnlkKMknyV8DA==
=otrs
-----END PGP SIGNATURE-----

--------------b433qyvSEMT4TDa2TMsODKjj--


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 06:44:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 06:44:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568419.887693 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNpIM-0000Wn-04; Mon, 24 Jul 2023 06:43:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568419.887693; Mon, 24 Jul 2023 06:43:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNpIL-0000Wg-TV; Mon, 24 Jul 2023 06:43:49 +0000
Received: by outflank-mailman (input) for mailman id 568419;
 Mon, 24 Jul 2023 06:43:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNpIK-0000WW-Mr; Mon, 24 Jul 2023 06:43:48 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNpIK-0007kR-BX; Mon, 24 Jul 2023 06:43:48 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNpIJ-0002J9-TN; Mon, 24 Jul 2023 06:43:47 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qNpIJ-0008OR-Sy; Mon, 24 Jul 2023 06:43:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=iYR06yxF48kIllC/kXgKQEgykxDGLvue0K1hYX4Bd30=; b=lyVvY3TesURbyqZI562ntlY18p
	7xgQJodHS0xgSbHsfRAyAztfy8+tzc5lqiy0cofGbuOhZVb4O6g/L59X4Z1EHUOHprPvaxiMwGeCn
	AYUH4Ya860M0B2iHrgXIVeuXNq5qtY0TgUHtWqsIRjfgtcwVtAujvL947kftAe4RdLPc=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181988-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 181988: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=dcf05f958eb409095bf330cf8b8f12fe4c940880
X-Osstest-Versions-That:
    ovmf=925c445fd37bf529ca78f9d6c416cca37c7e6da5
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 24 Jul 2023 06:43:47 +0000

flight 181988 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181988/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 dcf05f958eb409095bf330cf8b8f12fe4c940880
baseline version:
 ovmf                 925c445fd37bf529ca78f9d6c416cca37c7e6da5

Last test of basis   181944  2023-07-21 06:13:48 Z    3 days
Testing same since   181988  2023-07-24 04:10:50 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Michael D Kinney <michael.d.kinney@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   925c445fd3..dcf05f958e  dcf05f958eb409095bf330cf8b8f12fe4c940880 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 06:44:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 06:44:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568423.887703 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNpJ8-00011X-9y; Mon, 24 Jul 2023 06:44:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568423.887703; Mon, 24 Jul 2023 06:44:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNpJ8-00011Q-75; Mon, 24 Jul 2023 06:44:38 +0000
Received: by outflank-mailman (input) for mailman id 568423;
 Mon, 24 Jul 2023 06:44:36 +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
 <SRS0=gTwZ=DK=arm.com=Jiamei.Xie@srs-se1.protection.inumbo.net>)
 id 1qNpJ6-0000zG-Oo
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 06:44:36 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0624.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::624])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8c76e5c8-29ed-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 08:44:33 +0200 (CEST)
Received: from DUZPR01CA0042.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:468::9) by AS8PR08MB8328.eurprd08.prod.outlook.com
 (2603:10a6:20b:56d::8) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 06:44:28 +0000
Received: from DBAEUR03FT060.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:468:cafe::ee) by DUZPR01CA0042.outlook.office365.com
 (2603:10a6:10:468::9) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33 via Frontend
 Transport; Mon, 24 Jul 2023 06:44:28 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT060.mail.protection.outlook.com (100.127.142.238) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6588.42 via Frontend Transport; Mon, 24 Jul 2023 06:44:28 +0000
Received: ("Tessian outbound 95df046a2e2c:v145");
 Mon, 24 Jul 2023 06:44:28 +0000
Received: from ada7370f6c02.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 D4E812EC-233D-4410-84F0-925C324AC1C9.1; 
 Mon, 24 Jul 2023 06:44:22 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ada7370f6c02.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Mon, 24 Jul 2023 06:44:22 +0000
Received: from AS8PR08MB7696.eurprd08.prod.outlook.com (2603:10a6:20b:523::11)
 by PAXPR08MB6637.eurprd08.prod.outlook.com (2603:10a6:102:153::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 06:44:20 +0000
Received: from AS8PR08MB7696.eurprd08.prod.outlook.com
 ([fe80::3861:1ade:9356:9970]) by AS8PR08MB7696.eurprd08.prod.outlook.com
 ([fe80::3861:1ade:9356:9970%5]) with mapi id 15.20.6609.032; Mon, 24 Jul 2023
 06:44:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8c76e5c8-29ed-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MbeeTScz0PRvsspk2KmeA4TGOByOz02SNak6YGybUhA=;
 b=5vuR2MEXivV6AE1JskcrpjgtK4la6EtRY0iylGBG4hQKpPdMqJ+AypOsOD4P36fMy5eg9XWUoWLQ6ag4/Zv0xofoSUhrSbEOROfaltCDl0YFMiQwPa6wJJ45d1rUaaMaXTI0E0OGnem9IBOCNjaZgRN4w9K8TyJTh7KLb6emkRQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: b64a4c0cedd52501
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=g0Hu/vgR+rVGQeEZwX2S0QWHvoGABouIWsyJzLSChMd2xA1xhvKgRVR6amT8X1FccwnA9etgPO1UebSBh3dNx+out4IDRNefB0Fd7nAnAnhLElznVJ9CNt1pefHdref+fEGSvJrOMjwTWI2tlguy4zHhkBXExyU0JErCdLEAoefUeBLXwC51WGz8+JKvrRXfrKCoG89w68FgAhgVl9Jw4ZkZpRQPgqi3228+CUl4lOvVh2zipD2M9Rbq/VwPBu/ZqZNoOComyy+E3iIzHNyv3YsprmBb4ITxunLjrojbCPg+Zse5KJc8zWYOY0e2iISzjoQjcexYyd2UiDJi0lEMAg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MbeeTScz0PRvsspk2KmeA4TGOByOz02SNak6YGybUhA=;
 b=nemov4xG9SWAqkoL6hW1fV/1CCgJ3/HtooiZ4Sdx1DBEQvooPmExkd4KXfLmKv1aEUmxMaJhGEJmpk3CsFHci6yQmHO38EQ13XCpHWnCgJ7sOcQx5dZ+ircMDzlVKL+BvTqGrqMuC5umN/iquNyHBwZe6N4jRcQRVyLpLwvlGXGm+Fveo+stxXvc45wbeAqoUHYlIAHSpfRIwGhB53ypuquu2s/JkxkYcvoiSpjsxa16dNxXm/zZfukM8nJAVq0pGBQ5NOU50WL2LfFqZ0iMJKuhuY77uizJA1Ev3bVvbhRZ2EpEri1BrZwVawBJT9x4zXIHRoHo2ToZY4SjKLkHHg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MbeeTScz0PRvsspk2KmeA4TGOByOz02SNak6YGybUhA=;
 b=5vuR2MEXivV6AE1JskcrpjgtK4la6EtRY0iylGBG4hQKpPdMqJ+AypOsOD4P36fMy5eg9XWUoWLQ6ag4/Zv0xofoSUhrSbEOROfaltCDl0YFMiQwPa6wJJ45d1rUaaMaXTI0E0OGnem9IBOCNjaZgRN4w9K8TyJTh7KLb6emkRQ=
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
Message-ID: <1be55cf0-9e62-39b7-c5f3-bb7f4c25d21c@arm.com>
Date: Mon, 24 Jul 2023 14:44:12 +0800
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v5 4/4] automation: Add smoke test for ppc64le
To: xen-devel@lists.xenproject.org
References: <cover.1689958538.git.sanastasio@raptorengineering.com>
 <ade2e58251c506e4576424082623d9b232a435f9.1689958538.git.sanastasio@raptorengineering.com>
Content-Language: en-US
From: Jiamei Xie <jiamei.xie@arm.com>
In-Reply-To: <ade2e58251c506e4576424082623d9b232a435f9.1689958538.git.sanastasio@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: SI2PR01CA0026.apcprd01.prod.exchangelabs.com
 (2603:1096:4:192::16) To AS8PR08MB7696.eurprd08.prod.outlook.com
 (2603:10a6:20b:523::11)
MIME-Version: 1.0
X-MS-TrafficTypeDiagnostic:
	AS8PR08MB7696:EE_|PAXPR08MB6637:EE_|DBAEUR03FT060:EE_|AS8PR08MB8328:EE_
X-MS-Office365-Filtering-Correlation-Id: 5bfc1f23-b18d-4c82-a7b0-08db8c116d74
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 ekny9J5psSrUgsbV1Or3BX5Pj/LCrQn/WLC/kg9b952DKAimtjUfkHHBnR1Psi7QNI47Po242vlUWYvwYp5mzazpcnDiHmMmS7tiSJWC44AuDlj4dsMC1d24FlPZpXelHdv9hzrK4OzBInHoJve6Cbv9jwrsnAZRWFwiJs24xDboKZGZ3hJaK9PG0sjs9999Rx3A/dSTX7jCHGECwVDx/4EEd64nma+qi5c0qQngkN68sr0E/zcsWDjBmb9ulAfDZnXAxPHN/40EiE8rfwjtZcb4xIqM5VUESNf4YuRNjUWQ9MdbsKHmLWBL7b7u+EP9AhNmf5r3wWDZV5J326m/hx07tqHcYo5EnbB5WeqAyJqGEIHpRGDf+io9M7KYUEttxViBK5wy+6/kHXlBsNyjxlBsEYVz3NAzUiK9klhUH1l6h0U0vQC4pkwv31VqgdZPAaanR4Z264ZENPm1QnRdrzH/1O8Tsc2oK0i4n2fup+UFMr+XEmQ9RD7zqS+ZwO6lPO1eNugt9/fuefn45ph5BCMEfkxxRIS7PlQpPJHC6E6R9Fl9MHU5UXIlqhXJ/i8XDZG/XzT1AlHdxSul91Wv8bQC8IpI8jeoVVJy27iA4U7BMisfxmZXNveb2z7xJXF/0HFOylEkvGcOjUYXlUrfCg==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB7696.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(39860400002)(366004)(376002)(346002)(451199021)(8676002)(8936002)(478600001)(6486002)(5660300002)(6666004)(316002)(38100700002)(66946007)(6916009)(66476007)(66556008)(41300700001)(53546011)(186003)(36756003)(2906002)(4744005)(6506007)(26005)(31686004)(31696002)(86362001)(2616005)(6512007)(44832011)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6637
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT060.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	442e1958-6c59-41b1-121f-08db8c11686b
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	j1dTZUabkyabzrFf20wPOsxGEV/T16NeKv5kSq2oblIzOw4pKb0cAJimTUcpM/TvLEMLymZsgvqctCfqH2CZmMp/Eo/hiFhLriR8eCzDFVEwSULR9vpIK5zPyId+PTh0F5ug5WMb4gkYLcmwSEgkIQS+vfxudvXSltnj1jFGGyUvYyvxOGvvG0ExRYrw9+K8ZSkWTufAjwhoibwGTuswcRCdTunKESsq4BuSeji5Wan8vsZGQFitdG8zdGeh66iWm64hUzrTrJrc8Q9xklGbhH2lL2fj0NJIBFbfDihTnutLEQH0zxlSRmhMOY26hSOuh7YrppSJfM86WAg5hOXFVrSn3hUGUZzeXkDPk6iP4CuDDtNrkB/1lCm5srliV0DhxnWpa8Mwq0ivI2zFlfTz7A/9CZY6Ugd7nq2uOQyDuf0QmPFPLODnq+aRadKPlSl4qP6INpSso8HC71yUFyfqiOhvq9Na8ldXNzWkWN9PF/e+Zn1QD+yq1iKw5rETjfpi4YTAdxchQrJxhtxfHrg9uT/otAesFVN3FlZgaw+yU4PZZEMmql7jAQkuZQC86zS1b+ugtTP146OchTRF9eY2Q9xSMHnOM2ijubNOahoncExXr4PFXAR2kxFfa8pfV8ZIlOt2AwFkXiuUq8KJS/zJxD9C/ZtOtXglDnZgzYUTmT47qN34pcsP0F8FAkELoO8DyQ7Uz6chtGb7EOjrrVV3fr9udpcyIAfh4lONqyVGT34hcHHdE9EJlPCk4tmTTA8oCsyCgbmY6Tb8kyXmzLrP5w==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(136003)(376002)(39860400002)(451199021)(82310400008)(46966006)(40470700004)(36840700001)(36860700001)(5660300002)(2616005)(4744005)(2906002)(8936002)(8676002)(6486002)(47076005)(31686004)(44832011)(6506007)(53546011)(478600001)(81166007)(356005)(40460700003)(26005)(186003)(336012)(41300700001)(40480700001)(6666004)(6512007)(82740400003)(86362001)(31696002)(6916009)(316002)(70586007)(70206006)(36756003)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 06:44:28.1595
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 5bfc1f23-b18d-4c82-a7b0-08db8c116d74
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT060.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8328


On 2023/7/22 01:02, Shawn Anastasio wrote:
> Add an initial smoke test that boots xen on a ppc64/pseries machine and
> checks for a magic string. Based on the riscv smoke test.
>
> Eventually the powernv9 (POWER9 bare metal) machine type will want to be
> tested as well, but for now we only boot on pseries.
>
> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Jiamei Xie <jiamei.xie@arm.com>


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 06:50:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 06:50:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568425.887713 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNpOn-0002ak-UQ; Mon, 24 Jul 2023 06:50:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568425.887713; Mon, 24 Jul 2023 06:50:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNpOn-0002ad-Rh; Mon, 24 Jul 2023 06:50:29 +0000
Received: by outflank-mailman (input) for mailman id 568425;
 Mon, 24 Jul 2023 06:50:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gTwZ=DK=arm.com=Jiamei.Xie@srs-se1.protection.inumbo.net>)
 id 1qNpOm-0002aX-Aj
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 06:50:28 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on2062d.outbound.protection.outlook.com
 [2a01:111:f400:fe16::62d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5eab9bbf-29ee-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 08:50:26 +0200 (CEST)
Received: from AS9PR04CA0142.eurprd04.prod.outlook.com (2603:10a6:20b:48a::16)
 by DB9PR08MB8412.eurprd08.prod.outlook.com (2603:10a6:10:3d4::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.31; Mon, 24 Jul
 2023 06:50:23 +0000
Received: from AM7EUR03FT010.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:48a:cafe::cf) by AS9PR04CA0142.outlook.office365.com
 (2603:10a6:20b:48a::16) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32 via Frontend
 Transport; Mon, 24 Jul 2023 06:50:23 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT010.mail.protection.outlook.com (100.127.141.22) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6631.24 via Frontend Transport; Mon, 24 Jul 2023 06:50:23 +0000
Received: ("Tessian outbound d7adc65d10b4:v145");
 Mon, 24 Jul 2023 06:50:23 +0000
Received: from 43e550a262ff.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 B74EBB81-2846-4C81-B082-763098EE1D35.1; 
 Mon, 24 Jul 2023 06:50:17 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 43e550a262ff.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Mon, 24 Jul 2023 06:50:17 +0000
Received: from AS8PR08MB7696.eurprd08.prod.outlook.com (2603:10a6:20b:523::11)
 by PAXPR08MB6414.eurprd08.prod.outlook.com (2603:10a6:102:12e::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 06:50:14 +0000
Received: from AS8PR08MB7696.eurprd08.prod.outlook.com
 ([fe80::3861:1ade:9356:9970]) by AS8PR08MB7696.eurprd08.prod.outlook.com
 ([fe80::3861:1ade:9356:9970%5]) with mapi id 15.20.6609.032; Mon, 24 Jul 2023
 06:50:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5eab9bbf-29ee-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4MWTvK4cXoXTqOD6z+TKn5FtkR+lyXrGPsYcVAk9icg=;
 b=RzxZMMLzAevTLm1Sk26aBQextVZlVB9tfTQi7uuD9qQskIPEDEndIpzXoPcKypXVVonHvW9ZfpkQr9TKGmaI/ZKceyrh4IU0DiKC932DQ77AikmXeQKJfZebzzCR6eJNzxDMId2FuGdP1VcyneDtO9AJDHQSbshiM7K1sYnUyqQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 93eab6fd8eca6c78
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=d9cU/4B6BQoN/Tw7qUo3PIGW/aAy0VpqPtnrDuTw47+2Bzyz8fppMMg34myBDZnHpO/2A5QA3XCM3lK5mCgP+vl1T+JYBhWqHJsq4I5xmKKwGEotxxG0dOXNC7VHg8Yv7dcws4IHEpkMmB+pTapEdmXiz8iIb+7PcL/9TxKS96hsmRdYMfnZ6eefMIIZCMdlwivXylkcsoULUYJHVvj8NiyO/i5q4e+b+1ivjetCryItR7DQAAhfQHhXNEB273kKpBvMoMijUHOwD2a1APXEb7s+quMQctZYI0H+ccXkBlfMa7e1EFhTHiRft9LY4iX9uBXMP3CLD6sZS5LG5ZPzbg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4MWTvK4cXoXTqOD6z+TKn5FtkR+lyXrGPsYcVAk9icg=;
 b=BSbPP0/9dF5+yGtBZm4gkhuzqdRWkHRAhAZiC3GA8GFGESTGaPHWpyc3Sf6hue4tb6gePWiNKnkFosO4ZC2Q07bcmOnva9XYkCWdD7zwDPMzpaBwv9QlExiITyPmVsTX4zbSvBE4LeD0jgHNVMOdVPdmAsYnsAlLQT0qH27ThJsA0FzgkfU7vMgIV+et95HfBQrL0+57pta8U3HHUTpX3YbAI2Lo6CVGzeyQCqu70Zf7SEusJSlEkOcgDa9M7WSSIg1IaSyAEE/ZqQyvjlcHwk179q9KSM4xVRgohhQGiPh22Rw7A3GoGGS3fYWxcuCb97ek2WH0YegbXmnVzI3CFA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4MWTvK4cXoXTqOD6z+TKn5FtkR+lyXrGPsYcVAk9icg=;
 b=RzxZMMLzAevTLm1Sk26aBQextVZlVB9tfTQi7uuD9qQskIPEDEndIpzXoPcKypXVVonHvW9ZfpkQr9TKGmaI/ZKceyrh4IU0DiKC932DQ77AikmXeQKJfZebzzCR6eJNzxDMId2FuGdP1VcyneDtO9AJDHQSbshiM7K1sYnUyqQ=
From: Jiamei Xie <Jiamei.Xie@arm.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v5 4/4] automation: Add smoke test for ppc64le
Thread-Topic: [PATCH v5 4/4] automation: Add smoke test for ppc64le
Thread-Index: AQHZu/VFj0fTwFpDzE2sBWfiN/Fdba/JAe4A
Date: Mon, 24 Jul 2023 06:50:13 +0000
Message-ID: <b0a9d83b-42de-c2cc-bbb1-642ba95af31d@arm.com>
References: <cover.1689958538.git.sanastasio@raptorengineering.com>
 <ade2e58251c506e4576424082623d9b232a435f9.1689958538.git.sanastasio@raptorengineering.com>
In-Reply-To:
 <ade2e58251c506e4576424082623d9b232a435f9.1689958538.git.sanastasio@raptorengineering.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
x-ms-exchange-imapappendstamp: AS8PR08MB8369.eurprd08.prod.outlook.com
 (15.20.6609.010)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-traffictypediagnostic:
	AS8PR08MB7696:EE_|PAXPR08MB6414:EE_|AM7EUR03FT010:EE_|DB9PR08MB8412:EE_
X-MS-Office365-Filtering-Correlation-Id: 2dbd1d24-70b0-4653-d425-08db8c124146
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 hkXBfziRQXPYPdgfm/GY2FkjoCJyPWdwxuZ4bvoAT3dATccIeja6PQFOQAvfl2a41TUVfp20sEJ0pGyAt+CDKTjvcvpPDRmCsTEvJdDo3NLw2FcpVHcc70XEMv5jTU0mEzYmx6zG55VOMG3163EjStcnOTVFGpGCRFjEgQ6tUlC44SM8OFFPeNG3C1e3NQDMMXobO8alar0MOD2NH+HD+E1vTJrKhqoHF138nkNyoZm8ubBbJGVHULxOusRlskpkzhVsQP4IMC1ONPLRDlwQ2enyJuD6Am2zGmD05Qp3mG9xh0Pau5cSUcW1C2/15FWzQysaBNOFbNtBnQh1Ii0Wx8ll5aH/PzRzdx/qrYd8z2G2W1TwDXLk9NJy3qiFXS3deAgxNNCbWrzHk9RUA9JLSOqRYgyr4KNeZuOxvE6N0nWxwjw2s/jp96VnY7JprE88UJMzkcvCjIlbxb0r7uj6uI7ZOME2e0eQPoylq5O/IJtB/SgvjiKvXw/u46g0/E2uM/DeBLBokHP4srFlieBKNJBSIhyc/TNaqjyRKGqix9i1Ccsp2JoGp2Tx9gMJo+Jhk6zqYvL1NWgJ1dtnKBn1noIrndHyZmznToD5RTRXfFIfdyCC0BtslUC9+KvWTkxK5/MO2IMhgFv6tItyUZsDbvgPIm0Bl4PCQAVG+EdD7l5QVRf/+ZBcKwAb/0QRy4eb
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB7696.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(366004)(376002)(136003)(396003)(451199021)(38070700005)(76116006)(66946007)(66446008)(64756008)(66476007)(66556008)(6916009)(316002)(478600001)(38100700002)(6486002)(6512007)(41300700001)(71200400001)(31686004)(36756003)(8676002)(8936002)(6506007)(53546011)(186003)(26005)(5660300002)(44832011)(31696002)(86362001)(2616005)(4744005)(2906002)(122000001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: multipart/alternative;
	boundary="_000_b0a9d83b42dec2ccbbb1642ba95af31darmcom_"
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6414
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT010.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	6a183a51-327a-462f-e40b-08db8c123b7b
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Fk4QaIo736S+MwsaSRQgXSK6qxUa/oZ+mjAXIo0pTNcM7u6/cXOii1lPyPcASg3ICA8cGaq0xWsWZPjnxcUs/ofs4mkaMnwfNp+NFxijSWU+lTk3j41ZtL40/D+vXVmp31OwAZCDBbtYr9gvDXnlD6DsQ0fjAPkqeKRwQTpZEJP2J4AVOQgDaDoRKfmBOkh56I6BMHvJ9mUwuTEkBujrAfh2n1+8ONLSZSCLVdI9R9iNoGnwjkm6w1eHZ7z4/bXv3B3azwpOG9tpXIUN1lKPsAbNPdEanuF3I5T0V8d1dyTqx6HGIyay3Ywf+hp51fINx0coywpskEtoXZB0fP/5HVZGqH44syUriUgAzVvcWRbrZQpO0KwryUKZI/i5iP/0O7bO/tE5wgKlEWpfR7lrkrYGjfKCfuj0GK8bd0VB3milmVSf+u1IXttk1YSSODC4/7WBmcJE7MyP/HmKUMz+dPWmd08mkTOtrpR2c2bR2Z26wdck2VK1HEm4T47im0WIK3hJhW1xHEjMQkO9YQnSXKRzI7NXGR8MyH5AtQ/qpFXp1pp1bi2jpSKGq8MxDq+72EYn/AzvIUj0KhCif3nR1iZtSzAEUoIYpzr3+uNzZoAqXU91H1A9vw+AzrNZgO0w/BwMlIghxE3YINC9cNFvzqcgZayiK7bnt1+7jd7gkhZOOCH3KoKqw7avSgr30aXHa/StwBI1hINmDUs2xBjsYIOA+Cvo2bsIWMH9cnLo6GYTLdTOB4LDAte7LPXHaMq7LNnIMHXkfw4/C5F8/iAYRw==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(136003)(39860400002)(396003)(82310400008)(451199021)(46966006)(40470700004)(36840700001)(31686004)(8936002)(5660300002)(8676002)(41300700001)(316002)(2906002)(70206006)(70586007)(40460700003)(36860700001)(26005)(53546011)(6506007)(40480700001)(47076005)(31696002)(6512007)(86362001)(6916009)(478600001)(6486002)(82740400003)(2616005)(81166007)(356005)(36756003)(336012)(186003)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 06:50:23.4893
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 2dbd1d24-70b0-4653-d425-08db8c124146
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT010.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8412

--_000_b0a9d83b42dec2ccbbb1642ba95af31darmcom_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable


On 2023/7/22 01:02, Shawn Anastasio wrote:

Add an initial smoke test that boots xen on a ppc64/pseries machine and

checks for a magic string. Based on the riscv smoke test.



Eventually the powernv9 (POWER9 bare metal) machine type will want to be

tested as well, but for now we only boot on pseries.



Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com><mailto:sa=
nastasio@raptorengineering.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org><mailto:sstabellini=
@kernel.org>
Reviewed-by: Jiamei Xie <jiamei.xie@arm.com<mailto:jiamei.xie@arm.com>>

--_000_b0a9d83b42dec2ccbbb1642ba95af31darmcom_
Content-Type: text/html; charset="us-ascii"
Content-ID: <D0CAC34CF9C1904E85268135F7AB6B73@arm.com>
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:w=3D"urn:sc=
hemas-microsoft-com:office:word" xmlns:m=3D"http://schemas.microsoft.com/of=
fice/2004/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:DengXian;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
	{font-family:"Roboto Mono";
	panose-1:0 0 0 9 0 0 0 0 0 0;}
@font-face
	{font-family:"\@DengXian";
	panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
pre
	{mso-style-priority:99;
	mso-style-link:"HTML Preformatted Char";
	margin:0cm;
	font-size:10.0pt;
	font-family:"Courier New";}
span.HTMLPreformattedChar
	{mso-style-name:"HTML Preformatted Char";
	mso-style-priority:99;
	mso-style-link:"HTML Preformatted";
	font-family:"Consolas",serif;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;
	mso-ligatures:none;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style>
</head>
<body lang=3D"en-CN" link=3D"blue" vlink=3D"purple" style=3D"word-wrap:brea=
k-word">
<div class=3D"WordSection1">
<p><o:p>&nbsp;</o:p></p>
<div>
<p class=3D"MsoNormal">On 2023/7/22 01:02, Shawn Anastasio wrote:<o:p></o:p=
></p>
</div>
<blockquote style=3D"margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Add an initial smoke test that boots xen on a ppc64/pseries machine an=
d</pre>
<pre>checks for a magic string. Based on the riscv smoke test.</pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Eventually the powernv9 (POWER9 bare metal) machine type will want to =
be</pre>
<pre>tested as well, but for now we only boot on pseries.</pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Signed-off-by: Shawn Anastasio <a href=3D"mailto:sanastasio@raptorengi=
neering.com">&lt;sanastasio@raptorengineering.com&gt;</a></pre>
<pre>Reviewed-by: Stefano Stabellini <a href=3D"mailto:sstabellini@kernel.o=
rg">&lt;sstabellini@kernel.org&gt;</a></pre>
</blockquote>
<p class=3D"MsoNormal">Reviewed-by: <span style=3D"font-family:&quot;Roboto=
 Mono&quot;;color:#212121">
Jiamei Xie &lt;</span><a href=3D"mailto:jiamei.xie@arm.com" target=3D"_blan=
k"><span style=3D"font-family:&quot;Roboto Mono&quot;;border:none windowtex=
t 1.0pt;padding:0cm">jiamei.xie@arm.com</span></a><span style=3D"font-famil=
y:&quot;Roboto Mono&quot;;color:#212121">&gt;</span>
<o:p></o:p></p>
</div>
</body>
</html>

--_000_b0a9d83b42dec2ccbbb1642ba95af31darmcom_--


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 07:11:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 07:11:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568429.887723 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNpiW-0005Du-OB; Mon, 24 Jul 2023 07:10:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568429.887723; Mon, 24 Jul 2023 07:10:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNpiW-0005Dn-Kv; Mon, 24 Jul 2023 07:10:52 +0000
Received: by outflank-mailman (input) for mailman id 568429;
 Mon, 24 Jul 2023 07:10:51 +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 <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNpiV-0005Dh-62
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 07:10:51 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 36731c15-29f1-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 09:10:47 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id CE43E20530;
 Mon, 24 Jul 2023 07:10:46 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A9AD613476;
 Mon, 24 Jul 2023 07:10:46 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id ADr0J/YjvmQUWQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 07:10:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 36731c15-29f1-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690182646; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=wGdw6L5Irrk6yDag1TxdszPFdNtqQWzSzOQrMRNBAII=;
	b=XxcGcqdhLkC56COgT9o59x+tqEcBccxap511qXiZcKReapDeeAuOQ4bQdM334BcUWHNsU/
	F/0etLLgDQVCVDMTz6MJpTbNhT6Gxn7yIR/6mxTDWO55ir+Uxz92Ex1Sz41mQBbeQfssBV
	m1L2HcDTzDYO6zjoQNVuxuH82Jsy9E8=
Message-ID: <2fca0a55-3cbf-1875-62c9-2d27cbdd5f20@suse.com>
Date: Mon, 24 Jul 2023 09:10:46 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v2 1/2] tools/xenstore: add const to the return type of
 canonicalize()
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230722081646.4136-1-jgross@suse.com>
 <20230722081646.4136-2-jgross@suse.com>
 <adc0b17a-1d59-8c52-8823-64a0d9ec475b@xen.org>
 <e374c950-7dce-2e28-3b4c-946f4a0a2aec@xen.org>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <e374c950-7dce-2e28-3b4c-946f4a0a2aec@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------ALdJADnA5JcckD5BJtzooL08"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------ALdJADnA5JcckD5BJtzooL08
Content-Type: multipart/mixed; boundary="------------gUdvVkpBSt90FpA0yWG8Zspm";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <2fca0a55-3cbf-1875-62c9-2d27cbdd5f20@suse.com>
Subject: Re: [PATCH v2 1/2] tools/xenstore: add const to the return type of
 canonicalize()
References: <20230722081646.4136-1-jgross@suse.com>
 <20230722081646.4136-2-jgross@suse.com>
 <adc0b17a-1d59-8c52-8823-64a0d9ec475b@xen.org>
 <e374c950-7dce-2e28-3b4c-946f4a0a2aec@xen.org>
In-Reply-To: <e374c950-7dce-2e28-3b4c-946f4a0a2aec@xen.org>

--------------gUdvVkpBSt90FpA0yWG8Zspm
Content-Type: multipart/mixed; boundary="------------EIDVkL9Fplmbhrcus0FK050z"

--------------EIDVkL9Fplmbhrcus0FK050z
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjIuMDcuMjMgMTg6NDQsIEp1bGllbiBHcmFsbCB3cm90ZToNCj4gDQo+IA0KPiBPbiAy
Mi8wNy8yMDIzIDE2OjIwLCBKdWxpZW4gR3JhbGwgd3JvdGU6DQo+PiBIaSBKdWVyZ2VuLA0K
Pj4NCj4+IE9uIDIyLzA3LzIwMjMgMDk6MTYsIEp1ZXJnZW4gR3Jvc3Mgd3JvdGU6DQo+Pj4g
LXN0YXRpYyBzdHJ1Y3Qgd2F0Y2ggKmFkZF93YXRjaChzdHJ1Y3QgY29ubmVjdGlvbiAqY29u
biwgY2hhciAqcGF0aCwgY2hhciANCj4+PiAqdG9rZW4sDQo+Pj4gLcKgwqDCoMKgwqDCoMKg
wqDCoMKgwqDCoMKgwqDCoMKgwqDCoCBib29sIHJlbGF0aXZlLCBib29sIG5vX3F1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gPSBjaGVja193YXRjaF9wYXRoKGNvbm4sIGN0eCwgJnBhdGgsICZyZWxhdGl2ZSk7
DQo+Pg0KPj4gwqBGcm9tIG15IHVuZGVyc3RhbmRpbmcsIGNoZWNrX3dhdGNoX3BhdGgoKSBj
b3VsZCB1cGRhdGUgdmVjWzBdIHdoaWNoIGlzIHRoZW4gDQo+PiB1c2VkIGJlbG93LiBCdXQg
d2l0aCB5b3VyIGNoYW5nZSwgdmVjWzBdIHdvdWxkIG5vdCBiZSB1cGRhdGVkIGFueW1vcmUu
DQo+Pg0KPj4gSSBjYW4gc2VlIHR3byBwb3NzaWJsZSBhcHByb2FjaDoNCj4+IMKgwqDCoCAx
KSBnZXRfc3RyaW5ncygpIGlzIHRha2luZyBhIGNvbnN0IGFzIHdlbGwNCj4gDQo+IEkgaGF2
ZSBhIHBhdGNoIGRvaW5nIHRoaXMuIEkgd2lsbCBzZW5kIGl0IG9uIE1vbmRheS4NCg0KSG1t
LCBsb29raW5nIGF0IHRoaXMgSSB0aGluayB0aGlzIHdpbGwgY29sbGlkZSB3aXRoIG15IHBh
dGNoLg0KDQpXb3VsZCB5b3UgbWluZCBtZSBkb2luZyB0aGUgY29udmVyc2lvbiBvZiBnZXRf
c3RyaW5ncygpIGluIG15IHBhdGNoLCB0b28/DQoNCg0KSnVlcmdlbg0K
--------------EIDVkL9Fplmbhrcus0FK050z
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLE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gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------EIDVkL9Fplmbhrcus0FK050z--

--------------gUdvVkpBSt90FpA0yWG8Zspm--

--------------ALdJADnA5JcckD5BJtzooL08
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmS+I/YFAwAAAAAACgkQsN6d1ii/Ey+i
4Qf5AZhtQG4lY/SvKx1DeFWNRz0LjPXYLNw3cE265hQMjKNbpaPZ75dvbbp6MLK2x4VLyKVnTQdj
JQxEEp1zRQhbUOYGtgBuDlizTa62ZgbtylsgUalI2IcPmgd1oFnrdT++Lqwa0m5So5cLRDrDfBr7
RgnbZcoXSP7mveAenDV9Aa+ZbfZX7i02fdx0weWTQ/5MAFt4Ny5giJqpCputTBcQDtscrNQ9lBpv
z1pAZhhpdk9REnRGxiIszrjRTmJ2/6MwyBf4Es/QLwuAPpai5r+XVtQQS9nRK2DVxvFbixtRtey7
4CpE0zbw+H4ydTPco7Rl9eNECfzwmN0SdGME4/JFjQ==
=ahRt
-----END PGP SIGNATURE-----

--------------ALdJADnA5JcckD5BJtzooL08--


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 07:39:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 07:39:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568438.887733 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqA0-0007ow-Sw; Mon, 24 Jul 2023 07:39:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568438.887733; Mon, 24 Jul 2023 07:39:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqA0-0007op-PR; Mon, 24 Jul 2023 07:39:16 +0000
Received: by outflank-mailman (input) for mailman id 568438;
 Mon, 24 Jul 2023 07:39:14 +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 <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNq9y-0007oj-KD
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 07:39:14 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2081.outbound.protection.outlook.com [40.107.7.81])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2eb2bc2c-29f5-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 09:39:12 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8127.eurprd04.prod.outlook.com (2603:10a6:102:1c5::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.31; Mon, 24 Jul
 2023 07:38:43 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 07:38:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2eb2bc2c-29f5-11ee-8612-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=fS1mpoLr3PUVmGwf/hCxdMpEJZ5wFikkVTvzx4g7lEK9wfhdWQfx0GoMBgz7hyXs14d48yj3vnFISP910VNjI9eJWAvVGVt+MlZ0FwLuI4wlafHsP+JOCamO/Lo7YdwSaTunU5MbQstvLxFGpEJv6JWnAW+Xo8gsZOOejDWdDJ7a4utKm8kKPOQzxYzg6mnPlnZfBt3PfMHJo5eicVBmxOOtNZi0Tk6mkyVTnyWUTToFKEPkapMzFf0fC1R9BswUIzdkM95pDpMBDvza8+I9ztoTkloIq8UqsdwHB4Q8LoETXfV2o0EGHqe4IndIIsohavUdpcIAU0O+u3MAE5HRiQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=QTIIpgwVvHHIZYt3iPjkDifdMjpGToXo7N7VZ91BylM=;
 b=oVtz7GA8qkwgbPRQ0YTJBeXGRuK2kR9Z8ACl3s8Lreawn4/s+bFeldjaCOtZZFWIMU4NerfKgrNjNnZignfzVi6Ov6QHhCkR50659tqZNNtxDsWYFknRZ7FZfy+KRaoFh9caZHvstKBvs0I9om20VUEsrJdh3R1IMQuvkk/Ntj14dkzs7GLcSyCKCjlHI9y1vAiL5R3XWTZX0BPcy4JCNv7x1uytwSxNZJ3JROHh+Pf2YFJCm6g9DFDfnLcR0mdmHzf53SOySuqqC1uslgFFRMIyBYnyjzyqGdrgG/VHWYSvieSTaKDS4q6y84sRmpuqVNNXlFcHfXONnSnXmflnZA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QTIIpgwVvHHIZYt3iPjkDifdMjpGToXo7N7VZ91BylM=;
 b=TgfxS8bnGU/VLZH9uAjCrKkzEt34i0rQtIwooCWqXllSLVTWgh212LmdzM9DA/dCfCqPnQQIs2sd0kxlxl+WVjp3BMIGfiCGDF8xLnK3NYZkCHmw0tHtwG6wpL7yxXRYozS5KvO3Wdb6YveeNNRne7OnG6eb4h0NUnvtQNvIREppVmLizsigA3g8OYmFQi3oNivCb0mr9kkyyYlxmqpzOME4kRTtF1X1nR4H3pTqdW9w39aMa9Y1diiI4QTNpY1Ewg+q8rvJWyErKWsvUyYcV6X0JBsrIIma3xvYg/nozdomvMlM5eZn51EWE8wkVSRFXIYOTLwr0Gqw8fWs9D7S5w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <733ddfc7-3530-3d73-a1de-9b29132a8a72@suse.com>
Date: Mon, 24 Jul 2023 09:38:43 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v4 3/4] xen/ppc: Implement early serial printk on pseries
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1689710519.git.sanastasio@raptorengineering.com>
 <7c416ff843ea359bb24b8c954cc079fe1bbaf75f.1689710519.git.sanastasio@raptorengineering.com>
 <6d3b7cd6-7d6a-8d28-f1e7-7e939e393445@suse.com>
 <a7f89b3b-bcd1-6844-b836-40b73a9fa3b0@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <a7f89b3b-bcd1-6844-b836-40b73a9fa3b0@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0005.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8127:EE_
X-MS-Office365-Filtering-Correlation-Id: cf021001-18f4-400f-660c-08db8c19017a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	aoG1x23GVRFvtEiOwFM/+5f0zX0BCPl1cVzy7zMo6ubAkVqQorCAr+Wfkpqo404J8SD8nnUGa1T9bdEporwD10CZvfR543VYRnzCJnCiIjDk/lRTVDNEUPYF3N8oPrBhVzLH6bAvAAJP7AND55VrHoMdcB3UkrgKaBgLPlLl+BQqMGNajFcSjByY5nLYVVnzbeArR3S1v2eVeMNm6GFDtRmaJc2VPwSM1r+7mlDiUDCF552K/zrCY1+KI6zz86A/09zAR0GbgbvXXRTTdiz1tZNWaqKIev3zu8LSuQMfzVihGOYRjA3zPlyGjaPkzdOhyBpfv7LEiAXOi26HesVWBQmL5OFVUX+OIwdg3FwOfLlcFvZbjHuKE5x67p9v8vdqHNQ8T2MpA99MrDf2SCcPgNRTdLUV46WD0btrJEbBmx44OQ23QiC8GbtE3Au0MeerhUZF5NtxG8BNID0Sdduh5q8JOTOClIlCf5ysBd2FqhWkhlFZavwZANTWvXnoSlTL1ZfW40YV1PPppm5mYRSSbxb9YvLhk1zgoOEjFlYXvNo3ebuHWRHaEuwPWvAgljXWAdZ2CGuicsdZHeI70/dda//i7QXRApS1Bo6gdIbTFNHPzfGBLGzGKBJmFHcpBejAyTlj2jfPMuBwOf7ijXWeTw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(136003)(376002)(39860400002)(396003)(346002)(451199021)(31686004)(86362001)(31696002)(38100700002)(6916009)(66476007)(66556008)(478600001)(54906003)(66946007)(41300700001)(316002)(8936002)(5660300002)(8676002)(6486002)(6512007)(2906002)(26005)(6506007)(186003)(4326008)(83380400001)(36756003)(53546011)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MThIcDl3dHA0Mm9zMUp3TjZNNnllTnRXUkJCc2t0cUJOUzFpTVZCNHRENmdm?=
 =?utf-8?B?UUZ4eGRRb0d0bE1LTklhTFRoU296QnNad3RFRDkvUCsyY0J1RjZjOGZPRUU1?=
 =?utf-8?B?T3EzdTU5cDhEaVhIS1U1cTBMUlQ5dXJ1WmFQRnNta3dKVU5HbXExNDUzNTNN?=
 =?utf-8?B?Znd6VnBRSElxVDA4KzNsU3FveUt6VktrdXJFRkc0MzIyZk5wWWs4L292RmlW?=
 =?utf-8?B?TTJ3cm9zV1VIM05DelN4WTdkWXk1aWRPL0VYYXFCNXZSdzBISjFmQUMralUr?=
 =?utf-8?B?OGQ0TnVVdC9IWll4ZDhubzBqOWlha3FnN1NUWDI4VXBpbXlWS0U5OVI4aG15?=
 =?utf-8?B?VjFrSEh1ZUZnVUlvSElhVUVqOGhPU2plWnBQQUpwNll5SzF3LzFNQ0pGUXlT?=
 =?utf-8?B?RmNkdzZkNWJud3UvZlJHSGlhblBoZFFXdkRBMlFDL2JrZmM4WTVYdGNKMjRq?=
 =?utf-8?B?dVIzQU5UUkovQmNiVkJzeTFtKzU4azhvaHhaaGpycmJlSmZhdThuWjBXODJU?=
 =?utf-8?B?VE9wVC84NCtJMmE0SmpNb1pmeUdRKzZ3OWI3SzQ0L2VudzYrNHJnaE1yRWRU?=
 =?utf-8?B?ekRZTkEvS0NmaWxNQnduZ1NUQ2ZzODBQSW5QMTJkS2FjaEE3cXRYS3Z0NFVl?=
 =?utf-8?B?NG13R3dxeUFRbG93Z2ZRYkZzSTUzOVRjbmk0M2cxWDlSaGNzRUVxZUZnWDRp?=
 =?utf-8?B?MlR1eDZtUWtFSFlWZ0k0NDVBWC9LMG52bGtK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f-8?B?TmQxL2F6RWJHblNXVmF1cjFyZ2dqL3pGUWtMOXFlWFJkWHY4c1lBYjFNR3VB?=
 =?utf-8?B?cHcvRm1qSXhDQ2xXem5tWUxjdlkxOHJzRUJXcERlWlo3RkxXb0VkcngrakN3?=
 =?utf-8?B?aEdTUWRwOXhVQkhGOWRxYjVYUStJVVhXelMvWGhaUExMUXVMOTI5dVNnL3Ba?=
 =?utf-8?B?cXlmWGxOT2xDbFBzajYwNHRpbDJYVmlDRENINTNWVFo5QjVWaU12Y1JZQjE0?=
 =?utf-8?B?NTVqdEpGbDdRUld6YnhmNlhROVlJY1ZhWnY0UTRkM1BiajlSZ1hSSStmRUdy?=
 =?utf-8?B?VkU1b1pOMTNmTDBTTFI5eitVVjhEQ2ZwcVh2bytONWRKSUVqTGRhNkVOc1RN?=
 =?utf-8?B?RUdxOUVYMnVsVEpDbFkyRGordFprWDlvUVd6OWxyU0o3Sk5NRlo3K3l2QTA0?=
 =?utf-8?B?UHBDckRJa0xTU0Izd3JMNXBTTXNoUk1qQS9NcWhUVHVsR0doaE9ZUmdZTHdx?=
 =?utf-8?Q?m+FHYrnklo5DlEjq2duXI6/FP?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: cf021001-18f4-400f-660c-08db8c19017a
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 07:38:43.1073
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 83ECEcv9gUps74JLQroSmTucQ2Gk6xIg9vVgiPmm0LrsEqVHYpiK30j8uArQupwNrnwEGaE+mFjj66xeMcn5Hw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8127

On 21.07.2023 18:53, Shawn Anastasio wrote:
> On 7/19/23 9:05 AM, Jan Beulich wrote:
>> On 18.07.2023 22:20, Shawn Anastasio wrote:
>>> +void __init boot_of_init(unsigned long vec)
>>> +{
>>> +    int bof_chosen;
>>> +
>>> +    of_vec = vec;
>>> +
>>> +    /* Get a handle to the default console */
>>> +    bof_chosen = of_finddevice("/chosen");
>>> +    of_getprop(bof_chosen, "stdout", &of_out, sizeof(of_out));
>>> +    of_out = be32_to_cpu(of_out);
>>
>> Can any of these fail, and hence lead to ...
> 
> These calls are allowed to fail, but their return value in those cases
> is well-defined (an invalid handle), so...
> 
>>
>>> +    early_printk_init(of_putchar);
>>
>> ... this better not getting invoked?
> 
> this being invoked is fine even in those cases. It will just result in
> the invalid handle being passed to of_write and the firmware will refuse
> to service the writes.

I assumed all this to be the case; the question was more towards "Wouldn't
it make sense to avoid installing the function pointer in such a case?"

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 07:47:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 07:47:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568440.887743 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqHM-0000rQ-LT; Mon, 24 Jul 2023 07:46:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568440.887743; Mon, 24 Jul 2023 07:46:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqHM-0000rJ-Ij; Mon, 24 Jul 2023 07:46:52 +0000
Received: by outflank-mailman (input) for mailman id 568440;
 Mon, 24 Jul 2023 07:46:51 +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
 <SRS0=ixEc=DK=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qNqHL-0000rD-Sd
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 07:46:51 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3e50ff9a-29f6-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 09:46:48 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.162.140.144])
 by support.bugseng.com (Postfix) with ESMTPSA id DFBA84EE0737;
 Mon, 24 Jul 2023 09:46:46 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3e50ff9a-29f6-11ee-8612-37d641c3527e
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [XEN PATCH v2] xen/arm/atomic: change parameter name in atomic_cmpxchg() definition
Date: Mon, 24 Jul 2023 09:44:42 +0200
Message-Id: <a45f6a84f3c50a694e0f55042ef1b2f9ad9ac57d.1690184136.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Change parameter name from 'ptr' to 'v' in the function definition thus
addressing violations of MISRA C:2012 Rule 8.3: "All declarations of an
object or function shall use the same names and type qualifiers".

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
Changes in v2:
  - added arm tag;
  - propagated change to arm32.
---
 xen/arch/arm/include/asm/arm32/atomic.h | 8 ++++----
 xen/arch/arm/include/asm/arm64/atomic.h | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/include/asm/arm32/atomic.h b/xen/arch/arm/include/asm/arm32/atomic.h
index 2832a72792..33f9e73b19 100644
--- a/xen/arch/arm/include/asm/arm32/atomic.h
+++ b/xen/arch/arm/include/asm/arm32/atomic.h
@@ -113,13 +113,13 @@ static inline void atomic_and(int m, atomic_t *v)
 	: "cc");
 }
 
-static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
+static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
 {
 	int oldval;
 	unsigned long res;
 
 	smp_mb();
-	prefetchw(&ptr->counter);
+	prefetchw(&v->counter);
 
 	do {
 		__asm__ __volatile__("@ atomic_cmpxchg\n"
@@ -127,8 +127,8 @@ static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
 		"mov	%0, #0\n"
 		"teq	%1, %4\n"
 		"strexeq %0, %5, [%3]\n"
-		    : "=&r" (res), "=&r" (oldval), "+Qo" (ptr->counter)
-		    : "r" (&ptr->counter), "Ir" (old), "r" (new)
+		    : "=&r" (res), "=&r" (oldval), "+Qo" (v->counter)
+		    : "r" (&v->counter), "Ir" (old), "r" (new)
 		    : "cc");
 	} while (res);
 
diff --git a/xen/arch/arm/include/asm/arm64/atomic.h b/xen/arch/arm/include/asm/arm64/atomic.h
index 2d42567866..4460165295 100644
--- a/xen/arch/arm/include/asm/arm64/atomic.h
+++ b/xen/arch/arm/include/asm/arm64/atomic.h
@@ -105,7 +105,7 @@ static inline void atomic_and(int m, atomic_t *v)
 	: "Ir" (m));
 }
 
-static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
+static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
 {
 	unsigned long tmp;
 	int oldval;
@@ -119,7 +119,7 @@ static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
 "	stxr	%w0, %w4, %2\n"
 "	cbnz	%w0, 1b\n"
 "2:"
-	: "=&r" (tmp), "=&r" (oldval), "+Q" (ptr->counter)
+	: "=&r" (tmp), "=&r" (oldval), "+Q" (v->counter)
 	: "Ir" (old), "r" (new)
 	: "cc");
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 07:59:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 07:59:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568449.887752 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqT5-0002PK-Ll; Mon, 24 Jul 2023 07:58:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568449.887752; Mon, 24 Jul 2023 07:58:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqT5-0002PD-Ix; Mon, 24 Jul 2023 07:58:59 +0000
Received: by outflank-mailman (input) for mailman id 568449;
 Mon, 24 Jul 2023 07:58: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 <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNqT4-0002P5-Cs
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 07:58:58 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2060b.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::60b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f01cf6b9-29f7-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 09:58:56 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM8PR04MB7779.eurprd04.prod.outlook.com (2603:10a6:20b:24b::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 07:58:53 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 07:58:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f01cf6b9-29f7-11ee-8612-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=WK4xZKRn0jGB5hYodtgi5okDVSTqs+rxKfpM0PqTvMffpa3ptuNzut6+hGD09hS5f6uigd1P08z49mlPcjgWcfsQI8Hb3Eax1X0clNQtCuAQMf1d6KjHFASAG/7ZOVHpUHRAPMXkrd0NPbGGxWJJt2RUjCDbg9WBTk3spg9csNxq1OaAzNbNBPGFxW3Mv41xOAtO5BlgXSbUmJnNQb6AxfAuNSXrXIrQZshvk8BdV36kjFcy/xLWWiGEJTQww/EoLSz6g4b5Wh5l3feqY/55n1hclR0hLSnn+BEWeu9Wc5HLPRjeHl25SzRbWw+koxH56B5Ji7XciQloPibVA9wIyQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=cN3Jw4oiH4w+BEpS9e/0FrURZq8qnYMOGOW8nATvJxY=;
 b=b5xHTQG5VMbg2l879Xp03x5tfVhJ/FyYU9Ymgu1mJZLfbT7ffHc+qyq1Xz9WNPcCW18aMOB4L81Yw+ZE/zl1+uih79i0IL802T1+GzoDqUJjr3HfQlRSLKiE3iHv+ijzBC/L/7+0CVA5UzwtVmeCcNeCBIsuwNNEfhhxQKfGbtNgFfcvKE8+bq8V5HruHw3iQg0Gyfqc+o5Df65SUZnPmZQ9AA06PdRqK7pEF/K022ur5WsNiIq/Xn9KaVaCv6e1OUHNtrKKHq4aLkifEFIjby0LPb7MUl7rESssQc8ZxbWzza50LqSXAYMfwRUibIGk0TZdSDMXd+QHaDAXL3QqYg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=cN3Jw4oiH4w+BEpS9e/0FrURZq8qnYMOGOW8nATvJxY=;
 b=WmGecoBvvf8JtEe0g7unaIbjt6NE7IrKtB7hlyi5/MEuUJoL8LHnj+Oj4CR5N2gvlFaIi75uJiRddP9gXL354zyG7+SkFP95TqDtwAI6kVhhi/o+BYCmdhE+T9docixbk1+htUa8HaHkUEJEqtxkC1y6PWLahGSIkHTA5DcqKlUEOJJjatJxz+X6tB7HaI3rvgnNuDSaFOVJ5C0sgzK/pe/e1YnjRkQNSVhWT7CUZPklg+b7Ywxml8V8wn31WZdbL/xVkDiy4KCH0vUFm4RyAysl4NnJ0gcqtq8kZrHwM5LVkG1YCbgRKDGSxXkd/Ss0lF0IQtEB9rrlLuHZ9/TroA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e079bb85-deb4-41a6-53fb-117e64f75340@suse.com>
Date: Mon, 24 Jul 2023 09:58:53 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] x86/cpu-policy: address violations of MISRA C:2012
 Rule 8.3 on parameter names
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>,
 Federico Serafini <federico.serafini@bugseng.com>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
References: <912cfe8f5b043bddc80cbf9f75cc0b35e02a6ecd.1689929894.git.federico.serafini@bugseng.com>
 <alpine.DEB.2.22.394.2307211539000.3118466@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307211539000.3118466@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0053.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:48::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM8PR04MB7779:EE_
X-MS-Office365-Filtering-Correlation-Id: 5627a191-d392-45e4-4ec1-08db8c1bd2ed
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	SkS/QVmd35lGBsZmLoUTLavPU8d1KbSGTuuIK4nd35CxXFyAyIXXllJbROEtocR9XojUkkF1Sp4DSj4/iMI9vRvhwjsmCSusuw5qsoeyU5o5KScJIzz+FXbR9DaGA4FJyZ/1xhf0pXAb+DVJq9P9ekcDmYFplD/5TPCc7VBzOcAFyvSxEP3UrWjhG9LCc7QHQR4IgZ7kBVXh9hqtDHtatGXbw4pDKbum6mEUrEfAC5L592m8SKA2nKvDRDspF5mFQQlgxmC3m7ms0WmzpfzBMO135CzkLptxJtvX/WIR7+vKPwiwoZmxCH8x2vdD/T3SC6fODKikQHT4fACBrtp0r7d3tiGd42Yjy730Z8WSSMYiKsxnGkZIZIQb0nKWwPaBuUCVJUAXZ+Qkt1Gh56j+42OAuc12ehSLGJI+mQE6r3QFgwKnmNifiWHyzNwG9UxVGIT1vXkzK6z/s7TvQFQQVxzKVocBKfnvw5ko0znpAdu09JOMoQvG+4q3EZXePS9WXWRb2YJdntKpaUfC81PZ3w6kD6aVFBG5O5ah8hx831VWa4h6XP2Ugx5pocsWauZJiFfohHopk3CGfNwgYan0hJjaGt9aG0+AQD2FQo76NDhFL1Vj6llw7SsnsB0Om02abpFeyFukDnSzfo1qLEu/uw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(366004)(396003)(39860400002)(136003)(451199021)(38100700002)(36756003)(53546011)(2616005)(7416002)(8936002)(8676002)(5660300002)(110136005)(54906003)(478600001)(66556008)(66476007)(4326008)(316002)(66946007)(41300700001)(186003)(26005)(6506007)(6512007)(6486002)(2906002)(4744005)(31696002)(31686004)(86362001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YXN2T1VoT216T0ErVDByVFlsenZyVkZTQ0l4dVptOVcrd0hSWmRnN3dwVllR?=
 =?utf-8?B?REkyajJqcVdMRkw0VHJwVEJyMW1HcWh4UGJqL2lIT1RDenViM21GeW04a29G?=
 =?utf-8?B?eXZRa0o2MGJRcFhoTkdPWi82Z29mbUg0bE4ycWx6M0dXUGpTY1J5Sk1jejAv?=
 =?utf-8?B?QUZjNmRYRzErZFJnL09ZRlJrdFZ0N2xTT0IrUENsSklORnV2eFZ2QU5qb0F0?=
 =?utf-8?B?cmlITldiS1I2L0l4eld3WVJMdjB6blc0RUxJQU4zeW1kUGZ6NnFEVDRJUjNQ?=
 =?utf-8?B?YjBDMGx0dVN1U2liVVBRdEhvR0tSMzZSbllNT3dXdWRSRjcycGRSaE42TXpl?=
 =?utf-8?B?cFQvVWp2MVYwRmhKZS81UnQxOHVLc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OUOLnxfNzJmlOy/yMujUn?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5627a191-d392-45e4-4ec1-08db8c1bd2ed
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 07:58:53.4904
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 6Gri2fmBFyHNCdEB/NtgoXk9b0Ve3bsfZoF1kuI04942Ujxg/EQiG32sH3vzLiJTEPQkEQhWm5+lM6KUDqUMCQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7779

On 22.07.2023 00:39, Stefano Stabellini wrote:
> On Fri, 21 Jul 2023, Federico Serafini wrote:
>> Change parameter names in function declarations to be consistent with
>> the ones used in the correponding definitions, thus addressing
>> violations of MISRA C:2012 Rule 8.3: "All declarations of an object or
>> function shall use the same names and type qualifiers".
>>
>> No functional changes.
>>
>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Mon Jul 24 08:00:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 08:00:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568452.887763 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqU7-0003b2-6c; Mon, 24 Jul 2023 08:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568452.887763; Mon, 24 Jul 2023 08:00:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqU7-0003aE-24; Mon, 24 Jul 2023 08:00:03 +0000
Received: by outflank-mailman (input) for mailman id 568452;
 Mon, 24 Jul 2023 08:00:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Klik=DK=citrix.com=prvs=5629c81f5=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qNqU5-00031X-4v
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 08:00:01 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 14e8770a-29f8-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 09:59:59 +0200 (CEST)
Received: from mail-co1nam11lp2170.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.170])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 24 Jul 2023 03:59:44 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by CH0PR03MB6067.namprd03.prod.outlook.com (2603:10b6:610:be::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.31; Mon, 24 Jul
 2023 07:59:39 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 07:59:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 14e8770a-29f8-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690185599;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=ozb/LOciiRr0V2+pVXwsrrI/mbphhPjs/tnGTLg+YQ0=;
  b=OhgitMfpUVPqRbKH98RM8c0Ytv947OjkDa1iHFcir68QGDBx3e0RxkBI
   +aQB5gWha8i2L8CeA786Y5aSWttn0jqhmDGJN8KoHo/9sGHOzb0QcnlMS
   GFlbH5pqkpjvRX0i3Q6FqBNDqUtAHUl1tDsWyr/UuFBhVZruBqgdygRzu
   I=;
X-IronPort-RemoteIP: 104.47.56.170
X-IronPort-MID: 117065135
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:owGraKIKRtPX1mAVFE+RApQlxSXFcZb7ZxGr2PjKsXjdYENSg2YGx
 zMeXWDQPq3ba2v1eoxxao609kkD7J7Xnd9hSAJlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws
 Jb5rta31GWNglaYCUpKr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;i="6.01,228,1684814400"; 
   d="scan'208";a="117065135"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=nl/jr+W21KIcHlgYxVU1jQNQX1aamXEUfU3GeD2w3d5sEGnz9gnUHuwEYpf+Zli9h3tC4S+fUGY+fyS7Gz+6zjF0K21t1D8CbDc8SMUU6Ec5Gd4EAtZnIUsYOEZAKAPew5lfqKWlYwdguvIDjQZv/Equ2UdH9qaywUvpTu+Wp8vqIH8c0XhuuqyLtIHfPHS+wAmI/r05BPn7F5tnla0VNSukVHZCMgEXMoworFvwup9mogKn8N25e0HLpcNhoPWxWRRKh8DjYuezW+La/qF1xsL9bMjG0+lH0GvTLC6/MQyNeryJaBuv/EAoz3zOIGsxqWdoU0mWMmDoBR5do90hsQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=fmbhP3f0LfUbMTQ/Yf3rDA9ENI6qRthzEso0M42rmeE=;
 b=W5dACPnqxkty0jhXKPzpZsM5XklOjhr5ML7xG45k79n6xbzLDq9YYA1UjOT8xJARu4vvvIgUgTpiBRgm5puZot0GWqU93YYNUZqjQZ+yreN5eJuZBvlT/9bLHHDFxdnNhvRhNPt9GV2DxhsRlInYWzNqVWzVhAdQP1lzrJsRo/1DGbQM53NsO0V314u6IqKqbgK/3UaxaFXNRLYpqSU88FHmQgYmxDrT2i3911MsSThEtrhXS4y0I8RaektxL6SgkzxZDLRCLNyA5gDMJpwdoeVrf9hnAyKv1KOkV45zkUbfrKVYnKBCLsi0DATtPAw+lVVpTFmzlad9Zu0+et9+Nw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fmbhP3f0LfUbMTQ/Yf3rDA9ENI6qRthzEso0M42rmeE=;
 b=JFASYuqOUMf22I2Gu5SDxFzBo/LfNyBKV5dlhplhrd8nJ3GuhtKppmQQo563uRvxI1ZDxJzJedlFHZIBHQP60WviTzXTizkiECMxLUURYmMD/M8EqX9hQqi8dE+p4nrO3QcSRSY61oBuCftbEkXYXI9/IHvWhVj7qdvN/LtdkgU=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Mon, 24 Jul 2023 09:59:33 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Message-ID: <ZL4vZcZJoIpmM5-D@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local>
 <08ec7e54-1abf-5e1e-e1ee-7026a69e0279@suse.com>
 <ZLk7wh39Cc3GdIuB@MacBook-Air-de-Roger.local>
 <87fs5edve5.fsf@epam.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <87fs5edve5.fsf@epam.com>
X-ClientProxiedBy: LO4P123CA0420.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:18b::11) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|CH0PR03MB6067:EE_
X-MS-Office365-Filtering-Correlation-Id: 00fd1069-e380-4989-d777-08db8c1bede6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	pCuE690pw9ArbSbfyKxA1FKHjixO63EPLmLPBPz1YeWw/vektseDEycHD3slaMVWRxoTbIT68l9TjrRKtkRizYcgUlYdt660n7VcOp8zmGoQlPy8/hFYDF/GEzRtFJ7TTV0FeMxIrwmdPMdjdExppuPJE8UeELXDam5awdHI/hgK1yJxILnAnrLdj6Q9cMKysWomQ4Yn2zo9ISpMw/j6Z7y2854qRjQzewZKMXfhJNLGCokRbZCQ62veG+WcnaO3rfwfEdOZW/Yyf2An6CWRK04aGR29G8Me5fSQ3rrXIKNnbNTI34S9tSQ0FfVHRlLUbcEcc9O3cYRDrFD5eHKiZMMytl74SVH2J/VCo7czSeqoseZ6C84hzxsiytOW130ebvi6sR6z7UNWQsFCIvGOxFOUZ+6ItsHKnamv3K5H1AhWxIa5Yu9CXCfeGkgjvU2xXsa5JhTa4iJ4yGhIFNnYmWkGJ3ymp2amoMEUFqIWKwTQQdkJ2jjj4YNNFsOqKqp22Hu1N1zJboYibzE9fN/IEI2QVzzO9vUA5MACqCPDruSFJkOj6+lbjtI/yraRvRuO
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(396003)(136003)(346002)(376002)(39860400002)(451199021)(2906002)(66946007)(66476007)(66556008)(6916009)(6666004)(478600001)(6486002)(6512007)(9686003)(54906003)(83380400001)(86362001)(85182001)(186003)(82960400001)(26005)(53546011)(6506007)(38100700002)(4326008)(41300700001)(8936002)(8676002)(5660300002)(66899021)(316002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dFcydUluZ21vSlVTTk9GblE1RFk0NCt6MnJLWllJUTRjYkpoWDA4VzZBaDA5?=
 =?utf-8?B?NFJsL3FLNCsxdnF1WmtwR282dG9QSU5DQXpQUlFRYm0xSXNYb1hBZFcxWEtX?=
 =?utf-8?B?Yk9zSmg4b0ZESXFESkJWejZxcFZEdnkrMVpZS2d5YVhvaUQ0MHpTQmJZSTdH?=
 =?utf-8?B?cFFFQWU3Mk83bjIyRmZFM2ZHZ1NVSGtZbEx1UWMwUlZrdnBySWJzSXJFaXEw?=
 =?utf-8?B?K0h3aFp6dVZOSSt6RzJaUEd0SGJMRnl3V1FmbE83cU5Fa3FPTnpxZFFsWWRO?=
 =?utf-8?B?SWZ6YVhTMmZ5dk81eVQxY3pBaDdGYkFYMGtreSs2TmJDN0tSNmUrOXY1ZEhS?=
 =?utf-8?B?Sm8xU3gydVhZWkFaMXp1M3JZODM1WHFUdFA5UDZYZHpoeUNYYUVoY1hjeFpz?=
 =?utf-8?B?Y2M5QXZEbmd5dmtkMHFyVmlxWjVXQ3Nta0xxMkFTODVwb0p4QjZUdko1eTdq?=
 =?utf-8?B?MnZuSktDVzN0VWpOMCtVMERxQXlWUndXdVA0RVdPTXZHd2xSdld2N3VlK1Uv?=
 =?utf-8?B?ZmF2eUs3Vk9EZ1pPY05QME9zeUhubmZrV3ViajBxcDNpNVNacW1IQVRxa2w3?=
 =?utf-8?B?NUdBM0pqQzJvcE5sbmg3OGhYQ1kyTkxjNFFDRTRyNFRYcVZtVW8wdTVZOFdq?=
 =?utf-8?B?WUZYQXlCdUJvQnZReVJrcmtZN2RNQVJObnFIaFh4bzdEaTBKS1E4WVNkNDFQ?=
 =?utf-8?B?dHBwTWE0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xFvF0NhTqMTaSNjPan2V2heJu7Vv8E/he3vrIkIZqNZqQTc5+LVJ6HcTiKLRjwKzkGNsvohGZNX7LBVv6v2WUjJQTrbZkXc9eaYDXilYzrlNgIoF6dmYZnT95Tr2O6fj0H5DmdToiVP1/MeK3J3Z/UMI7ekyG8oCtAajg0LpOSMNMDR4R5RxD7cKk2Fhz6o1fqMYAR/0eVdNsY/oMNxK0MsC7c4UGZglovid7J3xF26SwNDHidYspjxEQaujmg5F1l1CvixoD2btMbtg8sDQLH7xVscSjsA0OMDcj/dsWwufm4CC3RoUXkNlgJQqwg+g5FAoOjBRcs6LN3pP9CRlx52oBxw81f9iRISHeEhEcFWWxVuJHluKWU3CqOTjn5hoc4JiEXHfDoJeeCd6u+UErnUprYjQVg2wNfdIlvBkdC4pWAQ+sgfBbK0MoFz8WYUXT/fL1qnljYNxy019ofXkWCyqVHuS2vwOsWcs5EBpLrEiVD0IhnPfrRA+5e0LlA==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 00fd1069-e380-4989-d777-08db8c1bede6
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 07:59:38.9891
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 4g+xSA58+MbQpgm/LfQVbOxYzRduCHsBC+WY+meWTBktWTXZLdrftJckT+qv7wkKp5a9ke8zaH/K2gTVVGSnGQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR03MB6067

On Mon, Jul 24, 2023 at 12:07:48AM +0000, Volodymyr Babchuk wrote:
> 
> Hi Roger,
> 
> Roger Pau MonnÃ© <roger.pau@citrix.com> writes:
> 
> > On Thu, Jul 20, 2023 at 03:27:29PM +0200, Jan Beulich wrote:
> >> On 20.07.2023 13:20, Roger Pau MonnÃ© wrote:
> >> > On Thu, Jul 20, 2023 at 12:32:31AM +0000, Volodymyr Babchuk wrote:
> >> >> @@ -447,8 +476,16 @@ void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
> >> >>  
> >> >>      /*
> >> >>       * Find the PCI dev matching the address, which for hwdom also requires
> >> >> -     * consulting DomXEN.  Passthrough everything that's not trapped.
> >> >> +     * consulting DomXEN. Passthrough everything that's not trapped.
> >> >> +     * If this is hwdom, we need to hold locks for both domain in case if
> >> >> +     * modify_bars is called()
> >> > 
> >> > Typo: the () wants to be at the end of modify_bars().
> >> > 
> >> >>       */
> >> >> +    read_lock(&d->pci_lock);
> >> >> +
> >> >> +    /* dom_xen->pci_lock always should be taken second to prevent deadlock */
> >> >> +    if ( is_hardware_domain(d) )
> >> >> +        read_lock(&dom_xen->pci_lock);
> >> > 
> >> > For modify_bars() we also want the locks to be in write mode (at least
> >> > the hw one), so that the position of the BARs can't be changed while
> >> > modify_bars() is iterating over them.
> >> 
> >> Isn't changing of the BARs happening under the vpci lock?
> >
> > It is.
> >
> >> Or else I guess
> >> I haven't understood the description correctly: My reading so far was
> >> that it is only the presence (allocation status / pointer validity) that
> >> is protected by this new lock.
> >
> > Hm, I see, yes.  I guess it was a previous patch version that also
> > took care of the modify_bars() issue by taking the lock in exclusive
> > mode here.
> >
> > We can always do that later, so forget about that comment (for now).
> 
> Are you sure? I'd rather rework the code to use write lock in the
> modify_bars(). This is why we began all this journey in the first place.

Well, I was just saying that it doesn't need to be done in this same
patch, it can be done as a followup if that's preferred, but one way
or another we need to deal with it.

I'm fine if you want to adjust the commit message and do the change in
this same patch.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 08:02:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 08:02:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568459.887772 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqWt-00050D-51; Mon, 24 Jul 2023 08:02:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568459.887772; Mon, 24 Jul 2023 08:02:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqWt-000506-1e; Mon, 24 Jul 2023 08:02:55 +0000
Received: by outflank-mailman (input) for mailman id 568459;
 Mon, 24 Jul 2023 08:02:54 +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
 <SRS0=Klik=DK=citrix.com=prvs=5629c81f5=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qNqWr-0004zh-Uv
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 08:02:54 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7b4e1d55-29f8-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 10:02:50 +0200 (CEST)
Received: from mail-bn8nam04lp2041.outbound.protection.outlook.com (HELO
 NAM04-BN8-obe.outbound.protection.outlook.com) ([104.47.74.41])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 24 Jul 2023 04:02:47 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ2PR03MB7475.namprd03.prod.outlook.com (2603:10b6:a03:55b::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.31; Mon, 24 Jul
 2023 08:02:40 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 08:02:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7b4e1d55-29f8-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690185770;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=vAjKwyJ9qD9NHUQU6aAiwWCbiHo6RtO5cIo46n7Sszc=;
  b=WIVnPVoL0ab5NQ0h8sNM1Uf4hU3r5J2rqE4xpTiTJKTMm33ReK3IptEs
   D5dHlvgNnl8C7QOKaxwitLNG8kHxGbxhvBERSm4F/st52kIo2+LXmNVfo
   ijmzUWcxTc9zwEnDSRsWcCF5OH1uiOcM9Z2vlxA6PB1RKaNWJlheNwNSl
   w=;
X-IronPort-RemoteIP: 104.47.74.41
X-IronPort-MID: 117624510
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:zJ2SyaIeQRq10KooFE+RFZQlxSXF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0+9+YDzrdXFedU19KrcSMo
 GT3cZDryrIQwVtUizqbkN1OdQqvrfw5evbXSI=
X-Talos-CUID: 9a23:EJNKCm4MSWp5j51SM9ssxk0NHO8IWXvh43qKc32nE0x5EI2yVgrF
X-Talos-MUID: =?us-ascii?q?9a23=3AddsWQgzYfR1MvejSkdYRnX/24L+aqKuFJHhTrJE?=
 =?us-ascii?q?nh+iNORJvJg+gnQqIWIByfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,228,1684814400"; 
   d="scan'208";a="117624510"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=EYX9tnyPhyz74zzkqdxCBQpbRwaGEmP2itoAFpfHq3khWR8ik+nOJJD+sVZl1SYvz/GDrGHGMgKbRi/o9RInlJdAlTDj3wtJB+5YSmauNaEWui5VBkjot6BxS6cv2BF8Uz3mFLvKuuEaw9AgYLC+IdS9FWv+xNbeCTQEGnAILiVjG8y3OM/r+MYSYZ7IjnyXFZb89fBOTA5fd0LMOW32iYD84AzebdIKo1z9Bv3RojvmuD/975fzL7+t4gsorL/MjIjtXmeRhLh4l/qrH5mRgVrqiLrS09BJU7L+zblq2291BtfhDwfgWR67oVa6QJzLq0NIn9FPfTwOPZl6gtteOQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=uAzeZy7H44ZHGi2Ny1uWhJ/0m3rdaz7mgNJDD7qMMr8=;
 b=gRU2Lt8RIhIJFRYSzKSDbEVPnlxHQ+kBPy37g320RZcDQxCRAJgTqCdWHoMo2FoZvhkQeU57gY3j9fGFMmd9+LXcY8Etn3HtT8zJk5jVzNapX/RTQ9aQ4R1cP6Mg0mfO1KLbzleaiiiaWGW/Z2C3oGyGax2MN7HeMyrU/XRkbEVFSAIZYV4EFGd2F21h3KrSKTzKbwCNAhYcEq2jsNU0yEcBl/IMR52U2Cb0JLMZdNKOI3T91fxe+OuyfNSYyEquqeLrzODkOSgGVV6v0jmkwgrLaSAyDH7IeE4Wgs0Rb7fdJ7wZPIZa9H8R7wT6vUZqimLCbQ462pr8eucZNg3x6A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=uAzeZy7H44ZHGi2Ny1uWhJ/0m3rdaz7mgNJDD7qMMr8=;
 b=WlckhZf6NgmqNqsFlydYSwSgNvUvrAJKpPbQAPQxHZS8N8GH9gAMAm+QrWhnyuboUOeH3MH5CNzwMgvDO8modKCm7Yb0TQs7QJvnEmeANKjvG0a62dVSz/ijpXt5U22rWXaVHSfrpHv2owTQd0+JmV9dsc8TH46Dl4D/+R0aJpg=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Mon, 24 Jul 2023 10:02:35 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH v8 12/13] xen/arm: translate virtual PCI bus topology for
 guests
Message-ID: <ZL4wG49kveKrKysq@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-13-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20230720003205.1828537-13-volodymyr_babchuk@epam.com>
X-ClientProxiedBy: LO4P123CA0239.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a7::10) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ2PR03MB7475:EE_
X-MS-Office365-Filtering-Correlation-Id: f6847f08-4cfb-4829-d742-08db8c1c5a3d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	V3WCgPKAX2B8c/7s22qK2i8Ewzvyio5i4emwU7Lcnbj1mN/2LPfLtuSkunHMBSlzYU6aaCFmMdi16gjaKKfEYcJIY20bSuCSw9EVeDy5WMUVUAi480KKoaqIKw2DGcb+Nj3Y+09MeJl3L403xO5IEXmPfenji2+pQyH7oWBUpecEWiO3Sa3Yhrs8U2HT6mIwyfrqAs1kXLqVVkMb/jwfqCSjWiWaEe5ahSsMTFhQtMOH/YIJx8aZvrXnJii5/PKXODIBvr100MXD1RDLYJ51O9dXte42dhMNx+5iiGVk/Iv2Vsv6WbKTDSAJ2BvrBdwXKfApQCHNK5mOi9JY4uNHakPbyxpb7u2qbOpA888dNW4da0ePxmK/mRqCDeIOhr7bY5HHYzKGbRffzNgPDq87lt8/bq1vJ/fYSEpy3TAwWDv1+nKfJ1KFPx8X5lGMqmiY2LlFC6E4tnvbb+KAIyl3pHSx9HpYIPuafyevN56rqxGLr1ZOGUL0s8uKpikOBNkMROnMaMCvJFc4Tz3iY6G1G3TcRPdxEx+aBvEnho9Q0FR83IB3qGshOuoWgBxGGPH1
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(136003)(396003)(39860400002)(366004)(451199021)(38100700002)(85182001)(83380400001)(8936002)(8676002)(5660300002)(478600001)(6916009)(54906003)(66556008)(66476007)(316002)(4326008)(66946007)(41300700001)(186003)(26005)(6506007)(6512007)(6486002)(9686003)(6666004)(2906002)(86362001)(82960400001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bFdZQitiRHBDbDA4QUEwanc2VGFNZ1BDcEZSOFovbnNuRU1pM1VpbFhTR29E?=
 =?utf-8?B?ZkwveHlHTGxXOGsvZ1NwYXBOTlBqanQvaEFCVUt1MzJaaERqTXFOMTk1NEVS?=
 =?utf-8?B?Nmd4YlRZOXZ1bXBxQkhkR2RmSFptL1lTUWl1cDJ2YU5uN3N5NjFRcHFJSUtK?=
 =?utf-8?B?aitNcFBSMWJQMlNCR1FySDVKdmd1VGlkQUllZmJwdUdEaFQ5Z2NhM0JGVHJK?=
 =?utf-8?B?YzlncXlDbmlMcGUybzRJaVdKbkpvbVM2K0pmOU1qRTg0TWxLTzkzZXBWK2Uv?=
 =?utf-8?B?bjRTbkdRemdlcExRWjZuQ3V0R2llZEEwMWE1SU1JYWk3bDJFeHhkb2R6V25T?=
 =?utf-8?B?em9vbnhERXNJcTVEUFNqa3ZkNHBRcEp3cGdUc1hjelRBdVhtL2JtSGsvQ3FO?=
 =?utf-8?B?OWNvMkVNd2NyZEQ1czhXYkluekJIK29Ka2lOdTIwL25WR1VOSFlvMzl1Y0RD?=
 =?utf-8?B?a256MTViNTMwN1pzWkoyVmtlUmNFZlhOM21FUTJrVzJ6SHdFVEhRRWVzVC9v?=
 =?utf-8?B?QjYvRWpqelFzMWFMQWNFbU5FQXd5VUU4VmtESW5acytSNUkxOW1nQkZoRDB5?=
 =?utf-8?B?b1VGRUhKZkZ3YmU3WWcvRXlnN1RuYnFieW04SUxkckw3OFh1OHhwMk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VMjbbTghA02FbBgQOjJeK3XibdeB0SdEFWQE1yNo+RjL+bUikBtZZImUzkCgfsKjuD0e5IYhVVkr5eMljBj9lgTXHurs0s/Tq7vwQUbuhsM3NGmX7ejUkBwrzykzoZBW+caVYtbY1kMnJXPFSB/8yC6UQ/tvLJAn1Ps7L6J+T92efZT0anXTDg91zSCNZSppEEAtL5ScwU7eP93f9ZjdLhAP7nNKfoUp7qRPqI+qeXz6Hy+5sQbowl2znVR09zJ+RUdekDBibyzrkSTGtlSDfY03ijTATMMMBifvJYLPKx7d7mjwwX50poZfj96lOZPD77MuRLtwLB6BjzbGoZ17ASS/ki8wKaJBK2bkzRrERs+ZF0ABOzPWi/xgOIRtsKBP2QcG5ZxC5n7bgxOvpR2uAceKnK4Ik+rZrduW1XUkRFntV2ZLlySxFj2+/x7unx6q/vFspOtDuSPTFFSDt7W1zV3jcntQXSX/mXzHy4njv7lxyiKf1dost9cKZ7rtFlVei1P3jnLBmhC5tVRgs0ZYUeLQ6m0nuDfFN+1bgKQOIoRwjpFQGoOvjenu6Zbc7SK4dE=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f6847f08-4cfb-4829-d742-08db8c1c5a3d
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 08:02:40.7386
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: p0Ibflz+NFHwuq7AsZKKMRv5RSHdXQnJOr1sNnn7culEKetiHfh6QVMcMU9GGnEEo42R69iDP4ywkK5g36NhtQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR03MB7475

On Thu, Jul 20, 2023 at 12:32:34AM +0000, Volodymyr Babchuk wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> 
> There are three  originators for the PCI configuration space access:
> 1. The domain that owns physical host bridge: MMIO handlers are
> there so we can update vPCI register handlers with the values
> written by the hardware domain, e.g. physical view of the registers
> vs guest's view on the configuration space.
> 2. Guest access to the passed through PCI devices: we need to properly
> map virtual bus topology to the physical one, e.g. pass the configuration
> space access to the corresponding physical devices.
> 3. Emulated host PCI bridge access. It doesn't exist in the physical
> topology, e.g. it can't be mapped to some physical host bridge.
> So, all access to the host bridge itself needs to be trapped and
> emulated.
> 
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> ---
> Since v8:
> - locks moved out of vpci_translate_virtual_device()
> Since v6:
> - add pcidevs locking to vpci_translate_virtual_device
> - update wrt to the new locking scheme
> Since v5:
> - add vpci_translate_virtual_device for #ifndef CONFIG_HAS_VPCI_GUEST_SUPPORT
>   case to simplify ifdefery
> - add ASSERT(!is_hardware_domain(d)); to vpci_translate_virtual_device
> - reset output register on failed virtual SBDF translation
> Since v4:
> - indentation fixes
> - constify struct domain
> - updated commit message
> - updates to the new locking scheme (pdev->vpci_lock)
> Since v3:
> - revisit locking
> - move code to vpci.c
> Since v2:
>  - pass struct domain instead of struct vcpu
>  - constify arguments where possible
>  - gate relevant code with CONFIG_HAS_VPCI_GUEST_SUPPORT
> New in v2
> ---
>  xen/arch/arm/vpci.c     | 47 +++++++++++++++++++++++++++++++++++++++--
>  xen/drivers/vpci/vpci.c | 24 +++++++++++++++++++++
>  xen/include/xen/vpci.h  |  7 ++++++
>  3 files changed, 76 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/arm/vpci.c b/xen/arch/arm/vpci.c
> index 3bc4bb5508..66701465af 100644
> --- a/xen/arch/arm/vpci.c
> +++ b/xen/arch/arm/vpci.c
> @@ -28,10 +28,33 @@ static int vpci_mmio_read(struct vcpu *v, mmio_info_t *info,
>                            register_t *r, void *p)
>  {
>      struct pci_host_bridge *bridge = p;
> -    pci_sbdf_t sbdf = vpci_sbdf_from_gpa(bridge, info->gpa);
> +    pci_sbdf_t sbdf;
>      /* data is needed to prevent a pointer cast on 32bit */
>      unsigned long data;
>  
> +    ASSERT(!bridge == !is_hardware_domain(v->domain));
> +
> +    sbdf = vpci_sbdf_from_gpa(bridge, info->gpa);
> +
> +    /*
> +     * For the passed through devices we need to map their virtual SBDF
> +     * to the physical PCI device being passed through.
> +     */
> +    if ( !bridge )
> +    {
> +        bool translated;
> +
> +        read_lock(&v->domain->pci_lock);
> +        translated = vpci_translate_virtual_device(v->domain, &sbdf);
> +        read_unlock(&v->domain->pci_lock);
> +
> +        if ( !translated )
> +        {
> +            *r = ~0ul;
> +            return 1;
> +        }
> +    }

I've been thinking about this, is there any reason to not place this
logic inside of vpci_sbdf_from_gpa()?

I'm not sure you need to expose vpci_translate_virtual_device().

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 08:07:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 08:07:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568463.887782 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqb5-0005fg-Pv; Mon, 24 Jul 2023 08:07:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568463.887782; Mon, 24 Jul 2023 08:07:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqb5-0005fZ-N8; Mon, 24 Jul 2023 08:07:15 +0000
Received: by outflank-mailman (input) for mailman id 568463;
 Mon, 24 Jul 2023 08:07:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNqb4-0005fT-AQ
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 08:07:14 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0615.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::615])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 18961389-29f9-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 10:07:13 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8131.eurprd04.prod.outlook.com (2603:10a6:20b:3ed::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 08:07:10 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 08:07:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 18961389-29f9-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=f4XSLXcfag/S7nKc2pemT7zBhapZvzToGC0T+aDY9Mpzb85b5sG5HGzt5VQO4KspObMoJy5LbLUQwhghsXApQYa8DBXS7mmqQv3/sICX1LFGQ8sDyy+SQT0Pba9vGbIcCiRc+XY0GSlAESenJQxHQAZ5pKkd+mdGFFH342s3oa5QbdCnol0bT14SOsKBL/aF0lhQR01UG4qpWFYfsIjqtDlsC9L5vy3hqdR3VX05ZmEZ3mtdVplxAEN790RzNDzGjXnY4nv3jL/2HBrBkCKh5e5nJKVkDPfINVdKrm0tEjP3vzeJ/0YAcie376vsN+fUwXnoeGn6FarnEb3gL1rBHg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=hjq2VSD2h9kYXAzD8CziPuoIQGKiMFT5SRWyLFznJUk=;
 b=ZhoncAcSatT5ujTPbnMh3ZfjMelm695JrId/mREHm1l/tZk8qgd6nVmlWTeu9rB1fDh8wl5kuqZgiIT03y02al52y30t+Bl6f4icOKFBaHKjii6b2aSagfNS1gozl4T/rIOQMFMM5wMQV15Lgdg/axYQdoYToBofrUTA7xIXHQnaormPS7VpV/jTTARz1lxDR9hiTDdWkMwgDTwYBzXmKvULW+kFoQ6p9h45adwqbvi/8n+iPF0bD7y892EtcSpmeCaTIExJs43urzf/AmzM8QTqLpXtj0Xs5/id6P2by+y0QXGrJAmZuSzPYXoz8ZW/UB4IXb6p8194cmQOBaFyyg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=hjq2VSD2h9kYXAzD8CziPuoIQGKiMFT5SRWyLFznJUk=;
 b=tPMzY1JwxFoz8Xdj0UElcwwvpskhmooqAeq/dYWD+VatA+VelRkg0SQy4vclCLXCm2wfv0ma8HIWPtQaKL2hidF2xXkNZpupnAfuqycX/j0J/+upaKQ/X0YwDzvQcwFPgBnQavh6vn4JUXabyo18QZgsHwmEHCUjzmye07FB5mV8agHNVZogVfA+wYJIiImO6j9uhOZhdfWHKMTeGP5LL2e8rRkJgBpT9BH4gH/3KYUPDt8Tibfjtb0NRNwb8P2426mn+iVLObVGsMFAeSM83s/AF1FFPVfBnwDUAqkWiF+MqA/OdOcN4slTfZb3F5fuwZE4ghgM8lk32qR+TTDlfg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <00ee1297-f5d5-b51b-0039-4ae10668b0e3@suse.com>
Date: Mon, 24 Jul 2023 10:07:11 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] efi: mechanical renaming to address MISRA C:2012 Rule
 5.3
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 xen-devel@lists.xenproject.org
References: <4da442b03ba783b4db0e56614bed43ce882a32ae.1689953085.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <4da442b03ba783b4db0e56614bed43ce882a32ae.1689953085.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0056.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:93::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8131:EE_
X-MS-Office365-Filtering-Correlation-Id: ffda5129-60a1-46c6-99bc-08db8c1cfb52
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	VWSN8OWYPes1c7RyZR9DpKHuSAU30TofUg06cxxlJvlIAaYmPoSFbWw/jH1sdxBD/nlQMq04kEgYRFo1qaCdyVBhGclLAxPk3WyKI4/20/NMZs8G8pY0TM/hgclahqfQPYv7EpqiAWTH14pxXZwuAR7vBQWZIk/qzoUr9HWLsWm5xNihO/8cqG7IGNl6wy5JpVAYDHMWX2SXGXELeKC6ILcTyUvFYLswsZmzz+iccIoVCmXsIsWlSv5wD5rry8dunGts4ORJIBuxtB5I9aYQX/aSO95u9dn0U39UpUtB71MDfsfYnUVL2rbIwKmBwa1qif626uewVWzvUmIHsEvRLdnbwuhgT2Mp4U+rxQ0n+748Lkq6OgMLanS3DtvGDv9uHr2V+ZzHTZv0wU0gSRQA37+U8NSmmlm+L/V5j2WQvzVmwDqYu7S9ipEO+IGejbbncfZnlZfpTVI3JMnCtK1jI4xRU/sZwvZD4EN+cexZ3oXoDfIwUVKANcQj8swPHPxF0slZZk2NZ7UkL8K0/mP5GAgntvh8QCsrsgYR1C808tWKd6koN+vR48tVTa2vPixY1d3MhNy/Vqcm5p/HO1IhSL9BLGHwgwA3rwBo6evFtQDMVwa5r2QlKnQoW3mTh5W0S/PdA8LseSolQhC32eejbw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(376002)(136003)(366004)(39860400002)(451199021)(6512007)(6486002)(478600001)(186003)(53546011)(2616005)(6506007)(26005)(2906002)(316002)(41300700001)(66556008)(66476007)(6916009)(4326008)(66946007)(5660300002)(8676002)(8936002)(38100700002)(36756003)(86362001)(31696002)(83380400001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?R09SN25SYVRJTjBNenpZODYwMmxpNnFsdGRNUTdBeHRXUTFVcXBnNjN5OFAv?=
 =?utf-8?B?bldBcnprM3FXVG5RR0pwVTdGejhVYWdTbDhnd2FUaGtoV2N4R1VMUWZUa2xm?=
 =?utf-8?B?UjZUMXVCY0VhK1U4Wktjb0FIU3FtZ0p4L3pjbE1GdEJ6a0ZFZjQ5M1UzWFBy?=
 =?utf-8?B?aDBsVXlIaFBEeUdMRGlwUUozMzVNVUt2OVpqVVpyWjBuc2gyK2tuTUljL1Ri?=
 =?utf-8?B?ZkhGWFJ5OCs5RkNva2E0YXdwNlU0ZWE5VTFGUG9JWFNRbjJERWFGMzZWazZS?=
 =?utf-8?B?ak4zcUhCdDBadW1VVkl6K2dnRHc0TkNoNlBma1IrZGRoKzV3Q2ljNUtvM3Qx?=
 =?utf-8?B?d0ZMQ2pPZHcrSFk0ZDlQa2czRFhHY0czb3NaLyt1NUVyWDVWM2IyZW5nR3Rm?=
 =?utf-8?B?SzJRL3FCZmR3TFBRSFVxVGVDTUJ1NkpzbzZrMUpqazRKZ2IvOStVaTFibjNI?=
 =?utf-8?B?UWYrQnh5TEdJTnBoa24rNGljSzR4NjNQUCswc2wwSTJ1Njc1OUYyQ0FxckpB?=
 =?utf-8?B?VzBTQ1dQNHBCeHg5dzFwVFoxVlhPRVJRQkFrNDJScXdzdG1zdWo1c0ZlMlhZ?=
 =?utf-8?B?dENqRjE1QVhwNW4vV05Xa0ZmWk1BaVlkS3I2bkhOaUczSzJlQjMrS3duWXJw?=
 =?utf-8?B?cHNjZ1lPZXAybEduTU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EN1cFVqQ0NzV2w0TXZPeEl4?=
 =?utf-8?B?L2ZtMmZ1ZjdpcGJ4YlNDeUhFeHZ2aW5aWkxvWktpc1VxcUwrZUJxR1EyRkh5?=
 =?utf-8?B?WE4zRENob3h3Qnlic0tOeHZKUFVGaCtUZmNTd29BTTdaakVUbFk5K2lPcmJI?=
 =?utf-8?B?L2dpNFpqVk5DcHdTN20zaTFVZFpkRktQNXMzVzlQTUNEZ2xDYS9La2MwMkk4?=
 =?utf-8?B?a29TL0orVzByZDJSU3RpY1VvVy9TQmoweVY0SW0wUDFyU2k2eXBZa0hzZjJv?=
 =?utf-8?B?cUhmWEVtRXVvaEJYaTBIQWlLT0ppMlU0eDBtNXlreUJuTGNsSDFSaUNGWFFt?=
 =?utf-8?B?RXh0bUlrYW9uVXA0bjAwNW5Id1ZTQlhVY3hDN1NKUno4U0Jrd2F6WUpvTzFW?=
 =?utf-8?B?OVgvTWtOZ1JMS3FSdkN4eWtKVGFVNXV0bklDMS9Va3NGTEJndXpFSkxhYSty?=
 =?utf-8?B?NmhNN2NRTU5wY0dxdjJHSGxURGFoamNZZE9veFdGNGRTckZ6UnBFdkhzNEYy?=
 =?utf-8?B?SHNGdjJZMUFyanZkeTB0dXVnRGJvazJBcTZUK1IzRVBsdTdST2RjeUpqS2k3?=
 =?utf-8?Q?c4kSIskRbR09kI/m2eZKNU1nq?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ffda5129-60a1-46c6-99bc-08db8c1cfb52
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 08:07:10.7593
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: PpmNVjie5nl8uxhTQHA2LXVfgqhEDEFYR8KhW1wAFemZFqVW5U5I2ATqeVir9VCvhyBj4NfEY3xNTpCwe+zEbA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8131

On 21.07.2023 17:26, Nicola Vetrini wrote:
> Rule 5.3 has the following headline:
> "An identifier declared in an inner scope shall not hide an
> identifier declared in an outer scope"
> 
> The function parameters renamed in this patch are hiding a variable defined
> in an enclosing scope or a function identifier.

I think this sentence should be limited to the part which actually applies.

> The following rename is made:
> - s/cfg/config/
> to distinguish from the variable 'cfg', which is hidden by the parameter inside
> the modified functions.

Hmm. I have to admit that I don't like this. The two functions in question
always have "&cfg" passed to them. So using the same name is, well, kind of
intentional. If we really need to change the code, I guess we may want to
consider dropping the parameter and always-same arguments (albeit the
choice to have this parameter was also intentional).

Another route would be to truly generalize the parameters by naming them
"file", like other functions have it.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 08:14:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 08:14:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568467.887793 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqiI-00078k-IH; Mon, 24 Jul 2023 08:14:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568467.887793; Mon, 24 Jul 2023 08:14:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqiI-00078d-ET; Mon, 24 Jul 2023 08:14:42 +0000
Received: by outflank-mailman (input) for mailman id 568467;
 Mon, 24 Jul 2023 08:14:41 +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 <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNqiH-00078W-6b
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 08:14:41 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2062a.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::62a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 216bfa2d-29fa-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 10:14:37 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB8817.eurprd04.prod.outlook.com (2603:10a6:20b:42c::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 08:14:35 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 08:14:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 216bfa2d-29fa-11ee-8612-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=VeVriaNBd6dBHlxhWtNPyzUrQSnx+IhRQNMbItS3Y+S2cu1OAocnXdTgW8lNJ3yPs/IluI2T8kFbmW81snQSQkfbm6SgkgVA3LuIT3MYbcqpOkLLtChWqks1a5agd9miEu2LDTq52UMFJL8pMS4/drezaO0K5sNBw+ue6XXkRgeJckHoa+nab+iVk020oYhD4rDpyiSjImVVaAGiYGgGCIZVmnJ8rW80l7TrvCmKt3sSfNcV+NLx0M1sxbFSReKUh/FzZ2ICxDLCUb5q3SEvyOPxa8MxOKh4bCttXoi125yyKpCUxbIXReIAdAdjkoN8R+M3dVRiGtvONSEafTURyg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=GuQbyCz36jECV6NW3wW27Dl7yC8SZKX91NwYgwxCHlc=;
 b=ahJnjWSghrwOcovt65x4aNCechLA4ZqSSeuAcwv2xIL1l1OHE8rjo+OkjMPakxCkK5AXpO1YSgESx6vMF4xMFRcWwFODM9p86NUUwnjFgYOwiyNPxP0oN2afQ0pIiQYjBxC2mwNI4tsbgiBdZgqKwr7ZWa5FaH6nAeCaOCW5Vbp1+SEx1PbhHDGj/1TR4/LaTNnWwz6xq/H0FPfq8dDHfUbZn3abVJJNNXTJv8xftzp347jCBkMH2f/im1or4GckmEIucqlzMDiD04uTH+o0LWUb0uWiRUQ9a7kxT2O8tYUTsFD0tYMcDehJBF+b7UqNUKfIY2Pg49790/OL0Zai+Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=GuQbyCz36jECV6NW3wW27Dl7yC8SZKX91NwYgwxCHlc=;
 b=wPOxZeC4dGq44rT0dW63flyQB+dnxM8SDt552B0I7nYncSNOmOaIrsJNLppn5+LcX8jjUG3HqztPMObesNnMbH+1P2PEa/veE4R1RdN+t5vgBHHTO93qfv6YVP6AhRA6Q5cw5RcCgjeWnL2bFhVAC+MR/mvPA08HfDFOfgT+V8b0LE8jolo21AqW9/w4ewAwim9jwCNsqR/x7crHUUM7mAv8Ud3xuQZ20RoafH+1fVpwsKp90kztVa2jQBnptMBCTIwBACLkADvjLfNnfHQYYry8DplPAWX2hr5r4EmT+3LMf3IiCZem02i5CzrRQnscsug6wKukgu8CReRel/xW6Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <4f3b6c7c-f8a3-b904-1b23-baa9eb2455a1@suse.com>
Date: Mon, 24 Jul 2023 10:14:35 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] xen/spinlock: mechanically rename parameter name
 'debug'
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
References: <78255b6c5caaaa02dad638c7d4102ea793a09b88.1689953306.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <78255b6c5caaaa02dad638c7d4102ea793a09b88.1689953306.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0130.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:94::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB8817:EE_
X-MS-Office365-Filtering-Correlation-Id: 70e058c3-c79e-4dd9-9397-08db8c1e0405
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	VeVzyKGLwiq6Xgkg1nzB1WjMFSrnhMuPQ+efi6QDobFLD/vdFhySxh4SWJ3FgN9z8HQxs66n/hxBJ8ulwtAi3xkcBjk3jsJ/+qxBglqkcWuowzB68Wm0fD4CeCVxypxafdeWdZaxZuVBqcfv6rmIVGqu4r/3fbIMZUApopt47qaYPVJwNg3b4crhjLjOqrQN3a3xJsfA2pUU/7/fi2thztVKRKctWx91GL6ERQO6N2ZpCrkE6npQZ4A22ZllulHN0npI/Cq2rmPFf248Tmp+oRu5Vm4vPUpbbHvgtG/yOOW/BDzMpR0UT9qQQ6+FizMmjkSdbwqH8LWZuib97IwMA6UQxHmx0Bl8k3vqDE6o6RFh22IKZDQiL+ZLfwEGJscRqRDwPQeygIEvcbQsONXcb7NOhQwJA/kCqbSoufdxe8hd9ti7IOU0YvMLFWass+/o8wXEz6XhndBfnajsA40LoRJTZJ0TKskdB9BPgFoMZh5cPZx6hzeHcSL2LakETlWYeA7ht5qmsCUuI/qOiG4I1Uv8tBVQECJ+qxLwJOVXVM1Lwctcxh+gOqiMwvtI+MgSUVm//DCgyjV5rsKo0WPgT2BbV3P1CgdbxyqpUAXSDvP9vI/p8VGKqnxH/j9sOlmnAgc0Q0bBzVkz8gs3bRDjDQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(136003)(396003)(346002)(366004)(451199021)(26005)(186003)(41300700001)(478600001)(6506007)(53546011)(86362001)(31696002)(66556008)(66476007)(66946007)(36756003)(4326008)(316002)(110136005)(6512007)(54906003)(38100700002)(6486002)(5660300002)(4744005)(2906002)(7416002)(8676002)(8936002)(83380400001)(2616005)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?U2F5ZUY3YklGZzBWSyttRnhTNVFTTTRwSU5DUlFubWtDS3FtaHFLeThGbXRR?=
 =?utf-8?B?KzNCWTVRdEJYWHdYNnhDdm5RNTRaRlk2ZUFTc3R5Y0hST3QwZld3VjVqYS9U?=
 =?utf-8?B?Nmd2UVozVHFURDlRd05qamVJUnBQOXMxdkdneFZTMVRZTWg5TjF2ak1pRzlD?=
 =?utf-8?B?TllNWE05RWtHa2V3QXFDbUFpWjd1ZDVYWFhudytGRDJCOWp1ek5vektXaFdR?=
 =?utf-8?B?TmlUOEs0QWlLREwyZytGK3BBaTNmRE84ck9CdXB3MWFoaGJuL3IxeDVmdThO?=
 =?utf-8?B?UUxRU2xGYmVPUHJoZHNMSzc4SW9YUkRFWHFENW0ySzMyWUJWV2RIMlU2VXBH?=
 =?utf-8?B?c2xZUVhETmx4R0pUam9KbEZXWTlVbkxQSHNudXl2bmtKOWVkUHdoWnZXVWcy?=
 =?utf-8?B?VXBJcmkwK0k3RTg1elp1RnB5S3ZxeG5qNVZjK0hCYVFRT2ZQRWh2SGpjZjlX?=
 =?utf-8?B?M3o5VFp3eEY3V2ZLYzAvbGRZVk0xajJjaGJrTzhOaSsrWDd4a3pxZHZpSjJa?=
 =?utf-8?B?LzMwM0ZBNFZ0eFJFbnp6UXV4VVdvZXp6Tmg1aG12K3VlS0dkeVE4UzMrU0x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056QmlQVVBTeXN2N3Bma0UwMmNQdjF5OGpOWXZxNDJvaEdXb0hi?=
 =?utf-8?B?ajRPVzVISUF5K29RNVdTajJLRmRRN2dMN0NmNys0VjFLSm1PaE5Wbm1DT2Nn?=
 =?utf-8?B?Sk9USkhLVTRHOGRCY2xSelhueStpaXVIYmhHZjlWWVRTL2kzZ3BaRGtNOHZU?=
 =?utf-8?B?WDNUdlhEYVF1cWU3MUY0QnkrRkhqTzYwNEY5K2lVMFhVSmJQbGdjanpKZ1Bo?=
 =?utf-8?B?VXUwZ0lHVGtpWG1oNlg3Q3R0MFhlTUhlVHY0Smt6SjdzVGx6REwzOW9zSWNy?=
 =?utf-8?B?RHF6MmdKS0dzdEhFTnpKdjI1aGdXMTdlNEZnUTV3WjAza0NrUHE2THN5bVRC?=
 =?utf-8?B?cGVmYzQrQXhHdlJYZHpTM2tZRDZEMFVLa2RlWGxkWmJYTG1qVXdFM1ZMcHJY?=
 =?utf-8?B?NFg2LzQ1M0wraUgxSnF0Z3d2ZUQrbUx1Q3U3MVk0ZTJFZmhxbHVkZEFPc2xy?=
 =?utf-8?B?eWJGeUwyRUhXcFk1WEMwWC9zSHM0WU5UZjE3cFBWdHg4b2Q5VGFHMTBtRlJD?=
 =?utf-8?B?amdmYS85ZnVvVFlTdHRVaXhDcUdlcDYrRVFZTXU2Y0FMYVZxZ0QrczhURjZW?=
 =?utf-8?B?aGFtYWl1OHZxemoweVpZMVhURC9wU0k1b0cxL3d1VFF3V3ZuTm9vallIbEtr?=
 =?utf-8?Q?0TSTHuDa5151smZAhYeqGckrT?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 70e058c3-c79e-4dd9-9397-08db8c1e0405
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 08:14:34.8542
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: UWY9+4mJ421T18CCGurZPtrJ0FFQmwkSbg88TLmHMUgZ9Il4cmDnGuj0TwNAu6hH0oGdXnFzvWlfuX6HOdVTZg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8817

On 21.07.2023 17:29, Nicola Vetrini wrote:
> --- a/xen/common/spinlock.c
> +++ b/xen/common/spinlock.c
> @@ -78,7 +78,7 @@ static int __init cf_check lockdebug_init(void)
>  }
>  presmp_initcall(lockdebug_init);
>  
> -void check_lock(union lock_debug *debug, bool try)
> +void check_lock(union lock_debug *dbg, bool try)

I consider it reasonably likely that something named "dbg" might also
appear, when we already have something with as generic a named as
"debug". How about naming these parameters "ld", "ldbg", "lkdbg", or
yet something along these lines, but (at least slightly) less generic?

Another alternative would be to rename debug() to entry_DB(), along
the lines of entry_CP(). Andrew, didn't you once propose renaming all
the exception entry points like this?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 08:26:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 08:26:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568479.887803 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqu0-0000K3-JQ; Mon, 24 Jul 2023 08:26:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568479.887803; Mon, 24 Jul 2023 08:26:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqu0-0000Jw-GO; Mon, 24 Jul 2023 08:26:48 +0000
Received: by outflank-mailman (input) for mailman id 568479;
 Mon, 24 Jul 2023 08:26:47 +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
 <SRS0=AOzI=DK=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qNqtz-0000Jl-9T
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 08:26:47 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d2d2a9c0-29fb-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 10:26:44 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.162.132.135])
 by support.bugseng.com (Postfix) with ESMTPSA id D073A4EE0737;
 Mon, 24 Jul 2023 10:26:43 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d2d2a9c0-29fb-11ee-8612-37d641c3527e
Message-ID: <5d0392e4-92f3-c660-7c34-e86a070e45e7@bugseng.com>
Date: Mon, 24 Jul 2023 10:26:42 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] efi: mechanical renaming to address MISRA C:2012 Rule
 5.3
To: Jan Beulich <jbeulich@suse.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 xen-devel@lists.xenproject.org
References: <4da442b03ba783b4db0e56614bed43ce882a32ae.1689953085.git.nicola.vetrini@bugseng.com>
 <00ee1297-f5d5-b51b-0039-4ae10668b0e3@suse.com>
Content-Language: en-US
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <00ee1297-f5d5-b51b-0039-4ae10668b0e3@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 24/07/23 10:07, Jan Beulich wrote:
> On 21.07.2023 17:26, Nicola Vetrini wrote:
>> Rule 5.3 has the following headline:
>> "An identifier declared in an inner scope shall not hide an
>> identifier declared in an outer scope"
>>
>> The function parameters renamed in this patch are hiding a variable defined
>> in an enclosing scope or a function identifier.
> 
> I think this sentence should be limited to the part which actually applies.
> 

Yes, I'll fix this.

>> The following rename is made:
>> - s/cfg/config/
>> to distinguish from the variable 'cfg', which is hidden by the parameter inside
>> the modified functions.
> 
> Hmm. I have to admit that I don't like this. The two functions in question
> always have "&cfg" passed to them. So using the same name is, well, kind of
> intentional. If we really need to change the code, I guess we may want to
> consider dropping the parameter and always-same arguments (albeit the
> choice to have this parameter was also intentional).
> 
> Another route would be to truly generalize the parameters by naming them
> "file", like other functions have it.
> 

Temporarily the second option seems the best, since further refactorings 
can be discussed properly later. I chose 'config' because it seemed to 
carry the same information as in the original source, but I'm open to 
other names such as "file" (though I'll test this before submitting a v2 
to avoid unintentionally adding violations).

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 08:26:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 08:26:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568480.887813 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqu3-0000ZR-T4; Mon, 24 Jul 2023 08:26:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568480.887813; Mon, 24 Jul 2023 08:26:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqu3-0000ZG-O5; Mon, 24 Jul 2023 08:26:51 +0000
Received: by outflank-mailman (input) for mailman id 568480;
 Mon, 24 Jul 2023 08:26:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNqu2-0000Yk-DN
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 08:26:50 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on2060a.outbound.protection.outlook.com
 [2a01:111:f400:fe16::60a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d55d8886-29fb-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 10:26:49 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM7PR04MB6949.eurprd04.prod.outlook.com (2603:10a6:20b:102::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 08:26:46 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 08:26:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d55d8886-29fb-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ADL7FVdUSrMrhitqXvq3RIHj7WwosaEMxCf8+4rNBpbSTIfz895B7AMaC3MYmIc9HncQAwGpcJpTxQJqK1FsqHypD9A8z+btEgaRz9lU18vLOKQUmRtJRgZ6CALGEwM8OqhuXt4gyQhknhnMV3Dvd0i5OqK/8vTxWdPPhS+CqTOEKAeCBjQDFJCvOLA4D0nPGmcxX6KK36PzGsDou+bukK8l2bi2X/93VKlFELmSBK/FtJE8GK3nndnAMJuuWRBZtNvk8N3jNAwDkQshJGOFUrEKujsbFYKe9mBawjhaukmdtTKmo5i8gTwq507gpKXQKxQeXveI5HFRB3zU8cujxA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=F1fqNcW2vRkKe42/FyS3M48IcTMRwU+HhI9BZMW2xI0=;
 b=DdwPA3eHFyP8BJZgzpBbouQ+LqS+p+BIA25Dfqq48pRo6WmrEP6MwOxcVlAKeXIWYRvt5J/fY0DecujBVvxz3Ox24mFXZPhXuiZUOWUM2CrpiEC5+gGcxMeygO0tiFFGi73RIj2ponLrzn5hJr36WWzD6VuAP99AsIbPj5gY0tbFuuw1SkA17jC9eGeLiIFSB2VXq6AZRTnn9DWhrrB4Gk+g28gP4HVPEG4IDUYE5jvOMSzEsHIvA5yKaDD23xHi+s/Dm7AcV74FspcDOD3Ijo23NepOs9gO/K+x+SG3HxQErM16+R/PFtbARGbD1nxvO8BX0kBtn0waYbyvTi9vqg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=F1fqNcW2vRkKe42/FyS3M48IcTMRwU+HhI9BZMW2xI0=;
 b=Qtby51u/J2uJF/dJQqtJtN/Pduqdwfcb7FHrA0YzCq6AC4+iS1GK6I5fZ04EdoRAR3Xqs+6xQl3wa2imqg+dcPKpDYnZgmfYwtLs7t0mlCHs2Q2mLAWQChEQ37arWgVte6sQk1ULBJ6/oPTwgGyQUIteI9EmR8GMNbox2lhodqEz7gWJ/fe0fyewBgYMBQgOtWEPZ8Vt7IAU7PDsWRzOLqAKMKHLeafRuhQsmIMaXsOPLSkEkpwpkOsdyGW+HmP7/OHIG4Yvckvj8PlgT//SHEqioHUSzAJo9YO1NaxGszIfiIYLbuM0xR0ScL9vyN6zVfyuQTjYcv1vEpM7/LSu1g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <c08f1df7-e314-f3fb-b5ac-7aa5e4c546a9@suse.com>
Date: Mon, 24 Jul 2023 10:26:46 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] xen/sched: mechanical renaming to address MISRA
 C:2012 Rule 5.3
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 George Dunlap <george.dunlap@citrix.com>, Dario Faggioli
 <dfaggioli@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <9945fd23b0bb88f3e0c6054a7f992cfa642d3f9f.1689953420.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <9945fd23b0bb88f3e0c6054a7f992cfa642d3f9f.1689953420.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0061.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:93::18) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM7PR04MB6949:EE_
X-MS-Office365-Filtering-Correlation-Id: e896d992-5e54-4ef3-4559-08db8c1fb80b
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	honS2ic1Mvkeq8IphQW7mdbvZRBgDblZSJfx01Y+sThJhrcBA2NnM9KF3ZNubqQWVAZi9LOzf0LfE97hYR1T075Gve+b6oViGUCvn7B+1Wc8+7/npmmY2Yu6sJbAKCFKIZt5ubfyuA3yreH8+6xLpsR9toLWW0BBHzCVJ/MdcUcJjvYCZGk0nvLyzcxfbfktfxgG1m3vqkjNu779K4jzOXfbDhLWL6+RXVcl5I+jHQvqrofqZgwOd+D6j8j28Bi2k2+9GXjcSDPmRcba44LJYjP/JblKNMRCZuL4wCklhayEuV7F00WwaTWOgPMcq1W9DvebltmBlemaWBMboafONwfALOmhxVXRmo5ZngqCyro+dELIyatxttMgXaGDbWRYrdqMv2wix9jYn0XneoOCE2c0NyTiuAQAbKFJ/DDK8u3HBEc3XmlOTaJWq3R74bhYaNRcwCbEB95/05jDN9QEmMbgWY5+S3mP2CTh4LmdKZhrNpR2X2Hv0x8CYfvJr2WxUu8cnNkblnxIgQrRxpABj9JcRi8cfOiHwggAtU9R/iEC2SeYJTlEIagkFRFxwDVPyag2d5czLUYui+imRo6f+lFaTbmldi+tFjmY+2iq8zNd8vNPwG/mPIYb6E8mrvwc5Yoa0tYZenDbwTcROreCoQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(39850400004)(396003)(136003)(376002)(451199021)(31686004)(2906002)(478600001)(6486002)(36756003)(7416002)(316002)(4326008)(6916009)(66476007)(66556008)(66946007)(8676002)(41300700001)(54906003)(83380400001)(38100700002)(6512007)(53546011)(8936002)(5660300002)(86362001)(31696002)(6506007)(186003)(2616005)(26005)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?LzVBL202MWpIZWhVcUZYWTlYQm1ucDFFc2FVYmxDdTlzbXgvdXY1S2NHMEpY?=
 =?utf-8?B?bEI4S2ZVRU8vSmo3NldTT3g2SFlIQlZWUUpPMkoxUFo3K1RrYWVNT0hiNGE1?=
 =?utf-8?B?T05pd1dmNk9VQUpwc2xwV3dIMWowQkhjOEpuTjBlSEVndTJlMGtNT1VxR1RQ?=
 =?utf-8?B?SStMUkFrT29iZ0Iwc3Q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dmdqYmpjSXBkZTNCTUlYOXJRTjBwWFd4R0Qzd2ZnZ1FFNE12?=
 =?utf-8?B?dHR4K2R0dFlVOVZWbDZRMFNzaUZGNnFaT2lBeVBGOTg5UmVFZGtpeGZHRHVw?=
 =?utf-8?B?SmRsSUt5UG5tN1d6a2oxc29ZeVBNeENobkhXZXZJUzh4b05mK3UvSndnVXZG?=
 =?utf-8?Q?1rRGlyUt0k1DfH/Y0KAhmcCc7?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e896d992-5e54-4ef3-4559-08db8c1fb80b
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 08:26:46.3820
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: NHP8KjfSb4+Y5/eq04BbnzgXJ3KnaJ7Td0mwKy6KCdtmbXNb1PChcX9PG9L0hee4BSV4HVwV0u5PeItLGZbR8w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6949

On 21.07.2023 17:31, Nicola Vetrini wrote:
> Rule 5.3 has the following headline:
> "An identifier declared in an inner scope shall not hide an
> identifier declared in an outer scope"
> 
> The renaming s/sched_id/scheduler_id of the function defined in
> 'xen/common/sched/core.c' prevents any hiding of that function
> by the many instances of omonymous function parameters.
> 
> Similarly, the renames
> - s/ops/operations
> - s/do_softirq/exec_softirq
> - s/loop/it
> are introduced for parameter names, to avoid any conflict
> with the homonymous variable or function defined in an enclosing
> scope.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
>  xen/common/sched/core.c    | 18 +++++++++---------
>  xen/common/sched/credit2.c |  4 ++--
>  xen/common/sysctl.c        |  2 +-
>  xen/include/xen/sched.h    |  2 +-
>  4 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
> index 022f548652..e74b1208bd 100644
> --- a/xen/common/sched/core.c
> +++ b/xen/common/sched/core.c
> @@ -99,13 +99,13 @@ static void sched_set_affinity(
>      struct sched_unit *unit, const cpumask_t *hard, const cpumask_t *soft);
>  
>  static struct sched_resource *cf_check
> -sched_idle_res_pick(const struct scheduler *ops, const struct sched_unit *unit)
> +sched_idle_res_pick(const struct scheduler *operations, const struct sched_unit *unit)
>  {
>      return unit->res;
>  }
>  
>  static void *cf_check
> -sched_idle_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
> +sched_idle_alloc_udata(const struct scheduler *operations, struct sched_unit *unit,
>                         void *dd)
>  {
>      /* Any non-NULL pointer is fine here. */
> @@ -113,12 +113,12 @@ sched_idle_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
>  }
>  
>  static void cf_check
> -sched_idle_free_udata(const struct scheduler *ops, void *priv)
> +sched_idle_free_udata(const struct scheduler *operations, void *priv)
>  {
>  }
>  
>  static void cf_check sched_idle_schedule(
> -    const struct scheduler *ops, struct sched_unit *unit, s_time_t now,
> +    const struct scheduler *operations, struct sched_unit *unit, s_time_t now,
>      bool tasklet_work_scheduled)
>  {
>      const unsigned int cpu = smp_processor_id();

These renames bring the idle scheduler out of sync with all others. I
think it wants considering to rename the file scope variable instead.

> @@ -2579,7 +2579,7 @@ static void cf_check sched_slave(void)
>      struct sched_unit    *prev = vprev->sched_unit, *next;
>      s_time_t              now;
>      spinlock_t           *lock;
> -    bool                  do_softirq = false;
> +    bool                  exec_softirq = false;

As an alternative to Stefano's suggestion, maybe consider "need_softirq"?

> --- a/xen/common/sched/credit2.c
> +++ b/xen/common/sched/credit2.c
> @@ -3884,7 +3884,7 @@ csched2_dump(const struct scheduler *ops)
>      list_for_each_entry ( rqd, &prv->rql, rql )
>      {
>          struct list_head *iter, *runq = &rqd->runq;
> -        int loop = 0;
> +        int it = 0;

Instead of renaming, why can't we just drop this second variable, re-using
the outer scope one here (and at the same time doing away with a not really
appropriate use of plain "int")? (This may then want accompanying by ...

> @@ -3901,7 +3901,7 @@ csched2_dump(const struct scheduler *ops)
>  
>              if ( svc )
>              {
> -                printk("\t%3d: ", loop++);
> +                printk("\t%3d: ", it++);

... switching to %3u here.)

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 08:27:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 08:27:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568487.887823 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNquk-0001Rg-8M; Mon, 24 Jul 2023 08:27:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568487.887823; Mon, 24 Jul 2023 08:27:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNquk-0001RZ-57; Mon, 24 Jul 2023 08:27:34 +0000
Received: by outflank-mailman (input) for mailman id 568487;
 Mon, 24 Jul 2023 08:27:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=c6P8=DK=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qNqui-0000Yk-Oc
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 08:27:32 +0000
Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com
 [2a00:1450:4864:20::634])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ef1215b6-29fb-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 10:27:32 +0200 (CEST)
Received: by mail-ej1-x634.google.com with SMTP id
 a640c23a62f3a-9923833737eso598944866b.3
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 01:27:32 -0700 (PDT)
Received: from [192.168.202.116] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 xo18-20020a170907bb9200b0099b5a71b0bfsm6173112ejc.94.2023.07.24.01.27.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 01:27:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ef1215b6-29fb-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690187251; x=1690792051;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=oDM+O9TwQTPY83TgZyOpL4QH+TDWcxO4fMX5Irgc2Nc=;
        b=mGYIaghdHbxdLeAcjqF/WB4DcAECBxTMDXnyfnuQ4RSd9oib+Gibtv1hawU+08inep
         s8wuGiqq5TphUOam7uraxV08mZQmgzHePlLsGFvmc1ngdUq4SfZvvzJUFIaDkN3LuYKc
         yDGuN+KUly77S3va7rpPbYe+4i3+QmS/bcd9z6sBdSYPswsm6mwuQb7Ykv4A7/D0wviA
         WPV1Omw/TFf2xzv+meUW+DIql5iNc9mqr3peZFBVdu9B9GjVhZmbxXhj70KGWmfhEQ6D
         3JDhaJA/ilmh0Kug1/jBA74WIttHopTxCWAQMBfzDd5fs4aF1q23Tg+ls9xpdt1R6iwX
         LJzg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690187251; x=1690792051;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=oDM+O9TwQTPY83TgZyOpL4QH+TDWcxO4fMX5Irgc2Nc=;
        b=kJnAPdwv3YSiyQVBxE/+E9XvWehW4fqLbUECF6xxxRJ+HLYylZnJyPbt9RTHyl9fkk
         TSKRzXwT7UbQewIEV30fuS9Z+uwVxCKVHzsOW4mHq2wjM+v3C+EHPcTEvyedirukJ+zh
         HN0uXjaFgHpjZWNKLPTfedhSeGojwsIJeyUSSpd7GTNKlzL6oVoywn/xG5ydjQf5yGOv
         h3kAq/0H+RkxtCHm4j0DcxUkoksr2L8A1JgN9DS29kxizCEfhY8T4f+b9qmz2aIT0lWv
         OdHOOHh/AEjDP74EMylzKPfk6ow7TwBlImrE/OCX0TvY3oFLmMvGr56XEbRGowkTQiBq
         apOQ==
X-Gm-Message-State: ABy/qLaaVc23O2MjRhdkyly2jYuK9OgyL5savKQHju/7X9dWYTKgMEl4
	Kv82H3fm2vavHUdrf8UKwXM=
X-Google-Smtp-Source: APBJJlG/J+qQBa2YvAtpv3uz1KuaXp3uqDWTGKbpHoLwWhDO0R1IIWbzDTDngJipkPdEMd9Qd5yb1Q==
X-Received: by 2002:a17:906:8a43:b0:99b:4bab:2839 with SMTP id gx3-20020a1709068a4300b0099b4bab2839mr9443885ejc.55.1690187251298;
        Mon, 24 Jul 2023 01:27:31 -0700 (PDT)
Message-ID: <ccfad0f751df1e498d1c5cea3eb373e263f91d00.camel@gmail.com>
Subject: Re: [PATCH] automation: avoid duplicated builds of staging branch
From: Oleksii <oleksii.kurochko@gmail.com>
To: Stefano Stabellini <sstabellini@kernel.org>, Marek
	=?ISO-8859-1?Q?Marczykowski-G=F3recki?=
	 <marmarek@invisiblethingslab.com>, andrew.cooper3@citrix.com
Cc: xen-devel@lists.xenproject.org, Doug Goldstein <cardoe@cardoe.com>, 
	"committers@xenproject.org"
	 <committers@xenproject.org>
Date: Mon, 24 Jul 2023 11:27:30 +0300
In-Reply-To: <alpine.DEB.2.22.394.2307211811020.3118466@ubuntu-linux-20-04-desktop>
References: <20230717130925.28183-1-marmarek@invisiblethingslab.com>
	 <cf7ac648-dbef-80bb-986b-3fe0daef855a@citrix.com>
	 <ZLVLaPeyOwDYYUXL@mail-itl>
	 <alpine.DEB.2.22.394.2307211627080.3118466@ubuntu-linux-20-04-desktop>
	 <ZLsd3tdSvTLwIyt3@mail-itl>
	 <alpine.DEB.2.22.394.2307211712430.3118466@ubuntu-linux-20-04-desktop>
	 <ZLshtl8KKgyR1wlY@mail-itl>
	 <alpine.DEB.2.22.394.2307211749270.3118466@ubuntu-linux-20-04-desktop>
	 <ZLsqSWXvwxBQK3NG@mail-itl>
	 <alpine.DEB.2.22.394.2307211811020.3118466@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

Hi Stefano,

On Fri, 2023-07-21 at 18:18 -0700, Stefano Stabellini wrote:
> Hi Andrew, Oleksii,
>=20
> Please see below.
>=20
> It looks like you have configured your personal repositories to
> mirror
> upstream Xen:
>=20
> https://gitlab.com/xen-project/people/olkur/xen
> https://gitlab.com/xen-project/people/andyhhp/xen
>=20
> Make sure that the option "Trigger pipelines for mirror updates" is
> unselected.
>=20
> If you setup the mirror a long time ago, you might want to stop the
> mirror and start it again.
>=20
> I have just done the same for fusa/xen-integration: I had to go to
> settings->repository, stop the existing mirror, and create a new one
> making sure "Trigger pipelines for mirror updates" is off.
I checked the option is unselected.

But I have selected "Mirror all branches" in "Mirror branches".
I can use "Mirror specific branches" to avoid 'staging' mirroring.

Will it be enough?

~ Oleksii
>=20
>=20
>=20
> On Sat, 22 Jul 2023, Marek Marczykowski-G=C3=B3recki wrote:
> > On Fri, Jul 21, 2023 at 05:49:49PM -0700, Stefano Stabellini wrote:
> > > On Sat, 22 Jul 2023, Marek Marczykowski-G=C3=B3recki wrote:
> > > > On Fri, Jul 21, 2023 at 05:14:01PM -0700, Stefano Stabellini
> > > > wrote:
> > > > > On Sat, 22 Jul 2023, Marek Marczykowski-G=C3=B3recki wrote:
> > > > > > On Fri, Jul 21, 2023 at 04:42:11PM -0700, Stefano
> > > > > > Stabellini wrote:
> > > > > > > On Mon, 17 Jul 2023, Marek Marczykowski-G=C3=B3recki wrote:
> > > > > > > > On Mon, Jul 17, 2023 at 02:14:14PM +0100, Andrew Cooper
> > > > > > > > wrote:
> > > > > > > > > On 17/07/2023 2:09 pm, Marek Marczykowski-G=C3=B3recki
> > > > > > > > > wrote:
> > > > > > > > > > "staging" branch is mirrored (automatically or
> > > > > > > > > > manually) to several
> > > > > > > > > > repositories. Avoid building it several times to
> > > > > > > > > > not waste runner
> > > > > > > > > > resources.
> > > > > > >=20
> > > > > > > Hi Marek,
> > > > > > >=20
> > > > > > > Let me try to understand the use-case a bit better. You
> > > > > > > would like the
> > > > > > > following "staging" branch to run a full pipeline:
> > > > > > > https://gitlab.com/xen-project/xen
> > > > > > >=20
> > > > > > > But if someone under xen-project/people is mirroring
> > > > > > > https://gitlab.com/xen-project/xen, this patch is
> > > > > > > attempting to skip the
> > > > > > > additional pipeline. For instance, if I am mirroring
> > > > > > > staging in my
> > > > > > > personal repo:
> > > > > > >=20
> > > > > > > https://gitlab.com/xen-project/people/sstabellini/xen
> > > > > > >=20
> > > > > > > We are skipping the additional pipeline there.
> > > > > >=20
> > > > > > Yes.
> > > > > >=20
> > > > > > > Is that correct? If so, it would be easier to ask
> > > > > > > everyone to make sure
> > > > > > > they have "Trigger pipelines for mirror updates"
> > > > > > > unselected:
> > > > > > >=20
> > > > > > > https://docs.gitlab.com/ee/user/project/repository/mirror/pul=
l.html#trigger-pipelines-for-mirror-updates
> > > > > >=20
> > > > > > If that's set in gitlab as pull mirror (instead of push
> > > > > > from somewhere
> > > > > > else), then that indeed may be enough. But is it really in
> > > > > > all those
> > > > > > cases?
> > > > >=20
> > > > > Yes, it is an option in the pull mirror, by default should be
> > > > > unselected
> > > > > I believe.
> > > >=20
> > > > Well, if that's the case, either it got manually enabled on
> > > > those 4 (?)
> > > > forks, or those are using something else for mirroring the
> > > > staging
> > > > branch (in which case, the setting would not help). I can't see
> > > > this
> > > > part of the settings in other's repositories, so I don't know.
> > >=20
> > > Do you know the name of those 4 forks? I can help figure it out.
> >=20
> > Looking at "activity" view on gitlab, I see those:
> > https://gitlab.com/xen-project/fusa/xen-integration
> > https://gitlab.com/xen-project/people/olkur/xen
> > https://gitlab.com/xen-project/people/andyhhp/xen
> >=20
> > There are few more that have staging branch almost up to date, but
> > seems
> > to be pushed manually (based on it being not fully up to date) and
> > less
> > often.
> >=20
> > --=20
> > Best Regards,
> > Marek Marczykowski-G=C3=B3recki
> > Invisible Things Lab



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 08:29:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 08:29:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568491.887833 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqwh-00029t-Jr; Mon, 24 Jul 2023 08:29:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568491.887833; Mon, 24 Jul 2023 08:29:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNqwh-00029k-Gs; Mon, 24 Jul 2023 08:29:35 +0000
Received: by outflank-mailman (input) for mailman id 568491;
 Mon, 24 Jul 2023 08:29:34 +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 <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNqwg-00029c-Gx
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 08:29:34 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on2060e.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::60e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 35a8f480-29fc-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 10:29:32 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB7549.eurprd04.prod.outlook.com (2603:10a6:102:e0::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.31; Mon, 24 Jul
 2023 08:29:29 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 08:29:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 35a8f480-29fc-11ee-8612-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=lahD2FPQof/jxrQc5I44eWWYcW4y06gpqTW2zjlu0Xteiv+rQ0VxIXXQ8dFhvF2wuTe2uyXQ30CqLUBjWqoSgLlyTMZkBROCr37/xpwV5u2b86OPaZm0nEUzNVDaTexC+z6NPsd3RXaOPzqgAXMuRi0sjpDgX39sYkjOl1NZ1Wv4lTtI8Kmm/NWjxg7GjEzEMrKJ3NH/Zc71tV0mMYYHgeQRhyNJhWwJA8+KIWBGNALezbiKOFmhQ6Ec2DmZBFVJ9IEq0aIqWfhsWFFk6fXbYCmAk8T8zbIsn70i8I9h9Ay7xUyDY7yLlEdogI0+jk/u2KoTADW1fHBUVxtJwysp8w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=vfDke/U+2CTCKL9TRdwGPQCdC4iiO9A5/s2heYKZN04=;
 b=IIbHl+zjHhxClRhnXYCcmgMovcKYfC3yX/6vd7YIMHFyGjUjLoI301a3SmdAJ4sWDrWTyXWPIjxryHmk8CMhdoAvVEmXwT227jBRtGB1Ua67P4Jw+5qiQQ6DwwMIsjDqPpuzWTRHUOMUTOlUrbm/LEcL2Ghw6Z3tAbSm7CUkmDSn+JqQ/8smxR5HFE3kwK7NpxsfLv6OcQgEx2ZSgpU8T9i0Af5Xajy0hv6nIoD1Wmfc0sL9jV4E+aOWv2EnsYei58QKIJprQKa7KzE41KTx9vQWPYZX0j/BhUbXws8HWp8Lze2xU6lvP/R3XkAcU6DzIU8jSFjRV7bow1sJAYJe7A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=vfDke/U+2CTCKL9TRdwGPQCdC4iiO9A5/s2heYKZN04=;
 b=OqFws6FzrWcX2y+V37N+N00N0a0nEdra+Oom7vfBghbKvu7X0ZmvTsj5Z4qwEc7DiAtp1f5qUqT/H+0lr2u8jmNgdglCyPuKwJxhqYuAUvY3ti1FSPPCOZ0f3NXqF24+DUPhQBdm+WCjR9xLMS1gJbLZJ59DuTj2nqSrGrcEGj2E2uazI+Pga7b3rSHOds9qVmja8Yy1V+lcyYbhzPy3ukiVxlHvMfW71xxJCmY4c6TVE0OsoSlNi7hAGWuMpUYxCeHq1xWGFM4tyXvG7X5jVlooU/gftgHMKiqL5ZfW2wPLOWrMEV5v0P5aW7D1GmR/SK71jsHtOYo+kS0/6n+FYg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <37878809-d541-c891-fa73-ecac321af00a@suse.com>
Date: Mon, 24 Jul 2023 10:29:28 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2] docs/misra: add Rule 1.1 and 5.6
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: andrew.cooper3@citrix.com, roger.pau@citrix.com, julien@xen.org,
 george.dunlap@citrix.com, bertrand.marquis@arm.com,
 Stefano Stabellini <stefano.stabellini@amd.com>,
 xen-devel@lists.xenproject.org
References: <20230721221636.3693746-1-sstabellini@kernel.org>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230721221636.3693746-1-sstabellini@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0236.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b2::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB7549:EE_
X-MS-Office365-Filtering-Correlation-Id: 864d19ac-d92f-4538-ea26-08db8c201831
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	nTgPXBzE4XDFWzHj7Ol+CwuCz+LPfrqAYMCAppbGblY1kN4Z1mKCogu+r3t/pty52GI/cL1VnvG94C6kQ4PDvRB9IfJf6Ad8lT7UL4mH31YRWzrPvZNofl2gdA+r3iDv02jB5citAtVeoyaaoCWhwu73RYcT6esGiNnaHRll5gq/r4FaGWDRuZ8ueUUNJ+3TVbOkCj2BZRU4OqJOf7vB+JetDp2RYX7LhNTZ5mKdcUpL6+coc9WhWlG/MiCN/1EABZzOVxVMJpoW5OW/u0STjFfJ57eY0nIwqy167LBx10pLCyXv/lolAsbI6LImF0A0bQxGF7tCJnic6YIW+0HXCG+zRFxDKKsGjr/mVUEqkpbJpqZ643Vvyz3Asij3xL3Oh4hx+Rr3DQYkqy8jy/i5IxDlbwRLuOZtSg74G/1FIRfQqJ4u4+pE/Lcn0yF1gyVkUW6R+rsvaXC0Imw1joNOK3Fb/f7sv+DuQeZpSZz7XfkV8bgEXslfpNjBZgKv4e725ZV2vKVFEuUxkNX99JOmmU22oLw7t1WYxXX4oUXfRBjk21+JAX1kc9K5x155znOLcrE/4HQy5CydlvYxGNRQwOWXQw/gNEKYBkHt8SDJwa8O+dUh+Nd7Tj+yxx/FCDKaKm+og6m9O5UlDFSr3YfjHQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(136003)(39860400002)(376002)(346002)(396003)(451199021)(31686004)(86362001)(31696002)(38100700002)(316002)(66556008)(66476007)(4326008)(478600001)(41300700001)(66946007)(5660300002)(8676002)(8936002)(6486002)(6512007)(4744005)(2906002)(26005)(186003)(6506007)(36756003)(53546011)(6916009)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NFIxSjlXc3ZkcHZKcUc2bVVIaXlyWTZUeEFBbTY2cmRMSkRxMDlob2czV3Js?=
 =?utf-8?B?aVVocXpDZXg2QkIxOGZ5QVdNRGtnNlpBMUtpU3RZOGtVamZJcUx1Vlg4RTFN?=
 =?utf-8?B?TmJ3eVFhSHJqa05yVjR1OEJjY3N0NWt1NGFXTDhkTXE3Y1FFeS9QMHdxV1cr?=
 =?utf-8?B?SGtPbC9OSytYUFUzcERMcGtGUWU3R0FsSVhtdmJhaW93WDNEQldxZjlwTTZ3?=
 =?utf-8?B?dGhxV3kxcG1lNDVPU0NEc0tmWUVOcmdCU3FLQktLOE1Uak9lYWFXb1RpNlV5?=
 =?utf-8?B?eFNGcm1FTVFROHRwMkZIVUJIUVFHS2lFckVEbXZlRXBjOURQNUEyMW1ZaVdX?=
 =?utf-8?B?aUV1MXlYSDR0czhwTHNEZ3NVTnBCNEt3L2VybkZ5eTljbEZaczBoNHE2V3di?=
 =?utf-8?B?Rk9PekRvZ0hKTEpuUWFIVjFvaGlwYW96ZnFvaHhCTCtadEJJWXpvYkVTcUNH?=
 =?utf-8?B?YzVXV2hrQmUvNzlSNFVSWEx4VHErVmhFRWFJTEV6TEFYcjhnczZtR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-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 08:29:27.7040
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 807a5TkBlMQVuoa2U2rjW+qc4NwkjVlUO5NJQlSis15ip2w0QPQHjf4XIAJ6HISaK/SDSwqBEBlZX1jovgMr1Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7549

On 22.07.2023 00:16, Stefano Stabellini wrote:
> From: Stefano Stabellini <stefano.stabellini@amd.com>
> 
> Rule 1.1 is uncontroversial and we are already following it.
> 
> Rule 5.6 has been deemed a good rule to have by the MISRA C group.
> However, we do have a significant amount of violations that will take
> time to resolve and might require partial deviations in the form of
> in-code comments or MISRA C scanners special configurations (ECLAIR).
> For new code, we want this rule to generally apply hence the addition to
> docs/misra/rules.rst.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Mon Jul 24 08:40:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 08:40:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568496.887844 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNr70-0004Yr-KU; Mon, 24 Jul 2023 08:40:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568496.887844; Mon, 24 Jul 2023 08:40:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNr70-0004Yk-Ff; Mon, 24 Jul 2023 08:40:14 +0000
Received: by outflank-mailman (input) for mailman id 568496;
 Mon, 24 Jul 2023 08:40:13 +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
 <SRS0=ixEc=DK=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qNr6z-0004Ye-3y
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 08:40:13 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b1a58172-29fd-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 10:40:08 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.162.140.144])
 by support.bugseng.com (Postfix) with ESMTPSA id EFA724EE0737;
 Mon, 24 Jul 2023 10:40:09 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b1a58172-29fd-11ee-8612-37d641c3527e
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>
Subject: [XEN PATCH v2] device_tree: address violations of MISRA C:2012 Rules 8.2 and 8.3
Date: Mon, 24 Jul 2023 10:40:02 +0200
Message-Id: <502a92e9b53960a6b78fabb48d354cbb5bc1750c.1690187572.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Give a name to unnamed parameters thus addressing violations of
MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
named parameters").
Keep consistency between parameter names and types used in function
declarations and the ones used in the corresponding function
definitions, thus addressing violations of MISRA C:2012 Rule 8.3
("All declarations of an object or function shall use the same names
and type qualifiers").

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
Changes in v2:
  - improved consistency in parameter renaming.
---
 xen/common/device_tree.c      | 24 ++++++++++++------------
 xen/include/xen/device_tree.h | 16 ++++++++--------
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 0677193ab3..d52531dc9f 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -85,11 +85,11 @@ struct dt_bus
     unsigned int (*get_flags)(const __be32 *addr);
 };
 
-void dt_get_range(const __be32 **cell, const struct dt_device_node *np,
+void dt_get_range(const __be32 **cellp, const struct dt_device_node *np,
                   u64 *address, u64 *size)
 {
-    *address = dt_next_cell(dt_n_addr_cells(np), cell);
-    *size = dt_next_cell(dt_n_size_cells(np), cell);
+    *address = dt_next_cell(dt_n_addr_cells(np), cellp);
+    *size = dt_next_cell(dt_n_size_cells(np), cellp);
 }
 
 void dt_set_cell(__be32 **cellp, int size, u64 val)
@@ -993,9 +993,9 @@ int dt_device_get_paddr(const struct dt_device_node *dev, unsigned int index,
 }
 
 int dt_for_each_range(const struct dt_device_node *dev,
-                      int (*cb)(const struct dt_device_node *,
+                      int (*cb)(const struct dt_device_node *dev,
                                 uint64_t addr, uint64_t length,
-                                void *),
+                                void *data),
                       void *data)
 {
     const struct dt_device_node *parent = NULL;
@@ -1164,7 +1164,7 @@ unsigned int dt_number_of_irq(const struct dt_device_node *device)
     return (intlen / intsize);
 }
 
-unsigned int dt_number_of_address(const struct dt_device_node *dev)
+unsigned int dt_number_of_address(const struct dt_device_node *device)
 {
     const __be32 *prop;
     u32 psize;
@@ -1173,20 +1173,20 @@ unsigned int dt_number_of_address(const struct dt_device_node *dev)
     int onesize, na, ns;
 
     /* Get parent & match bus type */
-    parent = dt_get_parent(dev);
+    parent = dt_get_parent(device);
     if ( parent == NULL )
         return 0;
 
     bus = dt_match_bus(parent);
     if ( !bus )
         return 0;
-    bus->count_cells(dev, &na, &ns);
+    bus->count_cells(device, &na, &ns);
 
     if ( !DT_CHECK_COUNTS(na, ns) )
         return 0;
 
     /* Get "reg" or "assigned-addresses" property */
-    prop = dt_get_property(dev, bus->addresses, &psize);
+    prop = dt_get_property(device, bus->addresses, &psize);
     if ( prop == NULL )
         return 0;
 
@@ -1197,9 +1197,9 @@ unsigned int dt_number_of_address(const struct dt_device_node *dev)
 }
 
 int dt_for_each_irq_map(const struct dt_device_node *dev,
-                        int (*cb)(const struct dt_device_node *,
-                                  const struct dt_irq *,
-                                  void *),
+                        int (*cb)(const struct dt_device_node *dev,
+                                  const struct dt_irq *dt_irq,
+                                  void *data),
                         void *data)
 {
     const struct dt_device_node *ipar, *tnode, *old = NULL;
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index c2eada7489..8d88159f76 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -538,7 +538,7 @@ bool_t dt_machine_is_compatible(const char *compat);
  * Returns a node pointer with refcount incremented, use
  * of_node_put() on it when done.
  */
-struct dt_device_node *dt_find_node_by_name(struct dt_device_node *node,
+struct dt_device_node *dt_find_node_by_name(struct dt_device_node *from,
                                             const char *name);
 
 /**
@@ -639,7 +639,7 @@ unsigned int dt_number_of_address(const struct dt_device_node *device);
  * device-tree node. It's the high level pendant to dt_device_get_raw_irq().
  */
 int dt_device_get_irq(const struct dt_device_node *device, unsigned int index,
-                      struct dt_irq *irq);
+                      struct dt_irq *out_irq);
 
 /**
  * dt_device_get_raw_irq - Resolve an interrupt for a device without translation
@@ -652,7 +652,7 @@ int dt_device_get_irq(const struct dt_device_node *device, unsigned int index,
  */
 int dt_device_get_raw_irq(const struct dt_device_node *device,
                           unsigned int index,
-                          struct dt_raw_irq *irq);
+                          struct dt_raw_irq *out_irq);
 
 /**
  * dt_irq_translate - Translate an irq
@@ -668,9 +668,9 @@ int dt_irq_translate(const struct dt_raw_irq *raw, struct dt_irq *out_irq);
  * @data: Caller data passed to callback
  */
 int dt_for_each_irq_map(const struct dt_device_node *dev,
-                        int (*cb)(const struct dt_device_node *,
-                                  const struct dt_irq *,
-                                  void *),
+                        int (*cb)(const struct dt_device_node *dev,
+                                  const struct dt_irq *dt_irq,
+                                  void *data),
                         void *data);
 
 /**
@@ -680,9 +680,9 @@ int dt_for_each_irq_map(const struct dt_device_node *dev,
  * @data: Caller data passed to callback
  */
 int dt_for_each_range(const struct dt_device_node *dev,
-                      int (*cb)(const struct dt_device_node *,
+                      int (*cb)(const struct dt_device_node *dev,
                                 uint64_t addr, uint64_t length,
-                                void *),
+                                void *data),
                       void *data);
 
 /**
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 08:42:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 08:42:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568503.887852 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNr8l-00058Y-TQ; Mon, 24 Jul 2023 08:42:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568503.887852; Mon, 24 Jul 2023 08:42:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNr8l-00058R-Qf; Mon, 24 Jul 2023 08:42:03 +0000
Received: by outflank-mailman (input) for mailman id 568503;
 Mon, 24 Jul 2023 08:42:02 +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
 <SRS0=AOzI=DK=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qNr8k-00058J-QR
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 08:42:02 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f34440b1-29fd-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 10:41:58 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.162.132.135])
 by support.bugseng.com (Postfix) with ESMTPSA id F18A44EE0737;
 Mon, 24 Jul 2023 10:41:58 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f34440b1-29fd-11ee-8612-37d641c3527e
Message-ID: <f96761cf-1329-2a95-29bc-4d0ae97423f5@bugseng.com>
Date: Mon, 24 Jul 2023 10:41:57 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] xen/spinlock: mechanically rename parameter name
 'debug'
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
References: <78255b6c5caaaa02dad638c7d4102ea793a09b88.1689953306.git.nicola.vetrini@bugseng.com>
 <4f3b6c7c-f8a3-b904-1b23-baa9eb2455a1@suse.com>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <4f3b6c7c-f8a3-b904-1b23-baa9eb2455a1@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 24/07/23 10:14, Jan Beulich wrote:
> On 21.07.2023 17:29, Nicola Vetrini wrote:
>> --- a/xen/common/spinlock.c
>> +++ b/xen/common/spinlock.c
>> @@ -78,7 +78,7 @@ static int __init cf_check lockdebug_init(void)
>>   }
>>   presmp_initcall(lockdebug_init);
>>   
>> -void check_lock(union lock_debug *debug, bool try)
>> +void check_lock(union lock_debug *dbg, bool try)
> 
> I consider it reasonably likely that something named "dbg" might also
> appear, when we already have something with as generic a named as
> "debug". How about naming these parameters "ld", "ldbg", "lkdbg", or
> yet something along these lines, but (at least slightly) less generic?
> 

No problem. I prefer "lkdbg" among the alternatives.

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 08:52:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 08:52:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568509.887863 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNrIs-0006jN-US; Mon, 24 Jul 2023 08:52:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568509.887863; Mon, 24 Jul 2023 08:52:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNrIs-0006jG-Ri; Mon, 24 Jul 2023 08:52:30 +0000
Received: by outflank-mailman (input) for mailman id 568509;
 Mon, 24 Jul 2023 08:52:29 +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
 <SRS0=FJWe=DK=linaro.org=leo.yan@srs-se1.protection.inumbo.net>)
 id 1qNrIr-0006j1-DI
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 08:52:29 +0000
Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com
 [2607:f8b0:4864:20::436])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 68f6c0e0-29ff-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 10:52:25 +0200 (CEST)
Received: by mail-pf1-x436.google.com with SMTP id
 d2e1a72fcca58-666e97fcc60so2168016b3a.3
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 01:52:26 -0700 (PDT)
Received: from leoy-yangtze.lan (n058152048165.netvigator.com. [58.152.48.165])
 by smtp.gmail.com with ESMTPSA id
 y10-20020aa7804a000000b006862af32fbesm7468270pfm.14.2023.07.24.01.52.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 01:52:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 68f6c0e0-29ff-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690188745; x=1690793545;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=Q3vP9oVx6XJxTpEk4lj39ypfC446ppW0B9Ad1g8MeRw=;
        b=a3aK1Xru3bnq80T4H/MTa4a2WlJfUFOMxElqqeRaJkTKwmZcEoboJH/E02s0rCduKl
         c73qtM8iMbSWp9/Apmi1P8MgtZQ0wYyyKibF00sM0WKlDmn7dXQVlHgBZGI7iB8A97XA
         SZGoq+pBUkcJRghyD9kuZX64t3yvpWN1fvLvu1budovqTiCjXqa4o67sA3rqsb6R3DGV
         9gvw0/Nmj5oLnYrGa/Dy/XFjtKsmSXtCmAKMitE9PiN/2MJKk2+B3KjeFMc3nd8JRkA4
         fCHZFca7p/gF1o/DPU1ce9O3sa+YH+m3dcoa7njjj4HSs0M1i3hQiam6JWiJkdQW6AwX
         ESzg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690188745; x=1690793545;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=Q3vP9oVx6XJxTpEk4lj39ypfC446ppW0B9Ad1g8MeRw=;
        b=ODORZ3rTk1mutikV0PUKWcfNgL3Oxlaola0gNtACIQAsM5Z+LdsVFP8ixPGWYB2eO9
         IMdTgcsJlq9eLrBN3gRsz81/cYVTz5NOmRgrzMD2OdFhcQn83bpioP5sfIzOCFe0sK2i
         L0LIPVn6qvIrtZ5yilR2T4SVlZEsQAbRurjCvYdt9fYAv5ix65sgVvvU764P13YER0ij
         2sParBmI5ScDftQHapux3MDBMcLivcMZm7XizUfZfBrfOkZnuFrVo0m5Ypfbqrn7QFDf
         RmlM56FfK5Q1oHoGyBoviS9LNLPhl9U4n3NFABE9NDI+DIs4Ul2fVICFep7zNGPTSEm5
         85qg==
X-Gm-Message-State: ABy/qLZ7ss6HQ//8nZ1WlalpiF6VUk23Xe2hphkZUlAPSYI+RL1f7ntM
	SD4rX0r39RFXE92gMcN3L/UqqBO3Zo5SJTG9xnU2WQ==
X-Google-Smtp-Source: APBJJlHDhVp69JuqF8N0VBOWFEmBhf+3xPkJoxi2C2DVG7PlwC7504jjwnIFnTRlY9wKAS3aZbavfg==
X-Received: by 2002:a05:6a00:2d8a:b0:666:81ae:fec0 with SMTP id fb10-20020a056a002d8a00b0066681aefec0mr5678751pfb.25.1690188744850;
        Mon, 24 Jul 2023 01:52:24 -0700 (PDT)
From: Leo Yan <leo.yan@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Leo Yan <leo.yan@linaro.org>
Subject: [PATCH] docs: Correct name for xen-command-line.pandoc
Date: Mon, 24 Jul 2023 16:52:11 +0800
Message-Id: <20230724085211.1383703-1-leo.yan@linaro.org>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In the commit d661611d08 ("docs/markdown: Switch to using pandoc, and
fix underscore escaping"), the documentation suffix was changed from
".markdown" to ".pandoc"; however, the reference was missed to update.

This patch updates the documentation name to xen-command-line.pandoc.

Fixes: d661611d08 ("docs/markdown: Switch to using pandoc, and fix underscore escaping")
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 docs/features/sched_credit2.pandoc | 2 +-
 docs/misc/arm/big.LITTLE.txt       | 2 +-
 xen/common/Kconfig                 | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/docs/features/sched_credit2.pandoc b/docs/features/sched_credit2.pandoc
index 436ff9f8f6..ef07e463cb 100644
--- a/docs/features/sched_credit2.pandoc
+++ b/docs/features/sched_credit2.pandoc
@@ -27,7 +27,7 @@ different than `credit2`) parameter is passed to Xen via the
 bootloader.
 
 Other parameters are available for tuning the behavior of Credit2
-(see `docs/misc/xen-command-line.markdown` for a complete list and
+(see `docs/misc/xen-command-line.pandoc` for a complete list and
 for their meaning).
 
 Once the system is live, for creating a cpupool with Credit2 as
diff --git a/docs/misc/arm/big.LITTLE.txt b/docs/misc/arm/big.LITTLE.txt
index b6ea1c9d61..1d11058444 100644
--- a/docs/misc/arm/big.LITTLE.txt
+++ b/docs/misc/arm/big.LITTLE.txt
@@ -42,5 +42,5 @@ The following option runs one domain vcpu as big and one as LITTLE:
   cpus = ["0-3", "4-7"]
 
 
-[1] docs/misc/xen-command-line.markdown
+[1] docs/misc/xen-command-line.pandoc
 [2] docs/man/xl.cfg.pod.5
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index dd8d7c3f1c..0d248ab941 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -440,7 +440,7 @@ config DOM0_MEM
 	  The specified string will be used for the dom0_mem parameter in
 	  case it was not specified on the command line.
 
-	  See docs/misc/xen-command-line.markdown for the supported syntax.
+	  See docs/misc/xen-command-line.pandoc for the supported syntax.
 
 	  Leave empty if you are not sure what to specify.
 
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:17:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:17:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568513.887873 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNrgI-0000u2-Sp; Mon, 24 Jul 2023 09:16:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568513.887873; Mon, 24 Jul 2023 09:16:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNrgI-0000tv-OG; Mon, 24 Jul 2023 09:16:42 +0000
Received: by outflank-mailman (input) for mailman id 568513;
 Mon, 24 Jul 2023 09:16:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNrgH-0000tp-47
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:16:41 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cbfd16d6-2a02-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:16:39 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 3809822897;
 Mon, 24 Jul 2023 09:16:39 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0D4C213476;
 Mon, 24 Jul 2023 09:16:39 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id YO2jAXdBvmQ/IQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 09:16:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cbfd16d6-2a02-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690190199; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=PVqUYuKw5DtX3E/gcgs6pb3jzkLuApZdht3gzt5Cm50=;
	b=f7uL/Wzhfec9yNBM8nwWO1QCoIl8j6hMw5PZ2mj72v6LW4XVlviqTa7qi9ntiTiaroDmuC
	slXH9Jp/bHbygQIqGHGFswTs5kT5ViiK3tfLAGqcvtFBJPzcPxPItouBsKUCq8T0/158Gs
	5nTh54WQe3YrxMCnWORNKhJwevODdlg=
Message-ID: <9dfdc8fb-443e-8f93-6602-8f3da36e4dd7@suse.com>
Date: Mon, 24 Jul 2023 11:16:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH] xenbus: check xen_domain in xenbus_probe_initcall
Content-Language: en-US
To: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Stefano Stabellini <sstabellini@kernel.org>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "pmladek@suse.com" <pmladek@suse.com>
References: <alpine.DEB.2.22.394.2307211609140.3118466@ubuntu-linux-20-04-desktop>
 <1fa1bb86-f0a9-62f5-b61a-ffb29daa81f5@epam.com>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <1fa1bb86-f0a9-62f5-b61a-ffb29daa81f5@epam.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------5jpAB1ZNhb0zUMmRkR2ST0EN"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------5jpAB1ZNhb0zUMmRkR2ST0EN
Content-Type: multipart/mixed; boundary="------------DzOmqtnTZFubx8I0Bg7JsIrh";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 Stefano Stabellini <sstabellini@kernel.org>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 "pmladek@suse.com" <pmladek@suse.com>
Message-ID: <9dfdc8fb-443e-8f93-6602-8f3da36e4dd7@suse.com>
Subject: Re: [PATCH] xenbus: check xen_domain in xenbus_probe_initcall
References: <alpine.DEB.2.22.394.2307211609140.3118466@ubuntu-linux-20-04-desktop>
 <1fa1bb86-f0a9-62f5-b61a-ffb29daa81f5@epam.com>
In-Reply-To: <1fa1bb86-f0a9-62f5-b61a-ffb29daa81f5@epam.com>

--------------DzOmqtnTZFubx8I0Bg7JsIrh
Content-Type: multipart/mixed; boundary="------------BQ7VU3I4Ib1808UMHFmXbJut"

--------------BQ7VU3I4Ib1808UMHFmXbJut
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjIuMDcuMjMgMTU6MDAsIE9sZWtzYW5kci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
ZnhfeGVuYnVzX3Byb2JlX3RocmVhZCsweDEwLzB4MTANCj4+IFsgIDM1Mi4yMTk2MDBdICB4
ZW5idXNfcHJvYmUrMHg3YS8weDgwDQo+PiBbICAzNTIuMjIxMDMwXSAgeGVuYnVzX3Byb2Jl
X3RocmVhZCsweDc2LzB4YzANCj4+DQo+PiBTaWduZWQtb2ZmLWJ5OiBTdGVmYW5vIFN0YWJl
bGxpbmkgPHN0ZWZhbm8uc3RhYmVsbGluaUBhbWQuY29tPg0KPj4gVGVzdGVkLWJ5OiBQZXRy
IE1sYWRlayA8cG1sYWRla0BzdXNlLmNvbT4NCj4gDQo+IA0KPiBSZXZpZXdlZC1ieTogT2xl
a3NhbmRyIFR5c2hjaGVua28gPG9sZWtzYW5kcl90eXNoY2hlbmtvQGVwYW0uY29tPg0KPiAN
Cj4gSSBndWVzcyB0aGlzIHdhbnRzIHRvIGdhaW4gdGhlIEZpeGVzIHRhZzoNCj4gDQo+IEZp
eGVzOiA1YjMzNTM5NDllODkgKCJ4ZW46IGFkZCBzdXBwb3J0IGZvciBpbml0aWFsaXppbmcg
eGVuc3RvcmUgbGF0ZXINCj4gYXMgSFZNIGRvbWFpbiIpDQoNCkknbGwgYWRkIGl0IHdoZW4g
Y29tbWl0dGluZy4NCg0KDQpKdWVyZ2VuDQo=
--------------BQ7VU3I4Ib1808UMHFmXbJut
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU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xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------BQ7VU3I4Ib1808UMHFmXbJut--

--------------DzOmqtnTZFubx8I0Bg7JsIrh--

--------------5jpAB1ZNhb0zUMmRkR2ST0EN
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmS+QXYFAwAAAAAACgkQsN6d1ii/Ey9n
KAf9Hj4DgJBzzT8gpPihw1w6pQ97w7OH8tPD0jUYIZHPmmn37LgnHek1HVcDPx//c0eZVA14F0N3
UTnz0hq9Qc1kPDlv/r4rH5C0HqBcphbRnmn9qS9p8GWJOQhKXX1a3+et2LfHmt1BCJW2DrCaIaDm
ujmUUfk7d4O6I3RFZIlqT+43o5peyaLeNhxLrZWu9JPhxHE+9YDv9w6gj5z6ATLcxQZ17dEhtKJs
/C2C09fGUOVqabMGwW+6ldGicB4QeQ7A10zNaESHOV0r+9YnA5CgMg73YTidB5uuHFL3q5EzO/cN
rF1FQU2hMWdJgPBvIeTDs/lD+Z43o6NQRxMA295oXQ==
=NfFS
-----END PGP SIGNATURE-----

--------------5jpAB1ZNhb0zUMmRkR2ST0EN--


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:40:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:40:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568516.887883 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNs2n-0003Tv-L6; Mon, 24 Jul 2023 09:39:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568516.887883; Mon, 24 Jul 2023 09:39:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNs2n-0003To-Hk; Mon, 24 Jul 2023 09:39:57 +0000
Received: by outflank-mailman (input) for mailman id 568516;
 Mon, 24 Jul 2023 09:39:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNs2m-0003Te-1s; Mon, 24 Jul 2023 09:39:56 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNs2l-0003xr-Ns; Mon, 24 Jul 2023 09:39:55 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNs2l-0001A0-68; Mon, 24 Jul 2023 09:39:55 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qNs2l-0006vp-5l; Mon, 24 Jul 2023 09:39:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Ihml9Vq8OAT6sL7keJZ1BGR53Te1lo3h9dkOrDiC6go=; b=jZlGat5ziEVxg6gCvk7qhhHZ2e
	6g3Jf4LC1WXb7wM7cDqgry4ez+lPTT+E9JGrwbOLKaaL952KguLL4l73er7mLr0FeISQlZ8Cqdg+3
	62iVW1nA5ugg2HKgEO7PCMXuFhAh0ryHNb6Ymg/RqF5bKMyYC3Akxp6cAAMz9B2WoIJI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181987-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 181987: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-examine-bios:host-install:broken:heisenbug
    xen-unstable:test-amd64-i386-examine:xen-install:fail:heisenbug
    xen-unstable:test-amd64-i386-migrupgrade:xen-install/src_host:fail:heisenbug
    xen-unstable:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt-raw:guest-start:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    xen-unstable:test-amd64-i386-xl-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=0c53c638e16278078371ce028c74693841d7738a
X-Osstest-Versions-That:
    xen=0c53c638e16278078371ce028c74693841d7738a
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 24 Jul 2023 09:39:55 +0000

flight 181987 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181987/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-examine-bios  5 host-install            broken pass in 181981
 test-amd64-i386-examine       6 xen-install      fail in 181981 pass in 181987
 test-amd64-i386-migrupgrade 10 xen-install/src_host fail in 181981 pass in 181987
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail in 181981 pass in 181987
 test-armhf-armhf-libvirt-raw 13 guest-start      fail in 181981 pass in 181987
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 181981
 test-amd64-i386-xl-vhd       21 guest-start/debian.repeat  fail pass in 181981

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181968
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181981
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181981
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181981
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181981
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181981
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181981
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181981
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181981
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181981
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181981
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181981
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 xen                  0c53c638e16278078371ce028c74693841d7738a
baseline version:
 xen                  0c53c638e16278078371ce028c74693841d7738a

Last test of basis   181987  2023-07-24 01:53:36 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-step test-amd64-amd64-examine-bios host-install

Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:41:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:41:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568522.887892 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNs4T-0004vO-7W; Mon, 24 Jul 2023 09:41:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568522.887892; Mon, 24 Jul 2023 09:41:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNs4T-0004vF-4n; Mon, 24 Jul 2023 09:41:41 +0000
Received: by outflank-mailman (input) for mailman id 568522;
 Mon, 24 Jul 2023 09:41:39 +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 <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNs4R-0004v3-FX
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:41:39 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on2061f.outbound.protection.outlook.com
 [2a01:111:f400:fe13::61f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4819227c-2a06-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:41:36 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB7498.eurprd04.prod.outlook.com (2603:10a6:10:20b::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.31; Mon, 24 Jul
 2023 09:41:35 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 09:41:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4819227c-2a06-11ee-8612-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=aLml5g56QAklOGRs7XhhCeQCZArUx3QqjKniqfsCFzp15pfr3p2pMxrhWvWVDHFX7OtHi+DbwBPRmdWUhj1n5D2HuyjWAQONmGHnKRN64oAlrPU0rTS5Ei4qOJHX4Dyz2YNscj0jCvHxySYV1rULACfVjyTefgCQyhdXC8wyv0VNMa1zPVcXWL8u2rD22OftnJUxTmkFMbdDv5s9RJknaT3Z+ygZHV10eAYkumvs9ccIY/EbqrsOMAmtfA77REBd/ofMMlOJ41DYHqaWwUTIL2GC5nM+9ExCzNPxefYP96br2BMnX/b4sE+YbM2o0PZJN677w5u+Cvj1SuhqMYa4QQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=EYrwqGSlqyeMdaVpr7MKG2KaWIkESZGb1YTpr5NSxsA=;
 b=DFqP2YzJedCgdj+H9gxYp31t9FfavSxFgWTRH93at6n6HHs8Or46A3T7beFWZsXAxR47XS/OdEpp1FNlh0pQgcX1gztJpe5CCCEPHK2Fb3UaaH12XHxQN+P8YW3lgHxJFHG6iVyxacBI08ClclrTFBhHybDV0oi2lkjfwrJ9viap9jYgsGJzSnjIEHje/6tUCzELouA8ZcJb/G+UemVs7TgbPn3lH5e6Jqlls9XUY5bOFlEdgPpljStOmOJ/v3KDvkHTvIPNiakJT2BwTxEh6gEU85v0ubTXehzJcC5OieAxApopeRL21PX3U2Kg3VrQfOGENtYPnOgiIE5oTMUkUA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=EYrwqGSlqyeMdaVpr7MKG2KaWIkESZGb1YTpr5NSxsA=;
 b=Lfrzx7lzOFlJfeMBcQeR3n78CtzTXv7Gd/rNkqR41QbqcPROU3ngaCItr2UF7NJlukDwaD63jO/Ou/6OU0Tb2Bh2N6FbPCWl6q6tNiVbkhvA7oSDp31w0HTBhq5s2F4+7tQ/DFpUNhcQsYIVCYUf+gUrFAQ3C5nG9rUxjKRJ8QhV1Je5lndNRlsnpRhwsu+BTTkFiNMx5kKoqMmR++4aW0qQ5ed/0TwqHuUiw1ANIl5rv49TIUb1PMBR4jzjDaOkWJ1v6XxiI5mGWeORS6HgWM4rLG7vAbhbEekUim4X86ZhMU42d3FRwwtCEr5XaCb8tMAULBw6zzVby/H3BmjZCg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <7e84c743-ca1d-28ba-e79d-d43a55ebcbdf@suse.com>
Date: Mon, 24 Jul 2023 11:41:35 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 04/13] vpci: add hooks for PCI device assign/de-assign
Content-Language: en-US
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-5-volodymyr_babchuk@epam.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230720003205.1828537-5-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0206.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ad::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB7498:EE_
X-MS-Office365-Filtering-Correlation-Id: e74a0c06-53c7-4760-9b19-08db8c2a2b82
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	u/sfr8lWL3lWQERqH1AzBAF2mlBDd0+oDshsc+8cYRwNPVnejVk7JnY4om7KdoBJIl+R9qp2VX+UjrdAM5e/Jnrsaw0IotIH6kvMuWglUTnNyqAOFCnX4Xow16HznP4AKSOOqMvYGOP+Kf/uD5OShYsuQxjBKjPT6UUfh92K7nvmzg+LJU0QG8zacExLVmS4k9mq1mN4b4V7kazkLaHmRBO/hR/KrjkMD/NVFeN4bUyCD7ow9dqb6jR61xtkX6IfOB/bOgz+SojqIaWK+fhLxUXzOwsObnfQKcde+Zsg7ElsO3/NNGuvFMUjFp0sGxdP2X3NQkbByK9xiMvJx1YPgcdROimBcmwnzR+hYQckjAeFvzJsGmXCjmsc09LV4cy7z3A5re8SGwWUe7cY9/ywxorH70j5hfzlvMF02QNhOzEIeVeZrqCuzD50fMh3LKcd/gRJGBxL91M35xkWw7LJLGug3fBBBfUdJXRLHOw+4RMh86ZlLiJLyLlLddMwipMWGAk7oIFLdXk77FGEVUs279/jYooNn0rntD0dqkbkMs2qvLB7zEiZ8zEWDkDQ/xITFJ3WChfbOvrSiZUKTygepZ2C3UiT1ApYYt/tclMoBtTuYe+gvCbeZaFh3FEBoLdQmmvJdIYpXLSwj/T9+sPmsM5ITklhNyt0mCBOobwWkhsGwU55VuszXusi61OWjB52
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(396003)(376002)(39860400002)(136003)(366004)(451199021)(38100700002)(6916009)(36756003)(53546011)(2616005)(83380400001)(8676002)(8936002)(5660300002)(478600001)(54906003)(316002)(66556008)(66476007)(4326008)(66946007)(41300700001)(6486002)(26005)(186003)(6506007)(6512007)(2906002)(31686004)(31696002)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?OU94S3F0NGZxVDhlNUVQNm16UjY4RFdxMjVOYkQ1a0Q3Nm9yT0x3a0NDYnZj?=
 =?utf-8?B?N3IyNlo1Z2Y5eEloTkozL3Y2eG1ITGEydnk3dkpGVHg1dDNadlY5bVVrK0Nv?=
 =?utf-8?B?eEtZcHV4TzJvcTBOYXZzS2V6dEVyK2hTL2xZNW13K3RJWmFEUWo4MzlDS2ZY?=
 =?utf-8?B?UHJpQnpybVJZTG90UW04NWFXVWlkUWM4NERjMmRNczM2ZXgzd1JLcmFTQWZ5?=
 =?utf-8?B?MWl5cy9mdmVIZHJRV0RyYnZ6aWZ5b3k3dUpoeFdpb3dleUJsaTJpa2VrTm9O?=
 =?utf-8?B?c0VzQ2h6alliYnZVbHEvMmVtQVB4aVZrMWxFZUV6YVhjN0hnY1J4bWp5aVV1?=
 =?utf-8?B?b1FmMHc3aENGejl0TzRtbWNEYzlScVlhWjY0eWJIUXY5M3A5Q0N6YUUrQ1ll?=
 =?utf-8?B?TzdVRU1lZi9ycSszMWpWeVI3cDlsZTlkaU9TRzFFcDFrMjEyUm9MT21wQXdW?=
 =?utf-8?B?VWxmL1pMNXl6Y1plNnFmb0xnQWxSWEV2NCtCcjhPTnBTazdlYjVIVmVRUkpC?=
 =?utf-8?B?WlFGdFgxMUNlY3JQUnYvRENBUTJXZVp1S2Q3VkkvZ3VrUml1dzN6VHVTZk5k?=
 =?utf-8?B?bzZUVjRmN1R1Yy9uZFFDbkdQM3hraGw4NzRpK1ROb3BNQlZNbWNwMWpDMHM3?=
 =?utf-8?B?S1RZZDZnTVRJYzNRbFI2dVY2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oNUlC?=
 =?utf-8?B?QjUzZUJoMFZUenoxa3JJME8wWGlpcDFoY3hEOURGR2NqcDR0NDFNVjM1aTVp?=
 =?utf-8?B?aUZIa2RGT2IyaDVEU1Y1dDI2b2xWMnpPM2JmSHAyTlorRkIxRDRyMlBSRjR1?=
 =?utf-8?B?U0xZeDlVeXhleThuaHpWVENGZThsMEFWN3dHdzNmOHJDKys4ZGxUZ1VoMmRX?=
 =?utf-8?B?azRzUXE0T2hnVUV5TnQvY3BuM0RDczBHcXljWnFRL0w2SS91NkhhV2dCNk8y?=
 =?utf-8?B?VEljT1M5Slg4RXdaSCs2UlJZd2J5aHlRUUMxM1NNMThwVWxVOGhjRitzK3E1?=
 =?utf-8?B?QnlTQ0VlTHhMRm9ydWQ3RTVOazZjZTVvS2U3d2pYOUY0bkNwNVlLcEg3dUhh?=
 =?utf-8?B?Nk5yWnBTYlVPUnVXOGJvU3lNcXAzeUYwNG5obFVDSnphdUhuRytUN3RNOE9F?=
 =?utf-8?B?aDAxVTVxL2FHb1RJYWxuM25ZVWdacFNlZFJQWnpHQ0F1WXhRNUIxMzBENjZR?=
 =?utf-8?B?cXNFd0plaWZ0WlplZms0bzRBMUJLK2ltWmZtcXlabTV5T2NEVU1DdHZvRTho?=
 =?utf-8?Q?alB838Tto1/2QTAk/h+ZF1RZ2?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e74a0c06-53c7-4760-9b19-08db8c2a2b82
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 09:41:35.2453
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: sNECoBRCtDIZNCeR49dl0GvXC00AHfHTccIpOjKuGutYXk54ZFjam7hJccb93ktWCrJYZPVuRWeTnIye7e477g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7498

On 20.07.2023 02:32, Volodymyr Babchuk wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> 
> When a PCI device gets assigned/de-assigned some work on vPCI side needs
> to be done for that device. Introduce a pair of hooks so vPCI can handle
> that.
> 
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

A couple more mechanical comments in addition to what Roger said:

> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -885,6 +885,10 @@ static int deassign_device(struct domain *d, uint16_t seg, uint8_t bus,
>      if ( ret )
>          goto out;
>  
> +    write_lock(&pdev->domain->pci_lock);
> +    vpci_deassign_device(pdev);
> +    write_unlock(&pdev->domain->pci_lock);

Can't it be just d here?

> @@ -1484,6 +1488,10 @@ static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn, u32 flag)
>      if ( pdev->broken && d != hardware_domain && d != dom_io )
>          goto done;
>  
> +    write_lock(&pdev->domain->pci_lock);
> +    vpci_deassign_device(pdev);
> +    write_unlock(&pdev->domain->pci_lock);

Is this meaningful (and okay to call at all) when pdev->domain == dom_io?

> @@ -1509,6 +1517,19 @@ static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn, u32 flag)
>          rc = iommu_call(hd->platform_ops, assign_device, d, devfn,
>                          pci_to_dev(pdev), flag);
>      }
> +    if ( rc )
> +        goto done;
> +
> +    devfn = pdev->devfn;
> +    write_lock(&pdev->domain->pci_lock);
> +    rc = vpci_assign_device(pdev);
> +    write_unlock(&pdev->domain->pci_lock);

Just d again here?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:42:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:42:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568524.887903 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNs5X-0005Sx-Hb; Mon, 24 Jul 2023 09:42:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568524.887903; Mon, 24 Jul 2023 09:42:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNs5X-0005Sq-EJ; Mon, 24 Jul 2023 09:42:47 +0000
Received: by outflank-mailman (input) for mailman id 568524;
 Mon, 24 Jul 2023 09:42:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=c6P8=DK=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qNs5W-0005Se-FQ
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:42:46 +0000
Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com
 [2a00:1450:4864:20::52f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 713d5922-2a06-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:42:45 +0200 (CEST)
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-5222a38c0a0so1680394a12.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:42:45 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 k10-20020aa7c04a000000b0050488d1d376sm6020958edo.0.2023.07.24.02.42.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:42:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 713d5922-2a06-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690191764; x=1690796564;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=atMf0boHnIDUMnp3fd3QiPuot2gD1j1rH3B7h89Bipc=;
        b=iwMKx/KGXjSviZGRRPpo0T2dfiq7xFRcJNagfm/AS9csAKWjxwWDTwoYO5yICdW17H
         9odFJltVKDZohCuOFBDegmpfbqMWM+UJ8LWfivC/mkbeJe7drsIziYqOQbFtONRc54fl
         j0Jj52guPteiBQeFnQwpowOnzoq5euaHPeoamG2TXCUqJzBpX1ml4TYUVHFSN0LogmO4
         c9NZL8umyAZYYNABOzLa5xnPeM99HO7aL881WlDVCYz6VZY65+8JLsrw/mL57kjwBFFM
         Q28RSAKDrIG+heHUsOQZmdz88CJYTo+OKqLkrcw9SswlucUoqfTvEyH3t2HqoIJ+GAUy
         VYtQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690191764; x=1690796564;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=atMf0boHnIDUMnp3fd3QiPuot2gD1j1rH3B7h89Bipc=;
        b=Y/wp1rZZsOYlU/5VVWrckYnKfS6Wny788MY80afHqsLXv6HY6/V84QZi1xk5gRsnc9
         t3Po5DSmNWKhUYn0OIXKkACjm0VPtq2pfE+3pgAm0BKefSU5HCpX49Qc4s1JDGeXAMMs
         8y4KNsYjXRSUznX9xN2XkJc5X0imCtQvwy0Am5KwotlmvRD4X+s/FhWy6awTXyLS5kL8
         IwIn/nZypd9xqkzVJLkghB1lLBr7WgvPqEyIJYxy6oAW1cjHBMYN7/kJlDmTp63DKBYY
         XcAnicqpHhYyKcH60ojQY9ms2497qRBpUX0n6M5Rd8VO7cKMSKFdURAwyA+IauyLAJLw
         6LFQ==
X-Gm-Message-State: ABy/qLaGU5gu2WTyA1wJOqOnvzZtn5NXuRcTKFKwrvqazuciJFDU3c8L
	IAihuIQ5dyYIJZogKfdWpSpeJn1H1PM=
X-Google-Smtp-Source: APBJJlEmmBTAw9xXG5+Uo5eKgCwAM77yuHXVFShWrBTPwZJ/XPIV4auwJZNmXa/KaXBxf+Go5s9r1w==
X-Received: by 2002:a05:6402:742:b0:522:1dcb:c355 with SMTP id p2-20020a056402074200b005221dcbc355mr5191692edy.16.1690191764407;
        Mon, 24 Jul 2023 02:42:44 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>
Subject: [PATCH v4 0/2] xen/riscv: introduce identity mapping
Date: Mon, 24 Jul 2023 12:42:39 +0300
Message-ID: <cover.1690191480.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The patch series introduces things necessary to implement identity mapping:
  1. Make identity mapping for the entire Xen.
  2. Enable MMU.
  3. Jump to the virtual address world
  4. Remove identity mapping.

Also current patch series introduces the calculation of physical offset before
MMU is enabled as access to physical offset will be calculated wrong after
MMU will be enabled because access to phys_off variable is PC-relative and
in the case when linker address != load address, it will cause MMU fault.

The reason for this patch series can be found here:
https://lore.kernel.org/xen-devel/4e336121-fc0c-b007-bf7b-430352563d55@citrix.com/
---
Changes in V4:
  - drop patch 	[PATCH v3 1/3] xen/riscv: add SPDX tag to config.h as it was
    merged to staging
  - remove definition of ARRAY_SIZE and ROUNDUP as <xen/macors.h> was introduced where these macros are located now.
	- update definition of PGTBL_INITIAL_COUNT
	- update the commit message for patch 'xen/riscv: introduce identity mapping'
	- update the comments in head.S
  - update the algo of identity mapping removing 
---
Changes in V3:
 - Update the patch series message.
 - The following patches were merged to staging so droped from the patch series:
   * xen/riscv: add .sbss section to .bss
   * xen/riscv: introduce reset_stack() function
   * xen/riscv: move extern of cpu0_boot_stack to header
   * xen/riscv: add SPDX tags
 - move save/restore of a0/a1 registers from patch 4 to patch 2 ( numbers are
   from the previous patch series version )
 - add SPDX tag in config.h
 - update definition of PGTBL_INITIAL_COUNT taking into account identity mapping.
 - refactor remove_identity_mapping() function.
 - add explanatory comments in xen.lds.S and mm.c.
---
Changes in V2:
 - update the patch series message.
 - drop patches from the previous version of the patch series:
   * xen/riscv: add __ASSEMBLY__ guards". ( merged )
   * xen/riscv: make sure that identity mapping isn't bigger then page size
     ( entire Xen is 1:1 mapped so there is no need for the checks from the patch )
 - add .sbss.* and put it befor .bss* .
 - move out reset_stack() to .text section.
 - add '__ro_after_init' for phys_offset variable.
 - add '__init' for calc_phys_offset().
 - declaring variable phys_off as non static as it will be used in head.S.
 - update definition of PGTBL_INITIAL_COUNT and the comment above.
 - code style fixes.
 - remove id_addrs array becase entire Xen is mapped.
 - reverse condition for cycle inside remove_identity_mapping().
 - fix page table walk in remove_identity_mapping().
 - save hart_id and dtb_addr before call MMU related C functions
 - use phys_offset variable instead of doing calcultations to get phys offset
   in head.S file. ( it can be easily done as entire Xen is 1:1 mapped now )
 - declare enable_muu() as __init.
 - Update SPDX tags.
 - Add Review-By/Suggested-By for some patches.
 - code style fixes.

Oleksii Kurochko (2):
  xen/riscv: introduce function for physical offset calculation
  xen/riscv: introduce identity mapping

 xen/arch/riscv/include/asm/mm.h |   5 +-
 xen/arch/riscv/mm.c             | 119 +++++++++++++++++++++-----------
 xen/arch/riscv/riscv64/head.S   |  35 ++++++++++
 xen/arch/riscv/setup.c          |  14 +---
 xen/arch/riscv/xen.lds.S        |   4 ++
 5 files changed, 123 insertions(+), 54 deletions(-)

-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:42:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:42:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568525.887913 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNs5Z-0005iX-Pg; Mon, 24 Jul 2023 09:42:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568525.887913; Mon, 24 Jul 2023 09:42:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNs5Z-0005iM-Lw; Mon, 24 Jul 2023 09:42:49 +0000
Received: by outflank-mailman (input) for mailman id 568525;
 Mon, 24 Jul 2023 09:42:48 +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
 <SRS0=c6P8=DK=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qNs5Y-0005hi-ST
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:42:48 +0000
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com
 [2a00:1450:4864:20::134])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7176ec9a-2a06-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:42:45 +0200 (CEST)
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-4fb5bcb9a28so6189322e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:42:46 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 k10-20020aa7c04a000000b0050488d1d376sm6020958edo.0.2023.07.24.02.42.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:42:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7176ec9a-2a06-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690191765; x=1690796565;
        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=Nfcp7c7c/3n6CY6kNcbVjdnQ1GyqRTk1VyoAU9RnpnM=;
        b=Csan28GVnhjQUoXT1yMjYnfboJRQfsiggTVzjPbFpapz3fKWnv0vzSmzUc1EY+7oOC
         z36BGfFwcPVee9rEWkh0XaYxpIUKr5VUvvynqB3z+fYIa9YsDbuRFX4x+1LCFW4TXs+Z
         PGJred5yGMjnEoUZS0HJt8dOl8koS/OccWvg6rkbl5cKXvtYFc76seXYsHB2RgyfjadE
         0qajHsS31XBdhlaV728LcMV3i8G2NmYNG2kUal+HCLYqgfxOFco/8cE3xlFuyTMzy4rG
         mhliVvUtHjMCAumQuvXOVRIlyEx6WKRd0V8sl/HReYBb07J5uVwYMCuChvoFu9jlQYGj
         HHvg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690191765; x=1690796565;
        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=Nfcp7c7c/3n6CY6kNcbVjdnQ1GyqRTk1VyoAU9RnpnM=;
        b=bTDYkjoJuAitv2H7e+MpbtsL4WiFGyEWYoTdX77sCREyiwvjl+Vi51JK4T/bWCJrsw
         Cfj24sGein3StDCTzcMOzN4gyddNlg8gpv/B081beRHYHfiM9rGS7yN+0lVCAHD887xT
         K21qnJn6X1FtUlmqgl6P1op7JXxS3zVar6OQEEdmC4G3ezRlyrQMlvYKZXMw5fDzR1ep
         0mefr5wvdm865Wf3Jy37dqD7QBftxDr1O7dVFJR4j6B9DXSRnCbvK9yvYzU7GkdDU/se
         8FqpSYlJoTKfqaT6jbKBsP2KP/cJjm8BqVMVm2QMZrKHwe1cApXtVEc3YrDTC4VDvOcR
         iFaQ==
X-Gm-Message-State: ABy/qLbzVe+PSyOa5IcyCRgSXBAjjQdA7JzfZZdtXTOLUWfomde3ppKS
	yEZw9J2idpyDQyVjr7FfBhAChosfJAA=
X-Google-Smtp-Source: APBJJlFtnpAKSRB9j61eraO6i0crSM/fmYILB1TIwDXPOcVEiyOaXs5GHgpCMPJAokcnijBiK865xQ==
X-Received: by 2002:a05:6512:23a5:b0:4fd:d517:fbd8 with SMTP id c37-20020a05651223a500b004fdd517fbd8mr6682242lfv.9.1690191765227;
        Mon, 24 Jul 2023 02:42:45 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>
Subject: [PATCH v4 1/2] xen/riscv: introduce function for physical offset calculation
Date: Mon, 24 Jul 2023 12:42:40 +0300
Message-ID: <19817eca0b7d4e8dee7eb5d5e7d3812133925eb3.1690191480.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1690191480.git.oleksii.kurochko@gmail.com>
References: <cover.1690191480.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The function was introduced to calculate and save physical
offset before MMU is enabled because access to start() is
PC-relative and in case of linker_addr != load_addr it will
result in incorrect value in phys_offset.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V4:
 - update the comment messages in head.S related to save/restore of a0/a1 regs.
---
Changes in V3:
 - save/restore of a0/a1 registers before C first function call.
---
Changes in V2:
  - add __ro_after_init for phys_offset variable.
  - remove double blank lines.
  - add __init for calc_phys_offset().
  - update the commit message.
  - declaring variable phys_off as non static as it will be used in head.S.
---
 xen/arch/riscv/include/asm/mm.h |  2 ++
 xen/arch/riscv/mm.c             | 18 +++++++++++++++---
 xen/arch/riscv/riscv64/head.S   | 13 +++++++++++++
 3 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 5e3ac5cde3..d9c4205103 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -15,4 +15,6 @@ void setup_initial_pagetables(void);
 void enable_mmu(void);
 void cont_after_mmu_is_enabled(void);
 
+void calc_phys_offset(void);
+
 #endif /* _ASM_RISCV_MM_H */
diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index fddb3cd0bd..c84a8a7c3c 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
+#include <xen/cache.h>
 #include <xen/compiler.h>
 #include <xen/init.h>
 #include <xen/kernel.h>
@@ -19,9 +20,10 @@ struct mmu_desc {
     pte_t *pgtbl_base;
 };
 
-#define PHYS_OFFSET ((unsigned long)_start - XEN_VIRT_START)
-#define LOAD_TO_LINK(addr) ((addr) - PHYS_OFFSET)
-#define LINK_TO_LOAD(addr) ((addr) + PHYS_OFFSET)
+unsigned long __ro_after_init phys_offset;
+
+#define LOAD_TO_LINK(addr) ((unsigned long)(addr) - phys_offset)
+#define LINK_TO_LOAD(addr) ((unsigned long)(addr) + phys_offset)
 
 /*
  * It is expected that Xen won't be more then 2 MB.
@@ -273,3 +275,13 @@ void __init noreturn noinline enable_mmu()
     switch_stack_and_jump((unsigned long)cpu0_boot_stack + STACK_SIZE,
                           cont_after_mmu_is_enabled);
 }
+
+/*
+ * calc_phys_offset() should be used before MMU is enabled because access to
+ * start() is PC-relative and in case when load_addr != linker_addr phys_offset
+ * will have an incorrect value
+ */
+void __init calc_phys_offset(void)
+{
+    phys_offset = (unsigned long)start - XEN_VIRT_START;
+}
diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S
index 2c0304646a..a28714e0ef 100644
--- a/xen/arch/riscv/riscv64/head.S
+++ b/xen/arch/riscv/riscv64/head.S
@@ -29,6 +29,19 @@ ENTRY(start)
 
         jal     reset_stack
 
+        /*
+         * save hart_id ( bootcpu_id ) and dtb_base as a0 and a1 register can
+         * be used by C code
+         */
+        mv      s0, a0
+        mv      s1, a1
+
+        jal     calc_phys_offset
+
+        /* restore hart_id ( bootcpu_id ) and dtb address */
+        mv      a0, s0
+        mv      a1, s1
+
         tail    start_xen
 
         .section .text, "ax", %progbits
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:42:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:42:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568526.887923 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNs5b-0005yX-23; Mon, 24 Jul 2023 09:42:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568526.887923; Mon, 24 Jul 2023 09:42:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNs5a-0005yI-VN; Mon, 24 Jul 2023 09:42:50 +0000
Received: by outflank-mailman (input) for mailman id 568526;
 Mon, 24 Jul 2023 09:42:49 +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
 <SRS0=c6P8=DK=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qNs5Z-0005hi-IK
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:42:49 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7188aa35-2a06-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:42:46 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5217bb5ae05so5541090a12.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:42:47 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 k10-20020aa7c04a000000b0050488d1d376sm6020958edo.0.2023.07.24.02.42.45
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:42:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7188aa35-2a06-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690191766; x=1690796566;
        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=3A7jIfn7cd5zSr8lvNclLlaXmI+gimV3tunSWePZzuo=;
        b=FjreHnYj84PURYQMOG0tUHg+XaO1B9OA3QVLQjya6LJldeYPkey2vp9IUaPHOh4NQy
         MT2iIAlfbtOO/34TpgSXH3aCtWK3c2vldGXFpGzPnrnr2ogTMq72dzamNad5ueGMkwAT
         3myLua7hvHOW9CklzECY3YKzu+hBvQ+5TspzuGN//+h68Av93EIrXExoPmJVWyeXqqSb
         NUIm2vaDT/mlWHyRPu2CdgOC/yi6ssthGQ8T9hQKV7QrjMqV4C87/VbMcccXWjuWSACX
         DGBSlMMEORsIbZNE8gK0xdYh8PjH6sHyZ5W9yHxnk5VrD9irW4g2fomW+zZ4nnMiDJyQ
         IeEg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690191766; x=1690796566;
        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=3A7jIfn7cd5zSr8lvNclLlaXmI+gimV3tunSWePZzuo=;
        b=hUzEegW0N7UZcxX3bKnIqmYyfqeqtxC9eyE5IvrCx11xgtsGHuh5ybgDTQ/iJVmuG1
         li0PBsb3sM1kBbRUuDt3lf7aAgyun2sWIYB+rG1eVpXiAjqeqMVCHgpl/xeEI+YAvtjP
         1GLe6RwH8eFb8b0nOatFSpzfS8fnQSmbR7KeJM0QaOFbwz6rNg6/SwoERL52likxhKw+
         gxTUKYfBKXaoRperjjY+JNynuUtrzwp7MbHZaq01b31+BuaNZJ4XGTGIq+3F3LWXLnKV
         gROCpl2vQG35OUiuuoJmSWOtR29CqZgtp4ZUvkyQ0EdslyJPCb0NTFy9TYcYI90d4s8U
         do/Q==
X-Gm-Message-State: ABy/qLawgpy+0D7afEFdy73yx+kjC7nDtG7Ri81vI9WHd2WQLm9iqpsE
	dInUNtxrSCgkKutIy19CrZ5Q2MZ0vTg=
X-Google-Smtp-Source: APBJJlG3Jq/VevmjGpaGSwcVLTeyfhAWXO+R3+Bc6NhCeh5J20ZztJ0zkfTfmbGo4ZDw8LV/OAY01Q==
X-Received: by 2002:a05:6402:609:b0:51e:c82:6f3b with SMTP id n9-20020a056402060900b0051e0c826f3bmr7925509edv.16.1690191765947;
        Mon, 24 Jul 2023 02:42:45 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>
Subject: [PATCH v4 2/2] xen/riscv: introduce identity mapping
Date: Mon, 24 Jul 2023 12:42:41 +0300
Message-ID: <a8ab1829ab718dda869db3df3348ded211e81967.1690191480.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1690191480.git.oleksii.kurochko@gmail.com>
References: <cover.1690191480.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The way how switch to virtual address was implemented in the
commit e66003e7be ("xen/riscv: introduce setup_initial_pages")
isn't safe enough as:
* enable_mmu() depends on hooking all exceptions
  and pagefault.
* Any exception other than pagefault, or not taking a pagefault
  causes it to malfunction, which means you will fail to boot
  depending on where Xen was loaded into memory.

Instead of the proposed way of switching to virtual addresses was
decided to use identity mapping of the entrire Xen and after
switching to virtual addresses identity mapping is removed from
page-tables in the following way: recursively visit all ptes related
to identity mapping and remove them.

Fixes: e66003e7be ("xen/riscv: introduce setup_initial_pages")
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
Changes in V4:
 - remove definition of ARRAY_SIZE and ROUNDUP as <xen/macors.h> was introduced where these macros are located now.
 - update definition of PGTBL_INITIAL_COUNT
 - update the commit message
 - update the algo of identity mapping removing
---
Changes in V3:
 - remove unrelated to the patch changes ( SPDX tags in config.h ).
 - update definition of PGTBL_INITIAL_COUNT taking into account identity mapping.
 - refactor remove_identity_mapping() function.
 - add explanatory comments in xen.lds.S and mm.c.
 - update commit message.
 - move save/restore of a0/a1 registers to [PATCH v2 2/3] xen/riscv: introduce
   function for physical offset calculation.
---
Changes in V2:
  - update definition of PGTBL_INITIAL_COUNT and the comment above.
  - code style fixes.
  - 1:1 mapping for entire Xen.
  - remove id_addrs array becase entire Xen is mapped.
  - reverse condition for cycle inside remove_identity_mapping().
  - fix page table walk in remove_identity_mapping().
  - update the commit message.
  - add Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
  - save hart_id and dtb_addr before call MMU related C functions.
  - use phys_offset variable instead of doing calcultations to get phys offset
    in head.S file. ( it can be easily done as entire Xen is 1:1 mapped )
  - declare enable_muu() as __init.
---
 xen/arch/riscv/include/asm/mm.h |   3 +-
 xen/arch/riscv/mm.c             | 101 ++++++++++++++++++++------------
 xen/arch/riscv/riscv64/head.S   |  22 +++++++
 xen/arch/riscv/setup.c          |  14 +----
 xen/arch/riscv/xen.lds.S        |   4 ++
 5 files changed, 93 insertions(+), 51 deletions(-)

diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index d9c4205103..085eaab7fb 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -13,7 +13,8 @@ extern unsigned char cpu0_boot_stack[];
 void setup_initial_pagetables(void);
 
 void enable_mmu(void);
-void cont_after_mmu_is_enabled(void);
+
+void remove_identity_mapping(void);
 
 void calc_phys_offset(void);
 
diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index c84a8a7c3c..aae24f3a54 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -4,6 +4,7 @@
 #include <xen/compiler.h>
 #include <xen/init.h>
 #include <xen/kernel.h>
+#include <xen/macros.h>
 #include <xen/pfn.h>
 
 #include <asm/early_printk.h>
@@ -35,8 +36,10 @@ unsigned long __ro_after_init phys_offset;
  *
  * It might be needed one more page table in case when Xen load address
  * isn't 2 MB aligned.
+ *
+ * CONFIG_PAGING_LEVELS page tables are needed for identity mapping.
  */
-#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) + 1)
+#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) * 2) + 1
 
 pte_t __section(".bss.page_aligned") __aligned(PAGE_SIZE)
 stage1_pgtbl_root[PAGETABLE_ENTRIES];
@@ -75,10 +78,11 @@ static void __init setup_initial_mapping(struct mmu_desc *mmu_desc,
     unsigned int index;
     pte_t *pgtbl;
     unsigned long page_addr;
+    bool is_identity_mapping = map_start == pa_start;
 
-    if ( (unsigned long)_start % XEN_PT_LEVEL_SIZE(0) )
+    if ( !IS_ALIGNED((unsigned long)_start, KB(4)) )
     {
-        early_printk("(XEN) Xen should be loaded at 4k boundary\n");
+        early_printk("(XEN) Xen should be loaded at 4KB boundary\n");
         die();
     }
 
@@ -108,16 +112,18 @@ static void __init setup_initial_mapping(struct mmu_desc *mmu_desc,
             {
                 unsigned long paddr = (page_addr - map_start) + pa_start;
                 unsigned int permissions = PTE_LEAF_DEFAULT;
+                unsigned long addr = is_identity_mapping
+                                     ? page_addr : LINK_TO_LOAD(page_addr);
                 pte_t pte_to_be_written;
 
                 index = pt_index(0, page_addr);
 
-                if ( is_kernel_text(LINK_TO_LOAD(page_addr)) ||
-                     is_kernel_inittext(LINK_TO_LOAD(page_addr)) )
-                    permissions =
-                        PTE_EXECUTABLE | PTE_READABLE | PTE_VALID;
+                if ( is_kernel_text(addr) ||
+                     is_kernel_inittext(addr) )
+                        permissions =
+                            PTE_EXECUTABLE | PTE_READABLE | PTE_VALID;
 
-                if ( is_kernel_rodata(LINK_TO_LOAD(page_addr)) )
+                if ( is_kernel_rodata(addr) )
                     permissions = PTE_READABLE | PTE_VALID;
 
                 pte_to_be_written = paddr_to_pte(paddr, permissions);
@@ -211,6 +217,10 @@ void __init setup_initial_pagetables(void)
     unsigned long linker_start  = LOAD_TO_LINK(load_start);
     unsigned long linker_end    = LOAD_TO_LINK(load_end);
 
+    /*
+     * If the overlapping check will be removed then remove_identity_mapping()
+     * logic should be updated.
+     */
     if ( (linker_start != load_start) &&
          (linker_start <= load_end) && (load_start <= linker_end) )
     {
@@ -232,22 +242,18 @@ void __init setup_initial_pagetables(void)
                           linker_start,
                           linker_end,
                           load_start);
+
+    if ( linker_start == load_start )
+        return;
+
+    setup_initial_mapping(&mmu_desc,
+                          load_start,
+                          load_end,
+                          load_start);
 }
 
-void __init noreturn noinline enable_mmu()
+void __init enable_mmu(void)
 {
-    /*
-     * Calculate a linker time address of the mmu_is_enabled
-     * label and update CSR_STVEC with it.
-     * MMU is configured in a way where linker addresses are mapped
-     * on load addresses so in a case when linker addresses are not equal
-     * to load addresses, after MMU is enabled, it will cause
-     * an exception and jump to linker time addresses.
-     * Otherwise if load addresses are equal to linker addresses the code
-     * after mmu_is_enabled label will be executed without exception.
-     */
-    csr_write(CSR_STVEC, LOAD_TO_LINK((unsigned long)&&mmu_is_enabled));
-
     /* Ensure page table writes precede loading the SATP */
     sfence_vma();
 
@@ -255,25 +261,44 @@ void __init noreturn noinline enable_mmu()
     csr_write(CSR_SATP,
               PFN_DOWN((unsigned long)stage1_pgtbl_root) |
               RV_STAGE1_MODE << SATP_MODE_SHIFT);
+}
 
-    asm volatile ( ".p2align 2" );
- mmu_is_enabled:
-    /*
-     * Stack should be re-inited as:
-     * 1. Right now an address of the stack is relative to load time
-     *    addresses what will cause an issue in case of load start address
-     *    isn't equal to linker start address.
-     * 2. Addresses in stack are all load time relative which can be an
-     *    issue in case when load start address isn't equal to linker
-     *    start address.
-     *
-     * We can't return to the caller because the stack was reseted
-     * and it may have stash some variable on the stack.
-     * Jump to a brand new function as the stack was reseted
-     */
+void __init remove_identity_mapping(void)
+{
+    static pte_t *pgtbl = stage1_pgtbl_root;
+    static unsigned long load_start = XEN_VIRT_START;
+    static unsigned int pt_level = CONFIG_PAGING_LEVELS - 1;
+
+    unsigned long load_end = LINK_TO_LOAD(_end);
+    unsigned long xen_size;
+    unsigned long pt_level_size = XEN_PT_LEVEL_SIZE(pt_level);
+    unsigned long pte_nums;
+
+    unsigned long virt_indx = pt_index(pt_level, XEN_VIRT_START);
+    unsigned long indx;
+
+    if ( load_start == XEN_VIRT_START )
+        load_start = LINK_TO_LOAD(_start);
+
+    xen_size = load_end - load_start;
+    pte_nums = ROUNDUP(xen_size, pt_level_size) / pt_level_size;
+
+    while ( pte_nums-- )
+    {
+        indx = pt_index(pt_level, load_start);
 
-    switch_stack_and_jump((unsigned long)cpu0_boot_stack + STACK_SIZE,
-                          cont_after_mmu_is_enabled);
+        if ( virt_indx != indx )
+        {
+            pgtbl[indx].pte = 0;
+            load_start += XEN_PT_LEVEL_SIZE(pt_level);
+        }
+        else
+        {
+            pgtbl =  (pte_t *)LOAD_TO_LINK(pte_to_paddr(pgtbl[indx]));
+            pt_level--;
+            remove_identity_mapping();
+        }
+    }
 }
 
 /*
diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S
index a28714e0ef..d74412351e 100644
--- a/xen/arch/riscv/riscv64/head.S
+++ b/xen/arch/riscv/riscv64/head.S
@@ -38,6 +38,28 @@ ENTRY(start)
 
         jal     calc_phys_offset
 
+        jal     setup_initial_pagetables
+
+        jal     enable_mmu
+
+        la      t1, phys_offset
+        REG_L   t1, (t1)
+
+        /* Calculate proper VA after jump from 1:1 mapping */
+        la      t0, .L_primary_switched
+        sub     t0, t0, t1
+
+        /* Jump from 1:1 mapping world */
+        jr      t0
+
+.L_primary_switched:
+        /*
+         * cpu0_boot_stack address is 1:1 mapping related so it should be
+         * recalculated after jump from 1:1 mapping world as 1:1 mapping
+         * will be removed soon in start_xen().
+         */
+        jal     reset_stack
+
         /* restore hart_id ( bootcpu_id ) and dtb address */
         mv      a0, s0
         mv      a1, s1
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index dde8fb898b..6593f601c1 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -13,20 +13,10 @@ unsigned char __initdata cpu0_boot_stack[STACK_SIZE]
 void __init noreturn start_xen(unsigned long bootcpu_id,
                                paddr_t dtb_addr)
 {
-    early_printk("Hello from C env\n");
-
-    setup_initial_pagetables();
-
-    enable_mmu();
-
-    for ( ;; )
-        asm volatile ("wfi");
+    remove_identity_mapping();
 
-    unreachable();
-}
+    early_printk("Hello from C env\n");
 
-void __init noreturn cont_after_mmu_is_enabled(void)
-{
     early_printk("All set up\n");
 
     for ( ;; )
diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S
index 9064852173..31ccebadcb 100644
--- a/xen/arch/riscv/xen.lds.S
+++ b/xen/arch/riscv/xen.lds.S
@@ -173,4 +173,8 @@ ASSERT(IS_ALIGNED(__bss_end,        POINTER_ALIGN), "__bss_end is misaligned")
 ASSERT(!SIZEOF(.got),      ".got non-empty")
 ASSERT(!SIZEOF(.got.plt),  ".got.plt non-empty")
 
+/*
+ * Changing the size of Xen binary can require an update of
+ * PGTBL_INITIAL_COUNT.
+ */
 ASSERT(_end - _start <= MB(2), "Xen too large for early-boot assumptions")
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:48:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:48:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568580.887933 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsBS-0007T0-37; Mon, 24 Jul 2023 09:48:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568580.887933; Mon, 24 Jul 2023 09:48:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsBR-0007St-VO; Mon, 24 Jul 2023 09:48:53 +0000
Received: by outflank-mailman (input) for mailman id 568580;
 Mon, 24 Jul 2023 09:48:52 +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
 <SRS0=sIK2=DK=invisiblethingslab.com=simon@srs-se1.protection.inumbo.net>)
 id 1qNsBQ-0007Pe-GK
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:48:52 +0000
Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com
 [64.147.123.20]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 49170100-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:48:49 +0200 (CEST)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.west.internal (Postfix) with ESMTP id 5FFC73200065;
 Mon, 24 Jul 2023 05:48:45 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute5.internal (MEProxy); Mon, 24 Jul 2023 05:48:45 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 24 Jul 2023 05:48:40 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 49170100-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm3; t=
	1690192124; x=1690278524; bh=2rLKSuU16UsnDfiMjPqYzoBhsClO4zSaeBL
	j/AD8j3o=; b=zinzpmKDgvyvA+XfsPVuDxD5BhJ/IC/cIU6erncXhQumrGFqW9N
	wHywbRgNM3UodM3aiwhoJAOlNhuOTDJP4sx/3luYLCTipe1X/8yDs+5ABqchmOxX
	E4MZl6RYvYUscgaC95qq9eeyYsK6OZSUa/LhoMjq3MAcybz/Oom0ig1f+VFomqi/
	Zan+lvcDYO8nubHvrvSf8zkGOKnDOw9LPnMURzhLCrDPtpLCzw/K1JeqXEmvSewT
	Axo3CsYtyP/72/VEOKKl9BF9Ndbu+6P8d8VkOn+R2A+g4kOJOsroWFNRrGhA1V8P
	+wbDkglvlKOlBOwEjdXZjlj+pRyZh3Wqliw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1690192124; x=1690278524; bh=2rLKSuU16UsnD
	fiMjPqYzoBhsClO4zSaeBLj/AD8j3o=; b=jaGpchDJCwSbaGsk7mdZSuU7tkWYq
	CZSMzkHBV9zjhYyVFhTYVt9pZG+qJVyxJGGzleQZn79TUmaFK8Ob1lsSQI+P2rAp
	NytI8fZxWFrxDIBWwOZK4ELBYOmbXflcNRnTerlpaZmqMXEAZH+t2kgItn+orWve
	Lfzw/tLNqwIKleOGyviwmH/ilFYtjCGovkVSmMptnU99xhVn5Rc/CnBVCtvGQcjg
	lsiF+aL5uW194aLTvVGMK67loSn7+PWSX1vv3tKaDSoGNlaEbBkBjgVouAfZfZfW
	sAHOCHlF+BSj5hDCOftDFWaZ0FeR7wPskzdh7pJvarZc8kFHKszWvvb7g==
X-ME-Sender: <xms:_Ei-ZGtCrqPojc3lqdPdePyySCxn7PfGGjQfBnf3kLRKabGOWKGzyA>
    <xme:_Ei-ZLeFeI3uqrLKZA9ANMmn6Gh4qrayhT0dYUn-B1M2r1S1PXPIUFdp6e-Os3f8V
    Nveq9i8zyGuGS0>
X-ME-Received: <xmr:_Ei-ZByxh3Itp-JN7uemWWjqWHxW6kNpC05NQJ3Q0n6xwnBbsiNDSClr79veagdB>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrheekgddulecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpefkffgguffvvehfhfgjtgesghdtreertddtjeenucfhrhhomhepufhimhhonhcu
    ifgrihhsvghruceoshhimhhonhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtoh
    hmqeenucggtffrrghtthgvrhhnpeekueffiedtgeffleeglefhledtfefgiedtveeiffeg
    hffgledtveehhfdugfetveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh
    grihhlfhhrohhmpehsihhmohhnsehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtgho
    mh
X-ME-Proxy: <xmx:_Ei-ZBP9mH-FhqcuIatPiNiv60S1gQoDsTm0hkWufo2LH6Dzh2_nVg>
    <xmx:_Ei-ZG-XSstEohxVe-_timxON9w41F59geEX06gC58feTVBmVyaXyw>
    <xmx:_Ei-ZJXQCvAf6-oIGO7nqoemCpXLt-U7RCFQ-NTyUrZrRInC1DmTWA>
    <xmx:_Ei-ZNbTIj9LOGlB4nuznzzfTae9yPMrUGCut2ZH9S5OLVU-I32-tg>
Feedback-ID: idc5945a3:Fastmail
Message-ID: <2b4075e5-0b17-fe14-72db-12c63ab30f86@invisiblethingslab.com>
Date: Mon, 24 Jul 2023 11:48:24 +0200
MIME-Version: 1.0
Subject: Re: [XEN PATCH] x86/hpet: Disable legacy replacement mode after IRQ
 test if not needed
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, Andrew Cooper
 <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>
References: <20230718122603.2002-1-simon@invisiblethingslab.com>
 <ZLaLLe2HFDN5oWUq@MacBook-Air-de-Roger.local>
 <ac77ecba-6804-1d16-60dc-f184e5d31dcb@invisiblethingslab.com>
 <58ee9410-e758-1503-e3f1-d25989fedc1e@suse.com>
Content-Language: en-US
From: Simon Gaiser <simon@invisiblethingslab.com>
In-Reply-To: <58ee9410-e758-1503-e3f1-d25989fedc1e@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------BaKg4KX5cvA95YSCPwr5wObm"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------BaKg4KX5cvA95YSCPwr5wObm
Content-Type: multipart/mixed; boundary="------------LVwnDABkqVYRbyUaMPboQkTp";
 protected-headers="v1"
From: Simon Gaiser <simon@invisiblethingslab.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, Andrew Cooper
 <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>
Message-ID: <2b4075e5-0b17-fe14-72db-12c63ab30f86@invisiblethingslab.com>
Subject: Re: [XEN PATCH] x86/hpet: Disable legacy replacement mode after IRQ
 test if not needed
References: <20230718122603.2002-1-simon@invisiblethingslab.com>
 <ZLaLLe2HFDN5oWUq@MacBook-Air-de-Roger.local>
 <ac77ecba-6804-1d16-60dc-f184e5d31dcb@invisiblethingslab.com>
 <58ee9410-e758-1503-e3f1-d25989fedc1e@suse.com>
In-Reply-To: <58ee9410-e758-1503-e3f1-d25989fedc1e@suse.com>

--------------LVwnDABkqVYRbyUaMPboQkTp
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Jan Beulich:
> On 18.07.2023 23:51, Simon Gaiser wrote:
>> Roger Pau Monn=C3=A9:
>>> On Tue, Jul 18, 2023 at 02:26:03PM +0200, Simon Gaiser wrote:
>>>> As far as I understand the HPET legacy mode is not required on syste=
ms
>>>> with ARAT after the timer IRQ test.
>>>
>>> What's the relation with ARAT here?
>>>
>>> It would seem to me that keeping legacy replacement enabled should
>>> only be done when opt_hpet_legacy_replacement > 0, and the currently
>>> modified block is already in a opt_hpet_legacy_replacement < 0 gated
>>> chunk.
>>
>> I was concerned that on systems without ARAT cpuidle might rely on HPE=
T
>> legacy mode being available. See _disable_pit_irq and lapic_timer_init=
=2E
>> But now that I stared at this again, I think that condition isn't
>> actually needed. If we reach that code we know that we have no working=

>> PIT, but HPET is working. So _disable_pit_irq which is run after
>> check_timer (__start_xen first calls check_timer via smp_prepare_cpus
>> and only later disable_pit_irq via do_initcalls) will setup HPET
>> broadcast, which should succeed since HPET worked previously.
>>
>> So I guess we can just drop the condition (please double check, that
>> code is quite tangled and I'm not familiar with it).
>=20
> What you want to respect instead though is opt_hpet_legacy_replacement.=


Can you please explain what behavior you expect? As Roger pointed out
this code only runs with opt_hpet_legacy_replacement < 0 so the user
didn't make an explicit choice. In that case enabling the legacy mode
for the timer IRQ test and then disabling it to allow lower power modes
seems reasonable to me.

Simon

--------------LVwnDABkqVYRbyUaMPboQkTp--

--------------BaKg4KX5cvA95YSCPwr5wObm
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE3E8ezGzG3N1CTQ//kO9xfO/xly8FAmS+SOoACgkQkO9xfO/x
ly9JPw//WumzM2bn//BEMPfXjj2ucaftDIJnuu3r44ih3EPtDdtUSSrdojLUqce3
vRBETsGbdMowB/5rTfr34xXoyNA/gcvy0SormM7+soou74ZrC7aq0VMYoz9F9R5U
oLPS3l2I3gxCOPr/wO1j5L3Exq7+XBTL/bIn5xl13BN97a6cqsk/AcB9gYcuUag4
MzlUa3FNdbJtcxaMbk8tSxsWL5snuFmtIjmUcdn1TDPNPS9RxtsjefsVVaXbexrV
5Ejt8wGlD6X+9rgZMsrc5fjA1SbqmQU4E/I8PipH9d+oVzqzfbSQNkgk4QS2C8WW
7jZxMLs34hN6ZiF3pok6Od+VfcYHhqw6ihlLGGpp6KGjI/UsjNGjDdBkWE+zPg8r
GS4p28KlhD/RBfoJUKgun9WdQq/z7hXo3m8czwONIMhLPEpKxDfrr9yJYnAwe6P2
JYmje077UgNtXyg4d/xzzlqCMFaxHthkeu0nyWJfEz1ARXldHEs7NVObbEustPV5
o7YgsHzE1LobqK8JWNeKDqDV8SUrNgvUIKn9V+CKU8kE2VBbzPSt6cSmkxDxQbOR
ubTOxn4CgQE7Q2opwjMTLe/qF16YQdTOqlL+EIZ1DiWI4x+uy/Qyo9Y7rTjS+Z22
EXZXkzh/273tMzRnUnyGsb8sVP1EPIaBcOZNnpa9Uda0PzHYBn4=
=gRqi
-----END PGP SIGNATURE-----

--------------BaKg4KX5cvA95YSCPwr5wObm--


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568536.887949 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCv-0000Xa-3x; Mon, 24 Jul 2023 09:50:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568536.887949; Mon, 24 Jul 2023 09:50:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCu-0000XK-Us; Mon, 24 Jul 2023 09:50:24 +0000
Received: by outflank-mailman (input) for mailman id 568536;
 Mon, 24 Jul 2023 09:45:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNs82-0007Dq-BZ
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:45:22 +0000
Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com
 [2607:f8b0:4864:20::535])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cd3ad165-2a06-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:45:20 +0200 (CEST)
Received: by mail-pg1-x535.google.com with SMTP id
 41be03b00d2f7-51f64817809so327322a12.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:45:20 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.45.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:45:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cd3ad165-2a06-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690191919; x=1690796719;
        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=0X7TTaSazj3dc5TZWcWlx26plk8VSh9DX3kWilrzg5Y=;
        b=VdTlZzB/jt/y63TJbbmnBK+5js3Ai/LddYK/vf13ARBhQSvnt0Hz2diGL3wfF6OnsP
         HxxDWYPxoFkC0iZxGk8IY7vRHxLpbhyIfaiEp9BIvngC76U3HdqMoZH3/YRNTL1V5vwe
         zO+Lz0eD4BVRbZ0IURus60XLrJDuKKqH936iw0mnlXu7MzNaeNUma2I2myQc8agKXgfl
         pbjJR+enxdiTLIrLQ8gqeStuTN/SAtbTDq+XP0ykolWIfc4CpfxMqclaF5ZnKSjILwlK
         awFJhJScJGP43MZKBZYQI4RAePrYxQgrIX/vx1eVt9xbVs4P5Bpbtfztjp3BWrG5XYSj
         sW5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690191919; x=1690796719;
        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=0X7TTaSazj3dc5TZWcWlx26plk8VSh9DX3kWilrzg5Y=;
        b=Y0KqLRH2Y5fJEV9W4MSqVNYqXeGQToDQdl8b+LBS0C0jVqtikU2UdS7/5fzbV+TR6K
         nl0dxMNZC8SOkkXZGEwLuH9LfDS5Jr82rCJHQrT+5Y2QwClVzEUnSfKk6fZgbR119qdX
         G+ne6ibQ/wTnaTA5yZN12rSO5fF9JpAmkyBES5P8ET6use2YDHX1R8Wm1Rx8A6XhHq1C
         qb7EnQ06uLCX6bmLvBr7l6tTS/rb4/2KZsUtLrTQvv7f5XNvB6HYYzsUwhk+gaEHLB/r
         D9jIxGqa0/EsE6ilKmNGnOyNq5Dntz0mmZOogHCpKkrLfc0y0rQmqin/wzgfqfB7v+tX
         TtxQ==
X-Gm-Message-State: ABy/qLYqEU3Ug58fRwdfaIE+SdnEDuGuYQ7jLapCAX5Ep8f2tt6D4QjP
	mTfQ46pQgkhhNpb89EK41Gciow==
X-Google-Smtp-Source: APBJJlFPznU2Mz9DpyvvZilnZbWNmGsS/vZbyZ4WeV3OjyfgEZ+ZkP4Oi24D+44zfnF1qq2REK47wg==
X-Received: by 2002:a17:902:e849:b0:1b8:35fa:cdcc with SMTP id t9-20020a170902e84900b001b835facdccmr12687528plg.5.1690191918908;
        Mon, 24 Jul 2023 02:45:18 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 01/47] mm: vmscan: move shrinker-related code into a separate file
Date: Mon, 24 Jul 2023 17:43:08 +0800
Message-Id: <20230724094354.90817-2-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The mm/vmscan.c file is too large, so separate the shrinker-related
code from it into a separate file. No functional changes.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 include/linux/shrinker.h |   3 +
 mm/Makefile              |   4 +-
 mm/shrinker.c            | 707 +++++++++++++++++++++++++++++++++++++++
 mm/vmscan.c              | 701 --------------------------------------
 4 files changed, 712 insertions(+), 703 deletions(-)
 create mode 100644 mm/shrinker.c

diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
index 224293b2dd06..961cb84e51f5 100644
--- a/include/linux/shrinker.h
+++ b/include/linux/shrinker.h
@@ -96,6 +96,9 @@ struct shrinker {
  */
 #define SHRINKER_NONSLAB	(1 << 3)
 
+unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
+			  int priority);
+
 extern int __printf(2, 3) prealloc_shrinker(struct shrinker *shrinker,
 					    const char *fmt, ...);
 extern void register_shrinker_prepared(struct shrinker *shrinker);
diff --git a/mm/Makefile b/mm/Makefile
index 678530a07326..891899186608 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -48,8 +48,8 @@ endif
 
 obj-y			:= filemap.o mempool.o oom_kill.o fadvise.o \
 			   maccess.o page-writeback.o folio-compat.o \
-			   readahead.o swap.o truncate.o vmscan.o shmem.o \
-			   util.o mmzone.o vmstat.o backing-dev.o \
+			   readahead.o swap.o truncate.o vmscan.o shrinker.o \
+			   shmem.o util.o mmzone.o vmstat.o backing-dev.o \
 			   mm_init.o percpu.o slab_common.o \
 			   compaction.o show_mem.o\
 			   interval_tree.o list_lru.o workingset.o \
diff --git a/mm/shrinker.c b/mm/shrinker.c
new file mode 100644
index 000000000000..0a32ef42f2a7
--- /dev/null
+++ b/mm/shrinker.c
@@ -0,0 +1,707 @@
+// SPDX-License-Identifier: GPL-2.0
+#include <linux/memcontrol.h>
+#include <linux/rwsem.h>
+#include <linux/shrinker.h>
+#include <trace/events/vmscan.h>
+
+LIST_HEAD(shrinker_list);
+DECLARE_RWSEM(shrinker_rwsem);
+
+#ifdef CONFIG_MEMCG
+static int shrinker_nr_max;
+
+/* The shrinker_info is expanded in a batch of BITS_PER_LONG */
+static inline int shrinker_map_size(int nr_items)
+{
+	return (DIV_ROUND_UP(nr_items, BITS_PER_LONG) * sizeof(unsigned long));
+}
+
+static inline int shrinker_defer_size(int nr_items)
+{
+	return (round_up(nr_items, BITS_PER_LONG) * sizeof(atomic_long_t));
+}
+
+void free_shrinker_info(struct mem_cgroup *memcg)
+{
+	struct mem_cgroup_per_node *pn;
+	struct shrinker_info *info;
+	int nid;
+
+	for_each_node(nid) {
+		pn = memcg->nodeinfo[nid];
+		info = rcu_dereference_protected(pn->shrinker_info, true);
+		kvfree(info);
+		rcu_assign_pointer(pn->shrinker_info, NULL);
+	}
+}
+
+int alloc_shrinker_info(struct mem_cgroup *memcg)
+{
+	struct shrinker_info *info;
+	int nid, size, ret = 0;
+	int map_size, defer_size = 0;
+
+	down_write(&shrinker_rwsem);
+	map_size = shrinker_map_size(shrinker_nr_max);
+	defer_size = shrinker_defer_size(shrinker_nr_max);
+	size = map_size + defer_size;
+	for_each_node(nid) {
+		info = kvzalloc_node(sizeof(*info) + size, GFP_KERNEL, nid);
+		if (!info) {
+			free_shrinker_info(memcg);
+			ret = -ENOMEM;
+			break;
+		}
+		info->nr_deferred = (atomic_long_t *)(info + 1);
+		info->map = (void *)info->nr_deferred + defer_size;
+		info->map_nr_max = shrinker_nr_max;
+		rcu_assign_pointer(memcg->nodeinfo[nid]->shrinker_info, info);
+	}
+	up_write(&shrinker_rwsem);
+
+	return ret;
+}
+
+static struct shrinker_info *shrinker_info_protected(struct mem_cgroup *memcg,
+						     int nid)
+{
+	return rcu_dereference_protected(memcg->nodeinfo[nid]->shrinker_info,
+					 lockdep_is_held(&shrinker_rwsem));
+}
+
+static int expand_one_shrinker_info(struct mem_cgroup *memcg,
+				    int map_size, int defer_size,
+				    int old_map_size, int old_defer_size,
+				    int new_nr_max)
+{
+	struct shrinker_info *new, *old;
+	struct mem_cgroup_per_node *pn;
+	int nid;
+	int size = map_size + defer_size;
+
+	for_each_node(nid) {
+		pn = memcg->nodeinfo[nid];
+		old = shrinker_info_protected(memcg, nid);
+		/* Not yet online memcg */
+		if (!old)
+			return 0;
+
+		/* Already expanded this shrinker_info */
+		if (new_nr_max <= old->map_nr_max)
+			continue;
+
+		new = kvmalloc_node(sizeof(*new) + size, GFP_KERNEL, nid);
+		if (!new)
+			return -ENOMEM;
+
+		new->nr_deferred = (atomic_long_t *)(new + 1);
+		new->map = (void *)new->nr_deferred + defer_size;
+		new->map_nr_max = new_nr_max;
+
+		/* map: set all old bits, clear all new bits */
+		memset(new->map, (int)0xff, old_map_size);
+		memset((void *)new->map + old_map_size, 0, map_size - old_map_size);
+		/* nr_deferred: copy old values, clear all new values */
+		memcpy(new->nr_deferred, old->nr_deferred, old_defer_size);
+		memset((void *)new->nr_deferred + old_defer_size, 0,
+		       defer_size - old_defer_size);
+
+		rcu_assign_pointer(pn->shrinker_info, new);
+		kvfree_rcu(old, rcu);
+	}
+
+	return 0;
+}
+
+static int expand_shrinker_info(int new_id)
+{
+	int ret = 0;
+	int new_nr_max = round_up(new_id + 1, BITS_PER_LONG);
+	int map_size, defer_size = 0;
+	int old_map_size, old_defer_size = 0;
+	struct mem_cgroup *memcg;
+
+	if (!root_mem_cgroup)
+		goto out;
+
+	lockdep_assert_held(&shrinker_rwsem);
+
+	map_size = shrinker_map_size(new_nr_max);
+	defer_size = shrinker_defer_size(new_nr_max);
+	old_map_size = shrinker_map_size(shrinker_nr_max);
+	old_defer_size = shrinker_defer_size(shrinker_nr_max);
+
+	memcg = mem_cgroup_iter(NULL, NULL, NULL);
+	do {
+		ret = expand_one_shrinker_info(memcg, map_size, defer_size,
+					       old_map_size, old_defer_size,
+					       new_nr_max);
+		if (ret) {
+			mem_cgroup_iter_break(NULL, memcg);
+			goto out;
+		}
+	} while ((memcg = mem_cgroup_iter(NULL, memcg, NULL)) != NULL);
+out:
+	if (!ret)
+		shrinker_nr_max = new_nr_max;
+
+	return ret;
+}
+
+void set_shrinker_bit(struct mem_cgroup *memcg, int nid, int shrinker_id)
+{
+	if (shrinker_id >= 0 && memcg && !mem_cgroup_is_root(memcg)) {
+		struct shrinker_info *info;
+
+		rcu_read_lock();
+		info = rcu_dereference(memcg->nodeinfo[nid]->shrinker_info);
+		if (!WARN_ON_ONCE(shrinker_id >= info->map_nr_max)) {
+			/* Pairs with smp mb in shrink_slab() */
+			smp_mb__before_atomic();
+			set_bit(shrinker_id, info->map);
+		}
+		rcu_read_unlock();
+	}
+}
+
+static DEFINE_IDR(shrinker_idr);
+
+static int prealloc_memcg_shrinker(struct shrinker *shrinker)
+{
+	int id, ret = -ENOMEM;
+
+	if (mem_cgroup_disabled())
+		return -ENOSYS;
+
+	down_write(&shrinker_rwsem);
+	/* This may call shrinker, so it must use down_read_trylock() */
+	id = idr_alloc(&shrinker_idr, shrinker, 0, 0, GFP_KERNEL);
+	if (id < 0)
+		goto unlock;
+
+	if (id >= shrinker_nr_max) {
+		if (expand_shrinker_info(id)) {
+			idr_remove(&shrinker_idr, id);
+			goto unlock;
+		}
+	}
+	shrinker->id = id;
+	ret = 0;
+unlock:
+	up_write(&shrinker_rwsem);
+	return ret;
+}
+
+static void unregister_memcg_shrinker(struct shrinker *shrinker)
+{
+	int id = shrinker->id;
+
+	BUG_ON(id < 0);
+
+	lockdep_assert_held(&shrinker_rwsem);
+
+	idr_remove(&shrinker_idr, id);
+}
+
+static long xchg_nr_deferred_memcg(int nid, struct shrinker *shrinker,
+				   struct mem_cgroup *memcg)
+{
+	struct shrinker_info *info;
+
+	info = shrinker_info_protected(memcg, nid);
+	return atomic_long_xchg(&info->nr_deferred[shrinker->id], 0);
+}
+
+static long add_nr_deferred_memcg(long nr, int nid, struct shrinker *shrinker,
+				  struct mem_cgroup *memcg)
+{
+	struct shrinker_info *info;
+
+	info = shrinker_info_protected(memcg, nid);
+	return atomic_long_add_return(nr, &info->nr_deferred[shrinker->id]);
+}
+
+void reparent_shrinker_deferred(struct mem_cgroup *memcg)
+{
+	int i, nid;
+	long nr;
+	struct mem_cgroup *parent;
+	struct shrinker_info *child_info, *parent_info;
+
+	parent = parent_mem_cgroup(memcg);
+	if (!parent)
+		parent = root_mem_cgroup;
+
+	/* Prevent from concurrent shrinker_info expand */
+	down_read(&shrinker_rwsem);
+	for_each_node(nid) {
+		child_info = shrinker_info_protected(memcg, nid);
+		parent_info = shrinker_info_protected(parent, nid);
+		for (i = 0; i < child_info->map_nr_max; i++) {
+			nr = atomic_long_read(&child_info->nr_deferred[i]);
+			atomic_long_add(nr, &parent_info->nr_deferred[i]);
+		}
+	}
+	up_read(&shrinker_rwsem);
+}
+#else
+static int prealloc_memcg_shrinker(struct shrinker *shrinker)
+{
+	return -ENOSYS;
+}
+
+static void unregister_memcg_shrinker(struct shrinker *shrinker)
+{
+}
+
+static long xchg_nr_deferred_memcg(int nid, struct shrinker *shrinker,
+				   struct mem_cgroup *memcg)
+{
+	return 0;
+}
+
+static long add_nr_deferred_memcg(long nr, int nid, struct shrinker *shrinker,
+				  struct mem_cgroup *memcg)
+{
+	return 0;
+}
+#endif /* CONFIG_MEMCG */
+
+static long xchg_nr_deferred(struct shrinker *shrinker,
+			     struct shrink_control *sc)
+{
+	int nid = sc->nid;
+
+	if (!(shrinker->flags & SHRINKER_NUMA_AWARE))
+		nid = 0;
+
+	if (sc->memcg &&
+	    (shrinker->flags & SHRINKER_MEMCG_AWARE))
+		return xchg_nr_deferred_memcg(nid, shrinker,
+					      sc->memcg);
+
+	return atomic_long_xchg(&shrinker->nr_deferred[nid], 0);
+}
+
+
+static long add_nr_deferred(long nr, struct shrinker *shrinker,
+			    struct shrink_control *sc)
+{
+	int nid = sc->nid;
+
+	if (!(shrinker->flags & SHRINKER_NUMA_AWARE))
+		nid = 0;
+
+	if (sc->memcg &&
+	    (shrinker->flags & SHRINKER_MEMCG_AWARE))
+		return add_nr_deferred_memcg(nr, nid, shrinker,
+					     sc->memcg);
+
+	return atomic_long_add_return(nr, &shrinker->nr_deferred[nid]);
+}
+
+#define SHRINK_BATCH 128
+
+static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
+				    struct shrinker *shrinker, int priority)
+{
+	unsigned long freed = 0;
+	unsigned long long delta;
+	long total_scan;
+	long freeable;
+	long nr;
+	long new_nr;
+	long batch_size = shrinker->batch ? shrinker->batch
+					  : SHRINK_BATCH;
+	long scanned = 0, next_deferred;
+
+	freeable = shrinker->count_objects(shrinker, shrinkctl);
+	if (freeable == 0 || freeable == SHRINK_EMPTY)
+		return freeable;
+
+	/*
+	 * copy the current shrinker scan count into a local variable
+	 * and zero it so that other concurrent shrinker invocations
+	 * don't also do this scanning work.
+	 */
+	nr = xchg_nr_deferred(shrinker, shrinkctl);
+
+	if (shrinker->seeks) {
+		delta = freeable >> priority;
+		delta *= 4;
+		do_div(delta, shrinker->seeks);
+	} else {
+		/*
+		 * These objects don't require any IO to create. Trim
+		 * them aggressively under memory pressure to keep
+		 * them from causing refetches in the IO caches.
+		 */
+		delta = freeable / 2;
+	}
+
+	total_scan = nr >> priority;
+	total_scan += delta;
+	total_scan = min(total_scan, (2 * freeable));
+
+	trace_mm_shrink_slab_start(shrinker, shrinkctl, nr,
+				   freeable, delta, total_scan, priority);
+
+	/*
+	 * Normally, we should not scan less than batch_size objects in one
+	 * pass to avoid too frequent shrinker calls, but if the slab has less
+	 * than batch_size objects in total and we are really tight on memory,
+	 * we will try to reclaim all available objects, otherwise we can end
+	 * up failing allocations although there are plenty of reclaimable
+	 * objects spread over several slabs with usage less than the
+	 * batch_size.
+	 *
+	 * We detect the "tight on memory" situations by looking at the total
+	 * number of objects we want to scan (total_scan). If it is greater
+	 * than the total number of objects on slab (freeable), we must be
+	 * scanning at high prio and therefore should try to reclaim as much as
+	 * possible.
+	 */
+	while (total_scan >= batch_size ||
+	       total_scan >= freeable) {
+		unsigned long ret;
+		unsigned long nr_to_scan = min(batch_size, total_scan);
+
+		shrinkctl->nr_to_scan = nr_to_scan;
+		shrinkctl->nr_scanned = nr_to_scan;
+		ret = shrinker->scan_objects(shrinker, shrinkctl);
+		if (ret == SHRINK_STOP)
+			break;
+		freed += ret;
+
+		count_vm_events(SLABS_SCANNED, shrinkctl->nr_scanned);
+		total_scan -= shrinkctl->nr_scanned;
+		scanned += shrinkctl->nr_scanned;
+
+		cond_resched();
+	}
+
+	/*
+	 * The deferred work is increased by any new work (delta) that wasn't
+	 * done, decreased by old deferred work that was done now.
+	 *
+	 * And it is capped to two times of the freeable items.
+	 */
+	next_deferred = max_t(long, (nr + delta - scanned), 0);
+	next_deferred = min(next_deferred, (2 * freeable));
+
+	/*
+	 * move the unused scan count back into the shrinker in a
+	 * manner that handles concurrent updates.
+	 */
+	new_nr = add_nr_deferred(next_deferred, shrinker, shrinkctl);
+
+	trace_mm_shrink_slab_end(shrinker, shrinkctl->nid, freed, nr, new_nr, total_scan);
+	return freed;
+}
+
+#ifdef CONFIG_MEMCG
+static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
+			struct mem_cgroup *memcg, int priority)
+{
+	struct shrinker_info *info;
+	unsigned long ret, freed = 0;
+	int i;
+
+	if (!mem_cgroup_online(memcg))
+		return 0;
+
+	if (!down_read_trylock(&shrinker_rwsem))
+		return 0;
+
+	info = shrinker_info_protected(memcg, nid);
+	if (unlikely(!info))
+		goto unlock;
+
+	for_each_set_bit(i, info->map, info->map_nr_max) {
+		struct shrink_control sc = {
+			.gfp_mask = gfp_mask,
+			.nid = nid,
+			.memcg = memcg,
+		};
+		struct shrinker *shrinker;
+
+		shrinker = idr_find(&shrinker_idr, i);
+		if (unlikely(!shrinker || !(shrinker->flags & SHRINKER_REGISTERED))) {
+			if (!shrinker)
+				clear_bit(i, info->map);
+			continue;
+		}
+
+		/* Call non-slab shrinkers even though kmem is disabled */
+		if (!memcg_kmem_online() &&
+		    !(shrinker->flags & SHRINKER_NONSLAB))
+			continue;
+
+		ret = do_shrink_slab(&sc, shrinker, priority);
+		if (ret == SHRINK_EMPTY) {
+			clear_bit(i, info->map);
+			/*
+			 * After the shrinker reported that it had no objects to
+			 * free, but before we cleared the corresponding bit in
+			 * the memcg shrinker map, a new object might have been
+			 * added. To make sure, we have the bit set in this
+			 * case, we invoke the shrinker one more time and reset
+			 * the bit if it reports that it is not empty anymore.
+			 * The memory barrier here pairs with the barrier in
+			 * set_shrinker_bit():
+			 *
+			 * list_lru_add()     shrink_slab_memcg()
+			 *   list_add_tail()    clear_bit()
+			 *   <MB>               <MB>
+			 *   set_bit()          do_shrink_slab()
+			 */
+			smp_mb__after_atomic();
+			ret = do_shrink_slab(&sc, shrinker, priority);
+			if (ret == SHRINK_EMPTY)
+				ret = 0;
+			else
+				set_shrinker_bit(memcg, nid, i);
+		}
+		freed += ret;
+
+		if (rwsem_is_contended(&shrinker_rwsem)) {
+			freed = freed ? : 1;
+			break;
+		}
+	}
+unlock:
+	up_read(&shrinker_rwsem);
+	return freed;
+}
+#else /* !CONFIG_MEMCG */
+static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
+			struct mem_cgroup *memcg, int priority)
+{
+	return 0;
+}
+#endif /* CONFIG_MEMCG */
+
+/**
+ * shrink_slab - shrink slab caches
+ * @gfp_mask: allocation context
+ * @nid: node whose slab caches to target
+ * @memcg: memory cgroup whose slab caches to target
+ * @priority: the reclaim priority
+ *
+ * Call the shrink functions to age shrinkable caches.
+ *
+ * @nid is passed along to shrinkers with SHRINKER_NUMA_AWARE set,
+ * unaware shrinkers will receive a node id of 0 instead.
+ *
+ * @memcg specifies the memory cgroup to target. Unaware shrinkers
+ * are called only if it is the root cgroup.
+ *
+ * @priority is sc->priority, we take the number of objects and >> by priority
+ * in order to get the scan target.
+ *
+ * Returns the number of reclaimed slab objects.
+ */
+unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
+			  int priority)
+{
+	unsigned long ret, freed = 0;
+	struct shrinker *shrinker;
+
+	/*
+	 * The root memcg might be allocated even though memcg is disabled
+	 * via "cgroup_disable=memory" boot parameter.  This could make
+	 * mem_cgroup_is_root() return false, then just run memcg slab
+	 * shrink, but skip global shrink.  This may result in premature
+	 * oom.
+	 */
+	if (!mem_cgroup_disabled() && !mem_cgroup_is_root(memcg))
+		return shrink_slab_memcg(gfp_mask, nid, memcg, priority);
+
+	if (!down_read_trylock(&shrinker_rwsem))
+		goto out;
+
+	list_for_each_entry(shrinker, &shrinker_list, list) {
+		struct shrink_control sc = {
+			.gfp_mask = gfp_mask,
+			.nid = nid,
+			.memcg = memcg,
+		};
+
+		ret = do_shrink_slab(&sc, shrinker, priority);
+		if (ret == SHRINK_EMPTY)
+			ret = 0;
+		freed += ret;
+		/*
+		 * Bail out if someone want to register a new shrinker to
+		 * prevent the registration from being stalled for long periods
+		 * by parallel ongoing shrinking.
+		 */
+		if (rwsem_is_contended(&shrinker_rwsem)) {
+			freed = freed ? : 1;
+			break;
+		}
+	}
+
+	up_read(&shrinker_rwsem);
+out:
+	cond_resched();
+	return freed;
+}
+
+/*
+ * Add a shrinker callback to be called from the vm.
+ */
+static int __prealloc_shrinker(struct shrinker *shrinker)
+{
+	unsigned int size;
+	int err;
+
+	if (shrinker->flags & SHRINKER_MEMCG_AWARE) {
+		err = prealloc_memcg_shrinker(shrinker);
+		if (err != -ENOSYS)
+			return err;
+
+		shrinker->flags &= ~SHRINKER_MEMCG_AWARE;
+	}
+
+	size = sizeof(*shrinker->nr_deferred);
+	if (shrinker->flags & SHRINKER_NUMA_AWARE)
+		size *= nr_node_ids;
+
+	shrinker->nr_deferred = kzalloc(size, GFP_KERNEL);
+	if (!shrinker->nr_deferred)
+		return -ENOMEM;
+
+	return 0;
+}
+
+#ifdef CONFIG_SHRINKER_DEBUG
+int prealloc_shrinker(struct shrinker *shrinker, const char *fmt, ...)
+{
+	va_list ap;
+	int err;
+
+	va_start(ap, fmt);
+	shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
+	va_end(ap);
+	if (!shrinker->name)
+		return -ENOMEM;
+
+	err = __prealloc_shrinker(shrinker);
+	if (err) {
+		kfree_const(shrinker->name);
+		shrinker->name = NULL;
+	}
+
+	return err;
+}
+#else
+int prealloc_shrinker(struct shrinker *shrinker, const char *fmt, ...)
+{
+	return __prealloc_shrinker(shrinker);
+}
+#endif
+
+void free_prealloced_shrinker(struct shrinker *shrinker)
+{
+#ifdef CONFIG_SHRINKER_DEBUG
+	kfree_const(shrinker->name);
+	shrinker->name = NULL;
+#endif
+	if (shrinker->flags & SHRINKER_MEMCG_AWARE) {
+		down_write(&shrinker_rwsem);
+		unregister_memcg_shrinker(shrinker);
+		up_write(&shrinker_rwsem);
+		return;
+	}
+
+	kfree(shrinker->nr_deferred);
+	shrinker->nr_deferred = NULL;
+}
+
+void register_shrinker_prepared(struct shrinker *shrinker)
+{
+	down_write(&shrinker_rwsem);
+	list_add_tail(&shrinker->list, &shrinker_list);
+	shrinker->flags |= SHRINKER_REGISTERED;
+	shrinker_debugfs_add(shrinker);
+	up_write(&shrinker_rwsem);
+}
+
+static int __register_shrinker(struct shrinker *shrinker)
+{
+	int err = __prealloc_shrinker(shrinker);
+
+	if (err)
+		return err;
+	register_shrinker_prepared(shrinker);
+	return 0;
+}
+
+#ifdef CONFIG_SHRINKER_DEBUG
+int register_shrinker(struct shrinker *shrinker, const char *fmt, ...)
+{
+	va_list ap;
+	int err;
+
+	va_start(ap, fmt);
+	shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
+	va_end(ap);
+	if (!shrinker->name)
+		return -ENOMEM;
+
+	err = __register_shrinker(shrinker);
+	if (err) {
+		kfree_const(shrinker->name);
+		shrinker->name = NULL;
+	}
+	return err;
+}
+#else
+int register_shrinker(struct shrinker *shrinker, const char *fmt, ...)
+{
+	return __register_shrinker(shrinker);
+}
+#endif
+EXPORT_SYMBOL(register_shrinker);
+
+/*
+ * Remove one
+ */
+void unregister_shrinker(struct shrinker *shrinker)
+{
+	struct dentry *debugfs_entry;
+	int debugfs_id;
+
+	if (!(shrinker->flags & SHRINKER_REGISTERED))
+		return;
+
+	down_write(&shrinker_rwsem);
+	list_del(&shrinker->list);
+	shrinker->flags &= ~SHRINKER_REGISTERED;
+	if (shrinker->flags & SHRINKER_MEMCG_AWARE)
+		unregister_memcg_shrinker(shrinker);
+	debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);
+	up_write(&shrinker_rwsem);
+
+	shrinker_debugfs_remove(debugfs_entry, debugfs_id);
+
+	kfree(shrinker->nr_deferred);
+	shrinker->nr_deferred = NULL;
+}
+EXPORT_SYMBOL(unregister_shrinker);
+
+/**
+ * synchronize_shrinkers - Wait for all running shrinkers to complete.
+ *
+ * This is equivalent to calling unregister_shrink() and register_shrinker(),
+ * but atomically and with less overhead. This is useful to guarantee that all
+ * shrinker invocations have seen an update, before freeing memory, similar to
+ * rcu.
+ */
+void synchronize_shrinkers(void)
+{
+	down_write(&shrinker_rwsem);
+	up_write(&shrinker_rwsem);
+}
+EXPORT_SYMBOL(synchronize_shrinkers);
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 4039620d30fe..07bc58af6f26 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -35,7 +35,6 @@
 #include <linux/cpuset.h>
 #include <linux/compaction.h>
 #include <linux/notifier.h>
-#include <linux/rwsem.h>
 #include <linux/delay.h>
 #include <linux/kthread.h>
 #include <linux/freezer.h>
@@ -188,246 +187,7 @@ struct scan_control {
  */
 int vm_swappiness = 60;
 
-LIST_HEAD(shrinker_list);
-DECLARE_RWSEM(shrinker_rwsem);
-
 #ifdef CONFIG_MEMCG
-static int shrinker_nr_max;
-
-/* The shrinker_info is expanded in a batch of BITS_PER_LONG */
-static inline int shrinker_map_size(int nr_items)
-{
-	return (DIV_ROUND_UP(nr_items, BITS_PER_LONG) * sizeof(unsigned long));
-}
-
-static inline int shrinker_defer_size(int nr_items)
-{
-	return (round_up(nr_items, BITS_PER_LONG) * sizeof(atomic_long_t));
-}
-
-static struct shrinker_info *shrinker_info_protected(struct mem_cgroup *memcg,
-						     int nid)
-{
-	return rcu_dereference_protected(memcg->nodeinfo[nid]->shrinker_info,
-					 lockdep_is_held(&shrinker_rwsem));
-}
-
-static int expand_one_shrinker_info(struct mem_cgroup *memcg,
-				    int map_size, int defer_size,
-				    int old_map_size, int old_defer_size,
-				    int new_nr_max)
-{
-	struct shrinker_info *new, *old;
-	struct mem_cgroup_per_node *pn;
-	int nid;
-	int size = map_size + defer_size;
-
-	for_each_node(nid) {
-		pn = memcg->nodeinfo[nid];
-		old = shrinker_info_protected(memcg, nid);
-		/* Not yet online memcg */
-		if (!old)
-			return 0;
-
-		/* Already expanded this shrinker_info */
-		if (new_nr_max <= old->map_nr_max)
-			continue;
-
-		new = kvmalloc_node(sizeof(*new) + size, GFP_KERNEL, nid);
-		if (!new)
-			return -ENOMEM;
-
-		new->nr_deferred = (atomic_long_t *)(new + 1);
-		new->map = (void *)new->nr_deferred + defer_size;
-		new->map_nr_max = new_nr_max;
-
-		/* map: set all old bits, clear all new bits */
-		memset(new->map, (int)0xff, old_map_size);
-		memset((void *)new->map + old_map_size, 0, map_size - old_map_size);
-		/* nr_deferred: copy old values, clear all new values */
-		memcpy(new->nr_deferred, old->nr_deferred, old_defer_size);
-		memset((void *)new->nr_deferred + old_defer_size, 0,
-		       defer_size - old_defer_size);
-
-		rcu_assign_pointer(pn->shrinker_info, new);
-		kvfree_rcu(old, rcu);
-	}
-
-	return 0;
-}
-
-void free_shrinker_info(struct mem_cgroup *memcg)
-{
-	struct mem_cgroup_per_node *pn;
-	struct shrinker_info *info;
-	int nid;
-
-	for_each_node(nid) {
-		pn = memcg->nodeinfo[nid];
-		info = rcu_dereference_protected(pn->shrinker_info, true);
-		kvfree(info);
-		rcu_assign_pointer(pn->shrinker_info, NULL);
-	}
-}
-
-int alloc_shrinker_info(struct mem_cgroup *memcg)
-{
-	struct shrinker_info *info;
-	int nid, size, ret = 0;
-	int map_size, defer_size = 0;
-
-	down_write(&shrinker_rwsem);
-	map_size = shrinker_map_size(shrinker_nr_max);
-	defer_size = shrinker_defer_size(shrinker_nr_max);
-	size = map_size + defer_size;
-	for_each_node(nid) {
-		info = kvzalloc_node(sizeof(*info) + size, GFP_KERNEL, nid);
-		if (!info) {
-			free_shrinker_info(memcg);
-			ret = -ENOMEM;
-			break;
-		}
-		info->nr_deferred = (atomic_long_t *)(info + 1);
-		info->map = (void *)info->nr_deferred + defer_size;
-		info->map_nr_max = shrinker_nr_max;
-		rcu_assign_pointer(memcg->nodeinfo[nid]->shrinker_info, info);
-	}
-	up_write(&shrinker_rwsem);
-
-	return ret;
-}
-
-static int expand_shrinker_info(int new_id)
-{
-	int ret = 0;
-	int new_nr_max = round_up(new_id + 1, BITS_PER_LONG);
-	int map_size, defer_size = 0;
-	int old_map_size, old_defer_size = 0;
-	struct mem_cgroup *memcg;
-
-	if (!root_mem_cgroup)
-		goto out;
-
-	lockdep_assert_held(&shrinker_rwsem);
-
-	map_size = shrinker_map_size(new_nr_max);
-	defer_size = shrinker_defer_size(new_nr_max);
-	old_map_size = shrinker_map_size(shrinker_nr_max);
-	old_defer_size = shrinker_defer_size(shrinker_nr_max);
-
-	memcg = mem_cgroup_iter(NULL, NULL, NULL);
-	do {
-		ret = expand_one_shrinker_info(memcg, map_size, defer_size,
-					       old_map_size, old_defer_size,
-					       new_nr_max);
-		if (ret) {
-			mem_cgroup_iter_break(NULL, memcg);
-			goto out;
-		}
-	} while ((memcg = mem_cgroup_iter(NULL, memcg, NULL)) != NULL);
-out:
-	if (!ret)
-		shrinker_nr_max = new_nr_max;
-
-	return ret;
-}
-
-void set_shrinker_bit(struct mem_cgroup *memcg, int nid, int shrinker_id)
-{
-	if (shrinker_id >= 0 && memcg && !mem_cgroup_is_root(memcg)) {
-		struct shrinker_info *info;
-
-		rcu_read_lock();
-		info = rcu_dereference(memcg->nodeinfo[nid]->shrinker_info);
-		if (!WARN_ON_ONCE(shrinker_id >= info->map_nr_max)) {
-			/* Pairs with smp mb in shrink_slab() */
-			smp_mb__before_atomic();
-			set_bit(shrinker_id, info->map);
-		}
-		rcu_read_unlock();
-	}
-}
-
-static DEFINE_IDR(shrinker_idr);
-
-static int prealloc_memcg_shrinker(struct shrinker *shrinker)
-{
-	int id, ret = -ENOMEM;
-
-	if (mem_cgroup_disabled())
-		return -ENOSYS;
-
-	down_write(&shrinker_rwsem);
-	/* This may call shrinker, so it must use down_read_trylock() */
-	id = idr_alloc(&shrinker_idr, shrinker, 0, 0, GFP_KERNEL);
-	if (id < 0)
-		goto unlock;
-
-	if (id >= shrinker_nr_max) {
-		if (expand_shrinker_info(id)) {
-			idr_remove(&shrinker_idr, id);
-			goto unlock;
-		}
-	}
-	shrinker->id = id;
-	ret = 0;
-unlock:
-	up_write(&shrinker_rwsem);
-	return ret;
-}
-
-static void unregister_memcg_shrinker(struct shrinker *shrinker)
-{
-	int id = shrinker->id;
-
-	BUG_ON(id < 0);
-
-	lockdep_assert_held(&shrinker_rwsem);
-
-	idr_remove(&shrinker_idr, id);
-}
-
-static long xchg_nr_deferred_memcg(int nid, struct shrinker *shrinker,
-				   struct mem_cgroup *memcg)
-{
-	struct shrinker_info *info;
-
-	info = shrinker_info_protected(memcg, nid);
-	return atomic_long_xchg(&info->nr_deferred[shrinker->id], 0);
-}
-
-static long add_nr_deferred_memcg(long nr, int nid, struct shrinker *shrinker,
-				  struct mem_cgroup *memcg)
-{
-	struct shrinker_info *info;
-
-	info = shrinker_info_protected(memcg, nid);
-	return atomic_long_add_return(nr, &info->nr_deferred[shrinker->id]);
-}
-
-void reparent_shrinker_deferred(struct mem_cgroup *memcg)
-{
-	int i, nid;
-	long nr;
-	struct mem_cgroup *parent;
-	struct shrinker_info *child_info, *parent_info;
-
-	parent = parent_mem_cgroup(memcg);
-	if (!parent)
-		parent = root_mem_cgroup;
-
-	/* Prevent from concurrent shrinker_info expand */
-	down_read(&shrinker_rwsem);
-	for_each_node(nid) {
-		child_info = shrinker_info_protected(memcg, nid);
-		parent_info = shrinker_info_protected(parent, nid);
-		for (i = 0; i < child_info->map_nr_max; i++) {
-			nr = atomic_long_read(&child_info->nr_deferred[i]);
-			atomic_long_add(nr, &parent_info->nr_deferred[i]);
-		}
-	}
-	up_read(&shrinker_rwsem);
-}
 
 /* Returns true for reclaim through cgroup limits or cgroup interfaces. */
 static bool cgroup_reclaim(struct scan_control *sc)
@@ -468,27 +228,6 @@ static bool writeback_throttling_sane(struct scan_control *sc)
 	return false;
 }
 #else
-static int prealloc_memcg_shrinker(struct shrinker *shrinker)
-{
-	return -ENOSYS;
-}
-
-static void unregister_memcg_shrinker(struct shrinker *shrinker)
-{
-}
-
-static long xchg_nr_deferred_memcg(int nid, struct shrinker *shrinker,
-				   struct mem_cgroup *memcg)
-{
-	return 0;
-}
-
-static long add_nr_deferred_memcg(long nr, int nid, struct shrinker *shrinker,
-				  struct mem_cgroup *memcg)
-{
-	return 0;
-}
-
 static bool cgroup_reclaim(struct scan_control *sc)
 {
 	return false;
@@ -557,39 +296,6 @@ static void flush_reclaim_state(struct scan_control *sc)
 	}
 }
 
-static long xchg_nr_deferred(struct shrinker *shrinker,
-			     struct shrink_control *sc)
-{
-	int nid = sc->nid;
-
-	if (!(shrinker->flags & SHRINKER_NUMA_AWARE))
-		nid = 0;
-
-	if (sc->memcg &&
-	    (shrinker->flags & SHRINKER_MEMCG_AWARE))
-		return xchg_nr_deferred_memcg(nid, shrinker,
-					      sc->memcg);
-
-	return atomic_long_xchg(&shrinker->nr_deferred[nid], 0);
-}
-
-
-static long add_nr_deferred(long nr, struct shrinker *shrinker,
-			    struct shrink_control *sc)
-{
-	int nid = sc->nid;
-
-	if (!(shrinker->flags & SHRINKER_NUMA_AWARE))
-		nid = 0;
-
-	if (sc->memcg &&
-	    (shrinker->flags & SHRINKER_MEMCG_AWARE))
-		return add_nr_deferred_memcg(nr, nid, shrinker,
-					     sc->memcg);
-
-	return atomic_long_add_return(nr, &shrinker->nr_deferred[nid]);
-}
-
 static bool can_demote(int nid, struct scan_control *sc)
 {
 	if (!numa_demotion_enabled)
@@ -671,413 +377,6 @@ static unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru,
 	return size;
 }
 
-/*
- * Add a shrinker callback to be called from the vm.
- */
-static int __prealloc_shrinker(struct shrinker *shrinker)
-{
-	unsigned int size;
-	int err;
-
-	if (shrinker->flags & SHRINKER_MEMCG_AWARE) {
-		err = prealloc_memcg_shrinker(shrinker);
-		if (err != -ENOSYS)
-			return err;
-
-		shrinker->flags &= ~SHRINKER_MEMCG_AWARE;
-	}
-
-	size = sizeof(*shrinker->nr_deferred);
-	if (shrinker->flags & SHRINKER_NUMA_AWARE)
-		size *= nr_node_ids;
-
-	shrinker->nr_deferred = kzalloc(size, GFP_KERNEL);
-	if (!shrinker->nr_deferred)
-		return -ENOMEM;
-
-	return 0;
-}
-
-#ifdef CONFIG_SHRINKER_DEBUG
-int prealloc_shrinker(struct shrinker *shrinker, const char *fmt, ...)
-{
-	va_list ap;
-	int err;
-
-	va_start(ap, fmt);
-	shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
-	va_end(ap);
-	if (!shrinker->name)
-		return -ENOMEM;
-
-	err = __prealloc_shrinker(shrinker);
-	if (err) {
-		kfree_const(shrinker->name);
-		shrinker->name = NULL;
-	}
-
-	return err;
-}
-#else
-int prealloc_shrinker(struct shrinker *shrinker, const char *fmt, ...)
-{
-	return __prealloc_shrinker(shrinker);
-}
-#endif
-
-void free_prealloced_shrinker(struct shrinker *shrinker)
-{
-#ifdef CONFIG_SHRINKER_DEBUG
-	kfree_const(shrinker->name);
-	shrinker->name = NULL;
-#endif
-	if (shrinker->flags & SHRINKER_MEMCG_AWARE) {
-		down_write(&shrinker_rwsem);
-		unregister_memcg_shrinker(shrinker);
-		up_write(&shrinker_rwsem);
-		return;
-	}
-
-	kfree(shrinker->nr_deferred);
-	shrinker->nr_deferred = NULL;
-}
-
-void register_shrinker_prepared(struct shrinker *shrinker)
-{
-	down_write(&shrinker_rwsem);
-	list_add_tail(&shrinker->list, &shrinker_list);
-	shrinker->flags |= SHRINKER_REGISTERED;
-	shrinker_debugfs_add(shrinker);
-	up_write(&shrinker_rwsem);
-}
-
-static int __register_shrinker(struct shrinker *shrinker)
-{
-	int err = __prealloc_shrinker(shrinker);
-
-	if (err)
-		return err;
-	register_shrinker_prepared(shrinker);
-	return 0;
-}
-
-#ifdef CONFIG_SHRINKER_DEBUG
-int register_shrinker(struct shrinker *shrinker, const char *fmt, ...)
-{
-	va_list ap;
-	int err;
-
-	va_start(ap, fmt);
-	shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
-	va_end(ap);
-	if (!shrinker->name)
-		return -ENOMEM;
-
-	err = __register_shrinker(shrinker);
-	if (err) {
-		kfree_const(shrinker->name);
-		shrinker->name = NULL;
-	}
-	return err;
-}
-#else
-int register_shrinker(struct shrinker *shrinker, const char *fmt, ...)
-{
-	return __register_shrinker(shrinker);
-}
-#endif
-EXPORT_SYMBOL(register_shrinker);
-
-/*
- * Remove one
- */
-void unregister_shrinker(struct shrinker *shrinker)
-{
-	struct dentry *debugfs_entry;
-	int debugfs_id;
-
-	if (!(shrinker->flags & SHRINKER_REGISTERED))
-		return;
-
-	down_write(&shrinker_rwsem);
-	list_del(&shrinker->list);
-	shrinker->flags &= ~SHRINKER_REGISTERED;
-	if (shrinker->flags & SHRINKER_MEMCG_AWARE)
-		unregister_memcg_shrinker(shrinker);
-	debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);
-	up_write(&shrinker_rwsem);
-
-	shrinker_debugfs_remove(debugfs_entry, debugfs_id);
-
-	kfree(shrinker->nr_deferred);
-	shrinker->nr_deferred = NULL;
-}
-EXPORT_SYMBOL(unregister_shrinker);
-
-/**
- * synchronize_shrinkers - Wait for all running shrinkers to complete.
- *
- * This is equivalent to calling unregister_shrink() and register_shrinker(),
- * but atomically and with less overhead. This is useful to guarantee that all
- * shrinker invocations have seen an update, before freeing memory, similar to
- * rcu.
- */
-void synchronize_shrinkers(void)
-{
-	down_write(&shrinker_rwsem);
-	up_write(&shrinker_rwsem);
-}
-EXPORT_SYMBOL(synchronize_shrinkers);
-
-#define SHRINK_BATCH 128
-
-static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
-				    struct shrinker *shrinker, int priority)
-{
-	unsigned long freed = 0;
-	unsigned long long delta;
-	long total_scan;
-	long freeable;
-	long nr;
-	long new_nr;
-	long batch_size = shrinker->batch ? shrinker->batch
-					  : SHRINK_BATCH;
-	long scanned = 0, next_deferred;
-
-	freeable = shrinker->count_objects(shrinker, shrinkctl);
-	if (freeable == 0 || freeable == SHRINK_EMPTY)
-		return freeable;
-
-	/*
-	 * copy the current shrinker scan count into a local variable
-	 * and zero it so that other concurrent shrinker invocations
-	 * don't also do this scanning work.
-	 */
-	nr = xchg_nr_deferred(shrinker, shrinkctl);
-
-	if (shrinker->seeks) {
-		delta = freeable >> priority;
-		delta *= 4;
-		do_div(delta, shrinker->seeks);
-	} else {
-		/*
-		 * These objects don't require any IO to create. Trim
-		 * them aggressively under memory pressure to keep
-		 * them from causing refetches in the IO caches.
-		 */
-		delta = freeable / 2;
-	}
-
-	total_scan = nr >> priority;
-	total_scan += delta;
-	total_scan = min(total_scan, (2 * freeable));
-
-	trace_mm_shrink_slab_start(shrinker, shrinkctl, nr,
-				   freeable, delta, total_scan, priority);
-
-	/*
-	 * Normally, we should not scan less than batch_size objects in one
-	 * pass to avoid too frequent shrinker calls, but if the slab has less
-	 * than batch_size objects in total and we are really tight on memory,
-	 * we will try to reclaim all available objects, otherwise we can end
-	 * up failing allocations although there are plenty of reclaimable
-	 * objects spread over several slabs with usage less than the
-	 * batch_size.
-	 *
-	 * We detect the "tight on memory" situations by looking at the total
-	 * number of objects we want to scan (total_scan). If it is greater
-	 * than the total number of objects on slab (freeable), we must be
-	 * scanning at high prio and therefore should try to reclaim as much as
-	 * possible.
-	 */
-	while (total_scan >= batch_size ||
-	       total_scan >= freeable) {
-		unsigned long ret;
-		unsigned long nr_to_scan = min(batch_size, total_scan);
-
-		shrinkctl->nr_to_scan = nr_to_scan;
-		shrinkctl->nr_scanned = nr_to_scan;
-		ret = shrinker->scan_objects(shrinker, shrinkctl);
-		if (ret == SHRINK_STOP)
-			break;
-		freed += ret;
-
-		count_vm_events(SLABS_SCANNED, shrinkctl->nr_scanned);
-		total_scan -= shrinkctl->nr_scanned;
-		scanned += shrinkctl->nr_scanned;
-
-		cond_resched();
-	}
-
-	/*
-	 * The deferred work is increased by any new work (delta) that wasn't
-	 * done, decreased by old deferred work that was done now.
-	 *
-	 * And it is capped to two times of the freeable items.
-	 */
-	next_deferred = max_t(long, (nr + delta - scanned), 0);
-	next_deferred = min(next_deferred, (2 * freeable));
-
-	/*
-	 * move the unused scan count back into the shrinker in a
-	 * manner that handles concurrent updates.
-	 */
-	new_nr = add_nr_deferred(next_deferred, shrinker, shrinkctl);
-
-	trace_mm_shrink_slab_end(shrinker, shrinkctl->nid, freed, nr, new_nr, total_scan);
-	return freed;
-}
-
-#ifdef CONFIG_MEMCG
-static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
-			struct mem_cgroup *memcg, int priority)
-{
-	struct shrinker_info *info;
-	unsigned long ret, freed = 0;
-	int i;
-
-	if (!mem_cgroup_online(memcg))
-		return 0;
-
-	if (!down_read_trylock(&shrinker_rwsem))
-		return 0;
-
-	info = shrinker_info_protected(memcg, nid);
-	if (unlikely(!info))
-		goto unlock;
-
-	for_each_set_bit(i, info->map, info->map_nr_max) {
-		struct shrink_control sc = {
-			.gfp_mask = gfp_mask,
-			.nid = nid,
-			.memcg = memcg,
-		};
-		struct shrinker *shrinker;
-
-		shrinker = idr_find(&shrinker_idr, i);
-		if (unlikely(!shrinker || !(shrinker->flags & SHRINKER_REGISTERED))) {
-			if (!shrinker)
-				clear_bit(i, info->map);
-			continue;
-		}
-
-		/* Call non-slab shrinkers even though kmem is disabled */
-		if (!memcg_kmem_online() &&
-		    !(shrinker->flags & SHRINKER_NONSLAB))
-			continue;
-
-		ret = do_shrink_slab(&sc, shrinker, priority);
-		if (ret == SHRINK_EMPTY) {
-			clear_bit(i, info->map);
-			/*
-			 * After the shrinker reported that it had no objects to
-			 * free, but before we cleared the corresponding bit in
-			 * the memcg shrinker map, a new object might have been
-			 * added. To make sure, we have the bit set in this
-			 * case, we invoke the shrinker one more time and reset
-			 * the bit if it reports that it is not empty anymore.
-			 * The memory barrier here pairs with the barrier in
-			 * set_shrinker_bit():
-			 *
-			 * list_lru_add()     shrink_slab_memcg()
-			 *   list_add_tail()    clear_bit()
-			 *   <MB>               <MB>
-			 *   set_bit()          do_shrink_slab()
-			 */
-			smp_mb__after_atomic();
-			ret = do_shrink_slab(&sc, shrinker, priority);
-			if (ret == SHRINK_EMPTY)
-				ret = 0;
-			else
-				set_shrinker_bit(memcg, nid, i);
-		}
-		freed += ret;
-
-		if (rwsem_is_contended(&shrinker_rwsem)) {
-			freed = freed ? : 1;
-			break;
-		}
-	}
-unlock:
-	up_read(&shrinker_rwsem);
-	return freed;
-}
-#else /* CONFIG_MEMCG */
-static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
-			struct mem_cgroup *memcg, int priority)
-{
-	return 0;
-}
-#endif /* CONFIG_MEMCG */
-
-/**
- * shrink_slab - shrink slab caches
- * @gfp_mask: allocation context
- * @nid: node whose slab caches to target
- * @memcg: memory cgroup whose slab caches to target
- * @priority: the reclaim priority
- *
- * Call the shrink functions to age shrinkable caches.
- *
- * @nid is passed along to shrinkers with SHRINKER_NUMA_AWARE set,
- * unaware shrinkers will receive a node id of 0 instead.
- *
- * @memcg specifies the memory cgroup to target. Unaware shrinkers
- * are called only if it is the root cgroup.
- *
- * @priority is sc->priority, we take the number of objects and >> by priority
- * in order to get the scan target.
- *
- * Returns the number of reclaimed slab objects.
- */
-static unsigned long shrink_slab(gfp_t gfp_mask, int nid,
-				 struct mem_cgroup *memcg,
-				 int priority)
-{
-	unsigned long ret, freed = 0;
-	struct shrinker *shrinker;
-
-	/*
-	 * The root memcg might be allocated even though memcg is disabled
-	 * via "cgroup_disable=memory" boot parameter.  This could make
-	 * mem_cgroup_is_root() return false, then just run memcg slab
-	 * shrink, but skip global shrink.  This may result in premature
-	 * oom.
-	 */
-	if (!mem_cgroup_disabled() && !mem_cgroup_is_root(memcg))
-		return shrink_slab_memcg(gfp_mask, nid, memcg, priority);
-
-	if (!down_read_trylock(&shrinker_rwsem))
-		goto out;
-
-	list_for_each_entry(shrinker, &shrinker_list, list) {
-		struct shrink_control sc = {
-			.gfp_mask = gfp_mask,
-			.nid = nid,
-			.memcg = memcg,
-		};
-
-		ret = do_shrink_slab(&sc, shrinker, priority);
-		if (ret == SHRINK_EMPTY)
-			ret = 0;
-		freed += ret;
-		/*
-		 * Bail out if someone want to register a new shrinker to
-		 * prevent the registration from being stalled for long periods
-		 * by parallel ongoing shrinking.
-		 */
-		if (rwsem_is_contended(&shrinker_rwsem)) {
-			freed = freed ? : 1;
-			break;
-		}
-	}
-
-	up_read(&shrinker_rwsem);
-out:
-	cond_resched();
-	return freed;
-}
-
 static unsigned long drop_slab_node(int nid)
 {
 	unsigned long freed = 0;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568548.887965 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCw-0000mi-2u; Mon, 24 Jul 2023 09:50:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568548.887965; Mon, 24 Jul 2023 09:50:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCv-0000kB-QH; Mon, 24 Jul 2023 09:50:25 +0000
Received: by outflank-mailman (input) for mailman id 568548;
 Mon, 24 Jul 2023 09:45:57 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNs8b-0007Fv-SO
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:45:57 +0000
Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com
 [2607:f8b0:4864:20::633])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e1e1fd9c-2a06-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:45:55 +0200 (CEST)
Received: by mail-pl1-x633.google.com with SMTP id
 d9443c01a7336-1b8c364ad3bso8855635ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:45:56 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.45.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:45:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e1e1fd9c-2a06-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690191955; x=1690796755;
        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=jmPwAlPL0TnDBmalzCzATtOPmfxfqu3Q+7XaFZclAtg=;
        b=IZCH5tV1VdvhB0RXcuG+SL+gg1mEbPZMQJz8qUY1fWCpYBfjAR72/AnWbcPpstjQLI
         aFpv+l8Q67Kc3iJwSzziW/zZbsYehvkdZbQbXx8X8jR6oJCUrIFV8Qzo50G/FYmT9t2/
         w6ZN7N+ZviCRVJxyy+bucuBxrS6SRhon2EIiX0i15H4OrDXIvK+dChrAy0pj6MjsuwdC
         6yiqEWuw0/0mdj0SNL2xTjIsK+WXPpE1gw9KgQ4WCUpGSoFe6rXH0GXBficEqbQlrShV
         wc7SdQklmSH69kiwU3dxFC6F0qOnJE6NuoEe6VBjJkE5shAIs2KVw9Ha+vCxjUcFWX2y
         lSHQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690191955; x=1690796755;
        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=jmPwAlPL0TnDBmalzCzATtOPmfxfqu3Q+7XaFZclAtg=;
        b=O4mLPDHWqAp2DSOBEiSyFKn/iLTNNeiMqfx7mPn9zvAa2KYOE4xkkhSOt9prHhAMp6
         qp5Wum9X8oDiYU2vMFSYDIXqj+OHXefwXYG0Aix7amEXFYSTULA48G1/MdXRa5bqDmS6
         eWXjOFl++aGtvW2pHi/OltzzZX1BgRJfORIyGr5N/5lOXFdALKBhfoKPrr4keBc5Nh3Y
         naDnRlPVyvIr4xQw3Ci1uivEr0kYL2z9JWc9/A5uMiNGiTwghBvuA+vbiBj62Yr1rTZW
         DaN5m76WQijfiXMczXQcuNTBUQvaNko1EPEhZFzt6ROt2J07jKswlMn0Y/mRJWIg7iyC
         8Z7Q==
X-Gm-Message-State: ABy/qLbNHIlC05wn4fkg31F8ao3VNF6q2wndO8tO2ehUEyySgFP0MkDt
	yNJbImPKOk3kG1yDOSfvM5nN8g==
X-Google-Smtp-Source: APBJJlHDY1qhgSa+H4mr70oj6h44PLP3QUTUzXb3MsGg4I77oDNLLFWrtOaIhBAmIAnOXFQDdEVBFw==
X-Received: by 2002:a17:902:d4cb:b0:1b1:9272:55e2 with SMTP id o11-20020a170902d4cb00b001b1927255e2mr12365119plg.3.1690191954835;
        Mon, 24 Jul 2023 02:45:54 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 04/47] kvm: mmu: dynamically allocate the x86-mmu shrinker
Date: Mon, 24 Jul 2023 17:43:11 +0800
Message-Id: <20230724094354.90817-5-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the x86-mmu shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 arch/x86/kvm/mmu/mmu.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index ec169f5c7dce..ab405e0a8954 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -6847,11 +6847,7 @@ static unsigned long mmu_shrink_count(struct shrinker *shrink,
 	return percpu_counter_read_positive(&kvm_total_used_mmu_pages);
 }
 
-static struct shrinker mmu_shrinker = {
-	.count_objects = mmu_shrink_count,
-	.scan_objects = mmu_shrink_scan,
-	.seeks = DEFAULT_SEEKS * 10,
-};
+static struct shrinker *mmu_shrinker;
 
 static void mmu_destroy_caches(void)
 {
@@ -6984,10 +6980,16 @@ int kvm_mmu_vendor_module_init(void)
 	if (percpu_counter_init(&kvm_total_used_mmu_pages, 0, GFP_KERNEL))
 		goto out;
 
-	ret = register_shrinker(&mmu_shrinker, "x86-mmu");
-	if (ret)
+	mmu_shrinker = shrinker_alloc(0, "x86-mmu");
+	if (!mmu_shrinker)
 		goto out_shrinker;
 
+	mmu_shrinker->count_objects = mmu_shrink_count;
+	mmu_shrinker->scan_objects = mmu_shrink_scan;
+	mmu_shrinker->seeks = DEFAULT_SEEKS * 10;
+
+	shrinker_register(mmu_shrinker);
+
 	return 0;
 
 out_shrinker:
@@ -7009,7 +7011,7 @@ void kvm_mmu_vendor_module_exit(void)
 {
 	mmu_destroy_caches();
 	percpu_counter_destroy(&kvm_total_used_mmu_pages);
-	unregister_shrinker(&mmu_shrinker);
+	shrinker_unregister(mmu_shrinker);
 }
 
 /*
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568540.887955 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCv-0000cT-GG; Mon, 24 Jul 2023 09:50:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568540.887955; Mon, 24 Jul 2023 09:50:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCv-0000b1-7e; Mon, 24 Jul 2023 09:50:25 +0000
Received: by outflank-mailman (input) for mailman id 568540;
 Mon, 24 Jul 2023 09:45:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNs8C-0007Dq-Q2
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:45:32 +0000
Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com
 [2607:f8b0:4864:20::42a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d43596c9-2a06-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:45:32 +0200 (CEST)
Received: by mail-pf1-x42a.google.com with SMTP id
 d2e1a72fcca58-682eef7d752so1027577b3a.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:45:32 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.45.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:45:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d43596c9-2a06-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690191931; x=1690796731;
        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=ewD/GNBDsb9emQZc+crYJJhL9Ok7DRtPygkZmojk224=;
        b=DyvUb16iFXGbECeKR4Jj5b9Aqu7GqNXEePNkHat23I7b1VL4ke9XL7AFF21PJI8D03
         dadzrjq6WC5mtymsIwcgysKxt2IeQhVQYSg0yzEciG/3J3jMvvonWrabgIjT5cyrH4U0
         K1NmdQ2LZEMZR3X0ctjhZi8pkjfdY6FiANez7gH72dxDBt7t+C7AalBczQoExmv/leVd
         sjx5yitsqqA/ZPm80lkfCIhjuAfvEuRwNIJ4RlVw9F2GYFjyskW1Ygf/DVx+iz0W5Dlm
         41zeCUlShQCZl1UPIlyRzbY5fG4LbR2jBKDZp6zvisQp1bayYn113SLSSif4m+cEaf+t
         mhLw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690191931; x=1690796731;
        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=ewD/GNBDsb9emQZc+crYJJhL9Ok7DRtPygkZmojk224=;
        b=XJfqMrUnL4Iu4K8ua3DuJYHwHHn1DDP8Ou/tm7G1cWn5a07f0ewRH5n7ayIER9McI1
         0K9OIxIDI5Gfm3xA8pfa+AWOYzzhSmHsJuZl6gCRK8Jjf+C+NE8rEtKCPD+OeBqDnOKb
         FGz1xmRzzefDcCqjwdUOwTMizi7g3VCDr9kPs1uP5WlPans4PYae0aEoILbYxhCRG0LR
         8C4cfIC4NLOJ3zOCpHt5NR7IGkvQ9AvZ1pdl06Zuu1SBUEC7+yr4zmqGHSCipdf2oyj5
         2xegjPW3RMGuVfTZtLAeL7EmT/KzQ8eWqvrCw1XCPEl4HdQIB2J13T9E0HdkvBFbAyFY
         RzKA==
X-Gm-Message-State: ABy/qLaIFfUT7b/trNAtaIGgXSCIhPp5nOyN1JffRC9EMgwP4QV+iuJn
	VoctrQEkvk1RZf8WxOloPh6X0Q==
X-Google-Smtp-Source: APBJJlF4hVHTEAcnrryQeIsWufK3e63a7rX2g1OMpnBMufUIHv2BcOagu97Dc7evIwstimu7xBX17w==
X-Received: by 2002:a17:902:e849:b0:1b8:35fa:cdcc with SMTP id t9-20020a170902e84900b001b835facdccmr12688015plg.5.1690191930816;
        Mon, 24 Jul 2023 02:45:30 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 02/47] mm: shrinker: remove redundant shrinker_rwsem in debugfs operations
Date: Mon, 24 Jul 2023 17:43:09 +0800
Message-Id: <20230724094354.90817-3-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The debugfs_remove_recursive() will wait for debugfs_file_put() to return,
so the shrinker will not be freed when doing debugfs operations (such as
shrinker_debugfs_count_show() and shrinker_debugfs_scan_write()), so there
is no need to hold shrinker_rwsem during debugfs operations.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 mm/shrinker_debug.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/mm/shrinker_debug.c b/mm/shrinker_debug.c
index 3ab53fad8876..f1becfd45853 100644
--- a/mm/shrinker_debug.c
+++ b/mm/shrinker_debug.c
@@ -55,11 +55,6 @@ static int shrinker_debugfs_count_show(struct seq_file *m, void *v)
 	if (!count_per_node)
 		return -ENOMEM;
 
-	ret = down_read_killable(&shrinker_rwsem);
-	if (ret) {
-		kfree(count_per_node);
-		return ret;
-	}
 	rcu_read_lock();
 
 	memcg_aware = shrinker->flags & SHRINKER_MEMCG_AWARE;
@@ -92,7 +87,6 @@ static int shrinker_debugfs_count_show(struct seq_file *m, void *v)
 	} while ((memcg = mem_cgroup_iter(NULL, memcg, NULL)) != NULL);
 
 	rcu_read_unlock();
-	up_read(&shrinker_rwsem);
 
 	kfree(count_per_node);
 	return ret;
@@ -117,7 +111,6 @@ static ssize_t shrinker_debugfs_scan_write(struct file *file,
 	struct mem_cgroup *memcg = NULL;
 	int nid;
 	char kbuf[72];
-	ssize_t ret;
 
 	read_len = size < (sizeof(kbuf) - 1) ? size : (sizeof(kbuf) - 1);
 	if (copy_from_user(kbuf, buf, read_len))
@@ -146,12 +139,6 @@ static ssize_t shrinker_debugfs_scan_write(struct file *file,
 		return -EINVAL;
 	}
 
-	ret = down_read_killable(&shrinker_rwsem);
-	if (ret) {
-		mem_cgroup_put(memcg);
-		return ret;
-	}
-
 	sc.nid = nid;
 	sc.memcg = memcg;
 	sc.nr_to_scan = nr_to_scan;
@@ -159,7 +146,6 @@ static ssize_t shrinker_debugfs_scan_write(struct file *file,
 
 	shrinker->scan_objects(shrinker, &sc);
 
-	up_read(&shrinker_rwsem);
 	mem_cgroup_put(memcg);
 
 	return size;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568533.887943 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCu-0000UD-PW; Mon, 24 Jul 2023 09:50:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568533.887943; Mon, 24 Jul 2023 09:50:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCu-0000U6-MJ; Mon, 24 Jul 2023 09:50:24 +0000
Received: by outflank-mailman (input) for mailman id 568533;
 Mon, 24 Jul 2023 09:45:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNs7p-0007Dq-UJ
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:45:10 +0000
Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com
 [2607:f8b0:4864:20::632])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c6052529-2a06-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:45:08 +0200 (CEST)
Received: by mail-pl1-x632.google.com with SMTP id
 d9443c01a7336-1bba9539a23so639175ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:45:08 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.44.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:45:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c6052529-2a06-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690191907; x=1690796707;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=GhsBT9Fumj8uBYrifNTbdeUWiupPg7k66ZIkdolEOus=;
        b=Mux1pbqzjbfqRXVfJEIWZc81mrnEot0PRQ/rTJrVGIim7ktrzSNm05Fsso5ilARRvv
         faySszbFYa9OO4CMI3npMpUlhKd9leJWtwrwrnGBgTFgyKPWAZhGDLwNVS7t8DhkjiqN
         RwEnjMy2GP0KMYlVucQ6x1a/u1Cr93p0iJndU/bpqFkEM97m8/txQF/6lkl5JDWlk8AU
         3iT7I2JCi3x9P2zSBpP/ZmfJYfqHGCek7eMXdifxANKuP/Fuf+mUHCVg2tSmefehawea
         n1OerRq0jnWZtgNyWPX2fjm4/jIjVqZyDgwY5w5AIUqAK7zCLOIJi1p74U5td8CU8Ec4
         mzxg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690191907; x=1690796707;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=GhsBT9Fumj8uBYrifNTbdeUWiupPg7k66ZIkdolEOus=;
        b=Y7PMSQUFh3UhN0nC6xT3FrN9XVohKZESVuOfnxP9xGdVBnGcPlZMNUcC7OsV8rhlp2
         rbZCWtqQDL4mrrr5X1Km2wX3Zjgp+BMjlQmTPHoxMiMzGMNcB5XW6wIap/QDO7tspR7w
         IqhLNsENqn6J09+goveG+cRnbTJ6wwhSiMjfwCtKGyTFNZSr0WOmPeiNffRLHmOlpJK4
         FT+4IPFn51nqVgPhYla/wpKaBYNL422ujLtS3MvkUdkrnq240siQ/moBCDu/CcKEm0Sd
         sCg5WCYoLVlmF4Jduj9SPyailH0FIIGaoBaMZTigSG6cA+cRSVarYCVLa06N6CXtjlLE
         UdNA==
X-Gm-Message-State: ABy/qLZR7u2RLEYS7wOZIMcPAgkWNr4Q20G5hJz97zrlvM6JYAKdWjGn
	MVYMnyl50OO+1vgIe6st+KqS3Q==
X-Google-Smtp-Source: APBJJlG2lKEMpVGWAV6dsRZ28hllsUFknqcdUwpJ+mz8ptX/BQjWY5s2WSDY0Jqf92PnyDAdPtn/0A==
X-Received: by 2002:a17:902:ea01:b0:1bb:83ec:832 with SMTP id s1-20020a170902ea0100b001bb83ec0832mr8326265plg.2.1690191906857;
        Mon, 24 Jul 2023 02:45:06 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 00/47] use refcount+RCU method to implement lockless slab shrink
Date: Mon, 24 Jul 2023 17:43:07 +0800
Message-Id: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Hi all,

1. Background
=============

We used to implement the lockless slab shrink with SRCU [1], but then kernel
test robot reported -88.8% regression in stress-ng.ramfs.ops_per_sec test
case [2], so we reverted it [3].

This patch series aims to re-implement the lockless slab shrink using the
refcount+RCU method proposed by Dave Chinner [4].

[1]. https://lore.kernel.org/lkml/20230313112819.38938-1-zhengqi.arch@bytedance.com/
[2]. https://lore.kernel.org/lkml/202305230837.db2c233f-yujie.liu@intel.com/
[3]. https://lore.kernel.org/all/20230609081518.3039120-1-qi.zheng@linux.dev/
[4]. https://lore.kernel.org/lkml/ZIJhou1d55d4H1s0@dread.disaster.area/

2. Implementation
=================

Currently, the shrinker instances can be divided into the following three types:

a) global shrinker instance statically defined in the kernel, such as
   workingset_shadow_shrinker.

b) global shrinker instance statically defined in the kernel modules, such as
   mmu_shrinker in x86.

c) shrinker instance embedded in other structures.

For case a, the memory of shrinker instance is never freed. For case b, the
memory of shrinker instance will be freed after synchronize_rcu() when the
module is unloaded. For case c, the memory of shrinker instance will be freed
along with the structure it is embedded in.

In preparation for implementing lockless slab shrink, we need to dynamically
allocate those shrinker instances in case c, then the memory can be dynamically
freed alone by calling kfree_rcu().

This patchset adds the following new APIs for dynamically allocating shrinker,
and add a private_data field to struct shrinker to record and get the original
embedded structure.

1. shrinker_alloc()
2. shrinker_free_non_registered()
3. shrinker_register()
4. shrinker_unregister()

In order to simplify shrinker-related APIs and make shrinker more independent of
other kernel mechanisms, this patchset uses the above APIs to convert all
shrinkers (including case a and b) to dynamically allocated, and then remove all
existing APIs. This will also have another advantage mentioned by Dave Chinner:

```
The other advantage of this is that it will break all the existing out of tree
code and third party modules using the old API and will no longer work with a
kernel using lockless slab shrinkers. They need to break (both at the source and
binary levels) to stop bad things from happening due to using uncoverted
shrinkers in the new setup.
```

Then we free the shrinker by calling kfree_rcu(), and use rcu_read_{lock,unlock}()
to ensure that the shrinker instance is valid. And the shrinker::refcount
mechanism ensures that the shrinker instance will not be run again after
unregistration. So the structure that records the pointer of shrinker instance
can be safely freed without waiting for the RCU read-side critical section.

In this way, while we implement the lockless slab shrink, we don't need to be
blocked in unregister_shrinker() to wait RCU read-side critical section.

PATCH 1: move shrinker-related code into a separate file
PATCH 2: remove redundant shrinker_rwsem in debugfs operations
PATCH 3: add infrastructure for dynamically allocating shrinker
PATCH 4 ~ 21: dynamically allocate the shrinker instances in case a and b
PATCH 22 ~ 40: dynamically allocate the shrinker instances in case c
PATCH 41: remove old APIs
PATCH 42: introduce pool_shrink_rwsem to implement private synchronize_shrinkers()
PATCH 43: add a secondary array for shrinker_info::{map, nr_deferred}
PATCH 44 ~ 45: implement the lockless slab shrink
PATCH 46 ~ 47: convert shrinker_rwsem to mutex

3. Testing
==========

3.1 slab shrink stress test
---------------------------

We can reproduce the down_read_trylock() hotspot through the following script:

```

DIR="/root/shrinker/memcg/mnt"

do_create()
{
    mkdir -p /sys/fs/cgroup/memory/test
    echo 4G > /sys/fs/cgroup/memory/test/memory.limit_in_bytes
    for i in `seq 0 $1`;
    do
        mkdir -p /sys/fs/cgroup/memory/test/$i;
        echo $$ > /sys/fs/cgroup/memory/test/$i/cgroup.procs;
        mkdir -p $DIR/$i;
    done
}

do_mount()
{
    for i in `seq $1 $2`;
    do
        mount -t tmpfs $i $DIR/$i;
    done
}

do_touch()
{
    for i in `seq $1 $2`;
    do
        echo $$ > /sys/fs/cgroup/memory/test/$i/cgroup.procs;
        dd if=/dev/zero of=$DIR/$i/file$i bs=1M count=1 &
    done
}

case "$1" in
  touch)
    do_touch $2 $3
    ;;
  test)
    do_create 4000
    do_mount 0 4000
    do_touch 0 3000
    ;;
  *)
    exit 1
    ;;
esac
```

Save the above script, then run test and touch commands. Then we can use the
following perf command to view hotspots:

perf top -U -F 999

1) Before applying this patchset:

  40.44%  [kernel]            [k] down_read_trylock
  17.59%  [kernel]            [k] up_read
  13.64%  [kernel]            [k] pv_native_safe_halt
  11.90%  [kernel]            [k] shrink_slab
   8.21%  [kernel]            [k] idr_find
   2.71%  [kernel]            [k] _find_next_bit
   1.36%  [kernel]            [k] shrink_node
   0.81%  [kernel]            [k] shrink_lruvec
   0.80%  [kernel]            [k] __radix_tree_lookup
   0.50%  [kernel]            [k] do_shrink_slab
   0.21%  [kernel]            [k] list_lru_count_one
   0.16%  [kernel]            [k] mem_cgroup_iter

2) After applying this patchset:

  60.17%  [kernel]           [k] shrink_slab
  20.42%  [kernel]           [k] pv_native_safe_halt
   3.03%  [kernel]           [k] do_shrink_slab
   2.73%  [kernel]           [k] shrink_node
   2.27%  [kernel]           [k] shrink_lruvec
   2.00%  [kernel]           [k] __rcu_read_unlock
   1.92%  [kernel]           [k] mem_cgroup_iter
   0.98%  [kernel]           [k] __rcu_read_lock
   0.91%  [kernel]           [k] osq_lock
   0.63%  [kernel]           [k] mem_cgroup_calculate_protection
   0.55%  [kernel]           [k] shrinker_put
   0.46%  [kernel]           [k] list_lru_count_one

We can see that the first perf hotspot becomes shrink_slab, which is what we
expect.

3.2 registeration and unregisteration stress test
-------------------------------------------------

Run the command below to test:

stress-ng --timeout 60 --times --verify --metrics-brief --ramfs 9 &

1) Before applying this patchset:

setting to a 60 second run per stressor
dispatching hogs: 9 ramfs
stressor       bogo ops real time  usr time  sys time   bogo ops/s     bogo ops/s
                          (secs)    (secs)    (secs)   (real time) (usr+sys time)
ramfs            735238     60.00     12.37    363.70     12253.05        1955.08
for a 60.01s run time:
   1440.27s available CPU time
     12.36s user time   (  0.86%)
    363.70s system time ( 25.25%)
    376.06s total time  ( 26.11%)
load average: 10.79 4.47 1.69
passed: 9: ramfs (9)
failed: 0
skipped: 0
successful run completed in 60.01s (1 min, 0.01 secs)

2) After applying this patchset:

setting to a 60 second run per stressor
dispatching hogs: 9 ramfs
stressor       bogo ops real time  usr time  sys time   bogo ops/s     bogo ops/s
                          (secs)    (secs)    (secs)   (real time) (usr+sys time)
ramfs            746677     60.00     12.22    367.75     12443.70        1965.13
for a 60.01s run time:
   1440.26s available CPU time
     12.21s user time   (  0.85%)
    367.75s system time ( 25.53%)
    379.96s total time  ( 26.38%)
load average: 8.37 2.48 0.86
passed: 9: ramfs (9)
failed: 0
skipped: 0
successful run completed in 60.01s (1 min, 0.01 secs)

We can see that the ops/s has hardly changed.

This series is based on next-20230711, and the [PATCH v2 05/49] depends on the
patch: https://lore.kernel.org/lkml/20230625154937.64316-1-qi.zheng@linux.dev/.

Comments and suggestions are welcome.

Thanks,
Qi

Changelog in v1 -> v2:
 - implement the new APIs and convert all shrinkers to use it.
   (suggested by Dave Chinner)
 - fix UAF in PATCH [05/29] (pointed by Steven Price)
 - add a secondary array for shrinker_info::{map, nr_deferred}
 - re-implement the lockless slab shrink
   (Since unifying the processing of global and memcg slab shrink needs to
    modify the startup sequence (As I mentioned in https://lore.kernel.org/lkml/38b14080-4ce5-d300-8a0a-c630bca6806b@bytedance.com/),
    I finally choose to process them separately.)
 - collect Acked-bys

Qi Zheng (47):
  mm: vmscan: move shrinker-related code into a separate file
  mm: shrinker: remove redundant shrinker_rwsem in debugfs operations
  mm: shrinker: add infrastructure for dynamically allocating shrinker
  kvm: mmu: dynamically allocate the x86-mmu shrinker
  binder: dynamically allocate the android-binder shrinker
  drm/ttm: dynamically allocate the drm-ttm_pool shrinker
  xenbus/backend: dynamically allocate the xen-backend shrinker
  erofs: dynamically allocate the erofs-shrinker
  f2fs: dynamically allocate the f2fs-shrinker
  gfs2: dynamically allocate the gfs2-glock shrinker
  gfs2: dynamically allocate the gfs2-qd shrinker
  NFSv4.2: dynamically allocate the nfs-xattr shrinkers
  nfs: dynamically allocate the nfs-acl shrinker
  nfsd: dynamically allocate the nfsd-filecache shrinker
  quota: dynamically allocate the dquota-cache shrinker
  ubifs: dynamically allocate the ubifs-slab shrinker
  rcu: dynamically allocate the rcu-lazy shrinker
  rcu: dynamically allocate the rcu-kfree shrinker
  mm: thp: dynamically allocate the thp-related shrinkers
  sunrpc: dynamically allocate the sunrpc_cred shrinker
  mm: workingset: dynamically allocate the mm-shadow shrinker
  drm/i915: dynamically allocate the i915_gem_mm shrinker
  drm/msm: dynamically allocate the drm-msm_gem shrinker
  drm/panfrost: dynamically allocate the drm-panfrost shrinker
  dm: dynamically allocate the dm-bufio shrinker
  dm zoned: dynamically allocate the dm-zoned-meta shrinker
  md/raid5: dynamically allocate the md-raid5 shrinker
  bcache: dynamically allocate the md-bcache shrinker
  vmw_balloon: dynamically allocate the vmw-balloon shrinker
  virtio_balloon: dynamically allocate the virtio-balloon shrinker
  mbcache: dynamically allocate the mbcache shrinker
  ext4: dynamically allocate the ext4-es shrinker
  jbd2,ext4: dynamically allocate the jbd2-journal shrinker
  nfsd: dynamically allocate the nfsd-client shrinker
  nfsd: dynamically allocate the nfsd-reply shrinker
  xfs: dynamically allocate the xfs-buf shrinker
  xfs: dynamically allocate the xfs-inodegc shrinker
  xfs: dynamically allocate the xfs-qm shrinker
  zsmalloc: dynamically allocate the mm-zspool shrinker
  fs: super: dynamically allocate the s_shrink
  mm: shrinker: remove old APIs
  drm/ttm: introduce pool_shrink_rwsem
  mm: shrinker: add a secondary array for shrinker_info::{map,
    nr_deferred}
  mm: shrinker: make global slab shrink lockless
  mm: shrinker: make memcg slab shrink lockless
  mm: shrinker: hold write lock to reparent shrinker nr_deferred
  mm: shrinker: convert shrinker_rwsem to mutex

 arch/x86/kvm/mmu/mmu.c                        |  18 +-
 drivers/android/binder_alloc.c                |  31 +-
 drivers/gpu/drm/i915/gem/i915_gem_shrinker.c  |  30 +-
 drivers/gpu/drm/i915/i915_drv.h               |   2 +-
 drivers/gpu/drm/msm/msm_drv.c                 |   4 +-
 drivers/gpu/drm/msm/msm_drv.h                 |   4 +-
 drivers/gpu/drm/msm/msm_gem_shrinker.c        |  36 +-
 drivers/gpu/drm/panfrost/panfrost_device.h    |   2 +-
 drivers/gpu/drm/panfrost/panfrost_drv.c       |   6 +-
 drivers/gpu/drm/panfrost/panfrost_gem.h       |   2 +-
 .../gpu/drm/panfrost/panfrost_gem_shrinker.c  |  32 +-
 drivers/gpu/drm/ttm/ttm_pool.c                |  38 +-
 drivers/md/bcache/bcache.h                    |   2 +-
 drivers/md/bcache/btree.c                     |  27 +-
 drivers/md/bcache/sysfs.c                     |   3 +-
 drivers/md/dm-bufio.c                         |  26 +-
 drivers/md/dm-cache-metadata.c                |   2 +-
 drivers/md/dm-zoned-metadata.c                |  28 +-
 drivers/md/raid5.c                            |  25 +-
 drivers/md/raid5.h                            |   2 +-
 drivers/misc/vmw_balloon.c                    |  38 +-
 drivers/virtio/virtio_balloon.c               |  25 +-
 drivers/xen/xenbus/xenbus_probe_backend.c     |  17 +-
 fs/btrfs/super.c                              |   2 +-
 fs/erofs/utils.c                              |  20 +-
 fs/ext4/ext4.h                                |   2 +-
 fs/ext4/extents_status.c                      |  22 +-
 fs/f2fs/super.c                               |  32 +-
 fs/gfs2/glock.c                               |  20 +-
 fs/gfs2/main.c                                |   6 +-
 fs/gfs2/quota.c                               |  26 +-
 fs/gfs2/quota.h                               |   3 +-
 fs/jbd2/journal.c                             |  27 +-
 fs/kernfs/mount.c                             |   2 +-
 fs/mbcache.c                                  |  23 +-
 fs/nfs/nfs42xattr.c                           |  87 +-
 fs/nfs/super.c                                |  20 +-
 fs/nfsd/filecache.c                           |  22 +-
 fs/nfsd/netns.h                               |   4 +-
 fs/nfsd/nfs4state.c                           |  20 +-
 fs/nfsd/nfscache.c                            |  31 +-
 fs/proc/root.c                                |   2 +-
 fs/quota/dquot.c                              |  17 +-
 fs/super.c                                    |  39 +-
 fs/ubifs/super.c                              |  22 +-
 fs/xfs/xfs_buf.c                              |  25 +-
 fs/xfs/xfs_buf.h                              |   2 +-
 fs/xfs/xfs_icache.c                           |  26 +-
 fs/xfs/xfs_mount.c                            |   4 +-
 fs/xfs/xfs_mount.h                            |   2 +-
 fs/xfs/xfs_qm.c                               |  26 +-
 fs/xfs/xfs_qm.h                               |   2 +-
 include/linux/fs.h                            |   2 +-
 include/linux/jbd2.h                          |   2 +-
 include/linux/memcontrol.h                    |  12 +-
 include/linux/shrinker.h                      |  54 +-
 kernel/rcu/tree.c                             |  21 +-
 kernel/rcu/tree_nocb.h                        |  19 +-
 mm/Makefile                                   |   4 +-
 mm/huge_memory.c                              |  69 +-
 mm/shrinker.c                                 | 772 ++++++++++++++++++
 mm/shrinker_debug.c                           |  76 +-
 mm/vmscan.c                                   | 701 ----------------
 mm/workingset.c                               |  26 +-
 mm/zsmalloc.c                                 |  28 +-
 net/sunrpc/auth.c                             |  19 +-
 66 files changed, 1516 insertions(+), 1225 deletions(-)
 create mode 100644 mm/shrinker.c

-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568550.887976 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCw-000139-QW; Mon, 24 Jul 2023 09:50:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568550.887976; Mon, 24 Jul 2023 09:50:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCw-0000yJ-BM; Mon, 24 Jul 2023 09:50:26 +0000
Received: by outflank-mailman (input) for mailman id 568550;
 Mon, 24 Jul 2023 09:46:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNs8n-0007J3-0e
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:46:09 +0000
Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com
 [2607:f8b0:4864:20::633])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e99bfe85-2a06-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:46:08 +0200 (CEST)
Received: by mail-pl1-x633.google.com with SMTP id
 d9443c01a7336-1b867f9198dso8894005ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:46:08 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.45.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:46:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e99bfe85-2a06-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690191967; x=1690796767;
        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=vu9DfqGDIkVtY7CS+mn/8y6VlhAfp+/Q2ofuaCWar5Q=;
        b=ZITiOrrWh+FheWM3chZFCAM8bc3YrsEgqzfm5Am/axy3dDhyTEHWaCIE6CxJlUheOx
         RF45EA9aOXE5By7kx/OP7STghpSD/KEB/oF3GrXK+Myxe/+Fwg6k+PP3FURA3cxLYMYy
         QPmEGcQxgz/g2uZ3I+YFETVsDVpSfeGJ/6AYCWm2OW7IkIAxCPa+wrGdNlr2psYdQiso
         l4rMdXxvPMn1WtqWv/dfO7wx6DqTx5ztQcgxaNLtyw9DkIVWCy3gu8FnfH++DQ/RAVD5
         IA2z6EzP9oeF3tWiBWkf5RokEJVb120E1SPLRv9Xx8rFVupecJKnGVj8I/3khxvVhjBZ
         QV2A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690191967; x=1690796767;
        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=vu9DfqGDIkVtY7CS+mn/8y6VlhAfp+/Q2ofuaCWar5Q=;
        b=dlrZVemPF7X91AjLxqP5BH7dRMRZyvJ7CaDGj7mcYCiwmNABjaZI4YyGCP3X7SPdoB
         RMa55Q46y9DBbDrYYtrTl2uUQ1nQE5bDbe537sShttea6cK8OhObhsCxz37GkVhTyvI2
         AieLyk0h6uVDTqWNoyeEUTu7aTxTsi1KWntQShssWoAV/3awR/g0vkjrKvq7dhHYEMyW
         Eq2g3cWaKuf+xJb5aJfsTrY1P52SQnjqMsTzBYUURZuAo+JAehLmlVNR0kk1dtmTCmos
         8RB7z9Yeqc7mibTujsSbGZaDnQ//bu/gsTzppKO/WJp40qFl8ulcOq8sIC5zbl98EPW1
         E2Rg==
X-Gm-Message-State: ABy/qLZak4WhWRkadqCxA0H7z/QxxFBxOFtOA3rfJwd0VGe4OzyoQ0Aq
	cwQbZcvy4EZfecsZxlusJ/VRHQ==
X-Google-Smtp-Source: APBJJlGrsdFKJ71ukJT79kDa1W+M4ztJszdSUa3mf2ArYfnWEb5YwD/wtpSbLXe4wEi7ibAUftTBwg==
X-Received: by 2002:a17:902:ecd2:b0:1b8:b4f6:1327 with SMTP id a18-20020a170902ecd200b001b8b4f61327mr12288935plh.6.1690191966684;
        Mon, 24 Jul 2023 02:46:06 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 05/47] binder: dynamically allocate the android-binder shrinker
Date: Mon, 24 Jul 2023 17:43:12 +0800
Message-Id: <20230724094354.90817-6-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the android-binder shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 drivers/android/binder_alloc.c | 31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
index e3db8297095a..019981d65e1e 100644
--- a/drivers/android/binder_alloc.c
+++ b/drivers/android/binder_alloc.c
@@ -1053,11 +1053,7 @@ binder_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
 			    NULL, sc->nr_to_scan);
 }
 
-static struct shrinker binder_shrinker = {
-	.count_objects = binder_shrink_count,
-	.scan_objects = binder_shrink_scan,
-	.seeks = DEFAULT_SEEKS,
-};
+static struct shrinker *binder_shrinker;
 
 /**
  * binder_alloc_init() - called by binder_open() for per-proc initialization
@@ -1077,19 +1073,30 @@ void binder_alloc_init(struct binder_alloc *alloc)
 
 int binder_alloc_shrinker_init(void)
 {
-	int ret = list_lru_init(&binder_alloc_lru);
+	int ret;
 
-	if (ret == 0) {
-		ret = register_shrinker(&binder_shrinker, "android-binder");
-		if (ret)
-			list_lru_destroy(&binder_alloc_lru);
+	ret = list_lru_init(&binder_alloc_lru);
+	if (ret)
+		return ret;
+
+	binder_shrinker = shrinker_alloc(0, "android-binder");
+	if (!binder_shrinker) {
+		list_lru_destroy(&binder_alloc_lru);
+		return -ENOMEM;
 	}
-	return ret;
+
+	binder_shrinker->count_objects = binder_shrink_count;
+	binder_shrinker->scan_objects = binder_shrink_scan;
+	binder_shrinker->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(binder_shrinker);
+
+	return 0;
 }
 
 void binder_alloc_shrinker_exit(void)
 {
-	unregister_shrinker(&binder_shrinker);
+	shrinker_unregister(binder_shrinker);
 	list_lru_destroy(&binder_alloc_lru);
 }
 
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568546.887957 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCv-0000hd-LA; Mon, 24 Jul 2023 09:50:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568546.887957; Mon, 24 Jul 2023 09:50:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCv-0000g2-G6; Mon, 24 Jul 2023 09:50:25 +0000
Received: by outflank-mailman (input) for mailman id 568546;
 Mon, 24 Jul 2023 09:45:46 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNs8Q-0007Fv-Qg
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:45:46 +0000
Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com
 [2607:f8b0:4864:20::62c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dac20c80-2a06-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:45:43 +0200 (CEST)
Received: by mail-pl1-x62c.google.com with SMTP id
 d9443c01a7336-1bb91c20602so2225655ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:45:44 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.45.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:45:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dac20c80-2a06-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690191943; x=1690796743;
        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=DaxJS65ntPERL7le+nmtmDDoPHIKL7Svp/IgETL6ZeE=;
        b=bsUNhBCXwNUzkDR0ZBYGRWY6QU8jf6SXW0GNGt2FOx6GMmf4JYDUwOhZCN0a9aNwPh
         pTka7+wy4J6SiQlycedqXCWLDNsWz3aJioSMhFKKX+Cimy7bU+oF7hjqxyvShR8A2yEG
         Bu7LESrzTJZCH9TPtc2I9FzALspZlYdCLyw0Gn9itfPl/wiIrNjf25JL50bsQdJ04tcL
         SlbyOamKluDXUz4pmzuKSCdYj+rqtmnfikA7iqukCNA9GBpbd9F7GXY8//WwnDt8lif7
         VBbsqb4LU2WF81b1loSTallposIksCkIrM7zY2O8grvdOy/OC2xy9l8uFRAuNMFBjkRJ
         /Eug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690191943; x=1690796743;
        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=DaxJS65ntPERL7le+nmtmDDoPHIKL7Svp/IgETL6ZeE=;
        b=HOCnM0isAOFcfz2NQVUzxdbq98NrF6M51j9etWxAu3PBLQxn26ALtgZOf4AeC6aQZv
         7LKzRRw1F9miJRTH3MDAhohkETtyprWKE1tHS2d4dH/YLSbujDGTESo15Bm2/H9YzWYj
         mTdo8kCbsnvK1KnIHORQNiUEQT6tRq0jEBlj77aXzQ+JfdVOZhtM6SvF/DoH7QXeOj5a
         DCo0hJm28OBL9Jbrf/6Dpxcc90zVRAF1Sc9hYAV01Cp82KfNLYdaQPSYstF0i3UXu9iW
         ukLM6ClDJ+zbXeASLNeRuS7ns57Ur6teSAAX3l9qSBTj4jgWZdCSL7NemWT/hCBaqyS3
         banA==
X-Gm-Message-State: ABy/qLYSoUyiLZiakFiIxhvoDcXSGDulKAodTX7akQqvodoV/w2wxus+
	Epu9aEKud1CiC2qx5t6FVwOs8g==
X-Google-Smtp-Source: APBJJlGWwe+Wn5SAE9CC225imGBvK3oJNP2MQHqUiC6fnoUxBGqj3ofPftHC2Yw9p8SUIC56L+2IOQ==
X-Received: by 2002:a17:903:2305:b0:1b8:b0c4:2e3d with SMTP id d5-20020a170903230500b001b8b0c42e3dmr12236473plh.4.1690191942806;
        Mon, 24 Jul 2023 02:45:42 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 03/47] mm: shrinker: add infrastructure for dynamically allocating shrinker
Date: Mon, 24 Jul 2023 17:43:10 +0800
Message-Id: <20230724094354.90817-4-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Currently, the shrinker instances can be divided into the following three
types:

a) global shrinker instance statically defined in the kernel, such as
   workingset_shadow_shrinker.

b) global shrinker instance statically defined in the kernel modules, such
   as mmu_shrinker in x86.

c) shrinker instance embedded in other structures.

For case a, the memory of shrinker instance is never freed. For case b,
the memory of shrinker instance will be freed after synchronize_rcu() when
the module is unloaded. For case c, the memory of shrinker instance will
be freed along with the structure it is embedded in.

In preparation for implementing lockless slab shrink, we need to
dynamically allocate those shrinker instances in case c, then the memory
can be dynamically freed alone by calling kfree_rcu().

So this commit adds the following new APIs for dynamically allocating
shrinker, and add a private_data field to struct shrinker to record and
get the original embedded structure.

1. shrinker_alloc()

Used to allocate shrinker instance itself and related memory, it will
return a pointer to the shrinker instance on success and NULL on failure.

2. shrinker_free_non_registered()

Used to destroy the non-registered shrinker instance.

3. shrinker_register()

Used to register the shrinker instance, which is same as the current
register_shrinker_prepared().

4. shrinker_unregister()

Used to unregister and free the shrinker instance.

In order to simplify shrinker-related APIs and make shrinker more
independent of other kernel mechanisms, subsequent submissions will use
the above API to convert all shrinkers (including case a and b) to
dynamically allocated, and then remove all existing APIs.

This will also have another advantage mentioned by Dave Chinner:

```
The other advantage of this is that it will break all the existing
out of tree code and third party modules using the old API and will
no longer work with a kernel using lockless slab shrinkers. They
need to break (both at the source and binary levels) to stop bad
things from happening due to using uncoverted shrinkers in the new
setup.
```

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 include/linux/shrinker.h |   6 +++
 mm/shrinker.c            | 113 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 119 insertions(+)

diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
index 961cb84e51f5..296f5e163861 100644
--- a/include/linux/shrinker.h
+++ b/include/linux/shrinker.h
@@ -70,6 +70,8 @@ struct shrinker {
 	int seeks;	/* seeks to recreate an obj */
 	unsigned flags;
 
+	void *private_data;
+
 	/* These are for internal use */
 	struct list_head list;
 #ifdef CONFIG_MEMCG
@@ -98,6 +100,10 @@ struct shrinker {
 
 unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
 			  int priority);
+struct shrinker *shrinker_alloc(unsigned int flags, const char *fmt, ...);
+void shrinker_free_non_registered(struct shrinker *shrinker);
+void shrinker_register(struct shrinker *shrinker);
+void shrinker_unregister(struct shrinker *shrinker);
 
 extern int __printf(2, 3) prealloc_shrinker(struct shrinker *shrinker,
 					    const char *fmt, ...);
diff --git a/mm/shrinker.c b/mm/shrinker.c
index 0a32ef42f2a7..d820e4cc5806 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -548,6 +548,119 @@ unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
 	return freed;
 }
 
+struct shrinker *shrinker_alloc(unsigned int flags, const char *fmt, ...)
+{
+	struct shrinker *shrinker;
+	unsigned int size;
+	va_list __maybe_unused ap;
+	int err;
+
+	shrinker = kzalloc(sizeof(struct shrinker), GFP_KERNEL);
+	if (!shrinker)
+		return NULL;
+
+#ifdef CONFIG_SHRINKER_DEBUG
+	va_start(ap, fmt);
+	shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
+	va_end(ap);
+	if (!shrinker->name)
+		goto err_name;
+#endif
+	shrinker->flags = flags;
+
+	if (flags & SHRINKER_MEMCG_AWARE) {
+		err = prealloc_memcg_shrinker(shrinker);
+		if (err == -ENOSYS)
+			shrinker->flags &= ~SHRINKER_MEMCG_AWARE;
+		else if (err == 0)
+			goto done;
+		else
+			goto err_flags;
+	}
+
+	/*
+	 * The nr_deferred is available on per memcg level for memcg aware
+	 * shrinkers, so only allocate nr_deferred in the following cases:
+	 *  - non memcg aware shrinkers
+	 *  - !CONFIG_MEMCG
+	 *  - memcg is disabled by kernel command line
+	 */
+	size = sizeof(*shrinker->nr_deferred);
+	if (flags & SHRINKER_NUMA_AWARE)
+		size *= nr_node_ids;
+
+	shrinker->nr_deferred = kzalloc(size, GFP_KERNEL);
+	if (!shrinker->nr_deferred)
+		goto err_flags;
+
+done:
+	return shrinker;
+
+err_flags:
+#ifdef CONFIG_SHRINKER_DEBUG
+	kfree_const(shrinker->name);
+	shrinker->name = NULL;
+err_name:
+#endif
+	kfree(shrinker);
+	return NULL;
+}
+EXPORT_SYMBOL(shrinker_alloc);
+
+void shrinker_free_non_registered(struct shrinker *shrinker)
+{
+#ifdef CONFIG_SHRINKER_DEBUG
+	kfree_const(shrinker->name);
+	shrinker->name = NULL;
+#endif
+	if (shrinker->flags & SHRINKER_MEMCG_AWARE) {
+		down_write(&shrinker_rwsem);
+		unregister_memcg_shrinker(shrinker);
+		up_write(&shrinker_rwsem);
+	}
+
+	kfree(shrinker->nr_deferred);
+	shrinker->nr_deferred = NULL;
+
+	kfree(shrinker);
+}
+EXPORT_SYMBOL(shrinker_free_non_registered);
+
+void shrinker_register(struct shrinker *shrinker)
+{
+	down_write(&shrinker_rwsem);
+	list_add_tail(&shrinker->list, &shrinker_list);
+	shrinker->flags |= SHRINKER_REGISTERED;
+	shrinker_debugfs_add(shrinker);
+	up_write(&shrinker_rwsem);
+}
+EXPORT_SYMBOL(shrinker_register);
+
+void shrinker_unregister(struct shrinker *shrinker)
+{
+	struct dentry *debugfs_entry;
+	int debugfs_id;
+
+	if (!shrinker || !(shrinker->flags & SHRINKER_REGISTERED))
+		return;
+
+	down_write(&shrinker_rwsem);
+	list_del(&shrinker->list);
+	shrinker->flags &= ~SHRINKER_REGISTERED;
+	if (shrinker->flags & SHRINKER_MEMCG_AWARE)
+		unregister_memcg_shrinker(shrinker);
+	debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);
+	up_write(&shrinker_rwsem);
+
+	shrinker_debugfs_remove(debugfs_entry, debugfs_id);
+
+	kfree(shrinker->nr_deferred);
+	shrinker->nr_deferred = NULL;
+
+	kfree(shrinker);
+}
+EXPORT_SYMBOL(shrinker_unregister);
+
 /*
  * Add a shrinker callback to be called from the vm.
  */
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568552.887983 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCx-0001AZ-Cy; Mon, 24 Jul 2023 09:50:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568552.887983; Mon, 24 Jul 2023 09:50:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCw-00016z-Q6; Mon, 24 Jul 2023 09:50:26 +0000
Received: by outflank-mailman (input) for mailman id 568552;
 Mon, 24 Jul 2023 09:46:21 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNs8z-0007Fv-NO
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:46:21 +0000
Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com
 [2607:f8b0:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f013a20f-2a06-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:46:19 +0200 (CEST)
Received: by mail-pl1-x62b.google.com with SMTP id
 d9443c01a7336-1bb85ed352bso2229915ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:46:20 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.46.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:46:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f013a20f-2a06-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690191978; x=1690796778;
        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=YJ34aDXYlHmjcWHNnO8BUtZL0Yf5ZszuCt3/FkcxObI=;
        b=dPg8Z+s3aha2IvphpVKs8g7PSY6piop3d9NgPI5ubIDitgffw9A2UJF008ettaOzL2
         E1tyNH7CPDs7txXWOfoA23V8TkeR2HnX04I7DoxtzP6sL4XEnTxiiEMAs0kV9Z/otM2W
         0kOcjwbHjS6iULnGuX+LKfjLBZnKtzDuWFv8l1d9/Rkqg83rJ36ocDx6bY7GsC2wtJpk
         Mw6apkZAnLMNttQVQifEE+ksvX6HBpvA7k/G1tddocZPzT2wZK5koTXpHocOk7zUb799
         2LPg0QZl2ME3q58o3tQeyyaY1BlYV7m8Ier04lnGoxRFxPK9Wx4EcovR5xvgXGZWDCe6
         9eCQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690191978; x=1690796778;
        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=YJ34aDXYlHmjcWHNnO8BUtZL0Yf5ZszuCt3/FkcxObI=;
        b=eo+JvcGxY7P/pgS9f34MYYZVZMMS0jouyHtOR87mhFIjkfKvJOyo7d4h7fHTEFEIel
         tNcTeJ/5jrnEfx/wUiXnYYqh6kDXisCZSDbjABF5WZ/K+7KjyvrEcfl25RbglqsWx0Jq
         9k68/0GhjLtfE0IFUz6Ak3GioQtSulVjUW2p9KbhywPApRjjyHYZ+44cTHBmZTM1y6k4
         lBYGp/Pv+nXddPrPt1x6Zjfrr/bTuAEab5euq6Dl19Z4oiThDZ+BLgcHDljo5NbBoYzt
         bzcZ4mWPYnL1ydkq8OlTTA87jYYkk0uFP6f8335emLBtLdVNrJ+67YcJhCCzGJGLXOwn
         1bCw==
X-Gm-Message-State: ABy/qLbacej6D/BDA/NNsmH7q2TSgIvjdYQBD1D3Krna9QubtyRXBJUO
	xSposC3rYB9JcnClDScwovBTWw==
X-Google-Smtp-Source: APBJJlGS+SYk55mAAJOUNGx8fxUIn0OJAQvX8pDu/8/ugt1o28j6t6h3zVeppHUSF07Rw5MgS0vxBA==
X-Received: by 2002:a17:902:d484:b0:1b8:a27d:f591 with SMTP id c4-20020a170902d48400b001b8a27df591mr12255719plg.5.1690191978640;
        Mon, 24 Jul 2023 02:46:18 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 06/47] drm/ttm: dynamically allocate the drm-ttm_pool shrinker
Date: Mon, 24 Jul 2023 17:43:13 +0800
Message-Id: <20230724094354.90817-7-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the drm-ttm_pool shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 drivers/gpu/drm/ttm/ttm_pool.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
index cddb9151d20f..e1eb73d0b72a 100644
--- a/drivers/gpu/drm/ttm/ttm_pool.c
+++ b/drivers/gpu/drm/ttm/ttm_pool.c
@@ -73,7 +73,7 @@ static struct ttm_pool_type global_dma32_uncached[MAX_ORDER + 1];
 
 static spinlock_t shrinker_lock;
 static struct list_head shrinker_list;
-static struct shrinker mm_shrinker;
+static struct shrinker *mm_shrinker;
 
 /* Allocate pages of size 1 << order with the given gfp_flags */
 static struct page *ttm_pool_alloc_page(struct ttm_pool *pool, gfp_t gfp_flags,
@@ -734,8 +734,8 @@ static int ttm_pool_debugfs_shrink_show(struct seq_file *m, void *data)
 	struct shrink_control sc = { .gfp_mask = GFP_NOFS };
 
 	fs_reclaim_acquire(GFP_KERNEL);
-	seq_printf(m, "%lu/%lu\n", ttm_pool_shrinker_count(&mm_shrinker, &sc),
-		   ttm_pool_shrinker_scan(&mm_shrinker, &sc));
+	seq_printf(m, "%lu/%lu\n", ttm_pool_shrinker_count(mm_shrinker, &sc),
+		   ttm_pool_shrinker_scan(mm_shrinker, &sc));
 	fs_reclaim_release(GFP_KERNEL);
 
 	return 0;
@@ -779,10 +779,17 @@ int ttm_pool_mgr_init(unsigned long num_pages)
 			    &ttm_pool_debugfs_shrink_fops);
 #endif
 
-	mm_shrinker.count_objects = ttm_pool_shrinker_count;
-	mm_shrinker.scan_objects = ttm_pool_shrinker_scan;
-	mm_shrinker.seeks = 1;
-	return register_shrinker(&mm_shrinker, "drm-ttm_pool");
+	mm_shrinker = shrinker_alloc(0, "drm-ttm_pool");
+	if (!mm_shrinker)
+		return -ENOMEM;
+
+	mm_shrinker->count_objects = ttm_pool_shrinker_count;
+	mm_shrinker->scan_objects = ttm_pool_shrinker_scan;
+	mm_shrinker->seeks = 1;
+
+	shrinker_register(mm_shrinker);
+
+	return 0;
 }
 
 /**
@@ -802,6 +809,6 @@ void ttm_pool_mgr_fini(void)
 		ttm_pool_type_fini(&global_dma32_uncached[i]);
 	}
 
-	unregister_shrinker(&mm_shrinker);
+	shrinker_unregister(mm_shrinker);
 	WARN_ON(!list_empty(&shrinker_list));
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568554.887990 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCx-0001LP-Qg; Mon, 24 Jul 2023 09:50:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568554.887990; Mon, 24 Jul 2023 09:50:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCx-0001GS-D0; Mon, 24 Jul 2023 09:50:27 +0000
Received: by outflank-mailman (input) for mailman id 568554;
 Mon, 24 Jul 2023 09:46:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNs9A-0007J3-Ed
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:46:32 +0000
Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com
 [2607:f8b0:4864:20::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f7cbaacd-2a06-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:46:31 +0200 (CEST)
Received: by mail-pl1-x62b.google.com with SMTP id
 d9443c01a7336-1b8c364ad3bso8856795ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:46:31 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.46.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:46:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f7cbaacd-2a06-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690191990; x=1690796790;
        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=TtWMuwNQICElQwN/uI+F3WL3CTikAs+Dtp5goHq/uX4=;
        b=I+UdRoo7PtFa/HFb9ptM84BLJk51Oz8G0P2vA9d94Wc/XjfftjzLyxRBwA01anb/sX
         9mresCrzzrrBEvcw02T2JRUzwmE2N5g0vsbRd5C+EoXN25pNGYeZ6g16/FMxa3H5VNDH
         6ji0rzPXwUbXzJbwXvPiq1FHNNE8ocU8HPGADHiXDhNHZabYES9ASLXofIUnLzuIXCW+
         kwLOx4qHBhz6RtbAZxDD88fTSzK7LENJJOn1r+bRhOQmNpcKYfm1Yk1Egb7OAZu9liNf
         8Q2C/an05GdrxKmh9WrMTyMLOPzFeZw3WZtFR0oz9alHcEF4Djwn7mAV20C2gc5TCLWm
         V2MQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690191990; x=1690796790;
        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=TtWMuwNQICElQwN/uI+F3WL3CTikAs+Dtp5goHq/uX4=;
        b=WMErMJqSu0Vsgkg7nZMEEsWfHW++BxYRufFEvpqGVE/lU7V5HqHD2X22NleSbEo8te
         Ox9TBNsqcq0Umx53Btsjvkf0K6/auppT3x+6CscVM2d8KbfCGeTJZMMPk0r4ZMegstQv
         CKhpLmKzJp1u0PXSk003s6J1tPtsZKHbnMYyurJuPF1fGMm0p1o9bQjZyk/v6TYVy+JL
         TwAfyZEdlwbcoRjmuxqsRjUPAov0x1QqGK5frpyUBJwez3wdK1K2AOn3T891tOR4OHcj
         PTt1RZiPTs8ccDtUllCqAWHrYOUhUW1Ps8wNFUpZH1wSFakuV0pYEAZT+iU1HQThtCy+
         QCtA==
X-Gm-Message-State: ABy/qLYSI2cVbQF3P9m6G5cNC0U0hkE1dfwHYIK7rRGxpHk+/lVd/Zft
	N6+49Ui8m8SVNmFG1/t0VbL9dg==
X-Google-Smtp-Source: APBJJlE4z/oQr/nYJvsLLx4ZH1UH5CYL5idBHg9QqjGajgFE/t5dphI4tPFsRKn6N/RjSu5tdTiopA==
X-Received: by 2002:a17:902:ecd2:b0:1b8:b4f6:1327 with SMTP id a18-20020a170902ecd200b001b8b4f61327mr12289687plh.6.1690191990533;
        Mon, 24 Jul 2023 02:46:30 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 07/47] xenbus/backend: dynamically allocate the xen-backend shrinker
Date: Mon, 24 Jul 2023 17:43:14 +0800
Message-Id: <20230724094354.90817-8-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the xen-backend shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 drivers/xen/xenbus/xenbus_probe_backend.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/xen/xenbus/xenbus_probe_backend.c b/drivers/xen/xenbus/xenbus_probe_backend.c
index da96c260e26b..b4c3cf27af30 100644
--- a/drivers/xen/xenbus/xenbus_probe_backend.c
+++ b/drivers/xen/xenbus/xenbus_probe_backend.c
@@ -284,10 +284,7 @@ static unsigned long backend_shrink_memory_count(struct shrinker *shrinker,
 	return 0;
 }
 
-static struct shrinker backend_memory_shrinker = {
-	.count_objects = backend_shrink_memory_count,
-	.seeks = DEFAULT_SEEKS,
-};
+static struct shrinker *backend_memory_shrinker;
 
 static int __init xenbus_probe_backend_init(void)
 {
@@ -305,8 +302,16 @@ static int __init xenbus_probe_backend_init(void)
 
 	register_xenstore_notifier(&xenstore_notifier);
 
-	if (register_shrinker(&backend_memory_shrinker, "xen-backend"))
-		pr_warn("shrinker registration failed\n");
+	backend_memory_shrinker = shrinker_alloc(0, "xen-backend");
+	if (!backend_memory_shrinker) {
+		pr_warn("shrinker allocation failed\n");
+		return 0;
+	}
+
+	backend_memory_shrinker->count_objects = backend_shrink_memory_count;
+	backend_memory_shrinker->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(backend_memory_shrinker);
 
 	return 0;
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568557.887997 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCy-0001am-JB; Mon, 24 Jul 2023 09:50:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568557.887997; Mon, 24 Jul 2023 09:50:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCy-0001Vj-40; Mon, 24 Jul 2023 09:50:28 +0000
Received: by outflank-mailman (input) for mailman id 568557;
 Mon, 24 Jul 2023 09:46:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNs9M-0007J3-Nc
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:46:44 +0000
Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com
 [2607:f8b0:4864:20::634])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fedfe2eb-2a06-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:46:44 +0200 (CEST)
Received: by mail-pl1-x634.google.com with SMTP id
 d9443c01a7336-1bba9539a23so640915ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:46:44 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.46.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:46:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fedfe2eb-2a06-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192002; x=1690796802;
        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=4zTxasxXedNYwr5HiD+ktCpinG7wwpmHx5iR9IBn5EM=;
        b=JQ+VYszNneWq9LnVTeEUNZ2bA9JmZI8LOFjK9svc9H4hl8hRyG271LpHarvUCKIyZI
         5Vn1CBHP/6AH5rHqtPGE6/hWSk0SIy6RYK161aZhDGhYtCkOSsB2o0ayijs8INBvePS+
         ybYmPnwAbLpRLtFyM0o4EOx/Hrne48NbEWwKs3diUJ/coEGr8/xoETACnBW25DeyyWC2
         ybnkMyVu7T3nx0cFgEz9x8FtixitWLVj99q7wd/aAYhgB/uAk5tIASLlagkcZ5eA/CFb
         vVvRndH0r/gASWIjyvLt8jh52cZF67TvvoceATQn3UiM+oNvT8rjkWmY1oM8XcntVr02
         2LrQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192002; x=1690796802;
        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=4zTxasxXedNYwr5HiD+ktCpinG7wwpmHx5iR9IBn5EM=;
        b=K9WBMbY3Pvf4fNDQWNCnOPU1h+sCWqDsu8k3wwHr4d3bmD2VUUAExtgFLG0TDYu56s
         n3qi1uLZn0SRM80o7JNjh/eUe3iOrPgr73DQPwtgzmVAFpteMN5x80u7sK9+S6Z1szk1
         3lh0HhO3iaC2oYOZsKA01VOBFzVn/7DznwV4qncaUJGtn1hsO6YFPNmdWk8g36LT6K36
         VTpxRNsahIib6OdySBbKiAijTMMsl6OMB9i8GDdtWhvNa2+quUW46nXVJucVQMeCMGCU
         bmT3fogxPuBr6+iWrnxv0p6tboU0wcFQ0LprmObCODog7rQsPaZwdBMbiej5G/prS2cE
         v4dQ==
X-Gm-Message-State: ABy/qLZQ0DgkPebBTOeQW39s5hY7EYoGPQTHAd6O8Ge5CfKJRnBCZgEE
	zwI3bZZwcK5cs+uxmMDJHXnoww==
X-Google-Smtp-Source: APBJJlEIhnQwoFDHuweIAHt2tJcWGI0d+r3I5wbhweuAT0TQly4d+VEILSYdnjVlMqhcbUSPWrZO+w==
X-Received: by 2002:a17:903:41c9:b0:1b8:17e8:547e with SMTP id u9-20020a17090341c900b001b817e8547emr12196517ple.1.1690192002389;
        Mon, 24 Jul 2023 02:46:42 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 08/47] erofs: dynamically allocate the erofs-shrinker
Date: Mon, 24 Jul 2023 17:43:15 +0800
Message-Id: <20230724094354.90817-9-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the erofs-shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/erofs/utils.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/fs/erofs/utils.c b/fs/erofs/utils.c
index cc6fb9e98899..389de06e1065 100644
--- a/fs/erofs/utils.c
+++ b/fs/erofs/utils.c
@@ -270,19 +270,25 @@ static unsigned long erofs_shrink_scan(struct shrinker *shrink,
 	return freed;
 }
 
-static struct shrinker erofs_shrinker_info = {
-	.scan_objects = erofs_shrink_scan,
-	.count_objects = erofs_shrink_count,
-	.seeks = DEFAULT_SEEKS,
-};
+static struct shrinker *erofs_shrinker_info;
 
 int __init erofs_init_shrinker(void)
 {
-	return register_shrinker(&erofs_shrinker_info, "erofs-shrinker");
+	erofs_shrinker_info = shrinker_alloc(0, "erofs-shrinker");
+	if (!erofs_shrinker_info)
+		return -ENOMEM;
+
+	erofs_shrinker_info->count_objects = erofs_shrink_count;
+	erofs_shrinker_info->scan_objects = erofs_shrink_scan;
+	erofs_shrinker_info->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(erofs_shrinker_info);
+
+	return 0;
 }
 
 void erofs_exit_shrinker(void)
 {
-	unregister_shrinker(&erofs_shrinker_info);
+	shrinker_unregister(erofs_shrinker_info);
 }
 #endif	/* !CONFIG_EROFS_FS_ZIP */
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568559.888009 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCz-0001kK-Eq; Mon, 24 Jul 2023 09:50:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568559.888009; Mon, 24 Jul 2023 09:50:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCy-0001gL-Lh; Mon, 24 Jul 2023 09:50:28 +0000
Received: by outflank-mailman (input) for mailman id 568559;
 Mon, 24 Jul 2023 09:46: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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNs9a-0007Fv-5a
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:46:58 +0000
Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com
 [2607:f8b0:4864:20::62c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 05cfbcb0-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:46:55 +0200 (CEST)
Received: by mail-pl1-x62c.google.com with SMTP id
 d9443c01a7336-1b8c364ad3bso8857575ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:46:56 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.46.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:46:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 05cfbcb0-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192015; x=1690796815;
        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=hKcV3vb4MClJJQ+mNTta07ndMYtKKP0SAkTwCVeOX0w=;
        b=a7lFhyKpvN91nijv1nVs3JeaaLMDFPSuaWY4NCEQD9DCJQdlhcmwFlvKgxp6H5QA07
         3dkX4W4M1txISO3DSWoCDCRM1ysYCDf7oPJVOFGCIfe+DlrmZLhiur4I07AdWC0aW3Dw
         CVnibojO6zdjwPP037s+ZGzHTbYwQp1TRk5IbZ0gf2icMTq1nF1E5wJ/BtOX4xZvFUp0
         NkBwNV73kgVtBd1NdtpFu3djSHL7HyBXhuBz5mRGNaBtssuegwQh/61PWGRXQCMhsibP
         +eC6XYGvARqk02NWbIzA2EZWiSinAW1FFs+vgwRWCCseEycqYRnDfiCLO/I65f90R1Q3
         zmCg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192015; x=1690796815;
        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=hKcV3vb4MClJJQ+mNTta07ndMYtKKP0SAkTwCVeOX0w=;
        b=EJvCMuPG0W+T5wZhLur0YQXPqKHJ4JxnwhtCauC2a0IZjdRC80Qt3sHJoBlCdjR+jS
         ARvOYs19dGneCzQiTR7iIe3hMuPr8PdiV9GDiyrXTtvjYPd8FEoMYDpwxzg8Yc0lIwYy
         d0/lJfV19N+Kz7w76DgRJhghGpIEb97Vwgcm9SyOy7D4FHs0r/pnyJoAnNCxyYODELb6
         jsSjwenb3tkpX/X4J5JCzWDDKTYlq6Z7IiUK/R/mzAmoFp5CowSL8cnwWjkkrsnhzYha
         Hty5qyvwm+ex1Du7n0Lp/w8XV/Wx10qDcsXF6K/l862IPWVNrECTih6qQzFp7n0YjPBY
         tANg==
X-Gm-Message-State: ABy/qLYVkssQos8Xd18FGrHfloJRvz4tpGM3wfAlAkNiQlt5VhkU9mf2
	Pfzfszxnt1Hw0WfyEXnl5nhuXQ==
X-Google-Smtp-Source: APBJJlFJGAUudAfwbE4FzEeIId9jY33sdTrNWRyhFQwrzl0Tx9fNVh9CNxBzY73cH6rP3yfMJCnueA==
X-Received: by 2002:a17:902:dace:b0:1b8:811:b079 with SMTP id q14-20020a170902dace00b001b80811b079mr12305026plx.0.1690192015077;
        Mon, 24 Jul 2023 02:46:55 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 09/47] f2fs: dynamically allocate the f2fs-shrinker
Date: Mon, 24 Jul 2023 17:43:16 +0800
Message-Id: <20230724094354.90817-10-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the f2fs-shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/f2fs/super.c | 32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index ca31163da00a..8b08473db358 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -83,11 +83,27 @@ void f2fs_build_fault_attr(struct f2fs_sb_info *sbi, unsigned int rate,
 #endif
 
 /* f2fs-wide shrinker description */
-static struct shrinker f2fs_shrinker_info = {
-	.scan_objects = f2fs_shrink_scan,
-	.count_objects = f2fs_shrink_count,
-	.seeks = DEFAULT_SEEKS,
-};
+static struct shrinker *f2fs_shrinker_info;
+
+static int f2fs_init_shrinker(void)
+{
+	f2fs_shrinker_info = shrinker_alloc(0, "f2fs-shrinker");
+	if (!f2fs_shrinker_info)
+		return -ENOMEM;
+
+	f2fs_shrinker_info->count_objects = f2fs_shrink_count;
+	f2fs_shrinker_info->scan_objects = f2fs_shrink_scan;
+	f2fs_shrinker_info->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(f2fs_shrinker_info);
+
+	return 0;
+}
+
+static void f2fs_exit_shrinker(void)
+{
+	shrinker_unregister(f2fs_shrinker_info);
+}
 
 enum {
 	Opt_gc_background,
@@ -4941,7 +4957,7 @@ static int __init init_f2fs_fs(void)
 	err = f2fs_init_sysfs();
 	if (err)
 		goto free_garbage_collection_cache;
-	err = register_shrinker(&f2fs_shrinker_info, "f2fs-shrinker");
+	err = f2fs_init_shrinker();
 	if (err)
 		goto free_sysfs;
 	err = register_filesystem(&f2fs_fs_type);
@@ -4986,7 +5002,7 @@ static int __init init_f2fs_fs(void)
 	f2fs_destroy_root_stats();
 	unregister_filesystem(&f2fs_fs_type);
 free_shrinker:
-	unregister_shrinker(&f2fs_shrinker_info);
+	f2fs_exit_shrinker();
 free_sysfs:
 	f2fs_exit_sysfs();
 free_garbage_collection_cache:
@@ -5018,7 +5034,7 @@ static void __exit exit_f2fs_fs(void)
 	f2fs_destroy_post_read_processing();
 	f2fs_destroy_root_stats();
 	unregister_filesystem(&f2fs_fs_type);
-	unregister_shrinker(&f2fs_shrinker_info);
+	f2fs_exit_shrinker();
 	f2fs_exit_sysfs();
 	f2fs_destroy_garbage_collection_cache();
 	f2fs_destroy_extent_cache();
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568561.888018 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsD0-00021h-5N; Mon, 24 Jul 2023 09:50:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568561.888018; Mon, 24 Jul 2023 09:50:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsCz-0001wL-JL; Mon, 24 Jul 2023 09:50:29 +0000
Received: by outflank-mailman (input) for mailman id 568561;
 Mon, 24 Jul 2023 09:47:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNs9k-0007J3-RD
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:47:08 +0000
Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com
 [2607:f8b0:4864:20::631])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0d7d829c-2a07-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:47:08 +0200 (CEST)
Received: by mail-pl1-x631.google.com with SMTP id
 d9443c01a7336-1bba9539a23so641525ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:47:08 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.46.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:47:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0d7d829c-2a07-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192027; x=1690796827;
        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=cYIc2pFR4p2fEyppjqJhI12Ags43zx4+1Vguh7yPn/A=;
        b=Mkbkj7G5CQEOG8iOHz5MrSjilpa0Roglbh/CftNIU9Jg3xNX1k/Xj43vnR/S/54ttk
         C3FfMc3SnotTmowd/+id3GM38yUMYBJBhTZIBUulrrZgzYrxT+SQHGW3axYXz1Mzi2fV
         AsX/jIuEEGTsEz+JOjVZRdbKq3nZcbngqtBBtuQhz8//b37rxmcNc4kjft3yYQbvP1Zj
         84eZDPKog/+vrWIKUYa0yatWxoPJwzUv5rccQj+Dyx2lWBxO8FM5qLWfEajMcNN5ZG2/
         nBaypiLs1PufNQuHjnIpPNYd5QiB7rev3NHLgSVLNHqyhO1fbeGyfmflk+kru7Y0DPcw
         GDkA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192027; x=1690796827;
        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=cYIc2pFR4p2fEyppjqJhI12Ags43zx4+1Vguh7yPn/A=;
        b=Kews2YwleadbTXfM2EQc8hPZiNk5yO/kwQeGzJwByRPeOeUbvWDSrpv+x1XkhB0fY0
         1kgUxdK7zYRbq7Gde0+5lV9XSgpeP3B4DYxAXpzWJ+bgPxpQcvCkqV9HCfBcVIU3LM6s
         5j4lQGx0tIR4vokQWXBNdf6WnB0ZA0f9LnerqRZB5WM/WjnVfFMa4XUrM1ll9V71O2D5
         /F6GAhLh7My2XiSYpaL4AM4NEb6EEpVozgGW3XB++LlLs8kj3WnpE8yxWaE6BoCBap75
         BF92WcnWQF6C6BNyjybDt5UFnoiFHPtJ/Z5UV5M6RH2IEfNc3Z0MHRJg/+kCJM8iuCJv
         5u2g==
X-Gm-Message-State: ABy/qLZwfGcH4eLVxJNyLUT4YrJsef0/EgizS62e8WW/Y18gCtd1Jsfr
	UKrV9OJSqWgXhYEkueNaIr5r0A==
X-Google-Smtp-Source: APBJJlE71N8j7jMrL1FzeS7v4yJrry2TgN0JWUZm9wk55uK2Ve/eQ/bXmY0X5mXvJcfiEdGHzkgvbw==
X-Received: by 2002:a17:902:ec8b:b0:1b3:d8ac:8db3 with SMTP id x11-20020a170902ec8b00b001b3d8ac8db3mr12337602plg.6.1690192026938;
        Mon, 24 Jul 2023 02:47:06 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 10/47] gfs2: dynamically allocate the gfs2-glock shrinker
Date: Mon, 24 Jul 2023 17:43:17 +0800
Message-Id: <20230724094354.90817-11-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the gfs2-glock shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/gfs2/glock.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 1438e7465e30..77da354667d9 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -2046,11 +2046,7 @@ static unsigned long gfs2_glock_shrink_count(struct shrinker *shrink,
 	return vfs_pressure_ratio(atomic_read(&lru_count));
 }
 
-static struct shrinker glock_shrinker = {
-	.seeks = DEFAULT_SEEKS,
-	.count_objects = gfs2_glock_shrink_count,
-	.scan_objects = gfs2_glock_shrink_scan,
-};
+static struct shrinker *glock_shrinker;
 
 /**
  * glock_hash_walk - Call a function for glock in a hash bucket
@@ -2472,13 +2468,19 @@ int __init gfs2_glock_init(void)
 		return -ENOMEM;
 	}
 
-	ret = register_shrinker(&glock_shrinker, "gfs2-glock");
-	if (ret) {
+	glock_shrinker = shrinker_alloc(0, "gfs2-glock");
+	if (!glock_shrinker) {
 		destroy_workqueue(glock_workqueue);
 		rhashtable_destroy(&gl_hash_table);
-		return ret;
+		return -ENOMEM;
 	}
 
+	glock_shrinker->count_objects = gfs2_glock_shrink_count;
+	glock_shrinker->scan_objects = gfs2_glock_shrink_scan;
+	glock_shrinker->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(glock_shrinker);
+
 	for (i = 0; i < GLOCK_WAIT_TABLE_SIZE; i++)
 		init_waitqueue_head(glock_wait_table + i);
 
@@ -2487,7 +2489,7 @@ int __init gfs2_glock_init(void)
 
 void gfs2_glock_exit(void)
 {
-	unregister_shrinker(&glock_shrinker);
+	shrinker_unregister(glock_shrinker);
 	rhashtable_destroy(&gl_hash_table);
 	destroy_workqueue(glock_workqueue);
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568563.888028 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsD1-0002Lj-2P; Mon, 24 Jul 2023 09:50:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568563.888028; Mon, 24 Jul 2023 09:50:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsD0-0002G1-Eu; Mon, 24 Jul 2023 09:50:30 +0000
Received: by outflank-mailman (input) for mailman id 568563;
 Mon, 24 Jul 2023 09:47:21 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNs9x-0007Fv-SQ
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:47:21 +0000
Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com
 [2607:f8b0:4864:20::62c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 13eb7647-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:47:19 +0200 (CEST)
Received: by mail-pl1-x62c.google.com with SMTP id
 d9443c01a7336-1bb85ed352bso2233275ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:47:20 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.47.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:47:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 13eb7647-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192039; x=1690796839;
        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=UBNhxmwoWFukUMFCa6L5K1ksS1zA9QvfN1MSwW+LOvg=;
        b=PYcbzrtYJQj413Q0/SwymVhgK8hPc8ex6XZDsNX+o4IV2cADzaV/i2ya7gUKq/uTsu
         wsioX/oC9g6+AR05yLYLolp75BAxO+vtAgmvegSP/6oS7xyFJbaLjDx8bzKHReC/LdPy
         ZD0p0zqCSm4I20GpIy4a7cDW1rypHC1YzlPKbmR7fKpS+iPZ3nobfzQ/pyKjlQMwP8jK
         Nmzke41P9dSVS9eDDUNJUwzSb8mk0vo1CuJyAAX+qbcUvC6mBpCbrcmY6qwTVXPENs8X
         jAMFBNAsAWQ6gQ7fzECuFMhzmmAgzRWBECByoqxf+ey+4diWRhb6HmTmtKgQ50al6pO0
         t6+A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192039; x=1690796839;
        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=UBNhxmwoWFukUMFCa6L5K1ksS1zA9QvfN1MSwW+LOvg=;
        b=GrHCytOfS90R+2cSQF+bGzvCQs2tuClgI3UqEKnlY2Du75NSRJ8BouhOR9/ar9yuhy
         v6QadTOTNmhEQFA5fUTl678BLDUwJyYQqbcp23t6v3LbJOUolGkc1WvoYEsXQIxUkTor
         K8IkV/26E1+HeQGkUEleRspQOC6SBnIFmYGrNw2rv8+7VSg0UICJwPka1VR0WwK0LiX4
         gVtuM7vRCKSZqaOSLEr7QGVkfpUzrAaCzu0/KJBHvcp/+p2XTSaq5Y6gWlp57yodMvZc
         hLHYMEEWUeg/ohpgQdYffBYl5szeuXXDHkoYliEPebl8FcOElJVk7+iMfZnlvrBuj3pm
         G61A==
X-Gm-Message-State: ABy/qLZK3ybmUQJtnE4SDsTTF9y9EeMUcvHJnKFXsjo1tjClJl/NZRT/
	PzngYGfAudi267SXrdKM8+nqDg==
X-Google-Smtp-Source: APBJJlF/3KLtCT6eHhEfIce84TGjlwCK5paHy95Ixo7dnPUARJYmTi5EEMpBHN4EFiKTP+Yjoiy13g==
X-Received: by 2002:a17:903:24f:b0:1b8:ac61:ffcd with SMTP id j15-20020a170903024f00b001b8ac61ffcdmr12333562plh.3.1690192038795;
        Mon, 24 Jul 2023 02:47:18 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 11/47] gfs2: dynamically allocate the gfs2-qd shrinker
Date: Mon, 24 Jul 2023 17:43:18 +0800
Message-Id: <20230724094354.90817-12-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the gfs2-qd shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/gfs2/main.c  |  6 +++---
 fs/gfs2/quota.c | 26 ++++++++++++++++++++------
 fs/gfs2/quota.h |  3 ++-
 3 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
index afcb32854f14..e47b1cc79f59 100644
--- a/fs/gfs2/main.c
+++ b/fs/gfs2/main.c
@@ -147,7 +147,7 @@ static int __init init_gfs2_fs(void)
 	if (!gfs2_trans_cachep)
 		goto fail_cachep8;
 
-	error = register_shrinker(&gfs2_qd_shrinker, "gfs2-qd");
+	error = gfs2_qd_shrinker_init();
 	if (error)
 		goto fail_shrinker;
 
@@ -196,7 +196,7 @@ static int __init init_gfs2_fs(void)
 fail_wq2:
 	destroy_workqueue(gfs_recovery_wq);
 fail_wq1:
-	unregister_shrinker(&gfs2_qd_shrinker);
+	gfs2_qd_shrinker_exit();
 fail_shrinker:
 	kmem_cache_destroy(gfs2_trans_cachep);
 fail_cachep8:
@@ -229,7 +229,7 @@ static int __init init_gfs2_fs(void)
 
 static void __exit exit_gfs2_fs(void)
 {
-	unregister_shrinker(&gfs2_qd_shrinker);
+	gfs2_qd_shrinker_exit();
 	gfs2_glock_exit();
 	gfs2_unregister_debugfs();
 	unregister_filesystem(&gfs2_fs_type);
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index 704192b73605..bc9883cea847 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -186,13 +186,27 @@ static unsigned long gfs2_qd_shrink_count(struct shrinker *shrink,
 	return vfs_pressure_ratio(list_lru_shrink_count(&gfs2_qd_lru, sc));
 }
 
-struct shrinker gfs2_qd_shrinker = {
-	.count_objects = gfs2_qd_shrink_count,
-	.scan_objects = gfs2_qd_shrink_scan,
-	.seeks = DEFAULT_SEEKS,
-	.flags = SHRINKER_NUMA_AWARE,
-};
+static struct shrinker *gfs2_qd_shrinker;
+
+int gfs2_qd_shrinker_init(void)
+{
+	gfs2_qd_shrinker = shrinker_alloc(SHRINKER_NUMA_AWARE, "gfs2-qd");
+	if (!gfs2_qd_shrinker)
+		return -ENOMEM;
+
+	gfs2_qd_shrinker->count_objects = gfs2_qd_shrink_count;
+	gfs2_qd_shrinker->scan_objects = gfs2_qd_shrink_scan;
+	gfs2_qd_shrinker->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(gfs2_qd_shrinker);
 
+	return 0;
+}
+
+void gfs2_qd_shrinker_exit(void)
+{
+	shrinker_unregister(gfs2_qd_shrinker);
+}
 
 static u64 qd2index(struct gfs2_quota_data *qd)
 {
diff --git a/fs/gfs2/quota.h b/fs/gfs2/quota.h
index 21ada332d555..f9cb863373f7 100644
--- a/fs/gfs2/quota.h
+++ b/fs/gfs2/quota.h
@@ -59,7 +59,8 @@ static inline int gfs2_quota_lock_check(struct gfs2_inode *ip,
 }
 
 extern const struct quotactl_ops gfs2_quotactl_ops;
-extern struct shrinker gfs2_qd_shrinker;
+int gfs2_qd_shrinker_init(void);
+void gfs2_qd_shrinker_exit(void);
 extern struct list_lru gfs2_qd_lru;
 extern void __init gfs2_quota_hash_init(void);
 
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568565.888041 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsD2-0002dO-D8; Mon, 24 Jul 2023 09:50:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568565.888041; Mon, 24 Jul 2023 09:50:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsD1-0002a5-Jf; Mon, 24 Jul 2023 09:50:31 +0000
Received: by outflank-mailman (input) for mailman id 568565;
 Mon, 24 Jul 2023 09:47:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsA8-0007J3-NC
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:47:32 +0000
Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com
 [2607:f8b0:4864:20::429])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1b9c712c-2a07-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:47:32 +0200 (CEST)
Received: by mail-pf1-x429.google.com with SMTP id
 d2e1a72fcca58-682ae5d4184so1050408b3a.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:47:32 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.47.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:47:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1b9c712c-2a07-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192050; x=1690796850;
        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=9U3hHp3Ixfpl9U4smEWKzCVcwCA5eIL8z0A28L1UZbc=;
        b=QAYeqCfp5ScVSEsaILXKgN5czHypzkm5pfRSAUj7+K2TTSbTzNRqgHmwizXWrdbADt
         dPS6CIyf53xE6HiwpNM1QNNfNY4T/YxCdjgwYwYCMqZA8+w8CYGaoBAhPrRyc3gw7MXt
         IVjAsBtH8DkTKLFOC8qO29c6qKeUwQyCtOthCGYm9GTNcqaePplKjaly3vCp9NsEKqTp
         +rf/lXOBdYiittVpF+0GtN4867xhpo9Jz2TGzwKtiTTt7IZ0uSzvoV172id3/t1bP5WN
         +6ZWZdRQacrIafbFpiL67FIfiJZ1NdJ30fDHwqgYiEqyaEr7Ox+6gQsN8Wgz37MDdYdG
         WIMg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192050; x=1690796850;
        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=9U3hHp3Ixfpl9U4smEWKzCVcwCA5eIL8z0A28L1UZbc=;
        b=cbCUK54H5E18AnOqHZKPvLpFAeK8mZX0MJAcHzXhpO/MsLZxS1jyBG9bhcdNee3olq
         yMvBeZVD4WgabmrJoHMJAJW6KMA9f2vQ0ADpspU+S0wghOMjSsF8qV0RKlWhZ+WnRdz9
         bVrg0tKsBTVQkwRcRyD6XChGhRD5AEuG/U1jQF6RwtrvwcK0BkLfKUqhf8s5huI1CUM2
         7vKz304uw+F16Ae2rm9RgSOElh3eAub9JAwdhCs5uv58vJ+2bPmdskxPUOvNyAQUgfZS
         wLvYbpCHN9ceoOzCHHoqUzRHndJkLlVRAaPh9ZbUbE7w5x8TDK7hnVItZXz+U1E9qU3e
         iXrw==
X-Gm-Message-State: ABy/qLY6w1dSmeIMTzPOpcajdJLiij5cP590G40SkRyRuQ2K/7v4Bdk2
	kznZlU4iD5uY/om4mej2hmkx5A==
X-Google-Smtp-Source: APBJJlHqJFoGUA+vGZIvjP2L+AzvJt8mYCuJXkz93MaA+snz7x91W/Nq1tjb4AkURZSKSg9l3nnnXQ==
X-Received: by 2002:a05:6a20:7d86:b0:137:3eba:b808 with SMTP id v6-20020a056a207d8600b001373ebab808mr14262798pzj.5.1690192050616;
        Mon, 24 Jul 2023 02:47:30 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 12/47] NFSv4.2: dynamically allocate the nfs-xattr shrinkers
Date: Mon, 24 Jul 2023 17:43:19 +0800
Message-Id: <20230724094354.90817-13-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the nfs-xattr shrinkers.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/nfs/nfs42xattr.c | 87 +++++++++++++++++++++++----------------------
 1 file changed, 44 insertions(+), 43 deletions(-)

diff --git a/fs/nfs/nfs42xattr.c b/fs/nfs/nfs42xattr.c
index 911f634ba3da..3604342e0f77 100644
--- a/fs/nfs/nfs42xattr.c
+++ b/fs/nfs/nfs42xattr.c
@@ -796,28 +796,9 @@ static unsigned long nfs4_xattr_cache_scan(struct shrinker *shrink,
 static unsigned long nfs4_xattr_entry_scan(struct shrinker *shrink,
 					   struct shrink_control *sc);
 
-static struct shrinker nfs4_xattr_cache_shrinker = {
-	.count_objects	= nfs4_xattr_cache_count,
-	.scan_objects	= nfs4_xattr_cache_scan,
-	.seeks		= DEFAULT_SEEKS,
-	.flags		= SHRINKER_MEMCG_AWARE,
-};
-
-static struct shrinker nfs4_xattr_entry_shrinker = {
-	.count_objects	= nfs4_xattr_entry_count,
-	.scan_objects	= nfs4_xattr_entry_scan,
-	.seeks		= DEFAULT_SEEKS,
-	.batch		= 512,
-	.flags		= SHRINKER_MEMCG_AWARE,
-};
-
-static struct shrinker nfs4_xattr_large_entry_shrinker = {
-	.count_objects	= nfs4_xattr_entry_count,
-	.scan_objects	= nfs4_xattr_entry_scan,
-	.seeks		= 1,
-	.batch		= 512,
-	.flags		= SHRINKER_MEMCG_AWARE,
-};
+static struct shrinker *nfs4_xattr_cache_shrinker;
+static struct shrinker *nfs4_xattr_entry_shrinker;
+static struct shrinker *nfs4_xattr_large_entry_shrinker;
 
 static enum lru_status
 cache_lru_isolate(struct list_head *item,
@@ -943,7 +924,7 @@ nfs4_xattr_entry_scan(struct shrinker *shrink, struct shrink_control *sc)
 	struct nfs4_xattr_entry *entry;
 	struct list_lru *lru;
 
-	lru = (shrink == &nfs4_xattr_large_entry_shrinker) ?
+	lru = (shrink == nfs4_xattr_large_entry_shrinker) ?
 	    &nfs4_xattr_large_entry_lru : &nfs4_xattr_entry_lru;
 
 	freed = list_lru_shrink_walk(lru, sc, entry_lru_isolate, &dispose);
@@ -971,7 +952,7 @@ nfs4_xattr_entry_count(struct shrinker *shrink, struct shrink_control *sc)
 	unsigned long count;
 	struct list_lru *lru;
 
-	lru = (shrink == &nfs4_xattr_large_entry_shrinker) ?
+	lru = (shrink == nfs4_xattr_large_entry_shrinker) ?
 	    &nfs4_xattr_large_entry_lru : &nfs4_xattr_entry_lru;
 
 	count = list_lru_shrink_count(lru, sc);
@@ -991,18 +972,34 @@ static void nfs4_xattr_cache_init_once(void *p)
 	INIT_LIST_HEAD(&cache->dispose);
 }
 
-static int nfs4_xattr_shrinker_init(struct shrinker *shrinker,
-				    struct list_lru *lru, const char *name)
+typedef unsigned long (*count_objects_cb)(struct shrinker *s,
+					  struct shrink_control *sc);
+typedef unsigned long (*scan_objects_cb)(struct shrinker *s,
+					 struct shrink_control *sc);
+
+static int nfs4_xattr_shrinker_init(struct shrinker **shrinker,
+				    struct list_lru *lru, const char *name,
+				    count_objects_cb count,
+				    scan_objects_cb scan, long batch, int seeks)
 {
-	int ret = 0;
+	int ret;
 
-	ret = register_shrinker(shrinker, name);
-	if (ret)
+	*shrinker = shrinker_alloc(SHRINKER_MEMCG_AWARE, name);
+	if (!*shrinker)
+		return -ENOMEM;
+
+	ret = list_lru_init_memcg(lru, *shrinker);
+	if (ret) {
+		shrinker_free_non_registered(*shrinker);
 		return ret;
+	}
 
-	ret = list_lru_init_memcg(lru, shrinker);
-	if (ret)
-		unregister_shrinker(shrinker);
+	(*shrinker)->count_objects = count;
+	(*shrinker)->scan_objects = scan;
+	(*shrinker)->batch = batch;
+	(*shrinker)->seeks = seeks;
+
+	shrinker_register(*shrinker);
 
 	return ret;
 }
@@ -1010,7 +1007,7 @@ static int nfs4_xattr_shrinker_init(struct shrinker *shrinker,
 static void nfs4_xattr_shrinker_destroy(struct shrinker *shrinker,
 					struct list_lru *lru)
 {
-	unregister_shrinker(shrinker);
+	shrinker_unregister(shrinker);
 	list_lru_destroy(lru);
 }
 
@@ -1026,27 +1023,31 @@ int __init nfs4_xattr_cache_init(void)
 		return -ENOMEM;
 
 	ret = nfs4_xattr_shrinker_init(&nfs4_xattr_cache_shrinker,
-				       &nfs4_xattr_cache_lru,
-				       "nfs-xattr_cache");
+				       &nfs4_xattr_cache_lru, "nfs-xattr_cache",
+				       nfs4_xattr_cache_count,
+				       nfs4_xattr_cache_scan, 0, DEFAULT_SEEKS);
 	if (ret)
 		goto out1;
 
 	ret = nfs4_xattr_shrinker_init(&nfs4_xattr_entry_shrinker,
-				       &nfs4_xattr_entry_lru,
-				       "nfs-xattr_entry");
+				       &nfs4_xattr_entry_lru, "nfs-xattr_entry",
+				       nfs4_xattr_entry_count,
+				       nfs4_xattr_entry_scan, 512, DEFAULT_SEEKS);
 	if (ret)
 		goto out2;
 
 	ret = nfs4_xattr_shrinker_init(&nfs4_xattr_large_entry_shrinker,
 				       &nfs4_xattr_large_entry_lru,
-				       "nfs-xattr_large_entry");
+				       "nfs-xattr_large_entry",
+				       nfs4_xattr_entry_count,
+				       nfs4_xattr_entry_scan, 512, 1);
 	if (!ret)
 		return 0;
 
-	nfs4_xattr_shrinker_destroy(&nfs4_xattr_entry_shrinker,
+	nfs4_xattr_shrinker_destroy(nfs4_xattr_entry_shrinker,
 				    &nfs4_xattr_entry_lru);
 out2:
-	nfs4_xattr_shrinker_destroy(&nfs4_xattr_cache_shrinker,
+	nfs4_xattr_shrinker_destroy(nfs4_xattr_cache_shrinker,
 				    &nfs4_xattr_cache_lru);
 out1:
 	kmem_cache_destroy(nfs4_xattr_cache_cachep);
@@ -1056,11 +1057,11 @@ int __init nfs4_xattr_cache_init(void)
 
 void nfs4_xattr_cache_exit(void)
 {
-	nfs4_xattr_shrinker_destroy(&nfs4_xattr_large_entry_shrinker,
+	nfs4_xattr_shrinker_destroy(nfs4_xattr_large_entry_shrinker,
 				    &nfs4_xattr_large_entry_lru);
-	nfs4_xattr_shrinker_destroy(&nfs4_xattr_entry_shrinker,
+	nfs4_xattr_shrinker_destroy(nfs4_xattr_entry_shrinker,
 				    &nfs4_xattr_entry_lru);
-	nfs4_xattr_shrinker_destroy(&nfs4_xattr_cache_shrinker,
+	nfs4_xattr_shrinker_destroy(nfs4_xattr_cache_shrinker,
 				    &nfs4_xattr_cache_lru);
 	kmem_cache_destroy(nfs4_xattr_cache_cachep);
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568567.888050 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsD3-00030s-Ft; Mon, 24 Jul 2023 09:50:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568567.888050; Mon, 24 Jul 2023 09:50:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsD2-0002vp-L7; Mon, 24 Jul 2023 09:50:32 +0000
Received: by outflank-mailman (input) for mailman id 568567;
 Mon, 24 Jul 2023 09:47:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsAK-0007J3-SR
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:47:44 +0000
Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com
 [2607:f8b0:4864:20::630])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 22acab3b-2a07-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:47:44 +0200 (CEST)
Received: by mail-pl1-x630.google.com with SMTP id
 d9443c01a7336-1b8c364ad3bso8858835ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:47:44 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.47.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:47:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 22acab3b-2a07-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192062; x=1690796862;
        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=rzRsL3uPXf8EtZhij3twpf+iuH9MzH4dVPBmPqsS5Og=;
        b=gX8Q7SXHLW91QeJQyKDVumBjdRBjyll1XQW/JTChdq9dJqktv+X9ib4/uAMXxgigqH
         2jaNwNGzNzbxV0P1Wq3smVBCy4sNVeMp2d3znSQmH+08EqCorhh8sobS3FzAo1aci+WZ
         ahKKXhVh1u/zcYQLSV07bWs7cg92+ga+7wTGv6JJSEqo99xKqc3+YUXi9LMwyQq6STAk
         AcT7MY/9kuaNFBZqw4pd3+jIBecT2Ao+Yw0ycAdTL8xM/HvxupDlq0E7GLdDU4836YR8
         3HkgcSbyA4vS6vLviPYG979wLCQ5W42uSMh1vXnsGUiqQWrA1KKfF7bNogJb+rMbZ6Yg
         D/lA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192062; x=1690796862;
        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=rzRsL3uPXf8EtZhij3twpf+iuH9MzH4dVPBmPqsS5Og=;
        b=F0Q4lIQNVD97+YyolyKd9T7/j0slewcsWq4rxdPZSPjE9Rj9CgdfQIrzzX0uX3+lvv
         HZSJM/adHA4WKsBXAS4Olb8SWxUKAdVgMz1JfKj5snbevWG6Vet30cAkMGzN2RMUQ7HA
         Gw/NGNjiJ0yzduoqM43hmTqFfVHUUarHPYCvcnibsrRMK4wdE1kml8Ff8KKs3DTaa1pp
         cE3GhQR93vwnDEh7q7eh0T7xDkQY66WNkwBCZFqkqQnVROl/jaSdgiecbFjEjMLO/DIL
         KcM2WZKs+nHqtLefpCF9ZkF2UvC6654ZdRGSBB95ghe++clTVztJWymPtW1N20Qu50Rb
         pEAg==
X-Gm-Message-State: ABy/qLbL9ZEkqGV7BDnVpuh85QDI5iKyQzLlkfu0yZUgQTMLzls4c26e
	bpNGBFEzZXW1J+kwxmf9FEL+sg==
X-Google-Smtp-Source: APBJJlE2hlcoboYUdUaSOoRiDnmiId7r6Wv5DYfSEbrHd1JPgB9nwdB4ObCAMGW7eL9gTiY+r7GrFA==
X-Received: by 2002:a17:902:d508:b0:1a6:6bdb:b548 with SMTP id b8-20020a170902d50800b001a66bdbb548mr12141350plg.1.1690192062448;
        Mon, 24 Jul 2023 02:47:42 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 13/47] nfs: dynamically allocate the nfs-acl shrinker
Date: Mon, 24 Jul 2023 17:43:20 +0800
Message-Id: <20230724094354.90817-14-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the nfs-acl shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/nfs/super.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 2284f749d892..a90b12593383 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -129,11 +129,7 @@ static void nfs_ssc_unregister_ops(void)
 }
 #endif /* CONFIG_NFS_V4_2 */
 
-static struct shrinker acl_shrinker = {
-	.count_objects	= nfs_access_cache_count,
-	.scan_objects	= nfs_access_cache_scan,
-	.seeks		= DEFAULT_SEEKS,
-};
+static struct shrinker *acl_shrinker;
 
 /*
  * Register the NFS filesystems
@@ -153,9 +149,17 @@ int __init register_nfs_fs(void)
 	ret = nfs_register_sysctl();
 	if (ret < 0)
 		goto error_2;
-	ret = register_shrinker(&acl_shrinker, "nfs-acl");
-	if (ret < 0)
+
+	acl_shrinker = shrinker_alloc(0, "nfs-acl");
+	if (!acl_shrinker)
 		goto error_3;
+
+	acl_shrinker->count_objects = nfs_access_cache_count;
+	acl_shrinker->scan_objects = nfs_access_cache_scan;
+	acl_shrinker->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(acl_shrinker);
+
 #ifdef CONFIG_NFS_V4_2
 	nfs_ssc_register_ops();
 #endif
@@ -175,7 +179,7 @@ int __init register_nfs_fs(void)
  */
 void __exit unregister_nfs_fs(void)
 {
-	unregister_shrinker(&acl_shrinker);
+	shrinker_unregister(acl_shrinker);
 	nfs_unregister_sysctl();
 	unregister_nfs4_fs();
 #ifdef CONFIG_NFS_V4_2
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568569.888059 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsD4-0003E3-EM; Mon, 24 Jul 2023 09:50:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568569.888059; Mon, 24 Jul 2023 09:50:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsD3-0003A8-LI; Mon, 24 Jul 2023 09:50:33 +0000
Received: by outflank-mailman (input) for mailman id 568569;
 Mon, 24 Jul 2023 09:47: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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsAY-0007Pe-CF
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:47:58 +0000
Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com
 [2607:f8b0:4864:20::633])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 29da9214-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:47:56 +0200 (CEST)
Received: by mail-pl1-x633.google.com with SMTP id
 d9443c01a7336-1b7dfb95761so5876465ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:47:55 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.47.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:47:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 29da9214-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192074; x=1690796874;
        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=qReDjbjFz0xyiV7re04rgbBc1uubNDIxQ7QKRYWZSRs=;
        b=ENVLEGhvMjLiUvisyoHJontwb50xfTslV0XVCIZNbj3XxjFa+A4sTXO4Rw3QqFmux5
         XbznTWGuyuir8FMQeIa7tywzBJUnyvYSwuYJ02HBKdcTkSJdAtoOPw44n28eP8zUKucc
         q8yY+ysDs6yXU3SX/8XFuGMKyo+SMyS0Zlg4rwVloT2TyOVOz/Imh5E9tEAGm8xg8jyO
         QATQrcFlR17SUbjRuc1dqQxPY8algfDWOcvmKhvXGbaXm39iJYJiLthaOzWAxzJVeqgh
         fJOtvB6CBEjtg12DSwkb6lmHRDFIhGbGsjcgpxt8MGvrxNBdwtVQD4ot+/N3ASfLH/lS
         XEeQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192074; x=1690796874;
        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=qReDjbjFz0xyiV7re04rgbBc1uubNDIxQ7QKRYWZSRs=;
        b=YDx8jm6pOIY3u4qiKr2Eo6LY1/wVzPS9L8jRSU2nqkQoTwWHJCVtcsL1qilT0k1ldf
         s5kFjVWpuBAuXCXrPyakbjaA6HLl9bSiCr6dtIW81AJcwG857qru0uniX/RIoGmmZEJb
         3/rKc+kZuQCYp6t4uSvuClq2J0gCJ38plwwFvk8PtXENnlj90j2o+xEbYOLYEI3CThI6
         00bulTJ50suZoagXNrOse0dcLN2UkjZNddnPgP3d60N/xUzaZ9IykKrkrLP9OtU2wtUR
         Q84vQsbp13xScKGbFRM8edbNQOqU8rpHDQwRsRsxsiTzuU0Jxvopzf//r93mBQEx0PVR
         nd0w==
X-Gm-Message-State: ABy/qLZdPaoEeFn6rn/S22Gfjzc1kKIeWL0sU+qB5jKd5uI5H47HpD4F
	uyXAFXzyzjNlthVmvAM9u8UwyA==
X-Google-Smtp-Source: APBJJlFmRr0YS7/80cQjb3Wv0/ryy4A2Bv0/hjBc48SsvJ3Rmt9/pUa2TTT24oRtgj6qJ02D1OEnuA==
X-Received: by 2002:a17:902:dacf:b0:1b8:9215:9163 with SMTP id q15-20020a170902dacf00b001b892159163mr12197474plx.6.1690192074491;
        Mon, 24 Jul 2023 02:47:54 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 14/47] nfsd: dynamically allocate the nfsd-filecache shrinker
Date: Mon, 24 Jul 2023 17:43:21 +0800
Message-Id: <20230724094354.90817-15-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the nfsd-filecache shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/nfsd/filecache.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
index ee9c923192e0..50216768d408 100644
--- a/fs/nfsd/filecache.c
+++ b/fs/nfsd/filecache.c
@@ -521,11 +521,7 @@ nfsd_file_lru_scan(struct shrinker *s, struct shrink_control *sc)
 	return ret;
 }
 
-static struct shrinker	nfsd_file_shrinker = {
-	.scan_objects = nfsd_file_lru_scan,
-	.count_objects = nfsd_file_lru_count,
-	.seeks = 1,
-};
+static struct shrinker *nfsd_file_shrinker;
 
 /**
  * nfsd_file_cond_queue - conditionally unhash and queue a nfsd_file
@@ -746,12 +742,18 @@ nfsd_file_cache_init(void)
 		goto out_err;
 	}
 
-	ret = register_shrinker(&nfsd_file_shrinker, "nfsd-filecache");
-	if (ret) {
-		pr_err("nfsd: failed to register nfsd_file_shrinker: %d\n", ret);
+	nfsd_file_shrinker = shrinker_alloc(0, "nfsd-filecache");
+	if (!nfsd_file_shrinker) {
+		pr_err("nfsd: failed to allocate nfsd_file_shrinker\n");
 		goto out_lru;
 	}
 
+	nfsd_file_shrinker->count_objects = nfsd_file_lru_count;
+	nfsd_file_shrinker->scan_objects = nfsd_file_lru_scan;
+	nfsd_file_shrinker->seeks = 1;
+
+	shrinker_register(nfsd_file_shrinker);
+
 	ret = lease_register_notifier(&nfsd_file_lease_notifier);
 	if (ret) {
 		pr_err("nfsd: unable to register lease notifier: %d\n", ret);
@@ -774,7 +776,7 @@ nfsd_file_cache_init(void)
 out_notifier:
 	lease_unregister_notifier(&nfsd_file_lease_notifier);
 out_shrinker:
-	unregister_shrinker(&nfsd_file_shrinker);
+	shrinker_unregister(nfsd_file_shrinker);
 out_lru:
 	list_lru_destroy(&nfsd_file_lru);
 out_err:
@@ -891,7 +893,7 @@ nfsd_file_cache_shutdown(void)
 		return;
 
 	lease_unregister_notifier(&nfsd_file_lease_notifier);
-	unregister_shrinker(&nfsd_file_shrinker);
+	shrinker_unregister(nfsd_file_shrinker);
 	/*
 	 * make sure all callers of nfsd_file_lru_cb are done before
 	 * calling nfsd_file_cache_purge
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568571.888067 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsD5-0003Uz-Hg; Mon, 24 Jul 2023 09:50:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568571.888067; Mon, 24 Jul 2023 09:50:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsD4-0003Nc-Ep; Mon, 24 Jul 2023 09:50:34 +0000
Received: by outflank-mailman (input) for mailman id 568571;
 Mon, 24 Jul 2023 09:48:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsAi-0007J3-Ms
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:48:08 +0000
Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com
 [2607:f8b0:4864:20::429])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3106102d-2a07-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:48:07 +0200 (CEST)
Received: by mail-pf1-x429.google.com with SMTP id
 d2e1a72fcca58-682eef7d752so1028046b3a.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:48:07 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.47.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:48:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3106102d-2a07-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192086; x=1690796886;
        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=ztwb9n/1dXh113w/8xubUIoix8VXd/5rqVT4RvFn/tw=;
        b=Am7FnjS3Cpm4I6+unn47wV0WInP35j7cWyw7YSHmXYddBbEndaPLIOhBD501lhuXhz
         ziS0uq23cHOpl1MZygPYTe8AuNvoAdPlGK8k32I3Ef9lRu2tiO1YjBbYZCD1R2rMLxT1
         sbS7mgch7/EfOaLRKT3V6tvhfJSY21ngFnqMEHN8grEnjoqg0M6Q11qf7CVQTrHQJzW3
         E1Q+qRl3oeLAaumIkMGruzrANQhf6ocLGFa54JS2CwGaWbDUA2Re4gbZJ2jDKM9ntSrw
         dCSeZvHulgVnMl/ivIn59gXFxJS3Mnbl4ERIMhlA37amtawTgx9ciEfDapqLjZzr2ZBw
         AsLQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192086; x=1690796886;
        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=ztwb9n/1dXh113w/8xubUIoix8VXd/5rqVT4RvFn/tw=;
        b=N0SD36Pj+gfyIIhu/RyDQGS8Xve37Zgo56eS9NhHYD25qwbXS1Qe5HGbwicF7lSoFz
         nl51d9r5NFvlglfo+qXoD4y89+jgjSdjaXaBi/AN/jOZJOZ9vY4r0y8JuaHfnP2PT++T
         HtkfI/Vd3E4+d4EC9g/AdoceqsyNXJdy34NaUmf2HkjxVZmXrkgpshbJj8brH82EdOU5
         t3C/lDmDZOp8kCKWCX7cFk28eMWy0RWxOh/kvNd0fVoK5N/H0bmFnF9EgIYDwGEmBO1g
         tULZyOGf/orkyYEAas3hngK1pcWvWBVJiePilTZBcyWrNGx4+ryXGzqkIlfa/kfKu/Gn
         gGoQ==
X-Gm-Message-State: ABy/qLaRah1Tw1dZIcDw6h1Go4D6bXq/7gKk1LhBnmfQISnzD+nVe78W
	4OpGSdFhEJPbB09gNqLcGa3rTg==
X-Google-Smtp-Source: APBJJlHRxCFTSeAmJPIiRwzXlrngv0y6n5gqphR6YCBFCcMRvGq0CtVM2WuFHUMj7p5y6QUWxkmpXA==
X-Received: by 2002:a17:902:dad1:b0:1b8:aded:524c with SMTP id q17-20020a170902dad100b001b8aded524cmr12538511plx.1.1690192086608;
        Mon, 24 Jul 2023 02:48:06 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 15/47] quota: dynamically allocate the dquota-cache shrinker
Date: Mon, 24 Jul 2023 17:43:22 +0800
Message-Id: <20230724094354.90817-16-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the dquota-cache shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/quota/dquot.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index e8232242dd34..6cb2d8911bc3 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -791,11 +791,7 @@ dqcache_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
 	percpu_counter_read_positive(&dqstats.counter[DQST_FREE_DQUOTS]));
 }
 
-static struct shrinker dqcache_shrinker = {
-	.count_objects = dqcache_shrink_count,
-	.scan_objects = dqcache_shrink_scan,
-	.seeks = DEFAULT_SEEKS,
-};
+static struct shrinker *dqcache_shrinker;
 
 /*
  * Safely release dquot and put reference to dquot.
@@ -2991,8 +2987,15 @@ static int __init dquot_init(void)
 	pr_info("VFS: Dquot-cache hash table entries: %ld (order %ld,"
 		" %ld bytes)\n", nr_hash, order, (PAGE_SIZE << order));
 
-	if (register_shrinker(&dqcache_shrinker, "dquota-cache"))
-		panic("Cannot register dquot shrinker");
+	dqcache_shrinker = shrinker_alloc(0, "dquota-cache");
+	if (!dqcache_shrinker)
+		panic("Cannot allocate dquot shrinker");
+
+	dqcache_shrinker->count_objects = dqcache_shrink_count;
+	dqcache_shrinker->scan_objects = dqcache_shrink_scan;
+	dqcache_shrinker->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(dqcache_shrinker);
 
 	return 0;
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568574.888081 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsD7-0003vq-MY; Mon, 24 Jul 2023 09:50:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568574.888081; Mon, 24 Jul 2023 09:50:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsD6-0003pO-9w; Mon, 24 Jul 2023 09:50:36 +0000
Received: by outflank-mailman (input) for mailman id 568574;
 Mon, 24 Jul 2023 09:48:21 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsAv-0007Pe-KG
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:48:21 +0000
Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com
 [2607:f8b0:4864:20::633])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 382642cf-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:48:19 +0200 (CEST)
Received: by mail-pl1-x633.google.com with SMTP id
 d9443c01a7336-1bb91c20602so2228665ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:48:19 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.48.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:48:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 382642cf-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192098; x=1690796898;
        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=av+QDe1dYuRDqLy0LPAsVex0suGCyDNqgU4hNImbDOo=;
        b=bDwQiK4fS0yTwWq4oVGVRKxPIDCclDxFD1XuAsmfHKruu98HTXXz11gYjdkSK/HgQ4
         rQnPx3dscLMyKil4aICcT0ClG/ZXMBy6mCQ6rCkQE03v5xWhoTzeYQvpLwD9l9p7vXT0
         v6DYimpLGMp1ValFsBMSR4AyqoftBHG/Cr11IkBPDpuRa7fi2izlKP1Mq3g/2PWtCUJ9
         byo8ZZ2a8q2qzXYTrMXoHTjOf2N4B4XMSkAD5N1iIFEjrTIqUQlkmwpGlE+j3WXksgRd
         fNHXLvhFxXWRY9vsToZ4OCxL1qfGN5pYRyHLSBIlboKFdsL2/OFWebl/aiL58+zCQO6q
         AKNw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192098; x=1690796898;
        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=av+QDe1dYuRDqLy0LPAsVex0suGCyDNqgU4hNImbDOo=;
        b=Pgm5J1Lwu3zbgdYuWiXKxV+eiGeiXp5Z8UcZLFVXeAIPZJn5PElR5j1NjjWHhti2QP
         o/A6WJpwRBYXklk7xxzH1FwjqXROGWioIyyPbrCkZlaklnpHP1bHYcYgnylEpB6z7a63
         N3WyhoOmjam++apBj0Pv6qKR/PDHaKCqXDvd4U5CM3+v1WRsI0nc1YbQlpEY+4ZkCs7c
         +ajuyHEBrfZxFaBQKq/d9MaMBMG2WZOKT2GKByuYs7I/4nMUxF433ZttUqdwUDEKhCFD
         HvXguWhK4RNbPWt0sVJVpPHA/zvv/qKbpQwR3ETalASKc6ZCYmBVxwEa6+ikTNo6iTq2
         oSeQ==
X-Gm-Message-State: ABy/qLZ6hiQ8FFwBmdxqqrSzK8WaT/FCYb0dx16ZAI1aEuLeZOPH5omZ
	fmLUaRWtubGCbWgoNz5wxz8wzg==
X-Google-Smtp-Source: APBJJlGdal6NRof8mBJ7MOpqyhGdVFWorp9Fsw25TA7e6Zh0vfd9YbcVPo2ONhSqPJyVS7KwA30xww==
X-Received: by 2002:a17:902:ea01:b0:1bb:83ec:832 with SMTP id s1-20020a170902ea0100b001bb83ec0832mr8333588plg.2.1690192098526;
        Mon, 24 Jul 2023 02:48:18 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 16/47] ubifs: dynamically allocate the ubifs-slab shrinker
Date: Mon, 24 Jul 2023 17:43:23 +0800
Message-Id: <20230724094354.90817-17-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the ubifs-slab shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/ubifs/super.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 32cb14759796..f2a3a58f7860 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -54,11 +54,7 @@ module_param_cb(default_version, &ubifs_default_version_ops, &ubifs_default_vers
 static struct kmem_cache *ubifs_inode_slab;
 
 /* UBIFS TNC shrinker description */
-static struct shrinker ubifs_shrinker_info = {
-	.scan_objects = ubifs_shrink_scan,
-	.count_objects = ubifs_shrink_count,
-	.seeks = DEFAULT_SEEKS,
-};
+static struct shrinker *ubifs_shrinker_info;
 
 /**
  * validate_inode - validate inode.
@@ -2373,7 +2369,7 @@ static void inode_slab_ctor(void *obj)
 
 static int __init ubifs_init(void)
 {
-	int err;
+	int err = -ENOMEM;
 
 	BUILD_BUG_ON(sizeof(struct ubifs_ch) != 24);
 
@@ -2439,10 +2435,16 @@ static int __init ubifs_init(void)
 	if (!ubifs_inode_slab)
 		return -ENOMEM;
 
-	err = register_shrinker(&ubifs_shrinker_info, "ubifs-slab");
-	if (err)
+	ubifs_shrinker_info = shrinker_alloc(0, "ubifs-slab");
+	if (!ubifs_shrinker_info)
 		goto out_slab;
 
+	ubifs_shrinker_info->count_objects = ubifs_shrink_count;
+	ubifs_shrinker_info->scan_objects = ubifs_shrink_scan;
+	ubifs_shrinker_info->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(ubifs_shrinker_info);
+
 	err = ubifs_compressors_init();
 	if (err)
 		goto out_shrinker;
@@ -2467,7 +2469,7 @@ static int __init ubifs_init(void)
 	dbg_debugfs_exit();
 	ubifs_compressors_exit();
 out_shrinker:
-	unregister_shrinker(&ubifs_shrinker_info);
+	shrinker_unregister(ubifs_shrinker_info);
 out_slab:
 	kmem_cache_destroy(ubifs_inode_slab);
 	return err;
@@ -2483,7 +2485,7 @@ static void __exit ubifs_exit(void)
 	dbg_debugfs_exit();
 	ubifs_sysfs_exit();
 	ubifs_compressors_exit();
-	unregister_shrinker(&ubifs_shrinker_info);
+	shrinker_unregister(ubifs_shrinker_info);
 
 	/*
 	 * Make sure all delayed rcu free inodes are flushed before we
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568576.888089 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsD8-0004GY-UP; Mon, 24 Jul 2023 09:50:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568576.888089; Mon, 24 Jul 2023 09:50:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsD7-00049u-RA; Mon, 24 Jul 2023 09:50:37 +0000
Received: by outflank-mailman (input) for mailman id 568576;
 Mon, 24 Jul 2023 09:48:33 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsB7-0007Pe-He
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:48:33 +0000
Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com
 [2607:f8b0:4864:20::630])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3f4604fc-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:48:31 +0200 (CEST)
Received: by mail-pl1-x630.google.com with SMTP id
 d9443c01a7336-1bb85ed352bso2235835ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:48:31 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.48.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:48:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3f4604fc-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192110; x=1690796910;
        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=8oqpenbl7KoJJhQpMWpio5jwf7tXqseO0h4l218M5aA=;
        b=aCj2BNfrpcxtoTz1/CdONfPnB9TAYVTaqB4T4WqFv6y7Hxl9V0boEFHOTATComBNn2
         xnFJ8tDKgZzO2TH4FwPeDTaYzb9x0D/uxmdjUcwFhXWgN5824wox+O8c9U9ybGUIohlv
         M3vK6kDUgbRBz02IXlUWPuxdPW8hkxiMWgJebr95xqiqSLJbGYOLAINvEuBU6c5+0m2D
         KwQfMs1a5lB1SKCsavAJR55Sjok6of8gfoBXMKjbRTfwQ6NM1BD/3dZZP6dR7OXOKSHl
         QBl4iWtqq0OikEBOGyMzrxqP+jJMX2cWmHkmCbYCS6DP7MDoD2ilfcJavniQ/pgHFrWu
         bw9w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192110; x=1690796910;
        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=8oqpenbl7KoJJhQpMWpio5jwf7tXqseO0h4l218M5aA=;
        b=HnmBLTjN61RoVyNfbfta1PmY8E1Ao+KbStV57f1SGo1aUyKQPDBnSrcU8dwxZl42bO
         8Uxi3KypCifcNVXQNalQvj44xDs/eGWe2H7xcM2OVtAzsnA9sKmbVpw5hzrLzhcSo57x
         ICm96Q/PsB+fPygoB6RQfXPFRWROdjv1c+7qsjmpJblkJVRjRhl43VVVY1Mfzu4mqWZf
         OkCcdwTH9E2ST8HozvOAL8vzOVL9GnH7l4AjuylUS0LPwTTQAc2PazKj0sIltS3j0O3N
         mFhpKQp2bI9+a0X/txD5jeC5osAcOH/w4zR573ZYcwA/qU5er8M6QkdwiInFeDyaK1Hb
         Ypew==
X-Gm-Message-State: ABy/qLZFGmLZPGIvB8C/EiiriXtKt6P+jkxAvzNApaVQFXWCoSFpmKXh
	Kg2H5dj4yfb5th+qgiO1RE7r2Q==
X-Google-Smtp-Source: APBJJlFv5Kl04F8rp2naJTMNzHe6rYzFJJPXcSejcs04WaV/YhAbklIOobqPbsV/O0Fdd5o/IKlERw==
X-Received: by 2002:a17:902:d484:b0:1b8:a27d:f591 with SMTP id c4-20020a170902d48400b001b8a27df591mr12259746plg.5.1690192110449;
        Mon, 24 Jul 2023 02:48:30 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 17/47] rcu: dynamically allocate the rcu-lazy shrinker
Date: Mon, 24 Jul 2023 17:43:24 +0800
Message-Id: <20230724094354.90817-18-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the rcu-lazy shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 kernel/rcu/tree_nocb.h | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h
index 43229d2b0c44..919f17561733 100644
--- a/kernel/rcu/tree_nocb.h
+++ b/kernel/rcu/tree_nocb.h
@@ -1397,12 +1397,7 @@ lazy_rcu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
 	return count ? count : SHRINK_STOP;
 }
 
-static struct shrinker lazy_rcu_shrinker = {
-	.count_objects = lazy_rcu_shrink_count,
-	.scan_objects = lazy_rcu_shrink_scan,
-	.batch = 0,
-	.seeks = DEFAULT_SEEKS,
-};
+static struct shrinker *lazy_rcu_shrinker;
 #endif // #ifdef CONFIG_RCU_LAZY
 
 void __init rcu_init_nohz(void)
@@ -1436,8 +1431,16 @@ void __init rcu_init_nohz(void)
 		return;
 
 #ifdef CONFIG_RCU_LAZY
-	if (register_shrinker(&lazy_rcu_shrinker, "rcu-lazy"))
-		pr_err("Failed to register lazy_rcu shrinker!\n");
+	lazy_rcu_shrinker = shrinker_alloc(0, "rcu-lazy");
+	if (!lazy_rcu_shrinker) {
+		pr_err("Failed to allocate lazy_rcu shrinker!\n");
+	} else {
+		lazy_rcu_shrinker->count_objects = lazy_rcu_shrink_count;
+		lazy_rcu_shrinker->scan_objects = lazy_rcu_shrink_scan;
+		lazy_rcu_shrinker->seeks = DEFAULT_SEEKS;
+
+		shrinker_register(lazy_rcu_shrinker);
+	}
 #endif // #ifdef CONFIG_RCU_LAZY
 
 	if (!cpumask_subset(rcu_nocb_mask, cpu_possible_mask)) {
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568578.888096 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsDB-0004dd-49; Mon, 24 Jul 2023 09:50:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568578.888096; Mon, 24 Jul 2023 09:50:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsD9-0004W2-Cb; Mon, 24 Jul 2023 09:50:39 +0000
Received: by outflank-mailman (input) for mailman id 568578;
 Mon, 24 Jul 2023 09:48:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsBI-0007SE-Ht
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:48:44 +0000
Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com
 [2607:f8b0:4864:20::634])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 46547d27-2a07-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:48:43 +0200 (CEST)
Received: by mail-pl1-x634.google.com with SMTP id
 d9443c01a7336-1bb85ed352bso2236135ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:48:43 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.48.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:48:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 46547d27-2a07-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192122; x=1690796922;
        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=SZ4CyloeMnj8DJaX3jH++Kh0s8L9fcE8HheaL79+C9E=;
        b=J/Bt6a5BMqhvdU/1SLuQX4nGlsOFwUStDgY9eH2v8f3RVdFq/sd3J4KWhio/dC9+p1
         I7x8MAszW6LDKxiafO3ijuVZWlwLloveljXquKUGhfhkI+gBmVZ+aRdkRgZMuHOMA0H0
         yKIvOrvLzQBJ0AtrK9ni37EuWpbTH6Gi1xp5mvGIU09YEhbSx5XeAtmIIM3L0YDCA4IY
         cOQImgDx6CerfFdixsFA7q/WRBoRbwfsUuvzftsn9rBMTfKTu+7IX9QKeDCcJjiigyeD
         MRXtrE3UPxmcDS5U+FzEfuL+bhB6TGOFiKBVZLyyImDcoC0jgqbvAUMVzKpuo72Ccxdg
         yqhg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192122; x=1690796922;
        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=SZ4CyloeMnj8DJaX3jH++Kh0s8L9fcE8HheaL79+C9E=;
        b=kexZzDobxkbVBIhNGY0WdZh3FaWWpe0Ho7kJWdYONWz0+JZ+lkQaVLqXnVGtJ0f/Tv
         YdJ6tiLn7OnTsIKC7qUHACLiSaPU5Hu+u5RKHhpaB15/LJHKiOrHVS0nZShc5HyAqR5W
         jlea4DiBIIOSuEj0abg3fWuKWO+efIiFcVgcQBaafXa5Bjn9isL73VfM+K/eu4Jvx+pW
         xyB+bGvkWHd+25hvjWzk38toOnhf4MCuwaPJOEl2WFtd5KWJhUxNoeZdt3S9vF8T45Hs
         jtCXYo8Hu7pbhVOfKTy76Koh8brwFQ2Q9f81pYIxWC1gEyKCC0XXwPvaA20Sv5ukbpyY
         lK+w==
X-Gm-Message-State: ABy/qLZjry1XMaQZopBj1ZkOqH7+Qm8fmGmtvZtI93PW3zuNKDXk8pKa
	vCgdQIkXECe+7oj6ahcM5wuQyQ==
X-Google-Smtp-Source: APBJJlGdl4zR2tT8oeBRlnNa82kteJScCMEv7aXbUuimbAqUFJ617TPjzQL08XTMcGzg+wanNIE0AA==
X-Received: by 2002:a17:902:ecce:b0:1b8:b55d:4cff with SMTP id a14-20020a170902ecce00b001b8b55d4cffmr12423850plh.2.1690192122325;
        Mon, 24 Jul 2023 02:48:42 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 18/47] rcu: dynamically allocate the rcu-kfree shrinker
Date: Mon, 24 Jul 2023 17:43:25 +0800
Message-Id: <20230724094354.90817-19-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the rcu-kfree shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 kernel/rcu/tree.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 1449cb69a0e0..d068ce3567fc 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3445,12 +3445,7 @@ kfree_rcu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
 	return freed == 0 ? SHRINK_STOP : freed;
 }
 
-static struct shrinker kfree_rcu_shrinker = {
-	.count_objects = kfree_rcu_shrink_count,
-	.scan_objects = kfree_rcu_shrink_scan,
-	.batch = 0,
-	.seeks = DEFAULT_SEEKS,
-};
+static struct shrinker *kfree_rcu_shrinker;
 
 void __init kfree_rcu_scheduler_running(void)
 {
@@ -4958,8 +4953,18 @@ static void __init kfree_rcu_batch_init(void)
 		INIT_DELAYED_WORK(&krcp->page_cache_work, fill_page_cache_func);
 		krcp->initialized = true;
 	}
-	if (register_shrinker(&kfree_rcu_shrinker, "rcu-kfree"))
-		pr_err("Failed to register kfree_rcu() shrinker!\n");
+
+	kfree_rcu_shrinker = shrinker_alloc(0, "rcu-kfree");
+	if (!kfree_rcu_shrinker) {
+		pr_err("Failed to allocate kfree_rcu() shrinker!\n");
+		return;
+	}
+
+	kfree_rcu_shrinker->count_objects = kfree_rcu_shrink_count;
+	kfree_rcu_shrinker->scan_objects = kfree_rcu_shrink_scan;
+	kfree_rcu_shrinker->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(kfree_rcu_shrinker);
 }
 
 void __init rcu_init(void)
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568581.888107 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsDC-00057g-Oe; Mon, 24 Jul 2023 09:50:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568581.888107; Mon, 24 Jul 2023 09:50:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsDB-0004yP-C6; Mon, 24 Jul 2023 09:50:41 +0000
Received: by outflank-mailman (input) for mailman id 568581;
 Mon, 24 Jul 2023 09:48:56 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsBU-0007SE-H9
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:48:56 +0000
Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com
 [2607:f8b0:4864:20::635])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4da35015-2a07-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:48:56 +0200 (CEST)
Received: by mail-pl1-x635.google.com with SMTP id
 d9443c01a7336-1b8c364ad3bso8860465ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:48:55 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.48.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:48:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4da35015-2a07-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192134; x=1690796934;
        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=hg2vi+2AAPCRuQsciRtLylYUMTgaXzyfBXLGSnv8etw=;
        b=aydgK7bn0QggjlQydoxB8/wzzA4TXTh5kAH1HczgG5x53kEUfwsZTHfAy7Oll8B5Eb
         /u8m2Fx+yVNF796ZZc3s2XmC1YIubtCHa+WaPaj49PGcqhNB+vofNP25+pjGYzLsUBey
         s8mU5+/TbPuzYxlgD12Kt4jsZqhjhd4Zmfvq3eYOMY75uxvK9h6vyhatsfe9xzUUvBHR
         65A0XriwgvV356EN5StwdT8HNZN8xypzwNZbI9gp5ddxZgA9hT9j3WwIFAc65w94K4S5
         JlPP5IHsQz3xceBVdVld1V5OEs83EDOwKVmAaZghdPj/BNMPCYQ+scOGPe5A3YPCuRcv
         ewxg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192134; x=1690796934;
        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=hg2vi+2AAPCRuQsciRtLylYUMTgaXzyfBXLGSnv8etw=;
        b=du7oq+dMnMEWP29EV90J8uTKjzYFvU3MUO9FaO/AvLDTuuXBW/oklel1keCkVsjLyj
         b6HEtifLAwbmdVmCHS5AzWVxGPp0hbEvG6PydoeNv5bOpZwUVzAJzW4NYn1/TmWCIGX2
         6vZWZOqBI3kGJR0w7UfOBHcBz01RXc7gsTedW+ZgNNO3YaIFVypaEKk20IiUVayym1+L
         TUKekwMKbIXItytyc3modhxvoY1ZhVlGWggImzF6PPakXrhSYi5wWt6FUp6zC5lxG687
         qjoxEPyU6wFmxxc1323FTjwtviM0/lPjXlli61nEii+Z+aZHai6IiISQ5HdMtWy38lER
         ZZMQ==
X-Gm-Message-State: ABy/qLZcHMKi6SQkz4+wZD606VLo/Fp5BlrAOyOUYrc0YrMFjXyShYlN
	wHyZ+ZOpi3qtQrX2hg/GncHORg==
X-Google-Smtp-Source: APBJJlFlbX7MjF6Gs1NiwvX/ojXDY5CFLHX7jflUqBVL6eloGiFWEtkN1YdVHiZpjmt9ZeBQxK8/kg==
X-Received: by 2002:a17:902:ecd2:b0:1b8:b4f6:1327 with SMTP id a18-20020a170902ecd200b001b8b4f61327mr12294253plh.6.1690192134533;
        Mon, 24 Jul 2023 02:48:54 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 19/47] mm: thp: dynamically allocate the thp-related shrinkers
Date: Mon, 24 Jul 2023 17:43:26 +0800
Message-Id: <20230724094354.90817-20-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the thp-zero and thp-deferred_split
shrinkers.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 mm/huge_memory.c | 69 +++++++++++++++++++++++++++++++-----------------
 1 file changed, 45 insertions(+), 24 deletions(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 8c94b34024a2..4db5a1834d81 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -65,7 +65,11 @@ unsigned long transparent_hugepage_flags __read_mostly =
 	(1<<TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG)|
 	(1<<TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG);
 
-static struct shrinker deferred_split_shrinker;
+static struct shrinker *deferred_split_shrinker;
+static unsigned long deferred_split_count(struct shrinker *shrink,
+					  struct shrink_control *sc);
+static unsigned long deferred_split_scan(struct shrinker *shrink,
+					 struct shrink_control *sc);
 
 static atomic_t huge_zero_refcount;
 struct page *huge_zero_page __read_mostly;
@@ -229,11 +233,7 @@ static unsigned long shrink_huge_zero_page_scan(struct shrinker *shrink,
 	return 0;
 }
 
-static struct shrinker huge_zero_page_shrinker = {
-	.count_objects = shrink_huge_zero_page_count,
-	.scan_objects = shrink_huge_zero_page_scan,
-	.seeks = DEFAULT_SEEKS,
-};
+static struct shrinker *huge_zero_page_shrinker;
 
 #ifdef CONFIG_SYSFS
 static ssize_t enabled_show(struct kobject *kobj,
@@ -454,6 +454,40 @@ static inline void hugepage_exit_sysfs(struct kobject *hugepage_kobj)
 }
 #endif /* CONFIG_SYSFS */
 
+static int thp_shrinker_init(void)
+{
+	huge_zero_page_shrinker = shrinker_alloc(0, "thp-zero");
+	if (!huge_zero_page_shrinker)
+		return -ENOMEM;
+
+	deferred_split_shrinker = shrinker_alloc(SHRINKER_NUMA_AWARE |
+						 SHRINKER_MEMCG_AWARE |
+						 SHRINKER_NONSLAB,
+						 "thp-deferred_split");
+	if (!deferred_split_shrinker) {
+		shrinker_free_non_registered(huge_zero_page_shrinker);
+		return -ENOMEM;
+	}
+
+	huge_zero_page_shrinker->count_objects = shrink_huge_zero_page_count;
+	huge_zero_page_shrinker->scan_objects = shrink_huge_zero_page_scan;
+	huge_zero_page_shrinker->seeks = DEFAULT_SEEKS;
+	shrinker_register(huge_zero_page_shrinker);
+
+	deferred_split_shrinker->count_objects = deferred_split_count;
+	deferred_split_shrinker->scan_objects = deferred_split_scan;
+	deferred_split_shrinker->seeks = DEFAULT_SEEKS;
+	shrinker_register(deferred_split_shrinker);
+
+	return 0;
+}
+
+static void thp_shrinker_exit(void)
+{
+	shrinker_unregister(huge_zero_page_shrinker);
+	shrinker_unregister(deferred_split_shrinker);
+}
+
 static int __init hugepage_init(void)
 {
 	int err;
@@ -482,12 +516,9 @@ static int __init hugepage_init(void)
 	if (err)
 		goto err_slab;
 
-	err = register_shrinker(&huge_zero_page_shrinker, "thp-zero");
-	if (err)
-		goto err_hzp_shrinker;
-	err = register_shrinker(&deferred_split_shrinker, "thp-deferred_split");
+	err = thp_shrinker_init();
 	if (err)
-		goto err_split_shrinker;
+		goto err_shrinker;
 
 	/*
 	 * By default disable transparent hugepages on smaller systems,
@@ -505,10 +536,8 @@ static int __init hugepage_init(void)
 
 	return 0;
 err_khugepaged:
-	unregister_shrinker(&deferred_split_shrinker);
-err_split_shrinker:
-	unregister_shrinker(&huge_zero_page_shrinker);
-err_hzp_shrinker:
+	thp_shrinker_exit();
+err_shrinker:
 	khugepaged_destroy();
 err_slab:
 	hugepage_exit_sysfs(hugepage_kobj);
@@ -2851,7 +2880,7 @@ void deferred_split_folio(struct folio *folio)
 #ifdef CONFIG_MEMCG
 		if (memcg)
 			set_shrinker_bit(memcg, folio_nid(folio),
-					 deferred_split_shrinker.id);
+					 deferred_split_shrinker->id);
 #endif
 	}
 	spin_unlock_irqrestore(&ds_queue->split_queue_lock, flags);
@@ -2925,14 +2954,6 @@ static unsigned long deferred_split_scan(struct shrinker *shrink,
 	return split;
 }
 
-static struct shrinker deferred_split_shrinker = {
-	.count_objects = deferred_split_count,
-	.scan_objects = deferred_split_scan,
-	.seeks = DEFAULT_SEEKS,
-	.flags = SHRINKER_NUMA_AWARE | SHRINKER_MEMCG_AWARE |
-		 SHRINKER_NONSLAB,
-};
-
 #ifdef CONFIG_DEBUG_FS
 static void split_huge_pages_all(void)
 {
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568586.888115 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsDE-0005ge-QN; Mon, 24 Jul 2023 09:50:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568586.888115; Mon, 24 Jul 2023 09:50:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsDD-0005Z7-KW; Mon, 24 Jul 2023 09:50:43 +0000
Received: by outflank-mailman (input) for mailman id 568586;
 Mon, 24 Jul 2023 09:49:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsBh-0007SE-Az
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:49:09 +0000
Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com
 [2607:f8b0:4864:20::635])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 54e37582-2a07-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:49:08 +0200 (CEST)
Received: by mail-pl1-x635.google.com with SMTP id
 d9443c01a7336-1b8c364ad3bso8861005ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:49:08 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.48.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:49:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 54e37582-2a07-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192146; x=1690796946;
        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=3CXd5cxT7BQDd98tt8oaC0MvbTuhoGV4WCiM7GrnKVE=;
        b=Om2j7Eq4b1zO3xdV6jpRgZNyxXUYFkRHVqkn+q5W951pJcNCyyCCfcFLMOexVrickD
         J4ocoN591zedkzE2l/xp9SKWxYNmVY9krcCZp1enxIDkg3AuGZslR02ZNhQ4EqRsU2HZ
         PP0+JI5GQi1EzLTs4k94q0v4nCvWQ/wpATlpWJHquPmCZ9F29qdBLMIvq7n3uMU0LBE+
         S5G8d6zEmU4sF3lI0zmYqBRm2zlIoJryhG+DWOUkdilD+QmzqjFCVIDjtSm2UD8IjhcW
         4f3Go/NoxA8FuaENkugEjSaXcGkVRUNsilnpPO5VZgwHu2urEIWQPvH/FMxPOeDNA9uj
         omeA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192146; x=1690796946;
        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=3CXd5cxT7BQDd98tt8oaC0MvbTuhoGV4WCiM7GrnKVE=;
        b=Tmn3+bHHrXJZJKddUEjES5CU6rHIhnLVaGXKQMkq/u7afychM1/hbY9uB9PTGCOJMU
         D9fiA0OCGrqVN0DJtFFXQxOEvOJFADrl1u5+YLaDYj8XGPtMNMownHAxVskjXsyMXuK9
         aTC7UObnfJtttLG5IDli0sowfM9n68kyXBAAvloVQxLQX968zuYn8fzroebgzopuoVSH
         ooXkHQT6IzpuCctxRdHc1YNX/oEhbKXxLowVXJ9PXsdXe/Iai/Cp5cJ2H5EVy3nPp3GK
         cPyEcgaXP/oRG/dhr3aD8JyPPUNtuSLtQtG8xBqe4lHd2O00H+3OHSmpZFGsJELrusNq
         E3TA==
X-Gm-Message-State: ABy/qLYw8XyhrJBEkkF6z0Hln7rwczRl7VgOk9lgEEjwI6G2Wr86ev+o
	zVi/g/sBPmxaVdu40fz4Uibosg==
X-Google-Smtp-Source: APBJJlGIkgxKi3c8vlsRfvF8eC2AUaCtjB+PIQLMdMMArsufsHEWiltHfQyyqXBdYUy9SpebX4CtOg==
X-Received: by 2002:a17:902:e80a:b0:1b8:50a9:6874 with SMTP id u10-20020a170902e80a00b001b850a96874mr12324079plg.5.1690192146760;
        Mon, 24 Jul 2023 02:49:06 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 20/47] sunrpc: dynamically allocate the sunrpc_cred shrinker
Date: Mon, 24 Jul 2023 17:43:27 +0800
Message-Id: <20230724094354.90817-21-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the sunrpc_cred shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 net/sunrpc/auth.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index 2f16f9d17966..74e40c8a512d 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -861,11 +861,7 @@ rpcauth_uptodatecred(struct rpc_task *task)
 		test_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) != 0;
 }
 
-static struct shrinker rpc_cred_shrinker = {
-	.count_objects = rpcauth_cache_shrink_count,
-	.scan_objects = rpcauth_cache_shrink_scan,
-	.seeks = DEFAULT_SEEKS,
-};
+static struct shrinker *rpc_cred_shrinker;
 
 int __init rpcauth_init_module(void)
 {
@@ -874,9 +870,16 @@ int __init rpcauth_init_module(void)
 	err = rpc_init_authunix();
 	if (err < 0)
 		goto out1;
-	err = register_shrinker(&rpc_cred_shrinker, "sunrpc_cred");
-	if (err < 0)
+	rpc_cred_shrinker = shrinker_alloc(0, "sunrpc_cred");
+	if (!rpc_cred_shrinker)
 		goto out2;
+
+	rpc_cred_shrinker->count_objects = rpcauth_cache_shrink_count;
+	rpc_cred_shrinker->scan_objects = rpcauth_cache_shrink_scan;
+	rpc_cred_shrinker->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(rpc_cred_shrinker);
+
 	return 0;
 out2:
 	rpc_destroy_authunix();
@@ -887,5 +890,5 @@ int __init rpcauth_init_module(void)
 void rpcauth_remove_module(void)
 {
 	rpc_destroy_authunix();
-	unregister_shrinker(&rpc_cred_shrinker);
+	shrinker_unregister(rpc_cred_shrinker);
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568589.888126 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsDH-0006Jj-3t; Mon, 24 Jul 2023 09:50:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568589.888126; Mon, 24 Jul 2023 09:50:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsDF-0006BG-KK; Mon, 24 Jul 2023 09:50:45 +0000
Received: by outflank-mailman (input) for mailman id 568589;
 Mon, 24 Jul 2023 09:49:21 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsBt-0007Pe-N9
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:49:21 +0000
Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com
 [2607:f8b0:4864:20::629])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5bec63fb-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:49:20 +0200 (CEST)
Received: by mail-pl1-x629.google.com with SMTP id
 d9443c01a7336-1bb85ed352bso2237105ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:49:19 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.49.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:49:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5bec63fb-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192158; x=1690796958;
        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=AVIFplaZ76DyAQXZ2ZJxr5973JfmLiF6XogxT7JwM8U=;
        b=g/oklpIKNGh+0wS+n9EMTX7klc8jS620o9fzwPGIqpCBu8mbiUf3GVaJFWI9cq4kyt
         IcHzy4DXpXrqHW9rKUwTo/qnz3ci8+g869gbq1SHjojy2v6sITGFJ6jCBwntHLmpVCFL
         BxlLRGgDhGT5pteYElzIqAQYNjUlDrhrzHvMMVeuk6mD5iB/3/39xp+zm1XNO6yWMu+0
         nnfy+u33I9S+Zpuf8vfrp2IBvebCHcozlkxEMdcu6inA/NJIaH4grbbwn36wCiHGJxl9
         XjhaC2ZZMe6xC4wfMSYebjh3I/a6dIvPCN3tI9BZtHhq23lIbjcutVI19WQEcGj42Ona
         01KQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192158; x=1690796958;
        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=AVIFplaZ76DyAQXZ2ZJxr5973JfmLiF6XogxT7JwM8U=;
        b=l8hp1vteUpNDcfSxJCEFEbHmHAKB8Dr0OblRQHqrpZlH0KjTT2ODd8Szs9YuZZO1gC
         Qe8R+ZnchkV0j5q1M2x6RyIxeE55W9XF+LqLV4ri6HhAOePw3y0KbDzew96BdhXRRWaf
         pIUV+Lg7lzjxeDmM8DZcohvcyhWTKOZpjbG0tKKVr+b3i039lV3fQJskCiYWsjZJ1zdL
         Y2ach5OdiowFlirFH0jXbSlGpI0iSPzeP29QQySRHQZwwYo/oQ/a9ItN3FnTxIFYExJz
         b0YdGFle4Ltwu93dQKe+MjD5HqOZoV7Y9NVqJHvHcl44hBzzMQnAsTKGz083Z00NhV9p
         hgOw==
X-Gm-Message-State: ABy/qLZ4nLqwGgZMyjXsCE3wu1JsyV3BylbzbmVEXwkvjZiHXayNBOXK
	QWEDqXoyIw70VLvP59MVADeEyQ==
X-Google-Smtp-Source: APBJJlFR9Ju5Vfb3AHUJ7jWuLYrfbcu6xuKCy8KktQCx0EpABVN8oHS8r350MQ/TdmOpiBIOkTrovA==
X-Received: by 2002:a17:902:d484:b0:1b8:a27d:f591 with SMTP id c4-20020a170902d48400b001b8a27df591mr12261184plg.5.1690192158548;
        Mon, 24 Jul 2023 02:49:18 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 21/47] mm: workingset: dynamically allocate the mm-shadow shrinker
Date: Mon, 24 Jul 2023 17:43:28 +0800
Message-Id: <20230724094354.90817-22-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the mm-shadow shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 mm/workingset.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/mm/workingset.c b/mm/workingset.c
index 4686ae363000..4bc85f739b13 100644
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@ -762,12 +762,7 @@ static unsigned long scan_shadow_nodes(struct shrinker *shrinker,
 					NULL);
 }
 
-static struct shrinker workingset_shadow_shrinker = {
-	.count_objects = count_shadow_nodes,
-	.scan_objects = scan_shadow_nodes,
-	.seeks = 0, /* ->count reports only fully expendable nodes */
-	.flags = SHRINKER_NUMA_AWARE | SHRINKER_MEMCG_AWARE,
-};
+static struct shrinker *workingset_shadow_shrinker;
 
 /*
  * Our list_lru->lock is IRQ-safe as it nests inside the IRQ-safe
@@ -779,7 +774,7 @@ static int __init workingset_init(void)
 {
 	unsigned int timestamp_bits;
 	unsigned int max_order;
-	int ret;
+	int ret = -ENOMEM;
 
 	BUILD_BUG_ON(BITS_PER_LONG < EVICTION_SHIFT);
 	/*
@@ -796,17 +791,24 @@ static int __init workingset_init(void)
 	pr_info("workingset: timestamp_bits=%d max_order=%d bucket_order=%u\n",
 	       timestamp_bits, max_order, bucket_order);
 
-	ret = prealloc_shrinker(&workingset_shadow_shrinker, "mm-shadow");
-	if (ret)
+	workingset_shadow_shrinker = shrinker_alloc(SHRINKER_NUMA_AWARE |
+						    SHRINKER_MEMCG_AWARE,
+						    "mm-shadow");
+	if (!workingset_shadow_shrinker)
 		goto err;
+
 	ret = __list_lru_init(&shadow_nodes, true, &shadow_nodes_key,
-			      &workingset_shadow_shrinker);
+			      workingset_shadow_shrinker);
 	if (ret)
 		goto err_list_lru;
-	register_shrinker_prepared(&workingset_shadow_shrinker);
+
+	workingset_shadow_shrinker->count_objects = count_shadow_nodes;
+	workingset_shadow_shrinker->scan_objects = scan_shadow_nodes;
+
+	shrinker_register(workingset_shadow_shrinker);
 	return 0;
 err_list_lru:
-	free_prealloced_shrinker(&workingset_shadow_shrinker);
+	shrinker_free_non_registered(workingset_shadow_shrinker);
 err:
 	return ret;
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568591.888138 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsDJ-000718-Je; Mon, 24 Jul 2023 09:50:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568591.888138; Mon, 24 Jul 2023 09:50:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsDH-0006mx-Tz; Mon, 24 Jul 2023 09:50:47 +0000
Received: by outflank-mailman (input) for mailman id 568591;
 Mon, 24 Jul 2023 09:49:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsC4-0007SE-8M
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:49:32 +0000
Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com
 [2607:f8b0:4864:20::635])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 62f8fa6a-2a07-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:49:31 +0200 (CEST)
Received: by mail-pl1-x635.google.com with SMTP id
 d9443c01a7336-1b7dfb95761so5878885ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:49:31 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.49.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:49:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 62f8fa6a-2a07-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192170; x=1690796970;
        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=ys9vBHKFvUQ64/r6xhiUU0Z6Ew/XYgW4RHIRDMT4d8M=;
        b=TLqdX6PCGs3QdF4rJk6Dp4mqvaSF7WZDWFKpkIQIK8x+Dm7L2v/Mmjuy/WWJJoDq3k
         4QTs2F3hk0gGhN8kj+Hfm6DAsPH66e1EubuHJaj3BSCQ2bDE7mtMLy3HQFnk3pG2qxGI
         mySJ8OPh5Ng4If1TjW3fRjGo1FnLHFlF9cOfMjspWTnq0qLhrPsLNbiUzYS8/krmBF6Z
         ip5YJEdLLkDL+5vWc2rL+XgbqKHQL8jbw+nlxR7I6M2XcMg9/1dcKhOJPvHQuFHMHPIp
         ARop1lFeh6w8Ne+wa7O3N2fKRYrV/3XKoHW5Uidkt6fMf+4L1gxMXNtlDdxeKPGfvdg6
         p11w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192170; x=1690796970;
        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=ys9vBHKFvUQ64/r6xhiUU0Z6Ew/XYgW4RHIRDMT4d8M=;
        b=bawQk3g/3wVI92HLjHzxde0gNTAh52xRXSlqVZ1FHJ2wOmv67KU+wdHom9/mnbnb+7
         aIsp5eN6Vc9/ctyPl8mSIRmw8TdQOFK5Qk4SJUrLXmw4XQ9Ghrmyk3ksxUmVoLfKexBK
         /iu4wrpV5gsiB62Lk560ErZuEPy+CWumNBxTa6wRgoR6e0eZgUQrnJJ5d/H2a/kxeL+f
         Ah7tFL41Aq9z/qit3KEf/wCIUSudMz7Km/tUjqGCwmsHPlqo5G9/hsF1/app02d3hyRA
         IMPBVVQ+cicLzjiHcxWOZWYWTtegz9USNTZYscX+cbcfLMcpMiJB5fyKfFbhTZHD6HBl
         yPkw==
X-Gm-Message-State: ABy/qLbm5EYbsVsMzuKA15czwLHjg0V9o2i5d6CVJuABx6uBBC/igDjA
	vQsnySO71jaY8kYaIh1MH9N0Yw==
X-Google-Smtp-Source: APBJJlFkBw02O8PtVItEXpmJ/bGWM9sp4fUOmnYSOIyG9XuieUTiinrCv3H33MrLETZpz/mqqXfPcw==
X-Received: by 2002:a17:903:32c9:b0:1b8:5827:8763 with SMTP id i9-20020a17090332c900b001b858278763mr12116030plr.4.1690192170396;
        Mon, 24 Jul 2023 02:49:30 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 22/47] drm/i915: dynamically allocate the i915_gem_mm shrinker
Date: Mon, 24 Jul 2023 17:43:29 +0800
Message-Id: <20230724094354.90817-23-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the i915_gem_mm shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct drm_i915_private.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_shrinker.c | 30 +++++++++++---------
 drivers/gpu/drm/i915/i915_drv.h              |  2 +-
 2 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c b/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c
index 214763942aa2..a7409b8c2634 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c
@@ -284,8 +284,7 @@ unsigned long i915_gem_shrink_all(struct drm_i915_private *i915)
 static unsigned long
 i915_gem_shrinker_count(struct shrinker *shrinker, struct shrink_control *sc)
 {
-	struct drm_i915_private *i915 =
-		container_of(shrinker, struct drm_i915_private, mm.shrinker);
+	struct drm_i915_private *i915 = shrinker->private_data;
 	unsigned long num_objects;
 	unsigned long count;
 
@@ -302,8 +301,8 @@ i915_gem_shrinker_count(struct shrinker *shrinker, struct shrink_control *sc)
 	if (num_objects) {
 		unsigned long avg = 2 * count / num_objects;
 
-		i915->mm.shrinker.batch =
-			max((i915->mm.shrinker.batch + avg) >> 1,
+		i915->mm.shrinker->batch =
+			max((i915->mm.shrinker->batch + avg) >> 1,
 			    128ul /* default SHRINK_BATCH */);
 	}
 
@@ -313,8 +312,7 @@ i915_gem_shrinker_count(struct shrinker *shrinker, struct shrink_control *sc)
 static unsigned long
 i915_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc)
 {
-	struct drm_i915_private *i915 =
-		container_of(shrinker, struct drm_i915_private, mm.shrinker);
+	struct drm_i915_private *i915 = shrinker->private_data;
 	unsigned long freed;
 
 	sc->nr_scanned = 0;
@@ -422,12 +420,18 @@ i915_gem_shrinker_vmap(struct notifier_block *nb, unsigned long event, void *ptr
 
 void i915_gem_driver_register__shrinker(struct drm_i915_private *i915)
 {
-	i915->mm.shrinker.scan_objects = i915_gem_shrinker_scan;
-	i915->mm.shrinker.count_objects = i915_gem_shrinker_count;
-	i915->mm.shrinker.seeks = DEFAULT_SEEKS;
-	i915->mm.shrinker.batch = 4096;
-	drm_WARN_ON(&i915->drm, register_shrinker(&i915->mm.shrinker,
-						  "drm-i915_gem"));
+	i915->mm.shrinker = shrinker_alloc(0, "drm-i915_gem");
+	if (!i915->mm.shrinker) {
+		drm_WARN_ON(&i915->drm, 1);
+	} else {
+		i915->mm.shrinker->scan_objects = i915_gem_shrinker_scan;
+		i915->mm.shrinker->count_objects = i915_gem_shrinker_count;
+		i915->mm.shrinker->seeks = DEFAULT_SEEKS;
+		i915->mm.shrinker->batch = 4096;
+		i915->mm.shrinker->private_data = i915;
+
+		shrinker_register(i915->mm.shrinker);
+	}
 
 	i915->mm.oom_notifier.notifier_call = i915_gem_shrinker_oom;
 	drm_WARN_ON(&i915->drm, register_oom_notifier(&i915->mm.oom_notifier));
@@ -443,7 +447,7 @@ void i915_gem_driver_unregister__shrinker(struct drm_i915_private *i915)
 		    unregister_vmap_purge_notifier(&i915->mm.vmap_notifier));
 	drm_WARN_ON(&i915->drm,
 		    unregister_oom_notifier(&i915->mm.oom_notifier));
-	unregister_shrinker(&i915->mm.shrinker);
+	shrinker_unregister(i915->mm.shrinker);
 }
 
 void i915_gem_shrinker_taints_mutex(struct drm_i915_private *i915,
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 682ef2b5c7d5..389e8bf140d7 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -163,7 +163,7 @@ struct i915_gem_mm {
 
 	struct notifier_block oom_notifier;
 	struct notifier_block vmap_notifier;
-	struct shrinker shrinker;
+	struct shrinker *shrinker;
 
 #ifdef CONFIG_MMU_NOTIFIER
 	/**
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568593.888148 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsDL-0007cO-C2; Mon, 24 Jul 2023 09:50:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568593.888148; Mon, 24 Jul 2023 09:50:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsDK-0007Tc-0R; Mon, 24 Jul 2023 09:50:50 +0000
Received: by outflank-mailman (input) for mailman id 568593;
 Mon, 24 Jul 2023 09:49:46 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsCH-0007Pe-W3
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:49:45 +0000
Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com
 [2607:f8b0:4864:20::62c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6a458985-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:49:44 +0200 (CEST)
Received: by mail-pl1-x62c.google.com with SMTP id
 d9443c01a7336-1bba9539a23so645295ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:49:43 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.49.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:49:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6a458985-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192182; x=1690796982;
        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=FPgx5tx5pugTz0d6jibfzfGw2xSKE+ix47CgP1Qw/g4=;
        b=eNFqSXTl7Fs+A61apTH/V806oFNFqUEW9iBW/QGnoaz3m8bxFzAIk52taB3hTPoo0J
         15Uy/EhxhzzXrAniIeKy95ZVaJB60ETDr5+Beo/2JORQV0eMMIYUvFGSn01JXJQmgfvF
         wVSzhI8MrjoxVzBXxfbK/bzinkaNiYLaxnx8BzakR2VO4bS5jTMeezTAiUWxMRd9glqy
         y7ZbeUA/amFMlmdildpnpY/ykDL2iuVB+OIlcnryGkEk6VSFnVV3f/s+KAnTQMPBvZI0
         bhvIVOkp7ajnZG67FTbNaTw3FFqm546EN6Ypmf7e8IynzALyaOfSF7MjrTN2cH5bObeQ
         XNsw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192182; x=1690796982;
        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=FPgx5tx5pugTz0d6jibfzfGw2xSKE+ix47CgP1Qw/g4=;
        b=RjEPDcsi/fckVyuYHlAPVUyLa5zLwkQKGzw/vqotMw4PHVOlYboHeYwC9te5o8xBXR
         lrQOau2IM7XWUtCFwsMFKEPRFTOHyZnPY9w7XPTrDsdYQOA8K3ISkLHjlDaMvlkCQ9kh
         DRvP2MqTZFZljNSr83+ItXZmrB4Y51JXzXvUBTVbgbKSTl/ay6OcP8aQy0WwNSLeE+9S
         OlYSUdy/udwr48DnfRnFng64YJ5cWS//E4FsSWtVNS140G4sMVpZNVjnaqubUZifJr3x
         +6MumYLWuAKYumH/q50DqLP7kQeaudX2IHQsDgN8LlPbu0pHWz7fBg1ibXY1RZ8SdtJg
         OtHw==
X-Gm-Message-State: ABy/qLZLEloRcyprfm5N0XQ50tGcdVbcPPGevQ/UqKM7FWqSf9p10Za0
	9/qDi6S4G0lzmtY+BWUak/oFug==
X-Google-Smtp-Source: APBJJlHNherDqZFzA7p7tcMEc26kiZZ4z0G58iklJcv127ghy/RIpJQTR76k3+Vr6OIbO3Et5X/b8Q==
X-Received: by 2002:a17:903:2305:b0:1b8:b0c4:2e3d with SMTP id d5-20020a170903230500b001b8b0c42e3dmr12244115plh.4.1690192182555;
        Mon, 24 Jul 2023 02:49:42 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 23/47] drm/msm: dynamically allocate the drm-msm_gem shrinker
Date: Mon, 24 Jul 2023 17:43:30 +0800
Message-Id: <20230724094354.90817-24-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the drm-msm_gem shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct msm_drm_private.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 drivers/gpu/drm/msm/msm_drv.c          |  4 ++-
 drivers/gpu/drm/msm/msm_drv.h          |  4 +--
 drivers/gpu/drm/msm/msm_gem_shrinker.c | 36 ++++++++++++++++----------
 3 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 891eff8433a9..7f6933be703f 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -461,7 +461,9 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
 	if (ret)
 		goto err_msm_uninit;
 
-	msm_gem_shrinker_init(ddev);
+	ret = msm_gem_shrinker_init(ddev);
+	if (ret)
+		goto err_msm_uninit;
 
 	if (priv->kms_init) {
 		ret = priv->kms_init(ddev);
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index e13a8cbd61c9..84523d4a1e58 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -217,7 +217,7 @@ struct msm_drm_private {
 	} vram;
 
 	struct notifier_block vmap_notifier;
-	struct shrinker shrinker;
+	struct shrinker *shrinker;
 
 	struct drm_atomic_state *pm_state;
 
@@ -279,7 +279,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
 unsigned long msm_gem_shrinker_shrink(struct drm_device *dev, unsigned long nr_to_scan);
 #endif
 
-void msm_gem_shrinker_init(struct drm_device *dev);
+int msm_gem_shrinker_init(struct drm_device *dev);
 void msm_gem_shrinker_cleanup(struct drm_device *dev);
 
 int msm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma);
diff --git a/drivers/gpu/drm/msm/msm_gem_shrinker.c b/drivers/gpu/drm/msm/msm_gem_shrinker.c
index f38296ad8743..7daab1298c11 100644
--- a/drivers/gpu/drm/msm/msm_gem_shrinker.c
+++ b/drivers/gpu/drm/msm/msm_gem_shrinker.c
@@ -34,8 +34,7 @@ static bool can_block(struct shrink_control *sc)
 static unsigned long
 msm_gem_shrinker_count(struct shrinker *shrinker, struct shrink_control *sc)
 {
-	struct msm_drm_private *priv =
-		container_of(shrinker, struct msm_drm_private, shrinker);
+	struct msm_drm_private *priv = shrinker->private_data;
 	unsigned count = priv->lru.dontneed.count;
 
 	if (can_swap())
@@ -100,8 +99,7 @@ active_evict(struct drm_gem_object *obj)
 static unsigned long
 msm_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc)
 {
-	struct msm_drm_private *priv =
-		container_of(shrinker, struct msm_drm_private, shrinker);
+	struct msm_drm_private *priv = shrinker->private_data;
 	struct {
 		struct drm_gem_lru *lru;
 		bool (*shrink)(struct drm_gem_object *obj);
@@ -148,10 +146,11 @@ msm_gem_shrinker_shrink(struct drm_device *dev, unsigned long nr_to_scan)
 	struct shrink_control sc = {
 		.nr_to_scan = nr_to_scan,
 	};
-	int ret;
+	unsigned long ret = SHRINK_STOP;
 
 	fs_reclaim_acquire(GFP_KERNEL);
-	ret = msm_gem_shrinker_scan(&priv->shrinker, &sc);
+	if (priv->shrinker)
+		ret = msm_gem_shrinker_scan(priv->shrinker, &sc);
 	fs_reclaim_release(GFP_KERNEL);
 
 	return ret;
@@ -210,16 +209,27 @@ msm_gem_shrinker_vmap(struct notifier_block *nb, unsigned long event, void *ptr)
  *
  * This function registers and sets up the msm shrinker.
  */
-void msm_gem_shrinker_init(struct drm_device *dev)
+int msm_gem_shrinker_init(struct drm_device *dev)
 {
 	struct msm_drm_private *priv = dev->dev_private;
-	priv->shrinker.count_objects = msm_gem_shrinker_count;
-	priv->shrinker.scan_objects = msm_gem_shrinker_scan;
-	priv->shrinker.seeks = DEFAULT_SEEKS;
-	WARN_ON(register_shrinker(&priv->shrinker, "drm-msm_gem"));
+
+	priv->shrinker = shrinker_alloc(0, "drm-msm_gem");
+	if (!priv->shrinker) {
+		WARN_ON(1);
+		return -ENOMEM;
+	}
+
+	priv->shrinker->count_objects = msm_gem_shrinker_count;
+	priv->shrinker->scan_objects = msm_gem_shrinker_scan;
+	priv->shrinker->seeks = DEFAULT_SEEKS;
+	priv->shrinker->private_data = priv;
+
+	shrinker_register(priv->shrinker);
 
 	priv->vmap_notifier.notifier_call = msm_gem_shrinker_vmap;
 	WARN_ON(register_vmap_purge_notifier(&priv->vmap_notifier));
+
+	return 0;
 }
 
 /**
@@ -232,8 +242,8 @@ void msm_gem_shrinker_cleanup(struct drm_device *dev)
 {
 	struct msm_drm_private *priv = dev->dev_private;
 
-	if (priv->shrinker.nr_deferred) {
+	if (priv->shrinker) {
 		WARN_ON(unregister_vmap_purge_notifier(&priv->vmap_notifier));
-		unregister_shrinker(&priv->shrinker);
+		shrinker_unregister(priv->shrinker);
 	}
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568595.888157 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsDM-00084E-Pc; Mon, 24 Jul 2023 09:50:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568595.888157; Mon, 24 Jul 2023 09:50:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsDL-0007y3-Ez; Mon, 24 Jul 2023 09:50:51 +0000
Received: by outflank-mailman (input) for mailman id 568595;
 Mon, 24 Jul 2023 09:49: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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsCU-0007Pe-6Z
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:49:58 +0000
Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com
 [2607:f8b0:4864:20::635])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 71a55ef8-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:49:56 +0200 (CEST)
Received: by mail-pl1-x635.google.com with SMTP id
 d9443c01a7336-1b8c364ad3bso8862085ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:49:56 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.49.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:49:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 71a55ef8-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192195; x=1690796995;
        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=9Za/Hz+nmH3G3JzZh25LzFiu0ZOWgA3znFTLEp4oxTw=;
        b=gR2qnZxmoz280cmZWcXiSCLKKkR1JfAp12ElTfYwqMrNTp8JCp9ZKZRXrFwOkcY/Sb
         CrbcisbKWYe3aY6B3pvGdH/dVnCF0vGzFeD5T1Yk3y+VfaQjIO+EZahaao1fjNd/BZoI
         apuMNV19Cpy+f53Y3adNFJ3coCvNEOiZFJQcm8nd+dDkCN4T/1IxyvGyE+UJ4ZlCp1aB
         v/6FaBWqZJevgDX1XD0OMGqFb23jKwI+/PxmuakBM9m0V+vk+xlBE1r0FaEXeTkyqUfe
         vbAcs9nc+KNDOrB0YDxGRMugv4K0wSAyub+4ZaUHe2Bm2guChHPn7IXXTJaLQIHDrakU
         MiWA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192195; x=1690796995;
        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=9Za/Hz+nmH3G3JzZh25LzFiu0ZOWgA3znFTLEp4oxTw=;
        b=eop+PxTl0Q4qh2sQTnm+Y+WbVi4Za2RqZmW5/eUrgcMr+0ypj5XJ7iYHfNR5gfKeko
         tH/rTA0bY6NmU0ppup0Ql32Ylk/sAEpE0+GvDdOm/6h6O+1wKa38XjtqTxzIUk+C+KPU
         jSk+ihxq5k5Pt6pCFfMG+RS6zt+xq8bvsWpkv3JprzKGaACzC/TybIG5jGzfqbUBd7Qh
         CSOjf7+6rzvAuNyWlSUpFiFS+7KaQMtCGAZNL8z1xxk+Lwr3oeD2NoHSFHQH1CmUEMrW
         3eIjqIVCJpYDg//YguIaujwJrBStwrA1khYwFpIpiSWvs2E2apVnIhjGvGiJPOZEWTAP
         gZ5A==
X-Gm-Message-State: ABy/qLb3DimpATv3swvA67vaJIPjY068+FPz1Nol3KAHrb/pbeKcjEZn
	ktM7+IHkV1spw9fUAQQP0z4oJw==
X-Google-Smtp-Source: APBJJlFYiQjYsesoLBIGYzIbaqvqBpGNnPrMVt+9gbe/8vvXchqG9OkxYsLP3NQiA5NgJtO6rGDrrQ==
X-Received: by 2002:a17:902:e80a:b0:1b8:50a9:6874 with SMTP id u10-20020a170902e80a00b001b850a96874mr12325717plg.5.1690192194956;
        Mon, 24 Jul 2023 02:49:54 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 24/47] drm/panfrost: dynamically allocate the drm-panfrost shrinker
Date: Mon, 24 Jul 2023 17:43:31 +0800
Message-Id: <20230724094354.90817-25-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the drm-panfrost shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct panfrost_device.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 drivers/gpu/drm/panfrost/panfrost_device.h    |  2 +-
 drivers/gpu/drm/panfrost/panfrost_drv.c       |  6 +++-
 drivers/gpu/drm/panfrost/panfrost_gem.h       |  2 +-
 .../gpu/drm/panfrost/panfrost_gem_shrinker.c  | 32 ++++++++++++-------
 4 files changed, 27 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h
index b0126b9fbadc..e667e5689353 100644
--- a/drivers/gpu/drm/panfrost/panfrost_device.h
+++ b/drivers/gpu/drm/panfrost/panfrost_device.h
@@ -118,7 +118,7 @@ struct panfrost_device {
 
 	struct mutex shrinker_lock;
 	struct list_head shrinker_list;
-	struct shrinker shrinker;
+	struct shrinker *shrinker;
 
 	struct panfrost_devfreq pfdevfreq;
 };
diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index bbada731bbbd..f705bbdea360 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -598,10 +598,14 @@ static int panfrost_probe(struct platform_device *pdev)
 	if (err < 0)
 		goto err_out1;
 
-	panfrost_gem_shrinker_init(ddev);
+	err = panfrost_gem_shrinker_init(ddev);
+	if (err)
+		goto err_out2;
 
 	return 0;
 
+err_out2:
+	drm_dev_unregister(ddev);
 err_out1:
 	pm_runtime_disable(pfdev->dev);
 	panfrost_device_fini(pfdev);
diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.h b/drivers/gpu/drm/panfrost/panfrost_gem.h
index ad2877eeeccd..863d2ec8d4f0 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gem.h
+++ b/drivers/gpu/drm/panfrost/panfrost_gem.h
@@ -81,7 +81,7 @@ panfrost_gem_mapping_get(struct panfrost_gem_object *bo,
 void panfrost_gem_mapping_put(struct panfrost_gem_mapping *mapping);
 void panfrost_gem_teardown_mappings_locked(struct panfrost_gem_object *bo);
 
-void panfrost_gem_shrinker_init(struct drm_device *dev);
+int panfrost_gem_shrinker_init(struct drm_device *dev);
 void panfrost_gem_shrinker_cleanup(struct drm_device *dev);
 
 #endif /* __PANFROST_GEM_H__ */
diff --git a/drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c b/drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c
index bf0170782f25..9a90dfb5301f 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c
+++ b/drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c
@@ -18,8 +18,7 @@
 static unsigned long
 panfrost_gem_shrinker_count(struct shrinker *shrinker, struct shrink_control *sc)
 {
-	struct panfrost_device *pfdev =
-		container_of(shrinker, struct panfrost_device, shrinker);
+	struct panfrost_device *pfdev = shrinker->private_data;
 	struct drm_gem_shmem_object *shmem;
 	unsigned long count = 0;
 
@@ -65,8 +64,7 @@ static bool panfrost_gem_purge(struct drm_gem_object *obj)
 static unsigned long
 panfrost_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc)
 {
-	struct panfrost_device *pfdev =
-		container_of(shrinker, struct panfrost_device, shrinker);
+	struct panfrost_device *pfdev = shrinker->private_data;
 	struct drm_gem_shmem_object *shmem, *tmp;
 	unsigned long freed = 0;
 
@@ -97,13 +95,24 @@ panfrost_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc)
  *
  * This function registers and sets up the panfrost shrinker.
  */
-void panfrost_gem_shrinker_init(struct drm_device *dev)
+int panfrost_gem_shrinker_init(struct drm_device *dev)
 {
 	struct panfrost_device *pfdev = dev->dev_private;
-	pfdev->shrinker.count_objects = panfrost_gem_shrinker_count;
-	pfdev->shrinker.scan_objects = panfrost_gem_shrinker_scan;
-	pfdev->shrinker.seeks = DEFAULT_SEEKS;
-	WARN_ON(register_shrinker(&pfdev->shrinker, "drm-panfrost"));
+
+	pfdev->shrinker = shrinker_alloc(0, "drm-panfrost");
+	if (!pfdev->shrinker) {
+		WARN_ON(1);
+		return -ENOMEM;
+	}
+
+	pfdev->shrinker->count_objects = panfrost_gem_shrinker_count;
+	pfdev->shrinker->scan_objects = panfrost_gem_shrinker_scan;
+	pfdev->shrinker->seeks = DEFAULT_SEEKS;
+	pfdev->shrinker->private_data = pfdev;
+
+	shrinker_register(pfdev->shrinker);
+
+	return 0;
 }
 
 /**
@@ -116,7 +125,6 @@ void panfrost_gem_shrinker_cleanup(struct drm_device *dev)
 {
 	struct panfrost_device *pfdev = dev->dev_private;
 
-	if (pfdev->shrinker.nr_deferred) {
-		unregister_shrinker(&pfdev->shrinker);
-	}
+	if (pfdev->shrinker)
+		shrinker_unregister(pfdev->shrinker);
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:50:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:50:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568597.888164 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsDN-0008NK-W7; Mon, 24 Jul 2023 09:50:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568597.888164; Mon, 24 Jul 2023 09:50:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsDM-0008G6-J7; Mon, 24 Jul 2023 09:50:52 +0000
Received: by outflank-mailman (input) for mailman id 568597;
 Mon, 24 Jul 2023 09:50:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsCf-0000Sq-EE
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:50:09 +0000
Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com
 [2607:f8b0:4864:20::629])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 78bfb01a-2a07-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:50:08 +0200 (CEST)
Received: by mail-pl1-x629.google.com with SMTP id
 d9443c01a7336-1bb91c20602so2230925ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:50:08 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.49.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:50:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 78bfb01a-2a07-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192207; x=1690797007;
        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=5tyryk3a6lKy52HCDJ7LTSnMns1BMfalny9tATaKfF4=;
        b=amQ/RyxG43H24ZUKc8otE5jiO+PYmxLlS/jMlPB0P6LNf3YwKIyMMGT5x5GETrJzMq
         RUBPJl4XNLYJOZfW+4QQddSzJ1AOcHQOg+iS5NlIsw7P4JxkBKv7P6vm/OPtlqHKc3hY
         SLjp5JA2uLEQMXCeF85H9FjbP+u1neEShB4g/q4BDTYJUem7uHrE3aZx7t8/OvBixlxe
         PbLUlPG8K2MumMSz8pDMF7zGqwESYJNwxt0dJLhsSfALoKSzpnkM0Hd7rb9gY0+HtLOP
         61X4fPzjkMASXPftIRT+bLKVEY2jgFRxsHYQZDL2GJ8BmZMhp7tc/64KlMZKvh3Rfksj
         0TFg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192207; x=1690797007;
        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=5tyryk3a6lKy52HCDJ7LTSnMns1BMfalny9tATaKfF4=;
        b=dLWWJQh6Ph8fLllFRMpEbxlpipMqC09oCxZk1GEPsJhsWJMhErGhA/MXHp/Jz2GNJ1
         wAZ4IytYpKXpRrzJ80XkMC1NXq+veVGFSGnhENlAoPWTIOOkJgH2R4L9ODBRzPUZz4Z3
         6WViFFh5fLAZUHU4q2cE3ngLVvhf7TEtaehvClU6Yn9QicZNIEvHOYirMB7ViqNcdq9o
         nq58M8QWcHFB06D3NH+09rulpRYvbriPhAzuhWWU6g589hSBmlSNx9KxMmp9MD5ZesHS
         wkBM2oaQz2l+bC35OsF9XWmPNvDzDfZW2FEqm9ySiSnw9CoKnBDrtBu6O8tL/CNtACDo
         wumg==
X-Gm-Message-State: ABy/qLZxkC/7512YXTBmBLwWR0f+Zv7n6sVAsqou039F+JQ68pfyD/jm
	0KxeZD9QxUmIrEBS/nrLAc5J5w==
X-Google-Smtp-Source: APBJJlGNSrKSFiHfBgDCDwymx1T6XElAyTc+fmhNn0a9fde+MwuOtWNaHmnJx2SRiMlK6zefGJ37qA==
X-Received: by 2002:a17:902:f682:b0:1b3:ec39:f42c with SMTP id l2-20020a170902f68200b001b3ec39f42cmr12377411plg.5.1690192206827;
        Mon, 24 Jul 2023 02:50:06 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 25/47] dm: dynamically allocate the dm-bufio shrinker
Date: Mon, 24 Jul 2023 17:43:32 +0800
Message-Id: <20230724094354.90817-26-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the dm-bufio shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct dm_bufio_client.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 drivers/md/dm-bufio.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index bc309e41d074..028e30a4b2d0 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -963,7 +963,7 @@ struct dm_bufio_client {
 
 	sector_t start;
 
-	struct shrinker shrinker;
+	struct shrinker *shrinker;
 	struct work_struct shrink_work;
 	atomic_long_t need_shrink;
 
@@ -2368,7 +2368,7 @@ static unsigned long dm_bufio_shrink_scan(struct shrinker *shrink, struct shrink
 {
 	struct dm_bufio_client *c;
 
-	c = container_of(shrink, struct dm_bufio_client, shrinker);
+	c = shrink->private_data;
 	atomic_long_add(sc->nr_to_scan, &c->need_shrink);
 	queue_work(dm_bufio_wq, &c->shrink_work);
 
@@ -2377,7 +2377,7 @@ static unsigned long dm_bufio_shrink_scan(struct shrinker *shrink, struct shrink
 
 static unsigned long dm_bufio_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
 {
-	struct dm_bufio_client *c = container_of(shrink, struct dm_bufio_client, shrinker);
+	struct dm_bufio_client *c = shrink->private_data;
 	unsigned long count = cache_total(&c->cache);
 	unsigned long retain_target = get_retain_buffers(c);
 	unsigned long queued_for_cleanup = atomic_long_read(&c->need_shrink);
@@ -2490,15 +2490,19 @@ struct dm_bufio_client *dm_bufio_client_create(struct block_device *bdev, unsign
 	INIT_WORK(&c->shrink_work, shrink_work);
 	atomic_long_set(&c->need_shrink, 0);
 
-	c->shrinker.count_objects = dm_bufio_shrink_count;
-	c->shrinker.scan_objects = dm_bufio_shrink_scan;
-	c->shrinker.seeks = 1;
-	c->shrinker.batch = 0;
-	r = register_shrinker(&c->shrinker, "dm-bufio:(%u:%u)",
-			      MAJOR(bdev->bd_dev), MINOR(bdev->bd_dev));
-	if (r)
+	c->shrinker = shrinker_alloc(0, "dm-bufio:(%u:%u)",
+				     MAJOR(bdev->bd_dev), MINOR(bdev->bd_dev));
+	if (!c->shrinker)
 		goto bad;
 
+	c->shrinker->count_objects = dm_bufio_shrink_count;
+	c->shrinker->scan_objects = dm_bufio_shrink_scan;
+	c->shrinker->seeks = 1;
+	c->shrinker->batch = 0;
+	c->shrinker->private_data = c;
+
+	shrinker_register(c->shrinker);
+
 	mutex_lock(&dm_bufio_clients_lock);
 	dm_bufio_client_count++;
 	list_add(&c->client_list, &dm_bufio_all_clients);
@@ -2537,7 +2541,7 @@ void dm_bufio_client_destroy(struct dm_bufio_client *c)
 
 	drop_buffers(c);
 
-	unregister_shrinker(&c->shrinker);
+	shrinker_unregister(c->shrinker);
 	flush_work(&c->shrink_work);
 
 	mutex_lock(&dm_bufio_clients_lock);
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:51:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:51:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568599.888193 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsDV-0002Dg-9U; Mon, 24 Jul 2023 09:51:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568599.888193; Mon, 24 Jul 2023 09:51:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsDU-00029b-IH; Mon, 24 Jul 2023 09:51:00 +0000
Received: by outflank-mailman (input) for mailman id 568599;
 Mon, 24 Jul 2023 09:50:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsDE-0005oA-PG
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:50:44 +0000
Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com
 [2607:f8b0:4864:20::630])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8deadc2d-2a07-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:50:43 +0200 (CEST)
Received: by mail-pl1-x630.google.com with SMTP id
 d9443c01a7336-1bb91c20602so2232125ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:50:43 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.50.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:50:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8deadc2d-2a07-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192242; x=1690797042;
        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=ZDFCq+3UkmhmTN0HM4/h2IKWPu86Pd5FvtdYemXQxRk=;
        b=XqHXKo6vbgHHpc6RhHf64kOEkWmd4DwF9S3G2HlcDNVprLbMgrziPLHmF3/SloAlTi
         M4qErsaBI3Xm//ZP8dUEW0qhn54k8U+Wqiz5Z3pGQ/Kj67wHGAvT2pzICXrQ4EWgGi4s
         SU7OWwibP9GfdaanTmVVTd7EGnabpaclCsU9Kc2UxrRFm4MGqpHvMAQuuWz3XkPdgRtX
         h20Y8gEliJsCmA8XQP0mFOD72LdPGTY+615jy3RfIBkDojgIRwF3RNuCELN3vZVJJ3vk
         B2oIbMm9U2+ETc6xL/s4Xuc7N8cOCExDDhuoZilq51tIchlhwDinGVhSK9NnH/LxlRAX
         CyQA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192242; x=1690797042;
        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=ZDFCq+3UkmhmTN0HM4/h2IKWPu86Pd5FvtdYemXQxRk=;
        b=g4zLXTS4nbILmIWYdIrutpKxYp2DJP5bj5Ge2Dv/c/de246JW97/gs2gnlX/JWq+zm
         sQh90yl8/Z3Yh9ICYBaU1XjBkl40eVBnTR5s7NxVKwE4d5e1nnAyVnh8ZhPnM867Qrtm
         qhwj8s8tmIiQJrn34ZoYkgkNRKZ5BnpgfHkifGL5Xbx+fkpLMqagFXprMVk4Nijo5kIM
         Wy5q5JVO+lB4/+zioqKVzVMkYFPoTUO2KhU7trwlMwCa4DjrhH82DCQhDQda6Ktqu0LI
         2nsFl7QYilr0RopxIIOk+8IVgYmC6a9bBqNN5hAcQZi2K13JRVj2bfwjJmRhoGsCd9gn
         614w==
X-Gm-Message-State: ABy/qLbpM8Wl+h2VdfLL36pUBrKOEojdJfb3PlHm9vaH9xeI87zeMzxF
	PxeIY1WG70XpGkI/aWWvskUj4w==
X-Google-Smtp-Source: APBJJlGR+n0mPlGVKvsXqmDpjqybpKJnY8gMKNhLgc/3jSHzBMUiGDHHAqX91CFo21fNITu34xNtfg==
X-Received: by 2002:a17:902:ec8b:b0:1b3:d8ac:8db3 with SMTP id x11-20020a170902ec8b00b001b3d8ac8db3mr12344607plg.6.1690192242411;
        Mon, 24 Jul 2023 02:50:42 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 28/47] bcache: dynamically allocate the md-bcache shrinker
Date: Mon, 24 Jul 2023 17:43:35 +0800
Message-Id: <20230724094354.90817-29-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the md-bcache shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct cache_set.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 drivers/md/bcache/bcache.h |  2 +-
 drivers/md/bcache/btree.c  | 27 ++++++++++++++++-----------
 drivers/md/bcache/sysfs.c  |  3 ++-
 3 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
index 5a79bb3c272f..c622bc50f81b 100644
--- a/drivers/md/bcache/bcache.h
+++ b/drivers/md/bcache/bcache.h
@@ -541,7 +541,7 @@ struct cache_set {
 	struct bio_set		bio_split;
 
 	/* For the btree cache */
-	struct shrinker		shrink;
+	struct shrinker		*shrink;
 
 	/* For the btree cache and anything allocation related */
 	struct mutex		bucket_lock;
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index fd121a61f17c..c176c7fc77d9 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -667,7 +667,7 @@ static int mca_reap(struct btree *b, unsigned int min_order, bool flush)
 static unsigned long bch_mca_scan(struct shrinker *shrink,
 				  struct shrink_control *sc)
 {
-	struct cache_set *c = container_of(shrink, struct cache_set, shrink);
+	struct cache_set *c = shrink->private_data;
 	struct btree *b, *t;
 	unsigned long i, nr = sc->nr_to_scan;
 	unsigned long freed = 0;
@@ -734,7 +734,7 @@ static unsigned long bch_mca_scan(struct shrinker *shrink,
 static unsigned long bch_mca_count(struct shrinker *shrink,
 				   struct shrink_control *sc)
 {
-	struct cache_set *c = container_of(shrink, struct cache_set, shrink);
+	struct cache_set *c = shrink->private_data;
 
 	if (c->shrinker_disabled)
 		return 0;
@@ -752,8 +752,8 @@ void bch_btree_cache_free(struct cache_set *c)
 
 	closure_init_stack(&cl);
 
-	if (c->shrink.list.next)
-		unregister_shrinker(&c->shrink);
+	if (c->shrink)
+		shrinker_unregister(c->shrink);
 
 	mutex_lock(&c->bucket_lock);
 
@@ -828,14 +828,19 @@ int bch_btree_cache_alloc(struct cache_set *c)
 		c->verify_data = NULL;
 #endif
 
-	c->shrink.count_objects = bch_mca_count;
-	c->shrink.scan_objects = bch_mca_scan;
-	c->shrink.seeks = 4;
-	c->shrink.batch = c->btree_pages * 2;
+	c->shrink = shrinker_alloc(0, "md-bcache:%pU", c->set_uuid);
+	if (!c->shrink) {
+		pr_warn("bcache: %s: could not allocate shrinker\n", __func__);
+		return -ENOMEM;
+	}
+
+	c->shrink->count_objects = bch_mca_count;
+	c->shrink->scan_objects = bch_mca_scan;
+	c->shrink->seeks = 4;
+	c->shrink->batch = c->btree_pages * 2;
+	c->shrink->private_data = c;
 
-	if (register_shrinker(&c->shrink, "md-bcache:%pU", c->set_uuid))
-		pr_warn("bcache: %s: could not register shrinker\n",
-				__func__);
+	shrinker_register(c->shrink);
 
 	return 0;
 }
diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
index 0e2c1880f60b..45d8af755de6 100644
--- a/drivers/md/bcache/sysfs.c
+++ b/drivers/md/bcache/sysfs.c
@@ -866,7 +866,8 @@ STORE(__bch_cache_set)
 
 		sc.gfp_mask = GFP_KERNEL;
 		sc.nr_to_scan = strtoul_or_return(buf);
-		c->shrink.scan_objects(&c->shrink, &sc);
+		if (c->shrink)
+			c->shrink->scan_objects(c->shrink, &sc);
 	}
 
 	sysfs_strtoul_clamp(congested_read_threshold_us,
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:51:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:51:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568609.888213 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsEQ-0006Zi-OR; Mon, 24 Jul 2023 09:51:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568609.888213; Mon, 24 Jul 2023 09:51:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsEQ-0006ZX-Jr; Mon, 24 Jul 2023 09:51:58 +0000
Received: by outflank-mailman (input) for mailman id 568609;
 Mon, 24 Jul 2023 09:51:57 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsEP-0006YF-CH
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:51:57 +0000
Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com
 [2607:f8b0:4864:20::630])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b89d8e58-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:51:55 +0200 (CEST)
Received: by mail-pl1-x630.google.com with SMTP id
 d9443c01a7336-1b867f9198dso8902915ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:51:55 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.51.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:51:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b89d8e58-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192314; x=1690797114;
        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=PA74NunQFszlW8RpIb5KtNwL3Pn/7Z7EgMABUrgFylU=;
        b=MYmDAyGvaH9GjafGte5f0TqZMkJr1oOT14uK/VKNPTh5pL/iKc3PiGablFSi+5BT6j
         IoiecGUe64uKw3y+vWs1lCbpf+OS9Yo3W5ff0ikkPf2ge+l7stczNwhOHnzI0pWwe0pR
         lVNgWWN8Ky8FgqL+6zRdvqLPNCTDQIHpWVlJaoIShaPfmtqGQzyTwxIkhTW3kzeSVUEW
         pkx6P9lBjvJg8+YzkWuV4dortMmGbLFDq9Rqdx9yF/c/I9SkCHMY1GOIepMBE1qemRK8
         tj0ZHDeO3eQ44eBpUz+g2//5n58O5w8P6EZtbtl6ceWITIkCg8pCfKcJD8vlFyZIVhW5
         jR1w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192314; x=1690797114;
        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=PA74NunQFszlW8RpIb5KtNwL3Pn/7Z7EgMABUrgFylU=;
        b=LkyUoDmzDN9RsaI7sl80GO0eokZeyBmIx4K0xffm/W1i6MMHyKpXMuFfuk53MDprj6
         GQ7xiuwxiZjhYkHVBKyAMO3tEnF1W3NbW8wHuqc7rp30/M0j3xjcKntJtLPSBlw5vMGd
         dkblgqM2RJWkE2SiStLAwCzRpV+BOb4AvXUsVxhywZQIZRTXygiEPtVGHcUS2tTt2CUz
         J/Sv1MqlaJ9egB4RP2mRCUgdqWC/0GEj9EE+2FRJtEHtr8ffCW4T8dr85TGOluWzkMbr
         7OXAWCVMYEqS13kIt8vGYur/Nm3OHndB4NGkZ+NG6aM0T0dI/6/3oLxoQWmMMVU9qs3k
         Zgng==
X-Gm-Message-State: ABy/qLbWi2Jd1K33XA/zGaQ9UqyuO83JOQ6BHc9ZOb64kxXCH4Foro08
	qB+0VNfCBqvx/jG8REZHge/5Kw==
X-Google-Smtp-Source: APBJJlG2oOvKNbqCVYKCsLLrFI6N3Peh10WK+D3LiX3VUR0Gh2vD9sbZ8AKvOgxEZEiSv+Xi5/CKrg==
X-Received: by 2002:a17:902:d4cb:b0:1b1:9272:55e2 with SMTP id o11-20020a170902d4cb00b001b1927255e2mr12377128plg.3.1690192313997;
        Mon, 24 Jul 2023 02:51:53 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Chuck Lever <chuck.lever@oracle.com>
Subject: [PATCH v2 34/47] nfsd: dynamically allocate the nfsd-client shrinker
Date: Mon, 24 Jul 2023 17:43:41 +0800
Message-Id: <20230724094354.90817-35-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the nfsd-client shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct nfsd_net.

Acked-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/nfsd/netns.h     |  2 +-
 fs/nfsd/nfs4state.c | 20 ++++++++++++--------
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h
index ec49b200b797..f669444d5336 100644
--- a/fs/nfsd/netns.h
+++ b/fs/nfsd/netns.h
@@ -195,7 +195,7 @@ struct nfsd_net {
 	int			nfs4_max_clients;
 
 	atomic_t		nfsd_courtesy_clients;
-	struct shrinker		nfsd_client_shrinker;
+	struct shrinker		*nfsd_client_shrinker;
 	struct work_struct	nfsd_shrinker_work;
 };
 
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 3339177f8e2f..c7a4616cd866 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4388,8 +4388,7 @@ static unsigned long
 nfsd4_state_shrinker_count(struct shrinker *shrink, struct shrink_control *sc)
 {
 	int count;
-	struct nfsd_net *nn = container_of(shrink,
-			struct nfsd_net, nfsd_client_shrinker);
+	struct nfsd_net *nn = shrink->private_data;
 
 	count = atomic_read(&nn->nfsd_courtesy_clients);
 	if (!count)
@@ -8125,12 +8124,17 @@ static int nfs4_state_create_net(struct net *net)
 	INIT_WORK(&nn->nfsd_shrinker_work, nfsd4_state_shrinker_worker);
 	get_net(net);
 
-	nn->nfsd_client_shrinker.scan_objects = nfsd4_state_shrinker_scan;
-	nn->nfsd_client_shrinker.count_objects = nfsd4_state_shrinker_count;
-	nn->nfsd_client_shrinker.seeks = DEFAULT_SEEKS;
-
-	if (register_shrinker(&nn->nfsd_client_shrinker, "nfsd-client"))
+	nn->nfsd_client_shrinker = shrinker_alloc(0, "nfsd-client");
+	if (!nn->nfsd_client_shrinker)
 		goto err_shrinker;
+
+	nn->nfsd_client_shrinker->scan_objects = nfsd4_state_shrinker_scan;
+	nn->nfsd_client_shrinker->count_objects = nfsd4_state_shrinker_count;
+	nn->nfsd_client_shrinker->seeks = DEFAULT_SEEKS;
+	nn->nfsd_client_shrinker->private_data = nn;
+
+	shrinker_register(nn->nfsd_client_shrinker);
+
 	return 0;
 
 err_shrinker:
@@ -8228,7 +8232,7 @@ nfs4_state_shutdown_net(struct net *net)
 	struct list_head *pos, *next, reaplist;
 	struct nfsd_net *nn = net_generic(net, nfsd_net_id);
 
-	unregister_shrinker(&nn->nfsd_client_shrinker);
+	shrinker_unregister(nn->nfsd_client_shrinker);
 	cancel_work(&nn->nfsd_shrinker_work);
 	cancel_delayed_work_sync(&nn->laundromat_work);
 	locks_end_grace(&nn->nfsd4_manager);
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:52:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:52:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568610.888223 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsEd-00075t-5e; Mon, 24 Jul 2023 09:52:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568610.888223; Mon, 24 Jul 2023 09:52:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsEd-00074e-2R; Mon, 24 Jul 2023 09:52:11 +0000
Received: by outflank-mailman (input) for mailman id 568610;
 Mon, 24 Jul 2023 09:52:09 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsEb-0006YF-K4
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:52:09 +0000
Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com
 [2607:f8b0:4864:20::636])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c008c3ec-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:52:07 +0200 (CEST)
Received: by mail-pl1-x636.google.com with SMTP id
 d9443c01a7336-1bb85ed352bso2244515ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:52:07 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.51.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:52:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c008c3ec-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192326; x=1690797126;
        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=qeaWGlGrVDaX2KSqXlTQooW5ZfkYFYzGyaP55BE4cnU=;
        b=MYlwTJTDVI5/f6YJJ9Nwh1CY4YhZi9eIC1CDJ1DyRv9Yzapo2flup5nLWK31JnUya4
         nBXhF3/ntFof+B/fxcNos4rU1mzgGFLQ8Lg1m/538+UmVUHxLn3bg+L91E4ru1Ihz2SO
         fg9POOKigTONSVFBbdLssldTbubSNv45ceOMMBLo6zHqMufpuf+dUVAHstr1v+ZhEIZv
         x1+X0S8QyRpTexUJuKkZ0porur2Qn5WvwI7n+FLWGO6xDxD7qp5+8q7izmU/Mh7qiSRk
         rbyb9tE1M2c/q9e5ktmfo/oyhVwb3xP8FRqJ8O/XNvBFPXNgfLRfxzZPysC6pDcVak9y
         az4w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192326; x=1690797126;
        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=qeaWGlGrVDaX2KSqXlTQooW5ZfkYFYzGyaP55BE4cnU=;
        b=HP82YklTm50jJHyGQNsSGYjY8kQiOHI2kW8n5PrcPn2/dbbVATMxZal8gPqBoA7/cK
         MTU5qToYBN3jELQi73liDrCYDkh/2r/2rYKNNyru0EjUwXafUkKNf/AQeRiJ0x92TqNJ
         brTC5+ZgYbSs0o3zrpGNPiyLWtf4bv144uw3WbHNWtSbbmRH03UXhwTo3RVebW79p8N3
         qbCYomNHbcgnvnRRBcTtv7V2vrWXubr8QTo+IJo9hw82+kyAOUOGHo6zbLHyk2vSbwnJ
         A/tR1ofbyhAZCRnqZ42LL2iKeZwcwIlykMu3yyaHQ5mP+0WCQnI6IwZIlxHk+T1wupkN
         cGvw==
X-Gm-Message-State: ABy/qLZL65L7sypck6K9Y0ddcs81CpNL+P3KDgdmrM0se3rs3F7pRRa4
	BsBhWR4wDr3V/T7K8esD800qtQ==
X-Google-Smtp-Source: APBJJlEv/cxcU4CX85hgEplaAz1eX7+5tW063l2dwuRz+2PjFKejJ2gbKnkgXcFETviQG8sX+JGIQQ==
X-Received: by 2002:a17:902:ecce:b0:1b8:b55d:4cff with SMTP id a14-20020a170902ecce00b001b8b55d4cffmr12430579plh.2.1690192326485;
        Mon, 24 Jul 2023 02:52:06 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Chuck Lever <chuck.lever@oracle.com>
Subject: [PATCH v2 35/47] nfsd: dynamically allocate the nfsd-reply shrinker
Date: Mon, 24 Jul 2023 17:43:42 +0800
Message-Id: <20230724094354.90817-36-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the nfsd-reply shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct nfsd_net.

Acked-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/nfsd/netns.h    |  2 +-
 fs/nfsd/nfscache.c | 31 ++++++++++++++++---------------
 2 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h
index f669444d5336..ab303a8b77d5 100644
--- a/fs/nfsd/netns.h
+++ b/fs/nfsd/netns.h
@@ -177,7 +177,7 @@ struct nfsd_net {
 	/* size of cache when we saw the longest hash chain */
 	unsigned int             longest_chain_cachesize;
 
-	struct shrinker		nfsd_reply_cache_shrinker;
+	struct shrinker		*nfsd_reply_cache_shrinker;
 
 	/* tracking server-to-server copy mounts */
 	spinlock_t              nfsd_ssc_lock;
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index 6eb3d7bdfaf3..9f0ab65e4125 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -200,26 +200,29 @@ int nfsd_reply_cache_init(struct nfsd_net *nn)
 {
 	unsigned int hashsize;
 	unsigned int i;
-	int status = 0;
 
 	nn->max_drc_entries = nfsd_cache_size_limit();
 	atomic_set(&nn->num_drc_entries, 0);
 	hashsize = nfsd_hashsize(nn->max_drc_entries);
 	nn->maskbits = ilog2(hashsize);
 
-	nn->nfsd_reply_cache_shrinker.scan_objects = nfsd_reply_cache_scan;
-	nn->nfsd_reply_cache_shrinker.count_objects = nfsd_reply_cache_count;
-	nn->nfsd_reply_cache_shrinker.seeks = 1;
-	status = register_shrinker(&nn->nfsd_reply_cache_shrinker,
-				   "nfsd-reply:%s", nn->nfsd_name);
-	if (status)
-		return status;
-
 	nn->drc_hashtbl = kvzalloc(array_size(hashsize,
 				sizeof(*nn->drc_hashtbl)), GFP_KERNEL);
 	if (!nn->drc_hashtbl)
+		return -ENOMEM;
+
+	nn->nfsd_reply_cache_shrinker = shrinker_alloc(0, "nfsd-reply:%s",
+						       nn->nfsd_name);
+	if (!nn->nfsd_reply_cache_shrinker)
 		goto out_shrinker;
 
+	nn->nfsd_reply_cache_shrinker->scan_objects = nfsd_reply_cache_scan;
+	nn->nfsd_reply_cache_shrinker->count_objects = nfsd_reply_cache_count;
+	nn->nfsd_reply_cache_shrinker->seeks = 1;
+	nn->nfsd_reply_cache_shrinker->private_data = nn;
+
+	shrinker_register(nn->nfsd_reply_cache_shrinker);
+
 	for (i = 0; i < hashsize; i++) {
 		INIT_LIST_HEAD(&nn->drc_hashtbl[i].lru_head);
 		spin_lock_init(&nn->drc_hashtbl[i].cache_lock);
@@ -228,7 +231,7 @@ int nfsd_reply_cache_init(struct nfsd_net *nn)
 
 	return 0;
 out_shrinker:
-	unregister_shrinker(&nn->nfsd_reply_cache_shrinker);
+	kvfree(nn->drc_hashtbl);
 	printk(KERN_ERR "nfsd: failed to allocate reply cache\n");
 	return -ENOMEM;
 }
@@ -238,7 +241,7 @@ void nfsd_reply_cache_shutdown(struct nfsd_net *nn)
 	struct nfsd_cacherep *rp;
 	unsigned int i;
 
-	unregister_shrinker(&nn->nfsd_reply_cache_shrinker);
+	shrinker_unregister(nn->nfsd_reply_cache_shrinker);
 
 	for (i = 0; i < nn->drc_hashsize; i++) {
 		struct list_head *head = &nn->drc_hashtbl[i].lru_head;
@@ -322,8 +325,7 @@ nfsd_prune_bucket_locked(struct nfsd_net *nn, struct nfsd_drc_bucket *b,
 static unsigned long
 nfsd_reply_cache_count(struct shrinker *shrink, struct shrink_control *sc)
 {
-	struct nfsd_net *nn = container_of(shrink,
-				struct nfsd_net, nfsd_reply_cache_shrinker);
+	struct nfsd_net *nn = shrink->private_data;
 
 	return atomic_read(&nn->num_drc_entries);
 }
@@ -342,8 +344,7 @@ nfsd_reply_cache_count(struct shrinker *shrink, struct shrink_control *sc)
 static unsigned long
 nfsd_reply_cache_scan(struct shrinker *shrink, struct shrink_control *sc)
 {
-	struct nfsd_net *nn = container_of(shrink,
-				struct nfsd_net, nfsd_reply_cache_shrinker);
+	struct nfsd_net *nn = shrink->private_data;
 	unsigned long freed = 0;
 	LIST_HEAD(dispose);
 	unsigned int i;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:53:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:53:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568611.888233 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsFm-0008E1-Gg; Mon, 24 Jul 2023 09:53:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568611.888233; Mon, 24 Jul 2023 09:53:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsFm-0008Du-Dh; Mon, 24 Jul 2023 09:53:22 +0000
Received: by outflank-mailman (input) for mailman id 568611;
 Mon, 24 Jul 2023 09:53:21 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsFl-0008Df-03
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:53:21 +0000
Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com
 [2607:f8b0:4864:20::635])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ea70e696-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:53:19 +0200 (CEST)
Received: by mail-pl1-x635.google.com with SMTP id
 d9443c01a7336-1bba9539a23so650585ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:53:19 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.53.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:53:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ea70e696-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192397; x=1690797197;
        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=Au95b59SE4lLb756TrNLGg7HOLC+u2MQAxdqgGCdIqg=;
        b=K/Vgei3KlPsrXtA3sEF6+yHtbBxZ+2xZx/x+lBMlIuJBg5AnMueb22TLJhFLNiGhrq
         XJ8rDff4cQLwPHBXyitYUyzJQ81uMlYuNrno/Yl2XPJ7mTqFwwu7vFn1NdgAzfOHqVdn
         II5+ILOauNsftf4HvRNlKd/NnPVQUMPzyMjlj4GtICaEBVuEkL6UBECCLrorLxVLl8kL
         HJxsj9ZJ8Jk/tR9LKuJiVmnd+Nmc0TutmJdqhqBde7M5Kr8oXqnp3FCO2erCLDx6b0DB
         5WEy+sbIcGffcYABxBhgHvq3vNRdUv2ziojVQWEW08nOSj8tZ15Bpl4cXIKs8nuuGoel
         I/Kg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192397; x=1690797197;
        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=Au95b59SE4lLb756TrNLGg7HOLC+u2MQAxdqgGCdIqg=;
        b=l9hvp3HOm3vuLPzC12ZxclvpVwkElc9uAWQOgQRtOCbCvnco905OBjIpEvGi5Fu2ul
         qGI3F6vuTJnOpDVv6wnT9LMFDFvGGWBSv+8lBAJzRqoRRqi9bh+zOyDn6GDKW+qvCdeJ
         FT7I6NzsEDltQMR+l1N9yaT878j63LCvjz4CAjfQhKF7hVQfgJ3f77WKe0IQfOq5TnMi
         OSKr57AL760+lvQ36RmKBUU0bJGVPQct68gwQexqFuND/G+uJNjollQ7U1RPWTEcoi6B
         +RK6yFok4KHjzzRhtk5nJsF2nipOvOIq/7lciF7/Ny9JKzdpzh4EIPRgVZw0mUwY4boD
         H8JQ==
X-Gm-Message-State: ABy/qLYXjRFrnfIHKxWg4+wU7AgsAlMey0dKMR2MGgwoULG+WhDIrmmK
	vu9yYAoFUkHz1WuengnnPm5D6w==
X-Google-Smtp-Source: APBJJlHskHW5r0IhvtSXxnBFmiqfwZejMZbjxfsN1oQLUQ3K2J0HHv3xxnfIpcyIc5BfLUakmxAnBw==
X-Received: by 2002:a17:902:e802:b0:1b3:d4bb:3515 with SMTP id u2-20020a170902e80200b001b3d4bb3515mr12393256plg.0.1690192397637;
        Mon, 24 Jul 2023 02:53:17 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 41/47] mm: shrinker: remove old APIs
Date: Mon, 24 Jul 2023 17:43:48 +0800
Message-Id: <20230724094354.90817-42-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Now no users are using the old APIs, just remove them.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 include/linux/shrinker.h |   7 --
 mm/shrinker.c            | 143 ---------------------------------------
 2 files changed, 150 deletions(-)

diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
index 296f5e163861..e464b4e9be0e 100644
--- a/include/linux/shrinker.h
+++ b/include/linux/shrinker.h
@@ -105,13 +105,6 @@ void shrinker_free_non_registered(struct shrinker *shrinker);
 void shrinker_register(struct shrinker *shrinker);
 void shrinker_unregister(struct shrinker *shrinker);
 
-extern int __printf(2, 3) prealloc_shrinker(struct shrinker *shrinker,
-					    const char *fmt, ...);
-extern void register_shrinker_prepared(struct shrinker *shrinker);
-extern int __printf(2, 3) register_shrinker(struct shrinker *shrinker,
-					    const char *fmt, ...);
-extern void unregister_shrinker(struct shrinker *shrinker);
-extern void free_prealloced_shrinker(struct shrinker *shrinker);
 extern void synchronize_shrinkers(void);
 
 #ifdef CONFIG_SHRINKER_DEBUG
diff --git a/mm/shrinker.c b/mm/shrinker.c
index d820e4cc5806..2f3635ad1b45 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -661,149 +661,6 @@ void shrinker_unregister(struct shrinker *shrinker)
 }
 EXPORT_SYMBOL(shrinker_unregister);
 
-/*
- * Add a shrinker callback to be called from the vm.
- */
-static int __prealloc_shrinker(struct shrinker *shrinker)
-{
-	unsigned int size;
-	int err;
-
-	if (shrinker->flags & SHRINKER_MEMCG_AWARE) {
-		err = prealloc_memcg_shrinker(shrinker);
-		if (err != -ENOSYS)
-			return err;
-
-		shrinker->flags &= ~SHRINKER_MEMCG_AWARE;
-	}
-
-	size = sizeof(*shrinker->nr_deferred);
-	if (shrinker->flags & SHRINKER_NUMA_AWARE)
-		size *= nr_node_ids;
-
-	shrinker->nr_deferred = kzalloc(size, GFP_KERNEL);
-	if (!shrinker->nr_deferred)
-		return -ENOMEM;
-
-	return 0;
-}
-
-#ifdef CONFIG_SHRINKER_DEBUG
-int prealloc_shrinker(struct shrinker *shrinker, const char *fmt, ...)
-{
-	va_list ap;
-	int err;
-
-	va_start(ap, fmt);
-	shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
-	va_end(ap);
-	if (!shrinker->name)
-		return -ENOMEM;
-
-	err = __prealloc_shrinker(shrinker);
-	if (err) {
-		kfree_const(shrinker->name);
-		shrinker->name = NULL;
-	}
-
-	return err;
-}
-#else
-int prealloc_shrinker(struct shrinker *shrinker, const char *fmt, ...)
-{
-	return __prealloc_shrinker(shrinker);
-}
-#endif
-
-void free_prealloced_shrinker(struct shrinker *shrinker)
-{
-#ifdef CONFIG_SHRINKER_DEBUG
-	kfree_const(shrinker->name);
-	shrinker->name = NULL;
-#endif
-	if (shrinker->flags & SHRINKER_MEMCG_AWARE) {
-		down_write(&shrinker_rwsem);
-		unregister_memcg_shrinker(shrinker);
-		up_write(&shrinker_rwsem);
-		return;
-	}
-
-	kfree(shrinker->nr_deferred);
-	shrinker->nr_deferred = NULL;
-}
-
-void register_shrinker_prepared(struct shrinker *shrinker)
-{
-	down_write(&shrinker_rwsem);
-	list_add_tail(&shrinker->list, &shrinker_list);
-	shrinker->flags |= SHRINKER_REGISTERED;
-	shrinker_debugfs_add(shrinker);
-	up_write(&shrinker_rwsem);
-}
-
-static int __register_shrinker(struct shrinker *shrinker)
-{
-	int err = __prealloc_shrinker(shrinker);
-
-	if (err)
-		return err;
-	register_shrinker_prepared(shrinker);
-	return 0;
-}
-
-#ifdef CONFIG_SHRINKER_DEBUG
-int register_shrinker(struct shrinker *shrinker, const char *fmt, ...)
-{
-	va_list ap;
-	int err;
-
-	va_start(ap, fmt);
-	shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
-	va_end(ap);
-	if (!shrinker->name)
-		return -ENOMEM;
-
-	err = __register_shrinker(shrinker);
-	if (err) {
-		kfree_const(shrinker->name);
-		shrinker->name = NULL;
-	}
-	return err;
-}
-#else
-int register_shrinker(struct shrinker *shrinker, const char *fmt, ...)
-{
-	return __register_shrinker(shrinker);
-}
-#endif
-EXPORT_SYMBOL(register_shrinker);
-
-/*
- * Remove one
- */
-void unregister_shrinker(struct shrinker *shrinker)
-{
-	struct dentry *debugfs_entry;
-	int debugfs_id;
-
-	if (!(shrinker->flags & SHRINKER_REGISTERED))
-		return;
-
-	down_write(&shrinker_rwsem);
-	list_del(&shrinker->list);
-	shrinker->flags &= ~SHRINKER_REGISTERED;
-	if (shrinker->flags & SHRINKER_MEMCG_AWARE)
-		unregister_memcg_shrinker(shrinker);
-	debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);
-	up_write(&shrinker_rwsem);
-
-	shrinker_debugfs_remove(debugfs_entry, debugfs_id);
-
-	kfree(shrinker->nr_deferred);
-	shrinker->nr_deferred = NULL;
-}
-EXPORT_SYMBOL(unregister_shrinker);
-
 /**
  * synchronize_shrinkers - Wait for all running shrinkers to complete.
  *
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:53:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:53:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568612.888243 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsFx-00007O-O9; Mon, 24 Jul 2023 09:53:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568612.888243; Mon, 24 Jul 2023 09:53:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsFx-00007H-LI; Mon, 24 Jul 2023 09:53:33 +0000
Received: by outflank-mailman (input) for mailman id 568612;
 Mon, 24 Jul 2023 09:53:32 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsFw-0008Df-Ik
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:53:32 +0000
Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com
 [2607:f8b0:4864:20::52e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f17c9d9b-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:53:30 +0200 (CEST)
Received: by mail-pg1-x52e.google.com with SMTP id
 41be03b00d2f7-51f64817809so328536a12.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:53:30 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.53.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:53:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f17c9d9b-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192409; x=1690797209;
        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=tgz3Agis5n4s/WxjwmGNRU8p70ZOSlVCE9Y6IFYv5Fc=;
        b=eiUPUGpded6z/EEpZ8kcBg2OU6CGo1gYbzczLwywLM+tiNX7NfxZ/UX56b+ECXWGVH
         v0+fBr9ZR2zpMAlXtEMsjJ0CP0T6ghJOZlIp4XvJRpj8mBoc0pWtxFqlQOAd5pU8ho3C
         /ZF88/qParVm3q/t2C5C9G6TKSIcK6iTaJcqE2ic3WbFUt7IFInWBxxki/5fOt9V+TbB
         A3A3KxQQy8HhELpvIDxSXQyR+9LFYaXi6y1sjrAoM0XnjPHdW4Yjr/fiDUUV6qlqOpNO
         kBdOBkmF9qj5RcGgCCau8brZhsZui1mwOYvY6Yl7YB6A8sVwNtEK8JeAfRs7jSuBenIO
         iXvw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192409; x=1690797209;
        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=tgz3Agis5n4s/WxjwmGNRU8p70ZOSlVCE9Y6IFYv5Fc=;
        b=NdOcQ2p0jkYkGgZibq91tH/E6rTeXAkGRVR6kJGySFnf3vEnXZiCzXuFo0D0+KtCAd
         aEMjplVgWgcQo0ui+etkf+mCMg59IDbtkPN27uE1qBXURM2EE7CVqFh4OyDIbBomc4Wu
         4tDsMnqA0su2+gMw2d1xOXpatSzHm2SwK2+8f2t9N6Uy0Ciq6D1NMW/AWOl1XSt8iDMT
         hnJUAzvNO2Wpe+1g56fOqiYT1IwQLOrX6LEa4P2+DiWL0Y7dqJDYThU2kn7ayax3hqg8
         DjzB9DLKpYKXHiUOYRjNnEyw4PwOytU4QR1PyARFsl0eLVqxe85QVfyw/VDux9dfnEw9
         aeKQ==
X-Gm-Message-State: ABy/qLYe31KTrSUC8zi2YRWhx5jXscQEp45M58rXG9j4YtctFEYDPe+d
	trkZu/OVHdX45II8brFRTluNDA==
X-Google-Smtp-Source: APBJJlGQECD+YmQyidx3CbYp8mtos2ukz3b+adApuBRwpx+yQP4R50i+1wYRdDRgYwf/0cvAmnpMMg==
X-Received: by 2002:a17:902:f681:b0:1b8:a469:53d8 with SMTP id l1-20020a170902f68100b001b8a46953d8mr12732513plg.0.1690192409468;
        Mon, 24 Jul 2023 02:53:29 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 42/47] drm/ttm: introduce pool_shrink_rwsem
Date: Mon, 24 Jul 2023 17:43:49 +0800
Message-Id: <20230724094354.90817-43-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Currently, the synchronize_shrinkers() is only used by TTM pool. It only
requires that no shrinkers run in parallel.

After we use RCU+refcount method to implement the lockless slab shrink,
we can not use shrinker_rwsem or synchronize_rcu() to guarantee that all
shrinker invocations have seen an update before freeing memory.

So we introduce a new pool_shrink_rwsem to implement a private
synchronize_shrinkers(), so as to achieve the same purpose.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 drivers/gpu/drm/ttm/ttm_pool.c | 15 +++++++++++++++
 include/linux/shrinker.h       |  2 --
 mm/shrinker.c                  | 15 ---------------
 3 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
index e1eb73d0b72a..8a35fd48ec46 100644
--- a/drivers/gpu/drm/ttm/ttm_pool.c
+++ b/drivers/gpu/drm/ttm/ttm_pool.c
@@ -74,6 +74,7 @@ static struct ttm_pool_type global_dma32_uncached[MAX_ORDER + 1];
 static spinlock_t shrinker_lock;
 static struct list_head shrinker_list;
 static struct shrinker *mm_shrinker;
+static DECLARE_RWSEM(pool_shrink_rwsem);
 
 /* Allocate pages of size 1 << order with the given gfp_flags */
 static struct page *ttm_pool_alloc_page(struct ttm_pool *pool, gfp_t gfp_flags,
@@ -317,6 +318,7 @@ static unsigned int ttm_pool_shrink(void)
 	unsigned int num_pages;
 	struct page *p;
 
+	down_read(&pool_shrink_rwsem);
 	spin_lock(&shrinker_lock);
 	pt = list_first_entry(&shrinker_list, typeof(*pt), shrinker_list);
 	list_move_tail(&pt->shrinker_list, &shrinker_list);
@@ -329,6 +331,7 @@ static unsigned int ttm_pool_shrink(void)
 	} else {
 		num_pages = 0;
 	}
+	up_read(&pool_shrink_rwsem);
 
 	return num_pages;
 }
@@ -572,6 +575,18 @@ void ttm_pool_init(struct ttm_pool *pool, struct device *dev,
 }
 EXPORT_SYMBOL(ttm_pool_init);
 
+/**
+ * synchronize_shrinkers - Wait for all running shrinkers to complete.
+ *
+ * This is useful to guarantee that all shrinker invocations have seen an
+ * update, before freeing memory, similar to rcu.
+ */
+static void synchronize_shrinkers(void)
+{
+	down_write(&pool_shrink_rwsem);
+	up_write(&pool_shrink_rwsem);
+}
+
 /**
  * ttm_pool_fini - Cleanup a pool
  *
diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
index e464b4e9be0e..23ea9360c5d8 100644
--- a/include/linux/shrinker.h
+++ b/include/linux/shrinker.h
@@ -105,8 +105,6 @@ void shrinker_free_non_registered(struct shrinker *shrinker);
 void shrinker_register(struct shrinker *shrinker);
 void shrinker_unregister(struct shrinker *shrinker);
 
-extern void synchronize_shrinkers(void);
-
 #ifdef CONFIG_SHRINKER_DEBUG
 extern int shrinker_debugfs_add(struct shrinker *shrinker);
 extern struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
diff --git a/mm/shrinker.c b/mm/shrinker.c
index 2f3635ad1b45..3c4d3fe2fa17 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -660,18 +660,3 @@ void shrinker_unregister(struct shrinker *shrinker)
 	kfree(shrinker);
 }
 EXPORT_SYMBOL(shrinker_unregister);
-
-/**
- * synchronize_shrinkers - Wait for all running shrinkers to complete.
- *
- * This is equivalent to calling unregister_shrink() and register_shrinker(),
- * but atomically and with less overhead. This is useful to guarantee that all
- * shrinker invocations have seen an update, before freeing memory, similar to
- * rcu.
- */
-void synchronize_shrinkers(void)
-{
-	down_write(&shrinker_rwsem);
-	up_write(&shrinker_rwsem);
-}
-EXPORT_SYMBOL(synchronize_shrinkers);
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:53:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:53:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568613.888253 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsGA-0000eY-WC; Mon, 24 Jul 2023 09:53:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568613.888253; Mon, 24 Jul 2023 09:53:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsGA-0000eP-TA; Mon, 24 Jul 2023 09:53:46 +0000
Received: by outflank-mailman (input) for mailman id 568613;
 Mon, 24 Jul 2023 09:53:45 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsG9-0008Df-E4
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:53:45 +0000
Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com
 [2607:f8b0:4864:20::633])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f8967be4-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:53:42 +0200 (CEST)
Received: by mail-pl1-x633.google.com with SMTP id
 d9443c01a7336-1bb91c20602so2236035ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:53:42 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.53.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:53:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f8967be4-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192421; x=1690797221;
        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=6ldGbVJmWFW3GnmiCRXjaV59N76MCfDcOlWufUCYnHU=;
        b=LP3XX3yvpoIadeMP368Vuuqayp4Ta/i1BL9FbOlpyXFC9Jth7YxMBoCJEisaQr+grg
         3RWigoM4pV8g1a44IoOjwdIfgyJeWnyMb+ac5HTGz60msj5A9lsKk39jUryOOABgsj6q
         NRZKPOQWfuNoIfZARwTwwR3jzsikriSk/yIuSKlxTW1FOKloFG2U7Q2213CsfZ1x3ay5
         Csiz7ykGZOw0ljM7V9gidgbk1QL4ELxkt+HpUHKCgXWWmsWCFACQiTx5nvDM48ITzc/6
         8FMpz8IkrvxUJpC+bPFHWVmg1zaiQp6UYtoLTk9ZWDMKIwxkwIFj9i5pdjmxt0VAo5YN
         w3Iw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192421; x=1690797221;
        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=6ldGbVJmWFW3GnmiCRXjaV59N76MCfDcOlWufUCYnHU=;
        b=gD8oHGWbyMbtYqTGNg/GZHTiVl/8xmyx+ThL+kTaDx/Ede3OzHMQpp0Lvc2yL2jXM9
         iYGaIKeHKimWI+P15pYByu/Vw7Oqk4l2ehvAsPI0ZJLluuUBKq2lnUcu/0iD1YackZKr
         UypE7IAV0APfFvy1eOH4dC+xQ8CJrVw8pbZ0AgQCcdMZI0CZG/nhFBm84pgG/cLEg/gT
         9ITDbddrjDFwvkwJGoAEGZ9wLiwZTIo2cO99w+AZxS0xqdebIq/qE+JgF6fGlbHZzvte
         jvaV0aU1LjKBBnq8ZuPAy3xoEpuqGnEru/WS7Bs+cfQh3ucv35q3VV6KkMo3EEcGbrQ2
         WPrw==
X-Gm-Message-State: ABy/qLYfDxvy37R6xBZA32mvJxjVi7I2hNc6lIgTZn7tBa1CS6z7g1O3
	NKNGt+gUjhDX7qur9ZqeokRG8w==
X-Google-Smtp-Source: APBJJlGryO879V9BaBQDHKX8zWib3yCjxEUuCoHfosN5ailAJ/cPY/8UIz/oHWPeLcNN21dHKE1QRw==
X-Received: by 2002:a17:902:ea01:b0:1bb:83ec:832 with SMTP id s1-20020a170902ea0100b001bb83ec0832mr8344187plg.2.1690192421320;
        Mon, 24 Jul 2023 02:53:41 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 43/47] mm: shrinker: add a secondary array for shrinker_info::{map, nr_deferred}
Date: Mon, 24 Jul 2023 17:43:50 +0800
Message-Id: <20230724094354.90817-44-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Currently, we maintain two linear arrays per node per memcg, which are
shrinker_info::map and shrinker_info::nr_deferred. And we need to resize
them when the shrinker_nr_max is exceeded, that is, allocate a new array,
and then copy the old array to the new array, and finally free the old
array by RCU.

For shrinker_info::map, we do set_bit() under the RCU lock, so we may set
the value into the old map which is about to be freed. This may cause the
value set to be lost. The current solution is not to copy the old map when
resizing, but to set all the corresponding bits in the new map to 1. This
solves the data loss problem, but bring the overhead of more pointless
loops while doing memcg slab shrink.

For shrinker_info::nr_deferred, we will only modify it under the read lock
of shrinker_rwsem, so it will not run concurrently with the resizing. But
after we make memcg slab shrink lockless, there will be the same data loss
problem as shrinker_info::map, and we can't work around it like the map.

For such resizable arrays, the most straightforward idea is to change it
to xarray, like we did for list_lru [1]. We need to do xa_store() in the
list_lru_add()-->set_shrinker_bit(), but this will cause memory
allocation, and the list_lru_add() doesn't accept failure. A possible
solution is to pre-allocate, but the location of pre-allocation is not
well determined.

Therefore, this commit chooses to introduce a secondary array for
shrinker_info::{map, nr_deferred}, so that we only need to copy this
secondary array every time the size is resized. Then even if we get the
old secondary array under the RCU lock, the found map and nr_deferred are
also true, so no data is lost.

[1]. https://lore.kernel.org/all/20220228122126.37293-13-songmuchun@bytedance.com/

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 include/linux/memcontrol.h |  12 +-
 include/linux/shrinker.h   |  17 +++
 mm/shrinker.c              | 250 +++++++++++++++++++++++--------------
 3 files changed, 172 insertions(+), 107 deletions(-)

diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 58eb7ca65699..1a2e9d15822d 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -21,6 +21,7 @@
 #include <linux/vmstat.h>
 #include <linux/writeback.h>
 #include <linux/page-flags.h>
+#include <linux/shrinker.h>
 
 struct mem_cgroup;
 struct obj_cgroup;
@@ -88,17 +89,6 @@ struct mem_cgroup_reclaim_iter {
 	unsigned int generation;
 };
 
-/*
- * Bitmap and deferred work of shrinker::id corresponding to memcg-aware
- * shrinkers, which have elements charged to this memcg.
- */
-struct shrinker_info {
-	struct rcu_head rcu;
-	atomic_long_t *nr_deferred;
-	unsigned long *map;
-	int map_nr_max;
-};
-
 struct lruvec_stats_percpu {
 	/* Local (CPU and cgroup) state */
 	long state[NR_VM_NODE_STAT_ITEMS];
diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
index 23ea9360c5d8..36977a70bebb 100644
--- a/include/linux/shrinker.h
+++ b/include/linux/shrinker.h
@@ -5,6 +5,23 @@
 #include <linux/atomic.h>
 #include <linux/types.h>
 
+#define SHRINKER_UNIT_BITS	BITS_PER_LONG
+
+/*
+ * Bitmap and deferred work of shrinker::id corresponding to memcg-aware
+ * shrinkers, which have elements charged to the memcg.
+ */
+struct shrinker_info_unit {
+	atomic_long_t nr_deferred[SHRINKER_UNIT_BITS];
+	DECLARE_BITMAP(map, SHRINKER_UNIT_BITS);
+};
+
+struct shrinker_info {
+	struct rcu_head rcu;
+	int map_nr_max;
+	struct shrinker_info_unit *unit[];
+};
+
 /*
  * This struct is used to pass information from page reclaim to the shrinkers.
  * We consolidate the values for easier extension later.
diff --git a/mm/shrinker.c b/mm/shrinker.c
index 3c4d3fe2fa17..8a1fe844f1a4 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -10,15 +10,50 @@ DECLARE_RWSEM(shrinker_rwsem);
 #ifdef CONFIG_MEMCG
 static int shrinker_nr_max;
 
-/* The shrinker_info is expanded in a batch of BITS_PER_LONG */
-static inline int shrinker_map_size(int nr_items)
+static inline int shrinker_unit_size(int nr_items)
 {
-	return (DIV_ROUND_UP(nr_items, BITS_PER_LONG) * sizeof(unsigned long));
+	return (DIV_ROUND_UP(nr_items, SHRINKER_UNIT_BITS) * sizeof(struct shrinker_info_unit *));
 }
 
-static inline int shrinker_defer_size(int nr_items)
+static inline void shrinker_unit_free(struct shrinker_info *info, int start)
 {
-	return (round_up(nr_items, BITS_PER_LONG) * sizeof(atomic_long_t));
+	struct shrinker_info_unit **unit;
+	int nr, i;
+
+	if (!info)
+		return;
+
+	unit = info->unit;
+	nr = DIV_ROUND_UP(info->map_nr_max, SHRINKER_UNIT_BITS);
+
+	for (i = start; i < nr; i++) {
+		if (!unit[i])
+			break;
+
+		kvfree(unit[i]);
+		unit[i] = NULL;
+	}
+}
+
+static inline int shrinker_unit_alloc(struct shrinker_info *new,
+				       struct shrinker_info *old, int nid)
+{
+	struct shrinker_info_unit *unit;
+	int nr = DIV_ROUND_UP(new->map_nr_max, SHRINKER_UNIT_BITS);
+	int start = old ? DIV_ROUND_UP(old->map_nr_max, SHRINKER_UNIT_BITS) : 0;
+	int i;
+
+	for (i = start; i < nr; i++) {
+		unit = kvzalloc_node(sizeof(*unit), GFP_KERNEL, nid);
+		if (!unit) {
+			shrinker_unit_free(new, start);
+			return -ENOMEM;
+		}
+
+		new->unit[i] = unit;
+	}
+
+	return 0;
 }
 
 void free_shrinker_info(struct mem_cgroup *memcg)
@@ -30,6 +65,7 @@ void free_shrinker_info(struct mem_cgroup *memcg)
 	for_each_node(nid) {
 		pn = memcg->nodeinfo[nid];
 		info = rcu_dereference_protected(pn->shrinker_info, true);
+		shrinker_unit_free(info, 0);
 		kvfree(info);
 		rcu_assign_pointer(pn->shrinker_info, NULL);
 	}
@@ -38,28 +74,27 @@ void free_shrinker_info(struct mem_cgroup *memcg)
 int alloc_shrinker_info(struct mem_cgroup *memcg)
 {
 	struct shrinker_info *info;
-	int nid, size, ret = 0;
-	int map_size, defer_size = 0;
+	int nid, ret = 0;
+	int array_size = 0;
 
 	down_write(&shrinker_rwsem);
-	map_size = shrinker_map_size(shrinker_nr_max);
-	defer_size = shrinker_defer_size(shrinker_nr_max);
-	size = map_size + defer_size;
+	array_size = shrinker_unit_size(shrinker_nr_max);
 	for_each_node(nid) {
-		info = kvzalloc_node(sizeof(*info) + size, GFP_KERNEL, nid);
-		if (!info) {
-			free_shrinker_info(memcg);
-			ret = -ENOMEM;
-			break;
-		}
-		info->nr_deferred = (atomic_long_t *)(info + 1);
-		info->map = (void *)info->nr_deferred + defer_size;
+		info = kvzalloc_node(sizeof(*info) + array_size, GFP_KERNEL, nid);
+		if (!info)
+			goto err;
 		info->map_nr_max = shrinker_nr_max;
+		if (shrinker_unit_alloc(info, NULL, nid))
+			goto err;
 		rcu_assign_pointer(memcg->nodeinfo[nid]->shrinker_info, info);
 	}
 	up_write(&shrinker_rwsem);
 
 	return ret;
+
+err:
+	free_shrinker_info(memcg);
+	return -ENOMEM;
 }
 
 static struct shrinker_info *shrinker_info_protected(struct mem_cgroup *memcg,
@@ -69,15 +104,12 @@ static struct shrinker_info *shrinker_info_protected(struct mem_cgroup *memcg,
 					 lockdep_is_held(&shrinker_rwsem));
 }
 
-static int expand_one_shrinker_info(struct mem_cgroup *memcg,
-				    int map_size, int defer_size,
-				    int old_map_size, int old_defer_size,
-				    int new_nr_max)
+static int expand_one_shrinker_info(struct mem_cgroup *memcg, int new_size,
+				    int old_size, int new_nr_max)
 {
 	struct shrinker_info *new, *old;
 	struct mem_cgroup_per_node *pn;
 	int nid;
-	int size = map_size + defer_size;
 
 	for_each_node(nid) {
 		pn = memcg->nodeinfo[nid];
@@ -90,21 +122,18 @@ static int expand_one_shrinker_info(struct mem_cgroup *memcg,
 		if (new_nr_max <= old->map_nr_max)
 			continue;
 
-		new = kvmalloc_node(sizeof(*new) + size, GFP_KERNEL, nid);
+		new = kvmalloc_node(sizeof(*new) + new_size, GFP_KERNEL, nid);
 		if (!new)
 			return -ENOMEM;
 
-		new->nr_deferred = (atomic_long_t *)(new + 1);
-		new->map = (void *)new->nr_deferred + defer_size;
 		new->map_nr_max = new_nr_max;
 
-		/* map: set all old bits, clear all new bits */
-		memset(new->map, (int)0xff, old_map_size);
-		memset((void *)new->map + old_map_size, 0, map_size - old_map_size);
-		/* nr_deferred: copy old values, clear all new values */
-		memcpy(new->nr_deferred, old->nr_deferred, old_defer_size);
-		memset((void *)new->nr_deferred + old_defer_size, 0,
-		       defer_size - old_defer_size);
+		/* copy old values, allocate all new values */
+		memcpy(new->unit, old->unit, old_size);
+		if (shrinker_unit_alloc(new, old, nid)) {
+			kvfree(new);
+			return -ENOMEM;
+		}
 
 		rcu_assign_pointer(pn->shrinker_info, new);
 		kvfree_rcu(old, rcu);
@@ -116,9 +145,8 @@ static int expand_one_shrinker_info(struct mem_cgroup *memcg,
 static int expand_shrinker_info(int new_id)
 {
 	int ret = 0;
-	int new_nr_max = round_up(new_id + 1, BITS_PER_LONG);
-	int map_size, defer_size = 0;
-	int old_map_size, old_defer_size = 0;
+	int new_nr_max = round_up(new_id + 1, SHRINKER_UNIT_BITS);
+	int new_size, old_size = 0;
 	struct mem_cgroup *memcg;
 
 	if (!root_mem_cgroup)
@@ -126,15 +154,12 @@ static int expand_shrinker_info(int new_id)
 
 	lockdep_assert_held(&shrinker_rwsem);
 
-	map_size = shrinker_map_size(new_nr_max);
-	defer_size = shrinker_defer_size(new_nr_max);
-	old_map_size = shrinker_map_size(shrinker_nr_max);
-	old_defer_size = shrinker_defer_size(shrinker_nr_max);
+	new_size = shrinker_unit_size(new_nr_max);
+	old_size = shrinker_unit_size(shrinker_nr_max);
 
 	memcg = mem_cgroup_iter(NULL, NULL, NULL);
 	do {
-		ret = expand_one_shrinker_info(memcg, map_size, defer_size,
-					       old_map_size, old_defer_size,
+		ret = expand_one_shrinker_info(memcg, new_size, old_size,
 					       new_nr_max);
 		if (ret) {
 			mem_cgroup_iter_break(NULL, memcg);
@@ -148,17 +173,34 @@ static int expand_shrinker_info(int new_id)
 	return ret;
 }
 
+static inline int shriner_id_to_index(int shrinker_id)
+{
+	return shrinker_id / SHRINKER_UNIT_BITS;
+}
+
+static inline int shriner_id_to_offset(int shrinker_id)
+{
+	return shrinker_id % SHRINKER_UNIT_BITS;
+}
+
+static inline int calc_shrinker_id(int index, int offset)
+{
+	return index * SHRINKER_UNIT_BITS + offset;
+}
+
 void set_shrinker_bit(struct mem_cgroup *memcg, int nid, int shrinker_id)
 {
 	if (shrinker_id >= 0 && memcg && !mem_cgroup_is_root(memcg)) {
 		struct shrinker_info *info;
+		struct shrinker_info_unit *unit;
 
 		rcu_read_lock();
 		info = rcu_dereference(memcg->nodeinfo[nid]->shrinker_info);
+		unit = info->unit[shriner_id_to_index(shrinker_id)];
 		if (!WARN_ON_ONCE(shrinker_id >= info->map_nr_max)) {
 			/* Pairs with smp mb in shrink_slab() */
 			smp_mb__before_atomic();
-			set_bit(shrinker_id, info->map);
+			set_bit(shriner_id_to_offset(shrinker_id), unit->map);
 		}
 		rcu_read_unlock();
 	}
@@ -207,26 +249,31 @@ static long xchg_nr_deferred_memcg(int nid, struct shrinker *shrinker,
 				   struct mem_cgroup *memcg)
 {
 	struct shrinker_info *info;
+	struct shrinker_info_unit *unit;
 
 	info = shrinker_info_protected(memcg, nid);
-	return atomic_long_xchg(&info->nr_deferred[shrinker->id], 0);
+	unit = info->unit[shriner_id_to_index(shrinker->id)];
+	return atomic_long_xchg(&unit->nr_deferred[shriner_id_to_offset(shrinker->id)], 0);
 }
 
 static long add_nr_deferred_memcg(long nr, int nid, struct shrinker *shrinker,
 				  struct mem_cgroup *memcg)
 {
 	struct shrinker_info *info;
+	struct shrinker_info_unit *unit;
 
 	info = shrinker_info_protected(memcg, nid);
-	return atomic_long_add_return(nr, &info->nr_deferred[shrinker->id]);
+	unit = info->unit[shriner_id_to_index(shrinker->id)];
+	return atomic_long_add_return(nr, &unit->nr_deferred[shriner_id_to_offset(shrinker->id)]);
 }
 
 void reparent_shrinker_deferred(struct mem_cgroup *memcg)
 {
-	int i, nid;
+	int nid, index, offset;
 	long nr;
 	struct mem_cgroup *parent;
 	struct shrinker_info *child_info, *parent_info;
+	struct shrinker_info_unit *child_unit, *parent_unit;
 
 	parent = parent_mem_cgroup(memcg);
 	if (!parent)
@@ -237,9 +284,13 @@ void reparent_shrinker_deferred(struct mem_cgroup *memcg)
 	for_each_node(nid) {
 		child_info = shrinker_info_protected(memcg, nid);
 		parent_info = shrinker_info_protected(parent, nid);
-		for (i = 0; i < child_info->map_nr_max; i++) {
-			nr = atomic_long_read(&child_info->nr_deferred[i]);
-			atomic_long_add(nr, &parent_info->nr_deferred[i]);
+		for (index = 0; index < shriner_id_to_index(child_info->map_nr_max); index++) {
+			child_unit = child_info->unit[index];
+			parent_unit = parent_info->unit[index];
+			for (offset = 0; offset < SHRINKER_UNIT_BITS; offset++) {
+				nr = atomic_long_read(&child_unit->nr_deferred[offset]);
+				atomic_long_add(nr, &parent_unit->nr_deferred[offset]);
+			}
 		}
 	}
 	up_read(&shrinker_rwsem);
@@ -405,7 +456,7 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
 {
 	struct shrinker_info *info;
 	unsigned long ret, freed = 0;
-	int i;
+	int offset, index = 0;
 
 	if (!mem_cgroup_online(memcg))
 		return 0;
@@ -417,56 +468,63 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
 	if (unlikely(!info))
 		goto unlock;
 
-	for_each_set_bit(i, info->map, info->map_nr_max) {
-		struct shrink_control sc = {
-			.gfp_mask = gfp_mask,
-			.nid = nid,
-			.memcg = memcg,
-		};
-		struct shrinker *shrinker;
+	for (; index < shriner_id_to_index(info->map_nr_max); index++) {
+		struct shrinker_info_unit *unit;
 
-		shrinker = idr_find(&shrinker_idr, i);
-		if (unlikely(!shrinker || !(shrinker->flags & SHRINKER_REGISTERED))) {
-			if (!shrinker)
-				clear_bit(i, info->map);
-			continue;
-		}
+		unit = info->unit[index];
 
-		/* Call non-slab shrinkers even though kmem is disabled */
-		if (!memcg_kmem_online() &&
-		    !(shrinker->flags & SHRINKER_NONSLAB))
-			continue;
+		for_each_set_bit(offset, unit->map, SHRINKER_UNIT_BITS) {
+			struct shrink_control sc = {
+				.gfp_mask = gfp_mask,
+				.nid = nid,
+				.memcg = memcg,
+			};
+			struct shrinker *shrinker;
+			int shrinker_id = calc_shrinker_id(index, offset);
 
-		ret = do_shrink_slab(&sc, shrinker, priority);
-		if (ret == SHRINK_EMPTY) {
-			clear_bit(i, info->map);
-			/*
-			 * After the shrinker reported that it had no objects to
-			 * free, but before we cleared the corresponding bit in
-			 * the memcg shrinker map, a new object might have been
-			 * added. To make sure, we have the bit set in this
-			 * case, we invoke the shrinker one more time and reset
-			 * the bit if it reports that it is not empty anymore.
-			 * The memory barrier here pairs with the barrier in
-			 * set_shrinker_bit():
-			 *
-			 * list_lru_add()     shrink_slab_memcg()
-			 *   list_add_tail()    clear_bit()
-			 *   <MB>               <MB>
-			 *   set_bit()          do_shrink_slab()
-			 */
-			smp_mb__after_atomic();
-			ret = do_shrink_slab(&sc, shrinker, priority);
-			if (ret == SHRINK_EMPTY)
-				ret = 0;
-			else
-				set_shrinker_bit(memcg, nid, i);
-		}
-		freed += ret;
+			shrinker = idr_find(&shrinker_idr, shrinker_id);
+			if (unlikely(!shrinker || !(shrinker->flags & SHRINKER_REGISTERED))) {
+				if (!shrinker)
+					clear_bit(offset, unit->map);
+				continue;
+			}
 
-		if (rwsem_is_contended(&shrinker_rwsem)) {
-			freed = freed ? : 1;
-			break;
+			/* Call non-slab shrinkers even though kmem is disabled */
+			if (!memcg_kmem_online() &&
+			    !(shrinker->flags & SHRINKER_NONSLAB))
+				continue;
+
+			ret = do_shrink_slab(&sc, shrinker, priority);
+			if (ret == SHRINK_EMPTY) {
+				clear_bit(offset, unit->map);
+				/*
+				 * After the shrinker reported that it had no objects to
+				 * free, but before we cleared the corresponding bit in
+				 * the memcg shrinker map, a new object might have been
+				 * added. To make sure, we have the bit set in this
+				 * case, we invoke the shrinker one more time and reset
+				 * the bit if it reports that it is not empty anymore.
+				 * The memory barrier here pairs with the barrier in
+				 * set_shrinker_bit():
+				 *
+				 * list_lru_add()     shrink_slab_memcg()
+				 *   list_add_tail()    clear_bit()
+				 *   <MB>               <MB>
+				 *   set_bit()          do_shrink_slab()
+				 */
+				smp_mb__after_atomic();
+				ret = do_shrink_slab(&sc, shrinker, priority);
+				if (ret == SHRINK_EMPTY)
+					ret = 0;
+				else
+					set_shrinker_bit(memcg, nid, shrinker_id);
+			}
+			freed += ret;
+
+			if (rwsem_is_contended(&shrinker_rwsem)) {
+				freed = freed ? : 1;
+				goto unlock;
+			}
 		}
 	}
 unlock:
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:54:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:54:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568615.888262 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsGM-0001Ai-Cb; Mon, 24 Jul 2023 09:53:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568615.888262; Mon, 24 Jul 2023 09:53:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsGM-0001AX-9N; Mon, 24 Jul 2023 09:53:58 +0000
Received: by outflank-mailman (input) for mailman id 568615;
 Mon, 24 Jul 2023 09:53:57 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsGK-0008Df-Ts
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:53:57 +0000
Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com
 [2607:f8b0:4864:20::62a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ffce1d2c-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:53:54 +0200 (CEST)
Received: by mail-pl1-x62a.google.com with SMTP id
 d9443c01a7336-1bba9539a23so652285ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:53:54 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.53.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:53:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ffce1d2c-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192433; x=1690797233;
        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=XqecqrzcRvoIqXqcLBZrKzE7eAqHgJsLkgEnUCNLJ88=;
        b=aakQ9LhPKkBsGHyPn/0S1pJ1AXUkQ2pktpKG7ZznaFtfhZEAk2L/s3HFeMgFo9c4sB
         YjCdA4cfHiRFoAsJ95F8trnyy9W68BXjPI8tIe3KlU9vfvKXQfLc257Tp3k47YEaXxyL
         cC8ybNo0+Yqlr0HVQKvzqpcMLU5N8q2szwgu3a5mj6YWOtdCVI9Po9J47o5AQImD34oT
         fsyjFTVrms8ZNz/QF3b8ws2KqbiX0AgcbeBq1tQNUWRWk8x6ugUkj7ouYw4NBJZ4G3AL
         LTP7v7rQyzLe809XfdRCCXpY5HwbT/Kp7yhBNDkoFUB3AI2hcQHdnuE1yZCegUiWSxuC
         mo/A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192433; x=1690797233;
        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=XqecqrzcRvoIqXqcLBZrKzE7eAqHgJsLkgEnUCNLJ88=;
        b=hLVftEHBaOg74fG6e7u9vbE7zOMAmuWCIyR21bjexh4rmj7SkbzJWqO/9yxZ6+v9zv
         oD10+INYKwzqPSjDhZg68FA8O7EZsARAPx2SOAf9bEblTDO5QSDcsxJD80QWyoBNretU
         EIx3IVe6A0XCErG/3EnftyFy0Xz8zoGl/tZYxHwihwII05o2oVe1BWOvYuRdd6oRf2Bq
         vOY5ZeXQxQ0TzMo1Lc2KBnujNorBXUISHfqDFvPzLT0/qyP6Qyfz6bFkjS4IvEzr42lI
         qfva6fXzGlwgtbqxpnaFTVChIYpWTzqT6+z97Ryaeypow4ZxDqS2noRDCqDqxgPZcbld
         UWKA==
X-Gm-Message-State: ABy/qLY9kRHwAhcesOLbhfZzledLo/rpA4AtNw5p8s/qd1wt6e7J06QJ
	ZBUvzQWh36aadSf6qq1uRR5lTw==
X-Google-Smtp-Source: APBJJlHr2sAgfQgo2DnUpmnId7qPkjYXCImwyHrh9U8oeEhs0YzxIvU3vAaX/E5/QdNFkGMDi+4Opg==
X-Received: by 2002:a17:903:41c9:b0:1b8:17e8:547e with SMTP id u9-20020a17090341c900b001b817e8547emr12210253ple.1.1690192433168;
        Mon, 24 Jul 2023 02:53:53 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 44/47] mm: shrinker: make global slab shrink lockless
Date: Mon, 24 Jul 2023 17:43:51 +0800
Message-Id: <20230724094354.90817-45-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The shrinker_rwsem is a global read-write lock in shrinkers subsystem,
which protects most operations such as slab shrink, registration and
unregistration of shrinkers, etc. This can easily cause problems in the
following cases.

1) When the memory pressure is high and there are many filesystems
   mounted or unmounted at the same time, slab shrink will be affected
   (down_read_trylock() failed).

   Such as the real workload mentioned by Kirill Tkhai:

   ```
   One of the real workloads from my experience is start
   of an overcommitted node containing many starting
   containers after node crash (or many resuming containers
   after reboot for kernel update). In these cases memory
   pressure is huge, and the node goes round in long reclaim.
   ```

2) If a shrinker is blocked (such as the case mentioned
   in [1]) and a writer comes in (such as mount a fs),
   then this writer will be blocked and cause all
   subsequent shrinker-related operations to be blocked.

Even if there is no competitor when shrinking slab, there may still be a
problem. The down_read_trylock() may become a perf hotspot with frequent
calls to shrink_slab(). Because of the poor multicore scalability of
atomic operations, this can lead to a significant drop in IPC
(instructions per cycle).

We used to implement the lockless slab shrink with SRCU [2], but then
kernel test robot reported -88.8% regression in
stress-ng.ramfs.ops_per_sec test case [3], so we reverted it [4].

This commit uses the refcount+RCU method [5] proposed by Dave Chinner
to re-implement the lockless global slab shrink. The memcg slab shrink is
handled in the subsequent patch.

For now, all shrinker instances are converted to dynamically allocated and
will be freed by kfree_rcu(). So we can use rcu_read_{lock,unlock}() to
ensure that the shrinker instance is valid.

And the shrinker instance will not be run again after unregistration. So
the structure that records the pointer of shrinker instance can be safely
freed without waiting for the RCU read-side critical section.

In this way, while we implement the lockless slab shrink, we don't need to
be blocked in unregister_shrinker().

The following are the test results:

stress-ng --timeout 60 --times --verify --metrics-brief --ramfs 9 &

1) Before applying this patchset:

setting to a 60 second run per stressor
dispatching hogs: 9 ramfs
stressor       bogo ops real time  usr time  sys time   bogo ops/s     bogo ops/s
                          (secs)    (secs)    (secs)   (real time) (usr+sys time)
ramfs            735238     60.00     12.37    363.70     12253.05        1955.08
for a 60.01s run time:
   1440.27s available CPU time
     12.36s user time   (  0.86%)
    363.70s system time ( 25.25%)
    376.06s total time  ( 26.11%)
load average: 10.79 4.47 1.69
passed: 9: ramfs (9)
failed: 0
skipped: 0
successful run completed in 60.01s (1 min, 0.01 secs)

2) After applying this patchset:

setting to a 60 second run per stressor
dispatching hogs: 9 ramfs
stressor       bogo ops real time  usr time  sys time   bogo ops/s     bogo ops/s
                          (secs)    (secs)    (secs)   (real time) (usr+sys time)
ramfs            746677     60.00     12.22    367.75     12443.70        1965.13
for a 60.01s run time:
   1440.26s available CPU time
     12.21s user time   (  0.85%)
    367.75s system time ( 25.53%)
    379.96s total time  ( 26.38%)
load average: 8.37 2.48 0.86
passed: 9: ramfs (9)
failed: 0
skipped: 0
successful run completed in 60.01s (1 min, 0.01 secs)

We can see that the ops/s has hardly changed.

[1]. https://lore.kernel.org/lkml/20191129214541.3110-1-ptikhomirov@virtuozzo.com/
[2]. https://lore.kernel.org/lkml/20230313112819.38938-1-zhengqi.arch@bytedance.com/
[3]. https://lore.kernel.org/lkml/202305230837.db2c233f-yujie.liu@intel.com/
[4]. https://lore.kernel.org/all/20230609081518.3039120-1-qi.zheng@linux.dev/
[5]. https://lore.kernel.org/lkml/ZIJhou1d55d4H1s0@dread.disaster.area/

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 include/linux/shrinker.h | 19 +++++++---
 mm/shrinker.c            | 75 ++++++++++++++++++++++++++--------------
 mm/shrinker_debug.c      | 52 +++++++++++++++++++++-------
 3 files changed, 104 insertions(+), 42 deletions(-)

diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
index 36977a70bebb..335da93cccee 100644
--- a/include/linux/shrinker.h
+++ b/include/linux/shrinker.h
@@ -4,6 +4,7 @@
 
 #include <linux/atomic.h>
 #include <linux/types.h>
+#include <linux/refcount.h>
 
 #define SHRINKER_UNIT_BITS	BITS_PER_LONG
 
@@ -86,6 +87,10 @@ struct shrinker {
 	long batch;	/* reclaim batch size, 0 = default */
 	int seeks;	/* seeks to recreate an obj */
 	unsigned flags;
+	bool registered;
+
+	refcount_t refcount;
+	struct rcu_head rcu;
 
 	void *private_data;
 
@@ -106,14 +111,13 @@ struct shrinker {
 #define DEFAULT_SEEKS 2 /* A good number if you don't know better. */
 
 /* Flags */
-#define SHRINKER_REGISTERED	(1 << 0)
-#define SHRINKER_NUMA_AWARE	(1 << 1)
-#define SHRINKER_MEMCG_AWARE	(1 << 2)
+#define SHRINKER_NUMA_AWARE	(1 << 0)
+#define SHRINKER_MEMCG_AWARE	(1 << 1)
 /*
  * It just makes sense when the shrinker is also MEMCG_AWARE for now,
  * non-MEMCG_AWARE shrinker should not have this flag set.
  */
-#define SHRINKER_NONSLAB	(1 << 3)
+#define SHRINKER_NONSLAB	(1 << 2)
 
 unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
 			  int priority);
@@ -122,6 +126,13 @@ void shrinker_free_non_registered(struct shrinker *shrinker);
 void shrinker_register(struct shrinker *shrinker);
 void shrinker_unregister(struct shrinker *shrinker);
 
+static inline bool shrinker_try_get(struct shrinker *shrinker)
+{
+	return READ_ONCE(shrinker->registered) &&
+	       refcount_inc_not_zero(&shrinker->refcount);
+}
+void shrinker_put(struct shrinker *shrinker);
+
 #ifdef CONFIG_SHRINKER_DEBUG
 extern int shrinker_debugfs_add(struct shrinker *shrinker);
 extern struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
diff --git a/mm/shrinker.c b/mm/shrinker.c
index 8a1fe844f1a4..8e3334749552 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -2,10 +2,13 @@
 #include <linux/memcontrol.h>
 #include <linux/rwsem.h>
 #include <linux/shrinker.h>
+#include <linux/rculist.h>
+#include <linux/spinlock.h>
 #include <trace/events/vmscan.h>
 
 LIST_HEAD(shrinker_list);
 DECLARE_RWSEM(shrinker_rwsem);
+DEFINE_SPINLOCK(shrinker_lock);
 
 #ifdef CONFIG_MEMCG
 static int shrinker_nr_max;
@@ -450,6 +453,18 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
 	return freed;
 }
 
+void shrinker_put(struct shrinker *shrinker)
+{
+	if (refcount_dec_and_test(&shrinker->refcount)) {
+		spin_lock(&shrinker_lock);
+		list_del_rcu(&shrinker->list);
+		spin_unlock(&shrinker_lock);
+
+		kfree(shrinker->nr_deferred);
+		kfree_rcu(shrinker, rcu);
+	}
+}
+
 #ifdef CONFIG_MEMCG
 static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
 			struct mem_cgroup *memcg, int priority)
@@ -483,7 +498,8 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
 			int shrinker_id = calc_shrinker_id(index, offset);
 
 			shrinker = idr_find(&shrinker_idr, shrinker_id);
-			if (unlikely(!shrinker || !(shrinker->flags & SHRINKER_REGISTERED))) {
+			if (unlikely(!shrinker ||
+				     !READ_ONCE(shrinker->registered))) {
 				if (!shrinker)
 					clear_bit(offset, unit->map);
 				continue;
@@ -575,33 +591,42 @@ unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
 	if (!mem_cgroup_disabled() && !mem_cgroup_is_root(memcg))
 		return shrink_slab_memcg(gfp_mask, nid, memcg, priority);
 
-	if (!down_read_trylock(&shrinker_rwsem))
-		goto out;
-
-	list_for_each_entry(shrinker, &shrinker_list, list) {
+	rcu_read_lock();
+	list_for_each_entry_rcu(shrinker, &shrinker_list, list) {
 		struct shrink_control sc = {
 			.gfp_mask = gfp_mask,
 			.nid = nid,
 			.memcg = memcg,
 		};
 
+		if (!shrinker_try_get(shrinker))
+			continue;
+
+		/*
+		 * We can safely unlock the RCU lock here since we already
+		 * hold the refcount of the shrinker.
+		 */
+		rcu_read_unlock();
+
 		ret = do_shrink_slab(&sc, shrinker, priority);
 		if (ret == SHRINK_EMPTY)
 			ret = 0;
 		freed += ret;
+
 		/*
-		 * Bail out if someone want to register a new shrinker to
-		 * prevent the registration from being stalled for long periods
-		 * by parallel ongoing shrinking.
+		 * This shrinker may be deleted from shrinker_list and freed in
+		 * the shrinker_put() below, but this shrinker is still used for
+		 * the next traversal. So it is necessary to hold the RCU lock
+		 * first to prevent this shrinker from being freed, which also
+		 * ensures that the next shrinker that is traversed will not be
+		 * freed (even if it is deleted from shrinker_list at the same
+		 * time).
 		 */
-		if (rwsem_is_contended(&shrinker_rwsem)) {
-			freed = freed ? : 1;
-			break;
-		}
+		rcu_read_lock();
+		shrinker_put(shrinker);
 	}
 
-	up_read(&shrinker_rwsem);
-out:
+	rcu_read_unlock();
 	cond_resched();
 	return freed;
 }
@@ -686,11 +711,14 @@ EXPORT_SYMBOL(shrinker_free_non_registered);
 
 void shrinker_register(struct shrinker *shrinker)
 {
-	down_write(&shrinker_rwsem);
-	list_add_tail(&shrinker->list, &shrinker_list);
-	shrinker->flags |= SHRINKER_REGISTERED;
+	refcount_set(&shrinker->refcount, 1);
+
+	spin_lock(&shrinker_lock);
+	list_add_tail_rcu(&shrinker->list, &shrinker_list);
+	spin_unlock(&shrinker_lock);
+
 	shrinker_debugfs_add(shrinker);
-	up_write(&shrinker_rwsem);
+	WRITE_ONCE(shrinker->registered, true);
 }
 EXPORT_SYMBOL(shrinker_register);
 
@@ -699,12 +727,12 @@ void shrinker_unregister(struct shrinker *shrinker)
 	struct dentry *debugfs_entry;
 	int debugfs_id;
 
-	if (!shrinker || !(shrinker->flags & SHRINKER_REGISTERED))
+	if (!shrinker || !READ_ONCE(shrinker->registered))
 		return;
 
+	WRITE_ONCE(shrinker->registered, false);
+
 	down_write(&shrinker_rwsem);
-	list_del(&shrinker->list);
-	shrinker->flags &= ~SHRINKER_REGISTERED;
 	if (shrinker->flags & SHRINKER_MEMCG_AWARE)
 		unregister_memcg_shrinker(shrinker);
 	debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);
@@ -712,9 +740,6 @@ void shrinker_unregister(struct shrinker *shrinker)
 
 	shrinker_debugfs_remove(debugfs_entry, debugfs_id);
 
-	kfree(shrinker->nr_deferred);
-	shrinker->nr_deferred = NULL;
-
-	kfree(shrinker);
+	shrinker_put(shrinker);
 }
 EXPORT_SYMBOL(shrinker_unregister);
diff --git a/mm/shrinker_debug.c b/mm/shrinker_debug.c
index f1becfd45853..c5573066adbf 100644
--- a/mm/shrinker_debug.c
+++ b/mm/shrinker_debug.c
@@ -5,6 +5,7 @@
 #include <linux/seq_file.h>
 #include <linux/shrinker.h>
 #include <linux/memcontrol.h>
+#include <linux/rculist.h>
 
 /* defined in vmscan.c */
 extern struct rw_semaphore shrinker_rwsem;
@@ -161,17 +162,21 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
 {
 	struct dentry *entry;
 	char buf[128];
-	int id;
-
-	lockdep_assert_held(&shrinker_rwsem);
+	int id, ret = 0;
 
 	/* debugfs isn't initialized yet, add debugfs entries later. */
 	if (!shrinker_debugfs_root)
 		return 0;
 
+	down_write(&shrinker_rwsem);
+	if (shrinker->debugfs_entry)
+		goto fail;
+
 	id = ida_alloc(&shrinker_debugfs_ida, GFP_KERNEL);
-	if (id < 0)
-		return id;
+	if (id < 0) {
+		ret = id;
+		goto fail;
+	}
 	shrinker->debugfs_id = id;
 
 	snprintf(buf, sizeof(buf), "%s-%d", shrinker->name, id);
@@ -180,7 +185,8 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
 	entry = debugfs_create_dir(buf, shrinker_debugfs_root);
 	if (IS_ERR(entry)) {
 		ida_free(&shrinker_debugfs_ida, id);
-		return PTR_ERR(entry);
+		ret = PTR_ERR(entry);
+		goto fail;
 	}
 	shrinker->debugfs_entry = entry;
 
@@ -188,7 +194,10 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
 			    &shrinker_debugfs_count_fops);
 	debugfs_create_file("scan", 0220, entry, shrinker,
 			    &shrinker_debugfs_scan_fops);
-	return 0;
+
+fail:
+	up_write(&shrinker_rwsem);
+	return ret;
 }
 
 int shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...)
@@ -243,6 +252,11 @@ struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
 	shrinker->name = NULL;
 
 	*debugfs_id = entry ? shrinker->debugfs_id : -1;
+	/*
+	 * Ensure that shrinker->registered has been set to false before
+	 * shrinker->debugfs_entry is set to NULL.
+	 */
+	smp_wmb();
 	shrinker->debugfs_entry = NULL;
 
 	return entry;
@@ -266,14 +280,26 @@ static int __init shrinker_debugfs_init(void)
 	shrinker_debugfs_root = dentry;
 
 	/* Create debugfs entries for shrinkers registered at boot */
-	down_write(&shrinker_rwsem);
-	list_for_each_entry(shrinker, &shrinker_list, list)
+	rcu_read_lock();
+	list_for_each_entry_rcu(shrinker, &shrinker_list, list) {
+		if (!shrinker_try_get(shrinker))
+			continue;
+		rcu_read_unlock();
+
 		if (!shrinker->debugfs_entry) {
-			ret = shrinker_debugfs_add(shrinker);
-			if (ret)
-				break;
+			/* Paired with smp_wmb() in shrinker_debugfs_detach() */
+			smp_rmb();
+			if (READ_ONCE(shrinker->registered))
+				ret = shrinker_debugfs_add(shrinker);
 		}
-	up_write(&shrinker_rwsem);
+
+		rcu_read_lock();
+		shrinker_put(shrinker);
+
+		if (ret)
+			break;
+	}
+	rcu_read_unlock();
 
 	return ret;
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:54:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:54:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568618.888273 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsGY-0001gV-Li; Mon, 24 Jul 2023 09:54:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568618.888273; Mon, 24 Jul 2023 09:54:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsGY-0001gL-I0; Mon, 24 Jul 2023 09:54:10 +0000
Received: by outflank-mailman (input) for mailman id 568618;
 Mon, 24 Jul 2023 09:54:08 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsGW-0008Df-Gl
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:54:08 +0000
Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com
 [2607:f8b0:4864:20::62d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 06c8b78f-2a08-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:54:06 +0200 (CEST)
Received: by mail-pl1-x62d.google.com with SMTP id
 d9443c01a7336-1b7dfb95761so5887145ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:54:06 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.53.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:54:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 06c8b78f-2a08-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192445; x=1690797245;
        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=FywtQwu9mwqdLnpgsxjfsrD11oDXqt6ENbvCNRWNCVA=;
        b=DikUT4CKvV9RWn+fl0EOFm95TR3cSja3PlgjCDFqYMWPqMDDzd0vmehY70wgwFHQZD
         xId6TApEDoayIU5bQp8ozmrUPwrV+fZdWpug1R+OQH5DrriDxnV5YGJ3iOuChC8/ataP
         +R3gMMBTSe4nwS0xpXqJAoWzm6vYwBlpoaI2H2xyHy5N1Vcg7pPEK5Dz8BrqbjXdo46a
         BIBOWCEzFcgC3VjgRrMmpjjBZE50INCoJYWq8LivZP/kkdwHaluoJFKZZtpIIdRFhRls
         Kq/htL25Wjh18OwWW51R+/aE+ahnELBQ5oiFmyJ9PiIhZjCyUAuo6LkxYtq+ZqQ6xAXz
         Fmyg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192445; x=1690797245;
        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=FywtQwu9mwqdLnpgsxjfsrD11oDXqt6ENbvCNRWNCVA=;
        b=M+gBc4r4ld+4SusH9m8TMuvR7lyA7qzFfaZkL4HKezMMX0sFO6XDy4Mn9KflITijeP
         84+M1a+ixc5sb04rg3yVmkqr6y0V3Fx9C/l6BLLO6wVWvG7j6pyq57Lg/m3pJtifVH8x
         nD83uKh+TTmB4kFPJCoeihDta+ZhsAtm8sBTx+Alp7+CvoOn/UbDHeM0y6+b/gxQDbc0
         UWwYNcV0CtU2pEepjZapfBP9+7GstehVMb1KQVAowOaBHiULy58CHhKrH+M2VdtW6JmY
         5PyXpfCrK/DmxRbFkcXe9lL3ZEMjg9T+zjqe+bgSvchrqLl5ui/n7k+9UlHQNbbSl0rk
         di5g==
X-Gm-Message-State: ABy/qLbYoRSQ7jWYfGA0JyiS2CUaILS6rntFc3kcdVrwIUgrorFUGdqE
	wuPM8u6dDCANNL62uHdUiGmlIA==
X-Google-Smtp-Source: APBJJlGle8sGTFCIz3U+SEQARZPGtcsatZf97BgxEHL69WWMCLjqGjoS5fsqRbwtJvxWPn7Q2rRfzw==
X-Received: by 2002:a17:902:cecd:b0:1b8:70d2:eb3a with SMTP id d13-20020a170902cecd00b001b870d2eb3amr12272091plg.0.1690192445165;
        Mon, 24 Jul 2023 02:54:05 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 45/47] mm: shrinker: make memcg slab shrink lockless
Date: Mon, 24 Jul 2023 17:43:52 +0800
Message-Id: <20230724094354.90817-46-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Like global slab shrink, this commit also uses refcount+RCU method to make
memcg slab shrink lockless.

Use the following script to do slab shrink stress test:

```

DIR="/root/shrinker/memcg/mnt"

do_create()
{
    mkdir -p /sys/fs/cgroup/memory/test
    echo 4G > /sys/fs/cgroup/memory/test/memory.limit_in_bytes
    for i in `seq 0 $1`;
    do
        mkdir -p /sys/fs/cgroup/memory/test/$i;
        echo $$ > /sys/fs/cgroup/memory/test/$i/cgroup.procs;
        mkdir -p $DIR/$i;
    done
}

do_mount()
{
    for i in `seq $1 $2`;
    do
        mount -t tmpfs $i $DIR/$i;
    done
}

do_touch()
{
    for i in `seq $1 $2`;
    do
        echo $$ > /sys/fs/cgroup/memory/test/$i/cgroup.procs;
        dd if=/dev/zero of=$DIR/$i/file$i bs=1M count=1 &
    done
}

case "$1" in
  touch)
    do_touch $2 $3
    ;;
  test)
    do_create 4000
    do_mount 0 4000
    do_touch 0 3000
    ;;
  *)
    exit 1
    ;;
esac
```

Save the above script, then run test and touch commands. Then we can use
the following perf command to view hotspots:

perf top -U -F 999

1) Before applying this patchset:

  40.44%  [kernel]            [k] down_read_trylock
  17.59%  [kernel]            [k] up_read
  13.64%  [kernel]            [k] pv_native_safe_halt
  11.90%  [kernel]            [k] shrink_slab
   8.21%  [kernel]            [k] idr_find
   2.71%  [kernel]            [k] _find_next_bit
   1.36%  [kernel]            [k] shrink_node
   0.81%  [kernel]            [k] shrink_lruvec
   0.80%  [kernel]            [k] __radix_tree_lookup
   0.50%  [kernel]            [k] do_shrink_slab
   0.21%  [kernel]            [k] list_lru_count_one
   0.16%  [kernel]            [k] mem_cgroup_iter

2) After applying this patchset:

  60.17%  [kernel]           [k] shrink_slab
  20.42%  [kernel]           [k] pv_native_safe_halt
   3.03%  [kernel]           [k] do_shrink_slab
   2.73%  [kernel]           [k] shrink_node
   2.27%  [kernel]           [k] shrink_lruvec
   2.00%  [kernel]           [k] __rcu_read_unlock
   1.92%  [kernel]           [k] mem_cgroup_iter
   0.98%  [kernel]           [k] __rcu_read_lock
   0.91%  [kernel]           [k] osq_lock
   0.63%  [kernel]           [k] mem_cgroup_calculate_protection
   0.55%  [kernel]           [k] shrinker_put
   0.46%  [kernel]           [k] list_lru_count_one

We can see that the first perf hotspot becomes shrink_slab, which is what
we expect.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 mm/shrinker.c       | 121 +++++++++++++++++++++++++++-----------------
 mm/shrinker_debug.c |   4 +-
 2 files changed, 76 insertions(+), 49 deletions(-)

diff --git a/mm/shrinker.c b/mm/shrinker.c
index 8e3334749552..744361afd520 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -107,6 +107,12 @@ static struct shrinker_info *shrinker_info_protected(struct mem_cgroup *memcg,
 					 lockdep_is_held(&shrinker_rwsem));
 }
 
+static struct shrinker_info *shrinker_info_rcu(struct mem_cgroup *memcg,
+					       int nid)
+{
+	return rcu_dereference(memcg->nodeinfo[nid]->shrinker_info);
+}
+
 static int expand_one_shrinker_info(struct mem_cgroup *memcg, int new_size,
 				    int old_size, int new_nr_max)
 {
@@ -152,11 +158,11 @@ static int expand_shrinker_info(int new_id)
 	int new_size, old_size = 0;
 	struct mem_cgroup *memcg;
 
+	down_write(&shrinker_rwsem);
+
 	if (!root_mem_cgroup)
 		goto out;
 
-	lockdep_assert_held(&shrinker_rwsem);
-
 	new_size = shrinker_unit_size(new_nr_max);
 	old_size = shrinker_unit_size(shrinker_nr_max);
 
@@ -173,6 +179,8 @@ static int expand_shrinker_info(int new_id)
 	if (!ret)
 		shrinker_nr_max = new_nr_max;
 
+	up_write(&shrinker_rwsem);
+
 	return ret;
 }
 
@@ -198,7 +206,7 @@ void set_shrinker_bit(struct mem_cgroup *memcg, int nid, int shrinker_id)
 		struct shrinker_info_unit *unit;
 
 		rcu_read_lock();
-		info = rcu_dereference(memcg->nodeinfo[nid]->shrinker_info);
+		info = shrinker_info_rcu(memcg, nid);
 		unit = info->unit[shriner_id_to_index(shrinker_id)];
 		if (!WARN_ON_ONCE(shrinker_id >= info->map_nr_max)) {
 			/* Pairs with smp mb in shrink_slab() */
@@ -211,39 +219,40 @@ void set_shrinker_bit(struct mem_cgroup *memcg, int nid, int shrinker_id)
 
 static DEFINE_IDR(shrinker_idr);
 
-static int prealloc_memcg_shrinker(struct shrinker *shrinker)
+static int shrinker_memcg_alloc(struct shrinker *shrinker)
 {
-	int id, ret = -ENOMEM;
+	int id;
 
 	if (mem_cgroup_disabled())
 		return -ENOSYS;
 
-	down_write(&shrinker_rwsem);
-	/* This may call shrinker, so it must use down_read_trylock() */
-	id = idr_alloc(&shrinker_idr, shrinker, 0, 0, GFP_KERNEL);
+	spin_lock(&shrinker_lock);
+	id = idr_alloc(&shrinker_idr, shrinker, 0, 0, GFP_ATOMIC);
+	spin_unlock(&shrinker_lock);
+
 	if (id < 0)
-		goto unlock;
+		return -ENOMEM;
 
 	if (id >= shrinker_nr_max) {
 		if (expand_shrinker_info(id)) {
+			spin_lock(&shrinker_lock);
 			idr_remove(&shrinker_idr, id);
-			goto unlock;
+			spin_unlock(&shrinker_lock);
+			return -ENOMEM;
 		}
 	}
 	shrinker->id = id;
-	ret = 0;
-unlock:
-	up_write(&shrinker_rwsem);
-	return ret;
+
+	return 0;
 }
 
-static void unregister_memcg_shrinker(struct shrinker *shrinker)
+static void shrinker_memcg_remove(struct shrinker *shrinker)
 {
 	int id = shrinker->id;
 
 	BUG_ON(id < 0);
 
-	lockdep_assert_held(&shrinker_rwsem);
+	lockdep_assert_held(&shrinker_lock);
 
 	idr_remove(&shrinker_idr, id);
 }
@@ -253,10 +262,15 @@ static long xchg_nr_deferred_memcg(int nid, struct shrinker *shrinker,
 {
 	struct shrinker_info *info;
 	struct shrinker_info_unit *unit;
+	long nr_deferred;
 
-	info = shrinker_info_protected(memcg, nid);
+	rcu_read_lock();
+	info = shrinker_info_rcu(memcg, nid);
 	unit = info->unit[shriner_id_to_index(shrinker->id)];
-	return atomic_long_xchg(&unit->nr_deferred[shriner_id_to_offset(shrinker->id)], 0);
+	nr_deferred = atomic_long_xchg(&unit->nr_deferred[shriner_id_to_offset(shrinker->id)], 0);
+	rcu_read_unlock();
+
+	return nr_deferred;
 }
 
 static long add_nr_deferred_memcg(long nr, int nid, struct shrinker *shrinker,
@@ -264,10 +278,16 @@ static long add_nr_deferred_memcg(long nr, int nid, struct shrinker *shrinker,
 {
 	struct shrinker_info *info;
 	struct shrinker_info_unit *unit;
+	long nr_deferred;
 
-	info = shrinker_info_protected(memcg, nid);
+	rcu_read_lock();
+	info = shrinker_info_rcu(memcg, nid);
 	unit = info->unit[shriner_id_to_index(shrinker->id)];
-	return atomic_long_add_return(nr, &unit->nr_deferred[shriner_id_to_offset(shrinker->id)]);
+	nr_deferred =
+		atomic_long_add_return(nr, &unit->nr_deferred[shriner_id_to_offset(shrinker->id)]);
+	rcu_read_unlock();
+
+	return nr_deferred;
 }
 
 void reparent_shrinker_deferred(struct mem_cgroup *memcg)
@@ -299,12 +319,12 @@ void reparent_shrinker_deferred(struct mem_cgroup *memcg)
 	up_read(&shrinker_rwsem);
 }
 #else
-static int prealloc_memcg_shrinker(struct shrinker *shrinker)
+static int shrinker_memcg_alloc(struct shrinker *shrinker)
 {
 	return -ENOSYS;
 }
 
-static void unregister_memcg_shrinker(struct shrinker *shrinker)
+static void shrinker_memcg_remove(struct shrinker *shrinker)
 {
 }
 
@@ -458,6 +478,8 @@ void shrinker_put(struct shrinker *shrinker)
 	if (refcount_dec_and_test(&shrinker->refcount)) {
 		spin_lock(&shrinker_lock);
 		list_del_rcu(&shrinker->list);
+		if (shrinker->flags & SHRINKER_MEMCG_AWARE)
+			shrinker_memcg_remove(shrinker);
 		spin_unlock(&shrinker_lock);
 
 		kfree(shrinker->nr_deferred);
@@ -476,18 +498,23 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
 	if (!mem_cgroup_online(memcg))
 		return 0;
 
-	if (!down_read_trylock(&shrinker_rwsem))
-		return 0;
-
-	info = shrinker_info_protected(memcg, nid);
+again:
+	rcu_read_lock();
+	info = shrinker_info_rcu(memcg, nid);
 	if (unlikely(!info))
 		goto unlock;
 
-	for (; index < shriner_id_to_index(info->map_nr_max); index++) {
+	if (index < shriner_id_to_index(info->map_nr_max)) {
 		struct shrinker_info_unit *unit;
 
 		unit = info->unit[index];
 
+		/*
+		 * The shrinker_info_unit will not be freed, so we can
+		 * safely release the RCU lock here.
+		 */
+		rcu_read_unlock();
+
 		for_each_set_bit(offset, unit->map, SHRINKER_UNIT_BITS) {
 			struct shrink_control sc = {
 				.gfp_mask = gfp_mask,
@@ -497,13 +524,14 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
 			struct shrinker *shrinker;
 			int shrinker_id = calc_shrinker_id(index, offset);
 
+			rcu_read_lock();
 			shrinker = idr_find(&shrinker_idr, shrinker_id);
-			if (unlikely(!shrinker ||
-				     !READ_ONCE(shrinker->registered))) {
-				if (!shrinker)
-					clear_bit(offset, unit->map);
+			if (unlikely(!shrinker || !shrinker_try_get(shrinker))) {
+				clear_bit(offset, unit->map);
+				rcu_read_unlock();
 				continue;
 			}
+			rcu_read_unlock();
 
 			/* Call non-slab shrinkers even though kmem is disabled */
 			if (!memcg_kmem_online() &&
@@ -536,15 +564,20 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
 					set_shrinker_bit(memcg, nid, shrinker_id);
 			}
 			freed += ret;
-
-			if (rwsem_is_contended(&shrinker_rwsem)) {
-				freed = freed ? : 1;
-				goto unlock;
-			}
+			shrinker_put(shrinker);
 		}
+
+		/*
+		 * We have already exited the read-side of rcu critical section
+		 * before calling do_shrink_slab(), the shrinker_info may be
+		 * released in expand_one_shrinker_info(), so reacquire the
+		 * shrinker_info.
+		 */
+		index++;
+		goto again;
 	}
 unlock:
-	up_read(&shrinker_rwsem);
+	rcu_read_unlock();
 	return freed;
 }
 #else /* !CONFIG_MEMCG */
@@ -652,7 +685,7 @@ struct shrinker *shrinker_alloc(unsigned int flags, const char *fmt, ...)
 	shrinker->flags = flags;
 
 	if (flags & SHRINKER_MEMCG_AWARE) {
-		err = prealloc_memcg_shrinker(shrinker);
+		err = shrinker_memcg_alloc(shrinker);
 		if (err == -ENOSYS)
 			shrinker->flags &= ~SHRINKER_MEMCG_AWARE;
 		else if (err == 0)
@@ -697,9 +730,9 @@ void shrinker_free_non_registered(struct shrinker *shrinker)
 	shrinker->name = NULL;
 #endif
 	if (shrinker->flags & SHRINKER_MEMCG_AWARE) {
-		down_write(&shrinker_rwsem);
-		unregister_memcg_shrinker(shrinker);
-		up_write(&shrinker_rwsem);
+		spin_lock(&shrinker_lock);
+		shrinker_memcg_remove(shrinker);
+		spin_unlock(&shrinker_lock);
 	}
 
 	kfree(shrinker->nr_deferred);
@@ -731,13 +764,7 @@ void shrinker_unregister(struct shrinker *shrinker)
 		return;
 
 	WRITE_ONCE(shrinker->registered, false);
-
-	down_write(&shrinker_rwsem);
-	if (shrinker->flags & SHRINKER_MEMCG_AWARE)
-		unregister_memcg_shrinker(shrinker);
 	debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);
-	up_write(&shrinker_rwsem);
-
 	shrinker_debugfs_remove(debugfs_entry, debugfs_id);
 
 	shrinker_put(shrinker);
diff --git a/mm/shrinker_debug.c b/mm/shrinker_debug.c
index c5573066adbf..badda35464c3 100644
--- a/mm/shrinker_debug.c
+++ b/mm/shrinker_debug.c
@@ -246,8 +246,7 @@ struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
 {
 	struct dentry *entry = shrinker->debugfs_entry;
 
-	lockdep_assert_held(&shrinker_rwsem);
-
+	down_write(&shrinker_rwsem);
 	kfree_const(shrinker->name);
 	shrinker->name = NULL;
 
@@ -258,6 +257,7 @@ struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
 	 */
 	smp_wmb();
 	shrinker->debugfs_entry = NULL;
+	up_write(&shrinker_rwsem);
 
 	return entry;
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:54:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:54:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568620.888283 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsGi-0002Aa-5M; Mon, 24 Jul 2023 09:54:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568620.888283; Mon, 24 Jul 2023 09:54:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsGi-0002AJ-22; Mon, 24 Jul 2023 09:54:20 +0000
Received: by outflank-mailman (input) for mailman id 568620;
 Mon, 24 Jul 2023 09:54:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsGg-0001Ob-Tg
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:54:18 +0000
Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com
 [2607:f8b0:4864:20::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0dcab634-2a08-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:54:18 +0200 (CEST)
Received: by mail-pl1-x62f.google.com with SMTP id
 d9443c01a7336-1b7dfb95761so5887685ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:54:18 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.54.05
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:54:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0dcab634-2a08-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192457; x=1690797257;
        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=CMESg6KcZ1f/x8j8WNeV/0Ezds9kYbd4Innm/bU0Ooo=;
        b=dwKlx1oQ8gC3FGBisAur+bDXIIsIsnjGtPcpy7zH7OHDzky5UKxSTJ05GXNV3ifxFh
         uFNY+8ub7jUvRzU2N0mzwWkyUcySnlCtwLD3JQfZApULo5o50SUYvFf7wmqQeUGg+K3w
         AqzVxAjjzV5PNtSqJauuHxoQULcgDnOjWhlM27zpLCCDDjhxzzb13/oecO1ube7S7m7P
         1safwLAq/c10jFTLUU1Xqd0TB13zkKzwSGxlgMOCVqCgGIAn0g9Om1mA4z6ti880Mese
         Evcqc6hGgzGiGoOdWdO80KWYfeQwXeXM+h1Vq8tuq+SebTbp5eEFtPf8XLS7hjdlVp+9
         zxcw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192457; x=1690797257;
        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=CMESg6KcZ1f/x8j8WNeV/0Ezds9kYbd4Innm/bU0Ooo=;
        b=Nu1A5b2JYlregfK11xskJ9xFTAbUSP6UkuStBHYqRFUOHIBQW3R5mLEil3lyC/Cn25
         LazEA3z4b6U/xCUntyp+eFDohbMitsc3udtDhUo6b46AV7TeirR3GTI6DSPY5QIIur/a
         z9GkUU3KHpDZ+ymBeIgSFD/rahQyD1VCtqpo+V3oDjATkxg6cJi9iZ1MJm3RM9PsC7zg
         k1+3/X8tuoIURHcSKH2PVHlxG8q8dkG6tf8wl480TiAJpoj3DKDmEqhoFXL5FtPc9xa/
         i0GzGYJmcVcqqkX7tEZBz8Si0VRS94EQkDUYhzPqnY2fh9NZGGezSYRidoKg2u4ZbXUN
         bF8w==
X-Gm-Message-State: ABy/qLZ2JBnEEBV0a38OPJ1n0DMf6J2+bW4qsg+CsortX/GiZA8s4erG
	vHqTcpk7gwDC0zOKtWtYFHqLfA==
X-Google-Smtp-Source: APBJJlGXXWR+7sUNZwfELUHGku1GBmb2Z0Up/m3d12N15W4mEcGvzf3zzmR3Y2DB2osG2hV81y8tMw==
X-Received: by 2002:a17:902:dacf:b0:1b8:9215:9163 with SMTP id q15-20020a170902dacf00b001b892159163mr12209813plx.6.1690192456927;
        Mon, 24 Jul 2023 02:54:16 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 46/47] mm: shrinker: hold write lock to reparent shrinker nr_deferred
Date: Mon, 24 Jul 2023 17:43:53 +0800
Message-Id: <20230724094354.90817-47-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

For now, reparent_shrinker_deferred() is the only holder of read lock of
shrinker_rwsem. And it already holds the global cgroup_mutex, so it will
not be called in parallel.

Therefore, in order to convert shrinker_rwsem to shrinker_mutex later,
here we change to hold the write lock of shrinker_rwsem to reparent.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 mm/shrinker.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/shrinker.c b/mm/shrinker.c
index 744361afd520..90c045620fe3 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -303,7 +303,7 @@ void reparent_shrinker_deferred(struct mem_cgroup *memcg)
 		parent = root_mem_cgroup;
 
 	/* Prevent from concurrent shrinker_info expand */
-	down_read(&shrinker_rwsem);
+	down_write(&shrinker_rwsem);
 	for_each_node(nid) {
 		child_info = shrinker_info_protected(memcg, nid);
 		parent_info = shrinker_info_protected(parent, nid);
@@ -316,7 +316,7 @@ void reparent_shrinker_deferred(struct mem_cgroup *memcg)
 			}
 		}
 	}
-	up_read(&shrinker_rwsem);
+	up_write(&shrinker_rwsem);
 }
 #else
 static int shrinker_memcg_alloc(struct shrinker *shrinker)
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:54:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:54:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568624.888293 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsGu-0002ph-F9; Mon, 24 Jul 2023 09:54:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568624.888293; Mon, 24 Jul 2023 09:54:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsGu-0002pQ-An; Mon, 24 Jul 2023 09:54:32 +0000
Received: by outflank-mailman (input) for mailman id 568624;
 Mon, 24 Jul 2023 09:54:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsGs-0001Ob-PN
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:54:30 +0000
Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com
 [2607:f8b0:4864:20::636])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 14d76bb7-2a08-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:54:30 +0200 (CEST)
Received: by mail-pl1-x636.google.com with SMTP id
 d9443c01a7336-1bba9539a23so652975ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:54:30 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.54.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:54:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 14d76bb7-2a08-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192469; x=1690797269;
        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=F/oK6bm2Afi7WKsfFLPLaSlUUie3UdhMRHX1z52bb4o=;
        b=W9Prg0fDQM4GlbOp7Efh7k12YSFxbQAIDSIFUNXpcxiaiwsMOqIS9spB+ZW9R8bqkG
         2eUk3vAJhRvOfzbc0lzRJ0pjebzRGDfg8mSr9wE4svx2n4tEZzvgmCHhvlLJZaqcPuTF
         ajZf7zR02a5nB3jGeTnCYDCOv2ZoK+omuzdRQRiU6Gx6ifxD/5gUipR32piSj3zU9ojE
         giQ5EbsOhgO/nBwZ9hR/Jy1y+NlQ/pZ5vMWcA3q2UVTMdeqbP2Ck3FtJpUlMmobx8vUB
         vcMI8GxEI7t1W6HxEfOkf8W6IvWEtYrQu4A2vSBZhjnQNuGVAvXWDybi001tXCfDYH7J
         BNiQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192469; x=1690797269;
        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=F/oK6bm2Afi7WKsfFLPLaSlUUie3UdhMRHX1z52bb4o=;
        b=kG6pu6dZPGoqXWn2s6xd46Ouf+MnMAI7OaeM8sAHtakffarQRXm0kexuJZoyJL/SrP
         AOrmhRrHOPjtxJ+Z+8mUglHJxtut7F3c8WLkGuY1v6uVEibquv6bWD1Aa4k7e97LXAz9
         DYDx6o6MtsUDXTtgmZwIYnbSF/Wo6Yqg0OlRkgQGA8zYyf1kwdGOMbrdDDgw1SJ2j/Mv
         OqNiNvdSoKu+VKrH493DsT2CVf1b7Bd/+YuTViR1aNme2hAUScZm3od48s2IugFEj0nC
         pvnN6tUJ/i7UD1s0DqFGNSANviIGSvTI6Du1suK4m9wDgVZ/EFLJO7RZZhzK9gALWYs2
         YEJw==
X-Gm-Message-State: ABy/qLZwCnPTBcetfY5Z3+2Nt0GbZ9/RY0lg2D7uqO27v3Zu+dlr3Zo3
	5kL/vh5rh3C/FWiyhKrbXxPvsQ==
X-Google-Smtp-Source: APBJJlFeSJXGwKM1/4Fx4M034iEieIqp39l7VwM/I3gIgSntmWk50xYbsW/3q3bB2XT8c22SamI2Bg==
X-Received: by 2002:a17:902:dad2:b0:1b8:9fc4:2733 with SMTP id q18-20020a170902dad200b001b89fc42733mr12483608plx.3.1690192468770;
        Mon, 24 Jul 2023 02:54:28 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 47/47] mm: shrinker: convert shrinker_rwsem to mutex
Date: Mon, 24 Jul 2023 17:43:54 +0800
Message-Id: <20230724094354.90817-48-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Now there are no readers of shrinker_rwsem, so we can simply replace it
with mutex lock.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 drivers/md/dm-cache-metadata.c |  2 +-
 fs/super.c                     |  2 +-
 mm/shrinker.c                  | 16 ++++++++--------
 mm/shrinker_debug.c            | 14 +++++++-------
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c
index acffed750e3e..9e0c69958587 100644
--- a/drivers/md/dm-cache-metadata.c
+++ b/drivers/md/dm-cache-metadata.c
@@ -1828,7 +1828,7 @@ int dm_cache_metadata_abort(struct dm_cache_metadata *cmd)
 	 * Replacement block manager (new_bm) is created and old_bm destroyed outside of
 	 * cmd root_lock to avoid ABBA deadlock that would result (due to life-cycle of
 	 * shrinker associated with the block manager's bufio client vs cmd root_lock).
-	 * - must take shrinker_rwsem without holding cmd->root_lock
+	 * - must take shrinker_mutex without holding cmd->root_lock
 	 */
 	new_bm = dm_block_manager_create(cmd->bdev, DM_CACHE_METADATA_BLOCK_SIZE << SECTOR_SHIFT,
 					 CACHE_MAX_CONCURRENT_LOCKS);
diff --git a/fs/super.c b/fs/super.c
index 04643fd80886..602cf54eb7da 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -54,7 +54,7 @@ static char *sb_writers_name[SB_FREEZE_LEVELS] = {
  * One thing we have to be careful of with a per-sb shrinker is that we don't
  * drop the last active reference to the superblock from within the shrinker.
  * If that happens we could trigger unregistering the shrinker from within the
- * shrinker path and that leads to deadlock on the shrinker_rwsem. Hence we
+ * shrinker path and that leads to deadlock on the shrinker_mutex. Hence we
  * take a passive reference to the superblock to avoid this from occurring.
  */
 static unsigned long super_cache_scan(struct shrinker *shrink,
diff --git a/mm/shrinker.c b/mm/shrinker.c
index 90c045620fe3..5c4546d2c234 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -7,7 +7,7 @@
 #include <trace/events/vmscan.h>
 
 LIST_HEAD(shrinker_list);
-DECLARE_RWSEM(shrinker_rwsem);
+DEFINE_MUTEX(shrinker_mutex);
 DEFINE_SPINLOCK(shrinker_lock);
 
 #ifdef CONFIG_MEMCG
@@ -80,7 +80,7 @@ int alloc_shrinker_info(struct mem_cgroup *memcg)
 	int nid, ret = 0;
 	int array_size = 0;
 
-	down_write(&shrinker_rwsem);
+	mutex_lock(&shrinker_mutex);
 	array_size = shrinker_unit_size(shrinker_nr_max);
 	for_each_node(nid) {
 		info = kvzalloc_node(sizeof(*info) + array_size, GFP_KERNEL, nid);
@@ -91,7 +91,7 @@ int alloc_shrinker_info(struct mem_cgroup *memcg)
 			goto err;
 		rcu_assign_pointer(memcg->nodeinfo[nid]->shrinker_info, info);
 	}
-	up_write(&shrinker_rwsem);
+	mutex_unlock(&shrinker_mutex);
 
 	return ret;
 
@@ -104,7 +104,7 @@ static struct shrinker_info *shrinker_info_protected(struct mem_cgroup *memcg,
 						     int nid)
 {
 	return rcu_dereference_protected(memcg->nodeinfo[nid]->shrinker_info,
-					 lockdep_is_held(&shrinker_rwsem));
+					 lockdep_is_held(&shrinker_mutex));
 }
 
 static struct shrinker_info *shrinker_info_rcu(struct mem_cgroup *memcg,
@@ -158,7 +158,7 @@ static int expand_shrinker_info(int new_id)
 	int new_size, old_size = 0;
 	struct mem_cgroup *memcg;
 
-	down_write(&shrinker_rwsem);
+	mutex_lock(&shrinker_mutex);
 
 	if (!root_mem_cgroup)
 		goto out;
@@ -179,7 +179,7 @@ static int expand_shrinker_info(int new_id)
 	if (!ret)
 		shrinker_nr_max = new_nr_max;
 
-	up_write(&shrinker_rwsem);
+	mutex_unlock(&shrinker_mutex);
 
 	return ret;
 }
@@ -303,7 +303,7 @@ void reparent_shrinker_deferred(struct mem_cgroup *memcg)
 		parent = root_mem_cgroup;
 
 	/* Prevent from concurrent shrinker_info expand */
-	down_write(&shrinker_rwsem);
+	mutex_lock(&shrinker_mutex);
 	for_each_node(nid) {
 		child_info = shrinker_info_protected(memcg, nid);
 		parent_info = shrinker_info_protected(parent, nid);
@@ -316,7 +316,7 @@ void reparent_shrinker_deferred(struct mem_cgroup *memcg)
 			}
 		}
 	}
-	up_write(&shrinker_rwsem);
+	mutex_unlock(&shrinker_mutex);
 }
 #else
 static int shrinker_memcg_alloc(struct shrinker *shrinker)
diff --git a/mm/shrinker_debug.c b/mm/shrinker_debug.c
index badda35464c3..44b620b1919d 100644
--- a/mm/shrinker_debug.c
+++ b/mm/shrinker_debug.c
@@ -8,7 +8,7 @@
 #include <linux/rculist.h>
 
 /* defined in vmscan.c */
-extern struct rw_semaphore shrinker_rwsem;
+extern struct mutex shrinker_mutex;
 extern struct list_head shrinker_list;
 
 static DEFINE_IDA(shrinker_debugfs_ida);
@@ -168,7 +168,7 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
 	if (!shrinker_debugfs_root)
 		return 0;
 
-	down_write(&shrinker_rwsem);
+	mutex_lock(&shrinker_mutex);
 	if (shrinker->debugfs_entry)
 		goto fail;
 
@@ -196,7 +196,7 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
 			    &shrinker_debugfs_scan_fops);
 
 fail:
-	up_write(&shrinker_rwsem);
+	mutex_unlock(&shrinker_mutex);
 	return ret;
 }
 
@@ -215,7 +215,7 @@ int shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...)
 	if (!new)
 		return -ENOMEM;
 
-	down_write(&shrinker_rwsem);
+	mutex_lock(&shrinker_mutex);
 
 	old = shrinker->name;
 	shrinker->name = new;
@@ -233,7 +233,7 @@ int shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...)
 			shrinker->debugfs_entry = entry;
 	}
 
-	up_write(&shrinker_rwsem);
+	mutex_unlock(&shrinker_mutex);
 
 	kfree_const(old);
 
@@ -246,7 +246,7 @@ struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
 {
 	struct dentry *entry = shrinker->debugfs_entry;
 
-	down_write(&shrinker_rwsem);
+	mutex_lock(&shrinker_mutex);
 	kfree_const(shrinker->name);
 	shrinker->name = NULL;
 
@@ -257,7 +257,7 @@ struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
 	 */
 	smp_wmb();
 	shrinker->debugfs_entry = NULL;
-	up_write(&shrinker_rwsem);
+	mutex_unlock(&shrinker_mutex);
 
 	return entry;
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:56:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:56:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568627.888302 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsJ3-0003ph-Qk; Mon, 24 Jul 2023 09:56:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568627.888302; Mon, 24 Jul 2023 09:56:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsJ3-0003pa-O5; Mon, 24 Jul 2023 09:56:45 +0000
Received: by outflank-mailman (input) for mailman id 568627;
 Mon, 24 Jul 2023 09:56:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsJ1-0003pU-Lh
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:56:43 +0000
Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com
 [2607:f8b0:4864:20::42c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 63b2cc17-2a08-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:56:42 +0200 (CEST)
Received: by mail-pf1-x42c.google.com with SMTP id
 d2e1a72fcca58-682ae5d4184so1051746b3a.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:56:42 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 y1-20020aa78541000000b00682aac1e2b8sm7356787pfn.60.2023.07.24.02.56.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 24 Jul 2023 02:56:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 63b2cc17-2a08-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192601; x=1690797401;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=am2eIoStEhYj6reS+R983QZxh6h3W0xYr71gNNToCQ8=;
        b=OlJHj1/yO42yQ42YyfDdqtfuDdXGGV/WQ0GpL38YIfO5RJZmkcdCx+PepLtkyGVzEN
         bTK4LhGsJI+OJKO7VuvlEDj/aPd3bZAexndKWivptO/xeLBD7J/JCOubjicjaVNWXLQ5
         H6fB+0YsEx63uc5TiCs20sSEjZ3JxRWkjZHG3LQbatv3J9k4pmh0VpqAg7R562nbzzly
         s71ebLgHH+wdbZuHYfqIuXfOS4H3wCLtxZ6Rqc556hBiF9jLddR68NJcthdMi5JsNo9F
         fUAZvFHEDsznNwsCMgykOwv5P0YMuteT/vvRsXd6nvRv9Clc/Ic3a7YeuRAtFe+vPCu7
         EZug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192601; x=1690797401;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=am2eIoStEhYj6reS+R983QZxh6h3W0xYr71gNNToCQ8=;
        b=ijq8OemdaTZp24RCnF5Hkyvf2oCTx2U++K+EBQKl6KtOFVt1mgo7pA2nJpMi0UtWs4
         AG8txnG1kDs9RbYbT0WpigPPjPYVK8Cy+2ZImL5m/scYFXh0Sr0jywW+81bbRCdzUKyg
         BENGpNz1IfmpOrYuoL4HMrHOBF+7tFtkp3IcYa5CaoCpcsnhQO0AZPFmv+XjokSJwvQQ
         RWuNWP4+2f0PV+2mOVtrDMhfPCJQWULMW8gBOCAGeZUMTknoDqopmMyupb6JjgZqOsCG
         iPTvh/2hCqFe9DWw1u/8AMkThnUng8z+XkOOhfy8Hr4n7p7ryFtLkRe+N2j+ZmqCNLEG
         +c7w==
X-Gm-Message-State: ABy/qLawimyUMFeUPE1yj7BJeBrjC/Ij7Rpi2owbJcihevfAktknBbMD
	2rSxDx96bV8Th/+4K9bibZW3gQ==
X-Google-Smtp-Source: APBJJlEtnCzvJ6I1rkWEELadVXHfZtUE/plpWIuGp/MFKpOvTS509ssN84iHDxA1POdeL3+D21rKQg==
X-Received: by 2002:a05:6a20:8e04:b0:137:3941:17b3 with SMTP id y4-20020a056a208e0400b00137394117b3mr14532126pzj.6.1690192601020;
        Mon, 24 Jul 2023 02:56:41 -0700 (PDT)
Message-ID: <7b4eb3fa-1ebd-de07-1a16-9533b069a66e@bytedance.com>
Date: Mon, 24 Jul 2023 17:56:27 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 05/47] binder: dynamically allocate the android-binder
 shrinker
Content-Language: en-US
To: akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru,
 vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org,
 brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com,
 cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com,
 gregkh@linuxfoundation.org, muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-6-zhengqi.arch@bytedance.com>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <20230724094354.90817-6-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit


This patch depends on the patch: 
https://lore.kernel.org/lkml/20230625154937.64316-1-qi.zheng@linux.dev/



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:57:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:57:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568629.888313 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsJd-0004K5-4Q; Mon, 24 Jul 2023 09:57:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568629.888313; Mon, 24 Jul 2023 09:57:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsJd-0004Jy-0u; Mon, 24 Jul 2023 09:57:21 +0000
Received: by outflank-mailman (input) for mailman id 568629;
 Mon, 24 Jul 2023 09:57:19 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsD3-0007Pe-IW
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:50:33 +0000
Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com
 [2607:f8b0:4864:20::1029])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 86d4b8c1-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:50:31 +0200 (CEST)
Received: by mail-pj1-x1029.google.com with SMTP id
 98e67ed59e1d1-2680edb9767so229952a91.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:50:31 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.50.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:50:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 86d4b8c1-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192230; x=1690797030;
        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=h5Pgz5o85vjRJX2NAYGHXGIfrVWxEYXMNean3UujJOE=;
        b=HTXrSeoRNfCylQUvp3rA93XfC5B9ZAm1jE2rq6Hxhf34WiOMuxDD1meCGjwu9EwIX7
         ZbtHbS4fRmsyA8f1AQ95KeA8pk2Wu8dqsEYadFuPM8kR0aC/DghUlOU1O4pFRVVN27md
         Jz3ZRGJgXj2574vm45/AlAwiQEEVW+fNcrUB9gqDXxsp5xfvZzaaREkRLWgNT154mbaN
         kLE4oZiRvqBvE8wXvErAyC7133TniCzwa8RrEDkzsepAqin0to9X/dlSZmLYhsSlZCfb
         1LIBzBngTPhlUQBluPspeHfucBGL5ud/FkBEqD4eyTXeqLx9y9KdZjNraR8njMzNn3Wl
         0XdQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192230; x=1690797030;
        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=h5Pgz5o85vjRJX2NAYGHXGIfrVWxEYXMNean3UujJOE=;
        b=btzh2D4U9Wyc9YSx+2kmub6JUPbAfMvkz30bWKrVNZ/kip9ka7A5PSJsqbndAbwlOE
         UIU2EFnf8y1uetApeqSeFfq660gDpe+H1t6jMQvMcvSOLnXC8JtSZKtbEChL5Nw3Tc3U
         Y9NMyIJwcdWnkzhhZhTcqTbjbGR4qYeCrfb3dYSN4tYbkTsUpEpU4U+/q2q+6OR3IKVO
         whndvyPwbL+PdPt3rmHKLqNkSHXC16qXSMp+SIAv4Q3kEnG9y8PTUqiRoGuu6UWpMLov
         lQfPZr6jrx/8MP9VvxVv5GxO5QPfWAITXCTlgUXfOyTBBWSwt6aMle/xWZOJlfUTNXjt
         WGng==
X-Gm-Message-State: ABy/qLYrmm3GTJetX/JJgpEvvUxoaDhwFGXiDM0w84UsNof1iB7Pkm7A
	CkQf4OWu4qRFXzY6WEjbrNqgOQ==
X-Google-Smtp-Source: APBJJlEuFsN94AIprk7ia8ABwlM0Slt2XXWIAtSq+6lqm1qdEZFYXWzDVMuJVyeP2h9BJXp/48ZO1g==
X-Received: by 2002:a17:90a:5a4c:b0:263:1e82:2dc7 with SMTP id m12-20020a17090a5a4c00b002631e822dc7mr8465919pji.0.1690192230524;
        Mon, 24 Jul 2023 02:50:30 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 27/47] md/raid5: dynamically allocate the md-raid5 shrinker
Date: Mon, 24 Jul 2023 17:43:34 +0800
Message-Id: <20230724094354.90817-28-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the md-raid5 shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct r5conf.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 drivers/md/raid5.c | 25 ++++++++++++++-----------
 drivers/md/raid5.h |  2 +-
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 85b3004594e0..12443dfb7aeb 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7414,7 +7414,7 @@ static void free_conf(struct r5conf *conf)
 
 	log_exit(conf);
 
-	unregister_shrinker(&conf->shrinker);
+	shrinker_unregister(conf->shrinker);
 	free_thread_groups(conf);
 	shrink_stripes(conf);
 	raid5_free_percpu(conf);
@@ -7462,7 +7462,7 @@ static int raid5_alloc_percpu(struct r5conf *conf)
 static unsigned long raid5_cache_scan(struct shrinker *shrink,
 				      struct shrink_control *sc)
 {
-	struct r5conf *conf = container_of(shrink, struct r5conf, shrinker);
+	struct r5conf *conf = shrink->private_data;
 	unsigned long ret = SHRINK_STOP;
 
 	if (mutex_trylock(&conf->cache_size_mutex)) {
@@ -7483,7 +7483,7 @@ static unsigned long raid5_cache_scan(struct shrinker *shrink,
 static unsigned long raid5_cache_count(struct shrinker *shrink,
 				       struct shrink_control *sc)
 {
-	struct r5conf *conf = container_of(shrink, struct r5conf, shrinker);
+	struct r5conf *conf = shrink->private_data;
 
 	if (conf->max_nr_stripes < conf->min_nr_stripes)
 		/* unlikely, but not impossible */
@@ -7718,18 +7718,21 @@ static struct r5conf *setup_conf(struct mddev *mddev)
 	 * it reduces the queue depth and so can hurt throughput.
 	 * So set it rather large, scaled by number of devices.
 	 */
-	conf->shrinker.seeks = DEFAULT_SEEKS * conf->raid_disks * 4;
-	conf->shrinker.scan_objects = raid5_cache_scan;
-	conf->shrinker.count_objects = raid5_cache_count;
-	conf->shrinker.batch = 128;
-	conf->shrinker.flags = 0;
-	ret = register_shrinker(&conf->shrinker, "md-raid5:%s", mdname(mddev));
-	if (ret) {
-		pr_warn("md/raid:%s: couldn't register shrinker.\n",
+	conf->shrinker = shrinker_alloc(0, "md-raid5:%s", mdname(mddev));
+	if (!conf->shrinker) {
+		pr_warn("md/raid:%s: couldn't allocate shrinker.\n",
 			mdname(mddev));
 		goto abort;
 	}
 
+	conf->shrinker->seeks = DEFAULT_SEEKS * conf->raid_disks * 4;
+	conf->shrinker->scan_objects = raid5_cache_scan;
+	conf->shrinker->count_objects = raid5_cache_count;
+	conf->shrinker->batch = 128;
+	conf->shrinker->private_data = conf;
+
+	shrinker_register(conf->shrinker);
+
 	sprintf(pers_name, "raid%d", mddev->new_level);
 	rcu_assign_pointer(conf->thread,
 			   md_register_thread(raid5d, mddev, pers_name));
diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h
index 97a795979a35..22bea20eccbd 100644
--- a/drivers/md/raid5.h
+++ b/drivers/md/raid5.h
@@ -670,7 +670,7 @@ struct r5conf {
 	wait_queue_head_t	wait_for_stripe;
 	wait_queue_head_t	wait_for_overlap;
 	unsigned long		cache_state;
-	struct shrinker		shrinker;
+	struct shrinker		*shrinker;
 	int			pool_size; /* number of disks in stripeheads in pool */
 	spinlock_t		device_lock;
 	struct disk_info	*disks;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:57:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:57:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568630.888322 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsJe-0004aq-Cw; Mon, 24 Jul 2023 09:57:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568630.888322; Mon, 24 Jul 2023 09:57:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsJe-0004aj-9j; Mon, 24 Jul 2023 09:57:22 +0000
Received: by outflank-mailman (input) for mailman id 568630;
 Mon, 24 Jul 2023 09:57:21 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsDR-0007Pe-Mu
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:50:57 +0000
Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com
 [2607:f8b0:4864:20::62e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 95172630-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:50:55 +0200 (CEST)
Received: by mail-pl1-x62e.google.com with SMTP id
 d9443c01a7336-1bb91c20602so2232375ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:50:55 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.50.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:50:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 95172630-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192254; x=1690797054;
        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=qE79rW9nQFdZueatbKkJSwG7PQvomLDBWPiy7CJ1pOw=;
        b=M5PackbLD4uz3PJU8ZrV6Y6kpl/UkDSiJMWkyeKo1o/QqggjCRDFeggmumRocssEkO
         U5pgVFb8eWXMORlIOr1ePtq+FK8kOLkQFNqmDuq4b+d33HgRHPfZYHAMUXUlROjpk8+o
         J1M8uQcskFRR53Czt+aOUFg/PIJgAadgSulzfayHiil7eFnaN+rquA9rpl4WBOKlzYvu
         UE9+Mze0Myg1eBjhHiRU9V6RNrQVMPxaTSp0Rfud/ExFs8cbE/oAjSNMW4v95hOWnnh1
         IBtexczqggdcPw8iGrtFLB0PL+o6pwYWvLTFYmwk22wyiYE0MeWKeaT0SoMLZVVWr3fx
         Grfg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192254; x=1690797054;
        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=qE79rW9nQFdZueatbKkJSwG7PQvomLDBWPiy7CJ1pOw=;
        b=GQ1ekgGAevLBZhG0UzLD8IU2Q1eUP0SmADj0TNAsIaXKY9BCeflk1NxNWrEMLFwQqE
         G3glmZG4f/c+5YaO6nxk4zgiisphs1j8rLV1QCD5J0aQqaqvZIsg1sfoVYtw3Es39FU/
         +YSp1hVk4uat/ZDIeFycT3gFOH2e+/uR8RS9vbM/8fPDq8zAZ7EPdky1M2kcipp0mkTy
         /a9rN+GbTTd2L3KM+PPb9NPbY3nS96RfxLaNwmR6OsRboLwP0eUBIFybJakBPaygeFfw
         fpykixctzUZT5fstOUYh+NtW/19Q+hIfQQVunUYWdoV/gtqI8GL+W805bPQJ4XR5qpiE
         DTiA==
X-Gm-Message-State: ABy/qLbKqtGctd2Iq7dhep3cFc9B5kiXSfB9GZurHsuAAqlBdWbjf3g7
	irVg4A/Xq8NZkGhLuOyapMiwgw==
X-Google-Smtp-Source: APBJJlFDDpJsPsXaM9K0eN3GbgFDnugc0MZ81V5AeEkSNRv9osxW0v212MSH0egY7R7+BB7SiCdLdQ==
X-Received: by 2002:a17:902:e802:b0:1b3:d4bb:3515 with SMTP id u2-20020a170902e80200b001b3d4bb3515mr12388503plg.0.1690192254453;
        Mon, 24 Jul 2023 02:50:54 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 29/47] vmw_balloon: dynamically allocate the vmw-balloon shrinker
Date: Mon, 24 Jul 2023 17:43:36 +0800
Message-Id: <20230724094354.90817-30-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the vmw-balloon shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct vmballoon.

And we can simply exit vmballoon_init() when registering the shrinker
fails. So the shrinker_registered indication is redundant, just remove it.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 drivers/misc/vmw_balloon.c | 38 ++++++++++++--------------------------
 1 file changed, 12 insertions(+), 26 deletions(-)

diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c
index 9ce9b9e0e9b6..d216d4dc042e 100644
--- a/drivers/misc/vmw_balloon.c
+++ b/drivers/misc/vmw_balloon.c
@@ -380,16 +380,7 @@ struct vmballoon {
 	/**
 	 * @shrinker: shrinker interface that is used to avoid over-inflation.
 	 */
-	struct shrinker shrinker;
-
-	/**
-	 * @shrinker_registered: whether the shrinker was registered.
-	 *
-	 * The shrinker interface does not handle gracefully the removal of
-	 * shrinker that was not registered before. This indication allows to
-	 * simplify the unregistration process.
-	 */
-	bool shrinker_registered;
+	struct shrinker *shrinker;
 };
 
 static struct vmballoon balloon;
@@ -1568,29 +1559,27 @@ static unsigned long vmballoon_shrinker_count(struct shrinker *shrinker,
 
 static void vmballoon_unregister_shrinker(struct vmballoon *b)
 {
-	if (b->shrinker_registered)
-		unregister_shrinker(&b->shrinker);
-	b->shrinker_registered = false;
+	shrinker_unregister(b->shrinker);
 }
 
 static int vmballoon_register_shrinker(struct vmballoon *b)
 {
-	int r;
-
 	/* Do nothing if the shrinker is not enabled */
 	if (!vmwballoon_shrinker_enable)
 		return 0;
 
-	b->shrinker.scan_objects = vmballoon_shrinker_scan;
-	b->shrinker.count_objects = vmballoon_shrinker_count;
-	b->shrinker.seeks = DEFAULT_SEEKS;
+	b->shrinker = shrinker_alloc(0, "vmw-balloon");
+	if (!b->shrinker)
+		return -ENOMEM;
 
-	r = register_shrinker(&b->shrinker, "vmw-balloon");
+	b->shrinker->scan_objects = vmballoon_shrinker_scan;
+	b->shrinker->count_objects = vmballoon_shrinker_count;
+	b->shrinker->seeks = DEFAULT_SEEKS;
+	b->shrinker->private_data = b;
 
-	if (r == 0)
-		b->shrinker_registered = true;
+	shrinker_register(b->shrinker);
 
-	return r;
+	return 0;
 }
 
 /*
@@ -1883,7 +1872,7 @@ static int __init vmballoon_init(void)
 
 	error = vmballoon_register_shrinker(&balloon);
 	if (error)
-		goto fail;
+		return error;
 
 	/*
 	 * Initialization of compaction must be done after the call to
@@ -1905,9 +1894,6 @@ static int __init vmballoon_init(void)
 	vmballoon_debugfs_init(&balloon);
 
 	return 0;
-fail:
-	vmballoon_unregister_shrinker(&balloon);
-	return error;
 }
 
 /*
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:57:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:57:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568636.888333 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsJf-0004s4-RA; Mon, 24 Jul 2023 09:57:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568636.888333; Mon, 24 Jul 2023 09:57:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsJf-0004rq-NT; Mon, 24 Jul 2023 09:57:23 +0000
Received: by outflank-mailman (input) for mailman id 568636;
 Mon, 24 Jul 2023 09:57:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsDc-0005oA-GD
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:51:08 +0000
Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com
 [2607:f8b0:4864:20::536])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9c3d1834-2a07-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:51:08 +0200 (CEST)
Received: by mail-pg1-x536.google.com with SMTP id
 41be03b00d2f7-51f64817809so328156a12.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:51:07 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.50.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:51:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9c3d1834-2a07-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192266; x=1690797066;
        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=oVZBD26n61nILm1319d0FZlD/fP50Fwp7YtrZB2yUEw=;
        b=iUPcJgUMyrTLwgrjrlC+a27y9vEWwy56+puOu64xedJv2ncHtSqDNqiSeynerud5CA
         SLWVqH1nGCnKkpkX8dkzmoG0eMRym5h6Xzfw/4y3ynxDe9x5fP4GtDEbYlXCEU4KGmnh
         J8JMlwHQENpmCB/IBQ5Kj/D3RaklR5mhQ3KWpjAIq5ncgA2kgZ+m8lyKEtRUg3xIXkRf
         1Y+VworbTR0lkfVEfm55Dde1LFRd3k61KtabNyesWRzHMD8tamW6ciBekSSPn4dMEieQ
         RK4Z2ABaXDMl+MwOvSJ5/Kn72pZwCqkmqC5YhlHMVnLFWPN8jgdPeYJAkwxf5yUyP5GW
         rA2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192266; x=1690797066;
        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=oVZBD26n61nILm1319d0FZlD/fP50Fwp7YtrZB2yUEw=;
        b=JpkLbMoFOTVHI0fuWd9ZxZyGSD5QpL8DY2eBFsvsWHi+g8G/FpzImmOZ73vG8VmZ0X
         NoFbtvzSmOKDQwBA3ndUqvlWAL5svkG1UF6HTFzdMGUvf8h+cVAg+dpLgoASJDYGH6h7
         zuoDJtSHP76oaO/fuK6SXGaGYRFdw9ejx18AHrBgR/DjoBcGxzbwSGjMD8mvw7AGQD+l
         ThIHYgLRN8LZhz3yYSxjGBU7NUBWvB8gX1wSNhA2vJrE5nUqzReI4ALuSqBhrwb4c5kE
         6hmUyRBGGlByFAp2IzgzKehR/CSOnogmdryCh14xJi56hRM+qCxSGrLg+iVfmagjJlGl
         6Z0A==
X-Gm-Message-State: ABy/qLbSPVUdg0/ijohYf7wOo87XLQ/L5piNLFFqGgTPUVwlrFWgZIXx
	fYWE+IVBBxFg+s1+9PyWeBcGxQ==
X-Google-Smtp-Source: APBJJlFQ+sAFI6LIZ7PgU9puTnlNzbjLYXvmJ0kfMmGkS9XBnuUvcLZ7El1l1GYgUvVEvdh+XgkfrQ==
X-Received: by 2002:a17:902:e74d:b0:1bb:ac37:384b with SMTP id p13-20020a170902e74d00b001bbac37384bmr1242952plf.6.1690192266338;
        Mon, 24 Jul 2023 02:51:06 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 30/47] virtio_balloon: dynamically allocate the virtio-balloon shrinker
Date: Mon, 24 Jul 2023 17:43:37 +0800
Message-Id: <20230724094354.90817-31-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the virtio-balloon shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct virtio_balloon.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 drivers/virtio/virtio_balloon.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 5b15936a5214..d773860c3b18 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -111,7 +111,7 @@ struct virtio_balloon {
 	struct virtio_balloon_stat stats[VIRTIO_BALLOON_S_NR];
 
 	/* Shrinker to return free pages - VIRTIO_BALLOON_F_FREE_PAGE_HINT */
-	struct shrinker shrinker;
+	struct shrinker *shrinker;
 
 	/* OOM notifier to deflate on OOM - VIRTIO_BALLOON_F_DEFLATE_ON_OOM */
 	struct notifier_block oom_nb;
@@ -816,8 +816,7 @@ static unsigned long shrink_free_pages(struct virtio_balloon *vb,
 static unsigned long virtio_balloon_shrinker_scan(struct shrinker *shrinker,
 						  struct shrink_control *sc)
 {
-	struct virtio_balloon *vb = container_of(shrinker,
-					struct virtio_balloon, shrinker);
+	struct virtio_balloon *vb = shrinker->private_data;
 
 	return shrink_free_pages(vb, sc->nr_to_scan);
 }
@@ -825,8 +824,7 @@ static unsigned long virtio_balloon_shrinker_scan(struct shrinker *shrinker,
 static unsigned long virtio_balloon_shrinker_count(struct shrinker *shrinker,
 						   struct shrink_control *sc)
 {
-	struct virtio_balloon *vb = container_of(shrinker,
-					struct virtio_balloon, shrinker);
+	struct virtio_balloon *vb = shrinker->private_data;
 
 	return vb->num_free_page_blocks * VIRTIO_BALLOON_HINT_BLOCK_PAGES;
 }
@@ -847,16 +845,23 @@ static int virtio_balloon_oom_notify(struct notifier_block *nb,
 
 static void virtio_balloon_unregister_shrinker(struct virtio_balloon *vb)
 {
-	unregister_shrinker(&vb->shrinker);
+	shrinker_unregister(vb->shrinker);
 }
 
 static int virtio_balloon_register_shrinker(struct virtio_balloon *vb)
 {
-	vb->shrinker.scan_objects = virtio_balloon_shrinker_scan;
-	vb->shrinker.count_objects = virtio_balloon_shrinker_count;
-	vb->shrinker.seeks = DEFAULT_SEEKS;
+	vb->shrinker = shrinker_alloc(0, "virtio-balloon");
+	if (!vb->shrinker)
+		return -ENOMEM;
 
-	return register_shrinker(&vb->shrinker, "virtio-balloon");
+	vb->shrinker->scan_objects = virtio_balloon_shrinker_scan;
+	vb->shrinker->count_objects = virtio_balloon_shrinker_count;
+	vb->shrinker->seeks = DEFAULT_SEEKS;
+	vb->shrinker->private_data = vb;
+
+	shrinker_register(vb->shrinker);
+
+	return 0;
 }
 
 static int virtballoon_probe(struct virtio_device *vdev)
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:57:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:57:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568637.888339 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsJg-0004w4-9b; Mon, 24 Jul 2023 09:57:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568637.888339; Mon, 24 Jul 2023 09:57:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsJg-0004va-26; Mon, 24 Jul 2023 09:57:24 +0000
Received: by outflank-mailman (input) for mailman id 568637;
 Mon, 24 Jul 2023 09:57:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsFX-0005oA-OD
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:53:07 +0000
Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com
 [2607:f8b0:4864:20::630])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e35cfa25-2a07-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:53:07 +0200 (CEST)
Received: by mail-pl1-x630.google.com with SMTP id
 d9443c01a7336-1b867f9198dso8906025ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:53:07 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.52.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:53:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e35cfa25-2a07-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192386; x=1690797186;
        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=5g6npGIA+Om/kUVtGYVOvbagC3ZLyiKj4WIBQXCM8VE=;
        b=S2U/TnIA3BvgIyDkI8CsZ/yGFHKz1H8MS/f3pGlXtajPbbIppzU4ekfHL7vbq4g/ee
         nkf99zZjxk8j/nQjCgbgKMXC9ObMD83Ww5ZyYdUYjsuItMzxm4Wsn6u5uqxvVJ5NZt73
         oOt/92HNqWFmybRGcw0zXn+oMfRVMEsr/DoqAZVnk2ZNsy7sblyXn+NZzmRKVz6cNdRV
         wWtdi5bD+tAEC91We9COVwQH6n4HnMN8tXvp4wHRFfihGnGQMhJey9Jy141oS1MYMhJE
         j+pvADu7PynqQJvb+d3VqI6dVhi2sWMN+NPa+E6Stx9k9uciZAdzPwJ0PeFQ9YZYARAb
         3C3A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192386; x=1690797186;
        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=5g6npGIA+Om/kUVtGYVOvbagC3ZLyiKj4WIBQXCM8VE=;
        b=A7tphceu0zJqDn1ImHPQdGyMGKurnSAxH83URSzlGjLEhBItx5oHI7GwhZzMPTC7ht
         QQjpPmCrJIMzm9uvk9DHP+Lc104hrBJXbBkxyhNtVwzQYktzMa6Rlw9nJUd0zvI2xRXO
         5PHWpo/TxvZgmQC2ZaSDiAzwOWdsm5LGDJM2oAum5Nnykn0sE8/IPJguAOeMpiFP34IE
         wmzTXn5n2rCkpPc+r3jDq9VaJ7d3QCcgKRep+J6HG6KoSJlojqLxnU0JcEi/nPDi0xiZ
         ByOc59uPiTYZ7a0pfJwq0Q3nIGlb05AB//Gf2DMrDrD0zdgH9g2rQTHeRmI56Y//eROo
         Inog==
X-Gm-Message-State: ABy/qLYSpCiUscln0m9lqcyDjzkEmPdcHrAnzSLsmHcSOhQ3M356iGHM
	XLlP/cSjDhkg/Xg7IoocNL21KA==
X-Google-Smtp-Source: APBJJlEx0UJtyjeglsteyzH1DFG53jEzFogOJaFJ6A1FWxhCOYZ9xoBbTcFIdBRvvwYlgD9HKyyPmg==
X-Received: by 2002:a17:902:ce92:b0:1b8:1591:9f81 with SMTP id f18-20020a170902ce9200b001b815919f81mr12186048plg.4.1690192385749;
        Mon, 24 Jul 2023 02:53:05 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 40/47] fs: super: dynamically allocate the s_shrink
Date: Mon, 24 Jul 2023 17:43:47 +0800
Message-Id: <20230724094354.90817-41-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the s_shrink, so that it can be freed asynchronously
using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical
section when releasing the struct super_block.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/btrfs/super.c   |  2 +-
 fs/kernfs/mount.c  |  2 +-
 fs/proc/root.c     |  2 +-
 fs/super.c         | 37 +++++++++++++++++++++----------------
 include/linux/fs.h |  2 +-
 5 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index f1dd172d8d5b..fad4ded26c80 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1513,7 +1513,7 @@ static struct dentry *btrfs_mount_root(struct file_system_type *fs_type,
 			error = -EBUSY;
 	} else {
 		snprintf(s->s_id, sizeof(s->s_id), "%pg", bdev);
-		shrinker_debugfs_rename(&s->s_shrink, "sb-%s:%s", fs_type->name,
+		shrinker_debugfs_rename(s->s_shrink, "sb-%s:%s", fs_type->name,
 					s->s_id);
 		btrfs_sb(s)->bdev_holder = fs_type;
 		error = btrfs_fill_super(s, fs_devices, data);
diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c
index d49606accb07..2657ff1181f1 100644
--- a/fs/kernfs/mount.c
+++ b/fs/kernfs/mount.c
@@ -256,7 +256,7 @@ static int kernfs_fill_super(struct super_block *sb, struct kernfs_fs_context *k
 	sb->s_time_gran = 1;
 
 	/* sysfs dentries and inodes don't require IO to create */
-	sb->s_shrink.seeks = 0;
+	sb->s_shrink->seeks = 0;
 
 	/* get root inode, initialize and unlock it */
 	down_read(&kf_root->kernfs_rwsem);
diff --git a/fs/proc/root.c b/fs/proc/root.c
index a86e65a608da..22b78b28b477 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -188,7 +188,7 @@ static int proc_fill_super(struct super_block *s, struct fs_context *fc)
 	s->s_stack_depth = FILESYSTEM_MAX_STACK_DEPTH;
 
 	/* procfs dentries and inodes don't require IO to create */
-	s->s_shrink.seeks = 0;
+	s->s_shrink->seeks = 0;
 
 	pde_get(&proc_root);
 	root_inode = proc_get_inode(s, &proc_root);
diff --git a/fs/super.c b/fs/super.c
index e781226e2880..04643fd80886 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -67,7 +67,7 @@ static unsigned long super_cache_scan(struct shrinker *shrink,
 	long	dentries;
 	long	inodes;
 
-	sb = container_of(shrink, struct super_block, s_shrink);
+	sb = shrink->private_data;
 
 	/*
 	 * Deadlock avoidance.  We may hold various FS locks, and we don't want
@@ -120,7 +120,7 @@ static unsigned long super_cache_count(struct shrinker *shrink,
 	struct super_block *sb;
 	long	total_objects = 0;
 
-	sb = container_of(shrink, struct super_block, s_shrink);
+	sb = shrink->private_data;
 
 	/*
 	 * We don't call trylock_super() here as it is a scalability bottleneck,
@@ -182,7 +182,8 @@ static void destroy_unused_super(struct super_block *s)
 	security_sb_free(s);
 	put_user_ns(s->s_user_ns);
 	kfree(s->s_subtype);
-	free_prealloced_shrinker(&s->s_shrink);
+	if (s->s_shrink)
+		shrinker_free_non_registered(s->s_shrink);
 	/* no delays needed */
 	destroy_super_work(&s->destroy_work);
 }
@@ -259,16 +260,20 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags,
 	s->s_time_min = TIME64_MIN;
 	s->s_time_max = TIME64_MAX;
 
-	s->s_shrink.seeks = DEFAULT_SEEKS;
-	s->s_shrink.scan_objects = super_cache_scan;
-	s->s_shrink.count_objects = super_cache_count;
-	s->s_shrink.batch = 1024;
-	s->s_shrink.flags = SHRINKER_NUMA_AWARE | SHRINKER_MEMCG_AWARE;
-	if (prealloc_shrinker(&s->s_shrink, "sb-%s", type->name))
+	s->s_shrink = shrinker_alloc(SHRINKER_NUMA_AWARE | SHRINKER_MEMCG_AWARE,
+				     "sb-%s", type->name);
+	if (!s->s_shrink)
 		goto fail;
-	if (list_lru_init_memcg(&s->s_dentry_lru, &s->s_shrink))
+
+	s->s_shrink->seeks = DEFAULT_SEEKS;
+	s->s_shrink->scan_objects = super_cache_scan;
+	s->s_shrink->count_objects = super_cache_count;
+	s->s_shrink->batch = 1024;
+	s->s_shrink->private_data = s;
+
+	if (list_lru_init_memcg(&s->s_dentry_lru, s->s_shrink))
 		goto fail;
-	if (list_lru_init_memcg(&s->s_inode_lru, &s->s_shrink))
+	if (list_lru_init_memcg(&s->s_inode_lru, s->s_shrink))
 		goto fail;
 	return s;
 
@@ -326,7 +331,7 @@ void deactivate_locked_super(struct super_block *s)
 {
 	struct file_system_type *fs = s->s_type;
 	if (atomic_dec_and_test(&s->s_active)) {
-		unregister_shrinker(&s->s_shrink);
+		shrinker_unregister(s->s_shrink);
 		fs->kill_sb(s);
 
 		/*
@@ -599,7 +604,7 @@ struct super_block *sget_fc(struct fs_context *fc,
 	hlist_add_head(&s->s_instances, &s->s_type->fs_supers);
 	spin_unlock(&sb_lock);
 	get_filesystem(s->s_type);
-	register_shrinker_prepared(&s->s_shrink);
+	shrinker_register(s->s_shrink);
 	return s;
 
 share_extant_sb:
@@ -678,7 +683,7 @@ struct super_block *sget(struct file_system_type *type,
 	hlist_add_head(&s->s_instances, &type->fs_supers);
 	spin_unlock(&sb_lock);
 	get_filesystem(type);
-	register_shrinker_prepared(&s->s_shrink);
+	shrinker_register(s->s_shrink);
 	return s;
 }
 EXPORT_SYMBOL(sget);
@@ -1312,7 +1317,7 @@ int get_tree_bdev(struct fs_context *fc,
 		down_write(&s->s_umount);
 	} else {
 		snprintf(s->s_id, sizeof(s->s_id), "%pg", bdev);
-		shrinker_debugfs_rename(&s->s_shrink, "sb-%s:%s",
+		shrinker_debugfs_rename(s->s_shrink, "sb-%s:%s",
 					fc->fs_type->name, s->s_id);
 		sb_set_blocksize(s, block_size(bdev));
 		error = fill_super(s, fc);
@@ -1385,7 +1390,7 @@ struct dentry *mount_bdev(struct file_system_type *fs_type,
 		down_write(&s->s_umount);
 	} else {
 		snprintf(s->s_id, sizeof(s->s_id), "%pg", bdev);
-		shrinker_debugfs_rename(&s->s_shrink, "sb-%s:%s",
+		shrinker_debugfs_rename(s->s_shrink, "sb-%s:%s",
 					fs_type->name, s->s_id);
 		sb_set_blocksize(s, block_size(bdev));
 		error = fill_super(s, data, flags & SB_SILENT ? 1 : 0);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index b4dca987a5d8..92748fc368b2 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1231,7 +1231,7 @@ struct super_block {
 
 	const struct dentry_operations *s_d_op; /* default d_op for dentries */
 
-	struct shrinker s_shrink;	/* per-sb shrinker handle */
+	struct shrinker *s_shrink;	/* per-sb shrinker handle */
 
 	/* Number of inodes with nlink == 0 but still referenced */
 	atomic_long_t s_remove_count;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:57:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:57:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568645.888353 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsJl-0005Xj-H4; Mon, 24 Jul 2023 09:57:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568645.888353; Mon, 24 Jul 2023 09:57:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsJl-0005XW-Cd; Mon, 24 Jul 2023 09:57:29 +0000
Received: by outflank-mailman (input) for mailman id 568645;
 Mon, 24 Jul 2023 09:57:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsEy-0005oA-2X
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:52:32 +0000
Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com
 [2607:f8b0:4864:20::534])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ce1deb03-2a07-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:52:31 +0200 (CEST)
Received: by mail-pg1-x534.google.com with SMTP id
 41be03b00d2f7-51f64817809so328350a12.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:52:31 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.52.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:52:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ce1deb03-2a07-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192350; x=1690797150;
        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=guTIXae/kI3JPez6Art55JYiwmImAmg2GBvF3i236eo=;
        b=T5pLZeng3kilrZ5OsnvGTDioSzbaJCT88B3/JHb49aZTbZwkP7SQy7bBJoydE9spSc
         QIxkCjfHPkCmZ3YIN0z+vz21Kuh2hIgEDSPHHynjot/NbMHOuV4niRtD3jI5KIBaaa0O
         QjmZCafpm4KClLD1lVXUS+elEzy69vq+ucFXQ9CjFJ4T1DxZVWoYTT1w3KSYOQJv3GQd
         ajkkZaaoOEQUBpPKcbabEPlKAYj8bt1g6LICLF4Sb/Oh/OZdyOCaK9S/uK8Sx83ZxUOS
         cV5UpYXnJF2ZClJYAKOlUHJYPAwRn2oigN8jrAEhI2JaJXKMB9RmC8T2WtXgjmkuAGWv
         WtUw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192350; x=1690797150;
        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=guTIXae/kI3JPez6Art55JYiwmImAmg2GBvF3i236eo=;
        b=evZCTk+I6jJoXcGgqJs+rKe/6GjYz/ns1CFw9vlkEDPhowVUzUiQJBnOCj3Zym9Xz4
         a3jKdsudBm/zYyLm3wh03SYfu1JeyY3PeIyBrw5NuPXEAkmV6TXBOpLWfySLZGmAnLaT
         ArcGkaE2z74E2bxGVzCW4qhNWId6hg4AiCKuaN4vR1UXVYnR9VI341Bz8sUstLfqHmt2
         eedbXB/4RBT522DGOpr5mEFPSZtZUU7wpBAHcBhJY4q9AZfEStaTXou6tEHSfj9++7CN
         ZVSBVZXdt4wNQmK5UG7RqeYIC8rl0rfj7GHZsTyru3xXD+2BNCiIIDxQFdLJFjk/v+Ku
         5blA==
X-Gm-Message-State: ABy/qLZlZqX19BmuwKW6e2AG+1cJ/IAw9qZOWoT4twIBIphe6AJoPjPZ
	NzcePWM8ktGe5ZrjHkAPedlouw==
X-Google-Smtp-Source: APBJJlHJFdqX7YvzDE87sV65msd4BgjSJaSlmkLSDmv21X9cTIYDURxtd2XgOOda4P7o7DorEuOAJA==
X-Received: by 2002:a17:903:41cd:b0:1bb:9e6e:a9f3 with SMTP id u13-20020a17090341cd00b001bb9e6ea9f3mr4119632ple.4.1690192350104;
        Mon, 24 Jul 2023 02:52:30 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 37/47] xfs: dynamically allocate the xfs-inodegc shrinker
Date: Mon, 24 Jul 2023 17:43:44 +0800
Message-Id: <20230724094354.90817-38-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the xfs-inodegc shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct xfs_mount.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/xfs/xfs_icache.c | 26 +++++++++++++++-----------
 fs/xfs/xfs_mount.c  |  4 ++--
 fs/xfs/xfs_mount.h  |  2 +-
 3 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 453890942d9f..751c380afd5a 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -2225,8 +2225,7 @@ xfs_inodegc_shrinker_count(
 	struct shrinker		*shrink,
 	struct shrink_control	*sc)
 {
-	struct xfs_mount	*mp = container_of(shrink, struct xfs_mount,
-						   m_inodegc_shrinker);
+	struct xfs_mount	*mp = shrink->private_data;
 	struct xfs_inodegc	*gc;
 	int			cpu;
 
@@ -2247,8 +2246,7 @@ xfs_inodegc_shrinker_scan(
 	struct shrinker		*shrink,
 	struct shrink_control	*sc)
 {
-	struct xfs_mount	*mp = container_of(shrink, struct xfs_mount,
-						   m_inodegc_shrinker);
+	struct xfs_mount	*mp = shrink->private_data;
 	struct xfs_inodegc	*gc;
 	int			cpu;
 	bool			no_items = true;
@@ -2284,13 +2282,19 @@ int
 xfs_inodegc_register_shrinker(
 	struct xfs_mount	*mp)
 {
-	struct shrinker		*shrink = &mp->m_inodegc_shrinker;
+	mp->m_inodegc_shrinker = shrinker_alloc(SHRINKER_NONSLAB,
+						"xfs-inodegc:%s",
+						mp->m_super->s_id);
+	if (!mp->m_inodegc_shrinker)
+		return -ENOMEM;
+
+	mp->m_inodegc_shrinker->count_objects = xfs_inodegc_shrinker_count;
+	mp->m_inodegc_shrinker->scan_objects = xfs_inodegc_shrinker_scan;
+	mp->m_inodegc_shrinker->seeks = 0;
+	mp->m_inodegc_shrinker->batch = XFS_INODEGC_SHRINKER_BATCH;
+	mp->m_inodegc_shrinker->private_data = mp;
 
-	shrink->count_objects = xfs_inodegc_shrinker_count;
-	shrink->scan_objects = xfs_inodegc_shrinker_scan;
-	shrink->seeks = 0;
-	shrink->flags = SHRINKER_NONSLAB;
-	shrink->batch = XFS_INODEGC_SHRINKER_BATCH;
+	shrinker_register(mp->m_inodegc_shrinker);
 
-	return register_shrinker(shrink, "xfs-inodegc:%s", mp->m_super->s_id);
+	return 0;
 }
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index fb87ffb48f7f..27c2d24797c9 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -1018,7 +1018,7 @@ xfs_mountfs(
  out_log_dealloc:
 	xfs_log_mount_cancel(mp);
  out_inodegc_shrinker:
-	unregister_shrinker(&mp->m_inodegc_shrinker);
+	shrinker_unregister(mp->m_inodegc_shrinker);
  out_fail_wait:
 	if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp)
 		xfs_buftarg_drain(mp->m_logdev_targp);
@@ -1100,7 +1100,7 @@ xfs_unmountfs(
 #if defined(DEBUG)
 	xfs_errortag_clearall(mp);
 #endif
-	unregister_shrinker(&mp->m_inodegc_shrinker);
+	shrinker_unregister(mp->m_inodegc_shrinker);
 	xfs_free_perag(mp);
 
 	xfs_errortag_del(mp);
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index e2866e7fa60c..562c294ca08e 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -217,7 +217,7 @@ typedef struct xfs_mount {
 	atomic_t		m_agirotor;	/* last ag dir inode alloced */
 
 	/* Memory shrinker to throttle and reprioritize inodegc */
-	struct shrinker		m_inodegc_shrinker;
+	struct shrinker		*m_inodegc_shrinker;
 	/*
 	 * Workqueue item so that we can coalesce multiple inode flush attempts
 	 * into a single flush.
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:57:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:57:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568646.888359 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsJm-0005cD-01; Mon, 24 Jul 2023 09:57:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568646.888359; Mon, 24 Jul 2023 09:57:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsJl-0005bn-Nc; Mon, 24 Jul 2023 09:57:29 +0000
Received: by outflank-mailman (input) for mailman id 568646;
 Mon, 24 Jul 2023 09:57:27 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsCr-0007Pe-Ps
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:50:21 +0000
Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com
 [2607:f8b0:4864:20::631])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7fbdc83d-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:50:20 +0200 (CEST)
Received: by mail-pl1-x631.google.com with SMTP id
 d9443c01a7336-1bb85ed352bso2239225ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:50:20 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.50.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:50:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7fbdc83d-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192218; x=1690797018;
        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=tx0FAlNIhhphM8SETf+9243EVHMgBeYNK+AXzmxIezQ=;
        b=YTfPugmHCk5Giro4CjFOmzbKkI7HJdV0vsDB4TzS6mGnPQKEUemoxYTNWrdu/E93kj
         6rb1na84A/nf6JJQgZLRucXt2LbXOJbRmcuphszkqRQsFezxcJpi7w4b7fLRmYCBPcZF
         4l9Jesyer1cnHOeAOuu1atoBtGOF2Hi89J+wuYgFZbI4os99VTzsysgcXEMrYAOOTtWx
         pJJhhqbwlv5qn9Pf+scc/easkuZhqJ5AueYpxd4sdsrGo5W3f8JKXrqMpLvSxxgZLh3E
         1PGhTx/OpgjsdMBthM6uSfqb5CFC4LVij0h3lS8QWwDKGMYakkpMlhcXlyLOkFlcnv5i
         ndxA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192218; x=1690797018;
        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=tx0FAlNIhhphM8SETf+9243EVHMgBeYNK+AXzmxIezQ=;
        b=RLqfh6MGIEK+dGYADXVx8LuBpAEY5hbVfD17h77AMRg8T9n1iriv/a6hSH6dLECZl0
         GNYKJkBVNiXeoDeHcKcZm3Lq6nr8y4cV08srFUrxHUv55UYun6RkJvnHpqopjdzMp7eq
         4PK79S57bxpmA/9hjcQyZTYyK/ujqHa7TOEzV4xQSmjKjWmByS8hbGWNRd3Lkshgp2uc
         JxAjw7K8FRiLSbal6xhji5rJNjuuAIOq5rPvTF5Gt8PCiUFtUmCXaPzXsvd9AR4YH2Dp
         9btaYpzsE1sHdXP7FjeKrQB/AobN1xeUEgFT+1+hNyvjpWANsTtbWi81c6X/pBFrd8dG
         CUtQ==
X-Gm-Message-State: ABy/qLZgQtS8hmMWkY1RJ10LYvujItOYSNU5nJlu9YGIfjqA8+qRTEZ4
	S8EtS1lnwNKxCH9p5pcuDsMi8g==
X-Google-Smtp-Source: APBJJlGW4+fw6ZDbsnwnWtlRY7yHkFW5IEHW5elDNTPh+ZvgkUhUSx4grfoYhobvAlLuy2pBiwekLg==
X-Received: by 2002:a17:902:dacf:b0:1b8:9215:9163 with SMTP id q15-20020a170902dacf00b001b892159163mr12201959plx.6.1690192218573;
        Mon, 24 Jul 2023 02:50:18 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 26/47] dm zoned: dynamically allocate the dm-zoned-meta shrinker
Date: Mon, 24 Jul 2023 17:43:33 +0800
Message-Id: <20230724094354.90817-27-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the dm-zoned-meta shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct dmz_metadata.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 drivers/md/dm-zoned-metadata.c | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c
index 9d3cca8e3dc9..657f274e4e84 100644
--- a/drivers/md/dm-zoned-metadata.c
+++ b/drivers/md/dm-zoned-metadata.c
@@ -187,7 +187,7 @@ struct dmz_metadata {
 	struct rb_root		mblk_rbtree;
 	struct list_head	mblk_lru_list;
 	struct list_head	mblk_dirty_list;
-	struct shrinker		mblk_shrinker;
+	struct shrinker		*mblk_shrinker;
 
 	/* Zone allocation management */
 	struct mutex		map_lock;
@@ -615,7 +615,7 @@ static unsigned long dmz_shrink_mblock_cache(struct dmz_metadata *zmd,
 static unsigned long dmz_mblock_shrinker_count(struct shrinker *shrink,
 					       struct shrink_control *sc)
 {
-	struct dmz_metadata *zmd = container_of(shrink, struct dmz_metadata, mblk_shrinker);
+	struct dmz_metadata *zmd = shrink->private_data;
 
 	return atomic_read(&zmd->nr_mblks);
 }
@@ -626,7 +626,7 @@ static unsigned long dmz_mblock_shrinker_count(struct shrinker *shrink,
 static unsigned long dmz_mblock_shrinker_scan(struct shrinker *shrink,
 					      struct shrink_control *sc)
 {
-	struct dmz_metadata *zmd = container_of(shrink, struct dmz_metadata, mblk_shrinker);
+	struct dmz_metadata *zmd = shrink->private_data;
 	unsigned long count;
 
 	spin_lock(&zmd->mblk_lock);
@@ -2936,19 +2936,23 @@ int dmz_ctr_metadata(struct dmz_dev *dev, int num_dev,
 	 */
 	zmd->min_nr_mblks = 2 + zmd->nr_map_blocks + zmd->zone_nr_bitmap_blocks * 16;
 	zmd->max_nr_mblks = zmd->min_nr_mblks + 512;
-	zmd->mblk_shrinker.count_objects = dmz_mblock_shrinker_count;
-	zmd->mblk_shrinker.scan_objects = dmz_mblock_shrinker_scan;
-	zmd->mblk_shrinker.seeks = DEFAULT_SEEKS;
 
 	/* Metadata cache shrinker */
-	ret = register_shrinker(&zmd->mblk_shrinker, "dm-zoned-meta:(%u:%u)",
-				MAJOR(dev->bdev->bd_dev),
-				MINOR(dev->bdev->bd_dev));
-	if (ret) {
-		dmz_zmd_err(zmd, "Register metadata cache shrinker failed");
+	zmd->mblk_shrinker = shrinker_alloc(0,  "dm-zoned-meta:(%u:%u)",
+					    MAJOR(dev->bdev->bd_dev),
+					    MINOR(dev->bdev->bd_dev));
+	if (!zmd->mblk_shrinker) {
+		dmz_zmd_err(zmd, "Allocate metadata cache shrinker failed");
 		goto err;
 	}
 
+	zmd->mblk_shrinker->count_objects = dmz_mblock_shrinker_count;
+	zmd->mblk_shrinker->scan_objects = dmz_mblock_shrinker_scan;
+	zmd->mblk_shrinker->seeks = DEFAULT_SEEKS;
+	zmd->mblk_shrinker->private_data = zmd;
+
+	shrinker_register(zmd->mblk_shrinker);
+
 	dmz_zmd_info(zmd, "DM-Zoned metadata version %d", zmd->sb_version);
 	for (i = 0; i < zmd->nr_devs; i++)
 		dmz_print_dev(zmd, i);
@@ -2995,7 +2999,7 @@ int dmz_ctr_metadata(struct dmz_dev *dev, int num_dev,
  */
 void dmz_dtr_metadata(struct dmz_metadata *zmd)
 {
-	unregister_shrinker(&zmd->mblk_shrinker);
+	shrinker_unregister(zmd->mblk_shrinker);
 	dmz_cleanup_metadata(zmd);
 	kfree(zmd);
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:57:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:57:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568657.888374 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsK1-0007Gk-Fk; Mon, 24 Jul 2023 09:57:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568657.888374; Mon, 24 Jul 2023 09:57:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsK1-0007FE-8o; Mon, 24 Jul 2023 09:57:45 +0000
Received: by outflank-mailman (input) for mailman id 568657;
 Mon, 24 Jul 2023 09:57:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsFL-0005oA-No
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:52:55 +0000
Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com
 [2607:f8b0:4864:20::530])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dc3aa0de-2a07-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:52:55 +0200 (CEST)
Received: by mail-pg1-x530.google.com with SMTP id
 41be03b00d2f7-51f64817809so328424a12.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:52:55 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.52.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:52:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dc3aa0de-2a07-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192374; x=1690797174;
        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=9IhUpcns1yxxzymDv5YqZr0WL/UQLCqdNy71sVoDGM4=;
        b=cIXR9ZHqZERNOWsb2ZEdIjE0QFxOnKivQ/lQuhg52n2dMXmoDDPFPRWm0FPSeKIyTD
         9MEjhkMrHdf4N2tIjeBY0uc5lSquXoXdYhiP9qX8UK1EW+X5crHHo79SFmqf55ARZX3O
         wyO0k7uy2smy2xR1NzKu5/FuAH29r1/9qws6QCy0a0A/Wi9H8QSjdkQwDRNOZuARuvE0
         YOjOyD02m78GscpYM7KCycgCs59mpkV1Df2xA3PyuSplvUE6fAmcpCViKcuW1UFX7dOt
         MJAdKKXTxsI7gYL1+jy4JOfZOmvmuaNL5149/IaptalG+QZNj6invXd818tFo/LPEoBW
         HvpQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192374; x=1690797174;
        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=9IhUpcns1yxxzymDv5YqZr0WL/UQLCqdNy71sVoDGM4=;
        b=KbBo23ixA6hT45TjgZBimhVIFEARtJCH5MvqSNyM7vFKIrALmeUfbWM5brGEjWr/GJ
         9KT28+jyymgQ4C3g7gasFhpJuFx62/MAtyyq2lDgNBaeS7SU5MBDJoKhi9MN3tKGgKKQ
         p2iOixXqibx+zi6A4xvcVyYurQPQn37EXtiQnaKJ4y1jUuYmq4zbOIK3ALvfROwiwj5O
         Cvyv5ARE2u9ytMV7s/bUwLxsmar624Hd/XyRKedxDPSyHZj+NnEyTj457JXxbu/YBzLT
         5KGjEytZunZU/4gUNzWHYkgiNCbQclheNAZ6LuJy6fgXf5cL51hxVPVTPq7OWAP6t3Mx
         ciOA==
X-Gm-Message-State: ABy/qLaBB5BpRZht2kvX3SBzMoi7eo9gINLAoWekW7t17RaGiXUo08D1
	jzhaj8U1Uuzaz0/QpNfuoE9+iw==
X-Google-Smtp-Source: APBJJlHBx7nK5g3+kldzxnSt3u+r3r/G3QW+9x74hGsko9rk5z0xsgiAGVczPyEk+gpBI6IeMpdddg==
X-Received: by 2002:a17:902:dad1:b0:1b8:aded:524c with SMTP id q17-20020a170902dad100b001b8aded524cmr12547787plx.1.1690192373829;
        Mon, 24 Jul 2023 02:52:53 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 39/47] zsmalloc: dynamically allocate the mm-zspool shrinker
Date: Mon, 24 Jul 2023 17:43:46 +0800
Message-Id: <20230724094354.90817-40-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the mm-zspool shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct zs_pool.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 mm/zsmalloc.c | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 32f5bc4074df..bbbffe313318 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -229,7 +229,7 @@ struct zs_pool {
 	struct zs_pool_stats stats;
 
 	/* Compact classes */
-	struct shrinker shrinker;
+	struct shrinker *shrinker;
 
 #ifdef CONFIG_ZSMALLOC_STAT
 	struct dentry *stat_dentry;
@@ -2082,8 +2082,7 @@ static unsigned long zs_shrinker_scan(struct shrinker *shrinker,
 		struct shrink_control *sc)
 {
 	unsigned long pages_freed;
-	struct zs_pool *pool = container_of(shrinker, struct zs_pool,
-			shrinker);
+	struct zs_pool *pool = shrinker->private_data;
 
 	/*
 	 * Compact classes and calculate compaction delta.
@@ -2101,8 +2100,7 @@ static unsigned long zs_shrinker_count(struct shrinker *shrinker,
 	int i;
 	struct size_class *class;
 	unsigned long pages_to_free = 0;
-	struct zs_pool *pool = container_of(shrinker, struct zs_pool,
-			shrinker);
+	struct zs_pool *pool = shrinker->private_data;
 
 	for (i = ZS_SIZE_CLASSES - 1; i >= 0; i--) {
 		class = pool->size_class[i];
@@ -2117,18 +2115,24 @@ static unsigned long zs_shrinker_count(struct shrinker *shrinker,
 
 static void zs_unregister_shrinker(struct zs_pool *pool)
 {
-	unregister_shrinker(&pool->shrinker);
+	shrinker_unregister(pool->shrinker);
 }
 
 static int zs_register_shrinker(struct zs_pool *pool)
 {
-	pool->shrinker.scan_objects = zs_shrinker_scan;
-	pool->shrinker.count_objects = zs_shrinker_count;
-	pool->shrinker.batch = 0;
-	pool->shrinker.seeks = DEFAULT_SEEKS;
+	pool->shrinker = shrinker_alloc(0, "mm-zspool:%s", pool->name);
+	if (!pool->shrinker)
+		return -ENOMEM;
+
+	pool->shrinker->scan_objects = zs_shrinker_scan;
+	pool->shrinker->count_objects = zs_shrinker_count;
+	pool->shrinker->batch = 0;
+	pool->shrinker->seeks = DEFAULT_SEEKS;
+	pool->shrinker->private_data = pool;
 
-	return register_shrinker(&pool->shrinker, "mm-zspool:%s",
-				 pool->name);
+	shrinker_register(pool->shrinker);
+
+	return 0;
 }
 
 static int calculate_zspage_chain_size(int class_size)
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:57:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:57:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568664.888383 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsKB-0007sz-Mh; Mon, 24 Jul 2023 09:57:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568664.888383; Mon, 24 Jul 2023 09:57:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsKB-0007sm-IN; Mon, 24 Jul 2023 09:57:55 +0000
Received: by outflank-mailman (input) for mailman id 568664;
 Mon, 24 Jul 2023 09:57:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsEB-0005oA-Qk
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:51:43 +0000
Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com
 [2607:f8b0:4864:20::435])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b155244a-2a07-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:51:43 +0200 (CEST)
Received: by mail-pf1-x435.google.com with SMTP id
 d2e1a72fcca58-6864c144897so1023355b3a.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:51:43 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.51.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:51:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b155244a-2a07-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192302; x=1690797102;
        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=GawUpWYlbps61zw2RmUByoW60pYFIoQHHGKJRm38EOk=;
        b=CEkBmtmFVjCzOooXofhUvjxLqUZPvNrcHhpIqNSHKhlsDLi4d+oiaZMcszC7DTpfnA
         0KCrn7qf+iMeDsU85frIwtRIJhPWTqjNE2GsFmUKb/AqXZ0cLaskVQ5sfrcUFwEyLRbQ
         YW+p3CB2iS2ZCJajkrzFZs2UYUV0m+MaHWdbJYgGTL2qMXc2h/u54iHPSNyVPneUBqzK
         Naf8yW1XF3OE4vVOOlqqaRwu13egTLMed+qZrwvG+Vv4BM3gaUW+md70rTXf2vm8C2IM
         auGDwQHGheimZXvmz6pG7OCBX8qrzq4/B64JbF2h2WpQYUSLrIvoMQuqshsPKoMXzH6R
         MZ2g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192302; x=1690797102;
        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=GawUpWYlbps61zw2RmUByoW60pYFIoQHHGKJRm38EOk=;
        b=cjDOubYEOC1kDeJIjeY+UZck/nAT8jCQGpFG0WWLbz6K+kbwQkTE0ZNM/cKtHdkL+N
         6rfzuJs16tEqzvxpv4IsNE8j2GPguYpV2MsPHKe41YQ2JuePMeKjubzQpWbxFAftoMEp
         phb12wYOS8j6YOhRwXZsDEw21DaHrRA2KMWngdb9Vy+ZNqR/jlwb5y9fws1ecXoovhAg
         1u+5zeiY9c1u43hhVaR3l8PxGUe7W5XKopl5R5CdqRqAfGMEI0tNViWqrW9D/HN3JLNp
         gkxxGKaYQCIJ2ZrsWBKZuEO8rsWQhbrX61TnmiEP/KttJFP+2sPCy1cmOlouuO2TJxgp
         aTdA==
X-Gm-Message-State: ABy/qLaDROTqGBA/NCY2s5qqP5LkTyt99Ft5BXRRK0a7zwcBo237eoSf
	+i0yQ07nWQRxAQUyhN8Tu5Zn8g==
X-Google-Smtp-Source: APBJJlEU/vgKmw8Um+e668RIawiv+P3qp/KwZZ/g6Y9wgpINkkaMr3bzWEnObMTDhnOi0EmMOvkuLQ==
X-Received: by 2002:a17:903:41cd:b0:1bb:9e6e:a9f3 with SMTP id u13-20020a17090341cd00b001bb9e6ea9f3mr4118075ple.4.1690192301770;
        Mon, 24 Jul 2023 02:51:41 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 33/47] jbd2,ext4: dynamically allocate the jbd2-journal shrinker
Date: Mon, 24 Jul 2023 17:43:40 +0800
Message-Id: <20230724094354.90817-34-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the jbd2-journal shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct journal_s.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/jbd2/journal.c    | 27 +++++++++++++++++----------
 include/linux/jbd2.h |  2 +-
 2 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index fbce16fedaa4..a7d555ea06e3 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -1301,7 +1301,7 @@ static int jbd2_min_tag_size(void)
 static unsigned long jbd2_journal_shrink_scan(struct shrinker *shrink,
 					      struct shrink_control *sc)
 {
-	journal_t *journal = container_of(shrink, journal_t, j_shrinker);
+	journal_t *journal = shrink->private_data;
 	unsigned long nr_to_scan = sc->nr_to_scan;
 	unsigned long nr_shrunk;
 	unsigned long count;
@@ -1327,7 +1327,7 @@ static unsigned long jbd2_journal_shrink_scan(struct shrinker *shrink,
 static unsigned long jbd2_journal_shrink_count(struct shrinker *shrink,
 					       struct shrink_control *sc)
 {
-	journal_t *journal = container_of(shrink, journal_t, j_shrinker);
+	journal_t *journal = shrink->private_data;
 	unsigned long count;
 
 	count = percpu_counter_read_positive(&journal->j_checkpoint_jh_count);
@@ -1415,19 +1415,26 @@ static journal_t *journal_init_common(struct block_device *bdev,
 	journal->j_superblock = (journal_superblock_t *)bh->b_data;
 
 	journal->j_shrink_transaction = NULL;
-	journal->j_shrinker.scan_objects = jbd2_journal_shrink_scan;
-	journal->j_shrinker.count_objects = jbd2_journal_shrink_count;
-	journal->j_shrinker.seeks = DEFAULT_SEEKS;
-	journal->j_shrinker.batch = journal->j_max_transaction_buffers;
 
 	if (percpu_counter_init(&journal->j_checkpoint_jh_count, 0, GFP_KERNEL))
 		goto err_cleanup;
 
-	if (register_shrinker(&journal->j_shrinker, "jbd2-journal:(%u:%u)",
-			      MAJOR(bdev->bd_dev), MINOR(bdev->bd_dev))) {
+	journal->j_shrinker = shrinker_alloc(0, "jbd2-journal:(%u:%u)",
+					     MAJOR(bdev->bd_dev),
+					     MINOR(bdev->bd_dev));
+	if (!journal->j_shrinker) {
 		percpu_counter_destroy(&journal->j_checkpoint_jh_count);
 		goto err_cleanup;
 	}
+
+	journal->j_shrinker->scan_objects = jbd2_journal_shrink_scan;
+	journal->j_shrinker->count_objects = jbd2_journal_shrink_count;
+	journal->j_shrinker->seeks = DEFAULT_SEEKS;
+	journal->j_shrinker->batch = journal->j_max_transaction_buffers;
+	journal->j_shrinker->private_data = journal;
+
+	shrinker_register(journal->j_shrinker);
+
 	return journal;
 
 err_cleanup:
@@ -2190,9 +2197,9 @@ int jbd2_journal_destroy(journal_t *journal)
 		brelse(journal->j_sb_buffer);
 	}
 
-	if (journal->j_shrinker.flags & SHRINKER_REGISTERED) {
+	if (journal->j_shrinker) {
 		percpu_counter_destroy(&journal->j_checkpoint_jh_count);
-		unregister_shrinker(&journal->j_shrinker);
+		shrinker_unregister(journal->j_shrinker);
 	}
 	if (journal->j_proc_entry)
 		jbd2_stats_proc_exit(journal);
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index d860499e15e4..9fdc02565c24 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -897,7 +897,7 @@ struct journal_s
 	 * Journal head shrinker, reclaim buffer's journal head which
 	 * has been written back.
 	 */
-	struct shrinker		j_shrinker;
+	struct shrinker		*j_shrinker;
 
 	/**
 	 * @j_checkpoint_jh_count:
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:57:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:57:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568665.888389 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsKB-0007v5-Vy; Mon, 24 Jul 2023 09:57:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568665.888389; Mon, 24 Jul 2023 09:57:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsKB-0007uE-PH; Mon, 24 Jul 2023 09:57:55 +0000
Received: by outflank-mailman (input) for mailman id 568665;
 Mon, 24 Jul 2023 09:57:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsF9-0005oA-S1
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:52:43 +0000
Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com
 [2607:f8b0:4864:20::631])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d5332f9b-2a07-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:52:43 +0200 (CEST)
Received: by mail-pl1-x631.google.com with SMTP id
 d9443c01a7336-1bba9539a23so649915ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:52:43 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.52.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:52:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d5332f9b-2a07-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192362; x=1690797162;
        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=+msSROnlHTbkN8WdS5VhxMSS48DaBcuNUu675bILAm8=;
        b=h3gsG4QXWw/nahqBxLdBCvqi4m8rD0FXz9A20d9YDr1GVweA7QI5gIYRXxeR03F7VF
         avO+YUz8f1IL6J1uYX1/b0NEPW6FiLuYcPPgWc9sNeFYAy1/jQVonTK3Har+aojJwTqi
         hQZEwnSV3LL7ecl9UfamsDpZO40zuTjDqPfF5eu13La0YtcWt3KQO54XvrgMZueVi5PZ
         X9MwcigdTTnwiJ3xQrZgNRbLcfkBdWK7eRH096K0D7h66kc666JHvNvIGlIc1vw99tH0
         GAm/hWRvtDUBnuyuOUfh8qzrbwzBKl3sPPd+rGOKnxJaCrXEUUZmWLLd6RNa7iYZg14F
         z6LA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192362; x=1690797162;
        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=+msSROnlHTbkN8WdS5VhxMSS48DaBcuNUu675bILAm8=;
        b=bi1ZbKYczVSEU8Nu43yuMVsJ+hnVtPG1Kwwg4Eey3DcEBpfASoSUeVfwc5apDTO5XF
         75B39e9GXFhXjNavPDKWQEYClwR88j/A5NNdo+UZwg83nwS+VE80hhMU1EdantxgfN5c
         Rs8SX4PSsBAkx+gWuCeWG9/4v/QLdtqw1YDYryFuXvC6oZb7VGHdv3K9P+THe6ShCtjO
         cLRjRX89LyMhSYnRnt9GDaoBKm4buacDFi6MEhqNTaG3anojcJNQypSEJxQlLgPRBmvB
         bn6pueHRZN4pYjPjpsDvBCte5XN/O99g8a/Ue3POWbTcJ/3qPNbx9dTmn/zciJBMLiG3
         wmHw==
X-Gm-Message-State: ABy/qLbUrb/o6mUm0BA2hAJxpy1bHrx7/CU6xi61l1WFuNxTbDvturar
	6WJ09N0e9/e66lLwbr1WYHOmng==
X-Google-Smtp-Source: APBJJlFjFnMUMe3SYJatR/saB9KY/jkISOdIPz1PLzDLS3adgTzHCnV8/bXf0D4q3OfiSxgFenVrMg==
X-Received: by 2002:a17:903:41c9:b0:1b8:17e8:547e with SMTP id u9-20020a17090341c900b001b817e8547emr12208099ple.1.1690192361964;
        Mon, 24 Jul 2023 02:52:41 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 38/47] xfs: dynamically allocate the xfs-qm shrinker
Date: Mon, 24 Jul 2023 17:43:45 +0800
Message-Id: <20230724094354.90817-39-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the xfs-qm shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct xfs_quotainfo.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/xfs/xfs_qm.c | 26 +++++++++++++-------------
 fs/xfs/xfs_qm.h |  2 +-
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index 6abcc34fafd8..8f1216e1efc1 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -504,8 +504,7 @@ xfs_qm_shrink_scan(
 	struct shrinker		*shrink,
 	struct shrink_control	*sc)
 {
-	struct xfs_quotainfo	*qi = container_of(shrink,
-					struct xfs_quotainfo, qi_shrinker);
+	struct xfs_quotainfo	*qi = shrink->private_data;
 	struct xfs_qm_isolate	isol;
 	unsigned long		freed;
 	int			error;
@@ -539,8 +538,7 @@ xfs_qm_shrink_count(
 	struct shrinker		*shrink,
 	struct shrink_control	*sc)
 {
-	struct xfs_quotainfo	*qi = container_of(shrink,
-					struct xfs_quotainfo, qi_shrinker);
+	struct xfs_quotainfo	*qi = shrink->private_data;
 
 	return list_lru_shrink_count(&qi->qi_lru, sc);
 }
@@ -680,16 +678,18 @@ xfs_qm_init_quotainfo(
 	if (XFS_IS_PQUOTA_ON(mp))
 		xfs_qm_set_defquota(mp, XFS_DQTYPE_PROJ, qinf);
 
-	qinf->qi_shrinker.count_objects = xfs_qm_shrink_count;
-	qinf->qi_shrinker.scan_objects = xfs_qm_shrink_scan;
-	qinf->qi_shrinker.seeks = DEFAULT_SEEKS;
-	qinf->qi_shrinker.flags = SHRINKER_NUMA_AWARE;
-
-	error = register_shrinker(&qinf->qi_shrinker, "xfs-qm:%s",
-				  mp->m_super->s_id);
-	if (error)
+	qinf->qi_shrinker = shrinker_alloc(SHRINKER_NUMA_AWARE, "xfs-qm:%s",
+					   mp->m_super->s_id);
+	if (!qinf->qi_shrinker)
 		goto out_free_inos;
 
+	qinf->qi_shrinker->count_objects = xfs_qm_shrink_count;
+	qinf->qi_shrinker->scan_objects = xfs_qm_shrink_scan;
+	qinf->qi_shrinker->seeks = DEFAULT_SEEKS;
+	qinf->qi_shrinker->private_data = qinf;
+
+	shrinker_register(qinf->qi_shrinker);
+
 	return 0;
 
 out_free_inos:
@@ -718,7 +718,7 @@ xfs_qm_destroy_quotainfo(
 	qi = mp->m_quotainfo;
 	ASSERT(qi != NULL);
 
-	unregister_shrinker(&qi->qi_shrinker);
+	shrinker_unregister(qi->qi_shrinker);
 	list_lru_destroy(&qi->qi_lru);
 	xfs_qm_destroy_quotainos(qi);
 	mutex_destroy(&qi->qi_tree_lock);
diff --git a/fs/xfs/xfs_qm.h b/fs/xfs/xfs_qm.h
index 9683f0457d19..d5c9fc4ba591 100644
--- a/fs/xfs/xfs_qm.h
+++ b/fs/xfs/xfs_qm.h
@@ -63,7 +63,7 @@ struct xfs_quotainfo {
 	struct xfs_def_quota	qi_usr_default;
 	struct xfs_def_quota	qi_grp_default;
 	struct xfs_def_quota	qi_prj_default;
-	struct shrinker		qi_shrinker;
+	struct shrinker		*qi_shrinker;
 
 	/* Minimum and maximum quota expiration timestamp values. */
 	time64_t		qi_expiry_min;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:57:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:57:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568667.888402 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsKD-0008Nq-5V; Mon, 24 Jul 2023 09:57:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568667.888402; Mon, 24 Jul 2023 09:57:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsKD-0008NJ-2E; Mon, 24 Jul 2023 09:57:57 +0000
Received: by outflank-mailman (input) for mailman id 568667;
 Mon, 24 Jul 2023 09:57:56 +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
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsDp-0007Pe-Ai
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:51:21 +0000
Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com
 [2607:f8b0:4864:20::530])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a33d654e-2a07-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 11:51:19 +0200 (CEST)
Received: by mail-pg1-x530.google.com with SMTP id
 41be03b00d2f7-55b5a37acb6so326968a12.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:51:19 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.51.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:51:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a33d654e-2a07-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192278; x=1690797078;
        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=xAp7xgO7HdkgEPthzXwizc0Cva5ED0l1RHYipwvkRG8=;
        b=fRZXTeDPI05cJ99onG6DHJxkfUMlRPnq7Rn/QLZ0is9nue6C7hI7NNrzzE1XiOtAsL
         jxaHqrHBeq2Kf9jVwHj0j/XI9pIc497j4STLT+aC4pqDVI/sTYYX/yRdxwUotEPFTVId
         GY6yzphCUZ5+EFCVJ7JaghU1AWJbzYCjuDnxJCswtZl+SwAhy4mi16E/MR1hRCsGjB+T
         cO99YDds8K867Aux+2jYQKZaNAhIQlxOtUrunaQPHSUBJtgcDiwvPSTxsjcEQk1O8lD+
         xr5m1LPO8Me4hvXm4e3bCHxSQGeRnDCDrCn2S6Pyj7qX4IByYBH740sUkYoEJ/i3i/6k
         qY8g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192278; x=1690797078;
        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=xAp7xgO7HdkgEPthzXwizc0Cva5ED0l1RHYipwvkRG8=;
        b=OFrQVdtf6NNaEK9IByDyOy3f0iK1ZZWZGQukTMsDqA0lNTMKwCICThisz/JRITo+jm
         OpUXRmV9oXES4NMzXQsdVJPYN4rMOLEmUV5PDyZ18gaOWfAwwPVRCbtLTqw2F6UBQrLe
         YabT51EvDSYskrBoDB1sa1Bwg8+V9E/FsY03s8ck+KGDvc75kHBFqvhiBnawzb0SuKOy
         +WtR5aCczV7oul404JYpdePBwo6zi/fppAeiWsxaHF2zkHQX0h+HwdoVFUYSA4X8eUEv
         Ny8W2u8DIVR++06zHRaOybn6oPqBk/GIVVRQVgUqskB6Kxj/cPA7RQCnfe3ui/IqwsFp
         Uvng==
X-Gm-Message-State: ABy/qLZEb3dj874gavR1kyqS0pdcEGiFg1IofYT2tslptoHKj7KxUTfP
	uwWJNwHLDA+GZQfw3KljsSsM6g==
X-Google-Smtp-Source: APBJJlHQq2D/WuDC+k4NqN86HhNTJ9MoR7Y5JtfL6V1jvtKqTGYGB1+jpVAvGxo9g3eH8SGsNzYhlw==
X-Received: by 2002:a17:902:f681:b0:1b8:a469:53d8 with SMTP id l1-20020a170902f68100b001b8a46953d8mr12728311plg.0.1690192278196;
        Mon, 24 Jul 2023 02:51:18 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 31/47] mbcache: dynamically allocate the mbcache shrinker
Date: Mon, 24 Jul 2023 17:43:38 +0800
Message-Id: <20230724094354.90817-32-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the mbcache shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct mb_cache.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/mbcache.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/fs/mbcache.c b/fs/mbcache.c
index 2a4b8b549e93..bfecebeec828 100644
--- a/fs/mbcache.c
+++ b/fs/mbcache.c
@@ -37,7 +37,7 @@ struct mb_cache {
 	struct list_head	c_list;
 	/* Number of entries in cache */
 	unsigned long		c_entry_count;
-	struct shrinker		c_shrink;
+	struct shrinker		*c_shrink;
 	/* Work for shrinking when the cache has too many entries */
 	struct work_struct	c_shrink_work;
 };
@@ -293,8 +293,7 @@ EXPORT_SYMBOL(mb_cache_entry_touch);
 static unsigned long mb_cache_count(struct shrinker *shrink,
 				    struct shrink_control *sc)
 {
-	struct mb_cache *cache = container_of(shrink, struct mb_cache,
-					      c_shrink);
+	struct mb_cache *cache = shrink->private_data;
 
 	return cache->c_entry_count;
 }
@@ -333,8 +332,7 @@ static unsigned long mb_cache_shrink(struct mb_cache *cache,
 static unsigned long mb_cache_scan(struct shrinker *shrink,
 				   struct shrink_control *sc)
 {
-	struct mb_cache *cache = container_of(shrink, struct mb_cache,
-					      c_shrink);
+	struct mb_cache *cache = shrink->private_data;
 	return mb_cache_shrink(cache, sc->nr_to_scan);
 }
 
@@ -377,15 +375,20 @@ struct mb_cache *mb_cache_create(int bucket_bits)
 	for (i = 0; i < bucket_count; i++)
 		INIT_HLIST_BL_HEAD(&cache->c_hash[i]);
 
-	cache->c_shrink.count_objects = mb_cache_count;
-	cache->c_shrink.scan_objects = mb_cache_scan;
-	cache->c_shrink.seeks = DEFAULT_SEEKS;
-	if (register_shrinker(&cache->c_shrink, "mbcache-shrinker")) {
+	cache->c_shrink = shrinker_alloc(0, "mbcache-shrinker");
+	if (!cache->c_shrink) {
 		kfree(cache->c_hash);
 		kfree(cache);
 		goto err_out;
 	}
 
+	cache->c_shrink->count_objects = mb_cache_count;
+	cache->c_shrink->scan_objects = mb_cache_scan;
+	cache->c_shrink->seeks = DEFAULT_SEEKS;
+	cache->c_shrink->private_data = cache;
+
+	shrinker_register(cache->c_shrink);
+
 	INIT_WORK(&cache->c_shrink_work, mb_cache_shrink_worker);
 
 	return cache;
@@ -406,7 +409,7 @@ void mb_cache_destroy(struct mb_cache *cache)
 {
 	struct mb_cache_entry *entry, *next;
 
-	unregister_shrinker(&cache->c_shrink);
+	shrinker_unregister(cache->c_shrink);
 
 	/*
 	 * We don't bother with any locking. Cache must not be used at this
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:58:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:58:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568668.888413 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsKH-0000Re-Op; Mon, 24 Jul 2023 09:58:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568668.888413; Mon, 24 Jul 2023 09:58:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsKH-0000RP-Kz; Mon, 24 Jul 2023 09:58:01 +0000
Received: by outflank-mailman (input) for mailman id 568668;
 Mon, 24 Jul 2023 09:57:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsDz-0005oA-Ry
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:51:31 +0000
Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com
 [2607:f8b0:4864:20::629])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id aa470a41-2a07-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:51:31 +0200 (CEST)
Received: by mail-pl1-x629.google.com with SMTP id
 d9443c01a7336-1b867f9198dso8902125ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:51:31 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.51.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:51:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aa470a41-2a07-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192290; x=1690797090;
        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=oXR+qbQ7FZSOf8H8/XKWyl6GGcPr2+dTjVkbZb7uW4E=;
        b=hOD9KvuIa/sVR/XUeit3UEUy4lAv7qisrKP+dY73zqCVNh5USDs3UmvxT9Mu0HPAd/
         sQoZTlZIhyjE9hP5yaJCN279yVD9q+u+zszBd3e/RRrSWK4lH9Sj6N23h1hoy3tnMHt9
         Prw78GIFByR0J3YK+swLHgojCOBGOspVkhguuywNaBo2olaDrD94vFbNjxafvVNqL5jj
         kb7wPt4FuUX1Yqc+w6X3ILlcOhkKLx335rMW5M/f76lMo6KZSankQneuXGq4M4YDo1Pw
         4QB0FQMF4kEeIJcpti49nOtrs1POFPvCGoLSeyUrx9gHxzPZXlLq/CHz3lcRP0C+66Sl
         YJZg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192290; x=1690797090;
        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=oXR+qbQ7FZSOf8H8/XKWyl6GGcPr2+dTjVkbZb7uW4E=;
        b=IT5tyoDk5Q5w7njpz1uaZIKQGgnkW/6HuJ5v4Otoj0cGiB/TrYGwWnmJvfUEsUk2pX
         wbU3ihkcIyAmGf32YkyRK715J4ilCwtt/nXX7zvHAIlKY5ako4jT8tWYN6DkPOEI5o+P
         arm6nCLCOiEc7XAVMGZwH0a0SFC3b4ZPAevJjToC2CLBYXzqE2H9cqK81F13w/9k6bk6
         TvVe28DHCZV8u+2cKvFl4b0TbYekK8NJ1v1BdSYdZNSZceV3EcrkVEyWyT/eCHku34EH
         c6jX7aKvY4MP4ySLvvBzyiEnPr3UjMeNQN00GUzJQfiKBeH1MgfzeB/EweVdLq0tgcPB
         ymzQ==
X-Gm-Message-State: ABy/qLbkzfq0l5E35c+kvZhXo6E+wtpj0iq5fK3FZOkLds7qXrVrXwzc
	xIsrykyJvEylnF2/zU7BneWQ5Q==
X-Google-Smtp-Source: APBJJlFC05XpXuobjW4LsGQFjmg3Q9TZDeGvX5MkKK/m+2sDEjZkN7MidhVsDpGMtrBJxCeRn4k3XA==
X-Received: by 2002:a17:903:22ce:b0:1b8:2ba0:c9a8 with SMTP id y14-20020a17090322ce00b001b82ba0c9a8mr12484346plg.2.1690192289977;
        Mon, 24 Jul 2023 02:51:29 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 32/47] ext4: dynamically allocate the ext4-es shrinker
Date: Mon, 24 Jul 2023 17:43:39 +0800
Message-Id: <20230724094354.90817-33-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the ext4-es shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct ext4_sb_info.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/ext4/ext4.h           |  2 +-
 fs/ext4/extents_status.c | 22 ++++++++++++----------
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 0a2d55faa095..1bd150d454f5 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1651,7 +1651,7 @@ struct ext4_sb_info {
 	__u32 s_csum_seed;
 
 	/* Reclaim extents from extent status tree */
-	struct shrinker s_es_shrinker;
+	struct shrinker *s_es_shrinker;
 	struct list_head s_es_list;	/* List of inodes with reclaimable extents */
 	long s_es_nr_inode;
 	struct ext4_es_stats s_es_stats;
diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
index 9b5b8951afb4..8d4a959dd32f 100644
--- a/fs/ext4/extents_status.c
+++ b/fs/ext4/extents_status.c
@@ -1596,7 +1596,7 @@ static unsigned long ext4_es_count(struct shrinker *shrink,
 	unsigned long nr;
 	struct ext4_sb_info *sbi;
 
-	sbi = container_of(shrink, struct ext4_sb_info, s_es_shrinker);
+	sbi = shrink->private_data;
 	nr = percpu_counter_read_positive(&sbi->s_es_stats.es_stats_shk_cnt);
 	trace_ext4_es_shrink_count(sbi->s_sb, sc->nr_to_scan, nr);
 	return nr;
@@ -1605,8 +1605,7 @@ static unsigned long ext4_es_count(struct shrinker *shrink,
 static unsigned long ext4_es_scan(struct shrinker *shrink,
 				  struct shrink_control *sc)
 {
-	struct ext4_sb_info *sbi = container_of(shrink,
-					struct ext4_sb_info, s_es_shrinker);
+	struct ext4_sb_info *sbi = shrink->private_data;
 	int nr_to_scan = sc->nr_to_scan;
 	int ret, nr_shrunk;
 
@@ -1690,14 +1689,17 @@ int ext4_es_register_shrinker(struct ext4_sb_info *sbi)
 	if (err)
 		goto err3;
 
-	sbi->s_es_shrinker.scan_objects = ext4_es_scan;
-	sbi->s_es_shrinker.count_objects = ext4_es_count;
-	sbi->s_es_shrinker.seeks = DEFAULT_SEEKS;
-	err = register_shrinker(&sbi->s_es_shrinker, "ext4-es:%s",
-				sbi->s_sb->s_id);
-	if (err)
+	sbi->s_es_shrinker = shrinker_alloc(0, "ext4-es:%s", sbi->s_sb->s_id);
+	if (!sbi->s_es_shrinker)
 		goto err4;
 
+	sbi->s_es_shrinker->scan_objects = ext4_es_scan;
+	sbi->s_es_shrinker->count_objects = ext4_es_count;
+	sbi->s_es_shrinker->seeks = DEFAULT_SEEKS;
+	sbi->s_es_shrinker->private_data = sbi;
+
+	shrinker_register(sbi->s_es_shrinker);
+
 	return 0;
 err4:
 	percpu_counter_destroy(&sbi->s_es_stats.es_stats_shk_cnt);
@@ -1716,7 +1718,7 @@ void ext4_es_unregister_shrinker(struct ext4_sb_info *sbi)
 	percpu_counter_destroy(&sbi->s_es_stats.es_stats_cache_misses);
 	percpu_counter_destroy(&sbi->s_es_stats.es_stats_all_cnt);
 	percpu_counter_destroy(&sbi->s_es_stats.es_stats_shk_cnt);
-	unregister_shrinker(&sbi->s_es_shrinker);
+	shrinker_unregister(sbi->s_es_shrinker);
 }
 
 /*
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 09:58:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 09:58:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568679.888423 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsKX-0001hh-28; Mon, 24 Jul 2023 09:58:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568679.888423; Mon, 24 Jul 2023 09:58:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsKW-0001hT-Un; Mon, 24 Jul 2023 09:58:16 +0000
Received: by outflank-mailman (input) for mailman id 568679;
 Mon, 24 Jul 2023 09:58:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jodz=DK=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qNsEm-0005oA-5v
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 09:52:20 +0000
Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com
 [2607:f8b0:4864:20::631])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c712e10b-2a07-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 11:52:19 +0200 (CEST)
Received: by mail-pl1-x631.google.com with SMTP id
 d9443c01a7336-1bb85ed352bso2245045ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 02:52:19 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 d5-20020a170902c18500b001bb20380bf2sm8467233pld.13.2023.07.24.02.52.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 02:52:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c712e10b-2a07-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690192338; x=1690797138;
        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=TdB9rRMLZCcd9e2nqCLYXDwhc2GYqBzgLTOCktFYsxc=;
        b=SzORXV42/Rkrz0ySbtFMuCZ6EcMdlaXWidsXVoP9Bu4SkfHmgah3BXDWmdOJP2Jiax
         xVX2Gq7sqO/lSpvZDt7FPW8ckXc5rBx+Fp5rDETVHg5ZRmLyKjmjXPxU8j82DsT8nUX2
         +lBD1pmTVNRo9p32tv/6gOZ/Sm5LO6qba/fn4oF55QYMtV6ZQw4pMeuXt6qQbAj1PWKP
         V84//RahuYbQGXKjJ1xGWfF0qil0oc/qVmx4ZoBZqcIV2GTe+3GnYm52uVamfvVOgPBe
         7qmhYlAe5+lFDhiCToVYO6NYEZfnOgPlX7bqwkW4eIRa2R40yUO4E7ouwBizzc4Majgp
         WMAQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690192338; x=1690797138;
        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=TdB9rRMLZCcd9e2nqCLYXDwhc2GYqBzgLTOCktFYsxc=;
        b=gqz+Imw74sfevz5qfy164D8S9rjxjOanot6kKOhG+UjV4IcdONMHfNv+Q9co4C0rix
         SeRsyLeKMqQvwhNrAtlYHYeKbC2EieMyd3fXo2flo6tVkPcaWcnn0jQedh1dD9EAhL96
         RO3kUxvdYzFkT1/Yg3dPKADg2AVuKxbqGRr0PXdBbaiBVkf0dtcwAJtcZR4NtQKpTJmR
         Or1EvcbAt/cC48Yjw1EUaU3dQ3VUqg4N2CLKvWHW55V8GGrP0iFmSNvTpJZsViGdiblm
         7TC+QWzB3VujcZDmfNh0AoFErYfzLa8PxIiPUpC5kSBi0RdzFoeRCIk6WeLHuIFh9Gou
         YHcA==
X-Gm-Message-State: ABy/qLab8mn5J7LIC8k72hqwGcLZ/C8upGwVDCEEqfchEZ+gAQ/ORkFA
	EtygwgIjBb29VHolk1l8namzjQ==
X-Google-Smtp-Source: APBJJlGv61W8KGqFtJwXjT0bM91VjHnubPgHDdaymusYtIYliDl3QXXildbsEKZFPobYebqub0cGDA==
X-Received: by 2002:a17:902:f681:b0:1b8:17e8:5472 with SMTP id l1-20020a170902f68100b001b817e85472mr12096259plg.1.1690192338295;
        Mon, 24 Jul 2023 02:52:18 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 36/47] xfs: dynamically allocate the xfs-buf shrinker
Date: Mon, 24 Jul 2023 17:43:43 +0800
Message-Id: <20230724094354.90817-37-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the xfs-buf shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct xfs_buftarg.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/xfs/xfs_buf.c | 25 ++++++++++++++-----------
 fs/xfs/xfs_buf.h |  2 +-
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 15d1e5a7c2d3..19a0bf6ce115 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1906,8 +1906,7 @@ xfs_buftarg_shrink_scan(
 	struct shrinker		*shrink,
 	struct shrink_control	*sc)
 {
-	struct xfs_buftarg	*btp = container_of(shrink,
-					struct xfs_buftarg, bt_shrinker);
+	struct xfs_buftarg	*btp = shrink->private_data;
 	LIST_HEAD(dispose);
 	unsigned long		freed;
 
@@ -1929,8 +1928,7 @@ xfs_buftarg_shrink_count(
 	struct shrinker		*shrink,
 	struct shrink_control	*sc)
 {
-	struct xfs_buftarg	*btp = container_of(shrink,
-					struct xfs_buftarg, bt_shrinker);
+	struct xfs_buftarg	*btp = shrink->private_data;
 	return list_lru_shrink_count(&btp->bt_lru, sc);
 }
 
@@ -1938,7 +1936,7 @@ void
 xfs_free_buftarg(
 	struct xfs_buftarg	*btp)
 {
-	unregister_shrinker(&btp->bt_shrinker);
+	shrinker_unregister(btp->bt_shrinker);
 	ASSERT(percpu_counter_sum(&btp->bt_io_count) == 0);
 	percpu_counter_destroy(&btp->bt_io_count);
 	list_lru_destroy(&btp->bt_lru);
@@ -2021,13 +2019,18 @@ xfs_alloc_buftarg(
 	if (percpu_counter_init(&btp->bt_io_count, 0, GFP_KERNEL))
 		goto error_lru;
 
-	btp->bt_shrinker.count_objects = xfs_buftarg_shrink_count;
-	btp->bt_shrinker.scan_objects = xfs_buftarg_shrink_scan;
-	btp->bt_shrinker.seeks = DEFAULT_SEEKS;
-	btp->bt_shrinker.flags = SHRINKER_NUMA_AWARE;
-	if (register_shrinker(&btp->bt_shrinker, "xfs-buf:%s",
-			      mp->m_super->s_id))
+	btp->bt_shrinker = shrinker_alloc(SHRINKER_NUMA_AWARE, "xfs-buf:%s",
+					  mp->m_super->s_id);
+	if (!btp->bt_shrinker)
 		goto error_pcpu;
+
+	btp->bt_shrinker->count_objects = xfs_buftarg_shrink_count;
+	btp->bt_shrinker->scan_objects = xfs_buftarg_shrink_scan;
+	btp->bt_shrinker->seeks = DEFAULT_SEEKS;
+	btp->bt_shrinker->private_data = btp;
+
+	shrinker_register(btp->bt_shrinker);
+
 	return btp;
 
 error_pcpu:
diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h
index 549c60942208..4e6969a675f7 100644
--- a/fs/xfs/xfs_buf.h
+++ b/fs/xfs/xfs_buf.h
@@ -102,7 +102,7 @@ typedef struct xfs_buftarg {
 	size_t			bt_logical_sectormask;
 
 	/* LRU control structures */
-	struct shrinker		bt_shrinker;
+	struct shrinker		*bt_shrinker;
 	struct list_lru		bt_lru;
 
 	struct percpu_counter	bt_io_count;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 10:03:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 10:03:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568686.888432 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsP0-0003m0-J9; Mon, 24 Jul 2023 10:02:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568686.888432; Mon, 24 Jul 2023 10:02:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsP0-0003lt-GO; Mon, 24 Jul 2023 10:02:54 +0000
Received: by outflank-mailman (input) for mailman id 568686;
 Mon, 24 Jul 2023 10:02:53 +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 <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNsOz-0003ln-5n
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 10:02:53 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2060d.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::60d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3fcd6661-2a09-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 12:02:51 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB7525.eurprd04.prod.outlook.com (2603:10a6:20b:29b::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 10:02:49 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 10:02:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3fcd6661-2a09-11ee-8612-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ST8f9vpP+WGzat3oJKxrDN9y4oV54JTT19ObnqbJF41lM9mOgVpGumHNvuacaTkC9K/UHxxkHxOE1upChMrGsbqJLt98yaaim/6mLQmTtyRcyNAHB+AJ9HZ4NC7uOAbCW0HO52+dabK3eEHowdxvhh2hd7i2JAvx1rp92TfBW3DQPomgfnhR1VvApn+BIeCJPMgnV4VxYv1rsecmxmfxrc8rDUxCCmVD5TnG50/P5rOw82ZLJH9LuapG00mGPkgoo2rcNdkVGPXSmkAIKsdnwt/dflNtdNgeBRdbi03rXTwNWDLhyHkM82oKSxkvGo4MqYeSmb4Kx7Ay08pdVdMvdA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=soERpOsRLbV3brjvLdmLqvEhIhDtCg7lQaV+SgJ1pEg=;
 b=ZMfaZpMMrwE164lwaIlnGpc1AlcfCv2Hm0FR99/ISRYPLHrfB+jLtuj3h7cWCKCCLrB3Yvf1VE+ccqUL1il2w9FqEfKrlZ7TgPqa2RVHfXmm5cZoLoE+tDdZxPftEuzYf2o2txP/UGKguJzsHPZoU7ofpEQUkc587yCcQS1dWiDwp4Nju3vKG4lpxhBAC0yFeElvNd6AP9YOYKqUy/c5aB1qS553X7fCuV8HSpsJqzAY+TLwBHPhRTcqowOULhJtPpmJJhI1AKNgyu+Wh83OASMQBkJO9EVJtr/S6ZVnDiJRXbC2c3OHh11ntCEzKyoq1oX4gOoG4yChC7aRxvNRaw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=soERpOsRLbV3brjvLdmLqvEhIhDtCg7lQaV+SgJ1pEg=;
 b=l7RHfuLJXHNs2FEbRV97eFNWkkqZBCceMB6TbTRPQjQSRPh26PhgMti41mB5ZP4022Cvdchql+GNoz7R5WB0TXrUvfYVdmNUUw0HbeB8FllsCrqcmdHFAMCsW1oxnQ6Mh5q0rjR4src6ZIkmvaNn0I6yRgd1RtB41UxF1AoYdAtpUuSJSsMIgdLPDL5+RSZB6PSJfNjYboSfk5ZMIXAt9HN0iZg4KuEal5GJnoe19oz7PCDa+YekrrZflmPUxe5E6uw0/l961BBrIT49GXH5LvYMlngoXThvF26njspQzSt0WYq+Gxq9LaoPIxd2qW1xhWUFf32FDeddgJnU7bidiQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <44da9133-ac6a-4f69-8478-0f7cea464d08@suse.com>
Date: Mon, 24 Jul 2023 12:02:49 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] x86/hpet: Disable legacy replacement mode after IRQ
 test if not needed
Content-Language: en-US
To: Simon Gaiser <simon@invisiblethingslab.com>
Cc: xen-devel@lists.xenproject.org, Andrew Cooper
 <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>
References: <20230718122603.2002-1-simon@invisiblethingslab.com>
 <ZLaLLe2HFDN5oWUq@MacBook-Air-de-Roger.local>
 <ac77ecba-6804-1d16-60dc-f184e5d31dcb@invisiblethingslab.com>
 <58ee9410-e758-1503-e3f1-d25989fedc1e@suse.com>
 <2b4075e5-0b17-fe14-72db-12c63ab30f86@invisiblethingslab.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <2b4075e5-0b17-fe14-72db-12c63ab30f86@invisiblethingslab.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0130.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:97::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB7525:EE_
X-MS-Office365-Filtering-Correlation-Id: 8a96847c-9fb2-4855-85c6-08db8c2d2314
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Q5rXxVy/G6pMIxz+XHjjJ3EzgiyRNxc8WAamyjH8CjXa9vlpYyzoxTg9jMZkDi45rd0Qs7SbLtK6hUIXbcvnkHZNbv7jxxETF6MC5zQa4UMSDG5g2MPoAcTdk8ZIbJlcZw6I5zFsEYQ+WRbPNpZvxEoFW70VTuOeXaIbQpVTGSEIErH+cvuwDYvmOHss1U0gFZogeTVo5FY0lAayYUXCVLKUAHiU2/w/2SscZ2KrrBHbDVJEVJoSXUhXwq15G7VabODNaHBck+JBjePMT8GRE8R9863VM9f82ofBYXrpGNqEg/97rvJWhwd4FbzNGPrAGQ4kLW4s1fSwwPcTT6xB9c6x3gxgyF+PjtfFThiqAha7V4SZ9g5QECQpxQKm7ldgN9QgH5VEhuTVU8FGyS6zdm5KicEUD3vgUEQMYURchJzqrJrKpy/VHrsMdEg0x2AFWTWnFojOVSYG0zv2Fx44mCpvUBZlF69nedqfeCWfDUzYhlfpfKwDL+oArn1KVTMYFQA8qPxj1TV2VJ4jiO0CMPsaIh7tmsVI7h48PK3OPKLjFsbes1slLlpNGqmxCdH2vwZTeL49QtE9PXSDz/nbhYJUd4WirGI0NIxOSegXHeSESgk4+kpbhIt0A4MxNRdstq9ncwYjX63O8+D2VvRjDA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(366004)(376002)(39860400002)(136003)(396003)(451199021)(38100700002)(36756003)(53546011)(2616005)(83380400001)(8676002)(8936002)(5660300002)(478600001)(54906003)(66556008)(316002)(6916009)(4326008)(66946007)(41300700001)(26005)(186003)(6506007)(6486002)(6512007)(66476007)(2906002)(31686004)(31696002)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YjNHT3dScDQ5djdRdnlwcDFpZFp0bjdGbkd3cTdCNHF5TExJZytuV05JRVla?=
 =?utf-8?B?bDVlYytFQVQrVG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utf-8?B?cDVRamNQK0xXU2hpTkFWMkJQVDJmVVZhY0xSYUhxWXhENXF3aWdZemRTdGxr?=
 =?utf-8?B?OHh0ei9DNUxKSFlaMEk1T3ZtQ0FqeWhCL0MvOTNmZmp4VjY0SHI1Y3M4aFNk?=
 =?utf-8?B?dWs1YzRXd1k2US9WZnBQMXh3U2RLL0t2d0pWdzdGUG9NZmEzSU9iSURCVHho?=
 =?utf-8?B?aVBCaU92UEZjUXBWcENPTUJaZk1qMTNYcWluSTY4TWRFamtpamtZQUlWdnov?=
 =?utf-8?B?VEZaSk5sVUhjenlOYVd3a3IreXlNSm9mTUpoTkUrZlluSUJVaHFBaWNzZ0p3?=
 =?utf-8?Q?nyAiQByKh9dDetpeHn+o3NZQ4?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8a96847c-9fb2-4855-85c6-08db8c2d2314
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 10:02:49.4357
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: qvGyjnSqKvOqji8529WwLEuXTKnvKUPcuCPLHNYSmi754fZlzKLJcxiXmGUAOped+51uEJxyw/IEGmgwvVI8BQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7525

On 24.07.2023 11:48, Simon Gaiser wrote:
> Jan Beulich:
>> On 18.07.2023 23:51, Simon Gaiser wrote:
>>> Roger Pau MonnÃ©:
>>>> On Tue, Jul 18, 2023 at 02:26:03PM +0200, Simon Gaiser wrote:
>>>>> As far as I understand the HPET legacy mode is not required on systems
>>>>> with ARAT after the timer IRQ test.
>>>>
>>>> What's the relation with ARAT here?
>>>>
>>>> It would seem to me that keeping legacy replacement enabled should
>>>> only be done when opt_hpet_legacy_replacement > 0, and the currently
>>>> modified block is already in a opt_hpet_legacy_replacement < 0 gated
>>>> chunk.
>>>
>>> I was concerned that on systems without ARAT cpuidle might rely on HPET
>>> legacy mode being available. See _disable_pit_irq and lapic_timer_init.
>>> But now that I stared at this again, I think that condition isn't
>>> actually needed. If we reach that code we know that we have no working
>>> PIT, but HPET is working. So _disable_pit_irq which is run after
>>> check_timer (__start_xen first calls check_timer via smp_prepare_cpus
>>> and only later disable_pit_irq via do_initcalls) will setup HPET
>>> broadcast, which should succeed since HPET worked previously.
>>>
>>> So I guess we can just drop the condition (please double check, that
>>> code is quite tangled and I'm not familiar with it).
>>
>> What you want to respect instead though is opt_hpet_legacy_replacement.
> 
> Can you please explain what behavior you expect? As Roger pointed out
> this code only runs with opt_hpet_legacy_replacement < 0 so the user
> didn't make an explicit choice.

Oh, I'm sorry. Please disregard my comment then.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 10:15:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 10:15:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568690.888443 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsam-0005S3-M0; Mon, 24 Jul 2023 10:15:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568690.888443; Mon, 24 Jul 2023 10:15:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsam-0005Rw-Iz; Mon, 24 Jul 2023 10:15:04 +0000
Received: by outflank-mailman (input) for mailman id 568690;
 Mon, 24 Jul 2023 10:15:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qNsal-0005Rq-IU
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 10:15:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNsal-0004xf-1Q; Mon, 24 Jul 2023 10:15:03 +0000
Received: from 54-240-197-232.amazon.com ([54.240.197.232]
 helo=dev-dsk-jgrall-1b-035652ec.eu-west-1.amazon.com)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNsak-00020c-Mp; Mon, 24 Jul 2023 10:15:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:
	Subject:Cc:To:From; bh=hCg9UPO+iJ8A9P2inWazj1KBsCeHxGmLi7g4EiwiQ6E=; b=VRyjB7
	F/mUUH3bgKVaTO54zMaH25w54ePycYK8ojYjzgRWM5eMqtc4ODSwEIALDqDqjcUZNgafMEqWb1UAG
	ZtYd3b6njpN4aweqNrCm+o577TnWB2fO013HG3cz8fkn9IYkT7pUEm6JRYyIn+6nspQUo4ePqDKZO
	m1BRFOQ5BlM=;
From: Julien Grall <julien@xen.org>
To: xen-devel@lists.xenproject.org
Cc: Luca.Fancellu@arm.com,
	michal.orzel@amd.com,
	Henry.Wang@arm.com,
	Julien Grall <jgrall@amazon.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH v2] xen/arm32: head: Widen the use of the temporary mapping
Date: Mon, 24 Jul 2023 11:14:58 +0100
Message-Id: <20230724101458.79412-1-julien@xen.org>
X-Mailer: git-send-email 2.40.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Julien Grall <jgrall@amazon.com>

At the moment, the temporary mapping is only used when the virtual
runtime region of Xen is clashing with the physical region.

In follow-up patches, we will rework how secondary CPU bring-up works
and it will be convenient to use the fixmap area for accessing
the root page-table (it is per-cpu).

Rework the code to use temporary mapping when the Xen physical address
is not overlapping with the temporary mapping.

This also has the advantage to simplify the logic to identity map
Xen.

Signed-off-by: Julien Grall <jgrall@amazon.com>

----

This patch was originally part of [1] but it was reverted due to
Xen not booting on the Arndale. The second patch of this series
is fixing it (confirmed by booting on the Arndale). So I am including
this patch.

[1] https://lore.kernel.org/xen-devel/20230416143211.72227-1-julien@xen.org/

Changes in new v2:
    - Rebase
    - Drop reviewed-by tags

Changelog from the previous series:

    Changes in v6:
        - Add Henry's reviewed-by and tested-by tag
        - Add Michal's reviewed-by
        - Add newline in remove_identity_mapping for clarity

    Changes in v5:
        - Fix typo in a comment
        - No need to link boot_{second, third}_id again if we need to
          create a temporary area.

    Changes in v3:
        - Resolve conflicts after switching from "ldr rX, <label>" to
          "mov_w rX, <label>" in a previous patch

    Changes in v2:
        - Patch added
---
 xen/arch/arm/arm32/head.S | 86 ++++++++-------------------------------
 1 file changed, 16 insertions(+), 70 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 26fc420b2e1f..33b038e7e0ca 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -473,7 +473,6 @@ ENDPROC(cpu_init)
 create_page_tables:
         /* Prepare the page-tables for mapping Xen */
         mov_w r0, XEN_VIRT_START
-        create_table_entry boot_pgtable, boot_second, r0, 1
 
         /*
          * We need to use a stash register because
@@ -519,70 +518,37 @@ create_page_tables:
         cmp   r1, r0                 /* Loop until we map all of Xen */
         blo   1b
 
-        /*
-         * If Xen is loaded at exactly XEN_VIRT_START then we don't
-         * need an additional 1:1 mapping, the virtual mapping will
-         * suffice.
-         */
-        cmp   r9, #XEN_VIRT_START
-        moveq pc, lr
-
         /*
          * Setup the 1:1 mapping so we can turn the MMU on. Note that
          * only the first page of Xen will be part of the 1:1 mapping.
-         *
-         * In all the cases, we will link boot_third_id. So create the
-         * mapping in advance.
          */
+        create_table_entry boot_pgtable, boot_second_id, r9, 1
+        create_table_entry boot_second_id, boot_third_id, r9, 2
         create_mapping_entry boot_third_id, r9, r9
 
         /*
-         * Find the first slot used. If the slot is not XEN_FIRST_SLOT,
-         * then the 1:1 mapping will use its own set of page-tables from
-         * the second level.
+         * Find the first slot used. If the slot is not the same
+         * as TEMPORARY_AREA_FIRST_SLOT, then we will want to switch
+         * to the temporary mapping before jumping to the runtime
+         * virtual mapping.
          */
         get_table_slot r1, r9, 1     /* r1 := first slot */
-        cmp   r1, #XEN_FIRST_SLOT
-        beq   1f
-        create_table_entry boot_pgtable, boot_second_id, r9, 1
-        b     link_from_second_id
-
-1:
-        /*
-         * Find the second slot used. If the slot is XEN_SECOND_SLOT, then the
-         * 1:1 mapping will use its own set of page-tables from the
-         * third level.
-         */
-        get_table_slot r1, r9, 2     /* r1 := second slot */
-        cmp   r1, #XEN_SECOND_SLOT
-        beq   virtphys_clash
-        create_table_entry boot_second, boot_third_id, r9, 2
-        b     link_from_third_id
+        cmp   r1, #TEMPORARY_AREA_FIRST_SLOT
+        bne   use_temporary_mapping
 
-link_from_second_id:
-        create_table_entry boot_second_id, boot_third_id, r9, 2
-link_from_third_id:
-        /* Good news, we are not clashing with Xen virtual mapping */
+        mov_w r0, XEN_VIRT_START
+        create_table_entry boot_pgtable, boot_second, r0, 1
         mov   r12, #0                /* r12 := temporary mapping not created */
         mov   pc, lr
 
-virtphys_clash:
+use_temporary_mapping:
         /*
-         * The identity map clashes with boot_third. Link boot_first_id and
-         * map Xen to a temporary mapping. See switch_to_runtime_mapping
-         * for more details.
+         * The identity mapping is not using the first slot
+         * TEMPORARY_AREA_FIRST_SLOT. Create a temporary mapping.
+         * See switch_to_runtime_mapping for more details.
          */
-        PRINT("- Virt and Phys addresses clash  -\r\n")
         PRINT("- Create temporary mapping -\r\n")
 
-        /*
-         * This will override the link to boot_second in XEN_FIRST_SLOT.
-         * The page-tables are not live yet. So no need to use
-         * break-before-make.
-         */
-        create_table_entry boot_pgtable, boot_second_id, r9, 1
-        create_table_entry boot_second_id, boot_third_id, r9, 2
-
         /* Map boot_second (cover Xen mappings) to the temporary 1st slot */
         mov_w r0, TEMPORARY_XEN_VIRT_START
         create_table_entry boot_pgtable, boot_second, r0, 1
@@ -720,33 +686,13 @@ remove_identity_mapping:
         /* r2:r3 := invalid page-table entry */
         mov   r2, #0x0
         mov   r3, #0x0
-        /*
-         * Find the first slot used. Remove the entry for the first
-         * table if the slot is not XEN_FIRST_SLOT.
-         */
+
+        /* Find the first slot used and remove it */
         get_table_slot r1, r9, 1     /* r1 := first slot */
-        cmp   r1, #XEN_FIRST_SLOT
-        beq   1f
-        /* It is not in slot 0, remove the entry */
         mov_w r0, boot_pgtable       /* r0 := root table */
         lsl   r1, r1, #3             /* r1 := Slot offset */
         strd  r2, r3, [r0, r1]
-        b     identity_mapping_removed
-
-1:
-        /*
-         * Find the second slot used. Remove the entry for the first
-         * table if the slot is not XEN_SECOND_SLOT.
-         */
-        get_table_slot r1, r9, 2     /* r1 := second slot */
-        cmp   r1, #XEN_SECOND_SLOT
-        beq   identity_mapping_removed
-        /* It is not in slot 1, remove the entry */
-        mov_w r0, boot_second        /* r0 := second table */
-        lsl   r1, r1, #3             /* r1 := Slot offset */
-        strd  r2, r3, [r0, r1]
 
-identity_mapping_removed:
         flush_xen_tlb_local r0
         mov   pc, lr
 ENDPROC(remove_identity_mapping)
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 10:18:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 10:18:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568694.888452 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsde-0006Au-6X; Mon, 24 Jul 2023 10:18:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568694.888452; Mon, 24 Jul 2023 10:18:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsde-0006An-3y; Mon, 24 Jul 2023 10:18:02 +0000
Received: by outflank-mailman (input) for mailman id 568694;
 Mon, 24 Jul 2023 10:18:00 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qNsdc-0006Ah-DE
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 10:18:00 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNsdb-000505-OP; Mon, 24 Jul 2023 10:17:59 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNsdb-000257-Jc; Mon, 24 Jul 2023 10:17:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=OPFAh+JMkSbhiwigso2scbLewGXjLhTXiV380AezFxE=; b=1ncu61U+RiN/hXI/oC2wmZq1w6
	tP/1UzGGS0vl01YaENlphPavQ/EGlFaCuN82jJOQeMrs7/jxUZaOQf/BAdtv8AQ2ayxW/TUtuOjGT
	o1PnuvrctJ8V/+EIXJ9NzOEes7KSxFMAwF+NM2CLDkDkwGCu7V8l5RmqYApZTMHzx9X0=;
Message-ID: <fcd60aeb-e983-93a2-8da3-0193d1062764@xen.org>
Date: Mon, 24 Jul 2023 11:17:58 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v2 1/2] tools/xenstore: add const to the return type of
 canonicalize()
Content-Language: en-US
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230722081646.4136-1-jgross@suse.com>
 <20230722081646.4136-2-jgross@suse.com>
 <adc0b17a-1d59-8c52-8823-64a0d9ec475b@xen.org>
 <e374c950-7dce-2e28-3b4c-946f4a0a2aec@xen.org>
 <2fca0a55-3cbf-1875-62c9-2d27cbdd5f20@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <2fca0a55-3cbf-1875-62c9-2d27cbdd5f20@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 24/07/2023 08:10, Juergen Gross wrote:
> On 22.07.23 18:44, Julien Grall wrote:
>>
>>
>> On 22/07/2023 16:20, Julien Grall wrote:
>>> Hi Juergen,
>>>
>>> On 22/07/2023 09:16, Juergen Gross wrote:
>>>> -static struct watch *add_watch(struct connection *conn, char *path, 
>>>> char *token,
>>>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  bool relative, bool no_quota_check)
>>>> +static struct watch *add_watch(struct connection *conn, const char 
>>>> *path,
>>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const char *token, bool relative,
>>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  bool no_quota_check)
>>>> Â  {
>>>> Â Â Â Â Â  struct watch *watch;
>>>> @@ -218,12 +219,14 @@ int do_watch(const void *ctx, struct 
>>>> connection *conn, struct buffered_data *in)
>>>> Â  {
>>>> Â Â Â Â Â  struct watch *watch;
>>>> Â Â Â Â Â  char *vec[2];
>>>> +Â Â Â  const char *path;
>>>> Â Â Â Â Â  bool relative;
>>>> Â Â Â Â Â  if (get_strings(in, vec, ARRAY_SIZE(vec)) != ARRAY_SIZE(vec))
>>>> Â Â Â Â Â Â Â Â Â  return EINVAL;
>>>> -Â Â Â  errno = check_watch_path(conn, ctx, &(vec[0]), &relative);
>>>> +Â Â Â  path = vec[0];
>>>> +Â Â Â  errno = check_watch_path(conn, ctx, &path, &relative);
>>>
>>> Â From my understanding, check_watch_path() could update vec[0] which 
>>> is then used below. But with your change, vec[0] would not be updated 
>>> anymore.
>>>
>>> I can see two possible approach:
>>> Â Â Â  1) get_strings() is taking a const as well
>>
>> I have a patch doing this. I will send it on Monday.
> 
> Hmm, looking at this I think this will collide with my patch.

Yes, it will for check_watch_patch().

> 
> Would you mind me doing the conversion of get_strings() in my patch, too?

Sure.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 10:25:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 10:25:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568702.888463 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNskL-0007ca-0I; Mon, 24 Jul 2023 10:24:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568702.888463; Mon, 24 Jul 2023 10:24:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNskK-0007cT-Sp; Mon, 24 Jul 2023 10:24:56 +0000
Received: by outflank-mailman (input) for mailman id 568702;
 Mon, 24 Jul 2023 10:24:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qNskJ-0007cN-Pt
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 10:24:55 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNskI-0005Q7-U4; Mon, 24 Jul 2023 10:24:54 +0000
Received: from 54-240-197-224.amazon.com ([54.240.197.224]
 helo=dev-dsk-jgrall-1b-035652ec.eu-west-1.amazon.com)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNskI-0002N7-GI; Mon, 24 Jul 2023 10:24:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:
	Subject:Cc:To:From; bh=emAUPp2iwh6deQobz6UsP/g0MPIQJ8uB2ul+C3tWMog=; b=JPy4Rk
	JIneq5PfwR1b/6ua27urc0bVwGK2XFPiVSpsOYK2SWpTAclX75Sg/w/VB1Y204M+Hqumubad8U9Qx
	SFHqE6kQxdPbqNVbFULlvIVNeT0isB9RixB8O69nOfKfSDqkjDh9lX9GBBUdT1yxIyE2aQlb2JrjW
	ELM7mNMXQ4s=;
From: Julien Grall <julien@xen.org>
To: xen-devel@lists.xenproject.org
Cc: nicola.vetrini@bugseng.com,
	Julien Grall <jgrall@amazon.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH] xen/dt: Rework the prototype of dt_property_read_string() to help Eclair
Date: Mon, 24 Jul 2023 11:24:43 +0100
Message-Id: <20230724102443.91894-1-julien@xen.org>
X-Mailer: git-send-email 2.40.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Julien Grall <jgrall@amazon.com>

Eclair vXXX is unable to prove the parameter out_string will only be
used the return of dt_property_read_string() is 0. So it will consider
that MISRA C:2012 Rule 9.1 was violated.

Rework the prototype so the string is returned and use ERR_PTR() to
embed the error code.

Signed-off-by: Julien Grall <jgrall@amazon.com>

---

The XXX should be replaced with the version of Eclair. Nicola, can you
provide it?
---
 xen/arch/arm/domain_build.c   |  4 +++-
 xen/arch/arm/psci.c           | 10 +++++-----
 xen/common/device_tree.c      | 15 +++++++--------
 xen/drivers/char/arm-uart.c   | 10 ++++++----
 xen/include/xen/device_tree.h | 16 ++++++++--------
 5 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 39b4ee03a505..2f98f0b1bd9c 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -3850,7 +3850,9 @@ static int __init construct_domU(struct domain *d,
 
     kinfo.vpl011 = dt_property_read_bool(node, "vpl011");
 
-    rc = dt_property_read_string(node, "xen,enhanced", &dom0less_enhanced);
+    dom0less_enhanced = dt_property_read_string(node, "xen,enhanced");
+
+    rc = IS_ERR(dom0less_enhanced) ? PTR_ERR(dom0less_enhanced) : 0;
     if ( rc == -EILSEQ ||
          rc == -ENODATA ||
          (rc == 0 && !strcmp(dom0less_enhanced, "enabled")) )
diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index 695d2fa1f1b5..8e01b5962c63 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -8,7 +8,7 @@
  * Copyright (c) 2013 Linaro Limited.
  */
 
-
+#include <xen/err.h>
 #include <xen/types.h>
 #include <xen/init.h>
 #include <xen/mm.h>
@@ -85,13 +85,13 @@ static int __init psci_features(uint32_t psci_func_id)
 
 static int __init psci_is_smc_method(const struct dt_device_node *psci)
 {
-    int ret;
     const char *prop_str;
 
-    ret = dt_property_read_string(psci, "method", &prop_str);
-    if ( ret )
+    prop_str = dt_property_read_string(psci, "method");
+    if ( IS_ERR(prop_str) )
     {
-        printk("/psci node does not provide a method (%d)\n", ret);
+        printk("/psci node does not provide a method (%ld)\n",
+               PTR_ERR(prop_str));
         return -EINVAL;
     }
 
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 0677193ab370..11222c3a8abf 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -191,21 +191,20 @@ bool_t dt_property_read_u64(const struct dt_device_node *np,
 
     return 1;
 }
-int dt_property_read_string(const struct dt_device_node *np,
-                            const char *propname, const char **out_string)
+
+const char *dt_property_read_string(const struct dt_device_node *np,
+                                    const char *propname)
 {
     const struct dt_property *pp = dt_find_property(np, propname, NULL);
 
     if ( !pp )
-        return -EINVAL;
+        return ERR_PTR(-EINVAL);
     if ( !pp->length )
-        return -ENODATA;
+        return ERR_PTR(-ENODATA);
     if ( strnlen(pp->value, pp->length) >= pp->length )
-        return -EILSEQ;
-
-    *out_string = pp->value;
+        return ERR_PTR(-EILSEQ);
 
-    return 0;
+    return pp->value;
 }
 
 /**
diff --git a/xen/drivers/char/arm-uart.c b/xen/drivers/char/arm-uart.c
index 8098a968c285..b76d8063beee 100644
--- a/xen/drivers/char/arm-uart.c
+++ b/xen/drivers/char/arm-uart.c
@@ -21,6 +21,7 @@
 
 #include <xen/console.h>
 #include <xen/device_tree.h>
+#include <xen/err.h>
 #include <xen/param.h>
 #include <xen/serial.h>
 #include <xen/errno.h>
@@ -55,16 +56,17 @@ static void __init dt_uart_init(void)
         {
             const char *stdout;
 
-            ret = dt_property_read_string(chosen, "stdout-path", &stdout);
-            if ( ret >= 0 )
+            stdout = dt_property_read_string(chosen, "stdout-path");
+            if ( !IS_ERR(stdout) )
             {
                 printk("Taking dtuart configuration from /chosen/stdout-path\n");
                 if ( strlcpy(opt_dtuart, stdout, sizeof(opt_dtuart))
                      >= sizeof(opt_dtuart) )
                     printk("WARNING: /chosen/stdout-path too long, truncated\n");
             }
-            else if ( ret != -EINVAL /* Not present */ )
-                printk("Failed to read /chosen/stdout-path (%d)\n", ret);
+            else if ( PTR_ERR(stdout) != -EINVAL /* Not present */ )
+                printk("Failed to read /chosen/stdout-path (%ld)\n",
+                       PTR_ERR(stdout));
         }
     }
 
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index c2eada748915..492204b4feda 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -486,18 +486,18 @@ static inline bool_t dt_property_read_bool(const struct dt_device_node *np,
  *              if return value if 0.
  *
  * Search for a property in a device tree node and retrieve a null
- * terminated string value (pointer to data, not a copy). Returns 0 on
- * success, -EINVAL if the property does not exist, -ENODATA if property
- * doest not have value, and -EILSEQ if the string is not
- * null-terminated with the length of the property data.
+ * terminated string value (pointer to data, not a copy). Returns a
+ * pointer to a null terminated string on success, -EINVAL if the property
+ * does not exist, -ENODATA if property doest not have value, and -EILSEQ
+ * if the string is not null-terminated with the length of the property data.
+ *
+ * The caller should use IS_ERR(...) to check if an error is returned.
  *
  * Note that the empty string "" has length of 1, thus -ENODATA cannot
  * be interpreted as an empty string.
- *
- * The out_string pointer is modified only if a valid string can be decoded.
  */
-int dt_property_read_string(const struct dt_device_node *np,
-                            const char *propname, const char **out_string);
+const char *dt_property_read_string(const struct dt_device_node *np,
+                                    const char *propname);
 
 /**
  * dt_property_match_string() - Find string in a list and return index
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 10:28:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 10:28:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568704.888473 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsnW-0008L6-G5; Mon, 24 Jul 2023 10:28:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568704.888473; Mon, 24 Jul 2023 10:28:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsnW-0008Kz-CJ; Mon, 24 Jul 2023 10:28:14 +0000
Received: by outflank-mailman (input) for mailman id 568704;
 Mon, 24 Jul 2023 10:28:13 +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
 <SRS0=GZnG=DK=citrix.com=prvs=5629cf0ab=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qNsnV-0008Kr-J9
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 10:28:13 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c8c300ab-2a0c-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 12:28:10 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c8c300ab-2a0c-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690194490;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:content-transfer-encoding:in-reply-to;
  bh=+f9zFSLQ2gak6Gf97nxUR4+vN+KgXcXbChzBQRV/ijA=;
  b=K9jbcP5OkOV+428vY5fRDE9OwmoueK/KfRhXGFJzMidvKVhxsaJTl5Iv
   DLo0T/9aoySuzYjvR8CX5jdD1Hl4EQ4M5S4ytPw12rSQlPClxEsablKE0
   XBnhLvw8YCEtj/+w3z90q//TKXdqrkk7wKPC3urhPNitmcOJ9JVLaiT+b
   I=;
Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 117641410
X-Ironport-Server: esa1.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:FNMfw6hbXrgdxiY8X+vf6U3JX161VxAKZh0ujC45NGQN5FlHY01je
 htvUW7QPv2KazGjfYsiPYmypkoO68PUmN9mGldqqSxnQSob9cadCdqndUqhZCn6wu8v7q5Ex
 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv
 cKai8DEMRqu1iUc3lg8sspvkzsx+qyr0N8klgZmP6sT4wWFzyJ94K83fsldEVOpGuG4IcbiL
 wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ
 OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+
 tQUAQ9cKSiHot6ng7ulELNt25QONNvSadZ3VnFIlVk1DN4jSJHHBa7L+cVZzHE7gcUm8fT2P
 pRDL2A1NVKZPkMJYw1MYH49tL7Aan3XejtEqFWTtOwv7nLa1gBZ27nxKtvFPNeNQK25m27B/
 z2Yoz2lW0ly2Nq36yqPynK2uM3zwS7KaZM5T4X/qvx0qQjGroAUIEJPDgbqyRWjsWaaRtlWb
 WId/CEjqawv3EWxS5/2WBjQiHyOswMYWtFQO/Yn8wzLwa3Riy6jD2gZSnh6adoptOc/Xzls3
 ViM9/v5CDoqvLCLRHa18raPsSj0KSUTNXUFZyIPUU0C+daLiIgrgwjGVNpLDK+/hdqzEjb1q
 w1mtwBn2e9V15RSkfzmoxae2WnESoX1ohAd6izoDyWd6iZFdc2sedby6AWLwO5SFdPMJrWeh
 0Toi/Ry/chXU8DVzXfRHb1VdF26z63baWOB2DaDC7Fkrm3woCD7IOi89RkkfC9U3tA4lSgFi
 aM5kSdY/9dtMXSjdsebiKrhWp1xncAM+TkIP804j+aigbArLmdrBAk0OSatM5nFySDAa50XN
 5aBatqLBn0HE6lhxzfeb75DgOdynX9kmT6CHcuTI/GbPV22PSD9dFv4GAHWMrBRAF2s/W05D
 Oqzx+PVkk4CAYUSkwHc8JIJLEBiEJTILcmeliCjTcbaelAOMDh4W5fsLUYJJ9QNc1J9yr2Zo
 RlQmyZwlDLCuJEwAVzTOyE9MumxDM8XQLBSFXVEAGtEEkMLOe6HhJrzvbNtFVX73ISPFcJJc
 sQ=
IronPort-HdrOrdr: A9a23:7ahpLKw3aiArGdKurP0WKrPwLL1zdoMgy1knxilNoH1uA6qlfq
 WV9sjzuiWE6gr5O0tBpTnjAtjkfZq0z/cciugs1NyZLW3bUQWTXeZfBEjZrwEI2ReSygeQ78
 hdmmFFZuEZqzVB/KXH3DU=
X-Talos-CUID: 9a23:5lUrSGPUsu3yqe5DVABYpQksHuUZYz7U0i2KIhLoJH57cejA
X-Talos-MUID: 9a23:oU7wIgnN1xMqd59Hb5g0dnpAJM1Q476QKnxRnKQ3quLfDWssOSm02WE=
X-IronPort-AV: E=Sophos;i="6.01,228,1684814400"; 
   d="scan'208";a="117641410"
Date: Mon, 24 Jul 2023 11:28:04 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Luca Fancellu <Luca.Fancellu@arm.com>
CC: Jan Beulich <jbeulich@suse.com>, Rahul Singh <Rahul.Singh@arm.com>, "Roger
 Pau =?iso-8859-1?Q?Monn=E9?=" <roger.pau@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [OSSTEST] ts-kernel-build: add kernel kconfig for the Arndale
Message-ID: <af1388d4-ddd8-4afe-8710-f5a780e8c333@perard>
References: <20230721121627.1229906-1-luca.fancellu@arm.com>
 <ceb7d6ad-0292-facf-6ad5-4bd265a8d34d@suse.com>
 <2CA77C15-BA9B-4D98-80A0-B1B7EDE4E48B@arm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <2CA77C15-BA9B-4D98-80A0-B1B7EDE4E48B@arm.com>

On Fri, Jul 21, 2023 at 04:45:44PM +0000, Luca Fancellu wrote:
> > On 21 Jul 2023, at 14:24, Jan Beulich <jbeulich@suse.com> wrote:
> > On 21.07.2023 14:16, Luca Fancellu wrote:
> >> --- a/ts-kernel-build
> >> +++ b/ts-kernel-build
> >> @@ -245,6 +245,7 @@ setopt CONFIG_SENSORS_LM90 n
> >> setopt CONFIG_ICS932S401 n
> >> 
> >> # Enable some additional drivers for Arndale.
> >> +setopt CONFIG_AHCI_DWC y
> > 
> > ... does it really need to be y (and not m) here?
> 
> I didnâ€™t try with m before because I was unsure where the kernel module were put (in the disk? But then we need to read it),
> but now I did a try with â€˜mâ€™ and it works, so I guess the module are put in some ramdisk instead of the disk we want to read.
> 
> Thanks for pointing that out.
> 
> @Roger, is it possible to change it on commit or should I send a v2?

I've pushed the patch to "pretest" with this modification.

If osstest is happy with the patch (that is no regression with a
"xen-unstable" flight), it will be committed.

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 10:29:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 10:29:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568706.888483 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsok-0000RD-Q2; Mon, 24 Jul 2023 10:29:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568706.888483; Mon, 24 Jul 2023 10:29:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNsok-0000R6-Ly; Mon, 24 Jul 2023 10:29:30 +0000
Received: by outflank-mailman (input) for mailman id 568706;
 Mon, 24 Jul 2023 10:29:29 +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
 <SRS0=sIK2=DK=invisiblethingslab.com=simon@srs-se1.protection.inumbo.net>)
 id 1qNsoj-0000R0-Pj
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 10:29:29 +0000
Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com
 [64.147.123.20]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f6d565bf-2a0c-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 12:29:27 +0200 (CEST)
Received: from compute2.internal (compute2.nyi.internal [10.202.2.46])
 by mailout.west.internal (Postfix) with ESMTP id E886B320091C;
 Mon, 24 Jul 2023 06:29:24 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute2.internal (MEProxy); Mon, 24 Jul 2023 06:29:25 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 24 Jul 2023 06:29:22 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f6d565bf-2a0c-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm3; t=
	1690194564; x=1690280964; bh=bRwBeznDm7R257YGjVw6nEKDUe4UcUMR/8q
	E2bCz4vc=; b=GX2ZDMvAXgehf2SahEhgC/O4Cd/11DUqRB4BEwVtVLEZHRQCz7w
	wuARVsCq8jmdpJlCVBWu5P7fUuD96g2XeAkF2GvVafQdE0cv3QK9LCje/B26nQtL
	pKN9mhe0XnYsOn014yTIxaSLoq4tiCuQ07xB01LaoGh73DrH4EERYU3Ko9gzqqKw
	vPyZOdhqANRpVSRyRvLVkVac6PR1amCUJq35F/R8JBNJkW/go21J0YI6pnpw9n/Z
	F1ykGw3cWq56UqrXOWHgubhaBaLXAo4zkkA2H7JmBtVopZVlH/REGPr//C+LEO8M
	JMZzaY/Zj6yZ1WeMFcWPDRcaD/ToWgvxV2Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1690194564; x=1690280964; bh=bRwBeznDm7R25
	7YGjVw6nEKDUe4UcUMR/8qE2bCz4vc=; b=0CY6hNqRUvzNjyEMbdOXDFJN71QjD
	zHNksNkVVRhUKnrLsRJKzBMJz0ILMbDRbhoNyOO0xahVyXHkWRPGhkVuS1pNjDRR
	oC69Pg8F0xw3N9tj0/rirn8oDhlcWusRNmWh83m90FPEeDrUX8zyeyAMKuTbc8BM
	csz3gosk7BvwGrrwWmDsrLx5/plVTCt7fJyKOEBHWcro5YRr6Xwm6jG0Nqwe5DGy
	71KYbSfuPHKVLnQh53Vel+tfBYFHfRDIsHz5+heGJ4AvYQ8LO4IrG96SobEQyd+A
	KO3p+DK2Q1It9YjgvQEyc0JhAzrPAaVT6TUA787bejxWxL5BAI7Ls4tXw==
X-ME-Sender: <xms:hFK-ZJdW_kEmBIRp34dLp2PaFRsTyUE2Aqmmg0rUQgN4MvbARAhcoA>
    <xme:hFK-ZHOkQKhp5cXxmcEcjSypAtZyfpvLsE92Q2fpCFVeg2SlRhuC0svD2F-be_j_E
    -MoJImGz0FBHBs>
X-ME-Received: <xmr:hFK-ZCivqQKrO8-vov09bJFYDsxkQfvwm099ZaVIbX8853-f50PQo2Mf_sI>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrheekgddvjecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpefkffgguffvvehfhfgjtgesghdtreertddtjeenucfhrhhomhepufhimhhonhcu
    ifgrihhsvghruceoshhimhhonhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtoh
    hmqeenucggtffrrghtthgvrhhnpeeftdefudeltdevhfehkeefhfeutdfhffdugeetffdv
    gfehfeekhfetgedvuefggfenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluh
    hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshhimhhonhesihhn
    vhhishhisghlvghthhhinhhgshhlrggsrdgtohhm
X-ME-Proxy: <xmx:hFK-ZC_wYAPQOYH8iG3S8VnC9ffRLxMQug32483z2RCe668YzirbVg>
    <xmx:hFK-ZFtCqPEDnnycVZD5lGXgb2lWyRTElQlL6ZalwWYKSiOlZoIc9w>
    <xmx:hFK-ZBGfDKcvYyx1gKKQWOOWqS_PNVNgfOIJJjHnSufWL_0vd9IPgQ>
    <xmx:hFK-ZO4f2YDJBVI2IDvm-n7MwbP17-4TznU9uvB_qEju_qR-xcRIJQ>
Feedback-ID: idc5945a3:Fastmail
Message-ID: <81ca146e-986c-b934-3567-2e1267a31ad7@invisiblethingslab.com>
Date: Mon, 24 Jul 2023 12:29:09 +0200
MIME-Version: 1.0
Subject: Re: [PATCH] xen/events: Add wakeup support to xen-pirq
Content-Language: en-US
To: Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
References: <20230313134102.3157-1-simon@invisiblethingslab.com>
From: Simon Gaiser <simon@invisiblethingslab.com>
In-Reply-To: <20230313134102.3157-1-simon@invisiblethingslab.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------Hf0VWW22SHCK1Z6ZaG9MPeYj"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------Hf0VWW22SHCK1Z6ZaG9MPeYj
Content-Type: multipart/mixed; boundary="------------NM7xgrV6rptQJ4hiPTQm8Yjd";
 protected-headers="v1"
From: Simon Gaiser <simon@invisiblethingslab.com>
To: Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Message-ID: <81ca146e-986c-b934-3567-2e1267a31ad7@invisiblethingslab.com>
Subject: Re: [PATCH] xen/events: Add wakeup support to xen-pirq
References: <20230313134102.3157-1-simon@invisiblethingslab.com>
In-Reply-To: <20230313134102.3157-1-simon@invisiblethingslab.com>

--------------NM7xgrV6rptQJ4hiPTQm8Yjd
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Simon Gaiser:
> This allows entering and exiting s2idle. Actual S0ix residency is
> another topic [1].
>=20
> Without this the ACPI code currently ignores the error enable_irq_wake(=
)
> returns when being used on a xen-pirq and the system goes to idle for
> ever since the wakeup IRQ doesn't gets enabled. With [2] the error is
> handled and the system refuses to go to s2idle.
>=20
> Link: https://lore.kernel.org/xen-devel/9051e484-b128-715a-9253-48af8e4=
7bb9d@invisiblethingslab.com/ # [1]
> Link: https://lore.kernel.org/linux-acpi/20230313125344.2893-1-simon@in=
visiblethingslab.com/ # [2]
> Signed-off-by: Simon Gaiser <simon@invisiblethingslab.com>
> ---
>=20
> While I think that the set of flags I set is correct, I'm not familiar
> with that code, so please pay special attention during review if they
> are actually correct for xen-pirq.
>=20
>  drivers/xen/events/events_base.c | 4 ++++
>  1 file changed, 4 insertions(+)
>=20
> diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/even=
ts_base.c
> index c7715f8bd452..991082f04f05 100644
> --- a/drivers/xen/events/events_base.c
> +++ b/drivers/xen/events/events_base.c
> @@ -2176,6 +2176,10 @@ static struct irq_chip xen_pirq_chip __read_most=
ly =3D {
>  	.irq_set_affinity	=3D set_affinity_irq,
> =20
>  	.irq_retrigger		=3D retrigger_dynirq,
> +
> +	.flags                  =3D IRQCHIP_SKIP_SET_WAKE |
> +				  IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND |
> +				  IRQCHIP_MASK_ON_SUSPEND,
>  };
> =20
>  static struct irq_chip xen_percpu_chip __read_mostly =3D {
ping

--------------NM7xgrV6rptQJ4hiPTQm8Yjd--

--------------Hf0VWW22SHCK1Z6ZaG9MPeYj
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE3E8ezGzG3N1CTQ//kO9xfO/xly8FAmS+UncACgkQkO9xfO/x
ly9H4w/9H6fMRreUIMniGKL0lM56B1kdKr6WGIfsRP979zHetmBSz0dKKcjJ7e5b
M+ljI+bNMocw/Pq4ph6EKLtrkCjsfH51+44EnZJmDgONbF5kZbxOZc1/YB+WHmWm
qr1eRhq6p7ORtCCRiHdc2Rpr72HMoxc+YDNLhfxdF10j3CVI2jShuEp/hf46zZnM
T3JSVXd1boQo09O2pt6Ka7BjbblfINJ0wT6zNdyhOeBEZMDI5siFP6cddKf+nrAo
2m7CYP7Njgr0IALV1OC4NC39s+qEx7uNzBTVSLJkBpYvyvKC6XfHyJavyaY40MA7
iyeA8hjq6IWCsZ67OcjAokF06ox0xr4ll7H8kx7QAZSwtSTbC+gK4zBgPn/DBAD1
NWj8qHhxFl3oEb/KBZXTg+0JuABbU7ARk/JZhZxR62WZU2hwHMzUViy1hzUvOzty
b1rzZTi3SsSmTaxZOr/vEHBkdde0FYQpLRowLs0v0uUvYB227Ey/HNxr0DJCC6CJ
WhcArncJhkRV+A5kYy47iLJeDMQTElGCRNm1Anm42BMo475b2GT2CWcw0Spnhnnl
pqGSfJISZTQ2HdZmcwFOzDnwBpTcByYsBI5ou5m2/JfRx5UWNGcsxRQaXSAp5IQ4
QelAecD+Fh6LNjnWn3AXXDhBL3o40A+upI4T1prOr74lPjYZudI=
=hLGI
-----END PGP SIGNATURE-----

--------------Hf0VWW22SHCK1Z6ZaG9MPeYj--


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 10:30:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 10:30:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568711.888493 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNspn-0001nf-39; Mon, 24 Jul 2023 10:30:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568711.888493; Mon, 24 Jul 2023 10:30:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNspm-0001nY-WE; Mon, 24 Jul 2023 10:30:35 +0000
Received: by outflank-mailman (input) for mailman id 568711;
 Mon, 24 Jul 2023 10:30:33 +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 <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNspl-0001nO-S8
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 10:30:33 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20613.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::613])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1d7b5cd7-2a0d-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 12:30:31 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB8059.eurprd04.prod.outlook.com (2603:10a6:10:1e9::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 10:30:29 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 10:30:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1d7b5cd7-2a0d-11ee-8612-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=QQootZuVpSWOq/5x+mK42PBG6+koVF6f7+SAkjzQdB8Hz9V3kLiYuCv6dld21UARGm/3ZhghxafIst7uRI5imQAyNYtvi9lQkRuUYxQ749C6qQ6Rt6ihmRw/aBlDeAQxg0iWPwP5D4EwduVrpaf+mfQi833YorQU9Iu5ZwCXrGz+eK+ZEUE8vZXw8SJ7kCEDfU/89wbeHDvRpaO54C0vrmRU9pT1GowlBUZwP2G9K8LtHAAbez7YsZDnQq+CBRJHJ4yppDSPaZs+wkfz+6LR3t/JzOf4kEASCGmnWqwjmTStGTTD8c9TpNhB46e6F3XoISZziRZIXcZjGMoL9Z4Gww==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=EZmkc2QkwNO94vPcC2/TsHIaCueBdwovQsBRyUUDMOU=;
 b=KSFArn7o+XckPTX/Mx8nx9BYVE4uwwYPrY3rKTmO2P+0YVAIOslmyBTNV9nGbHxYEeGEpMvJPMArgALcDe48HZJPdyHrRIm1uwy/iNr0TYHfy7IfoU3iN5t2HAvhzpJ9dRAPctiKiH3c9WyMGIuN8Os1Uk0LWNhIi+b/CyX8CCyn/pJod3NQLFh6eBIJPhYhI0dq63TBqQ8Xp9jI5ifi2RGcpg8L2ZZfgJF7IJGotzdCPFVukQcHckMzKufrjTmFecZjM1444LPfSVRxvsKXQMnHAvP58IEoFYZrYy4RMeMoxIzGZDnrc5HfqkmIKc3YDshaw/sT49yt58LCCn1LrA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=EZmkc2QkwNO94vPcC2/TsHIaCueBdwovQsBRyUUDMOU=;
 b=s7mWS92FV2zPbSF4RXB15MowJw+wt+jHgfAXJKxEQB0S+3t4qi20IAlVzM6uqqEQF5hnQDJSD0rg+nNyTSUh3tgJohjlZl7fo7fgo36Cn3a3PJF0xr5u4PjLglArYVp12WRXFqUC1XqPUuGdHpECj80bFaYdlFN8dXbbkyDiUlIC57YpBhhdOIpQqBqpNf2w5yOPiG+iOlTs2oQEAZmhlIzln9DZB+GlVm2dm4/cAgaTNc51nZIvQU62cfKVbXOKx5i6Btl4bpF50Nj+2J9y3JG1WaYD2XJPZtkqQFhwoBz4+M4hp249X21+rIlm0va/yaPObAFm+aKTd+WNRvvO0A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <5b9b873a-aa1b-2922-19e0-80e41a921e45@suse.com>
Date: Mon, 24 Jul 2023 12:30:29 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 08/13] vpci/header: program p2m with guest BAR view
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-9-volodymyr_babchuk@epam.com>
 <ZLqCr_ySq41C5w1i@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZLqCr_ySq41C5w1i@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0166.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:99::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB8059:EE_
X-MS-Office365-Filtering-Correlation-Id: 5d9a2287-4f99-497b-7999-08db8c31005b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	OYznELYUpiYr4aPJIHTlilNrwe7TEMHBlFr+yrucFmlZ4eSNpb3EKUqGVVrKGYfp9rrwQXdzcEyCxawlzVUqUxNlyHGJZCM5CGXhD8FNPJfv/MvQEgku4hh/C1wSn/Dw11pWtXjGGtnKExSRKRfd3kMAc7sRFkWb4ABIorpnucbRToWaSW2bANbquT599RnHPXVzs/3QL+Rz6Hg+cFwE/zUrIaoLhtaVtzVndBYzRFYkDx7RYe9W1CWFTtFlMYekHr2loCpw/aNYcnhm9ti9FzRmQrd5tHP3n5UCqtK0srATKx1sYtWKzcsT8mUEVsFe8U1Dm/v1si9S2XXmDfZbjp1B3E0tR7ZJYcCsqaW6gbPm86VYEX2Bt8SLb3dK6pWwg267nz2+RaDNf36sXbvilAyjbx+QQQ1lY/SCMKj28UdaqxbGTYJrcEGWgDE+inTOHjexXS+93BbLeokBtKmh00MDLqhAO9Ha6dZKFU/sKmOeHQ99GaTubk84SwZg/7H+YmjsqTao+KiWX01dGRKrDNKNaSdlJUAXlG5gR3Cf17vNXCR4d0ZLwtg3Yp40ii/TBdOVGJ3y/1k2sTS5iIOuM9wJHgkNucYCBfJhZY+mqfkdhuFzmF72Uy6eZZvB3zEsR4hLPUcMJdXK44vhUZMY/w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(136003)(346002)(396003)(366004)(376002)(451199021)(6506007)(26005)(186003)(36756003)(5660300002)(31696002)(8936002)(8676002)(4744005)(2906002)(53546011)(38100700002)(86362001)(6486002)(66476007)(66556008)(6512007)(66946007)(83380400001)(31686004)(54906003)(478600001)(110136005)(41300700001)(2616005)(4326008)(316002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eGpWajVvV2twVXZCNDRSbHRhb2tUbmJEb2VobnQvSlVZK1NWQkliNkxCdi9C?=
 =?utf-8?B?OTFDMnR2UDZZQnZIVHNxQjZlVUJBU3RIOFpKcVYvOFZQY2J6WjUrSncrSXlz?=
 =?utf-8?B?aGE1OHVBTW1EVElOVUxha1JucFRsZXJzdCt2a0VyY2FHbDBHQk0zWFA4VGZn?=
 =?utf-8?B?NVhnTmk0THpvOXBxWmhuRmp4YU5FMjRGRTl2OHRhVDQrTm5kQ1dFZUtybDJz?=
 =?utf-8?B?RFZDMmljSGFQSmJ0bHRiNU1iTkhIYVJZSStrNHdkNGRsOE9LS200WnovWVRX?=
 =?utf-8?B?M3g5Ung1MUR4VThteGhWWEtsb3AwOVovM0JEdEJHaWkyTHBLeXdpd2F1QlRH?=
 =?utf-8?B?aitNQVUvUkp3QVdnZjdDaU9qek5xcUdPVzNHbDJheUxtUG80b1dnS0k2NGJV?=
 =?utf-8?B?bTlhMlV3MG8yak9kQ2dpUFZ0aVlESVdsTUdCYjV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c31005b
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 10:30:29.1674
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ri4iIVBGLn6N9s0DvIh4a6l+weVBaP4P42pjv6zAhP/m1+8HzfE8wC8dn8NhVIKLg+pLersQd28rFMx8B9ZopQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB8059

On 21.07.2023 15:05, Roger Pau MonnÃ© wrote:
> On Thu, Jul 20, 2023 at 12:32:33AM +0000, Volodymyr Babchuk wrote:
>> @@ -62,8 +76,8 @@ static int cf_check map_range(
>>          if ( rc < 0 )
>>          {
>>              printk(XENLOG_G_WARNING
>> -                   "Failed to identity %smap [%lx, %lx] for d%d: %d\n",
>> -                   map->map ? "" : "un", s, e, map->d->domain_id, rc);
>> +                   "Failed to %smap [%lx, %lx] for %pd: %d\n",
>> +                   map->map ? "" : "un", s, e, map->d, rc);
> 
> I would also print the gfn -> mfn values if it's no longer an identity
> map.

And also the actual range - it's not [s,e] anymore.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 10:30:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 10:30:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568712.888503 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNspp-000242-Dm; Mon, 24 Jul 2023 10:30:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568712.888503; Mon, 24 Jul 2023 10:30:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNspp-00023v-AP; Mon, 24 Jul 2023 10:30:37 +0000
Received: by outflank-mailman (input) for mailman id 568712;
 Mon, 24 Jul 2023 10:30:35 +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
 <SRS0=9g4K=DK=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qNspn-0001nO-4e
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 10:30:35 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on2062c.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::62c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1df68d91-2a0d-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 12:30:32 +0200 (CEST)
Received: from DBBPR09CA0032.eurprd09.prod.outlook.com (2603:10a6:10:d4::20)
 by PAVPR08MB9555.eurprd08.prod.outlook.com (2603:10a6:102:312::19) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.30; Mon, 24 Jul
 2023 10:30:30 +0000
Received: from DBAEUR03FT027.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:d4:cafe::62) by DBBPR09CA0032.outlook.office365.com
 (2603:10a6:10:d4::20) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32 via Frontend
 Transport; Mon, 24 Jul 2023 10:30:29 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT027.mail.protection.outlook.com (100.127.142.237) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6631.24 via Frontend Transport; Mon, 24 Jul 2023 10:30:29 +0000
Received: ("Tessian outbound d7adc65d10b4:v145");
 Mon, 24 Jul 2023 10:30:29 +0000
Received: from 6537baf27bf6.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 98D36E01-DD03-4963-8F00-59650F1643E8.1; 
 Mon, 24 Jul 2023 10:30:22 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6537baf27bf6.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Mon, 24 Jul 2023 10:30:22 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by DB4PR08MB9309.eurprd08.prod.outlook.com (2603:10a6:10:3f7::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.31; Mon, 24 Jul
 2023 10:30:21 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::4c7d:6a1:e742:3b1a]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::4c7d:6a1:e742:3b1a%4]) with mapi id 15.20.6609.032; Mon, 24 Jul 2023
 10:30:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1df68d91-2a0d-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=CyRuusSFZEPsZjA8p+nkAzliUVaXuPh/L6Zq0u/a56w=;
 b=TTF/NgEgBH25uJPBnvS8vi8aC2h+AurkvOqFsFifsX+edC086T/ZurqjmtF1WD5aHNNlVPvZ+QwcLHHGvv3OJpzN6LrE+ICqMVP+8QUsg8KnBbbLTSLUyMcxPBGHjG+Bmz61ZdQpAs1vyH3zwLZwXfY20kGwlZT6jbjnB4mf56g=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: f4aaba77f25c5e52
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=eBs4esRyHGya6Pw1ojXPVKl1QOXc1Zmamdtr58QJsWSNM7IZfQpyuad9oVWg4yNbl74j93wPWzUCS9ZvgSsd3JppLlUelj8mRN3t76N1p48Z/KYi4dmAoq1k652UiDzsNGAht2abmCLqLH2Q1k9tu5foe8spdCMEmDjTqfqrvcfoVApfJ79Ipqu6GTB0O4GJ/LCHaAhDdlYijoC/tiSeomHdCxX9Oav1uiVFLTjT6814U1PCDkkExM4JC45eU1Y//K1HhjbG9wgM312Pm5X5Hf/GVXID+LP5gbFlv7RSYs4NjStNtPgSoe2nKGrpN0NjvljtXl8tNtSoEoEFrvbh/g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=CyRuusSFZEPsZjA8p+nkAzliUVaXuPh/L6Zq0u/a56w=;
 b=C1dewd4Y6r4LaLWb11rmmaJUgJx/GsmIaxv5ZyEtkLq7RvRUTL7pTGGURhEakMzo3OmZcuJRgSThlKxxpP/METwWDFMPHqWtvSYDvlKN5aM3wVWSGPrEx7Z9RyJnLgK/aGdw/pVJrhmFGapXWjFRUDqlSX8U6kAhT4vHh7BKFYOvCf0liPf7CEoehyCtQbPnT28d7n/dITOOWsDT5y1bozA2w2Pi+DQUQu3gNRzGC1xO2dIlvavk7jsxD3JMtKgF9UV7r1J24d3wWZGNmP1W+NU2OzgI/08r+a7y/OOMqfPT/IMQdQdTDGjJq0hcxfns5YT03hbQvJjXQ/+6XE0jbA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=CyRuusSFZEPsZjA8p+nkAzliUVaXuPh/L6Zq0u/a56w=;
 b=TTF/NgEgBH25uJPBnvS8vi8aC2h+AurkvOqFsFifsX+edC086T/ZurqjmtF1WD5aHNNlVPvZ+QwcLHHGvv3OJpzN6LrE+ICqMVP+8QUsg8KnBbbLTSLUyMcxPBGHjG+Bmz61ZdQpAs1vyH3zwLZwXfY20kGwlZT6jbjnB4mf56g=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Anthony PERARD <anthony.perard@citrix.com>
CC: Jan Beulich <jbeulich@suse.com>, Rahul Singh <Rahul.Singh@arm.com>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [OSSTEST] ts-kernel-build: add kernel kconfig for the Arndale
Thread-Topic: [OSSTEST] ts-kernel-build: add kernel kconfig for the Arndale
Thread-Index: AQHZu81JNSQT8M0pukCzoS21u4bdG6/ENcMAgAA4KoCABE2HAIAAAJYA
Date: Mon, 24 Jul 2023 10:30:20 +0000
Message-ID: <D162FEBE-9C66-43E5-A562-4CDB864E91A3@arm.com>
References: <20230721121627.1229906-1-luca.fancellu@arm.com>
 <ceb7d6ad-0292-facf-6ad5-4bd265a8d34d@suse.com>
 <2CA77C15-BA9B-4D98-80A0-B1B7EDE4E48B@arm.com>
 <af1388d4-ddd8-4afe-8710-f5a780e8c333@perard>
In-Reply-To: <af1388d4-ddd8-4afe-8710-f5a780e8c333@perard>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|DB4PR08MB9309:EE_|DBAEUR03FT027:EE_|PAVPR08MB9555:EE_
X-MS-Office365-Filtering-Correlation-Id: 75f27b57-bfc9-46e1-d1cf-08db8c3100a6
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 5gczrG4w4/Oc6yt+Z3r05MKSXT1s2XBJ9z3sOtiWDasy1/9QAAnncRHp6IIJVuMozdzRAFfVxCjhlejw8sBA7Fy2hFaRt21URmPZ40u+Jt40jTPAQjAvKfYspq0yeDWX0uua7RNmWpQn+71C1i9g6EpUQ0YTXV2+2pTCwN8eF7ziC3RnXoxAKCoYmKz0llwBVbRGBkrmIoyFwojRJ3cSlMidWkjUIXOd9xnLfHTaWnFVBNhQPN3HjRaueivQcw9yUj/2opL8Df6/VRVjAwFM9/kWiJbOuAdarYh1CHKd2j2NlQ+hO+44E6IwEOi1MtnoivsyBCPjQVv4mVOEyJRnADFOrsJivXSsOt++vtf1bc3FQAO4XIUnXToqi5R4k41RuVzKMY3I7xTYVfaBqqKQQsTmugQ//wSa1Hktljg3LojsD8J5usbGDeWu+DkOwGlzKBIqWOvdLEXyPhL9nuvZdTiRe87hR8eTf9uO20UQ9n8k4j2nC0pS0Aowoes36Nn0PYsfvXde4WeVc9MtETp1sGY078xvJBY0C8e2ipDuHSpstFahwBdCZCHd3EpsVb4VlJyWksGAZ5wP/bwfg747uZpYwEqg0aJgZlPLMTicgOZEo6WnVxP00WFnrAjEqhExQkmQWC40UtuavXkbqK5+/A==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(136003)(376002)(39850400004)(366004)(451199021)(91956017)(2906002)(64756008)(76116006)(66946007)(66446008)(66556008)(66476007)(6916009)(71200400001)(33656002)(478600001)(6486002)(6512007)(86362001)(54906003)(36756003)(122000001)(186003)(2616005)(38070700005)(53546011)(6506007)(26005)(38100700002)(4326008)(5660300002)(8936002)(41300700001)(8676002)(316002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <F8B6DDB9BAB25F4493BE53398A7F1353@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR08MB9309
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT027.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	040fb921-6176-47bb-afbe-08db8c30fb8e
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	65tcLxNtSC+yMsZE8mnW38z0+7v5GdeD4ca/WPe7FTIxAil1S81X3BOFr/vBSD2cmwMxXjdldCCduSzDPUkYmB/ODLjbTZUB+6JUJmcVrVQ+10M7AwKrXa7szASiD9hy7aQtFRg9usIlkORmIPdaUwgHxPNj6evzHLgIaVaL6AcRXyu4nG/XAq6rC1tP/zI8opSptxpqDEAfgo3suAjmJzBByFPoHv0q7S0cHDt5IzW0CjifchHmlIWZ9QJeQG72S6VWBr6AqXbNQtEprMGW+M6ZkOlfk++WlFK/0cJyR8iEhQpXbDUwjCwWhBdZINzM0B1oNehnwGAFAUsvrQnIqij7IfOopLl0ZFTxwusvDmYCIrhB0Q1+2/3XKe2rfVn/cLYbpkRS48fDcvEj2TWFjo4mbUI4bDdqDUHEixsTXgWtWli9JUKiQE/Xc239cONSmTRBD6RppjjjHynEOXCVzpFgO86a0Dtghms0Md5BF0K2bmd92Qm3KjNYXNPNyIPbjnsFrH2N8OAtek3VtST2e2A/zmSmpn+4LvOd1a3Ie3LReawRJfoyi3bhmQW1glRUggMYfpEOTQ6InwHK4xnUy6EqNY3HYz5+M8fPy8uLWm1hymPXCfdvUGUfmfdYXewpZ7smMLxkGX/7UQ1QDstOat4Jzis0SV80QEXJQTTwLK4pyXHN+e6lM6KMoaUFjqBWzt6ETVUYQn3CzBz99FXPxGe9Oy5SSTh+W7LSEnvisNXSokUGnRO8JELf1ckAfUOB
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(376002)(39860400002)(396003)(82310400008)(451199021)(36840700001)(46966006)(40470700004)(36860700001)(81166007)(36756003)(40480700001)(86362001)(33656002)(82740400003)(40460700003)(356005)(54906003)(478600001)(2906002)(186003)(336012)(26005)(6506007)(6512007)(6486002)(8936002)(5660300002)(8676002)(6862004)(316002)(41300700001)(70206006)(70586007)(4326008)(53546011)(47076005)(2616005);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 10:30:29.5119
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 75f27b57-bfc9-46e1-d1cf-08db8c3100a6
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT027.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9555

DQoNCj4gT24gMjQgSnVsIDIwMjMsIGF0IDExOjI4LCBBbnRob255IFBFUkFSRCA8YW50aG9ueS5w
ZXJhcmRAY2l0cml4LmNvbT4gd3JvdGU6DQo+IA0KPiBPbiBGcmksIEp1bCAyMSwgMjAyMyBhdCAw
NDo0NTo0NFBNICswMDAwLCBMdWNhIEZhbmNlbGx1IHdyb3RlOg0KPj4+IE9uIDIxIEp1bCAyMDIz
LCBhdCAxNDoyNCwgSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPiB3cm90ZToNCj4+PiBP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dGggdGhpcyBtb2RpZmljYXRpb24uDQoNClRoYW5r
cyBBbnRob255DQoNCj4gDQo+IElmIG9zc3Rlc3QgaXMgaGFwcHkgd2l0aCB0aGUgcGF0Y2ggKHRo
YXQgaXMgbm8gcmVncmVzc2lvbiB3aXRoIGENCj4gInhlbi11bnN0YWJsZSIgZmxpZ2h0KSwgaXQg
d2lsbCBiZSBjb21taXR0ZWQuDQoNCkZpbmdlcnMgY3Jvc3NlZA0KDQpDaGVlcnMsDQpMdWNhDQoN
Cj4gDQo+IFRoYW5rcywNCj4gDQo+IC0tIA0KPiBBbnRob255IFBFUkFSRA0KDQo=


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 10:33:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 10:33:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568716.888512 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNssb-00031f-Sp; Mon, 24 Jul 2023 10:33:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568716.888512; Mon, 24 Jul 2023 10:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNssb-00031Y-Ps; Mon, 24 Jul 2023 10:33:29 +0000
Received: by outflank-mailman (input) for mailman id 568716;
 Mon, 24 Jul 2023 10:33:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNssa-00031Q-Ht
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 10:33:28 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 86724f93-2a0d-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 12:33:27 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id F0DE620661;
 Mon, 24 Jul 2023 10:33:26 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C1EAB138E8;
 Mon, 24 Jul 2023 10:33:26 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id /c6gLXZTvmRqUAAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 10:33:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 86724f93-2a0d-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690194806; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:  content-transfer-encoding:content-transfer-encoding;
	bh=tJyUi4rnxrSoqA2GwW6BZTM1LqtefYMHO98BBC1hqes=;
	b=RLrouWu+recz2dsAvQ7BhTj1G3r818p4LhUH/FRpT6xl6q0x5ognBc6toCO2D9KZ/Bw21R
	hoZC+JBjXoNrXL6hxj+YKt9+9Xs3lUtHwrlOltj8HQW0lnX+OWFw8tB/HcN7yV78YqLOmL
	PTWJU3aJZHd/NNAG+ONakeCyVjxfiJM=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 0/2] tools/xenstore: fix get_spec_node()
Date: Mon, 24 Jul 2023 12:33:22 +0200
Message-Id: <20230724103324.4207-1-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Small series to fix a bug in get_spec_node().

Patch 1 is turning several function parameters into const in order to
avoid having to cast away the const attribute in get_spec_node().

Patch 2 is the fix, which is a backport candidate.

Changes in V3:
- add get_strings() conversion to const in patch 1

Changes in V2:
- add patch 1, avoiding the need to cast const away in patch 2

Juergen Gross (2):
  tools/xenstore: add const to the return type of  canonicalize()
  tools/xenstore: fix get_spec_node()

 tools/xenstore/xenstored_control.c   | 33 ++++++++++++++--------------
 tools/xenstore/xenstored_core.c      | 31 +++++++++++++++-----------
 tools/xenstore/xenstored_core.h      |  5 +++--
 tools/xenstore/xenstored_domain.c    |  4 ++--
 tools/xenstore/xenstored_lu.c        |  2 +-
 tools/xenstore/xenstored_lu.h        |  4 ++--
 tools/xenstore/xenstored_lu_daemon.c |  2 +-
 tools/xenstore/xenstored_lu_minios.c |  2 +-
 tools/xenstore/xenstored_watch.c     | 14 +++++++-----
 9 files changed, 53 insertions(+), 44 deletions(-)

-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 10:33:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 10:33:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568717.888524 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNssh-0003Ii-5j; Mon, 24 Jul 2023 10:33:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568717.888524; Mon, 24 Jul 2023 10:33:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNssh-0003IW-16; Mon, 24 Jul 2023 10:33:35 +0000
Received: by outflank-mailman (input) for mailman id 568717;
 Mon, 24 Jul 2023 10:33:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNssf-00031Q-Sl
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 10:33:34 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 89b2cb80-2a0d-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 12:33:32 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 9934820665;
 Mon, 24 Jul 2023 10:33:32 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6A849138E8;
 Mon, 24 Jul 2023 10:33:32 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id GMJQGHxTvmR0UAAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 10:33:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 89b2cb80-2a0d-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690194812; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=QztVVey2YoDwROHqqVV26V6sbdHLNr1pk8Dham/+sKc=;
	b=cLneK8POTES+WRVwOCQkrwj+rrLBR86cUux8d7OfyKkgvypopcr8qraUjAlhjJMh0dcfLH
	ReWg6z6NFjlOnUQqxuSogp3c0QsJ1lezCwIJgY/LBdR3Cx8JwwQttTYv6QBaRgdTO0DCnk
	ZJ3IzSbzZl0+z0nH/GBmX0Duy9Qgzlk=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 1/2] tools/xenstore: add const to the return type of  canonicalize()
Date: Mon, 24 Jul 2023 12:33:23 +0200
Message-Id: <20230724103324.4207-2-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724103324.4207-1-jgross@suse.com>
References: <20230724103324.4207-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The return type of canonicalize() can be modified to const char *.
This avoids the need to cast the const away from the input parameter.

There need to be quite some other functions modified to take const
parameters in order to avoid further casts.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- new patch (Julien Grall)
V3:
- add get_strings() conversion to take const pointer (Julien Grall)
---
 tools/xenstore/xenstored_control.c   | 33 ++++++++++++++--------------
 tools/xenstore/xenstored_core.c      | 26 ++++++++++++----------
 tools/xenstore/xenstored_core.h      |  5 +++--
 tools/xenstore/xenstored_domain.c    |  4 ++--
 tools/xenstore/xenstored_lu.c        |  2 +-
 tools/xenstore/xenstored_lu.h        |  4 ++--
 tools/xenstore/xenstored_lu_daemon.c |  2 +-
 tools/xenstore/xenstored_lu_minios.c |  2 +-
 tools/xenstore/xenstored_watch.c     | 14 +++++++-----
 9 files changed, 49 insertions(+), 43 deletions(-)

diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_control.c
index 145a0e5aff..3bdf2edc34 100644
--- a/tools/xenstore/xenstored_control.c
+++ b/tools/xenstore/xenstored_control.c
@@ -34,7 +34,7 @@
 
 struct cmd_s {
 	char *cmd;
-	int (*func)(const void *, struct connection *, char **, int);
+	int (*func)(const void *, struct connection *, const char **, int);
 	char *pars;
 	/*
 	 * max_pars can be used to limit the size of the parameter vector,
@@ -47,7 +47,7 @@ struct cmd_s {
 };
 
 static int do_control_check(const void *ctx, struct connection *conn,
-			    char **vec, int num)
+			    const char **vec, int num)
 {
 	if (num)
 		return EINVAL;
@@ -59,7 +59,7 @@ static int do_control_check(const void *ctx, struct connection *conn,
 }
 
 static int do_control_log(const void *ctx, struct connection *conn,
-			  char **vec, int num)
+			  const char **vec, int num)
 {
 	int ret;
 
@@ -126,7 +126,7 @@ static int quota_show_current(const void *ctx, struct connection *conn,
 }
 
 static int quota_set(const void *ctx, struct connection *conn,
-		     char **vec, int num, struct quota *quotas)
+		     const char **vec, int num, struct quota *quotas)
 {
 	unsigned int i;
 	int val;
@@ -150,7 +150,7 @@ static int quota_set(const void *ctx, struct connection *conn,
 }
 
 static int quota_get(const void *ctx, struct connection *conn,
-		     char **vec, int num)
+		     const char **vec, int num)
 {
 	if (num != 1)
 		return EINVAL;
@@ -159,7 +159,7 @@ static int quota_get(const void *ctx, struct connection *conn,
 }
 
 static int quota_max(const void *ctx, struct connection *conn,
-		     char **vec, int num)
+		     const char **vec, int num)
 {
 	if (num > 1)
 		return EINVAL;
@@ -175,7 +175,7 @@ static int quota_max(const void *ctx, struct connection *conn,
 }
 
 static int do_control_quota(const void *ctx, struct connection *conn,
-			    char **vec, int num)
+			    const char **vec, int num)
 {
 	if (num == 0)
 		return quota_show_current(ctx, conn, hard_quotas);
@@ -190,7 +190,7 @@ static int do_control_quota(const void *ctx, struct connection *conn,
 }
 
 static int do_control_quota_s(const void *ctx, struct connection *conn,
-			      char **vec, int num)
+			      const char **vec, int num)
 {
 	if (num == 0)
 		return quota_show_current(ctx, conn, soft_quotas);
@@ -203,7 +203,7 @@ static int do_control_quota_s(const void *ctx, struct connection *conn,
 
 #ifdef __MINIOS__
 static int do_control_memreport(const void *ctx, struct connection *conn,
-				char **vec, int num)
+				const char **vec, int num)
 {
 	if (num)
 		return EINVAL;
@@ -215,7 +215,7 @@ static int do_control_memreport(const void *ctx, struct connection *conn,
 }
 #else
 static int do_control_logfile(const void *ctx, struct connection *conn,
-			      char **vec, int num)
+			      const char **vec, int num)
 {
 	if (num != 1)
 		return EINVAL;
@@ -230,7 +230,7 @@ static int do_control_logfile(const void *ctx, struct connection *conn,
 }
 
 static int do_control_memreport(const void *ctx, struct connection *conn,
-				char **vec, int num)
+				const char **vec, int num)
 {
 	FILE *fp;
 	int fd;
@@ -270,7 +270,7 @@ static int do_control_memreport(const void *ctx, struct connection *conn,
 #endif
 
 static int do_control_print(const void *ctx, struct connection *conn,
-			    char **vec, int num)
+			    const char **vec, int num)
 {
 	if (num != 1)
 		return EINVAL;
@@ -281,7 +281,8 @@ static int do_control_print(const void *ctx, struct connection *conn,
 	return 0;
 }
 
-static int do_control_help(const void *, struct connection *, char **, int);
+static int do_control_help(const void *, struct connection *, const char **,
+			   int);
 
 static struct cmd_s cmds[] = {
 	{ "check", do_control_check, "" },
@@ -322,7 +323,7 @@ static struct cmd_s cmds[] = {
 };
 
 static int do_control_help(const void *ctx, struct connection *conn,
-			   char **vec, int num)
+			   const char **vec, int num)
 {
 	int cmd;
 	char *resp;
@@ -348,7 +349,7 @@ int do_control(const void *ctx, struct connection *conn,
 	       struct buffered_data *in)
 {
 	unsigned int cmd, num, off;
-	char **vec = NULL;
+	const char **vec = NULL;
 
 	if (domain_is_unprivileged(conn))
 		return EACCES;
@@ -365,7 +366,7 @@ int do_control(const void *ctx, struct connection *conn,
 	num = xenstore_count_strings(in->buffer, in->used);
 	if (cmds[cmd].max_pars)
 		num = min(num, cmds[cmd].max_pars);
-	vec = talloc_array(ctx, char *, num);
+	vec = (const char **)talloc_array(ctx, char *, num);
 	if (!vec)
 		return ENOMEM;
 	if (get_strings(in, vec, num) < num)
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index a1d3047e48..6d27b2dd7f 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -994,7 +994,7 @@ unsigned int get_string(const struct buffered_data *data, unsigned int offset)
  * ignore any data after the final nul.
  */
 unsigned int get_strings(struct buffered_data *data,
-			 char *vec[], unsigned int num)
+			 const char *vec[], unsigned int num)
 {
 	unsigned int off, i, len;
 
@@ -1216,25 +1216,26 @@ static char *perms_to_strings(const void *ctx, const struct node_perms *perms,
 	return strings;
 }
 
-char *canonicalize(struct connection *conn, const void *ctx, const char *node)
+const char *canonicalize(struct connection *conn, const void *ctx,
+			 const char *node)
 {
 	const char *prefix;
 
 	if (!node || (node[0] == '/') || (node[0] == '@'))
-		return (char *)node;
+		return node;
 	prefix = get_implicit_path(conn);
 	if (prefix)
 		return talloc_asprintf(ctx, "%s/%s", prefix, node);
-	return (char *)node;
+	return node;
 }
 
 static struct node *get_node_canonicalized(struct connection *conn,
 					   const void *ctx,
 					   const char *name,
-					   char **canonical_name,
+					   const char **canonical_name,
 					   unsigned int perm)
 {
-	char *tmp_name;
+	const char *tmp_name;
 
 	if (!canonical_name)
 		canonical_name = &tmp_name;
@@ -1249,7 +1250,7 @@ static struct node *get_node_canonicalized(struct connection *conn,
 }
 
 static struct node *get_spec_node(struct connection *conn, const void *ctx,
-				  const char *name, char **canonical_name,
+				  const char *name, const char **canonical_name,
 				  unsigned int perm)
 {
 	if (name[0] == '@')
@@ -1538,8 +1539,8 @@ static int do_write(const void *ctx, struct connection *conn,
 {
 	unsigned int offset, datalen;
 	struct node *node;
-	char *vec[1] = { NULL }; /* gcc4 + -W + -Werror fucks code. */
-	char *name;
+	const char *vec[1] = { NULL }; /* gcc4 + -W + -Werror fucks code. */
+	const char *name;
 
 	/* Extra "strings" can be created by binary data. */
 	if (get_strings(in, vec, ARRAY_SIZE(vec)) < ARRAY_SIZE(vec))
@@ -1574,7 +1575,7 @@ static int do_mkdir(const void *ctx, struct connection *conn,
 		    struct buffered_data *in)
 {
 	struct node *node;
-	char *name;
+	const char *name;
 
 	node = get_node_canonicalized(conn, ctx, onearg(in), &name,
 				      XS_PERM_WRITE);
@@ -1703,7 +1704,7 @@ static int do_rm(const void *ctx, struct connection *conn,
 {
 	struct node *node;
 	int ret;
-	char *name;
+	const char *name;
 	char *parentname;
 
 	node = get_node_canonicalized(conn, ctx, onearg(in), &name,
@@ -1765,7 +1766,8 @@ static int do_set_perms(const void *ctx, struct connection *conn,
 			struct buffered_data *in)
 {
 	struct node_perms perms, old_perms;
-	char *name, *permstr;
+	const char *name;
+	char *permstr;
 	struct node *node;
 
 	perms.num = xenstore_count_strings(in->buffer, in->used);
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 84a611cbb5..005556de90 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -212,7 +212,7 @@ const char *onearg(struct buffered_data *in);
 
 /* Break input into vectors, return the number, fill in up to num of them. */
 unsigned int get_strings(struct buffered_data *data,
-			 char *vec[], unsigned int num);
+			 const char *vec[], unsigned int num);
 unsigned int get_string(const struct buffered_data *data, unsigned int offset);
 
 void send_reply(struct connection *conn, enum xsd_sockmsg_type type,
@@ -224,7 +224,8 @@ void send_event(struct buffered_data *req, struct connection *conn,
 void send_ack(struct connection *conn, enum xsd_sockmsg_type type);
 
 /* Canonicalize this path if possible. */
-char *canonicalize(struct connection *conn, const void *ctx, const char *node);
+const char *canonicalize(struct connection *conn, const void *ctx,
+			 const char *node);
 
 /* Get access permissions. */
 unsigned int perm_for_conn(struct connection *conn,
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index 632ddb5efc..cc67af5b98 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -1014,7 +1014,7 @@ int do_introduce(const void *ctx, struct connection *conn,
 		 struct buffered_data *in)
 {
 	struct domain *domain;
-	char *vec[3];
+	const char *vec[3];
 	unsigned int domid;
 	evtchn_port_t port;
 
@@ -1055,7 +1055,7 @@ static struct domain *find_connected_domain(unsigned int domid)
 int do_set_target(const void *ctx, struct connection *conn,
 		  struct buffered_data *in)
 {
-	char *vec[2];
+	const char *vec[2];
 	unsigned int domid, tdomid;
         struct domain *domain, *tdomain;
 	if (get_strings(in, vec, ARRAY_SIZE(vec)) < ARRAY_SIZE(vec))
diff --git a/tools/xenstore/xenstored_lu.c b/tools/xenstore/xenstored_lu.c
index b20d0d37ea..f7f76acbf9 100644
--- a/tools/xenstore/xenstored_lu.c
+++ b/tools/xenstore/xenstored_lu.c
@@ -360,7 +360,7 @@ static const char *lu_start(const void *ctx, struct connection *conn,
 	return NULL;
 }
 
-int do_control_lu(const void *ctx, struct connection *conn, char **vec,
+int do_control_lu(const void *ctx, struct connection *conn, const char **vec,
 		  int num)
 {
 	const char *ret = NULL;
diff --git a/tools/xenstore/xenstored_lu.h b/tools/xenstore/xenstored_lu.h
index d633a765a3..ac3c572ca8 100644
--- a/tools/xenstore/xenstored_lu.h
+++ b/tools/xenstore/xenstored_lu.h
@@ -50,7 +50,7 @@ void lu_read_state(void);
 /* Write the "OK" response for the live-update command */
 unsigned int lu_write_response(FILE *fp);
 
-int do_control_lu(const void *ctx, struct connection *conn, char **vec,
+int do_control_lu(const void *ctx, struct connection *conn, const char **vec,
 		  int num);
 
 /* Live update private interfaces. */
@@ -59,7 +59,7 @@ void lu_close_dump_state(struct lu_dump_state *state);
 FILE *lu_dump_open(const void *ctx);
 void lu_dump_close(FILE *fp);
 char *lu_exec(const void *ctx, int argc, char **argv);
-const char *lu_arch(const void *ctx, struct connection *conn, char **vec,
+const char *lu_arch(const void *ctx, struct connection *conn, const char **vec,
 		    int num);
 const char *lu_begin(struct connection *conn);
 void lu_destroy_arch(void *data);
diff --git a/tools/xenstore/xenstored_lu_daemon.c b/tools/xenstore/xenstored_lu_daemon.c
index 310fb8c2e6..8c7522b0e1 100644
--- a/tools/xenstore/xenstored_lu_daemon.c
+++ b/tools/xenstore/xenstored_lu_daemon.c
@@ -118,7 +118,7 @@ static const char *lu_binary(const void *ctx, struct connection *conn,
 	return NULL;
 }
 
-const char *lu_arch(const void *ctx, struct connection *conn, char **vec,
+const char *lu_arch(const void *ctx, struct connection *conn, const char **vec,
 		    int num)
 {
 	if (num == 2 && !strcmp(vec[0], "-f"))
diff --git a/tools/xenstore/xenstored_lu_minios.c b/tools/xenstore/xenstored_lu_minios.c
index 88fb9e0f38..ae0483575e 100644
--- a/tools/xenstore/xenstored_lu_minios.c
+++ b/tools/xenstore/xenstored_lu_minios.c
@@ -104,7 +104,7 @@ static const char *lu_binary_save(const void *ctx, struct connection *conn,
 	return NULL;
 }
 
-const char *lu_arch(const void *ctx, struct connection *conn, char **vec,
+const char *lu_arch(const void *ctx, struct connection *conn, const char **vec,
 		    int num)
 {
 	if (num == 2 && !strcmp(vec[0], "-b"))
diff --git a/tools/xenstore/xenstored_watch.c b/tools/xenstore/xenstored_watch.c
index 4195c59e17..fefbf56ab2 100644
--- a/tools/xenstore/xenstored_watch.c
+++ b/tools/xenstore/xenstored_watch.c
@@ -161,7 +161,7 @@ static int destroy_watch(void *_watch)
 }
 
 static int check_watch_path(struct connection *conn, const void *ctx,
-			    char **path, bool *relative)
+			    const char **path, bool *relative)
 {
 	/* Check if valid event. */
 	if (strstarts(*path, "@")) {
@@ -184,8 +184,9 @@ static int check_watch_path(struct connection *conn, const void *ctx,
 	return errno;
 }
 
-static struct watch *add_watch(struct connection *conn, char *path, char *token,
-			       bool relative, bool no_quota_check)
+static struct watch *add_watch(struct connection *conn, const char *path,
+			       const char *token, bool relative,
+			       bool no_quota_check)
 {
 	struct watch *watch;
 
@@ -217,7 +218,7 @@ static struct watch *add_watch(struct connection *conn, char *path, char *token,
 int do_watch(const void *ctx, struct connection *conn, struct buffered_data *in)
 {
 	struct watch *watch;
-	char *vec[2];
+	const char *vec[2];
 	bool relative;
 
 	if (get_strings(in, vec, ARRAY_SIZE(vec)) != ARRAY_SIZE(vec))
@@ -258,7 +259,8 @@ int do_unwatch(const void *ctx, struct connection *conn,
 	       struct buffered_data *in)
 {
 	struct watch *watch;
-	char *node, *vec[2];
+	const char *node;
+	const char *vec[2];
 
 	if (get_strings(in, vec, ARRAY_SIZE(vec)) != ARRAY_SIZE(vec))
 		return EINVAL;
@@ -336,7 +338,7 @@ void read_state_watch(const void *ctx, const void *state)
 {
 	const struct xs_state_watch *sw = state;
 	struct connection *conn;
-	char *path, *token;
+	const char *path, *token;
 	bool relative;
 
 	conn = get_connection_by_id(sw->conn_id);
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 10:33:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 10:33:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568718.888532 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNssn-0003dr-GM; Mon, 24 Jul 2023 10:33:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568718.888532; Mon, 24 Jul 2023 10:33:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNssn-0003dk-DW; Mon, 24 Jul 2023 10:33:41 +0000
Received: by outflank-mailman (input) for mailman id 568718;
 Mon, 24 Jul 2023 10:33:40 +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 <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNssm-0003cS-9H
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 10:33:40 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8cf6a66b-2a0d-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 12:33:38 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 399B520661;
 Mon, 24 Jul 2023 10:33:38 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0641F138E8;
 Mon, 24 Jul 2023 10:33:38 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id w60gAIJTvmSIUAAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 10:33:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8cf6a66b-2a0d-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690194818; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=joi8pFR+Pd5xgecdMs2fa+83mlaOI82o45Pbhsckn/E=;
	b=K8MEtNjc3I4B4iavlfe0JoeBEbufnan4Mw7rSfaAkqgYrJy8rtwHdNXzgmY/ZC5Rg50HjH
	8ccOMb+DPhv36nxgkpxQFAIOrnX4BoXmH05EpjVg18Sd6uX5X7XN2SjOoIwzjhDiUe6MB1
	Ll/NRUQr6zqt2z81eegjmhrRQTypUhQ=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [PATCH v3 2/2] tools/xenstore: fix get_spec_node()
Date: Mon, 24 Jul 2023 12:33:24 +0200
Message-Id: <20230724103324.4207-3-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724103324.4207-1-jgross@suse.com>
References: <20230724103324.4207-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In case get_spec_node() is being called for a special node starting
with '@' it won't set *canonical_name. This can result in a crash of
xenstored due to dereferencing the uninitialized name in
fire_watches().

This is no security issue as it requires either a privileged caller or
ownership of the special node in question by an unprivileged caller
(which is questionable, as this would make the owner privileged in some
way).

Fixes: d6bb63924fc2 ("tools/xenstore: introduce dummy nodes for special watch paths")
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
---
V2:
- avoid casting const away (Julien Grall)
---
 tools/xenstore/xenstored_core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 6d27b2dd7f..9f1328a31f 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1253,8 +1253,11 @@ static struct node *get_spec_node(struct connection *conn, const void *ctx,
 				  const char *name, const char **canonical_name,
 				  unsigned int perm)
 {
-	if (name[0] == '@')
+	if (name[0] == '@') {
+		if (canonical_name)
+			*canonical_name = name;
 		return get_node(conn, ctx, name, perm);
+	}
 
 	return get_node_canonicalized(conn, ctx, name, canonical_name, perm);
 }
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 10:43:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 10:43:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568725.888543 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNt2J-0005pq-Dn; Mon, 24 Jul 2023 10:43:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568725.888543; Mon, 24 Jul 2023 10:43:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNt2J-0005pj-Af; Mon, 24 Jul 2023 10:43:31 +0000
Received: by outflank-mailman (input) for mailman id 568725;
 Mon, 24 Jul 2023 10:43:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNt2H-0005pd-As
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 10:43:29 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20606.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::606])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ec52bbb5-2a0e-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 12:43:28 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VI1PR04MB6909.eurprd04.prod.outlook.com (2603:10a6:803:13d::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 10:43:25 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 10:43:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ec52bbb5-2a0e-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=L7RkoT7QsftZogJL7Wgo5hX6vObQT5J9zyIyLjin9HBNHgs+zDzp8HK4B11F9boE9bsVaPtwjWVFHpoIiBcxBsdNpwYO1a7YtIZEv5pSEy1oPI/18OEzcBiMsP0Of2yLytMBQ0hRb33rPetqjYw3hPeCOFdeKkcUH696lbQZGPgS12RY4ZzvDO83EWZtzwdUTe8TJU8hyAAOF67qPvJb6+UPTIMXjIe3nx7CtpzHpfjN1WiqIuFXs2a7MSm08568Zg9cIVWrkOEAer5tK3uAI8eUWhlGbtol4VFDeQpxEdbh4UrffpvQfl3v4jG9WvIILa00SddQqQhUTaHtkyk+GQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=C6wO8FBEHzc5PzmCi6rSpI2LcKx70ml1aeaqOcxC6ik=;
 b=AIdSeRUiSr+yRxCn3gkT+buefQmRdybCfc+PKi95MsQWAiB5yShxF2EGSxgU7DSJqjGXbVPWQ/2yAe1kPxRHMCUoRIT8q9X2oKTOifmNrXaO23JVifBzRRlxis9Pepv8pCX70VvKz5TQi+7DpgXDxnR0FkdD/un9sPkmlOxa+QaIMDOXiQqH0cunBN2T4i8+BJWyqwKzL1Ppzw9S2yjWvicbfoJcu/jM1eCF31adkA8OBweLg+i63rX7NQOPV+EwLGGA44mEvxxZiDwWXtQGeMd7bgmD/+iJfeAfl/oZUZZpn3NUAsd44houdcTnhiYk6HU5noaSaTUuH20gm3KclA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=C6wO8FBEHzc5PzmCi6rSpI2LcKx70ml1aeaqOcxC6ik=;
 b=ITxnBZ2B9nkFFLR9OnphPlrR9zjj8+7KkZdjunONRcljTXEvtZbzf7OdknX/As3gNqePT6FzeuJWnUUTUVo5IF2Mo8Ox2DLydYcOKDhip9mbFDek6ihqoQqgPmi1pHTgez2bUcd7dvNRVKi01nSECf5qdKruJUN+vQdP3W0vnNf7Jr2aBPtgoSMW6IHw/plD6Y4VNud8TwhCkH7lQQp6ofeMMrXI/P5g7c4QB0uVmMvqP0Syoba306fut5NYmXuZQR1Dvb/SGdIHLZbKrYvCXRm3HZHgTRSmcieTSvpnj3gCbUtKzpqwdV0gm26NN9cEyNXqxcvfv4eST/gZvZ2aPA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <f2b8945e-cedf-3b38-042c-7b1288cfcde7@suse.com>
Date: Mon, 24 Jul 2023 12:43:26 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 08/13] vpci/header: program p2m with guest BAR view
Content-Language: en-US
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-9-volodymyr_babchuk@epam.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230720003205.1828537-9-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0157.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a2::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VI1PR04MB6909:EE_
X-MS-Office365-Filtering-Correlation-Id: dc4283c4-b581-4f61-62f4-08db8c32cf32
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	4A974rIDwJp/Ej1bnXkdbbFCHV+Q85e7DiA/Sjxzk7i+nz7L70Z3+QYxllbJZ1CLw9189SWgu3Sm66tfpQdZ5vYfTowk6M83ydsaABiT89+akprjtwhgZBOPX6dtFeD9EDtJo5CxQmyKpQjkCW+vhjWNA/zNcn8SA+2co4aupTFX2zGq0ZiHKkGmifN2FSoSGVqODXFQUyRmj4P4Jx6rmSkhYFZnKWWnA0HM4GBFV7lX0uMuQ64A0WKSYyiUJ2+BpHn3x6aNcJ5tENkyVjrf4GToGxyxXsFYKrDpkH3SdaM9KwPfYmN1amgbA4jA1lwJGk2IaAKqWudSxwfEAqYCACIQ3MNyOWZWzwigOremXKHjA9vodG6//JLjRdMvNMEP71/PRJt8AVNvbfmJOCWuJxMfuGiUzQUTJreajCwPlAoqcchZrQA7bGnRd5j2YlP2AVqo134r4rAJNStxUKcLxI1yozOB8/AlDT/CMHtMrys7uNZOAShyLEmzE+nnVhAu80paxJQ7/Dyd9GJt9cNrkjcourOZRskfFlZOQ7PadQQq+ytTtAQiY1wruXGMc4Z1nYV7/b+T1qjS/CoP83PvKD5umAef0735ubAd2nj4XrWr96a1+52/GTqMB52JPGvI0qRfs6uNnBsLwy4I711N1Q==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39850400004)(346002)(136003)(366004)(396003)(376002)(451199021)(38100700002)(66556008)(66899021)(36756003)(53546011)(2616005)(8676002)(8936002)(5660300002)(54906003)(478600001)(66476007)(6916009)(4326008)(316002)(66946007)(41300700001)(186003)(26005)(6506007)(6486002)(6512007)(2906002)(31686004)(31696002)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RUp6emg3a2xuekllUHdOZG81c1FVYmdBVm5Mb252VWlWMDZWdURCWVlLMnJQ?=
 =?utf-8?B?MGJwV1NYWjU3NjlFZVl3Z2xjUmpJTEF0dFY3Q3BQT2l1UW5jQ2hPTWU5OUJJ?=
 =?utf-8?B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bGExbXdLQUVLN2Vt?=
 =?utf-8?B?THJaNVExNkcyZWJMNno2YnpKSURkV013dzRadzFhc1RjL0lGSHl1bHBiaDFV?=
 =?utf-8?B?Y1BicWRMa01VcDBZS0k2cDdUM2hTcVY2RnVrMlU0SzNYK2JuU0JxdStOeklT?=
 =?utf-8?B?R1FlL0hnZnBuYTU0aDMwQmd2dC9pWTJFdEFUbTFidjlRandRV2x5V2drZzhw?=
 =?utf-8?B?Mk9hak9ocjQ5OE5PdmJZS0dINHFoYzJZc3gwMThMSndxdE91NG9PYXpCMFk0?=
 =?utf-8?Q?R+PiLAaKrojinOTQVa1xfFhWk?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: dc4283c4-b581-4f61-62f4-08db8c32cf32
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 10:43:25.6683
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: OcPvL9Sc/xAoCdxA+twIZnuHi3VyMTCWOAiTmrHbUVjiu38uhtfIRdvWEia/C5R0m6QzUVf2xFC7ta7cNfXRDg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6909

On 20.07.2023 02:32, Volodymyr Babchuk wrote:
> @@ -52,8 +66,8 @@ static int cf_check map_range(
>           * - {un}map_mmio_regions doesn't support preemption.
>           */
>  
> -        rc = map->map ? map_mmio_regions(map->d, _gfn(s), size, _mfn(s))
> -                      : unmap_mmio_regions(map->d, _gfn(s), size, _mfn(s));
> +        rc = map->map ? map_mmio_regions(map->d, start_gfn, size, _mfn(s))
> +                      : unmap_mmio_regions(map->d, start_gfn, size, _mfn(s));

Aiui this is the first direct exposure of these functions to DomU-s;
so far all calls were Xen-internal or from a domctl. There are a
couple of Arm TODOs listed in the comment ahead, but I'm not sure
that's all what is lacking here, and it's unclear whether this can
sensibly be left as a follow-on activity (at the very least known
open issues need mentioning as TODOs).

For example the x86 function truncates an unsigned long local
variable to (signed) int in its main return statement. This may for
the moment still be only a theoretical issue, but will need dealing
with sooner or later, I think.

Furthermore this yet again allows DomU-s to fiddle with their p2m.
To a degree this is unavoidable, I suppose. But some thought may
need putting into this anyway. Aiui on real hardware if a BAR is
placed over RAM, behavior is simply undefined. Once the BAR is
moved away though, behavior will become defined again: The RAM will
"reappear" in case the earlier undefined-ness made it disappear. I
don't know how the Arm variants of the functions behave, but on x86
the RAM pages will disappear from the guest's p2m upon putting a
BAR there, but they won't reappear upon unmapping of the BAR.

Luckily at least preemption looks to be handled in a satisfactory
manner already.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:03:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:03:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568731.888573 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtLD-0000cz-Fr; Mon, 24 Jul 2023 11:03:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568731.888573; Mon, 24 Jul 2023 11:03:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtLD-0000cm-Bf; Mon, 24 Jul 2023 11:03:03 +0000
Received: by outflank-mailman (input) for mailman id 568731;
 Mon, 24 Jul 2023 11:03:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtLC-0000KR-Dn
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:03:02 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a7f7b8d4-2a11-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:03:01 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 7E64F20695;
 Mon, 24 Jul 2023 11:03:01 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 47ED013476;
 Mon, 24 Jul 2023 11:03:01 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id shAlEGVavmRCYQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:03:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a7f7b8d4-2a11-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196581; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=+f/2hssl9+9pqd2iopuWIXDOp4+T2afqdOEfLUF2eXs=;
	b=aZejtC3pt47Q/KokoffOLlIiVzv9E9jbRDtmAQpCNjbn1+pHDrGUjVKSZVSOpTv8CUXkf1
	TsFDcBIhZ/bkaIyBM44hOASLTSdqWSLiw9BN+PKw6+2sa7MN7gaC3+ojczYCqBKjc4t7/L
	t/nFy8Q7mYpX2abMiB6Es6YImsmN+YQ=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [PATCH v3 02/25] tools/xenstore: replace key in struct node with data base name
Date: Mon, 24 Jul 2023 13:02:24 +0200
Message-Id: <20230724110247.10520-3-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Instead of storing the TDB key in struct node, only store the name of
the node used to access it in the data base.

Associated with that change replace the key parameter of access_node()
with the equivalent db_name.

This is in preparation to replace TDB with a more simple data storage.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 tools/xenstore/xenstored_core.c        | 19 +++++++++++++------
 tools/xenstore/xenstored_core.h        |  4 ++--
 tools/xenstore/xenstored_transaction.c | 10 +++++-----
 tools/xenstore/xenstored_transaction.h |  2 +-
 4 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index b7fdf16718..ba4798dd6e 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -821,18 +821,20 @@ int write_node_raw(struct connection *conn, TDB_DATA *key, struct node *node,
 }
 
 /*
- * Write the node. If the node is written, caller can find the key used in
- * node->key. This can later be used if the change needs to be reverted.
+ * Write the node. If the node is written, caller can find the DB name used in
+ * node->db_name. This can later be used if the change needs to be reverted.
  */
 static int write_node(struct connection *conn, struct node *node,
 		      enum write_node_mode mode, bool no_quota_check)
 {
 	int ret;
+	TDB_DATA key;
 
-	if (access_node(conn, node, NODE_ACCESS_WRITE, &node->key))
+	if (access_node(conn, node, NODE_ACCESS_WRITE, &node->db_name))
 		return errno;
 
-	ret = write_node_raw(conn, &node->key, node, mode, no_quota_check);
+	set_tdb_key(node->db_name, &key);
+	ret = write_node_raw(conn, &key, node, mode, no_quota_check);
 	if (ret && conn && conn->transaction) {
 		/*
 		 * Reverting access_node() is hard, so just fail the
@@ -1450,10 +1452,13 @@ nomem:
 
 static void destroy_node_rm(struct connection *conn, struct node *node)
 {
+	TDB_DATA key;
+
 	if (streq(node->name, "/"))
 		corrupt(NULL, "Destroying root node!");
 
-	do_tdb_delete(conn, &node->key, &node->acc);
+	set_tdb_key(node->db_name, &key);
+	do_tdb_delete(conn, &key, &node->acc);
 }
 
 static int destroy_node(struct connection *conn, struct node *node)
@@ -1643,10 +1648,11 @@ static int delnode_sub(const void *ctx, struct connection *conn,
 	const char *root = arg;
 	bool watch_exact;
 	int ret;
+	const char *db_name;
 	TDB_DATA key;
 
 	/* Any error here will probably be repeated for all following calls. */
-	ret = access_node(conn, node, NODE_ACCESS_DELETE, &key);
+	ret = access_node(conn, node, NODE_ACCESS_DELETE, &db_name);
 	if (ret > 0)
 		return WALK_TREE_SUCCESS_STOP;
 
@@ -1654,6 +1660,7 @@ static int delnode_sub(const void *ctx, struct connection *conn,
 		return WALK_TREE_ERROR_STOP;
 
 	/* In case of error stop the walk. */
+	set_tdb_key(db_name, &key);
 	if (!ret && do_tdb_delete(conn, &key, &node->acc))
 		return WALK_TREE_ERROR_STOP;
 
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 19a81adc49..ec7a56a869 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -181,8 +181,8 @@ struct node_account_data {
 
 struct node {
 	const char *name;
-	/* Key used to update TDB */
-	TDB_DATA key;
+	/* Name used to access data base. */
+	const char *db_name;
 
 	/* Parent (optional) */
 	struct node *parent;
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index baad9e472d..020b70d954 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -227,7 +227,7 @@ void transaction_prepend(struct connection *conn, const char *name,
  * to be accessed in the data base.
  */
 int access_node(struct connection *conn, struct node *node,
-		enum node_access_type type, TDB_DATA *key)
+		enum node_access_type type, const char **db_name)
 {
 	struct accessed_node *i = NULL;
 	struct transaction *trans;
@@ -243,8 +243,8 @@ int access_node(struct connection *conn, struct node *node,
 
 	if (!conn || !conn->transaction) {
 		/* They're changing the global database. */
-		if (key)
-			set_tdb_key(node->name, key);
+		if (db_name)
+			*db_name = node->name;
 		return 0;
 	}
 
@@ -308,8 +308,8 @@ int access_node(struct connection *conn, struct node *node,
 		/* Nothing to delete. */
 		return -1;
 
-	if (key) {
-		set_tdb_key(i->trans_name, key);
+	if (db_name) {
+		*db_name = i->trans_name;
 		if (type == NODE_ACCESS_WRITE)
 			i->ta_node = true;
 		if (type == NODE_ACCESS_DELETE)
diff --git a/tools/xenstore/xenstored_transaction.h b/tools/xenstore/xenstored_transaction.h
index 883145163f..f6a2e2f7f5 100644
--- a/tools/xenstore/xenstored_transaction.h
+++ b/tools/xenstore/xenstored_transaction.h
@@ -41,7 +41,7 @@ void ta_node_created(struct transaction *trans);
 
 /* This node was accessed. */
 int __must_check access_node(struct connection *conn, struct node *node,
-                             enum node_access_type type, TDB_DATA *key);
+                             enum node_access_type type, const char **db_name);
 
 /* Queue watches for a modified node. */
 void queue_watches(struct connection *conn, const char *name, bool watch_exact);
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:03:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:03:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568729.888553 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtL4-0008WP-Py; Mon, 24 Jul 2023 11:02:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568729.888553; Mon, 24 Jul 2023 11:02:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtL4-0008WI-Mv; Mon, 24 Jul 2023 11:02:54 +0000
Received: by outflank-mailman (input) for mailman id 568729;
 Mon, 24 Jul 2023 11:02:52 +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 <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtL2-0008WC-SC
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:02:52 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a159d94d-2a11-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 13:02:50 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 3F37121DA7;
 Mon, 24 Jul 2023 11:02:50 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1024613476;
 Mon, 24 Jul 2023 11:02:50 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 7AeMAlpavmQeYQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:02:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a159d94d-2a11-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196570; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:  content-transfer-encoding:content-transfer-encoding;
	bh=b9V8o+B4aeJYQ21EL9z8akw9Yu04m1vUAdm9BqqxkCo=;
	b=KrI+X1BosWkp+ferVgcLgilAM2QTMlvOtmCgLc/NSjlaSSOzo8oLVWedxMO97q9YrSGb9y
	qe5cpV6oA2w72RYGQvQZ70QVjqZmrK7eX0ORTixT46KyZprWr9s1qRSuQA5AUtr6DMXvhF
	uA63H9rLat/IwPdXnCTjDh6IRH+jHD8=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 00/25] tools/xenstore: drop TDB
Date: Mon, 24 Jul 2023 13:02:22 +0200
Message-Id: <20230724110247.10520-1-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Using TDB for storing the Xenstore nodes is adding more complexity
instead of removing it. With keeping the data in memory only, the main
reason for using TDB has disappeared.

This series is replacing TDB with a hashlist referencing directly
individually allocated Xenstore nodes.

This in turn allows to use references of the stored nodes instead of
copying them in case only read access is needed. Some simple tests
using the test-xenstore utility have shown no single test being slower
with this series applied, but some tests experienced up to 10% better
performance.

Note that this series is based on top of [1].

Changes in V3:
- addressed comments
- add patches 14+15
- replace patch 18 of v2 with patches 20-25

Changes in V2:
- addressed comments
- split former patch 9 into 2 patches
- added patches 13-18

[1]: https://lists.xen.org/archives/html/xen-devel/2023-07/threads.html#01625

Juergen Gross (25):
  tools/xenstore: explicitly specify create or modify for tdb_store()
  tools/xenstore: replace key in struct node with data base name
  tools/xenstore: let transaction_prepend() return the name for access
  tools/xenstore: rename do_tdb_delete() and change parameter type
  tools/xenstore: rename do_tdb_write() and change parameter type
  tools/xenstore: switch get_acc_data() to use name instead of key
  tools/xenstore: add wrapper for tdb_fetch()
  tools/xenstore: make hashtable key and value parameters const
  tools/xenstore: let hashtable_add() fail in case of existing entry
  tools/xenstore: add hashtable_replace() function
  tools/xenstore: drop use of tdb
  tools/xenstore: remove tdb code
  tools/xenstore: let db_delete() return void
  tools/xenstore: change talloc_free() to take a const pointer
  tools/xenstore: make data parameter of db_write() const
  tools/xenstore: move copying of node data out of db_fetch()
  tools/xenstore: rework struct xs_tdb_record_hdr
  tools/xenstore: don't use struct node_perms in struct node
  tools/xenstore: use struct node_hdr in struct node
  tools/xenstore: alloc new memory in domain_adjust_node_perms()
  tools/xenstore: introduce read_node_nocopy()
  tools/xenstore: merge get_spec_node() into get_node_canonicalized()
  tools/xenstore: merge is_valid_nodename() into canonicalize()
  tools/xenstore: rework get_node()
  tools/xenstore: introduce get_node_const()

 tools/xenstore/Makefile.common         |    2 +-
 tools/xenstore/hashtable.c             |   62 +-
 tools/xenstore/hashtable.h             |   20 +-
 tools/xenstore/talloc.c                |    8 +-
 tools/xenstore/talloc.h                |    4 +-
 tools/xenstore/tdb.c                   | 1748 ------------------------
 tools/xenstore/tdb.h                   |  132 --
 tools/xenstore/utils.h                 |    9 -
 tools/xenstore/xenstored_core.c        |  704 +++++-----
 tools/xenstore/xenstored_core.h        |   86 +-
 tools/xenstore/xenstored_domain.c      |   33 +-
 tools/xenstore/xenstored_transaction.c |  110 +-
 tools/xenstore/xenstored_transaction.h |    5 +-
 tools/xenstore/xenstored_watch.c       |   42 +-
 tools/xenstore/xenstored_watch.h       |    3 +-
 15 files changed, 591 insertions(+), 2377 deletions(-)
 delete mode 100644 tools/xenstore/tdb.c
 delete mode 100644 tools/xenstore/tdb.h

-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:03:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:03:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568730.888563 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtL9-0000LB-1k; Mon, 24 Jul 2023 11:02:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568730.888563; Mon, 24 Jul 2023 11:02:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtL8-0000L4-VB; Mon, 24 Jul 2023 11:02:58 +0000
Received: by outflank-mailman (input) for mailman id 568730;
 Mon, 24 Jul 2023 11:02:58 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtL8-0000KR-Ex
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:02:58 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a49787cc-2a11-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:02:56 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id D2E6B20695;
 Mon, 24 Jul 2023 11:02:55 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A1E9D13476;
 Mon, 24 Jul 2023 11:02:55 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id KKYWJl9avmQ1YQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:02:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a49787cc-2a11-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196575; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=cT5wbOHPovpy2wmMRthEc2mPjIWIHsQuAYvw6oSHDTA=;
	b=tZn4pcGGTi0KztJ64BTwtc6PiFzGkIzQoGq7EfZkZQHXj8PoDgd8VVlulmaaYzMYrjGnvq
	6O2n8ht8qDcX+wjuiIgjbLGMnyAlhmHE7sQi6LtgweLFV9Dael0ZTbkcAC3B2MXcpkoEH5
	pLIIn7U62eSEqyhG4opnl/bYf4cdiw0=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 01/25] tools/xenstore: explicitly specify create or modify for tdb_store()
Date: Mon, 24 Jul 2023 13:02:23 +0200
Message-Id: <20230724110247.10520-2-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Instead of using TDB_REPLACE for either creating or modifying a TDB
entry, use either TDB_INSERT or TDB_MODIFY when calling tdb_store().

At higher function levels use the abstract mode values NODE_CREATE
and NODE_MODIFY.

This is for preparing to get rid of TDB, even if it is beneficial
while using TDB, too.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- use an enum for the new "flag" parameter of do_tdb_write()
  (Julien Grall)
- add comment to read_state_node() (Julien Grall)
V3:
- use enum in finalize_transaction() and reduce the scope of it
  (Julien Grall)
---
 tools/xenstore/xenstored_core.c        | 32 +++++++++++++++-----------
 tools/xenstore/xenstored_core.h        | 10 ++++++--
 tools/xenstore/xenstored_domain.c      |  2 +-
 tools/xenstore/xenstored_transaction.c |  9 ++++++--
 4 files changed, 35 insertions(+), 18 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 9f1328a31f..b7fdf16718 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -601,7 +601,8 @@ static unsigned int get_acc_domid(struct connection *conn, TDB_DATA *key,
 }
 
 int do_tdb_write(struct connection *conn, TDB_DATA *key, TDB_DATA *data,
-		 struct node_account_data *acc, bool no_quota_check)
+		 struct node_account_data *acc, enum write_node_mode mode,
+		 bool no_quota_check)
 {
 	struct xs_tdb_record_hdr *hdr = (void *)data->dptr;
 	struct node_account_data old_acc = {};
@@ -635,7 +636,8 @@ int do_tdb_write(struct connection *conn, TDB_DATA *key, TDB_DATA *data,
 	}
 
 	/* TDB should set errno, but doesn't even set ecode AFAICT. */
-	if (tdb_store(tdb_ctx, *key, *data, TDB_REPLACE) != 0) {
+	if (tdb_store(tdb_ctx, *key, *data,
+		      (mode == NODE_CREATE) ? TDB_INSERT : TDB_MODIFY) != 0) {
 		domain_memory_add_nochk(conn, new_domid,
 					-data->dsize - key->dsize);
 		/* Error path, so no quota check. */
@@ -774,7 +776,7 @@ static bool read_node_can_propagate_errno(void)
 }
 
 int write_node_raw(struct connection *conn, TDB_DATA *key, struct node *node,
-		   bool no_quota_check)
+		   enum write_node_mode mode, bool no_quota_check)
 {
 	TDB_DATA data;
 	void *p;
@@ -812,7 +814,7 @@ int write_node_raw(struct connection *conn, TDB_DATA *key, struct node *node,
 	p += node->datalen;
 	memcpy(p, node->children, node->childlen);
 
-	if (do_tdb_write(conn, key, &data, &node->acc, no_quota_check))
+	if (do_tdb_write(conn, key, &data, &node->acc, mode, no_quota_check))
 		return EIO;
 
 	return 0;
@@ -823,14 +825,14 @@ int write_node_raw(struct connection *conn, TDB_DATA *key, struct node *node,
  * node->key. This can later be used if the change needs to be reverted.
  */
 static int write_node(struct connection *conn, struct node *node,
-		      bool no_quota_check)
+		      enum write_node_mode mode, bool no_quota_check)
 {
 	int ret;
 
 	if (access_node(conn, node, NODE_ACCESS_WRITE, &node->key))
 		return errno;
 
-	ret = write_node_raw(conn, &node->key, node, no_quota_check);
+	ret = write_node_raw(conn, &node->key, node, mode, no_quota_check);
 	if (ret && conn && conn->transaction) {
 		/*
 		 * Reverting access_node() is hard, so just fail the
@@ -1500,7 +1502,8 @@ static struct node *create_node(struct connection *conn, const void *ctx,
 			goto err;
 		}
 
-		ret = write_node(conn, i, false);
+		ret = write_node(conn, i, i->parent ? NODE_CREATE : NODE_MODIFY,
+				 false);
 		if (ret)
 			goto err;
 
@@ -1564,7 +1567,7 @@ static int do_write(const void *ctx, struct connection *conn,
 	} else {
 		node->data = in->buffer + offset;
 		node->datalen = datalen;
-		if (write_node(conn, node, false))
+		if (write_node(conn, node, NODE_MODIFY, false))
 			return errno;
 	}
 
@@ -1614,7 +1617,7 @@ static int remove_child_entry(struct connection *conn, struct node *node,
 	memdel(node->children, offset, childlen + 1, node->childlen);
 	node->childlen -= childlen + 1;
 
-	return write_node(conn, node, true);
+	return write_node(conn, node, NODE_MODIFY, true);
 }
 
 static int delete_child(struct connection *conn,
@@ -1812,7 +1815,7 @@ static int do_set_perms(const void *ctx, struct connection *conn,
 	if (domain_nbentry_inc(conn, get_node_owner(node)))
 		return ENOMEM;
 
-	if (write_node(conn, node, false))
+	if (write_node(conn, node, NODE_MODIFY, false))
 		return errno;
 
 	fire_watches(conn, ctx, name, node, false, &old_perms);
@@ -2326,7 +2329,7 @@ static void manual_node(const char *name, const char *child)
 	if (child)
 		node->childlen = strlen(child) + 1;
 
-	if (write_node(NULL, node, false))
+	if (write_node(NULL, node, NODE_CREATE, false))
 		barf_perror("Could not create initial node %s", name);
 	talloc_free(node);
 }
@@ -3474,12 +3477,15 @@ void read_state_node(const void *ctx, const void *state)
 			barf("allocation error restoring node");
 
 		set_tdb_key(parentname, &key);
-		if (write_node_raw(NULL, &key, parent, true))
+		if (write_node_raw(NULL, &key, parent, NODE_MODIFY, true))
 			barf("write parent error restoring node");
 	}
 
 	set_tdb_key(name, &key);
-	if (write_node_raw(NULL, &key, node, true))
+
+	/* The "/" node is already existing, so it can only be modified here. */
+	if (write_node_raw(NULL, &key, node,
+			   strcmp(name, "/") ? NODE_CREATE : NODE_MODIFY, true))
 		barf("write node error restoring node");
 
 	if (domain_nbentry_inc(&conn, get_node_owner(node)))
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 005556de90..19a81adc49 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -238,8 +238,13 @@ static inline unsigned int get_node_owner(const struct node *node)
 }
 
 /* Write a node to the tdb data base. */
+enum write_node_mode {
+	NODE_CREATE,
+	NODE_MODIFY
+};
+
 int write_node_raw(struct connection *conn, TDB_DATA *key, struct node *node,
-		   bool no_quota_check);
+		   enum write_node_mode mode, bool no_quota_check);
 
 /* Get a node from the tdb data base. */
 struct node *read_node(struct connection *conn, const void *ctx,
@@ -359,7 +364,8 @@ int remember_string(struct hashtable *hash, const char *str);
 
 void set_tdb_key(const char *name, TDB_DATA *key);
 int do_tdb_write(struct connection *conn, TDB_DATA *key, TDB_DATA *data,
-		 struct node_account_data *acc, bool no_quota_check);
+		 struct node_account_data *acc, enum write_node_mode mode,
+		 bool no_quota_check);
 int do_tdb_delete(struct connection *conn, TDB_DATA *key,
 		  struct node_account_data *acc);
 
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index cc67af5b98..569c3bfbd0 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -523,7 +523,7 @@ static int domain_tree_remove_sub(const void *ctx, struct connection *conn,
 		node->perms.p[0].id = priv_domid;
 		node->acc.memory = 0;
 		domain_nbentry_inc(NULL, priv_domid);
-		if (write_node_raw(NULL, &key, node, true)) {
+		if (write_node_raw(NULL, &key, node, NODE_MODIFY, true)) {
 			/* That's unfortunate. We only can try to continue. */
 			syslog(LOG_ERR,
 			       "error when moving orphaned node %s to dom0\n",
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 334f1609f1..baad9e472d 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -290,7 +290,8 @@ int access_node(struct connection *conn, struct node *node,
 			i->check_gen = true;
 			if (node->generation != NO_GENERATION) {
 				set_tdb_key(i->trans_name, &local_key);
-				ret = write_node_raw(conn, &local_key, node, true);
+				ret = write_node_raw(conn, &local_key, node,
+						     NODE_CREATE, true);
 				if (ret)
 					goto err;
 				i->ta_node = true;
@@ -401,12 +402,16 @@ static int finalize_transaction(struct connection *conn,
 			set_tdb_key(i->trans_name, &ta_key);
 			data = tdb_fetch(tdb_ctx, ta_key);
 			if (data.dptr) {
+				enum write_node_mode mode;
+
 				trace_tdb("read %s size %zu\n", ta_key.dptr,
 					  ta_key.dsize + data.dsize);
 				hdr = (void *)data.dptr;
 				hdr->generation = ++generation;
+				mode = (i->generation == NO_GENERATION)
+				       ? NODE_CREATE : NODE_MODIFY;
 				*is_corrupt |= do_tdb_write(conn, &key, &data,
-							    NULL, true);
+							    NULL, mode, true);
 				talloc_free(data.dptr);
 				if (do_tdb_delete(conn, &ta_key, NULL))
 					*is_corrupt = true;
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:03:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:03:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568732.888583 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtLJ-0000xb-MF; Mon, 24 Jul 2023 11:03:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568732.888583; Mon, 24 Jul 2023 11:03:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtLJ-0000xR-Im; Mon, 24 Jul 2023 11:03:09 +0000
Received: by outflank-mailman (input) for mailman id 568732;
 Mon, 24 Jul 2023 11:03:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtLH-0000KR-Q0
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:03:07 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ab4d4a66-2a11-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:03:07 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 1D14020695;
 Mon, 24 Jul 2023 11:03:07 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id DE56013476;
 Mon, 24 Jul 2023 11:03:06 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id QgPXNGpavmRVYQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:03:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ab4d4a66-2a11-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196587; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=SQf628ebvedy/oSH7lsRps7bb3KYzWqEHfLoukckbyU=;
	b=N3OsHHCa1qqmtwZ6iexrpcTMEBbBIgUl8kaOV7Of4r+BskBO9y80MPhlh4r4PorEiGcZwG
	Tv/4+5GEc0Ow4VSfqQalbSNAk4l3zxDWBjALtzUe3FfJNxLQjVkDGHzuylzNusZf+aUm1A
	9Tbzy/gQSFeMRVA2Ajb6OZHrZZ+6sDs=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [PATCH v3 03/25] tools/xenstore: let transaction_prepend() return the name for access
Date: Mon, 24 Jul 2023 13:02:25 +0200
Message-Id: <20230724110247.10520-4-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Instead of setting the TDB key for accessing the node in the data base,
let transaction_prepend() return the associated name instead.

This is in preparation to replace TDB with a more simple data storage.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 tools/xenstore/xenstored_core.c        |  4 +++-
 tools/xenstore/xenstored_transaction.c | 11 ++++-------
 tools/xenstore/xenstored_transaction.h |  3 +--
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index ba4798dd6e..474bc57e73 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -695,6 +695,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	TDB_DATA key, data;
 	struct xs_tdb_record_hdr *hdr;
 	struct node *node;
+	const char *db_name;
 	int err;
 
 	node = talloc(ctx, struct node);
@@ -709,7 +710,8 @@ struct node *read_node(struct connection *conn, const void *ctx,
 		return NULL;
 	}
 
-	transaction_prepend(conn, name, &key);
+	db_name = transaction_prepend(conn, name);
+	set_tdb_key(db_name, &key);
 
 	data = tdb_fetch(tdb_ctx, key);
 
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 020b70d954..36567db753 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -196,20 +196,17 @@ static char *transaction_get_node_name(void *ctx, struct transaction *trans,
  * Prepend the transaction to name if node has been modified in the current
  * transaction.
  */
-void transaction_prepend(struct connection *conn, const char *name,
-			 TDB_DATA *key)
+const char *transaction_prepend(struct connection *conn, const char *name)
 {
 	struct accessed_node *i;
 
 	if (conn && conn->transaction) {
 		i = find_accessed_node(conn->transaction, name);
-		if (i) {
-			set_tdb_key(i->trans_name, key);
-			return;
-		}
+		if (i)
+			return i->trans_name;
 	}
 
-	set_tdb_key(name, key);
+	return name;
 }
 
 /*
diff --git a/tools/xenstore/xenstored_transaction.h b/tools/xenstore/xenstored_transaction.h
index f6a2e2f7f5..b196b1ab07 100644
--- a/tools/xenstore/xenstored_transaction.h
+++ b/tools/xenstore/xenstored_transaction.h
@@ -47,8 +47,7 @@ int __must_check access_node(struct connection *conn, struct node *node,
 void queue_watches(struct connection *conn, const char *name, bool watch_exact);
 
 /* Prepend the transaction to name if appropriate. */
-void transaction_prepend(struct connection *conn, const char *name,
-                         TDB_DATA *key);
+const char *transaction_prepend(struct connection *conn, const char *name);
 
 /* Mark the transaction as failed. This will prevent it to be committed. */
 void fail_transaction(struct transaction *trans);
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:03:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:03:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568733.888593 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtLL-0001GX-Ud; Mon, 24 Jul 2023 11:03:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568733.888593; Mon, 24 Jul 2023 11:03:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtLL-0001FY-Qk; Mon, 24 Jul 2023 11:03:11 +0000
Received: by outflank-mailman (input) for mailman id 568733;
 Mon, 24 Jul 2023 11:03:10 +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 <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNtLK-0008WC-CW
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:03:10 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on2062a.outbound.protection.outlook.com
 [2a01:111:f400:fe13::62a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ac139c70-2a11-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 13:03:08 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB10034.eurprd04.prod.outlook.com (2603:10a6:10:4c4::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Mon, 24 Jul
 2023 11:03:06 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 11:03:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ac139c70-2a11-11ee-8612-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JzLXYt9BAHZ7ZrCmErCM6KXRgPQ0g7uLiqavI8pTdBkbJ5W8EH/8F5vAY2It6OrqslY3/6+GaDalpDjzeYpK2dSHnVBovE2P8mIvJUxcGsof0Eah8fX/s90MgsewQsoYZM68T17BZUn3qXK//V830ffxdwBjsyf5A5bn/dxjiJLmqOrQFAg8x8m8eky5xMlMc0chqiWlKQRBv7QwGlzQQVwx1Xydd35ZNKz/Hd1HD22wE9FVo6qoJbNUf6ZpB4g8E2fmMVzVoEwYv0Ug0W/nWsFWa334WNPhyS/W4Plntq+SsKxwsJExK0ml649IhzNO9dwB7LwaZiWF8GW7CF1OhA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=HRqRIWSw/+qjfthOL/y9AHdHG6EDej1B561NpI8uduk=;
 b=oTd4vv9NpF62zNVUYbxCtFMK8RLNN5eSAJrR7A1g09OWJcijsSW9Bx9Ueiy6Rf6FTC1E4LDY6bcZGiLUYNlCCq4ml2qgdeISd44tNgyH2Vi0o+ac0w/+eOHlYuEn6TSKbCwM2B4uHRDT9FFFWIiQkz7cdEzQQMhwW9bOAtnHbYJnu34EYF64C7sqVqGmO3lbWCj3/Sxhlj1xlW52LhvCWl7itoNFCUgLdRsCPCnjIXVNRI0VUXPl8qgs9ndn3t1v8rFZYZx+4fSe8mtJN46L6FUZ+yxsXAIySENxD3AFz6IDttaPPA8/Xw7oT5Ynf4i7VilEn93i3kc4ZC1Dxv8o/g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=HRqRIWSw/+qjfthOL/y9AHdHG6EDej1B561NpI8uduk=;
 b=SpyUkBsU30gZt/ciXZYdc/Fq2xAultvlXjcQ5xkiDEGJfCRTvQYdDGR/kmK0puPrLNobpn4vL0WAOBOFQTZc+5eNgGk4QBC719CHEOBBAq9lIGndpjJsoSApUJBzS/icRzzTHGVGDZQTRnM8Ze3DlSe5sMdakfcSkvJsy1ycHy0rmEX606PJdEHlNEnvOgQm+1lwFgzcEjruREpzkstmeniOKT+9KfEQ9N+6Dn0mVvwy4Mig0ChOCK9hIOgIEV5YzmHoilTnuE4qRa7iRSC59dXZtsWGNj8D76h3jUXHBLSMAZtc6OHBAnxh1El0QadrJObZsTExjf4dZDh0iYntEg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <cb97a392-16fb-136d-5781-095fc1cf8406@suse.com>
Date: Mon, 24 Jul 2023 13:03:06 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 09/13] vpci/header: emulate PCI_COMMAND register for
 guests
Content-Language: en-US
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-10-volodymyr_babchuk@epam.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230720003205.1828537-10-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0156.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b3::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB10034:EE_
X-MS-Office365-Filtering-Correlation-Id: 266baf04-b201-480e-3fc9-08db8c358eaa
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	gYJ6H28v5vqsJ0W5xZ2Xo9qBfTf8+oOfQIRbIlt0xyxv59ATb5rQIQHfdot3F6aFuV0y1numF41eMDkqSuIcyFyg+CLQLyA0jg7Iy4z0581B9ukP729ooovFnJ+SNXsu76wx344tyz8t5ktAPDvmzKgxk7mBO2+AOBEjh82KmBb419uaepX7rMpEKZoXJ6+WcmIHsNjen29LX0MNdLfTe6RgyFvviohBNnMPNWX61ZOXUys/kKCV3bPbay07T8lvofJJAUpIc2dl97lhOpKB6lKqzSDgw9f9ym5oCQ/T5o1XjUfnsW9o5/XCGB9hO9wJjReel6bz4yzPyKqH1TOwC0+NafSGI75WxqZa06EJTh6BOz8ZkO1IgHumjvdGpIuMA5b5KeXTG3eB1sI5ua5MH7qyX5LorG+GpAEItJfxnGuby7o5ZAaGJTQd9fnbR0e5hzWJVTdNSU2Wp1u7HLZuLZRCvjD8fXj3iC3jraioYKMjf/Mcqbxh9+Zknq+beC/Anc0j2dAi3GL0MlmE/tRsnG/Gwj2UC0bf+GFOg++m9uEwfeNPV3WoMO67zzOKCjXfWuLjuRmPun5k7JG/X2HQNZfc7rM5Fw5AvHRzQqOJtGZJdCjHB3LtFk5vXr9Lcp2kH9PHOo1QVqFA8KMo32kCjA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(136003)(376002)(346002)(39860400002)(396003)(451199021)(31686004)(6512007)(41300700001)(316002)(4326008)(26005)(6506007)(186003)(53546011)(54906003)(5660300002)(6486002)(66556008)(8936002)(8676002)(66476007)(6916009)(66946007)(478600001)(2616005)(83380400001)(2906002)(38100700002)(86362001)(36756003)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Q1ZudncrSjhNLzRnVjc0enNtUHorSkcwSmtiOCtRbDE5am9tZDRBWkw1S09h?=
 =?utf-8?B?SnI2SkR1RmRiZmdxTTlUMFRsNEQ5MS9EbXpPSDVCUjRQbDlnYnJVMWc1S3Mz?=
 =?utf-8?B?enpCRktLQmc2aEJzeUd6Ym44blllYUJQUzc1MDNWMVlLejJtNUc2SXcwTi9u?=
 =?utf-8?B?ejI2UzB0c0MxdkJnWXJTRE1WaHBaeEZlYkhoRmRsNkhVWGZEeUpzeHE4TUhr?=
 =?utf-8?B?bWV3WCtFQ1BOd09iZGZ5QVYyUlZ4WDhESVM5NTFZajRVRWRpWmxxMXdlNnFm?=
 =?utf-8?B?YmRwL3dMVVZUR1lXQmlHMTBqcjVLdWE1NnkrVjFleHZiK0RFTWpBbGF3Z245?=
 =?utf-8?B?aGxCdEEwdEhXM3Q3UzlhU1ZpWU5OQXNNTFp6blJoUy9WMUt4cE9SNGpQSGdT?=
 =?utf-8?B?WCtEWlpaOEdDZ0FXd1RSS1Npc3k0NlNUMEpwTFVTMXlpbTFDak9Za0Fna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rossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 11:03:05.8869
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: UwKf/UzjS/VfO3cJlTrN0E9DJje/aH6WA3HUlEZe2qJNiPPFin+q0N1J4S0V51DcU6YYCONUy/2tcEcSZeYF3g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB10034

On 20.07.2023 02:32, Volodymyr Babchuk wrote:
> --- a/xen/drivers/vpci/msi.c
> +++ b/xen/drivers/vpci/msi.c
> @@ -70,6 +70,10 @@ static void cf_check control_write(
>  
>          if ( vpci_msi_arch_enable(msi, pdev, vectors) )
>              return;
> +
> +        /* Make sure guest doesn't enable INTx while enabling MSI. */
> +        if ( !is_hardware_domain(pdev->domain) )
> +            pci_intx(pdev, false);

Neither this nor ...

> --- a/xen/drivers/vpci/msix.c
> +++ b/xen/drivers/vpci/msix.c
> @@ -97,6 +97,10 @@ static void cf_check control_write(
>          for ( i = 0; i < msix->max_entries; i++ )
>              if ( !msix->entries[i].masked && msix->entries[i].updated )
>                  update_entry(&msix->entries[i], pdev, i);
> +
> +        /* Make sure guest doesn't enable INTx while enabling MSI-X. */
> +        if ( !is_hardware_domain(pdev->domain) )
> +            pci_intx(pdev, false);

... this has a counterpart passing true, to restore pin-based IRQs.
While it looks like we have a pre-existing issue here as well
(see __pci_disable_msi() vs __pci_disable_msix()), could you clarify
how this is meant to work for DomU-s?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:03:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:03:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568734.888603 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtLP-0001cp-8R; Mon, 24 Jul 2023 11:03:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568734.888603; Mon, 24 Jul 2023 11:03:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtLP-0001cg-4v; Mon, 24 Jul 2023 11:03:15 +0000
Received: by outflank-mailman (input) for mailman id 568734;
 Mon, 24 Jul 2023 11:03:14 +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 <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtLO-0008WC-LG
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:03:14 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id aeade6d1-2a11-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 13:03:13 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id BE6F820697;
 Mon, 24 Jul 2023 11:03:12 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7FC8113476;
 Mon, 24 Jul 2023 11:03:12 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id lHDbHXBavmRlYQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:03:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aeade6d1-2a11-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196592; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=f6YolIcQ4D4Yg1XVjgJIVFTRGQJMKOPi0ubUNqhQlnI=;
	b=Bp0orEkYQdAkL6dfv/KVe4cMZURJxEm1tF80Nh3IXAWi7hjcsWYHHBULblf+UfvYCxgA9r
	4XrfOiDXygaDfeMLaC+GU1J/ZBZieNihCd5CLuPJLkwhSLvk9dOukXQQrnXmXW0EBQ7pFK
	sYRBfULqvT8AjlLSKnX3r6Lhi4ErASo=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [PATCH v3 04/25] tools/xenstore: rename do_tdb_delete() and change parameter type
Date: Mon, 24 Jul 2023 13:02:26 +0200
Message-Id: <20230724110247.10520-5-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rename do_tdb_delete() to db_delete() and replace the key parameter
with db_name specifying the name of the node in the data base.

This is in preparation to replace TDB with a more simple data storage.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
---
V2:
- remove unrelated change (Julien Grall)
---
 tools/xenstore/xenstored_core.c        | 31 ++++++++++++--------------
 tools/xenstore/xenstored_core.h        |  5 +++--
 tools/xenstore/xenstored_transaction.c | 16 +++++--------
 3 files changed, 23 insertions(+), 29 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 474bc57e73..aa3885682d 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -658,28 +658,31 @@ int do_tdb_write(struct connection *conn, TDB_DATA *key, TDB_DATA *data,
 	return 0;
 }
 
-int do_tdb_delete(struct connection *conn, TDB_DATA *key,
-		  struct node_account_data *acc)
+int db_delete(struct connection *conn, const char *name,
+	      struct node_account_data *acc)
 {
 	struct node_account_data tmp_acc;
 	unsigned int domid;
+	TDB_DATA key;
+
+	set_tdb_key(name, &key);
 
 	if (!acc) {
 		acc = &tmp_acc;
 		acc->memory = -1;
 	}
 
-	get_acc_data(key, acc);
+	get_acc_data(&key, acc);
 
-	if (tdb_delete(tdb_ctx, *key)) {
+	if (tdb_delete(tdb_ctx, key)) {
 		errno = EIO;
 		return errno;
 	}
-	trace_tdb("delete %s\n", key->dptr);
+	trace_tdb("delete %s\n", name);
 
 	if (acc->memory) {
-		domid = get_acc_domid(conn, key, acc->domid);
-		domain_memory_add_nochk(conn, domid, -acc->memory - key->dsize);
+		domid = get_acc_domid(conn, &key, acc->domid);
+		domain_memory_add_nochk(conn, domid, -acc->memory - key.dsize);
 	}
 
 	return 0;
@@ -1454,13 +1457,10 @@ nomem:
 
 static void destroy_node_rm(struct connection *conn, struct node *node)
 {
-	TDB_DATA key;
-
 	if (streq(node->name, "/"))
 		corrupt(NULL, "Destroying root node!");
 
-	set_tdb_key(node->db_name, &key);
-	do_tdb_delete(conn, &key, &node->acc);
+	db_delete(conn, node->db_name, &node->acc);
 }
 
 static int destroy_node(struct connection *conn, struct node *node)
@@ -1651,7 +1651,6 @@ static int delnode_sub(const void *ctx, struct connection *conn,
 	bool watch_exact;
 	int ret;
 	const char *db_name;
-	TDB_DATA key;
 
 	/* Any error here will probably be repeated for all following calls. */
 	ret = access_node(conn, node, NODE_ACCESS_DELETE, &db_name);
@@ -1662,8 +1661,7 @@ static int delnode_sub(const void *ctx, struct connection *conn,
 		return WALK_TREE_ERROR_STOP;
 
 	/* In case of error stop the walk. */
-	set_tdb_key(db_name, &key);
-	if (!ret && do_tdb_delete(conn, &key, &node->acc))
+	if (!ret && db_delete(conn, db_name, &node->acc))
 		return WALK_TREE_ERROR_STOP;
 
 	/*
@@ -2489,9 +2487,8 @@ static int clean_store_(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA val,
 	}
 	if (!hashtable_search(reachable, name)) {
 		log("clean_store: '%s' is orphaned!", name);
-		if (recovery) {
-			do_tdb_delete(NULL, &key, NULL);
-		}
+		if (recovery)
+			db_delete(NULL, name, NULL);
 	}
 
 	talloc_free(name);
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index ec7a56a869..1aae324c77 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -362,12 +362,13 @@ extern xengnttab_handle **xgt_handle;
 
 int remember_string(struct hashtable *hash, const char *str);
 
+/* Data base access functions. */
 void set_tdb_key(const char *name, TDB_DATA *key);
 int do_tdb_write(struct connection *conn, TDB_DATA *key, TDB_DATA *data,
 		 struct node_account_data *acc, enum write_node_mode mode,
 		 bool no_quota_check);
-int do_tdb_delete(struct connection *conn, TDB_DATA *key,
-		  struct node_account_data *acc);
+int db_delete(struct connection *conn, const char *name,
+	      struct node_account_data *acc);
 
 void conn_free_buffered_data(struct connection *conn);
 
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 36567db753..4a243369b0 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -384,8 +384,7 @@ static int finalize_transaction(struct connection *conn,
 		/* Entries for unmodified nodes can be removed early. */
 		if (!i->modified) {
 			if (i->ta_node) {
-				set_tdb_key(i->trans_name, &ta_key);
-				if (do_tdb_delete(conn, &ta_key, NULL))
+				if (db_delete(conn, i->trans_name, NULL))
 					return EIO;
 			}
 			list_del(&i->list);
@@ -394,7 +393,6 @@ static int finalize_transaction(struct connection *conn,
 	}
 
 	while ((i = list_top(&trans->accessed, struct accessed_node, list))) {
-		set_tdb_key(i->node, &key);
 		if (i->ta_node) {
 			set_tdb_key(i->trans_name, &ta_key);
 			data = tdb_fetch(tdb_ctx, ta_key);
@@ -407,10 +405,11 @@ static int finalize_transaction(struct connection *conn,
 				hdr->generation = ++generation;
 				mode = (i->generation == NO_GENERATION)
 				       ? NODE_CREATE : NODE_MODIFY;
+				set_tdb_key(i->node, &key);
 				*is_corrupt |= do_tdb_write(conn, &key, &data,
 							    NULL, mode, true);
 				talloc_free(data.dptr);
-				if (do_tdb_delete(conn, &ta_key, NULL))
+				if (db_delete(conn, i->trans_name, NULL))
 					*is_corrupt = true;
 			} else {
 				*is_corrupt = true;
@@ -423,7 +422,7 @@ static int finalize_transaction(struct connection *conn,
 			 */
 			*is_corrupt |= (i->generation == NO_GENERATION)
 				       ? false
-				       : do_tdb_delete(conn, &key, NULL);
+				       : db_delete(conn, i->node, NULL);
 		}
 		if (i->fire_watch)
 			fire_watches(conn, trans, i->node, NULL, i->watch_exact,
@@ -440,15 +439,12 @@ static int destroy_transaction(void *_transaction)
 {
 	struct transaction *trans = _transaction;
 	struct accessed_node *i;
-	TDB_DATA key;
 
 	wrl_ntransactions--;
 	trace_destroy(trans, "transaction");
 	while ((i = list_top(&trans->accessed, struct accessed_node, list))) {
-		if (i->ta_node) {
-			set_tdb_key(i->trans_name, &key);
-			do_tdb_delete(trans->conn, &key, NULL);
-		}
+		if (i->ta_node)
+			db_delete(trans->conn, i->trans_name, NULL);
 		list_del(&i->list);
 		talloc_free(i);
 	}
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:03:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:03:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568736.888613 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtLU-00026G-On; Mon, 24 Jul 2023 11:03:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568736.888613; Mon, 24 Jul 2023 11:03:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtLU-000269-Lr; Mon, 24 Jul 2023 11:03:20 +0000
Received: by outflank-mailman (input) for mailman id 568736;
 Mon, 24 Jul 2023 11:03:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtLT-0000KR-D9
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:03:19 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b1fc07cb-2a11-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:03:18 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 51CCB20694;
 Mon, 24 Jul 2023 11:03:18 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1EE3013476;
 Mon, 24 Jul 2023 11:03:18 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id RfohBnZavmRzYQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:03:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b1fc07cb-2a11-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196598; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=20QNajxZk743EX0aY+cQsL9LD9drTSx4TUjevmwUJ6E=;
	b=rmXs4+NUDGQWf0svXnxtB3EadaPS11KNyaZosp6kxxLj/esZfXbqvx2jpHUx4XcrqTKSPV
	ji8hfHWzDijUmpItQ7xcB7XwqlhQPTkxAMZ1XtTIc9cVlV0zZqXPDWrlUNt+dMIe67CSHC
	HA7RiHrZin4P7ta/pMewAMLrNaB/HtY=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [PATCH v3 05/25] tools/xenstore: rename do_tdb_write() and change parameter type
Date: Mon, 24 Jul 2023 13:02:27 +0200
Message-Id: <20230724110247.10520-6-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rename do_tdb_write() to db_write() and replace the key parameter with
db_name specifying the name of the node in the data base, and the data
parameter with a data pointer and a length.

Do the same key parameter type change for write_node_raw(), too.

This is in preparation to replace TDB with a more simple data storage.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
---
V2:
- keep ta_key in finalize_transaction() (Julien Grall)
---
 tools/xenstore/xenstored_core.c        | 70 +++++++++++++-------------
 tools/xenstore/xenstored_core.h        | 11 ++--
 tools/xenstore/xenstored_domain.c      |  4 +-
 tools/xenstore/xenstored_transaction.c | 10 ++--
 4 files changed, 46 insertions(+), 49 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index aa3885682d..2aa3d37c18 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -600,23 +600,27 @@ static unsigned int get_acc_domid(struct connection *conn, TDB_DATA *key,
 	       ? domid : conn->id;
 }
 
-int do_tdb_write(struct connection *conn, TDB_DATA *key, TDB_DATA *data,
-		 struct node_account_data *acc, enum write_node_mode mode,
-		 bool no_quota_check)
+int db_write(struct connection *conn, const char *db_name, void *data,
+	     size_t size, struct node_account_data *acc,
+	     enum write_node_mode mode, bool no_quota_check)
 {
-	struct xs_tdb_record_hdr *hdr = (void *)data->dptr;
+	struct xs_tdb_record_hdr *hdr = data;
 	struct node_account_data old_acc = {};
 	unsigned int old_domid, new_domid;
 	int ret;
+	TDB_DATA key, dat;
 
+	set_tdb_key(db_name, &key);
+	dat.dptr = data;
+	dat.dsize = size;
 	if (!acc)
 		old_acc.memory = -1;
 	else
 		old_acc = *acc;
 
-	get_acc_data(key, &old_acc);
-	old_domid = get_acc_domid(conn, key, old_acc.domid);
-	new_domid = get_acc_domid(conn, key, hdr->perms[0].id);
+	get_acc_data(&key, &old_acc);
+	old_domid = get_acc_domid(conn, &key, old_acc.domid);
+	new_domid = get_acc_domid(conn, &key, hdr->perms[0].id);
 
 	/*
 	 * Don't check for ENOENT, as we want to be able to switch orphaned
@@ -624,35 +628,34 @@ int do_tdb_write(struct connection *conn, TDB_DATA *key, TDB_DATA *data,
 	 */
 	if (old_acc.memory)
 		domain_memory_add_nochk(conn, old_domid,
-					-old_acc.memory - key->dsize);
-	ret = domain_memory_add(conn, new_domid,
-				data->dsize + key->dsize, no_quota_check);
+					-old_acc.memory - key.dsize);
+	ret = domain_memory_add(conn, new_domid, size + key.dsize,
+				no_quota_check);
 	if (ret) {
 		/* Error path, so no quota check. */
 		if (old_acc.memory)
 			domain_memory_add_nochk(conn, old_domid,
-						old_acc.memory + key->dsize);
+						old_acc.memory + key.dsize);
 		return ret;
 	}
 
 	/* TDB should set errno, but doesn't even set ecode AFAICT. */
-	if (tdb_store(tdb_ctx, *key, *data,
+	if (tdb_store(tdb_ctx, key, dat,
 		      (mode == NODE_CREATE) ? TDB_INSERT : TDB_MODIFY) != 0) {
-		domain_memory_add_nochk(conn, new_domid,
-					-data->dsize - key->dsize);
+		domain_memory_add_nochk(conn, new_domid, -size - key.dsize);
 		/* Error path, so no quota check. */
 		if (old_acc.memory)
 			domain_memory_add_nochk(conn, old_domid,
-						old_acc.memory + key->dsize);
+						old_acc.memory + key.dsize);
 		errno = EIO;
 		return errno;
 	}
-	trace_tdb("store %s size %zu\n", key->dptr, data->dsize + key->dsize);
+	trace_tdb("store %s size %zu\n", db_name, size + key.dsize);
 
 	if (acc) {
 		/* Don't use new_domid, as it might be a transaction node. */
 		acc->domid = hdr->perms[0].id;
-		acc->memory = data->dsize;
+		acc->memory = size;
 	}
 
 	return 0;
@@ -780,33 +783,35 @@ static bool read_node_can_propagate_errno(void)
 	return errno == ENOMEM || errno == ENOSPC;
 }
 
-int write_node_raw(struct connection *conn, TDB_DATA *key, struct node *node,
-		   enum write_node_mode mode, bool no_quota_check)
+int write_node_raw(struct connection *conn, const char *db_name,
+		   struct node *node, enum write_node_mode mode,
+		   bool no_quota_check)
 {
-	TDB_DATA data;
+	void *data;
+	size_t size;
 	void *p;
 	struct xs_tdb_record_hdr *hdr;
 
 	if (domain_adjust_node_perms(node))
 		return errno;
 
-	data.dsize = sizeof(*hdr)
+	size = sizeof(*hdr)
 		+ node->perms.num * sizeof(node->perms.p[0])
 		+ node->datalen + node->childlen;
 
 	/* Call domain_max_chk() in any case in order to record max values. */
-	if (domain_max_chk(conn, ACC_NODESZ, data.dsize) && !no_quota_check) {
+	if (domain_max_chk(conn, ACC_NODESZ, size) && !no_quota_check) {
 		errno = ENOSPC;
 		return errno;
 	}
 
-	data.dptr = talloc_size(node, data.dsize);
-	if (!data.dptr) {
+	data = talloc_size(node, size);
+	if (!data) {
 		errno = ENOMEM;
 		return errno;
 	}
 
-	hdr = (void *)data.dptr;
+	hdr = data;
 	hdr->generation = node->generation;
 	hdr->num_perms = node->perms.num;
 	hdr->datalen = node->datalen;
@@ -819,7 +824,8 @@ int write_node_raw(struct connection *conn, TDB_DATA *key, struct node *node,
 	p += node->datalen;
 	memcpy(p, node->children, node->childlen);
 
-	if (do_tdb_write(conn, key, &data, &node->acc, mode, no_quota_check))
+	if (db_write(conn, db_name, data, size, &node->acc, mode,
+		     no_quota_check))
 		return EIO;
 
 	return 0;
@@ -833,13 +839,11 @@ static int write_node(struct connection *conn, struct node *node,
 		      enum write_node_mode mode, bool no_quota_check)
 {
 	int ret;
-	TDB_DATA key;
 
 	if (access_node(conn, node, NODE_ACCESS_WRITE, &node->db_name))
 		return errno;
 
-	set_tdb_key(node->db_name, &key);
-	ret = write_node_raw(conn, &key, node, mode, no_quota_check);
+	ret = write_node_raw(conn, node->db_name, node, mode, no_quota_check);
 	if (ret && conn && conn->transaction) {
 		/*
 		 * Reverting access_node() is hard, so just fail the
@@ -3429,7 +3433,6 @@ void read_state_node(const void *ctx, const void *state)
 {
 	const struct xs_state_node *sn = state;
 	struct node *node, *parent;
-	TDB_DATA key;
 	char *name, *parentname;
 	unsigned int i;
 	struct connection conn = { .id = priv_domid };
@@ -3482,15 +3485,12 @@ void read_state_node(const void *ctx, const void *state)
 		if (add_child(node, parent, name))
 			barf("allocation error restoring node");
 
-		set_tdb_key(parentname, &key);
-		if (write_node_raw(NULL, &key, parent, NODE_MODIFY, true))
+		if (write_node_raw(NULL, parentname, parent, NODE_MODIFY, true))
 			barf("write parent error restoring node");
 	}
 
-	set_tdb_key(name, &key);
-
 	/* The "/" node is already existing, so it can only be modified here. */
-	if (write_node_raw(NULL, &key, node,
+	if (write_node_raw(NULL, name, node,
 			   strcmp(name, "/") ? NODE_CREATE : NODE_MODIFY, true))
 		barf("write node error restoring node");
 
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 1aae324c77..875ee5192b 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -243,8 +243,9 @@ enum write_node_mode {
 	NODE_MODIFY
 };
 
-int write_node_raw(struct connection *conn, TDB_DATA *key, struct node *node,
-		   enum write_node_mode mode, bool no_quota_check);
+int write_node_raw(struct connection *conn, const char *db_name,
+		   struct node *node, enum write_node_mode mode,
+		   bool no_quota_check);
 
 /* Get a node from the tdb data base. */
 struct node *read_node(struct connection *conn, const void *ctx,
@@ -364,9 +365,9 @@ int remember_string(struct hashtable *hash, const char *str);
 
 /* Data base access functions. */
 void set_tdb_key(const char *name, TDB_DATA *key);
-int do_tdb_write(struct connection *conn, TDB_DATA *key, TDB_DATA *data,
-		 struct node_account_data *acc, enum write_node_mode mode,
-		 bool no_quota_check);
+int db_write(struct connection *conn, const char *db_name, void *data,
+	     size_t size, struct node_account_data *acc,
+	     enum write_node_mode mode, bool no_quota_check);
 int db_delete(struct connection *conn, const char *name,
 	      struct node_account_data *acc);
 
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index 569c3bfbd0..10d2280f84 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -511,19 +511,17 @@ static int domain_tree_remove_sub(const void *ctx, struct connection *conn,
 				  struct node *node, void *arg)
 {
 	struct domain *domain = arg;
-	TDB_DATA key;
 	int ret = WALK_TREE_OK;
 
 	if (node->perms.p[0].id != domain->domid)
 		return WALK_TREE_OK;
 
 	if (keep_orphans) {
-		set_tdb_key(node->name, &key);
 		domain_nbentry_dec(NULL, domain->domid);
 		node->perms.p[0].id = priv_domid;
 		node->acc.memory = 0;
 		domain_nbentry_inc(NULL, priv_domid);
-		if (write_node_raw(NULL, &key, node, NODE_MODIFY, true)) {
+		if (write_node_raw(NULL, node->name, node, NODE_MODIFY, true)) {
 			/* That's unfortunate. We only can try to continue. */
 			syslog(LOG_ERR,
 			       "error when moving orphaned node %s to dom0\n",
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 4a243369b0..1961aef0d7 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -228,7 +228,6 @@ int access_node(struct connection *conn, struct node *node,
 {
 	struct accessed_node *i = NULL;
 	struct transaction *trans;
-	TDB_DATA local_key;
 	int ret;
 	bool introduce = false;
 
@@ -286,8 +285,7 @@ int access_node(struct connection *conn, struct node *node,
 			i->generation = node->generation;
 			i->check_gen = true;
 			if (node->generation != NO_GENERATION) {
-				set_tdb_key(i->trans_name, &local_key);
-				ret = write_node_raw(conn, &local_key, node,
+				ret = write_node_raw(conn, i->trans_name, node,
 						     NODE_CREATE, true);
 				if (ret)
 					goto err;
@@ -405,9 +403,9 @@ static int finalize_transaction(struct connection *conn,
 				hdr->generation = ++generation;
 				mode = (i->generation == NO_GENERATION)
 				       ? NODE_CREATE : NODE_MODIFY;
-				set_tdb_key(i->node, &key);
-				*is_corrupt |= do_tdb_write(conn, &key, &data,
-							    NULL, mode, true);
+				*is_corrupt |= db_write(conn, i->node,
+							data.dptr, data.dsize,
+							NULL, mode, true);
 				talloc_free(data.dptr);
 				if (db_delete(conn, i->trans_name, NULL))
 					*is_corrupt = true;
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:03:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:03:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568740.888623 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtLa-0002hv-27; Mon, 24 Jul 2023 11:03:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568740.888623; Mon, 24 Jul 2023 11:03:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtLZ-0002hA-VX; Mon, 24 Jul 2023 11:03:25 +0000
Received: by outflank-mailman (input) for mailman id 568740;
 Mon, 24 Jul 2023 11:03:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtLY-0000KR-NF
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:03:24 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b5561376-2a11-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:03:24 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id EADFC20694;
 Mon, 24 Jul 2023 11:03:23 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B4B0113476;
 Mon, 24 Jul 2023 11:03:23 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id btGyKntavmSAYQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:03:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b5561376-2a11-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196603; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=6lXZ5IdZRWlP0NjLbCuiGLRNG5pWjkshr1ucn8awGQY=;
	b=h8EyHs4MVggwfz2Lvg1G2aglMdM6p8SqTFBdAgrJZbUykaC49FaSfBDf/eeUJXmZ01dxgu
	3L1WQ/MdRy9GI5rJ6cU9vP8ZOEd4MeWz6H7COg6Ohp9Jfo4OqSYJfQ/ky8gLbeHG2wBvsg
	Drf11jy7FEX1DRdsMkVyLcfgj5fpzAA=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [PATCH v3 06/25] tools/xenstore: switch get_acc_data() to use name instead of key
Date: Mon, 24 Jul 2023 13:02:28 +0200
Message-Id: <20230724110247.10520-7-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Eliminate further TDB_DATA usage by switching get_acc_data() and
get_acc_domid() from a TDB key to the name of the node in the data base
as a parameter.

This is in preparation to replace TDB with a more simple data storage.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 tools/xenstore/xenstored_core.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 2aa3d37c18..dab09b5236 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -566,19 +566,20 @@ void set_tdb_key(const char *name, TDB_DATA *key)
 	key->dsize = strlen(name);
 }
 
-static void get_acc_data(TDB_DATA *key, struct node_account_data *acc)
+static void get_acc_data(const char *name, struct node_account_data *acc)
 {
-	TDB_DATA old_data;
+	TDB_DATA key, old_data;
 	struct xs_tdb_record_hdr *hdr;
 
 	if (acc->memory < 0) {
-		old_data = tdb_fetch(tdb_ctx, *key);
+		set_tdb_key(name, &key);
+		old_data = tdb_fetch(tdb_ctx, key);
 		/* No check for error, as the node might not exist. */
 		if (old_data.dptr == NULL) {
 			acc->memory = 0;
 		} else {
-			trace_tdb("read %s size %zu\n", key->dptr,
-				  old_data.dsize + key->dsize);
+			trace_tdb("read %s size %zu\n", name,
+				  old_data.dsize + key.dsize);
 			hdr = (void *)old_data.dptr;
 			acc->memory = old_data.dsize;
 			acc->domid = hdr->perms[0].id;
@@ -593,11 +594,10 @@ static void get_acc_data(TDB_DATA *key, struct node_account_data *acc)
  * count prepended (e.g. 123/local/domain/...). So testing for the node's
  * key not to start with "/" or "@" is sufficient.
  */
-static unsigned int get_acc_domid(struct connection *conn, TDB_DATA *key,
+static unsigned int get_acc_domid(struct connection *conn, const char *name,
 				  unsigned int domid)
 {
-	return (!conn || key->dptr[0] == '/' || key->dptr[0] == '@')
-	       ? domid : conn->id;
+	return (!conn || name[0] == '/' || name[0] == '@') ? domid : conn->id;
 }
 
 int db_write(struct connection *conn, const char *db_name, void *data,
@@ -618,9 +618,9 @@ int db_write(struct connection *conn, const char *db_name, void *data,
 	else
 		old_acc = *acc;
 
-	get_acc_data(&key, &old_acc);
-	old_domid = get_acc_domid(conn, &key, old_acc.domid);
-	new_domid = get_acc_domid(conn, &key, hdr->perms[0].id);
+	get_acc_data(db_name, &old_acc);
+	old_domid = get_acc_domid(conn, db_name, old_acc.domid);
+	new_domid = get_acc_domid(conn, db_name, hdr->perms[0].id);
 
 	/*
 	 * Don't check for ENOENT, as we want to be able to switch orphaned
@@ -675,7 +675,7 @@ int db_delete(struct connection *conn, const char *name,
 		acc->memory = -1;
 	}
 
-	get_acc_data(&key, acc);
+	get_acc_data(name, acc);
 
 	if (tdb_delete(tdb_ctx, key)) {
 		errno = EIO;
@@ -684,7 +684,7 @@ int db_delete(struct connection *conn, const char *name,
 	trace_tdb("delete %s\n", name);
 
 	if (acc->memory) {
-		domid = get_acc_domid(conn, &key, acc->domid);
+		domid = get_acc_domid(conn, name, acc->domid);
 		domain_memory_add_nochk(conn, domid, -acc->memory - key.dsize);
 	}
 
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:03:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:03:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568744.888633 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtLj-0003Wq-Bc; Mon, 24 Jul 2023 11:03:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568744.888633; Mon, 24 Jul 2023 11:03:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtLj-0003Wh-8C; Mon, 24 Jul 2023 11:03:35 +0000
Received: by outflank-mailman (input) for mailman id 568744;
 Mon, 24 Jul 2023 11:03:33 +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 <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtLh-0008WC-HP
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:03:33 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b8bb4c32-2a11-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 13:03:29 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 9CCD620695;
 Mon, 24 Jul 2023 11:03:29 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5F91F13476;
 Mon, 24 Jul 2023 11:03:29 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id cxT0FYFavmSPYQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:03:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b8bb4c32-2a11-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196609; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=r7Ym4LUS2VI66FFn3rEX1b9dLO2vvX5eqYIpBnAurpE=;
	b=YoqMEZGwt6iKt5rvlm+FBPXB3LTOxVbCCNH3l1dvNBjNHt96loBzBkPpqlhVf6FuWAHkoz
	9P1BdvIcF+QC+2f5kB4sjVgtE1OK9QS6idc0UYBLL4+FdUN52ziSsxLav2OjMXgRzpHYuP
	jhYuATWr79WO0vjMwexd043/TYUG8T0=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [PATCH v3 07/25] tools/xenstore: add wrapper for tdb_fetch()
Date: Mon, 24 Jul 2023 13:02:29 +0200
Message-Id: <20230724110247.10520-8-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add a wrapper function for tdb_fetch taking the name of the node in
the data base as a parameter. Let it return a data pointer and the
length of the data via a length pointer provided as additional
parameter.

Move logging of the TDB access from the callers into the wrapper.

This enables to make set_tdb_key() and tdb_ctx static.

This is in preparation to replace TDB with a more simple data storage.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
---
V2:
- always set *size in db_fetch() (Julien Grall)
- change db_fetch() return type (Julien Grall)
- move logging
---
 tools/xenstore/xenstored_core.c        | 55 +++++++++++++++-----------
 tools/xenstore/xenstored_core.h        |  3 +-
 tools/xenstore/xenstored_transaction.c | 31 ++++++---------
 3 files changed, 44 insertions(+), 45 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index dab09b5236..a12ede147c 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -85,7 +85,7 @@ bool keep_orphans = false;
 static int reopen_log_pipe[2];
 static int reopen_log_pipe0_pollfd_idx = -1;
 char *tracefile = NULL;
-TDB_CONTEXT *tdb_ctx = NULL;
+static TDB_CONTEXT *tdb_ctx = NULL;
 unsigned int trace_flags = TRACE_OBJ | TRACE_IO;
 
 static const char *sockmsg_string(enum xsd_sockmsg_type type);
@@ -556,7 +556,7 @@ static void initialize_fds(int *p_sock_pollfd_idx, int *ptimeout)
 	}
 }
 
-void set_tdb_key(const char *name, TDB_DATA *key)
+static void set_tdb_key(const char *name, TDB_DATA *key)
 {
 	/*
 	 * Dropping const is fine here, as the key will never be modified
@@ -566,25 +566,39 @@ void set_tdb_key(const char *name, TDB_DATA *key)
 	key->dsize = strlen(name);
 }
 
+struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
+{
+	TDB_DATA key, data;
+
+	set_tdb_key(db_name, &key);
+	data = tdb_fetch(tdb_ctx, key);
+	if (!data.dptr) {
+		errno = (tdb_error(tdb_ctx) == TDB_ERR_NOEXIST) ? ENOENT : EIO;
+		*size = 0;
+	} else {
+		*size = data.dsize;
+		trace_tdb("read %s size %zu\n", db_name,
+			  *size + strlen(db_name));
+	}
+
+	return (struct xs_tdb_record_hdr *)data.dptr;
+}
+
 static void get_acc_data(const char *name, struct node_account_data *acc)
 {
-	TDB_DATA key, old_data;
+	size_t size;
 	struct xs_tdb_record_hdr *hdr;
 
 	if (acc->memory < 0) {
-		set_tdb_key(name, &key);
-		old_data = tdb_fetch(tdb_ctx, key);
+		hdr = db_fetch(name, &size);
 		/* No check for error, as the node might not exist. */
-		if (old_data.dptr == NULL) {
+		if (hdr == NULL) {
 			acc->memory = 0;
 		} else {
-			trace_tdb("read %s size %zu\n", name,
-				  old_data.dsize + key.dsize);
-			hdr = (void *)old_data.dptr;
-			acc->memory = old_data.dsize;
+			acc->memory = size;
 			acc->domid = hdr->perms[0].id;
 		}
-		talloc_free(old_data.dptr);
+		talloc_free(hdr);
 	}
 }
 
@@ -698,7 +712,7 @@ int db_delete(struct connection *conn, const char *name,
 struct node *read_node(struct connection *conn, const void *ctx,
 		       const char *name)
 {
-	TDB_DATA key, data;
+	size_t size;
 	struct xs_tdb_record_hdr *hdr;
 	struct node *node;
 	const char *db_name;
@@ -717,29 +731,24 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	}
 
 	db_name = transaction_prepend(conn, name);
-	set_tdb_key(db_name, &key);
+	hdr = db_fetch(db_name, &size);
 
-	data = tdb_fetch(tdb_ctx, key);
-
-	if (data.dptr == NULL) {
-		if (tdb_error(tdb_ctx) == TDB_ERR_NOEXIST) {
+	if (hdr == NULL) {
+		if (errno == ENOENT) {
 			node->generation = NO_GENERATION;
 			err = access_node(conn, node, NODE_ACCESS_READ, NULL);
 			errno = err ? : ENOENT;
 		} else {
-			log("TDB error on read: %s", tdb_errorstr(tdb_ctx));
+			log("DB error on read: %s", strerror(errno));
 			errno = EIO;
 		}
 		goto error;
 	}
 
-	trace_tdb("read %s size %zu\n", key.dptr, data.dsize + key.dsize);
-
 	node->parent = NULL;
-	talloc_steal(node, data.dptr);
+	talloc_steal(node, hdr);
 
 	/* Datalen, childlen, number of permissions */
-	hdr = (void *)data.dptr;
 	node->generation = hdr->generation;
 	node->perms.num = hdr->num_perms;
 	node->datalen = hdr->datalen;
@@ -748,7 +757,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	/* Permissions are struct xs_permissions. */
 	node->perms.p = hdr->perms;
 	node->acc.domid = get_node_owner(node);
-	node->acc.memory = data.dsize;
+	node->acc.memory = size;
 	if (domain_adjust_node_perms(node))
 		goto error;
 
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 875ee5192b..f5aa8d51a0 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -315,7 +315,6 @@ do {						\
 		trace("tdb: " __VA_ARGS__);	\
 } while (0)
 
-extern TDB_CONTEXT *tdb_ctx;
 extern int dom0_domid;
 extern int dom0_event;
 extern int priv_domid;
@@ -364,7 +363,7 @@ extern xengnttab_handle **xgt_handle;
 int remember_string(struct hashtable *hash, const char *str);
 
 /* Data base access functions. */
-void set_tdb_key(const char *name, TDB_DATA *key);
+struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size);
 int db_write(struct connection *conn, const char *db_name, void *data,
 	     size_t size, struct node_account_data *acc,
 	     enum write_node_mode mode, bool no_quota_check);
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 1961aef0d7..1981d1d55d 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -356,25 +356,21 @@ static int finalize_transaction(struct connection *conn,
 				struct transaction *trans, bool *is_corrupt)
 {
 	struct accessed_node *i, *n;
-	TDB_DATA key, ta_key, data;
+	size_t size;
 	struct xs_tdb_record_hdr *hdr;
 	uint64_t gen;
 
 	list_for_each_entry_safe(i, n, &trans->accessed, list) {
 		if (i->check_gen) {
-			set_tdb_key(i->node, &key);
-			data = tdb_fetch(tdb_ctx, key);
-			hdr = (void *)data.dptr;
-			if (!data.dptr) {
-				if (tdb_error(tdb_ctx) != TDB_ERR_NOEXIST)
-					return EIO;
+			hdr = db_fetch(i->node, &size);
+			if (!hdr) {
+				if (errno != ENOENT)
+					return errno;
 				gen = NO_GENERATION;
 			} else {
-				trace_tdb("read %s size %zu\n", key.dptr,
-					  key.dsize + data.dsize);
 				gen = hdr->generation;
 			}
-			talloc_free(data.dptr);
+			talloc_free(hdr);
 			if (i->generation != gen)
 				return EAGAIN;
 		}
@@ -392,21 +388,16 @@ static int finalize_transaction(struct connection *conn,
 
 	while ((i = list_top(&trans->accessed, struct accessed_node, list))) {
 		if (i->ta_node) {
-			set_tdb_key(i->trans_name, &ta_key);
-			data = tdb_fetch(tdb_ctx, ta_key);
-			if (data.dptr) {
+			hdr = db_fetch(i->trans_name, &size);
+			if (hdr) {
 				enum write_node_mode mode;
 
-				trace_tdb("read %s size %zu\n", ta_key.dptr,
-					  ta_key.dsize + data.dsize);
-				hdr = (void *)data.dptr;
 				hdr->generation = ++generation;
 				mode = (i->generation == NO_GENERATION)
 				       ? NODE_CREATE : NODE_MODIFY;
-				*is_corrupt |= db_write(conn, i->node,
-							data.dptr, data.dsize,
-							NULL, mode, true);
-				talloc_free(data.dptr);
+				*is_corrupt |= db_write(conn, i->node, hdr,
+							size, NULL, mode, true);
+				talloc_free(hdr);
 				if (db_delete(conn, i->trans_name, NULL))
 					*is_corrupt = true;
 			} else {
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:03:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:03:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568747.888642 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtLw-0004Yf-NB; Mon, 24 Jul 2023 11:03:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568747.888642; Mon, 24 Jul 2023 11:03:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtLw-0004YU-Kd; Mon, 24 Jul 2023 11:03:48 +0000
Received: by outflank-mailman (input) for mailman id 568747;
 Mon, 24 Jul 2023 11:03:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtLv-0000KR-76
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:03:47 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c2c02585-2a11-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:03:46 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 7385B20694;
 Mon, 24 Jul 2023 11:03:46 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4295A13476;
 Mon, 24 Jul 2023 11:03:46 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id QU7oDpJavmSyYQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:03:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c2c02585-2a11-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196626; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=0xB6oTYH0jaatpxlvCW+IH+bGX/Y8NZRC6aQFlKjAIU=;
	b=IVp6ZksGh83WYzXRuRC9WvkUdC8TvLXiGMtuhXl2luo1OFl4cnh8CbKidF+Mzb+GoJOANJ
	n1/iwQOOuJxAO6sKE+EX6k0E0gx7kZOy15Uoh9K2y7NIcTZnWxkcHqE6u39oxZqV3V9ImY
	mQbSBNcn48EwXpmMBK9sXUt78SndYs0=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 10/25] tools/xenstore: add hashtable_replace() function
Date: Mon, 24 Jul 2023 13:02:32 +0200
Message-Id: <20230724110247.10520-11-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

For an effective way to replace a hashtable entry add a new function
hashtable_replace().

This is in preparation to replace TDB with a more simple data storage.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V3:
- fix commit message (Julien Grall)
- move unrelated change to previous patch (Julien Grall)
- make value parameter const
---
 tools/xenstore/hashtable.c | 19 +++++++++++++++++++
 tools/xenstore/hashtable.h | 16 ++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c
index 0409725060..f85b5a71f1 100644
--- a/tools/xenstore/hashtable.c
+++ b/tools/xenstore/hashtable.c
@@ -205,6 +205,25 @@ void *hashtable_search(const struct hashtable *h, const void *k)
     return e ? e->v : NULL;
 }
 
+int hashtable_replace(struct hashtable *h, const void *k, const void *v)
+{
+    struct entry *e;
+
+    e = hashtable_search_entry(h, k);
+    if (!e)
+        return ENOENT;
+
+    if (h->flags & HASHTABLE_FREE_VALUE)
+    {
+        talloc_free(e->v);
+        talloc_steal(e, v);
+    }
+
+    e->v = (void *)v;
+
+    return 0;
+}
+
 void
 hashtable_remove(struct hashtable *h, const void *k)
 {
diff --git a/tools/xenstore/hashtable.h b/tools/xenstore/hashtable.h
index 1da3af2648..125de0cfa2 100644
--- a/tools/xenstore/hashtable.h
+++ b/tools/xenstore/hashtable.h
@@ -51,6 +51,22 @@ create_hashtable(const void *ctx, const char *name,
 int
 hashtable_add(struct hashtable *h, const void *k, const void *v);
 
+/*****************************************************************************
+ * hashtable_replace
+
+ * @name        hashtable_nsert
+ * @param   h   the hashtable to insert into
+ * @param   k   the key - hashtable claims ownership and will free on removal
+ * @param   v   the value - does not claim ownership
+ * @return      zero for successful insertion
+ *
+ * This function does check for an entry being present before replacing it
+ * with a new value.
+ */
+
+int
+hashtable_replace(struct hashtable *h, const void *k, const void *v);
+
 /*****************************************************************************
  * hashtable_search
    
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:03:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:03:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568748.888653 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtM2-0004yl-Vs; Mon, 24 Jul 2023 11:03:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568748.888653; Mon, 24 Jul 2023 11:03:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtM2-0004yc-Sm; Mon, 24 Jul 2023 11:03:54 +0000
Received: by outflank-mailman (input) for mailman id 568748;
 Mon, 24 Jul 2023 11:03:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtM1-0000KR-8G
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:03:53 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c61a9ab5-2a11-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:03:52 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 16E7322988;
 Mon, 24 Jul 2023 11:03:52 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id DB9D913476;
 Mon, 24 Jul 2023 11:03:51 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id btBANJdavmS+YQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:03:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c61a9ab5-2a11-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196632; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=lKQAmb4KsaU7Y9dxsAA9D22NxH3ixedN67bIExwynMA=;
	b=lHqgtjHyM3uhZFBaJX0z7wDFva8+2WtcncKcas1+7Pl8JZcTt20uDPR5wf4hwum8UlCANv
	bjHPw2nkYL1cnmk9easo8T5J4D9f7s17h95qigO3PUR42vriIDdow8ZEN8WI/l6f83u+VB
	SKWXlZC7WVpw9JpY68SyiycyWvYfgsQ=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 11/25] tools/xenstore: drop use of tdb
Date: Mon, 24 Jul 2023 13:02:33 +0200
Message-Id: <20230724110247.10520-12-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Today all Xenstore nodes are stored in a TDB data base. This data base
has several disadvantages:

- It is using a fixed sized hash table, resulting in high memory
  overhead for small installations with only very few VMs, and a rather
  large performance hit for systems with lots of VMs due to many
  collisions.
  The hash table size today is 7919 entries. This means that e.g. in
  case of a simple desktop use case with 2 or 3 VMs probably far less
  than 10% of the entries will be used (assuming roughly 100 nodes per
  VM). OTOH a setup on a large server with 500 VMs would result in
  heavy conflicts in the hash list with 5-10 nodes per hash table entry.

- TDB is using a single large memory area for storing the nodes. It
  only ever increases this area and will never shrink it afterwards.
  This will result in more memory usage than necessary after a peak of
  Xenstore usage.

- Xenstore is only single-threaded, while TDB is designed to be fit
  for multi-threaded use cases, resulting in much higher code
  complexity than needed.

- Special use cases of Xenstore are not possible to implement with TDB
  in an effective way, while an implementation of a data base tailored
  for Xenstore could simplify some handling (e.g. transactions) a lot.

So drop using TDB and store the nodes directly in memory making them
easily accessible. Use a hash-based lookup mechanism for fast lookup
of nodes by their full path.

For now only replace TDB keeping the current access functions.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- add const (Julien Grall)
- use specific pointer type instead of void * (Julien Grall)
- add comment to db_fetch() (Julien Grall)
V3:
- use talloc_memdup() (Julien Grall)
---
 tools/xenstore/xenstored_core.c        | 156 ++++++++++---------------
 tools/xenstore/xenstored_core.h        |   5 +-
 tools/xenstore/xenstored_transaction.c |   1 -
 3 files changed, 62 insertions(+), 100 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index a12ede147c..2b94392fd4 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -53,7 +53,6 @@
 #include "xenstored_domain.h"
 #include "xenstored_control.h"
 #include "xenstored_lu.h"
-#include "tdb.h"
 
 #ifndef NO_SOCKETS
 #if defined(HAVE_SYSTEMD)
@@ -85,7 +84,7 @@ bool keep_orphans = false;
 static int reopen_log_pipe[2];
 static int reopen_log_pipe0_pollfd_idx = -1;
 char *tracefile = NULL;
-static TDB_CONTEXT *tdb_ctx = NULL;
+static struct hashtable *nodes;
 unsigned int trace_flags = TRACE_OBJ | TRACE_IO;
 
 static const char *sockmsg_string(enum xsd_sockmsg_type type);
@@ -556,32 +555,30 @@ static void initialize_fds(int *p_sock_pollfd_idx, int *ptimeout)
 	}
 }
 
-static void set_tdb_key(const char *name, TDB_DATA *key)
-{
-	/*
-	 * Dropping const is fine here, as the key will never be modified
-	 * by TDB.
-	 */
-	key->dptr = (char *)name;
-	key->dsize = strlen(name);
-}
-
 struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
 {
-	TDB_DATA key, data;
+	const struct xs_tdb_record_hdr *hdr;
+	struct xs_tdb_record_hdr *p;
 
-	set_tdb_key(db_name, &key);
-	data = tdb_fetch(tdb_ctx, key);
-	if (!data.dptr) {
-		errno = (tdb_error(tdb_ctx) == TDB_ERR_NOEXIST) ? ENOENT : EIO;
-		*size = 0;
-	} else {
-		*size = data.dsize;
-		trace_tdb("read %s size %zu\n", db_name,
-			  *size + strlen(db_name));
+	hdr = hashtable_search(nodes, db_name);
+	if (!hdr) {
+		errno = ENOENT;
+		return NULL;
 	}
 
-	return (struct xs_tdb_record_hdr *)data.dptr;
+	*size = sizeof(*hdr) + hdr->num_perms * sizeof(hdr->perms[0]) +
+		hdr->datalen + hdr->childlen;
+
+	/* Return a copy, avoiding a potential modification in the DB. */
+	p = talloc_memdup(NULL, hdr, *size);
+	if (!p) {
+		errno = ENOMEM;
+		return NULL;
+	}
+
+	trace_tdb("read %s size %zu\n", db_name, *size + strlen(db_name));
+
+	return p;
 }
 
 static void get_acc_data(const char *name, struct node_account_data *acc)
@@ -621,12 +618,10 @@ int db_write(struct connection *conn, const char *db_name, void *data,
 	struct xs_tdb_record_hdr *hdr = data;
 	struct node_account_data old_acc = {};
 	unsigned int old_domid, new_domid;
+	size_t name_len = strlen(db_name);
+	const char *name;
 	int ret;
-	TDB_DATA key, dat;
 
-	set_tdb_key(db_name, &key);
-	dat.dptr = data;
-	dat.dsize = size;
 	if (!acc)
 		old_acc.memory = -1;
 	else
@@ -642,29 +637,36 @@ int db_write(struct connection *conn, const char *db_name, void *data,
 	 */
 	if (old_acc.memory)
 		domain_memory_add_nochk(conn, old_domid,
-					-old_acc.memory - key.dsize);
-	ret = domain_memory_add(conn, new_domid, size + key.dsize,
+					-old_acc.memory - name_len);
+	ret = domain_memory_add(conn, new_domid, size + name_len,
 				no_quota_check);
 	if (ret) {
 		/* Error path, so no quota check. */
 		if (old_acc.memory)
 			domain_memory_add_nochk(conn, old_domid,
-						old_acc.memory + key.dsize);
+						old_acc.memory + name_len);
 		return ret;
 	}
 
-	/* TDB should set errno, but doesn't even set ecode AFAICT. */
-	if (tdb_store(tdb_ctx, key, dat,
-		      (mode == NODE_CREATE) ? TDB_INSERT : TDB_MODIFY) != 0) {
-		domain_memory_add_nochk(conn, new_domid, -size - key.dsize);
+	if (mode == NODE_CREATE) {
+		/* db_name could be modified later, so allocate a copy. */
+		name = talloc_strdup(data, db_name);
+		ret = name ? hashtable_add(nodes, name, data) : ENOMEM;
+	} else
+		ret = hashtable_replace(nodes, db_name, data);
+
+	if (ret) {
+		/* Free data, as it isn't owned by hashtable now. */
+		talloc_free(data);
+		domain_memory_add_nochk(conn, new_domid, -size - name_len);
 		/* Error path, so no quota check. */
 		if (old_acc.memory)
 			domain_memory_add_nochk(conn, old_domid,
-						old_acc.memory + key.dsize);
-		errno = EIO;
+						old_acc.memory + name_len);
+		errno = ret;
 		return errno;
 	}
-	trace_tdb("store %s size %zu\n", db_name, size + key.dsize);
+	trace_tdb("store %s size %zu\n", db_name, size + name_len);
 
 	if (acc) {
 		/* Don't use new_domid, as it might be a transaction node. */
@@ -680,9 +682,6 @@ int db_delete(struct connection *conn, const char *name,
 {
 	struct node_account_data tmp_acc;
 	unsigned int domid;
-	TDB_DATA key;
-
-	set_tdb_key(name, &key);
 
 	if (!acc) {
 		acc = &tmp_acc;
@@ -691,15 +690,13 @@ int db_delete(struct connection *conn, const char *name,
 
 	get_acc_data(name, acc);
 
-	if (tdb_delete(tdb_ctx, key)) {
-		errno = EIO;
-		return errno;
-	}
+	hashtable_remove(nodes, name);
 	trace_tdb("delete %s\n", name);
 
 	if (acc->memory) {
 		domid = get_acc_domid(conn, name, acc->domid);
-		domain_memory_add_nochk(conn, domid, -acc->memory - key.dsize);
+		domain_memory_add_nochk(conn, domid,
+					-acc->memory - strlen(name));
 	}
 
 	return 0;
@@ -2354,43 +2351,29 @@ static void manual_node(const char *name, const char *child)
 	talloc_free(node);
 }
 
-static void tdb_logger(TDB_CONTEXT *tdb, int level, const char * fmt, ...)
+static unsigned int hash_from_key_fn(const void *k)
 {
-	va_list ap;
-	char *s;
-	int saved_errno = errno;
+	const char *str = k;
+	unsigned int hash = 5381;
+	char c;
 
-	va_start(ap, fmt);
-	s = talloc_vasprintf(NULL, fmt, ap);
-	va_end(ap);
+	while ((c = *str++))
+		hash = ((hash << 5) + hash) + (unsigned int)c;
 
-	if (s) {
-		trace("TDB: %s\n", s);
-		syslog(LOG_ERR, "TDB: %s",  s);
-		if (verbose)
-			xprintf("TDB: %s", s);
-		talloc_free(s);
-	} else {
-		trace("talloc failure during logging\n");
-		syslog(LOG_ERR, "talloc failure during logging\n");
-	}
+	return hash;
+}
 
-	errno = saved_errno;
+static int keys_equal_fn(const void *key1, const void *key2)
+{
+	return 0 == strcmp(key1, key2);
 }
 
 void setup_structure(bool live_update)
 {
-	char *tdbname;
-
-	tdbname = talloc_strdup(talloc_autofree_context(), "/dev/mem");
-	if (!tdbname)
-		barf_perror("Could not create tdbname");
-
-	tdb_ctx = tdb_open_ex(tdbname, 7919, TDB_INTERNAL | TDB_NOLOCK,
-			      O_RDWR | O_CREAT | O_EXCL | O_CLOEXEC,
-			      0640, &tdb_logger, NULL);
-	if (!tdb_ctx)
-		barf_perror("Could not create tdb file %s", tdbname);
+	nodes = create_hashtable(NULL, "nodes", hash_from_key_fn, keys_equal_fn,
+				 HASHTABLE_FREE_KEY | HASHTABLE_FREE_VALUE);
+	if (!nodes)
+		barf_perror("Could not create nodes hashtable");
 
 	if (live_update)
 		manual_node("/", NULL);
@@ -2404,24 +2387,6 @@ void setup_structure(bool live_update)
 	}
 }
 
-static unsigned int hash_from_key_fn(const void *k)
-{
-	const char *str = k;
-	unsigned int hash = 5381;
-	char c;
-
-	while ((c = *str++))
-		hash = ((hash << 5) + hash) + (unsigned int)c;
-
-	return hash;
-}
-
-
-static int keys_equal_fn(const void *key1, const void *key2)
-{
-	return 0 == strcmp(key1, key2);
-}
-
 int remember_string(struct hashtable *hash, const char *str)
 {
 	char *k = talloc_strdup(NULL, str);
@@ -2481,12 +2446,11 @@ static int check_store_enoent(const void *ctx, struct connection *conn,
 /**
  * Helper to clean_store below.
  */
-static int clean_store_(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA val,
-			void *private)
+static int clean_store_(const void *key, void *val, void *private)
 {
 	struct hashtable *reachable = private;
 	char *slash;
-	char * name = talloc_strndup(NULL, key.dptr, key.dsize);
+	char *name = talloc_strdup(NULL, key);
 
 	if (!name) {
 		log("clean_store: ENOMEM");
@@ -2516,7 +2480,7 @@ static int clean_store_(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA val,
  */
 static void clean_store(struct check_store_data *data)
 {
-	tdb_traverse(tdb_ctx, &clean_store_, data->reachable);
+	hashtable_iterate(nodes, clean_store_, data->reachable);
 	domain_check_acc(data->domains);
 }
 
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index f5aa8d51a0..ce40c61f44 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -33,7 +33,6 @@
 #include "xenstore_lib.h"
 #include "xenstore_state.h"
 #include "list.h"
-#include "tdb.h"
 #include "hashtable.h"
 
 #ifndef O_CLOEXEC
@@ -237,7 +236,7 @@ static inline unsigned int get_node_owner(const struct node *node)
 	return node->perms.p[0].id;
 }
 
-/* Write a node to the tdb data base. */
+/* Write a node to the data base. */
 enum write_node_mode {
 	NODE_CREATE,
 	NODE_MODIFY
@@ -247,7 +246,7 @@ int write_node_raw(struct connection *conn, const char *db_name,
 		   struct node *node, enum write_node_mode mode,
 		   bool no_quota_check);
 
-/* Get a node from the tdb data base. */
+/* Get a node from the data base. */
 struct node *read_node(struct connection *conn, const void *ctx,
 		       const char *name);
 
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 1981d1d55d..378fe79763 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -397,7 +397,6 @@ static int finalize_transaction(struct connection *conn,
 				       ? NODE_CREATE : NODE_MODIFY;
 				*is_corrupt |= db_write(conn, i->node, hdr,
 							size, NULL, mode, true);
-				talloc_free(hdr);
 				if (db_delete(conn, i->trans_name, NULL))
 					*is_corrupt = true;
 			} else {
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:06:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:06:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568749.888662 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtOa-0006NB-ET; Mon, 24 Jul 2023 11:06:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568749.888662; Mon, 24 Jul 2023 11:06:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtOa-0006N4-Bg; Mon, 24 Jul 2023 11:06:32 +0000
Received: by outflank-mailman (input) for mailman id 568749;
 Mon, 24 Jul 2023 11:06:31 +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 <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNtOZ-0006Mx-A9
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:06:31 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on2060c.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::60c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 239b4dd2-2a12-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 13:06:29 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU2PR04MB8584.eurprd04.prod.outlook.com (2603:10a6:10:2db::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 11:06:27 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 11:06:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 239b4dd2-2a12-11ee-8612-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=NTlimjO3+UW7EPgu0O42i7iKiII7dMOWoe4aO/WselrTtTSLAfapWN2GXL+AKcvGeu3B7VCrnq7aQFDHEZ5ycZc6a/Xdd+fXw1lKHTuYId7BWMIqEzTee0m/e+YOBvaPueVjy9VOkQnrWR3Z7+L0UF7lc/nBLKCYK/Lcf9wi+nhFg3akFx3Fo/uRYs8lgAhfglj6/Z26rRAyz9AwGbMa0X4y9FYi/5snNhLOLGpv5rLFs37/MWlJwQoQ8zWJFPrCj0mIo6051VuberYOUHqob/0zv4oUYKboSWw+bufloRJZ+d2T9Li49dZLqsz19sjZgg+1D7rI46IsZobaSMxvOg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ecwrqCzGMywutxclDewn5ns90+IWxqevIEVLjZHvqAo=;
 b=oTzdBSDi/ndPs+3ANrjGRiQmtjbRjlbqwzM/M9EjpHNOohudiUpQDZO1oUdZeXo4n4iKuRGj+VRSKNx3bj5InivVmSAxDkMsY2rcf7M+l9YjwwGdVsRmvo/qUE7zW2LL4eLiDAfqcPQU48//D6ikoSPKPoysebdq7QyprXWGzFQP8TYQJHwTwhqkUYNhSYTjvrqJd0EL6TbCODmTjIt6zT8xqp5NtfIwXgbsUHhcx099gaDS6eE/WMPMrE/fhfhJxvRVG8XMv8u/uHl6HV9jUq4RZ3PrYugEKjsAY3mDUcpzsKBcBQcgJOy4MSsqj+qfGT4CXk0tQECA5tVh6TrjCg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ecwrqCzGMywutxclDewn5ns90+IWxqevIEVLjZHvqAo=;
 b=b8bzIQUPCgUuoKGs04oAWCKt3IusTL0Sgk2pgUSyzOCzvtCUl7JIJUxAzG1F0FCurEnMGXahOS3LIYP9rGI0Zps8LgaDL95WhDe1xa3KYaJ3vXxJfY8pkGpj8ydQe/i95WHpU7Xj3XI700LrbMWnPpKYgB3iRz0OOrCRJW8Zr5oQpV9ALB2ZE537vyXGbSPUFSqYRKDnW+2Q63bbh2Mv8hqcgPt/MRj+/tCiv7EbIQUOW3Zg86RuEN20TFHdmIJlB7IWDScCCnXUssJuH+R7Wma4/utQbJvT0yJI7VtTZBF8b+Wsqo4sHPXlNbbVJIw02a0iz4ntE2oNJStCbYCXWw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <98c801fd-f352-cad1-5e44-d6d8ca433422@suse.com>
Date: Mon, 24 Jul 2023 13:06:27 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 09/13] vpci/header: emulate PCI_COMMAND register for
 guests
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-10-volodymyr_babchuk@epam.com>
 <ZLqI65gmNj1XDBm4@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZLqI65gmNj1XDBm4@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0099.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a9::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU2PR04MB8584:EE_
X-MS-Office365-Filtering-Correlation-Id: fdda0065-2c09-4782-d494-08db8c3606b0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	EP3fWYe5RYCM4wbtnbw5bx/2F05Pve3DAqoX31ewpBYKG6kM9YfBvETUWt+uAcqupRvUar2g6KaFi5EoVw2bXVJtY0oTYM9mIfst4vug6Qx+0WMTvnyvZYQUKGauRkaoW4k/CrL6KbeVHHkiqa0f8XPMAoMSZS7QRsSfN9QVinbXbgHq/MgsTSEWx3m7clpzdFzbhk3yT2TO37FkusXm/OtC3GmnGS/NAY3hrEpyPXaen/a8reqgBhcvowh4kaYy7eQLipZwneORo6AFaGahbO6SorfAhj0/BjP5W1hBOge+SXiNlhYZja8hNJyR9rK/LfqsoRL4esuB9BjzmS9CO4Lis30Rc5CN/Oeamyt2aaIn8vTlVDVyOXt6oS0vxGz01RY4Fl9dJgpxE0/Lqnk+K+lgUDHGQAeKnYMDRTyPJtlUkMbmx7C+uAr3naZ/Rk2xdyj7zK4xwPVED5znq2d5nM/pJKosZKLBLtoJw3JXov+7JWORcEfYNI63Lfffl50zk3MPhqIGprPO8ZgwycTwrPXZ7aP/6GwiMr1ezjNlj1mI5rF4x9obo/0W+AHXBqUBwBFK1vL0dz3/u8m1TbcfpI9Z1gZlehM1TuAm7mGGQcNfLTrC6+2BdH++RWxsmeUWF1PRS6mANXkWwdBGyc2+jg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(39850400004)(366004)(396003)(136003)(451199021)(6512007)(6486002)(478600001)(54906003)(186003)(53546011)(2616005)(6506007)(26005)(2906002)(6916009)(316002)(41300700001)(66556008)(66476007)(4326008)(8676002)(5660300002)(8936002)(66946007)(38100700002)(86362001)(31696002)(83380400001)(36756003)(31686004)(66899021)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SWJzd1N3OTBEOURZUU1wVFlURlJ6SlJpRGhrdXVzQTQwWXRUbWR4YmJ0L0FI?=
 =?utf-8?B?R2dYZUVPYWtrWlNFOUZRcGROZXhFZUNXeU9qZ0tJTmtFYjBDVjJBaDJCZmU0?=
 =?utf-8?B?YW01RWxHaWNHNTVkTndyNTM4b0JOQjRQaWhvdURTT25DMTU0ZWw5TVZTWGFT?=
 =?utf-8?B?b205Y2RXRVBDWTc0ZHBUcTJETm1GYXR2bTZoOWpLT0dvS3dRM2NzdWVoVXJX?=
 =?utf-8?B?TG5iQjZWQUxCeHBzbWkvekcwMEkvY3l5RTczNW1uelVpb1dBT1pWUEwrWThF?=
 =?utf-8?B?c3lrRFBzQkJYSW0vUzNnZmxuc0tGOE9aeFpIUk5kUEQzZmFTR21PQjBTWkEw?=
 =?utf-8?B?eVdLREs5UmRtenZqK2ZDN1NaaGl6Q1pzN0JFbDFoOVhVSWVGYnYzdEJDWWhZ?=
 =?utf-8?B?Zjl4K3F0TzVaQjF1ZlJlMmNWOXJOSGM4SkZRQ2hFMFMwNnZ3TnN1Smh6NkZX?=
 =?utf-8?B?T05uVlN2SlFqb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04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 11:06:27.2688
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: EiSIShzsOPWsxeNGqZByy/z7rWqKUMWQT7gIjLUq9ccN8GzM7B7LwuI28jBVEtEnPQ2HNF/XCXxpVGQeS/GHAg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8584

On 21.07.2023 15:32, Roger Pau MonnÃ© wrote:
> On Thu, Jul 20, 2023 at 12:32:33AM +0000, Volodymyr Babchuk wrote:
>> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
>>
>> Xen and/or Dom0 may have put values in PCI_COMMAND which they expect
>> to remain unaltered. PCI_COMMAND_SERR bit is a good example: while the
>> guest's view of this will want to be zero initially, the host having set
>> it to 1 may not easily be overwritten with 0, or else we'd effectively
>> imply giving the guest control of the bit. Thus, PCI_COMMAND register needs
>> proper emulation in order to honor host's settings.
> 
> You speak about SERR here, yet in the code all bits are togglable by
> domUs.

I think this paragraph is meant to describe only what would need doing,
as per what's said ...

>> There are examples of emulators [1], [2] which already deal with PCI_COMMAND
>> register emulation and it seems that at most they care about is the only INTx
>                                                                       ^ stray?
>> bit (besides IO/memory enable and bus master which are write through).
>> It could be because in order to properly emulate the PCI_COMMAND register
>> we need to know about the whole PCI topology, e.g. if any setting in device's
>> command register is aligned with the upstream port etc.
>>
>> This makes me think that because of this complexity others just ignore that.
>> Neither I think this can easily be done in Xen case.
>>
>> According to "PCI LOCAL BUS SPECIFICATION, REV. 3.0", section "6.2.2
>> Device Control" the reset state of the command register is typically 0,
>> so when assigning a PCI device use 0 as the initial state for the guest's view
>> of the command register.
>>
>> For now our emulation only makes sure INTx is set according to the host
>> requirements, i.e. depending on MSI/MSI-X enabled state.
>>
>> This implementation and the decision to only emulate INTx bit for now
>> is based on the previous discussion at [3].

... through to down here. Yet I agree the title suggests otherwise, and
hence that initial paragraph is further misleading.

>> --- a/xen/drivers/vpci/header.c
>> +++ b/xen/drivers/vpci/header.c
>> @@ -486,11 +486,27 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
>>      return 0;
>>  }
>>  
>> +/* TODO: Add proper emulation for all bits of the command register. */
>>  static void cf_check cmd_write(
>>      const struct pci_dev *pdev, unsigned int reg, uint32_t cmd, void *data)
>>  {

Note also the TODO being added here. Which course will need resolving
before any of this can become supported.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:07:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:07:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568752.888673 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtPT-0006xN-Ri; Mon, 24 Jul 2023 11:07:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568752.888673; Mon, 24 Jul 2023 11:07:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtPT-0006xE-Nt; Mon, 24 Jul 2023 11:07:27 +0000
Received: by outflank-mailman (input) for mailman id 568752;
 Mon, 24 Jul 2023 11:07:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtMZ-0000KR-0e
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:04:27 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id da691f06-2a11-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:04:26 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 2673A2298F;
 Mon, 24 Jul 2023 11:04:26 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id EC43613476;
 Mon, 24 Jul 2023 11:04:25 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id X8JKOLlavmQZYgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:04:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: da691f06-2a11-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196666; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=HbG6vFfvfpnBEfnaaQaQ12ffiTPqhKHDZgquwOgUpOo=;
	b=lZQCbaqclyrLeW7Qk45h0NM5eK5D7aWNYWZkIEjznaHuVvQhWzLS/6hNsyXfCkYebr4QcY
	/af6jMVjIgKjxv3/cmUE8B/NTSXBHaXGbmWeB6qDLDr+p1Q37j3B2msfrrWU5l0VXzBiSl
	fRmhVGMr4Z0lqkE6w4mkKCpYP7QaCAU=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
Date: Mon, 24 Jul 2023 13:02:39 +0200
Message-Id: <20230724110247.10520-18-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Struct xs_tdb_record_hdr is used for nodes stored in the data base.
When working on a node, struct node is being used, which is including
the same information as struct xs_tdb_record_hdr, but in a different
format. Rework struct xs_tdb_record_hdr in order to prepare including
it in struct node.

Do the following modifications:

- move its definition to xenstored_core.h, as the reason to put it into
  utils.h are no longer existing

- rename it to struct node_hdr, as the "tdb" in its name has only
  historical reasons

- replace the empty permission array at the end with a comment about
  the layout of data in the data base (concatenation of header,
  permissions, node contents, and children list)

- use narrower types for num_perms and datalen, as those are naturally
  limited to XENSTORE_PAYLOAD_MAX (childlen is different here, as it is
  in theory basically unlimited)

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- new patch
---
 tools/xenstore/utils.h                 |  9 -------
 tools/xenstore/xenstored_core.c        | 35 +++++++++++++++-----------
 tools/xenstore/xenstored_core.h        | 20 ++++++++++++++-
 tools/xenstore/xenstored_transaction.c |  6 ++---
 4 files changed, 42 insertions(+), 28 deletions(-)

diff --git a/tools/xenstore/utils.h b/tools/xenstore/utils.h
index 028ecb9d7a..405d662ea2 100644
--- a/tools/xenstore/utils.h
+++ b/tools/xenstore/utils.h
@@ -9,15 +9,6 @@
 
 #include "xenstore_lib.h"
 
-/* Header of the node record in tdb. */
-struct xs_tdb_record_hdr {
-	uint64_t generation;
-	uint32_t num_perms;
-	uint32_t datalen;
-	uint32_t childlen;
-	struct xs_permissions perms[0];
-};
-
 /* Is A == B ? */
 #define streq(a,b) (strcmp((a),(b)) == 0)
 
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 1f5f118f1c..86b7c9bf36 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -555,9 +555,9 @@ static void initialize_fds(int *p_sock_pollfd_idx, int *ptimeout)
 	}
 }
 
-const struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
+const struct node_hdr *db_fetch(const char *db_name, size_t *size)
 {
-	struct xs_tdb_record_hdr *hdr;
+	struct node_hdr *hdr;
 
 	hdr = hashtable_search(nodes, db_name);
 	if (!hdr) {
@@ -565,7 +565,7 @@ const struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
 		return NULL;
 	}
 
-	*size = sizeof(*hdr) + hdr->num_perms * sizeof(hdr->perms[0]) +
+	*size = sizeof(*hdr) + hdr->num_perms * sizeof(struct xs_permissions) +
 		hdr->datalen + hdr->childlen;
 
 	trace_tdb("read %s size %zu\n", db_name, *size + strlen(db_name));
@@ -573,10 +573,15 @@ const struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
 	return hdr;
 }
 
+static struct xs_permissions *perms_from_node_hdr(const struct node_hdr *hdr)
+{
+	return (struct xs_permissions *)(hdr + 1);
+}
+
 static void get_acc_data(const char *name, struct node_account_data *acc)
 {
 	size_t size;
-	const struct xs_tdb_record_hdr *hdr;
+	const struct node_hdr *hdr;
 
 	if (acc->memory < 0) {
 		hdr = db_fetch(name, &size);
@@ -585,7 +590,7 @@ static void get_acc_data(const char *name, struct node_account_data *acc)
 			acc->memory = 0;
 		} else {
 			acc->memory = size;
-			acc->domid = hdr->perms[0].id;
+			acc->domid = perms_from_node_hdr(hdr)->id;
 		}
 	}
 }
@@ -606,7 +611,7 @@ int db_write(struct connection *conn, const char *db_name, const void *data,
 	     size_t size, struct node_account_data *acc,
 	     enum write_node_mode mode, bool no_quota_check)
 {
-	const struct xs_tdb_record_hdr *hdr = data;
+	const struct node_hdr *hdr = data;
 	struct node_account_data old_acc = {};
 	unsigned int old_domid, new_domid;
 	size_t name_len = strlen(db_name);
@@ -620,7 +625,7 @@ int db_write(struct connection *conn, const char *db_name, const void *data,
 
 	get_acc_data(db_name, &old_acc);
 	old_domid = get_acc_domid(conn, db_name, old_acc.domid);
-	new_domid = get_acc_domid(conn, db_name, hdr->perms[0].id);
+	new_domid = get_acc_domid(conn, db_name, perms_from_node_hdr(hdr)->id);
 
 	/*
 	 * Don't check for ENOENT, as we want to be able to switch orphaned
@@ -661,7 +666,7 @@ int db_write(struct connection *conn, const char *db_name, const void *data,
 
 	if (acc) {
 		/* Don't use new_domid, as it might be a transaction node. */
-		acc->domid = hdr->perms[0].id;
+		acc->domid = perms_from_node_hdr(hdr)->id;
 		acc->memory = size;
 	}
 
@@ -699,7 +704,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 		       const char *name)
 {
 	size_t size;
-	const struct xs_tdb_record_hdr *hdr;
+	const struct node_hdr *hdr;
 	struct node *node;
 	const char *db_name;
 	int err;
@@ -733,12 +738,12 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	node->perms.num = hdr->num_perms;
 	node->datalen = hdr->datalen;
 	node->childlen = hdr->childlen;
-	node->acc.domid = hdr->perms[0].id;
+	node->acc.domid = perms_from_node_hdr(hdr)->id;
 	node->acc.memory = size;
 
 	/* Copy node data to new memory area, starting with permissions. */
 	size -= sizeof(*hdr);
-	node->perms.p = talloc_memdup(node, hdr->perms, size);
+	node->perms.p = talloc_memdup(node, perms_from_node_hdr(hdr), size);
 	if (node->perms.p == NULL) {
 		errno = ENOMEM;
 		goto error;
@@ -785,7 +790,7 @@ int write_node_raw(struct connection *conn, const char *db_name,
 	void *data;
 	size_t size;
 	void *p;
-	struct xs_tdb_record_hdr *hdr;
+	struct node_hdr *hdr;
 
 	if (domain_adjust_node_perms(node))
 		return errno;
@@ -812,9 +817,9 @@ int write_node_raw(struct connection *conn, const char *db_name,
 	hdr->datalen = node->datalen;
 	hdr->childlen = node->childlen;
 
-	memcpy(hdr->perms, node->perms.p,
-	       node->perms.num * sizeof(*node->perms.p));
-	p = hdr->perms + node->perms.num;
+	p = perms_from_node_hdr(hdr);
+	memcpy(p, node->perms.p, node->perms.num * sizeof(*node->perms.p));
+	p += node->perms.num * sizeof(*node->perms.p);
 	memcpy(p, node->data, node->datalen);
 	p += node->datalen;
 	memcpy(p, node->children, node->childlen);
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 6d1578ce97..c965709090 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -168,6 +168,24 @@ struct connection
 };
 extern struct list_head connections;
 
+/*
+ * Header of the node record in the data base.
+ * In the data base the memory of the node is a single memory chunk with the
+ * following format:
+ * struct {
+ *     node_hdr hdr;
+ *     struct xs_permissions perms[hdr.num_perms];
+ *     char data[hdr.datalen];
+ *     char children[hdr.childlen];
+ * };
+ */
+struct node_hdr {
+	uint64_t generation;
+	uint16_t num_perms;
+	uint16_t datalen;
+	uint32_t childlen;
+};
+
 struct node_perms {
 	unsigned int num;
 	struct xs_permissions *p;
@@ -362,7 +380,7 @@ extern xengnttab_handle **xgt_handle;
 int remember_string(struct hashtable *hash, const char *str);
 
 /* Data base access functions. */
-const struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size);
+const struct node_hdr *db_fetch(const char *db_name, size_t *size);
 int db_write(struct connection *conn, const char *db_name, const void *data,
 	     size_t size, struct node_account_data *acc,
 	     enum write_node_mode mode, bool no_quota_check);
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index a90283dcc5..9ca73b9874 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -357,7 +357,7 @@ static int finalize_transaction(struct connection *conn,
 {
 	struct accessed_node *i, *n;
 	size_t size;
-	const struct xs_tdb_record_hdr *hdr;
+	const struct node_hdr *hdr;
 	uint64_t gen;
 
 	list_for_each_entry_safe(i, n, &trans->accessed, list) {
@@ -394,12 +394,12 @@ static int finalize_transaction(struct connection *conn,
 				 * generation count.
 				 */
 				enum write_node_mode mode;
-				struct xs_tdb_record_hdr *own;
+				struct node_hdr *own;
 
 				talloc_increase_ref_count(hdr);
 				db_delete(conn, i->trans_name, NULL);
 
-				own = (struct xs_tdb_record_hdr *)hdr;
+				own = (struct node_hdr *)hdr;
 				own->generation = ++generation;
 				mode = (i->generation == NO_GENERATION)
 				       ? NODE_CREATE : NODE_MODIFY;
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:07:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:07:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568753.888678 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtPU-0006z8-2m; Mon, 24 Jul 2023 11:07:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568753.888678; Mon, 24 Jul 2023 11:07:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtPT-0006yt-UR; Mon, 24 Jul 2023 11:07:27 +0000
Received: by outflank-mailman (input) for mailman id 568753;
 Mon, 24 Jul 2023 11:07:26 +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 <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtN7-0008WC-O3
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:05:01 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ee780650-2a11-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 13:05:00 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id C40F01FDF0;
 Mon, 24 Jul 2023 11:04:59 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 973BA13476;
 Mon, 24 Jul 2023 11:04:59 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id lvtGI9tavmR+YgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:04:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ee780650-2a11-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196699; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=9aPawA5ESo5CRMIgOFiPZjmhXxpcDENIO0dImei+Tbo=;
	b=MOWePWqF3Qw+uHN0dIhCwibDKqjlcE2Xt2ucz5KA96XZstUbGtqdSW04vakXkOhyBwirwB
	/tiVphEvE9PeTZyDLm0TF3HKMIPK8GzHWakj8DFL41y7h4M2ruQ/C6Dc8dTTWlU1ZN+rOH
	R4xM3ZTgbox+vNfJwveEgxDSvh32HkY=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 23/25] tools/xenstore: merge is_valid_nodename() into canonicalize()
Date: Mon, 24 Jul 2023 13:02:45 +0200
Message-Id: <20230724110247.10520-24-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Today is_valid_nodename() is always called directly after calling
canonicalize(), with the exception of do_unwatch(), where the call
is missing (which is not correct, but results just in a wrong error
reason being returned).

Merge is_valid_nodename() into canonicalize(). While at it merge
valid_chars() into it, too.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V3:
- new patch
---
 tools/xenstore/xenstored_core.c  | 89 ++++++++++++++------------------
 tools/xenstore/xenstored_core.h  |  6 +--
 tools/xenstore/xenstored_watch.c | 16 ++----
 3 files changed, 45 insertions(+), 66 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index ea5a1a9cce..ec20bc042d 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1210,42 +1210,6 @@ void send_ack(struct connection *conn, enum xsd_sockmsg_type type)
 	send_reply(conn, type, "OK", sizeof("OK"));
 }
 
-static bool valid_chars(const char *node)
-{
-	/* Nodes can have lots of crap. */
-	return (strspn(node, 
-		       "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-		       "abcdefghijklmnopqrstuvwxyz"
-		       "0123456789-/_@") == strlen(node));
-}
-
-bool is_valid_nodename(const struct connection *conn, const char *node,
-		       bool allow_special)
-{
-	int local_off = 0;
-	unsigned int domid;
-
-	/* Must start in / or - if special nodes are allowed - in @. */
-	if (!strstarts(node, "/") && (!allow_special || !strstarts(node, "@")))
-		return false;
-
-	/* Cannot end in / (unless it's just "/"). */
-	if (strends(node, "/") && !streq(node, "/"))
-		return false;
-
-	/* No double //. */
-	if (strstr(node, "//"))
-		return false;
-
-	if (sscanf(node, "/local/domain/%5u/%n", &domid, &local_off) != 1)
-		local_off = 0;
-
-	if (domain_max_chk(conn, ACC_PATHLEN, strlen(node) - local_off))
-		return false;
-
-	return valid_chars(node);
-}
-
 /* We expect one arg in the input: return NULL otherwise.
  * The payload must contain exactly one nul, at the end.
  */
@@ -1279,16 +1243,46 @@ static char *perms_to_strings(const void *ctx, const struct node_perms *perms,
 }
 
 const char *canonicalize(struct connection *conn, const void *ctx,
-			 const char *node)
+			 const char *node, bool allow_special)
 {
-	const char *prefix;
+	char *name;
+	int local_off = 0;
+	unsigned int domid;
 
-	if (!node || (node[0] == '/') || (node[0] == '@'))
-		return node;
-	prefix = get_implicit_path(conn);
-	if (prefix)
-		return talloc_asprintf(ctx, "%s/%s", prefix, node);
-	return node;
+	errno = EINVAL;
+	if (!node)
+		return NULL;
+
+	if (strspn(node, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+			 "0123456789-/_@") != strlen(node))
+		return NULL;
+
+	if (node[0] == '@' && !allow_special)
+		return NULL;
+
+	if (node[0] != '/' && node[0] != '@') {
+		name = talloc_asprintf(ctx, "%s/%s", get_implicit_path(conn),
+				       node);
+		if (!name)
+			return NULL;
+	} else
+		name = (char *)node;
+
+	/* Cannot end in / (unless it's just "/"). */
+	if (strends(name, "/") && !streq(name, "/"))
+		return NULL;
+
+	/* No double //. */
+	if (strstr(name, "//"))
+		return NULL;
+
+	if (sscanf(name, "/local/domain/%5u/%n", &domid, &local_off) != 1)
+		local_off = 0;
+
+	if (domain_max_chk(conn, ACC_PATHLEN, strlen(name) - local_off))
+		return NULL;
+
+	return name;
 }
 
 static struct node *get_node_canonicalized(struct connection *conn,
@@ -1302,13 +1296,10 @@ static struct node *get_node_canonicalized(struct connection *conn,
 
 	if (!canonical_name)
 		canonical_name = &tmp_name;
-	*canonical_name = canonicalize(conn, ctx, name);
+	*canonical_name = canonicalize(conn, ctx, name, allow_special);
 	if (!*canonical_name)
 		return NULL;
-	if (!is_valid_nodename(conn, *canonical_name, allow_special)) {
-		errno = EINVAL;
-		return NULL;
-	}
+
 	return get_node(conn, ctx, *canonical_name, perm);
 }
 
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index f3a83efce8..ec1d6aac27 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -241,7 +241,7 @@ void send_ack(struct connection *conn, enum xsd_sockmsg_type type);
 
 /* Canonicalize this path if possible. */
 const char *canonicalize(struct connection *conn, const void *ctx,
-			 const char *node);
+			 const char *node, bool allow_special);
 
 /* Get access permissions. */
 unsigned int perm_for_conn(struct connection *conn,
@@ -294,10 +294,6 @@ struct connection *get_connection_by_id(unsigned int conn_id);
 void check_store(void);
 void corrupt(struct connection *conn, const char *fmt, ...);
 
-/* Is this a valid node name? */
-bool is_valid_nodename(const struct connection *conn, const char *node,
-		       bool allow_special);
-
 /* Get name of parent node. */
 char *get_parent(const void *ctx, const char *node);
 
diff --git a/tools/xenstore/xenstored_watch.c b/tools/xenstore/xenstored_watch.c
index 2662a3fa49..247d37e80f 100644
--- a/tools/xenstore/xenstored_watch.c
+++ b/tools/xenstore/xenstored_watch.c
@@ -167,17 +167,9 @@ static int check_watch_path(struct connection *conn, const void *ctx,
 			    const char **path, bool *relative)
 {
 	*relative = !strstarts(*path, "/") && !strstarts(*path, "@");
-	*path = canonicalize(conn, ctx, *path);
-	if (!*path)
-		return errno;
-	if (!is_valid_nodename(conn, *path, true))
-		goto inval;
-
-	return 0;
+	*path = canonicalize(conn, ctx, *path, true);
 
- inval:
-	errno = EINVAL;
-	return errno;
+	return *path ? 0 : errno;
 }
 
 static struct watch *add_watch(struct connection *conn, const char *path,
@@ -261,9 +253,9 @@ int do_unwatch(const void *ctx, struct connection *conn,
 	if (get_strings(in, vec, ARRAY_SIZE(vec)) != ARRAY_SIZE(vec))
 		return EINVAL;
 
-	node = canonicalize(conn, ctx, vec[0]);
+	node = canonicalize(conn, ctx, vec[0], true);
 	if (!node)
-		return ENOMEM;
+		return errno;
 	list_for_each_entry(watch, &conn->watches, list) {
 		if (streq(watch->node, node) && streq(watch->token, vec[1])) {
 			list_del(&watch->list);
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:07:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:07:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568754.888693 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtPg-0007gf-8W; Mon, 24 Jul 2023 11:07:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568754.888693; Mon, 24 Jul 2023 11:07:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtPg-0007g3-5F; Mon, 24 Jul 2023 11:07:40 +0000
Received: by outflank-mailman (input) for mailman id 568754;
 Mon, 24 Jul 2023 11:07:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtMN-0000KR-QI
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:04:15 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [2001:67c:2178:6::1c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d3c20f8b-2a11-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:04:15 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 0111522988;
 Mon, 24 Jul 2023 11:04:15 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B3DDC13476;
 Mon, 24 Jul 2023 11:04:14 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id L474Ka5avmT9YQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:04:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d3c20f8b-2a11-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196655; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=chevwYuBSR7V/TZ3mWJmpGZB7vbjU7lZFq1Lv4K/AXA=;
	b=YZYVabAiVdDjvCZJmBZB5BX/DuaLdGTjVphEZ2IKaqs7qdf4zaR092HvBx9z4v9LttF6vA
	qb417PToMB/XOz8b1R85JC8dhfnBBUVseldkoLyXnly+pygjRGdNErFnstIZoKdACjlFLS
	cHJiD8tT7v2UG4FOxDMpz8N5jRPWopg=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 15/25] tools/xenstore: make data parameter of db_write() const
Date: Mon, 24 Jul 2023 13:02:37 +0200
Message-Id: <20230724110247.10520-16-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

db_write() doesn't change the data written to the data base, so the
data parameter can be const.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V3:
- new patch
---
 tools/xenstore/xenstored_core.c | 4 ++--
 tools/xenstore/xenstored_core.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index a08962c3ea..9f88914149 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -611,11 +611,11 @@ static unsigned int get_acc_domid(struct connection *conn, const char *name,
 	return (!conn || name[0] == '/' || name[0] == '@') ? domid : conn->id;
 }
 
-int db_write(struct connection *conn, const char *db_name, void *data,
+int db_write(struct connection *conn, const char *db_name, const void *data,
 	     size_t size, struct node_account_data *acc,
 	     enum write_node_mode mode, bool no_quota_check)
 {
-	struct xs_tdb_record_hdr *hdr = data;
+	const struct xs_tdb_record_hdr *hdr = data;
 	struct node_account_data old_acc = {};
 	unsigned int old_domid, new_domid;
 	size_t name_len = strlen(db_name);
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index e1aeb4aecd..1aa3cc0936 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -363,7 +363,7 @@ int remember_string(struct hashtable *hash, const char *str);
 
 /* Data base access functions. */
 struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size);
-int db_write(struct connection *conn, const char *db_name, void *data,
+int db_write(struct connection *conn, const char *db_name, const void *data,
 	     size_t size, struct node_account_data *acc,
 	     enum write_node_mode mode, bool no_quota_check);
 void db_delete(struct connection *conn, const char *name,
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:07:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:07:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568757.888703 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtPv-0008P9-GN; Mon, 24 Jul 2023 11:07:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568757.888703; Mon, 24 Jul 2023 11:07:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtPv-0008P2-DY; Mon, 24 Jul 2023 11:07:55 +0000
Received: by outflank-mailman (input) for mailman id 568757;
 Mon, 24 Jul 2023 11:07:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtMf-0000KR-0n
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:04:33 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ddbf1902-2a11-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:04:31 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id B87651FDF0;
 Mon, 24 Jul 2023 11:04:31 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8C1A513476;
 Mon, 24 Jul 2023 11:04:31 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id K//TIL9avmQrYgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:04:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ddbf1902-2a11-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196671; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=HP5J6XIp0DWqkQx8z5cq/ygHh6Oytu7p/EOreeJK8xE=;
	b=MenFa1wuLALtZWgUlCFQ57wC3MAWua2vaPS0StOYNTAJQHWhCwQyEYIhFkKmYaP+m8abSQ
	HKa8CsnytuKkKCYjLD6mRWn0yCXxNfIKmV7UWWqnUozNqA5YdoJU4bOqlnFe+AKlDh9uUc
	Z4qnS6c6+YYbLAYjtb+NMiCGOiJag2g=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 18/25] tools/xenstore: don't use struct node_perms in struct node
Date: Mon, 24 Jul 2023 13:02:40 +0200
Message-Id: <20230724110247.10520-19-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Open code struct node_perms in struct node in order to prepare using
struct node_hdr in struct node.

Add two helpers to transfer permissions between struct node and struct
node_perms.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- new patch
---
 tools/xenstore/xenstored_core.c        | 76 ++++++++++++++------------
 tools/xenstore/xenstored_core.h        | 21 ++++++-
 tools/xenstore/xenstored_domain.c      | 13 ++---
 tools/xenstore/xenstored_transaction.c |  8 +--
 tools/xenstore/xenstored_watch.c       |  7 ++-
 5 files changed, 75 insertions(+), 50 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 86b7c9bf36..c72fc0c725 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -735,7 +735,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 
 	/* Datalen, childlen, number of permissions */
 	node->generation = hdr->generation;
-	node->perms.num = hdr->num_perms;
+	node->num_perms = hdr->num_perms;
 	node->datalen = hdr->datalen;
 	node->childlen = hdr->childlen;
 	node->acc.domid = perms_from_node_hdr(hdr)->id;
@@ -743,8 +743,8 @@ struct node *read_node(struct connection *conn, const void *ctx,
 
 	/* Copy node data to new memory area, starting with permissions. */
 	size -= sizeof(*hdr);
-	node->perms.p = talloc_memdup(node, perms_from_node_hdr(hdr), size);
-	if (node->perms.p == NULL) {
+	node->perms = talloc_memdup(node, perms_from_node_hdr(hdr), size);
+	if (node->perms == NULL) {
 		errno = ENOMEM;
 		goto error;
 	}
@@ -757,7 +757,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 		node->acc.memory = 0;
 
 	/* Data is binary blob (usually ascii, no nul). */
-	node->data = node->perms.p + hdr->num_perms;
+	node->data = node->perms + hdr->num_perms;
 	/* Children is strings, nul separated. */
 	node->children = node->data + node->datalen;
 
@@ -796,7 +796,7 @@ int write_node_raw(struct connection *conn, const char *db_name,
 		return errno;
 
 	size = sizeof(*hdr)
-		+ node->perms.num * sizeof(node->perms.p[0])
+		+ node->num_perms * sizeof(node->perms[0])
 		+ node->datalen + node->childlen;
 
 	/* Call domain_max_chk() in any case in order to record max values. */
@@ -813,13 +813,13 @@ int write_node_raw(struct connection *conn, const char *db_name,
 
 	hdr = data;
 	hdr->generation = node->generation;
-	hdr->num_perms = node->perms.num;
+	hdr->num_perms = node->num_perms;
 	hdr->datalen = node->datalen;
 	hdr->childlen = node->childlen;
 
 	p = perms_from_node_hdr(hdr);
-	memcpy(p, node->perms.p, node->perms.num * sizeof(*node->perms.p));
-	p += node->perms.num * sizeof(*node->perms.p);
+	memcpy(p, node->perms, node->num_perms * sizeof(*node->perms));
+	p += node->num_perms * sizeof(*node->perms);
 	memcpy(p, node->data, node->datalen);
 	p += node->datalen;
 	memcpy(p, node->children, node->childlen);
@@ -900,6 +900,7 @@ static int ask_parents(struct connection *conn, const void *ctx,
 		       const char *name, unsigned int *perm)
 {
 	struct node *node;
+	struct node_perms perms;
 
 	do {
 		name = get_parent(ctx, name);
@@ -919,7 +920,8 @@ static int ask_parents(struct connection *conn, const void *ctx,
 		return 0;
 	}
 
-	*perm = perm_for_conn(conn, &node->perms);
+	node_to_node_perms(node, &perms);
+	*perm = perm_for_conn(conn, &perms);
 	return 0;
 }
 
@@ -956,11 +958,13 @@ static struct node *get_node(struct connection *conn,
 			     unsigned int perm)
 {
 	struct node *node;
+	struct node_perms perms;
 
 	node = read_node(conn, ctx, name);
 	/* If we don't have permission, we don't have node. */
 	if (node) {
-		if ((perm_for_conn(conn, &node->perms) & perm) != perm) {
+		node_to_node_perms(node, &perms);
+		if ((perm_for_conn(conn, &perms) & perm) != perm) {
 			errno = EACCES;
 			node = NULL;
 		}
@@ -1434,14 +1438,14 @@ static struct node *construct_node(struct connection *conn, const void *ctx,
 		node->name = talloc_steal(node, names[levels - 1]);
 
 		/* Inherit permissions, unpriv domains own what they create. */
-		node->perms.num = parent->perms.num;
-		node->perms.p = talloc_memdup(node, parent->perms.p,
-					      node->perms.num *
-					      sizeof(*node->perms.p));
-		if (!node->perms.p)
+		node->num_perms = parent->num_perms;
+		node->perms = talloc_memdup(node, parent->perms,
+					    node->num_perms *
+					    sizeof(*node->perms));
+		if (!node->perms)
 			goto nomem;
 		if (domain_is_unprivileged(conn))
-			node->perms.p[0].id = conn->id;
+			node->perms[0].id = conn->id;
 
 		/* No children, no data */
 		node->children = node->data = NULL;
@@ -1764,12 +1768,14 @@ static int do_get_perms(const void *ctx, struct connection *conn,
 	struct node *node;
 	char *strings;
 	unsigned int len;
+	struct node_perms perms;
 
 	node = get_spec_node(conn, ctx, onearg(in), NULL, XS_PERM_READ);
 	if (!node)
 		return errno;
 
-	strings = perms_to_strings(node, &node->perms, &len);
+	node_to_node_perms(node, &perms);
+	strings = perms_to_strings(node, &perms, &len);
 	if (!strings)
 		return errno;
 
@@ -1818,10 +1824,10 @@ static int do_set_perms(const void *ctx, struct connection *conn,
 	    perms.p[0].id != get_node_owner(node))
 		return EPERM;
 
-	old_perms = node->perms;
+	node_to_node_perms(node, &old_perms);
 	if (domain_nbentry_dec(conn, get_node_owner(node)))
 		return ENOMEM;
-	node->perms = perms;
+	node_perms_to_node(&perms, node);
 	if (domain_nbentry_inc(conn, get_node_owner(node)))
 		return ENOMEM;
 
@@ -2333,8 +2339,8 @@ static void manual_node(const char *name, const char *child)
 		barf_perror("Could not allocate initial node %s", name);
 
 	node->name = name;
-	node->perms.p = &perms;
-	node->perms.num = 1;
+	node->perms = &perms;
+	node->num_perms = 1;
 	node->children = (char *)child;
 	if (child)
 		node->childlen = strlen(child) + 1;
@@ -3205,10 +3211,10 @@ static int dump_state_node(const void *ctx, struct connection *conn,
 	sn.conn_id = 0;
 	sn.ta_id = 0;
 	sn.ta_access = 0;
-	sn.perm_n = node->perms.num;
+	sn.perm_n = node->num_perms;
 	sn.path_len = pathlen;
 	sn.data_len = node->datalen;
-	head.length += node->perms.num * sizeof(*sn.perms);
+	head.length += node->num_perms * sizeof(*sn.perms);
 	head.length += pathlen;
 	head.length += node->datalen;
 	head.length = ROUNDUP(head.length, 3);
@@ -3218,7 +3224,7 @@ static int dump_state_node(const void *ctx, struct connection *conn,
 	if (fwrite(&sn, sizeof(sn), 1, fp) != 1)
 		return dump_state_node_err(data, "Dump node state error");
 
-	ret = dump_state_node_perms(fp, node->perms.p, node->perms.num);
+	ret = dump_state_node_perms(fp, node->perms, node->num_perms);
 	if (ret)
 		return dump_state_node_err(data, ret);
 
@@ -3415,29 +3421,29 @@ void read_state_node(const void *ctx, const void *state)
 	node->data = name + sn->path_len;
 	node->childlen = 0;
 	node->children = NULL;
-	node->perms.num = sn->perm_n;
-	node->perms.p = talloc_array(node, struct xs_permissions,
-				     node->perms.num);
-	if (!node->perms.p)
+	node->num_perms = sn->perm_n;
+	node->perms = talloc_array(node, struct xs_permissions,
+				   node->num_perms);
+	if (!node->perms)
 		barf("allocation error restoring node");
-	for (i = 0; i < node->perms.num; i++) {
+	for (i = 0; i < node->num_perms; i++) {
 		switch (sn->perms[i].access) {
 		case 'r':
-			node->perms.p[i].perms = XS_PERM_READ;
+			node->perms[i].perms = XS_PERM_READ;
 			break;
 		case 'w':
-			node->perms.p[i].perms = XS_PERM_WRITE;
+			node->perms[i].perms = XS_PERM_WRITE;
 			break;
 		case 'b':
-			node->perms.p[i].perms = XS_PERM_READ | XS_PERM_WRITE;
+			node->perms[i].perms = XS_PERM_READ | XS_PERM_WRITE;
 			break;
 		default:
-			node->perms.p[i].perms = XS_PERM_NONE;
+			node->perms[i].perms = XS_PERM_NONE;
 			break;
 		}
 		if (sn->perms[i].flags & XS_STATE_NODE_PERM_IGNORE)
-			node->perms.p[i].perms |= XS_PERM_IGNORE;
-		node->perms.p[i].id = sn->perms[i].domid;
+			node->perms[i].perms |= XS_PERM_IGNORE;
+		node->perms[i].id = sn->perms[i].domid;
 	}
 
 	if (!strstarts(name, "@")) {
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index c965709090..9cb4c2f3eb 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -209,7 +209,8 @@ struct node {
 #define NO_GENERATION ~((uint64_t)0)
 
 	/* Permissions. */
-	struct node_perms perms;
+	unsigned int num_perms;
+	struct xs_permissions *perms;
 
 	/* Contents. */
 	unsigned int datalen;
@@ -251,7 +252,23 @@ unsigned int perm_for_conn(struct connection *conn,
 /* Get owner of a node. */
 static inline unsigned int get_node_owner(const struct node *node)
 {
-	return node->perms.p[0].id;
+	return node->perms[0].id;
+}
+
+/* Transfer permissions from node to struct node_perms. */
+static inline void node_to_node_perms(const struct node *node,
+				      struct node_perms *perms)
+{
+	perms->num = node->num_perms;
+	perms->p = node->perms;
+}
+
+/* Transfer permissions from struct node_perms to node. */
+static inline void node_perms_to_node(const struct node_perms *perms,
+				      struct node *node)
+{
+	node->num_perms = perms->num;
+	node->perms = perms->p;
 }
 
 /* Write a node to the data base. */
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index 10d2280f84..1ba73d9db2 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -513,12 +513,12 @@ static int domain_tree_remove_sub(const void *ctx, struct connection *conn,
 	struct domain *domain = arg;
 	int ret = WALK_TREE_OK;
 
-	if (node->perms.p[0].id != domain->domid)
+	if (node->perms[0].id != domain->domid)
 		return WALK_TREE_OK;
 
 	if (keep_orphans) {
 		domain_nbentry_dec(NULL, domain->domid);
-		node->perms.p[0].id = priv_domid;
+		node->perms[0].id = priv_domid;
 		node->acc.memory = 0;
 		domain_nbentry_inc(NULL, priv_domid);
 		if (write_node_raw(NULL, node->name, node, NODE_MODIFY, true)) {
@@ -1335,12 +1335,11 @@ int domain_adjust_node_perms(struct node *node)
 {
 	unsigned int i;
 
-	for (i = 1; i < node->perms.num; i++) {
-		if (node->perms.p[i].perms & XS_PERM_IGNORE)
+	for (i = 1; i < node->num_perms; i++) {
+		if (node->perms[i].perms & XS_PERM_IGNORE)
 			continue;
-		if (!chk_domain_generation(node->perms.p[i].id,
-					   node->generation))
-			node->perms.p[i].perms |= XS_PERM_IGNORE;
+		if (!chk_domain_generation(node->perms[i].id, node->generation))
+			node->perms[i].perms |= XS_PERM_IGNORE;
 	}
 
 	return 0;
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 9ca73b9874..213a2c436c 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -259,13 +259,13 @@ int access_node(struct connection *conn, struct node *node,
 		if (!i->trans_name)
 			goto nomem;
 		i->node = strchr(i->trans_name, '/') + 1;
-		if (node->generation != NO_GENERATION && node->perms.num) {
+		if (node->generation != NO_GENERATION && node->num_perms) {
 			i->perms.p = talloc_array(i, struct xs_permissions,
-						  node->perms.num);
+						  node->num_perms);
 			if (!i->perms.p)
 				goto nomem;
-			i->perms.num = node->perms.num;
-			memcpy(i->perms.p, node->perms.p,
+			i->perms.num = node->num_perms;
+			memcpy(i->perms.p, node->perms,
 			       i->perms.num * sizeof(*i->perms.p));
 		}
 
diff --git a/tools/xenstore/xenstored_watch.c b/tools/xenstore/xenstored_watch.c
index fefbf56ab2..c161385f89 100644
--- a/tools/xenstore/xenstored_watch.c
+++ b/tools/xenstore/xenstored_watch.c
@@ -79,6 +79,7 @@ static bool watch_permitted(struct connection *conn, const void *ctx,
 	unsigned int perm;
 	struct node *parent;
 	char *parent_name;
+	struct node_perms node_perms;
 
 	if (perms) {
 		perm = perm_for_conn(conn, perms);
@@ -92,7 +93,8 @@ static bool watch_permitted(struct connection *conn, const void *ctx,
 			return false;
 	}
 
-	perm = perm_for_conn(conn, &node->perms);
+	node_to_node_perms(node, &node_perms);
+	perm = perm_for_conn(conn, &node_perms);
 	if (perm & XS_PERM_READ)
 		return true;
 
@@ -106,7 +108,8 @@ static bool watch_permitted(struct connection *conn, const void *ctx,
 			return false;
 	}
 
-	perm = perm_for_conn(conn, &parent->perms);
+	node_to_node_perms(parent, &node_perms);
+	perm = perm_for_conn(conn, &node_perms);
 
 	return perm & XS_PERM_READ;
 }
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:08:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:08:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568760.888712 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQ1-0000LQ-RN; Mon, 24 Jul 2023 11:08:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568760.888712; Mon, 24 Jul 2023 11:08:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQ1-0000LJ-OU; Mon, 24 Jul 2023 11:08:01 +0000
Received: by outflank-mailman (input) for mailman id 568760;
 Mon, 24 Jul 2023 11:08:00 +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 <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtLl-0008WC-0G
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:03:37 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bc13b991-2a11-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 13:03:35 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 3F31522971;
 Mon, 24 Jul 2023 11:03:35 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1404513476;
 Mon, 24 Jul 2023 11:03:35 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 5EluA4davmSdYQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:03:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bc13b991-2a11-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196615; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=siTlKvWMR/RT4S0FnCgR+ZpOvEYZZwpHnARxR3tmw/4=;
	b=GhkPau+GxIQNm74gzCxgvTBrLWE2MgNHxieKxWzLiPjFgsNIFEOgi7RytaTF7pPUsSfRza
	DCLsvzH7D+ukWicqelez/plpzkItVdogW46c3rM6PBa4p9wCdzdgJCRobpbNsqNz51o33/
	ETy0NnKk3qhcCynU9B/BCCLdpaAS/hk=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 08/25] tools/xenstore: make hashtable key and value parameters const
Date: Mon, 24 Jul 2023 13:02:30 +0200
Message-Id: <20230724110247.10520-9-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The key and value are never modified by hashtable code, so they should
be marked as const.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V3:
- make value const, too.
---
 tools/xenstore/hashtable.c | 7 ++++---
 tools/xenstore/hashtable.h | 4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c
index 11f6bf8f15..670dc01003 100644
--- a/tools/xenstore/hashtable.c
+++ b/tools/xenstore/hashtable.c
@@ -11,7 +11,8 @@
 
 struct entry
 {
-    void *k, *v;
+    const void *k;
+    void *v;
     unsigned int h;
     struct entry *next;
 };
@@ -140,7 +141,7 @@ static int hashtable_expand(struct hashtable *h)
     return 0;
 }
 
-int hashtable_add(struct hashtable *h, void *k, void *v)
+int hashtable_add(struct hashtable *h, const void *k, const void *v)
 {
     /* This method allows duplicate keys - but they shouldn't be used */
     unsigned int index;
@@ -164,7 +165,7 @@ int hashtable_add(struct hashtable *h, void *k, void *v)
     e->k = k;
     if (h->flags & HASHTABLE_FREE_KEY)
         talloc_steal(e, k);
-    e->v = v;
+    e->v = (void *)v;
     if (h->flags & HASHTABLE_FREE_VALUE)
         talloc_steal(e, v);
     e->next = h->table[index];
diff --git a/tools/xenstore/hashtable.h b/tools/xenstore/hashtable.h
index 5a2cc4a4be..1da3af2648 100644
--- a/tools/xenstore/hashtable.h
+++ b/tools/xenstore/hashtable.h
@@ -48,8 +48,8 @@ create_hashtable(const void *ctx, const char *name,
  * If in doubt, remove before insert.
  */
 
-int 
-hashtable_add(struct hashtable *h, void *k, void *v);
+int
+hashtable_add(struct hashtable *h, const void *k, const void *v);
 
 /*****************************************************************************
  * hashtable_search
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:08:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:08:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568761.888723 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQ5-0000eX-4A; Mon, 24 Jul 2023 11:08:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568761.888723; Mon, 24 Jul 2023 11:08:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQ4-0000eM-WD; Mon, 24 Jul 2023 11:08:05 +0000
Received: by outflank-mailman (input) for mailman id 568761;
 Mon, 24 Jul 2023 11:08:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtMH-0000KR-Vb
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:04:09 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d05cbdf6-2a11-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:04:09 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 45ABF20697;
 Mon, 24 Jul 2023 11:04:09 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0C7D713476;
 Mon, 24 Jul 2023 11:04:09 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id TaAkAalavmTxYQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:04:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d05cbdf6-2a11-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196649; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=ybmSsNxeUNBDfbwoafuFdaqkBsZjOSyQ+1w8Dv8MPBA=;
	b=A/+QxO4eCzEmjzHMxT+ihNVdWzxr23vis3Q0qbpNKOW1152yipSC9ZR4tXOG8BWTybH0aY
	9nrT9YRxvzWTGdXrw/DW0rYz8g8aZgcrEFmTjFcRtaG5ChKRzaWJ4z53RKkeFVOrvBxZOm
	5CUF2So2ScZF3HnjW2o241v+gK5OiaU=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 14/25] tools/xenstore: change talloc_free() to take a const pointer
Date: Mon, 24 Jul 2023 13:02:36 +0200
Message-Id: <20230724110247.10520-15-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

With talloc_free() and related functions not taking a ponter to const
it is tedious to use the const attribute for talloc()-ed memory in
many cases.

Change the related prototypes to use "const void *" instead of
"void *".

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V3:
- new patch
---
 tools/xenstore/talloc.c | 8 ++++----
 tools/xenstore/talloc.h | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/xenstore/talloc.c b/tools/xenstore/talloc.c
index 23c3a23b19..4f08dbec59 100644
--- a/tools/xenstore/talloc.c
+++ b/tools/xenstore/talloc.c
@@ -319,7 +319,7 @@ static int talloc_unreference(const void *context, const void *ptr)
   remove a specific parent context from a pointer. This is a more
   controlled varient of talloc_free()
 */
-int talloc_unlink(const void *context, void *ptr)
+int talloc_unlink(const void *context, const void *ptr)
 {
 	struct talloc_chunk *tc_p, *new_p;
 	void *new_parent;
@@ -499,7 +499,7 @@ void *talloc_init(const char *fmt, ...)
   should probably not be used in new code. It's in here to keep the talloc
   code consistent across Samba 3 and 4.
 */
-static void talloc_free_children(void *ptr)
+static void talloc_free_children(const void *ptr)
 {
 	struct talloc_chunk *tc;
 
@@ -539,7 +539,7 @@ static void talloc_free_children(void *ptr)
    will not be freed if the ref_count is > 1 or the destructor (if
    any) returns non-zero
 */
-int talloc_free(void *ptr)
+int talloc_free(const void *ptr)
 {
 	int saved_errno = errno;
 	struct talloc_chunk *tc;
@@ -571,7 +571,7 @@ int talloc_free(void *ptr)
 			goto err;
 		}
 		tc->destructor = (talloc_destructor_t)-1;
-		if (d(ptr) == -1) {
+		if (d((void *)ptr) == -1) {
 			tc->destructor = d;
 			goto err;
 		}
diff --git a/tools/xenstore/talloc.h b/tools/xenstore/talloc.h
index 518fcac151..32cee63d4d 100644
--- a/tools/xenstore/talloc.h
+++ b/tools/xenstore/talloc.h
@@ -92,7 +92,7 @@ void *_talloc(const void *context, size_t size);
 void talloc_set_destructor(const void *ptr, int (*destructor)(void *));
 void talloc_increase_ref_count(const void *ptr);
 void *talloc_reference(const void *context, const void *ptr);
-int talloc_unlink(const void *context, void *ptr);
+int talloc_unlink(const void *context, const void *ptr);
 void talloc_set_name(const void *ptr, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
 void talloc_set_name_const(const void *ptr, const char *name);
 void *talloc_named(const void *context, size_t size, 
@@ -103,7 +103,7 @@ void *talloc_check_name(const void *ptr, const char *name);
 void talloc_report_depth(const void *ptr, FILE *f, int depth);
 void *talloc_parent(const void *ptr);
 void *talloc_init(const char *fmt, ...) PRINTF_ATTRIBUTE(1,2);
-int talloc_free(void *ptr);
+int talloc_free(const void *ptr);
 void *_talloc_realloc(const void *context, void *ptr, size_t size, const char *name);
 void *talloc_steal(const void *new_ctx, const void *ptr);
 off_t talloc_total_size(const void *ptr);
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:08:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:08:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568766.888744 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQF-0001UP-Bc; Mon, 24 Jul 2023 11:08:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568766.888744; Mon, 24 Jul 2023 11:08:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQE-0001RH-VV; Mon, 24 Jul 2023 11:08:14 +0000
Received: by outflank-mailman (input) for mailman id 568766;
 Mon, 24 Jul 2023 11:08:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtMT-0000KR-Eq
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:04:21 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d712c6f2-2a11-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:04:20 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 8A28722988;
 Mon, 24 Jul 2023 11:04:20 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5D52213476;
 Mon, 24 Jul 2023 11:04:20 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id o5lqFbRavmQHYgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:04:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d712c6f2-2a11-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196660; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=HAhSQtZ7+yH9+PPmPI+Vq3s5YrV0tpckJJuWvE/UBsg=;
	b=GjH1NJNhqgvJ+tD/UjOJTRHgxTCdUkmTezfUL/GyNM37sXtPZN00PK5Z6iwSH0FduCuBMT
	AwNjyqRLj87xxI8p4kFuXdO+GS7736DSaYuuH1Z49zJTj/eVjBey3xJ4OHtfUOikNgHztY
	YbAk6+ZoeOra1YSlM6rc8+b4/I3kii8=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 16/25] tools/xenstore: move copying of node data out of db_fetch()
Date: Mon, 24 Jul 2023 13:02:38 +0200
Message-Id: <20230724110247.10520-17-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Today the node data is copied in db_fetch() on each data base read in
order to avoid accidental data base modifications when working on a
node.

read_node() is the only caller of db_fetch() which isn't freeing the
returned data area immediately after using it. The other callers don't
modify the returned data, so they don't need the data to be copied.

Move copying of the data into read_node(), resulting in a speedup of
the other callers due to no memory allocation and no copying being
needed anymore.

This allows to let db_fetch() return a pointer to const data.

As db_fetch() can't return any error other than ENOENT now, error
handling for the callers can be simplified.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- new patch
V3:
- modify return type of db_fetch() to return a pointer to const
  (Julien Grall)
- drop stale comment (Julien Grall)
- fix transaction handling
---
 tools/xenstore/xenstored_core.c        | 45 +++++++++++---------------
 tools/xenstore/xenstored_core.h        |  2 +-
 tools/xenstore/xenstored_transaction.c | 23 +++++++++----
 3 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 9f88914149..1f5f118f1c 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -555,10 +555,9 @@ static void initialize_fds(int *p_sock_pollfd_idx, int *ptimeout)
 	}
 }
 
-struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
+const struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
 {
-	const struct xs_tdb_record_hdr *hdr;
-	struct xs_tdb_record_hdr *p;
+	struct xs_tdb_record_hdr *hdr;
 
 	hdr = hashtable_search(nodes, db_name);
 	if (!hdr) {
@@ -569,22 +568,15 @@ struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
 	*size = sizeof(*hdr) + hdr->num_perms * sizeof(hdr->perms[0]) +
 		hdr->datalen + hdr->childlen;
 
-	/* Return a copy, avoiding a potential modification in the DB. */
-	p = talloc_memdup(NULL, hdr, *size);
-	if (!p) {
-		errno = ENOMEM;
-		return NULL;
-	}
-
 	trace_tdb("read %s size %zu\n", db_name, *size + strlen(db_name));
 
-	return p;
+	return hdr;
 }
 
 static void get_acc_data(const char *name, struct node_account_data *acc)
 {
 	size_t size;
-	struct xs_tdb_record_hdr *hdr;
+	const struct xs_tdb_record_hdr *hdr;
 
 	if (acc->memory < 0) {
 		hdr = db_fetch(name, &size);
@@ -595,7 +587,6 @@ static void get_acc_data(const char *name, struct node_account_data *acc)
 			acc->memory = size;
 			acc->domid = hdr->perms[0].id;
 		}
-		talloc_free(hdr);
 	}
 }
 
@@ -708,7 +699,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 		       const char *name)
 {
 	size_t size;
-	struct xs_tdb_record_hdr *hdr;
+	const struct xs_tdb_record_hdr *hdr;
 	struct node *node;
 	const char *db_name;
 	int err;
@@ -729,30 +720,30 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	hdr = db_fetch(db_name, &size);
 
 	if (hdr == NULL) {
-		if (errno == ENOENT) {
-			node->generation = NO_GENERATION;
-			err = access_node(conn, node, NODE_ACCESS_READ, NULL);
-			errno = err ? : ENOENT;
-		} else {
-			log("DB error on read: %s", strerror(errno));
-			errno = EIO;
-		}
+		node->generation = NO_GENERATION;
+		err = access_node(conn, node, NODE_ACCESS_READ, NULL);
+		errno = err ? : ENOENT;
 		goto error;
 	}
 
 	node->parent = NULL;
-	talloc_steal(node, hdr);
 
 	/* Datalen, childlen, number of permissions */
 	node->generation = hdr->generation;
 	node->perms.num = hdr->num_perms;
 	node->datalen = hdr->datalen;
 	node->childlen = hdr->childlen;
-
-	/* Permissions are struct xs_permissions. */
-	node->perms.p = hdr->perms;
-	node->acc.domid = get_node_owner(node);
+	node->acc.domid = hdr->perms[0].id;
 	node->acc.memory = size;
+
+	/* Copy node data to new memory area, starting with permissions. */
+	size -= sizeof(*hdr);
+	node->perms.p = talloc_memdup(node, hdr->perms, size);
+	if (node->perms.p == NULL) {
+		errno = ENOMEM;
+		goto error;
+	}
+
 	if (domain_adjust_node_perms(node))
 		goto error;
 
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 1aa3cc0936..6d1578ce97 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -362,7 +362,7 @@ extern xengnttab_handle **xgt_handle;
 int remember_string(struct hashtable *hash, const char *str);
 
 /* Data base access functions. */
-struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size);
+const struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size);
 int db_write(struct connection *conn, const char *db_name, const void *data,
 	     size_t size, struct node_account_data *acc,
 	     enum write_node_mode mode, bool no_quota_check);
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index fbcea3663e..a90283dcc5 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -357,20 +357,17 @@ static int finalize_transaction(struct connection *conn,
 {
 	struct accessed_node *i, *n;
 	size_t size;
-	struct xs_tdb_record_hdr *hdr;
+	const struct xs_tdb_record_hdr *hdr;
 	uint64_t gen;
 
 	list_for_each_entry_safe(i, n, &trans->accessed, list) {
 		if (i->check_gen) {
 			hdr = db_fetch(i->node, &size);
 			if (!hdr) {
-				if (errno != ENOENT)
-					return errno;
 				gen = NO_GENERATION;
 			} else {
 				gen = hdr->generation;
 			}
-			talloc_free(hdr);
 			if (i->generation != gen)
 				return EAGAIN;
 		}
@@ -388,14 +385,26 @@ static int finalize_transaction(struct connection *conn,
 		if (i->ta_node) {
 			hdr = db_fetch(i->trans_name, &size);
 			if (hdr) {
+				/*
+				 * Delete transaction entry and write it as
+				 * no-TA entry. As we only hold a reference
+				 * to the data, increment its ref count, then
+				 * delete it from the DB. Now we own it and can
+				 * drop the const attribute for changing the
+				 * generation count.
+				 */
 				enum write_node_mode mode;
+				struct xs_tdb_record_hdr *own;
 
-				hdr->generation = ++generation;
+				talloc_increase_ref_count(hdr);
+				db_delete(conn, i->trans_name, NULL);
+
+				own = (struct xs_tdb_record_hdr *)hdr;
+				own->generation = ++generation;
 				mode = (i->generation == NO_GENERATION)
 				       ? NODE_CREATE : NODE_MODIFY;
-				*is_corrupt |= db_write(conn, i->node, hdr,
+				*is_corrupt |= db_write(conn, i->node, own,
 							size, NULL, mode, true);
-				db_delete(conn, i->trans_name, NULL);
 			} else {
 				*is_corrupt = true;
 			}
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:08:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:08:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568767.888749 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQF-0001d1-OZ; Mon, 24 Jul 2023 11:08:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568767.888749; Mon, 24 Jul 2023 11:08:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQF-0001bP-Du; Mon, 24 Jul 2023 11:08:15 +0000
Received: by outflank-mailman (input) for mailman id 568767;
 Mon, 24 Jul 2023 11:08:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtMv-0000KR-Gh
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:04:49 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e7cef7ff-2a11-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:04:48 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 9AE2C22973;
 Mon, 24 Jul 2023 11:04:48 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 62B8713476;
 Mon, 24 Jul 2023 11:04:48 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 2DaxFtBavmRiYgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:04:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e7cef7ff-2a11-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196688; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=tZobPrK7ENIq2LYLKVZ55LBjmihB+bKrO8uvn/+a32A=;
	b=ik3qFlDDMYiRPGNQW0ZOd4kCMuYHHFUQ4x/do2uc6JMSIAWmIDCwEvucRXMYFlvj6h/LJu
	FDxUKOfI+hw+GQ/MilaaUuCt5VKZ/SQki7zTLMcwVAh7F88ZrsJCkA/xYsxVxHwu8tPNTy
	uFUg+X3f9wfpYAU040NoxYK77TkXVjA=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 21/25] tools/xenstore: introduce read_node_nocopy()
Date: Mon, 24 Jul 2023 13:02:43 +0200
Message-Id: <20230724110247.10520-22-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Introduce a read_node() variant returning a pointer to const struct
node, which doesn't do a copy of the node data after retrieval from
the data base.

Call this variant where appropriate.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V3:
- new approach (Julien Grall)
---
 tools/xenstore/xenstored_core.c   | 104 ++++++++++++++++++++++--------
 tools/xenstore/xenstored_core.h   |   2 +
 tools/xenstore/xenstored_domain.c |   4 +-
 tools/xenstore/xenstored_watch.c  |  10 +--
 tools/xenstore/xenstored_watch.h  |   3 +-
 5 files changed, 89 insertions(+), 34 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index ea3d20a372..102be92a43 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -705,11 +705,11 @@ void db_delete(struct connection *conn, const char *name,
  * If it fails, returns NULL and sets errno.
  * Temporary memory allocations will be done with ctx.
  */
-struct node *read_node(struct connection *conn, const void *ctx,
-		       const char *name)
+static struct node *read_node_alloc(struct connection *conn, const void *ctx,
+				    const char *name,
+				    const struct node_hdr **hdr)
 {
 	size_t size;
-	const struct node_hdr *hdr;
 	struct node *node;
 	const char *db_name;
 	int err;
@@ -719,17 +719,16 @@ struct node *read_node(struct connection *conn, const void *ctx,
 		errno = ENOMEM;
 		return NULL;
 	}
+
 	node->name = talloc_strdup(node, name);
 	if (!node->name) {
-		talloc_free(node);
 		errno = ENOMEM;
-		return NULL;
+		goto error;
 	}
 
 	db_name = transaction_prepend(conn, name);
-	hdr = db_fetch(db_name, &size);
-
-	if (hdr == NULL) {
+	*hdr = db_fetch(db_name, &size);
+	if (*hdr == NULL) {
 		node->hdr.generation = NO_GENERATION;
 		err = access_node(conn, node, NODE_ACCESS_READ, NULL);
 		errno = err ? : ENOENT;
@@ -739,31 +738,79 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	node->parent = NULL;
 
 	/* Datalen, childlen, number of permissions */
-	node->hdr = *hdr;
-	node->acc.domid = perms_from_node_hdr(hdr)->id;
+	node->hdr = **hdr;
+	node->acc.domid = perms_from_node_hdr(*hdr)->id;
 	node->acc.memory = size;
 
-	/* Copy node data to new memory area, starting with permissions. */
-	size -= sizeof(*hdr);
-	node->perms = talloc_memdup(node, perms_from_node_hdr(hdr), size);
-	if (node->perms == NULL) {
-		errno = ENOMEM;
-		goto error;
-	}
+	return node;
 
+ error:
+	talloc_free(node);
+	return NULL;
+}
+
+static int read_node_helper(struct connection *conn, struct node *node)
+{
 	/* Data is binary blob (usually ascii, no nul). */
-	node->data = node->perms + hdr->num_perms;
+	node->data = node->perms + node->hdr.num_perms;
 	/* Children is strings, nul separated. */
 	node->children = node->data + node->hdr.datalen;
 
 	if (domain_adjust_node_perms(node))
-		goto error;
+		return -1;
 
 	/* If owner is gone reset currently accounted memory size. */
 	if (node->acc.domid != get_node_owner(node))
 		node->acc.memory = 0;
 
 	if (access_node(conn, node, NODE_ACCESS_READ, NULL))
+		return -1;
+
+	return 0;
+}
+
+struct node *read_node(struct connection *conn, const void *ctx,
+		       const char *name)
+{
+	size_t size;
+	const struct node_hdr *hdr;
+	struct node *node;
+
+	node = read_node_alloc(conn, ctx, name, &hdr);
+	if (!node)
+		return NULL;
+
+	/* Copy node data to new memory area, starting with permissions. */
+	size = node->acc.memory - sizeof(*hdr);
+	node->perms = talloc_memdup(node, perms_from_node_hdr(hdr), size);
+	if (node->perms == NULL) {
+		errno = ENOMEM;
+		goto error;
+	}
+
+	if (read_node_helper(conn, node))
+		goto error;
+
+	return node;
+
+ error:
+	talloc_free(node);
+	return NULL;
+}
+
+const struct node *read_node_const(struct connection *conn, const void *ctx,
+				   const char *name)
+{
+	const struct node_hdr *hdr;
+	struct node *node;
+
+	node = read_node_alloc(conn, ctx, name, &hdr);
+	if (!node)
+		return NULL;
+
+	node->perms = perms_from_node_hdr(hdr);
+
+	if (read_node_helper(conn, node))
 		goto error;
 
 	return node;
@@ -896,14 +943,14 @@ char *get_parent(const void *ctx, const char *node)
 static int ask_parents(struct connection *conn, const void *ctx,
 		       const char *name, unsigned int *perm)
 {
-	struct node *node;
+	const struct node *node;
 	struct node_perms perms;
 
 	do {
 		name = get_parent(ctx, name);
 		if (!name)
 			return errno;
-		node = read_node(conn, ctx, name);
+		node = read_node_const(conn, ctx, name);
 		if (node)
 			break;
 		if (read_node_can_propagate_errno())
@@ -3194,9 +3241,8 @@ static int dump_state_node_err(struct dump_node_data *data, const char *err)
 }
 
 static int dump_state_node(const void *ctx, struct connection *conn,
-			   struct node *node, void *arg)
+			   const struct node *node, struct dump_node_data *data)
 {
-	struct dump_node_data *data = arg;
 	FILE *fp = data->fp;
 	unsigned int pathlen;
 	struct xs_state_record_header head;
@@ -3241,14 +3287,20 @@ static int dump_state_node(const void *ctx, struct connection *conn,
 	return WALK_TREE_OK;
 }
 
+static int dump_state_node_enter(const void *ctx, struct connection *conn,
+				 struct node *node, void *arg)
+{
+	return dump_state_node(ctx, conn, node, arg);
+}
+
 static int dump_state_special_node(FILE *fp, const void *ctx,
 				   struct dump_node_data *data,
 				   const char *name)
 {
-	struct node *node;
+	const struct node *node;
 	int ret;
 
-	node = read_node(NULL, ctx, name);
+	node = read_node_const(NULL, ctx, name);
 	if (!node)
 		return dump_state_node_err(data, "Dump node read node error");
 
@@ -3264,7 +3316,7 @@ const char *dump_state_nodes(FILE *fp, const void *ctx)
 		.fp = fp,
 		.err = "Dump node walk error"
 	};
-	struct walk_funcs walkfuncs = { .enter = dump_state_node };
+	struct walk_funcs walkfuncs = { .enter = dump_state_node_enter };
 
 	if (walk_node_tree(ctx, NULL, "/", &walkfuncs, &data))
 		return data.err;
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index adf8a785fc..65782c559d 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -282,6 +282,8 @@ int write_node_raw(struct connection *conn, const char *db_name,
 /* Get a node from the data base. */
 struct node *read_node(struct connection *conn, const void *ctx,
 		       const char *name);
+const struct node *read_node_const(struct connection *conn, const void *ctx,
+				   const char *name);
 
 /* Remove a node and its children. */
 int rm_node(struct connection *conn, const void *ctx, const char *name);
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index cdef6efef4..7290bbc848 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -563,12 +563,12 @@ static void domain_tree_remove(struct domain *domain)
 static void fire_special_watches(const char *name)
 {
 	void *ctx = talloc_new(NULL);
-	struct node *node;
+	const struct node *node;
 
 	if (!ctx)
 		return;
 
-	node = read_node(NULL, ctx, name);
+	node = read_node_const(NULL, ctx, name);
 
 	if (node)
 		fire_watches(NULL, ctx, name, node, true, NULL);
diff --git a/tools/xenstore/xenstored_watch.c b/tools/xenstore/xenstored_watch.c
index c161385f89..86cf8322b4 100644
--- a/tools/xenstore/xenstored_watch.c
+++ b/tools/xenstore/xenstored_watch.c
@@ -73,11 +73,11 @@ static const char *get_watch_path(const struct watch *watch, const char *name)
  * changed permissions we need to take the old permissions into account, too.
  */
 static bool watch_permitted(struct connection *conn, const void *ctx,
-			    const char *name, struct node *node,
+			    const char *name, const struct node *node,
 			    struct node_perms *perms)
 {
 	unsigned int perm;
-	struct node *parent;
+	const struct node *parent;
 	char *parent_name;
 	struct node_perms node_perms;
 
@@ -88,7 +88,7 @@ static bool watch_permitted(struct connection *conn, const void *ctx,
 	}
 
 	if (!node) {
-		node = read_node(conn, ctx, name);
+		node = read_node_const(conn, ctx, name);
 		if (!node)
 			return false;
 	}
@@ -103,7 +103,7 @@ static bool watch_permitted(struct connection *conn, const void *ctx,
 		parent_name = get_parent(ctx, node->name);
 		if (!parent_name)
 			return false;
-		parent = read_node(conn, ctx, parent_name);
+		parent = read_node_const(conn, ctx, parent_name);
 		if (!parent)
 			return false;
 	}
@@ -122,7 +122,7 @@ static bool watch_permitted(struct connection *conn, const void *ctx,
  * watch event, too.
  */
 void fire_watches(struct connection *conn, const void *ctx, const char *name,
-		  struct node *node, bool exact, struct node_perms *perms)
+		  const struct node *node, bool exact, struct node_perms *perms)
 {
 	struct connection *i;
 	struct buffered_data *req;
diff --git a/tools/xenstore/xenstored_watch.h b/tools/xenstore/xenstored_watch.h
index 091890edca..ea247997ad 100644
--- a/tools/xenstore/xenstored_watch.h
+++ b/tools/xenstore/xenstored_watch.h
@@ -28,7 +28,8 @@ int do_unwatch(const void *ctx, struct connection *conn,
 
 /* Fire all watches: !exact means all the children are affected (ie. rm). */
 void fire_watches(struct connection *conn, const void *tmp, const char *name,
-		  struct node *node, bool exact, struct node_perms *perms);
+		  const struct node *node, bool exact,
+		  struct node_perms *perms);
 
 void conn_delete_all_watches(struct connection *conn);
 
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:08:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:08:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568765.888738 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQE-0001MM-QG; Mon, 24 Jul 2023 11:08:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568765.888738; Mon, 24 Jul 2023 11:08:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQE-0001Lp-Is; Mon, 24 Jul 2023 11:08:14 +0000
Received: by outflank-mailman (input) for mailman id 568765;
 Mon, 24 Jul 2023 11:08:13 +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 <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtLq-0008WC-Kf
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:03:42 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bf697012-2a11-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 13:03:41 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id D1FEB20694;
 Mon, 24 Jul 2023 11:03:40 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A05C513476;
 Mon, 24 Jul 2023 11:03:40 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id bmTGJYxavmSpYQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:03:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bf697012-2a11-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196620; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=6oZMjq2xxg3d8sR1/S0XLcsbOGgm4Oh3G9kg5yfwE0M=;
	b=XmoiRpW2LA+tvUODIHXnnBo0mEDqcrgYmuO8FeT9cTmSxX9nIeSBlnd8k8VCvOoDc7VU2b
	blQ0mHyin7ThS4wzgT+MVFBax99W4f0q6pQWWWmI8J2O2WKWgd8HVrpkJMW3TWP239I+0J
	MiWV0mSf2DzoIji5YhGxx4NmK8McRm8=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [PATCH v3 09/25] tools/xenstore: let hashtable_add() fail in case of existing entry
Date: Mon, 24 Jul 2023 13:02:31 +0200
Message-Id: <20230724110247.10520-10-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Silently adding another entry with the same key to a hashtable is a
perfect receipt for later failure with hard to diagnose symptoms.

Let hashtable_add() fail in case another entry with the same key is
already existing.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
---
V2:
- split off from next patch (Julien Grall)
- fix coding style (Julien Grall)
- use for () loop (Julien Grall)
---
 tools/xenstore/hashtable.c | 40 ++++++++++++++++++++++++++------------
 1 file changed, 28 insertions(+), 12 deletions(-)

diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c
index 670dc01003..0409725060 100644
--- a/tools/xenstore/hashtable.c
+++ b/tools/xenstore/hashtable.c
@@ -141,11 +141,34 @@ static int hashtable_expand(struct hashtable *h)
     return 0;
 }
 
+static struct entry *hashtable_search_entry(const struct hashtable *h,
+                                            const void *k)
+{
+    struct entry *e;
+    unsigned int hashvalue, index;
+
+    hashvalue = hash(h, k);
+    index = indexFor(h->tablelength, hashvalue);
+    e = h->table[index];
+
+    for (e = h->table[index]; e; e = e->next)
+    {
+        /* Check hash value to short circuit heavier comparison */
+        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
+            return e;
+    }
+
+    return NULL;
+}
+
 int hashtable_add(struct hashtable *h, const void *k, const void *v)
 {
-    /* This method allows duplicate keys - but they shouldn't be used */
     unsigned int index;
     struct entry *e;
+
+    if (hashtable_search_entry(h, k))
+        return EEXIST;
+
     if (++(h->entrycount) > h->loadlimit)
     {
         /* Ignore the return value. If expand fails, we should
@@ -176,17 +199,10 @@ int hashtable_add(struct hashtable *h, const void *k, const void *v)
 void *hashtable_search(const struct hashtable *h, const void *k)
 {
     struct entry *e;
-    unsigned int hashvalue, index;
-    hashvalue = hash(h,k);
-    index = indexFor(h->tablelength,hashvalue);
-    e = h->table[index];
-    while (NULL != e)
-    {
-        /* Check hash value to short circuit heavier comparison */
-        if ((hashvalue == e->h) && (h->eqfn(k, e->k))) return e->v;
-        e = e->next;
-    }
-    return NULL;
+
+    e = hashtable_search_entry(h, k);
+
+    return e ? e->v : NULL;
 }
 
 void
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:08:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:08:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568768.888755 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQG-0001pb-8Z; Mon, 24 Jul 2023 11:08:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568768.888755; Mon, 24 Jul 2023 11:08:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQF-0001kl-Vb; Mon, 24 Jul 2023 11:08:15 +0000
Received: by outflank-mailman (input) for mailman id 568768;
 Mon, 24 Jul 2023 11:08:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtMp-0000KR-L9
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:04:43 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [2001:67c:2178:6::1c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e470076b-2a11-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:04:43 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id F14B222991;
 Mon, 24 Jul 2023 11:04:42 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C2E7D13476;
 Mon, 24 Jul 2023 11:04:42 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id YTwkLspavmRZYgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:04:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e470076b-2a11-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196682; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=1v6Xlk3y4teF71x4mrmlG0ix0/+qV1VkkWZlz39L56s=;
	b=I3nc6rnJV2WdpYF0W9m5iv5wAf/LEjQ4Ypzm/0pbSr65JNx1NBheQj3abiiUJPkhG0c8/Z
	+aiW+8lHOzVPdwllXOtMuKkEayaiZNanK6OVRK1DFiTUcIJuwAeoeeLJqz3AK3ZBLX9KUq
	3s5J4/B9jG4nk2cuWIlKS527C1DyFQA=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 20/25] tools/xenstore: alloc new memory in domain_adjust_node_perms()
Date: Mon, 24 Jul 2023 13:02:42 +0200
Message-Id: <20230724110247.10520-21-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In order to avoid modifying the node data in the data base in case a
domain is gone, let domain_adjust_node_perms() allocate new memory for
the permissions in case they need to be modified. As this should
happen only in very rare cases, it is fine to do this even when having
copied the node data already.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V3:
- new patch
---
 tools/xenstore/xenstored_core.c   | 10 +++++-----
 tools/xenstore/xenstored_domain.c | 19 +++++++++++++++----
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 404ecd0c62..ea3d20a372 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -751,6 +751,11 @@ struct node *read_node(struct connection *conn, const void *ctx,
 		goto error;
 	}
 
+	/* Data is binary blob (usually ascii, no nul). */
+	node->data = node->perms + hdr->num_perms;
+	/* Children is strings, nul separated. */
+	node->children = node->data + node->hdr.datalen;
+
 	if (domain_adjust_node_perms(node))
 		goto error;
 
@@ -758,11 +763,6 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	if (node->acc.domid != get_node_owner(node))
 		node->acc.memory = 0;
 
-	/* Data is binary blob (usually ascii, no nul). */
-	node->data = node->perms + hdr->num_perms;
-	/* Children is strings, nul separated. */
-	node->children = node->data + node->hdr.datalen;
-
 	if (access_node(conn, node, NODE_ACCESS_READ, NULL))
 		goto error;
 
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index fdf1095acb..cdef6efef4 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -1334,13 +1334,24 @@ int domain_alloc_permrefs(struct node_perms *perms)
 int domain_adjust_node_perms(struct node *node)
 {
 	unsigned int i;
+	struct xs_permissions *perms = node->perms;
+	bool copied = false;
 
 	for (i = 1; i < node->hdr.num_perms; i++) {
-		if (node->perms[i].perms & XS_PERM_IGNORE)
+		if ((perms[i].perms & XS_PERM_IGNORE) ||
+		    chk_domain_generation(perms[i].id, node->hdr.generation))
 			continue;
-		if (!chk_domain_generation(node->perms[i].id,
-					   node->hdr.generation))
-			node->perms[i].perms |= XS_PERM_IGNORE;
+
+		if (!copied) {
+			perms = talloc_memdup(node, node->perms,
+					node->hdr.num_perms * sizeof(*perms));
+			if (!perms)
+				return ENOMEM;
+			node->perms = perms;
+			copied = true;
+		}
+
+		perms[i].perms |= XS_PERM_IGNORE;
 	}
 
 	return 0;
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:08:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:08:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568764.888733 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQE-0001Iv-ET; Mon, 24 Jul 2023 11:08:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568764.888733; Mon, 24 Jul 2023 11:08:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQE-0001IZ-8X; Mon, 24 Jul 2023 11:08:14 +0000
Received: by outflank-mailman (input) for mailman id 568764;
 Mon, 24 Jul 2023 11:08:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtNH-0000KR-Mm
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:05:11 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f52651f7-2a11-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:05:11 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 055401FDF0;
 Mon, 24 Jul 2023 11:05:11 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C3F4813476;
 Mon, 24 Jul 2023 11:05:10 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id aIaOLuZavmSrYgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:05:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f52651f7-2a11-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196711; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=g1YD4gZAxPlT1/QwlSIA+d4ZRSzaspiY2J7SO8xP21Y=;
	b=OJiF5x/VaWqiMiyGMrMqra8+bueuk7mXfo6z/Nrd1MpPdnXaX32UM4ef/K2QYf5BKYTZvP
	JYSeDqgofbQCcF6hH0kcbsv5rWcSCvxl7nH0SVsMI6ObddeoSRsvxgDliGcqJAky9mDBrv
	+C3j1TrPBnDr86kjxXjvMsb01YzcEcY=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 25/25] tools/xenstore: introduce get_node_const()
Date: Mon, 24 Jul 2023 13:02:47 +0200
Message-Id: <20230724110247.10520-26-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add a variant of get_node() returning a const struct node pointer.

Note that all callers of this new variant don't supply a pointer where
to store the canonical node name, while all callers needing a non-const
node do supply this pointer. This results in an asymmetric
simplification of the two variants.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V3:
- new approach (Julien Grall)
---
 tools/xenstore/xenstored_core.c | 35 ++++++++++++++++++++++-----------
 1 file changed, 24 insertions(+), 11 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index fa07bc0c31..ed4e83d67d 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1288,11 +1288,8 @@ static struct node *get_node(struct connection *conn, const void *ctx,
 			     const char *name, const char **canonical_name,
 			     unsigned int perm, bool allow_special)
 {
-	const char *tmp_name;
 	struct node *node;
 
-	if (!canonical_name)
-		canonical_name = &tmp_name;
 	*canonical_name = canonicalize(conn, ctx, name, allow_special);
 	if (!*canonical_name)
 		return NULL;
@@ -1303,12 +1300,28 @@ static struct node *get_node(struct connection *conn, const void *ctx,
 	       ? NULL : node;
 }
 
+static const struct node *get_node_const(struct connection *conn,
+					 const void *ctx, const char *name,
+					 unsigned int perm, bool allow_special)
+{
+	const char *tmp_name;
+	const struct node *node;
+
+	tmp_name = canonicalize(conn, ctx, name, allow_special);
+	if (!tmp_name)
+		return NULL;
+
+	node = read_node_const(conn, ctx, tmp_name);
+
+	return get_node_chk_perm(conn, ctx, node, tmp_name, perm) ? NULL : node;
+}
+
 static int send_directory(const void *ctx, struct connection *conn,
 			  struct buffered_data *in)
 {
-	struct node *node;
+	const struct node *node;
 
-	node = get_node(conn, ctx, onearg(in), NULL, XS_PERM_READ, false);
+	node = get_node_const(conn, ctx, onearg(in), XS_PERM_READ, false);
 	if (!node)
 		return errno;
 
@@ -1322,14 +1335,14 @@ static int send_directory_part(const void *ctx, struct connection *conn,
 {
 	unsigned int off, len, maxlen, genlen;
 	char *child, *data;
-	struct node *node;
+	const struct node *node;
 	char gen[24];
 
 	if (xenstore_count_strings(in->buffer, in->used) != 2)
 		return EINVAL;
 
 	/* First arg is node name. */
-	node = get_node(conn, ctx, in->buffer, NULL, XS_PERM_READ, false);
+	node = get_node_const(conn, ctx, in->buffer, XS_PERM_READ, false);
 	if (!node)
 		return errno;
 
@@ -1376,9 +1389,9 @@ static int send_directory_part(const void *ctx, struct connection *conn,
 static int do_read(const void *ctx, struct connection *conn,
 		   struct buffered_data *in)
 {
-	struct node *node;
+	const struct node *node;
 
-	node = get_node(conn, ctx, onearg(in), NULL, XS_PERM_READ, false);
+	node = get_node_const(conn, ctx, onearg(in), XS_PERM_READ, false);
 	if (!node)
 		return errno;
 
@@ -1786,12 +1799,12 @@ static int do_rm(const void *ctx, struct connection *conn,
 static int do_get_perms(const void *ctx, struct connection *conn,
 			struct buffered_data *in)
 {
-	struct node *node;
+	const struct node *node;
 	char *strings;
 	unsigned int len;
 	struct node_perms perms;
 
-	node = get_node(conn, ctx, onearg(in), NULL, XS_PERM_READ, true);
+	node = get_node_const(conn, ctx, onearg(in), XS_PERM_READ, true);
 	if (!node)
 		return errno;
 
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:08:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:08:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568771.888767 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQH-0002Aa-DE; Mon, 24 Jul 2023 11:08:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568771.888767; Mon, 24 Jul 2023 11:08:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQH-00027s-0l; Mon, 24 Jul 2023 11:08:17 +0000
Received: by outflank-mailman (input) for mailman id 568771;
 Mon, 24 Jul 2023 11:08:14 +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 <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtMD-0008WC-AG
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:04:05 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [2001:67c:2178:6::1c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ccdf6191-2a11-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 13:04:03 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 6C06922988;
 Mon, 24 Jul 2023 11:04:03 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 319AC13476;
 Mon, 24 Jul 2023 11:04:03 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id z6nMCqNavmTZYQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:04:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ccdf6191-2a11-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196643; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=BG6qvkTJomUkTWnj+OlsG8s/EdIwcHngnOtZ7JpxP6M=;
	b=Tt5SMJfeLWx1BWFx36kasi9KVt1fCKh2DDYH4qPyw9rsaeMC0iwQbF9BEmprvhdmPwuTab
	olOZstmmimgT1yOlsx7PVzRdHJrqVzp3S+w+4KimH5Vjio4XJChW2EZ9+c5TURsWW2kuld
	byy8DQom6qstPLNENEiGCu1SSI+67Es=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [PATCH v3 13/25] tools/xenstore: let db_delete() return void
Date: Mon, 24 Jul 2023 13:02:35 +0200
Message-Id: <20230724110247.10520-14-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

db_delete() only ever is returning 0. Switch it to return void and
remove all the error handling dealing wit a non-zero return value.

Suggested-by: Julien Grall <julien@xen.org>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
---
V2:
- new patch
---
 tools/xenstore/xenstored_core.c        | 11 ++++-------
 tools/xenstore/xenstored_core.h        |  4 ++--
 tools/xenstore/xenstored_transaction.c | 14 +++++---------
 3 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 2b94392fd4..a08962c3ea 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -677,8 +677,8 @@ int db_write(struct connection *conn, const char *db_name, void *data,
 	return 0;
 }
 
-int db_delete(struct connection *conn, const char *name,
-	      struct node_account_data *acc)
+void db_delete(struct connection *conn, const char *name,
+	       struct node_account_data *acc)
 {
 	struct node_account_data tmp_acc;
 	unsigned int domid;
@@ -698,8 +698,6 @@ int db_delete(struct connection *conn, const char *name,
 		domain_memory_add_nochk(conn, domid,
 					-acc->memory - strlen(name));
 	}
-
-	return 0;
 }
 
 /*
@@ -1670,9 +1668,8 @@ static int delnode_sub(const void *ctx, struct connection *conn,
 	if (domain_nbentry_dec(conn, get_node_owner(node)))
 		return WALK_TREE_ERROR_STOP;
 
-	/* In case of error stop the walk. */
-	if (!ret && db_delete(conn, db_name, &node->acc))
-		return WALK_TREE_ERROR_STOP;
+	if (!ret)
+		db_delete(conn, db_name, &node->acc);
 
 	/*
 	 * Fire the watches now, when we can still see the node permissions.
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index ce40c61f44..e1aeb4aecd 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -366,8 +366,8 @@ struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size);
 int db_write(struct connection *conn, const char *db_name, void *data,
 	     size_t size, struct node_account_data *acc,
 	     enum write_node_mode mode, bool no_quota_check);
-int db_delete(struct connection *conn, const char *name,
-	      struct node_account_data *acc);
+void db_delete(struct connection *conn, const char *name,
+	       struct node_account_data *acc);
 
 void conn_free_buffered_data(struct connection *conn);
 
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 378fe79763..fbcea3663e 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -377,10 +377,8 @@ static int finalize_transaction(struct connection *conn,
 
 		/* Entries for unmodified nodes can be removed early. */
 		if (!i->modified) {
-			if (i->ta_node) {
-				if (db_delete(conn, i->trans_name, NULL))
-					return EIO;
-			}
+			if (i->ta_node)
+				db_delete(conn, i->trans_name, NULL);
 			list_del(&i->list);
 			talloc_free(i);
 		}
@@ -397,8 +395,7 @@ static int finalize_transaction(struct connection *conn,
 				       ? NODE_CREATE : NODE_MODIFY;
 				*is_corrupt |= db_write(conn, i->node, hdr,
 							size, NULL, mode, true);
-				if (db_delete(conn, i->trans_name, NULL))
-					*is_corrupt = true;
+				db_delete(conn, i->trans_name, NULL);
 			} else {
 				*is_corrupt = true;
 			}
@@ -408,9 +405,8 @@ static int finalize_transaction(struct connection *conn,
 			 * in this transaction will have no generation
 			 * information stored.
 			 */
-			*is_corrupt |= (i->generation == NO_GENERATION)
-				       ? false
-				       : db_delete(conn, i->node, NULL);
+			if (i->generation != NO_GENERATION)
+				db_delete(conn, i->node, NULL);
 		}
 		if (i->fire_watch)
 			fire_watches(conn, trans, i->node, NULL, i->watch_exact,
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:08:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:08:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568772.888777 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQI-0002Np-2m; Mon, 24 Jul 2023 11:08:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568772.888777; Mon, 24 Jul 2023 11:08:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQH-0002K8-Mr; Mon, 24 Jul 2023 11:08:17 +0000
Received: by outflank-mailman (input) for mailman id 568772;
 Mon, 24 Jul 2023 11:08:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtM7-0000KR-Vt
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:04:00 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c97ddb0c-2a11-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:03:57 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id BADE820699;
 Mon, 24 Jul 2023 11:03:57 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 797C713476;
 Mon, 24 Jul 2023 11:03:57 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id WLkiHJ1avmTOYQAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:03:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c97ddb0c-2a11-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196637; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=f8c0WZkiA2sRwo/5ZKpm9mv0MPjHkD48eHCwmRexE5o=;
	b=XIPS18LQJz0Zwm18sOO04x2cLl02TTQCJkWqtd8y13UXyUohk+bFru8mzGUpROayqzWmwt
	M1mVDEliLAVZnnXr9o9UaaoNqPeQUP8up13PGq6V1lD09762LmX6WlMtMDjCi55V8ZEDNl
	KXZ06UND1Zlv1lhVna7HumjpQZxOYWE=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [PATCH v3 12/25] tools/xenstore: remove tdb code
Date: Mon, 24 Jul 2023 13:02:34 +0200
Message-Id: <20230724110247.10520-13-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Now that TDB isn't used anymore, remove it.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 tools/xenstore/Makefile.common |    2 +-
 tools/xenstore/tdb.c           | 1748 --------------------------------
 tools/xenstore/tdb.h           |  132 ---
 3 files changed, 1 insertion(+), 1881 deletions(-)
 delete mode 100644 tools/xenstore/tdb.c
 delete mode 100644 tools/xenstore/tdb.h

diff --git a/tools/xenstore/Makefile.common b/tools/xenstore/Makefile.common
index 657a16849e..3259ab51e6 100644
--- a/tools/xenstore/Makefile.common
+++ b/tools/xenstore/Makefile.common
@@ -2,7 +2,7 @@
 
 XENSTORED_OBJS-y := xenstored_core.o xenstored_watch.o xenstored_domain.o
 XENSTORED_OBJS-y += xenstored_transaction.o xenstored_control.o xenstored_lu.o
-XENSTORED_OBJS-y += talloc.o utils.o tdb.o hashtable.o
+XENSTORED_OBJS-y += talloc.o utils.o hashtable.o
 
 XENSTORED_OBJS-$(CONFIG_Linux) += xenstored_posix.o xenstored_lu_daemon.o
 XENSTORED_OBJS-$(CONFIG_NetBSD) += xenstored_posix.o xenstored_lu_daemon.o
diff --git a/tools/xenstore/tdb.c b/tools/xenstore/tdb.c
deleted file mode 100644
index 29593b76c3..0000000000
--- a/tools/xenstore/tdb.c
+++ /dev/null
@@ -1,1748 +0,0 @@
- /* 
-   Unix SMB/CIFS implementation.
-
-   trivial database library
-
-   Copyright (C) Andrew Tridgell              1999-2004
-   Copyright (C) Paul `Rusty' Russell		   2000
-   Copyright (C) Jeremy Allison			   2000-2003
-   
-     ** NOTE! The following LGPL license applies to the tdb
-     ** library. This does NOT imply that all of Samba is released
-     ** under the LGPL
-   
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; If not, see <http://www.gnu.org/licenses/>.
-*/
-
-
-#ifndef _SAMBA_BUILD_
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include "tdb.h"
-#include <stdarg.h>
-#include "talloc.h"
-#undef HAVE_MMAP
-#else
-#include "includes.h"
-#include "lib/tdb/include/tdb.h"
-#include "system/time.h"
-#include "system/shmem.h"
-#include "system/filesys.h"
-#endif
-
-#define TDB_MAGIC_FOOD "TDB file\n"
-#define TDB_VERSION (0x26011967 + 7)
-#define TDB_MAGIC (0x26011999U)
-#define TDB_FREE_MAGIC (~TDB_MAGIC)
-#define TDB_DEAD_MAGIC (0xFEE1DEAD)
-#define TDB_ALIGNMENT 4
-#define MIN_REC_SIZE (2*sizeof(struct list_struct) + TDB_ALIGNMENT)
-#define DEFAULT_HASH_SIZE 131
-#define TDB_PAGE_SIZE 0x2000
-#define FREELIST_TOP (sizeof(struct tdb_header))
-#define TDB_ALIGN(x,a) (((x) + (a)-1) & ~((a)-1))
-#define TDB_BYTEREV(x) (((((x)&0xff)<<24)|((x)&0xFF00)<<8)|(((x)>>8)&0xFF00)|((x)>>24))
-#define TDB_DEAD(r) ((r)->magic == TDB_DEAD_MAGIC)
-#define TDB_BAD_MAGIC(r) ((r)->magic != TDB_MAGIC && !TDB_DEAD(r))
-#define TDB_HASH_TOP(hash) (FREELIST_TOP + (BUCKET(hash)+1)*sizeof(tdb_off))
-#define TDB_DATA_START(hash_size) (TDB_HASH_TOP(hash_size-1))
-
-
-/* NB assumes there is a local variable called "tdb" that is the
- * current context, also takes doubly-parenthesized print-style
- * argument. */
-#define TDB_LOG(x) tdb->log_fn x
-
-/* lock offsets */
-#define GLOBAL_LOCK 0
-#define ACTIVE_LOCK 4
-
-#ifndef MAP_FILE
-#define MAP_FILE 0
-#endif
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-#ifndef discard_const_p
-# if defined(__intptr_t_defined) || defined(HAVE_INTPTR_T)
-#  define discard_const(ptr) ((void *)((intptr_t)(ptr)))
-# else
-#  define discard_const(ptr) ((void *)(ptr))
-# endif
-# define discard_const_p(type, ptr) ((type *)discard_const(ptr))
-#endif
-
-/* free memory if the pointer is valid and zero the pointer */
-#ifndef SAFE_FREE
-#define SAFE_FREE(x) do { if ((x) != NULL) {talloc_free(discard_const_p(void *, (x))); (x)=NULL;} } while(0)
-#endif
-
-#define BUCKET(hash) ((hash) % tdb->header.hash_size)
-static TDB_DATA tdb_null;
-
-/* all contexts, to ensure no double-opens (fcntl locks don't nest!) */
-static TDB_CONTEXT *tdbs = NULL;
-
-static int tdb_munmap(TDB_CONTEXT *tdb)
-{
-	if (tdb->flags & TDB_INTERNAL)
-		return 0;
-
-#ifdef HAVE_MMAP
-	if (tdb->map_ptr) {
-		int ret = munmap(tdb->map_ptr, tdb->map_size);
-		if (ret != 0)
-			return ret;
-	}
-#endif
-	tdb->map_ptr = NULL;
-	return 0;
-}
-
-static void tdb_mmap(TDB_CONTEXT *tdb)
-{
-	if (tdb->flags & TDB_INTERNAL)
-		return;
-
-#ifdef HAVE_MMAP
-	if (!(tdb->flags & TDB_NOMMAP)) {
-		tdb->map_ptr = mmap(NULL, tdb->map_size, 
-				    PROT_READ|(tdb->read_only? 0:PROT_WRITE), 
-				    MAP_SHARED|MAP_FILE, tdb->fd, 0);
-
-		/*
-		 * NB. When mmap fails it returns MAP_FAILED *NOT* NULL !!!!
-		 */
-
-		if (tdb->map_ptr == MAP_FAILED) {
-			tdb->map_ptr = NULL;
-			TDB_LOG((tdb, 2, "tdb_mmap failed for size %d (%s)\n", 
-				 tdb->map_size, strerror(errno)));
-		}
-	} else {
-		tdb->map_ptr = NULL;
-	}
-#else
-	tdb->map_ptr = NULL;
-#endif
-}
-
-/* Endian conversion: we only ever deal with 4 byte quantities */
-static void *convert(void *buf, uint32_t size)
-{
-	uint32_t i, *p = buf;
-	for (i = 0; i < size / 4; i++)
-		p[i] = TDB_BYTEREV(p[i]);
-	return buf;
-}
-#define DOCONV() (tdb->flags & TDB_CONVERT)
-#define CONVERT(x) (DOCONV() ? convert(&x, sizeof(x)) : &x)
-
-/* the body of the database is made of one list_struct for the free space
-   plus a separate data list for each hash value */
-struct list_struct {
-	tdb_off next; /* offset of the next record in the list */
-	tdb_len rec_len; /* total byte length of record */
-	tdb_len key_len; /* byte length of key */
-	tdb_len data_len; /* byte length of data */
-	uint32_t full_hash; /* the full 32 bit hash of the key */
-	uint32_t magic;   /* try to catch errors */
-	/* the following union is implied:
-		union {
-			char record[rec_len];
-			struct {
-				char key[key_len];
-				char data[data_len];
-			}
-			uint32_t totalsize; (tailer)
-		}
-	*/
-};
-
-/* a byte range locking function - return 0 on success
-   this functions locks/unlocks 1 byte at the specified offset.
-
-   On error, errno is also set so that errors are passed back properly
-   through tdb_open(). */
-static int tdb_brlock(TDB_CONTEXT *tdb, tdb_off offset, 
-		      int rw_type, int lck_type, int probe)
-{
-	struct flock fl;
-	int ret;
-
-	if (tdb->flags & TDB_NOLOCK)
-		return 0;
-	if ((rw_type == F_WRLCK) && (tdb->read_only)) {
-		errno = EACCES;
-		return -1;
-	}
-
-	fl.l_type = rw_type;
-	fl.l_whence = SEEK_SET;
-	fl.l_start = offset;
-	fl.l_len = 1;
-	fl.l_pid = 0;
-
-	do {
-		ret = fcntl(tdb->fd,lck_type,&fl);
-	} while (ret == -1 && errno == EINTR);
-
-	if (ret == -1) {
-		if (!probe && lck_type != F_SETLK) {
-			/* Ensure error code is set for log fun to examine. */
-			tdb->ecode = TDB_ERR_LOCK;
-			TDB_LOG((tdb, 5,"tdb_brlock failed (fd=%d) at offset %d rw_type=%d lck_type=%d\n", 
-				 tdb->fd, offset, rw_type, lck_type));
-		}
-		/* Generic lock error. errno set by fcntl.
-		 * EAGAIN is an expected return from non-blocking
-		 * locks. */
-		if (errno != EAGAIN) {
-		TDB_LOG((tdb, 5, "tdb_brlock failed (fd=%d) at offset %d rw_type=%d lck_type=%d: %s\n", 
-				 tdb->fd, offset, rw_type, lck_type, 
-				 strerror(errno)));
-		}
-		return TDB_ERRCODE(TDB_ERR_LOCK, -1);
-	}
-	return 0;
-}
-
-/* lock a list in the database. list -1 is the alloc list */
-static int tdb_lock(TDB_CONTEXT *tdb, int list, int ltype)
-{
-	if (list < -1 || list >= (int)tdb->header.hash_size) {
-		TDB_LOG((tdb, 0,"tdb_lock: invalid list %d for ltype=%d\n", 
-			   list, ltype));
-		return -1;
-	}
-	if (tdb->flags & TDB_NOLOCK)
-		return 0;
-
-	/* Since fcntl locks don't nest, we do a lock for the first one,
-	   and simply bump the count for future ones */
-	if (tdb->locked[list+1].count == 0) {
-		if (tdb_brlock(tdb,FREELIST_TOP+4*list,ltype,F_SETLKW, 0)) {
-			TDB_LOG((tdb, 0,"tdb_lock failed on list %d ltype=%d (%s)\n", 
-					   list, ltype, strerror(errno)));
-			return -1;
-		}
-		tdb->locked[list+1].ltype = ltype;
-	}
-	tdb->locked[list+1].count++;
-	return 0;
-}
-
-/* unlock the database: returns void because it's too late for errors. */
-	/* changed to return int it may be interesting to know there
-	   has been an error  --simo */
-static int tdb_unlock(TDB_CONTEXT *tdb, int list,
-		      int ltype __attribute__((unused)))
-{
-	int ret = -1;
-
-	if (tdb->flags & TDB_NOLOCK)
-		return 0;
-
-	/* Sanity checks */
-	if (list < -1 || list >= (int)tdb->header.hash_size) {
-		TDB_LOG((tdb, 0, "tdb_unlock: list %d invalid (%d)\n", list, tdb->header.hash_size));
-		return ret;
-	}
-
-	if (tdb->locked[list+1].count==0) {
-		TDB_LOG((tdb, 0, "tdb_unlock: count is 0\n"));
-		return ret;
-	}
-
-	if (tdb->locked[list+1].count == 1) {
-		/* Down to last nested lock: unlock underneath */
-		ret = tdb_brlock(tdb, FREELIST_TOP+4*list, F_UNLCK, F_SETLKW, 0);
-	} else {
-		ret = 0;
-	}
-	tdb->locked[list+1].count--;
-
-	if (ret)
-		TDB_LOG((tdb, 0,"tdb_unlock: An error occurred unlocking!\n")); 
-	return ret;
-}
-
-/* This is based on the hash algorithm from gdbm */
-static uint32_t default_tdb_hash(TDB_DATA *key)
-{
-	uint32_t value;	/* Used to compute the hash value.  */
-	uint32_t   i;	/* Used to cycle through random values. */
-
-	/* Set the initial value from the key size. */
-	for (value = 0x238F13AF * key->dsize, i=0; i < key->dsize; i++)
-		value = (value + (key->dptr[i] << (i*5 % 24)));
-
-	return (1103515243 * value + 12345);  
-}
-
-/* check for an out of bounds access - if it is out of bounds then
-   see if the database has been expanded by someone else and expand
-   if necessary 
-   note that "len" is the minimum length needed for the db
-*/
-static int tdb_oob(TDB_CONTEXT *tdb, tdb_off len, int probe)
-{
-	struct stat st;
-	if (len <= tdb->map_size)
-		return 0;
-	if (tdb->flags & TDB_INTERNAL) {
-		if (!probe) {
-			/* Ensure ecode is set for log fn. */
-			tdb->ecode = TDB_ERR_IO;
-			TDB_LOG((tdb, 0,"tdb_oob len %d beyond internal malloc size %d\n",
-				 (int)len, (int)tdb->map_size));
-		}
-		return TDB_ERRCODE(TDB_ERR_IO, -1);
-	}
-
-	if (fstat(tdb->fd, &st) == -1)
-		return TDB_ERRCODE(TDB_ERR_IO, -1);
-
-	if (st.st_size < (off_t)len) {
-		if (!probe) {
-			/* Ensure ecode is set for log fn. */
-			tdb->ecode = TDB_ERR_IO;
-			TDB_LOG((tdb, 0,"tdb_oob len %d beyond eof at %d\n",
-				 (int)len, (int)st.st_size));
-		}
-		return TDB_ERRCODE(TDB_ERR_IO, -1);
-	}
-
-	/* Unmap, update size, remap */
-	if (tdb_munmap(tdb) == -1)
-		return TDB_ERRCODE(TDB_ERR_IO, -1);
-	tdb->map_size = st.st_size;
-	tdb_mmap(tdb);
-	return 0;
-}
-
-/* write a lump of data at a specified offset */
-static int tdb_write(TDB_CONTEXT *tdb, tdb_off off, void *buf, tdb_len len)
-{
-	if (tdb_oob(tdb, off + len, 0) != 0)
-		return -1;
-
-	if (tdb->map_ptr)
-		memcpy(off + (char *)tdb->map_ptr, buf, len);
-#ifdef HAVE_PWRITE
-	else if (pwrite(tdb->fd, buf, len, off) != (ssize_t)len) {
-#else
-	else if (lseek(tdb->fd, off, SEEK_SET) != (off_t)off
-		 || write(tdb->fd, buf, len) != (off_t)len) {
-#endif
-		/* Ensure ecode is set for log fn. */
-		tdb->ecode = TDB_ERR_IO;
-		TDB_LOG((tdb, 0,"tdb_write failed at %d len=%d (%s)\n",
-			   off, len, strerror(errno)));
-		return TDB_ERRCODE(TDB_ERR_IO, -1);
-	}
-	return 0;
-}
-
-/* read a lump of data at a specified offset, maybe convert */
-static int tdb_read(TDB_CONTEXT *tdb,tdb_off off,void *buf,tdb_len len,int cv)
-{
-	if (tdb_oob(tdb, off + len, 0) != 0)
-		return -1;
-
-	if (tdb->map_ptr)
-		memcpy(buf, off + (char *)tdb->map_ptr, len);
-#ifdef HAVE_PREAD
-	else if (pread(tdb->fd, buf, len, off) != (off_t)len) {
-#else
-	else if (lseek(tdb->fd, off, SEEK_SET) != (off_t)off
-		 || read(tdb->fd, buf, len) != (off_t)len) {
-#endif
-		/* Ensure ecode is set for log fn. */
-		tdb->ecode = TDB_ERR_IO;
-		TDB_LOG((tdb, 0,"tdb_read failed at %d len=%d (%s)\n",
-			   off, len, strerror(errno)));
-		return TDB_ERRCODE(TDB_ERR_IO, -1);
-	}
-	if (cv)
-		convert(buf, len);
-	return 0;
-}
-
-/* don't allocate memory: used in tdb_delete path. */
-static int tdb_key_eq(TDB_CONTEXT *tdb, tdb_off off, TDB_DATA key)
-{
-	char buf[64];
-	uint32_t len;
-
-	if (tdb_oob(tdb, off + key.dsize, 0) != 0)
-		return -1;
-
-	if (tdb->map_ptr)
-		return !memcmp(off + (char*)tdb->map_ptr, key.dptr, key.dsize);
-
-	while (key.dsize) {
-		len = key.dsize;
-		if (len > sizeof(buf))
-			len = sizeof(buf);
-		if (tdb_read(tdb, off, buf, len, 0) != 0)
-			return -1;
-		if (memcmp(buf, key.dptr, len) != 0)
-			return 0;
-		key.dptr += len;
-		key.dsize -= len;
-		off += len;
-	}
-	return 1;
-}
-
-/* read a lump of data, allocating the space for it */
-static char *tdb_alloc_read(TDB_CONTEXT *tdb, tdb_off offset, tdb_len len)
-{
-	char *buf;
-
-	if (!(buf = talloc_size(tdb, len))) {
-		/* Ensure ecode is set for log fn. */
-		tdb->ecode = TDB_ERR_OOM;
-		TDB_LOG((tdb, 0,"tdb_alloc_read malloc failed len=%d (%s)\n",
-			   len, strerror(errno)));
-		return TDB_ERRCODE(TDB_ERR_OOM, buf);
-	}
-	if (tdb_read(tdb, offset, buf, len, 0) == -1) {
-		SAFE_FREE(buf);
-		return NULL;
-	}
-	return buf;
-}
-
-/* read/write a tdb_off */
-static int ofs_read(TDB_CONTEXT *tdb, tdb_off offset, tdb_off *d)
-{
-	return tdb_read(tdb, offset, (char*)d, sizeof(*d), DOCONV());
-}
-static int ofs_write(TDB_CONTEXT *tdb, tdb_off offset, tdb_off *d)
-{
-	tdb_off off = *d;
-	return tdb_write(tdb, offset, CONVERT(off), sizeof(*d));
-}
-
-/* read/write a record */
-static int rec_read(TDB_CONTEXT *tdb, tdb_off offset, struct list_struct *rec)
-{
-	if (tdb_read(tdb, offset, rec, sizeof(*rec),DOCONV()) == -1)
-		return -1;
-	if (TDB_BAD_MAGIC(rec)) {
-		/* Ensure ecode is set for log fn. */
-		tdb->ecode = TDB_ERR_CORRUPT;
-		TDB_LOG((tdb, 0,"rec_read bad magic 0x%x at offset=%d\n", rec->magic, offset));
-		return TDB_ERRCODE(TDB_ERR_CORRUPT, -1);
-	}
-	return tdb_oob(tdb, rec->next+sizeof(*rec), 0);
-}
-static int rec_write(TDB_CONTEXT *tdb, tdb_off offset, struct list_struct *rec)
-{
-	struct list_struct r = *rec;
-	return tdb_write(tdb, offset, CONVERT(r), sizeof(r));
-}
-
-/* read a freelist record and check for simple errors */
-static int rec_free_read(TDB_CONTEXT *tdb, tdb_off off, struct list_struct *rec)
-{
-	if (tdb_read(tdb, off, rec, sizeof(*rec),DOCONV()) == -1)
-		return -1;
-
-	if (rec->magic == TDB_MAGIC) {
-		/* this happens when a app is showdown while deleting a record - we should
-		   not completely fail when this happens */
-		TDB_LOG((tdb, 0,"rec_free_read non-free magic 0x%x at offset=%d - fixing\n", 
-			 rec->magic, off));
-		rec->magic = TDB_FREE_MAGIC;
-		if (tdb_write(tdb, off, rec, sizeof(*rec)) == -1)
-			return -1;
-	}
-
-	if (rec->magic != TDB_FREE_MAGIC) {
-		/* Ensure ecode is set for log fn. */
-		tdb->ecode = TDB_ERR_CORRUPT;
-		TDB_LOG((tdb, 0,"rec_free_read bad magic 0x%x at offset=%d\n", 
-			   rec->magic, off));
-		return TDB_ERRCODE(TDB_ERR_CORRUPT, -1);
-	}
-	if (tdb_oob(tdb, rec->next+sizeof(*rec), 0) != 0)
-		return -1;
-	return 0;
-}
-
-/* update a record tailer (must hold allocation lock) */
-static int update_tailer(TDB_CONTEXT *tdb, tdb_off offset,
-			 const struct list_struct *rec)
-{
-	tdb_off totalsize;
-
-	/* Offset of tailer from record header */
-	totalsize = sizeof(*rec) + rec->rec_len;
-	return ofs_write(tdb, offset + totalsize - sizeof(tdb_off),
-			 &totalsize);
-}
-
-/* Remove an element from the freelist.  Must have alloc lock. */
-static int remove_from_freelist(TDB_CONTEXT *tdb, tdb_off off, tdb_off next)
-{
-	tdb_off last_ptr, i;
-
-	/* read in the freelist top */
-	last_ptr = FREELIST_TOP;
-	while (ofs_read(tdb, last_ptr, &i) != -1 && i != 0) {
-		if (i == off) {
-			/* We've found it! */
-			return ofs_write(tdb, last_ptr, &next);
-		}
-		/* Follow chain (next offset is at start of record) */
-		last_ptr = i;
-	}
-	TDB_LOG((tdb, 0,"remove_from_freelist: not on list at off=%d\n", off));
-	return TDB_ERRCODE(TDB_ERR_CORRUPT, -1);
-}
-
-/* Add an element into the freelist. Merge adjacent records if
-   neccessary. */
-static int tdb_free(TDB_CONTEXT *tdb, tdb_off offset, struct list_struct *rec)
-{
-	tdb_off right, left;
-
-	/* Allocation and tailer lock */
-	if (tdb_lock(tdb, -1, F_WRLCK) != 0)
-		return -1;
-
-	/* set an initial tailer, so if we fail we don't leave a bogus record */
-	if (update_tailer(tdb, offset, rec) != 0) {
-		TDB_LOG((tdb, 0, "tdb_free: upfate_tailer failed!\n"));
-		goto fail;
-	}
-
-	/* Look right first (I'm an Australian, dammit) */
-	right = offset + sizeof(*rec) + rec->rec_len;
-	if (right + sizeof(*rec) <= tdb->map_size) {
-		struct list_struct r;
-
-		if (tdb_read(tdb, right, &r, sizeof(r), DOCONV()) == -1) {
-			TDB_LOG((tdb, 0, "tdb_free: right read failed at %u\n", right));
-			goto left;
-		}
-
-		/* If it's free, expand to include it. */
-		if (r.magic == TDB_FREE_MAGIC) {
-			if (remove_from_freelist(tdb, right, r.next) == -1) {
-				TDB_LOG((tdb, 0, "tdb_free: right free failed at %u\n", right));
-				goto left;
-			}
-			rec->rec_len += sizeof(r) + r.rec_len;
-		}
-	}
-
-left:
-	/* Look left */
-	left = offset - sizeof(tdb_off);
-	if (left > TDB_DATA_START(tdb->header.hash_size)) {
-		struct list_struct l;
-		tdb_off leftsize;
-		
-		/* Read in tailer and jump back to header */
-		if (ofs_read(tdb, left, &leftsize) == -1) {
-			TDB_LOG((tdb, 0, "tdb_free: left offset read failed at %u\n", left));
-			goto update;
-		}
-		left = offset - leftsize;
-
-		/* Now read in record */
-		if (tdb_read(tdb, left, &l, sizeof(l), DOCONV()) == -1) {
-			TDB_LOG((tdb, 0, "tdb_free: left read failed at %u (%u)\n", left, leftsize));
-			goto update;
-		}
-
-		/* If it's free, expand to include it. */
-		if (l.magic == TDB_FREE_MAGIC) {
-			if (remove_from_freelist(tdb, left, l.next) == -1) {
-				TDB_LOG((tdb, 0, "tdb_free: left free failed at %u\n", left));
-				goto update;
-			} else {
-				offset = left;
-				rec->rec_len += leftsize;
-			}
-		}
-	}
-
-update:
-	if (update_tailer(tdb, offset, rec) == -1) {
-		TDB_LOG((tdb, 0, "tdb_free: update_tailer failed at %u\n", offset));
-		goto fail;
-	}
-
-	/* Now, prepend to free list */
-	rec->magic = TDB_FREE_MAGIC;
-
-	if (ofs_read(tdb, FREELIST_TOP, &rec->next) == -1 ||
-	    rec_write(tdb, offset, rec) == -1 ||
-	    ofs_write(tdb, FREELIST_TOP, &offset) == -1) {
-		TDB_LOG((tdb, 0, "tdb_free record write failed at offset=%d\n", offset));
-		goto fail;
-	}
-
-	/* And we're done. */
-	tdb_unlock(tdb, -1, F_WRLCK);
-	return 0;
-
- fail:
-	tdb_unlock(tdb, -1, F_WRLCK);
-	return -1;
-}
-
-
-/* expand a file.  we prefer to use ftruncate, as that is what posix
-  says to use for mmap expansion */
-static int expand_file(TDB_CONTEXT *tdb, tdb_off size, tdb_off addition)
-{
-	char buf[1024];
-#ifdef HAVE_FTRUNCATE_EXTEND
-	if (ftruncate(tdb->fd, size+addition) != 0) {
-		TDB_LOG((tdb, 0, "expand_file ftruncate to %d failed (%s)\n", 
-			   size+addition, strerror(errno)));
-		return -1;
-	}
-#else
-	char b = 0;
-
-#ifdef HAVE_PWRITE
-	if (pwrite(tdb->fd,  &b, 1, (size+addition) - 1) != 1) {
-#else
-	if (lseek(tdb->fd, (size+addition) - 1, SEEK_SET) != (off_t)(size+addition) - 1 || 
-	    write(tdb->fd, &b, 1) != 1) {
-#endif
-		TDB_LOG((tdb, 0, "expand_file to %d failed (%s)\n", 
-			   size+addition, strerror(errno)));
-		return -1;
-	}
-#endif
-
-	/* now fill the file with something. This ensures that the file isn't sparse, which would be
-	   very bad if we ran out of disk. This must be done with write, not via mmap */
-	memset(buf, 0x42, sizeof(buf));
-	while (addition) {
-		int n = addition>sizeof(buf)?sizeof(buf):addition;
-#ifdef HAVE_PWRITE
-		int ret = pwrite(tdb->fd, buf, n, size);
-#else
-		int ret;
-		if (lseek(tdb->fd, size, SEEK_SET) != (off_t)size)
-			return -1;
-		ret = write(tdb->fd, buf, n);
-#endif
-		if (ret != n) {
-			TDB_LOG((tdb, 0, "expand_file write of %d failed (%s)\n", 
-				   n, strerror(errno)));
-			return -1;
-		}
-		addition -= n;
-		size += n;
-	}
-	return 0;
-}
-
-
-/* expand the database at least size bytes by expanding the underlying
-   file and doing the mmap again if necessary */
-static int tdb_expand(TDB_CONTEXT *tdb, tdb_off size)
-{
-	struct list_struct rec;
-	tdb_off offset;
-
-	if (tdb_lock(tdb, -1, F_WRLCK) == -1) {
-		TDB_LOG((tdb, 0, "lock failed in tdb_expand\n"));
-		return -1;
-	}
-
-	/* must know about any previous expansions by another process */
-	tdb_oob(tdb, tdb->map_size + 1, 1);
-
-	/* always make room for at least 10 more records, and round
-           the database up to a multiple of TDB_PAGE_SIZE */
-	size = TDB_ALIGN(tdb->map_size + size*10, TDB_PAGE_SIZE) - tdb->map_size;
-
-	if (!(tdb->flags & TDB_INTERNAL))
-		tdb_munmap(tdb);
-
-	/*
-	 * We must ensure the file is unmapped before doing this
-	 * to ensure consistency with systems like OpenBSD where
-	 * writes and mmaps are not consistent.
-	 */
-
-	/* expand the file itself */
-	if (!(tdb->flags & TDB_INTERNAL)) {
-		if (expand_file(tdb, tdb->map_size, size) != 0)
-			goto fail;
-	}
-
-	tdb->map_size += size;
-
-	if (tdb->flags & TDB_INTERNAL) {
-		char *new_map_ptr = talloc_realloc_size(tdb, tdb->map_ptr,
-							tdb->map_size);
-		if (!new_map_ptr) {
-			tdb->map_size -= size;
-			goto fail;
-		}
-		tdb->map_ptr = new_map_ptr;
-	} else {
-		/*
-		 * We must ensure the file is remapped before adding the space
-		 * to ensure consistency with systems like OpenBSD where
-		 * writes and mmaps are not consistent.
-		 */
-
-		/* We're ok if the mmap fails as we'll fallback to read/write */
-		tdb_mmap(tdb);
-	}
-
-	/* form a new freelist record */
-	memset(&rec,'\0',sizeof(rec));
-	rec.rec_len = size - sizeof(rec);
-
-	/* link it into the free list */
-	offset = tdb->map_size - size;
-	if (tdb_free(tdb, offset, &rec) == -1)
-		goto fail;
-
-	tdb_unlock(tdb, -1, F_WRLCK);
-	return 0;
- fail:
-	tdb_unlock(tdb, -1, F_WRLCK);
-	return -1;
-}
-
-
-/* 
-   the core of tdb_allocate - called when we have decided which
-   free list entry to use
- */
-static tdb_off tdb_allocate_ofs(TDB_CONTEXT *tdb, tdb_len length, tdb_off rec_ptr,
-				struct list_struct *rec, tdb_off last_ptr)
-{
-	struct list_struct newrec;
-	tdb_off newrec_ptr;
-
-	memset(&newrec, '\0', sizeof(newrec));
-
-	/* found it - now possibly split it up  */
-	if (rec->rec_len > length + MIN_REC_SIZE) {
-		/* Length of left piece */
-		length = TDB_ALIGN(length, TDB_ALIGNMENT);
-		
-		/* Right piece to go on free list */
-		newrec.rec_len = rec->rec_len - (sizeof(*rec) + length);
-		newrec_ptr = rec_ptr + sizeof(*rec) + length;
-		
-		/* And left record is shortened */
-		rec->rec_len = length;
-	} else {
-		newrec_ptr = 0;
-	}
-	
-	/* Remove allocated record from the free list */
-	if (ofs_write(tdb, last_ptr, &rec->next) == -1) {
-		return 0;
-	}
-	
-	/* Update header: do this before we drop alloc
-	   lock, otherwise tdb_free() might try to
-	   merge with us, thinking we're free.
-	   (Thanks Jeremy Allison). */
-	rec->magic = TDB_MAGIC;
-	if (rec_write(tdb, rec_ptr, rec) == -1) {
-		return 0;
-	}
-	
-	/* Did we create new block? */
-	if (newrec_ptr) {
-		/* Update allocated record tailer (we
-		   shortened it). */
-		if (update_tailer(tdb, rec_ptr, rec) == -1) {
-			return 0;
-		}
-		
-		/* Free new record */
-		if (tdb_free(tdb, newrec_ptr, &newrec) == -1) {
-			return 0;
-		}
-	}
-	
-	/* all done - return the new record offset */
-	return rec_ptr;
-}
-
-/* allocate some space from the free list. The offset returned points
-   to a unconnected list_struct within the database with room for at
-   least length bytes of total data
-
-   0 is returned if the space could not be allocated
- */
-static tdb_off tdb_allocate(TDB_CONTEXT *tdb, tdb_len length,
-			    struct list_struct *rec)
-{
-	tdb_off rec_ptr, last_ptr, newrec_ptr;
-	struct {
-		tdb_off rec_ptr, last_ptr;
-		tdb_len rec_len;
-	} bestfit = { 0, 0, 0 };
-
-	if (tdb_lock(tdb, -1, F_WRLCK) == -1)
-		return 0;
-
-	/* Extra bytes required for tailer */
-	length += sizeof(tdb_off);
-
- again:
-	last_ptr = FREELIST_TOP;
-
-	/* read in the freelist top */
-	if (ofs_read(tdb, FREELIST_TOP, &rec_ptr) == -1)
-		goto fail;
-
-	bestfit.rec_ptr = 0;
-
-	/* 
-	   this is a best fit allocation strategy. Originally we used
-	   a first fit strategy, but it suffered from massive fragmentation
-	   issues when faced with a slowly increasing record size.
-	 */
-	while (rec_ptr) {
-		if (rec_free_read(tdb, rec_ptr, rec) == -1) {
-			goto fail;
-		}
-
-		if (rec->rec_len >= length) {
-			if (bestfit.rec_ptr == 0 ||
-			    rec->rec_len < bestfit.rec_len) {
-				bestfit.rec_len = rec->rec_len;
-				bestfit.rec_ptr = rec_ptr;
-				bestfit.last_ptr = last_ptr;
-				/* consider a fit to be good enough if we aren't wasting more than half the space */
-				if (bestfit.rec_len < 2*length) {
-					break;
-				}
-			}
-		}
-
-		/* move to the next record */
-		last_ptr = rec_ptr;
-		rec_ptr = rec->next;
-	}
-
-	if (bestfit.rec_ptr != 0) {
-		if (rec_free_read(tdb, bestfit.rec_ptr, rec) == -1) {
-			goto fail;
-		}
-
-		newrec_ptr = tdb_allocate_ofs(tdb, length, bestfit.rec_ptr, rec, bestfit.last_ptr);
-		tdb_unlock(tdb, -1, F_WRLCK);
-		return newrec_ptr;
-	}
-
-	/* we didn't find enough space. See if we can expand the
-	   database and if we can then try again */
-	if (tdb_expand(tdb, length + sizeof(*rec)) == 0)
-		goto again;
- fail:
-	tdb_unlock(tdb, -1, F_WRLCK);
-	return 0;
-}
-
-/* initialise a new database with a specified hash size */
-static int tdb_new_database(TDB_CONTEXT *tdb, int hash_size)
-{
-	struct tdb_header *newdb;
-	int size, ret = -1;
-
-	/* We make it up in memory, then write it out if not internal */
-	size = sizeof(struct tdb_header) + (hash_size+1)*sizeof(tdb_off);
-	if (!(newdb = talloc_zero_size(tdb, size)))
-		return TDB_ERRCODE(TDB_ERR_OOM, -1);
-
-	/* Fill in the header */
-	newdb->version = TDB_VERSION;
-	newdb->hash_size = hash_size;
-	if (tdb->flags & TDB_INTERNAL) {
-		tdb->map_size = size;
-		tdb->map_ptr = (char *)newdb;
-		memcpy(&tdb->header, newdb, sizeof(tdb->header));
-		/* Convert the `ondisk' version if asked. */
-		CONVERT(*newdb);
-		return 0;
-	}
-	if (lseek(tdb->fd, 0, SEEK_SET) == -1)
-		goto fail;
-
-	if (ftruncate(tdb->fd, 0) == -1)
-		goto fail;
-
-	/* This creates an endian-converted header, as if read from disk */
-	CONVERT(*newdb);
-	memcpy(&tdb->header, newdb, sizeof(tdb->header));
-	/* Don't endian-convert the magic food! */
-	memcpy(newdb->magic_food, TDB_MAGIC_FOOD, strlen(TDB_MAGIC_FOOD)+1);
-	if (write(tdb->fd, newdb, size) != size)
-		ret = -1;
-	else
-		ret = 0;
-
-  fail:
-	SAFE_FREE(newdb);
-	return ret;
-}
-
-/* Returns 0 on fail.  On success, return offset of record, and fills
-   in rec */
-static tdb_off tdb_find(TDB_CONTEXT *tdb, TDB_DATA key, uint32_t hash,
-			struct list_struct *r)
-{
-	tdb_off rec_ptr;
-	
-	/* read in the hash top */
-	if (ofs_read(tdb, TDB_HASH_TOP(hash), &rec_ptr) == -1)
-		return 0;
-
-	/* keep looking until we find the right record */
-	while (rec_ptr) {
-		if (rec_read(tdb, rec_ptr, r) == -1)
-			return 0;
-
-		if (!TDB_DEAD(r) && hash==r->full_hash && key.dsize==r->key_len) {
-			/* a very likely hit - read the key */
-			int cmp = tdb_key_eq(tdb, rec_ptr + sizeof(*r), key);
-			if (cmp < 0)
-				return 0;
-			else if (cmp > 0)
-				return rec_ptr;
-		}
-		rec_ptr = r->next;
-	}
-	return TDB_ERRCODE(TDB_ERR_NOEXIST, 0);
-}
-
-/* As tdb_find, but if you succeed, keep the lock */
-static tdb_off tdb_find_lock_hash(TDB_CONTEXT *tdb, TDB_DATA key, uint32_t hash, int locktype,
-			     struct list_struct *rec)
-{
-	uint32_t rec_ptr;
-
-	if (tdb_lock(tdb, BUCKET(hash), locktype) == -1)
-		return 0;
-	if (!(rec_ptr = tdb_find(tdb, key, hash, rec)))
-		tdb_unlock(tdb, BUCKET(hash), locktype);
-	return rec_ptr;
-}
-
-enum TDB_ERROR tdb_error(TDB_CONTEXT *tdb)
-{
-	return tdb->ecode;
-}
-
-static struct tdb_errname {
-	enum TDB_ERROR ecode; const char *estring;
-} emap[] = { {TDB_SUCCESS, "Success"},
-	     {TDB_ERR_CORRUPT, "Corrupt database"},
-	     {TDB_ERR_IO, "IO Error"},
-	     {TDB_ERR_LOCK, "Locking error"},
-	     {TDB_ERR_OOM, "Out of memory"},
-	     {TDB_ERR_EXISTS, "Record exists"},
-	     {TDB_ERR_NOLOCK, "Lock exists on other keys"},
-	     {TDB_ERR_NOEXIST, "Record does not exist"} };
-
-/* Error string for the last tdb error */
-const char *tdb_errorstr(TDB_CONTEXT *tdb)
-{
-	uint32_t i;
-	for (i = 0; i < sizeof(emap) / sizeof(struct tdb_errname); i++)
-		if (tdb->ecode == emap[i].ecode)
-			return emap[i].estring;
-	return "Invalid error code";
-}
-
-/* update an entry in place - this only works if the new data size
-   is <= the old data size and the key exists.
-   on failure return -1.
-*/
-
-static int tdb_update_hash(TDB_CONTEXT *tdb, TDB_DATA key, uint32_t hash, TDB_DATA dbuf)
-{
-	struct list_struct rec;
-	tdb_off rec_ptr;
-
-	/* find entry */
-	if (!(rec_ptr = tdb_find(tdb, key, hash, &rec)))
-		return -1;
-
-	/* must be long enough key, data and tailer */
-	if (rec.rec_len < key.dsize + dbuf.dsize + sizeof(tdb_off)) {
-		tdb->ecode = TDB_SUCCESS; /* Not really an error */
-		return -1;
-	}
-
-	if (tdb_write(tdb, rec_ptr + sizeof(rec) + rec.key_len,
-		      dbuf.dptr, dbuf.dsize) == -1)
-		return -1;
-
-	if (dbuf.dsize != rec.data_len) {
-		/* update size */
-		rec.data_len = dbuf.dsize;
-		return rec_write(tdb, rec_ptr, &rec);
-	}
- 
-	return 0;
-}
-
-/* find an entry in the database given a key */
-/* If an entry doesn't exist tdb_err will be set to
- * TDB_ERR_NOEXIST. If a key has no data attached
- * then the TDB_DATA will have zero length but
- * a non-zero pointer
- */
-
-TDB_DATA tdb_fetch(TDB_CONTEXT *tdb, TDB_DATA key)
-{
-	tdb_off rec_ptr;
-	struct list_struct rec;
-	TDB_DATA ret;
-	uint32_t hash;
-
-	/* find which hash bucket it is in */
-	hash = tdb->hash_fn(&key);
-	if (!(rec_ptr = tdb_find_lock_hash(tdb,key,hash,F_RDLCK,&rec)))
-		return tdb_null;
-
-	ret.dptr = tdb_alloc_read(tdb, rec_ptr + sizeof(rec) + rec.key_len,
-				  rec.data_len);
-	ret.dsize = rec.data_len;
-	tdb_unlock(tdb, BUCKET(rec.full_hash), F_RDLCK);
-	return ret;
-}
-
-/* check if an entry in the database exists 
-
-   note that 1 is returned if the key is found and 0 is returned if not found
-   this doesn't match the conventions in the rest of this module, but is
-   compatible with gdbm
-*/
-static int tdb_exists_hash(TDB_CONTEXT *tdb, TDB_DATA key, uint32_t hash)
-{
-	struct list_struct rec;
-	
-	if (tdb_find_lock_hash(tdb, key, hash, F_RDLCK, &rec) == 0)
-		return 0;
-	tdb_unlock(tdb, BUCKET(rec.full_hash), F_RDLCK);
-	return 1;
-}
-
-/* record lock stops delete underneath */
-static int lock_record(TDB_CONTEXT *tdb, tdb_off off)
-{
-	return off ? tdb_brlock(tdb, off, F_RDLCK, F_SETLKW, 0) : 0;
-}
-/*
-  Write locks override our own fcntl readlocks, so check it here.
-  Note this is meant to be F_SETLK, *not* F_SETLKW, as it's not
-  an error to fail to get the lock here.
-*/
- 
-static int write_lock_record(TDB_CONTEXT *tdb, tdb_off off)
-{
-	struct tdb_traverse_lock *i;
-	for (i = &tdb->travlocks; i; i = i->next)
-		if (i->off == off)
-			return -1;
-	return tdb_brlock(tdb, off, F_WRLCK, F_SETLK, 1);
-}
-
-/*
-  Note this is meant to be F_SETLK, *not* F_SETLKW, as it's not
-  an error to fail to get the lock here.
-*/
-
-static int write_unlock_record(TDB_CONTEXT *tdb, tdb_off off)
-{
-	return tdb_brlock(tdb, off, F_UNLCK, F_SETLK, 0);
-}
-/* fcntl locks don't stack: avoid unlocking someone else's */
-static int unlock_record(TDB_CONTEXT *tdb, tdb_off off)
-{
-	struct tdb_traverse_lock *i;
-	uint32_t count = 0;
-
-	if (off == 0)
-		return 0;
-	for (i = &tdb->travlocks; i; i = i->next)
-		if (i->off == off)
-			count++;
-	return (count == 1 ? tdb_brlock(tdb, off, F_UNLCK, F_SETLKW, 0) : 0);
-}
-
-/* actually delete an entry in the database given the offset */
-static int do_delete(TDB_CONTEXT *tdb, tdb_off rec_ptr, struct list_struct*rec)
-{
-	tdb_off last_ptr, i;
-	struct list_struct lastrec;
-
-	if (tdb->read_only) return -1;
-
-	if (write_lock_record(tdb, rec_ptr) == -1) {
-		/* Someone traversing here: mark it as dead */
-		rec->magic = TDB_DEAD_MAGIC;
-		return rec_write(tdb, rec_ptr, rec);
-	}
-	if (write_unlock_record(tdb, rec_ptr) != 0)
-		return -1;
-
-	/* find previous record in hash chain */
-	if (ofs_read(tdb, TDB_HASH_TOP(rec->full_hash), &i) == -1)
-		return -1;
-	for (last_ptr = 0; i != rec_ptr; last_ptr = i, i = lastrec.next)
-		if (rec_read(tdb, i, &lastrec) == -1)
-			return -1;
-
-	/* unlink it: next ptr is at start of record. */
-	if (last_ptr == 0)
-		last_ptr = TDB_HASH_TOP(rec->full_hash);
-	if (ofs_write(tdb, last_ptr, &rec->next) == -1)
-		return -1;
-
-	/* recover the space */
-	if (tdb_free(tdb, rec_ptr, rec) == -1)
-		return -1;
-	return 0;
-}
-
-/* Uses traverse lock: 0 = finish, -1 = error, other = record offset */
-static int tdb_next_lock(TDB_CONTEXT *tdb, struct tdb_traverse_lock *tlock,
-			 struct list_struct *rec)
-{
-	int want_next = (tlock->off != 0);
-
-	/* Lock each chain from the start one. */
-	for (; tlock->hash < tdb->header.hash_size; tlock->hash++) {
-
-		/* this is an optimisation for the common case where
-		   the hash chain is empty, which is particularly
-		   common for the use of tdb with ldb, where large
-		   hashes are used. In that case we spend most of our
-		   time in tdb_brlock(), locking empty hash chains.
-
-		   To avoid this, we do an unlocked pre-check to see
-		   if the hash chain is empty before starting to look
-		   inside it. If it is empty then we can avoid that
-		   hash chain. If it isn't empty then we can't believe
-		   the value we get back, as we read it without a
-		   lock, so instead we get the lock and re-fetch the
-		   value below.
-
-		   Notice that not doing this optimisation on the
-		   first hash chain is critical. We must guarantee
-		   that we have done at least one fcntl lock at the
-		   start of a search to guarantee that memory is
-		   coherent on SMP systems. If records are added by
-		   others during the search then thats OK, and we
-		   could possibly miss those with this trick, but we
-		   could miss them anyway without this trick, so the
-		   semantics don't change.
-
-		   With a non-indexed ldb search this trick gains us a
-		   factor of around 80 in speed on a linux 2.6.x
-		   system (testing using ldbtest).
-		 */
-		if (!tlock->off && tlock->hash != 0) {
-			uint32_t off;
-			if (tdb->map_ptr) {
-				for (;tlock->hash < tdb->header.hash_size;tlock->hash++) {
-					if (0 != *(uint32_t *)(TDB_HASH_TOP(tlock->hash) + (unsigned char *)tdb->map_ptr)) {
-						break;
-					}
-				}
-				if (tlock->hash == tdb->header.hash_size) {
-					continue;
-				}
-			} else {
-				if (ofs_read(tdb, TDB_HASH_TOP(tlock->hash), &off) == 0 &&
-				    off == 0) {
-					continue;
-				}
-			}
-		}
-
-		if (tdb_lock(tdb, tlock->hash, F_WRLCK) == -1)
-			return -1;
-
-		/* No previous record?  Start at top of chain. */
-		if (!tlock->off) {
-			if (ofs_read(tdb, TDB_HASH_TOP(tlock->hash),
-				     &tlock->off) == -1)
-				goto fail;
-		} else {
-			/* Otherwise unlock the previous record. */
-			if (unlock_record(tdb, tlock->off) != 0)
-				goto fail;
-		}
-
-		if (want_next) {
-			/* We have offset of old record: grab next */
-			if (rec_read(tdb, tlock->off, rec) == -1)
-				goto fail;
-			tlock->off = rec->next;
-		}
-
-		/* Iterate through chain */
-		while( tlock->off) {
-			tdb_off current;
-			if (rec_read(tdb, tlock->off, rec) == -1)
-				goto fail;
-
-			/* Detect infinite loops. From "Shlomi Yaakobovich" <Shlomi@exanet.com>. */
-			if (tlock->off == rec->next) {
-				TDB_LOG((tdb, 0, "tdb_next_lock: loop detected.\n"));
-				goto fail;
-			}
-
-			if (!TDB_DEAD(rec)) {
-				/* Woohoo: we found one! */
-				if (lock_record(tdb, tlock->off) != 0)
-					goto fail;
-				return tlock->off;
-			}
-
-			/* Try to clean dead ones from old traverses */
-			current = tlock->off;
-			tlock->off = rec->next;
-			if (!tdb->read_only && 
-			    do_delete(tdb, current, rec) != 0)
-				goto fail;
-		}
-		tdb_unlock(tdb, tlock->hash, F_WRLCK);
-		want_next = 0;
-	}
-	/* We finished iteration without finding anything */
-	return TDB_ERRCODE(TDB_SUCCESS, 0);
-
- fail:
-	tlock->off = 0;
-	if (tdb_unlock(tdb, tlock->hash, F_WRLCK) != 0)
-		TDB_LOG((tdb, 0, "tdb_next_lock: On error unlock failed!\n"));
-	return -1;
-}
-
-/* traverse the entire database - calling fn(tdb, key, data) on each element.
-   return -1 on error or the record count traversed
-   if fn is NULL then it is not called
-   a non-zero return value from fn() indicates that the traversal should stop
-  */
-int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *private)
-{
-	TDB_DATA key, dbuf;
-	struct list_struct rec;
-	struct tdb_traverse_lock tl = { NULL, 0, 0 };
-	int ret, count = 0;
-
-	/* This was in the initializaton, above, but the IRIX compiler
-	 * did not like it.  crh
-	 */
-	tl.next = tdb->travlocks.next;
-
-	/* fcntl locks don't stack: beware traverse inside traverse */
-	tdb->travlocks.next = &tl;
-
-	/* tdb_next_lock places locks on the record returned, and its chain */
-	while ((ret = tdb_next_lock(tdb, &tl, &rec)) > 0) {
-		count++;
-		/* now read the full record */
-		key.dptr = tdb_alloc_read(tdb, tl.off + sizeof(rec), 
-					  rec.key_len + rec.data_len);
-		if (!key.dptr) {
-			ret = -1;
-			if (tdb_unlock(tdb, tl.hash, F_WRLCK) != 0)
-				goto out;
-			if (unlock_record(tdb, tl.off) != 0)
-				TDB_LOG((tdb, 0, "tdb_traverse: key.dptr == NULL and unlock_record failed!\n"));
-			goto out;
-		}
-		key.dsize = rec.key_len;
-		dbuf.dptr = key.dptr + rec.key_len;
-		dbuf.dsize = rec.data_len;
-
-		/* Drop chain lock, call out */
-		if (tdb_unlock(tdb, tl.hash, F_WRLCK) != 0) {
-			ret = -1;
-			goto out;
-		}
-		if (fn && fn(tdb, key, dbuf, private)) {
-			/* They want us to terminate traversal */
-			ret = count;
-			if (unlock_record(tdb, tl.off) != 0) {
-				TDB_LOG((tdb, 0, "tdb_traverse: unlock_record failed!\n"));
-				ret = -1;
-			}
-			tdb->travlocks.next = tl.next;
-			SAFE_FREE(key.dptr);
-			return count;
-		}
-		SAFE_FREE(key.dptr);
-	}
-out:
-	tdb->travlocks.next = tl.next;
-	if (ret < 0)
-		return -1;
-	else
-		return count;
-}
-
-/* find the first entry in the database and return its key */
-TDB_DATA tdb_firstkey(TDB_CONTEXT *tdb)
-{
-	TDB_DATA key;
-	struct list_struct rec;
-
-	/* release any old lock */
-	if (unlock_record(tdb, tdb->travlocks.off) != 0)
-		return tdb_null;
-	tdb->travlocks.off = tdb->travlocks.hash = 0;
-
-	if (tdb_next_lock(tdb, &tdb->travlocks, &rec) <= 0)
-		return tdb_null;
-	/* now read the key */
-	key.dsize = rec.key_len;
-	key.dptr =tdb_alloc_read(tdb,tdb->travlocks.off+sizeof(rec),key.dsize);
-	if (tdb_unlock(tdb, BUCKET(tdb->travlocks.hash), F_WRLCK) != 0)
-		TDB_LOG((tdb, 0, "tdb_firstkey: error occurred while tdb_unlocking!\n"));
-	return key;
-}
-
-/* find the next entry in the database, returning its key */
-TDB_DATA tdb_nextkey(TDB_CONTEXT *tdb, TDB_DATA oldkey)
-{
-	uint32_t oldhash;
-	TDB_DATA key = tdb_null;
-	struct list_struct rec;
-	char *k = NULL;
-
-	/* Is locked key the old key?  If so, traverse will be reliable. */
-	if (tdb->travlocks.off) {
-		if (tdb_lock(tdb,tdb->travlocks.hash,F_WRLCK))
-			return tdb_null;
-		if (rec_read(tdb, tdb->travlocks.off, &rec) == -1
-		    || !(k = tdb_alloc_read(tdb,tdb->travlocks.off+sizeof(rec),
-					    rec.key_len))
-		    || memcmp(k, oldkey.dptr, oldkey.dsize) != 0) {
-			/* No, it wasn't: unlock it and start from scratch */
-			if (unlock_record(tdb, tdb->travlocks.off) != 0)
-				return tdb_null;
-			if (tdb_unlock(tdb, tdb->travlocks.hash, F_WRLCK) != 0)
-				return tdb_null;
-			tdb->travlocks.off = 0;
-		}
-
-		SAFE_FREE(k);
-	}
-
-	if (!tdb->travlocks.off) {
-		/* No previous element: do normal find, and lock record */
-		tdb->travlocks.off = tdb_find_lock_hash(tdb, oldkey, tdb->hash_fn(&oldkey), F_WRLCK, &rec);
-		if (!tdb->travlocks.off)
-			return tdb_null;
-		tdb->travlocks.hash = BUCKET(rec.full_hash);
-		if (lock_record(tdb, tdb->travlocks.off) != 0) {
-			TDB_LOG((tdb, 0, "tdb_nextkey: lock_record failed (%s)!\n", strerror(errno)));
-			return tdb_null;
-		}
-	}
-	oldhash = tdb->travlocks.hash;
-
-	/* Grab next record: locks chain and returned record,
-	   unlocks old record */
-	if (tdb_next_lock(tdb, &tdb->travlocks, &rec) > 0) {
-		key.dsize = rec.key_len;
-		key.dptr = tdb_alloc_read(tdb, tdb->travlocks.off+sizeof(rec),
-					  key.dsize);
-		/* Unlock the chain of this new record */
-		if (tdb_unlock(tdb, tdb->travlocks.hash, F_WRLCK) != 0)
-			TDB_LOG((tdb, 0, "tdb_nextkey: WARNING tdb_unlock failed!\n"));
-	}
-	/* Unlock the chain of old record */
-	if (tdb_unlock(tdb, BUCKET(oldhash), F_WRLCK) != 0)
-		TDB_LOG((tdb, 0, "tdb_nextkey: WARNING tdb_unlock failed!\n"));
-	return key;
-}
-
-/* delete an entry in the database given a key */
-static int tdb_delete_hash(TDB_CONTEXT *tdb, TDB_DATA key, uint32_t hash)
-{
-	tdb_off rec_ptr;
-	struct list_struct rec;
-	int ret;
-
-	if (!(rec_ptr = tdb_find_lock_hash(tdb, key, hash, F_WRLCK, &rec)))
-		return -1;
-	ret = do_delete(tdb, rec_ptr, &rec);
-	if (tdb_unlock(tdb, BUCKET(rec.full_hash), F_WRLCK) != 0)
-		TDB_LOG((tdb, 0, "tdb_delete: WARNING tdb_unlock failed!\n"));
-	return ret;
-}
-
-int tdb_delete(TDB_CONTEXT *tdb, TDB_DATA key)
-{
-	uint32_t hash = tdb->hash_fn(&key);
-	return tdb_delete_hash(tdb, key, hash);
-}
-
-/* store an element in the database, replacing any existing element
-   with the same key 
-
-   return 0 on success, -1 on failure
-*/
-int tdb_store(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, int flag)
-{
-	struct list_struct rec;
-	uint32_t hash;
-	tdb_off rec_ptr;
-	char *p = NULL;
-	int ret = 0;
-
-	/* find which hash bucket it is in */
-	hash = tdb->hash_fn(&key);
-	if (tdb_lock(tdb, BUCKET(hash), F_WRLCK) == -1)
-		return -1;
-
-	/* check for it existing, on insert. */
-	if (flag == TDB_INSERT) {
-		if (tdb_exists_hash(tdb, key, hash)) {
-			tdb->ecode = TDB_ERR_EXISTS;
-			goto fail;
-		}
-	} else {
-		/* first try in-place update, on modify or replace. */
-		if (tdb_update_hash(tdb, key, hash, dbuf) == 0)
-			goto out;
-		if (tdb->ecode == TDB_ERR_NOEXIST &&
-		    flag == TDB_MODIFY) {
-			/* if the record doesn't exist and we are in TDB_MODIFY mode then
-			 we should fail the store */
-			goto fail;
-		}
-	}
-	/* reset the error code potentially set by the tdb_update() */
-	tdb->ecode = TDB_SUCCESS;
-
-	/* delete any existing record - if it doesn't exist we don't
-           care.  Doing this first reduces fragmentation, and avoids
-           coalescing with `allocated' block before it's updated. */
-	if (flag != TDB_INSERT)
-		tdb_delete_hash(tdb, key, hash);
-
-	/* Copy key+value *before* allocating free space in case malloc
-	   fails and we are left with a dead spot in the tdb. */
-
-	if (!(p = (char *)talloc_size(tdb, key.dsize + dbuf.dsize))) {
-		tdb->ecode = TDB_ERR_OOM;
-		goto fail;
-	}
-
-	memcpy(p, key.dptr, key.dsize);
-	if (dbuf.dsize)
-		memcpy(p+key.dsize, dbuf.dptr, dbuf.dsize);
-
-	/* we have to allocate some space */
-	if (!(rec_ptr = tdb_allocate(tdb, key.dsize + dbuf.dsize, &rec)))
-		goto fail;
-
-	/* Read hash top into next ptr */
-	if (ofs_read(tdb, TDB_HASH_TOP(hash), &rec.next) == -1)
-		goto fail;
-
-	rec.key_len = key.dsize;
-	rec.data_len = dbuf.dsize;
-	rec.full_hash = hash;
-	rec.magic = TDB_MAGIC;
-
-	/* write out and point the top of the hash chain at it */
-	if (rec_write(tdb, rec_ptr, &rec) == -1
-	    || tdb_write(tdb, rec_ptr+sizeof(rec), p, key.dsize+dbuf.dsize)==-1
-	    || ofs_write(tdb, TDB_HASH_TOP(hash), &rec_ptr) == -1) {
-		/* Need to tdb_unallocate() here */
-		goto fail;
-	}
- out:
-	SAFE_FREE(p); 
-	tdb_unlock(tdb, BUCKET(hash), F_WRLCK);
-	return ret;
-fail:
-	ret = -1;
-	goto out;
-}
-
-static int tdb_already_open(dev_t device,
-			    ino_t ino)
-{
-	TDB_CONTEXT *i;
-	
-	for (i = tdbs; i; i = i->next) {
-		if (i->device == device && i->inode == ino) {
-			return 1;
-		}
-	}
-
-	return 0;
-}
-
-/* a default logging function */
-static void null_log_fn(TDB_CONTEXT *tdb __attribute__((unused)),
-			int level __attribute__((unused)),
-			const char *fmt __attribute__((unused)), ...)
-{
-}
-
-
-TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
-			 int open_flags, mode_t mode,
-			 tdb_log_func log_fn,
-			 tdb_hash_func hash_fn)
-{
-	TDB_CONTEXT *tdb;
-	struct stat st;
-	int rev = 0, locked = 0;
-	uint8_t *vp;
-	uint32_t vertest;
-
-	if (!(tdb = talloc_zero(name, TDB_CONTEXT))) {
-		/* Can't log this */
-		errno = ENOMEM;
-		goto fail;
-	}
-	tdb->fd = -1;
-	tdb->name = NULL;
-	tdb->map_ptr = NULL;
-	tdb->flags = tdb_flags;
-	tdb->open_flags = open_flags;
-	tdb->log_fn = log_fn?log_fn:null_log_fn;
-	tdb->hash_fn = hash_fn ? hash_fn : default_tdb_hash;
-
-	if ((open_flags & O_ACCMODE) == O_WRONLY) {
-		TDB_LOG((tdb, 0, "tdb_open_ex: can't open tdb %s write-only\n",
-			 name));
-		errno = EINVAL;
-		goto fail;
-	}
-	
-	if (hash_size == 0)
-		hash_size = DEFAULT_HASH_SIZE;
-	if ((open_flags & O_ACCMODE) == O_RDONLY) {
-		tdb->read_only = 1;
-		/* read only databases don't do locking or clear if first */
-		tdb->flags |= TDB_NOLOCK;
-		tdb->flags &= ~TDB_CLEAR_IF_FIRST;
-	}
-
-	/* internal databases don't mmap or lock, and start off cleared */
-	if (tdb->flags & TDB_INTERNAL) {
-		tdb->flags |= (TDB_NOLOCK | TDB_NOMMAP);
-		tdb->flags &= ~TDB_CLEAR_IF_FIRST;
-		if (tdb_new_database(tdb, hash_size) != 0) {
-			TDB_LOG((tdb, 0, "tdb_open_ex: tdb_new_database failed!"));
-			goto fail;
-		}
-		goto internal;
-	}
-
-	if ((tdb->fd = open(name, open_flags, mode)) == -1) {
-		TDB_LOG((tdb, 5, "tdb_open_ex: could not open file %s: %s\n",
-			 name, strerror(errno)));
-		goto fail;	/* errno set by open(2) */
-	}
-
-	/* ensure there is only one process initialising at once */
-	if (tdb_brlock(tdb, GLOBAL_LOCK, F_WRLCK, F_SETLKW, 0) == -1) {
-		TDB_LOG((tdb, 0, "tdb_open_ex: failed to get global lock on %s: %s\n",
-			 name, strerror(errno)));
-		goto fail;	/* errno set by tdb_brlock */
-	}
-
-	/* we need to zero database if we are the only one with it open */
-	if ((tdb_flags & TDB_CLEAR_IF_FIRST) &&
-		(locked = (tdb_brlock(tdb, ACTIVE_LOCK, F_WRLCK, F_SETLK, 0) == 0))) {
-		open_flags |= O_CREAT;
-		if (ftruncate(tdb->fd, 0) == -1) {
-			TDB_LOG((tdb, 0, "tdb_open_ex: "
-				 "failed to truncate %s: %s\n",
-				 name, strerror(errno)));
-			goto fail; /* errno set by ftruncate */
-		}
-	}
-
-	if (read(tdb->fd, &tdb->header, sizeof(tdb->header)) != sizeof(tdb->header)
-	    || strcmp(tdb->header.magic_food, TDB_MAGIC_FOOD) != 0
-	    || (tdb->header.version != TDB_VERSION
-		&& !(rev = (tdb->header.version==TDB_BYTEREV(TDB_VERSION))))) {
-		/* its not a valid database - possibly initialise it */
-		if (!(open_flags & O_CREAT) || tdb_new_database(tdb, hash_size) == -1) {
-			errno = EIO; /* ie bad format or something */
-			goto fail;
-		}
-		rev = (tdb->flags & TDB_CONVERT);
-	}
-	vp = (uint8_t *)&tdb->header.version;
-	vertest = (((uint32_t)vp[0]) << 24) | (((uint32_t)vp[1]) << 16) |
-		  (((uint32_t)vp[2]) << 8) | (uint32_t)vp[3];
-	tdb->flags |= (vertest==TDB_VERSION) ? TDB_BIGENDIAN : 0;
-	if (!rev)
-		tdb->flags &= ~TDB_CONVERT;
-	else {
-		tdb->flags |= TDB_CONVERT;
-		convert(&tdb->header, sizeof(tdb->header));
-	}
-	if (fstat(tdb->fd, &st) == -1)
-		goto fail;
-
-	/* Is it already in the open list?  If so, fail. */
-	if (tdb_already_open(st.st_dev, st.st_ino)) {
-		TDB_LOG((tdb, 2, "tdb_open_ex: "
-			 "%s (%d,%d) is already open in this process\n",
-			 name, (int)st.st_dev, (int)st.st_ino));
-		errno = EBUSY;
-		goto fail;
-	}
-
-	if (!(tdb->name = (char *)talloc_strdup(tdb, name))) {
-		errno = ENOMEM;
-		goto fail;
-	}
-
-	tdb->map_size = st.st_size;
-	tdb->device = st.st_dev;
-	tdb->inode = st.st_ino;
-	tdb->locked = talloc_zero_array(tdb, struct tdb_lock_type,
-					tdb->header.hash_size+1);
-	if (!tdb->locked) {
-		TDB_LOG((tdb, 2, "tdb_open_ex: "
-			 "failed to allocate lock structure for %s\n",
-			 name));
-		errno = ENOMEM;
-		goto fail;
-	}
-	tdb_mmap(tdb);
-	if (locked) {
-		if (tdb_brlock(tdb, ACTIVE_LOCK, F_UNLCK, F_SETLK, 0) == -1) {
-			TDB_LOG((tdb, 0, "tdb_open_ex: "
-				 "failed to take ACTIVE_LOCK on %s: %s\n",
-				 name, strerror(errno)));
-			goto fail;
-		}
-
-	}
-
-	/* We always need to do this if the CLEAR_IF_FIRST flag is set, even if
-	   we didn't get the initial exclusive lock as we need to let all other
-	   users know we're using it. */
-
-	if (tdb_flags & TDB_CLEAR_IF_FIRST) {
-	/* leave this lock in place to indicate it's in use */
-	if (tdb_brlock(tdb, ACTIVE_LOCK, F_RDLCK, F_SETLKW, 0) == -1)
-		goto fail;
-	}
-
-
- internal:
-	/* Internal (memory-only) databases skip all the code above to
-	 * do with disk files, and resume here by releasing their
-	 * global lock and hooking into the active list. */
-	if (tdb_brlock(tdb, GLOBAL_LOCK, F_UNLCK, F_SETLKW, 0) == -1)
-		goto fail;
-	tdb->next = tdbs;
-	tdbs = tdb;
-	return tdb;
-
- fail:
-	{ int save_errno = errno;
-
-	if (!tdb)
-		return NULL;
-	
-	if (tdb->map_ptr) {
-		if (tdb->flags & TDB_INTERNAL)
-			SAFE_FREE(tdb->map_ptr);
-		else
-			tdb_munmap(tdb);
-	}
-	SAFE_FREE(tdb->name);
-	if (tdb->fd != -1)
-		if (close(tdb->fd) != 0)
-			TDB_LOG((tdb, 5, "tdb_open_ex: failed to close tdb->fd on error!\n"));
-	SAFE_FREE(tdb->locked);
-	SAFE_FREE(tdb);
-	errno = save_errno;
-	return NULL;
-	}
-}
-
-/**
- * Close a database.
- *
- * @returns -1 for error; 0 for success.
- **/
-int tdb_close(TDB_CONTEXT *tdb)
-{
-	TDB_CONTEXT **i;
-	int ret = 0;
-
-	if (tdb->map_ptr) {
-		if (tdb->flags & TDB_INTERNAL)
-			SAFE_FREE(tdb->map_ptr);
-		else
-			tdb_munmap(tdb);
-	}
-	SAFE_FREE(tdb->name);
-	if (tdb->fd != -1)
-		ret = close(tdb->fd);
-	SAFE_FREE(tdb->locked);
-
-	/* Remove from contexts list */
-	for (i = &tdbs; *i; i = &(*i)->next) {
-		if (*i == tdb) {
-			*i = tdb->next;
-			break;
-		}
-	}
-
-	memset(tdb, 0, sizeof(*tdb));
-	SAFE_FREE(tdb);
-
-	return ret;
-}
diff --git a/tools/xenstore/tdb.h b/tools/xenstore/tdb.h
deleted file mode 100644
index ce3c7339f8..0000000000
--- a/tools/xenstore/tdb.h
+++ /dev/null
@@ -1,132 +0,0 @@
-#ifndef __TDB_H__
-#define __TDB_H__
-
-#include "utils.h"
-
-/* 
-   Unix SMB/CIFS implementation.
-
-   trivial database library
-
-   Copyright (C) Andrew Tridgell 1999-2004
-   
-     ** NOTE! The following LGPL license applies to the tdb
-     ** library. This does NOT imply that all of Samba is released
-     ** under the LGPL
-   
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-
-/* flags to tdb_store() */
-#define TDB_REPLACE 1
-#define TDB_INSERT 2
-#define TDB_MODIFY 3
-
-/* flags for tdb_open() */
-#define TDB_DEFAULT 0 /* just a readability place holder */
-#define TDB_CLEAR_IF_FIRST 1
-#define TDB_INTERNAL 2 /* don't store on disk */
-#define TDB_NOLOCK   4 /* don't do any locking */
-#define TDB_NOMMAP   8 /* don't use mmap */
-#define TDB_CONVERT 16 /* convert endian (internal use) */
-#define TDB_BIGENDIAN 32 /* header is big-endian (internal use) */
-
-#define TDB_ERRCODE(code, ret) ((tdb->ecode = (code)), ret)
-
-/* error codes */
-enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK, 
-		TDB_ERR_OOM, TDB_ERR_EXISTS, TDB_ERR_NOLOCK, TDB_ERR_LOCK_TIMEOUT,
-		TDB_ERR_NOEXIST};
-
-#ifndef uint32_t
-#define uint32_t unsigned
-#endif
-
-typedef struct TDB_DATA {
-	char *dptr;
-	size_t dsize;
-} TDB_DATA;
-
-typedef uint32_t tdb_len;
-typedef uint32_t tdb_off;
-
-/* this is stored at the front of every database */
-struct tdb_header {
-	char magic_food[32]; /* for /etc/magic */
-	uint32_t version; /* version of the code */
-	uint32_t hash_size; /* number of hash entries */
-	tdb_off rwlocks;
-	tdb_off reserved[31];
-};
-
-struct tdb_lock_type {
-	uint32_t count;
-	uint32_t ltype;
-};
-
-struct tdb_traverse_lock {
-	struct tdb_traverse_lock *next;
-	uint32_t off;
-	uint32_t hash;
-};
-
-/* this is the context structure that is returned from a db open */
-typedef struct tdb_context {
-	char *name; /* the name of the database */
-	void *map_ptr; /* where it is currently mapped */
-	int fd; /* open file descriptor for the database */
-	tdb_len map_size; /* how much space has been mapped */
-	int read_only; /* opened read-only */
-	struct tdb_lock_type *locked; /* array of chain locks */
-	enum TDB_ERROR ecode; /* error code for last tdb error */
-	struct tdb_header header; /* a cached copy of the header */
-	uint32_t flags; /* the flags passed to tdb_open */
-	struct tdb_traverse_lock travlocks; /* current traversal locks */
-	struct tdb_context *next; /* all tdbs to avoid multiple opens */
-	dev_t device;	/* uniquely identifies this tdb */
-	ino_t inode;	/* uniquely identifies this tdb */
-	void (*log_fn)(struct tdb_context *tdb, int level, const char *, ...) PRINTF_ATTRIBUTE(3,4); /* logging function */
-	uint32_t (*hash_fn)(TDB_DATA *key);
-	int open_flags; /* flags used in the open - needed by reopen */
-} TDB_CONTEXT;
-
-typedef int (*tdb_traverse_func)(TDB_CONTEXT *, TDB_DATA, TDB_DATA, void *);
-typedef void (*tdb_log_func)(TDB_CONTEXT *, int , const char *, ...);
-typedef uint32_t (*tdb_hash_func)(TDB_DATA *key);
-
-TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
-			 int open_flags, mode_t mode,
-			 tdb_log_func log_fn,
-			 tdb_hash_func hash_fn);
-
-enum TDB_ERROR tdb_error(TDB_CONTEXT *tdb);
-const char *tdb_errorstr(TDB_CONTEXT *tdb);
-TDB_DATA tdb_fetch(TDB_CONTEXT *tdb, TDB_DATA key);
-int tdb_delete(TDB_CONTEXT *tdb, TDB_DATA key);
-int tdb_store(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, int flag);
-int tdb_close(TDB_CONTEXT *tdb);
-TDB_DATA tdb_firstkey(TDB_CONTEXT *tdb);
-TDB_DATA tdb_nextkey(TDB_CONTEXT *tdb, TDB_DATA key);
-int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *);
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif /* tdb.h */
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:08:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:08:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568773.888784 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQJ-0002fv-5F; Mon, 24 Jul 2023 11:08:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568773.888784; Mon, 24 Jul 2023 11:08:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQI-0002ba-N9; Mon, 24 Jul 2023 11:08:18 +0000
Received: by outflank-mailman (input) for mailman id 568773;
 Mon, 24 Jul 2023 11:08:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtNC-0000KR-6f
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:05:06 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f1ce6737-2a11-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:05:05 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 648F820698;
 Mon, 24 Jul 2023 11:05:05 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 329F613476;
 Mon, 24 Jul 2023 11:05:05 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id eiHwCuFavmSSYgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:05:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f1ce6737-2a11-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196705; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=Q9VQYVzWF+hzExhRy+1hXjgi0IQDCM4dRNBtJbobDzo=;
	b=WY7uqR9cSk04kvTpBVpiHW4mxeMmeADXxXA9URdgoksfu5hTrCO9jHjqmHHbVB8qUIswzy
	JsgIGRF0owIAEv4dXc9Jw3pJcNG5M9JIXFabwzuZcyPqu4UqDGNgM1m5JoFU/WCn+HIx3q
	Oj/EvucfWQTQZ+1yt2lXJz/RfGx/Luc=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 24/25] tools/xenstore: rework get_node()
Date: Mon, 24 Jul 2023 13:02:46 +0200
Message-Id: <20230724110247.10520-25-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Today get_node_canonicalized() is the only caller of get_node().

In order to prepare introducing a get_node() variant returning a
pointer to const struct node, do the following restructuring:

- move the call of read_node() from get_node() into
  get_node_canonicalized()

- rename get_node() to get_node_chk_perm()

- rename get_node_canonicalized() to get_node()

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V3:
- new patch
---
 tools/xenstore/xenstored_core.c | 57 +++++++++++++++------------------
 1 file changed, 25 insertions(+), 32 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index ec20bc042d..fa07bc0c31 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -996,27 +996,26 @@ static int errno_from_parents(struct connection *conn, const void *ctx,
  * If it fails, returns NULL and sets errno.
  * Temporary memory allocations are done with ctx.
  */
-static struct node *get_node(struct connection *conn,
-			     const void *ctx,
-			     const char *name,
-			     unsigned int perm)
+static bool get_node_chk_perm(struct connection *conn, const void *ctx,
+			      const struct node *node, const char *name,
+			      unsigned int perm)
 {
-	struct node *node;
 	struct node_perms perms;
+	bool err = false;
 
-	node = read_node(conn, ctx, name);
 	/* If we don't have permission, we don't have node. */
 	if (node) {
 		node_to_node_perms(node, &perms);
 		if ((perm_for_conn(conn, &perms) & perm) != perm) {
 			errno = EACCES;
-			node = NULL;
+			err = true;
 		}
 	}
 	/* Clean up errno if they weren't supposed to know. */
-	if (!node && !read_node_can_propagate_errno())
+	if (err && !read_node_can_propagate_errno())
 		errno = errno_from_parents(conn, ctx, name, errno, perm);
-	return node;
+
+	return err;
 }
 
 static struct buffered_data *new_buffer(void *ctx)
@@ -1285,14 +1284,12 @@ const char *canonicalize(struct connection *conn, const void *ctx,
 	return name;
 }
 
-static struct node *get_node_canonicalized(struct connection *conn,
-					   const void *ctx,
-					   const char *name,
-					   const char **canonical_name,
-					   unsigned int perm,
-					   bool allow_special)
+static struct node *get_node(struct connection *conn, const void *ctx,
+			     const char *name, const char **canonical_name,
+			     unsigned int perm, bool allow_special)
 {
 	const char *tmp_name;
+	struct node *node;
 
 	if (!canonical_name)
 		canonical_name = &tmp_name;
@@ -1300,7 +1297,10 @@ static struct node *get_node_canonicalized(struct connection *conn,
 	if (!*canonical_name)
 		return NULL;
 
-	return get_node(conn, ctx, *canonical_name, perm);
+	node = read_node(conn, ctx, *canonical_name);
+
+	return get_node_chk_perm(conn, ctx, node, *canonical_name, perm)
+	       ? NULL : node;
 }
 
 static int send_directory(const void *ctx, struct connection *conn,
@@ -1308,8 +1308,7 @@ static int send_directory(const void *ctx, struct connection *conn,
 {
 	struct node *node;
 
-	node = get_node_canonicalized(conn, ctx, onearg(in), NULL,
-				      XS_PERM_READ, false);
+	node = get_node(conn, ctx, onearg(in), NULL, XS_PERM_READ, false);
 	if (!node)
 		return errno;
 
@@ -1330,8 +1329,7 @@ static int send_directory_part(const void *ctx, struct connection *conn,
 		return EINVAL;
 
 	/* First arg is node name. */
-	node = get_node_canonicalized(conn, ctx, in->buffer, NULL,
-				      XS_PERM_READ, false);
+	node = get_node(conn, ctx, in->buffer, NULL, XS_PERM_READ, false);
 	if (!node)
 		return errno;
 
@@ -1380,8 +1378,7 @@ static int do_read(const void *ctx, struct connection *conn,
 {
 	struct node *node;
 
-	node = get_node_canonicalized(conn, ctx, onearg(in), NULL,
-				      XS_PERM_READ, false);
+	node = get_node(conn, ctx, onearg(in), NULL, XS_PERM_READ, false);
 	if (!node)
 		return errno;
 
@@ -1595,8 +1592,7 @@ static int do_write(const void *ctx, struct connection *conn,
 	offset = strlen(vec[0]) + 1;
 	datalen = in->used - offset;
 
-	node = get_node_canonicalized(conn, ctx, vec[0], &name, XS_PERM_WRITE,
-				      false);
+	node = get_node(conn, ctx, vec[0], &name, XS_PERM_WRITE, false);
 	if (!node) {
 		/* No permissions, invalid input? */
 		if (errno != ENOENT)
@@ -1624,8 +1620,7 @@ static int do_mkdir(const void *ctx, struct connection *conn,
 	struct node *node;
 	const char *name;
 
-	node = get_node_canonicalized(conn, ctx, onearg(in), &name,
-				      XS_PERM_WRITE, false);
+	node = get_node(conn, ctx, onearg(in), &name, XS_PERM_WRITE, false);
 
 	/* If it already exists, fine. */
 	if (!node) {
@@ -1754,8 +1749,7 @@ static int do_rm(const void *ctx, struct connection *conn,
 	const char *name;
 	char *parentname;
 
-	node = get_node_canonicalized(conn, ctx, onearg(in), &name,
-				      XS_PERM_WRITE, false);
+	node = get_node(conn, ctx, onearg(in), &name, XS_PERM_WRITE, false);
 	if (!node) {
 		/* Didn't exist already?  Fine, if parent exists. */
 		if (errno == ENOENT) {
@@ -1797,8 +1791,7 @@ static int do_get_perms(const void *ctx, struct connection *conn,
 	unsigned int len;
 	struct node_perms perms;
 
-	node = get_node_canonicalized(conn, ctx, onearg(in), NULL, XS_PERM_READ,
-				      true);
+	node = get_node(conn, ctx, onearg(in), NULL, XS_PERM_READ, true);
 	if (!node)
 		return errno;
 
@@ -1842,8 +1835,8 @@ static int do_set_perms(const void *ctx, struct connection *conn,
 		return ENOENT;
 
 	/* We must own node to do this (tools can do this too). */
-	node = get_node_canonicalized(conn, ctx, in->buffer, &name,
-				      XS_PERM_WRITE | XS_PERM_OWNER, true);
+	node = get_node(conn, ctx, in->buffer, &name,
+			XS_PERM_WRITE | XS_PERM_OWNER, true);
 	if (!node)
 		return errno;
 
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:08:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:08:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568776.888801 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQK-00037V-Pn; Mon, 24 Jul 2023 11:08:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568776.888801; Mon, 24 Jul 2023 11:08:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQK-00034C-2x; Mon, 24 Jul 2023 11:08:20 +0000
Received: by outflank-mailman (input) for mailman id 568776;
 Mon, 24 Jul 2023 11:08:15 +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 <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtMl-0008WC-IS
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:04:39 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e11d2c96-2a11-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 13:04:37 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 5FE0D1FDF0;
 Mon, 24 Jul 2023 11:04:37 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2C72813476;
 Mon, 24 Jul 2023 11:04:37 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id Y0+DCcVavmRJYgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:04:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e11d2c96-2a11-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196677; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=bjbZ4eQM53YUxH4Mwab1m/FMELiUx/tvg5hjmsBzQfA=;
	b=REgmbadv2ZYEEJ+8i0VNYzemUkhDDAQZkG1vyXXfH7mgJpGQ2Dv9tcbEf2Nb5czzEaXzYX
	LGIqeDwFaJNfmCCPZfn9SNDTO1p503isF3HNwNFK+WVAf2dYkNjZnhT9HBTj0C1FEU3sh+
	Izc9Gm+ei6JMT1hefMYbE6NlYJy91j0=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 19/25] tools/xenstore: use struct node_hdr in struct node
Date: Mon, 24 Jul 2023 13:02:41 +0200
Message-Id: <20230724110247.10520-20-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Replace some individual fields in struct node with struct node_hdr.

This allows to add a helper for calculating the accounted memory size
of a node.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- new patch
---
 tools/xenstore/xenstored_core.c        | 108 ++++++++++++-------------
 tools/xenstore/xenstored_core.h        |  16 ++--
 tools/xenstore/xenstored_domain.c      |   5 +-
 tools/xenstore/xenstored_transaction.c |  13 +--
 4 files changed, 71 insertions(+), 71 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index c72fc0c725..404ecd0c62 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -555,6 +555,12 @@ static void initialize_fds(int *p_sock_pollfd_idx, int *ptimeout)
 	}
 }
 
+static size_t calc_node_acc_size(struct node_hdr *hdr)
+{
+	return sizeof(*hdr) + hdr->num_perms * sizeof(struct xs_permissions) +
+	       hdr->datalen + hdr->childlen;
+}
+
 const struct node_hdr *db_fetch(const char *db_name, size_t *size)
 {
 	struct node_hdr *hdr;
@@ -565,8 +571,7 @@ const struct node_hdr *db_fetch(const char *db_name, size_t *size)
 		return NULL;
 	}
 
-	*size = sizeof(*hdr) + hdr->num_perms * sizeof(struct xs_permissions) +
-		hdr->datalen + hdr->childlen;
+	*size = calc_node_acc_size(hdr);
 
 	trace_tdb("read %s size %zu\n", db_name, *size + strlen(db_name));
 
@@ -725,7 +730,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	hdr = db_fetch(db_name, &size);
 
 	if (hdr == NULL) {
-		node->generation = NO_GENERATION;
+		node->hdr.generation = NO_GENERATION;
 		err = access_node(conn, node, NODE_ACCESS_READ, NULL);
 		errno = err ? : ENOENT;
 		goto error;
@@ -734,10 +739,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	node->parent = NULL;
 
 	/* Datalen, childlen, number of permissions */
-	node->generation = hdr->generation;
-	node->num_perms = hdr->num_perms;
-	node->datalen = hdr->datalen;
-	node->childlen = hdr->childlen;
+	node->hdr = *hdr;
 	node->acc.domid = perms_from_node_hdr(hdr)->id;
 	node->acc.memory = size;
 
@@ -759,7 +761,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
 	/* Data is binary blob (usually ascii, no nul). */
 	node->data = node->perms + hdr->num_perms;
 	/* Children is strings, nul separated. */
-	node->children = node->data + node->datalen;
+	node->children = node->data + node->hdr.datalen;
 
 	if (access_node(conn, node, NODE_ACCESS_READ, NULL))
 		goto error;
@@ -795,9 +797,7 @@ int write_node_raw(struct connection *conn, const char *db_name,
 	if (domain_adjust_node_perms(node))
 		return errno;
 
-	size = sizeof(*hdr)
-		+ node->num_perms * sizeof(node->perms[0])
-		+ node->datalen + node->childlen;
+	size = calc_node_acc_size(&node->hdr);
 
 	/* Call domain_max_chk() in any case in order to record max values. */
 	if (domain_max_chk(conn, ACC_NODESZ, size) && !no_quota_check) {
@@ -812,17 +812,14 @@ int write_node_raw(struct connection *conn, const char *db_name,
 	}
 
 	hdr = data;
-	hdr->generation = node->generation;
-	hdr->num_perms = node->num_perms;
-	hdr->datalen = node->datalen;
-	hdr->childlen = node->childlen;
+	*hdr = node->hdr;
 
 	p = perms_from_node_hdr(hdr);
-	memcpy(p, node->perms, node->num_perms * sizeof(*node->perms));
-	p += node->num_perms * sizeof(*node->perms);
-	memcpy(p, node->data, node->datalen);
-	p += node->datalen;
-	memcpy(p, node->children, node->childlen);
+	memcpy(p, node->perms, node->hdr.num_perms * sizeof(*node->perms));
+	p += node->hdr.num_perms * sizeof(*node->perms);
+	memcpy(p, node->data, node->hdr.datalen);
+	p += node->hdr.datalen;
+	memcpy(p, node->children, node->hdr.childlen);
 
 	if (db_write(conn, db_name, data, size, &node->acc, mode,
 		     no_quota_check))
@@ -1289,7 +1286,7 @@ static int send_directory(const void *ctx, struct connection *conn,
 	if (!node)
 		return errno;
 
-	send_reply(conn, XS_DIRECTORY, node->children, node->childlen);
+	send_reply(conn, XS_DIRECTORY, node->children, node->hdr.childlen);
 
 	return 0;
 }
@@ -1314,10 +1311,11 @@ static int send_directory_part(const void *ctx, struct connection *conn,
 	/* Second arg is childlist offset. */
 	off = atoi(in->buffer + strlen(in->buffer) + 1);
 
-	genlen = snprintf(gen, sizeof(gen), "%"PRIu64, node->generation) + 1;
+	genlen = snprintf(gen, sizeof(gen), "%"PRIu64, node->hdr.generation) +
+		 1;
 
 	/* Offset behind list: just return a list with an empty string. */
-	if (off >= node->childlen) {
+	if (off >= node->hdr.childlen) {
 		gen[genlen] = 0;
 		send_reply(conn, XS_DIRECTORY_PART, gen, genlen + 1);
 		return 0;
@@ -1330,7 +1328,7 @@ static int send_directory_part(const void *ctx, struct connection *conn,
 	while (len + strlen(child) < maxlen) {
 		len += strlen(child) + 1;
 		child += strlen(child) + 1;
-		if (off + len == node->childlen)
+		if (off + len == node->hdr.childlen)
 			break;
 	}
 
@@ -1340,7 +1338,7 @@ static int send_directory_part(const void *ctx, struct connection *conn,
 
 	memcpy(data, gen, genlen);
 	memcpy(data + genlen, node->children + off, len);
-	if (off + len == node->childlen) {
+	if (off + len == node->hdr.childlen) {
 		data[genlen + len] = 0;
 		len++;
 	}
@@ -1360,7 +1358,7 @@ static int do_read(const void *ctx, struct connection *conn,
 	if (!node)
 		return errno;
 
-	send_reply(conn, XS_READ, node->data, node->datalen);
+	send_reply(conn, XS_READ, node->data, node->hdr.datalen);
 
 	return 0;
 }
@@ -1379,13 +1377,13 @@ static int add_child(const void *ctx, struct node *parent, const char *name)
 
 	base = basename(name);
 	baselen = strlen(base) + 1;
-	children = talloc_array(ctx, char, parent->childlen + baselen);
+	children = talloc_array(ctx, char, parent->hdr.childlen + baselen);
 	if (!children)
 		return ENOMEM;
-	memcpy(children, parent->children, parent->childlen);
-	memcpy(children + parent->childlen, base, baselen);
+	memcpy(children, parent->children, parent->hdr.childlen);
+	memcpy(children + parent->hdr.childlen, base, baselen);
 	parent->children = children;
-	parent->childlen += baselen;
+	parent->hdr.childlen += baselen;
 
 	return 0;
 }
@@ -1438,9 +1436,9 @@ static struct node *construct_node(struct connection *conn, const void *ctx,
 		node->name = talloc_steal(node, names[levels - 1]);
 
 		/* Inherit permissions, unpriv domains own what they create. */
-		node->num_perms = parent->num_perms;
+		node->hdr.num_perms = parent->hdr.num_perms;
 		node->perms = talloc_memdup(node, parent->perms,
-					    node->num_perms *
+					    node->hdr.num_perms *
 					    sizeof(*node->perms));
 		if (!node->perms)
 			goto nomem;
@@ -1449,7 +1447,7 @@ static struct node *construct_node(struct connection *conn, const void *ctx,
 
 		/* No children, no data */
 		node->children = node->data = NULL;
-		node->childlen = node->datalen = 0;
+		node->hdr.childlen = node->hdr.datalen = 0;
 		node->acc.memory = 0;
 		node->parent = parent;
 
@@ -1501,7 +1499,7 @@ static struct node *create_node(struct connection *conn, const void *ctx,
 		ta_node_created(conn->transaction);
 
 	node->data = data;
-	node->datalen = datalen;
+	node->hdr.datalen = datalen;
 
 	/*
 	 * We write out the nodes bottom up.
@@ -1581,7 +1579,7 @@ static int do_write(const void *ctx, struct connection *conn,
 			return errno;
 	} else {
 		node->data = in->buffer + offset;
-		node->datalen = datalen;
+		node->hdr.datalen = datalen;
 		if (write_node(conn, node, NODE_MODIFY, false))
 			return errno;
 	}
@@ -1629,8 +1627,8 @@ static int remove_child_entry(struct connection *conn, struct node *node,
 {
 	size_t childlen = strlen(node->children + offset);
 
-	memdel(node->children, offset, childlen + 1, node->childlen);
-	node->childlen -= childlen + 1;
+	memdel(node->children, offset, childlen + 1, node->hdr.childlen);
+	node->hdr.childlen -= childlen + 1;
 
 	return write_node(conn, node, NODE_MODIFY, true);
 }
@@ -1640,8 +1638,9 @@ static int delete_child(struct connection *conn,
 {
 	unsigned int i;
 
-	for (i = 0; i < node->childlen; i += strlen(node->children+i) + 1) {
-		if (streq(node->children+i, childname)) {
+	for (i = 0; i < node->hdr.childlen;
+	     i += strlen(node->children + i) + 1) {
+		if (streq(node->children + i, childname)) {
 			errno = remove_child_entry(conn, node, i) ? EIO : 0;
 			return errno;
 		}
@@ -1910,7 +1909,7 @@ int walk_node_tree(const void *ctx, struct connection *conn, const char *root,
 		/* node == NULL possible only for the initial loop iteration. */
 		if (node) {
 			/* Go one step up if ret or if last child finished. */
-			if (ret || node->childoff >= node->childlen) {
+			if (ret || node->childoff >= node->hdr.childlen) {
 				parent = node->parent;
 				/* Call function AFTER processing a node. */
 				ret = walk_call_func(ctx, conn, node, parent,
@@ -2340,10 +2339,10 @@ static void manual_node(const char *name, const char *child)
 
 	node->name = name;
 	node->perms = &perms;
-	node->num_perms = 1;
+	node->hdr.num_perms = 1;
 	node->children = (char *)child;
 	if (child)
-		node->childlen = strlen(child) + 1;
+		node->hdr.childlen = strlen(child) + 1;
 
 	if (write_node(NULL, node, NODE_CREATE, false))
 		barf_perror("Could not create initial node %s", name);
@@ -3211,12 +3210,12 @@ static int dump_state_node(const void *ctx, struct connection *conn,
 	sn.conn_id = 0;
 	sn.ta_id = 0;
 	sn.ta_access = 0;
-	sn.perm_n = node->num_perms;
+	sn.perm_n = node->hdr.num_perms;
 	sn.path_len = pathlen;
-	sn.data_len = node->datalen;
-	head.length += node->num_perms * sizeof(*sn.perms);
+	sn.data_len = node->hdr.datalen;
+	head.length += node->hdr.num_perms * sizeof(*sn.perms);
 	head.length += pathlen;
-	head.length += node->datalen;
+	head.length += node->hdr.datalen;
 	head.length = ROUNDUP(head.length, 3);
 
 	if (fwrite(&head, sizeof(head), 1, fp) != 1)
@@ -3224,14 +3223,15 @@ static int dump_state_node(const void *ctx, struct connection *conn,
 	if (fwrite(&sn, sizeof(sn), 1, fp) != 1)
 		return dump_state_node_err(data, "Dump node state error");
 
-	ret = dump_state_node_perms(fp, node->perms, node->num_perms);
+	ret = dump_state_node_perms(fp, node->perms, node->hdr.num_perms);
 	if (ret)
 		return dump_state_node_err(data, ret);
 
 	if (fwrite(node->name, pathlen, 1, fp) != 1)
 		return dump_state_node_err(data, "Dump node path error");
 
-	if (node->datalen && fwrite(node->data, node->datalen, 1, fp) != 1)
+	if (node->hdr.datalen &&
+	    fwrite(node->data, node->hdr.datalen, 1, fp) != 1)
 		return dump_state_node_err(data, "Dump node data error");
 
 	ret = dump_state_align(fp);
@@ -3416,17 +3416,17 @@ void read_state_node(const void *ctx, const void *state)
 
 	node->acc.memory = 0;
 	node->name = name;
-	node->generation = ++generation;
-	node->datalen = sn->data_len;
+	node->hdr.generation = ++generation;
+	node->hdr.datalen = sn->data_len;
 	node->data = name + sn->path_len;
-	node->childlen = 0;
+	node->hdr.childlen = 0;
 	node->children = NULL;
-	node->num_perms = sn->perm_n;
+	node->hdr.num_perms = sn->perm_n;
 	node->perms = talloc_array(node, struct xs_permissions,
-				   node->num_perms);
+				   node->hdr.num_perms);
 	if (!node->perms)
 		barf("allocation error restoring node");
-	for (i = 0; i < node->num_perms; i++) {
+	for (i = 0; i < node->hdr.num_perms; i++) {
 		switch (sn->perms[i].access) {
 		case 'r':
 			node->perms[i].perms = XS_PERM_READ;
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 9cb4c2f3eb..adf8a785fc 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -181,6 +181,7 @@ extern struct list_head connections;
  */
 struct node_hdr {
 	uint64_t generation;
+#define NO_GENERATION ~((uint64_t)0)
 	uint16_t num_perms;
 	uint16_t datalen;
 	uint32_t childlen;
@@ -197,6 +198,10 @@ struct node_account_data {
 };
 
 struct node {
+	/* Data direct for data base. */
+	struct node_hdr hdr;
+
+	/* Xenstore path. */
 	const char *name;
 	/* Name used to access data base. */
 	const char *db_name;
@@ -204,20 +209,13 @@ struct node {
 	/* Parent (optional) */
 	struct node *parent;
 
-	/* Generation count. */
-	uint64_t generation;
-#define NO_GENERATION ~((uint64_t)0)
-
 	/* Permissions. */
-	unsigned int num_perms;
 	struct xs_permissions *perms;
 
 	/* Contents. */
-	unsigned int datalen;
 	void *data;
 
 	/* Children, each nul-terminated. */
-	unsigned int childlen;
 	unsigned int childoff;	/* Used by walk_node_tree() internally. */
 	char *children;
 
@@ -259,7 +257,7 @@ static inline unsigned int get_node_owner(const struct node *node)
 static inline void node_to_node_perms(const struct node *node,
 				      struct node_perms *perms)
 {
-	perms->num = node->num_perms;
+	perms->num = node->hdr.num_perms;
 	perms->p = node->perms;
 }
 
@@ -267,7 +265,7 @@ static inline void node_to_node_perms(const struct node *node,
 static inline void node_perms_to_node(const struct node_perms *perms,
 				      struct node *node)
 {
-	node->num_perms = perms->num;
+	node->hdr.num_perms = perms->num;
 	node->perms = perms->p;
 }
 
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index 1ba73d9db2..fdf1095acb 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -1335,10 +1335,11 @@ int domain_adjust_node_perms(struct node *node)
 {
 	unsigned int i;
 
-	for (i = 1; i < node->num_perms; i++) {
+	for (i = 1; i < node->hdr.num_perms; i++) {
 		if (node->perms[i].perms & XS_PERM_IGNORE)
 			continue;
-		if (!chk_domain_generation(node->perms[i].id, node->generation))
+		if (!chk_domain_generation(node->perms[i].id,
+					   node->hdr.generation))
 			node->perms[i].perms |= XS_PERM_IGNORE;
 	}
 
diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 213a2c436c..1f892b002d 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -232,7 +232,7 @@ int access_node(struct connection *conn, struct node *node,
 	bool introduce = false;
 
 	if (type != NODE_ACCESS_READ) {
-		node->generation = ++generation;
+		node->hdr.generation = ++generation;
 		if (conn && !conn->transaction)
 			wrl_apply_debit_direct(conn);
 	}
@@ -259,12 +259,13 @@ int access_node(struct connection *conn, struct node *node,
 		if (!i->trans_name)
 			goto nomem;
 		i->node = strchr(i->trans_name, '/') + 1;
-		if (node->generation != NO_GENERATION && node->num_perms) {
+		if (node->hdr.generation != NO_GENERATION &&
+		    node->hdr.num_perms) {
 			i->perms.p = talloc_array(i, struct xs_permissions,
-						  node->num_perms);
+						  node->hdr.num_perms);
 			if (!i->perms.p)
 				goto nomem;
-			i->perms.num = node->num_perms;
+			i->perms.num = node->hdr.num_perms;
 			memcpy(i->perms.p, node->perms,
 			       i->perms.num * sizeof(*i->perms.p));
 		}
@@ -282,9 +283,9 @@ int access_node(struct connection *conn, struct node *node,
 		 * from the write types.
 		 */
 		if (type == NODE_ACCESS_READ) {
-			i->generation = node->generation;
+			i->generation = node->hdr.generation;
 			i->check_gen = true;
-			if (node->generation != NO_GENERATION) {
+			if (node->hdr.generation != NO_GENERATION) {
 				ret = write_node_raw(conn, i->trans_name, node,
 						     NODE_CREATE, true);
 				if (ret)
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:08:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:08:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568778.888807 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQL-0003IG-9R; Mon, 24 Jul 2023 11:08:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568778.888807; Mon, 24 Jul 2023 11:08:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtQK-0003CB-NM; Mon, 24 Jul 2023 11:08:20 +0000
Received: by outflank-mailman (input) for mailman id 568778;
 Mon, 24 Jul 2023 11:08:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jVkC=DK=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qNtN0-0000KR-V2
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:04:54 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id eb1f1a33-2a11-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:04:54 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 2FD4422973;
 Mon, 24 Jul 2023 11:04:54 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 02BA113476;
 Mon, 24 Jul 2023 11:04:53 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 3WikOtVavmR1YgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 24 Jul 2023 11:04:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eb1f1a33-2a11-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690196694; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=UBNOYQXOYuzBuhgnYVP50MH6bXF9LZNypAn0rVMR8hc=;
	b=bI4nrkTogltF5ovLAboNZ0JNknZm7FprlbX1RXtaRrtAb8TzYzmkMiN3a2AlH68rNQb6AJ
	TANac/dPHsOJ2I8IB2CZp6ZjaYCRDwxUUT/UAEt5LCeG+rmQh6ERwKqQHNQkOxQLkR2AKc
	qSZ13gSybpgiYlCWNhWPVasGKiWfScE=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v3 22/25] tools/xenstore: merge get_spec_node() into get_node_canonicalized()
Date: Mon, 24 Jul 2023 13:02:44 +0200
Message-Id: <20230724110247.10520-23-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
References: <20230724110247.10520-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add a "allow_special" parameter to get_node_canonicalized() allowing
to merge get_spec_node() into get_node_canonicalized().

Add the same parameter to is_valid_nodename(), as this will simplify
check_watch_path().

This is done in preparation to introducing a get_node() variant
returning a pointer to const struct node.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V3:
- new patch
---
 tools/xenstore/xenstored_core.c  | 45 +++++++++++++-------------------
 tools/xenstore/xenstored_core.h  |  3 ++-
 tools/xenstore/xenstored_watch.c | 19 +++++---------
 3 files changed, 26 insertions(+), 41 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 102be92a43..ea5a1a9cce 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1219,13 +1219,14 @@ static bool valid_chars(const char *node)
 		       "0123456789-/_@") == strlen(node));
 }
 
-bool is_valid_nodename(const struct connection *conn, const char *node)
+bool is_valid_nodename(const struct connection *conn, const char *node,
+		       bool allow_special)
 {
 	int local_off = 0;
 	unsigned int domid;
 
-	/* Must start in /. */
-	if (!strstarts(node, "/"))
+	/* Must start in / or - if special nodes are allowed - in @. */
+	if (!strstarts(node, "/") && (!allow_special || !strstarts(node, "@")))
 		return false;
 
 	/* Cannot end in / (unless it's just "/"). */
@@ -1294,7 +1295,8 @@ static struct node *get_node_canonicalized(struct connection *conn,
 					   const void *ctx,
 					   const char *name,
 					   const char **canonical_name,
-					   unsigned int perm)
+					   unsigned int perm,
+					   bool allow_special)
 {
 	const char *tmp_name;
 
@@ -1303,33 +1305,20 @@ static struct node *get_node_canonicalized(struct connection *conn,
 	*canonical_name = canonicalize(conn, ctx, name);
 	if (!*canonical_name)
 		return NULL;
-	if (!is_valid_nodename(conn, *canonical_name)) {
+	if (!is_valid_nodename(conn, *canonical_name, allow_special)) {
 		errno = EINVAL;
 		return NULL;
 	}
 	return get_node(conn, ctx, *canonical_name, perm);
 }
 
-static struct node *get_spec_node(struct connection *conn, const void *ctx,
-				  const char *name, const char **canonical_name,
-				  unsigned int perm)
-{
-	if (name[0] == '@') {
-		if (canonical_name)
-			*canonical_name = name;
-		return get_node(conn, ctx, name, perm);
-	}
-
-	return get_node_canonicalized(conn, ctx, name, canonical_name, perm);
-}
-
 static int send_directory(const void *ctx, struct connection *conn,
 			  struct buffered_data *in)
 {
 	struct node *node;
 
 	node = get_node_canonicalized(conn, ctx, onearg(in), NULL,
-				      XS_PERM_READ);
+				      XS_PERM_READ, false);
 	if (!node)
 		return errno;
 
@@ -1351,7 +1340,7 @@ static int send_directory_part(const void *ctx, struct connection *conn,
 
 	/* First arg is node name. */
 	node = get_node_canonicalized(conn, ctx, in->buffer, NULL,
-				      XS_PERM_READ);
+				      XS_PERM_READ, false);
 	if (!node)
 		return errno;
 
@@ -1401,7 +1390,7 @@ static int do_read(const void *ctx, struct connection *conn,
 	struct node *node;
 
 	node = get_node_canonicalized(conn, ctx, onearg(in), NULL,
-				      XS_PERM_READ);
+				      XS_PERM_READ, false);
 	if (!node)
 		return errno;
 
@@ -1615,7 +1604,8 @@ static int do_write(const void *ctx, struct connection *conn,
 	offset = strlen(vec[0]) + 1;
 	datalen = in->used - offset;
 
-	node = get_node_canonicalized(conn, ctx, vec[0], &name, XS_PERM_WRITE);
+	node = get_node_canonicalized(conn, ctx, vec[0], &name, XS_PERM_WRITE,
+				      false);
 	if (!node) {
 		/* No permissions, invalid input? */
 		if (errno != ENOENT)
@@ -1644,7 +1634,7 @@ static int do_mkdir(const void *ctx, struct connection *conn,
 	const char *name;
 
 	node = get_node_canonicalized(conn, ctx, onearg(in), &name,
-				      XS_PERM_WRITE);
+				      XS_PERM_WRITE, false);
 
 	/* If it already exists, fine. */
 	if (!node) {
@@ -1774,7 +1764,7 @@ static int do_rm(const void *ctx, struct connection *conn,
 	char *parentname;
 
 	node = get_node_canonicalized(conn, ctx, onearg(in), &name,
-				      XS_PERM_WRITE);
+				      XS_PERM_WRITE, false);
 	if (!node) {
 		/* Didn't exist already?  Fine, if parent exists. */
 		if (errno == ENOENT) {
@@ -1816,7 +1806,8 @@ static int do_get_perms(const void *ctx, struct connection *conn,
 	unsigned int len;
 	struct node_perms perms;
 
-	node = get_spec_node(conn, ctx, onearg(in), NULL, XS_PERM_READ);
+	node = get_node_canonicalized(conn, ctx, onearg(in), NULL, XS_PERM_READ,
+				      true);
 	if (!node)
 		return errno;
 
@@ -1860,8 +1851,8 @@ static int do_set_perms(const void *ctx, struct connection *conn,
 		return ENOENT;
 
 	/* We must own node to do this (tools can do this too). */
-	node = get_spec_node(conn, ctx, in->buffer, &name,
-			     XS_PERM_WRITE | XS_PERM_OWNER);
+	node = get_node_canonicalized(conn, ctx, in->buffer, &name,
+				      XS_PERM_WRITE | XS_PERM_OWNER, true);
 	if (!node)
 		return errno;
 
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 65782c559d..f3a83efce8 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -295,7 +295,8 @@ void check_store(void);
 void corrupt(struct connection *conn, const char *fmt, ...);
 
 /* Is this a valid node name? */
-bool is_valid_nodename(const struct connection *conn, const char *node);
+bool is_valid_nodename(const struct connection *conn, const char *node,
+		       bool allow_special);
 
 /* Get name of parent node. */
 char *get_parent(const void *ctx, const char *node);
diff --git a/tools/xenstore/xenstored_watch.c b/tools/xenstore/xenstored_watch.c
index 86cf8322b4..2662a3fa49 100644
--- a/tools/xenstore/xenstored_watch.c
+++ b/tools/xenstore/xenstored_watch.c
@@ -166,19 +166,12 @@ static int destroy_watch(void *_watch)
 static int check_watch_path(struct connection *conn, const void *ctx,
 			    const char **path, bool *relative)
 {
-	/* Check if valid event. */
-	if (strstarts(*path, "@")) {
-		*relative = false;
-		if (strlen(*path) > XENSTORE_REL_PATH_MAX)
-			goto inval;
-	} else {
-		*relative = !strstarts(*path, "/");
-		*path = canonicalize(conn, ctx, *path);
-		if (!*path)
-			return errno;
-		if (!is_valid_nodename(conn, *path))
-			goto inval;
-	}
+	*relative = !strstarts(*path, "/") && !strstarts(*path, "@");
+	*path = canonicalize(conn, ctx, *path);
+	if (!*path)
+		return errno;
+	if (!is_valid_nodename(conn, *path, true))
+		goto inval;
 
 	return 0;
 
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:17:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:17:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568795.888832 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtZY-00008I-1I; Mon, 24 Jul 2023 11:17:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568795.888832; Mon, 24 Jul 2023 11:17:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtZX-00008A-Uw; Mon, 24 Jul 2023 11:17:51 +0000
Received: by outflank-mailman (input) for mailman id 568795;
 Mon, 24 Jul 2023 11:17:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BDRN=DK=arm.com=steven.price@srs-se1.protection.inumbo.net>)
 id 1qNtZW-000084-J5
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:17:50 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTP
 id b7bc57ef-2a13-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:17:47 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B206CDE0;
 Mon, 24 Jul 2023 04:18:29 -0700 (PDT)
Received: from [10.57.34.62] (unknown [10.57.34.62])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C518B3F5A1;
 Mon, 24 Jul 2023 04:17:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b7bc57ef-2a13-11ee-b23a-6b7b168915f2
Message-ID: <cdd08c9e-81d3-a85f-5426-5db738aa73ec@arm.com>
Date: Mon, 24 Jul 2023 12:17:40 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 24/47] drm/panfrost: dynamically allocate the
 drm-panfrost shrinker
To: Qi Zheng <zhengqi.arch@bytedance.com>, akpm@linux-foundation.org,
 david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz, roman.gushchin@linux.dev,
 djwong@kernel.org, brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu,
 cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com,
 gregkh@linuxfoundation.org, muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-25-zhengqi.arch@bytedance.com>
Content-Language: en-GB
From: Steven Price <steven.price@arm.com>
In-Reply-To: <20230724094354.90817-25-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 24/07/2023 10:43, Qi Zheng wrote:
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the drm-panfrost shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct panfrost_device.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

One nit below, but otherwise:

Reviewed-by: Steven Price <steven.price@arm.com>

> ---
>  drivers/gpu/drm/panfrost/panfrost_device.h    |  2 +-
>  drivers/gpu/drm/panfrost/panfrost_drv.c       |  6 +++-
>  drivers/gpu/drm/panfrost/panfrost_gem.h       |  2 +-
>  .../gpu/drm/panfrost/panfrost_gem_shrinker.c  | 32 ++++++++++++-------
>  4 files changed, 27 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h
> index b0126b9fbadc..e667e5689353 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_device.h
> +++ b/drivers/gpu/drm/panfrost/panfrost_device.h
> @@ -118,7 +118,7 @@ struct panfrost_device {
>  
>  	struct mutex shrinker_lock;
>  	struct list_head shrinker_list;
> -	struct shrinker shrinker;
> +	struct shrinker *shrinker;
>  
>  	struct panfrost_devfreq pfdevfreq;
>  };
> diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
> index bbada731bbbd..f705bbdea360 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_drv.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
> @@ -598,10 +598,14 @@ static int panfrost_probe(struct platform_device *pdev)
>  	if (err < 0)
>  		goto err_out1;
>  
> -	panfrost_gem_shrinker_init(ddev);
> +	err = panfrost_gem_shrinker_init(ddev);
> +	if (err)
> +		goto err_out2;
>  
>  	return 0;
>  
> +err_out2:
> +	drm_dev_unregister(ddev);
>  err_out1:
>  	pm_runtime_disable(pfdev->dev);
>  	panfrost_device_fini(pfdev);
> diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.h b/drivers/gpu/drm/panfrost/panfrost_gem.h
> index ad2877eeeccd..863d2ec8d4f0 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_gem.h
> +++ b/drivers/gpu/drm/panfrost/panfrost_gem.h
> @@ -81,7 +81,7 @@ panfrost_gem_mapping_get(struct panfrost_gem_object *bo,
>  void panfrost_gem_mapping_put(struct panfrost_gem_mapping *mapping);
>  void panfrost_gem_teardown_mappings_locked(struct panfrost_gem_object *bo);
>  
> -void panfrost_gem_shrinker_init(struct drm_device *dev);
> +int panfrost_gem_shrinker_init(struct drm_device *dev);
>  void panfrost_gem_shrinker_cleanup(struct drm_device *dev);
>  
>  #endif /* __PANFROST_GEM_H__ */
> diff --git a/drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c b/drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c
> index bf0170782f25..9a90dfb5301f 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c
> @@ -18,8 +18,7 @@
>  static unsigned long
>  panfrost_gem_shrinker_count(struct shrinker *shrinker, struct shrink_control *sc)
>  {
> -	struct panfrost_device *pfdev =
> -		container_of(shrinker, struct panfrost_device, shrinker);
> +	struct panfrost_device *pfdev = shrinker->private_data;
>  	struct drm_gem_shmem_object *shmem;
>  	unsigned long count = 0;
>  
> @@ -65,8 +64,7 @@ static bool panfrost_gem_purge(struct drm_gem_object *obj)
>  static unsigned long
>  panfrost_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc)
>  {
> -	struct panfrost_device *pfdev =
> -		container_of(shrinker, struct panfrost_device, shrinker);
> +	struct panfrost_device *pfdev = shrinker->private_data;
>  	struct drm_gem_shmem_object *shmem, *tmp;
>  	unsigned long freed = 0;
>  
> @@ -97,13 +95,24 @@ panfrost_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc)
>   *
>   * This function registers and sets up the panfrost shrinker.
>   */
> -void panfrost_gem_shrinker_init(struct drm_device *dev)
> +int panfrost_gem_shrinker_init(struct drm_device *dev)
>  {
>  	struct panfrost_device *pfdev = dev->dev_private;
> -	pfdev->shrinker.count_objects = panfrost_gem_shrinker_count;
> -	pfdev->shrinker.scan_objects = panfrost_gem_shrinker_scan;
> -	pfdev->shrinker.seeks = DEFAULT_SEEKS;
> -	WARN_ON(register_shrinker(&pfdev->shrinker, "drm-panfrost"));
> +
> +	pfdev->shrinker = shrinker_alloc(0, "drm-panfrost");
> +	if (!pfdev->shrinker) {
> +		WARN_ON(1);

I don't think this WARN_ON is particularly useful - if there's a failed
memory allocation we should see output from the kernel anyway. And we're
changing the semantics from "continue just without a shrinker" (which
argueably justifies the warning) to "probe fails, device doesn't work"
which will be obvious to the user so I don't feel we need the additional
warn.

> +		return -ENOMEM;
> +	}
> +
> +	pfdev->shrinker->count_objects = panfrost_gem_shrinker_count;
> +	pfdev->shrinker->scan_objects = panfrost_gem_shrinker_scan;
> +	pfdev->shrinker->seeks = DEFAULT_SEEKS;
> +	pfdev->shrinker->private_data = pfdev;
> +
> +	shrinker_register(pfdev->shrinker);
> +
> +	return 0;
>  }
>  
>  /**
> @@ -116,7 +125,6 @@ void panfrost_gem_shrinker_cleanup(struct drm_device *dev)
>  {
>  	struct panfrost_device *pfdev = dev->dev_private;
>  
> -	if (pfdev->shrinker.nr_deferred) {
> -		unregister_shrinker(&pfdev->shrinker);
> -	}
> +	if (pfdev->shrinker)
> +		shrinker_unregister(pfdev->shrinker);
>  }



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:33:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568813.888843 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtoT-0002cl-Bd; Mon, 24 Jul 2023 11:33:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568813.888843; Mon, 24 Jul 2023 11:33:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtoT-0002ce-84; Mon, 24 Jul 2023 11:33:17 +0000
Received: by outflank-mailman (input) for mailman id 568813;
 Mon, 24 Jul 2023 11:33:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNtoR-0002cY-N8
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:33:15 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2077.outbound.protection.outlook.com [40.107.13.77])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e05fde7c-2a15-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:33:14 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBAPR04MB7446.eurprd04.prod.outlook.com (2603:10a6:10:1aa::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 11:32:45 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 11:32:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e05fde7c-2a15-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Fsr+W/tYae4RsrzHahlYMdAq/t1N+WH1yEgCsei3DcP5Ez7v98+spthHUh1BPFvGuM0tc6phLBziAvCMVyX2JQj/vdj+d39NJmk1GhjJAQZLRwJUuRx/Mx8pt/vqCs+SOJdYH5OK6laxqYj/1OS/8j8OcdH57E4StOcoR4eTCGEuoIiuGnmIF3AQfpCXBlej6aq69r7FPghCpj52ZL8qxMilgOV2i8JmR6pvLBbH4ehxf29nnbIPB0ZBlCm/Z1EpmmTRN8uIZVZu+6Y+sDVlL6sivLSpHs5aALQVnQqcuQvuEzHdRyPp077C7u4eqeOLCjFLGVAV2NnUghrx6zQCbg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=j0nAmOsuSQru7srNN+gQZnvtGlciALlomqRWS0jt6go=;
 b=m93c2nDo3p2AyMHbs+CaTpszr4+iNPoC9GkpUcYjK19b/h0MXvMNYOWpL3AZGVs4P5a4nImE23OCFep5+tPXS7BCkfXJkOZ9a1C2bPbFPVuKeZ8EykGpdceWdx88ttYp1SCU9fwapETiiRHk7oF2BJ/p74G2D0CVclGbU5TePN5bslAqmE9DHRMw7gj92g+H47esg8J7voDpS7UMuEJa+XNDuUR7gtxlmdcDcxAkMJQfTtvxo2yzdYKEqAub0r9XVRYuYstE27XlJ0PG7upNXfQa8sRjKRey9cOo240IsncoG+aWt+QhsjSMG13SO/vjD+Zn4bbEvsUNStU3mvxDiQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=j0nAmOsuSQru7srNN+gQZnvtGlciALlomqRWS0jt6go=;
 b=v/v6tN1tUkMcGiNkhXxooup4rIjdaDT/imlB1uNP88V0cMzYVP4yr8YgkDn0PTxiwNmeV83pyR7i+jBZECNuosoORxxVU6xgAkGkkcCC55/tjwYVxdZer6zoJKYeeixkZly/fPPMB28ub0TcRMYKybN7orNgLdKRGLVHIS0Ke8Sb66dxbPwiz+q+E6TY21VxZdY8WWZRmXG0E0hlmbw6azsQhw/ZXZZN+xfn4k0koBUPR6K+vFRq9W9R7GuGwEj1A9Kdbi3UlUxs88/zhkZMIgrw62TrdiQDKtJTsH8xTDn1gaUPC3/dlOw/wgP67I5WFJKzimstj5ymTLHVyTS1tg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <adf14f28-a3ea-1ed8-4b41-24b8caa93f94@suse.com>
Date: Mon, 24 Jul 2023 13:32:45 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v5 2/4] xen/ppc: Set up a basic C environment
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 xen-devel@lists.xenproject.org
References: <cover.1689958538.git.sanastasio@raptorengineering.com>
 <27548375e29c56d87f08be800e38fb85c650568a.1689958538.git.sanastasio@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <27548375e29c56d87f08be800e38fb85c650568a.1689958538.git.sanastasio@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0007.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:15::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBAPR04MB7446:EE_
X-MS-Office365-Filtering-Correlation-Id: b49781aa-f249-4d41-7829-08db8c39b33d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	niG+ii2lV9qM8eWkmyYrdzZ4DnovvblNncknXiTq30UkwhJmsflgOG23h2gP2pF0/vgQ0EIoaxDTYQyw/dfoRby9mp1Qfhe4r1RBmvLXDgISDsvuAhOziCG1lgflshu9TjpDUoVwnf3aEk/RxOfmlsYFpgBS/Fj/ddUhLfSK7jxtatgqMDfCjoNZOe2MsPItT9viVCQq3B2utjRs7P9SGutjHJB/ns8g1Py4napdnlOo4f9emo0Pliiid8S92pRgyK2VqpIu/s9bJcQpvTZr4aaO0WKExhovzRsuwycbyFERerwfKTeptOQ5mvlvylM6HO04BuUdKuM3s77zbzkfzmoYGXbFqDix7pTMwc2m8nIVgeDn0Rvq5uFWf0XgdMIYk2fpfk4JY+k3lS50agYAv8pOL8gkKjpc5C+Kvan+9KlyXUkdJrSLCJip8uwewmkKxPhTRPDXvsdH2aJTf73LcC2/8ObDMIRVVHvIoy+FFRjZuTlWWIIozEwWgY400d642ZdsRR6xTjLcBYkSBe0fNaM41hfbXKeVfoAAIG7RIRZmXiZTyWsWPC4Xp6o7ZQ/jsotMmQHsk7TAx8ykd194t15HQzT0OHTNu9Ox5jFXl0QRJ/JxBVN1+xM/tm7wG3QzT3VMOVJJqUgK57PaNRCPiw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(366004)(376002)(136003)(39850400004)(396003)(451199021)(38100700002)(36756003)(53546011)(2616005)(83380400001)(8676002)(8936002)(5660300002)(478600001)(54906003)(66556008)(316002)(6916009)(4326008)(66946007)(41300700001)(26005)(186003)(6506007)(6486002)(6512007)(66476007)(4744005)(2906002)(31686004)(31696002)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-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UEFh?=
 =?utf-8?B?Wm1BNGxZSHhpVDhIaTJyR2QzU01DbWN6MWZLVGJRVHljdlNTL0diMHRTbFpW?=
 =?utf-8?B?RVFGQ1phSjI2MFludTdWdUdkNmJRVHB5VmZCRWVqR1BjejcrOWhtWHErbXRY?=
 =?utf-8?B?aUlLYkg4SE56b2JGdVVpUE1LbXJBQ2MxRWVVRUxmYmF5elBVcEJPZnhnNlcx?=
 =?utf-8?B?R2RBK1pua1hDQ3g1UDRsTUVCQXVCS2hRcERTeFlJM3FCb2h5endCYVFwQlNL?=
 =?utf-8?B?R2xPVkdNN3BRejI0KzErbTgzRXFXUjMyZllGMnR2WHlEYTBCVUxjU3JEb3Iy?=
 =?utf-8?B?ZGVRRHg2eGE2SDZmczRkcituWGd6WE9BQVBiTWVqdis4NEVtek12bVRGdkFw?=
 =?utf-8?B?ZUdxZVAzMFJJRm80S0UxbWxDajdiMXlwRFY3NkFEYi9TWGp5S0JRZ2NXYmNm?=
 =?utf-8?Q?YtMmWsqyRIdY3DXu4zJz19mkP?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b49781aa-f249-4d41-7829-08db8c39b33d
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 11:32:45.2335
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: pKPSKyo6rb6fs/JCWMa7/ZXZ8J5GZ+eM8+4n+5QiSje24Dk6NRydIZcNKLOMEWkx3dvdtOt3cKFfzP9i5a0q1g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7446

On 21.07.2023 19:02, Shawn Anastasio wrote:
> Update ppc64/head.S to set up an initial boot stack, zero the .bss
> section, and jump to C. The required setup is done using 32-bit
> immediate address loads for now, but they will be changed to
> TOC-relative loads once the position-independent code model is enabled.
> 
> Additionally, move the cpu0_boot_stack declaration to setup.c and change
> STACK_ORDER from 2 to 0. For now, ppc64 is using 64k pages and thus the
> larger STACK_ORDER is unnecessary.
> 
> Finally, refactor the endian fixup trampoline into its own macro, since it
> will need to be used in multiple places, including every time we make a
> call into firmware.
> 
> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>

I don't think I'm qualified to really give an R-b, so
Acked-by: Jan Beulich <jbeulich@suse.com>
will need to do.

Jan



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 11:35:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 11:35:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568815.888853 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtqz-0003CV-O8; Mon, 24 Jul 2023 11:35:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568815.888853; Mon, 24 Jul 2023 11:35:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNtqz-0003CO-LH; Mon, 24 Jul 2023 11:35:53 +0000
Received: by outflank-mailman (input) for mailman id 568815;
 Mon, 24 Jul 2023 11:35:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNtqx-0003CE-RU
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 11:35:51 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2060f.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::60f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3da005f9-2a16-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 13:35:51 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8828.eurprd04.prod.outlook.com (2603:10a6:20b:40b::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 11:35:48 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 11:35:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3da005f9-2a16-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hS+qhRa1z7Wuaz4sbnhHQjnJeJEFnxr4SZLJC1sUP/mFwsAC8hx231j8z8M1fLizvxf56LVrP7u8Lmur8Or1iKfsgOEWGzoXH43hSbVkyvTbIC160cy/UL+vV7S0xzEoYmOeu63Em2LrsTd0V/H1DOKw0pK819bVTBAB6c1YY+dST0IVmswIVXqSyfYTjaDf8rfggzVFfwS7LABNEXF50hBRFD62Dh6R9OxY5E74XjylBzC7gfDZf2CwxG59pfqYbArGYe7OFn+cFg/+jXjuziFHgcj2UwKL2zUF9EY7reYHhoM95ZXGr6RXWMcPQ1BQraAkwSyHpgJ2bfvh9BkJYg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3LrX9uyBmCeBB48YcEAKjAYONyqob2RuDkUInzMw1MU=;
 b=Xvs4W44Eb008/nx1gdqCYBr1meX4GGSlY5pBfE9GZmlCMElH2RMLQNHJKmmO1DmBtXvQ7eynEmubudNc3PpSjMvMD5yyDN+1BRCKGwnDv/Yc/WaSfdh6WiG/5qiXoYxPQ7Y9YQaxkEa2cpCl3/yndNvbQ2lIxAoheRKqqPzs/6j/dyUsoUQbE7TftUBeTMt2m0GxQGJ//1hOI/iUy3LO5YJVS9mky1S2gXHrGZ0BieIcIYTRoJea5VhdMkF1/ulgUy+yWAVZPc8Cv7z+V3OmE1S4YpRgV7R7Tl9JOds54QAilrE8DeyLet+5/rZUanxieI94UB54RTCvwB3zL2vrsQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3LrX9uyBmCeBB48YcEAKjAYONyqob2RuDkUInzMw1MU=;
 b=SDZKHsk2nxhV28Vq1b0FVrqujHYXpFVGTKVrrenTzKOsYZ4MVRBL24gB7nJE6RNGam8sZkn/TEnqIhpEp59wya7poreCx5ljC/ChctPdWA8Gg7FCnxQdXbtclQY+6Jh3c8XVU0XhYMKT8SICe1xa8KhNZKjamVRJIMbGU1WbWzuZrt7X4jiOh4Z3eAVBLFEr5YGAEWJFeu9d9pYdglAgAwxCgtaMoAigzsgBB5e+4ILXtlBG5uEK0DX+ryWi7U73xHhHW8Xopx2BEN/QMLjmqDGOo8/LlTkCbaJ+Zb+ZUGu18vTU5XcaIkSE88+LLRS1jMRcQEhd2+VAhyZFK94A+g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <5ae78f2b-2cc6-1810-4384-feadc295fa81@suse.com>
Date: Mon, 24 Jul 2023 13:35:49 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v5 3/4] xen/ppc: Implement early serial printk on pseries
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 xen-devel@lists.xenproject.org
References: <cover.1689958538.git.sanastasio@raptorengineering.com>
 <f326168638ae05f5f387e4fa018ac2ed057bac8c.1689958538.git.sanastasio@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <f326168638ae05f5f387e4fa018ac2ed057bac8c.1689958538.git.sanastasio@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0126.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:94::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8828:EE_
X-MS-Office365-Filtering-Correlation-Id: 7a19d6c2-48b7-4225-bfd0-08db8c3a208e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	avtHxGqYxKpTRc5Yav0ZfBd231mobYHnbt4RoWZQH2y74BPwhWzYZ83TOs3nIwYMd8xu8HYb65MUsS1akzg5ZX/0ROyYz01nK2ypC2ZZddFYwYL9LLG9IpAbTvowCRw54c8rZpsn5eCYRWMwOYkFsd3F2RzJczfkdehSS+cDoYUxRZoNJbVlwUaMissNXEaWITHX2w/qSWUQlkUWlrjYdvKw+96J9SqgbgST2BymU0tXMF6dBA1FhJFbjSLRqBvLr7DJODKRltPrK6jatpyzpuhOl5KCtu0znO0GiRamtUrcLy4V9prOqsBLqZmhoJfHpEjxuc6npvIlc2FTJGdTdpAEiU1CKMEm+VRADG+NXkW8+aAN4TBIgqI52dVbay3bbZlSgryKesyeji+xbrF8W+Crj86W6D9TaelPso6woOszdGJaH+/KnjnedOVp4VDABcRTOjXRLTqh61zxgKTu/SlELpbfvkAgJamgi3YPwcRVsdWrpC28j5heYZjeOrw8wNB5o9xvj4NLZi3uZEtAh0A78m8HOAy92n2JrXXIUMjHhu3ztoBTvQy2ov4sy/mP8QgauAFiHXgXVYWdLpD2ylesVqa8GJaSq6rYzCjjkOmD+2adlM8Ex6nMC+7o8aiDybYmf6lqbU39GsKQB6f/vQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(136003)(39860400002)(376002)(396003)(346002)(451199021)(83380400001)(38100700002)(36756003)(86362001)(31696002)(54906003)(478600001)(2906002)(186003)(6506007)(26005)(6512007)(6486002)(31686004)(5660300002)(8936002)(8676002)(316002)(41300700001)(66946007)(66476007)(66556008)(6916009)(4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ielp4cVVNQ0MzUnI1YkFQeXFRYjF6TjVBMDZJV052Y0hxYjFs?=
 =?utf-8?B?MDA1SHp5dVFXTktHeHIyS0drMDdHTkdISTBiM2ZCT3JkY0JaaGZzSE0yZDNQ?=
 =?utf-8?B?ekZFNGhkMjhsbW11cGlhV0trMS8zcEJCRnpyUmozaDlwTVFaMFZXUEpzU2xw?=
 =?utf-8?B?a3JqempwOWtTWjhBY0xjcUJZcVJ3ZXhCbHdhd2RtWVNTd2pUZkJzeEpmdVBN?=
 =?utf-8?B?enc0WkwzUngyRStBcEprQm5yUWJOdE9yR296QVJodDUxcnJFK3RPWlBZZmpW?=
 =?utf-8?B?dFBuTnVFbXlOMHAvaXVxZ3ErNExQUkNqdS92bHBCdVJrbjlaKzFmM05jWDdG?=
 =?utf-8?B?dEU3QVlOam9POUxQem9seVRMYVl3alN6bmtMVGQyRE5sTzV1QTVlZldMenAz?=
 =?utf-8?B?UVgzRVVrREVKSEJZYUtnemw5d0I4d29ZdVJlR1dyWnYxUmpwbTMvT0RvUmw1?=
 =?utf-8?Q?hdsM64hjx+q/bd0CmZcUKDS3p?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7a19d6c2-48b7-4225-bfd0-08db8c3a208e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 11:35:48.6171
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: FF716Q8LVtGVeSk+FU8oZTZ/DYP7eYTvyHw7MdI5DH5gXIFGpLkQkqkTwUkWf2dmRluZE5bImSYGasrnyy9qkQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8828

On 21.07.2023 19:02, Shawn Anastasio wrote:
> On typical Power VMs (e.g. QEMU's -M pseries), a variety of services
> including an early serial console are provided by Open Firmware.
> Implement the required interfaces to call into Open Firmware and write
> to the serial console.
> 
> Since Open Firmware runs in 32-bit Big Endian mode and Xen runs in
> 64-bit Little Endian mode, a thunk is required to save/restore
> any potentially-clobbered registers as well as to perform the
> required endianness switch. Thankfully, linux already has such
> a routine, which was imported into ppc64/of-call.S.
> 
> Support for bare metal (PowerNV) will be implemented in a future
> patch.
> 
> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
with the same remark as for patch 2, plus ...

> --- a/xen/arch/ppc/include/asm/asm-defns.h
> +++ b/xen/arch/ppc/include/asm/asm-defns.h
> @@ -37,4 +37,21 @@
>      .long 0xa6037b7d; /* mtsrr1 r11                         */                 \
>      .long 0x2400004c  /* rfid                               */
>  
> +
> +/* Taken from Linux kernel source (arch/powerpc/boot/crt0.S) */

... the introduction of a double blank line here dropped (which I'll
take care of while committing).

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:14:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:14:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568827.888862 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuRb-0007ho-NH; Mon, 24 Jul 2023 12:13:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568827.888862; Mon, 24 Jul 2023 12:13:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuRb-0007hh-KI; Mon, 24 Jul 2023 12:13:43 +0000
Received: by outflank-mailman (input) for mailman id 568827;
 Mon, 24 Jul 2023 12:13:43 +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
 <SRS0=0CZD=DK=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qNuRb-0007hM-5c
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:13:43 +0000
Received: from frasgout12.his.huawei.com (unknown [14.137.139.154])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8573a33d-2a1b-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:13:39 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.227])
 by frasgout12.his.huawei.com (SkyGuard) with ESMTP id 4R8dyb5yq2z9yMyp
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 20:00:23 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.222.124])
 by APP2 (Coremail) with SMTP id GxC2BwA3_lTGar5ky0byBA--.27936S2;
 Mon, 24 Jul 2023 13:13:10 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8573a33d-2a1b-11ee-8612-37d641c3527e
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v5 0/9] Allow dynamic allocation of software IO TLB bounce buffers
Date: Mon, 24 Jul 2023 14:12:36 +0200
Message-Id: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2BwA3_lTGar5ky0byBA--.27936S2
X-Coremail-Antispam: 1UD129KBjvJXoW3Wr1Dtw1rJr47Aw4kKrykZrb_yoWfKr43pF
	WrK34ftF4qqryxA3s7Ca18GF1rKa1kGry5GrWFvryrur13Cr1j93WktayFqFWUGr40vF12
	qFyjvw13uw1DZ3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDU0xBIdaVrnRJUUU9S14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0
	rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02
	1l84ACjcxK6xIIjxv20xvE14v26r1j6r1xM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4j
	6r4UJwA2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr
	0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj
	6xIIjxv20xvE14v26r106r15McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr
	0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E
	8cxan2IY04v7MxkF7I0Ew4C26cxK6c8Ij28IcwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4
	IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1r
	MI8E67AF67kF1VAFwI0_Wrv_Gr1UMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr
	0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVW3
	JVWrJr1lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8Jr0_Cr
	1UYxBIdaVFxhVjvjDU0xZFpf9x0JU-yCJUUUUU=
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

Motivation
==========

The software IO TLB was designed with these assumptions:

1) It would not be used much. Small systems (little RAM) don't need it, and
   big systems (lots of RAM) would have modern DMA controllers and an IOMMU
   chip to handle legacy devices.
2) A small fixed memory area (64 MiB by default) is sufficient to
   handle the few cases which require a bounce buffer.
3) 64 MiB is little enough that it has no impact on the rest of the
   system.
4) Bounce buffers require large contiguous chunks of low memory. Such
   memory is precious and can be allocated only early at boot.

It turns out they are not always true:

1) Embedded systems may have more than 4GiB RAM but no IOMMU and legacy
   32-bit peripheral busses and/or DMA controllers.
2) CoCo VMs use bounce buffers for all I/O but may need substantially more
   than 64 MiB.
3) Embedded developers put as many features as possible into the available
   memory. A few dozen "missing" megabytes may limit what features can be
   implemented.
4) If CMA is available, it can allocate large continuous chunks even after
   the system has run for some time.

Goals
=====

The goal of this work is to start with a small software IO TLB at boot and
expand it later when/if needed.

Design
======

This version of the patch series retains the current slot allocation
algorithm with multiple areas to reduce lock contention, but additional
slots can be added when necessary.

These alternatives have been considered:

- Allocate and free buffers as needed using direct DMA API. This works
  quite well, except in CoCo VMs where each allocation/free requires
  decrypting/encrypting memory, which is a very expensive operation.

- Allocate a very large software IO TLB at boot, but allow to migrate pages
  to/from it (like CMA does). For systems with CMA, this would mean two big
  allocations at boot. Finding the balance between CMA, SWIOTLB and rest of
  available RAM can be challenging. More importantly, there is no clear
  benefit compared to allocating SWIOTLB memory pools from the CMA.

Implementation Constraints
==========================

These constraints have been taken into account:

1) Minimize impact on devices which do not benefit from the change.
2) Minimize the number of memory decryption/encryption operations.
3) Avoid contention on a lock or atomic variable to preserve parallel
   scalability.

Additionally, the software IO TLB code is also used to implement restricted
DMA pools. These pools are restricted to a pre-defined physical memory
region and must not use any other memory. In other words, dynamic
allocation of memory pools must be disabled for restricted DMA pools.

Data Structures
===============

The existing struct io_tlb_mem is the central type for a SWIOTLB allocator,
but it now contains multiple memory pools::

  io_tlb_mem
  +---------+   io_tlb_pool
  | SWIOTLB | 	+-------+   +-------+   +-------+
  |allocator|-->|default|-->|dynamic|-->|dynamic|-->...
  |    	    |  	|memory |   |memory |   |memory |
  +---------+ 	| pool  |   | pool  |   | pool  |
	      	+-------+   +-------+   +-------+

The allocator structure contains global state (such as flags and counters)
and structures needed to schedule new allocations. Each memory pool
contains the actual buffer slots and metadata. The first memory pool in the
list is the default memory pool allocated statically at early boot.

New memory pools are allocated from a kernel worker thread. That's because
bounce buffers are allocated when mapping a DMA buffer, which may happen in
interrupt context where large atomic allocations would probably fail.
Allocation from process context is much more likely to succeed, especially
if it can use CMA.

Nonetheless, the onset of a load spike may fill up the SWIOTLB before the
worker has a chance to run. In that case, try to allocate a small transient
memory pool to accommodate the request. If memory is encrypted and the
device cannot do DMA to encrypted memory, this buffer is allocated from the
coherent atomic DMA memory pool. Reducing the size of SWIOTLB may therefore
require increasing the size of the coherent pool with the "coherent_pool"
command-line parameter.

Performance
===========

All testing compared a vanilla v6.4-rc6 kernel with a fully patched
kernel. The kernel was booted with "swiotlb=force" to allow stress-testing
the software IO TLB on a high-performance device that would otherwise not
need it. CONFIG_DEBUG_FS was set to 'y' to match the configuration of
popular distribution kernels; it is understood that parallel workloads
suffer from contention on the recently added debugfs atomic counters.

These benchmarks were run:

- small: single-threaded I/O of 4 KiB blocks,
- big: single-threaded I/O of 64 KiB blocks,
- 4way: 4-way parallel I/O of 4 KiB blocks.

In all tested cases, the default 64 MiB SWIOTLB would be sufficient (but
wasteful). The "default" pair of columns shows performance impact when
booted with 64 MiB SWIOTLB (i.e. current state). The "growing" pair of
columns shows the impact when booted with a 1 MiB initial SWIOTLB, which
grew to 5 MiB at run time. The "var" column in the tables below is the
coefficient of variance over 5 runs of the test, the "diff" column is the
difference in read-write I/O bandwidth (MiB/s). The very first column is
the coefficient of variance in the results of the base unpatched kernel.

First, on an x86 VM against a QEMU virtio SATA driver backed by a RAM-based
block device on the host:

	base	   default	   growing
	var	var	diff	var	diff
small	1.96%	0.47%	-1.5%	0.52%	-2.2%
big	2.03%	1.35%	+0.9%	2.22%	+2.9%
4way	0.80%	0.45%	-0.7%	1.22%	<0.1%

Second, on a Raspberry Pi4 with 8G RAM and a class 10 A1 microSD card:

	base	   default	   growing
	var	var	diff	var	diff
small	1.09%	1.69%	+0.5%	2.14%	-0.2%
big	0.03%	0.28%	-0.5%	0.03%	-0.1%
4way	5.15%	2.39%	+0.2%	0.66%	<0.1%

Third, on a CoCo VM. This was a bigger system, so I also added a 24-thread
parallel I/O test:

	base	   default	   growing
	var	var	diff	var	diff
small	2.41%	6.02%	+1.1%	10.33%	+6.7%
big	9.20%	2.81%	-0.6%	16.84%	-0.2%
4way	0.86%	2.66%	-0.1%	 2.22%	-4.9%
24way	3.19%	6.19%	+4.4%	 4.08%	-5.9%

Note the increased variance of the CoCo VM, although the host was not
otherwise loaded. These are caused by the first run, which includes the
overhead of allocating additional bounce buffers and sharing them with the
hypervisor. The system was not rebooted between successive runs.

Parallel tests suffer from a reduced number of areas in the dynamically
allocated memory pools. This can be improved by allocating a larger pool
from CMA (not implemented in this series yet).

I have no good explanation for the increase in performance of the
24-thread I/O test with the default (non-growing) memory pool. Although the
difference is within variance, it seems to be real. The average bandwidth
is consistently above that of the unpatched kernel.

To sum it up:

- All workloads benefit from reduced memory footprint.
- No performance regressions have been observed with the default size of
  the software IO TLB.
- Most workloads retain their former performance even if the software IO
  TLB grows at run time.

Changelog
=========

Changes from v4:
- Guard the code with a CONFIG_SWIOTLB_DYNAMIC option
- Remove is_swiotlb_allocated(); instead, prevent repeated initialization
  in swiotlb_init_late()
- Rename default_swiotlb_start() to default_swiotlb_base()
- Embed the default struct io_tlb_pool into struct io_tlb_mem
- Do not re-introduce struct io_tlb_pool.used

Changes from v3:
- Provide swiotlb_is_allocated() instead of extending swiotlb_is_active().
- Do not grow SWIOTLB if its address has been queried (affects Octeon).
- Do not grow SWIOTLB if a remap function is used (affects Xen PV).
- Use dma_mask instead of coherent_dma_mask.
- Replace complex ternary operators with if-else blocks.

Changes from v2:
- Complete rewrite using dynamically allocated memory pools rather
  than a list of individual buffers
- Depend on other SWIOTLB fixes (already sent)
- Fix Xen and MIPS Octeon builds

Changes from RFC:
- Track dynamic buffers per device instead of per swiotlb
- Use a linked list instead of a maple tree
- Move initialization of swiotlb fields of struct device to a
  helper function
- Rename __lookup_dyn_slot() to lookup_dyn_slot_locked()
- Introduce per-device flag if dynamic buffers are in use
- Add one more user of DMA_ATTR_MAY_SLEEP
- Add kernel-doc comments for new (and some old) code
- Properly escape '*' in dma-attributes.rst

Petr Tesarik (9):
  swiotlb: bail out of swiotlb_init_late() if swiotlb is already
    allocated
  swiotlb: make io_tlb_default_mem local to swiotlb.c
  swiotlb: add documentation and rename swiotlb_do_find_slots()
  swiotlb: separate memory pool data from other allocator data
  swiotlb: add a flag whether SWIOTLB is allowed to grow
  swiotlb: if swiotlb is full, fall back to a transient memory pool
  swiotlb: determine potential physical address limit
  swiotlb: allocate a new memory pool when existing pools are full
  swiotlb: search the software IO TLB only if the device makes use of it

 arch/arm/xen/mm.c           |  10 +-
 arch/mips/pci/pci-octeon.c  |   2 +-
 arch/x86/kernel/pci-dma.c   |  12 +-
 drivers/base/core.c         |   4 +-
 drivers/xen/swiotlb-xen.c   |   2 +-
 include/linux/device.h      |  10 +-
 include/linux/dma-mapping.h |   2 +
 include/linux/swiotlb.h     | 125 +++++--
 kernel/dma/Kconfig          |  13 +
 kernel/dma/direct.c         |   2 +-
 kernel/dma/swiotlb.c        | 675 ++++++++++++++++++++++++++++++++----
 11 files changed, 754 insertions(+), 103 deletions(-)

-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:14:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:14:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568828.888872 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuRn-0007yx-Ub; Mon, 24 Jul 2023 12:13:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568828.888872; Mon, 24 Jul 2023 12:13:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuRn-0007yq-Ru; Mon, 24 Jul 2023 12:13:55 +0000
Received: by outflank-mailman (input) for mailman id 568828;
 Mon, 24 Jul 2023 12:13:54 +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
 <SRS0=0CZD=DK=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qNuRm-0007hM-Sn
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:13:54 +0000
Received: from frasgout13.his.huawei.com (unknown [14.137.139.46])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8d639862-2a1b-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:13:52 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.229])
 by frasgout13.his.huawei.com (SkyGuard) with ESMTP id 4R8f161JHLz9yXKX
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 20:02:34 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.222.124])
 by APP2 (Coremail) with SMTP id GxC2BwA3_lTGar5ky0byBA--.27936S3;
 Mon, 24 Jul 2023 13:13:24 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8d639862-2a1b-11ee-8612-37d641c3527e
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v5 1/9] swiotlb: bail out of swiotlb_init_late() if swiotlb is already allocated
Date: Mon, 24 Jul 2023 14:12:37 +0200
Message-Id: <437209bd783fa3febc3a207acb7799a0ff5cf1f3.1690200598.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
References: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2BwA3_lTGar5ky0byBA--.27936S3
X-Coremail-Antispam: 1UD129KBjvJXoW7WFWxCFyrZr4rWFyUXry5urg_yoW8uFykp3
	43AFyvgF4jgas7ArW5C3WDZF1Yka1kK347urW5Wr13Jr15Jw45Kr1DKrWakrWrWFW8WF4S
	yFy8ZF1Fv3W2qw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDU0xBIdaVrnRJUUUma14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0
	rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_Jr4l82xGYIkIc2
	x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0
	Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UM2
	8EF7xvwVC2z280aVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4UJVWxJr1l
	e2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI
	8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwAC
	jcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7CjxVA2Y2ka0x
	kIwI1lc7CjxVAKzI0EY4vE52x082I5MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY
	6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17
	CEb7AF67AKxVWrXVW8Jr1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI
	42IY6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCw
	CI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4UJVWxJrUvcSsG
	vfC2KfnxnUUI43ZEXa7VUjmZX5UUUUU==
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

If swiotlb is allocated, immediately return 0, so callers do not have to
check io_tlb_default_mem.nslabs explicitly.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 arch/arm/xen/mm.c         | 10 ++++------
 arch/x86/kernel/pci-dma.c | 12 ++++++------
 kernel/dma/swiotlb.c      |  3 +++
 3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c
index 3d826c0b5fee..882cd70c7a2f 100644
--- a/arch/arm/xen/mm.c
+++ b/arch/arm/xen/mm.c
@@ -125,12 +125,10 @@ static int __init xen_mm_init(void)
 		return 0;
 
 	/* we can work with the default swiotlb */
-	if (!io_tlb_default_mem.nslabs) {
-		rc = swiotlb_init_late(swiotlb_size_or_default(),
-				       xen_swiotlb_gfp(), NULL);
-		if (rc < 0)
-			return rc;
-	}
+	rc = swiotlb_init_late(swiotlb_size_or_default(),
+			       xen_swiotlb_gfp(), NULL);
+	if (rc < 0)
+		return rc;
 
 	cflush.op = 0;
 	cflush.a.dev_bus_addr = 0;
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index de6be0a3965e..08988b0a1c91 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -86,16 +86,16 @@ static void __init pci_xen_swiotlb_init(void)
 
 int pci_xen_swiotlb_init_late(void)
 {
+	int rc;
+
 	if (dma_ops == &xen_swiotlb_dma_ops)
 		return 0;
 
 	/* we can work with the default swiotlb */
-	if (!io_tlb_default_mem.nslabs) {
-		int rc = swiotlb_init_late(swiotlb_size_or_default(),
-					   GFP_KERNEL, xen_swiotlb_fixup);
-		if (rc < 0)
-			return rc;
-	}
+	rc = swiotlb_init_late(swiotlb_size_or_default(),
+			       GFP_KERNEL, xen_swiotlb_fixup);
+	if (rc < 0)
+		return rc;
 
 	/* XXX: this switches the dma ops under live devices! */
 	dma_ops = &xen_swiotlb_dma_ops;
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 2b83e3ad9dca..66fc8ec9ae45 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -384,6 +384,9 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 	bool retried = false;
 	int rc = 0;
 
+	if (io_tlb_default_mem.nslabs)
+		return 0;
+
 	if (swiotlb_force_disable)
 		return 0;
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:14:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:14:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568833.888883 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuS5-00006L-6n; Mon, 24 Jul 2023 12:14:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568833.888883; Mon, 24 Jul 2023 12:14:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuS5-00006A-3D; Mon, 24 Jul 2023 12:14:13 +0000
Received: by outflank-mailman (input) for mailman id 568833;
 Mon, 24 Jul 2023 12:14:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0CZD=DK=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qNuS4-0008Te-4r
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:14:12 +0000
Received: from frasgout13.his.huawei.com (unknown [14.137.139.46])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 96b66c75-2a1b-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 14:14:09 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.228])
 by frasgout13.his.huawei.com (SkyGuard) with ESMTP id 4R8f1N6DWcz9yh97
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 20:02:48 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.222.124])
 by APP2 (Coremail) with SMTP id GxC2BwA3_lTGar5ky0byBA--.27936S4;
 Mon, 24 Jul 2023 13:13:39 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 96b66c75-2a1b-11ee-b23a-6b7b168915f2
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v5 2/9] swiotlb: make io_tlb_default_mem local to swiotlb.c
Date: Mon, 24 Jul 2023 14:12:38 +0200
Message-Id: <dd548fcaf2e1d413e37081d6becefb6bbe43bae6.1690200598.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
References: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2Bw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1j6r
	1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJbIY
	CTnIWIevJa73UjIFyTuYvjfUn3kuUUUUU
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

SWIOTLB implementation details should not be exposed to the rest of the
kernel. This will allow to make changes to the implementation without
modifying non-swiotlb code.

To avoid breaking existing users, provide helper functions for the few
required fields.

As a bonus, using a helper function to initialize struct device allows to
get rid of an #ifdef in driver core.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 arch/mips/pci/pci-octeon.c |  2 +-
 drivers/base/core.c        |  4 +---
 drivers/xen/swiotlb-xen.c  |  2 +-
 include/linux/swiotlb.h    | 19 ++++++++++++++++++-
 kernel/dma/swiotlb.c       | 31 ++++++++++++++++++++++++++++++-
 5 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/arch/mips/pci/pci-octeon.c b/arch/mips/pci/pci-octeon.c
index e457a18cbdc5..d19d9d456309 100644
--- a/arch/mips/pci/pci-octeon.c
+++ b/arch/mips/pci/pci-octeon.c
@@ -664,7 +664,7 @@ static int __init octeon_pci_setup(void)
 
 		/* BAR1 movable regions contiguous to cover the swiotlb */
 		octeon_bar1_pci_phys =
-			io_tlb_default_mem.start & ~((1ull << 22) - 1);
+			default_swiotlb_base() & ~((1ull << 22) - 1);
 
 		for (index = 0; index < 32; index++) {
 			union cvmx_pci_bar1_indexx bar1_index;
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 3dff5037943e..46d1d78c5beb 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -3108,9 +3108,7 @@ void device_initialize(struct device *dev)
     defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL)
 	dev->dma_coherent = dma_default_coherent;
 #endif
-#ifdef CONFIG_SWIOTLB
-	dev->dma_io_tlb_mem = &io_tlb_default_mem;
-#endif
+	swiotlb_dev_init(dev);
 }
 EXPORT_SYMBOL_GPL(device_initialize);
 
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index 67aa74d20162..946bd56f0ac5 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -381,7 +381,7 @@ xen_swiotlb_sync_sg_for_device(struct device *dev, struct scatterlist *sgl,
 static int
 xen_swiotlb_dma_supported(struct device *hwdev, u64 mask)
 {
-	return xen_phys_to_dma(hwdev, io_tlb_default_mem.end - 1) <= mask;
+	return xen_phys_to_dma(hwdev, default_swiotlb_limit()) <= mask;
 }
 
 const struct dma_map_ops xen_swiotlb_dma_ops = {
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 4e52cd5e0bdc..3b372364a144 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -110,7 +110,6 @@ struct io_tlb_mem {
 	atomic_long_t used_hiwater;
 #endif
 };
-extern struct io_tlb_mem io_tlb_default_mem;
 
 static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
 {
@@ -128,13 +127,21 @@ static inline bool is_swiotlb_force_bounce(struct device *dev)
 
 void swiotlb_init(bool addressing_limited, unsigned int flags);
 void __init swiotlb_exit(void);
+void swiotlb_dev_init(struct device *dev);
 size_t swiotlb_max_mapping_size(struct device *dev);
 bool is_swiotlb_active(struct device *dev);
 void __init swiotlb_adjust_size(unsigned long size);
+phys_addr_t default_swiotlb_base(void);
+phys_addr_t default_swiotlb_limit(void);
 #else
 static inline void swiotlb_init(bool addressing_limited, unsigned int flags)
 {
 }
+
+static inline void swiotlb_dev_init(struct device *dev)
+{
+}
+
 static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
 {
 	return false;
@@ -159,6 +166,16 @@ static inline bool is_swiotlb_active(struct device *dev)
 static inline void swiotlb_adjust_size(unsigned long size)
 {
 }
+
+static inline phys_addr_t default_swiotlb_base(void)
+{
+	return 0;
+}
+
+static inline phys_addr_t default_swiotlb_limit(void)
+{
+	return 0;
+}
 #endif /* CONFIG_SWIOTLB */
 
 extern void swiotlb_print_info(void);
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 66fc8ec9ae45..6734ef7b9d8d 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -71,7 +71,7 @@ struct io_tlb_slot {
 static bool swiotlb_force_bounce;
 static bool swiotlb_force_disable;
 
-struct io_tlb_mem io_tlb_default_mem;
+static struct io_tlb_mem io_tlb_default_mem;
 
 static unsigned long default_nslabs = IO_TLB_DEFAULT_SIZE >> IO_TLB_SHIFT;
 static unsigned long default_nareas;
@@ -489,6 +489,15 @@ void __init swiotlb_exit(void)
 	memset(mem, 0, sizeof(*mem));
 }
 
+/**
+ * swiotlb_dev_init() - initialize swiotlb fields in &struct device
+ * @dev:	Device to be initialized.
+ */
+void swiotlb_dev_init(struct device *dev)
+{
+	dev->dma_io_tlb_mem = &io_tlb_default_mem;
+}
+
 /*
  * Return the offset into a iotlb slot required to keep the device happy.
  */
@@ -961,6 +970,26 @@ bool is_swiotlb_active(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(is_swiotlb_active);
 
+/**
+ * default_swiotlb_base() - get the base address of the default SWIOTLB
+ *
+ * Get the lowest physical address used by the default software IO TLB pool.
+ */
+phys_addr_t default_swiotlb_base(void)
+{
+	return io_tlb_default_mem.start;
+}
+
+/**
+ * default_swiotlb_limit() - get the address limit of the default SWIOTLB
+ *
+ * Get the highest physical address used by the default software IO TLB pool.
+ */
+phys_addr_t default_swiotlb_limit(void)
+{
+	return io_tlb_default_mem.end - 1;
+}
+
 #ifdef CONFIG_DEBUG_FS
 
 static int io_tlb_used_get(void *data, u64 *val)
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:15:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:15:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568839.888893 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuSx-0000uT-NF; Mon, 24 Jul 2023 12:15:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568839.888893; Mon, 24 Jul 2023 12:15:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuSx-0000uM-JP; Mon, 24 Jul 2023 12:15:07 +0000
Received: by outflank-mailman (input) for mailman id 568839;
 Mon, 24 Jul 2023 12:15:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0CZD=DK=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qNuSv-0000u4-UT
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:15:06 +0000
Received: from frasgout13.his.huawei.com (unknown [14.137.139.46])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b89ea202-2a1b-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 14:15:04 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.227])
 by frasgout13.his.huawei.com (SkyGuard) with ESMTP id 4R8f2V5V3Rz9yh9p
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 20:03:46 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.222.124])
 by APP2 (Coremail) with SMTP id GxC2BwA3_lTGar5ky0byBA--.27936S8;
 Mon, 24 Jul 2023 13:14:37 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b89ea202-2a1b-11ee-b23a-6b7b168915f2
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v5 6/9] swiotlb: if swiotlb is full, fall back to a transient memory pool
Date: Mon, 24 Jul 2023 14:12:42 +0200
Message-Id: <aa1dfebfc64b880b414ba2e5ff1101b31244ca5b.1690200598.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
References: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2BwA3_lTGar5ky0byBA--.27936S8
X-Coremail-Antispam: 1UD129KBjvAXoW3Cr4UZr48Zr45Jw18Zw17Awb_yoW8CF1rXo
	W7uFn3Ww4fJ34UCF4rGFs7Gr47Za1kKa18AF4fuayYgayjvryYgrW7ta15X3sI9ryIkFWx
	Aw1Sqa4fWF4xArykn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73VFW2AGmfu7bjvjm3
	AaLaJ3UjIYCTnIWjp_UUUOT7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20EY4v20xva
	j40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r126s0DM28Irc
	Ia0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l
	84ACjcxK6xIIjxv20xvE14v26r4j6ryUM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4UJV
	WxJr1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr1j
	6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7V
	C0I7IYx2IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j
	6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x0262
	8vn2kIc2xKxwCY1x0264kExVAvwVAq07x20xyl42xK82IYc2Ij64vIr41l4I8I3I0E4IkC
	6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWw
	C2zVAF1VAY17CE14v26rWY6r4UJwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1I
	6r4UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UMIIF0xvE42xK8VAvwI8IcIk0rV
	WUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4UJVWx
	JrUvcSsGvfC2KfnxnUUI43ZEXa7VUjyCJPUUUUU==
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

Try to allocate a transient memory pool if no suitable slots can be found
and the respective SWIOTLB is allowed to grow. The transient pool is just
enough big for this one bounce buffer. It is inserted into a per-device
list of transient memory pools, and it is freed again when the bounce
buffer is unmapped.

Transient memory pools are kept in an RCU list. A memory barrier is
required after adding a new entry, because any address within a transient
buffer must be immediately recognized as belonging to the SWIOTLB, even if
it is passed to another CPU.

Deletion does not require any synchronization beyond RCU ordering
guarantees. After a buffer is unmapped, its physical addresses may no
longer be passed to the DMA API, so the memory range of the corresponding
stale entry in the RCU list never matches. If the memory range gets
allocated again, then it happens only after a RCU quiescent state.

Since bounce buffers can now be allocated from different pools, add a
parameter to swiotlb_alloc_pool() to let the caller know which memory pool
is used. Add swiotlb_find_pool() to find the memory pool corresponding to
an address. This function is now also used by is_swiotlb_buffer(), because
a simple boundary check is no longer sufficient.

The logic in swiotlb_alloc_tlb() is taken from __dma_direct_alloc_pages(),
simplified and enhanced to use coherent memory pools if needed.

Note that this is not the most efficient way to provide a bounce buffer,
but when a DMA buffer can't be mapped, something may (and will) actually
break. At that point it is better to make an allocation, even if it may be
an expensive operation.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/device.h      |   6 +
 include/linux/dma-mapping.h |   2 +
 include/linux/swiotlb.h     |  29 +++-
 kernel/dma/direct.c         |   2 +-
 kernel/dma/swiotlb.c        | 316 +++++++++++++++++++++++++++++++++++-
 5 files changed, 345 insertions(+), 10 deletions(-)

diff --git a/include/linux/device.h b/include/linux/device.h
index d9754a68ba95..5fd89c9d005c 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -626,6 +626,8 @@ struct device_physical_location {
  * @dma_mem:	Internal for coherent mem override.
  * @cma_area:	Contiguous memory area for dma allocations
  * @dma_io_tlb_mem: Software IO TLB allocator.  Not for driver use.
+ * @dma_io_tlb_pools:	List of transient swiotlb memory pools.
+ * @dma_io_tlb_lock:	Protects changes to the list of active pools.
  * @archdata:	For arch-specific additions.
  * @of_node:	Associated device tree node.
  * @fwnode:	Associated device node supplied by platform firmware.
@@ -731,6 +733,10 @@ struct device {
 #endif
 #ifdef CONFIG_SWIOTLB
 	struct io_tlb_mem *dma_io_tlb_mem;
+#endif
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	struct list_head dma_io_tlb_pools;
+	spinlock_t dma_io_tlb_lock;
 #endif
 	/* arch specific additions */
 	struct dev_archdata	archdata;
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index e13050eb9777..f0ccca16a0ac 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -418,6 +418,8 @@ static inline void dma_sync_sgtable_for_device(struct device *dev,
 #define dma_get_sgtable(d, t, v, h, s) dma_get_sgtable_attrs(d, t, v, h, s, 0)
 #define dma_mmap_coherent(d, v, c, h, s) dma_mmap_attrs(d, v, c, h, s, 0)
 
+bool dma_coherent_ok(struct device *dev, phys_addr_t phys, size_t size);
+
 static inline void *dma_alloc_coherent(struct device *dev, size_t size,
 		dma_addr_t *dma_handle, gfp_t gfp)
 {
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 78a51d2f9f5c..ad5bdf66ed7a 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -80,6 +80,9 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t phys,
  * @area_nslabs: Number of slots in each area.
  * @areas:	Array of memory area descriptors.
  * @slots:	Array of slot descriptors.
+ * @node:	Member of the IO TLB memory pool list.
+ * @rcu:	RCU head for swiotlb_dyn_free().
+ * @transient:  %true if transient memory pool.
  */
 struct io_tlb_pool {
 	phys_addr_t start;
@@ -91,6 +94,11 @@ struct io_tlb_pool {
 	unsigned int area_nslabs;
 	struct io_tlb_area *areas;
 	struct io_tlb_slot *slots;
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	struct list_head node;
+	struct rcu_head rcu;
+	bool transient;
+#endif
 };
 
 /**
@@ -122,6 +130,20 @@ struct io_tlb_mem {
 #endif
 };
 
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+
+struct io_tlb_pool *swiotlb_find_pool(struct device *dev, phys_addr_t paddr);
+
+#else
+
+static inline struct io_tlb_pool *swiotlb_find_pool(struct device *dev,
+						    phys_addr_t paddr)
+{
+	return &dev->dma_io_tlb_mem->defpool;
+}
+
+#endif
+
 /**
  * is_swiotlb_buffer() - check if a physical address belongs to a swiotlb
  * @dev:        Device which has mapped the buffer.
@@ -137,7 +159,12 @@ static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
 
-	return mem && paddr >= mem->defpool.start && paddr < mem->defpool.end;
+	if (!mem)
+		return false;
+
+	if (IS_ENABLED(CONFIG_SWIOTLB_DYNAMIC))
+		return swiotlb_find_pool(dev, paddr);
+	return paddr >= mem->defpool.start && paddr < mem->defpool.end;
 }
 
 static inline bool is_swiotlb_force_bounce(struct device *dev)
diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
index d29cade048db..9596ae1aa0da 100644
--- a/kernel/dma/direct.c
+++ b/kernel/dma/direct.c
@@ -66,7 +66,7 @@ static gfp_t dma_direct_optimal_gfp_mask(struct device *dev, u64 *phys_limit)
 	return 0;
 }
 
-static bool dma_coherent_ok(struct device *dev, phys_addr_t phys, size_t size)
+bool dma_coherent_ok(struct device *dev, phys_addr_t phys, size_t size)
 {
 	dma_addr_t dma_addr = phys_to_dma_direct(dev, phys);
 
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 5acb4552f869..8672810f7c56 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -35,6 +35,7 @@
 #include <linux/memblock.h>
 #include <linux/mm.h>
 #include <linux/pfn.h>
+#include <linux/rculist.h>
 #include <linux/scatterlist.h>
 #include <linux/set_memory.h>
 #include <linux/spinlock.h>
@@ -510,6 +511,211 @@ void __init swiotlb_exit(void)
 	memset(mem, 0, sizeof(*mem));
 }
 
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+
+/**
+ * alloc_dma_pages() - allocate pages to be used for DMA
+ * @gfp:	GFP flags for the allocation.
+ * @bytes:	Size of the buffer.
+ *
+ * Allocate pages from the buddy allocator. If successful, make the allocated
+ * pages decrypted that they can be used for DMA.
+ *
+ * Return: Decrypted pages, or %NULL on failure.
+ */
+static struct page *alloc_dma_pages(gfp_t gfp, size_t bytes)
+{
+	unsigned int order = get_order(bytes);
+	struct page *page;
+	void *vaddr;
+
+	page = alloc_pages(gfp, order);
+	if (!page)
+		return NULL;
+
+	vaddr = page_address(page);
+	if (set_memory_decrypted((unsigned long)vaddr, PFN_UP(bytes)))
+		goto error;
+	return page;
+
+error:
+	__free_pages(page, order);
+	return NULL;
+}
+
+/**
+ * swiotlb_alloc_tlb() - allocate a dynamic IO TLB buffer
+ * @dev:	Device for which a memory pool is allocated.
+ * @bytes:	Size of the buffer.
+ * @phys_limit:	Maximum allowed physical address of the buffer.
+ * @gfp:	GFP flags for the allocation.
+ *
+ * Return: Allocated pages, or %NULL on allocation failure.
+ */
+static struct page *swiotlb_alloc_tlb(struct device *dev, size_t bytes,
+		u64 phys_limit, gfp_t gfp)
+{
+	struct page *page;
+
+	/*
+	 * Allocate from the atomic pools if memory is encrypted and
+	 * the allocation is atomic, because decrypting may block.
+	 */
+	if (!gfpflags_allow_blocking(gfp) && dev && force_dma_unencrypted(dev)) {
+		void *vaddr;
+
+		if (!IS_ENABLED(CONFIG_DMA_COHERENT_POOL))
+			return NULL;
+
+		return dma_alloc_from_pool(dev, bytes, &vaddr, gfp,
+					   dma_coherent_ok);
+	}
+
+	gfp &= ~GFP_ZONEMASK;
+	if (phys_limit <= DMA_BIT_MASK(zone_dma_bits))
+		gfp |= __GFP_DMA;
+	else if (phys_limit <= DMA_BIT_MASK(32))
+		gfp |= __GFP_DMA32;
+
+	while ((page = alloc_dma_pages(gfp, bytes)) &&
+	       page_to_phys(page) + bytes - 1 > phys_limit) {
+		/* allocated, but too high */
+		__free_pages(page, get_order(bytes));
+
+		if (IS_ENABLED(CONFIG_ZONE_DMA32) &&
+		    phys_limit < DMA_BIT_MASK(64) &&
+		    !(gfp & (__GFP_DMA32 | __GFP_DMA)))
+			gfp |= __GFP_DMA32;
+		else if (IS_ENABLED(CONFIG_ZONE_DMA) &&
+			 !(gfp & __GFP_DMA))
+			gfp = (gfp & ~__GFP_DMA32) | __GFP_DMA;
+		else
+			return NULL;
+	}
+
+	return page;
+}
+
+/**
+ * swiotlb_free_tlb() - free a dynamically allocated IO TLB buffer
+ * @vaddr:	Virtual address of the buffer.
+ * @bytes:	Size of the buffer.
+ */
+static void swiotlb_free_tlb(void *vaddr, size_t bytes)
+{
+	if (IS_ENABLED(CONFIG_DMA_COHERENT_POOL) &&
+	    dma_free_from_pool(NULL, vaddr, bytes))
+		return;
+
+	/* Intentional leak if pages cannot be encrypted again. */
+	if (!set_memory_encrypted((unsigned long)vaddr, PFN_UP(bytes)))
+		__free_pages(virt_to_page(vaddr), get_order(bytes));
+}
+
+/**
+ * swiotlb_alloc_pool() - allocate a new IO TLB memory pool
+ * @dev:	Device for which a memory pool is allocated.
+ * @nslabs:	Desired number of slabs.
+ * @phys_limit:	Maximum DMA buffer physical address.
+ * @gfp:	GFP flags for the allocations.
+ *
+ * Allocate and initialize a new IO TLB memory pool.
+ *
+ * Return: New memory pool, or %NULL on allocation failure.
+ */
+static struct io_tlb_pool *swiotlb_alloc_pool(struct device *dev,
+		unsigned int nslabs, u64 phys_limit, gfp_t gfp)
+{
+	struct io_tlb_pool *pool;
+	struct page *tlb;
+	size_t pool_size;
+	size_t tlb_size;
+
+	pool_size = sizeof(*pool) + array_size(sizeof(*pool->areas), 1) +
+		array_size(sizeof(*pool->slots), nslabs);
+	pool = kzalloc(pool_size, gfp);
+	if (!pool)
+		goto error;
+	pool->areas = (void *)pool + sizeof(*pool);
+	pool->slots = (void *)pool->areas + sizeof(*pool->areas);
+
+	tlb_size = nslabs << IO_TLB_SHIFT;
+	tlb = swiotlb_alloc_tlb(dev, tlb_size, phys_limit, gfp);
+	if (!tlb)
+		goto error_tlb;
+
+	swiotlb_init_io_tlb_pool(pool, page_to_phys(tlb), nslabs, true, 1);
+	return pool;
+
+error_tlb:
+	kfree(pool);
+error:
+	return NULL;
+}
+
+/**
+ * swiotlb_dyn_free() - RCU callback to free a memory pool
+ * @rcu:	RCU head in the corresponding struct io_tlb_pool.
+ */
+static void swiotlb_dyn_free(struct rcu_head *rcu)
+{
+	struct io_tlb_pool *pool = container_of(rcu, struct io_tlb_pool, rcu);
+	size_t tlb_size = pool->end - pool->start;
+
+	swiotlb_free_tlb(pool->vaddr, tlb_size);
+	kfree(pool);
+}
+
+/**
+ * swiotlb_find_pool() - find the IO TLB pool for a physical address
+ * @dev:        Device which has mapped the DMA buffer.
+ * @paddr:      Physical address within the DMA buffer.
+ *
+ * Find the IO TLB memory pool descriptor which contains the given physical
+ * address, if any.
+ *
+ * Return: Memory pool which contains @paddr, or %NULL if none.
+ */
+struct io_tlb_pool *swiotlb_find_pool(struct device *dev, phys_addr_t paddr)
+{
+	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
+	struct io_tlb_pool *pool = &mem->defpool;
+
+	if (paddr >= pool->start && paddr < pool->end)
+		return pool;
+
+	/* Pairs with smp_wmb() in swiotlb_find_slots(). */
+	smp_rmb();
+
+	rcu_read_lock();
+	list_for_each_entry_rcu(pool, &dev->dma_io_tlb_pools, node) {
+		if (paddr >= pool->start && paddr < pool->end)
+			goto out;
+	}
+	pool = NULL;
+out:
+	rcu_read_unlock();
+	return pool;
+}
+
+/**
+ * swiotlb_del_pool() - remove an IO TLB pool from a device
+ * @dev:	Owning device.
+ * @pool:	Memory pool to be removed.
+ */
+static void swiotlb_del_pool(struct device *dev, struct io_tlb_pool *pool)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&dev->dma_io_tlb_lock, flags);
+	list_del_rcu(&pool->node);
+	spin_unlock_irqrestore(&dev->dma_io_tlb_lock, flags);
+
+	call_rcu(&pool->rcu, swiotlb_dyn_free);
+}
+
+#endif	/* CONFIG_SWIOTLB_DYNAMIC */
+
 /**
  * swiotlb_dev_init() - initialize swiotlb fields in &struct device
  * @dev:	Device to be initialized.
@@ -517,6 +723,10 @@ void __init swiotlb_exit(void)
 void swiotlb_dev_init(struct device *dev)
 {
 	dev->dma_io_tlb_mem = &io_tlb_default_mem;
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	INIT_LIST_HEAD(&dev->dma_io_tlb_pools);
+	spin_lock_init(&dev->dma_io_tlb_lock);
+#endif
 }
 
 /*
@@ -533,7 +743,7 @@ static unsigned int swiotlb_align_offset(struct device *dev, u64 addr)
 static void swiotlb_bounce(struct device *dev, phys_addr_t tlb_addr, size_t size,
 			   enum dma_data_direction dir)
 {
-	struct io_tlb_pool *mem = &dev->dma_io_tlb_mem->defpool;
+	struct io_tlb_pool *mem = swiotlb_find_pool(dev, tlb_addr);
 	int index = (tlb_addr - mem->start) >> IO_TLB_SHIFT;
 	phys_addr_t orig_addr = mem->slots[index].orig_addr;
 	size_t alloc_size = mem->slots[index].alloc_size;
@@ -799,6 +1009,8 @@ static int swiotlb_pool_find_slots(struct device *dev, struct io_tlb_pool *pool,
 	return -1;
 }
 
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+
 /**
  * swiotlb_find_slots() - search for slots in the whole swiotlb
  * @dev:	Device which maps the buffer.
@@ -806,6 +1018,7 @@ static int swiotlb_pool_find_slots(struct device *dev, struct io_tlb_pool *pool,
  * @alloc_size: Total requested size of the bounce buffer,
  *		including initial alignment padding.
  * @alloc_align_mask:	Required alignment of the allocated buffer.
+ * @retpool:	Used memory pool, updated on return.
  *
  * Search through the whole software IO TLB to find a sequence of slots that
  * match the allocation constraints.
@@ -813,12 +1026,64 @@ static int swiotlb_pool_find_slots(struct device *dev, struct io_tlb_pool *pool,
  * Return: Index of the first allocated slot, or -1 on error.
  */
 static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
-		size_t alloc_size, unsigned int alloc_align_mask)
+		size_t alloc_size, unsigned int alloc_align_mask,
+		struct io_tlb_pool **retpool)
 {
-	return swiotlb_pool_find_slots(dev, &dev->dma_io_tlb_mem->defpool,
+	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
+	struct io_tlb_pool *pool;
+	unsigned long nslabs;
+	unsigned long flags;
+	u64 phys_limit;
+	int index;
+
+	pool = &mem->defpool;
+	index = swiotlb_pool_find_slots(dev, pool, orig_addr,
+					alloc_size, alloc_align_mask);
+	if (index >= 0)
+		goto found;
+
+	if (!mem->can_grow)
+		return -1;
+
+	nslabs = nr_slots(alloc_size);
+	phys_limit = min_not_zero(*dev->dma_mask, dev->bus_dma_limit);
+	pool = swiotlb_alloc_pool(dev, nslabs, phys_limit,
+				  GFP_NOWAIT | __GFP_NOWARN);
+	if (!pool)
+		return -1;
+
+	index = swiotlb_pool_find_slots(dev, pool, orig_addr,
+					alloc_size, alloc_align_mask);
+	if (index < 0) {
+		swiotlb_dyn_free(&pool->rcu);
+		return -1;
+	}
+
+	pool->transient = true;
+	spin_lock_irqsave(&dev->dma_io_tlb_lock, flags);
+	list_add_rcu(&pool->node, &dev->dma_io_tlb_pools);
+	spin_unlock_irqrestore(&dev->dma_io_tlb_lock, flags);
+
+	/* Pairs with smp_rmb() in swiotlb_find_pool(). */
+	smp_wmb();
+found:
+	*retpool = pool;
+	return index;
+}
+
+#else  /* !CONFIG_SWIOTLB_DYNAMIC */
+
+static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
+		size_t alloc_size, unsigned int alloc_align_mask,
+		struct io_tlb_pool **retpool)
+{
+	*retpool = &dev->dma_io_tlb_mem->defpool;
+	return swiotlb_pool_find_slots(dev, *retpool,
 				       orig_addr, alloc_size, alloc_align_mask);
 }
 
+#endif /* CONFIG_SWIOTLB_DYNAMIC */
+
 #ifdef CONFIG_DEBUG_FS
 
 /**
@@ -899,7 +1164,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
 	}
 
 	index = swiotlb_find_slots(dev, orig_addr,
-				   alloc_size + offset, alloc_align_mask);
+				   alloc_size + offset, alloc_align_mask, &pool);
 	if (index == -1) {
 		if (!(attrs & DMA_ATTR_NO_WARN))
 			dev_warn_ratelimited(dev,
@@ -913,7 +1178,6 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
 	 * This is needed when we sync the memory.  Then we sync the buffer if
 	 * needed.
 	 */
-	pool = &mem->defpool;
 	for (i = 0; i < nr_slots(alloc_size + offset); i++)
 		pool->slots[index + i].orig_addr = slot_addr(orig_addr, i);
 	tlb_addr = slot_addr(pool->start, index) + offset;
@@ -930,7 +1194,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
 
 static void swiotlb_release_slots(struct device *dev, phys_addr_t tlb_addr)
 {
-	struct io_tlb_pool *mem = &dev->dma_io_tlb_mem->defpool;
+	struct io_tlb_pool *mem = swiotlb_find_pool(dev, tlb_addr);
 	unsigned long flags;
 	unsigned int offset = swiotlb_align_offset(dev, tlb_addr);
 	int index = (tlb_addr - offset - mem->start) >> IO_TLB_SHIFT;
@@ -977,6 +1241,41 @@ static void swiotlb_release_slots(struct device *dev, phys_addr_t tlb_addr)
 	dec_used(dev->dma_io_tlb_mem, nslots);
 }
 
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+
+/**
+ * swiotlb_del_transient() - delete a transient memory pool
+ * @dev:	Device which mapped the buffer.
+ * @tlb_addr:	Physical address within a bounce buffer.
+ *
+ * Check whether the address belongs to a transient SWIOTLB memory pool.
+ * If yes, then delete the pool.
+ *
+ * Return: %true if @tlb_addr belonged to a transient pool that was released.
+ */
+static bool swiotlb_del_transient(struct device *dev, phys_addr_t tlb_addr)
+{
+	struct io_tlb_pool *pool;
+
+	pool = swiotlb_find_pool(dev, tlb_addr);
+	if (!pool->transient)
+		return false;
+
+	dec_used(dev->dma_io_tlb_mem, pool->nslabs);
+	swiotlb_del_pool(dev, pool);
+	return true;
+}
+
+#else  /* !CONFIG_SWIOTLB_DYNAMIC */
+
+static inline bool swiotlb_del_transient(struct device *dev,
+					 phys_addr_t tlb_addr)
+{
+	return false;
+}
+
+#endif	/* CONFIG_SWIOTLB_DYNAMIC */
+
 /*
  * tlb_addr is the physical address of the bounce buffer to unmap.
  */
@@ -991,6 +1290,8 @@ void swiotlb_tbl_unmap_single(struct device *dev, phys_addr_t tlb_addr,
 	    (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL))
 		swiotlb_bounce(dev, tlb_addr, mapping_size, DMA_FROM_DEVICE);
 
+	if (swiotlb_del_transient(dev, tlb_addr))
+		return;
 	swiotlb_release_slots(dev, tlb_addr);
 }
 
@@ -1172,11 +1473,10 @@ struct page *swiotlb_alloc(struct device *dev, size_t size)
 	if (!mem)
 		return NULL;
 
-	index = swiotlb_find_slots(dev, 0, size, 0);
+	index = swiotlb_find_slots(dev, 0, size, 0, &pool);
 	if (index == -1)
 		return NULL;
 
-	pool = &mem->defpool;
 	tlb_addr = slot_addr(pool->start, index);
 
 	return pfn_to_page(PFN_DOWN(tlb_addr));
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:15:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:15:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568841.888904 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuTB-0001Ew-0q; Mon, 24 Jul 2023 12:15:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568841.888904; Mon, 24 Jul 2023 12:15:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuTA-0001Ep-S9; Mon, 24 Jul 2023 12:15:20 +0000
Received: by outflank-mailman (input) for mailman id 568841;
 Mon, 24 Jul 2023 12:15:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0CZD=DK=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qNuT9-0000u4-KT
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:15:19 +0000
Received: from frasgout13.his.huawei.com (unknown [14.137.139.46])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c142bbb3-2a1b-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 14:15:19 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.228])
 by frasgout13.his.huawei.com (SkyGuard) with ESMTP id 4R8f2n1xB0z9yh9p
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 20:04:01 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.222.124])
 by APP2 (Coremail) with SMTP id GxC2BwA3_lTGar5ky0byBA--.27936S9;
 Mon, 24 Jul 2023 13:14:51 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c142bbb3-2a1b-11ee-b23a-6b7b168915f2
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v5 7/9] swiotlb: determine potential physical address limit
Date: Mon, 24 Jul 2023 14:12:43 +0200
Message-Id: <0d4d789bf4d7caddb88c5690a82c66f146532a3e.1690200598.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
References: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2BwA3_lTGar5ky0byBA--.27936S9
X-Coremail-Antispam: 1UD129KBjvJXoWxXw4fJr1kZrW7Cry5Cw4xtFb_yoW5AF4DpF
	y8Jr4FgFsFqF12yrWxCw1IyFn5Ga18CrW29rW5urnxZr17Ww13Wrs7Kr45trySqF4IgF4S
	9Fyxua4Y9FsFv37anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDU0xBIdaVrnRJUUUml14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0
	rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYI
	kIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2
	z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F
	4UJwA2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr0_
	Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6x
	IIjxv20xvE14v26r106r15McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_
	Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8c
	xan2IY04v7MxkF7I0Ew4C26cxK6c8Ij28IcwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE
	7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI
	8E67AF67kF1VAFwI0_Wrv_Gr1UMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_JFI_
	Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1lIxAIcVCF04k26cxKx2IYs7xG6r
	1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr1j6F4U
	JbIYCTnIWIevJa73UjIFyTuYvjfUnzVbDUUUU
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

The value returned by default_swiotlb_limit() should be constant, because
it is used to decide whether DMA can be used. To allow allocating memory
pools on the fly, use the maximum possible physical address rather than the
highest address used by the default pool.

For swiotlb_init_remap(), this is either an arch-specific limit used by
memblock_alloc_low(), or the highest directly mapped physical address if
the initialization flags include SWIOTLB_ANY. For swiotlb_init_late(), the
highest address is determined by the GFP flags.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/swiotlb.h |  2 ++
 kernel/dma/swiotlb.c    | 14 ++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index ad5bdf66ed7a..d5ce51657fac 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -109,6 +109,7 @@ struct io_tlb_pool {
  * @force_bounce: %true if swiotlb bouncing is forced
  * @for_alloc:  %true if the pool is used for memory allocation
  * @can_grow:	%true if more pools can be allocated dynamically.
+ * @phys_limit:	Maximum allowed physical address.
  * @total_used:	The total number of slots in the pool that are currently used
  *		across all areas. Used only for calculating used_hiwater in
  *		debugfs.
@@ -123,6 +124,7 @@ struct io_tlb_mem {
 	bool for_alloc;
 #ifdef CONFIG_SWIOTLB_DYNAMIC
 	bool can_grow;
+	u64 phys_limit;
 #endif
 #ifdef CONFIG_DEBUG_FS
 	atomic_long_t total_used;
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 8672810f7c56..7e8edf011bba 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -334,6 +334,10 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 #ifdef CONFIG_SWIOTLB_DYNAMIC
 	if (!remap)
 		io_tlb_default_mem.can_grow = true;
+	if (flags & SWIOTLB_ANY)
+		io_tlb_default_mem.phys_limit = virt_to_phys(high_memory - 1);
+	else
+		io_tlb_default_mem.phys_limit = ARCH_LOW_ADDRESS_LIMIT;
 #endif
 
 	if (!default_nareas)
@@ -409,6 +413,12 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 #ifdef CONFIG_SWIOTLB_DYNAMIC
 	if (!remap)
 		io_tlb_default_mem.can_grow = true;
+	if (IS_ENABLED(CONFIG_ZONE_DMA) && (gfp_mask & __GFP_DMA))
+		io_tlb_default_mem.phys_limit = DMA_BIT_MASK(zone_dma_bits);
+	else if (IS_ENABLED(CONFIG_ZONE_DMA32) && (gfp_mask & __GFP_DMA32))
+		io_tlb_default_mem.phys_limit = DMA_BIT_MASK(32);
+	else
+		io_tlb_default_mem.phys_limit = virt_to_phys(high_memory - 1);
 #endif
 
 	if (!default_nareas)
@@ -1390,7 +1400,11 @@ phys_addr_t default_swiotlb_base(void)
  */
 phys_addr_t default_swiotlb_limit(void)
 {
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	return io_tlb_default_mem.phys_limit;
+#else
 	return io_tlb_default_mem.defpool.end - 1;
+#endif
 }
 
 #ifdef CONFIG_DEBUG_FS
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:15:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:15:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568846.888913 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuTP-0001jv-A9; Mon, 24 Jul 2023 12:15:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568846.888913; Mon, 24 Jul 2023 12:15:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuTP-0001jl-72; Mon, 24 Jul 2023 12:15:35 +0000
Received: by outflank-mailman (input) for mailman id 568846;
 Mon, 24 Jul 2023 12:15:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0CZD=DK=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qNuTO-0000u4-7b
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:15:34 +0000
Received: from frasgout13.his.huawei.com (unknown [14.137.139.46])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c9c6a757-2a1b-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 14:15:33 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.228])
 by frasgout13.his.huawei.com (SkyGuard) with ESMTP id 4R8f333zV2z9yh9p
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 20:04:15 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.222.124])
 by APP2 (Coremail) with SMTP id GxC2BwA3_lTGar5ky0byBA--.27936S10;
 Mon, 24 Jul 2023 13:15:06 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c9c6a757-2a1b-11ee-b23a-6b7b168915f2
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v5 8/9] swiotlb: allocate a new memory pool when existing pools are full
Date: Mon, 24 Jul 2023 14:12:44 +0200
Message-Id: <e9cff9b0968b86911cd26d52bb5c1f6c34c22584.1690200598.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
References: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2BwA3_lTGar5ky0byBA--.27936S10
X-Coremail-Antispam: 1UD129KBjvJXoW3ZrWfGFyxAryxCr4UJFWfAFb_yoWkXrW3pF
	y5Aa47KFWUXrn7CFy2k3WUCF1a9w4vkr47CrWa9rn8Zrn2grn8tFyqkryYqr95JF4DZF13
	tFWYvF15uw47Zw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDU0xBIdaVrnRJUUUmm14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0
	rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYI
	kIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2
	z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F
	4UJwA2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z280aVCY1x0267AKxVWxJr0_
	GcWle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2I
	x0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8
	JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7CjxVA2Y2
	ka0xkIwI1lc7CjxVAKzI0EY4vE52x082I5MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCj
	c4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4
	CE17CEb7AF67AKxVWrXVW8Jr1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUCVW8
	JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJwCI42IY6xAIw20EY4v20xvaj40_Jr
	0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8Jr0_Cr1U
	YxBIdaVFxhVjvjDU0xZFpf9x0JU3EfOUUUUU=
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

When swiotlb_find_slots() cannot find suitable slots, schedule the
allocation of a new memory pool. It is not possible to allocate the pool
immediately, because this code may run in interrupt context, which is not
suitable for large memory allocations. This means that the memory pool will
be available too late for the currently requested mapping, but the stress
on the software IO TLB allocator is likely to continue, and subsequent
allocations will benefit from the additional pool eventually.

Keep all memory pools for an allocator in an RCU list to avoid locking on
the read side. For modifications, add a new spinlock to struct io_tlb_mem.

The spinlock also protects updates to the total number of slabs (nslabs in
struct io_tlb_mem), but not reads of the value. Readers may therefore
encounter a stale value, but this is not an issue:

- swiotlb_tbl_map_single() and is_swiotlb_active() only check for non-zero
  value. This is ensured by the existence of the default memory pool,
  allocated at boot.

- The exact value is used only for non-critical purposes (debugfs, kernel
  messages).

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/swiotlb.h |   8 +++
 kernel/dma/swiotlb.c    | 148 +++++++++++++++++++++++++++++++++-------
 2 files changed, 131 insertions(+), 25 deletions(-)

diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index d5ce51657fac..8a9249685d0d 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -8,6 +8,7 @@
 #include <linux/types.h>
 #include <linux/limits.h>
 #include <linux/spinlock.h>
+#include <linux/workqueue.h>
 
 struct device;
 struct page;
@@ -104,12 +105,16 @@ struct io_tlb_pool {
 /**
  * struct io_tlb_mem - Software IO TLB allocator
  * @defpool:	Default (initial) IO TLB memory pool descriptor.
+ * @pool:	IO TLB memory pool descriptor (if not dynamic).
  * @nslabs:	Total number of IO TLB slabs in all pools.
  * @debugfs:	The dentry to debugfs.
  * @force_bounce: %true if swiotlb bouncing is forced
  * @for_alloc:  %true if the pool is used for memory allocation
  * @can_grow:	%true if more pools can be allocated dynamically.
  * @phys_limit:	Maximum allowed physical address.
+ * @lock:	Lock to synchronize changes to the list.
+ * @pools:	List of IO TLB memory pool descriptors (if dynamic).
+ * @dyn_alloc:	Dynamic IO TLB pool allocation work.
  * @total_used:	The total number of slots in the pool that are currently used
  *		across all areas. Used only for calculating used_hiwater in
  *		debugfs.
@@ -125,6 +130,9 @@ struct io_tlb_mem {
 #ifdef CONFIG_SWIOTLB_DYNAMIC
 	bool can_grow;
 	u64 phys_limit;
+	spinlock_t lock;
+	struct list_head pools;
+	struct work_struct dyn_alloc;
 #endif
 #ifdef CONFIG_DEBUG_FS
 	atomic_long_t total_used;
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 7e8edf011bba..3156bb6aa343 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -79,8 +79,23 @@ struct io_tlb_slot {
 static bool swiotlb_force_bounce;
 static bool swiotlb_force_disable;
 
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+
+static void swiotlb_dyn_alloc(struct work_struct *work);
+
+static struct io_tlb_mem io_tlb_default_mem = {
+	.lock = __SPIN_LOCK_UNLOCKED(io_tlb_default_mem.lock),
+	.pools = LIST_HEAD_INIT(io_tlb_default_mem.pools),
+	.dyn_alloc = __WORK_INITIALIZER(io_tlb_default_mem.dyn_alloc,
+					swiotlb_dyn_alloc),
+};
+
+#else  /* !CONFIG_SWIOTLB_DYNAMIC */
+
 static struct io_tlb_mem io_tlb_default_mem;
 
+#endif	/* CONFIG_SWIOTLB_DYNAMIC */
+
 static unsigned long default_nslabs = IO_TLB_DEFAULT_SIZE >> IO_TLB_SHIFT;
 static unsigned long default_nareas;
 
@@ -278,6 +293,23 @@ static void swiotlb_init_io_tlb_pool(struct io_tlb_pool *mem, phys_addr_t start,
 	return;
 }
 
+/**
+ * add_mem_pool() - add a memory pool to the allocator
+ * @mem:	Software IO TLB allocator.
+ * @pool:	Memory pool to be added.
+ */
+static void add_mem_pool(struct io_tlb_mem *mem, struct io_tlb_pool *pool)
+{
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	spin_lock(&mem->lock);
+	list_add_rcu(&pool->node, &mem->pools);
+	mem->nslabs += pool->nslabs;
+	spin_unlock(&mem->lock);
+#else
+	mem->nslabs = pool->nslabs;
+#endif
+}
+
 static void __init *swiotlb_memblock_alloc(unsigned long nslabs,
 		unsigned int flags,
 		int (*remap)(void *tlb, unsigned long nslabs))
@@ -375,7 +407,7 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 
 	swiotlb_init_io_tlb_pool(mem, __pa(tlb), nslabs, false,
 				 default_nareas);
-	io_tlb_default_mem.nslabs = nslabs;
+	add_mem_pool(&io_tlb_default_mem, mem);
 
 	if (flags & SWIOTLB_VERBOSE)
 		swiotlb_print_info();
@@ -474,7 +506,7 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 			     (nslabs << IO_TLB_SHIFT) >> PAGE_SHIFT);
 	swiotlb_init_io_tlb_pool(mem, virt_to_phys(vstart), nslabs, true,
 				 nareas);
-	io_tlb_default_mem.nslabs = nslabs;
+	add_mem_pool(&io_tlb_default_mem, mem);
 
 	swiotlb_print_info();
 	return 0;
@@ -625,44 +657,83 @@ static void swiotlb_free_tlb(void *vaddr, size_t bytes)
 /**
  * swiotlb_alloc_pool() - allocate a new IO TLB memory pool
  * @dev:	Device for which a memory pool is allocated.
- * @nslabs:	Desired number of slabs.
+ * @minslabs:	Minimum number of slabs.
+ * @nslabs:	Desired (maximum) number of slabs.
+ * @nareas:	Number of areas.
  * @phys_limit:	Maximum DMA buffer physical address.
  * @gfp:	GFP flags for the allocations.
  *
- * Allocate and initialize a new IO TLB memory pool.
+ * Allocate and initialize a new IO TLB memory pool. The actual number of
+ * slabs may be reduced if allocation of @nslabs fails. If even
+ * @minslabs cannot be allocated, this function fails.
  *
  * Return: New memory pool, or %NULL on allocation failure.
  */
 static struct io_tlb_pool *swiotlb_alloc_pool(struct device *dev,
-		unsigned int nslabs, u64 phys_limit, gfp_t gfp)
+		unsigned long minslabs, unsigned long nslabs,
+		unsigned int nareas, u64 phys_limit, gfp_t gfp)
 {
 	struct io_tlb_pool *pool;
+	unsigned int slot_order;
 	struct page *tlb;
 	size_t pool_size;
 	size_t tlb_size;
 
-	pool_size = sizeof(*pool) + array_size(sizeof(*pool->areas), 1) +
-		array_size(sizeof(*pool->slots), nslabs);
+	pool_size = sizeof(*pool) + array_size(sizeof(*pool->areas), nareas);
 	pool = kzalloc(pool_size, gfp);
 	if (!pool)
 		goto error;
 	pool->areas = (void *)pool + sizeof(*pool);
-	pool->slots = (void *)pool->areas + sizeof(*pool->areas);
 
 	tlb_size = nslabs << IO_TLB_SHIFT;
-	tlb = swiotlb_alloc_tlb(dev, tlb_size, phys_limit, gfp);
-	if (!tlb)
-		goto error_tlb;
+	while (!(tlb = swiotlb_alloc_tlb(dev, tlb_size, phys_limit, gfp))) {
+		if (nslabs <= minslabs)
+			goto error_tlb;
+		nslabs = ALIGN(nslabs >> 1, IO_TLB_SEGSIZE);
+		nareas = limit_nareas(nareas, nslabs);
+		tlb_size = nslabs << IO_TLB_SHIFT;
+	}
 
-	swiotlb_init_io_tlb_pool(pool, page_to_phys(tlb), nslabs, true, 1);
+	slot_order = get_order(array_size(sizeof(*pool->slots), nslabs));
+	pool->slots = (struct io_tlb_slot *)
+		__get_free_pages(gfp, slot_order);
+	if (!pool->slots)
+		goto error_slots;
+
+	swiotlb_init_io_tlb_pool(pool, page_to_phys(tlb), nslabs, true, nareas);
 	return pool;
 
+error_slots:
+	swiotlb_free_tlb(page_address(tlb), tlb_size);
 error_tlb:
 	kfree(pool);
 error:
 	return NULL;
 }
 
+/**
+ * swiotlb_dyn_alloc() - dynamic memory pool allocation worker
+ * @work:	Pointer to dyn_alloc in struct io_tlb_mem.
+ */
+static void swiotlb_dyn_alloc(struct work_struct *work)
+{
+	struct io_tlb_mem *mem =
+		container_of(work, struct io_tlb_mem, dyn_alloc);
+	struct io_tlb_pool *pool;
+
+	pool = swiotlb_alloc_pool(NULL, IO_TLB_MIN_SLABS, default_nslabs,
+				  default_nareas, mem->phys_limit, GFP_KERNEL);
+	if (!pool) {
+		pr_warn_ratelimited("Failed to allocate new pool");
+		return;
+	}
+
+	add_mem_pool(mem, pool);
+
+	/* Pairs with smp_rmb() in swiotlb_find_pool(). */
+	smp_wmb();
+}
+
 /**
  * swiotlb_dyn_free() - RCU callback to free a memory pool
  * @rcu:	RCU head in the corresponding struct io_tlb_pool.
@@ -670,8 +741,10 @@ static struct io_tlb_pool *swiotlb_alloc_pool(struct device *dev,
 static void swiotlb_dyn_free(struct rcu_head *rcu)
 {
 	struct io_tlb_pool *pool = container_of(rcu, struct io_tlb_pool, rcu);
+	size_t slots_size = array_size(sizeof(*pool->slots), pool->nslabs);
 	size_t tlb_size = pool->end - pool->start;
 
+	free_pages((unsigned long)pool->slots, get_order(slots_size));
 	swiotlb_free_tlb(pool->vaddr, tlb_size);
 	kfree(pool);
 }
@@ -689,15 +762,19 @@ static void swiotlb_dyn_free(struct rcu_head *rcu)
 struct io_tlb_pool *swiotlb_find_pool(struct device *dev, phys_addr_t paddr)
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
-	struct io_tlb_pool *pool = &mem->defpool;
-
-	if (paddr >= pool->start && paddr < pool->end)
-		return pool;
+	struct io_tlb_pool *pool;
 
-	/* Pairs with smp_wmb() in swiotlb_find_slots(). */
+	/* Pairs with smp_wmb() in swiotlb_find_slots() and
+	 * swiotlb_dyn_alloc(), which modify the RCU lists.
+	 */
 	smp_rmb();
 
 	rcu_read_lock();
+	list_for_each_entry_rcu(pool, &mem->pools, node) {
+		if (paddr >= pool->start && paddr < pool->end)
+			goto out;
+	}
+
 	list_for_each_entry_rcu(pool, &dev->dma_io_tlb_pools, node) {
 		if (paddr >= pool->start && paddr < pool->end)
 			goto out;
@@ -1046,18 +1123,24 @@ static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
 	u64 phys_limit;
 	int index;
 
-	pool = &mem->defpool;
-	index = swiotlb_pool_find_slots(dev, pool, orig_addr,
-					alloc_size, alloc_align_mask);
-	if (index >= 0)
-		goto found;
-
+	rcu_read_lock();
+	list_for_each_entry_rcu(pool, &mem->pools, node) {
+		index = swiotlb_pool_find_slots(dev, pool, orig_addr,
+						alloc_size, alloc_align_mask);
+		if (index >= 0) {
+			rcu_read_unlock();
+			goto found;
+		}
+	}
+	rcu_read_unlock();
 	if (!mem->can_grow)
 		return -1;
 
+	schedule_work(&mem->dyn_alloc);
+
 	nslabs = nr_slots(alloc_size);
 	phys_limit = min_not_zero(*dev->dma_mask, dev->bus_dma_limit);
-	pool = swiotlb_alloc_pool(dev, nslabs, phys_limit,
+	pool = swiotlb_alloc_pool(dev, nslabs, nslabs, 1, phys_limit,
 				  GFP_NOWAIT | __GFP_NOWARN);
 	if (!pool)
 		return -1;
@@ -1141,7 +1224,19 @@ static unsigned long mem_pool_used(struct io_tlb_pool *pool)
  */
 static unsigned long mem_used(struct io_tlb_mem *mem)
 {
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	struct io_tlb_pool *pool;
+	unsigned long used = 0;
+
+	rcu_read_lock();
+	list_for_each_entry_rcu(pool, &mem->pools, node)
+		used += mem_pool_used(pool);
+	rcu_read_unlock();
+
+	return used;
+#else
 	return mem_pool_used(&mem->defpool);
+#endif
 }
 
 #endif /* CONFIG_DEBUG_FS */
@@ -1555,7 +1650,10 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem,
 					 false, nareas);
 		mem->force_bounce = true;
 		mem->for_alloc = true;
-		mem->nslabs = nslabs;
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+		spin_lock_init(&mem->lock);
+#endif
+		add_mem_pool(mem, pool);
 
 		rmem->priv = mem;
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:15:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:15:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568852.888923 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuTd-0002Li-Ir; Mon, 24 Jul 2023 12:15:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568852.888923; Mon, 24 Jul 2023 12:15:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuTd-0002LZ-FO; Mon, 24 Jul 2023 12:15:49 +0000
Received: by outflank-mailman (input) for mailman id 568852;
 Mon, 24 Jul 2023 12:15:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0CZD=DK=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qNuTc-0000u4-AW
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:15:48 +0000
Received: from frasgout13.his.huawei.com (unknown [14.137.139.46])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d2571d90-2a1b-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 14:15:47 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.228])
 by frasgout13.his.huawei.com (SkyGuard) with ESMTP id 4R8f3K6fGRz9yXKP
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 20:04:29 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.222.124])
 by APP2 (Coremail) with SMTP id GxC2BwA3_lTGar5ky0byBA--.27936S11;
 Mon, 24 Jul 2023 13:15:20 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d2571d90-2a1b-11ee-b23a-6b7b168915f2
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v5 9/9] swiotlb: search the software IO TLB only if the device makes use of it
Date: Mon, 24 Jul 2023 14:12:45 +0200
Message-Id: <5a2cf3a8b5a20c739a2369548ec49e7547827a92.1690200599.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
References: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
MIME-Version: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20xvEc7CjxVAFwI0_Gr1j6F4UJwCI42IY6xAIw20EY4v20xvaj40_Jr
	0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AKxVWxJr0_GcJv
	cSsGvfC2KfnxnUUI43ZEXa7VUjyCJPUUUUU==
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

Skip searching the software IO TLB if a device has never used it, making
sure these devices are not affected by the introduction of multiple IO TLB
memory pools.

Additional memory barrier is required to ensure that the new value of the
flag is visible to other CPUs after mapping a new bounce buffer. For
efficiency, the flag check should be inlined, and then the memory barrier
must be moved to is_swiotlb_buffer(). However, it can replace the existing
barrier in swiotlb_find_pool(), because all callers use is_swiotlb_buffer()
first to verify that the buffer address belongs to the software IO TLB.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/device.h  |  2 ++
 include/linux/swiotlb.h |  7 ++++++-
 kernel/dma/swiotlb.c    | 14 ++++++--------
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/include/linux/device.h b/include/linux/device.h
index 5fd89c9d005c..6fc808d22bfd 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -628,6 +628,7 @@ struct device_physical_location {
  * @dma_io_tlb_mem: Software IO TLB allocator.  Not for driver use.
  * @dma_io_tlb_pools:	List of transient swiotlb memory pools.
  * @dma_io_tlb_lock:	Protects changes to the list of active pools.
+ * @dma_uses_io_tlb: %true if device has used the software IO TLB.
  * @archdata:	For arch-specific additions.
  * @of_node:	Associated device tree node.
  * @fwnode:	Associated device node supplied by platform firmware.
@@ -737,6 +738,7 @@ struct device {
 #ifdef CONFIG_SWIOTLB_DYNAMIC
 	struct list_head dma_io_tlb_pools;
 	spinlock_t dma_io_tlb_lock;
+	bool dma_uses_io_tlb;
 #endif
 	/* arch specific additions */
 	struct dev_archdata	archdata;
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 8a9249685d0d..b3cf602922dc 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -172,8 +172,13 @@ static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
 	if (!mem)
 		return false;
 
-	if (IS_ENABLED(CONFIG_SWIOTLB_DYNAMIC))
+	if (IS_ENABLED(CONFIG_SWIOTLB_DYNAMIC)) {
+		/* Pairs with smp_wmb() in swiotlb_find_slots() and
+		 * swiotlb_dyn_alloc(), which modify the RCU lists.
+		 */
+		smp_rmb();
 		return swiotlb_find_pool(dev, paddr);
+	}
 	return paddr >= mem->defpool.start && paddr < mem->defpool.end;
 }
 
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 3156bb6aa343..87b8c2417c68 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -730,7 +730,7 @@ static void swiotlb_dyn_alloc(struct work_struct *work)
 
 	add_mem_pool(mem, pool);
 
-	/* Pairs with smp_rmb() in swiotlb_find_pool(). */
+	/* Pairs with smp_rmb() in is_swiotlb_buffer(). */
 	smp_wmb();
 }
 
@@ -764,11 +764,6 @@ struct io_tlb_pool *swiotlb_find_pool(struct device *dev, phys_addr_t paddr)
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
 	struct io_tlb_pool *pool;
 
-	/* Pairs with smp_wmb() in swiotlb_find_slots() and
-	 * swiotlb_dyn_alloc(), which modify the RCU lists.
-	 */
-	smp_rmb();
-
 	rcu_read_lock();
 	list_for_each_entry_rcu(pool, &mem->pools, node) {
 		if (paddr >= pool->start && paddr < pool->end)
@@ -813,6 +808,7 @@ void swiotlb_dev_init(struct device *dev)
 #ifdef CONFIG_SWIOTLB_DYNAMIC
 	INIT_LIST_HEAD(&dev->dma_io_tlb_pools);
 	spin_lock_init(&dev->dma_io_tlb_lock);
+	dev->dma_uses_io_tlb = false;
 #endif
 }
 
@@ -1157,9 +1153,11 @@ static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
 	list_add_rcu(&pool->node, &dev->dma_io_tlb_pools);
 	spin_unlock_irqrestore(&dev->dma_io_tlb_lock, flags);
 
-	/* Pairs with smp_rmb() in swiotlb_find_pool(). */
-	smp_wmb();
 found:
+	dev->dma_uses_io_tlb = true;
+	/* Pairs with smp_rmb() in is_swiotlb_buffer() */
+	smp_wmb();
+
 	*retpool = pool;
 	return index;
 }
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:17:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:17:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568868.888946 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuV8-0003Wq-Nb; Mon, 24 Jul 2023 12:17:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568868.888946; Mon, 24 Jul 2023 12:17:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuV8-0003WC-JM; Mon, 24 Jul 2023 12:17:22 +0000
Received: by outflank-mailman (input) for mailman id 568868;
 Mon, 24 Jul 2023 12:17:21 +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
 <SRS0=0CZD=DK=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qNuSh-0007hM-NM
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:14:51 +0000
Received: from frasgout13.his.huawei.com (unknown [14.137.139.46])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id aff8c014-2a1b-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:14:50 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.227])
 by frasgout13.his.huawei.com (SkyGuard) with ESMTP id 4R8f2D1l2pz9yh9n
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 20:03:32 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.222.124])
 by APP2 (Coremail) with SMTP id GxC2BwA3_lTGar5ky0byBA--.27936S7;
 Mon, 24 Jul 2023 13:14:23 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aff8c014-2a1b-11ee-8612-37d641c3527e
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v5 5/9] swiotlb: add a flag whether SWIOTLB is allowed to grow
Date: Mon, 24 Jul 2023 14:12:41 +0200
Message-Id: <0c0c9033b48962930c66c0325bb385ce2744b8bd.1690200598.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
References: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2BwA3_lTGar5ky0byBA--.27936S7
X-Coremail-Antispam: 1UD129KBjvJXoWxWrW8XF1fKr1fZr13Wr4UArb_yoWrWryUpF
	15XF4rtF4IqF1xArZ7Cw1xGF9akw4kKrW7urWa9ry5Ar43Jw1Yq3WDKayYq34Fqrs2qF4S
	qFyS9r1Ykr17ZwUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDU0xBIdaVrnRJUUUml14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0
	rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYI
	kIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2
	z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F
	4UJwA2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr0_
	Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6x
	IIjxv20xvE14v26r106r15McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_
	Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8c
	xan2IY04v7MxkF7I0Ew4C26cxK6c8Ij28IcwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE
	7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI
	8E67AF67kF1VAFwI0_Wrv_Gr1UMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_JFI_
	Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1lIxAIcVCF04k26cxKx2IYs7xG6r
	1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr1j6F4U
	JbIYCTnIWIevJa73UjIFyTuYvjfUnzVbDUUUU
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

Add a config option (CONFIG_SWIOTLB_DYNAMIC) to enable or disable dynamic
allocation of additional bounce buffers.

If this option is set, mark the default SWIOTLB as able to grow and
restricted DMA pools as unable.

However, if the address of the default memory pool is explicitly queried,
make the default SWIOTLB also unable to grow. This is currently used to set
up PCI BAR movable regions on some Octeon MIPS boards which may not be able
to use a SWIOTLB pool elsewhere in physical memory. See octeon_pci_setup()
for more details.

If a remap function is specified, it must be also called on any dynamically
allocated pools, but there are some issues:

- The remap function may block, so it should not be called from an atomic
  context.
- There is no corresponding unremap() function if the memory pool is
  freed.
- The only in-tree implementation (xen_swiotlb_fixup) requires that the
  number of slots in the memory pool is a multiple of SWIOTLB_SEGSIZE.

Keep it simple for now and disable growing the SWIOTLB if a remap function
was specified.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/swiotlb.h |  4 ++++
 kernel/dma/Kconfig      | 13 +++++++++++++
 kernel/dma/swiotlb.c    | 13 +++++++++++++
 3 files changed, 30 insertions(+)

diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index fd01a0870b38..78a51d2f9f5c 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -100,6 +100,7 @@ struct io_tlb_pool {
  * @debugfs:	The dentry to debugfs.
  * @force_bounce: %true if swiotlb bouncing is forced
  * @for_alloc:  %true if the pool is used for memory allocation
+ * @can_grow:	%true if more pools can be allocated dynamically.
  * @total_used:	The total number of slots in the pool that are currently used
  *		across all areas. Used only for calculating used_hiwater in
  *		debugfs.
@@ -112,6 +113,9 @@ struct io_tlb_mem {
 	struct dentry *debugfs;
 	bool force_bounce;
 	bool for_alloc;
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	bool can_grow;
+#endif
 #ifdef CONFIG_DEBUG_FS
 	atomic_long_t total_used;
 	atomic_long_t used_hiwater;
diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig
index 11d077003205..68c61fdf2b44 100644
--- a/kernel/dma/Kconfig
+++ b/kernel/dma/Kconfig
@@ -90,6 +90,19 @@ config SWIOTLB
 	bool
 	select NEED_DMA_MAP_STATE
 
+config SWIOTLB_DYNAMIC
+	bool "Dynamic allocation of DMA bounce buffers"
+	default n
+	depends on SWIOTLB
+	help
+	  This enables dynamic resizing of the software IO TLB. The kernel
+	  starts with one memory pool at boot and it will allocate additional
+	  pools as needed. To reduce run-time kernel memory requirements, you
+	  may have to specify a smaller size of the initial pool using
+	  "swiotlb=" on the kernel command line.
+
+	  If unsure, say N.
+
 config DMA_BOUNCE_UNALIGNED_KMALLOC
 	bool
 	depends on SWIOTLB
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 11bacde00df7..5acb4552f869 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -330,6 +330,11 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 	io_tlb_default_mem.force_bounce =
 		swiotlb_force_bounce || (flags & SWIOTLB_FORCE);
 
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	if (!remap)
+		io_tlb_default_mem.can_grow = true;
+#endif
+
 	if (!default_nareas)
 		swiotlb_adjust_nareas(num_possible_cpus());
 
@@ -400,6 +405,11 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 
 	io_tlb_default_mem.force_bounce = swiotlb_force_bounce;
 
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	if (!remap)
+		io_tlb_default_mem.can_grow = true;
+#endif
+
 	if (!default_nareas)
 		swiotlb_adjust_nareas(num_possible_cpus());
 
@@ -1066,6 +1076,9 @@ EXPORT_SYMBOL_GPL(is_swiotlb_active);
  */
 phys_addr_t default_swiotlb_base(void)
 {
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	io_tlb_default_mem.can_grow = false;
+#endif
 	return io_tlb_default_mem.defpool.start;
 }
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:17:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:17:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568859.888933 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuV7-0003Gd-TJ; Mon, 24 Jul 2023 12:17:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568859.888933; Mon, 24 Jul 2023 12:17:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuV7-0003GW-Py; Mon, 24 Jul 2023 12:17:21 +0000
Received: by outflank-mailman (input) for mailman id 568859;
 Mon, 24 Jul 2023 12:17:19 +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
 <SRS0=0CZD=DK=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qNuSU-0007hM-Ml
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:14:38 +0000
Received: from frasgout11.his.huawei.com (unknown [14.137.139.23])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a761ebf7-2a1b-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:14:36 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.228])
 by frasgout11.his.huawei.com (SkyGuard) with ESMTP id 4R8f1v3Yq2z9ynSl
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 20:03:15 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.222.124])
 by APP2 (Coremail) with SMTP id GxC2BwA3_lTGar5ky0byBA--.27936S6;
 Mon, 24 Jul 2023 13:14:08 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a761ebf7-2a1b-11ee-8612-37d641c3527e
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v5 4/9] swiotlb: separate memory pool data from other allocator data
Date: Mon, 24 Jul 2023 14:12:40 +0200
Message-Id: <01b36bededb5284218c54eecadef783bf201fdef.1690200598.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
References: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2BwA3_lTGar5ky0byBA--.27936S6
X-Coremail-Antispam: 1UD129KBjvAXoWfCF4rZw4DCr18Wr1xWF1kGrg_yoW8Zw15Ao
	W7GFnrXw4fJryjkFW7Aan3Jr47uayqka1rAF1rZay5Xayjyr4Ygw4fta15Xw1fWr1fGFWx
	AwnxWa48WF4kAr18n29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73VFW2AGmfu7bjvjm3
	AaLaJ3UjIYCTnIWjp_UUUOT7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20EY4v20xva
	j40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r126s0DM28Irc
	Ia0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l
	84ACjcxK6xIIjxv20xvE14v26r1I6r4UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4UJV
	WxJr1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr1j
	6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7V
	C0I7IYx2IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j
	6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x0262
	8vn2kIc2xKxwCY1x0264kExVAvwVAq07x20xyl42xK82IYc2Ij64vIr41l4I8I3I0E4IkC
	6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWw
	C2zVAF1VAY17CE14v26rWY6r4UJwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1I
	6r4UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UMIIF0xvE42xK8VAvwI8IcIk0rV
	WUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4UJVWx
	JrUvcSsGvfC2KfnxnUUI43ZEXa7VUjyCJPUUUUU==
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

Carve out memory pool specific fields from struct io_tlb_mem. The original
struct now contains shared data for the whole allocator, while the new
struct io_tlb_pool contains data that is specific to one memory pool of
(potentially) many.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/device.h  |   2 +-
 include/linux/swiotlb.h |  45 +++++++----
 kernel/dma/swiotlb.c    | 175 +++++++++++++++++++++++++---------------
 3 files changed, 140 insertions(+), 82 deletions(-)

diff --git a/include/linux/device.h b/include/linux/device.h
index bbaeabd04b0d..d9754a68ba95 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -625,7 +625,7 @@ struct device_physical_location {
  * @dma_pools:	Dma pools (if dma'ble device).
  * @dma_mem:	Internal for coherent mem override.
  * @cma_area:	Contiguous memory area for dma allocations
- * @dma_io_tlb_mem: Pointer to the swiotlb pool used.  Not for driver use.
+ * @dma_io_tlb_mem: Software IO TLB allocator.  Not for driver use.
  * @archdata:	For arch-specific additions.
  * @of_node:	Associated device tree node.
  * @fwnode:	Associated device node supplied by platform firmware.
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index b122ad90660d..fd01a0870b38 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -62,8 +62,7 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t phys,
 #ifdef CONFIG_SWIOTLB
 
 /**
- * struct io_tlb_mem - IO TLB Memory Pool Descriptor
- *
+ * struct io_tlb_pool - IO TLB memory pool descriptor
  * @start:	The start address of the swiotlb memory pool. Used to do a quick
  *		range check to see if the memory was in fact allocated by this
  *		API.
@@ -73,15 +72,34 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t phys,
  * @vaddr:	The vaddr of the swiotlb memory pool. The swiotlb memory pool
  *		may be remapped in the memory encrypted case and store virtual
  *		address for bounce buffer operation.
- * @nslabs:	The number of IO TLB blocks (in groups of 64) between @start and
- *		@end. For default swiotlb, this is command line adjustable via
- *		setup_io_tlb_npages.
+ * @nslabs:	The number of IO TLB slots between @start and @end. For the
+ *		default swiotlb, this can be adjusted with a boot parameter,
+ *		see setup_io_tlb_npages().
+ * @late_alloc:	%true if allocated using the page allocator.
+ * @nareas:	Number of areas in the pool.
+ * @area_nslabs: Number of slots in each area.
+ * @areas:	Array of memory area descriptors.
+ * @slots:	Array of slot descriptors.
+ */
+struct io_tlb_pool {
+	phys_addr_t start;
+	phys_addr_t end;
+	void *vaddr;
+	unsigned long nslabs;
+	bool late_alloc;
+	unsigned int nareas;
+	unsigned int area_nslabs;
+	struct io_tlb_area *areas;
+	struct io_tlb_slot *slots;
+};
+
+/**
+ * struct io_tlb_mem - Software IO TLB allocator
+ * @defpool:	Default (initial) IO TLB memory pool descriptor.
+ * @nslabs:	Total number of IO TLB slabs in all pools.
  * @debugfs:	The dentry to debugfs.
- * @late_alloc:	%true if allocated using the page allocator
  * @force_bounce: %true if swiotlb bouncing is forced
  * @for_alloc:  %true if the pool is used for memory allocation
- * @nareas:  The area number in the pool.
- * @area_nslabs: The slot number in the area.
  * @total_used:	The total number of slots in the pool that are currently used
  *		across all areas. Used only for calculating used_hiwater in
  *		debugfs.
@@ -89,18 +107,11 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t phys,
  *		in debugfs.
  */
 struct io_tlb_mem {
-	phys_addr_t start;
-	phys_addr_t end;
-	void *vaddr;
+	struct io_tlb_pool defpool;
 	unsigned long nslabs;
 	struct dentry *debugfs;
-	bool late_alloc;
 	bool force_bounce;
 	bool for_alloc;
-	unsigned int nareas;
-	unsigned int area_nslabs;
-	struct io_tlb_area *areas;
-	struct io_tlb_slot *slots;
 #ifdef CONFIG_DEBUG_FS
 	atomic_long_t total_used;
 	atomic_long_t used_hiwater;
@@ -122,7 +133,7 @@ static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
 
-	return mem && paddr >= mem->start && paddr < mem->end;
+	return mem && paddr >= mem->defpool.start && paddr < mem->defpool.end;
 }
 
 static inline bool is_swiotlb_force_bounce(struct device *dev)
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 7eafb8ceb577..11bacde00df7 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -209,7 +209,7 @@ void __init swiotlb_adjust_size(unsigned long size)
 
 void swiotlb_print_info(void)
 {
-	struct io_tlb_mem *mem = &io_tlb_default_mem;
+	struct io_tlb_pool *mem = &io_tlb_default_mem.defpool;
 
 	if (!mem->nslabs) {
 		pr_warn("No low mem\n");
@@ -238,7 +238,7 @@ static inline unsigned long nr_slots(u64 val)
  */
 void __init swiotlb_update_mem_attributes(void)
 {
-	struct io_tlb_mem *mem = &io_tlb_default_mem;
+	struct io_tlb_pool *mem = &io_tlb_default_mem.defpool;
 	unsigned long bytes;
 
 	if (!mem->nslabs || mem->late_alloc)
@@ -247,9 +247,8 @@ void __init swiotlb_update_mem_attributes(void)
 	set_memory_decrypted((unsigned long)mem->vaddr, bytes >> PAGE_SHIFT);
 }
 
-static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,
-		unsigned long nslabs, unsigned int flags,
-		bool late_alloc, unsigned int nareas)
+static void swiotlb_init_io_tlb_pool(struct io_tlb_pool *mem, phys_addr_t start,
+		unsigned long nslabs, bool late_alloc, unsigned int nareas)
 {
 	void *vaddr = phys_to_virt(start);
 	unsigned long bytes = nslabs << IO_TLB_SHIFT, i;
@@ -261,8 +260,6 @@ static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,
 	mem->nareas = nareas;
 	mem->area_nslabs = nslabs / mem->nareas;
 
-	mem->force_bounce = swiotlb_force_bounce || (flags & SWIOTLB_FORCE);
-
 	for (i = 0; i < mem->nareas; i++) {
 		spin_lock_init(&mem->areas[i].lock);
 		mem->areas[i].index = 0;
@@ -319,7 +316,7 @@ static void __init *swiotlb_memblock_alloc(unsigned long nslabs,
 void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 		int (*remap)(void *tlb, unsigned long nslabs))
 {
-	struct io_tlb_mem *mem = &io_tlb_default_mem;
+	struct io_tlb_pool *mem = &io_tlb_default_mem.defpool;
 	unsigned long nslabs;
 	unsigned int nareas;
 	size_t alloc_size;
@@ -330,6 +327,9 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 	if (swiotlb_force_disable)
 		return;
 
+	io_tlb_default_mem.force_bounce =
+		swiotlb_force_bounce || (flags & SWIOTLB_FORCE);
+
 	if (!default_nareas)
 		swiotlb_adjust_nareas(num_possible_cpus());
 
@@ -363,8 +363,9 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 		return;
 	}
 
-	swiotlb_init_io_tlb_mem(mem, __pa(tlb), nslabs, flags, false,
-				default_nareas);
+	swiotlb_init_io_tlb_pool(mem, __pa(tlb), nslabs, false,
+				 default_nareas);
+	io_tlb_default_mem.nslabs = nslabs;
 
 	if (flags & SWIOTLB_VERBOSE)
 		swiotlb_print_info();
@@ -383,7 +384,7 @@ void __init swiotlb_init(bool addressing_limit, unsigned int flags)
 int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 		int (*remap)(void *tlb, unsigned long nslabs))
 {
-	struct io_tlb_mem *mem = &io_tlb_default_mem;
+	struct io_tlb_pool *mem = &io_tlb_default_mem.defpool;
 	unsigned long nslabs = ALIGN(size >> IO_TLB_SHIFT, IO_TLB_SEGSIZE);
 	unsigned int nareas;
 	unsigned char *vstart = NULL;
@@ -397,6 +398,8 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 	if (swiotlb_force_disable)
 		return 0;
 
+	io_tlb_default_mem.force_bounce = swiotlb_force_bounce;
+
 	if (!default_nareas)
 		swiotlb_adjust_nareas(num_possible_cpus());
 
@@ -448,8 +451,9 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 
 	set_memory_decrypted((unsigned long)vstart,
 			     (nslabs << IO_TLB_SHIFT) >> PAGE_SHIFT);
-	swiotlb_init_io_tlb_mem(mem, virt_to_phys(vstart), nslabs, 0, true,
-				nareas);
+	swiotlb_init_io_tlb_pool(mem, virt_to_phys(vstart), nslabs, true,
+				 nareas);
+	io_tlb_default_mem.nslabs = nslabs;
 
 	swiotlb_print_info();
 	return 0;
@@ -463,7 +467,7 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 
 void __init swiotlb_exit(void)
 {
-	struct io_tlb_mem *mem = &io_tlb_default_mem;
+	struct io_tlb_pool *mem = &io_tlb_default_mem.defpool;
 	unsigned long tbl_vaddr;
 	size_t tbl_size, slots_size;
 	unsigned int area_order;
@@ -519,7 +523,7 @@ static unsigned int swiotlb_align_offset(struct device *dev, u64 addr)
 static void swiotlb_bounce(struct device *dev, phys_addr_t tlb_addr, size_t size,
 			   enum dma_data_direction dir)
 {
-	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
+	struct io_tlb_pool *mem = &dev->dma_io_tlb_mem->defpool;
 	int index = (tlb_addr - mem->start) >> IO_TLB_SHIFT;
 	phys_addr_t orig_addr = mem->slots[index].orig_addr;
 	size_t alloc_size = mem->slots[index].alloc_size;
@@ -601,7 +605,7 @@ static inline unsigned long get_max_slots(unsigned long boundary_mask)
 	return nr_slots(boundary_mask + 1);
 }
 
-static unsigned int wrap_area_index(struct io_tlb_mem *mem, unsigned int index)
+static unsigned int wrap_area_index(struct io_tlb_pool *mem, unsigned int index)
 {
 	if (index >= mem->area_nslabs)
 		return 0;
@@ -645,6 +649,7 @@ static void dec_used(struct io_tlb_mem *mem, unsigned int nslots)
 /**
  * swiotlb_area_find_slots() - search for slots in one IO TLB memory area
  * @dev:	Device which maps the buffer.
+ * @pool:	Memory pool to be searched.
  * @area_index:	Index of the IO TLB memory area to be searched.
  * @orig_addr:	Original (non-bounced) IO buffer address.
  * @alloc_size: Total requested size of the bounce buffer,
@@ -657,15 +662,14 @@ static void dec_used(struct io_tlb_mem *mem, unsigned int nslots)
  *
  * Return: Index of the first allocated slot, or -1 on error.
  */
-static int swiotlb_area_find_slots(struct device *dev, int area_index,
-		phys_addr_t orig_addr, size_t alloc_size,
+static int swiotlb_area_find_slots(struct device *dev, struct io_tlb_pool *pool,
+		int area_index, phys_addr_t orig_addr, size_t alloc_size,
 		unsigned int alloc_align_mask)
 {
-	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
-	struct io_tlb_area *area = mem->areas + area_index;
+	struct io_tlb_area *area = pool->areas + area_index;
 	unsigned long boundary_mask = dma_get_seg_boundary(dev);
 	dma_addr_t tbl_dma_addr =
-		phys_to_dma_unencrypted(dev, mem->start) & boundary_mask;
+		phys_to_dma_unencrypted(dev, pool->start) & boundary_mask;
 	unsigned long max_slots = get_max_slots(boundary_mask);
 	unsigned int iotlb_align_mask =
 		dma_get_min_align_mask(dev) | alloc_align_mask;
@@ -677,7 +681,7 @@ static int swiotlb_area_find_slots(struct device *dev, int area_index,
 	unsigned int slot_index;
 
 	BUG_ON(!nslots);
-	BUG_ON(area_index >= mem->nareas);
+	BUG_ON(area_index >= pool->nareas);
 
 	/*
 	 * For allocations of PAGE_SIZE or larger only look for page aligned
@@ -694,19 +698,19 @@ static int swiotlb_area_find_slots(struct device *dev, int area_index,
 	stride = (iotlb_align_mask >> IO_TLB_SHIFT) + 1;
 
 	spin_lock_irqsave(&area->lock, flags);
-	if (unlikely(nslots > mem->area_nslabs - area->used))
+	if (unlikely(nslots > pool->area_nslabs - area->used))
 		goto not_found;
 
-	slot_base = area_index * mem->area_nslabs;
+	slot_base = area_index * pool->area_nslabs;
 	index = area->index;
 
-	for (slots_checked = 0; slots_checked < mem->area_nslabs; ) {
+	for (slots_checked = 0; slots_checked < pool->area_nslabs; ) {
 		slot_index = slot_base + index;
 
 		if (orig_addr &&
 		    (slot_addr(tbl_dma_addr, slot_index) &
 		     iotlb_align_mask) != (orig_addr & iotlb_align_mask)) {
-			index = wrap_area_index(mem, index + 1);
+			index = wrap_area_index(pool, index + 1);
 			slots_checked++;
 			continue;
 		}
@@ -719,10 +723,10 @@ static int swiotlb_area_find_slots(struct device *dev, int area_index,
 		if (!iommu_is_span_boundary(slot_index, nslots,
 					    nr_slots(tbl_dma_addr),
 					    max_slots)) {
-			if (mem->slots[slot_index].list >= nslots)
+			if (pool->slots[slot_index].list >= nslots)
 				goto found;
 		}
-		index = wrap_area_index(mem, index + stride);
+		index = wrap_area_index(pool, index + stride);
 		slots_checked += stride;
 	}
 
@@ -732,58 +736,79 @@ static int swiotlb_area_find_slots(struct device *dev, int area_index,
 
 found:
 	for (i = slot_index; i < slot_index + nslots; i++) {
-		mem->slots[i].list = 0;
-		mem->slots[i].alloc_size = alloc_size - (offset +
+		pool->slots[i].list = 0;
+		pool->slots[i].alloc_size = alloc_size - (offset +
 				((i - slot_index) << IO_TLB_SHIFT));
 	}
 	for (i = slot_index - 1;
 	     io_tlb_offset(i) != IO_TLB_SEGSIZE - 1 &&
-	     mem->slots[i].list; i--)
-		mem->slots[i].list = ++count;
+	     pool->slots[i].list; i--)
+		pool->slots[i].list = ++count;
 
 	/*
 	 * Update the indices to avoid searching in the next round.
 	 */
-	area->index = wrap_area_index(mem, index + nslots);
+	area->index = wrap_area_index(pool, index + nslots);
 	area->used += nslots;
 	spin_unlock_irqrestore(&area->lock, flags);
 
-	inc_used_and_hiwater(mem, nslots);
+	inc_used_and_hiwater(dev->dma_io_tlb_mem, nslots);
 	return slot_index;
 }
 
 /**
- * swiotlb_find_slots() - search for slots in the whole swiotlb
+ * swiotlb_pool_find_slots() - search for slots in one memory pool
  * @dev:	Device which maps the buffer.
+ * @pool:	Memory pool to be searched.
  * @orig_addr:	Original (non-bounced) IO buffer address.
  * @alloc_size: Total requested size of the bounce buffer,
  *		including initial alignment padding.
  * @alloc_align_mask:	Required alignment of the allocated buffer.
  *
- * Search through the whole software IO TLB to find a sequence of slots that
- * match the allocation constraints.
+ * Search through one memory pool to find a sequence of slots that match the
+ * allocation constraints.
  *
  * Return: Index of the first allocated slot, or -1 on error.
  */
-static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
-		size_t alloc_size, unsigned int alloc_align_mask)
+static int swiotlb_pool_find_slots(struct device *dev, struct io_tlb_pool *pool,
+		phys_addr_t orig_addr, size_t alloc_size,
+		unsigned int alloc_align_mask)
 {
-	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
-	int start = raw_smp_processor_id() & (mem->nareas - 1);
+	int start = raw_smp_processor_id() & (pool->nareas - 1);
 	int i = start, index;
 
 	do {
-		index = swiotlb_area_find_slots(dev, i, orig_addr, alloc_size,
-						alloc_align_mask);
+		index = swiotlb_area_find_slots(dev, pool, i, orig_addr,
+						alloc_size, alloc_align_mask);
 		if (index >= 0)
 			return index;
-		if (++i >= mem->nareas)
+		if (++i >= pool->nareas)
 			i = 0;
 	} while (i != start);
 
 	return -1;
 }
 
+/**
+ * swiotlb_find_slots() - search for slots in the whole swiotlb
+ * @dev:	Device which maps the buffer.
+ * @orig_addr:	Original (non-bounced) IO buffer address.
+ * @alloc_size: Total requested size of the bounce buffer,
+ *		including initial alignment padding.
+ * @alloc_align_mask:	Required alignment of the allocated buffer.
+ *
+ * Search through the whole software IO TLB to find a sequence of slots that
+ * match the allocation constraints.
+ *
+ * Return: Index of the first allocated slot, or -1 on error.
+ */
+static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
+		size_t alloc_size, unsigned int alloc_align_mask)
+{
+	return swiotlb_pool_find_slots(dev, &dev->dma_io_tlb_mem->defpool,
+				       orig_addr, alloc_size, alloc_align_mask);
+}
+
 #ifdef CONFIG_DEBUG_FS
 
 /**
@@ -802,6 +827,24 @@ static unsigned long mem_used(struct io_tlb_mem *mem)
 
 #else /* !CONFIG_DEBUG_FS */
 
+/**
+ * mem_pool_used() - get number of used slots in a memory pool
+ * @pool:	Software IO TLB memory pool.
+ *
+ * The result is not accurate, see mem_used().
+ *
+ * Return: Approximate number of used slots.
+ */
+static unsigned long mem_pool_used(struct io_tlb_pool *pool)
+{
+	int i;
+	unsigned long used = 0;
+
+	for (i = 0; i < pool->nareas; i++)
+		used += pool->areas[i].used;
+	return used;
+}
+
 /**
  * mem_used() - get number of used slots in an allocator
  * @mem:	Software IO TLB allocator.
@@ -813,12 +856,7 @@ static unsigned long mem_used(struct io_tlb_mem *mem)
  */
 static unsigned long mem_used(struct io_tlb_mem *mem)
 {
-	int i;
-	unsigned long used = 0;
-
-	for (i = 0; i < mem->nareas; i++)
-		used += mem->areas[i].used;
-	return used;
+	return mem_pool_used(&mem->defpool);
 }
 
 #endif /* CONFIG_DEBUG_FS */
@@ -830,6 +868,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
 	unsigned int offset = swiotlb_align_offset(dev, orig_addr);
+	struct io_tlb_pool *pool;
 	unsigned int i;
 	int index;
 	phys_addr_t tlb_addr;
@@ -864,9 +903,10 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
 	 * This is needed when we sync the memory.  Then we sync the buffer if
 	 * needed.
 	 */
+	pool = &mem->defpool;
 	for (i = 0; i < nr_slots(alloc_size + offset); i++)
-		mem->slots[index + i].orig_addr = slot_addr(orig_addr, i);
-	tlb_addr = slot_addr(mem->start, index) + offset;
+		pool->slots[index + i].orig_addr = slot_addr(orig_addr, i);
+	tlb_addr = slot_addr(pool->start, index) + offset;
 	/*
 	 * When dir == DMA_FROM_DEVICE we could omit the copy from the orig
 	 * to the tlb buffer, if we knew for sure the device will
@@ -880,7 +920,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
 
 static void swiotlb_release_slots(struct device *dev, phys_addr_t tlb_addr)
 {
-	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
+	struct io_tlb_pool *mem = &dev->dma_io_tlb_mem->defpool;
 	unsigned long flags;
 	unsigned int offset = swiotlb_align_offset(dev, tlb_addr);
 	int index = (tlb_addr - offset - mem->start) >> IO_TLB_SHIFT;
@@ -924,7 +964,7 @@ static void swiotlb_release_slots(struct device *dev, phys_addr_t tlb_addr)
 	area->used -= nslots;
 	spin_unlock_irqrestore(&area->lock, flags);
 
-	dec_used(mem, nslots);
+	dec_used(dev->dma_io_tlb_mem, nslots);
 }
 
 /*
@@ -1026,7 +1066,7 @@ EXPORT_SYMBOL_GPL(is_swiotlb_active);
  */
 phys_addr_t default_swiotlb_base(void)
 {
-	return io_tlb_default_mem.start;
+	return io_tlb_default_mem.defpool.start;
 }
 
 /**
@@ -1036,7 +1076,7 @@ phys_addr_t default_swiotlb_base(void)
  */
 phys_addr_t default_swiotlb_limit(void)
 {
-	return io_tlb_default_mem.end - 1;
+	return io_tlb_default_mem.defpool.end - 1;
 }
 
 #ifdef CONFIG_DEBUG_FS
@@ -1112,6 +1152,7 @@ static inline void swiotlb_create_debugfs_files(struct io_tlb_mem *mem,
 struct page *swiotlb_alloc(struct device *dev, size_t size)
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
+	struct io_tlb_pool *pool;
 	phys_addr_t tlb_addr;
 	int index;
 
@@ -1122,7 +1163,8 @@ struct page *swiotlb_alloc(struct device *dev, size_t size)
 	if (index == -1)
 		return NULL;
 
-	tlb_addr = slot_addr(mem->start, index);
+	pool = &mem->defpool;
+	tlb_addr = slot_addr(pool->start, index);
 
 	return pfn_to_page(PFN_DOWN(tlb_addr));
 }
@@ -1159,29 +1201,34 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem,
 	 * to it.
 	 */
 	if (!mem) {
+		struct io_tlb_pool *pool;
+
 		mem = kzalloc(sizeof(*mem), GFP_KERNEL);
 		if (!mem)
 			return -ENOMEM;
+		pool = &mem->defpool;
 
-		mem->slots = kcalloc(nslabs, sizeof(*mem->slots), GFP_KERNEL);
-		if (!mem->slots) {
+		pool->slots = kcalloc(nslabs, sizeof(*pool->slots), GFP_KERNEL);
+		if (!pool->slots) {
 			kfree(mem);
 			return -ENOMEM;
 		}
 
-		mem->areas = kcalloc(nareas, sizeof(*mem->areas),
+		pool->areas = kcalloc(nareas, sizeof(*pool->areas),
 				GFP_KERNEL);
-		if (!mem->areas) {
-			kfree(mem->slots);
+		if (!pool->areas) {
+			kfree(pool->slots);
 			kfree(mem);
 			return -ENOMEM;
 		}
 
 		set_memory_decrypted((unsigned long)phys_to_virt(rmem->base),
 				     rmem->size >> PAGE_SHIFT);
-		swiotlb_init_io_tlb_mem(mem, rmem->base, nslabs, SWIOTLB_FORCE,
-					false, nareas);
+		swiotlb_init_io_tlb_pool(pool, rmem->base, nslabs,
+					 false, nareas);
+		mem->force_bounce = true;
 		mem->for_alloc = true;
+		mem->nslabs = nslabs;
 
 		rmem->priv = mem;
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:17:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:17:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568862.888937 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuV8-0003Iz-69; Mon, 24 Jul 2023 12:17:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568862.888937; Mon, 24 Jul 2023 12:17:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuV8-0003IV-1j; Mon, 24 Jul 2023 12:17:22 +0000
Received: by outflank-mailman (input) for mailman id 568862;
 Mon, 24 Jul 2023 12:17:20 +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
 <SRS0=0CZD=DK=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qNuSG-0007hM-TN
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:14:24 +0000
Received: from frasgout12.his.huawei.com (unknown [14.137.139.154])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9ec9b8bc-2a1b-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:14:21 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.229])
 by frasgout12.his.huawei.com (SkyGuard) with ESMTP id 4R8dzR2TV1z9yMys
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 20:01:07 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.222.124])
 by APP2 (Coremail) with SMTP id GxC2BwA3_lTGar5ky0byBA--.27936S5;
 Mon, 24 Jul 2023 13:13:53 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9ec9b8bc-2a1b-11ee-8612-37d641c3527e
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v5 3/9] swiotlb: add documentation and rename swiotlb_do_find_slots()
Date: Mon, 24 Jul 2023 14:12:39 +0200
Message-Id: <d6e3a7f1a99724bd925ca11e890a17f3272aa7b5.1690200598.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
References: <cover.1690200598.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2BwA3_lTGar5ky0byBA--.27936S5
X-Coremail-Antispam: 1UD129KBjvJXoW3GrWfGF4UuFy8tF1xZF1kKrg_yoW7ur4rpF
	4rtFn8tFs8Jr1xC39Fkw48uF1S9w4kK347uFWavryF9rnrJr9agFyktrWYqFWrXF4xCF4U
	Ja4avr48Gr13Xr7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDU0xBIdaVrnRJUUUmq14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0
	rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JrWl82xGYIkIc2
	x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0
	Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw
	A2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr0_Cr1U
	M2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjx
	v20xvE14v26r106r15McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1l
	F7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8cxan2
	IY04v7MxkF7I0Ew4C26cxK6c8Ij28IcwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkE
	bVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67
	AF67kF1VAFwI0_Wrv_Gr1UMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4l
	IxAIcVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r
	1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJbIY
	CTnIWIevJa73UjIFyTuYvjfUnPEfUUUUU
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

Add some kernel-doc comments and move the existing documentation of struct
io_tlb_slot to its correct location. The latter was forgotten in commit
942a8186eb445 ("swiotlb: move struct io_tlb_slot to swiotlb.c").

Use the opportunity to give swiotlb_do_find_slots() a more descriptive name
and make it clear how it differs from swiotlb_find_slots().

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/swiotlb.h | 15 +++++++---
 kernel/dma/swiotlb.c    | 61 +++++++++++++++++++++++++++++++++++++----
 2 files changed, 66 insertions(+), 10 deletions(-)

diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 3b372364a144..b122ad90660d 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -76,10 +76,6 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t phys,
  * @nslabs:	The number of IO TLB blocks (in groups of 64) between @start and
  *		@end. For default swiotlb, this is command line adjustable via
  *		setup_io_tlb_npages.
- * @list:	The free list describing the number of free entries available
- *		from each index.
- * @orig_addr:	The original address corresponding to a mapped entry.
- * @alloc_size:	Size of the allocated buffer.
  * @debugfs:	The dentry to debugfs.
  * @late_alloc:	%true if allocated using the page allocator
  * @force_bounce: %true if swiotlb bouncing is forced
@@ -111,6 +107,17 @@ struct io_tlb_mem {
 #endif
 };
 
+/**
+ * is_swiotlb_buffer() - check if a physical address belongs to a swiotlb
+ * @dev:        Device which has mapped the buffer.
+ * @paddr:      Physical address within the DMA buffer.
+ *
+ * Check if @paddr points into a bounce buffer.
+ *
+ * Return:
+ * * %true if @paddr points into a bounce buffer
+ * * %false otherwise
+ */
 static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 6734ef7b9d8d..7eafb8ceb577 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -62,6 +62,13 @@
 
 #define INVALID_PHYS_ADDR (~(phys_addr_t)0)
 
+/**
+ * struct io_tlb_slot - IO TLB slot descriptor
+ * @orig_addr:	The original address corresponding to a mapped entry.
+ * @alloc_size:	Size of the allocated buffer.
+ * @list:	The free list describing the number of free entries available
+ *		from each index.
+ */
 struct io_tlb_slot {
 	phys_addr_t orig_addr;
 	size_t alloc_size;
@@ -635,11 +642,22 @@ static void dec_used(struct io_tlb_mem *mem, unsigned int nslots)
 }
 #endif /* CONFIG_DEBUG_FS */
 
-/*
- * Find a suitable number of IO TLB entries size that will fit this request and
- * allocate a buffer from that IO TLB pool.
+/**
+ * swiotlb_area_find_slots() - search for slots in one IO TLB memory area
+ * @dev:	Device which maps the buffer.
+ * @area_index:	Index of the IO TLB memory area to be searched.
+ * @orig_addr:	Original (non-bounced) IO buffer address.
+ * @alloc_size: Total requested size of the bounce buffer,
+ *		including initial alignment padding.
+ * @alloc_align_mask:	Required alignment of the allocated buffer.
+ *
+ * Find a suitable sequence of IO TLB entries for the request and allocate
+ * a buffer from the given IO TLB memory area.
+ * This function takes care of locking.
+ *
+ * Return: Index of the first allocated slot, or -1 on error.
  */
-static int swiotlb_do_find_slots(struct device *dev, int area_index,
+static int swiotlb_area_find_slots(struct device *dev, int area_index,
 		phys_addr_t orig_addr, size_t alloc_size,
 		unsigned int alloc_align_mask)
 {
@@ -734,6 +752,19 @@ static int swiotlb_do_find_slots(struct device *dev, int area_index,
 	return slot_index;
 }
 
+/**
+ * swiotlb_find_slots() - search for slots in the whole swiotlb
+ * @dev:	Device which maps the buffer.
+ * @orig_addr:	Original (non-bounced) IO buffer address.
+ * @alloc_size: Total requested size of the bounce buffer,
+ *		including initial alignment padding.
+ * @alloc_align_mask:	Required alignment of the allocated buffer.
+ *
+ * Search through the whole software IO TLB to find a sequence of slots that
+ * match the allocation constraints.
+ *
+ * Return: Index of the first allocated slot, or -1 on error.
+ */
 static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
 		size_t alloc_size, unsigned int alloc_align_mask)
 {
@@ -742,8 +773,8 @@ static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
 	int i = start, index;
 
 	do {
-		index = swiotlb_do_find_slots(dev, i, orig_addr, alloc_size,
-					      alloc_align_mask);
+		index = swiotlb_area_find_slots(dev, i, orig_addr, alloc_size,
+						alloc_align_mask);
 		if (index >= 0)
 			return index;
 		if (++i >= mem->nareas)
@@ -755,6 +786,15 @@ static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
 
 #ifdef CONFIG_DEBUG_FS
 
+/**
+ * mem_used() - get number of used slots in an allocator
+ * @mem:	Software IO TLB allocator.
+ *
+ * The result is accurate in this version of the function, because an atomic
+ * counter is available if CONFIG_DEBUG_FS is set.
+ *
+ * Return: Number of used slots.
+ */
 static unsigned long mem_used(struct io_tlb_mem *mem)
 {
 	return atomic_long_read(&mem->total_used);
@@ -762,6 +802,15 @@ static unsigned long mem_used(struct io_tlb_mem *mem)
 
 #else /* !CONFIG_DEBUG_FS */
 
+/**
+ * mem_used() - get number of used slots in an allocator
+ * @mem:	Software IO TLB allocator.
+ *
+ * The result is not accurate, because there is no locking of individual
+ * areas.
+ *
+ * Return: Approximate number of used slots.
+ */
 static unsigned long mem_used(struct io_tlb_mem *mem)
 {
 	int i;
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:17:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:17:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568884.888964 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuVa-0004os-0V; Mon, 24 Jul 2023 12:17:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568884.888964; Mon, 24 Jul 2023 12:17:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuVZ-0004ol-Rw; Mon, 24 Jul 2023 12:17:49 +0000
Received: by outflank-mailman (input) for mailman id 568884;
 Mon, 24 Jul 2023 12:17:48 +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
 <SRS0=xOfu=DK=kernel.org=jlayton@srs-se1.protection.inumbo.net>)
 id 1qNuVY-00049U-KR
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:17:48 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 18af089d-2a1c-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:17:46 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 21BA160F6A;
 Mon, 24 Jul 2023 12:17:45 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE84DC433C7;
 Mon, 24 Jul 2023 12:17:40 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 18af089d-2a1c-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690201064;
	bh=QrEpSq7cPtZ3cWIhHPElPK38cx6jwtPbdBU+j7U7fKM=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References:From;
	b=lFo5/uyfnIZhAXSNnfYH/zs0wLPvsdGmMHFPu1gPwZUyuOP10nfFnm2e23E9mVHox
	 RPTdsfQNauiU49m1hBahLSzV9+gtG/J7umAiMCAj2AameE5Kr8rrBCOJ9W6HPjIMkc
	 lBp1NfEAIBufJmTKwy4+ZdRStOdLezK2HhFQXgRbYXDnNec/zH0oZOEiZUwOk3URR0
	 CwbOA3I9uES6cdgV2JXRUz8O/MvIwDzgSFlH2Jg5PAfwuqtmwK87bHc16vNtVYlbJG
	 hfzmJLudml4J90E2WDeTwJcjuLZaZewiSQ45z8+KBeEkpGI5axaDFLzZmilBUDvalQ
	 cGU58i/dTyQGA==
Message-ID: <01e8445d033314b6d9cd67bece74ca1c3ce89945.camel@kernel.org>
Subject: Re: [PATCH v2 34/47] nfsd: dynamically allocate the nfsd-client
 shrinker
From: Jeff Layton <jlayton@kernel.org>
To: Qi Zheng <zhengqi.arch@bytedance.com>, akpm@linux-foundation.org, 
 david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz, roman.gushchin@linux.dev,
  djwong@kernel.org, brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu, 
 steven.price@arm.com, cel@kernel.org, senozhatsky@chromium.org, 
 yujie.liu@intel.com, gregkh@linuxfoundation.org, muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, 
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org, 
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net, 
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org, 
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
  dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, 
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,  virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,  linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,  linux-btrfs@vger.kernel.org, Chuck Lever
 <chuck.lever@oracle.com>
Date: Mon, 24 Jul 2023 08:17:39 -0400
In-Reply-To: <20230724094354.90817-35-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
	 <20230724094354.90817-35-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Mon, 2023-07-24 at 17:43 +0800, Qi Zheng wrote:
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the nfsd-client shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct nfsd_net.
>=20
> Acked-by: Chuck Lever <chuck.lever@oracle.com>
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> ---
>  fs/nfsd/netns.h     |  2 +-
>  fs/nfsd/nfs4state.c | 20 ++++++++++++--------
>  2 files changed, 13 insertions(+), 9 deletions(-)
>=20
> diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h
> index ec49b200b797..f669444d5336 100644
> --- a/fs/nfsd/netns.h
> +++ b/fs/nfsd/netns.h
> @@ -195,7 +195,7 @@ struct nfsd_net {
>  	int			nfs4_max_clients;
> =20
>  	atomic_t		nfsd_courtesy_clients;
> -	struct shrinker		nfsd_client_shrinker;
> +	struct shrinker		*nfsd_client_shrinker;
>  	struct work_struct	nfsd_shrinker_work;
>  };
> =20
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 3339177f8e2f..c7a4616cd866 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -4388,8 +4388,7 @@ static unsigned long
>  nfsd4_state_shrinker_count(struct shrinker *shrink, struct shrink_contro=
l *sc)
>  {
>  	int count;
> -	struct nfsd_net *nn =3D container_of(shrink,
> -			struct nfsd_net, nfsd_client_shrinker);
> +	struct nfsd_net *nn =3D shrink->private_data;
> =20
>  	count =3D atomic_read(&nn->nfsd_courtesy_clients);
>  	if (!count)
> @@ -8125,12 +8124,17 @@ static int nfs4_state_create_net(struct net *net)
>  	INIT_WORK(&nn->nfsd_shrinker_work, nfsd4_state_shrinker_worker);
>  	get_net(net);
> =20
> -	nn->nfsd_client_shrinker.scan_objects =3D nfsd4_state_shrinker_scan;
> -	nn->nfsd_client_shrinker.count_objects =3D nfsd4_state_shrinker_count;
> -	nn->nfsd_client_shrinker.seeks =3D DEFAULT_SEEKS;
> -
> -	if (register_shrinker(&nn->nfsd_client_shrinker, "nfsd-client"))
> +	nn->nfsd_client_shrinker =3D shrinker_alloc(0, "nfsd-client");
> +	if (!nn->nfsd_client_shrinker)
>  		goto err_shrinker;
> +
> +	nn->nfsd_client_shrinker->scan_objects =3D nfsd4_state_shrinker_scan;
> +	nn->nfsd_client_shrinker->count_objects =3D nfsd4_state_shrinker_count;
> +	nn->nfsd_client_shrinker->seeks =3D DEFAULT_SEEKS;
> +	nn->nfsd_client_shrinker->private_data =3D nn;
> +
> +	shrinker_register(nn->nfsd_client_shrinker);
> +
>  	return 0;
> =20
>  err_shrinker:
> @@ -8228,7 +8232,7 @@ nfs4_state_shutdown_net(struct net *net)
>  	struct list_head *pos, *next, reaplist;
>  	struct nfsd_net *nn =3D net_generic(net, nfsd_net_id);
> =20
> -	unregister_shrinker(&nn->nfsd_client_shrinker);
> +	shrinker_unregister(nn->nfsd_client_shrinker);
>  	cancel_work(&nn->nfsd_shrinker_work);
>  	cancel_delayed_work_sync(&nn->laundromat_work);
>  	locks_end_grace(&nn->nfsd4_manager);

Acked-by: Jeff Layton <jlayton@kernel.org>


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:18:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:18:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568885.888973 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuVl-0005AU-6l; Mon, 24 Jul 2023 12:18:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568885.888973; Mon, 24 Jul 2023 12:18:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuVl-0005AN-3o; Mon, 24 Jul 2023 12:18:01 +0000
Received: by outflank-mailman (input) for mailman id 568885;
 Mon, 24 Jul 2023 12:17:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xOfu=DK=kernel.org=jlayton@srs-se1.protection.inumbo.net>)
 id 1qNuVj-00043i-Lu
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:17:59 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1fc8d549-2a1c-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 14:17:58 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 397746113E;
 Mon, 24 Jul 2023 12:17:57 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7639DC433C7;
 Mon, 24 Jul 2023 12:17:53 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1fc8d549-2a1c-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690201076;
	bh=SgqvEHTSsoLx88OM4JQmZh6whPE6BGZ/uEOL9QxuZhc=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References:From;
	b=HeauOjdE48WDStWMcmbZe0QJCu1PZbrw2jnOfPPp5Y0n0Q1TK60SYgINluh0tVUHu
	 HMa9pGy9YrA2Xid5ZQCkD41aahatrfHq9vVHLjbuzLzQBP/bIUW5s/kQBvStLkPbEr
	 52wVvvm4TuW1EIIyQppWxFYEv7SoUq895jOWh1zWA+5Bhuu0CwPKUfnKQ6aPaR+FNu
	 w4bgci3LfqcgT2vztkyr4DzF2/4Hyf1LGlp6Z0shJe1d8GJLzPQbDhc3dh09sCIq3l
	 N9zzfqaN5HsWy8Vmt4P1E7EQFqQrkFrxcJ7/1W6yEYc3GiEERam+zZN0XSQm/ELIIc
	 3urjqaifuO8iw==
Message-ID: <d79d3ef43b3a61be99e53a77fa9eb19af7fc550f.camel@kernel.org>
Subject: Re: [PATCH v2 35/47] nfsd: dynamically allocate the nfsd-reply
 shrinker
From: Jeff Layton <jlayton@kernel.org>
To: Qi Zheng <zhengqi.arch@bytedance.com>, akpm@linux-foundation.org, 
 david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz, roman.gushchin@linux.dev,
  djwong@kernel.org, brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu, 
 steven.price@arm.com, cel@kernel.org, senozhatsky@chromium.org, 
 yujie.liu@intel.com, gregkh@linuxfoundation.org, muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, 
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org, 
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net, 
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org, 
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
  dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, 
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,  virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,  linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,  linux-btrfs@vger.kernel.org, Chuck Lever
 <chuck.lever@oracle.com>
Date: Mon, 24 Jul 2023 08:17:52 -0400
In-Reply-To: <20230724094354.90817-36-zhengqi.arch@bytedance.com>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
	 <20230724094354.90817-36-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Mon, 2023-07-24 at 17:43 +0800, Qi Zheng wrote:
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the nfsd-reply shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct nfsd_net.
>=20
> Acked-by: Chuck Lever <chuck.lever@oracle.com>
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> ---
>  fs/nfsd/netns.h    |  2 +-
>  fs/nfsd/nfscache.c | 31 ++++++++++++++++---------------
>  2 files changed, 17 insertions(+), 16 deletions(-)
>=20
> diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h
> index f669444d5336..ab303a8b77d5 100644
> --- a/fs/nfsd/netns.h
> +++ b/fs/nfsd/netns.h
> @@ -177,7 +177,7 @@ struct nfsd_net {
>  	/* size of cache when we saw the longest hash chain */
>  	unsigned int             longest_chain_cachesize;
> =20
> -	struct shrinker		nfsd_reply_cache_shrinker;
> +	struct shrinker		*nfsd_reply_cache_shrinker;
> =20
>  	/* tracking server-to-server copy mounts */
>  	spinlock_t              nfsd_ssc_lock;
> diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
> index 6eb3d7bdfaf3..9f0ab65e4125 100644
> --- a/fs/nfsd/nfscache.c
> +++ b/fs/nfsd/nfscache.c
> @@ -200,26 +200,29 @@ int nfsd_reply_cache_init(struct nfsd_net *nn)
>  {
>  	unsigned int hashsize;
>  	unsigned int i;
> -	int status =3D 0;
> =20
>  	nn->max_drc_entries =3D nfsd_cache_size_limit();
>  	atomic_set(&nn->num_drc_entries, 0);
>  	hashsize =3D nfsd_hashsize(nn->max_drc_entries);
>  	nn->maskbits =3D ilog2(hashsize);
> =20
> -	nn->nfsd_reply_cache_shrinker.scan_objects =3D nfsd_reply_cache_scan;
> -	nn->nfsd_reply_cache_shrinker.count_objects =3D nfsd_reply_cache_count;
> -	nn->nfsd_reply_cache_shrinker.seeks =3D 1;
> -	status =3D register_shrinker(&nn->nfsd_reply_cache_shrinker,
> -				   "nfsd-reply:%s", nn->nfsd_name);
> -	if (status)
> -		return status;
> -
>  	nn->drc_hashtbl =3D kvzalloc(array_size(hashsize,
>  				sizeof(*nn->drc_hashtbl)), GFP_KERNEL);
>  	if (!nn->drc_hashtbl)
> +		return -ENOMEM;
> +
> +	nn->nfsd_reply_cache_shrinker =3D shrinker_alloc(0, "nfsd-reply:%s",
> +						       nn->nfsd_name);
> +	if (!nn->nfsd_reply_cache_shrinker)
>  		goto out_shrinker;
> =20
> +	nn->nfsd_reply_cache_shrinker->scan_objects =3D nfsd_reply_cache_scan;
> +	nn->nfsd_reply_cache_shrinker->count_objects =3D nfsd_reply_cache_count=
;
> +	nn->nfsd_reply_cache_shrinker->seeks =3D 1;
> +	nn->nfsd_reply_cache_shrinker->private_data =3D nn;
> +
> +	shrinker_register(nn->nfsd_reply_cache_shrinker);
> +
>  	for (i =3D 0; i < hashsize; i++) {
>  		INIT_LIST_HEAD(&nn->drc_hashtbl[i].lru_head);
>  		spin_lock_init(&nn->drc_hashtbl[i].cache_lock);
> @@ -228,7 +231,7 @@ int nfsd_reply_cache_init(struct nfsd_net *nn)
> =20
>  	return 0;
>  out_shrinker:
> -	unregister_shrinker(&nn->nfsd_reply_cache_shrinker);
> +	kvfree(nn->drc_hashtbl);
>  	printk(KERN_ERR "nfsd: failed to allocate reply cache\n");
>  	return -ENOMEM;
>  }
> @@ -238,7 +241,7 @@ void nfsd_reply_cache_shutdown(struct nfsd_net *nn)
>  	struct nfsd_cacherep *rp;
>  	unsigned int i;
> =20
> -	unregister_shrinker(&nn->nfsd_reply_cache_shrinker);
> +	shrinker_unregister(nn->nfsd_reply_cache_shrinker);
> =20
>  	for (i =3D 0; i < nn->drc_hashsize; i++) {
>  		struct list_head *head =3D &nn->drc_hashtbl[i].lru_head;
> @@ -322,8 +325,7 @@ nfsd_prune_bucket_locked(struct nfsd_net *nn, struct =
nfsd_drc_bucket *b,
>  static unsigned long
>  nfsd_reply_cache_count(struct shrinker *shrink, struct shrink_control *s=
c)
>  {
> -	struct nfsd_net *nn =3D container_of(shrink,
> -				struct nfsd_net, nfsd_reply_cache_shrinker);
> +	struct nfsd_net *nn =3D shrink->private_data;
> =20
>  	return atomic_read(&nn->num_drc_entries);
>  }
> @@ -342,8 +344,7 @@ nfsd_reply_cache_count(struct shrinker *shrink, struc=
t shrink_control *sc)
>  static unsigned long
>  nfsd_reply_cache_scan(struct shrinker *shrink, struct shrink_control *sc=
)
>  {
> -	struct nfsd_net *nn =3D container_of(shrink,
> -				struct nfsd_net, nfsd_reply_cache_shrinker);
> +	struct nfsd_net *nn =3D shrink->private_data;
>  	unsigned long freed =3D 0;
>  	LIST_HEAD(dispose);
>  	unsigned int i;

Acked-by: Jeff Layton <jlayton@kernel.org>


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:18:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:18:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568887.888982 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuWO-000602-KE; Mon, 24 Jul 2023 12:18:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568887.888982; Mon, 24 Jul 2023 12:18:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNuWO-0005zt-Hh; Mon, 24 Jul 2023 12:18:40 +0000
Received: by outflank-mailman (input) for mailman id 568887;
 Mon, 24 Jul 2023 12:18:39 +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
 <SRS0=+YiG=DK=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qNuWN-0005sr-JB
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:18:39 +0000
Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com
 [2a00:1450:4864:20::32d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 37728426-2a1c-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:18:37 +0200 (CEST)
Received: by mail-wm1-x32d.google.com with SMTP id
 5b1f17b1804b1-3fbea14706eso33578765e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 05:18:37 -0700 (PDT)
Received: from EMEAENGAAD19049. (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 p15-20020a7bcc8f000000b003fbfef555d2sm12773706wma.23.2023.07.24.05.18.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 05:18:36 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 37728426-2a1c-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690201117; x=1690805917;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=tYZQ4FB+RN4vRq77iIyVxuJsWHDHH83ZPg7RUhTxPHg=;
        b=T0kG+pRnHndzeXyTOWTxmnJRjcaBrolfkcVPRb3339U3dM1WlhWGj7Fy5RC7Q2MmuH
         XRgHDCRByzuUFJWTSgZ7tLWpP2kHNlqkQPKanB9FgwQ/9YiX0qqy3uxOdslJzdgX4fnx
         eCN9PwlQbwu6gXzx3+KcNd7rP3vOadwBp6dRg=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690201117; x=1690805917;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=tYZQ4FB+RN4vRq77iIyVxuJsWHDHH83ZPg7RUhTxPHg=;
        b=VT5TgwwiGG+SqdPJQqfHq7PDsodU8lPKbiN7Kax7kSJQ0fSA/n+wS1/TOpsZzwMEOJ
         p+06fEU084cXkQ5xxBWj4bJGeIOQV6gb2D7vanU/vFzD16qscAjqrnKSYbgRp/gVe8gU
         SsOFEGIeCZcmUX8JuxnWZ2KQfY23VrnnjMz9d/4wDkWe281FRkTOqgClK4nLIidB+gyQ
         IQ1rx+1Kt7XJzP7jqnFlnThKuvjNAhPRbry6NuQ+HZvdeTnpGAUWbVM4OvPkdpNziXRw
         4zy580XNtiF1EeEPLUnVSYYw7qZep+t92XJqYXPBqK55e2s0MrEJGxTjfVkinE/azkZE
         055g==
X-Gm-Message-State: ABy/qLZgVe+IAL3PnUjcI9UmVyZYC4aEqppJz+64IxLMdW6F+h6V6/Qk
	uV9uRW+y5z8SHf9UAY6wSJEc7Q==
X-Google-Smtp-Source: APBJJlH60vqJNPd2I/GwBUqo2Sc1ErpXryoFOKnzSGgYeVHoZrJzf69P36xIWg4/Cxj4jYR3mppd5g==
X-Received: by 2002:a05:600c:240c:b0:3f8:facf:7626 with SMTP id 12-20020a05600c240c00b003f8facf7626mr6933033wmp.20.1690201116915;
        Mon, 24 Jul 2023 05:18:36 -0700 (PDT)
Message-ID: <64be6c1c.7b0a0220.49ba9.0e38@mx.google.com>
X-Google-Original-Message-ID: <ZL5sG254Ryx/E8TJ@EMEAENGAAD19049.>
Date: Mon, 24 Jul 2023 13:18:35 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Julien Grall <julien@xen.org>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH 6/8] mm/pdx: Standardize region validation wrt pdx
 compression
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-7-alejandro.vallejo@cloud.com>
 <1eb58b83-87ee-d738-08b0-948a8b48773a@xen.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1eb58b83-87ee-d738-08b0-948a8b48773a@xen.org>

On Fri, Jul 21, 2023 at 06:05:51PM +0100, Julien Grall wrote:
> Hi Alejandro,
> 
> On 17/07/2023 17:03, Alejandro Vallejo wrote:
> > +bool pdx_is_region_compressible(unsigned long smfn, unsigned long emfn)
> 
> For newer interface, I would rather prefer if we use start + size. It is
> easier to reason (you don't have to wonder whether 'emfn' is inclusive or
> not) and avoid issue in the case you are trying to handle a region right at
> the end of the address space as emfn would be 0 in the non-inclusive case
> (not much a concern for MFNs as the last one should be invalid, but it makes
> harder to reason).
I could agree on this, but every single caller is based on (smfn, emfn),
so it needlessly forces every caller to perform conversions where the
callee can do it just once. That said, I think your point makes sense and
it ought to be done. Probably as as part of a bigger refactor where
(smfn, emfn)-based functions are turned into (base, len) variants.

> 
> > +{
> > +    uint64_t base = smfn << PAGE_SHIFT;
> 
> On Arm32, physical address are up to 40-bit. So you want to cast smfn to
> uint64_t before shifting. That said, it would be best to use pfn_to_paddr()
> and possibly switch to paddr_t for the type.
Ack. I keep forgetting 32 bits is not gone on non-x86 ports :)

> 
> Note that I understand that the rest of the PDX code is using uint64_t. So I
> would be ok if you don't want to switch to paddr_t.
Not for this patch, but I will keep "Turn all u64 maddr variables in
pdx.[ch] into paddr_t" in the back of my head for a rainy day.

> 
> > +    uint64_t len = (emfn - smfn) << PAGE_SHIFT;
> 
> Same here.
Ack.

Thanks,
Alejandro


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:26:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:26:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568890.888992 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNueI-0007cW-DV; Mon, 24 Jul 2023 12:26:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568890.888992; Mon, 24 Jul 2023 12:26:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNueI-0007cP-Aq; Mon, 24 Jul 2023 12:26:50 +0000
Received: by outflank-mailman (input) for mailman id 568890;
 Mon, 24 Jul 2023 12:26:49 +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
 <SRS0=qvSe=DK=infradead.org=peterz@srs-se1.protection.inumbo.net>)
 id 1qNueG-0007cJ-OT
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:26:49 +0000
Received: from casper.infradead.org (casper.infradead.org
 [2001:8b0:10b:1236::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5a224237-2a1d-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:26:46 +0200 (CEST)
Received: from j130084.upc-j.chello.nl ([24.132.130.84]
 helo=noisy.programming.kicks-ass.net)
 by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux))
 id 1qNudM-004Ned-Mr; Mon, 24 Jul 2023 12:25:53 +0000
Received: from hirez.programming.kicks-ass.net
 (hirez.programming.kicks-ass.net [192.168.1.225])
 (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 noisy.programming.kicks-ass.net (Postfix) with ESMTPS id B0440300195;
 Mon, 24 Jul 2023 14:25:49 +0200 (CEST)
Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000)
 id 5C178266885CD; Mon, 24 Jul 2023 14:25:49 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5a224237-2a1d-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version:
	References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=FgtQe2iC/0NBUdTIYwU6FvaIC/2mZu3i/WpphGYT+1k=; b=ZIw/NB6uEo0641+Wq8EzNrbHBV
	rrdS2AkdlanLUW4jtuNV7YJmE8dx65rhuqNN6d+O2A+YB9l53nFIBcRLIER24dz2SZGSbQpUdfRFt
	O+SQB8u46jmJ0V3lkB2dv55l0XkOFJ2vLXAjC15/xKJogcvcsepgRzVe5Zf2VfboPt9BBV/mRWBu/
	r1HeDooSZKO8KrM91YanEuhJbHVgQEIeOAYvY50OE9Oa0XF31R7B/jnZvsmScHku30xY6VnjseHTr
	PXjdkkROSxxW+REohqgqj+xc5EAtZBuKqFbmv/xo9QoVvk4ORWEH1k1N/to1rfbfNrbjLNy69S5M/
	AYY+hq7g==;
Date: Mon, 24 Jul 2023 14:25:49 +0200
From: Peter Zijlstra <peterz@infradead.org>
To: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru,
	vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org,
	brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu,
	steven.price@arm.com, cel@kernel.org, senozhatsky@chromium.org,
	yujie.liu@intel.com, gregkh@linuxfoundation.org,
	muchun.song@linux.dev, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, x86@kernel.org, kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org, linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org, linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org, netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com, linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 03/47] mm: shrinker: add infrastructure for
 dynamically allocating shrinker
Message-ID: <20230724122549.GA3731903@hirez.programming.kicks-ass.net>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-4-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20230724094354.90817-4-zhengqi.arch@bytedance.com>

On Mon, Jul 24, 2023 at 05:43:10PM +0800, Qi Zheng wrote:

> +void shrinker_unregister(struct shrinker *shrinker)
> +{
> +	struct dentry *debugfs_entry;
> +	int debugfs_id;
> +
> +	if (!shrinker || !(shrinker->flags & SHRINKER_REGISTERED))
> +		return;
> +
> +	down_write(&shrinker_rwsem);
> +	list_del(&shrinker->list);
> +	shrinker->flags &= ~SHRINKER_REGISTERED;
> +	if (shrinker->flags & SHRINKER_MEMCG_AWARE)
> +		unregister_memcg_shrinker(shrinker);
> +	debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);
> +	up_write(&shrinker_rwsem);
> +
> +	shrinker_debugfs_remove(debugfs_entry, debugfs_id);

Should there not be an rcu_barrier() right about here?

> +
> +	kfree(shrinker->nr_deferred);
> +	shrinker->nr_deferred = NULL;
> +
> +	kfree(shrinker);
> +}
> +EXPORT_SYMBOL(shrinker_unregister);



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:41:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:41:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568902.889002 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNusO-0001a9-LJ; Mon, 24 Jul 2023 12:41:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568902.889002; Mon, 24 Jul 2023 12:41:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNusO-0001a2-IU; Mon, 24 Jul 2023 12:41:24 +0000
Received: by outflank-mailman (input) for mailman id 568902;
 Mon, 24 Jul 2023 12:41:23 +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 <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNusN-0001Zu-7l
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:41:23 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2044.outbound.protection.outlook.com [40.107.13.44])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4927508b-2a1f-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:40:35 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by GV1PR04MB9087.eurprd04.prod.outlook.com (2603:10a6:150:22::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 12:40:50 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 12:40:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4927508b-2a1f-11ee-8612-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=i4bVXjDc5rPGBdNhLSWV+7Bjk634o5d3MKpVwfl3m/b6WZs3pCEPVhlbBeUcyGvNNzhmXOu14d6aghEXT4P5Fgr+IEAmepDXejbGPo2WPL9abwr2QX9YAxMxc40/WlbAQiP038lVhTgsnQ4w/Lu1h51RzDWGVp1wtuCCHuvAmFAfyVvDFr6v/ccEsMtG5gXGuxjY56VywN0WvfOti7L6ag4EaPzzhQrA9yO+m2IxtOqAFe3U4lNo0C8SBGZa+Zm8TtuFal43nYSu8f21yo+OZNR4FZ5BW43knkUhF9/eQWIvq0PFeRmym2puOB64KbSd/R11ZZPvvSDV6Z+Ah50vqA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=NVOX9FdgZF/IwQDGOJfYw+KizAFkLui8caafB7SZ8Z8=;
 b=XxrCVEJu1p/48P3eXzmBS1YlgNsj2CL2RBdNhgksr5eoe3PfNEfANg7IS11AlJkyxOEXJbbW39nserHz2rHy65b0e3RT+nxMWKwDsbffF15W/WBfL8Wa2KPkziZFTb1c1gE7jxTFGOZvVhxjsKKYeqxwMi8m7zYNGtz5Q3yMuxw/TjzIzYtReVPYPcu+Ba6nuxFX4T6yV+8wBWdQVnXEfo1grfAjM2tbzW6VSQxnpTMlsVwtlgsh6iG1qWt8YDahUluNBgXWy1bEMxXROQzsmGfRLPGevX9S1arRA0hYpEsWj5yYkBvW0BaY57Lrr+p4f2UMQOJdUYQHiwUEYma7xw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=NVOX9FdgZF/IwQDGOJfYw+KizAFkLui8caafB7SZ8Z8=;
 b=uTnaEvYqvnZMGiZxuDzLuuw+ho/mPeC7qDfzRf+f4MvW6seklHRklTQHnzRLdoc7tzetHl86EXkVh0UkCGa9y2YNTYVEuSOOsj0VAK0IOYZYdsFdGQmi8R5jkiMEWtwHlJsMuVDkK+7Si0s4xdHVAOyfRBKWLfeux83I7Ve/wy+qJ8M51Lk79YfSWVZ/gK5Mamuk+KvSzuU8OX0rdMOfHd3jjr+eY1mJBYe6hc7pE2/g6zmOeWhdG+hbyP9WCxkf6kj1e6x3aoVkVDffk27npciK758eeoBgpmbPhF62w5YOp1gm3AHq/Dw2Ohmt8oTgcIxcLtvbVV6hi4Mli7RNbg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <019914c7-c6ca-70b9-6c90-e1891f4201c4@suse.com>
Date: Mon, 24 Jul 2023 14:40:47 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v5 3/4] xen/ppc: Implement early serial printk on pseries
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 xen-devel@lists.xenproject.org
References: <cover.1689958538.git.sanastasio@raptorengineering.com>
 <f326168638ae05f5f387e4fa018ac2ed057bac8c.1689958538.git.sanastasio@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <f326168638ae05f5f387e4fa018ac2ed057bac8c.1689958538.git.sanastasio@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0055.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:49::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|GV1PR04MB9087:EE_
X-MS-Office365-Filtering-Correlation-Id: b06b042d-0ae7-48d7-dcb6-08db8c433621
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	IYRKwqu9NKIKEsnoxM++capR2nOWs7ffI4AjfMpdilZW5j9y4o66A0Uiw9clCDmbfrWPQMi/q01oTyyA6e9nIC5rA9h9VmfRoVB9Lj3abylAPo3u5aY8aloeNQ0WpZdrk8weJ5wVm9YOtuuk+EomtOeM8rzXxX4vjOjqV9oxkIJBuZ827Lpop8BIUMGRMGJFzFXUoKelG1FJacCx7mbEvhlzD3yyOPgfLb3f/yKd+HdBppiAb/35wKxMU1hheCHvkt5Xs8PVIJWOl/PNlNYZRVF607OhJdk4CZYXJ2BiARw2TnUJM+uZioj6e5lo8oZxg4AahO7m1dYaIQioU3etR1J1JyrZsukbt7ZeoujFiQ6yQX7cKIMO/C8d9xqBI6EP71VBMh9eO2MphkUp0B8VspZhmBf5LRyjUIrTANoO6KgkzE7wL49ApKplfsAjNhhsJ51WwpPRJQNz3WV8DbUMO6Bg1VvQWZggEcEumvZ2IhfAshJHFt483+BqPs0gs+ag9bO7aL+DArx0CkFCmKcwPDPEVaDwaxGGn59yu0HXNYYAn2hnHx3J87mtbSN+FLl0qDH/gTuEa9QKfqrnSJDrJOSrR66yS5zE+98fEcinSTC/BJu+x9DcHncVLcsiQ42cvejjkwoWXqJonI+ABuKPmQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(136003)(396003)(346002)(39860400002)(451199021)(478600001)(6486002)(6512007)(6666004)(6916009)(4326008)(316002)(38100700002)(66476007)(66946007)(66556008)(41300700001)(83380400001)(54906003)(31686004)(36756003)(8676002)(8936002)(6506007)(26005)(186003)(5660300002)(31696002)(53546011)(86362001)(2616005)(4744005)(2906002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QWd2OHZndmFmcWFWSm9LOEdIM0hzcW9WNlF0bHMvN2NPS083RVh5YUZuOW5m?=
 =?utf-8?B?UjlRTzVuWUNXek1hOWJLZ1c5MHpMVzJLeWR5aXdNb2x5amtKcGt0UzFzTVMr?=
 =?utf-8?B?WU9PVWd0WngzamE3R2FldDl0S3FhNFU5R3UxNzQvQTlGZGRPTUNScEQ0SSt5?=
 =?utf-8?B?WndPNDkzemhISnFWK0VuSlQwRitZeW1YdlhQREVSQ3I4RGNnMjBYYmVpNWl2?=
 =?utf-8?B?cTdMNCt0M3lkTy8rMkxKb0U4R1lzUkUwMVlOWmF2ajl6WWE5M2VpQk1CdDBS?=
 =?utf-8?B?UnpSb3YweDB6YUsrTExsRlNGRXBURW1YZkFEQlh2dnEzZERtRWxNWWc1WUp5?=
 =?utf-8?B?dlFKTUMwT0lKeXM0RiszNDFCWHlYUUx2aCs3WUtFTExBVkVLWWl2SzJtWHRy?=
 =?utf-8?B?bkdpT1JUdFZFZkJpMjBIS0xqYzJXQ0tmZUl5UFppaE5XRG1tdzZVVktQUXlq?=
 =?utf-8?B?bFE2Y2loN3pyNl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B8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 12:40:50.2995
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: eQboF7La1IlXpdH9Uv2JuQQtWgz5ZbwPruhuvGw/bQlmpQZ2T1OVcL6E5GOwBp7S5++PfVMA4p0rYoyWv6ydDQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB9087

On 21.07.2023 19:02, Shawn Anastasio wrote:
> On typical Power VMs (e.g. QEMU's -M pseries), a variety of services
> including an early serial console are provided by Open Firmware.
> Implement the required interfaces to call into Open Firmware and write
> to the serial console.
> 
> Since Open Firmware runs in 32-bit Big Endian mode and Xen runs in
> 64-bit Little Endian mode, a thunk is required to save/restore
> any potentially-clobbered registers as well as to perform the
> required endianness switch. Thankfully, linux already has such
> a routine, which was imported into ppc64/of-call.S.
> 
> Support for bare metal (PowerNV) will be implemented in a future
> patch.
> 
> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>

While I've committed the earlier two patches, I had to back out this
one. In my environment (gcc13) the build fails due an unresolved
reference to memset() out of boot-of.c (supposedly from of_call()).

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:58:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:58:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568907.889013 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNv99-0003Be-30; Mon, 24 Jul 2023 12:58:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568907.889013; Mon, 24 Jul 2023 12:58:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNv99-0003BX-04; Mon, 24 Jul 2023 12:58:43 +0000
Received: by outflank-mailman (input) for mailman id 568907;
 Mon, 24 Jul 2023 12:58:41 +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
 <SRS0=AOzI=DK=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qNv97-0003BP-MM
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:58:41 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cf4478b5-2a21-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:58:39 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.162.132.135])
 by support.bugseng.com (Postfix) with ESMTPSA id 508004EE0737;
 Mon, 24 Jul 2023 14:58:38 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cf4478b5-2a21-11ee-8612-37d641c3527e
Message-ID: <014b6c1a-9e83-15f7-67d7-74afaf97b9a2@bugseng.com>
Date: Mon, 24 Jul 2023 14:58:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] xen/dt: Rework the prototype of dt_property_read_string()
 to help Eclair
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Julien Grall <jgrall@amazon.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230724102443.91894-1-julien@xen.org>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <20230724102443.91894-1-julien@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 24/07/23 12:24, Julien Grall wrote:
> From: Julien Grall <jgrall@amazon.com>
> 
> Eclair vXXX is unable to prove the parameter out_string will only be
> used the return of dt_property_read_string() is 0. So it will consider
> that MISRA C:2012 Rule 9.1 was violated.

This is not correct: ECLAIR cannot prove that the rule is not violated, 
and hence emits a caution, because the analysis is sound.

> 
> Rework the prototype so the string is returned and use ERR_PTR() to
> embed the error code.
> 
> Signed-off-by: Julien Grall <jgrall@amazon.com>
> 
> ---
> 
> The XXX should be replaced with the version of Eclair. Nicola, can you
> provide it?

I don't see as valuable mentioning ECLAIR at all, but rather explain 
what the change is about (encoding the error value as a return value and 
removing the **out_value parameter).

Regards,

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:59:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:59:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568912.889022 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNv9e-0003g4-Ak; Mon, 24 Jul 2023 12:59:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568912.889022; Mon, 24 Jul 2023 12:59:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNv9e-0003fx-7u; Mon, 24 Jul 2023 12:59:14 +0000
Received: by outflank-mailman (input) for mailman id 568912;
 Mon, 24 Jul 2023 12:59:12 +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
 <SRS0=ymW7=DK=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qNv9c-0003BP-Mz
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:59:12 +0000
Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com
 [2607:f8b0:4864:20::82d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e1aabc1d-2a21-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:59:11 +0200 (CEST)
Received: by mail-qt1-x82d.google.com with SMTP id
 d75a77b69052e-40551e2deebso9815681cf.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 05:59:10 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 d3-20020ac81183000000b00402364e77dcsm3273060qtj.7.2023.07.24.05.59.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 05:59:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e1aabc1d-2a21-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690203549; x=1690808349;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=uqF6OqLMuRcJv9J1aRyFnGvRuRaQSWG7Vrtddk2txvs=;
        b=B0HJzQYl5juuyYNQl0j+HinrUkUalScwEccd5Hr4QScJxqQxV6BldxAILndM9PszJv
         kfSO9ScV96dLPYlLGjttdSWLmrj5q1rzpw+UWPTfnzS60iU61vqH4jSQX/YORPlaz2+T
         sdJgAfvSL5LnBjMcrHE+qvw7EEwlSfDGTdgZwHBwlKiohLvu02/I7qpozMNeDTzvFRtA
         9pcnO0WAns6KHh/BLynlyVniICrCyckMfeQViyEa8/F4IElqYtaOntbo9mEj7rZtrJWy
         iipGE1hexJEkBAZykLmMdBNT2fyyjJKwaM3IGpdU23gnjAAgmZ+EwMubp46zv0rxhAm6
         7KPA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690203549; x=1690808349;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=uqF6OqLMuRcJv9J1aRyFnGvRuRaQSWG7Vrtddk2txvs=;
        b=Cra3opwDlm5VwTyX/LRAaOpsBgkIwaCrLvLvY/ZPMRbCWf1erU/kouPs/IDXG4WmYl
         h1fg+liSlhIs1kcw6FDNG6jiJf00NIb3MT+8cvTg4FClFsh8u5MuZIRr5WW1l6krmSgh
         l6Z/Ahiop5W2rvxy9O4l90lTEHeO1uS8SV4Xw36QgyPRxKwnezm41impG9G30bA1Vp93
         l5kChmP2sox7Fr00vRnAvh2dT9czwR0AHI1ZYakxRTK4Zg0caYxz/7Uzho/bV3tA3PSZ
         CeA0OWAIEOAzvnV72Hso4l64WfKvvN/F28vFLikWTcQ6bAhQqTSz9MsER3qvIYtmfkEX
         hx6w==
X-Gm-Message-State: ABy/qLaHn59R+XCc+kIccc0BCccECmrpWBu6ON4N4m6mEcdPztBQ+r/p
	V/zMLi7JkzNxiE8FWnx1EsA9LbOqc9s=
X-Google-Smtp-Source: APBJJlFftsEQuW1z0amxWsxbtvZrLWzpbkryxZIhf2fOEuADzNt84E+eYtTwxA35MSlQph34azMsrQ==
X-Received: by 2002:a05:622a:1191:b0:405:402b:9d61 with SMTP id m17-20020a05622a119100b00405402b9d61mr8469065qtk.42.1690203549122;
        Mon, 24 Jul 2023 05:59:09 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Henry Wang <Henry.Wang@arm.com>,
	Community Manager <community.manager@xenproject.org>
Subject: [PATCH v6 00/15] Intel Hardware P-States (HWP) support
Date: Mon, 24 Jul 2023 08:58:42 -0400
Message-ID: <20230724125857.11133-1-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Hi,

This patch series adds Hardware-Controlled Performance States (HWP) for
Intel processors to Xen.

v2 was only partially reviewed, so v3 is mostly a reposting of v2.  In v2 &
v3, I think I addressed all comments for v1.  I kept patch 11 "xenpm:
Factor out a non-fatal cpuid_parse variant", with a v2 comment
explaining why I keep it.

v3 adds "xen/x86: Tweak PDC bits when using HWP".  Qubes testing revealed
an issue where enabling HWP can crash firwmare code (maybe SMM).  This
requires a Linux change to get the PDC bits from Xen and pass them to
ACPI.  Roger has a patch [0] to set the PDC bits.  Roger's 3 patch
series was tested with "xen/x86: Tweak PDC bits when using HWP" on
affected hardware and allowed proper operation.

v4:
There is a large amount or renaming from HWP/hwp to CPPC/cppc in the series.
The driver remains hwp_ prefixed since it is dealing with the hardware
interface.  The sysctl, xc and xenpm interfaces were renamed to cppc to
be the generic ACPI CPPC (Collaborative Processor Performance Control)
interface.

struct xen_get_cpufreq_para was re-organized in a binary compatible
fashion to nest scaling governor options.  This allows the cppc support
to use uint32_t's for its parameters.

HWP is now enabled with a top-level cpufreq=hwp option.  It will
fallback to cpufreq=xen if hwp is unavailable.  This seems like the most
user-friendly option.  Since the user was trying to specify *some*
cpufreq, we should give them the best that we can instead of disabling
the functionality.

"xenpm: Factor out a non-fatal cpuid_parse variant" was dropped.
set-cpufreq-cppc expects either a cpu number or none specified, which
implies all.

Some patches were re-arrange - "xen/x86: Tweak PDC bits when using HWP"
now comes immediately after "cpufreq: Add Hardware P-State (HWP) driver"

The implementation of "cpufreq: Allow restricting to internal governors
only " changed, so I removed Jan's Ack.

v5:
HWP is enabled with a toplevel cpufreq=hwp option.  There is no fallback
by default, but a cpufreq=hwp;xen syntax is now supported.  That tries
hwp first.  If HWP registration is unsuccessful, then xen registration
is performed as a fallback.

More changes from Jan's feedback.  They are typically minor and
documented in individual patches.

v6:
After some discussion, the cpufreq=hwp;xen syntax is retained, with the
global applicability of "verbose" mention in docs.  Minor tweaks
elsewhere as documented in individual patches.

Previous cover letter:

With HWP, the processor makes its own determinations for frequency
selection, though users can set some parameters and preferences.  There
is also Turbo Boost which dynamically pushes the max frequency if
possible.

The existing governors don't work with HWP since they select frequencies
and HWP doesn't expose those.  Therefore a dummy hwp-interal governor is
used that doesn't do anything.

xenpm get-cpufreq-para is extended to show HWP parameters, and
set-cpufreq-cppc is added to set them.

A lightly loaded OpenXT laptop showed ~1W power savings according to
powertop.  A mostly idle Fedora system (dom0 only) showed a more modest
power savings.

This is for a 10th gen 6-core 1600 MHz base 4900 MHZ max cpu.  In the
default balance mode, Turbo Boost doesn't exceed 4GHz.  Tweaking the
energy_perf preference with `xenpm set-cpufreq-para balance ene:64`,
I've seen the CPU hit 4.7GHz before throttling down and bouncing around
between 4.3 and 4.5 GHz.  Curiously the other cores read ~4GHz when
turbo boost takes affect.  This was done after pinning all dom0 cores,
and using taskset to pin to vCPU/pCPU 11 and running a bash tightloop.

HWP defaults to disabled and running with the existing HWP configuration
- it doesn't reconfigure by default.  It can be enabled with
cpufreq=hwp.

Hardware Duty Cycling (HDC) is another feature to autonomously powerdown
things.  It defaults to enabled when HWP is enabled, but HDC can be
disabled on the command line.  cpufreq=xen:hwp,no-hdc

I've only tested on 8th gen and 10th gen systems with activity window
and energy_perf support.  So the pathes for CPUs lacking those features
are untested.

Fast MSR support was removed in v2.  The model specific checking was not
done properly, and I don't have hardware to test with.  Since writes are
expected to be infrequent, I just removed the code.

This changes the systcl_pm_op hypercall, so that wants review.

Regards,
Jason

[0] https://lore.kernel.org/xen-devel/20221121102113.41893-3-roger.pau@citrix.com/

Jason Andryuk (15):
  cpufreq: Allow restricting to internal governors only
  cpufreq: Add perf_freq to cpuinfo
  cpufreq: Export intel_feature_detect
  xen/sysctl: Nest cpufreq scaling options
  pmstat&xenpm: Re-arrage for cpufreq union
  cpufreq: Add Hardware P-State (HWP) driver
  xen/x86: Tweak PDC bits when using HWP
  xenpm: Change get-cpufreq-para output for hwp
  cpufreq: Export HWP parameters to userspace as CPPC
  libxc: Include cppc_para in definitions
  xenpm: Print HWP/CPPC parameters
  xen: Add SET_CPUFREQ_HWP xen_sysctl_pm_op
  libxc: Add xc_set_cpufreq_cppc
  xenpm: Add set-cpufreq-cppc subcommand
  CHANGELOG: Add Intel HWP entry

 CHANGELOG.md                                 |   2 +-
 docs/misc/xen-command-line.pandoc            |  20 +-
 tools/include/xenctrl.h                      |  28 +-
 tools/libs/ctrl/xc_pm.c                      |  42 +-
 tools/misc/xenpm.c                           | 392 ++++++++++-
 xen/arch/x86/acpi/cpufreq/Makefile           |   1 +
 xen/arch/x86/acpi/cpufreq/cpufreq.c          |  31 +-
 xen/arch/x86/acpi/cpufreq/hwp.c              | 654 +++++++++++++++++++
 xen/arch/x86/acpi/lib.c                      |   5 +
 xen/arch/x86/cpu/mcheck/mce_intel.c          |   6 +
 xen/arch/x86/include/asm/cpufeature.h        |  12 +-
 xen/arch/x86/include/asm/msr-index.h         |  16 +-
 xen/drivers/acpi/pmstat.c                    | 100 +--
 xen/drivers/cpufreq/cpufreq.c                |  60 +-
 xen/drivers/cpufreq/cpufreq_misc_governors.c |   9 +
 xen/drivers/cpufreq/cpufreq_ondemand.c       |   3 +
 xen/drivers/cpufreq/utility.c                |   1 +
 xen/include/acpi/cpufreq/cpufreq.h           |  22 +
 xen/include/acpi/pdc_intel.h                 |   1 +
 xen/include/public/sysctl.h                  | 144 +++-
 20 files changed, 1428 insertions(+), 121 deletions(-)
 create mode 100644 xen/arch/x86/acpi/cpufreq/hwp.c

-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:59:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:59:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568913.889033 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNv9m-0003z6-NK; Mon, 24 Jul 2023 12:59:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568913.889033; Mon, 24 Jul 2023 12:59:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNv9m-0003yz-Ji; Mon, 24 Jul 2023 12:59:22 +0000
Received: by outflank-mailman (input) for mailman id 568913;
 Mon, 24 Jul 2023 12:59:21 +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
 <SRS0=ymW7=DK=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qNv9l-0003BP-HJ
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:59:21 +0000
Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com
 [2607:f8b0:4864:20::82c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e6c3b833-2a21-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:59:19 +0200 (CEST)
Received: by mail-qt1-x82c.google.com with SMTP id
 d75a77b69052e-403f65a3f8cso33875051cf.2
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 05:59:19 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 d3-20020ac81183000000b00402364e77dcsm3273060qtj.7.2023.07.24.05.59.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 05:59:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e6c3b833-2a21-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690203558; x=1690808358;
        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=vNQhWJqSLtysm6iaINr+s0i3gnrhiDBqgnXkQD6RBcM=;
        b=jzJf7FgcwuUKsKESZMpF55d1xqwWqJHwFCR4zuSTi+QWm3u8jN0QVvhkIGBQRXFD7y
         YZV5+qeXwjJK2oIVQ6A61KGyl3JEIti2HJkuhraBoFQc4S6WDGYRzqbB7O6Yo9nON5Qr
         YIFdWnq72RVfzRflIjH6IBoNSuhJ/Lx/lhtUpV6DcaGP6VY0l3pBINRta1CauaZQ+0HZ
         1YNa7biAradn/d5roC/ZdEpqDc2dXEIX+LWbACL2EC14akyYOkCrM+snVWxsgY4CFPvg
         egvmx8Klc/7eqFe5ujV9bOnU1zc7qFaW7GZ3oVu+C+6mGRIS7LlXHL9eVMLS78VjiYTK
         F7Yw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690203558; x=1690808358;
        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=vNQhWJqSLtysm6iaINr+s0i3gnrhiDBqgnXkQD6RBcM=;
        b=ERev7igYntj78oaenAkoiIhyxjPawOC3lsWiRxRb0CtRYCWtv6TMSX6qRYDqXEYlar
         bJ0gkG6TFeUjiSJt44n/kW4U48rjF4zNVQx27AzfuvMmRDaqcEXHsKyrhElbOwgTfnfB
         DPHXELJpuvEzgzA/mH+HsCbp3l36ijUypb7C5BpdA6ikUAiZ/qfBqYy52GAlahNhGmSE
         6oPyn/8kL64l1m97g4qqri/s0cXit7jX4PjCQ32opvlNiAhI3ae6fpFc2mhNrLW7NBA/
         kVcaTzHc2KZpTAOqRA4pmz6QYRU2KL0J4bIjTHqdQrZEiklLWTB/BDYazS8hEpQMdG6w
         FZ8Q==
X-Gm-Message-State: ABy/qLbwB4VBqEOeueKfuWp0c/nIMvOcYDta/16jZYmCLOmSVvgWVbEk
	Mans1X29tykwaspQHph7ivzNV26papY=
X-Google-Smtp-Source: APBJJlHC4Avp8+Uss8Thrg0l6R9yg0cs9o3uBbVy0DGpOB/Ec+Z1s8yL4NlgLNOMeOEwphsJvge5+g==
X-Received: by 2002:ac8:5786:0:b0:403:e895:155b with SMTP id v6-20020ac85786000000b00403e895155bmr8528736qta.34.1690203557767;
        Mon, 24 Jul 2023 05:59:17 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v6 01/15] cpufreq: Allow restricting to internal governors only
Date: Mon, 24 Jul 2023 08:58:43 -0400
Message-ID: <20230724125857.11133-2-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230724125857.11133-1-jandryuk@gmail.com>
References: <20230724125857.11133-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

For hwp, the standard governors are not usable, and only the internal
one is applicable.  Add the cpufreq_governor_internal boolean to
indicate when an internal governor, like hwp, will be used.  This is set
during presmp_initcall, and governor registration can be skipped when
called during initcall.

This way unusable governors are not registered, and only compatible
governors are advertised to userspace.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v6:
Add Jan's Ack

v5:
Check cpufreq_governor_internal and skip registration as applicable
Remove internal flag

v4:
Rework to use an internal flag
Removed Jan's Ack since the approach is different.

v3:
Switch to initdata
Add Jan Acked-by
Commit message s/they/the/ typo
Don't register hwp-internal when running non-hwp - Marek

v2:
Switch to "-internal"
Add blank line in header
---
 xen/drivers/cpufreq/cpufreq.c                | 1 +
 xen/drivers/cpufreq/cpufreq_misc_governors.c | 9 +++++++++
 xen/drivers/cpufreq/cpufreq_ondemand.c       | 3 +++
 xen/include/acpi/cpufreq/cpufreq.h           | 2 ++
 4 files changed, 15 insertions(+)

diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 2321c7dd07..67a58d409b 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -56,6 +56,7 @@ struct cpufreq_dom {
 };
 static LIST_HEAD_READ_MOSTLY(cpufreq_dom_list_head);
 
+bool __initdata cpufreq_governor_internal;
 struct cpufreq_governor *__read_mostly cpufreq_opt_governor;
 LIST_HEAD_READ_MOSTLY(cpufreq_governor_list);
 
diff --git a/xen/drivers/cpufreq/cpufreq_misc_governors.c b/xen/drivers/cpufreq/cpufreq_misc_governors.c
index f5571f5486..0327fad23b 100644
--- a/xen/drivers/cpufreq/cpufreq_misc_governors.c
+++ b/xen/drivers/cpufreq/cpufreq_misc_governors.c
@@ -120,6 +120,9 @@ static int __init cf_check cpufreq_gov_userspace_init(void)
 {
     unsigned int cpu;
 
+    if ( cpufreq_governor_internal )
+        return 0;
+
     for_each_online_cpu(cpu)
         per_cpu(cpu_set_freq, cpu) = userspace_cmdline_freq;
     register_cpu_notifier(&cpufreq_userspace_cpu_nfb);
@@ -162,6 +165,9 @@ struct cpufreq_governor cpufreq_gov_performance = {
 
 static int __init cf_check cpufreq_gov_performance_init(void)
 {
+    if ( cpufreq_governor_internal )
+        return 0;
+
     return cpufreq_register_governor(&cpufreq_gov_performance);
 }
 __initcall(cpufreq_gov_performance_init);
@@ -201,6 +207,9 @@ struct cpufreq_governor cpufreq_gov_powersave = {
 
 static int __init cf_check cpufreq_gov_powersave_init(void)
 {
+    if ( cpufreq_governor_internal )
+        return 0;
+
     return cpufreq_register_governor(&cpufreq_gov_powersave);
 }
 __initcall(cpufreq_gov_powersave_init);
diff --git a/xen/drivers/cpufreq/cpufreq_ondemand.c b/xen/drivers/cpufreq/cpufreq_ondemand.c
index fbcd14d6c3..06cfc88d30 100644
--- a/xen/drivers/cpufreq/cpufreq_ondemand.c
+++ b/xen/drivers/cpufreq/cpufreq_ondemand.c
@@ -360,6 +360,9 @@ struct cpufreq_governor cpufreq_gov_dbs = {
 
 static int __init cf_check cpufreq_gov_dbs_init(void)
 {
+    if ( cpufreq_governor_internal )
+        return 0;
+
     return cpufreq_register_governor(&cpufreq_gov_dbs);
 }
 __initcall(cpufreq_gov_dbs_init);
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 35dcf21e8f..44fc4c58fc 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -116,6 +116,8 @@ extern struct cpufreq_governor cpufreq_gov_powersave;
 
 extern struct list_head cpufreq_governor_list;
 
+extern bool cpufreq_governor_internal;
+
 extern int cpufreq_register_governor(struct cpufreq_governor *governor);
 extern struct cpufreq_governor *__find_governor(const char *governor);
 #define CPUFREQ_DEFAULT_GOVERNOR &cpufreq_gov_dbs
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:59:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:59:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568914.889043 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNv9p-0004HF-Um; Mon, 24 Jul 2023 12:59:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568914.889043; Mon, 24 Jul 2023 12:59:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNv9p-0004H1-Rf; Mon, 24 Jul 2023 12:59:25 +0000
Received: by outflank-mailman (input) for mailman id 568914;
 Mon, 24 Jul 2023 12:59:24 +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
 <SRS0=ymW7=DK=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qNv9o-0003BP-7D
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:59:24 +0000
Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com
 [2607:f8b0:4864:20::72b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e89517af-2a21-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:59:22 +0200 (CEST)
Received: by mail-qk1-x72b.google.com with SMTP id
 af79cd13be357-76754b9eac0so394224385a.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 05:59:22 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 d3-20020ac81183000000b00402364e77dcsm3273060qtj.7.2023.07.24.05.59.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 05:59:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e89517af-2a21-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690203561; x=1690808361;
        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=tj29XCVclI+6QGR1ahwKo+P0a4dIzt4OqPyhJ7hCJ/k=;
        b=MefEokX652K3Hxpop/Q4MUOZwSx9FsyRVLkshoQu+sn3gQ6CYJ/YDwNuwOoy/D8IAA
         6D+xH84rlygFJyABuTIlX20Lk+yzoKkU5vwjGwZMaoK/jfBMTsWgub7rjLpyqfLLCSR+
         JWMPdas4HuujT4W7zgifiR+RJk45JF1pF8+a7wJDa3QEcojUEe0wiLHSQYEMNPJKjYXi
         ijiLBGl9eSxrK4CWCGrVTmPh/Qd2s7Lx0FvsGLocb5koZQQb9ZI968e0QAoKWvEx/ZpR
         ffBivN0qzCKVTI27ZcXRLbZSiaVDykVc0z181BmcnKRNK5iiSV1Nad4YPWr7CdmYSayv
         4e2g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690203561; x=1690808361;
        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=tj29XCVclI+6QGR1ahwKo+P0a4dIzt4OqPyhJ7hCJ/k=;
        b=VjTEeU9cCoJwlhkwvZTFc78WsTpqk37Vm6ya0c4Ez3ubGFOvGvwKtknre1BH2vvI0a
         gsF+wuCGqaaeudeK3Lou5FD3dIgtY87Ygu37k3hOT5jY3+kfrQSfU8HrW9CxyvLQP2Fz
         ZfPeQMXz5gAQLjEX1BUsCwH2wJdaAAk88dzAG0vuhNXkzN3WEkam6oeNrO9hiiuoTm27
         c6ydsNbMIyXIH4upfWlAF+wW2FhA2kAq/IQhzCTBvCifGqsJ2vebCrMEO9F4o5nCSn4n
         kqvp9rtjjpfdwYn4jhF9pTgNSq5AsiBlJRsendlAhaVO2XljdD3gM2dhbl+6hx0iHVQe
         EYtw==
X-Gm-Message-State: ABy/qLagmnfZcRbdm0vFrZWV8rFzQKrTI/HLm8sSJkgwIX4OUb9ktA/t
	1uo8bW5xVvXgVbHcvcw0Q8Xq4TLQo5c=
X-Google-Smtp-Source: APBJJlGr9DHZ8QXjoV3YuAbWacCy15zRL8+KkU5SbLjf/Ts2cgSvdd1lZO4UsazGe8E6ZRxSaZ0yHw==
X-Received: by 2002:a05:622a:249:b0:405:46e5:be3a with SMTP id c9-20020a05622a024900b0040546e5be3amr11564111qtx.49.1690203560813;
        Mon, 24 Jul 2023 05:59:20 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v6 02/15] cpufreq: Add perf_freq to cpuinfo
Date: Mon, 24 Jul 2023 08:58:44 -0400
Message-ID: <20230724125857.11133-3-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230724125857.11133-1-jandryuk@gmail.com>
References: <20230724125857.11133-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

acpi-cpufreq scales the aperf/mperf measurements by max_freq, but HWP
needs to scale by base frequency.  Settings max_freq to base_freq
"works" but the code is not obvious, and returning values to userspace
is tricky.  Add an additonal perf_freq member which is used for scaling
aperf/mperf measurements.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v3:
Add Jan's Ack

I don't like this, but it seems the best way to re-use the common
aperf/mperf code.  The other option would be to add wrappers that then
do the acpi vs. hwp scaling.
---
 xen/arch/x86/acpi/cpufreq/cpufreq.c | 2 +-
 xen/drivers/cpufreq/utility.c       | 1 +
 xen/include/acpi/cpufreq/cpufreq.h  | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index 2e0067fbe5..6c70d04395 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -316,7 +316,7 @@ unsigned int get_measured_perf(unsigned int cpu, unsigned int flag)
     else
         perf_percent = 0;
 
-    return policy->cpuinfo.max_freq * perf_percent / 100;
+    return policy->cpuinfo.perf_freq * perf_percent / 100;
 }
 
 static unsigned int cf_check get_cur_freq_on_cpu(unsigned int cpu)
diff --git a/xen/drivers/cpufreq/utility.c b/xen/drivers/cpufreq/utility.c
index 9eb7ecedcd..6831f62851 100644
--- a/xen/drivers/cpufreq/utility.c
+++ b/xen/drivers/cpufreq/utility.c
@@ -236,6 +236,7 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
 
     policy->min = policy->cpuinfo.min_freq = min_freq;
     policy->max = policy->cpuinfo.max_freq = max_freq;
+    policy->cpuinfo.perf_freq = max_freq;
     policy->cpuinfo.second_max_freq = second_max_freq;
 
     if (policy->min == ~0)
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 44fc4c58fc..1f1898d811 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -37,6 +37,9 @@ extern struct acpi_cpufreq_data *cpufreq_drv_data[NR_CPUS];
 struct cpufreq_cpuinfo {
     unsigned int        max_freq;
     unsigned int        second_max_freq;    /* P1 if Turbo Mode is on */
+    unsigned int        perf_freq; /* Scaling freq for aperf/mpref.
+                                      acpi-cpufreq uses max_freq, but HWP uses
+                                      base_freq.*/
     unsigned int        min_freq;
     unsigned int        transition_latency; /* in 10^(-9) s = nanoseconds */
 };
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:59:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:59:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568915.889053 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNv9r-0004Yg-7G; Mon, 24 Jul 2023 12:59:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568915.889053; Mon, 24 Jul 2023 12:59:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNv9r-0004YV-3x; Mon, 24 Jul 2023 12:59:27 +0000
Received: by outflank-mailman (input) for mailman id 568915;
 Mon, 24 Jul 2023 12:59:25 +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
 <SRS0=ymW7=DK=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qNv9p-0003BP-D6
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:59:25 +0000
Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com
 [2607:f8b0:4864:20::82f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e9526194-2a21-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:59:23 +0200 (CEST)
Received: by mail-qt1-x82f.google.com with SMTP id
 d75a77b69052e-403a7066bc8so34716411cf.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 05:59:23 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 d3-20020ac81183000000b00402364e77dcsm3273060qtj.7.2023.07.24.05.59.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 05:59:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e9526194-2a21-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690203562; x=1690808362;
        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=6N7tHO/NpGPoNencisuqLlnFkoHrBAPddvPlzfIc1r8=;
        b=cGb1P+6S3Av5VGzrgSZc1YUQupRCIbJ6DAVAiXA9Mottwv6P7pTsXXlnUeOeNQE6yS
         KXloN25oLGNWTvgFBoaCmcjPodiF98MuPueE99Oh/l/jiDSTy99X+cbsz2u76U2fKDtN
         GQrq3t/hMKxCpsFJTSG9KtG3i9LiWtrYvD7m9p/nqooS4SIDUyfGT/NS++diC6BVnvYM
         Ix7EoMFBJPh27yiNw7eExYutYYqXbb/9Z8YQbEJAVDxim2gAX+MmqXE5Q4IU8yVcoGq9
         XjmjJLYBdAdSc/tLVMdlChHQPvllJwyAX9ZrBYPRgSvckE/QVWo5fwOj/SOgEjcjVEbp
         MuFw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690203562; x=1690808362;
        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=6N7tHO/NpGPoNencisuqLlnFkoHrBAPddvPlzfIc1r8=;
        b=PXjrY+0V7KnGLn2F1j/Q01hUIJvBNBzCMo3KNBvD8Ksh8YiD7f3MbNHevryu6tHOXY
         fV3QXdNbKzZxuyF1lRo3s/++Hyxz4lW/qO6T6XrDl0mnCzWRzQZw3nm78A7cJExP3qvz
         VJCIvg6d0ioqltx+WqWsZ5Gy+uj4UblKo8Qgrvf6AORVHsAUhtenfZ3JEGInFIagPEg7
         hE8I8B6v2e8OaKmElI+yBw4z2uE5plmd/2xTgPIPdzaW65SGwAhOKn8kSwGlxJGszmD2
         pOwKui4Y9hBeYQ1hwcsJrz5limFBjHrcEEfK2x32EAQeB02+PbNecYjdt1TFFhL4kNcW
         On+Q==
X-Gm-Message-State: ABy/qLYrSEFy1dnw3z81yYGwmeYzVg+bvMM06YA2BC7xekwiXvgq9NwY
	TWm7+Y8TPT0TJnJJ6sWT+Dm4g4BHLkc=
X-Google-Smtp-Source: APBJJlHp7cIM4/UVssHdBqftTk4Z3lll3Mh05WSVk3y28GZq+W5S9sj/cFB3io/d1A08Hhw1vN1MKw==
X-Received: by 2002:ac8:5e46:0:b0:400:91d8:a704 with SMTP id i6-20020ac85e46000000b0040091d8a704mr10189554qtx.47.1690203562196;
        Mon, 24 Jul 2023 05:59:22 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v6 03/15] cpufreq: Export intel_feature_detect
Date: Mon, 24 Jul 2023 08:58:45 -0400
Message-ID: <20230724125857.11133-4-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230724125857.11133-1-jandryuk@gmail.com>
References: <20230724125857.11133-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Export feature_detect as intel_feature_detect so it can be re-used by
HWP.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v4:
Add Jan's Ack

v3:
Remove void * cast when calling intel_feature_detect

v2:
export intel_feature_detect with typed pointer
Move intel_feature_detect to acpi/cpufreq/cpufreq.h since the
declaration now contains struct cpufreq_policy *.
---
 xen/arch/x86/acpi/cpufreq/cpufreq.c | 8 ++++++--
 xen/include/acpi/cpufreq/cpufreq.h  | 2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index 6c70d04395..f1cc473b4f 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -339,9 +339,8 @@ static unsigned int cf_check get_cur_freq_on_cpu(unsigned int cpu)
     return extract_freq(get_cur_val(cpumask_of(cpu)), data);
 }
 
-static void cf_check feature_detect(void *info)
+void intel_feature_detect(struct cpufreq_policy *policy)
 {
-    struct cpufreq_policy *policy = info;
     unsigned int eax;
 
     eax = cpuid_eax(6);
@@ -353,6 +352,11 @@ static void cf_check feature_detect(void *info)
     }
 }
 
+static void cf_check feature_detect(void *info)
+{
+    intel_feature_detect(info);
+}
+
 static unsigned int check_freqs(const cpumask_t *mask, unsigned int freq,
                                 struct acpi_cpufreq_data *data)
 {
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 1f1898d811..482ea5b0de 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -243,4 +243,6 @@ int write_userspace_scaling_setspeed(unsigned int cpu, unsigned int freq);
 void cpufreq_dbs_timer_suspend(void);
 void cpufreq_dbs_timer_resume(void);
 
+void intel_feature_detect(struct cpufreq_policy *policy);
+
 #endif /* __XEN_CPUFREQ_PM_H__ */
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:59:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:59:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568917.889063 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNv9x-00050w-FJ; Mon, 24 Jul 2023 12:59:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568917.889063; Mon, 24 Jul 2023 12:59:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNv9x-00050i-BZ; Mon, 24 Jul 2023 12:59:33 +0000
Received: by outflank-mailman (input) for mailman id 568917;
 Mon, 24 Jul 2023 12:59:31 +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
 <SRS0=ymW7=DK=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qNv9v-0003BP-Cr
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:59:31 +0000
Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com
 [2607:f8b0:4864:20::72a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ec0c1eaa-2a21-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:59:28 +0200 (CEST)
Received: by mail-qk1-x72a.google.com with SMTP id
 af79cd13be357-7656652da3cso330108185a.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 05:59:28 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 d3-20020ac81183000000b00402364e77dcsm3273060qtj.7.2023.07.24.05.59.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 05:59:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ec0c1eaa-2a21-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690203566; x=1690808366;
        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=49TsFIBINTB4jyEM3kUw7HVPbRFWIZxCSrMg4LTGTQ8=;
        b=pWfjP/HO6qeTMKNsvEDHrF14ixlWFXJObWGPbYnTbBr6bTREvGjzzqkPeQLLYsGH4Z
         H5NZ35rOKBWQhwLAal1UUJnxVUchaW1us0mzcMsDlGMUmMbXtNHqtlRgDGzAO/FgLGxd
         AAf1TTvJOFBeFRd0A2zsV+9ScYnQ9VQOCxkyuJg1yaxrC+yPzE9mTkxmEp/neYIRcAjC
         XZex7mkgVVapFxDs5sr+HBXH8noKGrSTDYI3Ngjw8GEBiwlvCEa2xvk4KyyDuueoU0wW
         RYE36hH4adbzCMXh8E9+uovmDvkbdUB1vJH4NPcKFqNkhM2Hir7fUvSf/a6MjgUMgvD/
         71zA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690203566; x=1690808366;
        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=49TsFIBINTB4jyEM3kUw7HVPbRFWIZxCSrMg4LTGTQ8=;
        b=TiwhfU3113FjR/yqu6sb4SyFkB340CbI6jxOKYMhE4/6qPU6BUS44K5+LgngU3nI35
         vQTSm1aRsSQk1D1cxh5NZVCj1oZ5HO3701APlHBo1+A8cLDTmnCEjgl90Iazd/EZse4V
         ezb8B/ykkBQPklowXw4Lj9JEx/rLKAVXquyKUux1ZNAJ+55zkHwlgAO9A8WQnQLObQ2A
         GBXOmxtslIHaM9Hn1kvKcHjJNnOMfoujKJqHTLm509KA+ggJmOf+MB8uDEN3pDXQkLiv
         Tw7EhhXSgUSfprBQqCFN7kxZOJkQjV1/I04ojWI9KLnpUsGyucQMrapq+bPLmNABlVG2
         QQRA==
X-Gm-Message-State: ABy/qLZvHhR/sQHi6C9ohPhFg9r9UyGM5qbGYCQnQGtTgkJhJ/miQj1U
	lYZZpgLNSgFsFZS4F5LdHGkViCsy2FY=
X-Google-Smtp-Source: APBJJlEiffY54ufRiOuWPcgox/1ThBUVljb1DPh2tqKW5sPEEjan2K81uePrVFaZLm/NPoYYv3t+8Q==
X-Received: by 2002:ac8:7c44:0:b0:400:7ff8:db5b with SMTP id o4-20020ac87c44000000b004007ff8db5bmr11139049qtv.33.1690203566380;
        Mon, 24 Jul 2023 05:59:26 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 04/15] xen/sysctl: Nest cpufreq scaling options
Date: Mon, 24 Jul 2023 08:58:46 -0400
Message-ID: <20230724125857.11133-5-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230724125857.11133-1-jandryuk@gmail.com>
References: <20230724125857.11133-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add a union and struct so that most of the scaling variables of struct
xen_get_cpufreq_para are within in a binary-compatible layout.  This
allows cppc_para to live in the larger union and use uint32_ts - struct
xen_cppc_para will be 10 uint32_t's.

The new scaling struct is 3 * uint32_t + 16 bytes CPUFREQ_NAME_LEN + 4 *
uint32_t for xen_ondemand = 11 uint32_t.  That means the old size is
retained, int32_t turbo_enabled doesn't move and it's binary compatible.

The out-of-context memcpy() in xc_get_cpufreq_para() now handles the
copying of the fields removed there.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
v6:
Add Jan's Reviewed-by

v5:
Expand commit message
Change comment to driver/governor
---
 tools/include/xenctrl.h     | 22 +++++++++++++---------
 tools/libs/ctrl/xc_pm.c     |  7 +------
 tools/misc/xenpm.c          | 24 ++++++++++++------------
 xen/drivers/acpi/pmstat.c   | 27 ++++++++++++++-------------
 xen/include/public/sysctl.h | 22 +++++++++++++---------
 5 files changed, 53 insertions(+), 49 deletions(-)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index dba33d5d0f..8aedb952a0 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1909,16 +1909,20 @@ struct xc_get_cpufreq_para {
     uint32_t cpuinfo_cur_freq;
     uint32_t cpuinfo_max_freq;
     uint32_t cpuinfo_min_freq;
-    uint32_t scaling_cur_freq;
-
-    char scaling_governor[CPUFREQ_NAME_LEN];
-    uint32_t scaling_max_freq;
-    uint32_t scaling_min_freq;
-
-    /* for specific governor */
     union {
-        xc_userspace_t userspace;
-        xc_ondemand_t ondemand;
+        struct {
+            uint32_t scaling_cur_freq;
+
+            char scaling_governor[CPUFREQ_NAME_LEN];
+            uint32_t scaling_max_freq;
+            uint32_t scaling_min_freq;
+
+            /* for specific governor */
+            union {
+                xc_userspace_t userspace;
+                xc_ondemand_t ondemand;
+            } u;
+        } s;
     } u;
 
     int32_t turbo_enabled;
diff --git a/tools/libs/ctrl/xc_pm.c b/tools/libs/ctrl/xc_pm.c
index c3a9864bf7..6e751e242f 100644
--- a/tools/libs/ctrl/xc_pm.c
+++ b/tools/libs/ctrl/xc_pm.c
@@ -265,17 +265,12 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
         user_para->cpuinfo_cur_freq = sys_para->cpuinfo_cur_freq;
         user_para->cpuinfo_max_freq = sys_para->cpuinfo_max_freq;
         user_para->cpuinfo_min_freq = sys_para->cpuinfo_min_freq;
-        user_para->scaling_cur_freq = sys_para->scaling_cur_freq;
-        user_para->scaling_max_freq = sys_para->scaling_max_freq;
-        user_para->scaling_min_freq = sys_para->scaling_min_freq;
         user_para->turbo_enabled    = sys_para->turbo_enabled;
 
         memcpy(user_para->scaling_driver,
                 sys_para->scaling_driver, CPUFREQ_NAME_LEN);
-        memcpy(user_para->scaling_governor,
-                sys_para->scaling_governor, CPUFREQ_NAME_LEN);
 
-        /* copy to user_para no matter what cpufreq governor */
+        /* copy to user_para no matter what cpufreq driver/governor */
         BUILD_BUG_ON(sizeof(((struct xc_get_cpufreq_para *)0)->u) !=
 		     sizeof(((struct xen_get_cpufreq_para *)0)->u));
 
diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 1bb6187e56..ee8ce5d5f2 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -730,39 +730,39 @@ static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
     printf("scaling_avail_gov    : %s\n",
            p_cpufreq->scaling_available_governors);
 
-    printf("current_governor     : %s\n", p_cpufreq->scaling_governor);
-    if ( !strncmp(p_cpufreq->scaling_governor,
+    printf("current_governor     : %s\n", p_cpufreq->u.s.scaling_governor);
+    if ( !strncmp(p_cpufreq->u.s.scaling_governor,
                   "userspace", CPUFREQ_NAME_LEN) )
     {
         printf("  userspace specific :\n");
         printf("    scaling_setspeed : %u\n",
-               p_cpufreq->u.userspace.scaling_setspeed);
+               p_cpufreq->u.s.u.userspace.scaling_setspeed);
     }
-    else if ( !strncmp(p_cpufreq->scaling_governor,
+    else if ( !strncmp(p_cpufreq->u.s.scaling_governor,
                        "ondemand", CPUFREQ_NAME_LEN) )
     {
         printf("  ondemand specific  :\n");
         printf("    sampling_rate    : max [%u] min [%u] cur [%u]\n",
-               p_cpufreq->u.ondemand.sampling_rate_max,
-               p_cpufreq->u.ondemand.sampling_rate_min,
-               p_cpufreq->u.ondemand.sampling_rate);
+               p_cpufreq->u.s.u.ondemand.sampling_rate_max,
+               p_cpufreq->u.s.u.ondemand.sampling_rate_min,
+               p_cpufreq->u.s.u.ondemand.sampling_rate);
         printf("    up_threshold     : %u\n",
-               p_cpufreq->u.ondemand.up_threshold);
+               p_cpufreq->u.s.u.ondemand.up_threshold);
     }
 
     printf("scaling_avail_freq   :");
     for ( i = 0; i < p_cpufreq->freq_num; i++ )
         if ( p_cpufreq->scaling_available_frequencies[i] ==
-             p_cpufreq->scaling_cur_freq )
+             p_cpufreq->u.s.scaling_cur_freq )
             printf(" *%d", p_cpufreq->scaling_available_frequencies[i]);
         else
             printf(" %d", p_cpufreq->scaling_available_frequencies[i]);
     printf("\n");
 
     printf("scaling frequency    : max [%u] min [%u] cur [%u]\n",
-           p_cpufreq->scaling_max_freq,
-           p_cpufreq->scaling_min_freq,
-           p_cpufreq->scaling_cur_freq);
+           p_cpufreq->u.s.scaling_max_freq,
+           p_cpufreq->u.s.scaling_min_freq,
+           p_cpufreq->u.s.scaling_cur_freq);
 
     printf("turbo mode           : %s\n",
            p_cpufreq->turbo_enabled ? "enabled" : "disabled or n/a");
diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index 1bae635101..f5a9ac3f1a 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -258,37 +258,38 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
         cpufreq_driver.get ? cpufreq_driver.get(op->cpuid) : policy->cur;
     op->u.get_para.cpuinfo_max_freq = policy->cpuinfo.max_freq;
     op->u.get_para.cpuinfo_min_freq = policy->cpuinfo.min_freq;
-    op->u.get_para.scaling_cur_freq = policy->cur;
-    op->u.get_para.scaling_max_freq = policy->max;
-    op->u.get_para.scaling_min_freq = policy->min;
+
+    op->u.get_para.u.s.scaling_cur_freq = policy->cur;
+    op->u.get_para.u.s.scaling_max_freq = policy->max;
+    op->u.get_para.u.s.scaling_min_freq = policy->min;
 
     if ( cpufreq_driver.name[0] )
-        strlcpy(op->u.get_para.scaling_driver, 
+        strlcpy(op->u.get_para.scaling_driver,
             cpufreq_driver.name, CPUFREQ_NAME_LEN);
     else
         strlcpy(op->u.get_para.scaling_driver, "Unknown", CPUFREQ_NAME_LEN);
 
     if ( policy->governor->name[0] )
-        strlcpy(op->u.get_para.scaling_governor, 
+        strlcpy(op->u.get_para.u.s.scaling_governor,
             policy->governor->name, CPUFREQ_NAME_LEN);
     else
-        strlcpy(op->u.get_para.scaling_governor, "Unknown", CPUFREQ_NAME_LEN);
+        strlcpy(op->u.get_para.u.s.scaling_governor, "Unknown", CPUFREQ_NAME_LEN);
 
     /* governor specific para */
-    if ( !strncasecmp(op->u.get_para.scaling_governor,
+    if ( !strncasecmp(op->u.get_para.u.s.scaling_governor,
                       "userspace", CPUFREQ_NAME_LEN) )
     {
-        op->u.get_para.u.userspace.scaling_setspeed = policy->cur;
+        op->u.get_para.u.s.u.userspace.scaling_setspeed = policy->cur;
     }
 
-    if ( !strncasecmp(op->u.get_para.scaling_governor,
+    if ( !strncasecmp(op->u.get_para.u.s.scaling_governor,
                       "ondemand", CPUFREQ_NAME_LEN) )
     {
         ret = get_cpufreq_ondemand_para(
-            &op->u.get_para.u.ondemand.sampling_rate_max,
-            &op->u.get_para.u.ondemand.sampling_rate_min,
-            &op->u.get_para.u.ondemand.sampling_rate,
-            &op->u.get_para.u.ondemand.up_threshold);
+            &op->u.get_para.u.s.u.ondemand.sampling_rate_max,
+            &op->u.get_para.u.s.u.ondemand.sampling_rate_min,
+            &op->u.get_para.u.s.u.ondemand.sampling_rate,
+            &op->u.get_para.u.s.u.ondemand.up_threshold);
     }
     op->u.get_para.turbo_enabled = cpufreq_get_turbo_status(op->cpuid);
 
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index fa7147de47..c11c0b1a6c 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -317,16 +317,20 @@ struct xen_get_cpufreq_para {
     uint32_t cpuinfo_cur_freq;
     uint32_t cpuinfo_max_freq;
     uint32_t cpuinfo_min_freq;
-    uint32_t scaling_cur_freq;
-
-    char scaling_governor[CPUFREQ_NAME_LEN];
-    uint32_t scaling_max_freq;
-    uint32_t scaling_min_freq;
-
-    /* for specific governor */
     union {
-        struct  xen_userspace userspace;
-        struct  xen_ondemand ondemand;
+        struct {
+            uint32_t scaling_cur_freq;
+
+            char scaling_governor[CPUFREQ_NAME_LEN];
+            uint32_t scaling_max_freq;
+            uint32_t scaling_min_freq;
+
+            /* for specific governor */
+            union {
+                struct  xen_userspace userspace;
+                struct  xen_ondemand ondemand;
+            } u;
+        } s;
     } u;
 
     int32_t turbo_enabled;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:59:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:59:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568919.889073 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvA1-0005WN-VF; Mon, 24 Jul 2023 12:59:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568919.889073; Mon, 24 Jul 2023 12:59:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvA1-0005WA-S4; Mon, 24 Jul 2023 12:59:37 +0000
Received: by outflank-mailman (input) for mailman id 568919;
 Mon, 24 Jul 2023 12:59:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ymW7=DK=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qNvA0-0005PS-PB
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:59:36 +0000
Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com
 [2607:f8b0:4864:20::830])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id efffde6a-2a21-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 14:59:35 +0200 (CEST)
Received: by mail-qt1-x830.google.com with SMTP id
 d75a77b69052e-403a840dc64so31356791cf.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 05:59:34 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 d3-20020ac81183000000b00402364e77dcsm3273060qtj.7.2023.07.24.05.59.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 05:59:32 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: efffde6a-2a21-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690203573; x=1690808373;
        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=uONRseWQBNVJ9jwtBk4ECQqPUyTR6APKQISP6ohD4HM=;
        b=OdtCxCnAzp/i0h1Tz9ygma229o6dcVNPj9Ko4VMnlG+ITDRUJpU/uryXip/GfhTZ3q
         VWeO4obZul58uiDtUkOJJ45QXOfaNIEmE+6s4Nqzti1ZrVSNikH7j1QF+wN59TYA4YpH
         0Tox+V0X28SG9ucwg5MvJGxA5sJ3/i1IbdLWSGX/dUhfAG5SH098qzlhDhIUvzCkZl1/
         bkJpshONxr0hGyYckOwK+BbPz+/CuS9kc2mP/5GrjXdcQ2OuXzq8iVhUUNMg+lrCLwnU
         kwHxnlS4+28ZYhmH2oOjpv6d788XjNyU/4LutB2c1/cFEVwxK1/Wjhk0w4nqGzVwOPeT
         GDvA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690203573; x=1690808373;
        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=uONRseWQBNVJ9jwtBk4ECQqPUyTR6APKQISP6ohD4HM=;
        b=HSMwkEOkw7mi8nttV1EaEo/kP+I8x2q1fX8Wguwtkdus2cewxS15PY4nwC7rgm3SXH
         GyPzE+wAGpiLmmmzE2/8S2Erx8i9i3lfZEj9pxqEisPicIsnXxLob4hkC4Lv+wmgO0MA
         mOf3mW1RiqbvCqFLTWQbooTZcazlBFZ3nyXw826+mOOcNgwH1B08XOrw6Yk+KLugXiMS
         aGMjOeqFA+32N4wOQK8JFwCYhmbrFInu83DAuShtCP/jjc60NXWV8HjvQCNOmiw94Jq0
         NMZGoahAQ1Ixt+4eWGonWGj8tvjhrkT/kHqTuvW2fWfrYS2JGnLPaYK2IK7zX5JznCnG
         A6TA==
X-Gm-Message-State: ABy/qLZDgTI85oubC0CPjddHBF6WpAu7Duwtn/GEeL6f69Oe2nG0pbXG
	QhJxk1fhDH5EGztiIuU0gwZFTYQcUXs=
X-Google-Smtp-Source: APBJJlF/KBdRbu0e76cuugkP8ByA4765ArItcCVhDA6i3s1jADWCfzlbshzN6elxh9x7UatCJcYq5w==
X-Received: by 2002:a05:622a:1752:b0:403:ce1f:fd51 with SMTP id l18-20020a05622a175200b00403ce1ffd51mr11348459qtk.55.1690203573116;
        Mon, 24 Jul 2023 05:59:33 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v6 06/15] cpufreq: Add Hardware P-State (HWP) driver
Date: Mon, 24 Jul 2023 08:58:48 -0400
Message-ID: <20230724125857.11133-7-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230724125857.11133-1-jandryuk@gmail.com>
References: <20230724125857.11133-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

>From the Intel SDM: "Hardware-Controlled Performance States (HWP), which
autonomously selects performance states while utilizing OS supplied
performance guidance hints."

Enable HWP to run in autonomous mode by poking the correct MSRs.  HWP is
disabled by default, and cpufreq=hwp enables it.

cpufreq= parsing is expanded to allow cpufreq=hwp;xen.  This allows
trying HWP and falling back to xen if not available.  Only hwp and xen
are supported for this fallback feature.  hdc is a sub-option under hwp
(i.e.  cpufreq=hwp,hdc=0) as is verbose.

There is no interface to configure - xen_sysctl_pm_op/xenpm will
be extended to configure in subsequent patches.  It will run with the
default values, which should be the default 0x80 (out of 0x0-0xff)
energy/performance preference.

Unscientific powertop measurement of an mostly idle, customized OpenXT
install:
A 10th gen 6-core laptop showed battery discharge drop from ~9.x to
~7.x watts.
A 8th gen 4-core laptop dropped from ~10 to ~9

Power usage depends on many factors, especially display brightness, but
this does show a power saving in balanced mode when CPU utilization is
low.

HWP isn't compatible with an external governor - it doesn't take
explicit frequency requests.  Therefore a minimal internal governor,
hwp, is also added as a placeholder.

While adding to the xen-command-line.pandoc entry, un-nest verbose from
minfreq.  They are independent.

With cpufreq=hwp,verbose, HWP prints processor capabilities that are not
used by the code, like HW_FEEDBACK.  This is done because otherwise
there isn't a convenient way to query the information.

Xen doesn't use the HWP interrupt, so it is disabled like in the Linux
pstate driver.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
We disable on cpuid_level < 0x16.  cpuid(0x16) is used to get the cpu
frequencies for calculating the APERF/MPERF.  Without it, things would
still work, but the average cpu frequency output would be wrong.

My 8th & 10th gen test systems both report:
(XEN) HWP: 1 notify: 1 act_window: 1 energy_perf: 1 pkg_level: 0 peci: 0
(XEN) HWP: Hardware Duty Cycling (HDC) supported
(XEN) HWP: HW_FEEDBACK not supported

We can't use parse_boolean() since it requires a single name=val string
and cpufreq_handle_common_option is provided two strings.  Use
parse_bool() and manual handle no-hwp.

FAST_IA32_HWP_REQUEST was removed in v2.  The check in v1 was wrong,
it's a model specific feature and the CPUID bit is only available
after enabling via the MSR.  Support was untested since I don't have
hardware with the feature.  Writes are expected to be infrequent, so
just leave it out.

---
v2:
Alphabetize headers
Re-work driver registration
name hwp_drv_data anonymous union "hw"
Drop hwp_verbose_cont
style cleanups
Condense hwp_governor switch
hwp_cpufreq_target remove .raw from hwp_req assignment
Use typed-pointer in a few functions
Pass type to xzalloc
Add HWP_ENERGY_PERF_BALANCE/IA32_ENERGY_BIAS_BALANCE defines
Add XEN_HWP_GOVERNOR define for "hwp-internal"
Capitalize CPUID and MSR defines
Change '_' to '-' for energy-perf & act-window
Read-modify-write MSRs updates
Use FAST_IA32_HWP_REQUEST_MSR_ENABLE define
constify pointer in hwp_set_misc_turbo
Add space after non-fallthrough break in governor switch
Add IA32_ENERGY_BIAS_MASK define
Check CPUID_PM_LEAK for energy bias when needed
Fail initialization with curr_req = -1
Fold hwp_read_capabilities into hwp_init_msrs
Add command line cpufreq=xen:hwp
Add command line cpufreq=xen:hdc
Use per_cpu for hwp_drv_data pointers
Move hwp_energy_perf_bias call into hwp_write_request
energy_perf 0 is valid, so hwp_energy_perf_bias cannot be skipped
Ensure we don't generate interrupts
Remove Fast Write of Uncore MSR
Initialize hwp_drv_data from curr_req
Use SPDX line instead of license text in hwp.c

v3:
Add cf_check to cpufreq_gov_hwp_init() - Marek
Print cpuid_level with %#x - Marek

v4:
Use BIT() for CPUID and MSR bits
Move __initdata after type
Add __ro_after_init to feature_*
Remove aperf/mperf comment
Move feature_hwp_energy_perf { to newline
Remove _IA32_ infix
Use unsigned int & bool for bitfields
Require energy perf pref (Remove ENERGY_PERF_BIAS support)
Initialize activity_window
Return errors on wrmsr failure
Change command line to: cpufreq=xen:hwp
Move hdc into the hwp-specific handle_options
Drop feature_hwp_energy_perf, feature_hwp_pkg_level_ctl & feature_hwp_peci
Print features before exiting when energy/performance preference isn't available
Disable HWP MSR on initialization error
Change hwp_ print macros to add prefixes
Disable HDC when hdc=0 - (opt_hdc no longer initdata)
Mark hwp governor internal and use "hwp" name
Add XEN_HWP_DRIVER
Use top-level cpufreq=hwp command line option
Document that cpufreq=hwp falls back to cpufreq=xen without hardware
Add SPDX suffix GPL-2.0-only

v5:
Use _AC() macro in MSR_IA32_MISC_ENABLE_TURBO_DISENGAGE definition
hwp_err arg re-ordering
Use XEN_HWP_DRIVER_NAME
Use cpufreq.h for all declarations
Clear feature_hdc on failure and print a message
Use unnamed bitfields instead of reservered
Remove asm/io.h include
static DEFINE_PER_CPU_READ_MOSTLY(struct hwp_drv_data
Remove some empty newlines
Align feature_hdc assignment
Remove feature_hwp
Remove unnecesary return at end of void hwp_init_msrs()
BUILD_BUG_ON member variable
Reformat a compound if
Clear pre_cpu hwp_drv_data before xfree()
Only print HWP capabilities for CPU 0
Specify processor models in turbo comment
Use arg[1] in setup_cpufreq_option()
Remove some log messages
Drop double newline
Parse verbose as a boolean instead of the custom parsing.
Support cpufreq=hwp;xen fallback
Call hwp_available() from hwp_register_driver()
Move cpufreq_govenor_internal setting to hwp_register_driver

v6:
docs: mention verbose applies to both.
Use cpufreq=hwp;xen,verbose example with verbose at then end.
Declare induction i inside for loop
Add CPUFREQ_none
Only call cpufreq fallback for -ENODEV
Brace on newline fixes
hdc_set_pkg_hdc_ctl()/hdc_set_pm_ctl1() return boolean
Continue without hdc
Consolidate hdc if statement
Use hwp_req variable for BUILD_BUG_ON
Newline between declarations and statement
__initdata for cpufreq_xen_opts/cpufreq_xen_cnt
Only print HWP_REQUEST when differing from BSP.
Remove MSR_PM_ENABLE printing
Move hdc_set_pkg_hdc_ctl(), hdc_set_pm_ctl1(), hwp_get_cpu_speeds(), and
  hwp_init_msrs() to before their sole caller, hwp_cpufreq_cpu_init()
Fix cpufreq= parsing without options (set ret=0)
Drop stray s NULL check
Return -EINVAL from hwp_cmdline_parse()
Latch first CPU HWP request and print differences
Use strpbrk to split on ',' or ':' for arg in xen/hwp do..while
Limit hwp parsing error to just current option with %.*s and (end ?: e) - s
docs: Expand and clarify the handling of `verbose` with cpufreq fallbacks.
---
 docs/misc/xen-command-line.pandoc     |  20 +-
 xen/arch/x86/acpi/cpufreq/Makefile    |   1 +
 xen/arch/x86/acpi/cpufreq/cpufreq.c   |  21 +-
 xen/arch/x86/acpi/cpufreq/hwp.c       | 521 ++++++++++++++++++++++++++
 xen/arch/x86/include/asm/cpufeature.h |  12 +-
 xen/arch/x86/include/asm/msr-index.h  |  15 +-
 xen/drivers/cpufreq/cpufreq.c         |  59 ++-
 xen/include/acpi/cpufreq/cpufreq.h    |  10 +
 xen/include/public/sysctl.h           |   2 +
 9 files changed, 646 insertions(+), 15 deletions(-)
 create mode 100644 xen/arch/x86/acpi/cpufreq/hwp.c

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 4060ebdc5d..f77542de47 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -499,7 +499,7 @@ If set, force use of the performance counters for oprofile, rather than detectin
 available support.
 
 ### cpufreq
-> `= none | {{ <boolean> | xen } [:[powersave|performance|ondemand|userspace][,<maxfreq>][,[<minfreq>][,[verbose]]]]} | dom0-kernel`
+> `= none | {{ <boolean> | xen } { [:[powersave|performance|ondemand|userspace][,[<maxfreq>]][,[<minfreq>]]] } [,verbose]} | dom0-kernel | hwp[:[<hdc>][,verbose]]`
 
 > Default: `xen`
 
@@ -510,6 +510,24 @@ choice of `dom0-kernel` is deprecated and not supported by all Dom0 kernels.
 * `<maxfreq>` and `<minfreq>` are integers which represent max and min processor frequencies
   respectively.
 * `verbose` option can be included as a string or also as `verbose=<integer>`
+  for `xen`.  It is a boolean for `hwp`.
+* `hwp` selects Hardware-Controlled Performance States (HWP) on supported Intel
+  hardware.  HWP is a Skylake+ feature which provides better CPU power
+  management.  The default is disabled.  If `hwp` is selected, but hardware
+  support is not available, Xen will fallback to cpufreq=xen.
+* `<hdc>` is a boolean to enable Hardware Duty Cycling (HDC).  HDC enables the
+  processor to autonomously force physical package components into idle state.
+  The default is enabled, but the option only applies when `hwp` is enabled.
+
+There is also support for `;`-separated fallback options:
+`cpufreq=hwp;xen,verbose`.  This first tries `hwp` and falls back to `xen` if
+unavailable.  Note: The `verbose` suboption is handled globally.  Setting it
+for either the primary or fallback option applies to both irrespective of where
+it is specified.
+
+Note: grub2 requires to escape or quote ';', so `"cpufreq=hwp;xen"` should be
+specified within double quotes inside grub.cfg.  Refer to the grub2
+documentation for more information.
 
 ### cpuid (x86)
 > `= List of comma separated booleans`
diff --git a/xen/arch/x86/acpi/cpufreq/Makefile b/xen/arch/x86/acpi/cpufreq/Makefile
index f75da9b9ca..db83aa6b14 100644
--- a/xen/arch/x86/acpi/cpufreq/Makefile
+++ b/xen/arch/x86/acpi/cpufreq/Makefile
@@ -1,2 +1,3 @@
 obj-y += cpufreq.o
+obj-y += hwp.o
 obj-y += powernow.o
diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index f1cc473b4f..61b62c370a 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -642,7 +642,26 @@ static int __init cf_check cpufreq_driver_init(void)
         switch ( boot_cpu_data.x86_vendor )
         {
         case X86_VENDOR_INTEL:
-            ret = cpufreq_register_driver(&acpi_cpufreq_driver);
+            ret = -ENOENT;
+
+            for ( unsigned int i = 0; i < cpufreq_xen_cnt; i++ )
+            {
+                switch ( cpufreq_xen_opts[i] )
+                {
+                case CPUFREQ_xen:
+                    ret = cpufreq_register_driver(&acpi_cpufreq_driver);
+                    break;
+                case CPUFREQ_hwp:
+                    ret = hwp_register_driver();
+                    break;
+                case CPUFREQ_none:
+                    ret = 0;
+                    break;
+                }
+
+                if ( ret != -ENODEV )
+                    break;
+            }
             break;
 
         case X86_VENDOR_AMD:
diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
new file mode 100644
index 0000000000..3b042aefd5
--- /dev/null
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -0,0 +1,521 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * hwp.c cpufreq driver to run Intel Hardware P-States (HWP)
+ *
+ * Copyright (C) 2021 Jason Andryuk <jandryuk@gmail.com>
+ */
+
+#include <xen/cpumask.h>
+#include <xen/init.h>
+#include <xen/param.h>
+#include <xen/xmalloc.h>
+#include <asm/msr.h>
+#include <acpi/cpufreq/cpufreq.h>
+
+static bool __ro_after_init feature_hwp_notification;
+static bool __ro_after_init feature_hwp_activity_window;
+
+static bool __ro_after_init feature_hdc;
+
+static bool __ro_after_init opt_cpufreq_hdc = true;
+
+union hwp_request
+{
+    struct
+    {
+        unsigned int min_perf:8;
+        unsigned int max_perf:8;
+        unsigned int desired:8;
+        unsigned int energy_perf:8;
+        unsigned int activity_window:10;
+        bool package_control:1;
+        unsigned int :16;
+        bool activity_window_valid:1;
+        bool energy_perf_valid:1;
+        bool desired_valid:1;
+        bool max_perf_valid:1;
+        bool min_perf_valid:1;
+    };
+    uint64_t raw;
+};
+
+struct hwp_drv_data
+{
+    union
+    {
+        uint64_t hwp_caps;
+        struct
+        {
+            unsigned int highest:8;
+            unsigned int guaranteed:8;
+            unsigned int most_efficient:8;
+            unsigned int lowest:8;
+            unsigned int :32;
+        } hw;
+    };
+    union hwp_request curr_req;
+    int ret;
+    uint16_t activity_window;
+    uint8_t minimum;
+    uint8_t maximum;
+    uint8_t desired;
+    uint8_t energy_perf;
+};
+static DEFINE_PER_CPU_READ_MOSTLY(struct hwp_drv_data *, hwp_drv_data);
+
+#define hwp_err(cpu, fmt, ...) \
+    printk(XENLOG_ERR "HWP: CPU%u error: " fmt, cpu, ##__VA_ARGS__)
+#define hwp_info(fmt, ...)    printk(XENLOG_INFO "HWP: " fmt, ##__VA_ARGS__)
+#define hwp_verbose(fmt, ...)                             \
+({                                                        \
+    if ( cpufreq_verbose )                                \
+        printk(XENLOG_DEBUG "HWP: " fmt, ##__VA_ARGS__);  \
+})
+
+static int cf_check hwp_governor(struct cpufreq_policy *policy,
+                                 unsigned int event)
+{
+    int ret;
+
+    if ( policy == NULL )
+        return -EINVAL;
+
+    switch ( event )
+    {
+    case CPUFREQ_GOV_START:
+    case CPUFREQ_GOV_LIMITS:
+        ret = 0;
+        break;
+
+    case CPUFREQ_GOV_STOP:
+    default:
+        ret = -EINVAL;
+        break;
+    }
+
+    return ret;
+}
+
+static bool hwp_handle_option(const char *s, const char *end)
+{
+    int ret;
+
+    ret = parse_boolean("verbose", s, end);
+    if ( ret >= 0 )
+    {
+        cpufreq_verbose = ret;
+        return true;
+    }
+
+    ret = parse_boolean("hdc", s, end);
+    if ( ret >= 0 )
+    {
+        opt_cpufreq_hdc = ret;
+        return true;
+    }
+
+    return false;
+}
+
+int __init hwp_cmdline_parse(const char *s, const char *e)
+{
+    do
+    {
+        const char *end = strpbrk(s, ",;");
+
+        if ( !hwp_handle_option(s, end) )
+        {
+            printk(XENLOG_WARNING "cpufreq/hwp: option '%.*s' not recognized\n",
+                   (int)((end ?: e) - s), s);
+
+            return -EINVAL;
+        }
+
+        s = end ? ++end : end;
+    } while ( s && s < e );
+
+    return 0;
+}
+
+static struct cpufreq_governor cpufreq_gov_hwp =
+{
+    .name          = "hwp",
+    .governor      = hwp_governor,
+};
+
+static int __init cf_check cpufreq_gov_hwp_init(void)
+{
+    if ( !cpufreq_governor_internal )
+        return 0;
+
+    return cpufreq_register_governor(&cpufreq_gov_hwp);
+}
+__initcall(cpufreq_gov_hwp_init);
+
+static bool __init hwp_available(void)
+{
+    unsigned int eax;
+
+    if ( boot_cpu_data.cpuid_level < CPUID_PM_LEAF )
+    {
+        hwp_verbose("cpuid_level (%#x) lacks HWP support\n",
+                    boot_cpu_data.cpuid_level);
+
+        return false;
+    }
+
+    if ( boot_cpu_data.cpuid_level < 0x16 )
+    {
+        hwp_info("HWP disabled: cpuid_level %#x < 0x16 lacks CPU freq info\n",
+                 boot_cpu_data.cpuid_level);
+
+        return false;
+    }
+
+    eax = cpuid_eax(CPUID_PM_LEAF);
+
+    hwp_verbose("%d notify: %d act-window: %d energy-perf: %d pkg-level: %d peci: %d\n",
+                !!(eax & CPUID6_EAX_HWP),
+                !!(eax & CPUID6_EAX_HWP_NOTIFICATION),
+                !!(eax & CPUID6_EAX_HWP_ACTIVITY_WINDOW),
+                !!(eax & CPUID6_EAX_HWP_ENERGY_PERFORMANCE_PREFERENCE),
+                !!(eax & CPUID6_EAX_HWP_PACKAGE_LEVEL_REQUEST),
+                !!(eax & CPUID6_EAX_HWP_PECI));
+
+    if ( !(eax & CPUID6_EAX_HWP) )
+        return false;
+
+    if ( !(eax & CPUID6_EAX_HWP_ENERGY_PERFORMANCE_PREFERENCE) )
+    {
+        hwp_verbose("disabled: No energy/performance preference available");
+
+        return false;
+    }
+
+    feature_hwp_notification    = eax & CPUID6_EAX_HWP_NOTIFICATION;
+    feature_hwp_activity_window = eax & CPUID6_EAX_HWP_ACTIVITY_WINDOW;
+    feature_hdc                 = eax & CPUID6_EAX_HDC;
+
+    hwp_verbose("Hardware Duty Cycling (HDC) %ssupported%s\n",
+                feature_hdc ? "" : "not ",
+                feature_hdc ? opt_cpufreq_hdc ? ", enabled" : ", disabled"
+                            : "");
+
+    hwp_verbose("HW_FEEDBACK %ssupported\n",
+                (eax & CPUID6_EAX_HW_FEEDBACK) ? "" : "not ");
+
+    hwp_info("Using HWP for cpufreq\n");
+
+    return true;
+}
+
+static int cf_check hwp_cpufreq_verify(struct cpufreq_policy *policy)
+{
+    struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
+
+    if ( !feature_hwp_activity_window && data->activity_window )
+    {
+        hwp_verbose("HWP activity window not supported\n");
+
+        return -EINVAL;
+    }
+
+    return 0;
+}
+
+static void cf_check hwp_write_request(void *info)
+{
+    const struct cpufreq_policy *policy = info;
+    struct hwp_drv_data *data = this_cpu(hwp_drv_data);
+    union hwp_request hwp_req = data->curr_req;
+
+    data->ret = 0;
+
+    BUILD_BUG_ON(sizeof(hwp_req) != sizeof(hwp_req.raw));
+    if ( wrmsr_safe(MSR_HWP_REQUEST, hwp_req.raw) )
+    {
+        hwp_verbose("CPU%u: error wrmsr_safe(MSR_HWP_REQUEST, %lx)\n",
+                    policy->cpu, hwp_req.raw);
+        rdmsr_safe(MSR_HWP_REQUEST, data->curr_req.raw);
+        data->ret = -EINVAL;
+    }
+}
+
+static int cf_check hwp_cpufreq_target(struct cpufreq_policy *policy,
+                                       unsigned int target_freq,
+                                       unsigned int relation)
+{
+    unsigned int cpu = policy->cpu;
+    struct hwp_drv_data *data = per_cpu(hwp_drv_data, cpu);
+    /* Zero everything to ensure reserved bits are zero... */
+    union hwp_request hwp_req = { .raw = 0 };
+
+    /* .. and update from there */
+    hwp_req.min_perf = data->minimum;
+    hwp_req.max_perf = data->maximum;
+    hwp_req.desired = data->desired;
+    hwp_req.energy_perf = data->energy_perf;
+    if ( feature_hwp_activity_window )
+        hwp_req.activity_window = data->activity_window;
+
+    if ( hwp_req.raw == data->curr_req.raw )
+        return 0;
+
+    data->curr_req = hwp_req;
+
+    on_selected_cpus(cpumask_of(cpu), hwp_write_request, policy, 1);
+
+    return data->ret;
+}
+
+static bool hdc_set_pkg_hdc_ctl(unsigned int cpu, bool val)
+{
+    uint64_t msr;
+
+    if ( rdmsr_safe(MSR_PKG_HDC_CTL, msr) )
+    {
+        hwp_err(cpu, "rdmsr_safe(MSR_PKG_HDC_CTL)\n");
+        return false;
+    }
+
+    if ( val )
+        msr |= PKG_HDC_CTL_HDC_PKG_ENABLE;
+    else
+        msr &= ~PKG_HDC_CTL_HDC_PKG_ENABLE;
+
+    if ( wrmsr_safe(MSR_PKG_HDC_CTL, msr) )
+    {
+        hwp_err(cpu, "wrmsr_safe(MSR_PKG_HDC_CTL): %016lx\n", msr);
+        return false;
+    }
+
+    return true;
+}
+
+static bool hdc_set_pm_ctl1(unsigned int cpu, bool val)
+{
+    uint64_t msr;
+
+    if ( rdmsr_safe(MSR_PM_CTL1, msr) )
+    {
+        hwp_err(cpu, "rdmsr_safe(MSR_PM_CTL1)\n");
+        return false;
+    }
+
+    if ( val )
+        msr |= PM_CTL1_HDC_ALLOW_BLOCK;
+    else
+        msr &= ~PM_CTL1_HDC_ALLOW_BLOCK;
+
+    if ( wrmsr_safe(MSR_PM_CTL1, msr) )
+    {
+        hwp_err(cpu, "wrmsr_safe(MSR_PM_CTL1): %016lx\n", msr);
+        return false;
+    }
+
+    return true;
+}
+
+static void hwp_get_cpu_speeds(struct cpufreq_policy *policy)
+{
+    uint32_t base_khz, max_khz, bus_khz, edx;
+
+    cpuid(0x16, &base_khz, &max_khz, &bus_khz, &edx);
+
+    policy->cpuinfo.perf_freq = base_khz * 1000;
+    policy->cpuinfo.min_freq = base_khz * 1000;
+    policy->cpuinfo.max_freq = max_khz * 1000;
+    policy->min = base_khz * 1000;
+    policy->max = max_khz * 1000;
+    policy->cur = 0;
+}
+
+static void cf_check hwp_init_msrs(void *info)
+{
+    struct cpufreq_policy *policy = info;
+    struct hwp_drv_data *data = this_cpu(hwp_drv_data);
+    uint64_t val;
+
+    /*
+     * Package level MSR, but we don't have a good idea of packages here, so
+     * just do it everytime.
+     */
+    if ( rdmsr_safe(MSR_PM_ENABLE, val) )
+    {
+        hwp_err(policy->cpu, "rdmsr_safe(MSR_PM_ENABLE)\n");
+        data->curr_req.raw = -1;
+        return;
+    }
+
+    /* Ensure we don't generate interrupts */
+    if ( feature_hwp_notification )
+        wrmsr_safe(MSR_HWP_INTERRUPT, 0);
+
+    if ( !(val & PM_ENABLE_HWP_ENABLE) )
+    {
+        val |= PM_ENABLE_HWP_ENABLE;
+        if ( wrmsr_safe(MSR_PM_ENABLE, val) )
+        {
+            hwp_err(policy->cpu, "wrmsr_safe(MSR_PM_ENABLE, %lx)\n", val);
+            data->curr_req.raw = -1;
+            return;
+        }
+    }
+
+    if ( rdmsr_safe(MSR_HWP_CAPABILITIES, data->hwp_caps) )
+    {
+        hwp_err(policy->cpu, "rdmsr_safe(MSR_HWP_CAPABILITIES)\n");
+        goto error;
+    }
+
+    if ( rdmsr_safe(MSR_HWP_REQUEST, data->curr_req.raw) )
+    {
+        hwp_err(policy->cpu, "rdmsr_safe(MSR_HWP_REQUEST)\n");
+        goto error;
+    }
+
+    /*
+     * Check for APERF/MPERF support in hardware
+     * also check for boost/turbo support
+     */
+    intel_feature_detect(policy);
+
+    if ( feature_hdc &&
+         (!hdc_set_pkg_hdc_ctl(policy->cpu, opt_cpufreq_hdc) ||
+          !hdc_set_pm_ctl1(policy->cpu, opt_cpufreq_hdc)) )
+    {
+            hwp_err(policy->cpu, "Disabling HDC support\n");
+            feature_hdc = false;
+    }
+
+    hwp_get_cpu_speeds(policy);
+
+    return;
+
+ error:
+    data->curr_req.raw = -1;
+    val &= ~PM_ENABLE_HWP_ENABLE;
+    if ( wrmsr_safe(MSR_PM_ENABLE, val) )
+        hwp_err(policy->cpu, "wrmsr_safe(MSR_PM_ENABLE, %lx)\n", val);
+}
+
+static int cf_check hwp_cpufreq_cpu_init(struct cpufreq_policy *policy)
+{
+    static union hwp_request initial_req;
+    unsigned int cpu = policy->cpu;
+    struct hwp_drv_data *data;
+    bool first_run = false;
+
+    data = xzalloc(struct hwp_drv_data);
+    if ( !data )
+        return -ENOMEM;
+
+    policy->governor = &cpufreq_gov_hwp;
+
+    per_cpu(hwp_drv_data, cpu) = data;
+
+    on_selected_cpus(cpumask_of(cpu), hwp_init_msrs, policy, 1);
+
+    if ( data->curr_req.raw == -1 )
+    {
+        hwp_err(cpu, "Could not initialize HWP properly\n");
+        per_cpu(hwp_drv_data, cpu) = NULL;
+        xfree(data);
+        return -ENODEV;
+    }
+
+    data->minimum = data->curr_req.min_perf;
+    data->maximum = data->curr_req.max_perf;
+    data->desired = data->curr_req.desired;
+    data->energy_perf = data->curr_req.energy_perf;
+    data->activity_window = data->curr_req.activity_window;
+
+    if ( initial_req.raw == 0 )
+    {
+        hwp_verbose("CPU%u: HWP_CAPABILITIES: %016lx\n", cpu, data->hwp_caps);
+        initial_req = data->curr_req;
+        first_run = true;
+    }
+
+    if ( first_run || data->curr_req.raw != initial_req.raw )
+        hwp_verbose("CPU%u: rdmsr HWP_REQUEST %016lx\n", cpu,
+                    data->curr_req.raw);
+
+    return 0;
+}
+
+static int cf_check hwp_cpufreq_cpu_exit(struct cpufreq_policy *policy)
+{
+    struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
+
+    per_cpu(hwp_drv_data, policy->cpu) = NULL;
+    xfree(data);
+
+    return 0;
+}
+
+/*
+ * The SDM reads like turbo should be disabled with MSR_IA32_PERF_CTL and
+ * PERF_CTL_TURBO_DISENGAGE, but that does not seem to actually work, at least
+ * with testing on i7-10810U and i7-8550U.  MSR_MISC_ENABLE and
+ * MISC_ENABLE_TURBO_DISENGAGE is what Linux uses and seems to work.
+ */
+static void cf_check hwp_set_misc_turbo(void *info)
+{
+    const struct cpufreq_policy *policy = info;
+    struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
+    uint64_t msr;
+
+    data->ret = 0;
+
+    if ( rdmsr_safe(MSR_IA32_MISC_ENABLE, msr) )
+    {
+        hwp_verbose("CPU%u: error rdmsr_safe(MSR_IA32_MISC_ENABLE)\n",
+                    policy->cpu);
+        data->ret = -EINVAL;
+
+        return;
+    }
+
+    if ( policy->turbo == CPUFREQ_TURBO_ENABLED )
+        msr &= ~MSR_IA32_MISC_ENABLE_TURBO_DISENGAGE;
+    else
+        msr |= MSR_IA32_MISC_ENABLE_TURBO_DISENGAGE;
+
+    if ( wrmsr_safe(MSR_IA32_MISC_ENABLE, msr) )
+    {
+        hwp_verbose("CPU%u: error wrmsr_safe(MSR_IA32_MISC_ENABLE): %016lx\n",
+                    policy->cpu, msr);
+        data->ret = -EINVAL;
+    }
+}
+
+static int cf_check hwp_cpufreq_update(int cpuid, struct cpufreq_policy *policy)
+{
+    on_selected_cpus(cpumask_of(cpuid), hwp_set_misc_turbo, policy, 1);
+
+    return per_cpu(hwp_drv_data, cpuid)->ret;
+}
+
+static const struct cpufreq_driver __initconstrel hwp_cpufreq_driver =
+{
+    .name   = XEN_HWP_DRIVER_NAME,
+    .verify = hwp_cpufreq_verify,
+    .target = hwp_cpufreq_target,
+    .init   = hwp_cpufreq_cpu_init,
+    .exit   = hwp_cpufreq_cpu_exit,
+    .update = hwp_cpufreq_update,
+};
+
+int __init hwp_register_driver(void)
+{
+    int ret;
+
+    if ( !hwp_available() )
+        return -ENODEV;
+
+    ret = cpufreq_register_driver(&hwp_cpufreq_driver);
+    cpufreq_governor_internal = (ret == 0);
+
+    return ret;
+}
diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h
index 64e1dad225..93466441f5 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -52,8 +52,16 @@ static inline bool boot_cpu_has(unsigned int feat)
     return cpu_has(&boot_cpu_data, feat);
 }
 
-#define CPUID_PM_LEAF                    6
-#define CPUID6_ECX_APERFMPERF_CAPABILITY 0x1
+#define CPUID_PM_LEAF                                6
+#define CPUID6_EAX_HWP                               BIT(7, U)
+#define CPUID6_EAX_HWP_NOTIFICATION                  BIT(8, U)
+#define CPUID6_EAX_HWP_ACTIVITY_WINDOW               BIT(9, U)
+#define CPUID6_EAX_HWP_ENERGY_PERFORMANCE_PREFERENCE BIT(10, U)
+#define CPUID6_EAX_HWP_PACKAGE_LEVEL_REQUEST         BIT(11, U)
+#define CPUID6_EAX_HDC                               BIT(13, U)
+#define CPUID6_EAX_HWP_PECI                          BIT(16, U)
+#define CPUID6_EAX_HW_FEEDBACK                       BIT(19, U)
+#define CPUID6_ECX_APERFMPERF_CAPABILITY             BIT(0, U)
 
 /* CPUID level 0x00000001.edx */
 #define cpu_has_fpu             1
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 2382fc8e11..56f93cb8e2 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -151,6 +151,13 @@
 
 #define MSR_PKRS                            0x000006e1
 
+#define MSR_PM_ENABLE                       0x00000770
+#define  PM_ENABLE_HWP_ENABLE               BIT(0, ULL)
+
+#define MSR_HWP_CAPABILITIES                0x00000771
+#define MSR_HWP_INTERRUPT                   0x00000773
+#define MSR_HWP_REQUEST                     0x00000774
+
 #define MSR_X2APIC_FIRST                    0x00000800
 #define MSR_X2APIC_LAST                     0x000008ff
 
@@ -165,6 +172,11 @@
 #define  PASID_PASID_MASK                   0x000fffff
 #define  PASID_VALID                        (_AC(1, ULL) << 31)
 
+#define MSR_PKG_HDC_CTL                     0x00000db0
+#define  PKG_HDC_CTL_HDC_PKG_ENABLE         BIT(0, ULL)
+#define MSR_PM_CTL1                         0x00000db1
+#define  PM_CTL1_HDC_ALLOW_BLOCK            BIT(0, ULL)
+
 #define MSR_UARCH_MISC_CTRL                 0x00001b01
 #define  UARCH_CTRL_DOITM                   (_AC(1, ULL) <<  0)
 
@@ -466,7 +478,8 @@
 #define MSR_IA32_MISC_ENABLE_MONITOR_ENABLE (1<<18)
 #define MSR_IA32_MISC_ENABLE_LIMIT_CPUID  (1<<22)
 #define MSR_IA32_MISC_ENABLE_XTPR_DISABLE (1<<23)
-#define MSR_IA32_MISC_ENABLE_XD_DISABLE   (_AC(1, ULL) << 34)
+#define MSR_IA32_MISC_ENABLE_XD_DISABLE      (_AC(1, ULL) << 34)
+#define MSR_IA32_MISC_ENABLE_TURBO_DISENGAGE (_AC(1, ULL) << 38)
 
 #define MSR_IA32_TSC_DEADLINE		0x000006E0
 #define MSR_IA32_ENERGY_PERF_BIAS	0x000001b0
diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 67a58d409b..55aa36a045 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -63,12 +63,19 @@ LIST_HEAD_READ_MOSTLY(cpufreq_governor_list);
 /* set xen as default cpufreq */
 enum cpufreq_controller cpufreq_controller = FREQCTL_xen;
 
-static int __init cpufreq_cmdline_parse(const char *s);
+enum cpufreq_xen_opt __initdata cpufreq_xen_opts[2] = { CPUFREQ_xen,
+                                                        CPUFREQ_none };
+unsigned int __initdata cpufreq_xen_cnt = 1;
+
+static int __init cpufreq_cmdline_parse(const char *s, const char *e);
 
 static int __init cf_check setup_cpufreq_option(const char *str)
 {
-    const char *arg = strpbrk(str, ",:");
+    const char *arg = strpbrk(str, ",:;");
     int choice;
+    int ret = -EINVAL;
+
+    cpufreq_xen_cnt = 0;
 
     if ( !arg )
         arg = strchr(str, '\0');
@@ -89,15 +96,45 @@ static int __init cf_check setup_cpufreq_option(const char *str)
         return 0;
     }
 
-    if ( choice > 0 || !cmdline_strcmp(str, "xen") )
+    do
     {
-        xen_processor_pmbits |= XEN_PROCESSOR_PM_PX;
-        cpufreq_controller = FREQCTL_xen;
-        if ( *arg && *(arg + 1) )
-            return cpufreq_cmdline_parse(arg + 1);
-    }
+        const char *end = strchr(str, ';');
+
+        if ( end == NULL )
+            end = strchr(str, '\0');
+
+        arg = strpbrk(str, ",:");
+        if ( !arg || arg > end )
+            arg = strchr(str, '\0');
+
+        if ( cpufreq_xen_cnt == ARRAY_SIZE(cpufreq_xen_opts) )
+            return -E2BIG;
+
+        if ( choice > 0 || !cmdline_strcmp(str, "xen") )
+        {
+            xen_processor_pmbits |= XEN_PROCESSOR_PM_PX;
+            cpufreq_controller = FREQCTL_xen;
+            cpufreq_xen_opts[cpufreq_xen_cnt++] = CPUFREQ_xen;
+            ret = 0;
+            if ( arg[0] && arg[1] )
+                ret = cpufreq_cmdline_parse(arg + 1, end);
+        }
+        else if ( choice < 0 && !cmdline_strcmp(str, "hwp") )
+        {
+            xen_processor_pmbits |= XEN_PROCESSOR_PM_PX;
+            cpufreq_controller = FREQCTL_xen;
+            cpufreq_xen_opts[cpufreq_xen_cnt++] = CPUFREQ_hwp;
+            ret = 0;
+            if ( arg[0] && arg[1] )
+                ret = hwp_cmdline_parse(arg + 1, end);
+        }
+        else
+            ret = -EINVAL;
+
+        str = end ? ++end : end;
+    } while ( choice < 0 && ret == 0 && *str );
 
-    return (choice < 0) ? -EINVAL : 0;
+    return (choice < 0) ? ret : 0;
 }
 custom_param("cpufreq", setup_cpufreq_option);
 
@@ -576,7 +613,7 @@ static int __init cpufreq_handle_common_option(const char *name, const char *val
     return 0;
 }
 
-static int __init cpufreq_cmdline_parse(const char *s)
+static int __init cpufreq_cmdline_parse(const char *s, const char *e)
 {
     static struct cpufreq_governor *__initdata cpufreq_governors[] =
     {
@@ -592,6 +629,8 @@ static int __init cpufreq_cmdline_parse(const char *s)
     int rc = 0;
 
     strlcpy(buf, s, sizeof(buf));
+    if (e - s < sizeof(buf))
+        buf[e - s] = '\0';
     do {
         char *val, *end = strchr(str, ',');
         unsigned int i;
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 482ea5b0de..cfe975814e 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -24,6 +24,13 @@ DECLARE_PER_CPU(spinlock_t, cpufreq_statistic_lock);
 
 extern bool_t cpufreq_verbose;
 
+enum cpufreq_xen_opt {
+    CPUFREQ_none,
+    CPUFREQ_xen,
+    CPUFREQ_hwp,
+};
+extern enum cpufreq_xen_opt cpufreq_xen_opts[2];
+extern unsigned int cpufreq_xen_cnt;
 struct cpufreq_governor;
 
 struct acpi_cpufreq_data {
@@ -245,4 +252,7 @@ void cpufreq_dbs_timer_resume(void);
 
 void intel_feature_detect(struct cpufreq_policy *policy);
 
+int hwp_cmdline_parse(const char *s, const char *e);
+int hwp_register_driver(void);
+
 #endif /* __XEN_CPUFREQ_PM_H__ */
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index c11c0b1a6c..5a30b16fcf 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -296,6 +296,8 @@ struct xen_ondemand {
     uint32_t up_threshold;
 };
 
+#define XEN_HWP_DRIVER_NAME "hwp"
+
 /*
  * cpufreq para name of this structure named
  * same as sysfs file name of native linux
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:59:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:59:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568920.889083 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvA3-0005uY-In; Mon, 24 Jul 2023 12:59:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568920.889083; Mon, 24 Jul 2023 12:59:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvA3-0005uH-FT; Mon, 24 Jul 2023 12:59:39 +0000
Received: by outflank-mailman (input) for mailman id 568920;
 Mon, 24 Jul 2023 12:59:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ymW7=DK=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qNvA2-0005PS-4m
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:59:38 +0000
Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com
 [2607:f8b0:4864:20::831])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f1825718-2a21-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 14:59:37 +0200 (CEST)
Received: by mail-qt1-x831.google.com with SMTP id
 d75a77b69052e-4053cc10debso25745371cf.2
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 05:59:37 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 d3-20020ac81183000000b00402364e77dcsm3273060qtj.7.2023.07.24.05.59.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 05:59:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f1825718-2a21-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690203576; x=1690808376;
        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=KxfVmmmioL2/gxKeJ4GHvriusiFJ0dvjUrMcXz/9+Ls=;
        b=iJ/fmQDyYhTRUdH3K2sKGhPtAhPrKWqTy2sR6LX1uxGC2rC4M16Ho88+POnkyJ73r6
         lqDdW+kZ2dPfcFjHwLF82SJUcE+mxXLFyp66dp7fru1dqHQiFDeLe4BteLGygSSwuj8m
         QIRlG9mDVOBHGGvwjVS/Qhto0s+7OiR9sn7KWlCMIkmoLPxohemLtDgyU4AoN/KTxNkK
         LCHBvX/LNg3W3aYFX+Ew3lGGrKIBIybmjIB2FB0ykK+hQ9hW/G/xfmYTqYj/o07seuC+
         Mugdwwz2ZsxOrR39Ll0kpLC1BDgKPXst8Y40q5hf3v6j74B70yKWRIAv835PQ0OpMVir
         i4aA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690203576; x=1690808376;
        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=KxfVmmmioL2/gxKeJ4GHvriusiFJ0dvjUrMcXz/9+Ls=;
        b=WZJDRgoggIM6XVM4hJBCbuzjtFTSZe6+rEHMddKiU/rztlTqxVepcZYcDP2m3x89Ex
         Q2NKbb2WPrj09rsbzu9yMu7FrgQfR0XLqCnLIHTLX2srKg77hAOhU2f0jrY5wOi20DxP
         NHDU9+XH85/jpBoqV8sSSAnhmJ68ykNo+Gsy5Vs/68ftbGOUu0QlugI472miVimVbD2m
         hKcospke2ApY+FVrki7B498dE3+WcGv7HlqWwoH2UT3JHsITtuMK2UyItHiFMZ/41wos
         Q69vOq5kyDf4nOE86O1Bb3M1Sc/KsIAjNgxNrgWoa7u9/i5O9TlkJXHcJKQkKki4BSp+
         chsw==
X-Gm-Message-State: ABy/qLYtRDEWz6A18tOkgUXLHwHJRbd09pCurgKYfzxJQyDY/EOCa+cI
	Hk8S10xdY6poByli6WTXnxFQQ3czN7s=
X-Google-Smtp-Source: APBJJlFAnPPumKlbi61vjbPyvtpYqNAJzo7qH5qB96Uwg5Zwph9GHgLSaIAeA/OIxWFMPmsKVXMb7A==
X-Received: by 2002:ac8:5c94:0:b0:403:2dc0:e895 with SMTP id r20-20020ac85c94000000b004032dc0e895mr9030452qta.59.1690203575860;
        Mon, 24 Jul 2023 05:59:35 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v6 07/15] xen/x86: Tweak PDC bits when using HWP
Date: Mon, 24 Jul 2023 08:58:49 -0400
Message-ID: <20230724125857.11133-8-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230724125857.11133-1-jandryuk@gmail.com>
References: <20230724125857.11133-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Qubes testing of HWP support had a report of a laptop, Thinkpad X1
Carbon Gen 4 with a Skylake processor, locking up during boot when HWP
is enabled.  A user found a kernel bug that seems to be the same issue:
https://bugzilla.kernel.org/show_bug.cgi?id=110941.

That bug was fixed by Linux commit a21211672c9a ("ACPI / processor:
Request native thermal interrupt handling via _OSC").  The tl;dr is SMM
crashes when it receives thermal interrupts, so Linux calls the ACPI
_OSC method to take over interrupt handling.

The Linux fix looks at the CPU features to decide whether or not to call
_OSC with bit 12 set to take over native interrupt handling.  Xen needs
some way to communicate HWP to Dom0 for making an equivalent call.

Xen exposes modified PDC bits via the platform_op set_pminfo hypercall.
Expand that to set bit 12 when HWP is present and in use.

Any generated interrupt would be handled by Xen's thermal drive, which
clears the status.

Bit 12 isn't named in the linux header and is open coded in Linux's
usage.  Name it ACPI_PDC_CPPC_NATIVE_INTR.

This will need a corresponding linux patch to pick up and apply the PDC
bits.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
v5:
Minor fixup for feature_hwp removal
Use cpurfreq.h for declaration

v4:
Added __ro_after_init
s/ACPI_PDC_CPPC_NTV_INT/ACPI_PDC_CPPC_NATIVE_INTR/
Remove _IA32_
Fixup for opt_cpufreq_hwp removal
Add Jan Reviewed-by

v3:
New
---
 xen/arch/x86/acpi/cpufreq/hwp.c      | 9 +++++++++
 xen/arch/x86/acpi/lib.c              | 5 +++++
 xen/arch/x86/cpu/mcheck/mce_intel.c  | 6 ++++++
 xen/arch/x86/include/asm/msr-index.h | 1 +
 xen/include/acpi/cpufreq/cpufreq.h   | 1 +
 xen/include/acpi/pdc_intel.h         | 1 +
 6 files changed, 23 insertions(+)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index 3b042aefd5..662e719039 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -12,6 +12,8 @@
 #include <asm/msr.h>
 #include <acpi/cpufreq/cpufreq.h>
 
+static bool __ro_after_init hwp_in_use;
+
 static bool __ro_after_init feature_hwp_notification;
 static bool __ro_after_init feature_hwp_activity_window;
 
@@ -152,6 +154,11 @@ static int __init cf_check cpufreq_gov_hwp_init(void)
 }
 __initcall(cpufreq_gov_hwp_init);
 
+bool hwp_active(void)
+{
+    return hwp_in_use;
+}
+
 static bool __init hwp_available(void)
 {
     unsigned int eax;
@@ -204,6 +211,8 @@ static bool __init hwp_available(void)
     hwp_verbose("HW_FEEDBACK %ssupported\n",
                 (eax & CPUID6_EAX_HW_FEEDBACK) ? "" : "not ");
 
+    hwp_in_use = true;
+
     hwp_info("Using HWP for cpufreq\n");
 
     return true;
diff --git a/xen/arch/x86/acpi/lib.c b/xen/arch/x86/acpi/lib.c
index 43831b92d1..51cb082ca0 100644
--- a/xen/arch/x86/acpi/lib.c
+++ b/xen/arch/x86/acpi/lib.c
@@ -26,6 +26,8 @@
 #include <asm/fixmap.h>
 #include <asm/mwait.h>
 
+#include <acpi/cpufreq/cpufreq.h>
+
 u32 __read_mostly acpi_smi_cmd;
 u8 __read_mostly acpi_enable_value;
 u8 __read_mostly acpi_disable_value;
@@ -140,5 +142,8 @@ int arch_acpi_set_pdc_bits(u32 acpi_id, u32 *pdc, u32 mask)
 	    !(ecx & CPUID5_ECX_INTERRUPT_BREAK))
 		pdc[2] &= ~(ACPI_PDC_C_C1_FFH | ACPI_PDC_C_C2C3_FFH);
 
+	if (hwp_active())
+		pdc[2] |= ACPI_PDC_CPPC_NATIVE_INTR;
+
 	return 0;
 }
diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index 2f23f02923..4045c6591d 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -15,6 +15,9 @@
 #include <asm/p2m.h>
 #include <asm/mce.h>
 #include <asm/apic.h>
+
+#include <acpi/cpufreq/cpufreq.h>
+
 #include "mce.h"
 #include "x86_mca.h"
 #include "barrier.h"
@@ -64,6 +67,9 @@ static void cf_check intel_thermal_interrupt(struct cpu_user_regs *regs)
 
     ack_APIC_irq();
 
+    if ( hwp_active() )
+        wrmsr_safe(MSR_HWP_STATUS, 0);
+
     if ( NOW() < per_cpu(next, cpu) )
         return;
 
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 56f93cb8e2..f2410fc8c8 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -157,6 +157,7 @@
 #define MSR_HWP_CAPABILITIES                0x00000771
 #define MSR_HWP_INTERRUPT                   0x00000773
 #define MSR_HWP_REQUEST                     0x00000774
+#define MSR_HWP_STATUS                      0x00000777
 
 #define MSR_X2APIC_FIRST                    0x00000800
 #define MSR_X2APIC_LAST                     0x000008ff
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index cfe975814e..6737798e25 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -254,5 +254,6 @@ void intel_feature_detect(struct cpufreq_policy *policy);
 
 int hwp_cmdline_parse(const char *s, const char *e);
 int hwp_register_driver(void);
+bool hwp_active(void);
 
 #endif /* __XEN_CPUFREQ_PM_H__ */
diff --git a/xen/include/acpi/pdc_intel.h b/xen/include/acpi/pdc_intel.h
index 4fb719d6f5..abaa098b51 100644
--- a/xen/include/acpi/pdc_intel.h
+++ b/xen/include/acpi/pdc_intel.h
@@ -17,6 +17,7 @@
 #define ACPI_PDC_C_C1_FFH		(0x0100)
 #define ACPI_PDC_C_C2C3_FFH		(0x0200)
 #define ACPI_PDC_SMP_P_HWCOORD		(0x0800)
+#define ACPI_PDC_CPPC_NATIVE_INTR	(0x1000)
 
 #define ACPI_PDC_EST_CAPABILITY_SMP	(ACPI_PDC_SMP_C1PT | \
 					 ACPI_PDC_C_C1_HALT | \
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:59:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:59:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568922.889093 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvA6-0006PC-Sz; Mon, 24 Jul 2023 12:59:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568922.889093; Mon, 24 Jul 2023 12:59:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvA6-0006Ov-Oq; Mon, 24 Jul 2023 12:59:42 +0000
Received: by outflank-mailman (input) for mailman id 568922;
 Mon, 24 Jul 2023 12:59:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ymW7=DK=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qNvA5-0005PS-K2
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:59:41 +0000
Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com
 [2607:f8b0:4864:20::82f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f303aef8-2a21-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 14:59:40 +0200 (CEST)
Received: by mail-qt1-x82f.google.com with SMTP id
 d75a77b69052e-4039a42467fso31277551cf.3
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 05:59:40 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 d3-20020ac81183000000b00402364e77dcsm3273060qtj.7.2023.07.24.05.59.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 05:59:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f303aef8-2a21-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690203578; x=1690808378;
        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=aw1/CynLpBcgrYjNJfRHcPPsQKW2D4eyDyqElDmf4oI=;
        b=X+V9+qimaGeEq2IG3mPy0vaIQfs9BHl0Xl9qamIBc2t0mi9acZj6eVG9brWsRN/3bH
         DBqgd6UZ4X/76K6uKOEDHOldBt+1zWG0rvyGhZPmj4Npaqh4CuGUunOYLwUKKJBztIDt
         xwewMZYBIsnjdxVqBR7twDB4Y5koE9+o5Rf2Cz4NCuz1I27VZgJvDAnKjLBP3ipYArxZ
         DJ8q2lIuEEmNBXls31Hq+VfGrncGVJomyGI9lFjfp5VRkxsH9W8NYhJUWYvbY6svbplP
         8PsDY7DmivzU3tXaSA6rGWr3+hPJDohxRjRepwMcdLoR7Gt+0elZK7FsGUrAljSdwns9
         pGPg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690203578; x=1690808378;
        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=aw1/CynLpBcgrYjNJfRHcPPsQKW2D4eyDyqElDmf4oI=;
        b=Jhh0IB7Dntx+zye7S1hZnIx3ubN+C2VnbqEY6fbwBxJCA9A2G4P6pV0G0XqbDniRd/
         bmvenID7kzvoIvbMXOiDHN2vGf4970dkeZdwdzqf/mLv5eo8NtKJEac/5nJrSBE43Gdc
         CL/R9HSoGnq9AOqWBkPAhFDpxGY5q+1lRMy4JFrqvvlka3Iq/ZIyepL2PdaIR9IW3hdv
         JannO3ROvpCRRquoGkUn5Ko9mnTKkPFbUWXmCjAXOqDNHAKocNhahazKJ811hYNi70vK
         Z96uinAzQfntqEz049zhchi1uvWrQ5H7nzNNO3KKy2BTODj6cOvu0FbAMJYYqIZZmmbB
         D9dw==
X-Gm-Message-State: ABy/qLazfaCh6P4kkvQc073XQMValafJUPb6c8oJqoB582rrHfS/0YFn
	VXb8+FRanUxa5Xe/NClW8VqkjeGvjc0=
X-Google-Smtp-Source: APBJJlHFNB+Iu0pU6jcWGQQF8qUJI893BZHVXWQjpTL9ssPC69rJ6UFgdDcZnQgM6euWszFNProKfw==
X-Received: by 2002:ac8:5c01:0:b0:406:95b8:6535 with SMTP id i1-20020ac85c01000000b0040695b86535mr4188278qti.48.1690203578329;
        Mon, 24 Jul 2023 05:59:38 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v6 08/15] xenpm: Change get-cpufreq-para output for hwp
Date: Mon, 24 Jul 2023 08:58:50 -0400
Message-ID: <20230724125857.11133-9-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230724125857.11133-1-jandryuk@gmail.com>
References: <20230724125857.11133-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

When using HWP, some of the returned data is not applicable.  In that
case, we should just omit it to avoid confusing the user.  So switch to
printing the base and max frequencies since those are relevant to HWP.
Similarly, stop printing the CPU frequencies since those do not apply.
The scaling fields are also no longer printed.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v5:
Use XEN_HWP_DRIVER_NAME
Add Jan's Ack

v4:
s/turbo/max/
Check for XEN_HWP_DRIVER driver instead of "-internal"

v2:
Use full governor name XEN_HWP_GOVERNOR to change output
Style fixes
---
 tools/misc/xenpm.c | 83 +++++++++++++++++++++++++---------------------
 1 file changed, 46 insertions(+), 37 deletions(-)

diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 1c474c3b59..21c93386de 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -711,6 +711,7 @@ void start_gather_func(int argc, char *argv[])
 /* print out parameters about cpu frequency */
 static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
 {
+    bool hwp = strcmp(p_cpufreq->scaling_driver, XEN_HWP_DRIVER_NAME) == 0;
     int i;
 
     printf("cpu id               : %d\n", cpuid);
@@ -720,49 +721,57 @@ static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
         printf(" %d", p_cpufreq->affected_cpus[i]);
     printf("\n");
 
-    printf("cpuinfo frequency    : max [%u] min [%u] cur [%u]\n",
-           p_cpufreq->cpuinfo_max_freq,
-           p_cpufreq->cpuinfo_min_freq,
-           p_cpufreq->cpuinfo_cur_freq);
+    if ( hwp )
+        printf("cpuinfo frequency    : base [%u] max [%u]\n",
+               p_cpufreq->cpuinfo_min_freq,
+               p_cpufreq->cpuinfo_max_freq);
+    else
+        printf("cpuinfo frequency    : max [%u] min [%u] cur [%u]\n",
+               p_cpufreq->cpuinfo_max_freq,
+               p_cpufreq->cpuinfo_min_freq,
+               p_cpufreq->cpuinfo_cur_freq);
 
     printf("scaling_driver       : %s\n", p_cpufreq->scaling_driver);
 
-    printf("scaling_avail_gov    : %s\n",
-           p_cpufreq->scaling_available_governors);
-
-    printf("current_governor     : %s\n", p_cpufreq->u.s.scaling_governor);
-    if ( !strncmp(p_cpufreq->u.s.scaling_governor,
-                  "userspace", CPUFREQ_NAME_LEN) )
-    {
-        printf("  userspace specific :\n");
-        printf("    scaling_setspeed : %u\n",
-               p_cpufreq->u.s.u.userspace.scaling_setspeed);
-    }
-    else if ( !strncmp(p_cpufreq->u.s.scaling_governor,
-                       "ondemand", CPUFREQ_NAME_LEN) )
+    if ( !hwp )
     {
-        printf("  ondemand specific  :\n");
-        printf("    sampling_rate    : max [%u] min [%u] cur [%u]\n",
-               p_cpufreq->u.s.u.ondemand.sampling_rate_max,
-               p_cpufreq->u.s.u.ondemand.sampling_rate_min,
-               p_cpufreq->u.s.u.ondemand.sampling_rate);
-        printf("    up_threshold     : %u\n",
-               p_cpufreq->u.s.u.ondemand.up_threshold);
-    }
+        printf("scaling_avail_gov    : %s\n",
+               p_cpufreq->scaling_available_governors);
 
-    printf("scaling_avail_freq   :");
-    for ( i = 0; i < p_cpufreq->freq_num; i++ )
-        if ( p_cpufreq->scaling_available_frequencies[i] ==
-             p_cpufreq->u.s.scaling_cur_freq )
-            printf(" *%d", p_cpufreq->scaling_available_frequencies[i]);
-        else
-            printf(" %d", p_cpufreq->scaling_available_frequencies[i]);
-    printf("\n");
+        printf("current_governor     : %s\n", p_cpufreq->u.s.scaling_governor);
+        if ( !strncmp(p_cpufreq->u.s.scaling_governor,
+                      "userspace", CPUFREQ_NAME_LEN) )
+        {
+            printf("  userspace specific :\n");
+            printf("    scaling_setspeed : %u\n",
+                   p_cpufreq->u.s.u.userspace.scaling_setspeed);
+        }
+        else if ( !strncmp(p_cpufreq->u.s.scaling_governor,
+                           "ondemand", CPUFREQ_NAME_LEN) )
+        {
+            printf("  ondemand specific  :\n");
+            printf("    sampling_rate    : max [%u] min [%u] cur [%u]\n",
+                   p_cpufreq->u.s.u.ondemand.sampling_rate_max,
+                   p_cpufreq->u.s.u.ondemand.sampling_rate_min,
+                   p_cpufreq->u.s.u.ondemand.sampling_rate);
+            printf("    up_threshold     : %u\n",
+                   p_cpufreq->u.s.u.ondemand.up_threshold);
+        }
+
+        printf("scaling_avail_freq   :");
+        for ( i = 0; i < p_cpufreq->freq_num; i++ )
+            if ( p_cpufreq->scaling_available_frequencies[i] ==
+                 p_cpufreq->u.s.scaling_cur_freq )
+                printf(" *%d", p_cpufreq->scaling_available_frequencies[i]);
+            else
+                printf(" %d", p_cpufreq->scaling_available_frequencies[i]);
+        printf("\n");
 
-    printf("scaling frequency    : max [%u] min [%u] cur [%u]\n",
-           p_cpufreq->u.s.scaling_max_freq,
-           p_cpufreq->u.s.scaling_min_freq,
-           p_cpufreq->u.s.scaling_cur_freq);
+        printf("scaling frequency    : max [%u] min [%u] cur [%u]\n",
+               p_cpufreq->u.s.scaling_max_freq,
+               p_cpufreq->u.s.scaling_min_freq,
+               p_cpufreq->u.s.scaling_cur_freq);
+    }
 
     printf("turbo mode           : %s\n",
            p_cpufreq->turbo_enabled ? "enabled" : "disabled or n/a");
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:59:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:59:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568925.889103 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvAA-0006tW-7z; Mon, 24 Jul 2023 12:59:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568925.889103; Mon, 24 Jul 2023 12:59:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvAA-0006tM-40; Mon, 24 Jul 2023 12:59:46 +0000
Received: by outflank-mailman (input) for mailman id 568925;
 Mon, 24 Jul 2023 12:59:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ymW7=DK=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qNvA9-0005PS-Cd
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:59:45 +0000
Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com
 [2607:f8b0:4864:20::82d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f5daa102-2a21-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 14:59:44 +0200 (CEST)
Received: by mail-qt1-x82d.google.com with SMTP id
 d75a77b69052e-403b07cf5d0so38989371cf.2
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 05:59:44 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 d3-20020ac81183000000b00402364e77dcsm3273060qtj.7.2023.07.24.05.59.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 05:59:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f5daa102-2a21-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690203583; x=1690808383;
        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=5g90NEIr2gEQRrKv4KW4CuJMuwsS8xE3NxELsPnfYWs=;
        b=q40Zru82L/2BKRKKtOnL14Tu9aKQ+W6CSWGiQnn8n5AOg/Lkg3DCC8wOOKUjH+TV+8
         t25Wn7qxIk9Xh0xZA1nOmFZInBUF4FL12mrtIW/nNwnvMp+92hgQAxDss2ehA2QdT0s3
         FAAHILtXwK2MFnNO+CbCdVLUjIc5dIq+452QycZbAzJRHzOuLPDvXZGhGwlAXuC4znF5
         chxGlJQ8E+wsjBKA7D/SezbQI6tj/03ND910bYOYoaOfpKXCyRd5SJBr6SNEgajg5Wxu
         Wla7MKsh6xDBsf3tB0GH2wwmHqljAH9oK9YU8KpLUvy6UMZuofY8p5daiNlm+YhwONsP
         BhZQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690203583; x=1690808383;
        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=5g90NEIr2gEQRrKv4KW4CuJMuwsS8xE3NxELsPnfYWs=;
        b=VwsmRD715TdbSOwK8r328St4TU5jdwrvvj6pZ8sciuKdlZTSR8FwLx2uT1P9Ocq/DD
         U975kbfg3oMlIrD9PKKeG1msAeMGA9dkGnSIgdSq6GDM9j0RqnOjT2uHw77576eXyEP6
         Mq+DkRWrrtpGap3MVCCf9Tt/+lBlC/fPq2rNCZaiTNMzn3F+ZGT1cZntFdu6ApbeIyeA
         QfW7aGhCB+pn7PecUElzYhppL71yWRLPks2NLhs36o3b536VF/C2y2IRBwoUda08y8P4
         YlLmT/6R71ivmUF2BKIi+02a0SRN49KFEshWse9kAV9c072IV+VPIUwRGVaNXd5roYkC
         3NLA==
X-Gm-Message-State: ABy/qLahrYn1wVtWV9PTJp+7hR8A0EwJ+AiRG4da0fpgedxL68fEnxD1
	4B681aag9Zm/kBwXwUDcsUeybxLI1GI=
X-Google-Smtp-Source: APBJJlEU18y5Q5FQMKok9iXRYDlpczsp//w+ubp7MNlQrMmfrhMCI04OoyLe36HFmJM8e3+Y7KIkXA==
X-Received: by 2002:a05:622a:1a1c:b0:403:edd0:8ada with SMTP id f28-20020a05622a1a1c00b00403edd08adamr11556056qtb.61.1690203583244;
        Mon, 24 Jul 2023 05:59:43 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v6 10/15] libxc: Include cppc_para in definitions
Date: Mon, 24 Jul 2023 08:58:52 -0400
Message-ID: <20230724125857.11133-11-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230724125857.11133-1-jandryuk@gmail.com>
References: <20230724125857.11133-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Expose the cppc_para fields through libxc.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
---
v4:
Rename hwp to cppc
Add Anthony's Ack
---
 tools/include/xenctrl.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index 8aedb952a0..2092632296 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1892,6 +1892,7 @@ int xc_smt_disable(xc_interface *xch);
  */
 typedef struct xen_userspace xc_userspace_t;
 typedef struct xen_ondemand xc_ondemand_t;
+typedef struct xen_cppc_para xc_cppc_para_t;
 
 struct xc_get_cpufreq_para {
     /* IN/OUT variable */
@@ -1923,6 +1924,7 @@ struct xc_get_cpufreq_para {
                 xc_ondemand_t ondemand;
             } u;
         } s;
+        xc_cppc_para_t cppc_para;
     } u;
 
     int32_t turbo_enabled;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:59:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:59:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568927.889113 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvAH-0007cB-Fq; Mon, 24 Jul 2023 12:59:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568927.889113; Mon, 24 Jul 2023 12:59:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvAH-0007c0-Ca; Mon, 24 Jul 2023 12:59:53 +0000
Received: by outflank-mailman (input) for mailman id 568927;
 Mon, 24 Jul 2023 12:59:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ymW7=DK=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qNvAG-0005PS-BW
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:59:52 +0000
Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com
 [2607:f8b0:4864:20::834])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fa0b5116-2a21-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 14:59:51 +0200 (CEST)
Received: by mail-qt1-x834.google.com with SMTP id
 d75a77b69052e-4039a42467fso31278521cf.3
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 05:59:51 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 d3-20020ac81183000000b00402364e77dcsm3273060qtj.7.2023.07.24.05.59.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 05:59:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fa0b5116-2a21-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690203590; x=1690808390;
        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=wIB5Z/ggG5eJ8M2F2JBMwNaYc9A5YlbhT5y/HdVUB7g=;
        b=SM+lqGSz/5VSB9c/MoeGAZxm/4e37RT/uB8jtevTGq2vpRK1NLJKjHt2dQIjYCAD1Q
         GtCp8vSZkjj6j8F2lmJAt12mGxcR6pLyCiJRo4/8ad/nJio3GF2rSRcMjJNXwlfaDABd
         KKTjn4RnHkuqLQDUb5kb7lLoFOxbAV/wHFUJvzkhzKNv6L0bR5GlRJGL3h8sFarOmr1E
         cmwXbyfqO4JVF1L+m7+mr9s9AzxJI1e2WRjL/6mzvrFjELvoZtERcNz6Lc0LCIetna63
         TkMeA9iw6XnfkAPW5tPEfjgJHmygzPceBvmkOMJOsssD57AnnFmq47SWPRvc3EcNxkn7
         +obw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690203590; x=1690808390;
        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=wIB5Z/ggG5eJ8M2F2JBMwNaYc9A5YlbhT5y/HdVUB7g=;
        b=H0dbT5TaxpiacrWkUP7OEcYtqomo8fuAfB509qnILAVgEMijCcYoJPBhXgmYWmhWdG
         MQ5PaESfLX/thpTROL7Ipq4CJMoXUt99fovisNzPt0tOgtEZT7SkRJAWVdMgxb/wdOh6
         fd/e8NhtXSboE/pHwN74mIuvOZOeMPhqxCueLKVBSK5MucO0K0zqeddZk0xX01gZ6cVj
         4ZzHaC/1mQ8NWGwTt4xRVtL/Ecl74gDMrX2AMmaBAvnuYxkV0SUAd9+Go2evY84VduHi
         /AIentvcwTqB3v6VtRgwXOocaVNM8MqVqX2HhKMNlRQM25z7XBdbkUJLL4meCxXNvhOx
         mATA==
X-Gm-Message-State: ABy/qLbfo0l7mm/BahqTSSTzEPMwf/BIEgME1gMvnJx99vECEu8cIDjt
	MEhd86E7fEAgW8nExjGZDkP9l7+ZzTQ=
X-Google-Smtp-Source: APBJJlEbAnhKZwmYJQ1uF7lhDM89r23rRp0J9dk/ylqXD/W3cyaHzjwGjBqtJEoEoPnRT2KCqo8gcA==
X-Received: by 2002:ac8:7f84:0:b0:403:adf1:8352 with SMTP id z4-20020ac87f84000000b00403adf18352mr11685349qtj.24.1690203590210;
        Mon, 24 Jul 2023 05:59:50 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v6 13/15] libxc: Add xc_set_cpufreq_cppc
Date: Mon, 24 Jul 2023 08:58:55 -0400
Message-ID: <20230724125857.11133-14-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230724125857.11133-1-jandryuk@gmail.com>
References: <20230724125857.11133-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add xc_set_cpufreq_cppc to allow calling xen_systctl_pm_op
SET_CPUFREQ_CPPC.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
---
v2:
Mark xc_set_hwp_para_t const

v4:
s/hwp/cppc/
Add Anthony's Ack

v5:
Remove const and copy back result
---
 tools/include/xenctrl.h |  4 ++++
 tools/libs/ctrl/xc_pm.c | 23 +++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index 2092632296..52f42fb5b6 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1930,11 +1930,15 @@ struct xc_get_cpufreq_para {
     int32_t turbo_enabled;
 };
 
+typedef struct xen_set_cppc_para xc_set_cppc_para_t;
+
 int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
                         struct xc_get_cpufreq_para *user_para);
 int xc_set_cpufreq_gov(xc_interface *xch, int cpuid, char *govname);
 int xc_set_cpufreq_para(xc_interface *xch, int cpuid,
                         int ctrl_type, int ctrl_value);
+int xc_set_cpufreq_cppc(xc_interface *xch, int cpuid,
+                        xc_set_cppc_para_t *set_cppc);
 int xc_get_cpufreq_avgfreq(xc_interface *xch, int cpuid, int *avg_freq);
 
 int xc_set_sched_opt_smt(xc_interface *xch, uint32_t value);
diff --git a/tools/libs/ctrl/xc_pm.c b/tools/libs/ctrl/xc_pm.c
index cea3eab22e..1f267147f6 100644
--- a/tools/libs/ctrl/xc_pm.c
+++ b/tools/libs/ctrl/xc_pm.c
@@ -329,6 +329,29 @@ int xc_set_cpufreq_para(xc_interface *xch, int cpuid,
     return xc_sysctl(xch, &sysctl);
 }
 
+int xc_set_cpufreq_cppc(xc_interface *xch, int cpuid,
+                        xc_set_cppc_para_t *set_cppc)
+{
+    DECLARE_SYSCTL;
+    int ret;
+
+    if ( !xch )
+    {
+        errno = EINVAL;
+        return -1;
+    }
+    sysctl.cmd = XEN_SYSCTL_pm_op;
+    sysctl.u.pm_op.cmd = SET_CPUFREQ_CPPC;
+    sysctl.u.pm_op.cpuid = cpuid;
+    sysctl.u.pm_op.u.set_cppc = *set_cppc;
+
+    ret = xc_sysctl(xch, &sysctl);
+
+    *set_cppc = sysctl.u.pm_op.u.set_cppc;
+
+    return ret;
+}
+
 int xc_get_cpufreq_avgfreq(xc_interface *xch, int cpuid, int *avg_freq)
 {
     int ret = 0;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 12:59:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 12:59:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568928.889123 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvAK-0008BU-VD; Mon, 24 Jul 2023 12:59:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568928.889123; Mon, 24 Jul 2023 12:59:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvAK-0008AV-RY; Mon, 24 Jul 2023 12:59:56 +0000
Received: by outflank-mailman (input) for mailman id 568928;
 Mon, 24 Jul 2023 12:59:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ymW7=DK=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qNvAJ-0005PS-0z
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:59:55 +0000
Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com
 [2607:f8b0:4864:20::833])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fb8e9920-2a21-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 14:59:54 +0200 (CEST)
Received: by mail-qt1-x833.google.com with SMTP id
 d75a77b69052e-403a7066d9bso25740411cf.3
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 05:59:54 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 d3-20020ac81183000000b00402364e77dcsm3273060qtj.7.2023.07.24.05.59.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 05:59:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fb8e9920-2a21-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690203593; x=1690808393;
        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=gblVHwIRoZ9Cb4sFC+wqThP0YWJWsFM4Sph0J9w8nz0=;
        b=C8u0rZ8OH0ChHPtFR5Y4ilL+LX/QpCLEuSQijfYkbVS0HuDaktqfzS9UQMxTWaNJCk
         Ky/21sffmMh0sI0waS61fI+Qzh2teTL5MskKUEOE+5g3om/ySNRi/IhlhFWfI2DjiVU4
         K8MxBkvjdDMlB1NnXRisNulGWeJG/akBLXtNMCCvUY4nfOT4+kl2DxLSLWkOTSks/8wq
         JOxBO/+DBYFe9NGTll7jUcaVdo5DpAGYA465SXHsXjCiUCWWDVUbvwnKZJHQ+f5MD9Dt
         08VtsZE1RR5K2rAPGkyzhShIiCJsl5xF/EpHmxIGZ4Mtmhe2+0e9h6w3rcEUTppCm+OF
         xr0Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690203593; x=1690808393;
        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=gblVHwIRoZ9Cb4sFC+wqThP0YWJWsFM4Sph0J9w8nz0=;
        b=d4/0Vv09HkQqE1mEVccKurYuA+hQR63yT9PdxcRHhXPXB/WPPnocDIaF2BbbeVcYF2
         MECnQ+liTa2T9a/ky/eKiUp2CS+ZU5ByArAk9++4OeSWfD8dztxMB6NhXtB5UAujIGOr
         nNtZCkadtNctAia+ip4ec/zx/hZe+l2SmjspvnhgEL62ATbu4HPSUhSrn7v+6ZwTZrpl
         J+FtdFkRi0uoxrwmgOGRT3TwjiWZ84fiF+Uo5lTLPKG29275xf+1NERitzTP4rpJcMM2
         8QAo4b19/bluMTT2uLzG3xG3ajAJX1cNUnqP2qZBDxCxMw+z++uz0QrybLJwMyzKkfAR
         zT0w==
X-Gm-Message-State: ABy/qLZWE24kb7CfDcTbdZD/zuSxZGJaqeD8hJ1aPE8UsWTi2MLdo95X
	nAhtdaAE9aI9u678Yun39HrPXzf8uSw=
X-Google-Smtp-Source: APBJJlEZaj/SDM9fAVEkIn8Xu6YGvulO4B3cxv83Rg+IbT/weF6ok/CqS2nBSaemNL8U+OlvVIbMPQ==
X-Received: by 2002:ac8:5916:0:b0:403:b6b0:c1d8 with SMTP id 22-20020ac85916000000b00403b6b0c1d8mr8688084qty.7.1690203592676;
        Mon, 24 Jul 2023 05:59:52 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v6 14/15] xenpm: Add set-cpufreq-cppc subcommand
Date: Mon, 24 Jul 2023 08:58:56 -0400
Message-ID: <20230724125857.11133-15-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230724125857.11133-1-jandryuk@gmail.com>
References: <20230724125857.11133-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

set-cpufreq-cppc allows setting the Hardware P-State (HWP) parameters.

It can be run on all or just a single cpu.  There are presets of
balance, powersave & performance.  Those can be further tweaked by
param:val arguments as explained in the usage description.

Parameter names are just checked to the first 3 characters to shorten
typing.

Some options are hardware dependent, and ranges can be found in
get-cpufreq-para.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v5:
Make i unsigned int
Use local max_cpuid instead of max_cpu_nr
Add Jan's Ack
Check set_params and print a message if activity window wasn't set

v4:
Remove energy bias 0-15 & 7 references
Use MASK_INSR
Fixup { placement
Drop extra case in parse_activity_window
strcmp suffix
Expand help text
s/hwp/cppc/
Use isdigit() to check cpuid - otherwise run on all CPUs.

v2:
Compare provided parameter name and not just 3 characters.
Use "-" in parameter names
Remove hw_
Replace sscanf with strchr & strtoul.
Remove toplevel error message with lower level ones.
Help text s/127/128/
Help text mention truncation.
Avoid some truncation rounding down by adding 5 before division.
Help test mention default microseconds
Also comment the limit check written to avoid overflow.
---
 tools/misc/xenpm.c | 244 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 244 insertions(+)

diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 3abd99fd20..0877f43946 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -16,6 +16,8 @@
  */
 #define MAX_NR_CPU 512
 
+#include <ctype.h>
+#include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -67,6 +69,30 @@ void show_help(void)
             " set-max-cstate        <num>|'unlimited' [<num2>|'unlimited']\n"
             "                                     set the C-State limitation (<num> >= 0) and\n"
             "                                     optionally the C-sub-state limitation (<num2> >= 0)\n"
+            " set-cpufreq-cppc      [cpuid] [balance|performance|powersave] <param:val>*\n"
+            "                                     set Hardware P-State (HWP) parameters\n"
+            "                                     on CPU <cpuid> or all if omitted.\n"
+            "                                     optionally a preset of one of:\n"
+            "                                       balance|performance|powersave\n"
+            "                                     an optional list of param:val arguments\n"
+            "                                       minimum:N (0-255)\n"
+            "                                       maximum:N (0-255)\n"
+            "                                           get-cpufreq-para lowest/highest\n"
+            "                                           values are limits for\n"
+            "                                           minumum/maximum.\n"
+            "                                       desired:N (0-255)\n"
+            "                                           set explicit performance target.\n"
+            "                                           non-zero disables auto-HWP mode.\n"
+            "                                       energy-perf:N (0-255)\n"
+            "                                                   energy/performance hint\n"
+            "                                                   lower - favor performance\n"
+            "                                                   higher - favor powersave\n"
+            "                                                   128 - balance\n"
+            "                                       act-window:N{,m,u}s range 1us-1270s\n"
+            "                                           window for internal calculations.\n"
+            "                                           units default to \"us\" if unspecified.\n"
+            "                                           truncates un-representable values.\n"
+            "                                           0 lets the hardware decide.\n"
             " start [seconds]                     start collect Cx/Px statistics,\n"
             "                                     output after CTRL-C or SIGINT or several seconds.\n"
             " enable-turbo-mode     [cpuid]       enable Turbo Mode for processors that support it.\n"
@@ -1292,6 +1318,223 @@ void disable_turbo_mode(int argc, char *argv[])
                 errno, strerror(errno));
 }
 
+/*
+ * Parse activity_window:NNN{us,ms,s} and validate range.
+ *
+ * Activity window is a 7bit mantissa (0-127) with a 3bit exponent (0-7) base
+ * 10 in microseconds.  So the range is 1 microsecond to 1270 seconds.  A value
+ * of 0 lets the hardware autonomously select the window.
+ *
+ * Return 0 on success
+ *       -1 on error
+ */
+static int parse_activity_window(xc_set_cppc_para_t *set_cppc, unsigned long u,
+                                 const char *suffix)
+{
+    unsigned int exponent = 0;
+    unsigned int multiplier = 1;
+
+    if ( suffix && suffix[0] )
+    {
+        if ( strcmp(suffix, "s") == 0 )
+        {
+            multiplier = 1000 * 1000;
+            exponent = 6;
+        }
+        else if ( strcmp(suffix, "ms") == 0 )
+        {
+            multiplier = 1000;
+            exponent = 3;
+        }
+        else if ( strcmp(suffix, "us") != 0 )
+        {
+            fprintf(stderr, "invalid activity window units: \"%s\"\n", suffix);
+
+            return -1;
+        }
+    }
+
+    /* u * multipler > 1270 * 1000 * 1000 transformed to avoid overflow. */
+    if ( u > 1270 * 1000 * 1000 / multiplier )
+    {
+        fprintf(stderr, "activity window is too large\n");
+
+        return -1;
+    }
+
+    /* looking for 7 bits of mantissa and 3 bits of exponent */
+    while ( u > 127 )
+    {
+        u += 5; /* Round up to mitigate truncation rounding down
+                   e.g. 128 -> 120 vs 128 -> 130. */
+        u /= 10;
+        exponent += 1;
+    }
+
+    set_cppc->activity_window =
+        MASK_INSR(exponent, XEN_CPPC_ACT_WINDOW_EXPONENT_MASK) |
+        MASK_INSR(u, XEN_CPPC_ACT_WINDOW_MANTISSA_MASK);
+    set_cppc->set_params |= XEN_SYSCTL_CPPC_SET_ACT_WINDOW;
+
+    return 0;
+}
+
+static int parse_cppc_opts(xc_set_cppc_para_t *set_cppc, int *cpuid,
+                           int argc, char *argv[])
+{
+    int i = 0;
+
+    if ( argc < 1 )
+    {
+        fprintf(stderr, "Missing arguments\n");
+        return -1;
+    }
+
+    if ( isdigit(argv[i][0]) )
+    {
+        if ( sscanf(argv[i], "%d", cpuid) != 1 || *cpuid < 0 )
+        {
+            fprintf(stderr, "Could not parse cpuid \"%s\"\n", argv[i]);
+            return -1;
+        }
+
+        i++;
+    }
+
+    if ( i == argc )
+    {
+        fprintf(stderr, "Missing arguments\n");
+        return -1;
+    }
+
+    if ( strcasecmp(argv[i], "powersave") == 0 )
+    {
+        set_cppc->set_params = XEN_SYSCTL_CPPC_SET_PRESET_POWERSAVE;
+        i++;
+    }
+    else if ( strcasecmp(argv[i], "performance") == 0 )
+    {
+        set_cppc->set_params = XEN_SYSCTL_CPPC_SET_PRESET_PERFORMANCE;
+        i++;
+    }
+    else if ( strcasecmp(argv[i], "balance") == 0 )
+    {
+        set_cppc->set_params = XEN_SYSCTL_CPPC_SET_PRESET_BALANCE;
+        i++;
+    }
+
+    for ( ; i < argc; i++)
+    {
+        unsigned long val;
+        char *param = argv[i];
+        char *value;
+        char *suffix;
+        int ret;
+
+        value = strchr(param, ':');
+        if ( value == NULL )
+        {
+            fprintf(stderr, "\"%s\" is an invalid cppc parameter\n", argv[i]);
+            return -1;
+        }
+
+        value[0] = '\0';
+        value++;
+
+        errno = 0;
+        val = strtoul(value, &suffix, 10);
+        if ( (errno && val == ULONG_MAX) || value == suffix )
+        {
+            fprintf(stderr, "Could not parse number \"%s\"\n", value);
+            return -1;
+        }
+
+        if ( strncasecmp(param, "act-window", strlen(param)) == 0 )
+        {
+            ret = parse_activity_window(set_cppc, val, suffix);
+            if (ret)
+                return -1;
+
+            continue;
+        }
+
+        if ( val > 255 )
+        {
+            fprintf(stderr, "\"%s\" value \"%lu\" is out of range\n", param,
+                    val);
+            return -1;
+        }
+
+        if ( suffix && suffix[0] )
+        {
+            fprintf(stderr, "Suffix \"%s\" is invalid\n", suffix);
+            return -1;
+        }
+
+        if ( strncasecmp(param, "minimum", MAX(2, strlen(param))) == 0 )
+        {
+            set_cppc->minimum = val;
+            set_cppc->set_params |= XEN_SYSCTL_CPPC_SET_MINIMUM;
+        }
+        else if ( strncasecmp(param, "maximum", MAX(2, strlen(param))) == 0 )
+        {
+            set_cppc->maximum = val;
+            set_cppc->set_params |= XEN_SYSCTL_CPPC_SET_MAXIMUM;
+        }
+        else if ( strncasecmp(param, "desired", strlen(param)) == 0 )
+        {
+            set_cppc->desired = val;
+            set_cppc->set_params |= XEN_SYSCTL_CPPC_SET_DESIRED;
+        }
+        else if ( strncasecmp(param, "energy-perf", strlen(param)) == 0 )
+        {
+            set_cppc->energy_perf = val;
+            set_cppc->set_params |= XEN_SYSCTL_CPPC_SET_ENERGY_PERF;
+        }
+        else
+        {
+            fprintf(stderr, "\"%s\" is an invalid parameter\n", param);
+            return -1;
+        }
+    }
+
+    if ( set_cppc->set_params == 0 )
+    {
+        fprintf(stderr, "No parameters set in request\n");
+        return -1;
+    }
+
+    return 0;
+}
+
+static void cppc_set_func(int argc, char *argv[])
+{
+    xc_set_cppc_para_t set_cppc = {};
+    unsigned int max_cpuid = max_cpu_nr;
+    int cpuid = -1;
+    unsigned int i = 0;
+    uint32_t set_params;
+
+    if ( parse_cppc_opts(&set_cppc, &cpuid, argc, argv) )
+        exit(EINVAL);
+
+    if ( cpuid != -1 )
+    {
+        i = cpuid;
+        max_cpuid = i + 1;
+    }
+
+    set_params = set_cppc.set_params;
+    for ( ; i < max_cpuid; i++ ) {
+        if ( xc_set_cpufreq_cppc(xc_handle, i, &set_cppc) )
+            fprintf(stderr, "[CPU%d] failed to set cppc params (%d - %s)\n",
+                    i, errno, strerror(errno));
+    }
+
+    if ( (set_params ^ set_cppc.set_params) & XEN_SYSCTL_CPPC_SET_ACT_WINDOW )
+        printf("Activity window not supported and omitted\n");
+}
+
 struct {
     const char *name;
     void (*function)(int argc, char *argv[]);
@@ -1302,6 +1545,7 @@ struct {
     { "get-cpufreq-average", cpufreq_func },
     { "start", start_gather_func },
     { "get-cpufreq-para", cpufreq_para_func },
+    { "set-cpufreq-cppc", cppc_set_func },
     { "set-scaling-maxfreq", scaling_max_freq_func },
     { "set-scaling-minfreq", scaling_min_freq_func },
     { "set-scaling-governor", scaling_governor_func },
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 13:07:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 13:07:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568937.889147 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvHW-0002nd-Bt; Mon, 24 Jul 2023 13:07:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568937.889147; Mon, 24 Jul 2023 13:07:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvHW-0002mf-8e; Mon, 24 Jul 2023 13:07:22 +0000
Received: by outflank-mailman (input) for mailman id 568937;
 Mon, 24 Jul 2023 13:07:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ymW7=DK=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qNvAM-0005PS-1d
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:59:58 +0000
Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com
 [2607:f8b0:4864:20::82e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fd0dff1b-2a21-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 14:59:56 +0200 (CEST)
Received: by mail-qt1-x82e.google.com with SMTP id
 d75a77b69052e-403c6a0f3aaso36357581cf.2
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 05:59:56 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 d3-20020ac81183000000b00402364e77dcsm3273060qtj.7.2023.07.24.05.59.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 05:59:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fd0dff1b-2a21-11ee-b23a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690203595; x=1690808395;
        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=7fKIbOA4RKJwyWZPk8ACAEU8hAgIi7aDz2OnDwWBK4c=;
        b=sJmOJLa6D8sdIdBTnex7aNKMckc6WIJrt9usf4u3RkUJVccqXlqyhw87KVlZScJNwM
         +51m4YeQitTJRMb7w1Q5jeJiOHRWfla5MyiamJhR9Gq+mxUy6jYBSclzG4rJZEXdNiSC
         WwYLFSwaAKlBzSs8mEtAEK9qQ6Se7lvGe6XqjupwVUlwDsWbPGya89hWpREkqNTyEeP1
         kkS+J7mk3Xt/EIILTVxNKSj3Nw+vLL4hUMErAk7Jd3uDYmLH2XQQ1AumXTXMYrffXflf
         W5kO2bEL569HFn/KkYjkVOeWDZwWMNkZ3w456Qk/nlSsC6hvC6NbUhRHwq+I7evy8CLh
         G0Aw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690203595; x=1690808395;
        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=7fKIbOA4RKJwyWZPk8ACAEU8hAgIi7aDz2OnDwWBK4c=;
        b=lUPQAzhQRaMDwJQCV0pob6c0bBhHVliczXw3FEau799SAk/nQAGFBOFmpwRAvMAuYk
         dnLTPvJZI37sYIj5IV6RpE97Nu3/ndJikB+ArxMadhmOdQPkHwONeJDRB8pu70/4cjJ0
         fxW/PaOfIzN4cX7yG5HOCrxowlhrnAfoxX+BGC+4UeXCpFiSkWlwYXmIfIn6uDGdAcbR
         ZVb+WGH+FpGawvTHMX/T2GBxcoAgx4TMa0e5B6liL1RTplka+1PZgvFptbIdl1GGe5Iz
         LKBKA/qUVJYKhztsb6bpqKU4+l1DtXyNjmPndXXH0kb+qOwQgzHWob+iaY2IRZjL2KGz
         rPdg==
X-Gm-Message-State: ABy/qLa4Dip/ttpTsQ2BshdCVGd04YOr+UiX4jRM3jYwM5P6Y/gSGoz3
	GHyCyIR55Anl3dIii/GgNlDtKttOvOs=
X-Google-Smtp-Source: APBJJlEbLrveRL6h2ryVcasfzikm+AV07pIP3VCXOykFn11KDziFGr4vXORohvsOrSj19Cjav2oHFw==
X-Received: by 2002:a05:622a:1745:b0:406:a592:756c with SMTP id l5-20020a05622a174500b00406a592756cmr591717qtk.58.1690203595195;
        Mon, 24 Jul 2023 05:59:55 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Henry Wang <Henry.Wang@arm.com>,
	Community Manager <community.manager@xenproject.org>
Subject: [PATCH v6 15/15] CHANGELOG: Add Intel HWP entry
Date: Mon, 24 Jul 2023 08:58:57 -0400
Message-ID: <20230724125857.11133-16-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230724125857.11133-1-jandryuk@gmail.com>
References: <20230724125857.11133-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Henry Wang <Henry.Wang@arm.com>
---
v3:
Position under existing Added section
Add Henry's Ack

v2:
Add blank line
---
 CHANGELOG.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7d7e0590f8..8d6e6c3088 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -24,7 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - xl/libxl can customize SMBIOS strings for HVM guests.
  - Add support for AVX512-FP16 on x86.
  - On Arm, Xen supports guests running SVE/SVE2 instructions. (Tech Preview)
-
+ - Add Intel Hardware P-States (HWP) cpufreq driver.
 
 ## [4.17.0](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.17.0) - 2022-12-12
 
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 13:07:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 13:07:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568939.889156 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvHW-0002zp-V2; Mon, 24 Jul 2023 13:07:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568939.889156; Mon, 24 Jul 2023 13:07:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvHW-0002xT-Ok; Mon, 24 Jul 2023 13:07:22 +0000
Received: by outflank-mailman (input) for mailman id 568939;
 Mon, 24 Jul 2023 13:07:21 +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
 <SRS0=ymW7=DK=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qNv9x-0003BP-VY
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:59:33 +0000
Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com
 [2607:f8b0:4864:20::834])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ee157326-2a21-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:59:32 +0200 (CEST)
Received: by mail-qt1-x834.google.com with SMTP id
 d75a77b69052e-4055bc3cdd8so11787461cf.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 05:59:32 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 d3-20020ac81183000000b00402364e77dcsm3273060qtj.7.2023.07.24.05.59.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 05:59:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ee157326-2a21-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690203570; x=1690808370;
        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=UU4SMiJdUktv8hEdzVKy8V3KsteeHcG1cOr0eV9yG8I=;
        b=BcWMVL5ueF+iP4G5PnLsosbjMkhYHV2qzqa317LHDSf9s2ANyQN+l4UOxmpwMB9HTn
         /UVG+dG5qzwqWL0HjMNrODL/zl8/FMiMJhxoIwFylrKrolfi1vICFTPYD8niJNmB5/j0
         +osv8lpLnFVsuRuwdIFnEQ9p+3AC3TTD1RQKxM4wjkd6W4N23/vFZFR4wcguk62Wls/E
         7hzyDKsIpxJfzMJkqQj9oxupG4lKoCX9O+vrTbvVy61OiLXe9wT7XsqoFLadItXCkdF0
         rbtCDsP3QE5A6ynwe8GHNRdSzruMC2PP11SWhO/C1qHf/q+rRj1sxWE7wNC7X2XDJLIL
         jaMg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690203570; x=1690808370;
        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=UU4SMiJdUktv8hEdzVKy8V3KsteeHcG1cOr0eV9yG8I=;
        b=FlHetaV6jCO1Kr+MlMkqvnf9jcCVSNJ9jOLOeDFGQ+cuW3WGSnUv3SBG4D1IEgNx02
         nn/E1wLBFQhEGCHZY3r8eMA2a/IdE07w83JixtYNsYUlqSKqUtYdLl6TkJjj0gNSP8Mq
         fxExnaqOjUlUh5Kxs8XkooSl2XjxkhtaHZCfAlKUZERMWeAMUulPuak+G+06lzU05s+N
         q/iQyGYJA+0xhnwJWo6S28YvhAIMwuC7NO1lSww11FBDnDnCG0e2dVHdMFKmfSyWoX7D
         wZBIkxbTsO3qHW+MDJz/sEfodk7c0gRVbrs7Fp6x4w+3gmCaG4moQtmx7h+reLVWpti5
         ShKQ==
X-Gm-Message-State: ABy/qLbjd6a3YFPpruiXvwY6zSJa22RHks1vAATn6uYbgEHfftDrJtMk
	9ouUWiNhrzr7mzHzHNNI9754kzsuNiU=
X-Google-Smtp-Source: APBJJlFJmsqQYBT5LfoXDKUnIASSQEg6TvmQR9TcF2qEFG8Sz+O+8XEcKxeEgiI0T1/o6KQXqePvHg==
X-Received: by 2002:a05:622a:1314:b0:3ff:23e4:40b4 with SMTP id v20-20020a05622a131400b003ff23e440b4mr9359913qtk.42.1690203570171;
        Mon, 24 Jul 2023 05:59:30 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v6 05/15] pmstat&xenpm: Re-arrage for cpufreq union
Date: Mon, 24 Jul 2023 08:58:47 -0400
Message-ID: <20230724125857.11133-6-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230724125857.11133-1-jandryuk@gmail.com>
References: <20230724125857.11133-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rearrange code now that xen_sysctl_pm_op's get_para fields has the
nested union and struct.  In particular, the scaling governor
information like scaling_available_governors is inside the union, so it
is not always available.  Move those fields (op->u.get_para.u.s.u.*)
together as well as the common fields (ones outside the union like
op->u.get_para.turbo_enabled).

With that, gov_num may be 0, so bounce buffer handling needs
to be modified.

scaling_governor and other fields inside op->u.get_para.u.s.u.* won't be
used for hwp, so this will simplify the change when hwp support is
introduced and re-indents these lines all together.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v6:
Add Jan's Ack

v5:
Remove some formatting changes
Expand commit message
---
 tools/libs/ctrl/xc_pm.c   | 12 ++++++++----
 tools/misc/xenpm.c        |  3 ++-
 xen/drivers/acpi/pmstat.c | 24 ++++++++++++------------
 3 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/tools/libs/ctrl/xc_pm.c b/tools/libs/ctrl/xc_pm.c
index 6e751e242f..cea3eab22e 100644
--- a/tools/libs/ctrl/xc_pm.c
+++ b/tools/libs/ctrl/xc_pm.c
@@ -221,7 +221,7 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
     {
         if ( (!user_para->affected_cpus)                    ||
              (!user_para->scaling_available_frequencies)    ||
-             (!user_para->scaling_available_governors) )
+             (user_para->gov_num && !user_para->scaling_available_governors) )
         {
             errno = EINVAL;
             return -1;
@@ -230,12 +230,15 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
             goto unlock_1;
         if ( xc_hypercall_bounce_pre(xch, scaling_available_frequencies) )
             goto unlock_2;
-        if ( xc_hypercall_bounce_pre(xch, scaling_available_governors) )
+        if ( user_para->gov_num &&
+             xc_hypercall_bounce_pre(xch, scaling_available_governors) )
             goto unlock_3;
 
         set_xen_guest_handle(sys_para->affected_cpus, affected_cpus);
         set_xen_guest_handle(sys_para->scaling_available_frequencies, scaling_available_frequencies);
-        set_xen_guest_handle(sys_para->scaling_available_governors, scaling_available_governors);
+        if ( user_para->gov_num )
+            set_xen_guest_handle(sys_para->scaling_available_governors,
+                                 scaling_available_governors);
     }
 
     sysctl.cmd = XEN_SYSCTL_pm_op;
@@ -278,7 +281,8 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
     }
 
 unlock_4:
-    xc_hypercall_bounce_post(xch, scaling_available_governors);
+    if ( user_para->gov_num )
+        xc_hypercall_bounce_post(xch, scaling_available_governors);
 unlock_3:
     xc_hypercall_bounce_post(xch, scaling_available_frequencies);
 unlock_2:
diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index ee8ce5d5f2..1c474c3b59 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -811,7 +811,8 @@ static int show_cpufreq_para_by_cpuid(xc_interface *xc_handle, int cpuid)
             ret = -ENOMEM;
             goto out;
         }
-        if (!(p_cpufreq->scaling_available_governors =
+        if (p_cpufreq->gov_num &&
+            !(p_cpufreq->scaling_available_governors =
               malloc(p_cpufreq->gov_num * CPUFREQ_NAME_LEN * sizeof(char))))
         {
             fprintf(stderr,
diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index f5a9ac3f1a..d67d99e62f 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -239,6 +239,18 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
     if ( ret )
         return ret;
 
+    op->u.get_para.cpuinfo_cur_freq =
+        cpufreq_driver.get ? cpufreq_driver.get(op->cpuid) : policy->cur;
+    op->u.get_para.cpuinfo_max_freq = policy->cpuinfo.max_freq;
+    op->u.get_para.cpuinfo_min_freq = policy->cpuinfo.min_freq;
+    op->u.get_para.turbo_enabled = cpufreq_get_turbo_status(op->cpuid);
+
+    if ( cpufreq_driver.name[0] )
+        strlcpy(op->u.get_para.scaling_driver,
+            cpufreq_driver.name, CPUFREQ_NAME_LEN);
+    else
+        strlcpy(op->u.get_para.scaling_driver, "Unknown", CPUFREQ_NAME_LEN);
+
     if ( !(scaling_available_governors =
            xzalloc_array(char, gov_num * CPUFREQ_NAME_LEN)) )
         return -ENOMEM;
@@ -254,21 +266,10 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
     if ( ret )
         return ret;
 
-    op->u.get_para.cpuinfo_cur_freq =
-        cpufreq_driver.get ? cpufreq_driver.get(op->cpuid) : policy->cur;
-    op->u.get_para.cpuinfo_max_freq = policy->cpuinfo.max_freq;
-    op->u.get_para.cpuinfo_min_freq = policy->cpuinfo.min_freq;
-
     op->u.get_para.u.s.scaling_cur_freq = policy->cur;
     op->u.get_para.u.s.scaling_max_freq = policy->max;
     op->u.get_para.u.s.scaling_min_freq = policy->min;
 
-    if ( cpufreq_driver.name[0] )
-        strlcpy(op->u.get_para.scaling_driver,
-            cpufreq_driver.name, CPUFREQ_NAME_LEN);
-    else
-        strlcpy(op->u.get_para.scaling_driver, "Unknown", CPUFREQ_NAME_LEN);
-
     if ( policy->governor->name[0] )
         strlcpy(op->u.get_para.u.s.scaling_governor,
             policy->governor->name, CPUFREQ_NAME_LEN);
@@ -291,7 +292,6 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
             &op->u.get_para.u.s.u.ondemand.sampling_rate,
             &op->u.get_para.u.s.u.ondemand.up_threshold);
     }
-    op->u.get_para.turbo_enabled = cpufreq_get_turbo_status(op->cpuid);
 
     return ret;
 }
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 13:07:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 13:07:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568932.889133 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvHU-0002V5-Pd; Mon, 24 Jul 2023 13:07:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568932.889133; Mon, 24 Jul 2023 13:07:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvHU-0002Uy-Mh; Mon, 24 Jul 2023 13:07:20 +0000
Received: by outflank-mailman (input) for mailman id 568932;
 Mon, 24 Jul 2023 13:07:20 +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
 <SRS0=ymW7=DK=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qNvA9-0003BP-Gs
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:59:45 +0000
Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com
 [2607:f8b0:4864:20::72c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f488429c-2a21-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:59:42 +0200 (CEST)
Received: by mail-qk1-x72c.google.com with SMTP id
 af79cd13be357-7673180224bso286927985a.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 05:59:42 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 d3-20020ac81183000000b00402364e77dcsm3273060qtj.7.2023.07.24.05.59.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 05:59:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f488429c-2a21-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690203581; x=1690808381;
        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=lOhLHK6n7gDw0RiXQnnSlKqHxuCkhhczBtcl+i5sew4=;
        b=kJr07GRPShb+8/G78tHfwSntXH4s9n0PtX2zJwj2moxuU3J30W63G7hmPrC18vNB6O
         +5mc55P9vXO+0UvsBV1AXU4vEgk82BnSyheTwECDSKs3b5Uue/7DtxL4Q0ZJFDsSxrgd
         IwBUDim3GrtlNjX1wFNoxb1652UX98GFSRCA8R67oI31vJC39wKzbQpVMo8PtOaVV7tc
         UC34FLhlnEO/45MnXXaIkoTXadCygsJuULazBfSWKvUnFpdDG0PCyEJwhYzcAqhOxL+k
         oflP6ED5Zb2VCNUngP3rFt3CQb1GrByIQSEZiMxB2v6ZFzU+YCgrPhQE0BYqWfzCwz7g
         I18Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690203581; x=1690808381;
        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=lOhLHK6n7gDw0RiXQnnSlKqHxuCkhhczBtcl+i5sew4=;
        b=Yy79YIJVhcLuinwaZaEuvwWXt7IBgjurhbVlV3fGXh/qTVn3FQjYNU3sYNlv1DOErn
         scAu8cGwpkvxdoSaeFIssohwc7552cIFaKV5p+0xsxJ6JuMB+sPz/lovmececdR3mwLd
         Gaqx9Li8xK4LtJ/XjSlhg9dNMsw8NUpELVDXjA51b38jBYypr9udlUD1huXWpYrcgwTD
         aGDBk38KzXJ2hTbImVlbPMLISN7gT5PtWwz5Fb5iyH60ldCgGLCpiT/NRjjKiY+rYCRH
         EECxUXL6dwp7liNriLWPsCqjqkE+IgOA3Up2CiLpfl4Zhdz9Lyi5PhhZ+WvopQKjF+Kc
         4K4Q==
X-Gm-Message-State: ABy/qLawIM00L/30RYeLo/0rG/FUS9i95n+CBF5iDZcBfWnUGaQs38jv
	Mp+i5CDrT7hjtQlbIc/M3Ijb262Ne94=
X-Google-Smtp-Source: APBJJlFFK2/uArp/TlJqYh5u0Jctt8z9KycKNM8HjEyNeFgoxwfavV7nPCZPb0YgLXgGCAIC4xgS/w==
X-Received: by 2002:a05:622a:156:b0:402:4bf3:7f41 with SMTP id v22-20020a05622a015600b004024bf37f41mr9051029qtw.29.1690203580882;
        Mon, 24 Jul 2023 05:59:40 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 09/15] cpufreq: Export HWP parameters to userspace as CPPC
Date: Mon, 24 Jul 2023 08:58:51 -0400
Message-ID: <20230724125857.11133-10-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230724125857.11133-1-jandryuk@gmail.com>
References: <20230724125857.11133-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Extend xen_get_cpufreq_para to return hwp parameters.  HWP is an
implementation of ACPI CPPC (Collaborative Processor Performance
Control).  Use the CPPC name since that might be useful in the future
for AMD P-state.

We need the features bitmask to indicate fields supported by the actual
hardware - this only applies to activity window for the time being.

The HWP most_efficient is mapped to CPPC lowest_nonlinear, and guaranteed is
mapped to nominal.  CPPC has a guaranteed that is optional while nominal
is required.  ACPI spec says "If this register is not implemented, OSPM
assumes guaranteed performance is always equal to nominal performance."

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v2:
Style fixes
Don't bump XEN_SYSCTL_INTERFACE_VERSION
Drop cpufreq.h comment divider
Expand xen_hwp_para comment
Add HWP activity window mantissa/exponent defines
Handle union rename
Add const to get_hwp_para
Remove hw_ prefix from xen_hwp_para members
Use XEN_HWP_GOVERNOR
Use per_cpu for hwp_drv_data

v4:
Fixup for opt_cpufreq_hwp/hdc removal
get_hwp_para() takes cpu as arg
XEN_ prefix HWP_ACT_WINDOW_*
Drop HWP_ACT_WINDOW_EXPONENT_SHIFT - shift MASK
Remove Energy Bias (0-15) EPP fallback
Rename xen_hwp_para to xen_cppc_para
s/hwp/cppc/
Use scaling driver to switch output

v5:
Use XEN_HWP_DRIVER_NAME
Use cpufreq.h for declarations
Fixup some comments
Drop const from unsigned int cpu
Drop some unnecessary { }
Use strncmp
Switch sizeof(char) to sizeof(*scaling_available_governors)
Reindent copy_to_guest call
Add "HWP: " prefix to sysctl comments for cppc->hwp mapping

v6:
Drop commit message uint8_t paragraph
sysctl.h s/They/They're/
Fix indent and add parens for read_scaling_available_governors() args
Add Jan's Ack
---
 xen/arch/x86/acpi/cpufreq/hwp.c    | 23 ++++++++++
 xen/drivers/acpi/pmstat.c          | 74 ++++++++++++++++--------------
 xen/include/acpi/cpufreq/cpufreq.h |  2 +
 xen/include/public/sysctl.h        | 56 ++++++++++++++++++++++
 4 files changed, 121 insertions(+), 34 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index 662e719039..0dad23e330 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -516,6 +516,29 @@ static const struct cpufreq_driver __initconstrel hwp_cpufreq_driver =
     .update = hwp_cpufreq_update,
 };
 
+int get_hwp_para(unsigned int cpu,
+                 struct xen_cppc_para *cppc_para)
+{
+    const struct hwp_drv_data *data = per_cpu(hwp_drv_data, cpu);
+
+    if ( data == NULL )
+        return -ENODATA;
+
+    cppc_para->features         =
+        (feature_hwp_activity_window ? XEN_SYSCTL_CPPC_FEAT_ACT_WINDOW : 0);
+    cppc_para->lowest           = data->hw.lowest;
+    cppc_para->lowest_nonlinear = data->hw.most_efficient;
+    cppc_para->nominal          = data->hw.guaranteed;
+    cppc_para->highest          = data->hw.highest;
+    cppc_para->minimum          = data->minimum;
+    cppc_para->maximum          = data->maximum;
+    cppc_para->desired          = data->desired;
+    cppc_para->energy_perf      = data->energy_perf;
+    cppc_para->activity_window  = data->activity_window;
+
+    return 0;
+}
+
 int __init hwp_register_driver(void)
 {
     int ret;
diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index d67d99e62f..e4e2df94a7 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -251,46 +251,52 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
     else
         strlcpy(op->u.get_para.scaling_driver, "Unknown", CPUFREQ_NAME_LEN);
 
-    if ( !(scaling_available_governors =
-           xzalloc_array(char, gov_num * CPUFREQ_NAME_LEN)) )
-        return -ENOMEM;
-    if ( (ret = read_scaling_available_governors(scaling_available_governors,
-                gov_num * CPUFREQ_NAME_LEN * sizeof(char))) )
+    if ( !strncmp(op->u.get_para.scaling_driver, XEN_HWP_DRIVER_NAME,
+                      CPUFREQ_NAME_LEN) )
+        ret = get_hwp_para(policy->cpu, &op->u.get_para.u.cppc_para);
+    else
     {
+        if ( !(scaling_available_governors =
+               xzalloc_array(char, gov_num * CPUFREQ_NAME_LEN)) )
+            return -ENOMEM;
+        if ( (ret = read_scaling_available_governors(
+                        scaling_available_governors,
+                        (gov_num * CPUFREQ_NAME_LEN *
+                         sizeof(*scaling_available_governors)))) )
+        {
+            xfree(scaling_available_governors);
+            return ret;
+        }
+        ret = copy_to_guest(op->u.get_para.scaling_available_governors,
+                            scaling_available_governors,
+                            gov_num * CPUFREQ_NAME_LEN);
         xfree(scaling_available_governors);
-        return ret;
-    }
-    ret = copy_to_guest(op->u.get_para.scaling_available_governors,
-                scaling_available_governors, gov_num * CPUFREQ_NAME_LEN);
-    xfree(scaling_available_governors);
-    if ( ret )
-        return ret;
+        if ( ret )
+            return ret;
 
-    op->u.get_para.u.s.scaling_cur_freq = policy->cur;
-    op->u.get_para.u.s.scaling_max_freq = policy->max;
-    op->u.get_para.u.s.scaling_min_freq = policy->min;
+        op->u.get_para.u.s.scaling_cur_freq = policy->cur;
+        op->u.get_para.u.s.scaling_max_freq = policy->max;
+        op->u.get_para.u.s.scaling_min_freq = policy->min;
 
-    if ( policy->governor->name[0] )
-        strlcpy(op->u.get_para.u.s.scaling_governor,
-            policy->governor->name, CPUFREQ_NAME_LEN);
-    else
-        strlcpy(op->u.get_para.u.s.scaling_governor, "Unknown", CPUFREQ_NAME_LEN);
+        if ( policy->governor->name[0] )
+            strlcpy(op->u.get_para.u.s.scaling_governor,
+                policy->governor->name, CPUFREQ_NAME_LEN);
+        else
+            strlcpy(op->u.get_para.u.s.scaling_governor, "Unknown",
+                    CPUFREQ_NAME_LEN);
 
-    /* governor specific para */
-    if ( !strncasecmp(op->u.get_para.u.s.scaling_governor,
-                      "userspace", CPUFREQ_NAME_LEN) )
-    {
-        op->u.get_para.u.s.u.userspace.scaling_setspeed = policy->cur;
-    }
+        /* governor specific para */
+        if ( !strncasecmp(op->u.get_para.u.s.scaling_governor,
+                          "userspace", CPUFREQ_NAME_LEN) )
+            op->u.get_para.u.s.u.userspace.scaling_setspeed = policy->cur;
 
-    if ( !strncasecmp(op->u.get_para.u.s.scaling_governor,
-                      "ondemand", CPUFREQ_NAME_LEN) )
-    {
-        ret = get_cpufreq_ondemand_para(
-            &op->u.get_para.u.s.u.ondemand.sampling_rate_max,
-            &op->u.get_para.u.s.u.ondemand.sampling_rate_min,
-            &op->u.get_para.u.s.u.ondemand.sampling_rate,
-            &op->u.get_para.u.s.u.ondemand.up_threshold);
+        if ( !strncasecmp(op->u.get_para.u.s.scaling_governor,
+                          "ondemand", CPUFREQ_NAME_LEN) )
+            ret = get_cpufreq_ondemand_para(
+                &op->u.get_para.u.s.u.ondemand.sampling_rate_max,
+                &op->u.get_para.u.s.u.ondemand.sampling_rate_min,
+                &op->u.get_para.u.s.u.ondemand.sampling_rate,
+                &op->u.get_para.u.s.u.ondemand.up_threshold);
     }
 
     return ret;
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 6737798e25..f90e9d3a6c 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -255,5 +255,7 @@ void intel_feature_detect(struct cpufreq_policy *policy);
 int hwp_cmdline_parse(const char *s, const char *e);
 int hwp_register_driver(void);
 bool hwp_active(void);
+int get_hwp_para(unsigned int cpu,
+                 struct xen_cppc_para *cppc_para);
 
 #endif /* __XEN_CPUFREQ_PM_H__ */
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 5a30b16fcf..cf27f8f2f9 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -296,6 +296,61 @@ struct xen_ondemand {
     uint32_t up_threshold;
 };
 
+struct xen_cppc_para {
+    /* OUT */
+    /* activity_window supported if set */
+#define XEN_SYSCTL_CPPC_FEAT_ACT_WINDOW  (1 << 0)
+    uint32_t features; /* bit flags for features */
+    /*
+     * See Intel SDM: HWP Performance Range and Dynamic Capabilities
+     *
+     * These four are 0-255 hardware-provided values.  They're "continuous,
+     * abstract unit-less, performance" values.  Smaller numbers are slower
+     * and larger ones are faster.
+     */
+    uint32_t lowest;
+    uint32_t lowest_nonlinear; /* HWP: most_efficient */
+    uint32_t nominal; /* HWP: guaranteed */
+    uint32_t highest;
+    /*
+     * See Intel SDM: IA32_HWP_REQUEST MSR (Address: 774H Logical Processor
+     * Scope)
+     *
+     * These are all hints, and the processor may deviate outside of them.
+     * Values below are 0-255.
+     *
+     * minimum and maximum can be set to the above hardware values to constrain
+     * operation.  The full range 0-255 is accepted and will be clipped by
+     * hardware.
+     */
+    uint32_t minimum;
+    uint32_t maximum;
+    /*
+     * An explicit performance hint, disabling hardware selection.
+     * 0 lets the hardware decide.
+     */
+    uint32_t desired;
+    /*
+     * Hint to hardware for energy/performance preference.
+     * 0:   Performance
+     * 128: Balance (Default)
+     * 255: Powersaving
+     */
+    uint32_t energy_perf;
+    /*
+     * Activity Window is a moving history window for the processor's operation
+     * calculations, controlling responsiveness.  Measured in microseconds
+     * encoded as:
+     *
+     * bits 6:0   - 7bit mantissa
+     * bits 9:7   - 3bit base-10 exponent
+     * btis 15:10 - Unused - must be 0
+     */
+#define XEN_CPPC_ACT_WINDOW_MANTISSA_MASK  0x07f
+#define XEN_CPPC_ACT_WINDOW_EXPONENT_MASK  0x380
+    uint32_t activity_window;
+};
+
 #define XEN_HWP_DRIVER_NAME "hwp"
 
 /*
@@ -333,6 +388,7 @@ struct xen_get_cpufreq_para {
                 struct  xen_ondemand ondemand;
             } u;
         } s;
+        struct xen_cppc_para cppc_para;
     } u;
 
     int32_t turbo_enabled;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 13:07:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 13:07:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568941.889163 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvHX-00036K-An; Mon, 24 Jul 2023 13:07:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568941.889163; Mon, 24 Jul 2023 13:07:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvHX-00034a-2v; Mon, 24 Jul 2023 13:07:23 +0000
Received: by outflank-mailman (input) for mailman id 568941;
 Mon, 24 Jul 2023 13:07:21 +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
 <SRS0=ymW7=DK=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qNvAC-0003BP-S7
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:59:48 +0000
Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com
 [2607:f8b0:4864:20::830])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f7389760-2a21-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:59:47 +0200 (CEST)
Received: by mail-qt1-x830.google.com with SMTP id
 d75a77b69052e-40398ccdaeeso23762401cf.3
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 05:59:47 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 d3-20020ac81183000000b00402364e77dcsm3273060qtj.7.2023.07.24.05.59.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 05:59:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f7389760-2a21-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690203585; x=1690808385;
        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=imeu59UbyEmxk/60do4rzt8IPOfqsoGRviRd+fRZmSg=;
        b=YpASQfLFnytk7VP1bYkLDavSb/M7qd+uwPu4j/tOJgE5DRIu7gma192+clwRqdJuSs
         rIuQfdHnqHXy3e1UUEJpOjUIxPPWgGTw+v0AnhDalZxIhlug0+RQ637d6jWkUsKo8C1w
         MqGLyfSyGk9EZHH+6S1/Tfq8H4euU6QRByDkEMyhaiitQwMKHMV8VjghKruObmaf69D9
         spTezGDsliw9sZDh33Yh1thB5Ej2WqN1lUkKp0aNlm/Vb7hNgcU4AklkB09Z6AgGL0hW
         +KEYT8da4xuymbRt6PTZGSRjp/62YfUBRP/mFrEwaA7rO7TSc/eufl/D/YiOxte9EeS1
         c/HA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690203585; x=1690808385;
        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=imeu59UbyEmxk/60do4rzt8IPOfqsoGRviRd+fRZmSg=;
        b=ItQ9noTB0JQB7tpqwAeJgmvRTHCU66+pnAJeG6wjIF7s2aI6+mc53ovGOalCw06zAx
         V8tcoEtBviFzLXmgMtrjfwD6lXwU4kUcsqe5Wz3Za6DZH/S3iiXM4LAMA6JZrdAGh1t/
         SM/hfGxVvSArrYlGiVLvMGIbMvle2yCsRhyR1SIgbxklOZvm+eNAYl/7VEAufrhV+5Fs
         bPQb4yprTvKa0rip5J99dLEp2qlhCNWM/HdLkQgcElulUVXiUKAN9yi4ZHppOzFk4dFd
         RJY28/k/VtnfkjHYL5IDPWKfB/gKtaaCYUAAZgfu/2wWvsOMm++tpxtA2X2XI2R9DPro
         ck6w==
X-Gm-Message-State: ABy/qLaz3BrVJRZFRhQrzI7L84FYUpW183hc7ZVANmMzvM01oBpEc4WV
	xXVy02kebzsJ2ozeEnBQ3T2TQ/3UzZY=
X-Google-Smtp-Source: APBJJlG/rhBl3LQx8RWGyPUb+9Q0wH7L9YDLHr0wfJ7kUnm/j+ZPWiPY15cIeGXKzDbhLYch0wNK6w==
X-Received: by 2002:ac8:7f55:0:b0:403:be32:7669 with SMTP id g21-20020ac87f55000000b00403be327669mr8463060qtk.51.1690203585422;
        Mon, 24 Jul 2023 05:59:45 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v6 11/15] xenpm: Print HWP/CPPC parameters
Date: Mon, 24 Jul 2023 08:58:53 -0400
Message-ID: <20230724125857.11133-12-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230724125857.11133-1-jandryuk@gmail.com>
References: <20230724125857.11133-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Print HWP-specific parameters.  Some are always present, but others
depend on hardware support.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
v2:
Style fixes
Declare i outside loop
Replace repearted hardware/configured limits with spaces
Fixup for hw_ removal
Use XEN_HWP_GOVERNOR
Use HWP_ACT_WINDOW_EXPONENT_*
Remove energy_perf hw autonomous - 0 doesn't mean autonomous

v4:
Return activity_window from calculate_hwp_activity_window
Use blanks instead of _ in output
Use MASK_EXTR
Check XEN_HWP_DRIVER name since governor is no longer returned
s/hwp/cppc

v5:
Add Jan's Reviewed-by
---
 tools/misc/xenpm.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 21c93386de..3abd99fd20 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -708,6 +708,46 @@ void start_gather_func(int argc, char *argv[])
     pause();
 }
 
+static unsigned int calculate_activity_window(const xc_cppc_para_t *cppc,
+                                              const char **units)
+{
+    unsigned int mantissa = MASK_EXTR(cppc->activity_window,
+                                      XEN_CPPC_ACT_WINDOW_MANTISSA_MASK);
+    unsigned int exponent = MASK_EXTR(cppc->activity_window,
+                                      XEN_CPPC_ACT_WINDOW_EXPONENT_MASK);
+    unsigned int multiplier = 1;
+    unsigned int i;
+
+    /*
+     * SDM only states a 0 register is hardware selected, and doesn't mention
+     * a 0 mantissa with a non-0 exponent.  Only special case a 0 register.
+     */
+    if ( cppc->activity_window == 0 )
+    {
+        *units = "hardware selected";
+
+        return 0;
+    }
+
+    if ( exponent >= 6 )
+    {
+        *units = "s";
+        exponent -= 6;
+    }
+    else if ( exponent >= 3 )
+    {
+        *units = "ms";
+        exponent -= 3;
+    }
+    else
+        *units = "us";
+
+    for ( i = 0; i < exponent; i++ )
+        multiplier *= 10;
+
+    return mantissa * multiplier;
+}
+
 /* print out parameters about cpu frequency */
 static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
 {
@@ -772,6 +812,32 @@ static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
                p_cpufreq->u.s.scaling_min_freq,
                p_cpufreq->u.s.scaling_cur_freq);
     }
+    else
+    {
+        const xc_cppc_para_t *cppc = &p_cpufreq->u.cppc_para;
+
+        printf("cppc variables       :\n");
+        printf("  hardware limits    : lowest [%u] lowest nonlinear [%u]\n",
+               cppc->lowest, cppc->lowest_nonlinear);
+        printf("                     : nominal [%u] highest [%u]\n",
+               cppc->nominal, cppc->highest);
+        printf("  configured limits  : min [%u] max [%u] energy perf [%u]\n",
+               cppc->minimum, cppc->maximum, cppc->energy_perf);
+
+        if ( cppc->features & XEN_SYSCTL_CPPC_FEAT_ACT_WINDOW )
+        {
+            unsigned int activity_window;
+            const char *units;
+
+            activity_window = calculate_activity_window(cppc, &units);
+            printf("                     : activity_window [%u %s]\n",
+                   activity_window, units);
+        }
+
+        printf("                     : desired [%u%s]\n",
+               cppc->desired,
+               cppc->desired ? "" : " hw autonomous");
+    }
 
     printf("turbo mode           : %s\n",
            p_cpufreq->turbo_enabled ? "enabled" : "disabled or n/a");
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 13:07:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 13:07:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568934.889143 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvHW-0002ki-37; Mon, 24 Jul 2023 13:07:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568934.889143; Mon, 24 Jul 2023 13:07:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvHV-0002kb-Uo; Mon, 24 Jul 2023 13:07:21 +0000
Received: by outflank-mailman (input) for mailman id 568934;
 Mon, 24 Jul 2023 13:07:20 +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
 <SRS0=ymW7=DK=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qNvAF-0003BP-Qv
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 12:59:51 +0000
Received: from mail-ua1-x933.google.com (mail-ua1-x933.google.com
 [2607:f8b0:4864:20::933])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f8d69074-2a21-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 14:59:49 +0200 (CEST)
Received: by mail-ua1-x933.google.com with SMTP id
 a1e0cc1a2514c-791a0651fa3so1320857241.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 05:59:49 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 d3-20020ac81183000000b00402364e77dcsm3273060qtj.7.2023.07.24.05.59.47
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 05:59:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f8d69074-2a21-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690203588; x=1690808388;
        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=0R7amCrxsMhk/Le+knMWaQSWNzoupdSkXPvXn+UKpgQ=;
        b=nkXapzFXswv4M2qZeuJs1O7uCd5V4Md52dgjw9n6keLY2lUVxU4blqr+PQxcBfZgpu
         tNst8zb3iPmBcZnnXhhQbQXSbC98XW9qT+nUVvm1FgjEN1iUwL92Lfv3iPoV0cBRa4VA
         q+SCUskLMPhfqmSonmiRn28zV6gWoYvcOmsKOEKNTF8wBYooeecqmAsWOrFC/RYmIwnU
         kM04/DiTZfYE7ijBpaY4kPrrVRU6cfReNHPJnhpeUJDjHxcywGLISQYvfP698pzDtq4q
         S9RN1zt3xq1KKO/szUyaxOW1pnIPJPdS0IVe9TJi7Nu09QGYDVrP5qBe2MJvifuW3iHi
         w8+A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690203588; x=1690808388;
        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=0R7amCrxsMhk/Le+knMWaQSWNzoupdSkXPvXn+UKpgQ=;
        b=V2ycK3lyrLp9r5GbeCd585OAO56vROAFlidjat99tp4klFHvoHmW1/yjCfkiZ7ovyW
         yD4rloQoX9ER+uA0FtVomihUxMmzO0SSWM9f+v6fVilfvxX0R8PfGK1mQNHDsGf4Xqrh
         uft95+4Abs1Yf3EbU91XOgRVW9z0e+NREjZq0zS5XIv0rgnVUn4g3Z0HlGDQ8pPOSrO9
         jq230IUabkFMJesy3w3qpAjgIQzfGS9rFhxYxc8Ed6jSRdmfA6cqzE5s3ZygXkAkw4Fn
         nNq+w+EFFvC085YDBA2ScdTFcNIfvi/d3xMqX9Q5rsJOVrLb21KeUvgStIcyK27qOUdc
         snog==
X-Gm-Message-State: ABy/qLYqtSFqbetTilPzowLEdMCvbrZCIMauDQOfCFdABvFvB7TWgn0A
	3sOYWiKw3TtTLmsMF2TDanlE9Mz0cfc=
X-Google-Smtp-Source: APBJJlEanse0YnKdH1Rlb7UfWyZbu05nmwdZT5ZGVpcEzvwgTXDuVBaCV3jHMzA6W8hLMcBaol41iA==
X-Received: by 2002:a67:f7d1:0:b0:443:8a7b:f76d with SMTP id a17-20020a67f7d1000000b004438a7bf76dmr2108344vsp.28.1690203587987;
        Mon, 24 Jul 2023 05:59:47 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 12/15] xen: Add SET_CPUFREQ_HWP xen_sysctl_pm_op
Date: Mon, 24 Jul 2023 08:58:54 -0400
Message-ID: <20230724125857.11133-13-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230724125857.11133-1-jandryuk@gmail.com>
References: <20230724125857.11133-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add SET_CPUFREQ_HWP xen_sysctl_pm_op to set HWP parameters.  The sysctl
supports setting multiple values simultaneously as indicated by the
set_params bits.  This allows atomically applying new HWP configuration
via a single wrmsr.

XEN_SYSCTL_HWP_SET_PRESET_BALANCE/PERFORMANCE/POWERSAVE provide three
common presets.  Setting them depends on hardware limits which the
hypervisor is already caching.  So using them allows skipping a
hypercall to query the limits (lowest/highest) to then set those same
values.  The code is organized to allow a preset to be refined with
additional parameters if desired.

"most_efficient" and "guaranteed" could be additional presets in the
future, but the are not added now.  Those levels can change at runtime,
but we don't have code in place to monitor and update for those events.

Since activity window may not be supported by all hardware, omit writing
it when not supported, and return that fact to userspace by updating
set_params.

CPPC parameter checking disallows setting reserved bytes and ensure
values are only non-zero when the corresponding set_params bit is set.
There is no range checking (0-255 is allowed) since hardware is
documented to clip internally.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>

---
v6:
Add () around bit test
Add U suffix to XEN_SYSCTL_ constants
Change -EINVAL returns to -ENOENT/-EOPNOTSUPP
Return success for no-op set_hwp_para()

v5:
Use cpufreq.h for include
Add () around bit test
Fix Configure typo
Drop duplicated energy_perf comment
Define XEN_SYSCTL_CPPC_ACT_WINDOW_MASK from *_MANTISSA_MASK and *_EXPONENT_MASK
Re-order XEN_SYSCTL_CPPC_SET_* flags to match field and hardware order.
Remove const from set_cppc param to update set_params
Skip Activity Window if not supported by hardware and clear set_params
Make parameter parsing consistent
Add an exit path when there are no parameters to write.
Expand the header file to cover the IN/OUT set_params.
Remove the "desired" lowest/highest checking as hardware clips internally

v4:
Remove IA32_ENERGY_BIAS support
Validate parameters don't exceed 255
Use CPPC/cppc name
set_cppc_para() add const
set_cppc_para() return hwp_cpufreq_target()
Expand sysctl comments

v3:
Remove cpufreq_governor_internal from set_cpufreq_hwp

v2:
Update for naming anonymous union
Drop hwp_err for invalid input in set_hwp_para()
Drop uint16_t cast in XEN_SYSCTL_HWP_SET_PARAM_MASK
Drop parens for HWP_SET_PRESET defines
Reference activity_window format comment
Place SET_CPUFREQ_HWP after SET_CPUFREQ_PARA
Add {HWP,IA32}_ENERGY_PERF_MAX_{PERFORMANCE,POWERSAVE} defines
Order defines before fields in sysctl.h
Use XEN_HWP_GOVERNOR
Use per_cpu for hwp_drv_data
---
 xen/arch/x86/acpi/cpufreq/hwp.c    | 101 +++++++++++++++++++++++++++++
 xen/drivers/acpi/pmstat.c          |  17 +++++
 xen/include/acpi/cpufreq/cpufreq.h |   2 +
 xen/include/public/sysctl.h        |  64 ++++++++++++++++++
 4 files changed, 184 insertions(+)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index 0dad23e330..05132095e7 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -21,6 +21,10 @@ static bool __ro_after_init feature_hdc;
 
 static bool __ro_after_init opt_cpufreq_hdc = true;
 
+#define HWP_ENERGY_PERF_MAX_PERFORMANCE 0
+#define HWP_ENERGY_PERF_BALANCE         0x80
+#define HWP_ENERGY_PERF_MAX_POWERSAVE   0xff
+
 union hwp_request
 {
     struct
@@ -539,6 +543,103 @@ int get_hwp_para(unsigned int cpu,
     return 0;
 }
 
+int set_hwp_para(struct cpufreq_policy *policy,
+                 struct xen_set_cppc_para *set_cppc)
+{
+    unsigned int cpu = policy->cpu;
+    struct hwp_drv_data *data = per_cpu(hwp_drv_data, cpu);
+    bool cleared_act_window = false;
+
+    if ( data == NULL )
+        return -ENOENT;
+
+    /* Validate all parameters - Disallow reserved bits. */
+    if ( set_cppc->minimum > 255 ||
+         set_cppc->maximum > 255 ||
+         set_cppc->desired > 255 ||
+         set_cppc->energy_perf > 255 ||
+         (set_cppc->set_params & ~XEN_SYSCTL_CPPC_SET_PARAM_MASK) ||
+         (set_cppc->activity_window & ~XEN_SYSCTL_CPPC_ACT_WINDOW_MASK) )
+        return -EINVAL;
+
+    /* Only allow values if params bit is set. */
+    if ( (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_DESIRED) &&
+          set_cppc->desired) ||
+         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_MINIMUM) &&
+          set_cppc->minimum) ||
+         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_MAXIMUM) &&
+          set_cppc->maximum) ||
+         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ENERGY_PERF) &&
+          set_cppc->energy_perf) ||
+         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ACT_WINDOW) &&
+          set_cppc->activity_window) )
+        return -EINVAL;
+
+    /* Clear out activity window if lacking HW supported. */
+    if ( (set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ACT_WINDOW) &&
+         !feature_hwp_activity_window ) {
+        set_cppc->set_params &= ~XEN_SYSCTL_CPPC_SET_ACT_WINDOW;
+        cleared_act_window = true;
+    }
+
+    /* Return if there is nothing to do. */
+    if ( set_cppc->set_params == 0 )
+        return 0;
+
+    /* Apply presets */
+    switch ( set_cppc->set_params & XEN_SYSCTL_CPPC_SET_PRESET_MASK )
+    {
+    case XEN_SYSCTL_CPPC_SET_PRESET_POWERSAVE:
+        data->minimum = data->hw.lowest;
+        data->maximum = data->hw.lowest;
+        data->activity_window = 0;
+        data->energy_perf = HWP_ENERGY_PERF_MAX_POWERSAVE;
+        data->desired = 0;
+        break;
+
+    case XEN_SYSCTL_CPPC_SET_PRESET_PERFORMANCE:
+        data->minimum = data->hw.highest;
+        data->maximum = data->hw.highest;
+        data->activity_window = 0;
+        data->energy_perf = HWP_ENERGY_PERF_MAX_PERFORMANCE;
+        data->desired = 0;
+        break;
+
+    case XEN_SYSCTL_CPPC_SET_PRESET_BALANCE:
+        data->minimum = data->hw.lowest;
+        data->maximum = data->hw.highest;
+        data->activity_window = 0;
+        data->energy_perf = HWP_ENERGY_PERF_BALANCE;
+        data->desired = 0;
+        break;
+
+    case XEN_SYSCTL_CPPC_SET_PRESET_NONE:
+        break;
+
+    default:
+        return -EINVAL;
+    }
+
+    /* Further customize presets if needed */
+    if ( set_cppc->set_params & XEN_SYSCTL_CPPC_SET_MINIMUM )
+        data->minimum = set_cppc->minimum;
+
+    if ( set_cppc->set_params & XEN_SYSCTL_CPPC_SET_MAXIMUM )
+        data->maximum = set_cppc->maximum;
+
+    if ( set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ENERGY_PERF )
+        data->energy_perf = set_cppc->energy_perf;
+
+    if ( set_cppc->set_params & XEN_SYSCTL_CPPC_SET_DESIRED )
+        data->desired = set_cppc->desired;
+
+    if ( set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ACT_WINDOW )
+        data->activity_window = set_cppc->activity_window &
+                                XEN_SYSCTL_CPPC_ACT_WINDOW_MASK;
+
+    return hwp_cpufreq_target(policy, 0, 0);
+}
+
 int __init hwp_register_driver(void)
 {
     int ret;
diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index e4e2df94a7..85097d463c 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -400,6 +400,19 @@ static int set_cpufreq_para(struct xen_sysctl_pm_op *op)
     return ret;
 }
 
+static int set_cpufreq_cppc(struct xen_sysctl_pm_op *op)
+{
+    struct cpufreq_policy *policy = per_cpu(cpufreq_cpu_policy, op->cpuid);
+
+    if ( !policy || !policy->governor )
+        return -ENOENT;
+
+    if ( !hwp_active() )
+        return -EOPNOTSUPP;
+
+    return set_hwp_para(policy, &op->u.set_cppc);
+}
+
 int do_pm_op(struct xen_sysctl_pm_op *op)
 {
     int ret = 0;
@@ -472,6 +485,10 @@ int do_pm_op(struct xen_sysctl_pm_op *op)
         break;
     }
 
+    case SET_CPUFREQ_CPPC:
+        ret = set_cpufreq_cppc(op);
+        break;
+
     case GET_CPUFREQ_AVGFREQ:
     {
         op->u.get_avgfreq = cpufreq_driver_getavg(op->cpuid, USR_GETAVG);
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index f90e9d3a6c..281e3f513d 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -257,5 +257,7 @@ int hwp_register_driver(void);
 bool hwp_active(void);
 int get_hwp_para(unsigned int cpu,
                  struct xen_cppc_para *cppc_para);
+int set_hwp_para(struct cpufreq_policy *policy,
+                 struct xen_set_cppc_para *set_cppc);
 
 #endif /* __XEN_CPUFREQ_PM_H__ */
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index cf27f8f2f9..3975050248 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -351,6 +351,68 @@ struct xen_cppc_para {
     uint32_t activity_window;
 };
 
+/*
+ * Set CPPC values.
+ *
+ * Configure the parameters for CPPC.  Set bits in set_params control which
+ * values are applied.  If a bit is not set in set_params, the field must be
+ * zero.
+ *
+ * For HWP specifically, values must be limited to 0-255 or within
+ * XEN_SYSCTL_CPPC_ACT_WINDOW_MASK for activity window.  Set bits outside the
+ * range will be returned as -EINVAL.
+ *
+ * Activity Window may not be supported by the hardware.  In that case, the
+ * returned set_params will clear XEN_SYSCTL_CPPC_SET_ACT_WINDOW to indicate
+ * that it was not applied - though the rest of the values will be applied.
+ *
+ * There are a set of presets along with individual fields.  Presets are
+ * applied first, and then individual fields.  This allows customizing
+ * a preset without having to specify every value.
+ *
+ * The preset options values are as follows:
+ *
+ * preset      | minimum | maxium  | energy_perf
+ * ------------+---------+---------+----------------
+ * powersave   | lowest  | lowest  | powersave (255)
+ * ------------+---------+---------+----------------
+ * balance     | lowest  | highest | balance (128)
+ * ------------+---------+---------+----------------
+ * performance | highest | highest | performance (0)
+ *
+ * desired and activity_window are set to 0, hardware selected.
+ */
+struct xen_set_cppc_para {
+#define XEN_SYSCTL_CPPC_SET_MINIMUM              (1U << 0)
+#define XEN_SYSCTL_CPPC_SET_MAXIMUM              (1U << 1)
+#define XEN_SYSCTL_CPPC_SET_DESIRED              (1U << 2)
+#define XEN_SYSCTL_CPPC_SET_ENERGY_PERF          (1U << 3)
+#define XEN_SYSCTL_CPPC_SET_ACT_WINDOW           (1U << 4)
+#define XEN_SYSCTL_CPPC_SET_PRESET_MASK          0xf0000000U
+#define XEN_SYSCTL_CPPC_SET_PRESET_NONE          0x00000000U
+#define XEN_SYSCTL_CPPC_SET_PRESET_BALANCE       0x10000000U
+#define XEN_SYSCTL_CPPC_SET_PRESET_POWERSAVE     0x20000000U
+#define XEN_SYSCTL_CPPC_SET_PRESET_PERFORMANCE   0x30000000U
+#define XEN_SYSCTL_CPPC_SET_PARAM_MASK \
+        (XEN_SYSCTL_CPPC_SET_PRESET_MASK | \
+         XEN_SYSCTL_CPPC_SET_MINIMUM     | \
+         XEN_SYSCTL_CPPC_SET_MAXIMUM     | \
+         XEN_SYSCTL_CPPC_SET_DESIRED     | \
+         XEN_SYSCTL_CPPC_SET_ENERGY_PERF | \
+         XEN_SYSCTL_CPPC_SET_ACT_WINDOW  )
+    /* IN/OUT */
+    uint32_t set_params; /* bitflags for valid values */
+    /* See comments in struct xen_cppc_para. */
+    /* IN */
+    uint32_t minimum;
+    uint32_t maximum;
+    uint32_t desired;
+    uint32_t energy_perf;
+#define XEN_SYSCTL_CPPC_ACT_WINDOW_MASK (XEN_CPPC_ACT_WINDOW_MANTISSA_MASK | \
+                                         XEN_CPPC_ACT_WINDOW_EXPONENT_MASK)
+    uint32_t activity_window;
+};
+
 #define XEN_HWP_DRIVER_NAME "hwp"
 
 /*
@@ -418,6 +480,7 @@ struct xen_sysctl_pm_op {
     #define SET_CPUFREQ_GOV            (CPUFREQ_PARA | 0x02)
     #define SET_CPUFREQ_PARA           (CPUFREQ_PARA | 0x03)
     #define GET_CPUFREQ_AVGFREQ        (CPUFREQ_PARA | 0x04)
+    #define SET_CPUFREQ_CPPC           (CPUFREQ_PARA | 0x05)
 
     /* set/reset scheduler power saving option */
     #define XEN_SYSCTL_pm_op_set_sched_opt_smt    0x21
@@ -444,6 +507,7 @@ struct xen_sysctl_pm_op {
         struct xen_get_cpufreq_para get_para;
         struct xen_set_cpufreq_gov  set_gov;
         struct xen_set_cpufreq_para set_para;
+        struct xen_set_cppc_para    set_cppc;
         uint64_aligned_t get_avgfreq;
         uint32_t                    set_sched_opt_smt;
 #define XEN_SYSCTL_CX_UNLIMITED 0xffffffffU
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 13:08:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 13:08:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568950.889183 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvIA-00054Q-Kb; Mon, 24 Jul 2023 13:08:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568950.889183; Mon, 24 Jul 2023 13:08:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvIA-00054H-HA; Mon, 24 Jul 2023 13:08:02 +0000
Received: by outflank-mailman (input) for mailman id 568950;
 Mon, 24 Jul 2023 13:08:01 +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 <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNvI9-0004Jx-A2
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 13:08:01 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20628.outbound.protection.outlook.com
 [2a01:111:f400:7d00::628])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1d076b24-2a23-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 15:07:59 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB7989.eurprd04.prod.outlook.com (2603:10a6:20b:28b::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 13:07:57 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 13:07:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1d076b24-2a23-11ee-8612-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=kziCq6r4qQZN8YVOJGl7Wun0n1cKIBwv/oW8mN9tQ9eD/8kgCRQgTeKT4d9WLqmf4krAbRAeKOTGoBMO+1YShYSy6iqpWkKMOs6mulGYuj9ZMjZGHUBLql8i62kPxdsUV+gUou9tWVNPuU2XVwh+G7wdivNDsOct2TNGDl60aS2NQnnAKcUtcoV591qRGICkKdFNdUPaj+84JQwLW1Q1/Jz9dT0Kmtv40SHtRY6wfpA6bHlV9IBSEXYqmn2Yg3loJ4NeJulciwHpubQvkqwvcJQ/LNZQCrAID2CJoFSA0bjZqJhEjR3j6lvcqk6lobkUPKcuFdADFiRm7khck0Mw1w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Gv9cDQKBaLCNl+zKIQICHTqpJqJNTHABuJriI3EDKmY=;
 b=So7tYg6FyYb62/7/zcHp8rWYa99se4r3Bdc0GPDaGi7PQ9kPXclUJdcEnV5xXf3ZQ1K0lv3U/tVATsZHNmuur+1e0Su5KN9BuPtjHw5t2lZpQfWLlwP2sUm/dxzWA9H41UEGM11xgOvtVzAnZpE31WvsWwF7XMhMnBDvvaDXahIu57r+R9Ugd0+WZ9ngzDqv7z2z3MG7ebNOW7ukqv7YgjbqWYikhslG8C90YjIG/AvejxYE3gL5QdgqVXSPDdF83d3jn3fGfj2mOCgeWed/odI9nGI2p30DHhwB++Bt5lrlqKP6GolRyspKPR0asFiqsaTRZ5e4TfamwVJungcomA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Gv9cDQKBaLCNl+zKIQICHTqpJqJNTHABuJriI3EDKmY=;
 b=R4Kx1I8kS+Xuj9kkxr6qHw9bIM8e9ilWqL4lMvTkfZokNg6TyR7uBeSNjj3IAjXcFohMbQfEoFckVUZAO2sDyLghWBgrUmUKzx/XUGfecFbVJak3mobLD6UsR9X9qYBlsV0+amnS32XGM7HqQwlN07PEpE8UoHwrhLBGKeVhBVNn9Eb6f8Asqky/jCyJgMUhaGV8M+6lVJV/7RCYNVp2uvEnDTfFfnLlRRng1MphzGLj97riqu+ueCP9iZsyD6j3Vq0hS8Gi4OMWnu+kBEpRr5S3bs8h0lufBggq4ah5assMNXZl1XP7scRRZEBqQVEKZQfI91kvH9KEez2o6QDgfQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <8e9a47c3-1c1e-6075-f462-5cadec80c28a@suse.com>
Date: Mon, 24 Jul 2023 15:07:55 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v5 0/4] Early serial on Power
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 xen-devel@lists.xenproject.org
References: <cover.1689958538.git.sanastasio@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <cover.1689958538.git.sanastasio@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0256.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b5::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB7989:EE_
X-MS-Office365-Filtering-Correlation-Id: 6d0f8ade-05b3-441c-1eb2-08db8c46ffb2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	+gsyaGlQ8q2uJ234GxdxL8vJx++gWbrX7MeYJvBbj0prwms9v/57KraBNJoQGfL0noxR1I8rGpsm9sP+H1inFofHq+dapfH0fzO8q408dEPZEnmdNMfAH56Vqz7RhXvgpJt9WAcCx7yBejZmi0dBuXjUKBLI2sNjq/Wsk7Sx9u6MiZNsdjjBOeL6U3e2gEQVrhnnJhdoco98qlvstbO5dvnRTD45y679j89dJ+kMRkLMIroF/dTujffAWdz8Lxnh2A+EcJ5HTig1vTlNSXsUr4OHZwsIX10AIjeqlQgRlax7I8tZzrbjI0aA4kQDyRztUVEuKAAhQvjw82uy3e+W+L33JydnRcnhcKjc2PlJaFBRj4Y+RcDxPt+XFfrVjsLg+a0iN+tpfkGLe/gYfbZhU6aXy3Z3a+HI/cXwaQEUfomvlFFpFYd1Ik4l2zsSMkJxrCwfTCwd4v4Pdsn0uvGcxofwCSRwTZUC0G8dMDAvTnsdiOGP7qNDtzGvlLx0GoChhulXoyR6aaeVMX/CxcRP2ZKieR5s8YzoF6KjpEOiLvktDRG1fzL3/CKvzrGP3nSDByryZ/OhvkONv3GUqR5djtkv/Ir4604gBxNuvgKEL9omlfnx81vrMMVl7LXA2Pnm32qB0lZgUZj7qlrvLSzVRQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(376002)(366004)(346002)(136003)(39860400002)(451199021)(6512007)(6486002)(478600001)(54906003)(186003)(53546011)(2616005)(6506007)(26005)(2906002)(4744005)(41300700001)(66946007)(66556008)(66476007)(6916009)(4326008)(5660300002)(8676002)(8936002)(316002)(38100700002)(36756003)(31696002)(86362001)(83380400001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YnNPdzRZTnBkRU85UjBvTE1IVW1sNVNGQU1vWm5ZQUtTbzBzSHpaUG9vMTBH?=
 =?utf-8?B?UDlkeWljOGFqZDJFRk8xNUJ0S2VnNnJ4SUlSaFFwZjYvYU5FVkJIUlNqdW93?=
 =?utf-8?B?RmIyM0xsb1RWUDFxRzFHZFJWT1dDdk9uWlpsSVM0RGZHMjR5NEdaeW9XcnQw?=
 =?utf-8?B?N0RPakNzcDJ6SzJmZm55bkdMSUVILzRPU0EwTzhsS1F3SUxtVTRGUmdEaFpM?=
 =?utf-8?B?eEt3RWwrZnp1M0dHTFJIdFNOUTArVFlYcVJMM2c2WEFUQXlKby9lU2w5ZzJr?=
 =?utf-8?B?bjlWNjE4RU0rdnZrRmw2cHViY2syQU44SEZsTWdPeVoxck9RVjRHdjlHNk5Z?=
 =?utf-8?B?cXdjVFNXeVpCWXRuQXMxSjFoR1ZTNTdiUzJsM2FmNDZiZUtTOGZNaHZRbjRC?=
 =?utf-8?B?REk5Z3RseHNveXRHK0l3NWNqKzJwWW9YaENEdlBQQ3NsL29zTkhvK2FJRHFX?=
 =?utf-8?B?QlhKRjRnRGNvQjZoTGJtR2ppMHMrSFdlUFI4TytrWWN1ZUo2d3Znbm51MGVV?=
 =?utf-8?B?ck84dGU0dUdQMWNZRWsxR3BjbkVFeENGcWpUenV5ay8vZGg3OHEzaWVHMEYv?=
 =?utf-8?B?R1QydUtYQ2hWWGdseHFkN3ZXQ085MkFDclZEVSsxV0FMWlZpQkZuclQ4Vlhi?=
 =?utf-8?B?SU1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bzN2S2NNOVFYa1pUbVlFbTBj?=
 =?utf-8?B?dm83RHNFRTR2eDFxSXRGMS9kbFRBcUdISzRFMzF3Qjc1ekswbUZzNllqYVpl?=
 =?utf-8?B?dDkvY3dPbG1XaVltbHdLOFNsUFVSV2dyRldCU1lzNW1jalNTRlhEVjdNam9D?=
 =?utf-8?B?bkJ2MlpjcllNODFUajQyV3FNa2M2Q0lueHpvcEQ3VW9ldXRmZEFTTnFZZ0s3?=
 =?utf-8?B?RWlSQlZtVG55ZVltOWcvZEtHWkZ0T1huMHA2ZmlhaktuTXNURjRWalVZNXhK?=
 =?utf-8?B?V2szcGVTMlREbUdzVVlHU0RJT2U3ZjJWWkg5a09RcWVudEE3WVlYUXVaam96?=
 =?utf-8?B?VnREc01qWjZKRkZ2UTlHd3RRMnZnMHBzOS90cWFldFBvb2dROGVhWVQ0NHdS?=
 =?utf-8?B?aWo1Y01RQ28rdnpLMUJiUEgxYlhlM0R0UlNIbEVCOVVHU3FCUk5yaXJNa2pE?=
 =?utf-8?B?ZmVoMUFNRFFlSWVvdGpYOTN0V2JaN1ZSM3EyK0M2ZmV2V1p2akhCb2tYWm0w?=
 =?utf-8?B?bkd1eElQVWNhV2pqRnk5cDV3OTZZYUoyMXRwc2tRMzJmZWxVZVIwMjkzU1do?=
 =?utf-8?Q?mk5wa9uRpzGbspyydrjGQwqDD?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6d0f8ade-05b3-441c-1eb2-08db8c46ffb2
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 13:07:57.1973
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: I9z9BdPfd3BySLp3bsqI2Yu1XBjAsCIINcmzZ1+B8l578qtWQ78FbKvCkS9eR+ur7iO8LCzcNuSy8WnH8zSYFQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7989

On 21.07.2023 19:02, Shawn Anastasio wrote:
> Changes in v5:
>   - (xen/macros.h) Add signoff
>   - (xen/macros.h) Fix up comment formatting and macro parameter names
>   - (*.S) Use 8-space column alignment for assembly
>   - (of-call.S) Add missing space after comma
>   - (asm-offsets.c) Fix DEFINE() macro formatting
>   - (asm-offsets.c) Replace _Static_assert with BUILD_BUG_ON

One more general remark / request: Having change logs in cover letters
is certainly okay and better than none at all, but for review purposes
it is far more useful when provided in the individual patches. Not the
least because, as you will likely understand, the larger the series, the
harder it is to associate each of the remarks here with individual
patches.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 13:16:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 13:16:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568954.889192 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvPj-0006re-I1; Mon, 24 Jul 2023 13:15:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568954.889192; Mon, 24 Jul 2023 13:15:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvPj-0006rX-Eu; Mon, 24 Jul 2023 13:15:51 +0000
Received: by outflank-mailman (input) for mailman id 568954;
 Mon, 24 Jul 2023 13:15:50 +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
 <SRS0=AOzI=DK=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qNvPi-0006rR-Hs
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 13:15:50 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 345ec366-2a24-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 15:15:48 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.162.132.135])
 by support.bugseng.com (Postfix) with ESMTPSA id 61D1F4EE0737;
 Mon, 24 Jul 2023 15:15:46 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 345ec366-2a24-11ee-8612-37d641c3527e
Message-ID: <33af17e5-2942-e263-22bf-7e60148e1de1@bugseng.com>
Date: Mon, 24 Jul 2023 15:15:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
Subject: Re: [XEN PATCH] xen/arm: p2m: refactor 'p2m_get_entry'
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <118566cd8b9ebbcedd2b610f5f602cc31c12fd55.1689922099.git.nicola.vetrini@bugseng.com>
 <9c1b7c53-f8da-76a2-cc02-7c72a3030be4@xen.org>
Content-Language: en-US
In-Reply-To: <9c1b7c53-f8da-76a2-cc02-7c72a3030be4@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 21/07/23 12:01, Julien Grall wrote:
> Hi Nicola,
> 
> I would add "to please ECLAIR" in the commit title.

I would be against this. It's the MISRA assessor that needs
to understand and agree on what has been done to claim MISRA compliance. 
A static analysis tool is just a useful way to help reaching this aim.

> 
> On 21/07/2023 07:49, Nicola Vetrini wrote:
>> This function is refactored to avoid using a
>> local dummy variable that served as a fallback
>> if the parameter 't' is NULL.
>>
>> Storing the address of that variable into 't' caused
>> static analysis tools not to be able to recognize the
> 
> Can you mention which static analysis tools is not happy and the 
> version? This could help us in the future if we decided to revert the 
> patch.
> 

It is not a matter of tool happiness, but of MISRA compliance.
There are several tools (even emblazoned ones) that have lots
of false negatives, also for mandatory guidelines such as Rule 9.1:
the fact that they do not issue messages for possible violations
they cannot exclude is happiness for nobody (especially for those
who have to ensure there are indeed no violations). Two things
that have to be kept well in mind are:

1) Rule 9.1 is undecidable, there will never be a tool that flags all
    and only the violations; tools will false positives, false negatives
    or both. ECLAIR (all versions of it) errs on the safe side.

2) Safety-critical code has to be boring and obviously correct:
    programming virtuosism and safety are in two very different leagues.
    This is why ECLAIR uses the algorithm it uses: typically when it
    issues a caution the code is not obviously correct.

Kind Regards,

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 13:16:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 13:16:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568958.889202 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvQC-0007KJ-PW; Mon, 24 Jul 2023 13:16:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568958.889202; Mon, 24 Jul 2023 13:16:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvQC-0007KA-Mw; Mon, 24 Jul 2023 13:16:20 +0000
Received: by outflank-mailman (input) for mailman id 568958;
 Mon, 24 Jul 2023 13:16:20 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qNvQC-0007K2-3j
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 13:16:20 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNvQB-0000vC-8U; Mon, 24 Jul 2023 13:16:19 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNvQA-00049t-V5; Mon, 24 Jul 2023 13:16:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=bz+o/Hq9OltO/IW7Qgu7d5gD1r3RxbSX/CoTGtoJgcU=; b=h8ohktsOIpVk1qdwbp/Xt42hsk
	Yponiq4vOAFc5VcykOCN3MaQWkCTa7ce0GGr61qnseIuR+dMtVu5DMmTo7IjkEjJGqQclLc7naDIS
	AOsR231xAPTpKm9LSiYNs4nUbRQWba3rN4hob6BV/72v9YVoGnQG9aMkWu7464E/oPdY=;
Message-ID: <9de1b328-a1d3-1544-addb-5909618df2ba@xen.org>
Date: Mon, 24 Jul 2023 14:16:17 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH] xen/dt: Rework the prototype of dt_property_read_string()
 to help Eclair
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: Julien Grall <jgrall@amazon.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230724102443.91894-1-julien@xen.org>
 <014b6c1a-9e83-15f7-67d7-74afaf97b9a2@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <014b6c1a-9e83-15f7-67d7-74afaf97b9a2@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Nicola,

On 24/07/2023 13:58, Nicola Vetrini wrote:
> 
> 
> On 24/07/23 12:24, Julien Grall wrote:
>> From: Julien Grall <jgrall@amazon.com>
>>
>> Eclair vXXX is unable to prove the parameter out_string will only be
>> used the return of dt_property_read_string() is 0. So it will consider
>> that MISRA C:2012 Rule 9.1 was violated.
> 
> This is not correct: ECLAIR cannot prove that the rule is not violated, 
> and hence emits a caution, because the analysis is sound.

Ok. How about: "So it will not be able to prove that MISR C:2012 Rule 
9.1 wasn't violated"?

> 
>>
>> Rework the prototype so the string is returned and use ERR_PTR() to
>> embed the error code.
>>
>> Signed-off-by: Julien Grall <jgrall@amazon.com>
>>
>> ---
>>
>> The XXX should be replaced with the version of Eclair. Nicola, can you
>> provide it?
> 
> I don't see as valuable mentioning ECLAIR at all, but rather explain 
> what the change is about (encoding the error value as a return value and 
> removing the **out_value parameter).
If Eclair didn't report a caution, then I would not have spent time 
writing this patch.

Also, the point of mentioning the Eclair version is that if someone ever 
want to change the prototype back to where it was (e.g. because another 
tools is unhappy), then we have some details on why it was done and way 
to reproduce. This would avoid endless argument on the ML on whether it 
is safe to revert it.

So overall, the value is not necessarily for today, but for the future 
reader.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 13:16:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 13:16:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568960.889213 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvQQ-0007fk-2I; Mon, 24 Jul 2023 13:16:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568960.889213; Mon, 24 Jul 2023 13:16:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvQP-0007fa-Ts; Mon, 24 Jul 2023 13:16:33 +0000
Received: by outflank-mailman (input) for mailman id 568960;
 Mon, 24 Jul 2023 13:16:32 +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
 <SRS0=Klik=DK=citrix.com=prvs=5629c81f5=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qNvQO-0006rR-6d
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 13:16:32 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4c3e9cb3-2a24-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 15:16:29 +0200 (CEST)
Received: from mail-bn8nam12lp2175.outbound.protection.outlook.com (HELO
 NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.175])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 24 Jul 2023 09:16:21 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB7026.namprd03.prod.outlook.com (2603:10b6:a03:4e8::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 13:16:19 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 13:16:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4c3e9cb3-2a24-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690204589;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=C3BhfwxYchidX/CRUxuGBTjl1R5AfE+43xhmaIwGhQo=;
  b=D7dQ2/pnpZ3pywcXqz1D7ybwoEcpR92xXnWm4395o0HdWuWxu7vjmDV1
   RhxApsUkFmCjxgddMCRBartJFvdvm4d8h9YQW+prtNBDhfg1XCtxzy2i6
   6ryFny+p5LwH8Tdqyk2Bq34YmEz0ogVM8ld3mVJXorhQEvWuLkUSl57yz
   4=;
X-IronPort-RemoteIP: 104.47.55.175
X-IronPort-MID: 119843685
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:RvHpDK/j4dSGieXcWDcbDrUDUH+TJUtcMsCJ2f8bNWPcYEJGY0x3y
 zYaCG/Tb6neYGr1LowiOtmy8U8Eu8WAyoJqSQJspXg8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s
 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk
 d7pqojUNUTNNwRcawr40Ird7ks21BjOkGlA5AdmOqoQ5AS2e0Q9V/rzG4ngdxMUfaEMdgKKb
 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk
 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklF6
 KIfOh9UMCmfuKWN5JKlas50nfw8eZyD0IM34hmMzBn/JNN/G9XpZfWP4tVVmjAtmspJAPDSI
 dIDbiZiZwjBZBsJPUoLDJU5n6GjgXyXnz9w8QrJ4/ZopTWOilUujdABM/KMEjCObd9SkUuC4
 HrP4kzyAw0ANczZwj2Amp6prraWzHOnA9xCSdVU8NZh2HOiljNKKycoSFqLodiUlBDhQ91Qf
 hl8Fi0G6PJaGFaQZtv3UgC8oXWElgUBQNcWGOo/gCmzza7T7xecF3IzZDdLY9w7t+c7XTUvk
 FSOmrvBIjhis6acT36HwZ6SoSmvIigeLWIEZigsQBMM5p/op4RbpgLCSJNvHbC4ivXxGCrs2
 HaaoS4mnbIRgMUXkaKh8jj6bymEo5HISks/4FXRV2f8tAdhPtf6Osqv9ETR6utGIMCBVF6ds
 XMYms+YqucTEZWKky/LS+IIdF2028u43PTnqQYHN/EcG/6FohZPoag4DOlCGXpU
IronPort-HdrOrdr: A9a23:f0J4G6iAIOebGZXsiQBgzVmZunBQXioji2hC6mlwRA09TyX5ra
 2TdZUgpHvJYVMqMk3I9uruBEDtex3hHP1OkOws1NWZLWrbUQKTRekP0WKF+Vzd8kXFndK1vp
 0QEZSWZueRMbEAt7ec3OG5eexQvOVu8sqT9JjjJ6EGd3AVV0lihT0JezpyCidNNW977QJSLu
 vn2iJAzQDQAEg/X4CAKVQuefPMnNHPnIKOW296O/Z2gDP+9Q9B8dTBYmOl4is=
X-Talos-CUID: =?us-ascii?q?9a23=3AoSJMVmg/YJnKGjk6FDtXK4P89jJueWCDy2X/ehG?=
 =?us-ascii?q?BFVkuc5m1V3+34LhcjJ87?=
X-Talos-MUID: 9a23:oGyscwQJ3RXRZoBuRXTn3B9TZJgxwJ6QFUE9kbQrpZfbLSN/bmI=
X-IronPort-AV: E=Sophos;i="6.01,228,1684814400"; 
   d="scan'208";a="119843685"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=B3fWN55LwSV+/07AXWu9jV02PDA6ZaYmh26UjB16U6od0u8pYyC333WrpY4RezP4L+RSbn6Q6mKTj60dbkTg5OqntmHzT3xeSfVFPyTgSssRjQkoPc0yYODYc/v9bNSq0HFB78T6U/LviGHaNcAobEe9E9fdtf0Rp4oTPN0qrX3NraXFoQldAE31HtBwf5rOgvr7A7zKAKYnJ/i1V5wqVxN125wofT1n1gXI+vbZw7JFYFSr63iUEBpg35b7CjTQzupG4stQ81u6SqJuOzAP4BT+3g/BzrBbDAB49Qf4hdPORQFXaq15wyMa+CPEarToSbE012SnMP7XdpYG+Yudtg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=1vNs+4AI76zkJDkRv5AgPDPbYeF+/XeT2zqMQI2mYSA=;
 b=h7KqaULSz+FJ5mhvJtB2oil6+GuWZu5l7xeDC2lJUC9t9qE82wFZiOw2l37NZChwg0urgOr4+8PmcBkSEIaIQ+ASEoIW3fksmgg7FWgw/q2ahx7JN7CU/WPhyvcy/Aoitpo91jxiMSLkFCjS0Aeyw3P8IBWyU2BPzYn61JXWuO+fJhMAe9Geg5Av7mAP3fJohtmh3tlAkCupwIxLN+T4uQRlDt1DmJectqKWVVczZc/XuHVD+DwdrQrkPtmYBGMLKB0IE1VccCaQFddIOEZSAGJGVbP+x/MVPlFzoUCvWMDJhMdZ4tWU8O8QBf4ZIpKCeC1cX4WooWOypewP4CsV2Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=1vNs+4AI76zkJDkRv5AgPDPbYeF+/XeT2zqMQI2mYSA=;
 b=lm5ubIecprGCZdpoIJ9e8DKDgWmtJVaiJXBLe1y6uNI3F+dQb70Xj41luuJ51o89xv5pUXz7ePRHTBrz7wTEmAaFAuAfTb05ec0jmLqdCdJZWX6/f7AVHf7LALIgCWpAgp9ly+kAq6CqoRQEQajMpb3Bg0y4Fz/fKKbFVmQjYpA=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Mon, 24 Jul 2023 15:16:13 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v8 08/13] vpci/header: program p2m with guest BAR view
Message-ID: <ZL55nfjyL-WpIWyt@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-9-volodymyr_babchuk@epam.com>
 <f2b8945e-cedf-3b38-042c-7b1288cfcde7@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <f2b8945e-cedf-3b38-042c-7b1288cfcde7@suse.com>
X-ClientProxiedBy: LO4P302CA0039.GBRP302.PROD.OUTLOOK.COM
 (2603:10a6:600:317::12) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB7026:EE_
X-MS-Office365-Filtering-Correlation-Id: 3ba0fa0a-61d5-45f0-37b3-08db8c482b2d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	dqlvJDJ8XVRg/nDthKILOdtp/jFWz3PoToC6N/xo3IfeMmXuTVTCCzyamTps/EDMVheFiQgD1oFgJ+8pJCEsq2ex84EurXD5EkgiF2XtVUaaz9cYEIVxXVFJs1xc8Jz218uSVW4wndyT13/4e52fDEr9K/CGsezjw0rnSy/Anrw5l2lVNsOFaQOeTbKw+Cz1W9FhsnmQeixVfr4YAgWWr4XZ/UsQdp/rFgQ2AlH7Lb04dJqwZvu5Xd7Cqi9StDB7MztZJ0L3lzVMtlpPhxRIrdnSHAoTLTgDXAwkMD53ViJ+4uaJNgZlN8XSLK+uYYaq9PnyyAQ7k0iAiUWQ07xvwHB0T51sQjXcQBzOVpNGdMUJVYKA+LmRbBAK4RoKaSFnxSHjAOjf8dPrz7IPm+b53KBjskbcXp3eBtDVZLTlwwXjfU43S3l66EDNi6foersmUVaFPTViYN29bfHjyXnHmwuNN6U9XPlD9BJpFE9wLuP4VEEzpW9zE4iKzQq5Dp8oeNWbFnY71q30tS1c7ud2tLDR5HgyiIzmZpZ4Ji7g7emz292KmjvvS1tdMp0VEblH
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(39860400002)(376002)(346002)(366004)(451199021)(26005)(186003)(6506007)(53546011)(83380400001)(66476007)(66556008)(66946007)(4326008)(6916009)(316002)(8936002)(8676002)(5660300002)(41300700001)(6512007)(6666004)(9686003)(6486002)(2906002)(54906003)(478600001)(38100700002)(85182001)(86362001)(82960400001)(66899021);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NVFUWnlxQi8vTy9Wa0RnclNtOEFTVG1wUW9OZzZrTG42eWNNNnVWM1R0WGZq?=
 =?utf-8?B?bFBVSk5zQUc2cW8zbFNHSkUxbzNITEcyejJENW9C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r0B1BFhLMeyPwmp9EcZ3Cxcd7qR1QycQ8BnINn4pXH4Qt0HoWBPzEkSRG+06xU21z+SeF/kVRcjRUtcMWiqR+xOolYaimc43dY79e3kWy74LRIWKmtRxH59DNm6hpZKIMOlSCxLdwShdVWdX2TzTKt5gLANvjRY5D+QFUZunxEVVnnLAgLqQQNywDrcbh1l/Yz3tNJhXKz7JSuuZ4KEl/bHYN4V0T7ZnR97t2dCIjm1isDg==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3ba0fa0a-61d5-45f0-37b3-08db8c482b2d
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 13:16:19.5374
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: yjrGRBsuYRBQn6ExAHFrFdJAdS0OecncXh4gw9lnu54OIRCobmjnl4TEdnBfsLtv6oSR7jWTv4XynHlw/VC+3Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB7026

On Mon, Jul 24, 2023 at 12:43:26PM +0200, Jan Beulich wrote:
> On 20.07.2023 02:32, Volodymyr Babchuk wrote:
> > @@ -52,8 +66,8 @@ static int cf_check map_range(
> >           * - {un}map_mmio_regions doesn't support preemption.
> >           */
> >  
> > -        rc = map->map ? map_mmio_regions(map->d, _gfn(s), size, _mfn(s))
> > -                      : unmap_mmio_regions(map->d, _gfn(s), size, _mfn(s));
> > +        rc = map->map ? map_mmio_regions(map->d, start_gfn, size, _mfn(s))
> > +                      : unmap_mmio_regions(map->d, start_gfn, size, _mfn(s));
> 
> Aiui this is the first direct exposure of these functions to DomU-s;

I guess it depends on how direct you consider exposure from
XEN_DOMCTL_memory_mapping hypercall, as that's what gets called by
QEMU also in order to set up BAR mappings.

> so far all calls were Xen-internal or from a domctl. There are a
> couple of Arm TODOs listed in the comment ahead, but I'm not sure
> that's all what is lacking here, and it's unclear whether this can
> sensibly be left as a follow-on activity (at the very least known
> open issues need mentioning as TODOs).
> 
> For example the x86 function truncates an unsigned long local
> variable to (signed) int in its main return statement. This may for
> the moment still be only a theoretical issue, but will need dealing
> with sooner or later, I think.

One bit that we need to add is the iomem_access_permitted() plus the
xsm_iomem_mapping() checks to map_range().

> Furthermore this yet again allows DomU-s to fiddle with their p2m.
> To a degree this is unavoidable, I suppose. But some thought may
> need putting into this anyway. Aiui on real hardware if a BAR is
> placed over RAM, behavior is simply undefined. Once the BAR is
> moved away though, behavior will become defined again: The RAM will
> "reappear" in case the earlier undefined-ness made it disappear. I
> don't know how the Arm variants of the functions behave, but on x86
> the RAM pages will disappear from the guest's p2m upon putting a
> BAR there, but they won't reappear upon unmapping of the BAR.

Yeah, that's unfortunate, but I'm afraid it's the same behavior when
using QEMU, so I wouldn't consider it strictly a regression from the
current handling that we do for BARs when doing PCI passthrough.

Furthermore, I don't see any easy way to deal with this so that RAM
can be re-added when the BAR is re positioned to not overlap a RAM
region.

> Luckily at least preemption looks to be handled in a satisfactory
> manner already.

I spend quite a lot of time trying to make sure this was at least
attempted to solve properly.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 13:32:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 13:32:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568969.889223 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvfP-0001yZ-9s; Mon, 24 Jul 2023 13:32:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568969.889223; Mon, 24 Jul 2023 13:32:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvfP-0001yS-6T; Mon, 24 Jul 2023 13:32:03 +0000
Received: by outflank-mailman (input) for mailman id 568969;
 Mon, 24 Jul 2023 13:32:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNvfN-0001yM-IC
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 13:32:01 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on060d.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::60d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 77b53d30-2a26-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 15:32:00 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB8480.eurprd04.prod.outlook.com (2603:10a6:10:2c6::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.31; Mon, 24 Jul
 2023 13:31:58 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 13:31:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 77b53d30-2a26-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=HwtINDcE8lMeryoyHFPtHZPI9LdpiEFLfyrUHaiNmZM9fDnfz/bne/oTlQEvPa5wTBERvc2F9cS7WXGs5l+3TBvl6DK2Om1C+eQqUxWZ4UPlr7OTcQau3IRKYIIeCziyONvvxlc4FkiLUR3z6AEvL7fFOFfJmnuCxgeaN4J5cG/h84SmL4MniywEZCm9CeayX4lqZTg+a8tCNtyxBxOTz0qctGLEHci4h4QpcqZT6vfDfjIfdawy1G5ZRfqzXr9WR2ZgftLHsYJAv5zRDjTM2b4EvFZI2HaNJ/PsWhCpK36AIrcrzm0L35LGp+q8+qeHVPc0KMBmLYaaNVqEvWei8A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4bStPEJpe5jiTrOHHetxFmq274agqPmssi/OYDxvWC4=;
 b=f4BnbaquPIO2/6pWNbde9RYj2P6ZoDWwvarbOaMdKoT1IqI/O1MVsr0jn/99puS7WjfjtIR5mhEfjwBdLTk/o/63toVqkdPJkBpoTKd8ynHO3L+pNwlOrzOKI8jRaiO2cl+M9O2SjU0/2z9J7SwWr3QleECreN/L1B9DrA6UV7zw8Jf2wP3MYPR9LeNvR6fJ2QGa6TIxWp4BXF5z+DJeSSNQV13xiNnmR4viVTSAzpJwyxxrC7kRGmfXPpiP3ib37+9kPznkbX81EeXf/d3GewyE9wWp+oyw6K+3bVKrUGOKZI49oLc+9nDE2kpCy+Cd67xA3RwRtX9JcRbedSI2Ng==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4bStPEJpe5jiTrOHHetxFmq274agqPmssi/OYDxvWC4=;
 b=MvXLPyBQoMHO06YX/bQH3kV/+PJ2TmL3JSQo3GMZKnaYliXEGRsUQq5dWlwRpGp3L8gtL48g2HpFOHIRJ3O5FKhm6egELk0UJnakmD7y2S74jIpaQNa1LITISXWHvDZ9ido7sUrvQ2762+mUFcC5BfTSKchE0v4c68BfVbPvIK17cBOgwoDuTpYFQc91c4fpot+u1E78shqpY/NFuxjkJ5olOBBKKsfivdw9K6xfWg5wpc/4kzt0rho1GM9ZbzQzNhoPp6j4TNtFec+MHaz/zjfD5v92Q7tV38XeeK/fVmXE6pDZLL79m0KMxOVaB9AYGy16j9tkYVLhFMfxob6Ixw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <a7821ebf-674a-87ce-7d26-d87ae4c9d040@suse.com>
Date: Mon, 24 Jul 2023 15:31:56 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 08/13] vpci/header: program p2m with guest BAR view
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-9-volodymyr_babchuk@epam.com>
 <f2b8945e-cedf-3b38-042c-7b1288cfcde7@suse.com>
 <ZL55nfjyL-WpIWyt@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZL55nfjyL-WpIWyt@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0135.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9e::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB8480:EE_
X-MS-Office365-Filtering-Correlation-Id: 8d37980f-5359-4ac7-9ddf-08db8c4a5ac9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	CU0ov2k7acbsqhHZ9K+4/Qt+KprR2TzqJLrywvGGSVo/nATHP8+XlHn/DD0442pdhCoC+N9j1UlcLVEql8/4YRkxPx6mh1z1eo2lNF5z0vDZehbB88SE+uzCrZJnp2qTfHYeenjDCjAPoVMFBMp197bXgSsbrgTwWA+GksCtwnFM61e5dFHVaCpl7va88GxuLroONkSVpxdz1zApMtkRF2+FlzI7rB/PsW0oNZPAA4kgjFsAyO2yt/4UGAl0WVWIwKd2iORoQHuHo82af5zmAy2R5MCmhQkxzl6D2OOzKST/ub/Pi8YHttsuwFEHcyganrSU35b0EcNIaofn6CvPNKxXvHiL57Eiiu0odAYZowaXXHKebjqV9NYEWMj4/9tkU92nlQwKv2HJ6stB1NKTDfvAjkL/Tb90Mx9rfFb0f/rOeT6d1+c/PMCKce0Vn55qTai1P2oKPXnJSt3wR8X06ImSITOv4UNDdE84Ac6kLkQiOogvxslCI5jxh1bdG+3bt0Rr1/NKip7d7su7fBHiTZBksqWUIjNQQG+Rwscda0WDM7WnxGtkj29uEE5CoutjruV9Dwo1ZYm3oyvYd3MY+/ggP2MoGHYGzNdYGpGhPuwGbz30dBfo/4ADqJwAqCdd4SV5La17hVub8TAx0hhj8w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(136003)(346002)(376002)(39860400002)(451199021)(2906002)(66946007)(66476007)(66556008)(6916009)(478600001)(6486002)(31696002)(6512007)(54906003)(83380400001)(86362001)(36756003)(186003)(2616005)(26005)(53546011)(6506007)(38100700002)(4326008)(41300700001)(8936002)(31686004)(8676002)(5660300002)(66899021)(316002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?T0c2ckVBTjhqRXVDNVZzVCs3VzJQWm90WUpnTzVJR1ZNdGpsU0RaekFLRE53?=
 =?utf-8?B?OUhqenNtMFNncTl1bXZUNDRHUVhabENVVVRBWUZaNllQakJYTll0dWNud2Y4?=
 =?utf-8?B?bUM4cWtNSDdSSGJZM29RcVlycWV2b3NHVTFDNEFtejBmUE45MWFqbDFyenJv?=
 =?utf-8?B?aGthZ0xlRUdYdW1CTFFjak9HU29CTFk5S0NZZGxYS3F0TmZ6bzRvcndBVE5I?=
 =?utf-8?B?QmMrYS8wTG53N0YxTmk3RkZQTWhKRFNYOWtCOW9rNHNkd2JiVUpYMlBTSEJj?=
 =?utf-8?B?ejJKamh5Uzl0NXhuQnZicTd1Z21oaGY2ZFdOYjA5YVhYNVZzNTlDaXVTcUlN?=
 =?utf-8?B?aE53V1hwQitpTXlFekF0anhBSjVsWjBXanJBWjFpSUZ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f-8?Q?85ZSDSzcWh/77RA0lCtMdTDaO?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8d37980f-5359-4ac7-9ddf-08db8c4a5ac9
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 13:31:58.2950
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 6op0/GYmXmZFjdQvBsUiLqarGRcn14knfcvyR8gby9jWesvB4iqWc5JLu8otkQhtsDNkOdbtI7lT6mTfPaNB6w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8480

On 24.07.2023 15:16, Roger Pau MonnÃ© wrote:
> On Mon, Jul 24, 2023 at 12:43:26PM +0200, Jan Beulich wrote:
>> On 20.07.2023 02:32, Volodymyr Babchuk wrote:
>>> @@ -52,8 +66,8 @@ static int cf_check map_range(
>>>           * - {un}map_mmio_regions doesn't support preemption.
>>>           */
>>>  
>>> -        rc = map->map ? map_mmio_regions(map->d, _gfn(s), size, _mfn(s))
>>> -                      : unmap_mmio_regions(map->d, _gfn(s), size, _mfn(s));
>>> +        rc = map->map ? map_mmio_regions(map->d, start_gfn, size, _mfn(s))
>>> +                      : unmap_mmio_regions(map->d, start_gfn, size, _mfn(s));
>>
>> Aiui this is the first direct exposure of these functions to DomU-s;
> 
> I guess it depends on how direct you consider exposure from
> XEN_DOMCTL_memory_mapping hypercall, as that's what gets called by
> QEMU also in order to set up BAR mappings.

Fair point - it is one of the few domctls not covered by XSA-77.

>> so far all calls were Xen-internal or from a domctl. There are a
>> couple of Arm TODOs listed in the comment ahead, but I'm not sure
>> that's all what is lacking here, and it's unclear whether this can
>> sensibly be left as a follow-on activity (at the very least known
>> open issues need mentioning as TODOs).
>>
>> For example the x86 function truncates an unsigned long local
>> variable to (signed) int in its main return statement. This may for
>> the moment still be only a theoretical issue, but will need dealing
>> with sooner or later, I think.
> 
> One bit that we need to add is the iomem_access_permitted() plus the
> xsm_iomem_mapping() checks to map_range().

The former would just be reassurance, wouldn't it? Assigning a PCI
device surely implies granting access to all its BARs (minus the
MSI-X page(s), if any). The latter would of course be more
"interesting", as XSM could in principle interject.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 13:33:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 13:33:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568972.889232 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvgx-0002a1-Nn; Mon, 24 Jul 2023 13:33:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568972.889232; Mon, 24 Jul 2023 13:33:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvgx-0002Zu-LC; Mon, 24 Jul 2023 13:33:39 +0000
Received: by outflank-mailman (input) for mailman id 568972;
 Mon, 24 Jul 2023 13:33:37 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qNvgv-0002Zo-Hv
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 13:33:37 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNvgu-0001P5-I5; Mon, 24 Jul 2023 13:33:36 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNvgu-000585-B1; Mon, 24 Jul 2023 13:33:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=OaSl5ntvJ0tXrit0QV4hVHKLq8QJbIXzvhZb6nRwBC4=; b=CzZrMbI4gZhfMI6ho+22/dKGoU
	cQ94UbSlfg4/RHowDLnukIBxs6tQqGwPkKW3cozCvDYk2AyxKl1t8zdRFzZWpcdfN71LLDQ6qZ4QI
	0h/TFnyDSyzlHHV5XYfyuu17+yKkT3icUkIp5dgJrucXTFVMXVWoSdRcqsztUolQbajY=;
Message-ID: <27d35ad9-188f-499f-c80c-4bb0b022813e@xen.org>
Date: Mon, 24 Jul 2023 14:33:34 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] xen/arm: p2m: refactor 'p2m_get_entry'
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <118566cd8b9ebbcedd2b610f5f602cc31c12fd55.1689922099.git.nicola.vetrini@bugseng.com>
 <9c1b7c53-f8da-76a2-cc02-7c72a3030be4@xen.org>
 <33af17e5-2942-e263-22bf-7e60148e1de1@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <33af17e5-2942-e263-22bf-7e60148e1de1@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 24/07/2023 14:15, Nicola Vetrini wrote:
> 
> 
> On 21/07/23 12:01, Julien Grall wrote:
>> Hi Nicola,
>>
>> I would add "to please ECLAIR" in the commit title.
> 
> I would be against this. It's the MISRA assessor that needs
> to understand and agree on what has been done to claim MISRA compliance. 
> A static analysis tool is just a useful way to help reaching this aim.

I have already mentioned in [1], but I will repeat here in a shorter 
version. If Eclair wasn't complaining about it, then this is not a patch 
I would have accepted with the current justification.

>
>>
>> On 21/07/2023 07:49, Nicola Vetrini wrote:
>>> This function is refactored to avoid using a
>>> local dummy variable that served as a fallback
>>> if the parameter 't' is NULL.
>>>
>>> Storing the address of that variable into 't' caused
>>> static analysis tools not to be able to recognize the
>>
>> Can you mention which static analysis tools is not happy and the 
>> version? This could help us in the future if we decided to revert the 
>> patch.
>>
> 
> It is not a matter of tool happiness, but of MISRA compliance.
 From my understanding, the code you are modifying is compliant with 
MISRA. So you are only doing this patch to:

   1) Help Eclair to figure out there is no issue
   2) Avoid adding an explanation in the documentation why this is safe

> There are several tools (even emblazoned ones) that have lots
> of false negatives, also for mandatory guidelines such as Rule 9.1:
> the fact that they do not issue messages for possible violations
> they cannot exclude is happiness for nobody (especially for those
> who have to ensure there are indeed no violations). Two things
> that have to be kept well in mind are:

My point is that someone in the future may decide to use a tool that 
will complain about your change here. A possible course of action would 
be to revert the patch but this would not work for Eclair.

By explicitly mentioning Eclair in the commit message/title, you are 
making a statement that a simple revert would not work. This will save a 
lot of back and forth, including arguments on the ML.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 13:40:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 13:40:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568979.889242 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvnV-000450-DK; Mon, 24 Jul 2023 13:40:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568979.889242; Mon, 24 Jul 2023 13:40:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvnV-00044t-Ad; Mon, 24 Jul 2023 13:40:25 +0000
Received: by outflank-mailman (input) for mailman id 568979;
 Mon, 24 Jul 2023 13:40:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNvnU-0003Dh-PE
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 13:40:24 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20611.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::611])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a3edb771-2a27-11ee-b23a-6b7b168915f2;
 Mon, 24 Jul 2023 15:40:24 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8391.eurprd04.prod.outlook.com (2603:10a6:102:1c4::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 13:40:21 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 13:40:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a3edb771-2a27-11ee-b23a-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=SQ3Qv8mVUZd+SLBrt74VG7IBnrDs1n/+xm18RLPpGOEshUAwrv2cEJOkeAT39AX/lJPiGp4OTlqTYw7fBcAJyLHJ/9pfvLTpR5bEDTJCf8/UnDCmyyZ8UWPQiyS9bksmrxFBaLtBPaOwNk4ox6UtAr5zhhL7vE5xEUYA8TtbKD0Y8LYgOuMsS8NBql9sLdRzuxtZhEGH7rOXo5z9pIZpmQbxadEuNSHmx4wjX1GJwPICy0OG0SRDI4tKiXgmP3qGdf4FeqQ1jX/rAHclvnW4CrY0TDBvg/SnZ0+tlcbJjyggqMpyBdGI91h3l3j6J3BUzWJ+94gSKchjdQVNdVxTMQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=v/Dk3H9+KPxVss5y+OP7rpTMAi0oHcbOdrc9bPzf3Jc=;
 b=Mm+3s4lSTFU684xUmUBQHOTVk17tDhXS4zwuJ/PJbxFAs2Yr7VEY7RIzV7+LtmYlZIPXvbMcC3mC4NA+fDAfTwDA9a93c5Q+kv6c0fZfom2m236K/h+fQFPJzj6hCNu+IX9p6XzLQMMcv3rr1F5hbDEaDPayyIMgCHFFFAUDglltr4EM7jNuNHwlPZob0cH7H0ZEgSSfkj1U31pa235eEdx7qqB/U5d1pWe0BbamlfvXHaHIXfZ13jruLba2q3YzxR8vT1bMT69/mpdo6EeEbZtgWHPgk1Q1foc70xB25eD/VRPNrim8jc5UDbIRVm+b7j+6081FkEIGbL1mhiRC9g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=v/Dk3H9+KPxVss5y+OP7rpTMAi0oHcbOdrc9bPzf3Jc=;
 b=RCSkOdW3l9lyvAs94bv1ybHqFsdauL7FMtdE9enuBDRhV4pLz0Z12M90Q8CS6WDrWtAwIwONqkuZMdc62fSP+zHRzogFFb5UGvPaHtd6EFMzlw1cescXQbfh1dte507ET17/sQZMuiDcUy8hxGCBncX1uwgOgFJoDQvm2fjoYAy/1+4b0xuZbvtRMbR3Z4aKQlXgXOfGGj6tZBwpzCZPjlUig21X1+PFelIgP679uSKR6qTwmlz9rObRnV/uEwz0vi9yKFAfcN/JcpTBVnvwkk+M3jNQutsryU8g7UhoF13E865oILAT62+3QTQIvOV9BGm2z9smUAtyUxWsPizkOQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e728eb67-3ec6-65d2-df20-7aa34431546c@suse.com>
Date: Mon, 24 Jul 2023 15:40:18 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v4 1/2] xen/riscv: introduce function for physical offset
 calculation
Content-Language: en-US
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1690191480.git.oleksii.kurochko@gmail.com>
 <19817eca0b7d4e8dee7eb5d5e7d3812133925eb3.1690191480.git.oleksii.kurochko@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <19817eca0b7d4e8dee7eb5d5e7d3812133925eb3.1690191480.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0125.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9d::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8391:EE_
X-MS-Office365-Filtering-Correlation-Id: ee04a783-a965-4b29-104d-08db8c4b862c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	5tpRPwGCDtM0IN1MUuO+GRfvqRk7pPDpl3jAh/CUjTfYsxNxdTDd66L1nVGWv32p2R3U0GJ/SYnMregDvODNHJeLjVr1Mt4aCAjYyAoQQnE9dVL3XCjed0uvrUdMjuN2UK+qWYeDPYKy2Zzqb19IB7JZgaby/UUaDOe7rjr/s7nAozAFeT6ptbavVvxYUZlIn/Z0HpqxOLBSWnZN8ge5QMTEBfL+KYJNi4HVjuow4z/PgkcDqgN08xb9bCfF2iwhIeHK+x26y19NQ2B42gsaOe8nmpRaet14Czr/gTAisc4QKO439ckqlsuoD2N2bvoOA0MhC15flnAFSnebZMILY7Bn2/A+q5Y8UOjhNfDVzEmuCz40b8FlgIokbYbXF0W5Sq82zexcb9GZFW4H5PFK9+oB34YBTkwHtMpmJaX/kEAu+SXlDtTiqHcbC5HLp/7RpsnXCuSCdft0ohlJQ6rUIj0akTQOFBvuuohn6V3U3nhyAe/jicd9fMU9JEdFyf5tXnQpQjJqm35qFF/z+qsNsdBeZGs5HzL7lrpKpT4J419fLMs9vX348kMOxpdzlCKxxCL8we51oClEBwNxUtc6NlSz1YfPeJCO2MlouYFW+z8bu4YWgt6EwNjQtks3LwaudArNGYzFiLa0FDMQ+Mnijg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(136003)(396003)(346002)(376002)(39860400002)(451199021)(26005)(186003)(53546011)(6506007)(31696002)(5660300002)(36756003)(8936002)(8676002)(2906002)(2616005)(86362001)(38100700002)(83380400001)(6916009)(66946007)(66556008)(66476007)(4326008)(316002)(54906003)(6486002)(6512007)(478600001)(41300700001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cVBheHdOalpNNUtXM214TFU4ZUNndW52OUxiOVFIMGYyTndMTU5xTUd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05EbndJN0YxUnN4TTJsdkFFWjg2V05V?=
 =?utf-8?B?aTUzNmo3OGZvTVlhREhOKzQ1MkxQbmtldE1mUEc2U0x2RDR4MDFzenY3elI5?=
 =?utf-8?B?TnRML3E4eWtuTTE4K0lMdERPcXpuNmorZ1kwRjU2UEZkV2ZuUmlyK0JvT014?=
 =?utf-8?B?VmdnbUtGVHBCMUNCSFo1WitOUjAyODJKK2JrNDRQME5Wa05VRHhmVWVCdk1X?=
 =?utf-8?B?MzhEa0FFcFlxSmsvcFhWaERTUkEyYXlyTmM0bE80SFBLbU1wRkRrb29CQXR5?=
 =?utf-8?B?MGlxMnp3M2d2Yk14eVROcGhLSExBeDVoT3RvejZCbVY2ZkVDUlJQT3h3RmZM?=
 =?utf-8?Q?wWLZ+MxYgKCd6aQ6n/flpoj9u?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ee04a783-a965-4b29-104d-08db8c4b862c
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 13:40:20.5425
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 4yaYBcnaMk8pLiUqFpTPy8kEAZgw5Uy25n8S2PTxHxl1NQtvdbMkWuciZLn1tIcqkB81+mf5EhRvlJbNYScuSw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8391

On 24.07.2023 11:42, Oleksii Kurochko wrote:
> @@ -19,9 +20,10 @@ struct mmu_desc {
>      pte_t *pgtbl_base;
>  };
>  
> -#define PHYS_OFFSET ((unsigned long)_start - XEN_VIRT_START)
> -#define LOAD_TO_LINK(addr) ((addr) - PHYS_OFFSET)
> -#define LINK_TO_LOAD(addr) ((addr) + PHYS_OFFSET)
> +unsigned long __ro_after_init phys_offset;

While Misra compliance is distant future for RISC-V, there's a
problem here with there not being any declaration for this global
variable. Adding a declaration isn't the only solution though:
Patch 2 also only uses the variable in assembly code. Therefore
the variable here could be made static, with ...

> @@ -273,3 +275,13 @@ void __init noreturn noinline enable_mmu()
>      switch_stack_and_jump((unsigned long)cpu0_boot_stack + STACK_SIZE,
>                            cont_after_mmu_is_enabled);
>  }
> +
> +/*
> + * calc_phys_offset() should be used before MMU is enabled because access to
> + * start() is PC-relative and in case when load_addr != linker_addr phys_offset
> + * will have an incorrect value
> + */
> +void __init calc_phys_offset(void)
> +{
> +    phys_offset = (unsigned long)start - XEN_VIRT_START;
> +}

... this function (being invoked by the same assembly code
function) returning the value alongside storing it.

FTAOD I wouldn't insist on this being taken care of right away,
so if you get a maintainer ack this way, I'd be happy to commit as
is.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 13:43:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 13:43:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568982.889253 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvq3-0004e3-Qg; Mon, 24 Jul 2023 13:43:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568982.889253; Mon, 24 Jul 2023 13:43:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNvq3-0004dw-NZ; Mon, 24 Jul 2023 13:43:03 +0000
Received: by outflank-mailman (input) for mailman id 568982;
 Mon, 24 Jul 2023 13:43:02 +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
 <SRS0=Klik=DK=citrix.com=prvs=5629c81f5=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qNvq2-0004dq-TW
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 13:43:02 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0082b906-2a28-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 15:43:00 +0200 (CEST)
Received: from mail-bn8nam12lp2173.outbound.protection.outlook.com (HELO
 NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.173])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 24 Jul 2023 09:42:49 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by DM6PR03MB5292.namprd03.prod.outlook.com (2603:10b6:5:240::19) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 13:42:44 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 13:42:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0082b906-2a28-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690206180;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=/siqa6srSvXni8+QBEj0B1D7S4UCTuYjftKXCBYYNDY=;
  b=E19IzdC2X6ZKhPViTySbt60DePrwYcYQkSUymKDtJ5D1hHojlLD9Idqd
   JPopPaWCzave+Au8pk3xpElf85NjpNcYv2CDEyRG9wnfJoMqiQp0FBlEY
   PsGkELmz644kaUPeWddlsYVrooAPvsQmrabbeUaSgQHFUe/bvS12BC+wa
   w=;
X-IronPort-RemoteIP: 104.47.55.173
X-IronPort-MID: 116523100
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:8gy7x6JqLY/E24C4FE+RAZQlxSXFcZb7ZxGr2PjKsXjdYENShWdRy
 DEfXTuDPa2Oazb2f4x0O9i2/BxTsZeDndMyQVFlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws
 Jb5rta31GWNglaYCUpKrfrawP9TlK6q4mhA4QZlPasjUGL2zBH5MrpOfcldEFOgKmVkNrbSb
 /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/
 jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5bPSYT+
 fhbCQo8VT+vmsWbypOCd8Rz05FLwMnDZOvzu1lG5BSAV7MMZ8CGRK/Ho9hFwD03m8ZCW+7EY
 NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/dqpTGMl2Sd05C0WDbRUsaNSshP2F6Ru
 0rN/njjAwFcP9uaodaA2iv12LKVxnqjAOr+EpWd6qBIjFezmlU/L0YKBGqEn9a/i0exDoc3x
 0s8v3BGQbIJ3E6hQ8T5Xha4iGWZpRNaUN1Ve8UE7wWKxrvR8hyuLGEORT5ca/QrrMYzAzct0
 zehuNfkBidmtrGPflub+q2JtjO5OSUTLmgqaDcNSE0O5NyLiJE+iFfDQ8huFIaxj8bpAnfgz
 jaSti88ir4Py8kR2M2GEUvvhjutot3DSF4z7wCOBGa9tFomP8iiepCi7kXd4bBYNoGFQ1Kdv
 X8C3c+D8OQJCpLLnyuIKAkQIIyUCz++GGW0qTZS81MJrlxBJ1bLkVhs3QxD
IronPort-HdrOrdr: A9a23:izt7gqzfKFFReWl48bSaKrPw6L1zdoMgy1knxilNoHxuH/Bw9v
 re+cjzsCWftN9/Yh4dcLy7VpVoIkmsl6Kdg7NwAV7KZmCP1FdARLsI0WKI+UyCJ8SRzI9gPa
 cLSdkFNDXzZ2IK8PoTNmODYqodKNrsytHWuQ/HpU0dKT2D88tbnn9E4gDwKDwQeCB2QaAXOb
 C7/cR9qz+paR0sH7+G7ilsZZmkmzXT/qiWGCI7Ow==
X-Talos-CUID: =?us-ascii?q?9a23=3AXNClx2g8yqgUkoM1oBiYR/kHtzJuXkGakXvUYG6?=
 =?us-ascii?q?COF1GZKCyZFWxwZ5JjJ87?=
X-Talos-MUID: 9a23:ATFrgAh4B2OsKxU9kZvowsMpEds2waikKBw0vbJdp5i1ChJfPTaUg2Hi
X-IronPort-AV: E=Sophos;i="6.01,228,1684814400"; 
   d="scan'208";a="116523100"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=jLVerEAlObNAR8L0MQAYu+CV2cBrLUz6jF3Tno3dq1CfqxQQp5jdsptSAc90lLkzB6p7wP0RSM4EHD8RmGfADni/iCuq1259xguD5WfDtCMDnZ4Gb+8/tGA/Tts1BziFsWzXt8QzvlxjRNHqr+HfI/3oQYGwCBY6FpUckRWdJq93OEXZaZo1hLjzOST7kf7UrLc+Redq/igVBaae3cRQ7L57sYCcHcuUkBofBMa5tPen8kjbtvyiRXuN1yKwdFuPRxC/kHKBjOFgPVhzWPjC0EXp+C1cnijIjocmeEFPMshPV9yaHyuSOxPkK7Z/ecieBDMB5RFhFOoXcsrOKI0yGw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=pt0PHpuTnjqwbpU3YSkhKGRJ00J7NkyVGF+Cp4quThs=;
 b=iGic8dmBb+FiHnsS3RPRczoFftxToJdKL/gilBCwyitWDhCAL/md8fMzYlS0Itv48bh6n+zEyS73V1AWZg+bZxetPeZFDpsaUEr+HJ15NmMAMZzSzvfuPDvkV1nmaEICTC1LvtNVDSfow+tfROPuF1fcOdjKB2q2cS1JBa+vuxlUc6+V7u8eKsCSVREASWqKuZ38PRsnLqSuvzDXZPaXcFgUNPcbhLVuy+w4M+hCdbwLD28fYQmlCSq3ng3gkRKIFwJG55OVQYJqR4aXtTQ8660x3KN8KgEUJjsJn+JjUjbHpXjl5nqdDkWlt27CB2hKw8b9mjfFucn3DMPn+kJIhw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=pt0PHpuTnjqwbpU3YSkhKGRJ00J7NkyVGF+Cp4quThs=;
 b=bB2W37xrLRVnsA21R+kp2i7fk3tzJDzdza3CS3lDZmkGqUxroNfAKGtP/af51QcgpRRLt/pzBEnYY78MYLJ8B6YRFfqFry+Unu2ct+jx4i+uJftMOdPQN7WmLdfUscjcNyXq8BVJ5yXnCKoM/+Ap9wh9s9KCe09YMyq6pMCojyo=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Mon, 24 Jul 2023 15:42:39 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v8 08/13] vpci/header: program p2m with guest BAR view
Message-ID: <ZL5_zxmcINjPSfIK@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-9-volodymyr_babchuk@epam.com>
 <f2b8945e-cedf-3b38-042c-7b1288cfcde7@suse.com>
 <ZL55nfjyL-WpIWyt@MacBook-Air-de-Roger.local>
 <a7821ebf-674a-87ce-7d26-d87ae4c9d040@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <a7821ebf-674a-87ce-7d26-d87ae4c9d040@suse.com>
X-ClientProxiedBy: LO4P123CA0467.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1aa::22) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|DM6PR03MB5292:EE_
X-MS-Office365-Filtering-Correlation-Id: f9c09a11-de9f-4769-1939-08db8c4bdbc9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	LehecBcEJ203E3zgmzgkrjzgXYzfBMMuyADVXoE+XyVGZLOzQd2pf1pxUcGRhJBPPh+PE5+jsPmoIz+LECKuGu7p258QEMveS2WnC5zWzbyxxTWuXMqFBefWrn3BV7a3D9fKlV1BMkf9l1fXpTSpS+G4WUytSAQeP3aEgbqn/DcXycH/we1tRxnTX/Hz9++dMsDSpnm0BbErgnCRCIWgsKRkqwzP+QlYlc5U8O+kS7SJLvi34ywgbcwghVYKvAmIUYq3QZPmk9a8pqFwX6wEA1dIB60t2CUQ9bCnLok/MVGmSAToTAcSg0dO4OeG+1NB5ICA2i/ExB1JjpbGISb/kpS6qOer41KDePqethFeZsskpFb3+eaDHasGe/31uChWMK1Z/hdzldZ4TCjJl7j2zCdwKYcOPQ4p4PqLzUjUKYObGEpgd3a+LuaVmdbsDFhpkkl4IJVLYyEqp/b3ZeN9k+xmDpyngV2NJkp8hsi7olHgdMBmquMyYBIxUaIdOujYfOIVCzqs2WfdjYwMUmkJhFj5nvenafqXyzpg9N5AGaPzyxn7UvsVogHo3LCCq7ez
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(39860400002)(366004)(136003)(376002)(451199021)(6512007)(82960400001)(38100700002)(83380400001)(6506007)(53546011)(186003)(26005)(5660300002)(8676002)(8936002)(2906002)(41300700001)(85182001)(66556008)(6486002)(6666004)(66476007)(66946007)(6916009)(4326008)(478600001)(54906003)(316002)(86362001)(9686003)(66899021);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cXlkdlg2UjgvMVlJLzhZU2RFSytBRGRnK2tJQlFk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bpqEx/H3PIIhY6/z8tltiUWvtKFQZ4kxMIH4X8wTABSklwYJ6rN3tOF0sfpFIoULyZX95l2T/JQgVpCNQ+jcU6KRs2CxHCyuitStkutMHXxE9Sb2z4kfWDWfGdu7HD8CHeJLp+qKgxgpyeHdeqSqUwuHfHyv5tzbmZXQbnR6nEhB4tYyFVnaPfnKoMhBLSDiXFYiAl6ySc7QSTym9AqhFmt1gloE4ZkE91by1gtJdGp2DZSWd5rzLHp6QPO5Vb2kThseN0AkPb8Vp0LldPcXusxzPWgz+TFbqem81JRYmpNhdNg5kMQW15Fq1vLAAe2nQFkq2n5NA2Ltvqv36NLIsx4RTefOjWdloLEMsbz+Ag==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f9c09a11-de9f-4769-1939-08db8c4bdbc9
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 13:42:44.3356
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: rdt5mxTufHbUY+v0bwW1K0fCbN7wGCMaGQtPnSTgJU9mvdah4wo/vwAqazruFc6ERw3YvlESzZ0sVf0JnK/mUw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB5292

On Mon, Jul 24, 2023 at 03:31:56PM +0200, Jan Beulich wrote:
> On 24.07.2023 15:16, Roger Pau MonnÃ© wrote:
> > On Mon, Jul 24, 2023 at 12:43:26PM +0200, Jan Beulich wrote:
> >> On 20.07.2023 02:32, Volodymyr Babchuk wrote:
> >>> @@ -52,8 +66,8 @@ static int cf_check map_range(
> >>>           * - {un}map_mmio_regions doesn't support preemption.
> >>>           */
> >>>  
> >>> -        rc = map->map ? map_mmio_regions(map->d, _gfn(s), size, _mfn(s))
> >>> -                      : unmap_mmio_regions(map->d, _gfn(s), size, _mfn(s));
> >>> +        rc = map->map ? map_mmio_regions(map->d, start_gfn, size, _mfn(s))
> >>> +                      : unmap_mmio_regions(map->d, start_gfn, size, _mfn(s));
> >>
> >> Aiui this is the first direct exposure of these functions to DomU-s;
> > 
> > I guess it depends on how direct you consider exposure from
> > XEN_DOMCTL_memory_mapping hypercall, as that's what gets called by
> > QEMU also in order to set up BAR mappings.
> 
> Fair point - it is one of the few domctls not covered by XSA-77.
> 
> >> so far all calls were Xen-internal or from a domctl. There are a
> >> couple of Arm TODOs listed in the comment ahead, but I'm not sure
> >> that's all what is lacking here, and it's unclear whether this can
> >> sensibly be left as a follow-on activity (at the very least known
> >> open issues need mentioning as TODOs).
> >>
> >> For example the x86 function truncates an unsigned long local
> >> variable to (signed) int in its main return statement. This may for
> >> the moment still be only a theoretical issue, but will need dealing
> >> with sooner or later, I think.
> > 
> > One bit that we need to add is the iomem_access_permitted() plus the
> > xsm_iomem_mapping() checks to map_range().
> 
> The former would just be reassurance, wouldn't it? Assigning a PCI
> device surely implies granting access to all its BARs (minus the
> MSI-X page(s), if any).

Indeed.  But for consistency we need to match the same checks that are
done in XEN_DOMCTL_memory_mapping.

> The latter would of course be more
> "interesting", as XSM could in principle interject.

Yes, we need both.  In fact I'm just writing a patch to add them
straight away.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 14:11:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 14:11:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568990.889263 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNwHU-0008DL-6e; Mon, 24 Jul 2023 14:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568990.889263; Mon, 24 Jul 2023 14:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNwHU-0008DE-3B; Mon, 24 Jul 2023 14:11:24 +0000
Received: by outflank-mailman (input) for mailman id 568990;
 Mon, 24 Jul 2023 14:11:22 +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 <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNwHS-0008D8-BZ
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 14:11:22 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20613.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::613])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f61c3889-2a2b-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 16:11:20 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB7738.eurprd04.prod.outlook.com (2603:10a6:10:1ea::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 14:11:17 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 14:11:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f61c3889-2a2b-11ee-8612-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=MTGAFiv9oWvajNv5HyJ+qgnSWIOQoXFoPbj13gRXv7fYq58PxcvEO5mFfE2VjmAxNcaMJmk5yXSs0c6doKEqARyBQ56q3QxWzu1oT0/lxddXRajQ8pNBmepL/zaN6ktb6IrR1IceYrt7c5RErCP2qIZ/29Pno7YJHxwVSxX3pOQLBqxGQi38rWNALL4yO3ocBqnXCf7YOxpWG6RTWA3is3R+iVBYRpIrJFaKsikN7yFU72pWMJ1ZxuoaOgtCHS6kgFEMtsm/2KcmrDHVgiQdcWrXNym5yKVWc703plF8CM/OxmCC3HdjmCVJsOtlI3VsufEk9EXOo+jYKFTNZwIl8g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=N5Osi0aa+CbeShEqaHlKJY5wZo+F4aku0BuKH8iWEDk=;
 b=DW3OIK/WAGzjxF3ul6vOmrhxJpbRzWkkamdw2Uj46AFXLx9i2MO3lDwVyfFCai2P4/avqEGqZT7usx+NcRe0c/QI0mk43JIwU4BsC7iN9wfOYKILs1PmkgrvmbAoETqW/pyThQw1pAhdMKMjHhGzsHeKWX5MZ0esiaSuqE4v66V7c3UEyfTCND/cFmHbd/5YbZ8/nVuxAYIL+/Q3vBUI+GBRD4DrmV68Uz0hMD8ugfvP2xX8HrNzzWgj2WpTX0O+RTU2BM3oqcbln/EAf/M9GOaGW0fa59SV424VpmSAZREXwylfrEMefzMCvt//I329kbVhx01o9CcywU8WfCO3WQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=N5Osi0aa+CbeShEqaHlKJY5wZo+F4aku0BuKH8iWEDk=;
 b=0xM99MuA1DZiSP82X8DvUioan9cb9rbQhRX8aFG5IrPteRxu0xmKsfYfKt9hiE2zig+DmNkoK/R0E787jj4N5H3ZFK6fYqyx1fIywRoxicR85L+v7ypdsRyaEh7lJjEYnMW4CO6kRqFwdvVMC/JTLLD6vLpHisT2G5jMIoUlEjHdLc/oQDtbqYZsuAN+Bmqx5n++RAyd9xDxatR2Bjivo1Hl7/kGWuCZIiGDh70BIhse27Ae/cBHMlNzocX0Nkp4Pl4/7P9q5Vp6TJR6mGgIHLoWNH4KThe3HPScn0pmr/K6XACABbZFQBIg/qKatgMkNSKgLLtI9AaaD1Ti9Rpd1g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <c32d8be8-75cf-78f8-304d-247b93b611cb@suse.com>
Date: Mon, 24 Jul 2023 16:11:14 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping
Content-Language: en-US
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1690191480.git.oleksii.kurochko@gmail.com>
 <a8ab1829ab718dda869db3df3348ded211e81967.1690191480.git.oleksii.kurochko@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <a8ab1829ab718dda869db3df3348ded211e81967.1690191480.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0057.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4b::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB7738:EE_
X-MS-Office365-Filtering-Correlation-Id: 1fc575c7-311c-4764-11ac-08db8c4fd888
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	TnYZXvbBZ4bikZWMsjG7k+JLui/QICbQHsvuCoXieqxh0jVsyrY4a7JF56kZN3zE6BlQ4BFoG3h7/gBvNjCzTJyNkwShEkrQYX3NGzz2bQfMdEc4sq2JR18DPt89FyfpjSWkcx4LJMxDsS2j+mcbsF62Uu6/tCjHzu7I5aPGFYsX86ArR0HkGoQcChEIGGKfLZytF10ezs6nn4/b3g0w4M7jKORM3z/zs7JduW6zokSKvEGIht4DluHNuc5/cdfOR4+CCyPWmaJ99iY6f+LK09MB68G9xU/K7iDftQiawO5Qfuf30WBnU9rc7z00eL7LdFKwW8+vN5j9HCbC3B3CkpW1Md6o1mPSD0lCGIQHOy4U/PBvl8mk6raLdxnLIWYm+eIUeEsmfzIYcyLGTWCl4Z78N5GBf+0xPoqafLhkbrxgciO6/VCIBGCzgiVXBQVu37jls6TzBA2m3vSJWPYv81MY5dfD9RiOShXW+awBsXu5Qt36XB9om2UC7KmBp+NAdWloGoWoSDunHSjdRL4nTQT/CuATjzA8AN7K6BukbUmqJWE6rmYWkNNVKNccdrAkwObXsRl7kiq/EQjSW2+gQGFlfUUa1avHvQVD/iETDHfhw6VrQRlo/hbkN9+K8aqQxR0BNum+hpk/UQs8XC3BQw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(136003)(346002)(396003)(366004)(376002)(451199021)(6506007)(26005)(186003)(36756003)(5660300002)(31696002)(8936002)(8676002)(2906002)(53546011)(38100700002)(86362001)(6486002)(66476007)(66556008)(6512007)(66946007)(83380400001)(31686004)(54906003)(478600001)(41300700001)(2616005)(6916009)(4326008)(316002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WWVLTURiOFdaVS9ZWmEvdG41T1dkUStlUUxBQmdJdVhiRWNRTG5QSTczRWZU?=
 =?utf-8?B?VVhJRzgrcnN6YXp3WTJtem1ZZ3ViL1JTTWJLMnd1QXJ6aTNyUHlOeFhnaUQw?=
 =?utf-8?B?VW5NMXZudVhBWnBRV2VYdk45dGRxR2RKQ04vYnFTbkpZUkJSMm9RUWdpMkNC?=
 =?utf-8?B?UG1CTzYwS0RBZUxEMFg1L1FNSWNkaWhzUjVPL2REalU4Rjc3RTBLSndEa2R6?=
 =?utf-8?B?eDU1ekJwcG9lOHI3aFN5MG16Vkc0RktTRk5Ha25sOGlhMFo0QjFZOGtEMElN?=
 =?utf-8?B?Y2RKeXJ1aGV1UG5uZ1ZEKzk5ZDE4eWJBQTFEWGNYZm5ZdWFGZ0xBcGhWRFBw?=
 =?utf-8?B?dStEb0pBT3FzTnB3Y24rRVdrRjhVVmRiUkkrVFh3ZDFqT1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wkeVlba6db?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1fc575c7-311c-4764-11ac-08db8c4fd888
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 14:11:16.7317
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 4oD3Lg43BaiKGxEwbtfmdwDoHPDgNFT+D8nBMjR/4zAjeqb0ag1slEqQHCn3siKOyP1hFflR16jW3ISD7l7cvA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7738

On 24.07.2023 11:42, Oleksii Kurochko wrote:
> @@ -35,8 +36,10 @@ unsigned long __ro_after_init phys_offset;
>   *
>   * It might be needed one more page table in case when Xen load address
>   * isn't 2 MB aligned.
> + *
> + * CONFIG_PAGING_LEVELS page tables are needed for identity mapping.
>   */
> -#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) + 1)
> +#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) * 2) + 1

Comment addition and code change are at least apparently out of sync:
With such a comment and without thinking much one would expect the
constant to be bumped by CONFIG_PAGING_LEVELS. It is true that you
only need CONFIG_PAGING_LEVELS - 1, because the root table is shared,
but that would then be nice to also clarify in the comment. E.g.

"CONFIG_PAGING_LEVELS page tables are needed for the identity mapping,
 except that the root page table is shared with the initial mapping."

Also - where did the outermost pair of parentheses go? (Really you
don't need to parenthesize the multiplication, so the last closing
one can simply move last.)

> @@ -75,10 +78,11 @@ static void __init setup_initial_mapping(struct mmu_desc *mmu_desc,
>      unsigned int index;
>      pte_t *pgtbl;
>      unsigned long page_addr;
> +    bool is_identity_mapping = map_start == pa_start;
>  
> -    if ( (unsigned long)_start % XEN_PT_LEVEL_SIZE(0) )
> +    if ( !IS_ALIGNED((unsigned long)_start, KB(4)) )
>      {
> -        early_printk("(XEN) Xen should be loaded at 4k boundary\n");
> +        early_printk("(XEN) Xen should be loaded at 4KB boundary\n");

The change to the message looks unrelated.

> @@ -255,25 +261,44 @@ void __init noreturn noinline enable_mmu()
>      csr_write(CSR_SATP,
>                PFN_DOWN((unsigned long)stage1_pgtbl_root) |
>                RV_STAGE1_MODE << SATP_MODE_SHIFT);
> +}
>  
> -    asm volatile ( ".p2align 2" );
> - mmu_is_enabled:
> -    /*
> -     * Stack should be re-inited as:
> -     * 1. Right now an address of the stack is relative to load time
> -     *    addresses what will cause an issue in case of load start address
> -     *    isn't equal to linker start address.
> -     * 2. Addresses in stack are all load time relative which can be an
> -     *    issue in case when load start address isn't equal to linker
> -     *    start address.
> -     *
> -     * We can't return to the caller because the stack was reseted
> -     * and it may have stash some variable on the stack.
> -     * Jump to a brand new function as the stack was reseted
> -     */
> +void __init remove_identity_mapping(void)
> +{
> +    static pte_t *pgtbl = stage1_pgtbl_root;
> +    static unsigned long load_start = XEN_VIRT_START;
> +    static unsigned int pt_level = CONFIG_PAGING_LEVELS - 1;

These all want to be __initdata, but personally I find this way of
recursing a little odd. Let's see what the maintainers say.

> +    unsigned long load_end = LINK_TO_LOAD(_end);
> +    unsigned long xen_size;
> +    unsigned long pt_level_size = XEN_PT_LEVEL_SIZE(pt_level);
> +    unsigned long pte_nums;
> +
> +    unsigned long virt_indx = pt_index(pt_level, XEN_VIRT_START);
> +    unsigned long indx;
> +
> +    if ( load_start == XEN_VIRT_START )
> +        load_start = LINK_TO_LOAD(_start);
> +
> +    xen_size = load_end - load_start;

When you come here recursively, don't you need to limit this
instance of the function to a single page table's worth of address
space (at the given level), using load_end only if that's yet
lower?

> +    pte_nums = ROUNDUP(xen_size, pt_level_size) / pt_level_size;
> +
> +    while ( pte_nums-- )
> +    {
> +        indx = pt_index(pt_level, load_start);
>  
> -    switch_stack_and_jump((unsigned long)cpu0_boot_stack + STACK_SIZE,
> -                          cont_after_mmu_is_enabled);
> +        if ( virt_indx != indx )
> +        {
> +            pgtbl[indx].pte = 0;
> +            load_start += XEN_PT_LEVEL_SIZE(pt_level);
> +        }
> +        else
> +        {
> +            pgtbl =  (pte_t *)LOAD_TO_LINK(pte_to_paddr(pgtbl[indx]));

Nit: Stray double blank.

> +            pt_level--;
> +            remove_identity_mapping();

Don't you need to restore pgtbl and pt_level here before the loop
can continue? And because of depending on load_start, which would
have moved, xen_size also needs suitably reducing, I think. Plus
pte_nums as well, since that in turn was calculated from xen_size.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 14:27:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 14:27:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.568995.889273 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNwX3-0001NB-I0; Mon, 24 Jul 2023 14:27:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 568995.889273; Mon, 24 Jul 2023 14:27:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNwX3-0001N4-Ez; Mon, 24 Jul 2023 14:27:29 +0000
Received: by outflank-mailman (input) for mailman id 568995;
 Mon, 24 Jul 2023 14:27:28 +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
 <SRS0=c6P8=DK=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qNwX2-0001My-9R
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 14:27:28 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 352689c8-2a2e-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 16:27:24 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-4fb7373dd35so6872810e87.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 07:27:24 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 er14-20020a05651248ce00b004fdb27909cesm2238855lfb.5.2023.07.24.07.27.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 07:27:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 352689c8-2a2e-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690208844; x=1690813644;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=q1pbQAm5Bhfv4qZPL0AfqaY18XN1qs/woa+tmGH403k=;
        b=GoQiEqjF0SmLWmIsgxxm/vIxFnbNgZ8ii2V62ha214WcDTXeAP1ll9Srfm4aG7BJms
         OtBW+TiJSSKc/+B2gnbqtpjST3dfUq2hqhlQstiOlVT1SiLR9+WbN55Hzdgm7dmHy9Kj
         nfSwX2vL3Is9o9veLpxFV7MgseQygTgs/JO6ds6oJG3lzewzoZwesNDFdUdUjZyWwoxB
         QTipnU4JOssMVfk71TlIiAlo4YpXpTvR023s+zVugfCBrk4v2wd8bFQLcR6g3CaPnT4W
         wZ+LdvIdw6qenwufBplPtGBvbIm0KDhBfIPASXfALZl++05DogOxD/2bo20NHe204z4d
         lFKg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690208844; x=1690813644;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=q1pbQAm5Bhfv4qZPL0AfqaY18XN1qs/woa+tmGH403k=;
        b=KdWDrOrgvr+szM0iyUCtONKc2FUvYUYYCXGIj9GZ191sQeHddC4yOSSjTqrk0nOITE
         LGFd2r/W0P0WyH178AVSNDTCmPZMly+gzYtQB01nUVj6EOoM3oar8PIp6Qi7WpI2CyO9
         5Uwo+AacOPHScr/I3Fpb8TcaSONGMo/lAt5OjAq0J+fzIlgNg1CZoVoHdCsjc/cix59X
         Wuh8dNj67hcTmv2lwjYxIq5kS0VocEYQ6kfDdEfe4+QYb6wly4RFnWzhTo/bcsVu/J9F
         IQMQeGBnypIlDd0zKTfZCNH6OOcMMGSQLAvT6YdWmnTmFNI5iBI7zmYh6F66+1wNvak2
         KCug==
X-Gm-Message-State: ABy/qLZoNkPrAMXA7OXsNbT0Vz3iM/D60FgC0WaPWpiG4jCg1DEZWUKJ
	3V+6QwoRJ1qFxpLCnqv+NOEFfQZePH0=
X-Google-Smtp-Source: APBJJlEJXrjV48nVMGFDzOAX/eTdjirm2w57RDngn0Zz/VLj+f0iLcnVCd/SlpCT8FFwqhKhSfRNCw==
X-Received: by 2002:ac2:4d07:0:b0:4fb:a088:cfca with SMTP id r7-20020ac24d07000000b004fba088cfcamr3347618lfi.6.1690208843344;
        Mon, 24 Jul 2023 07:27:23 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v3] ns16550: add support for polling mode when device tree is used
Date: Mon, 24 Jul 2023 17:27:20 +0300
Message-ID: <d929b43814e6e1a247b954c4be40a35d61b6a45a.1690208840.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

RISC-V doesn't support interrupts for the time being, so it would be nice to
have polling mode.

The patch adds new option to console='...,polling' which forces driver to use
polling mode.

If there is no interrupt property in UART node, then polling will be used. Â  Â 
According to 4.2.2 National Semiconductor 16450/16550 Compatible UART
Requirements from The Devicetree Specification v0.4
( https://www.devicetree.org/specifications/ ) the interrupt property is Â  Â  Â  Â 
optional.

Also, it is possible that interrupt '0' can be used for some architectures as
an legal UART interrupt number ( according to dts files in Linux kernel ), so
the check of the return value of platform_get_irq() was updated in case of when
device tree is used for UART initialization.
For example:
https://github.com/torvalds/linux/blob/master/arch/powerpc/boot/dts/ebony.dts#L197

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/drivers/char/console.c |  2 ++
 xen/drivers/char/ns16550.c | 38 ++++++++++++++++++++++++++++----------
 2 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 0e410fa086..07e9610d77 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -993,6 +993,8 @@ void __init console_init_preirq(void)
 #endif
         else if ( !strncmp(p, "none", 4) )
             continue;
+        else if ( !strncmp(p, "polling", 7 )
+            continue;
         else if ( (sh = serial_parse_handle(p)) >= 0 )
         {
             sercon_handle = sh;
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 2aed6ec707..a6eb3b3997 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -58,7 +58,11 @@ static struct ns16550 {
     struct timer timer;
     struct timer resume_timer;
     unsigned int timeout_ms;
-    bool_t intr_works;
+    enum {
+        intr_off,
+        intr_on,
+        polling,
+    } intr_works;
     bool_t dw_usr_bsy;
 #ifdef NS16550_PCI
     /* PCI card parameters. */
@@ -181,7 +185,7 @@ static void cf_check ns16550_interrupt(
     struct serial_port *port = dev_id;
     struct ns16550 *uart = port->uart;
 
-    uart->intr_works = 1;
+    uart->intr_works = intr_on;
 
     while ( !(ns_read_reg(uart, UART_IIR) & UART_IIR_NOINT) )
     {
@@ -212,7 +216,7 @@ static void cf_check __ns16550_poll(struct cpu_user_regs *regs)
     struct serial_port *port = this_cpu(poll_port);
     struct ns16550 *uart = port->uart;
 
-    if ( uart->intr_works )
+    if ( uart->intr_works == intr_on )
         return; /* Interrupts work - no more polling */
 
     while ( ns_read_reg(uart, UART_LSR) & UART_LSR_DR )
@@ -305,7 +309,8 @@ static void ns16550_setup_preirq(struct ns16550 *uart)
     unsigned char lcr;
     unsigned int  divisor;
 
-    uart->intr_works = 0;
+    if ( uart->intr_works != polling )
+        uart->intr_works = intr_off;
 
     pci_serial_early_init(uart);
 
@@ -394,7 +399,7 @@ static void __init cf_check ns16550_init_irq(struct serial_port *port)
 
 static void ns16550_setup_postirq(struct ns16550 *uart)
 {
-    if ( uart->irq > 0 )
+    if ( uart->intr_works != polling )
     {
         /* Master interrupt enable; also keep DTR/RTS asserted. */
         ns_write_reg(uart,
@@ -473,6 +478,7 @@ static void __init cf_check ns16550_init_postirq(struct serial_port *port)
                 if ( rc )
                 {
                     uart->irq = 0;
+                    uart->intr_works = polling;
                     if ( msi_desc )
                         msi_free_irq(msi_desc);
                     else
@@ -488,7 +494,7 @@ static void __init cf_check ns16550_init_postirq(struct serial_port *port)
     }
 #endif
 
-    if ( uart->irq > 0 )
+    if ( uart->intr_works != polling )
     {
         uart->irqaction.handler = ns16550_interrupt;
         uart->irqaction.name    = "ns16550";
@@ -595,7 +601,9 @@ static void __init cf_check ns16550_endboot(struct serial_port *port)
 static int __init cf_check ns16550_irq(struct serial_port *port)
 {
     struct ns16550 *uart = port->uart;
-    return ((uart->irq > 0) ? uart->irq : -1);
+
+    return ( uart->intr_works != polling ) ?
+            uart->irq : -1;
 }
 
 static void cf_check ns16550_start_tx(struct serial_port *port)
@@ -654,6 +662,9 @@ static void ns16550_init_common(struct ns16550 *uart)
 
     /* Default lsr_mask = UART_LSR_THRE */
     uart->lsr_mask  = UART_LSR_THRE;
+
+    if ( console_has("polling") )
+        uart->intr_works = polling;
 }
 
 #ifdef CONFIG_X86
@@ -1330,9 +1341,12 @@ pci_uart_config(struct ns16550 *uart, bool_t skip_amt, unsigned int idx)
                  * as special only for X86.
                  */
                 if ( uart->irq == 0xff )
+                {
                     uart->irq = 0;
+                    uart->intr_works = polling;
+                }
 #endif
-                if ( !uart->irq )
+                if ( !uart->irq || (uart->intr_works == polling) )
                     printk(XENLOG_INFO
                            "ns16550: %pp: no legacy IRQ, using poll mode\n",
                            &PCI_SBDF(0, b, d, f));
@@ -1552,6 +1566,7 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
             conf += 3;
             uart->msi = true;
             uart->irq = 0;
+            uart->intr_works = polling;
         }
         else
 #endif
@@ -1791,8 +1806,11 @@ static int __init ns16550_uart_dt_init(struct dt_device_node *dev,
     }
 
     res = platform_get_irq(dev, 0);
-    if ( ! res )
-        return -EINVAL;
+    if ( res < 0 )
+    {
+        printk("there is no interrupt property, polling will be used\n");
+        uart->intr_works = polling;
+    }
     uart->irq = res;
 
     uart->dw_usr_bsy = dt_device_is_compatible(dev, "snps,dw-apb-uart");
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 14:34:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 14:34:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569000.889283 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNwdi-0002qc-8v; Mon, 24 Jul 2023 14:34:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569000.889283; Mon, 24 Jul 2023 14:34:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNwdi-0002qV-4w; Mon, 24 Jul 2023 14:34:22 +0000
Received: by outflank-mailman (input) for mailman id 569000;
 Mon, 24 Jul 2023 14:34:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=AOzI=DK=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qNwdh-0002qP-N7
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 14:34:21 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2cf2311f-2a2f-11ee-b23b-6b7b168915f2;
 Mon, 24 Jul 2023 16:34:20 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.162.132.135])
 by support.bugseng.com (Postfix) with ESMTPSA id E11814EE073E;
 Mon, 24 Jul 2023 16:34:18 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2cf2311f-2a2f-11ee-b23b-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [XEN PATCH v2] efi: mechanical renaming to address MISRA C:2012 Rule 5.3
Date: Mon, 24 Jul 2023 16:26:07 +0200
Message-Id: <60e2908f5a6c8aec082b59b44a688c260805c7b2.1690208527.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rule 5.3 has the following headline:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope"

The function parameters renamed in this patch are hiding a variable defined
in an enclosing scope.

The following rename is made:
- s/cfg/file/
to distinguish from the variable 'cfg', which is hidden by the parameter inside
the modified functions.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/common/efi/boot.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 24169b7b50..79a654af69 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -528,10 +528,10 @@ static char * __init split_string(char *s)
     return NULL;
 }
 
-static char *__init get_value(const struct file *cfg, const char *section,
+static char *__init get_value(const struct file *file, const char *section,
                               const char *item)
 {
-    char *ptr = cfg->str, *end = ptr + cfg->size;
+    char *ptr = file->str, *end = ptr + file->size;
     size_t slen = section ? strlen(section) : 0, ilen = strlen(item);
     bool match = !slen;
 
@@ -821,9 +821,9 @@ static bool __init read_section(const EFI_LOADED_IMAGE *image,
     return true;
 }
 
-static void __init pre_parse(const struct file *cfg)
+static void __init pre_parse(const struct file *file)
 {
-    char *ptr = cfg->str, *end = ptr + cfg->size;
+    char *ptr = file->str, *end = ptr + file->size;
     bool start = true, comment = false;
 
     for ( ; ptr < end; ++ptr )
@@ -844,7 +844,7 @@ static void __init pre_parse(const struct file *cfg)
         else
             start = 0;
     }
-    if ( cfg->size && end[-1] )
+    if ( file->size && end[-1] )
          PrintStr(L"No newline at end of config file,"
                    " last line will be ignored.\r\n");
 }
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 14:43:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 14:43:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569006.889293 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNwmf-0004O0-34; Mon, 24 Jul 2023 14:43:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569006.889293; Mon, 24 Jul 2023 14:43:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNwmf-0004Nt-0I; Mon, 24 Jul 2023 14:43:37 +0000
Received: by outflank-mailman (input) for mailman id 569006;
 Mon, 24 Jul 2023 14:43:35 +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 <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNwmd-0004Nl-R8
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 14:43:35 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2042.outbound.protection.outlook.com [40.107.13.42])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6f9f094a-2a30-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 16:43:21 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 14:43:04 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 14:43:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6f9f094a-2a30-11ee-8612-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=MFsLyc9T6msZGLf3kgGUUw6qfwJd+sBV/7GPYvzkOW7nlBumCUOqGYuKQyBB1UjycdkvFskzSBqeuYGh/SgBemK4SshPQ1KD4+Ey5dgyFlCThPIKvx5fntnnxkzE+T1bVf7rgiAC6efzarJTUM81aj1TJWRH/b2GqiVtxa3VjEjJvnLAv3DDLMy1kcp2XW2Wb5xMCsSnZKed1doWbR5mP5FiAOMOqLdqwjQRmnsxBGh1QBSZItDCZ8pV9XcOPcQEZbqdR5X0vJH+MJ6Gp8j4xlJ7qorkSaMjruhhoFnTSjne97Fn6ndzPxDYj1vZiqzyIgQG/JgvbtAAyyViOmxBnA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=SNzGTM1o3xIa9kcRiIs6wQ13+/1OY8o/5kHg68wZ0Cs=;
 b=OrMqb93/ZlXgYGaR9fXEZHlRKHL/mHY2Cda4nU9413UgGIr9kJc2u4J8KAhWU/Es4uebY08K+ymWUeJpozvqssrj4qpkoAyA+hciaAdVhgbLDj+GuYtzpVA2KQnSG6IycNO5XHlBieplE/QokgpNtktUpD2XFFQMXbldVt2VwjlzTtxH1Z0u+6OPJHf2HEXX1CyIUwuyuZbwGd78aNgpi8FS20tbZDfcaWjmi13LTomiMBAR2K9xrsYIHXmYmfyGhEsLfOjh5fJyca0m494RtkFyOQalygRvwYOzSY0VxB/S4qEWBAgRWWlURXefqK8n8QRqkomPN1UQtRd08HKgjw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=SNzGTM1o3xIa9kcRiIs6wQ13+/1OY8o/5kHg68wZ0Cs=;
 b=iESZDMAHpLSvLgm4HwNapUmo7NGwliaZbcfumIH5/Ew9JlliSDPYG4xyepeDT8P4PuWUNI3u9rRqd5+W01MpVB+VmY9HwfcECBsRsE3DKbef+U0d0IDsh/gO7Tg9P4x9LU3WU9mQTi5V0IMiRUpmy/gNzUVN0DeUmotAZWpqWvVuxPBCVNGTWKSHdbn9s6+/PnR98YBzt/RlZvaIvF+qFHQcpnbzzihiZcxZAkXyY2T9hp8j0tXqaN01A9KNEm/12uGBvX3ebZ+gmi3a+VslEQbLUaUCpYsJDbIzupktNxraMGhxyVnn0yQCJTU51gpYZcosHU6k8WEY8J5CxnNMYA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <be0c9eb8-6561-f6bc-ff76-a1bfeaeaab9d@suse.com>
Date: Mon, 24 Jul 2023 16:43:02 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3] ns16550: add support for polling mode when device tree
 is used
Content-Language: en-US
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <d929b43814e6e1a247b954c4be40a35d61b6a45a.1690208840.git.oleksii.kurochko@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <d929b43814e6e1a247b954c4be40a35d61b6a45a.1690208840.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0042.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:48::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM7PR04MB7157:EE_
X-MS-Office365-Filtering-Correlation-Id: 086ed71f-551d-45e3-728d-08db8c5449a3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	wHxfHob7HqlQ/ddlgOGBGW2k5mK1gX5nomeIKti/W0/bVYqjwLkF1GwZss7nRCpmbHDTuRzTnneZt3p0QbsgfOS8iclDN3G4viJjpLfBrvGibw2WUZ9TGzOgtJwkGWM2bxg/lSKD7GiLuPTCfSyFZQp8RaETTKZDuEtP0FLZ0zJUFhIh2TKd1ohUP7rEYcvP/sCP9HbFl3u/G/i1z6GvM0JZ6NkDoWsa9vefLgeQNBwdytIFbs+B/lSCkpaoWYfbgelo9dsb0/kWVbzv6jetMR+zPl83LfLWao8e4VPpn17VUsX73QaVprwjzhR2DE8vyRYSy24kJDQ7LnYaUEqRet/h99EMxcDX0uIdO1+CWZRoIpvso8GtbdACqaE2kwltXAjE3pKPqLiq5xL3Kw1TOJty5Y4wx5dUJJpHf5ngDH7GDLNiE8yL44KeNmQM6K/cJUrik67qem+tP9rzP6YzAVBkFCbuPitchTiee+0dtZ/JQjFpJiwIpl3OaoOtAjvg6XLqRSUISu3S6hjNwjjkIGiPhANfs/UdzyQZt7YtRGM0rUR2MK0KXY7fwto6+enqmrz0swqCIuTZT4gwWbIo9aEvrOKqsqUyCLgGJL/i4haMIOR+l8ip9j9r7FncZEvKpmIs514bXms5+0+FLbMJIw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(346002)(376002)(366004)(396003)(39850400004)(451199021)(478600001)(6486002)(66899021)(54906003)(8936002)(8676002)(5660300002)(2906002)(36756003)(86362001)(31696002)(4326008)(6916009)(38100700002)(66476007)(66946007)(66556008)(41300700001)(316002)(31686004)(83380400001)(186003)(2616005)(53546011)(26005)(6506007)(6512007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WEJ6eis4emszSVlId3YxV3lOdG1mcEpyZ0JJQmNxdFd6TW80OG1Bdjh6YUth?=
 =?utf-8?B?TVF3akpibVVhU0dMdGtmZWNuU2hvYm5YeHo5ejhjNkM0RlU0ZnFhZytOWngw?=
 =?utf-8?B?RGFMWmMvMlRFVzdPSEg1Nyt3S2ZZVHpaUndtcHE1N2dienp2RnFkeUFWRkFE?=
 =?utf-8?B?WjFKVWxBYjg2cWk1TW5uT1B4U3hBbll3dTRqWlM3WFZkWnZDeGRzZ0N1bFYy?=
 =?utf-8?B?ZUx3dWwrd2l1NVdrWjFCVFl2eG15eEpwTVhLSkd6WTBlU1RrL1MzR3BleU9H?=
 =?utf-8?B?Z2paVDFYUGdXUVVXdmVLSFliUlEwK3UzMm9DQ1J0WGp2Z1ZJTSswVjV0VlhV?=
 =?utf-8?B?dFRyMG5wUE90bHZrT3RxTUZnRk5SRVRyamlsajkyYXROSEVOT1JnTGExMU83?=
 =?utf-8?B?TTltdzV0eHJITk9hb1hqMVUrN2FzM2xrKzQwQWovV0habWtoZkJsb2hOejZz?=
 =?utf-8?B?VFNyUHhkTUNJTGZ5TFlkaEtVa2d4c2hzM1hDOWdRM0JNTHdYb2swRUpWcGla?=
 =?utf-8?B?SmVXTXMvMFJ6cE1QNnpKWUZEdjRTdTZFVE1mRWszQXJRNkgvZW12MUNwaC9C?=
 =?utf-8?B?S01lT2ROUFU0S29vVGlyc3cyMXdhUW1LWUpLSnNDd0tIUHE0VklveWlLM0xn?=
 =?utf-8?B?SzZhaWxDQit3dFNHVGpHYmtUcUx6WndQaUw1RllJd3BYZTdLT0JWWHhYTGVW?=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ExR1hIQUNtbkdud2NUanJWZ0p3NXBaZlRPY1NYSGV5UCsr?=
 =?utf-8?B?ai8ycTBqUE9jaXAvMzVnN0FqbTJsUTI5UzVrUFRHMDNZcWlUMUpRQjVkQlRD?=
 =?utf-8?B?WG9MdmZTc1JNOXZrVDIweUU3dGppQ0xOTk5mUzNiNVZaMWRoQU42T205YVV1?=
 =?utf-8?B?bCttNmlIYUtpekd2S3FkOXY2ejUzQ1ZkbWZsL3VwVmc3bGVEaElab2xHUlhC?=
 =?utf-8?B?N0hhZEc3T3BGL3UweTdMNjF0alhvQi9ONFlNQXdSZUVBOWdDY3V1OWlIMjBm?=
 =?utf-8?B?ZkQvNlJULzhQVUhyOENnWm1nWFYvOEVEaE9GL1hIYmFwdno3Z1BWSE9WcG1S?=
 =?utf-8?B?Mzh6a21qYWQvQ0lHU0NLSTEyUk9rMU00bHAxWmI3dGVRZkZLZm1NWEtMZ29N?=
 =?utf-8?B?SUdRRzd0NEtTWm9FRnZXUHZ3M0d1VG1WYWYvMzY4TEQzOTdOZTVjRFRCOEM0?=
 =?utf-8?B?Rk5pdkJGdUdFYURncUwvdjZScG04cFVERU9BenJnZ2ZPSG5PL05sLy94bkV5?=
 =?utf-8?Q?tjcYVf0kVS9OPkv9qYOn4jX1I?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 086ed71f-551d-45e3-728d-08db8c5449a3
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 14:43:04.4702
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 4RG5b+u3xkVIZh9GFJy1FNFXK8c2D+dc8ZgqU/64S7JlqiMOfMvqblq40ztT5z+NY+T9VF7om82pzO0e8PudWw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB7157

On 24.07.2023 16:27, Oleksii Kurochko wrote:
> --- a/xen/drivers/char/console.c
> +++ b/xen/drivers/char/console.c
> @@ -993,6 +993,8 @@ void __init console_init_preirq(void)
>  #endif
>          else if ( !strncmp(p, "none", 4) )
>              continue;
> +        else if ( !strncmp(p, "polling", 7 )
> +            continue;
>          else if ( (sh = serial_parse_handle(p)) >= 0 )
>          {
>              sercon_handle = sh;

Looks like you mean the new option to go under "console=". Besides
this being guesswork because of you not updating the command line
doc, this also is wrong, as the property then applies to all
consoles. What you mean is a control for a specific instance of a
16550 console, which can only possibly go under "com<N>=". I would
suggest to simply extend [<irq>|msi] there to [<irq>|msi|poll].

> @@ -595,7 +601,9 @@ static void __init cf_check ns16550_endboot(struct serial_port *port)
>  static int __init cf_check ns16550_irq(struct serial_port *port)
>  {
>      struct ns16550 *uart = port->uart;
> -    return ((uart->irq > 0) ? uart->irq : -1);
> +
> +    return ( uart->intr_works != polling ) ?
> +            uart->irq : -1;
>  }

Please don't corrupt previously correct style. You can keep things
almost like they were (albeit there's no strict need for any of the
parentheses):

    return ((uart->intr_works != polling) ? uart->irq : -1);

> @@ -1330,9 +1341,12 @@ pci_uart_config(struct ns16550 *uart, bool_t skip_amt, unsigned int idx)
>                   * as special only for X86.
>                   */
>                  if ( uart->irq == 0xff )
> +                {
>                      uart->irq = 0;
> +                    uart->intr_works = polling;
> +                }
>  #endif
> -                if ( !uart->irq )
> +                if ( !uart->irq || (uart->intr_works == polling) )
>                      printk(XENLOG_INFO
>                             "ns16550: %pp: no legacy IRQ, using poll mode\n",
>                             &PCI_SBDF(0, b, d, f));

Message and code (after your addition) continue to be out of sync.
As said before, any condition that leads to polling mode wants to
find itself expressed by uart->intr_works set to "polling".

> @@ -1552,6 +1566,7 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
>              conf += 3;
>              uart->msi = true;
>              uart->irq = 0;
> +            uart->intr_works = polling;

How that? "msi" is specifically asking for interrupt driven mode,
just that the IRQ number isn't known yet. (Seeing this I notice that
parse_namevalue_pairs() offers no way of selecting MSI mode. But
that's not something you need to sort out.)

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 14:45:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 14:45:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569009.889303 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNwo4-00051N-Hy; Mon, 24 Jul 2023 14:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569009.889303; Mon, 24 Jul 2023 14:45:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNwo4-00051G-Ds; Mon, 24 Jul 2023 14:45:04 +0000
Received: by outflank-mailman (input) for mailman id 569009;
 Mon, 24 Jul 2023 14:45:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNwo2-000514-Rd
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 14:45:02 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20622.outbound.protection.outlook.com
 [2a01:111:f400:7d00::622])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ab12c211-2a30-11ee-b23b-6b7b168915f2;
 Mon, 24 Jul 2023 16:45:01 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM8PR04MB7842.eurprd04.prod.outlook.com (2603:10a6:20b:245::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 14:44:59 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 14:44:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ab12c211-2a30-11ee-b23b-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=jBNGXdQbQOMOtt5J37p4p51Rur3vX5Qo2LZQPUPgLqSk+o4PnYFU+S2nw1huBCWXmCdvjVQUhDIhVwq8HCbMqahhL8OUQB+8J7vlO3Mv0Zf9gM6WL1a9e5ryaHAYJGzEKDVwTsrLfQ6e3/4v4j5znhXagHopK961MfXrlKPT8bHM9Y4SQcZzASPKMFZZajo/yCjTS930wSlBgQnuJonUYyyGZJDYhyCGm/X8vPtBcgPdF8qg0YMxm9fC9sksL0pifziS+8PrdUWpwcJFjXBHgFilbvscXjJBFcOhcZkRsUV4Yeyq9R6VoSRtqowJjNi41R8oCWs25OQSyedPMX0Edg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=niFdESdRLTWSWCxrIcGQL93tVo8iJqV0Ckd/Cd3J4ic=;
 b=ZqtaufUHa8MpPdr6eYgW5YRaljZ/zu4tNqNVkuimhK8Eh2zVgtRMQh404YuwNkGTJtlNBB/us35BhxV2QiY1W4VuS39L2ifnqn9O5fO+XB0A5HJZI1112xdPkbukfCynSjG1DoYfGNQoERqqCh2HtnIAj6qK/7VlM3zN8cFQZl73RthW15mlyC2EVmGMA+BaB2AWEu45vHQDuw2BqswO/CyhanucCp7IT8idSUXkcejUXM5wxCieHbiiu0dZFy8RWRLKh5OkShjDDN3vXksolFbbWW7WdLBOpOry3q1Jh7mtG+xoe/VRQFWPucd6vd1GVXCFRL+Fdogv3yrBA8KnUQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=niFdESdRLTWSWCxrIcGQL93tVo8iJqV0Ckd/Cd3J4ic=;
 b=Q56cI/YqHCcSpiwv/3ze1lom6PLsDKrzCNgBrxDXdsh3zL9VoxyMK9tB0RVvJe0AcvyjQrpuwFWAvnKh7NnZikO51NgVc2IXAvF5ErUJ25leaB+9PSX8MUOfo0QVFzjf3zcIC9+2dnMirpsRcJ23H7SGpkhhWIR4Fn2k6RiWZ7mIv7CHU8g/aSWacRS5fI5DxHLK3PUgUXtRA4gbq0x32g6qZqLEmU7CSj0DeCm/5c/xOnVJS+/aVOCXHkNyIID1JkZPyGYIrYF1AzGtb/ZZKM0ci8qcUPfie0SWIgMZlVWC4jA9qwxDf9ajTYBRHG7gIpUbn0lEOjeeq/skhC1NCg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e56d35c5-5fff-1067-3c47-ae917a4720ee@suse.com>
Date: Mon, 24 Jul 2023 16:44:57 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v2] efi: mechanical renaming to address MISRA C:2012
 Rule 5.3
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 xen-devel@lists.xenproject.org
References: <60e2908f5a6c8aec082b59b44a688c260805c7b2.1690208527.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <60e2908f5a6c8aec082b59b44a688c260805c7b2.1690208527.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0057.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:49::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM8PR04MB7842:EE_
X-MS-Office365-Filtering-Correlation-Id: a4597932-f840-4cb0-ba1a-08db8c548e24
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	5uszbPEDsquP/KeYCyXxqTh6defNcAODl1+DnPOPvf9oii98+POhishanQmrnv3pl/1yRFyKR1EXJbv0YfGUc7vdhU34VmOTz1euhhNodFHYAxsGJ0qW3l0Tg6yJH7UosbLK/Oj2QsC3RQjpXBjZasb4sOJbwdf1AiA3hLL+UHS6cCleJC9JLIFwJvO6MCWjCL9v0rNHYf09IcYL2s96mz8fk/pjqAV4V7dcHKeuDKT4vBNGu9pg/DrHDwxiGDH6sYtYl8glUQXepVCDiX5sxtdKJqcwuedP6PNOwGlm7ZgGkJON8zinDTmY5lb5uBIaut1RSWvbXnSmAD689Cs5RKytTR9ZLDO4RuT8Ofu/uBH7Q8OCxa+U2yZAtU3wTyRbXHNiXB9iyo9K1dr9nc4R5dl9qPdOMvVB3OOn2+EYliQvykC23CLTxvd4FWZpvJna3hv+pVd+NyJyTWUI37eH/dnIUc71YCuHKxnMBfLdaPle8MBzC8MmLPjGwreXW7gOC/Q6CeoR1gbchMIw3h2iAqM2Oy5f9++7uTXjxXxcl2u2jTGk7z5jb82Ka2l5jO29s+8TUpS1/qCQK6hsCi4631p8nw+egpRz+zQ+O34DEQckMqYTfguf9pHYrJElDWsdp70u2yclFNQUz6nm2Ef1QA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199021)(38100700002)(36756003)(53546011)(2616005)(8676002)(8936002)(5660300002)(478600001)(6916009)(4326008)(66556008)(66476007)(316002)(66946007)(41300700001)(26005)(186003)(6506007)(6512007)(6486002)(4744005)(2906002)(31696002)(31686004)(86362001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QnBRV3BtZU90Q3d5R2JkZ2t4V0VFQ05zaHVOOWVqdFIwTlVyOHBEeXgxVG9s?=
 =?utf-8?B?cDl4R1lQMFozQzcwZTlsWGU0Q3NXVWxoNHYy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T2hHclRKdUhreDVFRzNWVXZEakpvcFFj?=
 =?utf-8?B?ZmNDSHU4Rjd4N1MxZFRsVFBoNHRqenB2WVVmVlYrSGZHenNSWmhzWFVFam9v?=
 =?utf-8?B?ZkptTENSZjNtNlN2MjdLSHVGNW94YkFIVlB1V3FkTXZMT29QS1RqbFpla1Nm?=
 =?utf-8?B?aEdLcGJMMFFjUmVHNVA3d3pMaVVrRUtrTGl4Z0FYSVpmUXJVbzB2MEFNRG1r?=
 =?utf-8?B?SzRoYmRuYUV0czBQcldjZ3NCUUI3aUYzMHd6b0tnci9iQlY4TFpqQjZSUmRj?=
 =?utf-8?Q?HkY3pJYo4yg726OPh5Dg8SpGn?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a4597932-f840-4cb0-ba1a-08db8c548e24
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 14:44:59.3935
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 32/yE7ybrFPZaCfDov0IV1UzG1V5OPLjKuXL3CFmXOcUDWxMhtP68u+Xw5j4vcKV1dsC3pZtuXUEA/1ySewDkA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7842

On 24.07.2023 16:26, Nicola Vetrini wrote:
> Rule 5.3 has the following headline:
> "An identifier declared in an inner scope shall not hide an
> identifier declared in an outer scope"
> 
> The function parameters renamed in this patch are hiding a variable defined
> in an enclosing scope.
> 
> The following rename is made:
> - s/cfg/file/
> to distinguish from the variable 'cfg', which is hidden by the parameter inside
> the modified functions.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

Somewhat hesitantly
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 14:47:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 14:47:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569016.889312 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNwqp-0005db-Ue; Mon, 24 Jul 2023 14:47:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569016.889312; Mon, 24 Jul 2023 14:47:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNwqp-0005dU-SC; Mon, 24 Jul 2023 14:47:55 +0000
Received: by outflank-mailman (input) for mailman id 569016;
 Mon, 24 Jul 2023 14:47:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=c6P8=DK=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qNwqo-0005dO-K1
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 14:47:54 +0000
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com
 [2a00:1450:4864:20::134])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 11eaf71b-2a31-11ee-b23b-6b7b168915f2;
 Mon, 24 Jul 2023 16:47:53 +0200 (CEST)
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-4fbc0314a7bso6512750e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 07:47:53 -0700 (PDT)
Received: from [192.168.202.116] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 q2-20020a19a402000000b004fde41a2059sm1844354lfc.305.2023.07.24.07.47.52
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 07:47:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 11eaf71b-2a31-11ee-b23b-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690210073; x=1690814873;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=+v80aDPdHtfvFynUvxEJFCjMaubnRxDeZY7l/HynMo8=;
        b=k6pK8U2UTT686oNU+FEZMd1vAhhSOvJJ0R144h9bKQyudZEyLFYSERLskj4ExEovwr
         OSmCbTR3C7GltRbqNfPZUm+uFLxYSRIq/ICjVkm8PhggdhjtJNKAsqviyd47tT86vwVJ
         nbzMT+5E+V8lflnAzcn93RostkwBgx4LNEOHEbmBI408hXFKG4VYjEcIALOYYFz/EwDm
         upiwSUzKIWeuTn5sWWw3L7qQ7a2UYmY2auZxo4O88R0KrTZ/ZdlpXMaD/a80C18ljkbY
         QZBNAc9+zYFoX9uoPzKLObuvyz6pAkKi4w3hVF56xYBb6udFjUDKZVh4Ez3pT6iXEj2M
         NpEQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690210073; x=1690814873;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=+v80aDPdHtfvFynUvxEJFCjMaubnRxDeZY7l/HynMo8=;
        b=WxV6IQ5PX8rqGnN36NIj0eONdMeCoBEr7Xbj/q9ddGVJMSC+9HM2AbVld0OoG48AYb
         XbakW3oNRAtdsd4XVigvX87R3Fi3A4/iOPzMkiuCur4ymOJ4LGCZT66MvZwfWA9DnU5Y
         aHQzKsVlP54JfJ26IxLbyzvaP6NM4o9OCa3/Rj/Kq9GMiWyZJouQm9v7vtAhzwxwTOX8
         VfFXYVptvvt47Gxh2eI3/SBslss6Kg23vardyxtDrFp423ieFcZ3MDBEwkncIkKR4MaM
         Z3uSOr4bK5z78ePQU4VTWceYJPvhdsDoxvvIJErNDCeStUDQNf7Rg7C7T/jdG4FO9EpB
         mHew==
X-Gm-Message-State: ABy/qLbkTSSKqX4qqWVxE8pewUZWq83lV+KcldoeWyWusmvNqJnz6duT
	u1qTNePrfZBNkyGAzZtkC44=
X-Google-Smtp-Source: APBJJlED54JqkCH1IVNvz/AbNxe3t/EDLeGH/xgQ9YYK/oQFHGjCqkQRf+weo/kkXjDlNORpcJlprw==
X-Received: by 2002:a19:f802:0:b0:4f8:6e6e:4100 with SMTP id a2-20020a19f802000000b004f86e6e4100mr5151665lff.52.1690210073042;
        Mon, 24 Jul 2023 07:47:53 -0700 (PDT)
Message-ID: <a5b021b5f17f34c94729b934158f02c53ba70b7f.camel@gmail.com>
Subject: Re: [PATCH v4 1/2] xen/riscv: introduce function for physical
 offset calculation
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Bob Eshleman
	 <bobbyeshleman@gmail.com>, Alistair Francis <alistair.francis@wdc.com>, 
	Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
Date: Mon, 24 Jul 2023 17:47:52 +0300
In-Reply-To: <e728eb67-3ec6-65d2-df20-7aa34431546c@suse.com>
References: <cover.1690191480.git.oleksii.kurochko@gmail.com>
	 <19817eca0b7d4e8dee7eb5d5e7d3812133925eb3.1690191480.git.oleksii.kurochko@gmail.com>
	 <e728eb67-3ec6-65d2-df20-7aa34431546c@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Mon, 2023-07-24 at 15:40 +0200, Jan Beulich wrote:
> On 24.07.2023 11:42, Oleksii Kurochko wrote:
> > @@ -19,9 +20,10 @@ struct mmu_desc {
> > =C2=A0=C2=A0=C2=A0=C2=A0 pte_t *pgtbl_base;
> > =C2=A0};
> > =C2=A0
> > -#define PHYS_OFFSET ((unsigned long)_start - XEN_VIRT_START)
> > -#define LOAD_TO_LINK(addr) ((addr) - PHYS_OFFSET)
> > -#define LINK_TO_LOAD(addr) ((addr) + PHYS_OFFSET)
> > +unsigned long __ro_after_init phys_offset;
>=20
> While Misra compliance is distant future for RISC-V, there's a
> problem here with there not being any declaration for this global
> variable. Adding a declaration isn't the only solution though:
> Patch 2 also only uses the variable in assembly code. Therefore
> the variable here could be made static, with ...
>=20
> > @@ -273,3 +275,13 @@ void __init noreturn noinline enable_mmu()
> > =C2=A0=C2=A0=C2=A0=C2=A0 switch_stack_and_jump((unsigned long)cpu0_boot=
_stack +
> > STACK_SIZE,
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 cont_after_mmu_is_enabled);
> > =C2=A0}
> > +
> > +/*
> > + * calc_phys_offset() should be used before MMU is enabled because
> > access to
> > + * start() is PC-relative and in case when load_addr !=3D
> > linker_addr phys_offset
> > + * will have an incorrect value
> > + */
> > +void __init calc_phys_offset(void)
> > +{
> > +=C2=A0=C2=A0=C2=A0 phys_offset =3D (unsigned long)start - XEN_VIRT_STA=
RT;
> > +}
>=20
> ... this function (being invoked by the same assembly code
> function) returning the value alongside storing it.
Thanks for explanation about MISRA compliance.

>=20
> FTAOD I wouldn't insist on this being taken care of right away,
> so if you get a maintainer ack this way, I'd be happy to commit as
> is.
If I don't get an ACK, I'll update the code with the next patch
version.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 15:06:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 15:06:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569021.889322 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNx8h-0008AC-D5; Mon, 24 Jul 2023 15:06:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569021.889322; Mon, 24 Jul 2023 15:06:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNx8h-0008A5-AA; Mon, 24 Jul 2023 15:06:23 +0000
Received: by outflank-mailman (input) for mailman id 569021;
 Mon, 24 Jul 2023 15:06:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=1ryx=DK=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qNx8g-00089z-6I
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 15:06:22 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a47ab3b4-2a33-11ee-b23b-6b7b168915f2;
 Mon, 24 Jul 2023 17:06:20 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id DFC908285470;
 Mon, 24 Jul 2023 10:06:17 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id GxqBjUqR8x07; Mon, 24 Jul 2023 10:06:17 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 239DF82854B7;
 Mon, 24 Jul 2023 10:06:17 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id 0FqT181aTRYw; Mon, 24 Jul 2023 10:06:17 -0500 (CDT)
Received: from [10.11.0.2] (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 913638285470;
 Mon, 24 Jul 2023 10:06:16 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a47ab3b4-2a33-11ee-b23b-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 239DF82854B7
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1690211177; bh=v3Djm0mV8rUJTjPy/MbJN0Eqiw3J7S3u/mG6Rima90U=;
	h=Message-ID:Date:MIME-Version:To:From;
	b=S3wwud6B63gbnncyQiP7KCWP9Boq6euegPxEuuOc3rtChVp0GNcFCG6uuwOkDRIBA
	 ETLDHkLkTxxuqyiopdN5WBAvL6K5GXxBHCvnfDP2U4OMXEp8UmhjKlwseV6UWuzgJg
	 NXhJvEgW4t76HyR9xD7j1HgRRUTmfeRuY32YIB3c=
X-Virus-Scanned: amavisd-new at rptsys.com
Message-ID: <cf7e418f-763a-6f27-d498-c88b19c8a9eb@raptorengineering.com>
Date: Mon, 24 Jul 2023 10:06:15 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v5 3/4] xen/ppc: Implement early serial printk on pseries
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 xen-devel@lists.xenproject.org
References: <cover.1689958538.git.sanastasio@raptorengineering.com>
 <f326168638ae05f5f387e4fa018ac2ed057bac8c.1689958538.git.sanastasio@raptorengineering.com>
 <019914c7-c6ca-70b9-6c90-e1891f4201c4@suse.com>
From: Shawn Anastasio <sanastasio@raptorengineering.com>
In-Reply-To: <019914c7-c6ca-70b9-6c90-e1891f4201c4@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 7/24/23 7:40 AM, Jan Beulich wrote:
> On 21.07.2023 19:02, Shawn Anastasio wrote:
>> On typical Power VMs (e.g. QEMU's -M pseries), a variety of services
>> including an early serial console are provided by Open Firmware.
>> Implement the required interfaces to call into Open Firmware and write
>> to the serial console.
>>
>> Since Open Firmware runs in 32-bit Big Endian mode and Xen runs in
>> 64-bit Little Endian mode, a thunk is required to save/restore
>> any potentially-clobbered registers as well as to perform the
>> required endianness switch. Thankfully, linux already has such
>> a routine, which was imported into ppc64/of-call.S.
>>
>> Support for bare metal (PowerNV) will be implemented in a future
>> patch.
>>
>> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
> 
> While I've committed the earlier two patches, I had to back out this
> one. In my environment (gcc13) the build fails due an unresolved
> reference to memset() out of boot-of.c (supposedly from of_call()).

Does removing the `{ 0 }` initializer to `struct of_service s` on line
43 resolve this?

> Jan

Thanks,
Shawn


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 15:38:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 15:38:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569027.889332 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNxdd-0003Ak-Nu; Mon, 24 Jul 2023 15:38:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569027.889332; Mon, 24 Jul 2023 15:38:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNxdd-0003Ad-LB; Mon, 24 Jul 2023 15:38:21 +0000
Received: by outflank-mailman (input) for mailman id 569027;
 Mon, 24 Jul 2023 15:38:20 +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
 <SRS0=Klik=DK=citrix.com=prvs=5629c81f5=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qNxdb-0003AW-SN
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 15:38:20 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 10fdc474-2a38-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 17:38:00 +0200 (CEST)
Received: from mail-dm6nam11lp2170.outbound.protection.outlook.com (HELO
 NAM11-DM6-obe.outbound.protection.outlook.com) ([104.47.57.170])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 24 Jul 2023 11:37:54 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by MN2PR03MB5101.namprd03.prod.outlook.com (2603:10b6:208:1b0::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 15:37:52 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 15:37:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 10fdc474-2a38-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690213094;
  h=from:to:cc:subject:date:message-id:
   content-transfer-encoding:mime-version;
  bh=IYK+bOifPjEvm/34iNsybaMiYRDTv416x4CCd1LbYpE=;
  b=R0ri9T6qhouYHf1hf8gIRPn/d4GQsj9NMPpJ4rnvsF8baPwHCcP3D8ZV
   sUKJ6YbGUdL32G2hG9V8FUcO5MODwP3V1wx+65b7N68OwcZ8nKwwNenuR
   9O91jD8JyKO89+AJjfCMIx25902/UBDu7dl1yQJyNX4BYgYbZLjMC5WQm
   k=;
X-IronPort-RemoteIP: 104.47.57.170
X-IronPort-MID: 117679537
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:czyk8KsgB0VwVE3fQKwZrugVt+fnVJJfMUV32f8akzHdYApBsoF/q
 tZmKT2HO6nfZGr2Kt51Pt60oxgD756EydcwGwplqy1gQytB+JbJXdiXEBz9bniYRiHhoOCLz
 O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQqIu
 Nfjy+XSI1bg0DNvWo4uw/vrRChH4rKq4Vv0gnRkPaoQ5ACEzCFOZH4iDfrZw0XQE9E88tGSH
 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9
 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG
 fMwJwwgPjPZrt+Mnqu0FPh1nt4mLYq7BdZK0p1g5Wmx4fcOZ7nmGvyPyfoGmTA6i4ZJAOrUY
 NcfZXx3dhPcbhZTO1ARTpUjgOOvgXq5eDpdwL6XjfNvvy6Pk0osj/60b4K9lt+iHK25mm6Co
 W3L5SLhCwwyP92D0zuVtHmrg4cjmAuiAd1MS+zlraECbFu74XUcMxJOdnSAjd68gBGvdvFRF
 U4o0397xUQ13AnxJjXnZDWorXjBshMCVt54F+wh9BrL2qfS+xyeBGUPUnhG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JufUHwnFSKCnK?=
 =?us-ascii?q?CV39mFqyMUUWV+eA0qp87?=
X-Talos-MUID: 9a23:zi/36AjtEHTjUnSVClfP3MMpE95n2Kv2K282vbIDsZaVGA9+BTWhpWHi
X-IronPort-AV: E=Sophos;i="6.01,228,1684814400"; 
   d="scan'208";a="117679537"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=FZVss69ow/aL+z5clJzrIieha+cLJPQMBqVa44hrhstV1GAfiKBR9PuzchxmU3YX/ms6YgwQ+UgIvmZyvJV4bLO4c4CTxuASeAUA/ot7/9z+h4XAZO+PUeREfjkXP1b7OcYS1iJ6WuoNMSJUvsVB82iaLR2C1PxFDcCCjAIvEpCQr5gvN0xbTunKnHdte67RLiOFqwSmak9qkrUeAaF6H1VzMrwYJTy1A61aepMJYyYktcu2artlB64l4WC/aTUJBNdk8dTi/j8VoWbZeaV+wGkXc2Ewj16j1NsN14Dnmyg261meakJWzdQy1dWgQSSM6obvzWV7CczjV3EHqTUUig==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=dG3oPCszXfwQasS/uN0MSJM+luIJvXbEbNU+alUDoOY=;
 b=RCTPAF8/OE7JkwGJ7BJWY9AfZw6w5HyzHQQ7y5GHb387EzyBGk/RLWfxIXikizO+ElBX89Ci3lnhoW6ojWx1jAW/sljzmbVETIbTt6vf8jzrmOcPX1c0uup+cyQ9PlQz7wq3s4kM+90dcx5rBBH3SW8HrwP1NmGEcVwh6iNKR4VboRjtJGQj2q8DDOJOcPPExC/23khIo6LzCHgXyi6/oVAwjPxCtji09Ks8XPecy2Cuu2TwRJxrlp2tNO+SzVnOhRO34r8NlhFw3OXS+f84uylKVSQZkTJcVTMKRllpLEwVjSajUTzmMnvpHlUTDN+Kk4a5AT/hEbO9RKhJzLFgVQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=dG3oPCszXfwQasS/uN0MSJM+luIJvXbEbNU+alUDoOY=;
 b=VweBWWY4Au+RmN1S5ZGW9xU9/yCW10u3OVREq8p0y5TCKu6xQMnFJ+LSq7sczwSbqs2jx0JCVzZhp6SeTw5lUuvhFICspgWGGGocDQXt+opF8hW6eyhP/UNYUbFtHOScOdSnek2I+RV1ma3kAsUaamHOKU3ZVcviRrmxmr0FPOA=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: [PATCH] vpci: add permission checks to map_range()
Date: Mon, 24 Jul 2023 17:37:41 +0200
Message-ID: <20230724153741.42374-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO6P123CA0007.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:338::9) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|MN2PR03MB5101:EE_
X-MS-Office365-Filtering-Correlation-Id: a991604c-aa42-4255-477d-08db8c5bf140
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	GVXWvrfrppU1+TWvprvAQM5Thz9spqlUsQL2AdlQY++VkNoEIUoLfCmTdS30WpYFhTyHyxI0bklWn//HgdN2AE9ARAe652v1ZQlmeiVzuNVqhwLg58B3saRYIPRJ7TbDftPbKrLj1qKd+6gVASm1YTvg215RUgxzI9bnPpUONt0ADhqMDxHSQU25rWHZtC3GVe3kpWOBQNcFMKHh08mO6/2wWtdLG+AT8Z3ON/xHXyVVE6tlR9Dxx/qgWa1IRW8jOz4EnhTP8058uKFLTu9TdHTLOS1h0ElK4YH7dX/k6AYP/DGplS6bLDSJXUIRexv7yEUj9BJ4XvDBXD1QOY1pBtfTaE46MC8EmVYs1NoVK34SiS5jOMiQ8QsJ1GOf4KIbRbDvU0AjLePf0NqXuXbAFTZm803rfpIDQW+XfHxPHZDPTfeJ8jEqsMEjpYRG2xWJtIZpyqSJgzYXtdBamAIgFN3BcTtJCdUTEDDQoKKnwTJhzPN3OCY1cMnkmCzQUEJW1knPmre0w5lx/RzcJR3tregpNzhV1RN3NZPxDFAqKGo=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(136003)(396003)(346002)(376002)(39860400002)(451199021)(1076003)(26005)(186003)(6506007)(5660300002)(36756003)(8936002)(8676002)(2906002)(2616005)(82960400001)(86362001)(38100700002)(83380400001)(6916009)(66946007)(66556008)(66476007)(4326008)(316002)(54906003)(6486002)(6512007)(6666004)(478600001)(41300700001);DIR:OUT;SFP:1101;
X-MS-Exchange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CV1CJffyTTAlJJ1o+zTQyomKf6vjmbmjPe3+MH/eVwdDziZcNy+lUXyz4OTEUzU1mq0oOWhyEoTEDVWOshzevZNsDBBfkex2I71eX6c6knwF4wXcIVdQPX/T+9PArc4VXaKjHya8y3xeQw7meEArVsB2Yzq2MPRUssAyaw3pt4AnkXiMmmVsXTel3+j3R8Ut+t0gmPRxol9mDlnt8SiuXj36AZJRST7t+TLorE5COYeJ/XsNZrOsugdKHUfgIgORp6Pd3qO4GfKp3oi2pfKWhyBIWYXi80gxbMZpArg12XZCcD7IDdm983UUe+Ro8sf0oPJoMuHZlwW4aDvNv6e5XsTqP30oXWA8eEoNf+M/GuEdlrhe+2qpQYS1A+kGcN5JnSIqOTNxJb0IPXYEO8bUAe+KDhcplh2lVyN45/LDbICoHBhcFwNW2c8V5/r0kwoM3iwCUHqf0nf9oWZlw8fxAZjml4eSoX7JQpLFGS/7Qxw9pA2FxgRxTAqe3GBhodQfyTAgK4t0x
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a991604c-aa42-4255-477d-08db8c5bf140
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 15:37:52.3388
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: o5dQ8uvXL2AnALN/hXQZp5+/qEHpQgYi1uJ9nh1NDyTyrxLOodtA+Vtd7YtwhpklTQGNWJQteNK81xhjt+lLhg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR03MB5101

Just like it's done for the XEN_DOMCTL_memory_mapping hypercall, add
the permissions checks to vPCI map_range(), which is used to map the
BARs into the domain p2m.

Adding those checks requires that for x86 PVH hardware domain builder
the permissions are set before initializing the IOMMU, or else
attempts to initialize vPCI done as part of IOMMU device setup will
fail due to missing permissions to create the BAR mappings.

Fixes: 9c244fdef7e7 ('vpci: add header handlers')
Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
I'm unsure whether on ARM MMIO permissions are properly set for the
hardware domain, but I don't have a system to test with.
---
 xen/arch/x86/hvm/dom0_build.c | 21 ++++++++++++++-------
 xen/drivers/vpci/header.c     | 18 ++++++++++++++++++
 2 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index fd2cbf68bc62..c0ca57e05e98 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -715,13 +715,6 @@ static int __init pvh_setup_cpus(struct domain *d, paddr_t entry,
         return rc;
     }
 
-    rc = dom0_setup_permissions(d);
-    if ( rc )
-    {
-        panic("Unable to setup Dom0 permissions: %d\n", rc);
-        return rc;
-    }
-
     update_domain_wallclock_time(d);
 
     v->is_initialised = 1;
@@ -1184,6 +1177,20 @@ int __init dom0_construct_pvh(struct domain *d, const module_t *image,
 
     printk(XENLOG_INFO "*** Building a PVH Dom%d ***\n", d->domain_id);
 
+    if ( is_hardware_domain(d) )
+    {
+        /*
+         * Setup permissions early so that calls to add MMIO regions to the
+         * p2m as part of vPCI setup don't fail due to permission checks.
+         */
+        rc = dom0_setup_permissions(d);
+        if ( rc )
+        {
+            printk("%pd unable to setup permissions: %d\n", d, rc);
+            return rc;
+        }
+    }
+
     /*
      * NB: MMCFG initialization needs to be performed before iommu
      * initialization so the iommu code can fetch the MMCFG regions used by the
diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index b41556d00746..12ae37deac83 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -17,10 +17,13 @@
  * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <xen/iocap.h>
 #include <xen/sched.h>
 #include <xen/softirq.h>
 #include <xen/vpci.h>
 
+#include <xsm/xsm.h>
+
 #include <asm/event.h>
 #include <asm/p2m.h>
 
@@ -43,6 +46,21 @@ static int cf_check map_range(
     {
         unsigned long size = e - s + 1;
 
+        if ( !iomem_access_permitted(map->d, s, e) )
+        {
+            gprintk(XENLOG_WARNING,
+                    "%pd denied access to MMIO range [%#lx, %#lx]\n", s, e);
+            return -EPERM;
+        }
+
+        rc = xsm_iomem_mapping(XSM_HOOK, map->d, s, e, map->map);
+        if ( rc )
+        {
+            gprintk(XENLOG_WARNING,
+                    "%pd XSM denied access to MMIO range [%#lx, %#lx]\n", s, e);
+            return rc;
+        }
+
         /*
          * ARM TODOs:
          * - On ARM whether the memory is prefetchable or not should be passed
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 15:55:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 15:55:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569048.889343 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNxuX-0005gE-Ll; Mon, 24 Jul 2023 15:55:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569048.889343; Mon, 24 Jul 2023 15:55:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNxuX-0005g7-IR; Mon, 24 Jul 2023 15:55:49 +0000
Received: by outflank-mailman (input) for mailman id 569048;
 Mon, 24 Jul 2023 15:55:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNxuW-0005fx-1w; Mon, 24 Jul 2023 15:55:48 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNxuV-0004vq-PB; Mon, 24 Jul 2023 15:55:47 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNxuV-0000er-BV; Mon, 24 Jul 2023 15:55:47 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qNxuV-0003FE-Ap; Mon, 24 Jul 2023 15:55:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=GwRKfPmeIwkUKcoTAlHKt4m9+ZUm/2kVcJz1p1Fyhj8=; b=JL07n0fkBnUW14btd67zdLSdrT
	4Dahop0eSxiB+9jAUpwQ+oAJl7eH3avBXxywwcPrkcKezwC+to9nzyqWquiqNmCUjW788yI5PVFmN
	Eroc1H4O8oREH/gGbYbtfGyktXDhsrG5WM7N6U07wj5vIXOhjNJcU1tCPrt6e+sg68pY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181989-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181989: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:guest-localmigrate/x10:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-rtds:guest-localmigrate/x10:fail:allowable
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=6eaae198076080886b9e7d57f4ae06fa782f90ef
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 24 Jul 2023 15:55:47 +0000

flight 181989 linux-linus real [real]
flight 181992 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181989/
http://logs.test-lab.xenproject.org/osstest/logs/181992/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 18 guest-localmigrate/x10 fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-shadow 20 guest-localmigrate/x10 fail pass in 181992-retest
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 181992-retest

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds     20 guest-localmigrate/x10   fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                6eaae198076080886b9e7d57f4ae06fa782f90ef
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   98 days
Failing since        180281  2023-04-17 06:24:36 Z   98 days  187 attempts
Testing same since   181989  2023-07-24 04:22:26 Z    0 days    1 attempts

------------------------------------------------------------
3818 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 641607 lines long.)


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 16:00:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 16:00:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569052.889353 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNxzF-0007fk-6l; Mon, 24 Jul 2023 16:00:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569052.889353; Mon, 24 Jul 2023 16:00:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNxzF-0007fd-3p; Mon, 24 Jul 2023 16:00:41 +0000
Received: by outflank-mailman (input) for mailman id 569052;
 Mon, 24 Jul 2023 16:00:40 +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
 <SRS0=c6P8=DK=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qNxzD-0007fX-TV
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 16:00:39 +0000
Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com
 [2a00:1450:4864:20::22b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2d2f5a5e-2a3b-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 18:00:14 +0200 (CEST)
Received: by mail-lj1-x22b.google.com with SMTP id
 38308e7fff4ca-2b93fba1f62so64335021fa.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 09:00:32 -0700 (PDT)
Received: from [192.168.202.116] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 k19-20020a2e2413000000b002b6ec6cb24bsm2955187ljk.57.2023.07.24.09.00.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 09:00:31 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2d2f5a5e-2a3b-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690214432; x=1690819232;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=zYlzHlK3um2lM7goEapzGJltSbWGvQox88EIUcqrIlE=;
        b=QDtOlKbdUrKOKbDmwOdLw4bmUBgnrpW6BFmn7+RM+YDi8jCx2ZscSsA7VYOdiUChUH
         ZHGToD5dBmONkXB4gwkaqXfJ+XXQXMuPNa809Ab4nxOoI/Vnntp/rsbJjuck4rvHidNv
         /hojHWKkJ9sVejLw1we9LFsq1+EjzWiS1UtSmGfaJinbtgDcxMWnlfxJikex9JJXy3zm
         ueKWv2uN4Uz+o2PqekjOqrwQQl2u+RofQe489XYtYKRzS28NOWv2G9+nEDKfkbXpGFHA
         c+8Zla65bKsmBjkS0JUMfMxgAHpKMKy37wym0wj7y1DwC9G1Cf8FMCl0M65AVJjDlU45
         aoXA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690214432; x=1690819232;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=zYlzHlK3um2lM7goEapzGJltSbWGvQox88EIUcqrIlE=;
        b=YCwjzfY+mwB6dlAuyr63toa+xn/DhOAxFtuoefPVtTrFK3niwKGh/6TSiKV/6oLwwy
         LzypCqxpsAHRzBEAs+cUSBYdGwCpFb6wbYkrIC0k4oCgG2nWfCi61/yv93/OjwLt8s6f
         78qn3jUNb1bxwX8gKA1Fn8UVg7IxmPYBnO5gZbDc8Aci+TWJH3Aj/JO6kMRImv/rYk57
         mzOI4XOiO0Ujp/rK+MmwL4iznyrhnynjNhzdX2+2gHebIDR7PH853HXwpd0QKUnTxwHD
         zUT/mfilGRVTua/NqlBfMXbyl7SFz5RnKtuCM7t8s3SFyY2GbvrXlXeFn1UKmutoJLj8
         nSCQ==
X-Gm-Message-State: ABy/qLaqnyzpHXxwuYMghlNTX9QvlGn+lqONZXNJX04ekAawqQcaRS8s
	FCNJ2BqNyqW58UFHeNrQLVE=
X-Google-Smtp-Source: APBJJlHWCO8ER6mL7YLVDBndcPO1DB9s8FHg+rqbAvgsriMlcfuvep69ePtTyNpiVS572hYE4wK4Tw==
X-Received: by 2002:a2e:90da:0:b0:2b9:4476:ab28 with SMTP id o26-20020a2e90da000000b002b94476ab28mr6947230ljg.38.1690214431845;
        Mon, 24 Jul 2023 09:00:31 -0700 (PDT)
Message-ID: <dddc1effe5fc112f79a84e4f0a7ccf283877a466.camel@gmail.com>
Subject: Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Bob Eshleman
	 <bobbyeshleman@gmail.com>, Alistair Francis <alistair.francis@wdc.com>, 
	Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
Date: Mon, 24 Jul 2023 19:00:30 +0300
In-Reply-To: <c32d8be8-75cf-78f8-304d-247b93b611cb@suse.com>
References: <cover.1690191480.git.oleksii.kurochko@gmail.com>
	 <a8ab1829ab718dda869db3df3348ded211e81967.1690191480.git.oleksii.kurochko@gmail.com>
	 <c32d8be8-75cf-78f8-304d-247b93b611cb@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Mon, 2023-07-24 at 16:11 +0200, Jan Beulich wrote:
> On 24.07.2023 11:42, Oleksii Kurochko wrote:
> > @@ -35,8 +36,10 @@ unsigned long __ro_after_init phys_offset;
> > =C2=A0 *
> > =C2=A0 * It might be needed one more page table in case when Xen load
> > address
> > =C2=A0 * isn't 2 MB aligned.
> > + *
> > + * CONFIG_PAGING_LEVELS page tables are needed for identity
> > mapping.
> > =C2=A0 */
> > -#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) + 1)
> > +#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) * 2) + 1
>=20
> Comment addition and code change are at least apparently out of sync:
> With such a comment and without thinking much one would expect the
> constant to be bumped by CONFIG_PAGING_LEVELS. It is true that you
> only need CONFIG_PAGING_LEVELS - 1, because the root table is shared,
> but that would then be nice to also clarify in the comment. E.g.
>=20
> "CONFIG_PAGING_LEVELS page tables are needed for the identity
> mapping,
> =C2=A0except that the root page table is shared with the initial mapping.=
"
Thanks. I'll take into account in the next patch version.

>=20
> Also - where did the outermost pair of parentheses go? (Really you
> don't need to parenthesize the multiplication, so the last closing
> one can simply move last.)
Missed it. Thanks. I'll move last parentheses to the end.
>=20
> > @@ -75,10 +78,11 @@ static void __init setup_initial_mapping(struct
> > mmu_desc *mmu_desc,
> > =C2=A0=C2=A0=C2=A0=C2=A0 unsigned int index;
> > =C2=A0=C2=A0=C2=A0=C2=A0 pte_t *pgtbl;
> > =C2=A0=C2=A0=C2=A0=C2=A0 unsigned long page_addr;
> > +=C2=A0=C2=A0=C2=A0 bool is_identity_mapping =3D map_start =3D=3D pa_st=
art;
> > =C2=A0
> > -=C2=A0=C2=A0=C2=A0 if ( (unsigned long)_start % XEN_PT_LEVEL_SIZE(0) )
> > +=C2=A0=C2=A0=C2=A0 if ( !IS_ALIGNED((unsigned long)_start, KB(4)) )
> > =C2=A0=C2=A0=C2=A0=C2=A0 {
> > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 early_printk("(XEN) Xen sho=
uld be loaded at 4k
> > boundary\n");
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 early_printk("(XEN) Xen sho=
uld be loaded at 4KB
> > boundary\n");
>=20
> The change to the message looks unrelated.
Yes, you are right. I'll remove that change to the message.

>=20
> > @@ -255,25 +261,44 @@ void __init noreturn noinline enable_mmu()
> > =C2=A0=C2=A0=C2=A0=C2=A0 csr_write(CSR_SATP,
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 PFN_DOWN((unsigned long)stage1_pgtbl_root) |
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 RV_STAGE1_MODE << SATP_MODE_SHIFT);
> > +}
> > =C2=A0
> > -=C2=A0=C2=A0=C2=A0 asm volatile ( ".p2align 2" );
> > - mmu_is_enabled:
> > -=C2=A0=C2=A0=C2=A0 /*
> > -=C2=A0=C2=A0=C2=A0=C2=A0 * Stack should be re-inited as:
> > -=C2=A0=C2=A0=C2=A0=C2=A0 * 1. Right now an address of the stack is rel=
ative to load
> > time
> > -=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0=C2=A0 addresses what will cause=
 an issue in case of load start
> > address
> > -=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0=C2=A0 isn't equal to linker sta=
rt address.
> > -=C2=A0=C2=A0=C2=A0=C2=A0 * 2. Addresses in stack are all load time rel=
ative which can
> > be an
> > -=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0=C2=A0 issue in case when load s=
tart address isn't equal to
> > linker
> > -=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0=C2=A0 start address.
> > -=C2=A0=C2=A0=C2=A0=C2=A0 *
> > -=C2=A0=C2=A0=C2=A0=C2=A0 * We can't return to the caller because the s=
tack was reseted
> > -=C2=A0=C2=A0=C2=A0=C2=A0 * and it may have stash some variable on the =
stack.
> > -=C2=A0=C2=A0=C2=A0=C2=A0 * Jump to a brand new function as the stack w=
as reseted
> > -=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +void __init remove_identity_mapping(void)
> > +{
> > +=C2=A0=C2=A0=C2=A0 static pte_t *pgtbl =3D stage1_pgtbl_root;
> > +=C2=A0=C2=A0=C2=A0 static unsigned long load_start =3D XEN_VIRT_START;
> > +=C2=A0=C2=A0=C2=A0 static unsigned int pt_level =3D CONFIG_PAGING_LEVE=
LS - 1;
>=20
> These all want to be __initdata, but personally I find this way of
> recursing a little odd. Let's see what the maintainers say.
I'm not completely happy either. Initially I thought that it would be
better to pass all this stuff as function's arguments.

But then it is needed to provide an access to stage1_pgtbl_root (
get_root_pt() function ? ). So remove_identity_mapping() will be called
as remove_identity_mapping(get_root_pt(), _start, CONFIG_PAGING_LELVELS
-1 ) or remove_identity_mapping(NULL, _start, CONFIG_PAGING_LELVELS -1
) and then check if first argument is NULL then initialize it with
stage1_pgtbl_root.
Also I am not sure that an 'user' should provide all this information
to such function.

Could you recommend something better?

>=20
> > +=C2=A0=C2=A0=C2=A0 unsigned long load_end =3D LINK_TO_LOAD(_end);
> > +=C2=A0=C2=A0=C2=A0 unsigned long xen_size;
> > +=C2=A0=C2=A0=C2=A0 unsigned long pt_level_size =3D XEN_PT_LEVEL_SIZE(p=
t_level);
> > +=C2=A0=C2=A0=C2=A0 unsigned long pte_nums;
> > +
> > +=C2=A0=C2=A0=C2=A0 unsigned long virt_indx =3D pt_index(pt_level, XEN_=
VIRT_START);
> > +=C2=A0=C2=A0=C2=A0 unsigned long indx;
> > +
> > +=C2=A0=C2=A0=C2=A0 if ( load_start =3D=3D XEN_VIRT_START )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 load_start =3D LINK_TO_LOAD=
(_start);
> > +
> > +=C2=A0=C2=A0=C2=A0 xen_size =3D load_end - load_start;
>=20
> When you come here recursively, don't you need to limit this
> instance of the function to a single page table's worth of address
> space (at the given level), using load_end only if that's yet
> lower?
Do you mean a case when load_start > load_end? If yes then I missed
that.
>=20
> > +=C2=A0=C2=A0=C2=A0 pte_nums =3D ROUNDUP(xen_size, pt_level_size) / pt_=
level_size;
> > +
> > +=C2=A0=C2=A0=C2=A0 while ( pte_nums-- )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 indx =3D pt_index(pt_level,=
 load_start);
> > =C2=A0
> > -=C2=A0=C2=A0=C2=A0 switch_stack_and_jump((unsigned long)cpu0_boot_stac=
k +
> > STACK_SIZE,
> > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 cont_after_mmu_is_enabled);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( virt_indx !=3D indx )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pgt=
bl[indx].pte =3D 0;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 loa=
d_start +=3D XEN_PT_LEVEL_SIZE(pt_level);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pgt=
bl =3D=C2=A0 (pte_t
> > *)LOAD_TO_LINK(pte_to_paddr(pgtbl[indx]));
>=20
> Nit: Stray double blank.
Thanks.
>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pt_=
level--;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rem=
ove_identity_mapping();
>=20
> Don't you need to restore pgtbl and pt_level here before the loop
> can continue? And because of depending on load_start, which would
> have moved, xen_size also needs suitably reducing, I think. Plus
> pte_nums as well, since that in turn was calculated from xen_size.
I forgot to restore pgtbl and pt_level because initially I used a
function arguments to pass that information so it wasn't needed to
restore them.

Regarding xen_size and pte_nums it looks like it is needed to init only
once on each page table level.
For example we have the following situation:
  ----------------------
   non-identity-mapping
   identity-mapping
  ---------------------- C
   identity-mapping
  ---------------------- B
   identity-mapping
  ---------------------- A
So we calculated that we need to remove 3 ptes, for first two ptes ( as
only identity mapping is there) are removed without any issue, then
move load_addr to C and run recursion
for the pte 'C' to go to next page table level.
At new level we are calculating how many ptes are needed to be removed
and remove only necessary amount of ptes.
When we will back to prev page table level pte_num will be 1 then we
will go to the head of the cycle, decrease pte_num to 0 and exit.

The same is with the case when non-idenitity-mapping is lower than
identity mapping ( but it looks like it is not a case becase
XEN_VIRT_START addr is the highest address by its defintion. Probably
it is needed to add a check ):
we know that pte_num =3D 3 at some level. Then we go to the next level
and remove there only identity map ptes, back to previous level,
decrease pte_num to 2 and remove only 2 remaining ptes.

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 16:04:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 16:04:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569056.889373 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNy2V-0008Ks-5H; Mon, 24 Jul 2023 16:04:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569056.889373; Mon, 24 Jul 2023 16:04:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNy2V-0008Jn-0C; Mon, 24 Jul 2023 16:04:03 +0000
Received: by outflank-mailman (input) for mailman id 569056;
 Mon, 24 Jul 2023 16:04:01 +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
 <SRS0=VoGu=DK=xenbits.xen.org=andrewcoop@srs-se1.protection.inumbo.net>)
 id 1qNy2T-0008EZ-Co
 for xen-devel@lists.xen.org; Mon, 24 Jul 2023 16:04:01 +0000
Received: from mail.xenproject.org (mail.xenproject.org [104.130.215.37])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9f1e281d-2a3b-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 18:03:28 +0200 (CEST)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1qNy2D-0005bj-7X; Mon, 24 Jul 2023 16:03:45 +0000
Received: from andrewcoop by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1qNy2D-00042T-65; Mon, 24 Jul 2023 16:03:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9f1e281d-2a3b-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:CC:From:To:MIME-Version:
	Content-Transfer-Encoding:Content-Type;
	bh=q0hSbsYW9qaxMw1fIRui10REp4EqcBzJKVI5U2eNgXw=; b=RBAKC0tmeugUhMUvdHF8KNvaI3
	w5ZA/Aq9B/hMvU8Weqx2M31Y8DuaNDVO4C7cZidHte37g75YKzoNATU4WH096OjRPW77vytxD0eIz
	K2NCH0bmGokqW0x3sne2DRoQWMm3BepyLsPTPH2L2453qMcnCfJc2oqL4FitMDBpM4aw=;
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.509 (Entity 5.509)
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
 xen-users@lists.xen.org, oss-security@lists.openwall.com
From: Xen.org security team <security@xen.org>
CC: Xen.org security team <security-team-members@xen.org>
Subject: Xen Security Advisory 433 v1 - x86/AMD: Zenbleed
Message-Id: <E1qNy2D-00042T-65@xenbits.xenproject.org>
Date: Mon, 24 Jul 2023 16:03:45 +0000

--=separator
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

                    Xen Security Advisory XSA-433

                          x86/AMD: Zenbleed

ISSUE DESCRIPTION
=================

Researchers at Google have discovered Zenbleed, a hardware bug causing
corruption of the vector registers.

When a VZEROUPPER instruction is discarded as part of a bad transient
execution path, its effect on internal tracking are not unwound
correctly.  This manifests as the wrong micro-architectural state
becoming architectural, and corrupting the vector registers.

Note: While this malfunction is related to speculative execution, this
      is not a speculative sidechannel vulnerability.

The corruption is not random.  It happens to be stale values from the
physical vector register file, a structure competitively shared between
sibling threads.  Therefore, an attacker can directly access data from
the sibling thread, or from a more privileged context.

For more details, see:
  https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7008.html
  https://github.com/google/security-research/security/advisories/GHSA-v6wh-rxpg-cmm8

IMPACT
======

With very low probability, corruption of the vector registers can occur.
This data corruption causes mis-calculations in subsequent logic.

An attacker can exploit this bug to read data from different contexts on
the same core.  Examples of such data includes key material, cypher and
plaintext from the AES-NI instructions, or the contents of REP-MOVS
instructions, commonly used to implement memcpy().

VULNERABLE SYSTEMS
==================

Systems running all versions of Xen are affected.

This bug is specific to the AMD Zen2 microarchitecture.  AMD do not
believe that other microarchitectures are affected.

MITIGATION
==========

This issue can be mitigated by disabling AVX, either by booting Xen with
`cpuid=no-avx` on the command line, or by specifying `cpuid="host:avx=0"` in
the vm.cfg file of all untrusted VMs.  However, this will come with a
significant impact on the system and is not recommended for anyone able to
deploy the microcode or patch described below.

RESOLUTION
==========

AMD are producing microcode updates to address the bug.  Consult your
dom0 OS vendor.  This microcode is effective when late-loaded, which can
be performed on a live system without reboot.

In cases where microcode is not available, the appropriate attached
patch updates Xen to use a control register to avoid the issue.

Note that patches for released versions are generally prepared to
apply to the stable branches, and may not apply cleanly to the most
recent release tarball.  Downstreams are encouraged to update to the
tip of the stable branch before applying these patches.

xsa433.patch           xen-unstable
xsa433-4.17.patch      Xen 4.17.x
xsa433-4.16.patch      Xen 4.16.x
xsa433-4.15.patch      Xen 4.15.x
xsa433-4.14.patch      Xen 4.14.x

$ sha256sum xsa433*
a9331733b63e3e566f1436a48e9bd9e8b86eb48da6a8ced72ff4affb7859e027  xsa433.patch
6f1db2a2078b0152631f819f8ddee21720dabe185ec49dc9806d4a9d3478adfd  xsa433-4.14.patch
ca3a92605195307ae9b6ff87240beb52a097c125a760c919d7b9a0aff6e557c0  xsa433-4.15.patch
e5e94b3de68842a1c8d222802fb204d64acd118e3293c8e909dfaf3ada23d912  xsa433-4.16.patch
41d12104869b7e8307cd93af1af12b4fd75a669aeff15d31b234dc72981ae407  xsa433-4.17.patch
$

NOTE CONCERNING TIMELINE
========================

This issue is subject to coordinated disclosure on August 8th.  The
discoverer chose to publish details ahead of this timeline.
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmS+oDEMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZ4JkIAMOW9i78luUOEgggrQDp97T1CMAhew+3v+r2ZPMl
z7a6ATRU3oW7yeepYEP/1mrRFi2E09zrj0rDLvLVrYrhqeDGVIL+ZfI480508/5Y
ubRYZC13rA3jDMDu9r+oBIzObumecRAVj54j5BQmuKyXDqkDMGfbVShpMMvARvhE
wqlBXNFB1Z+ARlDrDZZo6sKhfUqHS4Fo8iilWthKxY9Eb0cxxA1PazMJz5OOaqe6
6Y3hHrSN4dq3DseAhYGgtw+BOTa/XlgAzkdlJM0DvooS22HFuHqwB7dckrtpCMlC
6I3P3p0GfsnG8U99lxYWzuEbtAKwSsFf/da2S8A4rel0aOE=
=xmQd
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa433.patch"
Content-Disposition: attachment; filename="xsa433.patch"
Content-Transfer-Encoding: base64

RnJvbTogQW5kcmV3IENvb3BlciA8YW5kcmV3LmNvb3BlcjNAY2l0cml4LmNv
bT4KU3ViamVjdDogeDg2L2FtZDogTWl0aWdhdGlvbnMgZm9yIFplbmJsZWVk
CgpaZW5ibGVlZCBpcyBhIG1hbGZ1bmN0aW9uIG9uIEFNRCBaZW4yIHVhcmNo
IHBhcnRzIHdoaWNoIHJlc3VsdHMga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wcm9jZXNzb3IuaAorKysgYi94ZW4vYXJjaC94ODYvaW5jbHVkZS9h
c20vcHJvY2Vzc29yLmgKQEAgLTU0Nyw2ICs1NDcsOCBAQCBlbnVtIGFwX2Jv
b3RfbWV0aG9kIHsKIH07CiBleHRlcm4gZW51bSBhcF9ib290X21ldGhvZCBh
cF9ib290X21ldGhvZDsKIAordm9pZCBhbWRfY2hlY2tfemVuYmxlZWQodm9p
ZCk7CisKICNlbmRpZiAvKiAhX19BU1NFTUJMWV9fICovCiAKICNlbmRpZiAv
KiBfX0FTTV9YODZfUFJPQ0VTU09SX0ggKi8KCg==

--=separator
Content-Type: application/octet-stream; name="xsa433-4.14.patch"
Content-Disposition: attachment; filename="xsa433-4.14.patch"
Content-Transfer-Encoding: base64

RnJvbTogQW5kcmV3IENvb3BlciA8YW5kcmV3LmNvb3BlcjNAY2l0cml4LmNv
bT4KU3ViamVjdDogeDg2L2FtZDogTWl0aWdhdGlvbnMgZm9yIFplbmJsZWVk
CgpaZW5ibGVlZCBpcyBhIG1hbGZ1bmN0aW9uIG9uIEFNRCBaZW4yIHVhcmNo
IHBhcnRzIHdoaWNoIHJlc3VsdHMgaW4gY29ycnVwdGlvbgpvZiB0aGUgdmVj
dG9yIHJlZ2lzdGVycy4gIEFuIGF0dGFja2VyIGNhbiB0cmlnZ2VyIHRoaXMg
YnVnIGRlbGliZXJhdGVseSBpbgpvcmRlciB0byBhY2Nlc3Mgc3RhbGUgZGF0
YSBpbiB0aGUgcGh5c2ljYWwgdmVjdG9yIHJlZ2lzdGVyIGZpbGUuICBUaGlz
IGNhbgppbmNsdWRlIGRhdGEgZnJvbSBzaWJsaW5nIHRocmVhZHMsIG9yIGEg
aGlnaGVyLXByaXZpbGVnZSBjb250ZXh0LgoKTWljcm9jb2RlIGlzIHRoZSBw
cmVmZXJyZWQgbWl0aWdhdGlvbiBidXQgaW4gdGhlIGNhc2UgdGhhdCdzIG5v
dCBhdmFpbGFibGUgdXNlCnRoZSBjaGlja2VuY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RlL2FtZC5jCkBAIC0yNTEsNiArMjUxLDggQEAgc3RhdGljIGludCBhcHBs
eV9taWNyb2NvZGUoY29uc3Qgc3RydWN0IG1pY3JvY29kZV9wYXRjaCAqcGF0
Y2gpCiAgICAgcHJpbnRrKFhFTkxPR19XQVJOSU5HICJtaWNyb2NvZGU6IENQ
VSV1IHVwZGF0ZWQgZnJvbSByZXZpc2lvbiAlI3ggdG8gJSN4XG4iLAogICAg
ICAgICAgICBjcHUsIG9sZF9yZXYsIHJldik7CiAKKyAgICBhbWRfY2hlY2tf
emVuYmxlZWQoKTsKKwogICAgIHJldHVybiAwOwogfQogCmRpZmYgLS1naXQg
YS94ZW4vaW5jbHVkZS9hc20teDg2L3Byb2Nlc3Nvci5oIGIveGVuL2luY2x1
ZGUvYXNtLXg4Ni9wcm9jZXNzb3IuaAppbmRleCAzZmY3Y2M1ODA3ZTcuLjcx
YjQ1NGQ5ODRhYyAxMDA2NDQKLS0tIGEveGVuL2luY2x1ZGUvYXNtLXg4Ni9w
cm9jZXNzb3IuaAorKysgYi94ZW4vaW5jbHVkZS9hc20teDg2L3Byb2Nlc3Nv
ci5oCkBAIC02MzUsNiArNjM1LDggQEAgdm9pZCB0c3hfaW5pdCh2b2lkKTsK
IHZvaWQgdXBkYXRlX21jdV9vcHRfY3RybCh2b2lkKTsKIHZvaWQgc2V0X2lu
X21jdV9vcHRfY3RybCh1aW50MzJfdCBtYXNrLCB1aW50MzJfdCB2YWwpOwog
Cit2b2lkIGFtZF9jaGVja196ZW5ibGVlZCh2b2lkKTsKKwogI2VuZGlmIC8q
ICFfX0FTU0VNQkxZX18gKi8KIAogI2VuZGlmIC8qIF9fQVNNX1g4Nl9QUk9D
RVNTT1JfSCAqLwoK

--=separator
Content-Type: application/octet-stream; name="xsa433-4.15.patch"
Content-Disposition: attachment; filename="xsa433-4.15.patch"
Content-Transfer-Encoding: base64

RnJvbTogQW5kcmV3IENvb3BlciA8YW5kcmV3LmNvb3BlcjNAY2l0cml4LmNv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di
NWJhNDFhNDBhMCAxMDA2NDQKLS0tIGEveGVuL2luY2x1ZGUvYXNtLXg4Ni9w
cm9jZXNzb3IuaAorKysgYi94ZW4vaW5jbHVkZS9hc20teDg2L3Byb2Nlc3Nv
ci5oCkBAIC02NDEsNiArNjQxLDggQEAgZW51bSBhcF9ib290X21ldGhvZCB7
CiB9OwogZXh0ZXJuIGVudW0gYXBfYm9vdF9tZXRob2QgYXBfYm9vdF9tZXRo
b2Q7CiAKK3ZvaWQgYW1kX2NoZWNrX3plbmJsZWVkKHZvaWQpOworCiAjZW5k
aWYgLyogIV9fQVNTRU1CTFlfXyAqLwogCiAjZW5kaWYgLyogX19BU01fWDg2
X1BST0NFU1NPUl9IICovCgo=

--=separator
Content-Type: application/octet-stream; name="xsa433-4.16.patch"
Content-Disposition: attachment; filename="xsa433-4.16.patch"
Content-Transfer-Encoding: base64

RnJvbTogQW5kcmV3IENvb3BlciA8YW5kcmV3LmNvb3BlcjNAY2l0cml4LmNv
bT4KU3ViamVjdDogeDg2L2FtZDogTWl0aWdhdGlvbnMgZm9yIFplbmJsZWVk
CgpaZW5ibGVlZCBpcyBhIG1hbGZ1bmN0aW9uIG9uIEFNRCBaZW4yIHVhcmNo
IHBhcnRzIHdoaWNoIHJlc3VsdHMgaW4gY29ycnVwdGlvbgpvZiB0aGUgdmVj
dG9yIHJlZ2lzdGVycy4gIEFuIGF0dGFja2VyIGNhbiB0cmlnZ2VyIHRoaXMg
YnVnIGRlbGliZXJhdGVseSBpbgpvcmRlciB0byBhY2Nlc3Mgc3RhbGUgZGF0
YSBpbiB0aGUgcGh5c2ljYWwgdmVjdG9yIHJlZ2lzdGVyIGZpbGUuICBUaGlz
IGNhbgppbmNsdWRlIGRhdGEgZnJvbSBzaWJsaW5nIHRocmVhZHMsIG9yIGEg
aGlnaGVyLXByaXZpbGVnZSBjb250ZXh0LgoKTWljcm9jb2RlIGlzIHRoZSBw
cmVmZXJyZWQgbWl0aWdhdGlvbiBidXQgaW4gdGh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Y3JvY29kZS9hbWQuYwpAQCAtMjYyLDYgKzI2Miw4IEBAIHN0YXRpYyBp
bnQgYXBwbHlfbWljcm9jb2RlKGNvbnN0IHN0cnVjdCBtaWNyb2NvZGVfcGF0
Y2ggKnBhdGNoKQogICAgICAgICAgICAibWljcm9jb2RlOiBDUFUldSB1cGRh
dGVkIGZyb20gcmV2aXNpb24gJSN4IHRvICUjeCwgZGF0ZSA9ICUwNHgtJTAy
eC0lMDJ4XG4iLAogICAgICAgICAgICBjcHUsIG9sZF9yZXYsIHJldiwgcGF0
Y2gtPnllYXIsIHBhdGNoLT5tb250aCwgcGF0Y2gtPmRheSk7CiAKKyAgICBh
bWRfY2hlY2tfemVuYmxlZWQoKTsKKwogICAgIHJldHVybiAwOwogfQogCmRp
ZmYgLS1naXQgYS94ZW4vaW5jbHVkZS9hc20teDg2L3Byb2Nlc3Nvci5oIGIv
eGVuL2luY2x1ZGUvYXNtLXg4Ni9wcm9jZXNzb3IuaAppbmRleCAzZDhhYWNk
M2FhYjIuLjk2NjIxZWMzOWY4YiAxMDA2NDQKLS0tIGEveGVuL2luY2x1ZGUv
YXNtLXg4Ni9wcm9jZXNzb3IuaAorKysgYi94ZW4vaW5jbHVkZS9hc20teDg2
L3Byb2Nlc3Nvci5oCkBAIC02MzksNiArNjM5LDggQEAgZW51bSBhcF9ib290
X21ldGhvZCB7CiB9OwogZXh0ZXJuIGVudW0gYXBfYm9vdF9tZXRob2QgYXBf
Ym9vdF9tZXRob2Q7CiAKK3ZvaWQgYW1kX2NoZWNrX3plbmJsZWVkKHZvaWQp
OworCiAjZW5kaWYgLyogIV9fQVNTRU1CTFlfXyAqLwogCiAjZW5kaWYgLyog
X19BU01fWDg2X1BST0NFU1NPUl9IICovCgo=

--=separator
Content-Type: application/octet-stream; name="xsa433-4.17.patch"
Content-Disposition: attachment; filename="xsa433-4.17.patch"
Content-Transfer-Encoding: base64

RnJvbTogQW5kcmV3IENvb3BlciA8YW5kcmV3LmNvb3BlcjNAY2l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mggYi94ZW4vYXJjaC94ODYv
aW5jbHVkZS9hc20vcHJvY2Vzc29yLmgKaW5kZXggOGUyODE2ZmFlOWI5Li42
NjYxMWRmNmVmYzEgMTAwNjQ0Ci0tLSBhL3hlbi9hcmNoL3g4Ni9pbmNsdWRl
L2FzbS9wcm9jZXNzb3IuaAorKysgYi94ZW4vYXJjaC94ODYvaW5jbHVkZS9h
c20vcHJvY2Vzc29yLmgKQEAgLTYzNyw2ICs2MzcsOCBAQCBlbnVtIGFwX2Jv
b3RfbWV0aG9kIHsKIH07CiBleHRlcm4gZW51bSBhcF9ib290X21ldGhvZCBh
cF9ib290X21ldGhvZDsKIAordm9pZCBhbWRfY2hlY2tfemVuYmxlZWQodm9p
ZCk7CisKICNlbmRpZiAvKiAhX19BU1NFTUJMWV9fICovCiAKICNlbmRpZiAv
KiBfX0FTTV9YODZfUFJPQ0VTU09SX0ggKi8KCg==

--=separator--


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 16:15:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 16:15:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569133.889407 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNyDB-0003Pp-UC; Mon, 24 Jul 2023 16:15:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569133.889407; Mon, 24 Jul 2023 16:15:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNyDB-0003Pi-RM; Mon, 24 Jul 2023 16:15:05 +0000
Received: by outflank-mailman (input) for mailman id 569133;
 Mon, 24 Jul 2023 16:15:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=vJ35=DK=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qNyDA-0003Pc-DY
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 16:15:04 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20609.outbound.protection.outlook.com
 [2a01:111:f400:7d00::609])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3e6c9386-2a3d-11ee-b23b-6b7b168915f2;
 Mon, 24 Jul 2023 18:15:02 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB8467.eurprd04.prod.outlook.com (2603:10a6:20b:34a::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.31; Mon, 24 Jul
 2023 16:15:00 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023
 16:15:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3e6c9386-2a3d-11ee-b23b-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Nj0+PU7JiMpJCIvH1GDmjXz7x8aZOaO0Mhx+Y9S2FGCe/zS6i3B+JkUWmGhxUzoGvBHOdgffkeVfEx0lcW/BppCmsJXMTm63vWm/7WfpfsXKqQzxtf92hRcnMpLXzG4+6lr55zoF1QeZ1RS71DBSK8sOBKnt6dyThgZQdZQ7ZWymiKgT8AKi6KG36d38PzyVox5lqZfnQL4KBXdUBn8q/k3sdwwZac6wIER9M6356kOaIB9QNL8A1hcEiepajCAzEdB4gnPW5DXsT+H+epISJR0AaG84u1Gmh5Z1szDtnVkfpoRQXzDeel0FpdaWCum1k7sYUXNK9IGm/eQwIfyZ0g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LaaEnlkpUVwgi3NGcFwJPwKkPKyvm+Dghfw08tkBYYk=;
 b=Sk6SiYmi6UC7Hud9561N9de+engVoG0FVOe2aW5ArRox2pc/nnc0bjTOaR/7gPDleRheIiAOWujP7TJQArgXNp4cBW/QsQ5P8bkpA9fHQs6dyLe/1x+aHUEoJhMvhiJb5Ii9g8keNCpDaO0QH7S0kefpt5/vDLACMdJ/InpDBd+kXfolEmBs76y581N+3OCiCjHrkYW7xxsI91otJAy/Yg9s3WsI5ZtJs9Im5+sGhiaY4dfFa4xBP+Ex0oh38SlPKHbE07txiVk2tJoYmjAD0crg6cEq1i5x71f8ScYEiovebS5v+aKrDTf6mGSLeCmaI9qPFd/v0UT1DnFm7qwFBA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LaaEnlkpUVwgi3NGcFwJPwKkPKyvm+Dghfw08tkBYYk=;
 b=ZbUFbVGVvhnBOTm5HCoseGgA7qWCVQ6uUZsoIc0jV+wtUZxHdbgV3DJ3sa0YT+XPf0RiyeQ/3R85YsXkdp9c8CPczZHk599q8KpVLu0/Y5tQjau2K5dvu5RGuT+JUQhrVFVtD8xTCkIpHEaFvzqfZnOftJ94rou45IVnt79FCTK1sIJlsVqlt6RZ37rLaoZYQaTvHTXfxkiJPh92BdL9GYYTP1W+xg9dqva+i5K/oIu0W29y5Hq9vzWZeU22jvUY1lKqxGAQ7nn7rPWX3XhuGMLkY/VfNknRin/J21fGyxv11OJzCVbMqF59qd7RBvKZYMAIlDuPbD2MUDFrLuJSxQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <7636d3d2-c78d-711a-ed90-aedd1b464c6c@suse.com>
Date: Mon, 24 Jul 2023 18:14:58 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v6 06/15] cpufreq: Add Hardware P-State (HWP) driver
Content-Language: en-US
To: Jason Andryuk <jandryuk@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20230724125857.11133-1-jandryuk@gmail.com>
 <20230724125857.11133-7-jandryuk@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230724125857.11133-7-jandryuk@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0099.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9c::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB8467:EE_
X-MS-Office365-Filtering-Correlation-Id: 85fd98d2-32ee-40ce-323b-08db8c612160
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	A1qRiFtGJpQ/fQuqcwKOZdERWCIBZX1iBiY/jNxV0HQriC8zXVS22XDCfcElDFtXZlgAhBwlrg9eX5mSg60Y783TB7BSKU+l3yjHfopcQC5N6fLCGo0UCWYnQzZj21HnGdX7ZoVGJMqxMkMIUdughsjXNYChGhy9NzE6wPbSck1MpdEcabN94wVUGOR+bTINnakOob6Z1OBZ+KbH+LsDEY3Fko0OZcqUDKUVYbgYzmgs7TDwV6UQH3YbJFGbHJL2c+Yn4OPIkPEeBvRSBvUcWYjZLl20YenmGO2czfN311JsNVQpC2vl0pZ3o40wPItI9USTc2oaYodJ7BTo1nOZYWZb2KqwhsBLA4zjv9qqDNkZgB6TaY2DFKHAiVBeOE8sD/MHFrb0jaYEhkY3oKdP31nI9YvVnLtozH9/E5KdrawzphAJNFEnjypc2cnIopn2K4gEb+ws1MZd3gyyz03/aZET0yKFstlhDhuKa8d8XkGe1EQsTM9Kzj5jNvJw/HihjRaXWlHdJDan6tSTSzy0tLNpBbeJuyFgI27aoob6NP6buM0LLl23S5YzxCuo3KDMXUZPPLraAZnGFd1vFeys2mi5BzRLonURRiuR2NLKUTEJ18x3S+Olvy/5nBZwmBsGiZNy9As7HLBaOhFx9JaCsg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(396003)(376002)(39860400002)(136003)(366004)(451199021)(38100700002)(6916009)(36756003)(53546011)(2616005)(83380400001)(8676002)(8936002)(5660300002)(478600001)(54906003)(316002)(66556008)(66476007)(4326008)(66946007)(41300700001)(6486002)(26005)(186003)(6506007)(6512007)(2906002)(31686004)(31696002)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SEpKOU51SThLa0k0N1JiRktwV3Vaa3NQTkYzRTEzMVV4Y2xlcTRDMGZQRGw2?=
 =?utf-8?B?aTlWMy9uZFNuL1pvdXJmUGZtYVRHRDFBUlhiYmxmZlpROEJ6T2lDQnd1czNL?=
 =?utf-8?B?R0IrYVJROW1rSzBGMnB1bTRoWll2eDRtaU5jOGxlT0RtbmFiUm9ZWERicm9H?=
 =?utf-8?B?dW9RV00zUmVYblA3ekRjUHBaZEt5TGdzYWliT01Gb080M1Nkb3ErWjhCNjU3?=
 =?utf-8?B?RmdnYTRPZ1NtWUNkT0tvU1NXY1hveVhMR2gvaEFFUVl1WnMvWjFBY1RMVWFm?=
 =?utf-8?B?VC8xZk84UU0wTkgxdkRSM2EwWUlvWDBBNXNBdXE3U0xVTWV6MWRQK0lqenor?=
 =?utf-8?B?T0YyRDdtUmt1VWJWaTNXVmt3RWlHTmozbkY1QlYzdDlKZnpWZ2lYTDZoZGVn?=
 =?utf-8?B?Tjl6Z1hQTThlQjF6YThiU0VoNkxucHBXQVVSTU55U3pMdU1hblFKTXI1Sk5U?=
 =?utf-8?B?OHpQMnEwUHl0d2FSODgvMlNRS2pFRXBtZG1FSEY0dzJjZmZpall6cngvdE1R?=
 =?utf-8?B?VEpDbUdjRzRSUVk4d0cwMXMvSVB6RnJDUktEZGpnbXQ4UytMdWF2WXFvbXdC?=
 =?utf-8?B?Y0dsWjRQUmdZdkpIYzVZYi9G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0TG45Um9ObmtBMXNR?=
 =?utf-8?B?MWMvekM2WHRCNnp3dGNtZnRMZzV5UzA0R213NW9YaTQrWFN4ZThOQkN4c0NH?=
 =?utf-8?B?cGdReFVKaWZlRHJLb1gxSldiWlBPUytsSko4VlhyRk1Td2FuK1lKeEplR0kx?=
 =?utf-8?B?MEUrbnRHTE9QVDVqNUhVeU92dG10R0toalYvOGxlZ0xmSisrc2NpdmZwbTkw?=
 =?utf-8?B?RE9QanVtaWQzTG83ekMzaG12bFFoVmJUSUJIME9TMjc0S2J6aDZjZnZzNVJ5?=
 =?utf-8?B?ZUNTUXZFNnEwdDlJUEpDWFovSy9CbC9WY08vbVI2eFNKZVVHdVdWUlU2NC91?=
 =?utf-8?B?TE1NOHZxdmljWEZSdGwxNmo4Wlh5V1lFdi9ncWJxUEJtQlVrVmZvdWhjQngr?=
 =?utf-8?B?NFhkRHFIdS9LR3Y1eXJTSGlTRWVCWWJrOUk1bUpreGxZQ3loTFNwZ3BZbVdt?=
 =?utf-8?B?bk1jbUU3OWRPK2xKWERsU0Y2VWQ4ME9sYUs0SXBQV1ZXRzZVaWlLVnRRUXQ5?=
 =?utf-8?B?RnlhTFFjQVlMOHNaVjVNNnN2S2ZFY0JUZnVLNTNYaUxhRTI2eTJZcm45dTU3?=
 =?utf-8?B?c1RBKzMxWGxmUkU1YklOY2Y4UmxVaERxREU1aWFFMlRQcXFSUXRKdVpQTlpn?=
 =?utf-8?Q?WDLIF7RtvoheZXTBDK1yIetR6?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 85fd98d2-32ee-40ce-323b-08db8c612160
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 16:15:00.4148
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: +TikQOtsBJkDCBEANNvBpjye4abxm+OalP5WNgOCF3XrOKSQcg3NjF9pj6PYLmErKCoygYlysvRulaAw6tiMXQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8467

On 24.07.2023 14:58, Jason Andryuk wrote:
> --- /dev/null
> +++ b/xen/arch/x86/acpi/cpufreq/hwp.c
> @@ -0,0 +1,521 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * hwp.c cpufreq driver to run Intel Hardware P-States (HWP)
> + *
> + * Copyright (C) 2021 Jason Andryuk <jandryuk@gmail.com>
> + */
> +
> +#include <xen/cpumask.h>
> +#include <xen/init.h>
> +#include <xen/param.h>
> +#include <xen/xmalloc.h>
> +#include <asm/msr.h>
> +#include <acpi/cpufreq/cpufreq.h>
> +
> +static bool __ro_after_init feature_hwp_notification;
> +static bool __ro_after_init feature_hwp_activity_window;
> +
> +static bool __ro_after_init feature_hdc;
> +
> +static bool __ro_after_init opt_cpufreq_hdc = true;
> +
> +union hwp_request
> +{
> +    struct
> +    {
> +        unsigned int min_perf:8;
> +        unsigned int max_perf:8;
> +        unsigned int desired:8;
> +        unsigned int energy_perf:8;
> +        unsigned int activity_window:10;
> +        bool package_control:1;
> +        unsigned int :16;
> +        bool activity_window_valid:1;
> +        bool energy_perf_valid:1;
> +        bool desired_valid:1;
> +        bool max_perf_valid:1;
> +        bool min_perf_valid:1;
> +    };
> +    uint64_t raw;
> +};
> +
> +struct hwp_drv_data
> +{
> +    union
> +    {
> +        uint64_t hwp_caps;
> +        struct
> +        {
> +            unsigned int highest:8;
> +            unsigned int guaranteed:8;
> +            unsigned int most_efficient:8;
> +            unsigned int lowest:8;
> +            unsigned int :32;
> +        } hw;
> +    };
> +    union hwp_request curr_req;
> +    int ret;
> +    uint16_t activity_window;
> +    uint8_t minimum;
> +    uint8_t maximum;
> +    uint8_t desired;
> +    uint8_t energy_perf;
> +};
> +static DEFINE_PER_CPU_READ_MOSTLY(struct hwp_drv_data *, hwp_drv_data);
> +
> +#define hwp_err(cpu, fmt, ...) \
> +    printk(XENLOG_ERR "HWP: CPU%u error: " fmt, cpu, ##__VA_ARGS__)
> +#define hwp_info(fmt, ...)    printk(XENLOG_INFO "HWP: " fmt, ##__VA_ARGS__)

I'm not convinced ", ##__VA_ARGS__" is a good construct to use. I notice
we have a few instances (mainly in code inherited from elsewhere), but I
think it ought to either be plain C99 style (without the ##) or purely
the gcc extension form (not using __VA_ARGS__).

> +#define hwp_verbose(fmt, ...)                             \
> +({                                                        \
> +    if ( cpufreq_verbose )                                \
> +        printk(XENLOG_DEBUG "HWP: " fmt, ##__VA_ARGS__);  \

(One more here then.)

> +static bool hwp_handle_option(const char *s, const char *end)

__init?

> +static void hwp_get_cpu_speeds(struct cpufreq_policy *policy)
> +{
> +    uint32_t base_khz, max_khz, bus_khz, edx;
> +
> +    cpuid(0x16, &base_khz, &max_khz, &bus_khz, &edx);
> +
> +    policy->cpuinfo.perf_freq = base_khz * 1000;
> +    policy->cpuinfo.min_freq = base_khz * 1000;
> +    policy->cpuinfo.max_freq = max_khz * 1000;
> +    policy->min = base_khz * 1000;
> +    policy->max = max_khz * 1000;

Earlier on I asked what about cases where the CPUID output yields
some zero values (as I know can happen). Iirc you said this doesn't
affect functionality, but wouldn't it make sense to have a comment
to this effect here (proving the cases were thought through).

> +static void cf_check hwp_init_msrs(void *info)
> +{
> +    struct cpufreq_policy *policy = info;
> +    struct hwp_drv_data *data = this_cpu(hwp_drv_data);
> +    uint64_t val;
> +
> +    /*
> +     * Package level MSR, but we don't have a good idea of packages here, so
> +     * just do it everytime.
> +     */
> +    if ( rdmsr_safe(MSR_PM_ENABLE, val) )
> +    {
> +        hwp_err(policy->cpu, "rdmsr_safe(MSR_PM_ENABLE)\n");
> +        data->curr_req.raw = -1;
> +        return;
> +    }
> +
> +    /* Ensure we don't generate interrupts */
> +    if ( feature_hwp_notification )
> +        wrmsr_safe(MSR_HWP_INTERRUPT, 0);
> +
> +    if ( !(val & PM_ENABLE_HWP_ENABLE) )
> +    {
> +        val |= PM_ENABLE_HWP_ENABLE;
> +        if ( wrmsr_safe(MSR_PM_ENABLE, val) )
> +        {
> +            hwp_err(policy->cpu, "wrmsr_safe(MSR_PM_ENABLE, %lx)\n", val);
> +            data->curr_req.raw = -1;
> +            return;
> +        }
> +    }
> +
> +    if ( rdmsr_safe(MSR_HWP_CAPABILITIES, data->hwp_caps) )
> +    {
> +        hwp_err(policy->cpu, "rdmsr_safe(MSR_HWP_CAPABILITIES)\n");
> +        goto error;
> +    }
> +
> +    if ( rdmsr_safe(MSR_HWP_REQUEST, data->curr_req.raw) )
> +    {
> +        hwp_err(policy->cpu, "rdmsr_safe(MSR_HWP_REQUEST)\n");
> +        goto error;
> +    }
> +
> +    /*
> +     * Check for APERF/MPERF support in hardware
> +     * also check for boost/turbo support
> +     */
> +    intel_feature_detect(policy);

Nit: The comment could do with adding at least a comma or semicolon.

> +    if ( feature_hdc &&
> +         (!hdc_set_pkg_hdc_ctl(policy->cpu, opt_cpufreq_hdc) ||
> +          !hdc_set_pm_ctl1(policy->cpu, opt_cpufreq_hdc)) )
> +    {
> +            hwp_err(policy->cpu, "Disabling HDC support\n");
> +            feature_hdc = false;

Nit: Too deep indentation.

> +static int cf_check hwp_cpufreq_cpu_init(struct cpufreq_policy *policy)
> +{
> +    static union hwp_request initial_req;
> +    unsigned int cpu = policy->cpu;
> +    struct hwp_drv_data *data;
> +    bool first_run = false;
> +
> +    data = xzalloc(struct hwp_drv_data);
> +    if ( !data )
> +        return -ENOMEM;
> +
> +    policy->governor = &cpufreq_gov_hwp;
> +
> +    per_cpu(hwp_drv_data, cpu) = data;
> +
> +    on_selected_cpus(cpumask_of(cpu), hwp_init_msrs, policy, 1);
> +
> +    if ( data->curr_req.raw == -1 )
> +    {
> +        hwp_err(cpu, "Could not initialize HWP properly\n");
> +        per_cpu(hwp_drv_data, cpu) = NULL;
> +        xfree(data);
> +        return -ENODEV;
> +    }
> +
> +    data->minimum = data->curr_req.min_perf;
> +    data->maximum = data->curr_req.max_perf;
> +    data->desired = data->curr_req.desired;
> +    data->energy_perf = data->curr_req.energy_perf;
> +    data->activity_window = data->curr_req.activity_window;
> +
> +    if ( initial_req.raw == 0 )
> +    {
> +        hwp_verbose("CPU%u: HWP_CAPABILITIES: %016lx\n", cpu, data->hwp_caps);
> +        initial_req = data->curr_req;
> +        first_run = true;
> +    }

What part of data->curr_req is guaranteed to be non-0 (for the condition
around ...

> +    if ( first_run || data->curr_req.raw != initial_req.raw )
> +        hwp_verbose("CPU%u: rdmsr HWP_REQUEST %016lx\n", cpu,
> +                    data->curr_req.raw);

... this logging to be effective)?

> +static void cf_check hwp_set_misc_turbo(void *info)
> +{
> +    const struct cpufreq_policy *policy = info;
> +    struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
> +    uint64_t msr;
> +
> +    data->ret = 0;
> +
> +    if ( rdmsr_safe(MSR_IA32_MISC_ENABLE, msr) )
> +    {
> +        hwp_verbose("CPU%u: error rdmsr_safe(MSR_IA32_MISC_ENABLE)\n",
> +                    policy->cpu);
> +        data->ret = -EINVAL;
> +
> +        return;
> +    }
> +
> +    if ( policy->turbo == CPUFREQ_TURBO_ENABLED )
> +        msr &= ~MSR_IA32_MISC_ENABLE_TURBO_DISENGAGE;
> +    else
> +        msr |= MSR_IA32_MISC_ENABLE_TURBO_DISENGAGE;
> +
> +    if ( wrmsr_safe(MSR_IA32_MISC_ENABLE, msr) )
> +    {
> +        hwp_verbose("CPU%u: error wrmsr_safe(MSR_IA32_MISC_ENABLE): %016lx\n",
> +                    policy->cpu, msr);
> +        data->ret = -EINVAL;
> +    }
> +}

Neither of the two -EINVAL really indicate an invalid argument that was
passed. Maybe EACCES (or less desirably EFAULT)?

> @@ -89,15 +96,45 @@ static int __init cf_check setup_cpufreq_option(const char *str)
>          return 0;
>      }
>  
> -    if ( choice > 0 || !cmdline_strcmp(str, "xen") )
> +    do
>      {
> -        xen_processor_pmbits |= XEN_PROCESSOR_PM_PX;
> -        cpufreq_controller = FREQCTL_xen;
> -        if ( *arg && *(arg + 1) )
> -            return cpufreq_cmdline_parse(arg + 1);
> -    }
> +        const char *end = strchr(str, ';');
> +
> +        if ( end == NULL )
> +            end = strchr(str, '\0');
> +
> +        arg = strpbrk(str, ",:");
> +        if ( !arg || arg > end )
> +            arg = strchr(str, '\0');
> +
> +        if ( cpufreq_xen_cnt == ARRAY_SIZE(cpufreq_xen_opts) )
> +            return -E2BIG;
> +
> +        if ( choice > 0 || !cmdline_strcmp(str, "xen") )
> +        {
> +            xen_processor_pmbits |= XEN_PROCESSOR_PM_PX;
> +            cpufreq_controller = FREQCTL_xen;
> +            cpufreq_xen_opts[cpufreq_xen_cnt++] = CPUFREQ_xen;
> +            ret = 0;
> +            if ( arg[0] && arg[1] )
> +                ret = cpufreq_cmdline_parse(arg + 1, end);
> +        }
> +        else if ( choice < 0 && !cmdline_strcmp(str, "hwp") )
> +        {
> +            xen_processor_pmbits |= XEN_PROCESSOR_PM_PX;
> +            cpufreq_controller = FREQCTL_xen;
> +            cpufreq_xen_opts[cpufreq_xen_cnt++] = CPUFREQ_hwp;
> +            ret = 0;
> +            if ( arg[0] && arg[1] )
> +                ret = hwp_cmdline_parse(arg + 1, end);
> +        }
> +        else
> +            ret = -EINVAL;
> +
> +        str = end ? ++end : end;
> +    } while ( choice < 0 && ret == 0 && *str );

According to the earlier of the two lines, str may be NULL and hence
cannot be dereferenced without first checking to be non-NULL. Earlier
in the loop though you ensure end cannot be NULL. In that case,
however, you point end at the nul character, so the increment above
would point end at the next following one. So my guess is that you
meant

        str = *end ? ++end : end;

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 16:21:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 16:21:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569141.889417 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNyJL-0004sK-Kd; Mon, 24 Jul 2023 16:21:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569141.889417; Mon, 24 Jul 2023 16:21:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNyJL-0004sD-GN; Mon, 24 Jul 2023 16:21:27 +0000
Received: by outflank-mailman (input) for mailman id 569141;
 Mon, 24 Jul 2023 16:21:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=AOzI=DK=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qNyJK-0004s7-55
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 16:21:26 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 22174553-2a3e-11ee-b23b-6b7b168915f2;
 Mon, 24 Jul 2023 18:21:24 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.162.132.135])
 by support.bugseng.com (Postfix) with ESMTPSA id 669AB4EE073E;
 Mon, 24 Jul 2023 18:21:22 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 22174553-2a3e-11ee-b23b-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH] docs/misra: document the usage of array range initializers
Date: Mon, 24 Jul 2023 18:19:19 +0200
Message-Id: <5dc1aa0a5cd2ee3410047956f8e69c32c4b227ca.1690215341.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The usage of a documented GNU extension that allows a range of elements
in an array to be initalized to the same value using a designated
initalizer is added to this document, to fully comply with
MISRA C:2012 Rule 1.1.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 docs/misra/C-language-toolchain.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/docs/misra/C-language-toolchain.rst b/docs/misra/C-language-toolchain.rst
index 8651f59118..785aed1eaf 100644
--- a/docs/misra/C-language-toolchain.rst
+++ b/docs/misra/C-language-toolchain.rst
@@ -196,6 +196,10 @@ The table columns are as follows:
      - X86_64
      - See Section "6.9 128-bit Integers" of GCC_MANUAL.
 
+   * - Designated initializer for a range of elements
+     - ARM64, X86_64
+     - See Section "6.29 Designated Initializers" of GCC_MANUAL
+
 
 Translation Limits
 __________________
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 16:39:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 16:39:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569156.889427 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNyam-0006W9-Pn; Mon, 24 Jul 2023 16:39:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569156.889427; Mon, 24 Jul 2023 16:39:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNyam-0006W2-MJ; Mon, 24 Jul 2023 16:39:28 +0000
Received: by outflank-mailman (input) for mailman id 569156;
 Mon, 24 Jul 2023 16:39:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNyal-0006Vs-LA; Mon, 24 Jul 2023 16:39:27 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNyal-0006NZ-Ik; Mon, 24 Jul 2023 16:39:27 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qNyak-0002cs-Ej; Mon, 24 Jul 2023 16:39:26 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qNyak-0007oi-EA; Mon, 24 Jul 2023 16:39:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=6MXRL5qJn3ruIdLSI9Sfho4M8R6kbF216OPvjL4BigI=; b=PSRTD+uZDVTg5GXeuBiPcxIauS
	ZR+SmRxfGV6KzIU/a4i6vaT+Vv7x4Z37b1ERBc83KZyBNVk3ki7hMcsgsXn+82AhKBd96U9f4yLau
	yD6zPd0gW3iLVAPCttBDxh+9vB4zArLOV509ccqZtijl9nIMFFz1R4pEankPYdoHAEgQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181991-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181991: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=3a4e6f67bc689365680cd544d05c8772f56b7a91
X-Osstest-Versions-That:
    xen=0c53c638e16278078371ce028c74693841d7738a
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 24 Jul 2023 16:39:26 +0000

flight 181991 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181991/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  3a4e6f67bc689365680cd544d05c8772f56b7a91
baseline version:
 xen                  0c53c638e16278078371ce028c74693841d7738a

Last test of basis   181956  2023-07-21 11:02:28 Z    3 days
Testing same since   181991  2023-07-24 13:02:07 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Federico Serafini <federico.serafini@bugseng.com>
  George Dunlap <george.dunlap@cloud.com>
  Jan Beulich <jbeulich@suse.com>
  Shawn Anastasio <sanastasio@raptorengineering.com>
  Viresh Kumar <viresh.kumar@linaro.org>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   0c53c638e1..3a4e6f67bc  3a4e6f67bc689365680cd544d05c8772f56b7a91 -> smoke


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 16:52:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 16:52:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569163.889467 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNync-0001CH-PI; Mon, 24 Jul 2023 16:52:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569163.889467; Mon, 24 Jul 2023 16:52:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNync-0001C6-Lr; Mon, 24 Jul 2023 16:52:44 +0000
Received: by outflank-mailman (input) for mailman id 569163;
 Mon, 24 Jul 2023 16:52:42 +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
 <SRS0=+YiG=DK=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qNyna-0000gc-Ty
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 16:52:42 +0000
Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com
 [2a00:1450:4864:20::42d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8077ee23-2a42-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 18:52:40 +0200 (CEST)
Received: by mail-wr1-x42d.google.com with SMTP id
 ffacd0b85a97d-31758eb5db8so1531798f8f.2
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 09:52:40 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net
 (default-46-102-197-194.interdsl.co.uk. [46.102.197.194])
 by smtp.gmail.com with ESMTPSA id
 x13-20020a5d60cd000000b0030ada01ca78sm13480777wrt.10.2023.07.24.09.52.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 09:52:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8077ee23-2a42-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690217560; x=1690822360;
        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=FQrfrX/9YiZ+DtYGqTJdty4w9Ag9CCl3bmUTiKKBqx4=;
        b=NleyQ1Kylc04W1xqGCWqUrYVCY060mcMc97m19FGOqMDCkwr5Lal13M+XnJSv3v+0J
         YyDVLE5OSkdWKJxFrRXhoH+fleYHOO+T+OQRbW5C2YP9Z1uQ4U24Br6/r2U8a1ItW2s3
         Nm3QE8qXMPwwspb2sYXZGc8ayB6FPWVgRECQU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690217560; x=1690822360;
        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=FQrfrX/9YiZ+DtYGqTJdty4w9Ag9CCl3bmUTiKKBqx4=;
        b=aUhgIJ9PhaOD1l/RaBzoeD2XYmxhwAJOb5lGZrCLRtY+xLF2ST2DsswcH946P0rSHU
         It18urNp8CJQXGg72RRbnYLsI6Ee+tTGWeM+zWtHYhqItvZ2fN87/X6RlzQ7dzLzplJB
         djW877Oigd5luDLnhZ+4M5bNtpoz4qkNpKZc5RC8LXB8Ql0b5ccO/VgBjHGNr96fCNdI
         lMTtun229AmlfZfTJoRJZ1DJAd8hEAIEvm7JGHpdF3vIdIzcYKAcvBv00TQk8C/e/vac
         KdxtjY6c+njRDDhTGeAmHy1zIsa8z3RjKxEwr1Bw1GBHDvQQkXbzddBrB+DyumJKzJX6
         KwNw==
X-Gm-Message-State: ABy/qLZ55SeULu+MtsvBx9yRAJAm6v9V8IdWFHnCXwk+F0XiBaI+ub/W
	YlzlmvvXAeG9BXJncNrLt7UDao0ZdT6RiVnWTtY=
X-Google-Smtp-Source: APBJJlFAXSaZiAeePI7MIQoas4MEobXA1tZgPfr4bR2vIkOy4g/E9EDAEk5wNZTEIxctc74TN6fXxQ==
X-Received: by 2002:adf:f5ce:0:b0:314:11f3:ca94 with SMTP id k14-20020adff5ce000000b0031411f3ca94mr8194166wrp.41.1690217560130;
        Mon, 24 Jul 2023 09:52:40 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v6 3/3] x86/microcode: Disable microcode update handler if DIS_MCU_UPDATE is set
Date: Mon, 24 Jul 2023 17:52:35 +0100
Message-Id: <20230724165235.25262-4-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230724165235.25262-1-alejandro.vallejo@cloud.com>
References: <20230724165235.25262-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

If IA32_MSR_MCU_CONTROL exists then it's possible a CPU may be unable to
perform microcode updates. This is controlled through the DIS_MCU_LOAD bit
and is intended for baremetal clouds where the owner may not trust the
tenant to choose the microcode version in use. If we notice that bit being
set then simply disable the "apply_microcode" handler so we can't even try
to perform update (as it's known to be silently dropped).

While at it, remove the Intel family check, as microcode loading is
supported on every Intel64 CPU.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
v6:
  * Amended early exit comment to cover both !can_load and rev=~0 (Jan)
---
 xen/arch/x86/cpu/microcode/core.c     | 20 ++++++++++++++------
 xen/arch/x86/cpu/microcode/intel.c    | 13 +++++++++++++
 xen/arch/x86/cpu/microcode/private.h  |  7 +++++++
 xen/arch/x86/include/asm/cpufeature.h |  1 +
 xen/arch/x86/include/asm/msr-index.h  |  5 +++++
 5 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 44bc0fafa3..ec921f5b77 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -847,17 +847,21 @@ int __init early_microcode_init(unsigned long *module_map,
 {
     const struct cpuinfo_x86 *c = &boot_cpu_data;
     int rc = 0;
+    bool can_load = false;
 
     switch ( c->x86_vendor )
     {
     case X86_VENDOR_AMD:
         if ( c->x86 >= 0x10 )
+        {
             ucode_ops = amd_ucode_ops;
+            can_load = true;
+        }
         break;
 
     case X86_VENDOR_INTEL:
-        if ( c->x86 >= 6 )
-            ucode_ops = intel_ucode_ops;
+        ucode_ops = intel_ucode_ops;
+        can_load = intel_can_load_microcode();
         break;
     }
 
@@ -871,13 +875,17 @@ int __init early_microcode_init(unsigned long *module_map,
 
     /*
      * Some hypervisors deliberately report a microcode revision of -1 to
-     * mean that they will not accept microcode updates. We take the hint
-     * and ignore the microcode interface in that case.
+     * mean that they will not accept microcode updates.
+     *
+     * It's also possible the hardware might have built-in support to disable
+     * updates and someone (e.g: a baremetal cloud provider) disabled them.
+     *
+     * Take the hint in either case and ignore the microcode interface.
      */
-    if ( this_cpu(cpu_sig).rev == ~0 )
+    if ( this_cpu(cpu_sig).rev == ~0 || !can_load )
     {
         printk(XENLOG_INFO "Microcode loading disabled due to: %s",
-                           "HW toggle");
+                           can_load ? "rev = ~0" : "HW toggle");
         ucode_ops.apply_microcode = NULL;
         return -ENODEV;
     }
diff --git a/xen/arch/x86/cpu/microcode/intel.c b/xen/arch/x86/cpu/microcode/intel.c
index 8d4d6574aa..060c529a6e 100644
--- a/xen/arch/x86/cpu/microcode/intel.c
+++ b/xen/arch/x86/cpu/microcode/intel.c
@@ -385,6 +385,19 @@ static struct microcode_patch *cf_check cpu_request_microcode(
     return patch;
 }
 
+bool __init intel_can_load_microcode(void)
+{
+    uint64_t mcu_ctrl;
+
+    if ( !cpu_has_mcu_ctrl )
+        return true;
+
+    rdmsrl(MSR_MCU_CONTROL, mcu_ctrl);
+
+    /* If DIS_MCU_LOAD is set applying microcode updates won't work */
+    return !(mcu_ctrl & MCU_CONTROL_DIS_MCU_LOAD);
+}
+
 const struct microcode_ops __initconst_cf_clobber intel_ucode_ops = {
     .cpu_request_microcode            = cpu_request_microcode,
     .collect_cpu_info                 = collect_cpu_info,
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index 626aeb4d08..d80787205a 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -60,6 +60,13 @@ struct microcode_ops {
         const struct microcode_patch *new, const struct microcode_patch *old);
 };
 
+/**
+ * Checks whether we can perform microcode updates on this Intel system
+ *
+ * @return True iff the microcode update facilities are enabled
+ */
+bool intel_can_load_microcode(void);
+
 extern const struct microcode_ops amd_ucode_ops, intel_ucode_ops;
 
 #endif /* ASM_X86_MICROCODE_PRIVATE_H */
diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h
index 64e1dad225..5422baed27 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -193,6 +193,7 @@ static inline bool boot_cpu_has(unsigned int feat)
 #define cpu_has_if_pschange_mc_no boot_cpu_has(X86_FEATURE_IF_PSCHANGE_MC_NO)
 #define cpu_has_tsx_ctrl        boot_cpu_has(X86_FEATURE_TSX_CTRL)
 #define cpu_has_taa_no          boot_cpu_has(X86_FEATURE_TAA_NO)
+#define cpu_has_mcu_ctrl        boot_cpu_has(X86_FEATURE_MCU_CTRL)
 #define cpu_has_fb_clear        boot_cpu_has(X86_FEATURE_FB_CLEAR)
 #define cpu_has_rrsba           boot_cpu_has(X86_FEATURE_RRSBA)
 
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 2382fc8e11..a5f730e9a6 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -165,6 +165,11 @@
 #define  PASID_PASID_MASK                   0x000fffff
 #define  PASID_VALID                        (_AC(1, ULL) << 31)
 
+#define MSR_MCU_CONTROL                     0x00001406
+#define  MCU_CONTROL_LOCK                   (_AC(1, ULL) <<  0)
+#define  MCU_CONTROL_DIS_MCU_LOAD           (_AC(1, ULL) <<  1)
+#define  MCU_CONTROL_EN_SMM_BYPASS          (_AC(1, ULL) <<  2)
+
 #define MSR_UARCH_MISC_CTRL                 0x00001b01
 #define  UARCH_CTRL_DOITM                   (_AC(1, ULL) <<  0)
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 16:52:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 16:52:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569161.889447 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNyna-0000gv-AN; Mon, 24 Jul 2023 16:52:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569161.889447; Mon, 24 Jul 2023 16:52:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNyna-0000go-6v; Mon, 24 Jul 2023 16:52:42 +0000
Received: by outflank-mailman (input) for mailman id 569161;
 Mon, 24 Jul 2023 16:52:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+YiG=DK=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qNynY-0000Rl-Pq
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 16:52:40 +0000
Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com
 [2a00:1450:4864:20::42f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7f86e7ac-2a42-11ee-b23b-6b7b168915f2;
 Mon, 24 Jul 2023 18:52:39 +0200 (CEST)
Received: by mail-wr1-x42f.google.com with SMTP id
 ffacd0b85a97d-313e742a787so2894374f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 09:52:39 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net
 (default-46-102-197-194.interdsl.co.uk. [46.102.197.194])
 by smtp.gmail.com with ESMTPSA id
 x13-20020a5d60cd000000b0030ada01ca78sm13480777wrt.10.2023.07.24.09.52.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 09:52:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7f86e7ac-2a42-11ee-b23b-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690217558; x=1690822358;
        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=3OqOlHUGbYLsNw2DCYr1XfJ49MHPIApDoD89S57teGo=;
        b=Dj2sUcDZPUR8iEur6y588xckGrd7OERkp/FAE/G+DmWG/xYeCCzVaTm+Mtrmk75PSV
         DLoIf20R8RJpZHRSIzmV4rgN+ozDQYtzYw8P4vxaLGoDLd8kvmuBZVSiQPDiinqBcbo3
         MmBgWQb+4+8dXAvJWk2Mr4oV4VQ/jnvl0Z8h4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690217558; x=1690822358;
        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=3OqOlHUGbYLsNw2DCYr1XfJ49MHPIApDoD89S57teGo=;
        b=ZYb9Piybznlz/nkgObFJ0tBs6lNlKFql/0hMNzU2H+O5GwZAqVwJ6V86+IgMPc8yy2
         7M3HA8hdB0SIOWHXlFYkzA84f7eN8dwhD8+SYoc48ymbQwwCnFaemSFNomF0O7gVZGm+
         civF1uzsHi7k45LMWj0k/vXMud3Mvv5YzQdr5Bd+prMqczaFIc52QJoOd2+n0WXxecJl
         gSshGSOdtGGCaA82zw/D9+2wCKTDkg8HWUcwqw+AWkeZFFkI/lVWVqj6IJmHoTINvIXn
         g+f96U64aZKF3T3+EXY7QwWh7TgrTFqI2BAaqvV56cqxrW+a+UchqE1+2TBJ779zeKZC
         wC5w==
X-Gm-Message-State: ABy/qLYZDUCUnG/yJYhpAFUN/jvRa2YuO2fQbEWmY6lG0ZPck7MVp+sx
	PxSM0Zf7MCoUuwJh/9ZdgLHvcfwzv7yiwY+6ktU=
X-Google-Smtp-Source: APBJJlGRi77c9zNJWYtpeiRgKRE9bFZwYBuQiSPvocOw7EHVHJnt59w7dC/XEonETQwuEP4NkaUP3g==
X-Received: by 2002:adf:e9c7:0:b0:311:360e:ea3a with SMTP id l7-20020adfe9c7000000b00311360eea3amr12406885wrn.34.1690217558475;
        Mon, 24 Jul 2023 09:52:38 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v6 1/3] x86/microcode: Ignore microcode loading interface for revision = -1
Date: Mon, 24 Jul 2023 17:52:33 +0100
Message-Id: <20230724165235.25262-2-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230724165235.25262-1-alejandro.vallejo@cloud.com>
References: <20230724165235.25262-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Some hypervisors report ~0 as the microcode revision to mean "don't issue
microcode updates". Ignore the microcode loading interface in that case.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
v6:
  * Change message content and move severity WARNING -> INFO (Andrew)
      NOTE: It has a convoluted argument to simplify the last patch, that
            uses the same printk()
---
 xen/arch/x86/cpu/microcode/core.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index bec8b55db2..71e3944cf2 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -867,10 +867,23 @@ int __init early_microcode_init(unsigned long *module_map,
         return -ENODEV;
     }
 
-    microcode_grab_module(module_map, mbi);
-
     ucode_ops.collect_cpu_info();
 
+    /*
+     * Some hypervisors deliberately report a microcode revision of -1 to
+     * mean that they will not accept microcode updates. We take the hint
+     * and ignore the microcode interface in that case.
+     */
+    if ( this_cpu(cpu_sig).rev == ~0 )
+    {
+        printk(XENLOG_INFO "Microcode loading disabled due to: %s",
+                           "HW toggle");
+        ucode_ops.apply_microcode = NULL;
+        return -ENODEV;
+    }
+
+    microcode_grab_module(module_map, mbi);
+
     if ( ucode_mod.mod_end || ucode_blob.size )
         rc = early_microcode_update_cpu();
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 16:52:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 16:52:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569160.889436 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNynY-0000S2-VB; Mon, 24 Jul 2023 16:52:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569160.889436; Mon, 24 Jul 2023 16:52:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNynY-0000Rv-S6; Mon, 24 Jul 2023 16:52:40 +0000
Received: by outflank-mailman (input) for mailman id 569160;
 Mon, 24 Jul 2023 16:52:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+YiG=DK=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qNynY-0000Rl-49
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 16:52:40 +0000
Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com
 [2a00:1450:4864:20::32c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7f196bcc-2a42-11ee-b23b-6b7b168915f2;
 Mon, 24 Jul 2023 18:52:38 +0200 (CEST)
Received: by mail-wm1-x32c.google.com with SMTP id
 5b1f17b1804b1-3fbea14706eso36824075e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 09:52:38 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net
 (default-46-102-197-194.interdsl.co.uk. [46.102.197.194])
 by smtp.gmail.com with ESMTPSA id
 x13-20020a5d60cd000000b0030ada01ca78sm13480777wrt.10.2023.07.24.09.52.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 09:52:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7f196bcc-2a42-11ee-b23b-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690217558; x=1690822358;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=CLQCJAr0rC6dxrW2X+lLr/OB58MmuMcxotnvqWKYPbM=;
        b=hd6yzEB/gZB21Qyxh20mdjwpa7KH30OKCCiFHBmnl5rxybh5T4OOif2oxJB0ZArETk
         uPnHEYa7EfRyTyrvGt1C8cEqbfK2IBJi/toqtApUOn24UtVDbWbe0MvOKE+69LmHO531
         sWAGTAzB+m5N9mrIrd2nM/+fVuT1mHJBbKO3o=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690217558; x=1690822358;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=CLQCJAr0rC6dxrW2X+lLr/OB58MmuMcxotnvqWKYPbM=;
        b=JacVqO+iIZS8cFT7mmwOItkpjUUavMwg33hTNhC76G6IYJlENQluW7br4wrr6gbKkv
         FwwGUOuYz47m7hEH8eGTLNlgT96nFfsaSlRyY4v6uEBdebzvc56XL9sXpro7QeMN2LT9
         HJ7JRs1ECgfv7OwfrQuE8w/56srs0rbBiTz4LwB8KAr7t4pSi/rvI0ZVKeZx/Y5AM88f
         483Geq6aGBXNf2vqT5O9WApJ2C+tdOBagsu38+C0cbK7N4mCFgc9ZFPzP+JXPqjYeVyD
         CEuUZ7haR+Gw254K9adc2OwBsZmi1vt2v0RCSlLLvarzrJ/y7hcm4Q9r2k4dYrxzrTmC
         Dz6w==
X-Gm-Message-State: ABy/qLbcx0KSuA1U0zrNVeDFBEi74RQVq6nkP0Mr1rjNgJr4l0/3s+sh
	B34IThNWYo7G6lRfJhf1PO3VjlFoYPll7Pv3Lpg=
X-Google-Smtp-Source: APBJJlGNazamfPa/FbdAUXmKTFl+lBPUVr735yYRADnLHJ6fno/0Ci2++OzWp3cJ8mMvxaxkGOBoww==
X-Received: by 2002:adf:fe12:0:b0:317:54d9:eb48 with SMTP id n18-20020adffe12000000b0031754d9eb48mr4026139wrr.11.1690217557770;
        Mon, 24 Jul 2023 09:52:37 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v6 0/3] Prevent attempting updates known to fail
Date: Mon, 24 Jul 2023 17:52:32 +0100
Message-Id: <20230724165235.25262-1-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Under certain conditions a CPU may not be able to perform microcode updates
even if hardware exists to that effect. In particular:

 * If Xen runs under certain hypervisors they won't allow microcode
   updates, and will signal this fact by reporting a microcode revision of
   -1.
 * If the DIS_MCU_LOAD bit is set, which is expected in some baremetal
   clouds where the owner may not trust the tenant, then the CPU is not
   capable of loading new microcode.

This series adds logic so that in both of these cases we don't needlessly
attempt updates that are not going to succeed. Patch summary:

Patch 1 Ignores microcode facilities when the current microcode revision is -1

Patch 2 Moves the MSR_ARCH_CAPS read in tsx_init() to early_cpu_init() and
        early_microcode_init()

Patch 3 Adds the logic to detect microcode updates being disabled on Intel.

Alejandro Vallejo (3):
  x86/microcode: Ignore microcode loading interface for revision = -1
  x86: Read MSR_ARCH_CAPS immediately after early_microcode_init()
  x86/microcode: Disable microcode update handler if DIS_MCU_UPDATE is
    set

 xen/arch/x86/cpu/common.c             | 20 ++++++++++----
 xen/arch/x86/cpu/microcode/core.c     | 38 ++++++++++++++++++++++++---
 xen/arch/x86/cpu/microcode/intel.c    | 13 +++++++++
 xen/arch/x86/cpu/microcode/private.h  |  7 +++++
 xen/arch/x86/include/asm/cpufeature.h |  1 +
 xen/arch/x86/include/asm/msr-index.h  |  5 ++++
 xen/arch/x86/include/asm/setup.h      |  2 +-
 xen/arch/x86/setup.c                  |  2 +-
 xen/arch/x86/tsx.c                    | 16 +++--------
 9 files changed, 81 insertions(+), 23 deletions(-)

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 16:52:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 16:52:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569162.889457 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNynb-0000wI-In; Mon, 24 Jul 2023 16:52:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569162.889457; Mon, 24 Jul 2023 16:52:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNynb-0000w9-F9; Mon, 24 Jul 2023 16:52:43 +0000
Received: by outflank-mailman (input) for mailman id 569162;
 Mon, 24 Jul 2023 16:52:42 +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
 <SRS0=+YiG=DK=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qNyna-0000gc-8n
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 16:52:42 +0000
Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com
 [2a00:1450:4864:20::42d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8007e9d6-2a42-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 18:52:40 +0200 (CEST)
Received: by mail-wr1-x42d.google.com with SMTP id
 ffacd0b85a97d-3144bf65ce9so3489430f8f.3
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 09:52:40 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net
 (default-46-102-197-194.interdsl.co.uk. [46.102.197.194])
 by smtp.gmail.com with ESMTPSA id
 x13-20020a5d60cd000000b0030ada01ca78sm13480777wrt.10.2023.07.24.09.52.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 09:52:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8007e9d6-2a42-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690217559; x=1690822359;
        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=A572cM8GKUnw4aLvmx7+QkpR9aur5X3rTBja4ErTb1k=;
        b=bz2LZzqDjLeexZgD0bf/vo+LfkQbMWseYbLDirCYM4JJqBf1TsgdbNCcwJPiOsIezm
         FpnGKKLQmOtmvll5VgRThGnwO7gVvepKYLa4RZ3bPCubuWuuiNO7IKzoqEQGgtEY9MZA
         Ho0fWtZHPrfmcUSLJbqZvddgJ6PXx/prtTm/U=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690217559; x=1690822359;
        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=A572cM8GKUnw4aLvmx7+QkpR9aur5X3rTBja4ErTb1k=;
        b=UQAafBiUiifM3eSTHbPsHCnUGql51ojR2QB1TWPlZK09Y+kEjZOC6sLEFjho5dIzuV
         L2RAbFqdHtmp8bIQco6AQ+2AFC8gqGW45vL8SrC1IeBTGaZF1wkieq92JcE3eniht/hJ
         hMsozxmmBjpfOwhV6hzaIYOkKQ0RVGRzDgUbO1zv0ErmmGE1xfj++ITmfOq0Y1yg+kLY
         DDR7nhv/YZ1yv/JDZk6vFt8dWyp6l6rJ8brNCiUNOEA8fANf3oQOLCA6zfcDZokaUxWo
         6EovdLl6/nitKFwfRY/Ev1JhJ+aFpsnAWpMZ3+YtxowPh/n0/RkCTzW8dkWNOAFDgXmG
         FGFg==
X-Gm-Message-State: ABy/qLbNsOpH4GqOk3J4YznHXUuafRsLKkwM9e77+Jwz6plqO8iEWna0
	6mdPiKNQR3CAF2uP9/fH72C9yReoIqzr98GOfqc=
X-Google-Smtp-Source: APBJJlG9eQSXgi17Zj7NZ2nSBfg6QzHxndz9XtpBvomf6xyXB1RwYTh/aNnHH+ur85VfYYuamzrAvA==
X-Received: by 2002:adf:d4c5:0:b0:317:5ddb:a8bf with SMTP id w5-20020adfd4c5000000b003175ddba8bfmr2655699wrk.29.1690217559216;
        Mon, 24 Jul 2023 09:52:39 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v6 2/3] x86: Read MSR_ARCH_CAPS immediately after early_microcode_init()
Date: Mon, 24 Jul 2023 17:52:34 +0100
Message-Id: <20230724165235.25262-3-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230724165235.25262-1-alejandro.vallejo@cloud.com>
References: <20230724165235.25262-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Move MSR_ARCH_CAPS read code from tsx_init() to early_cpu_init(). Because
microcode updates might make them that MSR to appear/have different values
we also must reload it after a microcode update in early_microcode_init().

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
v6:
 * Invert logic of a verbosity-guard to reduce diff (Jan)
 * Reflow last printk in v5/patch3:early_cpu_init() for line length (Jan)
 * Rewrite comment for the early_cpu_init(false) statement (Jan)
---
 xen/arch/x86/cpu/common.c         | 20 +++++++++++++++-----
 xen/arch/x86/cpu/microcode/core.c |  9 +++++++++
 xen/arch/x86/include/asm/setup.h  |  2 +-
 xen/arch/x86/setup.c              |  2 +-
 xen/arch/x86/tsx.c                | 16 ++++------------
 5 files changed, 30 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index cfcdaace12..2b9cc680ac 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -303,7 +303,7 @@ static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
 
    WARNING: this function is only called on the BP.  Don't add code here
    that is supposed to run on all CPUs. */
-void __init early_cpu_init(void)
+void __init early_cpu_init(bool verbose)
 {
 	struct cpuinfo_x86 *c = &boot_cpu_data;
 	u32 eax, ebx, ecx, edx;
@@ -324,6 +324,8 @@ void __init early_cpu_init(void)
 	case X86_VENDOR_SHANGHAI: this_cpu = &shanghai_cpu_dev; break;
 	case X86_VENDOR_HYGON:    this_cpu = &hygon_cpu_dev;    break;
 	default:
+		if (!verbose)
+			break;
 		printk(XENLOG_ERR
 		       "Unrecognised or unsupported CPU vendor '%.12s'\n",
 		       c->x86_vendor_id);
@@ -340,10 +342,13 @@ void __init early_cpu_init(void)
 	c->x86_capability[FEATURESET_1d] = edx;
 	c->x86_capability[FEATURESET_1c] = ecx;
 
-	printk(XENLOG_INFO
-	       "CPU Vendor: %s, Family %u (%#x), Model %u (%#x), Stepping %u (raw %08x)\n",
-	       x86_cpuid_vendor_to_str(c->x86_vendor), c->x86, c->x86,
-	       c->x86_model, c->x86_model, c->x86_mask, eax);
+	if (verbose)
+		printk(XENLOG_INFO
+		       "CPU Vendor: %s, Family %u (%#x), "
+		       "Model %u (%#x), Stepping %u (raw %08x)\n",
+		       x86_cpuid_vendor_to_str(c->x86_vendor), c->x86,
+		       c->x86, c->x86_model, c->x86_model, c->x86_mask,
+		       eax);
 
 	if (c->cpuid_level >= 7) {
 		uint32_t max_subleaf;
@@ -352,6 +357,11 @@ void __init early_cpu_init(void)
 			    &c->x86_capability[FEATURESET_7c0],
 			    &c->x86_capability[FEATURESET_7d0]);
 
+		if (test_bit(X86_FEATURE_ARCH_CAPS, c->x86_capability))
+			rdmsr(MSR_ARCH_CAPABILITIES,
+			      c->x86_capability[FEATURESET_m10Al],
+			      c->x86_capability[FEATURESET_m10Ah]);
+
 		if (max_subleaf >= 1)
 			cpuid_count(7, 1, &eax, &ebx, &ecx,
 				    &c->x86_capability[FEATURESET_7d1]);
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 71e3944cf2..44bc0fafa3 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -887,5 +887,14 @@ int __init early_microcode_init(unsigned long *module_map,
     if ( ucode_mod.mod_end || ucode_blob.size )
         rc = early_microcode_update_cpu();
 
+    /*
+     * Some CPUID leaves and MSRs are only present after microcode updates
+     * on some processors. We take the chance here to make sure what little
+     * state we have already probed is re-probed in order to ensure we do
+     * not use stale values. tsx_init() in particular needs to have up to
+     * date MSR_ARCH_CAPS.
+     */
+    early_cpu_init(false);
+
     return rc;
 }
diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index ae0dd3915a..df59a4cd28 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -15,7 +15,7 @@ extern uint64_t boot_tsc_stamp;
 
 extern void *stack_start;
 
-void early_cpu_init(void);
+void early_cpu_init(bool verbose);
 void early_time_init(void);
 
 void set_nr_cpu_ids(unsigned int max_cpus);
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 74e3915a4d..bdf66e80ac 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1211,7 +1211,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         panic("Bootloader provided no memory information\n");
 
     /* This must come before e820 code because it sets paddr_bits. */
-    early_cpu_init();
+    early_cpu_init(true);
 
     /* Choose shadow stack early, to set infrastructure up appropriately. */
     if ( !boot_cpu_has(X86_FEATURE_CET_SS) )
diff --git a/xen/arch/x86/tsx.c b/xen/arch/x86/tsx.c
index 80c6f4cedd..50d8059f23 100644
--- a/xen/arch/x86/tsx.c
+++ b/xen/arch/x86/tsx.c
@@ -39,9 +39,10 @@ void tsx_init(void)
     static bool __read_mostly once;
 
     /*
-     * This function is first called between microcode being loaded, and CPUID
-     * being scanned generally.  Read into boot_cpu_data.x86_capability[] for
-     * the cpu_has_* bits we care about using here.
+     * This function is first called between microcode being loaded, and
+     * CPUID being scanned generally. early_cpu_init() has already prepared
+     * the feature bits needed here. And early_microcode_init() has ensured
+     * they are not stale after the microcode update.
      */
     if ( unlikely(!once) )
     {
@@ -49,15 +50,6 @@ void tsx_init(void)
 
         once = true;
 
-        if ( boot_cpu_data.cpuid_level >= 7 )
-            boot_cpu_data.x86_capability[FEATURESET_7d0]
-                = cpuid_count_edx(7, 0);
-
-        if ( cpu_has_arch_caps )
-            rdmsr(MSR_ARCH_CAPABILITIES,
-                  boot_cpu_data.x86_capability[FEATURESET_m10Al],
-                  boot_cpu_data.x86_capability[FEATURESET_m10Ah]);
-
         has_rtm_always_abort = cpu_has_rtm_always_abort;
 
         if ( cpu_has_tsx_ctrl && cpu_has_srbds_ctrl )
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 17:16:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 17:16:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569180.889477 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNzA4-0004ga-L2; Mon, 24 Jul 2023 17:15:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569180.889477; Mon, 24 Jul 2023 17:15:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNzA4-0004gT-HH; Mon, 24 Jul 2023 17:15:56 +0000
Received: by outflank-mailman (input) for mailman id 569180;
 Mon, 24 Jul 2023 17:15:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=9g4K=DK=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qNzA3-0004gN-Mc
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 17:15:55 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20616.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::616])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bf363205-2a45-11ee-b23b-6b7b168915f2;
 Mon, 24 Jul 2023 19:15:54 +0200 (CEST)
Received: from DUZPR01CA0232.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4b4::6) by AS8PR08MB6054.eurprd08.prod.outlook.com
 (2603:10a6:20b:291::15) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul
 2023 17:15:49 +0000
Received: from DBAEUR03FT018.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4b4:cafe::c8) by DUZPR01CA0232.outlook.office365.com
 (2603:10a6:10:4b4::6) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32 via Frontend
 Transport; Mon, 24 Jul 2023 17:15:49 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT018.mail.protection.outlook.com (100.127.142.74) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6631.25 via Frontend Transport; Mon, 24 Jul 2023 17:15:49 +0000
Received: ("Tessian outbound e1fdbe8a48d3:v145");
 Mon, 24 Jul 2023 17:15:48 +0000
Received: from 8d3733c8114f.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 6F17816F-B108-431F-8165-685965FC959C.1; 
 Mon, 24 Jul 2023 17:15:37 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8d3733c8114f.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Mon, 24 Jul 2023 17:15:37 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by PAWPR08MB10119.eurprd08.prod.outlook.com (2603:10a6:102:364::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.31; Mon, 24 Jul
 2023 17:15:30 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::4c7d:6a1:e742:3b1a]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::4c7d:6a1:e742:3b1a%4]) with mapi id 15.20.6609.032; Mon, 24 Jul 2023
 17:15:30 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bf363205-2a45-11ee-b23b-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=gWMj0fj3nc1fwJfKbqN1FEPborB7MLbH1vij1Yr698k=;
 b=gmj0AHWW84CG+Ps0JpgTH3fM5Y+BDgJbkQ1VcjtLOLqngVNw8QdlrB/p5/vLSxfkvAYdJNJj//UlSfS3W+vDlGZA8gNrX3KT+1/HkHEvnzCpcOhBy+zrCYL771dAVaeVsZNcyecfZR9Dpn9m/viTOgIL0x0ba0eeCEUpXIIEKmE=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 9b12da302572121c
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=brbwSmU1JZHABirExMDqe0Z51rUXHjH0eQd3uIchd3Nu6fGKYTy5E0gk6MFf7+WaDUnRlvZEh70QEN09IwSes12y0OiWPo+GZE0TpfFKSB8/r4HNX4ANGZOZiYBOhDjLelAYAb+aOLLMUDBex8kGo/wiIGi6j4GoP3OoavE1E7lDWshssNyYJtU/QFOoTx413wkAJ7/glxHSu48i+fxscbLPxiW7RKnhNZpLm6R9761/HbOwLlurkZp74OVQhKpEhPkoQ6aLaJuFwsHR0U9vtnU/beC1CKJN3sqWNZlWOu45FPhCirg/3aIP1Q8hhBKoxkT8w8Hq9kNQOIMOpCZrOw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=gWMj0fj3nc1fwJfKbqN1FEPborB7MLbH1vij1Yr698k=;
 b=ISAPTciBGzmfIhP71/EdO4HASYRFn5OZgKo5qjb6Y8lfrYpDpIsK9K4vreeYTo6HbZ3Ux7YFOs8WJ9vi7objZAAOcclPeE7sWw0dfFWSDl+ggpEwJglo8/V2Njp0lz20PKAq4IojyVKy6QpmtndP8qmv6hb+vGpgJTWjcOr3NkzBKCrcLcE2WwhxLc8YU6HsRXGwoNSlVT7GZ3MAxU2FdPvc+RsyslhVJ1m+8Itq4vaBd4PHUv2QKl0zoHBjg2fK+4azxSHMwRsY8wiiw415SHJZAuzj0CsucptRETfEFFK+KPkU2fAnsUfMt8LPktXWkBHxrZKdSCLdgbAkUV2nIA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=gWMj0fj3nc1fwJfKbqN1FEPborB7MLbH1vij1Yr698k=;
 b=gmj0AHWW84CG+Ps0JpgTH3fM5Y+BDgJbkQ1VcjtLOLqngVNw8QdlrB/p5/vLSxfkvAYdJNJj//UlSfS3W+vDlGZA8gNrX3KT+1/HkHEvnzCpcOhBy+zrCYL771dAVaeVsZNcyecfZR9Dpn9m/viTOgIL0x0ba0eeCEUpXIIEKmE=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Julien Grall <julien@xen.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, "michal.orzel@amd.com"
	<michal.orzel@amd.com>, Henry Wang <Henry.Wang@arm.com>, Julien Grall
	<jgrall@amazon.com>, Stefano Stabellini <sstabellini@kernel.org>, Bertrand
 Marquis <Bertrand.Marquis@arm.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH v2] xen/arm32: head: Widen the use of the temporary
 mapping
Thread-Topic: [PATCH v2] xen/arm32: head: Widen the use of the temporary
 mapping
Thread-Index: AQHZvhfALUYUxcU0dEyDyil7nxQeXq/JKKkA
Date: Mon, 24 Jul 2023 17:15:30 +0000
Message-ID: <AD86AD11-2FFC-4276-B0B4-F0E370F22EBC@arm.com>
References: <20230724101458.79412-1-julien@xen.org>
In-Reply-To: <20230724101458.79412-1-julien@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|PAWPR08MB10119:EE_|DBAEUR03FT018:EE_|AS8PR08MB6054:EE_
X-MS-Office365-Filtering-Correlation-Id: eb783c46-b0c9-403c-e1c5-08db8c69a03b
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 uIkii3BQfr0b/zbI/kplm6B4Ptb3dS6WRIukhHXJEaFzY1kF+gDX03d/uQQw6BTafOMLEZ+r5jXLuzng/kEV2hnRbgahq4VoUa2+MvqqJPES02qODTzucZpqj0itC79gMDQ8kKH/nVNX3emkPdGmwfcLaInJvC2+unR4SmTWSyOpnaURprEYYfh/ZlsyOZKjVr+xNqkwHsM0P3YUIvjTHWGhasro7tmQ6fz6pduB9UInWAdajANatRC10XrxeyLXQjUkhJFfhJxyRZcSeJaMNU/l0OP9k/39+wx0Pv5K94GetfLRBvIGlha3OYJ41mD7kufyS/96tnJuf1eBjO5inKIPcDwPlm6YVR8KLAvjMKtuJdfm+XEKwNHesBxuFByfbufysc1M193eEH/Xraaku8yIWqHkto6iXf7P0YDHabe7dF3fDZpXZXmxVwlaEQCTz4TK7XNoroZWP+zAJasYq59cIBPfBc6uWeWf1vigfTaCa2oTquVaTvm9zhPfDWuRXhM7dnNAmW5l8VSyM+Td0SrPvUQsCMWBZNdWJ1C6KUESkp9STFFpkxhfp+22T3Baj0gG4ruFo+Nt6ViLnC43U2T2TCkqmu+LpcLNkzw0WhgylgridK6ltTx3PxveGzZTc3CBlu8Gdox7qXL+zrntSw==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(376002)(346002)(366004)(396003)(451199021)(36756003)(66476007)(5660300002)(26005)(38070700005)(186003)(6506007)(66946007)(4326008)(6916009)(316002)(66446008)(66556008)(76116006)(41300700001)(91956017)(64756008)(71200400001)(53546011)(6486002)(2616005)(2906002)(4744005)(6512007)(8676002)(478600001)(8936002)(54906003)(83380400001)(86362001)(38100700002)(33656002)(122000001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <31F934B3EC1A854A9169F335FBC17564@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB10119
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT018.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	0ae2862c-d880-4eb8-c784-08db8c699527
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	EwjvUJlRWlMNs9eAxt9TIkD+QSv1aXuxsCJerGn4uknXxJxauI7X9MezDjmJ5Y5CaYxC0j7idO44dRxpGhmWTkSLz/MZcK1IiKIJzIgm20DAo/5jBvSDdORuCOGdaKzXmJC4CZL61uBEiNtoApenNJhfRi2dTYu81cB3nIlFQo/G+9Un3maIdyWWVGYj4/p+tofy7+hKDeKhE82o/Z+WtfMdolBtZi2L2mkriCFEAKYdT8M/0ufboI/1j30yL+SqQymsAh3hBRZcB1QEg1DnZaQR7zsjhNaNyKDsgheo+sEzPG00I03fyo/v5Dplhj/L0fT33gxgbGarFdDHKfvWAkMf59A/3HIIjgAtrhyolEEGouvAypMo/vcozRMb231bJQotgcIqjKS0GIeZrpJ4fPXmOJeSZEbTeI4edzcYJ1lWYNbmg+/vNix/AMvJ50SS2xpX+hTwPXhEW2Q51MOqCP1zjxIZpqeshxRUAdA5DlhxJ6ae75y9lb1DMqS84R6tNTZsKCuYxzEdqc1Y6x+M1vd1CrF8io8pZG0vBwcNMytHg31soWXHYp7+OSltSjklc6UMDDOguXjmSU4FuTVLN1FuCo5a0Xdd1KEGVlnrvPgnU6Nohpxyc8UjNM1Zu/k5CyLTcrSe34ijG3W7kb0MV/ngUxNEX6kI1BixBCGFofGg359juYgXL1m4S8WUHOpa7rxg3uLpLK/PrXi9be/M492Ryn8+h3y/zc07OsR8M+ZvSId59s62Nk9EZPvz3Kyc
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(376002)(136003)(396003)(451199021)(82310400008)(40470700004)(36840700001)(46966006)(40460700003)(33656002)(82740400003)(86362001)(356005)(40480700001)(81166007)(6486002)(4744005)(2906002)(6512007)(47076005)(2616005)(107886003)(53546011)(6506007)(186003)(26005)(336012)(36756003)(5660300002)(41300700001)(70206006)(70586007)(316002)(4326008)(478600001)(8676002)(8936002)(6862004)(54906003)(83380400001)(36860700001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 17:15:49.0634
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: eb783c46-b0c9-403c-e1c5-08db8c69a03b
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT018.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6054

DQoNCj4gT24gMjQgSnVsIDIwMjMsIGF0IDExOjE0LCBKdWxpZW4gR3JhbGwgPGp1bGllbkB4ZW4u
b3JnPiB3cm90ZToNCj4gDQo+IEZyb206IEp1bGllbiBHcmFsbCA8amdyYWxsQGFtYXpvbi5jb20+
DQo+IA0KPiBBdCB0aGUgbW9tZW50LCB0aGUgdGVtcG9yYXJ5IG1hcHBpbmcgaXMgb25seSB1c2Vk
IHdoZW4gdGhlIHZpcnR1YWwNCj4gcnVudGltZSByZWdpb24gb2YgWGVuIGlzIGNsYXNoaW5nIHdp
dGggdGhlIHBoeXNpY2FsIHJlZ2lvbi4NCj4gDQo+IEluIGZvbGxvdy11cCBwYXRjaGVzLCB3ZSB3
aWxsIHJld29yayBob3cgc2Vjb25kYXJ5IENQVSBicmluZy11cCB3b3Jrcw0KPiBhbmQgaXQgd2ls
bCBiZSBjb252ZW5pZW50IHRvIHVzZSB0aGUgZml4bWFwIGFyZWEgZm9yIGFjY2Vzc2luZw0KPiB0
aGUgcm9vdCBwYWdlLXRhYmxlIChpdCBpcyBwZXItY3B1KS4NCj4gDQo+IFJld29yayB0aGUgY29k
ZSB0byB1c2UgdGVtcG9yYXJ5IG1hcHBpbmcgd2hlbiB0aGUgWGVuIHBoeXNpY2FsIGFkZHJlc3MN
Cj4gaXMgbm90IG92ZXJsYXBwaW5nIHdpdGggdGhlIHRlbXBvcmFyeSBtYXBwaW5nLg0KPiANCj4g
VGhpcyBhbHNvIGhhcyB0aGUgYWR2YW50YWdlIHRvIHNpbXBsaWZ5IHRoZSBsb2dpYyB0byBpZGVu
dGl0eSBtYXANCj4gWGVuLg0KPiANCj4gU2lnbmVkLW9mZi1ieTogSnVsaWVuIEdyYWxsIDxqZ3Jh
bGxAYW1hem9uLmNvbT4NCg0KSGkgSnVsaWVuLA0KDQpTZWVtcyBnb29kIHRvIG1lLCBJ4oCZdmUg
YWxzbyB0ZXN0ZWQgb24gcWVtdSBhbmQgRlZQLCBjcmVhdGluZy9kZXN0cm95aW5nIGd1ZXN0cyBh
bmQgbm8gaXNzdWVzIHNvIGZhci4NCg0KUmV2aWV3ZWQtYnk6IEx1Y2EgRmFuY2VsbHUgPGx1Y2Eu
ZmFuY2VsbHVAYXJtLmNvbT4NClRlc3RlZC1ieTogTHVjYSBGYW5jZWxsdSA8bHVjYS5mYW5jZWxs
dUBhcm0uY29tPg0KDQoNCg==


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 17:26:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 17:26:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569183.889487 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNzKW-0006F3-Pn; Mon, 24 Jul 2023 17:26:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569183.889487; Mon, 24 Jul 2023 17:26:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNzKW-0006Ew-MD; Mon, 24 Jul 2023 17:26:44 +0000
Received: by outflank-mailman (input) for mailman id 569183;
 Mon, 24 Jul 2023 17:26:43 +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
 <SRS0=4gb1=DK=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qNzKU-0006Eq-K8
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 17:26:43 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2df5ea68-2a47-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 19:26:10 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.162.132.135])
 by support.bugseng.com (Postfix) with ESMTPSA id 8E3594EE073E;
 Mon, 24 Jul 2023 19:26:36 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2df5ea68-2a47-11ee-8612-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Wei Liu <wl@xen.org>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: [XEN PATCH v2] automation: add ECLAIR pipeline
Date: Mon, 24 Jul 2023 19:25:34 +0200
Message-Id: <c3a0495afe01cca1b0caf6e1caa2d0a3451ecc00.1690219502.git.simone.ballarin@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Add two pipelines that analyze an ARM64 and a X86_64 build with the
ECLAIR static analyzer on the guidelines contained in Set1.

The analysis configuration is stored in automation/eclair_analysis.

All commits on the xen-project/xen:staging branch will be analyzed
and their artifacts will be stored indefinitely; the integration will
report differential information with respect to the previous analysis.

All commits on other branches or repositories will be analyzed and
only the last ten artifacts will be kept; the integration will report
differential information with respect to the analysis done on the common
ancestor with xen-project/xen:staging (if available).

Currently the pipeline variable ENABLE_ECLAIR_BOT is set to "n".
Doing so disables the generation of comments with the analysis summary
on the commit threads. The variable can be set to "y" if the a masked
variable named ECLAIR_BOT_TOKEN is set with the impersonation token of
an account with enough privileges to write on all repositories.

Additionaly any repository should be able to read a masked variable
named WTOKEN with the token provided by BUGSENG.

The analysis fails if it contains violations of guidelines tagged as
clean:added. The list of clean guidelines are maintained in
automation/eclair_analysis/ECLAIR/tagging.ecl.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

--

Changes in v2:
- add ECLAIR configuration files (before they were fetched from a separate
  repository);
- now the pipeline fails if there are new violations of guidelines tagged
  with clean:added.
---
 .gitlab-ci.yml                                |   2 +
 MAINTAINERS                                   |   6 +
 automation/eclair_analysis/ECLAIR/Set1.ecl    |  59 ++++
 automation/eclair_analysis/ECLAIR/Set2.ecl    |  25 ++
 automation/eclair_analysis/ECLAIR/Set3.ecl    |  67 ++++
 .../eclair_analysis/ECLAIR/action.helpers     | 193 ++++++++++++
 .../eclair_analysis/ECLAIR/action.settings    | 172 ++++++++++
 .../ECLAIR/action_clean_added.sh              |  36 +++
 .../eclair_analysis/ECLAIR/action_log.sh      |  15 +
 .../ECLAIR/action_pull_request.sh             |  57 ++++
 .../eclair_analysis/ECLAIR/action_push.sh     |  95 ++++++
 .../ECLAIR/action_upload_sarif.sh             |  31 ++
 .../eclair_analysis/ECLAIR/analysis.ecl       |  25 ++
 automation/eclair_analysis/ECLAIR/analyze.sh  | 106 +++++++
 .../ECLAIR/call_properties.ecl                | 106 +++++++
 .../eclair_analysis/ECLAIR/deviations.ecl     | 298 ++++++++++++++++++
 .../eclair_analysis/ECLAIR/out_of_scope.ecl   | 127 ++++++++
 .../ECLAIR/print_analyzed_files.sh            |  66 ++++
 .../eclair_analysis/ECLAIR/public_APIs.ecl    |   6 +
 automation/eclair_analysis/ECLAIR/report.ecl  |   4 +
 automation/eclair_analysis/ECLAIR/tagging.ecl |  34 ++
 .../eclair_analysis/ECLAIR/toolchain.ecl      | 275 ++++++++++++++++
 automation/eclair_analysis/Makefile.prepare   |   6 +
 automation/eclair_analysis/build.sh           |  44 +++
 automation/eclair_analysis/prepare.sh         |  42 +++
 automation/eclair_analysis/xen_arm_config     | 147 +++++++++
 automation/eclair_analysis/xen_x86_config     | 152 +++++++++
 automation/gitlab-ci/analyze.yaml             |  37 +++
 automation/gitlab-ci/build.yaml               |   1 +
 automation/scripts/eclair                     |  32 ++
 30 files changed, 2266 insertions(+)
 create mode 100644 automation/eclair_analysis/ECLAIR/Set1.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/Set2.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/Set3.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/action.helpers
 create mode 100644 automation/eclair_analysis/ECLAIR/action.settings
 create mode 100755 automation/eclair_analysis/ECLAIR/action_clean_added.sh
 create mode 100755 automation/eclair_analysis/ECLAIR/action_log.sh
 create mode 100644 automation/eclair_analysis/ECLAIR/action_pull_request.sh
 create mode 100755 automation/eclair_analysis/ECLAIR/action_push.sh
 create mode 100755 automation/eclair_analysis/ECLAIR/action_upload_sarif.sh
 create mode 100644 automation/eclair_analysis/ECLAIR/analysis.ecl
 create mode 100755 automation/eclair_analysis/ECLAIR/analyze.sh
 create mode 100644 automation/eclair_analysis/ECLAIR/call_properties.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/deviations.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/out_of_scope.ecl
 create mode 100755 automation/eclair_analysis/ECLAIR/print_analyzed_files.=
sh
 create mode 100644 automation/eclair_analysis/ECLAIR/public_APIs.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/report.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/tagging.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/toolchain.ecl
 create mode 100644 automation/eclair_analysis/Makefile.prepare
 create mode 100755 automation/eclair_analysis/build.sh
 create mode 100755 automation/eclair_analysis/prepare.sh
 create mode 100644 automation/eclair_analysis/xen_arm_config
 create mode 100644 automation/eclair_analysis/xen_x86_config
 create mode 100644 automation/gitlab-ci/analyze.yaml
 create mode 100755 automation/scripts/eclair

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c8bd7519d5..ee5430b8b7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,7 +1,9 @@
 stages:
+  - analyze
   - build
   - test
=20
 include:
+  - 'automation/gitlab-ci/analyze.yaml'
   - 'automation/gitlab-ci/build.yaml'
   - 'automation/gitlab-ci/test.yaml'
diff --git a/MAINTAINERS b/MAINTAINERS
index 180e57dac4..c3b99e8560 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -305,6 +305,12 @@ F:	xen/include/xen/libfdt/
 F:	xen/include/xen/device_tree.h
 F:	xen/drivers/passthrough/device_tree.c
=20
+ECLAIR
+M: Simone Ballarin <simone.ballarin@bugseng.com>
+S: Supported
+F: xen/automation/eclair_analysis/
+F: xen/automation/scripts/eclair
+
 EFI
 M:	Jan Beulich <jbeulich@suse.com>
 S:	Supported
diff --git a/automation/eclair_analysis/ECLAIR/Set1.ecl b/automation/eclair=
_analysis/ECLAIR/Set1.ecl
new file mode 100644
index 0000000000..b5ca499037
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/Set1.ecl
@@ -0,0 +1,59 @@
+-doc_begin=3D"Set 1 as defined in Xen MISRA C Task (a): Xen Coding Guideli=
nes v1.0, May 31, 2023"
+-enable=3DMC3R1.R9.1
+-enable=3DMC3R1.R12.5
+-enable=3DMC3R1.R17.3
+-enable=3DMC3R1.R17.4
+-enable=3DMC3R1.R17.6
+-enable=3DMC3R1.R19.1
+-enable=3DMC3R1.R21.13
+-enable=3DMC3R1.R21.17
+-enable=3DMC3R1.R21.18
+-enable=3DMC3R1.R21.19
+-enable=3DMC3R1.R21.20
+-enable=3DMC3R1.R21.21
+-enable=3DMC3R1.R22.2
+-enable=3DMC3R1.R22.4
+-enable=3DMC3R1.R22.5
+-enable=3DMC3R1.R22.6
+-enable=3DMC3R1.D1.1
+-enable=3DMC3R1.D2.1
+-enable=3DMC3R1.D4.1
+-enable=3DMC3R1.D4.3
+-enable=3DMC3R1.D4.7
+-enable=3DMC3R1.D4.10
+-enable=3DMC3R1.D4.11
+-enable=3DMC3R1.D4.14
+-enable=3DMC3R1.R1.1
+-enable=3DMC3R1.R1.3
+-enable=3DMC3R1.R1.4
+-enable=3DMC3R1.R2.1
+-enable=3DMC3R1.R2.2
+-enable=3DMC3R1.R3.1
+-enable=3DMC3R1.R3.2
+-enable=3DMC3R1.R4.1
+-enable=3DMC3R1.R5.1
+-enable=3DMC3R1.R5.2
+-enable=3DMC3R1.R5.3
+-enable=3DMC3R1.R5.4
+-enable=3DMC3R1.R5.6
+-enable=3DMC3R1.R6.1
+-enable=3DMC3R1.R6.2
+-enable=3DMC3R1.R7.1
+-enable=3DMC3R1.R7.2
+-enable=3DMC3R1.R7.3
+-enable=3DMC3R1.R7.4
+-enable=3DMC3R1.R8.1
+-enable=3DMC3R1.R8.2
+-enable=3DMC3R1.R8.3
+-enable=3DMC3R1.R8.4
+-enable=3DMC3R1.R8.5
+-enable=3DMC3R1.R8.6
+-enable=3DMC3R1.R8.8
+-enable=3DMC3R1.R8.10
+-enable=3DMC3R1.R8.12
+-enable=3DMC3R1.R8.14
+-enable=3DMC3R1.R9.2
+-enable=3DMC3R1.R9.3
+-enable=3DMC3R1.R9.4
+-enable=3DMC3R1.R9.5
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/Set2.ecl b/automation/eclair=
_analysis/ECLAIR/Set2.ecl
new file mode 100644
index 0000000000..741fe4d470
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/Set2.ecl
@@ -0,0 +1,25 @@
+-doc_begin=3D"Set 2 as defined in Xen MISRA C Task (a): Xen Coding Guideli=
nes v1.0, May 31, 2023"
+-enable=3DMC3R1.R10.1
+-enable=3DMC3R1.R10.2
+-enable=3DMC3R1.R10.3
+-enable=3DMC3R1.R10.4
+-enable=3DMC3R1.R10.6
+-enable=3DMC3R1.R10.7
+-enable=3DMC3R1.R10.8
+-enable=3DMC3R1.R11.1
+-enable=3DMC3R1.R11.2
+-enable=3DMC3R1.R11.3
+-enable=3DMC3R1.R11.6
+-enable=3DMC3R1.R11.7
+-enable=3DMC3R1.R11.8
+-enable=3DMC3R1.R11.9
+-enable=3DMC3R1.R12.2
+-enable=3DMC3R1.R13.1
+-enable=3DMC3R1.R13.2
+-enable=3DMC3R1.R13.5
+-enable=3DMC3R1.R13.6
+-enable=3DMC3R1.R14.1
+-enable=3DMC3R1.R14.2
+-enable=3DMC3R1.R14.3
+-enable=3DMC3R1.R14.4
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/Set3.ecl b/automation/eclair=
_analysis/ECLAIR/Set3.ecl
new file mode 100644
index 0000000000..1b1afe4f3b
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/Set3.ecl
@@ -0,0 +1,67 @@
+-doc_begin=3D"Set 3 as defined in Xen MISRA C Task (a): Xen Coding Guideli=
nes v1.0, May 31, 2023"
+-enable=3DMC3R1.D4.12
+-enable=3DMC3R1.R5.5
+-enable=3DMC3R1.R5.7
+-enable=3DMC3R1.R5.8
+-enable=3DMC3R1.R15.2
+-enable=3DMC3R1.R15.3
+-enable=3DMC3R1.R15.6
+-enable=3DMC3R1.R15.7
+-enable=3DMC3R1.R16.1
+-enable=3DMC3R1.R16.2
+-enable=3DMC3R1.R16.3
+-enable=3DMC3R1.R16.4
+-enable=3DMC3R1.R16.5
+-enable=3DMC3R1.R16.6
+-enable=3DMC3R1.R16.7
+-enable=3DMC3R1.R17.1
+-enable=3DMC3R1.R17.2
+-enable=3DMC3R1.R17.5
+-enable=3DMC3R1.R17.7
+-enable=3DMC3R1.R18.1
+-enable=3DMC3R1.R18.2
+-enable=3DMC3R1.R18.3
+-enable=3DMC3R1.R18.6
+-enable=3DMC3R1.R18.7
+-enable=3DMC3R1.R18.8
+-enable=3DMC3R1.R20.2
+-enable=3DMC3R1.R20.3
+-enable=3DMC3R1.R20.4
+-enable=3DMC3R1.R20.6
+-enable=3DMC3R1.R20.7
+-enable=3DMC3R1.R20.8
+-enable=3DMC3R1.R20.9
+-enable=3DMC3R1.R20.11
+-enable=3DMC3R1.R20.12
+-enable=3DMC3R1.R20.13
+-enable=3DMC3R1.R20.14
+-enable=3DMC3R1.R21.1
+-enable=3DMC3R1.R21.2
+-enable=3DMC3R1.R21.3
+-enable=3DMC3R1.R21.4
+-enable=3DMC3R1.R21.5
+-enable=3DMC3R1.R21.6
+-enable=3DMC3R1.R21.7
+-enable=3DMC3R1.R21.8
+-enable=3DMC3R1.R21.9
+-enable=3DMC3R1.R21.10
+-enable=3DMC3R1.R21.12
+-enable=3DMC3R1.R21.14
+-enable=3DMC3R1.R21.15
+-enable=3DMC3R1.R21.16
+-enable=3DMC3R1.R22.1
+-enable=3DMC3R1.R22.3
+-enable=3DMC3R1.R22.7
+-enable=3DMC3R1.R22.8
+-enable=3DMC3R1.R22.9
+-enable=3DMC3R1.R22.10
+-enable=3DMC3R1.R2.6
+-enable=3DMC3R1.R4.2
+-doc_end
+
+-doc_begin=3D"Guidelines added with Xen MISRA C Task (a): Xen Coding Guide=
lines v1.1, June 1, 2023"
+-enable=3DMC3R1.R21.11
+-enable=3DMC3R1.D4.4
+-enable=3DMC3R1.R8.9
+-enable=3DMC3R1.R12.4
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/action.helpers b/automation/=
eclair_analysis/ECLAIR/action.helpers
new file mode 100644
index 0000000000..2ad6428eaa
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action.helpers
@@ -0,0 +1,193 @@
+if [ -n "${GITLAB_CI:-}" ]; then
+    ci=3Dgitlab
+elif [ -n "${GITHUB_ACTION:-}" ]; then
+    ci=3Dgithub
+elif [ -n "${JENKINS_HOME:-}" ]; then
+    ci=3Djenkins
+else
+    echo "Unexpected CI/CD context" >&2
+    exit 1
+fi
+
+esc=3D$(printf '\e')
+cr=3D$(printf '\r')
+
+open_section() {
+    id=3D$1
+    title=3D$2
+    collapsed=3D$3
+    echo "${esc}[0Ksection_start:$(date +%s):${id}${collapsed}${cr}${esc}[=
0K${esc}[1m${esc}[36m${title}${esc}[m"
+}
+
+close_section() {
+    id=3D$1
+    echo "${esc}[0Ksection_end:$(date +%s):${id}${cr}${esc}[0K"
+}
+
+summary() {
+    fixedReports=3D
+    newReports=3D
+    unfixedReports=3D
+    while read -r line; do
+        var=3D${line%%: *}
+        val=3D${line#*: }
+        eval "${var}=3D${val}"
+    done <"${updateLog}"
+
+    case "${ci}" in
+    github)
+        nl=3D"\\"
+        ;;
+    gitlab)
+        nl=3D
+        ;;
+    jenkins)
+        nl=3D"<br/>"
+        ;;
+    *)
+        nl=3D
+        ;;
+    esac
+
+    if [ -z "${newReports}" ]; then
+        fixedMsg=3D
+        unfixedMsg=3D"Unfixed reports: ${unfixedReports}"
+        countsMsg=3D"${unfixedMsg}"
+    else
+        fixedMsg=3D"Fixed reports: ${fixedReports}"
+        unfixedMsg=3D"Unfixed reports: ${unfixedReports} [new: ${newReport=
s}]"
+        countsMsg=3D"${fixedMsg}${nl}
+${unfixedMsg}"
+    fi
+    case "${ci}" in
+    jenkins)
+        cat <<EOF >"${summaryTxt}"
+${countsMsg}                                                              =
                ${nl}
+<a href=3D"https://www.bugseng.com/eclair">
+  <img src=3D"${eclairReportUrlPrefix}/rsrc/eclair.svg" width=3D"100" />
+</a>
+<h3>${jobHeadline}</h3>
+<a href=3D"${indexHtmlUrl}">Browse analysis results</a>
+EOF
+        ;;
+    *)
+        cat <<EOF >"${summaryTxt}"
+<a href=3D"https://www.bugseng.com/eclair">
+  <img src=3D"${eclairReportUrlPrefix}/rsrc/eclair.svg" width=3D"100" />
+</a>
+Analysis Summary
+
+${jobHeadline}${nl}
+${countsMsg}${nl}
+[Browse analysis](${indexHtmlUrl})
+EOF
+        ;;
+    esac
+
+    case ${ci} in
+    github)
+        cat "${summaryTxt}" >"${GITHUB_STEP_SUMMARY}"
+        ;;
+    gitlab)
+        open_section ECLAIR_summary "ECLAIR analysis summary" ""
+        # Generate summary and print it (GitLab-specific)
+        cat <<EOF
+${jobHeadline}
+${countsMsg}
+Browse analysis: ${esc}[33m${indexHtmlUrl}${esc}[m
+EOF
+        close_section ECLAIR_summary
+        ;;
+    jenkins)
+        cat <<EOF
+${jobHeadline}
+${fixedMsg}
+${unfixedMsg}
+Browse analysis: ${indexHtmlUrl}
+EOF
+        ;;
+    *)
+        echo "Unexpected CI/CD context" >&2
+        exit 1
+        ;;
+    esac
+}
+
+log_file() {
+    section_id=3D$1
+    section_name=3D$2
+    file=3D$3
+    exit_code=3D$4
+    if [ "${exit_code}" =3D 0 ]; then
+        collapsed=3D[collapsed=3Dtrue]
+    else
+        collapsed=3D
+    fi
+
+    case ${ci} in
+    github | jenkins)
+        echo "${section_name}"
+        ;;
+    gitlab)
+        open_section "${section_id}" "${section_name}" "${collapsed}"
+        ;;
+    *)
+        echo "Unexpected CI/CD context" >&2
+        exit 1
+        ;;
+    esac
+
+    cat "${file}"
+
+    case ${ci} in
+    github | jenkins) ;;
+    gitlab)
+        close_section "${section_id}"
+        ;;
+    *) ;;
+    esac
+}
+
+maybe_log_file_exit() {
+    section_id=3D$1
+    section_name=3D$2
+    file=3D$3
+    exit_code=3D$4
+
+    case ${ci} in
+    github | jenkins)
+        echo "${section_name}"
+        ;;
+    gitlab)
+        open_section "${section_id}" "${section_name}" ""
+        ;;
+    *)
+        echo "Unexpected CI/CD context" >&2
+        exit 1
+        ;;
+    esac
+
+    if [ "${exit_code}" !=3D 0 ]; then
+        cat "${file}"
+    fi
+
+    case ${ci} in
+    github | jenkins) ;;
+    gitlab)
+        close_section "${section_id}"
+        ;;
+    *) ;;
+    esac
+    return "${exit_code}"
+}
+
+is_enabled() {
+    case "$1" in
+    true | TRUE | y | Y | yes | YES | 1)
+        return 0
+        ;;
+    *)
+        return 1
+        ;;
+    esac
+}
diff --git a/automation/eclair_analysis/ECLAIR/action.settings b/automation=
/eclair_analysis/ECLAIR/action.settings
new file mode 100644
index 0000000000..0f7950f5ab
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action.settings
@@ -0,0 +1,172 @@
+variantSubDir=3D
+variantHeadline=3D
+if [ -n "${VARIANT:-}" ]; then
+    variantSubDir=3D"/${VARIANT}"
+    variantHeadline=3D" [${VARIANT}]"
+fi
+
+# AUTO PR Feature
+# If the following variables are defined, then all pipelines
+# of other branches will be considered pull-requests to
+# autoPRBranch.
+# Customized
+autoPRRepository=3D"${AUTO_PR_REPOSITORY:-}"
+# Customized
+autoPRBranch=3D"${AUTO_PR_BRANCH:-}"
+
+# Customized
+artifactsRoot=3D/var/local/eclair
+
+case "${ci}" in
+github)
+    # To be customized
+    repository=3D"${GITHUB_REPOSITORY}"
+    jobId=3D"${GITHUB_RUN_NUMBER}"
+
+    autoPRRemoteUrl=3D"${GITHUB_SERVER_URL}/${autoPRRepository:-}"
+
+    case "${GITHUB_EVENT_NAME}" in
+    pull_request*)
+        event=3Dpull_request
+        pullRequestId=3D"${GITHUB_EVENT_PULL_REQUEST_NUMBER}"
+        pullRequestHeadRepo=3D"${PR_HEAD_REPO}"
+        pullRequestHeadRef=3D"${PR_HEAD_REF}"
+        pullRequestBaseRef=3D"${PR_BASE_REF}"
+        pullRequestUser=3D"${PR_USER}"
+        # baseCommitId and headCommitId are the most recent merge points w=
ithout conflicts
+        git fetch -q --deepen=3D2
+        baseCommitId=3D$(git show -s --pretty=3D%H HEAD^1)
+        headCommitId=3D$(git show -s --pretty=3D%H HEAD^2)
+        ;;
+    push | workflow_dispatch)
+        event=3Dpush
+        # Extract the branch name from "refs/heads/<branch>"
+        branch=3D"${GITHUB_REF#refs/heads/}"
+        headCommitId=3D"${GITHUB_SHA}"
+        pushUser=3D"${GITHUB_ACTOR}"
+        ;;
+    *)
+        echo "Unexpected GITHUB_REF ${GITHUB_REF}" >&2
+        exit 1
+        ;;
+    esac
+    ;;
+gitlab)
+    # Customized
+    repository=3D"${CI_PROJECT_PATH}"
+    jobId=3D"${CI_JOB_ID}"
+
+    gitlabApiUrl=3D"${CI_SERVER_PROTOCOL}://${CI_SERVER_HOST}:${CI_SERVER_=
PORT}/api/v4"
+    autoPRRemoteUrl=3D"${CI_SERVER_PROTOCOL}://${CI_SERVER_HOST}:${CI_SERV=
ER_PORT}/${autoPRRepository:-}"
+
+    # Customized
+    gitlabBotToken=3D"${ECLAIR_BOT_TOKEN:-}"
+
+    case "${CI_PIPELINE_SOURCE}" in
+    merge_request_event)
+        event=3Dpull_request
+        pullRequestId=3D"${CI_MERGE_REQUEST_IID}"
+        pullRequestHeadRef=3D"${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
+        pullRequestHeadRepo=3D"${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH}"
+        pullRequestBaseRef=3D"${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}"
+        pullRequestUser=3D"${GITLAB_USER_LOGIN}"
+        headCommitId=3D"${CI_COMMIT_SHA}"
+        baseCommitId=3D"${CI_MERGE_REQUEST_DIFF_BASE_SHA}"
+        ;;
+    push | pipeline | web)
+        event=3Dpush
+        branch=3D"${CI_COMMIT_BRANCH}"
+        headCommitId=3D"${CI_COMMIT_SHA}"
+        pushUser=3D"${GITLAB_USER_NAME}"
+        ;;
+    *)
+        echo "Unexpected event ${CI_PIPELINE_SOURCE}" >&2
+        exit 1
+        ;;
+    esac
+    ;;
+jenkins)
+    # To be customized
+    repository=3D"${JOB_BASE_NAME}"
+    project=3D"${JOB_NAME}"
+    jobId=3D"${BUILD_NUMBER}"
+
+    jenkinsApiUrl=3D"${JENKINS_URL}"
+    autoPRRemoteUrl=3D"${JENKINS_URL}/${autoPRRepository:-}"
+
+    # To be customized
+    jenkinsBotUsername=3D"${ECLAIR_BOT_USERNAME:-}"
+    jenkinsBotToken=3D"${ECLAIR_BOT_TOKEN:-}"
+
+    event=3Dpush
+    branch=3D"${GIT_BRANCH}"
+    headCommitId=3D"${GIT_COMMIT}"
+    pushUser=3D$(git show --pretty=3D'format:%aN' -s)
+    ;;
+*)
+    echo "Unexpected CI/CD context" >&2
+    exit 1
+    ;;
+esac
+
+if [ "${event}" =3D "push" ] && [ -n "${autoPRBranch:-}" ]; then
+    # AUTO PR Feature enabled
+    if ! [ "${branch}" =3D "${autoPRBranch}" ] ||
+        ! [ "${repository}" =3D "${autoPRRepository}" ]; then
+        event=3Dauto_pull_request
+    fi
+fi
+
+case "${event}" in
+pull_request)
+    subDir=3D"${pullRequestHeadRepo}.ecdf/${pullRequestBaseRef}"
+    jobHeadline=3D"ECLAIR ${ANALYSIS_KIND} on repository ${repository}: ${=
pullRequestUser} wants to merge ${pullRequestHeadRepo}:${pullRequestHeadRef=
} (${headCommitId}) into ${pullRequestBaseRef} (${baseCommitId})"
+    ;;
+push)
+    subDir=3D"${branch}"
+    jobHeadline=3D"ECLAIR ${ANALYSIS_KIND} on repository ${repository}: br=
anch ${branch} (${headCommitId})"
+    badgeLabel=3D"ECLAIR ${ANALYSIS_KIND} ${branch}${variantHeadline} #${j=
obId}"
+    ;;
+auto_pull_request)
+    git remote remove autoPRRemote || true
+    git remote add autoPRRemote "${autoPRRemoteUrl}"
+    git fetch autoPRRemote
+    subDir=3D"${branch}"
+    baseCommitId=3D$(git merge-base "autoPRRemote/${autoPRBranch}" HEAD)
+    jobHeadline=3D"ECLAIR ${ANALYSIS_KIND} on repository ${repository}: ${=
pushUser} wants to merge ${repository}:${branch} (${headCommitId}) into ${a=
utoPRRepository}/${autoPRBranch} (${baseCommitId})"
+    ;;
+*)
+    echo "Unexpected event ${event}" >&2
+    exit 1
+    ;;
+esac
+
+case "${repository}" in
+xen-project/xen)
+    # Customized
+    keepOldAnalyses=3D0
+    ;;
+xen-project/*)
+    # Customized
+    keepOldAnalyses=3D10
+    ;;
+*)
+    echo "Unexpected repository" >&2
+    exit 1
+    ;;
+esac
+
+ECLAIR_BIN_DIR=3D/opt/bugseng/eclair/bin/
+
+artifactsDir=3D"${artifactsRoot}/xen-project.ecdf/${repository}/ECLAIR_${A=
NALYSIS_KIND}"
+subDir=3D"${subDir}${variantSubDir}"
+jobHeadline=3D"${jobHeadline}${variantHeadline}"
+
+# Customized
+eclairReportUrlPrefix=3Dhttps://saas.eclairit.com:3787
+
+jobDir=3D"${artifactsDir}/${subDir}/${jobId}"
+updateLog=3D"${analysisOutputDir}/update.log"
+commentLog=3D"${analysisOutputDir}/comment.json"
+indexHtmlUrl=3D"${eclairReportUrlPrefix}/fs${jobDir}/index.html"
+summaryTxt=3D"${analysisOutputDir}/summary.txt"
diff --git a/automation/eclair_analysis/ECLAIR/action_clean_added.sh b/auto=
mation/eclair_analysis/ECLAIR/action_clean_added.sh
new file mode 100755
index 0000000000..59bc35fd13
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action_clean_added.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -eu
+
+usage() {
+    echo "Usage: $0 ANALYSIS_OUTPUT_DIR" >&2
+    exit 2
+}
+
+[ $# -eq 1 ] || usage
+
+analysisOutputDir=3D$1
+
+cleanAddedTxt=3D"${analysisOutputDir}/clean_added.log"
+
+# Load settings and helpers
+. "$(dirname "$0")/action.helpers"
+. "$(dirname "$0")/action.settings"
+
+unexpectedReports=3D$("${ECLAIR_BIN_DIR}eclair_report" \
+    "-db=3D'${analysisOutputDir}/PROJECT.ecd'" \
+    "-sel_unfixed=3Dunfixed" \
+    "-sel_tag_glob=3Dclean_added,clean,added" \
+    "-print=3D'',reports_count()")
+
+if [ "${unexpectedReports}" -gt 0 ]; then
+    cat <<EOF >"${cleanAddedTxt}"
+Failure: ${unexpectedReports} unexpected reports found.
+Unexpected reports are tagged 'clean:added'.
+EOF
+    exit 1
+else
+    cat <<EOF >"${cleanAddedTxt}"
+Success: No unexpected reports.
+EOF
+fi
diff --git a/automation/eclair_analysis/ECLAIR/action_log.sh b/automation/e=
clair_analysis/ECLAIR/action_log.sh
new file mode 100755
index 0000000000..67125b08f3
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action_log.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -eu
+
+usage() {
+    echo "Usage: $0 SECTION_ID SECTION_NAME FILE EXIT_CODE" >&2
+    exit 2
+}
+
+[ $# -eq 4 ] || usage
+
+# Load settings and helpers
+. "$(dirname "$0")/action.helpers"
+
+log_file "$@"
diff --git a/automation/eclair_analysis/ECLAIR/action_pull_request.sh b/aut=
omation/eclair_analysis/ECLAIR/action_pull_request.sh
new file mode 100644
index 0000000000..68f7e6282e
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+set -eu
+
+usage() {
+    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR COMMIT_ID" >&2
+    exit 2
+}
+
+[ $# -eq 2 ] || usage
+
+wtoken=3D$1
+analysisOutputDir=3D$2
+
+# Load settings and helpers
+. "$(dirname "$0")/action.helpers"
+. "$(dirname "$0")/action.settings"
+
+curl -sS "${eclairReportUrlPrefix}/ext/update_pull_request" \
+    -F "wtoken=3D${wtoken}" \
+    -F "artifactsDir=3D${artifactsDir}" \
+    -F "subDir=3D${subDir}" \
+    -F "jobId=3D${jobId}" \
+    -F "jobHeadline=3D${jobHeadline}" \
+    -F "baseCommitId=3D${baseCommitId}" \
+    -F "keepOldAnalyses=3D${keepOldAnalyses}" \
+    -F "db=3D@${analysisOutputDir}/PROJECT.ecd" \
+    >"${updateLog}"
+ex=3D0
+grep -Fq "unfixedReports: " "${updateLog}" || ex=3D$?
+maybe_log_file_exit PUBLISH_RESULT "Publishing results" "${updateLog}" "${=
ex}"
+
+summary
+
+if is_enabled "${ENABLE_ECLAIR_BOT:-}"; then
+    case ${ci} in
+    github)
+        ex=3D0
+        gh api \
+            --method POST \
+            "/repos/${repository}/issues/${pullRequestId}/comments" \
+            -F "body=3D@${summaryTxt}" \
+            --silent >"${commentLog}" 2>&1 || ex=3D$?
+        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "=
${ex}"
+        ;;
+    gitlab)
+        curl -sS --request POST \
+            "${gitlabApiUrl}/projects/${CI_PROJECT_ID}/merge_requests/${pu=
llRequestId}/notes" \
+            -H "PRIVATE-TOKEN: ${gitlabBotToken}" \
+            -F "body=3D<${summaryTxt}" >"${commentLog}"
+        ex=3D0
+        grep -Fq "Unfixed reports: " "${commentLog}" || ex=3D$?
+        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "=
${ex}"
+        ;;
+    *) ;;
+    esac
+fi
diff --git a/automation/eclair_analysis/ECLAIR/action_push.sh b/automation/=
eclair_analysis/ECLAIR/action_push.sh
new file mode 100755
index 0000000000..45215fbf00
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action_push.sh
@@ -0,0 +1,95 @@
+#!/bin/sh
+
+set -eu
+
+usage() {
+    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR" >&2
+    exit 2
+}
+
+[ $# -eq 2 ] || usage
+
+wtoken=3D$1
+analysisOutputDir=3D$2
+
+# Load settings and helpers
+. "$(dirname "$0")/action.helpers"
+. "$(dirname "$0")/action.settings"
+
+case "${event}" in
+push)
+    curl -sS "${eclairReportUrlPrefix}/ext/update_push" \
+        -F "wtoken=3D${wtoken}" \
+        -F "artifactsDir=3D${artifactsDir}" \
+        -F "subDir=3D${subDir}" \
+        -F "jobId=3D${jobId}" \
+        -F "jobHeadline=3D${jobHeadline}" \
+        -F "commitId=3D${headCommitId}" \
+        -F "badgeLabel=3D${badgeLabel}" \
+        -F "keepOldAnalyses=3D${keepOldAnalyses}" \
+        -F "db=3D@${analysisOutputDir}/PROJECT.ecd" \
+        >"${updateLog}"
+    ;;
+auto_pull_request)
+    curl -sS "${eclairReportUrlPrefix}/ext/update_pull_request" \
+        -F "wtoken=3D${wtoken}" \
+        -F "artifactsDir=3D${artifactsDir}" \
+        -F "subDir=3D${subDir}" \
+        -F "jobId=3D${jobId}" \
+        -F "jobHeadline=3D${jobHeadline}" \
+        -F "baseCommitId=3D${baseCommitId}" \
+        -F "keepOldAnalyses=3D${keepOldAnalyses}" \
+        -F "db=3D@${analysisOutputDir}/PROJECT.ecd" \
+        >"${updateLog}"
+    ;;
+*)
+    echo "Unexpected event ${event}" >&2
+    exit 1
+    ;;
+esac
+
+ex=3D0
+grep -Fq "unfixedReports: " "${updateLog}" || ex=3D$?
+maybe_log_file_exit PUBLISH_RESULT "Publishing results" "${updateLog}" "${=
ex}"
+
+summary
+
+if is_enabled "${ENABLE_ECLAIR_BOT:-}"; then
+    case ${ci} in
+    github)
+        ex=3D0
+        gh api \
+            --method POST \
+            "/repos/${repository}/commits/${headCommitId}/comments" \
+            -F "body=3D@${summaryTxt}" \
+            --silent >"${commentLog}" 2>&1 || ex=3D$?
+        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "=
${ex}"
+        ;;
+    gitlab)
+        curl -sS --request POST \
+            "${gitlabApiUrl}/projects/${CI_PROJECT_ID}/repository/commits/=
${CI_COMMIT_SHA}/comments" \
+            -H "PRIVATE-TOKEN: ${gitlabBotToken}" \
+            -F "note=3D<${summaryTxt}" >"${commentLog}"
+        ex=3D0
+        grep -Fq "Unfixed reports: " "${commentLog}" || ex=3D$?
+        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "=
${ex}"
+        ;;
+    jenkins)
+        ex=3D0
+        curl \
+            --user "${jenkinsBotUsername}:${jenkinsBotToken}" \
+            --data-urlencode "description=3D$(cat "${summaryTxt}")" \
+            --data-urlencode "Submit=3DSubmit" \
+            "${jenkinsApiUrl}job/${project}/${jobId}/submitDescription" \
+            >"${commentLog}" 2>&1 || ex=3D$?
+        curl \
+            --user "${jenkinsBotUsername}:${jenkinsBotToken}" \
+            --data-urlencode "description=3D$(cat "${summaryTxt}")" \
+            --data-urlencode "Submit=3DSubmit" \
+            "${jenkinsApiUrl}job/${project}/submitDescription" \
+            >"${commentLog}" 2>&1 || ex=3D$?
+        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "=
${ex}"
+        ;;
+    *) ;;
+    esac
+fi
diff --git a/automation/eclair_analysis/ECLAIR/action_upload_sarif.sh b/aut=
omation/eclair_analysis/ECLAIR/action_upload_sarif.sh
new file mode 100755
index 0000000000..60b8034fcc
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action_upload_sarif.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+set -eu
+
+usage() {
+    echo "Usage: $0 SARIF_FILE" >&2
+    exit 2
+}
+
+[ $# -eq 1 ] || usage
+
+HERE=3D$( (
+    cd "$(dirname "$0")"
+    echo "${PWD}"
+))
+
+. "${HERE}/action.helpers"
+
+sarifFile=3D$1
+sarifPayload=3D${HERE}/sarif.gz.b64
+uploadLog=3D${HERE}/upload_sarif.log
+
+gzip -c "${sarifFile}" | base64 -w0 >"${sarifPayload}"
+
+ex=3D0
+gh api --method POST -H "Accept: application/vnd.github+json" \
+    "/repos/${GITHUB_REPOSITORY}/code-scanning/sarifs" \
+    -f "commit_sha=3D${GITHUB_SHA}" -f "ref=3D${GITHUB_REF}" \
+    -F "sarif=3D@${sarifPayload}" \
+    --silent >"${uploadLog}" 2>&1 || ex=3D$?
+maybe_log_file_exit ADD_COMMENT "Uploading SARIF" "${uploadLog}" "${ex}"
diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/ec=
lair_analysis/ECLAIR/analysis.ecl
new file mode 100644
index 0000000000..fe418d6da1
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -0,0 +1,25 @@
+-setq=3Dset,getenv("SET")
+-project_name=3Dgetenv("ECLAIR_PROJECT_NAME")
+-project_root=3Dgetenv("ECLAIR_PROJECT_ROOT")
+
+-setq=3Ddata_dir,getenv("ECLAIR_DATA_DIR")
+
+-verbose
+
+-enable=3DB.REPORT.ECB
+-config=3DB.REPORT.ECB,output=3Djoin_paths(data_dir,"FRAME.@FRAME@.ecb")
+-config=3DB.REPORT.ECB,preprocessed=3Dshow
+-config=3DB.REPORT.ECB,macros=3D10
+
+-enable=3DB.EXPLAIN
+
+-eval_file=3Dtoolchain.ecl
+-eval_file=3Dpublic_APIs.ecl
+-eval_file=3Dout_of_scope.ecl
+-eval_file=3Ddeviations.ecl
+-eval_file=3Dcall_properties.ecl
+-eval_file=3Dtagging.ecl
+-eval_file=3Dconcat(set,".ecl")
+
+-doc=3D"Hide reports in external code."
+-reports+=3D{hide,all_exp_external}
diff --git a/automation/eclair_analysis/ECLAIR/analyze.sh b/automation/ecla=
ir_analysis/ECLAIR/analyze.sh
new file mode 100755
index 0000000000..47cdbb03ce
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/analyze.sh
@@ -0,0 +1,106 @@
+#!/bin/bash
+# Stop immediately if any executed command has exit status different from =
0.
+set -e
+set -o pipefail
+
+script_name=3D"$(basename "$0")"
+
+fatal() {
+  echo "${script_name}: $*" >&2
+  exit 1
+}
+
+usage() {
+  fatal "Usage: ${script_name} <ARM64|X86_64> <Set0|Set1|Set2|Set3>"
+}
+
+if [[ $# -ne 2 ]]; then
+  usage
+fi
+
+# Absolute path of the ECLAIR bin directory.
+export ECLAIR_BIN_DIR=3D/opt/bugseng/eclair/bin/
+
+# Directory where this script resides: usually in a directory named "ECLAI=
R".
+SCRIPT_DIR=3D"$(
+  cd "$(dirname "$0")"
+  echo "${PWD}"
+)"
+# Directory where to put all ECLAIR output and temporary files.
+if [[ -z "${ECLAIR_OUTPUT_DIR:-}" ]]; then
+  ECLAIR_OUTPUT_DIR=3D"${PWD}/ECLAIR/out"
+fi
+
+export ECLAIR_DIAGNOSTICS_OUTPUT=3D"${ECLAIR_OUTPUT_DIR}/ANALYSIS.log"
+# Set the variable for the build log file.
+ECLAIR_BUILD_LOG=3D${ECLAIR_OUTPUT_DIR}/BUILD.log
+# Set the variable for the report log file.
+ECLAIR_REPORT_LOG=3D${ECLAIR_OUTPUT_DIR}/REPORT.log
+
+if [[ "$1" =3D "X86_64" ]]; then
+  export CROSS_COMPILE=3D
+  export XEN_TARGET_ARCH=3Dx86_64
+  EXTRA_ECLAIR_ENV_OPTIONS=3D-disable=3DMC3R1.R20.7
+elif [[ "$1" =3D "ARM64" ]]; then
+  export CROSS_COMPILE=3Daarch64-linux-gnu-
+  export XEN_TARGET_ARCH=3Darm64
+else
+  fatal "Unknown configuration: $1"
+fi
+
+VARIANT=3D"${XEN_TARGET_ARCH}"
+
+# Used in analysis.ecl
+case "$2" in
+Set0|Set1|Set2|Set3)
+  export SET=3D"$2"
+  ;;
+*)
+  fatal "Unknown configuration: $2"
+  ;;
+esac
+
+export CC_ALIASES=3D"${CROSS_COMPILE}gcc-12"
+export CXX_ALIASES=3D"${CROSS_COMPILE}g++-12"
+export LD_ALIASES=3D"${CROSS_COMPILE}ld"
+export AR_ALIASES=3D"${CROSS_COMPILE}ar"
+export AS_ALIASES=3D"${CROSS_COMPILE}as"
+export FILEMANIP_ALIASES=3D"cp mv ${CROSS_COMPILE}objcopy"
+
+# ECLAIR binary data directory and workspace.
+export ECLAIR_DATA_DIR=3D"${ECLAIR_OUTPUT_DIR}/.data"
+# ECLAIR workspace.
+export ECLAIR_WORKSPACE=3D"${ECLAIR_DATA_DIR}/eclair_workspace"
+
+# Identifies the particular build of the project.
+export ECLAIR_PROJECT_NAME=3D"XEN_${VARIANT}-${SET}"
+# All paths mentioned in ECLAIR reports that are below this directory
+# will be presented as relative to ECLAIR_PROJECT_ROOT.
+export ECLAIR_PROJECT_ROOT=3D"${PWD}"
+
+# Erase and recreate the output directory and the data directory.
+rm -rf "${ECLAIR_OUTPUT_DIR:?}/*"
+mkdir -p "${ECLAIR_DATA_DIR}"
+
+# Perform the build (from scratch) in an ECLAIR environment.
+"${ECLAIR_BIN_DIR}eclair_env" \
+    "-config_file=3D'${SCRIPT_DIR}/analysis.ecl'" \
+    "${EXTRA_ECLAIR_ENV_OPTIONS}" \
+  -- "${SCRIPT_DIR}/../build.sh" "$1" | tee "${ECLAIR_BUILD_LOG}"
+
+
+# Create the project database.
+PROJECT_ECD=3D"${ECLAIR_OUTPUT_DIR}/PROJECT.ecd"
+find "${ECLAIR_DATA_DIR}" -maxdepth 1 -name "FRAME.*.ecb" |
+  sort | xargs cat |
+  "${ECLAIR_BIN_DIR}eclair_report" \
+    "-create_db=3D'${PROJECT_ECD}'" \
+    -load=3D/dev/stdin > "${ECLAIR_REPORT_LOG}" 2>&1
+
+# Create the Jenkins reports file.
+"${ECLAIR_BIN_DIR}eclair_report" \
+  "-db=3D'${PROJECT_ECD}'" \
+  "-eval_file=3D'${SCRIPT_DIR}/report.ecl'" \
+  >> "${ECLAIR_REPORT_LOG}" 2>&1
+
+"${SCRIPT_DIR}/print_analyzed_files.sh" "${PROJECT_ECD}" "${ECLAIR_OUTPUT_=
DIR}"
diff --git a/automation/eclair_analysis/ECLAIR/call_properties.ecl b/automa=
tion/eclair_analysis/ECLAIR/call_properties.ecl
new file mode 100644
index 0000000000..3f7794bf8b
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/call_properties.ecl
@@ -0,0 +1,106 @@
+
+-call_properties+=3D{"name(printk)", {"pointee_write(1..=3Dnever)", "taken=
()"}}
+-call_properties+=3D{"name(debugtrace_printk)", {"pointee_write(1..=3Dneve=
r)", "taken()"}}
+-call_properties+=3D{"name(panic)", {"pointee_write(1..=3Dnever)", "taken(=
)"}}
+-call_properties+=3D{"macro(^domain_crash$)", {"pointee_write(2..=3Dnever)=
", "taken()"}}
+-call_properties+=3D{"macro(^(g?d|mm_)?printk$)", {"pointee_write(2..=3Dne=
ver)", "taken()"}}
+-call_properties+=3D{"macro(^guest_bug_on_failed$)", {"pointee_write(1=3Dn=
ever)", "taken()"}}
+-call_properties+=3D{"macro(^spin_lock_init_prof$)", {"pointee_write(2=3Dn=
ever)", "taken()"}}
+-call_properties+=3D{"macro(^sched_test_func$)", {"pointee_write(1..=3Dnev=
er)", "taken()"}}
+-call_properties+=3D{"macro(^dev_(info|warn)$)", {"pointee_write(1..=3Dnev=
er)", "taken()"}}
+-call_properties+=3D{"macro(^PAGING_DEBUG$)", {"pointee_write(1..=3Dnever)=
", "taken()"}}
+-call_properties+=3D{"macro(^ACPI_(WARNING|ERROR|INFO)$)", {"pointee_write=
(1..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(fdt_get_property_by_offset_)", {"pointee_write(=
3=3Dalways)", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(read_atomic_size)", {"pointee_write(2=3Dalways)=
", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(device_tree_get_reg)", {"pointee_write(4..=3Dal=
ways)", "pointee_read(4..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(dt_get_range)", {"pointee_write(3..=3Dalways)",=
 "pointee_read(3..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(parse_static_mem_prop)", {"pointee_write(2..=3D=
always)", "pointee_read(2..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(get_ttbr_and_gran_64bit)", {"pointee_write(1..2=
=3Dalways)", "pointee_read(1..2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(hvm_emulate_init_once)", {"pointee_write(1=3Dal=
ways)", "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(__vmread)", {"pointee_write(2=3Dalways)", "poin=
tee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(hvm_pci_decode_addr)", {"pointee_write(3=3Dalwa=
ys)", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(vpci_mmcfg_decode_addr)", {"pointee_write(3=3Da=
lways)", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(x86emul_decode)", {"pointee_write(1=3Dalways)",=
 "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(unmap_grant_ref)", {"pointee_write(2=3Dalways)"=
, "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(arm_smmu_cmdq_build_cmd)", {"pointee_write(1=3D=
always)", "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(pci_size_mem_bar)", {"pointee_write(4=3Dalways)=
", "pointee_read(4=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(_hvm_read_entry)", {"pointee_write(2=3Dalways)"=
, "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(hvm_map_guest_frame_rw)", {"pointee_write(3=3Da=
lways)", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(guest_cpuid)", {"pointee_write(4=3Dalways)", "p=
ointee_read(4=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(epte_get_entry_emt)", {"pointee_write(5=3Dalway=
s)", "pointee_read(5=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(mcheck_mca_logout)", {"pointee_write(3=3Dalways=
)", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(set_field_in_reg_u32)", {"pointee_write(5=3Dalw=
ays)", "pointee_read(5=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(alloc_affinity_masks)", {"pointee_write(1=3Dalw=
ays)", "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(xasprintf)", {"pointee_write(1=3Dalways)", "poi=
ntee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(find_non_smt)", {"pointee_write(2=3Dalways)", "=
pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(call_rcu)", {"pointee_write(1=3Dalways)", "poin=
tee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(getdomaininfo)", {"pointee_write(2=3Dalways)", =
"pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"^MAPPING_(INSERT|SEARCH)\\(.*$", {"pointee_write(2..=
=3Dalways)", "pointee_read(2..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(FormatDec)", {"pointee_write(2=3Dalways)", "poi=
ntee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(FormatHex)", {"pointee_write(3=3Dalways)", "poi=
ntee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(p2m_get_ioreq_server)", {"pointee_write(2=3Dalw=
ays)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(elf_memset_unchecked)", {"pointee_write(1=3Dalw=
ays)", "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(set_iommu_pte_present)", {"pointee_write(7=3Dal=
ways)", "pointee_read(7=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(clear_iommu_pte_present)", {"pointee_write(4=3D=
always)", "pointee_read(4=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(vcpu_runstate_get)", {"pointee_write(2=3Dalways=
)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(va_start)", {"pointee_write(1=3Dalways)", "poin=
tee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(sgi_target_init)", {"pointee_write(1=3Dalways)"=
, "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(get_hw_residencies)", {"pointee_write(2=3Dalway=
s)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(x86_cpu_policy_to_featureset)", {"pointee_write=
(2=3Dalways)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"^simple_strtou?ll?\\(.*$", {"pointee_write(2=3Dalway=
s)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(msi_compose_msg)", {"pointee_write(3=3Dalways)"=
, "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(print_tainted)", {"pointee_write(1=3Dalways)", =
"pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(get_hvm_registers)", {"pointee_write(3=3Dalways=
)", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(x86_insn_modrm)", {"pointee_write(2..3=3Dalways=
)", "pointee_read(2..3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(cpuid_count_leaf)", {"pointee_write(3=3Dalways)=
", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(rcu_lock_remote_domain_by_id)", {"pointee_write=
(2=3Dalways)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(cpuid_count)", {"pointee_write(3..=3Dalways)", =
"pointee_read(3..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(efi_boot_mem_unused)", {"pointee_write(1..=3Dal=
ways)", "pointee_read(1..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(collect_time_info)", {"pointee_write(2=3Dalways=
)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(setup_xstate_comp)", {"pointee_write(1=3Dalways=
)", "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(map_domain_gfn)", {"pointee_read(5=3Dnever)", "=
taken()"}}
+-call_properties+=3D{"name(fdt_getprop)", {"pointee_read(4=3Dnever)", "tak=
en()"}}
+-call_properties+=3D{"name(fdt_get_name)", {"pointee_read(3=3Dnever)", "ta=
ken()"}}
+-call_properties+=3D{"name(fdt_get_property)", {"pointee_read(4=3Dnever)",=
 "taken()"}}
+-call_properties+=3D{"name(pci_get_host_bridge_segment)", {"pointee_read(2=
=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(dt_get_property)", {"pointee_read(3=3Dnever)", =
"taken()"}}
+-call_properties+=3D{"name(dt_property_read_u32)", {"pointee_read(3=3Dneve=
r)", "taken()"}}
+-call_properties+=3D{"name(dt_device_get_paddr)", {"pointee_read(3..4=3Dne=
ver)", "taken()"}}
+-call_properties+=3D{"name(get_evtchn_dt_property)", {"pointee_write(2..3=
=3Dmaybe)", "pointee_read(2..3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(setup_chosen_node)", {"pointee_write(2..3=3Dmay=
be)", "pointee_read(2..3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(queue_remove_raw)", {"pointee_read(2=3Dnever)",=
 "taken()"}}
+-call_properties+=3D{"macro(^memset$)", {"pointee_write(1=3Dalways)", "poi=
ntee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"macro(^va_start$)", {"pointee_write(1=3Dalways)", "p=
ointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"macro(^memcmp$)", {"pointee_write(1..2=3Dnever)", "t=
aken()"}}
+-call_properties+=3D{"macro(^memcpy$)", {"pointee_write(1=3Dalways&&2..=3D=
never)", "pointee_read(1=3Dnever&&2..=3Dalways)", "taken()"}}
+
+-doc_begin=3D"Property inferred as a consequence of the semantics of devic=
e_tree_get_reg"
+-call_properties+=3D{"name(acquire_static_memory_bank)", {"pointee_write(4=
..=3Dalways)", "pointee_read(4..=3Dnever)", "taken()"}}
+-doc_end
+
+-doc_begin=3D"Property inferred as a consequence of the semantics of dt_se=
t_cell"
+-call_properties+=3D{"name(set_interrupt)", {"pointee_write(1=3Dalways)", =
"pointee_read(1=3Dnever)", "taken()"}}
+-doc_end
+
+-doc_begin=3D"Property inferred as a consequence of the semantics of __p2m=
_get_mem_access"
+-call_properties+=3D{"name(p2m_get_mem_access)", {"pointee_write(3=3Dalway=
s)", "pointee_read(3=3Dnever)", "taken()"}}
+-doc_end
+
+-doc_begin=3D"This function has alternative definitions with props {write=
=3Dalways,read=3Dnever} and {write=3Dnever,read=3Dnever}"
+-call_properties+=3D{"name(alloc_cpumask_var)", {"pointee_write(1=3Dmaybe)=
", "pointee_read(1=3Dnever)", "taken()"}}
+-doc_end
+
+-doc_begin=3D"Property inferred as a consequence of the semantics of alloc=
_cpumask_var"
+-call_properties+=3D{"name(xenctl_bitmap_to_cpumask)", {"pointee_write(1=
=3Dalways)", "pointee_read(1=3Dnever)", "taken()"}}
+-doc_end
+
+-doc_begin=3D"The call to bitmap_and causes the pointee of dstp to be alwa=
ys written"
+-call_properties+=3D{"^cpumask_(and|andnot|clear|copy|complement).*$", {"p=
ointee_write(1=3Dalways)", "pointee_read(1=3Dnever)" "taken()"}}
+-call_properties+=3D{"^bitmap_(andnot|complement|fill).*$", {"pointee_writ=
e(1=3Dalways)", "pointee_read(1=3Dnever)", "taken()"}}
+-doc_end
+
+-doc_begin=3D"The .*copy_(to|from).* helpers all have a memcpy-like expect=
ation that the destination is a copy of the source.
+Furthermore, their uses do initialize the involved variables as needed by =
futher uses in the caller."
+-call_properties+=3D{"macro(^(__)?(raw_)?copy_from_(paddr|guest|compat)(_o=
ffset)?$)", {"pointee_write(1=3Dalways)", "pointee_read(1=3Dnever)", "taken=
()"}}
+-call_properties+=3D{"macro(^(__)?copy_to_(guest|compat)(_offset)?$)", {"p=
ointee_write(2=3Dalways)", "pointee_read(2=3Dnever)", "taken()"}}
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/=
eclair_analysis/ECLAIR/deviations.ecl
new file mode 100644
index 0000000000..e1a06daf2f
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -0,0 +1,298 @@
+### Set 1 ###
+
+#
+# Series 2.
+#
+
+-doc_begin=3D"The compiler implementation guarantees that the unreachable =
code is removed.
+Constant expressions and unreachable branches of if and switch statements =
are expected."
+-config=3DMC3R1.R2.1,+reports=3D{safe,"first_area(^.*has an invariantly.*$=
)"}
+-config=3DMC3R1.R2.1,+reports=3D{safe,"first_area(^.*incompatible with lab=
eled statement$)"}
+-doc_end
+
+-doc_begin=3D"Some functions are intended to be not referenced."
+-config=3DMC3R1.R2.1,+reports=3D{deliberate,"first_area(^.*is never refere=
nced$)"}
+-doc_end
+
+-doc_begin=3D"Unreachability in the following macros are expected and safe=
."
+-config=3DMC3R1.R2.1,statements+=3D{safe,"macro(name(BUG||assert_failed||E=
RROR_EXIT||ERROR_EXIT_DOM||PIN_FAIL))"}
+-doc_end
+
+-doc_begin=3D"Proving compliance with respect to Rule 2.2 is generally imp=
ossible:
+see https://arxiv.org/abs/2212.13933 for details. Moreover, peer review gi=
ves us
+confidence that no evidence of errors in the program's logic has been miss=
ed due
+to undetected violations of Rule 2.2, if any. Testing on time behavior giv=
es us
+confidence on the fact that, should the program contain dead code that is =
not
+removed by the compiler, the resulting slowdown is negligible."
+-config=3DMC3R1.R2.2,reports+=3D{disapplied,"any()"}
+-doc_end
+
+#
+# Series 3.
+#
+
+-doc_begin=3D"Comments starting with '/*' and containing hyperlinks are sa=
fe as
+they are not instances of commented-out code."
+-config=3DMC3R1.R3.1,reports+=3D{safe, "first_area(text(^.*https?://.*$))"}
+-doc_end
+
+#
+# Series 4.
+#
+
+-doc_begin=3D"The directive has been accepted only for the ARM codebase."
+-config=3DMC3R1.D4.3,reports+=3D{disapplied,"!(any_area(any_loc(file(^xen/=
arch/arm/arm64/.*$))))"}
+-doc_end
+
+-doc_begin=3D"Depending on the compiler, rewriting the following function-=
like
+macros as inline functions is not guaranteed to have the same effect."
+-config=3DMC3R1.D4.9,macros+=3D{deliberate,"name(likely)"}
+-config=3DMC3R1.D4.9,macros+=3D{deliberate,"name(unlikely)"}
+-config=3DMC3R1.D4.9,macros+=3D{deliberate,"name(unreachable)"}
+-doc_end
+
+-doc_begin=3D"These macros can be used on both pointers and unsigned long =
type values."
+-config=3DMC3R1.D4.9,macros+=3D{safe,"name(virt_to_maddr)"}
+-config=3DMC3R1.D4.9,macros+=3D{safe,"name(virt_to_mfn)"}
+-doc_end
+
+-doc_begin=3D"Rewriting variadic macros as variadic functions might have a=
 negative impact on safety."
+-config=3DMC3R1.D4.9,macros+=3D{deliberate,"variadic()"}
+-doc_end
+
+-doc_begin=3D"Rewriting macros with arguments that are, in turn, arguments=
 of
+__builtin_constant_p() can change the behavior depending on the optimizati=
on
+level."
+-config=3DMC3R1.D4.9,macro_argument_context+=3D"skip_to(class(type||expr||=
decl,any),
+                                            call(name(__builtin_constant_p=
)))"
+-doc_end
+
+-doc_begin=3D"Function-like macros defined in public headers are meant to =
be
+usable in C89 mode without any extensions. Hence they cannot be replaced by
+inline functions."
+-config=3DMC3R1.D4.9,macros+=3D{deliberate, "loc(file(api:public))"}
+-doc_end
+
+-doc_begin=3D"This header file is autogenerated or empty, therefore it pos=
es no
+risk if included more than once."
+-file_tag+=3D{empty_header, "^xen/arch/arm/efi/runtime\\.h$"}
+-file_tag+=3D{autogen_headers, "^xen/include/xen/compile\\.h$||^xen/includ=
e/generated/autoconf.h$||^xen/include/xen/hypercall-defs.h$"}
+-config=3DMC3R1.D4.10,reports+=3D{safe, "all_area(all_loc(file(empty_heade=
r||autogen_headers)))"}
+-doc_end
+
+-doc_begin=3D"Files that are intended to be included more than once do not=
 need to
+conform to the directive."
+-config=3DMC3R1.D4.10,reports+=3D{safe, "first_area(text(^/\\* This file i=
s legitimately included multiple times\\. \\*/$, begin-4))"}
+-config=3DMC3R1.D4.10,reports+=3D{safe, "first_area(text(^/\\* Generated f=
ile, do not edit! \\*/$, begin-3))"}
+-doc_end
+
+#
+# Series 5.
+#
+
+-doc_begin=3D"The project adopted the rule with an exception listed in
+'docs/misra/rules.rst'"
+-config=3DMC3R1.R5.3,reports+=3D{safe, "any_area(any_loc(any_exp(macro(^RE=
AD_SYSREG$))&&any_exp(macro(^WRITE_SYSREG$))))"}
+-config=3DMC3R1.R5.3,reports+=3D{safe, "any_area(any_loc(any_exp(macro(^ma=
x_t$))&&any_exp(macro(^min_t$))))"}
+-config=3DMC3R1.R5.3,reports+=3D{safe, "any_area(any_loc(any_exp(macro(^re=
ad[bwlq]$))&&any_exp(macro(^read[bwlq]_relaxed$))))"}
+-config=3DMC3R1.R5.3,reports+=3D{safe, "any_area(any_loc(any_exp(macro(^pe=
r_cpu$))&&any_exp(macro(^this_cpu$))))"}
+-doc_end
+
+-doc_begin=3D"The identifier 'fdt' is a widely-used name, for which no sui=
table
+substitute can be found. It is understood in 'xen/arch/arm/efi-boot.h' tha=
t the
+static variable 'fdt' cannot be confused with parameter names of the funct=
ion
+declarations that are present in the file."
+-file_tag+=3D{efi_boot_h, "^xen/arch/arm/efi/efi-boot\\.h$"}
+-config=3DMC3R1.R5.3,reports+=3D{deliberate, "any_area(decl(kind(var)&&sta=
tic_storage()&&^fdt$)&&any_loc(file(efi_boot_h)))"}
+-doc_end
+
+-doc_begin=3D"The identifier 'start' is a widely-used name, for which no s=
uitable
+substitute can be found. It is understood in 'xen/include/xen/kernel.h' th=
at the
+extern variable 'start' cannot be confused with omonymous parameter names =
of the
+function declarations where that variable is visible."
+-file_tag+=3D{kernel_h, "^xen/include/xen/kernel\\.h$"}
+-config=3DMC3R1.R5.3,reports+=3D{deliberate, "any_area(decl(kind(var)&&lin=
kage(external)&&^start$)&&any_loc(file(kernel_h)))"}
+-doc_end
+
+-doc_begin=3D"Function-like macros cannot be confused with identifiers tha=
t are
+neither functions nor pointers to functions."
+-config=3DMC3R1.R5.5,reports=3D{safe,"all_area(decl(node(enum_decl||record=
_decl||field_decl||param_decl||var_decl)&&!type(canonical(address((node(fun=
ction||function_no_proto))))))||macro(function_like()))"}
+-doc_end
+
+-doc_begin=3D"The use of these identifiers for both macro names and other =
entities
+is deliberate and does not generate developer confusion."
+-config=3DMC3R1.R5.5,reports+=3D{safe, "any_area(text(^\\s*/\\*\\s+SAF-[0-=
9]+-safe\\s+MC3R1\\.R5\\.5.*$, begin-1))"}
+-doc_end
+
+-doc_begin=3D"The definition of macros and functions ending in '_bit' that=
 use the
+same identifier in 'bitops.h' is deliberate and safe."
+-file_tag+=3D{bitops_h, "^xen/arch/x86/include/asm/bitops\\.h$"}
+-config=3DMC3R1.R5.5,reports+=3D{safe, "all_area((decl(^.*_bit\\(.*$)||mac=
ro(^.*_bit$))&&all_loc(file(bitops_h)))"}
+-doc_end
+
+-doc_begin=3D"The definition of macros and functions beginning in 'str' or=
 'mem'
+that use the same identifier in 'xen/include/xen/string.h' is deliberate a=
nd
+safe."
+-file_tag+=3D{string_h, "^xen/include/xen/string\\.h$"}
+-config=3DMC3R1.R5.5,reports+=3D{safe, "any_area((decl(^(mem|str).*$)||mac=
ro(^(mem|str).*$))&&all_loc(file(string_h)))"}
+-doc_end
+
+#
+# Series 7.
+#
+
+-doc_begin=3D"Usage of the following constants is safe, since they are giv=
en as-is
+in the inflate algorithm specification and there is therefore no risk of t=
hem
+being interpreted as decimal constants."
+-config=3DMC3R1.R7.1,literals=3D{safe, "^0(007|37|070|213|236|300|321|330|=
331|332|333|334|335|337|371)$"}
+-doc_end
+
+-doc_begin=3D"Violations in files that maintainers have asked to not modif=
y in the
+context of R7.2."
+-file_tag+=3D{adopted_r7_2,"^xen/include/xen/libfdt/.*$"}
+-file_tag+=3D{adopted_r7_2,"^xen/arch/x86/include/asm/x86_64/efibind.h$"}
+-file_tag+=3D{adopted_r7_2,"^xen/include/efi/efiapi\\.h$"}
+-file_tag+=3D{adopted_r7_2,"^xen/include/efi/efidef\\.h$"}
+-file_tag+=3D{adopted_r7_2,"^xen/include/efi/efiprot\\.h$"}
+-file_tag+=3D{adopted_r7_2,"^xen/arch/x86/cpu/intel\\.c$"}
+-file_tag+=3D{adopted_r7_2,"^xen/arch/x86/cpu/amd\\.c$"}
+-file_tag+=3D{adopted_r7_2,"^xen/arch/x86/cpu/common\\.c$"}
+-config=3DMC3R1.R7.2,reports+=3D{deliberate,"any_area(any_loc(file(adopted=
_r7_2)))"}
+-doc_end
+
+-doc_begin=3D"Violations caused by __HYPERVISOR_VIRT_START are related to =
the
+particular use of it done in xen_mk_ulong."
+-config=3DMC3R1.R7.2,reports+=3D{deliberate,"any_area(any_loc(macro(name(B=
UILD_BUG_ON))))"}
+-doc_end
+
+-doc_begin=3D"The following string literals are assigned to pointers to non
+const-qualified char."
+-config=3DMC3R1.R7.4,reports+=3D{safe, "any_area(text(^\\s*/\\*\\s+SAF-[0-=
9]+-safe\\s+MC3R1\\.R7\\.4.*$, begin-1))"}
+-doc_end
+
+-doc_begin=3D"Allow pointers of non-character type as long as the pointee =
is
+const-qualified."
+-config=3DMC3R1.R7.4,same_pointee=3Dfalse
+-doc_end
+
+#
+# Series 8.
+#
+
+-doc_begin=3D"The following variables are compiled in multiple translation=
 units
+belonging to different executables and therefore are safe."
+-config=3DMC3R1.R8.6,declarations+=3D{safe, "name(current_stack_pointer||b=
search||sort)"}
+-doc_end
+
+-doc_begin=3D"Declarations without definitions are allowed (specifically w=
hen the
+definition is compiled-out or optimized-out by the compiler)"
+-config=3DMC3R1.R8.6,reports+=3D{deliberate, "first_area(^.*has no definit=
ion$)"}
+-doc_end
+
+-doc_begin=3D"The gnu_inline attribute without static is deliberately allo=
wed."
+-config=3DMC3R1.R8.10,declarations+=3D{deliberate,"property(gnu_inline)"}
+-doc_end
+
+#
+# Series 9.
+#
+
+-doc_begin=3D"The following variables are written before being set, theref=
ore no
+access to uninitialized memory locations happens, as explained in the devi=
ation
+comment."
+-config=3DMC3R1.R9.1,reports+=3D{safe, "any_area(text(^\\s*/\\*\\s+SAF-[0-=
9]+-safe\\s+MC3R1\\.R9\\.1.*$, begin-1))"}
+-doc_end
+
+-doc_begin=3D"Violations in files that maintainers have asked to not modif=
y in the
+context of R9.1."
+-file_tag+=3D{adopted_r9_1,"^xen/arch/arm/arm64/lib/find_next_bit\\.c$"}
+-config=3DMC3R1.R9.1,reports+=3D{deliberate,"any_area(any_loc(file(adopted=
_r9_1)))"}
+-doc_end
+
+-doc_begin=3D"The possibility of committing mistakes by specifying an expl=
icit
+dimension is higher than omitting the dimension."
+-config=3DMC3R1.R9.5,reports+=3D{deliberate, "any()"}
+-doc_end
+
+### Set 2 ###
+
+#
+# Series 10.
+#
+
+-doc_begin=3D"The value-preserving conversions of integer constants are sa=
fe"
+-config=3DMC3R1.R10.1,etypes=3D{safe,"any()","preserved_integer_constant()=
"}
+-config=3DMC3R1.R10.3,etypes=3D{safe,"any()","preserved_integer_constant()=
"}
+-config=3DMC3R1.R10.4,etypes=3D{safe,"any()","preserved_integer_constant()=
||sibling(rhs,preserved_integer_constant())"}
+-doc_end
+
+-doc_begin=3D"Shifting non-negative integers to the right is safe."
+-config=3DMC3R1.R10.1,etypes+=3D{safe,
+  "stmt(node(binary_operator)&&operator(shr))",
+  "src_expr(definitely_in(0..))"}
+-doc_end
+
+-doc_begin=3D"Shifting non-negative integers to the left is safe if the re=
sult is
+still non-negative."
+-config=3DMC3R1.R10.1,etypes+=3D{safe,
+  "stmt(node(binary_operator)&&operator(shl)&&definitely_in(0..))",
+  "src_expr(definitely_in(0..))"}
+-doc_end
+
+-doc_begin=3D"Bitwise logical operations on non-negative integers are safe=
."
+-config=3DMC3R1.R10.1,etypes+=3D{safe,
+  "stmt(node(binary_operator)&&operator(and||or||xor))",
+  "src_expr(definitely_in(0..))"}
+-doc_end
+
+-doc_begin=3D"The implicit conversion to Boolean for logical operator argu=
ments is well known to all Xen developers to be a comparison with 0"
+-config=3DMC3R1.R10.1,etypes+=3D{safe, "stmt(operator(logical)||node(condi=
tional_operator||binary_conditional_operator))", "dst_type(ebool||boolean)"}
+-doc_end
+
+### Set 3 ###
+
+#
+# Series 18.
+#
+
+-doc_begin=3D"FIXME: explain why pointer differences involving this macro =
are safe."
+-config=3DMC3R1.R18.2,reports+=3D{safe,"all_area(all_loc(any_exp(macro(^AC=
PI_PTR_DIFF$))))"}
+-doc_end
+
+-doc_begin=3D"FIXME: explain why pointer differences involving this macro =
are safe."
+-config=3DMC3R1.R18.2,reports+=3D{safe,"all_area(all_loc(any_exp(macro(^pa=
ge_to_mfn$))))"}
+-doc_end
+
+-doc_begin=3D"FIXME: explain why pointer differences involving this macro =
are safe."
+-config=3DMC3R1.R18.2,reports+=3D{safe,"all_area(all_loc(any_exp(macro(^pa=
ge_to_pdx$))))"}
+-doc_end
+
+#
+# Series 20.
+#
+
+-doc_begin=3D"Code violating Rule 20.7 is safe when macro parameters are u=
sed: (1)
+as function arguments; (2) as macro arguments; (3) as array indices; (4) a=
s lhs
+in assignments."
+-config=3DMC3R1.R20.7,expansion_context=3D
+{safe, "context(__call_expr_arg_contexts)"},
+{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(node(arr=
ay_subscript_expr), subscript)))"},
+{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(operator=
(assign), lhs)))"},
+{safe, "left_right(^[(,\\[]$,^[),\\]]$)"}
+-doc_end
+
+#
+# Developer confusion
+#
+
+-doc=3D"Selection for reports that are fully contained in adopted code."
+-report_selector+=3D{adopted_report,"all_area(!kind(culprit||evidence)||al=
l_loc(all_exp(adopted||pseudo)))"}
+
+-doc_begin=3D"Adopted code is not meant to be read, reviewed or modified b=
y human
+programmers:no developers' confusion is not possible. In addition, adopted=
 code
+is assumed to work as is. Reports that are fully contained in adopted code=
 are
+hidden/tagged with the 'adopted' tag."
+-service_selector=3D{developer_confusion_guidelines,"^(MC3R1\\.R2\\.1|MC3R=
1\\.R2\\.2|MC3R1\\.R2\\.3|MC3R1\\.R2\\.4|MC3R1\\.R2\\.5|MC3R1\\.R2\\.6|MC3R=
1\\.R2\\.7|MC3R1\\.R4\\.1|MC3R1\\.R5\\.3|MC3R1\\.R5\\.6|MC3R1\\.R5\\.7|MC3R=
1\\.R5\\.8|MC3R1\\.R5\\.9|MC3R1\\.R7\\.1|MC3R1\\.R7\\.2|MC3R1\\.R7\\.3|MC3R=
1\\.R8\\.7|MC3R1\\.R8\\.8|MC3R1\\.R8\\.9|MC3R1\\.R8\\.11|MC3R1\\.R8\\.12|MC=
3R1\\.R8\\.13|MC3R1\\.R9\\.3|MC3R1\\.R9\\.4|MC3R1\\.R9\\.5|MC3R1\\.R10\\.2|=
MC3R1\\.R10\\.5|MC3R1\\.R10\\.6|MC3R1\\.R10\\.7|MC3R1\\.R10\\.8|MC3R1\\.R11=
\\.9|MC3R1\\.R12\\.1|MC3R1\\.R12\\.3|MC3R1\\.R12\\.4|MC3R1\\.R13\\.5|MC3R1\=
\.R14\\.1|MC3R1\\.R14\\.2|MC3R1\\.R14\\.3|MC3R1\\.R15\\.1|MC3R1\\.R15\\.2|M=
C3R1\\.R15\\.3|MC3R1\\.R15\\.4|MC3R1\\.R15\\.5|MC3R1\\.R15\\.6|MC3R1\\.R15\=
\.7|MC3R1\\.R16\\.1|MC3R1\\.R16\\.2|MC3R1\\.R16\\.3|MC3R1\\.R16\\.4|MC3R1\\=
.R16\\.5|MC3R1\\.R16\\.6|MC3R1\\.R16\\.7|MC3R1\\.R17\\.7|MC3R1\\.R17\\.8|MC=
3R1\\.R18\\.4|MC3R1\\.R18\\.5)$"
+}
+-config=3Ddeveloper_confusion_guidelines,reports+=3D{relied,adopted_report}
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/out_of_scope.ecl b/automatio=
n/eclair_analysis/ECLAIR/out_of_scope.ecl
new file mode 100644
index 0000000000..44db6997b5
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/out_of_scope.ecl
@@ -0,0 +1,127 @@
+-doc_begin=3D"Imported from Linux: ignore for now."
+-file_tag+=3D{adopted,"^xen/common/libfdt/.*$"}
+-file_tag+=3D{adopted,"^xen/include/xen/libfdt/.*$"}
+-file_tag+=3D{adopted,"^xen/common/xz/.*$"}
+-file_tag+=3D{adopted,"^xen/common/zstd/.*$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/apei/.*$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/tables/.*$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/utilities/.*$"}
+-file_tag+=3D{adopted,"^xen/drivers/video/font_.*$"}
+-file_tag+=3D{adopted,"^xen/arch/arm/arm64/cpufeature\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/arm/arm64/insn\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/arm/arm64/lib/find_next_bit\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/bitmap\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/bunzip2\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/earlycpio\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/inflate\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/lzo\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/lz4/decompress\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/radix-tree\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/ubsan/ubsan\\.c$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/hwregs\\.c$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/numa\\.c$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/osl\\.c$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/tables\\.c$"}
+-file_tag+=3D{adopted,"^xen/lib/list-sort\\.c$"}
+-file_tag+=3D{adopted,"^xen/lib/rbtree\\.c$"}
+-file_tag+=3D{adopted,"^xen/lib/xxhash.*\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/acpi/boot\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/acpi/cpu_idle\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/acpi/cpufreq/cpufreq\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/acpi/cpuidle_menu\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/acpi/lib\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/amd\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/centaur\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/common\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/hygon\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/intel\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/intel_cacheinfo\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/mcheck/non-fatal\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/mtrr/.*$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/mwait-idle\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/delay\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/dmi_scan\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/mpparse\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/srat\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/time\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/x86_64/mmconf-fam10h\\.c$"}
+-doc_end
+
+-doc_begin=3D"Intel specific source files are out of scope."
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/intel\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/intel_cacheinfo\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/microcode/intel\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/shanghai\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/hvm/vmx/.*$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/include/asm/hvm/vmx/.*$"}
+-file_tag+=3D{out_of_scope,"^xen/drivers/passthrough/vtd/.*$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/mcheck/mce_intel\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/mwait-idle\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/vpmu_intel\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/tsx\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/mm/altp2m\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/mm/p2m-ept\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/mm/hap/nested_ept\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/include/asm/altp2m\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/include/asm/intel-family\\.h$"}
+-doc_end
+
+-doc_begin=3D"Not in scope initially as it generates many violations and i=
t is not enabled in safety configurations."
+-file_tag+=3D{adopted,"^xen/xsm/flask/.*$"}
+-doc_end
+
+-doc_begin=3D"unlz4.c implementation by Yann Collet, the others un* are fr=
om Linux, ignore for now."
+-file_tag+=3D{adopted,"^xen/common/un.*\\.c$"}
+-doc_end
+
+-doc_begin=3D"Origin is external and documented in xen/crypto/README.sourc=
e ."
+-file_tag+=3D{adopted,"^xen/crypto/.*$"}
+-doc_end
+
+-doc_begin=3D"Files imported from the gnu-efi package"
+-file_tag+=3D{adopted,"^xen/include/efi/.*$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/include/asm/x86_64/efibind\\.h$"}
+-doc_end
+
+-doc_begin=3D"Build tools are out of scope."
+-file_tag+=3D{out_of_scope_tools,"^xen/tools/.*$"}
+-file_tag+=3D{out_of_scope_tools,"^xen/arch/x86/efi/mkreloc\\.c$"}
+-file_tag+=3D{out_of_scope_tools,"^xen/arch/x86/boot/mkelf32\\.c$"}
+-doc_end
+
+-doc_begin=3D"Out of scope headers."
+-file_tag+=3D{out_of_scope,"^xen/include/xen/bitmap\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/earlycpio\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/lzo\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/lz4\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/common/lz4/defs\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/radix-tree\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/list_sort\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/rbtree\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/xxhash\\.h$"}
+-doc_end
+
+-doc_begin=3D"Headers under xen/include/public/ are the description of the=
 public
+hypercall ABI so the community is extremely conservative in making changes
+there, because the interface is maintained for backward compatibility: ign=
ore
+for now."
+-file_tag+=3D{hypercall_ABI, "^xen/include/public/.*$"}
+-source_files+=3D{hide, hypercall_ABI}
+-doc_end
+
+-doc_begin=3D"Consider out-of-scope files external to the project."
+-file_tag+=3D{external, out_of_scope}
+-doc_end
+
+-doc_begin=3D"Consider adopted files external to the project."
+-file_tag+=3D{external, adopted}
+-doc_end
+
+-doc_begin=3D"Disregard out-of-scope tools."
+-frames+=3D{hide,"main(out_of_scope_tools)"}
+-doc_end
+
+-doc_begin=3D"The build performs speculative calls with target /dev/null: =
this
+frames should be ignored."
+-frames+=3D{hide,"target(^/dev/null$)"}
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/print_analyzed_files.sh b/au=
tomation/eclair_analysis/ECLAIR/print_analyzed_files.sh
new file mode 100755
index 0000000000..163228ea96
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/print_analyzed_files.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+# Stop immediately if any executed command has exit status different from =
0.
+set -eux
+
+script_name=3D"$(basename "$0")"
+script_dir=3D"$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null =
&& pwd )"
+
+fatal() {
+  echo "${script_name}: $*" >&2
+  exit 1
+}
+
+usage() {
+  fatal "Usage: ${script_name} DATABASE OUT_DIR"
+}
+
+extrapolate_regex() {
+  lookbehind=3D$1
+  file=3D$2
+  grep -Po "(?<=3D${lookbehind}\"\\^).*(?=3D\\$\")" "${file}" | sed 's/\\\=
\/\\/'
+}
+
+if [ $# -lt 2 ]; then
+  usage
+fi
+
+DB=3D$1
+OUT_DIR=3D$2
+
+files_txt=3D"${OUT_DIR}/files.txt"
+files_c_txt=3D"${OUT_DIR}/files_c.txt"
+files_h_txt=3D"${OUT_DIR}/files_h.txt"
+exclusions_txt=3D"${OUT_DIR}/exclusions.txt"
+
+
+if [[ ! -d "${OUT_DIR}" ]]; then
+  mkdir -p "${OUT_DIR}"
+else
+  rm -f "${files_txt}"
+  rm -f "${files_c_txt}"
+  rm -f "${files_h_txt}"
+  rm -f "${exclusions_txt}"
+fi
+
+# Generating txt report with files
+"${ECLAIR_BIN_DIR}eclair_report" -db=3D"${DB}" -files_txt=3D"${files_txt}"
+
+{
+  # Extracting out of scope code
+  out_of_scope_ecl=3D"${script_dir}/out_of_scope.ecl"
+  extrapolate_regex adopted,             "${out_of_scope_ecl}"
+  extrapolate_regex out_of_scope_tools,  "${out_of_scope_ecl}"
+  extrapolate_regex out_of_scope,        "${out_of_scope_ecl}"
+  extrapolate_regex hypercall_ABI,       "${out_of_scope_ecl}"
+  extrapolate_regex "hide, "             "${out_of_scope_ecl}"
+} >"${exclusions_txt}"
+sort -o "${exclusions_txt}" -u "${exclusions_txt}"
+
+# Removing exclusions from files_txt
+grep -E -v "(object: |/dev/pipe)" "${files_txt}" > "${files_txt}.tmp"
+grep -vf "${exclusions_txt}" "${files_txt}.tmp" > "${files_txt}"
+rm "${files_txt}.tmp"
+# Creating files with only headers
+grep -Ev "(xen.*\.(h\w+|[^h]\w*) |.*ecl)" "${files_txt}" > "${files_h_txt}"
+# Creating files with only c files
+grep -Ev "(xen.*\.(c\w+|[^c]\w*) |.*ecl)" "${files_txt}" > "${files_c_txt}"
diff --git a/automation/eclair_analysis/ECLAIR/public_APIs.ecl b/automation=
/eclair_analysis/ECLAIR/public_APIs.ecl
new file mode 100644
index 0000000000..9701a295e6
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/public_APIs.ecl
@@ -0,0 +1,6 @@
+# Definition of the public APIs.
+
+-doc=3D"All Xen public headers."
+-file_tag+=3D{api:public,"^xen/include/public/.*\\.h$"}
+
+-public_files+=3Dapi:public
diff --git a/automation/eclair_analysis/ECLAIR/report.ecl b/automation/ecla=
ir_analysis/ECLAIR/report.ecl
new file mode 100644
index 0000000000..6ee324746c
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/report.ecl
@@ -0,0 +1,4 @@
+# eclair_report
+
+reports_codeclimate("gl-code-quality-report.json")
+
diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/ecl=
air_analysis/ECLAIR/tagging.ecl
new file mode 100644
index 0000000000..ef2e56e186
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
@@ -0,0 +1,34 @@
+-doc=3D"Hide reports marked as compliant."
+-remap_rtag=3D{compliant,hide}
+
+-doc=3D"Hide reports marked as safe."
+-remap_rtag=3D{safe,hide}
+
+-doc=3D"Hide reports marked as relied."
+-remap_rtag=3D{relied,hide}
+
+-doc=3D"Hide reports marked as deliberate."
+-remap_rtag=3D{deliberate,hide}
+
+-doc=3D"Hide reports marked as disapplied."
+-remap_rtag=3D{disapplied,hide}
+
+#######################
+# Accepted guidelines #
+#######################
+
+-doc=3D"Accepted guidelines as reported in XEN/docs/misra/rules.rst"
+-service_selector=3D{accepted_guidelines,"^(MC3R1\\.D1\\.1|MC3R1\\.D2\\.1|=
MC3R1\\.D4\\.3|MC3R1\\.D4\\.7|MC3R1\\.D4\\.10|MC3R1\\.D4\\.11|MC3R1\\.D4\\.=
14|MC3R1\\.R1\\.1|MC3R1\\.R1\\.3|MC3R1\\.R1\\.4|MC3R1\\.R2\\.1|MC3R1\\.R2\\=
.6|MC3R1\\.R2\\.2|MC3R1\\.R3\\.1|MC3R1\\.R3\\.2|MC3R1\\.R4\\.1|MC3R1\\.R4\\=
.2|MC3R1\\.R5\\.1|MC3R1\\.R5\\.2|MC3R1\\.R5\\.3|MC3R1\\.R5\\.4|MC3R1\\.R5\\=
.6|MC3R1\\.R6\\.1|MC3R1\\.R6\\.2|MC3R1\\.R7\\.1|MC3R1\\.R7\\.2|MC3R1\\.R7\\=
.3|MC3R1\\.R7\\.4|MC3R1\\.R8\\.1|MC3R1\\.R8\\.2|MC3R1\\.R8\\.3|MC3R1\\.R8\\=
.4|MC3R1\\.R8\\.5|MC3R1\\.R8\\.6|MC3R1\\.R8\\.8|MC3R1\\.R8\\.10|MC3R1\\.R8\=
\.12|MC3R1\\.R8\\.14|MC3R1\\.R9\\.1|MC3R1\\.R9\\.2|MC3R1\\.R9\\.3|MC3R1\\.R=
9\\.4|MC3R1\\.R9\\.5|MC3R1\\.R12\\.5|MC3R1\\.R13\\.6|MC3R1\\.R13\\.1|MC3R1\=
\.R14\\.1|MC3R1\\.R16\\.7|MC3R1\\.R17\\.3|MC3R1\\.R17\\.4|MC3R1\\.R17\\.6|M=
C3R1\\.R18\\.3|MC3R1\\.R19\\.1|MC3R1\\.R20\\.7|MC3R1\\.R20\\.13|MC3R1\\.R20=
\\.14|MC3R1\\.R21\\.13|MC3R1\\.R21\\.17|MC3R1\\.R21\\.18|MC3R1\\.R21\\.19|M=
C3R1\\.R21\\.20|MC3R1\\.R21\\.21|MC3R1\\.R22\\.2|MC3R1\\.R22\\.4|MC3R1\\.R2=
2\\.5|MC3R1\\.R22\\.6)$"
+}
+-doc=3D"All reports of accepted guidelines are tagged as accepted."
+-reports+=3D{status:accepted,"service(accepted_guidelines)"}
+
+####################
+# Clean guidelines #
+####################
+
+-doc_begin=3D"Clean guidelines: new violations for these guidelines are no=
t accepted."
+-service_selector=3D{clean_guidelines,"^(MC3R1\\.D1\\.1|MC3R1\\.D2\\.1|MC3=
R1\\.D4\\.11|MC3R1\\.D4\\.14|MC3R1\\.R1\\.4|MC3R1\\.R2\\.2|MC3R1\\.R3\\.2|M=
C3R1\\.R5\\.1|MC3R1\\.R5\\.2|MC3R1\\.R5\\.4|MC3R1\\.R6\\.1|MC3R1\\.R6\\.2|M=
C3R1\\.R7\\.1|MC3R1\\.R8\\.1|MC3R1\\.R8\\.5|MC3R1\\.R8\\.8|MC3R1\\.R8\\.10|=
MC3R1\\.R8\\.12|MC3R1\\.R8\\.14|MC3R1\\.R9\\.2|MC3R1\\.R9\\.4|MC3R1\\.R9\\.=
5|MC3R1\\.R12\\.5|MC3R1\\.R17\\.3|MC3R1\\.R17\\.6|MC3R1\\.R21\\.13|MC3R1\\.=
R21\\.19|MC3R1\\.R21\\.21|MC3R1\\.R22\\.2|MC3R1\\.R22\\.4|MC3R1\\.R22\\.5)$"
+}
+-reports+=3D{clean:added,"service(clean_guidelines)"}
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/toolchain.ecl b/automation/e=
clair_analysis/ECLAIR/toolchain.ecl
new file mode 100644
index 0000000000..e6cd289b5e
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/toolchain.ecl
@@ -0,0 +1,275 @@
+# Compilers.
+-file_tag+=3D{GCC_ARM64,"^/usr/bin/aarch64-linux-gnu-gcc-12$"}
+-file_tag+=3D{GCC_X86_64,"^/usr/bin/x86_64-linux-gnu-gcc-12$"}
+
+# Manuals.
+-setq=3DGCC_MANUAL,"https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc.pdf"
+-setq=3DCPP_MANUAL,"https://gcc.gnu.org/onlinedocs/gcc-12.1.0/cpp.pdf"
+-setq=3DARM64_ABI_MANUAL,"https://github.com/ARM-software/abi-aa/blob/60a8=
eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs64/aapcs64.rst"
+-setq=3DX86_64_ABI_MANUAL,"https://gitlab.com/x86-psABIs/x86-64-ABI/-/jobs=
/artifacts/master/raw/x86-64-ABI/abi.pdf?job=3Dbuild"
+-setq=3DARM64_LIBC_MANUAL,"https://www.gnu.org/software/libc/manual/pdf/li=
bc.pdf"
+-setq=3DX86_64_LIBC_MANUAL,"https://www.gnu.org/software/libc/manual/pdf/l=
ibc.pdf"
+-setq=3DC99_STD,"ISO/IEC 9899:1999"
+
+-doc_begin=3D"
+    _Static_assert: see Section \"2.1 C Language\" of "GCC_MANUAL".
+    asm, __asm__: see Sections \"6.48 Alternate Keywords\" and \"6.47 How =
to Use Inline Assembly Language in C Code\" of "GCC_MANUAL".
+    __volatile__: see Sections \"6.48 Alternate Keywords\" and \"6.47.2.1 =
Volatile\" of "GCC_MANUAL".
+    __const__, __inline__, __inline: see Section \"6.48 Alternate Keywords=
\" of "GCC_MANUAL".
+    typeof, __typeof__: see Section \"6.7 Referring to a Type with typeof\=
" of "GCC_MANUAL".
+    __alignof__, __alignof: see Sections \"6.48 Alternate Keywords\" and \=
"6.44 Determining the Alignment of Functions, Types or Variables\" of "GCC_=
MANUAL".
+    __attribute__: see Section \"6.39 Attribute Syntax\" of "GCC_MANUAL".
+    __builtin_types_compatible_p: see Section \"6.59 Other Built-in Functi=
ons Provided by GCC\" of "GCC_MANUAL".
+    __builtin_va_arg: non-documented GCC extension.
+    __builtin_offsetof: see Section \"6.53 Support for offsetof\" of "GCC_=
MANUAL".
+"
+-config=3DSTD.tokenext,behavior+=3D{c99, GCC_ARM64, "^(_Static_assert|asm|=
__asm__|__volatile__|__const__|__inline__|typeof|__typeof__|__alignof__|__a=
ttribute__|__builtin_types_compatible_p|__builtin_va_arg|__builtin_offsetof=
)$"}
+-config=3DSTD.tokenext,behavior+=3D{c99, GCC_X86_64, "^(_Static_assert|asm=
|__asm__|__volatile__|__const__|__inline__|__inline|typeof|__typeof__|__ali=
gnof__|__alignof|__attribute__|__builtin_types_compatible_p|__builtin_va_ar=
g|__builtin_offsetof)$"}
+-doc_end
+
+-doc_begin=3D"Non-documented GCC extension."
+-config=3DSTD.emptinit,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.emptinit,behavior+=3D{c99,GCC_X86_64,specified}
+#-config=3DSTD.emptinit,behavior+=3D{c18,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.24 Arithmetic on void- and Function-Pointers=
\" of "GCC_MANUAL"."
+-config=3DSTD.vptrarth,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.vptrarth,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.1 Statements and Declarations in Expressions=
\" of "GCC_MANUAL"."
+-config=3DSTD.stmtexpr,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.stmtexpr,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.19 Structures with No Members\" of "GCC_MANU=
AL"."
+-config=3DSTD.emptrecd,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.emptrecd,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.18 Arrays of Length Zero\" of "GCC_MANUAL"."
+-config=3DSTD.arayzero,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.arayzero,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.8 Conditionals with Omitted Operands\" of "G=
CC_MANUAL"."
+-config=3DSTD.bincondl,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.bincondl,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.30 Case Ranges\" of "GCC_MANUAL"."
+-config=3DSTD.caseuplw,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.caseuplw,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.63 Unnamed Structure and Union Fields\" of "=
GCC_MANUAL"."
+-config=3DSTD.anonfild,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.anonfild,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"Non-documented GCC extension."
+-config=3DSTD.emptdecl,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.emptdecl,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"Non-documented GCC extension."
+-config=3DSTD.emptenum,behavior+=3D{c99,GCC_ARM64,specified}
+-doc_end
+
+-doc_begin=3D"Non-documented GCC extension."
+-config=3DSTD.pteincmp,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.pteincmp,behavior+=3D{c99,GCC_X86_64,specified}
+#-config=3DSTD.pteincmp,behavior+=3D{c18,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"Non-documented GCC extension."
+-config=3DSTD.funojptr,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"
+    ext_paste_comma: see Section \"6.21 Macros with a Variable Number of A=
rguments\" of "GCC_MANUAL".
+    ext_missing_varargs_arg: see Section \"6.21 Macros with a Variable Num=
ber of Arguments\" of "GCC_MANUAL".
+    ext_named_variadic_macro: see Section \"6.21 Macros with a Variable Nu=
mber of Arguments\" of "GCC_MANUAL".
+    ext_return_has_void_expr: see the documentation for -Wreturn-type in S=
ection \"3.8 Options to Request or Suppress Warnings\" of "GCC_MANUAL".
+    ext_gnu_statement_expr_macro: see Section \"6.1 Statements and Declara=
tions in Expressions\" of "GCC_MANUAL".
+    ext_sizeof_alignof_void_type: see Section \"6.24 Arithmetic on void- a=
nd Function-Pointers\" of "GCC_MANUAL".
+    ext_forward_ref_enum_def: see Section \"6.49 Incomplete enum Types\" o=
f "GCC_MANUAL".
+    ext_flexible_array_in_struct: see Section \"6.18 Arrays of Length Zero=
\" of "GCC_MANUAL".
+    ext_flexible_array_in_array: see Section \"6.18 Arrays of Length Zero\=
" of "GCC_MANUAL".
+    ext_enum_value_not_int: non-documented GCC extension.
+    ext_gnu_array_range: see Section \"6.29 Designated Initializers\" of "=
GCC_MANUAL".
+"
+-config=3DSTD.diag,behavior+=3D{c99,GCC_ARM64,"^(ext_paste_comma|ext_missi=
ng_varargs_arg|ext_named_variadic_macro|ext_return_has_void_expr|ext_gnu_st=
atement_expr_macro|ext_sizeof_alignof_void_type|ext_forward_ref_enum_def|ex=
t_gnu_array_range)$"}
+-config=3DSTD.diag,behavior+=3D{c99,GCC_X86_64,"^(ext_paste_comma|ext_miss=
ing_varargs_arg|ext_named_variadic_macro|ext_return_has_void_expr|ext_gnu_s=
tatement_expr_macro|ext_sizeof_alignof_void_type|ext_flexible_array_in_stru=
ct|ext_flexible_array_in_array|ext_enum_value_not_int|ext_gnu_array_range)$=
"}
+-doc_end
+
+-doc_begin=3D"The maximum size of an object is defined in the MAX_SIZE mac=
ro, and for a 32 bit architecture is 8MB.
+    The maximum size for an array is defined in the PTRDIFF_MAX and in a 3=
2 bit architecture is 2^30-1.
+    See occurrences of these macros in "GCC_MANUAL"."
+-config=3DSTD.byteobjt,behavior+=3D{c99, GCC_ARM64, 8388608}
+-config=3DSTD.byteobjt,behavior+=3D{c99, GCC_X86_64, 8388608}
+-doc_end
+
+-doc_begin=3D"See Section \"11.2 Implementation limits\" of "CPP_MANUAL"."
+-config=3DSTD.charline,behavior+=3D{c99, GCC_ARM64, 5000}
+-config=3DSTD.charline,behavior+=3D{c99, GCC_X86_64, 12000}
+-doc_end
+
+-doc_begin=3D"See Section \"11.2 Implementation limits\" of "CPP_MANUAL"."
+-config=3DSTD.inclnest,behavior+=3D{c99, GCC_ARM64, 24}
+-config=3DSTD.inclnest,behavior+=3D{c99, GCC_X86_64, 32}
+-doc_end
+
+-doc_begin=3D"FIXME: why is C90 used?"
+-config=3DSTD.ppifnest,behavior+=3D{c90, GCC_X86_64, 32}
+-doc_end
+
+-doc_begin=3D"See Section \"4.12 Statements\" of "GCC_MANUAL"."
+-config=3DSTD.caselimt,behavior+=3D{c99, GCC_X86_64, 1500}
+-doc_end
+
+-doc_begin=3D"See Section \"6.9 128-bit Integers\" of "GCC_MANUAL"."
+-config=3DSTD.stdtypes,behavior+=3D{c99, GCC_X86_64, "__uint128_t"}
+-doc_end
+
+-doc_begin=3D"FIXME: Non-documented GCC extension?"
+-config=3DSTD.charescp,behavior=3D{c99, GCC_X86_64, "^m$"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.9 Structures, Unions, Enumerations, and Bit-=
Fields\" of "GCC_MANUAL"."
+-config=3DSTD.bitfldtp, +behavior=3D{c99, GCC_ARM64, "unsigned char;unsign=
ed short;unsigned long;unsigned long long"}
+-config=3DSTD.bitfldtp, +behavior=3D{c99, GCC_X86_64, "unsigned char;unsig=
ned short;unsigned long;enum"}
+-doc_end
+
+-doc_begin=3D"
+    #pragma pack: see Section \"6.62.11 Structure-Layout Pragmas\" of "GCC=
_MANUAL".
+    #pragma GCC visibility: see Section \"6.62.14 Visibility Pragmas\" of =
"GCC_MANUAL".
+"
+-config=3DSTD.nonstdc,behavior=3D{c99, GCC_ARM64, "^(pack\\(|GCC visibilit=
y (push|pop)).*$"}
+-config=3DSTD.nonstdc,behavior=3D{c99, GCC_X86_64, "^(pack\\(|GCC visibili=
ty (push|pop)).*$"}
+-doc_end
+
+-doc_begin=3D"See Section \"1.1 Character sets\" of "CPP_MANUAL".  We assu=
me the locale is not restricting any UTF-8 characters being part of the sou=
rce character set."
+-config=3DSTD.charset,behavior=3D{c99, GCC_ARM64, "utf8"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.3 Identifiers\" of "GCC_MANUAL"."
+-config=3DSTD.extidsig, behavior+=3D{c99, GCC_ARM64, "63"}
+-config=3DSTD.extidsig, behavior+=3D{c99, GCC_X86_64, "63"}
+-doc_end
+
+#
+# Documentation for relied-upon implementation-defined behaviors (Dir 1.1)
+#
+
+-doc_begin=3D"See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \=
"8.1 Data types\" of "ARM64_ABI_MANUAL"."
+-config=3DSTD.bytebits,behavior=3D{c99, GCC_ARM64, "8"}
+-config=3DSTD.charsobj,behavior=3D{c99, GCC_ARM64, "utf8"}
+-config=3DSTD.charsval,behavior=3D{c99, GCC_ARM64, "utf8"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \=
"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
+-config=3DSTD.bytebits,behavior=3D{c99, GCC_X86_64, "8"}
+-config=3DSTD.charsobj,behavior=3D{c99, GCC_X86_64, "utf8"}
+-config=3DSTD.charsval,behavior=3D{c99, GCC_X86_64, "utf8"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.4 Characters\" of "GCC_MANUAL" and the docum=
entation for -finput-charset=3Dcharset in the same manual."
+-config=3DSTD.charsmap,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.charsmap,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.4 Characters\" of "GCC_MANUAL" and the docum=
entation for -fexec-charset=3Dcharset and -finput-charset=3Dcharset in the =
same manual."
+-config=3DSTD.charsmem,behavior=3D{c99, GCC_ARM64, "utf8"}
+-config=3DSTD.charsmem,behavior=3D{c99, GCC_X86_64, "utf8"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.1 Translation\" of "GCC_MANUAL"."
+-config=3DSTD.diagidnt,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.diagidnt,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.4 Characters\" of "GCC_MANUAL" and the docum=
entation for -fexec-charset=3Dcharset in the same manual."
+-config=3DSTD.execvals,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.execvals,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"Given that Xen is compiled in hosted mode, ECLAIR cannot exc=
lude the independency from program termination implementation-defined behav=
ior.  See \"Section 25.7 Program Termination\" of "ARM64_LIBC_MANUAL"."
+-config=3DSTD.exitstat,behavior=3D{c99, GCC_ARM64, "specified"}
+-doc_end
+
+-doc_begin=3D"Given that Xen is compiled in hosted mode, ECLAIR cannot exc=
lude the independency from program termination implementation-defined behav=
ior.  See \"Section 25.7 Program Termination\" of "X86_64_LIBC_MANUAL"."
+-config=3DSTD.exitstat,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Chapter \"2 Header Files\" of "CPP_MANUAL"."
+-config=3DSTD.inclangl,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.inclangl,behavior=3D{c99, GCC_X86_64, "specified"}
+-config=3DSTD.inclfile,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.inclfile,behavior=3D{c99, GCC_X86_64, "specified"}
+-config=3DSTD.inclhead,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.inclhead,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.5 Integers\" of "GCC_MANUAL"."
+-config=3DSTD.signdint,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.signdint,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.15 Architecture\" of "GCC_MANUAL" and Chapte=
r \"5   Data types and alignment\" of "ARM64_ABI_MANUAL"."
+-config=3DSTD.objbytes,behavior=3D{c99, GCC_ARM64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.15 Architecture\" of "GCC_MANUAL" and Sectio=
n \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
+-config=3DSTD.objbytes,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"3.4 Stringizing\" of "CPP_MANUAL"."
+-config=3DSTD.stringfy,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.stringfy,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.9 Structures, Unions, Enumerations, and Bit-=
Fields\"
+ of "GCC_MANUAL" and Section \"8.1.8 Bit-fields\" of "ARM64_ABI_MANUAL"."
+-config=3DSTD.bitfldby,+behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.bitfldor,+behavior=3D{c99, GCC_ARM64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.9 Structures, Unions, Enumerations, and Bit-=
Fields\"
+ of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_=
MANUAL"."
+-config=3DSTD.bitfldby,+behavior=3D{c99, GCC_X86_64, "specified"}
+-config=3DSTD.bitfldor,+behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.10 Qualifiers\" of "GCC_MANUAL"."
+-config=3DSTD.volatltp,+behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.volatltp,+behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.15 Architecture\" of "GCC_MANUAL" and Chapte=
r \"5   Data types and alignment\" of "ARM64_ABI_MANUAL"."
+-config=3DSTD.stdmacro,behavior=3D{c99, GCC_ARM64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.15 Architecture\" of "GCC_MANUAL" and Sectio=
n \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
+-config=3DSTD.stdmacro,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \=
"11.1 Implementation-defined behavior\" of "CPP_MANUAL"."
+-config=3DSTD.widestng,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.widestng,behavior=3D{c99, GCC_X86_64, "specified"}
+-config=3DSTD.multbtsl,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.13 Preprocessing Directives\" of "GCC_MANUAL=
" and Section \"7 Pragmas\" of "CPP_MANUAL"."
+-config=3DSTD.pragmdir,behavior=3D{c99, GCC_ARM64, "^(pack\\(|GCC visibili=
ty (push|pop)).*$"}
+-config=3DSTD.pragmdir,behavior=3D{c99, GCC_X86_64, "^(pack\\(|GCC visibil=
ity (push|pop)).*$"}
+-doc_end
+
+-doc_begin=3D"See Section \"6.9 128-bit Integers\" of "GCC_MANUAL"."
+-config=3DSTD.extinttp,behavior=3D{c99, GCC_X86_64, "__uint128_t"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.13 Preprocessing Directives\" of "GCC_MANUAL=
" and Section \"11.1 Implementation-defined behavior\" of "CPP_MANUAL"."
+-config=3DSTD.inclexpd,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
diff --git a/automation/eclair_analysis/Makefile.prepare b/automation/eclai=
r_analysis/Makefile.prepare
new file mode 100644
index 0000000000..90f4a31172
--- /dev/null
+++ b/automation/eclair_analysis/Makefile.prepare
@@ -0,0 +1,6 @@
+include Makefile
+prepare:
+	$(Q)$(MAKE) $(build)=3Dtools
+	$(Q)$(MAKE) $(build)=3D. include/xen/compile.h
+	$(Q)$(MAKE) $(build)=3Dinclude all
+	$(Q)$(MAKE) $(build)=3Darch/$(SRCARCH) include
diff --git a/automation/eclair_analysis/build.sh b/automation/eclair_analys=
is/build.sh
new file mode 100755
index 0000000000..ec087dd822
--- /dev/null
+++ b/automation/eclair_analysis/build.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+# Stop immediately if any executed command has exit status different from =
0.
+set -e
+
+script_name=3D"$(basename "$0")"
+
+fatal() {
+  echo "${script_name}: $*" >&2
+  exit 1
+}
+
+usage() {
+  fatal "Usage: ${script_name} <ARM64|X86_64>"
+}
+
+if [ $# -ne 1 ]; then
+  usage
+fi
+
+if [ "$1" =3D "X86_64" ]; then
+  export CROSS_COMPILE=3D
+  export XEN_TARGET_ARCH=3Dx86_64
+elif [ "$1" =3D "ARM64" ]; then
+  export CROSS_COMPILE=3Daarch64-linux-gnu-
+  export XEN_TARGET_ARCH=3Darm64
+else
+  fatal "Unknown configuration: $1"
+fi
+
+if [[ -f /proc/cpuinfo ]]; then
+  PROCESSORS=3D$(grep -c ^processor /proc/cpuinfo)
+else
+  PROCESSORS=3D6
+fi
+
+(
+  cd xen
+
+  make "-j${PROCESSORS}" "-l${PROCESSORS}.0"    \
+       "CROSS_COMPILE=3D${CROSS_COMPILE}"         \
+       "CC=3D${CROSS_COMPILE}gcc-12"              \
+       "CXX=3D${CROSS_COMPILE}g++-12"             \
+       "XEN_TARGET_ARCH=3D${XEN_TARGET_ARCH}"
+)
diff --git a/automation/eclair_analysis/prepare.sh b/automation/eclair_anal=
ysis/prepare.sh
new file mode 100755
index 0000000000..275a1a3f51
--- /dev/null
+++ b/automation/eclair_analysis/prepare.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+# Stop immediately if any executed command has exit status different from =
0.
+set -e
+
+script_name=3D"$(basename "$0")"
+script_dir=3D"$(
+  cd "$(dirname "$0")"
+  echo "${PWD}"
+)"
+
+fatal() {
+  echo "${script_name}: $*" >&2
+  exit 1
+}
+
+usage() {
+  fatal "Usage: ${script_name}"
+}
+
+if [ $# -ne 1 ]; then
+  usage
+  exit 1
+fi
+
+export XEN_TARGET_ARCH
+
+if [ "$1" =3D "X86_64" ]; then
+  CONFIG_FILE=3D"${script_dir}/xen_x86_config"
+  XEN_TARGET_ARCH=3Dx86_64
+elif [ "$1" =3D "ARM64" ]; then
+  CONFIG_FILE=3D"${script_dir}/xen_arm_config"
+  XEN_TARGET_ARCH=3Darm64
+else
+  fatal "Unknown configuration: $1"
+fi
+
+(
+    cd xen
+    cp "${CONFIG_FILE}" .config
+    make clean
+    make -f ${script_dir}/Makefile.prepare prepare
+)
diff --git a/automation/eclair_analysis/xen_arm_config b/automation/eclair_=
analysis/xen_arm_config
new file mode 100644
index 0000000000..82102b889e
--- /dev/null
+++ b/automation/eclair_analysis/xen_arm_config
@@ -0,0 +1,147 @@
+# File provided in=0D
+# Re: Xen MISRA C: Source files in scope and out of scope=0D
+# from:	Stefano Stabellini <stefano.stabellini@amd.com>=0D
+# date:	6 giu 2023, 02:53=0D
+=0D
+#=0D
+# Automatically generated file; DO NOT EDIT.=0D
+# Xen/arm 4.18-unstable Configuration=0D
+#=0D
+CONFIG_CC_IS_GCC=3Dy=0D
+CONFIG_GCC_VERSION=3D90400=0D
+CONFIG_CLANG_VERSION=3D0=0D
+CONFIG_LD_IS_GNU=3Dy=0D
+CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE=3Dy=0D
+CONFIG_ARM_64=3Dy=0D
+CONFIG_ARM=3Dy=0D
+CONFIG_ARCH_DEFCONFIG=3D"arch/arm/configs/arm64_defconfig"=0D
+=0D
+# UBSAN=0D
+CONFIG_UBSAN=3Dn=0D
+=0D
+#=0D
+# Architecture Features=0D
+#=0D
+CONFIG_ARM64_SVE=3Dn=0D
+CONFIG_64BIT=3Dy=0D
+CONFIG_NR_CPUS=3D4=0D
+# CONFIG_ACPI is not set=0D
+CONFIG_ARM_EFI=3Dy=0D
+CONFIG_GICV3=3Dy=0D
+CONFIG_HAS_ITS=3Dy=0D
+CONFIG_HVM=3Dy=0D
+# CONFIG_NEW_VGIC is not set=0D
+CONFIG_SBSA_VUART_CONSOLE=3Dy=0D
+CONFIG_ARM_SSBD=3Dy=0D
+CONFIG_HARDEN_BRANCH_PREDICTOR=3Dy=0D
+# CONFIG_TEE is not set=0D
+# CONFIG_STATIC_SHM is not set=0D
+# end of Architecture Features=0D
+=0D
+#=0D
+# ARM errata workaround via the alternative framework=0D
+#=0D
+CONFIG_ARM64_ERRATUM_827319=3Dy=0D
+CONFIG_ARM64_ERRATUM_824069=3Dy=0D
+CONFIG_ARM64_ERRATUM_819472=3Dy=0D
+CONFIG_ARM64_ERRATUM_843419=3Dy=0D
+CONFIG_ARM64_ERRATUM_832075=3Dy=0D
+CONFIG_ARM64_ERRATUM_834220=3Dy=0D
+CONFIG_ARM_ERRATUM_858921=3Dy=0D
+CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=3Dy=0D
+CONFIG_ARM64_ERRATUM_1286807=3Dy=0D
+# end of ARM errata workaround via the alternative framework=0D
+=0D
+CONFIG_ARM64_HARDEN_BRANCH_PREDICTOR=3Dy=0D
+# CONFIG_ALL_PLAT is not set=0D
+# CONFIG_QEMU is not set=0D
+# CONFIG_RCAR3 is not set=0D
+CONFIG_MPSOC=3Dy=0D
+# CONFIG_NO_PLAT is not set=0D
+CONFIG_MPSOC_PLATFORM=3Dy=0D
+=0D
+#=0D
+# Common Features=0D
+#=0D
+CONFIG_GRANT_TABLE=3Dy=0D
+CONFIG_HAS_ALTERNATIVE=3Dy=0D
+CONFIG_HAS_DEVICE_TREE=3Dy=0D
+CONFIG_HAS_FAST_MULTIPLY=3Dy=0D
+CONFIG_HAS_PDX=3Dy=0D
+CONFIG_HAS_PMAP=3Dy=0D
+# CONFIG_MEM_ACCESS is not set=0D
+CONFIG_STATIC_MEMORY=3Dy=0D
+=0D
+#=0D
+# Speculative hardening=0D
+#=0D
+CONFIG_SPECULATIVE_HARDEN_ARRAY=3Dy=0D
+# end of Speculative hardening=0D
+=0D
+# CONFIG_HYPFS is not set=0D
+CONFIG_IOREQ_SERVER=3Dy=0D
+# CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP is not set=0D
+# CONFIG_XSM is not set=0D
+# CONFIG_ARGO is not set=0D
+=0D
+#=0D
+# Schedulers=0D
+#=0D
+# CONFIG_SCHED_CREDIT is not set=0D
+CONFIG_SCHED_CREDIT2=3Dy=0D
+# CONFIG_SCHED_RTDS is not set=0D
+# CONFIG_SCHED_ARINC653 is not set=0D
+CONFIG_SCHED_NULL=3Dy=0D
+CONFIG_SCHED_CREDIT2_DEFAULT=3Dy=0D
+# CONFIG_SCHED_NULL_DEFAULT is not set=0D
+CONFIG_SCHED_DEFAULT=3D"credit2"=0D
+# end of Schedulers=0D
+=0D
+CONFIG_BOOT_TIME_CPUPOOLS=3Dy=0D
+# CONFIG_LIVEPATCH is not set=0D
+# CONFIG_ENFORCE_UNIQUE_SYMBOLS is not set=0D
+CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS=3Dy=0D
+CONFIG_CMDLINE=3D""=0D
+CONFIG_DOM0_MEM=3D""=0D
+CONFIG_DTB_FILE=3D""=0D
+# CONFIG_TRACEBUFFER is not set=0D
+# end of Common Features=0D
+=0D
+#=0D
+# Device Drivers=0D
+#=0D
+# CONFIG_HAS_NS16550 is not set=0D
+CONFIG_HAS_CADENCE_UART=3Dy=0D
+# CONFIG_HAS_IMX_LPUART is not set=0D
+# CONFIG_HAS_MVEBU is not set=0D
+# CONFIG_HAS_MESON is not set=0D
+CONFIG_HAS_PL011=3Dy=0D
+# CONFIG_HAS_SCIF is not set=0D
+CONFIG_SERIAL_TX_BUFSIZE=3D16384=0D
+CONFIG_HAS_PASSTHROUGH=3Dy=0D
+CONFIG_ARM_SMMU=3Dy=0D
+CONFIG_ARM_SMMU_V3=3Dy=0D
+# CONFIG_IPMMU_VMSA is not set=0D
+CONFIG_IOMMU_FORCE_PT_SHARE=3Dy=0D
+# end of Device Drivers=0D
+=0D
+CONFIG_EXPERT=3Dy=0D
+CONFIG_UNSUPPORTED=3Dy=0D
+=0D
+#=0D
+# Debugging Options=0D
+#=0D
+CONFIG_DEBUG=3Dy=0D
+CONFIG_FRAME_POINTER=3Dy=0D
+CONFIG_COVERAGE=3Dy=0D
+CONFIG_DEBUG_LOCK_PROFILE=3Dy=0D
+CONFIG_DEBUG_LOCKS=3Dy=0D
+CONFIG_PERF_COUNTERS=3Dy=0D
+CONFIG_PERF_ARRAYS=3Dy=0D
+CONFIG_VERBOSE_DEBUG=3Dy=0D
+CONFIG_DEVICE_TREE_DEBUG=3Dy=0D
+CONFIG_SCRUB_DEBUG=3Dy=0D
+CONFIG_DEBUG_TRACE=3Dy=0D
+CONFIG_XMEM_POOL_POISON=3Dy=0D
+CONFIG_DEBUG_INFO=3Dy=0D
+# end of Debugging Options=0D
diff --git a/automation/eclair_analysis/xen_x86_config b/automation/eclair_=
analysis/xen_x86_config
new file mode 100644
index 0000000000..9b2709bfc8
--- /dev/null
+++ b/automation/eclair_analysis/xen_x86_config
@@ -0,0 +1,152 @@
+# File provided in=0D
+# Re: Xen MISRA C: Source files in scope and out of scope=0D
+# from:	Stefano Stabellini <stefano.stabellini@amd.com> =0D
+# date:	6 giu 2023, 02:53=0D
+=0D
+#=0D
+# Automatically generated file; DO NOT EDIT.=0D
+# Xen/x86 4.18-unstable Configuration=0D
+#=0D
+CONFIG_CC_IS_GCC=3Dy=0D
+CONFIG_GCC_VERSION=3D90400=0D
+CONFIG_CLANG_VERSION=3D0=0D
+CONFIG_LD_IS_GNU=3Dy=0D
+CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE=3Dy=0D
+CONFIG_X86_64=3Dy=0D
+CONFIG_X86=3Dy=0D
+CONFIG_ARCH_DEFCONFIG=3D"arch/x86/configs/x86_64_defconfig"=0D
+CONFIG_CC_HAS_INDIRECT_THUNK=3Dy=0D
+CONFIG_HAS_AS_CET_SS=3Dy=0D
+CONFIG_HAS_CC_CET_IBT=3Dy=0D
+=0D
+CONFIG_REQUIRE_NX=3Dn=0D
+=0D
+#=0D
+# Architecture Features=0D
+#=0D
+CONFIG_64BIT=3Dy=0D
+CONFIG_NR_CPUS=3D16=0D
+CONFIG_NR_NUMA_NODES=3D2=0D
+# CONFIG_PV is not set=0D
+CONFIG_HVM=3Dy=0D
+# CONFIG_XEN_SHSTK is not set=0D
+# CONFIG_XEN_IBT is not set=0D
+# CONFIG_SHADOW_PAGING is not set=0D
+# CONFIG_BIGMEM is not set=0D
+# CONFIG_HVM_FEP is not set=0D
+# CONFIG_TBOOT is not set=0D
+CONFIG_XEN_ALIGN_DEFAULT=3Dy=0D
+# CONFIG_XEN_ALIGN_2M is not set=0D
+CONFIG_X2APIC_PHYSICAL=3Dy=0D
+# CONFIG_XEN_GUEST is not set=0D
+# CONFIG_HYPERV_GUEST is not set=0D
+# CONFIG_MEM_PAGING is not set=0D
+# CONFIG_MEM_SHARING is not set=0D
+# end of Architecture Features=0D
+=0D
+#=0D
+# Common Features=0D
+#=0D
+CONFIG_COMPAT=3Dy=0D
+CONFIG_CORE_PARKING=3Dy=0D
+CONFIG_GRANT_TABLE=3Dy=0D
+CONFIG_ALTERNATIVE_CALL=3Dy=0D
+CONFIG_ARCH_MAP_DOMAIN_PAGE=3Dy=0D
+CONFIG_GENERIC_BUG_FRAME=3Dy=0D
+CONFIG_HAS_ALTERNATIVE=3Dy=0D
+CONFIG_HAS_COMPAT=3Dy=0D
+CONFIG_HAS_EX_TABLE=3Dy=0D
+CONFIG_HAS_FAST_MULTIPLY=3Dy=0D
+CONFIG_HAS_IOPORTS=3Dy=0D
+CONFIG_HAS_KEXEC=3Dy=0D
+CONFIG_HAS_PDX=3Dy=0D
+CONFIG_HAS_SCHED_GRANULARITY=3Dy=0D
+CONFIG_HAS_UBSAN=3Dy=0D
+CONFIG_MEM_ACCESS_ALWAYS_ON=3Dy=0D
+CONFIG_MEM_ACCESS=3Dy=0D
+CONFIG_NEEDS_LIBELF=3Dy=0D
+CONFIG_NUMA=3Dy=0D
+=0D
+#=0D
+# Speculative hardening=0D
+#=0D
+CONFIG_INDIRECT_THUNK=3Dy=0D
+CONFIG_SPECULATIVE_HARDEN_ARRAY=3Dy=0D
+CONFIG_SPECULATIVE_HARDEN_BRANCH=3Dy=0D
+# end of Speculative hardening=0D
+=0D
+# CONFIG_HYPFS is not set=0D
+CONFIG_IOREQ_SERVER=3Dy=0D
+# CONFIG_KEXEC is not set=0D
+# CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP is not set=0D
+# CONFIG_XENOPROF is not set=0D
+# CONFIG_XSM is not set=0D
+# CONFIG_ARGO is not set=0D
+=0D
+#=0D
+# Schedulers=0D
+#=0D
+# CONFIG_SCHED_CREDIT is not set=0D
+CONFIG_SCHED_CREDIT2=3Dy=0D
+# CONFIG_SCHED_RTDS is not set=0D
+# CONFIG_SCHED_ARINC653 is not set=0D
+CONFIG_SCHED_NULL=3Dy=0D
+CONFIG_SCHED_CREDIT2_DEFAULT=3Dy=0D
+# CONFIG_SCHED_NULL_DEFAULT is not set=0D
+CONFIG_SCHED_DEFAULT=3D"credit2"=0D
+# end of Schedulers=0D
+=0D
+# CONFIG_LIVEPATCH is not set=0D
+# CONFIG_ENFORCE_UNIQUE_SYMBOLS is not set=0D
+# CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS is not set=0D
+CONFIG_CMDLINE=3D""=0D
+CONFIG_DOM0_MEM=3D""=0D
+# CONFIG_TRACEBUFFER is not set=0D
+# end of Common Features=0D
+=0D
+#=0D
+# Device Drivers=0D
+#=0D
+CONFIG_ACPI=3Dy=0D
+CONFIG_ACPI_LEGACY_TABLES_LOOKUP=3Dy=0D
+CONFIG_ACPI_NUMA=3Dy=0D
+CONFIG_HAS_NS16550=3Dy=0D
+CONFIG_HAS_EHCI=3Dy=0D
+CONFIG_SERIAL_TX_BUFSIZE=3D16384=0D
+# CONFIG_XHCI is not set=0D
+CONFIG_HAS_CPUFREQ=3Dy=0D
+CONFIG_HAS_PASSTHROUGH=3Dy=0D
+CONFIG_AMD_IOMMU=3Dy=0D
+# CONFIG_INTEL_IOMMU is not set=0D
+# CONFIG_IOMMU_QUARANTINE_NONE is not set=0D
+CONFIG_IOMMU_QUARANTINE_BASIC=3Dy=0D
+# CONFIG_IOMMU_QUARANTINE_SCRATCH_PAGE is not set=0D
+CONFIG_HAS_PCI=3Dy=0D
+CONFIG_HAS_PCI_MSI=3Dy=0D
+CONFIG_VIDEO=3Dy=0D
+CONFIG_VGA=3Dy=0D
+CONFIG_HAS_VPCI=3Dy=0D
+# end of Device Drivers=0D
+=0D
+CONFIG_EXPERT=3Dy=0D
+CONFIG_UNSUPPORTED=3Dy=0D
+CONFIG_ARCH_SUPPORTS_INT128=3Dy=0D
+=0D
+#=0D
+# Debugging Options=0D
+#=0D
+CONFIG_DEBUG=3Dy=0D
+# CONFIG_CRASH_DEBUG is not set=0D
+CONFIG_GDBSX=3Dy=0D
+CONFIG_FRAME_POINTER=3Dy=0D
+# CONFIG_COVERAGE is not set=0D
+# CONFIG_DEBUG_LOCK_PROFILE is not set=0D
+CONFIG_DEBUG_LOCKS=3Dy=0D
+# CONFIG_PERF_COUNTERS is not set=0D
+CONFIG_VERBOSE_DEBUG=3Dy=0D
+CONFIG_SCRUB_DEBUG=3Dy=0D
+# CONFIG_UBSAN is not set=0D
+# CONFIG_DEBUG_TRACE is not set=0D
+CONFIG_XMEM_POOL_POISON=3Dy=0D
+CONFIG_DEBUG_INFO=3Dy=0D
+# end of Debugging Options=0D
diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analy=
ze.yaml
new file mode 100644
index 0000000000..9ce2a287fb
--- /dev/null
+++ b/automation/gitlab-ci/analyze.yaml
@@ -0,0 +1,37 @@
+.eclair-analysis:
+  stage: analyze
+  tags:
+    - eclair-analysis
+  variables:
+    ECLAIR_OUTPUT_DIR: "ECLAIR_out"
+    ANALYSIS_KIND: "normal"
+    ENABLE_ECLAIR_BOT: "n"
+    AUTO_PR_BRANCH: "staging"
+    AUTO_PR_REPOSITORY: "xen-project/xen"
+  artifacts:
+    when: always
+    paths:
+      - "${ECLAIR_OUTPUT_DIR}"
+      - '*.log'
+    reports:
+      codequality: gl-code-quality-report.json
+
+eclair-x86_64:
+  extends: .eclair-analysis
+  variables:
+    LOGFILE: "eclair-x86_64.log"
+    VARIANT: "X86_64"
+    RULESET: "Set1"
+  script:
+    - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
+  allow_failure: true
+
+eclair-ARM64:
+  extends: .eclair-analysis
+  variables:
+    LOGFILE: "eclair-ARM64.log"
+    VARIANT: "ARM64"
+    RULESET: "Set1"
+  script:
+    - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
+  allow_failure: true
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.y=
aml
index c401f62d61..f01e2c32bb 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -11,6 +11,7 @@
       - '*.log'
       - '*/*.log'
     when: always
+  needs: []
   except:
     - master
     - smoke
diff --git a/automation/scripts/eclair b/automation/scripts/eclair
new file mode 100755
index 0000000000..c4a3bb57d7
--- /dev/null
+++ b/automation/scripts/eclair
@@ -0,0 +1,32 @@
+#!/bin/sh -eu
+
+ECLAIR_ANALYSIS_DIR=3Dautomation/eclair_analysis
+ECLAIR_DIR=3D"${ECLAIR_ANALYSIS_DIR}/ECLAIR"
+ECLAIR_OUTPUT_DIR=3D$(realpath "${ECLAIR_OUTPUT_DIR}")
+
+"${ECLAIR_ANALYSIS_DIR}/prepare.sh" "${VARIANT}"
+
+ex=3D0
+"${ECLAIR_DIR}/analyze.sh" "${VARIANT}" "${RULESET}" || ex=3D$?
+"${ECLAIR_DIR}/action_log.sh" ANALYSIS_LOG \
+                             "ECLAIR analysis log" \
+                             "${ECLAIR_OUTPUT_DIR}/ANALYSIS.log" \
+                             "${ex}"
+"${ECLAIR_DIR}/action_log.sh" REPORT_LOG \
+                             "ECLAIR report log" \
+                             "${ECLAIR_OUTPUT_DIR}/REPORT.log" \
+                             "${ex}"
+[ "${ex}" =3D 0 ] || exit "${ex}"
+"${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
+
+# Fail in case of new reports
+"${ECLAIR_DIR}/action_clean_added.sh" "${ECLAIR_OUTPUT_DIR}" || ex=3D$?
+"${ECLAIR_DIR}/action_log.sh" DIFF_CHECK_LOG \
+                             "ECLAIR diff check" \
+                             "${ECLAIR_OUTPUT_DIR}/clean_added.log" \
+                             "${ex}"
+
+rm -rf "${ECLAIR_OUTPUT_DIR}/.data"
+rm -rf "${ECLAIR_OUTPUT_DIR}/PROJECT.ecd"
+
+[ "${ex}" =3D 0 ] || exit "${ex}"
--=20
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 17:26:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 17:26:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569185.889496 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNzKl-0006XX-78; Mon, 24 Jul 2023 17:26:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569185.889496; Mon, 24 Jul 2023 17:26:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNzKl-0006XQ-4L; Mon, 24 Jul 2023 17:26:59 +0000
Received: by outflank-mailman (input) for mailman id 569185;
 Mon, 24 Jul 2023 17:26:57 +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
 <SRS0=GZnG=DK=citrix.com=prvs=5629cf0ab=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qNzKj-0006Eq-IB
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 17:26:57 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 36ca2ee4-2a47-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 19:26:26 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 36ca2ee4-2a47-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690219614;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=YHFhvsy4inb7+yvCsMm7kRjZYDroMm2BRJqX9tJyNqw=;
  b=bzwBSxpbxZB9UzrfyYe6EnFXS+CM5R8YWbvqos4+e89yxZhKXzhm/I6o
   tIhJBJ8giTgXabATZpDG9vCEIJCu6nEAaEPJHH8Ub11Ofzpj1IQAoNfhE
   Z0gR9hGby0jTwhHOslJb0Jye3R/29oO7tjoP7/I1L4LgDycw7Hzx47U5D
   0=;
Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 117134229
X-Ironport-Server: esa2.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:nhTAh6BDGBz0NhVW/zzjw5YqxClBgxIJ4kV8jS/XYbTApGx33mEHn
 DAcDDrTbvfcYWvweo93bIqy90sDuZXRyNAyQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h
 yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs
 t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GxC5QRlDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS
 uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada
 jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIwpcx9XDxD7
 /ghOjFRVAyqu+K17KCBc7w57igjBJGD0II3v3hhyXfSDOo8QICFSKLPjTNa9G5u3IYUR6+YP
 pdHL2M1N3wsYDUWUrsTIJs4gOevgGi5azBCoUiZjaE2/3LS3Ep6172F3N/9I4XVHJ4JxBzJz
 o7A11zUXwtLBtfG8yLf3yr1msDevC36YZ1HQdVU8dY12QbOlwT/EiY+RVa95PW0lEO6c9ZeM
 FAPvDojq7Ao806mRcW7WAe3yFabujYMVtwWFPc1gCmPxbDT+B2xHXUfQ3hKb9lOnMYuSCYjz
 FOhg9LjDjspu7qQIU9x7Z/N82n0Y3JMazZfO2ldF1BtD8TfTJ8b0TjFE4tuCqqMnNypIy3Z/
 zCJgDoEvuBG5SIU7JlX7Wwrkhr1+MmRF1Vpu12PNo62xlgnPdD4PuRE/XCetK8dd9jBEzFtq
 VBew6CjAPYy4YZhfcBnaMEEB/mX6vmMK1UwanY/TsB6p1xBF5NOFL28AQ2Sx28zaK7ogRezP
 CfuVfp5vfe/xkeCY65teJ6WAM8316XmHtmNfqmKP4IXOccrKFLWpHoGiausM4fFyRZErE3CE
 c3DLZbE4YgyVMyLMwZat89CiOR2l0jSNEvYRIzhzgTP7FZtTCf9dFvxC3PXNrpRxPrd8G3oH
 yN3a5PiJ+N3DLevPUE6MOc7cTg3EJTMLcut9JcILbfZeVsO9aNII6a5/I7NsrdNx8x9/tokN
 FnkMqOE4DITXUH6FDg=
IronPort-HdrOrdr: A9a23:hiU7va2FRLX+53dq6noC1wqjBKckLtp133Aq2lEZdPU1SKylfq
 WV98jzuiWftN98YhwdcKm7Scu9qCrnhPtICOoqXItKPjOIhILAFugL0WKI+VPd8kPFmtK1uJ
 0QEJRDNA==
X-Talos-CUID: 9a23:5Kru8m+IrhoitIGvZy+VvxE+EJ14f2fZ9WXRf3WkIFppS5GHc2bFrQ==
X-Talos-MUID: 9a23:oCUWNAt0DAcVysCL2c2nvBw/LpZa6P2UEBogycwalNilOy1JJGLI
X-IronPort-AV: E=Sophos;i="6.01,228,1684814400"; 
   d="scan'208";a="117134229"
Date: Mon, 24 Jul 2023 18:26:42 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
CC: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>, Juergen Gross
	<jgross@suse.com>
Subject: Re: [PATCH v3 3/6] libxl: introduce MSR data in libxl_cpuid_policy
Message-ID: <022263eb-e10d-4e76-8fdc-2f64ecbb347d@perard>
References: <20230720082540.69444-1-roger.pau@citrix.com>
 <20230720082540.69444-4-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230720082540.69444-4-roger.pau@citrix.com>

On Thu, Jul 20, 2023 at 10:25:37AM +0200, Roger Pau Monne wrote:
> ---
> It would be nice to rename the json output field to 'cpu_policy'
> instead of 'cpuid', so that it looks like:
> 
> "cpu_policy": {
>     "cpuid": [
>         {
>             "leaf": 7,
>             "subleaf": 0,
>             "edx": "xx1xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
>         },
>         {
>             "leaf": 1,
>             "ebx": "xxxxxxxxxxxxxxxx00010000xxxxxxxx"
>         }
>         }
>         }
>     ],
>     "msr": [
>         {
>             "index": 266,
>             "policy": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1xx1x1"
>         }
>     ]
> },
> 
> Sadly I have no idea how to do that, and can be done in a followup
> change anyway.

I don't think that would be possible. I think that would mean renaming
the field in "struct libxl_domain_build_info", and changing a fields
name seems complicated.

> diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
> index 3c8b2a72c0b8..68b797886642 100644
> --- a/tools/libs/light/libxl_cpuid.c
> +++ b/tools/libs/light/libxl_cpuid.c
> @@ -592,17 +641,24 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
>  {
>      int i, size;
>      struct xc_xend_cpuid *l;
> +    struct xc_msr *msr;
> +    const libxl__json_object *co;
>      flexarray_t *array;
>  
> -    if (!libxl__json_object_is_array(o))
> +    if (!libxl__json_object_is_map(o))
>          return ERROR_FAIL;

We still need to be able to migrate a VM from a previous release of Xen,
and we are going to have an array instead of a map. Could you try to
handle both the old and new format of "cpuid"? If we don't then the
scenario "migrate then reboot" is going to fail to use the expected cpu
policy.

> diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
> index 9e48bb772646..887824fdd828 100644
> --- a/tools/libs/light/libxl_types.idl
> +++ b/tools/libs/light/libxl_types.idl
> @@ -19,7 +19,7 @@ libxl_mac = Builtin("mac", json_parse_type="JSON_STRING", passby=PASS_BY_REFEREN
>  libxl_bitmap = Builtin("bitmap", json_parse_type="JSON_ARRAY", dispose_fn="libxl_bitmap_dispose", passby=PASS_BY_REFERENCE,
>                         check_default_fn="libxl_bitmap_is_empty", copy_fn="libxl_bitmap_copy_alloc")
>  libxl_cpuid_policy_list = Builtin("cpuid_policy_list", dispose_fn="libxl_cpuid_dispose", passby=PASS_BY_REFERENCE,
> -                                  json_parse_type="JSON_ARRAY", check_default_fn="libxl__cpuid_policy_is_empty",
> +                                  json_parse_type="JSON_MAP", check_default_fn="libxl__cpuid_policy_is_empty",

Maybe we should have json_parse_type as either "JSON_ARRAY | JSON_MAP"
or just "JSON_ANY" since nothing beside libxl is supposed to do
something with it, and when migrating from a previous version, we are
going to have an array.

I don't think anything is using json_parse_type for this
libxl_cpuid_policy_list, so I don't think it matter which type we use.


Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 17:52:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 17:52:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569202.889511 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNzjT-0001oL-DW; Mon, 24 Jul 2023 17:52:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569202.889511; Mon, 24 Jul 2023 17:52:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNzjT-0001np-A8; Mon, 24 Jul 2023 17:52:31 +0000
Received: by outflank-mailman (input) for mailman id 569202;
 Mon, 24 Jul 2023 17:52:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ixEc=DK=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qNzjS-0001ku-O2
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 17:52:30 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dbd347fe-2a4a-11ee-b23c-6b7b168915f2;
 Mon, 24 Jul 2023 19:52:30 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.161.223.75])
 by support.bugseng.com (Postfix) with ESMTPSA id 746694EE0C87;
 Mon, 24 Jul 2023 19:52:28 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dbd347fe-2a4a-11ee-b23c-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH 1/3] xen/irq: add missing parameter names
Date: Mon, 24 Jul 2023 19:50:27 +0200
Message-Id: <54ce64f3634a19a834cc1ce5ed74527bf8fa9420.1690217195.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690217195.git.federico.serafini@bugseng.com>
References: <cover.1690217195.git.federico.serafini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add missing parameter names thus addressing violations of MISRA C:2012
Rule 8.2: "Function types shall be in prototype form with named
parameters".

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/include/xen/irq.h     | 59 ++++++++++++++++++++-------------------
 xen/include/xen/softirq.h |  2 +-
 2 files changed, 31 insertions(+), 30 deletions(-)

diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index 300625e56d..7cc6917513 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -18,7 +18,7 @@
     ASSERT(!in_irq() && (local_irq_is_enabled() || num_online_cpus() <= 1))
 
 struct irqaction {
-    void (*handler)(int, void *, struct cpu_user_regs *);
+    void (*handler)(int irq, void *data, struct cpu_user_regs *regs);
     const char *name;
     void *dev_id;
     bool_t free_on_release;
@@ -58,21 +58,21 @@ struct irq_desc;
 
 /*
  * Interrupt controller descriptor. This is all we need
- * to describe about the low-level hardware. 
+ * to describe about the low-level hardware.
  */
 struct hw_interrupt_type {
     const char *typename;
-    unsigned int (*startup)(struct irq_desc *);
-    void (*shutdown)(struct irq_desc *);
-    void (*enable)(struct irq_desc *);
-    void (*disable)(struct irq_desc *);
-    void (*ack)(struct irq_desc *);
+    unsigned int (*startup)(struct irq_desc *desc);
+    void (*shutdown)(struct irq_desc *desc);
+    void (*enable)(struct irq_desc *desc);
+    void (*disable)(struct irq_desc *desc);
+    void (*ack)(struct irq_desc *desc);
 #ifdef CONFIG_X86
-    void (*end)(struct irq_desc *, u8 vector);
+    void (*end)(struct irq_desc *desc, u8 vector);
 #else
-    void (*end)(struct irq_desc *);
+    void (*end)(struct irq_desc *desc);
 #endif
-    void (*set_affinity)(struct irq_desc *, const cpumask_t *);
+    void (*set_affinity)(struct irq_desc *desc, const cpumask_t *mask);
 };
 
 typedef const struct hw_interrupt_type hw_irq_controller;
@@ -110,22 +110,23 @@ typedef struct irq_desc {
 #define irq_to_desc(irq)    (&irq_desc[irq])
 #endif
 
-int init_one_irq_desc(struct irq_desc *);
-int arch_init_one_irq_desc(struct irq_desc *);
+int init_one_irq_desc(struct irq_desc *desc);
+int arch_init_one_irq_desc(struct irq_desc *desc);
 
 #define irq_desc_initialized(desc) ((desc)->handler != NULL)
 
 extern int setup_irq(unsigned int irq, unsigned int irqflags,
-                     struct irqaction *);
+                     struct irqaction *new);
 extern void release_irq(unsigned int irq, const void *dev_id);
 extern int request_irq(unsigned int irq, unsigned int irqflags,
-               void (*handler)(int, void *, struct cpu_user_regs *),
+               void (*handler)(int irq, void *dev_id,
+                     struct cpu_user_regs *regs),
                const char * devname, void *dev_id);
 
 extern hw_irq_controller no_irq_type;
 void cf_check no_action(int cpl, void *dev_id, struct cpu_user_regs *regs);
-unsigned int cf_check irq_startup_none(struct irq_desc *);
-void cf_check irq_actor_none(struct irq_desc *);
+unsigned int cf_check irq_startup_none(struct irq_desc *desc);
+void cf_check irq_actor_none(struct irq_desc *desc);
 #define irq_shutdown_none irq_actor_none
 #define irq_disable_none irq_actor_none
 #define irq_enable_none irq_actor_none
@@ -146,7 +147,7 @@ struct pirq {
 #define pirq_info(d, p) ((struct pirq *)radix_tree_lookup(&(d)->pirq_tree, p))
 
 /* Use this instead of pirq_info() if the structure may need allocating. */
-extern struct pirq *pirq_get_info(struct domain *, int pirq);
+extern struct pirq *pirq_get_info(struct domain *d, int pirq);
 
 #define pirq_field(d, p, f, def) ({ \
     const struct pirq *__pi = pirq_info(d, p); \
@@ -155,30 +156,30 @@ extern struct pirq *pirq_get_info(struct domain *, int pirq);
 #define pirq_to_evtchn(d, pirq) pirq_field(d, pirq, evtchn, 0)
 #define pirq_masked(d, pirq) pirq_field(d, pirq, masked, 0)
 
-void pirq_cleanup_check(struct pirq *, struct domain *);
+void pirq_cleanup_check(struct pirq *pirq, struct domain *d);
 
 #define pirq_cleanup_check(pirq, d) \
     ((pirq)->evtchn ? pirq_cleanup_check(pirq, d) : (void)0)
 
-extern void pirq_guest_eoi(struct pirq *);
-extern void desc_guest_eoi(struct irq_desc *, struct pirq *);
+extern void pirq_guest_eoi(struct pirq *pirq);
+extern void desc_guest_eoi(struct irq_desc *desc, struct pirq *pirq);
 extern int pirq_guest_unmask(struct domain *d);
-extern int pirq_guest_bind(struct vcpu *, struct pirq *, int will_share);
-extern void pirq_guest_unbind(struct domain *d, struct pirq *);
-extern void pirq_set_affinity(struct domain *d, int irq, const cpumask_t *);
-extern irq_desc_t *domain_spin_lock_irq_desc(
+extern int pirq_guest_bind(struct vcpu *v, struct pirq *pirq, int will_share);
+extern void pirq_guest_unbind(struct domain *d, struct pirq *pirq);
+extern void pirq_set_affinity(struct domain *d, int irq, const cpumask_t *mask);
+extern struct irq_desc *domain_spin_lock_irq_desc(
     struct domain *d, int irq, unsigned long *pflags);
-extern irq_desc_t *pirq_spin_lock_irq_desc(
-    const struct pirq *, unsigned long *pflags);
+extern struct irq_desc *pirq_spin_lock_irq_desc(
+    const struct pirq *pirq, unsigned long *pflags);
 
-unsigned int set_desc_affinity(struct irq_desc *, const cpumask_t *);
+unsigned int set_desc_affinity(struct irq_desc *desc, const cpumask_t *mask);
 
 #ifndef arch_hwdom_irqs
-unsigned int arch_hwdom_irqs(domid_t);
+unsigned int arch_hwdom_irqs(domid_t domid);
 #endif
 
 #ifndef arch_evtchn_bind_pirq
-void arch_evtchn_bind_pirq(struct domain *, int pirq);
+void arch_evtchn_bind_pirq(struct domain *d, int pirq);
 #endif
 
 #endif /* __XEN_IRQ_H__ */
diff --git a/xen/include/xen/softirq.h b/xen/include/xen/softirq.h
index 1f6c4783da..33d6f2ecd2 100644
--- a/xen/include/xen/softirq.h
+++ b/xen/include/xen/softirq.h
@@ -26,7 +26,7 @@ typedef void (*softirq_handler)(void);
 void do_softirq(void);
 void open_softirq(int nr, softirq_handler handler);
 
-void cpumask_raise_softirq(const cpumask_t *, unsigned int nr);
+void cpumask_raise_softirq(const cpumask_t *mask, unsigned int nr);
 void cpu_raise_softirq(unsigned int cpu, unsigned int nr);
 void raise_softirq(unsigned int nr);
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 17:52:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 17:52:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569203.889527 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNzjU-0002Fj-KO; Mon, 24 Jul 2023 17:52:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569203.889527; Mon, 24 Jul 2023 17:52:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNzjU-0002Fc-Hd; Mon, 24 Jul 2023 17:52:32 +0000
Received: by outflank-mailman (input) for mailman id 569203;
 Mon, 24 Jul 2023 17:52:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ixEc=DK=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qNzjT-0001ku-Fs
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 17:52:31 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dc65252d-2a4a-11ee-b23c-6b7b168915f2;
 Mon, 24 Jul 2023 19:52:31 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.161.223.75])
 by support.bugseng.com (Postfix) with ESMTPSA id 034474EE0C88;
 Mon, 24 Jul 2023 19:52:29 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dc65252d-2a4a-11ee-b23c-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [XEN PATCH 2/3] xen/arm: irq: address violations of MISRA C: 2012 Rules 8.2 and 8.3
Date: Mon, 24 Jul 2023 19:50:28 +0200
Message-Id: <a62e88a9c29cf7866c251968b5a5b6865aff4a2a.1690217195.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690217195.git.federico.serafini@bugseng.com>
References: <cover.1690217195.git.federico.serafini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Give a name to unnamed parameters thus addressing violations of
MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
named parameters").
Keep consistency between parameter names and types used in function
declarations and the ones used in the corresponding function
definitions, thus addressing violations of MISRA C:2012 Rule 8.3
("All declarations of an object or function shall use the same names
and type qualifiers").

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/arch/arm/irq.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 16e56f8945..335e06a2a7 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -58,7 +58,7 @@ hw_irq_controller no_irq_type = {
 static irq_desc_t irq_desc[NR_IRQS];
 static DEFINE_PER_CPU(irq_desc_t[NR_LOCAL_IRQS], local_irq_desc);
 
-irq_desc_t *__irq_to_desc(int irq)
+struct irq_desc *__irq_to_desc(int irq)
 {
     if ( irq < NR_LOCAL_IRQS )
         return &this_cpu(local_irq_desc)[irq];
@@ -182,7 +182,8 @@ void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask)
 }
 
 int request_irq(unsigned int irq, unsigned int irqflags,
-                void (*handler)(int, void *, struct cpu_user_regs *),
+                void (*handler)(int irq, void *dev_id,
+                                struct cpu_user_regs *regs),
                 const char *devname, void *dev_id)
 {
     struct irqaction *action;
@@ -617,7 +618,7 @@ void pirq_guest_unbind(struct domain *d, struct pirq *pirq)
     BUG();
 }
 
-void pirq_set_affinity(struct domain *d, int pirq, const cpumask_t *mask)
+void pirq_set_affinity(struct domain *d, int irq, const cpumask_t *mask)
 {
     BUG();
 }
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 17:52:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 17:52:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569201.889507 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNzjT-0001lM-6r; Mon, 24 Jul 2023 17:52:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569201.889507; Mon, 24 Jul 2023 17:52:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNzjT-0001lF-3p; Mon, 24 Jul 2023 17:52:31 +0000
Received: by outflank-mailman (input) for mailman id 569201;
 Mon, 24 Jul 2023 17:52:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ixEc=DK=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qNzjR-0001ku-MI
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 17:52:29 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id db02f064-2a4a-11ee-b23c-6b7b168915f2;
 Mon, 24 Jul 2023 19:52:28 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.161.223.75])
 by support.bugseng.com (Postfix) with ESMTPSA id DF4D64EE073E;
 Mon, 24 Jul 2023 19:52:25 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: db02f064-2a4a-11ee-b23c-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [XEN PATCH 0/3] IRQ: address violations of MISRA C:2012 Rules 8.2 and 8.3
Date: Mon, 24 Jul 2023 19:50:26 +0200
Message-Id: <cover.1690217195.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This patch serie addresses violations of rules 8.2 and 8.3 related to the IRQ
module.
Changes are divided by architecture.
No functional changes.

Federico Serafini (3):
  xen/irq: add missing parameter names
  xen/arm: irq: address violations of MISRA C: 2012 Rules 8.2 and 8.3
  x86/irq: address violations of MISRA C:2012 Rules 8.2 and 8.3

 xen/arch/arm/irq.c             |  7 ++--
 xen/arch/x86/include/asm/irq.h | 32 +++++++++---------
 xen/arch/x86/irq.c             | 28 ++++++++--------
 xen/include/xen/irq.h          | 59 +++++++++++++++++-----------------
 xen/include/xen/softirq.h      |  2 +-
 5 files changed, 65 insertions(+), 63 deletions(-)

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 17:52:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 17:52:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569204.889537 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNzjX-0002We-S9; Mon, 24 Jul 2023 17:52:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569204.889537; Mon, 24 Jul 2023 17:52:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNzjX-0002WX-Om; Mon, 24 Jul 2023 17:52:35 +0000
Received: by outflank-mailman (input) for mailman id 569204;
 Mon, 24 Jul 2023 17:52:34 +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
 <SRS0=ixEc=DK=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qNzjW-0002Up-7i
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 17:52:34 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cc0e1619-2a4a-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 19:52:03 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.161.223.75])
 by support.bugseng.com (Postfix) with ESMTPSA id ED8F94EE0C89;
 Mon, 24 Jul 2023 19:52:30 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cc0e1619-2a4a-11ee-8612-37d641c3527e
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH 3/3] x86/irq: address violations of MISRA C:2012 Rules 8.2 and 8.3
Date: Mon, 24 Jul 2023 19:50:29 +0200
Message-Id: <ae48788c6c41e5e506b9995037d176ac8b08d3f2.1690217195.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690217195.git.federico.serafini@bugseng.com>
References: <cover.1690217195.git.federico.serafini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Give a name to unnamed parameters thus addressing violations of
MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
named parameters").
Keep consistency between parameter names and types used in function
declarations and the ones used in the corresponding function
definitions, thus addressing violations of MISRA C:2012 Rule 8.3
("All declarations of an object or function shall use the same names
and type qualifiers").

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/arch/x86/include/asm/irq.h | 32 ++++++++++++++++----------------
 xen/arch/x86/irq.c             | 28 ++++++++++++++--------------
 2 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/xen/arch/x86/include/asm/irq.h b/xen/arch/x86/include/asm/irq.h
index 3f95dd39b7..bb8b7ff2cc 100644
--- a/xen/arch/x86/include/asm/irq.h
+++ b/xen/arch/x86/include/asm/irq.h
@@ -101,18 +101,18 @@ void cf_check irq_move_cleanup_interrupt(struct cpu_user_regs *regs);
 uint8_t alloc_hipriority_vector(void);
 
 void set_direct_apic_vector(
-    uint8_t vector, void (*handler)(struct cpu_user_regs *));
+    uint8_t vector, void (*handler)(struct cpu_user_regs *regs));
 void alloc_direct_apic_vector(
-    uint8_t *vector, void (*handler)(struct cpu_user_regs *));
+    uint8_t *vector, void (*handler)(struct cpu_user_regs *regs));
 
 void do_IRQ(struct cpu_user_regs *regs);
 
-void cf_check disable_8259A_irq(struct irq_desc *);
-void cf_check enable_8259A_irq(struct irq_desc *);
+void cf_check disable_8259A_irq(struct irq_desc *desc);
+void cf_check enable_8259A_irq(struct irq_desc *desc);
 int i8259A_irq_pending(unsigned int irq);
 void mask_8259A(void);
 void unmask_8259A(void);
-void init_8259A(int aeoi);
+void init_8259A(int auto_eoi);
 void make_8259A_irq(unsigned int irq);
 bool bogus_8259A_irq(unsigned int irq);
 int i8259A_suspend(void);
@@ -148,9 +148,9 @@ int map_domain_pirq(struct domain *d, int pirq, int irq, int type,
                            void *data);
 int unmap_domain_pirq(struct domain *d, int pirq);
 int get_free_pirq(struct domain *d, int type);
-int get_free_pirqs(struct domain *, unsigned int nr);
+int get_free_pirqs(struct domain *d, unsigned int nr);
 void free_domain_pirqs(struct domain *d);
-int map_domain_emuirq_pirq(struct domain *d, int pirq, int irq);
+int map_domain_emuirq_pirq(struct domain *d, int pirq, int emuirq);
 int unmap_domain_pirq_emuirq(struct domain *d, int pirq);
 
 /* Reset irq affinities to match the given CPU mask. */
@@ -168,9 +168,9 @@ int irq_to_vector(int irq);
  */
 int create_irq(nodeid_t node, bool grant_access);
 void destroy_irq(unsigned int irq);
-int assign_irq_vector(int irq, const cpumask_t *);
+int assign_irq_vector(int irq, const cpumask_t *mask);
 
-void cf_check irq_complete_move(struct irq_desc *);
+void cf_check irq_complete_move(struct irq_desc *desc);
 
 extern struct irq_desc *irq_desc;
 
@@ -179,16 +179,16 @@ void unlock_vector_lock(void);
 
 void setup_vector_irq(unsigned int cpu);
 
-void move_native_irq(struct irq_desc *);
-void move_masked_irq(struct irq_desc *);
+void move_native_irq(struct irq_desc *desc);
+void move_masked_irq(struct irq_desc *desc);
 
-int bind_irq_vector(int irq, int vector, const cpumask_t *);
+int bind_irq_vector(int irq, int vector, const cpumask_t *mask);
 
-void cf_check end_nonmaskable_irq(struct irq_desc *, uint8_t vector);
-void irq_set_affinity(struct irq_desc *, const cpumask_t *mask);
+void cf_check end_nonmaskable_irq(struct irq_desc *desc, uint8_t vector);
+void irq_set_affinity(struct irq_desc *desc, const cpumask_t *mask);
 
-int init_domain_irq_mapping(struct domain *);
-void cleanup_domain_irq_mapping(struct domain *);
+int init_domain_irq_mapping(struct domain *d);
+void cleanup_domain_irq_mapping(struct domain *d);
 
 #define domain_pirq_to_irq(d, pirq) pirq_field(d, pirq, arch.irq, 0)
 #define domain_irq_to_pirq(d, irq) ({                           \
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 20150b1c7f..c2ec1182f1 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -148,14 +148,14 @@ static void trace_irq_mask(uint32_t event, int irq, int vector,
 }
 
 static int __init _bind_irq_vector(struct irq_desc *desc, int vector,
-                                   const cpumask_t *cpu_mask)
+                                   const cpumask_t *mask)
 {
     cpumask_t online_mask;
     int cpu;
 
     BUG_ON((unsigned)vector >= X86_NR_VECTORS);
 
-    cpumask_and(&online_mask, cpu_mask, &cpu_online_map);
+    cpumask_and(&online_mask, mask, &cpu_online_map);
     if (cpumask_empty(&online_mask))
         return -EINVAL;
     if ( (desc->arch.vector == vector) &&
@@ -177,7 +177,7 @@ static int __init _bind_irq_vector(struct irq_desc *desc, int vector,
     return 0;
 }
 
-int __init bind_irq_vector(int irq, int vector, const cpumask_t *cpu_mask)
+int __init bind_irq_vector(int irq, int vector, const cpumask_t *mask)
 {
     struct irq_desc *desc = irq_to_desc(irq);
     unsigned long flags;
@@ -187,7 +187,7 @@ int __init bind_irq_vector(int irq, int vector, const cpumask_t *cpu_mask)
 
     spin_lock_irqsave(&desc->lock, flags);
     spin_lock(&vector_lock);
-    ret = _bind_irq_vector(desc, vector, cpu_mask);
+    ret = _bind_irq_vector(desc, vector, mask);
     spin_unlock(&vector_lock);
     spin_unlock_irqrestore(&desc->lock, flags);
 
@@ -893,10 +893,10 @@ void irq_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
     desc->status |= IRQ_MOVE_PENDING;
 }
 
-void pirq_set_affinity(struct domain *d, int pirq, const cpumask_t *mask)
+void pirq_set_affinity(struct domain *d, int irq, const cpumask_t *mask)
 {
     unsigned long flags;
-    struct irq_desc *desc = domain_spin_lock_irq_desc(d, pirq, &flags);
+    struct irq_desc *desc = domain_spin_lock_irq_desc(d, irq, &flags);
 
     if ( !desc )
         return;
@@ -915,16 +915,16 @@ uint8_t alloc_hipriority_vector(void)
     return next++;
 }
 
-static void (*direct_apic_vector[X86_NR_VECTORS])(struct cpu_user_regs *);
+static void (*direct_apic_vector[X86_NR_VECTORS])(struct cpu_user_regs *regs);
 void set_direct_apic_vector(
-    uint8_t vector, void (*handler)(struct cpu_user_regs *))
+    uint8_t vector, void (*handler)(struct cpu_user_regs *regs))
 {
     BUG_ON(direct_apic_vector[vector] != NULL);
     direct_apic_vector[vector] = handler;
 }
 
 void alloc_direct_apic_vector(
-    uint8_t *vector, void (*handler)(struct cpu_user_regs *))
+    uint8_t *vector, void (*handler)(struct cpu_user_regs *regs))
 {
     static DEFINE_SPINLOCK(lock);
 
@@ -964,7 +964,7 @@ static int __init cf_check irq_ratelimit_init(void)
 __initcall(irq_ratelimit_init);
 
 int __init request_irq(unsigned int irq, unsigned int irqflags,
-        void (*handler)(int, void *, struct cpu_user_regs *),
+        void (*handler)(int irq, void *dev_id, struct cpu_user_regs *regs),
         const char * devname, void *dev_id)
 {
     struct irqaction * action;
@@ -1194,9 +1194,9 @@ static void cf_check irq_guest_eoi_timer_fn(void *data)
  * to the per-domain irq-to-vector mapping.
  */
 struct irq_desc *domain_spin_lock_irq_desc(
-    struct domain *d, int pirq, unsigned long *pflags)
+    struct domain *d, int irq, unsigned long *pflags)
 {
-    const struct pirq *info = pirq_info(d, pirq);
+    const struct pirq *info = pirq_info(d, irq);
 
     return info ? pirq_spin_lock_irq_desc(info, pflags) : NULL;
 }
@@ -1525,14 +1525,14 @@ static int irq_acktype(const struct irq_desc *desc)
     return 0;
 }
 
-int pirq_shared(struct domain *d, int pirq)
+int pirq_shared(struct domain *d, int irq)
 {
     struct irq_desc    *desc;
     const irq_guest_action_t *action;
     unsigned long       flags;
     int                 shared;
 
-    desc = domain_spin_lock_irq_desc(d, pirq, &flags);
+    desc = domain_spin_lock_irq_desc(d, irq, &flags);
     if ( desc == NULL )
         return 0;
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 24 18:05:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 18:05:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569223.889546 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNzwL-00057H-5N; Mon, 24 Jul 2023 18:05:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569223.889546; Mon, 24 Jul 2023 18:05:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qNzwL-00057A-2c; Mon, 24 Jul 2023 18:05:49 +0000
Received: by outflank-mailman (input) for mailman id 569223;
 Mon, 24 Jul 2023 18:05:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qNzwJ-000574-AV
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 18:05:47 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNzwI-0008QN-I6; Mon, 24 Jul 2023 18:05:46 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qNzwI-0000CF-Ab; Mon, 24 Jul 2023 18:05:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=zMwsL7LXC5D9/g9ebjweC53RF9AWepSVWZgXww5RXuM=; b=H/qawPzEb05+WegpGgZ5gKGpAR
	72NyYKaAYcj72kLMCiZG3AyfXI1y+aQAF4YUPHvDNcj03A1akEC9NRfNgPSABtuoldtDaBBNRHV89
	VJ7pVupt0HYogBUoHGwlxxmRdekdBKdzt2+UOt6vt56sXt/YHJlhtlOFWUPBM89bjKic=;
Message-ID: <2a80d651-10ea-cde4-354d-7d9ac7addda3@xen.org>
Date: Mon, 24 Jul 2023 19:05:44 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [XEN PATCH 2/3] xen/arm: irq: address violations of MISRA C: 2012
 Rules 8.2 and 8.3
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1690217195.git.federico.serafini@bugseng.com>
 <a62e88a9c29cf7866c251968b5a5b6865aff4a2a.1690217195.git.federico.serafini@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <a62e88a9c29cf7866c251968b5a5b6865aff4a2a.1690217195.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 24/07/2023 18:50, Federico Serafini wrote:
> Give a name to unnamed parameters thus addressing violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names and types used in function
> declarations and the ones used in the corresponding function
> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
> ("All declarations of an object or function shall use the same names
> and type qualifiers").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

I think it would be better if this is folded in patch #1 where you 
modify the prototype.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 18:20:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 18:20:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569225.889557 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO0AV-0007VC-EN; Mon, 24 Jul 2023 18:20:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569225.889557; Mon, 24 Jul 2023 18:20:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO0AV-0007V5-Av; Mon, 24 Jul 2023 18:20:27 +0000
Received: by outflank-mailman (input) for mailman id 569225;
 Mon, 24 Jul 2023 18:20:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qO0AT-0007Uy-Sg
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 18:20:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qO0AT-0000Nr-24; Mon, 24 Jul 2023 18:20:25 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qO0AS-0001Ct-QI; Mon, 24 Jul 2023 18:20:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=IQup0LI22JV56F7wY+aW3LCWMgtFXWKwrVumGyQlX0A=; b=3fLMoVR49P0iBWbEaXU2XnZhyD
	wsCfYypnZUfwNb8npZNOKufC+XAU6MbDGEW5bylXi2XaSISBtgCBiCyWJhQZMRyM17+DHQyotNQTl
	r48uY2XfRRKLN79JUSn+40dxK7qvz+HiwsxRDrcGpxksTl0JwqRCbkYj9/IyoJqRAQDI=;
Message-ID: <79ecab0a-cb91-cc95-fd31-c76ec287fa9b@xen.org>
Date: Mon, 24 Jul 2023 19:20:22 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH 6/8] mm/pdx: Standardize region validation wrt pdx
 compression
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-7-alejandro.vallejo@cloud.com>
 <1eb58b83-87ee-d738-08b0-948a8b48773a@xen.org>
 <64be6c1c.7b0a0220.49ba9.0e38@mx.google.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <64be6c1c.7b0a0220.49ba9.0e38@mx.google.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Alejandro,

On 24/07/2023 13:18, Alejandro Vallejo wrote:
> On Fri, Jul 21, 2023 at 06:05:51PM +0100, Julien Grall wrote:
>> Hi Alejandro,
>>
>> On 17/07/2023 17:03, Alejandro Vallejo wrote:
>>> +bool pdx_is_region_compressible(unsigned long smfn, unsigned long emfn)
>>
>> For newer interface, I would rather prefer if we use start + size. It is
>> easier to reason (you don't have to wonder whether 'emfn' is inclusive or
>> not) and avoid issue in the case you are trying to handle a region right at
>> the end of the address space as emfn would be 0 in the non-inclusive case
>> (not much a concern for MFNs as the last one should be invalid, but it makes
>> harder to reason).
> I could agree on this, but every single caller is based on (smfn, emfn),
> so it needlessly forces every caller to perform conversions where the
> callee can do it just once.

That's indeed one way to see it. The problem is that...

> That said, I think your point makes sense and
> it ought to be done. Probably as as part of a bigger refactor where
> (smfn, emfn)-based functions are turned into (base, len) variants.

... clean-up tends to be put in the back-burner and we just continue to 
add new use. This makes the task to remove every use a lot more 
difficult. So there is a point when one has to say no more.

Therefore, I would strongly prefer if each callers are doing the 
computation. The rest can be removed leisurely.

Let see what the opinion of the other maintainers.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 19:50:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 19:50:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569232.889566 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO1ZQ-0008EZ-VP; Mon, 24 Jul 2023 19:50:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569232.889566; Mon, 24 Jul 2023 19:50:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO1ZQ-0008ES-Sh; Mon, 24 Jul 2023 19:50:16 +0000
Received: by outflank-mailman (input) for mailman id 569232;
 Mon, 24 Jul 2023 19:50:15 +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
 <SRS0=ymW7=DK=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qO1ZP-0008EM-Go
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 19:50:15 +0000
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com
 [2a00:1450:4864:20::130])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4de2f44f-2a5b-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 21:50:13 +0200 (CEST)
Received: by mail-lf1-x130.google.com with SMTP id
 2adb3069b0e04-4fb863edcb6so7151030e87.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 12:50:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4de2f44f-2a5b-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690228213; x=1690833013;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Om4Ojxr126IDdlj6zdRkR8pSwS+LP03jHkiJwEpCx/s=;
        b=m8iUL22DTywd0S9tqCFVe8Xjqy3JPavpPH2em0rnnNNNqlUE4hMbZ4KIUcbnsBchEj
         DY/voo/S9px/zwjZHB4fM7F433NAOQOiCchXmpf+yMyfxh9IhKhmb6MXOGZnis6O0cnj
         BRI2Gof6BtSrNY2ldrzhCOcc3ptaiiPCyWNHDlOSX2RxaCx5W5bj2hutARUtizjo0a6G
         EcTMFeUxS0FummnhwefHMfOOS721VUXAbBm2OXWEIlNkMnCFcvQAi31xptpyYa6WQC9r
         E+BF+azm4WF6zKOlynsdQke4q0lsVKVwKRo286exme8MQYPwtW60NiRKk7Oe+c27Tyh+
         bVhQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690228213; x=1690833013;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=Om4Ojxr126IDdlj6zdRkR8pSwS+LP03jHkiJwEpCx/s=;
        b=X+EQVjkyKRCHdz2pD1LuDL0z7qfjlYYCc3q2NMaH16PcEzPQKGhV06Yj5ABjR7CjgQ
         H+W+g1zEoIG2aH3AKYfaXwED1+F8+ftrZQZxUQ4UqjTZC+a8fB1qsPOXgPj0id8u40Ak
         Slfjj/MEErb1bLlfLkYxK0hsGSyF8ydmeWF8BTxqlX1sn0xsSqfNMXYwrv/B5Sr1B69a
         CcIBnM0L6rM+xF12e6UQUqOxhxz2hUHMfClpigVY5wK891/iWPQVzp4gAywdZGZkTBVV
         LzhIFQpf4bRrhCykSxen6jNm5BCv++UQxzXLbcsNbHnKWeGsV1GgJ74oO50z4rstPFmr
         nLww==
X-Gm-Message-State: ABy/qLZASJLlBe86GK7SZsNHeODrYEUqxH2qcs4uom+hVoriQK8qJh73
	VmnG/Z4A+5NJpoUkE1NwWU7aEsVZPR8tu6E4iZw=
X-Google-Smtp-Source: APBJJlHDBm6FgjYq4tytAG0K99zsRfwcBX6SSiz4i+Bn+kKiJYHgDg+Wf8MxfTP2inw/eRBHjm3k17SX/IW9kebxSGs=
X-Received: by 2002:a19:ca5a:0:b0:4fd:d862:72a6 with SMTP id
 h26-20020a19ca5a000000b004fdd86272a6mr5417924lfj.53.1690228212284; Mon, 24
 Jul 2023 12:50:12 -0700 (PDT)
MIME-Version: 1.0
References: <20230724125857.11133-1-jandryuk@gmail.com> <20230724125857.11133-7-jandryuk@gmail.com>
 <7636d3d2-c78d-711a-ed90-aedd1b464c6c@suse.com>
In-Reply-To: <7636d3d2-c78d-711a-ed90-aedd1b464c6c@suse.com>
From: Jason Andryuk <jandryuk@gmail.com>
Date: Mon, 24 Jul 2023 15:49:58 -0400
Message-ID: <CAKf6xpt1LzKMv7E-G3sTpUWrEApy+BX8z7dG69oS1upHcpytMg@mail.gmail.com>
Subject: Re: [PATCH v6 06/15] cpufreq: Add Hardware P-State (HWP) driver
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, 
	Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Jul 24, 2023 at 12:15=E2=80=AFPM Jan Beulich <jbeulich@suse.com> wr=
ote:
>
> On 24.07.2023 14:58, Jason Andryuk wrote:
> > --- /dev/null
> > +++ b/xen/arch/x86/acpi/cpufreq/hwp.c
> > @@ -0,0 +1,521 @@
> > +/* SPDX-License-Identifier: GPL-2.0-only */
> > +/*
> > + * hwp.c cpufreq driver to run Intel Hardware P-States (HWP)
> > + *
> > + * Copyright (C) 2021 Jason Andryuk <jandryuk@gmail.com>
> > + */
> > +
> > +#include <xen/cpumask.h>
> > +#include <xen/init.h>
> > +#include <xen/param.h>
> > +#include <xen/xmalloc.h>
> > +#include <asm/msr.h>
> > +#include <acpi/cpufreq/cpufreq.h>
> > +
> > +static bool __ro_after_init feature_hwp_notification;
> > +static bool __ro_after_init feature_hwp_activity_window;
> > +
> > +static bool __ro_after_init feature_hdc;
> > +
> > +static bool __ro_after_init opt_cpufreq_hdc =3D true;
> > +
> > +union hwp_request
> > +{
> > +    struct
> > +    {
> > +        unsigned int min_perf:8;
> > +        unsigned int max_perf:8;
> > +        unsigned int desired:8;
> > +        unsigned int energy_perf:8;
> > +        unsigned int activity_window:10;
> > +        bool package_control:1;
> > +        unsigned int :16;
> > +        bool activity_window_valid:1;
> > +        bool energy_perf_valid:1;
> > +        bool desired_valid:1;
> > +        bool max_perf_valid:1;
> > +        bool min_perf_valid:1;
> > +    };
> > +    uint64_t raw;
> > +};
> > +
> > +struct hwp_drv_data
> > +{
> > +    union
> > +    {
> > +        uint64_t hwp_caps;
> > +        struct
> > +        {
> > +            unsigned int highest:8;
> > +            unsigned int guaranteed:8;
> > +            unsigned int most_efficient:8;
> > +            unsigned int lowest:8;
> > +            unsigned int :32;
> > +        } hw;
> > +    };
> > +    union hwp_request curr_req;
> > +    int ret;
> > +    uint16_t activity_window;
> > +    uint8_t minimum;
> > +    uint8_t maximum;
> > +    uint8_t desired;
> > +    uint8_t energy_perf;
> > +};
> > +static DEFINE_PER_CPU_READ_MOSTLY(struct hwp_drv_data *, hwp_drv_data)=
;
> > +
> > +#define hwp_err(cpu, fmt, ...) \
> > +    printk(XENLOG_ERR "HWP: CPU%u error: " fmt, cpu, ##__VA_ARGS__)
> > +#define hwp_info(fmt, ...)    printk(XENLOG_INFO "HWP: " fmt, ##__VA_A=
RGS__)
>
> I'm not convinced ", ##__VA_ARGS__" is a good construct to use. I notice
> we have a few instances (mainly in code inherited from elsewhere), but I
> think it ought to either be plain C99 style (without the ##) or purely
> the gcc extension form (not using __VA_ARGS__).

Using plain __VA_ARGS__ doesn't work for the cases without arguments:
arch/x86/acpi/cpufreq/hwp.c:78:53: error: expected expression before =E2=80=
=98)=E2=80=99 token
   78 |         printk(XENLOG_DEBUG "HWP: " fmt, __VA_ARGS__);  \
      |                                                     ^
arch/x86/acpi/cpufreq/hwp.c:201:9: note: in expansion of macro =E2=80=98hwp=
_verbose=E2=80=99
  201 |         hwp_verbose("disabled: No energy/performance
preference available");
      |         ^~~~~~~~~~~

I can use "__VA_OPT__(,) __VA_ARGS__" though.

> > +#define hwp_verbose(fmt, ...)                             \
> > +({                                                        \
> > +    if ( cpufreq_verbose )                                \
> > +        printk(XENLOG_DEBUG "HWP: " fmt, ##__VA_ARGS__);  \
>
> (One more here then.)
>
> > +static bool hwp_handle_option(const char *s, const char *end)
>
> __init?

Yes, thanks.

> > +static void hwp_get_cpu_speeds(struct cpufreq_policy *policy)
> > +{
> > +    uint32_t base_khz, max_khz, bus_khz, edx;
> > +
> > +    cpuid(0x16, &base_khz, &max_khz, &bus_khz, &edx);
> > +
> > +    policy->cpuinfo.perf_freq =3D base_khz * 1000;
> > +    policy->cpuinfo.min_freq =3D base_khz * 1000;
> > +    policy->cpuinfo.max_freq =3D max_khz * 1000;
> > +    policy->min =3D base_khz * 1000;
> > +    policy->max =3D max_khz * 1000;
>
> Earlier on I asked what about cases where the CPUID output yields
> some zero values (as I know can happen). Iirc you said this doesn't
> affect functionality, but wouldn't it make sense to have a comment
> to this effect here (proving the cases were thought through).

Sure.

> > +static void cf_check hwp_init_msrs(void *info)
> > +{
> > +    struct cpufreq_policy *policy =3D info;
> > +    struct hwp_drv_data *data =3D this_cpu(hwp_drv_data);
> > +    uint64_t val;
> > +
> > +    /*
> > +     * Package level MSR, but we don't have a good idea of packages he=
re, so
> > +     * just do it everytime.
> > +     */
> > +    if ( rdmsr_safe(MSR_PM_ENABLE, val) )
> > +    {
> > +        hwp_err(policy->cpu, "rdmsr_safe(MSR_PM_ENABLE)\n");
> > +        data->curr_req.raw =3D -1;
> > +        return;
> > +    }
> > +
> > +    /* Ensure we don't generate interrupts */
> > +    if ( feature_hwp_notification )
> > +        wrmsr_safe(MSR_HWP_INTERRUPT, 0);
> > +
> > +    if ( !(val & PM_ENABLE_HWP_ENABLE) )
> > +    {
> > +        val |=3D PM_ENABLE_HWP_ENABLE;
> > +        if ( wrmsr_safe(MSR_PM_ENABLE, val) )
> > +        {
> > +            hwp_err(policy->cpu, "wrmsr_safe(MSR_PM_ENABLE, %lx)\n", v=
al);
> > +            data->curr_req.raw =3D -1;
> > +            return;
> > +        }
> > +    }
> > +
> > +    if ( rdmsr_safe(MSR_HWP_CAPABILITIES, data->hwp_caps) )
> > +    {
> > +        hwp_err(policy->cpu, "rdmsr_safe(MSR_HWP_CAPABILITIES)\n");
> > +        goto error;
> > +    }
> > +
> > +    if ( rdmsr_safe(MSR_HWP_REQUEST, data->curr_req.raw) )
> > +    {
> > +        hwp_err(policy->cpu, "rdmsr_safe(MSR_HWP_REQUEST)\n");
> > +        goto error;
> > +    }
> > +
> > +    /*
> > +     * Check for APERF/MPERF support in hardware
> > +     * also check for boost/turbo support
> > +     */
> > +    intel_feature_detect(policy);
>
> Nit: The comment could do with adding at least a comma or semicolon.

Will change to "Check for turbo support."  APERF/MPERF was removed
from intel_feature_detect() in commit 4dd16c44152f ("x86/cpufreq:
Rework APERF/MPERF handling").

> > +    if ( feature_hdc &&
> > +         (!hdc_set_pkg_hdc_ctl(policy->cpu, opt_cpufreq_hdc) ||
> > +          !hdc_set_pm_ctl1(policy->cpu, opt_cpufreq_hdc)) )
> > +    {
> > +            hwp_err(policy->cpu, "Disabling HDC support\n");
> > +            feature_hdc =3D false;
>
> Nit: Too deep indentation.

Yes, thanks.

> > +static int cf_check hwp_cpufreq_cpu_init(struct cpufreq_policy *policy=
)
> > +{
> > +    static union hwp_request initial_req;
> > +    unsigned int cpu =3D policy->cpu;
> > +    struct hwp_drv_data *data;
> > +    bool first_run =3D false;
> > +
> > +    data =3D xzalloc(struct hwp_drv_data);
> > +    if ( !data )
> > +        return -ENOMEM;
> > +
> > +    policy->governor =3D &cpufreq_gov_hwp;
> > +
> > +    per_cpu(hwp_drv_data, cpu) =3D data;
> > +
> > +    on_selected_cpus(cpumask_of(cpu), hwp_init_msrs, policy, 1);
> > +
> > +    if ( data->curr_req.raw =3D=3D -1 )
> > +    {
> > +        hwp_err(cpu, "Could not initialize HWP properly\n");
> > +        per_cpu(hwp_drv_data, cpu) =3D NULL;
> > +        xfree(data);
> > +        return -ENODEV;
> > +    }
> > +
> > +    data->minimum =3D data->curr_req.min_perf;
> > +    data->maximum =3D data->curr_req.max_perf;
> > +    data->desired =3D data->curr_req.desired;
> > +    data->energy_perf =3D data->curr_req.energy_perf;
> > +    data->activity_window =3D data->curr_req.activity_window;
> > +
> > +    if ( initial_req.raw =3D=3D 0 )
> > +    {
> > +        hwp_verbose("CPU%u: HWP_CAPABILITIES: %016lx\n", cpu, data->hw=
p_caps);
> > +        initial_req =3D data->curr_req;
> > +        first_run =3D true;
> > +    }
>
> What part of data->curr_req is guaranteed to be non-0 (for the condition
> around ...
>
> > +    if ( first_run || data->curr_req.raw !=3D initial_req.raw )
> > +        hwp_verbose("CPU%u: rdmsr HWP_REQUEST %016lx\n", cpu,
> > +                    data->curr_req.raw);
>
> ... this logging to be effective)?

Hmmm.  I think you are correct that there is no guarantee that
data->curr_req will be non-zero.  i.e. a BIOS could zero the whole
register.  In practice, I see 0x8000ff01 - energy_perf =3D 0x80, maximum
=3D 0xff and minimum =3D 0x01.

Would you prefer that I make first_run a static variable to track if
initial_req has been populated?

> > +static void cf_check hwp_set_misc_turbo(void *info)
> > +{
> > +    const struct cpufreq_policy *policy =3D info;
> > +    struct hwp_drv_data *data =3D per_cpu(hwp_drv_data, policy->cpu);
> > +    uint64_t msr;
> > +
> > +    data->ret =3D 0;
> > +
> > +    if ( rdmsr_safe(MSR_IA32_MISC_ENABLE, msr) )
> > +    {
> > +        hwp_verbose("CPU%u: error rdmsr_safe(MSR_IA32_MISC_ENABLE)\n",
> > +                    policy->cpu);
> > +        data->ret =3D -EINVAL;
> > +
> > +        return;
> > +    }
> > +
> > +    if ( policy->turbo =3D=3D CPUFREQ_TURBO_ENABLED )
> > +        msr &=3D ~MSR_IA32_MISC_ENABLE_TURBO_DISENGAGE;
> > +    else
> > +        msr |=3D MSR_IA32_MISC_ENABLE_TURBO_DISENGAGE;
> > +
> > +    if ( wrmsr_safe(MSR_IA32_MISC_ENABLE, msr) )
> > +    {
> > +        hwp_verbose("CPU%u: error wrmsr_safe(MSR_IA32_MISC_ENABLE): %0=
16lx\n",
> > +                    policy->cpu, msr);
> > +        data->ret =3D -EINVAL;
> > +    }
> > +}
>
> Neither of the two -EINVAL really indicate an invalid argument that was
> passed. Maybe EACCES (or less desirably EFAULT)?

Ok, I'll use EACCES.

> > @@ -89,15 +96,45 @@ static int __init cf_check setup_cpufreq_option(con=
st char *str)
> >          return 0;
> >      }
> >
> > -    if ( choice > 0 || !cmdline_strcmp(str, "xen") )
> > +    do
> >      {
> > -        xen_processor_pmbits |=3D XEN_PROCESSOR_PM_PX;
> > -        cpufreq_controller =3D FREQCTL_xen;
> > -        if ( *arg && *(arg + 1) )
> > -            return cpufreq_cmdline_parse(arg + 1);
> > -    }
> > +        const char *end =3D strchr(str, ';');
> > +
> > +        if ( end =3D=3D NULL )
> > +            end =3D strchr(str, '\0');
> > +
> > +        arg =3D strpbrk(str, ",:");
> > +        if ( !arg || arg > end )
> > +            arg =3D strchr(str, '\0');
> > +
> > +        if ( cpufreq_xen_cnt =3D=3D ARRAY_SIZE(cpufreq_xen_opts) )
> > +            return -E2BIG;
> > +
> > +        if ( choice > 0 || !cmdline_strcmp(str, "xen") )
> > +        {
> > +            xen_processor_pmbits |=3D XEN_PROCESSOR_PM_PX;
> > +            cpufreq_controller =3D FREQCTL_xen;
> > +            cpufreq_xen_opts[cpufreq_xen_cnt++] =3D CPUFREQ_xen;
> > +            ret =3D 0;
> > +            if ( arg[0] && arg[1] )
> > +                ret =3D cpufreq_cmdline_parse(arg + 1, end);
> > +        }
> > +        else if ( choice < 0 && !cmdline_strcmp(str, "hwp") )
> > +        {
> > +            xen_processor_pmbits |=3D XEN_PROCESSOR_PM_PX;
> > +            cpufreq_controller =3D FREQCTL_xen;
> > +            cpufreq_xen_opts[cpufreq_xen_cnt++] =3D CPUFREQ_hwp;
> > +            ret =3D 0;
> > +            if ( arg[0] && arg[1] )
> > +                ret =3D hwp_cmdline_parse(arg + 1, end);
> > +        }
> > +        else
> > +            ret =3D -EINVAL;
> > +
> > +        str =3D end ? ++end : end;
> > +    } while ( choice < 0 && ret =3D=3D 0 && *str );
>
> According to the earlier of the two lines, str may be NULL and hence
> cannot be dereferenced without first checking to be non-NULL. Earlier
> in the loop though you ensure end cannot be NULL. In that case,
> however, you point end at the nul character, so the increment above
> would point end at the next following one. So my guess is that you
> meant
>
>         str =3D *end ? ++end : end;

Yes, you are correct.  Thanks for catching it.

Thanks,
Jason


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 20:17:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 20:17:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569234.889577 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO1zC-0002Z9-42; Mon, 24 Jul 2023 20:16:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569234.889577; Mon, 24 Jul 2023 20:16:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO1zC-0002Z2-01; Mon, 24 Jul 2023 20:16:54 +0000
Received: by outflank-mailman (input) for mailman id 569234;
 Mon, 24 Jul 2023 20:16:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qO1zA-0002Ys-5w; Mon, 24 Jul 2023 20:16:52 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qO1zA-0002ry-27; Mon, 24 Jul 2023 20:16:52 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qO1z9-0005HC-Kd; Mon, 24 Jul 2023 20:16:51 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qO1z9-0005b1-J4; Mon, 24 Jul 2023 20:16:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=cyrddpTdu0RV2jFeNHL0z5qSnG9IbANMGMEJi7xKd0w=; b=EDYV/A9idh9PUJgPIihJO71+w5
	awOzGk/oRsI8UOWSOlh0KhfndXYaPP6MeUV8Jch6gwE70KqpFPkhPG96GSsFfFL+LDMo/3N/m60AI
	GaJzJtPlAJhE+TLhy/Pd/+m55ASwgXkkHbv7eCIeeITz5awSQUdznLwWecZRLbbhJ0aU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181999-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 181999: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=f91c5ea970675637721bb7f18adaa189837eb783
X-Osstest-Versions-That:
    xen=3a4e6f67bc689365680cd544d05c8772f56b7a91
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 24 Jul 2023 20:16:51 +0000

flight 181999 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181999/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  f91c5ea970675637721bb7f18adaa189837eb783
baseline version:
 xen                  3a4e6f67bc689365680cd544d05c8772f56b7a91

Last test of basis   181991  2023-07-24 13:02:07 Z    0 days
Testing same since   181999  2023-07-24 17:02:22 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   3a4e6f67bc..f91c5ea970  f91c5ea970675637721bb7f18adaa189837eb783 -> smoke


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 20:28:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 20:28:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569238.889586 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO2An-00049G-4f; Mon, 24 Jul 2023 20:28:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569238.889586; Mon, 24 Jul 2023 20:28:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO2An-000499-1u; Mon, 24 Jul 2023 20:28:53 +0000
Received: by outflank-mailman (input) for mailman id 569238;
 Mon, 24 Jul 2023 20:28:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Oom6=DK=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qO2Al-000493-Eb
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 20:28:51 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b162d782-2a60-11ee-b23c-6b7b168915f2;
 Mon, 24 Jul 2023 22:28:49 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36OKSPew061528
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Mon, 24 Jul 2023 16:28:31 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36OKSOYB061527;
 Mon, 24 Jul 2023 13:28:24 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b162d782-2a60-11ee-b23c-6b7b168915f2
Date: Mon, 24 Jul 2023 13:28:24 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: iwj@xenproject.org, wl@xen.org, Anthony PERARD <anthony.perard@citrix.com>,
        Juergen Gross <jgross@suse.com>,
        Marek =?iso-8859-1?Q?Marczykowski-G=F3recki?= <marmarek@invisiblethingslab.com>
Subject: Re: Python in Domain Configurations
Message-ID: <ZL7e6IcJWK38IHU7@mattapan.m5p.com>
References: <ZKiN80e08QIojRSL@mattapan.m5p.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <ZKiN80e08QIojRSL@mattapan.m5p.com>
X-Spam-Status: No, score=0.4 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

On Fri, Jul 07, 2023 at 03:13:07PM -0700, Elliott Mitchell wrote:
> 
> The only context I could find was 54fbaf446b and
> https://wiki.xenproject.org/wiki/PythonInXlConfig which don't explain
> the reasoning.
> 
> Would the maintainers be amenable to revisiting the decision to remove
> support for full Python in domain configuration files?

Any chance of this getting a response?

On examination it appears domain configuration files are a proper subset
of Python.  The interface to the parser is a bit interesting, but it
looks fairly simple to replace the parser with libpython.

My goal is to create an init script for some automatically started
domains.  Issue is there can be ordering concerns with domain start/stop,
and this seems best handled by adding an extra setting to the
configuration files.  If full Python syntax is available, I can use that
for this extra data.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Mon Jul 24 20:58:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 20:58:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569245.889597 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO2df-0007jT-Gj; Mon, 24 Jul 2023 20:58:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569245.889597; Mon, 24 Jul 2023 20:58:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO2df-0007jM-D9; Mon, 24 Jul 2023 20:58:43 +0000
Received: by outflank-mailman (input) for mailman id 569245;
 Mon, 24 Jul 2023 20:58:41 +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
 <SRS0=AJiQ=DK=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qO2dd-0007jG-C8
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 20:58:41 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dcb45c29-2a64-11ee-8612-37d641c3527e;
 Mon, 24 Jul 2023 22:58:39 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id BEDF361312;
 Mon, 24 Jul 2023 20:58:37 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11BDFC433C8;
 Mon, 24 Jul 2023 20:58:35 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dcb45c29-2a64-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690232317;
	bh=vicWDrcK2udb1mEquP0na6Li+ktfQpcLEkEHmBSAk7A=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=mUQQ+/zbERJzatG06vwbmYisF0FTy2SkeQh+C1zeqg8nqKRkF6WWSDID4W6MsTmkb
	 so4eptLKiVbJfCW2osAuDkrGGPJ6/oAdh0i3AuHF+HGrQ+2Ra06eo0EbWXua0gF+eo
	 0zfJK+71TpvpfG04K3s2kL/XjMKxhRbXdkevRkMl1HmFO9mpUJFe0ruZhRq6g1hOle
	 EW4/zAJInL06ldh+DE6TmiT92UsH7e3twI3Qe0UMQrJpvEhALCQaNixqMl/e1RjtTo
	 CTI4RB1G+e18nEnMKmoJ8OmHTfp6Rch4lg2jy58fVUYB7f2+jA28XtCZJnpXpSHGZs
	 MmR/jEmgwui6A==
Date: Mon, 24 Jul 2023 13:58:34 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Oleksii <oleksii.kurochko@gmail.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>, 
    andrew.cooper3@citrix.com, xen-devel@lists.xenproject.org, 
    Doug Goldstein <cardoe@cardoe.com>, 
    "committers@xenproject.org" <committers@xenproject.org>
Subject: Re: [PATCH] automation: avoid duplicated builds of staging branch
In-Reply-To: <ccfad0f751df1e498d1c5cea3eb373e263f91d00.camel@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2307241357570.3118466@ubuntu-linux-20-04-desktop>
References: <20230717130925.28183-1-marmarek@invisiblethingslab.com>  <cf7ac648-dbef-80bb-986b-3fe0daef855a@citrix.com>  <ZLVLaPeyOwDYYUXL@mail-itl>  <alpine.DEB.2.22.394.2307211627080.3118466@ubuntu-linux-20-04-desktop>  <ZLsd3tdSvTLwIyt3@mail-itl> 
 <alpine.DEB.2.22.394.2307211712430.3118466@ubuntu-linux-20-04-desktop>  <ZLshtl8KKgyR1wlY@mail-itl>  <alpine.DEB.2.22.394.2307211749270.3118466@ubuntu-linux-20-04-desktop>  <ZLsqSWXvwxBQK3NG@mail-itl>  <alpine.DEB.2.22.394.2307211811020.3118466@ubuntu-linux-20-04-desktop>
 <ccfad0f751df1e498d1c5cea3eb373e263f91d00.camel@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 24 Jul 2023, Oleksii wrote:
> Hi Stefano,
> 
> On Fri, 2023-07-21 at 18:18 -0700, Stefano Stabellini wrote:
> > Hi Andrew, Oleksii,
> > 
> > Please see below.
> > 
> > It looks like you have configured your personal repositories to
> > mirror
> > upstream Xen:
> > 
> > https://gitlab.com/xen-project/people/olkur/xen
> > https://gitlab.com/xen-project/people/andyhhp/xen
> > 
> > Make sure that the option "Trigger pipelines for mirror updates" is
> > unselected.
> > 
> > If you setup the mirror a long time ago, you might want to stop the
> > mirror and start it again.
> > 
> > I have just done the same for fusa/xen-integration: I had to go to
> > settings->repository, stop the existing mirror, and create a new one
> > making sure "Trigger pipelines for mirror updates" is off.
> I checked the option is unselected.
> 
> But I have selected "Mirror all branches" in "Mirror branches".
> I can use "Mirror specific branches" to avoid 'staging' mirroring.
> 
> Will it be enough?

My understanding is that if you already have "Trigger pipelines for
mirror updates" unselected, then you shouldn't need anything else.


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 22:22:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 22:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569250.889606 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO3wS-0008Q0-DV; Mon, 24 Jul 2023 22:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569250.889606; Mon, 24 Jul 2023 22:22:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO3wS-0008Pt-Ax; Mon, 24 Jul 2023 22:22:12 +0000
Received: by outflank-mailman (input) for mailman id 569250;
 Mon, 24 Jul 2023 22:22:10 +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
 <SRS0=AJiQ=DK=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qO3wQ-0008Pn-D2
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 22:22:10 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 861d92c1-2a70-11ee-8612-37d641c3527e;
 Tue, 25 Jul 2023 00:22:07 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 608E7613C5;
 Mon, 24 Jul 2023 22:22:06 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA059C433C7;
 Mon, 24 Jul 2023 22:22:03 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 861d92c1-2a70-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690237325;
	bh=2zSe2c6mZbuMMjAXJUZWo9zGelSBJohgIrq4LtFzB5k=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=XksA0wxe3MC4LqgaZULqJr0B//8FYZPHv+7ZHvgIJxct+XPJR04csWHJKvymicL2k
	 zTXwM3IYe31eUcloovpifw6YODx5rHNv8pOSiPegcj07K9OIoVSjqthj/RsLFmhHNo
	 dEBew2stsWZgA7upQThHmecjhy0uzCAujD73DXce40Va3Trx/N74YXClEhuhmCaLnM
	 yvf1LT5GbECPGcIAv5OGRa57IFT8gsTpHimPfhDRa/tKH5H1AOy/faYCK22PDRgjbU
	 L/NL8BJDR2rvRC+ifBDHL99HVrGR29jfsI3jQfQXQ7pQQYD6D365lv/VTbQGjv68G3
	 gPR2HWGuyvANA==
Date: Mon, 24 Jul 2023 15:22:02 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    xen-devel@lists.xenproject.org, michal.orzel@amd.com, 
    xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, 
    consulting@bugseng.com, George Dunlap <george.dunlap@citrix.com>, 
    Dario Faggioli <dfaggioli@suse.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>
Subject: Re: [XEN PATCH] xen/sched: mechanical renaming to address MISRA
 C:2012 Rule 5.3
In-Reply-To: <8d31545a-dcc9-ef9e-8597-da8435872936@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307241519380.3118466@ubuntu-linux-20-04-desktop>
References: <9945fd23b0bb88f3e0c6054a7f992cfa642d3f9f.1689953420.git.nicola.vetrini@bugseng.com> <alpine.DEB.2.22.394.2307211601230.3118466@ubuntu-linux-20-04-desktop> <8d31545a-dcc9-ef9e-8597-da8435872936@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Sat, 22 Jul 2023, Nicola Vetrini wrote:
> On 22/07/23 01:06, Stefano Stabellini wrote:
> > On Fri, 21 Jul 2023, Nicola Vetrini wrote:
> > > Rule 5.3 has the following headline:
> > > "An identifier declared in an inner scope shall not hide an
> > > identifier declared in an outer scope"
> > > 
> > > The renaming s/sched_id/scheduler_id of the function defined in
> > > 'xen/common/sched/core.c' prevents any hiding of that function
> > > by the many instances of omonymous function parameters.
> > > 
> > > Similarly, the renames
> > > - s/ops/operations
> > > - s/do_softirq/exec_softirq
> > > - s/loop/it
> > > are introduced for parameter names, to avoid any conflict
> > > with the homonymous variable or function defined in an enclosing
> > > scope.
> > > 
> > > Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> > > ---
> > >   xen/common/sched/core.c    | 18 +++++++++---------
> > >   xen/common/sched/credit2.c |  4 ++--
> > >   xen/common/sysctl.c        |  2 +-
> > >   xen/include/xen/sched.h    |  2 +-
> > >   4 files changed, 13 insertions(+), 13 deletions(-)
> > > 
> > > diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
> > > index 022f548652..e74b1208bd 100644
> > > --- a/xen/common/sched/core.c
> > > +++ b/xen/common/sched/core.c
> > > @@ -99,13 +99,13 @@ static void sched_set_affinity(
> > >       struct sched_unit *unit, const cpumask_t *hard, const cpumask_t
> > > *soft);
> > >     static struct sched_resource *cf_check
> > > -sched_idle_res_pick(const struct scheduler *ops, const struct sched_unit
> > > *unit)
> > > +sched_idle_res_pick(const struct scheduler *operations, const struct
> > > sched_unit *unit)
> > 
> > nit: code style, now the line is over 80 chars, could be fixed on commit
> > 
> 
> Ok
> 
> 
> > > -/* sched_id - fetch ID of current scheduler */
> > > -int sched_id(void)
> > > +/* scheduler_id - fetch ID of current scheduler */
> > > +int scheduler_id(void)
> > >   {
> > >       return ops.sched_id;
> > >   }
> > > @@ -2579,7 +2579,7 @@ static void cf_check sched_slave(void)
> > >       struct sched_unit    *prev = vprev->sched_unit, *next;
> > >       s_time_t              now;
> > >       spinlock_t           *lock;
> > > -    bool                  do_softirq = false;
> > > +    bool                  exec_softirq = false;
> > 
> > We don't typically use "exec" especially in the context of softirqs.
> > I would just change it to "softirq".
> > 
> 
> Ok
> 
> > 
> > >       unsigned int          cpu = smp_processor_id();
> > >         ASSERT_NOT_IN_ATOMIC();
> > > @@ -2604,7 +2604,7 @@ static void cf_check sched_slave(void)
> > >               return;
> > >           }
> > >   -        do_softirq = true;
> > > +        exec_softirq = true;
> > >       }
> > >         if ( !prev->rendezvous_in_cnt )
> > > @@ -2614,7 +2614,7 @@ static void cf_check sched_slave(void)
> > >           rcu_read_unlock(&sched_res_rculock);
> > >             /* Check for failed forced context switch. */
> > > -        if ( do_softirq )
> > > +        if ( exec_softirq )
> > >               raise_softirq(SCHEDULE_SOFTIRQ);
> > >             return;
> > > diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
> > > index 87a1e31ee9..aba51a7963 100644
> > > --- a/xen/common/sched/credit2.c
> > > +++ b/xen/common/sched/credit2.c
> > > @@ -3884,7 +3884,7 @@ csched2_dump(const struct scheduler *ops)
> > >       list_for_each_entry ( rqd, &prv->rql, rql )
> > >       {
> > >           struct list_head *iter, *runq = &rqd->runq;
> > > -        int loop = 0;
> > > +        int it = 0;
> > 
> > Nice catch! This is almost a bug fix.
> > 
> > 
> > >           /* We need the lock to scan the runqueue. */
> > >           spin_lock(&rqd->lock);
> > > @@ -3901,7 +3901,7 @@ csched2_dump(const struct scheduler *ops)
> > >                 if ( svc )
> > >               {
> > > -                printk("\t%3d: ", loop++);
> > > +                printk("\t%3d: ", it++);
> > >                   csched2_dump_unit(prv, svc);
> > >               }
> > >           }
> > > diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
> > > index 0cbfe8bd44..7cabfb0230 100644
> > > --- a/xen/common/sysctl.c
> > > +++ b/xen/common/sysctl.c
> > > @@ -71,7 +71,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t)
> > > u_sysctl)
> > >           break;
> > >         case XEN_SYSCTL_sched_id:
> > > -        op->u.sched_id.sched_id = sched_id();
> > > +        op->u.sched_id.sched_id = scheduler_id();
> > 
> > I am confused about this one. There is no global variable or no other
> > global function named "sched_id". Why do we need to rename sched_id to
> > scheduler_id?
> > 
> 
> sched_id is also a common parameter name used by functions declared where the
> declaration of function 'sched_id' is also visible, so it's entirely
> equivalent whether to change parameter names or the function identifier, but
> since there's just one usage of the function (in 'xen/common/sysctl.c') I
> preferred to make the minimal change in the patch. If you prefer this done the
> other way around, no problem.

I searched through the code and there aren't that many parameters or
local variables called "sched_id" maybe only 5-6. Still, thinking about
it, I think it is better to rename the function to scheduler_id() as you
did in this patch.

Cheers,

Stefano


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 22:24:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 22:24:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569252.889617 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO3yV-0000WV-QI; Mon, 24 Jul 2023 22:24:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569252.889617; Mon, 24 Jul 2023 22:24:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO3yV-0000WO-NZ; Mon, 24 Jul 2023 22:24:19 +0000
Received: by outflank-mailman (input) for mailman id 569252;
 Mon, 24 Jul 2023 22:24:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=AJiQ=DK=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qO3yU-0000WC-HS
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 22:24:18 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d2c9202c-2a70-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 00:24:16 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 4A5C26143D;
 Mon, 24 Jul 2023 22:24:15 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78D18C433C7;
 Mon, 24 Jul 2023 22:24:13 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d2c9202c-2a70-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690237454;
	bh=T4VaUWM7QMySV5arEfjq710+X6f2/x+T6JgWklnuo58=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=FQhBwsG0uVLL6zEuQxekSWx3wzp6wbjsbBh51uQ+a1lRB9b7m5uVDXaK0qaYQP0Nx
	 ImqfttZHRJTcXrQK5bZ0WGD54x5sBbKycCT9YDquhc2gHX3Y4QF6stnooXY+2CXAfn
	 04uQF6rgKoieGqSwqz866jGfk17OfAnZQIZgAcC+l4J8OQDpCMWGjgbyH/rVraMBOt
	 EvCMZYnphwyzT8ULNcevFEVHC+9cgNCCgXHEranKVFSOnyCS7VFsmyqJg6K1yNyRoY
	 13MiIbcQN2H7VUMPxCTGMYHi9/G87I9sdDGzC1W4YMA6kxZEZQIHKAilzV9oSRk8/8
	 ZZmcNEp0wsjeQ==
Date: Mon, 24 Jul 2023 15:24:11 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
    Bertrand Marquis <bertrand.marquis@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [XEN PATCH v2] xen/arm/atomic: change parameter name in
 atomic_cmpxchg() definition
In-Reply-To: <a45f6a84f3c50a694e0f55042ef1b2f9ad9ac57d.1690184136.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307241524050.3118466@ubuntu-linux-20-04-desktop>
References: <a45f6a84f3c50a694e0f55042ef1b2f9ad9ac57d.1690184136.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 24 Jul 2023, Federico Serafini wrote:
> Change parameter name from 'ptr' to 'v' in the function definition thus
> addressing violations of MISRA C:2012 Rule 8.3: "All declarations of an
> object or function shall use the same names and type qualifiers".
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes in v2:
>   - added arm tag;
>   - propagated change to arm32.
> ---
>  xen/arch/arm/include/asm/arm32/atomic.h | 8 ++++----
>  xen/arch/arm/include/asm/arm64/atomic.h | 4 ++--
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/xen/arch/arm/include/asm/arm32/atomic.h b/xen/arch/arm/include/asm/arm32/atomic.h
> index 2832a72792..33f9e73b19 100644
> --- a/xen/arch/arm/include/asm/arm32/atomic.h
> +++ b/xen/arch/arm/include/asm/arm32/atomic.h
> @@ -113,13 +113,13 @@ static inline void atomic_and(int m, atomic_t *v)
>  	: "cc");
>  }
>  
> -static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
> +static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
>  {
>  	int oldval;
>  	unsigned long res;
>  
>  	smp_mb();
> -	prefetchw(&ptr->counter);
> +	prefetchw(&v->counter);
>  
>  	do {
>  		__asm__ __volatile__("@ atomic_cmpxchg\n"
> @@ -127,8 +127,8 @@ static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
>  		"mov	%0, #0\n"
>  		"teq	%1, %4\n"
>  		"strexeq %0, %5, [%3]\n"
> -		    : "=&r" (res), "=&r" (oldval), "+Qo" (ptr->counter)
> -		    : "r" (&ptr->counter), "Ir" (old), "r" (new)
> +		    : "=&r" (res), "=&r" (oldval), "+Qo" (v->counter)
> +		    : "r" (&v->counter), "Ir" (old), "r" (new)
>  		    : "cc");
>  	} while (res);
>  
> diff --git a/xen/arch/arm/include/asm/arm64/atomic.h b/xen/arch/arm/include/asm/arm64/atomic.h
> index 2d42567866..4460165295 100644
> --- a/xen/arch/arm/include/asm/arm64/atomic.h
> +++ b/xen/arch/arm/include/asm/arm64/atomic.h
> @@ -105,7 +105,7 @@ static inline void atomic_and(int m, atomic_t *v)
>  	: "Ir" (m));
>  }
>  
> -static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
> +static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
>  {
>  	unsigned long tmp;
>  	int oldval;
> @@ -119,7 +119,7 @@ static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
>  "	stxr	%w0, %w4, %2\n"
>  "	cbnz	%w0, 1b\n"
>  "2:"
> -	: "=&r" (tmp), "=&r" (oldval), "+Q" (ptr->counter)
> +	: "=&r" (tmp), "=&r" (oldval), "+Q" (v->counter)
>  	: "Ir" (old), "r" (new)
>  	: "cc");
>  
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 22:29:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 22:29:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569255.889627 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO433-00019d-Bc; Mon, 24 Jul 2023 22:29:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569255.889627; Mon, 24 Jul 2023 22:29:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO433-00019W-8i; Mon, 24 Jul 2023 22:29:01 +0000
Received: by outflank-mailman (input) for mailman id 569255;
 Mon, 24 Jul 2023 22:29:00 +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
 <SRS0=AJiQ=DK=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qO432-00019Q-0V
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 22:29:00 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7a3f6c7c-2a71-11ee-8612-37d641c3527e;
 Tue, 25 Jul 2023 00:28:57 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 14A906144E;
 Mon, 24 Jul 2023 22:28:56 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6977AC433C8;
 Mon, 24 Jul 2023 22:28:54 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7a3f6c7c-2a71-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690237735;
	bh=UGSJRNRJY2sX+WOaCRfEkNafNwXKK+QCD1M7K1RX084=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=QKtS6FvrcwLehzVyxzzuRo+LTK2wd+UxHDfeQIE3ts82ji4ooE+k6S+MoQTAv/ol/
	 byuzgdvl27DpzDNrVcNRBDaIDu7HgTP02/GV0u5ZWgI/84y6ib1UmXvwyFn3e4vgMp
	 wHCoBdFke6Xqtgt0mFY8shxm6j0gLjcsWKjB8H/m6Zm630/l0qOhMr8JZOYo9V6BK9
	 muN+bQs3iD6vN4W7NSEn4iBKMYeL2XnhUOG+EZxkyhzzaejZjFyq6WxWKeu9LV/5fU
	 SVm/Cgr5ra3Z7TEmuPgtDH66L3uU0GidkzjcUTAw2VRv4Plgdl0scq6sincqAps0QX
	 hk1es57F1kLmg==
Date: Mon, 24 Jul 2023 15:28:52 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Julien Grall <julien@xen.org>
cc: xen-devel@lists.xenproject.org, nicola.vetrini@bugseng.com, 
    Julien Grall <jgrall@amazon.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Bertrand Marquis <bertrand.marquis@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH] xen/dt: Rework the prototype of dt_property_read_string()
 to help Eclair
In-Reply-To: <20230724102443.91894-1-julien@xen.org>
Message-ID: <alpine.DEB.2.22.394.2307241528150.3118466@ubuntu-linux-20-04-desktop>
References: <20230724102443.91894-1-julien@xen.org>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 24 Jul 2023, Julien Grall wrote:
> From: Julien Grall <jgrall@amazon.com>
> 
> Eclair vXXX is unable to prove the parameter out_string will only be
> used the return of dt_property_read_string() is 0. So it will consider
> that MISRA C:2012 Rule 9.1 was violated.
> 
> Rework the prototype so the string is returned and use ERR_PTR() to
> embed the error code.
> 
> Signed-off-by: Julien Grall <jgrall@amazon.com>

I'll let you sort out the best commit message. For the code changes:

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> 
> The XXX should be replaced with the version of Eclair. Nicola, can you
> provide it?
> ---
>  xen/arch/arm/domain_build.c   |  4 +++-
>  xen/arch/arm/psci.c           | 10 +++++-----
>  xen/common/device_tree.c      | 15 +++++++--------
>  xen/drivers/char/arm-uart.c   | 10 ++++++----
>  xen/include/xen/device_tree.h | 16 ++++++++--------
>  5 files changed, 29 insertions(+), 26 deletions(-)
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 39b4ee03a505..2f98f0b1bd9c 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -3850,7 +3850,9 @@ static int __init construct_domU(struct domain *d,
>  
>      kinfo.vpl011 = dt_property_read_bool(node, "vpl011");
>  
> -    rc = dt_property_read_string(node, "xen,enhanced", &dom0less_enhanced);
> +    dom0less_enhanced = dt_property_read_string(node, "xen,enhanced");
> +
> +    rc = IS_ERR(dom0less_enhanced) ? PTR_ERR(dom0less_enhanced) : 0;
>      if ( rc == -EILSEQ ||
>           rc == -ENODATA ||
>           (rc == 0 && !strcmp(dom0less_enhanced, "enabled")) )
> diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
> index 695d2fa1f1b5..8e01b5962c63 100644
> --- a/xen/arch/arm/psci.c
> +++ b/xen/arch/arm/psci.c
> @@ -8,7 +8,7 @@
>   * Copyright (c) 2013 Linaro Limited.
>   */
>  
> -
> +#include <xen/err.h>
>  #include <xen/types.h>
>  #include <xen/init.h>
>  #include <xen/mm.h>
> @@ -85,13 +85,13 @@ static int __init psci_features(uint32_t psci_func_id)
>  
>  static int __init psci_is_smc_method(const struct dt_device_node *psci)
>  {
> -    int ret;
>      const char *prop_str;
>  
> -    ret = dt_property_read_string(psci, "method", &prop_str);
> -    if ( ret )
> +    prop_str = dt_property_read_string(psci, "method");
> +    if ( IS_ERR(prop_str) )
>      {
> -        printk("/psci node does not provide a method (%d)\n", ret);
> +        printk("/psci node does not provide a method (%ld)\n",
> +               PTR_ERR(prop_str));
>          return -EINVAL;
>      }
>  
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 0677193ab370..11222c3a8abf 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -191,21 +191,20 @@ bool_t dt_property_read_u64(const struct dt_device_node *np,
>  
>      return 1;
>  }
> -int dt_property_read_string(const struct dt_device_node *np,
> -                            const char *propname, const char **out_string)
> +
> +const char *dt_property_read_string(const struct dt_device_node *np,
> +                                    const char *propname)
>  {
>      const struct dt_property *pp = dt_find_property(np, propname, NULL);
>  
>      if ( !pp )
> -        return -EINVAL;
> +        return ERR_PTR(-EINVAL);
>      if ( !pp->length )
> -        return -ENODATA;
> +        return ERR_PTR(-ENODATA);
>      if ( strnlen(pp->value, pp->length) >= pp->length )
> -        return -EILSEQ;
> -
> -    *out_string = pp->value;
> +        return ERR_PTR(-EILSEQ);
>  
> -    return 0;
> +    return pp->value;
>  }
>  
>  /**
> diff --git a/xen/drivers/char/arm-uart.c b/xen/drivers/char/arm-uart.c
> index 8098a968c285..b76d8063beee 100644
> --- a/xen/drivers/char/arm-uart.c
> +++ b/xen/drivers/char/arm-uart.c
> @@ -21,6 +21,7 @@
>  
>  #include <xen/console.h>
>  #include <xen/device_tree.h>
> +#include <xen/err.h>
>  #include <xen/param.h>
>  #include <xen/serial.h>
>  #include <xen/errno.h>
> @@ -55,16 +56,17 @@ static void __init dt_uart_init(void)
>          {
>              const char *stdout;
>  
> -            ret = dt_property_read_string(chosen, "stdout-path", &stdout);
> -            if ( ret >= 0 )
> +            stdout = dt_property_read_string(chosen, "stdout-path");
> +            if ( !IS_ERR(stdout) )
>              {
>                  printk("Taking dtuart configuration from /chosen/stdout-path\n");
>                  if ( strlcpy(opt_dtuart, stdout, sizeof(opt_dtuart))
>                       >= sizeof(opt_dtuart) )
>                      printk("WARNING: /chosen/stdout-path too long, truncated\n");
>              }
> -            else if ( ret != -EINVAL /* Not present */ )
> -                printk("Failed to read /chosen/stdout-path (%d)\n", ret);
> +            else if ( PTR_ERR(stdout) != -EINVAL /* Not present */ )
> +                printk("Failed to read /chosen/stdout-path (%ld)\n",
> +                       PTR_ERR(stdout));
>          }
>      }
>  
> diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
> index c2eada748915..492204b4feda 100644
> --- a/xen/include/xen/device_tree.h
> +++ b/xen/include/xen/device_tree.h
> @@ -486,18 +486,18 @@ static inline bool_t dt_property_read_bool(const struct dt_device_node *np,
>   *              if return value if 0.
>   *
>   * Search for a property in a device tree node and retrieve a null
> - * terminated string value (pointer to data, not a copy). Returns 0 on
> - * success, -EINVAL if the property does not exist, -ENODATA if property
> - * doest not have value, and -EILSEQ if the string is not
> - * null-terminated with the length of the property data.
> + * terminated string value (pointer to data, not a copy). Returns a
> + * pointer to a null terminated string on success, -EINVAL if the property
> + * does not exist, -ENODATA if property doest not have value, and -EILSEQ
> + * if the string is not null-terminated with the length of the property data.
> + *
> + * The caller should use IS_ERR(...) to check if an error is returned.
>   *
>   * Note that the empty string "" has length of 1, thus -ENODATA cannot
>   * be interpreted as an empty string.
> - *
> - * The out_string pointer is modified only if a valid string can be decoded.
>   */
> -int dt_property_read_string(const struct dt_device_node *np,
> -                            const char *propname, const char **out_string);
> +const char *dt_property_read_string(const struct dt_device_node *np,
> +                                    const char *propname);
>  
>  /**
>   * dt_property_match_string() - Find string in a list and return index
> -- 
> 2.40.1
> 


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 22:34:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 22:34:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569257.889636 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO48e-0002au-Ve; Mon, 24 Jul 2023 22:34:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569257.889636; Mon, 24 Jul 2023 22:34:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO48e-0002an-T8; Mon, 24 Jul 2023 22:34:48 +0000
Received: by outflank-mailman (input) for mailman id 569257;
 Mon, 24 Jul 2023 22:34:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=AJiQ=DK=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qO48e-0002ah-1s
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 22:34:48 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4a5521ec-2a72-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 00:34:46 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 4CDC961448;
 Mon, 24 Jul 2023 22:34:45 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90B39C433C7;
 Mon, 24 Jul 2023 22:34:43 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4a5521ec-2a72-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690238084;
	bh=7hit+tpHXPWv3dF1PQui/U29Bek1sYAJeFvTFP3tAjE=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=ZGcVIGI/IE5Vn1Y3bXpUn7KcR8VzsGTq8+52I+7WM8cU2d1ACf/zJT6fh5ysdlIZU
	 7HjcUpSyjpt87o0j9NX534Y1AiJ6ksp5ZVkqKv2Mklsdxesu2cRcOyhR0wX+5AUTYV
	 9ocQPkbW1AMI44P/VV5Df3ADh6kY5ulSSvojJnxAfV7cxwfK0c8OLFnXta83puyZ7g
	 gGtYPNq+p3QJ/Zrh2FO6TywnqbE/zmWLndlFmekEl2jInssBNX8xGe4QW7mbXRByyB
	 T1ekoIsHWssecIl3gh9XjzPFN8c2/8XBNHYIbjZGxrN48Rcu+k0dTQ1AGZFIpINuyH
	 Eq2R+kpMblGgQ==
Date: Mon, 24 Jul 2023 15:34:42 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org, 
    michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, 
    consulting@bugseng.com, Jan Beulich <jbeulich@suse.com>
Subject: Re: [XEN PATCH v2] efi: mechanical renaming to address MISRA C:2012
 Rule 5.3
In-Reply-To: <60e2908f5a6c8aec082b59b44a688c260805c7b2.1690208527.git.nicola.vetrini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307241534350.3118466@ubuntu-linux-20-04-desktop>
References: <60e2908f5a6c8aec082b59b44a688c260805c7b2.1690208527.git.nicola.vetrini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 24 Jul 2023, Nicola Vetrini wrote:
> Rule 5.3 has the following headline:
> "An identifier declared in an inner scope shall not hide an
> identifier declared in an outer scope"
> 
> The function parameters renamed in this patch are hiding a variable defined
> in an enclosing scope.
> 
> The following rename is made:
> - s/cfg/file/
> to distinguish from the variable 'cfg', which is hidden by the parameter inside
> the modified functions.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  xen/common/efi/boot.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
> index 24169b7b50..79a654af69 100644
> --- a/xen/common/efi/boot.c
> +++ b/xen/common/efi/boot.c
> @@ -528,10 +528,10 @@ static char * __init split_string(char *s)
>      return NULL;
>  }
>  
> -static char *__init get_value(const struct file *cfg, const char *section,
> +static char *__init get_value(const struct file *file, const char *section,
>                                const char *item)
>  {
> -    char *ptr = cfg->str, *end = ptr + cfg->size;
> +    char *ptr = file->str, *end = ptr + file->size;
>      size_t slen = section ? strlen(section) : 0, ilen = strlen(item);
>      bool match = !slen;
>  
> @@ -821,9 +821,9 @@ static bool __init read_section(const EFI_LOADED_IMAGE *image,
>      return true;
>  }
>  
> -static void __init pre_parse(const struct file *cfg)
> +static void __init pre_parse(const struct file *file)
>  {
> -    char *ptr = cfg->str, *end = ptr + cfg->size;
> +    char *ptr = file->str, *end = ptr + file->size;
>      bool start = true, comment = false;
>  
>      for ( ; ptr < end; ++ptr )
> @@ -844,7 +844,7 @@ static void __init pre_parse(const struct file *cfg)
>          else
>              start = 0;
>      }
> -    if ( cfg->size && end[-1] )
> +    if ( file->size && end[-1] )
>           PrintStr(L"No newline at end of config file,"
>                     " last line will be ignored.\r\n");
>  }
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 22:50:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 22:50:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569260.889647 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO4OB-00054E-DH; Mon, 24 Jul 2023 22:50:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569260.889647; Mon, 24 Jul 2023 22:50:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO4OB-000547-AJ; Mon, 24 Jul 2023 22:50:51 +0000
Received: by outflank-mailman (input) for mailman id 569260;
 Mon, 24 Jul 2023 22:50:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=AJiQ=DK=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qO4O9-000541-8i
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 22:50:49 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8737dc3a-2a74-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 00:50:47 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 70E406145D;
 Mon, 24 Jul 2023 22:50:46 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 805C7C433C8;
 Mon, 24 Jul 2023 22:50:44 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8737dc3a-2a74-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690239045;
	bh=pNNBq0RfOTyBuT58wWlas3Su+nG5r5Bea5RMeqWoue4=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=A7DgH5T7cKJRAShkT+Azz2jphbL5+7ETQaAu4rsNJ9vby9E0SZ72QSQnhaSqLjD42
	 bRi2SHlS8qoJg2IE8qz7E7TC5ua4JxKwZvslx/1p17kRVEUumfEWXovOI3abZxq0ml
	 mvB7Jk/rqo+IyFepQFpzAEpzDzC3U4zTkGROApASSlNLAdvI9BGhksHM/fS9bi3XT9
	 2xDMLwNEC8RzuaUCQHTbNJ486E36I8NuZIvGCGEPuMewHxZffpbTyRBxSq/xFYCovs
	 FEewZK+NvCKIi6OsbWcWIySoINiWcnZ7ESJYIn/aUK5qG0TRTqQrDYzE7OHWxB/0Dd
	 2vGWkSRfwL1FQ==
Date: Mon, 24 Jul 2023 15:50:42 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Wei Liu <wl@xen.org>
Subject: Re: [XEN PATCH 1/3] xen/irq: add missing parameter names
In-Reply-To: <54ce64f3634a19a834cc1ce5ed74527bf8fa9420.1690217195.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307241544080.3118466@ubuntu-linux-20-04-desktop>
References: <cover.1690217195.git.federico.serafini@bugseng.com> <54ce64f3634a19a834cc1ce5ed74527bf8fa9420.1690217195.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 24 Jul 2023, Federico Serafini wrote:
> -extern int pirq_guest_bind(struct vcpu *, struct pirq *, int will_share);
> -extern void pirq_guest_unbind(struct domain *d, struct pirq *);
> -extern void pirq_set_affinity(struct domain *d, int irq, const cpumask_t *);
> -extern irq_desc_t *domain_spin_lock_irq_desc(
> +extern int pirq_guest_bind(struct vcpu *v, struct pirq *pirq, int will_share);
> +extern void pirq_guest_unbind(struct domain *d, struct pirq *pirq);
> +extern void pirq_set_affinity(struct domain *d, int irq, const cpumask_t *mask);

This should be:
void pirq_set_affinity(struct domain *d, int pirq, const cpumask_t *mask)


Everything else looks good to me


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 22:55:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 22:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569262.889656 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO4Sg-0005fP-UL; Mon, 24 Jul 2023 22:55:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569262.889656; Mon, 24 Jul 2023 22:55:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO4Sg-0005fI-RW; Mon, 24 Jul 2023 22:55:30 +0000
Received: by outflank-mailman (input) for mailman id 569262;
 Mon, 24 Jul 2023 22:55:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=AJiQ=DK=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qO4Sf-0005fC-St
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 22:55:29 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2eabb6d4-2a75-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 00:55:28 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 5789D6145D;
 Mon, 24 Jul 2023 22:55:27 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id A362FC433C8;
 Mon, 24 Jul 2023 22:55:25 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2eabb6d4-2a75-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690239326;
	bh=D9aN3tyC2B0wvSthHOwUv/fEVrhSHzVK2GuhbKiPlGY=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=urKbb5rOZzlRedPGpFPI/bjbYbJmRwNeFNGcXXgal4GOMLDwDTeR8HCHvUlY90Iow
	 biD1IvZMQHCRz/gxZ7+ucjMRiJpuFpmAXf6CQXbNBwisedJHMKx75AlOwEJjMkwwO3
	 UBwk5aWXi6BaOhmGjS5B2p7LK3pMQ5/VeS1qTEacRs2Hnfnyz80oi9TXpsvIJ+mZE8
	 AMXbmNDGVqbRZY6IuTrD8IgWnExxitjkIxxlRRPAuxvirMGG3MBAZBbWonP9ql2LzC
	 G0H6gt2TUb3uCvxiuZx/run/NfoqDUnL42SV1gUtara7c7IYT3f1bTeyGsRef+ZHUp
	 10EGGgCx2Ga2Q==
Date: Mon, 24 Jul 2023 15:55:24 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
    Bertrand Marquis <bertrand.marquis@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [XEN PATCH 2/3] xen/arm: irq: address violations of MISRA C:
 2012 Rules 8.2 and 8.3
In-Reply-To: <a62e88a9c29cf7866c251968b5a5b6865aff4a2a.1690217195.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307241551380.3118466@ubuntu-linux-20-04-desktop>
References: <cover.1690217195.git.federico.serafini@bugseng.com> <a62e88a9c29cf7866c251968b5a5b6865aff4a2a.1690217195.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 24 Jul 2023, Federico Serafini wrote:
> Give a name to unnamed parameters thus addressing violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names and types used in function
> declarations and the ones used in the corresponding function
> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
> ("All declarations of an object or function shall use the same names
> and type qualifiers").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> ---
>  xen/arch/arm/irq.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
> index 16e56f8945..335e06a2a7 100644
> --- a/xen/arch/arm/irq.c
> +++ b/xen/arch/arm/irq.c
> @@ -58,7 +58,7 @@ hw_irq_controller no_irq_type = {
>  static irq_desc_t irq_desc[NR_IRQS];
>  static DEFINE_PER_CPU(irq_desc_t[NR_LOCAL_IRQS], local_irq_desc);
>  
> -irq_desc_t *__irq_to_desc(int irq)
> +struct irq_desc *__irq_to_desc(int irq)
>  {
>      if ( irq < NR_LOCAL_IRQS )
>          return &this_cpu(local_irq_desc)[irq];
> @@ -182,7 +182,8 @@ void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask)
>  }
>  
>  int request_irq(unsigned int irq, unsigned int irqflags,
> -                void (*handler)(int, void *, struct cpu_user_regs *),
> +                void (*handler)(int irq, void *dev_id,
> +                                struct cpu_user_regs *regs),

We have an inconsistency where the handler functions on x86 typically
call it void *data, while on arm they typically use void *dev_id
(see xen/arch/x86/irq.c:request_irq and
xen/arch/x86/hpet.c:hpet_interrupt_handler). I think we should be
consistent. Or, if this is not a MISRA requirement because this is just
a function pointer rather than a proper function, then I would leave it
alone.


>                  const char *devname, void *dev_id)
>  {
>      struct irqaction *action;
> @@ -617,7 +618,7 @@ void pirq_guest_unbind(struct domain *d, struct pirq *pirq)
>      BUG();
>  }
>  
> -void pirq_set_affinity(struct domain *d, int pirq, const cpumask_t *mask)
> +void pirq_set_affinity(struct domain *d, int irq, const cpumask_t *mask)

I think we should leave it as is because there is also the x86
implementation of pirq_set_affinity that uses int pirq as parameter. It
is not a good idea to introduce inconsistencies between the x86 and the
ARM versions of the same function.


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 23:09:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 23:09:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569264.889666 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO4fp-0007Db-2l; Mon, 24 Jul 2023 23:09:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569264.889666; Mon, 24 Jul 2023 23:09:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO4fp-0007DU-03; Mon, 24 Jul 2023 23:09:05 +0000
Received: by outflank-mailman (input) for mailman id 569264;
 Mon, 24 Jul 2023 23:09:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=AJiQ=DK=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qO4fo-0007DO-Fq
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 23:09:04 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1421c33e-2a77-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 01:09:03 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id C85886145F;
 Mon, 24 Jul 2023 23:09:01 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D7F4C433C8;
 Mon, 24 Jul 2023 23:08:59 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1421c33e-2a77-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690240141;
	bh=+GM9qScBHJhZPZmCDzrmXRXW1HhK2Vjnf0mP4FPhLrE=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=nMRx+P4DyEAexRJOE/r2mYNjGgrzqpYGqIQkMrWQ+IaXg+F+38KtgrcCpGfH+bvu1
	 O9hm/8w6aVb7Su1pFGvXJL+Lu+F9kys5qY3vlsNAks2JwIgwNHQPGJLnPmoRfW8IJ5
	 MikztO4rPl684SdPQXtDMW8JAee/FMbLTAb9lzzbOwXMa+nvZENoGzzL6aKqOLbr6h
	 Os1bQO9NS3YH2nuYtqL0C23AjFoow/cF00B8U0DMYjMNUIAPy+a+hShvzZi0XNLvJo
	 Gpv+k42PIg+NSu6DNZTkfCRlp5Pn2kQ8nFXKdw+mMWaRHCdjsWmIQX0VCjizRO9FyN
	 ym69HPRLe6jPg==
Date: Mon, 24 Jul 2023 16:08:58 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>
Subject: Re: [XEN PATCH 3/3] x86/irq: address violations of MISRA C:2012
 Rules 8.2 and 8.3
In-Reply-To: <ae48788c6c41e5e506b9995037d176ac8b08d3f2.1690217195.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307241558350.3118466@ubuntu-linux-20-04-desktop>
References: <cover.1690217195.git.federico.serafini@bugseng.com> <ae48788c6c41e5e506b9995037d176ac8b08d3f2.1690217195.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 24 Jul 2023, Federico Serafini wrote:
> Give a name to unnamed parameters thus addressing violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names and types used in function
> declarations and the ones used in the corresponding function
> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
> ("All declarations of an object or function shall use the same names
> and type qualifiers").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> ---
>  xen/arch/x86/include/asm/irq.h | 32 ++++++++++++++++----------------
>  xen/arch/x86/irq.c             | 28 ++++++++++++++--------------
>  2 files changed, 30 insertions(+), 30 deletions(-)
> 
> diff --git a/xen/arch/x86/include/asm/irq.h b/xen/arch/x86/include/asm/irq.h
> index 3f95dd39b7..bb8b7ff2cc 100644
> --- a/xen/arch/x86/include/asm/irq.h
> +++ b/xen/arch/x86/include/asm/irq.h
> @@ -101,18 +101,18 @@ void cf_check irq_move_cleanup_interrupt(struct cpu_user_regs *regs);
>  uint8_t alloc_hipriority_vector(void);
>  
>  void set_direct_apic_vector(
> -    uint8_t vector, void (*handler)(struct cpu_user_regs *));
> +    uint8_t vector, void (*handler)(struct cpu_user_regs *regs));
>  void alloc_direct_apic_vector(
> -    uint8_t *vector, void (*handler)(struct cpu_user_regs *));
> +    uint8_t *vector, void (*handler)(struct cpu_user_regs *regs));
>  
>  void do_IRQ(struct cpu_user_regs *regs);
>  
> -void cf_check disable_8259A_irq(struct irq_desc *);
> -void cf_check enable_8259A_irq(struct irq_desc *);
> +void cf_check disable_8259A_irq(struct irq_desc *desc);
> +void cf_check enable_8259A_irq(struct irq_desc *desc);
>  int i8259A_irq_pending(unsigned int irq);
>  void mask_8259A(void);
>  void unmask_8259A(void);
> -void init_8259A(int aeoi);
> +void init_8259A(int auto_eoi);
>  void make_8259A_irq(unsigned int irq);
>  bool bogus_8259A_irq(unsigned int irq);
>  int i8259A_suspend(void);
> @@ -148,9 +148,9 @@ int map_domain_pirq(struct domain *d, int pirq, int irq, int type,
>                             void *data);
>  int unmap_domain_pirq(struct domain *d, int pirq);
>  int get_free_pirq(struct domain *d, int type);
> -int get_free_pirqs(struct domain *, unsigned int nr);
> +int get_free_pirqs(struct domain *d, unsigned int nr);
>  void free_domain_pirqs(struct domain *d);
> -int map_domain_emuirq_pirq(struct domain *d, int pirq, int irq);
> +int map_domain_emuirq_pirq(struct domain *d, int pirq, int emuirq);
>  int unmap_domain_pirq_emuirq(struct domain *d, int pirq);
>  
>  /* Reset irq affinities to match the given CPU mask. */
> @@ -168,9 +168,9 @@ int irq_to_vector(int irq);
>   */
>  int create_irq(nodeid_t node, bool grant_access);
>  void destroy_irq(unsigned int irq);
> -int assign_irq_vector(int irq, const cpumask_t *);
> +int assign_irq_vector(int irq, const cpumask_t *mask);
>  
> -void cf_check irq_complete_move(struct irq_desc *);
> +void cf_check irq_complete_move(struct irq_desc *desc);
>  
>  extern struct irq_desc *irq_desc;
>  
> @@ -179,16 +179,16 @@ void unlock_vector_lock(void);
>  
>  void setup_vector_irq(unsigned int cpu);
>  
> -void move_native_irq(struct irq_desc *);
> -void move_masked_irq(struct irq_desc *);
> +void move_native_irq(struct irq_desc *desc);
> +void move_masked_irq(struct irq_desc *desc);
>  
> -int bind_irq_vector(int irq, int vector, const cpumask_t *);
> +int bind_irq_vector(int irq, int vector, const cpumask_t *mask);
>  
> -void cf_check end_nonmaskable_irq(struct irq_desc *, uint8_t vector);
> -void irq_set_affinity(struct irq_desc *, const cpumask_t *mask);
> +void cf_check end_nonmaskable_irq(struct irq_desc *desc, uint8_t vector);
> +void irq_set_affinity(struct irq_desc *desc, const cpumask_t *mask);
>  
> -int init_domain_irq_mapping(struct domain *);
> -void cleanup_domain_irq_mapping(struct domain *);
> +int init_domain_irq_mapping(struct domain *d);
> +void cleanup_domain_irq_mapping(struct domain *d);
>  
>  #define domain_pirq_to_irq(d, pirq) pirq_field(d, pirq, arch.irq, 0)
>  #define domain_irq_to_pirq(d, irq) ({                           \
> diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
> index 20150b1c7f..c2ec1182f1 100644
> --- a/xen/arch/x86/irq.c
> +++ b/xen/arch/x86/irq.c
> @@ -148,14 +148,14 @@ static void trace_irq_mask(uint32_t event, int irq, int vector,
>  }
>  
>  static int __init _bind_irq_vector(struct irq_desc *desc, int vector,
> -                                   const cpumask_t *cpu_mask)
> +                                   const cpumask_t *mask)
>  {
>      cpumask_t online_mask;
>      int cpu;
>  
>      BUG_ON((unsigned)vector >= X86_NR_VECTORS);
>  
> -    cpumask_and(&online_mask, cpu_mask, &cpu_online_map);
> +    cpumask_and(&online_mask, mask, &cpu_online_map);
>      if (cpumask_empty(&online_mask))
>          return -EINVAL;
>      if ( (desc->arch.vector == vector) &&
> @@ -177,7 +177,7 @@ static int __init _bind_irq_vector(struct irq_desc *desc, int vector,
>      return 0;
>  }
>  
> -int __init bind_irq_vector(int irq, int vector, const cpumask_t *cpu_mask)
> +int __init bind_irq_vector(int irq, int vector, const cpumask_t *mask)
>  {
>      struct irq_desc *desc = irq_to_desc(irq);
>      unsigned long flags;
> @@ -187,7 +187,7 @@ int __init bind_irq_vector(int irq, int vector, const cpumask_t *cpu_mask)
>  
>      spin_lock_irqsave(&desc->lock, flags);
>      spin_lock(&vector_lock);
> -    ret = _bind_irq_vector(desc, vector, cpu_mask);
> +    ret = _bind_irq_vector(desc, vector, mask);
>      spin_unlock(&vector_lock);
>      spin_unlock_irqrestore(&desc->lock, flags);
>  
> @@ -893,10 +893,10 @@ void irq_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
>      desc->status |= IRQ_MOVE_PENDING;
>  }
>  
> -void pirq_set_affinity(struct domain *d, int pirq, const cpumask_t *mask)
> +void pirq_set_affinity(struct domain *d, int irq, const cpumask_t *mask)

I welcome feedback from the other maintainers on this but I would keep
the original "pirq" parameter name here...


>  {
>      unsigned long flags;
> -    struct irq_desc *desc = domain_spin_lock_irq_desc(d, pirq, &flags);
> +    struct irq_desc *desc = domain_spin_lock_irq_desc(d, irq, &flags);
>  
>      if ( !desc )
>          return;
> @@ -915,16 +915,16 @@ uint8_t alloc_hipriority_vector(void)
>      return next++;
>  }
>  
> -static void (*direct_apic_vector[X86_NR_VECTORS])(struct cpu_user_regs *);
> +static void (*direct_apic_vector[X86_NR_VECTORS])(struct cpu_user_regs *regs);
>  void set_direct_apic_vector(
> -    uint8_t vector, void (*handler)(struct cpu_user_regs *))
> +    uint8_t vector, void (*handler)(struct cpu_user_regs *regs))
>  {
>      BUG_ON(direct_apic_vector[vector] != NULL);
>      direct_apic_vector[vector] = handler;
>  }
>  
>  void alloc_direct_apic_vector(
> -    uint8_t *vector, void (*handler)(struct cpu_user_regs *))
> +    uint8_t *vector, void (*handler)(struct cpu_user_regs *regs))
>  {
>      static DEFINE_SPINLOCK(lock);
>  
> @@ -964,7 +964,7 @@ static int __init cf_check irq_ratelimit_init(void)
>  __initcall(irq_ratelimit_init);
>  
>  int __init request_irq(unsigned int irq, unsigned int irqflags,
> -        void (*handler)(int, void *, struct cpu_user_regs *),
> +        void (*handler)(int irq, void *dev_id, struct cpu_user_regs *regs),
>          const char * devname, void *dev_id)

I think hpet_interrupt_handler should be adapted for consistency



>  {
>      struct irqaction * action;
> @@ -1194,9 +1194,9 @@ static void cf_check irq_guest_eoi_timer_fn(void *data)
>   * to the per-domain irq-to-vector mapping.
>   */
>  struct irq_desc *domain_spin_lock_irq_desc(
> -    struct domain *d, int pirq, unsigned long *pflags)
> +    struct domain *d, int irq, unsigned long *pflags)
>  {
> -    const struct pirq *info = pirq_info(d, pirq);
> +    const struct pirq *info = pirq_info(d, irq);
>  
>      return info ? pirq_spin_lock_irq_desc(info, pflags) : NULL;
>  }

... and here


> @@ -1525,14 +1525,14 @@ static int irq_acktype(const struct irq_desc *desc)
>      return 0;
>  }
>  
> -int pirq_shared(struct domain *d, int pirq)
> +int pirq_shared(struct domain *d, int irq)

and here


>  {
>      struct irq_desc    *desc;
>      const irq_guest_action_t *action;
>      unsigned long       flags;
>      int                 shared;
>  
> -    desc = domain_spin_lock_irq_desc(d, pirq, &flags);
> +    desc = domain_spin_lock_irq_desc(d, irq, &flags);

and here

I change the declarations as needed



>      if ( desc == NULL )
>          return 0;
>  
> -- 
> 2.34.1
> 
> 


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 23:27:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 23:27:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569267.889679 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO4xB-0001EE-J3; Mon, 24 Jul 2023 23:27:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569267.889679; Mon, 24 Jul 2023 23:27:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO4xB-0001E7-GT; Mon, 24 Jul 2023 23:27:01 +0000
Received: by outflank-mailman (input) for mailman id 569267;
 Mon, 24 Jul 2023 23:27:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=AJiQ=DK=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qO4xA-0001E1-3d
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 23:27:00 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 94da31fc-2a79-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 01:26:58 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id BF79F61464;
 Mon, 24 Jul 2023 23:26:56 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 631C9C433C7;
 Mon, 24 Jul 2023 23:26:54 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 94da31fc-2a79-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690241215;
	bh=VpbOjrX3jU4/CqCdljyGKHEWm7DOHDx2keBjS5cUgQU=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=jnIOAoX/wpFu3EH2c21D1BUMwRIIEzpvXNEbN4WZAyJIE7SHWs8bWw78Esht2ptU3
	 LA+DUpHQb11YoQwLP9wvnK1IF35gSNlgMeBnTjQO3fEyEm8cRVffqzOEwdhxfjAMWP
	 /d3YuN/relvLLMJYZP9EWw7UoOuCr2PiuptTZLS5wHYAyp6VDCIegv54DsChuEvirU
	 lF9TUGebfWhMzXOde9MZAIAnHb/DniM39kWlvRrsHJ6EoWIVKbv5AQ8edsrTy3x41k
	 mbt0dU4RjjQQZ3LGg431bNF0dqmcjssKovsGKMMwxkN9jk0KdLdb5o10krRNbUrLvM
	 S+LE77ZFvPOnw==
Date: Mon, 24 Jul 2023 16:26:52 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org, 
    michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, 
    consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>
Subject: Re: [XEN PATCH] docs/misra: document the usage of array range
 initializers
In-Reply-To: <5dc1aa0a5cd2ee3410047956f8e69c32c4b227ca.1690215341.git.nicola.vetrini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307241626270.3118466@ubuntu-linux-20-04-desktop>
References: <5dc1aa0a5cd2ee3410047956f8e69c32c4b227ca.1690215341.git.nicola.vetrini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 24 Jul 2023, Nicola Vetrini wrote:
> The usage of a documented GNU extension that allows a range of elements
> in an array to be initalized to the same value using a designated
> initalizer is added to this document, to fully comply with
> MISRA C:2012 Rule 1.1.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  docs/misra/C-language-toolchain.rst | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/docs/misra/C-language-toolchain.rst b/docs/misra/C-language-toolchain.rst
> index 8651f59118..785aed1eaf 100644
> --- a/docs/misra/C-language-toolchain.rst
> +++ b/docs/misra/C-language-toolchain.rst
> @@ -196,6 +196,10 @@ The table columns are as follows:
>       - X86_64
>       - See Section "6.9 128-bit Integers" of GCC_MANUAL.
>  
> +   * - Designated initializer for a range of elements
> +     - ARM64, X86_64
> +     - See Section "6.29 Designated Initializers" of GCC_MANUAL
> +
>  
>  Translation Limits
>  __________________
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 23:28:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 23:28:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569269.889690 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO4yr-0001le-Vi; Mon, 24 Jul 2023 23:28:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569269.889690; Mon, 24 Jul 2023 23:28:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO4yr-0001lX-S6; Mon, 24 Jul 2023 23:28:45 +0000
Received: by outflank-mailman (input) for mailman id 569269;
 Mon, 24 Jul 2023 23:28:44 +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
 <SRS0=AJiQ=DK=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qO4yq-0001lP-Ga
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 23:28:44 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d18323f2-2a79-11ee-8612-37d641c3527e;
 Tue, 25 Jul 2023 01:28:39 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id E0B7E61463;
 Mon, 24 Jul 2023 23:28:40 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9B1CC433C7;
 Mon, 24 Jul 2023 23:28:38 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d18323f2-2a79-11ee-8612-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690241320;
	bh=pJjCkS+RQ4jPSTKfXNZzI4LTvCdmA6xACWtWfciPIYU=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=YdvpVA/Iazd72NkvgXRFk5VnAp3RVdhaBwG81Y0Ov2VI73I8U3LM5WXyUNK817TNJ
	 wkqUUpx5samrTMSx/mu5ADg8y3bDiGeAOow1na/bkOtFksP/yXMESdb8/HJXWMtndW
	 ABB5XkhcYocTuDLMG2oY/7UpkmrZMFdnTE/pgT1Z5cwPZIcof2UhHD3HP6icV5UACY
	 Ig6oU7Z1lN7Wicqq9qlyw/6sLXLUV3k8S9FJHu2yaLe+Y9IQBR4MmrnIyPRaU4TrRM
	 d36cT99Rd4S5OJtSUsk6qZxU2PMEkCuYz5PrINtxnNFh1qDpvGuqaJK6c3RVkLaXRx
	 b1kWbQsAfeeow==
Date: Mon, 24 Jul 2023 16:28:37 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Leo Yan <leo.yan@linaro.org>
cc: xen-devel@lists.xenproject.org, Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>, 
    Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, 
    Bertrand Marquis <bertrand.marquis@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH] docs: Correct name for xen-command-line.pandoc
In-Reply-To: <20230724085211.1383703-1-leo.yan@linaro.org>
Message-ID: <alpine.DEB.2.22.394.2307241628300.3118466@ubuntu-linux-20-04-desktop>
References: <20230724085211.1383703-1-leo.yan@linaro.org>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 24 Jul 2023, Leo Yan wrote:
> In the commit d661611d08 ("docs/markdown: Switch to using pandoc, and
> fix underscore escaping"), the documentation suffix was changed from
> ".markdown" to ".pandoc"; however, the reference was missed to update.
> 
> This patch updates the documentation name to xen-command-line.pandoc.
> 
> Fixes: d661611d08 ("docs/markdown: Switch to using pandoc, and fix underscore escaping")
> Signed-off-by: Leo Yan <leo.yan@linaro.org>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  docs/features/sched_credit2.pandoc | 2 +-
>  docs/misc/arm/big.LITTLE.txt       | 2 +-
>  xen/common/Kconfig                 | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/docs/features/sched_credit2.pandoc b/docs/features/sched_credit2.pandoc
> index 436ff9f8f6..ef07e463cb 100644
> --- a/docs/features/sched_credit2.pandoc
> +++ b/docs/features/sched_credit2.pandoc
> @@ -27,7 +27,7 @@ different than `credit2`) parameter is passed to Xen via the
>  bootloader.
>  
>  Other parameters are available for tuning the behavior of Credit2
> -(see `docs/misc/xen-command-line.markdown` for a complete list and
> +(see `docs/misc/xen-command-line.pandoc` for a complete list and
>  for their meaning).
>  
>  Once the system is live, for creating a cpupool with Credit2 as
> diff --git a/docs/misc/arm/big.LITTLE.txt b/docs/misc/arm/big.LITTLE.txt
> index b6ea1c9d61..1d11058444 100644
> --- a/docs/misc/arm/big.LITTLE.txt
> +++ b/docs/misc/arm/big.LITTLE.txt
> @@ -42,5 +42,5 @@ The following option runs one domain vcpu as big and one as LITTLE:
>    cpus = ["0-3", "4-7"]
>  
>  
> -[1] docs/misc/xen-command-line.markdown
> +[1] docs/misc/xen-command-line.pandoc
>  [2] docs/man/xl.cfg.pod.5
> diff --git a/xen/common/Kconfig b/xen/common/Kconfig
> index dd8d7c3f1c..0d248ab941 100644
> --- a/xen/common/Kconfig
> +++ b/xen/common/Kconfig
> @@ -440,7 +440,7 @@ config DOM0_MEM
>  	  The specified string will be used for the dom0_mem parameter in
>  	  case it was not specified on the command line.
>  
> -	  See docs/misc/xen-command-line.markdown for the supported syntax.
> +	  See docs/misc/xen-command-line.pandoc for the supported syntax.
>  
>  	  Leave empty if you are not sure what to specify.
>  
> -- 
> 2.39.2
> 


From xen-devel-bounces@lists.xenproject.org Mon Jul 24 23:30:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Jul 2023 23:30:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569272.889700 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO50D-0003Ez-CT; Mon, 24 Jul 2023 23:30:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569272.889700; Mon, 24 Jul 2023 23:30:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO50D-0003Es-93; Mon, 24 Jul 2023 23:30:09 +0000
Received: by outflank-mailman (input) for mailman id 569272;
 Mon, 24 Jul 2023 23:30:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=AJiQ=DK=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qO50C-0003AN-0s
 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 23:30:08 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0561172e-2a7a-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 01:30:06 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 9CDE36140B;
 Mon, 24 Jul 2023 23:30:05 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B55FC433C8;
 Mon, 24 Jul 2023 23:30:03 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0561172e-2a7a-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690241404;
	bh=UfmnbT3l0HzeN3OL06xfSJs7nAyRX3AaBg2GvLVol5Q=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=cF8W7GGUekj9GcGaNDv/HYIY/P8WYdKqlElaY1KAKYlnzghGVb4iUg3Dk5WXnOQAF
	 9taiPhGJRXS4cL6hNwLBZl9npRgJ9ikw3n5OVdxa+ItfTqct4z9GwLzQMxxQ9WFEZO
	 fvyH+cgOpIX0e1KR58hjlUavrFnQqSGXwMFltYkUVZuhC8qkNSOnbvE54RSMjtxtgb
	 yfIfaOc7ZvUjr0y0EAI0EkXaQsc1tSG0P17Y1kvNoqcn7Zx7uM5pMdfzr3zIFpMzW+
	 71Hs76BUvNd2NiJaulry9h93O6iDs5emPMk0tofBh/j0/0U6uMh4a0pS6JDH4kyHyP
	 cDhbjpkNW1CWw==
Date: Mon, 24 Jul 2023 16:30:02 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>
Subject: Re: [XEN PATCH v2] device_tree: address violations of MISRA C:2012
 Rules 8.2 and 8.3
In-Reply-To: <502a92e9b53960a6b78fabb48d354cbb5bc1750c.1690187572.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307241629480.3118466@ubuntu-linux-20-04-desktop>
References: <502a92e9b53960a6b78fabb48d354cbb5bc1750c.1690187572.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 24 Jul 2023, Federico Serafini wrote:
> Give a name to unnamed parameters thus addressing violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names and types used in function
> declarations and the ones used in the corresponding function
> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
> ("All declarations of an object or function shall use the same names
> and type qualifiers").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes in v2:
>   - improved consistency in parameter renaming.
> ---
>  xen/common/device_tree.c      | 24 ++++++++++++------------
>  xen/include/xen/device_tree.h | 16 ++++++++--------
>  2 files changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 0677193ab3..d52531dc9f 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -85,11 +85,11 @@ struct dt_bus
>      unsigned int (*get_flags)(const __be32 *addr);
>  };
>  
> -void dt_get_range(const __be32 **cell, const struct dt_device_node *np,
> +void dt_get_range(const __be32 **cellp, const struct dt_device_node *np,
>                    u64 *address, u64 *size)
>  {
> -    *address = dt_next_cell(dt_n_addr_cells(np), cell);
> -    *size = dt_next_cell(dt_n_size_cells(np), cell);
> +    *address = dt_next_cell(dt_n_addr_cells(np), cellp);
> +    *size = dt_next_cell(dt_n_size_cells(np), cellp);
>  }
>  
>  void dt_set_cell(__be32 **cellp, int size, u64 val)
> @@ -993,9 +993,9 @@ int dt_device_get_paddr(const struct dt_device_node *dev, unsigned int index,
>  }
>  
>  int dt_for_each_range(const struct dt_device_node *dev,
> -                      int (*cb)(const struct dt_device_node *,
> +                      int (*cb)(const struct dt_device_node *dev,
>                                  uint64_t addr, uint64_t length,
> -                                void *),
> +                                void *data),
>                        void *data)
>  {
>      const struct dt_device_node *parent = NULL;
> @@ -1164,7 +1164,7 @@ unsigned int dt_number_of_irq(const struct dt_device_node *device)
>      return (intlen / intsize);
>  }
>  
> -unsigned int dt_number_of_address(const struct dt_device_node *dev)
> +unsigned int dt_number_of_address(const struct dt_device_node *device)
>  {
>      const __be32 *prop;
>      u32 psize;
> @@ -1173,20 +1173,20 @@ unsigned int dt_number_of_address(const struct dt_device_node *dev)
>      int onesize, na, ns;
>  
>      /* Get parent & match bus type */
> -    parent = dt_get_parent(dev);
> +    parent = dt_get_parent(device);
>      if ( parent == NULL )
>          return 0;
>  
>      bus = dt_match_bus(parent);
>      if ( !bus )
>          return 0;
> -    bus->count_cells(dev, &na, &ns);
> +    bus->count_cells(device, &na, &ns);
>  
>      if ( !DT_CHECK_COUNTS(na, ns) )
>          return 0;
>  
>      /* Get "reg" or "assigned-addresses" property */
> -    prop = dt_get_property(dev, bus->addresses, &psize);
> +    prop = dt_get_property(device, bus->addresses, &psize);
>      if ( prop == NULL )
>          return 0;
>  
> @@ -1197,9 +1197,9 @@ unsigned int dt_number_of_address(const struct dt_device_node *dev)
>  }
>  
>  int dt_for_each_irq_map(const struct dt_device_node *dev,
> -                        int (*cb)(const struct dt_device_node *,
> -                                  const struct dt_irq *,
> -                                  void *),
> +                        int (*cb)(const struct dt_device_node *dev,
> +                                  const struct dt_irq *dt_irq,
> +                                  void *data),
>                          void *data)
>  {
>      const struct dt_device_node *ipar, *tnode, *old = NULL;
> diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
> index c2eada7489..8d88159f76 100644
> --- a/xen/include/xen/device_tree.h
> +++ b/xen/include/xen/device_tree.h
> @@ -538,7 +538,7 @@ bool_t dt_machine_is_compatible(const char *compat);
>   * Returns a node pointer with refcount incremented, use
>   * of_node_put() on it when done.
>   */
> -struct dt_device_node *dt_find_node_by_name(struct dt_device_node *node,
> +struct dt_device_node *dt_find_node_by_name(struct dt_device_node *from,
>                                              const char *name);
>  
>  /**
> @@ -639,7 +639,7 @@ unsigned int dt_number_of_address(const struct dt_device_node *device);
>   * device-tree node. It's the high level pendant to dt_device_get_raw_irq().
>   */
>  int dt_device_get_irq(const struct dt_device_node *device, unsigned int index,
> -                      struct dt_irq *irq);
> +                      struct dt_irq *out_irq);
>  
>  /**
>   * dt_device_get_raw_irq - Resolve an interrupt for a device without translation
> @@ -652,7 +652,7 @@ int dt_device_get_irq(const struct dt_device_node *device, unsigned int index,
>   */
>  int dt_device_get_raw_irq(const struct dt_device_node *device,
>                            unsigned int index,
> -                          struct dt_raw_irq *irq);
> +                          struct dt_raw_irq *out_irq);
>  
>  /**
>   * dt_irq_translate - Translate an irq
> @@ -668,9 +668,9 @@ int dt_irq_translate(const struct dt_raw_irq *raw, struct dt_irq *out_irq);
>   * @data: Caller data passed to callback
>   */
>  int dt_for_each_irq_map(const struct dt_device_node *dev,
> -                        int (*cb)(const struct dt_device_node *,
> -                                  const struct dt_irq *,
> -                                  void *),
> +                        int (*cb)(const struct dt_device_node *dev,
> +                                  const struct dt_irq *dt_irq,
> +                                  void *data),
>                          void *data);
>  
>  /**
> @@ -680,9 +680,9 @@ int dt_for_each_irq_map(const struct dt_device_node *dev,
>   * @data: Caller data passed to callback
>   */
>  int dt_for_each_range(const struct dt_device_node *dev,
> -                      int (*cb)(const struct dt_device_node *,
> +                      int (*cb)(const struct dt_device_node *dev,
>                                  uint64_t addr, uint64_t length,
> -                                void *),
> +                                void *data),
>                        void *data);
>  
>  /**
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 00:09:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 00:09:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569280.889710 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO5bx-0007OC-PL; Tue, 25 Jul 2023 00:09:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569280.889710; Tue, 25 Jul 2023 00:09:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO5bx-0007O5-Li; Tue, 25 Jul 2023 00:09:09 +0000
Received: by outflank-mailman (input) for mailman id 569280;
 Tue, 25 Jul 2023 00:09:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ITxH=DL=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qO5bv-0007Nw-4H
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 00:09:07 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 75c4f875-2a7f-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 02:09:04 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 5698F61479;
 Tue, 25 Jul 2023 00:09:01 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05E6CC433C7;
 Tue, 25 Jul 2023 00:08:58 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 75c4f875-2a7f-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690243740;
	bh=pLvPK3SESVxCzqOo9IdyqWgmPHzBauHaicS0+AMw9Rw=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=Pjqv8a8lR0DGlf6kkXRGMJSQfvDtHFzgiMFfn48v+sUJNau/8upcDo4KIf69PPgjx
	 UVfTExx3jNeqCUjwiMzN1T32qfq68xkjy6UGTYANCc08RrMVuaq+5vaaHMQ8/IJ4OH
	 7qNSKtWBCDVVULiWdU1Nnr1fz+Wju1H1eiD7bKlMQ114f895YBuhQajxDV3cg+jRW2
	 qicXVjfGrLNHVi3Xd7GHtVFsLbAzlwO1CcckNijZqajOg9U1pcjUR3roB3IqiN93tf
	 F/kTbogFvuvuAmsskIjxf/iijW2yL5N93liEx9S/4Xk15vsRqZTLLNH7fVNcqzwBEX
	 gFj0K5WH1Gpwg==
Date: Mon, 24 Jul 2023 17:08:57 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: xen-devel@lists.xenproject.org, Doug Goldstein <cardoe@cardoe.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, 
    "Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: Re: [XEN PATCH v2] automation: add ECLAIR pipeline
In-Reply-To: <c3a0495afe01cca1b0caf6e1caa2d0a3451ecc00.1690219502.git.simone.ballarin@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307241643140.3118466@ubuntu-linux-20-04-desktop>
References: <c3a0495afe01cca1b0caf6e1caa2d0a3451ecc00.1690219502.git.simone.ballarin@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; BOUNDARY="8323329-1672649101-1690242549=:3118466"
Content-ID: <alpine.DEB.2.22.394.2307241649110.3118466@ubuntu-linux-20-04-desktop>

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-1672649101-1690242549=:3118466
Content-Type: text/plain; CHARSET=US-ASCII
Content-Transfer-Encoding: 8BIT
Content-ID: <alpine.DEB.2.22.394.2307241649111.3118466@ubuntu-linux-20-04-desktop>

On Mon, 24 Jul 2023, Simone Ballarin wrote:
> Add two pipelines that analyze an ARM64 and a X86_64 build with the
> ECLAIR static analyzer on the guidelines contained in Set1.
> 
> The analysis configuration is stored in automation/eclair_analysis.
> 
> All commits on the xen-project/xen:staging branch will be analyzed
> and their artifacts will be stored indefinitely; the integration will
> report differential information with respect to the previous analysis.
> 
> All commits on other branches or repositories will be analyzed and
> only the last ten artifacts will be kept; the integration will report
> differential information with respect to the analysis done on the common
> ancestor with xen-project/xen:staging (if available).
> 
> Currently the pipeline variable ENABLE_ECLAIR_BOT is set to "n".
> Doing so disables the generation of comments with the analysis summary
> on the commit threads. The variable can be set to "y" if the a masked
> variable named ECLAIR_BOT_TOKEN is set with the impersonation token of
> an account with enough privileges to write on all repositories.
> 
> Additionaly any repository should be able to read a masked variable
> named WTOKEN with the token provided by BUGSENG.
> 
> The analysis fails if it contains violations of guidelines tagged as
> clean:added. The list of clean guidelines are maintained in
> automation/eclair_analysis/ECLAIR/tagging.ecl.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> 
> --
> 
> Changes in v2:
> - add ECLAIR configuration files (before they were fetched from a separate
>   repository);
> - now the pipeline fails if there are new violations of guidelines tagged
>   with clean:added.
> ---
>  .gitlab-ci.yml                                |   2 +
>  MAINTAINERS                                   |   6 +
>  automation/eclair_analysis/ECLAIR/Set1.ecl    |  59 ++++
>  automation/eclair_analysis/ECLAIR/Set2.ecl    |  25 ++
>  automation/eclair_analysis/ECLAIR/Set3.ecl    |  67 ++++
>  .../eclair_analysis/ECLAIR/action.helpers     | 193 ++++++++++++
>  .../eclair_analysis/ECLAIR/action.settings    | 172 ++++++++++
>  .../ECLAIR/action_clean_added.sh              |  36 +++
>  .../eclair_analysis/ECLAIR/action_log.sh      |  15 +
>  .../ECLAIR/action_pull_request.sh             |  57 ++++
>  .../eclair_analysis/ECLAIR/action_push.sh     |  95 ++++++
>  .../ECLAIR/action_upload_sarif.sh             |  31 ++
>  .../eclair_analysis/ECLAIR/analysis.ecl       |  25 ++
>  automation/eclair_analysis/ECLAIR/analyze.sh  | 106 +++++++
>  .../ECLAIR/call_properties.ecl                | 106 +++++++
>  .../eclair_analysis/ECLAIR/deviations.ecl     | 298 ++++++++++++++++++
>  .../eclair_analysis/ECLAIR/out_of_scope.ecl   | 127 ++++++++
>  .../ECLAIR/print_analyzed_files.sh            |  66 ++++
>  .../eclair_analysis/ECLAIR/public_APIs.ecl    |   6 +
>  automation/eclair_analysis/ECLAIR/report.ecl  |   4 +
>  automation/eclair_analysis/ECLAIR/tagging.ecl |  34 ++
>  .../eclair_analysis/ECLAIR/toolchain.ecl      | 275 ++++++++++++++++
>  automation/eclair_analysis/Makefile.prepare   |   6 +
>  automation/eclair_analysis/build.sh           |  44 +++
>  automation/eclair_analysis/prepare.sh         |  42 +++
>  automation/eclair_analysis/xen_arm_config     | 147 +++++++++
>  automation/eclair_analysis/xen_x86_config     | 152 +++++++++
>  automation/gitlab-ci/analyze.yaml             |  37 +++
>  automation/gitlab-ci/build.yaml               |   1 +
>  automation/scripts/eclair                     |  32 ++
>  30 files changed, 2266 insertions(+)
>  create mode 100644 automation/eclair_analysis/ECLAIR/Set1.ecl
>  create mode 100644 automation/eclair_analysis/ECLAIR/Set2.ecl
>  create mode 100644 automation/eclair_analysis/ECLAIR/Set3.ecl
>  create mode 100644 automation/eclair_analysis/ECLAIR/action.helpers
>  create mode 100644 automation/eclair_analysis/ECLAIR/action.settings
>  create mode 100755 automation/eclair_analysis/ECLAIR/action_clean_added.sh
>  create mode 100755 automation/eclair_analysis/ECLAIR/action_log.sh
>  create mode 100644 automation/eclair_analysis/ECLAIR/action_pull_request.sh
>  create mode 100755 automation/eclair_analysis/ECLAIR/action_push.sh
>  create mode 100755 automation/eclair_analysis/ECLAIR/action_upload_sarif.sh
>  create mode 100644 automation/eclair_analysis/ECLAIR/analysis.ecl
>  create mode 100755 automation/eclair_analysis/ECLAIR/analyze.sh
>  create mode 100644 automation/eclair_analysis/ECLAIR/call_properties.ecl
>  create mode 100644 automation/eclair_analysis/ECLAIR/deviations.ecl
>  create mode 100644 automation/eclair_analysis/ECLAIR/out_of_scope.ecl
>  create mode 100755 automation/eclair_analysis/ECLAIR/print_analyzed_files.sh
>  create mode 100644 automation/eclair_analysis/ECLAIR/public_APIs.ecl
>  create mode 100644 automation/eclair_analysis/ECLAIR/report.ecl
>  create mode 100644 automation/eclair_analysis/ECLAIR/tagging.ecl
>  create mode 100644 automation/eclair_analysis/ECLAIR/toolchain.ecl
>  create mode 100644 automation/eclair_analysis/Makefile.prepare
>  create mode 100755 automation/eclair_analysis/build.sh
>  create mode 100755 automation/eclair_analysis/prepare.sh
>  create mode 100644 automation/eclair_analysis/xen_arm_config
>  create mode 100644 automation/eclair_analysis/xen_x86_config
>  create mode 100644 automation/gitlab-ci/analyze.yaml
>  create mode 100755 automation/scripts/eclair

This is a lot of changes, I think we need to split it in 3 patches to
make them "digestible":

- 1 patch to introduce the ECLAIR configuration under
  automation/eclair_analysis/

- 1 patch to add xen_arm_config and xen_x86_config

- 1 patch to introduce the gitlab-ci integration; changes similar to the
  previous version of the patch, touching .gitlab-ci.yml,
  automation/gitlab-ci/, automation/scripts/eclair

- 1 patch to update the maintainers file


I think the gitlab-ci integration is already good enough to be
committed. I only have a few comments on all the files added under 
automation/eclair_analysis.

It is important that we keep the configuration files under xen.git,
things like deviations.ecl, out_of_scope.ecl and toolchain.ecl. But I
wonder if we need to keep all the others under xen.git.


> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index c8bd7519d5..ee5430b8b7 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -1,7 +1,9 @@
>  stages:
> +  - analyze
>    - build
>    - test
>  
>  include:
> +  - 'automation/gitlab-ci/analyze.yaml'
>    - 'automation/gitlab-ci/build.yaml'
>    - 'automation/gitlab-ci/test.yaml'
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 180e57dac4..c3b99e8560 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -305,6 +305,12 @@ F:	xen/include/xen/libfdt/
>  F:	xen/include/xen/device_tree.h
>  F:	xen/drivers/passthrough/device_tree.c
>  
> +ECLAIR
> +M: Simone Ballarin <simone.ballarin@bugseng.com>
> +S: Supported
> +F: xen/automation/eclair_analysis/
> +F: xen/automation/scripts/eclair
> +
>  EFI
>  M:	Jan Beulich <jbeulich@suse.com>
>  S:	Supported
> diff --git a/automation/eclair_analysis/ECLAIR/Set1.ecl b/automation/eclair_analysis/ECLAIR/Set1.ecl
> new file mode 100644
> index 0000000000..b5ca499037
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/Set1.ecl
> @@ -0,0 +1,59 @@
> +-doc_begin="Set 1 as defined in Xen MISRA C Task (a): Xen Coding Guidelines v1.0, May 31, 2023"

We need a different description. Please remove "Task (a)" which doesn't
have a meaning here. If you cannot come up with anything to describe Set
1, then just go with: "Set 1 of MISRA C rules".


> +-enable=MC3R1.R9.1
> +-enable=MC3R1.R12.5
> +-enable=MC3R1.R17.3
> +-enable=MC3R1.R17.4
> +-enable=MC3R1.R17.6
> +-enable=MC3R1.R19.1
> +-enable=MC3R1.R21.13
> +-enable=MC3R1.R21.17
> +-enable=MC3R1.R21.18
> +-enable=MC3R1.R21.19
> +-enable=MC3R1.R21.20
> +-enable=MC3R1.R21.21
> +-enable=MC3R1.R22.2
> +-enable=MC3R1.R22.4
> +-enable=MC3R1.R22.5
> +-enable=MC3R1.R22.6
> +-enable=MC3R1.D1.1
> +-enable=MC3R1.D2.1
> +-enable=MC3R1.D4.1
> +-enable=MC3R1.D4.3
> +-enable=MC3R1.D4.7
> +-enable=MC3R1.D4.10
> +-enable=MC3R1.D4.11
> +-enable=MC3R1.D4.14
> +-enable=MC3R1.R1.1
> +-enable=MC3R1.R1.3
> +-enable=MC3R1.R1.4
> +-enable=MC3R1.R2.1
> +-enable=MC3R1.R2.2
> +-enable=MC3R1.R3.1
> +-enable=MC3R1.R3.2
> +-enable=MC3R1.R4.1
> +-enable=MC3R1.R5.1
> +-enable=MC3R1.R5.2
> +-enable=MC3R1.R5.3
> +-enable=MC3R1.R5.4
> +-enable=MC3R1.R5.6
> +-enable=MC3R1.R6.1
> +-enable=MC3R1.R6.2
> +-enable=MC3R1.R7.1
> +-enable=MC3R1.R7.2
> +-enable=MC3R1.R7.3
> +-enable=MC3R1.R7.4
> +-enable=MC3R1.R8.1
> +-enable=MC3R1.R8.2
> +-enable=MC3R1.R8.3
> +-enable=MC3R1.R8.4
> +-enable=MC3R1.R8.5
> +-enable=MC3R1.R8.6
> +-enable=MC3R1.R8.8
> +-enable=MC3R1.R8.10
> +-enable=MC3R1.R8.12
> +-enable=MC3R1.R8.14
> +-enable=MC3R1.R9.2
> +-enable=MC3R1.R9.3
> +-enable=MC3R1.R9.4
> +-enable=MC3R1.R9.5
> +-doc_end
> diff --git a/automation/eclair_analysis/ECLAIR/Set2.ecl b/automation/eclair_analysis/ECLAIR/Set2.ecl
> new file mode 100644
> index 0000000000..741fe4d470
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/Set2.ecl
> @@ -0,0 +1,25 @@
> +-doc_begin="Set 2 as defined in Xen MISRA C Task (a): Xen Coding Guidelines v1.0, May 31, 2023"

same here


> +-enable=MC3R1.R10.1
> +-enable=MC3R1.R10.2
> +-enable=MC3R1.R10.3
> +-enable=MC3R1.R10.4
> +-enable=MC3R1.R10.6
> +-enable=MC3R1.R10.7
> +-enable=MC3R1.R10.8
> +-enable=MC3R1.R11.1
> +-enable=MC3R1.R11.2
> +-enable=MC3R1.R11.3
> +-enable=MC3R1.R11.6
> +-enable=MC3R1.R11.7
> +-enable=MC3R1.R11.8
> +-enable=MC3R1.R11.9
> +-enable=MC3R1.R12.2
> +-enable=MC3R1.R13.1
> +-enable=MC3R1.R13.2
> +-enable=MC3R1.R13.5
> +-enable=MC3R1.R13.6
> +-enable=MC3R1.R14.1
> +-enable=MC3R1.R14.2
> +-enable=MC3R1.R14.3
> +-enable=MC3R1.R14.4
> +-doc_end
> diff --git a/automation/eclair_analysis/ECLAIR/Set3.ecl b/automation/eclair_analysis/ECLAIR/Set3.ecl
> new file mode 100644
> index 0000000000..1b1afe4f3b
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/Set3.ecl
> @@ -0,0 +1,67 @@
> +-doc_begin="Set 3 as defined in Xen MISRA C Task (a): Xen Coding Guidelines v1.0, May 31, 2023"

same here


> +-enable=MC3R1.D4.12
> +-enable=MC3R1.R5.5
> +-enable=MC3R1.R5.7
> +-enable=MC3R1.R5.8
> +-enable=MC3R1.R15.2
> +-enable=MC3R1.R15.3
> +-enable=MC3R1.R15.6
> +-enable=MC3R1.R15.7
> +-enable=MC3R1.R16.1
> +-enable=MC3R1.R16.2
> +-enable=MC3R1.R16.3
> +-enable=MC3R1.R16.4
> +-enable=MC3R1.R16.5
> +-enable=MC3R1.R16.6
> +-enable=MC3R1.R16.7
> +-enable=MC3R1.R17.1
> +-enable=MC3R1.R17.2
> +-enable=MC3R1.R17.5
> +-enable=MC3R1.R17.7
> +-enable=MC3R1.R18.1
> +-enable=MC3R1.R18.2
> +-enable=MC3R1.R18.3
> +-enable=MC3R1.R18.6
> +-enable=MC3R1.R18.7
> +-enable=MC3R1.R18.8
> +-enable=MC3R1.R20.2
> +-enable=MC3R1.R20.3
> +-enable=MC3R1.R20.4
> +-enable=MC3R1.R20.6
> +-enable=MC3R1.R20.7
> +-enable=MC3R1.R20.8
> +-enable=MC3R1.R20.9
> +-enable=MC3R1.R20.11
> +-enable=MC3R1.R20.12
> +-enable=MC3R1.R20.13
> +-enable=MC3R1.R20.14
> +-enable=MC3R1.R21.1
> +-enable=MC3R1.R21.2
> +-enable=MC3R1.R21.3
> +-enable=MC3R1.R21.4
> +-enable=MC3R1.R21.5
> +-enable=MC3R1.R21.6
> +-enable=MC3R1.R21.7
> +-enable=MC3R1.R21.8
> +-enable=MC3R1.R21.9
> +-enable=MC3R1.R21.10
> +-enable=MC3R1.R21.12
> +-enable=MC3R1.R21.14
> +-enable=MC3R1.R21.15
> +-enable=MC3R1.R21.16
> +-enable=MC3R1.R22.1
> +-enable=MC3R1.R22.3
> +-enable=MC3R1.R22.7
> +-enable=MC3R1.R22.8
> +-enable=MC3R1.R22.9
> +-enable=MC3R1.R22.10
> +-enable=MC3R1.R2.6
> +-enable=MC3R1.R4.2
> +-doc_end
> +
> +-doc_begin="Guidelines added with Xen MISRA C Task (a): Xen Coding Guidelines v1.1, June 1, 2023"
> +-enable=MC3R1.R21.11
> +-enable=MC3R1.D4.4
> +-enable=MC3R1.R8.9
> +-enable=MC3R1.R12.4
> +-doc_end

These 3 files are important and I would definitely add them to xen.git



> diff --git a/automation/eclair_analysis/ECLAIR/action.helpers b/automation/eclair_analysis/ECLAIR/action.helpers
> new file mode 100644
> index 0000000000..2ad6428eaa
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/action.helpers
> @@ -0,0 +1,193 @@
> +if [ -n "${GITLAB_CI:-}" ]; then
> +    ci=gitlab
> +elif [ -n "${GITHUB_ACTION:-}" ]; then
> +    ci=github
> +elif [ -n "${JENKINS_HOME:-}" ]; then
> +    ci=jenkins
> +else
> +    echo "Unexpected CI/CD context" >&2
> +    exit 1
> +fi
> +
> +esc=$(printf '\e')
> +cr=$(printf '\r')
> +
> +open_section() {
> +    id=$1
> +    title=$2
> +    collapsed=$3
> +    echo "${esc}[0Ksection_start:$(date +%s):${id}${collapsed}${cr}${esc}[0K${esc}[1m${esc}[36m${title}${esc}[m"
> +}
> +
> +close_section() {
> +    id=$1
> +    echo "${esc}[0Ksection_end:$(date +%s):${id}${cr}${esc}[0K"
> +}
> +
> +summary() {
> +    fixedReports=
> +    newReports=
> +    unfixedReports=
> +    while read -r line; do
> +        var=${line%%: *}
> +        val=${line#*: }
> +        eval "${var}=${val}"
> +    done <"${updateLog}"
> +
> +    case "${ci}" in
> +    github)
> +        nl="\\"
> +        ;;
> +    gitlab)
> +        nl=
> +        ;;
> +    jenkins)
> +        nl="<br/>"
> +        ;;
> +    *)
> +        nl=
> +        ;;
> +    esac
> +
> +    if [ -z "${newReports}" ]; then
> +        fixedMsg=
> +        unfixedMsg="Unfixed reports: ${unfixedReports}"
> +        countsMsg="${unfixedMsg}"
> +    else
> +        fixedMsg="Fixed reports: ${fixedReports}"
> +        unfixedMsg="Unfixed reports: ${unfixedReports} [new: ${newReports}]"
> +        countsMsg="${fixedMsg}${nl}
> +${unfixedMsg}"
> +    fi
> +    case "${ci}" in
> +    jenkins)
> +        cat <<EOF >"${summaryTxt}"
> +${countsMsg}                                                                              ${nl}
> +<a href="https://www.bugseng.com/eclair">
> +  <img src="${eclairReportUrlPrefix}/rsrc/eclair.svg" width="100" />
> +</a>
> +<h3>${jobHeadline}</h3>
> +<a href="${indexHtmlUrl}">Browse analysis results</a>
> +EOF
> +        ;;
> +    *)
> +        cat <<EOF >"${summaryTxt}"
> +<a href="https://www.bugseng.com/eclair">
> +  <img src="${eclairReportUrlPrefix}/rsrc/eclair.svg" width="100" />
> +</a>
> +Analysis Summary
> +
> +${jobHeadline}${nl}
> +${countsMsg}${nl}
> +[Browse analysis](${indexHtmlUrl})
> +EOF
> +        ;;
> +    esac
> +
> +    case ${ci} in
> +    github)
> +        cat "${summaryTxt}" >"${GITHUB_STEP_SUMMARY}"
> +        ;;
> +    gitlab)
> +        open_section ECLAIR_summary "ECLAIR analysis summary" ""
> +        # Generate summary and print it (GitLab-specific)
> +        cat <<EOF
> +${jobHeadline}
> +${countsMsg}
> +Browse analysis: ${esc}[33m${indexHtmlUrl}${esc}[m
> +EOF
> +        close_section ECLAIR_summary
> +        ;;
> +    jenkins)
> +        cat <<EOF
> +${jobHeadline}
> +${fixedMsg}
> +${unfixedMsg}
> +Browse analysis: ${indexHtmlUrl}
> +EOF
> +        ;;
> +    *)
> +        echo "Unexpected CI/CD context" >&2
> +        exit 1
> +        ;;
> +    esac
> +}
> +
> +log_file() {
> +    section_id=$1
> +    section_name=$2
> +    file=$3
> +    exit_code=$4
> +    if [ "${exit_code}" = 0 ]; then
> +        collapsed=[collapsed=true]
> +    else
> +        collapsed=
> +    fi
> +
> +    case ${ci} in
> +    github | jenkins)
> +        echo "${section_name}"
> +        ;;
> +    gitlab)
> +        open_section "${section_id}" "${section_name}" "${collapsed}"
> +        ;;
> +    *)
> +        echo "Unexpected CI/CD context" >&2
> +        exit 1
> +        ;;
> +    esac
> +
> +    cat "${file}"
> +
> +    case ${ci} in
> +    github | jenkins) ;;
> +    gitlab)
> +        close_section "${section_id}"
> +        ;;
> +    *) ;;
> +    esac
> +}
> +
> +maybe_log_file_exit() {
> +    section_id=$1
> +    section_name=$2
> +    file=$3
> +    exit_code=$4
> +
> +    case ${ci} in
> +    github | jenkins)
> +        echo "${section_name}"
> +        ;;
> +    gitlab)
> +        open_section "${section_id}" "${section_name}" ""
> +        ;;
> +    *)
> +        echo "Unexpected CI/CD context" >&2
> +        exit 1
> +        ;;
> +    esac
> +
> +    if [ "${exit_code}" != 0 ]; then
> +        cat "${file}"
> +    fi
> +
> +    case ${ci} in
> +    github | jenkins) ;;
> +    gitlab)
> +        close_section "${section_id}"
> +        ;;
> +    *) ;;
> +    esac
> +    return "${exit_code}"
> +}
> +
> +is_enabled() {
> +    case "$1" in
> +    true | TRUE | y | Y | yes | YES | 1)
> +        return 0
> +        ;;
> +    *)
> +        return 1
> +        ;;
> +    esac
> +}

This seems imporant too


> diff --git a/automation/eclair_analysis/ECLAIR/action.settings b/automation/eclair_analysis/ECLAIR/action.settings
> new file mode 100644
> index 0000000000..0f7950f5ab
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/action.settings
> @@ -0,0 +1,172 @@
> +variantSubDir=
> +variantHeadline=
> +if [ -n "${VARIANT:-}" ]; then
> +    variantSubDir="/${VARIANT}"
> +    variantHeadline=" [${VARIANT}]"
> +fi
> +
> +# AUTO PR Feature
> +# If the following variables are defined, then all pipelines
> +# of other branches will be considered pull-requests to
> +# autoPRBranch.
> +# Customized
> +autoPRRepository="${AUTO_PR_REPOSITORY:-}"
> +# Customized
> +autoPRBranch="${AUTO_PR_BRANCH:-}"
> +
> +# Customized
> +artifactsRoot=/var/local/eclair
> +
> +case "${ci}" in
> +github)
> +    # To be customized
> +    repository="${GITHUB_REPOSITORY}"
> +    jobId="${GITHUB_RUN_NUMBER}"
> +
> +    autoPRRemoteUrl="${GITHUB_SERVER_URL}/${autoPRRepository:-}"
> +
> +    case "${GITHUB_EVENT_NAME}" in
> +    pull_request*)
> +        event=pull_request
> +        pullRequestId="${GITHUB_EVENT_PULL_REQUEST_NUMBER}"
> +        pullRequestHeadRepo="${PR_HEAD_REPO}"
> +        pullRequestHeadRef="${PR_HEAD_REF}"
> +        pullRequestBaseRef="${PR_BASE_REF}"
> +        pullRequestUser="${PR_USER}"
> +        # baseCommitId and headCommitId are the most recent merge points without conflicts
> +        git fetch -q --deepen=2
> +        baseCommitId=$(git show -s --pretty=%H HEAD^1)
> +        headCommitId=$(git show -s --pretty=%H HEAD^2)
> +        ;;
> +    push | workflow_dispatch)
> +        event=push
> +        # Extract the branch name from "refs/heads/<branch>"
> +        branch="${GITHUB_REF#refs/heads/}"
> +        headCommitId="${GITHUB_SHA}"
> +        pushUser="${GITHUB_ACTOR}"
> +        ;;
> +    *)
> +        echo "Unexpected GITHUB_REF ${GITHUB_REF}" >&2
> +        exit 1
> +        ;;
> +    esac
> +    ;;
> +gitlab)
> +    # Customized
> +    repository="${CI_PROJECT_PATH}"
> +    jobId="${CI_JOB_ID}"
> +
> +    gitlabApiUrl="${CI_SERVER_PROTOCOL}://${CI_SERVER_HOST}:${CI_SERVER_PORT}/api/v4"
> +    autoPRRemoteUrl="${CI_SERVER_PROTOCOL}://${CI_SERVER_HOST}:${CI_SERVER_PORT}/${autoPRRepository:-}"
> +
> +    # Customized
> +    gitlabBotToken="${ECLAIR_BOT_TOKEN:-}"
> +
> +    case "${CI_PIPELINE_SOURCE}" in
> +    merge_request_event)
> +        event=pull_request
> +        pullRequestId="${CI_MERGE_REQUEST_IID}"
> +        pullRequestHeadRef="${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
> +        pullRequestHeadRepo="${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH}"
> +        pullRequestBaseRef="${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}"
> +        pullRequestUser="${GITLAB_USER_LOGIN}"
> +        headCommitId="${CI_COMMIT_SHA}"
> +        baseCommitId="${CI_MERGE_REQUEST_DIFF_BASE_SHA}"
> +        ;;
> +    push | pipeline | web)
> +        event=push
> +        branch="${CI_COMMIT_BRANCH}"
> +        headCommitId="${CI_COMMIT_SHA}"
> +        pushUser="${GITLAB_USER_NAME}"
> +        ;;
> +    *)
> +        echo "Unexpected event ${CI_PIPELINE_SOURCE}" >&2
> +        exit 1
> +        ;;
> +    esac
> +    ;;
> +jenkins)
> +    # To be customized
> +    repository="${JOB_BASE_NAME}"
> +    project="${JOB_NAME}"
> +    jobId="${BUILD_NUMBER}"
> +
> +    jenkinsApiUrl="${JENKINS_URL}"
> +    autoPRRemoteUrl="${JENKINS_URL}/${autoPRRepository:-}"
> +
> +    # To be customized
> +    jenkinsBotUsername="${ECLAIR_BOT_USERNAME:-}"
> +    jenkinsBotToken="${ECLAIR_BOT_TOKEN:-}"
> +
> +    event=push
> +    branch="${GIT_BRANCH}"
> +    headCommitId="${GIT_COMMIT}"
> +    pushUser=$(git show --pretty='format:%aN' -s)
> +    ;;
> +*)
> +    echo "Unexpected CI/CD context" >&2
> +    exit 1
> +    ;;
> +esac
> +
> +if [ "${event}" = "push" ] && [ -n "${autoPRBranch:-}" ]; then
> +    # AUTO PR Feature enabled
> +    if ! [ "${branch}" = "${autoPRBranch}" ] ||
> +        ! [ "${repository}" = "${autoPRRepository}" ]; then
> +        event=auto_pull_request
> +    fi
> +fi
> +
> +case "${event}" in
> +pull_request)
> +    subDir="${pullRequestHeadRepo}.ecdf/${pullRequestBaseRef}"
> +    jobHeadline="ECLAIR ${ANALYSIS_KIND} on repository ${repository}: ${pullRequestUser} wants to merge ${pullRequestHeadRepo}:${pullRequestHeadRef} (${headCommitId}) into ${pullRequestBaseRef} (${baseCommitId})"
> +    ;;
> +push)
> +    subDir="${branch}"
> +    jobHeadline="ECLAIR ${ANALYSIS_KIND} on repository ${repository}: branch ${branch} (${headCommitId})"
> +    badgeLabel="ECLAIR ${ANALYSIS_KIND} ${branch}${variantHeadline} #${jobId}"
> +    ;;
> +auto_pull_request)
> +    git remote remove autoPRRemote || true
> +    git remote add autoPRRemote "${autoPRRemoteUrl}"
> +    git fetch autoPRRemote
> +    subDir="${branch}"
> +    baseCommitId=$(git merge-base "autoPRRemote/${autoPRBranch}" HEAD)
> +    jobHeadline="ECLAIR ${ANALYSIS_KIND} on repository ${repository}: ${pushUser} wants to merge ${repository}:${branch} (${headCommitId}) into ${autoPRRepository}/${autoPRBranch} (${baseCommitId})"
> +    ;;
> +*)
> +    echo "Unexpected event ${event}" >&2
> +    exit 1
> +    ;;
> +esac
> +
> +case "${repository}" in
> +xen-project/xen)
> +    # Customized
> +    keepOldAnalyses=0
> +    ;;
> +xen-project/*)
> +    # Customized
> +    keepOldAnalyses=10
> +    ;;
> +*)
> +    echo "Unexpected repository" >&2
> +    exit 1
> +    ;;
> +esac
> +
> +ECLAIR_BIN_DIR=/opt/bugseng/eclair/bin/
> +
> +artifactsDir="${artifactsRoot}/xen-project.ecdf/${repository}/ECLAIR_${ANALYSIS_KIND}"
> +subDir="${subDir}${variantSubDir}"
> +jobHeadline="${jobHeadline}${variantHeadline}"
> +
> +# Customized
> +eclairReportUrlPrefix=https://saas.eclairit.com:3787
> +
> +jobDir="${artifactsDir}/${subDir}/${jobId}"
> +updateLog="${analysisOutputDir}/update.log"
> +commentLog="${analysisOutputDir}/comment.json"
> +indexHtmlUrl="${eclairReportUrlPrefix}/fs${jobDir}/index.html"
> +summaryTxt="${analysisOutputDir}/summary.txt"

I see here a bunch of things, some of them related to github and
jenking that we don't use. For the sake of not having dead code under
xen.git, I wonder if it makes sense to have the script under xen.git or
if it would be better to keep it outside in another repository. I am
open to suggestions.


> diff --git a/automation/eclair_analysis/ECLAIR/action_clean_added.sh b/automation/eclair_analysis/ECLAIR/action_clean_added.sh
> new file mode 100755
> index 0000000000..59bc35fd13
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/action_clean_added.sh
> @@ -0,0 +1,36 @@
> +#!/bin/sh
> +
> +set -eu
> +
> +usage() {
> +    echo "Usage: $0 ANALYSIS_OUTPUT_DIR" >&2
> +    exit 2
> +}
> +
> +[ $# -eq 1 ] || usage
> +
> +analysisOutputDir=$1
> +
> +cleanAddedTxt="${analysisOutputDir}/clean_added.log"
> +
> +# Load settings and helpers
> +. "$(dirname "$0")/action.helpers"
> +. "$(dirname "$0")/action.settings"
> +
> +unexpectedReports=$("${ECLAIR_BIN_DIR}eclair_report" \
> +    "-db='${analysisOutputDir}/PROJECT.ecd'" \
> +    "-sel_unfixed=unfixed" \
> +    "-sel_tag_glob=clean_added,clean,added" \
> +    "-print='',reports_count()")
> +
> +if [ "${unexpectedReports}" -gt 0 ]; then
> +    cat <<EOF >"${cleanAddedTxt}"
> +Failure: ${unexpectedReports} unexpected reports found.
> +Unexpected reports are tagged 'clean:added'.
> +EOF
> +    exit 1
> +else
> +    cat <<EOF >"${cleanAddedTxt}"
> +Success: No unexpected reports.
> +EOF
> +fi
> diff --git a/automation/eclair_analysis/ECLAIR/action_log.sh b/automation/eclair_analysis/ECLAIR/action_log.sh
> new file mode 100755
> index 0000000000..67125b08f3
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/action_log.sh
> @@ -0,0 +1,15 @@
> +#!/bin/sh
> +
> +set -eu
> +
> +usage() {
> +    echo "Usage: $0 SECTION_ID SECTION_NAME FILE EXIT_CODE" >&2
> +    exit 2
> +}
> +
> +[ $# -eq 4 ] || usage
> +
> +# Load settings and helpers
> +. "$(dirname "$0")/action.helpers"
> +
> +log_file "$@"
> diff --git a/automation/eclair_analysis/ECLAIR/action_pull_request.sh b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
> new file mode 100644
> index 0000000000..68f7e6282e
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
> @@ -0,0 +1,57 @@
> +#!/bin/sh
> +
> +set -eu
> +
> +usage() {
> +    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR COMMIT_ID" >&2
> +    exit 2
> +}
> +
> +[ $# -eq 2 ] || usage
> +
> +wtoken=$1
> +analysisOutputDir=$2
> +
> +# Load settings and helpers
> +. "$(dirname "$0")/action.helpers"
> +. "$(dirname "$0")/action.settings"
> +
> +curl -sS "${eclairReportUrlPrefix}/ext/update_pull_request" \
> +    -F "wtoken=${wtoken}" \
> +    -F "artifactsDir=${artifactsDir}" \
> +    -F "subDir=${subDir}" \
> +    -F "jobId=${jobId}" \
> +    -F "jobHeadline=${jobHeadline}" \
> +    -F "baseCommitId=${baseCommitId}" \
> +    -F "keepOldAnalyses=${keepOldAnalyses}" \
> +    -F "db=@${analysisOutputDir}/PROJECT.ecd" \
> +    >"${updateLog}"
> +ex=0
> +grep -Fq "unfixedReports: " "${updateLog}" || ex=$?
> +maybe_log_file_exit PUBLISH_RESULT "Publishing results" "${updateLog}" "${ex}"
> +
> +summary
> +
> +if is_enabled "${ENABLE_ECLAIR_BOT:-}"; then
> +    case ${ci} in
> +    github)
> +        ex=0
> +        gh api \
> +            --method POST \
> +            "/repos/${repository}/issues/${pullRequestId}/comments" \
> +            -F "body=@${summaryTxt}" \
> +            --silent >"${commentLog}" 2>&1 || ex=$?
> +        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "${ex}"
> +        ;;
> +    gitlab)
> +        curl -sS --request POST \
> +            "${gitlabApiUrl}/projects/${CI_PROJECT_ID}/merge_requests/${pullRequestId}/notes" \
> +            -H "PRIVATE-TOKEN: ${gitlabBotToken}" \
> +            -F "body=<${summaryTxt}" >"${commentLog}"
> +        ex=0
> +        grep -Fq "Unfixed reports: " "${commentLog}" || ex=$?
> +        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "${ex}"
> +        ;;
> +    *) ;;
> +    esac
> +fi
> diff --git a/automation/eclair_analysis/ECLAIR/action_push.sh b/automation/eclair_analysis/ECLAIR/action_push.sh
> new file mode 100755
> index 0000000000..45215fbf00
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/action_push.sh
> @@ -0,0 +1,95 @@
> +#!/bin/sh
> +
> +set -eu
> +
> +usage() {
> +    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR" >&2
> +    exit 2
> +}
> +
> +[ $# -eq 2 ] || usage
> +
> +wtoken=$1
> +analysisOutputDir=$2
> +
> +# Load settings and helpers
> +. "$(dirname "$0")/action.helpers"
> +. "$(dirname "$0")/action.settings"
> +
> +case "${event}" in
> +push)
> +    curl -sS "${eclairReportUrlPrefix}/ext/update_push" \
> +        -F "wtoken=${wtoken}" \
> +        -F "artifactsDir=${artifactsDir}" \
> +        -F "subDir=${subDir}" \
> +        -F "jobId=${jobId}" \
> +        -F "jobHeadline=${jobHeadline}" \
> +        -F "commitId=${headCommitId}" \
> +        -F "badgeLabel=${badgeLabel}" \
> +        -F "keepOldAnalyses=${keepOldAnalyses}" \
> +        -F "db=@${analysisOutputDir}/PROJECT.ecd" \
> +        >"${updateLog}"
> +    ;;
> +auto_pull_request)
> +    curl -sS "${eclairReportUrlPrefix}/ext/update_pull_request" \
> +        -F "wtoken=${wtoken}" \
> +        -F "artifactsDir=${artifactsDir}" \
> +        -F "subDir=${subDir}" \
> +        -F "jobId=${jobId}" \
> +        -F "jobHeadline=${jobHeadline}" \
> +        -F "baseCommitId=${baseCommitId}" \
> +        -F "keepOldAnalyses=${keepOldAnalyses}" \
> +        -F "db=@${analysisOutputDir}/PROJECT.ecd" \
> +        >"${updateLog}"
> +    ;;
> +*)
> +    echo "Unexpected event ${event}" >&2
> +    exit 1
> +    ;;
> +esac
> +
> +ex=0
> +grep -Fq "unfixedReports: " "${updateLog}" || ex=$?
> +maybe_log_file_exit PUBLISH_RESULT "Publishing results" "${updateLog}" "${ex}"
> +
> +summary
> +
> +if is_enabled "${ENABLE_ECLAIR_BOT:-}"; then
> +    case ${ci} in
> +    github)
> +        ex=0
> +        gh api \
> +            --method POST \
> +            "/repos/${repository}/commits/${headCommitId}/comments" \
> +            -F "body=@${summaryTxt}" \
> +            --silent >"${commentLog}" 2>&1 || ex=$?
> +        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "${ex}"
> +        ;;
> +    gitlab)
> +        curl -sS --request POST \
> +            "${gitlabApiUrl}/projects/${CI_PROJECT_ID}/repository/commits/${CI_COMMIT_SHA}/comments" \
> +            -H "PRIVATE-TOKEN: ${gitlabBotToken}" \
> +            -F "note=<${summaryTxt}" >"${commentLog}"
> +        ex=0
> +        grep -Fq "Unfixed reports: " "${commentLog}" || ex=$?
> +        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "${ex}"
> +        ;;
> +    jenkins)
> +        ex=0
> +        curl \
> +            --user "${jenkinsBotUsername}:${jenkinsBotToken}" \
> +            --data-urlencode "description=$(cat "${summaryTxt}")" \
> +            --data-urlencode "Submit=Submit" \
> +            "${jenkinsApiUrl}job/${project}/${jobId}/submitDescription" \
> +            >"${commentLog}" 2>&1 || ex=$?
> +        curl \
> +            --user "${jenkinsBotUsername}:${jenkinsBotToken}" \
> +            --data-urlencode "description=$(cat "${summaryTxt}")" \
> +            --data-urlencode "Submit=Submit" \
> +            "${jenkinsApiUrl}job/${project}/submitDescription" \
> +            >"${commentLog}" 2>&1 || ex=$?
> +        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "${ex}"
> +        ;;
> +    *) ;;
> +    esac
> +fi
> diff --git a/automation/eclair_analysis/ECLAIR/action_upload_sarif.sh b/automation/eclair_analysis/ECLAIR/action_upload_sarif.sh
> new file mode 100755
> index 0000000000..60b8034fcc
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/action_upload_sarif.sh
> @@ -0,0 +1,31 @@
> +#!/bin/sh
> +
> +set -eu
> +
> +usage() {
> +    echo "Usage: $0 SARIF_FILE" >&2
> +    exit 2
> +}
> +
> +[ $# -eq 1 ] || usage
> +
> +HERE=$( (
> +    cd "$(dirname "$0")"
> +    echo "${PWD}"
> +))
> +
> +. "${HERE}/action.helpers"
> +
> +sarifFile=$1
> +sarifPayload=${HERE}/sarif.gz.b64
> +uploadLog=${HERE}/upload_sarif.log
> +
> +gzip -c "${sarifFile}" | base64 -w0 >"${sarifPayload}"
> +
> +ex=0
> +gh api --method POST -H "Accept: application/vnd.github+json" \
> +    "/repos/${GITHUB_REPOSITORY}/code-scanning/sarifs" \
> +    -f "commit_sha=${GITHUB_SHA}" -f "ref=${GITHUB_REF}" \
> +    -F "sarif=@${sarifPayload}" \
> +    --silent >"${uploadLog}" 2>&1 || ex=$?
> +maybe_log_file_exit ADD_COMMENT "Uploading SARIF" "${uploadLog}" "${ex}"

Same for the scripts up until this point.

Instead, below it looks the information is a lot more critical to the
ECLAIR configuration and tied to the information we have under
docs/misra.

My suggestion is to add all the config file and script below to
automation/eclair_analysis under xen.git. For these ones above, I'll
leave it to you. If it makes it easier to have them under xen.git for
your ECLAIR runner maintainance, then let's add them. Otherwise if not,
let's not added them.

Under xen.git, it is key that we have all the config files and scripts
that would need to change if we decide to change something in
docs/misra/rules.rst, docs/misra/C-language-toolchain.rst or
docs/misra/exclude-list.rst. Everything else is optional and we could
decide to keep them out of xen.git especially if they have
functionalities that are not needed by the Xen community (e.g. jenkins
integration). We can also decide to keep them all together in xen.git as
long as you are happy to keep maintaining them.

Cheers,

Stefano


> diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/eclair_analysis/ECLAIR/analysis.ecl
> new file mode 100644
> index 0000000000..fe418d6da1
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
> @@ -0,0 +1,25 @@
> +-setq=set,getenv("SET")
> +-project_name=getenv("ECLAIR_PROJECT_NAME")
> +-project_root=getenv("ECLAIR_PROJECT_ROOT")
> +
> +-setq=data_dir,getenv("ECLAIR_DATA_DIR")
> +
> +-verbose
> +
> +-enable=B.REPORT.ECB
> +-config=B.REPORT.ECB,output=join_paths(data_dir,"FRAME.@FRAME@.ecb")
> +-config=B.REPORT.ECB,preprocessed=show
> +-config=B.REPORT.ECB,macros=10
> +
> +-enable=B.EXPLAIN
> +
> +-eval_file=toolchain.ecl
> +-eval_file=public_APIs.ecl
> +-eval_file=out_of_scope.ecl
> +-eval_file=deviations.ecl
> +-eval_file=call_properties.ecl
> +-eval_file=tagging.ecl
> +-eval_file=concat(set,".ecl")
> +
> +-doc="Hide reports in external code."
> +-reports+={hide,all_exp_external}
> diff --git a/automation/eclair_analysis/ECLAIR/analyze.sh b/automation/eclair_analysis/ECLAIR/analyze.sh
> new file mode 100755
> index 0000000000..47cdbb03ce
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/analyze.sh
> @@ -0,0 +1,106 @@
> +#!/bin/bash
> +# Stop immediately if any executed command has exit status different from 0.
> +set -e
> +set -o pipefail
> +
> +script_name="$(basename "$0")"
> +
> +fatal() {
> +  echo "${script_name}: $*" >&2
> +  exit 1
> +}
> +
> +usage() {
> +  fatal "Usage: ${script_name} <ARM64|X86_64> <Set0|Set1|Set2|Set3>"
> +}
> +
> +if [[ $# -ne 2 ]]; then
> +  usage
> +fi
> +
> +# Absolute path of the ECLAIR bin directory.
> +export ECLAIR_BIN_DIR=/opt/bugseng/eclair/bin/
> +
> +# Directory where this script resides: usually in a directory named "ECLAIR".
> +SCRIPT_DIR="$(
> +  cd "$(dirname "$0")"
> +  echo "${PWD}"
> +)"
> +# Directory where to put all ECLAIR output and temporary files.
> +if [[ -z "${ECLAIR_OUTPUT_DIR:-}" ]]; then
> +  ECLAIR_OUTPUT_DIR="${PWD}/ECLAIR/out"
> +fi
> +
> +export ECLAIR_DIAGNOSTICS_OUTPUT="${ECLAIR_OUTPUT_DIR}/ANALYSIS.log"
> +# Set the variable for the build log file.
> +ECLAIR_BUILD_LOG=${ECLAIR_OUTPUT_DIR}/BUILD.log
> +# Set the variable for the report log file.
> +ECLAIR_REPORT_LOG=${ECLAIR_OUTPUT_DIR}/REPORT.log
> +
> +if [[ "$1" = "X86_64" ]]; then
> +  export CROSS_COMPILE=
> +  export XEN_TARGET_ARCH=x86_64
> +  EXTRA_ECLAIR_ENV_OPTIONS=-disable=MC3R1.R20.7
> +elif [[ "$1" = "ARM64" ]]; then
> +  export CROSS_COMPILE=aarch64-linux-gnu-
> +  export XEN_TARGET_ARCH=arm64
> +else
> +  fatal "Unknown configuration: $1"
> +fi
> +
> +VARIANT="${XEN_TARGET_ARCH}"
> +
> +# Used in analysis.ecl
> +case "$2" in
> +Set0|Set1|Set2|Set3)
> +  export SET="$2"
> +  ;;
> +*)
> +  fatal "Unknown configuration: $2"
> +  ;;
> +esac
> +
> +export CC_ALIASES="${CROSS_COMPILE}gcc-12"
> +export CXX_ALIASES="${CROSS_COMPILE}g++-12"
> +export LD_ALIASES="${CROSS_COMPILE}ld"
> +export AR_ALIASES="${CROSS_COMPILE}ar"
> +export AS_ALIASES="${CROSS_COMPILE}as"
> +export FILEMANIP_ALIASES="cp mv ${CROSS_COMPILE}objcopy"
> +
> +# ECLAIR binary data directory and workspace.
> +export ECLAIR_DATA_DIR="${ECLAIR_OUTPUT_DIR}/.data"
> +# ECLAIR workspace.
> +export ECLAIR_WORKSPACE="${ECLAIR_DATA_DIR}/eclair_workspace"
> +
> +# Identifies the particular build of the project.
> +export ECLAIR_PROJECT_NAME="XEN_${VARIANT}-${SET}"
> +# All paths mentioned in ECLAIR reports that are below this directory
> +# will be presented as relative to ECLAIR_PROJECT_ROOT.
> +export ECLAIR_PROJECT_ROOT="${PWD}"
> +
> +# Erase and recreate the output directory and the data directory.
> +rm -rf "${ECLAIR_OUTPUT_DIR:?}/*"
> +mkdir -p "${ECLAIR_DATA_DIR}"
> +
> +# Perform the build (from scratch) in an ECLAIR environment.
> +"${ECLAIR_BIN_DIR}eclair_env" \
> +    "-config_file='${SCRIPT_DIR}/analysis.ecl'" \
> +    "${EXTRA_ECLAIR_ENV_OPTIONS}" \
> +  -- "${SCRIPT_DIR}/../build.sh" "$1" | tee "${ECLAIR_BUILD_LOG}"
> +
> +
> +# Create the project database.
> +PROJECT_ECD="${ECLAIR_OUTPUT_DIR}/PROJECT.ecd"
> +find "${ECLAIR_DATA_DIR}" -maxdepth 1 -name "FRAME.*.ecb" |
> +  sort | xargs cat |
> +  "${ECLAIR_BIN_DIR}eclair_report" \
> +    "-create_db='${PROJECT_ECD}'" \
> +    -load=/dev/stdin > "${ECLAIR_REPORT_LOG}" 2>&1
> +
> +# Create the Jenkins reports file.
> +"${ECLAIR_BIN_DIR}eclair_report" \
> +  "-db='${PROJECT_ECD}'" \
> +  "-eval_file='${SCRIPT_DIR}/report.ecl'" \
> +  >> "${ECLAIR_REPORT_LOG}" 2>&1
> +
> +"${SCRIPT_DIR}/print_analyzed_files.sh" "${PROJECT_ECD}" "${ECLAIR_OUTPUT_DIR}"
> diff --git a/automation/eclair_analysis/ECLAIR/call_properties.ecl b/automation/eclair_analysis/ECLAIR/call_properties.ecl
> new file mode 100644
> index 0000000000..3f7794bf8b
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/call_properties.ecl
> @@ -0,0 +1,106 @@
> +
> +-call_properties+={"name(printk)", {"pointee_write(1..=never)", "taken()"}}
> +-call_properties+={"name(debugtrace_printk)", {"pointee_write(1..=never)", "taken()"}}
> +-call_properties+={"name(panic)", {"pointee_write(1..=never)", "taken()"}}
> +-call_properties+={"macro(^domain_crash$)", {"pointee_write(2..=never)", "taken()"}}
> +-call_properties+={"macro(^(g?d|mm_)?printk$)", {"pointee_write(2..=never)", "taken()"}}
> +-call_properties+={"macro(^guest_bug_on_failed$)", {"pointee_write(1=never)", "taken()"}}
> +-call_properties+={"macro(^spin_lock_init_prof$)", {"pointee_write(2=never)", "taken()"}}
> +-call_properties+={"macro(^sched_test_func$)", {"pointee_write(1..=never)", "taken()"}}
> +-call_properties+={"macro(^dev_(info|warn)$)", {"pointee_write(1..=never)", "taken()"}}
> +-call_properties+={"macro(^PAGING_DEBUG$)", {"pointee_write(1..=never)", "taken()"}}
> +-call_properties+={"macro(^ACPI_(WARNING|ERROR|INFO)$)", {"pointee_write(1..=never)", "taken()"}}
> +-call_properties+={"name(fdt_get_property_by_offset_)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(read_atomic_size)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(device_tree_get_reg)", {"pointee_write(4..=always)", "pointee_read(4..=never)", "taken()"}}
> +-call_properties+={"name(dt_get_range)", {"pointee_write(3..=always)", "pointee_read(3..=never)", "taken()"}}
> +-call_properties+={"name(parse_static_mem_prop)", {"pointee_write(2..=always)", "pointee_read(2..=never)", "taken()"}}
> +-call_properties+={"name(get_ttbr_and_gran_64bit)", {"pointee_write(1..2=always)", "pointee_read(1..2=never)", "taken()"}}
> +-call_properties+={"name(hvm_emulate_init_once)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(__vmread)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(hvm_pci_decode_addr)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(vpci_mmcfg_decode_addr)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(x86emul_decode)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(unmap_grant_ref)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(arm_smmu_cmdq_build_cmd)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(pci_size_mem_bar)", {"pointee_write(4=always)", "pointee_read(4=never)", "taken()"}}
> +-call_properties+={"name(_hvm_read_entry)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(hvm_map_guest_frame_rw)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(guest_cpuid)", {"pointee_write(4=always)", "pointee_read(4=never)", "taken()"}}
> +-call_properties+={"name(epte_get_entry_emt)", {"pointee_write(5=always)", "pointee_read(5=never)", "taken()"}}
> +-call_properties+={"name(mcheck_mca_logout)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(set_field_in_reg_u32)", {"pointee_write(5=always)", "pointee_read(5=never)", "taken()"}}
> +-call_properties+={"name(alloc_affinity_masks)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(xasprintf)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(find_non_smt)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(call_rcu)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(getdomaininfo)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"^MAPPING_(INSERT|SEARCH)\\(.*$", {"pointee_write(2..=always)", "pointee_read(2..=never)", "taken()"}}
> +-call_properties+={"name(FormatDec)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(FormatHex)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(p2m_get_ioreq_server)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(elf_memset_unchecked)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(set_iommu_pte_present)", {"pointee_write(7=always)", "pointee_read(7=never)", "taken()"}}
> +-call_properties+={"name(clear_iommu_pte_present)", {"pointee_write(4=always)", "pointee_read(4=never)", "taken()"}}
> +-call_properties+={"name(vcpu_runstate_get)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(va_start)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(sgi_target_init)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(get_hw_residencies)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(x86_cpu_policy_to_featureset)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"^simple_strtou?ll?\\(.*$", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(msi_compose_msg)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(print_tainted)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(get_hvm_registers)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(x86_insn_modrm)", {"pointee_write(2..3=always)", "pointee_read(2..3=never)", "taken()"}}
> +-call_properties+={"name(cpuid_count_leaf)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(rcu_lock_remote_domain_by_id)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(cpuid_count)", {"pointee_write(3..=always)", "pointee_read(3..=never)", "taken()"}}
> +-call_properties+={"name(efi_boot_mem_unused)", {"pointee_write(1..=always)", "pointee_read(1..=never)", "taken()"}}
> +-call_properties+={"name(collect_time_info)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(setup_xstate_comp)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(map_domain_gfn)", {"pointee_read(5=never)", "taken()"}}
> +-call_properties+={"name(fdt_getprop)", {"pointee_read(4=never)", "taken()"}}
> +-call_properties+={"name(fdt_get_name)", {"pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(fdt_get_property)", {"pointee_read(4=never)", "taken()"}}
> +-call_properties+={"name(pci_get_host_bridge_segment)", {"pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(dt_get_property)", {"pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(dt_property_read_u32)", {"pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(dt_device_get_paddr)", {"pointee_read(3..4=never)", "taken()"}}
> +-call_properties+={"name(get_evtchn_dt_property)", {"pointee_write(2..3=maybe)", "pointee_read(2..3=never)", "taken()"}}
> +-call_properties+={"name(setup_chosen_node)", {"pointee_write(2..3=maybe)", "pointee_read(2..3=never)", "taken()"}}
> +-call_properties+={"name(queue_remove_raw)", {"pointee_read(2=never)", "taken()"}}
> +-call_properties+={"macro(^memset$)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"macro(^va_start$)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"macro(^memcmp$)", {"pointee_write(1..2=never)", "taken()"}}
> +-call_properties+={"macro(^memcpy$)", {"pointee_write(1=always&&2..=never)", "pointee_read(1=never&&2..=always)", "taken()"}}
> +
> +-doc_begin="Property inferred as a consequence of the semantics of device_tree_get_reg"
> +-call_properties+={"name(acquire_static_memory_bank)", {"pointee_write(4..=always)", "pointee_read(4..=never)", "taken()"}}
> +-doc_end
> +
> +-doc_begin="Property inferred as a consequence of the semantics of dt_set_cell"
> +-call_properties+={"name(set_interrupt)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-doc_end
> +
> +-doc_begin="Property inferred as a consequence of the semantics of __p2m_get_mem_access"
> +-call_properties+={"name(p2m_get_mem_access)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-doc_end
> +
> +-doc_begin="This function has alternative definitions with props {write=always,read=never} and {write=never,read=never}"
> +-call_properties+={"name(alloc_cpumask_var)", {"pointee_write(1=maybe)", "pointee_read(1=never)", "taken()"}}
> +-doc_end
> +
> +-doc_begin="Property inferred as a consequence of the semantics of alloc_cpumask_var"
> +-call_properties+={"name(xenctl_bitmap_to_cpumask)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-doc_end
> +
> +-doc_begin="The call to bitmap_and causes the pointee of dstp to be always written"
> +-call_properties+={"^cpumask_(and|andnot|clear|copy|complement).*$", {"pointee_write(1=always)", "pointee_read(1=never)" "taken()"}}
> +-call_properties+={"^bitmap_(andnot|complement|fill).*$", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-doc_end
> +
> +-doc_begin="The .*copy_(to|from).* helpers all have a memcpy-like expectation that the destination is a copy of the source.
> +Furthermore, their uses do initialize the involved variables as needed by futher uses in the caller."
> +-call_properties+={"macro(^(__)?(raw_)?copy_from_(paddr|guest|compat)(_offset)?$)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"macro(^(__)?copy_to_(guest|compat)(_offset)?$)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-doc_end
> diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
> new file mode 100644
> index 0000000000..e1a06daf2f
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
> @@ -0,0 +1,298 @@
> +### Set 1 ###
> +
> +#
> +# Series 2.
> +#
> +
> +-doc_begin="The compiler implementation guarantees that the unreachable code is removed.
> +Constant expressions and unreachable branches of if and switch statements are expected."
> +-config=MC3R1.R2.1,+reports={safe,"first_area(^.*has an invariantly.*$)"}
> +-config=MC3R1.R2.1,+reports={safe,"first_area(^.*incompatible with labeled statement$)"}
> +-doc_end
> +
> +-doc_begin="Some functions are intended to be not referenced."
> +-config=MC3R1.R2.1,+reports={deliberate,"first_area(^.*is never referenced$)"}
> +-doc_end
> +
> +-doc_begin="Unreachability in the following macros are expected and safe."
> +-config=MC3R1.R2.1,statements+={safe,"macro(name(BUG||assert_failed||ERROR_EXIT||ERROR_EXIT_DOM||PIN_FAIL))"}
> +-doc_end
> +
> +-doc_begin="Proving compliance with respect to Rule 2.2 is generally impossible:
> +see https://arxiv.org/abs/2212.13933 for details. Moreover, peer review gives us
> +confidence that no evidence of errors in the program's logic has been missed due
> +to undetected violations of Rule 2.2, if any. Testing on time behavior gives us
> +confidence on the fact that, should the program contain dead code that is not
> +removed by the compiler, the resulting slowdown is negligible."
> +-config=MC3R1.R2.2,reports+={disapplied,"any()"}
> +-doc_end
> +
> +#
> +# Series 3.
> +#
> +
> +-doc_begin="Comments starting with '/*' and containing hyperlinks are safe as
> +they are not instances of commented-out code."
> +-config=MC3R1.R3.1,reports+={safe, "first_area(text(^.*https?://.*$))"}
> +-doc_end
> +
> +#
> +# Series 4.
> +#
> +
> +-doc_begin="The directive has been accepted only for the ARM codebase."
> +-config=MC3R1.D4.3,reports+={disapplied,"!(any_area(any_loc(file(^xen/arch/arm/arm64/.*$))))"}
> +-doc_end
> +
> +-doc_begin="Depending on the compiler, rewriting the following function-like
> +macros as inline functions is not guaranteed to have the same effect."
> +-config=MC3R1.D4.9,macros+={deliberate,"name(likely)"}
> +-config=MC3R1.D4.9,macros+={deliberate,"name(unlikely)"}
> +-config=MC3R1.D4.9,macros+={deliberate,"name(unreachable)"}
> +-doc_end
> +
> +-doc_begin="These macros can be used on both pointers and unsigned long type values."
> +-config=MC3R1.D4.9,macros+={safe,"name(virt_to_maddr)"}
> +-config=MC3R1.D4.9,macros+={safe,"name(virt_to_mfn)"}
> +-doc_end
> +
> +-doc_begin="Rewriting variadic macros as variadic functions might have a negative impact on safety."
> +-config=MC3R1.D4.9,macros+={deliberate,"variadic()"}
> +-doc_end
> +
> +-doc_begin="Rewriting macros with arguments that are, in turn, arguments of
> +__builtin_constant_p() can change the behavior depending on the optimization
> +level."
> +-config=MC3R1.D4.9,macro_argument_context+="skip_to(class(type||expr||decl,any),
> +                                            call(name(__builtin_constant_p)))"
> +-doc_end
> +
> +-doc_begin="Function-like macros defined in public headers are meant to be
> +usable in C89 mode without any extensions. Hence they cannot be replaced by
> +inline functions."
> +-config=MC3R1.D4.9,macros+={deliberate, "loc(file(api:public))"}
> +-doc_end
> +
> +-doc_begin="This header file is autogenerated or empty, therefore it poses no
> +risk if included more than once."
> +-file_tag+={empty_header, "^xen/arch/arm/efi/runtime\\.h$"}
> +-file_tag+={autogen_headers, "^xen/include/xen/compile\\.h$||^xen/include/generated/autoconf.h$||^xen/include/xen/hypercall-defs.h$"}
> +-config=MC3R1.D4.10,reports+={safe, "all_area(all_loc(file(empty_header||autogen_headers)))"}
> +-doc_end
> +
> +-doc_begin="Files that are intended to be included more than once do not need to
> +conform to the directive."
> +-config=MC3R1.D4.10,reports+={safe, "first_area(text(^/\\* This file is legitimately included multiple times\\. \\*/$, begin-4))"}
> +-config=MC3R1.D4.10,reports+={safe, "first_area(text(^/\\* Generated file, do not edit! \\*/$, begin-3))"}
> +-doc_end
> +
> +#
> +# Series 5.
> +#
> +
> +-doc_begin="The project adopted the rule with an exception listed in
> +'docs/misra/rules.rst'"
> +-config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^READ_SYSREG$))&&any_exp(macro(^WRITE_SYSREG$))))"}
> +-config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^max_t$))&&any_exp(macro(^min_t$))))"}
> +-config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^read[bwlq]$))&&any_exp(macro(^read[bwlq]_relaxed$))))"}
> +-config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^per_cpu$))&&any_exp(macro(^this_cpu$))))"}
> +-doc_end
> +
> +-doc_begin="The identifier 'fdt' is a widely-used name, for which no suitable
> +substitute can be found. It is understood in 'xen/arch/arm/efi-boot.h' that the
> +static variable 'fdt' cannot be confused with parameter names of the function
> +declarations that are present in the file."
> +-file_tag+={efi_boot_h, "^xen/arch/arm/efi/efi-boot\\.h$"}
> +-config=MC3R1.R5.3,reports+={deliberate, "any_area(decl(kind(var)&&static_storage()&&^fdt$)&&any_loc(file(efi_boot_h)))"}
> +-doc_end
> +
> +-doc_begin="The identifier 'start' is a widely-used name, for which no suitable
> +substitute can be found. It is understood in 'xen/include/xen/kernel.h' that the
> +extern variable 'start' cannot be confused with omonymous parameter names of the
> +function declarations where that variable is visible."
> +-file_tag+={kernel_h, "^xen/include/xen/kernel\\.h$"}
> +-config=MC3R1.R5.3,reports+={deliberate, "any_area(decl(kind(var)&&linkage(external)&&^start$)&&any_loc(file(kernel_h)))"}
> +-doc_end
> +
> +-doc_begin="Function-like macros cannot be confused with identifiers that are
> +neither functions nor pointers to functions."
> +-config=MC3R1.R5.5,reports={safe,"all_area(decl(node(enum_decl||record_decl||field_decl||param_decl||var_decl)&&!type(canonical(address((node(function||function_no_proto))))))||macro(function_like()))"}
> +-doc_end
> +
> +-doc_begin="The use of these identifiers for both macro names and other entities
> +is deliberate and does not generate developer confusion."
> +-config=MC3R1.R5.5,reports+={safe, "any_area(text(^\\s*/\\*\\s+SAF-[0-9]+-safe\\s+MC3R1\\.R5\\.5.*$, begin-1))"}
> +-doc_end
> +
> +-doc_begin="The definition of macros and functions ending in '_bit' that use the
> +same identifier in 'bitops.h' is deliberate and safe."
> +-file_tag+={bitops_h, "^xen/arch/x86/include/asm/bitops\\.h$"}
> +-config=MC3R1.R5.5,reports+={safe, "all_area((decl(^.*_bit\\(.*$)||macro(^.*_bit$))&&all_loc(file(bitops_h)))"}
> +-doc_end
> +
> +-doc_begin="The definition of macros and functions beginning in 'str' or 'mem'
> +that use the same identifier in 'xen/include/xen/string.h' is deliberate and
> +safe."
> +-file_tag+={string_h, "^xen/include/xen/string\\.h$"}
> +-config=MC3R1.R5.5,reports+={safe, "any_area((decl(^(mem|str).*$)||macro(^(mem|str).*$))&&all_loc(file(string_h)))"}
> +-doc_end
> +
> +#
> +# Series 7.
> +#
> +
> +-doc_begin="Usage of the following constants is safe, since they are given as-is
> +in the inflate algorithm specification and there is therefore no risk of them
> +being interpreted as decimal constants."
> +-config=MC3R1.R7.1,literals={safe, "^0(007|37|070|213|236|300|321|330|331|332|333|334|335|337|371)$"}
> +-doc_end
> +
> +-doc_begin="Violations in files that maintainers have asked to not modify in the
> +context of R7.2."
> +-file_tag+={adopted_r7_2,"^xen/include/xen/libfdt/.*$"}
> +-file_tag+={adopted_r7_2,"^xen/arch/x86/include/asm/x86_64/efibind.h$"}
> +-file_tag+={adopted_r7_2,"^xen/include/efi/efiapi\\.h$"}
> +-file_tag+={adopted_r7_2,"^xen/include/efi/efidef\\.h$"}
> +-file_tag+={adopted_r7_2,"^xen/include/efi/efiprot\\.h$"}
> +-file_tag+={adopted_r7_2,"^xen/arch/x86/cpu/intel\\.c$"}
> +-file_tag+={adopted_r7_2,"^xen/arch/x86/cpu/amd\\.c$"}
> +-file_tag+={adopted_r7_2,"^xen/arch/x86/cpu/common\\.c$"}
> +-config=MC3R1.R7.2,reports+={deliberate,"any_area(any_loc(file(adopted_r7_2)))"}
> +-doc_end
> +
> +-doc_begin="Violations caused by __HYPERVISOR_VIRT_START are related to the
> +particular use of it done in xen_mk_ulong."
> +-config=MC3R1.R7.2,reports+={deliberate,"any_area(any_loc(macro(name(BUILD_BUG_ON))))"}
> +-doc_end
> +
> +-doc_begin="The following string literals are assigned to pointers to non
> +const-qualified char."
> +-config=MC3R1.R7.4,reports+={safe, "any_area(text(^\\s*/\\*\\s+SAF-[0-9]+-safe\\s+MC3R1\\.R7\\.4.*$, begin-1))"}
> +-doc_end
> +
> +-doc_begin="Allow pointers of non-character type as long as the pointee is
> +const-qualified."
> +-config=MC3R1.R7.4,same_pointee=false
> +-doc_end
> +
> +#
> +# Series 8.
> +#
> +
> +-doc_begin="The following variables are compiled in multiple translation units
> +belonging to different executables and therefore are safe."
> +-config=MC3R1.R8.6,declarations+={safe, "name(current_stack_pointer||bsearch||sort)"}
> +-doc_end
> +
> +-doc_begin="Declarations without definitions are allowed (specifically when the
> +definition is compiled-out or optimized-out by the compiler)"
> +-config=MC3R1.R8.6,reports+={deliberate, "first_area(^.*has no definition$)"}
> +-doc_end
> +
> +-doc_begin="The gnu_inline attribute without static is deliberately allowed."
> +-config=MC3R1.R8.10,declarations+={deliberate,"property(gnu_inline)"}
> +-doc_end
> +
> +#
> +# Series 9.
> +#
> +
> +-doc_begin="The following variables are written before being set, therefore no
> +access to uninitialized memory locations happens, as explained in the deviation
> +comment."
> +-config=MC3R1.R9.1,reports+={safe, "any_area(text(^\\s*/\\*\\s+SAF-[0-9]+-safe\\s+MC3R1\\.R9\\.1.*$, begin-1))"}
> +-doc_end
> +
> +-doc_begin="Violations in files that maintainers have asked to not modify in the
> +context of R9.1."
> +-file_tag+={adopted_r9_1,"^xen/arch/arm/arm64/lib/find_next_bit\\.c$"}
> +-config=MC3R1.R9.1,reports+={deliberate,"any_area(any_loc(file(adopted_r9_1)))"}
> +-doc_end
> +
> +-doc_begin="The possibility of committing mistakes by specifying an explicit
> +dimension is higher than omitting the dimension."
> +-config=MC3R1.R9.5,reports+={deliberate, "any()"}
> +-doc_end
> +
> +### Set 2 ###
> +
> +#
> +# Series 10.
> +#
> +
> +-doc_begin="The value-preserving conversions of integer constants are safe"
> +-config=MC3R1.R10.1,etypes={safe,"any()","preserved_integer_constant()"}
> +-config=MC3R1.R10.3,etypes={safe,"any()","preserved_integer_constant()"}
> +-config=MC3R1.R10.4,etypes={safe,"any()","preserved_integer_constant()||sibling(rhs,preserved_integer_constant())"}
> +-doc_end
> +
> +-doc_begin="Shifting non-negative integers to the right is safe."
> +-config=MC3R1.R10.1,etypes+={safe,
> +  "stmt(node(binary_operator)&&operator(shr))",
> +  "src_expr(definitely_in(0..))"}
> +-doc_end
> +
> +-doc_begin="Shifting non-negative integers to the left is safe if the result is
> +still non-negative."
> +-config=MC3R1.R10.1,etypes+={safe,
> +  "stmt(node(binary_operator)&&operator(shl)&&definitely_in(0..))",
> +  "src_expr(definitely_in(0..))"}
> +-doc_end
> +
> +-doc_begin="Bitwise logical operations on non-negative integers are safe."
> +-config=MC3R1.R10.1,etypes+={safe,
> +  "stmt(node(binary_operator)&&operator(and||or||xor))",
> +  "src_expr(definitely_in(0..))"}
> +-doc_end
> +
> +-doc_begin="The implicit conversion to Boolean for logical operator arguments is well known to all Xen developers to be a comparison with 0"
> +-config=MC3R1.R10.1,etypes+={safe, "stmt(operator(logical)||node(conditional_operator||binary_conditional_operator))", "dst_type(ebool||boolean)"}
> +-doc_end
> +
> +### Set 3 ###
> +
> +#
> +# Series 18.
> +#
> +
> +-doc_begin="FIXME: explain why pointer differences involving this macro are safe."
> +-config=MC3R1.R18.2,reports+={safe,"all_area(all_loc(any_exp(macro(^ACPI_PTR_DIFF$))))"}
> +-doc_end
> +
> +-doc_begin="FIXME: explain why pointer differences involving this macro are safe."
> +-config=MC3R1.R18.2,reports+={safe,"all_area(all_loc(any_exp(macro(^page_to_mfn$))))"}
> +-doc_end
> +
> +-doc_begin="FIXME: explain why pointer differences involving this macro are safe."
> +-config=MC3R1.R18.2,reports+={safe,"all_area(all_loc(any_exp(macro(^page_to_pdx$))))"}
> +-doc_end
> +
> +#
> +# Series 20.
> +#
> +
> +-doc_begin="Code violating Rule 20.7 is safe when macro parameters are used: (1)
> +as function arguments; (2) as macro arguments; (3) as array indices; (4) as lhs
> +in assignments."
> +-config=MC3R1.R20.7,expansion_context=
> +{safe, "context(__call_expr_arg_contexts)"},
> +{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(node(array_subscript_expr), subscript)))"},
> +{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(operator(assign), lhs)))"},
> +{safe, "left_right(^[(,\\[]$,^[),\\]]$)"}
> +-doc_end
> +
> +#
> +# Developer confusion
> +#
> +
> +-doc="Selection for reports that are fully contained in adopted code."
> +-report_selector+={adopted_report,"all_area(!kind(culprit||evidence)||all_loc(all_exp(adopted||pseudo)))"}
> +
> +-doc_begin="Adopted code is not meant to be read, reviewed or modified by human
> +programmers:no developers' confusion is not possible. In addition, adopted code
> +is assumed to work as is. Reports that are fully contained in adopted code are
> +hidden/tagged with the 'adopted' tag."
> +-service_selector={developer_confusion_guidelines,"^(MC3R1\\.R2\\.1|MC3R1\\.R2\\.2|MC3R1\\.R2\\.3|MC3R1\\.R2\\.4|MC3R1\\.R2\\.5|MC3R1\\.R2\\.6|MC3R1\\.R2\\.7|MC3R1\\.R4\\.1|MC3R1\\.R5\\.3|MC3R1\\.R5\\.6|MC3R1\\.R5\\.7|MC3R1\\.R5\\.8|MC3R1\\.R5\\.9|MC3R1\\.R7\\.1|MC3R1\\.R7\\.2|MC3R1\\.R7\\.3|MC3R1\\.R8\\.7|MC3R1\\.R8\\.8|MC3R1\\.R8\\.9|MC3R1\\.R8\\.11|MC3R1\\.R8\\.12|MC3R1\\.R8\\.13|MC3R1\\.R9\\.3|MC3R1\\.R9\\.4|MC3R1\\.R9\\.5|MC3R1\\.R10\\.2|MC3R1\\.R10\\.5|MC3R1\\.R10\\.6|MC3R1\\.R10\\.7|MC3R1\\.R10\\.8|MC3R1\\.R11\\.9|MC3R1\\.R12\\.1|MC3R1\\.R12\\.3|MC3R1\\.R12\\.4|MC3R1\\.R13\\.5|MC3R1\\.R14\\.1|MC3R1\\.R14\\.2|MC3R1\\.R14\\.3|MC3R1\\.R15\\.1|MC3R1\\.R15\\.2|MC3R1\\.R15\\.3|MC3R1\\.R15\\.4|MC3R1\\.R15\\.5|MC3R1\\.R15\\.6|MC3R1\\.R15\\.7|MC3R1\\.R16\\.1|MC3R1\\.R16\\.2|MC3R1\\.R16\\.3|MC3R1\\.R16\\.4|MC3R1\\.R16\\.5|MC3R1\\.R16\\.6|MC3R1\\.R16\\.7|MC3R1\\.R17\\.7|MC3R1\\.R17\\.8|MC3R1\\.R18\\.4|MC3R1\\.R18\\.5)$"
> +}
> +-config=developer_confusion_guidelines,reports+={relied,adopted_report}
> +-doc_end
> diff --git a/automation/eclair_analysis/ECLAIR/out_of_scope.ecl b/automation/eclair_analysis/ECLAIR/out_of_scope.ecl
> new file mode 100644
> index 0000000000..44db6997b5
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/out_of_scope.ecl
> @@ -0,0 +1,127 @@
> +-doc_begin="Imported from Linux: ignore for now."
> +-file_tag+={adopted,"^xen/common/libfdt/.*$"}
> +-file_tag+={adopted,"^xen/include/xen/libfdt/.*$"}
> +-file_tag+={adopted,"^xen/common/xz/.*$"}
> +-file_tag+={adopted,"^xen/common/zstd/.*$"}
> +-file_tag+={adopted,"^xen/drivers/acpi/apei/.*$"}
> +-file_tag+={adopted,"^xen/drivers/acpi/tables/.*$"}
> +-file_tag+={adopted,"^xen/drivers/acpi/utilities/.*$"}
> +-file_tag+={adopted,"^xen/drivers/video/font_.*$"}
> +-file_tag+={adopted,"^xen/arch/arm/arm64/cpufeature\\.c$"}
> +-file_tag+={adopted,"^xen/arch/arm/arm64/insn\\.c$"}
> +-file_tag+={adopted,"^xen/arch/arm/arm64/lib/find_next_bit\\.c$"}
> +-file_tag+={adopted,"^xen/common/bitmap\\.c$"}
> +-file_tag+={adopted,"^xen/common/bunzip2\\.c$"}
> +-file_tag+={adopted,"^xen/common/earlycpio\\.c$"}
> +-file_tag+={adopted,"^xen/common/inflate\\.c$"}
> +-file_tag+={adopted,"^xen/common/lzo\\.c$"}
> +-file_tag+={adopted,"^xen/common/lz4/decompress\\.c$"}
> +-file_tag+={adopted,"^xen/common/radix-tree\\.c$"}
> +-file_tag+={adopted,"^xen/common/ubsan/ubsan\\.c$"}
> +-file_tag+={adopted,"^xen/drivers/acpi/hwregs\\.c$"}
> +-file_tag+={adopted,"^xen/drivers/acpi/numa\\.c$"}
> +-file_tag+={adopted,"^xen/drivers/acpi/osl\\.c$"}
> +-file_tag+={adopted,"^xen/drivers/acpi/tables\\.c$"}
> +-file_tag+={adopted,"^xen/lib/list-sort\\.c$"}
> +-file_tag+={adopted,"^xen/lib/rbtree\\.c$"}
> +-file_tag+={adopted,"^xen/lib/xxhash.*\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/acpi/boot\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/acpi/cpu_idle\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/acpi/cpufreq/cpufreq\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/acpi/cpuidle_menu\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/acpi/lib\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/cpu/amd\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/cpu/centaur\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/cpu/common\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/cpu/hygon\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/cpu/intel\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/cpu/intel_cacheinfo\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/cpu/mcheck/non-fatal\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/cpu/mtrr/.*$"}
> +-file_tag+={adopted,"^xen/arch/x86/cpu/mwait-idle\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/delay\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/dmi_scan\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/mpparse\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/srat\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/time\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/x86_64/mmconf-fam10h\\.c$"}
> +-doc_end
> +
> +-doc_begin="Intel specific source files are out of scope."
> +-file_tag+={out_of_scope,"^xen/arch/x86/cpu/intel\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/cpu/intel_cacheinfo\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/cpu/microcode/intel\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/cpu/shanghai\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/hvm/vmx/.*$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/include/asm/hvm/vmx/.*$"}
> +-file_tag+={out_of_scope,"^xen/drivers/passthrough/vtd/.*$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/cpu/mcheck/mce_intel\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/cpu/mwait-idle\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/cpu/vpmu_intel\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/tsx\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/mm/altp2m\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/mm/p2m-ept\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/mm/hap/nested_ept\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/include/asm/altp2m\\.h$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/include/asm/intel-family\\.h$"}
> +-doc_end
> +
> +-doc_begin="Not in scope initially as it generates many violations and it is not enabled in safety configurations."
> +-file_tag+={adopted,"^xen/xsm/flask/.*$"}
> +-doc_end
> +
> +-doc_begin="unlz4.c implementation by Yann Collet, the others un* are from Linux, ignore for now."
> +-file_tag+={adopted,"^xen/common/un.*\\.c$"}
> +-doc_end
> +
> +-doc_begin="Origin is external and documented in xen/crypto/README.source ."
> +-file_tag+={adopted,"^xen/crypto/.*$"}
> +-doc_end
> +
> +-doc_begin="Files imported from the gnu-efi package"
> +-file_tag+={adopted,"^xen/include/efi/.*$"}
> +-file_tag+={adopted,"^xen/arch/x86/include/asm/x86_64/efibind\\.h$"}
> +-doc_end
> +
> +-doc_begin="Build tools are out of scope."
> +-file_tag+={out_of_scope_tools,"^xen/tools/.*$"}
> +-file_tag+={out_of_scope_tools,"^xen/arch/x86/efi/mkreloc\\.c$"}
> +-file_tag+={out_of_scope_tools,"^xen/arch/x86/boot/mkelf32\\.c$"}
> +-doc_end
> +
> +-doc_begin="Out of scope headers."
> +-file_tag+={out_of_scope,"^xen/include/xen/bitmap\\.h$"}
> +-file_tag+={out_of_scope,"^xen/include/xen/earlycpio\\.h$"}
> +-file_tag+={out_of_scope,"^xen/include/xen/lzo\\.h$"}
> +-file_tag+={out_of_scope,"^xen/include/xen/lz4\\.h$"}
> +-file_tag+={out_of_scope,"^xen/common/lz4/defs\\.h$"}
> +-file_tag+={out_of_scope,"^xen/include/xen/radix-tree\\.h$"}
> +-file_tag+={out_of_scope,"^xen/include/xen/list_sort\\.h$"}
> +-file_tag+={out_of_scope,"^xen/include/xen/rbtree\\.h$"}
> +-file_tag+={out_of_scope,"^xen/include/xen/xxhash\\.h$"}
> +-doc_end
> +
> +-doc_begin="Headers under xen/include/public/ are the description of the public
> +hypercall ABI so the community is extremely conservative in making changes
> +there, because the interface is maintained for backward compatibility: ignore
> +for now."
> +-file_tag+={hypercall_ABI, "^xen/include/public/.*$"}
> +-source_files+={hide, hypercall_ABI}
> +-doc_end
> +
> +-doc_begin="Consider out-of-scope files external to the project."
> +-file_tag+={external, out_of_scope}
> +-doc_end
> +
> +-doc_begin="Consider adopted files external to the project."
> +-file_tag+={external, adopted}
> +-doc_end
> +
> +-doc_begin="Disregard out-of-scope tools."
> +-frames+={hide,"main(out_of_scope_tools)"}
> +-doc_end
> +
> +-doc_begin="The build performs speculative calls with target /dev/null: this
> +frames should be ignored."
> +-frames+={hide,"target(^/dev/null$)"}
> +-doc_end
> diff --git a/automation/eclair_analysis/ECLAIR/print_analyzed_files.sh b/automation/eclair_analysis/ECLAIR/print_analyzed_files.sh
> new file mode 100755
> index 0000000000..163228ea96
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/print_analyzed_files.sh
> @@ -0,0 +1,66 @@
> +#!/bin/bash
> +# Stop immediately if any executed command has exit status different from 0.
> +set -eux
> +
> +script_name="$(basename "$0")"
> +script_dir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
> +
> +fatal() {
> +  echo "${script_name}: $*" >&2
> +  exit 1
> +}
> +
> +usage() {
> +  fatal "Usage: ${script_name} DATABASE OUT_DIR"
> +}
> +
> +extrapolate_regex() {
> +  lookbehind=$1
> +  file=$2
> +  grep -Po "(?<=${lookbehind}\"\\^).*(?=\\$\")" "${file}" | sed 's/\\\\/\\/'
> +}
> +
> +if [ $# -lt 2 ]; then
> +  usage
> +fi
> +
> +DB=$1
> +OUT_DIR=$2
> +
> +files_txt="${OUT_DIR}/files.txt"
> +files_c_txt="${OUT_DIR}/files_c.txt"
> +files_h_txt="${OUT_DIR}/files_h.txt"
> +exclusions_txt="${OUT_DIR}/exclusions.txt"
> +
> +
> +if [[ ! -d "${OUT_DIR}" ]]; then
> +  mkdir -p "${OUT_DIR}"
> +else
> +  rm -f "${files_txt}"
> +  rm -f "${files_c_txt}"
> +  rm -f "${files_h_txt}"
> +  rm -f "${exclusions_txt}"
> +fi
> +
> +# Generating txt report with files
> +"${ECLAIR_BIN_DIR}eclair_report" -db="${DB}" -files_txt="${files_txt}"
> +
> +{
> +  # Extracting out of scope code
> +  out_of_scope_ecl="${script_dir}/out_of_scope.ecl"
> +  extrapolate_regex adopted,             "${out_of_scope_ecl}"
> +  extrapolate_regex out_of_scope_tools,  "${out_of_scope_ecl}"
> +  extrapolate_regex out_of_scope,        "${out_of_scope_ecl}"
> +  extrapolate_regex hypercall_ABI,       "${out_of_scope_ecl}"
> +  extrapolate_regex "hide, "             "${out_of_scope_ecl}"
> +} >"${exclusions_txt}"
> +sort -o "${exclusions_txt}" -u "${exclusions_txt}"
> +
> +# Removing exclusions from files_txt
> +grep -E -v "(object: |/dev/pipe)" "${files_txt}" > "${files_txt}.tmp"
> +grep -vf "${exclusions_txt}" "${files_txt}.tmp" > "${files_txt}"
> +rm "${files_txt}.tmp"
> +# Creating files with only headers
> +grep -Ev "(xen.*\.(h\w+|[^h]\w*) |.*ecl)" "${files_txt}" > "${files_h_txt}"
> +# Creating files with only c files
> +grep -Ev "(xen.*\.(c\w+|[^c]\w*) |.*ecl)" "${files_txt}" > "${files_c_txt}"
> diff --git a/automation/eclair_analysis/ECLAIR/public_APIs.ecl b/automation/eclair_analysis/ECLAIR/public_APIs.ecl
> new file mode 100644
> index 0000000000..9701a295e6
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/public_APIs.ecl
> @@ -0,0 +1,6 @@
> +# Definition of the public APIs.
> +
> +-doc="All Xen public headers."
> +-file_tag+={api:public,"^xen/include/public/.*\\.h$"}
> +
> +-public_files+=api:public
> diff --git a/automation/eclair_analysis/ECLAIR/report.ecl b/automation/eclair_analysis/ECLAIR/report.ecl
> new file mode 100644
> index 0000000000..6ee324746c
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/report.ecl
> @@ -0,0 +1,4 @@
> +# eclair_report
> +
> +reports_codeclimate("gl-code-quality-report.json")
> +
> diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/eclair_analysis/ECLAIR/tagging.ecl
> new file mode 100644
> index 0000000000..ef2e56e186
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
> @@ -0,0 +1,34 @@
> +-doc="Hide reports marked as compliant."
> +-remap_rtag={compliant,hide}
> +
> +-doc="Hide reports marked as safe."
> +-remap_rtag={safe,hide}
> +
> +-doc="Hide reports marked as relied."
> +-remap_rtag={relied,hide}
> +
> +-doc="Hide reports marked as deliberate."
> +-remap_rtag={deliberate,hide}
> +
> +-doc="Hide reports marked as disapplied."
> +-remap_rtag={disapplied,hide}
> +
> +#######################
> +# Accepted guidelines #
> +#######################
> +
> +-doc="Accepted guidelines as reported in XEN/docs/misra/rules.rst"
> +-service_selector={accepted_guidelines,"^(MC3R1\\.D1\\.1|MC3R1\\.D2\\.1|MC3R1\\.D4\\.3|MC3R1\\.D4\\.7|MC3R1\\.D4\\.10|MC3R1\\.D4\\.11|MC3R1\\.D4\\.14|MC3R1\\.R1\\.1|MC3R1\\.R1\\.3|MC3R1\\.R1\\.4|MC3R1\\.R2\\.1|MC3R1\\.R2\\.6|MC3R1\\.R2\\.2|MC3R1\\.R3\\.1|MC3R1\\.R3\\.2|MC3R1\\.R4\\.1|MC3R1\\.R4\\.2|MC3R1\\.R5\\.1|MC3R1\\.R5\\.2|MC3R1\\.R5\\.3|MC3R1\\.R5\\.4|MC3R1\\.R5\\.6|MC3R1\\.R6\\.1|MC3R1\\.R6\\.2|MC3R1\\.R7\\.1|MC3R1\\.R7\\.2|MC3R1\\.R7\\.3|MC3R1\\.R7\\.4|MC3R1\\.R8\\.1|MC3R1\\.R8\\.2|MC3R1\\.R8\\.3|MC3R1\\.R8\\.4|MC3R1\\.R8\\.5|MC3R1\\.R8\\.6|MC3R1\\.R8\\.8|MC3R1\\.R8\\.10|MC3R1\\.R8\\.12|MC3R1\\.R8\\.14|MC3R1\\.R9\\.1|MC3R1\\.R9\\.2|MC3R1\\.R9\\.3|MC3R1\\.R9\\.4|MC3R1\\.R9\\.5|MC3R1\\.R12\\.5|MC3R1\\.R13\\.6|MC3R1\\.R13\\.1|MC3R1\\.R14\\.1|MC3R1\\.R16\\.7|MC3R1\\.R17\\.3|MC3R1\\.R17\\.4|MC3R1\\.R17\\.6|MC3R1\\.R18\\.3|MC3R1\\.R19\\.1|MC3R1\\.R20\\.7|MC3R1\\.R20\\.13|MC3R1\\.R20\\.14|MC3R1\\.R21\\.13|MC3R1\\.R21\\.17|MC3R1\\.R21\\.18|MC3R1\\.R21\\.19|MC3R1\\.R21\\.20|MC3R1\\
 .R21\\.21|MC3R1\\.R22\\.2|MC3R1\\.R22\\.4|MC3R1\\.R22\\.5|MC3R1\\.R22\\.6)$"
> +}
> +-doc="All reports of accepted guidelines are tagged as accepted."
> +-reports+={status:accepted,"service(accepted_guidelines)"}
> +
> +####################
> +# Clean guidelines #
> +####################
> +
> +-doc_begin="Clean guidelines: new violations for these guidelines are not accepted."
> +-service_selector={clean_guidelines,"^(MC3R1\\.D1\\.1|MC3R1\\.D2\\.1|MC3R1\\.D4\\.11|MC3R1\\.D4\\.14|MC3R1\\.R1\\.4|MC3R1\\.R2\\.2|MC3R1\\.R3\\.2|MC3R1\\.R5\\.1|MC3R1\\.R5\\.2|MC3R1\\.R5\\.4|MC3R1\\.R6\\.1|MC3R1\\.R6\\.2|MC3R1\\.R7\\.1|MC3R1\\.R8\\.1|MC3R1\\.R8\\.5|MC3R1\\.R8\\.8|MC3R1\\.R8\\.10|MC3R1\\.R8\\.12|MC3R1\\.R8\\.14|MC3R1\\.R9\\.2|MC3R1\\.R9\\.4|MC3R1\\.R9\\.5|MC3R1\\.R12\\.5|MC3R1\\.R17\\.3|MC3R1\\.R17\\.6|MC3R1\\.R21\\.13|MC3R1\\.R21\\.19|MC3R1\\.R21\\.21|MC3R1\\.R22\\.2|MC3R1\\.R22\\.4|MC3R1\\.R22\\.5)$"
> +}
> +-reports+={clean:added,"service(clean_guidelines)"}
> +-doc_end
> diff --git a/automation/eclair_analysis/ECLAIR/toolchain.ecl b/automation/eclair_analysis/ECLAIR/toolchain.ecl
> new file mode 100644
> index 0000000000..e6cd289b5e
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/toolchain.ecl
> @@ -0,0 +1,275 @@
> +# Compilers.
> +-file_tag+={GCC_ARM64,"^/usr/bin/aarch64-linux-gnu-gcc-12$"}
> +-file_tag+={GCC_X86_64,"^/usr/bin/x86_64-linux-gnu-gcc-12$"}
> +
> +# Manuals.
> +-setq=GCC_MANUAL,"https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc.pdf"
> +-setq=CPP_MANUAL,"https://gcc.gnu.org/onlinedocs/gcc-12.1.0/cpp.pdf"
> +-setq=ARM64_ABI_MANUAL,"https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs64/aapcs64.rst"
> +-setq=X86_64_ABI_MANUAL,"https://gitlab.com/x86-psABIs/x86-64-ABI/-/jobs/artifacts/master/raw/x86-64-ABI/abi.pdf?job=build"
> +-setq=ARM64_LIBC_MANUAL,"https://www.gnu.org/software/libc/manual/pdf/libc.pdf"
> +-setq=X86_64_LIBC_MANUAL,"https://www.gnu.org/software/libc/manual/pdf/libc.pdf"
> +-setq=C99_STD,"ISO/IEC 9899:1999"
> +
> +-doc_begin="
> +    _Static_assert: see Section \"2.1 C Language\" of "GCC_MANUAL".
> +    asm, __asm__: see Sections \"6.48 Alternate Keywords\" and \"6.47 How to Use Inline Assembly Language in C Code\" of "GCC_MANUAL".
> +    __volatile__: see Sections \"6.48 Alternate Keywords\" and \"6.47.2.1 Volatile\" of "GCC_MANUAL".
> +    __const__, __inline__, __inline: see Section \"6.48 Alternate Keywords\" of "GCC_MANUAL".
> +    typeof, __typeof__: see Section \"6.7 Referring to a Type with typeof\" of "GCC_MANUAL".
> +    __alignof__, __alignof: see Sections \"6.48 Alternate Keywords\" and \"6.44 Determining the Alignment of Functions, Types or Variables\" of "GCC_MANUAL".
> +    __attribute__: see Section \"6.39 Attribute Syntax\" of "GCC_MANUAL".
> +    __builtin_types_compatible_p: see Section \"6.59 Other Built-in Functions Provided by GCC\" of "GCC_MANUAL".
> +    __builtin_va_arg: non-documented GCC extension.
> +    __builtin_offsetof: see Section \"6.53 Support for offsetof\" of "GCC_MANUAL".
> +"
> +-config=STD.tokenext,behavior+={c99, GCC_ARM64, "^(_Static_assert|asm|__asm__|__volatile__|__const__|__inline__|typeof|__typeof__|__alignof__|__attribute__|__builtin_types_compatible_p|__builtin_va_arg|__builtin_offsetof)$"}
> +-config=STD.tokenext,behavior+={c99, GCC_X86_64, "^(_Static_assert|asm|__asm__|__volatile__|__const__|__inline__|__inline|typeof|__typeof__|__alignof__|__alignof|__attribute__|__builtin_types_compatible_p|__builtin_va_arg|__builtin_offsetof)$"}
> +-doc_end
> +
> +-doc_begin="Non-documented GCC extension."
> +-config=STD.emptinit,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.emptinit,behavior+={c99,GCC_X86_64,specified}
> +#-config=STD.emptinit,behavior+={c18,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="See Section \"6.24 Arithmetic on void- and Function-Pointers\" of "GCC_MANUAL"."
> +-config=STD.vptrarth,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.vptrarth,behavior+={c99,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="See Section \"6.1 Statements and Declarations in Expressions\" of "GCC_MANUAL"."
> +-config=STD.stmtexpr,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.stmtexpr,behavior+={c99,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="See Section \"6.19 Structures with No Members\" of "GCC_MANUAL"."
> +-config=STD.emptrecd,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.emptrecd,behavior+={c99,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="See Section \"6.18 Arrays of Length Zero\" of "GCC_MANUAL"."
> +-config=STD.arayzero,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.arayzero,behavior+={c99,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="See Section \"6.8 Conditionals with Omitted Operands\" of "GCC_MANUAL"."
> +-config=STD.bincondl,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.bincondl,behavior+={c99,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="See Section \"6.30 Case Ranges\" of "GCC_MANUAL"."
> +-config=STD.caseuplw,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.caseuplw,behavior+={c99,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="See Section \"6.63 Unnamed Structure and Union Fields\" of "GCC_MANUAL"."
> +-config=STD.anonfild,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.anonfild,behavior+={c99,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="Non-documented GCC extension."
> +-config=STD.emptdecl,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.emptdecl,behavior+={c99,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="Non-documented GCC extension."
> +-config=STD.emptenum,behavior+={c99,GCC_ARM64,specified}
> +-doc_end
> +
> +-doc_begin="Non-documented GCC extension."
> +-config=STD.pteincmp,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.pteincmp,behavior+={c99,GCC_X86_64,specified}
> +#-config=STD.pteincmp,behavior+={c18,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="Non-documented GCC extension."
> +-config=STD.funojptr,behavior+={c99,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="
> +    ext_paste_comma: see Section \"6.21 Macros with a Variable Number of Arguments\" of "GCC_MANUAL".
> +    ext_missing_varargs_arg: see Section \"6.21 Macros with a Variable Number of Arguments\" of "GCC_MANUAL".
> +    ext_named_variadic_macro: see Section \"6.21 Macros with a Variable Number of Arguments\" of "GCC_MANUAL".
> +    ext_return_has_void_expr: see the documentation for -Wreturn-type in Section \"3.8 Options to Request or Suppress Warnings\" of "GCC_MANUAL".
> +    ext_gnu_statement_expr_macro: see Section \"6.1 Statements and Declarations in Expressions\" of "GCC_MANUAL".
> +    ext_sizeof_alignof_void_type: see Section \"6.24 Arithmetic on void- and Function-Pointers\" of "GCC_MANUAL".
> +    ext_forward_ref_enum_def: see Section \"6.49 Incomplete enum Types\" of "GCC_MANUAL".
> +    ext_flexible_array_in_struct: see Section \"6.18 Arrays of Length Zero\" of "GCC_MANUAL".
> +    ext_flexible_array_in_array: see Section \"6.18 Arrays of Length Zero\" of "GCC_MANUAL".
> +    ext_enum_value_not_int: non-documented GCC extension.
> +    ext_gnu_array_range: see Section \"6.29 Designated Initializers\" of "GCC_MANUAL".
> +"
> +-config=STD.diag,behavior+={c99,GCC_ARM64,"^(ext_paste_comma|ext_missing_varargs_arg|ext_named_variadic_macro|ext_return_has_void_expr|ext_gnu_statement_expr_macro|ext_sizeof_alignof_void_type|ext_forward_ref_enum_def|ext_gnu_array_range)$"}
> +-config=STD.diag,behavior+={c99,GCC_X86_64,"^(ext_paste_comma|ext_missing_varargs_arg|ext_named_variadic_macro|ext_return_has_void_expr|ext_gnu_statement_expr_macro|ext_sizeof_alignof_void_type|ext_flexible_array_in_struct|ext_flexible_array_in_array|ext_enum_value_not_int|ext_gnu_array_range)$"}
> +-doc_end
> +
> +-doc_begin="The maximum size of an object is defined in the MAX_SIZE macro, and for a 32 bit architecture is 8MB.
> +    The maximum size for an array is defined in the PTRDIFF_MAX and in a 32 bit architecture is 2^30-1.
> +    See occurrences of these macros in "GCC_MANUAL"."
> +-config=STD.byteobjt,behavior+={c99, GCC_ARM64, 8388608}
> +-config=STD.byteobjt,behavior+={c99, GCC_X86_64, 8388608}
> +-doc_end
> +
> +-doc_begin="See Section \"11.2 Implementation limits\" of "CPP_MANUAL"."
> +-config=STD.charline,behavior+={c99, GCC_ARM64, 5000}
> +-config=STD.charline,behavior+={c99, GCC_X86_64, 12000}
> +-doc_end
> +
> +-doc_begin="See Section \"11.2 Implementation limits\" of "CPP_MANUAL"."
> +-config=STD.inclnest,behavior+={c99, GCC_ARM64, 24}
> +-config=STD.inclnest,behavior+={c99, GCC_X86_64, 32}
> +-doc_end
> +
> +-doc_begin="FIXME: why is C90 used?"
> +-config=STD.ppifnest,behavior+={c90, GCC_X86_64, 32}
> +-doc_end
> +
> +-doc_begin="See Section \"4.12 Statements\" of "GCC_MANUAL"."
> +-config=STD.caselimt,behavior+={c99, GCC_X86_64, 1500}
> +-doc_end
> +
> +-doc_begin="See Section \"6.9 128-bit Integers\" of "GCC_MANUAL"."
> +-config=STD.stdtypes,behavior+={c99, GCC_X86_64, "__uint128_t"}
> +-doc_end
> +
> +-doc_begin="FIXME: Non-documented GCC extension?"
> +-config=STD.charescp,behavior={c99, GCC_X86_64, "^m$"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.9 Structures, Unions, Enumerations, and Bit-Fields\" of "GCC_MANUAL"."
> +-config=STD.bitfldtp, +behavior={c99, GCC_ARM64, "unsigned char;unsigned short;unsigned long;unsigned long long"}
> +-config=STD.bitfldtp, +behavior={c99, GCC_X86_64, "unsigned char;unsigned short;unsigned long;enum"}
> +-doc_end
> +
> +-doc_begin="
> +    #pragma pack: see Section \"6.62.11 Structure-Layout Pragmas\" of "GCC_MANUAL".
> +    #pragma GCC visibility: see Section \"6.62.14 Visibility Pragmas\" of "GCC_MANUAL".
> +"
> +-config=STD.nonstdc,behavior={c99, GCC_ARM64, "^(pack\\(|GCC visibility (push|pop)).*$"}
> +-config=STD.nonstdc,behavior={c99, GCC_X86_64, "^(pack\\(|GCC visibility (push|pop)).*$"}
> +-doc_end
> +
> +-doc_begin="See Section \"1.1 Character sets\" of "CPP_MANUAL".  We assume the locale is not restricting any UTF-8 characters being part of the source character set."
> +-config=STD.charset,behavior={c99, GCC_ARM64, "utf8"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.3 Identifiers\" of "GCC_MANUAL"."
> +-config=STD.extidsig, behavior+={c99, GCC_ARM64, "63"}
> +-config=STD.extidsig, behavior+={c99, GCC_X86_64, "63"}
> +-doc_end
> +
> +#
> +# Documentation for relied-upon implementation-defined behaviors (Dir 1.1)
> +#
> +
> +-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \"8.1 Data types\" of "ARM64_ABI_MANUAL"."
> +-config=STD.bytebits,behavior={c99, GCC_ARM64, "8"}
> +-config=STD.charsobj,behavior={c99, GCC_ARM64, "utf8"}
> +-config=STD.charsval,behavior={c99, GCC_ARM64, "utf8"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
> +-config=STD.bytebits,behavior={c99, GCC_X86_64, "8"}
> +-config=STD.charsobj,behavior={c99, GCC_X86_64, "utf8"}
> +-config=STD.charsval,behavior={c99, GCC_X86_64, "utf8"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and the documentation for -finput-charset=charset in the same manual."
> +-config=STD.charsmap,behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.charsmap,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and the documentation for -fexec-charset=charset and -finput-charset=charset in the same manual."
> +-config=STD.charsmem,behavior={c99, GCC_ARM64, "utf8"}
> +-config=STD.charsmem,behavior={c99, GCC_X86_64, "utf8"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.1 Translation\" of "GCC_MANUAL"."
> +-config=STD.diagidnt,behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.diagidnt,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and the documentation for -fexec-charset=charset in the same manual."
> +-config=STD.execvals,behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.execvals,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="Given that Xen is compiled in hosted mode, ECLAIR cannot exclude the independency from program termination implementation-defined behavior.  See \"Section 25.7 Program Termination\" of "ARM64_LIBC_MANUAL"."
> +-config=STD.exitstat,behavior={c99, GCC_ARM64, "specified"}
> +-doc_end
> +
> +-doc_begin="Given that Xen is compiled in hosted mode, ECLAIR cannot exclude the independency from program termination implementation-defined behavior.  See \"Section 25.7 Program Termination\" of "X86_64_LIBC_MANUAL"."
> +-config=STD.exitstat,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Chapter \"2 Header Files\" of "CPP_MANUAL"."
> +-config=STD.inclangl,behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.inclangl,behavior={c99, GCC_X86_64, "specified"}
> +-config=STD.inclfile,behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.inclfile,behavior={c99, GCC_X86_64, "specified"}
> +-config=STD.inclhead,behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.inclhead,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.5 Integers\" of "GCC_MANUAL"."
> +-config=STD.signdint,behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.signdint,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.15 Architecture\" of "GCC_MANUAL" and Chapter \"5   Data types and alignment\" of "ARM64_ABI_MANUAL"."
> +-config=STD.objbytes,behavior={c99, GCC_ARM64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.15 Architecture\" of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
> +-config=STD.objbytes,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"3.4 Stringizing\" of "CPP_MANUAL"."
> +-config=STD.stringfy,behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.stringfy,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.9 Structures, Unions, Enumerations, and Bit-Fields\"
> + of "GCC_MANUAL" and Section \"8.1.8 Bit-fields\" of "ARM64_ABI_MANUAL"."
> +-config=STD.bitfldby,+behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.bitfldor,+behavior={c99, GCC_ARM64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.9 Structures, Unions, Enumerations, and Bit-Fields\"
> + of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
> +-config=STD.bitfldby,+behavior={c99, GCC_X86_64, "specified"}
> +-config=STD.bitfldor,+behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.10 Qualifiers\" of "GCC_MANUAL"."
> +-config=STD.volatltp,+behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.volatltp,+behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.15 Architecture\" of "GCC_MANUAL" and Chapter \"5   Data types and alignment\" of "ARM64_ABI_MANUAL"."
> +-config=STD.stdmacro,behavior={c99, GCC_ARM64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.15 Architecture\" of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
> +-config=STD.stdmacro,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \"11.1 Implementation-defined behavior\" of "CPP_MANUAL"."
> +-config=STD.widestng,behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.widestng,behavior={c99, GCC_X86_64, "specified"}
> +-config=STD.multbtsl,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.13 Preprocessing Directives\" of "GCC_MANUAL" and Section \"7 Pragmas\" of "CPP_MANUAL"."
> +-config=STD.pragmdir,behavior={c99, GCC_ARM64, "^(pack\\(|GCC visibility (push|pop)).*$"}
> +-config=STD.pragmdir,behavior={c99, GCC_X86_64, "^(pack\\(|GCC visibility (push|pop)).*$"}
> +-doc_end
> +
> +-doc_begin="See Section \"6.9 128-bit Integers\" of "GCC_MANUAL"."
> +-config=STD.extinttp,behavior={c99, GCC_X86_64, "__uint128_t"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.13 Preprocessing Directives\" of "GCC_MANUAL" and Section \"11.1 Implementation-defined behavior\" of "CPP_MANUAL"."
> +-config=STD.inclexpd,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> diff --git a/automation/eclair_analysis/Makefile.prepare b/automation/eclair_analysis/Makefile.prepare
> new file mode 100644
> index 0000000000..90f4a31172
> --- /dev/null
> +++ b/automation/eclair_analysis/Makefile.prepare
> @@ -0,0 +1,6 @@
> +include Makefile
> +prepare:
> +	$(Q)$(MAKE) $(build)=tools
> +	$(Q)$(MAKE) $(build)=. include/xen/compile.h
> +	$(Q)$(MAKE) $(build)=include all
> +	$(Q)$(MAKE) $(build)=arch/$(SRCARCH) include
> diff --git a/automation/eclair_analysis/build.sh b/automation/eclair_analysis/build.sh
> new file mode 100755
> index 0000000000..ec087dd822
> --- /dev/null
> +++ b/automation/eclair_analysis/build.sh
> @@ -0,0 +1,44 @@
> +#!/bin/bash
> +# Stop immediately if any executed command has exit status different from 0.
> +set -e
> +
> +script_name="$(basename "$0")"
> +
> +fatal() {
> +  echo "${script_name}: $*" >&2
> +  exit 1
> +}
> +
> +usage() {
> +  fatal "Usage: ${script_name} <ARM64|X86_64>"
> +}
> +
> +if [ $# -ne 1 ]; then
> +  usage
> +fi
> +
> +if [ "$1" = "X86_64" ]; then
> +  export CROSS_COMPILE=
> +  export XEN_TARGET_ARCH=x86_64
> +elif [ "$1" = "ARM64" ]; then
> +  export CROSS_COMPILE=aarch64-linux-gnu-
> +  export XEN_TARGET_ARCH=arm64
> +else
> +  fatal "Unknown configuration: $1"
> +fi
> +
> +if [[ -f /proc/cpuinfo ]]; then
> +  PROCESSORS=$(grep -c ^processor /proc/cpuinfo)
> +else
> +  PROCESSORS=6
> +fi
> +
> +(
> +  cd xen
> +
> +  make "-j${PROCESSORS}" "-l${PROCESSORS}.0"    \
> +       "CROSS_COMPILE=${CROSS_COMPILE}"         \
> +       "CC=${CROSS_COMPILE}gcc-12"              \
> +       "CXX=${CROSS_COMPILE}g++-12"             \
> +       "XEN_TARGET_ARCH=${XEN_TARGET_ARCH}"
> +)
> diff --git a/automation/eclair_analysis/prepare.sh b/automation/eclair_analysis/prepare.sh
> new file mode 100755
> index 0000000000..275a1a3f51
> --- /dev/null
> +++ b/automation/eclair_analysis/prepare.sh
> @@ -0,0 +1,42 @@
> +#!/bin/bash
> +# Stop immediately if any executed command has exit status different from 0.
> +set -e
> +
> +script_name="$(basename "$0")"
> +script_dir="$(
> +  cd "$(dirname "$0")"
> +  echo "${PWD}"
> +)"
> +
> +fatal() {
> +  echo "${script_name}: $*" >&2
> +  exit 1
> +}
> +
> +usage() {
> +  fatal "Usage: ${script_name}"
> +}
> +
> +if [ $# -ne 1 ]; then
> +  usage
> +  exit 1
> +fi
> +
> +export XEN_TARGET_ARCH
> +
> +if [ "$1" = "X86_64" ]; then
> +  CONFIG_FILE="${script_dir}/xen_x86_config"
> +  XEN_TARGET_ARCH=x86_64
> +elif [ "$1" = "ARM64" ]; then
> +  CONFIG_FILE="${script_dir}/xen_arm_config"
> +  XEN_TARGET_ARCH=arm64
> +else
> +  fatal "Unknown configuration: $1"
> +fi
> +
> +(
> +    cd xen
> +    cp "${CONFIG_FILE}" .config
> +    make clean
> +    make -f ${script_dir}/Makefile.prepare prepare
> +)
> diff --git a/automation/eclair_analysis/xen_arm_config b/automation/eclair_analysis/xen_arm_config
> new file mode 100644
> index 0000000000..82102b889e
> --- /dev/null
> +++ b/automation/eclair_analysis/xen_arm_config
> @@ -0,0 +1,147 @@
> +# File provided in
> +# Re: Xen MISRA C: Source files in scope and out of scope
> +# from:	Stefano Stabellini <stefano.stabellini@amd.com>
> +# date:	6 giu 2023, 02:53
> +
> +#
> +# Automatically generated file; DO NOT EDIT.
> +# Xen/arm 4.18-unstable Configuration
> +#
> +CONFIG_CC_IS_GCC=y
> +CONFIG_GCC_VERSION=90400
> +CONFIG_CLANG_VERSION=0
> +CONFIG_LD_IS_GNU=y
> +CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE=y
> +CONFIG_ARM_64=y
> +CONFIG_ARM=y
> +CONFIG_ARCH_DEFCONFIG="arch/arm/configs/arm64_defconfig"
> +
> +# UBSAN
> +CONFIG_UBSAN=n
> +
> +#
> +# Architecture Features
> +#
> +CONFIG_ARM64_SVE=n
> +CONFIG_64BIT=y
> +CONFIG_NR_CPUS=4
> +# CONFIG_ACPI is not set
> +CONFIG_ARM_EFI=y
> +CONFIG_GICV3=y
> +CONFIG_HAS_ITS=y
> +CONFIG_HVM=y
> +# CONFIG_NEW_VGIC is not set
> +CONFIG_SBSA_VUART_CONSOLE=y
> +CONFIG_ARM_SSBD=y
> +CONFIG_HARDEN_BRANCH_PREDICTOR=y
> +# CONFIG_TEE is not set
> +# CONFIG_STATIC_SHM is not set
> +# end of Architecture Features
> +
> +#
> +# ARM errata workaround via the alternative framework
> +#
> +CONFIG_ARM64_ERRATUM_827319=y
> +CONFIG_ARM64_ERRATUM_824069=y
> +CONFIG_ARM64_ERRATUM_819472=y
> +CONFIG_ARM64_ERRATUM_843419=y
> +CONFIG_ARM64_ERRATUM_832075=y
> +CONFIG_ARM64_ERRATUM_834220=y
> +CONFIG_ARM_ERRATUM_858921=y
> +CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y
> +CONFIG_ARM64_ERRATUM_1286807=y
> +# end of ARM errata workaround via the alternative framework
> +
> +CONFIG_ARM64_HARDEN_BRANCH_PREDICTOR=y
> +# CONFIG_ALL_PLAT is not set
> +# CONFIG_QEMU is not set
> +# CONFIG_RCAR3 is not set
> +CONFIG_MPSOC=y
> +# CONFIG_NO_PLAT is not set
> +CONFIG_MPSOC_PLATFORM=y
> +
> +#
> +# Common Features
> +#
> +CONFIG_GRANT_TABLE=y
> +CONFIG_HAS_ALTERNATIVE=y
> +CONFIG_HAS_DEVICE_TREE=y
> +CONFIG_HAS_FAST_MULTIPLY=y
> +CONFIG_HAS_PDX=y
> +CONFIG_HAS_PMAP=y
> +# CONFIG_MEM_ACCESS is not set
> +CONFIG_STATIC_MEMORY=y
> +
> +#
> +# Speculative hardening
> +#
> +CONFIG_SPECULATIVE_HARDEN_ARRAY=y
> +# end of Speculative hardening
> +
> +# CONFIG_HYPFS is not set
> +CONFIG_IOREQ_SERVER=y
> +# CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP is not set
> +# CONFIG_XSM is not set
> +# CONFIG_ARGO is not set
> +
> +#
> +# Schedulers
> +#
> +# CONFIG_SCHED_CREDIT is not set
> +CONFIG_SCHED_CREDIT2=y
> +# CONFIG_SCHED_RTDS is not set
> +# CONFIG_SCHED_ARINC653 is not set
> +CONFIG_SCHED_NULL=y
> +CONFIG_SCHED_CREDIT2_DEFAULT=y
> +# CONFIG_SCHED_NULL_DEFAULT is not set
> +CONFIG_SCHED_DEFAULT="credit2"
> +# end of Schedulers
> +
> +CONFIG_BOOT_TIME_CPUPOOLS=y
> +# CONFIG_LIVEPATCH is not set
> +# CONFIG_ENFORCE_UNIQUE_SYMBOLS is not set
> +CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS=y
> +CONFIG_CMDLINE=""
> +CONFIG_DOM0_MEM=""
> +CONFIG_DTB_FILE=""
> +# CONFIG_TRACEBUFFER is not set
> +# end of Common Features
> +
> +#
> +# Device Drivers
> +#
> +# CONFIG_HAS_NS16550 is not set
> +CONFIG_HAS_CADENCE_UART=y
> +# CONFIG_HAS_IMX_LPUART is not set
> +# CONFIG_HAS_MVEBU is not set
> +# CONFIG_HAS_MESON is not set
> +CONFIG_HAS_PL011=y
> +# CONFIG_HAS_SCIF is not set
> +CONFIG_SERIAL_TX_BUFSIZE=16384
> +CONFIG_HAS_PASSTHROUGH=y
> +CONFIG_ARM_SMMU=y
> +CONFIG_ARM_SMMU_V3=y
> +# CONFIG_IPMMU_VMSA is not set
> +CONFIG_IOMMU_FORCE_PT_SHARE=y
> +# end of Device Drivers
> +
> +CONFIG_EXPERT=y
> +CONFIG_UNSUPPORTED=y
> +
> +#
> +# Debugging Options
> +#
> +CONFIG_DEBUG=y
> +CONFIG_FRAME_POINTER=y
> +CONFIG_COVERAGE=y
> +CONFIG_DEBUG_LOCK_PROFILE=y
> +CONFIG_DEBUG_LOCKS=y
> +CONFIG_PERF_COUNTERS=y
> +CONFIG_PERF_ARRAYS=y
> +CONFIG_VERBOSE_DEBUG=y
> +CONFIG_DEVICE_TREE_DEBUG=y
> +CONFIG_SCRUB_DEBUG=y
> +CONFIG_DEBUG_TRACE=y
> +CONFIG_XMEM_POOL_POISON=y
> +CONFIG_DEBUG_INFO=y
> +# end of Debugging Options
> diff --git a/automation/eclair_analysis/xen_x86_config b/automation/eclair_analysis/xen_x86_config
> new file mode 100644
> index 0000000000..9b2709bfc8
> --- /dev/null
> +++ b/automation/eclair_analysis/xen_x86_config
> @@ -0,0 +1,152 @@
> +# File provided in
> +# Re: Xen MISRA C: Source files in scope and out of scope
> +# from:	Stefano Stabellini <stefano.stabellini@amd.com> 
> +# date:	6 giu 2023, 02:53
> +
> +#
> +# Automatically generated file; DO NOT EDIT.
> +# Xen/x86 4.18-unstable Configuration
> +#
> +CONFIG_CC_IS_GCC=y
> +CONFIG_GCC_VERSION=90400
> +CONFIG_CLANG_VERSION=0
> +CONFIG_LD_IS_GNU=y
> +CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE=y
> +CONFIG_X86_64=y
> +CONFIG_X86=y
> +CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
> +CONFIG_CC_HAS_INDIRECT_THUNK=y
> +CONFIG_HAS_AS_CET_SS=y
> +CONFIG_HAS_CC_CET_IBT=y
> +
> +CONFIG_REQUIRE_NX=n
> +
> +#
> +# Architecture Features
> +#
> +CONFIG_64BIT=y
> +CONFIG_NR_CPUS=16
> +CONFIG_NR_NUMA_NODES=2
> +# CONFIG_PV is not set
> +CONFIG_HVM=y
> +# CONFIG_XEN_SHSTK is not set
> +# CONFIG_XEN_IBT is not set
> +# CONFIG_SHADOW_PAGING is not set
> +# CONFIG_BIGMEM is not set
> +# CONFIG_HVM_FEP is not set
> +# CONFIG_TBOOT is not set
> +CONFIG_XEN_ALIGN_DEFAULT=y
> +# CONFIG_XEN_ALIGN_2M is not set
> +CONFIG_X2APIC_PHYSICAL=y
> +# CONFIG_XEN_GUEST is not set
> +# CONFIG_HYPERV_GUEST is not set
> +# CONFIG_MEM_PAGING is not set
> +# CONFIG_MEM_SHARING is not set
> +# end of Architecture Features
> +
> +#
> +# Common Features
> +#
> +CONFIG_COMPAT=y
> +CONFIG_CORE_PARKING=y
> +CONFIG_GRANT_TABLE=y
> +CONFIG_ALTERNATIVE_CALL=y
> +CONFIG_ARCH_MAP_DOMAIN_PAGE=y
> +CONFIG_GENERIC_BUG_FRAME=y
> +CONFIG_HAS_ALTERNATIVE=y
> +CONFIG_HAS_COMPAT=y
> +CONFIG_HAS_EX_TABLE=y
> +CONFIG_HAS_FAST_MULTIPLY=y
> +CONFIG_HAS_IOPORTS=y
> +CONFIG_HAS_KEXEC=y
> +CONFIG_HAS_PDX=y
> +CONFIG_HAS_SCHED_GRANULARITY=y
> +CONFIG_HAS_UBSAN=y
> +CONFIG_MEM_ACCESS_ALWAYS_ON=y
> +CONFIG_MEM_ACCESS=y
> +CONFIG_NEEDS_LIBELF=y
> +CONFIG_NUMA=y
> +
> +#
> +# Speculative hardening
> +#
> +CONFIG_INDIRECT_THUNK=y
> +CONFIG_SPECULATIVE_HARDEN_ARRAY=y
> +CONFIG_SPECULATIVE_HARDEN_BRANCH=y
> +# end of Speculative hardening
> +
> +# CONFIG_HYPFS is not set
> +CONFIG_IOREQ_SERVER=y
> +# CONFIG_KEXEC is not set
> +# CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP is not set
> +# CONFIG_XENOPROF is not set
> +# CONFIG_XSM is not set
> +# CONFIG_ARGO is not set
> +
> +#
> +# Schedulers
> +#
> +# CONFIG_SCHED_CREDIT is not set
> +CONFIG_SCHED_CREDIT2=y
> +# CONFIG_SCHED_RTDS is not set
> +# CONFIG_SCHED_ARINC653 is not set
> +CONFIG_SCHED_NULL=y
> +CONFIG_SCHED_CREDIT2_DEFAULT=y
> +# CONFIG_SCHED_NULL_DEFAULT is not set
> +CONFIG_SCHED_DEFAULT="credit2"
> +# end of Schedulers
> +
> +# CONFIG_LIVEPATCH is not set
> +# CONFIG_ENFORCE_UNIQUE_SYMBOLS is not set
> +# CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS is not set
> +CONFIG_CMDLINE=""
> +CONFIG_DOM0_MEM=""
> +# CONFIG_TRACEBUFFER is not set
> +# end of Common Features
> +
> +#
> +# Device Drivers
> +#
> +CONFIG_ACPI=y
> +CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y
> +CONFIG_ACPI_NUMA=y
> +CONFIG_HAS_NS16550=y
> +CONFIG_HAS_EHCI=y
> +CONFIG_SERIAL_TX_BUFSIZE=16384
> +# CONFIG_XHCI is not set
> +CONFIG_HAS_CPUFREQ=y
> +CONFIG_HAS_PASSTHROUGH=y
> +CONFIG_AMD_IOMMU=y
> +# CONFIG_INTEL_IOMMU is not set
> +# CONFIG_IOMMU_QUARANTINE_NONE is not set
> +CONFIG_IOMMU_QUARANTINE_BASIC=y
> +# CONFIG_IOMMU_QUARANTINE_SCRATCH_PAGE is not set
> +CONFIG_HAS_PCI=y
> +CONFIG_HAS_PCI_MSI=y
> +CONFIG_VIDEO=y
> +CONFIG_VGA=y
> +CONFIG_HAS_VPCI=y
> +# end of Device Drivers
> +
> +CONFIG_EXPERT=y
> +CONFIG_UNSUPPORTED=y
> +CONFIG_ARCH_SUPPORTS_INT128=y
> +
> +#
> +# Debugging Options
> +#
> +CONFIG_DEBUG=y
> +# CONFIG_CRASH_DEBUG is not set
> +CONFIG_GDBSX=y
> +CONFIG_FRAME_POINTER=y
> +# CONFIG_COVERAGE is not set
> +# CONFIG_DEBUG_LOCK_PROFILE is not set
> +CONFIG_DEBUG_LOCKS=y
> +# CONFIG_PERF_COUNTERS is not set
> +CONFIG_VERBOSE_DEBUG=y
> +CONFIG_SCRUB_DEBUG=y
> +# CONFIG_UBSAN is not set
> +# CONFIG_DEBUG_TRACE is not set
> +CONFIG_XMEM_POOL_POISON=y
> +CONFIG_DEBUG_INFO=y
> +# end of Debugging Options
> diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
> new file mode 100644
> index 0000000000..9ce2a287fb
> --- /dev/null
> +++ b/automation/gitlab-ci/analyze.yaml
> @@ -0,0 +1,37 @@
> +.eclair-analysis:
> +  stage: analyze
> +  tags:
> +    - eclair-analysis
> +  variables:
> +    ECLAIR_OUTPUT_DIR: "ECLAIR_out"
> +    ANALYSIS_KIND: "normal"
> +    ENABLE_ECLAIR_BOT: "n"
> +    AUTO_PR_BRANCH: "staging"
> +    AUTO_PR_REPOSITORY: "xen-project/xen"
> +  artifacts:
> +    when: always
> +    paths:
> +      - "${ECLAIR_OUTPUT_DIR}"
> +      - '*.log'
> +    reports:
> +      codequality: gl-code-quality-report.json
> +
> +eclair-x86_64:
> +  extends: .eclair-analysis
> +  variables:
> +    LOGFILE: "eclair-x86_64.log"
> +    VARIANT: "X86_64"
> +    RULESET: "Set1"
> +  script:
> +    - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
> +  allow_failure: true
> +
> +eclair-ARM64:
> +  extends: .eclair-analysis
> +  variables:
> +    LOGFILE: "eclair-ARM64.log"
> +    VARIANT: "ARM64"
> +    RULESET: "Set1"
> +  script:
> +    - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
> +  allow_failure: true
> diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
> index c401f62d61..f01e2c32bb 100644
> --- a/automation/gitlab-ci/build.yaml
> +++ b/automation/gitlab-ci/build.yaml
> @@ -11,6 +11,7 @@
>        - '*.log'
>        - '*/*.log'
>      when: always
> +  needs: []
>    except:
>      - master
>      - smoke
> diff --git a/automation/scripts/eclair b/automation/scripts/eclair
> new file mode 100755
> index 0000000000..c4a3bb57d7
> --- /dev/null
> +++ b/automation/scripts/eclair
> @@ -0,0 +1,32 @@
> +#!/bin/sh -eu
> +
> +ECLAIR_ANALYSIS_DIR=automation/eclair_analysis
> +ECLAIR_DIR="${ECLAIR_ANALYSIS_DIR}/ECLAIR"
> +ECLAIR_OUTPUT_DIR=$(realpath "${ECLAIR_OUTPUT_DIR}")
> +
> +"${ECLAIR_ANALYSIS_DIR}/prepare.sh" "${VARIANT}"
> +
> +ex=0
> +"${ECLAIR_DIR}/analyze.sh" "${VARIANT}" "${RULESET}" || ex=$?
> +"${ECLAIR_DIR}/action_log.sh" ANALYSIS_LOG \
> +                             "ECLAIR analysis log" \
> +                             "${ECLAIR_OUTPUT_DIR}/ANALYSIS.log" \
> +                             "${ex}"
> +"${ECLAIR_DIR}/action_log.sh" REPORT_LOG \
> +                             "ECLAIR report log" \
> +                             "${ECLAIR_OUTPUT_DIR}/REPORT.log" \
> +                             "${ex}"
> +[ "${ex}" = 0 ] || exit "${ex}"
> +"${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
> +
> +# Fail in case of new reports
> +"${ECLAIR_DIR}/action_clean_added.sh" "${ECLAIR_OUTPUT_DIR}" || ex=$?
> +"${ECLAIR_DIR}/action_log.sh" DIFF_CHECK_LOG \
> +                             "ECLAIR diff check" \
> +                             "${ECLAIR_OUTPUT_DIR}/clean_added.log" \
> +                             "${ex}"
> +
> +rm -rf "${ECLAIR_OUTPUT_DIR}/.data"
> +rm -rf "${ECLAIR_OUTPUT_DIR}/PROJECT.ecd"
> +
> +[ "${ex}" = 0 ] || exit "${ex}"
> -- 
> 2.34.1
> 
--8323329-1672649101-1690242549=:3118466--


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 01:27:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 01:27:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569314.889719 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO6pP-0005Tb-GV; Tue, 25 Jul 2023 01:27:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569314.889719; Tue, 25 Jul 2023 01:27:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO6pP-0005TU-De; Tue, 25 Jul 2023 01:27:07 +0000
Received: by outflank-mailman (input) for mailman id 569314;
 Tue, 25 Jul 2023 01:27:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pBYh=DL=arm.com=Henry.Wang@srs-se1.protection.inumbo.net>)
 id 1qO6pO-0005T5-N3
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 01:27:06 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2080.outbound.protection.outlook.com [40.107.7.80])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5c61f2ec-2a8a-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 03:27:04 +0200 (CEST)
Received: from AS8PR08MB7991.eurprd08.prod.outlook.com (2603:10a6:20b:570::15)
 by DBAPR08MB5686.eurprd08.prod.outlook.com (2603:10a6:10:1a1::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Tue, 25 Jul
 2023 01:26:34 +0000
Received: from AS8PR08MB7991.eurprd08.prod.outlook.com
 ([fe80::7083:22dc:6b5f:5965]) by AS8PR08MB7991.eurprd08.prod.outlook.com
 ([fe80::7083:22dc:6b5f:5965%7]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 01:26:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5c61f2ec-2a8a-11ee-b23c-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=YrDipqVjMu0wp29bb5LwNtZkGlX0/7U+kPl41Dk/HWVgx9bgiaMqsrGeEGqapxzS7wd230YolTSQwl9/PKBgEJYYPMvwh+EX177kYCyPM+Pr7xe+VFXiBKITI3E6XAN9if+0KWzoiBAYD95cbpg9zCPcAFxJvOg9uS0EWxtYdy8lcZptoWNItkBmEF/9NWPTfvzc6D1YWC5nAqY9/qqdTkw5cZfWXjkz3y+J5jFtlY2+/nlk+vslZKy5nRdh8dI0b84i859rC6n4uDdZrOpNFSioSD0n4LdtYBojtgWDldGISiZ6mwn4Jr+Y/JO7gAGujJnidQX2HhCiv2cMyAPhwA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=2aP1OG4ctH9AeuM3fwW0JA76HBgCouhtT64QRlakYqo=;
 b=ROIu1no5mxWD1bwr3AoheERshH2gc/ZhpiIgSi/bI3qbDuz6Q/XOzUIicxCfVfF3aIAsXS/GcyqYb+awhzGpNszx7NjXW9TGCHvqDCsO1IoE4gzXEm9dDblk6H9N+aQLn9FexeENP1xVy3DYd16iarHWC+c5b6QwuCEVQpi8K4zYhK7T5cqsEKPPTOqO3QzniWrueM0ZqoZdSF8Y8flyuT8TXFNrT73mUsU+2F8hg5rHG8JbTxxCkKP7CQ/g47M2lZEx6PMiziFekSG4NmRdrbyCwsPkUfCuChp5qEqVa1DBxLtwSwdo682eyEJY/+HZHXuUwgzetTALklg+McmELw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=2aP1OG4ctH9AeuM3fwW0JA76HBgCouhtT64QRlakYqo=;
 b=kIXDDZ0iLBGjkGlNlxgupbGR8Qqhtz9eOrBRzr/f7ij+ne0/iyJeU+6OTOKHqWpr2BufEz2cRB97NGSC+6GOIsCuD/c4npTHgW6HaMeaQJV8UbOL4oDxouFzmwDn6nChaMHJTrYOirPk0Hype/4ZLaucKSqKw4F3gvz3Ozc2xjM=
From: Henry Wang <Henry.Wang@arm.com>
To: Federico Serafini <federico.serafini@bugseng.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: "consulting@bugseng.com" <consulting@bugseng.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>
Subject: RE: [XEN PATCH v2] device_tree: address violations of MISRA C:2012
 Rules 8.2 and 8.3
Thread-Topic: [XEN PATCH v2] device_tree: address violations of MISRA C:2012
 Rules 8.2 and 8.3
Thread-Index: AQHZvgqIKEgaqsoxpkKjuK/J/mFe36/Jsdfg
Date: Tue, 25 Jul 2023 01:26:33 +0000
Message-ID:
 <AS8PR08MB79919B7BE07C1594BE8012689203A@AS8PR08MB7991.eurprd08.prod.outlook.com>
References:
 <502a92e9b53960a6b78fabb48d354cbb5bc1750c.1690187572.git.federico.serafini@bugseng.com>
In-Reply-To:
 <502a92e9b53960a6b78fabb48d354cbb5bc1750c.1690187572.git.federico.serafini@bugseng.com>
Accept-Language: zh-CN, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ts-tracking-id: B4254949AD2AF1469FC87F1E64718D2E.0
x-checkrecipientchecked: true
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AS8PR08MB7991:EE_|DBAPR08MB5686:EE_
x-ms-office365-filtering-correlation-id: d84ea2cb-51d8-4313-5e28-08db8cae2e4e
nodisclaimer: true
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info:
 zBKCR3QUeGk7pDTMod1CxvDlmOAwioHliwoNzxPY0163D60Mm1iPnOusNVsm7V5ZMQAYPdRrXI4qt+peDG1BpeHseJUKp9GsotJJkfLdX3gva7zuO/PhCmDL3L5khij61A0zn5Uy2haqWWSzTTyctAULpLcF2jH1Jf2kJfVGA7BFR5j1KDmsAPS3SAAgNy1/JppyWVuu/7r3iHda1Ev9dc/c4hnI7Ks9UBLogfA52Dv1GYqEens/NOzkxhyvaBTpoHv+r6yPwE4KlIXjvX4bxndepBKylIxyHgl/Qpa0VExe9VRZcnT5lq5AYibyxIJBDq5D2wjCEnHmUyDJgZPsnjLRG4//Ctt9NDboGQjyYknQbRYhRuAcJyWUYYjtQ7Ng7pJjZ99ADVcDIJJGrYwkidLV60qtch/pBIC9CpM0l7nx3GdiJJkZDtAmudCW44H2NjdHOFd9eC39tjSvEZIv8p7DTeLJyZVdynOyJjWEKbQeO2yusfN78SD6thF1FFAbKAuEq2WvjKfOtEMuzS4O77NDFGmIJZ+ZvkpdLApHBD2kfnk0ZOj6vJtgs9vW2m/tYl3LX6hInbADh4it7ADVv9V7ih5TdvQokULdhpRq6lpxpdujgdc24DjOzrXUC2zt
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB7991.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(346002)(136003)(376002)(366004)(451199021)(86362001)(38070700005)(478600001)(66556008)(64756008)(66946007)(66476007)(66446008)(4326008)(2906002)(55016003)(7696005)(41300700001)(9686003)(316002)(76116006)(8936002)(8676002)(26005)(6506007)(71200400001)(110136005)(54906003)(5660300002)(186003)(53546011)(33656002)(52536014)(38100700002)(122000001)(83380400001)(4744005);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?r+XZVWeBXgRYPvCohN8JjxsPhnyjixrSXpdvTsM2g+PAIw72lqL6+QRSalRp?=
 =?us-ascii?Q?QpgDVtPahN3Irs4Q+OeM5bf63OIl0r5fSCFj5ckY5mnqV0H6RwJ7YMnvGs0B?=
 =?us-ascii?Q?MkcTUUtMLbKKn0LPoH4eW11v7e6B3imhvFEDcAiW8XbpljfDCyE0GnjMg6WP?=
 =?us-ascii?Q?FxyS6E1id+p+90+tEp51KS7O12N+sYPwg+PP2wUP3G/8cHGhbNAQScPQiylV?=
 =?us-ascii?Q?UF0nvVhP595MC4IGyDwfxkYKXcqQn+bdCPaRfkzXEpmLAKqLNdk04kF+XMx5?=
 =?us-ascii?Q?fUr/XPhQFGmgBa35m8VYK20Py7eyKS85shB1atDpbk/xbLY7zTdq2nCP1fNF?=
 =?us-ascii?Q?X7QrLrlNOlzllrC2qpdYhz+utYoKZa1QaBUVSJoQw7LQed3oXhudqJZJ8b8g?=
 =?us-ascii?Q?SJqDkEZMmsVYOYjWa/MRsgfIaUToCDN8hu5cQdiBTX/iKmnXI8lBXAB2Xqel?=
 =?us-ascii?Q?WNpXuSnhOtxFBb5C/WIoraZnbyyD5cnJUev723K5YKZsdJLPlpFHFyyDfrjP?=
 =?us-ascii?Q?0/6s0mcsOQ5DJ8e0mZHu4QE8ZD5c3YV6wlR0Uu91/8w8NoKcSPR73KFz/PqT?=
 =?us-ascii?Q?YpS8BHG9F9coNmUiTJewtRsXVDr6VhL3Vbc0IrRClQ9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ZY+B4tEig?=
 =?us-ascii?Q?YI4IcFD4bBDLtsHvBsxTm/Pu/esdLCN4HWGWAHVK8/azG078WQhWNY5+jSax?=
 =?us-ascii?Q?0vmJNR9xx5os7vVDZo+G83qxotWZKW/ASIEg6wXM?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AS8PR08MB7991.eurprd08.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d84ea2cb-51d8-4313-5e28-08db8cae2e4e
X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jul 2023 01:26:33.1650
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: a/Ecgl3D1k2oNiXMcfmFbMzFww/qj1XS+aWAdcGCR1yIqxz5AxExEKgAzT5X8FPIEPwKuFBeGy3sRujqv1AUww==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5686

Hi Federico,

> -----Original Message-----
> From: Xen-devel <xen-devel-bounces@lists.xenproject.org> On Behalf Of
> Federico Serafini
> Sent: Monday, July 24, 2023 4:40 PM
> To: xen-devel@lists.xenproject.org
> Cc: consulting@bugseng.com; Federico Serafini
> <federico.serafini@bugseng.com>; Stefano Stabellini
> <sstabellini@kernel.org>; Julien Grall <julien@xen.org>
> Subject: [XEN PATCH v2] device_tree: address violations of MISRA C:2012
> Rules 8.2 and 8.3
>=20
> Give a name to unnamed parameters thus addressing violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names and types used in function
> declarations and the ones used in the corresponding function
> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
> ("All declarations of an object or function shall use the same names
> and type qualifiers").
>=20
> No functional changes.
>=20
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Henry Wang <Henry.Wang@arm.com>

Kind regards,
Henry


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 01:30:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 01:30:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569318.889729 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO6sx-0006uc-0P; Tue, 25 Jul 2023 01:30:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569318.889729; Tue, 25 Jul 2023 01:30:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO6sw-0006uV-TN; Tue, 25 Jul 2023 01:30:46 +0000
Received: by outflank-mailman (input) for mailman id 569318;
 Tue, 25 Jul 2023 01:30:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pBYh=DL=arm.com=Henry.Wang@srs-se1.protection.inumbo.net>)
 id 1qO6sv-0006uN-C3
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 01:30:45 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2040.outbound.protection.outlook.com [40.107.7.40])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id df61705e-2a8a-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 03:30:44 +0200 (CEST)
Received: from AS8PR08MB7991.eurprd08.prod.outlook.com (2603:10a6:20b:570::15)
 by DBAPR08MB5686.eurprd08.prod.outlook.com (2603:10a6:10:1a1::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Tue, 25 Jul
 2023 01:30:14 +0000
Received: from AS8PR08MB7991.eurprd08.prod.outlook.com
 ([fe80::7083:22dc:6b5f:5965]) by AS8PR08MB7991.eurprd08.prod.outlook.com
 ([fe80::7083:22dc:6b5f:5965%7]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 01:30:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: df61705e-2a8a-11ee-b23c-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JV9mIbVS14dDB0XhxEw92+N+/CQzxXUzforYRsXJexN0im89/5mF5U8K6J6PM8cEfZm/c+D+oFkXPTwDIv8TskabO2lVowK9tEZEkgzYSPkR9Qu2IIsICQ3kMlIPFWEmAxJeoLPGsEOhNOwbeA65yiAS18QNJFOtQfQsjren834udlJg5vLYkfoUm3nLCEgmapWiKymy5+aZwn/yWcWb9LvBrNzxC1vqkI2NkC9h/BuFyn6G0yAm9sTHDvbyYka5psNcoYRFkYr0ii4pk4JlYlh6dT+pcxLz6Wd0w6LTVpMa0tz1JX/x5YcT6gH/yq0wOa+m1A2aRBMxiVynUtWoMg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=R6+43YiA7NSSOO1kPlP466bX5vcdFAxXzpiBNrwtWx4=;
 b=QQkeE1+iVQzUPWA77VdWOCZoL4YhXvP7kfph+OUjjpQkDHV7/hJ2WxrqmDXk6nuytPEtQhhVnYLUff6LoR5UmMJ21PV5t9e8mYLS+/5A8xV/6ZHTDxrC8mDOXnlJBGEqYrBSYrWBGSG9MdGYdlMrPMrZmRqvGOs80xIW3+UiiTUN6AnLJp/AZWgWqHI0HCE4QAQ3k70UbVKIRNL6CF7eUiddXqXcyggy3Aj034inYpy0jl+c/0kc5OniLCnSaESPVKQH1tEU7B4f1kw/C0AJJn7wamireK2jbjJvrivf6J0EjJR1d7tNv7Y3StmcI2LZ+gqGzOrubhs4DoOsQiulpA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=R6+43YiA7NSSOO1kPlP466bX5vcdFAxXzpiBNrwtWx4=;
 b=oYRqgJ4XM00wGN+XnY6hXDTaUnU7wj4/2RK+1hkvMNPjOf+WlLe7aUyoVpVkGGxd2zETTs12w/QYqunVxZ/8c9DBmAvf1QbjUM0HaPArQa4QV5zycijDmW3j8jdDScrLsNFKVGtmrLSfacMa4idVIzJh+bSc5bxDxfvCzuYfUxQ=
From: Henry Wang <Henry.Wang@arm.com>
To: Julien Grall <julien@xen.org>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
CC: Luca Fancellu <Luca.Fancellu@arm.com>, "michal.orzel@amd.com"
	<michal.orzel@amd.com>, Julien Grall <jgrall@amazon.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Bertrand Marquis <Bertrand.Marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: RE: [PATCH v2] xen/arm32: head: Widen the use of the temporary
 mapping
Thread-Topic: [PATCH v2] xen/arm32: head: Widen the use of the temporary
 mapping
Thread-Index: AQHZvhfA/4kdXKXKFU+aFkgCYJxPNK/JsRLg
Date: Tue, 25 Jul 2023 01:30:13 +0000
Message-ID:
 <AS8PR08MB799137E28B7345725FCF724F9203A@AS8PR08MB7991.eurprd08.prod.outlook.com>
References: <20230724101458.79412-1-julien@xen.org>
In-Reply-To: <20230724101458.79412-1-julien@xen.org>
Accept-Language: zh-CN, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ts-tracking-id: CCE200FA451D0049BDC650FC333FDE6F.0
x-checkrecipientchecked: true
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AS8PR08MB7991:EE_|DBAPR08MB5686:EE_
x-ms-office365-filtering-correlation-id: 35476500-52dc-4bd3-aadc-08db8caeb1b5
nodisclaimer: true
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info:
 C+x2dCCd3CeY+xHXZ2prhyY6FRDhBYGW98BrGNLwY1wyavjjex453FGei9ALph3ft2TVpYkQDzGECobEGdwvTplK6bgasT//HPnKGsibyCJRP8VPQPcIZUI1F0iZ+HD5lU2EUK8k3lZ+vPjDyJFCwawoW9oLb3ifO9JIl7wWwPA4aitw/4y/ap1gzZ7PKjAZNn8eejxtAF2hnl+USHTslNHRwgauL//JNsk/xXliYFUxJnoENRtmrP2c1D03y2n02IHY8emBRnHWvDfdF6GVGftzfBrerGuiRKqXF1FRpvc6K+pvExgRVNjYmQEMbfi77BCSXSRW98iM+URbIvVdB2k74xKKkMUG4Cfm2lxutjTuS+g+D9ogeeewN9i5+xL6yNhQvCgGoaJYYYxeqq10+k+KSevJXcNQiS2ObfqQZ0eiOX0gbhAwufVRlczng/ZCObPPHMeC0XSe/mTd9Sr4zneRxuYnFlyDRLqRQ/NWZgrHpfQYYx5li5hTzaXpOG8OGEpprU7iDNgHiXMRgEEQIJZyCyJC9Z2VYGPvDgBbUqW6iQxXy8zOUKT9kEQNaE4we7BLnUszOiIosCw+sqXLjCzAleqKjOFdbzZvDznifSasAMnJDr6G3SQy9MrfdDOJ
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB7991.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(346002)(136003)(376002)(366004)(451199021)(86362001)(38070700005)(478600001)(66556008)(64756008)(66946007)(66476007)(66446008)(4326008)(2906002)(55016003)(7696005)(41300700001)(9686003)(316002)(76116006)(8936002)(8676002)(26005)(6506007)(71200400001)(110136005)(54906003)(5660300002)(186003)(33656002)(52536014)(38100700002)(122000001)(83380400001)(4744005);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?jGiQXxt6C93OKfLsYdmLu83CBYzgB+zfEybz5UyG6rUejoshBxs6PEFu9D94?=
 =?us-ascii?Q?M1ij8JCrU+/Vfxsr9jYBUJpOmYZwZMExPqMoFzgsG94SPcdZ6mI7G1THGx7Z?=
 =?us-ascii?Q?SujWhENQsn36SyTVZmJurGS7CQ+ipAULXt/CePrm/n8E7euCbqwUr+/Wjyra?=
 =?us-ascii?Q?FmKi/TVJxhFeyaVSCOmOJRzFvZx6Mx4pNrTnLzFy6eWPpFvhLe+Zy8sa2Y8x?=
 =?us-ascii?Q?vFaYI5BBNug4OgyjhSKCssvyw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hZLz5yvAfm3r+DFdy5ZQo6DqKg?=
 =?us-ascii?Q?IypOfrH+OIySnivzlB2Tv8NPOuuMdWIpeQbOju1pKhj+CCTelEiFFQ1NtB6o?=
 =?us-ascii?Q?inwGsWCEVKontQFLy0ZN4V/ccTLmPIHwB9/jLS+DOsmw4yPSGJNQmknGTPMd?=
 =?us-ascii?Q?T7pRUSsotJ1BXaVYxKR9OAAsTEcHsxo1wrkexgcXz97zeNuZMaXXJDK04BYt?=
 =?us-ascii?Q?67nBcBavT7+1HuIQ2B5wFkOopjqsd4smTnZv/NISVRH9JRoLHfQE2/il9AYU?=
 =?us-ascii?Q?wirkwStI9oo6mWHEXAYHyJm/hqQ0JVZSSdRjdEZZqa80HI04UyMIwbP6pTao?=
 =?us-ascii?Q?jSA9u3L4uh2H/LTFWHbNGGVELwQR4PtJ1iRcygkU6giHGCph2/H9kqOOyLDs?=
 =?us-ascii?Q?RQgD6KSSc5ympU1m81UMZ+pQiPImuUtn6go39QeXNSq/33ZT7Fdr9g7R60J2?=
 =?us-ascii?Q?dQe9KD2j3Xggy62pZSilcmEiiSWxGizDeZvtSWhw?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AS8PR08MB7991.eurprd08.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 35476500-52dc-4bd3-aadc-08db8caeb1b5
X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jul 2023 01:30:13.6549
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: f30QoasN9J9CFnLUdU6DHQcfRJzXpulzwo6CL9ZvErh5xC6nugkN3emvAUwmxvy2XptMYTxRw0ctcgPPrMXm0w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5686

Hi Julien,

> -----Original Message-----
> Subject: [PATCH v2] xen/arm32: head: Widen the use of the temporary
> mapping
>=20
> From: Julien Grall <jgrall@amazon.com>
>=20
> At the moment, the temporary mapping is only used when the virtual
> runtime region of Xen is clashing with the physical region.
>=20
> In follow-up patches, we will rework how secondary CPU bring-up works
> and it will be convenient to use the fixmap area for accessing
> the root page-table (it is per-cpu).
>=20
> Rework the code to use temporary mapping when the Xen physical address
> is not overlapping with the temporary mapping.
>=20
> This also has the advantage to simplify the logic to identity map
> Xen.
>=20
> Signed-off-by: Julien Grall <jgrall@amazon.com>

Reviewed-by: Henry Wang <Henry.Wang@arm.com>

Kind regards,
Henry


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 02:59:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 02:59:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569336.889740 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO8G9-0007DZ-51; Tue, 25 Jul 2023 02:58:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569336.889740; Tue, 25 Jul 2023 02:58:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO8G8-0007DD-Vo; Tue, 25 Jul 2023 02:58:48 +0000
Received: by outflank-mailman (input) for mailman id 569336;
 Tue, 25 Jul 2023 02:58:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pBYh=DL=arm.com=Henry.Wang@srs-se1.protection.inumbo.net>)
 id 1qO8G7-0007D7-Nx
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 02:58:47 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2050.outbound.protection.outlook.com [40.107.7.50])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2b7e2876-2a97-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 04:58:45 +0200 (CEST)
Received: from AS8PR08MB7991.eurprd08.prod.outlook.com (2603:10a6:20b:570::15)
 by AM7PR08MB5493.eurprd08.prod.outlook.com (2603:10a6:20b:102::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Tue, 25 Jul
 2023 02:58:15 +0000
Received: from AS8PR08MB7991.eurprd08.prod.outlook.com
 ([fe80::7083:22dc:6b5f:5965]) by AS8PR08MB7991.eurprd08.prod.outlook.com
 ([fe80::7083:22dc:6b5f:5965%7]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 02:58:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2b7e2876-2a97-11ee-b23c-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=F1IVtNqy1YEtqFEgPN8ge18GXe/KDjP7Xx3PZiTsDQ9J+mSLdJb6sv+rH8ZUI7yOQ1u3m2cHUEHnZPSbEHADjqxomsALzVfM+U4etKYM4FFDRsxRuIaMkiksjbq9q6B3Y1/qVZVJDNor99yzGsjWIyYAuwZkmZSXv6Kbf4PYmpYo/XKAtj+fiD+eYGpaUcA0C78s8OdnBchOkWHa2FNtFYGgbAFq74Is4eerNdWFsgkVGYjwjx4ImghhTRmpTyPHlFAWQrF3Wb0PUnPaRqSziFcM4yhURqFRmaCC9cy/PUfLuF3vOzOZPfMUdQN2r8mrOKWFvcX41zwJBB1XUNt/XA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=HDaxQidPXi153G5dSHXyTPT6bcFllfwouMfRau4SKEM=;
 b=Eui7rlc4QzS6Y5rIMZ+xkuUaC2Vg6I6vHjrLc4q0Wo0SqNDZ48QyNLVwFdDN6eUpq/eWgryIAulOcq0qDi0bTLRtD5+Qa2CFx7JeeViHmUiqnNC9TBV88e4zBc0IOdABdNNj4RI3pT+MTEUJL4HQ7yZZuP78Togmqi20vfHbnr9tifc/RokIcMu+TXqr+UNtfQ5SRSPG6MviNuJS/GB5fnEgaGG3IdFE7qoK4OWVaII0LABuEExoZZBwBME9ZtinCg3+/G4tBO1QSrgrj2L2Bmqv96k1jpGF1W/0qtubGVOhAvzlw7vYLPM8i+D+AKtIlEO4qQ3ZldkLneljugR15A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=HDaxQidPXi153G5dSHXyTPT6bcFllfwouMfRau4SKEM=;
 b=wTVNstI19233rcZFl93QHmVSmpm0/DArf7aPeoRYUD6B78EhhrkAL/mH1Gm4uJb7dbHgfspcHJW8Yb0y7f5XrWI+ywsfZXD6uLWu0gILXFKIeFBVNDLQZL6s+Q+d2GTz+T4ZLdwsPnNEdFOr/DNB07IPLOeGw6a1jrvlIyEbCCY=
From: Henry Wang <Henry.Wang@arm.com>
To: Julien Grall <julien@xen.org>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
CC: "nicola.vetrini@bugseng.com" <nicola.vetrini@bugseng.com>, Julien Grall
	<jgrall@amazon.com>, Stefano Stabellini <sstabellini@kernel.org>, Bertrand
 Marquis <Bertrand.Marquis@arm.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>
Subject: RE: [PATCH] xen/dt: Rework the prototype of dt_property_read_string()
 to help Eclair
Thread-Topic: [PATCH] xen/dt: Rework the prototype of
 dt_property_read_string() to help Eclair
Thread-Index: AQHZvhkoHM9BIJ2JWEmZ3643dNrJDa/JsTlQ
Date: Tue, 25 Jul 2023 02:58:14 +0000
Message-ID:
 <AS8PR08MB7991452378AD792FF055F9139203A@AS8PR08MB7991.eurprd08.prod.outlook.com>
References: <20230724102443.91894-1-julien@xen.org>
In-Reply-To: <20230724102443.91894-1-julien@xen.org>
Accept-Language: zh-CN, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ts-tracking-id: 2BD1D1F7D99C62408CFFFD96FDB38A1C.0
x-checkrecipientchecked: true
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AS8PR08MB7991:EE_|AM7PR08MB5493:EE_
x-ms-office365-filtering-correlation-id: e691e475-4c9a-431c-cf7f-08db8cbafd78
nodisclaimer: true
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info:
 Sj60MBY2mmRTYEdwXUHmSRJhe+Yuvcm9rhh8dpEbmhC+5LK401nlFxwzidAXXCoRelV25uB4E9n2kPrj3tnTt9tLhbpJKDG2OASz8/W05xsoUNv4zA8QZpk3fXpfVdC3StWYV1dhbjTybwm1t/hjYL4RCb254lsdYhjYi/1lEajgVWdMFKIHQhqI4rORSgkKZz6wH2DcZgotHUOcIMOBIFmnJw3Jkxq424V5J4ZFAwdt0AHZ4clFRGTv2o78XoykRigJQBEM6O+DXgqAOLa5r93OZgcjXsfU5zd/n1hV1jms4PKvX0mu4wBmeWAFamKCO6baxxIYJ6fuLStW4HECxyaI/DNTkMB+RNWrPRfz5mJFUiY/T7owq2BeZcwOtkh7SbxQG0xKRF5JouDth5x2shML0pt6rIMxlVtyYbNBFZ0hxPO4izsSoAGvXqya+ICq0+2twmIf8YBj64sqsZSovSofxjPbA0QS0jlhlKbY9yP0geM4+diGmj8RuudApVgO8wDWhvf1EYYPVRpTHeAJ5cQ8azoNqKPnbe3VkMvLR9+3t8chmtFHK9drLyDPjeKZPCyHsJGKEgH6NCNh6eF8VO8plVeDl6HNUh6q0VQyToMmuqMm2oISb5qT9pl/c0G7
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB7991.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(366004)(39860400002)(396003)(376002)(346002)(451199021)(9686003)(7696005)(478600001)(54906003)(110136005)(71200400001)(83380400001)(38070700005)(33656002)(86362001)(55016003)(4744005)(2906002)(186003)(26005)(6506007)(316002)(38100700002)(122000001)(66446008)(52536014)(66476007)(4326008)(66946007)(66556008)(76116006)(64756008)(41300700001)(8936002)(8676002)(5660300002)(21314003);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q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zcq/JZtHR/Q5PyM7zAXBVJ2Z+zmrtW0gsPUXWhFh+Px7sw9K?=
 =?us-ascii?Q?QYeWUsxcRkPQF1039to5Dqjo85m2BL28LgD+tl87kZO4wXJ5hG8y6j7YHGFv?=
 =?us-ascii?Q?l8W4CtKrHmU3rtkgTZKclc7WpZDnGlWN12OCZSJAy8Dy5VIH9l3mboMYsXJb?=
 =?us-ascii?Q?NdfxlkLDUXi5QXUKbUGtD7v/TUiY8FpFPUsnOxnMQpoEQnztAGLOJs37Bf5M?=
 =?us-ascii?Q?LcqxUsS5667VtMR2KVjUaMsV8LmYt5M+BuJg8k7GPBWbeTCBq5K4Lf0MKBqB?=
 =?us-ascii?Q?Wu3DiwD2VYFXZuO0S37D8CJOxejasaBW1H4BhgvEfFfgrKTOVDzKJfQWCQkI?=
 =?us-ascii?Q?FFhyvryWnT9Gi83ohCwgy6ng+f0maCkJpV79pSPXw+J27T1nkHUxJJYHJeDj?=
 =?us-ascii?Q?RpZOjxFopax9mbTJVTuEkg+okKJ7Zc/U/wr3ptJrSGtQJ4SqtjTP51OeXYGK?=
 =?us-ascii?Q?XG+4O1pyD8q7TYFGJJRf5hg77DMU64FKldkhKEZ3Eo8LMokbhRXfeW5EUst3?=
 =?us-ascii?Q?qdqQv/NoPBGyaP7tHmopQCnt7yyN2TaFyKJF+kLs8R6BSvllOhTcWpz9J5/W?=
 =?us-ascii?Q?2xBDlJpYyyJ7404WtfGnp7pfe5VH76gFwXV8VWV9EG7E8yyQU91RUgEmgPzF?=
 =?us-ascii?Q?lGq5XXIETJgK3CWwsNg4h6gjpRNC9zeoiWnV0xjnMoQtgMnMkZAGgW1zDq0a?=
 =?us-ascii?Q?Mi3edjSK1fYlrQiBTiQR1rWMUPvp+mMWkFS6B8LI?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AS8PR08MB7991.eurprd08.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e691e475-4c9a-431c-cf7f-08db8cbafd78
X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jul 2023 02:58:14.7279
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 16gCKCTQp4q7YTOX49p1yBpxNkW3sRhkM+3epYnQUtKKosJZ/0M+qohYTaJcGZisB9SEkrpyOncQFoZcie85mA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5493

Hi Julien,

> -----Original Message-----
> Subject: [PATCH] xen/dt: Rework the prototype of dt_property_read_string(=
)
> to help Eclair
>=20
> From: Julien Grall <jgrall@amazon.com>
>=20
> Eclair vXXX is unable to prove the parameter out_string will only be
> used the return of dt_property_read_string() is 0. So it will consider
> that MISRA C:2012 Rule 9.1 was violated.
>=20
> Rework the prototype so the string is returned and use ERR_PTR() to
> embed the error code.
>=20
> Signed-off-by: Julien Grall <jgrall@amazon.com>
> ---
> The XXX should be replaced with the version of Eclair. Nicola, can you
> provide it?

I am seeing some ongoing discussions about the commit message, but
the code itself looks good to me, and I also tested this patch to make
sure things are good, so:

Reviewed-by: Henry Wang <Henry.Wang@arm.com>
Tested-by: Henry Wang <Henry.Wang@arm.com>

Kind regards,
Henry



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 03:01:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 03:01:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569338.889749 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO8Ih-0000Bu-F8; Tue, 25 Jul 2023 03:01:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569338.889749; Tue, 25 Jul 2023 03:01:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO8Ih-0000Bn-CV; Tue, 25 Jul 2023 03:01:27 +0000
Received: by outflank-mailman (input) for mailman id 569338;
 Tue, 25 Jul 2023 03:01:26 +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
 <SRS0=8+K8=DL=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qO8Ig-0000Bf-9G
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 03:01:26 +0000
Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com
 [2607:f8b0:4864:20::42a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 61c18ac0-2a97-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 05:00:17 +0200 (CEST)
Received: by mail-pf1-x42a.google.com with SMTP id
 d2e1a72fcca58-66d6a9851f3so1179273b3a.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 20:01:23 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 fe15-20020a056a002f0f00b0066ccb8e8024sm8472563pfb.30.2023.07.24.20.01.09
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 24 Jul 2023 20:01:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 61c18ac0-2a97-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690254081; x=1690858881;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=BOm9JtzAMmxvhoSbX2NtL3QoGfALrOaBCsSuiN3HvS8=;
        b=S6qTrQW9jNBAqKkMe5A0Cu8+HbQDlzC3TLro07t5ACviirx/XqhnqUPjiclTs78MVw
         L8tR0RX+uwWODTuNUCn9GO7p4bXpfIsdbkjqpY0PqVfJilI1CACHVzYlY/iV0sWP5V/3
         T3P+fsJZrl/T8/61jZYJY4PyQofvYiMvXNGAlNPnqvgQIdqIJpCErJLddWxt9/CHMYvA
         fQfQW01/Y2q+AlIExOo9mNzILsmJhUWs4VPYn88so7T3w1Nn66xNTb/c35K8Neo4b+tp
         wg91etpXIESM3veFJOsmMl9xQ0iXGYxs+8+DAjrpr00+sWBSXajvrars1puw7bQqkMd4
         /qUw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690254081; x=1690858881;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=BOm9JtzAMmxvhoSbX2NtL3QoGfALrOaBCsSuiN3HvS8=;
        b=XEuK6UKAkhgC0qPU5p8EjFKZnMYGlqQItybqCovswU6kzxrO+c6M0NfiM/XHuJOUZx
         DXtTN0WTSyTTkAwjwfZ9+hG4BCHqZjQmCBh46enlkGlOJhsPA2GFG0FqkQ+2khB6TrGw
         CcdAYVYxZxESIaKcz1eEa9pNkRJA7BX1+YThDJgkrr18CepfluCt4quhy2Ve4ot2441W
         oGxeFEkCbOk794Vw+2ZGwEJK2qTVXeM88VzZin87SVIeW2tfwb7LKNHEK3S+Y4YwNEH2
         88vi5GbUjSmL9w9AXXTEKNqWHfM8NOXP+pEj2f3BqWp4Ad8ULxl9vfofIcNbwUZZe+nh
         rAYA==
X-Gm-Message-State: ABy/qLZh3J74iO6pH7H3VunnLA0AXrBxuwSRsIgOX2u2HCblexUkES5d
	EJwDYjJBxKSS39aSxS7va82qKg==
X-Google-Smtp-Source: APBJJlFM6WPSihXOKl0X4zg92CAAfeqIP/jkVagMNd5II31TO+klkQLkXzKhhJFyUFA6pGL+niCVGA==
X-Received: by 2002:a05:6a20:160d:b0:111:a0e5:d2b7 with SMTP id l13-20020a056a20160d00b00111a0e5d2b7mr15056320pzj.4.1690254081364;
        Mon, 24 Jul 2023 20:01:21 -0700 (PDT)
Message-ID: <9b149dd9-1617-9af4-4252-6d0df01f93b1@bytedance.com>
Date: Tue, 25 Jul 2023 11:01:06 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 03/47] mm: shrinker: add infrastructure for dynamically
 allocating shrinker
Content-Language: en-US
To: Peter Zijlstra <peterz@infradead.org>
Cc: akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru,
 vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org,
 brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com,
 cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com,
 gregkh@linuxfoundation.org, muchun.song@linux.dev,
 linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-4-zhengqi.arch@bytedance.com>
 <20230724122549.GA3731903@hirez.programming.kicks-ass.net>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <20230724122549.GA3731903@hirez.programming.kicks-ass.net>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Peter,

On 2023/7/24 20:25, Peter Zijlstra wrote:
> On Mon, Jul 24, 2023 at 05:43:10PM +0800, Qi Zheng wrote:
> 
>> +void shrinker_unregister(struct shrinker *shrinker)
>> +{
>> +	struct dentry *debugfs_entry;
>> +	int debugfs_id;
>> +
>> +	if (!shrinker || !(shrinker->flags & SHRINKER_REGISTERED))
>> +		return;
>> +
>> +	down_write(&shrinker_rwsem);
>> +	list_del(&shrinker->list);
>> +	shrinker->flags &= ~SHRINKER_REGISTERED;
>> +	if (shrinker->flags & SHRINKER_MEMCG_AWARE)
>> +		unregister_memcg_shrinker(shrinker);
>> +	debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);
>> +	up_write(&shrinker_rwsem);
>> +
>> +	shrinker_debugfs_remove(debugfs_entry, debugfs_id);
> 
> Should there not be an rcu_barrier() right about here?

The shrinker_debugfs_remove() will wait for debugfs_file_put() to
return, so when running here, all shrinker debugfs operations have
been completed. And the slab shrink will hold the read lock of
shrinker_rwsem to traverse the shrinker_list, so when we hold the
write lock of shrinker_rwsem to delete the shrinker from the
shrinker_list, the shrinker will not be executed again.

So I think there is no need to add a rcu_barrier() here. Please let
me know if I missed something.

Thanks,
Qi

> 
>> +
>> +	kfree(shrinker->nr_deferred);
>> +	shrinker->nr_deferred = NULL;
>> +
>> +	kfree(shrinker);
>> +}
>> +EXPORT_SYMBOL(shrinker_unregister);
> 


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 03:05:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 03:05:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569342.889760 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO8Mb-0000sJ-4I; Tue, 25 Jul 2023 03:05:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569342.889760; Tue, 25 Jul 2023 03:05:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO8Mb-0000sC-0i; Tue, 25 Jul 2023 03:05:29 +0000
Received: by outflank-mailman (input) for mailman id 569342;
 Tue, 25 Jul 2023 03:05:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8+K8=DL=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qO8MZ-0000s6-Nf
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 03:05:27 +0000
Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com
 [2607:f8b0:4864:20::432])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 19e3d1b2-2a98-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 05:05:26 +0200 (CEST)
Received: by mail-pf1-x432.google.com with SMTP id
 d2e1a72fcca58-6864c144897so1189009b3a.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 20:05:26 -0700 (PDT)
Received: from ?IPV6:fdbd:ff1:ce00:1c25:884:3ed:e1db:b610?
 ([2408:8000:b001:1:1f:58ff:f102:103])
 by smtp.gmail.com with ESMTPSA id
 t10-20020a17090aba8a00b002681d44071csm2043968pjr.46.2023.07.24.20.05.08
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 24 Jul 2023 20:05:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 19e3d1b2-2a98-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690254325; x=1690859125;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=niSMZqBCvW/Me9jsMaxXz5gtuZ44llk1Ot3soT0LhIs=;
        b=FniJo6cfZiXO48N3LrJPbrRtsXuGwEsrxL+rPNcNzpIfBU8e0vwfaKRVcngIxQ6/Nq
         uV6IwXjWItzg/7IWT04hxNl0ft8u0yvH7EyRJ6POcXsP6dFyjR2vvuievKT7V7wXKj9i
         Hs4OFXg82m4uyRZZDGIHYrUPf7Daiin7owJFDMH9ALFzGhGiMR/jo54iE9PQ2yCszEax
         GduXKZlfrLf0f1lI69b+SeFKsM1fBAPgAwEi9/QiPJB5pr3rcwSAawR7U6Bt6cbBHX1B
         l+6jljnScvspLgnoIuyzCCNBX+9PGgFUwcZiZbmROS7agCNCVVXov8LOv0CsZfjvTopq
         9j6w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690254325; x=1690859125;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=niSMZqBCvW/Me9jsMaxXz5gtuZ44llk1Ot3soT0LhIs=;
        b=OTg2q0BtlKaUZHlyUlNa8DtLOEWQWxwY32ELSMYm2VBT+iI6mJHyHA94i8GDg3P3YC
         Qmhvz3yAOW6MZjJv1OdZsdviKKjCNStApUPEcJbX0qHGLLP6pV8hqtXl73u4zYSoMqOx
         Wqpn7qRcOnjFo5fWu3JSICHzORYGi5naIEpQSia9SOod5RBMpivtcYY4r8WvgaTBh4V/
         NeU/z2AlUBd3QSBuFCIG8VHi5GigQSygMHQF9A9H8VQqXyG/KA6tOG5VYPdqxmYGkq55
         VY45Npf1oRFiYbwY8utmNunUQIl+UA/hOp+RQcLaE8NRmVvTV2LZ80ojQwQ9gqRTMJVq
         PNPA==
X-Gm-Message-State: ABy/qLZgtF7DStjXfHm2eFUxCM+IdwSXFRFZ5hyUNgapqIhxlHnwEzFB
	C+GgfR2sHdvYAAOVI/TQmvJ4VA==
X-Google-Smtp-Source: APBJJlFB/cQTGj3IlIfGF+HAM8hU50IJB+Lr29ujA3cHbbDSAB3N90HdGCOpa8iydTeMw+f8qxyL2Q==
X-Received: by 2002:a17:90a:1d46:b0:268:abc:83d5 with SMTP id u6-20020a17090a1d4600b002680abc83d5mr6012554pju.4.1690254324674;
        Mon, 24 Jul 2023 20:05:24 -0700 (PDT)
Message-ID: <6049aa99-aa47-5137-f66e-350bc4723914@bytedance.com>
Date: Tue, 25 Jul 2023 11:05:04 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 24/47] drm/panfrost: dynamically allocate the
 drm-panfrost shrinker
Content-Language: en-US
To: Steven Price <steven.price@arm.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz,
 roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org,
 paulmck@kernel.org, tytso@mit.edu, cel@kernel.org, senozhatsky@chromium.org,
 yujie.liu@intel.com, gregkh@linuxfoundation.org, muchun.song@linux.dev
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-25-zhengqi.arch@bytedance.com>
 <cdd08c9e-81d3-a85f-5426-5db738aa73ec@arm.com>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <cdd08c9e-81d3-a85f-5426-5db738aa73ec@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Steven,

On 2023/7/24 19:17, Steven Price wrote:
> On 24/07/2023 10:43, Qi Zheng wrote:
>> In preparation for implementing lockless slab shrink, use new APIs to
>> dynamically allocate the drm-panfrost shrinker, so that it can be freed
>> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
>> read-side critical section when releasing the struct panfrost_device.
>>
>> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> 
> One nit below, but otherwise:
> 
> Reviewed-by: Steven Price <steven.price@arm.com>
> 
>> ---
>>   drivers/gpu/drm/panfrost/panfrost_device.h    |  2 +-
>>   drivers/gpu/drm/panfrost/panfrost_drv.c       |  6 +++-
>>   drivers/gpu/drm/panfrost/panfrost_gem.h       |  2 +-
>>   .../gpu/drm/panfrost/panfrost_gem_shrinker.c  | 32 ++++++++++++-------
>>   4 files changed, 27 insertions(+), 15 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h
>> index b0126b9fbadc..e667e5689353 100644
>> --- a/drivers/gpu/drm/panfrost/panfrost_device.h
>> +++ b/drivers/gpu/drm/panfrost/panfrost_device.h
>> @@ -118,7 +118,7 @@ struct panfrost_device {
>>   
>>   	struct mutex shrinker_lock;
>>   	struct list_head shrinker_list;
>> -	struct shrinker shrinker;
>> +	struct shrinker *shrinker;
>>   
>>   	struct panfrost_devfreq pfdevfreq;
>>   };
>> diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
>> index bbada731bbbd..f705bbdea360 100644
>> --- a/drivers/gpu/drm/panfrost/panfrost_drv.c
>> +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
>> @@ -598,10 +598,14 @@ static int panfrost_probe(struct platform_device *pdev)
>>   	if (err < 0)
>>   		goto err_out1;
>>   
>> -	panfrost_gem_shrinker_init(ddev);
>> +	err = panfrost_gem_shrinker_init(ddev);
>> +	if (err)
>> +		goto err_out2;
>>   
>>   	return 0;
>>   
>> +err_out2:
>> +	drm_dev_unregister(ddev);
>>   err_out1:
>>   	pm_runtime_disable(pfdev->dev);
>>   	panfrost_device_fini(pfdev);
>> diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.h b/drivers/gpu/drm/panfrost/panfrost_gem.h
>> index ad2877eeeccd..863d2ec8d4f0 100644
>> --- a/drivers/gpu/drm/panfrost/panfrost_gem.h
>> +++ b/drivers/gpu/drm/panfrost/panfrost_gem.h
>> @@ -81,7 +81,7 @@ panfrost_gem_mapping_get(struct panfrost_gem_object *bo,
>>   void panfrost_gem_mapping_put(struct panfrost_gem_mapping *mapping);
>>   void panfrost_gem_teardown_mappings_locked(struct panfrost_gem_object *bo);
>>   
>> -void panfrost_gem_shrinker_init(struct drm_device *dev);
>> +int panfrost_gem_shrinker_init(struct drm_device *dev);
>>   void panfrost_gem_shrinker_cleanup(struct drm_device *dev);
>>   
>>   #endif /* __PANFROST_GEM_H__ */
>> diff --git a/drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c b/drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c
>> index bf0170782f25..9a90dfb5301f 100644
>> --- a/drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c
>> +++ b/drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c
>> @@ -18,8 +18,7 @@
>>   static unsigned long
>>   panfrost_gem_shrinker_count(struct shrinker *shrinker, struct shrink_control *sc)
>>   {
>> -	struct panfrost_device *pfdev =
>> -		container_of(shrinker, struct panfrost_device, shrinker);
>> +	struct panfrost_device *pfdev = shrinker->private_data;
>>   	struct drm_gem_shmem_object *shmem;
>>   	unsigned long count = 0;
>>   
>> @@ -65,8 +64,7 @@ static bool panfrost_gem_purge(struct drm_gem_object *obj)
>>   static unsigned long
>>   panfrost_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc)
>>   {
>> -	struct panfrost_device *pfdev =
>> -		container_of(shrinker, struct panfrost_device, shrinker);
>> +	struct panfrost_device *pfdev = shrinker->private_data;
>>   	struct drm_gem_shmem_object *shmem, *tmp;
>>   	unsigned long freed = 0;
>>   
>> @@ -97,13 +95,24 @@ panfrost_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc)
>>    *
>>    * This function registers and sets up the panfrost shrinker.
>>    */
>> -void panfrost_gem_shrinker_init(struct drm_device *dev)
>> +int panfrost_gem_shrinker_init(struct drm_device *dev)
>>   {
>>   	struct panfrost_device *pfdev = dev->dev_private;
>> -	pfdev->shrinker.count_objects = panfrost_gem_shrinker_count;
>> -	pfdev->shrinker.scan_objects = panfrost_gem_shrinker_scan;
>> -	pfdev->shrinker.seeks = DEFAULT_SEEKS;
>> -	WARN_ON(register_shrinker(&pfdev->shrinker, "drm-panfrost"));
>> +
>> +	pfdev->shrinker = shrinker_alloc(0, "drm-panfrost");
>> +	if (!pfdev->shrinker) {
>> +		WARN_ON(1);
> 
> I don't think this WARN_ON is particularly useful - if there's a failed
> memory allocation we should see output from the kernel anyway. And we're
> changing the semantics from "continue just without a shrinker" (which
> argueably justifies the warning) to "probe fails, device doesn't work"
> which will be obvious to the user so I don't feel we need the additional
> warn.

Make sense. Will delete this WARN_ON() in the next version.

Thanks,
Qi

> 
>> +		return -ENOMEM;
>> +	}
>> +
>> +	pfdev->shrinker->count_objects = panfrost_gem_shrinker_count;
>> +	pfdev->shrinker->scan_objects = panfrost_gem_shrinker_scan;
>> +	pfdev->shrinker->seeks = DEFAULT_SEEKS;
>> +	pfdev->shrinker->private_data = pfdev;
>> +
>> +	shrinker_register(pfdev->shrinker);
>> +
>> +	return 0;
>>   }
>>   
>>   /**
>> @@ -116,7 +125,6 @@ void panfrost_gem_shrinker_cleanup(struct drm_device *dev)
>>   {
>>   	struct panfrost_device *pfdev = dev->dev_private;
>>   
>> -	if (pfdev->shrinker.nr_deferred) {
>> -		unregister_shrinker(&pfdev->shrinker);
>> -	}
>> +	if (pfdev->shrinker)
>> +		shrinker_unregister(pfdev->shrinker);
>>   }
> 


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 03:09:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 03:09:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569344.889770 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO8QP-0001SX-Jb; Tue, 25 Jul 2023 03:09:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569344.889770; Tue, 25 Jul 2023 03:09:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO8QP-0001SQ-Gj; Tue, 25 Jul 2023 03:09:25 +0000
Received: by outflank-mailman (input) for mailman id 569344;
 Tue, 25 Jul 2023 03:09:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8+K8=DL=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qO8QO-0001SK-IG
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 03:09:24 +0000
Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com
 [2607:f8b0:4864:20::102c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a76882fa-2a98-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 05:09:23 +0200 (CEST)
Received: by mail-pj1-x102c.google.com with SMTP id
 98e67ed59e1d1-267711d2b43so714282a91.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 20:09:23 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 21-20020a17090a199500b002633fa95ac2sm9540001pji.13.2023.07.24.20.09.10
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 24 Jul 2023 20:09:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a76882fa-2a98-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690254562; x=1690859362;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=ZLkcXzJjvvDBLgu5DbJbwRAKtejO8FK7VlKqBEYpGhg=;
        b=T37460khNMPot0VVWdDz4lB6VWzVdicUBxVfz7CttLqrgD8g0MkXpwdKxm81+5qM3E
         yM+KFmnDFeQa0ZY5ZeNvvyumpxFJqPDg3oixgT5YKKGKOt9qmtbXs6vK0nUKy4kqsaDS
         iJ3utK1jXEfJapBrHYjK+SRbiAPBWHkzR4mO0jKk+qC4Stl39POzbhCCP4MwAtpmSso5
         ynGZ9erR4hLoA8pCdH+sRZpUbw1kMvKh2ycfFI2IzmOqd8Zq8Q0hlgUcK6mejCeashGS
         UzcYSPHM74qvjYTTAriMRhyDbW62IR+NfEc7uD2qj/U2RIYLpDl8fGFG28yoLGatJrqh
         GkTg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690254562; x=1690859362;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=ZLkcXzJjvvDBLgu5DbJbwRAKtejO8FK7VlKqBEYpGhg=;
        b=JGHD0aUE2+3jZ/GlNARM9v4a4dR2/cXHnFW3W1EhmXg0D4oy3Ur0srtMACM/da5L88
         D7dYszzxyz3km/nfafCHFGnr3yWKjns+ML2PmC3pmrHH3Pm++EJ7A5yyripe3tXKcAXV
         belGdXyKa1JsN8fLseh138JFIyd8Ba7C+F4+eb1lEoYwdCAGgA6582/2TuMickFx8Gcn
         YCvNAiogH0H/S5khJeNBJgm9BIo7A/6cS5SiSCW71zdRnZSFsZ1xzh5ngsVvSJaHk42I
         zOwqIIZkSZvmii6jFj5f1zHSlZnl52EFQkTW+quAQcL03GBrEGe2F3UNfyXJe5bogLQS
         vzaQ==
X-Gm-Message-State: ABy/qLbkqDl49y3p+mQViANta0u5ef9vfLE+RdxXsUAwbN9C90Fg+xf9
	1V3dbfu9aodYIscbyybgu48/eQ==
X-Google-Smtp-Source: APBJJlEruF0WFFXXZAOwcLJKfTF/P8Yek4Wx/bwgxp4VRr2IRHJr9OEk7izXq54CPTEEiNehAqKYyg==
X-Received: by 2002:a17:90a:50f:b0:263:730b:f568 with SMTP id h15-20020a17090a050f00b00263730bf568mr10246975pjh.3.1690254562043;
        Mon, 24 Jul 2023 20:09:22 -0700 (PDT)
Message-ID: <d2621ad0-8b99-9154-5ff5-509dec2f32a3@bytedance.com>
Date: Tue, 25 Jul 2023 11:09:07 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 01/47] mm: vmscan: move shrinker-related code into a
 separate file
Content-Language: en-US
To: Muchun Song <muchun.song@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>, david@fromorbit.com,
 tkhai@ya.ru, Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>, djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>, "Paul E. McKenney"
 <paulmck@kernel.org>, tytso@mit.edu, steven.price@arm.com, cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>, yujie.liu@intel.com,
 Greg KH <gregkh@linuxfoundation.org>, LKML <linux-kernel@vger.kernel.org>,
 Linux Memory Management List <linux-mm@kvack.org>, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org,
 netdev <netdev@vger.kernel.org>, dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, dm-devel@redhat.com,
 linux-raid@vger.kernel.org, linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-2-zhengqi.arch@bytedance.com>
 <97E80C37-8872-4C5A-A027-A0B35F39152A@linux.dev>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <97E80C37-8872-4C5A-A027-A0B35F39152A@linux.dev>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 2023/7/25 10:35, Muchun Song wrote:
> 
> 
>> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
>>
>> The mm/vmscan.c file is too large, so separate the shrinker-related
>> code from it into a separate file. No functional changes.
>>
>> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
>> ---
>> include/linux/shrinker.h |   3 +
>> mm/Makefile              |   4 +-
>> mm/shrinker.c            | 707 +++++++++++++++++++++++++++++++++++++++
>> mm/vmscan.c              | 701 --------------------------------------
>> 4 files changed, 712 insertions(+), 703 deletions(-)
>> create mode 100644 mm/shrinker.c
>>
>> diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
>> index 224293b2dd06..961cb84e51f5 100644
>> --- a/include/linux/shrinker.h
>> +++ b/include/linux/shrinker.h
>> @@ -96,6 +96,9 @@ struct shrinker {
>>   */
>> #define SHRINKER_NONSLAB (1 << 3)
>>
>> +unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
>> +			   int priority);
> 
> A good cleanup, vmscan.c is so huge.
> 
> I'd like to introduce a new header in mm/ directory and contains those
> declarations of functions (like this and other debug function in
> shrinker_debug.c) since they are used internally across mm.

How about putting them in the mm/internal.h file?

> 
> Thanks.
> 


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 03:28:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 03:28:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569351.889780 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO8ie-0003ue-6H; Tue, 25 Jul 2023 03:28:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569351.889780; Tue, 25 Jul 2023 03:28:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO8ie-0003uX-2o; Tue, 25 Jul 2023 03:28:16 +0000
Received: by outflank-mailman (input) for mailman id 569351;
 Tue, 25 Jul 2023 03:28:15 +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
 <SRS0=8+K8=DL=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qO8ic-0003uR-N9
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 03:28:15 +0000
Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com
 [2607:f8b0:4864:20::435])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 47ea8840-2a9b-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 05:28:11 +0200 (CEST)
Received: by mail-pf1-x435.google.com with SMTP id
 d2e1a72fcca58-682a5465e9eso1181695b3a.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 20:28:11 -0700 (PDT)
Received: from ?IPV6:fdbd:ff1:ce00:1c25:884:3ed:e1db:b610?
 ([240e:694:e21:b::2]) by smtp.gmail.com with ESMTPSA id
 s3-20020aa78283000000b00682a9325ffcsm8407714pfm.5.2023.07.24.20.27.57
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 24 Jul 2023 20:28:10 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 47ea8840-2a9b-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690255690; x=1690860490;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=6wY4cILkEhsrpRf+mNddP0nleKOSU9sayj8Z5h0ToXM=;
        b=PknHptOa2Z8+2vaclzexjcjHcgGTKnQ0JRJ89LK+GvkJZyUzNmFYDaw4LaxhrbAB97
         Qlt49eA21cgLfip1YkLzQvNHl9NRE1uu+H3yLMzr5GUQw2R94ASja3LKRc7K2/IuJ877
         /rUQws3HOX4h/pSV0QLIC/txctttQBZDy4goWlpNGxYwzk8J6CttdGDNpskz9IiWFE6E
         W06R7YBvAlwN2Ll/k0WZ+e8J2UJKgy2rlagtK3lUaqPgpyCrwLsDTNoP/0MXBrAUaLK4
         fe8VXE6m3BmotnBeZ7KmASyzpGnPX5FsNzpJdMUNn5TjD0dfcmx5lygJuqraNOT+sjor
         yB3A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690255690; x=1690860490;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=6wY4cILkEhsrpRf+mNddP0nleKOSU9sayj8Z5h0ToXM=;
        b=JsIYdUKGimVX5XBd+GVVNhsp/VWMfCmRpjUuJyMFDOurNgEUmIcdGPoqlYS3gybF6n
         cUFl30dOZNdpJqG+EJQ60v8OkbSJ0ZkdNJb/Ki4G6soATAbRZcrZ3p1GXwWm/YYi49Ny
         p3F+EKg4TPp7lsQ9qA0c5MqLzw0RsrkUoRc8RIr5jpw2SIcpePbGAObRgyn0H+LzhyGK
         k3i/q+8GQ9KkXF63nGzGk5DFQ8puUjn0hFLFil4P+7YsEKWajpUJ2+XuCbw1Nv76sDPb
         Nk8YfMwAVV3+PcN/33PZ5ohWBCly7zyLGZvc+decM8LNu9rdGX2rJ5SfIT5uA5qoP0A5
         APcA==
X-Gm-Message-State: ABy/qLYYPVzwGKCk2Weq9fLjNk+DX3NOiaYjH3uI001fWAMwX5wa45XW
	yYGSTGfLsnMF06vHngDTMpAWsA==
X-Google-Smtp-Source: APBJJlHvnzRChS6v/nee9rDGEWxm9C29UVXVwYKOSH3HP5ue/guAsHAKmcdiSeukVqd30tCkGAz2cw==
X-Received: by 2002:a05:6a00:cd1:b0:677:bb4c:c321 with SMTP id b17-20020a056a000cd100b00677bb4cc321mr15272930pfv.0.1690255690395;
        Mon, 24 Jul 2023 20:28:10 -0700 (PDT)
Message-ID: <bbd36d96-b6b8-08c3-1092-e3d0b255134a@bytedance.com>
Date: Tue, 25 Jul 2023 11:27:55 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 01/47] mm: vmscan: move shrinker-related code into a
 separate file
Content-Language: en-US
To: Muchun Song <muchun.song@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>, david@fromorbit.com,
 tkhai@ya.ru, Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>, djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>, "Paul E. McKenney"
 <paulmck@kernel.org>, tytso@mit.edu, steven.price@arm.com, cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>, yujie.liu@intel.com,
 Greg KH <gregkh@linuxfoundation.org>, LKML <linux-kernel@vger.kernel.org>,
 Linux Memory Management List <linux-mm@kvack.org>, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org,
 netdev <netdev@vger.kernel.org>, dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, dm-devel@redhat.com,
 linux-raid@vger.kernel.org, linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-2-zhengqi.arch@bytedance.com>
 <97E80C37-8872-4C5A-A027-A0B35F39152A@linux.dev>
 <d2621ad0-8b99-9154-5ff5-509dec2f32a3@bytedance.com>
 <6FE62F56-1B4E-4E2A-BEA9-0DA6907A2FA9@linux.dev>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <6FE62F56-1B4E-4E2A-BEA9-0DA6907A2FA9@linux.dev>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 2023/7/25 11:23, Muchun Song wrote:
> 
> 
>> On Jul 25, 2023, at 11:09, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
>>
>>
>>
>> On 2023/7/25 10:35, Muchun Song wrote:
>>>> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
>>>>
>>>> The mm/vmscan.c file is too large, so separate the shrinker-related
>>>> code from it into a separate file. No functional changes.
>>>>
>>>> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
>>>> ---
>>>> include/linux/shrinker.h |   3 +
>>>> mm/Makefile              |   4 +-
>>>> mm/shrinker.c            | 707 +++++++++++++++++++++++++++++++++++++++
>>>> mm/vmscan.c              | 701 --------------------------------------
>>>> 4 files changed, 712 insertions(+), 703 deletions(-)
>>>> create mode 100644 mm/shrinker.c
>>>>
>>>> diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
>>>> index 224293b2dd06..961cb84e51f5 100644
>>>> --- a/include/linux/shrinker.h
>>>> +++ b/include/linux/shrinker.h
>>>> @@ -96,6 +96,9 @@ struct shrinker {
>>>>   */
>>>> #define SHRINKER_NONSLAB (1 << 3)
>>>>
>>>> +unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
>>>> +    int priority);
>>> A good cleanup, vmscan.c is so huge.
>>> I'd like to introduce a new header in mm/ directory and contains those
>>> declarations of functions (like this and other debug function in
>>> shrinker_debug.c) since they are used internally across mm.
>>
>> How about putting them in the mm/internal.h file?
> 
> Either is fine to me.

OK, will do in the next version.

> 
>>
>>> Thanks.
> 
> 


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:21:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:21:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569358.889830 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Xz-00036J-6p; Tue, 25 Jul 2023 04:21:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569358.889830; Tue, 25 Jul 2023 04:21:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Xz-000367-3b; Tue, 25 Jul 2023 04:21:19 +0000
Received: by outflank-mailman (input) for mailman id 569358;
 Tue, 25 Jul 2023 04:21:18 +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
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Xy-00023t-Ao
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:18 +0000
Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com
 [2607:f8b0:4864:20::b29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b22ac632-2aa2-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:21:16 +0200 (CEST)
Received: by mail-yb1-xb29.google.com with SMTP id
 3f1490d57ef6-c5cf26e9669so4296593276.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:16 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.13
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:14 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b22ac632-2aa2-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258875; x=1690863675;
        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=IUMUqbW/uAIHfn0G4toP3JCuPKsaNgXF+JjYaBSaBaw=;
        b=p9s9prTX9rn/wpC0IRJR9+orYvMKxIQqYiO/2qc1ucIOxNaOErt5vfdpNKxEU6T/vv
         +2unp610u7/KZK91WoTQLcBH/VtkD3XUQxHC44CLkqpLaHmHFzgBPOO6uWyO/3jX9Xgf
         76GcUW4UU7BHeMr+SY/V25wW6PaanozuCo4EhC7wsdhYIlQKIrWatw16Z/wgKznB+Orn
         ruoMSNrGoRWxyM/OJxGteQSORJl7RZHeZVq6QR7pMySplhmG3+tZ02+FH1KXAFJgXdGU
         XCaHvNOv6BykhfTtnLqNaZvGHZmQ1vFu3nRlDk8gtK37Li+LTW7MffEEWNWOsyB37y52
         60nA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258875; x=1690863675;
        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=IUMUqbW/uAIHfn0G4toP3JCuPKsaNgXF+JjYaBSaBaw=;
        b=iO9WDfRD8Q07KOIskDZt8rKlNEWbLK3W/HBVdnoNFwpY9GT+FGlKq7JcPb+MzPLhs3
         2wZcxAa+J1BwAZKk80mgqfYeCwrQTa9XgPYvGHWTYbbCV2rA3jGS3FoW69P/NgX2GUF+
         PzKarrPihy1qaNqBBxA6dtui1zywO2P2geBD2DeMXO0ep8DIbVcVwngUTiNPmAZBWx0V
         57ZWUCUEjqQRgnongZGcZq7Nxcwwd+6KxdS5l+G9Jf2p0xZWKWrB/v+Z5PnngAQ1evzL
         u23M3ETMkUxeHc35XJxBzKD5lASWiSN/dztESkuHxe53Ac2UN+oiS2d5NhH1gKW82ThQ
         Up+g==
X-Gm-Message-State: ABy/qLay5YkkYGmwKe0Af5bG5p5cImoeIT8lfnUfIgr7i9wojgS6lSGx
	6yF6aTdQxJcT/A0qd/9cxSc=
X-Google-Smtp-Source: APBJJlEMSP0J8OF6O819F/tTFVo5KNWedtuWn+u3qsGgdRhWZk0PUYcaZVFlVCsLViSNb2GRnqh20Q==
X-Received: by 2002:a25:6b45:0:b0:d10:68c5:233e with SMTP id o5-20020a256b45000000b00d1068c5233emr4343866ybm.60.1690258875202;
        Mon, 24 Jul 2023 21:21:15 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 04/31] mm: Convert pmd_pgtable_page() callers to use pmd_ptdesc()
Date: Mon, 24 Jul 2023 21:20:24 -0700
Message-Id: <20230725042051.36691-5-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Converts internal pmd_pgtable_page() callers to use pmd_ptdesc(). This
removes some direct accesses to struct page, working towards splitting
out struct ptdesc from struct page.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/mm.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 3fda0ad41cf2..bf552a106e4a 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2971,7 +2971,7 @@ static inline struct ptdesc *pmd_ptdesc(pmd_t *pmd)
 
 static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd)
 {
-	return ptlock_ptr(pmd_pgtable_page(pmd));
+	return ptlock_ptr(ptdesc_page(pmd_ptdesc(pmd)));
 }
 
 static inline bool pmd_ptlock_init(struct page *page)
@@ -2990,7 +2990,7 @@ static inline void pmd_ptlock_free(struct page *page)
 	ptlock_free(page);
 }
 
-#define pmd_huge_pte(mm, pmd) (pmd_pgtable_page(pmd)->pmd_huge_pte)
+#define pmd_huge_pte(mm, pmd) (pmd_ptdesc(pmd)->pmd_huge_pte)
 
 #else
 
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:21:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:21:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569354.889790 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Xr-000246-3E; Tue, 25 Jul 2023 04:21:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569354.889790; Tue, 25 Jul 2023 04:21:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Xr-00023z-0R; Tue, 25 Jul 2023 04:21:11 +0000
Received: by outflank-mailman (input) for mailman id 569354;
 Tue, 25 Jul 2023 04:21:10 +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
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Xq-00023t-Ig
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:10 +0000
Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com
 [2607:f8b0:4864:20::b35])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ad09e06a-2aa2-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:21:07 +0200 (CEST)
Received: by mail-yb1-xb35.google.com with SMTP id
 3f1490d57ef6-d075a831636so3447885276.3
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:07 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ad09e06a-2aa2-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258866; x=1690863666;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=TyJK1FcnJgXFfZtNrnEiwbnRrWFFZ4hxtDemQIw/+70=;
        b=IWbM/8TKnsrsFnwfAtrtbT7DO2Dq3vbt1JDGjncQR1/QHrfo4QUSkIiEQN1x/WCeen
         Wq+1xfZOSXiXa3ftlSpFueFEFpvRBK3/RSrU5gjulTAyP6CHn+1+IFvHFglXW6v8keEi
         8OQyuFtLfuzytADBe5cFOUdQJ/Hdq1bfJlON7Nb+Mx5/ezSX5vpuq992erh0MteP8eY0
         ca2RegvmV6aTmEkiWQSzVkeiWkjDFWU6BxECXoDX15tgD4oeetn4XjwJQHkKr/UZi4jn
         M2rzWVhqQ0uUKv1+kbt9dezvn9EL8NwkaBEBxeHbR53ElScFeaGw8CT+ZDStPX5ya8Y8
         SH2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258866; x=1690863666;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=TyJK1FcnJgXFfZtNrnEiwbnRrWFFZ4hxtDemQIw/+70=;
        b=a4fD/mQ9snEaGRpZfI67Ypx+2QTCfWKt+awDQsc2PXT46IOAhy4SE5QEf7Ic5VEE8c
         rJH48ys4lsEgJwnMju+V5ctbp+nqTZ8w5hsJepiMnxsvbaY+97y5veC+zeX4Td3z+sK2
         501XPKjY1lsVJkaZ/F6OLYkhAuEO+VEob+fof7Q/9cRU3j4UDA/pG/G42hAvgWKz1QJ6
         5fBx7IqMX94LLlHvsSyiLDtotxLWszCut4pp4enAmaf+WEmcygJsDHRQphv9byx8+Aad
         ZWumfaLhiKbj4zFRB0z9uy6+6g0G0SVqySfI4G8g7asd/uXPRdYPdJkoKeI6UrY0ZA9l
         TJsA==
X-Gm-Message-State: ABy/qLaXeqbRj2ocozqmqDk6evXB9jTQpuqPOCoSchImISII9FkIB7/Y
	vNBHTPCon6kiBp2+G2odlgU=
X-Google-Smtp-Source: APBJJlGpggWKl9mhx1f6cNzYJrVg2oqym/Xg0n0t+vhY+yg/UIrQUebANCL8UUu/vWaCrzFFriLNMw==
X-Received: by 2002:a25:844f:0:b0:cf0:b977:2794 with SMTP id r15-20020a25844f000000b00cf0b9772794mr10487441ybm.30.1690258866444;
        Mon, 24 Jul 2023 21:21:06 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Huacai Chen <chenhuacai@kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Dinh Nguyen <dinguyen@kernel.org>,
	Jonas Bonn <jonas@southpole.se>,
	David Hildenbrand <david@redhat.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	"David S. Miller" <davem@davemloft.net>,
	Richard Weinberger <richard@nod.at>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Christophe Leroy <christophe.leroy@csgroup.eu>
Subject: [PATCH mm-unstable v7 00/31] Split ptdesc from struct page
Date: Mon, 24 Jul 2023 21:20:20 -0700
Message-Id: <20230725042051.36691-1-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The MM subsystem is trying to shrink struct page. This patchset
introduces a memory descriptor for page table tracking - struct ptdesc.

This patchset introduces ptdesc, splits ptdesc from struct page, and
converts many callers of page table constructor/destructors to use ptdescs.

Ptdesc is a foundation to further standardize page tables, and eventually
allow for dynamic allocation of page tables independent of struct page.
However, the use of pages for page table tracking is quite deeply
ingrained and varied across archictectures, so there is still a lot of
work to be done before that can happen.

This is rebased on mm-unstable.

v7:
  Drop s390 gmap ptdesc conversions - gmap is unecessary complication
    that can be dealt with later
  Be more thorough with ptdesc struct sanity checks and comments
  Rebase onto mm-unstable

Vishal Moola (Oracle) (31):
  mm: Add PAGE_TYPE_OP folio functions
  pgtable: Create struct ptdesc
  mm: add utility functions for ptdesc
  mm: Convert pmd_pgtable_page() callers to use pmd_ptdesc()
  mm: Convert ptlock_alloc() to use ptdescs
  mm: Convert ptlock_ptr() to use ptdescs
  mm: Convert pmd_ptlock_init() to use ptdescs
  mm: Convert ptlock_init() to use ptdescs
  mm: Convert pmd_ptlock_free() to use ptdescs
  mm: Convert ptlock_free() to use ptdescs
  mm: Create ptdesc equivalents for pgtable_{pte,pmd}_page_{ctor,dtor}
  powerpc: Convert various functions to use ptdescs
  x86: Convert various functions to use ptdescs
  s390: Convert various pgalloc functions to use ptdescs
  mm: Remove page table members from struct page
  pgalloc: Convert various functions to use ptdescs
  arm: Convert various functions to use ptdescs
  arm64: Convert various functions to use ptdescs
  csky: Convert __pte_free_tlb() to use ptdescs
  hexagon: Convert __pte_free_tlb() to use ptdescs
  loongarch: Convert various functions to use ptdescs
  m68k: Convert various functions to use ptdescs
  mips: Convert various functions to use ptdescs
  nios2: Convert __pte_free_tlb() to use ptdescs
  openrisc: Convert __pte_free_tlb() to use ptdescs
  riscv: Convert alloc_{pmd, pte}_late() to use ptdescs
  sh: Convert pte_free_tlb() to use ptdescs
  sparc64: Convert various functions to use ptdescs
  sparc: Convert pgtable_pte_page_{ctor, dtor}() to ptdesc equivalents
  um: Convert {pmd, pte}_free_tlb() to use ptdescs
  mm: Remove pgtable_{pmd, pte}_page_{ctor, dtor}() wrappers

 Documentation/mm/split_page_table_lock.rst    |  12 +-
 .../zh_CN/mm/split_page_table_lock.rst        |  14 +-
 arch/arm/include/asm/tlb.h                    |  12 +-
 arch/arm/mm/mmu.c                             |   7 +-
 arch/arm64/include/asm/tlb.h                  |  14 +-
 arch/arm64/mm/mmu.c                           |   7 +-
 arch/csky/include/asm/pgalloc.h               |   4 +-
 arch/hexagon/include/asm/pgalloc.h            |   8 +-
 arch/loongarch/include/asm/pgalloc.h          |  27 ++--
 arch/loongarch/mm/pgtable.c                   |   7 +-
 arch/m68k/include/asm/mcf_pgalloc.h           |  47 +++---
 arch/m68k/include/asm/sun3_pgalloc.h          |   8 +-
 arch/m68k/mm/motorola.c                       |   4 +-
 arch/mips/include/asm/pgalloc.h               |  32 ++--
 arch/mips/mm/pgtable.c                        |   8 +-
 arch/nios2/include/asm/pgalloc.h              |   8 +-
 arch/openrisc/include/asm/pgalloc.h           |   8 +-
 arch/powerpc/mm/book3s64/mmu_context.c        |  10 +-
 arch/powerpc/mm/book3s64/pgtable.c            |  32 ++--
 arch/powerpc/mm/pgtable-frag.c                |  56 +++----
 arch/riscv/include/asm/pgalloc.h              |   8 +-
 arch/riscv/mm/init.c                          |  16 +-
 arch/s390/include/asm/pgalloc.h               |   4 +-
 arch/s390/include/asm/tlb.h                   |   4 +-
 arch/s390/mm/pgalloc.c                        | 128 +++++++--------
 arch/sh/include/asm/pgalloc.h                 |   9 +-
 arch/sparc/mm/init_64.c                       |  17 +-
 arch/sparc/mm/srmmu.c                         |   5 +-
 arch/um/include/asm/pgalloc.h                 |  18 +--
 arch/x86/mm/pgtable.c                         |  47 +++---
 arch/x86/xen/mmu_pv.c                         |   2 +-
 include/asm-generic/pgalloc.h                 |  88 +++++-----
 include/asm-generic/tlb.h                     |  11 ++
 include/linux/mm.h                            | 151 +++++++++++++-----
 include/linux/mm_types.h                      |  18 ---
 include/linux/page-flags.h                    |  30 +++-
 include/linux/pgtable.h                       |  80 ++++++++++
 mm/memory.c                                   |   8 +-
 38 files changed, 585 insertions(+), 384 deletions(-)

-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:21:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:21:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569357.889816 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Xw-0002cG-1W; Tue, 25 Jul 2023 04:21:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569357.889816; Tue, 25 Jul 2023 04:21:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Xv-0002bP-QI; Tue, 25 Jul 2023 04:21:15 +0000
Received: by outflank-mailman (input) for mailman id 569357;
 Tue, 25 Jul 2023 04:21:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Xu-0002Iw-SZ
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:14 +0000
Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com
 [2607:f8b0:4864:20::b36])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b0e9c554-2aa2-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 06:21:14 +0200 (CEST)
Received: by mail-yb1-xb36.google.com with SMTP id
 3f1490d57ef6-ccc462deca6so5718693276.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:14 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.11
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b0e9c554-2aa2-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258873; x=1690863673;
        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=VFdcrIV5fIYEpRddOkWey4lp7uyipkLol3FVSysO4BI=;
        b=s2BAwwv8oUl+Hs1v7tcLJQyKdVwJshh+4MpeNVgW1JpMCfNsHy0yAipjGg5nDC4TQ3
         JkHdARTanKtpCG9rN/oS8YzJfpPRNx6XW3JcMNzfdGZFEFJtnvS7vhAwLgXYeaHpX4H5
         NJaLuVvVp94MScMO0B9PaYwNUr2ulC3xrBpZ+CyDbAB9PpgdPgDL4PRuM4CqBe7/ffTt
         TmfnC+ju4A6ouW55J0uzsReFyd+IYIWUEILsrpu+20SnVPwPWzbnSxYO46LPY8/Yv8hj
         xJ022X/2C2f6wqhTFayqxrRvwC61r0RZYX59fEcwS+AuUkwZ6FlssTAYS5BT87g2jU8h
         4qTw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258873; x=1690863673;
        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=VFdcrIV5fIYEpRddOkWey4lp7uyipkLol3FVSysO4BI=;
        b=Z/XI1mamp4mmDvd17RjDZBFkaCcdpPtl+fIhMQpXR2pHcl+auFVzUEqVNLSrvCdtay
         xLYp9GUA4+y4VlHpzK+RI6bAucHQ5xD1kGoIZqWi//czpaLZn40vadf7NShymsFr34OT
         VLCbUwjzBL5MY0gdJ8/q4xovYLMtRRtxLy/ID9V6/85zW1rUL14KGx11RNVOYVOt7jsL
         aKxyiM2pKZJDsP9kgtSfTYVtIGeEJAg7ZlJWi7I4FO+ti+SY20DaeH3fjMoy2YfvIUVT
         P8Xizld8j7wxs/ODhnb+WZM+pAAyQefhcavWIE1xpaZw6CYBtUZ7AiAeTDHZyYgVyrdK
         lvuA==
X-Gm-Message-State: ABy/qLY6Pt94TNgHcdJ4RBBabNjBZO02s788pkc0dL0nRuEOw3W/45vi
	gSymTicy5mFCl5apa16yLCU=
X-Google-Smtp-Source: APBJJlEljmstle/55h2Wn4YBOHbmslxxkZ+0xzy95w3akZzqV4BQHNPNvPKRyocnj15MdoqDrOBO8w==
X-Received: by 2002:a25:1e09:0:b0:d05:2b13:aec9 with SMTP id e9-20020a251e09000000b00d052b13aec9mr8919211ybe.23.1690258873123;
        Mon, 24 Jul 2023 21:21:13 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>
Subject: [PATCH mm-unstable v7 03/31] mm: add utility functions for ptdesc
Date: Mon, 24 Jul 2023 21:20:23 -0700
Message-Id: <20230725042051.36691-4-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Introduce utility functions setting the foundation for ptdescs. These
will also assist in the splitting out of ptdesc from struct page.

Functions that focus on the descriptor are prefixed with ptdesc_* while
functions that focus on the pagetable are prefixed with pagetable_*.

pagetable_alloc() is defined to allocate new ptdesc pages as compound
pages. This is to standardize ptdescs by allowing for one allocation
and one free function, in contrast to 2 allocation and 2 free functions.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
---
 include/asm-generic/tlb.h | 11 +++++++
 include/linux/mm.h        | 61 +++++++++++++++++++++++++++++++++++++++
 include/linux/pgtable.h   | 12 ++++++++
 3 files changed, 84 insertions(+)

diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index bc32a2284c56..129a3a759976 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -480,6 +480,17 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
 	return tlb_remove_page_size(tlb, page, PAGE_SIZE);
 }
 
+static inline void tlb_remove_ptdesc(struct mmu_gather *tlb, void *pt)
+{
+	tlb_remove_table(tlb, pt);
+}
+
+/* Like tlb_remove_ptdesc, but for page-like page directories. */
+static inline void tlb_remove_page_ptdesc(struct mmu_gather *tlb, struct ptdesc *pt)
+{
+	tlb_remove_page(tlb, ptdesc_page(pt));
+}
+
 static inline void tlb_change_page_size(struct mmu_gather *tlb,
 						     unsigned int page_size)
 {
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 2ba73f09ae4a..3fda0ad41cf2 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2787,6 +2787,57 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a
 }
 #endif /* CONFIG_MMU */
 
+static inline struct ptdesc *virt_to_ptdesc(const void *x)
+{
+	return page_ptdesc(virt_to_page(x));
+}
+
+static inline void *ptdesc_to_virt(const struct ptdesc *pt)
+{
+	return page_to_virt(ptdesc_page(pt));
+}
+
+static inline void *ptdesc_address(const struct ptdesc *pt)
+{
+	return folio_address(ptdesc_folio(pt));
+}
+
+static inline bool pagetable_is_reserved(struct ptdesc *pt)
+{
+	return folio_test_reserved(ptdesc_folio(pt));
+}
+
+/**
+ * pagetable_alloc - Allocate pagetables
+ * @gfp:    GFP flags
+ * @order:  desired pagetable order
+ *
+ * pagetable_alloc allocates memory for page tables as well as a page table
+ * descriptor to describe that memory.
+ *
+ * Return: The ptdesc describing the allocated page tables.
+ */
+static inline struct ptdesc *pagetable_alloc(gfp_t gfp, unsigned int order)
+{
+	struct page *page = alloc_pages(gfp | __GFP_COMP, order);
+
+	return page_ptdesc(page);
+}
+
+/**
+ * pagetable_free - Free pagetables
+ * @pt:	The page table descriptor
+ *
+ * pagetable_free frees the memory of all page tables described by a page
+ * table descriptor and the memory for the descriptor itself.
+ */
+static inline void pagetable_free(struct ptdesc *pt)
+{
+	struct page *page = ptdesc_page(pt);
+
+	__free_pages(page, compound_order(page));
+}
+
 #if USE_SPLIT_PTE_PTLOCKS
 #if ALLOC_SPLIT_PTLOCKS
 void __init ptlock_cache_init(void);
@@ -2913,6 +2964,11 @@ static inline struct page *pmd_pgtable_page(pmd_t *pmd)
 	return virt_to_page((void *)((unsigned long) pmd & mask));
 }
 
+static inline struct ptdesc *pmd_ptdesc(pmd_t *pmd)
+{
+	return page_ptdesc(pmd_pgtable_page(pmd));
+}
+
 static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd)
 {
 	return ptlock_ptr(pmd_pgtable_page(pmd));
@@ -3025,6 +3081,11 @@ static inline void mark_page_reserved(struct page *page)
 	adjust_managed_page_count(page, -1);
 }
 
+static inline void free_reserved_ptdesc(struct ptdesc *pt)
+{
+	free_reserved_page(ptdesc_page(pt));
+}
+
 /*
  * Default method to free all the __init memory into the buddy system.
  * The freed pages will be poisoned with pattern "poison" if it's within
diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
index 1f92514d54b0..250fdeba68f3 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
@@ -1064,6 +1064,18 @@ TABLE_MATCH(memcg_data, pt_memcg_data);
 #undef TABLE_MATCH
 static_assert(sizeof(struct ptdesc) <= sizeof(struct page));
 
+#define ptdesc_page(pt)			(_Generic((pt),			\
+	const struct ptdesc *:		(const struct page *)(pt),	\
+	struct ptdesc *:		(struct page *)(pt)))
+
+#define ptdesc_folio(pt)		(_Generic((pt),			\
+	const struct ptdesc *:		(const struct folio *)(pt),	\
+	struct ptdesc *:		(struct folio *)(pt)))
+
+#define page_ptdesc(p)			(_Generic((p),			\
+	const struct page *:		(const struct ptdesc *)(p),	\
+	struct page *:			(struct ptdesc *)(p)))
+
 /*
  * No-op macros that just return the current protection value. Defined here
  * because these macros can be used even if CONFIG_MMU is not defined.
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:21:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:21:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569355.889800 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Xu-0002JH-Fe; Tue, 25 Jul 2023 04:21:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569355.889800; Tue, 25 Jul 2023 04:21:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Xu-0002J6-An; Tue, 25 Jul 2023 04:21:14 +0000
Received: by outflank-mailman (input) for mailman id 569355;
 Tue, 25 Jul 2023 04:21:11 +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
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Xr-00023t-Gs
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:11 +0000
Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com
 [2607:f8b0:4864:20::b2a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ae3b0ebb-2aa2-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:21:09 +0200 (CEST)
Received: by mail-yb1-xb2a.google.com with SMTP id
 3f1490d57ef6-cf284f4d7afso5663482276.3
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:09 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ae3b0ebb-2aa2-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258868; x=1690863668;
        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=DXYENedStYVsFXpaqy8X3+wmlabVR1q8JHyD5+dxFj0=;
        b=NIGVZvXp4f6PI/DiyEOXr4f5A6/bm955BIOhiZOHaf2xh+RIldWqkGVwj9eR6s7h/D
         u8onvMaEHJrYU/HCUYvuGCCHfNRwQcrgAf2DqnNwPmYZKfV6oX/8zUa5Ig2Q+OQW0ypq
         XPjKaW0SZdhI5qLkWxfkcfI+eeyw8wOays1ttc+jYPlhsNlhP4uKwb+dfDR5nCYKuXl2
         +XMxk/OSmgfJy9dL/mFwEgWIg+fhMPrVsdF2dCpA0ebzWdyAhRP+4N95J6UWvMmJ+uKs
         yf/le1oPMyKhHzKGvzlCs3EuPlXqwgoKoHDer5fRkFbOxeVLftXul8Z+3F07FK5C3JFa
         Y2Rw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258868; x=1690863668;
        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=DXYENedStYVsFXpaqy8X3+wmlabVR1q8JHyD5+dxFj0=;
        b=bmnxiiVaX2ngYRYJJgQ+mug9jOyeGMlgvYY4FiANy9nQ1eE+xJPcA24ZeVewswS+Jy
         zXMOQpbNZL3RGzgApW4gWF+kJSTBkmLRhVBxRktiDGPOP+N3laa1G3RnLDofWhjaJ69+
         m0seDyp9mbcjwfYu+O3g2GaaIUgthh39rv+e+iUaPMtwShOWvwuirWj+3PSEwX7X5gTx
         ux0nG1+AeawhZXqmUwGw8GMc+Z5aHaPtWp+4nWH/3E0BwsXvc1NIzu6R3h3UphdhYiz0
         21h8eILGF682rkhhxAJXNEeuzq6pTd4+HUv0O81FP4rt4fiFPQdd1i4/6K9UPV7wfwyF
         lcow==
X-Gm-Message-State: ABy/qLbFluIiWyKRe0C0lrybhZ+rBSX3N1iwpJOtp4YsuVYuajOf9g87
	lgSHFYMpWXmerGJ5E/Y+oEk=
X-Google-Smtp-Source: APBJJlFMeQGxec1oJDVWQUYg3sII69ysVmGK3iC6jxP+dksIpqg/98z6796G6YK9NBoYSePtafE2Ug==
X-Received: by 2002:a25:7ac6:0:b0:c5e:d3af:35cb with SMTP id v189-20020a257ac6000000b00c5ed3af35cbmr8904739ybc.42.1690258868599;
        Mon, 24 Jul 2023 21:21:08 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 01/31] mm: Add PAGE_TYPE_OP folio functions
Date: Mon, 24 Jul 2023 21:20:21 -0700
Message-Id: <20230725042051.36691-2-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

No folio equivalents for page type operations have been defined, so
define them for later folio conversions.

Also changes the Page##uname macros to take in const struct page* since
we only read the memory here.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/page-flags.h | 30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 92a2063a0a23..9218028caf33 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -908,6 +908,8 @@ static inline bool is_page_hwpoison(struct page *page)
 
 #define PageType(page, flag)						\
 	((page->page_type & (PAGE_TYPE_BASE | flag)) == PAGE_TYPE_BASE)
+#define folio_test_type(folio, flag)					\
+	((folio->page.page_type & (PAGE_TYPE_BASE | flag)) == PAGE_TYPE_BASE)
 
 static inline int page_type_has_type(unsigned int page_type)
 {
@@ -919,27 +921,41 @@ static inline int page_has_type(struct page *page)
 	return page_type_has_type(page->page_type);
 }
 
-#define PAGE_TYPE_OPS(uname, lname)					\
-static __always_inline int Page##uname(struct page *page)		\
+#define PAGE_TYPE_OPS(uname, lname, fname)				\
+static __always_inline int Page##uname(const struct page *page)		\
 {									\
 	return PageType(page, PG_##lname);				\
 }									\
+static __always_inline int folio_test_##fname(const struct folio *folio)\
+{									\
+	return folio_test_type(folio, PG_##lname);			\
+}									\
 static __always_inline void __SetPage##uname(struct page *page)		\
 {									\
 	VM_BUG_ON_PAGE(!PageType(page, 0), page);			\
 	page->page_type &= ~PG_##lname;					\
 }									\
+static __always_inline void __folio_set_##fname(struct folio *folio)	\
+{									\
+	VM_BUG_ON_FOLIO(!folio_test_type(folio, 0), folio);		\
+	folio->page.page_type &= ~PG_##lname;				\
+}									\
 static __always_inline void __ClearPage##uname(struct page *page)	\
 {									\
 	VM_BUG_ON_PAGE(!Page##uname(page), page);			\
 	page->page_type |= PG_##lname;					\
-}
+}									\
+static __always_inline void __folio_clear_##fname(struct folio *folio)	\
+{									\
+	VM_BUG_ON_FOLIO(!folio_test_##fname(folio), folio);		\
+	folio->page.page_type |= PG_##lname;				\
+}									\
 
 /*
  * PageBuddy() indicates that the page is free and in the buddy system
  * (see mm/page_alloc.c).
  */
-PAGE_TYPE_OPS(Buddy, buddy)
+PAGE_TYPE_OPS(Buddy, buddy, buddy)
 
 /*
  * PageOffline() indicates that the page is logically offline although the
@@ -963,7 +979,7 @@ PAGE_TYPE_OPS(Buddy, buddy)
  * pages should check PageOffline() and synchronize with such drivers using
  * page_offline_freeze()/page_offline_thaw().
  */
-PAGE_TYPE_OPS(Offline, offline)
+PAGE_TYPE_OPS(Offline, offline, offline)
 
 extern void page_offline_freeze(void);
 extern void page_offline_thaw(void);
@@ -973,12 +989,12 @@ extern void page_offline_end(void);
 /*
  * Marks pages in use as page tables.
  */
-PAGE_TYPE_OPS(Table, table)
+PAGE_TYPE_OPS(Table, table, pgtable)
 
 /*
  * Marks guardpages used with debug_pagealloc.
  */
-PAGE_TYPE_OPS(Guard, guard)
+PAGE_TYPE_OPS(Guard, guard, guard)
 
 extern bool is_free_buddy_page(struct page *page);
 
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:21:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:21:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569356.889810 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Xv-0002Yc-M9; Tue, 25 Jul 2023 04:21:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569356.889810; Tue, 25 Jul 2023 04:21:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Xv-0002YV-Hi; Tue, 25 Jul 2023 04:21:15 +0000
Received: by outflank-mailman (input) for mailman id 569356;
 Tue, 25 Jul 2023 04:21:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Xu-0002Iw-AT
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:14 +0000
Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com
 [2607:f8b0:4864:20::b35])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id afa6f1d4-2aa2-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 06:21:12 +0200 (CEST)
Received: by mail-yb1-xb35.google.com with SMTP id
 3f1490d57ef6-d129edb8261so1957794276.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:12 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.08
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:10 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: afa6f1d4-2aa2-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258871; x=1690863671;
        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=Z39OytypuZQhWkFCV+z6u8l5O5ZgTP/vsQXKA5JsO6g=;
        b=nfSBxZc3bItW8IdMBLL+dSGF/sScmKpt0AcwakiFztIyJApvwUouFBq2QYNw8J0rTh
         aGOyeE8+hHOVNRFF4WnJZ/JBfvYsJ6/Oqtf1pd4yYE50HlUq0kH3gRbnZoqyUUw5UiUt
         9BiNVm/Jcmu4oBRAf0Ghv+POnWAvJRL2FAU4oS0kRbRMToMj9LqJMWXwLu8fKfr8IAjj
         wOqfUiwKX3V5nYlU7QswO3bA3PxVILROT4IFFlX3tqCczMBU5TNT3JSvKElDhd9S0f0I
         IVPRDxFnKb0Q83Ir8UwSfLZr1e3Lc2Zl/QQj5qJvJK7JbaWdiWhNWfmCQ7brLh/spl2P
         pUgA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258871; x=1690863671;
        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=Z39OytypuZQhWkFCV+z6u8l5O5ZgTP/vsQXKA5JsO6g=;
        b=UN8WEXNB8EB4nMx4YOVaTpo6NtqqCEXBenbQSzlsLpM2Rk4yo81UzLr7Xv1PDcIlaL
         Haz2faIYZ+RCAWveg+ZTrtSzQUL83XzxwDCjZlwGK4k6/6lWirQ6FyfmlV4QhJlXKTCy
         RKlCrMIOfAeKcchXp3Xj4h+ldixgovMJVNS93vk0Tm5ZWuYWApjW16NKplCsagZsrVtK
         ECHtLKU+Xb1ngmO6kjhi+JrmyM8k/P8IzJ4/vJTkboTx9GyVb3zEQzMAGGjnvPujppqM
         XNh5N9yE8GxdDZljGAIGB/oWNANCC3r8bOrHoWH8lns8EzGL9jrPGdIuGVG3iuIQM4Pj
         a+Pg==
X-Gm-Message-State: ABy/qLaTKwKEw3fXj55MD7ERYjhTC2G1Jvy+nTAXigzzXownaAzrRUNO
	6bl4G2BgJCx8fyAAa6hRtTw=
X-Google-Smtp-Source: APBJJlH3lH39robuGI5LChDr8WX6p02zic6DdoBpY//WhDEwtiPShXvAKethMDx9GI6ybtlOyIPsYw==
X-Received: by 2002:a25:b4c:0:b0:cb7:a41e:be58 with SMTP id 73-20020a250b4c000000b00cb7a41ebe58mr1296053ybl.23.1690258870978;
        Mon, 24 Jul 2023 21:21:10 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 02/31] pgtable: Create struct ptdesc
Date: Mon, 24 Jul 2023 21:20:22 -0700
Message-Id: <20230725042051.36691-3-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Currently, page table information is stored within struct page. As part
of simplifying struct page, create struct ptdesc for page table
information.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/pgtable.h | 71 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
index 5f36c055794b..1f92514d54b0 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
@@ -993,6 +993,77 @@ static inline void ptep_modify_prot_commit(struct vm_area_struct *vma,
 #endif /* __HAVE_ARCH_PTEP_MODIFY_PROT_TRANSACTION */
 #endif /* CONFIG_MMU */
 
+
+/**
+ * struct ptdesc -    Memory descriptor for page tables.
+ * @__page_flags:     Same as page flags. Unused for page tables.
+ * @pt_rcu_head:      For freeing page table pages.
+ * @pt_list:          List of used page tables. Used for s390 and x86.
+ * @_pt_pad_1:        Padding that aliases with page's compound head.
+ * @pmd_huge_pte:     Protected by ptdesc->ptl, used for THPs.
+ * @__page_mapping:   Aliases with page->mapping. Unused for page tables.
+ * @pt_mm:            Used for x86 pgds.
+ * @pt_frag_refcount: For fragmented page table tracking. Powerpc and s390 only.
+ * @_pt_pad_2:        Padding to ensure proper alignment.
+ * @ptl:              Lock for the page table.
+ * @__page_type:      Same as page->page_type. Unused for page tables.
+ * @_refcount:        Same as page refcount. Used for s390 page tables.
+ * @pt_memcg_data:    Memcg data. Tracked for page tables here.
+ *
+ * This struct overlays struct page for now. Do not modify without a good
+ * understanding of the issues.
+ */
+struct ptdesc {
+	unsigned long __page_flags;
+
+	union {
+		struct rcu_head pt_rcu_head;
+		struct list_head pt_list;
+		struct {
+			unsigned long _pt_pad_1;
+			pgtable_t pmd_huge_pte;
+		};
+	};
+	unsigned long __page_mapping;
+
+	union {
+		struct mm_struct *pt_mm;
+		atomic_t pt_frag_refcount;
+	};
+
+	union {
+		unsigned long _pt_pad_2;
+#if ALLOC_SPLIT_PTLOCKS
+		spinlock_t *ptl;
+#else
+		spinlock_t ptl;
+#endif
+	};
+	unsigned int __page_type;
+	atomic_t _refcount;
+#ifdef CONFIG_MEMCG
+	unsigned long pt_memcg_data;
+#endif
+};
+
+#define TABLE_MATCH(pg, pt)						\
+	static_assert(offsetof(struct page, pg) == offsetof(struct ptdesc, pt))
+TABLE_MATCH(flags, __page_flags);
+TABLE_MATCH(compound_head, pt_list);
+TABLE_MATCH(compound_head, _pt_pad_1);
+TABLE_MATCH(pmd_huge_pte, pmd_huge_pte);
+TABLE_MATCH(mapping, __page_mapping);
+TABLE_MATCH(pt_mm, pt_mm);
+TABLE_MATCH(ptl, ptl);
+TABLE_MATCH(rcu_head, pt_rcu_head);
+TABLE_MATCH(page_type, __page_type);
+TABLE_MATCH(_refcount, _refcount);
+#ifdef CONFIG_MEMCG
+TABLE_MATCH(memcg_data, pt_memcg_data);
+#endif
+#undef TABLE_MATCH
+static_assert(sizeof(struct ptdesc) <= sizeof(struct page));
+
 /*
  * No-op macros that just return the current protection value. Defined here
  * because these macros can be used even if CONFIG_MMU is not defined.
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:21:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:21:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569359.889840 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Y1-0003Pv-LQ; Tue, 25 Jul 2023 04:21:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569359.889840; Tue, 25 Jul 2023 04:21:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Y1-0003Pi-Hs; Tue, 25 Jul 2023 04:21:21 +0000
Received: by outflank-mailman (input) for mailman id 569359;
 Tue, 25 Jul 2023 04:21:20 +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
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Y0-00023t-2w
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:20 +0000
Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com
 [2607:f8b0:4864:20::b33])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b35b6c95-2aa2-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:21:18 +0200 (CEST)
Received: by mail-yb1-xb33.google.com with SMTP id
 3f1490d57ef6-c5f98fc4237so4296915276.2
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:18 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.15
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b35b6c95-2aa2-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258877; x=1690863677;
        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=hLtCJBysrabsGyMeKlbK2lKTjEzHhmjaMpElw0hOQuQ=;
        b=gPFq/JoYwJjLf9rVCoB8Lw8LOssqafkFQKm1MRAos7/YFfmCVQ5zZtnC0rhhBdQCXk
         N7cP2rb2Gc3I1sIFDEA6WDVqpFvuzV9g0ksMwxcFOLrW1SrVCbGbF2JEMKH7iGrlo6kh
         szCDqr3K9qHITaCMG+6I4Bv2DGuidVlNjZotb70C80Hqf3ER0SLHbbdax/uMFjYuJbcP
         w5E647QIdwTWza0fMIXSMCOI01eppzdj1zv2JddPFf9pPmBUxHnIhf/jhE5I9HeeHTOn
         pGU0qrcAaECYa9O8B/YJzvoVn8SSXjyAEPRTA5PEQfVza6O4EJzAJ9koweASwJRx6Tml
         xocw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258877; x=1690863677;
        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=hLtCJBysrabsGyMeKlbK2lKTjEzHhmjaMpElw0hOQuQ=;
        b=fVm+YVde7wtk5wNM/RDXS3otVozwUp66OTekU3jCci4u1gSZWyT01cCkYxELM5FvvN
         RSPxGfgwLt0g+rCUClYJl+xzFR88VbEMGwT3XTu40GbA1lHJN/n9fZVZGPo8f4mDNlGT
         6t6m5ma+yP494NNCECeA4UHCC8hzbW08EXFEA8Xd22LNUOPX3263bDLDX+qnj5be1ODc
         jBaYlMPDg1OPGLwaUGQD9yoeQwU0JmzeS/cU8kezdd7vJhj2Gx6DBYLSixUn74OBS9wE
         86jPIwASO+ACjXnnesHkBwuQDuBti8vXzzF8rfL6AqxC4w9fh40XIOhkq3cs4jW7dE5y
         +NAQ==
X-Gm-Message-State: ABy/qLa1sty+YjiJs+gymQey+vIWFrYNBFFtLOtDkMfnl5pXq0XuW194
	1l+gmuLTKYpNgYFzgouhdtQ=
X-Google-Smtp-Source: APBJJlHyqmJ7X8HSspT6LddsJqdqN9Il/WFvcTF4BUwycttfbECYy8j8wA/EIsdExukzdWEa0jT4RQ==
X-Received: by 2002:a25:4cca:0:b0:d01:52da:9625 with SMTP id z193-20020a254cca000000b00d0152da9625mr7877273yba.13.1690258877265;
        Mon, 24 Jul 2023 21:21:17 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 05/31] mm: Convert ptlock_alloc() to use ptdescs
Date: Mon, 24 Jul 2023 21:20:25 -0700
Message-Id: <20230725042051.36691-6-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This removes some direct accesses to struct page, working towards
splitting out struct ptdesc from struct page.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/mm.h | 6 +++---
 mm/memory.c        | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index bf552a106e4a..b3fce0bfe201 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2841,7 +2841,7 @@ static inline void pagetable_free(struct ptdesc *pt)
 #if USE_SPLIT_PTE_PTLOCKS
 #if ALLOC_SPLIT_PTLOCKS
 void __init ptlock_cache_init(void);
-extern bool ptlock_alloc(struct page *page);
+bool ptlock_alloc(struct ptdesc *ptdesc);
 extern void ptlock_free(struct page *page);
 
 static inline spinlock_t *ptlock_ptr(struct page *page)
@@ -2853,7 +2853,7 @@ static inline void ptlock_cache_init(void)
 {
 }
 
-static inline bool ptlock_alloc(struct page *page)
+static inline bool ptlock_alloc(struct ptdesc *ptdesc)
 {
 	return true;
 }
@@ -2883,7 +2883,7 @@ static inline bool ptlock_init(struct page *page)
 	 * slab code uses page->slab_cache, which share storage with page->ptl.
 	 */
 	VM_BUG_ON_PAGE(*(unsigned long *)&page->ptl, page);
-	if (!ptlock_alloc(page))
+	if (!ptlock_alloc(page_ptdesc(page)))
 		return false;
 	spin_lock_init(ptlock_ptr(page));
 	return true;
diff --git a/mm/memory.c b/mm/memory.c
index 2130bad76eb1..4fee273595e2 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -6231,14 +6231,14 @@ void __init ptlock_cache_init(void)
 			SLAB_PANIC, NULL);
 }
 
-bool ptlock_alloc(struct page *page)
+bool ptlock_alloc(struct ptdesc *ptdesc)
 {
 	spinlock_t *ptl;
 
 	ptl = kmem_cache_alloc(page_ptl_cachep, GFP_KERNEL);
 	if (!ptl)
 		return false;
-	page->ptl = ptl;
+	ptdesc->ptl = ptl;
 	return true;
 }
 
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:21:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:21:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569360.889850 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Y4-0003jY-00; Tue, 25 Jul 2023 04:21:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569360.889850; Tue, 25 Jul 2023 04:21:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Y3-0003jM-Pj; Tue, 25 Jul 2023 04:21:23 +0000
Received: by outflank-mailman (input) for mailman id 569360;
 Tue, 25 Jul 2023 04:21:22 +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
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Y1-00023t-Vq
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:21 +0000
Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com
 [2607:f8b0:4864:20::b35])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b48fc086-2aa2-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:21:20 +0200 (CEST)
Received: by mail-yb1-xb35.google.com with SMTP id
 3f1490d57ef6-c11e2b31b95so5469540276.3
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:20 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b48fc086-2aa2-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258879; x=1690863679;
        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=uNVCmnQN0ufsotHop6mLPsVoSXSsgvYy2QMaIqEOqi4=;
        b=KDYHcYEdfvpzUEFX0lNkksdcmQYTfb1isarY0fEljmc2IAYrJ5nDDg/7JZU04JTP3L
         c1QFP/HGIvTwW+tPYnlNpNTf+bNvT4Orf2hELyP6ANZ15n2MuBFPHNYtsv0S4hi5lotS
         plPoF0Qd+eEXR5m8DnmPEfjKpZQYq5r/wJZjYdNGeMiNfjBcVsPF+85ffm8Hp1058zGf
         E5mhpdv5sROIr4fRE4AWEGFCJJhFOSPgScin1k95zzp/7dsKEN0qwGECqGpXVDa6nTcU
         k6so3Cygyv6WxOWRYm0T8muDY8KTb9y3edYXGJvaWKcZYnoxLAplBnufWrEfQhIBMbq5
         IGpg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258879; x=1690863679;
        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=uNVCmnQN0ufsotHop6mLPsVoSXSsgvYy2QMaIqEOqi4=;
        b=PUUxBuxE2nIxzV22Nq0qk7Ipq+Kh+YdnvdxLspBpxFEwgG0hHwaZqhrexIg82+rDIP
         SMh7U6TKELBQuRmM90x/AlW/ShYyf6Zi3E9sQ9/DypaemTXMoANFGhP/aDu4oUFiVduk
         eCIHP22FYgb57DPFlJfvMmhG/mbzugbor9PGweEy/2s4HXc5kgJ+Jy1TFA4iR66AC4wE
         iQX9UJoOgUufooiMY9pGxREoy259aT0VwJuXwPuyDBc245Z0jOQ/sTEg/9SsTACBOnaL
         vW9rr9HLum4CTPbpkAB9NUBPp7F0ImmQvYlAjDxfUfDFotvB6CuK6/eFoM9ylTnyWStX
         ascQ==
X-Gm-Message-State: ABy/qLYwld4P5fPoDs/f2thUHfM1MtW2b8so64kyYn0DL4Wa1e+JjH1R
	B2veSwMQLGpufAX2U7cJE+GlPRLi3MxIeA==
X-Google-Smtp-Source: APBJJlEiFrFEbevAO9Lv8rv0gB/m4nTd0LDSBWnZ0KZCrLtO0+gMBzxp+Bweq5U88z1Cb1Q1T0NNwg==
X-Received: by 2002:a5b:cd2:0:b0:c1b:d362:4b49 with SMTP id e18-20020a5b0cd2000000b00c1bd3624b49mr9588966ybr.50.1690258879241;
        Mon, 24 Jul 2023 21:21:19 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 06/31] mm: Convert ptlock_ptr() to use ptdescs
Date: Mon, 24 Jul 2023 21:20:26 -0700
Message-Id: <20230725042051.36691-7-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This removes some direct accesses to struct page, working towards
splitting out struct ptdesc from struct page.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/x86/xen/mmu_pv.c |  2 +-
 include/linux/mm.h    | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c
index e0a975165de7..8796ec310483 100644
--- a/arch/x86/xen/mmu_pv.c
+++ b/arch/x86/xen/mmu_pv.c
@@ -667,7 +667,7 @@ static spinlock_t *xen_pte_lock(struct page *page, struct mm_struct *mm)
 	spinlock_t *ptl = NULL;
 
 #if USE_SPLIT_PTE_PTLOCKS
-	ptl = ptlock_ptr(page);
+	ptl = ptlock_ptr(page_ptdesc(page));
 	spin_lock_nest_lock(ptl, &mm->page_table_lock);
 #endif
 
diff --git a/include/linux/mm.h b/include/linux/mm.h
index b3fce0bfe201..c155f82dd2cc 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2844,9 +2844,9 @@ void __init ptlock_cache_init(void);
 bool ptlock_alloc(struct ptdesc *ptdesc);
 extern void ptlock_free(struct page *page);
 
-static inline spinlock_t *ptlock_ptr(struct page *page)
+static inline spinlock_t *ptlock_ptr(struct ptdesc *ptdesc)
 {
-	return page->ptl;
+	return ptdesc->ptl;
 }
 #else /* ALLOC_SPLIT_PTLOCKS */
 static inline void ptlock_cache_init(void)
@@ -2862,15 +2862,15 @@ static inline void ptlock_free(struct page *page)
 {
 }
 
-static inline spinlock_t *ptlock_ptr(struct page *page)
+static inline spinlock_t *ptlock_ptr(struct ptdesc *ptdesc)
 {
-	return &page->ptl;
+	return &ptdesc->ptl;
 }
 #endif /* ALLOC_SPLIT_PTLOCKS */
 
 static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
 {
-	return ptlock_ptr(pmd_page(*pmd));
+	return ptlock_ptr(page_ptdesc(pmd_page(*pmd)));
 }
 
 static inline bool ptlock_init(struct page *page)
@@ -2885,7 +2885,7 @@ static inline bool ptlock_init(struct page *page)
 	VM_BUG_ON_PAGE(*(unsigned long *)&page->ptl, page);
 	if (!ptlock_alloc(page_ptdesc(page)))
 		return false;
-	spin_lock_init(ptlock_ptr(page));
+	spin_lock_init(ptlock_ptr(page_ptdesc(page)));
 	return true;
 }
 
@@ -2971,7 +2971,7 @@ static inline struct ptdesc *pmd_ptdesc(pmd_t *pmd)
 
 static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd)
 {
-	return ptlock_ptr(ptdesc_page(pmd_ptdesc(pmd)));
+	return ptlock_ptr(pmd_ptdesc(pmd));
 }
 
 static inline bool pmd_ptlock_init(struct page *page)
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:21:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:21:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569361.889860 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Y5-00041a-7L; Tue, 25 Jul 2023 04:21:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569361.889860; Tue, 25 Jul 2023 04:21:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Y5-00041H-3G; Tue, 25 Jul 2023 04:21:25 +0000
Received: by outflank-mailman (input) for mailman id 569361;
 Tue, 25 Jul 2023 04:21:24 +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
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Y3-00023t-Vp
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:23 +0000
Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com
 [2607:f8b0:4864:20::b2d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b5b61e09-2aa2-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:21:22 +0200 (CEST)
Received: by mail-yb1-xb2d.google.com with SMTP id
 3f1490d57ef6-cfcebc33d04so5669944276.2
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:22 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b5b61e09-2aa2-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258881; x=1690863681;
        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=d0E0BACLvXh2vpBt6imfUOZqEuzu1odD4oW+AaIJCus=;
        b=jYui+PKKLrYwW/9bkeBCxZuH30ZLFCfjk6k83i08YHGZs5qBvg098warmUkrhehPA7
         w4YGyti6UCNUragO2itKU02HUpV/ViBpQF9TFUZFW/NNv47MTUMBLJ+3J2/znigqsRJs
         QhHBOUaU/0pdlJBDEn1DtnKR6Jjb52zcMeUqfdcetzMdFupe+5WkVJfD4fN5fJJOsgL0
         e1lfCQXQItA0Ro7t73ofq2YB2adhnzcCWoT2HIbviNcoaPhOqdkOZB4a44aYijkjfd8z
         BHV0Z8ytCVZzLV7QMejslcSqJexW00RaRFmpSqinl2bowLcrU0F1887NS/OPVowYeO94
         sAOA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258881; x=1690863681;
        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=d0E0BACLvXh2vpBt6imfUOZqEuzu1odD4oW+AaIJCus=;
        b=Y770aFsgnF0a3ZXzn3SxenvjA0V5XLBXV35E5mFnuv+NIwzhNi4tcbg7bsa+9IptWR
         D8i5bDwNOZrNR0vg2Um4qjVzI+Wjb8dr32EH187esVVYhWU9PLDVvD0duE3c92tg4edf
         dhP0fGuXnSaWck3qS3tLG5NkSQGTcEKziwuHSOknOTZH8SRVM+pohMBKQFtcfIuyGHZf
         Fhi0ouEDVZR3sno3kQ3BDRp7xxaxN6URjHl4RJAg0ahhIbdobDRzPKoZ1wm8ybvrOdmR
         LX0vbOfIca0Iu6Pu5GOz2cwbqYnykv4lOd/k16Zd6wEOT5X6I2ISIkPJATJpnoISmogs
         FPcA==
X-Gm-Message-State: ABy/qLY+H55c6tJezO7GmycNlul83V1t9DCIkGds4gD43A9DMU02wAvR
	gWUE/6HSmQlAV3x7msvepqI=
X-Google-Smtp-Source: APBJJlGCGmZmbOTlDUcCFEi74mEzBDVKNi9w9+0D8ZZZqBiNJxZc6NQL85g34qQbwNZIlG7Tv+r/mA==
X-Received: by 2002:a25:356:0:b0:d0b:ed07:7f56 with SMTP id 83-20020a250356000000b00d0bed077f56mr5325321ybd.18.1690258881187;
        Mon, 24 Jul 2023 21:21:21 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 07/31] mm: Convert pmd_ptlock_init() to use ptdescs
Date: Mon, 24 Jul 2023 21:20:27 -0700
Message-Id: <20230725042051.36691-8-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This removes some direct accesses to struct page, working towards
splitting out struct ptdesc from struct page.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/mm.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index c155f82dd2cc..52ef09c100a2 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2974,12 +2974,12 @@ static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd)
 	return ptlock_ptr(pmd_ptdesc(pmd));
 }
 
-static inline bool pmd_ptlock_init(struct page *page)
+static inline bool pmd_ptlock_init(struct ptdesc *ptdesc)
 {
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
-	page->pmd_huge_pte = NULL;
+	ptdesc->pmd_huge_pte = NULL;
 #endif
-	return ptlock_init(page);
+	return ptlock_init(ptdesc_page(ptdesc));
 }
 
 static inline void pmd_ptlock_free(struct page *page)
@@ -2999,7 +2999,7 @@ static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd)
 	return &mm->page_table_lock;
 }
 
-static inline bool pmd_ptlock_init(struct page *page) { return true; }
+static inline bool pmd_ptlock_init(struct ptdesc *ptdesc) { return true; }
 static inline void pmd_ptlock_free(struct page *page) {}
 
 #define pmd_huge_pte(mm, pmd) ((mm)->pmd_huge_pte)
@@ -3015,7 +3015,7 @@ static inline spinlock_t *pmd_lock(struct mm_struct *mm, pmd_t *pmd)
 
 static inline bool pgtable_pmd_page_ctor(struct page *page)
 {
-	if (!pmd_ptlock_init(page))
+	if (!pmd_ptlock_init(page_ptdesc(page)))
 		return false;
 	__SetPageTable(page);
 	inc_lruvec_page_state(page, NR_PAGETABLE);
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:21:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:21:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569362.889870 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Y7-0004Oc-Iv; Tue, 25 Jul 2023 04:21:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569362.889870; Tue, 25 Jul 2023 04:21:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Y7-0004OK-Cg; Tue, 25 Jul 2023 04:21:27 +0000
Received: by outflank-mailman (input) for mailman id 569362;
 Tue, 25 Jul 2023 04:21:26 +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
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Y5-00023t-VC
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:25 +0000
Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com
 [2607:f8b0:4864:20::b2e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b6dff9db-2aa2-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:21:24 +0200 (CEST)
Received: by mail-yb1-xb2e.google.com with SMTP id
 3f1490d57ef6-d13e0bfbbcfso1761726276.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:24 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b6dff9db-2aa2-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258883; x=1690863683;
        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=iy/rMhqpUcv/05FOZn+4srvOxwPFLEA5us+pK4Rb6lw=;
        b=DwndbpJ6ZJrYKMHpG4xKikBhk7x+krWdi68yaEUskEkiop40SD81D3SbVY3seOkRYX
         /kBw1kbEHeLJuAWxODh8wznz3CeaeUpUO4YYOfw0VBoc804gVI4mMhkv5lDO7g/hc/Ox
         TXEzhNof0Ms0qo0Det2yGSzvCCxAKXVShq3qZYqhwj2d67+5rTird7vmREAL8b8Si8Ac
         tOq0IFFx/OCdHFNMMX58/9jGd+Cn0j6BluiHfy+sp+cwHgX7LWNmOOEbAbHaR8hHlJNg
         plgZtGI8EoaWjuEjbu+IQ9bgYRh88XsoYPHoE7Qno7Yp+zMkk++OeXafcS4wt+s+lSyS
         wNUg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258883; x=1690863683;
        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=iy/rMhqpUcv/05FOZn+4srvOxwPFLEA5us+pK4Rb6lw=;
        b=VcjjnNtvpg/hEmDITWWhK9JLCwViqtq7bffcXAW2qy14fhAOh5r6LY3Tok5gujRdtn
         drlVrFgWYCqFCS2sKmF+KLiGB9GZ7c8D8lRiGzj6U0rug3GGOuC2k0QKLwkto8+otPf2
         VneMYbsxRay+WOoYJDWZNxqMYOrKApGyTM4tiiuI/I4SeBsOrybgsPKecjfg/kkwZmb2
         2Ea4xnfgCNaQ3CYWsSw8zBZX2lHHFK7gGvMDwRRLWSgmNhtGlOLWmIkr9oApaKVdk050
         nxBPKj5InfXrZzhK7M58Uh0C+W+DDI1PNX5gSWuqWvmwAz5Jlr4uWWUm7mU6c4nOERX4
         PEzg==
X-Gm-Message-State: ABy/qLaySArIlRJH/qt6juo20D7tW4wriy+AM/JrOkUnFwnwIgJjVPNC
	BpvYlf1Qw3tPh9dgHxlzNH4=
X-Google-Smtp-Source: APBJJlF+SF4cjauiYcGzSv/LhxAh6sYfbdxhzn585BID5O/OlI17XEMKbBKdqUp1OW6pVPf/RqCKZQ==
X-Received: by 2002:a25:908e:0:b0:d07:b677:3349 with SMTP id t14-20020a25908e000000b00d07b6773349mr1259438ybl.25.1690258883131;
        Mon, 24 Jul 2023 21:21:23 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 08/31] mm: Convert ptlock_init() to use ptdescs
Date: Mon, 24 Jul 2023 21:20:28 -0700
Message-Id: <20230725042051.36691-9-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This removes some direct accesses to struct page, working towards
splitting out struct ptdesc from struct page.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/mm.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 52ef09c100a2..675972d3f7e4 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2873,7 +2873,7 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
 	return ptlock_ptr(page_ptdesc(pmd_page(*pmd)));
 }
 
-static inline bool ptlock_init(struct page *page)
+static inline bool ptlock_init(struct ptdesc *ptdesc)
 {
 	/*
 	 * prep_new_page() initialize page->private (and therefore page->ptl)
@@ -2882,10 +2882,10 @@ static inline bool ptlock_init(struct page *page)
 	 * It can happen if arch try to use slab for page table allocation:
 	 * slab code uses page->slab_cache, which share storage with page->ptl.
 	 */
-	VM_BUG_ON_PAGE(*(unsigned long *)&page->ptl, page);
-	if (!ptlock_alloc(page_ptdesc(page)))
+	VM_BUG_ON_PAGE(*(unsigned long *)&ptdesc->ptl, ptdesc_page(ptdesc));
+	if (!ptlock_alloc(ptdesc))
 		return false;
-	spin_lock_init(ptlock_ptr(page_ptdesc(page)));
+	spin_lock_init(ptlock_ptr(ptdesc));
 	return true;
 }
 
@@ -2898,13 +2898,13 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
 	return &mm->page_table_lock;
 }
 static inline void ptlock_cache_init(void) {}
-static inline bool ptlock_init(struct page *page) { return true; }
+static inline bool ptlock_init(struct ptdesc *ptdesc) { return true; }
 static inline void ptlock_free(struct page *page) {}
 #endif /* USE_SPLIT_PTE_PTLOCKS */
 
 static inline bool pgtable_pte_page_ctor(struct page *page)
 {
-	if (!ptlock_init(page))
+	if (!ptlock_init(page_ptdesc(page)))
 		return false;
 	__SetPageTable(page);
 	inc_lruvec_page_state(page, NR_PAGETABLE);
@@ -2979,7 +2979,7 @@ static inline bool pmd_ptlock_init(struct ptdesc *ptdesc)
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
 	ptdesc->pmd_huge_pte = NULL;
 #endif
-	return ptlock_init(ptdesc_page(ptdesc));
+	return ptlock_init(ptdesc);
 }
 
 static inline void pmd_ptlock_free(struct page *page)
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:21:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:21:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569363.889880 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Y8-0004iJ-TD; Tue, 25 Jul 2023 04:21:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569363.889880; Tue, 25 Jul 2023 04:21:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9Y8-0004hF-NB; Tue, 25 Jul 2023 04:21:28 +0000
Received: by outflank-mailman (input) for mailman id 569363;
 Tue, 25 Jul 2023 04:21:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Y6-0002Iw-TM
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:26 +0000
Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com
 [2607:f8b0:4864:20::b32])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b82d6b9f-2aa2-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 06:21:26 +0200 (CEST)
Received: by mail-yb1-xb32.google.com with SMTP id
 3f1490d57ef6-cb19b1b9a36so5683242276.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:26 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b82d6b9f-2aa2-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258885; x=1690863685;
        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=iZ7ozcISUSGoixC5UzzNE5tJz0+L18C1Imj6XmV/DYM=;
        b=gPlpDfbgQUaDh17nMUuxk8LJn1nYdgEAVfSMEcDpmwNJCwXKDaomTlh0BY+xZkFMKd
         tFRmLrBoE1Vp0IzzPSrF8bgPZVxB+9aP3VrUcSHjKLr+y7jNlD4PpyjtmGaGnI3Rciw5
         xPEUpzqKKaVrLEfBMw5DD9c3Ng9G9PKL+n4eQ6Zcvb2wmVEKnYUeBmB54WntK+cvg6UK
         QgMdLEB/drGqPOPjrgcd99xnUW0qMuGMWDmaVMRTFx92PXfEsSeKT6B4JdtVKY4BOuL7
         QKWH8kGjoeg6j0VlgnYB4AI/+z50XhZH+jdg01QIwrxx7GkpXjxyDTkcgrBZeXNJtHxg
         DmIA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258885; x=1690863685;
        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=iZ7ozcISUSGoixC5UzzNE5tJz0+L18C1Imj6XmV/DYM=;
        b=GCqSPct5XVEGWB5I2TqVH7RJxgRu3JQdI8oz+PyvT5WQwUzPMAhvTl3qLt02DstLW5
         trOOf8deAdnfrYoXNnpbvfRGJSUDGfmbzOpKSRM9FFS24rMk0XptoqyYAoEINDNPQ0lc
         qY1N+Xa27B61fzqxakmP68BVtFE64kqV//nWROD4NA7ulj0VbI2JlXpIfz4pBMY4xyGL
         L7f0ZECUO0eqOemuX2R2tc885zj2TWiwfyB3A17taZ3/k6yzH6xuhv5mel+RvvqBFKds
         PuwYEcA3GhTRo0Z1d0DaaKwJGFGkbsFZRk8q04nUP41HPsy9Tck7iBxRGIK1GVPN/eft
         TMCw==
X-Gm-Message-State: ABy/qLZHJAfliaG7tPcvPqBgdS3081ZlYlqDzAKZ8sLJQc5pCvYHzlXM
	9w6MXmrUIy9nOpuDIUDIIfM=
X-Google-Smtp-Source: APBJJlEU2X68Ojav0w5cqMxtXa5ryZpYlhi5g+xNY8vonB7Weqi80FZO/gUhwzOoBC/kjqTB4Zo1Gw==
X-Received: by 2002:a25:f827:0:b0:d0e:794f:64ef with SMTP id u39-20020a25f827000000b00d0e794f64efmr4552557ybd.0.1690258885213;
        Mon, 24 Jul 2023 21:21:25 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 09/31] mm: Convert pmd_ptlock_free() to use ptdescs
Date: Mon, 24 Jul 2023 21:20:29 -0700
Message-Id: <20230725042051.36691-10-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This removes some direct accesses to struct page, working towards
splitting out struct ptdesc from struct page.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/mm.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 675972d3f7e4..774fe83c0c16 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2982,12 +2982,12 @@ static inline bool pmd_ptlock_init(struct ptdesc *ptdesc)
 	return ptlock_init(ptdesc);
 }
 
-static inline void pmd_ptlock_free(struct page *page)
+static inline void pmd_ptlock_free(struct ptdesc *ptdesc)
 {
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
-	VM_BUG_ON_PAGE(page->pmd_huge_pte, page);
+	VM_BUG_ON_PAGE(ptdesc->pmd_huge_pte, ptdesc_page(ptdesc));
 #endif
-	ptlock_free(page);
+	ptlock_free(ptdesc_page(ptdesc));
 }
 
 #define pmd_huge_pte(mm, pmd) (pmd_ptdesc(pmd)->pmd_huge_pte)
@@ -3000,7 +3000,7 @@ static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd)
 }
 
 static inline bool pmd_ptlock_init(struct ptdesc *ptdesc) { return true; }
-static inline void pmd_ptlock_free(struct page *page) {}
+static inline void pmd_ptlock_free(struct ptdesc *ptdesc) {}
 
 #define pmd_huge_pte(mm, pmd) ((mm)->pmd_huge_pte)
 
@@ -3024,7 +3024,7 @@ static inline bool pgtable_pmd_page_ctor(struct page *page)
 
 static inline void pgtable_pmd_page_dtor(struct page *page)
 {
-	pmd_ptlock_free(page);
+	pmd_ptlock_free(page_ptdesc(page));
 	__ClearPageTable(page);
 	dec_lruvec_page_state(page, NR_PAGETABLE);
 }
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:21:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:21:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569364.889890 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9YB-0005Jw-IO; Tue, 25 Jul 2023 04:21:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569364.889890; Tue, 25 Jul 2023 04:21:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9YB-0005Jk-E2; Tue, 25 Jul 2023 04:21:31 +0000
Received: by outflank-mailman (input) for mailman id 569364;
 Tue, 25 Jul 2023 04:21:30 +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
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Y9-00023t-W2
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:29 +0000
Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com
 [2607:f8b0:4864:20::b35])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b955feb1-2aa2-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:21:28 +0200 (CEST)
Received: by mail-yb1-xb35.google.com with SMTP id
 3f1490d57ef6-cc4f4351ac7so5617254276.2
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:28 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:27 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b955feb1-2aa2-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258887; x=1690863687;
        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=7EZnRhm4Fj3KaK4sFjI+P1mIVDNOtVXSgVauozi7/LE=;
        b=RYLJ+HHhZ3SW3XdvMN1AzT9gPBErVqrhuCtcU9fNt2oY7ALxgSJoFkBn6Vm9nhRIfL
         WiTjjdSQLpNPnjH/5n9WBm6wJTnH8dJRd1NltGEZ286BUnLn7Q2MMvQIs7uIZqTwGdGS
         eL9nBqdaNLlYe8KWVzFFhBRvhsKclpu6/YA+4Q97+gqJ/tvmMP0hkmlN965zL32r5aWq
         lGDtyvV+tLl+Z/pogbSTjxnJu1qRtO3WfiwXTUnVp3YPllt2BfK2Izz7z0ivGxPYpzFU
         UjwvvFWDj18TjEMiWj89EXU3QbdGQMvzZCK7ByPk/vtnFluG2/Q0k/42+A+1E3bms/jl
         vfTg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258887; x=1690863687;
        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=7EZnRhm4Fj3KaK4sFjI+P1mIVDNOtVXSgVauozi7/LE=;
        b=b6du23XjbnspNFip+ycNRsiSo6st30l/PvENx7g1V2NXXvuBX3RJIPtn6gcHraizSs
         mrMJrH06Fm93GV3fckSiXrZm1cUYO+zGdwh3pEeTFkP5ulb83mBI29HOGpLFkbI/PiJ5
         epf7c1xtQaQE45loDqV8rJdiNKsEhEI76iEq5UfEClbQyl4dWD/iAhM7lIqZYa/j/nvG
         Dev6WwQNUhh4z1UPhZ1lQr/78yFDOKIDdFkYHbj5VyPEbYW+yDNJs/lKQfujaItvTVwO
         RUDpIL7S79YB62yHX2gpHtAfMUAsZiR2zUwjtnCiFTsKGI5EQMqnyX/xb2YMXffefNF6
         2qMg==
X-Gm-Message-State: ABy/qLaXe+1/+vp5798HugRvqohqQHV3GjNlIQWbzcyx+sW+ip3Ht1DW
	WoL1zF8PjqFbQRwo5S7JcaM=
X-Google-Smtp-Source: APBJJlEDrySQ7FY0Or7EcCMVmcmwbMMbiMSaZShCmPSyL8HtQQZFeTHHFjIo1cF+xzs4edAkc8Gy+Q==
X-Received: by 2002:a5b:782:0:b0:c91:cc0e:1aef with SMTP id b2-20020a5b0782000000b00c91cc0e1aefmr9011877ybq.58.1690258887257;
        Mon, 24 Jul 2023 21:21:27 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 10/31] mm: Convert ptlock_free() to use ptdescs
Date: Mon, 24 Jul 2023 21:20:30 -0700
Message-Id: <20230725042051.36691-11-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This removes some direct accesses to struct page, working towards
splitting out struct ptdesc from struct page.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/mm.h | 10 +++++-----
 mm/memory.c        |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 774fe83c0c16..ffddae95af78 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2842,7 +2842,7 @@ static inline void pagetable_free(struct ptdesc *pt)
 #if ALLOC_SPLIT_PTLOCKS
 void __init ptlock_cache_init(void);
 bool ptlock_alloc(struct ptdesc *ptdesc);
-extern void ptlock_free(struct page *page);
+void ptlock_free(struct ptdesc *ptdesc);
 
 static inline spinlock_t *ptlock_ptr(struct ptdesc *ptdesc)
 {
@@ -2858,7 +2858,7 @@ static inline bool ptlock_alloc(struct ptdesc *ptdesc)
 	return true;
 }
 
-static inline void ptlock_free(struct page *page)
+static inline void ptlock_free(struct ptdesc *ptdesc)
 {
 }
 
@@ -2899,7 +2899,7 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
 }
 static inline void ptlock_cache_init(void) {}
 static inline bool ptlock_init(struct ptdesc *ptdesc) { return true; }
-static inline void ptlock_free(struct page *page) {}
+static inline void ptlock_free(struct ptdesc *ptdesc) {}
 #endif /* USE_SPLIT_PTE_PTLOCKS */
 
 static inline bool pgtable_pte_page_ctor(struct page *page)
@@ -2913,7 +2913,7 @@ static inline bool pgtable_pte_page_ctor(struct page *page)
 
 static inline void pgtable_pte_page_dtor(struct page *page)
 {
-	ptlock_free(page);
+	ptlock_free(page_ptdesc(page));
 	__ClearPageTable(page);
 	dec_lruvec_page_state(page, NR_PAGETABLE);
 }
@@ -2987,7 +2987,7 @@ static inline void pmd_ptlock_free(struct ptdesc *ptdesc)
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
 	VM_BUG_ON_PAGE(ptdesc->pmd_huge_pte, ptdesc_page(ptdesc));
 #endif
-	ptlock_free(ptdesc_page(ptdesc));
+	ptlock_free(ptdesc);
 }
 
 #define pmd_huge_pte(mm, pmd) (pmd_ptdesc(pmd)->pmd_huge_pte)
diff --git a/mm/memory.c b/mm/memory.c
index 4fee273595e2..e5e370cdac23 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -6242,8 +6242,8 @@ bool ptlock_alloc(struct ptdesc *ptdesc)
 	return true;
 }
 
-void ptlock_free(struct page *page)
+void ptlock_free(struct ptdesc *ptdesc)
 {
-	kmem_cache_free(page_ptl_cachep, page->ptl);
+	kmem_cache_free(page_ptl_cachep, ptdesc->ptl);
 }
 #endif
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:21:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:21:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569365.889900 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9YD-0005fE-5B; Tue, 25 Jul 2023 04:21:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569365.889900; Tue, 25 Jul 2023 04:21:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9YC-0005dt-RZ; Tue, 25 Jul 2023 04:21:32 +0000
Received: by outflank-mailman (input) for mailman id 569365;
 Tue, 25 Jul 2023 04:21:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9YB-0002Iw-7k
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:31 +0000
Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com
 [2607:f8b0:4864:20::b33])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ba9ea1e2-2aa2-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 06:21:30 +0200 (CEST)
Received: by mail-yb1-xb33.google.com with SMTP id
 3f1490d57ef6-d18566dc0c1so252021276.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:30 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ba9ea1e2-2aa2-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258889; x=1690863689;
        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=GM8s3dDlKIn9bcZ3Rv1fAyQJ11tvy15JiujAITQGQIU=;
        b=pRtFn4s2PbyDqF0TT2ROPqoi8Nf6cO+mjT/PpAibpqoGu7RVl319pUbQzpwGcemW6v
         ycybLo0TEnNIsKIUBDodgJqfY6SleEYizvK1Vc9btvfMS46S3rfljXuaAJYnljAU7sG7
         7jK+G5eyuE1KaJYyjxnJ03BoenaidsCYPCkwIEGR1Hhy/zJz4Ys+XX9GMOuKC1FJDNY4
         VtftN6v4wiLKMbMCHR3bjB9E/ZrVvmPIO3VQbX7+L4Iqn5VeUa8q9xhONTfTBRh7Kux2
         Tj/BOzEarK1RhsZfJqN5Pnf19w+jQvRB3VZLmWb0D0GCMPtXp8othTQIXw79eSgdX3zV
         QV6g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258889; x=1690863689;
        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=GM8s3dDlKIn9bcZ3Rv1fAyQJ11tvy15JiujAITQGQIU=;
        b=L0NRK7EGwDWjIMPdCeqTXvQ6a2BzhT9RsX4X03CxI71KzIJUBvRySwEVDFqKZLFPqD
         QI057xKbUaHLHBGTHIlKncaCfk3J3qHw8MB7IOSl2acuSduR0qDLoM94b/v75XRq7t0x
         kVlVmCpugABbc9jpsjr1tYcQhNo9pyS0axvER4Q68jqspJoDSNey5I/Ob0yF6S2m5xKN
         jyN+6CJU2cL8mnVNfVleKLSVSWGicRQe0yQuNlvS9IeJnLegMfpLpUJ3ovDDsP2Y97RE
         flWh/ApPq4pZnmk6pu3AHEEZ5hIImbvkQauVSwCY5VrUkhjgUdbZ3IDkzluUjMZQ8Fl+
         FGyg==
X-Gm-Message-State: ABy/qLZWAvH10iTrVZBW46U1VFuN4hE9CNAsSa//zORcEJ8zqlW+xZDB
	Ha/Khvmac804wwqs9F1a/v8=
X-Google-Smtp-Source: APBJJlG8/pyNsL5c65VV2FWW2n+kp6iwz/O9EJhcRKijOyOwqeNWpfh6eCenLgaMZnYc3nueG5tQ5Q==
X-Received: by 2002:a25:e7d8:0:b0:d0e:b5c8:6359 with SMTP id e207-20020a25e7d8000000b00d0eb5c86359mr4890639ybh.55.1690258889345;
        Mon, 24 Jul 2023 21:21:29 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 11/31] mm: Create ptdesc equivalents for pgtable_{pte,pmd}_page_{ctor,dtor}
Date: Mon, 24 Jul 2023 21:20:31 -0700
Message-Id: <20230725042051.36691-12-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Create pagetable_pte_ctor(), pagetable_pmd_ctor(), pagetable_pte_dtor(),
and pagetable_pmd_dtor() and make the original pgtable
constructor/destructors wrappers.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/mm.h | 56 ++++++++++++++++++++++++++++++++++------------
 1 file changed, 42 insertions(+), 14 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index ffddae95af78..bd3d99d81984 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2902,20 +2902,34 @@ static inline bool ptlock_init(struct ptdesc *ptdesc) { return true; }
 static inline void ptlock_free(struct ptdesc *ptdesc) {}
 #endif /* USE_SPLIT_PTE_PTLOCKS */
 
-static inline bool pgtable_pte_page_ctor(struct page *page)
+static inline bool pagetable_pte_ctor(struct ptdesc *ptdesc)
 {
-	if (!ptlock_init(page_ptdesc(page)))
+	struct folio *folio = ptdesc_folio(ptdesc);
+
+	if (!ptlock_init(ptdesc))
 		return false;
-	__SetPageTable(page);
-	inc_lruvec_page_state(page, NR_PAGETABLE);
+	__folio_set_pgtable(folio);
+	lruvec_stat_add_folio(folio, NR_PAGETABLE);
 	return true;
 }
 
+static inline bool pgtable_pte_page_ctor(struct page *page)
+{
+	return pagetable_pte_ctor(page_ptdesc(page));
+}
+
+static inline void pagetable_pte_dtor(struct ptdesc *ptdesc)
+{
+	struct folio *folio = ptdesc_folio(ptdesc);
+
+	ptlock_free(ptdesc);
+	__folio_clear_pgtable(folio);
+	lruvec_stat_sub_folio(folio, NR_PAGETABLE);
+}
+
 static inline void pgtable_pte_page_dtor(struct page *page)
 {
-	ptlock_free(page_ptdesc(page));
-	__ClearPageTable(page);
-	dec_lruvec_page_state(page, NR_PAGETABLE);
+	pagetable_pte_dtor(page_ptdesc(page));
 }
 
 pte_t *__pte_offset_map(pmd_t *pmd, unsigned long addr, pmd_t *pmdvalp);
@@ -3013,20 +3027,34 @@ static inline spinlock_t *pmd_lock(struct mm_struct *mm, pmd_t *pmd)
 	return ptl;
 }
 
-static inline bool pgtable_pmd_page_ctor(struct page *page)
+static inline bool pagetable_pmd_ctor(struct ptdesc *ptdesc)
 {
-	if (!pmd_ptlock_init(page_ptdesc(page)))
+	struct folio *folio = ptdesc_folio(ptdesc);
+
+	if (!pmd_ptlock_init(ptdesc))
 		return false;
-	__SetPageTable(page);
-	inc_lruvec_page_state(page, NR_PAGETABLE);
+	__folio_set_pgtable(folio);
+	lruvec_stat_add_folio(folio, NR_PAGETABLE);
 	return true;
 }
 
+static inline bool pgtable_pmd_page_ctor(struct page *page)
+{
+	return pagetable_pmd_ctor(page_ptdesc(page));
+}
+
+static inline void pagetable_pmd_dtor(struct ptdesc *ptdesc)
+{
+	struct folio *folio = ptdesc_folio(ptdesc);
+
+	pmd_ptlock_free(ptdesc);
+	__folio_clear_pgtable(folio);
+	lruvec_stat_sub_folio(folio, NR_PAGETABLE);
+}
+
 static inline void pgtable_pmd_page_dtor(struct page *page)
 {
-	pmd_ptlock_free(page_ptdesc(page));
-	__ClearPageTable(page);
-	dec_lruvec_page_state(page, NR_PAGETABLE);
+	pagetable_pmd_dtor(page_ptdesc(page));
 }
 
 /*
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:21:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:21:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569370.889909 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9YH-0006PK-Dg; Tue, 25 Jul 2023 04:21:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569370.889909; Tue, 25 Jul 2023 04:21:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9YH-0006Ou-8k; Tue, 25 Jul 2023 04:21:37 +0000
Received: by outflank-mailman (input) for mailman id 569370;
 Tue, 25 Jul 2023 04:21:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9YF-0002Iw-GM
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:35 +0000
Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com
 [2607:f8b0:4864:20::b30])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bd3b8720-2aa2-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 06:21:34 +0200 (CEST)
Received: by mail-yb1-xb30.google.com with SMTP id
 3f1490d57ef6-c11e2b31b95so5469679276.3
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:34 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bd3b8720-2aa2-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258894; x=1690863694;
        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=sltDOqqNfHEtvz8jLXUjW/r74sJCuRKUMVTEbSHBWCo=;
        b=OoN3UWmLSCjyxYbzaa/VyreR9Zp9zZE7q4yjWoRCcej2BHg4aQ044HHkVDn/SawDGs
         xygKZwOWRrg9shT9yAucyLF6JUhOidpReQLO08WoWlOww74TOvMA9ViH1KwkS5HDFQJa
         y+AyGlFm7eQ/xHxPvinfJ1GONUFKOJqagJ2BY2uxKaAzYfrmCGsCa4yr7xv8/m49BRfU
         KlXVshXWDHbntXMlZI7+vEacDxTrUH1emR9hZmFm4q/PkdnrRRqZ8ALZY/gtIumGa75s
         4tL6H+cr1eSITvTUPxxUzr3WyxhZ30248GorV0XuK4prnVd3rVvMT55DDWK1kXMXlQb2
         U/Ig==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258894; x=1690863694;
        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=sltDOqqNfHEtvz8jLXUjW/r74sJCuRKUMVTEbSHBWCo=;
        b=YCjtJmYINc8unV26DN+sFK6gQqIYW4EXoQIt25fZgYohEItBVAL7v/xoSOH+yxDW6l
         f8HttuT812Avn/2WipP9kL3C+il5zMYxqBiV3bZMTkwtCTsPneX3iuOvOgmnzb7o0f/4
         jj1KEM0VkAepeJgW+5K9TOnh8dCQe72A+jX5QmR6ZAT83aPMgBXvLUWl2XwqeV9Aiktr
         VNH94qH4ipuVPxFGYFjxoufsQkbTBpc9X5OfK/wlKTNaFnDKBGy0EwsPG+YV0ENtTsi9
         f4JCQjhtNYhHCMFy4TAC7FKLtKB/woOOxWHyLas1MiiPNfangF5Gx5lpjjwQ1MicmJCA
         auQQ==
X-Gm-Message-State: ABy/qLb1+CGK7o1gt0IJZurEJkDkHbiXMqJVWEzpRiKZZcb+DODWSd8r
	UVONZltKniTYa429fXIWl6w=
X-Google-Smtp-Source: APBJJlHsEM8PJvWhxaYGxDCv9CFh7IDA0XQcYTrJ3snbNygB4DE40wKDxkk+qw9NHN2b60Di5RWY+Q==
X-Received: by 2002:a25:f908:0:b0:d08:7ffc:c0eb with SMTP id q8-20020a25f908000000b00d087ffcc0ebmr6392710ybe.19.1690258893793;
        Mon, 24 Jul 2023 21:21:33 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Dave Hansen <dave.hansen@linux.intel.com>
Subject: [PATCH mm-unstable v7 13/31] x86: Convert various functions to use ptdescs
Date: Mon, 24 Jul 2023 21:20:33 -0700
Message-Id: <20230725042051.36691-14-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In order to split struct ptdesc from struct page, convert various
functions to use ptdescs.

Some of the functions use the *get*page*() helper functions. Convert
these to use pagetable_alloc() and ptdesc_address() instead to help
standardize page tables further.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
---
 arch/x86/mm/pgtable.c | 47 ++++++++++++++++++++++++++-----------------
 1 file changed, 28 insertions(+), 19 deletions(-)

diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 15a8009a4480..d3a93e8766ee 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -52,7 +52,7 @@ early_param("userpte", setup_userpte);
 
 void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte)
 {
-	pgtable_pte_page_dtor(pte);
+	pagetable_pte_dtor(page_ptdesc(pte));
 	paravirt_release_pte(page_to_pfn(pte));
 	paravirt_tlb_remove_table(tlb, pte);
 }
@@ -60,7 +60,7 @@ void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte)
 #if CONFIG_PGTABLE_LEVELS > 2
 void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
 {
-	struct page *page = virt_to_page(pmd);
+	struct ptdesc *ptdesc = virt_to_ptdesc(pmd);
 	paravirt_release_pmd(__pa(pmd) >> PAGE_SHIFT);
 	/*
 	 * NOTE! For PAE, any changes to the top page-directory-pointer-table
@@ -69,8 +69,8 @@ void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
 #ifdef CONFIG_X86_PAE
 	tlb->need_flush_all = 1;
 #endif
-	pgtable_pmd_page_dtor(page);
-	paravirt_tlb_remove_table(tlb, page);
+	pagetable_pmd_dtor(ptdesc);
+	paravirt_tlb_remove_table(tlb, ptdesc_page(ptdesc));
 }
 
 #if CONFIG_PGTABLE_LEVELS > 3
@@ -92,16 +92,16 @@ void ___p4d_free_tlb(struct mmu_gather *tlb, p4d_t *p4d)
 
 static inline void pgd_list_add(pgd_t *pgd)
 {
-	struct page *page = virt_to_page(pgd);
+	struct ptdesc *ptdesc = virt_to_ptdesc(pgd);
 
-	list_add(&page->lru, &pgd_list);
+	list_add(&ptdesc->pt_list, &pgd_list);
 }
 
 static inline void pgd_list_del(pgd_t *pgd)
 {
-	struct page *page = virt_to_page(pgd);
+	struct ptdesc *ptdesc = virt_to_ptdesc(pgd);
 
-	list_del(&page->lru);
+	list_del(&ptdesc->pt_list);
 }
 
 #define UNSHARED_PTRS_PER_PGD				\
@@ -112,12 +112,12 @@ static inline void pgd_list_del(pgd_t *pgd)
 
 static void pgd_set_mm(pgd_t *pgd, struct mm_struct *mm)
 {
-	virt_to_page(pgd)->pt_mm = mm;
+	virt_to_ptdesc(pgd)->pt_mm = mm;
 }
 
 struct mm_struct *pgd_page_get_mm(struct page *page)
 {
-	return page->pt_mm;
+	return page_ptdesc(page)->pt_mm;
 }
 
 static void pgd_ctor(struct mm_struct *mm, pgd_t *pgd)
@@ -213,11 +213,14 @@ void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd)
 static void free_pmds(struct mm_struct *mm, pmd_t *pmds[], int count)
 {
 	int i;
+	struct ptdesc *ptdesc;
 
 	for (i = 0; i < count; i++)
 		if (pmds[i]) {
-			pgtable_pmd_page_dtor(virt_to_page(pmds[i]));
-			free_page((unsigned long)pmds[i]);
+			ptdesc = virt_to_ptdesc(pmds[i]);
+
+			pagetable_pmd_dtor(ptdesc);
+			pagetable_free(ptdesc);
 			mm_dec_nr_pmds(mm);
 		}
 }
@@ -230,18 +233,24 @@ static int preallocate_pmds(struct mm_struct *mm, pmd_t *pmds[], int count)
 
 	if (mm == &init_mm)
 		gfp &= ~__GFP_ACCOUNT;
+	gfp &= ~__GFP_HIGHMEM;
 
 	for (i = 0; i < count; i++) {
-		pmd_t *pmd = (pmd_t *)__get_free_page(gfp);
-		if (!pmd)
+		pmd_t *pmd = NULL;
+		struct ptdesc *ptdesc = pagetable_alloc(gfp, 0);
+
+		if (!ptdesc)
 			failed = true;
-		if (pmd && !pgtable_pmd_page_ctor(virt_to_page(pmd))) {
-			free_page((unsigned long)pmd);
-			pmd = NULL;
+		if (ptdesc && !pagetable_pmd_ctor(ptdesc)) {
+			pagetable_free(ptdesc);
+			ptdesc = NULL;
 			failed = true;
 		}
-		if (pmd)
+		if (ptdesc) {
 			mm_inc_nr_pmds(mm);
+			pmd = ptdesc_address(ptdesc);
+		}
+
 		pmds[i] = pmd;
 	}
 
@@ -830,7 +839,7 @@ int pud_free_pmd_page(pud_t *pud, unsigned long addr)
 
 	free_page((unsigned long)pmd_sv);
 
-	pgtable_pmd_page_dtor(virt_to_page(pmd));
+	pagetable_pmd_dtor(virt_to_ptdesc(pmd));
 	free_page((unsigned long)pmd);
 
 	return 1;
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:21:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:21:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569373.889920 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9YM-0007NK-MP; Tue, 25 Jul 2023 04:21:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569373.889920; Tue, 25 Jul 2023 04:21:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9YM-0007M4-Ib; Tue, 25 Jul 2023 04:21:42 +0000
Received: by outflank-mailman (input) for mailman id 569373;
 Tue, 25 Jul 2023 04:21:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9YM-0002Iw-1J
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:42 +0000
Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com
 [2607:f8b0:4864:20::b2b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c1112e51-2aa2-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 06:21:41 +0200 (CEST)
Received: by mail-yb1-xb2b.google.com with SMTP id
 3f1490d57ef6-d075a831636so3448184276.3
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:41 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c1112e51-2aa2-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258900; x=1690863700;
        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=bBkB4loM/Mt006iaxsYk7j8UnaAx8a9/NTd5FkPootg=;
        b=ZdUhmLaX4gyxiKMyaj14CX9NQ1dcJnSa6rrPN3h4Mn2BougMhb6+8eVh3LDQVrQc65
         NbnS7VdeFeEZ212ZKZ16lIX06FqrCLzrwnXox0T9+YGd8WFEd02oq0hboPERBUgGx8JC
         HOw+EuGxnkrsAxoVIbFXPSdQFe979NDqglA7jt9NXl1ISDIRCiCswdNU94Ao6k2KFzes
         p0unhJhxsBzqp2at7WfBaU/RBWoIHYWL79aXOZXm1nAXnss+vRNjWMvAhrXpkXlQkCEM
         C6Xg+Yg0Z0IGF4ytYyUqBQzs61/z6rc7xaR+RbhDKuWWQZ0zi2wRVTJY+XBjSXIYJO1f
         lTUw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258900; x=1690863700;
        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=bBkB4loM/Mt006iaxsYk7j8UnaAx8a9/NTd5FkPootg=;
        b=LlxNxhJ8JHdSBYDMBGvvGkXCQtc3+lHI5b3fG/dtIe+pj/x/rznAkKN9HP4oGmGdBu
         BClREEAOXjN1mnkMc22+bXDg/j6M0xkmHAoNVx1DtXyj+6FLZsv2a6WKozBbLNkuJMqC
         dV5xML8k5mzdKzX35Tm6UK0b+uuMNlLxBOR0AovNAHMNci1pUWk1eBEUz1/xqTMyuybL
         MSKQ3QM2nNkks1s8KF2jN28CskW26bPMJhbeeVwMgrBKeMRtmEnmLun6ShYrZl4CWjwp
         ndvVptcCvHWiLf9z3MPMQ1971xYkErjdvoPrhiJxORCDARrc5i9H5I8R8vAVSHLkaXLy
         SRpg==
X-Gm-Message-State: ABy/qLZFuuD2SzTu+C6oa7RIIoyKBFXOZhplNGVLgWKdtp90tWtUQAHU
	wLjAeKBWNMK5i/cUwzOCLh8=
X-Google-Smtp-Source: APBJJlH216bHzn+k38ByANxYCweqR/XKQKTMqZJNszM/Cw5+4Xe9qdLUIJ9YJ2RtXuXTDJ+OkOOs1w==
X-Received: by 2002:a25:1003:0:b0:d0b:7ad2:6426 with SMTP id 3-20020a251003000000b00d0b7ad26426mr5060713ybq.18.1690258900146;
        Mon, 24 Jul 2023 21:21:40 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>
Subject: [PATCH mm-unstable v7 16/31] pgalloc: Convert various functions to use ptdescs
Date: Mon, 24 Jul 2023 21:20:36 -0700
Message-Id: <20230725042051.36691-17-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

Some of the functions use the *get*page*() helper functions. Convert
these to use pagetable_alloc() and ptdesc_address() instead to help
standardize page tables further.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
---
 include/asm-generic/pgalloc.h | 88 +++++++++++++++++++++--------------
 1 file changed, 52 insertions(+), 36 deletions(-)

diff --git a/include/asm-generic/pgalloc.h b/include/asm-generic/pgalloc.h
index a7cf825befae..c75d4a753849 100644
--- a/include/asm-generic/pgalloc.h
+++ b/include/asm-generic/pgalloc.h
@@ -8,7 +8,7 @@
 #define GFP_PGTABLE_USER	(GFP_PGTABLE_KERNEL | __GFP_ACCOUNT)
 
 /**
- * __pte_alloc_one_kernel - allocate a page for PTE-level kernel page table
+ * __pte_alloc_one_kernel - allocate memory for a PTE-level kernel page table
  * @mm: the mm_struct of the current context
  *
  * This function is intended for architectures that need
@@ -18,12 +18,17 @@
  */
 static inline pte_t *__pte_alloc_one_kernel(struct mm_struct *mm)
 {
-	return (pte_t *)__get_free_page(GFP_PGTABLE_KERNEL);
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_PGTABLE_KERNEL &
+			~__GFP_HIGHMEM, 0);
+
+	if (!ptdesc)
+		return NULL;
+	return ptdesc_address(ptdesc);
 }
 
 #ifndef __HAVE_ARCH_PTE_ALLOC_ONE_KERNEL
 /**
- * pte_alloc_one_kernel - allocate a page for PTE-level kernel page table
+ * pte_alloc_one_kernel - allocate memory for a PTE-level kernel page table
  * @mm: the mm_struct of the current context
  *
  * Return: pointer to the allocated memory or %NULL on error
@@ -35,40 +40,40 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
 #endif
 
 /**
- * pte_free_kernel - free PTE-level kernel page table page
+ * pte_free_kernel - free PTE-level kernel page table memory
  * @mm: the mm_struct of the current context
  * @pte: pointer to the memory containing the page table
  */
 static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
 {
-	free_page((unsigned long)pte);
+	pagetable_free(virt_to_ptdesc(pte));
 }
 
 /**
- * __pte_alloc_one - allocate a page for PTE-level user page table
+ * __pte_alloc_one - allocate memory for a PTE-level user page table
  * @mm: the mm_struct of the current context
  * @gfp: GFP flags to use for the allocation
  *
- * Allocates a page and runs the pgtable_pte_page_ctor().
+ * Allocate memory for a page table and ptdesc and runs pagetable_pte_ctor().
  *
  * This function is intended for architectures that need
  * anything beyond simple page allocation or must have custom GFP flags.
  *
- * Return: `struct page` initialized as page table or %NULL on error
+ * Return: `struct page` referencing the ptdesc or %NULL on error
  */
 static inline pgtable_t __pte_alloc_one(struct mm_struct *mm, gfp_t gfp)
 {
-	struct page *pte;
+	struct ptdesc *ptdesc;
 
-	pte = alloc_page(gfp);
-	if (!pte)
+	ptdesc = pagetable_alloc(gfp, 0);
+	if (!ptdesc)
 		return NULL;
-	if (!pgtable_pte_page_ctor(pte)) {
-		__free_page(pte);
+	if (!pagetable_pte_ctor(ptdesc)) {
+		pagetable_free(ptdesc);
 		return NULL;
 	}
 
-	return pte;
+	return ptdesc_page(ptdesc);
 }
 
 #ifndef __HAVE_ARCH_PTE_ALLOC_ONE
@@ -76,9 +81,9 @@ static inline pgtable_t __pte_alloc_one(struct mm_struct *mm, gfp_t gfp)
  * pte_alloc_one - allocate a page for PTE-level user page table
  * @mm: the mm_struct of the current context
  *
- * Allocates a page and runs the pgtable_pte_page_ctor().
+ * Allocate memory for a page table and ptdesc and runs pagetable_pte_ctor().
  *
- * Return: `struct page` initialized as page table or %NULL on error
+ * Return: `struct page` referencing the ptdesc or %NULL on error
  */
 static inline pgtable_t pte_alloc_one(struct mm_struct *mm)
 {
@@ -92,14 +97,16 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm)
  */
 
 /**
- * pte_free - free PTE-level user page table page
+ * pte_free - free PTE-level user page table memory
  * @mm: the mm_struct of the current context
- * @pte_page: the `struct page` representing the page table
+ * @pte_page: the `struct page` referencing the ptdesc
  */
 static inline void pte_free(struct mm_struct *mm, struct page *pte_page)
 {
-	pgtable_pte_page_dtor(pte_page);
-	__free_page(pte_page);
+	struct ptdesc *ptdesc = page_ptdesc(pte_page);
+
+	pagetable_pte_dtor(ptdesc);
+	pagetable_free(ptdesc);
 }
 
 
@@ -107,10 +114,11 @@ static inline void pte_free(struct mm_struct *mm, struct page *pte_page)
 
 #ifndef __HAVE_ARCH_PMD_ALLOC_ONE
 /**
- * pmd_alloc_one - allocate a page for PMD-level page table
+ * pmd_alloc_one - allocate memory for a PMD-level page table
  * @mm: the mm_struct of the current context
  *
- * Allocates a page and runs the pgtable_pmd_page_ctor().
+ * Allocate memory for a page table and ptdesc and runs pagetable_pmd_ctor().
+ *
  * Allocations use %GFP_PGTABLE_USER in user context and
  * %GFP_PGTABLE_KERNEL in kernel context.
  *
@@ -118,28 +126,30 @@ static inline void pte_free(struct mm_struct *mm, struct page *pte_page)
  */
 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
 {
-	struct page *page;
+	struct ptdesc *ptdesc;
 	gfp_t gfp = GFP_PGTABLE_USER;
 
 	if (mm == &init_mm)
 		gfp = GFP_PGTABLE_KERNEL;
-	page = alloc_page(gfp);
-	if (!page)
+	ptdesc = pagetable_alloc(gfp, 0);
+	if (!ptdesc)
 		return NULL;
-	if (!pgtable_pmd_page_ctor(page)) {
-		__free_page(page);
+	if (!pagetable_pmd_ctor(ptdesc)) {
+		pagetable_free(ptdesc);
 		return NULL;
 	}
-	return (pmd_t *)page_address(page);
+	return ptdesc_address(ptdesc);
 }
 #endif
 
 #ifndef __HAVE_ARCH_PMD_FREE
 static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
 {
+	struct ptdesc *ptdesc = virt_to_ptdesc(pmd);
+
 	BUG_ON((unsigned long)pmd & (PAGE_SIZE-1));
-	pgtable_pmd_page_dtor(virt_to_page(pmd));
-	free_page((unsigned long)pmd);
+	pagetable_pmd_dtor(ptdesc);
+	pagetable_free(ptdesc);
 }
 #endif
 
@@ -150,19 +160,25 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
 static inline pud_t *__pud_alloc_one(struct mm_struct *mm, unsigned long addr)
 {
 	gfp_t gfp = GFP_PGTABLE_USER;
+	struct ptdesc *ptdesc;
 
 	if (mm == &init_mm)
 		gfp = GFP_PGTABLE_KERNEL;
-	return (pud_t *)get_zeroed_page(gfp);
+	gfp &= ~__GFP_HIGHMEM;
+
+	ptdesc = pagetable_alloc(gfp, 0);
+	if (!ptdesc)
+		return NULL;
+	return ptdesc_address(ptdesc);
 }
 
 #ifndef __HAVE_ARCH_PUD_ALLOC_ONE
 /**
- * pud_alloc_one - allocate a page for PUD-level page table
+ * pud_alloc_one - allocate memory for a PUD-level page table
  * @mm: the mm_struct of the current context
  *
- * Allocates a page using %GFP_PGTABLE_USER for user context and
- * %GFP_PGTABLE_KERNEL for kernel context.
+ * Allocate memory for a page table using %GFP_PGTABLE_USER for user context
+ * and %GFP_PGTABLE_KERNEL for kernel context.
  *
  * Return: pointer to the allocated memory or %NULL on error
  */
@@ -175,7 +191,7 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
 static inline void __pud_free(struct mm_struct *mm, pud_t *pud)
 {
 	BUG_ON((unsigned long)pud & (PAGE_SIZE-1));
-	free_page((unsigned long)pud);
+	pagetable_free(virt_to_ptdesc(pud));
 }
 
 #ifndef __HAVE_ARCH_PUD_FREE
@@ -190,7 +206,7 @@ static inline void pud_free(struct mm_struct *mm, pud_t *pud)
 #ifndef __HAVE_ARCH_PGD_FREE
 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 {
-	free_page((unsigned long)pgd);
+	pagetable_free(virt_to_ptdesc(pgd));
 }
 #endif
 
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:24:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:24:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569328.889930 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9bE-0001Vx-Dd; Tue, 25 Jul 2023 04:24:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569328.889930; Tue, 25 Jul 2023 04:24:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9bE-0001Vq-Ah; Tue, 25 Jul 2023 04:24:40 +0000
Received: by outflank-mailman (input) for mailman id 569328;
 Tue, 25 Jul 2023 02:35:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+ZC3=DL=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qO7u2-0005Dc-MA
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 02:35:59 +0000
Received: from out-41.mta1.migadu.com (out-41.mta1.migadu.com [95.215.58.41])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fba84dce-2a93-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 04:35:56 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fba84dce-2a93-11ee-b23c-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690252555;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=0+VnVPZa4UeOCG7Yrfiew8gKr6k3ViuPV5Oe7aKEwA0=;
	b=OouSnERnVUq8t87+qMJi+ElF1O+pkB5HJ/XjlEV4XPIdaL5qKz/r9JLMMUeUfOnb3ZMOdj
	khOpzTQ2idnb6S4y6b+9cHD3wy9I4UTOUPXGpsseW4bB+Gm8jsDjdu3ImL8BlNp++kk+K8
	DDellGRauVWKhKhaf7FrGB51gwHD7wU=
MIME-Version: 1.0
Subject: Re: [PATCH v2 01/47] mm: vmscan: move shrinker-related code into a
 separate file
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-2-zhengqi.arch@bytedance.com>
Date: Tue, 25 Jul 2023 10:35:01 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>,
 yujie.liu@intel.com,
 Greg KH <gregkh@linuxfoundation.org>,
 LKML <linux-kernel@vger.kernel.org>,
 Linux Memory Management List <linux-mm@kvack.org>,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev <netdev@vger.kernel.org>,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <97E80C37-8872-4C5A-A027-A0B35F39152A@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-2-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> =
wrote:
>=20
> The mm/vmscan.c file is too large, so separate the shrinker-related
> code from it into a separate file. No functional changes.
>=20
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> ---
> include/linux/shrinker.h |   3 +
> mm/Makefile              |   4 +-
> mm/shrinker.c            | 707 +++++++++++++++++++++++++++++++++++++++
> mm/vmscan.c              | 701 --------------------------------------
> 4 files changed, 712 insertions(+), 703 deletions(-)
> create mode 100644 mm/shrinker.c
>=20
> diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
> index 224293b2dd06..961cb84e51f5 100644
> --- a/include/linux/shrinker.h
> +++ b/include/linux/shrinker.h
> @@ -96,6 +96,9 @@ struct shrinker {
>  */
> #define SHRINKER_NONSLAB (1 << 3)
>=20
> +unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup =
*memcg,
> +			   int priority);

A good cleanup, vmscan.c is so huge.

I'd like to introduce a new header in mm/ directory and contains those
declarations of functions (like this and other debug function in
shrinker_debug.c) since they are used internally across mm.

Thanks.



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:24:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:24:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569346.889935 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9bE-0001YD-N4; Tue, 25 Jul 2023 04:24:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569346.889935; Tue, 25 Jul 2023 04:24:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9bE-0001XZ-HM; Tue, 25 Jul 2023 04:24:40 +0000
Received: by outflank-mailman (input) for mailman id 569346;
 Tue, 25 Jul 2023 03:18:19 +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
 <SRS0=+ZC3=DL=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qO8Z1-0002wU-24
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 03:18:19 +0000
Received: from out-38.mta0.migadu.com (out-38.mta0.migadu.com [91.218.175.38])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bda8463d-2a99-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 05:17:10 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bda8463d-2a99-11ee-8613-37d641c3527e
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690255094;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=keHNwQXyGxB+2fa9SqrEE3DvQ5TME2b5TMHAzSBP2pw=;
	b=HAeGJ99i5xFhmj3CijzGTxYLYsS22+UCkxr4poXrv7YrVuJ+ys1PsTwIPg8xpWVSxn9zir
	H57AkKYqiD1vOZNVzVNI7GcU+WBHpxaXuuBnNpw5g5o1ZYYgFiQKUmRNmm30EbXVxytcjf
	W5muscH4uShV5wnAUhi90ZLbjVnLzlo=
MIME-Version: 1.0
Subject: Re: [PATCH v2 02/47] mm: shrinker: remove redundant shrinker_rwsem in
 debugfs operations
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-3-zhengqi.arch@bytedance.com>
Date: Tue, 25 Jul 2023 11:17:24 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>,
 yujie.liu@intel.com,
 Greg KH <gregkh@linuxfoundation.org>,
 LKML <linux-kernel@vger.kernel.org>,
 Linux Memory Management List <linux-mm@kvack.org>,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev <netdev@vger.kernel.org>,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <210C013C-AB14-45BC-AB2E-199FF7F5E523@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-3-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> The debugfs_remove_recursive() will wait for debugfs_file_put() to return,
> so the shrinker will not be freed when doing debugfs operations (such as
> shrinker_debugfs_count_show() and shrinker_debugfs_scan_write()), so there
> is no need to hold shrinker_rwsem during debugfs operations.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.




From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:24:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:24:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569349.889942 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9bF-0001fG-1N; Tue, 25 Jul 2023 04:24:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569349.889942; Tue, 25 Jul 2023 04:24:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9bE-0001bF-Pg; Tue, 25 Jul 2023 04:24:40 +0000
Received: by outflank-mailman (input) for mailman id 569349;
 Tue, 25 Jul 2023 03:24:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+ZC3=DL=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qO8fE-0003q7-OE
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 03:24:44 +0000
Received: from out-8.mta0.migadu.com (out-8.mta0.migadu.com
 [2001:41d0:1004:224b::8])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cb52a77e-2a9a-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 05:24:43 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cb52a77e-2a9a-11ee-b23c-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690255481;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=6p0DFvIoLJzSIVM0qRIM/GXeN12xkckyA9Fji4TGEhI=;
	b=r9D+tXFVa/N1RN+BLv5WgR5iQ4rwtyebnPM62Sh3w2AQ+19WlSlFOjsJl5wosr8TEtJchn
	V877L2MD6oNieyuMlTG6JawmQ1ns/Fjh33pHsVXqhR6CCRTDc2499SUTwOS+JRsWVrdweW
	vS3GyBw0+b28Uj9NeJVk00fqQ8IPfLM=
MIME-Version: 1.0
Subject: Re: [PATCH v2 01/47] mm: vmscan: move shrinker-related code into a
 separate file
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <d2621ad0-8b99-9154-5ff5-509dec2f32a3@bytedance.com>
Date: Tue, 25 Jul 2023 11:23:54 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>,
 yujie.liu@intel.com,
 Greg KH <gregkh@linuxfoundation.org>,
 LKML <linux-kernel@vger.kernel.org>,
 Linux Memory Management List <linux-mm@kvack.org>,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev <netdev@vger.kernel.org>,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <6FE62F56-1B4E-4E2A-BEA9-0DA6907A2FA9@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-2-zhengqi.arch@bytedance.com>
 <97E80C37-8872-4C5A-A027-A0B35F39152A@linux.dev>
 <d2621ad0-8b99-9154-5ff5-509dec2f32a3@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 25, 2023, at 11:09, Qi Zheng <zhengqi.arch@bytedance.com> =
wrote:
>=20
>=20
>=20
> On 2023/7/25 10:35, Muchun Song wrote:
>>> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> =
wrote:
>>>=20
>>> The mm/vmscan.c file is too large, so separate the shrinker-related
>>> code from it into a separate file. No functional changes.
>>>=20
>>> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
>>> ---
>>> include/linux/shrinker.h |   3 +
>>> mm/Makefile              |   4 +-
>>> mm/shrinker.c            | 707 =
+++++++++++++++++++++++++++++++++++++++
>>> mm/vmscan.c              | 701 =
--------------------------------------
>>> 4 files changed, 712 insertions(+), 703 deletions(-)
>>> create mode 100644 mm/shrinker.c
>>>=20
>>> diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
>>> index 224293b2dd06..961cb84e51f5 100644
>>> --- a/include/linux/shrinker.h
>>> +++ b/include/linux/shrinker.h
>>> @@ -96,6 +96,9 @@ struct shrinker {
>>>  */
>>> #define SHRINKER_NONSLAB (1 << 3)
>>>=20
>>> +unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct =
mem_cgroup *memcg,
>>> +    int priority);
>> A good cleanup, vmscan.c is so huge.
>> I'd like to introduce a new header in mm/ directory and contains =
those
>> declarations of functions (like this and other debug function in
>> shrinker_debug.c) since they are used internally across mm.
>=20
> How about putting them in the mm/internal.h file?

Either is fine to me.

>=20
>> Thanks.




From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:27:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:27:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569384.889977 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9dq-0003Ne-Cj; Tue, 25 Jul 2023 04:27:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569384.889977; Tue, 25 Jul 2023 04:27:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9dq-0003Lj-0q; Tue, 25 Jul 2023 04:27:22 +0000
Received: by outflank-mailman (input) for mailman id 569384;
 Tue, 25 Jul 2023 04:27:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Yj-0002Iw-Ua
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:22:05 +0000
Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com
 [2607:f8b0:4864:20::b32])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cf77cfc5-2aa2-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 06:22:05 +0200 (CEST)
Received: by mail-yb1-xb32.google.com with SMTP id
 3f1490d57ef6-c5ffb6cda23so5568569276.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:22:05 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.22.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:22:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cf77cfc5-2aa2-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258924; x=1690863724;
        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=NG13BwzmmAIpXpcduEwvRHFbS3iQhU18W2JpKLteVDY=;
        b=GBQqKOXR4MY0Ps6Ytzn9QjLc5kcnNARqYVMOSqCl4nxxP5zueTINjr7iMbjZhk8uU1
         uF+ZNdDLWemlb8QXVTn60jLorPF4KaxuajyPq7XQ8ZCUpgrsfyxcNU4aZsjJHBdfgv4V
         f3SehFOrdMCWYaV3GNfOxXZlwwtfQps2pLwSnw0r1MZbny4VXC0cZl+5ECg/uwswSkJJ
         2spe5/EA1yI0VqTuQ1Drr9GEQcMwkhM/FKbElCEbuZdJkSdi81Zbahgosic5IMYJMWsY
         zz7YF2FVGFBOrfl6ZnWHbV39qhmx668oKEAvnRRKMjMLLqABK50UfsT2Oc13y2cvxYxd
         xuhw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258924; x=1690863724;
        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=NG13BwzmmAIpXpcduEwvRHFbS3iQhU18W2JpKLteVDY=;
        b=PMRaDkoZNCaRbOaRnbUN1wAVrRs8iX+YHSchPqsiocZvhRdOy8wYtNgevBws4Sbs0H
         7xIzR8EdHmuNk9agLw4vYvRcqbXPECowF34pzupimFPTIVA+V7nB/uIZAixebOIMA49K
         OfN17x2J4oU4r6H/Qn6bJHKJsp1f3LC1ThKDyAGxNN3RF4W9EQ/EkvEpTewbY9H5pgBc
         heMCgrwwGorb5gMWBs9EwBC3kQa9J/zvs006ZIZ5rDSUYjC2YZuduOXMexTLj5j9JQeH
         FvKunre9VgmNp66R3UCq7jODMCaT0gv9FpiUBNJAriq27pRd7I5jkgtoXDXK3c2ut2qk
         yZOQ==
X-Gm-Message-State: ABy/qLYeI5x3v0In8PF+YQxGSwUzdyzXnoglttRqYhgEEXcHdW1CDfK8
	9Wa97c4K7bab9TDLq/jLYiw=
X-Google-Smtp-Source: APBJJlFIEKBO4FnrV/9ajkbTKUo/vEdRCYW7kk6X3z3g19puIv3mx6us1kMtRHRFLnY2I/2ODsKhEw==
X-Received: by 2002:a25:2309:0:b0:d0d:2d82:7a27 with SMTP id j9-20020a252309000000b00d0d2d827a27mr4389099ybj.13.1690258924402;
        Mon, 24 Jul 2023 21:22:04 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 27/31] sh: Convert pte_free_tlb() to use ptdescs
Date: Mon, 24 Jul 2023 21:20:47 -0700
Message-Id: <20230725042051.36691-28-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents. Also cleans up some spacing issues.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/sh/include/asm/pgalloc.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/sh/include/asm/pgalloc.h b/arch/sh/include/asm/pgalloc.h
index a9e98233c4d4..5d8577ab1591 100644
--- a/arch/sh/include/asm/pgalloc.h
+++ b/arch/sh/include/asm/pgalloc.h
@@ -2,6 +2,7 @@
 #ifndef __ASM_SH_PGALLOC_H
 #define __ASM_SH_PGALLOC_H
 
+#include <linux/mm.h>
 #include <asm/page.h>
 
 #define __HAVE_ARCH_PMD_ALLOC_ONE
@@ -31,10 +32,10 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
 	set_pmd(pmd, __pmd((unsigned long)page_address(pte)));
 }
 
-#define __pte_free_tlb(tlb,pte,addr)			\
-do {							\
-	pgtable_pte_page_dtor(pte);			\
-	tlb_remove_page((tlb), (pte));			\
+#define __pte_free_tlb(tlb, pte, addr)				\
+do {								\
+	pagetable_pte_dtor(page_ptdesc(pte));			\
+	tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte)));	\
 } while (0)
 
 #endif /* __ASM_SH_PGALLOC_H */
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:27:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:27:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569383.889971 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9dq-0003JP-4d; Tue, 25 Jul 2023 04:27:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569383.889971; Tue, 25 Jul 2023 04:27:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9dp-0003IO-OU; Tue, 25 Jul 2023 04:27:21 +0000
Received: by outflank-mailman (input) for mailman id 569383;
 Tue, 25 Jul 2023 04:27:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Yh-0002Iw-PJ
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:22:03 +0000
Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com
 [2607:f8b0:4864:20::b33])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ce281eb3-2aa2-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 06:22:03 +0200 (CEST)
Received: by mail-yb1-xb33.google.com with SMTP id
 3f1490d57ef6-cfcebc33d04so5670217276.2
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:22:03 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.22.00
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:22:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ce281eb3-2aa2-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258922; x=1690863722;
        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=3wtNkjiFE1rjq7ZRDFNmpMqdu/3EA/QyC8BNR6xlaRk=;
        b=iu7T9ShRTfGWqcA5uJNn48P7ITBijMcZXksGMFFsSIJDj0VmHTYECkWvPEWNMN60a1
         IUYR/sDhh53Vy6dzUT6UahYzj05kYwH8neXcRQGMrWnafyF9Nggmi7HojAqo4PR9lKrk
         02FdxS1l6wceDUexmcvfeLaN7cB/yf3NJTMHz8qA/qhQubNB4zuidHLrnfC+CD9FthdV
         DmB6BJ+22VwMurCnw4NmkeKklt87ZDgX5spGKsnDe9xsWqCmiOPReZ8vAaZPSBJPyLEZ
         EQXlbCfDgq90/zCmmXSE8cDOoCHltzy9M5tcZZJw0IWtubbSaQTI0PoE70blt5u8J64C
         txJg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258922; x=1690863722;
        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=3wtNkjiFE1rjq7ZRDFNmpMqdu/3EA/QyC8BNR6xlaRk=;
        b=bh4Col8xdEuoUFSKmaUW3oQZLSIsWU5r5xdk3irXxO3Nx/CaaMmXmwx4/5vHPLoAs6
         G9Z4JPZnKBl5hr7KjN0zqAUbXZobto7Obe2Fxua8bFGziGyFZ0fqCgKMLJSD5jOYZk3T
         cY3Bt+RquKPR6Gs0FR5jFfEalFqcigZeJ2V7bOfHjzq9ahUy6OzKS181QJ+eTvgJfKqd
         VjxfJjoq3JjikEdDwAlD2AZL9Q/tKkgIQlc0gTWIjSD/4QFTmexANCoE+VY4+VIxxfxy
         Ff6SBhn9qrObx6GkLCVI5DTprtOSsF4H4U3IbjKCjZtSQjtPfJFHenRtWA+pd0yJaDJX
         0Nqg==
X-Gm-Message-State: ABy/qLb7ayP+frBu11DoVot0XjqE7463y8hhl/dThBvyBdcENftDrySO
	WtyT5KAOzqGdR3CxpH6/4rQ=
X-Google-Smtp-Source: APBJJlGfBdwhSlxwyOaXtB0+Cx5VSBUjcB1Wb8y8NRWIESkjts+Gr4L0lqHFPdNq/1caH3RyI0GElw==
X-Received: by 2002:a05:6902:cb:b0:bc9:92c9:7fd1 with SMTP id i11-20020a05690200cb00b00bc992c97fd1mr8566515ybs.3.1690258922187;
        Mon, 24 Jul 2023 21:22:02 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@rivosinc.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 26/31] riscv: Convert alloc_{pmd, pte}_late() to use ptdescs
Date: Mon, 24 Jul 2023 21:20:46 -0700
Message-Id: <20230725042051.36691-27-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

Some of the functions use the *get*page*() helper functions. Convert
these to use pagetable_alloc() and ptdesc_address() instead to help
standardize page tables further.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/riscv/include/asm/pgalloc.h |  8 ++++----
 arch/riscv/mm/init.c             | 16 ++++++----------
 2 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/arch/riscv/include/asm/pgalloc.h b/arch/riscv/include/asm/pgalloc.h
index 59dc12b5b7e8..d169a4f41a2e 100644
--- a/arch/riscv/include/asm/pgalloc.h
+++ b/arch/riscv/include/asm/pgalloc.h
@@ -153,10 +153,10 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 
 #endif /* __PAGETABLE_PMD_FOLDED */
 
-#define __pte_free_tlb(tlb, pte, buf)   \
-do {                                    \
-	pgtable_pte_page_dtor(pte);     \
-	tlb_remove_page((tlb), pte);    \
+#define __pte_free_tlb(tlb, pte, buf)			\
+do {							\
+	pagetable_pte_dtor(page_ptdesc(pte));		\
+	tlb_remove_page_ptdesc((tlb), page_ptdesc(pte));\
 } while (0)
 #endif /* CONFIG_MMU */
 
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 9ce504737d18..430a3d05a841 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -353,12 +353,10 @@ static inline phys_addr_t __init alloc_pte_fixmap(uintptr_t va)
 
 static phys_addr_t __init alloc_pte_late(uintptr_t va)
 {
-	unsigned long vaddr;
-
-	vaddr = __get_free_page(GFP_KERNEL);
-	BUG_ON(!vaddr || !pgtable_pte_page_ctor(virt_to_page((void *)vaddr)));
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL & ~__GFP_HIGHMEM, 0);
 
-	return __pa(vaddr);
+	BUG_ON(!ptdesc || !pagetable_pte_ctor(ptdesc));
+	return __pa((pte_t *)ptdesc_address(ptdesc));
 }
 
 static void __init create_pte_mapping(pte_t *ptep,
@@ -436,12 +434,10 @@ static phys_addr_t __init alloc_pmd_fixmap(uintptr_t va)
 
 static phys_addr_t __init alloc_pmd_late(uintptr_t va)
 {
-	unsigned long vaddr;
-
-	vaddr = __get_free_page(GFP_KERNEL);
-	BUG_ON(!vaddr || !pgtable_pmd_page_ctor(virt_to_page((void *)vaddr)));
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL & ~__GFP_HIGHMEM, 0);
 
-	return __pa(vaddr);
+	BUG_ON(!ptdesc || !pagetable_pmd_ctor(ptdesc));
+	return __pa((pmd_t *)ptdesc_address(ptdesc));
 }
 
 static void __init create_pmd_mapping(pmd_t *pmdp,
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:27:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:27:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569382.889965 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9dp-0003FS-M3; Tue, 25 Jul 2023 04:27:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569382.889965; Tue, 25 Jul 2023 04:27:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9dp-0003ET-FR; Tue, 25 Jul 2023 04:27:21 +0000
Received: by outflank-mailman (input) for mailman id 569382;
 Tue, 25 Jul 2023 04:27:20 +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
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Yg-00023t-RC
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:22:02 +0000
Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com
 [2607:f8b0:4864:20::b32])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ccea9428-2aa2-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:22:01 +0200 (CEST)
Received: by mail-yb1-xb32.google.com with SMTP id
 3f1490d57ef6-ca3cc52ee62so5589308276.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:22:01 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.58
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ccea9428-2aa2-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258920; x=1690863720;
        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=0AnRv7d38hHUVaoAGins0CaWMMRgzo0GwUb20Y9YoSw=;
        b=pF3/aUrb3JX49e0u22fW9ciATl7u+MUedSxMIodJhkvCSur2UbV1ymLo02TZ+J+kPF
         Kx5HeDHnWoCFEiMJQRkEFLmGeKvRgst1SRco5Nf2sutYKL2w+MtMEjm9RYoVaVV/WbaV
         YVQVPd7LOUuBtkmGFl+FmiiuwqN1u54q2lW5pHrezKOb3piONF3+v81Wt/4bQq44saNJ
         XmrP/XQPqOefJAz6PJqT1BLnizFGrc2xSl/LadxebvB7doG0PAx8D01yebNX4JhyxCLk
         tgaBucE6SVITexqLzDjpMrpbMyKpy8WP6lMzfEvzG49OmJW0+1GrWwpk6bQXNmC80wMv
         +HWQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258920; x=1690863720;
        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=0AnRv7d38hHUVaoAGins0CaWMMRgzo0GwUb20Y9YoSw=;
        b=EMYqwr815s01XR4R6LBGG2Pu+6IMyGgqCtN9RWfsA6vsbeLJ0q+1D8h+w1qd8rINx1
         3zIaG7RzEfFMOxHcD2b2pB8gLkv/9YCwv0E/LTyJVaUbbscFHdVHsl2KYJHwriuue/rj
         4qr1L0+G4qGw/5lp2Jkbmg+b7C/8UNASxqkC75noKTJSdda1wk0/T6EsaVTD5DFSe3xY
         58CeGLAZN+LH78mpE3hOPLVnGtus0/jJTfelxQo4RLpLZHgD2S/PGGxrXfs3DPWQgWP2
         ctvWAdQuROaMRVg3v0G/3fv4elHNTE0BRTkc75KfHUlSOZvCqKCaeS3Fw0+/RSIm04U9
         0Hrw==
X-Gm-Message-State: ABy/qLbXJIyde/9CrSXoCi4M6oaaXN4392H8OhqA16h5Wpy7aQ3SxG9x
	KLT4HQ163SCplnlRfuUkxxE=
X-Google-Smtp-Source: APBJJlEdkcahnNVyEvlWTLDmpaRsWSF5WciOnYxL0p0ce55MSQlJt+bgPnW2jeW0QxRihWyF8hwpDQ==
X-Received: by 2002:a25:ac42:0:b0:d0a:da40:638e with SMTP id r2-20020a25ac42000000b00d0ada40638emr6436068ybd.12.1690258920108;
        Mon, 24 Jul 2023 21:22:00 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Jonas Bonn <jonas@southpole.se>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 25/31] openrisc: Convert __pte_free_tlb() to use ptdescs
Date: Mon, 24 Jul 2023 21:20:45 -0700
Message-Id: <20230725042051.36691-26-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/openrisc/include/asm/pgalloc.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/openrisc/include/asm/pgalloc.h b/arch/openrisc/include/asm/pgalloc.h
index b7b2b8d16fad..c6a73772a546 100644
--- a/arch/openrisc/include/asm/pgalloc.h
+++ b/arch/openrisc/include/asm/pgalloc.h
@@ -66,10 +66,10 @@ extern inline pgd_t *pgd_alloc(struct mm_struct *mm)
 
 extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm);
 
-#define __pte_free_tlb(tlb, pte, addr)	\
-do {					\
-	pgtable_pte_page_dtor(pte);	\
-	tlb_remove_page((tlb), (pte));	\
+#define __pte_free_tlb(tlb, pte, addr)				\
+do {								\
+	pagetable_pte_dtor(page_ptdesc(pte));			\
+	tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte)));	\
 } while (0)
 
 #endif
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:27:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:27:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569390.890001 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9ds-0003wx-3T; Tue, 25 Jul 2023 04:27:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569390.890001; Tue, 25 Jul 2023 04:27:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9dr-0003vn-OF; Tue, 25 Jul 2023 04:27:23 +0000
Received: by outflank-mailman (input) for mailman id 569390;
 Tue, 25 Jul 2023 04:27:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9YT-0002Iw-DS
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:49 +0000
Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com
 [2607:f8b0:4864:20::b2c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c581a0a2-2aa2-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 06:21:48 +0200 (CEST)
Received: by mail-yb1-xb2c.google.com with SMTP id
 3f1490d57ef6-d129edb8261so1958251276.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:48 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c581a0a2-2aa2-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258908; x=1690863708;
        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=/CuYJ7liBLmFxtlpmCAIL/qtog0vkZLk1dVk72P32nA=;
        b=isSLzJlVCcu3DqkromZhEI/qWyA5zzmxG1x9IbP6194I1DKOByM/hDEPdxe0FV3MLw
         d6Rw+lHZ9WlgptdvBWiFzGMaM6KUoRlGp3xu2jda8iMy45KiL59BtGKHYho8dHuVUxG+
         hJLuMObqibUKBJwga6VwRPSAoh79vGoLNGxF2cxBKo1aHJdauK67/yOhDfLuLDKzblyJ
         F0wgtxLKGut1KlZ4xgsSxueuM+T0O4hKbp6cFWk4PiHYX5rGa1VxC3c5t+U93CbfreQA
         BhDLct+PPc5ibyvQ9RmPu/T+BvIQhbpSiLzGAmfokkxsUZTkKg3EAjaoANJECHoNxZLs
         xbZw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258908; x=1690863708;
        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=/CuYJ7liBLmFxtlpmCAIL/qtog0vkZLk1dVk72P32nA=;
        b=QF0UD9785MqjvOX+J6gWWGtK68tazYUWxEO2tWFaD7+eFJz4BelP1G3fJKpSdB5Ry+
         QD63rnJV1J7HW5eH1imtL2IvfpZEZGoCZEp9dazlSbKmXEezZg70uGKs+/8Q7BZW2Y/J
         Tu216Cs+uw4Sish9whTytnj0lDZhhDoiR7Je/KIWFffGTho9hgIlJjBllCZcWvPllB51
         QYy3hsKvgMEvcfM43dprMQ85YR5dVpHkvTsyjSl7OuOloxHGZ+M1yxQu8GP0c3iMaB6Q
         MyJ2cETv9t/ZENKvJcAavDTT3LTtwJ3Faugg79lNeozKeCZGra9CwhS3lcuuHd4P2DFe
         1xgw==
X-Gm-Message-State: ABy/qLaJ9Q0KJhEDaxZc0sWVFetIVqLBSckSp9vh1Iq5fYNfxVd+xxkI
	GmSHBhhznVzVDdnvGdcfvZk=
X-Google-Smtp-Source: APBJJlE3eJKl34GJI9esPlRffLNepF5AyEOkc7MEH4MKJMttiyYPB1pXgCmUyzmySa6Xjpm5Cuhodw==
X-Received: by 2002:a25:b08a:0:b0:d07:1a89:2e73 with SMTP id f10-20020a25b08a000000b00d071a892e73mr1367996ybj.28.1690258907697;
        Mon, 24 Jul 2023 21:21:47 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Guo Ren <guoren@kernel.org>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 19/31] csky: Convert __pte_free_tlb() to use ptdescs
Date: Mon, 24 Jul 2023 21:20:39 -0700
Message-Id: <20230725042051.36691-20-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Guo Ren <guoren@kernel.org>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/csky/include/asm/pgalloc.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/csky/include/asm/pgalloc.h b/arch/csky/include/asm/pgalloc.h
index 7d57e5da0914..9c84c9012e53 100644
--- a/arch/csky/include/asm/pgalloc.h
+++ b/arch/csky/include/asm/pgalloc.h
@@ -63,8 +63,8 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 
 #define __pte_free_tlb(tlb, pte, address)		\
 do {							\
-	pgtable_pte_page_dtor(pte);			\
-	tlb_remove_page(tlb, pte);			\
+	pagetable_pte_dtor(page_ptdesc(pte));		\
+	tlb_remove_page_ptdesc(tlb, page_ptdesc(pte));	\
 } while (0)
 
 extern void pagetable_init(void);
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:27:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:27:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569381.889961 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9dp-0003Ch-DJ; Tue, 25 Jul 2023 04:27:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569381.889961; Tue, 25 Jul 2023 04:27:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9dp-0003CV-7f; Tue, 25 Jul 2023 04:27:21 +0000
Received: by outflank-mailman (input) for mailman id 569381;
 Tue, 25 Jul 2023 04:27:20 +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
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9YW-00023t-Gf
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:52 +0000
Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com
 [2607:f8b0:4864:20::b2c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c6c40f70-2aa2-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:21:51 +0200 (CEST)
Received: by mail-yb1-xb2c.google.com with SMTP id
 3f1490d57ef6-d066d72eb12so4536318276.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:50 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.47
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c6c40f70-2aa2-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258910; x=1690863710;
        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=aUnc1suNAj/KzreaB6s7vAsOWiJZx3FNBLzDbQjj/SU=;
        b=f6oxEdexqW7t8O18O1zlBzEMy1/ySz1lSWwZIgvC+6ZdC+AQVNOOjrUGsL3n8z9yLs
         jC/oIvWOegKfTXKYCqEjhGYC8DO1R1+qqiiOoaRmFe+GV40qDgP7vCBrkhQ8/QoelGjZ
         6zYUNV4SeVX24QIWi1/OsGEJx1KydkZGoq9ape10nJTNyMWr+pQqOvmxVzCb+3U9sgmC
         ze1LeRMHMeTo2LxUzcGxr55PmnWGKX2eITQpSi6L0WDbS9ycLs9Jos/2PAo+dLuVd9aS
         LiJCpXRUIDud7YKdN1pv+EIwqPuZ42v47LQ3yS2kQDdlx8gJ3/GU5UxByOmc+boocCVB
         ZyIQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258910; x=1690863710;
        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=aUnc1suNAj/KzreaB6s7vAsOWiJZx3FNBLzDbQjj/SU=;
        b=jqC6l07dy62O7Jv5s0xZDVJ6TETyoX8RnDVKi2NdlYjPSAb4CATfC/Aqb4ha9woHIg
         pCRjj8GROwJTzmoNYrAWoUytCjdVh5+aQVfWKaxqosHRkjyhPnn0wvu5znToUOPDMIBQ
         b5kPKr1959i17EGUFsJ86yS8Gk7NvKsHpst7w8QigAMyoJkE06+LPdHCsM5ryOiPCvJL
         Ut/LxgYp9RGY1v4dV2teP7CXeDBCUwQQoolHB0hiLNbaQ1sWX9kVW5zuc+DSbKvVaYU4
         rQeGKLGjS+BvtBj9yhAB6m6kmkX86JNeISyO3KysV/IPkhPwj1jn6FCl6o4VDhL2y+tQ
         Fa/g==
X-Gm-Message-State: ABy/qLbV604YmjmLu65zqUmTlCAAW94Y32KZsAb04jpIVeJsSEBz92Ag
	31QQf3xk4uoaiONTls8UozE=
X-Google-Smtp-Source: APBJJlE5+Qlh5eptk2IDiumLzwzdgKuW8E4L+dGkDhCtXpTjXCpZJt13f1YzsO4C3URc73BGKhlHpg==
X-Received: by 2002:a25:6814:0:b0:d0a:3876:a22a with SMTP id d20-20020a256814000000b00d0a3876a22amr1377987ybc.4.1690258909714;
        Mon, 24 Jul 2023 21:21:49 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 20/31] hexagon: Convert __pte_free_tlb() to use ptdescs
Date: Mon, 24 Jul 2023 21:20:40 -0700
Message-Id: <20230725042051.36691-21-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/hexagon/include/asm/pgalloc.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/hexagon/include/asm/pgalloc.h b/arch/hexagon/include/asm/pgalloc.h
index f0c47e6a7427..55988625e6fb 100644
--- a/arch/hexagon/include/asm/pgalloc.h
+++ b/arch/hexagon/include/asm/pgalloc.h
@@ -87,10 +87,10 @@ static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
 		max_kernel_seg = pmdindex;
 }
 
-#define __pte_free_tlb(tlb, pte, addr)		\
-do {						\
-	pgtable_pte_page_dtor((pte));		\
-	tlb_remove_page((tlb), (pte));		\
+#define __pte_free_tlb(tlb, pte, addr)				\
+do {								\
+	pagetable_pte_dtor((page_ptdesc(pte)));			\
+	tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte)));	\
 } while (0)
 
 #endif
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:27:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:27:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569385.889983 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9dq-0003VP-Ni; Tue, 25 Jul 2023 04:27:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569385.889983; Tue, 25 Jul 2023 04:27:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9dq-0003Te-EO; Tue, 25 Jul 2023 04:27:22 +0000
Received: by outflank-mailman (input) for mailman id 569385;
 Tue, 25 Jul 2023 04:27:20 +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
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9YJ-00023t-AX
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:39 +0000
Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com
 [2607:f8b0:4864:20::b36])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id be9e996b-2aa2-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:21:37 +0200 (CEST)
Received: by mail-yb1-xb36.google.com with SMTP id
 3f1490d57ef6-d10354858e8so1903814276.2
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:37 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: be9e996b-2aa2-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258896; x=1690863696;
        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=HTuFXf3k0XF+iUx9+PEFpsWUTVtSma2QbqtalFKJ0Mg=;
        b=QrRJzaA03gdUbTqzHfmEzG/SCLN8TfMO31W01m+ZWQlnbcrzlb4tYT+35zeJjfW06z
         9U9gt9lsV+tgAHhZ8n35SKI0CeQMqkEFGZ5B5orgn4svLxjBxl6Jzaq1tScsN4cutOyY
         MBojHX9rcIUgj3E6lWh0fv0eOSaMCWjRoxbQUhG1aAVpaeKYRSQsFSUSSXXm+4gUld+4
         AAwiKYy7kKhjXb8bIEfD9zbtO0aneFF+lO/xjXVcWjg9cVHeUj4bupcxDkGJc2fLy1IN
         +ECwgNBBuGb+qDcAZhQy4/GreCi4XEqGLy5ZaCaADXrFmYS9d/RmD/xlr0+TZwqE0RSU
         qvRg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258896; x=1690863696;
        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=HTuFXf3k0XF+iUx9+PEFpsWUTVtSma2QbqtalFKJ0Mg=;
        b=Njcpg+ryS4YxSdsPV7QeI+ugIhHj42TJyaya1QLCnoXgj7jwvXnBG16e0kIEcEQ0pc
         dn0n+Qncup4wRyuqp40VVG072uJHcbEFfc3lbX6IKJKbUrpN82eRVmb5LI+uEFcTGXh6
         j48tSFtsS8rv0Q7u6K0pV0D0lzZJPI7UaI7adDvlcuFd+ixLtf+K2RN+/ahDcQdrP5j4
         4a4Uxg6hEe+3fnFD+Jq+FiPlnDZdynLROK3EzxEmxWFHkFO09y1cphaatCIxCpRVOuHZ
         Ymzd2hjNH4nnzXVSyWt0E40mnoOS8iRwNJ2FBoMH0v6oMUqBbN+XdcHF2AQ80fYh7vWC
         lxRw==
X-Gm-Message-State: ABy/qLaxra+PpLYFwzO4jNdYNRYgSyxh6/5fsKE1Ov69rlXh69nD97qw
	+jMKe5mRRCqCJqjR37Nh4jg=
X-Google-Smtp-Source: APBJJlEki8LDrmeLBLq59XmoJzB5sRXzAtgIv4vzSjEn99cb+IjR/JJiSJaFtdPyyxG1wP2vNvhZ2w==
X-Received: by 2002:a25:8e0d:0:b0:d13:80a0:b428 with SMTP id p13-20020a258e0d000000b00d1380a0b428mr2932580ybl.3.1690258896011;
        Mon, 24 Jul 2023 21:21:36 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	David Hildenbrand <david@redhat.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 14/31] s390: Convert various pgalloc functions to use ptdescs
Date: Mon, 24 Jul 2023 21:20:34 -0700
Message-Id: <20230725042051.36691-15-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

Some of the functions use the *get*page*() helper functions. Convert
these to use pagetable_alloc() and ptdesc_address() instead to help
standardize page tables further.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/s390/include/asm/pgalloc.h |   4 +-
 arch/s390/include/asm/tlb.h     |   4 +-
 arch/s390/mm/pgalloc.c          | 128 ++++++++++++++++----------------
 3 files changed, 69 insertions(+), 67 deletions(-)

diff --git a/arch/s390/include/asm/pgalloc.h b/arch/s390/include/asm/pgalloc.h
index 89a9d5ef94f8..376b4b23bdaa 100644
--- a/arch/s390/include/asm/pgalloc.h
+++ b/arch/s390/include/asm/pgalloc.h
@@ -86,7 +86,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
 	if (!table)
 		return NULL;
 	crst_table_init(table, _SEGMENT_ENTRY_EMPTY);
-	if (!pgtable_pmd_page_ctor(virt_to_page(table))) {
+	if (!pagetable_pmd_ctor(virt_to_ptdesc(table))) {
 		crst_table_free(mm, table);
 		return NULL;
 	}
@@ -97,7 +97,7 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
 {
 	if (mm_pmd_folded(mm))
 		return;
-	pgtable_pmd_page_dtor(virt_to_page(pmd));
+	pagetable_pmd_dtor(virt_to_ptdesc(pmd));
 	crst_table_free(mm, (unsigned long *) pmd);
 }
 
diff --git a/arch/s390/include/asm/tlb.h b/arch/s390/include/asm/tlb.h
index b91f4a9b044c..383b1f91442c 100644
--- a/arch/s390/include/asm/tlb.h
+++ b/arch/s390/include/asm/tlb.h
@@ -89,12 +89,12 @@ static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd,
 {
 	if (mm_pmd_folded(tlb->mm))
 		return;
-	pgtable_pmd_page_dtor(virt_to_page(pmd));
+	pagetable_pmd_dtor(virt_to_ptdesc(pmd));
 	__tlb_adjust_range(tlb, address, PAGE_SIZE);
 	tlb->mm->context.flush_mm = 1;
 	tlb->freed_tables = 1;
 	tlb->cleared_puds = 1;
-	tlb_remove_table(tlb, pmd);
+	tlb_remove_ptdesc(tlb, pmd);
 }
 
 /*
diff --git a/arch/s390/mm/pgalloc.c b/arch/s390/mm/pgalloc.c
index d7374add7820..07fc660a24aa 100644
--- a/arch/s390/mm/pgalloc.c
+++ b/arch/s390/mm/pgalloc.c
@@ -43,17 +43,17 @@ __initcall(page_table_register_sysctl);
 
 unsigned long *crst_table_alloc(struct mm_struct *mm)
 {
-	struct page *page = alloc_pages(GFP_KERNEL, CRST_ALLOC_ORDER);
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL, CRST_ALLOC_ORDER);
 
-	if (!page)
+	if (!ptdesc)
 		return NULL;
-	arch_set_page_dat(page, CRST_ALLOC_ORDER);
-	return (unsigned long *) page_to_virt(page);
+	arch_set_page_dat(ptdesc_page(ptdesc), CRST_ALLOC_ORDER);
+	return (unsigned long *) ptdesc_to_virt(ptdesc);
 }
 
 void crst_table_free(struct mm_struct *mm, unsigned long *table)
 {
-	free_pages((unsigned long)table, CRST_ALLOC_ORDER);
+	pagetable_free(virt_to_ptdesc(table));
 }
 
 static void __crst_table_upgrade(void *arg)
@@ -140,21 +140,21 @@ static inline unsigned int atomic_xor_bits(atomic_t *v, unsigned int bits)
 
 struct page *page_table_alloc_pgste(struct mm_struct *mm)
 {
-	struct page *page;
+	struct ptdesc *ptdesc;
 	u64 *table;
 
-	page = alloc_page(GFP_KERNEL);
-	if (page) {
-		table = (u64 *)page_to_virt(page);
+	ptdesc = pagetable_alloc(GFP_KERNEL, 0);
+	if (ptdesc) {
+		table = (u64 *)ptdesc_to_virt(ptdesc);
 		memset64(table, _PAGE_INVALID, PTRS_PER_PTE);
 		memset64(table + PTRS_PER_PTE, 0, PTRS_PER_PTE);
 	}
-	return page;
+	return ptdesc_page(ptdesc);
 }
 
 void page_table_free_pgste(struct page *page)
 {
-	__free_page(page);
+	pagetable_free(page_ptdesc(page));
 }
 
 #endif /* CONFIG_PGSTE */
@@ -242,7 +242,7 @@ void page_table_free_pgste(struct page *page)
 unsigned long *page_table_alloc(struct mm_struct *mm)
 {
 	unsigned long *table;
-	struct page *page;
+	struct ptdesc *ptdesc;
 	unsigned int mask, bit;
 
 	/* Try to get a fragment of a 4K page as a 2K page table */
@@ -250,9 +250,9 @@ unsigned long *page_table_alloc(struct mm_struct *mm)
 		table = NULL;
 		spin_lock_bh(&mm->context.lock);
 		if (!list_empty(&mm->context.pgtable_list)) {
-			page = list_first_entry(&mm->context.pgtable_list,
-						struct page, lru);
-			mask = atomic_read(&page->_refcount) >> 24;
+			ptdesc = list_first_entry(&mm->context.pgtable_list,
+						struct ptdesc, pt_list);
+			mask = atomic_read(&ptdesc->_refcount) >> 24;
 			/*
 			 * The pending removal bits must also be checked.
 			 * Failure to do so might lead to an impossible
@@ -264,13 +264,13 @@ unsigned long *page_table_alloc(struct mm_struct *mm)
 			 */
 			mask = (mask | (mask >> 4)) & 0x03U;
 			if (mask != 0x03U) {
-				table = (unsigned long *) page_to_virt(page);
+				table = (unsigned long *) ptdesc_to_virt(ptdesc);
 				bit = mask & 1;		/* =1 -> second 2K */
 				if (bit)
 					table += PTRS_PER_PTE;
-				atomic_xor_bits(&page->_refcount,
+				atomic_xor_bits(&ptdesc->_refcount,
 							0x01U << (bit + 24));
-				list_del_init(&page->lru);
+				list_del_init(&ptdesc->pt_list);
 			}
 		}
 		spin_unlock_bh(&mm->context.lock);
@@ -278,28 +278,28 @@ unsigned long *page_table_alloc(struct mm_struct *mm)
 			return table;
 	}
 	/* Allocate a fresh page */
-	page = alloc_page(GFP_KERNEL);
-	if (!page)
+	ptdesc = pagetable_alloc(GFP_KERNEL, 0);
+	if (!ptdesc)
 		return NULL;
-	if (!pgtable_pte_page_ctor(page)) {
-		__free_page(page);
+	if (!pagetable_pte_ctor(ptdesc)) {
+		pagetable_free(ptdesc);
 		return NULL;
 	}
-	arch_set_page_dat(page, 0);
+	arch_set_page_dat(ptdesc_page(ptdesc), 0);
 	/* Initialize page table */
-	table = (unsigned long *) page_to_virt(page);
+	table = (unsigned long *) ptdesc_to_virt(ptdesc);
 	if (mm_alloc_pgste(mm)) {
 		/* Return 4K page table with PGSTEs */
-		INIT_LIST_HEAD(&page->lru);
-		atomic_xor_bits(&page->_refcount, 0x03U << 24);
+		INIT_LIST_HEAD(&ptdesc->pt_list);
+		atomic_xor_bits(&ptdesc->_refcount, 0x03U << 24);
 		memset64((u64 *)table, _PAGE_INVALID, PTRS_PER_PTE);
 		memset64((u64 *)table + PTRS_PER_PTE, 0, PTRS_PER_PTE);
 	} else {
 		/* Return the first 2K fragment of the page */
-		atomic_xor_bits(&page->_refcount, 0x01U << 24);
+		atomic_xor_bits(&ptdesc->_refcount, 0x01U << 24);
 		memset64((u64 *)table, _PAGE_INVALID, 2 * PTRS_PER_PTE);
 		spin_lock_bh(&mm->context.lock);
-		list_add(&page->lru, &mm->context.pgtable_list);
+		list_add(&ptdesc->pt_list, &mm->context.pgtable_list);
 		spin_unlock_bh(&mm->context.lock);
 	}
 	return table;
@@ -322,19 +322,18 @@ static void page_table_release_check(struct page *page, void *table,
 
 static void pte_free_now(struct rcu_head *head)
 {
-	struct page *page;
+	struct ptdesc *ptdesc;
 
-	page = container_of(head, struct page, rcu_head);
-	pgtable_pte_page_dtor(page);
-	__free_page(page);
+	ptdesc = container_of(head, struct ptdesc, pt_rcu_head);
+	pagetable_pte_dtor(ptdesc);
+	pagetable_free(ptdesc);
 }
 
 void page_table_free(struct mm_struct *mm, unsigned long *table)
 {
 	unsigned int mask, bit, half;
-	struct page *page;
+	struct ptdesc *ptdesc = virt_to_ptdesc(table);
 
-	page = virt_to_page(table);
 	if (!mm_alloc_pgste(mm)) {
 		/* Free 2K page table fragment of a 4K page */
 		bit = ((unsigned long) table & ~PAGE_MASK)/(PTRS_PER_PTE*sizeof(pte_t));
@@ -344,51 +343,50 @@ void page_table_free(struct mm_struct *mm, unsigned long *table)
 		 * will happen outside of the critical section from this
 		 * function or from __tlb_remove_table()
 		 */
-		mask = atomic_xor_bits(&page->_refcount, 0x11U << (bit + 24));
+		mask = atomic_xor_bits(&ptdesc->_refcount, 0x11U << (bit + 24));
 		mask >>= 24;
-		if ((mask & 0x03U) && !PageActive(page)) {
+		if ((mask & 0x03U) && !folio_test_active(ptdesc_folio(ptdesc))) {
 			/*
 			 * Other half is allocated, and neither half has had
 			 * its free deferred: add page to head of list, to make
 			 * this freed half available for immediate reuse.
 			 */
-			list_add(&page->lru, &mm->context.pgtable_list);
+			list_add(&ptdesc->pt_list, &mm->context.pgtable_list);
 		} else {
 			/* If page is on list, now remove it. */
-			list_del_init(&page->lru);
+			list_del_init(&ptdesc->pt_list);
 		}
 		spin_unlock_bh(&mm->context.lock);
-		mask = atomic_xor_bits(&page->_refcount, 0x10U << (bit + 24));
+		mask = atomic_xor_bits(&ptdesc->_refcount, 0x10U << (bit + 24));
 		mask >>= 24;
 		if (mask != 0x00U)
 			return;
 		half = 0x01U << bit;
 	} else {
 		half = 0x03U;
-		mask = atomic_xor_bits(&page->_refcount, 0x03U << 24);
+		mask = atomic_xor_bits(&ptdesc->_refcount, 0x03U << 24);
 		mask >>= 24;
 	}
 
-	page_table_release_check(page, table, half, mask);
-	if (TestClearPageActive(page))
-		call_rcu(&page->rcu_head, pte_free_now);
+	page_table_release_check(ptdesc_page(ptdesc), table, half, mask);
+	if (folio_test_clear_active(ptdesc_folio(ptdesc)))
+		call_rcu(&ptdesc->pt_rcu_head, pte_free_now);
 	else
-		pte_free_now(&page->rcu_head);
+		pte_free_now(&ptdesc->pt_rcu_head);
 }
 
 void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table,
 			 unsigned long vmaddr)
 {
 	struct mm_struct *mm;
-	struct page *page;
 	unsigned int bit, mask;
+	struct ptdesc *ptdesc = virt_to_ptdesc(table);
 
 	mm = tlb->mm;
-	page = virt_to_page(table);
 	if (mm_alloc_pgste(mm)) {
 		gmap_unlink(mm, table, vmaddr);
 		table = (unsigned long *) ((unsigned long)table | 0x03U);
-		tlb_remove_table(tlb, table);
+		tlb_remove_ptdesc(tlb, table);
 		return;
 	}
 	bit = ((unsigned long) table & ~PAGE_MASK) / (PTRS_PER_PTE*sizeof(pte_t));
@@ -398,19 +396,19 @@ void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table,
 	 * outside of the critical section from __tlb_remove_table() or from
 	 * page_table_free()
 	 */
-	mask = atomic_xor_bits(&page->_refcount, 0x11U << (bit + 24));
+	mask = atomic_xor_bits(&ptdesc->_refcount, 0x11U << (bit + 24));
 	mask >>= 24;
-	if ((mask & 0x03U) && !PageActive(page)) {
+	if ((mask & 0x03U) && !folio_test_active(ptdesc_folio(ptdesc))) {
 		/*
 		 * Other half is allocated, and neither half has had
 		 * its free deferred: add page to end of list, to make
 		 * this freed half available for reuse once its pending
 		 * bit has been cleared by __tlb_remove_table().
 		 */
-		list_add_tail(&page->lru, &mm->context.pgtable_list);
+		list_add_tail(&ptdesc->pt_list, &mm->context.pgtable_list);
 	} else {
 		/* If page is on list, now remove it. */
-		list_del_init(&page->lru);
+		list_del_init(&ptdesc->pt_list);
 	}
 	spin_unlock_bh(&mm->context.lock);
 	table = (unsigned long *) ((unsigned long) table | (0x01U << bit));
@@ -421,30 +419,30 @@ void __tlb_remove_table(void *_table)
 {
 	unsigned int mask = (unsigned long) _table & 0x03U, half = mask;
 	void *table = (void *)((unsigned long) _table ^ mask);
-	struct page *page = virt_to_page(table);
+	struct ptdesc *ptdesc = virt_to_ptdesc(table);
 
 	switch (half) {
 	case 0x00U:	/* pmd, pud, or p4d */
-		free_pages((unsigned long)table, CRST_ALLOC_ORDER);
+		pagetable_free(ptdesc);
 		return;
 	case 0x01U:	/* lower 2K of a 4K page table */
 	case 0x02U:	/* higher 2K of a 4K page table */
-		mask = atomic_xor_bits(&page->_refcount, mask << (4 + 24));
+		mask = atomic_xor_bits(&ptdesc->_refcount, mask << (4 + 24));
 		mask >>= 24;
 		if (mask != 0x00U)
 			return;
 		break;
 	case 0x03U:	/* 4K page table with pgstes */
-		mask = atomic_xor_bits(&page->_refcount, 0x03U << 24);
+		mask = atomic_xor_bits(&ptdesc->_refcount, 0x03U << 24);
 		mask >>= 24;
 		break;
 	}
 
-	page_table_release_check(page, table, half, mask);
-	if (TestClearPageActive(page))
-		call_rcu(&page->rcu_head, pte_free_now);
+	page_table_release_check(ptdesc_page(ptdesc), table, half, mask);
+	if (folio_test_clear_active(ptdesc_folio(ptdesc)))
+		call_rcu(&ptdesc->pt_rcu_head, pte_free_now);
 	else
-		pte_free_now(&page->rcu_head);
+		pte_free_now(&ptdesc->pt_rcu_head);
 }
 
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
@@ -488,16 +486,20 @@ static void base_pgt_free(unsigned long *table)
 static unsigned long *base_crst_alloc(unsigned long val)
 {
 	unsigned long *table;
+	struct ptdesc *ptdesc;
 
-	table =	(unsigned long *)__get_free_pages(GFP_KERNEL, CRST_ALLOC_ORDER);
-	if (table)
-		crst_table_init(table, val);
+	ptdesc = pagetable_alloc(GFP_KERNEL & ~__GFP_HIGHMEM, CRST_ALLOC_ORDER);
+	if (!ptdesc)
+		return NULL;
+	table = ptdesc_address(ptdesc);
+
+	crst_table_init(table, val);
 	return table;
 }
 
 static void base_crst_free(unsigned long *table)
 {
-	free_pages((unsigned long)table, CRST_ALLOC_ORDER);
+	pagetable_free(virt_to_ptdesc(table));
 }
 
 #define BASE_ADDR_END_FUNC(NAME, SIZE)					\
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:27:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:27:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569386.889993 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9dr-0003rr-I7; Tue, 25 Jul 2023 04:27:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569386.889993; Tue, 25 Jul 2023 04:27:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9dr-0003nr-8t; Tue, 25 Jul 2023 04:27:23 +0000
Received: by outflank-mailman (input) for mailman id 569386;
 Tue, 25 Jul 2023 04:27:21 +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
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9YP-00023t-EL
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:45 +0000
Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com
 [2607:f8b0:4864:20::b2d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c24a892a-2aa2-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:21:43 +0200 (CEST)
Received: by mail-yb1-xb2d.google.com with SMTP id
 3f1490d57ef6-d129edb8261so1958186276.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:43 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c24a892a-2aa2-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258902; x=1690863702;
        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=jHkn+4hWn6cNWfQmftBQOtWQYQb9iJJIYcRZZNmu6iY=;
        b=YmaPL1Vi+BQChOKWGw1MlFqz3AIULFncYrkFnUsVyfilrIdeasoH5GHm0MEpRXKgmq
         DwC9KwXiAQ3MN8gwuAbymt06/p5z+8sYZZRmtF0QZ8N7W0KJLZlIdtmS/iEXcHfRR9pY
         2ULSywNr2+fCENRH3Q/SedxdAZmlqvHkU4bXO0Iy6mLyj0C0e7FNRd96oXnepKXsjgBp
         DVfpoX3+8pHS5yXYZY0DswmNPSsrKwOikBQLnb77xz8k9ebKbrK+QxqOENWwGszD02R4
         u3nvQUFC/AuDK1NFsePOhCwUQCv2T+yjXJkyc6tTHY68z6Qz4nIbLO6jQDPO+Xjl6VQM
         RJag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258902; x=1690863702;
        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=jHkn+4hWn6cNWfQmftBQOtWQYQb9iJJIYcRZZNmu6iY=;
        b=LWcKL8HIl7BidB2ODq0sEyzbPzhPZKo3eKoMZxNo9KfqCX7t4p23afpcMnyfZS0sMp
         YDSb3oxGbp7fPF/VXENpTzToD2AyuoHU7FYbQFhPcKib+CAVmtjD7HVMjKdRT7cjX4Y0
         dSX7ccO6Y7f93bOGELBoBreVdu0EkGwOpZqS51/0rH/HlLYKuon0l+Gl+3Qv6pLxaWGE
         9Jd0P9HLfn/WGCGWBaa8g08p/oK+AlTZXB8qlyikBxPSvxIGo1eD/lR3sh0FqNDLRPhb
         s7Ad8nbYT11bNhNkdwnPqPWTGX3++mXBnvCbYV4bWuQLwEwLvUp+LdV719yRU1eDtleC
         E8nw==
X-Gm-Message-State: ABy/qLZgoqmfcGvR5/o9CsWzgoWyS/menafkyEryB/ejNKbd3uimW/FV
	BXCa1yNJdGbHHkUR99GJ4SI=
X-Google-Smtp-Source: APBJJlF19R+0iLSXwcqdh2p0QPj8gjsaDLf4/piQLSANpJDw+A6xil+mrxUfv/BGU2XCVUHQZlpYDQ==
X-Received: by 2002:a25:dbce:0:b0:bcf:e2a6:7085 with SMTP id g197-20020a25dbce000000b00bcfe2a67085mr1287878ybf.23.1690258902247;
        Mon, 24 Jul 2023 21:21:42 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 17/31] arm: Convert various functions to use ptdescs
Date: Mon, 24 Jul 2023 21:20:37 -0700
Message-Id: <20230725042051.36691-18-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

late_alloc() also uses the __get_free_pages() helper function. Convert
this to use pagetable_alloc() and ptdesc_address() instead to help
standardize page tables further.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/arm/include/asm/tlb.h | 12 +++++++-----
 arch/arm/mm/mmu.c          |  7 ++++---
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h
index b8cbe03ad260..f40d06ad5d2a 100644
--- a/arch/arm/include/asm/tlb.h
+++ b/arch/arm/include/asm/tlb.h
@@ -39,7 +39,9 @@ static inline void __tlb_remove_table(void *_table)
 static inline void
 __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, unsigned long addr)
 {
-	pgtable_pte_page_dtor(pte);
+	struct ptdesc *ptdesc = page_ptdesc(pte);
+
+	pagetable_pte_dtor(ptdesc);
 
 #ifndef CONFIG_ARM_LPAE
 	/*
@@ -50,17 +52,17 @@ __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, unsigned long addr)
 	__tlb_adjust_range(tlb, addr - PAGE_SIZE, 2 * PAGE_SIZE);
 #endif
 
-	tlb_remove_table(tlb, pte);
+	tlb_remove_ptdesc(tlb, ptdesc);
 }
 
 static inline void
 __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp, unsigned long addr)
 {
 #ifdef CONFIG_ARM_LPAE
-	struct page *page = virt_to_page(pmdp);
+	struct ptdesc *ptdesc = virt_to_ptdesc(pmdp);
 
-	pgtable_pmd_page_dtor(page);
-	tlb_remove_table(tlb, page);
+	pagetable_pmd_dtor(ptdesc);
+	tlb_remove_ptdesc(tlb, ptdesc);
 #endif
 }
 
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 13fc4bb5f792..fdeaee30d167 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -737,11 +737,12 @@ static void __init *early_alloc(unsigned long sz)
 
 static void *__init late_alloc(unsigned long sz)
 {
-	void *ptr = (void *)__get_free_pages(GFP_PGTABLE_KERNEL, get_order(sz));
+	void *ptdesc = pagetable_alloc(GFP_PGTABLE_KERNEL & ~__GFP_HIGHMEM,
+			get_order(sz));
 
-	if (!ptr || !pgtable_pte_page_ctor(virt_to_page(ptr)))
+	if (!ptdesc || !pagetable_pte_ctor(ptdesc))
 		BUG();
-	return ptr;
+	return ptdesc_to_virt(ptdesc);
 }
 
 static pte_t * __init arm_pte_alloc(pmd_t *pmd, unsigned long addr,
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:27:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:27:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569391.890007 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9ds-0004BF-LN; Tue, 25 Jul 2023 04:27:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569391.890007; Tue, 25 Jul 2023 04:27:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9ds-00047h-BI; Tue, 25 Jul 2023 04:27:24 +0000
Received: by outflank-mailman (input) for mailman id 569391;
 Tue, 25 Jul 2023 04:27:22 +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
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9YE-00023t-Mb
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:34 +0000
Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com
 [2607:f8b0:4864:20::b29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bc087547-2aa2-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:21:32 +0200 (CEST)
Received: by mail-yb1-xb29.google.com with SMTP id
 3f1490d57ef6-cc4f4351ac7so5617288276.2
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:32 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:31 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bc087547-2aa2-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258892; x=1690863692;
        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=u45KHTw4Lm2isFbqg98Xq6aGMxdNGIm/kUbyd7vxsNs=;
        b=MFgPFIETcyQZFOhpw8+4f5zUQ0n+xg0tLu3Cdkb+1dejjtG9+Sn41JCWtxba3EUBon
         STSpvH1MNNsW6So+a/tghvNI+G/Lbgp5MhbOWzErRXRSurAquyDZtOdk2dZXP+K84d5y
         2lj+wM84jK4/KJI/eNnwRBO0/O9yXdLYbiUEV5UJ1n3RcSGR2Pu1ZBK+tTmCkEf8+hqQ
         1ItBCZtJ+JMmJlssaP+CTZzrVD9IabvE2unI85k4nMXIrER2uiyvsKz70ElKaAXIai8Y
         fMscO6ZRlYBmd8LI9oEQGQcnOb2XkEpfo9N2EgAc0FnMq++qauCUPViA0CXIrh8vRr/Z
         vicQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258892; x=1690863692;
        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=u45KHTw4Lm2isFbqg98Xq6aGMxdNGIm/kUbyd7vxsNs=;
        b=jmwGF8+3Uf58uUBzURi8GHVv1+R/j43zMN7+NPQ0MpnsFZilNZztYKBkphPGyUaLQ2
         rN6hkk1sJfplXWeB827amjHbLoCxpeu8AfmdgorX0tAkpU7TRvv8HVdiC8QvXUsnEBZ/
         krNWx6axYi58tB5YXQXXj5z9zci2G1zhu+YVDnVEPynDGqSuQUo1zVd1GZipfFrGLA0u
         5WKg8AzKyVjothkzvC8qIE/hZ3vVQ+Wyc5Cqo6CrItL1rnRCdtJ7cJcIAwkui/bRkdCS
         3fL7W53PI6irrD1VhjGYNjpKJNVBRY+Yl2KZFhFUEk0Q2rYo3xlPV0imBgt/S2+sSnAq
         s/yw==
X-Gm-Message-State: ABy/qLbu89wa+AwDSxnfvcWxXbnF8RxboI4YFPF4Z3ievTG0jV1q6a0F
	MLHiW1Fc27KWrLoJu5rVr5g=
X-Google-Smtp-Source: APBJJlGXFehjpASX0xXxIrGyQXSgIbPf3Ytm7rdvcIS221Bu6qToSpB5aWuJ/dgS8MuNc8IFsSfnXw==
X-Received: by 2002:a25:7082:0:b0:d10:a134:adde with SMTP id l124-20020a257082000000b00d10a134addemr4056715ybc.53.1690258891680;
        Mon, 24 Jul 2023 21:21:31 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 12/31] powerpc: Convert various functions to use ptdescs
Date: Mon, 24 Jul 2023 21:20:32 -0700
Message-Id: <20230725042051.36691-13-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In order to split struct ptdesc from struct page, convert various
functions to use ptdescs.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/powerpc/mm/book3s64/mmu_context.c | 10 ++---
 arch/powerpc/mm/book3s64/pgtable.c     | 32 +++++++--------
 arch/powerpc/mm/pgtable-frag.c         | 56 +++++++++++++-------------
 3 files changed, 49 insertions(+), 49 deletions(-)

diff --git a/arch/powerpc/mm/book3s64/mmu_context.c b/arch/powerpc/mm/book3s64/mmu_context.c
index c766e4c26e42..1715b07c630c 100644
--- a/arch/powerpc/mm/book3s64/mmu_context.c
+++ b/arch/powerpc/mm/book3s64/mmu_context.c
@@ -246,15 +246,15 @@ static void destroy_contexts(mm_context_t *ctx)
 static void pmd_frag_destroy(void *pmd_frag)
 {
 	int count;
-	struct page *page;
+	struct ptdesc *ptdesc;
 
-	page = virt_to_page(pmd_frag);
+	ptdesc = virt_to_ptdesc(pmd_frag);
 	/* drop all the pending references */
 	count = ((unsigned long)pmd_frag & ~PAGE_MASK) >> PMD_FRAG_SIZE_SHIFT;
 	/* We allow PTE_FRAG_NR fragments from a PTE page */
-	if (atomic_sub_and_test(PMD_FRAG_NR - count, &page->pt_frag_refcount)) {
-		pgtable_pmd_page_dtor(page);
-		__free_page(page);
+	if (atomic_sub_and_test(PMD_FRAG_NR - count, &ptdesc->pt_frag_refcount)) {
+		pagetable_pmd_dtor(ptdesc);
+		pagetable_free(ptdesc);
 	}
 }
 
diff --git a/arch/powerpc/mm/book3s64/pgtable.c b/arch/powerpc/mm/book3s64/pgtable.c
index 85c84e89e3ea..1212deeabe15 100644
--- a/arch/powerpc/mm/book3s64/pgtable.c
+++ b/arch/powerpc/mm/book3s64/pgtable.c
@@ -306,22 +306,22 @@ static pmd_t *get_pmd_from_cache(struct mm_struct *mm)
 static pmd_t *__alloc_for_pmdcache(struct mm_struct *mm)
 {
 	void *ret = NULL;
-	struct page *page;
+	struct ptdesc *ptdesc;
 	gfp_t gfp = GFP_KERNEL_ACCOUNT | __GFP_ZERO;
 
 	if (mm == &init_mm)
 		gfp &= ~__GFP_ACCOUNT;
-	page = alloc_page(gfp);
-	if (!page)
+	ptdesc = pagetable_alloc(gfp, 0);
+	if (!ptdesc)
 		return NULL;
-	if (!pgtable_pmd_page_ctor(page)) {
-		__free_pages(page, 0);
+	if (!pagetable_pmd_ctor(ptdesc)) {
+		pagetable_free(ptdesc);
 		return NULL;
 	}
 
-	atomic_set(&page->pt_frag_refcount, 1);
+	atomic_set(&ptdesc->pt_frag_refcount, 1);
 
-	ret = page_address(page);
+	ret = ptdesc_address(ptdesc);
 	/*
 	 * if we support only one fragment just return the
 	 * allocated page.
@@ -331,12 +331,12 @@ static pmd_t *__alloc_for_pmdcache(struct mm_struct *mm)
 
 	spin_lock(&mm->page_table_lock);
 	/*
-	 * If we find pgtable_page set, we return
+	 * If we find ptdesc_page set, we return
 	 * the allocated page with single fragment
 	 * count.
 	 */
 	if (likely(!mm->context.pmd_frag)) {
-		atomic_set(&page->pt_frag_refcount, PMD_FRAG_NR);
+		atomic_set(&ptdesc->pt_frag_refcount, PMD_FRAG_NR);
 		mm->context.pmd_frag = ret + PMD_FRAG_SIZE;
 	}
 	spin_unlock(&mm->page_table_lock);
@@ -357,15 +357,15 @@ pmd_t *pmd_fragment_alloc(struct mm_struct *mm, unsigned long vmaddr)
 
 void pmd_fragment_free(unsigned long *pmd)
 {
-	struct page *page = virt_to_page(pmd);
+	struct ptdesc *ptdesc = virt_to_ptdesc(pmd);
 
-	if (PageReserved(page))
-		return free_reserved_page(page);
+	if (pagetable_is_reserved(ptdesc))
+		return free_reserved_ptdesc(ptdesc);
 
-	BUG_ON(atomic_read(&page->pt_frag_refcount) <= 0);
-	if (atomic_dec_and_test(&page->pt_frag_refcount)) {
-		pgtable_pmd_page_dtor(page);
-		__free_page(page);
+	BUG_ON(atomic_read(&ptdesc->pt_frag_refcount) <= 0);
+	if (atomic_dec_and_test(&ptdesc->pt_frag_refcount)) {
+		pagetable_pmd_dtor(ptdesc);
+		pagetable_free(ptdesc);
 	}
 }
 
diff --git a/arch/powerpc/mm/pgtable-frag.c b/arch/powerpc/mm/pgtable-frag.c
index 0c6b68130025..4c899c9c0694 100644
--- a/arch/powerpc/mm/pgtable-frag.c
+++ b/arch/powerpc/mm/pgtable-frag.c
@@ -18,15 +18,15 @@
 void pte_frag_destroy(void *pte_frag)
 {
 	int count;
-	struct page *page;
+	struct ptdesc *ptdesc;
 
-	page = virt_to_page(pte_frag);
+	ptdesc = virt_to_ptdesc(pte_frag);
 	/* drop all the pending references */
 	count = ((unsigned long)pte_frag & ~PAGE_MASK) >> PTE_FRAG_SIZE_SHIFT;
 	/* We allow PTE_FRAG_NR fragments from a PTE page */
-	if (atomic_sub_and_test(PTE_FRAG_NR - count, &page->pt_frag_refcount)) {
-		pgtable_pte_page_dtor(page);
-		__free_page(page);
+	if (atomic_sub_and_test(PTE_FRAG_NR - count, &ptdesc->pt_frag_refcount)) {
+		pagetable_pte_dtor(ptdesc);
+		pagetable_free(ptdesc);
 	}
 }
 
@@ -55,25 +55,25 @@ static pte_t *get_pte_from_cache(struct mm_struct *mm)
 static pte_t *__alloc_for_ptecache(struct mm_struct *mm, int kernel)
 {
 	void *ret = NULL;
-	struct page *page;
+	struct ptdesc *ptdesc;
 
 	if (!kernel) {
-		page = alloc_page(PGALLOC_GFP | __GFP_ACCOUNT);
-		if (!page)
+		ptdesc = pagetable_alloc(PGALLOC_GFP | __GFP_ACCOUNT, 0);
+		if (!ptdesc)
 			return NULL;
-		if (!pgtable_pte_page_ctor(page)) {
-			__free_page(page);
+		if (!pagetable_pte_ctor(ptdesc)) {
+			pagetable_free(ptdesc);
 			return NULL;
 		}
 	} else {
-		page = alloc_page(PGALLOC_GFP);
-		if (!page)
+		ptdesc = pagetable_alloc(PGALLOC_GFP, 0);
+		if (!ptdesc)
 			return NULL;
 	}
 
-	atomic_set(&page->pt_frag_refcount, 1);
+	atomic_set(&ptdesc->pt_frag_refcount, 1);
 
-	ret = page_address(page);
+	ret = ptdesc_address(ptdesc);
 	/*
 	 * if we support only one fragment just return the
 	 * allocated page.
@@ -82,12 +82,12 @@ static pte_t *__alloc_for_ptecache(struct mm_struct *mm, int kernel)
 		return ret;
 	spin_lock(&mm->page_table_lock);
 	/*
-	 * If we find pgtable_page set, we return
+	 * If we find ptdesc_page set, we return
 	 * the allocated page with single fragment
 	 * count.
 	 */
 	if (likely(!pte_frag_get(&mm->context))) {
-		atomic_set(&page->pt_frag_refcount, PTE_FRAG_NR);
+		atomic_set(&ptdesc->pt_frag_refcount, PTE_FRAG_NR);
 		pte_frag_set(&mm->context, ret + PTE_FRAG_SIZE);
 	}
 	spin_unlock(&mm->page_table_lock);
@@ -108,28 +108,28 @@ pte_t *pte_fragment_alloc(struct mm_struct *mm, int kernel)
 
 static void pte_free_now(struct rcu_head *head)
 {
-	struct page *page;
+	struct ptdesc *ptdesc;
 
-	page = container_of(head, struct page, rcu_head);
-	pgtable_pte_page_dtor(page);
-	__free_page(page);
+	ptdesc = container_of(head, struct ptdesc, pt_rcu_head);
+	pagetable_pte_dtor(ptdesc);
+	pagetable_free(ptdesc);
 }
 
 void pte_fragment_free(unsigned long *table, int kernel)
 {
-	struct page *page = virt_to_page(table);
+	struct ptdesc *ptdesc = virt_to_ptdesc(table);
 
-	if (PageReserved(page))
-		return free_reserved_page(page);
+	if (pagetable_is_reserved(ptdesc))
+		return free_reserved_ptdesc(ptdesc);
 
 	BUG_ON(atomic_read(&page->pt_frag_refcount) <= 0);
-	if (atomic_dec_and_test(&page->pt_frag_refcount)) {
+	if (atomic_dec_and_test(&ptdesc->pt_frag_refcount)) {
 		if (kernel)
-			__free_page(page);
-		else if (TestClearPageActive(page))
-			call_rcu(&page->rcu_head, pte_free_now);
+			pagetable_free(ptdesc);
+		else if (folio_test_clear_active(ptdesc_folio(ptdesc)))
+			call_rcu(&ptdesc->pt_rcu_head, pte_free_now);
 		else
-			pte_free_now(&page->rcu_head);
+			pte_free_now(&ptdesc->pt_rcu_head);
 	}
 }
 
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:27:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:27:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569392.890024 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9du-0004cM-DO; Tue, 25 Jul 2023 04:27:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569392.890024; Tue, 25 Jul 2023 04:27:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9dt-0004YS-OG; Tue, 25 Jul 2023 04:27:25 +0000
Received: by outflank-mailman (input) for mailman id 569392;
 Tue, 25 Jul 2023 04:27:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9YQ-0002Iw-21
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:46 +0000
Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com
 [2607:f8b0:4864:20::b2d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c3878c7a-2aa2-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 06:21:45 +0200 (CEST)
Received: by mail-yb1-xb2d.google.com with SMTP id
 3f1490d57ef6-c01e1c0402cso4250067276.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:45 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c3878c7a-2aa2-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258904; x=1690863704;
        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=1W6z1I6yvWrQZbHmgHYBEGZZDstSbvELOPET/EcKlKw=;
        b=llZNAcL5ycBFvzQAJZ6/7pTtXuYWij53XzPtouHMRbZn6leKQwmdyrNb7ZQDIKMG1m
         dR4kHDNfHjwFzi7thvuqMg/yyonddaX76H366KbzQfr0mkb337gkTgeXtW8fYA7C7vgk
         0JX1efxIqLTVNU9f3lKJPAHDACzn61fxVyoRKEpyP8P7ERItPl34MD7TyhY45+GL16eR
         5mEH9l98a4BvtK/z9rHYNj8+yyPV+LgacWgOs4WnwTXzC4ltuUCUEGWdaUuvQRw4+9rt
         VkJRX5ILuNF3nkwEu0MY2t+Msy6Bxfzl0kRhh6mJAuamIH8rB6hnYqiG0nMAmPPj+VFo
         IfmQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258904; x=1690863704;
        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=1W6z1I6yvWrQZbHmgHYBEGZZDstSbvELOPET/EcKlKw=;
        b=PAuL24taXBY/gIM7FCGejFt7500ey6F8hO+D1gJmMeQHccQKc35ryoSGaHz8utcpRj
         mk28UAgq2vQy+ZV+f8Ud00M4YcVD9mAPLscpF0F6g6HheE0ZKPrG1f6ww5NQbklgpewq
         JSwK5Dq09UejC/6EKNIvmz7QftUCkSRvu1CnR2haQpvzHGsWhg34rze5hLPrNqHgT4Z1
         ulGa4Ll8qOm3abO7y7r0xQeRXuui91MQDOm6sUVEwqYrfiE5AfMqxf0gLBGJv+0KuDnN
         Uj+xHEeghNH08jvatedRDqivpx0o7A2AUyLG2BFqYw5o/CGmRXBRhYUjIjKP5Wr1EYlc
         59Ww==
X-Gm-Message-State: ABy/qLYlJqhKYI73wcVs3aNNBfe/z+hobDmXL6FY6MdPZEkcIq97k5WG
	+zF1Hrsi6yFlaLNzKWegKv8=
X-Google-Smtp-Source: APBJJlHNukUfyrx8d4ygarvYMYKc0qsL214/d3tYWYQLTsgvH0ZFNOJIIblBNYsFgmKRmFutGU4Hyg==
X-Received: by 2002:a25:cc4f:0:b0:d08:50cc:4733 with SMTP id l76-20020a25cc4f000000b00d0850cc4733mr5932948ybf.45.1690258904372;
        Mon, 24 Jul 2023 21:21:44 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>
Subject: [PATCH mm-unstable v7 18/31] arm64: Convert various functions to use ptdescs
Date: Mon, 24 Jul 2023 21:20:38 -0700
Message-Id: <20230725042051.36691-19-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
---
 arch/arm64/include/asm/tlb.h | 14 ++++++++------
 arch/arm64/mm/mmu.c          |  7 ++++---
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/include/asm/tlb.h b/arch/arm64/include/asm/tlb.h
index c995d1f4594f..2c29239d05c3 100644
--- a/arch/arm64/include/asm/tlb.h
+++ b/arch/arm64/include/asm/tlb.h
@@ -75,18 +75,20 @@ static inline void tlb_flush(struct mmu_gather *tlb)
 static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
 				  unsigned long addr)
 {
-	pgtable_pte_page_dtor(pte);
-	tlb_remove_table(tlb, pte);
+	struct ptdesc *ptdesc = page_ptdesc(pte);
+
+	pagetable_pte_dtor(ptdesc);
+	tlb_remove_ptdesc(tlb, ptdesc);
 }
 
 #if CONFIG_PGTABLE_LEVELS > 2
 static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp,
 				  unsigned long addr)
 {
-	struct page *page = virt_to_page(pmdp);
+	struct ptdesc *ptdesc = virt_to_ptdesc(pmdp);
 
-	pgtable_pmd_page_dtor(page);
-	tlb_remove_table(tlb, page);
+	pagetable_pmd_dtor(ptdesc);
+	tlb_remove_ptdesc(tlb, ptdesc);
 }
 #endif
 
@@ -94,7 +96,7 @@ static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp,
 static inline void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pudp,
 				  unsigned long addr)
 {
-	tlb_remove_table(tlb, virt_to_page(pudp));
+	tlb_remove_ptdesc(tlb, virt_to_ptdesc(pudp));
 }
 #endif
 
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index 95d360805f8a..47781bec6171 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -426,6 +426,7 @@ static phys_addr_t __pgd_pgtable_alloc(int shift)
 static phys_addr_t pgd_pgtable_alloc(int shift)
 {
 	phys_addr_t pa = __pgd_pgtable_alloc(shift);
+	struct ptdesc *ptdesc = page_ptdesc(phys_to_page(pa));
 
 	/*
 	 * Call proper page table ctor in case later we need to
@@ -433,12 +434,12 @@ static phys_addr_t pgd_pgtable_alloc(int shift)
 	 * this pre-allocated page table.
 	 *
 	 * We don't select ARCH_ENABLE_SPLIT_PMD_PTLOCK if pmd is
-	 * folded, and if so pgtable_pmd_page_ctor() becomes nop.
+	 * folded, and if so pagetable_pte_ctor() becomes nop.
 	 */
 	if (shift == PAGE_SHIFT)
-		BUG_ON(!pgtable_pte_page_ctor(phys_to_page(pa)));
+		BUG_ON(!pagetable_pte_ctor(ptdesc));
 	else if (shift == PMD_SHIFT)
-		BUG_ON(!pgtable_pmd_page_ctor(phys_to_page(pa)));
+		BUG_ON(!pagetable_pmd_ctor(ptdesc));
 
 	return pa;
 }
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:27:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:27:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569393.890027 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9du-0004mS-Q7; Tue, 25 Jul 2023 04:27:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569393.890027; Tue, 25 Jul 2023 04:27:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9du-0004kT-Eu; Tue, 25 Jul 2023 04:27:26 +0000
Received: by outflank-mailman (input) for mailman id 569393;
 Tue, 25 Jul 2023 04:27:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Yd-0002Iw-Kz
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:59 +0000
Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com
 [2607:f8b0:4864:20::b33])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cbb9ce8c-2aa2-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 06:21:59 +0200 (CEST)
Received: by mail-yb1-xb33.google.com with SMTP id
 3f1490d57ef6-d10354858e8so1903958276.2
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:59 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cbb9ce8c-2aa2-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258918; x=1690863718;
        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=DOzSOLTncjJXn0AvJQqE6PD7zrtBe8MIuyz5zw7TzDY=;
        b=dhPD8MhdzMmnO7UJpDnYU2UUndnCrctJzCVX4h8RxV/2AqAGAmNSSgBAimCgoOXbFI
         jwqB3InLHcwQnBW7LGy3zNpfxtaFx0sRNMrc2BW/oP9Y9sT30Imc49n106obHaMafKD9
         3iENsXyRilYTy2IVeIDj7UinpA3gJg4m95b/YmknsgUr223VL5cVJ4//6IC3DQ94xugG
         7BqjgjAuhv+rjaUhUgEIiEByqDs5npSuOOnKXGMd/lRwDVio+iIe4ROtQu1UVk7GVi+q
         O8m155eNSAMp9dX3vcmdIfcwnE6nUvi43OowEy4OezSv6ZkWZbIGQtYJYSHuCGDVV+u2
         iZCA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258918; x=1690863718;
        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=DOzSOLTncjJXn0AvJQqE6PD7zrtBe8MIuyz5zw7TzDY=;
        b=YoR14sbQSdUHcjpcieUN9/diVoLeqlWiVMdh2YletoyWrKzYzqrjhm+xlmfvenHu5q
         J0JXLA5a0FIFSBYWM3p4zvGrYIvAjthzKfHSa9mSRtg6PBF2mewQJjllEvEo9xcrVWXy
         s/zU8jNL05M/P6bM08CRY1RlUmTCKe/cbp6/LTjDhJ/eu2PZ/4YR6X4ydciLT/JSeMzC
         PeTtyaxL+t1llwUQ5RPmJNwNyle4Xvn7oe/KP89Z7dtrEOmReirPAuWyJ5CEAIVM545h
         WoPyhj5nOLtuVwV/rNTP0vn5hbPEe3LFFGsv6Z2l/eSsPQvfL5bdH1HfHUpJkGMD/dAi
         Vqrw==
X-Gm-Message-State: ABy/qLbr9rA3ET1VRTiYFXxo/LJ+F7IRVKq8gCYYXIsVGgV3395cP/HO
	O6sgLlQwM+XR1yWDHfQ2UaM=
X-Google-Smtp-Source: APBJJlGh3t71iGxZySWvCqAB9/DfGs5U66hmdz8Mr8qCsALi+Mic17AL5W5IK2UTO7itITs/+4o4Zw==
X-Received: by 2002:a25:ced0:0:b0:d13:e334:241b with SMTP id x199-20020a25ced0000000b00d13e334241bmr2805085ybe.21.1690258918114;
        Mon, 24 Jul 2023 21:21:58 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>,
	Dinh Nguyen <dinguyen@kernel.org>
Subject: [PATCH mm-unstable v7 24/31] nios2: Convert __pte_free_tlb() to use ptdescs
Date: Mon, 24 Jul 2023 21:20:44 -0700
Message-Id: <20230725042051.36691-25-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
Acked-by: Dinh Nguyen <dinguyen@kernel.org>
---
 arch/nios2/include/asm/pgalloc.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/nios2/include/asm/pgalloc.h b/arch/nios2/include/asm/pgalloc.h
index ecd1657bb2ce..ce6bb8e74271 100644
--- a/arch/nios2/include/asm/pgalloc.h
+++ b/arch/nios2/include/asm/pgalloc.h
@@ -28,10 +28,10 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
 
 extern pgd_t *pgd_alloc(struct mm_struct *mm);
 
-#define __pte_free_tlb(tlb, pte, addr)				\
-	do {							\
-		pgtable_pte_page_dtor(pte);			\
-		tlb_remove_page((tlb), (pte));			\
+#define __pte_free_tlb(tlb, pte, addr)					\
+	do {								\
+		pagetable_pte_dtor(page_ptdesc(pte));			\
+		tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte)));	\
 	} while (0)
 
 #endif /* _ASM_NIOS2_PGALLOC_H */
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:27:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:27:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569396.890051 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9dx-0005ce-Bo; Tue, 25 Jul 2023 04:27:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569396.890051; Tue, 25 Jul 2023 04:27:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9dx-0005Zy-1e; Tue, 25 Jul 2023 04:27:29 +0000
Received: by outflank-mailman (input) for mailman id 569396;
 Tue, 25 Jul 2023 04:27:27 +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
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Yt-00023t-Sk
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:22:15 +0000
Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com
 [2607:f8b0:4864:20::b34])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d4891be9-2aa2-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:22:14 +0200 (CEST)
Received: by mail-yb1-xb34.google.com with SMTP id
 3f1490d57ef6-d124309864dso1373013276.3
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:22:14 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.22.11
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:22:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d4891be9-2aa2-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258933; x=1690863733;
        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=ge3Da1dLlbVImV5jdD/HZRx7aISFPvIvfEGvqleo2SA=;
        b=pXw/al5n2PZt63hoen8XWII6rt0WFX5sgjX7qQn8gv0HWFLKnKq3bevtOzYUASugG2
         pCxGKJOC5ggVyKCT1VDrwsaEi6MlyxwOLjAg/45BvYDi6yzh+q0BBiRQroW3z59gIlxT
         qmaJpZ1xyAeP6+U8sI1TI5+kmnURZAb3iR8avL4fKbvg/gsoUc7EkqlV+0gnf4rSHbHI
         2YWk0HYiOFW33a4FYfPo9WrS1QN1IRD+XWbKqzPIeVg52ry9QdQcyg/270EcS7s+RywF
         +5wAnQbinAMNk/Lv6GIEnBeoT41AhvsJSWE+pPOymAwrKRfCNfM+KV2MhemhV91wxD/d
         2Dxw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258933; x=1690863733;
        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=ge3Da1dLlbVImV5jdD/HZRx7aISFPvIvfEGvqleo2SA=;
        b=VWFKR0t9unWmHKxqiyRZqlMbfXGYf9fWSEfYRJYaWGPFy6qwNkAZUWwz6dg0DzAWJa
         X8iwqD7bpvoLEhv4k8ZMyaI1qwvqiRX7wHpCQntPYQ4ACYEoX19Pv0j5LR69eHR05lMK
         92X+U/PmpQQVj24IWm7P+pU9tyF2TcQ1/XNGnPhiwCNcmKwkQ28sFougYYZHy8Rl0eIO
         oHP4HBEsMre9nvmPqUBxGPRQhnMyTmB50uuBhhRY7kTw6z6Di8w9frsyp9G7UUA5dneH
         SI1ZmqYlI5xXp7yxVMxneRA7l2UbIoio2gX8vpiMCbKyPC5oMSwyhd7VzpSAArf6gvxe
         bFvg==
X-Gm-Message-State: ABy/qLb2S4mp3k3bZjsUGTXVgdhsk9Yrf6BHi6P+uTC0u2TpE2LNFCyn
	ECFKnu1+nfx7ZKuYU0OEgqg=
X-Google-Smtp-Source: APBJJlGduGUsku2y340xQfxyEpNx6ubFn5qWJpFMniISafhH3MH0EHub+91fIwUA2U73/kY7XLKlHQ==
X-Received: by 2002:a25:5087:0:b0:d0e:2e5c:2f80 with SMTP id e129-20020a255087000000b00d0e2e5c2f80mr4416565ybb.64.1690258932878;
        Mon, 24 Jul 2023 21:22:12 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 31/31] mm: Remove pgtable_{pmd, pte}_page_{ctor, dtor}() wrappers
Date: Mon, 24 Jul 2023 21:20:51 -0700
Message-Id: <20230725042051.36691-32-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

These functions are no longer necessary. Remove them and cleanup
Documentation referencing them.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 Documentation/mm/split_page_table_lock.rst    | 12 +++++------
 .../zh_CN/mm/split_page_table_lock.rst        | 14 ++++++-------
 include/linux/mm.h                            | 20 -------------------
 3 files changed, 13 insertions(+), 33 deletions(-)

diff --git a/Documentation/mm/split_page_table_lock.rst b/Documentation/mm/split_page_table_lock.rst
index a834fad9de12..e4f6972eb6c0 100644
--- a/Documentation/mm/split_page_table_lock.rst
+++ b/Documentation/mm/split_page_table_lock.rst
@@ -58,7 +58,7 @@ Support of split page table lock by an architecture
 ===================================================
 
 There's no need in special enabling of PTE split page table lock: everything
-required is done by pgtable_pte_page_ctor() and pgtable_pte_page_dtor(), which
+required is done by pagetable_pte_ctor() and pagetable_pte_dtor(), which
 must be called on PTE table allocation / freeing.
 
 Make sure the architecture doesn't use slab allocator for page table
@@ -68,8 +68,8 @@ This field shares storage with page->ptl.
 PMD split lock only makes sense if you have more than two page table
 levels.
 
-PMD split lock enabling requires pgtable_pmd_page_ctor() call on PMD table
-allocation and pgtable_pmd_page_dtor() on freeing.
+PMD split lock enabling requires pagetable_pmd_ctor() call on PMD table
+allocation and pagetable_pmd_dtor() on freeing.
 
 Allocation usually happens in pmd_alloc_one(), freeing in pmd_free() and
 pmd_free_tlb(), but make sure you cover all PMD table allocation / freeing
@@ -77,7 +77,7 @@ paths: i.e X86_PAE preallocate few PMDs on pgd_alloc().
 
 With everything in place you can set CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK.
 
-NOTE: pgtable_pte_page_ctor() and pgtable_pmd_page_ctor() can fail -- it must
+NOTE: pagetable_pte_ctor() and pagetable_pmd_ctor() can fail -- it must
 be handled properly.
 
 page->ptl
@@ -97,7 +97,7 @@ trick:
    split lock with enabled DEBUG_SPINLOCK or DEBUG_LOCK_ALLOC, but costs
    one more cache line for indirect access;
 
-The spinlock_t allocated in pgtable_pte_page_ctor() for PTE table and in
-pgtable_pmd_page_ctor() for PMD table.
+The spinlock_t allocated in pagetable_pte_ctor() for PTE table and in
+pagetable_pmd_ctor() for PMD table.
 
 Please, never access page->ptl directly -- use appropriate helper.
diff --git a/Documentation/translations/zh_CN/mm/split_page_table_lock.rst b/Documentation/translations/zh_CN/mm/split_page_table_lock.rst
index 4fb7aa666037..a2c288670a24 100644
--- a/Documentation/translations/zh_CN/mm/split_page_table_lock.rst
+++ b/Documentation/translations/zh_CN/mm/split_page_table_lock.rst
@@ -56,16 +56,16 @@ Hugetlbç‰¹å®šçš„è¾…åŠ©å‡½æ•°:
 æž¶æž„å¯¹åˆ†é¡µè¡¨é”çš„æ”¯æŒ
 ====================
 
-æ²¡æœ‰å¿…è¦ç‰¹åˆ«å¯ç”¨PTEåˆ†é¡µè¡¨é”ï¼šæ‰€æœ‰éœ€è¦çš„ä¸œè¥¿éƒ½ç”±pgtable_pte_page_ctor()
-å’Œpgtable_pte_page_dtor()å®Œæˆï¼Œå®ƒä»¬å¿…é¡»åœ¨PTEè¡¨åˆ†é…/é‡Šæ”¾æ—¶è¢«è°ƒç”¨ã€‚
+æ²¡æœ‰å¿…è¦ç‰¹åˆ«å¯ç”¨PTEåˆ†é¡µè¡¨é”ï¼šæ‰€æœ‰éœ€è¦çš„ä¸œè¥¿éƒ½ç”±pagetable_pte_ctor()
+å’Œpagetable_pte_dtor()å®Œæˆï¼Œå®ƒä»¬å¿…é¡»åœ¨PTEè¡¨åˆ†é…/é‡Šæ”¾æ—¶è¢«è°ƒç”¨ã€‚
 
 ç¡®ä¿æž¶æž„ä¸ä½¿ç”¨slabåˆ†é…å™¨æ¥åˆ†é…é¡µè¡¨ï¼šslabä½¿ç”¨page->slab_cacheæ¥åˆ†é…å…¶é¡µ
 é¢ã€‚è¿™ä¸ªåŒºåŸŸä¸Žpage->ptlå…±äº«å­˜å‚¨ã€‚
 
 PMDåˆ†é¡µé”åªæœ‰åœ¨ä½ æœ‰ä¸¤ä¸ªä»¥ä¸Šçš„é¡µè¡¨çº§åˆ«æ—¶æ‰æœ‰æ„ä¹‰ã€‚
 
-å¯ç”¨PMDåˆ†é¡µé”éœ€è¦åœ¨PMDè¡¨åˆ†é…æ—¶è°ƒç”¨pgtable_pmd_page_ctor()ï¼Œåœ¨é‡Šæ”¾æ—¶è°ƒ
-ç”¨pgtable_pmd_page_dtor()ã€‚
+å¯ç”¨PMDåˆ†é¡µé”éœ€è¦åœ¨PMDè¡¨åˆ†é…æ—¶è°ƒç”¨pagetable_pmd_ctor()ï¼Œåœ¨é‡Šæ”¾æ—¶è°ƒ
+ç”¨pagetable_pmd_dtor()ã€‚
 
 åˆ†é…é€šå¸¸å‘ç”Ÿåœ¨pmd_alloc_one()ä¸­ï¼Œé‡Šæ”¾å‘ç”Ÿåœ¨pmd_free()å’Œpmd_free_tlb()
 ä¸­ï¼Œä½†è¦ç¡®ä¿è¦†ç›–æ‰€æœ‰çš„PMDè¡¨åˆ†é…/é‡Šæ”¾è·¯å¾„ï¼šå³X86_PAEåœ¨pgd_alloc()ä¸­é¢„å…ˆ
@@ -73,7 +73,7 @@ PMDåˆ†é¡µé”åªæœ‰åœ¨ä½ æœ‰ä¸¤ä¸ªä»¥ä¸Šçš„é¡µè¡¨çº§åˆ«æ—¶æ‰æœ‰æ„ä¹‰ã€‚
 
 ä¸€åˆ‡å°±ç»ªåŽï¼Œä½ å¯ä»¥è®¾ç½®CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCKã€‚
 
-æ³¨æ„ï¼špgtable_pte_page_ctor()å’Œpgtable_pmd_page_ctor()å¯èƒ½å¤±è´¥--å¿…
+æ³¨æ„ï¼špagetable_pte_ctor()å’Œpagetable_pmd_ctor()å¯èƒ½å¤±è´¥--å¿…
 é¡»æ­£ç¡®å¤„ç†ã€‚
 
 page->ptl
@@ -90,7 +90,7 @@ page->ptlç”¨äºŽè®¿é—®åˆ†å‰²é¡µè¡¨é”ï¼Œå…¶ä¸­'page'æ˜¯åŒ…å«è¯¥è¡¨çš„é¡µé¢struc
    çš„æŒ‡é’ˆå¹¶åŠ¨æ€åˆ†é…å®ƒã€‚è¿™å…è®¸åœ¨å¯ç”¨DEBUG_SPINLOCKæˆ–DEBUG_LOCK_ALLOCçš„
    æƒ…å†µä¸‹ä½¿ç”¨åˆ†é¡µé”ï¼Œä½†ç”±äºŽé—´æŽ¥è®¿é—®è€Œå¤šèŠ±äº†ä¸€ä¸ªç¼“å­˜è¡Œã€‚
 
-PTEè¡¨çš„spinlock_tåˆ†é…åœ¨pgtable_pte_page_ctor()ä¸­ï¼ŒPMDè¡¨çš„spinlock_t
-åˆ†é…åœ¨pgtable_pmd_page_ctor()ä¸­ã€‚
+PTEè¡¨çš„spinlock_tåˆ†é…åœ¨pagetable_pte_ctor()ä¸­ï¼ŒPMDè¡¨çš„spinlock_t
+åˆ†é…åœ¨pagetable_pmd_ctor()ä¸­ã€‚
 
 è¯·ä¸è¦ç›´æŽ¥è®¿é—®page->ptl - -ä½¿ç”¨é€‚å½“çš„è¾…åŠ©å‡½æ•°ã€‚
diff --git a/include/linux/mm.h b/include/linux/mm.h
index bd3d99d81984..e4e34ecbc2ea 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2913,11 +2913,6 @@ static inline bool pagetable_pte_ctor(struct ptdesc *ptdesc)
 	return true;
 }
 
-static inline bool pgtable_pte_page_ctor(struct page *page)
-{
-	return pagetable_pte_ctor(page_ptdesc(page));
-}
-
 static inline void pagetable_pte_dtor(struct ptdesc *ptdesc)
 {
 	struct folio *folio = ptdesc_folio(ptdesc);
@@ -2927,11 +2922,6 @@ static inline void pagetable_pte_dtor(struct ptdesc *ptdesc)
 	lruvec_stat_sub_folio(folio, NR_PAGETABLE);
 }
 
-static inline void pgtable_pte_page_dtor(struct page *page)
-{
-	pagetable_pte_dtor(page_ptdesc(page));
-}
-
 pte_t *__pte_offset_map(pmd_t *pmd, unsigned long addr, pmd_t *pmdvalp);
 static inline pte_t *pte_offset_map(pmd_t *pmd, unsigned long addr)
 {
@@ -3038,11 +3028,6 @@ static inline bool pagetable_pmd_ctor(struct ptdesc *ptdesc)
 	return true;
 }
 
-static inline bool pgtable_pmd_page_ctor(struct page *page)
-{
-	return pagetable_pmd_ctor(page_ptdesc(page));
-}
-
 static inline void pagetable_pmd_dtor(struct ptdesc *ptdesc)
 {
 	struct folio *folio = ptdesc_folio(ptdesc);
@@ -3052,11 +3037,6 @@ static inline void pagetable_pmd_dtor(struct ptdesc *ptdesc)
 	lruvec_stat_sub_folio(folio, NR_PAGETABLE);
 }
 
-static inline void pgtable_pmd_page_dtor(struct page *page)
-{
-	pagetable_pmd_dtor(page_ptdesc(page));
-}
-
 /*
  * No scalability reason to split PUD locks yet, but follow the same pattern
  * as the PMD locks to make it easier if we decide to.  The VM should not be
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:27:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:27:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569397.890060 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9dy-0005kZ-63; Tue, 25 Jul 2023 04:27:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569397.890060; Tue, 25 Jul 2023 04:27:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9dx-0005hh-K6; Tue, 25 Jul 2023 04:27:29 +0000
Received: by outflank-mailman (input) for mailman id 569397;
 Tue, 25 Jul 2023 04:27:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Yc-0002Iw-JH
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:58 +0000
Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com
 [2607:f8b0:4864:20::b30])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ca63ef9d-2aa2-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 06:21:57 +0200 (CEST)
Received: by mail-yb1-xb30.google.com with SMTP id
 3f1490d57ef6-d075a831636so3448311276.3
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:56 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ca63ef9d-2aa2-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258916; x=1690863716;
        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=Z2eVDlXL8alglJUGVXcc8JA7ix0brgT+4DYqdXjkOuM=;
        b=fGvrybG9veCXSoZFXJMA0UtqwNVtXsAlnWuMk/bkXpKkiczqed+HRBg7qpGXw+rftP
         R8qGxP/khxNNrFznF2hl0CDjqxop72dBkyp4625bQ80IjqR8i+AlFghPxbvHSncIk2dU
         DIqadiRIjjzhPNPBHKa8Srlv+IgcPTSwuOlmzDd7w7/overcGZcXEJW2ZE2gLlzTkiIr
         14q1X4buVUmvyXPkdMqpiQ5xV1g5ijhPBheP6rwOByILYuHwrisg3701wx7CgFQtr2bO
         RrmWP1BVIW5ubmY7FqAv2e+hZuvZuJ8ivG88vT2nRQQmOHlirL+OU5ylsfQ+AZXaGLB1
         RXTA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258916; x=1690863716;
        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=Z2eVDlXL8alglJUGVXcc8JA7ix0brgT+4DYqdXjkOuM=;
        b=avYJcXHzYSwynl9GKLJ7SP/0X2IxUT93qcdRtafzD+U6VDTm6CW80mn4uOVexAeBfX
         KshVWUFtp7Zim06iJeSxYYAYBYDSr2UzSq7XoptJDxhvxk8wodeifRaxP6EJ+oIvUZCl
         hR9h0q9puO/Yo2P9u+G+3nEeNK9T7duFwacxUWkSBbofKrqfTwAyH3PRTrUVUCFuJiwA
         kfh2c/g5TE/+6fQEXcwvozK2wKal02h7w2dCSvAqn94IUw1Ej1ur87U7HIIxa5yYtXuQ
         0QSZutbDiZEdS1pBOlDi5zce6gXfgGM6a2rUrU9Z5Tk7zRwTMTQ4oJg2KRYy9nQSpUDO
         6/QQ==
X-Gm-Message-State: ABy/qLZhm9/NPrAqXe2bQXWvF0Ee58uGgzIGxu6tpYDDzDE2/ReaQQ9+
	f0S/Fs65g7h5RxNYClZE/7Y=
X-Google-Smtp-Source: APBJJlGrUdYE+QekYe04OLVV4hTwe68IN9aeZvp7joelMErKuv+FL/dozsxuFXjvhOH/EvJSITLrDw==
X-Received: by 2002:a25:ac88:0:b0:d16:7ccc:b407 with SMTP id x8-20020a25ac88000000b00d167cccb407mr1735614ybi.39.1690258915878;
        Mon, 24 Jul 2023 21:21:55 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 23/31] mips: Convert various functions to use ptdescs
Date: Mon, 24 Jul 2023 21:20:43 -0700
Message-Id: <20230725042051.36691-24-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

Some of the functions use the *get*page*() helper functions. Convert
these to use pagetable_alloc() and ptdesc_address() instead to help
standardize page tables further.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/mips/include/asm/pgalloc.h | 32 ++++++++++++++++++--------------
 arch/mips/mm/pgtable.c          |  8 +++++---
 2 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/arch/mips/include/asm/pgalloc.h b/arch/mips/include/asm/pgalloc.h
index f72e737dda21..40e40a7eb94a 100644
--- a/arch/mips/include/asm/pgalloc.h
+++ b/arch/mips/include/asm/pgalloc.h
@@ -51,13 +51,13 @@ extern pgd_t *pgd_alloc(struct mm_struct *mm);
 
 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 {
-	free_pages((unsigned long)pgd, PGD_TABLE_ORDER);
+	pagetable_free(virt_to_ptdesc(pgd));
 }
 
-#define __pte_free_tlb(tlb,pte,address)			\
-do {							\
-	pgtable_pte_page_dtor(pte);			\
-	tlb_remove_page((tlb), pte);			\
+#define __pte_free_tlb(tlb, pte, address)			\
+do {								\
+	pagetable_pte_dtor(page_ptdesc(pte));			\
+	tlb_remove_page_ptdesc((tlb), page_ptdesc(pte));	\
 } while (0)
 
 #ifndef __PAGETABLE_PMD_FOLDED
@@ -65,18 +65,18 @@ do {							\
 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 {
 	pmd_t *pmd;
-	struct page *pg;
+	struct ptdesc *ptdesc;
 
-	pg = alloc_pages(GFP_KERNEL_ACCOUNT, PMD_TABLE_ORDER);
-	if (!pg)
+	ptdesc = pagetable_alloc(GFP_KERNEL_ACCOUNT, PMD_TABLE_ORDER);
+	if (!ptdesc)
 		return NULL;
 
-	if (!pgtable_pmd_page_ctor(pg)) {
-		__free_pages(pg, PMD_TABLE_ORDER);
+	if (!pagetable_pmd_ctor(ptdesc)) {
+		pagetable_free(ptdesc);
 		return NULL;
 	}
 
-	pmd = (pmd_t *)page_address(pg);
+	pmd = ptdesc_address(ptdesc);
 	pmd_init(pmd);
 	return pmd;
 }
@@ -90,10 +90,14 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long address)
 {
 	pud_t *pud;
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL & ~__GFP_HIGHMEM,
+			PUD_TABLE_ORDER);
 
-	pud = (pud_t *) __get_free_pages(GFP_KERNEL, PUD_TABLE_ORDER);
-	if (pud)
-		pud_init(pud);
+	if (!ptdesc)
+		return NULL;
+	pud = ptdesc_address(ptdesc);
+
+	pud_init(pud);
 	return pud;
 }
 
diff --git a/arch/mips/mm/pgtable.c b/arch/mips/mm/pgtable.c
index b13314be5d0e..1506e458040d 100644
--- a/arch/mips/mm/pgtable.c
+++ b/arch/mips/mm/pgtable.c
@@ -10,10 +10,12 @@
 
 pgd_t *pgd_alloc(struct mm_struct *mm)
 {
-	pgd_t *ret, *init;
+	pgd_t *init, *ret = NULL;
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL & ~__GFP_HIGHMEM,
+			PGD_TABLE_ORDER);
 
-	ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_TABLE_ORDER);
-	if (ret) {
+	if (ptdesc) {
+		ret = ptdesc_address(ptdesc);
 		init = pgd_offset(&init_mm, 0UL);
 		pgd_init(ret);
 		memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:27:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:27:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569399.890077 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9e1-0006fq-SO; Tue, 25 Jul 2023 04:27:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569399.890077; Tue, 25 Jul 2023 04:27:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9e1-0006da-Ie; Tue, 25 Jul 2023 04:27:33 +0000
Received: by outflank-mailman (input) for mailman id 569399;
 Tue, 25 Jul 2023 04:27:31 +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
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9YY-00023t-Ev
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:54 +0000
Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com
 [2607:f8b0:4864:20::b2e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c7e7db0a-2aa2-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:21:52 +0200 (CEST)
Received: by mail-yb1-xb2e.google.com with SMTP id
 3f1490d57ef6-d10354858e8so1903927276.2
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:52 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c7e7db0a-2aa2-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258912; x=1690863712;
        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=pBiyp2dfMpzV+NvCt1JbKOh6Ic1GEYp83948mVxRzoc=;
        b=M6jRKuivh8zjiemd5A6uxigxJohHpad42drXAXZPo/WrWX/VH06lIJBZPBsy6q5WUU
         sx0lJdOkpQ0kaLkBOuxv3JTr0MrJ9mxzZ+UUwF+trvlZXj+IJfJxZEoLsbjBtENoOnKp
         r4LPLa1pA9aLy86FefeD5kRctnKeFj9h3GxRlhN5hCXqNjunVSlk6MQa/3J7EWf+g7LP
         GgIUvItIu349rIBsGC+5p4KYn28jcwcdvYVyudYGHQ4Rpe+/D34t/jp9N4BHJAtnbKCw
         qFN4cKxe4NHkjK6LRf9V/I6F5RMPandO1u3QcQV36zYYu50WN177HZ6ueUgU7U2rKCNZ
         UtKQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258912; x=1690863712;
        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=pBiyp2dfMpzV+NvCt1JbKOh6Ic1GEYp83948mVxRzoc=;
        b=B0crBQudQdmm6ZbxLHArNEKMln5NK4LJKCiy/ht0JMfczdnWKWGzoqe1NBGuRjwsXU
         8N/0yRYFS/RuUrn4D/ETIiPrEN6gBKhBcigtNSu4sribQx8mZxNX2jIMUDgOydL5oaPz
         eA2UrbXXQQBA/fIIomv5KnWKG9ekRTRfvyKukLNpIqbpJZaeQQoe/Hw3fMXxoboR+MHz
         WaAHNupAaoQFZjRh7FPRd3dXL5uk/uVaEo11I7adH/CB/MR2d50YU4y0BrEpxKRZN5S5
         55Ox509eJRMUUsViwuajeXXrz5D86jeGkqp2EODd43dzd8tNm8Fu0upWRSo3GDhfsS21
         Vk6g==
X-Gm-Message-State: ABy/qLYjBuIM4lFjjBx3GcI09haUcBjc6b+/k9pZ7WbA/1NNDjlml2i4
	JBs9DmBsmJHOLLMYMY1K3bY=
X-Google-Smtp-Source: APBJJlHmWGng2mD7r+HORvYbViNahHExZyfg9AnaCMkhuF9zAe2z+T72MtBm8rxbTIBepY55dKGlDw==
X-Received: by 2002:a25:2547:0:b0:d0b:f845:c831 with SMTP id l68-20020a252547000000b00d0bf845c831mr5748800ybl.13.1690258911713;
        Mon, 24 Jul 2023 21:21:51 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Huacai Chen <chenhuacai@kernel.org>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 21/31] loongarch: Convert various functions to use ptdescs
Date: Mon, 24 Jul 2023 21:20:41 -0700
Message-Id: <20230725042051.36691-22-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

Some of the functions use the *get*page*() helper functions. Convert
these to use pagetable_alloc() and ptdesc_address() instead to help
standardize page tables further.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/loongarch/include/asm/pgalloc.h | 27 +++++++++++++++------------
 arch/loongarch/mm/pgtable.c          |  7 ++++---
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/arch/loongarch/include/asm/pgalloc.h b/arch/loongarch/include/asm/pgalloc.h
index af1d1e4a6965..23f5b1107246 100644
--- a/arch/loongarch/include/asm/pgalloc.h
+++ b/arch/loongarch/include/asm/pgalloc.h
@@ -45,9 +45,9 @@ extern void pagetable_init(void);
 extern pgd_t *pgd_alloc(struct mm_struct *mm);
 
 #define __pte_free_tlb(tlb, pte, address)			\
-do {							\
-	pgtable_pte_page_dtor(pte);			\
-	tlb_remove_page((tlb), pte);			\
+do {								\
+	pagetable_pte_dtor(page_ptdesc(pte));			\
+	tlb_remove_page_ptdesc((tlb), page_ptdesc(pte));	\
 } while (0)
 
 #ifndef __PAGETABLE_PMD_FOLDED
@@ -55,18 +55,18 @@ do {							\
 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 {
 	pmd_t *pmd;
-	struct page *pg;
+	struct ptdesc *ptdesc;
 
-	pg = alloc_page(GFP_KERNEL_ACCOUNT);
-	if (!pg)
+	ptdesc = pagetable_alloc(GFP_KERNEL_ACCOUNT, 0);
+	if (!ptdesc)
 		return NULL;
 
-	if (!pgtable_pmd_page_ctor(pg)) {
-		__free_page(pg);
+	if (!pagetable_pmd_ctor(ptdesc)) {
+		pagetable_free(ptdesc);
 		return NULL;
 	}
 
-	pmd = (pmd_t *)page_address(pg);
+	pmd = ptdesc_address(ptdesc);
 	pmd_init(pmd);
 	return pmd;
 }
@@ -80,10 +80,13 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long address)
 {
 	pud_t *pud;
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL & ~__GFP_HIGHMEM, 0);
 
-	pud = (pud_t *) __get_free_page(GFP_KERNEL);
-	if (pud)
-		pud_init(pud);
+	if (!ptdesc)
+		return NULL;
+	pud = ptdesc_address(ptdesc);
+
+	pud_init(pud);
 	return pud;
 }
 
diff --git a/arch/loongarch/mm/pgtable.c b/arch/loongarch/mm/pgtable.c
index 36a6dc0148ae..5bd102b51f7c 100644
--- a/arch/loongarch/mm/pgtable.c
+++ b/arch/loongarch/mm/pgtable.c
@@ -11,10 +11,11 @@
 
 pgd_t *pgd_alloc(struct mm_struct *mm)
 {
-	pgd_t *ret, *init;
+	pgd_t *init, *ret = NULL;
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL & ~__GFP_HIGHMEM, 0);
 
-	ret = (pgd_t *) __get_free_page(GFP_KERNEL);
-	if (ret) {
+	if (ptdesc) {
+		ret = (pgd_t *)ptdesc_address(ptdesc);
 		init = pgd_offset(&init_mm, 0UL);
 		pgd_init(ret);
 		memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:27:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:27:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569402.890089 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9e6-0007rD-PS; Tue, 25 Jul 2023 04:27:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569402.890089; Tue, 25 Jul 2023 04:27:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9e6-0007qq-F2; Tue, 25 Jul 2023 04:27:38 +0000
Received: by outflank-mailman (input) for mailman id 569402;
 Tue, 25 Jul 2023 04:27:36 +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
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Yr-00023t-I2
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:22:13 +0000
Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com
 [2607:f8b0:4864:20::b2b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d3544807-2aa2-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:22:12 +0200 (CEST)
Received: by mail-yb1-xb2b.google.com with SMTP id
 3f1490d57ef6-c5f98fc4237so4297284276.2
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:22:12 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.22.08
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:22:10 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d3544807-2aa2-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258931; x=1690863731;
        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=JRfRtQSkmDpdaHgWU+x8J8rVDSFtmuGYMRjnXDV0vQY=;
        b=dIpSbxhiHoEZRybZXN/MVeO3g9uu5Wr3kckw/68K6KR19uhvm31rhYObpAHJDDboRN
         fN++WCiGx69nFrN6B8d/NLOzRwfLSelYXtCG2axa3nxyX1nLiBBRswcz9UUR+gYqr6j2
         ancXFsSIRjlVC+siGAlQPxsDtqvlS6d02kp43kWDLSl5AqbfL3SxRXE8QCvzAnUbAKUU
         YasskwMDZ8VrwnmHFnrCJmWDVf5znjGB85g4q/nAwV8W9HMi2mBDPg8zNmEW2Wmz/ahG
         Gd3GY4JptXSFLWhWmWPz4PD8TWa0sGWxRtah1a9utFkbDSvAH1sC4A2J8wMHczxZTgoj
         5RbA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258931; x=1690863731;
        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=JRfRtQSkmDpdaHgWU+x8J8rVDSFtmuGYMRjnXDV0vQY=;
        b=FPc2ddG3cvXQvJBlXzw6xR+tncgBPlWzW7Ahz/XLioPgdW1Iji2yplIX6W2mvpUDEB
         W0TMTVM8iU9C9CtWSEYd7CHuTNUYBzBVkWVx7NGgXPalelCcXIxmaLvRk/hvrjDBT4z4
         jmZ7Bzj6T0Y4aNFXgy1qwahjM/Xpve8SFvpq3VjIvSsFf4I6uZx3aRk6LlSULoEiKKdK
         wKgCRGqBQ8tENTZ7Bu8hP2Wr4X5hg7Wxa+QT1QuJ71b4Y6J4usV+xyO8v4BGEwJaPnEl
         OkxXHYe6E59mzY8EMkuui106KqASVcTd5wMJZFDFP11AjlrqllBOa06ncRBaofHYgunx
         Iorg==
X-Gm-Message-State: ABy/qLbFfbxnCxz+M+AXXgfAlUwiBzM5yFTJrzEoxRYuTXfVfy80npeS
	jSNWf1px2p4jJ6bLYjOEIag=
X-Google-Smtp-Source: APBJJlFFrRXSNeam/kWey2sQFPpJrG6DmS1yW3xEJWnQmkKSGkoB3AAvrxYF3pVhZLtkZcpr8uNrnQ==
X-Received: by 2002:a25:2517:0:b0:d0a:86fc:6110 with SMTP id l23-20020a252517000000b00d0a86fc6110mr5159740ybl.28.1690258930893;
        Mon, 24 Jul 2023 21:22:10 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 30/31] um: Convert {pmd, pte}_free_tlb() to use ptdescs
Date: Mon, 24 Jul 2023 21:20:50 -0700
Message-Id: <20230725042051.36691-31-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents. Also cleans up some spacing issues.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/um/include/asm/pgalloc.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/um/include/asm/pgalloc.h b/arch/um/include/asm/pgalloc.h
index 8ec7cd46dd96..de5e31c64793 100644
--- a/arch/um/include/asm/pgalloc.h
+++ b/arch/um/include/asm/pgalloc.h
@@ -25,19 +25,19 @@
  */
 extern pgd_t *pgd_alloc(struct mm_struct *);
 
-#define __pte_free_tlb(tlb,pte, address)		\
-do {							\
-	pgtable_pte_page_dtor(pte);			\
-	tlb_remove_page((tlb),(pte));			\
+#define __pte_free_tlb(tlb, pte, address)			\
+do {								\
+	pagetable_pte_dtor(page_ptdesc(pte));			\
+	tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte)));	\
 } while (0)
 
 #ifdef CONFIG_3_LEVEL_PGTABLES
 
-#define __pmd_free_tlb(tlb, pmd, address)		\
-do {							\
-	pgtable_pmd_page_dtor(virt_to_page(pmd));	\
-	tlb_remove_page((tlb),virt_to_page(pmd));	\
-} while (0)						\
+#define __pmd_free_tlb(tlb, pmd, address)			\
+do {								\
+	pagetable_pmd_dtor(virt_to_ptdesc(pmd));			\
+	tlb_remove_page_ptdesc((tlb), virt_to_ptdesc(pmd));	\
+} while (0)
 
 #endif
 
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:27:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:27:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569404.890094 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9e7-0007x9-9v; Tue, 25 Jul 2023 04:27:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569404.890094; Tue, 25 Jul 2023 04:27:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9e6-0007ub-Vx; Tue, 25 Jul 2023 04:27:38 +0000
Received: by outflank-mailman (input) for mailman id 569404;
 Tue, 25 Jul 2023 04:27:37 +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
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Yn-00023t-Ff
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:22:09 +0000
Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com
 [2607:f8b0:4864:20::b2b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d0d3524d-2aa2-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:22:07 +0200 (CEST)
Received: by mail-yb1-xb2b.google.com with SMTP id
 3f1490d57ef6-ca3cc52ee62so5589361276.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:22:07 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.22.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:22:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d0d3524d-2aa2-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258926; x=1690863726;
        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=K9EaWELDe99nUon5K3Z+iJo2yPeaFSzyCnD+eyoagSI=;
        b=qNSUsqiVKVB0ESH5eMh2318rltbeTzVNrLxONrPQx/nleyciLPoBJAEyvEQiA5s1Tn
         685R6sAh2RRkBOJ+dHhwwHaTsDfn1Dq0fhp7maY379FRtPvlZFAioZBWPPk7fa1Wkq01
         qN75vY9UJqWiLkOixY4L6XdTPAaqKlrcR9SWRLlUZxoXjG975sFhxm21WZutHmQKl3h2
         OQ9WcHoISTJ2OjIGWYQNx9W6xFSNLrPRAFCGXfmCK8TcPNzYvmKngSTkC45cBTIzIEjY
         73sY0YERl7Ohg+xplAh/xTNZowvdAeC+fipfIzPvDIC0nmap4j6fccJNDYEXWoxWM6gV
         WCvA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258926; x=1690863726;
        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=K9EaWELDe99nUon5K3Z+iJo2yPeaFSzyCnD+eyoagSI=;
        b=Y9wNrbvL70mI3JZ/FpbnHifSdQG+K3aotMRMI3eZ0vsLZIhdkajifHfyYsD6qxVd4u
         W1depxxsTVEz271DNPXYFqyquxz0deK45vlUCpiKNRo82usQ+2RY3rLnO74hMuq9Uaza
         57vUtYhE5eJtmPL5JcgJSLPb3a9xENCyERoOEiyGuyHQmBhiyu1VwlEvuThr5JlPb1gd
         Fl527tD5+1xwdi6kmzWntIyLJedNVtMVfxr29/LzlUPQab5fByu71JC36AjfFUBK0nU0
         zWclTNs9ASMiGhUpw4kS3gSEZNIzMKmRPs5Zo1WxsKwCy1WisYprCUDRXr43QfS+joZM
         qvVA==
X-Gm-Message-State: ABy/qLZPvwmUhbJP0hqu3kKiUc0+ecV9fI/Ai3zHHeCQOx+swfhls6/6
	QE4KO4+0R2nwOQj1UaZTOdE=
X-Google-Smtp-Source: APBJJlEYsYvwES4yIHo2kt7NPKD5Twgr2oGLJnzn9f7qzh6ZvPXJtQdH1+pOAmNJT4cd1ABpvr+wDQ==
X-Received: by 2002:a5b:88e:0:b0:d0e:3831:fa2b with SMTP id e14-20020a5b088e000000b00d0e3831fa2bmr4772882ybq.62.1690258926669;
        Mon, 24 Jul 2023 21:22:06 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 28/31] sparc64: Convert various functions to use ptdescs
Date: Mon, 24 Jul 2023 21:20:48 -0700
Message-Id: <20230725042051.36691-29-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/sparc/mm/init_64.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index 0d7fd793924c..9a63a3e08e40 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -2893,14 +2893,15 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
 
 pgtable_t pte_alloc_one(struct mm_struct *mm)
 {
-	struct page *page = alloc_page(GFP_KERNEL | __GFP_ZERO);
-	if (!page)
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL | __GFP_ZERO, 0);
+
+	if (!ptdesc)
 		return NULL;
-	if (!pgtable_pte_page_ctor(page)) {
-		__free_page(page);
+	if (!pagetable_pte_ctor(ptdesc)) {
+		pagetable_free(ptdesc);
 		return NULL;
 	}
-	return (pte_t *) page_address(page);
+	return ptdesc_address(ptdesc);
 }
 
 void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
@@ -2910,10 +2911,10 @@ void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
 
 static void __pte_free(pgtable_t pte)
 {
-	struct page *page = virt_to_page(pte);
+	struct ptdesc *ptdesc = virt_to_ptdesc(pte);
 
-	pgtable_pte_page_dtor(page);
-	__free_page(page);
+	pagetable_pte_dtor(ptdesc);
+	pagetable_free(ptdesc);
 }
 
 void pte_free(struct mm_struct *mm, pgtable_t pte)
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:27:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:27:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569406.890099 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9e8-0008C6-6M; Tue, 25 Jul 2023 04:27:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569406.890099; Tue, 25 Jul 2023 04:27:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9e7-00084T-RI; Tue, 25 Jul 2023 04:27:39 +0000
Received: by outflank-mailman (input) for mailman id 569406;
 Tue, 25 Jul 2023 04:27:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9YZ-0002Iw-IQ
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:55 +0000
Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com
 [2607:f8b0:4864:20::b34])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c9304b30-2aa2-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 06:21:55 +0200 (CEST)
Received: by mail-yb1-xb34.google.com with SMTP id
 3f1490d57ef6-bff89873d34so4241245276.2
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:54 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c9304b30-2aa2-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258914; x=1690863714;
        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=PAg5qbCpsu4QeXC2CiYcNVSx9jEaugPagVbNncebk84=;
        b=PXib1CaoeptK69/6qIILztnTaPIyTv5YQR6TlThXrcj/XpnovRKNC9dRvmGTlMVJ+Y
         8clpfWi14Fbd16+bMMcIRSu1RjPFhxm0HGFSqSbVNLXv71Rm3nby7GTQmmhFhxR6Fe4W
         a+uFGPq1sDojuKpfGHqkLm54qltGyV31LmZTGF+k48o1qYH0m7DJawnWKwrZ6fgwSg9U
         SkV3boxZmuDGmlSDQsQA0yQXTmRpMU2gDvzpay51JFwtkFxUR2TcnLVayYqi4qXpl0OW
         +6iL34M/ESeTyP1F7hG3vKsG74iuD4sY6ImSrnr2BOLiIrK5HdmfLQg1v5h+YsRalPF6
         ymFQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258914; x=1690863714;
        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=PAg5qbCpsu4QeXC2CiYcNVSx9jEaugPagVbNncebk84=;
        b=cxM4oXNAgJnnaRQFOBvJyFh/6elCVLgcwDQMkbdaOHyP08dmCTfPRveN4PhxiB7n4v
         ZtLXOsoEXcs5+qIsq5avx3XwU1A1BSteOeeTIEFa/Wz/s/gSQ2zHXmuysjL/RLfTN3mI
         GuPKL/K8P56pBZCtjt1B/dZUS1tBF29XU7hnbJm9iOasRNW0ZYunZ+aeaCMMFjJbnw2s
         Oa2hx2xQ1GPNNN/HB5ailiVekfWLykrXoKXDKIYc/KnCoc6hqHUT/cp/Tm9+aj15lGPq
         83bQYS6ZBlRkuxoLqlYQ3gaRQ12fcGa/DmNqaPMMT1cwC84GOX0YgeTvntGNfTX6I71b
         bYhg==
X-Gm-Message-State: ABy/qLa0Ofk8WHWvYaysf0tTN1SBJd3Zz9jlk0J+nkvjIHtdBZ7dkan/
	Xq9KKn9prxFHKNCX7JDivJA=
X-Google-Smtp-Source: APBJJlHF/0iqvuKN3GeuQCQLqa/Csn12p4p6+Y/7f8hKrU53tH/yWNA7sehk6j4tDPYcgh4VwiCADg==
X-Received: by 2002:a25:d57:0:b0:d06:7064:5209 with SMTP id 84-20020a250d57000000b00d0670645209mr6311982ybn.22.1690258913820;
        Mon, 24 Jul 2023 21:21:53 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH mm-unstable v7 22/31] m68k: Convert various functions to use ptdescs
Date: Mon, 24 Jul 2023 21:20:42 -0700
Message-Id: <20230725042051.36691-23-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

Some of the functions use the *get*page*() helper functions. Convert
these to use pagetable_alloc() and ptdesc_address() instead to help
standardize page tables further.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/include/asm/mcf_pgalloc.h  | 47 ++++++++++++++--------------
 arch/m68k/include/asm/sun3_pgalloc.h |  8 ++---
 arch/m68k/mm/motorola.c              |  4 +--
 3 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/arch/m68k/include/asm/mcf_pgalloc.h b/arch/m68k/include/asm/mcf_pgalloc.h
index 5c2c0a864524..302c5bf67179 100644
--- a/arch/m68k/include/asm/mcf_pgalloc.h
+++ b/arch/m68k/include/asm/mcf_pgalloc.h
@@ -5,22 +5,22 @@
 #include <asm/tlb.h>
 #include <asm/tlbflush.h>
 
-extern inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
+static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
 {
-	free_page((unsigned long) pte);
+	pagetable_free(virt_to_ptdesc(pte));
 }
 
 extern const char bad_pmd_string[];
 
-extern inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
+static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
 {
-	unsigned long page = __get_free_page(GFP_DMA);
+	struct ptdesc *ptdesc = pagetable_alloc((GFP_DMA | __GFP_ZERO) &
+			~__GFP_HIGHMEM, 0);
 
-	if (!page)
+	if (!ptdesc)
 		return NULL;
 
-	memset((void *)page, 0, PAGE_SIZE);
-	return (pte_t *) (page);
+	return ptdesc_address(ptdesc);
 }
 
 extern inline pmd_t *pmd_alloc_kernel(pgd_t *pgd, unsigned long address)
@@ -35,36 +35,34 @@ extern inline pmd_t *pmd_alloc_kernel(pgd_t *pgd, unsigned long address)
 static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pgtable,
 				  unsigned long address)
 {
-	struct page *page = virt_to_page(pgtable);
+	struct ptdesc *ptdesc = virt_to_ptdesc(pgtable);
 
-	pgtable_pte_page_dtor(page);
-	__free_page(page);
+	pagetable_pte_dtor(ptdesc);
+	pagetable_free(ptdesc);
 }
 
 static inline pgtable_t pte_alloc_one(struct mm_struct *mm)
 {
-	struct page *page = alloc_pages(GFP_DMA, 0);
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_DMA | __GFP_ZERO, 0);
 	pte_t *pte;
 
-	if (!page)
+	if (!ptdesc)
 		return NULL;
-	if (!pgtable_pte_page_ctor(page)) {
-		__free_page(page);
+	if (!pagetable_pte_ctor(ptdesc)) {
+		pagetable_free(ptdesc);
 		return NULL;
 	}
 
-	pte = page_address(page);
-	clear_page(pte);
-
+	pte = ptdesc_address(ptdesc);
 	return pte;
 }
 
 static inline void pte_free(struct mm_struct *mm, pgtable_t pgtable)
 {
-	struct page *page = virt_to_page(pgtable);
+	struct ptdesc *ptdesc = virt_to_ptdesc(pgtable);
 
-	pgtable_pte_page_dtor(page);
-	__free_page(page);
+	pagetable_pte_dtor(ptdesc);
+	pagetable_free(ptdesc);
 }
 
 /*
@@ -75,16 +73,19 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pgtable)
 
 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 {
-	free_page((unsigned long) pgd);
+	pagetable_free(virt_to_ptdesc(pgd));
 }
 
 static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 {
 	pgd_t *new_pgd;
+	struct ptdesc *ptdesc = pagetable_alloc((GFP_DMA | __GFP_NOWARN) &
+			~__GFP_HIGHMEM, 0);
 
-	new_pgd = (pgd_t *)__get_free_page(GFP_DMA | __GFP_NOWARN);
-	if (!new_pgd)
+	if (!ptdesc)
 		return NULL;
+	new_pgd = ptdesc_address(ptdesc);
+
 	memcpy(new_pgd, swapper_pg_dir, PTRS_PER_PGD * sizeof(pgd_t));
 	memset(new_pgd, 0, PAGE_OFFSET >> PGDIR_SHIFT);
 	return new_pgd;
diff --git a/arch/m68k/include/asm/sun3_pgalloc.h b/arch/m68k/include/asm/sun3_pgalloc.h
index 198036aff519..ff48573db2c0 100644
--- a/arch/m68k/include/asm/sun3_pgalloc.h
+++ b/arch/m68k/include/asm/sun3_pgalloc.h
@@ -17,10 +17,10 @@
 
 extern const char bad_pmd_string[];
 
-#define __pte_free_tlb(tlb,pte,addr)			\
-do {							\
-	pgtable_pte_page_dtor(pte);			\
-	tlb_remove_page((tlb), pte);			\
+#define __pte_free_tlb(tlb, pte, addr)				\
+do {								\
+	pagetable_pte_dtor(page_ptdesc(pte));			\
+	tlb_remove_page_ptdesc((tlb), page_ptdesc(pte));	\
 } while (0)
 
 static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index c75984e2d86b..594575a0780c 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -161,7 +161,7 @@ void *get_pointer_table(int type)
 			 * m68k doesn't have SPLIT_PTE_PTLOCKS for not having
 			 * SMP.
 			 */
-			pgtable_pte_page_ctor(virt_to_page(page));
+			pagetable_pte_ctor(virt_to_ptdesc(page));
 		}
 
 		mmu_page_ctor(page);
@@ -201,7 +201,7 @@ int free_pointer_table(void *table, int type)
 		list_del(dp);
 		mmu_page_dtor((void *)page);
 		if (type == TABLE_PTE)
-			pgtable_pte_page_dtor(virt_to_page((void *)page));
+			pagetable_pte_dtor(virt_to_ptdesc((void *)page));
 		free_page (page);
 		return 1;
 	} else if (ptable_list[type].next != dp) {
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:27:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:27:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569407.890108 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9e9-00008j-RO; Tue, 25 Jul 2023 04:27:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569407.890108; Tue, 25 Jul 2023 04:27:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9e9-00005n-7e; Tue, 25 Jul 2023 04:27:41 +0000
Received: by outflank-mailman (input) for mailman id 569407;
 Tue, 25 Jul 2023 04:27:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9Yo-0002Iw-BZ
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:22:10 +0000
Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com
 [2607:f8b0:4864:20::b2b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d20aa443-2aa2-11ee-b23c-6b7b168915f2;
 Tue, 25 Jul 2023 06:22:09 +0200 (CEST)
Received: by mail-yb1-xb2b.google.com with SMTP id
 3f1490d57ef6-d0b597e7ac1so2718248276.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:22:09 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.22.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:22:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d20aa443-2aa2-11ee-b23c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258929; x=1690863729;
        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=ES9RfFz84BcV9KH4Nk3AfkjPOEvVVRdPbPMSiTejLcw=;
        b=cSKYfsxsSJS7ffOM4NEt7zqMXRoog1hv17RKdUNV14hwO6VLFQmWr65pOVoZcWEcHO
         ZTxl5sTEIPleNQWx16W6XrYvQNc8QXYYi7iNKk/WLCGUAw+9con++Nm/zKIXiRkvFnF7
         Kmn+uijjQiZlrdtiQKHDxzRwNsdnc8EVkdLLz/rRCQKPLyPDRXi+bbVeFHkpJoJjSqoQ
         LLoMyhXQM5hAlfwlKm9TGFpC4wUaQoFel3CzrwsKFljyIKf+UmRISO6P0XGMas/PtQ7m
         PZz9tli6d2qqtk+AGtTpbrNJSRqge28gNGwJ8TouzN1vk9cQxwcl+kcXzH8Il6o+JKN2
         oqCg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258929; x=1690863729;
        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=ES9RfFz84BcV9KH4Nk3AfkjPOEvVVRdPbPMSiTejLcw=;
        b=K1KvbrPGBn2pDwk7ozf/7vLuyFWSU6qACLs5BC/gUGx43Omn4B3Ra3dnZpjaoWB+mJ
         VzOzxBj38mCNGpceNvTJ8x0cUOFa5tP5LGmWZXPr9o6N7xhwCytuHjbeOUkQbcBoQ+Eb
         RBeF3ai+aTKWdYzOAGXz3mK1hMcOTZlDR/jrc4+7xATBMwycYqg1b39qcUfFBukO3qVT
         u71NzaKWg4WbsgsacANQmowLkVLGNott6oL29uG4hnWs4QtLZss7KneKOCtGIFZlpWDq
         i3pRzjWH30NA2QoleSew87k3GnVZKD3qhrquiq2w7yaWH2iMgX2kwFnNGWUd7WJBgc9H
         R8+A==
X-Gm-Message-State: ABy/qLZZXNBJKqFxg60E1h8KFlEqW+NsiX9OhTWlOqDoH+Jna8dDdu5b
	AC8I9uVgyhCCiBoreo8X79U=
X-Google-Smtp-Source: APBJJlHinG28bY5749COLWHo/TBHjyABo5nSLZGYajOWLjAfKDEgrRU/vgHTv2Ygbb3WniVSdKl5LA==
X-Received: by 2002:a25:700a:0:b0:d16:c58a:e63a with SMTP id l10-20020a25700a000000b00d16c58ae63amr1491610ybc.23.1690258928721;
        Mon, 24 Jul 2023 21:22:08 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 29/31] sparc: Convert pgtable_pte_page_{ctor, dtor}() to ptdesc equivalents
Date: Mon, 24 Jul 2023 21:20:49 -0700
Message-Id: <20230725042051.36691-30-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Part of the conversions to replace pgtable pte constructor/destructors with
ptdesc equivalents.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/sparc/mm/srmmu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index 13f027afc875..8393faa3e596 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -355,7 +355,8 @@ pgtable_t pte_alloc_one(struct mm_struct *mm)
 		return NULL;
 	page = pfn_to_page(__nocache_pa((unsigned long)ptep) >> PAGE_SHIFT);
 	spin_lock(&mm->page_table_lock);
-	if (page_ref_inc_return(page) == 2 && !pgtable_pte_page_ctor(page)) {
+	if (page_ref_inc_return(page) == 2 &&
+			!pagetable_pte_ctor(page_ptdesc(page))) {
 		page_ref_dec(page);
 		ptep = NULL;
 	}
@@ -371,7 +372,7 @@ void pte_free(struct mm_struct *mm, pgtable_t ptep)
 	page = pfn_to_page(__nocache_pa((unsigned long)ptep) >> PAGE_SHIFT);
 	spin_lock(&mm->page_table_lock);
 	if (page_ref_dec_return(page) == 1)
-		pgtable_pte_page_dtor(page);
+		pagetable_pte_dtor(page_ptdesc(page));
 	spin_unlock(&mm->page_table_lock);
 
 	srmmu_free_nocache(ptep, SRMMU_PTE_TABLE_SIZE);
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:27:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:27:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569408.890114 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9eA-0000J3-Mz; Tue, 25 Jul 2023 04:27:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569408.890114; Tue, 25 Jul 2023 04:27:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9e9-0000Ef-U0; Tue, 25 Jul 2023 04:27:41 +0000
Received: by outflank-mailman (input) for mailman id 569408;
 Tue, 25 Jul 2023 04:27:38 +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
 <SRS0=dJfN=DL=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qO9YK-00023t-Vo
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:21:40 +0000
Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com
 [2607:f8b0:4864:20::b2f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bfda9d7c-2aa2-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:21:39 +0200 (CEST)
Received: by mail-yb1-xb2f.google.com with SMTP id
 3f1490d57ef6-d0a8ae5f8a6so2876729276.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:21:39 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 h9-20020a25b189000000b00d0db687ef48sm1175540ybj.61.2023.07.24.21.21.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:21:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bfda9d7c-2aa2-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690258898; x=1690863698;
        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=hoPDwBR7UkDBRqaPTC6ObTEe9OrRslO4Jma44jkeaBI=;
        b=Dgs8EsJAHasnII4rJ0h10Nj9H3O9uzEKXy7LW6sf6S5UPbm7zagckuwMpdCbvZk8cU
         3/jnkSDkvXi64EHRwyjz+CM8p/KmVE/9fnMiDEX0PvmK/w2bAUSZDPt5BzsyT9VmXNoR
         USMHwv5na3aMh8DeZjSQRwfSfPFKG4ZOnIYC2X37iqKJqBwj0eKoY0bqe0NY7N310KPu
         aidhbQQvpt95cN5aH+LGh5XqwJcQ2uC+n4TR20GhHOCZWT8rqRInnhuzQKk9A3ffSHvU
         8/8KhU8ISd3BEz/7bIAWQZEwejG7oku5b5qOTInFSfUdh8Iny4J/y8tSxkhE65C29I99
         J5UQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690258898; x=1690863698;
        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=hoPDwBR7UkDBRqaPTC6ObTEe9OrRslO4Jma44jkeaBI=;
        b=NG/nib/MQdLQjtpgBS8UtsrytNZaNemSisFaelEVymkoLBwzbLdwAsdG6mhu5LjL1h
         E4FOt+jbhA4y8LNOzX32r0KKQrf3/RBfWm17ccK4NGGyyfC5C1XOOHQIvYNQnTsJdM/F
         8jtv4b+ILpLmDQVw8e734XRK/GeEaUiM/nVjd230/4lFQktr0u9E/3h3RQXbVwsgEKPS
         z8dIWhnsWJ5TrJOjTXa9iiJnMx9KrS4RxGOgox2pryO1CJYJIqzn04IQyObuyPHYiR+Z
         FNKg3ffcMa7e/9fw/yKfCr5G6mGIFjsEtVXU38198IqTWktrSyKrB2dkiimh1I7/5a/X
         XJSQ==
X-Gm-Message-State: ABy/qLbHFhwHgNKa817sCQlGLrU+4L/BOOkguoqW65hl4Zl7s2MzkJWf
	oSee8cMAzE1tjDs9HmCW0Bw=
X-Google-Smtp-Source: APBJJlF5Dk/uQrTXMbCnDdD5/bLVaLQ5W3zqcEOsqm95ohTlFSSUZBYyBU16PWFlX2Ey7GE6JXmN/Q==
X-Received: by 2002:a25:254c:0:b0:d0b:9058:f660 with SMTP id l73-20020a25254c000000b00d0b9058f660mr5944061ybl.44.1690258898065;
        Mon, 24 Jul 2023 21:21:38 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v7 15/31] mm: Remove page table members from struct page
Date: Mon, 24 Jul 2023 21:20:35 -0700
Message-Id: <20230725042051.36691-16-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The page table members are now split out into their own ptdesc struct.
Remove them from struct page.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/mm_types.h | 18 ------------------
 include/linux/pgtable.h  |  3 ---
 2 files changed, 21 deletions(-)

diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index da538ff68953..aae6af098031 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -141,24 +141,6 @@ struct page {
 		struct {	/* Tail pages of compound page */
 			unsigned long compound_head;	/* Bit zero is set */
 		};
-		struct {	/* Page table pages */
-			unsigned long _pt_pad_1;	/* compound_head */
-			pgtable_t pmd_huge_pte; /* protected by page->ptl */
-			/*
-			 * A PTE page table page might be freed by use of
-			 * rcu_head: which overlays those two fields above.
-			 */
-			unsigned long _pt_pad_2;	/* mapping */
-			union {
-				struct mm_struct *pt_mm; /* x86 pgds only */
-				atomic_t pt_frag_refcount; /* powerpc */
-			};
-#if ALLOC_SPLIT_PTLOCKS
-			spinlock_t *ptl;
-#else
-			spinlock_t ptl;
-#endif
-		};
 		struct {	/* ZONE_DEVICE pages */
 			/** @pgmap: Points to the hosting device page map. */
 			struct dev_pagemap *pgmap;
diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
index 250fdeba68f3..1a984c300d45 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
@@ -1051,10 +1051,7 @@ struct ptdesc {
 TABLE_MATCH(flags, __page_flags);
 TABLE_MATCH(compound_head, pt_list);
 TABLE_MATCH(compound_head, _pt_pad_1);
-TABLE_MATCH(pmd_huge_pte, pmd_huge_pte);
 TABLE_MATCH(mapping, __page_mapping);
-TABLE_MATCH(pt_mm, pt_mm);
-TABLE_MATCH(ptl, ptl);
 TABLE_MATCH(rcu_head, pt_rcu_head);
 TABLE_MATCH(page_type, __page_type);
 TABLE_MATCH(_refcount, _refcount);
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 04:41:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 04:41:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569431.890140 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9rr-0006sp-Kp; Tue, 25 Jul 2023 04:41:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569431.890140; Tue, 25 Jul 2023 04:41:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qO9rr-0006si-H0; Tue, 25 Jul 2023 04:41:51 +0000
Received: by outflank-mailman (input) for mailman id 569431;
 Tue, 25 Jul 2023 04:41:50 +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 <SRS0=NXNf=DL=google.com=hughd@srs-se1.protection.inumbo.net>)
 id 1qO9rq-0006sb-3V
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 04:41:50 +0000
Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com
 [2607:f8b0:4864:20::b29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8fe4eba7-2aa5-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 06:41:47 +0200 (CEST)
Received: by mail-yb1-xb29.google.com with SMTP id
 3f1490d57ef6-d08658c7713so3165648276.3
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 21:41:47 -0700 (PDT)
Received: from ripple.attlocal.net
 (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147])
 by smtp.gmail.com with ESMTPSA id
 z16-20020a25e310000000b00c71e4833957sm2656725ybd.63.2023.07.24.21.41.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 21:41:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8fe4eba7-2aa5-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20221208; t=1690260106; x=1690864906;
        h=mime-version:references:message-id:in-reply-to:subject:cc:to:from
         :date:from:to:cc:subject:date:message-id:reply-to;
        bh=4tFc7lI8l/TAp6N4SH/RnjHMrhDjcjpOS0NvhRjK3tI=;
        b=syg9IyMH/gqJY1k4LT3S6JMx0fSLcgE37Cs+8KWCUO35fKCYg0MuLIIi0nsu37jtyV
         JWnNbNndjflxoqEknhV3drMoPO1rLP5Mf2NwuEGG3uNqc6WCc3lC70F16ZnEeLC+MDXA
         tlBtkvCExRePxNsWSrYSlIqtWo9fJaFXM7OzUrScUdzQ6XIpjZwJMknKg/XaSKKfA+Pp
         NHjPm93xL9xpQDR+q+3gjlysNDu5FD2n2xMli6SN590GUy6WkS3ghg4fMC/PcVORHv0z
         7pZwaHoSCWcs0DC0U/7aDMkjw3lDyZjRkGaSMnnCoKZ6Eh2nJ1AJW7AcIEll2MImoPAy
         2Dhg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690260106; x=1690864906;
        h=mime-version:references:message-id:in-reply-to:subject:cc:to:from
         :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=4tFc7lI8l/TAp6N4SH/RnjHMrhDjcjpOS0NvhRjK3tI=;
        b=dFYiFc+ktND9z0o5Q/iTOmchGENBYPIS61MOIaEY3+7sHpbI0RcA8vpuWPV39edrvK
         eoitw/H/tScofzqiiTKWjGpRyoPTWFAMlTxKd+2d1BrlHoSfi3KjEgA/LGjT7kYt+rKl
         n50OccuB4x90LzYMEdk8bpjX5Rq8hfM/LoOOWKrVeV+6cMgDh0aH6HTK+WoCcTdTU/U1
         o0NEVYLaRiaw3nWEOrzAjHfcQH6cgdZ5D2Z+Pdhcm6bEZEuWFWdvbkLFNGtIQis0aQ2X
         IlTM4k0gQjljnIdb2trJRqWoRNUFwvpWtlXu+CzxmUGAmAXdAuVcO0zO5XIYtcIqQYMi
         l/OQ==
X-Gm-Message-State: ABy/qLZ69lbRkgxiZkX3aespDYO8aWwbqCUSCNCgmW1vTqQv5g7Uhi5K
	R4saHzcUo/bU2RA/9k+OQ9pXeQ==
X-Google-Smtp-Source: APBJJlHQLTh3cgEYO+DVAD/fw8XSxxaq77z0mK7JibK/JjnN3wjA/kyDdlXYpJW7FLCpf9E01rW5SQ==
X-Received: by 2002:a25:2342:0:b0:d0d:2d17:3f11 with SMTP id j63-20020a252342000000b00d0d2d173f11mr5304231ybj.17.1690260106082;
        Mon, 24 Jul 2023 21:41:46 -0700 (PDT)
Date: Mon, 24 Jul 2023 21:41:36 -0700 (PDT)
From: Hugh Dickins <hughd@google.com>
X-X-Sender: hugh@ripple.attlocal.net
To: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
cc: Andrew Morton <akpm@linux-foundation.org>, 
    Matthew Wilcox <willy@infradead.org>, linux-mm@kvack.org, 
    linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, 
    linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, 
    loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, 
    linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, 
    linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, 
    linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, 
    sparclinux@vger.kernel.org, linux-um@lists.infradead.org, 
    xen-devel@lists.xenproject.org, kvm@vger.kernel.org, 
    Hugh Dickins <hughd@google.com>, Catalin Marinas <catalin.marinas@arm.com>, 
    Huacai Chen <chenhuacai@kernel.org>, 
    Geert Uytterhoeven <geert@linux-m68k.org>, 
    Thomas Bogendoerfer <tsbogend@alpha.franken.de>, 
    Dinh Nguyen <dinguyen@kernel.org>, Jonas Bonn <jonas@southpole.se>, 
    David Hildenbrand <david@redhat.com>, 
    Claudio Imbrenda <imbrenda@linux.ibm.com>, 
    Paul Walmsley <paul.walmsley@sifive.com>, 
    "David S. Miller" <davem@davemloft.net>, 
    Richard Weinberger <richard@nod.at>, 
    Yoshinori Sato <ysato@users.sourceforge.jp>, 
    Dave Hansen <dave.hansen@linux.intel.com>, Arnd Bergmann <arnd@arndb.de>, 
    Christophe Leroy <christophe.leroy@csgroup.eu>
Subject: Re: [PATCH mm-unstable v7 00/31] Split ptdesc from struct page
In-Reply-To: <20230725042051.36691-1-vishal.moola@gmail.com>
Message-ID: <5296514f-cdd1-9526-2e83-a21e76e86e5@google.com>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 24 Jul 2023, Vishal Moola (Oracle) wrote:

> The MM subsystem is trying to shrink struct page. This patchset
> introduces a memory descriptor for page table tracking - struct ptdesc.
> 
> This patchset introduces ptdesc, splits ptdesc from struct page, and
> converts many callers of page table constructor/destructors to use ptdescs.
> 
> Ptdesc is a foundation to further standardize page tables, and eventually
> allow for dynamic allocation of page tables independent of struct page.
> However, the use of pages for page table tracking is quite deeply
> ingrained and varied across archictectures, so there is still a lot of
> work to be done before that can happen.

Others may differ, but it remains the case that I see no point to this
patchset, until the minimal descriptor that replaces struct page is
working, and struct page then becomes just overhead.  Until that time,
let architectures continue to use struct page as they do - whyever not?

Hugh

> 
> This is rebased on mm-unstable.
> 
> v7:
>   Drop s390 gmap ptdesc conversions - gmap is unecessary complication
>     that can be dealt with later
>   Be more thorough with ptdesc struct sanity checks and comments
>   Rebase onto mm-unstable
> 
> Vishal Moola (Oracle) (31):
>   mm: Add PAGE_TYPE_OP folio functions
>   pgtable: Create struct ptdesc
>   mm: add utility functions for ptdesc
>   mm: Convert pmd_pgtable_page() callers to use pmd_ptdesc()
>   mm: Convert ptlock_alloc() to use ptdescs
>   mm: Convert ptlock_ptr() to use ptdescs
>   mm: Convert pmd_ptlock_init() to use ptdescs
>   mm: Convert ptlock_init() to use ptdescs
>   mm: Convert pmd_ptlock_free() to use ptdescs
>   mm: Convert ptlock_free() to use ptdescs
>   mm: Create ptdesc equivalents for pgtable_{pte,pmd}_page_{ctor,dtor}
>   powerpc: Convert various functions to use ptdescs
>   x86: Convert various functions to use ptdescs
>   s390: Convert various pgalloc functions to use ptdescs
>   mm: Remove page table members from struct page
>   pgalloc: Convert various functions to use ptdescs
>   arm: Convert various functions to use ptdescs
>   arm64: Convert various functions to use ptdescs
>   csky: Convert __pte_free_tlb() to use ptdescs
>   hexagon: Convert __pte_free_tlb() to use ptdescs
>   loongarch: Convert various functions to use ptdescs
>   m68k: Convert various functions to use ptdescs
>   mips: Convert various functions to use ptdescs
>   nios2: Convert __pte_free_tlb() to use ptdescs
>   openrisc: Convert __pte_free_tlb() to use ptdescs
>   riscv: Convert alloc_{pmd, pte}_late() to use ptdescs
>   sh: Convert pte_free_tlb() to use ptdescs
>   sparc64: Convert various functions to use ptdescs
>   sparc: Convert pgtable_pte_page_{ctor, dtor}() to ptdesc equivalents
>   um: Convert {pmd, pte}_free_tlb() to use ptdescs
>   mm: Remove pgtable_{pmd, pte}_page_{ctor, dtor}() wrappers
> 
>  Documentation/mm/split_page_table_lock.rst    |  12 +-
>  .../zh_CN/mm/split_page_table_lock.rst        |  14 +-
>  arch/arm/include/asm/tlb.h                    |  12 +-
>  arch/arm/mm/mmu.c                             |   7 +-
>  arch/arm64/include/asm/tlb.h                  |  14 +-
>  arch/arm64/mm/mmu.c                           |   7 +-
>  arch/csky/include/asm/pgalloc.h               |   4 +-
>  arch/hexagon/include/asm/pgalloc.h            |   8 +-
>  arch/loongarch/include/asm/pgalloc.h          |  27 ++--
>  arch/loongarch/mm/pgtable.c                   |   7 +-
>  arch/m68k/include/asm/mcf_pgalloc.h           |  47 +++---
>  arch/m68k/include/asm/sun3_pgalloc.h          |   8 +-
>  arch/m68k/mm/motorola.c                       |   4 +-
>  arch/mips/include/asm/pgalloc.h               |  32 ++--
>  arch/mips/mm/pgtable.c                        |   8 +-
>  arch/nios2/include/asm/pgalloc.h              |   8 +-
>  arch/openrisc/include/asm/pgalloc.h           |   8 +-
>  arch/powerpc/mm/book3s64/mmu_context.c        |  10 +-
>  arch/powerpc/mm/book3s64/pgtable.c            |  32 ++--
>  arch/powerpc/mm/pgtable-frag.c                |  56 +++----
>  arch/riscv/include/asm/pgalloc.h              |   8 +-
>  arch/riscv/mm/init.c                          |  16 +-
>  arch/s390/include/asm/pgalloc.h               |   4 +-
>  arch/s390/include/asm/tlb.h                   |   4 +-
>  arch/s390/mm/pgalloc.c                        | 128 +++++++--------
>  arch/sh/include/asm/pgalloc.h                 |   9 +-
>  arch/sparc/mm/init_64.c                       |  17 +-
>  arch/sparc/mm/srmmu.c                         |   5 +-
>  arch/um/include/asm/pgalloc.h                 |  18 +--
>  arch/x86/mm/pgtable.c                         |  47 +++---
>  arch/x86/xen/mmu_pv.c                         |   2 +-
>  include/asm-generic/pgalloc.h                 |  88 +++++-----
>  include/asm-generic/tlb.h                     |  11 ++
>  include/linux/mm.h                            | 151 +++++++++++++-----
>  include/linux/mm_types.h                      |  18 ---
>  include/linux/page-flags.h                    |  30 +++-
>  include/linux/pgtable.h                       |  80 ++++++++++
>  mm/memory.c                                   |   8 +-
>  38 files changed, 585 insertions(+), 384 deletions(-)
> 
> -- 
> 2.40.1


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 05:19:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 05:19:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569433.890149 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOARy-0002Qn-CX; Tue, 25 Jul 2023 05:19:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569433.890149; Tue, 25 Jul 2023 05:19:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOARy-0002Qg-9D; Tue, 25 Jul 2023 05:19:10 +0000
Received: by outflank-mailman (input) for mailman id 569433;
 Tue, 25 Jul 2023 05:19:08 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOARw-0002QA-Lc; Tue, 25 Jul 2023 05:19:08 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOARw-0006pp-Ig; Tue, 25 Jul 2023 05:19:08 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOARw-0006l9-43; Tue, 25 Jul 2023 05:19:08 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOARw-00075f-1e; Tue, 25 Jul 2023 05:19:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=lhHP/ht2WwnJ123gQxu/GC9dybiGH5VxlTGLHXOc74I=; b=hsvXCaNVpN/xfb+a3rmCjCpJDH
	rACKzbUgAziVynkbeI3x06JVi4F0ZpqFtd9S/iiftcoXqpFBXqxniWKa3AnaMu8GE55k7sc+qlMX9
	HDQOZTqMEyCD7oQxQ61jZvM0z+89bpc3f7O6pZOLSDS/sUAfI3smcmPLtjj2xwgwYV14=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181993-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 181993: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:regression
    qemu-mainline:test-armhf-armhf-xl-vhd:guest-start:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=885fc169f09f5915ce037263d20a59eb226d473d
X-Osstest-Versions-That:
    qemuu=d1181d29370a4318a9f11ea92065bea6bb159f83
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 25 Jul 2023 05:19:08 +0000

flight 181993 qemu-mainline real [real]
flight 182003 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181993/
http://logs.test-lab.xenproject.org/osstest/logs/182003/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail REGR. vs. 181952

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-vhd      13 guest-start             fail blocked in 181952
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181952
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181952
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181952
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181952
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181952
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181952
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181952
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181952
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 qemuu                885fc169f09f5915ce037263d20a59eb226d473d
baseline version:
 qemuu                d1181d29370a4318a9f11ea92065bea6bb159f83

Last test of basis   181952  2023-07-21 10:07:07 Z    3 days
Testing same since   181993  2023-07-24 13:37:28 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alistair Francis <alistair.francis@wdc.com>
  Anton Johansson <anjo@rev.ng>
  Anushree Mathur <anushree.mathur@linux.vnet.ibm.com>
  Benjamin Gray <bgray@linux.ibm.com>
  Bin Meng <bmeng@tinylab.org>
  Conor Dooley <conor.dooley@microchip.com>
  Ilya Leoshkevich <iii@linux.ibm.com>
  Jordan Niethe <jniethe5@gmail.com>
  Luca Bonissi <qemu@bonslack.org>
  Michael Tokarev <mjt@tls.msk.ru>
  Peter Maydell <peter.maydell@linaro.org>
  Richard Henderson <richard.henderson@linaro.org>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      fail    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 316 lines long.)


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 06:16:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 06:16:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569440.890163 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOBLc-0000Sg-MH; Tue, 25 Jul 2023 06:16:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569440.890163; Tue, 25 Jul 2023 06:16:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOBLc-0000SZ-H1; Tue, 25 Jul 2023 06:16:40 +0000
Received: by outflank-mailman (input) for mailman id 569440;
 Tue, 25 Jul 2023 06:16:39 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOBLb-0000SN-Qg; Tue, 25 Jul 2023 06:16:39 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOBLb-00081m-Nj; Tue, 25 Jul 2023 06:16:39 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOBLb-0002nx-BK; Tue, 25 Jul 2023 06:16:39 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOBLb-00082w-Av; Tue, 25 Jul 2023 06:16:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=RkawmzL7lMjhfdasXIhGTCJKWedq/PBlG4X55Y9fOTM=; b=C+afh9EGZpHaZVnf5FTZO/9Q1h
	f3mIT2j+bl1+hs7h5FoWV4wKeco68/HXm5RFu1aJldafnFJKLHfNxHCZGuSqjXpDC6oUOcjOkG0QS
	gQt+OZly2dTBKhhSwvh3sV8veGmzZz8dot/XV1YwkMyYrzvdpdb6DPXNcUwz4lElr3Jc=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182002-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 182002: regressions - FAIL
X-Osstest-Failures:
    xen-unstable-smoke:test-armhf-armhf-xl:xen-boot:fail:regression
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=0b1171be87698bc7d14760383c0770aeb6e41dd4
X-Osstest-Versions-That:
    xen=f91c5ea970675637721bb7f18adaa189837eb783
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 25 Jul 2023 06:16:39 +0000

flight 182002 xen-unstable-smoke real [real]
flight 182005 xen-unstable-smoke real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/182002/
http://logs.test-lab.xenproject.org/osstest/logs/182005/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-armhf-armhf-xl           8 xen-boot                 fail REGR. vs. 181999

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  0b1171be87698bc7d14760383c0770aeb6e41dd4
baseline version:
 xen                  f91c5ea970675637721bb7f18adaa189837eb783

Last test of basis   181999  2023-07-24 17:02:22 Z    0 days
Testing same since   182002  2023-07-25 01:03:53 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 0b1171be87698bc7d14760383c0770aeb6e41dd4
Author: Nicola Vetrini <nicola.vetrini@bugseng.com>
Date:   Mon Jul 24 16:26:07 2023 +0200

    efi: mechanical renaming to address MISRA C:2012 Rule 5.3
    
    Rule 5.3 has the following headline:
    "An identifier declared in an inner scope shall not hide an
    identifier declared in an outer scope"
    
    The function parameters renamed in this patch are hiding a variable defined
    in an enclosing scope.
    
    The following rename is made:
    - s/cfg/file/
    to distinguish from the variable 'cfg', which is hidden by the parameter inside
    the modified functions.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

commit 9a51409452b52ffed132eb54e8673a3501d8ec95
Author: Stefano Stabellini <stefano.stabellini@amd.com>
Date:   Fri Jul 21 15:16:36 2023 -0700

    docs/misra: add Rule 1.1 and 5.6
    
    Rule 1.1 is uncontroversial and we are already following it.
    
    Rule 5.6 has been deemed a good rule to have by the MISRA C group.
    However, we do have a significant amount of violations that will take
    time to resolve and might require partial deviations in the form of
    in-code comments or MISRA C scanners special configurations (ECLAIR).
    For new code, we want this rule to generally apply hence the addition to
    docs/misra/rules.rst.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 06:27:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 06:27:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569444.890173 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOBW5-0001zo-J4; Tue, 25 Jul 2023 06:27:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569444.890173; Tue, 25 Jul 2023 06:27:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOBW5-0001zh-G4; Tue, 25 Jul 2023 06:27:29 +0000
Received: by outflank-mailman (input) for mailman id 569444;
 Tue, 25 Jul 2023 06:27:27 +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 <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOBW3-0001zb-Bo
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 06:27:27 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on062e.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::62e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4e6e8af7-2ab4-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 08:27:19 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM0PR04MB6913.eurprd04.prod.outlook.com (2603:10a6:208:184::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 06:27:22 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 06:27:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4e6e8af7-2ab4-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hcwtXWxhj4BVtisZb/CrRyzno2hq+hqiFJ33bAW2X/R13tt66MdWQuzOXpGUY2yt8N/H7HYqmwQxA9e70F+3PDwlr7zP8vQYVVxI7WHxFfZwFC3HuhzEuxmCTZsAX1TYLCxLSQYiS1pEajvE9R1qV1+FjNmLMc7zP0k/z6pRUhnt4kNsawRsV3RTbtLKohEjfnGYqrAnHg0cixt9PsIRRJaCKKUJTlCdZDeZjzqFE3xj4S0MD672RVMlKJxEs32Jm92aLvtOc+/yz1rW5+wVFO6ip22FpvtrZxhd0+KHB+rywct0J7gTNiuBVqalEfCQiwzb9haljimJWDEAy9eJwg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=GA4MOW5AKBwAfd4brLWNNySCOAmZVuNXK3Cc4TRsOyI=;
 b=RiEjNSH6j8dKk4SKyYyQvrxlQjoS4KRnc7tZPuUJgmeMOdR+rzSKvwYv8wpk/jizoSGfPyTV9CH09kI89n0nPgERImtwtrlz9fY84EECLyUox7+yXbjbWMsjaVucfUBa53135jNpWSA8tv/my3RYnh8sRbSyrBHS+VRoElz3XkQaVp7P8fVc5GcmdfBdfOdLIQIrDh9oIDMzviJDl1VxpaWGt2NPQRUGaH/707/C6usHDtty/VluBmp8sG+/IeS8I7WmAW1Zx9b1RqYI2rKNk8R9UlKiiQ8j5XlZOxFKP8G94KX5dPOOrOWwMXnumxC33mii+xymb9Yu19Vd6UPX7A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=GA4MOW5AKBwAfd4brLWNNySCOAmZVuNXK3Cc4TRsOyI=;
 b=rf7naCbJJ8A7iVXNY4pQ69YQjoQugU5AAPqqHJJUS67/4bAtBYzHIRL5YB7hm8HyqcepOIoSDOP3bePtVL5xUbSMwQOf+j0oy2gQ7J3KFp4J0j23zH9OW5ak5jph5R6ZK4MBGFs4yPcZPKafM7gwAclkRgCBacHIj7ioGFVqLQVyTYA/DPgTk1d+2C3hGgWIA7hRFvOfvcmlYG6PUei1x45s2dkCIJmxKzy/+0dJizDZrg+YIfg2jmPZFbWogsfKkhW/dsSpgm9xJmohROCMGS1fuJFi6W38yLGjP5yxnEcH5GYn13j/PfsvhyRDOMipvJ++dg+LwXNc++mh338nQg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <d3d8123e-2b81-d3e0-3883-83dcdaf99700@suse.com>
Date: Tue, 25 Jul 2023 08:27:20 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v6 06/15] cpufreq: Add Hardware P-State (HWP) driver
Content-Language: en-US
To: Jason Andryuk <jandryuk@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20230724125857.11133-1-jandryuk@gmail.com>
 <20230724125857.11133-7-jandryuk@gmail.com>
 <7636d3d2-c78d-711a-ed90-aedd1b464c6c@suse.com>
 <CAKf6xpt1LzKMv7E-G3sTpUWrEApy+BX8z7dG69oS1upHcpytMg@mail.gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <CAKf6xpt1LzKMv7E-G3sTpUWrEApy+BX8z7dG69oS1upHcpytMg@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0124.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9d::18) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM0PR04MB6913:EE_
X-MS-Office365-Filtering-Correlation-Id: 1dab50fe-884f-4ece-4951-08db8cd83453
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	kjSepgdMn2WwKcP+cAFTYQNXCf58bqTybScxVUFzal1HHExp4egtxPZBm4g93+7pfMI+KQ0qPLXm8ulus3Wcqjiwi2/VxTqRZcE+N8lbfZpDUCwLhjeIKep3kTiTo5pGJZUFhYKiF999PEZKZrKp0zaO3XfkEs4wKBMCjKF0FZqD7u+kADYiV7bv/+F/wKnQE2vkOy7mpUp8xZVDaIC/+4y8I+qtrgGij0lXB0D+9Ir6yBM/ns7SZP3CUoY4s83RDlDWhs/fHQfhKG7OCPMygRF1ZopD/GAm5IfkzQA6VYVrfmdL6rDPT1YVkshSGAyFjZD3mF18y+eNNnUvXL1eWPxmpTjavq94qvJ2yo0UzQcX9QRe5DC8w/chJlTbFuyMmalFcnISDmwMSZMITe2ISS8ESRJ30MmVfwtVJAuCrcFql3Fx9E+8fsA62lypIQB1EJcTwkhZYRB2e4tHskMu3zhBwAAVxh3v0r6qn7veOT4gRPF2Klr/LjcSRUJQwAtLwppINZ9LaJtg+LLzvHjEu6HxNr7Zu479zhqik6dqljPYJFtpXmQ0j5iRk1GLMCtJitEh83Gpb98drQ+mRNlarb7RUPVQukXoMs+0UF1rEkf3/+rewPAjrxA5fNDmzeZId2iu1Cb+JQjNueONIGCvtg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(136003)(376002)(39860400002)(366004)(346002)(451199021)(31686004)(8936002)(8676002)(5660300002)(41300700001)(316002)(4326008)(6916009)(2906002)(54906003)(66556008)(66476007)(66946007)(6486002)(6512007)(26005)(53546011)(186003)(478600001)(6506007)(31696002)(86362001)(36756003)(2616005)(83380400001)(38100700002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?R0s4bkZOZDhVVEVJSG12dVBVSGw2V0wxODByTHp2ck1hMVJ4T1NKZTRZT21m?=
 =?utf-8?B?Qkdaa0hRUk9JTVpmendLUzFjWnJ1MzZ6N2tkNDJ1djd3QUFsYTVHdm9GVnhZ?=
 =?utf-8?B?UGpCYlFEb3lRV0dRcjlOaWtCd0Z1amFtNHlZbU9CT29EWUxPdnRWbWpyVWI0?=
 =?utf-8?B?YnhEVmtGbjJZNy9wUEhRajZiSnpGTnZZWlFxUnQvbTB3R2kwRjFIRVdyb2NM?=
 =?utf-8?B?a2xNdXlzTU9JbHA0a3U5Qm4wZW1CUVBVVHRydDN0Wis0OTJQVE80OFhFQ1ph?=
 =?utf-8?B?Q2ZKZnoyMm14b1B3SmhGWlpRQ0liQjROb1FDVjM1ZWt1MmEvaWxQSnNTaTB0?=
 =?utf-8?B?aVpjcHNZaENxRlkyQURFLytMZG82cWs2ak83alRxa0haWXVuMXJTQThWUWlU?=
 =?utf-8?B?dy82SUhVL1dramx5ZXlvR2ZNY2o0UjIvWENUckdNWkJlb3RjM0NYeDJyUzlo?=
 =?utf-8?B?cSt2ejhsTHk1S3VEZ3cvOEFRY0Mzd2Q4TURZTUJuUzNEb3JrR1l6bWY3b3Uz?=
 =?utf-8?B?SWJxWE51SUxuWVM1dzIvM21CbHdmSzFmL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Ux3amMxVVNP?=
 =?utf-8?B?Q09MdHJod2xGT1dzdGxZUTR2TXpsaTBQYStGOS94dkd6V1EyWUVpcEduQzBp?=
 =?utf-8?B?ei8zZy82ZTIzUDNERjhUQkJRcHU2TTBpMXY2NlZoWjdMZW5ONksrWldYcFh6?=
 =?utf-8?B?d0JnQVNBbTVsV05PbVUwdG9OZXZ6SkhrOHYwNGUwL0N1MzlTL2FoeUlUdHNp?=
 =?utf-8?B?d1kzeVZ3TEhVNUhrci9ZYWNLOXpxRFFNOGcxM0lRTktEekVweElnVWtHa3h0?=
 =?utf-8?B?cWtXVyt2cllIRlZPR2hRYys4M2U3dFRpcUgxR0swZHVoY1NNU0xYTnI1Q0dV?=
 =?utf-8?B?ZjBQNG1tcU9peDBXSjkyYjRGZkxxUjZURldDTWJGcFVRVjdvQnVjenBsM0dl?=
 =?utf-8?B?OUtrNUdsc2FqTWRiNWJPU1FMN2FDY0RSN2VKbXV2WTFZbE8vbWNlN2JrcmpB?=
 =?utf-8?B?OHZCTEJEVUdhQnRGemwrNFU0clJRbUVkVWV5SXI2VDJhRGJqdUJMcUNhK2g2?=
 =?utf-8?B?TGdwNFF6Q0pTK2RDc09ZQzh5bDdsWjNucElXTXB4eFd5bWMzazVpZnFOWW54?=
 =?utf-8?B?ZlRZRHlMVG1vQnR6dG02Mngzcm5ML2M2WWovOVdaaWVzcUtXSEhnMDJNMWE2?=
 =?utf-8?B?c1pVdFhzMFNUb2VHQXNoMXFpTVRBcTV6RGs0eDY5bjVoZnQrTFFFQ050N3l4?=
 =?utf-8?Q?qNPxsuTxQrWknHe8vzds9A94f?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1dab50fe-884f-4ece-4951-08db8cd83453
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 06:27:22.2990
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: VRgyNi7JA39GQNmKeLkBO8P1SaBUDVBxtbozpsgkLLfRYamUHCNSiZm/Wx8xwFl1sxvX41C41cKKn9foe/1UUA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6913

On 24.07.2023 21:49, Jason Andryuk wrote:
> On Mon, Jul 24, 2023 at 12:15â€¯PM Jan Beulich <jbeulich@suse.com> wrote:
>> On 24.07.2023 14:58, Jason Andryuk wrote:
>>> --- /dev/null
>>> +++ b/xen/arch/x86/acpi/cpufreq/hwp.c
>>> @@ -0,0 +1,521 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-only */
>>> +/*
>>> + * hwp.c cpufreq driver to run Intel Hardware P-States (HWP)
>>> + *
>>> + * Copyright (C) 2021 Jason Andryuk <jandryuk@gmail.com>
>>> + */
>>> +
>>> +#include <xen/cpumask.h>
>>> +#include <xen/init.h>
>>> +#include <xen/param.h>
>>> +#include <xen/xmalloc.h>
>>> +#include <asm/msr.h>
>>> +#include <acpi/cpufreq/cpufreq.h>
>>> +
>>> +static bool __ro_after_init feature_hwp_notification;
>>> +static bool __ro_after_init feature_hwp_activity_window;
>>> +
>>> +static bool __ro_after_init feature_hdc;
>>> +
>>> +static bool __ro_after_init opt_cpufreq_hdc = true;
>>> +
>>> +union hwp_request
>>> +{
>>> +    struct
>>> +    {
>>> +        unsigned int min_perf:8;
>>> +        unsigned int max_perf:8;
>>> +        unsigned int desired:8;
>>> +        unsigned int energy_perf:8;
>>> +        unsigned int activity_window:10;
>>> +        bool package_control:1;
>>> +        unsigned int :16;
>>> +        bool activity_window_valid:1;
>>> +        bool energy_perf_valid:1;
>>> +        bool desired_valid:1;
>>> +        bool max_perf_valid:1;
>>> +        bool min_perf_valid:1;
>>> +    };
>>> +    uint64_t raw;
>>> +};
>>> +
>>> +struct hwp_drv_data
>>> +{
>>> +    union
>>> +    {
>>> +        uint64_t hwp_caps;
>>> +        struct
>>> +        {
>>> +            unsigned int highest:8;
>>> +            unsigned int guaranteed:8;
>>> +            unsigned int most_efficient:8;
>>> +            unsigned int lowest:8;
>>> +            unsigned int :32;
>>> +        } hw;
>>> +    };
>>> +    union hwp_request curr_req;
>>> +    int ret;
>>> +    uint16_t activity_window;
>>> +    uint8_t minimum;
>>> +    uint8_t maximum;
>>> +    uint8_t desired;
>>> +    uint8_t energy_perf;
>>> +};
>>> +static DEFINE_PER_CPU_READ_MOSTLY(struct hwp_drv_data *, hwp_drv_data);
>>> +
>>> +#define hwp_err(cpu, fmt, ...) \
>>> +    printk(XENLOG_ERR "HWP: CPU%u error: " fmt, cpu, ##__VA_ARGS__)
>>> +#define hwp_info(fmt, ...)    printk(XENLOG_INFO "HWP: " fmt, ##__VA_ARGS__)
>>
>> I'm not convinced ", ##__VA_ARGS__" is a good construct to use. I notice
>> we have a few instances (mainly in code inherited from elsewhere), but I
>> think it ought to either be plain C99 style (without the ##) or purely
>> the gcc extension form (not using __VA_ARGS__).
> 
> Using plain __VA_ARGS__ doesn't work for the cases without arguments:
> arch/x86/acpi/cpufreq/hwp.c:78:53: error: expected expression before â€˜)â€™ token
>    78 |         printk(XENLOG_DEBUG "HWP: " fmt, __VA_ARGS__);  \
>       |                                                     ^
> arch/x86/acpi/cpufreq/hwp.c:201:9: note: in expansion of macro â€˜hwp_verboseâ€™
>   201 |         hwp_verbose("disabled: No energy/performance
> preference available");
>       |         ^~~~~~~~~~~

Of course.

> I can use "__VA_OPT__(,) __VA_ARGS__" though.

__VA_OPT__ is yet newer than C99, so this is an option only if all
compilers we continue to support actually know of this. We have no
uses of it in the codebase so far, which suggests you might best go
with the longstanding gcc extension here.

>>> +static int cf_check hwp_cpufreq_cpu_init(struct cpufreq_policy *policy)
>>> +{
>>> +    static union hwp_request initial_req;
>>> +    unsigned int cpu = policy->cpu;
>>> +    struct hwp_drv_data *data;
>>> +    bool first_run = false;
>>> +
>>> +    data = xzalloc(struct hwp_drv_data);
>>> +    if ( !data )
>>> +        return -ENOMEM;
>>> +
>>> +    policy->governor = &cpufreq_gov_hwp;
>>> +
>>> +    per_cpu(hwp_drv_data, cpu) = data;
>>> +
>>> +    on_selected_cpus(cpumask_of(cpu), hwp_init_msrs, policy, 1);
>>> +
>>> +    if ( data->curr_req.raw == -1 )
>>> +    {
>>> +        hwp_err(cpu, "Could not initialize HWP properly\n");
>>> +        per_cpu(hwp_drv_data, cpu) = NULL;
>>> +        xfree(data);
>>> +        return -ENODEV;
>>> +    }
>>> +
>>> +    data->minimum = data->curr_req.min_perf;
>>> +    data->maximum = data->curr_req.max_perf;
>>> +    data->desired = data->curr_req.desired;
>>> +    data->energy_perf = data->curr_req.energy_perf;
>>> +    data->activity_window = data->curr_req.activity_window;
>>> +
>>> +    if ( initial_req.raw == 0 )
>>> +    {
>>> +        hwp_verbose("CPU%u: HWP_CAPABILITIES: %016lx\n", cpu, data->hwp_caps);
>>> +        initial_req = data->curr_req;
>>> +        first_run = true;
>>> +    }
>>
>> What part of data->curr_req is guaranteed to be non-0 (for the condition
>> around ...
>>
>>> +    if ( first_run || data->curr_req.raw != initial_req.raw )
>>> +        hwp_verbose("CPU%u: rdmsr HWP_REQUEST %016lx\n", cpu,
>>> +                    data->curr_req.raw);
>>
>> ... this logging to be effective)?
> 
> Hmmm.  I think you are correct that there is no guarantee that
> data->curr_req will be non-zero.  i.e. a BIOS could zero the whole
> register.  In practice, I see 0x8000ff01 - energy_perf = 0x80, maximum
> = 0xff and minimum = 0x01.
> 
> Would you prefer that I make first_run a static variable to track if
> initial_req has been populated?

Well, I wouldn't call it "prefer", but I see no easy alternative.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 06:41:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 06:41:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569449.890186 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOBjE-0004N6-Oq; Tue, 25 Jul 2023 06:41:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569449.890186; Tue, 25 Jul 2023 06:41:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOBjE-0004Mz-Lv; Tue, 25 Jul 2023 06:41:04 +0000
Received: by outflank-mailman (input) for mailman id 569449;
 Tue, 25 Jul 2023 06:41:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOBjE-0004Mt-2W
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 06:41:04 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2081.outbound.protection.outlook.com [40.107.7.81])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 392ce7b8-2ab6-11ee-b23d-6b7b168915f2;
 Tue, 25 Jul 2023 08:41:02 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS4PR04MB9690.eurprd04.prod.outlook.com (2603:10a6:20b:4fd::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 06:40:33 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 06:40:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 392ce7b8-2ab6-11ee-b23d-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=PiSbbsIYWCp1pRiCNRAJfJITcAYpnwuoumh4rSu3P6c+IYvPU90ETjoVfD97K49Fo11wGViKQAwYOMdRfOukkSO3tIY278RjX65H9jELSU9R+LW+iUcFBa09QUSxRF2CLwM6XXsfPnwlEBQylS32EpJ/KOi7ee2DEmBzp4SF793oXODmiTvC80vNKhNU+ndaJLtgIRMr+rHMXZY8ls/hhj3V55D3V1FIcBAbBcjgyVd9K6mkoaaRAoz2FORJiI2vzF2u0eR922OQvb6+mHGRh7bVjbRXNncbMBarsnwq4PTYcdSBDYLye5HeZ7Y/uQVZWBEqO7C+f5c6eLeBGYwvVw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=zra/HTMP5ef0ZgjtY/CGV/K/31/jxct9cpzrwEqCzm8=;
 b=SlYrGZr5nMENqw4rdLpOmFYH3yVZrcp5SswLOPZDQRSX+0XyuovrafQDz4Jsh2CwdEZDfzBntVX1p9+SjHSm2P1CDlD2p9HhkRCiJ9azBtgU4RUzREKWH3mbPXZOBwS5BTxbShFPIVz7ab+NlO7nFo3dVU7VN7yGlZuzLZ+PyPXiJ1RpUYr20ZgaACNIvwIxUZL4/trzG8j6GgTZXK2qtQtCIw5cUL0qq6FAPn7y3prZGWSeiYMgtWtYg+QAxB86yfjNB7x6Ji7L/A8zw1m5hoiuQ3UOevxCTY/Qhe2ksy9QzGkUCYLEQCU6rArXePGdFEMhDOB9clJdjuySlEFsnQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=zra/HTMP5ef0ZgjtY/CGV/K/31/jxct9cpzrwEqCzm8=;
 b=25aln6UvudePjaejKYrdU+ygrvwnGstfjSf8DwQg7bjezFU6u/xoz3ina9ZRp3AT/12dD106EB1vBExBmtM12MB+w3bxwuyAEU3fAJ/NS+hfEwMKtWRh6X/vIsDvtDniDsoKqwK3fTTFI4gaTh0ur/3OM3A1fhTo3RxRaInSZhI1euvHs7xYVGCy6MRU5LuC0SmKY/BA/t+OkFVpX79Ec5+9yZg7pbJ99qa12Z5ZyF5+ynakiIE42ql/hJzQsdariDm/GzNsm7+Ca6kMlnIF1sbU2bBsfkREvwggv+HoKlHYq5840Y4BezETNXUm+6fZyYUHVN75BdDgyFLimmV7rQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <4a31893d-a784-ed33-bd47-5db85b3c02b6@suse.com>
Date: Tue, 25 Jul 2023 08:40:31 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v6 1/3] x86/microcode: Ignore microcode loading interface
 for revision = -1
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
References: <20230724165235.25262-1-alejandro.vallejo@cloud.com>
 <20230724165235.25262-2-alejandro.vallejo@cloud.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230724165235.25262-2-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0110.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a8::6) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS4PR04MB9690:EE_
X-MS-Office365-Filtering-Correlation-Id: 9b92ef6b-b4c8-4540-be35-08db8cda0bd7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	OMQwEfqgdev4VQ9IH80W729qpsBg4gvvryNN1sbjffOoO2PG1ny7TEHLiCx81Lqi+q4urci2tBtza/armdfGbvqlRUuz+CAvPkEdymZKK0hi73nxlDLJSomEqnMJRphzXt3bqNwwsDjII/K5Or/xxE5gyr8afq9oaTvBx2NGOre+lgY7hhTl9GwPkmo4FwBGlrugbWZoCq+WLSnhyDsSHhxie46wkJyGdNKoZgtNLZyIpezGKpJ0dzm7ucWQPUv1KAU8+HRcjdDmMQo1OxGbW6idfdcDNL4XwKFJwbJAxVjSJhxXNwMDGD2CqpiaMfQXKiLo1c6Qa+kDvFcUfzm9JOedoU8DTBNz6QgQoa0e/ZFTIozHtZGka0PIWz7XPeLreT4iBq01ihmknPWiUL0qd23FI4tx4RltVXOrmaAEHXfJKieNgGVGAOCwyl5bpqNc/pPNKKnWJYiX+pXIJko1RzgWom1xDTnt/ISdyuXDvGdvmoP+cvK2ILHAjKq35veCbvx1klElT5Q8Yd5Sc+hiamPtSh25r7huoEx7VTurHQTS5wUSqUwNb20nMdstBahjC00xva6ksaiy9ycAnneoSppJ6iWRtzC9/PZK+DdPeFg0C0DfSBJItxG5Z0r9SZ6MbbKlTo8N+fws5fF1mOiNgA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(39860400002)(136003)(396003)(366004)(451199021)(86362001)(36756003)(31696002)(31686004)(2906002)(54906003)(478600001)(38100700002)(26005)(186003)(2616005)(6506007)(53546011)(5660300002)(41300700001)(6486002)(6512007)(66476007)(66556008)(66946007)(8676002)(83380400001)(6916009)(4326008)(8936002)(316002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?T3dBSndaUnI4ZUh1ZENuL24wR09MOHFERWVubUpQVmRiUVZyQ0J1VS8zYWVS?=
 =?utf-8?B?SmNlMXRXbVJ6OE1WOWRtV0lYSWdmeG5pNUE0NEZMdXhhbTFhME44a1JrSUtH?=
 =?utf-8?B?QTJ3dng2bm1TcTBKUjkyL0ZDNnVHTmNlZU1TWGV0cGxCQnpHd3Y5cUVFZWJl?=
 =?utf-8?B?NG1oRjhZUG1lMlB4ZUhwQVN2VEdlQ1hlSjNNUHdxdFZiaGpVd3F4cENMamM5?=
 =?utf-8?B?WEF2bkxuMGExY0dOalpQeHB6UTVFNEhWNnplWTdZSUkzSk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npUVXhpdHJUKzlzOGdKWVJpeW9i?=
 =?utf-8?B?dXRQWFZ3M0lXYTd3K2pEUUV6MS9hSCtVQnUyTktVa0ZlbHJ1cWVKM3N0RGRU?=
 =?utf-8?Q?nTGo2/gHEaRV0Gz5eoiKXNbEx?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9b92ef6b-b4c8-4540-be35-08db8cda0bd7
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 06:40:33.3560
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ebRH8hzNYViT+JjsOFxyCy8XvsZYW1yw9LK/jD6BtS/1VUD2y8nnrgPB+NEN3hDBybdX3glSAK9xp8kIbavAsw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9690

On 24.07.2023 18:52, Alejandro Vallejo wrote:
> Some hypervisors report ~0 as the microcode revision to mean "don't issue
> microcode updates". Ignore the microcode loading interface in that case.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Hmm.

> --- a/xen/arch/x86/cpu/microcode/core.c
> +++ b/xen/arch/x86/cpu/microcode/core.c
> @@ -867,10 +867,23 @@ int __init early_microcode_init(unsigned long *module_map,
>          return -ENODEV;
>      }
>  
> -    microcode_grab_module(module_map, mbi);
> -
>      ucode_ops.collect_cpu_info();
>  
> +    /*
> +     * Some hypervisors deliberately report a microcode revision of -1 to
> +     * mean that they will not accept microcode updates. We take the hint
> +     * and ignore the microcode interface in that case.
> +     */
> +    if ( this_cpu(cpu_sig).rev == ~0 )
> +    {
> +        printk(XENLOG_INFO "Microcode loading disabled due to: %s",

While we have tentatively agreed to adjust what _will_ be emitted by
default (subject to suitable justification in that change's
description), such a patch is yet to be sent. As it stands this message
will be invisible by default.

> +                           "HW toggle");

With the comment talking about hypervisors, what is this string supposed
to tell an observer of the message in a log file?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 06:43:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 06:43:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569452.890195 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOBlO-0004yr-8w; Tue, 25 Jul 2023 06:43:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569452.890195; Tue, 25 Jul 2023 06:43:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOBlO-0004yk-5w; Tue, 25 Jul 2023 06:43:18 +0000
Received: by outflank-mailman (input) for mailman id 569452;
 Tue, 25 Jul 2023 06:43:16 +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 <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOBlM-0004yc-Nc
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 06:43:16 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20625.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::625])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 849d2c97-2ab6-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 08:43:09 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM7PR04MB6823.eurprd04.prod.outlook.com (2603:10a6:20b:102::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 06:43:12 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 06:43:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 849d2c97-2ab6-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=mat5TGBb5kQinOncVWKIudZNpL+TycH+/i/PIkWw3joISboM29W9Hqw2tEKbMbEsNuwJxzf4+ic/39GEV1rS11cfMsaTiOSmnl5N8sjbPhZ41PG67rtv/d+/cZf5Ich86xnlm8h/iXCgrnVigH7k6xUXo6iv2MRNmx9EzY2iOH00sKT8mVcuY1YMyTQRDWN32sDY1PomN2A9h20lZvY4DyrJgAtcH0J0DlgpRwBxLNvWxYQS8paOnKr1Y7gW0S0xo6GyqQ/iW04aCgWH9naspcgEesX6WZsc6WAERnOHn/e+OmxYWd5JthBdsOMgYt2K3O0nA7DyeGgVKgg9RkP4fQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=IqWXcYfpK4ztMAnhZGAzcZh3J5RSTOKhD6SWS3tr2Fg=;
 b=hsfrEg0RTQxnorgBTl3olDY1jiDDu36/uKjV1XNs/+4ElhBdKx7d/yUc7IjKkZB2gB6BfVYU20yOSzgstes5uP42BBcX/flekDLztZKbrCJgwtVMQyYyhB5fOotGviqEJT2nqGdR4IgFcQRkle0Hiosy8cDP0uaUuDlhdHuuOxxPFa3nJm8wTJBpg0xaPfoAkAmmbRQd2pBX0JvZiDt1X+zGmD8h2dacfR0GAVkj9THYALkiCZxdZWnTj390WmQTyVowlRb/WXZqM9AYEPwfZeUb4KcaMCq9GOhUbY0a27XSj7nO8yZ6FJ5GYNBbV/7o7glNYaBEapZsZPpF4/4uFA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IqWXcYfpK4ztMAnhZGAzcZh3J5RSTOKhD6SWS3tr2Fg=;
 b=tHuFlvbrhR/CMRiRyKKjGcdBr46znxIJXjvF9L41kWTlr0GPzv6SvWWaYL0ucZSRHC1sjwSlbzojrk3kIbORtnFDxnJ6/tpQUollX7TtBrsAbaEbWVdTbfZlOHLiYV9QmwP40K9qCiumyr4ELsicljtZJs65Cl267mrwzWGE+qSD6QIRcLXQSr4VEd1yRkT431QG3XER2y0gmp5y0e4xDGwGr8MwBYRIDxrUqJr/Pi6Bd5SPyYwhSGRSZyOdjLXC+/zYBAQybwbzzSnaxxCqpFzNU+SwM5olWeKMDjOK9zN9SlLS4eK3IOnRWkflioPIZZCz4Xh466EwIPqWntm1Gw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <873d6b15-957e-9888-7a36-0aebacbf3666@suse.com>
Date: Tue, 25 Jul 2023 08:43:10 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v6 1/3] x86/microcode: Ignore microcode loading interface
 for revision = -1
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
References: <20230724165235.25262-1-alejandro.vallejo@cloud.com>
 <20230724165235.25262-2-alejandro.vallejo@cloud.com>
 <4a31893d-a784-ed33-bd47-5db85b3c02b6@suse.com>
In-Reply-To: <4a31893d-a784-ed33-bd47-5db85b3c02b6@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0053.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:48::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM7PR04MB6823:EE_
X-MS-Office365-Filtering-Correlation-Id: e2a81d49-32cd-4cbf-f708-08db8cda6a9f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	/TUzznmo9H6WmBvlLmxKHCjhw+w5qJlNX11/3bHYalRvn34ipQMzw12Tx2v4laSyjpnRAY/WrkEn1iWpDrDZR8NbzDxUtSeZyYlrbAANGGuklrUb01u3BNpmytStDwqm0M/BMHkEZCGn9RNADoQE0YGpwUBEKY/nLJEkknnZCvnAdgcUaX8GAYoFhX8TUQ0KKaP/RM25/AANV8ravVq4iGT/UTlGsA7TmTcQnQlvltjSU+40DFiNwM0S/EhEyi1GFVGJPYr0wTeKefTcTtPN3piWUz/vtW0FaQDXAJICoDxd5IezNKnf6pnDwb8Gv5fiXUtKr15eaN9G8y9IdQ15x4w6mhU/Q/85hi8HzcvAYlYXa+Qwl4gYW9PeHTOXhz8q2VXeaPyu8qsjCH3InmbCHMQY18mdKQTVN/DThp49iUcU76FekUZ2dJXaO88sHe4siiEyVnrhQvRGa3b+s9jVdcJgfw1TK4KruYxYVVgrfelEpNV5DuYkgH4T6Ul3OuzZayeM4UhAsF4Owxg+fEskKy75oAdTqNBOczNm56ueO8bB9fBuQ5hWU/s0h6i3Boa6EQUHlJ2ngM1sDCwJ+33g9WnXMf5aQybTJ3jmurtJRQo9lnrnIowedz4EAMbRdS7h/uaCXDjAMzV5rh9D6zfuhg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(376002)(366004)(346002)(39860400002)(396003)(451199021)(2906002)(186003)(6506007)(26005)(38100700002)(2616005)(53546011)(83380400001)(41300700001)(5660300002)(66946007)(66556008)(316002)(66476007)(4326008)(6916009)(8676002)(8936002)(36756003)(86362001)(31696002)(54906003)(478600001)(6512007)(6486002)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Vlo5TFZjeWYzdkNKVU9DVkl1bW5Md3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ENIejF6bVAyUnZaY25Rci9OemJUOU9NZ0ptYzlhQjFpK1I2?=
 =?utf-8?B?U0s2Rjk2T1hPNzNmUEVyZmRKb0g0dm9KSEd3clluTWtlb3pPNTgwb1NxNklP?=
 =?utf-8?B?N0JwTzlKUWFMUVdBS083bHFDcE1qK3RBWUhaTEhoaG9qc3B5N1ZIWkxqUkxa?=
 =?utf-8?B?N2VGdjlXam1zTTVubmU2M0hKUDVQN1NZYTkydXpSMU9rZjg3YUhJbGs1VG92?=
 =?utf-8?B?YkFrNlRxMmFNR253T1d1cW5WT1ZPTHcwRGVBbkx6NWR4aFNSZHRHY093NVBu?=
 =?utf-8?B?aldaU25NREQ1TDQvaTdKNE1YRmYvUGJMYjlvR2R6ZXlVT0M1alRNQlBpbmN1?=
 =?utf-8?Q?PLgOMfLJVS8S9SOb+aQzdlVTA?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e2a81d49-32cd-4cbf-f708-08db8cda6a9f
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 06:43:12.3640
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 2/P3TabtPwsyimBYBInHopdD82mlNauutnvv/rNEEO20ZNV+yO/9hxGashZVCmHmg4CmoUwIh2X52GVLvpXbvA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6823

On 25.07.2023 08:40, Jan Beulich wrote:
> On 24.07.2023 18:52, Alejandro Vallejo wrote:
>> --- a/xen/arch/x86/cpu/microcode/core.c
>> +++ b/xen/arch/x86/cpu/microcode/core.c
>> @@ -867,10 +867,23 @@ int __init early_microcode_init(unsigned long *module_map,
>>          return -ENODEV;
>>      }
>>  
>> -    microcode_grab_module(module_map, mbi);
>> -
>>      ucode_ops.collect_cpu_info();
>>  
>> +    /*
>> +     * Some hypervisors deliberately report a microcode revision of -1 to
>> +     * mean that they will not accept microcode updates. We take the hint
>> +     * and ignore the microcode interface in that case.
>> +     */
>> +    if ( this_cpu(cpu_sig).rev == ~0 )
>> +    {
>> +        printk(XENLOG_INFO "Microcode loading disabled due to: %s",
> 
> While we have tentatively agreed to adjust what _will_ be emitted by
> default (subject to suitable justification in that change's
> description), such a patch is yet to be sent. As it stands this message
> will be invisible by default.
> 
>> +                           "HW toggle");
> 
> With the comment talking about hypervisors, what is this string supposed
> to tell an observer of the message in a log file?

Looking at patch 3 I get the impression that you put here the wrong of the
two messages there.

Jan



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 06:47:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 06:47:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569455.890216 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOBpc-0005rC-5m; Tue, 25 Jul 2023 06:47:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569455.890216; Tue, 25 Jul 2023 06:47:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOBpc-0005r3-2j; Tue, 25 Jul 2023 06:47:40 +0000
Received: by outflank-mailman (input) for mailman id 569455;
 Tue, 25 Jul 2023 06:47:38 +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
 <SRS0=QXT9=DL=linaro.org=viresh.kumar@srs-se1.protection.inumbo.net>)
 id 1qOBpa-0005qU-Rp
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 06:47:38 +0000
Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com
 [2607:f8b0:4864:20::634])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 22e147cd-2ab7-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 08:47:35 +0200 (CEST)
Received: by mail-pl1-x634.google.com with SMTP id
 d9443c01a7336-1b89114266dso41678295ad.0
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 23:47:35 -0700 (PDT)
Received: from localhost ([122.172.87.195]) by smtp.gmail.com with ESMTPSA id
 f20-20020a170902ab9400b001bb7a736b46sm6520346plr.104.2023.07.24.23.47.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 23:47:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 22e147cd-2ab7-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690267654; x=1690872454;
        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=Hcw0vhkpfA1IWVmpW9wPPgV2C/r/WIeNrF6Q4NPx1Cs=;
        b=e2vS6JKd5Vy/p29drm1dbYw1K/JcNfPQeFaLfaYPx0UwGlXs2imi0lkQVd00y2dXtj
         m+UpNHaeCs21NcHkcxK+BwICVhhKZQPsfzid5i83VJ7CmWNIpHXlus3VADuc1Wimp90M
         AxQyNtR1aTZANK9UnHB+z4qfjhm4/QfCmo444N8cSTUlSfF1eEBL10tDYfqMkvRkzUS0
         ntCOQmyYsx0/VVfhp3eAgJAsjFs9DPDQ/wCNiHDi6TZkpI9TE7sLJDb35Kh+77XaIqff
         GMiXpM5DoGXzzdNAGw78cPbRLZBk0lJQG8bWMmXvAi/FJ49Qe7eLOCyXAgDJypSFWQJZ
         h4Ow==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690267654; x=1690872454;
        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=Hcw0vhkpfA1IWVmpW9wPPgV2C/r/WIeNrF6Q4NPx1Cs=;
        b=hqrR8F6Zfm/MKP6qIEFONqGNNq7jeVLu8tvH2DFh1rbY6wCOBd3Vmzi33pWLnWS8E0
         ZhkI8Q3Bx8lKNCVfsJb439TulhXOikRN6Z1KwLH+UrYnPcbYAXUCKRHZCWikK2XDlzQD
         T4G5nIN8PGAqHnUYHbB8A5JV/c/ztostur+rMZT/qIBmLIh9o+48szNoIyCg4bqrn9V2
         9aGAw33qQLHwaWxvxSBSm66GrjfNKpEOrY1yuEplHBQ5c8jHpnNsxwbeCR/RxA5abA6h
         IxgOdLn2mjAPtBHGDGuyWxmJKRT4spNoF5jJzmexJp2tjh70YuxuiO46leyO7tGG/UXg
         my2g==
X-Gm-Message-State: ABy/qLaClMOOZx6dI0b/4GYmxp0O6MLDTgcIDRVo6ZZrL2i3WxnbkBfX
	PGq8mDSxFmW8h4HOc4hVe2Cln8fpzoLTAFnM2So=
X-Google-Smtp-Source: APBJJlFtlQZpWmJARSwj2NSQOJ/18NpmQBTPAIV6sVOL+bAv54tYlrZaDWwP8hi2MCYmwm2uvE2nig==
X-Received: by 2002:a17:902:cec1:b0:1b8:8dbd:e1a0 with SMTP id d1-20020a170902cec100b001b88dbde1a0mr15735753plg.13.1690267654137;
        Mon, 24 Jul 2023 23:47:34 -0700 (PDT)
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	=?UTF-8?q?Alex=20Benn=C3=A9e?= <alex.bennee@linaro.org>,
	stratos-dev@op-lists.linaro.org,
	Erik Schilling <erik.schilling@linaro.org>,
	Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	xen-devel@lists.xenproject.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH V3 2/2] xen: privcmd: Add support for irqfd
Date: Tue, 25 Jul 2023 12:17:26 +0530
Message-Id: <8c1ea7faa0fe5deed1b2c86ea0f73e824f8a001d.1690190453.git.viresh.kumar@linaro.org>
X-Mailer: git-send-email 2.31.1.272.g89b43f80a514
In-Reply-To: <ffae9d7021829fea19fd93fda3c30b52b0af923e.1690190453.git.viresh.kumar@linaro.org>
References: <ffae9d7021829fea19fd93fda3c30b52b0af923e.1690190453.git.viresh.kumar@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Xen provides support for injecting interrupts to the guests via the
HYPERVISOR_dm_op() hypercall. The same is used by the Virtio based
device backend implementations, in an inefficient manner currently.

Generally, the Virtio backends are implemented to work with the Eventfd
based mechanism. In order to make such backends work with Xen, another
software layer needs to poll the Eventfds and raise an interrupt to the
guest using the Xen based mechanism. This results in an extra context
switch.

This is not a new problem in Linux though. It is present with other
hypervisors like KVM, etc. as well. The generic solution implemented in
the kernel for them is to provide an IOCTL call to pass the interrupt
details and eventfd, which lets the kernel take care of polling the
eventfd and raising of the interrupt, instead of handling this in user
space (which involves an extra context switch).

This patch adds support to inject a specific interrupt to guest using
the eventfd mechanism, by preventing the extra context switch.

Inspired by existing implementations for KVM, etc..

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
V2.1->V3
- No changes

V2->V2.1
- Select EVENTFD from Kconfig

V1->V2:
- Improve error handling.
- Remove the unnecessary usage of list_for_each_entry_safe().
- Restrict the use of XEN_DMOP_set_irq_level to only ARM64.

 drivers/xen/Kconfig        |   1 +
 drivers/xen/privcmd.c      | 276 ++++++++++++++++++++++++++++++++++++-
 include/uapi/xen/privcmd.h |  14 ++
 3 files changed, 289 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
index d5d7c402b651..7967393c55a4 100644
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
@@ -261,6 +261,7 @@ config XEN_SCSI_BACKEND
 config XEN_PRIVCMD
 	tristate "Xen hypercall passthrough driver"
 	depends on XEN
+	select EVENTFD
 	default m
 	help
 	  The hypercall passthrough driver allows privileged user programs to
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index e2f580e30a86..0debc5482253 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -9,11 +9,16 @@
 
 #define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt
 
+#include <linux/eventfd.h>
+#include <linux/file.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/poll.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/string.h>
+#include <linux/workqueue.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
@@ -833,6 +838,257 @@ static long privcmd_ioctl_mmap_resource(struct file *file,
 	return rc;
 }
 
+/* Irqfd support */
+static struct workqueue_struct *irqfd_cleanup_wq;
+static DEFINE_MUTEX(irqfds_lock);
+static LIST_HEAD(irqfds_list);
+
+struct privcmd_kernel_irqfd {
+	domid_t dom;
+	u8 level;
+	bool error;
+	u32 irq;
+	struct eventfd_ctx *eventfd;
+	struct work_struct shutdown;
+	wait_queue_entry_t wait;
+	struct list_head list;
+	poll_table pt;
+};
+
+static void irqfd_deactivate(struct privcmd_kernel_irqfd *kirqfd)
+{
+	lockdep_assert_held(&irqfds_lock);
+
+	list_del_init(&kirqfd->list);
+	queue_work(irqfd_cleanup_wq, &kirqfd->shutdown);
+}
+
+static void irqfd_shutdown(struct work_struct *work)
+{
+	struct privcmd_kernel_irqfd *kirqfd =
+		container_of(work, struct privcmd_kernel_irqfd, shutdown);
+	u64 cnt;
+
+	eventfd_ctx_remove_wait_queue(kirqfd->eventfd, &kirqfd->wait, &cnt);
+	eventfd_ctx_put(kirqfd->eventfd);
+	kfree(kirqfd);
+}
+
+static void irqfd_inject(struct privcmd_kernel_irqfd *kirqfd)
+{
+	/* Different architectures support this differently */
+	struct xen_dm_op dm_op = {
+#ifdef CONFIG_ARM64
+		.op = XEN_DMOP_set_irq_level,
+		.u.set_irq_level.irq = kirqfd->irq,
+		.u.set_irq_level.level = kirqfd->level,
+#endif
+	};
+	struct xen_dm_op_buf xbufs = {
+		.size = sizeof(dm_op),
+	};
+	u64 cnt;
+	long rc;
+
+	eventfd_ctx_do_read(kirqfd->eventfd, &cnt);
+	set_xen_guest_handle(xbufs.h, &dm_op);
+
+	xen_preemptible_hcall_begin();
+	rc = HYPERVISOR_dm_op(kirqfd->dom, 1, &xbufs);
+	xen_preemptible_hcall_end();
+
+	/* Don't repeat the error message for consecutive failures */
+	if (rc && !kirqfd->error) {
+		pr_err("Failed to configure irq: %d to level: %d for guest domain: %d\n",
+		       kirqfd->irq, kirqfd->level, kirqfd->dom);
+	}
+
+	kirqfd->error = !!rc;
+}
+
+static int
+irqfd_wakeup(wait_queue_entry_t *wait, unsigned int mode, int sync, void *key)
+{
+	struct privcmd_kernel_irqfd *kirqfd =
+		container_of(wait, struct privcmd_kernel_irqfd, wait);
+	__poll_t flags = key_to_poll(key);
+
+	if (flags & EPOLLIN)
+		irqfd_inject(kirqfd);
+
+	if (flags & EPOLLHUP) {
+		mutex_lock(&irqfds_lock);
+		irqfd_deactivate(kirqfd);
+		mutex_unlock(&irqfds_lock);
+	}
+
+	return 0;
+}
+
+static void
+irqfd_poll_func(struct file *file, wait_queue_head_t *wqh, poll_table *pt)
+{
+	struct privcmd_kernel_irqfd *kirqfd =
+		container_of(pt, struct privcmd_kernel_irqfd, pt);
+
+	add_wait_queue_priority(wqh, &kirqfd->wait);
+}
+
+static int privcmd_irqfd_assign(struct privcmd_irqfd *irqfd)
+{
+	struct privcmd_kernel_irqfd *kirqfd, *tmp;
+	struct eventfd_ctx *eventfd;
+	__poll_t events;
+	struct fd f;
+	int ret;
+
+	kirqfd = kzalloc(sizeof(*kirqfd), GFP_KERNEL);
+	if (!kirqfd)
+		return -ENOMEM;
+
+	kirqfd->irq = irqfd->irq;
+	kirqfd->dom = irqfd->dom;
+	kirqfd->level = irqfd->level;
+	INIT_LIST_HEAD(&kirqfd->list);
+	INIT_WORK(&kirqfd->shutdown, irqfd_shutdown);
+
+	f = fdget(irqfd->fd);
+	if (!f.file) {
+		ret = -EBADF;
+		goto error_kfree;
+	}
+
+	eventfd = eventfd_ctx_fileget(f.file);
+	if (IS_ERR(eventfd)) {
+		ret = PTR_ERR(eventfd);
+		goto error_fd_put;
+	}
+
+	kirqfd->eventfd = eventfd;
+
+	/*
+	 * Install our own custom wake-up handling so we are notified via a
+	 * callback whenever someone signals the underlying eventfd.
+	 */
+	init_waitqueue_func_entry(&kirqfd->wait, irqfd_wakeup);
+	init_poll_funcptr(&kirqfd->pt, irqfd_poll_func);
+
+	mutex_lock(&irqfds_lock);
+
+	list_for_each_entry(tmp, &irqfds_list, list) {
+		if (kirqfd->eventfd == tmp->eventfd) {
+			ret = -EBUSY;
+			mutex_unlock(&irqfds_lock);
+			goto error_eventfd;
+		}
+	}
+
+	list_add_tail(&kirqfd->list, &irqfds_list);
+	mutex_unlock(&irqfds_lock);
+
+	/*
+	 * Check if there was an event already pending on the eventfd before we
+	 * registered, and trigger it as if we didn't miss it.
+	 */
+	events = vfs_poll(f.file, &kirqfd->pt);
+	if (events & EPOLLIN)
+		irqfd_inject(kirqfd);
+
+	/*
+	 * Do not drop the file until the kirqfd is fully initialized, otherwise
+	 * we might race against the EPOLLHUP.
+	 */
+	fdput(f);
+	return 0;
+
+error_eventfd:
+	eventfd_ctx_put(eventfd);
+
+error_fd_put:
+	fdput(f);
+
+error_kfree:
+	kfree(kirqfd);
+	return ret;
+}
+
+static int privcmd_irqfd_deassign(struct privcmd_irqfd *irqfd)
+{
+	struct privcmd_kernel_irqfd *kirqfd;
+	struct eventfd_ctx *eventfd;
+
+	eventfd = eventfd_ctx_fdget(irqfd->fd);
+	if (IS_ERR(eventfd))
+		return PTR_ERR(eventfd);
+
+	mutex_lock(&irqfds_lock);
+
+	list_for_each_entry(kirqfd, &irqfds_list, list) {
+		if (kirqfd->eventfd == eventfd) {
+			irqfd_deactivate(kirqfd);
+			break;
+		}
+	}
+
+	mutex_unlock(&irqfds_lock);
+
+	eventfd_ctx_put(eventfd);
+
+	/*
+	 * Block until we know all outstanding shutdown jobs have completed so
+	 * that we guarantee there will not be any more interrupts once this
+	 * deassign function returns.
+	 */
+	flush_workqueue(irqfd_cleanup_wq);
+
+	return 0;
+}
+
+static long privcmd_ioctl_irqfd(struct file *file, void __user *udata)
+{
+	struct privcmd_data *data = file->private_data;
+	struct privcmd_irqfd irqfd;
+
+	if (copy_from_user(&irqfd, udata, sizeof(irqfd)))
+		return -EFAULT;
+
+	/* No other flags should be set */
+	if (irqfd.flags & ~PRIVCMD_IRQFD_FLAG_DEASSIGN)
+		return -EINVAL;
+
+	/* If restriction is in place, check the domid matches */
+	if (data->domid != DOMID_INVALID && data->domid != irqfd.dom)
+		return -EPERM;
+
+	if (irqfd.flags & PRIVCMD_IRQFD_FLAG_DEASSIGN)
+		return privcmd_irqfd_deassign(&irqfd);
+
+	return privcmd_irqfd_assign(&irqfd);
+}
+
+static int privcmd_irqfd_init(void)
+{
+	irqfd_cleanup_wq = alloc_workqueue("privcmd-irqfd-cleanup", 0, 0);
+	if (!irqfd_cleanup_wq)
+		return -ENOMEM;
+
+	return 0;
+}
+
+static void privcmd_irqfd_exit(void)
+{
+	struct privcmd_kernel_irqfd *kirqfd, *tmp;
+
+	mutex_lock(&irqfds_lock);
+
+	list_for_each_entry_safe(kirqfd, tmp, &irqfds_list, list)
+		irqfd_deactivate(kirqfd);
+
+	mutex_unlock(&irqfds_lock);
+
+	destroy_workqueue(irqfd_cleanup_wq);
+}
+
 static long privcmd_ioctl(struct file *file,
 			  unsigned int cmd, unsigned long data)
 {
@@ -868,6 +1124,10 @@ static long privcmd_ioctl(struct file *file,
 		ret = privcmd_ioctl_mmap_resource(file, udata);
 		break;
 
+	case IOCTL_PRIVCMD_IRQFD:
+		ret = privcmd_ioctl_irqfd(file, udata);
+		break;
+
 	default:
 		break;
 	}
@@ -992,15 +1252,27 @@ static int __init privcmd_init(void)
 	err = misc_register(&xen_privcmdbuf_dev);
 	if (err != 0) {
 		pr_err("Could not register Xen hypercall-buf device\n");
-		misc_deregister(&privcmd_dev);
-		return err;
+		goto err_privcmdbuf;
+	}
+
+	err = privcmd_irqfd_init();
+	if (err != 0) {
+		pr_err("irqfd init failed\n");
+		goto err_irqfd;
 	}
 
 	return 0;
+
+err_irqfd:
+	misc_deregister(&xen_privcmdbuf_dev);
+err_privcmdbuf:
+	misc_deregister(&privcmd_dev);
+	return err;
 }
 
 static void __exit privcmd_exit(void)
 {
+	privcmd_irqfd_exit();
 	misc_deregister(&privcmd_dev);
 	misc_deregister(&xen_privcmdbuf_dev);
 }
diff --git a/include/uapi/xen/privcmd.h b/include/uapi/xen/privcmd.h
index d2029556083e..47334bb91a09 100644
--- a/include/uapi/xen/privcmd.h
+++ b/include/uapi/xen/privcmd.h
@@ -98,6 +98,18 @@ struct privcmd_mmap_resource {
 	__u64 addr;
 };
 
+/* For privcmd_irqfd::flags */
+#define PRIVCMD_IRQFD_FLAG_DEASSIGN (1 << 0)
+
+struct privcmd_irqfd {
+	__u32 fd;
+	__u32 flags;
+	__u32 irq;
+	domid_t dom;
+	__u8 level;
+	__u8 pad;
+};
+
 /*
  * @cmd: IOCTL_PRIVCMD_HYPERCALL
  * @arg: &privcmd_hypercall_t
@@ -125,5 +137,7 @@ struct privcmd_mmap_resource {
 	_IOC(_IOC_NONE, 'P', 6, sizeof(domid_t))
 #define IOCTL_PRIVCMD_MMAP_RESOURCE				\
 	_IOC(_IOC_NONE, 'P', 7, sizeof(struct privcmd_mmap_resource))
+#define IOCTL_PRIVCMD_IRQFD					\
+	_IOC(_IOC_NONE, 'P', 8, sizeof(struct privcmd_irqfd))
 
 #endif /* __LINUX_PUBLIC_PRIVCMD_H__ */
-- 
2.31.1.272.g89b43f80a514



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 06:47:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 06:47:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569454.890205 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOBpX-0005b0-P6; Tue, 25 Jul 2023 06:47:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569454.890205; Tue, 25 Jul 2023 06:47:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOBpX-0005at-MC; Tue, 25 Jul 2023 06:47:35 +0000
Received: by outflank-mailman (input) for mailman id 569454;
 Tue, 25 Jul 2023 06:47:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=QXT9=DL=linaro.org=viresh.kumar@srs-se1.protection.inumbo.net>)
 id 1qOBpW-0005an-9Y
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 06:47:34 +0000
Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com
 [2607:f8b0:4864:20::433])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 20e001e0-2ab7-11ee-b23d-6b7b168915f2;
 Tue, 25 Jul 2023 08:47:32 +0200 (CEST)
Received: by mail-pf1-x433.google.com with SMTP id
 d2e1a72fcca58-666eb03457cso2896212b3a.1
 for <xen-devel@lists.xenproject.org>; Mon, 24 Jul 2023 23:47:32 -0700 (PDT)
Received: from localhost ([122.172.87.195]) by smtp.gmail.com with ESMTPSA id
 p18-20020a170902a41200b001bb9f104333sm3906512plq.12.2023.07.24.23.47.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jul 2023 23:47:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 20e001e0-2ab7-11ee-b23d-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690267651; x=1690872451;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=rWzN+HUQXSE8CC0n86w1+/sl9/LWI75RHk+lRbcP7uQ=;
        b=vK/cpq+XWmV8elkOjGqR/FSbCh2+QA4jEpC+cdRsN1NvyTMYsKV900RWFOhyZ9DDiz
         JPo2TwZXFnBZf8fYGuMsI07osGoJvNY14R0ysPvEc6Ft9LJsCyPJtA8fuelswb6wIEP4
         WiOBcqZ6dSb68yF/rku5wz1zmo7QpEE4diqQmccpU5rSzXh5SIhhG4hFZY+eUM92M691
         hHwUJILbZQ40y5SmT8UTK7wrSrDx2jt3LfRHbwIAunSeJcGtMDYePQOoErkIQ/EKeeoh
         b9XZ3hK6PvAww6Plv4TTmERMqij2sTkksKPGlH9MhH37EdZEuM0c+Gz2DFq5Q4+xWbW+
         k2Tw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690267651; x=1690872451;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=rWzN+HUQXSE8CC0n86w1+/sl9/LWI75RHk+lRbcP7uQ=;
        b=IiEO6i0bqmbk24Z9mDDjxx16PLQnLTgYYOvrLnKcGURHDjgWF+wVYmUlnXXPs8qQw8
         kfWgdVrUxYz5WhzMXukrAALU2KTMsULn3ja72BlLFdqTbuq+sZHKwED+H/q9qNWYwzTr
         WwoZWO74TqwLjAYD2RcLBkGkAfxVL7P4XdTlnEj7TwWDZ58wWC9NIWlaU0zyrRdQ8XNI
         6qVRGCxWJOMyE+YYRVVCHnaUp96DjnAZ+q2ywpndSZPXjwE1uAjyfvO7lukeAArXL8Rm
         f2Z1CYEdZD7ItfSDkvqBdvsZc2pyHAMEj+Ps9M2Q7/YF8PYpi+lzzhYDVlS6IKIdAPK+
         7ZXQ==
X-Gm-Message-State: ABy/qLZJiYuLaPStrAkfVoLAGNaa4glRJHxKWJzqiddTnfwmte7eDKFi
	pdmEN11Uq4qLPUO5/6I2Nx1rJA==
X-Google-Smtp-Source: APBJJlEUiVNnwpl1ujfGTV4J3Wl9UlyHhagVQvV3W3y2/Umq0sU3Sc1U7L8vMx0LSpx0aqXmnEzaDQ==
X-Received: by 2002:a05:6a20:42a5:b0:126:306b:c6d4 with SMTP id o37-20020a056a2042a500b00126306bc6d4mr9851386pzj.23.1690267650623;
        Mon, 24 Jul 2023 23:47:30 -0700 (PDT)
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	=?UTF-8?q?Alex=20Benn=C3=A9e?= <alex.bennee@linaro.org>,
	stratos-dev@op-lists.linaro.org,
	Erik Schilling <erik.schilling@linaro.org>,
	Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	xen-devel@lists.xenproject.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH V3 1/2] xen: Update dm_op.h from Xen public header
Date: Tue, 25 Jul 2023 12:17:25 +0530
Message-Id: <ffae9d7021829fea19fd93fda3c30b52b0af923e.1690190453.git.viresh.kumar@linaro.org>
X-Mailer: git-send-email 2.31.1.272.g89b43f80a514
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Update the definitions in dm_op.h from Xen public header (latest commit
0c53c638e162 ("tools/xenstore: fix XSA-417 patch")).

List of changes done to the file after copying from Xen:
- Updated paths of included files.
- Removed typedef definitions, as is done for other Xen headers (as per
  kernel coding guidelines).
- Removed some not-so-useful comments.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
V2->V3:
- Updated commit log with more details.

V1->V2:
- New commit.

 include/xen/interface/hvm/dm_op.h | 445 ++++++++++++++++++++++++++++++
 1 file changed, 445 insertions(+)

diff --git a/include/xen/interface/hvm/dm_op.h b/include/xen/interface/hvm/dm_op.h
index 08d972f87c7b..bc6948fd1815 100644
--- a/include/xen/interface/hvm/dm_op.h
+++ b/include/xen/interface/hvm/dm_op.h
@@ -6,6 +6,451 @@
 #ifndef __XEN_PUBLIC_HVM_DM_OP_H__
 #define __XEN_PUBLIC_HVM_DM_OP_H__
 
+#include <xen/interface/xen.h>
+#include <xen/interface/event_channel.h>
+
+#ifndef uint64_aligned_t
+#define uint64_aligned_t uint64_t
+#endif
+
+/*
+ * IOREQ Servers
+ *
+ * The interface between an I/O emulator and Xen is called an IOREQ Server.
+ * A domain supports a single 'legacy' IOREQ Server which is instantiated if
+ * parameter...
+ *
+ * HVM_PARAM_IOREQ_PFN is read (to get the gfn containing the synchronous
+ * ioreq structures), or...
+ * HVM_PARAM_BUFIOREQ_PFN is read (to get the gfn containing the buffered
+ * ioreq ring), or...
+ * HVM_PARAM_BUFIOREQ_EVTCHN is read (to get the event channel that Xen uses
+ * to request buffered I/O emulation).
+ *
+ * The following hypercalls facilitate the creation of IOREQ Servers for
+ * 'secondary' emulators which are invoked to implement port I/O, memory, or
+ * PCI config space ranges which they explicitly register.
+ */
+
+typedef uint16_t ioservid_t;
+
+/*
+ * XEN_DMOP_create_ioreq_server: Instantiate a new IOREQ Server for a
+ *                               secondary emulator.
+ *
+ * The <id> handed back is unique for target domain. The valur of
+ * <handle_bufioreq> should be one of HVM_IOREQSRV_BUFIOREQ_* defined in
+ * hvm_op.h. If the value is HVM_IOREQSRV_BUFIOREQ_OFF then  the buffered
+ * ioreq ring will not be allocated and hence all emulation requests to
+ * this server will be synchronous.
+ */
+#define XEN_DMOP_create_ioreq_server 1
+
+struct xen_dm_op_create_ioreq_server {
+    /* IN - should server handle buffered ioreqs */
+    uint8_t handle_bufioreq;
+    uint8_t pad[3];
+    /* OUT - server id */
+    ioservid_t id;
+};
+
+/*
+ * XEN_DMOP_get_ioreq_server_info: Get all the information necessary to
+ *                                 access IOREQ Server <id>.
+ *
+ * If the IOREQ Server is handling buffered emulation requests, the
+ * emulator needs to bind to event channel <bufioreq_port> to listen for
+ * them. (The event channels used for synchronous emulation requests are
+ * specified in the per-CPU ioreq structures).
+ * In addition, if the XENMEM_acquire_resource memory op cannot be used,
+ * the emulator will need to map the synchronous ioreq structures and
+ * buffered ioreq ring (if it exists) from guest memory. If <flags> does
+ * not contain XEN_DMOP_no_gfns then these pages will be made available and
+ * the frame numbers passed back in gfns <ioreq_gfn> and <bufioreq_gfn>
+ * respectively. (If the IOREQ Server is not handling buffered emulation
+ * only <ioreq_gfn> will be valid).
+ *
+ * NOTE: To access the synchronous ioreq structures and buffered ioreq
+ *       ring, it is preferable to use the XENMEM_acquire_resource memory
+ *       op specifying resource type XENMEM_resource_ioreq_server.
+ */
+#define XEN_DMOP_get_ioreq_server_info 2
+
+struct xen_dm_op_get_ioreq_server_info {
+    /* IN - server id */
+    ioservid_t id;
+    /* IN - flags */
+    uint16_t flags;
+
+#define _XEN_DMOP_no_gfns 0
+#define XEN_DMOP_no_gfns (1u << _XEN_DMOP_no_gfns)
+
+    /* OUT - buffered ioreq port */
+    evtchn_port_t bufioreq_port;
+    /* OUT - sync ioreq gfn (see block comment above) */
+    uint64_aligned_t ioreq_gfn;
+    /* OUT - buffered ioreq gfn (see block comment above)*/
+    uint64_aligned_t bufioreq_gfn;
+};
+
+/*
+ * XEN_DMOP_map_io_range_to_ioreq_server: Register an I/O range for
+ *                                        emulation by the client of
+ *                                        IOREQ Server <id>.
+ * XEN_DMOP_unmap_io_range_from_ioreq_server: Deregister an I/O range
+ *                                            previously registered for
+ *                                            emulation by the client of
+ *                                            IOREQ Server <id>.
+ *
+ * There are three types of I/O that can be emulated: port I/O, memory
+ * accesses and PCI config space accesses. The <type> field denotes which
+ * type of range* the <start> and <end> (inclusive) fields are specifying.
+ * PCI config space ranges are specified by segment/bus/device/function
+ * values which should be encoded using the DMOP_PCI_SBDF helper macro
+ * below.
+ *
+ * NOTE: unless an emulation request falls entirely within a range mapped
+ * by a secondary emulator, it will not be passed to that emulator.
+ */
+#define XEN_DMOP_map_io_range_to_ioreq_server 3
+#define XEN_DMOP_unmap_io_range_from_ioreq_server 4
+
+struct xen_dm_op_ioreq_server_range {
+    /* IN - server id */
+    ioservid_t id;
+    uint16_t pad;
+    /* IN - type of range */
+    uint32_t type;
+# define XEN_DMOP_IO_RANGE_PORT   0 /* I/O port range */
+# define XEN_DMOP_IO_RANGE_MEMORY 1 /* MMIO range */
+# define XEN_DMOP_IO_RANGE_PCI    2 /* PCI segment/bus/dev/func range */
+    /* IN - inclusive start and end of range */
+    uint64_aligned_t start, end;
+};
+
+#define XEN_DMOP_PCI_SBDF(s,b,d,f) \
+	((((s) & 0xffff) << 16) |  \
+	 (((b) & 0xff) << 8) |     \
+	 (((d) & 0x1f) << 3) |     \
+	 ((f) & 0x07))
+
+/*
+ * XEN_DMOP_set_ioreq_server_state: Enable or disable the IOREQ Server <id>
+ *
+ * The IOREQ Server will not be passed any emulation requests until it is
+ * in the enabled state.
+ * Note that the contents of the ioreq_gfn and bufioreq_gfn (see
+ * XEN_DMOP_get_ioreq_server_info) are not meaningful until the IOREQ Server
+ * is in the enabled state.
+ */
+#define XEN_DMOP_set_ioreq_server_state 5
+
+struct xen_dm_op_set_ioreq_server_state {
+    /* IN - server id */
+    ioservid_t id;
+    /* IN - enabled? */
+    uint8_t enabled;
+    uint8_t pad;
+};
+
+/*
+ * XEN_DMOP_destroy_ioreq_server: Destroy the IOREQ Server <id>.
+ *
+ * Any registered I/O ranges will be automatically deregistered.
+ */
+#define XEN_DMOP_destroy_ioreq_server 6
+
+struct xen_dm_op_destroy_ioreq_server {
+    /* IN - server id */
+    ioservid_t id;
+    uint16_t pad;
+};
+
+/*
+ * XEN_DMOP_track_dirty_vram: Track modifications to the specified pfn
+ *                            range.
+ *
+ * NOTE: The bitmap passed back to the caller is passed in a
+ *       secondary buffer.
+ */
+#define XEN_DMOP_track_dirty_vram 7
+
+struct xen_dm_op_track_dirty_vram {
+    /* IN - number of pages to be tracked */
+    uint32_t nr;
+    uint32_t pad;
+    /* IN - first pfn to track */
+    uint64_aligned_t first_pfn;
+};
+
+/*
+ * XEN_DMOP_set_pci_intx_level: Set the logical level of one of a domain's
+ *                              PCI INTx pins.
+ */
+#define XEN_DMOP_set_pci_intx_level 8
+
+struct xen_dm_op_set_pci_intx_level {
+    /* IN - PCI INTx identification (domain:bus:device:intx) */
+    uint16_t domain;
+    uint8_t bus, device, intx;
+    /* IN - Level: 0 -> deasserted, 1 -> asserted */
+    uint8_t  level;
+};
+
+/*
+ * XEN_DMOP_set_isa_irq_level: Set the logical level of a one of a domain's
+ *                             ISA IRQ lines.
+ */
+#define XEN_DMOP_set_isa_irq_level 9
+
+struct xen_dm_op_set_isa_irq_level {
+    /* IN - ISA IRQ (0-15) */
+    uint8_t  isa_irq;
+    /* IN - Level: 0 -> deasserted, 1 -> asserted */
+    uint8_t  level;
+};
+
+/*
+ * XEN_DMOP_set_pci_link_route: Map a PCI INTx line to an IRQ line.
+ */
+#define XEN_DMOP_set_pci_link_route 10
+
+struct xen_dm_op_set_pci_link_route {
+    /* PCI INTx line (0-3) */
+    uint8_t  link;
+    /* ISA IRQ (1-15) or 0 -> disable link */
+    uint8_t  isa_irq;
+};
+
+/*
+ * XEN_DMOP_modified_memory: Notify that a set of pages were modified by
+ *                           an emulator.
+ *
+ * DMOP buf 1 contains an array of xen_dm_op_modified_memory_extent with
+ * @nr_extents entries.
+ *
+ * On error, @nr_extents will contain the index+1 of the extent that
+ * had the error.  It is not defined if or which pages may have been
+ * marked as dirty, in this event.
+ */
+#define XEN_DMOP_modified_memory 11
+
+struct xen_dm_op_modified_memory {
+    /*
+     * IN - Number of extents to be processed
+     * OUT -returns n+1 for failing extent
+     */
+    uint32_t nr_extents;
+    /* IN/OUT - Must be set to 0 */
+    uint32_t opaque;
+};
+
+struct xen_dm_op_modified_memory_extent {
+    /* IN - number of contiguous pages modified */
+    uint32_t nr;
+    uint32_t pad;
+    /* IN - first pfn modified */
+    uint64_aligned_t first_pfn;
+};
+
+/*
+ * XEN_DMOP_set_mem_type: Notify that a region of memory is to be treated
+ *                        in a specific way. (See definition of
+ *                        hvmmem_type_t).
+ *
+ * NOTE: In the event of a continuation (return code -ERESTART), the
+ *       @first_pfn is set to the value of the pfn of the remaining
+ *       region and @nr reduced to the size of the remaining region.
+ */
+#define XEN_DMOP_set_mem_type 12
+
+struct xen_dm_op_set_mem_type {
+    /* IN - number of contiguous pages */
+    uint32_t nr;
+    /* IN - new hvmmem_type_t of region */
+    uint16_t mem_type;
+    uint16_t pad;
+    /* IN - first pfn in region */
+    uint64_aligned_t first_pfn;
+};
+
+/*
+ * XEN_DMOP_inject_event: Inject an event into a VCPU, which will
+ *                        get taken up when it is next scheduled.
+ *
+ * Note that the caller should know enough of the state of the CPU before
+ * injecting, to know what the effect of injecting the event will be.
+ */
+#define XEN_DMOP_inject_event 13
+
+struct xen_dm_op_inject_event {
+    /* IN - index of vCPU */
+    uint32_t vcpuid;
+    /* IN - interrupt vector */
+    uint8_t vector;
+    /* IN - event type (DMOP_EVENT_* ) */
+    uint8_t type;
+/* NB. This enumeration precisely matches hvm.h:X86_EVENTTYPE_* */
+# define XEN_DMOP_EVENT_ext_int    0 /* external interrupt */
+# define XEN_DMOP_EVENT_nmi        2 /* nmi */
+# define XEN_DMOP_EVENT_hw_exc     3 /* hardware exception */
+# define XEN_DMOP_EVENT_sw_int     4 /* software interrupt (CD nn) */
+# define XEN_DMOP_EVENT_pri_sw_exc 5 /* ICEBP (F1) */
+# define XEN_DMOP_EVENT_sw_exc     6 /* INT3 (CC), INTO (CE) */
+    /* IN - instruction length */
+    uint8_t insn_len;
+    uint8_t pad0;
+    /* IN - error code (or ~0 to skip) */
+    uint32_t error_code;
+    uint32_t pad1;
+    /* IN - type-specific extra data (%cr2 for #PF, pending_dbg for #DB) */
+    uint64_aligned_t cr2;
+};
+
+/*
+ * XEN_DMOP_inject_msi: Inject an MSI for an emulated device.
+ */
+#define XEN_DMOP_inject_msi 14
+
+struct xen_dm_op_inject_msi {
+    /* IN - MSI data (lower 32 bits) */
+    uint32_t data;
+    uint32_t pad;
+    /* IN - MSI address (0xfeexxxxx) */
+    uint64_aligned_t addr;
+};
+
+/*
+ * XEN_DMOP_map_mem_type_to_ioreq_server : map or unmap the IOREQ Server <id>
+ *                                      to specific memory type <type>
+ *                                      for specific accesses <flags>
+ *
+ * For now, flags only accept the value of XEN_DMOP_IOREQ_MEM_ACCESS_WRITE,
+ * which means only write operations are to be forwarded to an ioreq server.
+ * Support for the emulation of read operations can be added when an ioreq
+ * server has such requirement in future.
+ */
+#define XEN_DMOP_map_mem_type_to_ioreq_server 15
+
+struct xen_dm_op_map_mem_type_to_ioreq_server {
+    ioservid_t id;      /* IN - ioreq server id */
+    uint16_t type;      /* IN - memory type */
+    uint32_t flags;     /* IN - types of accesses to be forwarded to the
+                           ioreq server. flags with 0 means to unmap the
+                           ioreq server */
+
+#define XEN_DMOP_IOREQ_MEM_ACCESS_READ (1u << 0)
+#define XEN_DMOP_IOREQ_MEM_ACCESS_WRITE (1u << 1)
+
+    uint64_t opaque;    /* IN/OUT - only used for hypercall continuation,
+                           has to be set to zero by the caller */
+};
+
+/*
+ * XEN_DMOP_remote_shutdown : Declare a shutdown for another domain
+ *                            Identical to SCHEDOP_remote_shutdown
+ */
+#define XEN_DMOP_remote_shutdown 16
+
+struct xen_dm_op_remote_shutdown {
+    uint32_t reason;       /* SHUTDOWN_* => enum sched_shutdown_reason */
+                           /* (Other reason values are not blocked) */
+};
+
+/*
+ * XEN_DMOP_relocate_memory : Relocate GFNs for the specified guest.
+ *                            Identical to XENMEM_add_to_physmap with
+ *                            space == XENMAPSPACE_gmfn_range.
+ */
+#define XEN_DMOP_relocate_memory 17
+
+struct xen_dm_op_relocate_memory {
+    /* All fields are IN/OUT, with their OUT state undefined. */
+    /* Number of GFNs to process. */
+    uint32_t size;
+    uint32_t pad;
+    /* Starting GFN to relocate. */
+    uint64_aligned_t src_gfn;
+    /* Starting GFN where GFNs should be relocated. */
+    uint64_aligned_t dst_gfn;
+};
+
+/*
+ * XEN_DMOP_pin_memory_cacheattr : Pin caching type of RAM space.
+ *                                 Identical to XEN_DOMCTL_pin_mem_cacheattr.
+ */
+#define XEN_DMOP_pin_memory_cacheattr 18
+
+struct xen_dm_op_pin_memory_cacheattr {
+    uint64_aligned_t start; /* Start gfn. */
+    uint64_aligned_t end;   /* End gfn. */
+/* Caching types: these happen to be the same as x86 MTRR/PAT type codes. */
+#define XEN_DMOP_MEM_CACHEATTR_UC  0
+#define XEN_DMOP_MEM_CACHEATTR_WC  1
+#define XEN_DMOP_MEM_CACHEATTR_WT  4
+#define XEN_DMOP_MEM_CACHEATTR_WP  5
+#define XEN_DMOP_MEM_CACHEATTR_WB  6
+#define XEN_DMOP_MEM_CACHEATTR_UCM 7
+#define XEN_DMOP_DELETE_MEM_CACHEATTR (~(uint32_t)0)
+    uint32_t type;          /* XEN_DMOP_MEM_CACHEATTR_* */
+    uint32_t pad;
+};
+
+/*
+ * XEN_DMOP_set_irq_level: Set the logical level of a one of a domain's
+ *                         IRQ lines (currently Arm only).
+ * Only SPIs are supported.
+ */
+#define XEN_DMOP_set_irq_level 19
+
+struct xen_dm_op_set_irq_level {
+    uint32_t irq;
+    /* IN - Level: 0 -> deasserted, 1 -> asserted */
+    uint8_t level;
+    uint8_t pad[3];
+};
+
+/*
+ * XEN_DMOP_nr_vcpus: Query the number of vCPUs a domain has.
+ *
+ * This is the number of vcpu objects allocated in Xen for the domain, and is
+ * fixed from creation time.  This bound is applicable to e.g. the vcpuid
+ * parameter of XEN_DMOP_inject_event, or number of struct ioreq objects
+ * mapped via XENMEM_acquire_resource.
+ */
+#define XEN_DMOP_nr_vcpus 20
+
+struct xen_dm_op_nr_vcpus {
+    uint32_t vcpus; /* OUT */
+};
+
+struct xen_dm_op {
+    uint32_t op;
+    uint32_t pad;
+    union {
+        struct xen_dm_op_create_ioreq_server create_ioreq_server;
+        struct xen_dm_op_get_ioreq_server_info get_ioreq_server_info;
+        struct xen_dm_op_ioreq_server_range map_io_range_to_ioreq_server;
+        struct xen_dm_op_ioreq_server_range unmap_io_range_from_ioreq_server;
+        struct xen_dm_op_set_ioreq_server_state set_ioreq_server_state;
+        struct xen_dm_op_destroy_ioreq_server destroy_ioreq_server;
+        struct xen_dm_op_track_dirty_vram track_dirty_vram;
+        struct xen_dm_op_set_pci_intx_level set_pci_intx_level;
+        struct xen_dm_op_set_isa_irq_level set_isa_irq_level;
+        struct xen_dm_op_set_irq_level set_irq_level;
+        struct xen_dm_op_set_pci_link_route set_pci_link_route;
+        struct xen_dm_op_modified_memory modified_memory;
+        struct xen_dm_op_set_mem_type set_mem_type;
+        struct xen_dm_op_inject_event inject_event;
+        struct xen_dm_op_inject_msi inject_msi;
+        struct xen_dm_op_map_mem_type_to_ioreq_server map_mem_type_to_ioreq_server;
+        struct xen_dm_op_remote_shutdown remote_shutdown;
+        struct xen_dm_op_relocate_memory relocate_memory;
+        struct xen_dm_op_pin_memory_cacheattr pin_memory_cacheattr;
+        struct xen_dm_op_nr_vcpus nr_vcpus;
+    } u;
+};
+
 struct xen_dm_op_buf {
 	GUEST_HANDLE(void) h;
 	xen_ulong_t size;
-- 
2.31.1.272.g89b43f80a514



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 06:52:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 06:52:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569463.890226 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOBtn-0007dF-Mf; Tue, 25 Jul 2023 06:51:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569463.890226; Tue, 25 Jul 2023 06:51:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOBtn-0007d8-JK; Tue, 25 Jul 2023 06:51:59 +0000
Received: by outflank-mailman (input) for mailman id 569463;
 Tue, 25 Jul 2023 06:51:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOBtn-0007d2-0X
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 06:51:59 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20627.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::627])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bec80103-2ab7-11ee-b23d-6b7b168915f2;
 Tue, 25 Jul 2023 08:51:58 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB7554.eurprd04.prod.outlook.com (2603:10a6:20b:2da::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 06:51:54 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 06:51:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bec80103-2ab7-11ee-b23d-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=jnSweCAiqTVQQWqj9zMPMEpdFt786AbIdMcFcrmSXjIArLFKCRLuwY7pdvdhjAXlfGHMYeGINf6Z7TBwB9BvcoZ93k2dhmy69F5DaTQkrfKJIgx4StHaOWywIBdj4kXb0nZ0W/qqS8p5J/tYL65NHoUS+fZJsJ39w2INAh9r8SnEj45okm5nTBW6SJXVeJ4USjclt0NOCynq7Gy6LT/dgmTbvol2g280dmOR63+YMTOK+RTIIINMqHJFl1XM4pz/k5EQsMvA366pbE9gP69y1rFqA1Gr4RmGN7TX3RyF41bAMk7fClvRDiJxw7FN6JzWf+e53GHKyfvOEZ2JddLtWw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=n0RbcNAgsxwzQByZOv0WqToh+4jZlbpzHh/ceuBS+1o=;
 b=WcUePRVDBwQx/vbHaXpLsLwu0BpBgMu/TXSk/zCKHcegwHdirgvhO7aDUioe/ZGlEsxaky6AAUg7tQ1SWWYP7H740tCKCoUnyertn3trM537Ir0XacKO49/9hYTV8yWUUK2CNUf9/TdRKWm+GpgrrL2wsVxFGrJxofAhRHmhejIoNtjRik3jDQqPhCuVt9oHaYkG6Q2wCxyUMchyTxPAg2MxVbHU1KSjH2S3yn8qjscPrMxzIv9+rDo9ViO7GnKjhx1dGVv4LFqHSRr1WuaFHhYbkwh8pQPgDTP2UAeQDhoM7zuVuhkOVln6uE2d9+AnM1IC57Yb00NYniW3MsWkSg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=n0RbcNAgsxwzQByZOv0WqToh+4jZlbpzHh/ceuBS+1o=;
 b=mt3IyZyO3MnjIUYJ0v9BOQLEh676K15mttBxNa6x26QSqcQwH33kANMP9QJME1UK6Zyu662gMl8Z7OElYPcebUdPM4Oxe29pYdXAnLNj6jAcNOO3/Fj1L/UXy6syOBbm2SmpbKk4nAoxTcKGQMgSc/n0PZhkHa8Zto1or5hklXbNaeEoUc4YMSGb3m4RHKwe7kk2/4ZqThrc7eldcZyvp0C6iFOdj+85o4Zh62xodQhEzoy37C6dfbnMyB7d6Eq1E6eBeOdCFhpmcLt8L+8xIJsyx+MiRNhSgBkE+aC/ihwHf+tXL6HuQIF/hbCYBwgTGftne9kBTR18vv66cKPodA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <0d28d9cd-8cb3-6d03-94d3-e07a4dab9e95@suse.com>
Date: Tue, 25 Jul 2023 08:51:52 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 6/8] mm/pdx: Standardize region validation wrt pdx
 compression
Content-Language: en-US
To: Julien Grall <julien@xen.org>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-7-alejandro.vallejo@cloud.com>
 <1eb58b83-87ee-d738-08b0-948a8b48773a@xen.org>
 <64be6c1c.7b0a0220.49ba9.0e38@mx.google.com>
 <79ecab0a-cb91-cc95-fd31-c76ec287fa9b@xen.org>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <79ecab0a-cb91-cc95-fd31-c76ec287fa9b@xen.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0219.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ac::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB7554:EE_
X-MS-Office365-Filtering-Correlation-Id: ba029042-579d-4677-b4e0-08db8cdba1a3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	QT27KwuDGm5i5FJe22oYKqAyklBRKoatcmyxHKMqUbyBszDeWA58QTbuyeJzszKmByIi6CLx8EB0k5ratniHXKGYEpXv4UPMqma8/O+wqHCFuinznb60ijV71rh5T7rm8HMz31StLqCSs1l8j2ni+eoLbo8Vy6mcQzTpJJ9it/QDn8TZ/tqrNnuYw4dvC07bEPSK6S26UXpsK5fJRc2ppjfUm6g/ot2WbZvZo2so3G2T6FrWNXy3blCc1KG3qYZJfB1Jqs16F+0Ma550pTN3xGKG2tMe9kYk0+84O6kzimhxNFhrSOdep3jhWtVa4PSPvu7puWpqqaDw8VKHEsSBKtDpDVFKhDskyBcHSr0ruHwlZZn8+tpuVPkFl0IuUbNSNLdz0fpYOYPVV4hM+viR+uP4VcxSf+VGA+UKtD/Au+kmrGwRRB3UDYw/QMKb7K4ZqOawM1OcWFSLPZOEJ+Sl6shNc8HADDEh5iBAbUhvrQG+lGO9PtMQ1alLeH9I3b4llKB+7Ne6uNkjkaDSlW5FbcfOyzgXpqAswndjJgDgAMV31upLBqtTklUXHSkk9lLDjRr2/WRT3RIOwnbVMdeSm/HDdVcu4tOJcs40mPK+BWoSUqIgaoWWM1VclPAROnqwexzlBtxRxFcAVn+m+ZgPWA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(136003)(366004)(376002)(396003)(451199021)(31686004)(8676002)(8936002)(5660300002)(41300700001)(316002)(6916009)(4326008)(54906003)(2906002)(66946007)(66476007)(66556008)(6486002)(186003)(26005)(53546011)(478600001)(6512007)(6506007)(31696002)(86362001)(36756003)(2616005)(38100700002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Y0pUMzVyaE9FVS95YWtCL1ZmSlhyWnhsblFDVjYxY1Y2ZjZVd1RhRDJLaXY3?=
 =?utf-8?B?SmFiV0JZYU1YT3NXSjhMQ1dudyt1SHo1azRQU3ZBanljY25RTFg0Sk0rYkRJ?=
 =?utf-8?B?T1FXREh1M3QwVCtSeVh1WVE3ZWF1bnpWV3NtRThCQnd5bDBNZkRFZnFYRXNE?=
 =?utf-8?B?eUVnSFBkSk1yWjlxM0hWeWNKWERKT2NlRmhBYXRNUjQ4MzhCRytyTTJHaWFm?=
 =?utf-8?B?Szh3UTluUWFxdFVTbWw2b0FsWmtaRklPeVJ3djZoNi8xbXZtV29YRysybHJF?=
 =?utf-8?B?QmRPaDJvK2hJdmw0Vk9NcFRqdWpXTkNuNjJpdzNJQ3B2L1A1YlZuQkJTMGZD?=
 =?utf-8?B?bENYTXZWbCtieC9GZTNXMnpZeGIwUFpQNWxGYmlQREFVc3YxNDJzclNzaE1z?=
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Exchange-CrossTenant-Network-Message-Id: ba029042-579d-4677-b4e0-08db8cdba1a3
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 06:51:54.1668
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: RPpR146zXfExDJzVxh++T1Gsyh4GrE2m6Kt1ag94zhtdzDzM2Hm0fxruXMkEpNgwlG4C2gDdThubp1DKHrhHVg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7554

On 24.07.2023 20:20, Julien Grall wrote:
> On 24/07/2023 13:18, Alejandro Vallejo wrote:
>> On Fri, Jul 21, 2023 at 06:05:51PM +0100, Julien Grall wrote:
>>> Hi Alejandro,
>>>
>>> On 17/07/2023 17:03, Alejandro Vallejo wrote:
>>>> +bool pdx_is_region_compressible(unsigned long smfn, unsigned long emfn)
>>>
>>> For newer interface, I would rather prefer if we use start + size. It is
>>> easier to reason (you don't have to wonder whether 'emfn' is inclusive or
>>> not) and avoid issue in the case you are trying to handle a region right at
>>> the end of the address space as emfn would be 0 in the non-inclusive case
>>> (not much a concern for MFNs as the last one should be invalid, but it makes
>>> harder to reason).
>> I could agree on this, but every single caller is based on (smfn, emfn),
>> so it needlessly forces every caller to perform conversions where the
>> callee can do it just once.
> 
> That's indeed one way to see it. The problem is that...
> 
>> That said, I think your point makes sense and
>> it ought to be done. Probably as as part of a bigger refactor where
>> (smfn, emfn)-based functions are turned into (base, len) variants.
> 
> ... clean-up tends to be put in the back-burner and we just continue to 
> add new use. This makes the task to remove every use a lot more 
> difficult. So there is a point when one has to say no more.
> 
> Therefore, I would strongly prefer if each callers are doing the 
> computation. The rest can be removed leisurely.
> 
> Let see what the opinion of the other maintainers.

I think [a,b] ranges are fine to pass, and may even be preferable over
passing a size. I'm specifically using that term that you also used:
"size" (or "length") is ambiguous when talking about page granular
items - is it in bytes or number of pages? Especially in the former
case calculations at the call sites would be quite a bit more cumbersome.
I could agree with (mfn,nr) tuples, but as said I think inclusive
ranges are also fine to use (and would be less of a problem at the call
sites here, afaics).

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 07:02:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 07:02:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569467.890235 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOC3Y-0000ki-Kb; Tue, 25 Jul 2023 07:02:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569467.890235; Tue, 25 Jul 2023 07:02:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOC3Y-0000kb-HN; Tue, 25 Jul 2023 07:02:04 +0000
Received: by outflank-mailman (input) for mailman id 569467;
 Tue, 25 Jul 2023 07:02:03 +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 <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOC3X-0000kV-KF
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 07:02:03 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2087.outbound.protection.outlook.com [40.107.13.87])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2751cd88-2ab9-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 09:02:01 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB7884.eurprd04.prod.outlook.com (2603:10a6:10:1f2::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 07:01:30 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 07:01:30 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2751cd88-2ab9-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Lw04vWB2m6oJh5BNYRcdx+PZvYzdV3U/QvAPXrti6b/J3GyzkN3nCyQ5qHR+V5bQRQ1U6jAGwF1GQAnInQ13uOpmLOxUYBwbVaMfxuiuU1vOYKyfrcNvkDwl5s/l+gmgXWjazTZ/QDToQUX06r5wtTgq/yhf7paaLtHIalNGYP9f+ZF+HyPgTwrdyOG+3X1NvVOzUtoWUC/WUg8hjiXwoDnFmr8h3UvFnpbo0hsNmRonRQjhKepB5nFWNUY1ePQIRkNzytpphxBU/YZrMcnSgK6s/8iLjakmCycgAfQr77LeP1iCQ/hwnLCuXMnY7ieiSMJdjIegP6uDdtsi++HSLA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/GmQPjoG/bIz6yjmRzHLmM//DVTJdsU9m6I2Dabl8Gk=;
 b=I0KcRwwt3+Lq5lnBCVEgnIfW7gjLNL4wyyRCkKvPFuPr8hps3shTvcxcOp9tylsWGQ3jh2QrkWFxOiL7+7yz8aiQgfT6u5T+62xtDmn9R+A5XAEWm0uFtXJQwbC2YUoKJIFz8nT7umqmRSk+0TGcVylHYByd4HuqTp1FkDs9Wrz8ky7SlhAVEVkrtVAOFl4YKbjWppEAwAEbjEuQuhlLPpmkl5VHGFuODXNI0hsr3PoOH9ZCLAYEsfaqwxfvcdsKwFAUT/eRS3dD1hB6emacqIU9CNms+7sXdrzm92UbAws5x3BftFHl8LQRXUAh6gDtdixPs0/og1MAXwtXEseHHw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/GmQPjoG/bIz6yjmRzHLmM//DVTJdsU9m6I2Dabl8Gk=;
 b=Qv5wBtLPB1h3PU3i9aVRLLGfOnOMqr+a3z9UqynnyZhnMjAWFrrXZIcB2GXqhU6OQIn8Y9luZsqDxYHTuHBdECrMf20GlC9lgCGm+3acB8YSJdzrb7/iDrSuePIPLXD/kcBqij62wWwREZNnSCAczDoO/JNGPWIF/Hxeb6Eo6FWy/Jk67euByHxef2ME8y0QfLqdgHj1cUspF4PfxN4GJyRUJi6mcrWrb2JlVIBBI8f7xWiSaZZtrFeUfh6HFoNGloRbytedRpeUgkl/XiEy5/kdn4qVWU8vXyIrPO3crFavzyLxUFFtaACVuTaf3engNVD3ji/9Go59Q0cMlz0Ulg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e36f3372-b3ba-14bd-63db-49b2e85c08aa@suse.com>
Date: Tue, 25 Jul 2023 09:01:28 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v2] automation: add ECLAIR pipeline
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: Doug Goldstein <cardoe@cardoe.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <c3a0495afe01cca1b0caf6e1caa2d0a3451ecc00.1690219502.git.simone.ballarin@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <c3a0495afe01cca1b0caf6e1caa2d0a3451ecc00.1690219502.git.simone.ballarin@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0062.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:93::20) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB7884:EE_
X-MS-Office365-Filtering-Correlation-Id: ff45b5b7-e86f-4e9f-984c-08db8cdcf91f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	7VdKYQjFxjTkDZ4q+l5yovYTiiSVovlF+EhAw+mLUb2oH4G7UYuGDXxn0HqONnHHV2bmGW773XPjgSW7OZYQQgY0KN34BnIm2l9mNne8//lzbRf33K4TKo/GY/gsJh4/CjqPbLIoAE9Nw1ihCxbFUaYVcDuUVli81vVenh/y8orBLmGvmtEpvqOGb7xgrjHX3Q/aholffsDixAOcTqzZ4WqVye04HBnhpigB9ZIFaknKss2P/nLo4fFTjHyE/PkshssekxPpHBYbcNdAKyAVfIt0zxA0Fmmb4acD2s4pxd0To/FUpOs2LzF5AZCP/koM6d+Gg3SSjBAC0omqf1om1/Ui1zcoxDyMQE8P1k6JZPMe7fVKfY/5/0wDS/aX4GB2JPUwkg6FkZPHy8peZGI5XZiDReimysThB1cK3nvVVOBaR3YAtqt9Q+CcjAH5KiwSzNwllxN/znE5RZUXLJEwQ/uPrBUCadqSx+TKzxC2MmB30/Qg7zsbkopGJNS4vdsTgwhHs3W1GHxjyCUjfKf1hcaIGb7j9nvxXY8FPbdEijENjRPOWhAzevAng34DgCrJU83Lc6iPGt8EGBc2LtE2IZQnfTiy4NTOtLDfgVHSWa+Mdvzvp+dTVtD5TM6IW+wMSdt+OhaJ0uxsHoIWxQ6IoA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(136003)(366004)(396003)(376002)(451199021)(31686004)(2906002)(8676002)(8936002)(5660300002)(41300700001)(316002)(4744005)(4326008)(6916009)(54906003)(66556008)(66476007)(66946007)(6486002)(26005)(53546011)(186003)(478600001)(6506007)(6512007)(31696002)(86362001)(36756003)(2616005)(38100700002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-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=
 =?utf-8?B?cm12ejdDY1Rid0FGakNBeWlnLzUyL3h4T2ZVQUdtQVR4ejdsdXdlcU5Zb21O?=
 =?utf-8?B?VG9KS3A2NDVFZmo1YzBPenJGOWhtN0NpczF5cWU4bEdxZ3VEYThhUU11UHpz?=
 =?utf-8?B?L3J3bWZzYVlFc3ZpZ25uTDZpZ2Z5Q1pxVmNja3AyL0xTM2g2dnlSK2NlazRQ?=
 =?utf-8?B?YVBzZ0Z0b3NCKy9jcXA1NHpOUXIya1hQSlE2OWdlR1dRbkpOWC9aTndHOGxL?=
 =?utf-8?B?L0IzWis0blprem1zS1BGV3JhdWZzK2pUSVNkbS9qcE9kTjNUM1p2alVnbkxr?=
 =?utf-8?B?b1YzaXY5Q09jN0QxMmNxTEtBaHZFcXFvZGc3cVZjd0ttRzRXZ1AvdjRncW9H?=
 =?utf-8?B?RjFvMUl3YlFNS1Via2JPUFJNNzhPdnZhdVhhVzFIM1hoek41SkloaUhNdEh5?=
 =?utf-8?Q?NLrkOzZew6rQnKjqCnjfcWnAJ?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ff45b5b7-e86f-4e9f-984c-08db8cdcf91f
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 07:01:30.4491
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: T+9gj4tYCETysD8GWxlYpYb+60L83hap13fzPfeEPsZyiNvVKN12zJFfcdBL/eQrnK2pNFvFfueMZ4e0VSfFKw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7884

On 24.07.2023 19:25, Simone Ballarin wrote:
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -305,6 +305,12 @@ F:	xen/include/xen/libfdt/
>  F:	xen/include/xen/device_tree.h
>  F:	xen/drivers/passthrough/device_tree.c
>  
> +ECLAIR
> +M: Simone Ballarin <simone.ballarin@bugseng.com>
> +S: Supported
> +F: xen/automation/eclair_analysis/
> +F: xen/automation/scripts/eclair
> +
>  EFI
>  M:	Jan Beulich <jbeulich@suse.com>
>  S:	Supported

Please follow surrounding style (tab padding, not blank). It also
looks as if the xen/ prefixes in the names were wrong. Finally,
following Stefano's suggestion to split - decisions to make people
maintainers of certain pieces of the code are usually separate
from accepting any code changes / additions. Hence even if tiny,
this change may want splitting out and putting last. Content-
wise personally I think we want to start out with R:, not M:, but
this would need discussing among committers plus maintainers of
automation/.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 07:04:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 07:04:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569470.890246 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOC5g-0001Lx-58; Tue, 25 Jul 2023 07:04:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569470.890246; Tue, 25 Jul 2023 07:04:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOC5g-0001Lq-1f; Tue, 25 Jul 2023 07:04:16 +0000
Received: by outflank-mailman (input) for mailman id 569470;
 Tue, 25 Jul 2023 07:04:14 +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 <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOC5e-0001Lg-6Y
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 07:04:14 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20627.outbound.protection.outlook.com
 [2a01:111:f400:7d00::627])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7549dc78-2ab9-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 09:04:12 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VE1PR04MB7229.eurprd04.prod.outlook.com (2603:10a6:800:1a3::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 07:04:10 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 07:04:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7549dc78-2ab9-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Q/CmX2G4OEPS45YmW8WtusspuoqliVMaApR6OEAoiYE4TMOxLbm5AUL7pvtNFY6C0UdrVfX0LRqCFoWvSuG12x9ojurYU3g6ygwOzihqwG1VpqSNif0eX8BB9yPZNyW7k9buxNtUNPcEuZ6cB1GNZ+A6/6s/SZovPvC1SlikCARlA9pRn4XgUntoQ4I/M98Pu6obrpz/qaXQHUHJSOhdxmGCaqWHtcrl0gKxdDTD0wBgSBRX2t+wcfb9eXVVhv64/9fwwlHjDt3Z9zDhvEmkG7UMXSnMy1dicW5Uv6vfhGB3MgbpWBO/c2xGdBNHxRtiB7LmFffChltcf2C0LwhNNQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BAxtSNP1R6UV016cQgJQZU9N9jTZaAHsC3RGUVAJ1qg=;
 b=U1Ov/yw6kI9F9WVxhGUfyMCRekEm99+2FFXikG9leiY0TvDQAonMg5Hglgvp73SXT5F9Lu21y1Zg/fRfMghXhpupU5nMZ79Der8qlu8isaJR/BS2EDJERPa4hPtOSEnOHhI140IMYdYm0Dm3UBhDJDNP8GbSNbXcewoN3cm4g0clLCqQzxrJSGpo/ScpmOUx8YKVHouUBlUMAa2dnIrLI9rIFUZqAfD/oMAbToDERSZvQwdR/kDtk8otgY0Evi0aKyg4EzzMtpj4jWBrJNYRX2bzbmJk/8BCRD2dfrVVx30QDgly2P1thchQ6d3g/5sn6KGnH3/wdTy1FsVg9wRatw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BAxtSNP1R6UV016cQgJQZU9N9jTZaAHsC3RGUVAJ1qg=;
 b=Im0XHU3mW8+vbYjoPdqIXiqQehjB01Dut5MHN1+S6RIdOA+hOlgAS+4G4/OqFbNNH1xA6DskAJNvDYTTHbZ58oNMGLFdxL/19BqmJXQWmLRizSqwBDZ7LI6pryQiMlm1UuOmxEY0XlsPclElFUsxgUe2z3QbdUIrDFfwM5aVKC3RGabVP1Q7kU7fKfSa+1HwCNbKHyNKTmuAUxBS853fnA711Ryml6ICkLjFYe1tbB99MLwfsa6r1W7t3dIkdQJ1G/VPG+oLoRVj1avm1fqalHgCL5dbGZbQ/kbFr8hDOd7cqD/Ql6LCWXbPdF6+jXFUCOchWXPX1BNekpU3tKDqFg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <1498bef6-ded0-1b1f-a5ca-e8755800b489@suse.com>
Date: Tue, 25 Jul 2023 09:04:07 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH V3 1/2] xen: Update dm_op.h from Xen public header
Content-Language: en-US
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
 =?UTF-8?Q?Alex_Benn=c3=a9e?= <alex.bennee@linaro.org>,
 stratos-dev@op-lists.linaro.org, Erik Schilling <erik.schilling@linaro.org>,
 Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
 Mathieu Poirier <mathieu.poirier@linaro.org>,
 xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
 Juergen Gross <jgross@suse.com>, Stefano Stabellini
 <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
References: <ffae9d7021829fea19fd93fda3c30b52b0af923e.1690190453.git.viresh.kumar@linaro.org>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ffae9d7021829fea19fd93fda3c30b52b0af923e.1690190453.git.viresh.kumar@linaro.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0145.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:95::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VE1PR04MB7229:EE_
X-MS-Office365-Filtering-Correlation-Id: 1e6a2fd1-7e2b-4a08-900c-08db8cdd582a
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	WLXiQQuuRo1Lce7KLaYUbs6xV+kEBWyBdR1hgc8YITCMaGDBlFWrDyVs7yra7NnJWivUuqcJwj+qyq+c9VQ7WSTA0JacTHxVpgZDpqF4b3bgAKyy4jusmzsTrgljpwWnbLEgt1Ea2iwMbIXM/aGrIwKzMPhRAb1GSj3T/iFVpZIPGm7xOVBmroiOz1jCkpJkuuoynJCst+pTYVoRDGCpH3DE/HOw3KDdJuEOO7gH6JgViyjUEkk4I5tPbZxDSNv9zFZxMsKOzN9qsPstBzWEyzU2rf3MuVnUd4VvE09C83zoA3UZl9DeExEaJM4Yv0jGTvB8fO6zafRkmIkytBJPgColZmrrjyF36GKPh7HO5vqL43lsKsV5R8A6oBikWjb7my98qvqlKRiOzPsacfnCeSJYZMOe5CjKsNnkGEvcSx6blExwVfjbbXsq9NhpoOe0UvskGX3gG8ajzRYJmbqngJrFcoiLKT9bjFDgnhYqfDArhLR/5lvMCwCzGm8je3jUbS7hpcEUNqCBxCl3szCCKZXS8yxVeazWbVWNv8ZwcN462TGqPNDMvw1IP4ZUvv1i9R33orLZ6GXrA4QmrHa3CXBgeL2IMscLJkHxXGJZP5HbfmtnVQHKaH7Uaygu16ojuGRZD7ufHYEdWZRmceF5sg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(39860400002)(396003)(376002)(366004)(136003)(451199021)(6512007)(31686004)(186003)(2616005)(53546011)(26005)(6506007)(41300700001)(4326008)(316002)(36756003)(6486002)(38100700002)(5660300002)(7416002)(6916009)(66946007)(66476007)(66556008)(8676002)(8936002)(2906002)(54906003)(86362001)(478600001)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cW9jZGtYdWxuZ0ZqaWVMY21yTDVqQkMrM0dKYXpHN0NhQ3RpQXB6azlVaGFh?=
 =?utf-8?B?dVd2UkgvVE9DRmZnRmhRckVSSDdKMU9yMExsYmkxSk1mMmpmZ0VtcFd3amlp?=
 =?utf-8?B?d1BDbGRnRWpIdXRjRXFjVHdscmZVL0VwMGg0ZDU2TUFGNzgwc2lzZjJ4RGQv?=
 =?utf-8?B?NFJIVGw5WUdseVhIYWlIQ0l6T0xPL0lLd0FoMEMvYUZkQ3J6bmpSWDFZUjFp?=
 =?utf-8?B?amk1emgvZUFQeElLWWI0Ujh0QmpZOGpVbHJQZllvenJKTVNEZ2lSRmNjVVpU?=
 =?utf-8?B?d0h3ZmJ3ZVNOQmw5VTY4UnI2MldKQnFIdEdHTUhISmFFNS8ybWNWS3pVc0V2?=
 =?utf-8?B?WjByNEp4Y2JsY3dIcDhQblRMbW9maHFqTDZWb2N1cThZRFJidmE2bDNvT1BS?=
 =?utf-8?B?U3pFSTNpcE9Nbys5R0VXWFZjQ1BoSUtOM0NrV1ZONmdlbkRlb3ZNckxmVXpU?=
 =?utf-8?B?bkhZRHBRWGhRRDYzZy9pM05WWG0yWEJqSE9a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X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 07:04:09.8938
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: zeZ6Uui4epOhtdVXI+e1kFRqy7F5dQC/oMPHImFDOGtqBhlePvYjrwInBU3KbgYgxFmRnbx6dRDhyC4oh30BFw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7229

On 25.07.2023 08:47, Viresh Kumar wrote:
> +struct xen_dm_op {
> +    uint32_t op;
> +    uint32_t pad;
> +    union {
> +        struct xen_dm_op_create_ioreq_server create_ioreq_server;
> +        struct xen_dm_op_get_ioreq_server_info get_ioreq_server_info;
> +        struct xen_dm_op_ioreq_server_range map_io_range_to_ioreq_server;
> +        struct xen_dm_op_ioreq_server_range unmap_io_range_from_ioreq_server;
> +        struct xen_dm_op_set_ioreq_server_state set_ioreq_server_state;
> +        struct xen_dm_op_destroy_ioreq_server destroy_ioreq_server;
> +        struct xen_dm_op_track_dirty_vram track_dirty_vram;
> +        struct xen_dm_op_set_pci_intx_level set_pci_intx_level;
> +        struct xen_dm_op_set_isa_irq_level set_isa_irq_level;
> +        struct xen_dm_op_set_irq_level set_irq_level;
> +        struct xen_dm_op_set_pci_link_route set_pci_link_route;
> +        struct xen_dm_op_modified_memory modified_memory;
> +        struct xen_dm_op_set_mem_type set_mem_type;
> +        struct xen_dm_op_inject_event inject_event;
> +        struct xen_dm_op_inject_msi inject_msi;
> +        struct xen_dm_op_map_mem_type_to_ioreq_server map_mem_type_to_ioreq_server;
> +        struct xen_dm_op_remote_shutdown remote_shutdown;
> +        struct xen_dm_op_relocate_memory relocate_memory;
> +        struct xen_dm_op_pin_memory_cacheattr pin_memory_cacheattr;
> +        struct xen_dm_op_nr_vcpus nr_vcpus;
> +    } u;
> +};

Is sync-ing for the sake of sync-ing really useful? For example, are any
of the ioreq server elements halfway likely to ever be used in the kernel?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 07:09:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 07:09:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569473.890256 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOCAc-0001zb-Mi; Tue, 25 Jul 2023 07:09:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569473.890256; Tue, 25 Jul 2023 07:09:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOCAc-0001zU-JY; Tue, 25 Jul 2023 07:09:22 +0000
Received: by outflank-mailman (input) for mailman id 569473;
 Tue, 25 Jul 2023 07:09:20 +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
 <SRS0=QXT9=DL=linaro.org=viresh.kumar@srs-se1.protection.inumbo.net>)
 id 1qOCAa-0001zO-Oz
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 07:09:20 +0000
Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com
 [2607:f8b0:4864:20::632])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2b48b868-2aba-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 09:09:18 +0200 (CEST)
Received: by mail-pl1-x632.google.com with SMTP id
 d9443c01a7336-1b890e2b9b7so26217995ad.3
 for <xen-devel@lists.xenproject.org>; Tue, 25 Jul 2023 00:09:18 -0700 (PDT)
Received: from localhost ([122.172.87.195]) by smtp.gmail.com with ESMTPSA id
 l2-20020a170902f68200b001b89536974bsm10201845plg.202.2023.07.25.00.09.15
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 25 Jul 2023 00:09:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2b48b868-2aba-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690268957; x=1690873757;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=JIQ8MXgj79FPzxbU+Oz451tZts6uK1mso7WDqsxExFY=;
        b=VfntkoCSVssXo9LyVkGrt2TjunbWhF2qI/ykhbvzXpC9QmOrjiIdmtvZR/ssn8+Q1W
         uKQI3M1s0Uo8nufkszQL5PlNxyQrSbsDGQqFJBErhYh4k0XjilNPlVjWbvs1kGU9ymvt
         LPdeD7WxsbmnJDmAJSFZgj3y+nQlv1qn85ECPP47p5eMhWBffwI5DiGHmFBU4QTLouax
         UYG2osFUGhVt6Py0/Bo8TrqsjEXtKadDvJxf0sRLJwCT8UCtvfyTHRk2S3kW+qoVSWCv
         QwGo+WsR7TlD5JRpQyoD2EXZgk6dMbMVrXrDwFeQR1gbY2Rz7jly+gL0qfmRAHTCtJ/m
         IV2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690268957; x=1690873757;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=JIQ8MXgj79FPzxbU+Oz451tZts6uK1mso7WDqsxExFY=;
        b=XXj/X41ngn0ebrxYdI216AJQQ3FP1Nzhtgoxroe/R7KL9u+uMKykM3R5Yuz/rCTdvn
         4YQTUnIvkOFPPqTwS4MCZv+wEVmGExY6maUY6YANnGIJeggvIR9QAaX6IuDWrjdPoHaG
         /ToaDdNS1dQDbnaBrkSXe9Q2/1/nNsn2ndIb57UG3PWAuZLewueWMsLuymhNrGh9rDw6
         1fbh5jhdoEulxyJE06DWjsL3qkD6VwC+Uv1nOHC/wjOUjuJ9ugx4W/mA3qGzOrR8w6kN
         8gPJhrAs0I81BZaRa3KzMz+h5wZRTFEJ4HSrr1L92TLoV49l5ANjep1SIZyZgaVyo8hw
         HCPw==
X-Gm-Message-State: ABy/qLY3wbers+uEinNAqk1CuDKW1wSnd3r+ceXX/EE3MCNIeq9LQzkC
	V5r+s0zFnFXLhRH363ZFL7RcvQ==
X-Google-Smtp-Source: APBJJlH8GuZfYFneyMg85Bl3e/BeTCnIRoDterkLPKXOwUe47EpC07JsTIRlFxwn8ihA2rpmJFhqeQ==
X-Received: by 2002:a17:902:ea04:b0:1b8:b3f9:58e5 with SMTP id s4-20020a170902ea0400b001b8b3f958e5mr12453743plg.38.1690268956688;
        Tue, 25 Jul 2023 00:09:16 -0700 (PDT)
Date: Tue, 25 Jul 2023 12:39:14 +0530
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
	Alex =?utf-8?Q?Benn=C3=A9e?= <alex.bennee@linaro.org>,
	stratos-dev@op-lists.linaro.org,
	Erik Schilling <erik.schilling@linaro.org>,
	Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Subject: Re: [PATCH V3 1/2] xen: Update dm_op.h from Xen public header
Message-ID: <20230725070914.m3dxlokedrgjlgcu@vireshk-i7>
References: <ffae9d7021829fea19fd93fda3c30b52b0af923e.1690190453.git.viresh.kumar@linaro.org>
 <1498bef6-ded0-1b1f-a5ca-e8755800b489@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1498bef6-ded0-1b1f-a5ca-e8755800b489@suse.com>

On 25-07-23, 09:04, Jan Beulich wrote:
> On 25.07.2023 08:47, Viresh Kumar wrote:
> > +struct xen_dm_op {
> > +    uint32_t op;
> > +    uint32_t pad;
> > +    union {
> > +        struct xen_dm_op_create_ioreq_server create_ioreq_server;
> > +        struct xen_dm_op_get_ioreq_server_info get_ioreq_server_info;
> > +        struct xen_dm_op_ioreq_server_range map_io_range_to_ioreq_server;
> > +        struct xen_dm_op_ioreq_server_range unmap_io_range_from_ioreq_server;
> > +        struct xen_dm_op_set_ioreq_server_state set_ioreq_server_state;
> > +        struct xen_dm_op_destroy_ioreq_server destroy_ioreq_server;
> > +        struct xen_dm_op_track_dirty_vram track_dirty_vram;
> > +        struct xen_dm_op_set_pci_intx_level set_pci_intx_level;
> > +        struct xen_dm_op_set_isa_irq_level set_isa_irq_level;
> > +        struct xen_dm_op_set_irq_level set_irq_level;
> > +        struct xen_dm_op_set_pci_link_route set_pci_link_route;
> > +        struct xen_dm_op_modified_memory modified_memory;
> > +        struct xen_dm_op_set_mem_type set_mem_type;
> > +        struct xen_dm_op_inject_event inject_event;
> > +        struct xen_dm_op_inject_msi inject_msi;
> > +        struct xen_dm_op_map_mem_type_to_ioreq_server map_mem_type_to_ioreq_server;
> > +        struct xen_dm_op_remote_shutdown remote_shutdown;
> > +        struct xen_dm_op_relocate_memory relocate_memory;
> > +        struct xen_dm_op_pin_memory_cacheattr pin_memory_cacheattr;
> > +        struct xen_dm_op_nr_vcpus nr_vcpus;
> > +    } u;
> > +};
> 
> Is sync-ing for the sake of sync-ing really useful? For example, are any
> of the ioreq server elements halfway likely to ever be used in the kernel?

The only field, out of the union, I am using for now is:

        struct xen_dm_op_set_irq_level set_irq_level;

I am not sure if some of the others are going to be used or not in the
future.

FWIW, I am also looking at solving a similar problem for Ioeventfds
(kick from guest to backend) and may end up using a few more of these.
But they can very well be contained in that patchset.

-- 
viresh


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 07:09:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 07:09:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569474.890266 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOCAo-0002J4-Tw; Tue, 25 Jul 2023 07:09:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569474.890266; Tue, 25 Jul 2023 07:09:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOCAo-0002Ix-R5; Tue, 25 Jul 2023 07:09:34 +0000
Received: by outflank-mailman (input) for mailman id 569474;
 Tue, 25 Jul 2023 07:09:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOCAn-0002HV-WE
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 07:09:34 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0600.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::600])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 346ab995-2aba-11ee-b23d-6b7b168915f2;
 Tue, 25 Jul 2023 09:09:33 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM0PR04MB6978.eurprd04.prod.outlook.com (2603:10a6:208:17d::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 07:09:30 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 07:09:30 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 346ab995-2aba-11ee-b23d-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=e74A7WlMK4qafJbbXTzAe2iWm/C3yo3RS647JdM4+1mGMYyRlWsgCdw1jcxLX9v4Dt/8H+Y0TKL7nynXzRNOMOlN8BiICCDp9oxt3bVhQnHWcdCD62ZgiccjCjL4sboEjvZ9K2O5RQpqRxsAPB1raz7COaNKP4D5SeXnsfHErcg0Z2dwskckn2zfa3r8fF+LmaT+sOw9rY8XvQsj6HBsSpmrx94JaG07JFYve3J1qVZ7YxHDDQ52zl5UXAGuedSpNRN7Lwtf31aqQ586QGlSOuymxtf+FQbPLBPQ7JLGISMqN35BAZmigRJuD/CWO8/DlA5/14SXFFdeeo6UGUj7yA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4LcsK9H3U5j/Fcjth15gu3w+D5a5BgpjUtmjawQXrog=;
 b=oAyL6IKAutQxtI8eIs0SYl4qwlP5oTMUPHfVT3Bke+LINJT8Zlfk2llGriYF+XPvDEWw6iLZrAipBzVWSwzIrO0g70dbTuDEk5tl+LeU7DeFRfBkSgfqPiUtHA4h79wtpvGMtLYU6h5LGTzcF1iz88Wjq3kk0ZNxHSj2ks7Mfv95uzYnl2Ub2V9VOrWCdC4A7uREVk3+TavJwm9tmHmrZGJa19bsJpMvlXD11BEjw7H5N+xrt6HXAQYmTCaBUoHsa1n957FnGsSjwBv3EHumPfVH8o24ixS+iUGb+XJQyjoPjQWzd5U9VzI0k/TV3PTPuStuaUHyvyHAqGUvoXBA3w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4LcsK9H3U5j/Fcjth15gu3w+D5a5BgpjUtmjawQXrog=;
 b=fxCXfyVflfQZ/aFp6SFppbe5nHwDQ398jqpT9MnA4lNmice9eFrxZaM2aXfD5kye9uwuzuKsTsHRVaCClRF62GlMA8lhQgU+NQHpS/Q/lwRRJr4tYJiuZchH0XLH1f8JlpgwcV2rDUTL631fKbFvjZQrkhEDbaxgFIVvsvn/0z4c5sMHF34RZtqEVteEizOwZ6cmnFryYL7Qw5ZKHK9zFYTBvmaWBrFlOCgGfm4gWcUDout1NkuU1HUpNjXZA08PaVxkj7tntKf4svsxgS6pjmrXygHjyAPC3emInRfYmMOUWuo4gMXx54mti4TIfaPVmpDH4bWRoOjnvH2r9eYLUw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <a81326f4-e018-b461-ebec-9ef2ff5dc4df@suse.com>
Date: Tue, 25 Jul 2023 09:09:28 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH 2/3] xen/arm: irq: address violations of MISRA C: 2012
 Rules 8.2 and 8.3
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>,
 Stefano Stabellini <sstabellini@kernel.org>
Cc: consulting@bugseng.com, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 xen-devel@lists.xenproject.org
References: <cover.1690217195.git.federico.serafini@bugseng.com>
 <a62e88a9c29cf7866c251968b5a5b6865aff4a2a.1690217195.git.federico.serafini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <a62e88a9c29cf7866c251968b5a5b6865aff4a2a.1690217195.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0143.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:95::6) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM0PR04MB6978:EE_
X-MS-Office365-Filtering-Correlation-Id: ba60886a-3926-4856-61a5-08db8cde1738
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	sfrKJuQuH2HVnoY5JO+lGywLlvapANQ8q0rg7fzC8bpMLpd5dn6jQSLYDlL2qDhvLsthpOPc38fHek8Upi1IepmsJpo8oUGC5k1f7xxsEeQ3a9gjjYYTuDHvUNhgCaaDJgoM+ibelial4n3gjcWCnLwPAedm+AwrJdRO/wzZlK3zKk5mRTB0dFAhDXBLe/uBbLyXNA41I/RGb4vnT3C/PH0iIZ7Xrk76VaXNUg5MXc0Cjgd93cmtJMl98vQf4oZzcuZRTNPXcpsf3guFmsyP511ar0qg96TYa0EpXevjrTqzg9SYARKQZP6yiSKeWqUDNxzBR3aLIw1ueu1rAJhWrsJ+lnPAAQ2HILHHZe7Azk2ixWRmlbi2wjBoLwbmk6mH2uXdMwIAd9iriRpGYxbSOndLaO8sQgzu8EL3OkJuQEhvQg7+TxnFA8Lwzp8LflRhtATlNviszcCnh5qewMXN8HpDbr7SLj86ov2Btq0OzO3Wuof0kah2EtO61wRMdwCL5S5HPpSDJ2UBnL/MombZXDwqC+lzi1chnB/NkjJgTRMCpGV52oRyRwr6dzTAw+dIaxwPo6FSH90/cny+1cgYkxa0GhGz+gsaXLWfpUr1gBjc2MjLT1iDxEbezQrWCsPqw4488HI3EPjsCmueFrh+bw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(39860400002)(396003)(346002)(136003)(376002)(451199021)(54906003)(66946007)(66556008)(66476007)(2616005)(36756003)(83380400001)(86362001)(31696002)(38100700002)(478600001)(110136005)(6486002)(6512007)(53546011)(26005)(186003)(6506007)(31686004)(41300700001)(5660300002)(316002)(2906002)(4744005)(4326008)(8676002)(8936002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Sisva0JNU0JQR0ZXN20vM0Z4TGx0QXdIbXd2L1VDcWxDQWUxdG1QaXd3emtI?=
 =?utf-8?B?bkU1WmNjSFM4Tm84M1YvVlNTL2x2QTE5ZHJqRVVTMnlJN2EweG9TaDJQNUJO?=
 =?utf-8?B?YlFwMzZ5K0Z3ZVVUMlJGSU9uYy9jUmlJSC9od3gwRDlBcS9lSlRIc1JpRVAw?=
 =?utf-8?B?K3NKdEs3M3YyMElsSUNTOSt6QU1mQUQwREVyaVJRUVczdm1IODVoL2ZUdW1l?=
 =?utf-8?B?cGZNM1hlWE54dmVvMk1KZmtaR2E3SWtQZGNSdU0zdktuYXpDM1N6bGNYUGdH?=
 =?utf-8?B?WURpSnFUWXprYVQ1czhxSE92YVVMMXU0N2pLaXVMRmdnWGZ4bnhob2diR3FY?=
 =?utf-8?B?RHlONnJWSEFWTjBuSFdSaXlaMjRIbUVVdnc2OFFyWWtrS0RudHBFZW1GS1Zm?=
 =?utf-8?B?b2FuenVZaTZoY2lMOVQ2SDFSVk9KUXE5Nk42Vy94ZmRta2NwSWsvaEhBak9V?=
 =?utf-8?B?UjkzTktsR2tXWmhzRmwra3BLS2N3UVJITlRlZ2NaK2cyZ3NhbGxuVjVLT2dQ?=
 =?utf-8?B?YzAzcVRIc3M1Y3FMcS9LMmVadWduWkQwRkdzMlkydmNNTWFUNUtsZzQxT05h?=
 =?utf-8?B?ay9ubUZ3WllqYlVNdy94U2k4NEk4L1pOVFhOVlBRaStPVlpDUDRxOXFNMW1R?=
 =?utf-8?B?UDFNYlIxbUIzR3Z5RFVIdjNTZzVhNzh5NVVOb2krTllkSVBKWGVvYkZ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c3RjU3UVYzQ1Q4elhCUXllak5CbERuaGEwUWh3SnllYTla?=
 =?utf-8?B?b2VjSlM0c0NKajY5eFRWdXZ2eWRHSkpFME5DWUtGV29td1VaZGViK1MrUTYz?=
 =?utf-8?B?eDlna1Z5QmZweERZb1hKSXd4bWsrYmIyVk1hc0hlNjNyaE00aUxqSFVRNE4z?=
 =?utf-8?B?K0FkUW9OT3ZJVGt1YVNmQTU2QzJ1alZyQUR4dzMxVjJIVS8wNHF0MnVqUEhK?=
 =?utf-8?B?N0x3ekxkMG9qQ1U3bEZqRW5mNWxOdGVDOWVELzFROUFwUUxBa2kxbzVoS1pa?=
 =?utf-8?B?REdLeCtvNXhVVDJrSGo3ZHVrSG9adU9HM3M5b1FiUWdubTNVU2dheTNLc1M5?=
 =?utf-8?B?WURYWk5BL2tKaHV5TEZ5UEtaSzAwNTl5QkZYVndiNGIxTGRoK0NVblQ1Nm1a?=
 =?utf-8?B?NytTeTRrRUFOcXowL0JaMlduSHNGVnFFQktLdXVrK2IzNkVGQ1ZhMVVlVSs1?=
 =?utf-8?B?eHdCc0I1WEk5aFhMNmU3N0tVSUFSZGxtc3ltMk5jb2VSak41Z2hqWkoxUEFS?=
 =?utf-8?Q?vH3HlD9KXGWdm724JoCfwzUao?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ba60886a-3926-4856-61a5-08db8cde1738
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 07:09:30.4871
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: LSpOHcxFlbGsjvVE4w/775wp92wXkiMRWas3L1vbYnyTWkGnkVE+jcS+fs/r/h/exMxaicQsiK/OR5gOhV+KYQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6978

On 24.07.2023 19:50, Federico Serafini wrote:
> @@ -182,7 +182,8 @@ void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask)
>  }
>  
>  int request_irq(unsigned int irq, unsigned int irqflags,
> -                void (*handler)(int, void *, struct cpu_user_regs *),
> +                void (*handler)(int irq, void *dev_id,
> +                                struct cpu_user_regs *regs),
>                  const char *devname, void *dev_id)
>  {

Before we accept patches, don't we need to first settle on whether to
apply the rule(s) also to function type declarations (and not just
ordinary prototypes)?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 07:13:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 07:13:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569477.890275 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOCEk-0003x5-DU; Tue, 25 Jul 2023 07:13:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569477.890275; Tue, 25 Jul 2023 07:13:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOCEk-0003wy-Ab; Tue, 25 Jul 2023 07:13:38 +0000
Received: by outflank-mailman (input) for mailman id 569477;
 Tue, 25 Jul 2023 07:13:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOCEj-0003ws-25
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 07:13:37 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on20624.outbound.protection.outlook.com
 [2a01:111:f400:fe13::624])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c5415381-2aba-11ee-b23d-6b7b168915f2;
 Tue, 25 Jul 2023 09:13:36 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB8138.eurprd04.prod.outlook.com (2603:10a6:10:25c::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Tue, 25 Jul
 2023 07:13:34 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 07:13:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c5415381-2aba-11ee-b23d-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=C0uzrNUglJzCCu4cBi2r3oeNoksPNmfxNJcUpUjhL3rlcmG1vKeMhAG1dQGaBwACLqG6K/K1e7Gfb567PfgsvYEl9mETiKuUqFVI0rLnNGmBtfPmHn1FGwlpJ1DdYgOv9VtAosQex23jneBaM8H/jRJbBCHpbb1KSUuPE8uMVmdZ8vtoDsLBotJ3cJ6rVniC2j+MeNrHXhMnETScRKC8eFKsBSqjZfW9OaOTTY/wIbJnh7+VMbAzWPJVhXnus/0r6laHVIxwamMbcghVaSJko0Pen58FHdiZbSmDuwm3u9Otk1i+Nv7xJvp/nanYj+O2GCW0g1CqkBHvaGhle+p79Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3n4JaB/SB3ZqFC5yerfJWn8FgMLSUAYKEJdFfj6eUuc=;
 b=O+IQQQMPm1G8b9qboJHbzZC0J363K0nz8PY8TPUoM1jNIAaiW24e2YsTUWrAM8CQd4wBgu7xXmJhenaNcINTBFZ4cVFDRTXB+Hw19NpC2/ydmpv3LEgJJDrfv+6T5H1OC+fXLQVBgnPbddab4fhDUHk5zaAP3zaInYW16MWeT9X9ER2CYPAwMZiqhjuPBlVHDeeymwTCn3LrYm7xAbawWijYCuXhDqLkeHZCc82VPbNspIUixGa8WdtYfIk5W7wW4HU7S2/n/mwJGjndoMOo0WRW6POQc4Osi0iAAk8HMwJNuIIecwxoPtlonIGpPZ+73Mm+66AWAApMvxXBOwBx5w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3n4JaB/SB3ZqFC5yerfJWn8FgMLSUAYKEJdFfj6eUuc=;
 b=e5nGmmrtmEKFjhRpn6/Uc3hhIv+SxWHhiDTyaugjr6ScNb0ewbiOwPgm1LlfQ3dZsktROuhhUGhaBxjHn6cTrQT+++nsk5WHE4cJQpYiPa0DJ4fBx4jLmz1CLYvglqbe7tWnadOovCz0V+K1k/1wVozSOW0XGF0mbbpUXGZAk0FvxjfPBmUoal5SUCPjcet+iZpaWc4MRKqGPJm1Dp8UQszDXzBW/FjfVL6GX7wD9joF+K4HtUKptOuXfx+7IgsK1ymt+1HfkYxkbIJ0WROQykXrDpZf/RwWOgF/PY39I4FISko06A+QxIaJswH7hN//gSdeGu1r76rq+oylSlQjSg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <eecc7968-970a-9eb9-050b-843d2496f8d3@suse.com>
Date: Tue, 25 Jul 2023 09:13:32 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH 3/3] x86/irq: address violations of MISRA C:2012 Rules
 8.2 and 8.3
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>,
 Federico Serafini <federico.serafini@bugseng.com>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu <wl@xen.org>
References: <cover.1690217195.git.federico.serafini@bugseng.com>
 <ae48788c6c41e5e506b9995037d176ac8b08d3f2.1690217195.git.federico.serafini@bugseng.com>
 <alpine.DEB.2.22.394.2307241558350.3118466@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307241558350.3118466@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0138.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:96::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB8138:EE_
X-MS-Office365-Filtering-Correlation-Id: 98b4757c-67c2-43dd-c0a4-08db8cdea892
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Z/VwQoZPtF2RqCfNbGTC9UsEtgh/lZFG3cBDXE3bgci92zFxruqu0vDpPZxbFcnWxdSVdolFY5KhgT55r0FGZ0VKxa6QauNhv1geOOpVCgzT+JUbHbTTHyYzxW7AxEhxjoM9hVEaCfph8aacCX6I7FprJI/kXN7chJeIrywj81NAjjn654WP+4aXeomHCRIGZRQgLLpXc6apCUsLw11TvDJ8xorvg0NJX8rZNXzKvysqhb/jdyrTeUGUy9rK9hlK3kxMOUlEh7Tl0S8VmRbnwVNmljyLKE5oRRB8iGG0QLyDDcdB6P5DJCaSSnvXNyGpGuP8mOga7uVFhKT6WFcNnAVrkQ4g4+M59ap6tZQTkyjPC3ceyKp5aWaEX7fkatVBTQgntxo99f1fcKYyQaM6NVfxYn3nfvavQlnP1A/8ZoiS4hLtgSz1WQ4+ucKeCYKVuC+R46FMQ+gcN063sbjE+DtvVGh5ogs2hxfMXuePFGiVumZ0i2dN6Pyo/MthE1p+ytkrpfCXOr3HqgDi1QQ+n+SoQiGP0S+v8CyRLqi5VYyy8eJ5DAw43plewnHPBeLjq6G1eztXmioetbyOJ23JxFYp+PTvHkwE1UTW33fvJND84zy7OVEXnI2CxAY/fhoUB2W/iyI6faRU49pJlY0sdg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(366004)(396003)(136003)(39860400002)(451199021)(38100700002)(66899021)(53546011)(2616005)(36756003)(8936002)(8676002)(5660300002)(54906003)(110136005)(478600001)(66556008)(4326008)(316002)(66946007)(66476007)(41300700001)(6506007)(26005)(186003)(6512007)(6486002)(4744005)(2906002)(31696002)(31686004)(86362001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eDdCM1RmM1ZnRDRDS1AwSEZ6QWhQa2V6eHZpYllSUzNwUFZ5RFpkT1BrNi8w?=
 =?utf-8?B?SkVBT1daK2x6TlVScXBFdnpPYkZ1RkF0dVp3cjRjYzJaRFArOHd5am1VU2Mv?=
 =?utf-8?B?QTRXSnBGQ0Q0NzN4QVVBOGltcGcwRmt1YjZvUmxIUEtIbmxjUDg4dWRWQmlR?=
 =?utf-8?B?ZlFUaXNvZ3BDaE83bFZzbnlMQVhSdEV5OGVOUFZsczJYZEltYTBKQ0JENUlo?=
 =?utf-8?B?ZGR1aGt1WkRtbmM1aEdPVW1jdE15S3c2dE02RjRydU53Syt1cUdJNEtyUXNQ?=
 =?utf-8?B?TTFjc0VwVTNoUkZYRENFTnJxdkpSWmxLTjl0bThRcTYvNzRmc0Myd1hTWmFM?=
 =?utf-8?B?YjBZNlhncUZMZnJBL3QwbEhlclpvN0IxQ3VxcVR1eWtEbEhZUVlWekxtanNs?=
 =?utf-8?B?RSttNXUzUlVEeGJ2a3c5S2pOK0NMQ2tWRktydUc5K3kyZDBJeVZVK2x3ZCs0?=
 =?utf-8?B?RHZKaisybHk2S2hMcTFoK3JPWjNoMjRuZ2xITlZjaVVZVHBibmJaRGdPUEE4?=
 =?utf-8?B?aGJEcmlXZlgwUEJLQ0hPZFNMWFZCbG5GT1JMTXp4QXZsYmhPY1NKalZTVjNL?=
 =?utf-8?B?S3BaRVhtNGpOSFU4V1VVa1JDaEFrQXZaamUzTXFyTkx3MnpFVlVnSm56T3pz?=
 =?utf-8?B?WlArUUkvcHY5Lytq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TazZ6UGRpRGQxamNj?=
 =?utf-8?B?T1VzTU8xTml6cmh6MW0vQlJzSzIyL1YweWd4d2tCaEhTMm96c1lVeTRHZ3pQ?=
 =?utf-8?B?V21MQVd6Zjkwb2M1RSt5YXQrdEo3MFJaTzZ4SStYNFFxMk43c3ZWeFgxRVN2?=
 =?utf-8?B?R0pwR1E2cFpFN3BMcm5zZ0wxNG9vc0NFTGpGSW9YcTRQZUgramN4YmtUeERj?=
 =?utf-8?B?RzM0L1Vtckx5dVZTZFpWQi8zWDJWZ00vc0haOFcvSFhPYWpTR3pHdWJvb3Bo?=
 =?utf-8?B?N2lUZEdTNWNtZGxCcVhSMGJLc0lQeWczL1BmZzZhZncrWjc4b25pNHkwellS?=
 =?utf-8?B?emJpSjhJdldWQmFYVm9UZXNER1E5MGUzUTdnNDNRVTJkY1lTNGNFa3h3SHZr?=
 =?utf-8?B?ZXdBT25VK1VXOFgzcWNsUlJVNGc1VHZCNG90bG5IWTR1aENnNTFKL2ZkSnpD?=
 =?utf-8?B?aHB4NUlvZTFmQTBTTFYvZ3F6MVA2b3J3Vml0K0hLMmdtZnBuT1RJL2NtWUt0?=
 =?utf-8?B?My9vTkM1OTV5dFA5VGdwZUVXNWRrMDA1K0svVENPcVdQYUhseVJQenB3Q3pJ?=
 =?utf-8?Q?sDXGOiwlHw9HjTwwtUXiWKQKz?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 98b4757c-67c2-43dd-c0a4-08db8cdea892
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 07:13:34.2884
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ZoNTX+XFGCOBhDvoPA6n6aR0htxHKETbf2hBDFWquYEX9ZXahB0RakFN3WY0GMsbAJQRE4SGyebkFuaL7Zrvrg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8138

On 25.07.2023 01:08, Stefano Stabellini wrote:
> On Mon, 24 Jul 2023, Federico Serafini wrote:
>> @@ -893,10 +893,10 @@ void irq_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
>>      desc->status |= IRQ_MOVE_PENDING;
>>  }
>>  
>> -void pirq_set_affinity(struct domain *d, int pirq, const cpumask_t *mask)
>> +void pirq_set_affinity(struct domain *d, int irq, const cpumask_t *mask)
> 
> I welcome feedback from the other maintainers on this but I would keep
> the original "pirq" parameter name here...

+2

We absolutely should not further increase the misnaming. Instead the goal
needs to be to uniformly use pirq when pIRQ (used in interfacing with
guests) is meant, and irq when a (Xen internal) IRQ is meant. Sadly this
isn't helped by Arm not knowing the concept of pIRQ (see "[PATCH v2 0/2]
new CONFIG_HAS_PIRQ and extra_guest_irqs adjustment").

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 07:18:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 07:18:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569482.890285 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOCJA-0004d5-3k; Tue, 25 Jul 2023 07:18:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569482.890285; Tue, 25 Jul 2023 07:18:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOCJA-0004cy-0o; Tue, 25 Jul 2023 07:18:12 +0000
Received: by outflank-mailman (input) for mailman id 569482;
 Tue, 25 Jul 2023 07:18:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOCJ9-0004cs-8m
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 07:18:11 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on061a.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::61a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 68b70a20-2abb-11ee-b23d-6b7b168915f2;
 Tue, 25 Jul 2023 09:18:10 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU2PR04MB8791.eurprd04.prod.outlook.com (2603:10a6:10:2e2::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 07:18:08 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 07:18:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 68b70a20-2abb-11ee-b23d-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=FYpZ1omjT7q2tA+UB7+wbhAh+ypxd1cgWzxRVVJ4vSiXDIpQTgo0nIE2GAK61wwkV5CabkMN6g66XmeTmF83XPAvy/ClDKOt4PjC5ORQjcnl0JwojJdNZM2Mfi5Ep72G4V21yIyT7GbNGa0UYBJC+h234gZDx8TuCCn3W+ldbgpkuyHj4m+N5PQ5bilLluCPL8N9eQcTdjBU/nwMeqKVDy+DqanCbb5LBwXo/De0MpKTq6Vkq/1IEOon3HJ+S0P/WPk40LJ4yJQW61wp88eva0YtOLVHMzm73TLk6+cmQG1WFdvSmpQD2aMv0Q3Rccc2YtrNw6Up2GCKDrZ/2bDixw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=lfkmAbvaGhDvplXe8kl8ESjTuPx4xFgu5vAhX9Q5f/o=;
 b=VBpTy7NuMcLRyEuqGj6p9bVFE+pUnPr/iziQBfAh+LAM3cNnBJIfIVU+YC11NuchSeBUXIaf0EIORAeSXYgF1hs8crm3jEg09QtXs19P4Aqy+YfsvkSDcS0FECljriIAfnYqLLxoH6gQNVzYC/HAWfL0wAZbiyQXN5ImbbfXRyTzdpc7NYXZ5dFTOeqhMdPkuucdMunRurMN1zogQxU6YY2Yzm0FB33KezC7JzhZB7wuI6HFw6rDuQi4Aq+QV1pdtfBKaZQIgNnNb+uRRTfeC8M3nP5Tt51PmjNtpqgy7J8Rb+1q4dgxOcz9RqH7TkO4yzdxepH94PEdo5vNkME9sA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=lfkmAbvaGhDvplXe8kl8ESjTuPx4xFgu5vAhX9Q5f/o=;
 b=UGnZig7PqqgWfJCu2CuFnhayz7qMuouLoZ1UEOCM9lVQOFB3ugxCmnaRHOShzWJppEZxm0HN6ySg01GkBidYbBShWNbhuQcrex/zAifMeTQ6RHLuCv0JSa/patfZzma/ssetgA1e+z4zUjYbWj2Mn54qDSu+090vlstpeqGT0JZXGtH2TKxy1pnhjEFJnF6LAFfa+COg234N5MfDL1PDduufbBJ/MxkNn6uSbTkPkX+DlKcrJzrxGBT46Z5rnTnyWxwrVej/rVL+cp710ItzRtRDRL5RBKWhvJ094XeQk592JFq2QPk5MImbiVmZS65FKt/G09Kc5b9EZhqClZXXLw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3770f13f-0621-48af-4c79-880a0ffaa8a6@suse.com>
Date: Tue, 25 Jul 2023 09:18:05 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH V3 1/2] xen: Update dm_op.h from Xen public header
Content-Language: en-US
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
 =?UTF-8?Q?Alex_Benn=c3=a9e?= <alex.bennee@linaro.org>,
 stratos-dev@op-lists.linaro.org, Erik Schilling <erik.schilling@linaro.org>,
 Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
 Mathieu Poirier <mathieu.poirier@linaro.org>,
 xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
 Juergen Gross <jgross@suse.com>, Stefano Stabellini
 <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
References: <ffae9d7021829fea19fd93fda3c30b52b0af923e.1690190453.git.viresh.kumar@linaro.org>
 <1498bef6-ded0-1b1f-a5ca-e8755800b489@suse.com>
 <20230725070914.m3dxlokedrgjlgcu@vireshk-i7>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230725070914.m3dxlokedrgjlgcu@vireshk-i7>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0075.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9a::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU2PR04MB8791:EE_
X-MS-Office365-Filtering-Correlation-Id: d9ae417d-a3dd-4223-9432-08db8cdf4b8d
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	CArRG2W1Nc/aiNCg9S0murR+9buaMNPkWAfcxzSQKKGNEAlV/pxOIM4v2kOlGbzp73NOJMNSZ/GXEkOtxcjn/zNWJrPgZ8fB3dozZkOEorMpQGp769jckr/+WLxKJ22iO7McCGWUwfjQiNZMa+q6mcQBcySxDSIr8SOWnksG0FDs+FZWCCs3c92YY4h/TY4avdJn/wkluWzVbRb3WcziltMCmAaVyRw+hN3b1WKXbLdrmpedHC0mF5js1xggWO+IF92cYdpJh4+Qu1zwJ1qtRcQ/pKyElMqQbS0LtDaRF3vNtedFyshAmIwRIRMFnI2ZDq42gO9lOshrUvn+X5I2lXK7Us3gMP2OodrHR06M/Xg+KgoX4vSaE3hFZWGK24IimtB5SiyLXR2OttrMFGKbPWKz/VHm6sw9/5KCy+t3CZkj4Kb6qS8MDdCWGgIWEJZaeTWxKJEAFsas7cqOF7NwtvJ8cp8g7annP6a1rR8lBkvKM2WB+cbxNuvitcLDGNMqeUqKZkl5H9oaMFHU3i3Uj1DHljoOppIJh/EyMbn+zjfwGZLyiUqSHFHLjDPQned7ZNghIg+U5QW+Ti9DDqrdOnN4Bnu/Jj1TTXg33w5LdhUoX5qRcEQy/2YiSvnmLgH5k62tMaT2ChfpTuNWWcK1UA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(136003)(366004)(376002)(39860400002)(451199021)(54906003)(478600001)(6486002)(6512007)(186003)(26005)(6506007)(53546011)(31686004)(2616005)(6916009)(4326008)(66476007)(66556008)(66946007)(38100700002)(7416002)(5660300002)(8936002)(8676002)(316002)(41300700001)(2906002)(86362001)(31696002)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UVI0YXJRTHorTVhGL3pMbytRbE9QOHNVaU5HV3pCZWNHODI3TFZFdUdwQ3Nk?=
 =?utf-8?B?YkdvM0hWbkZtd25lTlRkb1pLbE9Od3FkNzlwVVVaNmo0QUlYdStXYmViZXZt?=
 =?utf-8?B?aHoxQmdPYVQzZmJuRkdwY0dMNjNwN3IwcVNOTG0zQU0wTWJ2eGJKMzFscnBV?=
 =?utf-8?B?K3hsb1FhdVpQS1FQN3k3NVZ3K0VCeFVVQjM3STBtaUY4bk9ETVpZVklnUWZR?=
 =?utf-8?B?c1BDL0t3QW15VE13U2tCczRmK0ZnSzQ3OFpNc1BYemQyK2hCZHdUNHg5Wnlu?=
 =?utf-8?B?RE50ekVLZG1NMEpvcEwyNFJBUndCUVV0TTNtSzZLdW03bDY4elQwSHBlWUpq?=
 =?utf-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HBTMmRDUldDalBZSXE2?=
 =?utf-8?Q?c0JHU9pvzCLztsofPvDGHoobq?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d9ae417d-a3dd-4223-9432-08db8cdf4b8d
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 07:18:07.7375
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: xo79Dc1IE5uq52cmMGFbEh8vYrAZFdXGnWbZwUc/MAy+dtJEeBTuRwKJ0mv5J5DPj121EOcuYPu7NrDefjatBQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8791

On 25.07.2023 09:09, Viresh Kumar wrote:
> On 25-07-23, 09:04, Jan Beulich wrote:
>> On 25.07.2023 08:47, Viresh Kumar wrote:
>>> +struct xen_dm_op {
>>> +    uint32_t op;
>>> +    uint32_t pad;
>>> +    union {
>>> +        struct xen_dm_op_create_ioreq_server create_ioreq_server;
>>> +        struct xen_dm_op_get_ioreq_server_info get_ioreq_server_info;
>>> +        struct xen_dm_op_ioreq_server_range map_io_range_to_ioreq_server;
>>> +        struct xen_dm_op_ioreq_server_range unmap_io_range_from_ioreq_server;
>>> +        struct xen_dm_op_set_ioreq_server_state set_ioreq_server_state;
>>> +        struct xen_dm_op_destroy_ioreq_server destroy_ioreq_server;
>>> +        struct xen_dm_op_track_dirty_vram track_dirty_vram;
>>> +        struct xen_dm_op_set_pci_intx_level set_pci_intx_level;
>>> +        struct xen_dm_op_set_isa_irq_level set_isa_irq_level;
>>> +        struct xen_dm_op_set_irq_level set_irq_level;
>>> +        struct xen_dm_op_set_pci_link_route set_pci_link_route;
>>> +        struct xen_dm_op_modified_memory modified_memory;
>>> +        struct xen_dm_op_set_mem_type set_mem_type;
>>> +        struct xen_dm_op_inject_event inject_event;
>>> +        struct xen_dm_op_inject_msi inject_msi;
>>> +        struct xen_dm_op_map_mem_type_to_ioreq_server map_mem_type_to_ioreq_server;
>>> +        struct xen_dm_op_remote_shutdown remote_shutdown;
>>> +        struct xen_dm_op_relocate_memory relocate_memory;
>>> +        struct xen_dm_op_pin_memory_cacheattr pin_memory_cacheattr;
>>> +        struct xen_dm_op_nr_vcpus nr_vcpus;
>>> +    } u;
>>> +};
>>
>> Is sync-ing for the sake of sync-ing really useful? For example, are any
>> of the ioreq server elements halfway likely to ever be used in the kernel?
> 
> The only field, out of the union, I am using for now is:
> 
>         struct xen_dm_op_set_irq_level set_irq_level;
> 
> I am not sure if some of the others are going to be used or not in the
> future.

I question that use, btw, but it is not up to me to decide whether to
accept such a layering violation in Linux. dm-op is, as its name says,
for device models to use. Your intended use doesn't fall in that
category, aiui. Imo the present contents of dm_op.h in Linux is indeed
all a kernel is supposed to know about, unless it was to gain in-kernel
device models.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 07:29:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 07:29:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569484.890295 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOCTg-0006Ad-2E; Tue, 25 Jul 2023 07:29:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569484.890295; Tue, 25 Jul 2023 07:29:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOCTf-0006AW-Vg; Tue, 25 Jul 2023 07:29:03 +0000
Received: by outflank-mailman (input) for mailman id 569484;
 Tue, 25 Jul 2023 07:29:02 +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
 <SRS0=1Iib=DL=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qOCTe-0006AP-NZ
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 07:29:02 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ec2efe32-2abc-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 09:29:00 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.161.75.91])
 by support.bugseng.com (Postfix) with ESMTPSA id 65A584EE0739;
 Tue, 25 Jul 2023 09:28:58 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ec2efe32-2abc-11ee-8613-37d641c3527e
Message-ID: <bb145f45-934f-b2ae-5aa0-94dc86703287@bugseng.com>
Date: Tue, 25 Jul 2023 09:28:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] xen/sched: mechanical renaming to address MISRA
 C:2012 Rule 5.3
To: Jan Beulich <jbeulich@suse.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 George Dunlap <george.dunlap@citrix.com>, Dario Faggioli
 <dfaggioli@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <9945fd23b0bb88f3e0c6054a7f992cfa642d3f9f.1689953420.git.nicola.vetrini@bugseng.com>
 <c08f1df7-e314-f3fb-b5ac-7aa5e4c546a9@suse.com>
Content-Language: en-US
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <c08f1df7-e314-f3fb-b5ac-7aa5e4c546a9@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 24/07/23 10:26, Jan Beulich wrote:
> On 21.07.2023 17:31, Nicola Vetrini wrote:
>> Rule 5.3 has the following headline:
>> "An identifier declared in an inner scope shall not hide an
>> identifier declared in an outer scope"
>>
>> The renaming s/sched_id/scheduler_id of the function defined in
>> 'xen/common/sched/core.c' prevents any hiding of that function
>> by the many instances of omonymous function parameters.
>>
>> Similarly, the renames
>> - s/ops/operations
>> - s/do_softirq/exec_softirq
>> - s/loop/it
>> are introduced for parameter names, to avoid any conflict
>> with the homonymous variable or function defined in an enclosing
>> scope.
>>
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>> ---
>>   xen/common/sched/core.c    | 18 +++++++++---------
>>   xen/common/sched/credit2.c |  4 ++--
>>   xen/common/sysctl.c        |  2 +-
>>   xen/include/xen/sched.h    |  2 +-
>>   4 files changed, 13 insertions(+), 13 deletions(-)
>>
>> diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
>> index 022f548652..e74b1208bd 100644
>> --- a/xen/common/sched/core.c
>> +++ b/xen/common/sched/core.c
>> @@ -99,13 +99,13 @@ static void sched_set_affinity(
>>       struct sched_unit *unit, const cpumask_t *hard, const cpumask_t *soft);
>>   
>>   static struct sched_resource *cf_check
>> -sched_idle_res_pick(const struct scheduler *ops, const struct sched_unit *unit)
>> +sched_idle_res_pick(const struct scheduler *operations, const struct sched_unit *unit)
>>   {
>>       return unit->res;
>>   }
>>   
>>   static void *cf_check
>> -sched_idle_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
>> +sched_idle_alloc_udata(const struct scheduler *operations, struct sched_unit *unit,
>>                          void *dd)
>>   {
>>       /* Any non-NULL pointer is fine here. */
>> @@ -113,12 +113,12 @@ sched_idle_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
>>   }
>>   
>>   static void cf_check
>> -sched_idle_free_udata(const struct scheduler *ops, void *priv)
>> +sched_idle_free_udata(const struct scheduler *operations, void *priv)
>>   {
>>   }
>>   
>>   static void cf_check sched_idle_schedule(
>> -    const struct scheduler *ops, struct sched_unit *unit, s_time_t now,
>> +    const struct scheduler *operations, struct sched_unit *unit, s_time_t now,
>>       bool tasklet_work_scheduled)
>>   {
>>       const unsigned int cpu = smp_processor_id();
> 
> These renames bring the idle scheduler out of sync with all others. I
> think it wants considering to rename the file scope variable instead.
> 

That's ok, since the variable is static.

>> @@ -2579,7 +2579,7 @@ static void cf_check sched_slave(void)
>>       struct sched_unit    *prev = vprev->sched_unit, *next;
>>       s_time_t              now;
>>       spinlock_t           *lock;
>> -    bool                  do_softirq = false;
>> +    bool                  exec_softirq = false;
> 
> As an alternative to Stefano's suggestion, maybe consider "need_softirq"?
> 

I like it, especially since it's a local variable.

>> --- a/xen/common/sched/credit2.c
>> +++ b/xen/common/sched/credit2.c
>> @@ -3884,7 +3884,7 @@ csched2_dump(const struct scheduler *ops)
>>       list_for_each_entry ( rqd, &prv->rql, rql )
>>       {
>>           struct list_head *iter, *runq = &rqd->runq;
>> -        int loop = 0;
>> +        int it = 0;
> 
> Instead of renaming, why can't we just drop this second variable, re-using
> the outer scope one here (and at the same time doing away with a not really
> appropriate use of plain "int")? (This may then want accompanying by ...
> 
>> @@ -3901,7 +3901,7 @@ csched2_dump(const struct scheduler *ops)
>>   
>>               if ( svc )
>>               {
>> -                printk("\t%3d: ", loop++);
>> +                printk("\t%3d: ", it++);
> 
> ... switching to %3u here.)
> 

Good point.

I'll submit a v2 shortly with these changes.

Regards,

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 07:42:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 07:42:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569490.890306 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOCgc-0000D3-6M; Tue, 25 Jul 2023 07:42:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569490.890306; Tue, 25 Jul 2023 07:42:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOCgc-0000Cw-2D; Tue, 25 Jul 2023 07:42:26 +0000
Received: by outflank-mailman (input) for mailman id 569490;
 Tue, 25 Jul 2023 07:42:25 +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
 <SRS0=QXT9=DL=linaro.org=viresh.kumar@srs-se1.protection.inumbo.net>)
 id 1qOCga-0000Cq-Uw
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 07:42:25 +0000
Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com
 [2607:f8b0:4864:20::62d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c6c36b04-2abe-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 09:42:17 +0200 (CEST)
Received: by mail-pl1-x62d.google.com with SMTP id
 d9443c01a7336-1b8ad8383faso39858095ad.0
 for <xen-devel@lists.xenproject.org>; Tue, 25 Jul 2023 00:42:22 -0700 (PDT)
Received: from localhost ([122.172.87.195]) by smtp.gmail.com with ESMTPSA id
 l20-20020a170903005400b001b8a85489a3sm10254527pla.262.2023.07.25.00.42.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 25 Jul 2023 00:42:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c6c36b04-2abe-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690270941; x=1690875741;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=kewmDoSwKZcyBAfVPaIo9+Biv1FObKhjKX+FUtEeF3k=;
        b=PA+fK6qXbHqYwEPVsLMv/2Ju1Mxrp9vScm/JmrJ7HPHfkOnZsCfnzfbxllwJPkxjV1
         Hk+IVr0kEUHskUZVuUq0VBT5mNuJxc96HduKH0ezuRL7do8qgxgB5SJUIfF82pObwC+h
         DXogbpdgn4C88+PsK3UNW0ZRNiXMoH9yh1/8x+wkMS5HtFRThUCrNALaEnu6+1tC3zjg
         oljAojsu5/XpZUccb55Q7m1LgEJwQk8oQLqFk4Gtsd0p8otmccReDMDX0k/dXvdfJYN+
         1LRWKACoE9ytjmLGfZfsjzn8+flAvCFYSQ/A1/Xt8FrfiBLsq+M0dwuZn/P5E3gUNYnN
         GI+Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690270941; x=1690875741;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=kewmDoSwKZcyBAfVPaIo9+Biv1FObKhjKX+FUtEeF3k=;
        b=LJJhh8yc7HGeLql0kdqrQd9Cb4muObHHDn5ihhAg5dgXFtdCQTUUev1ehTixn4uOqK
         yE8FWAHibu8tx7wDvBIAOaBGZj4gbSegI3uwBPIQHn4MO1rF3D6USJAhsIiqMSyHaa7b
         VamQsceiUMe/QMqrlqs6mFkloREFt1b3Mp8kLJoJludZGu9Wat5yoL1O3OXnE5xF/JRp
         2SLyBQbBja5heQBGimQkA8VW74LEkF+RdreU2bkupYqqvirx/8SUYWmbNkfy1Fd0UrjE
         wlwX9mecTLA5yBzM0lYS16081NAzEVfgEnU/O2KR3xAT7wwXOdEXs7Z2yOnT2Rq2lr2V
         EIdg==
X-Gm-Message-State: ABy/qLbex5FyhFa6vZetdIfZfgF/cg3ulyUyR7GrfWE8Aimh03ArCTby
	OZtnaAKatytcVuaHreD+pgjHUA==
X-Google-Smtp-Source: APBJJlHHSoNX8d5INhseTullEgrqBEXbHGAfAD9IQElyfVzOxJEv7mdJAxFRTer6Win8HqYFlgHQew==
X-Received: by 2002:a17:903:2341:b0:1b8:a31b:ac85 with SMTP id c1-20020a170903234100b001b8a31bac85mr15445663plh.41.1690270941395;
        Tue, 25 Jul 2023 00:42:21 -0700 (PDT)
Date: Tue, 25 Jul 2023 13:12:18 +0530
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
	Alex =?utf-8?Q?Benn=C3=A9e?= <alex.bennee@linaro.org>,
	stratos-dev@op-lists.linaro.org,
	Erik Schilling <erik.schilling@linaro.org>,
	Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Subject: Re: [PATCH V3 1/2] xen: Update dm_op.h from Xen public header
Message-ID: <20230725074218.zcgbkkx5pfgszimu@vireshk-i7>
References: <ffae9d7021829fea19fd93fda3c30b52b0af923e.1690190453.git.viresh.kumar@linaro.org>
 <1498bef6-ded0-1b1f-a5ca-e8755800b489@suse.com>
 <20230725070914.m3dxlokedrgjlgcu@vireshk-i7>
 <3770f13f-0621-48af-4c79-880a0ffaa8a6@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <3770f13f-0621-48af-4c79-880a0ffaa8a6@suse.com>

On 25-07-23, 09:18, Jan Beulich wrote:
> I question that use, btw, but it is not up to me to decide whether to
> accept such a layering violation in Linux. dm-op is, as its name says,
> for device models to use. Your intended use doesn't fall in that
> category, aiui. Imo the present contents of dm_op.h in Linux is indeed
> all a kernel is supposed to know about, unless it was to gain in-kernel
> device models.

Is there any other way by which an interrupt can be raised for the
guest VM ? I was only aware of this method and so implemented it like
this.

I am open to suggestions on this.

-- 
viresh


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 07:50:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 07:50:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569494.890315 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOCnw-0000zm-Tm; Tue, 25 Jul 2023 07:50:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569494.890315; Tue, 25 Jul 2023 07:50:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOCnw-0000zf-Qo; Tue, 25 Jul 2023 07:50:00 +0000
Received: by outflank-mailman (input) for mailman id 569494;
 Tue, 25 Jul 2023 07:49:58 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOCnu-0000y0-Fp
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 07:49:58 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20622.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::622])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d91fa4a8-2abf-11ee-b23d-6b7b168915f2;
 Tue, 25 Jul 2023 09:49:57 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS5PR04MB9942.eurprd04.prod.outlook.com (2603:10a6:20b:67e::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 07:49:53 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 07:49:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d91fa4a8-2abf-11ee-b23d-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=U6nwFXTYzhMNzMK3ma1RLmzC04E+/o2rz5wWzWi5ApQ1TErhpn6bCmg5cwSUIIrGpwoziUEslZvp3ph/V5dNmHO/UbhE6iJ+JM93rEGeErR6C3JJks1meLLl85UniWE3oCJcwgxCDO3nsVbBD+M/hnJEXiFbbdp0cvw+634WGMmMZrm3g6MbEhWsHFMLDyOKKFFmZifG/GMMF3BUWZ7PS0gVJ9rqbLKkdM7nfhPtX1V/HHorBGiikjdQvoMNKfGqEuaTHk7pjU3UWlaGXKkPCXFpvYasi54+GaibhCErUns8OQ1moqfcbhbtn+nRW9jNxwvuez6JT+sxrdEIQgp+4Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=dnV2Wz9VIuWc6O3b1FpCA0oPWzq8AyxfKwpDVwjvO08=;
 b=CPYKuu34QIteLKvGDNuZ5mZbiL6IILt1A1H8US+3kZwjBz20xdRCVoS0YBM/SQCI4uuxx0cj+ioHmONoLS3ophK3/3ixC2RE9i15RvSBe9roLsbXR/RvF9j02i5hIw0rjhpGbDdSVqOY/Duhk5p/cGzpt3rlbvn+WcyN7nVGVb2Pcs9L3MC59x/OBciTorxhvvlA9ym89NcRLXuy4HZS6EnShyrEsn1tCEdv/ZBVsZ2ErpEWc6sL/JBFlWvwJlckA29PsNuL6yIqrq3VsxtStWUvKzLdQihSyHG6+WL1Qz84Dv4bq6fJuy/phOigxbwJDYhsKPfJGIDInCseLftZzQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=dnV2Wz9VIuWc6O3b1FpCA0oPWzq8AyxfKwpDVwjvO08=;
 b=i5h3KsnPQgHR04TDXXWr2NPWj87Pbyo9XMX0s7arlaTDDVTeeeGTwj7z6fHwiyl7gX7IcQlUDt8KUhFNVYCX/IoEkPv7dYOETEkOm/j1SOkQ3WJRE1kT5fckiA9JEnyF1zbr1ASsW/43jPYaSzg7N5m4bAe/Ufi9n365xXDEKLIxC9llEOx2lBGBigTEXnWk1rAJ/1AhDs8I2vUFiHu7eo6YMD8PVJMNG/6SG8gXVHmy84s4mvpvBYLxB04UBdp6VYOqsDegXFbk0oV6oC9dCny8aNXAn7tSRDox9Jfn/GsnQxDaT/vWhLOP60n1k61GPG99EU2JKdyqKZGcWjiiqw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <920ede72-c2fb-c814-7b1c-aa488e400f83@suse.com>
Date: Tue, 25 Jul 2023 09:49:51 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH V3 1/2] xen: Update dm_op.h from Xen public header
Content-Language: en-US
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
 =?UTF-8?Q?Alex_Benn=c3=a9e?= <alex.bennee@linaro.org>,
 stratos-dev@op-lists.linaro.org, Erik Schilling <erik.schilling@linaro.org>,
 Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
 Mathieu Poirier <mathieu.poirier@linaro.org>,
 xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
 Juergen Gross <jgross@suse.com>, Stefano Stabellini
 <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
References: <ffae9d7021829fea19fd93fda3c30b52b0af923e.1690190453.git.viresh.kumar@linaro.org>
 <1498bef6-ded0-1b1f-a5ca-e8755800b489@suse.com>
 <20230725070914.m3dxlokedrgjlgcu@vireshk-i7>
 <3770f13f-0621-48af-4c79-880a0ffaa8a6@suse.com>
 <20230725074218.zcgbkkx5pfgszimu@vireshk-i7>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230725074218.zcgbkkx5pfgszimu@vireshk-i7>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0065.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:93::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS5PR04MB9942:EE_
X-MS-Office365-Filtering-Correlation-Id: 6f9911ab-333b-4380-3d6f-08db8ce3bb94
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	zve+le0WNiHuJSnhrzEJN+6PLckPQ7h75e/Uvk2jSn+bb9c9Ig8omN/OxYzGE3pJnxnPUYUjWLEzk4PTzLG9kJ2ca2ZpI1mJ1aQUdIXPNEPWnbSkPGQGl00MrDgH6UcXRoDb8n8c5OT5BBmMiU43ZitqBfHjmbOTYYZlVnsorPevHduuDMOd/0gSumLT7E/BlP5o4c0khER8Hj8kBTdkqSIQAbCZNr8G0by7Lb2xqtuFDnuAeHAz7WDPkkbEG2z3D3Z7d3cR9yrir7TMqP8Aj6GMEWYwUQDoEWTSfBAZ3su+L34s+KCTLFFsfzDRLsATAsWLneOQWsgZ9MAbKe+Pq6uhgSEUdAGuRkfGtTNn3rucR52ZUIytnU0fJrQNhfAfhx6/zjGI1YKFGwI99hLsJ4HiG8/aFEnTbZIKl9nhAXVfNbf3XOAQbFZOKoX+oJaXKc6ZgnrlCZl9P89nwI0YUInLcgScARWVyUepaQdJP21x7DZb5MEVH8ntE8gn2SYxLd5pOpe+AnGljUVBWBJM7uDDu46cHofsL2oWzAKN9D0wV2uYNqO2PqFafuqU3bT2Pw7egjVNY7YJzvkPmosXJZmE/xH7/YPfxoRE1DlxL95bbvHg7AA9Zog33/UPHf6Dy4DoC21M2OPUyQ6q8s/LqQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(376002)(366004)(136003)(346002)(39860400002)(451199021)(54906003)(66946007)(66556008)(66476007)(2616005)(36756003)(86362001)(31696002)(38100700002)(478600001)(186003)(6486002)(6512007)(53546011)(26005)(6506007)(2906002)(31686004)(41300700001)(5660300002)(316002)(4744005)(6916009)(4326008)(8676002)(8936002)(7416002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cXF3Z1hNeEpOYytZSm0wSVM5NlhTRXJTRWR3RXZTQ0xQZ0M0QWRtNERLQTdS?=
 =?utf-8?B?dThJb3h5MkU0bUJCQlJ3c0lraEt2TVVKZm5r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0JleGRqbmNsbzBDcDAwcFJMSjQ5ME5VNklPOTZZdm9a?=
 =?utf-8?B?Wlk1Syt5NFlUeTVSQXJzZ1ZKVHNkZ1UrMWFzUGd6Y0dVR0ZOWDMyZGVQNEdN?=
 =?utf-8?B?N0gzMGc1bHF3cjdFWnB6cWhQMmM3OUxlMWJIaE56NFp5KzdqVmwxbUJxOVNL?=
 =?utf-8?B?ekZEQ2ZoZDF5TUFqZDRzYS82NmUzUUR4UUd1WkZVMFFwUUZEVWhmWCt2M1Ji?=
 =?utf-8?B?OStDUEFGYm93N08yWkRlTitrZTlrUmQ4SDEwcDYwZ0lFSmlnaDJFZ01tOXFG?=
 =?utf-8?Q?yDASf07IwxwFY9EwKwhHn+Plf?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6f9911ab-333b-4380-3d6f-08db8ce3bb94
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 07:49:53.6848
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 5zxKfk0H1aK9mMTdEApZvO1rQ4495PPR1+i4Ogddnicx4jiNVeld2xOcBhbTO6BWDW1L2iKtl+btb5r9T0P9IQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB9942

On 25.07.2023 09:42, Viresh Kumar wrote:
> On 25-07-23, 09:18, Jan Beulich wrote:
>> I question that use, btw, but it is not up to me to decide whether to
>> accept such a layering violation in Linux. dm-op is, as its name says,
>> for device models to use. Your intended use doesn't fall in that
>> category, aiui. Imo the present contents of dm_op.h in Linux is indeed
>> all a kernel is supposed to know about, unless it was to gain in-kernel
>> device models.
> 
> Is there any other way by which an interrupt can be raised for the
> guest VM ? I was only aware of this method and so implemented it like
> this.
> 
> I am open to suggestions on this.

Well. I don't know your requirements. Generally I would suggest using
event channels, not interrupts, when talking about injecting events
into guests. If it strictly needs to be an interrupt, then I guess a
non-dm-op means would need introducing if none already exists.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 07:54:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 07:54:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569498.890325 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOCsh-0002T7-Il; Tue, 25 Jul 2023 07:54:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569498.890325; Tue, 25 Jul 2023 07:54:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOCsh-0002T0-GD; Tue, 25 Jul 2023 07:54:55 +0000
Received: by outflank-mailman (input) for mailman id 569498;
 Tue, 25 Jul 2023 07:54:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=aw78=DL=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qOCsg-0002Su-NC
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 07:54:54 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8a307b9f-2ac0-11ee-b23d-6b7b168915f2;
 Tue, 25 Jul 2023 09:54:53 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 36B371F74C;
 Tue, 25 Jul 2023 07:54:53 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C339513342;
 Tue, 25 Jul 2023 07:54:52 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id YejKLcx/v2QtJAAAMHmgww
 (envelope-from <jgross@suse.com>); Tue, 25 Jul 2023 07:54:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8a307b9f-2ac0-11ee-b23d-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690271693; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=igjqLOUndV0llKBZReZGwl1hYmK7O2hDw+Z4/9yZX8M=;
	b=C7adS2yoYoVvIyH20vrfTMjPB5nDwXUo24uzLpbZJFiwqaXX2xMWQwmxQQlPR7yMhOi1JR
	A+uIvUfe7nioZ+ilkBOmzcIdRFAJTVfX7a8JdULfy5rmDfJhbkPajAmjOUq55MKP8D8Trv
	KXHkgqQyYJevZjHmagGb8oTSXM6vWYU=
Message-ID: <8466d82c-d4ff-8302-2475-ae1acc09da38@suse.com>
Date: Tue, 25 Jul 2023 09:54:52 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH V3 1/2] xen: Update dm_op.h from Xen public header
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>, Viresh Kumar <viresh.kumar@linaro.org>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
 =?UTF-8?Q?Alex_Benn=c3=a9e?= <alex.bennee@linaro.org>,
 stratos-dev@op-lists.linaro.org, Erik Schilling <erik.schilling@linaro.org>,
 Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
 Mathieu Poirier <mathieu.poirier@linaro.org>,
 xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
References: <ffae9d7021829fea19fd93fda3c30b52b0af923e.1690190453.git.viresh.kumar@linaro.org>
 <1498bef6-ded0-1b1f-a5ca-e8755800b489@suse.com>
 <20230725070914.m3dxlokedrgjlgcu@vireshk-i7>
 <3770f13f-0621-48af-4c79-880a0ffaa8a6@suse.com>
 <20230725074218.zcgbkkx5pfgszimu@vireshk-i7>
 <920ede72-c2fb-c814-7b1c-aa488e400f83@suse.com>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <920ede72-c2fb-c814-7b1c-aa488e400f83@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------JL4MhcBsBYwNo14ivZLIVRNV"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------JL4MhcBsBYwNo14ivZLIVRNV
Content-Type: multipart/mixed; boundary="------------YVvyqzcome6DaI7ZaEhR27cg";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>, Viresh Kumar <viresh.kumar@linaro.org>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
 =?UTF-8?Q?Alex_Benn=c3=a9e?= <alex.bennee@linaro.org>,
 stratos-dev@op-lists.linaro.org, Erik Schilling <erik.schilling@linaro.org>,
 Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
 Mathieu Poirier <mathieu.poirier@linaro.org>,
 xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Message-ID: <8466d82c-d4ff-8302-2475-ae1acc09da38@suse.com>
Subject: Re: [PATCH V3 1/2] xen: Update dm_op.h from Xen public header
References: <ffae9d7021829fea19fd93fda3c30b52b0af923e.1690190453.git.viresh.kumar@linaro.org>
 <1498bef6-ded0-1b1f-a5ca-e8755800b489@suse.com>
 <20230725070914.m3dxlokedrgjlgcu@vireshk-i7>
 <3770f13f-0621-48af-4c79-880a0ffaa8a6@suse.com>
 <20230725074218.zcgbkkx5pfgszimu@vireshk-i7>
 <920ede72-c2fb-c814-7b1c-aa488e400f83@suse.com>
In-Reply-To: <920ede72-c2fb-c814-7b1c-aa488e400f83@suse.com>

--------------YVvyqzcome6DaI7ZaEhR27cg
Content-Type: multipart/mixed; boundary="------------hzgYDLsIxTgAe0GpXazwiSlp"

--------------hzgYDLsIxTgAe0GpXazwiSlp
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjUuMDcuMjMgMDk6NDksIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAyNS4wNy4yMDIz
IDA5OjQyLCBWaXJlc2ggS3VtYXIgd3JvdGU6DQo+PiBPbiAy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3Vlc3RzLiBJZiBpdCBzdHJpY3RseSBuZWVkcyB0byBiZSBhbiBpbnRl
cnJ1cHQsIHRoZW4gSSBndWVzcyBhDQo+IG5vbi1kbS1vcCBtZWFucyB3b3VsZCBuZWVkIGlu
dHJvZHVjaW5nIGlmIG5vbmUgYWxyZWFkeSBleGlzdHMuDQoNCkkgdGhpbmsgdGhlIGJlc3Qg
d2F5IHdvdWxkIGJlIHRvIGxldCB0aGUgdXNlciBtb2RlIGRldmljZSBtb2RlbCAoaS5lLiB0
aGUNCmJhY2tlbmQpIGNvbnN0cnVjdCB0aGUgZG0tb3AgcGFyYW1ldGVycyBsaWtlIHFlbXUg
aXMgZG9pbmcgaXQgYW5kIHBhc3MgaXQNCnZpYSB0aGUgaW9jdGwgdG8gdGhlIHByaXZjbWQg
ZHJpdmVyIGFzIHBhcnQgb2Ygc3RydWN0IHByaXZjbWRfaXJxZmQuIFRoZW4NCml0IHdvdWxk
IGJlIG9wYXF1ZSB0byB0aGUga2VybmVsIGxpa2UgZXZlcnkgb3RoZXIgZG0tb3AuDQoNCg0K
SnVlcmdlbg0KDQo=
--------------hzgYDLsIxTgAe0GpXazwiSlp
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxX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RfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------hzgYDLsIxTgAe0GpXazwiSlp--

--------------YVvyqzcome6DaI7ZaEhR27cg--

--------------JL4MhcBsBYwNo14ivZLIVRNV
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmS/f8wFAwAAAAAACgkQsN6d1ii/Ey9V
5Qf/afTWZb8SmxR62nYwuB7eC64OtFZRVwz55tH7meJhDs1Hvk6nGWXoprhtHmmtS2sEnQH6rR2r
oFk2jLq1TtV60vmkQpQyVgJRAmILxckUNgENMlsK+6SekVE8akLBXzQ2gchxZeu3xILJrRuB3CeA
8LiUuEN3vrjigrg+0COrO8AuRyx3sH39N2WGviVU6pa3eTsQdohpl79W4Y/R9wSDFDWOfIKd4jRl
FgICR88NxaY6vJjGVoNo4evpV3XhRzpnLrDXF3NLehYARKmS/EEHAa0kW1KMKH+yzOwehRpgbXgL
InTEzR4VULuhKSn+hauyNg0hKxKV3K/tmJMIhdO+SQ==
=hHoe
-----END PGP SIGNATURE-----

--------------JL4MhcBsBYwNo14ivZLIVRNV--


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 08:15:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 08:15:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569522.890336 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qODCg-0005ZT-MT; Tue, 25 Jul 2023 08:15:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569522.890336; Tue, 25 Jul 2023 08:15:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qODCg-0005ZM-JD; Tue, 25 Jul 2023 08:15:34 +0000
Received: by outflank-mailman (input) for mailman id 569522;
 Tue, 25 Jul 2023 08:15:32 +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
 <SRS0=BzC/=DL=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qODCe-0005ZA-Lq
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 08:15:32 +0000
Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com
 [2a00:1450:4864:20::12f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 651bfae8-2ac3-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 10:15:19 +0200 (CEST)
Received: by mail-lf1-x12f.google.com with SMTP id
 2adb3069b0e04-4fbc0314a7bso7819443e87.2
 for <xen-devel@lists.xenproject.org>; Tue, 25 Jul 2023 01:15:25 -0700 (PDT)
Received: from [192.168.202.116] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 h14-20020a05651211ce00b004fd36c89c3csm2652350lfr.43.2023.07.25.01.15.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 25 Jul 2023 01:15:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 651bfae8-2ac3-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690272925; x=1690877725;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=YhWqz0FUKVohbtdgIg+bZJt5UeCCllY5/RPT9e38CBg=;
        b=Svol500bxkr2KTbJ1H4Y9HVRm/pWA+AWXNu/o/viNr7B7BGHdS3h86Wwi73pou823/
         flm+UM+i2gIXJIfxX9wIzQIk2/xIJ+ta+hbSOx3/BrPKGLLMOTpAeZn6mc2MikTEdPuS
         rsGeOZ4CjHLDVB13dLSr+CYzNbu1MoH7nR1orKXd2sNfGQjV1OCNY0RWWhwpiVo7p/Qa
         G7IH++DdijvCClAT6aN9++q/MAvlCdRuldilpLrnlTgeYwfvpj4L2l/hK9f/JkC7BQnw
         p4/+amA1d2g1mLwugyiQshxsp3mRRgBBQtL2/NtRP8aIWYWrPC6zrgjnKibTJTwc9kDm
         KWAg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690272925; x=1690877725;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=YhWqz0FUKVohbtdgIg+bZJt5UeCCllY5/RPT9e38CBg=;
        b=BIVgPVziwfPRXgKcaLPTDdAk3SedOs6Q84CIvfpJnNYKhUWYWDJwpJylP+31Mct3Ti
         at+cgl9m0R4rxIM/AaT8GzUh/lnVdpu5AF859MG0kgSCDJw67XpcyyeqyqfpJ9zTWJLP
         qQzYwQ42LpSDQW0pD0r0ZQJMdTpOS6FOiYpmkQawgBB8PTWvUyolxSutBx66wJZrcHNU
         3PJl0pe7tsruzsIYqIAyCXOCSbibeoMnXyPvLV2+aUrjAWJ6zz16h8vHbsgnZcEncaS+
         gYfBH73UlqhrduJ0KdmXKDDVis+eJscw6KY/jTf30k4xvCpdKWSNIEsmd86qVX8VcenH
         KhLA==
X-Gm-Message-State: ABy/qLZBpi6GNz1UN5iqQofsk68BT4F6hH+KYcOWuRZYKCiaPZEDAHOu
	CBRLFHxxr0erzmo5FGBpy3I=
X-Google-Smtp-Source: APBJJlHyVWOdYsVQVEI0RGOqv/B0zpuhCb4mKlNJhKbLVo2pUyKBFrygrqdlGGGYVd9xBc/BsQ6HcQ==
X-Received: by 2002:a05:6512:401e:b0:4fb:90c6:c31a with SMTP id br30-20020a056512401e00b004fb90c6c31amr7844583lfb.14.1690272924798;
        Tue, 25 Jul 2023 01:15:24 -0700 (PDT)
Message-ID: <ab9e7a3f3b5faa4805b5b2c8ffc985bc3330c4a3.camel@gmail.com>
Subject: Re: [PATCH v3] ns16550: add support for polling mode when device
 tree is used
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap
 <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
Date: Tue, 25 Jul 2023 11:15:23 +0300
In-Reply-To: <be0c9eb8-6561-f6bc-ff76-a1bfeaeaab9d@suse.com>
References: 
	<d929b43814e6e1a247b954c4be40a35d61b6a45a.1690208840.git.oleksii.kurochko@gmail.com>
	 <be0c9eb8-6561-f6bc-ff76-a1bfeaeaab9d@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Mon, 2023-07-24 at 16:43 +0200, Jan Beulich wrote:
> On 24.07.2023 16:27, Oleksii Kurochko wrote:
> > --- a/xen/drivers/char/console.c
> > +++ b/xen/drivers/char/console.c
> > @@ -993,6 +993,8 @@ void __init console_init_preirq(void)
> > =C2=A0#endif
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else if ( !strncmp(p, =
"none", 4) )
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 continue;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else if ( !strncmp(p, "poll=
ing", 7 )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 con=
tinue;
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else if ( (sh =3D seri=
al_parse_handle(p)) >=3D 0 )
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 sercon_handle =3D sh;
>=20
> Looks like you mean the new option to go under "console=3D". Besides
> this being guesswork because of you not updating the command line
> doc, this also is wrong, as the property then applies to all
> consoles. What you mean is a control for a specific instance of a
> 16550 console, which can only possibly go under "com<N>=3D". I would
> suggest to simply extend [<irq>|msi] there to [<irq>|msi|poll].
Thanks. It would be definitely better to go under "com<N>"
>=20
> > @@ -595,7 +601,9 @@ static void __init cf_check
> > ns16550_endboot(struct serial_port *port)
> > =C2=A0static int __init cf_check ns16550_irq(struct serial_port *port)
> > =C2=A0{
> > =C2=A0=C2=A0=C2=A0=C2=A0 struct ns16550 *uart =3D port->uart;
> > -=C2=A0=C2=A0=C2=A0 return ((uart->irq > 0) ? uart->irq : -1);
> > +
> > +=C2=A0=C2=A0=C2=A0 return ( uart->intr_works !=3D polling ) ?
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uar=
t->irq : -1;
> > =C2=A0}
>=20
> Please don't corrupt previously correct style. You can keep things
> almost like they were (albeit there's no strict need for any of the
> parentheses):
>=20
> =C2=A0=C2=A0=C2=A0 return ((uart->intr_works !=3D polling) ? uart->irq : =
-1);
Thanks.
>=20
> > @@ -1330,9 +1341,12 @@ pci_uart_config(struct ns16550 *uart, bool_t
> > skip_amt, unsigned int idx)
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * as special only for X86.
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */
> > =C2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C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 "ns16550: %pp: no legacy IRQ, using
> > poll mode\n",
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 &PCI_SBDF(0, b, d, f));
>=20
> Message and code (after your addition) continue to be out of sync.
> As said before, any condition that leads to polling mode wants to
> find itself expressed by uart->intr_works set to "polling".
Well. It looks like it would be better to set 'uart->intr_works =3D
polling' inside if ( !uart->irq ):
  if ( !uart->irq || (uart->intr_works =3D=3D polling) )
  {
      uart->intr_works =3D polling;
      printk(XENLOG_INFO
             "ns16550: %pp: using poll mode\n",
             &PCI_SBDF(0, b, d, f));
  }
Then "uart->intr_works =3D polling;" can be removed from "if ( uart->irq
=3D=3D 0xff )" as in that case 'uart->irq =3D 0' means polling mode for X86=
.
 =20
>=20
> > @@ -1552,6 +1566,7 @@ static bool __init parse_positional(struct
> > ns16550 *uart, char **str)
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 conf +=3D 3;
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 uart->msi =3D true;
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 uart->irq =3D 0;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uar=
t->intr_works =3D polling;
>=20
> How that? "msi" is specifically asking for interrupt driven mode,
> just that the IRQ number isn't known yet. (Seeing this I notice that
> parse_namevalue_pairs() offers no way of selecting MSI mode. But
> that's not something you need to sort out.)
I was confused by the code from ns16550_init_postirq():
                if ( rc )
                {
                    uart->irq =3D 0;
                    if ( msi_desc )
                        msi_free_irq(msi_desc);
                    else
                        destroy_irq(msi.irq);
                }
where "uart->irq =3D 0;" means that polling mode should be used because
of the following code in the same function:
    if ( uart->irq > 0 )
    {
        uart->irqaction.handler =3D ns16550_interrupt;
        uart->irqaction.name    =3D "ns16550";
        uart->irqaction.dev_id  =3D port;
        if ( (rc =3D setup_irq(uart->irq, 0, &uart->irqaction)) !=3D 0 )
            printk("ERROR: Failed to allocate ns16550 IRQ %d\n", uart-
>irq);
    }

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 08:16:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 08:16:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569524.890346 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qODDW-00064V-VV; Tue, 25 Jul 2023 08:16:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569524.890346; Tue, 25 Jul 2023 08:16:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qODDW-00064O-Rr; Tue, 25 Jul 2023 08:16:26 +0000
Received: by outflank-mailman (input) for mailman id 569524;
 Tue, 25 Jul 2023 08:16:25 +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 <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qODDV-00064C-CI
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 08:16:25 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20611.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::611])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 871d0864-2ac3-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 10:16:17 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS5PR04MB9944.eurprd04.prod.outlook.com (2603:10a6:20b:682::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 08:16:20 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 08:16:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 871d0864-2ac3-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Ch5NkPY+GFt9nyypKSpM8CgyE+AYEu1uughn0qTX+uIwWhUfwH8JJ2uqyGmLVYbWzmb+7DWjC+aamZeQ4AEYtRIcHG2diHXl5NEeSdiISgT30srFP/qMDj4lPSKc9be93rBJZNU0/PEUnW0MUj3WE1u9YKOY47k6h1WmtLV02n/2eRs6qZEuPS3m/TW/IIUP3p4OHKo5nhqqsZqDtwh4Way4jiDYuW/Tl3jaKI14LrdVzbeu+LfcH2axPnJHX5voDr8Xap7DRIFCFV0ojzItO5OZBPZAYVrHoouQ9DsuCFoikZKDIFVlXQhBgXpvtKxwjBaCzojY6Wq8F8cWUC6P2Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=lDUGSo8T5zYHmBk6fUObDr8uwP+vbIqt8tciC8vMC7k=;
 b=dx7PARJmxeAhWAqwnXYCwylICBGfnOwuX+pWnxAub3SLRNkoiRZnG7MHyg0rkNaQcNYa1rrpPUOZPH8W0K4HIB2iGfh497YHOYSnnwEsM/Lo4VpEv36q48wjkpBpPhTfemhgvWSTTl0OjcCLjIBBlqCKpZbzLI6t7GWTKPcV5s+e4U13QNi5Uw6A9AXAbJrHpkPvCtKR6KRqJRXj+d9GWVWgv1HLM+/7nX1GFg5XVnghHVPyzoo0AWCt47QX/au7qbGhlyrweftIoo6dl3iT6rhF4P0/L1QGv35Lyb7cFUTRmFx3q0fUmiN0av+aT1DS8PtZxhRJRqE/jNQlIcp0FQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=lDUGSo8T5zYHmBk6fUObDr8uwP+vbIqt8tciC8vMC7k=;
 b=pxLG/nyK504mhcAffPLVVaT5LrRBA2yHHtKanUn43o4U6xLwQZCdHriKzgjuml99dEPnrNnUvYyuCRCvqtg9rOHaVdCAAnJJdWR9eChiEY969J1gHupNGjrNBBF7BF6jLVPnDTzOM5UC9Qx8XZ3d4e3MZvuzdw0R0CVKlio9ECC9KBG8nBxFhSqrlAxEeYroQG/5v2yjuE08v8bgjrs790gJedWtPukSG9atUlAy2p3xcdUXCfGIAK0MGhndJDS4aAtoB/qJtYcBOp5quVoSJW68ZtrioAED/UF1siaQo/mrdeYuYGZriLUuWiIZPz4DOgXZUUcI9KA2uk7V+Wjc4A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <d8aeb29b-1284-98bc-de75-3d5d8a825e1b@suse.com>
Date: Tue, 25 Jul 2023 10:16:18 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1690191480.git.oleksii.kurochko@gmail.com>
 <a8ab1829ab718dda869db3df3348ded211e81967.1690191480.git.oleksii.kurochko@gmail.com>
 <c32d8be8-75cf-78f8-304d-247b93b611cb@suse.com>
 <dddc1effe5fc112f79a84e4f0a7ccf283877a466.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <dddc1effe5fc112f79a84e4f0a7ccf283877a466.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0090.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1f::6) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS5PR04MB9944:EE_
X-MS-Office365-Filtering-Correlation-Id: 752c6799-e5ce-45f3-0e2b-08db8ce76d3b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	EA+dLGmbSdE1Acv1IC76pBRWdrnRUHCaK+Rmiq0XMV2wGQ/lCS8I35+AVjyXnt8wJbmQg+HbCOfYWTKZPNFWfzjMlXedxITZFeaYqSGZW4TOUGLqjbNN+lv3F+EZTN32IX/aQKzBDfzBBNiZaun/qVsv4rPwhDZkfTEchtfoAOblleCEfgxgTs1DIQv8V8GyPaK46Ux8a4sSrBNV9hIxXUDNYND2/HhIK8PgR/kzb533/ETtFb1ByfgbAOgZwVkTj9VcLMUJncENlR9IMt6dxgxStLzf/COk7a0QoBeDAUEske25wxtnKwd83nC4T6KKzTscTZeUceZCmUeULnkUa95E+9qoJr2i+Jg80DAzi1FGu/lYfGCjCMRpZrUc2g5Vn4TCkbLVWLgDALysko5Znx6F+DAeImVICRujgL7XTYlB1o/FImSszAvKi5jGHvd7U3iCCBo4ztW+TMHHOipZMMrhWM8wZb/EzJQqhCjR7OGLOa4Bibshuq7gWjJBvvEQ83pELjP/1MUyoGCOtBaHD36h52cS26lH5jJfoN5xu1iElwB3Gb5PX7AvjASFo5PKnpHx0sF+7FQ8CTPtevGapcC5IIV/nGEDVeY8WolUYjV4QxsGAsD1y6XjcqQCP6DMVk4mt9bv+L1zTwKxXbnppg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(396003)(136003)(346002)(39860400002)(366004)(451199021)(54906003)(66946007)(66556008)(66476007)(2616005)(36756003)(83380400001)(86362001)(31696002)(38100700002)(478600001)(186003)(6506007)(6486002)(6512007)(53546011)(26005)(31686004)(41300700001)(5660300002)(316002)(2906002)(6916009)(4326008)(8676002)(8936002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?a1lUOTJ2TmJUdGJvYVAxVnNtWUJ3WDhPS1RrU21JVFVDVFFSWUxGYzZPSjQ3?=
 =?utf-8?B?TytkbHpLT2paZEIzZUtRRitNYjZ2YmZFTXFiQ3VqY2t0SmVnUE1kSzRrUVhr?=
 =?utf-8?B?ZGFjbHJnNlVGeGoydmNWL1pnTDVJcTljY1JaNm5TOFVUM0ZtemxuK3NmaWVq?=
 =?utf-8?B?Y29QdGxBQW00Y09LZjVDOXBOWXZma3BoQVdYODlKTjFCOCsxVFdNOFp6WS9S?=
 =?utf-8?B?RlEwRld0U0tzYmhDSlJlT1ZxQWVnbmgxek1MNXdYcitpZHFDekFpL0JYU0dk?=
 =?utf-8?B?YS9ST2JjeTRPZ29MaFBGWS95QytWUzc1T1BjemlyMmQvVVNVRXQxWXRLcHNl?=
 =?utf-8?B?UGcvSW11cGpYN3c4bllxV0d5Zmh2SCtJWHRrOWtzYi9ldVhSdXdhd2RDa2dW?=
 =?utf-8?B?UnJBVzU1UXhpWDdqU0JpZUpnZk5Kc3o4UWdMcGU4SjZkaE85dktFOGRCeEQy?=
 =?utf-8?B?VStPaUgvNERGTWhNN1YxMnpZeWcvNUZ0NC9VdnpDSGx1c2V2Vmd3VE5Rdllj?=
 =?utf-8?B?bEluR3BFRzJJU05VbStaZldYN3R2TmJJa015QnBrQWlLZG04czh2ckkzSkFn?=
 =?utf-8?B?WEticWtoMHNITmNHNE9VYmM1b0cyTitsOENhYythWUhqMkhtcnVWY3QzT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8?B?Nmw0d3Z3elY3dys3cXQyMkkxYWQvZ3JTOVNTaWltdlJ1cUlZMU5iVUpEcFBw?=
 =?utf-8?B?aHR2clNjMk9LcXBLSHhoQ0Y5eWxCOWpIMTVXM2JDdnJybDhiN0VwVjNaM3Zn?=
 =?utf-8?B?RlNWTGE4ajJnRzhzNStFZWt6Yk9YN0psamZqMzRNeFRFTmh1b1l2MWMyV0pr?=
 =?utf-8?B?OUlkN0dVUzNYNjNzdnlpdmdxTkdwVFpTZmhoQWJmRWxEeDVOVGFiSHBNSTJz?=
 =?utf-8?B?aHN3Y2tULzlBR3BwSElXVkEzL0Fpa3Jqdkx0YVYrWFV3V1AyMTNqL1IrQ1lL?=
 =?utf-8?B?b0c4NUduaS9PNUZXS1BTY1BFWkZDMWZ2aGlEWFBST3ZmenQ3SHUyS3kyNUtE?=
 =?utf-8?B?Y3JqVXJoMEdCTS85a3o3MHNad1hTZWFMK0RrM3RydkEwUXhtNXJaTDVZNDZX?=
 =?utf-8?B?MmZSQnlLQUdGUTBxQjVlMUhLbTkzSVpvdVhrWEw3WFp5enBkVWFySm5QZlc1?=
 =?utf-8?B?MVpWQ01CQW5XT081S3pLZWRxMmU3N0pUYjFMRUw4bTNNM2ZXYTVHRW9uT2Jy?=
 =?utf-8?B?T0FkTHJ5QWFKMzhSdDZNZHF1MVVRdWhrbWNMVnN2SDhMcjdaMmdXQWtlL3F6?=
 =?utf-8?Q?KQtzd57E8Y9mLnsj/DJZFgwya?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 752c6799-e5ce-45f3-0e2b-08db8ce76d3b
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 08:16:20.2100
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: immbaLPzr1TkKlkQ5WuR0hWyFXuYuP9I3EC+Ghc7hJ/IwguSR4lRlSjZPAvMCPs3TOLi6W1UeyHZC01rM2V0Cg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB9944

On 24.07.2023 18:00, Oleksii wrote:
> On Mon, 2023-07-24 at 16:11 +0200, Jan Beulich wrote:
>> On 24.07.2023 11:42, Oleksii Kurochko wrote:
>>> +void __init remove_identity_mapping(void)
>>> +{
>>> +Â Â Â  static pte_t *pgtbl = stage1_pgtbl_root;
>>> +Â Â Â  static unsigned long load_start = XEN_VIRT_START;
>>> +Â Â Â  static unsigned int pt_level = CONFIG_PAGING_LEVELS - 1;
>>
>> These all want to be __initdata, but personally I find this way of
>> recursing a little odd. Let's see what the maintainers say.
> I'm not completely happy either. Initially I thought that it would be
> better to pass all this stuff as function's arguments.
> 
> But then it is needed to provide an access to stage1_pgtbl_root (
> get_root_pt() function ? ). So remove_identity_mapping() will be called
> as remove_identity_mapping(get_root_pt(), _start, CONFIG_PAGING_LELVELS
> -1 ) or remove_identity_mapping(NULL, _start, CONFIG_PAGING_LELVELS -1
> ) and then check if first argument is NULL then initialize it with
> stage1_pgtbl_root.
> Also I am not sure that an 'user' should provide all this information
> to such function.
> 
> Could you recommend something better?

Well, to avoid the mess you are describing I would consider making
remove_identity_mapping() itself a thin wrapper around the actual
function which then invokes itself recursively. That'll keep the
top-level call site tidy, and all the technical details confined to
the (then) two functions.

>>> +Â Â Â  unsigned long load_end = LINK_TO_LOAD(_end);
>>> +Â Â Â  unsigned long xen_size;
>>> +Â Â Â  unsigned long pt_level_size = XEN_PT_LEVEL_SIZE(pt_level);
>>> +Â Â Â  unsigned long pte_nums;
>>> +
>>> +Â Â Â  unsigned long virt_indx = pt_index(pt_level, XEN_VIRT_START);
>>> +Â Â Â  unsigned long indx;
>>> +
>>> +Â Â Â  if ( load_start == XEN_VIRT_START )
>>> +Â Â Â Â Â Â Â  load_start = LINK_TO_LOAD(_start);
>>> +
>>> +Â Â Â  xen_size = load_end - load_start;
>>
>> When you come here recursively, don't you need to limit this
>> instance of the function to a single page table's worth of address
>> space (at the given level), using load_end only if that's yet
>> lower?
> Do you mean a case when load_start > load_end? If yes then I missed
> that.

No, my concern is with the page table presently acted upon covering
only a limited part of the address space. That "limited" is the full
address space only for the top level table. You won't observe this
though unless the Xen image crosses a 2Mb boundary. But if it does
(and it may help if you arranged for big enough an image just for
the purpose of debugging, simply by inserting enough dead code or
data), and if all mappings are 4k ones, you'd run past the first L1
table's worth of mappings on the first invocation of this function
with a L1 table. (Of course hitting the condition may further
require Xen and 1:1 mappings to be sufficiently close to one another,
so that the zapping doesn't already occur at higher levels. But then
the same situation could arise at higher levels when the image
crosses a 1Gb or 512Gb boundary.)

>>> +Â Â Â  pte_nums = ROUNDUP(xen_size, pt_level_size) / pt_level_size;
>>> +
>>> +Â Â Â  while ( pte_nums-- )
>>> +Â Â Â  {
>>> +Â Â Â Â Â Â Â  indx = pt_index(pt_level, load_start);
>>> Â 
>>> -Â Â Â  switch_stack_and_jump((unsigned long)cpu0_boot_stack +
>>> STACK_SIZE,
>>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  cont_after_mmu_is_enabled);
>>> +Â Â Â Â Â Â Â  if ( virt_indx != indx )
>>> +Â Â Â Â Â Â Â  {
>>> +Â Â Â Â Â Â Â Â Â Â Â  pgtbl[indx].pte = 0;
>>> +Â Â Â Â Â Â Â Â Â Â Â  load_start += XEN_PT_LEVEL_SIZE(pt_level);
>>> +Â Â Â Â Â Â Â  }
>>> +Â Â Â Â Â Â Â  else
>>> +Â Â Â Â Â Â Â  {
>>> +Â Â Â Â Â Â Â Â Â Â Â  pgtbl =Â  (pte_t
>>> *)LOAD_TO_LINK(pte_to_paddr(pgtbl[indx]));
>>
>> Nit: Stray double blank.
> Thanks.
>>
>>> +Â Â Â Â Â Â Â Â Â Â Â  pt_level--;
>>> +Â Â Â Â Â Â Â Â Â Â Â  remove_identity_mapping();
>>
>> Don't you need to restore pgtbl and pt_level here before the loop
>> can continue? And because of depending on load_start, which would
>> have moved, xen_size also needs suitably reducing, I think. Plus
>> pte_nums as well, since that in turn was calculated from xen_size.
> I forgot to restore pgtbl and pt_level because initially I used a
> function arguments to pass that information so it wasn't needed to
> restore them.
> 
> Regarding xen_size and pte_nums it looks like it is needed to init only
> once on each page table level.
> For example we have the following situation:
>   ----------------------
>    non-identity-mapping
>    identity-mapping
>   ---------------------- C
>    identity-mapping
>   ---------------------- B
>    identity-mapping
>   ---------------------- A
> So we calculated that we need to remove 3 ptes, for first two ptes ( as
> only identity mapping is there) are removed without any issue, then
> move load_addr to C and run recursion
> for the pte 'C' to go to next page table level.
> At new level we are calculating how many ptes are needed to be removed
> and remove only necessary amount of ptes.
> When we will back to prev page table level pte_num will be 1 then we
> will go to the head of the cycle, decrease pte_num to 0 and exit.

I think I agree that this case is okay.

> The same is with the case when non-idenitity-mapping is lower than
> identity mapping ( but it looks like it is not a case becase
> XEN_VIRT_START addr is the highest address by its defintion. Probably
> it is needed to add a check ):

And it looks like this case being impossible is what voids my respective
remark. (Might be worth adding a comment to this effect.)

Jan

> we know that pte_num = 3 at some level. Then we go to the next level
> and remove there only identity map ptes, back to previous level,
> decrease pte_num to 2 and remove only 2 remaining ptes.
> 
> ~ Oleksii
> 



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 08:19:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 08:19:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569527.890356 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qODGM-0006mO-GR; Tue, 25 Jul 2023 08:19:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569527.890356; Tue, 25 Jul 2023 08:19:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qODGM-0006mH-DG; Tue, 25 Jul 2023 08:19:22 +0000
Received: by outflank-mailman (input) for mailman id 569527;
 Tue, 25 Jul 2023 08:19:21 +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 <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qODGL-0006mB-Kv
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 08:19:21 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2070.outbound.protection.outlook.com [40.107.7.70])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f056bb16-2ac3-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 10:19:13 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8619.eurprd04.prod.outlook.com (2603:10a6:20b:43a::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 08:18:50 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 08:18:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f056bb16-2ac3-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=kAFbrqzWFv0r4mtIyN+JYQgtBFophrHKKX6FdTu2D8Np1KRs52/lpWbZt8Yshu412fByp00an28axc32tEofkN1lH5CQPc4LFQqBNGd93pU67wyoql+Ds1IuT9bF8TPlM+h++Sfn8GLLnjVFzh0esRjV/xVnt+K60s+htqyM7VdtImTFfNvCw5hBGJaB6rQWMPtFbcXK6gM1kwLh5ja6WkTARUaWpRaSajhrvLyEba3uphGCnRyBO87UnCWdlQ8AgZp0gt9dbtmG69wVaF8BRe+DwGJNmMcru2OBvwjlmQpnlFeGm3CFrnphy5J+SwBTsWkyVO+vxISPJAYokvj7qA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ODO1xSaXezWXoStZDdTbR/K3+TD1E18vrSVKt/DrhP8=;
 b=FY6v1JZJtg6e7KAD2thS92I5PGhlHPWLlKK2nf2fsD3rXeRSYx2sj0PxZS+B9hYC+afLF2xiPF6kgQ4aXq1/14yWBdM9lh4C4jU+swQQLWVzamFeQbF8GnYOpy5O6IDjnhr5cqq4W3N5EG5Ze0TdPnOIeVnxdRjv9uVV47GW8wt3efNQ1ykZjrD/aW/GuT5XpACWh41fjYkwKxSMrts7ZrfHFEGS8rKDfs45nJJ72BWwg3CZQwQEkNAPFgRv8zk9Ntxr/z7YfqrbLUPxpcobqbfeV+13zQk27wSINMc4bQWPvTIn7vYf4n2+ZSu2Hh42dr9ttXNsg85HGHHQ29hfCw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ODO1xSaXezWXoStZDdTbR/K3+TD1E18vrSVKt/DrhP8=;
 b=phBhL78JjhxJkQnEMSRAgKdFjrR/a7p5MFlogyuE0RKUaUrVTZLiNcUeXyKGkZSenCImrreSohAt3MlFxnYxNQ2cfIQnydrQryOyzTHOT2Uk9DARoYchF9HlGrt6K+ICz2xnr8HI6Q8VC6Y506FoVuO1vJZuO9J90ALQXZ7HI6jXyF+XdIZirlDzyXWOa2iDhGHglud5eSd8rEpffCJ+vlduUqDxWoiJ4z8gQZlqvjGq8hUL4awotDVxr0CHHhXImLo8I0pr374r/a8DoMOZxTGdXNRMxb6/Uo8G6126POwr0JeH816Req9Sj/MNYgraParXmkugvH35Qtgz1srC0Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <004fa0af-105b-63eb-2abc-53b0cbcfaef7@suse.com>
Date: Tue, 25 Jul 2023 10:18:48 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3] ns16550: add support for polling mode when device tree
 is used
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <d929b43814e6e1a247b954c4be40a35d61b6a45a.1690208840.git.oleksii.kurochko@gmail.com>
 <be0c9eb8-6561-f6bc-ff76-a1bfeaeaab9d@suse.com>
 <ab9e7a3f3b5faa4805b5b2c8ffc985bc3330c4a3.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ab9e7a3f3b5faa4805b5b2c8ffc985bc3330c4a3.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0059.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:93::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8619:EE_
X-MS-Office365-Filtering-Correlation-Id: 703b8edc-09ac-47a4-52ec-08db8ce7c69a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	6JClz5A9GC+Yg5OAMui5zro8ArTFjOiwQBZRiIKLHtwKkdg1TrNi7eRTJVepC+lV+C3RNVZNJsr0SmRh7jtzlkhv3JhAIE89GLChBJOthdJ8rJrEeI4vp1yz8ErcGZqiCAqShWgAx8/o/WGihkUR5+0vO1PEggFfK/2VpvACYrNmtDxVIZ2TwFDDlbXuDYNQpO60rysv3OKvHAM0rdjgVdQjEUHG1ZCwgDekcxrDLcRi3s4CcunmBXf/VT9w3igHFtVA4yijEj2CZqK3Qlx1JJbTPIIn4pB+RXU1pOWTlroOEa+3QhhJWYaMwcxcUGWhhkO3llTJngz2qGIU+V5xDoknIVt3rkrHOsO5xAVMh2PHfXDonbzgiA1P9wdF3bHEcGW64HwJjQOlDjluk94a9y23nMLJ2I7EZ7BD7q/skDNJZ5fyJkx1kRtlC8rBInvGIxpTcnYD2rA6/u2YteVtjOc+0w2vxVQp3ZIiFXLxFgMyDf08dNrLPzOtpdCD6BO2JdzmPuyYECxYXH0BIAOVjfnWlzBsxvV1EgeDDAjH5+dHQR+IKVh8QAkpVcqr0QyItoHtjAewgQ4CvwA+kmVHDUMqm3Bf3PFT12vgZQND/xGUnTWFnB0mDjhyqS51TNwFoqO6LncUQe4ZhGkw4+xZQQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(136003)(376002)(366004)(39860400002)(451199021)(6486002)(478600001)(83380400001)(53546011)(6506007)(6512007)(26005)(4326008)(6916009)(54906003)(66556008)(66946007)(66476007)(2616005)(186003)(38100700002)(31686004)(5660300002)(8676002)(8936002)(2906002)(41300700001)(316002)(86362001)(31696002)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZjZFSDd2bHI3Yko1dVBtSFNUbCtXTXNpZUQwVnFrZXhFM3hGT2xGOUlacTFZ?=
 =?utf-8?B?ZTlFdEZNaUhyNFlXY2hjSWN6eFpvaElJVi80dGRLZkxnMVNTaVNXUWRNS2E4?=
 =?utf-8?B?VlJ5VXFCWTEzYng0Ykc4Q25tcytvOTdhb0VidEZrY2htVmFwU0RxWHVWZHdT?=
 =?utf-8?B?RnI5Z1QxT1ZidWMrbkdEVi9rQXhBai9JWnZ2UnN1OHhySmlCOTM2ZkRSaEhD?=
 =?utf-8?B?QW5GM1lqSUhIeFJQRHh1YjMyVEVrS292ai9sNVZiU2ZRSzR6b1Jsc0pRK1BN?=
 =?utf-8?B?MTE1WVRhU2JJMC9lNkxzQy9oUDhRRStpMmYvZENYQVFwWVlzL3lOQW1S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SGdFRjduS2xIK0h0?=
 =?utf-8?Q?ciXEzKq9bT3+78m5HQYQ+m//P?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 703b8edc-09ac-47a4-52ec-08db8ce7c69a
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 08:18:50.1729
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: jNuwG6ObVMmQL/2E3DblRksXACdkZBJsW+pb60FYATsyQ7y6hUjkeWFpg0gRaNvsYkhrDm6MSCk40UrjZxfxng==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8619

On 25.07.2023 10:15, Oleksii wrote:
> On Mon, 2023-07-24 at 16:43 +0200, Jan Beulich wrote:
>> On 24.07.2023 16:27, Oleksii Kurochko wrote:
>>> @@ -1330,9 +1341,12 @@ pci_uart_config(struct ns16550 *uart, bool_t
>>> skip_amt, unsigned int idx)
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  * as special only for X86.
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  */
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  if ( uart->irq == 0xff )
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  {
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  uart->irq = 0;
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  uart->intr_works = polling;
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  }
>>> Â #endif
>>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  if ( !uart->irq )
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  if ( !uart->irq || (uart->intr_works == polling) )
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  printk(XENLOG_INFO
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  "ns16550: %pp: no legacy IRQ, using
>>> poll mode\n",
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  &PCI_SBDF(0, b, d, f));
>>
>> Message and code (after your addition) continue to be out of sync.
>> As said before, any condition that leads to polling mode wants to
>> find itself expressed by uart->intr_works set to "polling".
> Well. It looks like it would be better to set 'uart->intr_works =
> polling' inside if ( !uart->irq ):
>   if ( !uart->irq || (uart->intr_works == polling) )
>   {
>       uart->intr_works = polling;
>       printk(XENLOG_INFO
>              "ns16550: %pp: using poll mode\n",
>              &PCI_SBDF(0, b, d, f));
>   }
> Then "uart->intr_works = polling;" can be removed from "if ( uart->irq
> == 0xff )" as in that case 'uart->irq = 0' means polling mode for X86.

I'm not fully convinced. Care needs to be taken that both the x86 case
and the general case continue to function as they did (unless proven to
be buggy).

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 08:42:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 08:42:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569539.890367 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qODcf-0001mt-5z; Tue, 25 Jul 2023 08:42:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569539.890367; Tue, 25 Jul 2023 08:42:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qODcf-0001mm-1P; Tue, 25 Jul 2023 08:42:25 +0000
Received: by outflank-mailman (input) for mailman id 569539;
 Tue, 25 Jul 2023 08:42:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=aw78=DL=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qODce-0001mg-B6
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 08:42:24 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [2001:67c:2178:6::1c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2c99c33c-2ac7-11ee-b23d-6b7b168915f2;
 Tue, 25 Jul 2023 10:42:23 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id A099E2238C;
 Tue, 25 Jul 2023 08:42:22 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5155113342;
 Tue, 25 Jul 2023 08:42:22 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id DjgWEe6Kv2TuPgAAMHmgww
 (envelope-from <jgross@suse.com>); Tue, 25 Jul 2023 08:42:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2c99c33c-2ac7-11ee-b23d-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690274542; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=LN7abiJtxMulznyHMJQAdbbO9gDCYknD/hJxzBUtmVQ=;
	b=PATFFidW84PmyG8pAzJVd201JO8jdl1/apw99ALckAW7AXbBWQTc9E1tK3+1EpvVQDMd3d
	Z/yk47DhnFqy8JFvJkaA05WLhbJg9BDA6XwN2zQBoNzb08PR2XmmDpChaSRijWTREZ8BSi
	jeBI26Bn9ejxZio9MBPpKtncxgcyieU=
Message-ID: <938e9198-8684-6e1b-d3a9-4601bedd2004@suse.com>
Date: Tue, 25 Jul 2023 10:42:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH V3 2/2] xen: privcmd: Add support for irqfd
Content-Language: en-US
To: Viresh Kumar <viresh.kumar@linaro.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
 =?UTF-8?Q?Alex_Benn=c3=a9e?= <alex.bennee@linaro.org>,
 stratos-dev@op-lists.linaro.org, Erik Schilling <erik.schilling@linaro.org>,
 Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
 Mathieu Poirier <mathieu.poirier@linaro.org>,
 xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
References: <ffae9d7021829fea19fd93fda3c30b52b0af923e.1690190453.git.viresh.kumar@linaro.org>
 <8c1ea7faa0fe5deed1b2c86ea0f73e824f8a001d.1690190453.git.viresh.kumar@linaro.org>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <8c1ea7faa0fe5deed1b2c86ea0f73e824f8a001d.1690190453.git.viresh.kumar@linaro.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------0pVDYdB0AhBfd9mnjxflwa0K"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------0pVDYdB0AhBfd9mnjxflwa0K
Content-Type: multipart/mixed; boundary="------------cU0FjSzGoxJGMDvaoRzrxGMA";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Viresh Kumar <viresh.kumar@linaro.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
 =?UTF-8?Q?Alex_Benn=c3=a9e?= <alex.bennee@linaro.org>,
 stratos-dev@op-lists.linaro.org, Erik Schilling <erik.schilling@linaro.org>,
 Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
 Mathieu Poirier <mathieu.poirier@linaro.org>,
 xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Message-ID: <938e9198-8684-6e1b-d3a9-4601bedd2004@suse.com>
Subject: Re: [PATCH V3 2/2] xen: privcmd: Add support for irqfd
References: <ffae9d7021829fea19fd93fda3c30b52b0af923e.1690190453.git.viresh.kumar@linaro.org>
 <8c1ea7faa0fe5deed1b2c86ea0f73e824f8a001d.1690190453.git.viresh.kumar@linaro.org>
In-Reply-To: <8c1ea7faa0fe5deed1b2c86ea0f73e824f8a001d.1690190453.git.viresh.kumar@linaro.org>

--------------cU0FjSzGoxJGMDvaoRzrxGMA
Content-Type: multipart/mixed; boundary="------------dN83e0dptSsRjzwwXIJxoum7"

--------------dN83e0dptSsRjzwwXIJxoum7
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjUuMDcuMjMgMDg6NDcsIFZpcmVzaCBLdW1hciB3cm90ZToNCj4gWGVuIHByb3ZpZGVz
IHN1cHBvcnQgZm9yIGluamVjdGluZyBpbnRlcnJ1cHRzIHRvIHRoZSBndWVzdHMgdmlhIHRo
ZQ0KPiBIWVBFUlZJU09SX2RtX29wKCkgaHlwZXJjYWxsLiBUaGUgc2FtZSBpcyB1c2VkIGJ5
IHRoZSBWaXJ0aW8gYmFzZWQNCj4gZGV2aWNlIGJhY2tlbmQgaW1wbGVtZW50YXRpb25zLCBp
biBhbiBpbmVmZmljaWVudCBtYW5uZXIgY3VycmVudGx5Lg0KPiANCj4gR2VuZXJhbGx5LCB0
aGUgVmlydGlvIGJhY2tlbmRzIGFyZSBpbXBsZW1lbnRlZCB0byB3b3JrIHdpdGggdGhlIEV2
ZW50ZmQNCj4gYmFzZWQgbWVjaGFuaXNtLiBJbiBvcmRlciB0byBtYWtlIHN1Y2ggYmFja2Vu
ZHMgd29yayB3aXRoIFhlbiwgYW5vdGhlcg0KPiBzb2Z0d2FyZSBsYXllciBuZWVkcyB0byBw
b2xsIHRoZSBFdmVudGZkcyBhbmQgcmFpc2UgYW4gaW50ZXJydXB0IHRvIHRoZQ0KPiBndWVz
dCB1c2luZyB0aGUgWGVuIGJhc2VkIG1lY2hhbmlzbS4gVGhpcyByZXN1bHRzIGluIGFuIGV4
dHJhIGNvbnRleHQNCj4gc3dpdGNoLg0KPiANCj4gVGhpcyBpcyBub3QgYSBuZXcgcHJvYmxl
bSBpbiBMaW51eCB0aG91Z2guIEl0IGlzIHByZXNlbnQgd2l0aCBvdGhlcg0KPiBoeXBlcnZp
c29ycyBsaWtlIEtWTSwgZXRjLiBhcyB3ZWxsLiBUaGUgZ2VuZX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kZGl0aW9uYWwgY29kZSBm
b3IgZXZlcnlvbmUuDQoNCg0KSnVlcmdlbg0K
--------------dN83e0dptSsRjzwwXIJxoum7
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5RnNVUJbvoPHZ8SlM4KWm8rG+lIkGurq
qu5gu8q8ZMKdsdGC4bBxdQKDKHEFExLJK/nRPFmAuGlId1E3fe10v5QL+qHI3EIP
tyfE7i9Hz6rVwi7lWKgh7pe0ZvatAudZ+JNIlBKptb64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7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------dN83e0dptSsRjzwwXIJxoum7--

--------------cU0FjSzGoxJGMDvaoRzrxGMA--

--------------0pVDYdB0AhBfd9mnjxflwa0K
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmS/iu0FAwAAAAAACgkQsN6d1ii/Ey8L
ZAgAgGWQ0HJDC93HDXPsqUP9EcQznNgD/sLKmwPOK44NADZZQZbVsnQBCUWM07L10NMR2DHXrczI
pR/G/PEXWQwT+taHkSgYnsacP2u2toXo0YT6bez76Ycg2SaDV/CWHZXJHNJC3tasajgqP15+xPvo
M0OSufBdOAVNHjNrp+L03AgeCBPW6wIdd/2i298Z7e4T9OmWPjC3wzKPRNIz/x5ikfP9v1bwp/Sa
ZB0n91pKvs0Md6OeNE0+dcK0F1WNojvX637J809uFgI+CokLfTyEKt/QQ9V/aHHKadlgQDRJ1sb0
h6sk3nYDlLpWJc5p4HAT0kRqNp/FHsLzzO+4YZGASQ==
=OaDI
-----END PGP SIGNATURE-----

--------------0pVDYdB0AhBfd9mnjxflwa0K--


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 08:43:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 08:43:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569543.890375 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qODe7-0002Jm-EE; Tue, 25 Jul 2023 08:43:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569543.890375; Tue, 25 Jul 2023 08:43:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qODe7-0002Jf-Bi; Tue, 25 Jul 2023 08:43:55 +0000
Received: by outflank-mailman (input) for mailman id 569543;
 Tue, 25 Jul 2023 08:43:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BzC/=DL=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qODe6-0002JX-0P
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 08:43:54 +0000
Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com
 [2a00:1450:4864:20::22c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 624e52a0-2ac7-11ee-b23d-6b7b168915f2;
 Tue, 25 Jul 2023 10:43:53 +0200 (CEST)
Received: by mail-lj1-x22c.google.com with SMTP id
 38308e7fff4ca-2b9338e4695so77079871fa.2
 for <xen-devel@lists.xenproject.org>; Tue, 25 Jul 2023 01:43:53 -0700 (PDT)
Received: from [192.168.202.116] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 h8-20020a2e9ec8000000b002b6efce3f54sm3374404ljk.123.2023.07.25.01.43.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 25 Jul 2023 01:43:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 624e52a0-2ac7-11ee-b23d-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690274633; x=1690879433;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=aHaat45Ng8OamlXU6VLPk832wooGU9Zg94nTarMt7F4=;
        b=smMrtBiq7wTuyIdetfmdRsBqAeMTLnzj2hCg7Af1rMuc9sv+ql+nQNRLDUqgMaiVGm
         P5Jp30Rx0vpTEtWy9+6hFQo3Vl+MT+AIfCWdtnEteflo9VZkyndcL3lga5Mh2uChd9/P
         B/EB16+K5nWEQcpbHM08m5ZW+PoPgKUD6lTsUhLcrEgTvNKshhtjjHdlbHjvC68XAYTU
         75G3I5JZjJiUKZZtH5mdc8+ilFZ+PzRvAFubahSEKGXkjTMVMh+mzlcQFGdZANrJ3RV5
         JaELGiYfGcba4k6bEAHJ1bVY9j00G3dwtcl+88KPxqt+CClUH/eI5YPbPiSYs4bHFBhH
         QduA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690274633; x=1690879433;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=aHaat45Ng8OamlXU6VLPk832wooGU9Zg94nTarMt7F4=;
        b=OpgXWTFfiRAHsUwYqJFzlNP2ypt8fKPg5JyizAQFZ4imZ+4okv7889ZrRlS//RqJKa
         B6L+Et/8fIFJNG6uJoNmU+zlL//gd5pBrNzn1euCZiIZnoH9zy/jaAsi/SK9ODqYV2Lq
         BctneC0na/G9euUbUDnDtyvfcuLtTufCuD8dxrFCEwxWKsy1RP3mCSFw1nmYU5u5eLV4
         mJLsIyn9ztWYMhSMnO+8sOGpXCq8fsMtltQMY0l8cVoYalKOCdjcv4NgkDZb5Voj+xSf
         XDvdZ7ceKwyR8Gkbaoihjv4Slf+bqKkRd2IuWtckZ5DjTC2IcZYLvEp3LS+ZdKYTgcjq
         AXjg==
X-Gm-Message-State: ABy/qLb16U4DmZmlQCGe0SFPWWgZZVlUYgHrgjcRrBUA5dkQ1qniKBMM
	IB/FQ6ohI7kfXodTmkRS9Hk=
X-Google-Smtp-Source: APBJJlG7S/zg7foFO7C/BxkZfvTtGJ199qtuAP7Y0bCvZmpd9ybMdLvMds1s3uqsv1jsoFTElSN4hw==
X-Received: by 2002:a2e:92d0:0:b0:2b4:7c31:ab8a with SMTP id k16-20020a2e92d0000000b002b47c31ab8amr6991443ljh.23.1690274632451;
        Tue, 25 Jul 2023 01:43:52 -0700 (PDT)
Message-ID: <43701a3fcebf4ddc66defef9a6d5bacd6df876bb.camel@gmail.com>
Subject: Re: [PATCH v3] ns16550: add support for polling mode when device
 tree is used
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap
 <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
Date: Tue, 25 Jul 2023 11:43:51 +0300
In-Reply-To: <004fa0af-105b-63eb-2abc-53b0cbcfaef7@suse.com>
References: 
	<d929b43814e6e1a247b954c4be40a35d61b6a45a.1690208840.git.oleksii.kurochko@gmail.com>
	 <be0c9eb8-6561-f6bc-ff76-a1bfeaeaab9d@suse.com>
	 <ab9e7a3f3b5faa4805b5b2c8ffc985bc3330c4a3.camel@gmail.com>
	 <004fa0af-105b-63eb-2abc-53b0cbcfaef7@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: base64
User-Agent: Evol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ZyBtb2RlIGluCmNhc2Ug
b2YgWDg2IHdoZW4gcG9sbGluZyBtb2RlIGlzIGZvcmNlZCBieSBjb21tYW5kIGxpbmU6CiAgICBp
ZiAoICggdWFydC0+aXJxID09IDB4ZmYgKSB8fCAodWFydC0+aW50cl93b3JrcyA9PSBwb2xsaW5n
KSApCiAgICB7CiAgICAgICAgdWFydC0+aXJxID0gMDsKICAgICAgICB1YXJ0LT5pbnRyX3dvcmtz
ID0gcG9sbGluZzsKICAgIH0KQnV0IHRoaXMgY2hlY2sgbG9va3MgYSBsaXR0bGUgYml0IHVubmVj
ZXNzYXJ5IGJlY2F1c2UgaWYgdGhlIHBvbGxpbmcKbW9kZSBpcyBmb3JjZWQgb3Igbm90IHdpbGwg
YmUgY2hlY2tlZCBsYXRlciBpbiB0aGUgbmV4dCBpZiBjb25kaXRpb24uCgp+IE9sZWtzaWkK



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 08:55:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 08:55:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569546.890386 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qODp6-0003vi-LV; Tue, 25 Jul 2023 08:55:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569546.890386; Tue, 25 Jul 2023 08:55:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qODp6-0003vb-IU; Tue, 25 Jul 2023 08:55:16 +0000
Received: by outflank-mailman (input) for mailman id 569546;
 Tue, 25 Jul 2023 08:55:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=A3G+=DL=citrix.com=prvs=56320e048=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qODp4-0003vV-Ro
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 08:55:15 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f67daa67-2ac8-11ee-b23d-6b7b168915f2;
 Tue, 25 Jul 2023 10:55:12 +0200 (CEST)
Received: from mail-bn7nam10lp2102.outbound.protection.outlook.com (HELO
 NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.102])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 25 Jul 2023 04:55:10 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by BN9PR03MB6122.namprd03.prod.outlook.com (2603:10b6:408:11b::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 08:55:07 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6609.031; Tue, 25 Jul 2023
 08:55:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f67daa67-2ac8-11ee-b23d-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690275312;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=lBPEo/uJxTIuULngR3ksXbeE4m0VS67ZkS5B6xpjoAc=;
  b=B9Q0DDOxIb1qZrj3vNdX33RfCc/VKUH6/8Mto8hC5NyJLz76ieYJIxen
   T/UlP5npC7tj87lVxQWfE/aONuyqSk3u864KnkeOKE/TcYcXrhEZi+1/D
   5qsfHvbIFNOAkpmSiCLBWVL3MED3XegSwd/8THcRJEDhOcAOwHax1LjD0
   4=;
X-IronPort-RemoteIP: 104.47.70.102
X-IronPort-MID: 117209085
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:Ox9926JeRjYbbDYxFE+R9ZQlxSXFcZb7ZxGr2PjKsXjdYENShjdTn
 WJOW2jTM6qKMTDxe9h/PIi0oUtS7MXTmNdmGQZlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws
 Jb5rta31GWNglaYCUpKrfrawP9TlK6q4mhA4QZjPakjUGL2zBH5MrpOfcldEFOgKmVkNrbSb
 /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/
 jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5eJ0hC8
 +YjOAsqSU+GuMec0Oq4d8lz05FLwMnDZOvzu1lG5BSAVbMMZ8+GRK/Ho9hFwD03m8ZCW+7EY
 NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE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0X2cPdlzurTCGj+1f7jG8nNitHxVsr1Cf7ELQsEM1mPcU
 frGgKDafl90g==
X-Talos-CUID: 9a23:Y7zl3GDXD/NsGmf6EwBB3UISAPs1SVr6k3LvBmWoUWVUaKLAHA==
X-Talos-MUID: 9a23:rzvrRwt2Yz2tdqZpvc2num0yMdhT8pyVJwMoi5wsl/CAGXNqEmLI
X-IronPort-AV: E=Sophos;i="6.01,230,1684814400"; 
   d="scan'208";a="117209085"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=RUfEWuStQz0E5f0BvUI+JdYdmpQ6ijfkLzj7XflszIB01f0z7QDBFibt3GbPe+tlCYdnAwEMsLf8N5wZqZBurX9yr6OsS3T2RHtKglQwEwbqM09yjtcNidnGN5ULpKa0mhHHy09kLVqwz2r2qerO1U1GdzQ0pZic5UEdABvquMVbjr3ajZTebS9sN0GNhACri8S5KAp9RTqoSUQUpLNQPaaew7raPlaDVIXBmKLXvuCP0T/aeNeIARbJ4Hkvitg1KIuhqNLqYVxn6fR6G3qiFWDZX/vdhxi7kOs0lrKm+e34l5t4z2U0KMk5oZc6QTjeZKFp3Uc7FXef6v8+ybSClQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=6VHiboYJH7PGBirLkgaxzMQSUIp5GNznCnvhD78UPtU=;
 b=cHS6DBZ4mVGVOe4DTzXZapO4DhdtcrhXQOPUPfEfiwvBZRcit9SRUuPOtDOjAFJt7/KZETGZLZfavrqlRoRyhLEopXOGRdIoqWbGkLykiOmsmCfKKIHH/RktaCp0ZlLuHQG6fMvSxzrEFNjJTKfAQBkJUjcKWUVRjst4zhOfYoJYuV6q0ZIWpb6LR5wezylz/DcL3X6VgfVgqU25HwsBSot89/fBNJlj1DBNasyHCAXvMjt+M0gm8SKjEpH0X/Ggr7qbtqGVh5qqyxOc82aDmNrFSpY3CCsY8kPy6ZpTdgaJmilYLXnaIOjIfEMTzYg6m1Z3qI10biQoDKDIFTjagw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=6VHiboYJH7PGBirLkgaxzMQSUIp5GNznCnvhD78UPtU=;
 b=v/3XW0dxtXyB7msDuoUrDCjc0Eqa4HpuqM2q6JjYneBH5WhUoKskFSR/iW7Vs0i3OA4d89aK2mtgZk7Rof2GOLypHdjG8zSZX03L8Mgu3mgjq86JdQOhXrbk2VfcU+GzT9d42CQHAxwBabZpR+6xoLR7HiBysjaXqFS3b7Jt76U=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Tue, 25 Jul 2023 10:55:01 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v3 3/6] libxl: introduce MSR data in libxl_cpuid_policy
Message-ID: <ZL-N5cHkbcusnKqb@MacBook-Air-de-Roger.local>
References: <20230720082540.69444-1-roger.pau@citrix.com>
 <20230720082540.69444-4-roger.pau@citrix.com>
 <022263eb-e10d-4e76-8fdc-2f64ecbb347d@perard>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <022263eb-e10d-4e76-8fdc-2f64ecbb347d@perard>
X-ClientProxiedBy: LO2P265CA0212.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:9e::32) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|BN9PR03MB6122:EE_
X-MS-Office365-Filtering-Correlation-Id: 46abaf0f-35aa-4c40-5cb3-08db8cecd845
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	lf3ctseIEgT1oAWtwsNcmFTxBLVMAYrl70t8CnCYwn9LtWMx/R03pvJj+m+awASN/D+xPkh9kbXLShSC/fgH2HjNpr4xeNdXn1cx/OS2fNWXOAf1fGx0lONZ1aTUKCSSPsvrzckpOahxyDyYboeul5r9WfWyYElZYSxCtbhY+DiRDEfGCTX4e0VPDtHbLGO7EUZzE9qKY16Vn1YSov9l6zwdt9x6uNvnyNPmQa1GlfsXb+fm7rH8nbLreDEUgGWgTb7C+Rxs+KDMP8gnQLzuEL0VwTnAcaI4aq8VHrnfMB5psuUsgBh+HZUt+F1IBjxSmw3F1/6ZuxS6dNGChv4M47FGNq5uVi7J8551zvldnsi0VJ8Cy9vL/keg033v7fImv0icXk4L03hxrFRQKiYAD7vgkPLGa56Mrl9irDIDICXmuNYGXDK2bsP9TqiCefBqMGqq+XEPMGYpEXKoHIZkWjhwCDBs7tAaC/GZIsYxQNvIxWC6RRvR099rJhMPlKZKo32L+2PtPQol//bmX5n5zoOSMKBQ/EJaq8d6r3QZHShPdNapf95bC6EIUFer5lDx
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(396003)(136003)(39860400002)(376002)(346002)(451199021)(26005)(186003)(6506007)(4326008)(66946007)(6636002)(8936002)(66556008)(316002)(66476007)(6862004)(41300700001)(8676002)(6666004)(6512007)(5660300002)(6486002)(9686003)(2906002)(478600001)(54906003)(82960400001)(38100700002)(86362001)(85182001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bXA4bVlma29iQVFsMWtiUFF2UDdOWW94ZW1mNVhUYjhQREJMU3U3eXRPemNk?=
 =?utf-8?B?N1prYlhXeENuaStzejZieUNhL3hLelRoOXhUUXBseVBWZ3NVSnlidXJHelZo?=
 =?utf-8?B?SkpsMUN0S1VHZ0NEa3hEdTkzZDU2YzBFQWhPTncxNmFSaHlidEkrK1NWYnZo?=
 =?utf-8?B?YkdqQ2NEckZ0VHhwYVc3MkdIN0xyYWJVY0hITE5CQkp4OFhOL2pMYjl4RGJi?=
 =?utf-8?B?RHVTT1JQMjdjcWZ0T0V4cTdDcGNSbEx2dUFUaWMwT0U2T2dJc0dCaTkxVG1V?=
 =?utf-8?B?b2psWDV2SFVmblM3QVJ2YTlxUm9xN0Z3aWhnRlJlUkRER05NbUtzNVQ5enFk?=
 =?utf-8?B?bEI3Ti9tbEc4dFdRMzhiNWpzRkl5K3AzU3FxS3ZGREM2MEpVd3FpcXl6d3lH?=
 =?utf-8?B?OER0MnVSNGVlOHNXcEVGYi9zTDNWK3JMQk1tdytHM0Y3MVVtTkRSRWxseTR2?=
 =?utf-8?B?NE1oWUNndnJTWTFralB0NU1DZ2duZFAxem05UmZUK29vQWlpamQxd3AyQ2gy?=
 =?utf-8?B?aVNYRkdOYlVpUFpmaXBISmMrUllGZmZhUk50dkFtcHcraHhUR0U4NUNKdWZs?=
 =?utf-8?B?WDA1YkNKMnlPS2FWYlRJMmt0bkZZUmdNcWdXY0QvcnI1bjRKS3lsSmFqQXpK?=
 =?utf-8?B?L3RXWjN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on5rFUTbuaeUHWHAvzEm2GfPcowxpaPm1CJs6PL2wG7uJ9luxzgaitTIaEky2aTYpwgg5HsiH9Mm88B8sIeIOHDDRr4AQ+meCUrfIUppqAg4E33PSD4tUFbX3zwR2os8fQdbr5GoLJyGljfvMONMGHHyMbnlhmmeQ1Oedan3E0kU1FwLVNw4uLgg792cSwZKCcP+YuhjyGuzgcKWLkS+hIv7dOCVJlc3G4VVexnATT5BsEULn8B54io11foxqsp6pwOSMwLKYYjOUMepuf/PVL2kCETC/Mw941OtBu5Wrmg18ZP8oGnqS18KWcwsfksDWCwW/RErqgGiBCuE46BlmGArWnjCJ4kJB7Cudhic8cADu2VTVJV6WikC2nI0iwI11veCS8125icBqFpbzwchJjLiUHepdlG6XRFmVKl8g4modLiSKJv4dyCRfZIh6JCLd8+kb4hwTKbJ1zZhXQxB2fKh2ZTZpMwk6sJ2M8DnF7UbvIzQp0Ggf4DO9sJncopqTbmuWpKBpQmkW0pEQactaA5pLEYHDmaqbe/4E6DP39Y6uuGr7pG7EQ+qQlC2AR24pnqflxBMhpKkSWxaWlhFimYu/jUxr7Ny40d30QI1uZoxNMennWutATti/1PvvDL
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 46abaf0f-35aa-4c40-5cb3-08db8cecd845
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 08:55:07.4313
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: z3Z8GlSuPSNvBP3oWsRSmVUhuM1wM4DVXzdyIOlMjsba+OqLOtsedxqUJ+l5FOnM3L/ObhMITawWtFrCMI+kiA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR03MB6122

On Mon, Jul 24, 2023 at 06:26:42PM +0100, Anthony PERARD wrote:
> On Thu, Jul 20, 2023 at 10:25:37AM +0200, Roger Pau Monne wrote:
> > ---
> > It would be nice to rename the json output field to 'cpu_policy'
> > instead of 'cpuid', so that it looks like:
> > 
> > "cpu_policy": {
> >     "cpuid": [
> >         {
> >             "leaf": 7,
> >             "subleaf": 0,
> >             "edx": "xx1xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
> >         },
> >         {
> >             "leaf": 1,
> >             "ebx": "xxxxxxxxxxxxxxxx00010000xxxxxxxx"
> >         }
> >         }
> >         }
> >     ],
> >     "msr": [
> >         {
> >             "index": 266,
> >             "policy": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1xx1x1"
> >         }
> >     ]
> > },
> > 
> > Sadly I have no idea how to do that, and can be done in a followup
> > change anyway.
> 
> I don't think that would be possible. I think that would mean renaming
> the field in "struct libxl_domain_build_info", and changing a fields
> name seems complicated.

I did wonder whether it would be possible to change the json field
name without changing the libxl_domain_build_info field name, but that
would need a lot of special casing AFAICT.

> > diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
> > index 3c8b2a72c0b8..68b797886642 100644
> > --- a/tools/libs/light/libxl_cpuid.c
> > +++ b/tools/libs/light/libxl_cpuid.c
> > @@ -592,17 +641,24 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
> >  {
> >      int i, size;
> >      struct xc_xend_cpuid *l;
> > +    struct xc_msr *msr;
> > +    const libxl__json_object *co;
> >      flexarray_t *array;
> >  
> > -    if (!libxl__json_object_is_array(o))
> > +    if (!libxl__json_object_is_map(o))
> >          return ERROR_FAIL;
> 
> We still need to be able to migrate a VM from a previous release of Xen,
> and we are going to have an array instead of a map. Could you try to
> handle both the old and new format of "cpuid"? If we don't then the
> scenario "migrate then reboot" is going to fail to use the expected cpu
> policy.
> 
> > diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
> > index 9e48bb772646..887824fdd828 100644
> > --- a/tools/libs/light/libxl_types.idl
> > +++ b/tools/libs/light/libxl_types.idl
> > @@ -19,7 +19,7 @@ libxl_mac = Builtin("mac", json_parse_type="JSON_STRING", passby=PASS_BY_REFEREN
> >  libxl_bitmap = Builtin("bitmap", json_parse_type="JSON_ARRAY", dispose_fn="libxl_bitmap_dispose", passby=PASS_BY_REFERENCE,
> >                         check_default_fn="libxl_bitmap_is_empty", copy_fn="libxl_bitmap_copy_alloc")
> >  libxl_cpuid_policy_list = Builtin("cpuid_policy_list", dispose_fn="libxl_cpuid_dispose", passby=PASS_BY_REFERENCE,
> > -                                  json_parse_type="JSON_ARRAY", check_default_fn="libxl__cpuid_policy_is_empty",
> > +                                  json_parse_type="JSON_MAP", check_default_fn="libxl__cpuid_policy_is_empty",
> 
> Maybe we should have json_parse_type as either "JSON_ARRAY | JSON_MAP"
> or just "JSON_ANY" since nothing beside libxl is supposed to do
> something with it, and when migrating from a previous version, we are
> going to have an array.

Yeah, we need to use JSON_ANY and then guess the version by whether
the object is an array or a map.

That should be easy to arrange, let me prepare v4.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 09:03:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 09:03:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569558.890396 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qODwi-0005Rf-Cf; Tue, 25 Jul 2023 09:03:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569558.890396; Tue, 25 Jul 2023 09:03:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qODwi-0005RY-9q; Tue, 25 Jul 2023 09:03:08 +0000
Received: by outflank-mailman (input) for mailman id 569558;
 Tue, 25 Jul 2023 09:03:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+ZC3=DL=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qODwg-0005RR-DX
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 09:03:07 +0000
Received: from out-18.mta1.migadu.com (out-18.mta1.migadu.com [95.215.58.18])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 105efce5-2aca-11ee-b23d-6b7b168915f2;
 Tue, 25 Jul 2023 11:03:04 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 105efce5-2aca-11ee-b23d-6b7b168915f2
Message-ID: <3648ca69-d65e-8431-135a-a5738586bc25@linux.dev>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690275782;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=jkjBh/Kp2KZsbd5A9bxpjAJZxN02Eft+lFTspqPnOCk=;
	b=C86+NnAgVOWWduY0bypLj9pEd8+f7K2hQWQRdMiOl+4lNoex/sNqQF/OzRY+XF6R/pQj3x
	RJfrwmBw/U62Xz7gGIQfDrsff33dmTRFy6JUY2ZoASoV8vvmjWXkOHfSOC62P8ONIDS3dq
	14Z/qjc5TC07VTaeF50qDKBsNsdzhz4=
Date: Tue, 25 Jul 2023 17:02:47 +0800
MIME-Version: 1.0
Subject: Re: [PATCH v2 03/47] mm: shrinker: add infrastructure for dynamically
 allocating shrinker
To: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz,
 roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org,
 paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com, cel@kernel.org,
 senozhatsky@chromium.org, yujie.liu@intel.com, gregkh@linuxfoundation.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-4-zhengqi.arch@bytedance.com>
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-4-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Migadu-Flow: FLOW_OUT



On 2023/7/24 17:43, Qi Zheng wrote:
> Currently, the shrinker instances can be divided into the following three
> types:
>
> a) global shrinker instance statically defined in the kernel, such as
>     workingset_shadow_shrinker.
>
> b) global shrinker instance statically defined in the kernel modules, such
>     as mmu_shrinker in x86.
>
> c) shrinker instance embedded in other structures.
>
> For case a, the memory of shrinker instance is never freed. For case b,
> the memory of shrinker instance will be freed after synchronize_rcu() when
> the module is unloaded. For case c, the memory of shrinker instance will
> be freed along with the structure it is embedded in.
>
> In preparation for implementing lockless slab shrink, we need to
> dynamically allocate those shrinker instances in case c, then the memory
> can be dynamically freed alone by calling kfree_rcu().
>
> So this commit adds the following new APIs for dynamically allocating
> shrinker, and add a private_data field to struct shrinker to record and
> get the original embedded structure.
>
> 1. shrinker_alloc()
>
> Used to allocate shrinker instance itself and related memory, it will
> return a pointer to the shrinker instance on success and NULL on failure.
>
> 2. shrinker_free_non_registered()
>
> Used to destroy the non-registered shrinker instance.

At least I don't like this name. I know you want to tell others
this function only should be called when shrinker has not been
registed but allocated. Maybe shrinker_free() is more simple.
And and a comment to tell the users when to use it.

>
> 3. shrinker_register()
>
> Used to register the shrinker instance, which is same as the current
> register_shrinker_prepared().
>
> 4. shrinker_unregister()
>
> Used to unregister and free the shrinker instance.
>
> In order to simplify shrinker-related APIs and make shrinker more
> independent of other kernel mechanisms, subsequent submissions will use
> the above API to convert all shrinkers (including case a and b) to
> dynamically allocated, and then remove all existing APIs.
>
> This will also have another advantage mentioned by Dave Chinner:
>
> ```
> The other advantage of this is that it will break all the existing
> out of tree code and third party modules using the old API and will
> no longer work with a kernel using lockless slab shrinkers. They
> need to break (both at the source and binary levels) to stop bad
> things from happening due to using uncoverted shrinkers in the new
> setup.
> ```
>
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> ---
>   include/linux/shrinker.h |   6 +++
>   mm/shrinker.c            | 113 +++++++++++++++++++++++++++++++++++++++
>   2 files changed, 119 insertions(+)
>
> diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
> index 961cb84e51f5..296f5e163861 100644
> --- a/include/linux/shrinker.h
> +++ b/include/linux/shrinker.h
> @@ -70,6 +70,8 @@ struct shrinker {
>   	int seeks;	/* seeks to recreate an obj */
>   	unsigned flags;
>   
> +	void *private_data;
> +
>   	/* These are for internal use */
>   	struct list_head list;
>   #ifdef CONFIG_MEMCG
> @@ -98,6 +100,10 @@ struct shrinker {
>   
>   unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
>   			  int priority);
> +struct shrinker *shrinker_alloc(unsigned int flags, const char *fmt, ...);
> +void shrinker_free_non_registered(struct shrinker *shrinker);
> +void shrinker_register(struct shrinker *shrinker);
> +void shrinker_unregister(struct shrinker *shrinker);
>   
>   extern int __printf(2, 3) prealloc_shrinker(struct shrinker *shrinker,
>   					    const char *fmt, ...);
> diff --git a/mm/shrinker.c b/mm/shrinker.c
> index 0a32ef42f2a7..d820e4cc5806 100644
> --- a/mm/shrinker.c
> +++ b/mm/shrinker.c
> @@ -548,6 +548,119 @@ unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
>   	return freed;
>   }
>   
> +struct shrinker *shrinker_alloc(unsigned int flags, const char *fmt, ...)
> +{
> +	struct shrinker *shrinker;
> +	unsigned int size;
> +	va_list __maybe_unused ap;
> +	int err;
> +
> +	shrinker = kzalloc(sizeof(struct shrinker), GFP_KERNEL);
> +	if (!shrinker)
> +		return NULL;
> +
> +#ifdef CONFIG_SHRINKER_DEBUG
> +	va_start(ap, fmt);
> +	shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
> +	va_end(ap);
> +	if (!shrinker->name)
> +		goto err_name;
> +#endif

So why not introduce another helper to handle this and declare it
as a void function when !CONFIG_SHRINKER_DEBUG? Something like the
following:

#ifdef CONFIG_SHRINKER_DEBUG
static int shrinker_debugfs_name_alloc(struct shrinker *shrinker, const 
char *fmt,
 Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â  Â Â Â Â  va_list vargs)

{
 Â Â Â  shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, vargs);
 Â Â Â  return shrinker->name ? 0 : -ENOMEM;
}
#else
static int shrinker_debugfs_name_alloc(struct shrinker *shrinker, const 
char *fmt,
 Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â  Â Â Â Â  va_list vargs)
{
 Â Â Â  return 0;
}
#endif

> +	shrinker->flags = flags;
> +
> +	if (flags & SHRINKER_MEMCG_AWARE) {
> +		err = prealloc_memcg_shrinker(shrinker);
> +		if (err == -ENOSYS)
> +			shrinker->flags &= ~SHRINKER_MEMCG_AWARE;
> +		else if (err == 0)
> +			goto done;
> +		else
> +			goto err_flags;
> +	}
> +
> +	/*
> +	 * The nr_deferred is available on per memcg level for memcg aware
> +	 * shrinkers, so only allocate nr_deferred in the following cases:
> +	 *  - non memcg aware shrinkers
> +	 *  - !CONFIG_MEMCG
> +	 *  - memcg is disabled by kernel command line
> +	 */
> +	size = sizeof(*shrinker->nr_deferred);
> +	if (flags & SHRINKER_NUMA_AWARE)
> +		size *= nr_node_ids;
> +
> +	shrinker->nr_deferred = kzalloc(size, GFP_KERNEL);
> +	if (!shrinker->nr_deferred)
> +		goto err_flags;
> +
> +done:
> +	return shrinker;
> +
> +err_flags:
> +#ifdef CONFIG_SHRINKER_DEBUG
> +	kfree_const(shrinker->name);
> +	shrinker->name = NULL;

This could be shrinker_debugfs_name_free()

> +err_name:
> +#endif
> +	kfree(shrinker);
> +	return NULL;
> +}
> +EXPORT_SYMBOL(shrinker_alloc);
> +
> +void shrinker_free_non_registered(struct shrinker *shrinker)
> +{
> +#ifdef CONFIG_SHRINKER_DEBUG
> +	kfree_const(shrinker->name);
> +	shrinker->name = NULL;

This could be shrinker_debugfs_name_free()

> +#endif
> +	if (shrinker->flags & SHRINKER_MEMCG_AWARE) {
> +		down_write(&shrinker_rwsem);
> +		unregister_memcg_shrinker(shrinker);
> +		up_write(&shrinker_rwsem);
> +	}
> +
> +	kfree(shrinker->nr_deferred);
> +	shrinker->nr_deferred = NULL;
> +
> +	kfree(shrinker);
> +}
> +EXPORT_SYMBOL(shrinker_free_non_registered);
> +
> +void shrinker_register(struct shrinker *shrinker)
> +{
> +	down_write(&shrinker_rwsem);
> +	list_add_tail(&shrinker->list, &shrinker_list);
> +	shrinker->flags |= SHRINKER_REGISTERED;
> +	shrinker_debugfs_add(shrinker);
> +	up_write(&shrinker_rwsem);
> +}
> +EXPORT_SYMBOL(shrinker_register);
> +
> +void shrinker_unregister(struct shrinker *shrinker)

You have made all shrinkers to be dynamically allocated, so
we should prevent users from allocating shrinkers statically and
use this function to unregister it. It is better to add a
flag like SHRINKER_ALLOCATED which is set in shrinker_alloc(),
and check whether it is set in shrinker_unregister(), if not
maybe a warning should be added to tell the users what happened.

> +{
> +	struct dentry *debugfs_entry;
> +	int debugfs_id;
> +
> +	if (!shrinker || !(shrinker->flags & SHRINKER_REGISTERED))
> +		return;
> +
> +	down_write(&shrinker_rwsem);
> +	list_del(&shrinker->list);
> +	shrinker->flags &= ~SHRINKER_REGISTERED;
> +	if (shrinker->flags & SHRINKER_MEMCG_AWARE)
> +		unregister_memcg_shrinker(shrinker);
> +	debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);

In the internal of this function, you also could use
shrinker_debugfs_name_free().

Thanks.

> +	up_write(&shrinker_rwsem);
> +
> +	shrinker_debugfs_remove(debugfs_entry, debugfs_id);
> +
> +	kfree(shrinker->nr_deferred);
> +	shrinker->nr_deferred = NULL;
> +
> +	kfree(shrinker);
> +}
> +EXPORT_SYMBOL(shrinker_unregister);
> +
>   /*
>    * Add a shrinker callback to be called from the vm.
>    */



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 09:09:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 09:09:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569561.890408 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOE2m-000650-1c; Tue, 25 Jul 2023 09:09:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569561.890408; Tue, 25 Jul 2023 09:09:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOE2l-00064t-VH; Tue, 25 Jul 2023 09:09:23 +0000
Received: by outflank-mailman (input) for mailman id 569561;
 Tue, 25 Jul 2023 09:09:23 +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
 <SRS0=1Iib=DL=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qOE2l-00064n-76
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 09:09:23 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ece9c984-2aca-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 11:09:14 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.161.75.91])
 by support.bugseng.com (Postfix) with ESMTPSA id D6EDD4EE0739;
 Tue, 25 Jul 2023 11:09:17 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ece9c984-2aca-11ee-8613-37d641c3527e
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH v2] xen/sched: mechanical renaming to address MISRA C:2012 Rule 5.3
Date: Tue, 25 Jul 2023 11:08:39 +0200
Message-Id: <0b489f53751f8f7e80a7be85eb832f90bcadcbb0.1690272371.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rule 5.3 has the following headline:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope"

The renaming s/sched_id/scheduler_id/ of the function defined in
'xen/common/sched/core.c' prevents any hiding of that function
by the instances of homonymous function parameters that
are defined in inner scopes.

Similarly, the renames
- s/ops/operations/ for the static variable in 'xen/common/sched/core.c'
- s/do_softirq/needs_softirq/
are introduced for variables, to avoid any conflict with homonymous
parameters or function identifiers.

Moreover, the variable 'loop' defined at 'xen/common/sched/credit2.c:3887'
has been dropped, in favour of the homonymous variable declared in the
outer scope. This in turn requires a modification of the printk call that
involves it.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
Changes in v2:
- s/softirq/needs_softirq/
- Dropped local variable 'it'
- Renamed the 'ops' static variable instead of function parameters
in the idle scheduler for coherence.
---
 xen/common/sched/core.c    | 35 ++++++++++++++++++-----------------
 xen/common/sched/credit2.c |  9 +++++----
 xen/common/sysctl.c        |  2 +-
 xen/include/xen/sched.h    |  2 +-
 4 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 022f548652..ed977ddfd5 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -91,7 +91,7 @@ extern const struct scheduler *__start_schedulers_array[], *__end_schedulers_arr
 #define NUM_SCHEDULERS (__end_schedulers_array - __start_schedulers_array)
 #define schedulers __start_schedulers_array
 
-static struct scheduler __read_mostly ops;
+static struct scheduler __read_mostly operations;
 
 static bool scheduler_active;
 
@@ -99,14 +99,15 @@ static void sched_set_affinity(
     struct sched_unit *unit, const cpumask_t *hard, const cpumask_t *soft);
 
 static struct sched_resource *cf_check
-sched_idle_res_pick(const struct scheduler *ops, const struct sched_unit *unit)
+sched_idle_res_pick(
+    const struct scheduler *ops, const struct sched_unit *unit)
 {
     return unit->res;
 }
 
 static void *cf_check
-sched_idle_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
-                       void *dd)
+sched_idle_alloc_udata(
+    const struct scheduler *ops, struct sched_unit *unit, void *dd)
 {
     /* Any non-NULL pointer is fine here. */
     return ZERO_BLOCK_PTR;
@@ -171,7 +172,7 @@ static inline struct scheduler *dom_scheduler(const struct domain *d)
      * is the default scheduler that has been, choosen at boot.
      */
     ASSERT(is_idle_domain(d));
-    return &ops;
+    return &operations;
 }
 
 static inline struct scheduler *unit_scheduler(const struct sched_unit *unit)
@@ -2040,10 +2041,10 @@ long do_set_timer_op(s_time_t timeout)
     return 0;
 }
 
-/* sched_id - fetch ID of current scheduler */
-int sched_id(void)
+/* scheduler_id - fetch ID of current scheduler */
+int scheduler_id(void)
 {
-    return ops.sched_id;
+    return operations.sched_id;
 }
 
 /* Adjust scheduling parameter for a given domain. */
@@ -2579,7 +2580,7 @@ static void cf_check sched_slave(void)
     struct sched_unit    *prev = vprev->sched_unit, *next;
     s_time_t              now;
     spinlock_t           *lock;
-    bool                  do_softirq = false;
+    bool                  needs_softirq = false;
     unsigned int          cpu = smp_processor_id();
 
     ASSERT_NOT_IN_ATOMIC();
@@ -2604,7 +2605,7 @@ static void cf_check sched_slave(void)
             return;
         }
 
-        do_softirq = true;
+        needs_softirq = true;
     }
 
     if ( !prev->rendezvous_in_cnt )
@@ -2614,7 +2615,7 @@ static void cf_check sched_slave(void)
         rcu_read_unlock(&sched_res_rculock);
 
         /* Check for failed forced context switch. */
-        if ( do_softirq )
+        if ( needs_softirq )
             raise_softirq(SCHEDULE_SOFTIRQ);
 
         return;
@@ -3016,14 +3017,14 @@ void __init scheduler_init(void)
         BUG_ON(!scheduler);
         printk("Using '%s' (%s)\n", scheduler->name, scheduler->opt_name);
     }
-    ops = *scheduler;
+    operations = *scheduler;
 
     if ( cpu_schedule_up(0) )
         BUG();
     register_cpu_notifier(&cpu_schedule_nfb);
 
-    printk("Using scheduler: %s (%s)\n", ops.name, ops.opt_name);
-    if ( sched_init(&ops) )
+    printk("Using scheduler: %s (%s)\n", operations.name, operations.opt_name);
+    if ( sched_init(&operations) )
         panic("scheduler returned error on init\n");
 
     if ( sched_ratelimit_us &&
@@ -3363,7 +3364,7 @@ int schedule_cpu_rm(unsigned int cpu, struct cpu_rm_data *data)
 
 struct scheduler *scheduler_get_default(void)
 {
-    return &ops;
+    return &operations;
 }
 
 struct scheduler *scheduler_alloc(unsigned int sched_id)
@@ -3392,7 +3393,7 @@ struct scheduler *scheduler_alloc(unsigned int sched_id)
 
 void scheduler_free(struct scheduler *sched)
 {
-    BUG_ON(sched == &ops);
+    BUG_ON(sched == &operations);
     sched_deinit(sched);
     xfree(sched);
 }
@@ -3416,7 +3417,7 @@ void schedule_dump(struct cpupool *c)
     }
     else
     {
-        sched = &ops;
+        sched = &operations;
         cpus = &cpupool_free_cpus;
     }
 
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 87a1e31ee9..0a76652a66 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -3809,7 +3809,8 @@ csched2_dump(const struct scheduler *ops)
     struct list_head *iter_sdom;
     struct csched2_private *prv = csched2_priv(ops);
     unsigned long flags;
-    unsigned int j, loop;
+    unsigned int loop;
+    int j;
     struct csched2_runqueue_data *rqd;
 
     /*
@@ -3874,7 +3875,7 @@ csched2_dump(const struct scheduler *ops)
 
             lock = unit_schedule_lock(unit);
 
-            printk("\t%3d: ", ++loop);
+            printk("\t%3u: ", ++loop);
             csched2_dump_unit(prv, svc);
 
             unit_schedule_unlock(lock, unit);
@@ -3884,7 +3885,7 @@ csched2_dump(const struct scheduler *ops)
     list_for_each_entry ( rqd, &prv->rql, rql )
     {
         struct list_head *iter, *runq = &rqd->runq;
-        int loop = 0;
+        loop = 0;
 
         /* We need the lock to scan the runqueue. */
         spin_lock(&rqd->lock);
@@ -3901,7 +3902,7 @@ csched2_dump(const struct scheduler *ops)
 
             if ( svc )
             {
-                printk("\t%3d: ", loop++);
+                printk("\t%3u: ", loop++);
                 csched2_dump_unit(prv, svc);
             }
         }
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 0cbfe8bd44..7cabfb0230 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -71,7 +71,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         break;
 
     case XEN_SYSCTL_sched_id:
-        op->u.sched_id.sched_id = sched_id();
+        op->u.sched_id.sched_id = scheduler_id();
         break;
 
     case XEN_SYSCTL_getdomaininfolist:
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 854f3e32c0..bfe714d2e2 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -791,7 +791,7 @@ int  sched_init_domain(struct domain *d, unsigned int poolid);
 void sched_destroy_domain(struct domain *d);
 long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *);
 long sched_adjust_global(struct xen_sysctl_scheduler_op *);
-int  sched_id(void);
+int  scheduler_id(void);
 
 /*
  * sched_get_id_by_name - retrieves a scheduler id given a scheduler name
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 09:17:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 09:17:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569574.890421 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOEAT-0007eR-VR; Tue, 25 Jul 2023 09:17:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569574.890421; Tue, 25 Jul 2023 09:17:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOEAT-0007eK-Sj; Tue, 25 Jul 2023 09:17:21 +0000
Received: by outflank-mailman (input) for mailman id 569574;
 Tue, 25 Jul 2023 09:17:20 +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
 <SRS0=+ZC3=DL=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOEAS-0007e6-9l
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 09:17:20 +0000
Received: from out-29.mta1.migadu.com (out-29.mta1.migadu.com [95.215.58.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 08390092-2acc-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 11:17:09 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 08390092-2acc-11ee-8613-37d641c3527e
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690276634;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=LkxORCEddVXylYLMZWxeVj/rzxAJufQsQsoKMX9s7XM=;
	b=GyQLyI1D1TTXamIiZSPpttowrS97LQ+Cvba3kwh3HO3Mr0wmyVIbpLLBPb98H+kjVW5rA+
	/zd7C2ydW45ZzgH545IUXQ8vSPh6L3WEGSQz1gl3354IzH/cv4sDH5rzcHYAT/4O8ESTlb
	D32dfiCpfyNxorLxCJCQE9t24/FgOFc=
MIME-Version: 1.0
Subject: Re: [PATCH v2 04/47] kvm: mmu: dynamically allocate the x86-mmu
 shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-5-zhengqi.arch@bytedance.com>
Date: Tue, 25 Jul 2023 17:16:24 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>,
 yujie.liu@intel.com,
 Greg KH <gregkh@linuxfoundation.org>,
 LKML <linux-kernel@vger.kernel.org>,
 Linux Memory Management List <linux-mm@kvack.org>,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev <netdev@vger.kernel.org>,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <AA25C9A6-B2F4-44B4-AF31-B2A2C2A1F867@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-5-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> Use new APIs to dynamically allocate the x86-mmu shrinker.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 09:17:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 09:17:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569576.890432 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOEAt-00087G-6k; Tue, 25 Jul 2023 09:17:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569576.890432; Tue, 25 Jul 2023 09:17:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOEAt-000879-3U; Tue, 25 Jul 2023 09:17:47 +0000
Received: by outflank-mailman (input) for mailman id 569576;
 Tue, 25 Jul 2023 09:17:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=1Iib=DL=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qOEAr-000841-M3
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 09:17:45 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1ce6aef5-2acc-11ee-b23d-6b7b168915f2;
 Tue, 25 Jul 2023 11:17:44 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.161.75.91])
 by support.bugseng.com (Postfix) with ESMTPSA id 45FA94EE0739;
 Tue, 25 Jul 2023 11:17:42 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1ce6aef5-2acc-11ee-b23d-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH v2] xen/spinlock: mechanically rename parameter name 'debug'
Date: Tue, 25 Jul 2023 11:17:02 +0200
Message-Id: <87c0f41e43a1c95ef7d8923c77a2072eb9baee96.1690276551.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rule 5.3 has the following headline:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope"

To avoid any confusion resulting from the parameter 'debug'
hiding the homonymous function declared at
'xen/arch/x86/include/asm/processor.h:428'
the rename of parameters s/debug/lkdbg/ is performed.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
Changes in v2:
- s/dbg/lkdbg/
---
 xen/common/spinlock.c      | 38 +++++++++++++++++++-------------------
 xen/include/xen/spinlock.h |  6 +++---
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index 7f453234a9..56813d4594 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -78,7 +78,7 @@ static int __init cf_check lockdebug_init(void)
 }
 presmp_initcall(lockdebug_init);
 
-void check_lock(union lock_debug *debug, bool try)
+void check_lock(union lock_debug *lkdbg, bool try)
 {
     bool irq_safe = !local_irq_is_enabled();
     unsigned int cpu = smp_processor_id();
@@ -118,12 +118,12 @@ void check_lock(union lock_debug *debug, bool try)
     if ( try && irq_safe )
         return;
 
-    if ( unlikely(debug->irq_safe != irq_safe) )
+    if ( unlikely(lkdbg->irq_safe != irq_safe) )
     {
         union lock_debug seen, new = { 0 };
 
         new.irq_safe = irq_safe;
-        seen.val = cmpxchg(&debug->val, LOCK_DEBUG_INITVAL, new.val);
+        seen.val = cmpxchg(&lkdbg->val, LOCK_DEBUG_INITVAL, new.val);
 
         if ( !seen.unseen && seen.irq_safe == !irq_safe )
         {
@@ -137,14 +137,14 @@ void check_lock(union lock_debug *debug, bool try)
         return;
 
     for ( i = 0; i < nr_taken; i++ )
-        if ( taken[i] == debug )
+        if ( taken[i] == lkdbg )
         {
-            printk("CHECKLOCK FAILURE: lock at %p taken recursively\n", debug);
+            printk("CHECKLOCK FAILURE: lock at %p taken recursively\n", lkdbg);
             BUG();
         }
 }
 
-static void check_barrier(union lock_debug *debug)
+static void check_barrier(union lock_debug *dbg)
 {
     if ( unlikely(atomic_read(&spin_debug) <= 0) )
         return;
@@ -160,10 +160,10 @@ static void check_barrier(union lock_debug *debug)
      * However, if we spin on an IRQ-unsafe lock with IRQs disabled then that
      * is clearly wrong, for the same reason outlined in check_lock() above.
      */
-    BUG_ON(!local_irq_is_enabled() && !debug->irq_safe);
+    BUG_ON(!local_irq_is_enabled() && !dbg->irq_safe);
 }
 
-void lock_enter(const union lock_debug *debug)
+void lock_enter(const union lock_debug *lkdbg)
 {
     unsigned int cpu = smp_processor_id();
     const union lock_debug **taken = per_cpu(locks_taken, cpu);
@@ -176,7 +176,7 @@ void lock_enter(const union lock_debug *debug)
     local_irq_save(flags);
 
     if ( *nr_taken < lock_depth_size )
-        taken[(*nr_taken)++] = debug;
+        taken[(*nr_taken)++] = lkdbg;
     else if ( !max_depth_reached )
     {
         max_depth_reached = true;
@@ -187,7 +187,7 @@ void lock_enter(const union lock_debug *debug)
     local_irq_restore(flags);
 }
 
-void lock_exit(const union lock_debug *debug)
+void lock_exit(const union lock_debug *lkdbg)
 {
     unsigned int cpu = smp_processor_id();
     const union lock_debug **taken = per_cpu(locks_taken, cpu);
@@ -202,7 +202,7 @@ void lock_exit(const union lock_debug *debug)
 
     for ( i = *nr_taken; i > 0; i-- )
     {
-        if ( taken[i - 1] == debug )
+        if ( taken[i - 1] == lkdbg )
         {
             memmove(taken + i - 1, taken + i,
                     (*nr_taken - i) * sizeof(*taken));
@@ -217,28 +217,28 @@ void lock_exit(const union lock_debug *debug)
 
     if ( !max_depth_reached )
     {
-        printk("CHECKLOCK released lock at %p not recorded!\n", debug);
+        printk("CHECKLOCK released lock at %p not recorded!\n", lkdbg);
         WARN();
     }
 
     local_irq_restore(flags);
 }
 
-static void got_lock(union lock_debug *debug)
+static void got_lock(union lock_debug *dbg)
 {
-    debug->cpu = smp_processor_id();
+    dbg->cpu = smp_processor_id();
 
-    lock_enter(debug);
+    lock_enter(dbg);
 }
 
-static void rel_lock(union lock_debug *debug)
+static void rel_lock(union lock_debug *dbg)
 {
     if ( atomic_read(&spin_debug) > 0 )
-        BUG_ON(debug->cpu != smp_processor_id());
+        BUG_ON(dbg->cpu != smp_processor_id());
 
-    lock_exit(debug);
+    lock_exit(dbg);
 
-    debug->cpu = SPINLOCK_NO_CPU;
+    dbg->cpu = SPINLOCK_NO_CPU;
 }
 
 void spin_debug_enable(void)
diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index 0a02a527dc..464af705eb 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -22,9 +22,9 @@ union lock_debug {
     };
 };
 #define _LOCK_DEBUG { LOCK_DEBUG_INITVAL }
-void check_lock(union lock_debug *debug, bool try);
-void lock_enter(const union lock_debug *debug);
-void lock_exit(const union lock_debug *debug);
+void check_lock(union lock_debug *lkdbg, bool try);
+void lock_enter(const union lock_debug *lkdbg);
+void lock_exit(const union lock_debug *lkdbg);
 void spin_debug_enable(void);
 void spin_debug_disable(void);
 #else
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 09:20:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 09:20:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569581.890442 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOEDT-0001Bf-Je; Tue, 25 Jul 2023 09:20:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569581.890442; Tue, 25 Jul 2023 09:20:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOEDT-0001BY-H4; Tue, 25 Jul 2023 09:20:27 +0000
Received: by outflank-mailman (input) for mailman id 569581;
 Tue, 25 Jul 2023 09:20:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+ZC3=DL=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOEDS-0001BR-SY
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 09:20:26 +0000
Received: from out-26.mta0.migadu.com (out-26.mta0.migadu.com
 [2001:41d0:1004:224b::1a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7ca1e757-2acc-11ee-b23d-6b7b168915f2;
 Tue, 25 Jul 2023 11:20:25 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7ca1e757-2acc-11ee-b23d-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690276823;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=lWqqPzpNBtB6jTVVrWh0b/e9soljzkJiIrV3enhBysE=;
	b=hQXVvzFcrWWWpy9SLwyFzJJZuDADbBS2OdiYg60cVhz1X3iYVafxnHWqF9F5gbQE+t5rUv
	I46fSuLx9fxRRB/KaBl036o5sGpNNMaguRBPQls2fbyMfQnAsVHD21W1LE1DjorXmO7V65
	cgmVLn1Ua4w1+HIDSsYSdCmvQqociDo=
MIME-Version: 1.0
Subject: Re: [PATCH v2 06/47] drm/ttm: dynamically allocate the drm-ttm_pool
 shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-7-zhengqi.arch@bytedance.com>
Date: Tue, 25 Jul 2023 17:19:40 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 senozhatsky@chromium.org,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <1A349AE9-C4B3-42EB-B2D6-018583CCB102@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-7-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> Use new APIs to dynamically allocate the drm-ttm_pool shrinker.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 09:22:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 09:22:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569583.890453 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOEFf-0001jT-1T; Tue, 25 Jul 2023 09:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569583.890453; Tue, 25 Jul 2023 09:22:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOEFe-0001jM-So; Tue, 25 Jul 2023 09:22:42 +0000
Received: by outflank-mailman (input) for mailman id 569583;
 Tue, 25 Jul 2023 09:22:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+ZC3=DL=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOEFd-0001jG-IZ
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 09:22:41 +0000
Received: from out-53.mta1.migadu.com (out-53.mta1.migadu.com [95.215.58.53])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cd548b28-2acc-11ee-b23d-6b7b168915f2;
 Tue, 25 Jul 2023 11:22:40 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cd548b28-2acc-11ee-b23d-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690276959;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=O0aj+CEvUWLWW/lym+SjHnwm8OSi0vQ8fgtochDa6Vs=;
	b=xJfsnq4tfri4+FrxQ/wgEMA3zFz0o0z0uW0gHHJCvckela5K3HUZXJd8znm8ohjnxlmbHS
	uH4lNpUNfMnIh4HG6zSYXwQDD4QbiVOnWxcUq/Ckyge75DILepht+8WUJVUEtTuA6yQWPk
	2nBkRdUkFluXDihkXSSSRwQEBatV+pk=
MIME-Version: 1.0
Subject: Re: [PATCH v2 07/47] xenbus/backend: dynamically allocate the
 xen-backend shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-8-zhengqi.arch@bytedance.com>
Date: Tue, 25 Jul 2023 17:22:00 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 senozhatsky@chromium.org,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <CD39258F-AAA8-42A7-BBA9-6528A629B315@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-8-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> Use new APIs to dynamically allocate the xen-backend shrinker.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 09:25:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 09:25:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569586.890462 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOEI2-0002KQ-CN; Tue, 25 Jul 2023 09:25:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569586.890462; Tue, 25 Jul 2023 09:25:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOEI2-0002KJ-9V; Tue, 25 Jul 2023 09:25:10 +0000
Received: by outflank-mailman (input) for mailman id 569586;
 Tue, 25 Jul 2023 09:25:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+ZC3=DL=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOEI1-0002KB-Gr
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 09:25:09 +0000
Received: from out-1.mta1.migadu.com (out-1.mta1.migadu.com [95.215.58.1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 25ea3045-2acd-11ee-b23d-6b7b168915f2;
 Tue, 25 Jul 2023 11:25:09 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 25ea3045-2acd-11ee-b23d-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690277108;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=+8cgQl/NwKjlv95whhBvr3/hIEapF8k47N3p7suJb70=;
	b=usOR6hHD6eRCxqjCTCcivuGWvHVkYPEcYN1LFGUp7w19ZF5rgZGS7F3BC9qYg1mh2K3CZg
	P+ggLeAhjwkMLLXjRaq6w6val5oNQN/dZHMaY89bOfIaUuCQCvzNHzHVmmvDvSO+waObUp
	Ejvejxqj/KUxQq2De9wkuBcRQhJyUA4=
MIME-Version: 1.0
Subject: Re: [PATCH v2 08/47] erofs: dynamically allocate the erofs-shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-9-zhengqi.arch@bytedance.com>
Date: Tue, 25 Jul 2023 17:24:24 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 senozhatsky@chromium.org,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <0C8B4C97-C8DF-401D-83E9-A13AE69E73F0@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-9-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> Use new APIs to dynamically allocate the erofs-shrinker.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 09:26:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 09:26:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569588.890472 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOEIz-0002r2-Mw; Tue, 25 Jul 2023 09:26:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569588.890472; Tue, 25 Jul 2023 09:26:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOEIz-0002qv-JB; Tue, 25 Jul 2023 09:26:09 +0000
Received: by outflank-mailman (input) for mailman id 569588;
 Tue, 25 Jul 2023 09:26:08 +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
 <SRS0=+ZC3=DL=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOEIy-0002qd-9X
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 09:26:08 +0000
Received: from out-24.mta1.migadu.com (out-24.mta1.migadu.com
 [2001:41d0:203:375::18])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 47f70ce4-2acd-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 11:26:06 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 47f70ce4-2acd-11ee-8613-37d641c3527e
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690277165;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=kJwBPug4K2o2Rsg3Nl512ID6Vx26wyYZeksPouOPBIo=;
	b=UsXWV/BrmTb/Mzt4qG2L6aakkxaQdFwUIWYXPaL2lks9qA3so8IOOprpfwKsyfOszGQNhK
	441qHddwlHklaskCeo1UAHikFDlDH211gEZQvhiMM0ozG4kf9A5oDb6k5ulzt7O+uqRDww
	PXrlU0RxHN6exb+unDnSMMStapEjRew=
MIME-Version: 1.0
Subject: Re: [PATCH v2 09/47] f2fs: dynamically allocate the f2fs-shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-10-zhengqi.arch@bytedance.com>
Date: Tue, 25 Jul 2023 17:25:26 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <3D511473-EBD7-4FDF-B85E-AD911A31A260@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-10-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> Use new APIs to dynamically allocate the f2fs-shrinker.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 09:56:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 09:56:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569594.890482 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOEmf-0006LE-VQ; Tue, 25 Jul 2023 09:56:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569594.890482; Tue, 25 Jul 2023 09:56:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOEmf-0006L7-Rq; Tue, 25 Jul 2023 09:56:49 +0000
Received: by outflank-mailman (input) for mailman id 569594;
 Tue, 25 Jul 2023 09:56:48 +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
 <SRS0=8+K8=DL=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOEme-0006L1-Ig
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 09:56:48 +0000
Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com
 [2607:f8b0:4864:20::102d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8f7ff890-2ad1-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 11:56:45 +0200 (CEST)
Received: by mail-pj1-x102d.google.com with SMTP id
 98e67ed59e1d1-2659b1113c2so706752a91.1
 for <xen-devel@lists.xenproject.org>; Tue, 25 Jul 2023 02:56:44 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020a170902da8800b001b39ffff838sm10605398plx.25.2023.07.25.02.56.31
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 25 Jul 2023 02:56:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8f7ff890-2ad1-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690279003; x=1690883803;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=/casiWQBa8FLPDyI/Gjog1Q/iFy65e/7JWaM5Gwrppw=;
        b=kzP9jxhdW7EUIP2JpY6nQ4V3KB8KzHZHwXd+bJOEeLU9gCN3lvtKTIOyV+D6pg6POw
         Q2+Agk0fHs6Wf0nJIf8rf8T9VZNFr/hsapg2zga11FSk7AOs0JkWfaLjemq0FDeG0Uw5
         HhEk2mitTuKDolaaQqjf+O9IL+c+U5F1pPsQI+4eucs75jhsRhGM9fqq3uQDPTEvroq0
         /U4/CVAvtL3Xk0W286vaVtW9MXQ1p85A5kNQw+kxMFfLtXWo8Tn1go6QyxS1jqmnrw9a
         uFzHc2WhcIqVkW0xdKzdkJ+42hQ6tNSe2IXCsgIEyfURXIjl60ODrk022w8+JVfo8hQI
         ne/Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690279003; x=1690883803;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=/casiWQBa8FLPDyI/Gjog1Q/iFy65e/7JWaM5Gwrppw=;
        b=AEy+X146C6/o1uH5PpB5JalQlpn8yioBu9oD13jS9DafCsfXu2nFz2V5dL83qDqT1o
         EgpsR7ulcWuO3tnNSTiEMfp/ZM05z/go4LihjpuSm0Wuud7sFAF2dFMsSU+4K6EJJnwL
         z5rIEDCT4xEL0GfLCgreJGzDMN5xYuG69K91bRVR+kNjzSU0VTQLWFykEaZJGwAJnZPJ
         V4n5vdm26YSx5+dlGpO0DAEcH5xFcFXaqgPEnwlDoq11/pASTKJuwtgLbAIZ5uUq+xBk
         lm3aYDchIuUmdUvWNvLKcXCju6itgejTet9xCNmnGAoMfI/U86H1qfpc79i3Jb14M59M
         r0/Q==
X-Gm-Message-State: ABy/qLafQzV6rHH0oDGEqvYubzcXVx2hhU3j4TC3RW7O1NM+iGmJTiMU
	mgjhOnmJyn8FGYXkn1OX5mWZyw==
X-Google-Smtp-Source: APBJJlE4g3zxacKAsn4H4YysRKAp71VN9gqUpsqodFXfAXxBRsoAel6FjePiWo+WkUy1agkNvA6LJQ==
X-Received: by 2002:a17:90a:74cf:b0:268:196f:9656 with SMTP id p15-20020a17090a74cf00b00268196f9656mr4627258pjl.1.1690279003192;
        Tue, 25 Jul 2023 02:56:43 -0700 (PDT)
Message-ID: <c1a1952f-0c3e-2fa1-fdf9-8b3b8a592b23@bytedance.com>
Date: Tue, 25 Jul 2023 17:56:29 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 03/47] mm: shrinker: add infrastructure for dynamically
 allocating shrinker
Content-Language: en-US
To: Muchun Song <muchun.song@linux.dev>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz,
 roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org,
 paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com, cel@kernel.org,
 senozhatsky@chromium.org, yujie.liu@intel.com, gregkh@linuxfoundation.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-4-zhengqi.arch@bytedance.com>
 <3648ca69-d65e-8431-135a-a5738586bc25@linux.dev>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <3648ca69-d65e-8431-135a-a5738586bc25@linux.dev>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Muchun,

On 2023/7/25 17:02, Muchun Song wrote:
> 
> 
> On 2023/7/24 17:43, Qi Zheng wrote:
>> Currently, the shrinker instances can be divided into the following three
>> types:
>>
>> a) global shrinker instance statically defined in the kernel, such as
>> Â Â Â  workingset_shadow_shrinker.
>>
>> b) global shrinker instance statically defined in the kernel modules, 
>> such
>> Â Â Â  as mmu_shrinker in x86.
>>
>> c) shrinker instance embedded in other structures.
>>
>> For case a, the memory of shrinker instance is never freed. For case b,
>> the memory of shrinker instance will be freed after synchronize_rcu() 
>> when
>> the module is unloaded. For case c, the memory of shrinker instance will
>> be freed along with the structure it is embedded in.
>>
>> In preparation for implementing lockless slab shrink, we need to
>> dynamically allocate those shrinker instances in case c, then the memory
>> can be dynamically freed alone by calling kfree_rcu().
>>
>> So this commit adds the following new APIs for dynamically allocating
>> shrinker, and add a private_data field to struct shrinker to record and
>> get the original embedded structure.
>>
>> 1. shrinker_alloc()
>>
>> Used to allocate shrinker instance itself and related memory, it will
>> return a pointer to the shrinker instance on success and NULL on failure.
>>
>> 2. shrinker_free_non_registered()
>>
>> Used to destroy the non-registered shrinker instance.
> 
> At least I don't like this name. I know you want to tell others
> this function only should be called when shrinker has not been
> registed but allocated. Maybe shrinker_free() is more simple.
> And and a comment to tell the users when to use it.

OK, if no one else objects, I will change it to shrinker_free() in
the next version.

> 
>>
>> 3. shrinker_register()
>>
>> Used to register the shrinker instance, which is same as the current
>> register_shrinker_prepared().
>>
>> 4. shrinker_unregister()
>>
>> Used to unregister and free the shrinker instance.
>>
>> In order to simplify shrinker-related APIs and make shrinker more
>> independent of other kernel mechanisms, subsequent submissions will use
>> the above API to convert all shrinkers (including case a and b) to
>> dynamically allocated, and then remove all existing APIs.
>>
>> This will also have another advantage mentioned by Dave Chinner:
>>
>> ```
>> The other advantage of this is that it will break all the existing
>> out of tree code and third party modules using the old API and will
>> no longer work with a kernel using lockless slab shrinkers. They
>> need to break (both at the source and binary levels) to stop bad
>> things from happening due to using uncoverted shrinkers in the new
>> setup.
>> ```
>>
>> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
>> ---
>> Â  include/linux/shrinker.h |Â Â  6 +++
>> Â  mm/shrinker.cÂ Â Â Â Â Â Â Â Â Â Â  | 113 +++++++++++++++++++++++++++++++++++++++
>> Â  2 files changed, 119 insertions(+)
>>
>> diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
>> index 961cb84e51f5..296f5e163861 100644
>> --- a/include/linux/shrinker.h
>> +++ b/include/linux/shrinker.h
>> @@ -70,6 +70,8 @@ struct shrinker {
>> Â Â Â Â Â  int seeks;Â Â Â  /* seeks to recreate an obj */
>> Â Â Â Â Â  unsigned flags;
>> +Â Â Â  void *private_data;
>> +
>> Â Â Â Â Â  /* These are for internal use */
>> Â Â Â Â Â  struct list_head list;
>> Â  #ifdef CONFIG_MEMCG
>> @@ -98,6 +100,10 @@ struct shrinker {
>> Â  unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup 
>> *memcg,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  int priority);
>> +struct shrinker *shrinker_alloc(unsigned int flags, const char *fmt, 
>> ...);
>> +void shrinker_free_non_registered(struct shrinker *shrinker);
>> +void shrinker_register(struct shrinker *shrinker);
>> +void shrinker_unregister(struct shrinker *shrinker);
>> Â  extern int __printf(2, 3) prealloc_shrinker(struct shrinker *shrinker,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const char *fmt, ...);
>> diff --git a/mm/shrinker.c b/mm/shrinker.c
>> index 0a32ef42f2a7..d820e4cc5806 100644
>> --- a/mm/shrinker.c
>> +++ b/mm/shrinker.c
>> @@ -548,6 +548,119 @@ unsigned long shrink_slab(gfp_t gfp_mask, int 
>> nid, struct mem_cgroup *memcg,
>> Â Â Â Â Â  return freed;
>> Â  }
>> +struct shrinker *shrinker_alloc(unsigned int flags, const char *fmt, 
>> ...)
>> +{
>> +Â Â Â  struct shrinker *shrinker;
>> +Â Â Â  unsigned int size;
>> +Â Â Â  va_list __maybe_unused ap;
>> +Â Â Â  int err;
>> +
>> +Â Â Â  shrinker = kzalloc(sizeof(struct shrinker), GFP_KERNEL);
>> +Â Â Â  if (!shrinker)
>> +Â Â Â Â Â Â Â  return NULL;
>> +
>> +#ifdef CONFIG_SHRINKER_DEBUG
>> +Â Â Â  va_start(ap, fmt);
>> +Â Â Â  shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
>> +Â Â Â  va_end(ap);
>> +Â Â Â  if (!shrinker->name)
>> +Â Â Â Â Â Â Â  goto err_name;
>> +#endif
> 
> So why not introduce another helper to handle this and declare it
> as a void function when !CONFIG_SHRINKER_DEBUG? Something like the
> following:
> 
> #ifdef CONFIG_SHRINKER_DEBUG
> static int shrinker_debugfs_name_alloc(struct shrinker *shrinker, const 
> char *fmt,
>  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â  Â Â Â Â  va_list vargs)
> 
> {
>  Â Â Â  shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, vargs);
>  Â Â Â  return shrinker->name ? 0 : -ENOMEM;
> }
> #else
> static int shrinker_debugfs_name_alloc(struct shrinker *shrinker, const 
> char *fmt,
>  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â  Â Â Â Â  va_list vargs)
> {
>  Â Â Â  return 0;
> }
> #endif

Will do in the next version.

> 
>> +Â Â Â  shrinker->flags = flags;
>> +
>> +Â Â Â  if (flags & SHRINKER_MEMCG_AWARE) {
>> +Â Â Â Â Â Â Â  err = prealloc_memcg_shrinker(shrinker);
>> +Â Â Â Â Â Â Â  if (err == -ENOSYS)
>> +Â Â Â Â Â Â Â Â Â Â Â  shrinker->flags &= ~SHRINKER_MEMCG_AWARE;
>> +Â Â Â Â Â Â Â  else if (err == 0)
>> +Â Â Â Â Â Â Â Â Â Â Â  goto done;
>> +Â Â Â Â Â Â Â  else
>> +Â Â Â Â Â Â Â Â Â Â Â  goto err_flags;
>> +Â Â Â  }
>> +
>> +Â Â Â  /*
>> +Â Â Â Â  * The nr_deferred is available on per memcg level for memcg aware
>> +Â Â Â Â  * shrinkers, so only allocate nr_deferred in the following cases:
>> +Â Â Â Â  *Â  - non memcg aware shrinkers
>> +Â Â Â Â  *Â  - !CONFIG_MEMCG
>> +Â Â Â Â  *Â  - memcg is disabled by kernel command line
>> +Â Â Â Â  */
>> +Â Â Â  size = sizeof(*shrinker->nr_deferred);
>> +Â Â Â  if (flags & SHRINKER_NUMA_AWARE)
>> +Â Â Â Â Â Â Â  size *= nr_node_ids;
>> +
>> +Â Â Â  shrinker->nr_deferred = kzalloc(size, GFP_KERNEL);
>> +Â Â Â  if (!shrinker->nr_deferred)
>> +Â Â Â Â Â Â Â  goto err_flags;
>> +
>> +done:
>> +Â Â Â  return shrinker;
>> +
>> +err_flags:
>> +#ifdef CONFIG_SHRINKER_DEBUG
>> +Â Â Â  kfree_const(shrinker->name);
>> +Â Â Â  shrinker->name = NULL;
> 
> This could be shrinker_debugfs_name_free()

Will do.

> 
>> +err_name:
>> +#endif
>> +Â Â Â  kfree(shrinker);
>> +Â Â Â  return NULL;
>> +}
>> +EXPORT_SYMBOL(shrinker_alloc);
>> +
>> +void shrinker_free_non_registered(struct shrinker *shrinker)
>> +{
>> +#ifdef CONFIG_SHRINKER_DEBUG
>> +Â Â Â  kfree_const(shrinker->name);
>> +Â Â Â  shrinker->name = NULL;
> 
> This could be shrinker_debugfs_name_free()
> 
>> +#endif
>> +Â Â Â  if (shrinker->flags & SHRINKER_MEMCG_AWARE) {
>> +Â Â Â Â Â Â Â  down_write(&shrinker_rwsem);
>> +Â Â Â Â Â Â Â  unregister_memcg_shrinker(shrinker);
>> +Â Â Â Â Â Â Â  up_write(&shrinker_rwsem);
>> +Â Â Â  }
>> +
>> +Â Â Â  kfree(shrinker->nr_deferred);
>> +Â Â Â  shrinker->nr_deferred = NULL;
>> +
>> +Â Â Â  kfree(shrinker);
>> +}
>> +EXPORT_SYMBOL(shrinker_free_non_registered);
>> +
>> +void shrinker_register(struct shrinker *shrinker)
>> +{
>> +Â Â Â  down_write(&shrinker_rwsem);
>> +Â Â Â  list_add_tail(&shrinker->list, &shrinker_list);
>> +Â Â Â  shrinker->flags |= SHRINKER_REGISTERED;
>> +Â Â Â  shrinker_debugfs_add(shrinker);
>> +Â Â Â  up_write(&shrinker_rwsem);
>> +}
>> +EXPORT_SYMBOL(shrinker_register);
>> +
>> +void shrinker_unregister(struct shrinker *shrinker)
> 
> You have made all shrinkers to be dynamically allocated, so
> we should prevent users from allocating shrinkers statically and
> use this function to unregister it. It is better to add a
> flag like SHRINKER_ALLOCATED which is set in shrinker_alloc(),
> and check whether it is set in shrinker_unregister(), if not
> maybe a warning should be added to tell the users what happened.

Make sense, will do.

> 
>> +{
>> +Â Â Â  struct dentry *debugfs_entry;
>> +Â Â Â  int debugfs_id;
>> +
>> +Â Â Â  if (!shrinker || !(shrinker->flags & SHRINKER_REGISTERED))
>> +Â Â Â Â Â Â Â  return;
>> +
>> +Â Â Â  down_write(&shrinker_rwsem);
>> +Â Â Â  list_del(&shrinker->list);
>> +Â Â Â  shrinker->flags &= ~SHRINKER_REGISTERED;
>> +Â Â Â  if (shrinker->flags & SHRINKER_MEMCG_AWARE)
>> +Â Â Â Â Â Â Â  unregister_memcg_shrinker(shrinker);
>> +Â Â Â  debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);
> 
> In the internal of this function, you also could use
> shrinker_debugfs_name_free().

Yeah, will do.

Thanks,
Qi

> 
> Thanks.
> 
>> +Â Â Â  up_write(&shrinker_rwsem);
>> +
>> +Â Â Â  shrinker_debugfs_remove(debugfs_entry, debugfs_id);
>> +
>> +Â Â Â  kfree(shrinker->nr_deferred);
>> +Â Â Â  shrinker->nr_deferred = NULL;
>> +
>> +Â Â Â  kfree(shrinker);
>> +}
>> +EXPORT_SYMBOL(shrinker_unregister);
>> +
>> Â  /*
>> Â Â  * Add a shrinker callback to be called from the vm.
>> Â Â  */
> 


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 10:02:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 10:02:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569597.890491 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOErs-0007xC-KN; Tue, 25 Jul 2023 10:02:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569597.890491; Tue, 25 Jul 2023 10:02:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOErs-0007x5-HM; Tue, 25 Jul 2023 10:02:12 +0000
Received: by outflank-mailman (input) for mailman id 569597;
 Tue, 25 Jul 2023 10:02:10 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qOErq-0007wj-Qf
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 10:02:10 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qOErq-0005Lz-D1; Tue, 25 Jul 2023 10:02:10 +0000
Received: from 54-240-197-238.amazon.com ([54.240.197.238]
 helo=[192.168.17.43]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qOErq-0003We-7M; Tue, 25 Jul 2023 10:02:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=wGoXdfF1EiS7CrX0t1ZP3XO+ZNqo6NxN/lhPDW50POI=; b=BjLhj3gjGRqdCM/vBFNUj7wqvV
	R+6XR0tOTtLtdFITtTUG8kmnbk3waWNidPdf5LmofSbfdmeLSUskglUDZiQ8ThqWfqY3XqUvAKiGM
	Rx4VW0UYRteLaIpgSH2l8jyVfDGvHfobeH03QbmoaYFnjA/wZzx2HOqx43kup6e8wR24=;
Message-ID: <421bcc71-006f-af73-374a-b54266052a42@xen.org>
Date: Tue, 25 Jul 2023 11:02:08 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v2] device_tree: address violations of MISRA C:2012
 Rules 8.2 and 8.3
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com, Stefano Stabellini <sstabellini@kernel.org>
References: <502a92e9b53960a6b78fabb48d354cbb5bc1750c.1690187572.git.federico.serafini@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <502a92e9b53960a6b78fabb48d354cbb5bc1750c.1690187572.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Federico,

On 24/07/2023 09:40, Federico Serafini wrote:
> Give a name to unnamed parameters thus addressing violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names and types used in function
> declarations and the ones used in the corresponding function
> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
> ("All declarations of an object or function shall use the same names
> and type qualifiers").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> ---
> Changes in v2:
>    - improved consistency in parameter renaming.
> ---
>   xen/common/device_tree.c      | 24 ++++++++++++------------
>   xen/include/xen/device_tree.h | 16 ++++++++--------
>   2 files changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 0677193ab3..d52531dc9f 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -85,11 +85,11 @@ struct dt_bus
>       unsigned int (*get_flags)(const __be32 *addr);
>   };
>   
> -void dt_get_range(const __be32 **cell, const struct dt_device_node *np,
> +void dt_get_range(const __be32 **cellp, const struct dt_device_node *np,
>                     u64 *address, u64 *size)
>   {
> -    *address = dt_next_cell(dt_n_addr_cells(np), cell);
> -    *size = dt_next_cell(dt_n_size_cells(np), cell);
> +    *address = dt_next_cell(dt_n_addr_cells(np), cellp);
> +    *size = dt_next_cell(dt_n_size_cells(np), cellp);
>   }
>   
>   void dt_set_cell(__be32 **cellp, int size, u64 val)
> @@ -993,9 +993,9 @@ int dt_device_get_paddr(const struct dt_device_node *dev, unsigned int index,
>   }
>   
>   int dt_for_each_range(const struct dt_device_node *dev,
> -                      int (*cb)(const struct dt_device_node *,
> +                      int (*cb)(const struct dt_device_node *dev,
>                                   uint64_t addr, uint64_t length,
> -                                void *),
> +                                void *data),
>                         void *data)
>   {
>       const struct dt_device_node *parent = NULL;
> @@ -1164,7 +1164,7 @@ unsigned int dt_number_of_irq(const struct dt_device_node *device)
>       return (intlen / intsize);
>   }
>   
> -unsigned int dt_number_of_address(const struct dt_device_node *dev)
> +unsigned int dt_number_of_address(const struct dt_device_node *device)
We have a structure called 'device', so wouldn't this result to violate 
another MISRA rule because identifiers are re-used?

In any case, I would prefer if we keep the shorter version (i.e. 'dev') 
as this is more common within device_tree.c. We can replace the other 
'device' at a leisure pace.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 10:43:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 10:43:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569609.890501 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOFVR-00040Y-M5; Tue, 25 Jul 2023 10:43:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569609.890501; Tue, 25 Jul 2023 10:43:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOFVR-00040R-JS; Tue, 25 Jul 2023 10:43:05 +0000
Received: by outflank-mailman (input) for mailman id 569609;
 Tue, 25 Jul 2023 10:43:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOFVQ-00040H-Oz; Tue, 25 Jul 2023 10:43:04 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOFVQ-0006A6-M3; Tue, 25 Jul 2023 10:43:04 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOFVQ-0002eR-CP; Tue, 25 Jul 2023 10:43:04 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOFVQ-0003RL-A5; Tue, 25 Jul 2023 10:43:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=fYuAcepna1KAVA4aB9xXexfQgkwVyndNXPics8GSA4g=; b=QJreEFvXDOiAeGhkCK8nj5QnTD
	8J4NciD5nCvTJO6ZonZGsyFJTMi9553kVrbjZAIvRNYLUhYigKCUSJ0WienRaHsmYPU6H1NJsVcob
	a8BoGob1JB2DSRBYfck6ctKwtWzHtqR0LUTBC+8zUZZu/ALgi8WaEMMk7/OfSJh/7wb4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181994-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 181994: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-armhf-armhf-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-shadow:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-rtds:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-multivcpu:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-coresched-amd64-xl:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-freebsd11-amd64:guest-localmigrate:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-vhd:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-rtds:guest-start/debian.repeat:fail:allowable
    linux-linus:test-armhf-armhf-examine:reboot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:xen-boot:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=6eaae198076080886b9e7d57f4ae06fa782f90ef
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 25 Jul 2023 10:43:04 +0000

flight 181994 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181994/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-armhf-armhf-xl-credit1   8 xen-boot                 fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-shadow 20 guest-localmigrate/x10 fail in 181989 pass in 181994
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail in 181989 pass in 181994
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 18 guest-localmigrate/x10 fail in 181989 pass in 181994
 test-amd64-amd64-xl-rtds 20 guest-localmigrate/x10 fail in 181989 pass in 181994
 test-amd64-amd64-xl-multivcpu  8 xen-boot                  fail pass in 181989
 test-amd64-amd64-xl          20 guest-localmigrate/x10     fail pass in 181989
 test-amd64-coresched-amd64-xl 20 guest-localmigrate/x10    fail pass in 181989
 test-amd64-amd64-freebsd11-amd64 17 guest-localmigrate     fail pass in 181989
 test-amd64-amd64-xl-vhd      21 guest-start/debian.repeat  fail pass in 181989

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds    22 guest-start/debian.repeat fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-examine      8 reboot                       fail  like 180278
 test-armhf-armhf-xl-arndale   8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-raw  8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-credit2   8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl           8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt      8 xen-boot                     fail  like 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-armhf-armhf-xl-rtds      8 xen-boot                     fail  like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-armhf-armhf-xl-vhd       8 xen-boot                     fail  like 180278
 test-armhf-armhf-libvirt-qcow2  8 xen-boot                    fail like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                6eaae198076080886b9e7d57f4ae06fa782f90ef
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z   99 days
Failing since        180281  2023-04-17 06:24:36 Z   99 days  188 attempts
Testing same since   181989  2023-07-24 04:22:26 Z    1 days    2 attempts

------------------------------------------------------------
3818 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          fail    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                fail    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      fail    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 641607 lines long.)


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 10:44:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 10:44:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569613.890511 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOFWT-0004Vr-08; Tue, 25 Jul 2023 10:44:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569613.890511; Tue, 25 Jul 2023 10:44:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOFWS-0004Vk-Tg; Tue, 25 Jul 2023 10:44:08 +0000
Received: by outflank-mailman (input) for mailman id 569613;
 Tue, 25 Jul 2023 10:44:07 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOFWR-0004VT-PL; Tue, 25 Jul 2023 10:44:07 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOFWR-0006CQ-OT; Tue, 25 Jul 2023 10:44:07 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOFWR-0002jO-BB; Tue, 25 Jul 2023 10:44:07 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOFWR-0004Qk-Af; Tue, 25 Jul 2023 10:44:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=6ODv3fRc/wW6IHpaFTVdMdbVFp3Tz/II2Y0CK8w025M=; b=VAeDJqZSihGC0u0KkS5zk5+vc4
	SYGWivlyw4ssTVSdpIMthxf0JO+gStQTlC41ISmL7IDN0xQPAapKhSlO5NSh9hBx0rPW8IuNV+6LL
	o14IS9fFGFhaJAn3UJUBFZWu/zz8GSrk+n76BQ/lMUnsutEYpz3RXoCuyh4GkiOdjxS0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182009-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 182009: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-armhf-armhf-xl:xen-boot:fail:heisenbug
    xen-unstable-smoke:test-amd64-amd64-xl-qemuu-debianhvm-amd64:guest-localmigrate/x10:fail:heisenbug
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=0b1171be87698bc7d14760383c0770aeb6e41dd4
X-Osstest-Versions-That:
    xen=f91c5ea970675637721bb7f18adaa189837eb783
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 25 Jul 2023 10:44:07 +0000

flight 182009 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182009/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl           8 xen-boot         fail in 182002 pass in 182009
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 18 guest-localmigrate/x10 fail pass in 182002

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  0b1171be87698bc7d14760383c0770aeb6e41dd4
baseline version:
 xen                  f91c5ea970675637721bb7f18adaa189837eb783

Last test of basis   181999  2023-07-24 17:02:22 Z    0 days
Testing same since   182002  2023-07-25 01:03:53 Z    0 days    2 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   f91c5ea970..0b1171be87  0b1171be87698bc7d14760383c0770aeb6e41dd4 -> smoke


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 10:57:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 10:57:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569622.890522 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOFjU-00069j-53; Tue, 25 Jul 2023 10:57:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569622.890522; Tue, 25 Jul 2023 10:57:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOFjU-00069c-1r; Tue, 25 Jul 2023 10:57:36 +0000
Received: by outflank-mailman (input) for mailman id 569622;
 Tue, 25 Jul 2023 10:57:35 +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
 <SRS0=QXT9=DL=linaro.org=viresh.kumar@srs-se1.protection.inumbo.net>)
 id 1qOFjT-00069W-JY
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 10:57:35 +0000
Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com
 [2607:f8b0:4864:20::435])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0ddb4d70-2ada-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 12:57:32 +0200 (CEST)
Received: by mail-pf1-x435.google.com with SMTP id
 d2e1a72fcca58-666edfc50deso3493064b3a.0
 for <xen-devel@lists.xenproject.org>; Tue, 25 Jul 2023 03:57:33 -0700 (PDT)
Received: from localhost ([122.172.87.195]) by smtp.gmail.com with ESMTPSA id
 t10-20020a63954a000000b005634bd81331sm10135267pgn.72.2023.07.25.03.57.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 25 Jul 2023 03:57:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0ddb4d70-2ada-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690282651; x=1690887451;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=qvjHAYgSg2MMxQBr50LK2tzwYkNIQtvGXiVi72AP3w0=;
        b=HLDMMdXIrJ1dI47+4Zg3/qapw999XXjWIEaiDM5eyJuFhFlVcMDP6wYNjtKB9oQffF
         xVKSmRYoguqb4lhJD36rbSnCUK+UMvrhd+1JSAypmNurOblFUYAd1xoEyloAIudc2XEK
         rcNctVRYkdxD3W2EsTEA3YZ+ZUd+OyvSWlH4l18M8Ff6aoqnHLi6vzUVXo/1sW6xW+Zo
         g0N2biwqq9i8eJNNeJ4jj8AwKKIpXvye+x0YJKR5WhhWYQC1cCjvvhSSm+HSZNWhBn9o
         ECFSJ83ecRzhVrw0F9lTQgLJZwINZsfIbyWNXgL6J3w1C6qHisAWVmveJLH3zaIrCMKa
         pi/Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690282651; x=1690887451;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=qvjHAYgSg2MMxQBr50LK2tzwYkNIQtvGXiVi72AP3w0=;
        b=GQb2MGv2SExgBXuz3ME6fw6Qy/XhM20YFqhALMXrjETlaRFeKxlN6ftEKKcG4QnAiJ
         NzEbsKktR53zFroznviGFLPOf/bA/FafB771OgCwkOCU4rL4219M2oA3BQS2q6o20X5S
         2uU9HJm4WXiwWzKNUEh0e9/W2o1D/fhYi00nSejcFU+DRMlmE+JKQ0WW9ATljZCE+lkl
         tfIYAfDq8FRcvMIEk4i3Dft9RTScpWmhsIZvHJ5nkurCEXazXB8reDhgJ61AB2JawJsN
         xsQGdz+wLJq/MpPvD8o0mD2oUPVeaDRgFBoT62ZJy72OlDZHcS1TPaRQJqn7bi8oc6Hn
         ayoQ==
X-Gm-Message-State: ABy/qLaAl45G+435gj6JSore5rFp3lGItYRw6u4XWRRVUdm9cyBqd4bW
	LG25EtIYZ9m/ACPnDU7tKkx9TQ==
X-Google-Smtp-Source: APBJJlEDzn3s8/mi4yBlx3QnoIGh2Rt7Yx/UiabIGORbUqro3poYcn3j9w3qyV/VT+ToMRIMuoP5SQ==
X-Received: by 2002:a05:6a00:1ca0:b0:67a:20d0:b9bb with SMTP id y32-20020a056a001ca000b0067a20d0b9bbmr2453198pfw.1.1690282651561;
        Tue, 25 Jul 2023 03:57:31 -0700 (PDT)
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	=?UTF-8?q?Alex=20Benn=C3=A9e?= <alex.bennee@linaro.org>,
	stratos-dev@op-lists.linaro.org,
	Erik Schilling <erik.schilling@linaro.org>,
	Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	xen-devel@lists.xenproject.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH V4] xen: privcmd: Add support for irqfd
Date: Tue, 25 Jul 2023 16:27:26 +0530
Message-Id: <d783b8689395e60d0c314f9dad476443ca7773cf.1690282439.git.viresh.kumar@linaro.org>
X-Mailer: git-send-email 2.31.1.272.g89b43f80a514
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Xen provides support for injecting interrupts to the guests via the
HYPERVISOR_dm_op() hypercall. The same is used by the Virtio based
device backend implementations, in an inefficient manner currently.

Generally, the Virtio backends are implemented to work with the Eventfd
based mechanism. In order to make such backends work with Xen, another
software layer needs to poll the Eventfds and raise an interrupt to the
guest using the Xen based mechanism. This results in an extra context
switch.

This is not a new problem in Linux though. It is present with other
hypervisors like KVM, etc. as well. The generic solution implemented in
the kernel for them is to provide an IOCTL call to pass the interrupt
details and eventfd, which lets the kernel take care of polling the
eventfd and raising of the interrupt, instead of handling this in user
space (which involves an extra context switch).

This patch adds support to inject a specific interrupt to guest using
the eventfd mechanism, by preventing the extra context switch.

Inspired by existing implementations for KVM, etc..

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
V3->V4
- Drop the imported definitions to hvm/dm_op.h.
- Make the caller pass a pointer to pre-filled "struct xen_dm_op" instance and
  get rid of irq and level fields.
- Enable the irqfd feature under a new Kconfig entry.

V2->V3
- Select EVENTFD from Kconfig

V1->V2:
- Improve error handling.
- Remove the unnecessary usage of list_for_each_entry_safe().
- Restrict the use of XEN_DMOP_set_irq_level to only ARM64.
- Import definitions from Xen to hvm/dm_op.h.

 drivers/xen/Kconfig        |   8 ++
 drivers/xen/privcmd.c      | 286 ++++++++++++++++++++++++++++++++++++-
 include/uapi/xen/privcmd.h |  14 ++
 3 files changed, 306 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
index d5d7c402b651..c7fabfab4c20 100644
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
@@ -269,6 +269,14 @@ config XEN_PRIVCMD
 	  disaggregated Xen setups this driver might be needed for other
 	  domains, too.
 
+config XEN_PRIVCMD_IRQFD
+	bool "Xen irqfd support"
+	depends on XEN_PRIVCMD && XEN_VIRTIO && EVENTFD
+	default m
+	help
+	  irqfd is a mechanism to inject a specific interrupt to a User VM using
+	  a decoupled eventfd mechanism.
+
 config XEN_ACPI_PROCESSOR
 	tristate "Xen ACPI processor"
 	depends on XEN && XEN_PV_DOM0 && X86 && ACPI_PROCESSOR && CPU_FREQ
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index e2f580e30a86..584c8de56c5e 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -9,11 +9,16 @@
 
 #define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt
 
+#include <linux/eventfd.h>
+#include <linux/file.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/poll.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/string.h>
+#include <linux/workqueue.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
@@ -833,6 +838,267 @@ static long privcmd_ioctl_mmap_resource(struct file *file,
 	return rc;
 }
 
+#ifdef CONFIG_XEN_PRIVCMD_IRQFD
+/* Irqfd support */
+static struct workqueue_struct *irqfd_cleanup_wq;
+static DEFINE_MUTEX(irqfds_lock);
+static LIST_HEAD(irqfds_list);
+
+struct privcmd_kernel_irqfd {
+	struct xen_dm_op_buf xbufs;
+	domid_t dom;
+	bool error;
+	struct eventfd_ctx *eventfd;
+	struct work_struct shutdown;
+	wait_queue_entry_t wait;
+	struct list_head list;
+	poll_table pt;
+};
+
+static void irqfd_deactivate(struct privcmd_kernel_irqfd *kirqfd)
+{
+	lockdep_assert_held(&irqfds_lock);
+
+	list_del_init(&kirqfd->list);
+	queue_work(irqfd_cleanup_wq, &kirqfd->shutdown);
+}
+
+static void irqfd_shutdown(struct work_struct *work)
+{
+	struct privcmd_kernel_irqfd *kirqfd =
+		container_of(work, struct privcmd_kernel_irqfd, shutdown);
+	u64 cnt;
+
+	eventfd_ctx_remove_wait_queue(kirqfd->eventfd, &kirqfd->wait, &cnt);
+	eventfd_ctx_put(kirqfd->eventfd);
+	kfree(kirqfd);
+}
+
+static void irqfd_inject(struct privcmd_kernel_irqfd *kirqfd)
+{
+	u64 cnt;
+	long rc;
+
+	eventfd_ctx_do_read(kirqfd->eventfd, &cnt);
+
+	xen_preemptible_hcall_begin();
+	rc = HYPERVISOR_dm_op(kirqfd->dom, 1, &kirqfd->xbufs);
+	xen_preemptible_hcall_end();
+
+	/* Don't repeat the error message for consecutive failures */
+	if (rc && !kirqfd->error) {
+		pr_err("Failed to configure irq for guest domain: %d\n",
+		       kirqfd->dom);
+	}
+
+	kirqfd->error = !!rc;
+}
+
+static int
+irqfd_wakeup(wait_queue_entry_t *wait, unsigned int mode, int sync, void *key)
+{
+	struct privcmd_kernel_irqfd *kirqfd =
+		container_of(wait, struct privcmd_kernel_irqfd, wait);
+	__poll_t flags = key_to_poll(key);
+
+	if (flags & EPOLLIN)
+		irqfd_inject(kirqfd);
+
+	if (flags & EPOLLHUP) {
+		mutex_lock(&irqfds_lock);
+		irqfd_deactivate(kirqfd);
+		mutex_unlock(&irqfds_lock);
+	}
+
+	return 0;
+}
+
+static void
+irqfd_poll_func(struct file *file, wait_queue_head_t *wqh, poll_table *pt)
+{
+	struct privcmd_kernel_irqfd *kirqfd =
+		container_of(pt, struct privcmd_kernel_irqfd, pt);
+
+	add_wait_queue_priority(wqh, &kirqfd->wait);
+}
+
+static int privcmd_irqfd_assign(struct privcmd_irqfd *irqfd)
+{
+	struct privcmd_kernel_irqfd *kirqfd, *tmp;
+	struct eventfd_ctx *eventfd;
+	__poll_t events;
+	struct fd f;
+	void *dm_op;
+	int ret;
+
+	kirqfd = kzalloc(sizeof(*kirqfd) + irqfd->size, GFP_KERNEL);
+	if (!kirqfd)
+		return -ENOMEM;
+	dm_op = kirqfd + 1;
+
+	if (copy_from_user(dm_op, irqfd->dm_op, irqfd->size)) {
+		ret = -EFAULT;
+		goto error_kfree;
+	}
+
+	kirqfd->xbufs.size = irqfd->size;
+	set_xen_guest_handle(kirqfd->xbufs.h, dm_op);
+	kirqfd->dom = irqfd->dom;
+	INIT_LIST_HEAD(&kirqfd->list);
+	INIT_WORK(&kirqfd->shutdown, irqfd_shutdown);
+
+	f = fdget(irqfd->fd);
+	if (!f.file) {
+		ret = -EBADF;
+		goto error_kfree;
+	}
+
+	eventfd = eventfd_ctx_fileget(f.file);
+	if (IS_ERR(eventfd)) {
+		ret = PTR_ERR(eventfd);
+		goto error_fd_put;
+	}
+
+	kirqfd->eventfd = eventfd;
+
+	/*
+	 * Install our own custom wake-up handling so we are notified via a
+	 * callback whenever someone signals the underlying eventfd.
+	 */
+	init_waitqueue_func_entry(&kirqfd->wait, irqfd_wakeup);
+	init_poll_funcptr(&kirqfd->pt, irqfd_poll_func);
+
+	mutex_lock(&irqfds_lock);
+
+	list_for_each_entry(tmp, &irqfds_list, list) {
+		if (kirqfd->eventfd == tmp->eventfd) {
+			ret = -EBUSY;
+			mutex_unlock(&irqfds_lock);
+			goto error_eventfd;
+		}
+	}
+
+	list_add_tail(&kirqfd->list, &irqfds_list);
+	mutex_unlock(&irqfds_lock);
+
+	/*
+	 * Check if there was an event already pending on the eventfd before we
+	 * registered, and trigger it as if we didn't miss it.
+	 */
+	events = vfs_poll(f.file, &kirqfd->pt);
+	if (events & EPOLLIN)
+		irqfd_inject(kirqfd);
+
+	/*
+	 * Do not drop the file until the kirqfd is fully initialized, otherwise
+	 * we might race against the EPOLLHUP.
+	 */
+	fdput(f);
+	return 0;
+
+error_eventfd:
+	eventfd_ctx_put(eventfd);
+
+error_fd_put:
+	fdput(f);
+
+error_kfree:
+	kfree(kirqfd);
+	return ret;
+}
+
+static int privcmd_irqfd_deassign(struct privcmd_irqfd *irqfd)
+{
+	struct privcmd_kernel_irqfd *kirqfd;
+	struct eventfd_ctx *eventfd;
+
+	eventfd = eventfd_ctx_fdget(irqfd->fd);
+	if (IS_ERR(eventfd))
+		return PTR_ERR(eventfd);
+
+	mutex_lock(&irqfds_lock);
+
+	list_for_each_entry(kirqfd, &irqfds_list, list) {
+		if (kirqfd->eventfd == eventfd) {
+			irqfd_deactivate(kirqfd);
+			break;
+		}
+	}
+
+	mutex_unlock(&irqfds_lock);
+
+	eventfd_ctx_put(eventfd);
+
+	/*
+	 * Block until we know all outstanding shutdown jobs have completed so
+	 * that we guarantee there will not be any more interrupts once this
+	 * deassign function returns.
+	 */
+	flush_workqueue(irqfd_cleanup_wq);
+
+	return 0;
+}
+
+static long privcmd_ioctl_irqfd(struct file *file, void __user *udata)
+{
+	struct privcmd_data *data = file->private_data;
+	struct privcmd_irqfd irqfd;
+
+	if (copy_from_user(&irqfd, udata, sizeof(irqfd)))
+		return -EFAULT;
+
+	/* No other flags should be set */
+	if (irqfd.flags & ~PRIVCMD_IRQFD_FLAG_DEASSIGN)
+		return -EINVAL;
+
+	/* If restriction is in place, check the domid matches */
+	if (data->domid != DOMID_INVALID && data->domid != irqfd.dom)
+		return -EPERM;
+
+	if (irqfd.flags & PRIVCMD_IRQFD_FLAG_DEASSIGN)
+		return privcmd_irqfd_deassign(&irqfd);
+
+	return privcmd_irqfd_assign(&irqfd);
+}
+
+static int privcmd_irqfd_init(void)
+{
+	irqfd_cleanup_wq = alloc_workqueue("privcmd-irqfd-cleanup", 0, 0);
+	if (!irqfd_cleanup_wq)
+		return -ENOMEM;
+
+	return 0;
+}
+
+static void privcmd_irqfd_exit(void)
+{
+	struct privcmd_kernel_irqfd *kirqfd, *tmp;
+
+	mutex_lock(&irqfds_lock);
+
+	list_for_each_entry_safe(kirqfd, tmp, &irqfds_list, list)
+		irqfd_deactivate(kirqfd);
+
+	mutex_unlock(&irqfds_lock);
+
+	destroy_workqueue(irqfd_cleanup_wq);
+}
+#else
+static inline long privcmd_ioctl_irqfd(struct file *file, void __user *udata)
+{
+	return -EOPNOTSUPP;
+}
+
+static inline int privcmd_irqfd_init(void)
+{
+	return 0;
+}
+
+static inline void privcmd_irqfd_exit(void)
+{
+}
+#endif /* CONFIG_XEN_PRIVCMD_IRQFD */
+
 static long privcmd_ioctl(struct file *file,
 			  unsigned int cmd, unsigned long data)
 {
@@ -868,6 +1134,10 @@ static long privcmd_ioctl(struct file *file,
 		ret = privcmd_ioctl_mmap_resource(file, udata);
 		break;
 
+	case IOCTL_PRIVCMD_IRQFD:
+		ret = privcmd_ioctl_irqfd(file, udata);
+		break;
+
 	default:
 		break;
 	}
@@ -992,15 +1262,27 @@ static int __init privcmd_init(void)
 	err = misc_register(&xen_privcmdbuf_dev);
 	if (err != 0) {
 		pr_err("Could not register Xen hypercall-buf device\n");
-		misc_deregister(&privcmd_dev);
-		return err;
+		goto err_privcmdbuf;
+	}
+
+	err = privcmd_irqfd_init();
+	if (err != 0) {
+		pr_err("irqfd init failed\n");
+		goto err_irqfd;
 	}
 
 	return 0;
+
+err_irqfd:
+	misc_deregister(&xen_privcmdbuf_dev);
+err_privcmdbuf:
+	misc_deregister(&privcmd_dev);
+	return err;
 }
 
 static void __exit privcmd_exit(void)
 {
+	privcmd_irqfd_exit();
 	misc_deregister(&privcmd_dev);
 	misc_deregister(&xen_privcmdbuf_dev);
 }
diff --git a/include/uapi/xen/privcmd.h b/include/uapi/xen/privcmd.h
index d2029556083e..375718ba4ab6 100644
--- a/include/uapi/xen/privcmd.h
+++ b/include/uapi/xen/privcmd.h
@@ -98,6 +98,18 @@ struct privcmd_mmap_resource {
 	__u64 addr;
 };
 
+/* For privcmd_irqfd::flags */
+#define PRIVCMD_IRQFD_FLAG_DEASSIGN (1 << 0)
+
+struct privcmd_irqfd {
+	void __user *dm_op;
+	__u32 size; /* Size of structure pointed by dm_op */
+	__u32 fd;
+	__u32 flags;
+	domid_t dom;
+	__u8 pad[2];
+};
+
 /*
  * @cmd: IOCTL_PRIVCMD_HYPERCALL
  * @arg: &privcmd_hypercall_t
@@ -125,5 +137,7 @@ struct privcmd_mmap_resource {
 	_IOC(_IOC_NONE, 'P', 6, sizeof(domid_t))
 #define IOCTL_PRIVCMD_MMAP_RESOURCE				\
 	_IOC(_IOC_NONE, 'P', 7, sizeof(struct privcmd_mmap_resource))
+#define IOCTL_PRIVCMD_IRQFD					\
+	_IOC(_IOC_NONE, 'P', 8, sizeof(struct privcmd_irqfd))
 
 #endif /* __LINUX_PUBLIC_PRIVCMD_H__ */
-- 
2.31.1.272.g89b43f80a514



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 12:43:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 12:43:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569660.890538 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHNS-0000ou-SA; Tue, 25 Jul 2023 12:42:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569660.890538; Tue, 25 Jul 2023 12:42:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHNS-0000on-P6; Tue, 25 Jul 2023 12:42:58 +0000
Received: by outflank-mailman (input) for mailman id 569660;
 Tue, 25 Jul 2023 12:42:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BzC/=DL=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qOHNR-0000oh-Gl
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 12:42:57 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c79a17dc-2ae8-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 14:42:56 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-4fdd14c1fbfso8394116e87.1
 for <xen-devel@lists.xenproject.org>; Tue, 25 Jul 2023 05:42:56 -0700 (PDT)
Received: from [192.168.202.116] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 j14-20020ac2550e000000b004fc863a0bf6sm2744707lfk.223.2023.07.25.05.42.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 25 Jul 2023 05:42:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c79a17dc-2ae8-11ee-b23f-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690288976; x=1690893776;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=AOH+pNKnr7Sxny4pULHZN2j0klw+6ma+TbLJC2RF++Q=;
        b=mVIs/Tm5D5cLMClLy/sV2jT0Zg9vER1e0UNT6gf1WEJuNmAuNK99u3fAED3O1v/mVZ
         dS0xyvX7fWgnyMdhLwKFTFeiUpQLrWsdOsTKmh643LwlNakAbBLKk0YiBsn0pDFWRXZP
         7gNt4bwEHdPrwBt48h+LdMVEuSQZJK/pT9uEq9FqiaiCkOSI0rTPO7zVLmJx6BNVZ+su
         h23w5D+rziQ7y61ACtSQhsLDkpQYpzhq6HICsd0G7WMtRfOHWSoL49v03BY+ZTBumgjj
         pQXU0O/WO3kflvp2HvoNaJyRZdiQgfn6YAlQnBYCO08XxBPlm5JC1Ps7+w/eDOVHWRC8
         f6QA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690288976; x=1690893776;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=AOH+pNKnr7Sxny4pULHZN2j0klw+6ma+TbLJC2RF++Q=;
        b=I/Y5/qaCbfJFal3AbnTTlRfqFKC1e89yBwiF5dkPRgBtOn6jjkxBE9/W+X+Ao4wTqa
         lkc1N9FuhDKJrTfSKZkutZgnLXkfJD5JkGSCjB3pZwa1+lJ+Ku4kOUhIAgU8Y6dNFIIS
         ng94xA5QBQwANtaAhkCx7HQ/xR+MmXH2c554uBIDo17e25xtG4KQ5jomT7kf5FJ4Vnp3
         a71MiKQfeZLOkk+c0d5lkPnXzJN05iQyqh5R3yuKQbvB//3hWvpXTX0rrahqqUX3YcPb
         Z2rJmK60kYPL5hg5TkWZQwAFRg0IJueZ8M7UpMLhkzw8lMVpwal/R5gpHfOZWV0t9AAR
         A0JQ==
X-Gm-Message-State: ABy/qLYuozl5Ajf1weVoBHDV1hNFeD8aenRNOVyyPhO9TW2mfrQm2TWd
	gNVF+UAaa5OGgfAQsKYDIwE=
X-Google-Smtp-Source: APBJJlEk7OenKovCVVmf8xfAGZLeX5pd8lXpr7ezYBb9uyE2dSCS5J9vK30c8w8ZKus1cBjoMiWqBQ==
X-Received: by 2002:a05:6512:2015:b0:4fd:fef7:95a5 with SMTP id a21-20020a056512201500b004fdfef795a5mr1785325lfb.11.1690288975667;
        Tue, 25 Jul 2023 05:42:55 -0700 (PDT)
Message-ID: <ef37e5f11a8a8f69f98c2069a8d71485a046b600.camel@gmail.com>
Subject: Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Bob Eshleman
	 <bobbyeshleman@gmail.com>, Alistair Francis <alistair.francis@wdc.com>, 
	Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
Date: Tue, 25 Jul 2023 15:42:54 +0300
In-Reply-To: <d8aeb29b-1284-98bc-de75-3d5d8a825e1b@suse.com>
References: <cover.1690191480.git.oleksii.kurochko@gmail.com>
	 <a8ab1829ab718dda869db3df3348ded211e81967.1690191480.git.oleksii.kurochko@gmail.com>
	 <c32d8be8-75cf-78f8-304d-247b93b611cb@suse.com>
	 <dddc1effe5fc112f79a84e4f0a7ccf283877a466.camel@gmail.com>
	 <d8aeb29b-1284-98bc-de75-3d5d8a825e1b@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Tue, 2023-07-25 at 10:16 +0200, Jan Beulich wrote:
> On 24.07.2023 18:00, Oleksii wrote:
> > On Mon, 2023-07-24 at 16:11 +0200, Jan Beulich wrote:
> > > On 24.07.2023 11:42, Oleksii Kurochko wrote:
> > > > +void __init remove_identity_mapping(void)
> > > > +{
> > > > +=C2=A0=C2=A0=C2=A0 static pte_t *pgtbl =3D stage1_pgtbl_root;
> > > > +=C2=A0=C2=A0=C2=A0 static unsigned long load_start =3D XEN_VIRT_ST=
ART;
> > > > +=C2=A0=C2=A0=C2=A0 static unsigned int pt_level =3D CONFIG_PAGING_=
LEVELS - 1;
> > >=20
> > > These all want to be __initdata, but personally I find this way
> > > of
> > > recursing a little odd. Let's see what the maintainers say.
> > I'm not completely happy either. Initially I thought that it would
> > be
> > better to pass all this stuff as function's arguments.
> >=20
> > But then it is needed to provide an access to stage1_pgtbl_root (
> > get_root_pt() function ? ). So remove_identity_mapping() will be
> > called
> > as remove_identity_mapping(get_root_pt(), _start,
> > CONFIG_PAGING_LELVELS
> > -1 ) or remove_identity_mapping(NULL, _start, CONFIG_PAGING_LELVELS
> > -1
> > ) and then check if first argument is NULL then initialize it with
> > stage1_pgtbl_root.
> > Also I am not sure that an 'user' should provide all this
> > information
> > to such function.
> >=20
> > Could you recommend something better?
>=20
> Well, to avoid the mess you are describing I would consider making
> remove_identity_mapping() itself a thin wrapper around the actual
> function which then invokes itself recursively. That'll keep the
> top-level call site tidy, and all the technical details confined to
> the (then) two functions.
Thanks a lot for the recommendation.

>=20
> > > > +=C2=A0=C2=A0=C2=A0 unsigned long load_end =3D LINK_TO_LOAD(_end);
> > > > +=C2=A0=C2=A0=C2=A0 unsigned long xen_size;
> > > > +=C2=A0=C2=A0=C2=A0 unsigned long pt_level_size =3D XEN_PT_LEVEL_SI=
ZE(pt_level);
> > > > +=C2=A0=C2=A0=C2=A0 unsigned long pte_nums;
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 unsigned long virt_indx =3D pt_index(pt_level,
> > > > XEN_VIRT_START);
> > > > +=C2=A0=C2=A0=C2=A0 unsigned long indx;
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 if ( load_start =3D=3D XEN_VIRT_START )
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 load_start =3D LINK_TO_=
LOAD(_start);
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 xen_size =3D load_end - load_start;
> > >=20
> > > When you come here recursively, don't you need to limit this
> > > instance of the function to a single page table's worth of
> > > address
> > > space (at the given level), using load_end only if that's yet
> > > lower?
> > Do you mean a case when load_start > load_end? If yes then I missed
> > that.
>=20
> No, my concern is with the page table presently acted upon covering
> only a limited part of the address space. That "limited" is the full
> address space only for the top level table. You won't observe this
> though unless the Xen image crosses a 2Mb boundary. But if it does
> (and it may help if you arranged for big enough an image just for
> the purpose of debugging, simply by inserting enough dead code or
> data), and if all mappings are 4k ones, you'd run past the first L1
> table's worth of mappings on the first invocation of this function
> with a L1 table. (Of course hitting the condition may further
> require Xen and 1:1 mappings to be sufficiently close to one another,
> so that the zapping doesn't already occur at higher levels. But then
> the same situation could arise at higher levels when the image
> crosses a 1Gb or 512Gb boundary.)
In this case, all should be fine.

If we put identity and non-identity mapping as closely as possible.
I tested with the following input:
   XEN_VIRT_START =3D 0x80670000
   load start =3D 0x80200000
   Xen size =3D 4648960

So now pte on L2 level is shared, so we will go to L1, and calculate
the amount of pte nums on the L1 level. In the current one case, it is
3, so it will delete the first two L1's ptes ( as they have different
index from index of XEN_VIRT_START at L1 level so we are sure that
these ptes are used only for identity mapping and can be removed ),
move load_start +=3D 4 MB, and for the last one L1's ptes which is shared
with non-identity mapping it will go to L0 table, calculate a number of
ptes needed to be cleaned based on 'new' load start and page level ( it
is 0x6f in the current case ) to finish removing of identity mapping.

I added some prints inside:
    if ( virt_indx !=3D indx )
    { ....
And received the expected output I described above:
(level number) '-' means removed

(1) -
(1) -
(0) -
... 0x6f times
(0) -

>=20
> > > > +=C2=A0=C2=A0=C2=A0 pte_nums =3D ROUNDUP(xen_size, pt_level_size) /
> > > > pt_level_size;
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 while ( pte_nums-- )
> > > > +=C2=A0=C2=A0=C2=A0 {
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 indx =3D pt_index(pt_le=
vel, load_start);
> > > > =C2=A0
> > > > -=C2=A0=C2=A0=C2=A0 switch_stack_and_jump((unsigned long)cpu0_boot_=
stack +
> > > > STACK_SIZE,
> > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 cont_after_mmu_is_enabled);
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( virt_indx !=3D ind=
x )
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 pgtbl[indx].pte =3D 0;
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 load_start +=3D XEN_PT_LEVEL_SIZE(pt_level);
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 pgtbl =3D=C2=A0 (pte_t
> > > > *)LOAD_TO_LINK(pte_to_paddr(pgtbl[indx]));
> > >=20
> > > Nit: Stray double blank.
> > Thanks.
> > >=20
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 pt_level--;
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 remove_identity_mapping();
> > >=20
> > > Don't you need to restore pgtbl and pt_level here before the loop
> > > can continue? And because of depending on load_start, which would
> > > have moved, xen_size also needs suitably reducing, I think. Plus
> > > pte_nums as well, since that in turn was calculated from
> > > xen_size.
> > I forgot to restore pgtbl and pt_level because initially I used a
> > function arguments to pass that information so it wasn't needed to
> > restore them.
> >=20
> > Regarding xen_size and pte_nums it looks like it is needed to init
> > only
> > once on each page table level.
> > For example we have the following situation:
> > =C2=A0 ----------------------
> > =C2=A0=C2=A0 non-identity-mapping
> > =C2=A0=C2=A0 identity-mapping
> > =C2=A0 ---------------------- C
> > =C2=A0=C2=A0 identity-mapping
> > =C2=A0 ---------------------- B
> > =C2=A0=C2=A0 identity-mapping
> > =C2=A0 ---------------------- A
> > So we calculated that we need to remove 3 ptes, for first two ptes
> > ( as
> > only identity mapping is there) are removed without any issue, then
> > move load_addr to C and run recursion
> > for the pte 'C' to go to next page table level.
> > At new level we are calculating how many ptes are needed to be
> > removed
> > and remove only necessary amount of ptes.
> > When we will back to prev page table level pte_num will be 1 then
> > we
> > will go to the head of the cycle, decrease pte_num to 0 and exit.
>=20
> I think I agree that this case is okay.
>=20
> > The same is with the case when non-idenitity-mapping is lower than
> > identity mapping ( but it looks like it is not a case becase
> > XEN_VIRT_START addr is the highest address by its defintion.
> > Probably
> > it is needed to add a check ):
>=20
> And it looks like this case being impossible is what voids my
> respective
> remark. (Might be worth adding a comment to this effect.)
I'll add a comment in remove_identity_function().

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 12:51:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 12:51:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569664.890547 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHVC-0002Jr-MU; Tue, 25 Jul 2023 12:50:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569664.890547; Tue, 25 Jul 2023 12:50:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHVC-0002Jk-JI; Tue, 25 Jul 2023 12:50:58 +0000
Received: by outflank-mailman (input) for mailman id 569664;
 Tue, 25 Jul 2023 12:50:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=rtsi=DL=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qOHVB-0002Jc-1h
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 12:50:57 +0000
Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com
 [2a00:1450:4864:20::32c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e51fe143-2ae9-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 14:50:55 +0200 (CEST)
Received: by mail-wm1-x32c.google.com with SMTP id
 5b1f17b1804b1-3fd2f298712so23255745e9.2
 for <xen-devel@lists.xenproject.org>; Tue, 25 Jul 2023 05:50:55 -0700 (PDT)
Received: from EMEAENGAAD19049. (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 9-20020a05600c024900b003fd32074e74sm7694474wmj.31.2023.07.25.05.50.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 25 Jul 2023 05:50:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e51fe143-2ae9-11ee-b23f-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690289455; x=1690894255;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=LciJMUcwPRYY1S1ZzSFiCg3n9xRe7tdT7XuMqyl2U8w=;
        b=B/03xREzwQOX2zptyHTF28L0hjijBgX++KW1ZjB2lWpU4OfjNiPT7KCNSPvqa3Hxq8
         66KGD+UitebZvqGu1vQOfoAGl7kKmx+34vCOEV5meZO0OzvUL239uGcIQNfoFJCWvw7k
         6hmB7PMOP17icLtNYEC0OjNXv4Fkw5n4zLR9k=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690289455; x=1690894255;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=LciJMUcwPRYY1S1ZzSFiCg3n9xRe7tdT7XuMqyl2U8w=;
        b=LLPXj2lXUKOrwDocwJCwbtKi0ToFKwIgzTQk5OgRYPaKSutMqNpNnvCiGkrzeb6Bq3
         ckUd8dXpa9CaJAsGwTsmlOj+4PpES24YIy6UQuw6nVLIl4YfGXIAYPib9OLCuG5eoyxM
         Y777Qtn4ZGMdK8lORflMOopHheI7OtL1TI0eK8pXo0O+5S7AHwtrnHksH7eaws83VVM0
         3Pq2OBMTdHC6vYMuLyXnC15SA171G5MLAGguVUa6GVPDN3moKfXpsnnBWhJbFEwu17s/
         nplo5TvkH9tAOOCEbpTCXnjrEpTxF7rQ6AISpjx8WHbbO9TOHOvOXREUC1jkl65SOhib
         QNmA==
X-Gm-Message-State: ABy/qLYip2MA6Ed8R4SOCc3WqZ2PD0SMMwMQOhWPZGrB7yf8zIeHLIr3
	KAN5yI/nYlzE2bjj5bKRcG6zEg==
X-Google-Smtp-Source: APBJJlFKT8X7Du38LcD7Ra1BT302ADtZiC1g1Wlj1ib5EXZWZQ/t6YxEQRKZ8s8NfvnQxhkY6PB8ow==
X-Received: by 2002:a05:600c:20d1:b0:3fd:1daf:abd8 with SMTP id y17-20020a05600c20d100b003fd1dafabd8mr7294549wmm.40.1690289455066;
        Tue, 25 Jul 2023 05:50:55 -0700 (PDT)
Message-ID: <64bfc52e.050a0220.14646.cb0d@mx.google.com>
X-Google-Original-Message-ID: <ZL/FBj69kTqyCXYz@EMEAENGAAD19049.>
Date: Tue, 25 Jul 2023 13:50:52 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v6 1/3] x86/microcode: Ignore microcode loading interface
 for revision = -1
References: <20230724165235.25262-1-alejandro.vallejo@cloud.com>
 <20230724165235.25262-2-alejandro.vallejo@cloud.com>
 <4a31893d-a784-ed33-bd47-5db85b3c02b6@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4a31893d-a784-ed33-bd47-5db85b3c02b6@suse.com>

On Tue, Jul 25, 2023 at 08:40:31AM +0200, Jan Beulich wrote:
> On 24.07.2023 18:52, Alejandro Vallejo wrote:
> > Some hypervisors report ~0 as the microcode revision to mean "don't issue
> > microcode updates". Ignore the microcode loading interface in that case.
> > 
> > Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> > Reviewed-by: Jan Beulich <jbeulich@suse.com>
> 
> Hmm.
> 
> > --- a/xen/arch/x86/cpu/microcode/core.c
> > +++ b/xen/arch/x86/cpu/microcode/core.c
> > @@ -867,10 +867,23 @@ int __init early_microcode_init(unsigned long *module_map,
> >          return -ENODEV;
> >      }
> >  
> > -    microcode_grab_module(module_map, mbi);
> > -
> >      ucode_ops.collect_cpu_info();
> >  
> > +    /*
> > +     * Some hypervisors deliberately report a microcode revision of -1 to
> > +     * mean that they will not accept microcode updates. We take the hint
> > +     * and ignore the microcode interface in that case.
> > +     */
> > +    if ( this_cpu(cpu_sig).rev == ~0 )
> > +    {
> > +        printk(XENLOG_INFO "Microcode loading disabled due to: %s",
> 
> While we have tentatively agreed to adjust what _will_ be emitted by
> default (subject to suitable justification in that change's
> description), such a patch is yet to be sent.
Ugh, that was indeed mistagged. Sorry about that. I touched several parts
of this patch shortly before sending it and it crept in by mistake.

> As it stands this message
> will be invisible by default.
Arguably, that's not necessarily a bad thing. The fact that microcode
cannot be updated is expected behaviour and it makes little sense to warn
about it. If only because they should already be aware of it through their
agreement with their provider.

The case I can think of where a warning would be sensible is where the
system has a microcode blob more recent than the currently installed
revision. This is something the admin may want to be aware of in order to
pester their provider for updates. In the common case the machine won't
even need such an update, so sending unconditional warnings per boot seems
unwarranted.

> 
> > +                           "HW toggle");
> 
> With the comment talking about hypervisors, what is this string supposed
> to tell an observer of the message in a log file?
> 
> Jan
Nothing good. As you noticed later, that's the wrong substring off the last
patch and should've been "rev = ~0"

Thanks,
Alejandro


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 13:06:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 13:06:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569668.890560 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHkB-0003v3-Us; Tue, 25 Jul 2023 13:06:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569668.890560; Tue, 25 Jul 2023 13:06:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHkB-0003uw-S9; Tue, 25 Jul 2023 13:06:27 +0000
Received: by outflank-mailman (input) for mailman id 569668;
 Tue, 25 Jul 2023 13:06:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=A3G+=DL=citrix.com=prvs=56320e048=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOHkA-0003uq-PM
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 13:06:27 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0dc09ab2-2aec-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 15:06:24 +0200 (CEST)
Received: from mail-dm6nam10lp2106.outbound.protection.outlook.com (HELO
 NAM10-DM6-obe.outbound.protection.outlook.com) ([104.47.58.106])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 25 Jul 2023 09:06:21 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SA1PR03MB6516.namprd03.prod.outlook.com (2603:10b6:806:1c7::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 13:06:19 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6609.031; Tue, 25 Jul 2023
 13:06:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0dc09ab2-2aec-11ee-b23f-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690290384;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=/jv+CyPM3neLkaA4oQq4tIsXoYzSYlUOZobTjS+1d6o=;
  b=ZbeF5W5raUvGtH3RBcFU3i+yrOeoSMp6FLLCCB2hEJMrwaXhtkKn+y6B
   XNf5f+XGn3fRH1ROHs2Azdn6vRecZ+o9t/+cBBAv2jzyXEcPWY0jZjTFk
   nNz3Eo3r9nRe67R3HQIVTsO0VVLQ6Xo8ATDB+8Qmmw/BL77gQmu0FISN1
   o=;
X-IronPort-RemoteIP: 104.47.58.106
X-IronPort-MID: 117380966
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X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bay39QYKcegQUdAC0+6hMHfiLqShfng8OaYE
X-Talos-CUID: 9a23:R19dVGx1Tr7HzXjQ4YA1BgUzIswVUD6BzUuNPla1MGs4VLCIYlaPrfY=
X-Talos-MUID: =?us-ascii?q?9a23=3AcUDXfgzeDvCapxKQvsVDLgruqWOaqPyjDXwPqpI?=
 =?us-ascii?q?HgOOBDDwtGB64vRu2Q4Byfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,230,1684814400"; 
   d="scan'208";a="117380966"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=jJhS924O7TznFdejo4+eYlT8tedekz0WgmozmcLsmMf5BRrBdHQ89DqyMU77dl2tWcH+QLbBMfFQ737QEIpqmo6qzb4izUA1+vFoMDf7GHv+BzqrsaNxrCcJpsl5rFlgS7mJfnaQT0vO7roYyhdXmb0pOZwZAamAHUEuH74GZu3RXnjxFz3jclk3rXfsjLusNrGJ5hjckmo9RbRLDFTovmYkX53LZbI0Dn1PRiCf2IQyaBT3UnUJ3t7vBNSmX50rHDCfCcLYKtax1AP9p6n6U4PsPN1ZKhQ8twuyH1daaWtHWQJ3rOn60o8cBUm0r9kMQ3UPqF+KgvJpqXb/dz30oQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=wf40HwzFigWxi5/seuFzBWojNz9BnyuqK0PdkFX/FF4=;
 b=E2rJQLdtPmYzXguFadCGEP34V7PRqEvvHJsnMXA9bLx6DjQAG1SzR4EbcidwPcZHbSSsApaPLphmp5UzyQpH3w2ZyWEn/Tx0XeCrGPAAhk0HpBGkfg98IQSShVxeN61x0RqfbOrnKfABkf5W4DXL3OksimQIsv75rn76YCZcsm7tk6J87MyeXse/C+ThnVXbOtzpcaKW9vMIViXqB7gAblbh7GX1FK2Fj92bihphbWFuKr/q4UFv2yUsuajFmCmDeQs7Td/OYHNCIR40WwC+sqanRJf6Og89mChqS1qUYkqrnTORU5fu8Y03PNpLa4/0Q1GAfAq0Yi6QFXG24eoOsw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=wf40HwzFigWxi5/seuFzBWojNz9BnyuqK0PdkFX/FF4=;
 b=uZprRpw5WEAc1yT8Z7OyMEQEiEz9w0pQ1rvG/zwG6/tNiyKBea0vhRTTQNcVCLa2OnV4D5j1WdJW1mCQv0mt/qbmGlllHW5T005zyjJSzisVq9YrwpvflT6+eNt7bq+y3wzORn8o0+NZoPHNutRk0FfzKSXUfjcce2UbNqF1NUY=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v4 1/6] libs/guest: introduce support for setting guest MSRs
Date: Tue, 25 Jul 2023 15:05:53 +0200
Message-ID: <20230725130558.58094-2-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230725130558.58094-1-roger.pau@citrix.com>
References: <20230725130558.58094-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0094.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2bc::9) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA1PR03MB6516:EE_
X-MS-Office365-Filtering-Correlation-Id: 0edbc6cc-9e8e-49f5-a3b0-08db8d0fef8d
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	FaW1Z1yUCozNZhWPhHqLirx6wDlOnkgtJ8b9ouy6CaUKavGX2p0dafFoPS9GY+vsTICbrNegQvosUEYYmJVENUsFGGC52++GAxWbrCSETz7+FYTRSy78xGKLnnTZgslmn9KrCpR480Tv6CsGIikYckttahDrZSC2HioNQbNNG9gFqMO+j12o019A6SU84LmEAWpA4PqXZwqzXzZtIsvVuHXbcUuqzl/MHIOBg/Di6vTeg9tGRG4EEASgsndU1GWyHtB/bXsBcodbqQlOtdkjVsA8xuJcv8jiEdgb6lEQ8+RCq+lHEreCDpKeWh/GID/da9h7vXZsamRYW8xFuxNuEc4iMe6BXJx2NNCLEwTCeCmiQoJSy/6NjjCzxU0vfgwjesocUklLR3n2Xvo4iv9eFXIX9TY0gEFSraJ4DTGgLHK5PnifGX9wL2nHy3+63GcDOaVOB0VYlRgW6zhL4xQkfgAkdA0Vo4kX0WeyZf9OOAN0vbVcDbv7WwSh5+Da+3wTs0fkTjNJNOcjS3U0XvtG8T36sTXzE5k01wc8SrK6gxgPXn6OFSyEEOjtFalGP6p+
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(136003)(346002)(396003)(39860400002)(451199021)(6486002)(6666004)(82960400001)(478600001)(83380400001)(8936002)(1076003)(26005)(6512007)(6506007)(66946007)(38100700002)(66556008)(54906003)(6916009)(4326008)(66476007)(186003)(2616005)(5660300002)(8676002)(2906002)(316002)(41300700001)(86362001)(36756003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dlpuSUdjTkpFRzV6YUZPNVVzZTU5ZngyQUZSWEloUzlnTlpQS2VMaGdraCs2?=
 =?utf-8?B?WXNQUnlLdlV6b0k4Q045L0NpejRYZEpyYXRxT3hKZ3JyVnlaUVB4WEwyd3dh?=
 =?utf-8?B?RTBKVUcxLzNCQ2JLa0JIMHNxdkxuYVlpbm14WWVnQ2d1YjU4S0Q3Z3VZRUEx?=
 =?utf-8?B?UmwrVUtGWStCR1JhQm14WThqZURXYkdrL0dQT0lSdVZCOFFXMGtHWDd4SmNB?=
 =?utf-8?B?bTliTDBFNnhWR01uMnQwcVRsU1dJVFYrdUlZeGsyTXgvZ3F0THBkZUlRcE11?=
 =?utf-8?B?anJ4UEkrd1FYWDZuVlM2SUVDZkVKNjEyOWREbXhJbzQ2Znl1ZjZQQTFYa2RM?=
 =?utf-8?B?ZlcvSTdOR0NGS2xXRWhvTUZiYWRXUmVOVTBXZ2pTbzFVMks1MHRUbTlUT2dk?=
 =?utf-8?B?MUxoRm9JeFFLMVN5VTQwMTdVZkF5d1BtRWd0OUUrb2xUU3k1RFArSHRPMHhF?=
 =?utf-8?B?aWpNM25vMUNIcDlKaVJKRU1nZlloamJFam9hV3V4MWR5ZFBXNjdrOUZXZVdD?=
 =?utf-8?B?eVlWdlZUT0FEbEM1UEU5eVFlY1BSRVluWHdQdHQxbEw3RXl2eVJuUlNQSDFG?=
 =?utf-8?B?Y1RhSnN5MTRsSmdETjdsWlgrVmxYNHViREVZcDB6QUVvOTZ0QSswcUoveUsw?=
 =?utf-8?B?dzVFeklnTUJwUC9hdC9Z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LeVrdPsWJjQCsVbcAxAWd2jWkTjJcPw/m9S7i1LryXu0eGW6oAyvOxU1Mjdx/5dv6uepE1lCTs2m6MsqSoxfzZQ8VYG8jy36GcHliuznEJD3nGTjL+o6rJynw0xnjSYpdvPUQtAFpnEOiOYYsJLs8udIyE8T+WHpKFLruowpyGlfEL9mE5YbCVSrxnN53nYCEhbe2m3Qw6jR04fcYL20ob6Tp+rrLpzr5M1Jwn9ZM2dp6BykVDthZ/O3/cEJiA2n2pX8VJ/A2xke9vkiyF4fJtYtAQUbqlejU4zWgEyPt9ijofEzyBtgeWBXlcrUPJ3iptKkCMW9daWcDyCDnVJnkc7//6QitiLx579ZZoM9kjNW5ycGwPtcJV3sxBjlRtQND63Uo0C9CCPMf5HLv/7yUbbwTmf9E3HJq8gY7Rk9ZmrCxtxx4UUJifcfWDQXDrffakSLQ+Zv2RoptS6c3jaFgb+jglQ9SstiuVQIXmwRRPnku/bxeAGqU59TdPYgMENM2koSXvRw5xwfkChuiEKutTgeu0bYpl3AOFKYKrljzcwArEvZrP0fNQw4Bb9PYt0pTBOrsb6dv1jjg83ulBSVb35dq4PHpUHZI5VJIbJhbhc5
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0edbc6cc-9e8e-49f5-a3b0-08db8d0fef8d
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 13:06:18.8670
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: GxwbBhlDpizBh02WU05k3YvB3FDidmY2Yb6JB0ZumNL09ZYHvj9uvSshU6I+lG+88n36OGuCNgj8KEM7xK8/iw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB6516

Like it's done with CPUID, introduce support for passing MSR values to
xc_cpuid_apply_policy().  The chosen format for expressing MSR policy
data matches the current one used for CPUID.  Note that existing
callers of xc_cpuid_apply_policy() can pass NULL as the value for the
newly introduced 'msr' parameter in order to preserve the same
functionality, and in fact that's done in libxl on this patch.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
---
Changes since v2:
 - Some code adjustment, no functional change.
---
 tools/include/xenctrl.h         |  21 +++-
 tools/libs/guest/xg_cpuid_x86.c | 169 +++++++++++++++++++++++++++++++-
 tools/libs/light/libxl_cpuid.c  |   2 +-
 3 files changed, 188 insertions(+), 4 deletions(-)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index dba33d5d0f39..faec1dd82453 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1822,6 +1822,21 @@ struct xc_xend_cpuid {
     char *policy[4];
 };
 
+/*
+ * MSR policy data.
+ *
+ * The format of the policy string is the following:
+ *   '1' -> force to 1
+ *   '0' -> force to 0
+ *   'x' -> we don't care (use default)
+ *   'k' -> pass through host value
+ */
+struct xc_msr {
+    uint32_t index;
+    char policy[65];
+};
+#define XC_MSR_INPUT_UNUSED 0xffffffffu
+
 /*
  * Make adjustments to the CPUID settings for a domain.
  *
@@ -1833,13 +1848,15 @@ struct xc_xend_cpuid {
  * Either pass a full new @featureset (and @nr_features), or adjust individual
  * features (@pae, @itsc, @nested_virt).
  *
- * Then (optionally) apply legacy XEND overrides (@xend) to the result.
+ * Then (optionally) apply legacy XEND CPUID overrides (@xend) or MSR (@msr)
+ * to the result.
  */
 int xc_cpuid_apply_policy(xc_interface *xch,
                           uint32_t domid, bool restore,
                           const uint32_t *featureset,
                           unsigned int nr_features, bool pae, bool itsc,
-                          bool nested_virt, const struct xc_xend_cpuid *xend);
+                          bool nested_virt, const struct xc_xend_cpuid *xend,
+                          const struct xc_msr *msr);
 int xc_mca_op(xc_interface *xch, struct xen_mc *mc);
 int xc_mca_op_inject_v2(xc_interface *xch, unsigned int flags,
                         xc_cpumap_t cpumap, unsigned int nr_cpus);
diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c
index 5b035223f4f5..f2b1e809011d 100644
--- a/tools/libs/guest/xg_cpuid_x86.c
+++ b/tools/libs/guest/xg_cpuid_x86.c
@@ -423,10 +423,170 @@ static int xc_cpuid_xend_policy(
     return rc;
 }
 
+static int compare_msr(const void *l, const void *r)
+{
+    const xen_msr_entry_t *lhs = l;
+    const xen_msr_entry_t *rhs = r;
+
+    if ( lhs->idx == rhs->idx )
+        return 0;
+
+    return lhs->idx < rhs->idx ? -1 : 1;
+}
+
+static xen_msr_entry_t *find_msr(
+    xen_msr_entry_t *msrs, unsigned int nr_msrs,
+    uint32_t index)
+{
+    const xen_msr_entry_t key = { .idx = index };
+
+    return bsearch(&key, msrs, nr_msrs, sizeof(*msrs), compare_msr);
+}
+
+
+static int xc_msr_policy(xc_interface *xch, domid_t domid,
+                         const struct xc_msr *msr)
+{
+    int rc;
+    bool hvm;
+    xc_domaininfo_t di;
+    unsigned int nr_leaves, nr_msrs;
+    uint32_t err_leaf = -1, err_subleaf = -1, err_msr = -1;
+    /*
+     * Three full policies.  The host, default for the domain type,
+     * and domain current.
+     */
+    xen_msr_entry_t *host = NULL, *def = NULL, *cur = NULL;
+    unsigned int nr_host, nr_def, nr_cur;
+
+    if ( (rc = xc_domain_getinfo_single(xch, domid, &di)) < 0 )
+    {
+        PERROR("Failed to obtain d%d info", domid);
+        rc = -errno;
+        goto out;
+    }
+    hvm = di.flags & XEN_DOMINF_hvm_guest;
+
+    rc = xc_cpu_policy_get_size(xch, &nr_leaves, &nr_msrs);
+    if ( rc )
+    {
+        PERROR("Failed to obtain policy info size");
+        rc = -errno;
+        goto out;
+    }
+
+    if ( (host = calloc(nr_msrs, sizeof(*host))) == NULL ||
+         (def  = calloc(nr_msrs, sizeof(*def)))  == NULL ||
+         (cur  = calloc(nr_msrs, sizeof(*cur)))  == NULL )
+    {
+        ERROR("Unable to allocate memory for %u CPUID leaves", nr_leaves);
+        rc = -ENOMEM;
+        goto out;
+    }
+
+    /* Get the domain's current policy. */
+    nr_leaves = 0;
+    nr_cur = nr_msrs;
+    rc = get_domain_cpu_policy(xch, domid, &nr_leaves, NULL, &nr_cur, cur);
+    if ( rc )
+    {
+        PERROR("Failed to obtain d%d current policy", domid);
+        rc = -errno;
+        goto out;
+    }
+
+    /* Get the domain type's default policy. */
+    nr_leaves = 0;
+    nr_def = nr_msrs;
+    rc = get_system_cpu_policy(xch, hvm ? XEN_SYSCTL_cpu_policy_hvm_default
+                                        : XEN_SYSCTL_cpu_policy_pv_default,
+                               &nr_leaves, NULL, &nr_def, def);
+    if ( rc )
+    {
+        PERROR("Failed to obtain %s def policy", hvm ? "hvm" : "pv");
+        rc = -errno;
+        goto out;
+    }
+
+    /* Get the host policy. */
+    nr_leaves = 0;
+    nr_host = nr_msrs;
+    rc = get_system_cpu_policy(xch, XEN_SYSCTL_cpu_policy_host,
+                               &nr_leaves, NULL, &nr_host, host);
+    if ( rc )
+    {
+        PERROR("Failed to obtain host policy");
+        rc = -errno;
+        goto out;
+    }
+
+    for ( ; msr->index != XC_MSR_INPUT_UNUSED; ++msr )
+    {
+        xen_msr_entry_t *cur_msr = find_msr(cur, nr_cur, msr->index);
+        const xen_msr_entry_t *def_msr = find_msr(def, nr_def, msr->index);
+        const xen_msr_entry_t *host_msr = find_msr(host, nr_host, msr->index);
+        unsigned int i;
+
+        if ( cur_msr == NULL || def_msr == NULL || host_msr == NULL )
+        {
+            ERROR("Missing MSR %#x", msr->index);
+            rc = -ENOENT;
+            goto out;
+        }
+
+        for ( i = 0; i < ARRAY_SIZE(msr->policy) - 1; i++ )
+        {
+            bool val;
+
+            if ( msr->policy[i] == '1' )
+                val = true;
+            else if ( msr->policy[i] == '0' )
+                val = false;
+            else if ( msr->policy[i] == 'x' )
+                val = test_bit(63 - i, &def_msr->val);
+            else if ( msr->policy[i] == 'k' )
+                val = test_bit(63 - i, &host_msr->val);
+            else
+            {
+                ERROR("MSR index %#x: bad character '%c' in policy string '%s'",
+                      msr->index, msr->policy[i], msr->policy);
+                rc = -EINVAL;
+                goto out;
+            }
+
+            if ( val )
+                set_bit(63 - i, &cur_msr->val);
+            else
+                clear_bit(63 - i, &cur_msr->val);
+        }
+    }
+
+    /* Feed the transformed policy back up to Xen. */
+    rc = xc_set_domain_cpu_policy(xch, domid, 0, NULL, nr_cur, cur,
+                                  &err_leaf, &err_subleaf, &err_msr);
+    if ( rc )
+    {
+        PERROR("Failed to set d%d's policy (err leaf %#x, subleaf %#x, msr %#x)",
+               domid, err_leaf, err_subleaf, err_msr);
+        rc = -errno;
+        goto out;
+    }
+
+    /* Success! */
+
+ out:
+    free(cur);
+    free(def);
+    free(host);
+
+    return rc;
+}
+
 int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
                           const uint32_t *featureset, unsigned int nr_features,
                           bool pae, bool itsc, bool nested_virt,
-                          const struct xc_xend_cpuid *xend)
+                          const struct xc_xend_cpuid *xend,
+                          const struct xc_msr *msr)
 {
     int rc;
     bool hvm;
@@ -663,6 +823,13 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
     if ( xend && (rc = xc_cpuid_xend_policy(xch, domid, xend)) )
         goto out;
 
+    if ( msr )
+    {
+        rc = xc_msr_policy(xch, domid, msr);
+        if ( rc )
+            goto out;
+    }
+
     rc = 0;
 
 out:
diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index f5ce9f97959c..c96aeb3bce46 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -502,7 +502,7 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
             info->tsc_mode == LIBXL_TSC_MODE_ALWAYS_EMULATE);
 
     r = xc_cpuid_apply_policy(ctx->xch, domid, restore, NULL, 0,
-                              pae, itsc, nested_virt, info->cpuid);
+                              pae, itsc, nested_virt, info->cpuid, NULL);
     if (r)
         LOGEVD(ERROR, -r, domid, "Failed to apply CPUID policy");
 
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 13:06:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 13:06:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569669.890571 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHkL-0004CB-8l; Tue, 25 Jul 2023 13:06:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569669.890571; Tue, 25 Jul 2023 13:06:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHkL-0004C1-65; Tue, 25 Jul 2023 13:06:37 +0000
Received: by outflank-mailman (input) for mailman id 569669;
 Tue, 25 Jul 2023 13:06:36 +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
 <SRS0=A3G+=DL=citrix.com=prvs=56320e048=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOHkK-0004BN-5j
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 13:06:36 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f6341ec4-2aeb-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 15:05:44 +0200 (CEST)
Received: from mail-co1nam11lp2171.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.171])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 25 Jul 2023 09:06:17 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SA1PR03MB6516.namprd03.prod.outlook.com (2603:10b6:806:1c7::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 13:06:13 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6609.031; Tue, 25 Jul 2023
 13:06:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f6341ec4-2aeb-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690290393;
  h=from:to:cc:subject:date:message-id:
   content-transfer-encoding:mime-version;
  bh=rfePr69IWK0mWEXIQo+D3kzuJGWGZb68XMqpUFQEXd8=;
  b=bCY0oXftMsuNmhXoWyIL5kulJcEQomBlq881dmHei6ie2E/SaCVJZHEl
   sLEB14NndzYqAGswRkWHiwb3aM3H1hhEmPUOErndzzzXp2k/UfnqBGxAr
   1BE1JF7QMzgYnNh87vhdEGb4v3uCGm2zgAR16Xt2zHGuLYtzghFr7f1Tp
   k=;
X-IronPort-RemoteIP: 104.47.56.171
X-IronPort-MID: 119981262
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:MTlLTazq1CXm3jXC2m56t+cQxyrEfRIJ4+MujC+fZmUNrF6WrkVWy
 WsbDW6PbveCYmH0Koh0PY/no0pV7JPWztRhGwU9rCAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhP60T5TcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KUtg2
 No5AjILVB+CmMSfwZiGCa5vhu12eaEHPKtH0p1h5RfwKK9/BLvkGuDN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjaVlVMouFTuGIO9ltiiX8Jak1zev
 mvb12/4HgsbJJqUzj/tHneE37aezHOiAtxIfFG+3qRbw1ew+3xQMj0TCQW/m/+fmFW4CvsKf
 iT4/QJr98De7neDXtT7GhG1vnOAlhodQMZLVf037hmXzajZ6BrfAXILJhZebPQ2uclwQiYlv
 neLkMnuHidHq6CORDSW8bL8kN+pES0cLGtHbihdSwIAuoDnuNtq0UuJSct/GqmoiNGzASv33
 z2BsCk5gfMUkNIP0KK4u1vAhlpAu6T0c+L83S2PNkrN0++zTNT5D2B0wTA3Ncp9Ebs=
IronPort-HdrOrdr: A9a23:gc51laBawyfUB7TlHejpsceALOsnbusQ8zAXPiFKOGlom6mj/K
 6TdZsgtSMc9wxhJE3I9ergBEDiewKuyXcK2/hyAV7KZmCP0ldAR7sSjrcKrQeQfhEX/YZmpN
 hdm8AVMrHN5TMRt6nHCMbTKbsd6ejCyYTtodr3i05qSwQCUdAT0++6YDzrbHGfgGN9dOoE/F
 /33Ls3m9PaQwVyUu2LQkMdWvTFpZnijYuOW29+OzcXrDOWiC+u6vrQDxic034lIk5y6IZny3
 HBjwv6ooKqt/3T8G6660bjq65OncfnyJ9kGsuBkaEuW1PRozftXp1lR7qB+AoUjYiUmS4Xue
 iJmQ4kI8Nwr0ncZX64ujzk3wWI6kdU11bSjWWAhGflo4jHSCkhC8xH7LgpCCfk1w==
X-Talos-CUID: 9a23:ZsTcjm9S/GSACTTnZXWVv2Q6N+YEWH/b9njRPGmRCExUC/qWSXbFrQ==
X-Talos-MUID: 9a23:aSYqCAsyW7EcHtLaZs2n3gAhPuRV8+eUKEVRz5E8ve+WLiohEmLI
X-IronPort-AV: E=Sophos;i="6.01,230,1684814400"; 
   d="scan'208";a="119981262"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=e0deDAX7/86042r7eURrgTu9cN3kwmGMaSNe1pi0YDhQSE2Os1VvuHpiHD/++7dQ2jklmNst0Fi3nRFo4le+VTaHkYs+fy64VIY9ah5uGISwHOJyCVqBx5hgpjLYBYjRBQF53obM/zV+6fW4CAgAYzudTVgtDPHpvoZWoV7KmYZ3fGra4Gy/LUNjBniJBH3rZ9mahEr89lAMiNp72GsEeNZN1n6uxabGQvJ78oq3sAYrYD8lAp6q7mwMQ9w3Q2ip88mk0tpD3XApDPMbb9BsVVKNTCR99COBgdh4N4C70UaYjCwbxORv09N/siOL/tQ7Am+HTtJdVsiKXjRiR6I8Xg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=e3D+sCBu93lJN8h/uBwTlirz+UK81IB9FCSryAPCYQ8=;
 b=EAqbgicPNbA03HPFPskRIKf8T/8csDo1dwyx8SjzAVP5zPxevF/sbJvHdNk+QqIIOIvYFnuKwypsX6ZhpIyZ4KFewfZ/ypjR1/t2QgaE8PKldv9UBw2KHFJY8WVyYA6bnKui8QBIoB2OwfK1oo2kUO1dbFb280FsH+FM1EzdZzuTa7+vckPFgwt4pW+XJvuneiF6PcnK5s+QqFdFA/R5KMKkbvXzhlGxtI5GEwSzqDsJIjIeUrABR62orHdUAc0Hv1r+3Pnm73gdNbHSQ2PdVteCpJENNrUkWIXPYM09rNqV9Zu6dm/RI8l8nxk7odFVF59yGFq6eqptUX4YDqVA7g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=e3D+sCBu93lJN8h/uBwTlirz+UK81IB9FCSryAPCYQ8=;
 b=WGGFj4mt6PuSahHWZEr8dluYx/0luO2L0OBnkxEBYqmjfcbG7/z0d0MemcS5E8kfH5oeQ4EfgHdN6pjSYYuH6WXwZ7Z8/adRJnPI92J56xNR6Rz9UQ3Ejb3uyjZKUYvaVbA1kwQbAJX0DSCd7m29vn0LjwbRsB3aFqW/i2xFceM=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v4 0/6] lib{xc,xl}: support for guest MSR features
Date: Tue, 25 Jul 2023 15:05:52 +0200
Message-ID: <20230725130558.58094-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LNXP265CA0038.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:5c::26) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA1PR03MB6516:EE_
X-MS-Office365-Filtering-Correlation-Id: 159917cb-0db4-42a2-41ae-08db8d0fec38
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	dS0uPNeTcqWTODkM9tq8AytH1SLWqqsmKThGGnvhqLp6cHfnfpsGcbVfTLaelcVDzq0s2On43WkkXppZ8KX7oqzIm4OSvDdcvq8c4rZGkPKEZmeb7wmSVDVEH3DphJooKaagSmo0zTbN0ViaeefTpb82fGoqGeg1vSbPLECR9KPWQ73d0zQTSAoXXLnmqw2wdigEKhS/Xkt2WTcIb7SVMd/7TGOEYhi1d52skmuh9KHVxblkOpTAVAQbZpCTd0PyOR61yvuzB2qd65EWcJNc73N+i/yvY6RErGjA1Dj4DoPWRWVj7Zi/uJoGKywCYeaHptBlBv42I8BUjAx/+EeMeuSQp8oGIqqBcXPdk6u8FywzQYXjgIOv2baow01jRw0CoAPEbo9OBI3oDo3kVB+sjRIyoUod6odgm/htkBBu2k9ExjGfQclUYPrwimLjHoGeGZKyZqO0/eCkvnVnSmYPUw2WEeAZb9J/rq+JqSX2EvB/CFD6qv5y1yYBHhFMGFJ4nQDHlM0kZWofXTLSiYlDQJwEuh7nrdsZOKW1vJz9l6gMN9gdCOVL6J2cIjz0acLO
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(136003)(346002)(396003)(39860400002)(451199021)(6486002)(6666004)(82960400001)(478600001)(83380400001)(8936002)(1076003)(26005)(6512007)(6506007)(66946007)(38100700002)(66556008)(54906003)(6916009)(4326008)(66476007)(186003)(2616005)(5660300002)(8676002)(2906002)(316002)(41300700001)(86362001)(36756003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NDhXTHMzMlFDTnZSZVdFSHlwbnR3ZkR3ZjBwUkdyT3M5TFcwaTdyZEhpUHA4?=
 =?utf-8?B?WXh2TjRDa1QydC9hOG1MNDNIMVZzQTB3ZVk3VUxFdXh2YlpHWWxaVlFFZ0Fv?=
 =?utf-8?B?cFRKYXBFUjAycmhzYktIbTZyb2dzbVErZTdhbVVSdUFaaG83Wm9zWFgxQ0o0?=
 =?utf-8?B?Q0o5M2JGMzBJTDVxbFFaREFyekcrUjY3Mi8wWGdRbWE1M1FRbzUzb3c4L2lF?=
 =?utf-8?B?MnhJYzFaaFFVNDNhS0FRRjFXS1ExdlBjTUdmMnBQeTNLTm50ejRPUmJBM0pK?=
 =?utf-8?B?WEwva1lXdlp4RFhvQmtiVENFTWtmSGhSK3hPai9ZVHk2dlltL0YwQnpDdzh1?=
 =?utf-8?B?T0pQREFjMGpqMDNGUjgyS1dQYXV4Z3EwQXFmQ3BKVEZZSEQ4UzB6QVd4ZzFG?=
 =?utf-8?B?NmZMY3J1NyszTnhJRnhIYkd6bmJ3bjJ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?=
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	iORoeMOCo6kf+aIlRX1LgyaaKyK6NyFM6gSHhDST5v6q2h2102ZS3v6qv89uYUH0exzxbmJKnxJF2y/IHB14HmtlmIP7xWv41ZlNnh0/Mm6BHzIQtD174TXZjF6kFeLQU/DgUEeJcLkYi8gJYhL75Ym3jW7fk6Sp7QsJ7bvF0Sz795gsZvdovkwKrfhD7HBELQdJ9qmSAFsxdvHXQIVJUx1pnVT+dsONuzd1Hsmv7QSkArIBnOwZz4SBdgvAVdd6AGh67LJY95bbtiPdG9Gb3agTuwkM+vykdCHE0qhhQJTUglJU87V1lZrNSpgkRjMwqRqeUkP3XQMccbOvOG1sNk7vdhD0+BvJILZJCwcz2bEpN8rx5GLw2ishcPq0F+Yzh0+0j47PNH0GUYwZdeGpRtN4ldQD5FC/hkaWO4/TAAVc9RPJU4XWOlzIWFbQ/Ht97NRuIZFmRdT2GOP3yajKnIFtwzvx64hKfIIajqwxhy4nQ4/GbbrXXZJHWleUDFmf61Wo8e+nxNqjTbucetvlL6WLpKzWqgWVTHD9mZ08+uOn+JUgfC0avZhA/Iqqesfq0dXpptmZ/5UD5mAVm8cwfaNnsm19Q9YZKAsQUcVkbhqgpP9i+cs0fYy1OmbFTm1I4dYHyLe7436FWPzN90rSHK5R/RUIBGSIdm5OSyBtGxQ4ZcSn+hb/fhfavwsrylG8Ey3n3OxIRh504YJwWJnRZzxZREa0VwwZ1FZ6E0t8bqX1zstSZUCgJmWGVNfJsOTWvjgTvkewt6k4GdLjD7mn1WakxUTei4qrJeQOTvwYGw+A4NMh9DrYvHm/KKjEibXN
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 159917cb-0db4-42a2-41ae-08db8d0fec38
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 13:06:13.1809
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Q+HehgDM9az9wyqiwWlr50e/ViaujC2MtwwXgdUx06WB6YwQCtlWevxasGXOCZVfFn6pHtjOdbxm9SL68FPNTQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB6516

Hello,

The following series adds support for handling guest MSR features as
defined in arch-x86/cpufeatureset.h.

The end result is the user being able to use such features with the
xl.cfg(5) cpuid option.  This also involves adding support to all the
underlying layers, so both libxl and libxc also get new functionality in
order to properly parse those.

Thanks, Roger.

Roger Pau Monne (6):
  libs/guest: introduce support for setting guest MSRs
  libxl: change the type of libxl_cpuid_policy_list
  libxl: introduce MSR data in libxl_cpuid_policy
  libxl: split logic to parse user provided CPUID features
  libxl: use the cpuid feature names from cpufeatureset.h
  libxl: add support for parsing MSR features

 docs/man/xl.cfg.5.pod.in          |  24 +-
 tools/include/libxl.h             |   8 +-
 tools/include/xenctrl.h           |  21 +-
 tools/libs/guest/xg_cpuid_x86.c   | 169 +++++++-
 tools/libs/light/libxl_cpuid.c    | 672 ++++++++++++++++++------------
 tools/libs/light/libxl_internal.h |   5 +
 tools/libs/light/libxl_types.idl  |   2 +-
 tools/xl/xl_parse.c               |   3 +
 8 files changed, 612 insertions(+), 292 deletions(-)

-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 13:06:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 13:06:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569670.890581 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHkM-0004Rj-FW; Tue, 25 Jul 2023 13:06:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569670.890581; Tue, 25 Jul 2023 13:06:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHkM-0004RZ-Cc; Tue, 25 Jul 2023 13:06:38 +0000
Received: by outflank-mailman (input) for mailman id 569670;
 Tue, 25 Jul 2023 13:06:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=A3G+=DL=citrix.com=prvs=56320e048=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOHkL-0003uq-DN
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 13:06:37 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 14d87be6-2aec-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 15:06:36 +0200 (CEST)
Received: from mail-co1nam11lp2176.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.176])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 25 Jul 2023 09:06:33 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SA1PR03MB6516.namprd03.prod.outlook.com (2603:10b6:806:1c7::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 13:06:31 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6609.031; Tue, 25 Jul 2023
 13:06:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 14d87be6-2aec-11ee-b23f-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690290395;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=JIumuHTKjeGUw+xjOuW7QgTbX2kySrmgaixI+f/zzfA=;
  b=DFgX/0HgS/T2QiaHb4SMOlJtyxJH8L2GgV540GOq+eYW3QtfvVhzS8Xh
   yKwaJuZGta+F7fq0dLloiL2P9qHRKBAGFX4HTiiRnCKSeYBwoTaxWFHys
   KkcbZf2C5i+3PTt8hLrnKhGWb0gMMlwTe5ky3ISRq+Dilac8o5G9KUnNI
   A=;
X-IronPort-RemoteIP: 104.47.56.176
X-IronPort-MID: 117238716
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:6sNhbKl5rLf/Z6X8afdDSbno5gylJ0RdPkR7XQ2eYbSJt1+Wr1Gzt
 xIaDW2HM/rbMWb0fotzOY/l8h5QvpDQnIVnTwRl/n08QSMWpZLJC+rCIxarNUt+DCFhoGFPt
 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 =?us-ascii?q?8uJefJzFVYhiRqTOGTdpy?=
X-IronPort-AV: E=Sophos;i="6.01,230,1684814400"; 
   d="scan'208";a="117238716"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=kW/KYh8RNZ2GYvwGTTj0rcIpXQ4L+zCC2+QY90QTeIPAiOvzul1OOOy/zjDLaVTK4PUXuxwMNd/S73dvddsqF5P43+TJ5HolNJ9JpPrsPwXVXObWiu+ZhEXa2nzM2LR56pNzR3YzMsXeoHC01GrhrnG64Dm9c0C1C/4HkoPm6Ga+xXyZgxWduoXN9zkQh1vQNk4+zsJKvNi5XFZ+zScJ0FUVRP/fFqITPkjK6nEm+3dOO552BWAkg5OAA51rDwizfU94lxEyi2L359OBhjjJ/B7BPMU++vR4wtP2a70aAFMqkgBlRYCHY5e4xodwOHuMVQni1ZZ1+8+IinhbNhtvVg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=T7eRUdhf8n5WuI46Z6Zzvuxd+0+61lrZHp1tvM3LQ/4=;
 b=NoLe/QZvRWqstynHzS3Cp1HiTrEaeQ+wopI/xJzYgBGErrvWhG+9N9XRwRR1Ot8IH5HZv+Y1NVkEeYpgOGSRoJiFHvTx4tHt1ipGtgjBjaY3U3xVJDroyJ7X6bD4sEmJGYb4p7M5slcE6O3/Eo/Qim+5PKTA7z22RMZmiX0342ZQH95OjdBT+jFP/LLzoZ/hwoTS4Ez1nhng1cUd9sda3iyI0h+Gliswttz9pshuT391egFSwkH7ZHjdVLTYv4N3E8otNCEr+UE3kGmQWNZMS5y47Wj0lfhJx6oe+ZZW77/TghOQ6DNgOUSf3Yc8aNfLHOjUNkhgmHmTJfSjxGFknQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=T7eRUdhf8n5WuI46Z6Zzvuxd+0+61lrZHp1tvM3LQ/4=;
 b=ElRG6uALVEPV0/HYMSz9jT7/G3ZfjqeUOJXNfgWkb4FSncpsdmyUXPLbJAvzaIVsTj2Rdl9mzZ5dijphObnFFpyc6AoVaqyCbh1BD32sXfM/ft+ZWdvoKhmiN2ziALZkWtF/1QdSyjO8b2dJvjr8R8roHE6MvhinmaXbqy3ZsrU=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v4 3/6] libxl: introduce MSR data in libxl_cpuid_policy
Date: Tue, 25 Jul 2023 15:05:55 +0200
Message-ID: <20230725130558.58094-4-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230725130558.58094-1-roger.pau@citrix.com>
References: <20230725130558.58094-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0238.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a7::9) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA1PR03MB6516:EE_
X-MS-Office365-Filtering-Correlation-Id: c8afc498-b61d-4d10-1afe-08db8d0ff6f7
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	paeRlOQLrWbUX1W/YAGz+3GS5bvWjnMCSX5SS6B6ZkJ84LKJWT1AQz+0N34yxenXKNMFgbrXOjY+2Z9dE/G3JYPxIqsvjbWTITClOui2Yw61hi6plnGSyK0o30Dr1oEAoSAoMZFOkmddteaAKB3OScUP5Dpr+RJRW4LACGCgDm515g3ZiyqxGOX3ZuJ0OSYJKmXVJoSXlxm6eUsonUdoCD7qbjeY5J1TnSuExCTYfzK+ZDn5KLNcECvo4Jm0C798l92tV2nO7UN241O8ZmomrEyDffbwO97pgjrMtf4MCcf74gDl/4m6heKlOoStWTQZ3id4ReUzlXOIEHIBfJwNoPuvtXn6dmMrIRSDEdDJrDO9Og1Dly0g4Gadp85wrMM5deGtt98sVKaS/H3rn6QdkJt4BrNvJGzaVKOzq24V5vwxBDfGIeGS1aXK2sJc7uA/Ba5ekP3Hsc9isdbgwUnC/v4zSfexdAzzYkXzvlVO2Ew4fDKug3FcbvBU7keQrracopGmSvLADzwkHUKlrEpYg+cxD29o+ik39bIsSiAAtSvnpuZReAxwzIWiBFnClIYW
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(136003)(346002)(396003)(39860400002)(451199021)(6486002)(6666004)(82960400001)(478600001)(83380400001)(8936002)(1076003)(26005)(6512007)(6506007)(66946007)(38100700002)(66556008)(54906003)(6916009)(4326008)(66476007)(186003)(2616005)(5660300002)(8676002)(2906002)(316002)(41300700001)(86362001)(36756003);DIR:OUT;SFP:1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DZx6wkd8vAs4yijY1ESXrgq+psC5kfRxvB//0xIu4puRPsiDCtJwT5mlz/tI9fHYkNXcRChaiFBwen2Dszq2+XtnYE8t4f+JVbx/y527nbRh59uhXQb4dt97J5M3AqiYj0s4Yd8wUnmC6LXiO29Mtoi3oOzT8SOJ4h4DJID6HL8IDP8gBPncR+N6lVQPHgOggdmJWTR1h2JLBKVK97Q5ddhtewAeolRF3rznceU0l/zGfRptuxsHk/u0ujeMtAPfKyhi63j3zS9s2zbH9VXc6YLnP3/BM++fEpamSSWlC837IEVwVNcrgZqxGHZYgKcN84TBzB3EW8koJhmgV1Iz7FOt/9gE/xc2JZSDheY6BtZq/rTa/yNfyY9WUe7B+tj2GWc9jX9tFEbwizfFjJTsqCaL/iSHjnpvSVa71JPNbS+6eJN9ASU0p4+UQK4L25kSps1PENlfLvJEZirI6sHqaGBkiF7Ai6e
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c8afc498-b61d-4d10-1afe-08db8d0ff6f7
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 13:06:31.3225
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Ko7ipICwXvrHNhoLkkoNeKrSzrW2j6juq9m5ztZcRUM8b/SK+rLpbFtXRd/3Sh992EX0GsKQqxIwWVjxSZ/PYg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB6516

Add a new array field to libxl_cpuid_policy in order to store the MSR
policies.

Adding the MSR data in the libxl_cpuid_policy_list type is done so
that existing users can seamlessly pass MSR features as part of the
CPUID data, without requiring the introduction of a separate
domain_build_info field, and a new set of handlers functions.

Note that support for parsing the old JSON format is kept, as that's
required in order to restore domains or received migrations from
previous tool versions.  Differentiation between the old and the new
formats is done based on whether the contents of the 'cpuid' field is
an array or a map JSON object.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
Changes since v3:
 - Keep support for the old json format in the parse function.

Changes since v2:
 - Unconditionally call free().
 - Implement the JSON marshaling functions.
---
 tools/libs/light/libxl_cpuid.c    | 152 ++++++++++++++++++++++++++----
 tools/libs/light/libxl_internal.h |   1 +
 tools/libs/light/libxl_types.idl  |   2 +-
 3 files changed, 138 insertions(+), 17 deletions(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index 3c8b2a72c0b8..dd97699bbde7 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -16,7 +16,7 @@
 
 int libxl__cpuid_policy_is_empty(libxl_cpuid_policy_list *pl)
 {
-    return !libxl_cpuid_policy_list_length(pl);
+    return !*pl || (!libxl_cpuid_policy_list_length(pl) && !(*pl)->msr);
 }
 
 void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl)
@@ -40,6 +40,8 @@ void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl)
         free(policy->cpuid);
     }
 
+    free(policy->msr);
+
     free(policy);
     *pl = NULL;
     return;
@@ -516,7 +518,8 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
 
     r = xc_cpuid_apply_policy(ctx->xch, domid, restore, NULL, 0,
                               pae, itsc, nested_virt,
-                              info->cpuid ? info->cpuid->cpuid : NULL, NULL);
+                              info->cpuid ? info->cpuid->cpuid : NULL,
+                              info->cpuid ? info->cpuid->msr : NULL);
     if (r)
         LOGEVD(ERROR, -r, domid, "Failed to apply CPUID policy");
 
@@ -528,16 +531,22 @@ static const char *input_names[2] = { "leaf", "subleaf" };
 static const char *policy_names[4] = { "eax", "ebx", "ecx", "edx" };
 /*
  * Aiming for:
- * [
- *     { 'leaf':    'val-eax',
- *       'subleaf': 'val-ecx',
- *       'eax':     'filter',
- *       'ebx':     'filter',
- *       'ecx':     'filter',
- *       'edx':     'filter' },
- *     { 'leaf':    'val-eax', ..., 'eax': 'filter', ... },
- *     ... etc ...
- * ]
+ * {   'cpuid': [
+ *              { 'leaf':    'val-eax',
+ *                'subleaf': 'val-ecx',
+ *                'eax':     'filter',
+ *                'ebx':     'filter',
+ *                'ecx':     'filter',
+ *                'edx':     'filter' },
+ *              { 'leaf':    'val-eax', ..., 'eax': 'filter', ... },
+ *              ... etc ...
+ *     ],
+ *     'msr': [
+ *            { 'index': 'val-index',
+ *              'policy': 'filter', },
+ *              ... etc ...
+ *     ],
+ * }
  */
 
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
@@ -545,9 +554,16 @@ yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
 {
     libxl_cpuid_policy_list policy = *pl;
     struct xc_xend_cpuid *cpuid;
+    const struct xc_msr *msr;
     yajl_gen_status s;
     int i, j;
 
+    s = yajl_gen_map_open(hand);
+    if (s != yajl_gen_status_ok) goto out;
+
+    s = libxl__yajl_gen_asciiz(hand, "cpuid");
+    if (s != yajl_gen_status_ok) goto out;
+
     s = yajl_gen_array_open(hand);
     if (s != yajl_gen_status_ok) goto out;
 
@@ -582,6 +598,39 @@ yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
 
 empty:
     s = yajl_gen_array_close(hand);
+    if (s != yajl_gen_status_ok) goto out;
+
+    s = libxl__yajl_gen_asciiz(hand, "msr");
+    if (s != yajl_gen_status_ok) goto out;
+
+    s = yajl_gen_array_open(hand);
+    if (s != yajl_gen_status_ok) goto out;
+
+    if (!policy || !policy->msr) goto done;
+    msr = policy->msr;
+
+    for (i = 0; msr[i].index != XC_MSR_INPUT_UNUSED; i++) {
+        s = yajl_gen_map_open(hand);
+        if (s != yajl_gen_status_ok) goto out;
+
+        s = libxl__yajl_gen_asciiz(hand, "index");
+        if (s != yajl_gen_status_ok) goto out;
+        s = yajl_gen_integer(hand, msr[i].index);
+        if (s != yajl_gen_status_ok) goto out;
+        s = libxl__yajl_gen_asciiz(hand, "policy");
+        if (s != yajl_gen_status_ok) goto out;
+        s = yajl_gen_string(hand,
+                            (const unsigned char *)msr[i].policy, 64);
+        if (s != yajl_gen_status_ok) goto out;
+
+        s = yajl_gen_map_close(hand);
+        if (s != yajl_gen_status_ok) goto out;
+    }
+
+done:
+    s = yajl_gen_array_close(hand);
+    if (s != yajl_gen_status_ok) goto out;
+    s = yajl_gen_map_close(hand);
 out:
     return s;
 }
@@ -592,17 +641,32 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
 {
     int i, size;
     struct xc_xend_cpuid *l;
+    struct xc_msr *msr;
+    const libxl__json_object *co;
     flexarray_t *array;
+    bool cpuid_only = false;
+
+    if (libxl__json_object_is_array(o)) {
+        co = o;
+        cpuid_only = true;
+        goto parse_cpuid;
+    }
+
+    if (!libxl__json_object_is_map(o))
+        return ERROR_FAIL;
 
-    if (!libxl__json_object_is_array(o))
+    co = libxl__json_map_get("cpuid", o, JSON_ARRAY);
+    if (!libxl__json_object_is_array(co))
         return ERROR_FAIL;
 
-    array = libxl__json_object_get_array(o);
+parse_cpuid:
+    *p = libxl__calloc(NOGC, 1, sizeof(**p));
+
+    array = libxl__json_object_get_array(co);
     if (!array->count)
-        return 0;
+        goto cpuid_empty;
 
     size = array->count;
-    *p = libxl__calloc(NOGC, 1, sizeof(**p));
     /* need one extra slot as sentinel */
     l = (*p)->cpuid = libxl__calloc(NOGC, size + 1,
                                     sizeof(struct xc_xend_cpuid));
@@ -641,6 +705,42 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
                     libxl__strdup(NOGC, libxl__json_object_get_string(r));
         }
     }
+    if (cpuid_only)
+        return 0;
+
+cpuid_empty:
+    co = libxl__json_map_get("msr", o, JSON_ARRAY);
+    if (!libxl__json_object_is_array(co))
+        return ERROR_FAIL;
+
+    array = libxl__json_object_get_array(co);
+    if (!array->count)
+        return 0;
+    size = array->count;
+    /* need one extra slot as sentinel */
+    msr = (*p)->msr = libxl__calloc(NOGC, size + 1, sizeof(struct xc_msr));
+
+    msr[size].index = XC_MSR_INPUT_UNUSED;
+
+    for (i = 0; i < size; i++) {
+        const libxl__json_object *t, *r;
+
+        if (flexarray_get(array, i, (void**)&t) != 0)
+            return ERROR_FAIL;
+
+        if (!libxl__json_object_is_map(t))
+            return ERROR_FAIL;
+
+        r = libxl__json_map_get("index", t, JSON_INTEGER);
+        if (!r) return ERROR_FAIL;
+        msr[i].index = libxl__json_object_get_integer(r);
+        r = libxl__json_map_get("policy", t, JSON_STRING);
+        if (!r) return ERROR_FAIL;
+        if (strlen(libxl__json_object_get_string(r)) !=
+            ARRAY_SIZE(msr[i].policy) - 1)
+            return ERROR_FAIL;
+        strcpy(msr[i].policy, libxl__json_object_get_string(r));
+    }
 
     return 0;
 }
@@ -677,6 +777,10 @@ void libxl_cpuid_policy_list_copy(libxl_ctx *ctx,
     }
 
     *pdst = libxl__calloc(NOGC, 1, sizeof(**pdst));
+
+    if (!(*psrc)->cpuid)
+        goto copy_msr;
+
     dst = &(*pdst)->cpuid;
     src = &(*psrc)->cpuid;
     len = libxl_cpuid_policy_list_length(psrc);
@@ -696,6 +800,22 @@ void libxl_cpuid_policy_list_copy(libxl_ctx *ctx,
                 (*dst)[i].policy[j] = NULL;
     }
 
+copy_msr:
+    if ((*psrc)->msr) {
+        const struct xc_msr *msr = (*psrc)->msr;
+
+        for (i = 0; msr[i].index != XC_MSR_INPUT_UNUSED; i++)
+            ;
+        len = i;
+        (*pdst)->msr = libxl__calloc(NOGC, len + 1, sizeof(struct xc_msr));
+        (*pdst)->msr[len].index = XC_MSR_INPUT_UNUSED;
+
+        for (i = 0; i < len; i++) {
+            (*pdst)->msr[i].index = msr[i].index;
+            strcpy((*pdst)->msr[i].policy, msr[i].policy);
+        }
+    }
+
 out:
     GC_FREE;
 }
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index ef882cff3912..b1a7cd9f615b 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -4871,6 +4871,7 @@ _hidden int libxl__domain_set_paging_mempool_size(
 
 struct libxl__cpu_policy {
     struct xc_xend_cpuid *cpuid;
+    struct xc_msr *msr;
 };
 
 #endif
diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
index 9e48bb772646..fd2f3f6e485f 100644
--- a/tools/libs/light/libxl_types.idl
+++ b/tools/libs/light/libxl_types.idl
@@ -19,7 +19,7 @@ libxl_mac = Builtin("mac", json_parse_type="JSON_STRING", passby=PASS_BY_REFEREN
 libxl_bitmap = Builtin("bitmap", json_parse_type="JSON_ARRAY", dispose_fn="libxl_bitmap_dispose", passby=PASS_BY_REFERENCE,
                        check_default_fn="libxl_bitmap_is_empty", copy_fn="libxl_bitmap_copy_alloc")
 libxl_cpuid_policy_list = Builtin("cpuid_policy_list", dispose_fn="libxl_cpuid_dispose", passby=PASS_BY_REFERENCE,
-                                  json_parse_type="JSON_ARRAY", check_default_fn="libxl__cpuid_policy_is_empty",
+                                  json_parse_type="JSON_ANY", check_default_fn="libxl__cpuid_policy_is_empty",
                                   copy_fn="libxl_cpuid_policy_list_copy")
 
 libxl_string_list = Builtin("string_list", dispose_fn="libxl_string_list_dispose", passby=PASS_BY_REFERENCE,
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 13:06:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 13:06:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569671.890591 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHkO-0004iH-0e; Tue, 25 Jul 2023 13:06:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569671.890591; Tue, 25 Jul 2023 13:06:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHkN-0004i1-S8; Tue, 25 Jul 2023 13:06:39 +0000
Received: by outflank-mailman (input) for mailman id 569671;
 Tue, 25 Jul 2023 13:06:38 +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
 <SRS0=A3G+=DL=citrix.com=prvs=56320e048=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOHkM-0004BN-9V
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 13:06:38 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f852f70f-2aeb-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 15:05:46 +0200 (CEST)
Received: from mail-co1nam11lp2169.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.169])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 25 Jul 2023 09:06:27 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SA1PR03MB6516.namprd03.prod.outlook.com (2603:10b6:806:1c7::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 13:06:25 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6609.031; Tue, 25 Jul 2023
 13:06:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f852f70f-2aeb-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690290396;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=/DjRmCpyR41ndqdeo2ztSdCTQNy5XAVA3JYpNnatIeo=;
  b=NS3wq0BIDjGu6pXsjcrYtHbpSH3HbFmmLSvtLn3QFuDbZm0CtwdvhzZv
   0eFkZn9UJstnwPhSM2hsGUKOo+REOZJWt7Xd3n7ndmmHt3IaugS/SEHfG
   sRuieQfkWwfg786XlPrYbUjYuI0AxTR/YnpOiqYmdj+TVAlYSES4SuoLn
   E=;
X-IronPort-RemoteIP: 104.47.56.169
X-IronPort-MID: 119981299
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:vuFeb6MxV0vrVlDvrR2BlsFynXyQoLVcMsEvi/4bfWQNrUog0zxUy
 GFNCGqDaPjeajH3etwlYNmwpxkE7cfXmtJiQQto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v
 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/
 Nj/uKUzAnf8s9J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
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=QZXMP0bomo0LK1ts5N3E3/F2ffI6CDEPtUe7CmQNJKg7hTng1w6nlnZtyeQrChqa5g/9i5Jaf0f8YqVHcOpi5q+eqeqzsYvtc26Xb4nVaAc3THpQoUiO7G6CCrANIZJHvxGKEaXgUMMQ5QneuuZZ9xc70MhRK8T6ZhFj/CvZhs5Cxs03wrV5gFzRxv342F5GNXXW5YeONpeXeOKE+VV+QXG5C8hXpyHYBMsYn1wF41C3SM4SJ/vOtZnQbjbUmt8NjH+nI/1AXn4cy35L9zs5kgDNkEAxbrzI8DzLIbgEBMAiTEUfD0Wp0rJd7oSGzLLnTog7l4SrnLzqrc7cuXn3jg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OvAgEnMZzKsiO5gFVAUArv65sWJ/koiL8PS5eQmSiJs=;
 b=YrfJ5Ht7lWa/RmjXNc/nYgWNDwVQR5G1/YJNndcJ6qmq4enZU/5sFYH/B1RG5wn5D27M6YiZBizO5d9+2b/78ymNwJVpO9AK7wEDDaxASX4wnfDkSziY0scskGJ55BP05OFKXvAHBRgvvJRsZ9Wb50J2i/nV6HLQ9gxVZuohFMXhIsUAnO9Sc5MlUDJbwAkRXXPjWvSY7oQqmA+a+LKpS1BL7wR4EGetylFmrvO7pq2c5/7Xjo7na21za5FQJj7FuBAUYRJjcX9nQnxicWy0zsadx+ieiM2lSLSE0tD6/kOGpkIyMqgAjuXMxONHhfteZIhsUd0f0zERhBRTJzLefw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OvAgEnMZzKsiO5gFVAUArv65sWJ/koiL8PS5eQmSiJs=;
 b=TXemCq/e5A9HSugl/SdInMqG3e/h/2x854TDUcigBR82MeDdSYdN9RI2Ek5tek9o9P4pa4SfQ2ezq9kzqETltTvmZoF9/w7+sIw4JSlPLmwmENECGF57sXQjLo+HiM7i/+EK/6iT/pVpJhJ5EWD3a/4lYtNVUhiUO0J5vOAla+s=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v4 2/6] libxl: change the type of libxl_cpuid_policy_list
Date: Tue, 25 Jul 2023 15:05:54 +0200
Message-ID: <20230725130558.58094-3-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230725130558.58094-1-roger.pau@citrix.com>
References: <20230725130558.58094-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0552.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:319::14) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA1PR03MB6516:EE_
X-MS-Office365-Filtering-Correlation-Id: c810b45d-b3b5-4240-5c76-08db8d0ff361
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	CNEA1qaeQ11vMnyI0IzvN0e12CeU8T8koj5/bq5+wFMmD9mlZrPmrq7juTKmP3n+XQZw7o9Y7vD+eNh/udBogv8n22qbKE9E3OKViZTmMY3CyETkatMYTeru/crWTNIq8xEOFYBsa0cUOAS7swGzlPS/h8MCmjbmrOe6X0RZoLVaHQ0HJ73DM1l+8GD8R7c/U2jyXfGdb2Ix2VC+Wj/fUBVq4bwSi2z24kYEah+B4uoGxaZv9giW842SUZksumd/8BeRZubcD3vxZy8ofNB0S5XBq2keG5C1V0cGKCFFvXuxJUr2OPRScksG4ec134tYWB33YMuvEPl1/bz1Y49B0BIT2yP3lYfjsXQbiRrxfJTm+pUnTvhiUk/xh3/8XdZwjrd+tz9DqUoSHBtyaEjfY1G66j9wLzfk+cG9MfbWIL/a9z883pXqlJKyO75oCmD9B2owwIoGHOzVVtOYP5OkYfW1jnnbwBjMvRjAiRXZ6FA9VQY3gHur8lZwRzhyIKa3N4R6cNd2iTvH4ms9SA1vKv7gvFICfVIzOyAEJL0+DkCB1UjJtJ5JgNNgwZHl+I0b
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(136003)(346002)(396003)(39860400002)(451199021)(6486002)(6666004)(82960400001)(478600001)(83380400001)(8936002)(1076003)(26005)(6512007)(6506007)(66946007)(38100700002)(66556008)(54906003)(6916009)(4326008)(66476007)(186003)(2616005)(5660300002)(8676002)(2906002)(316002)(41300700001)(86362001)(36756003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dnNqcjdqc1pIazd1ZEI2R2xwamlx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1wCzz/HVLT4JUskNxtOnJThokOQMICqLTlFnzmcD2QC+ErEP6TSIE45sqerJqeLCM5d4YwsJ7sc5cURKS+8G3UDCN1gMmCuDuBGcqwm/X+hE+hWXNL0hZ5eIFIV1KbUnsc6eHDeFQCJ8Sc60iAHwN4sBsi4jIBOcJiFurLvD1GsHRw969ST8l69gNs0LSa0tttkyFMvstun0LF4m62yJE10imOXoh/lFbcU3T1s6skR5QxbGk3wAf9VWUPlo5tmc4VPHqAOLJ0ih3GAM2oPLTq6b3+cqUZPrVBrRWnmoaLvZmC7u95chmAidCZyUN2ryx4wmRz3kXckjdhAO93FFl0doMMr3uXvAn0XRMpDUGadMVS6iW1pOhelOVih8QtPTd7Cq8Rm
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c810b45d-b3b5-4240-5c76-08db8d0ff361
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 13:06:25.2836
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: gklcuy1WpFY+prOgUOoBkRJmEiza7S6Tl4/gNhM1ckOVjmihXETUp5RqHnbZdeXkQ/HnKjb+qbvh/zSdnJUzcw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB6516

Currently libxl_cpuid_policy_list is an opaque type to the users of
libxl, and internally it's an array of xc_xend_cpuid objects.

Change the type to instead be a structure that contains one array for
CPUID policies, in preparation for it also holding another array for
MSR policies.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
---
Changes since v2:
 - Add braces in the inner loop.
 - Do not set the policy to NULL.
---
 tools/include/libxl.h             |  8 +--
 tools/libs/light/libxl_cpuid.c    | 87 ++++++++++++++++++++-----------
 tools/libs/light/libxl_internal.h |  4 ++
 3 files changed, 63 insertions(+), 36 deletions(-)

diff --git a/tools/include/libxl.h b/tools/include/libxl.h
index cac641a7eba2..f3975ecc021f 100644
--- a/tools/include/libxl.h
+++ b/tools/include/libxl.h
@@ -1455,12 +1455,8 @@ typedef struct {
 void libxl_bitmap_init(libxl_bitmap *map);
 void libxl_bitmap_dispose(libxl_bitmap *map);
 
-/*
- * libxl_cpuid_policy is opaque in the libxl ABI.  Users of both libxl and
- * libxc may not make assumptions about xc_xend_cpuid.
- */
-typedef struct xc_xend_cpuid libxl_cpuid_policy;
-typedef libxl_cpuid_policy * libxl_cpuid_policy_list;
+struct libxl__cpu_policy;
+typedef struct libxl__cpu_policy *libxl_cpuid_policy_list;
 void libxl_cpuid_dispose(libxl_cpuid_policy_list *cpuid_list);
 int libxl_cpuid_policy_list_length(const libxl_cpuid_policy_list *l);
 void libxl_cpuid_policy_list_copy(libxl_ctx *ctx,
diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index c96aeb3bce46..3c8b2a72c0b8 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -19,22 +19,29 @@ int libxl__cpuid_policy_is_empty(libxl_cpuid_policy_list *pl)
     return !libxl_cpuid_policy_list_length(pl);
 }
 
-void libxl_cpuid_dispose(libxl_cpuid_policy_list *p_cpuid_list)
+void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl)
 {
-    int i, j;
-    libxl_cpuid_policy_list cpuid_list = *p_cpuid_list;
+    libxl_cpuid_policy_list policy = *pl;
 
-    if (cpuid_list == NULL)
+    if (policy == NULL)
         return;
-    for (i = 0; cpuid_list[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
-        for (j = 0; j < 4; j++)
-            if (cpuid_list[i].policy[j] != NULL) {
-                free(cpuid_list[i].policy[j]);
-                cpuid_list[i].policy[j] = NULL;
+
+    if (policy->cpuid) {
+        unsigned int i, j;
+        struct xc_xend_cpuid *cpuid_list = policy->cpuid;
+
+        for (i = 0; cpuid_list[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
+            for (j = 0; j < 4; j++) {
+                if (cpuid_list[i].policy[j] != NULL) {
+                    free(cpuid_list[i].policy[j]);
+                }
             }
+        }
+        free(policy->cpuid);
     }
-    free(cpuid_list);
-    *p_cpuid_list = NULL;
+
+    free(policy);
+    *pl = NULL;
     return;
 }
 
@@ -62,11 +69,17 @@ struct cpuid_flags {
 /* go through the dynamic array finding the entry for a specified leaf.
  * if no entry exists, allocate one and return that.
  */
-static libxl_cpuid_policy_list cpuid_find_match(libxl_cpuid_policy_list *list,
-                                          uint32_t leaf, uint32_t subleaf)
+static struct xc_xend_cpuid *cpuid_find_match(libxl_cpuid_policy_list *pl,
+                                              uint32_t leaf, uint32_t subleaf)
 {
+    libxl_cpuid_policy_list policy = *pl;
+    struct xc_xend_cpuid **list;
     int i = 0;
 
+    if (policy == NULL)
+        policy = *pl = calloc(1, sizeof(*policy));
+
+    list = &policy->cpuid;
     if (*list != NULL) {
         for (i = 0; (*list)[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
             if ((*list)[i].input[0] == leaf && (*list)[i].input[1] == subleaf)
@@ -86,7 +99,7 @@ static libxl_cpuid_policy_list cpuid_find_match(libxl_cpuid_policy_list *list,
  * Will overwrite earlier entries and thus can be called multiple
  * times.
  */
-int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
+int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
 {
 #define NA XEN_CPUID_INPUT_UNUSED
     static const struct cpuid_flags cpuid_flags[] = {
@@ -345,7 +358,7 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
     if (flag->name == NULL) {
         return 2;
     }
-    entry = cpuid_find_match(cpuid, flag->leaf, flag->subleaf);
+    entry = cpuid_find_match(policy, flag->leaf, flag->subleaf);
     resstr = entry->policy[flag->reg - 1];
     num = strtoull(val, &endptr, 0);
     flags[flag->length] = 0;
@@ -400,7 +413,7 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
  * the strings for each register were directly exposed to the user.
  * Used for maintaining compatibility with older config files
  */
-int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *cpuid,
+int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *policy,
                                   const char* str)
 {
     char *endptr;
@@ -427,7 +440,7 @@ int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *cpuid,
         return 3;
     }
     str = endptr + 1;
-    entry = cpuid_find_match(cpuid, leaf, subleaf);
+    entry = cpuid_find_match(policy, leaf, subleaf);
     for (str = endptr + 1; *str != 0;) {
         if (str[0] != 'e' || str[2] != 'x') {
             return 4;
@@ -502,7 +515,8 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
             info->tsc_mode == LIBXL_TSC_MODE_ALWAYS_EMULATE);
 
     r = xc_cpuid_apply_policy(ctx->xch, domid, restore, NULL, 0,
-                              pae, itsc, nested_virt, info->cpuid, NULL);
+                              pae, itsc, nested_virt,
+                              info->cpuid ? info->cpuid->cpuid : NULL, NULL);
     if (r)
         LOGEVD(ERROR, -r, domid, "Failed to apply CPUID policy");
 
@@ -527,16 +541,18 @@ static const char *policy_names[4] = { "eax", "ebx", "ecx", "edx" };
  */
 
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
-                                libxl_cpuid_policy_list *pcpuid)
+                                libxl_cpuid_policy_list *pl)
 {
-    libxl_cpuid_policy_list cpuid = *pcpuid;
+    libxl_cpuid_policy_list policy = *pl;
+    struct xc_xend_cpuid *cpuid;
     yajl_gen_status s;
     int i, j;
 
     s = yajl_gen_array_open(hand);
     if (s != yajl_gen_status_ok) goto out;
 
-    if (cpuid == NULL) goto empty;
+    if (policy == NULL || policy->cpuid == NULL) goto empty;
+    cpuid = policy->cpuid;
 
     for (i = 0; cpuid[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
         s = yajl_gen_map_open(hand);
@@ -575,7 +591,7 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
                                         libxl_cpuid_policy_list *p)
 {
     int i, size;
-    libxl_cpuid_policy_list l;
+    struct xc_xend_cpuid *l;
     flexarray_t *array;
 
     if (!libxl__json_object_is_array(o))
@@ -586,8 +602,10 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
         return 0;
 
     size = array->count;
+    *p = libxl__calloc(NOGC, 1, sizeof(**p));
     /* need one extra slot as sentinel */
-    l = *p = libxl__calloc(NOGC, size + 1, sizeof(libxl_cpuid_policy));
+    l = (*p)->cpuid = libxl__calloc(NOGC, size + 1,
+                                    sizeof(struct xc_xend_cpuid));
 
     l[size].input[0] = XEN_CPUID_INPUT_UNUSED;
     l[size].input[1] = XEN_CPUID_INPUT_UNUSED;
@@ -630,8 +648,12 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
 int libxl_cpuid_policy_list_length(const libxl_cpuid_policy_list *pl)
 {
     int i = 0;
-    libxl_cpuid_policy_list l = *pl;
+    const struct xc_xend_cpuid *l;
+
+    if (*pl == NULL)
+        return 0;
 
+    l = (*pl)->cpuid;
     if (l) {
         while (l[i].input[0] != XEN_CPUID_INPUT_UNUSED)
             i++;
@@ -641,20 +663,25 @@ int libxl_cpuid_policy_list_length(const libxl_cpuid_policy_list *pl)
 }
 
 void libxl_cpuid_policy_list_copy(libxl_ctx *ctx,
-                                  libxl_cpuid_policy_list *dst,
-                                  const libxl_cpuid_policy_list *src)
+                                  libxl_cpuid_policy_list *pdst,
+                                  const libxl_cpuid_policy_list *psrc)
 {
+    struct xc_xend_cpuid **dst;
+    struct xc_xend_cpuid *const *src;
     GC_INIT(ctx);
     int i, j, len;
 
-    if (*src == NULL) {
-        *dst = NULL;
+    if (*psrc == NULL) {
+        *pdst = NULL;
         goto out;
     }
 
-    len = libxl_cpuid_policy_list_length(src);
+    *pdst = libxl__calloc(NOGC, 1, sizeof(**pdst));
+    dst = &(*pdst)->cpuid;
+    src = &(*psrc)->cpuid;
+    len = libxl_cpuid_policy_list_length(psrc);
     /* one extra slot for sentinel */
-    *dst = libxl__calloc(NOGC, len + 1, sizeof(libxl_cpuid_policy));
+    *dst = libxl__calloc(NOGC, len + 1, sizeof(struct xc_xend_cpuid));
     (*dst)[len].input[0] = XEN_CPUID_INPUT_UNUSED;
     (*dst)[len].input[1] = XEN_CPUID_INPUT_UNUSED;
 
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index 1cf3d400bfce..ef882cff3912 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -4869,6 +4869,10 @@ int libxl__setresuid(uid_t ruid, uid_t euid, uid_t suid);
 _hidden int libxl__domain_set_paging_mempool_size(
     libxl__gc *gc, libxl_domain_config *d_config, uint32_t domid);
 
+struct libxl__cpu_policy {
+    struct xc_xend_cpuid *cpuid;
+};
+
 #endif
 
 /*
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 13:06:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 13:06:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569672.890601 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHkT-000534-8W; Tue, 25 Jul 2023 13:06:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569672.890601; Tue, 25 Jul 2023 13:06:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHkT-00052v-5C; Tue, 25 Jul 2023 13:06:45 +0000
Received: by outflank-mailman (input) for mailman id 569672;
 Tue, 25 Jul 2023 13:06:44 +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
 <SRS0=A3G+=DL=citrix.com=prvs=56320e048=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOHkR-0004BN-Ry
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 13:06:43 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fabb7852-2aeb-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 15:05:52 +0200 (CEST)
Received: from mail-co1nam11lp2175.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.175])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 25 Jul 2023 09:06:39 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SA1PR03MB6516.namprd03.prod.outlook.com (2603:10b6:806:1c7::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 13:06:36 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6609.031; Tue, 25 Jul 2023
 13:06:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fabb7852-2aeb-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690290401;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=3YW2uWrH0cDvz/qKgkm2RdMtfdnR+LKEqygNTbfvJjA=;
  b=dQBSZwaLQj5QMfayv8gWbneKNrWBspYvRwlWncrCsMjexZFTuHl/T+Dg
   nNsQJipwFM5rZkZ7ciHzUGjtgOz/U5SAafRdRnznzrdn4I5M98uykXgkC
   5/TTNcRiF7QNFOWQ+5gjAN+Rxw/JO4Huom+nrsCJYN8TRubEc4WDIWhMX
   A=;
X-IronPort-RemoteIP: 104.47.56.175
X-IronPort-MID: 117795529
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:l7pT2anBQev/1El6WeMxiSro5gylJ0RdPkR7XQ2eYbSJt1+Wr1Gzt
 xIWDGyEaf7Ya2KmKNB1Po7joEgH6JHXmoU3HQA5ri03QyMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5gKGzhH5MbpETU2PByqgKmVrNrbSq
 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/
 f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3
 dU8FWAITQiSvaGv0bi8FrlwhcslcNa+aevzulk4pd3YJdAPZMmaBo7tvJpf1jp2gd1SF/HDY
 cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVkVI3ieewWDbWUoXiqcF9hEGXq
 3iA523kKhobKMae2XyO9XfEaurnxHqkB9NPSefpnhJsqFqQ51cQMhkaaRyE+OCgqxSYB+ptE
 VNBr0LCqoB3riRHVOLVTxC+5XKJoBMYc95RCPEhrhGAzLLO5ASUDXRCSSROAPQ5sOcmSDps0
 UWG9/vrCiZoq6a9Um+G+/GfqjbaBMQOBWoLZCtBRgxc5dDm+dg3lkiWEYslF7OphNroHz222
 yqNsCU1m7QUi4gMyrm/+lfExTmro/AlUzII2+keZUr9hisRWWJvT9XABYTzhRqYELukcw==
IronPort-HdrOrdr: A9a23:+GvE36FnwL6TdsTHpLqE7MeALOsnbusQ8zAXPiFKJSC9F/byqy
 nAppsmPHPP5gr5IUtQ/uxoWpPhfZqsz/9ICOAqVN/JMTUO01HYT72Kg7GSpgHIKmnT8fNcyL
 clU4UWMqyVMbGit7eZ3DWF
X-Talos-CUID: 9a23:U3I9Dm9HBBJ/JP5JgxiVv2cwJ5AgUWXM9jTJMkW/VTZ1S7KTFUDFrQ==
X-Talos-MUID: =?us-ascii?q?9a23=3A/e139g9kVmO+sRO2Skgx+DGQf8Brwp+tMkQBrdI?=
 =?us-ascii?q?54tCdFHZWZw+vtiviFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,230,1684814400"; 
   d="scan'208";a="117795529"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LCtSwQLq1Gls2hTnfurr/Xz9Nz3Ia09KzLde1qICbHmLAWQAsZFGdCl6vmCS+jiCwcyjNIfYF/rjoqKboBHU/bUKpGeu3kvRetgYsY2GQGY4+HK8gi07G7rU5+ZQjxBcK3nlCXrFI5lTeJ0EOuIu7QU/s9VcBlIGmp8WIcHj23gJ8QxeJX8ha4wIy7m7E6LSaMMfwM1rxAW8/3+4vYJSn4V7yt7mpd4YPyhsmqunW/C8iHobu/xMNiMohP2Z56ozdBXhqeeULvz6tb1J+8MA2Hg3sR3O809JNsTe7c7PEkoxSWONyEkH1WypVhl7l9pGx2RadCSMMvukN1zJUb67jA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0VuaruMFBkjm32zvsZJXEPKcdb4HJwG3XWzAhS0qQtk=;
 b=egSXSQeMHCwIeJN2dpvvH62kIUQ1tlFbUSBL8g48Sji+HJbUnlQfK6b668NfY6Uhfc8kol5fIzOBTKVxwBja6AXg/o6pqznI0I4y/LrHXJDyMXo3Hg1Nk3Oy3czFIsYIaOGCxPy0YQK/rPuP5zIKdP4oUvhrgZ7YwNUkTAWLD9joXnT99jcpk/3V/DTI4Uy+jHeGhp+Fv7xT3awil1lsiOOPOYdLvL3yqOpGoDR6uGdBczv1zOj0ke+AJO9vWU1/wA9oeIscJrSMzsbiGF++N3+M4YOE2FOKVKk1pxCPn2Nzg2iMeKnrQZ0wcgSqEQOcErIQv9gRaKa7Qbd3+DPyMQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0VuaruMFBkjm32zvsZJXEPKcdb4HJwG3XWzAhS0qQtk=;
 b=D7JVqtUg2/4SIQauCDh2Bv90795Fq6HQJSezaVChS7maYb14ZxdPyN0/mSzfQ8hxsSpz+9FngzrD3NgSIqw3Dw1AS3+crFzMh2HNkvHVOi3/pUkkWUtPCcgvcd1KRm5WSpsUW2RDWnxL9/vlEugG3mh8UIF47WxrReNB24CjQt8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v4 4/6] libxl: split logic to parse user provided CPUID features
Date: Tue, 25 Jul 2023 15:05:56 +0200
Message-ID: <20230725130558.58094-5-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230725130558.58094-1-roger.pau@citrix.com>
References: <20230725130558.58094-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P265CA0494.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:13a::19) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA1PR03MB6516:EE_
X-MS-Office365-Filtering-Correlation-Id: b3b60524-1da8-45ff-2fab-08db8d0ffa3e
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	NNw0DSUyAqQaAVVCQd2pMffUYw5wdLUDH7Uj0y4oQo9G7THSjfsJzdsf49TFEKDqh9QHTfiidU36G8krmeEXEYi/7J2h8Wo/xiS4rd2av+PNp+rzvGc1+H4C1XK2F4j8bxRZWLx+cKpd1qiqPVrwU4oB4dqkkJRL4TgCGA5/Ojof0PXQuyF/tFwOJpocT1Ux5zByccbvLaxYSDoTS4yUiG8Sla54TNB3/iTS+xR9sbVOmkW4thMtFBcS00ZDVSIHPOYgB64l5KRuQsHVIOvur/lfZJMgr5rCkqpUEyiMgKPXsTIRAQ2BBP6gPMBTBCyzMsIT/mGzhi8LxvJpVSuqgSwXWn28e6bSLVRV3grUZbGRScYCIweE1k3WdpjceeUGBATxAP+V2YtFFCY+kE12Ja1SN0D2AIBxxhg01f5ff0yT7jNwpTXzt7MHoR+4Gl1HTDCJHxcFRxq2lW2RBWuSHwrIMtxHqYjvdP+5TZWoOo+AbFnQ+rMV8dcX0Aj23SjT1b+uuIjAYU8Brw/x/3DpQZrEhNBbn11Fte19iQyATB2vumH23vAnjwAi1G77OPCd
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(136003)(346002)(396003)(39860400002)(451199021)(6486002)(6666004)(82960400001)(478600001)(83380400001)(8936002)(1076003)(26005)(6512007)(6506007)(66946007)(38100700002)(66556008)(54906003)(6916009)(4326008)(66476007)(186003)(2616005)(5660300002)(8676002)(2906002)(316002)(41300700001)(86362001)(36756003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YldKZ0hneWNCZWl3TkZOUUVOV01TTklBTXJISTJqZW0wOU41V0ovV29IaktR?=
 =?utf-8?B?d0RlRWZkOU5GRm0zK0JGNDlJK3VzN2N6aWpwZCtrdU9vMUs3c0h3eWZlTE5a?=
 =?utf-8?B?MVhhU251ZUZHU3lPSUp6Znhlb0JzWVAwY3g4TWJoYVpjRU9EM1NUS251ZExz?=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X275p92IRQ/zLgET1Iexkj4PziD9cfa9WoSINw7A++QCEmH1EE3bOXUHAM6EMDZkeJf/jd/B+KAlE3fWv6m6IxUgqr2QrpeIKW8Oa56Q1E1k0IEMT2Nruty+mDwx4Abkgo321u1VmjvVA/o6Izg1ziQIpa+AapzCb25OwZye+LcC
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b3b60524-1da8-45ff-2fab-08db8d0ffa3e
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 13:06:36.6710
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 3XYaVcH2aXV3HgNi1QraV9fTnZT6qnMFZP3HuUMVrL9brfqM84iy5NybVjjcKfzo9gmkGsrrAi5zpmY5iLUUqw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB6516

Move the CPUID value parsers out of libxl_cpuid_parse_config() into a
newly created cpuid_add() local helper.  This is in preparation for
also adding MSR feature parsing support.

No functional change intended.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
---
Changes since v3:
 - Fix UB and use strtoul.
---
 tools/libs/light/libxl_cpuid.c | 120 +++++++++++++++++----------------
 1 file changed, 63 insertions(+), 57 deletions(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index dd97699bbde7..f04b192c0e44 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -96,6 +96,66 @@ static struct xc_xend_cpuid *cpuid_find_match(libxl_cpuid_policy_list *pl,
     return *list + i;
 }
 
+static int cpuid_add(libxl_cpuid_policy_list *policy,
+                     const struct cpuid_flags *flag, const char *val)
+{
+    struct xc_xend_cpuid *entry = cpuid_find_match(policy, flag->leaf,
+                                                   flag->subleaf);
+    unsigned long num;
+    char flags[33], *resstr, *endptr;
+    unsigned int i;
+
+    resstr = entry->policy[flag->reg - 1];
+    num = strtoul(val, &endptr, 0);
+    flags[flag->length] = 0;
+    if (endptr != val) {
+        /* if this was a valid number, write the binary form into the string */
+        for (i = 0; i < flag->length; i++) {
+            flags[flag->length - 1 - i] = "01"[(num >> i) & 1];
+        }
+    } else {
+        switch(val[0]) {
+        case 'x': case 'k': case 's':
+            memset(flags, val[0], flag->length);
+            break;
+        default:
+            return 3;
+        }
+    }
+
+    if (resstr == NULL) {
+        resstr = strdup("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
+    }
+
+    /* the family and model entry is potentially split up across
+     * two fields in Fn0000_0001_EAX, so handle them here separately.
+     */
+    if (!strcmp(flag->name, "family")) {
+        if (num < 16) {
+            memcpy(resstr + (32 - 4) - flag->bit, flags + 4, 4);
+            memcpy(resstr + (32 - 8) - 20, "00000000", 8);
+        } else {
+            num -= 15;
+            memcpy(resstr + (32 - 4) - flag->bit, "1111", 4);
+            for (i = 0; i < 7; i++) {
+                flags[7 - i] = "01"[num & 1];
+                num >>= 1;
+            }
+            memcpy(resstr + (32 - 8) - 20, flags, 8);
+        }
+    } else if (!strcmp(flag->name, "model")) {
+        memcpy(resstr + (32 - 4) - 16, flags, 4);
+        memcpy(resstr + (32 - 4) - flag->bit, flags + 4, 4);
+    } else {
+        memcpy(resstr + (32 - flag->length) - flag->bit, flags,
+               flag->length);
+    }
+    entry->policy[flag->reg - 1] = resstr;
+
+    return 0;
+
+}
+
 /* parse a single key=value pair and translate it into the libxc
  * used interface using 32-characters strings for each register.
  * Will overwrite earlier entries and thus can be called multiple
@@ -340,12 +400,8 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
         {NULL, 0, NA, CPUID_REG_INV, 0, 0}
     };
 #undef NA
-    char *sep, *val, *endptr;
-    int i;
+    const char *sep, *val;
     const struct cpuid_flags *flag;
-    struct xc_xend_cpuid *entry;
-    unsigned long num;
-    char flags[33], *resstr;
 
     sep = strchr(str, '=');
     if (sep == NULL) {
@@ -355,60 +411,10 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
     }
     for (flag = cpuid_flags; flag->name != NULL; flag++) {
         if(!strncmp(str, flag->name, sep - str) && flag->name[sep - str] == 0)
-            break;
-    }
-    if (flag->name == NULL) {
-        return 2;
-    }
-    entry = cpuid_find_match(policy, flag->leaf, flag->subleaf);
-    resstr = entry->policy[flag->reg - 1];
-    num = strtoull(val, &endptr, 0);
-    flags[flag->length] = 0;
-    if (endptr != val) {
-        /* if this was a valid number, write the binary form into the string */
-        for (i = 0; i < flag->length; i++) {
-            flags[flag->length - 1 - i] = "01"[!!(num & (1 << i))];
-        }
-    } else {
-        switch(val[0]) {
-        case 'x': case 'k': case 's':
-            memset(flags, val[0], flag->length);
-            break;
-        default:
-            return 3;
-        }
-    }
-
-    if (resstr == NULL) {
-        resstr = strdup("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
+            return cpuid_add(policy, flag, val);
     }
 
-    /* the family and model entry is potentially split up across
-     * two fields in Fn0000_0001_EAX, so handle them here separately.
-     */
-    if (!strncmp(str, "family", sep - str)) {
-        if (num < 16) {
-            memcpy(resstr + (32 - 4) - flag->bit, flags + 4, 4);
-            memcpy(resstr + (32 - 8) - 20, "00000000", 8);
-        } else {
-            num -= 15;
-            memcpy(resstr + (32 - 4) - flag->bit, "1111", 4);
-            for (i = 0; i < 7; i++) {
-                flags[7 - i] = "01"[num & 1];
-                num >>= 1;
-            }
-            memcpy(resstr + (32 - 8) - 20, flags, 8);
-        }
-    } else if (!strncmp(str, "model", sep - str)) {
-        memcpy(resstr + (32 - 4) - 16, flags, 4);
-        memcpy(resstr + (32 - 4) - flag->bit, flags + 4, 4);
-    } else {
-        memcpy(resstr + (32 - flag->length) - flag->bit, flags,
-               flag->length);
-    }
-    entry->policy[flag->reg - 1] = resstr;
-
-    return 0;
+    return 2;
 }
 
 /* parse a single list item from the legacy Python xend syntax, where
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 13:06:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 13:06:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569675.890611 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHkd-0005f8-Md; Tue, 25 Jul 2023 13:06:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569675.890611; Tue, 25 Jul 2023 13:06:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHkd-0005ez-Ja; Tue, 25 Jul 2023 13:06:55 +0000
Received: by outflank-mailman (input) for mailman id 569675;
 Tue, 25 Jul 2023 13:06:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=A3G+=DL=citrix.com=prvs=56320e048=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOHkc-0003uq-9c
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 13:06:54 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1f372882-2aec-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 15:06:53 +0200 (CEST)
Received: from mail-co1nam11lp2175.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.175])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 25 Jul 2023 09:06:51 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SA1PR03MB6516.namprd03.prod.outlook.com (2603:10b6:806:1c7::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 13:06:49 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6609.031; Tue, 25 Jul 2023
 13:06:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1f372882-2aec-11ee-b23f-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690290413;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=8h94lYnckg0tD+pN5EVmt3fI//N3Vydy/cqPpyKBrQo=;
  b=hLZFRLreukjkjmYEWIMxHGqfiAgCPjLQ7+9NvCyrMQHU5Zs91OQhq8yG
   S/ytbkDO6LohsErBh1E3F/RHnPli+kmHL6RuGH2jbZmLE3JDAuLA00uzN
   FzoOB/1o71ZJnMb6sb/mL5BzEbfdQSHHWSdtXJ8kgZuHVUvEVH6Ttjn9O
   s=;
X-IronPort-RemoteIP: 104.47.56.175
X-IronPort-MID: 117381056
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:cGTcoK3T0sBB2+9Io/bD5fdwkn2cJEfYwER7XKvMYLTBsI5bpzUBz
 WJKCz/XO/iONGKmeIx2Otvj8EpTuJbRmoVlGgA/pC1hF35El5HIVI+TRqvS04F+DeWYFR46s
 J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo
 tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5gNkOKgS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL
 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ
 OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfOj9Nq
 tpHJw00bwm8wMWv/em7S7FPmZF2RCXrFNt3VnBI6xj8VK9jareaBqLA6JlfwSs6gd1IEbDGf
 c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxqvS6Kk1EZPLvFabI5fvSQQspYhACAr
 3/u9GXlGBAKcteYzFJp91r137CUzXqjBdx6+LuQ/aJPglye520pVyYdFlqlp6iBh2WGYocKQ
 6AT0m90xUQoz2S7Q9+4UxCmrXqsuh8HR8EWA+A88BuKyKff/0CeHGdsZiFFQMwrsokxXzNC/
 l2GhdTyHhR0raaYD3ma89+pQSiaPCEUKSoJYnYCRA5cut37+ths01TIU8ppF7OzgpvtAzbsz
 juWrS84wbIOkcoM0Kb99lfC696xmqX0oscOzl2/dgqYAslRP+ZJu6TABYDn0Mt9
IronPort-HdrOrdr: A9a23:JI4szKwbv3O7ecj5K3+3KrPxaeskLtp133Aq2lEZdPU1SL3sqy
 nKpp906faaslYssQ4b6Ky90cW7IE80lqQFkrX5Q43SPjUO0VHAROtfBODZsl7d8kPFh4tgPa
 wJSdkANDWZZ2IXsS6QijPWLz7uquPrzImYwd77i1NRZUVSbadkhj0JeDpy0CdNNXd77V5SLu
 vt2iKDzQDQCEj/Ff7LYkUtbqz4vtjWk5CjSQcebiRXkTWmvHeT8bvnFBrd9QsfVj4n+8ZezU
 H11zbh47mlsbWdwhvRvlWjiKh+qZ/a095eA87JrNYTJi6EsHfPWK1RH4eauSwzoqWUyHtCqq
 i1nz4Qe/5r7m/XfCWOrQDz1xLG2DIjgkWSsmOwsD/YuMnkQzB/NMZbn4JedXLimjAdgO0=
X-Talos-CUID: 9a23:fiZWLGNCS0LeUO5DY3dkq2hLFf0cc2Tii1DJHhS4CD5KV+jA
X-Talos-MUID: 9a23:go6S4AQaWtZ4cXdfRXTn2BRgNcpJ4p7xM0tOkIsA6vGJHhRJbmI=
X-IronPort-AV: E=Sophos;i="6.01,230,1684814400"; 
   d="scan'208";a="117381056"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=XdFIcAWrIrreNII2IBy/vsOV4e6ygiJo3meTf5PdODv2bAD9bvZaoBlGhCbThEx/f9T1AxTqv8M7lU4pCLza/3+WDlNCpHzvbUsqmDD+eckqjFT801+2D4/tyRh2NKRVPOhcZqpH8OZbnAsntdtlCoq5S9X+tzOFMBMhG6Ijcn9jQcjPMsfPEWtcXHVMeE8SFrMGCALHVr+EspJsf0/ku6wr/GaL3lkvyOo2q5HK2YnsuIGcTrp/gqI5GPt5Ps/CfZNf5Eq98HP1SZzQEGcpbvr7Ejo6jBcpoFOeq5gEnrYVckiBbB00AhWw3XhFsRsqMTqzN1IlE7Hhotz/arAnvQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=IkXSjb3Rn7PBge9Ur09P08ZeEBi8VRA2CbzLrLn2KAg=;
 b=fTlP60mScZM/FOJl/eSxo1k09CrSYsRjth07E5GXFpsGa2p2TX7vQoD623rBU87uOzgDxo2QssSY/CwXyF0vqVeHUH1NnLycwLtiIWUuMIcJBoHnyuDMCjFXivIUcFACS2+1Gi4nO90JMR/AqeHrDczE0NsGilIX4c+V8WfXHVFTpbuJyZZTZ9fuLjR6ebldNSMyQEbayWyNUVmOOI4AZk8nJv/cyhhLNOeB1/sNyuAGAV3umGi6OhscpB/PsL/YmmjJsABx19V8dluqGc9xmPjrMUzXWQkdcQPhJQgwM7WwWOej89ggEs3nKSBeFPlOmh3Oh2u1lg1ZIsynRKkR0Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IkXSjb3Rn7PBge9Ur09P08ZeEBi8VRA2CbzLrLn2KAg=;
 b=XZ/7p1Pi6PXpxBFCIZKyNukTXmN6X4gKWIgmNWEF8c308GpdmWfZYAmmxamLyATl3DkNxqj4eGURk0XCIPARPZave06Kei2SJ5eeZVuG1JbPps2Nhw/OOrQ8TtlDZm2FlmpLU360lWfIqZqxhv+S070UEmsz47MDm1MOvdsD7/U=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v4 6/6] libxl: add support for parsing MSR features
Date: Tue, 25 Jul 2023 15:05:58 +0200
Message-ID: <20230725130558.58094-7-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230725130558.58094-1-roger.pau@citrix.com>
References: <20230725130558.58094-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P265CA0468.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:a2::24) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA1PR03MB6516:EE_
X-MS-Office365-Filtering-Correlation-Id: d2b71db7-93f5-46de-11ec-08db8d10014d
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	pdC8HJ24MckIsjVkpCU3dR8pauJH4DDum1JnCrj24clURoVopgExhMe65UNFFnQGVlk6sbCcXUnlUN9gvnq+UWn3t/MYCpp3d6qPoINcMpfiU9stj8cfEWelckzDZD/nigZTAsDAMoFRj1LJ5FyS9c8g5+JjfJDpCzbx9Z+dy1GTIoiFRGKhKLp65XTdy1fBOx1E4VQ6c1x4f+Qmel8325VHzpHzKRbtkC0RqAEFLttf9Hwu6VkAXHtZTHpIX0rSetwkZmUJ1gr3YcmiXN9YPOOgE/1xqa6f2nI0cFfKxqTMVAtZk7qUjrBgOH5Y4919zQpNRZv0FkXMNa7d3/U5XJzsQ0q+QqenV1AzUsZ0lsoZXQOf1O4Npd/LXkbTG+VcAkPAL9xFC3TFZWY/Cg95woy9frBfEF1ADU7qQgK+js0/OEY20maThBHMsW1q3cs0noQARZl1n2aGwXlbThnJWmjYQ1Oswgrsn5cnKr1Mll3RjfoluLo99vcQUs8JVg03rqCsiZ35ujzqU2OgLtqEddg9UhZ02OArFfybOHw/CMcibCMzvyy1DQyMFR7UWnIQ
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(136003)(346002)(396003)(39860400002)(451199021)(6486002)(6666004)(82960400001)(478600001)(83380400001)(8936002)(1076003)(26005)(6512007)(6506007)(66946007)(38100700002)(66556008)(54906003)(6916009)(4326008)(66476007)(186003)(2616005)(5660300002)(8676002)(2906002)(316002)(41300700001)(86362001)(36756003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NytuRnB6cUhEZCtBODZBa0VSR2VOU3dRcG9KSFJBQUZXUndnVmh1elBHU3lE?=
 =?utf-8?B?YVA5SGZYTE5tTFRCdnJtWlBKMWhTdnlXZEpwVllLU3dUNHR5a3hIRDFqVmxG?=
 =?utf-8?B?ZVJvb2M5SENQelZneWI5elAxK2svZXd4K3o3RFNLVlpSeWsrUnpySWIrRWVi?=
 =?utf-8?B?QW9BcldQV0xHYUhKbytlS3NPaTB0dnpVU3NLYUtMdnVqc3MvaDRuSmNhbEt2?=
 =?utf-8?B?eVlwSGQ1YlBMbW10SWxyVjkrT0ZKeEIxM3pXbUo1VEttN3p2TDlEYW5HbTZP?=
 =?utf-8?B?ci9jbmw5Q1U1Z2tGSS9GSS9iQjBldzBZRmgydUFqdllSRzdGOXZLNm9CMnF2?=
 =?utf-8?B?VWhFQUswbUl1VDVXc2ZWbjVobjE4bmRVMEgyRWI2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GU3VwQUk5dHhTbHFJcGhh?=
 =?utf-8?B?K0E9PQ==?=
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	gNUl+olermFwWatXLxRTLCtbQC9SFNi043oOCQKtnuw5QtlLYq7WTNleBPMKRRoUXJzdi1ZuHaH0bd8/oS4FK2BuuAOwDJkDlXDohIsOu4wZGCK+sE8LUDCf8sTezQcSqwYF8yFBpdHO0vQZ7n7xDqI0u/3upmk9EDsb5TgSETctuOkGjILRLN7SteYoxX0KkMpZydUMNJF1GhzAfzpCHsIrx3H4anHCKw8KVPZNyzkTdGpcjvAsxNuz4qGj2KPCoQAD75yYVJ0GFavfs2gGmq9ZLMoSEtHMyGPvLxE59QcGi3JlqgzXGNM/3uGKMgHYuS8lvX7FN6QqufjN/ru9GVTnpBKxz3OH4TzKe6Adz20t2PILWeYZEt9gEHXJSJXSldG2Kcij4Ad1ImIEg7IjjqP+makoN3ii9YY+nCjQYMxZUhBKP8ISz66k1XoYcOzJB6ZISd/5lMsOMuXXWttjflIhPOxrsFcGSTGxl3szx7CIhoO4OKoQXcHxibEaKwPWn67GPRNdvSAnBliejRxIl8HT/fFr8cTpF2cal1krgxiCMz8fusr8je5ZXwd6gMC8J+U0Tipqs/8WpzSWCw3yq3KUXxUOlPUQZWtJmIbkQPwmlvgQdq2+CQVFye7zMoinMuugq+l9zRBZmkwijpjmRr3mXyfVTnlkCNRWJVT5xIfkvC2eViwxeMdRU1CgzH9xwOLpIIhOC/wAq0phnzfzEfFTXioxt9t/iOgUq5Chjyd5kEExvYYdtPcwgoObDN5WbzkV/80886tE+27Yb5gng0i0qoQgOvZcAPssZK3pmAKu2rySttK2kWQ+Rhvkwrvv
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d2b71db7-93f5-46de-11ec-08db8d10014d
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 13:06:48.6637
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: xamPO9QI13iSAP66uF7DBsx8p2If9I1fdT1qK/gTq60bJF9d89n5J5P/CclpymQBpYDtl9gJez0AOxzbLGZTrg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB6516

Introduce support for handling MSR features in
libxl_cpuid_parse_config().  The MSR policies are added to the
libxl_cpuid_policy like the CPUID one, which gets passed to
xc_cpuid_apply_policy().

This allows existing users of libxl to provide MSR related features as
key=value pairs to libxl_cpuid_parse_config() without requiring the
usage of a different API.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
---
Changes since v2:
 - Add some braces.
---
 tools/libs/light/libxl_cpuid.c | 64 +++++++++++++++++++++++++++++++++-
 1 file changed, 63 insertions(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index 0daa564abb81..46dd2ce5f9e3 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -157,6 +157,60 @@ static int cpuid_add(libxl_cpuid_policy_list *policy,
     return 0;
 }
 
+static struct xc_msr *msr_find_match(libxl_cpuid_policy_list *pl, uint32_t index)
+{
+    unsigned int i = 0;
+    libxl_cpuid_policy_list policy = *pl;
+
+    if (policy == NULL)
+        policy = *pl = calloc(1, sizeof(*policy));
+
+    if (policy->msr != NULL) {
+        for (i = 0; policy->msr[i].index != XC_MSR_INPUT_UNUSED; i++) {
+            if (policy->msr[i].index == index) {
+                return &policy->msr[i];
+            }
+        }
+    }
+
+    policy->msr = realloc(policy->msr, sizeof(struct xc_msr) * (i + 2));
+    policy->msr[i].index = index;
+    memset(policy->msr[i].policy, 'x', ARRAY_SIZE(policy->msr[0].policy) - 1);
+    policy->msr[i].policy[ARRAY_SIZE(policy->msr[0].policy) - 1] = '\0';
+    policy->msr[i + 1].index = XC_MSR_INPUT_UNUSED;
+
+    return &policy->msr[i];
+}
+
+static int msr_add(libxl_cpuid_policy_list *policy, uint32_t index, unsigned int bit,
+                   const char *val)
+{
+    struct xc_msr *entry = msr_find_match(policy, index);
+
+    /* Only allow options taking a character for MSRs, no values allowed. */
+    if (strlen(val) != 1)
+        return 3;
+
+    switch (val[0]) {
+    case '0':
+    case '1':
+    case 'x':
+    case 'k':
+        entry->policy[63 - bit] = val[0];
+        break;
+
+    case 's':
+        /* Translate s -> k as xc_msr doesn't support the deprecated 's'. */
+        entry->policy[63 - bit] = 'k';
+        break;
+
+    default:
+        return 3;
+    }
+
+    return 0;
+}
+
 struct feature_name {
     const char *name;
     unsigned int bit;
@@ -336,7 +390,15 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
     }
 
     case FEAT_MSR:
-        return 2;
+    {
+        unsigned int bit = feat->bit % 32;
+
+        if (feature_to_policy[feat->bit / 32].msr.reg == CPUID_REG_EDX)
+            bit += 32;
+
+        return msr_add(policy, feature_to_policy[feat->bit / 32].msr.index,
+                       bit, val);
+    }
     }
 
     return 2;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 13:06:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 13:06:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569676.890621 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHkf-0005ww-14; Tue, 25 Jul 2023 13:06:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569676.890621; Tue, 25 Jul 2023 13:06:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHke-0005wH-TM; Tue, 25 Jul 2023 13:06:56 +0000
Received: by outflank-mailman (input) for mailman id 569676;
 Tue, 25 Jul 2023 13:06:55 +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
 <SRS0=A3G+=DL=citrix.com=prvs=56320e048=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOHkc-0004BN-UW
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 13:06:55 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0108943b-2aec-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 15:06:02 +0200 (CEST)
Received: from mail-co1nam11lp2171.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.171])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 25 Jul 2023 09:06:46 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SA1PR03MB6516.namprd03.prod.outlook.com (2603:10b6:806:1c7::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 13:06:42 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6609.031; Tue, 25 Jul 2023
 13:06:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0108943b-2aec-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690290411;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=yn7kJQzbf6RnPHIK78W4GQCjFinnOtP7h79IJBxxEjo=;
  b=BRScAGoX2jPfpcWA8oqDJr9/P+bVw8i/pqQow86QYepy4XJ/ezlOHSlc
   mi0nYZEpeConzmhXqB11JRqIgmytglrBVng1BFCSFpXG7gIRud4/JV+SE
   hjVZl8AT/NsNu9j90jmnsNXd/gmu2PrSN2oV2xMpw5p7aBKp/PsktuXWH
   s=;
X-IronPort-RemoteIP: 104.47.56.171
X-IronPort-MID: 116652320
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:OnJ3oaw018E45dFDgV16t+cTxyrEfRIJ4+MujC+fZmUNrF6WrkUGm
 mAbUW/QbvrZYzPxKtlwPdznp08Pv8LSydUyHAI/qCAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhP60T5TcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KVBC3
 8U+IQkKVD+kttyVn4CyTdtslO12eaEHPKtH0p1h5RfwKK9/BLvkGuDN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjaVlVMouFTuGIO9ltiiX8Jak1zev
 mvb12/4HgsbJJqUzj/tHneE37aRw36hA9hKfFG+3qc6gk+Sn3YCMycXElj4ufC2kEW8ROsKf
 iT4/QJr98De7neDXtT7GhG1vnOAlhodQMZLVf037hmXzajZ6BrfAXILJhZebPQ2uclwQiYlv
 neLkMnuHidHq6CORDSW8bL8kN+pES0cLGtHbihdSwIAuoDnuNtq0UuJSct/GqmoiNGzASv33
 z2BsCk5gfMUkNIP0KK4u1vAhlpAu6T0c+L83S2PNkrN0++zTNTNi1CAgbQD0ct9EQ==
IronPort-HdrOrdr: A9a23:Rny0fK+laMDsnPC1KHpuk+AHI+orL9Y04lQ7vn2ZKCYlDvBw8v
 rEoB11737JYUkqKRcdcLy7VJVoAkmsjKKdmLNhR4tKBTOWxVdAT7sSkrcKoQeBJ8SkzJ8k6U
 4IScEXYuEYa2IUsS+Q2mSF+rgbruVujciT9JzjJqNWPGNXg90J1XYfNu/iKDwUeOCwP+tcKH
 M03Lsjmwad
X-Talos-CUID: 9a23:OxJKwmATZiXsGLr6Exhr3ncyE/kiSFL6/UnzfH2xDlRpWpTAHA==
X-Talos-MUID: 9a23:kPv/oATO5mrp4qq4RXS11DNwNZ5y8p+UCQcO0o0PtNOPNzNJbmI=
X-IronPort-AV: E=Sophos;i="6.01,230,1684814400"; 
   d="scan'208";a="116652320"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=GTB7lcehk+MqNCPoFh8M1abVRhfReF+lJkobeuVvoi9bwdkO+7C5HOI+F4yTZxXNQGkpUQaHHyBVzoDYbhAmsbblhZYb2gOs0yxul7XG+zFOVohyf27m0YEBeC9PMKovcZCEKngXUQDrPTldtwrPMRabXoy3+CTQnj3WLURT1os1s5cvmYo+yPDH/MJIjFPGt9bom9lmb/mT6lsUwzrwwr55iZluutXz48QPNYBThIZuCqi9g1F29Y734IRBNUr512EBm+UtMcs+lfPU+F7uKEaImPm3g3In3dIzCkaqE83sS30n5/GnCdVuZDwyT22OzOABaj0evDZuEzGyQv2GnA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=HmAWMVJN7ymqGfurpuYWddbt8PjeHmT9mj43QmC7/1I=;
 b=Hd4wiL5YmPDuwghU1CaFs4UvKYuWRQw2+aBds0JU4TO1sg1vNRthte2GZgzCUruY3/kBVhqb1RNS4b2ijK0EvBzExiZifje7jenbJtQkMUxOObKK4LQEO7/e1LWan/z05tPkqYRBCunZzZojlTpiuAYyc9tQh9KqVMHhaIqhusd5T3x4Njeptbntaf1NOZaqpYbGbIf5zG4J9tS3gT9oofiYT7KbOSofLRdmDJBex8cQiM2gUNcgk/IflFcj7C7XLdxGdJqDDnz3lFXKRyssgLQN+Wvc8BG21khjznuWVOSXziCyKdBfp806hcZHkT8dxdeQNiTMRp4T5+K6+qpYNQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=HmAWMVJN7ymqGfurpuYWddbt8PjeHmT9mj43QmC7/1I=;
 b=meZAiXrkZtugv3/8TbIPHmIY8l06PxrVT7D1h+05EK44Dp2a0BcK3ZrJaZXvRrs8Gw9eXXTYD2Oj6fgM0UChkT1e654j6HAkdhgM10mTBz8Fxqa6yyycubJ8oxLhrUWRl1sq4ywpyw/JGyPCY6JXi/K9fHjE1r6rUZZ9VaJ2G+I=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v4 5/6] libxl: use the cpuid feature names from cpufeatureset.h
Date: Tue, 25 Jul 2023 15:05:57 +0200
Message-ID: <20230725130558.58094-6-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230725130558.58094-1-roger.pau@citrix.com>
References: <20230725130558.58094-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0394.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:18f::21) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SA1PR03MB6516:EE_
X-MS-Office365-Filtering-Correlation-Id: 36bb92bb-1d37-484e-030e-08db8d0ffdc8
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	VpOfEXRP3uIJfQYGjivgL72zpAYa/9zu8Ix8eDe55aQNlaOuRet2Bqi1GIX9YGIkgIP41EIltcT0a2UHGxVmDZlMxBuhTPP/cOLDLlE5PHew38cuzorRujxpr5QyLiiW9HYZWPmT7/oqMF4fE0bWwg/kt+0fhObzL3gGXbret9LkQHPIeUXJUyeqMJ3G8sWVKlfqwwLYkkiDT1sFRRZmR8VphIXeaHQyBjG00Xe68xegSjN3W/mNpLPBi1VXxW9Si8oURwt6ECFdFq+GDM4KgJAjMnzW93/yqX4Agg3b1oeHi78meDu3od8qprCGRsfOFLZgMEwOl9aCjQIVmGAWzDsGAi6U+FyozKdn/lH6+64+s1upNjX8LPPll80Hut6clnTJyEkckZ32MlLsN9g3QAURJzUbRuKAPlFYjPmS5UZfZc9rQMvRjBxtBb+RjxezXl+l+l2VEhsM4b1AQfxbDlBBKTmPOm5FgVhepUECc6E6R83krq+4FvNpxGdIqeAEqnjzGIrpUPZS2HxDhEWNtumFEcriOFOdrKrblaMPe4Dtb+z2XhKFJIpYuQrXjZCrQ/xRDHFQN42X/JylOhjdAkwykdZzox9z+NLMmu2BCj8=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(136003)(346002)(396003)(39860400002)(451199021)(6486002)(6666004)(82960400001)(478600001)(83380400001)(8936002)(1076003)(26005)(6512007)(6506007)(66946007)(38100700002)(66556008)(54906003)(6916009)(4326008)(66476007)(186003)(66574015)(2616005)(5660300002)(8676002)(2906002)(30864003)(316002)(41300700001)(86362001)(36756003)(473944003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NDVQamRwcW03WjZnR3ZIcDd2OGZxS1RlaTlFckV3L25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ado6gIC6696OjR0f9Nq37inwNywVHR32mDyg/VwYhmOr3P/ZRMc5qr4NegISiRwshjxGi4ZQgskjLXG613teaa7k9wd33ipqtkBqtykUFMqiVuOAcBl/2cihy9A01RnedM9bJ+WVmvdFVDax+MAPiCec+RS4UGNkXSOhKby05fLUl407x6S0LwAdYDTOanDbWb/Gp+6PTnmYsvpkG8Cc1WG7covhVeV9vHNKN/cwvHojQPwFCrcOqmho/JMKQqhkTlAsebI3CCyRJvKU9u54J9Ihb/+q6kR/4cMyW6FO64QoHnNZ5ZLS6cG/VfEE0ITt
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 36bb92bb-1d37-484e-030e-08db8d0ffdc8
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 13:06:42.7554
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: F6KJyBpWpuNKzUQxbf6Y4xBe7sKmfSK5UTOB/mno8v6QihY0m0KPu7qcmb/0In0yI8V8DFLaofpTFeA+bPCp2Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB6516

The current implementation in libxl_cpuid_parse_config() requires
keeping a list of cpuid feature bits that should be mostly in sync
with the contents of cpufeatureset.h.

Avoid such duplication by using the automatically generated list of
cpuid features in INIT_FEATURE_NAMES in order to map feature names to
featureset bits, and then translate from featureset bits into cpuid
leaf, subleaf, register tuple.

Note that the full contents of the previous cpuid translation table
can't be removed.  That's because some feature names allowed by libxl
are not described in the featuresets, or because naming has diverged
and the previous nomenclature is preserved for compatibility reasons.

Should result in no functional change observed by callers, albeit some
new cpuid features will be available as a result of the change.

While there constify cpuid_flags name field.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
---
Changes since v1:
 - const unnamed structure cast.
 - Declare struct feature_name outside the function.
 - Use strcmp.
 - Fix indentation.
 - Add back missing feature name options.
 - Return ERROR_NOMEM if allocation fails.
 - Improve xl.cfg documentation about how to reference the features
   described in the public header.
---
 docs/man/xl.cfg.5.pod.in       |  24 +--
 tools/libs/light/libxl_cpuid.c | 267 ++++++++++++---------------------
 tools/xl/xl_parse.c            |   3 +
 3 files changed, 107 insertions(+), 187 deletions(-)

diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index 3979be2a590a..55161856f4c7 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -2010,24 +2010,16 @@ proccount procpkg stepping
 
 =back
 
-List of keys taking a character:
+List of keys taking a character can be found in the public header file
+L<arch-x86/cpufeatureset.h|https://xenbits.xen.org/docs/unstable/hypercall/x86_64/include,public,arch-x86,cpufeatureset.h.html>
 
-=over 4
-
-3dnow 3dnowext 3dnowprefetch abm acpi adx aes altmovcr8 apic arat avx avx2
-avx512-4fmaps avx512-4vnniw avx512bw avx512cd avx512dq avx512er avx512f
-avx512ifma avx512pf avx512vbmi avx512vl bmi1 bmi2 clflushopt clfsh clwb cmov
-cmplegacy cmpxchg16 cmpxchg8 cmt cntxid dca de ds dscpl dtes64 erms est extapic
-f16c ffxsr fma fma4 fpu fsgsbase fxsr hle htt hypervisor ia64 ibs invpcid
-invtsc lahfsahf lm lwp mca mce misalignsse mmx mmxext monitor movbe mpx msr
-mtrr nodeid nx ospke osvw osxsave pae page1gb pat pbe pcid pclmulqdq pdcm
-perfctr_core perfctr_nb pge pku popcnt pse pse36 psn rdrand rdseed rdtscp rtm
-sha skinit smap smep smx ss sse sse2 sse3 sse4.1 sse4.2 sse4_1 sse4_2 sse4a
-ssse3 svm svm_decode svm_lbrv svm_npt svm_nrips svm_pausefilt svm_tscrate
-svm_vmcbclean syscall sysenter tbm tm tm2 topoext tsc tsc-deadline tsc_adjust
-umip vme vmx wdt x2apic xop xsave xtpr
+The feature names described in C<cpufeatureset.h> should be specified in all
+lowercase letters, and with underscores converted to hyphens.  For example in
+order to reference feature C<LAHF_LM> the string C<lahf-lm> should be used.
 
-=back
+Note that C<clflush> is described as an option that takes a value, and that
+takes precedence over the C<clflush> flag in C<cpufeatureset.h>.  The feature
+flag must be referenced as C<clfsh>.
 
 =back
 
diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index f04b192c0e44..0daa564abb81 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -14,6 +14,8 @@
 
 #include "libxl_internal.h"
 
+#include <xen/lib/x86/cpu-policy.h>
+
 int libxl__cpuid_policy_is_empty(libxl_cpuid_policy_list *pl)
 {
     return !*pl || (!libxl_cpuid_policy_list_length(pl) && !(*pl)->msr);
@@ -60,7 +62,7 @@ void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl)
  * Used for the static structure describing all features.
  */
 struct cpuid_flags {
-    char* name;
+    const char *name;
     uint32_t leaf;
     uint32_t subleaf;
     int reg;
@@ -153,7 +155,19 @@ static int cpuid_add(libxl_cpuid_policy_list *policy,
     entry->policy[flag->reg - 1] = resstr;
 
     return 0;
+}
+
+struct feature_name {
+    const char *name;
+    unsigned int bit;
+};
+
+static int search_feature(const void *a, const void *b)
+{
+    const char *key = a;
+    const char *feat = ((const struct feature_name *)b)->name;
 
+    return strcmp(key, feat);
 }
 
 /* parse a single key=value pair and translate it into the libxc
@@ -176,208 +190,42 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
         {"proccount",    0x00000001, NA, CPUID_REG_EBX, 16,  8},
         {"localapicid",  0x00000001, NA, CPUID_REG_EBX, 24,  8},
 
-        {"sse3",         0x00000001, NA, CPUID_REG_ECX,  0,  1},
-        {"pclmulqdq",    0x00000001, NA, CPUID_REG_ECX,  1,  1},
-        {"dtes64",       0x00000001, NA, CPUID_REG_ECX,  2,  1},
-        {"monitor",      0x00000001, NA, CPUID_REG_ECX,  3,  1},
-        {"dscpl",        0x00000001, NA, CPUID_REG_ECX,  4,  1},
-        {"vmx",          0x00000001, NA, CPUID_REG_ECX,  5,  1},
-        {"smx",          0x00000001, NA, CPUID_REG_ECX,  6,  1},
         {"est",          0x00000001, NA, CPUID_REG_ECX,  7,  1},
-        {"tm2",          0x00000001, NA, CPUID_REG_ECX,  8,  1},
-        {"ssse3",        0x00000001, NA, CPUID_REG_ECX,  9,  1},
         {"cntxid",       0x00000001, NA, CPUID_REG_ECX, 10,  1},
-        {"fma",          0x00000001, NA, CPUID_REG_ECX, 12,  1},
         {"cmpxchg16",    0x00000001, NA, CPUID_REG_ECX, 13,  1},
-        {"xtpr",         0x00000001, NA, CPUID_REG_ECX, 14,  1},
-        {"pdcm",         0x00000001, NA, CPUID_REG_ECX, 15,  1},
-        {"pcid",         0x00000001, NA, CPUID_REG_ECX, 17,  1},
-        {"dca",          0x00000001, NA, CPUID_REG_ECX, 18,  1},
         /* Linux uses sse4_{1,2}.  Keep sse4.{1,2} for compatibility */
         {"sse4_1",       0x00000001, NA, CPUID_REG_ECX, 19,  1},
         {"sse4.1",       0x00000001, NA, CPUID_REG_ECX, 19,  1},
         {"sse4_2",       0x00000001, NA, CPUID_REG_ECX, 20,  1},
         {"sse4.2",       0x00000001, NA, CPUID_REG_ECX, 20,  1},
-        {"x2apic",       0x00000001, NA, CPUID_REG_ECX, 21,  1},
-        {"movbe",        0x00000001, NA, CPUID_REG_ECX, 22,  1},
-        {"popcnt",       0x00000001, NA, CPUID_REG_ECX, 23,  1},
-        {"tsc-deadline", 0x00000001, NA, CPUID_REG_ECX, 24,  1},
         {"aes",          0x00000001, NA, CPUID_REG_ECX, 25,  1},
-        {"xsave",        0x00000001, NA, CPUID_REG_ECX, 26,  1},
-        {"osxsave",      0x00000001, NA, CPUID_REG_ECX, 27,  1},
-        {"avx",          0x00000001, NA, CPUID_REG_ECX, 28,  1},
-        {"f16c",         0x00000001, NA, CPUID_REG_ECX, 29,  1},
-        {"rdrand",       0x00000001, NA, CPUID_REG_ECX, 30,  1},
-        {"hypervisor",   0x00000001, NA, CPUID_REG_ECX, 31,  1},
-
-        {"fpu",          0x00000001, NA, CPUID_REG_EDX,  0,  1},
-        {"vme",          0x00000001, NA, CPUID_REG_EDX,  1,  1},
-        {"de",           0x00000001, NA, CPUID_REG_EDX,  2,  1},
-        {"pse",          0x00000001, NA, CPUID_REG_EDX,  3,  1},
-        {"tsc",          0x00000001, NA, CPUID_REG_EDX,  4,  1},
-        {"msr",          0x00000001, NA, CPUID_REG_EDX,  5,  1},
-        {"pae",          0x00000001, NA, CPUID_REG_EDX,  6,  1},
-        {"mce",          0x00000001, NA, CPUID_REG_EDX,  7,  1},
+
         {"cmpxchg8",     0x00000001, NA, CPUID_REG_EDX,  8,  1},
-        {"apic",         0x00000001, NA, CPUID_REG_EDX,  9,  1},
         {"sysenter",     0x00000001, NA, CPUID_REG_EDX, 11,  1},
-        {"mtrr",         0x00000001, NA, CPUID_REG_EDX, 12,  1},
-        {"pge",          0x00000001, NA, CPUID_REG_EDX, 13,  1},
-        {"mca",          0x00000001, NA, CPUID_REG_EDX, 14,  1},
-        {"cmov",         0x00000001, NA, CPUID_REG_EDX, 15,  1},
-        {"pat",          0x00000001, NA, CPUID_REG_EDX, 16,  1},
-        {"pse36",        0x00000001, NA, CPUID_REG_EDX, 17,  1},
         {"psn",          0x00000001, NA, CPUID_REG_EDX, 18,  1},
         {"clfsh",        0x00000001, NA, CPUID_REG_EDX, 19,  1},
-        {"ds",           0x00000001, NA, CPUID_REG_EDX, 21,  1},
-        {"acpi",         0x00000001, NA, CPUID_REG_EDX, 22,  1},
-        {"mmx",          0x00000001, NA, CPUID_REG_EDX, 23,  1},
-        {"fxsr",         0x00000001, NA, CPUID_REG_EDX, 24,  1},
-        {"sse",          0x00000001, NA, CPUID_REG_EDX, 25,  1},
-        {"sse2",         0x00000001, NA, CPUID_REG_EDX, 26,  1},
-        {"ss",           0x00000001, NA, CPUID_REG_EDX, 27,  1},
-        {"htt",          0x00000001, NA, CPUID_REG_EDX, 28,  1},
         {"tm",           0x00000001, NA, CPUID_REG_EDX, 29,  1},
         {"ia64",         0x00000001, NA, CPUID_REG_EDX, 30,  1},
         {"pbe",          0x00000001, NA, CPUID_REG_EDX, 31,  1},
 
         {"arat",         0x00000006, NA, CPUID_REG_EAX,  2,  1},
 
-        {"fsgsbase",     0x00000007,  0, CPUID_REG_EBX,  0,  1},
         {"tsc_adjust",   0x00000007,  0, CPUID_REG_EBX,  1,  1},
-        {"bmi1",         0x00000007,  0, CPUID_REG_EBX,  3,  1},
-        {"hle",          0x00000007,  0, CPUID_REG_EBX,  4,  1},
-        {"avx2",         0x00000007,  0, CPUID_REG_EBX,  5,  1},
-        {"smep",         0x00000007,  0, CPUID_REG_EBX,  7,  1},
-        {"bmi2",         0x00000007,  0, CPUID_REG_EBX,  8,  1},
-        {"erms",         0x00000007,  0, CPUID_REG_EBX,  9,  1},
-        {"invpcid",      0x00000007,  0, CPUID_REG_EBX, 10,  1},
-        {"rtm",          0x00000007,  0, CPUID_REG_EBX, 11,  1},
         {"cmt",          0x00000007,  0, CPUID_REG_EBX, 12,  1},
-        {"mpx",          0x00000007,  0, CPUID_REG_EBX, 14,  1},
-        {"avx512f",      0x00000007,  0, CPUID_REG_EBX, 16,  1},
-        {"avx512dq",     0x00000007,  0, CPUID_REG_EBX, 17,  1},
-        {"rdseed",       0x00000007,  0, CPUID_REG_EBX, 18,  1},
-        {"adx",          0x00000007,  0, CPUID_REG_EBX, 19,  1},
-        {"smap",         0x00000007,  0, CPUID_REG_EBX, 20,  1},
-        {"avx512-ifma",  0x00000007,  0, CPUID_REG_EBX, 21,  1},
-        {"clflushopt",   0x00000007,  0, CPUID_REG_EBX, 23,  1},
-        {"clwb",         0x00000007,  0, CPUID_REG_EBX, 24,  1},
-        {"proc-trace",   0x00000007,  0, CPUID_REG_EBX, 25,  1},
-        {"avx512pf",     0x00000007,  0, CPUID_REG_EBX, 26,  1},
-        {"avx512er",     0x00000007,  0, CPUID_REG_EBX, 27,  1},
-        {"avx512cd",     0x00000007,  0, CPUID_REG_EBX, 28,  1},
-        {"sha",          0x00000007,  0, CPUID_REG_EBX, 29,  1},
-        {"avx512bw",     0x00000007,  0, CPUID_REG_EBX, 30,  1},
-        {"avx512vl",     0x00000007,  0, CPUID_REG_EBX, 31,  1},
-
-        {"prefetchwt1",  0x00000007,  0, CPUID_REG_ECX,  0,  1},
-        {"avx512-vbmi",  0x00000007,  0, CPUID_REG_ECX,  1,  1},
-        {"umip",         0x00000007,  0, CPUID_REG_ECX,  2,  1},
-        {"pku",          0x00000007,  0, CPUID_REG_ECX,  3,  1},
-        {"ospke",        0x00000007,  0, CPUID_REG_ECX,  4,  1},
-        {"avx512-vbmi2", 0x00000007,  0, CPUID_REG_ECX,  6,  1},
-        {"cet-ss",       0x00000007,  0, CPUID_REG_ECX,  7,  1},
-        {"gfni",         0x00000007,  0, CPUID_REG_ECX,  8,  1},
-        {"vaes",         0x00000007,  0, CPUID_REG_ECX,  9,  1},
-        {"vpclmulqdq",   0x00000007,  0, CPUID_REG_ECX, 10,  1},
-        {"avx512-vnni",  0x00000007,  0, CPUID_REG_ECX, 11,  1},
-        {"avx512-bitalg",0x00000007,  0, CPUID_REG_ECX, 12,  1},
-        {"avx512-vpopcntdq",0x00000007,0,CPUID_REG_ECX, 14,  1},
-        {"rdpid",        0x00000007,  0, CPUID_REG_ECX, 22,  1},
-        {"cldemote",     0x00000007,  0, CPUID_REG_ECX, 25,  1},
-        {"pks",          0x00000007,  0, CPUID_REG_ECX, 31,  1},
-
-        {"avx512-4vnniw",0x00000007,  0, CPUID_REG_EDX,  2,  1},
-        {"avx512-4fmaps",0x00000007,  0, CPUID_REG_EDX,  3,  1},
-        {"fsrm",         0x00000007,  0, CPUID_REG_EDX,  4,  1},
-        {"avx512-vp2intersect",0x00000007,0,CPUID_REG_EDX,8, 1},
-        {"srbds-ctrl",   0x00000007,  0, CPUID_REG_EDX,  9,  1},
-        {"md-clear",     0x00000007,  0, CPUID_REG_EDX, 10,  1},
-        {"serialize",    0x00000007,  0, CPUID_REG_EDX, 14,  1},
-        {"tsxldtrk",     0x00000007,  0, CPUID_REG_EDX, 16,  1},
-        {"cet-ibt",      0x00000007,  0, CPUID_REG_EDX, 20,  1},
-        {"avx512-fp16",  0x00000007,  0, CPUID_REG_EDX, 23,  1},
-        {"ibrsb",        0x00000007,  0, CPUID_REG_EDX, 26,  1},
-        {"stibp",        0x00000007,  0, CPUID_REG_EDX, 27,  1},
-        {"l1d-flush",    0x00000007,  0, CPUID_REG_EDX, 28,  1},
-        {"arch-caps",    0x00000007,  0, CPUID_REG_EDX, 29,  1},
-        {"core-caps",    0x00000007,  0, CPUID_REG_EDX, 30,  1},
-        {"ssbd",         0x00000007,  0, CPUID_REG_EDX, 31,  1},
-
-        {"avx-vnni",     0x00000007,  1, CPUID_REG_EAX,  4,  1},
-        {"avx512-bf16",  0x00000007,  1, CPUID_REG_EAX,  5,  1},
-        {"fzrm",         0x00000007,  1, CPUID_REG_EAX, 10,  1},
-        {"fsrs",         0x00000007,  1, CPUID_REG_EAX, 11,  1},
-        {"fsrcs",        0x00000007,  1, CPUID_REG_EAX, 12,  1},
-        {"wrmsrns",      0x00000007,  1, CPUID_REG_EAX, 19,  1},
-        {"avx-ifma",     0x00000007,  1, CPUID_REG_EAX, 23,  1},
-
-        {"avx-vnni-int8",0x00000007,  1, CPUID_REG_EDX,  4,  1},
-        {"avx-ne-convert",0x00000007, 1, CPUID_REG_EDX,  5,  1},
-        {"cet-sss",      0x00000007,  1, CPUID_REG_EDX, 18,  1},
-
-        {"intel-psfd",   0x00000007,  2, CPUID_REG_EDX,  0,  1},
-        {"ipred-ctrl",   0x00000007,  2, CPUID_REG_EDX,  1,  1},
-        {"rrsba-ctrl",   0x00000007,  2, CPUID_REG_EDX,  2,  1},
-        {"ddp-ctrl",     0x00000007,  2, CPUID_REG_EDX,  3,  1},
-        {"bhi-ctrl",     0x00000007,  2, CPUID_REG_EDX,  4,  1},
-        {"mcdt-no",      0x00000007,  2, CPUID_REG_EDX,  5,  1},
 
         {"lahfsahf",     0x80000001, NA, CPUID_REG_ECX,  0,  1},
         {"cmplegacy",    0x80000001, NA, CPUID_REG_ECX,  1,  1},
-        {"svm",          0x80000001, NA, CPUID_REG_ECX,  2,  1},
-        {"extapic",      0x80000001, NA, CPUID_REG_ECX,  3,  1},
         {"altmovcr8",    0x80000001, NA, CPUID_REG_ECX,  4,  1},
-        {"abm",          0x80000001, NA, CPUID_REG_ECX,  5,  1},
-        {"sse4a",        0x80000001, NA, CPUID_REG_ECX,  6,  1},
-        {"misalignsse",  0x80000001, NA, CPUID_REG_ECX,  7,  1},
-        {"3dnowprefetch",0x80000001, NA, CPUID_REG_ECX,  8,  1},
-        {"osvw",         0x80000001, NA, CPUID_REG_ECX,  9,  1},
-        {"ibs",          0x80000001, NA, CPUID_REG_ECX, 10,  1},
-        {"xop",          0x80000001, NA, CPUID_REG_ECX, 11,  1},
-        {"skinit",       0x80000001, NA, CPUID_REG_ECX, 12,  1},
-        {"wdt",          0x80000001, NA, CPUID_REG_ECX, 13,  1},
-        {"lwp",          0x80000001, NA, CPUID_REG_ECX, 15,  1},
-        {"fma4",         0x80000001, NA, CPUID_REG_ECX, 16,  1},
         {"nodeid",       0x80000001, NA, CPUID_REG_ECX, 19,  1},
-        {"tbm",          0x80000001, NA, CPUID_REG_ECX, 21,  1},
-        {"topoext",      0x80000001, NA, CPUID_REG_ECX, 22,  1},
         {"perfctr_core", 0x80000001, NA, CPUID_REG_ECX, 23,  1},
         {"perfctr_nb",   0x80000001, NA, CPUID_REG_ECX, 24,  1},
 
-        {"syscall",      0x80000001, NA, CPUID_REG_EDX, 11,  1},
-        {"nx",           0x80000001, NA, CPUID_REG_EDX, 20,  1},
-        {"mmxext",       0x80000001, NA, CPUID_REG_EDX, 22,  1},
-        {"ffxsr",        0x80000001, NA, CPUID_REG_EDX, 25,  1},
-        {"page1gb",      0x80000001, NA, CPUID_REG_EDX, 26,  1},
-        {"rdtscp",       0x80000001, NA, CPUID_REG_EDX, 27,  1},
-        {"lm",           0x80000001, NA, CPUID_REG_EDX, 29,  1},
-        {"3dnowext",     0x80000001, NA, CPUID_REG_EDX, 30,  1},
-        {"3dnow",        0x80000001, NA, CPUID_REG_EDX, 31,  1},
-
         {"procpkg",      0x00000004,  0, CPUID_REG_EAX, 26,  6},
 
         {"invtsc",       0x80000007, NA, CPUID_REG_EDX,  8,  1},
 
-        {"clzero",       0x80000008, NA, CPUID_REG_EBX,  0,  1},
-        {"rstr-fp-err-ptrs", 0x80000008, NA, CPUID_REG_EBX, 2, 1},
-        {"wbnoinvd",     0x80000008, NA, CPUID_REG_EBX,  9,  1},
-        {"ibpb",         0x80000008, NA, CPUID_REG_EBX, 12,  1},
-        {"ibrs",         0x80000008, NA, CPUID_REG_EBX, 14,  1},
-        {"amd-stibp",    0x80000008, NA, CPUID_REG_EBX, 15,  1},
-        {"ibrs-always",  0x80000008, NA, CPUID_REG_EBX, 16,  1},
-        {"stibp-always", 0x80000008, NA, CPUID_REG_EBX, 17,  1},
-        {"ibrs-fast",    0x80000008, NA, CPUID_REG_EBX, 18,  1},
-        {"ibrs-same-mode", 0x80000008, NA, CPUID_REG_EBX, 19,  1},
-        {"no-lmsl",      0x80000008, NA, CPUID_REG_EBX, 20,  1},
         {"ppin",         0x80000008, NA, CPUID_REG_EBX, 23,  1},
-        {"amd-ssbd",     0x80000008, NA, CPUID_REG_EBX, 24,  1},
-        {"virt-ssbd",    0x80000008, NA, CPUID_REG_EBX, 25,  1},
-        {"ssb-no",       0x80000008, NA, CPUID_REG_EBX, 26,  1},
-        {"psfd",         0x80000008, NA, CPUID_REG_EBX, 28,  1},
         {"btc-no",       0x80000008, NA, CPUID_REG_EBX, 29,  1},
-        {"ibpb-ret",     0x80000008, NA, CPUID_REG_EBX, 30,  1},
 
         {"nc",           0x80000008, NA, CPUID_REG_ECX,  0,  8},
         {"apicidsize",   0x80000008, NA, CPUID_REG_ECX, 12,  4},
@@ -391,17 +239,63 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
         {"svm_pausefilt",0x8000000a, NA, CPUID_REG_EDX, 10,  1},
 
         {"lfence+",      0x80000021, NA, CPUID_REG_EAX,  2,  1},
-        {"nscb",         0x80000021, NA, CPUID_REG_EAX,  6,  1},
-        {"auto-ibrs",    0x80000021, NA, CPUID_REG_EAX,  8,  1},
-        {"cpuid-user-dis", 0x80000021, NA, CPUID_REG_EAX, 17, 1},
 
         {"maxhvleaf",    0x40000000, NA, CPUID_REG_EAX,  0,  8},
 
         {NULL, 0, NA, CPUID_REG_INV, 0, 0}
     };
+    static const struct feature_name features[] = INIT_FEATURE_NAMES;
+    /*
+     * NB: if we switch to using a cpu_policy derived object instead of a
+     * libxl_cpuid_policy_list we could get rid of the featureset -> cpuid leaf
+     * conversion table and use a featureset directly as we have conversions
+     * to/from featureset and cpu_policy.
+     */
+    static const struct {
+        enum { FEAT_CPUID, FEAT_MSR } type;
+        union {
+            struct {
+                uint32_t leaf, subleaf;
+                unsigned int reg;
+            } cpuid;
+            struct {
+                uint32_t index;
+                unsigned int reg;
+            } msr;
+        };
+    } feature_to_policy[] = {
+#define CPUID_ENTRY(l, s, r) \
+    { .type = FEAT_CPUID, .cpuid.leaf = l, .cpuid.subleaf = s, .cpuid.reg = r }
+#define MSR_ENTRY(i, r) \
+    { .type = FEAT_MSR, .msr.index = i, .msr.reg = r }
+        CPUID_ENTRY(0x00000001, NA, CPUID_REG_EDX),
+        CPUID_ENTRY(0x00000001, NA, CPUID_REG_ECX),
+        CPUID_ENTRY(0x80000001, NA, CPUID_REG_EDX),
+        CPUID_ENTRY(0x80000001, NA, CPUID_REG_ECX),
+        CPUID_ENTRY(0x0000000D,  1, CPUID_REG_EAX),
+        CPUID_ENTRY(0x00000007,  0, CPUID_REG_EBX),
+        CPUID_ENTRY(0x00000007,  0, CPUID_REG_ECX),
+        CPUID_ENTRY(0x80000007, NA, CPUID_REG_EDX),
+        CPUID_ENTRY(0x80000008, NA, CPUID_REG_EBX),
+        CPUID_ENTRY(0x00000007,  0, CPUID_REG_EDX),
+        CPUID_ENTRY(0x00000007,  1, CPUID_REG_EAX),
+        CPUID_ENTRY(0x80000021, NA, CPUID_REG_EAX),
+        CPUID_ENTRY(0x00000007,  1, CPUID_REG_EBX),
+        CPUID_ENTRY(0x00000007,  2, CPUID_REG_EDX),
+        CPUID_ENTRY(0x00000007,  1, CPUID_REG_ECX),
+        CPUID_ENTRY(0x00000007,  1, CPUID_REG_EDX),
+        MSR_ENTRY(0x10a, CPUID_REG_EAX),
+        MSR_ENTRY(0x10a, CPUID_REG_EDX),
+#undef MSR_ENTRY
+#undef CPUID_ENTRY
+    };
 #undef NA
     const char *sep, *val;
+    char *name;
     const struct cpuid_flags *flag;
+    const struct feature_name *feat;
+
+    BUILD_BUG_ON(ARRAY_SIZE(feature_to_policy) != FEATURESET_NR_ENTRIES);
 
     sep = strchr(str, '=');
     if (sep == NULL) {
@@ -414,6 +308,37 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *policy, const char* str)
             return cpuid_add(policy, flag, val);
     }
 
+    /* Provide a NUL terminated feature name to the search helper. */
+    name = strndup(str, sep - str);
+    if (name == NULL)
+        return ERROR_NOMEM;
+
+    feat = bsearch(name, features, ARRAY_SIZE(features), sizeof(features[0]),
+                   search_feature);
+    free(name);
+
+    if (feat == NULL)
+        return 2;
+
+    switch (feature_to_policy[feat->bit / 32].type) {
+    case FEAT_CPUID:
+    {
+        struct cpuid_flags f;
+
+        f.name = feat->name;
+        f.leaf = feature_to_policy[feat->bit / 32].cpuid.leaf;
+        f.subleaf = feature_to_policy[feat->bit / 32].cpuid.subleaf;
+        f.reg = feature_to_policy[feat->bit / 32].cpuid.reg;
+        f.bit = feat->bit % 32;
+        f.length = 1;
+
+        return cpuid_add(policy, &f, val);
+    }
+
+    case FEAT_MSR:
+        return 2;
+    }
+
     return 2;
 }
 
diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index f036e56fc239..7bf587455d08 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -2620,6 +2620,9 @@ skip_usbdev:
                 case 3:
                     errstr = "illegal CPUID value (must be: [0|1|x|k|s])";
                     break;
+                case ERROR_NOMEM:
+                    errstr = "out of memory";
+                    break;
                 default:
                     errstr = "unknown error";
                     break;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 13:21:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 13:21:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569687.890630 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHz0-0001Qz-HI; Tue, 25 Jul 2023 13:21:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569687.890630; Tue, 25 Jul 2023 13:21:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOHz0-0001Qs-Eg; Tue, 25 Jul 2023 13:21:46 +0000
Received: by outflank-mailman (input) for mailman id 569687;
 Tue, 25 Jul 2023 13:21:45 +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
 <SRS0=n1im=DL=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qOHyz-0001Qm-4d
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 13:21:45 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 149555d0-2aee-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 15:20:53 +0200 (CEST)
Received: from [172.20.10.2] (unknown [37.160.93.75])
 by support.bugseng.com (Postfix) with ESMTPSA id 841084EE0739;
 Tue, 25 Jul 2023 15:21:41 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 149555d0-2aee-11ee-8613-37d641c3527e
Message-ID: <9290ef80-cea6-9b29-3fcf-cf6590dfcf76@bugseng.com>
Date: Tue, 25 Jul 2023 15:21:39 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v2] device_tree: address violations of MISRA C:2012
 Rules 8.2 and 8.3
Content-Language: en-US, it
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com, Stefano Stabellini <sstabellini@kernel.org>
References: <502a92e9b53960a6b78fabb48d354cbb5bc1750c.1690187572.git.federico.serafini@bugseng.com>
 <421bcc71-006f-af73-374a-b54266052a42@xen.org>
From: Federico Serafini <federico.serafini@bugseng.com>
Organization: BUGSENG srl
In-Reply-To: <421bcc71-006f-af73-374a-b54266052a42@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hello Julien,

On 25/07/23 12:02, Julien Grall wrote:
>> -unsigned int dt_number_of_address(const struct dt_device_node *dev)
>> +unsigned int dt_number_of_address(const struct dt_device_node *device)
> We have a structure called 'device', so wouldn't this result to violate 
> another MISRA rule because identifiers are re-used?
> 
> In any case, I would prefer if we keep the shorter version (i.e. 'dev') 
> as this is more common within device_tree.c. We can replace the other 
> 'device' at a leisure pace.

If you refer to the rule 5.3 ("An identifier declared in an inner scope
shall not hide an identifier declared in an outer scope") then no,
it is not a violation because there is no hiding.
To my knowledge, this does not cause violations of any other MISRA rule.

However, I agree with you,
the parameter name 'device' is not the best choice.
I will propose a v2.

Regards
-- 
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 13:24:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 13:24:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569692.890640 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOI21-00020P-VN; Tue, 25 Jul 2023 13:24:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569692.890640; Tue, 25 Jul 2023 13:24:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOI21-00020I-SC; Tue, 25 Jul 2023 13:24:53 +0000
Received: by outflank-mailman (input) for mailman id 569692;
 Tue, 25 Jul 2023 13:24:53 +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 <SRS0=aw78=DL=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qOI20-00020A-TJ
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 13:24:53 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 84689442-2aee-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 15:24:01 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 952A41F8C4;
 Tue, 25 Jul 2023 13:24:49 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3A34A13487;
 Tue, 25 Jul 2023 13:24:49 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id +KSIDCHNv2S9XgAAMHmgww
 (envelope-from <jgross@suse.com>); Tue, 25 Jul 2023 13:24:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 84689442-2aee-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690291489; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=AqyTd2714EJFGCB/jQvmmDvdfesx3+Di6GqmdgIC4dI=;
	b=LOOdKy/MY1uDvvk1hszIq8vTCOTakxEbv7OQBFpz3FS6A5RP37khTfO3i7bdQVVikY4CIg
	EDHWUVtOOaZQDkp1HkzrVedS8BDFWvhJy3gjJVgQkwW6Gd8YRFO/hjBaa9iHvfvYU6Ct7V
	jxJhgX+ZpbeBTdOE/WN89ms1LgwqNJQ=
Message-ID: <e208365f-dbc6-06d1-ccc9-3b2e945a0bff@suse.com>
Date: Tue, 25 Jul 2023 15:24:48 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: Nathan Chancellor <nathan@kernel.org>,
 Bagas Sanjaya <bagasdotme@gmail.com>
Cc: Jan Beulich <jbeulich@suse.com>, "David S. Miller" <davem@davemloft.net>,
 sander44 <ionut_n2001@yahoo.com>, Linux Xen
 <xen-devel@lists.xenproject.org>, Linux BPF <bpf@vger.kernel.org>,
 Linux Networking <netdev@vger.kernel.org>,
 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
 Linux Regressions <regressions@lists.linux.dev>, keescook@chromium.org,
 gustavoars@kernel.org
References: <7e3841ce-011d-5ba6-9dae-7b14e07b5c4b@gmail.com>
 <20230723000657.GA878540@dev-arch.thelio-3990X>
From: Juergen Gross <jgross@suse.com>
Subject: Re: Fwd: UBSAN: index 1 is out of range for type
 'xen_netif_rx_sring_entry [1]'
In-Reply-To: <20230723000657.GA878540@dev-arch.thelio-3990X>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------nTP0TN6FvUDeg01fmFVeb6pv"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------nTP0TN6FvUDeg01fmFVeb6pv
Content-Type: multipart/mixed; boundary="------------H4J7i5BF54v60HLIhY2IcVFH";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Nathan Chancellor <nathan@kernel.org>,
 Bagas Sanjaya <bagasdotme@gmail.com>
Cc: Jan Beulich <jbeulich@suse.com>, "David S. Miller" <davem@davemloft.net>,
 sander44 <ionut_n2001@yahoo.com>, Linux Xen
 <xen-devel@lists.xenproject.org>, Linux BPF <bpf@vger.kernel.org>,
 Linux Networking <netdev@vger.kernel.org>,
 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
 Linux Regressions <regressions@lists.linux.dev>, keescook@chromium.org,
 gustavoars@kernel.org
Message-ID: <e208365f-dbc6-06d1-ccc9-3b2e945a0bff@suse.com>
Subject: Re: Fwd: UBSAN: index 1 is out of range for type
 'xen_netif_rx_sring_entry [1]'
References: <7e3841ce-011d-5ba6-9dae-7b14e07b5c4b@gmail.com>
 <20230723000657.GA878540@dev-arch.thelio-3990X>
In-Reply-To: <20230723000657.GA878540@dev-arch.thelio-3990X>

--------------H4J7i5BF54v60HLIhY2IcVFH
Content-Type: multipart/mixed; boundary="------------OGjxol5Ws0UtfCh0WG4zSCOz"

--------------OGjxol5Ws0UtfCh0WG4zSCOz
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjMuMDcuMjMgMDI6MDYsIE5hdGhhbiBDaGFuY2VsbG9yIHdyb3RlOg0KPiBPbiBTYXQs
IEp1bCAyMiwgMjAyMyBhdCAwNzoyMTowNUFNICswNzAwLCBCYWdhcyBTYW5qYXlhIHdyb3Rl
Og0KPj4gSGksDQo+Pg0KPj4gSSBub3RpY2UgYSByZWdyZXNzaW9uIHJlcG9ydCBvbiBCdWd6
aWxsYSBbMV0uIFF1b3RpbmcgZnJvbSBpdDoNCj4+DQo+Pj4gSGkgS2VybmVsIFRlYW0sDQo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ZW4vaW5jbHVkZS9wdWJsaWMvaW8vcmluZy5oDQoNCk5vLCBJ
IGRvbid0IHRoaW5rIGl0IHdpbGwgYmUgcG9zc2libGUgdG8gY2hhbmdlIHRoaXMgaW4gdGhl
IFhlbiB0cmVlIGVhc2lseS4NCg0KRXNwZWNpYWxseSB0aGUgcHVibGljIFhlbiBoZWFkZXJz
IGFyZSBtZWFudCB0byBiZSBjb21wYXRpYmxlIHdpdGggYSBsYXJnZQ0KdmFyaWV0eSBvZiBj
b21waWxlcnMsIGluY2x1ZGluZyByYXRoZXIgb2xkIG9uZXMuDQoNClRoaXMgbWVhbnMgdGhh
dCByaW5nWzFdIGNhbid0IGJlIGVhc2lseSBzd2FwcGVkIHdpdGggcmluZ1tdLCBhcyB0aGF0
IHdvdWxkDQpjYXVzZSBjb21waWxlIHRpbWUgZXJyb3JzIHdpdGggc29tZSBjb21waWxlcnMu
DQoNCkp1c3QgbW9kaWZ5aW5nIHRoZSBMaW51eCBzaWRlIGhlYWRlciBpcyBhbiBvcHRpb24s
IHRob3VnaCwgYXMgd2UgZG9uJ3QgbmVlZA0KdGhlIHNhbWUgd2lkZSByYW5nZSBvZiBzdXBw
b3J0ZWQgY29tcGlsZXJzIGFzIFhlbi4NCg0KSSdsbCBzZW5kIGEgcGF0Y2ggZm9yIHRoYXQg
cHVycG9zZS4NCg0KDQpKdWVyZ2VuDQoNCg==
--------------OGjxol5Ws0UtfCh0WG4zSCOz
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1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AQgAyzH6
AOODMBjgfWE9VeCgsrwH3exNAU32gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------OGjxol5Ws0UtfCh0WG4zSCOz--

--------------H4J7i5BF54v60HLIhY2IcVFH--

--------------nTP0TN6FvUDeg01fmFVeb6pv
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmS/zSAFAwAAAAAACgkQsN6d1ii/Ey8J
Igf/cxop+Y34IyMeKy4ptiNoxHLysbvjMVWw1Bxs5MPof6FGH+16DR6D0re3wLODJ7+9h76LvZ5g
D1YcTZKLVXDfYm3TBkJ4jXJT5QRq/p2lULCLPxB8mtpNZ6yh0zNgo2uAPj50Cqenno2T81Z9W3Pw
HdA9Q0BGM/YBkfea6jIdrfDsPRliTCn/hrdhWm3iEaTv25Cmis/T2g7bnbCjV+PHvPHYUsooaSxu
ENtJy6Qgr/WVMkgIB5akYmradxcmGN4nr9/MKNa6APQzSBbAo27P/jvCe8dzUlXQUx7ki3wV+2Ya
PfNIKYmYIgrY6rjdgkWhPJ4F6xNzm6TVFCu3LFNrEg==
=L4jj
-----END PGP SIGNATURE-----

--------------nTP0TN6FvUDeg01fmFVeb6pv--


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 13:26:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 13:26:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569695.890651 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOI3w-0002db-Ff; Tue, 25 Jul 2023 13:26:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569695.890651; Tue, 25 Jul 2023 13:26:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOI3w-0002dU-CI; Tue, 25 Jul 2023 13:26:52 +0000
Received: by outflank-mailman (input) for mailman id 569695;
 Tue, 25 Jul 2023 13:26:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xGH8=DL=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qOI3v-0002dM-1Z
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 13:26:51 +0000
Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com
 [2a00:1450:4864:20::52a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e8aeadc9-2aee-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 15:26:49 +0200 (CEST)
Received: by mail-ed1-x52a.google.com with SMTP id
 4fb4d7f45d1cf-5222a38c0a0so3724710a12.1
 for <xen-devel@lists.xenproject.org>; Tue, 25 Jul 2023 06:26:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e8aeadc9-2aee-11ee-b23f-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690291608; x=1690896408;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=O4YgP8vVhGP/Z3y2FHVVLMtFg2ANsoPqxTlazFBlfDo=;
        b=sLd4renpKM3+jIbQ8prX9LYJvJpWHnT9oSjmNmAMm5M8x4/HgQeX3chtabcUjstODq
         SYdXyDvRv3ZAvTyLDUN7VU4nkLUPp7qz5D6E5SWFHv3+0S5wlO3ZQV8NovtIGZimOfnn
         RJu/T658MY0gqV2Nr3l5tBP4N8ZvpmCfWvUVQJBMftFGDumo7tBOq/JfEe+21TQeIl8v
         MaDBt9tTdgbmy2a0Q1d/5ozScr7/bPN8Iv/YUJAAf/8YCnxUdmqVhYBswj8DuddYqo48
         M7t8ucxYObQZIPZ9tr6dAXI1DB/VKR7ldBurwAdjWNa2tN7GyFPJFF3Iby4IIcbHeida
         qxtg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690291608; x=1690896408;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=O4YgP8vVhGP/Z3y2FHVVLMtFg2ANsoPqxTlazFBlfDo=;
        b=Gae2O7tOCjlV+VRGD8duB8iBsTwtzjVL/gI90TgBANAM4gE0L3HpIE0ROzpisOokqk
         zqkMvLyFKdH9UUaF7x6gPAhu3+tL43eiMQ+Kv5vMnHy2Z3a/hjPfCxfYosS7m/kDT3Y2
         IorZEEzbPn/zRBjRghac6qK5r7YWWv4Rcg8TkX8vf8QVmasgeR2O+nYh3Ou1wCqHbq3D
         8eQGJuHoMCpuO+6pkh7h5a9YUAdkMyjQogvxR9n6YjNDJgvPveqjv/mFSigHU5s8ciml
         Llsni3io/uePgdnVa7CwmHSlMrgJYCi26nGkOzvGpRz1qHqtjwV2a1C5hiL9+jH5FZ+I
         pYBw==
X-Gm-Message-State: ABy/qLbl8KXRYA9dPTpArUkAuPzfTUZFG9QVsPtGtoSdFv98ZslCgX3R
	SpPOmAYAVK5JCe6UiuoXfkZFO2TjkVxM9k8RunU=
X-Google-Smtp-Source: APBJJlH9r71cTL5AolZNWo/nazMISuKmtnGcyOofNXifLkrI09MZyWhVrserdDZAqKjdwooFl3Nxnii/6fG/LYqyQWs=
X-Received: by 2002:a05:6402:3da:b0:51e:3558:5eb6 with SMTP id
 t26-20020a05640203da00b0051e35585eb6mr11534512edw.3.1690291608404; Tue, 25
 Jul 2023 06:26:48 -0700 (PDT)
MIME-Version: 1.0
References: <20230724125857.11133-1-jandryuk@gmail.com> <20230724125857.11133-7-jandryuk@gmail.com>
 <7636d3d2-c78d-711a-ed90-aedd1b464c6c@suse.com> <CAKf6xpt1LzKMv7E-G3sTpUWrEApy+BX8z7dG69oS1upHcpytMg@mail.gmail.com>
 <d3d8123e-2b81-d3e0-3883-83dcdaf99700@suse.com>
In-Reply-To: <d3d8123e-2b81-d3e0-3883-83dcdaf99700@suse.com>
From: Jason Andryuk <jandryuk@gmail.com>
Date: Tue, 25 Jul 2023 09:26:35 -0400
Message-ID: <CAKf6xpsE_=XYWcC8Q6NhKkboMajnOKZAsfUpOROeGuhU+7CTdw@mail.gmail.com>
Subject: Re: [PATCH v6 06/15] cpufreq: Add Hardware P-State (HWP) driver
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, 
	Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 25, 2023 at 2:27=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wro=
te:
>
> On 24.07.2023 21:49, Jason Andryuk wrote:
> > On Mon, Jul 24, 2023 at 12:15=E2=80=AFPM Jan Beulich <jbeulich@suse.com=
> wrote:
> >> On 24.07.2023 14:58, Jason Andryuk wrote:
> >>> --- /dev/null
> >>> +++ b/xen/arch/x86/acpi/cpufreq/hwp.c
> >>> +#define hwp_err(cpu, fmt, ...) \
> >>> +    printk(XENLOG_ERR "HWP: CPU%u error: " fmt, cpu, ##__VA_ARGS__)
> >>> +#define hwp_info(fmt, ...)    printk(XENLOG_INFO "HWP: " fmt, ##__VA=
_ARGS__)
> >>
> >> I'm not convinced ", ##__VA_ARGS__" is a good construct to use. I noti=
ce
> >> we have a few instances (mainly in code inherited from elsewhere), but=
 I
> >> think it ought to either be plain C99 style (without the ##) or purely
> >> the gcc extension form (not using __VA_ARGS__).
> >
> > Using plain __VA_ARGS__ doesn't work for the cases without arguments:
> > arch/x86/acpi/cpufreq/hwp.c:78:53: error: expected expression before =
=E2=80=98)=E2=80=99 token
> >    78 |         printk(XENLOG_DEBUG "HWP: " fmt, __VA_ARGS__);  \
> >       |                                                     ^
> > arch/x86/acpi/cpufreq/hwp.c:201:9: note: in expansion of macro =E2=80=
=98hwp_verbose=E2=80=99
> >   201 |         hwp_verbose("disabled: No energy/performance
> > preference available");
> >       |         ^~~~~~~~~~~
>
> Of course.
>
> > I can use "__VA_OPT__(,) __VA_ARGS__" though.
>
> __VA_OPT__ is yet newer than C99, so this is an option only if all
> compilers we continue to support actually know of this.

Right, sorry.

> We have no
> uses of it in the codebase so far, which suggests you might best go
> with the longstanding gcc extension here.

FTAOD, "##__VA_ARGS__" is the longstanding extension?  It's the only
one I've been able to get to compile.  I'm reading
https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html and it
mentions a few different extensions.

This part seemed promising:
"""
This has been fixed in C++20, and GNU CPP also has a pair of
extensions which deal with this problem.

First, in GNU CPP, and in C++ beginning in C++20, you are allowed to
leave the variable argument out entirely:

eprintf ("success!\n")
     =E2=86=92 fprintf(stderr, "success!\n", );
"""

However, it doesn't seem to actually work for me.  I still get an
error like the one above for plain __VA_ARGS__.  That is for:

    #define hwp_err(cpu, fmt, args...) \
        printk(XENLOG_ERR "HWP: CPU%u error: " fmt, cpu, args)

I can drop "fmt" from hwp_info() and hwp_verbose() to just use
__VA_ARGS__, but that doesn't work for hwp_err() since we want to
re-order fmt and cpu inside the macro.

Thanks,
Jason


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 13:31:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 13:31:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569697.890661 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOI8I-00045u-WC; Tue, 25 Jul 2023 13:31:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569697.890661; Tue, 25 Jul 2023 13:31:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOI8I-00045n-Sw; Tue, 25 Jul 2023 13:31:22 +0000
Received: by outflank-mailman (input) for mailman id 569697;
 Tue, 25 Jul 2023 13:31:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=A3G+=DL=citrix.com=prvs=56320e048=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOI8G-00045h-Ud
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 13:31:20 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 88617dc1-2aef-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 15:31:18 +0200 (CEST)
Received: from mail-mw2nam10lp2108.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.108])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 25 Jul 2023 09:30:55 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by PH0PR03MB6400.namprd03.prod.outlook.com (2603:10b6:510:b6::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.29; Tue, 25 Jul
 2023 13:30:53 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6609.031; Tue, 25 Jul 2023
 13:30:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 88617dc1-2aef-11ee-b23f-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690291878;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=cdt3mcnVdwfpZbidGPgv3fBAQZqFR4yEjwQueoTratM=;
  b=KEe31UBgW7RIp0+mFixqJ8OkXLLgoViGRu6hyL+Mji4VwfrtlYVUadkc
   AyJtiVHUnGQ9bsFgyogpcW4GtlDxDUp+aKz2+lwKgomsmvJf2HLE/yev6
   /pTx+K5j1SHpMm/VAYmQVES2zFiyZUsracY0V6qzVNFXUkAAtsG0LnePg
   0=;
X-IronPort-RemoteIP: 104.47.55.108
X-IronPort-MID: 117384354
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:CKTwB62qSwWj8VyZFvbD5fJwkn2cJEfYwER7XKvMYLTBsI5bpzEAz
 GEcXmHQb6qIZGTxeNEiYIuxpk4Hu5OExtcwSQRlpC1hF35El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bjq7pXhfr8wZ94CMuAhtN9EESLti+kaJ59W7qLoTAyp/vH0idVrO
 Xx
X-Talos-CUID: =?us-ascii?q?9a23=3A1xowTWhsqSK89N7T4eMWqePhqzJuamOD9WjeM0G?=
 =?us-ascii?q?DFndGa5+QTGa76LJAqp87?=
X-Talos-MUID: 9a23:D5lmiwbuJI9ukOBTlznQ1AM+N+5T44OJBGQIiJc8vfvbHHkl
X-IronPort-AV: E=Sophos;i="6.01,230,1684814400"; 
   d="scan'208";a="117384354"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=j4lIUoEkcyNIg8e8SZayu16/lUbCefrAw9uXbj8duYYML9cwB88OYE6btE8AW/dafkNxQRRZv4jX3NQi4Pcya15XfDj8n+tvJrub/BCIQMRROWNCsaufTRVLKCI4whi+v6RNDcn7R13lj+OV4yhmb5YLC9GVIRpkzzUzjgbtqVbz8QBa6GkxGBV3cCDskylCnsjN5rN/K4Wd4CKnZdxXmvPw5oEnhTQ/P+HkaJQApXQQ6TEWm7bx3sAdLhJ3fuD3/u6wjBD89mphJGoon5fq1r4a8fNSz/R3dzMnYBaCVHBvI6AI1uDkxQPY+55f8nYSjfILwROKHBtFQItSrwgfcA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=JkzvlS7YgjafCSIz40nYce5MrEYRCo9o9cp+rHpmmAA=;
 b=T1/TN2QaH/IqEm5oQT07CV8aUsNdUFKpg50RrEhBW40fUnp8vQefEPM3a3kjpodvvuY0tXg8mUi/t7sSZMvNmS4e6gJh31nGoFhzoIE/VBu88Urqr/5eDoWLIS0AgHQsOU1thRnC2ve3cBbud+ebOeHvi5ojFiiJoUZsjtBRZYlo8Cas6gXjptkff4q3EhIVKKp+5VxwD39KTwXD4KWfbfylpjTVyj73djm8F6xnsjUcrkv282qLpalIPmOUIG3rKvdjVpOfzN8TtoXd0hmOikkTqyfGMx/vg+I09lUo5nO+IZGwpLMbGqy2Z/xlCC7YC9MLwoMqRjh4g1W7Hn+EQQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=JkzvlS7YgjafCSIz40nYce5MrEYRCo9o9cp+rHpmmAA=;
 b=Tky3GJP+lyCuE+brKCQFHbt6+SRIGeB8CjBfSwSpfsM1Yn0p5YIZXpaDblPUU9cKVOti1QiVv9txOh2IY3DTgFY3pFxAQtmKYebfKeoxWWVvnlmNsf/pPjMFKPmDNUbU2mS7IZEnLPVCdhwRGJ3Ot4wrvdnNbLKPonokG4oAof4=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Tue, 25 Jul 2023 15:30:47 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 2/5] x86/ioapic: RTE modifications must use
 ioapic_write_entry
Message-ID: <ZL_Oh6S8mbNan-s-@MacBook-Air-de-Roger.local>
References: <20230718124334.36548-1-roger.pau@citrix.com>
 <20230718124334.36548-3-roger.pau@citrix.com>
 <1bc67bb2-9b01-eb18-eb6a-741067a9b35c@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <1bc67bb2-9b01-eb18-eb6a-741067a9b35c@suse.com>
X-ClientProxiedBy: LO2P265CA0467.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:a2::23) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|PH0PR03MB6400:EE_
X-MS-Office365-Filtering-Correlation-Id: 84c228b9-3a7a-4339-47fd-08db8d135e73
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	VkS+bIvVMe6NhIDQHUrfsKTom/BMsD2twb68GohwyllH3Jw8k85mSPK7qE5pDGI16kobYwgoxPNGWpDDlg3/9Ej8wvRssbCzhTbK2NjtuwyknBpbW/UeVvwaL8CkZ5dINzJc0oABVVgxINntJx7+6nZM1LYysVvQMmBVCaC4hTEJrfrDOZCTAYJ/9LOcih9n1EIcRotyknGupk0r23Y2+HJxoYecxqbIvYElh0LWSBBtC2Fr+KsUxHLMOHCluSn2JIs8ImYUldj6eraSxmWaKQi4ST6fXlWsUN85LVwAGsODcKyJIp8pYs9pCtU98urd4IH8KV5Nr2pG4poPgiE9i8JR+IbrQbC9hOYEzROeby4aVSXw0EC29k0aayEedgAKzfwRUQ9uSDuz+NQ1O8dcS6dx8vRjadwFQUb5Z1nQmgW4qi5DqFDfCv5B7ma5sYUyfmZaXo5PxZgKHuFGVw/JNZ/l4pjWK8FWmg2Dx8OhXs8I8FrkPRFBneA3GcFc8uUZey5bllu+azNMFMZYs2WAhUpxFHau8CbVAfEL0CuIMep59XePdwWMb/mwYPp1IgTu
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(366004)(376002)(39860400002)(136003)(451199021)(54906003)(6512007)(6486002)(478600001)(9686003)(6666004)(83380400001)(86362001)(2906002)(53546011)(186003)(6506007)(66476007)(26005)(38100700002)(6916009)(66556008)(85182001)(82960400001)(4326008)(316002)(41300700001)(5660300002)(66946007)(8676002)(8936002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UHFRMGkwK3FDM2s2SkIzRWJGaEJtSmUyOXB5akh0bHZSd2xZM0EvbEIwR0h0?=
 =?utf-8?B?djdadHI2eDR5ZnQyQmM1cmVocjk1cGhaMEFlREU0enRUTnFHYjRVTGNYbkR6?=
 =?utf-8?B?N0VNNEZDdlEwQ1VLRXltVlE0ZitwQTFBQlptUzdsb3o5Y2VFa2VLSlNJNEdW?=
 =?utf-8?B?eGFJR3VQNmFmbTI5K2JXemNpckhjTDY0UlZ6VEpyTlZwWldmbDRRdTZpQjQ5?=
 =?utf-8?B?K28zRjk5ZVZobkFyVEZHV2Ftd0ZqSkh0NUFEYU1TaHBqWEg4Wm5PU3Vndkha?=
 =?utf-8?B?eVNEOGNXK2dkbk5lTHlMdVAzYVpIZzZWelFPWXRkZmRYOWl2d3liSTNsa0Nw?=
 =?utf-8?B?TGUyUmplWForYWR0ZjFLcm9YZHlBbU0vV0gwMUdsNk8xaWU5MUdSMk5OSG11?=
 =?utf-8?B?WnNTWDA3L2d2NmczNVRkSEtlQ0JJOWZWMHBOWFhLMGRodjZqTStrZGR1L1ZW?=
 =?utf-8?B?TnBNRktUdjJCUlYyRy9Pb0RwemRpTGg4Y1FvTDFtc3U5ZWJPYlZkaGVhdnJM?=
 =?utf-8?B?VENPZTdlenZYV3o5SVFwM2cvZjhveFNMWWdRYklYTS9ySVRsVGNxcWZqTlJC?=
 =?utf-8?B?QUtuNEVjSGRaaUJoOTF1ZGJxb1N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d6kJ/0vKX5HP25ox0JUgBw+tzHktODuDg4WWrHmMcSzNKQgkVPqs3pwKQrJnnbW3vQq9iizq4GCQ7Qjk3GAjdBZvr7Thf5RaevSbSziYVXTVpB1xExhOgXaatTncsvNAc+sQ5TQxxduS74y9fcoEUDPl/bmTloEHl6pmdLeVklKD59EDmQu1oHL98XLjnDvb6CEQUKMwvI0RVmvbKGGJ1xpemAVbzePbUfcs45NTQJVg6mK4ix8sv9+eJTzMAtkT9nJ+MF7LwPyp0YAn5rysPXKULwvQNnVrQ3v3LowMwe4xA4x5p/oEszhbDoD7cNEdrCwnMhEa6rjkFBnN2NttAUasLswtfMuip90pkT1yeVp907dlmYtp4XWxF84UKVIEx7OJ3zz8/tQcfITP7q8OloN2wOt7Nlr9SwssDHHMXhUxPYzEQHzZN6Qax5GTubuuVmIyDfDwxoqUfVreEkAL0SyRG1Cx/xwWVQgfC+PrjlxGYEvBnlWoYJakh/a5mL5d0yS5P/CHSgocyox0O8hGOGMruhaRGySbw2CVtP12RD9Fymju6vm6PZyOHyCYki1DqpXv2npmhYwywTstp0ZuDOF7JtuAkMlOk73OQkbxhmNS9kFF/aOcYhxzayIBQdSWmPGJAbKuLmD7SRAsgzN4pLYI9N/PhGu89kVfpWaIxpfT/3B4PGd9sqGWL38CYoK
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 84c228b9-3a7a-4339-47fd-08db8d135e73
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 13:30:53.4733
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: cYxLhdREceaXLC9uaQ6UlrBURx8/NP6mWSrO9B7A+CDa+I/U9UxfVGe9y2dYmSErkDBeHtA0PDMv9WQPZQcwoA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB6400

On Tue, Jul 18, 2023 at 05:40:18PM +0200, Jan Beulich wrote:
> On 18.07.2023 14:43, Roger Pau Monne wrote:
> > --- a/xen/arch/x86/io_apic.c
> > +++ b/xen/arch/x86/io_apic.c
> > @@ -584,16 +585,16 @@ set_ioapic_affinity_irq(struct irq_desc *desc, const cpumask_t *mask)
> >              dest = SET_APIC_LOGICAL_ID(dest);
> >          entry = irq_2_pin + irq;
> >          for (;;) {
> > -            unsigned int data;
> > +            struct IO_APIC_route_entry rte;
> > +
> >              pin = entry->pin;
> >              if (pin == -1)
> >                  break;
> >  
> > -            io_apic_write(entry->apic, 0x10 + 1 + pin*2, dest);
> > -            data = io_apic_read(entry->apic, 0x10 + pin*2);
> > -            data &= ~IO_APIC_REDIR_VECTOR_MASK;
> > -            data |= MASK_INSR(desc->arch.vector, IO_APIC_REDIR_VECTOR_MASK);
> > -            io_apic_modify(entry->apic, 0x10 + pin*2, data);
> > +            rte = __ioapic_read_entry(entry->apic, pin, false);
> > +            rte.dest.dest32 = dest;
> > +            rte.vector = desc->arch.vector;
> > +            __ioapic_write_entry(entry->apic, pin, false, rte);
> 
> ... this makes me wonder whether there shouldn't be an
> __ioapic_modify_entry() capable of suppressing one of the two
> writes (but still being handed the full RTE).

I've wondered about this, and I'm not sure how often can one of the
two writes be suppressed here, as we modify both the low (for the
vector) and the high part of the RTE (for the destination).  It's
unlikely that the same vector could be used on both destinations, and
IMO such case doesn't warrant the introduction of the extra logic
required in order to suppress one of the writes.

Am I overlooking something?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 13:34:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 13:34:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569699.890671 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOIBL-0004fF-EQ; Tue, 25 Jul 2023 13:34:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569699.890671; Tue, 25 Jul 2023 13:34:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOIBL-0004f8-BZ; Tue, 25 Jul 2023 13:34:31 +0000
Received: by outflank-mailman (input) for mailman id 569699;
 Tue, 25 Jul 2023 13:34:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=aw78=DL=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qOIBJ-0004f2-Ve
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 13:34:30 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fa29d7ed-2aef-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 15:34:28 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 80D3A1F8D6;
 Tue, 25 Jul 2023 13:34:27 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 21B7613487;
 Tue, 25 Jul 2023 13:34:27 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 7ezUBmPPv2SsZAAAMHmgww
 (envelope-from <jgross@suse.com>); Tue, 25 Jul 2023 13:34:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fa29d7ed-2aef-11ee-b23f-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690292067; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=qNMgcrFtdllbZ63W0rNOYzsin59mC+hMgJ5rAGjGU2k=;
	b=P8NjzCmbfPjiNHboTSs2uNE4kfaoRscLudzdVKGxOzVBdj5ubBfhbdUTY+X1pAEzxmq7TD
	iSCsV/ngMYlzlUtvY4IStP/B8YS6XPC+ouuZVpamsOztrOKhAqpmjvchhljkJMD1M/wUk6
	VZW9YOK5xWJNms5iL+gkQqajMlhLr5s=
Message-ID: <73019154-6a34-f714-96b5-b43038569feb@suse.com>
Date: Tue, 25 Jul 2023 15:34:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: Fwd: UBSAN: index 1 is out of range for type
 'xen_netif_rx_sring_entry [1]'
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
To: Nathan Chancellor <nathan@kernel.org>,
 Bagas Sanjaya <bagasdotme@gmail.com>
Cc: Jan Beulich <jbeulich@suse.com>, "David S. Miller" <davem@davemloft.net>,
 sander44 <ionut_n2001@yahoo.com>, Linux Xen
 <xen-devel@lists.xenproject.org>, Linux BPF <bpf@vger.kernel.org>,
 Linux Networking <netdev@vger.kernel.org>,
 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
 Linux Regressions <regressions@lists.linux.dev>, keescook@chromium.org,
 gustavoars@kernel.org
References: <7e3841ce-011d-5ba6-9dae-7b14e07b5c4b@gmail.com>
 <20230723000657.GA878540@dev-arch.thelio-3990X>
 <e208365f-dbc6-06d1-ccc9-3b2e945a0bff@suse.com>
In-Reply-To: <e208365f-dbc6-06d1-ccc9-3b2e945a0bff@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------XBKzJwB0h6uCLN7Vd5l5OOF0"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------XBKzJwB0h6uCLN7Vd5l5OOF0
Content-Type: multipart/mixed; boundary="------------VGyeuckk1S0Ydd9KEXqzZO52";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Nathan Chancellor <nathan@kernel.org>,
 Bagas Sanjaya <bagasdotme@gmail.com>
Cc: Jan Beulich <jbeulich@suse.com>, "David S. Miller" <davem@davemloft.net>,
 sander44 <ionut_n2001@yahoo.com>, Linux Xen
 <xen-devel@lists.xenproject.org>, Linux BPF <bpf@vger.kernel.org>,
 Linux Networking <netdev@vger.kernel.org>,
 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
 Linux Regressions <regressions@lists.linux.dev>, keescook@chromium.org,
 gustavoars@kernel.org
Message-ID: <73019154-6a34-f714-96b5-b43038569feb@suse.com>
Subject: Re: Fwd: UBSAN: index 1 is out of range for type
 'xen_netif_rx_sring_entry [1]'
References: <7e3841ce-011d-5ba6-9dae-7b14e07b5c4b@gmail.com>
 <20230723000657.GA878540@dev-arch.thelio-3990X>
 <e208365f-dbc6-06d1-ccc9-3b2e945a0bff@suse.com>
In-Reply-To: <e208365f-dbc6-06d1-ccc9-3b2e945a0bff@suse.com>

--------------VGyeuckk1S0Ydd9KEXqzZO52
Content-Type: multipart/mixed; boundary="------------TUoqzjv9mh2JbW2RC5eU2Syu"

--------------TUoqzjv9mh2JbW2RC5eU2Syu
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjUuMDcuMjMgMTU6MjQsIEp1ZXJnZW4gR3Jvc3Mgd3JvdGU6DQo+IE9uIDIzLjA3LjIz
IDAyOjA2LCBOYXRoYW4gQ2hhbmNlbGxvciB3cm90ZToNCj4+IE9uIFNhdCwgSnVsIDIyLCAy
MDIzIGF0IDA3OjIxOjA1QU0gKzA3MDAsIEJhZ2FzIFNhbmpheWEgd3JvdGU6DQo+Pj4gSGks
DQo+Pj4NCj4+PiBJIG5vdGljZSBhIHJlZ3Jlc3Npb24gcmVwb3J0IG9uIEJ1Z3ppbGxhIFsx
XS4gUXVvdGluZyBmcm9tIGl0Og0KPj4+DQo+Pj4+IEhpIEtlcm5lbCBUZWFtLA0KPj4+Pg0K
Pj4+PiBJIHJlYnVpbGQgdG9kYXkgbGF0ZXN0IHZlcnNpb24gZnJvbSBtYWlubGluZSByZXBv
Lg0KPj4+PiBBbmQgaSBub3RpY2UgaXNzdWUgcmVnYXJkaW5nIHhlbi1uZXRmcm9udC5jLg0K
Pj4+Pg0KPj4+PiBFcnJvcjoNCj4+Pj4gW8KgwqDCoCAzLjQ3NzQwMF0gDQo+Pj4+ID09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09DQo+Pj4+IFvCoMKgwqAgMy40Nzc2MzNdIFVCU0FOOiBh
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W4gaGVhZGVycyBhcmUgbWVhbnQgdG8gYmUgY29tcGF0aWJsZSB3aXRoIGEg
bGFyZ2UNCj4gdmFyaWV0eSBvZiBjb21waWxlcnMsIGluY2x1ZGluZyByYXRoZXIgb2xkIG9u
ZXMuDQo+IA0KPiBUaGlzIG1lYW5zIHRoYXQgcmluZ1sxXSBjYW4ndCBiZSBlYXNpbHkgc3dh
cHBlZCB3aXRoIHJpbmdbXSwgYXMgdGhhdCB3b3VsZA0KPiBjYXVzZSBjb21waWxlIHRpbWUg
ZXJyb3JzIHdpdGggc29tZSBjb21waWxlcnMuDQo+IA0KPiBKdXN0IG1vZGlmeWluZyB0aGUg
TGludXggc2lkZSBoZWFkZXIgaXMgYW4gb3B0aW9uLCB0aG91Z2gsIGFzIHdlIGRvbid0IG5l
ZWQNCj4gdGhlIHNhbWUgd2lkZSByYW5nZSBvZiBzdXBwb3J0ZWQgY29tcGlsZXJzIGFzIFhl
bi4NCj4gDQo+IEknbGwgc2VuZCBhIHBhdGNoIGZvciB0aGF0IHB1cnBvc2UuDQoNCk9oLCBp
biBmYWN0IHRoZXJlIGlzIGEgd2F5IGluIFhlbiB0byBkbyB0aGF0IGNvcnJlY3RseS4gSXQg
c2Nob3VsZCBiZSBlbm91Z2ggdG8NCnVzZSByaW5nW1hFTl9GTEVYX0FSUkFZX0RJTV0sIHdo
aWNoIHdpbGwgZG8gdGhlIHJpZ2h0IHRoaW5nLg0KDQpTbyBJJ2xsIHdyaXRlIGEgWGVuIHBh
dGNoIGZpcnN0LCBhZnRlciBhbGwuDQoNCg0KSnVlcmdlbg0K
--------------TUoqzjv9mh2JbW2RC5eU2Syu
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/To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EvmV2xAKDoaEOgQB4iFQLhJCdP1I5aSgM5IVFdn7v5YgEYuJYx37Io
N1EblHI//x/e2AaIHpzK5h88NEawQsaNRpNSrcfbFmAg987ATQRTjHAWAQgAyzH6
AOODMBjgfWE9VeCgsrwH3exNAU32gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------TUoqzjv9mh2JbW2RC5eU2Syu--

--------------VGyeuckk1S0Ydd9KEXqzZO52--

--------------XBKzJwB0h6uCLN7Vd5l5OOF0
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmS/z2IFAwAAAAAACgkQsN6d1ii/Ey/6
bQf+LeN3/UlgSdhOACatDE09SAKAljNmqZoo9e3+Rei0wQJi1WgS8f5NMiKLTbImLjMPTFkqsMzv
EEq2eSo4tpdz9m7q0bAezCTLcT6MC7ak4F8jT5bRQFIjsZq5HSO2eBZhlKOd9EuaPOCC0k5qtfwp
YnAFZZejmcpddMNtIPGIx/tqP7prEozVKMzaKUICNG2uafTs1W531UqAtmKEmwiF2tFBuYuIipOh
eM5IcT+oDP0lHqVsTlFmkgn4sugTIOmAhAECUDsG/CQRWCArNXxMv4aqeQz/H2jh0jTQvN38OUhK
R4zHgCueLE+r0ENr/+AcQ2WoDWEkEuliMDOLU5kMug==
=f1Qj
-----END PGP SIGNATURE-----

--------------XBKzJwB0h6uCLN7Vd5l5OOF0--


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 13:50:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 13:50:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569706.890680 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOIQH-0006KC-R6; Tue, 25 Jul 2023 13:49:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569706.890680; Tue, 25 Jul 2023 13:49:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOIQH-0006K5-OR; Tue, 25 Jul 2023 13:49:57 +0000
Received: by outflank-mailman (input) for mailman id 569706;
 Tue, 25 Jul 2023 13:49:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOIQG-0006Jv-RI; Tue, 25 Jul 2023 13:49:56 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOIQG-0002hT-Mb; Tue, 25 Jul 2023 13:49:56 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOIQG-0005ck-8s; Tue, 25 Jul 2023 13:49:56 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOIQG-0001qE-8Q; Tue, 25 Jul 2023 13:49:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=9Tq8d8IhvK8rdIljreJFAlhm1759MJXThepoWh09LNU=; b=srHMGBGH8dpz5plkJjIh5JlabI
	qtbKvU6dHIEJEhhaOTFAj+txFpsvwkn/64Zfj8GP2eDLuN9fI0bNeLfUnPj6ztdZaKInmRATngjdd
	olthbPdVb04jgSrtreoPUB1qrCvW4ftNeJr3Wg1rrS9lROqEaVvo+ucQR4K/XCkGggdE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181995-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.15-testing test] 181995: tolerable trouble: fail/pass/starved - PUSHED
X-Osstest-Failures:
    xen-4.15-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.15-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.15-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.15-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.15-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.15-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.15-testing:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.15-testing:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.15-testing:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.15-testing:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.15-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.15-testing:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-4.15-testing:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.15-testing:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.15-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.15-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.15-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.15-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.15-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.15-testing:test-arm64-arm64-libvirt-xsm:hosts-allocate:starved:nonblocking
X-Osstest-Versions-This:
    xen=faa4e2b1cf8022497a7b60c5b50a3bd280a5fc65
X-Osstest-Versions-That:
    xen=87cb0fd8757542893336aa2ffce3947451adf144
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 25 Jul 2023 13:49:56 +0000

flight 181995 xen-4.15-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181995/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 180426
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180426
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180426
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180426
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 180426
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 180426
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180426
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180426
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 180426
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 180426
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 180426
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 180426
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm  3 hosts-allocate               starved  n/a

version targeted for testing:
 xen                  faa4e2b1cf8022497a7b60c5b50a3bd280a5fc65
baseline version:
 xen                  87cb0fd8757542893336aa2ffce3947451adf144

Last test of basis   180426  2023-04-26 07:39:28 Z   90 days
Testing same since   181995  2023-07-24 16:37:09 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 starved 
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   87cb0fd875..faa4e2b1cf  faa4e2b1cf8022497a7b60c5b50a3bd280a5fc65 -> stable-4.15


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 13:56:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 13:56:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569712.890694 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOIW9-0007r2-Hu; Tue, 25 Jul 2023 13:56:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569712.890694; Tue, 25 Jul 2023 13:56:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOIW9-0007qv-F8; Tue, 25 Jul 2023 13:56:01 +0000
Received: by outflank-mailman (input) for mailman id 569712;
 Tue, 25 Jul 2023 13:56:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=aw78=DL=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qOIW8-0007qp-TP
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 13:56:00 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fc1eaa03-2af2-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 15:55:59 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 519E91FD65;
 Tue, 25 Jul 2023 13:55:59 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2CB8E13487;
 Tue, 25 Jul 2023 13:55:59 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id c+IrCW/Uv2SEcAAAMHmgww
 (envelope-from <jgross@suse.com>); Tue, 25 Jul 2023 13:55:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fc1eaa03-2af2-11ee-b23f-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690293359; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:  content-transfer-encoding:content-transfer-encoding;
	bh=jUKVQwiBVg5c8tP4oa1JbpgaUtbxTHSXSrceFPdKKlw=;
	b=jVIMgYDPsjOyxMn6nWgvP+3TMO5OlLo8fH/xCaqM8yAViIKje2rwb9jJz6gSJU2uxTIRTN
	kxMs6w8VnrqIR1QOSk9uGbseucZ+KaW8dBXXIekVi9LYa2r43c+AAgWzF8BWvR1OMSuH0s
	1moEONLCpGBGDYzJQKTdPvwDD8zdpq0=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>
Subject: [PATCH] xen/public: fix flexible array definitions
Date: Tue, 25 Jul 2023 15:55:57 +0200
Message-Id: <20230725135557.20518-1-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Flexible arrays in public headers can be problematic with some
compilers.

Replace them with arr[XEN_FLEX_ARRAY_DIM] in order to avoid compilation
errors.

This includes arrays defined as "arr[1]", as seen with a recent Linux
kernel [1].

[1]: https://bugzilla.kernel.org/show_bug.cgi?id=217693

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 xen/include/public/io/cameraif.h | 2 +-
 xen/include/public/io/displif.h  | 2 +-
 xen/include/public/io/fsif.h     | 4 ++--
 xen/include/public/io/pvcalls.h  | 2 +-
 xen/include/public/io/ring.h     | 4 ++--
 xen/include/public/io/sndif.h    | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/include/public/io/cameraif.h b/xen/include/public/io/cameraif.h
index 13763abef9..d6c69d6e1c 100644
--- a/xen/include/public/io/cameraif.h
+++ b/xen/include/public/io/cameraif.h
@@ -763,7 +763,7 @@ struct xencamera_buf_create_req {
  */
 struct xencamera_page_directory {
     grant_ref_t gref_dir_next_page;
-    grant_ref_t gref[1]; /* Variable length */
+    grant_ref_t gref[XEN_FLEX_ARRAY_DIM];
 };
 
 /*
diff --git a/xen/include/public/io/displif.h b/xen/include/public/io/displif.h
index 73d0cbdf15..4b9a27e960 100644
--- a/xen/include/public/io/displif.h
+++ b/xen/include/public/io/displif.h
@@ -537,7 +537,7 @@ struct xendispl_dbuf_create_req {
 
 struct xendispl_page_directory {
     grant_ref_t gref_dir_next_page;
-    grant_ref_t gref[1]; /* Variable length */
+    grant_ref_t gref[XEN_FLEX_ARRAY_DIM];
 };
 
 /*
diff --git a/xen/include/public/io/fsif.h b/xen/include/public/io/fsif.h
index ec57850233..0e1fba994a 100644
--- a/xen/include/public/io/fsif.h
+++ b/xen/include/public/io/fsif.h
@@ -40,7 +40,7 @@ struct fsif_read_request {
     int32_t pad;
     uint64_t len;
     uint64_t offset;
-    grant_ref_t grefs[1];  /* Variable length */
+    grant_ref_t grefs[XEN_FLEX_ARRAY_DIM];
 };
 
 struct fsif_write_request {
@@ -48,7 +48,7 @@ struct fsif_write_request {
     int32_t pad;
     uint64_t len;
     uint64_t offset;
-    grant_ref_t grefs[1];  /* Variable length */
+    grant_ref_t grefs[XEN_FLEX_ARRAY_DIM];
 };
 
 struct fsif_stat_request {
diff --git a/xen/include/public/io/pvcalls.h b/xen/include/public/io/pvcalls.h
index 230b0719e3..c8c7602470 100644
--- a/xen/include/public/io/pvcalls.h
+++ b/xen/include/public/io/pvcalls.h
@@ -30,7 +30,7 @@ struct pvcalls_data_intf {
     uint8_t pad2[52];
 
     RING_IDX ring_order;
-    grant_ref_t ref[];
+    grant_ref_t ref[XEN_FLEX_ARRAY_DIM];
 };
 DEFINE_XEN_FLEX_RING(pvcalls);
 
diff --git a/xen/include/public/io/ring.h b/xen/include/public/io/ring.h
index 0cae4367be..fa43396318 100644
--- a/xen/include/public/io/ring.h
+++ b/xen/include/public/io/ring.h
@@ -110,7 +110,7 @@ struct __name##_sring {                                                 \
         uint8_t pvt_pad[4];                                             \
     } pvt;                                                              \
     uint8_t __pad[44];                                                  \
-    union __name##_sring_entry ring[1]; /* variable-length */           \
+    union __name##_sring_entry ring[XEN_FLEX_ARRAY_DIM];                \
 };                                                                      \
                                                                         \
 /* "Front" end's private variables */                                   \
@@ -479,7 +479,7 @@ struct name##_data_intf {                                                     \
     uint8_t pad2[56];                                                         \
                                                                               \
     RING_IDX ring_order;                                                      \
-    grant_ref_t ref[];                                                        \
+    grant_ref_t ref[XEN_FLEX_ARRAY_DIM];                                      \
 };                                                                            \
 DEFINE_XEN_FLEX_RING(name)
 
diff --git a/xen/include/public/io/sndif.h b/xen/include/public/io/sndif.h
index 4234a47c87..32f1fde4d6 100644
--- a/xen/include/public/io/sndif.h
+++ b/xen/include/public/io/sndif.h
@@ -659,7 +659,7 @@ struct xensnd_open_req {
 
 struct xensnd_page_directory {
     grant_ref_t gref_dir_next_page;
-    grant_ref_t gref[1]; /* Variable length */
+    grant_ref_t gref[XEN_FLEX_ARRAY_DIM];
 };
 
 /*
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 13:57:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 13:57:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569715.890704 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOIXA-0008Mc-RX; Tue, 25 Jul 2023 13:57:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569715.890704; Tue, 25 Jul 2023 13:57:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOIXA-0008MV-O5; Tue, 25 Jul 2023 13:57:04 +0000
Received: by outflank-mailman (input) for mailman id 569715;
 Tue, 25 Jul 2023 13:57:04 +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
 <SRS0=n1im=DL=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qOIXA-0008Lz-14
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 13:57:04 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 214e52a4-2af3-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 15:57:02 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.160.93.75])
 by support.bugseng.com (Postfix) with ESMTPSA id 11B7B4EE0739;
 Tue, 25 Jul 2023 15:57:00 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 214e52a4-2af3-11ee-8613-37d641c3527e
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>
Subject: [XEN PATCH v3] device_tree: address violations of MISRA C:2012 Rules 8.2 and 8.3
Date: Tue, 25 Jul 2023 15:56:44 +0200
Message-Id: <982ad65413e08e8c10ef035cb8246ba7277ff01b.1690292999.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Give a name to unnamed parameters thus addressing violations of
MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
named parameters").
Keep consistency between parameter names and types used in function
declarations and the ones used in the corresponding function
definitions, thus addressing violations of MISRA C:2012 Rule 8.3
("All declarations of an object or function shall use the same names
and type qualifiers").

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
Changes in v3:
  - use parameter name 'dev' instead of 'device'.
---
Changes in v2:
  - improved consistency in parameter renaming.
---
 xen/common/device_tree.c      | 16 ++++++++--------
 xen/include/xen/device_tree.h | 20 ++++++++++----------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 0677193ab3..0522fdf976 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -85,11 +85,11 @@ struct dt_bus
     unsigned int (*get_flags)(const __be32 *addr);
 };
 
-void dt_get_range(const __be32 **cell, const struct dt_device_node *np,
+void dt_get_range(const __be32 **cellp, const struct dt_device_node *np,
                   u64 *address, u64 *size)
 {
-    *address = dt_next_cell(dt_n_addr_cells(np), cell);
-    *size = dt_next_cell(dt_n_size_cells(np), cell);
+    *address = dt_next_cell(dt_n_addr_cells(np), cellp);
+    *size = dt_next_cell(dt_n_size_cells(np), cellp);
 }
 
 void dt_set_cell(__be32 **cellp, int size, u64 val)
@@ -993,9 +993,9 @@ int dt_device_get_paddr(const struct dt_device_node *dev, unsigned int index,
 }
 
 int dt_for_each_range(const struct dt_device_node *dev,
-                      int (*cb)(const struct dt_device_node *,
+                      int (*cb)(const struct dt_device_node *dev,
                                 uint64_t addr, uint64_t length,
-                                void *),
+                                void *data),
                       void *data)
 {
     const struct dt_device_node *parent = NULL;
@@ -1197,9 +1197,9 @@ unsigned int dt_number_of_address(const struct dt_device_node *dev)
 }
 
 int dt_for_each_irq_map(const struct dt_device_node *dev,
-                        int (*cb)(const struct dt_device_node *,
-                                  const struct dt_irq *,
-                                  void *),
+                        int (*cb)(const struct dt_device_node *dev,
+                                  const struct dt_irq *dt_irq,
+                                  void *data),
                         void *data)
 {
     const struct dt_device_node *ipar, *tnode, *old = NULL;
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index c2eada7489..1d79e23b28 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -538,7 +538,7 @@ bool_t dt_machine_is_compatible(const char *compat);
  * Returns a node pointer with refcount incremented, use
  * of_node_put() on it when done.
  */
-struct dt_device_node *dt_find_node_by_name(struct dt_device_node *node,
+struct dt_device_node *dt_find_node_by_name(struct dt_device_node *from,
                                             const char *name);
 
 /**
@@ -622,12 +622,12 @@ unsigned int dt_number_of_irq(const struct dt_device_node *device);
 
 /**
  * dt_number_of_address - Get the number of addresses for a device
- * @device: the device whose number of address is to be retrieved
+ * @dev: the device whose number of address is to be retrieved
  *
  * Return the number of address for this device or 0 if there is no
  * address or an error occurred.
  */
-unsigned int dt_number_of_address(const struct dt_device_node *device);
+unsigned int dt_number_of_address(const struct dt_device_node *dev);
 
 /**
  * dt_device_get_irq - Resolve an interrupt for a device
@@ -639,7 +639,7 @@ unsigned int dt_number_of_address(const struct dt_device_node *device);
  * device-tree node. It's the high level pendant to dt_device_get_raw_irq().
  */
 int dt_device_get_irq(const struct dt_device_node *device, unsigned int index,
-                      struct dt_irq *irq);
+                      struct dt_irq *out_irq);
 
 /**
  * dt_device_get_raw_irq - Resolve an interrupt for a device without translation
@@ -652,7 +652,7 @@ int dt_device_get_irq(const struct dt_device_node *device, unsigned int index,
  */
 int dt_device_get_raw_irq(const struct dt_device_node *device,
                           unsigned int index,
-                          struct dt_raw_irq *irq);
+                          struct dt_raw_irq *out_irq);
 
 /**
  * dt_irq_translate - Translate an irq
@@ -668,9 +668,9 @@ int dt_irq_translate(const struct dt_raw_irq *raw, struct dt_irq *out_irq);
  * @data: Caller data passed to callback
  */
 int dt_for_each_irq_map(const struct dt_device_node *dev,
-                        int (*cb)(const struct dt_device_node *,
-                                  const struct dt_irq *,
-                                  void *),
+                        int (*cb)(const struct dt_device_node *dev,
+                                  const struct dt_irq *dt_irq,
+                                  void *data),
                         void *data);
 
 /**
@@ -680,9 +680,9 @@ int dt_for_each_irq_map(const struct dt_device_node *dev,
  * @data: Caller data passed to callback
  */
 int dt_for_each_range(const struct dt_device_node *dev,
-                      int (*cb)(const struct dt_device_node *,
+                      int (*cb)(const struct dt_device_node *dev,
                                 uint64_t addr, uint64_t length,
-                                void *),
+                                void *data),
                       void *data);
 
 /**
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 14:28:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 14:28:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569729.890715 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJ11-0003ar-Af; Tue, 25 Jul 2023 14:27:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569729.890715; Tue, 25 Jul 2023 14:27:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJ11-0003ak-7x; Tue, 25 Jul 2023 14:27:55 +0000
Received: by outflank-mailman (input) for mailman id 569729;
 Tue, 25 Jul 2023 14:27:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qOJ10-0003ad-2V
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 14:27:54 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qOJ0y-0003dY-Tc; Tue, 25 Jul 2023 14:27:52 +0000
Received: from 54-240-197-230.amazon.com ([54.240.197.230]
 helo=[192.168.17.43]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qOJ0y-0006S0-M4; Tue, 25 Jul 2023 14:27:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=RzJckpnz3evDMZSeIJfRFcPgovOnF5f1qG9MwpUxOAY=; b=mwRDQslIW1A7T8AWpp87T8kYzI
	tbAqiGYlnDTRidWuv2JPcQ/whirlxEMAGU+YSXhiG/W+M8DPNiEZNBMKkxIRhmv2WS0SgNOYVzYvP
	la3KL7pF2s5dzImS485J0LB10Piw8aVf91GZCZcrtCm4UhEJOgIvIHllupUJ+P5NNKDI=;
Message-ID: <dc76516e-2334-798a-216e-5ad983fea2f9@xen.org>
Date: Tue, 25 Jul 2023 15:27:50 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH 6/8] mm/pdx: Standardize region validation wrt pdx
 compression
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-7-alejandro.vallejo@cloud.com>
 <1eb58b83-87ee-d738-08b0-948a8b48773a@xen.org>
 <64be6c1c.7b0a0220.49ba9.0e38@mx.google.com>
 <79ecab0a-cb91-cc95-fd31-c76ec287fa9b@xen.org>
 <0d28d9cd-8cb3-6d03-94d3-e07a4dab9e95@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <0d28d9cd-8cb3-6d03-94d3-e07a4dab9e95@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 25/07/2023 07:51, Jan Beulich wrote:
> On 24.07.2023 20:20, Julien Grall wrote:
>> On 24/07/2023 13:18, Alejandro Vallejo wrote:
>>> On Fri, Jul 21, 2023 at 06:05:51PM +0100, Julien Grall wrote:
>>>> Hi Alejandro,
>>>>
>>>> On 17/07/2023 17:03, Alejandro Vallejo wrote:
>>>>> +bool pdx_is_region_compressible(unsigned long smfn, unsigned long emfn)
>>>>
>>>> For newer interface, I would rather prefer if we use start + size. It is
>>>> easier to reason (you don't have to wonder whether 'emfn' is inclusive or
>>>> not) and avoid issue in the case you are trying to handle a region right at
>>>> the end of the address space as emfn would be 0 in the non-inclusive case
>>>> (not much a concern for MFNs as the last one should be invalid, but it makes
>>>> harder to reason).
>>> I could agree on this, but every single caller is based on (smfn, emfn),
>>> so it needlessly forces every caller to perform conversions where the
>>> callee can do it just once.
>>
>> That's indeed one way to see it. The problem is that...
>>
>>> That said, I think your point makes sense and
>>> it ought to be done. Probably as as part of a bigger refactor where
>>> (smfn, emfn)-based functions are turned into (base, len) variants.
>>
>> ... clean-up tends to be put in the back-burner and we just continue to
>> add new use. This makes the task to remove every use a lot more
>> difficult. So there is a point when one has to say no more.
>>
>> Therefore, I would strongly prefer if each callers are doing the
>> computation. The rest can be removed leisurely.
>>
>> Let see what the opinion of the other maintainers.
> 
> I think [a,b] ranges are fine to pass, and may even be preferable over
> passing a size. I'm specifically using that term that you also used:
> "size" (or "length") is ambiguous when talking about page granular
> items - is it in bytes or number of pages?

I was referring to the number of pages. I don't think it make sense to 
have it in bytes given the start is a frame.

> Especially in the former
> case calculations at the call sites would be quite a bit more cumbersome.
> I could agree with (mfn,nr) tuples

Ok. So your objection of my proposal is just about the name, right? If 
so, I didn't put too much thought behind the naming when I sent my 
original e-mail. I am open to any.

, but as said I think inclusive
> ranges are also fine to use (and would be less of a problem at the call
> sites here, afaics).

The problem with range is that it can lead to confusion on whether the 
end is inclusive or exclusive. We had one bug recently in the Arm PCI 
code because of that.

So I would like to get rid of any use of range in new functions.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 14:30:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 14:30:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569732.890725 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJ3H-0004zT-N8; Tue, 25 Jul 2023 14:30:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569732.890725; Tue, 25 Jul 2023 14:30:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJ3H-0004zM-J2; Tue, 25 Jul 2023 14:30:15 +0000
Received: by outflank-mailman (input) for mailman id 569732;
 Tue, 25 Jul 2023 14:30:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qOJ3F-0004z0-Ib
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 14:30:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qOJ3B-0003hY-Ur; Tue, 25 Jul 2023 14:30:09 +0000
Received: from 54-240-197-230.amazon.com ([54.240.197.230]
 helo=[192.168.17.43]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qOJ3B-0006U8-Or; Tue, 25 Jul 2023 14:30:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=4Vs3l1QEosKolhDvdmkMRtOXHwMJdKxdH7fCelID/dU=; b=dLBc7BQHWLPrpljfhGJcinwVJ1
	KD83OPX3pHZAQf9mRPqfZkhOUALhXUGR5p6CS8LgejIQCAgr7OaGU5dSpi9hNZUHIuYUIfx5+Et4a
	lu9iBxpRPABm/Y81HLL/cK4oOO6rRyH6FD3I5vCfT6ZxPaqvy2Ru3B4qL8Og4QgyC7Yw=;
Message-ID: <6f263328-0fdb-8a8d-69b4-1d05ec742cef@xen.org>
Date: Tue, 25 Jul 2023 15:30:07 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH] xen/arm: Move TEE mediators in a kconfig submenu
Content-Language: en-US
To: Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Jan Beulich <jbeulich@suse.com>
Cc: Jens Wiklander <jens.wiklander@linaro.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <a44f74559f52d1fa90a3f77390e7d121c9cd848e.1689926422.git.bertrand.marquis@arm.com>
 <cb7b53bc-2440-8619-61ce-39c967b56eb7@suse.com>
 <DFD07AA0-E7E2-400B-8961-A646E5531DF7@arm.com>
 <6b24847c-5cd2-877a-bc72-16bb732e0ca2@suse.com>
 <C63A942A-AC5D-46CD-81B3-50B6376860E7@arm.com>
 <47ab1431-6a0b-6e74-92ec-8495c6bf8fbd@suse.com>
 <8ABBDFFB-AE3C-4A8F-8AAA-F0C5EB99C2C3@arm.com>
 <fc1bffbe-c5ce-ba05-ad01-22bb1ff983b7@suse.com>
 <60BC1EAE-ACE2-4D28-9323-51E03D405B35@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <60BC1EAE-ACE2-4D28-9323-51E03D405B35@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 21/07/2023 15:34, Bertrand Marquis wrote:
>> On 21 Jul 2023, at 16:24, Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 21.07.2023 16:07, Bertrand Marquis wrote:
>>>> On 21 Jul 2023, at 15:08, Jan Beulich <jbeulich@suse.com> wrote:
>>>> On 21.07.2023 14:27, Bertrand Marquis wrote:
>>>>> So what should i keep or remove here ?
>>>>
>>>> My understanding so far was that "visibility" merely hides all prompts
>>>> underneath (but then I use the command line version of the tool, not
>>>> menuconfig), so it largely is shorthand for adding "if" to all enclosed
>>>> prompts. Therefore I think all the "if UNSUPPORTED" are redundant and
>>>> could be dropped. But then I'm also working from the understanding that
>>>> "depends on" would behave somewhat differently ...
>>>
>>> If that is ok with you I would rather keep them so that making one of them
>>> SUPPORTED one day will not end up in wrongly making the other one
>>> supported to. The visible if i added was more to "beautify" a bit when
>>> unsupported is not selected so that we do not have an empty menu.
>>
>> You're the maintainer, so you judge what is best. If I was maintainer, the
>> primary thing I would ask for is that there be no redundancy. IOW here
>> either no "if"s or no "visibility".
> 
> In this case i do think that the "if UNSUPPORTED" per entry is important
> so that it clear per config entry which ones are unsupported.
> 
> So if other arm maintainers agree with your point, i would remove the
> "visibility" and keep an empty menu.
> But my vote is to keep both.
> 
> @julien and Stefano: Any view on that ?

I agree with keeping both.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 14:34:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 14:34:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569735.890734 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJ7l-0005a6-7K; Tue, 25 Jul 2023 14:34:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569735.890734; Tue, 25 Jul 2023 14:34:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJ7l-0005Zz-4e; Tue, 25 Jul 2023 14:34:53 +0000
Received: by outflank-mailman (input) for mailman id 569735;
 Tue, 25 Jul 2023 14:34:52 +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 <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOJ7k-0005Zs-68
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 14:34:52 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on20618.outbound.protection.outlook.com
 [2a01:111:f400:fe13::618])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 68fec8a1-2af8-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 16:34:49 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS4PR04MB9268.eurprd04.prod.outlook.com (2603:10a6:20b:4e3::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 14:34:48 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 14:34:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 68fec8a1-2af8-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=GmlhtxogpAw2ROvQ3YCBUNAp84P70j99XnTeVpRT7Z26Sa0XNnevRh7FpardI1FhVThW6SUZPA7bcI2qUXSXCm9mMPCE81Win5bHnv6Ej2biJ/Zr8X33CwUg64DsmziXUmYXL2yoY+Ooi7KWhcF0Ifapt8n1BBYN2qCY6fLiwlgTx4UrI4Mmxe72epKAAwuo7xODNMoUQVo5yqsFGn+hcdoOeS1KE84DjMbaP/rkNvEOhGfMfrWshoi1v5xZ5m07GfwECo8C8KQctjkeawo1CVyYkMJpnvhEYAnUhgPvXqWTAvPX1ALbC929TVPhFA3iEQJbQw6gyKrd5xw3o3YxUw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=2Z+R0u3M+pfsqdCUJfT0yTLEC8qgayggXAilMH2IVvg=;
 b=cvDP/K7WSX7ZUvgjB/2ou7qSU/uLgtOz8+ZYekw916sBBBBS0e3EI5BBdTnYpLvMwM225wYCQwJumNo0jUeJa2h73vAFUCrBYkEwlQdLxYda+vLXnJ+lgAedhWj1+okdp+8zYL78MVB77SZwUe2+IeeW5ZknVk+xa7wc/P8Z1YdcAmxNVnXBVaGchlUaFzQCHwYYNlWQBR0oxvseXdoWgWu06weTt0AonsWYs0Cvp2AeIuTpEkYJMhGK7xUx6SEu+8bD8Tt/JisyEjWwH5jCPG2HJOUXOshhp4k+qfxeN4Vt/Cm2hgVfxxnf/ba7Jiie/fl3anRbdxu7e5dPAbDK/g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=2Z+R0u3M+pfsqdCUJfT0yTLEC8qgayggXAilMH2IVvg=;
 b=rtZTWJAviCrRZ+vpZdz/1TcIvMmr5IeiERT95qC3uOfPllCJeaijvqyamjda3fBu3cTk1YMKkMxGmt0JLTxy9s9BTTzLm3faLDnqwADu3RfSQgZJuXM5McQlfARPcTcy/+BsqE7Q8GiLmH0a80/i++KycDAd7G0URPemJ3jGIJwz88sICMln3bDcB6RfiiA7ZmDq2fHTGAZwItGE9wlGLJJAALNU2//PZAqs1xc9yNeKVbb6ykNVTJhlm5HMs0VgO/M+uXbmpeutVlRw/rTLZKc3Ypm6dO9hJI7uiIA0Y19ofIlmJaFiYSy0V8fucw8//d+D4rm73KmwCLVjSqaAjQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <58b1901c-f5ee-8617-a5f8-0666c4ef51e6@suse.com>
Date: Tue, 25 Jul 2023 16:34:42 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 6/8] mm/pdx: Standardize region validation wrt pdx
 compression
Content-Language: en-US
To: Julien Grall <julien@xen.org>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-7-alejandro.vallejo@cloud.com>
 <1eb58b83-87ee-d738-08b0-948a8b48773a@xen.org>
 <64be6c1c.7b0a0220.49ba9.0e38@mx.google.com>
 <79ecab0a-cb91-cc95-fd31-c76ec287fa9b@xen.org>
 <0d28d9cd-8cb3-6d03-94d3-e07a4dab9e95@suse.com>
 <dc76516e-2334-798a-216e-5ad983fea2f9@xen.org>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <dc76516e-2334-798a-216e-5ad983fea2f9@xen.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0048.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:92::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS4PR04MB9268:EE_
X-MS-Office365-Filtering-Correlation-Id: 221928d2-b146-488d-8ca1-08db8d1c4c0a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	0U/Rb0aBAL8Q+LayBWjweqckxeYqASYmOdtKQPmrxyPY9uy/ccGjD4VleKpL2+EPwfUEUEBpE2YTbcGWYFI3It+iOeIuszTnKMyWRW4yHm+DTdYzXxK4rH/EQq2g6c5sE7A1nbbQUi76fiMExExs0vdFloNpUPUfRdXljWGWvJwIj0kmTvAsRfI+Y5v7cGQ6SSn48/W/cMDkL3kyYMhoYAjEz5cnYwCKNSLZw0Ycu/YzbyN4SWPmKphLDelaVIxaA+tBoRRpdM7TvIot2RisIH05Kw+ZXxw6Xe/HW+x/6qIF3lQ3ZTlfcd0bwHttw11g3uRiPzkFOBXLT65OUDh1/GMivscs6iBggw9fSOVBM8eRxu/mKAf7ft6Oq0rkK65Vi+s6Im1Ue6hs8P84VF7OizzsCEklyaO0WebcLQ0PHb9vh0cX5F8S30mE/UzSTJlkmHGXj1NIU6rTeH5Eck0Dtz3PacxrbtL8/mlN9XNcik6OAZpZB9sXEpP5CU7BgLmdQqHAXq3n6RLnzvye0zE4YReJZIHQZ034TNtlIyISdMWAgxqckuYBA5xzdFrdkpjMlnRl+CiMIAmP3szBjq8Yzj9goGIznHds1J7Dzkv/w9WCRL17iqMeQIR3FzVEw0scxC+Ma157NmcGO8nph7IBDg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(136003)(346002)(366004)(376002)(451199021)(31686004)(36756003)(31696002)(86362001)(2906002)(186003)(83380400001)(53546011)(6506007)(26005)(6512007)(6666004)(6486002)(38100700002)(54906003)(478600001)(8936002)(66556008)(8676002)(4326008)(66476007)(2616005)(316002)(6916009)(5660300002)(66946007)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZHB0QlM4dnVLQ0RiM2orb0xGNkhHYVEyeE1oSjdXTkJ4T1BhZloxUFFucXpY?=
 =?utf-8?B?QVp4MXZndk9CVDU4MEJ1SG51OWVrd3g3bEloUi9vRVdTdklEME9zZVlMemFU?=
 =?utf-8?B?bGsrNEIyd29HWVBsSlIrcUVMOXQwT3Z5b3R4cCtIRjFiamgzY1ZkMy83eUVt?=
 =?utf-8?B?cXJjU2N0UVFvSERDNVIzUUNGNDlZbFkzdGlJbCt0aGk0enR4VHMvNjdhL2hG?=
 =?utf-8?B?NnZCSmN1dnB3ZkYySjlmaU9FZEUyRlQzVHB3MXpOcGY0THk3NVo1Q1d4OVRY?=
 =?utf-8?B?QUpzMiswTG13Zko2b0ZudGQ1T2VlcDZnQU5BMmhWa3JTQ0N5bFdIR2s0enMw?=
 =?utf-8?B?blhaZjNjYUhNNzhibUZEYmlLTFZxYzB1T2JyRHdzeTB1dEdhc0ZUZE9UUHgz?=
 =?utf-8?B?c0YrL0tKdmpSMlQxWko1RU53Zm5MRXovR2F0TXd3K09vZUNyRXV3c3RHZTkw?=
 =?utf-8?B?MUpLMDZYODMySHpBMWI1dHlVU2xFSXlZcEVkdTBDWXVldUdSNUZhREdVREo0?=
 =?utf-8?B?L3ZXRDFkSFFGM1FlUGh4WUpKWkNXSWg3TWhYTjBIWHFxT0JxRWJPbU5iS2Ev?=
 =?utf-8?B?c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aHU1Ym5YZDF5MmFE?=
 =?utf-8?B?K0pQM0N5WmlvMWRxMFQ1UTQ4WldpWDFGUkFyWGdNOG9aRkdxLzkvYU5DaUpw?=
 =?utf-8?B?T0JDTWNmWDVqVktKUnMvYUl3cnNuNWx0OUZRSDhJc0YrRTFVZmp2K3ErRkJ5?=
 =?utf-8?B?L1Mrb1BoN2tuYVdWWmQrYTZ6Q2NCRGxLMjNzbTJURW9jMWxtWGRCZ3E5d1FQ?=
 =?utf-8?B?OEFHNXNyeTF4WEZ4emhKMXZrRy9zZ1M4RHVibExWZ1k3eFVJK2VHTnRRWXRB?=
 =?utf-8?B?N2djeUVJRU5SYjVFM2xjMUdLb0xNVmZMRkdwdGdQSUNIaHNkUm5hVFRVOXdt?=
 =?utf-8?B?Vk9lTFBaTHgxZWo2aXFJY1YwNmVOVzJXZWFBYzl5bXBjUEphT3d6c2JhNjJL?=
 =?utf-8?B?b3JLeGRCUVFEdXd5ZHdOcTU4SUxFbEttTVhHaTJyZm5CeHM4ZnVYQzcwZDYv?=
 =?utf-8?B?eHVxdndWSEFnZDdoSkdydVVoY1RCZ2N5bEQ2S3Z3R1c4dEFpazRPVGhNeEFr?=
 =?utf-8?B?MFRQeG9hN1FrM3RJS2J0bVdJQkkyekMwWFZuMlFJVVpiakpkUkhLODFpcTgz?=
 =?utf-8?B?MTFMeDVDSG9sdmlveFRqd1M5dWJYNDFYQ0d3ZWQyb0Z3Z0FJYitobjYyOHlu?=
 =?utf-8?Q?COdCcUF9UyTze/ggPQ2OSt515?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 221928d2-b146-488d-8ca1-08db8d1c4c0a
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 14:34:47.9177
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: mYOmad0YKucVi43d4O6EcgkBxXo//b7J7CbWORYkTMLe8/mkvJp4kcyiHzLGWI30Mp9A8hyELj+xksHA2zuubg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9268

On 25.07.2023 16:27, Julien Grall wrote:
> Hi,
> 
> On 25/07/2023 07:51, Jan Beulich wrote:
>> On 24.07.2023 20:20, Julien Grall wrote:
>>> On 24/07/2023 13:18, Alejandro Vallejo wrote:
>>>> On Fri, Jul 21, 2023 at 06:05:51PM +0100, Julien Grall wrote:
>>>>> Hi Alejandro,
>>>>>
>>>>> On 17/07/2023 17:03, Alejandro Vallejo wrote:
>>>>>> +bool pdx_is_region_compressible(unsigned long smfn, unsigned long emfn)
>>>>>
>>>>> For newer interface, I would rather prefer if we use start + size. It is
>>>>> easier to reason (you don't have to wonder whether 'emfn' is inclusive or
>>>>> not) and avoid issue in the case you are trying to handle a region right at
>>>>> the end of the address space as emfn would be 0 in the non-inclusive case
>>>>> (not much a concern for MFNs as the last one should be invalid, but it makes
>>>>> harder to reason).
>>>> I could agree on this, but every single caller is based on (smfn, emfn),
>>>> so it needlessly forces every caller to perform conversions where the
>>>> callee can do it just once.
>>>
>>> That's indeed one way to see it. The problem is that...
>>>
>>>> That said, I think your point makes sense and
>>>> it ought to be done. Probably as as part of a bigger refactor where
>>>> (smfn, emfn)-based functions are turned into (base, len) variants.
>>>
>>> ... clean-up tends to be put in the back-burner and we just continue to
>>> add new use. This makes the task to remove every use a lot more
>>> difficult. So there is a point when one has to say no more.
>>>
>>> Therefore, I would strongly prefer if each callers are doing the
>>> computation. The rest can be removed leisurely.
>>>
>>> Let see what the opinion of the other maintainers.
>>
>> I think [a,b] ranges are fine to pass, and may even be preferable over
>> passing a size. I'm specifically using that term that you also used:
>> "size" (or "length") is ambiguous when talking about page granular
>> items - is it in bytes or number of pages?
> 
> I was referring to the number of pages. I don't think it make sense to 
> have it in bytes given the start is a frame.
> 
>> Especially in the former
>> case calculations at the call sites would be quite a bit more cumbersome.
>> I could agree with (mfn,nr) tuples
> 
> Ok. So your objection of my proposal is just about the name, right? If 
> so, I didn't put too much thought behind the naming when I sent my 
> original e-mail. I am open to any.

Something like "nr" would be fine with me, for example.

> , but as said I think inclusive
>> ranges are also fine to use (and would be less of a problem at the call
>> sites here, afaics).
> 
> The problem with range is that it can lead to confusion on whether the 
> end is inclusive or exclusive. We had one bug recently in the Arm PCI 
> code because of that.

It's a matter of properly writing it down, I would say.

> So I would like to get rid of any use of range in new functions.

Hmm, seems to need further input from other maintainers / committers
then.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 14:37:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 14:37:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569738.890745 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJAU-0006BS-Mb; Tue, 25 Jul 2023 14:37:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569738.890745; Tue, 25 Jul 2023 14:37:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJAU-0006BL-IQ; Tue, 25 Jul 2023 14:37:42 +0000
Received: by outflank-mailman (input) for mailman id 569738;
 Tue, 25 Jul 2023 14:37:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOJAT-0006BF-Ve
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 14:37:41 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20615.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::615])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cef58edd-2af8-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 16:37:41 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VE1PR04MB7293.eurprd04.prod.outlook.com (2603:10a6:800:1a8::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 14:37:37 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 14:37:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cef58edd-2af8-11ee-b23f-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=F2bP0Fjt/8fOdptKzADti/3jypXtci+A2YMjK3r6e+x7hBjxH0NQ9U55PbVtinqKcxQFuhr9mGbib7rjsum0KnM1CJ6HlpjU0zA56XwiMczEofujtuTsjumzro3MVaaLYqwagNvEo0Gyvmmmd2iK5P11GfqIg6fHA+VmV3SgFoZ+oY3sPc10c6+WXKjJKwsR+poe2Mt9ZP9bzTvyuVrh7tRd7KOXJygdF5Tok4cqiVVgZA7cu3y6GmYzGNtDucLZ6WCHJPx9RpZ/ziJxw6qcW8zPv9XuAHd+qXbKFYMr6eBSxqWkFXk2t7uavtwfpPUW9qAm3sBPrgiYSKDpP9pONw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=e0H5zcfSPg6NMySGaHQY8YOf1VikXtEJGncfYPRtJN4=;
 b=c3jkQNOkl7nKzuME7jQ30mK+NeQPjZHRTjOS6LwBK7TUrunrEy0c5skrSXfkVUWzq2RgCg760t9CmkuSggNa0OV3EMcyOhMd+7qHixaY6kVOhiM2jczEXt2LjKwQ5ZbyaIx657ZLENGYvnsjbLh6Mvrx2POL4tO3XvQ8486VLCjPSkZryr0dR1v8dnhpsMnJl/NLk6ewcnO3xVtyBApFcQP+FnqpOYl6eezZXsRYMTwGsteErstBxnUp7kKsUmxBex4MGcy0tPc62hfdVWI4bm/UJ+6xlpQW3viId1Ske7d7GIZsC3ZiLoBJm4CfeGn9cIIDhnSaZ1ftVNvG5gNxWg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=e0H5zcfSPg6NMySGaHQY8YOf1VikXtEJGncfYPRtJN4=;
 b=yLrsXNFzA0xSdTsAXnnriG9WPV2sf5F7GYffHaxivsORyML3wlR4hKTTPV20NbO0l3qhu/1f//mxTc28TDo7ppaHoD2KZk6+PCPfll8dAP6ayfGsju8aBMSjicDJQ9M3K+M747cQG7xZekdIBixyb2Uu7mQsbBbpSxQegenceGvkocBaPZvdFcsg+EAqJSgOGoHBQln9l+62qxKiI3Fb/PFV2R6gTPKVF9fsj8LkHz5CKJ47gBbjUzXsDwwaGUl8C/aqxpaSxGHk9rdu3LGb1ggRyoG1PGwDfjEyNkrCxo8Hz5vKoDInr1uWysak8ITFCr98g7bQ9S0KWp6EDYf0/w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3f43f36d-b661-ea65-e8de-d1c4fba34509@suse.com>
Date: Tue, 25 Jul 2023 16:37:35 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v6 06/15] cpufreq: Add Hardware P-State (HWP) driver
Content-Language: en-US
To: Jason Andryuk <jandryuk@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20230724125857.11133-1-jandryuk@gmail.com>
 <20230724125857.11133-7-jandryuk@gmail.com>
 <7636d3d2-c78d-711a-ed90-aedd1b464c6c@suse.com>
 <CAKf6xpt1LzKMv7E-G3sTpUWrEApy+BX8z7dG69oS1upHcpytMg@mail.gmail.com>
 <d3d8123e-2b81-d3e0-3883-83dcdaf99700@suse.com>
 <CAKf6xpsE_=XYWcC8Q6NhKkboMajnOKZAsfUpOROeGuhU+7CTdw@mail.gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <CAKf6xpsE_=XYWcC8Q6NhKkboMajnOKZAsfUpOROeGuhU+7CTdw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0024.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:14::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VE1PR04MB7293:EE_
X-MS-Office365-Filtering-Correlation-Id: 9e2f3685-1d83-4453-7bde-08db8d1cb14b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	F64SLqIwpZpA6D3FdInWOkh+4gGGiyseAIFnZkCH1Av+VjQlALIvCP3bAFEz4NilBLX2Il/xptsasEKl/+6tiifHho4aydbgDAPd0lUsJ5maw0md+AqYMSoCD/1cNwQEQGuCB/wK5bHwtYVImerX//8XAN6JsIeukcedtAh6H89f/E3zceFIHZn31ANxPXKw23Osilrp/tfdqII92+z12AhS3VrzJcMNcS1KJl5wrOWXXcR3Ilf3hXSy/sYzNu2aZ7J0cZas2HkB8UfRClI/NwvioDhfQcZ304asRHmw/OLcc0zVS43AG5joM3s7aSScQRqE3U9qgqQI21/L19aEDpEirRFMPlFrptgJR4tVG0A+pP6JHJzJc6IAlhpIdQw1ct1yO3Yge4Rlz431sPJWzo02mg9rWLCi0IAM3/RKVoqAAG6xXZIRWPKc/2pUqDYe7khQY0esEVkI4l3kgxHVb/WGbySG86L1dLZ6WThsagl9mB2jjmVH940x+lq8O1pw6wPjf9xPbAhTh7PrsXRX3Xifd95Haqjt1VuwKot/bnJpsMSDFCo1G5xLYIxk0+m/nPtHU86OBrbPZoYhPWT3TRLNpJQ/85R94NJUGheI04mKJoKClgS+T237NEhM3XGO1IMghJqrFwlGS1Dv59O66A==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(39860400002)(136003)(376002)(346002)(451199021)(54906003)(66946007)(66556008)(66476007)(6486002)(2616005)(36756003)(83380400001)(86362001)(31696002)(38100700002)(966005)(6512007)(53546011)(26005)(186003)(478600001)(6506007)(31686004)(316002)(41300700001)(5660300002)(66899021)(2906002)(4326008)(6916009)(8936002)(8676002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UGV5bW1BR1EyREFWUXQwdkRyanRNYkYyZDhzNnpqV1B0dEhpTDRldDd3MkQ5?=
 =?utf-8?B?dUk3YmhSUVg2UGFhWjhLRVYxdzRibzVyMTh4bmtiVHpIbDZETE1sKzlaek5L?=
 =?utf-8?B?ZnliN1U1aFNQZ0h4dGw3RzFUOUNYNU1rRDdZM2RlTXptUVU1aFYrcEplVE44?=
 =?utf-8?B?Q2cyMVNsTU4zYlZTcDdjTUZzSGFrSVBSeEsveVFBa0Y2T0I4b3IrTHlEdDdM?=
 =?utf-8?B?R0NQT2hzODJ3L0ZVd1ROMDFZMmtaT3ZlbndlK1h6MGN0T3VhbURjQXhmTzlT?=
 =?utf-8?B?Q2lrcjlQUkdqM1ZLdVc3bmh6dCs1SnkwWTBTaElUcTVzZ292WUNRTkwwbHB1?=
 =?utf-8?B?WGdJVXVvVkdiVVNRbitPc0NsSjNhY2laVlR0K2JIallTa1hxZDhGWEVaY3Ft?=
 =?utf-8?B?VnZjNEVIVTREd0tSUHJQMW5pRlVNTTFIWmNWamZxQVp6NGtkOUpuR3RDL3ZS?=
 =?utf-8?B?UVcvUlI4UUF2Q0NWdGdBR1RKelZldDJpSmFrVStVdTB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0Q5elgvTnFtY1ZhU2E4dWJLU0lhWUpXSlZRbEhIejhBaDZnS1Z0SVFmeExJ?=
 =?utf-8?B?R2VMWW5meGFuYnc5dExKVXRUcXBhQUdnQWsyS1RacWx5NjBVNVQ5Z01FT0dz?=
 =?utf-8?B?RmtveDI4OFFtVmZmVXlzcGdvVDdFUFplMXpJSHNvdVQwdHNRbGcxR0JXcnJO?=
 =?utf-8?B?S0pGMTBnUUlqc1E1OGV4YlpIRzVRV2hHOVJUUFBNS0lqVFV2WHk3bVVwR2ti?=
 =?utf-8?B?RGZNTkV1YlBLbGYySzJHZ3RDQ2lsTCtBU1QrM09RR2ttTWVOSDk4R2I0elE0?=
 =?utf-8?B?S0FOM1lKclZxWUFZV0lOUGo4YUNJSmc5VmlRd2xDem1mejdqcFZJd2tHU1ln?=
 =?utf-8?B?U2F0a3duWHF5dGRsN28ySHdSMzVvSERnaTZicHNtUzBGMFFsUENvNWRMc2Fp?=
 =?utf-8?B?UzQxM1ZJdjVLbU1HUUNYd1I5Qi96a1l5UFd1TEgvTmRxU3MzSEhweDhYZnM2?=
 =?utf-8?B?R29UVzNDeWdmdmRkZFpiL21zM0hNQ054T0xCV2Q3SmNkbVYrbU5Kby9iaHYr?=
 =?utf-8?B?NXBObWtDeUpoWXluZWE2RDNtYkVJREg4K1I0T0lUVitWZUpCV1U2ZVMyVU1F?=
 =?utf-8?B?NzhNSmpNb0daRjByQUdVYWorbHBJM3RBYVdVeFduT3ZOYUovS1FEWmgrWDMv?=
 =?utf-8?B?QU5vM1lZa29LZ1RlckxucG5ZN1luVFBKTVVrUG1JZHVvMVE0TXdBUkxpRTFJ?=
 =?utf-8?Q?VhgOfXTiLLz/8xGoNlOsPDy/Q?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9e2f3685-1d83-4453-7bde-08db8d1cb14b
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 14:37:37.7829
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 5CgK1362wY5wgnSe3gcajMlkKnf4zxnRZaNUwNmRhv6jKRnEOkXs6cn8V6d5D+snR/+OPUQtAWa5RtRIDlp+sA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7293

On 25.07.2023 15:26, Jason Andryuk wrote:
> On Tue, Jul 25, 2023 at 2:27â€¯AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 24.07.2023 21:49, Jason Andryuk wrote:
>>> On Mon, Jul 24, 2023 at 12:15â€¯PM Jan Beulich <jbeulich@suse.com> wrote:
>>>> On 24.07.2023 14:58, Jason Andryuk wrote:
>>>>> --- /dev/null
>>>>> +++ b/xen/arch/x86/acpi/cpufreq/hwp.c
>>>>> +#define hwp_err(cpu, fmt, ...) \
>>>>> +    printk(XENLOG_ERR "HWP: CPU%u error: " fmt, cpu, ##__VA_ARGS__)
>>>>> +#define hwp_info(fmt, ...)    printk(XENLOG_INFO "HWP: " fmt, ##__VA_ARGS__)
>>>>
>>>> I'm not convinced ", ##__VA_ARGS__" is a good construct to use. I notice
>>>> we have a few instances (mainly in code inherited from elsewhere), but I
>>>> think it ought to either be plain C99 style (without the ##) or purely
>>>> the gcc extension form (not using __VA_ARGS__).
>>>
>>> Using plain __VA_ARGS__ doesn't work for the cases without arguments:
>>> arch/x86/acpi/cpufreq/hwp.c:78:53: error: expected expression before â€˜)â€™ token
>>>    78 |         printk(XENLOG_DEBUG "HWP: " fmt, __VA_ARGS__);  \
>>>       |                                                     ^
>>> arch/x86/acpi/cpufreq/hwp.c:201:9: note: in expansion of macro â€˜hwp_verboseâ€™
>>>   201 |         hwp_verbose("disabled: No energy/performance
>>> preference available");
>>>       |         ^~~~~~~~~~~
>>
>> Of course.
>>
>>> I can use "__VA_OPT__(,) __VA_ARGS__" though.
>>
>> __VA_OPT__ is yet newer than C99, so this is an option only if all
>> compilers we continue to support actually know of this.
> 
> Right, sorry.
> 
>> We have no
>> uses of it in the codebase so far, which suggests you might best go
>> with the longstanding gcc extension here.
> 
> FTAOD, "##__VA_ARGS__" is the longstanding extension?

No. But you've apparently found it ...

>  It's the only
> one I've been able to get to compile.  I'm reading
> https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html and it
> mentions a few different extensions.
> 
> This part seemed promising:
> """
> This has been fixed in C++20, and GNU CPP also has a pair of
> extensions which deal with this problem.
> 
> First, in GNU CPP, and in C++ beginning in C++20, you are allowed to
> leave the variable argument out entirely:
> 
> eprintf ("success!\n")
>      â†’ fprintf(stderr, "success!\n", );
> """
> 
> However, it doesn't seem to actually work for me.  I still get an
> error like the one above for plain __VA_ARGS__.  That is for:
> 
>     #define hwp_err(cpu, fmt, args...) \
>         printk(XENLOG_ERR "HWP: CPU%u error: " fmt, cpu, args)

..., just that you're missing the ##:

    #define hwp_err(cpu, fmt, args...) \
        printk(XENLOG_ERR "HWP: CPU%u error: " fmt, cpu, ## args)

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 14:41:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 14:41:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569741.890754 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJEL-0007gL-9Z; Tue, 25 Jul 2023 14:41:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569741.890754; Tue, 25 Jul 2023 14:41:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJEL-0007gE-6y; Tue, 25 Jul 2023 14:41:41 +0000
Received: by outflank-mailman (input) for mailman id 569741;
 Tue, 25 Jul 2023 14:41:40 +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 <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOJEK-0007g6-3z
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 14:41:40 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20616.outbound.protection.outlook.com
 [2a01:111:f400:7d00::616])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5bc8052d-2af9-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 16:41:37 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by GVXPR04MB9904.eurprd04.prod.outlook.com (2603:10a6:150:119::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Tue, 25 Jul
 2023 14:41:33 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 14:41:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5bc8052d-2af9-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=mLXB+vOFOxSjtCmvfF+kzlyBaKOQX8fr0Lv3cyLCuldBKMtaUyku1Gwl4c6dvNl2bfczEi7JMXLrtYt1ygGN66glj3IoHhr1a4ugW/Dd6YUJHP/X50Cwtdxdi6ks8aonPS9WyjrpS0GuUcXyEkpj+HeC8gxRBpBYI9Z4ZMYs+7POtVHj+eMAgcRcg0LfNuQg/Qt4GTT2RklT6ks4c1I5XscOHlpq1vxK7wae392roVZoTOlRgfsje9AWkxEQMNssjCBHxQPox3k/WRqlpgZKcncDed3prRaOKkgFpThisMs5PpugeQQQodZQRjM8E3v6dP/6bZaLCyPy9PMkuIW4QA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/fCKgd6sLYBCLQCXDyjAJHBrOzBlbkU4oitvYVu7UgE=;
 b=Yo7uN+u+9ztZy1Vykf3Iv28ufvHjfJqJKM/T+q582iYP2Pdgv8wuiDJu4yiVNMgdXGJqHCXQLp78liz+HSFDP7aXJawhKJkgMvnShmx7jnqTIPjRgBWEC7KEHF0kQb6l7wXTLEcsu96Rx5iOE4J0UcnYu3Jt+KMv/mxmlMZIPvz+NA+4xfuii8iPrjZa87l9FavG/mpdxSTTUw/uL4rF3/2ymgMXUy9hgGaE4rPjGFggxwQXlm4//kJ10iTIjtPcI9/7PKPcG6K+8lnax0bLF3bmqv+GDUcF1OvFhimizpV4E6FMSiGFxIET97LAxvhqmJZUdUKMi8JWioozF1qvrA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/fCKgd6sLYBCLQCXDyjAJHBrOzBlbkU4oitvYVu7UgE=;
 b=468j5D92J/Rj2JAccocy3NU1DKFYhj4jYgRNDV1RYordtIdL43w2BUJLw3PJOVKng6K6oT1KcAKQK81GBdCKdT7FC0OVu8uxOlnUGYhlGHKATuQGtXSixDwmxM0bRMR+15l0I0upjD/ALLOvRoQ3AtE0jzgx3SQ0uxWUVWTZg/GZ/GOKdSOuhP8FZewbENU8hdW0bK1VR/FhEO4ZSRCDhDMFiwr0AaIhVnezWQP4ytgWWSxUNlLpu4IX6RpJIX/HGmgXUs7yMoORpvvi72alFyUDEXV4LSImsVqsNyVZ57Rdr5/YyOXoosDGkWkjogC0AdGa2B/cnEcHLVInjFcHrg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <50ae6411-704c-60fa-e61b-0800f3a346c4@suse.com>
Date: Tue, 25 Jul 2023 16:41:30 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 2/5] x86/ioapic: RTE modifications must use
 ioapic_write_entry
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230718124334.36548-1-roger.pau@citrix.com>
 <20230718124334.36548-3-roger.pau@citrix.com>
 <1bc67bb2-9b01-eb18-eb6a-741067a9b35c@suse.com>
 <ZL_Oh6S8mbNan-s-@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZL_Oh6S8mbNan-s-@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0040.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:48::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|GVXPR04MB9904:EE_
X-MS-Office365-Filtering-Correlation-Id: 5705a109-0693-4161-3637-08db8d1d3d4b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	GKbNNLsYK7No1f/50uuAqXrvb7A4K/nOvKNnRpUuryjco5jjlvYO1e70QuEUMFxIABe7RcxYes2K8Wz/+81x+OeHVSfkJYqEJD+W1P8SzicnYE1ShjskQ8nRsE2YH8aNrHnNEFPfyX/FeKhMmq4cY0UTMkz5llRqVjN2Jtsg8rvs/A4d2H22nR5dp+A6Nu6LR6KYKIK04Q1N1yYjdiZK+xSR9Y2JVDXIaJ1qKXvV3BC6ksiaR4LO2knnBPbuOoQYA+7STInCDNeJSa/UmjftKrSyfIRIrGnmQPyGenVSgK6Qu/DtUtWB25FzFJ31AV5e+aKqWblcTNWnE1oWRwZ9rr5WNNSIe87mTwrTtbcu+2NRh04QF01zVRzG8WNRkVpYMWop9v43298aOPnHL5CDVFnRXdSNDWb1nOOdeQhZrcoywQnzyTu/4yA/GverhBWlxN3bQDF3qVaox2quIBUMehKY49VWnamoQW+syzmQSAmvnsGr051nODk5Q/ltf/G9R8LnpFIzeqy2gGrCBqz1FGYsB426c24uzBkvKKJb0LuT+KdepI+4b5SxXdrwRJhAUkTUZ6gO13YbqUF4nRfSUP1zr1qbpiZwo6wjgh7W9UeFBYW/2qZe2azwHtLPcMUblwCslF7r2dt6kd2anxYghA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(396003)(39860400002)(136003)(346002)(451199021)(6512007)(6486002)(54906003)(478600001)(186003)(53546011)(2616005)(6506007)(26005)(2906002)(41300700001)(66556008)(66946007)(5660300002)(8936002)(8676002)(4326008)(66476007)(6916009)(316002)(38100700002)(36756003)(86362001)(31696002)(83380400001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dXdwQ1BoNUZsTXh1d0pkcW1xbXF5dWhUNjhJNEdndDQ0VUJEdzRZUlYyM2N6?=
 =?utf-8?B?Mmsrd01NTzFySCtWTTFxejZKcnZmSDl0dHRiRnVjWHMwM0d1VXd6R3lORktz?=
 =?utf-8?B?S0dIY2F5WXkyOUNOQjJiMjhlMzg5RUFBcXRVZWtXUWY0WHh3UjIvR243ZVFs?=
 =?utf-8?B?ZUxWcWZUMWp5amh2bWFqbGppSDloWjBWbjRGOWZ5MjdLaTMxb1pxY2tZYkFp?=
 =?utf-8?B?YnVzSnBTSTBOdzFxeHJ4cUJhWDZmMkJLVENzeUdlREVXOEQvT1VkbU1xYitT?=
 =?utf-8?B?TDF3czFZNU5qUkQ5ZVpKelVuWU4wdGd2TlZ0VEFtZElWRHpsVkhyL3hrRWR3?=
 =?utf-8?B?eHlWSjloR3NwVkxCbm00aGRqY1doaDlkQjN1MHp4M1YzNDhabHFTY09DSjdT?=
 =?utf-8?B?SW80K2d3bzZGcWNqMFNPUGFkUm00UlR2ZkN4MnM5ejlhQkZMSE85Z20xbWN1?=
 =?utf-8?B?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PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 14:41:32.6364
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: uobWFCQyYFwXuhptsvQLhCttRrdVTv0U8/3IFYhQhG8urFguAHKhfmpgrZlxZKZueabHSZOeUN9oPn8MhUiQ/w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9904

On 25.07.2023 15:30, Roger Pau MonnÃ© wrote:
> On Tue, Jul 18, 2023 at 05:40:18PM +0200, Jan Beulich wrote:
>> On 18.07.2023 14:43, Roger Pau Monne wrote:
>>> --- a/xen/arch/x86/io_apic.c
>>> +++ b/xen/arch/x86/io_apic.c
>>> @@ -584,16 +585,16 @@ set_ioapic_affinity_irq(struct irq_desc *desc, const cpumask_t *mask)
>>>              dest = SET_APIC_LOGICAL_ID(dest);
>>>          entry = irq_2_pin + irq;
>>>          for (;;) {
>>> -            unsigned int data;
>>> +            struct IO_APIC_route_entry rte;
>>> +
>>>              pin = entry->pin;
>>>              if (pin == -1)
>>>                  break;
>>>  
>>> -            io_apic_write(entry->apic, 0x10 + 1 + pin*2, dest);
>>> -            data = io_apic_read(entry->apic, 0x10 + pin*2);
>>> -            data &= ~IO_APIC_REDIR_VECTOR_MASK;
>>> -            data |= MASK_INSR(desc->arch.vector, IO_APIC_REDIR_VECTOR_MASK);
>>> -            io_apic_modify(entry->apic, 0x10 + pin*2, data);
>>> +            rte = __ioapic_read_entry(entry->apic, pin, false);
>>> +            rte.dest.dest32 = dest;
>>> +            rte.vector = desc->arch.vector;
>>> +            __ioapic_write_entry(entry->apic, pin, false, rte);
>>
>> ... this makes me wonder whether there shouldn't be an
>> __ioapic_modify_entry() capable of suppressing one of the two
>> writes (but still being handed the full RTE).
> 
> I've wondered about this, and I'm not sure how often can one of the
> two writes be suppressed here, as we modify both the low (for the
> vector) and the high part of the RTE (for the destination).  It's
> unlikely that the same vector could be used on both destinations, and
> IMO such case doesn't warrant the introduction of the extra logic
> required in order to suppress one of the writes.
> 
> Am I overlooking something?

Oh, no, that was me seeing the io_apic_modify() without paying attention
to the earlier io_apic_write() (both in the code you replace).

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 14:43:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 14:43:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569743.890765 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJFs-0008Dx-L3; Tue, 25 Jul 2023 14:43:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569743.890765; Tue, 25 Jul 2023 14:43:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJFs-0008Dq-Hs; Tue, 25 Jul 2023 14:43:16 +0000
Received: by outflank-mailman (input) for mailman id 569743;
 Tue, 25 Jul 2023 14:43:15 +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
 <SRS0=n1im=DL=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qOJFr-0008DR-4m
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 14:43:15 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 94a3c7b0-2af9-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 16:43:12 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.160.93.75])
 by support.bugseng.com (Postfix) with ESMTPSA id 53B3D4EE0739;
 Tue, 25 Jul 2023 16:43:11 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 94a3c7b0-2af9-11ee-8613-37d641c3527e
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH] xen/cpu: change parameter name in __cpu_up() declaration
Date: Tue, 25 Jul 2023 16:43:02 +0200
Message-Id: <5fdc284b6451dd19f2e84db97d12ab45efaf3bfd.1690295729.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Change parameter name from 'cpunum' to 'cpu' to keep consistency with
the name used in the corresponding definitions thus addressing a
violation of MISRA C:2012 Rule 8.3: "All declarations of an object or
function shall use the same names and type qualifiers".

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/include/xen/cpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/cpu.h b/xen/include/xen/cpu.h
index e8eeb217a0..e1d4eb5967 100644
--- a/xen/include/xen/cpu.h
+++ b/xen/include/xen/cpu.h
@@ -69,7 +69,7 @@ int disable_nonboot_cpus(void);
 void enable_nonboot_cpus(void);
 
 /* Private arch-dependent helpers for CPU hotplug. */
-int __cpu_up(unsigned int cpunum);
+int __cpu_up(unsigned int cpu);
 void __cpu_disable(void);
 void __cpu_die(unsigned int cpu);
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 14:44:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 14:44:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569748.890775 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJHM-0000Lu-VG; Tue, 25 Jul 2023 14:44:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569748.890775; Tue, 25 Jul 2023 14:44:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJHM-0000Ln-Rt; Tue, 25 Jul 2023 14:44:48 +0000
Received: by outflank-mailman (input) for mailman id 569748;
 Tue, 25 Jul 2023 14:44:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0Hqi=DL=citrix.com=prvs=563c090bc=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qOJHK-0000Lc-RT
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 14:44:46 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cab3d4ba-2af9-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 16:44:45 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cab3d4ba-2af9-11ee-b23f-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690296284;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=Na0Hb4IZHzXLvF3oz0irvk2SPKT81dw3L53qPjmZfeg=;
  b=PT3HjjAU13bHYq7WSGjPnmzdLx+/Zf8D4twdBk9vpCxHXctGlWOE7FAV
   xarzuIvWmyNwq3TI/q4pzpFOoiI9W1RQlwbm/Wspy2+wlDJAS+V618u4h
   kl4aAfgpBfIHEpCTlWPe5xOo8rPrOypGabWfEIjmVLyHveL/0rasOVxcG
   0=;
Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 116075324
X-Ironport-Server: esa5.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:nQR8IKKPPZe9+HyFFE+RwpUlxSXFcZb7ZxGr2PjKsXjdYENS3mAAn
 WZJCzuEM66CZzPyfdByYY2zpBgH65SExtBkTwBlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv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u5nSZVuk+DWI+orL9Y04lQ7vn2ZKCY4TiX8ra
 uTdZsguiMc5Ax+ZJhDo7C90di7IE80nKQdieN9AV7IZniEhILHFvAG0aLShxHmBi3i5qp8+M
 5bAsxD4QTLfDpHsfo=
X-Talos-CUID: =?us-ascii?q?9a23=3AbHS9C2pEvyYZFZejJ0JZzg3mUc0/KkL53GrxGmP?=
 =?us-ascii?q?7EkhMY62/T3ih+7wxxg=3D=3D?=
X-Talos-MUID: =?us-ascii?q?9a23=3AIXkvTg+udW0sUULy8MEpVIyQf+lD/6b+MUwcqqc?=
 =?us-ascii?q?H4ZnVHwJqJx2TtQ3iFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,230,1684814400"; 
   d="scan'208";a="116075324"
Date: Tue, 25 Jul 2023 15:44:29 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
CC: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>, Juergen Gross
	<jgross@suse.com>
Subject: Re: [PATCH v4 3/6] libxl: introduce MSR data in libxl_cpuid_policy
Message-ID: <e906e798-fc5b-49c5-bf18-f2e07912a7a8@perard>
References: <20230725130558.58094-1-roger.pau@citrix.com>
 <20230725130558.58094-4-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230725130558.58094-4-roger.pau@citrix.com>

On Tue, Jul 25, 2023 at 03:05:55PM +0200, Roger Pau Monne wrote:
> diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
> index 3c8b2a72c0b8..dd97699bbde7 100644
> --- a/tools/libs/light/libxl_cpuid.c
> +++ b/tools/libs/light/libxl_cpuid.c
> @@ -592,17 +641,32 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
>  {
>      int i, size;
>      struct xc_xend_cpuid *l;
> +    struct xc_msr *msr;
> +    const libxl__json_object *co;
>      flexarray_t *array;
> +    bool cpuid_only = false;
> +
> +    if (libxl__json_object_is_array(o)) {

I think a comment here would useful to point out that we are parsing the
format from previous version of Xen.

> +        co = o;
> +        cpuid_only = true;
> +        goto parse_cpuid;
> +    }

Otherwise, the patch looks good now:
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 14:46:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 14:46:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569750.890785 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJIN-0000uy-83; Tue, 25 Jul 2023 14:45:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569750.890785; Tue, 25 Jul 2023 14:45:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJIN-0000ur-5F; Tue, 25 Jul 2023 14:45:51 +0000
Received: by outflank-mailman (input) for mailman id 569750;
 Tue, 25 Jul 2023 14:45:50 +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 <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOJIM-0000uj-7I
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 14:45:50 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20611.outbound.protection.outlook.com
 [2a01:111:f400:7d00::611])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f149e771-2af9-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 16:45:48 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by GVXPR04MB9904.eurprd04.prod.outlook.com (2603:10a6:150:119::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Tue, 25 Jul
 2023 14:45:46 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 14:45:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f149e771-2af9-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=X9TSnp9Ht3T0wdqnbKE80wbWO0pL8/Vo9kgTWbleW9WdVQgMe8c3Erm1PBEfSQ2rbyRa6eWm10YwY/2i8jJGJRi95whWr7fRLAuNIkojplWS7HkdyToBaqB5hG9KOPgrOCqvKVZCawOcIbTPhyqE9N/vqZ6p2UCprqWyGabhCRrYKf2wYenQBSuT5xTumpjVmErX9VxVSJ1G8a/B6e1zIavbnd39oBb+QRbFr8i/8C7NEh+oGJC8iRdbWL5E7ehJI0kRDfdSQElsqxF5fYjpEIOhACPF6gfaA7b2W/cD9h3KdVn+LpwEYACAisZCjuvrOgF4uV0z7q4Xorc8oaY6Ow==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=NShA3SFEHAfYIpgenBS7HX1XTNQCsojJTAq4Q24tiUs=;
 b=ONtgWt10pfA1F1tYUVINZxBH9WuY+Vq8uazkVzAWQ+vmM4s3z//JqKK6ParIdIFt68TE2DpCg22K+INj9wp1oMMJYgImgYB3x60DJAyhDzMDCr8RLYX6Hl3yvGfh9QvuDhFl1itHACKVfqGCKjI/ZzCxyW3pty3rAqxXZravFdW1utsIoZffAqEtlI2pL8KP8n1tDATkmTMO3tymF9hqdMXdnKCnLdXMneToQNm0t8td6WQyikK+bakIji2Js/VPhvDCBfFsjBZbnA0rqVBWlM+OW/Rw3/DNp5XOoubqnGq4gKocRvVOT+mrYPrnYnjofe5Ohe36VLYJDPUtBn7i7Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=NShA3SFEHAfYIpgenBS7HX1XTNQCsojJTAq4Q24tiUs=;
 b=DBoT8vTrIhoazyIWryh2cwVly0m1oHLNog0nIYzQFqa3rpxrxNq62Eeo4CRhlJEqwfDdIkfsuBjbELqRHzKvkSMSpFX5MS/ImONGuzPDdu+sLTpb0vlfqR6nHB0mjlaVUC9cjgs7byiv3VJ7giqmqajvv46CrP2QdN+2q6+CRPAPFPFBnzkILf66rijmmDknSNlLe9W/nj0EGisXeblOt0dP5AoFVogUY7aGsZgsx97OOCC2FAGc1pUpXVvGVLrL6suArVfFDt+B+JaPdFUDpw6se1VAyEAv56ywUVylG6pBiOwLUpQz9P1Jp3WKRG4kuzW/g09PfXwBYcdSfW+dkg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3e690119-10f7-577f-b0e7-2fe5f1605081@suse.com>
Date: Tue, 25 Jul 2023 16:45:43 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v6 12/15] xen: Add SET_CPUFREQ_HWP xen_sysctl_pm_op
Content-Language: en-US
To: Jason Andryuk <jandryuk@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <20230724125857.11133-1-jandryuk@gmail.com>
 <20230724125857.11133-13-jandryuk@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230724125857.11133-13-jandryuk@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0020.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:14::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|GVXPR04MB9904:EE_
X-MS-Office365-Filtering-Correlation-Id: c219968a-91c4-47cb-27d7-08db8d1dd44a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	sUc8/JE7pScybx/tPA0PriMIhecGqWeMHc4OZWkwBy5zN0aZ5NLeOY6VZOl/SL9q0D5DJ418aof2s/HzoKVnKCmQ8clWTt/KtHeYKDt2pa+5CYQ2ghzVRWHgdwyVDKEGfUVbxYwvTsN5tch3IW+rfR5vd1Dbq3HxI+9xPlt3vSFTSNkGUg+lBY+zMDn65rlUg/vS6NPV06siBlxibUnfCiRG3Lj1OrB6PUEki5MRAb/9vS8tSMyn0pEVZxkpz6ArVxxKpMT6vLgJf+GSSUKh3yxZ2C662QorzWgDQVgD6MGe7ndAwSbQVJEH8ZSJI1JiduREeKrtRer4M2xitv6B4k5FzltlkEfIpafFGVZrXcz6QTdCaAztJPgK+DjOKNC5ek4C61Kfd7ghFRgmSPsiBCTFEvnOH/+VWQfmvAg2EGAuLxpDrS82TqIEFO12713tNVN+nbsHIiGuTAnCuv82jarqALmsP64rOXeRu+/CupQ30HPjmwX4snUaJDe82okF3EnpHt0Xfd1Z66gaTN3gqAPKJ453X6AwaFX3fk2ZdDntIGODhEkGGjT1iKmMLdQiRLR7LdVNHCQZNCH0xqOYJxEo28t/9JBjY2bng38vouqySYWiPuCBuRneL5xS5qXz7Mv43NP4a1a1pN2g1aeH3A==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(396003)(39860400002)(136003)(346002)(451199021)(6512007)(6486002)(54906003)(6666004)(478600001)(186003)(53546011)(2616005)(6506007)(26005)(2906002)(41300700001)(66556008)(66946007)(5660300002)(8936002)(8676002)(4326008)(66476007)(6916009)(316002)(38100700002)(36756003)(86362001)(31696002)(83380400001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cXhKUDB5NUErajQ1TEltMFRNRmJYZjZkU1YyeEE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?SHg5M3Q3S3p5MEEyVUJNZ2dRai8xVnhWR25wM0d5dU42SGhqNUR5R3JDOHpq?=
 =?utf-8?B?Y0xiZ1ZVK01Dd2VCNHBaNk9VVlU4WVBJN29JVnJhWS9SZ1RwbE9UWkY4MGNX?=
 =?utf-8?B?ZWlxc2M0LzQzbTBvNTBrbTJDVGRIM1dVQWZIMHIzalp2UDlic0ozV3dXQkRa?=
 =?utf-8?B?UThvdjNodnc4aU0wa1lOM1dST3hjUms5S01rS0dJQThCNytmYm5YV3h2M0du?=
 =?utf-8?B?UkNwNzY5LzdTTXg2L05zRDZuRFhFdDI5QllzVzNEVGRaZnJQZVE4SitaY3NB?=
 =?utf-8?B?VFdUeVR1RGFaZERVUm5DZENqWnl1MnlmbWV6dFRNVkVHdHZ4c3Jvc004YzBa?=
 =?utf-8?Q?ToNOvaRt2NMpWsLK5bwj1Vseg?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c219968a-91c4-47cb-27d7-08db8d1dd44a
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 14:45:45.9535
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: OeQ5mBWtr+ygeYmK5N8l1XxwdGEcGCYm5Qb9zT2E32rOqZ0nTMX6MgSeNspcdbCj3QiJ9V254hZYZ2kjbd6jlg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9904

On 24.07.2023 14:58, Jason Andryuk wrote:
> Add SET_CPUFREQ_HWP xen_sysctl_pm_op to set HWP parameters.  The sysctl
> supports setting multiple values simultaneously as indicated by the
> set_params bits.  This allows atomically applying new HWP configuration
> via a single wrmsr.
> 
> XEN_SYSCTL_HWP_SET_PRESET_BALANCE/PERFORMANCE/POWERSAVE provide three
> common presets.  Setting them depends on hardware limits which the
> hypervisor is already caching.  So using them allows skipping a
> hypercall to query the limits (lowest/highest) to then set those same
> values.  The code is organized to allow a preset to be refined with
> additional parameters if desired.
> 
> "most_efficient" and "guaranteed" could be additional presets in the
> future, but the are not added now.  Those levels can change at runtime,
> but we don't have code in place to monitor and update for those events.
> 
> Since activity window may not be supported by all hardware, omit writing
> it when not supported, and return that fact to userspace by updating
> set_params.
> 
> CPPC parameter checking disallows setting reserved bytes and ensure
> values are only non-zero when the corresponding set_params bit is set.
> There is no range checking (0-255 is allowed) since hardware is
> documented to clip internally.
> 
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
with one last nit taken care of:

> @@ -539,6 +543,103 @@ int get_hwp_para(unsigned int cpu,
>      return 0;
>  }
>  
> +int set_hwp_para(struct cpufreq_policy *policy,
> +                 struct xen_set_cppc_para *set_cppc)
> +{
> +    unsigned int cpu = policy->cpu;
> +    struct hwp_drv_data *data = per_cpu(hwp_drv_data, cpu);
> +    bool cleared_act_window = false;
> +
> +    if ( data == NULL )
> +        return -ENOENT;
> +
> +    /* Validate all parameters - Disallow reserved bits. */
> +    if ( set_cppc->minimum > 255 ||
> +         set_cppc->maximum > 255 ||
> +         set_cppc->desired > 255 ||
> +         set_cppc->energy_perf > 255 ||
> +         (set_cppc->set_params & ~XEN_SYSCTL_CPPC_SET_PARAM_MASK) ||
> +         (set_cppc->activity_window & ~XEN_SYSCTL_CPPC_ACT_WINDOW_MASK) )
> +        return -EINVAL;
> +
> +    /* Only allow values if params bit is set. */
> +    if ( (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_DESIRED) &&
> +          set_cppc->desired) ||
> +         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_MINIMUM) &&
> +          set_cppc->minimum) ||
> +         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_MAXIMUM) &&
> +          set_cppc->maximum) ||
> +         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ENERGY_PERF) &&
> +          set_cppc->energy_perf) ||
> +         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ACT_WINDOW) &&
> +          set_cppc->activity_window) )
> +        return -EINVAL;
> +
> +    /* Clear out activity window if lacking HW supported. */
> +    if ( (set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ACT_WINDOW) &&
> +         !feature_hwp_activity_window ) {

Yet another misplaced brace.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 14:53:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 14:53:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569753.890794 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJPM-0002Rj-VR; Tue, 25 Jul 2023 14:53:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569753.890794; Tue, 25 Jul 2023 14:53:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJPM-0002Rc-Sf; Tue, 25 Jul 2023 14:53:04 +0000
Received: by outflank-mailman (input) for mailman id 569753;
 Tue, 25 Jul 2023 14:53:04 +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 <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOJPL-0002RO-Vb
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 14:53:03 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2058.outbound.protection.outlook.com [40.107.13.58])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f419fe0a-2afa-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 16:53:02 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB9704.eurprd04.prod.outlook.com (2603:10a6:10:303::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 14:52:32 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 14:52:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f419fe0a-2afa-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Sl9mJzCwpY7uoyPwhPLfYUeNJw2YuASmYw9zkR7JpWhv9l1xFJAsFCSURSDIT1x+WXw1HNyQTdKuI6h2sPZeuME5ExQmMxR6XukUN8MUp9frerZ41vZHIpysrPiNeCR0WkFlefx+XGAba7V2+pa8Ss1PIZXuR4l0GI7X2NbZvZHqJ72Im+cTUf7ljPv3OrU/VA4dythoMqdhg6YvDxzJ+zL1toWse//FOn32X/+0Xqe4YRbJUl7hIS91qvljyihBXsz623xr9IA9b+bmuXdvGQH49dhkNuDJEWwbW++22vkzjtKobcvhW9azJXhIWS9bwVH9XmaY+oiP9cwXXEX9cw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=H9ZB3Cp0sgSI1qvkZRQIy33j9qWeKYMHFTtR0g54CNc=;
 b=aQGUGIL1BM43VF7i/2BXR4KA2+aIu2mchWXhGpDdV5oL7Xn1MP7FpjaTn3ZGiGpo63fdF4CFuhAzHbmij4o3L1wcs7iBM86nfHbTOTjVeeEwWIRBnvxK7EsAOKGiyQWvVSNqsDJyzO2IRVoc33p+hXN5qIzCK1ha01nNeptec9NDowSRDN/gkyFMs15WhyIbmHctlWDLg0FTKxvzcVT9cYGauDbkIK/z2tTtGzL94aplMWPVl/N2AXIvNlHmvsgPRCwsJy/o8LFJJXmK8TkG4P4L6/2SAZkRB5h7CJJiwnwB+5gBeNFp2KIep5/ISojSPYHZ/V3VZjhGXr3+CzkIwQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=H9ZB3Cp0sgSI1qvkZRQIy33j9qWeKYMHFTtR0g54CNc=;
 b=KivcR4/u14NxCKW/yy0B/oLCGpG545UG6vFsRAAhNlTBhsLkp35wBEY1kht6YGErE+Xmpg9LzIf6n+wUWGh12ZBt9UW5eeCjf5JvkqxuYPinmtnr9FUXEF90QwMPZ3quhDYNGQomIAEWzUJyvpaFm2DpE8SJEUKn4sS5tuVSs7gw0MUE2qi/Bqt+5N1m1MAjdVCEmbB77tkJbxNW7U+deb5pj5DVLFy9SS0wmi+hd0zFYbkO7vln9qNHZG9ao0J2gAfZVGMwg+ME9bp2QvEGPce6l/dpRaEpAwGZIUSy3CKOJk7cT/G7j5aiPs35/ZuchX4dTo5DdZaCwA/+XAnBdA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <8a30cc1f-79fb-f202-a602-3645de619825@suse.com>
Date: Tue, 25 Jul 2023 16:52:29 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v2] xen/sched: mechanical renaming to address MISRA
 C:2012 Rule 5.3
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 George Dunlap <george.dunlap@citrix.com>, Dario Faggioli
 <dfaggioli@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <0b489f53751f8f7e80a7be85eb832f90bcadcbb0.1690272371.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <0b489f53751f8f7e80a7be85eb832f90bcadcbb0.1690272371.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0127.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9e::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB9704:EE_
X-MS-Office365-Filtering-Correlation-Id: 7742f871-66b0-49cf-72b5-08db8d1ec661
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	LtaMDBvon5i2hivg/g9dC2XyIwWjeJVSsSGexSCq8b0WtziHRfF9qntJTm/naEkojtLcQakcYchakZyhDcPZYfAE/CFz3ojZNqFYF4z4dCy11XZLissBQXPRU9SgGVOG+4D8+WguGped4SYK/unTLE1vqnbdPfjTQqgZHWWsBhov3/f2eMNefG/BTrHQDSB2t6nyOtpiVNbfc5d0f/EMdhyoJrSEpfc0olNpuH8kwJ8Kd6+LXBjmCVf6a9i/tHYmW04B8Fnqd0itEAw+W6io1E0jeub+iD6dQknnsKBz3T89K7ubudtVC/LY7juZSpP6Vgjb/SXTryDcEC7XN92RRxl7Sxu0XFK+gc5X+pCCJ88tUQxJsYYu0cEYEEpAHcyFQzlL/kGyGGvWLtLzuoa9OEgyCI0nbGfh+Mc1YPwNgNuNKUoa/5BVChuGr05Hwb4bttev/nBLBXGGeLdheRxIiH2UtBh/lYNnVJyX3mmn9lnp39ypEk8XDnLASy46yavSMQbVxnFNcB6qaGHpHAMvVcuTE71pwi1MnF9LFa0eT5OP3WF29Sdifm6Rp0wMntbANKW7czdjiCIyzw5G5cXc3P+6gJyjL1ptT/PSW9Ecx5C4atxe6vgwW8vNepeKjVasNmBZZPRYqgQIY9yFPcVEqw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(136003)(366004)(346002)(396003)(39860400002)(451199021)(54906003)(66946007)(66476007)(66556008)(6486002)(2616005)(36756003)(83380400001)(31696002)(86362001)(38100700002)(478600001)(6512007)(53546011)(26005)(186003)(6506007)(6666004)(31686004)(41300700001)(316002)(5660300002)(2906002)(6916009)(4326008)(8676002)(7416002)(8936002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aEhwU3R3QXk1d04wcFV0R1lkSXZzNmVKeFFVNC96K1VXSzhtbW1MdHpMdVRE?=
 =?utf-8?B?WlZkTlZCVnZTeGhpVmY1QW05cG01UjJxQ3RBdFFIZndzUUw5RkFvc3BmbUxH?=
 =?utf-8?B?aUltRGNlb1N3VVo4WnNtU0ZZY0pRTUZYRVdRYlNkSzdNc0pHOTQ5QkVzWHFm?=
 =?utf-8?B?VWlTMktLbTRRWVRPbXExaGZHb0greEU3WFNZNHg3VXN6RnRlU3AvMFNlSWJr?=
 =?utf-8?B?bDkxM3hEazk0MkR3aHAvSlBHRGRlT3NvMXJVY1k1WHZETTVnZ2FZcnVwWnY0?=
 =?utf-8?B?ZWhwWlNrYTVWbTdrTGJ0QjVGK1lXc1kwWVg2bm9iOUcxQnZJMVBJNGcxTk40?=
 =?utf-8?B?UmhvR0tQN0R5b3g4SHN0TndCL0RxVjE1YkhGWUJITjJQenQ1cEJpWXdUWTJY?=
 =?utf-8?B?Nk9DL3JxU3l6bHk4RTJHZFVMR3pMSVYwR1lZWDVsa3MrL0wrdDZEaWFSQURX?=
 =?utf-8?B?cEhLaGpuTjFRd2RVZnBPdy85WUNWZlZ0SjlUQ2RoTVRjcTJmbERBRC9yd2JM?=
 =?utf-8?B?QzJhMk4zNFp3a09QSEhZK2NCQTAwUm1YNEVyYm03ekpLdm4yZGFhRkFTT0hE?=
 =?utf-8?B?bmpacEsySkNOcFFhdkFDSGNtMjJScG4zRVUzbVE2L0hEbXIxMkRjNkdzY1pl?=
 =?utf-8?B?dlBYZ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VMyYkR1U1FEcE5nQ1VsOTBqSnMrTC9XSDNKNUErRGZZ?=
 =?utf-8?B?NURCMmsveEYrY3FjTHNCb1RJMktFZ1hjK1oydlRYc0ZkYXR2MHFnTXFYWXlQ?=
 =?utf-8?B?Z2V0bCtKZ09Ma1hISi9PMnhUbkFEV3BHOEtGVklBRkJvczlCeDFhKzB3WHkz?=
 =?utf-8?B?TXBaYW1qU1paVko5SXRVOHNMV0NrKzBoMkdmSTZjQmtYWDg4U0J6TEg0NFVq?=
 =?utf-8?B?NHVPb2ZmaWdqL1MyZjNkN2tVM0ZGRzFDemswNkxUQ0RPZU4zak00M1JML0xM?=
 =?utf-8?B?bGRLcmlRU1FsZU1xS3NVcHZKeDB6ajRQRlp4cHpsOVVpTG9TRmxaQXNNbjlT?=
 =?utf-8?B?SC9VclQwOFJLd3RCWGJ1WWh1eGxLYUx2bUllVEI3NTExQW12UWs4ZEYxN1Ni?=
 =?utf-8?B?OGlPY1F3dGJ3MHE5ZFRnblZkWjZObkFRZ1NlNTdobjhnWDZwdjJZZWxXRk5R?=
 =?utf-8?B?V1ZvZU0rOHI5QWlGejlXVnRiWVdvamQ5ajlWOGRpK2gzRDlhNzlCZ1JiU3Zy?=
 =?utf-8?B?dEU2bFRzc1VTUi8vTGl0VktmTnZRYk1paWhaOEp0ZUxscHBnOHRKbENpanFU?=
 =?utf-8?Q?WluqOqz/xkE8lXtFYDlrE55cf?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7742f871-66b0-49cf-72b5-08db8d1ec661
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 14:52:32.1173
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Aj5cOngI8YxTLAhV9gUbmbgHMV63u/HY3WjMekbqE+xr9Ron3faEuTIm1gHkI8Pa47rXeP8vC11FTF/7AVJghQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9704

On 25.07.2023 11:08, Nicola Vetrini wrote:
> @@ -99,14 +99,15 @@ static void sched_set_affinity(
>      struct sched_unit *unit, const cpumask_t *hard, const cpumask_t *soft);
>  
>  static struct sched_resource *cf_check
> -sched_idle_res_pick(const struct scheduler *ops, const struct sched_unit *unit)
> +sched_idle_res_pick(
> +    const struct scheduler *ops, const struct sched_unit *unit)
>  {
>      return unit->res;
>  }
>  
>  static void *cf_check
> -sched_idle_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
> -                       void *dd)
> +sched_idle_alloc_udata(
> +    const struct scheduler *ops, struct sched_unit *unit, void *dd)
>  {
>      /* Any non-NULL pointer is fine here. */
>      return ZERO_BLOCK_PTR;

These look like stray changes, presumably resulting from you not fully
undoing earlier changes.

> --- a/xen/common/sched/credit2.c
> +++ b/xen/common/sched/credit2.c
> @@ -3809,7 +3809,8 @@ csched2_dump(const struct scheduler *ops)
>      struct list_head *iter_sdom;
>      struct csched2_private *prv = csched2_priv(ops);
>      unsigned long flags;
> -    unsigned int j, loop;
> +    unsigned int loop;
> +    int j;

This looks like a stray change too, just that it's unclear where it is
coming from.

> @@ -3884,7 +3885,7 @@ csched2_dump(const struct scheduler *ops)
>      list_for_each_entry ( rqd, &prv->rql, rql )
>      {
>          struct list_head *iter, *runq = &rqd->runq;
> -        int loop = 0;
> +        loop = 0;
>  
>          /* We need the lock to scan the runqueue. */
>          spin_lock(&rqd->lock);

With the switch from declaration to statement, a blank line wants
inserting (to separate the remaining declaration from the
statements).

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 14:55:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 14:55:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569755.890805 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJRV-00030z-BT; Tue, 25 Jul 2023 14:55:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569755.890805; Tue, 25 Jul 2023 14:55:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJRV-00030s-8e; Tue, 25 Jul 2023 14:55:17 +0000
Received: by outflank-mailman (input) for mailman id 569755;
 Tue, 25 Jul 2023 14:55:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOJRT-00030R-RZ
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 14:55:15 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2057.outbound.protection.outlook.com [40.107.13.57])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 430ed76a-2afb-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 16:55:14 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB9704.eurprd04.prod.outlook.com (2603:10a6:10:303::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 14:54:45 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 14:54:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 430ed76a-2afb-11ee-b23f-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=M+N4uUizyVKy/AyJ44iX7BjfRDvnmAvbwCCh9l9PIFwz3xIvSyYZKUOClOOPUJIMxDqLxRgZ/XqHacrYSu0/Djoy2c5cLm4qkBuhpZ3AF70IfUU21AfqekRTbh2Aoz3Lx6Ek2Q8uyqKHBEZv5M/ocv6bymbyHannEMNC0WRsfF2oIW5zRgRN1KAe2tpCjJyuVYnyxKtxU8h42ESDHIvZ9bTz6ltFpkCpjCw5S4/UgTJxrmgU09CWOOLlalp/joDOBpiouydIvCMGget0fSjko1LF/qJ/K+SNckh6eQANOm5vOA575A7Zn4b6i1zyAWy5wZBULEW9HxorEyDAkstomA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=GFjE/0XmVuJbmKxK+1O3d8vmuyqjKCrcDoeceA9/uBY=;
 b=dtNUxpDcIj2dbjXa1GkdkyxzIRTNQDhy+w7tUwuaBWtWAK+vhvE7rEk8IJBL9hTOKqAH2qRBWYgYYfnAPy5tCkFFPwXj8BaOndKQ1Fzd5ZPHY31yfcV4MoPWDsiKrFhagMrOHXCeQl/qhTK/GOU8kO68bc+QNIFnZl48tnoK29ll7jZzEUj4Tk37wSGxsFARSa6To94b8S/njsWCCyV2dVGhIaTlp+SCFfxcnCRpnum50KIZ2e7GXo7c0ZdreA1Kq5q/cSWL4tAot+7r41c2vxCwj2HeU0jrOtSWU+wxaAQe6u2v7RI+m3ZvbhAs6ng3tuO7p4BDQ3cZyg5eiRTY5A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=GFjE/0XmVuJbmKxK+1O3d8vmuyqjKCrcDoeceA9/uBY=;
 b=hrjQcBp3VuYr0X9+6LXNNpEAnxrzVm7qo7Euq2lAmbvZ/fKun9/rDnzqABJkPCGmQCFMgF/iuPCrKOuA7uoEqBnqPPIxv8qF3jf8KRhGhrgklmEHHLMs/nc+yRBPT3juxmXBRkHeVzkCSaPmgakmzgkbP1v1Cq5zc8BMvgRVdbw3TUTUWferJUApxMpRdVx1vZCWk8B85yqaGLqy7NHAoM1U/LaCCvRCTydY3A4ggokxgauZwJCHMnLp9qzYM8xm2gOILpRpbYn05mTzLelkHuNB4snhgGO+bw9ZYFjp4rrFDUwnBuFTRqQakUIR0UPxiqP/UHWXAPc4630VFvjAbg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <120ed841-5e0f-e27b-9937-5599dc75d84a@suse.com>
Date: Tue, 25 Jul 2023 16:54:44 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v2] xen/spinlock: mechanically rename parameter name
 'debug'
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
References: <87c0f41e43a1c95ef7d8923c77a2072eb9baee96.1690276551.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <87c0f41e43a1c95ef7d8923c77a2072eb9baee96.1690276551.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0224.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ac::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB9704:EE_
X-MS-Office365-Filtering-Correlation-Id: a46b1e35-abfe-4b1d-c5ea-08db8d1f1618
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	7bVquTkkn8bgakuNvwjgDYJMJaC/jNBUHuV5Va1aj8nkCIlyKj8qk+UoQ7WEhdj4JE32UjRVCOWiyCjTZ+SwjOUQhlPMXPkWJTH3FonkXQeEnYCrXfCPgNlhjIZC/5N3yZZPsWFQzqG5adg9kQQeeorEo2q6sTC1UyUYNXjOap5DA0pac6tb/3ZOpwQjTCWRGrlanFC4rxVTbm3EZL2ssJMdeGs5SHlGXNvoqGY4u1gFY3yNJ/FKkkSUwD9CoZONIor5SuSjA06yCkq8qLM0p885n6e0kSGpGFz20BSXgPrroj3V+80/7gRcR9lkWHMFY7Nnkid5M0abVxHb+hCwgOi/XWiN/JtD04iXsu1I0ae05O8++aamsM8nX4+cu4dOLvo04j6N3jSuaseVKfyRFJKvO1hhPhxVsbs5Qr7EqfVf34KF/NHtM1J08Dpd7eC7PaE+sDqW+dgZ2gaDnq1jp3abu6b7HDsOiul82bsoW4NK2CPhuqcy/egEAQWBDemQTld0qYlyOMhGrDi8v9l8XQRcY/apTuypG/Ey8GpbZ+gPsanSVSEzEgkYryHaE8yJFILGvPGvoD4q4lhD5KNx57yGtJ2oP9qImwFngMSRja0gi30/gi0XRcICGIlgeV9ohZ2nNKLgYzRGM21NTDdZfw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(136003)(366004)(346002)(396003)(39860400002)(451199021)(54906003)(66946007)(66476007)(66556008)(6486002)(2616005)(36756003)(83380400001)(31696002)(86362001)(38100700002)(478600001)(6512007)(53546011)(26005)(186003)(4744005)(6506007)(31686004)(41300700001)(316002)(5660300002)(2906002)(6916009)(4326008)(8676002)(7416002)(8936002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SUQ2cHl6MGhXRlRhV1ZBcE44T01aNWEvaFZzYnZ6VHdVOGZKcjZiMXlNamNp?=
 =?utf-8?B?SHZSc2NmazNDckxXUnlOc2pXbE5pbkVJeG82T2pDeUJkOXBUNWpmQlVaQ2dW?=
 =?utf-8?B?bmN3VmU5TnFIUXVSUDdRQjBQcWxZNkdpOW5GTUZyUHVGZERWejlYemE5ZUxw?=
 =?utf-8?B?bUdaSXZkdUFsR1FJ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-8?B?M2twZWxPcm42L0JDK1VOb0JpeDFXNytEQ2htSG1NY01IcWZYM2NxSFhWZUpk?=
 =?utf-8?B?ZUNOem55dlZxLzZHS3JHeU1wWGo2c2lDYXFLdzdqai9DM0hJOVNHT1pia0U0?=
 =?utf-8?B?TFNWSXg0cFBYa2UvYXdaeWxHRlg3S28rWUQwOE4yb3Irejc3K2s3N1loNnB2?=
 =?utf-8?Q?i1ArLwWzviG07Z2I2Fb/bzoXY?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a46b1e35-abfe-4b1d-c5ea-08db8d1f1618
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 14:54:45.8684
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: l+tsUYR+34H9zaqqSNuwExxItBVJQBoXIc5NXFL+OknZWXDdbHhQVcdhSiKT8uJZb3UjR0AO65k1YCBVnEzRdg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9704

On 25.07.2023 11:17, Nicola Vetrini wrote:
> Rule 5.3 has the following headline:
> "An identifier declared in an inner scope shall not hide an
> identifier declared in an outer scope"
> 
> To avoid any confusion resulting from the parameter 'debug'
> hiding the homonymous function declared at
> 'xen/arch/x86/include/asm/processor.h:428'
> the rename of parameters s/debug/lkdbg/ is performed.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
> Changes in v2:
> - s/dbg/lkdbg/

But only in some of the cases. E.g. ...

> -static void check_barrier(union lock_debug *debug)
> +static void check_barrier(union lock_debug *dbg)

... not here (there are a few more).

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 14:57:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 14:57:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569758.890814 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJTN-0003bG-Mq; Tue, 25 Jul 2023 14:57:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569758.890814; Tue, 25 Jul 2023 14:57:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJTN-0003b9-K0; Tue, 25 Jul 2023 14:57:13 +0000
Received: by outflank-mailman (input) for mailman id 569758;
 Tue, 25 Jul 2023 14:57:12 +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 <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOJTM-0003ay-HZ
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 14:57:12 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20600.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::600])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 87e5f582-2afb-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 16:57:10 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB9704.eurprd04.prod.outlook.com (2603:10a6:10:303::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 14:57:08 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 14:57:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 87e5f582-2afb-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=WLznSAZrvHlyjQF+/gBkHeShGCWooCVd0yu3iaKsdxOiqJo+GCy19QpNrwnOmcdhcoyv5WiqM7M1jS69858nnwjWHGGhqtR6z/kItVYYgVG2psAX+6CHp5f9d1YpmYtUDKNxxSe/xxrUtUWqFrotO/CltaTN2xHHBBIWD3llaxEZjHdfAyCqvseI8nnf6LCn5uaCWNf4t+qY+4moQ5U6rmMFR35lz8sA9J1zJbg7aZn9gDBdEWykZDIE7De/wYLvRmMxl7gM+1M0vm85PPTeiFUx0BXT0F0bC+IH9UcynPfhjK1RHYiE+CIq3SSW9aLBNu6MI7rPQi6VITzwnQ0JdQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=qK042ciPaAd5w7KBVNFwKwZ1hnRCXfY7pEh28nuY2Y0=;
 b=RDgXKr9HFsGsstXwX3FJ15lRkLGs/5kHaDKFgZr2wpqS6arfdMP2QM+FeIUWyPDUzB8pG2yFV/fWJz6B3gXnemRgYpuq82fncw7ZyWvNnbt2EC4PqeLOH/p1eHofmeI9YdPT1Mb6SyZcDeiPcJAAtV/FAGVwxJZ6KT2wNlCHL3UCCfXRV0fW+l4ks7CXnIWgUCysmOwCaDwe0pKB24zlUza0wvv7HzDXvo79980EPIbFFYESL394SZW+Rj/2j8ji86TFG1N9PayrqxsytR0OIvFmG+/puLKF8lGcziC1xc5okjRxrFIVAUZBk+H6QM5IGP/TnTc4wbGU1DFua7PQ9w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=qK042ciPaAd5w7KBVNFwKwZ1hnRCXfY7pEh28nuY2Y0=;
 b=vXHzzEShaac/vx1kt71r/89hORJVCxWVLya487lWn/Liukd8GEET+ezVjA7BzRGVb+NLtER3dLRXaign5A3wjjDvoNFKzuLCahtyr5T52CN1Pf8/3PZJULiiAZ6Tl3LW/iexK5LJ//TaoPBxeyYrg48hGPHL9gcJJD/imPeol/ryBCPt4kuwdOmIRQNQiYOe5Op/N5wYiqITbqle3ABwbRtZ58cFj+DpOePEsAl/j/prPoVuTp+/WEIZGwMtAJ6KQ+gtgSMY3SLEYsxAPG5xw8KeyArC6S2JVsmYO0NuYG1slKNCvGkp0MMjRC8G1UwGcImCKxvkupxvHpvsDsw+3w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <948fa9bb-1995-1586-98d5-adc2bb36ae83@suse.com>
Date: Tue, 25 Jul 2023 16:57:06 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] xen/cpu: change parameter name in __cpu_up()
 declaration
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <5fdc284b6451dd19f2e84db97d12ab45efaf3bfd.1690295729.git.federico.serafini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <5fdc284b6451dd19f2e84db97d12ab45efaf3bfd.1690295729.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0129.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:94::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB9704:EE_
X-MS-Office365-Filtering-Correlation-Id: 7bc1c17d-3690-4a24-2502-08db8d1f6b0e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	SxaYVYFeEXcRJyMZo9N6BlWwqo6uHFdoZkV6NWUrC8cjMoc9GRdbr3RsIfSyvbnPmTtlH2TD8g8dfsEUc0ZVx+kXlMZh1NK+6B3NL7nEHovTWlCBQbV2crAvhxlCD6NbNz3iBlMYtJCW58aWgpBH6wJq18E+e6OQcHK9r9qr8LAUkclP/cDVgOwyJKAMgeOr398UWwjyJXdyDTVIEm85F0dGJnHQpGor4bIJHBk4qbtDzSAhYS/FYHsR8YRydwwD5I2wf1kDimK2lyHyyWELFHK1IQ2AiopI2sCUySgp3kx4ydGPpi/97JT5DqEjs5/uqh5VrMk0q20B8/25yiBgodSqNPlmCgTA23KAehI55SxCNcur2gaVpFSJKRld+VoErLy84m/aqysISs01ogsVorU+8dbKzE7B28mIwSFfOkkuwFfMQ+wNQD44MnOUezgGxO3rGYib3sh80WDJX4iokXkeTAgamFuUlH6aJh60aN2RG1bymRjvT4kjSj7ic1ysqkCYxwF0AfPDNDlOXdfzTKhE1K70vpRRyYjjN+YSjGON332uI1v6mfdBezQAzbNFVBwMWxIrHJ9+Kb5c2DuYyhLt13ehh6WvDiyfuFOW4DW1fVkjiYlNu63cso9Ido0zvicEhf6AR3ettm2Obi2gVw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(136003)(366004)(346002)(396003)(39860400002)(451199021)(54906003)(66946007)(66476007)(66556008)(6486002)(2616005)(36756003)(31696002)(86362001)(38100700002)(478600001)(6512007)(53546011)(26005)(186003)(4744005)(6506007)(31686004)(41300700001)(316002)(5660300002)(2906002)(6916009)(4326008)(8676002)(8936002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VjRPcVFDR3NmNG1xNVJCcHdrb0lIbk0yaGpZeENOZW9iWVVtUG52ZHcwUUp4?=
 =?utf-8?B?cWtxY25JS3E4SVNOOVhTNFJLODhGVytDMi9QbzVUVko4S3VHYjg0N3NqdnNn?=
 =?utf-8?B?VEhSTFQwYXlkRUFsQjlNTm5rTVpPQVMzaHg5a2RlcXlodUo0ajlENHlyOVBi?=
 =?utf-8?B?T1YzUjdiMmFTRWg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f-8?B?OUFxZFdRMjQ1c3U2Ym5Bd29WWUtvUVNCWG1SeW9HNEJhblZ3SUhCSlIvVHlR?=
 =?utf-8?B?aHUzMnR4Z2ZMdmpQVmlvMjFxM05HRVMxSGsvbkNpZkpkY1lkUGlzSGE1OE1h?=
 =?utf-8?B?REFjbkZSM0dPKzB5bXYvTnQ1eDdNb2hrVEZXM09MRXdPZkQ1U2xCc2M1a3hI?=
 =?utf-8?Q?WWA4ve2RoOjSTBZwUS7nufO6E?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7bc1c17d-3690-4a24-2502-08db8d1f6b0e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 14:57:08.4000
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: tS4C+b68iAHyKXuU6rWMPp0Lzik/KSwRgndQ1jQU6Mp//LaBRuTpkfbyJn/ozz0nnrCxklmGJWQO2vrW317ePg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9704

On 25.07.2023 16:43, Federico Serafini wrote:
> Change parameter name from 'cpunum' to 'cpu' to keep consistency with
> the name used in the corresponding definitions thus addressing a
> violation of MISRA C:2012 Rule 8.3: "All declarations of an object or
> function shall use the same names and type qualifiers".
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Tue Jul 25 14:57:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 14:57:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569760.890825 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJTj-000480-3d; Tue, 25 Jul 2023 14:57:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569760.890825; Tue, 25 Jul 2023 14:57:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJTj-00047s-0c; Tue, 25 Jul 2023 14:57:35 +0000
Received: by outflank-mailman (input) for mailman id 569760;
 Tue, 25 Jul 2023 14:57:34 +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
 <SRS0=p13o=DL=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qOJTi-0003ay-My
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 14:57:34 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 95632501-2afb-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 16:57:32 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.75.91])
 by support.bugseng.com (Postfix) with ESMTPSA id 35E6B4EE0739;
 Tue, 25 Jul 2023 16:57:31 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 95632501-2afb-11ee-8613-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH 0/4] automation: Add ECLAIR pipelines
Date: Tue, 25 Jul 2023 16:55:53 +0200
Message-Id: <cover.1690294965.git.simone.ballarin@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This patch series adds two pipelines that analyze an ARM64 and a X86_64
build with the ECLAIR static analyzer on the guidelines contained in Set1.
The builds analyzed are the ones triggered by automation/eclair_analysis/build.sh.

automation/eclair_analysis/ECLAIR contains the ECLAIR configuration files
(.ecl files) and scripts that implement the integration (action* scripts).

All commits on the xen-project/xen:staging branch will be analyzed
and their artifacts will be stored indefinitely; the integration will
report differential information with respect to the previous analysis.

All commits on other branches or repositories will be analyzed and
only the last ten artifacts will be kept; the integration will report
differential information with respect to the analysis done on the common
ancestor with xen-project/xen:staging (if available).

Additionaly any repository should be able to read a masked variable
named WTOKEN with the token provided by BUGSENG, otherwise the pipeline
will fail.

The analysis fails if it contains violations of guidelines tagged as
clean:added. The list of clean guidelines are maintained in
automation/eclair_analysis/ECLAIR/tagging.ecl.

Simone Ballarin (4):
  automation: Add ECLAIR utilities and settings
  automation: Add xen builds for the ECLAIR analyses
  automation: Add ECLAIR pipelines
  maintainers: Add ECLAIR reviewer

 .gitlab-ci.yml                                |   2 +
 MAINTAINERS                                   |   6 +
 automation/eclair_analysis/ECLAIR/Set1.ecl    |  59 ++++
 automation/eclair_analysis/ECLAIR/Set2.ecl    |  25 ++
 automation/eclair_analysis/ECLAIR/Set3.ecl    |  67 ++++
 .../eclair_analysis/ECLAIR/action.helpers     | 193 ++++++++++++
 .../eclair_analysis/ECLAIR/action.settings    | 172 ++++++++++
 .../ECLAIR/action_clean_added.sh              |  36 +++
 .../eclair_analysis/ECLAIR/action_log.sh      |  15 +
 .../ECLAIR/action_pull_request.sh             |  57 ++++
 .../eclair_analysis/ECLAIR/action_push.sh     |  95 ++++++
 .../ECLAIR/action_upload_sarif.sh             |  31 ++
 .../eclair_analysis/ECLAIR/analysis.ecl       |  25 ++
 automation/eclair_analysis/ECLAIR/analyze.sh  | 106 +++++++
 .../ECLAIR/call_properties.ecl                | 106 +++++++
 .../eclair_analysis/ECLAIR/deviations.ecl     | 298 ++++++++++++++++++
 .../eclair_analysis/ECLAIR/out_of_scope.ecl   | 127 ++++++++
 .../ECLAIR/print_analyzed_files.sh            |  66 ++++
 .../eclair_analysis/ECLAIR/public_APIs.ecl    |   6 +
 automation/eclair_analysis/ECLAIR/report.ecl  |   4 +
 automation/eclair_analysis/ECLAIR/tagging.ecl |  34 ++
 .../eclair_analysis/ECLAIR/toolchain.ecl      | 275 ++++++++++++++++
 automation/eclair_analysis/Makefile.prepare   |   6 +
 automation/eclair_analysis/build.sh           |  44 +++
 automation/eclair_analysis/prepare.sh         |  42 +++
 automation/eclair_analysis/xen_arm_config     | 147 +++++++++
 automation/eclair_analysis/xen_x86_config     | 152 +++++++++
 automation/gitlab-ci/analyze.yaml             |  38 +++
 automation/gitlab-ci/build.yaml               |   1 +
 automation/scripts/eclair                     |  34 ++
 30 files changed, 2269 insertions(+)
 create mode 100644 automation/eclair_analysis/ECLAIR/Set1.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/Set2.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/Set3.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/action.helpers
 create mode 100644 automation/eclair_analysis/ECLAIR/action.settings
 create mode 100755 automation/eclair_analysis/ECLAIR/action_clean_added.sh
 create mode 100755 automation/eclair_analysis/ECLAIR/action_log.sh
 create mode 100644 automation/eclair_analysis/ECLAIR/action_pull_request.sh
 create mode 100755 automation/eclair_analysis/ECLAIR/action_push.sh
 create mode 100755 automation/eclair_analysis/ECLAIR/action_upload_sarif.sh
 create mode 100644 automation/eclair_analysis/ECLAIR/analysis.ecl
 create mode 100755 automation/eclair_analysis/ECLAIR/analyze.sh
 create mode 100644 automation/eclair_analysis/ECLAIR/call_properties.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/deviations.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/out_of_scope.ecl
 create mode 100755 automation/eclair_analysis/ECLAIR/print_analyzed_files.sh
 create mode 100644 automation/eclair_analysis/ECLAIR/public_APIs.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/report.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/tagging.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/toolchain.ecl
 create mode 100644 automation/eclair_analysis/Makefile.prepare
 create mode 100755 automation/eclair_analysis/build.sh
 create mode 100755 automation/eclair_analysis/prepare.sh
 create mode 100644 automation/eclair_analysis/xen_arm_config
 create mode 100644 automation/eclair_analysis/xen_x86_config
 create mode 100644 automation/gitlab-ci/analyze.yaml
 create mode 100755 automation/scripts/eclair

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 14:57:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 14:57:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569765.890836 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJU6-0004gh-EW; Tue, 25 Jul 2023 14:57:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569765.890836; Tue, 25 Jul 2023 14:57:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJU6-0004ga-9A; Tue, 25 Jul 2023 14:57:58 +0000
Received: by outflank-mailman (input) for mailman id 569765;
 Tue, 25 Jul 2023 14:57:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=p13o=DL=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qOJU4-0004O3-KI
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 14:57:57 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a25ed720-2afb-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 16:57:54 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.75.91])
 by support.bugseng.com (Postfix) with ESMTPSA id 671434EE0739;
 Tue, 25 Jul 2023 16:57:53 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a25ed720-2afb-11ee-b23f-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: [XEN PATCH 1/4] automation: Add ECLAIR utilities and settings
Date: Tue, 25 Jul 2023 16:55:54 +0200
Message-Id: <5ee65af94a3bccf64b283a6206b05880c9ae6732.1690294965.git.simone.ballarin@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690294965.git.simone.ballarin@bugseng.com>
References: <cover.1690294965.git.simone.ballarin@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

The files with extension ecl are ECLAIR configurations that
are loaded during the analysis phase or during the report
generation phase: analysis.ecl is the main file for the analysis
phase, while reports.ecl is the one for the report phase.
All other ecl files are included by one of the two main ones.

The actions* scripts implement the integration with the CI server,
they are completely general and can be amended to work with any CI
server. Their presence in xen.git is recommended so that maintainance
would be easier.

analyze.sh is the script that actually triggers the analysis.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

--
Changes in v3:
- split ECLAIR configurations and scripts in a separate patch;
- remove references to "Task (a): Xen Coding Guidelines v1.0".

Changes in v2:
- add ECLAIR configuration files (before they were fetched from a separate
    repository);
- now the pipeline fails if there are new violations of guidelines tagged
    with clean:added.
---
 automation/eclair_analysis/ECLAIR/Set1.ecl    |  59 ++++
 automation/eclair_analysis/ECLAIR/Set2.ecl    |  25 ++
 automation/eclair_analysis/ECLAIR/Set3.ecl    |  67 ++++
 .../eclair_analysis/ECLAIR/action.helpers     | 193 ++++++++++++
 .../eclair_analysis/ECLAIR/action.settings    | 172 ++++++++++
 .../ECLAIR/action_clean_added.sh              |  36 +++
 .../eclair_analysis/ECLAIR/action_log.sh      |  15 +
 .../ECLAIR/action_pull_request.sh             |  57 ++++
 .../eclair_analysis/ECLAIR/action_push.sh     |  95 ++++++
 .../ECLAIR/action_upload_sarif.sh             |  31 ++
 .../eclair_analysis/ECLAIR/analysis.ecl       |  25 ++
 automation/eclair_analysis/ECLAIR/analyze.sh  | 106 +++++++
 .../ECLAIR/call_properties.ecl                | 106 +++++++
 .../eclair_analysis/ECLAIR/deviations.ecl     | 298 ++++++++++++++++++
 .../eclair_analysis/ECLAIR/out_of_scope.ecl   | 127 ++++++++
 .../ECLAIR/print_analyzed_files.sh            |  66 ++++
 .../eclair_analysis/ECLAIR/public_APIs.ecl    |   6 +
 automation/eclair_analysis/ECLAIR/report.ecl  |   4 +
 automation/eclair_analysis/ECLAIR/tagging.ecl |  34 ++
 .../eclair_analysis/ECLAIR/toolchain.ecl      | 275 ++++++++++++++++
 20 files changed, 1797 insertions(+)
 create mode 100644 automation/eclair_analysis/ECLAIR/Set1.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/Set2.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/Set3.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/action.helpers
 create mode 100644 automation/eclair_analysis/ECLAIR/action.settings
 create mode 100755 automation/eclair_analysis/ECLAIR/action_clean_added.sh
 create mode 100755 automation/eclair_analysis/ECLAIR/action_log.sh
 create mode 100644 automation/eclair_analysis/ECLAIR/action_pull_request.sh
 create mode 100755 automation/eclair_analysis/ECLAIR/action_push.sh
 create mode 100755 automation/eclair_analysis/ECLAIR/action_upload_sarif.sh
 create mode 100644 automation/eclair_analysis/ECLAIR/analysis.ecl
 create mode 100755 automation/eclair_analysis/ECLAIR/analyze.sh
 create mode 100644 automation/eclair_analysis/ECLAIR/call_properties.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/deviations.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/out_of_scope.ecl
 create mode 100755 automation/eclair_analysis/ECLAIR/print_analyzed_files.=
sh
 create mode 100644 automation/eclair_analysis/ECLAIR/public_APIs.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/report.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/tagging.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/toolchain.ecl

diff --git a/automation/eclair_analysis/ECLAIR/Set1.ecl b/automation/eclair=
_analysis/ECLAIR/Set1.ecl
new file mode 100644
index 0000000000..86b8e7e772
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/Set1.ecl
@@ -0,0 +1,59 @@
+-doc_begin=3D"Set 1 of Xen MISRA C guidelines"
+-enable=3DMC3R1.R9.1
+-enable=3DMC3R1.R12.5
+-enable=3DMC3R1.R17.3
+-enable=3DMC3R1.R17.4
+-enable=3DMC3R1.R17.6
+-enable=3DMC3R1.R19.1
+-enable=3DMC3R1.R21.13
+-enable=3DMC3R1.R21.17
+-enable=3DMC3R1.R21.18
+-enable=3DMC3R1.R21.19
+-enable=3DMC3R1.R21.20
+-enable=3DMC3R1.R21.21
+-enable=3DMC3R1.R22.2
+-enable=3DMC3R1.R22.4
+-enable=3DMC3R1.R22.5
+-enable=3DMC3R1.R22.6
+-enable=3DMC3R1.D1.1
+-enable=3DMC3R1.D2.1
+-enable=3DMC3R1.D4.1
+-enable=3DMC3R1.D4.3
+-enable=3DMC3R1.D4.7
+-enable=3DMC3R1.D4.10
+-enable=3DMC3R1.D4.11
+-enable=3DMC3R1.D4.14
+-enable=3DMC3R1.R1.1
+-enable=3DMC3R1.R1.3
+-enable=3DMC3R1.R1.4
+-enable=3DMC3R1.R2.1
+-enable=3DMC3R1.R2.2
+-enable=3DMC3R1.R3.1
+-enable=3DMC3R1.R3.2
+-enable=3DMC3R1.R4.1
+-enable=3DMC3R1.R5.1
+-enable=3DMC3R1.R5.2
+-enable=3DMC3R1.R5.3
+-enable=3DMC3R1.R5.4
+-enable=3DMC3R1.R5.6
+-enable=3DMC3R1.R6.1
+-enable=3DMC3R1.R6.2
+-enable=3DMC3R1.R7.1
+-enable=3DMC3R1.R7.2
+-enable=3DMC3R1.R7.3
+-enable=3DMC3R1.R7.4
+-enable=3DMC3R1.R8.1
+-enable=3DMC3R1.R8.2
+-enable=3DMC3R1.R8.3
+-enable=3DMC3R1.R8.4
+-enable=3DMC3R1.R8.5
+-enable=3DMC3R1.R8.6
+-enable=3DMC3R1.R8.8
+-enable=3DMC3R1.R8.10
+-enable=3DMC3R1.R8.12
+-enable=3DMC3R1.R8.14
+-enable=3DMC3R1.R9.2
+-enable=3DMC3R1.R9.3
+-enable=3DMC3R1.R9.4
+-enable=3DMC3R1.R9.5
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/Set2.ecl b/automation/eclair=
_analysis/ECLAIR/Set2.ecl
new file mode 100644
index 0000000000..7608335cf4
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/Set2.ecl
@@ -0,0 +1,25 @@
+-doc_begin=3D"Set 2 of Xen MISRA C guidelines"
+-enable=3DMC3R1.R10.1
+-enable=3DMC3R1.R10.2
+-enable=3DMC3R1.R10.3
+-enable=3DMC3R1.R10.4
+-enable=3DMC3R1.R10.6
+-enable=3DMC3R1.R10.7
+-enable=3DMC3R1.R10.8
+-enable=3DMC3R1.R11.1
+-enable=3DMC3R1.R11.2
+-enable=3DMC3R1.R11.3
+-enable=3DMC3R1.R11.6
+-enable=3DMC3R1.R11.7
+-enable=3DMC3R1.R11.8
+-enable=3DMC3R1.R11.9
+-enable=3DMC3R1.R12.2
+-enable=3DMC3R1.R13.1
+-enable=3DMC3R1.R13.2
+-enable=3DMC3R1.R13.5
+-enable=3DMC3R1.R13.6
+-enable=3DMC3R1.R14.1
+-enable=3DMC3R1.R14.2
+-enable=3DMC3R1.R14.3
+-enable=3DMC3R1.R14.4
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/Set3.ecl b/automation/eclair=
_analysis/ECLAIR/Set3.ecl
new file mode 100644
index 0000000000..d2c2c4b21f
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/Set3.ecl
@@ -0,0 +1,67 @@
+-doc_begin=3D"Set 3 of Xen MISRA C guidelines"
+-enable=3DMC3R1.D4.12
+-enable=3DMC3R1.R5.5
+-enable=3DMC3R1.R5.7
+-enable=3DMC3R1.R5.8
+-enable=3DMC3R1.R15.2
+-enable=3DMC3R1.R15.3
+-enable=3DMC3R1.R15.6
+-enable=3DMC3R1.R15.7
+-enable=3DMC3R1.R16.1
+-enable=3DMC3R1.R16.2
+-enable=3DMC3R1.R16.3
+-enable=3DMC3R1.R16.4
+-enable=3DMC3R1.R16.5
+-enable=3DMC3R1.R16.6
+-enable=3DMC3R1.R16.7
+-enable=3DMC3R1.R17.1
+-enable=3DMC3R1.R17.2
+-enable=3DMC3R1.R17.5
+-enable=3DMC3R1.R17.7
+-enable=3DMC3R1.R18.1
+-enable=3DMC3R1.R18.2
+-enable=3DMC3R1.R18.3
+-enable=3DMC3R1.R18.6
+-enable=3DMC3R1.R18.7
+-enable=3DMC3R1.R18.8
+-enable=3DMC3R1.R20.2
+-enable=3DMC3R1.R20.3
+-enable=3DMC3R1.R20.4
+-enable=3DMC3R1.R20.6
+-enable=3DMC3R1.R20.7
+-enable=3DMC3R1.R20.8
+-enable=3DMC3R1.R20.9
+-enable=3DMC3R1.R20.11
+-enable=3DMC3R1.R20.12
+-enable=3DMC3R1.R20.13
+-enable=3DMC3R1.R20.14
+-enable=3DMC3R1.R21.1
+-enable=3DMC3R1.R21.2
+-enable=3DMC3R1.R21.3
+-enable=3DMC3R1.R21.4
+-enable=3DMC3R1.R21.5
+-enable=3DMC3R1.R21.6
+-enable=3DMC3R1.R21.7
+-enable=3DMC3R1.R21.8
+-enable=3DMC3R1.R21.9
+-enable=3DMC3R1.R21.10
+-enable=3DMC3R1.R21.12
+-enable=3DMC3R1.R21.14
+-enable=3DMC3R1.R21.15
+-enable=3DMC3R1.R21.16
+-enable=3DMC3R1.R22.1
+-enable=3DMC3R1.R22.3
+-enable=3DMC3R1.R22.7
+-enable=3DMC3R1.R22.8
+-enable=3DMC3R1.R22.9
+-enable=3DMC3R1.R22.10
+-enable=3DMC3R1.R2.6
+-enable=3DMC3R1.R4.2
+-doc_end
+
+-doc_begin=3D"Guidelines added with Xen MISRA C Task (a): Xen Coding Guide=
lines v1.1, June 1, 2023"
+-enable=3DMC3R1.R21.11
+-enable=3DMC3R1.D4.4
+-enable=3DMC3R1.R8.9
+-enable=3DMC3R1.R12.4
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/action.helpers b/automation/=
eclair_analysis/ECLAIR/action.helpers
new file mode 100644
index 0000000000..2ad6428eaa
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action.helpers
@@ -0,0 +1,193 @@
+if [ -n "${GITLAB_CI:-}" ]; then
+    ci=3Dgitlab
+elif [ -n "${GITHUB_ACTION:-}" ]; then
+    ci=3Dgithub
+elif [ -n "${JENKINS_HOME:-}" ]; then
+    ci=3Djenkins
+else
+    echo "Unexpected CI/CD context" >&2
+    exit 1
+fi
+
+esc=3D$(printf '\e')
+cr=3D$(printf '\r')
+
+open_section() {
+    id=3D$1
+    title=3D$2
+    collapsed=3D$3
+    echo "${esc}[0Ksection_start:$(date +%s):${id}${collapsed}${cr}${esc}[=
0K${esc}[1m${esc}[36m${title}${esc}[m"
+}
+
+close_section() {
+    id=3D$1
+    echo "${esc}[0Ksection_end:$(date +%s):${id}${cr}${esc}[0K"
+}
+
+summary() {
+    fixedReports=3D
+    newReports=3D
+    unfixedReports=3D
+    while read -r line; do
+        var=3D${line%%: *}
+        val=3D${line#*: }
+        eval "${var}=3D${val}"
+    done <"${updateLog}"
+
+    case "${ci}" in
+    github)
+        nl=3D"\\"
+        ;;
+    gitlab)
+        nl=3D
+        ;;
+    jenkins)
+        nl=3D"<br/>"
+        ;;
+    *)
+        nl=3D
+        ;;
+    esac
+
+    if [ -z "${newReports}" ]; then
+        fixedMsg=3D
+        unfixedMsg=3D"Unfixed reports: ${unfixedReports}"
+        countsMsg=3D"${unfixedMsg}"
+    else
+        fixedMsg=3D"Fixed reports: ${fixedReports}"
+        unfixedMsg=3D"Unfixed reports: ${unfixedReports} [new: ${newReport=
s}]"
+        countsMsg=3D"${fixedMsg}${nl}
+${unfixedMsg}"
+    fi
+    case "${ci}" in
+    jenkins)
+        cat <<EOF >"${summaryTxt}"
+${countsMsg}                                                              =
                ${nl}
+<a href=3D"https://www.bugseng.com/eclair">
+  <img src=3D"${eclairReportUrlPrefix}/rsrc/eclair.svg" width=3D"100" />
+</a>
+<h3>${jobHeadline}</h3>
+<a href=3D"${indexHtmlUrl}">Browse analysis results</a>
+EOF
+        ;;
+    *)
+        cat <<EOF >"${summaryTxt}"
+<a href=3D"https://www.bugseng.com/eclair">
+  <img src=3D"${eclairReportUrlPrefix}/rsrc/eclair.svg" width=3D"100" />
+</a>
+Analysis Summary
+
+${jobHeadline}${nl}
+${countsMsg}${nl}
+[Browse analysis](${indexHtmlUrl})
+EOF
+        ;;
+    esac
+
+    case ${ci} in
+    github)
+        cat "${summaryTxt}" >"${GITHUB_STEP_SUMMARY}"
+        ;;
+    gitlab)
+        open_section ECLAIR_summary "ECLAIR analysis summary" ""
+        # Generate summary and print it (GitLab-specific)
+        cat <<EOF
+${jobHeadline}
+${countsMsg}
+Browse analysis: ${esc}[33m${indexHtmlUrl}${esc}[m
+EOF
+        close_section ECLAIR_summary
+        ;;
+    jenkins)
+        cat <<EOF
+${jobHeadline}
+${fixedMsg}
+${unfixedMsg}
+Browse analysis: ${indexHtmlUrl}
+EOF
+        ;;
+    *)
+        echo "Unexpected CI/CD context" >&2
+        exit 1
+        ;;
+    esac
+}
+
+log_file() {
+    section_id=3D$1
+    section_name=3D$2
+    file=3D$3
+    exit_code=3D$4
+    if [ "${exit_code}" =3D 0 ]; then
+        collapsed=3D[collapsed=3Dtrue]
+    else
+        collapsed=3D
+    fi
+
+    case ${ci} in
+    github | jenkins)
+        echo "${section_name}"
+        ;;
+    gitlab)
+        open_section "${section_id}" "${section_name}" "${collapsed}"
+        ;;
+    *)
+        echo "Unexpected CI/CD context" >&2
+        exit 1
+        ;;
+    esac
+
+    cat "${file}"
+
+    case ${ci} in
+    github | jenkins) ;;
+    gitlab)
+        close_section "${section_id}"
+        ;;
+    *) ;;
+    esac
+}
+
+maybe_log_file_exit() {
+    section_id=3D$1
+    section_name=3D$2
+    file=3D$3
+    exit_code=3D$4
+
+    case ${ci} in
+    github | jenkins)
+        echo "${section_name}"
+        ;;
+    gitlab)
+        open_section "${section_id}" "${section_name}" ""
+        ;;
+    *)
+        echo "Unexpected CI/CD context" >&2
+        exit 1
+        ;;
+    esac
+
+    if [ "${exit_code}" !=3D 0 ]; then
+        cat "${file}"
+    fi
+
+    case ${ci} in
+    github | jenkins) ;;
+    gitlab)
+        close_section "${section_id}"
+        ;;
+    *) ;;
+    esac
+    return "${exit_code}"
+}
+
+is_enabled() {
+    case "$1" in
+    true | TRUE | y | Y | yes | YES | 1)
+        return 0
+        ;;
+    *)
+        return 1
+        ;;
+    esac
+}
diff --git a/automation/eclair_analysis/ECLAIR/action.settings b/automation=
/eclair_analysis/ECLAIR/action.settings
new file mode 100644
index 0000000000..0f7950f5ab
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action.settings
@@ -0,0 +1,172 @@
+variantSubDir=3D
+variantHeadline=3D
+if [ -n "${VARIANT:-}" ]; then
+    variantSubDir=3D"/${VARIANT}"
+    variantHeadline=3D" [${VARIANT}]"
+fi
+
+# AUTO PR Feature
+# If the following variables are defined, then all pipelines
+# of other branches will be considered pull-requests to
+# autoPRBranch.
+# Customized
+autoPRRepository=3D"${AUTO_PR_REPOSITORY:-}"
+# Customized
+autoPRBranch=3D"${AUTO_PR_BRANCH:-}"
+
+# Customized
+artifactsRoot=3D/var/local/eclair
+
+case "${ci}" in
+github)
+    # To be customized
+    repository=3D"${GITHUB_REPOSITORY}"
+    jobId=3D"${GITHUB_RUN_NUMBER}"
+
+    autoPRRemoteUrl=3D"${GITHUB_SERVER_URL}/${autoPRRepository:-}"
+
+    case "${GITHUB_EVENT_NAME}" in
+    pull_request*)
+        event=3Dpull_request
+        pullRequestId=3D"${GITHUB_EVENT_PULL_REQUEST_NUMBER}"
+        pullRequestHeadRepo=3D"${PR_HEAD_REPO}"
+        pullRequestHeadRef=3D"${PR_HEAD_REF}"
+        pullRequestBaseRef=3D"${PR_BASE_REF}"
+        pullRequestUser=3D"${PR_USER}"
+        # baseCommitId and headCommitId are the most recent merge points w=
ithout conflicts
+        git fetch -q --deepen=3D2
+        baseCommitId=3D$(git show -s --pretty=3D%H HEAD^1)
+        headCommitId=3D$(git show -s --pretty=3D%H HEAD^2)
+        ;;
+    push | workflow_dispatch)
+        event=3Dpush
+        # Extract the branch name from "refs/heads/<branch>"
+        branch=3D"${GITHUB_REF#refs/heads/}"
+        headCommitId=3D"${GITHUB_SHA}"
+        pushUser=3D"${GITHUB_ACTOR}"
+        ;;
+    *)
+        echo "Unexpected GITHUB_REF ${GITHUB_REF}" >&2
+        exit 1
+        ;;
+    esac
+    ;;
+gitlab)
+    # Customized
+    repository=3D"${CI_PROJECT_PATH}"
+    jobId=3D"${CI_JOB_ID}"
+
+    gitlabApiUrl=3D"${CI_SERVER_PROTOCOL}://${CI_SERVER_HOST}:${CI_SERVER_=
PORT}/api/v4"
+    autoPRRemoteUrl=3D"${CI_SERVER_PROTOCOL}://${CI_SERVER_HOST}:${CI_SERV=
ER_PORT}/${autoPRRepository:-}"
+
+    # Customized
+    gitlabBotToken=3D"${ECLAIR_BOT_TOKEN:-}"
+
+    case "${CI_PIPELINE_SOURCE}" in
+    merge_request_event)
+        event=3Dpull_request
+        pullRequestId=3D"${CI_MERGE_REQUEST_IID}"
+        pullRequestHeadRef=3D"${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
+        pullRequestHeadRepo=3D"${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH}"
+        pullRequestBaseRef=3D"${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}"
+        pullRequestUser=3D"${GITLAB_USER_LOGIN}"
+        headCommitId=3D"${CI_COMMIT_SHA}"
+        baseCommitId=3D"${CI_MERGE_REQUEST_DIFF_BASE_SHA}"
+        ;;
+    push | pipeline | web)
+        event=3Dpush
+        branch=3D"${CI_COMMIT_BRANCH}"
+        headCommitId=3D"${CI_COMMIT_SHA}"
+        pushUser=3D"${GITLAB_USER_NAME}"
+        ;;
+    *)
+        echo "Unexpected event ${CI_PIPELINE_SOURCE}" >&2
+        exit 1
+        ;;
+    esac
+    ;;
+jenkins)
+    # To be customized
+    repository=3D"${JOB_BASE_NAME}"
+    project=3D"${JOB_NAME}"
+    jobId=3D"${BUILD_NUMBER}"
+
+    jenkinsApiUrl=3D"${JENKINS_URL}"
+    autoPRRemoteUrl=3D"${JENKINS_URL}/${autoPRRepository:-}"
+
+    # To be customized
+    jenkinsBotUsername=3D"${ECLAIR_BOT_USERNAME:-}"
+    jenkinsBotToken=3D"${ECLAIR_BOT_TOKEN:-}"
+
+    event=3Dpush
+    branch=3D"${GIT_BRANCH}"
+    headCommitId=3D"${GIT_COMMIT}"
+    pushUser=3D$(git show --pretty=3D'format:%aN' -s)
+    ;;
+*)
+    echo "Unexpected CI/CD context" >&2
+    exit 1
+    ;;
+esac
+
+if [ "${event}" =3D "push" ] && [ -n "${autoPRBranch:-}" ]; then
+    # AUTO PR Feature enabled
+    if ! [ "${branch}" =3D "${autoPRBranch}" ] ||
+        ! [ "${repository}" =3D "${autoPRRepository}" ]; then
+        event=3Dauto_pull_request
+    fi
+fi
+
+case "${event}" in
+pull_request)
+    subDir=3D"${pullRequestHeadRepo}.ecdf/${pullRequestBaseRef}"
+    jobHeadline=3D"ECLAIR ${ANALYSIS_KIND} on repository ${repository}: ${=
pullRequestUser} wants to merge ${pullRequestHeadRepo}:${pullRequestHeadRef=
} (${headCommitId}) into ${pullRequestBaseRef} (${baseCommitId})"
+    ;;
+push)
+    subDir=3D"${branch}"
+    jobHeadline=3D"ECLAIR ${ANALYSIS_KIND} on repository ${repository}: br=
anch ${branch} (${headCommitId})"
+    badgeLabel=3D"ECLAIR ${ANALYSIS_KIND} ${branch}${variantHeadline} #${j=
obId}"
+    ;;
+auto_pull_request)
+    git remote remove autoPRRemote || true
+    git remote add autoPRRemote "${autoPRRemoteUrl}"
+    git fetch autoPRRemote
+    subDir=3D"${branch}"
+    baseCommitId=3D$(git merge-base "autoPRRemote/${autoPRBranch}" HEAD)
+    jobHeadline=3D"ECLAIR ${ANALYSIS_KIND} on repository ${repository}: ${=
pushUser} wants to merge ${repository}:${branch} (${headCommitId}) into ${a=
utoPRRepository}/${autoPRBranch} (${baseCommitId})"
+    ;;
+*)
+    echo "Unexpected event ${event}" >&2
+    exit 1
+    ;;
+esac
+
+case "${repository}" in
+xen-project/xen)
+    # Customized
+    keepOldAnalyses=3D0
+    ;;
+xen-project/*)
+    # Customized
+    keepOldAnalyses=3D10
+    ;;
+*)
+    echo "Unexpected repository" >&2
+    exit 1
+    ;;
+esac
+
+ECLAIR_BIN_DIR=3D/opt/bugseng/eclair/bin/
+
+artifactsDir=3D"${artifactsRoot}/xen-project.ecdf/${repository}/ECLAIR_${A=
NALYSIS_KIND}"
+subDir=3D"${subDir}${variantSubDir}"
+jobHeadline=3D"${jobHeadline}${variantHeadline}"
+
+# Customized
+eclairReportUrlPrefix=3Dhttps://saas.eclairit.com:3787
+
+jobDir=3D"${artifactsDir}/${subDir}/${jobId}"
+updateLog=3D"${analysisOutputDir}/update.log"
+commentLog=3D"${analysisOutputDir}/comment.json"
+indexHtmlUrl=3D"${eclairReportUrlPrefix}/fs${jobDir}/index.html"
+summaryTxt=3D"${analysisOutputDir}/summary.txt"
diff --git a/automation/eclair_analysis/ECLAIR/action_clean_added.sh b/auto=
mation/eclair_analysis/ECLAIR/action_clean_added.sh
new file mode 100755
index 0000000000..59bc35fd13
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action_clean_added.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -eu
+
+usage() {
+    echo "Usage: $0 ANALYSIS_OUTPUT_DIR" >&2
+    exit 2
+}
+
+[ $# -eq 1 ] || usage
+
+analysisOutputDir=3D$1
+
+cleanAddedTxt=3D"${analysisOutputDir}/clean_added.log"
+
+# Load settings and helpers
+. "$(dirname "$0")/action.helpers"
+. "$(dirname "$0")/action.settings"
+
+unexpectedReports=3D$("${ECLAIR_BIN_DIR}eclair_report" \
+    "-db=3D'${analysisOutputDir}/PROJECT.ecd'" \
+    "-sel_unfixed=3Dunfixed" \
+    "-sel_tag_glob=3Dclean_added,clean,added" \
+    "-print=3D'',reports_count()")
+
+if [ "${unexpectedReports}" -gt 0 ]; then
+    cat <<EOF >"${cleanAddedTxt}"
+Failure: ${unexpectedReports} unexpected reports found.
+Unexpected reports are tagged 'clean:added'.
+EOF
+    exit 1
+else
+    cat <<EOF >"${cleanAddedTxt}"
+Success: No unexpected reports.
+EOF
+fi
diff --git a/automation/eclair_analysis/ECLAIR/action_log.sh b/automation/e=
clair_analysis/ECLAIR/action_log.sh
new file mode 100755
index 0000000000..67125b08f3
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action_log.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -eu
+
+usage() {
+    echo "Usage: $0 SECTION_ID SECTION_NAME FILE EXIT_CODE" >&2
+    exit 2
+}
+
+[ $# -eq 4 ] || usage
+
+# Load settings and helpers
+. "$(dirname "$0")/action.helpers"
+
+log_file "$@"
diff --git a/automation/eclair_analysis/ECLAIR/action_pull_request.sh b/aut=
omation/eclair_analysis/ECLAIR/action_pull_request.sh
new file mode 100644
index 0000000000..68f7e6282e
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+set -eu
+
+usage() {
+    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR COMMIT_ID" >&2
+    exit 2
+}
+
+[ $# -eq 2 ] || usage
+
+wtoken=3D$1
+analysisOutputDir=3D$2
+
+# Load settings and helpers
+. "$(dirname "$0")/action.helpers"
+. "$(dirname "$0")/action.settings"
+
+curl -sS "${eclairReportUrlPrefix}/ext/update_pull_request" \
+    -F "wtoken=3D${wtoken}" \
+    -F "artifactsDir=3D${artifactsDir}" \
+    -F "subDir=3D${subDir}" \
+    -F "jobId=3D${jobId}" \
+    -F "jobHeadline=3D${jobHeadline}" \
+    -F "baseCommitId=3D${baseCommitId}" \
+    -F "keepOldAnalyses=3D${keepOldAnalyses}" \
+    -F "db=3D@${analysisOutputDir}/PROJECT.ecd" \
+    >"${updateLog}"
+ex=3D0
+grep -Fq "unfixedReports: " "${updateLog}" || ex=3D$?
+maybe_log_file_exit PUBLISH_RESULT "Publishing results" "${updateLog}" "${=
ex}"
+
+summary
+
+if is_enabled "${ENABLE_ECLAIR_BOT:-}"; then
+    case ${ci} in
+    github)
+        ex=3D0
+        gh api \
+            --method POST \
+            "/repos/${repository}/issues/${pullRequestId}/comments" \
+            -F "body=3D@${summaryTxt}" \
+            --silent >"${commentLog}" 2>&1 || ex=3D$?
+        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "=
${ex}"
+        ;;
+    gitlab)
+        curl -sS --request POST \
+            "${gitlabApiUrl}/projects/${CI_PROJECT_ID}/merge_requests/${pu=
llRequestId}/notes" \
+            -H "PRIVATE-TOKEN: ${gitlabBotToken}" \
+            -F "body=3D<${summaryTxt}" >"${commentLog}"
+        ex=3D0
+        grep -Fq "Unfixed reports: " "${commentLog}" || ex=3D$?
+        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "=
${ex}"
+        ;;
+    *) ;;
+    esac
+fi
diff --git a/automation/eclair_analysis/ECLAIR/action_push.sh b/automation/=
eclair_analysis/ECLAIR/action_push.sh
new file mode 100755
index 0000000000..45215fbf00
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action_push.sh
@@ -0,0 +1,95 @@
+#!/bin/sh
+
+set -eu
+
+usage() {
+    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR" >&2
+    exit 2
+}
+
+[ $# -eq 2 ] || usage
+
+wtoken=3D$1
+analysisOutputDir=3D$2
+
+# Load settings and helpers
+. "$(dirname "$0")/action.helpers"
+. "$(dirname "$0")/action.settings"
+
+case "${event}" in
+push)
+    curl -sS "${eclairReportUrlPrefix}/ext/update_push" \
+        -F "wtoken=3D${wtoken}" \
+        -F "artifactsDir=3D${artifactsDir}" \
+        -F "subDir=3D${subDir}" \
+        -F "jobId=3D${jobId}" \
+        -F "jobHeadline=3D${jobHeadline}" \
+        -F "commitId=3D${headCommitId}" \
+        -F "badgeLabel=3D${badgeLabel}" \
+        -F "keepOldAnalyses=3D${keepOldAnalyses}" \
+        -F "db=3D@${analysisOutputDir}/PROJECT.ecd" \
+        >"${updateLog}"
+    ;;
+auto_pull_request)
+    curl -sS "${eclairReportUrlPrefix}/ext/update_pull_request" \
+        -F "wtoken=3D${wtoken}" \
+        -F "artifactsDir=3D${artifactsDir}" \
+        -F "subDir=3D${subDir}" \
+        -F "jobId=3D${jobId}" \
+        -F "jobHeadline=3D${jobHeadline}" \
+        -F "baseCommitId=3D${baseCommitId}" \
+        -F "keepOldAnalyses=3D${keepOldAnalyses}" \
+        -F "db=3D@${analysisOutputDir}/PROJECT.ecd" \
+        >"${updateLog}"
+    ;;
+*)
+    echo "Unexpected event ${event}" >&2
+    exit 1
+    ;;
+esac
+
+ex=3D0
+grep -Fq "unfixedReports: " "${updateLog}" || ex=3D$?
+maybe_log_file_exit PUBLISH_RESULT "Publishing results" "${updateLog}" "${=
ex}"
+
+summary
+
+if is_enabled "${ENABLE_ECLAIR_BOT:-}"; then
+    case ${ci} in
+    github)
+        ex=3D0
+        gh api \
+            --method POST \
+            "/repos/${repository}/commits/${headCommitId}/comments" \
+            -F "body=3D@${summaryTxt}" \
+            --silent >"${commentLog}" 2>&1 || ex=3D$?
+        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "=
${ex}"
+        ;;
+    gitlab)
+        curl -sS --request POST \
+            "${gitlabApiUrl}/projects/${CI_PROJECT_ID}/repository/commits/=
${CI_COMMIT_SHA}/comments" \
+            -H "PRIVATE-TOKEN: ${gitlabBotToken}" \
+            -F "note=3D<${summaryTxt}" >"${commentLog}"
+        ex=3D0
+        grep -Fq "Unfixed reports: " "${commentLog}" || ex=3D$?
+        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "=
${ex}"
+        ;;
+    jenkins)
+        ex=3D0
+        curl \
+            --user "${jenkinsBotUsername}:${jenkinsBotToken}" \
+            --data-urlencode "description=3D$(cat "${summaryTxt}")" \
+            --data-urlencode "Submit=3DSubmit" \
+            "${jenkinsApiUrl}job/${project}/${jobId}/submitDescription" \
+            >"${commentLog}" 2>&1 || ex=3D$?
+        curl \
+            --user "${jenkinsBotUsername}:${jenkinsBotToken}" \
+            --data-urlencode "description=3D$(cat "${summaryTxt}")" \
+            --data-urlencode "Submit=3DSubmit" \
+            "${jenkinsApiUrl}job/${project}/submitDescription" \
+            >"${commentLog}" 2>&1 || ex=3D$?
+        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "=
${ex}"
+        ;;
+    *) ;;
+    esac
+fi
diff --git a/automation/eclair_analysis/ECLAIR/action_upload_sarif.sh b/aut=
omation/eclair_analysis/ECLAIR/action_upload_sarif.sh
new file mode 100755
index 0000000000..60b8034fcc
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action_upload_sarif.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+set -eu
+
+usage() {
+    echo "Usage: $0 SARIF_FILE" >&2
+    exit 2
+}
+
+[ $# -eq 1 ] || usage
+
+HERE=3D$( (
+    cd "$(dirname "$0")"
+    echo "${PWD}"
+))
+
+. "${HERE}/action.helpers"
+
+sarifFile=3D$1
+sarifPayload=3D${HERE}/sarif.gz.b64
+uploadLog=3D${HERE}/upload_sarif.log
+
+gzip -c "${sarifFile}" | base64 -w0 >"${sarifPayload}"
+
+ex=3D0
+gh api --method POST -H "Accept: application/vnd.github+json" \
+    "/repos/${GITHUB_REPOSITORY}/code-scanning/sarifs" \
+    -f "commit_sha=3D${GITHUB_SHA}" -f "ref=3D${GITHUB_REF}" \
+    -F "sarif=3D@${sarifPayload}" \
+    --silent >"${uploadLog}" 2>&1 || ex=3D$?
+maybe_log_file_exit ADD_COMMENT "Uploading SARIF" "${uploadLog}" "${ex}"
diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/ec=
lair_analysis/ECLAIR/analysis.ecl
new file mode 100644
index 0000000000..fe418d6da1
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -0,0 +1,25 @@
+-setq=3Dset,getenv("SET")
+-project_name=3Dgetenv("ECLAIR_PROJECT_NAME")
+-project_root=3Dgetenv("ECLAIR_PROJECT_ROOT")
+
+-setq=3Ddata_dir,getenv("ECLAIR_DATA_DIR")
+
+-verbose
+
+-enable=3DB.REPORT.ECB
+-config=3DB.REPORT.ECB,output=3Djoin_paths(data_dir,"FRAME.@FRAME@.ecb")
+-config=3DB.REPORT.ECB,preprocessed=3Dshow
+-config=3DB.REPORT.ECB,macros=3D10
+
+-enable=3DB.EXPLAIN
+
+-eval_file=3Dtoolchain.ecl
+-eval_file=3Dpublic_APIs.ecl
+-eval_file=3Dout_of_scope.ecl
+-eval_file=3Ddeviations.ecl
+-eval_file=3Dcall_properties.ecl
+-eval_file=3Dtagging.ecl
+-eval_file=3Dconcat(set,".ecl")
+
+-doc=3D"Hide reports in external code."
+-reports+=3D{hide,all_exp_external}
diff --git a/automation/eclair_analysis/ECLAIR/analyze.sh b/automation/ecla=
ir_analysis/ECLAIR/analyze.sh
new file mode 100755
index 0000000000..47cdbb03ce
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/analyze.sh
@@ -0,0 +1,106 @@
+#!/bin/bash
+# Stop immediately if any executed command has exit status different from =
0.
+set -e
+set -o pipefail
+
+script_name=3D"$(basename "$0")"
+
+fatal() {
+  echo "${script_name}: $*" >&2
+  exit 1
+}
+
+usage() {
+  fatal "Usage: ${script_name} <ARM64|X86_64> <Set0|Set1|Set2|Set3>"
+}
+
+if [[ $# -ne 2 ]]; then
+  usage
+fi
+
+# Absolute path of the ECLAIR bin directory.
+export ECLAIR_BIN_DIR=3D/opt/bugseng/eclair/bin/
+
+# Directory where this script resides: usually in a directory named "ECLAI=
R".
+SCRIPT_DIR=3D"$(
+  cd "$(dirname "$0")"
+  echo "${PWD}"
+)"
+# Directory where to put all ECLAIR output and temporary files.
+if [[ -z "${ECLAIR_OUTPUT_DIR:-}" ]]; then
+  ECLAIR_OUTPUT_DIR=3D"${PWD}/ECLAIR/out"
+fi
+
+export ECLAIR_DIAGNOSTICS_OUTPUT=3D"${ECLAIR_OUTPUT_DIR}/ANALYSIS.log"
+# Set the variable for the build log file.
+ECLAIR_BUILD_LOG=3D${ECLAIR_OUTPUT_DIR}/BUILD.log
+# Set the variable for the report log file.
+ECLAIR_REPORT_LOG=3D${ECLAIR_OUTPUT_DIR}/REPORT.log
+
+if [[ "$1" =3D "X86_64" ]]; then
+  export CROSS_COMPILE=3D
+  export XEN_TARGET_ARCH=3Dx86_64
+  EXTRA_ECLAIR_ENV_OPTIONS=3D-disable=3DMC3R1.R20.7
+elif [[ "$1" =3D "ARM64" ]]; then
+  export CROSS_COMPILE=3Daarch64-linux-gnu-
+  export XEN_TARGET_ARCH=3Darm64
+else
+  fatal "Unknown configuration: $1"
+fi
+
+VARIANT=3D"${XEN_TARGET_ARCH}"
+
+# Used in analysis.ecl
+case "$2" in
+Set0|Set1|Set2|Set3)
+  export SET=3D"$2"
+  ;;
+*)
+  fatal "Unknown configuration: $2"
+  ;;
+esac
+
+export CC_ALIASES=3D"${CROSS_COMPILE}gcc-12"
+export CXX_ALIASES=3D"${CROSS_COMPILE}g++-12"
+export LD_ALIASES=3D"${CROSS_COMPILE}ld"
+export AR_ALIASES=3D"${CROSS_COMPILE}ar"
+export AS_ALIASES=3D"${CROSS_COMPILE}as"
+export FILEMANIP_ALIASES=3D"cp mv ${CROSS_COMPILE}objcopy"
+
+# ECLAIR binary data directory and workspace.
+export ECLAIR_DATA_DIR=3D"${ECLAIR_OUTPUT_DIR}/.data"
+# ECLAIR workspace.
+export ECLAIR_WORKSPACE=3D"${ECLAIR_DATA_DIR}/eclair_workspace"
+
+# Identifies the particular build of the project.
+export ECLAIR_PROJECT_NAME=3D"XEN_${VARIANT}-${SET}"
+# All paths mentioned in ECLAIR reports that are below this directory
+# will be presented as relative to ECLAIR_PROJECT_ROOT.
+export ECLAIR_PROJECT_ROOT=3D"${PWD}"
+
+# Erase and recreate the output directory and the data directory.
+rm -rf "${ECLAIR_OUTPUT_DIR:?}/*"
+mkdir -p "${ECLAIR_DATA_DIR}"
+
+# Perform the build (from scratch) in an ECLAIR environment.
+"${ECLAIR_BIN_DIR}eclair_env" \
+    "-config_file=3D'${SCRIPT_DIR}/analysis.ecl'" \
+    "${EXTRA_ECLAIR_ENV_OPTIONS}" \
+  -- "${SCRIPT_DIR}/../build.sh" "$1" | tee "${ECLAIR_BUILD_LOG}"
+
+
+# Create the project database.
+PROJECT_ECD=3D"${ECLAIR_OUTPUT_DIR}/PROJECT.ecd"
+find "${ECLAIR_DATA_DIR}" -maxdepth 1 -name "FRAME.*.ecb" |
+  sort | xargs cat |
+  "${ECLAIR_BIN_DIR}eclair_report" \
+    "-create_db=3D'${PROJECT_ECD}'" \
+    -load=3D/dev/stdin > "${ECLAIR_REPORT_LOG}" 2>&1
+
+# Create the Jenkins reports file.
+"${ECLAIR_BIN_DIR}eclair_report" \
+  "-db=3D'${PROJECT_ECD}'" \
+  "-eval_file=3D'${SCRIPT_DIR}/report.ecl'" \
+  >> "${ECLAIR_REPORT_LOG}" 2>&1
+
+"${SCRIPT_DIR}/print_analyzed_files.sh" "${PROJECT_ECD}" "${ECLAIR_OUTPUT_=
DIR}"
diff --git a/automation/eclair_analysis/ECLAIR/call_properties.ecl b/automa=
tion/eclair_analysis/ECLAIR/call_properties.ecl
new file mode 100644
index 0000000000..3f7794bf8b
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/call_properties.ecl
@@ -0,0 +1,106 @@
+
+-call_properties+=3D{"name(printk)", {"pointee_write(1..=3Dnever)", "taken=
()"}}
+-call_properties+=3D{"name(debugtrace_printk)", {"pointee_write(1..=3Dneve=
r)", "taken()"}}
+-call_properties+=3D{"name(panic)", {"pointee_write(1..=3Dnever)", "taken(=
)"}}
+-call_properties+=3D{"macro(^domain_crash$)", {"pointee_write(2..=3Dnever)=
", "taken()"}}
+-call_properties+=3D{"macro(^(g?d|mm_)?printk$)", {"pointee_write(2..=3Dne=
ver)", "taken()"}}
+-call_properties+=3D{"macro(^guest_bug_on_failed$)", {"pointee_write(1=3Dn=
ever)", "taken()"}}
+-call_properties+=3D{"macro(^spin_lock_init_prof$)", {"pointee_write(2=3Dn=
ever)", "taken()"}}
+-call_properties+=3D{"macro(^sched_test_func$)", {"pointee_write(1..=3Dnev=
er)", "taken()"}}
+-call_properties+=3D{"macro(^dev_(info|warn)$)", {"pointee_write(1..=3Dnev=
er)", "taken()"}}
+-call_properties+=3D{"macro(^PAGING_DEBUG$)", {"pointee_write(1..=3Dnever)=
", "taken()"}}
+-call_properties+=3D{"macro(^ACPI_(WARNING|ERROR|INFO)$)", {"pointee_write=
(1..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(fdt_get_property_by_offset_)", {"pointee_write(=
3=3Dalways)", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(read_atomic_size)", {"pointee_write(2=3Dalways)=
", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(device_tree_get_reg)", {"pointee_write(4..=3Dal=
ways)", "pointee_read(4..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(dt_get_range)", {"pointee_write(3..=3Dalways)",=
 "pointee_read(3..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(parse_static_mem_prop)", {"pointee_write(2..=3D=
always)", "pointee_read(2..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(get_ttbr_and_gran_64bit)", {"pointee_write(1..2=
=3Dalways)", "pointee_read(1..2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(hvm_emulate_init_once)", {"pointee_write(1=3Dal=
ways)", "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(__vmread)", {"pointee_write(2=3Dalways)", "poin=
tee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(hvm_pci_decode_addr)", {"pointee_write(3=3Dalwa=
ys)", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(vpci_mmcfg_decode_addr)", {"pointee_write(3=3Da=
lways)", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(x86emul_decode)", {"pointee_write(1=3Dalways)",=
 "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(unmap_grant_ref)", {"pointee_write(2=3Dalways)"=
, "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(arm_smmu_cmdq_build_cmd)", {"pointee_write(1=3D=
always)", "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(pci_size_mem_bar)", {"pointee_write(4=3Dalways)=
", "pointee_read(4=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(_hvm_read_entry)", {"pointee_write(2=3Dalways)"=
, "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(hvm_map_guest_frame_rw)", {"pointee_write(3=3Da=
lways)", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(guest_cpuid)", {"pointee_write(4=3Dalways)", "p=
ointee_read(4=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(epte_get_entry_emt)", {"pointee_write(5=3Dalway=
s)", "pointee_read(5=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(mcheck_mca_logout)", {"pointee_write(3=3Dalways=
)", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(set_field_in_reg_u32)", {"pointee_write(5=3Dalw=
ays)", "pointee_read(5=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(alloc_affinity_masks)", {"pointee_write(1=3Dalw=
ays)", "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(xasprintf)", {"pointee_write(1=3Dalways)", "poi=
ntee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(find_non_smt)", {"pointee_write(2=3Dalways)", "=
pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(call_rcu)", {"pointee_write(1=3Dalways)", "poin=
tee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(getdomaininfo)", {"pointee_write(2=3Dalways)", =
"pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"^MAPPING_(INSERT|SEARCH)\\(.*$", {"pointee_write(2..=
=3Dalways)", "pointee_read(2..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(FormatDec)", {"pointee_write(2=3Dalways)", "poi=
ntee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(FormatHex)", {"pointee_write(3=3Dalways)", "poi=
ntee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(p2m_get_ioreq_server)", {"pointee_write(2=3Dalw=
ays)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(elf_memset_unchecked)", {"pointee_write(1=3Dalw=
ays)", "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(set_iommu_pte_present)", {"pointee_write(7=3Dal=
ways)", "pointee_read(7=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(clear_iommu_pte_present)", {"pointee_write(4=3D=
always)", "pointee_read(4=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(vcpu_runstate_get)", {"pointee_write(2=3Dalways=
)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(va_start)", {"pointee_write(1=3Dalways)", "poin=
tee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(sgi_target_init)", {"pointee_write(1=3Dalways)"=
, "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(get_hw_residencies)", {"pointee_write(2=3Dalway=
s)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(x86_cpu_policy_to_featureset)", {"pointee_write=
(2=3Dalways)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"^simple_strtou?ll?\\(.*$", {"pointee_write(2=3Dalway=
s)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(msi_compose_msg)", {"pointee_write(3=3Dalways)"=
, "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(print_tainted)", {"pointee_write(1=3Dalways)", =
"pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(get_hvm_registers)", {"pointee_write(3=3Dalways=
)", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(x86_insn_modrm)", {"pointee_write(2..3=3Dalways=
)", "pointee_read(2..3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(cpuid_count_leaf)", {"pointee_write(3=3Dalways)=
", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(rcu_lock_remote_domain_by_id)", {"pointee_write=
(2=3Dalways)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(cpuid_count)", {"pointee_write(3..=3Dalways)", =
"pointee_read(3..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(efi_boot_mem_unused)", {"pointee_write(1..=3Dal=
ways)", "pointee_read(1..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(collect_time_info)", {"pointee_write(2=3Dalways=
)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(setup_xstate_comp)", {"pointee_write(1=3Dalways=
)", "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(map_domain_gfn)", {"pointee_read(5=3Dnever)", "=
taken()"}}
+-call_properties+=3D{"name(fdt_getprop)", {"pointee_read(4=3Dnever)", "tak=
en()"}}
+-call_properties+=3D{"name(fdt_get_name)", {"pointee_read(3=3Dnever)", "ta=
ken()"}}
+-call_properties+=3D{"name(fdt_get_property)", {"pointee_read(4=3Dnever)",=
 "taken()"}}
+-call_properties+=3D{"name(pci_get_host_bridge_segment)", {"pointee_read(2=
=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(dt_get_property)", {"pointee_read(3=3Dnever)", =
"taken()"}}
+-call_properties+=3D{"name(dt_property_read_u32)", {"pointee_read(3=3Dneve=
r)", "taken()"}}
+-call_properties+=3D{"name(dt_device_get_paddr)", {"pointee_read(3..4=3Dne=
ver)", "taken()"}}
+-call_properties+=3D{"name(get_evtchn_dt_property)", {"pointee_write(2..3=
=3Dmaybe)", "pointee_read(2..3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(setup_chosen_node)", {"pointee_write(2..3=3Dmay=
be)", "pointee_read(2..3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(queue_remove_raw)", {"pointee_read(2=3Dnever)",=
 "taken()"}}
+-call_properties+=3D{"macro(^memset$)", {"pointee_write(1=3Dalways)", "poi=
ntee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"macro(^va_start$)", {"pointee_write(1=3Dalways)", "p=
ointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"macro(^memcmp$)", {"pointee_write(1..2=3Dnever)", "t=
aken()"}}
+-call_properties+=3D{"macro(^memcpy$)", {"pointee_write(1=3Dalways&&2..=3D=
never)", "pointee_read(1=3Dnever&&2..=3Dalways)", "taken()"}}
+
+-doc_begin=3D"Property inferred as a consequence of the semantics of devic=
e_tree_get_reg"
+-call_properties+=3D{"name(acquire_static_memory_bank)", {"pointee_write(4=
..=3Dalways)", "pointee_read(4..=3Dnever)", "taken()"}}
+-doc_end
+
+-doc_begin=3D"Property inferred as a consequence of the semantics of dt_se=
t_cell"
+-call_properties+=3D{"name(set_interrupt)", {"pointee_write(1=3Dalways)", =
"pointee_read(1=3Dnever)", "taken()"}}
+-doc_end
+
+-doc_begin=3D"Property inferred as a consequence of the semantics of __p2m=
_get_mem_access"
+-call_properties+=3D{"name(p2m_get_mem_access)", {"pointee_write(3=3Dalway=
s)", "pointee_read(3=3Dnever)", "taken()"}}
+-doc_end
+
+-doc_begin=3D"This function has alternative definitions with props {write=
=3Dalways,read=3Dnever} and {write=3Dnever,read=3Dnever}"
+-call_properties+=3D{"name(alloc_cpumask_var)", {"pointee_write(1=3Dmaybe)=
", "pointee_read(1=3Dnever)", "taken()"}}
+-doc_end
+
+-doc_begin=3D"Property inferred as a consequence of the semantics of alloc=
_cpumask_var"
+-call_properties+=3D{"name(xenctl_bitmap_to_cpumask)", {"pointee_write(1=
=3Dalways)", "pointee_read(1=3Dnever)", "taken()"}}
+-doc_end
+
+-doc_begin=3D"The call to bitmap_and causes the pointee of dstp to be alwa=
ys written"
+-call_properties+=3D{"^cpumask_(and|andnot|clear|copy|complement).*$", {"p=
ointee_write(1=3Dalways)", "pointee_read(1=3Dnever)" "taken()"}}
+-call_properties+=3D{"^bitmap_(andnot|complement|fill).*$", {"pointee_writ=
e(1=3Dalways)", "pointee_read(1=3Dnever)", "taken()"}}
+-doc_end
+
+-doc_begin=3D"The .*copy_(to|from).* helpers all have a memcpy-like expect=
ation that the destination is a copy of the source.
+Furthermore, their uses do initialize the involved variables as needed by =
futher uses in the caller."
+-call_properties+=3D{"macro(^(__)?(raw_)?copy_from_(paddr|guest|compat)(_o=
ffset)?$)", {"pointee_write(1=3Dalways)", "pointee_read(1=3Dnever)", "taken=
()"}}
+-call_properties+=3D{"macro(^(__)?copy_to_(guest|compat)(_offset)?$)", {"p=
ointee_write(2=3Dalways)", "pointee_read(2=3Dnever)", "taken()"}}
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/=
eclair_analysis/ECLAIR/deviations.ecl
new file mode 100644
index 0000000000..e1a06daf2f
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -0,0 +1,298 @@
+### Set 1 ###
+
+#
+# Series 2.
+#
+
+-doc_begin=3D"The compiler implementation guarantees that the unreachable =
code is removed.
+Constant expressions and unreachable branches of if and switch statements =
are expected."
+-config=3DMC3R1.R2.1,+reports=3D{safe,"first_area(^.*has an invariantly.*$=
)"}
+-config=3DMC3R1.R2.1,+reports=3D{safe,"first_area(^.*incompatible with lab=
eled statement$)"}
+-doc_end
+
+-doc_begin=3D"Some functions are intended to be not referenced."
+-config=3DMC3R1.R2.1,+reports=3D{deliberate,"first_area(^.*is never refere=
nced$)"}
+-doc_end
+
+-doc_begin=3D"Unreachability in the following macros are expected and safe=
."
+-config=3DMC3R1.R2.1,statements+=3D{safe,"macro(name(BUG||assert_failed||E=
RROR_EXIT||ERROR_EXIT_DOM||PIN_FAIL))"}
+-doc_end
+
+-doc_begin=3D"Proving compliance with respect to Rule 2.2 is generally imp=
ossible:
+see https://arxiv.org/abs/2212.13933 for details. Moreover, peer review gi=
ves us
+confidence that no evidence of errors in the program's logic has been miss=
ed due
+to undetected violations of Rule 2.2, if any. Testing on time behavior giv=
es us
+confidence on the fact that, should the program contain dead code that is =
not
+removed by the compiler, the resulting slowdown is negligible."
+-config=3DMC3R1.R2.2,reports+=3D{disapplied,"any()"}
+-doc_end
+
+#
+# Series 3.
+#
+
+-doc_begin=3D"Comments starting with '/*' and containing hyperlinks are sa=
fe as
+they are not instances of commented-out code."
+-config=3DMC3R1.R3.1,reports+=3D{safe, "first_area(text(^.*https?://.*$))"}
+-doc_end
+
+#
+# Series 4.
+#
+
+-doc_begin=3D"The directive has been accepted only for the ARM codebase."
+-config=3DMC3R1.D4.3,reports+=3D{disapplied,"!(any_area(any_loc(file(^xen/=
arch/arm/arm64/.*$))))"}
+-doc_end
+
+-doc_begin=3D"Depending on the compiler, rewriting the following function-=
like
+macros as inline functions is not guaranteed to have the same effect."
+-config=3DMC3R1.D4.9,macros+=3D{deliberate,"name(likely)"}
+-config=3DMC3R1.D4.9,macros+=3D{deliberate,"name(unlikely)"}
+-config=3DMC3R1.D4.9,macros+=3D{deliberate,"name(unreachable)"}
+-doc_end
+
+-doc_begin=3D"These macros can be used on both pointers and unsigned long =
type values."
+-config=3DMC3R1.D4.9,macros+=3D{safe,"name(virt_to_maddr)"}
+-config=3DMC3R1.D4.9,macros+=3D{safe,"name(virt_to_mfn)"}
+-doc_end
+
+-doc_begin=3D"Rewriting variadic macros as variadic functions might have a=
 negative impact on safety."
+-config=3DMC3R1.D4.9,macros+=3D{deliberate,"variadic()"}
+-doc_end
+
+-doc_begin=3D"Rewriting macros with arguments that are, in turn, arguments=
 of
+__builtin_constant_p() can change the behavior depending on the optimizati=
on
+level."
+-config=3DMC3R1.D4.9,macro_argument_context+=3D"skip_to(class(type||expr||=
decl,any),
+                                            call(name(__builtin_constant_p=
)))"
+-doc_end
+
+-doc_begin=3D"Function-like macros defined in public headers are meant to =
be
+usable in C89 mode without any extensions. Hence they cannot be replaced by
+inline functions."
+-config=3DMC3R1.D4.9,macros+=3D{deliberate, "loc(file(api:public))"}
+-doc_end
+
+-doc_begin=3D"This header file is autogenerated or empty, therefore it pos=
es no
+risk if included more than once."
+-file_tag+=3D{empty_header, "^xen/arch/arm/efi/runtime\\.h$"}
+-file_tag+=3D{autogen_headers, "^xen/include/xen/compile\\.h$||^xen/includ=
e/generated/autoconf.h$||^xen/include/xen/hypercall-defs.h$"}
+-config=3DMC3R1.D4.10,reports+=3D{safe, "all_area(all_loc(file(empty_heade=
r||autogen_headers)))"}
+-doc_end
+
+-doc_begin=3D"Files that are intended to be included more than once do not=
 need to
+conform to the directive."
+-config=3DMC3R1.D4.10,reports+=3D{safe, "first_area(text(^/\\* This file i=
s legitimately included multiple times\\. \\*/$, begin-4))"}
+-config=3DMC3R1.D4.10,reports+=3D{safe, "first_area(text(^/\\* Generated f=
ile, do not edit! \\*/$, begin-3))"}
+-doc_end
+
+#
+# Series 5.
+#
+
+-doc_begin=3D"The project adopted the rule with an exception listed in
+'docs/misra/rules.rst'"
+-config=3DMC3R1.R5.3,reports+=3D{safe, "any_area(any_loc(any_exp(macro(^RE=
AD_SYSREG$))&&any_exp(macro(^WRITE_SYSREG$))))"}
+-config=3DMC3R1.R5.3,reports+=3D{safe, "any_area(any_loc(any_exp(macro(^ma=
x_t$))&&any_exp(macro(^min_t$))))"}
+-config=3DMC3R1.R5.3,reports+=3D{safe, "any_area(any_loc(any_exp(macro(^re=
ad[bwlq]$))&&any_exp(macro(^read[bwlq]_relaxed$))))"}
+-config=3DMC3R1.R5.3,reports+=3D{safe, "any_area(any_loc(any_exp(macro(^pe=
r_cpu$))&&any_exp(macro(^this_cpu$))))"}
+-doc_end
+
+-doc_begin=3D"The identifier 'fdt' is a widely-used name, for which no sui=
table
+substitute can be found. It is understood in 'xen/arch/arm/efi-boot.h' tha=
t the
+static variable 'fdt' cannot be confused with parameter names of the funct=
ion
+declarations that are present in the file."
+-file_tag+=3D{efi_boot_h, "^xen/arch/arm/efi/efi-boot\\.h$"}
+-config=3DMC3R1.R5.3,reports+=3D{deliberate, "any_area(decl(kind(var)&&sta=
tic_storage()&&^fdt$)&&any_loc(file(efi_boot_h)))"}
+-doc_end
+
+-doc_begin=3D"The identifier 'start' is a widely-used name, for which no s=
uitable
+substitute can be found. It is understood in 'xen/include/xen/kernel.h' th=
at the
+extern variable 'start' cannot be confused with omonymous parameter names =
of the
+function declarations where that variable is visible."
+-file_tag+=3D{kernel_h, "^xen/include/xen/kernel\\.h$"}
+-config=3DMC3R1.R5.3,reports+=3D{deliberate, "any_area(decl(kind(var)&&lin=
kage(external)&&^start$)&&any_loc(file(kernel_h)))"}
+-doc_end
+
+-doc_begin=3D"Function-like macros cannot be confused with identifiers tha=
t are
+neither functions nor pointers to functions."
+-config=3DMC3R1.R5.5,reports=3D{safe,"all_area(decl(node(enum_decl||record=
_decl||field_decl||param_decl||var_decl)&&!type(canonical(address((node(fun=
ction||function_no_proto))))))||macro(function_like()))"}
+-doc_end
+
+-doc_begin=3D"The use of these identifiers for both macro names and other =
entities
+is deliberate and does not generate developer confusion."
+-config=3DMC3R1.R5.5,reports+=3D{safe, "any_area(text(^\\s*/\\*\\s+SAF-[0-=
9]+-safe\\s+MC3R1\\.R5\\.5.*$, begin-1))"}
+-doc_end
+
+-doc_begin=3D"The definition of macros and functions ending in '_bit' that=
 use the
+same identifier in 'bitops.h' is deliberate and safe."
+-file_tag+=3D{bitops_h, "^xen/arch/x86/include/asm/bitops\\.h$"}
+-config=3DMC3R1.R5.5,reports+=3D{safe, "all_area((decl(^.*_bit\\(.*$)||mac=
ro(^.*_bit$))&&all_loc(file(bitops_h)))"}
+-doc_end
+
+-doc_begin=3D"The definition of macros and functions beginning in 'str' or=
 'mem'
+that use the same identifier in 'xen/include/xen/string.h' is deliberate a=
nd
+safe."
+-file_tag+=3D{string_h, "^xen/include/xen/string\\.h$"}
+-config=3DMC3R1.R5.5,reports+=3D{safe, "any_area((decl(^(mem|str).*$)||mac=
ro(^(mem|str).*$))&&all_loc(file(string_h)))"}
+-doc_end
+
+#
+# Series 7.
+#
+
+-doc_begin=3D"Usage of the following constants is safe, since they are giv=
en as-is
+in the inflate algorithm specification and there is therefore no risk of t=
hem
+being interpreted as decimal constants."
+-config=3DMC3R1.R7.1,literals=3D{safe, "^0(007|37|070|213|236|300|321|330|=
331|332|333|334|335|337|371)$"}
+-doc_end
+
+-doc_begin=3D"Violations in files that maintainers have asked to not modif=
y in the
+context of R7.2."
+-file_tag+=3D{adopted_r7_2,"^xen/include/xen/libfdt/.*$"}
+-file_tag+=3D{adopted_r7_2,"^xen/arch/x86/include/asm/x86_64/efibind.h$"}
+-file_tag+=3D{adopted_r7_2,"^xen/include/efi/efiapi\\.h$"}
+-file_tag+=3D{adopted_r7_2,"^xen/include/efi/efidef\\.h$"}
+-file_tag+=3D{adopted_r7_2,"^xen/include/efi/efiprot\\.h$"}
+-file_tag+=3D{adopted_r7_2,"^xen/arch/x86/cpu/intel\\.c$"}
+-file_tag+=3D{adopted_r7_2,"^xen/arch/x86/cpu/amd\\.c$"}
+-file_tag+=3D{adopted_r7_2,"^xen/arch/x86/cpu/common\\.c$"}
+-config=3DMC3R1.R7.2,reports+=3D{deliberate,"any_area(any_loc(file(adopted=
_r7_2)))"}
+-doc_end
+
+-doc_begin=3D"Violations caused by __HYPERVISOR_VIRT_START are related to =
the
+particular use of it done in xen_mk_ulong."
+-config=3DMC3R1.R7.2,reports+=3D{deliberate,"any_area(any_loc(macro(name(B=
UILD_BUG_ON))))"}
+-doc_end
+
+-doc_begin=3D"The following string literals are assigned to pointers to non
+const-qualified char."
+-config=3DMC3R1.R7.4,reports+=3D{safe, "any_area(text(^\\s*/\\*\\s+SAF-[0-=
9]+-safe\\s+MC3R1\\.R7\\.4.*$, begin-1))"}
+-doc_end
+
+-doc_begin=3D"Allow pointers of non-character type as long as the pointee =
is
+const-qualified."
+-config=3DMC3R1.R7.4,same_pointee=3Dfalse
+-doc_end
+
+#
+# Series 8.
+#
+
+-doc_begin=3D"The following variables are compiled in multiple translation=
 units
+belonging to different executables and therefore are safe."
+-config=3DMC3R1.R8.6,declarations+=3D{safe, "name(current_stack_pointer||b=
search||sort)"}
+-doc_end
+
+-doc_begin=3D"Declarations without definitions are allowed (specifically w=
hen the
+definition is compiled-out or optimized-out by the compiler)"
+-config=3DMC3R1.R8.6,reports+=3D{deliberate, "first_area(^.*has no definit=
ion$)"}
+-doc_end
+
+-doc_begin=3D"The gnu_inline attribute without static is deliberately allo=
wed."
+-config=3DMC3R1.R8.10,declarations+=3D{deliberate,"property(gnu_inline)"}
+-doc_end
+
+#
+# Series 9.
+#
+
+-doc_begin=3D"The following variables are written before being set, theref=
ore no
+access to uninitialized memory locations happens, as explained in the devi=
ation
+comment."
+-config=3DMC3R1.R9.1,reports+=3D{safe, "any_area(text(^\\s*/\\*\\s+SAF-[0-=
9]+-safe\\s+MC3R1\\.R9\\.1.*$, begin-1))"}
+-doc_end
+
+-doc_begin=3D"Violations in files that maintainers have asked to not modif=
y in the
+context of R9.1."
+-file_tag+=3D{adopted_r9_1,"^xen/arch/arm/arm64/lib/find_next_bit\\.c$"}
+-config=3DMC3R1.R9.1,reports+=3D{deliberate,"any_area(any_loc(file(adopted=
_r9_1)))"}
+-doc_end
+
+-doc_begin=3D"The possibility of committing mistakes by specifying an expl=
icit
+dimension is higher than omitting the dimension."
+-config=3DMC3R1.R9.5,reports+=3D{deliberate, "any()"}
+-doc_end
+
+### Set 2 ###
+
+#
+# Series 10.
+#
+
+-doc_begin=3D"The value-preserving conversions of integer constants are sa=
fe"
+-config=3DMC3R1.R10.1,etypes=3D{safe,"any()","preserved_integer_constant()=
"}
+-config=3DMC3R1.R10.3,etypes=3D{safe,"any()","preserved_integer_constant()=
"}
+-config=3DMC3R1.R10.4,etypes=3D{safe,"any()","preserved_integer_constant()=
||sibling(rhs,preserved_integer_constant())"}
+-doc_end
+
+-doc_begin=3D"Shifting non-negative integers to the right is safe."
+-config=3DMC3R1.R10.1,etypes+=3D{safe,
+  "stmt(node(binary_operator)&&operator(shr))",
+  "src_expr(definitely_in(0..))"}
+-doc_end
+
+-doc_begin=3D"Shifting non-negative integers to the left is safe if the re=
sult is
+still non-negative."
+-config=3DMC3R1.R10.1,etypes+=3D{safe,
+  "stmt(node(binary_operator)&&operator(shl)&&definitely_in(0..))",
+  "src_expr(definitely_in(0..))"}
+-doc_end
+
+-doc_begin=3D"Bitwise logical operations on non-negative integers are safe=
."
+-config=3DMC3R1.R10.1,etypes+=3D{safe,
+  "stmt(node(binary_operator)&&operator(and||or||xor))",
+  "src_expr(definitely_in(0..))"}
+-doc_end
+
+-doc_begin=3D"The implicit conversion to Boolean for logical operator argu=
ments is well known to all Xen developers to be a comparison with 0"
+-config=3DMC3R1.R10.1,etypes+=3D{safe, "stmt(operator(logical)||node(condi=
tional_operator||binary_conditional_operator))", "dst_type(ebool||boolean)"}
+-doc_end
+
+### Set 3 ###
+
+#
+# Series 18.
+#
+
+-doc_begin=3D"FIXME: explain why pointer differences involving this macro =
are safe."
+-config=3DMC3R1.R18.2,reports+=3D{safe,"all_area(all_loc(any_exp(macro(^AC=
PI_PTR_DIFF$))))"}
+-doc_end
+
+-doc_begin=3D"FIXME: explain why pointer differences involving this macro =
are safe."
+-config=3DMC3R1.R18.2,reports+=3D{safe,"all_area(all_loc(any_exp(macro(^pa=
ge_to_mfn$))))"}
+-doc_end
+
+-doc_begin=3D"FIXME: explain why pointer differences involving this macro =
are safe."
+-config=3DMC3R1.R18.2,reports+=3D{safe,"all_area(all_loc(any_exp(macro(^pa=
ge_to_pdx$))))"}
+-doc_end
+
+#
+# Series 20.
+#
+
+-doc_begin=3D"Code violating Rule 20.7 is safe when macro parameters are u=
sed: (1)
+as function arguments; (2) as macro arguments; (3) as array indices; (4) a=
s lhs
+in assignments."
+-config=3DMC3R1.R20.7,expansion_context=3D
+{safe, "context(__call_expr_arg_contexts)"},
+{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(node(arr=
ay_subscript_expr), subscript)))"},
+{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(operator=
(assign), lhs)))"},
+{safe, "left_right(^[(,\\[]$,^[),\\]]$)"}
+-doc_end
+
+#
+# Developer confusion
+#
+
+-doc=3D"Selection for reports that are fully contained in adopted code."
+-report_selector+=3D{adopted_report,"all_area(!kind(culprit||evidence)||al=
l_loc(all_exp(adopted||pseudo)))"}
+
+-doc_begin=3D"Adopted code is not meant to be read, reviewed or modified b=
y human
+programmers:no developers' confusion is not possible. In addition, adopted=
 code
+is assumed to work as is. Reports that are fully contained in adopted code=
 are
+hidden/tagged with the 'adopted' tag."
+-service_selector=3D{developer_confusion_guidelines,"^(MC3R1\\.R2\\.1|MC3R=
1\\.R2\\.2|MC3R1\\.R2\\.3|MC3R1\\.R2\\.4|MC3R1\\.R2\\.5|MC3R1\\.R2\\.6|MC3R=
1\\.R2\\.7|MC3R1\\.R4\\.1|MC3R1\\.R5\\.3|MC3R1\\.R5\\.6|MC3R1\\.R5\\.7|MC3R=
1\\.R5\\.8|MC3R1\\.R5\\.9|MC3R1\\.R7\\.1|MC3R1\\.R7\\.2|MC3R1\\.R7\\.3|MC3R=
1\\.R8\\.7|MC3R1\\.R8\\.8|MC3R1\\.R8\\.9|MC3R1\\.R8\\.11|MC3R1\\.R8\\.12|MC=
3R1\\.R8\\.13|MC3R1\\.R9\\.3|MC3R1\\.R9\\.4|MC3R1\\.R9\\.5|MC3R1\\.R10\\.2|=
MC3R1\\.R10\\.5|MC3R1\\.R10\\.6|MC3R1\\.R10\\.7|MC3R1\\.R10\\.8|MC3R1\\.R11=
\\.9|MC3R1\\.R12\\.1|MC3R1\\.R12\\.3|MC3R1\\.R12\\.4|MC3R1\\.R13\\.5|MC3R1\=
\.R14\\.1|MC3R1\\.R14\\.2|MC3R1\\.R14\\.3|MC3R1\\.R15\\.1|MC3R1\\.R15\\.2|M=
C3R1\\.R15\\.3|MC3R1\\.R15\\.4|MC3R1\\.R15\\.5|MC3R1\\.R15\\.6|MC3R1\\.R15\=
\.7|MC3R1\\.R16\\.1|MC3R1\\.R16\\.2|MC3R1\\.R16\\.3|MC3R1\\.R16\\.4|MC3R1\\=
.R16\\.5|MC3R1\\.R16\\.6|MC3R1\\.R16\\.7|MC3R1\\.R17\\.7|MC3R1\\.R17\\.8|MC=
3R1\\.R18\\.4|MC3R1\\.R18\\.5)$"
+}
+-config=3Ddeveloper_confusion_guidelines,reports+=3D{relied,adopted_report}
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/out_of_scope.ecl b/automatio=
n/eclair_analysis/ECLAIR/out_of_scope.ecl
new file mode 100644
index 0000000000..44db6997b5
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/out_of_scope.ecl
@@ -0,0 +1,127 @@
+-doc_begin=3D"Imported from Linux: ignore for now."
+-file_tag+=3D{adopted,"^xen/common/libfdt/.*$"}
+-file_tag+=3D{adopted,"^xen/include/xen/libfdt/.*$"}
+-file_tag+=3D{adopted,"^xen/common/xz/.*$"}
+-file_tag+=3D{adopted,"^xen/common/zstd/.*$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/apei/.*$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/tables/.*$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/utilities/.*$"}
+-file_tag+=3D{adopted,"^xen/drivers/video/font_.*$"}
+-file_tag+=3D{adopted,"^xen/arch/arm/arm64/cpufeature\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/arm/arm64/insn\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/arm/arm64/lib/find_next_bit\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/bitmap\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/bunzip2\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/earlycpio\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/inflate\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/lzo\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/lz4/decompress\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/radix-tree\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/ubsan/ubsan\\.c$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/hwregs\\.c$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/numa\\.c$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/osl\\.c$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/tables\\.c$"}
+-file_tag+=3D{adopted,"^xen/lib/list-sort\\.c$"}
+-file_tag+=3D{adopted,"^xen/lib/rbtree\\.c$"}
+-file_tag+=3D{adopted,"^xen/lib/xxhash.*\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/acpi/boot\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/acpi/cpu_idle\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/acpi/cpufreq/cpufreq\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/acpi/cpuidle_menu\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/acpi/lib\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/amd\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/centaur\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/common\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/hygon\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/intel\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/intel_cacheinfo\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/mcheck/non-fatal\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/mtrr/.*$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/mwait-idle\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/delay\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/dmi_scan\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/mpparse\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/srat\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/time\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/x86_64/mmconf-fam10h\\.c$"}
+-doc_end
+
+-doc_begin=3D"Intel specific source files are out of scope."
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/intel\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/intel_cacheinfo\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/microcode/intel\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/shanghai\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/hvm/vmx/.*$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/include/asm/hvm/vmx/.*$"}
+-file_tag+=3D{out_of_scope,"^xen/drivers/passthrough/vtd/.*$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/mcheck/mce_intel\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/mwait-idle\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/vpmu_intel\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/tsx\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/mm/altp2m\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/mm/p2m-ept\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/mm/hap/nested_ept\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/include/asm/altp2m\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/include/asm/intel-family\\.h$"}
+-doc_end
+
+-doc_begin=3D"Not in scope initially as it generates many violations and i=
t is not enabled in safety configurations."
+-file_tag+=3D{adopted,"^xen/xsm/flask/.*$"}
+-doc_end
+
+-doc_begin=3D"unlz4.c implementation by Yann Collet, the others un* are fr=
om Linux, ignore for now."
+-file_tag+=3D{adopted,"^xen/common/un.*\\.c$"}
+-doc_end
+
+-doc_begin=3D"Origin is external and documented in xen/crypto/README.sourc=
e ."
+-file_tag+=3D{adopted,"^xen/crypto/.*$"}
+-doc_end
+
+-doc_begin=3D"Files imported from the gnu-efi package"
+-file_tag+=3D{adopted,"^xen/include/efi/.*$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/include/asm/x86_64/efibind\\.h$"}
+-doc_end
+
+-doc_begin=3D"Build tools are out of scope."
+-file_tag+=3D{out_of_scope_tools,"^xen/tools/.*$"}
+-file_tag+=3D{out_of_scope_tools,"^xen/arch/x86/efi/mkreloc\\.c$"}
+-file_tag+=3D{out_of_scope_tools,"^xen/arch/x86/boot/mkelf32\\.c$"}
+-doc_end
+
+-doc_begin=3D"Out of scope headers."
+-file_tag+=3D{out_of_scope,"^xen/include/xen/bitmap\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/earlycpio\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/lzo\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/lz4\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/common/lz4/defs\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/radix-tree\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/list_sort\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/rbtree\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/xxhash\\.h$"}
+-doc_end
+
+-doc_begin=3D"Headers under xen/include/public/ are the description of the=
 public
+hypercall ABI so the community is extremely conservative in making changes
+there, because the interface is maintained for backward compatibility: ign=
ore
+for now."
+-file_tag+=3D{hypercall_ABI, "^xen/include/public/.*$"}
+-source_files+=3D{hide, hypercall_ABI}
+-doc_end
+
+-doc_begin=3D"Consider out-of-scope files external to the project."
+-file_tag+=3D{external, out_of_scope}
+-doc_end
+
+-doc_begin=3D"Consider adopted files external to the project."
+-file_tag+=3D{external, adopted}
+-doc_end
+
+-doc_begin=3D"Disregard out-of-scope tools."
+-frames+=3D{hide,"main(out_of_scope_tools)"}
+-doc_end
+
+-doc_begin=3D"The build performs speculative calls with target /dev/null: =
this
+frames should be ignored."
+-frames+=3D{hide,"target(^/dev/null$)"}
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/print_analyzed_files.sh b/au=
tomation/eclair_analysis/ECLAIR/print_analyzed_files.sh
new file mode 100755
index 0000000000..c19a8ecbd0
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/print_analyzed_files.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+# Stop immediately if any executed command has exit status different from =
0.
+set -eu
+
+script_name=3D"$(basename "$0")"
+script_dir=3D"$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null =
&& pwd )"
+
+fatal() {
+  echo "${script_name}: $*" >&2
+  exit 1
+}
+
+usage() {
+  fatal "Usage: ${script_name} DATABASE OUT_DIR"
+}
+
+extrapolate_regex() {
+  lookbehind=3D$1
+  file=3D$2
+  grep -Po "(?<=3D${lookbehind}\"\\^).*(?=3D\\$\")" "${file}" | sed 's/\\\=
\/\\/'
+}
+
+if [ $# -lt 2 ]; then
+  usage
+fi
+
+DB=3D$1
+OUT_DIR=3D$2
+
+files_txt=3D"${OUT_DIR}/files.txt"
+files_c_txt=3D"${OUT_DIR}/files_c.txt"
+files_h_txt=3D"${OUT_DIR}/files_h.txt"
+exclusions_txt=3D"${OUT_DIR}/exclusions.txt"
+
+
+if [[ ! -d "${OUT_DIR}" ]]; then
+  mkdir -p "${OUT_DIR}"
+else
+  rm -f "${files_txt}"
+  rm -f "${files_c_txt}"
+  rm -f "${files_h_txt}"
+  rm -f "${exclusions_txt}"
+fi
+
+# Generating txt report with files
+"${ECLAIR_BIN_DIR}eclair_report" -db=3D"${DB}" -files_txt=3D"${files_txt}"
+
+{
+  # Extracting out of scope code
+  out_of_scope_ecl=3D"${script_dir}/out_of_scope.ecl"
+  extrapolate_regex adopted,             "${out_of_scope_ecl}"
+  extrapolate_regex out_of_scope_tools,  "${out_of_scope_ecl}"
+  extrapolate_regex out_of_scope,        "${out_of_scope_ecl}"
+  extrapolate_regex hypercall_ABI,       "${out_of_scope_ecl}"
+  extrapolate_regex "hide, "             "${out_of_scope_ecl}"
+} >"${exclusions_txt}"
+sort -o "${exclusions_txt}" -u "${exclusions_txt}"
+
+# Removing exclusions from files_txt
+grep -E -v "(object: |/dev/pipe)" "${files_txt}" > "${files_txt}.tmp"
+grep -vf "${exclusions_txt}" "${files_txt}.tmp" > "${files_txt}"
+rm "${files_txt}.tmp"
+# Creating files with only headers
+grep -Ev "(xen.*\.(h\w+|[^h]\w*) |.*ecl)" "${files_txt}" > "${files_h_txt}"
+# Creating files with only c files
+grep -Ev "(xen.*\.(c\w+|[^c]\w*) |.*ecl)" "${files_txt}" > "${files_c_txt}"
diff --git a/automation/eclair_analysis/ECLAIR/public_APIs.ecl b/automation=
/eclair_analysis/ECLAIR/public_APIs.ecl
new file mode 100644
index 0000000000..9701a295e6
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/public_APIs.ecl
@@ -0,0 +1,6 @@
+# Definition of the public APIs.
+
+-doc=3D"All Xen public headers."
+-file_tag+=3D{api:public,"^xen/include/public/.*\\.h$"}
+
+-public_files+=3Dapi:public
diff --git a/automation/eclair_analysis/ECLAIR/report.ecl b/automation/ecla=
ir_analysis/ECLAIR/report.ecl
new file mode 100644
index 0000000000..6ee324746c
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/report.ecl
@@ -0,0 +1,4 @@
+# eclair_report
+
+reports_codeclimate("gl-code-quality-report.json")
+
diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/ecl=
air_analysis/ECLAIR/tagging.ecl
new file mode 100644
index 0000000000..ef2e56e186
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
@@ -0,0 +1,34 @@
+-doc=3D"Hide reports marked as compliant."
+-remap_rtag=3D{compliant,hide}
+
+-doc=3D"Hide reports marked as safe."
+-remap_rtag=3D{safe,hide}
+
+-doc=3D"Hide reports marked as relied."
+-remap_rtag=3D{relied,hide}
+
+-doc=3D"Hide reports marked as deliberate."
+-remap_rtag=3D{deliberate,hide}
+
+-doc=3D"Hide reports marked as disapplied."
+-remap_rtag=3D{disapplied,hide}
+
+#######################
+# Accepted guidelines #
+#######################
+
+-doc=3D"Accepted guidelines as reported in XEN/docs/misra/rules.rst"
+-service_selector=3D{accepted_guidelines,"^(MC3R1\\.D1\\.1|MC3R1\\.D2\\.1|=
MC3R1\\.D4\\.3|MC3R1\\.D4\\.7|MC3R1\\.D4\\.10|MC3R1\\.D4\\.11|MC3R1\\.D4\\.=
14|MC3R1\\.R1\\.1|MC3R1\\.R1\\.3|MC3R1\\.R1\\.4|MC3R1\\.R2\\.1|MC3R1\\.R2\\=
.6|MC3R1\\.R2\\.2|MC3R1\\.R3\\.1|MC3R1\\.R3\\.2|MC3R1\\.R4\\.1|MC3R1\\.R4\\=
.2|MC3R1\\.R5\\.1|MC3R1\\.R5\\.2|MC3R1\\.R5\\.3|MC3R1\\.R5\\.4|MC3R1\\.R5\\=
.6|MC3R1\\.R6\\.1|MC3R1\\.R6\\.2|MC3R1\\.R7\\.1|MC3R1\\.R7\\.2|MC3R1\\.R7\\=
.3|MC3R1\\.R7\\.4|MC3R1\\.R8\\.1|MC3R1\\.R8\\.2|MC3R1\\.R8\\.3|MC3R1\\.R8\\=
.4|MC3R1\\.R8\\.5|MC3R1\\.R8\\.6|MC3R1\\.R8\\.8|MC3R1\\.R8\\.10|MC3R1\\.R8\=
\.12|MC3R1\\.R8\\.14|MC3R1\\.R9\\.1|MC3R1\\.R9\\.2|MC3R1\\.R9\\.3|MC3R1\\.R=
9\\.4|MC3R1\\.R9\\.5|MC3R1\\.R12\\.5|MC3R1\\.R13\\.6|MC3R1\\.R13\\.1|MC3R1\=
\.R14\\.1|MC3R1\\.R16\\.7|MC3R1\\.R17\\.3|MC3R1\\.R17\\.4|MC3R1\\.R17\\.6|M=
C3R1\\.R18\\.3|MC3R1\\.R19\\.1|MC3R1\\.R20\\.7|MC3R1\\.R20\\.13|MC3R1\\.R20=
\\.14|MC3R1\\.R21\\.13|MC3R1\\.R21\\.17|MC3R1\\.R21\\.18|MC3R1\\.R21\\.19|M=
C3R1\\.R21\\.20|MC3R1\\.R21\\.21|MC3R1\\.R22\\.2|MC3R1\\.R22\\.4|MC3R1\\.R2=
2\\.5|MC3R1\\.R22\\.6)$"
+}
+-doc=3D"All reports of accepted guidelines are tagged as accepted."
+-reports+=3D{status:accepted,"service(accepted_guidelines)"}
+
+####################
+# Clean guidelines #
+####################
+
+-doc_begin=3D"Clean guidelines: new violations for these guidelines are no=
t accepted."
+-service_selector=3D{clean_guidelines,"^(MC3R1\\.D1\\.1|MC3R1\\.D2\\.1|MC3=
R1\\.D4\\.11|MC3R1\\.D4\\.14|MC3R1\\.R1\\.4|MC3R1\\.R2\\.2|MC3R1\\.R3\\.2|M=
C3R1\\.R5\\.1|MC3R1\\.R5\\.2|MC3R1\\.R5\\.4|MC3R1\\.R6\\.1|MC3R1\\.R6\\.2|M=
C3R1\\.R7\\.1|MC3R1\\.R8\\.1|MC3R1\\.R8\\.5|MC3R1\\.R8\\.8|MC3R1\\.R8\\.10|=
MC3R1\\.R8\\.12|MC3R1\\.R8\\.14|MC3R1\\.R9\\.2|MC3R1\\.R9\\.4|MC3R1\\.R9\\.=
5|MC3R1\\.R12\\.5|MC3R1\\.R17\\.3|MC3R1\\.R17\\.6|MC3R1\\.R21\\.13|MC3R1\\.=
R21\\.19|MC3R1\\.R21\\.21|MC3R1\\.R22\\.2|MC3R1\\.R22\\.4|MC3R1\\.R22\\.5)$"
+}
+-reports+=3D{clean:added,"service(clean_guidelines)"}
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/toolchain.ecl b/automation/e=
clair_analysis/ECLAIR/toolchain.ecl
new file mode 100644
index 0000000000..e6cd289b5e
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/toolchain.ecl
@@ -0,0 +1,275 @@
+# Compilers.
+-file_tag+=3D{GCC_ARM64,"^/usr/bin/aarch64-linux-gnu-gcc-12$"}
+-file_tag+=3D{GCC_X86_64,"^/usr/bin/x86_64-linux-gnu-gcc-12$"}
+
+# Manuals.
+-setq=3DGCC_MANUAL,"https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc.pdf"
+-setq=3DCPP_MANUAL,"https://gcc.gnu.org/onlinedocs/gcc-12.1.0/cpp.pdf"
+-setq=3DARM64_ABI_MANUAL,"https://github.com/ARM-software/abi-aa/blob/60a8=
eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs64/aapcs64.rst"
+-setq=3DX86_64_ABI_MANUAL,"https://gitlab.com/x86-psABIs/x86-64-ABI/-/jobs=
/artifacts/master/raw/x86-64-ABI/abi.pdf?job=3Dbuild"
+-setq=3DARM64_LIBC_MANUAL,"https://www.gnu.org/software/libc/manual/pdf/li=
bc.pdf"
+-setq=3DX86_64_LIBC_MANUAL,"https://www.gnu.org/software/libc/manual/pdf/l=
ibc.pdf"
+-setq=3DC99_STD,"ISO/IEC 9899:1999"
+
+-doc_begin=3D"
+    _Static_assert: see Section \"2.1 C Language\" of "GCC_MANUAL".
+    asm, __asm__: see Sections \"6.48 Alternate Keywords\" and \"6.47 How =
to Use Inline Assembly Language in C Code\" of "GCC_MANUAL".
+    __volatile__: see Sections \"6.48 Alternate Keywords\" and \"6.47.2.1 =
Volatile\" of "GCC_MANUAL".
+    __const__, __inline__, __inline: see Section \"6.48 Alternate Keywords=
\" of "GCC_MANUAL".
+    typeof, __typeof__: see Section \"6.7 Referring to a Type with typeof\=
" of "GCC_MANUAL".
+    __alignof__, __alignof: see Sections \"6.48 Alternate Keywords\" and \=
"6.44 Determining the Alignment of Functions, Types or Variables\" of "GCC_=
MANUAL".
+    __attribute__: see Section \"6.39 Attribute Syntax\" of "GCC_MANUAL".
+    __builtin_types_compatible_p: see Section \"6.59 Other Built-in Functi=
ons Provided by GCC\" of "GCC_MANUAL".
+    __builtin_va_arg: non-documented GCC extension.
+    __builtin_offsetof: see Section \"6.53 Support for offsetof\" of "GCC_=
MANUAL".
+"
+-config=3DSTD.tokenext,behavior+=3D{c99, GCC_ARM64, "^(_Static_assert|asm|=
__asm__|__volatile__|__const__|__inline__|typeof|__typeof__|__alignof__|__a=
ttribute__|__builtin_types_compatible_p|__builtin_va_arg|__builtin_offsetof=
)$"}
+-config=3DSTD.tokenext,behavior+=3D{c99, GCC_X86_64, "^(_Static_assert|asm=
|__asm__|__volatile__|__const__|__inline__|__inline|typeof|__typeof__|__ali=
gnof__|__alignof|__attribute__|__builtin_types_compatible_p|__builtin_va_ar=
g|__builtin_offsetof)$"}
+-doc_end
+
+-doc_begin=3D"Non-documented GCC extension."
+-config=3DSTD.emptinit,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.emptinit,behavior+=3D{c99,GCC_X86_64,specified}
+#-config=3DSTD.emptinit,behavior+=3D{c18,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.24 Arithmetic on void- and Function-Pointers=
\" of "GCC_MANUAL"."
+-config=3DSTD.vptrarth,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.vptrarth,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.1 Statements and Declarations in Expressions=
\" of "GCC_MANUAL"."
+-config=3DSTD.stmtexpr,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.stmtexpr,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.19 Structures with No Members\" of "GCC_MANU=
AL"."
+-config=3DSTD.emptrecd,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.emptrecd,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.18 Arrays of Length Zero\" of "GCC_MANUAL"."
+-config=3DSTD.arayzero,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.arayzero,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.8 Conditionals with Omitted Operands\" of "G=
CC_MANUAL"."
+-config=3DSTD.bincondl,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.bincondl,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.30 Case Ranges\" of "GCC_MANUAL"."
+-config=3DSTD.caseuplw,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.caseuplw,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.63 Unnamed Structure and Union Fields\" of "=
GCC_MANUAL"."
+-config=3DSTD.anonfild,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.anonfild,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"Non-documented GCC extension."
+-config=3DSTD.emptdecl,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.emptdecl,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"Non-documented GCC extension."
+-config=3DSTD.emptenum,behavior+=3D{c99,GCC_ARM64,specified}
+-doc_end
+
+-doc_begin=3D"Non-documented GCC extension."
+-config=3DSTD.pteincmp,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.pteincmp,behavior+=3D{c99,GCC_X86_64,specified}
+#-config=3DSTD.pteincmp,behavior+=3D{c18,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"Non-documented GCC extension."
+-config=3DSTD.funojptr,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"
+    ext_paste_comma: see Section \"6.21 Macros with a Variable Number of A=
rguments\" of "GCC_MANUAL".
+    ext_missing_varargs_arg: see Section \"6.21 Macros with a Variable Num=
ber of Arguments\" of "GCC_MANUAL".
+    ext_named_variadic_macro: see Section \"6.21 Macros with a Variable Nu=
mber of Arguments\" of "GCC_MANUAL".
+    ext_return_has_void_expr: see the documentation for -Wreturn-type in S=
ection \"3.8 Options to Request or Suppress Warnings\" of "GCC_MANUAL".
+    ext_gnu_statement_expr_macro: see Section \"6.1 Statements and Declara=
tions in Expressions\" of "GCC_MANUAL".
+    ext_sizeof_alignof_void_type: see Section \"6.24 Arithmetic on void- a=
nd Function-Pointers\" of "GCC_MANUAL".
+    ext_forward_ref_enum_def: see Section \"6.49 Incomplete enum Types\" o=
f "GCC_MANUAL".
+    ext_flexible_array_in_struct: see Section \"6.18 Arrays of Length Zero=
\" of "GCC_MANUAL".
+    ext_flexible_array_in_array: see Section \"6.18 Arrays of Length Zero\=
" of "GCC_MANUAL".
+    ext_enum_value_not_int: non-documented GCC extension.
+    ext_gnu_array_range: see Section \"6.29 Designated Initializers\" of "=
GCC_MANUAL".
+"
+-config=3DSTD.diag,behavior+=3D{c99,GCC_ARM64,"^(ext_paste_comma|ext_missi=
ng_varargs_arg|ext_named_variadic_macro|ext_return_has_void_expr|ext_gnu_st=
atement_expr_macro|ext_sizeof_alignof_void_type|ext_forward_ref_enum_def|ex=
t_gnu_array_range)$"}
+-config=3DSTD.diag,behavior+=3D{c99,GCC_X86_64,"^(ext_paste_comma|ext_miss=
ing_varargs_arg|ext_named_variadic_macro|ext_return_has_void_expr|ext_gnu_s=
tatement_expr_macro|ext_sizeof_alignof_void_type|ext_flexible_array_in_stru=
ct|ext_flexible_array_in_array|ext_enum_value_not_int|ext_gnu_array_range)$=
"}
+-doc_end
+
+-doc_begin=3D"The maximum size of an object is defined in the MAX_SIZE mac=
ro, and for a 32 bit architecture is 8MB.
+    The maximum size for an array is defined in the PTRDIFF_MAX and in a 3=
2 bit architecture is 2^30-1.
+    See occurrences of these macros in "GCC_MANUAL"."
+-config=3DSTD.byteobjt,behavior+=3D{c99, GCC_ARM64, 8388608}
+-config=3DSTD.byteobjt,behavior+=3D{c99, GCC_X86_64, 8388608}
+-doc_end
+
+-doc_begin=3D"See Section \"11.2 Implementation limits\" of "CPP_MANUAL"."
+-config=3DSTD.charline,behavior+=3D{c99, GCC_ARM64, 5000}
+-config=3DSTD.charline,behavior+=3D{c99, GCC_X86_64, 12000}
+-doc_end
+
+-doc_begin=3D"See Section \"11.2 Implementation limits\" of "CPP_MANUAL"."
+-config=3DSTD.inclnest,behavior+=3D{c99, GCC_ARM64, 24}
+-config=3DSTD.inclnest,behavior+=3D{c99, GCC_X86_64, 32}
+-doc_end
+
+-doc_begin=3D"FIXME: why is C90 used?"
+-config=3DSTD.ppifnest,behavior+=3D{c90, GCC_X86_64, 32}
+-doc_end
+
+-doc_begin=3D"See Section \"4.12 Statements\" of "GCC_MANUAL"."
+-config=3DSTD.caselimt,behavior+=3D{c99, GCC_X86_64, 1500}
+-doc_end
+
+-doc_begin=3D"See Section \"6.9 128-bit Integers\" of "GCC_MANUAL"."
+-config=3DSTD.stdtypes,behavior+=3D{c99, GCC_X86_64, "__uint128_t"}
+-doc_end
+
+-doc_begin=3D"FIXME: Non-documented GCC extension?"
+-config=3DSTD.charescp,behavior=3D{c99, GCC_X86_64, "^m$"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.9 Structures, Unions, Enumerations, and Bit-=
Fields\" of "GCC_MANUAL"."
+-config=3DSTD.bitfldtp, +behavior=3D{c99, GCC_ARM64, "unsigned char;unsign=
ed short;unsigned long;unsigned long long"}
+-config=3DSTD.bitfldtp, +behavior=3D{c99, GCC_X86_64, "unsigned char;unsig=
ned short;unsigned long;enum"}
+-doc_end
+
+-doc_begin=3D"
+    #pragma pack: see Section \"6.62.11 Structure-Layout Pragmas\" of "GCC=
_MANUAL".
+    #pragma GCC visibility: see Section \"6.62.14 Visibility Pragmas\" of =
"GCC_MANUAL".
+"
+-config=3DSTD.nonstdc,behavior=3D{c99, GCC_ARM64, "^(pack\\(|GCC visibilit=
y (push|pop)).*$"}
+-config=3DSTD.nonstdc,behavior=3D{c99, GCC_X86_64, "^(pack\\(|GCC visibili=
ty (push|pop)).*$"}
+-doc_end
+
+-doc_begin=3D"See Section \"1.1 Character sets\" of "CPP_MANUAL".  We assu=
me the locale is not restricting any UTF-8 characters being part of the sou=
rce character set."
+-config=3DSTD.charset,behavior=3D{c99, GCC_ARM64, "utf8"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.3 Identifiers\" of "GCC_MANUAL"."
+-config=3DSTD.extidsig, behavior+=3D{c99, GCC_ARM64, "63"}
+-config=3DSTD.extidsig, behavior+=3D{c99, GCC_X86_64, "63"}
+-doc_end
+
+#
+# Documentation for relied-upon implementation-defined behaviors (Dir 1.1)
+#
+
+-doc_begin=3D"See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \=
"8.1 Data types\" of "ARM64_ABI_MANUAL"."
+-config=3DSTD.bytebits,behavior=3D{c99, GCC_ARM64, "8"}
+-config=3DSTD.charsobj,behavior=3D{c99, GCC_ARM64, "utf8"}
+-config=3DSTD.charsval,behavior=3D{c99, GCC_ARM64, "utf8"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \=
"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
+-config=3DSTD.bytebits,behavior=3D{c99, GCC_X86_64, "8"}
+-config=3DSTD.charsobj,behavior=3D{c99, GCC_X86_64, "utf8"}
+-config=3DSTD.charsval,behavior=3D{c99, GCC_X86_64, "utf8"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.4 Characters\" of "GCC_MANUAL" and the docum=
entation for -finput-charset=3Dcharset in the same manual."
+-config=3DSTD.charsmap,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.charsmap,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.4 Characters\" of "GCC_MANUAL" and the docum=
entation for -fexec-charset=3Dcharset and -finput-charset=3Dcharset in the =
same manual."
+-config=3DSTD.charsmem,behavior=3D{c99, GCC_ARM64, "utf8"}
+-config=3DSTD.charsmem,behavior=3D{c99, GCC_X86_64, "utf8"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.1 Translation\" of "GCC_MANUAL"."
+-config=3DSTD.diagidnt,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.diagidnt,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.4 Characters\" of "GCC_MANUAL" and the docum=
entation for -fexec-charset=3Dcharset in the same manual."
+-config=3DSTD.execvals,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.execvals,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"Given that Xen is compiled in hosted mode, ECLAIR cannot exc=
lude the independency from program termination implementation-defined behav=
ior.  See \"Section 25.7 Program Termination\" of "ARM64_LIBC_MANUAL"."
+-config=3DSTD.exitstat,behavior=3D{c99, GCC_ARM64, "specified"}
+-doc_end
+
+-doc_begin=3D"Given that Xen is compiled in hosted mode, ECLAIR cannot exc=
lude the independency from program termination implementation-defined behav=
ior.  See \"Section 25.7 Program Termination\" of "X86_64_LIBC_MANUAL"."
+-config=3DSTD.exitstat,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Chapter \"2 Header Files\" of "CPP_MANUAL"."
+-config=3DSTD.inclangl,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.inclangl,behavior=3D{c99, GCC_X86_64, "specified"}
+-config=3DSTD.inclfile,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.inclfile,behavior=3D{c99, GCC_X86_64, "specified"}
+-config=3DSTD.inclhead,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.inclhead,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.5 Integers\" of "GCC_MANUAL"."
+-config=3DSTD.signdint,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.signdint,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.15 Architecture\" of "GCC_MANUAL" and Chapte=
r \"5   Data types and alignment\" of "ARM64_ABI_MANUAL"."
+-config=3DSTD.objbytes,behavior=3D{c99, GCC_ARM64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.15 Architecture\" of "GCC_MANUAL" and Sectio=
n \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
+-config=3DSTD.objbytes,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"3.4 Stringizing\" of "CPP_MANUAL"."
+-config=3DSTD.stringfy,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.stringfy,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.9 Structures, Unions, Enumerations, and Bit-=
Fields\"
+ of "GCC_MANUAL" and Section \"8.1.8 Bit-fields\" of "ARM64_ABI_MANUAL"."
+-config=3DSTD.bitfldby,+behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.bitfldor,+behavior=3D{c99, GCC_ARM64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.9 Structures, Unions, Enumerations, and Bit-=
Fields\"
+ of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_=
MANUAL"."
+-config=3DSTD.bitfldby,+behavior=3D{c99, GCC_X86_64, "specified"}
+-config=3DSTD.bitfldor,+behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.10 Qualifiers\" of "GCC_MANUAL"."
+-config=3DSTD.volatltp,+behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.volatltp,+behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.15 Architecture\" of "GCC_MANUAL" and Chapte=
r \"5   Data types and alignment\" of "ARM64_ABI_MANUAL"."
+-config=3DSTD.stdmacro,behavior=3D{c99, GCC_ARM64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.15 Architecture\" of "GCC_MANUAL" and Sectio=
n \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
+-config=3DSTD.stdmacro,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \=
"11.1 Implementation-defined behavior\" of "CPP_MANUAL"."
+-config=3DSTD.widestng,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.widestng,behavior=3D{c99, GCC_X86_64, "specified"}
+-config=3DSTD.multbtsl,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.13 Preprocessing Directives\" of "GCC_MANUAL=
" and Section \"7 Pragmas\" of "CPP_MANUAL"."
+-config=3DSTD.pragmdir,behavior=3D{c99, GCC_ARM64, "^(pack\\(|GCC visibili=
ty (push|pop)).*$"}
+-config=3DSTD.pragmdir,behavior=3D{c99, GCC_X86_64, "^(pack\\(|GCC visibil=
ity (push|pop)).*$"}
+-doc_end
+
+-doc_begin=3D"See Section \"6.9 128-bit Integers\" of "GCC_MANUAL"."
+-config=3DSTD.extinttp,behavior=3D{c99, GCC_X86_64, "__uint128_t"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.13 Preprocessing Directives\" of "GCC_MANUAL=
" and Section \"11.1 Implementation-defined behavior\" of "CPP_MANUAL"."
+-config=3DSTD.inclexpd,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
--=20
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 14:58:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 14:58:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569767.890845 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJUB-0004yE-Qn; Tue, 25 Jul 2023 14:58:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569767.890845; Tue, 25 Jul 2023 14:58:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJUB-0004y5-Mr; Tue, 25 Jul 2023 14:58:03 +0000
Received: by outflank-mailman (input) for mailman id 569767;
 Tue, 25 Jul 2023 14:58:02 +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
 <SRS0=p13o=DL=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qOJUA-0003ay-9B
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 14:58:02 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a5d2161d-2afb-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 16:58:00 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.75.91])
 by support.bugseng.com (Postfix) with ESMTPSA id 979614EE073E;
 Tue, 25 Jul 2023 16:57:59 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a5d2161d-2afb-11ee-8613-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [XEN PATCH 2/4] automation: Add xen builds for the ECLAIR analyses
Date: Tue, 25 Jul 2023 16:55:55 +0200
Message-Id: <256dd32f1496400c7fc8554aa03db417e729c741.1690294965.git.simone.ballarin@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690294965.git.simone.ballarin@bugseng.com>
References: <cover.1690294965.git.simone.ballarin@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

This patch defines an ARM64 and a X86_64 build for the
ECLAIR pipelines.

These files are used by the analyze.sh script in
automation/eclair_analysis: it initially calls prepare.sh,
then runs into an ECLAIR environment build.sh.

Only the toolchain invocations triggered by build.sh
are analyzed; the prepare.sh script is instead intended
to perform all the required operations for building xen
that are not supposed to be analyzed: e.g. dependencies
build.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

--
Changes in v3:
- split build definitions in a separate patch.

Changes in v2:
- add ECLAIR configuration files (before they were fetched from a separate
  repository);
- now the pipeline fails if there are new violations of guidelines tagged
  with clean:added.
---
 automation/eclair_analysis/Makefile.prepare |   6 +
 automation/eclair_analysis/build.sh         |  44 ++++++
 automation/eclair_analysis/prepare.sh       |  42 ++++++
 automation/eclair_analysis/xen_arm_config   | 147 +++++++++++++++++++
 automation/eclair_analysis/xen_x86_config   | 152 ++++++++++++++++++++
 5 files changed, 391 insertions(+)
 create mode 100644 automation/eclair_analysis/Makefile.prepare
 create mode 100755 automation/eclair_analysis/build.sh
 create mode 100755 automation/eclair_analysis/prepare.sh
 create mode 100644 automation/eclair_analysis/xen_arm_config
 create mode 100644 automation/eclair_analysis/xen_x86_config

diff --git a/automation/eclair_analysis/Makefile.prepare b/automation/eclai=
r_analysis/Makefile.prepare
new file mode 100644
index 0000000000..90f4a31172
--- /dev/null
+++ b/automation/eclair_analysis/Makefile.prepare
@@ -0,0 +1,6 @@
+include Makefile
+prepare:
+	$(Q)$(MAKE) $(build)=3Dtools
+	$(Q)$(MAKE) $(build)=3D. include/xen/compile.h
+	$(Q)$(MAKE) $(build)=3Dinclude all
+	$(Q)$(MAKE) $(build)=3Darch/$(SRCARCH) include
diff --git a/automation/eclair_analysis/build.sh b/automation/eclair_analys=
is/build.sh
new file mode 100755
index 0000000000..ec087dd822
--- /dev/null
+++ b/automation/eclair_analysis/build.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+# Stop immediately if any executed command has exit status different from =
0.
+set -e
+
+script_name=3D"$(basename "$0")"
+
+fatal() {
+  echo "${script_name}: $*" >&2
+  exit 1
+}
+
+usage() {
+  fatal "Usage: ${script_name} <ARM64|X86_64>"
+}
+
+if [ $# -ne 1 ]; then
+  usage
+fi
+
+if [ "$1" =3D "X86_64" ]; then
+  export CROSS_COMPILE=3D
+  export XEN_TARGET_ARCH=3Dx86_64
+elif [ "$1" =3D "ARM64" ]; then
+  export CROSS_COMPILE=3Daarch64-linux-gnu-
+  export XEN_TARGET_ARCH=3Darm64
+else
+  fatal "Unknown configuration: $1"
+fi
+
+if [[ -f /proc/cpuinfo ]]; then
+  PROCESSORS=3D$(grep -c ^processor /proc/cpuinfo)
+else
+  PROCESSORS=3D6
+fi
+
+(
+  cd xen
+
+  make "-j${PROCESSORS}" "-l${PROCESSORS}.0"    \
+       "CROSS_COMPILE=3D${CROSS_COMPILE}"         \
+       "CC=3D${CROSS_COMPILE}gcc-12"              \
+       "CXX=3D${CROSS_COMPILE}g++-12"             \
+       "XEN_TARGET_ARCH=3D${XEN_TARGET_ARCH}"
+)
diff --git a/automation/eclair_analysis/prepare.sh b/automation/eclair_anal=
ysis/prepare.sh
new file mode 100755
index 0000000000..275a1a3f51
--- /dev/null
+++ b/automation/eclair_analysis/prepare.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+# Stop immediately if any executed command has exit status different from =
0.
+set -e
+
+script_name=3D"$(basename "$0")"
+script_dir=3D"$(
+  cd "$(dirname "$0")"
+  echo "${PWD}"
+)"
+
+fatal() {
+  echo "${script_name}: $*" >&2
+  exit 1
+}
+
+usage() {
+  fatal "Usage: ${script_name}"
+}
+
+if [ $# -ne 1 ]; then
+  usage
+  exit 1
+fi
+
+export XEN_TARGET_ARCH
+
+if [ "$1" =3D "X86_64" ]; then
+  CONFIG_FILE=3D"${script_dir}/xen_x86_config"
+  XEN_TARGET_ARCH=3Dx86_64
+elif [ "$1" =3D "ARM64" ]; then
+  CONFIG_FILE=3D"${script_dir}/xen_arm_config"
+  XEN_TARGET_ARCH=3Darm64
+else
+  fatal "Unknown configuration: $1"
+fi
+
+(
+    cd xen
+    cp "${CONFIG_FILE}" .config
+    make clean
+    make -f ${script_dir}/Makefile.prepare prepare
+)
diff --git a/automation/eclair_analysis/xen_arm_config b/automation/eclair_=
analysis/xen_arm_config
new file mode 100644
index 0000000000..82102b889e
--- /dev/null
+++ b/automation/eclair_analysis/xen_arm_config
@@ -0,0 +1,147 @@
+# File provided in=0D
+# Re: Xen MISRA C: Source files in scope and out of scope=0D
+# from:	Stefano Stabellini <stefano.stabellini@amd.com>=0D
+# date:	6 giu 2023, 02:53=0D
+=0D
+#=0D
+# Automatically generated file; DO NOT EDIT.=0D
+# Xen/arm 4.18-unstable Configuration=0D
+#=0D
+CONFIG_CC_IS_GCC=3Dy=0D
+CONFIG_GCC_VERSION=3D90400=0D
+CONFIG_CLANG_VERSION=3D0=0D
+CONFIG_LD_IS_GNU=3Dy=0D
+CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE=3Dy=0D
+CONFIG_ARM_64=3Dy=0D
+CONFIG_ARM=3Dy=0D
+CONFIG_ARCH_DEFCONFIG=3D"arch/arm/configs/arm64_defconfig"=0D
+=0D
+# UBSAN=0D
+CONFIG_UBSAN=3Dn=0D
+=0D
+#=0D
+# Architecture Features=0D
+#=0D
+CONFIG_ARM64_SVE=3Dn=0D
+CONFIG_64BIT=3Dy=0D
+CONFIG_NR_CPUS=3D4=0D
+# CONFIG_ACPI is not set=0D
+CONFIG_ARM_EFI=3Dy=0D
+CONFIG_GICV3=3Dy=0D
+CONFIG_HAS_ITS=3Dy=0D
+CONFIG_HVM=3Dy=0D
+# CONFIG_NEW_VGIC is not set=0D
+CONFIG_SBSA_VUART_CONSOLE=3Dy=0D
+CONFIG_ARM_SSBD=3Dy=0D
+CONFIG_HARDEN_BRANCH_PREDICTOR=3Dy=0D
+# CONFIG_TEE is not set=0D
+# CONFIG_STATIC_SHM is not set=0D
+# end of Architecture Features=0D
+=0D
+#=0D
+# ARM errata workaround via the alternative framework=0D
+#=0D
+CONFIG_ARM64_ERRATUM_827319=3Dy=0D
+CONFIG_ARM64_ERRATUM_824069=3Dy=0D
+CONFIG_ARM64_ERRATUM_819472=3Dy=0D
+CONFIG_ARM64_ERRATUM_843419=3Dy=0D
+CONFIG_ARM64_ERRATUM_832075=3Dy=0D
+CONFIG_ARM64_ERRATUM_834220=3Dy=0D
+CONFIG_ARM_ERRATUM_858921=3Dy=0D
+CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=3Dy=0D
+CONFIG_ARM64_ERRATUM_1286807=3Dy=0D
+# end of ARM errata workaround via the alternative framework=0D
+=0D
+CONFIG_ARM64_HARDEN_BRANCH_PREDICTOR=3Dy=0D
+# CONFIG_ALL_PLAT is not set=0D
+# CONFIG_QEMU is not set=0D
+# CONFIG_RCAR3 is not set=0D
+CONFIG_MPSOC=3Dy=0D
+# CONFIG_NO_PLAT is not set=0D
+CONFIG_MPSOC_PLATFORM=3Dy=0D
+=0D
+#=0D
+# Common Features=0D
+#=0D
+CONFIG_GRANT_TABLE=3Dy=0D
+CONFIG_HAS_ALTERNATIVE=3Dy=0D
+CONFIG_HAS_DEVICE_TREE=3Dy=0D
+CONFIG_HAS_FAST_MULTIPLY=3Dy=0D
+CONFIG_HAS_PDX=3Dy=0D
+CONFIG_HAS_PMAP=3Dy=0D
+# CONFIG_MEM_ACCESS is not set=0D
+CONFIG_STATIC_MEMORY=3Dy=0D
+=0D
+#=0D
+# Speculative hardening=0D
+#=0D
+CONFIG_SPECULATIVE_HARDEN_ARRAY=3Dy=0D
+# end of Speculative hardening=0D
+=0D
+# CONFIG_HYPFS is not set=0D
+CONFIG_IOREQ_SERVER=3Dy=0D
+# CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP is not set=0D
+# CONFIG_XSM is not set=0D
+# CONFIG_ARGO is not set=0D
+=0D
+#=0D
+# Schedulers=0D
+#=0D
+# CONFIG_SCHED_CREDIT is not set=0D
+CONFIG_SCHED_CREDIT2=3Dy=0D
+# CONFIG_SCHED_RTDS is not set=0D
+# CONFIG_SCHED_ARINC653 is not set=0D
+CONFIG_SCHED_NULL=3Dy=0D
+CONFIG_SCHED_CREDIT2_DEFAULT=3Dy=0D
+# CONFIG_SCHED_NULL_DEFAULT is not set=0D
+CONFIG_SCHED_DEFAULT=3D"credit2"=0D
+# end of Schedulers=0D
+=0D
+CONFIG_BOOT_TIME_CPUPOOLS=3Dy=0D
+# CONFIG_LIVEPATCH is not set=0D
+# CONFIG_ENFORCE_UNIQUE_SYMBOLS is not set=0D
+CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS=3Dy=0D
+CONFIG_CMDLINE=3D""=0D
+CONFIG_DOM0_MEM=3D""=0D
+CONFIG_DTB_FILE=3D""=0D
+# CONFIG_TRACEBUFFER is not set=0D
+# end of Common Features=0D
+=0D
+#=0D
+# Device Drivers=0D
+#=0D
+# CONFIG_HAS_NS16550 is not set=0D
+CONFIG_HAS_CADENCE_UART=3Dy=0D
+# CONFIG_HAS_IMX_LPUART is not set=0D
+# CONFIG_HAS_MVEBU is not set=0D
+# CONFIG_HAS_MESON is not set=0D
+CONFIG_HAS_PL011=3Dy=0D
+# CONFIG_HAS_SCIF is not set=0D
+CONFIG_SERIAL_TX_BUFSIZE=3D16384=0D
+CONFIG_HAS_PASSTHROUGH=3Dy=0D
+CONFIG_ARM_SMMU=3Dy=0D
+CONFIG_ARM_SMMU_V3=3Dy=0D
+# CONFIG_IPMMU_VMSA is not set=0D
+CONFIG_IOMMU_FORCE_PT_SHARE=3Dy=0D
+# end of Device Drivers=0D
+=0D
+CONFIG_EXPERT=3Dy=0D
+CONFIG_UNSUPPORTED=3Dy=0D
+=0D
+#=0D
+# Debugging Options=0D
+#=0D
+CONFIG_DEBUG=3Dy=0D
+CONFIG_FRAME_POINTER=3Dy=0D
+CONFIG_COVERAGE=3Dy=0D
+CONFIG_DEBUG_LOCK_PROFILE=3Dy=0D
+CONFIG_DEBUG_LOCKS=3Dy=0D
+CONFIG_PERF_COUNTERS=3Dy=0D
+CONFIG_PERF_ARRAYS=3Dy=0D
+CONFIG_VERBOSE_DEBUG=3Dy=0D
+CONFIG_DEVICE_TREE_DEBUG=3Dy=0D
+CONFIG_SCRUB_DEBUG=3Dy=0D
+CONFIG_DEBUG_TRACE=3Dy=0D
+CONFIG_XMEM_POOL_POISON=3Dy=0D
+CONFIG_DEBUG_INFO=3Dy=0D
+# end of Debugging Options=0D
diff --git a/automation/eclair_analysis/xen_x86_config b/automation/eclair_=
analysis/xen_x86_config
new file mode 100644
index 0000000000..9b2709bfc8
--- /dev/null
+++ b/automation/eclair_analysis/xen_x86_config
@@ -0,0 +1,152 @@
+# File provided in=0D
+# Re: Xen MISRA C: Source files in scope and out of scope=0D
+# from:	Stefano Stabellini <stefano.stabellini@amd.com> =0D
+# date:	6 giu 2023, 02:53=0D
+=0D
+#=0D
+# Automatically generated file; DO NOT EDIT.=0D
+# Xen/x86 4.18-unstable Configuration=0D
+#=0D
+CONFIG_CC_IS_GCC=3Dy=0D
+CONFIG_GCC_VERSION=3D90400=0D
+CONFIG_CLANG_VERSION=3D0=0D
+CONFIG_LD_IS_GNU=3Dy=0D
+CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE=3Dy=0D
+CONFIG_X86_64=3Dy=0D
+CONFIG_X86=3Dy=0D
+CONFIG_ARCH_DEFCONFIG=3D"arch/x86/configs/x86_64_defconfig"=0D
+CONFIG_CC_HAS_INDIRECT_THUNK=3Dy=0D
+CONFIG_HAS_AS_CET_SS=3Dy=0D
+CONFIG_HAS_CC_CET_IBT=3Dy=0D
+=0D
+CONFIG_REQUIRE_NX=3Dn=0D
+=0D
+#=0D
+# Architecture Features=0D
+#=0D
+CONFIG_64BIT=3Dy=0D
+CONFIG_NR_CPUS=3D16=0D
+CONFIG_NR_NUMA_NODES=3D2=0D
+# CONFIG_PV is not set=0D
+CONFIG_HVM=3Dy=0D
+# CONFIG_XEN_SHSTK is not set=0D
+# CONFIG_XEN_IBT is not set=0D
+# CONFIG_SHADOW_PAGING is not set=0D
+# CONFIG_BIGMEM is not set=0D
+# CONFIG_HVM_FEP is not set=0D
+# CONFIG_TBOOT is not set=0D
+CONFIG_XEN_ALIGN_DEFAULT=3Dy=0D
+# CONFIG_XEN_ALIGN_2M is not set=0D
+CONFIG_X2APIC_PHYSICAL=3Dy=0D
+# CONFIG_XEN_GUEST is not set=0D
+# CONFIG_HYPERV_GUEST is not set=0D
+# CONFIG_MEM_PAGING is not set=0D
+# CONFIG_MEM_SHARING is not set=0D
+# end of Architecture Features=0D
+=0D
+#=0D
+# Common Features=0D
+#=0D
+CONFIG_COMPAT=3Dy=0D
+CONFIG_CORE_PARKING=3Dy=0D
+CONFIG_GRANT_TABLE=3Dy=0D
+CONFIG_ALTERNATIVE_CALL=3Dy=0D
+CONFIG_ARCH_MAP_DOMAIN_PAGE=3Dy=0D
+CONFIG_GENERIC_BUG_FRAME=3Dy=0D
+CONFIG_HAS_ALTERNATIVE=3Dy=0D
+CONFIG_HAS_COMPAT=3Dy=0D
+CONFIG_HAS_EX_TABLE=3Dy=0D
+CONFIG_HAS_FAST_MULTIPLY=3Dy=0D
+CONFIG_HAS_IOPORTS=3Dy=0D
+CONFIG_HAS_KEXEC=3Dy=0D
+CONFIG_HAS_PDX=3Dy=0D
+CONFIG_HAS_SCHED_GRANULARITY=3Dy=0D
+CONFIG_HAS_UBSAN=3Dy=0D
+CONFIG_MEM_ACCESS_ALWAYS_ON=3Dy=0D
+CONFIG_MEM_ACCESS=3Dy=0D
+CONFIG_NEEDS_LIBELF=3Dy=0D
+CONFIG_NUMA=3Dy=0D
+=0D
+#=0D
+# Speculative hardening=0D
+#=0D
+CONFIG_INDIRECT_THUNK=3Dy=0D
+CONFIG_SPECULATIVE_HARDEN_ARRAY=3Dy=0D
+CONFIG_SPECULATIVE_HARDEN_BRANCH=3Dy=0D
+# end of Speculative hardening=0D
+=0D
+# CONFIG_HYPFS is not set=0D
+CONFIG_IOREQ_SERVER=3Dy=0D
+# CONFIG_KEXEC is not set=0D
+# CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP is not set=0D
+# CONFIG_XENOPROF is not set=0D
+# CONFIG_XSM is not set=0D
+# CONFIG_ARGO is not set=0D
+=0D
+#=0D
+# Schedulers=0D
+#=0D
+# CONFIG_SCHED_CREDIT is not set=0D
+CONFIG_SCHED_CREDIT2=3Dy=0D
+# CONFIG_SCHED_RTDS is not set=0D
+# CONFIG_SCHED_ARINC653 is not set=0D
+CONFIG_SCHED_NULL=3Dy=0D
+CONFIG_SCHED_CREDIT2_DEFAULT=3Dy=0D
+# CONFIG_SCHED_NULL_DEFAULT is not set=0D
+CONFIG_SCHED_DEFAULT=3D"credit2"=0D
+# end of Schedulers=0D
+=0D
+# CONFIG_LIVEPATCH is not set=0D
+# CONFIG_ENFORCE_UNIQUE_SYMBOLS is not set=0D
+# CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS is not set=0D
+CONFIG_CMDLINE=3D""=0D
+CONFIG_DOM0_MEM=3D""=0D
+# CONFIG_TRACEBUFFER is not set=0D
+# end of Common Features=0D
+=0D
+#=0D
+# Device Drivers=0D
+#=0D
+CONFIG_ACPI=3Dy=0D
+CONFIG_ACPI_LEGACY_TABLES_LOOKUP=3Dy=0D
+CONFIG_ACPI_NUMA=3Dy=0D
+CONFIG_HAS_NS16550=3Dy=0D
+CONFIG_HAS_EHCI=3Dy=0D
+CONFIG_SERIAL_TX_BUFSIZE=3D16384=0D
+# CONFIG_XHCI is not set=0D
+CONFIG_HAS_CPUFREQ=3Dy=0D
+CONFIG_HAS_PASSTHROUGH=3Dy=0D
+CONFIG_AMD_IOMMU=3Dy=0D
+# CONFIG_INTEL_IOMMU is not set=0D
+# CONFIG_IOMMU_QUARANTINE_NONE is not set=0D
+CONFIG_IOMMU_QUARANTINE_BASIC=3Dy=0D
+# CONFIG_IOMMU_QUARANTINE_SCRATCH_PAGE is not set=0D
+CONFIG_HAS_PCI=3Dy=0D
+CONFIG_HAS_PCI_MSI=3Dy=0D
+CONFIG_VIDEO=3Dy=0D
+CONFIG_VGA=3Dy=0D
+CONFIG_HAS_VPCI=3Dy=0D
+# end of Device Drivers=0D
+=0D
+CONFIG_EXPERT=3Dy=0D
+CONFIG_UNSUPPORTED=3Dy=0D
+CONFIG_ARCH_SUPPORTS_INT128=3Dy=0D
+=0D
+#=0D
+# Debugging Options=0D
+#=0D
+CONFIG_DEBUG=3Dy=0D
+# CONFIG_CRASH_DEBUG is not set=0D
+CONFIG_GDBSX=3Dy=0D
+CONFIG_FRAME_POINTER=3Dy=0D
+# CONFIG_COVERAGE is not set=0D
+# CONFIG_DEBUG_LOCK_PROFILE is not set=0D
+CONFIG_DEBUG_LOCKS=3Dy=0D
+# CONFIG_PERF_COUNTERS is not set=0D
+CONFIG_VERBOSE_DEBUG=3Dy=0D
+CONFIG_SCRUB_DEBUG=3Dy=0D
+# CONFIG_UBSAN is not set=0D
+# CONFIG_DEBUG_TRACE is not set=0D
+CONFIG_XMEM_POOL_POISON=3Dy=0D
+CONFIG_DEBUG_INFO=3Dy=0D
+# end of Debugging Options=0D
--=20
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 14:58:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 14:58:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569768.890855 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJUE-0005Ew-3o; Tue, 25 Jul 2023 14:58:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569768.890855; Tue, 25 Jul 2023 14:58:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJUE-0005En-05; Tue, 25 Jul 2023 14:58:06 +0000
Received: by outflank-mailman (input) for mailman id 569768;
 Tue, 25 Jul 2023 14:58:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=p13o=DL=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qOJUC-0004O3-KG
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 14:58:04 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a805113b-2afb-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 16:58:04 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.75.91])
 by support.bugseng.com (Postfix) with ESMTPSA id 49E694EE0739;
 Tue, 25 Jul 2023 16:58:03 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a805113b-2afb-11ee-b23f-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [XEN PATCH 3/4] automation: Add ECLAIR pipelines
Date: Tue, 25 Jul 2023 16:55:56 +0200
Message-Id: <5e0b4afa229e29914392ffee736129f5ec2462cd.1690294965.git.simone.ballarin@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690294965.git.simone.ballarin@bugseng.com>
References: <cover.1690294965.git.simone.ballarin@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add two pipelines that analyze an ARM64 and a X86_64 build with the
ECLAIR static analyzer on the guidelines contained in Set1.

The analysis configuration is stored in automation/eclair_analysis.

All commits on the xen-project/xen:staging branch will be analyzed
and their artifacts will be stored indefinitely; the integration will
report differential information with respect to the previous analysis.

All commits on other branches or repositories will be analyzed and
only the last ten artifacts will be kept; the integration will report
differential information with respect to the analysis done on the common
ancestor with xen-project/xen:staging (if available).

Currently the pipeline variable ENABLE_ECLAIR_BOT is set to "n".
Doing so disables the generation of comments with the analysis summary
on the commit threads. The variable can be set to "y" if the a masked
variable named ECLAIR_BOT_TOKEN is set with the impersonation token of
an account with enough privileges to write on all repositories.

Additionaly any repository should be able to read a masked variable
named WTOKEN with the token provided by BUGSENG.

The analysis fails if it contains violations of guidelines tagged as
clean:added. The list of clean guidelines are maintained in
automation/eclair_analysis/ECLAIR/tagging.ecl.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

--
Changes in v3:
- split definitions of the ECLAIR pipelines in a separate patch;
- if the WTOKEN variable is missing now the analysis fails immediately.

Changes in v2:
- add ECLAIR configuration files (before they were fetched from a separate
    repository);
- now the pipeline fails if there are new violations of guidelines tagged
    with clean:added.
---
 .gitlab-ci.yml                    |  2 ++
 automation/gitlab-ci/analyze.yaml | 38 +++++++++++++++++++++++++++++++
 automation/gitlab-ci/build.yaml   |  1 +
 automation/scripts/eclair         | 34 +++++++++++++++++++++++++++
 4 files changed, 75 insertions(+)
 create mode 100644 automation/gitlab-ci/analyze.yaml
 create mode 100755 automation/scripts/eclair

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c8bd7519d5..ee5430b8b7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,7 +1,9 @@
 stages:
+  - analyze
   - build
   - test
 
 include:
+  - 'automation/gitlab-ci/analyze.yaml'
   - 'automation/gitlab-ci/build.yaml'
   - 'automation/gitlab-ci/test.yaml'
diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
new file mode 100644
index 0000000000..3d8166572b
--- /dev/null
+++ b/automation/gitlab-ci/analyze.yaml
@@ -0,0 +1,38 @@
+.eclair-analysis:
+  stage: analyze
+  tags:
+    - eclair-analysis
+  variables:
+    ECLAIR_OUTPUT_DIR: "ECLAIR_out"
+    ANALYSIS_KIND: "normal"
+    ENABLE_ECLAIR_BOT: "n"
+    AUTO_PR_BRANCH: "staging"
+    AUTO_PR_REPOSITORY: "xen-project/xen"
+  artifacts:
+    when: always
+    paths:
+      - "${ECLAIR_OUTPUT_DIR}/*.log"
+      - "${ECLAIR_OUTPUT_DIR}/*.txt"
+      - '*.log'
+    reports:
+      codequality: gl-code-quality-report.json
+
+eclair-x86_64:
+  extends: .eclair-analysis
+  variables:
+    LOGFILE: "eclair-x86_64.log"
+    VARIANT: "X86_64"
+    RULESET: "Set1"
+  script:
+    - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
+  allow_failure: true
+
+eclair-ARM64:
+  extends: .eclair-analysis
+  variables:
+    LOGFILE: "eclair-ARM64.log"
+    VARIANT: "ARM64"
+    RULESET: "Set1"
+  script:
+    - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
+  allow_failure: true
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index c401f62d61..f01e2c32bb 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -11,6 +11,7 @@
       - '*.log'
       - '*/*.log'
     when: always
+  needs: []
   except:
     - master
     - smoke
diff --git a/automation/scripts/eclair b/automation/scripts/eclair
new file mode 100755
index 0000000000..55888617b3
--- /dev/null
+++ b/automation/scripts/eclair
@@ -0,0 +1,34 @@
+#!/bin/sh -eu
+
+ECLAIR_ANALYSIS_DIR=automation/eclair_analysis
+ECLAIR_DIR="${ECLAIR_ANALYSIS_DIR}/ECLAIR"
+ECLAIR_OUTPUT_DIR=$(realpath "${ECLAIR_OUTPUT_DIR}")
+
+if [ -z "${WTOKEN:-}" ]; then
+    echo "Failure: the WTOKEN variable is not defined." >&2
+    exit 1
+fi
+
+"${ECLAIR_ANALYSIS_DIR}/prepare.sh" "${VARIANT}"
+
+ex=0
+"${ECLAIR_DIR}/analyze.sh" "${VARIANT}" "${RULESET}" || ex=$?
+"${ECLAIR_DIR}/action_log.sh" ANALYSIS_LOG \
+                             "ECLAIR analysis log" \
+                             "${ECLAIR_OUTPUT_DIR}/ANALYSIS.log" \
+                             "${ex}"
+"${ECLAIR_DIR}/action_log.sh" REPORT_LOG \
+                             "ECLAIR report log" \
+                             "${ECLAIR_OUTPUT_DIR}/REPORT.log" \
+                             "${ex}"
+[ "${ex}" = 0 ] || exit "${ex}"
+"${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
+
+# Fail in case of new reports
+"${ECLAIR_DIR}/action_clean_added.sh" "${ECLAIR_OUTPUT_DIR}" || ex=$?
+"${ECLAIR_DIR}/action_log.sh" DIFF_CHECK_LOG \
+                             "ECLAIR diff check" \
+                             "${ECLAIR_OUTPUT_DIR}/clean_added.log" \
+                             "${ex}"
+
+[ "${ex}" = 0 ] || exit "${ex}"
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 14:58:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 14:58:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569771.890865 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJUO-0005hL-C5; Tue, 25 Jul 2023 14:58:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569771.890865; Tue, 25 Jul 2023 14:58:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOJUO-0005hC-8g; Tue, 25 Jul 2023 14:58:16 +0000
Received: by outflank-mailman (input) for mailman id 569771;
 Tue, 25 Jul 2023 14:58:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=p13o=DL=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qOJUN-0004O3-I7
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 14:58:15 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ae9a1701-2afb-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 16:58:15 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.161.75.91])
 by support.bugseng.com (Postfix) with ESMTPSA id 0656B4EE073E;
 Tue, 25 Jul 2023 16:58:13 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ae9a1701-2afb-11ee-b23f-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH 4/4] maintainers: Add ECLAIR reviewer
Date: Tue, 25 Jul 2023 16:55:57 +0200
Message-Id: <dfe59e554a25a180b9bece8fd6a0f9a142654004.1690294965.git.simone.ballarin@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690294965.git.simone.ballarin@bugseng.com>
References: <cover.1690294965.git.simone.ballarin@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

--
Changes in v3:
- split maintainer add in a separate patch;
- substitute blanks with tabs;
- fix file paths;
- change role from maintainer to reviewer.

Changes in v2:
- add ECLAIR configuration files (before they were fetched from a separate
  repository);
- now the pipeline fails if there are new violations of guidelines tagged
  with clean:added.
---
 MAINTAINERS | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 180e57dac4..66ff0ed710 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -305,6 +305,12 @@ F:	xen/include/xen/libfdt/
 F:	xen/include/xen/device_tree.h
 F:	xen/drivers/passthrough/device_tree.c
 
+ECLAIR
+R:	Simone Ballarin <simone.ballarin@bugseng.com>
+S:	Supported
+F: 	automation/eclair_analysis/
+F: 	automation/scripts/eclair
+
 EFI
 M:	Jan Beulich <jbeulich@suse.com>
 S:	Supported
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 15:40:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 15:40:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569794.890874 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOK96-0003Hm-Hq; Tue, 25 Jul 2023 15:40:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569794.890874; Tue, 25 Jul 2023 15:40:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOK96-0003Hf-FL; Tue, 25 Jul 2023 15:40:20 +0000
Received: by outflank-mailman (input) for mailman id 569794;
 Tue, 25 Jul 2023 15:40:19 +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
 <SRS0=0Hqi=DL=citrix.com=prvs=563c090bc=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qOK95-0003HZ-6O
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 15:40:19 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8ca8a316-2b01-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 17:40:16 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8ca8a316-2b01-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690299616;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=6Cvekg3BhRzyP7fDHWicLvsGca0I3Fn93MuBXtz7KW0=;
  b=A5GcSwKKbGLQKJ9NDEVH9sEbkEgFgkyjybeZm+LAlOkdJKwjAVQHi3O7
   WuEMyl09EqfoyXKxi2vUUKm/uP10fVkyUPLpTj4ZY4gcCCwlZh890csQs
   YUGnNp+K1zSdTH7XuNNIKQ1/13vLgIyp7NnIaTQmRINkgpJWw1PrF2mYI
   4=;
Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 120006801
X-Ironport-Server: esa4.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:Orpo76rJwLvfBVsE79u84HV9GIteBmLBZRIvgKrLsJaIsI4StFCzt
 garIBmOPKuINmbxe95/bIm28hwDvJLSz4RiS1Blqyg0Fy5GopuZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weBzSRNVfrzGInqR5fGatgMdgKFb
 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo
 OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay
 RAXADUoNkGg3siU/KiAG+pK2JgAMcbCDKpK7xmMzRmBZRonaZXKQqGM7t5ExjYgwMtJGJ4yZ
 eJAN2ApNk6ZJUQSZBFOUslWcOSA3xETdxVRrk6VoqwmpXDe1gVr3JDmMcbPe8zMTsJQ9qqdj
 jucpzyhXEFCbbRzzxKqrkidwfHqxBrCc70WKaDl8dN1pxq6kzl75Bo+CgLg/KjRZlSFc8pSN
 0EOvCopvKUp3EWxS5/2WBjQiG6JuFsQVsRdF8U+6RqR0ezE7gCBHG8GQzVdLts8u6ceTzEwy
 kWAmd+vADV1qaCUUlqU7LLSpjS3UQAKIG5Ebi8JSyMM+dylq4Y25jrLU91qVqC8iNb4HTXt6
 zmQqW41gLB7pdEP/7W2+xbAmT3EjpHRQxQ8/An/QmOv5QQ/b4mgD7FE8nCCs6wGdtzACADc4
 j5dwZP2AP0y4Y+lkQnVEcZUNpOV/c3UMxuC3X1yELAR3mH4k5K8Rry88A2SNW8wbJdcI2CzO
 xKK0e9CzMQNZSX3NMebd6r0Up13lva4SLwJQ9iONrJzjo5NmBhrFc2ETWqZxCjTnUclisnT0
 r/LIJ/3XR725UmKpQdaptvxMpdxnEjSPUuJGfjGI+2PiNJynkK9R7YfK0epZesk9q6Cqwi92
 48BZpPQkU4DALKiOXW/HWsvwbYidyNT6Xfe8pI/SwJ+ClA+RDFJ5wH5nNvNhLCJb4wKz7yVr
 xlRq2dTyUblhG2vFOl5QikLVV8bZr4m9ShTFXV1bT6VN40LPd7HAFE3K8FmItHKNYVLkZZJc
 hXyU5zdWqsfEmqdplzwr/DV9eRfSfhivirWVwLNXdT1V8cIq9DhkjM8QjbSyQ==
IronPort-HdrOrdr: A9a23:JtnFVa77WrNq9eOIuAPXwAzXdLJyesId70hD6qkQc3Fom62j5q
 WTdZEgvyMc5wx/ZJhNo7690cq7MBHhHPxOgbX5VI3KNGXbUQOTR72KhrGSoAEIdReeygZcv5
 0QCZSXCrfLfCVHZRCR2njFLz4iquP3j5xBnY3lvhNQpZkBUdAZ0+9+YDzrdXFedU19KrcSMo
 GT3cZDryrIQwVtUizqbkN1OdQqvrfw5evbXSI=
X-Talos-CUID: =?us-ascii?q?9a23=3AJ5z/LmgFSlAZGzdos6P4Ff/DjzJud1iFnVSJCW2?=
 =?us-ascii?q?EE104S5vLFXyN94pUup87?=
X-Talos-MUID: =?us-ascii?q?9a23=3ADnhxsQ8XgBZnT5KJ0DTDDr2Qf+g02ZXpFmVUqKw?=
 =?us-ascii?q?thM25KHF3Fii6yx3iFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,230,1684814400"; 
   d="scan'208";a="120006801"
Date: Tue, 25 Jul 2023 16:40:03 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Peter Hoyes <peter.hoyes@arm.com>
CC: <xen-devel@lists.xenproject.org>, <bertrand.marquis@arm.com>,
	<wei.chen@arm.com>, <luca.fancellu@arm.com>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH v5 1/2] tools/console: Add escape argument to configure
 escape character
Message-ID: <1848b8d5-e6c4-4928-a340-603481d9f96a@perard>
References: <20230712102917.37763-1-peter.hoyes@arm.com>
 <20230712102917.37763-2-peter.hoyes@arm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230712102917.37763-2-peter.hoyes@arm.com>

On Wed, Jul 12, 2023 at 11:29:16AM +0100, Peter Hoyes wrote:
> From: Peter Hoyes <Peter.Hoyes@arm.com>
> 
> Dom0 may be accessed via telnet, meaning the default escape character
> (which is the same as telnet's) cannot be directly used to exit the
> console. It would be helpful to make the escape character customizable
> in such use cases.
> 
> Add --escape argument to console tool for this purpose.
> 
> Add argument to getopt options, parse and validate the escape character
> and pass value to console_loop.
> 
> If --escape is not specified, it falls back to the existing behavior
> using DEFAULT_ESCAPE_SEQUENCE.
> 
> Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>

Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 15:43:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 15:43:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569798.890884 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKC6-0003uT-3G; Tue, 25 Jul 2023 15:43:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569798.890884; Tue, 25 Jul 2023 15:43:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKC6-0003uM-0Y; Tue, 25 Jul 2023 15:43:26 +0000
Received: by outflank-mailman (input) for mailman id 569798;
 Tue, 25 Jul 2023 15:43:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=h5PA=DL=arm.com=bertrand.marquis@srs-se1.protection.inumbo.net>)
 id 1qOKC4-0003uG-Uo
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 15:43:24 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTP
 id fc85dcc6-2b01-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 17:43:23 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A4D6915DB;
 Tue, 25 Jul 2023 08:44:05 -0700 (PDT)
Received: from C3HXLD123V.emea.arm.com (C3HXLD123V.cambridge.arm.com
 [10.1.38.25])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4CD6F3F6C4;
 Tue, 25 Jul 2023 08:43:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fc85dcc6-2b01-11ee-b23f-6b7b168915f2
From: Bertrand Marquis <bertrand.marquis@arm.com>
To: xen-devel@lists.xenproject.org
Cc: jens.wiklander@linaro.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH v3] xen/arm: Move TEE mediators in a kconfig submenu
Date: Tue, 25 Jul 2023 16:42:37 +0100
Message-Id: <5f10382a15ca7b221a052915347e4e59f66b001f.1690297570.git.bertrand.marquis@arm.com>
X-Mailer: git-send-email 2.39.2 (Apple Git-143)
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rework TEE mediators to put them under a submenu in Kconfig.
The submenu is only visible if UNSUPPORTED is activated as all currently
existing mediators are UNSUPPORTED.

While there rework a bit the configuration so that OP-TEE and FF-A
mediators are selecting the generic TEE interface instead of depending
on it.
Make the TEE option hidden as it is of no interest for anyone to select
it without one of the mediators so having them select it instead should
be enough.

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
Changes in v3:
- automatically compile in tee instead of using CONFIG_TEE for it
  (Makefile is only included if CONFIG_TEE is selected)
- remove commit message paragraph on Makefile inclusion which was not
  true anymore
Changes in v2:
- only included tee subdirectory in makefile if CONFIG_TEE is selected
  (reverts to state before patch)
- remove help in hidden TEE config
- rebase on top of staging
---
 xen/arch/arm/Kconfig     |  7 -------
 xen/arch/arm/tee/Kconfig | 17 ++++++++++++++---
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 439cc94f3344..fd57a82dd284 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -175,13 +175,6 @@ config ARM64_BTI
 	  Branch Target Identification support.
 	  This feature is not supported in Xen.
 
-config TEE
-	bool "Enable TEE mediators support (UNSUPPORTED)" if UNSUPPORTED
-	default n
-	help
-	  This option enables generic TEE mediators support. It allows guests
-	  to access real TEE via one of TEE mediators implemented in XEN.
-
 source "arch/arm/tee/Kconfig"
 
 config STATIC_SHM
diff --git a/xen/arch/arm/tee/Kconfig b/xen/arch/arm/tee/Kconfig
index db3ea78faaaa..c5b0f88d7522 100644
--- a/xen/arch/arm/tee/Kconfig
+++ b/xen/arch/arm/tee/Kconfig
@@ -1,7 +1,14 @@
+menu "TEE mediators"
+	visible if UNSUPPORTED
+
+config TEE
+	bool
+	default n
+
 config OPTEE
-	bool "Enable OP-TEE mediator"
+	bool "Enable OP-TEE mediator (UNSUPPORTED)" if UNSUPPORTED
 	default n
-	depends on TEE
+	select TEE
 	help
 	  Enable the OP-TEE mediator. It allows guests to access
 	  OP-TEE running on your platform. This requires
@@ -12,10 +19,14 @@ config OPTEE
 config FFA
 	bool "Enable FF-A mediator support (UNSUPPORTED)" if UNSUPPORTED
 	default n
-	depends on ARM_64 && TEE
+	depends on ARM_64
+	select TEE
 	help
 	  This option enables a minimal FF-A mediator. The mediator is
 	  generic as it follows the FF-A specification [1], but it only
 	  implements a small subset of the specification.
 
 	  [1] https://developer.arm.com/documentation/den0077/latest
+
+endmenu
+
-- 
2.39.2 (Apple Git-143)



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 15:45:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 15:45:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569803.890895 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKDj-0004Tm-EG; Tue, 25 Jul 2023 15:45:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569803.890895; Tue, 25 Jul 2023 15:45:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKDj-0004Td-Ab; Tue, 25 Jul 2023 15:45:07 +0000
Received: by outflank-mailman (input) for mailman id 569803;
 Tue, 25 Jul 2023 15:45:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qOKDh-0004TV-RP
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 15:45:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qOKDh-0005Ve-H6; Tue, 25 Jul 2023 15:45:05 +0000
Received: from 54-240-197-238.amazon.com ([54.240.197.238]
 helo=[192.168.17.43]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qOKDh-0001yr-AA; Tue, 25 Jul 2023 15:45:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=PDTYKzN7S7kcIyhgQOHkR0Mk7BjSUmWeSQ/cy7y3oCE=; b=RNejiyDRg9bXxfWXuDeCK9BplW
	aKnVtZxqvDWVHtV2kBSKMoaPV7I2FABn3v3XVdz1MYHBqHpu1fO3mTHORV3Nlxs3g+zG7ujwfGNsS
	Mpo+c7V8KWrbHbNRmGnLo4SLxgF8j5VgKJVI/NGYOuq9ctObBph8yUs2DRhdGpxx9xNE=;
Message-ID: <bfa643fe-4b8f-c8bf-2b13-fd699c6816c5@xen.org>
Date: Tue, 25 Jul 2023 16:45:03 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v3] xen/arm: Move TEE mediators in a kconfig submenu
Content-Language: en-US
To: Bertrand Marquis <bertrand.marquis@arm.com>,
 xen-devel@lists.xenproject.org
Cc: jens.wiklander@linaro.org, Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <5f10382a15ca7b221a052915347e4e59f66b001f.1690297570.git.bertrand.marquis@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <5f10382a15ca7b221a052915347e4e59f66b001f.1690297570.git.bertrand.marquis@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Bertrand,

On 25/07/2023 16:42, Bertrand Marquis wrote:
> Rework TEE mediators to put them under a submenu in Kconfig.
> The submenu is only visible if UNSUPPORTED is activated as all currently
> existing mediators are UNSUPPORTED.
> 
> While there rework a bit the configuration so that OP-TEE and FF-A
> mediators are selecting the generic TEE interface instead of depending
> on it.
> Make the TEE option hidden as it is of no interest for anyone to select
> it without one of the mediators so having them select it instead should
> be enough.
> 
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>

Reviewed-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 15:52:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 15:52:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569805.890905 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKKv-0005x4-5Q; Tue, 25 Jul 2023 15:52:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569805.890905; Tue, 25 Jul 2023 15:52:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKKv-0005wx-1U; Tue, 25 Jul 2023 15:52:33 +0000
Received: by outflank-mailman (input) for mailman id 569805;
 Tue, 25 Jul 2023 15:52:32 +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
 <SRS0=0Hqi=DL=citrix.com=prvs=563c090bc=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qOKKu-0005wr-Ld
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 15:52:32 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 41cae32c-2b03-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 17:52:29 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 41cae32c-2b03-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690300350;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=Y1wruseCD2zoRQ4cVTciOKpdQ3aEXElslBWGnvk5vok=;
  b=TG8BRv9W4q6gisYMbiPwkypoxZJVPjINNJEnH+BFVJ+jligFcRAys7b4
   7vKonrWc00KhMnP6a9dmMJs4jp4SuxO2ulY+7vUVhbI/cEXC8+X69eu1/
   AHsdZWOKZc4wuVgxPC+6FntQWXWR2JdFjAOSUlLty2DB8GQlQSkmzQ+IP
   4=;
Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 117820925
X-Ironport-Server: esa1.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:hUD2KaIeFmHtzW0kFE+ROZUlxSXFcZb7ZxGr2PjKsXjdYENS02cGy
 2RLDDrUbP+KajbyKNh1bNu/90MOv5XXz4I2TABlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws
 Jb5rta31GWNglaYCUpKrfrawP9TlK6q4mhA4QZjPakjUGL2zBH5MrpOfcldEFOgKmVkNrbSb
 /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/
 jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5cJG5O9
 MEzIQstNCHchuyZkK+mSORj05FLwMnDZOvzu1llxDDdS/0nXYrCU+PB4towMDUY354UW6yEP
 oxANGQpNU6bC/FMEg5/5JYWleG0hn75YntApUicv6Yf6GnP1g1hlrPqNbI5f/TTHJoFxB7J/
 D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67CXYqZBbalgWnWqZyfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,230,1684814400"; 
   d="scan'208";a="117820925"
Date: Tue, 25 Jul 2023 16:52:23 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Peter Hoyes <peter.hoyes@arm.com>
CC: <xen-devel@lists.xenproject.org>, <bertrand.marquis@arm.com>,
	<wei.chen@arm.com>, <luca.fancellu@arm.com>, Wei Liu <wl@xen.org>, Juergen
 Gross <jgross@suse.com>
Subject: Re: [PATCH v5 2/2] xl: Add escape character argument to xl console
Message-ID: <3584fc4a-7015-4a2c-9b6b-927b70affa78@perard>
References: <20230712102917.37763-1-peter.hoyes@arm.com>
 <20230712102917.37763-3-peter.hoyes@arm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230712102917.37763-3-peter.hoyes@arm.com>

On Wed, Jul 12, 2023 at 11:29:17AM +0100, Peter Hoyes wrote:
> @@ -1968,9 +1979,12 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
>   * guests using pygrub.
>   * If notify_fd is not -1, xenconsole will write 0x00 to it to nofity
>   * the caller that it has connected to the guest console.
> + * If escape_character is not NULL, the provided value is used to exit
> + * the guest console.
>   */
>  int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm,
> -                               int notify_fd);
> +                               int notify_fd,
> +                               char* escape_character);
>  
>  #if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040800
>  
> @@ -1989,6 +2003,25 @@ static inline int libxl_primary_console_exec_0x040700(libxl_ctx *ctx,
>  }
>  #define libxl_primary_console_exec libxl_primary_console_exec_0x040700
>  
> +#elif defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x041800
> +
> +static inline int libxl_console_exec_0x041800(libxl_ctx *ctx, uint32_t domid,

Is is preferred to name these compatibility function with the version of
Xen that last presented this API, so could you rename it to
"libxl_console_exec_0x041700" ?

> +                                              int cons_num,
> +                                              libxl_console_type type,
> +                                              int notify_fd)
> +{
> +    return libxl_console_exec(ctx, domid, cons_num, type, notify_fd, NULL);
> +}
> +#define libxl_console_exec libxl_console_exec_0x041800
> +
> +static inline int libxl_primary_console_exec_0x041800(libxl_ctx *ctx,

Same thing here.

> +                                                      uint32_t domid_vm,
> +                                                      int notify_fd)
> +{
> +    return libxl_primary_console_exec(ctx, domid_vm, notify_fd, NULL);
> +}
> +#define libxl_primary_console_exec libxl_primary_console_exec_0x041800
> +

Also, could you add the extra NULL argument in the function call of both
"libxl_console_exec_0x040700()" and
"libxl_primary_console_exec_0x040700()" ?

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 15:52:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 15:52:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569807.890915 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKLK-0006R5-DJ; Tue, 25 Jul 2023 15:52:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569807.890915; Tue, 25 Jul 2023 15:52:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKLK-0006Qy-9u; Tue, 25 Jul 2023 15:52:58 +0000
Received: by outflank-mailman (input) for mailman id 569807;
 Tue, 25 Jul 2023 15:52:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qOKLI-0006Qg-Sv
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 15:52:56 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qOKLI-0005nZ-9M; Tue, 25 Jul 2023 15:52:56 +0000
Received: from 54-240-197-238.amazon.com ([54.240.197.238]
 helo=[192.168.17.43]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qOKLI-0002F6-2U; Tue, 25 Jul 2023 15:52:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=7qDZFJRj2LL7ebMZ3E20PUwjJ7m7lGtYgIZd/Kgbkeg=; b=Z2CgkqMU9Gsi6ySywBByQzV3cy
	AbAk8HlZK64fk0WHaBJt8acFPeTp97+PYtdK6QNDdmlVRcQURZtZtcPbuq9RRAGqad6YjRlYPxIRU
	LTr0HYv8knAn8Xjf/F5coRZuX8TxoNOlfnzduvfJQaToiZbLkdASpeBFwvqqzSe9VAvk=;
Message-ID: <7ea8ac60-cda6-0f6f-d203-c9ed153b45bc@xen.org>
Date: Tue, 25 Jul 2023 16:52:54 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v3 1/2] tools/xenstore: add const to the return type of
 canonicalize()
Content-Language: en-US
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724103324.4207-1-jgross@suse.com>
 <20230724103324.4207-2-jgross@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230724103324.4207-2-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 24/07/2023 11:33, Juergen Gross wrote:
> The return type of canonicalize() can be modified to const char *.
> This avoids the need to cast the const away from the input parameter.
> 
> There need to be quite some other functions modified to take const
> parameters in order to avoid further casts.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 16:01:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 16:01:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569815.890924 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKTY-00006S-5e; Tue, 25 Jul 2023 16:01:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569815.890924; Tue, 25 Jul 2023 16:01:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKTY-00006L-38; Tue, 25 Jul 2023 16:01:28 +0000
Received: by outflank-mailman (input) for mailman id 569815;
 Tue, 25 Jul 2023 16:01:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qOKTX-00006F-2b
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 16:01:27 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qOKTW-0006Wp-8D; Tue, 25 Jul 2023 16:01:26 +0000
Received: from 54-240-197-238.amazon.com ([54.240.197.238]
 helo=[192.168.17.43]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qOKTW-0002jH-1u; Tue, 25 Jul 2023 16:01:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=TTddz3KDHA+u9P8uLHSBtOip9rReMIppMTqy0uZHQZ0=; b=zBQm3AMSSEulvFIJBLE0yTaQ4C
	h9gsmoStonFhnjlzwOXRgA9+4n8R3l8tzVMxVRYUb2oXExisW2kfJVG5wIEfzrYsVCUbUz+dAnMiV
	5oEGI8pC1iwhH31u5cteEj1hhjWvkFTxQ+unBif99i0DkXX05HWmCMyoU2v/uXLKSFBA=;
Message-ID: <c5314cd4-eba6-0dba-1fd0-77cdbc710a0a@xen.org>
Date: Tue, 25 Jul 2023 17:01:24 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v3 01/25] tools/xenstore: explicitly specify create or
 modify for tdb_store()
Content-Language: en-US
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-2-jgross@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230724110247.10520-2-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 24/07/2023 12:02, Juergen Gross wrote:
> Instead of using TDB_REPLACE for either creating or modifying a TDB
> entry, use either TDB_INSERT or TDB_MODIFY when calling tdb_store().
> 
> At higher function levels use the abstract mode values NODE_CREATE
> and NODE_MODIFY.
> 
> This is for preparing to get rid of TDB, even if it is beneficial
> while using TDB, too.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 16:06:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 16:06:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569819.890935 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKYM-0000kg-P0; Tue, 25 Jul 2023 16:06:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569819.890935; Tue, 25 Jul 2023 16:06:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKYM-0000kZ-Ln; Tue, 25 Jul 2023 16:06:26 +0000
Received: by outflank-mailman (input) for mailman id 569819;
 Tue, 25 Jul 2023 16:06:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+x6f=DL=citrix.com=prvs=56398a583=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qOKYL-0000kT-DU
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 16:06:25 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3246ab96-2b05-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 18:06:23 +0200 (CEST)
Received: from mail-dm6nam11lp2172.outbound.protection.outlook.com (HELO
 NAM11-DM6-obe.outbound.protection.outlook.com) ([104.47.57.172])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 25 Jul 2023 12:06:10 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by CH0PR03MB6164.namprd03.prod.outlook.com (2603:10b6:610:d3::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 16:06:07 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::edfe:6f64:4048:74c5]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::edfe:6f64:4048:74c5%4]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 16:06:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3246ab96-2b05-11ee-b23f-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690301183;
  h=message-id:date:subject:to:references:from:in-reply-to:
   content-transfer-encoding:mime-version;
  bh=OMQNM4VLCi7n21BjBDs1ywkoV83r40LGs7LFx/Eczuo=;
  b=Tl1bYUrmG/Aj1nHcstksckCQN+XKC5QVrCV1QVefaw2qnSzL5hDBts7a
   WOGrisUhkhOpYJpRGJMnZo+7659gUWufjxNoNTnykKvcvW/Do4J8uAWpo
   z+IgTkr3w13F6ME/KlybukRZjXDykZGy4uNOdznWK2mxiXpzzKZjT8TJs
   I=;
X-IronPort-RemoteIP: 104.47.57.172
X-IronPort-MID: 116679881
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:ue5dp6oP1fPj7V7aKjr2OpqhfK5eBmIHZBIvgKrLsJaIsI4StFCzt
 garIBmCO6yJNmf2fIx2PY3k8hgO6pPWyoVkGwU6rCphQSIXo5uZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weBzSRNVfrzGInqR5fGatgMdgKFb
 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo
 OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay
 RAXADALZTWTjc+Y+beyWM512MINCs3aBZxK7xmMzRmBZRonabbqZvyToPN9gnI3jM0IGuvCb
 c0EbzYpdA7HfxBEJlYQDtQ5gfusgX78NTZfrTp5p4JuuzSVkFM3jeeraYWPEjCJbZw9ckKwj
 2TK5WnmRDodM8SS02Gt+XOwnO7f2yj8Xer+EZXhr6A03wzDljV75Bs+dgCRrOOFqU6CQ+1FD
 hI5pAAqiLkj3Rn+JjX6d1jiyJKehTYeVMBXCPYS8xyWx+zf5APxLngJSHtNZcIrsOcyRCc2z
 RmZktXxHzttvbaJD3WH+d+pQSiaPCEUKSoOYHECRA5cut37+ths1FTIU8ppF7OzgpvtAzbsz
 juWrS84wbIOkcoM0Kb99lfC696xmqX0oscOzl2/dgqYAslRP+ZJu6TABYDn0Mt9
IronPort-HdrOrdr: A9a23:050f6K0hoSmBiRJXf40uFwqjBJkkLtp133Aq2lEZdPU1SL38qy
 nKpp536faaslossR0b9uxoQZPwOE80lqQFg7X5X43DYOCOggLBEGgF1+XfKlbbak7DH4BmtJ
 uIRJIObOEYXWIQsS8j2njCLz/7+qjgzEl0v5a4856wd3ATV0i/1XYCNjqm
X-Talos-CUID: =?us-ascii?q?9a23=3AjxqhK2sbjLjk2v+cYHJfNai86IsldHb43H39DXa?=
 =?us-ascii?q?9AHROUeOTZ3mUyZp7xp8=3D?=
X-Talos-MUID: 9a23:yUVY5AZwTreYB+BTlGTGiSteF8dU+5u0LR4gz78CntiVHHkl
X-IronPort-AV: E=Sophos;i="6.01,230,1684814400"; 
   d="scan'208";a="116679881"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=f+iNdBAp1KWD97WGNYl1i0bkSJm4R5FaBJiG0PPIB2DLSRkNIkVLekJSHMi9v6QH6n3VdnvlPeRCgGfrwNNPQGnln+2H5sW4Xec1BmaWt2yzT2UMroMwo8ENq0wRqtvi028pTjGBcoFo/saKzNlnyjHvIfoVpVUr/H0tPz5ZV/yL4yazL5Eqn8XQbAxsrm8KZ79mCWDcTiOz7MzRfOtlBVeqxX4VKuiKTuR32gtMjHrXZSdAgcrcDWOKZaV+fcgK6UrwgxJ+dOR6tMPfc3VzgCnEQY++aa67RGFnitNjyBHFvRkZ0S8JlYxLnm1uN09XV2AqnJEMKCs5n0iPwmD2VQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OMQNM4VLCi7n21BjBDs1ywkoV83r40LGs7LFx/Eczuo=;
 b=meR9CQHeTPxaXQD3BBV+2RArzDcqmIC/YAHnOb21BvUBx+2PMmt1nJC5306J+xueKhvhGsKKCd2xcOFgolk0tYc/gC5aj2GoZNECf4U6nj9/PEuMZdtvRGKWLdz4ze+vWZsNnwFuVXffRosmrR84A9Xz2PHuR9t1jnRiN+dAZ6F0D9UwGThNl79sV3k2BWIZFbd9R/PXt/3Z5cmkOHSXm8VjYR9b0UEX0BemO7rnXUqJ1Vy60UGbeninQ5spbF8HakkOF9XgBhoRRR0bUsG8DMSBp5iLT648yIFXZ0lajqjARszShVyEQnfpMknf+L/ommDbiAfVdSbUflPT5ieHhg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OMQNM4VLCi7n21BjBDs1ywkoV83r40LGs7LFx/Eczuo=;
 b=Cgv7x2uSoGDEanFof2AlEwCBGEaQtJ6DapbisFKman1ObLTtUBWJ1poKlWhmnJu3PkfwpWL6f7VKFfkx73IGctJnGDtSyQ/4LF90Y+6tAesG62oqIb/R05A2NX+JO7P3QrDq+l2O3m5Ul8k4E+XTUDjL1IFe4xRfc4y8iFwihmc=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <9db9facc-c5af-d0b1-28d6-cc8d2886dec5@citrix.com>
Date: Tue, 25 Jul 2023 17:06:01 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] xen/public: fix flexible array definitions
Content-Language: en-GB
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
References: <20230725135557.20518-1-jgross@suse.com>
From: Andrew Cooper <andrew.cooper3@citrix.com>
In-Reply-To: <20230725135557.20518-1-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO3P123CA0003.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:ba::8) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|CH0PR03MB6164:EE_
X-MS-Office365-Filtering-Correlation-Id: 07d4f899-3207-478d-a163-08db8d290d6c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	UBR7R/4leFh4TPXGuUpf6K+g0VGrxyhqGXr71AZkFEhoMuPTl1lkubde4XU6UUHi6W2zhiapSWctrcQMcWK237DUXhIhaWFGhNXYVf4g0Zoz8YVW1NKhEbFCG6ytsWzVohXzmxE+SsCgMMm9XWUzy/CWZVSmjIp932KGOuqj3zmMy+qYgaiDw/DkrewgOjN3jEx8iRRneypTb0NS963swEr8OCMz6/PAWMJfa3GSIRjMq+EaZdf+8H6j2R67YZaUGVRZUdNnrePSnDJovLskzTzbKUHYvZ9p2Mn5o9kYAPjWm9pHKaoL+fGi5E9d6nVYQVE3CcTrUdH6GahFiZDvHYQoR/ZH0VfCn88HxS8LGsXTwYRTUPsDOqyBdN1OYfHF5C1drPs32SmPGVwIrZUsfwkH4o53LG7uZ407H7EvqCNgxiWJWtMs+UefoPC2LQu9qAszXSTvQgzR8DDSQvPcwsdK+C5L3+AbL1YF/svW4XALmX5ygDO0+XcUpRE1J5huJ+w72+IfER33nuLjIQOH5GjPYVLbxocFgqr8iYGFKcPLKwWa7iSmxh8A7NURu2b0X/54nADrmMgwdYyyrmXC0ZTHdZN3/acAX5nm4KADmd7WkM4QipBUzUngUrIYMKYnFuUH0Y+DYxT3ctOcoObxpA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(39860400002)(376002)(396003)(366004)(451199021)(31686004)(8676002)(8936002)(5660300002)(41300700001)(316002)(2906002)(66946007)(66476007)(66556008)(6486002)(6512007)(26005)(4744005)(53546011)(478600001)(186003)(966005)(6506007)(6666004)(31696002)(82960400001)(86362001)(36756003)(2616005)(83380400001)(38100700002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?c2lTaTZEVUpQYkZqNDUxdldwRnNvSjhhM1FjVE5jODJYek5vMTBRK05pZi83?=
 =?utf-8?B?OUQ0R0RiTHFKS3U3dFlpQjJJQk1CeU02YlkyZXFvV0toTnkzRHNpUk15R0F6?=
 =?utf-8?B?MldoUHFjY3JQUE54aUpwVT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Rk5q3CZBMbdzDZjW0D/kU5xsTTfWZwnyGpJN/AcAXXyfxr3mfEhNg/38DXOMzXMbpo4NnGlCpNVgSkBRFRa4w6AWl5kS943XOygb9KUMfyy4eiNxcCRrapx6HXi1I0xYmCh/F6kzGmL/bxl5hFNPO+u9dH0YxniYPQu2F0RtrWhZzrilwbpkCT1uzTP8=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 07d4f899-3207-478d-a163-08db8d290d6c
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 16:06:06.7491
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: VxH8znpnO88bbpRaja9S3mdEisODc9aYa1lQtG2OLqqHGSMIIjQUkRQjKVSW1bQizI3CF1aHmdD4VBTqksGKGJQHxsxYZI/JPrjGhXvDnhA=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR03MB6164

On 25/07/2023 2:55 pm, Juergen Gross wrote:
> Flexible arrays in public headers can be problematic with some
> compilers.
>
> Replace them with arr[XEN_FLEX_ARRAY_DIM] in order to avoid compilation
> errors.
>
> This includes arrays defined as "arr[1]", as seen with a recent Linux
> kernel [1].
>
> [1]: https://bugzilla.kernel.org/show_bug.cgi?id=217693
>
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 16:07:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 16:07:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569822.890944 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKZV-0001M1-54; Tue, 25 Jul 2023 16:07:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569822.890944; Tue, 25 Jul 2023 16:07:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKZV-0001Lu-2U; Tue, 25 Jul 2023 16:07:37 +0000
Received: by outflank-mailman (input) for mailman id 569822;
 Tue, 25 Jul 2023 16:07:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=A3G+=DL=citrix.com=prvs=56320e048=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOKZT-0001Lg-9j
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 16:07:35 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5c9362df-2b05-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 18:07:34 +0200 (CEST)
Received: from mail-mw2nam12lp2048.outbound.protection.outlook.com (HELO
 NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.48])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 25 Jul 2023 12:07:31 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by PH8PR03MB7269.namprd03.prod.outlook.com (2603:10b6:510:252::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.30; Tue, 25 Jul
 2023 16:07:29 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6609.031; Tue, 25 Jul 2023
 16:07:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5c9362df-2b05-11ee-b23f-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690301253;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=AUxdY+yMaqXwLb/PqgCbDwmaoqHnadfaQ2wNhDTrHy4=;
  b=PlECX8bjeAm7AuVUyTgfp9mNfa3IszxMgSM+KS5YLx/C9QrvzsmQ5LJb
   8iFFz1RZLNkVl52vHTRtWwOPLpsC3EKXEU8CgQ/EiOnpjgx4cU+y3O5iE
   U0CmqWoiBGZoTLdoQ3a8flUzqaErhVtz4gqMPsc7M/qauozOrcnh0I7CQ
   U=;
X-IronPort-RemoteIP: 104.47.66.48
X-IronPort-MID: 117410037
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:KffMHqB7Kx1WrhVW/wziw5YqxClBgxIJ4kV8jS/XYbTApGh33zAFn
 DQcDTvQOvmMazP9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ii?q?CIDhSVI+IT2Sp9K80up87?=
X-Talos-MUID: 9a23:efKW1QhQ0qk1SM8xoAgvuMMpbJx2uaiNT2A3qssJh8m7aG8vMmyntWHi
X-IronPort-AV: E=Sophos;i="6.01,230,1684814400"; 
   d="scan'208";a="117410037"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=iheyAoISehwLSc/ZSxwn5jfio3chab3tTyJqU2dGDdzwEK1NaXzBTmX5OlbHukekj6Q8mERoXWSTNCEBddSXDRg046NCXpHpX7H4xtGiPaFB7bZRWftPw8VbYhrmt4W/bm6GoWII+zHCeqNj79QlI5k06IOeC9JwcZh2sp7s1RRR7kq0r56xxS6/ayiZ0N8xWp+uXQURIzLz9IZ04mehDqurnX3+52rjTvKlz/rBspsp04JBh8C/SLwHMfJCvFT1GDMZKrmzqAOU0IK2TLMU2eKDsvXZ6nsbVvrBNAQioMuYWpiyNSkm+v4mIa6eSyQRoAONH9C6WMdcJ0s3UzwRUQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=HWt6rW5kl9y6UOoEZ/2TMh97gnV/HRaeV3GhylKQ9U4=;
 b=FpAJxSN+c061y6p83Hmf3LxG19LHUuh6OGawC2jpkaY7erg1G2UVMIuhUGF6MCcpTY7xAciKw5sLGWWvadxZk5jRJt+75rRpuY9aHP4OB6MEv+1LXLxvn57elTQZDWdkEtT2V6SAJnzJKkVyygYMaOI/yF6q9uouSlK0dBBulLmgdTKHTGBZ0AZzY7SqkksS58Hve+tXMwDQwFz79BexmHmY9aZ1Q5H3I+okwbAVLU/sqn9oe7e8mbKxvi1BmwPyLmAnH0qCe+RkcR3V+ge+RFF9IdQaR5aneGVPSTRLxx7t+3n/Bf+5NeITm73T1W28TVZcMLjA84sbT7ES6bBDyg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=HWt6rW5kl9y6UOoEZ/2TMh97gnV/HRaeV3GhylKQ9U4=;
 b=WStA4hSFVWI2gPRpNlbQrSQ6nwlm84cbMS9ohVbrYrvBADXDPI174tNqIn5Tb+Mo19O3kMvFg7hmQbW+rvl86dLNVm1Q+WR9qUwDsMTjCPPjTw9L5LMDifBZrqvMIbJY0YPFAx7+rftrM/tQC5kn0xr6MOj0nVo8ynJLGh0RbHo=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Tue, 25 Jul 2023 18:07:23 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v4 3/6] libxl: introduce MSR data in libxl_cpuid_policy
Message-ID: <ZL_zO5AqlldLYY3A@MacBook-Air-de-Roger.local>
References: <20230725130558.58094-1-roger.pau@citrix.com>
 <20230725130558.58094-4-roger.pau@citrix.com>
 <e906e798-fc5b-49c5-bf18-f2e07912a7a8@perard>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <e906e798-fc5b-49c5-bf18-f2e07912a7a8@perard>
X-ClientProxiedBy: LO4P123CA0277.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:195::12) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|PH8PR03MB7269:EE_
X-MS-Office365-Filtering-Correlation-Id: ea9fcfb9-d4c9-4411-657e-08db8d293e9a
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	pbrE4roUkmF/yjcA50tNPuyiBgUPsDN3s6A4QnfjH6icIH02cR7G+0PqfEFYbJhDDYrlH4TBSp1gHviZRT8DowrThQdAj5TPKaO7R1wrsbkWkrTP7zAB8vVPazqMB9ab2IaP8qbAzu00BLo0rnKL7aS5iroejH1c69OUgfHQPmIiPSli7LPgKroWWfnPET26vQEqjz66PFWxlXF1wJM0CXB0BxSPn9cZ/o6rJ79HKNuzJogiIQXV1vE2Fb0iwgZVj+whwkcITcf/P9jXKUEVbXDVD8OPMTf4L//P0+w4LLQxgKPdO8ocOaAVjWxC+gY6IzfQb+iAPhbvgp02S708VqVYChsR2cAZ1h7xCr5C+T1str6UhZhd2I2PWoeylw1F/yTPceISWskfiJ4A0ZRfbEG609Lwro8QDxv+xj7Wslnm6n+a8A0XxoLCdVS9GdtP/Hruj+8tvcmSrodvePbsZJ1Zt16WqIYC98/LfbrBRbqEm3q0IlYOr+aYq6BleLm0YD1JORfXBojO18OcizJ4OFRdaGTrLtvkWqHw6fTlHsSARyiAsYJFBk+tX0O5kbQ0
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(136003)(376002)(396003)(346002)(451199021)(38100700002)(85182001)(82960400001)(86362001)(54906003)(2906002)(478600001)(6506007)(26005)(186003)(6512007)(6666004)(6486002)(9686003)(8936002)(5660300002)(6862004)(8676002)(316002)(41300700001)(6636002)(66476007)(66556008)(4326008)(66946007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aTdGV0FnanVPcnFPTnhuU3JkUERkM3RYcC9WRXlZNUp1ckJLNFg3TU9aUE4y?=
 =?utf-8?B?Nzg2U3M5Mk5jRWpxQjlMK0tKTVZuN2syeFp4MHhVOS9BQUxxZmxCWWVkTHJW?=
 =?utf-8?B?M2w4Zisxa2gzYVB5Tzkzc3hiZGpia1FzbllsU3VrREhubWZOa2l2OFlJWklh?=
 =?utf-8?B?b2ZycjVJeFlKZUdQeGRIcFkyNi8rRlB1U1VqZTBsT2QyeEVFOW0yYlFzU1I0?=
 =?utf-8?B?b2p4MXZHL3lvOTN5SVgwZGVzaWNxMlViSFVQTGNSRytnNmZnN0l3QVplcHZ3?=
 =?utf-8?B?bktwZlMxTGVWRWo0UGVJRU9YZFRLaC8wUE5jdWhSOVB2b2t1VCsyWjZYZU5J?=
 =?utf-8?B?R2EwVjJmZTdMY0VwbzRPNHFZMGZCYkU4WXFPR3FlRURTUWF5NHJQbWZEb1dF?=
 =?utf-8?B?aUdwVUVXQ01zeEhMRE0zTVpMR2d4a25TU3BvUnllN3dqUXByWmNZYWx1VnMy?=
 =?utf-8?B?RXBxNmttaHJqQzJ2enIrdVJaM1hCNmNSMWdhdkZVVDlCRFdtZzZFM3FpZytN?=
 =?utf-8?B?ZkNQdCsvS0ozMmFKUUwrTG52amNOVDBSTVAralA3SDV1WXFxRWlCdlJLcmV4?=
 =?utf-8?B?ODB1bzNFTTRsMmxmU3JhS09IVVBpWCs0dk40RERBSE5FckdhTTNEamdxSkhO?=
 =?utf-8?B?SGVxTEdWOVJzdzBjQTV0anJQL01nakwxVDhGTVlhUWJwNXdnZHF1a0orUUNQ?=
 =?utf-8?B?R0lvQ1RLWUNHYm9KUHp1bllWa3RMN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tE11btrU2oijBrjTMOMJ351WMWjZwgsDLaSb9lbWicUYwaeEQx3T4xdZqfiu1s5aoNF0/L1yD8+49AJfGL+Pit2m3KHQzFe/heMMx7VR5uLJzfsdbxP5zvRTcCQvKTzqFsymgaMedSK6l5dQQ3n01Lgcnu2UK4WuklQT1NggliN5aPg4mtU8ioGjOTAzBfMCRrV+B8XtyQ9ecwsmB7WKV9oAahcqvs2HP8l++/54Vz+s614w4PizXBSqARwhjSx5Ru4yumkyuu/1Kk/DkDmNbB99NNrk7dcNJHDzbL13QAhY+eNWedhQ+acPH4BSVWwI6yL4e1ZOcGfSRme5RPFku91zye7bP5/woyPGFK9mBhnsm0uXJi3eHQJEesTmQbaGGYVyrlyPKRH4AzUCnyIYlh75U1bmz6EJcKXaLPZUip0yPzcpAC7JleY9hkdn+8CqV6t3mbsYocDga3r2cwftNqN06F61IapTru/8OvJqFTmmgO+F6PjQYv5x4AN1chvW+iT3qZ1AzUJ6EsCeAnQlvy7KtI3sfR
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ea9fcfb9-d4c9-4411-657e-08db8d293e9a
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 16:07:29.3546
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: RqwoA8bi+KSvmYBk6nhJ4o7ZX2Nd+qSQHBntcUeu7AAoRDUsXel9KcnpcqhIhO4vFSKcmOwmt2HXYr0rsDeeSg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR03MB7269

On Tue, Jul 25, 2023 at 03:44:29PM +0100, Anthony PERARD wrote:
> On Tue, Jul 25, 2023 at 03:05:55PM +0200, Roger Pau Monne wrote:
> > diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
> > index 3c8b2a72c0b8..dd97699bbde7 100644
> > --- a/tools/libs/light/libxl_cpuid.c
> > +++ b/tools/libs/light/libxl_cpuid.c
> > @@ -592,17 +641,32 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
> >  {
> >      int i, size;
> >      struct xc_xend_cpuid *l;
> > +    struct xc_msr *msr;
> > +    const libxl__json_object *co;
> >      flexarray_t *array;
> > +    bool cpuid_only = false;
> > +
> > +    if (libxl__json_object_is_array(o)) {
> 
> I think a comment here would useful to point out that we are parsing the
> format from previous version of Xen.
> 
> > +        co = o;
> > +        cpuid_only = true;
> > +        goto parse_cpuid;
> > +    }
> 
> Otherwise, the patch looks good now:
> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks, will add and send just v5 for this patch, as a reply to v4.

Regards, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 16:08:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 16:08:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569824.890955 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKaU-0001tG-Fd; Tue, 25 Jul 2023 16:08:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569824.890955; Tue, 25 Jul 2023 16:08:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKaU-0001t9-D1; Tue, 25 Jul 2023 16:08:38 +0000
Received: by outflank-mailman (input) for mailman id 569824;
 Tue, 25 Jul 2023 16:08:38 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qOKaT-0001t3-VI
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 16:08:37 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qOKaT-0006eo-4X; Tue, 25 Jul 2023 16:08:37 +0000
Received: from 54-240-197-238.amazon.com ([54.240.197.238]
 helo=[192.168.17.43]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qOKaS-00032e-Tn; Tue, 25 Jul 2023 16:08:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=xvT4aVE3l6GM7DyCOcRsWXGZgCEPSpgYyDbRKwCk3rc=; b=LdEU0jHj92AusFlrWGJy5Fa7ex
	5JZSohwGUtIKDDNy9Q6S1Zja8CQ4Ceji7OLLZmQJic3HUMYTpp+BHx/O9QolEkh94HW0kEXL/Xx1t
	um/jnr5JdFUQPZywM/JG/SebzWJkfvaLFeb1OejClki5W3VuMOpKU+sGSH+6uZFbWGWg=;
Message-ID: <2c981a1a-b020-3908-8b9b-8821daec9457@xen.org>
Date: Tue, 25 Jul 2023 17:08:35 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v3 08/25] tools/xenstore: make hashtable key and value
 parameters const
Content-Language: en-US
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-9-jgross@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230724110247.10520-9-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 24/07/2023 12:02, Juergen Gross wrote:
> The key and value are never modified by hashtable code, so they should
> be marked as const.

You wrote this but...

> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
> V3:
> - make value const, too.
> ---
>   tools/xenstore/hashtable.c | 7 ++++---
>   tools/xenstore/hashtable.h | 4 ++--
>   2 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c
> index 11f6bf8f15..670dc01003 100644
> --- a/tools/xenstore/hashtable.c
> +++ b/tools/xenstore/hashtable.c
> @@ -11,7 +11,8 @@
>   
>   struct entry
>   {
> -    void *k, *v;
> +    const void *k;
> +    void *v;


... this is not const and ...

>       unsigned int h;
>       struct entry *next;
>   };
> @@ -140,7 +141,7 @@ static int hashtable_expand(struct hashtable *h)
>       return 0;
>   }
>   
> -int hashtable_add(struct hashtable *h, void *k, void *v)
> +int hashtable_add(struct hashtable *h, const void *k, const void *v)
>   {
>       /* This method allows duplicate keys - but they shouldn't be used */
>       unsigned int index;
> @@ -164,7 +165,7 @@ int hashtable_add(struct hashtable *h, void *k, void *v)
>       e->k = k;
>       if (h->flags & HASHTABLE_FREE_KEY)
>           talloc_steal(e, k);
> -    e->v = v;
> +    e->v = (void *)v;

... you cast-away the const here. I think this is a pretty bad idea.

Can you clarify why you are doing like that?

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 16:16:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 16:16:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569830.890965 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKhr-0003Rq-8K; Tue, 25 Jul 2023 16:16:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569830.890965; Tue, 25 Jul 2023 16:16:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKhr-0003Rj-4S; Tue, 25 Jul 2023 16:16:15 +0000
Received: by outflank-mailman (input) for mailman id 569830;
 Tue, 25 Jul 2023 16:16:14 +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 <SRS0=nivo=DL=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOKhq-0003Rd-4i
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 16:16:14 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2060d.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::60d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 924189c3-2b06-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 18:16:12 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8956.eurprd04.prod.outlook.com (2603:10a6:20b:40b::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul
 2023 16:16:09 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 16:16:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 924189c3-2b06-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=cdcWfHXmDeI/1GW/DBAnfOHgKVHCm1Yo4kxH9zEYAEOR4eKiilW5ULosQufbBmc5xar/Bm8OW/2fS5IyLoGJEx2srCHlabkPnIZlqg+A2XucdhHoVwovU1hePyEqpxd+j16LGrcB/cuGHTRY3NZazKgFUaFkp0TK5j5xUNsP4bQf3Yq3J++RhKeUosTW4fID32GrmcZn7LAdpj0OsC44il3INKD7U1lbRNsEYzn8LdRWs5HOVHzLr9uQYYTWafJ2N1XxB4mzEZHcjioArzppG1A8jeGHX64lxZoZHJAaoaBBdScPRITh+k0e3qdVPYGY1rCFpc3cr+JhtbyegTYhrg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Zhk8p+vwoO4d9BWmNqf9aqUY4Ep4CONckUbDoj5U26c=;
 b=h1ItWeVtf2gfagR/jdCc+KK2ld6XSFGz1OlbD8tEzbOej4FAcl2A7nJuDlSW5H3CDh00SoIA8HatxTAIAy8xcEXRkBUTSN6BDrtOfKxq7Hy3/HhzdSEgubvBaH2pIJeGOmX4cCFHiCtk7fWoG+IncEEdCT2N/JydXg3vw/XGPEr50KYNLDIvDfTa8ZPceLGOpUX9OfuOkpeVgCMetM+DaajfWO9+/z0i3Es0imSuTSncea8E8Y/YLyZRwWc4YlR0ia0ryBG29eXuXUMn/bsLjOLhMp92p0t84UqnxA01sueH9SmxNUfArbG08cIU5D8y38FB4XrrsPahisSsq/zWSw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Zhk8p+vwoO4d9BWmNqf9aqUY4Ep4CONckUbDoj5U26c=;
 b=wLS0aYm2vxA+YHHitHolfiMM0efCe73Y3TsmJJm4ycBYalgOKZVMMu/qOVPlSNNDR4FnzNS18SIxqksBrYPqlmi8xPTIxDmru6GF9l24VggoQpC06pgfgS3Cxga7vKY5ilhoJ7PiiyReYPrLSavQ5CNsYerB497Eifg5wS2hHIlr376wJsshTgQUmkRSHmq/BIKj+qfLqzRg59G+YovB19HrXgvGOBBmfqu2PHU1V6w7Qj4Kvmt9WlyA/14r8JqaPOG4rJfPWd/bXSQf/ZzxEN9dNxGwhmsUFEZYDpSXoNSVI8Z6//ZejobyJTYAikgrnPEWtv2ZKV3AKpINsL47wA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <5ba647c0-fc74-595e-5fe3-658f4662f16e@suse.com>
Date: Tue, 25 Jul 2023 18:16:07 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] xen/public: fix flexible array definitions
Content-Language: en-US
To: Juergen Gross <jgross@suse.com>
References: <20230725135557.20518-1-jgross@suse.com>
Cc: xen-devel@lists.xenproject.org
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230725135557.20518-1-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0042.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4a::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8956:EE_
X-MS-Office365-Filtering-Correlation-Id: 7d2de74d-c413-46c5-6042-08db8d2a7512
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	wGZ8zp49AHZwGADXmDG3cxJOmfCPpiytwnT2lr+T1xXfVs87tm7l8guyXUy3WDHEYTkTbBB2QLaSAtx+SxO0ouEels4Fh1EPbzmalVskaQNfhvV6KBMRu2VVgXHdnVvzgmaOdg4AJq7Mbipg3cZPhLKtg6ZzWCnJJFt2KNHxiBECmcIb9GK/6PyqxQb0i0QBPcE8a1yhSwhhUqvbrmzjt2yrckS/s2+HXvIEoY+mUjDolm2foMzjPBhVr1UZ7chhFiFtG2FFZtogO0hOyApPnxWjtLI2IRDFTdqPRpMwdrZCCpW8eLrz9W1iNIyP7jWB1Zi/7iYFiekN2aXupNKurHTgGt4ImE0h/Ck65eCyvzvEE6sju/NZOreo4dsDzRYcaHj5H2lqff1VcVBBQo3qeBttUbPLV0HTj4u9tM1kPVY3NXVWsk4srIcb/I7j4BD9nrIZbcnHyPZX7Chzx09uuHXBqJ8egx3TedX9mpJHx2xEmF4lrzr4QUipV15jYqwXcn532Al1BeU8i8Vo0wzbMZghCJWgO2wFTD7DY4ZdVDViBcpkjmiW932dDobAIwvA9UzlijnWM2sWrbfXHCcYZNvjBHstg7AwPyWydcdQ/c7d23sV+Ue6ucZUFAy0S5CcadlOL/KV9B4bXk3uNVNtXg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(39860400002)(396003)(346002)(376002)(366004)(451199021)(37006003)(2616005)(6486002)(478600001)(86362001)(966005)(6512007)(31696002)(26005)(53546011)(36756003)(6506007)(5660300002)(316002)(41300700001)(6862004)(8936002)(8676002)(4326008)(2906002)(4744005)(66476007)(66946007)(38100700002)(66556008)(6636002)(186003)(83380400001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dnFvQmJCYkdCVk5XK2FaeFFTcjh2eUlDejZPS3hZczVzaDhEQWZmbkNuN3lJ?=
 =?utf-8?B?L3RFMFoxMkxrRmcxcHhnL1BML04wd0dQa0haRDNkUW5LNjltRDdsMEM3YnBV?=
 =?utf-8?B?K0tMQ3VXazVudDZibUk4S3FiTVMzMlB4TVVydmFqUi9MNmRvc0o4dVBWL0tO?=
 =?utf-8?B?RFAwTzNya1BHQXJicm1mZklTaU9KT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RXNsNEdoa3B6UDdqSlNacjNwS0pDb1pkRmk0?=
 =?utf-8?B?YzNocXkrQVQ5M3NJSVBWb1hDOUVLU1I5SmptNTNnTWg4c1R5Vlk3cTQ1dWdT?=
 =?utf-8?B?Y0poUjBnTnVhRy9wUUxIRy94SzVxd0RiZUdKUDNVcDVzUFZOTk9jdzRUck9E?=
 =?utf-8?Q?DvgY8pMWAOCBMejEBXywRDVFa?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7d2de74d-c413-46c5-6042-08db8d2a7512
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 16:16:09.7035
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 9NllXkXQIDWlseFpbHxuQwd75kXBjFITOuYB8+RDVVJX7PsLMXO/G0rsbMZPGmqUGn+K0awoR+sVNfLb+ALFSQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8956

On 25.07.2023 15:55, Juergen Gross wrote:
> Flexible arrays in public headers can be problematic with some
> compilers.
> 
> Replace them with arr[XEN_FLEX_ARRAY_DIM] in order to avoid compilation
> errors.
> 
> This includes arrays defined as "arr[1]", as seen with a recent Linux
> kernel [1].
> 
> [1]: https://bugzilla.kernel.org/show_bug.cgi?id=217693
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

I think we need to be careful here: What if someone somewhere applies
sizeof() to any of the types you alter? The resulting value would
change with the changes you propose, which we cannot allow to happen
in a stable interface. Therefore imo it can only be an opt-in feature
to have these arrays no longer be one-element ones.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 16:17:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 16:17:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569832.890975 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKit-0003y0-Gi; Tue, 25 Jul 2023 16:17:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569832.890975; Tue, 25 Jul 2023 16:17:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOKit-0003xt-DW; Tue, 25 Jul 2023 16:17:19 +0000
Received: by outflank-mailman (input) for mailman id 569832;
 Tue, 25 Jul 2023 16:17:17 +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
 <SRS0=1Iib=DL=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qOKir-0003xh-TP
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 16:17:17 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b8271c40-2b06-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 18:17:15 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.161.75.91])
 by support.bugseng.com (Postfix) with ESMTPSA id E338E4EE0738;
 Tue, 25 Jul 2023 18:17:13 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b8271c40-2b06-11ee-8613-37d641c3527e
Message-ID: <f67b89a1-6479-922b-0991-2af6f8a3802e@bugseng.com>
Date: Tue, 25 Jul 2023 18:17:12 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v2] xen/sched: mechanical renaming to address MISRA
 C:2012 Rule 5.3
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 George Dunlap <george.dunlap@citrix.com>, Dario Faggioli
 <dfaggioli@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <0b489f53751f8f7e80a7be85eb832f90bcadcbb0.1690272371.git.nicola.vetrini@bugseng.com>
 <8a30cc1f-79fb-f202-a602-3645de619825@suse.com>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <8a30cc1f-79fb-f202-a602-3645de619825@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 25/07/23 16:52, Jan Beulich wrote:
> On 25.07.2023 11:08, Nicola Vetrini wrote:
>> @@ -99,14 +99,15 @@ static void sched_set_affinity(
>>       struct sched_unit *unit, const cpumask_t *hard, const cpumask_t *soft);
>>   
>>   static struct sched_resource *cf_check
>> -sched_idle_res_pick(const struct scheduler *ops, const struct sched_unit *unit)
>> +sched_idle_res_pick(
>> +    const struct scheduler *ops, const struct sched_unit *unit)
>>   {
>>       return unit->res;
>>   }
>>   
>>   static void *cf_check
>> -sched_idle_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
>> -                       void *dd)
>> +sched_idle_alloc_udata(
>> +    const struct scheduler *ops, struct sched_unit *unit, void *dd)
>>   {
>>       /* Any non-NULL pointer is fine here. */
>>       return ZERO_BLOCK_PTR;
> 
> These look like stray changes, presumably resulting from you not fully
> undoing earlier changes.
> 

You're right, they were the byproduct of an earlier edit to this patch.

>> --- a/xen/common/sched/credit2.c
>> +++ b/xen/common/sched/credit2.c
>> @@ -3809,7 +3809,8 @@ csched2_dump(const struct scheduler *ops)
>>       struct list_head *iter_sdom;
>>       struct csched2_private *prv = csched2_priv(ops);
>>       unsigned long flags;
>> -    unsigned int j, loop;
>> +    unsigned int loop;
>> +    int j;
> 
> This looks like a stray change too, just that it's unclear where it is
> coming from.
> 

I thought I added a note to the commit, but I probably did some mistake.
That's why I changed it:

Note: local variable 'j' in xen/common/sched/credit2.c:3888' should
probably be unsigned as well, but I saw while editing the patch
that it's used as a parameter to 'dump_pcpu', which takes an int.
Changing the types of parameters used in these calls is
probably a good target for another patch, as it's not relevant
to Rule 5.3

>> @@ -3884,7 +3885,7 @@ csched2_dump(const struct scheduler *ops)
>>       list_for_each_entry ( rqd, &prv->rql, rql )
>>       {
>>           struct list_head *iter, *runq = &rqd->runq;
>> -        int loop = 0;
>> +        loop = 0;
>>   
>>           /* We need the lock to scan the runqueue. */
>>           spin_lock(&rqd->lock);
> 
> With the switch from declaration to statement, a blank line wants
> inserting (to separate the remaining declaration from the
> statements).
> 

Ok

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 16:49:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 16:49:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569841.890985 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOLE7-0007xf-26; Tue, 25 Jul 2023 16:49:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569841.890985; Tue, 25 Jul 2023 16:49:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOLE6-0007xY-Ut; Tue, 25 Jul 2023 16:49:34 +0000
Received: by outflank-mailman (input) for mailman id 569841;
 Tue, 25 Jul 2023 16:49:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOLE5-0007xO-Fw; Tue, 25 Jul 2023 16:49:33 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOLE5-0008GN-Bj; Tue, 25 Jul 2023 16:49:33 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOLE4-0007Xx-TU; Tue, 25 Jul 2023 16:49:32 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOLE4-0005LO-T2; Tue, 25 Jul 2023 16:49:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=h6Z2La7X2r4reGRp8YyfXgknOUxYngHCBX7pnCaJc5E=; b=uLEg2TIh42X+m66LrIAC1fbQ3D
	tdvWRZAA97p7NxpIGMPkt2MooIs4oXURx9ol5OqCeaNpKzP1qoWasnzb9IaTTFxSlIjR8BPzceH75
	ypQW1DNfvmkeyxKzXA6cn2+YENFSFZBvk4mSuCktBd2BQShfpxh2eZupvzB5tA0crRz8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181996-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.14-testing test] 181996: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-4.14-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.14-testing:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.14-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.14-testing:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.14-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.14-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.14-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.14-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.14-testing:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.14-testing:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.14-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.14-testing:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-4.14-testing:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.14-testing:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.14-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.14-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.14-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.14-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.14-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.14-testing:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=64b40594f589c9069fb8cf3899d4aac59c86d4f1
X-Osstest-Versions-That:
    xen=98ec8ad2eeb96eb9d4b7f9bfd1ef3a994c63af17
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 25 Jul 2023 16:49:32 +0000

flight 181996 xen-4.14-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/181996/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 180425
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 180425
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180425
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 180425
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180425
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180425
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 180425
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180425
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 180425
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180425
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 180425
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 180425
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  64b40594f589c9069fb8cf3899d4aac59c86d4f1
baseline version:
 xen                  98ec8ad2eeb96eb9d4b7f9bfd1ef3a994c63af17

Last test of basis   180425  2023-04-26 07:39:28 Z   90 days
Testing same since   181996  2023-07-24 16:37:10 Z    1 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   98ec8ad2ee..64b40594f5  64b40594f589c9069fb8cf3899d4aac59c86d4f1 -> stable-4.14


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 16:59:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 16:59:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569846.890999 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOLNc-000145-1I; Tue, 25 Jul 2023 16:59:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569846.890999; Tue, 25 Jul 2023 16:59:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOLNb-00013y-UW; Tue, 25 Jul 2023 16:59:23 +0000
Received: by outflank-mailman (input) for mailman id 569846;
 Tue, 25 Jul 2023 16:59:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+x6f=DL=citrix.com=prvs=56398a583=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qOLNa-00013s-JX
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 16:59:22 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 98963a1f-2b0c-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 18:59:21 +0200 (CEST)
Received: from mail-bn1nam02lp2047.outbound.protection.outlook.com (HELO
 NAM02-BN1-obe.outbound.protection.outlook.com) ([104.47.51.47])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 25 Jul 2023 12:59:17 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by SA0PR03MB5450.namprd03.prod.outlook.com (2603:10b6:806:be::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Tue, 25 Jul
 2023 16:59:15 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::edfe:6f64:4048:74c5]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::edfe:6f64:4048:74c5%4]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023
 16:59:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 98963a1f-2b0c-11ee-b23f-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690304361;
  h=message-id:date:subject:to:cc:references:from:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=zTt+xcWlFKE+PnXg77I1ADqGh2CAfQq2XeNMJ7yXeKQ=;
  b=Skl7W0xb++bU+zqu1yDvxZ3M2sOntxSSe27fRXTgIykJLnlFalqdp9cn
   VQS7FR+df/cGO2AXquotX5jxVs/kiSbZRkT+hnG/FNazNriPGn2GFR1P2
   t+pTxMpS2X7E0xCuHSbCtvkLQI+t1DS3y48ABJYAhTj5eQKo35nH+VRb9
   4=;
X-IronPort-RemoteIP: 104.47.51.47
X-IronPort-MID: 117416866
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:jZ4oIa3taI0+uki04/bD5fpwkn2cJEfYwER7XKvMYLTBsI5bpzUGn
 zNNCGzSPf6NazGmLtklO47ipE0E6MeByIVkQFE/pC1hF35El5HIVI+TRqvS04F+DeWYFR46s
 J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo
 tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5gNkOKgS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL
 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ
 OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfGFFw7
 scxchM2TkqGgOztg5KEbfRnv5F2RCXrFNt3VnBI6xj8Vaxja7aaBqLA6JlfwSs6gd1IEbDGf
 c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxqui6Pk2Sd05C0WDbRUvWMSd9YgQCzo
 WXe8n6iKhobKMae2XyO9XfEaurnxHqkBNtMROPmnhJsqHKjwX0xGiQ9aXK+n8WGs3OvfYkDA
 GVBr0LCqoB3riRHVOLVXRe1vXqFtR40QMdLHqsx7wTl4qjb+QGCHUAfUyVMLtchsaceVTEsk
 1OEgd7tLThuq6GOD2KQ8K+OqjG/MjRTKnUNDRLoViMA6tjn5Ys11xTGS445FLbv1oGqXzbt3
 zqNsS4ywa0JitIG3Lm6+laBhC+wop/OTUg+4QC/sn+Z0z6VrbWNP+SAgWU3J94aRGpFZjFtZ
 EQ5pvU=
IronPort-HdrOrdr: A9a23:fEwHu6NxhuWn7MBcTv6jsMiBIKoaSvp037Dk7TEJdfU1SL3hqy
 nKpp4mPHDP+VMssR0b6LK90ey7MBDhHP1OgLX5X43SODUO0VHAROpfBMnZowEIcBeOkdK1u5
 0QFZSWy+edMbG5t6vHCcWDfOrICePozJyV
X-Talos-CUID: 9a23:4AtWhW7yB1svJMH3hNss7X4qAfsMKF7m7C3VJEHjSkZWb6CecArF
X-Talos-MUID: =?us-ascii?q?9a23=3AIRmVJA+LGoTEqtIqKIH2UWyQf+hY5LWMGnkmrbw?=
 =?us-ascii?q?DhfW7DBFhHWzBpx3iFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,230,1684814400"; 
   d="scan'208";a="117416866"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=GWAQuypXv/wTLk59zWP1r8ffzMSB+eZMVZe0X1Rjtik8vFFTSG/3uSfucXl46x7D2Pw4v/quedQFm+SqCwybs4MO4WroEojWF8HdqsVWUau3xzMKbPJ/rvMtUbGhvuw2dQC9cE/svT92xCy2Z/TU9z0MyZDR5UYgo2RGYgkedbpmQMVNW8trcs69PKUUTbbhXekdaLwl/3eHj6GUS3M5HacJSBabs9gWrHomou8gqf8WN8pPJKH9f+cHWf7e5Dc2lGEesNdkLpwsv38rzst3m0npsqtrDpPo0L04vpvYtjC6CPhYkleuJRb/1BjS8vz3XB3xlUOGmSxrJJxsh5HOkg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=FjubPeh4Jz3Yoa+t0Yupgqs8qC+4/GGxRdLSxVPAqt4=;
 b=OpNuWmEOpg6Ol8m0eL56hOGYvaDG2ABIAMf2951DsEmviSPi5frSPGMy2u2KR5VPN4lHyUzjUMvOOhIhcjBRuMuH6EDntL/pNTdtVn2FbB1m7CGkCyYBHiJaVI8B6s2VnyeFQhZUFTK9XK0ege7tbgWjZkLT9bu0SKRpSuICv2+qLDqE2Pt/alG80RmqR4w1WAsgrwscSwyeErZrUBwDNT+pG5j7PRFawcL1FFxFFxL/nvB9LxWCw/ydKciCBpMTmrKA6FBQZeXgeJ6EZT9YF27McflE0/xbbej1WvphQV4mQpJW6e9Ycj0LbxAuTyT6OTSPw2cfVh6y+Nrob8o26Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=FjubPeh4Jz3Yoa+t0Yupgqs8qC+4/GGxRdLSxVPAqt4=;
 b=ObyqGSKcXRnnOeeDofgejPi2UxYOij7ji/24r14AFKsx3mcrT5qyJqKPvY45sGP0sHLOimiFC6cmX5boSMPdYGRg1nmzzD0p8Nt8R0C9Peksn3tEYKBLvA2/VnGczJkIl4VKxjlNW1gFLRIaBm8RoUBg7vVwKONyo54Gn3Vd9NI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <f54fcb50-15c5-aa72-60fa-6370547bb9f2@citrix.com>
Date: Tue, 25 Jul 2023 17:59:09 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] xen/public: fix flexible array definitions
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>, Juergen Gross <jgross@suse.com>
Cc: xen-devel@lists.xenproject.org
References: <20230725135557.20518-1-jgross@suse.com>
 <5ba647c0-fc74-595e-5fe3-658f4662f16e@suse.com>
From: Andrew Cooper <andrew.cooper3@citrix.com>
In-Reply-To: <5ba647c0-fc74-595e-5fe3-658f4662f16e@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0237.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a7::8) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|SA0PR03MB5450:EE_
X-MS-Office365-Filtering-Correlation-Id: 6f7c63cf-1225-4f68-9124-08db8d307a14
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	j7WeJgOlK7yurEMTsUXWjLqS5nZOKULtYBumYYR3dLwkhPVNZrVVSZTqLypP3AyWktfwbG/za7mVCqileuUw6ZARU51TLvpfPhBU5w7R2qS1TLFkY/xiQAs41D9McFKsVfb5DXS8LpMBCy3Doa/YQXigh1A5ijTNkgJSD60ujZt1mWa5Kb8TJZBRu772ZxMN/b6Z/+aqwg0uFPWOIu/T79TnVoW0Qu299Z0t6nT4gPjnIiFJX++RKNvjvMKGNfveTiz4AizCDOeBvqJRdpzEidbsShZUtAPAkIBY82eMEmzk6Yj9ZDuoKsomP68b0xD/J9QM9yu3RjV2wzOe4uOIGj3Ji6HAXpXUUL99jy+i8nbhx4S2O0/+PcLAePpB6LwNfPDNLbCAju+dLyWUIZYJCXYjS5bIvjJi36nYejYn0S40dltx7iRt+CXTmaSN/2T1eZETABQUGNR+HZDJUiJDFGRz2I9sieq1uumkeqti9bK4T1zcGjZAh6Ilsh7AvuWbi/4V39pbK7v2n+WvbB49kyaTJtCZbY1pK26atzduZYx9YQHx3oMg8gnkxL/uGA9AMfl2QQNTwALEScwTmUNd3Wk5ZuXaKA/LwayQ385v/bH+oTcT0g9TKS4yG4Ft4VbwyKaeQmilcvwDFdhkUKpvuw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(366004)(376002)(346002)(136003)(451199021)(966005)(6512007)(6486002)(6666004)(110136005)(478600001)(186003)(53546011)(2616005)(6506007)(26005)(2906002)(66556008)(41300700001)(66946007)(5660300002)(8936002)(8676002)(4326008)(66476007)(82960400001)(316002)(38100700002)(36756003)(31696002)(86362001)(83380400001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WTc3RmQrVVYwL3dJVVAyN2hNdTdBNkIwNzhlY2dTOEhGbEdLL0dTcUhSeVJa?=
 =?utf-8?B?aUNOazM5cUQ3QmdkSFFkaDJTODRmOGZDR2paVHZKRldINTRjUDV6SW9IUjNj?=
 =?utf-8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gZYsUx3Nz7Z6rN48hrrLWWGscrEYQwsxkGmduBloOdgvEWAkIhH2jghQksKRRliiTRpwA1MMWqbhdG0KdKSkWrZVY1pH3ReQ5un+Ncei/VQhAat7o7T0yOTHlmEZakkUv3hYC9S872iDQIDZOQgMysHKolh6axf9imPNCp7nx6tLO/UEllAx2oiUeXgKlDrNMNU9Vo8nYg6eAzPzq0FpEHkyeuwk58dtuJgatc3Pw=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6f7c63cf-1225-4f68-9124-08db8d307a14
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 16:59:15.2027
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: KkJYjC9I+3zVy3l4jGMmqzAyhz/GAhK/aPJvbJY8XTqHKFSx9n13Bonu5WTvEV/vPEFNoZ7hSfe3z6DVbAxHn5hfOgbIaAx/UkP+jbHy3hE=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR03MB5450

On 25/07/2023 5:16 pm, Jan Beulich wrote:
> On 25.07.2023 15:55, Juergen Gross wrote:
>> Flexible arrays in public headers can be problematic with some
>> compilers.
>>
>> Replace them with arr[XEN_FLEX_ARRAY_DIM] in order to avoid compilation
>> errors.
>>
>> This includes arrays defined as "arr[1]", as seen with a recent Linux
>> kernel [1].
>>
>> [1]: https://bugzilla.kernel.org/show_bug.cgi?id=217693
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
> I think we need to be careful here: What if someone somewhere applies
> sizeof() to any of the types you alter?

Then the code was most likely wrong already.

>  The resulting value would
> change with the changes you propose, which we cannot allow to happen
> in a stable interface. Therefore imo it can only be an opt-in feature
> to have these arrays no longer be one-element ones.

I don't consider this an issue.

If people take an update to the headers and their code stops compiling,
then of course they fix the compilation issue.Â  That's normal.

It's unreasonable to take opt-in features to a set of headers intended
to be vendored in the first place, to work around a corner case that's
likely buggy already.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 17:57:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 17:57:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569858.891008 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOMI1-0007On-CQ; Tue, 25 Jul 2023 17:57:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569858.891008; Tue, 25 Jul 2023 17:57:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOMI1-0007Og-9n; Tue, 25 Jul 2023 17:57:41 +0000
Received: by outflank-mailman (input) for mailman id 569858;
 Tue, 25 Jul 2023 17:57:39 +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 <SRS0=z+7o=DL=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qOMHz-0007Oa-Tf
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 17:57:39 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bc1c6d4a-2b14-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 19:57:36 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36PHvBrk067089
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Tue, 25 Jul 2023 13:57:16 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36PHvAFL067088;
 Tue, 25 Jul 2023 10:57:10 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bc1c6d4a-2b14-11ee-8613-37d641c3527e
Message-Id: <8891bdfb2378187cfcaa8ed6f49817404db15924.1690307465.git.ehem+xen@m5p.com>
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Date: Thu, 13 Jul 2023 16:53:57 -0700
Subject: [PATCH RESEND] tools/xl_parse: remove message for tsc mode string
X-Spam-Status: No, score=2.5 required=10.0 tests=DATE_IN_PAST_96_XX,
	KHOP_HELO_FCRDNS autolearn=no autolearn_force=no version=3.4.6
X-Spam-Level: **
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

Normal behavior is to be silent.  Generating a message for the preferred
input can be mistaken for an error.  As such remove this message to match
other conditions.

Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
This looks like a bit of printf()-debugging which never got removed.  The
message serves to discourage use of the named tsc_mode values.  I suspect
this is the ooposite of the desired result and therefore should be
purged.
---
 tools/xl/xl_parse.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index f036e56fc2..7b1369f098 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -1658,7 +1658,6 @@ void parse_config_data(const char *config_source,
         }
         b_info->tsc_mode = l;
     } else if (!xlu_cfg_get_string(config, "tsc_mode", &buf, 0)) {
-        fprintf(stderr, "got a tsc mode string: \"%s\"\n", buf);
         if (libxl_tsc_mode_from_string(buf, &b_info->tsc_mode)) {
             fprintf(stderr, "ERROR: invalid value \"%s\" for \"tsc_mode\"\n",
                     buf);
-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 18:21:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 18:21:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569884.891018 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOMea-0002NX-6U; Tue, 25 Jul 2023 18:21:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569884.891018; Tue, 25 Jul 2023 18:21:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOMea-0002NQ-3j; Tue, 25 Jul 2023 18:21:00 +0000
Received: by outflank-mailman (input) for mailman id 569884;
 Tue, 25 Jul 2023 18:20:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+x6f=DL=citrix.com=prvs=56398a583=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qOMeZ-0002NK-7g
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 18:20:59 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fedf9100-2b17-11ee-b23f-6b7b168915f2;
 Tue, 25 Jul 2023 20:20:57 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fedf9100-2b17-11ee-b23f-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690309256;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=vNaY0Gb4fEnPxscuh5gMxGc4bfOXcYQXGexKJPchBZ8=;
  b=dkQ6bM699+EizaEfFVubIIAdE3auMF7tV0MwBfpOTEf2aVzWrGqOK7fu
   S/UKA2F4DkycwPczsuBmjtcvZpaMdiJg93r8kyPVC2giwwu9xzMk284Hg
   G02JTHGAffIGxijzJGaXQ0sJL5NcutMQ5oOt/IgRTM1m+36YGIYYuDbIL
   4=;
Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 117426735
X-Ironport-Server: esa3.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:Bt6SvK2VLc5x3DUUNvbD5bB2kn2cJEfYwER7XKvMYLTBsI5bp2BTx
 2IcCm6HOanbYGGmfNh2OYvl/E8AsZGGy4BqQQJopC1hF35El5HIVI+TRqvS04F+DeWYFR46s
 J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo
 tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5gNkOKgS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL
 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ
 OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfEz4N5
 NYnLho3cgHTv9u66ZaXavg0mZF2RCXrFNt3VnBIyDjYCbAtQIzZQrWM7thdtNsyrpkQR7CEP
 ZNfMGcxKk2aOHWjOX9OYH46tM6uimPybHtzr1WNqLBsy2PS0BZwwP7mN9+9ltmiHJwKwhzG+
 Tmbl4j/KjsfHdiS9hScySOXqebBpDP2QIgLGoTto5aGh3XMnzdOWXX6T2CTsfS/z0KzRd9bA
 0gV4TY167g/8lSxSdvwVAH+p2SL1jY+cddNF+wx6CmW17HZpQ2eAwAsVSVdYdYrsMs3Qz0C1
 VKTmd7tQzt1v9W9Vna15rqS6zSoNkA9L3IGZCICZRsI5Z/kuo5bpizIStFvAauklOrfEDv7w
 y2JhCUmjrBVhskOv42x8ErbmTuqqt7MRxQs+wTMdmu/60VyY4vNT4Ws6EPH5PdaaoiDR1+Kv
 WMshMSVqusJCPmlniuHSvQAB7Gt6vOMNhXThFduG98q8DHF03Wke4ZX4j13OkZyGskBcD7tJ
 kTUvGt545teP2CrbOl0fpi2AMQpyoDvEN3kUrbfad8mSoJ2fgKd4CYob0ef2Wn3mWAmjK4kN
 JGUN82rCB4n5b9PlWTsAb1HiPlym354nDmILXzm8/i5+ajBJ2+/drEvCkefPtgA4IqgjCXEq
 8kKYqNm1C5jvP3Cjjj/qNBCdQtSciNlVPgauOQMKLfdf1MO9HUJTqaInOh/I9ENc7F9zL+gw
 52rZqNPJLMTb1XjIB7CVH1sYaiHsX1X/SNiZnxE0bpFNhEejWeTAEQ3LcFfkUEPrrAL8BKNZ
 6Btlz+8KvpOUC/b3D8WcIPwqodvHDzy21PWZXD+PGhgI8U8L+AsxjMCVlG0nMXpJnPp3fbSX
 pX6jl+LKXb9b1kK4DnqhAKHkArq4Cl1dBNaVErUONhDEHgAA6AzQxEdesQfeplWQT2an2vy6
 upjKUtAzQU7i9NvoYahaGHth9vBLtaS6WIBTzKGvenmanmyE6jK6dYobdtktAv1DAvckJhOr
 80Pl5kQ7NVvcI52jrdB
IronPort-HdrOrdr: A9a23:Dkl8FK9Adq1LnB97H3huk+DnI+orL9Y04lQ7vn2ZhyYlC/Bw9v
 re5MjzsCWftN9/YgBEpTntAtjjfZqYz+8X3WBzB9aftWvdyQ+VxehZhOOI/9SjIU3DH4VmpM
 BdmsZFebvN5JtB4foSIjPULz/t+ra6GWmT69vj8w==
X-Talos-CUID: 9a23:EkOlXmw3bMqXCbXW7UaRBgUGRYM0WELb5k3MMh+AMGpAbJG1WAePrfY=
X-Talos-MUID: 9a23:FTTxjATlD8vpafNzRXTGgRhmOfhG+p//M28En6wWttGOLCJJbmI=
X-IronPort-AV: E=Sophos;i="6.01,230,1684814400"; 
   d="scan'208";a="117426735"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
	<JBeulich@suse.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>, Alistair Francis
	<alistair.francis@wdc.com>, Connor Davis <connojdavis@gmail.com>, "Oleksii
 Kurochko" <oleksii.kurochko@gmail.com>, Roberto Bagnara
	<roberto.bagnara@bugseng.com>
Subject: [PATCH] xen: Drop the (almost) unused extern start[]
Date: Tue, 25 Jul 2023 19:20:49 +0100
Message-ID: <20230725182049.2384427-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

This global variable is shadowed by plenty local variables, violating MISRA
rule 5.3.  Some architectures happen to have a symbol by the name of start in
their head.S's, but it's not a useful symbol to reference from C.

In fact, the single use of the global start[] in RISC-V is wrong and means to
use _start[] as the linker symbol at the beginning of the .text section, not
the function which happens to be in the same location.

Fix RISC-V to use the right symbol for it's calculation, and drop the extern.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Bob Eshleman <bobbyeshleman@gmail.com>
CC: Alistair Francis <alistair.francis@wdc.com>
CC: Connor Davis <connojdavis@gmail.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Roberto Bagnara <roberto.bagnara@bugseng.com>

I'm expecting:

  https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/945105609

to come back and show green, but Gitlab is very backed up right now.  I've
compiled each architecture locally.
---
 xen/arch/riscv/mm.c      | 2 +-
 xen/include/xen/kernel.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index fddb3cd0bdeb..99ed5e9623cc 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -148,7 +148,7 @@ static bool __init check_pgtbl_mode_support(struct mmu_desc *mmu_desc,
 
     unsigned long aligned_load_start = load_start & level_map_mask;
     unsigned long aligned_page_size = XEN_PT_LEVEL_SIZE(page_table_level);
-    unsigned long xen_size = (unsigned long)(_end - start);
+    unsigned long xen_size = (unsigned long)(_end - _start);
 
     if ( (load_start + xen_size) > (aligned_load_start + aligned_page_size) )
     {
diff --git a/xen/include/xen/kernel.h b/xen/include/xen/kernel.h
index 9ac2694dc7b1..46b3c9c02625 100644
--- a/xen/include/xen/kernel.h
+++ b/xen/include/xen/kernel.h
@@ -66,7 +66,7 @@
 })
 
 /* SAF-0-safe */
-extern char _start[], _end[], start[];
+extern char _start[], _end[];
 #define is_kernel(p) ({                         \
     char *__p = (char *)(unsigned long)(p);     \
     (__p >= _start) && (__p < _end);            \

base-commit: 0b1171be87698bc7d14760383c0770aeb6e41dd4
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 19:22:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 19:22:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569890.891028 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qONbh-0000OM-IU; Tue, 25 Jul 2023 19:22:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569890.891028; Tue, 25 Jul 2023 19:22:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qONbh-0000OE-Fq; Tue, 25 Jul 2023 19:22:05 +0000
Received: by outflank-mailman (input) for mailman id 569890;
 Tue, 25 Jul 2023 19:22:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qONbg-0000O4-JY; Tue, 25 Jul 2023 19:22:04 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qONbg-0003G2-Ft; Tue, 25 Jul 2023 19:22:04 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qONbg-00033A-3j; Tue, 25 Jul 2023 19:22:04 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qONbg-0001zk-34; Tue, 25 Jul 2023 19:22:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=YT5vEY+bHy6XfMq8aMHgdXYoyeV/hO76H3WkEBYKglg=; b=GBwwWMagB0SF3zr1tYVc+c1bzz
	pQw8sjz4Bn2q8gTBgOXQbkkChAXNII9B/gRG0QznNGuFo1F0JSY3+Jle5H68HJCy58Xfly4D8HkhJ
	x+xXmVOkXR54KUb3W8JEHLhJcuI7pGfhlFhc2mFZeNP7QfBg5kaRLLWwjQt29Tb5HVHA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182000-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 182000: regressions - FAIL
X-Osstest-Failures:
    xen-unstable:build-arm64-pvops:kernel-build:fail:regression
    xen-unstable:test-arm64-arm64-examine:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:build-check(1):blocked:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-vhd:guest-start/debian.repeat:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=3a4e6f67bc689365680cd544d05c8772f56b7a91
X-Osstest-Versions-That:
    xen=0c53c638e16278078371ce028c74693841d7738a
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 25 Jul 2023 19:22:04 +0000

flight 182000 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182000/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-arm64-pvops             6 kernel-build             fail REGR. vs. 181987

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-examine      1 build-check(1)               blocked  n/a
 test-arm64-arm64-libvirt-raw  1 build-check(1)               blocked  n/a
 test-arm64-arm64-libvirt-xsm  1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl           1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-credit1   1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-credit2   1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-thunderx  1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-vhd       1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-xsm       1 build-check(1)               blocked  n/a
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181987
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181987
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181987
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181987
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181987
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181987
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181987
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181987
 test-amd64-i386-xl-vhd       21 guest-start/debian.repeat    fail  like 181987
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181987
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181987
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181987
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181987
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 xen                  3a4e6f67bc689365680cd544d05c8772f56b7a91
baseline version:
 xen                  0c53c638e16278078371ce028c74693841d7738a

Last test of basis   181987  2023-07-24 01:53:36 Z    1 days
Testing same since   182000  2023-07-24 17:07:02 Z    1 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Federico Serafini <federico.serafini@bugseng.com>
  George Dunlap <george.dunlap@cloud.com>
  Jan Beulich <jbeulich@suse.com>
  Shawn Anastasio <sanastasio@raptorengineering.com>
  Viresh Kumar <viresh.kumar@linaro.org>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            fail    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          blocked 
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 blocked 
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      blocked 
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  blocked 
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  blocked 
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     blocked 
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 blocked 
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 blocked 
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      blocked 
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 3a4e6f67bc689365680cd544d05c8772f56b7a91
Author: Shawn Anastasio <sanastasio@raptorengineering.com>
Date:   Mon Jul 24 14:29:15 2023 +0200

    xen/ppc: Set up a basic C environment
    
    Update ppc64/head.S to set up an initial boot stack, zero the .bss
    section, and jump to C. The required setup is done using 32-bit
    immediate address loads for now, but they will be changed to
    TOC-relative loads once the position-independent code model is enabled.
    
    Additionally, move the cpu0_boot_stack declaration to setup.c and change
    STACK_ORDER from 2 to 0. For now, ppc64 is using 64k pages and thus the
    larger STACK_ORDER is unnecessary.
    
    Finally, refactor the endian fixup trampoline into its own macro, since it
    will need to be used in multiple places, including every time we make a
    call into firmware.
    
    Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>

commit 0c683baa67e957ce4c91f803fd9283e08e4635e8
Author: Shawn Anastasio <sanastasio@raptorengineering.com>
Date:   Mon Jul 24 14:13:08 2023 +0200

    common: Move a few more standalone macros from xen/lib.h to xen/macros.h
    
    Move a few more macros which have no dependencies on other headers from
    xen/lib.h to xen/macros.h. Notably, this includes BUILD_BUG_ON* and
    ARRAY_SIZE.
    
    Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>

commit f0437c378effb8569d5199a0cb835c00c40e427a
Author: Federico Serafini <federico.serafini@bugseng.com>
Date:   Mon Jul 24 14:12:04 2023 +0200

    x86/cpu-policy: address violations of MISRA C:2012 Rule 8.3 on parameter names
    
    Change parameter names in function declarations to be consistent with
    the ones used in the correponding definitions, thus addressing
    violations of MISRA C:2012 Rule 8.3: "All declarations of an object or
    function shall use the same names and type qualifiers".
    
    No functional changes.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>

commit c14254065ff4826e34f714e1790eab5217368c38
Author: Viresh Kumar <viresh.kumar@linaro.org>
Date:   Mon Jul 24 14:11:35 2023 +0200

    libxl: arm: Add grant_usage parameter for virtio devices
    
    Currently, the grant mapping related device tree properties are added if
    the backend domain is not Dom0. While Dom0 is privileged and can do
    foreign mapping for the entire guest memory, it is still desired for
    Dom0 to access guest's memory via grant mappings and hence map only what
    is required.
    
    This commit adds the "grant_usage" parameter for virtio devices, which
    provides better control over the functionality.
    
    Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: George Dunlap <george.dunlap@cloud.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 19:24:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 19:24:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569895.891038 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qONdb-0000yW-2Y; Tue, 25 Jul 2023 19:24:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569895.891038; Tue, 25 Jul 2023 19:24:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qONda-0000yP-W8; Tue, 25 Jul 2023 19:24:02 +0000
Received: by outflank-mailman (input) for mailman id 569895;
 Tue, 25 Jul 2023 19:24:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ITxH=DL=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qONda-0000yH-0P
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 19:24:02 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ce26a7ab-2b20-11ee-b240-6b7b168915f2;
 Tue, 25 Jul 2023 21:24:00 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id DA17E61826;
 Tue, 25 Jul 2023 19:23:58 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94BF2C433C7;
 Tue, 25 Jul 2023 19:23:57 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ce26a7ab-2b20-11ee-b240-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690313038;
	bh=aOlsPNJ7N1Szj7NrNWi/AlsWfiWT7rFphb073vD4EoA=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=NvFHDZirCFDPKcFQG76bZFwwwABbZDn0345S4N5g9L6HoeW/G+3tKWdxjaT1fDh3q
	 tNGaGk4v8paTugFab0mopSoJdf5lpJwOmGXi1HZFfP4IJ/9FhhfEW/HR13yDWQDgJo
	 8AI/Qg8WGGcKivoFUTWd07D8OrPaNNllSFtaqzPynIakGNvayQn93fHRAHXFtYkHcc
	 XJkZTKl97Odu/eRsqsJNejtO2VOOtslTVmDNl88B8iLwdPIxEAd5GZnLHIktOh5LEP
	 TU/rTMryWPuIq6YtSq5Rj+uwJSej6BbeAKbDelCj1q/ELJkzQKP3+30RGlQZkFn8mI
	 AisnOhMiAorpA==
Date: Tue, 25 Jul 2023 12:23:55 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>
Subject: Re: [XEN PATCH v3] device_tree: address violations of MISRA C:2012
 Rules 8.2 and 8.3
In-Reply-To: <982ad65413e08e8c10ef035cb8246ba7277ff01b.1690292999.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307251223470.3118466@ubuntu-linux-20-04-desktop>
References: <982ad65413e08e8c10ef035cb8246ba7277ff01b.1690292999.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 25 Jul 2023, Federico Serafini wrote:
> Give a name to unnamed parameters thus addressing violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names and types used in function
> declarations and the ones used in the corresponding function
> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
> ("All declarations of an object or function shall use the same names
> and type qualifiers").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes in v3:
>   - use parameter name 'dev' instead of 'device'.
> ---
> Changes in v2:
>   - improved consistency in parameter renaming.
> ---
>  xen/common/device_tree.c      | 16 ++++++++--------
>  xen/include/xen/device_tree.h | 20 ++++++++++----------
>  2 files changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 0677193ab3..0522fdf976 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -85,11 +85,11 @@ struct dt_bus
>      unsigned int (*get_flags)(const __be32 *addr);
>  };
>  
> -void dt_get_range(const __be32 **cell, const struct dt_device_node *np,
> +void dt_get_range(const __be32 **cellp, const struct dt_device_node *np,
>                    u64 *address, u64 *size)
>  {
> -    *address = dt_next_cell(dt_n_addr_cells(np), cell);
> -    *size = dt_next_cell(dt_n_size_cells(np), cell);
> +    *address = dt_next_cell(dt_n_addr_cells(np), cellp);
> +    *size = dt_next_cell(dt_n_size_cells(np), cellp);
>  }
>  
>  void dt_set_cell(__be32 **cellp, int size, u64 val)
> @@ -993,9 +993,9 @@ int dt_device_get_paddr(const struct dt_device_node *dev, unsigned int index,
>  }
>  
>  int dt_for_each_range(const struct dt_device_node *dev,
> -                      int (*cb)(const struct dt_device_node *,
> +                      int (*cb)(const struct dt_device_node *dev,
>                                  uint64_t addr, uint64_t length,
> -                                void *),
> +                                void *data),
>                        void *data)
>  {
>      const struct dt_device_node *parent = NULL;
> @@ -1197,9 +1197,9 @@ unsigned int dt_number_of_address(const struct dt_device_node *dev)
>  }
>  
>  int dt_for_each_irq_map(const struct dt_device_node *dev,
> -                        int (*cb)(const struct dt_device_node *,
> -                                  const struct dt_irq *,
> -                                  void *),
> +                        int (*cb)(const struct dt_device_node *dev,
> +                                  const struct dt_irq *dt_irq,
> +                                  void *data),
>                          void *data)
>  {
>      const struct dt_device_node *ipar, *tnode, *old = NULL;
> diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
> index c2eada7489..1d79e23b28 100644
> --- a/xen/include/xen/device_tree.h
> +++ b/xen/include/xen/device_tree.h
> @@ -538,7 +538,7 @@ bool_t dt_machine_is_compatible(const char *compat);
>   * Returns a node pointer with refcount incremented, use
>   * of_node_put() on it when done.
>   */
> -struct dt_device_node *dt_find_node_by_name(struct dt_device_node *node,
> +struct dt_device_node *dt_find_node_by_name(struct dt_device_node *from,
>                                              const char *name);
>  
>  /**
> @@ -622,12 +622,12 @@ unsigned int dt_number_of_irq(const struct dt_device_node *device);
>  
>  /**
>   * dt_number_of_address - Get the number of addresses for a device
> - * @device: the device whose number of address is to be retrieved
> + * @dev: the device whose number of address is to be retrieved
>   *
>   * Return the number of address for this device or 0 if there is no
>   * address or an error occurred.
>   */
> -unsigned int dt_number_of_address(const struct dt_device_node *device);
> +unsigned int dt_number_of_address(const struct dt_device_node *dev);
>  
>  /**
>   * dt_device_get_irq - Resolve an interrupt for a device
> @@ -639,7 +639,7 @@ unsigned int dt_number_of_address(const struct dt_device_node *device);
>   * device-tree node. It's the high level pendant to dt_device_get_raw_irq().
>   */
>  int dt_device_get_irq(const struct dt_device_node *device, unsigned int index,
> -                      struct dt_irq *irq);
> +                      struct dt_irq *out_irq);
>  
>  /**
>   * dt_device_get_raw_irq - Resolve an interrupt for a device without translation
> @@ -652,7 +652,7 @@ int dt_device_get_irq(const struct dt_device_node *device, unsigned int index,
>   */
>  int dt_device_get_raw_irq(const struct dt_device_node *device,
>                            unsigned int index,
> -                          struct dt_raw_irq *irq);
> +                          struct dt_raw_irq *out_irq);
>  
>  /**
>   * dt_irq_translate - Translate an irq
> @@ -668,9 +668,9 @@ int dt_irq_translate(const struct dt_raw_irq *raw, struct dt_irq *out_irq);
>   * @data: Caller data passed to callback
>   */
>  int dt_for_each_irq_map(const struct dt_device_node *dev,
> -                        int (*cb)(const struct dt_device_node *,
> -                                  const struct dt_irq *,
> -                                  void *),
> +                        int (*cb)(const struct dt_device_node *dev,
> +                                  const struct dt_irq *dt_irq,
> +                                  void *data),
>                          void *data);
>  
>  /**
> @@ -680,9 +680,9 @@ int dt_for_each_irq_map(const struct dt_device_node *dev,
>   * @data: Caller data passed to callback
>   */
>  int dt_for_each_range(const struct dt_device_node *dev,
> -                      int (*cb)(const struct dt_device_node *,
> +                      int (*cb)(const struct dt_device_node *dev,
>                                  uint64_t addr, uint64_t length,
> -                                void *),
> +                                void *data),
>                        void *data);
>  
>  /**
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 19:32:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 19:32:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569898.891052 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qONlp-0002WU-WA; Tue, 25 Jul 2023 19:32:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569898.891052; Tue, 25 Jul 2023 19:32:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qONlp-0002WN-SZ; Tue, 25 Jul 2023 19:32:33 +0000
Received: by outflank-mailman (input) for mailman id 569898;
 Tue, 25 Jul 2023 19:32:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ITxH=DL=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qONlo-0002WH-9n
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 19:32:32 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id feac5d9a-2b21-11ee-b240-6b7b168915f2;
 Tue, 25 Jul 2023 21:32:31 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id B452961888;
 Tue, 25 Jul 2023 19:32:29 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 140F0C433C8;
 Tue, 25 Jul 2023 19:32:27 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: feac5d9a-2b21-11ee-b240-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690313549;
	bh=A+a/6l+yUXC1DJZe/ZrvK0q+y5Xy7Ic9XFzcSzhYAcQ=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=rairky3HqFZE9ol3iftLMrEmeJFgHBnIP9du3wwKkqWQMU/yxmpuwOVVvG2DqqKqi
	 36AY5J5jGJOyhToFWNM/ro3AWXqxqU0lZQYIEzL571EOuUT3eMWMhkkxCxxUaqhTj0
	 iJqMXYcWotv46cM4qXrfA0HXqDUhHjZoHcw5iyuuk4V4Ti5ON5MT0nyCWq1dcmjz5Z
	 olufCcQ4K/eYdNMZ7vhXMOwIIr/Wdm8lpNSWrn055fotFQC8EOX9k5ySMV1Ralo/1I
	 gtOmPMueq9yibCL0jr4VNw2ihqRD/KqTNa3EK2cYDxK/GdJxauES1XasJL0Gm4PV2P
	 ewHw87bGrtgHQ==
Date: Tue, 25 Jul 2023 12:32:26 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Federico Serafini <federico.serafini@bugseng.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, consulting@bugseng.com, 
    Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH 2/3] xen/arm: irq: address violations of MISRA C:
 2012 Rules 8.2 and 8.3
In-Reply-To: <a81326f4-e018-b461-ebec-9ef2ff5dc4df@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307251226180.3118466@ubuntu-linux-20-04-desktop>
References: <cover.1690217195.git.federico.serafini@bugseng.com> <a62e88a9c29cf7866c251968b5a5b6865aff4a2a.1690217195.git.federico.serafini@bugseng.com> <a81326f4-e018-b461-ebec-9ef2ff5dc4df@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 25 Jul 2023, Jan Beulich wrote:
> On 24.07.2023 19:50, Federico Serafini wrote:
> > @@ -182,7 +182,8 @@ void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask)
> >  }
> >  
> >  int request_irq(unsigned int irq, unsigned int irqflags,
> > -                void (*handler)(int, void *, struct cpu_user_regs *),
> > +                void (*handler)(int irq, void *dev_id,
> > +                                struct cpu_user_regs *regs),
> >                  const char *devname, void *dev_id)
> >  {
> 
> Before we accept patches, don't we need to first settle on whether to
> apply the rule(s) also to function type declarations (and not just
> ordinary prototypes)?

Yes, in retrospect we should have found agreement on this issue this
morning but I forgot to bring it up :-(  Ooops.

(I think the agreement was to change the function type declarations too,
that's why docs/misra/rules.rst doesn't have a note about this, but I
don't want to make assumptions as I am not certain.)


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 19:35:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 19:35:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569900.891062 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qONoe-00036v-C4; Tue, 25 Jul 2023 19:35:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569900.891062; Tue, 25 Jul 2023 19:35:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qONoe-00036o-9F; Tue, 25 Jul 2023 19:35:28 +0000
Received: by outflank-mailman (input) for mailman id 569900;
 Tue, 25 Jul 2023 19:35:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=n1im=DL=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qONoc-00036h-MH
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 19:35:26 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 66d4befe-2b22-11ee-b240-6b7b168915f2;
 Tue, 25 Jul 2023 21:35:25 +0200 (CEST)
Received: from [192.168.1.101] (unknown [37.163.26.148])
 by support.bugseng.com (Postfix) with ESMTPSA id CEC8B4EE0738;
 Tue, 25 Jul 2023 21:35:23 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 66d4befe-2b22-11ee-b240-6b7b168915f2
Message-ID: <553dc3d0-a518-c8ba-f90b-76e45a47ff87@bugseng.com>
Date: Tue, 25 Jul 2023 21:35:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH 2/3] xen/arm: irq: address violations of MISRA C: 2012
 Rules 8.2 and 8.3
Content-Language: en-US, it
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1690217195.git.federico.serafini@bugseng.com>
 <a62e88a9c29cf7866c251968b5a5b6865aff4a2a.1690217195.git.federico.serafini@bugseng.com>
 <alpine.DEB.2.22.394.2307241551380.3118466@ubuntu-linux-20-04-desktop>
From: Federico Serafini <federico.serafini@bugseng.com>
Organization: BUGSENG srl
In-Reply-To: <alpine.DEB.2.22.394.2307241551380.3118466@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hello Stefano,

On 25/07/23 00:55, Stefano Stabellini wrote:
>>   int request_irq(unsigned int irq, unsigned int irqflags,
>> -                void (*handler)(int, void *, struct cpu_user_regs *),
>> +                void (*handler)(int irq, void *dev_id,
>> +                                struct cpu_user_regs *regs),
> 
> We have an inconsistency where the handler functions on x86 typically
> call it void *data, while on arm they typically use void *dev_id
> (see xen/arch/x86/irq.c:request_irq and
> xen/arch/x86/hpet.c:hpet_interrupt_handler). I think we should be
> consistent. Or, if this is not a MISRA requirement because this is just
> a function pointer rather than a proper function, then I would leave it
> alone.

This is an inconsistency but it is not a violation of the rule 8.3.

Regards
-- 
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 19:37:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 19:37:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569908.891072 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qONqs-0003gf-Qj; Tue, 25 Jul 2023 19:37:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569908.891072; Tue, 25 Jul 2023 19:37:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qONqs-0003gY-Mi; Tue, 25 Jul 2023 19:37:46 +0000
Received: by outflank-mailman (input) for mailman id 569908;
 Tue, 25 Jul 2023 19:37:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ITxH=DL=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qONqr-0003el-Vh
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 19:37:45 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ba080121-2b22-11ee-b240-6b7b168915f2;
 Tue, 25 Jul 2023 21:37:45 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 26E22618A3;
 Tue, 25 Jul 2023 19:37:44 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9A8FC433C8;
 Tue, 25 Jul 2023 19:37:40 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ba080121-2b22-11ee-b240-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690313863;
	bh=8S3KAqZPKAYnc39+hvKiKorrkqvhLNaQBDJZjthGBFk=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=LBxSiZ7QECbhPjycXi2fR9YtT0UsvbDJWLwnISTVeuAhaQKSZOzq+VimWMJMnyV79
	 VqJ3kDfpNCZAgBiHb2LChTva5V+05l/vEml9H3I/t5HkPrvc3fTxwem94BFbgSOyj9
	 g1oLBjaEpTEwLvfzXuHHZn/jrqUrEoh2tddFCCBzp4cDBxmSM+tbgxmD+OQ+V0GncN
	 ZflbbAXwUVB1NCNBsXWUpy4cl8C5dOjDpwcJHVv5GlZU4XDsWcpsuXW+J1q6pWQArE
	 +LWsZhtTcU9u+PBPImcc7yZR712uGPa4vTB9QBoakl3EjSNrInt08nggMWKCragmdk
	 4ylTa8GyY089g==
Date: Tue, 25 Jul 2023 12:37:38 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Nicola Vetrini <nicola.vetrini@bugseng.com>, sstabellini@kernel.org, 
    michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, 
    consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>, 
    Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v2] xen/spinlock: mechanically rename parameter name
 'debug'
In-Reply-To: <120ed841-5e0f-e27b-9937-5599dc75d84a@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307251235090.3118466@ubuntu-linux-20-04-desktop>
References: <87c0f41e43a1c95ef7d8923c77a2072eb9baee96.1690276551.git.nicola.vetrini@bugseng.com> <120ed841-5e0f-e27b-9937-5599dc75d84a@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 25 Jul 2023, Jan Beulich wrote:
> On 25.07.2023 11:17, Nicola Vetrini wrote:
> > Rule 5.3 has the following headline:
> > "An identifier declared in an inner scope shall not hide an
> > identifier declared in an outer scope"
> > 
> > To avoid any confusion resulting from the parameter 'debug'
> > hiding the homonymous function declared at
> > 'xen/arch/x86/include/asm/processor.h:428'
> > the rename of parameters s/debug/lkdbg/ is performed.
> > 
> > Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> > ---
> > Changes in v2:
> > - s/dbg/lkdbg/
> 
> But only in some of the cases. E.g. ...
> 
> > -static void check_barrier(union lock_debug *debug)
> > +static void check_barrier(union lock_debug *dbg)
> 
> ... not here (there are a few more).

I agree with Jan: these are all union lock_debug parameters, so it would
make sense to me to use lkdbg everywhere in this patch.


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 19:42:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 19:42:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569910.891082 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qONvd-000571-CM; Tue, 25 Jul 2023 19:42:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569910.891082; Tue, 25 Jul 2023 19:42:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qONvd-00056u-8o; Tue, 25 Jul 2023 19:42:41 +0000
Received: by outflank-mailman (input) for mailman id 569910;
 Tue, 25 Jul 2023 19:42:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ITxH=DL=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qONvc-00056o-9w
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 19:42:40 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 68ddcf2c-2b23-11ee-b240-6b7b168915f2;
 Tue, 25 Jul 2023 21:42:38 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 7C5F461787;
 Tue, 25 Jul 2023 19:42:37 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27F32C433C8;
 Tue, 25 Jul 2023 19:42:35 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 68ddcf2c-2b23-11ee-b240-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690314156;
	bh=CokXeVNzW0IkdCPN+qwscECrp2QzRT9ynnidtOiQNjQ=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=HABRs8s9+IGX+44DUWPXHiEQTWQVWZ/ubUIYg8x9f0gKCjXj6be9uNsneBTlgEWnY
	 ZTJSVL2CnKkBMEum+jANTP6NfjNwxrVPGQ+C8mABg4yLk65DDA4m2Hugui67oWwD+4
	 O3mMhMv/hXeicgrhbgbknoabYaLjEj8Ca+t05ypsmojKVPGt7IaR+nBDbWZrFmbvnU
	 H45FPrX8L17imyzs/ElICxSuHl0gEdHF1IqdVY+bjh6S6EHLvq2l+0EARLYsn2wNk1
	 QH9HvsKnSry/DNb4hJ44hgvTWHGQzK+LXd9P+3SugSkLkJUXK7iypzs+/WvanG+lhA
	 rmLdInOjPMuow==
Date: Tue, 25 Jul 2023 12:42:33 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Andrew Cooper <andrew.cooper3@citrix.com>
cc: Xen-devel <xen-devel@lists.xenproject.org>, 
    Jan Beulich <JBeulich@suse.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Julien Grall <julien@xen.org>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Bertrand Marquis <bertrand.marquis@arm.com>, 
    Bob Eshleman <bobbyeshleman@gmail.com>, 
    Alistair Francis <alistair.francis@wdc.com>, 
    Connor Davis <connojdavis@gmail.com>, 
    Oleksii Kurochko <oleksii.kurochko@gmail.com>, 
    Roberto Bagnara <roberto.bagnara@bugseng.com>
Subject: Re: [PATCH] xen: Drop the (almost) unused extern start[]
In-Reply-To: <20230725182049.2384427-1-andrew.cooper3@citrix.com>
Message-ID: <alpine.DEB.2.22.394.2307251242200.3118466@ubuntu-linux-20-04-desktop>
References: <20230725182049.2384427-1-andrew.cooper3@citrix.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="8323329-1857193308-1690314156=:3118466"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-1857193308-1690314156=:3118466
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT

On Tue, 25 Jul 2023, Andrew Cooper wrote:
> This global variable is shadowed by plenty local variables, violating MISRA
> rule 5.3.  Some architectures happen to have a symbol by the name of start in
> their head.S's, but it's not a useful symbol to reference from C.
> 
> In fact, the single use of the global start[] in RISC-V is wrong and means to
> use _start[] as the linker symbol at the beginning of the .text section, not
> the function which happens to be in the same location.
> 
> Fix RISC-V to use the right symbol for it's calculation, and drop the extern.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
> CC: Wei Liu <wl@xen.org>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Julien Grall <julien@xen.org>
> CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
> CC: Bertrand Marquis <bertrand.marquis@arm.com>
> CC: Bob Eshleman <bobbyeshleman@gmail.com>
> CC: Alistair Francis <alistair.francis@wdc.com>
> CC: Connor Davis <connojdavis@gmail.com>
> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> CC: Roberto Bagnara <roberto.bagnara@bugseng.com>
> 
> I'm expecting:
> 
>   https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/945105609
> 
> to come back and show green, but Gitlab is very backed up right now.  I've
> compiled each architecture locally.
> ---
>  xen/arch/riscv/mm.c      | 2 +-
>  xen/include/xen/kernel.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
> index fddb3cd0bdeb..99ed5e9623cc 100644
> --- a/xen/arch/riscv/mm.c
> +++ b/xen/arch/riscv/mm.c
> @@ -148,7 +148,7 @@ static bool __init check_pgtbl_mode_support(struct mmu_desc *mmu_desc,
>  
>      unsigned long aligned_load_start = load_start & level_map_mask;
>      unsigned long aligned_page_size = XEN_PT_LEVEL_SIZE(page_table_level);
> -    unsigned long xen_size = (unsigned long)(_end - start);
> +    unsigned long xen_size = (unsigned long)(_end - _start);
>  
>      if ( (load_start + xen_size) > (aligned_load_start + aligned_page_size) )
>      {
> diff --git a/xen/include/xen/kernel.h b/xen/include/xen/kernel.h
> index 9ac2694dc7b1..46b3c9c02625 100644
> --- a/xen/include/xen/kernel.h
> +++ b/xen/include/xen/kernel.h
> @@ -66,7 +66,7 @@
>  })
>  
>  /* SAF-0-safe */
> -extern char _start[], _end[], start[];
> +extern char _start[], _end[];
>  #define is_kernel(p) ({                         \
>      char *__p = (char *)(unsigned long)(p);     \
>      (__p >= _start) && (__p < _end);            \
> 
> base-commit: 0b1171be87698bc7d14760383c0770aeb6e41dd4
> -- 
> 2.30.2
> 
--8323329-1857193308-1690314156=:3118466--


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 20:03:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 20:03:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569913.891092 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOOG9-0007eW-Ut; Tue, 25 Jul 2023 20:03:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569913.891092; Tue, 25 Jul 2023 20:03:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOOG9-0007eP-RZ; Tue, 25 Jul 2023 20:03:53 +0000
Received: by outflank-mailman (input) for mailman id 569913;
 Tue, 25 Jul 2023 20:03:52 +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
 <SRS0=ITxH=DL=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qOOG7-0007eJ-Uv
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 20:03:52 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5d321ee1-2b26-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 22:03:47 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 420EB61479;
 Tue, 25 Jul 2023 20:03:46 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64C4DC433C7;
 Tue, 25 Jul 2023 20:03:44 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5d321ee1-2b26-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690315425;
	bh=NDPG+R5OXes3NzgO+cvmWQ1mq6AzZp9WGOdnq2It7hA=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=GEdL0rpQG6HLkbp4BtRFcegQsWI9kp/W0uWU75gzhBDx9DTIsaP6MC5BXrHwqokei
	 9xo0GZzBEiR/nQjexuseUj27Q0a36mbSWdgqFR+JEwN87EgZgd7ujEIiIA0jzyNnoC
	 phu1rXvrW5BGMi39hs4qlV8eY3A1J0AlAvpWOC9rg4R9eT+BHz2cSyamjuuIeA41cU
	 0y0O8pbqgwra18tG2Lj1xzzbzC444lXWZiOsBsOQtGy2KIjJI1oBVksB0nyKIMuZuF
	 chk3lV59Yg1F75/KBHYN8xYbV2owTXLWtKP5h5FrrghdhhZIhgiZYZ5rlTKzY7H73e
	 XD08z5zC+urWQ==
Date: Tue, 25 Jul 2023 13:03:42 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Doug Goldstein <cardoe@cardoe.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    "Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: Re: [XEN PATCH 1/4] automation: Add ECLAIR utilities and settings
In-Reply-To: <5ee65af94a3bccf64b283a6206b05880c9ae6732.1690294965.git.simone.ballarin@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307251302350.3118466@ubuntu-linux-20-04-desktop>
References: <cover.1690294965.git.simone.ballarin@bugseng.com> <5ee65af94a3bccf64b283a6206b05880c9ae6732.1690294965.git.simone.ballarin@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; BOUNDARY="8323329-957209064-1690315409=:3118466"
Content-ID: <alpine.DEB.2.22.394.2307251303410.3118466@ubuntu-linux-20-04-desktop>

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-957209064-1690315409=:3118466
Content-Type: text/plain; CHARSET=US-ASCII
Content-Transfer-Encoding: 8BIT
Content-ID: <alpine.DEB.2.22.394.2307251303411.3118466@ubuntu-linux-20-04-desktop>

On Tue, 25 Jul 2023, Simone Ballarin wrote:
> The files with extension ecl are ECLAIR configurations that
> are loaded during the analysis phase or during the report
> generation phase: analysis.ecl is the main file for the analysis
> phase, while reports.ecl is the one for the report phase.
> All other ecl files are included by one of the two main ones.
> 
> The actions* scripts implement the integration with the CI server,
> they are completely general and can be amended to work with any CI
> server. Their presence in xen.git is recommended so that maintainance
> would be easier.
> 
> analyze.sh is the script that actually triggers the analysis.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> --
> Changes in v3:
> - split ECLAIR configurations and scripts in a separate patch;
> - remove references to "Task (a): Xen Coding Guidelines v1.0".
> 
> Changes in v2:
> - add ECLAIR configuration files (before they were fetched from a separate
>     repository);
> - now the pipeline fails if there are new violations of guidelines tagged
>     with clean:added.
> ---
>  automation/eclair_analysis/ECLAIR/Set1.ecl    |  59 ++++
>  automation/eclair_analysis/ECLAIR/Set2.ecl    |  25 ++
>  automation/eclair_analysis/ECLAIR/Set3.ecl    |  67 ++++
>  .../eclair_analysis/ECLAIR/action.helpers     | 193 ++++++++++++
>  .../eclair_analysis/ECLAIR/action.settings    | 172 ++++++++++
>  .../ECLAIR/action_clean_added.sh              |  36 +++
>  .../eclair_analysis/ECLAIR/action_log.sh      |  15 +
>  .../ECLAIR/action_pull_request.sh             |  57 ++++
>  .../eclair_analysis/ECLAIR/action_push.sh     |  95 ++++++
>  .../ECLAIR/action_upload_sarif.sh             |  31 ++
>  .../eclair_analysis/ECLAIR/analysis.ecl       |  25 ++
>  automation/eclair_analysis/ECLAIR/analyze.sh  | 106 +++++++
>  .../ECLAIR/call_properties.ecl                | 106 +++++++
>  .../eclair_analysis/ECLAIR/deviations.ecl     | 298 ++++++++++++++++++
>  .../eclair_analysis/ECLAIR/out_of_scope.ecl   | 127 ++++++++
>  .../ECLAIR/print_analyzed_files.sh            |  66 ++++
>  .../eclair_analysis/ECLAIR/public_APIs.ecl    |   6 +
>  automation/eclair_analysis/ECLAIR/report.ecl  |   4 +
>  automation/eclair_analysis/ECLAIR/tagging.ecl |  34 ++
>  .../eclair_analysis/ECLAIR/toolchain.ecl      | 275 ++++++++++++++++
>  20 files changed, 1797 insertions(+)
>  create mode 100644 automation/eclair_analysis/ECLAIR/Set1.ecl
>  create mode 100644 automation/eclair_analysis/ECLAIR/Set2.ecl
>  create mode 100644 automation/eclair_analysis/ECLAIR/Set3.ecl
>  create mode 100644 automation/eclair_analysis/ECLAIR/action.helpers
>  create mode 100644 automation/eclair_analysis/ECLAIR/action.settings
>  create mode 100755 automation/eclair_analysis/ECLAIR/action_clean_added.sh
>  create mode 100755 automation/eclair_analysis/ECLAIR/action_log.sh
>  create mode 100644 automation/eclair_analysis/ECLAIR/action_pull_request.sh
>  create mode 100755 automation/eclair_analysis/ECLAIR/action_push.sh
>  create mode 100755 automation/eclair_analysis/ECLAIR/action_upload_sarif.sh
>  create mode 100644 automation/eclair_analysis/ECLAIR/analysis.ecl
>  create mode 100755 automation/eclair_analysis/ECLAIR/analyze.sh
>  create mode 100644 automation/eclair_analysis/ECLAIR/call_properties.ecl
>  create mode 100644 automation/eclair_analysis/ECLAIR/deviations.ecl
>  create mode 100644 automation/eclair_analysis/ECLAIR/out_of_scope.ecl
>  create mode 100755 automation/eclair_analysis/ECLAIR/print_analyzed_files.sh
>  create mode 100644 automation/eclair_analysis/ECLAIR/public_APIs.ecl
>  create mode 100644 automation/eclair_analysis/ECLAIR/report.ecl
>  create mode 100644 automation/eclair_analysis/ECLAIR/tagging.ecl
>  create mode 100644 automation/eclair_analysis/ECLAIR/toolchain.ecl
> 
> diff --git a/automation/eclair_analysis/ECLAIR/Set1.ecl b/automation/eclair_analysis/ECLAIR/Set1.ecl
> new file mode 100644
> index 0000000000..86b8e7e772
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/Set1.ecl
> @@ -0,0 +1,59 @@
> +-doc_begin="Set 1 of Xen MISRA C guidelines"
> +-enable=MC3R1.R9.1
> +-enable=MC3R1.R12.5
> +-enable=MC3R1.R17.3
> +-enable=MC3R1.R17.4
> +-enable=MC3R1.R17.6
> +-enable=MC3R1.R19.1
> +-enable=MC3R1.R21.13
> +-enable=MC3R1.R21.17
> +-enable=MC3R1.R21.18
> +-enable=MC3R1.R21.19
> +-enable=MC3R1.R21.20
> +-enable=MC3R1.R21.21
> +-enable=MC3R1.R22.2
> +-enable=MC3R1.R22.4
> +-enable=MC3R1.R22.5
> +-enable=MC3R1.R22.6
> +-enable=MC3R1.D1.1
> +-enable=MC3R1.D2.1
> +-enable=MC3R1.D4.1
> +-enable=MC3R1.D4.3
> +-enable=MC3R1.D4.7
> +-enable=MC3R1.D4.10
> +-enable=MC3R1.D4.11
> +-enable=MC3R1.D4.14
> +-enable=MC3R1.R1.1
> +-enable=MC3R1.R1.3
> +-enable=MC3R1.R1.4
> +-enable=MC3R1.R2.1
> +-enable=MC3R1.R2.2
> +-enable=MC3R1.R3.1
> +-enable=MC3R1.R3.2
> +-enable=MC3R1.R4.1
> +-enable=MC3R1.R5.1
> +-enable=MC3R1.R5.2
> +-enable=MC3R1.R5.3
> +-enable=MC3R1.R5.4
> +-enable=MC3R1.R5.6
> +-enable=MC3R1.R6.1
> +-enable=MC3R1.R6.2
> +-enable=MC3R1.R7.1
> +-enable=MC3R1.R7.2
> +-enable=MC3R1.R7.3
> +-enable=MC3R1.R7.4
> +-enable=MC3R1.R8.1
> +-enable=MC3R1.R8.2
> +-enable=MC3R1.R8.3
> +-enable=MC3R1.R8.4
> +-enable=MC3R1.R8.5
> +-enable=MC3R1.R8.6
> +-enable=MC3R1.R8.8
> +-enable=MC3R1.R8.10
> +-enable=MC3R1.R8.12
> +-enable=MC3R1.R8.14
> +-enable=MC3R1.R9.2
> +-enable=MC3R1.R9.3
> +-enable=MC3R1.R9.4
> +-enable=MC3R1.R9.5
> +-doc_end
> diff --git a/automation/eclair_analysis/ECLAIR/Set2.ecl b/automation/eclair_analysis/ECLAIR/Set2.ecl
> new file mode 100644
> index 0000000000..7608335cf4
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/Set2.ecl
> @@ -0,0 +1,25 @@
> +-doc_begin="Set 2 of Xen MISRA C guidelines"
> +-enable=MC3R1.R10.1
> +-enable=MC3R1.R10.2
> +-enable=MC3R1.R10.3
> +-enable=MC3R1.R10.4
> +-enable=MC3R1.R10.6
> +-enable=MC3R1.R10.7
> +-enable=MC3R1.R10.8
> +-enable=MC3R1.R11.1
> +-enable=MC3R1.R11.2
> +-enable=MC3R1.R11.3
> +-enable=MC3R1.R11.6
> +-enable=MC3R1.R11.7
> +-enable=MC3R1.R11.8
> +-enable=MC3R1.R11.9
> +-enable=MC3R1.R12.2
> +-enable=MC3R1.R13.1
> +-enable=MC3R1.R13.2
> +-enable=MC3R1.R13.5
> +-enable=MC3R1.R13.6
> +-enable=MC3R1.R14.1
> +-enable=MC3R1.R14.2
> +-enable=MC3R1.R14.3
> +-enable=MC3R1.R14.4
> +-doc_end
> diff --git a/automation/eclair_analysis/ECLAIR/Set3.ecl b/automation/eclair_analysis/ECLAIR/Set3.ecl
> new file mode 100644
> index 0000000000..d2c2c4b21f
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/Set3.ecl
> @@ -0,0 +1,67 @@
> +-doc_begin="Set 3 of Xen MISRA C guidelines"
> +-enable=MC3R1.D4.12
> +-enable=MC3R1.R5.5
> +-enable=MC3R1.R5.7
> +-enable=MC3R1.R5.8
> +-enable=MC3R1.R15.2
> +-enable=MC3R1.R15.3
> +-enable=MC3R1.R15.6
> +-enable=MC3R1.R15.7
> +-enable=MC3R1.R16.1
> +-enable=MC3R1.R16.2
> +-enable=MC3R1.R16.3
> +-enable=MC3R1.R16.4
> +-enable=MC3R1.R16.5
> +-enable=MC3R1.R16.6
> +-enable=MC3R1.R16.7
> +-enable=MC3R1.R17.1
> +-enable=MC3R1.R17.2
> +-enable=MC3R1.R17.5
> +-enable=MC3R1.R17.7
> +-enable=MC3R1.R18.1
> +-enable=MC3R1.R18.2
> +-enable=MC3R1.R18.3
> +-enable=MC3R1.R18.6
> +-enable=MC3R1.R18.7
> +-enable=MC3R1.R18.8
> +-enable=MC3R1.R20.2
> +-enable=MC3R1.R20.3
> +-enable=MC3R1.R20.4
> +-enable=MC3R1.R20.6
> +-enable=MC3R1.R20.7
> +-enable=MC3R1.R20.8
> +-enable=MC3R1.R20.9
> +-enable=MC3R1.R20.11
> +-enable=MC3R1.R20.12
> +-enable=MC3R1.R20.13
> +-enable=MC3R1.R20.14
> +-enable=MC3R1.R21.1
> +-enable=MC3R1.R21.2
> +-enable=MC3R1.R21.3
> +-enable=MC3R1.R21.4
> +-enable=MC3R1.R21.5
> +-enable=MC3R1.R21.6
> +-enable=MC3R1.R21.7
> +-enable=MC3R1.R21.8
> +-enable=MC3R1.R21.9
> +-enable=MC3R1.R21.10
> +-enable=MC3R1.R21.12
> +-enable=MC3R1.R21.14
> +-enable=MC3R1.R21.15
> +-enable=MC3R1.R21.16
> +-enable=MC3R1.R22.1
> +-enable=MC3R1.R22.3
> +-enable=MC3R1.R22.7
> +-enable=MC3R1.R22.8
> +-enable=MC3R1.R22.9
> +-enable=MC3R1.R22.10
> +-enable=MC3R1.R2.6
> +-enable=MC3R1.R4.2
> +-doc_end
> +
> +-doc_begin="Guidelines added with Xen MISRA C Task (a): Xen Coding Guidelines v1.1, June 1, 2023"
> +-enable=MC3R1.R21.11
> +-enable=MC3R1.D4.4
> +-enable=MC3R1.R8.9
> +-enable=MC3R1.R12.4
> +-doc_end
> diff --git a/automation/eclair_analysis/ECLAIR/action.helpers b/automation/eclair_analysis/ECLAIR/action.helpers
> new file mode 100644
> index 0000000000..2ad6428eaa
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/action.helpers
> @@ -0,0 +1,193 @@
> +if [ -n "${GITLAB_CI:-}" ]; then
> +    ci=gitlab
> +elif [ -n "${GITHUB_ACTION:-}" ]; then
> +    ci=github
> +elif [ -n "${JENKINS_HOME:-}" ]; then
> +    ci=jenkins
> +else
> +    echo "Unexpected CI/CD context" >&2
> +    exit 1
> +fi
> +
> +esc=$(printf '\e')
> +cr=$(printf '\r')
> +
> +open_section() {
> +    id=$1
> +    title=$2
> +    collapsed=$3
> +    echo "${esc}[0Ksection_start:$(date +%s):${id}${collapsed}${cr}${esc}[0K${esc}[1m${esc}[36m${title}${esc}[m"
> +}
> +
> +close_section() {
> +    id=$1
> +    echo "${esc}[0Ksection_end:$(date +%s):${id}${cr}${esc}[0K"
> +}
> +
> +summary() {
> +    fixedReports=
> +    newReports=
> +    unfixedReports=
> +    while read -r line; do
> +        var=${line%%: *}
> +        val=${line#*: }
> +        eval "${var}=${val}"
> +    done <"${updateLog}"
> +
> +    case "${ci}" in
> +    github)
> +        nl="\\"
> +        ;;
> +    gitlab)
> +        nl=
> +        ;;
> +    jenkins)
> +        nl="<br/>"
> +        ;;
> +    *)
> +        nl=
> +        ;;
> +    esac
> +
> +    if [ -z "${newReports}" ]; then
> +        fixedMsg=
> +        unfixedMsg="Unfixed reports: ${unfixedReports}"
> +        countsMsg="${unfixedMsg}"
> +    else
> +        fixedMsg="Fixed reports: ${fixedReports}"
> +        unfixedMsg="Unfixed reports: ${unfixedReports} [new: ${newReports}]"
> +        countsMsg="${fixedMsg}${nl}
> +${unfixedMsg}"
> +    fi
> +    case "${ci}" in
> +    jenkins)
> +        cat <<EOF >"${summaryTxt}"
> +${countsMsg}                                                                              ${nl}
> +<a href="https://www.bugseng.com/eclair">
> +  <img src="${eclairReportUrlPrefix}/rsrc/eclair.svg" width="100" />
> +</a>
> +<h3>${jobHeadline}</h3>
> +<a href="${indexHtmlUrl}">Browse analysis results</a>
> +EOF
> +        ;;
> +    *)
> +        cat <<EOF >"${summaryTxt}"
> +<a href="https://www.bugseng.com/eclair">
> +  <img src="${eclairReportUrlPrefix}/rsrc/eclair.svg" width="100" />
> +</a>
> +Analysis Summary
> +
> +${jobHeadline}${nl}
> +${countsMsg}${nl}
> +[Browse analysis](${indexHtmlUrl})
> +EOF
> +        ;;
> +    esac
> +
> +    case ${ci} in
> +    github)
> +        cat "${summaryTxt}" >"${GITHUB_STEP_SUMMARY}"
> +        ;;
> +    gitlab)
> +        open_section ECLAIR_summary "ECLAIR analysis summary" ""
> +        # Generate summary and print it (GitLab-specific)
> +        cat <<EOF
> +${jobHeadline}
> +${countsMsg}
> +Browse analysis: ${esc}[33m${indexHtmlUrl}${esc}[m
> +EOF
> +        close_section ECLAIR_summary
> +        ;;
> +    jenkins)
> +        cat <<EOF
> +${jobHeadline}
> +${fixedMsg}
> +${unfixedMsg}
> +Browse analysis: ${indexHtmlUrl}
> +EOF
> +        ;;
> +    *)
> +        echo "Unexpected CI/CD context" >&2
> +        exit 1
> +        ;;
> +    esac
> +}
> +
> +log_file() {
> +    section_id=$1
> +    section_name=$2
> +    file=$3
> +    exit_code=$4
> +    if [ "${exit_code}" = 0 ]; then
> +        collapsed=[collapsed=true]
> +    else
> +        collapsed=
> +    fi
> +
> +    case ${ci} in
> +    github | jenkins)
> +        echo "${section_name}"
> +        ;;
> +    gitlab)
> +        open_section "${section_id}" "${section_name}" "${collapsed}"
> +        ;;
> +    *)
> +        echo "Unexpected CI/CD context" >&2
> +        exit 1
> +        ;;
> +    esac
> +
> +    cat "${file}"
> +
> +    case ${ci} in
> +    github | jenkins) ;;
> +    gitlab)
> +        close_section "${section_id}"
> +        ;;
> +    *) ;;
> +    esac
> +}
> +
> +maybe_log_file_exit() {
> +    section_id=$1
> +    section_name=$2
> +    file=$3
> +    exit_code=$4
> +
> +    case ${ci} in
> +    github | jenkins)
> +        echo "${section_name}"
> +        ;;
> +    gitlab)
> +        open_section "${section_id}" "${section_name}" ""
> +        ;;
> +    *)
> +        echo "Unexpected CI/CD context" >&2
> +        exit 1
> +        ;;
> +    esac
> +
> +    if [ "${exit_code}" != 0 ]; then
> +        cat "${file}"
> +    fi
> +
> +    case ${ci} in
> +    github | jenkins) ;;
> +    gitlab)
> +        close_section "${section_id}"
> +        ;;
> +    *) ;;
> +    esac
> +    return "${exit_code}"
> +}
> +
> +is_enabled() {
> +    case "$1" in
> +    true | TRUE | y | Y | yes | YES | 1)
> +        return 0
> +        ;;
> +    *)
> +        return 1
> +        ;;
> +    esac
> +}
> diff --git a/automation/eclair_analysis/ECLAIR/action.settings b/automation/eclair_analysis/ECLAIR/action.settings
> new file mode 100644
> index 0000000000..0f7950f5ab
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/action.settings
> @@ -0,0 +1,172 @@
> +variantSubDir=
> +variantHeadline=
> +if [ -n "${VARIANT:-}" ]; then
> +    variantSubDir="/${VARIANT}"
> +    variantHeadline=" [${VARIANT}]"
> +fi
> +
> +# AUTO PR Feature
> +# If the following variables are defined, then all pipelines
> +# of other branches will be considered pull-requests to
> +# autoPRBranch.
> +# Customized
> +autoPRRepository="${AUTO_PR_REPOSITORY:-}"
> +# Customized
> +autoPRBranch="${AUTO_PR_BRANCH:-}"
> +
> +# Customized
> +artifactsRoot=/var/local/eclair
> +
> +case "${ci}" in
> +github)
> +    # To be customized
> +    repository="${GITHUB_REPOSITORY}"
> +    jobId="${GITHUB_RUN_NUMBER}"
> +
> +    autoPRRemoteUrl="${GITHUB_SERVER_URL}/${autoPRRepository:-}"
> +
> +    case "${GITHUB_EVENT_NAME}" in
> +    pull_request*)
> +        event=pull_request
> +        pullRequestId="${GITHUB_EVENT_PULL_REQUEST_NUMBER}"
> +        pullRequestHeadRepo="${PR_HEAD_REPO}"
> +        pullRequestHeadRef="${PR_HEAD_REF}"
> +        pullRequestBaseRef="${PR_BASE_REF}"
> +        pullRequestUser="${PR_USER}"
> +        # baseCommitId and headCommitId are the most recent merge points without conflicts
> +        git fetch -q --deepen=2
> +        baseCommitId=$(git show -s --pretty=%H HEAD^1)
> +        headCommitId=$(git show -s --pretty=%H HEAD^2)
> +        ;;
> +    push | workflow_dispatch)
> +        event=push
> +        # Extract the branch name from "refs/heads/<branch>"
> +        branch="${GITHUB_REF#refs/heads/}"
> +        headCommitId="${GITHUB_SHA}"
> +        pushUser="${GITHUB_ACTOR}"
> +        ;;
> +    *)
> +        echo "Unexpected GITHUB_REF ${GITHUB_REF}" >&2
> +        exit 1
> +        ;;
> +    esac
> +    ;;
> +gitlab)
> +    # Customized
> +    repository="${CI_PROJECT_PATH}"
> +    jobId="${CI_JOB_ID}"
> +
> +    gitlabApiUrl="${CI_SERVER_PROTOCOL}://${CI_SERVER_HOST}:${CI_SERVER_PORT}/api/v4"
> +    autoPRRemoteUrl="${CI_SERVER_PROTOCOL}://${CI_SERVER_HOST}:${CI_SERVER_PORT}/${autoPRRepository:-}"
> +
> +    # Customized
> +    gitlabBotToken="${ECLAIR_BOT_TOKEN:-}"
> +
> +    case "${CI_PIPELINE_SOURCE}" in
> +    merge_request_event)
> +        event=pull_request
> +        pullRequestId="${CI_MERGE_REQUEST_IID}"
> +        pullRequestHeadRef="${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
> +        pullRequestHeadRepo="${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH}"
> +        pullRequestBaseRef="${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}"
> +        pullRequestUser="${GITLAB_USER_LOGIN}"
> +        headCommitId="${CI_COMMIT_SHA}"
> +        baseCommitId="${CI_MERGE_REQUEST_DIFF_BASE_SHA}"
> +        ;;
> +    push | pipeline | web)
> +        event=push
> +        branch="${CI_COMMIT_BRANCH}"
> +        headCommitId="${CI_COMMIT_SHA}"
> +        pushUser="${GITLAB_USER_NAME}"
> +        ;;
> +    *)
> +        echo "Unexpected event ${CI_PIPELINE_SOURCE}" >&2
> +        exit 1
> +        ;;
> +    esac
> +    ;;
> +jenkins)
> +    # To be customized
> +    repository="${JOB_BASE_NAME}"
> +    project="${JOB_NAME}"
> +    jobId="${BUILD_NUMBER}"
> +
> +    jenkinsApiUrl="${JENKINS_URL}"
> +    autoPRRemoteUrl="${JENKINS_URL}/${autoPRRepository:-}"
> +
> +    # To be customized
> +    jenkinsBotUsername="${ECLAIR_BOT_USERNAME:-}"
> +    jenkinsBotToken="${ECLAIR_BOT_TOKEN:-}"
> +
> +    event=push
> +    branch="${GIT_BRANCH}"
> +    headCommitId="${GIT_COMMIT}"
> +    pushUser=$(git show --pretty='format:%aN' -s)
> +    ;;
> +*)
> +    echo "Unexpected CI/CD context" >&2
> +    exit 1
> +    ;;
> +esac
> +
> +if [ "${event}" = "push" ] && [ -n "${autoPRBranch:-}" ]; then
> +    # AUTO PR Feature enabled
> +    if ! [ "${branch}" = "${autoPRBranch}" ] ||
> +        ! [ "${repository}" = "${autoPRRepository}" ]; then
> +        event=auto_pull_request
> +    fi
> +fi
> +
> +case "${event}" in
> +pull_request)
> +    subDir="${pullRequestHeadRepo}.ecdf/${pullRequestBaseRef}"
> +    jobHeadline="ECLAIR ${ANALYSIS_KIND} on repository ${repository}: ${pullRequestUser} wants to merge ${pullRequestHeadRepo}:${pullRequestHeadRef} (${headCommitId}) into ${pullRequestBaseRef} (${baseCommitId})"
> +    ;;
> +push)
> +    subDir="${branch}"
> +    jobHeadline="ECLAIR ${ANALYSIS_KIND} on repository ${repository}: branch ${branch} (${headCommitId})"
> +    badgeLabel="ECLAIR ${ANALYSIS_KIND} ${branch}${variantHeadline} #${jobId}"
> +    ;;
> +auto_pull_request)
> +    git remote remove autoPRRemote || true
> +    git remote add autoPRRemote "${autoPRRemoteUrl}"
> +    git fetch autoPRRemote
> +    subDir="${branch}"
> +    baseCommitId=$(git merge-base "autoPRRemote/${autoPRBranch}" HEAD)
> +    jobHeadline="ECLAIR ${ANALYSIS_KIND} on repository ${repository}: ${pushUser} wants to merge ${repository}:${branch} (${headCommitId}) into ${autoPRRepository}/${autoPRBranch} (${baseCommitId})"
> +    ;;
> +*)
> +    echo "Unexpected event ${event}" >&2
> +    exit 1
> +    ;;
> +esac
> +
> +case "${repository}" in
> +xen-project/xen)
> +    # Customized
> +    keepOldAnalyses=0
> +    ;;
> +xen-project/*)
> +    # Customized
> +    keepOldAnalyses=10
> +    ;;
> +*)
> +    echo "Unexpected repository" >&2
> +    exit 1
> +    ;;
> +esac
> +
> +ECLAIR_BIN_DIR=/opt/bugseng/eclair/bin/
> +
> +artifactsDir="${artifactsRoot}/xen-project.ecdf/${repository}/ECLAIR_${ANALYSIS_KIND}"
> +subDir="${subDir}${variantSubDir}"
> +jobHeadline="${jobHeadline}${variantHeadline}"
> +
> +# Customized
> +eclairReportUrlPrefix=https://saas.eclairit.com:3787
> +
> +jobDir="${artifactsDir}/${subDir}/${jobId}"
> +updateLog="${analysisOutputDir}/update.log"
> +commentLog="${analysisOutputDir}/comment.json"
> +indexHtmlUrl="${eclairReportUrlPrefix}/fs${jobDir}/index.html"
> +summaryTxt="${analysisOutputDir}/summary.txt"
> diff --git a/automation/eclair_analysis/ECLAIR/action_clean_added.sh b/automation/eclair_analysis/ECLAIR/action_clean_added.sh
> new file mode 100755
> index 0000000000..59bc35fd13
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/action_clean_added.sh
> @@ -0,0 +1,36 @@
> +#!/bin/sh
> +
> +set -eu
> +
> +usage() {
> +    echo "Usage: $0 ANALYSIS_OUTPUT_DIR" >&2
> +    exit 2
> +}
> +
> +[ $# -eq 1 ] || usage
> +
> +analysisOutputDir=$1
> +
> +cleanAddedTxt="${analysisOutputDir}/clean_added.log"
> +
> +# Load settings and helpers
> +. "$(dirname "$0")/action.helpers"
> +. "$(dirname "$0")/action.settings"
> +
> +unexpectedReports=$("${ECLAIR_BIN_DIR}eclair_report" \
> +    "-db='${analysisOutputDir}/PROJECT.ecd'" \
> +    "-sel_unfixed=unfixed" \
> +    "-sel_tag_glob=clean_added,clean,added" \
> +    "-print='',reports_count()")
> +
> +if [ "${unexpectedReports}" -gt 0 ]; then
> +    cat <<EOF >"${cleanAddedTxt}"
> +Failure: ${unexpectedReports} unexpected reports found.
> +Unexpected reports are tagged 'clean:added'.
> +EOF
> +    exit 1
> +else
> +    cat <<EOF >"${cleanAddedTxt}"
> +Success: No unexpected reports.
> +EOF
> +fi
> diff --git a/automation/eclair_analysis/ECLAIR/action_log.sh b/automation/eclair_analysis/ECLAIR/action_log.sh
> new file mode 100755
> index 0000000000..67125b08f3
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/action_log.sh
> @@ -0,0 +1,15 @@
> +#!/bin/sh
> +
> +set -eu
> +
> +usage() {
> +    echo "Usage: $0 SECTION_ID SECTION_NAME FILE EXIT_CODE" >&2
> +    exit 2
> +}
> +
> +[ $# -eq 4 ] || usage
> +
> +# Load settings and helpers
> +. "$(dirname "$0")/action.helpers"
> +
> +log_file "$@"
> diff --git a/automation/eclair_analysis/ECLAIR/action_pull_request.sh b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
> new file mode 100644
> index 0000000000..68f7e6282e
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
> @@ -0,0 +1,57 @@
> +#!/bin/sh
> +
> +set -eu
> +
> +usage() {
> +    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR COMMIT_ID" >&2
> +    exit 2
> +}
> +
> +[ $# -eq 2 ] || usage
> +
> +wtoken=$1
> +analysisOutputDir=$2
> +
> +# Load settings and helpers
> +. "$(dirname "$0")/action.helpers"
> +. "$(dirname "$0")/action.settings"
> +
> +curl -sS "${eclairReportUrlPrefix}/ext/update_pull_request" \
> +    -F "wtoken=${wtoken}" \
> +    -F "artifactsDir=${artifactsDir}" \
> +    -F "subDir=${subDir}" \
> +    -F "jobId=${jobId}" \
> +    -F "jobHeadline=${jobHeadline}" \
> +    -F "baseCommitId=${baseCommitId}" \
> +    -F "keepOldAnalyses=${keepOldAnalyses}" \
> +    -F "db=@${analysisOutputDir}/PROJECT.ecd" \
> +    >"${updateLog}"
> +ex=0
> +grep -Fq "unfixedReports: " "${updateLog}" || ex=$?
> +maybe_log_file_exit PUBLISH_RESULT "Publishing results" "${updateLog}" "${ex}"
> +
> +summary
> +
> +if is_enabled "${ENABLE_ECLAIR_BOT:-}"; then
> +    case ${ci} in
> +    github)
> +        ex=0
> +        gh api \
> +            --method POST \
> +            "/repos/${repository}/issues/${pullRequestId}/comments" \
> +            -F "body=@${summaryTxt}" \
> +            --silent >"${commentLog}" 2>&1 || ex=$?
> +        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "${ex}"
> +        ;;
> +    gitlab)
> +        curl -sS --request POST \
> +            "${gitlabApiUrl}/projects/${CI_PROJECT_ID}/merge_requests/${pullRequestId}/notes" \
> +            -H "PRIVATE-TOKEN: ${gitlabBotToken}" \
> +            -F "body=<${summaryTxt}" >"${commentLog}"
> +        ex=0
> +        grep -Fq "Unfixed reports: " "${commentLog}" || ex=$?
> +        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "${ex}"
> +        ;;
> +    *) ;;
> +    esac
> +fi
> diff --git a/automation/eclair_analysis/ECLAIR/action_push.sh b/automation/eclair_analysis/ECLAIR/action_push.sh
> new file mode 100755
> index 0000000000..45215fbf00
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/action_push.sh
> @@ -0,0 +1,95 @@
> +#!/bin/sh
> +
> +set -eu
> +
> +usage() {
> +    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR" >&2
> +    exit 2
> +}
> +
> +[ $# -eq 2 ] || usage
> +
> +wtoken=$1
> +analysisOutputDir=$2
> +
> +# Load settings and helpers
> +. "$(dirname "$0")/action.helpers"
> +. "$(dirname "$0")/action.settings"
> +
> +case "${event}" in
> +push)
> +    curl -sS "${eclairReportUrlPrefix}/ext/update_push" \
> +        -F "wtoken=${wtoken}" \
> +        -F "artifactsDir=${artifactsDir}" \
> +        -F "subDir=${subDir}" \
> +        -F "jobId=${jobId}" \
> +        -F "jobHeadline=${jobHeadline}" \
> +        -F "commitId=${headCommitId}" \
> +        -F "badgeLabel=${badgeLabel}" \
> +        -F "keepOldAnalyses=${keepOldAnalyses}" \
> +        -F "db=@${analysisOutputDir}/PROJECT.ecd" \
> +        >"${updateLog}"
> +    ;;
> +auto_pull_request)
> +    curl -sS "${eclairReportUrlPrefix}/ext/update_pull_request" \
> +        -F "wtoken=${wtoken}" \
> +        -F "artifactsDir=${artifactsDir}" \
> +        -F "subDir=${subDir}" \
> +        -F "jobId=${jobId}" \
> +        -F "jobHeadline=${jobHeadline}" \
> +        -F "baseCommitId=${baseCommitId}" \
> +        -F "keepOldAnalyses=${keepOldAnalyses}" \
> +        -F "db=@${analysisOutputDir}/PROJECT.ecd" \
> +        >"${updateLog}"
> +    ;;
> +*)
> +    echo "Unexpected event ${event}" >&2
> +    exit 1
> +    ;;
> +esac
> +
> +ex=0
> +grep -Fq "unfixedReports: " "${updateLog}" || ex=$?
> +maybe_log_file_exit PUBLISH_RESULT "Publishing results" "${updateLog}" "${ex}"
> +
> +summary
> +
> +if is_enabled "${ENABLE_ECLAIR_BOT:-}"; then
> +    case ${ci} in
> +    github)
> +        ex=0
> +        gh api \
> +            --method POST \
> +            "/repos/${repository}/commits/${headCommitId}/comments" \
> +            -F "body=@${summaryTxt}" \
> +            --silent >"${commentLog}" 2>&1 || ex=$?
> +        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "${ex}"
> +        ;;
> +    gitlab)
> +        curl -sS --request POST \
> +            "${gitlabApiUrl}/projects/${CI_PROJECT_ID}/repository/commits/${CI_COMMIT_SHA}/comments" \
> +            -H "PRIVATE-TOKEN: ${gitlabBotToken}" \
> +            -F "note=<${summaryTxt}" >"${commentLog}"
> +        ex=0
> +        grep -Fq "Unfixed reports: " "${commentLog}" || ex=$?
> +        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "${ex}"
> +        ;;
> +    jenkins)
> +        ex=0
> +        curl \
> +            --user "${jenkinsBotUsername}:${jenkinsBotToken}" \
> +            --data-urlencode "description=$(cat "${summaryTxt}")" \
> +            --data-urlencode "Submit=Submit" \
> +            "${jenkinsApiUrl}job/${project}/${jobId}/submitDescription" \
> +            >"${commentLog}" 2>&1 || ex=$?
> +        curl \
> +            --user "${jenkinsBotUsername}:${jenkinsBotToken}" \
> +            --data-urlencode "description=$(cat "${summaryTxt}")" \
> +            --data-urlencode "Submit=Submit" \
> +            "${jenkinsApiUrl}job/${project}/submitDescription" \
> +            >"${commentLog}" 2>&1 || ex=$?
> +        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "${ex}"
> +        ;;
> +    *) ;;
> +    esac
> +fi
> diff --git a/automation/eclair_analysis/ECLAIR/action_upload_sarif.sh b/automation/eclair_analysis/ECLAIR/action_upload_sarif.sh
> new file mode 100755
> index 0000000000..60b8034fcc
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/action_upload_sarif.sh
> @@ -0,0 +1,31 @@
> +#!/bin/sh
> +
> +set -eu
> +
> +usage() {
> +    echo "Usage: $0 SARIF_FILE" >&2
> +    exit 2
> +}
> +
> +[ $# -eq 1 ] || usage
> +
> +HERE=$( (
> +    cd "$(dirname "$0")"
> +    echo "${PWD}"
> +))
> +
> +. "${HERE}/action.helpers"
> +
> +sarifFile=$1
> +sarifPayload=${HERE}/sarif.gz.b64
> +uploadLog=${HERE}/upload_sarif.log
> +
> +gzip -c "${sarifFile}" | base64 -w0 >"${sarifPayload}"
> +
> +ex=0
> +gh api --method POST -H "Accept: application/vnd.github+json" \
> +    "/repos/${GITHUB_REPOSITORY}/code-scanning/sarifs" \
> +    -f "commit_sha=${GITHUB_SHA}" -f "ref=${GITHUB_REF}" \
> +    -F "sarif=@${sarifPayload}" \
> +    --silent >"${uploadLog}" 2>&1 || ex=$?
> +maybe_log_file_exit ADD_COMMENT "Uploading SARIF" "${uploadLog}" "${ex}"
> diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/eclair_analysis/ECLAIR/analysis.ecl
> new file mode 100644
> index 0000000000..fe418d6da1
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
> @@ -0,0 +1,25 @@
> +-setq=set,getenv("SET")
> +-project_name=getenv("ECLAIR_PROJECT_NAME")
> +-project_root=getenv("ECLAIR_PROJECT_ROOT")
> +
> +-setq=data_dir,getenv("ECLAIR_DATA_DIR")
> +
> +-verbose
> +
> +-enable=B.REPORT.ECB
> +-config=B.REPORT.ECB,output=join_paths(data_dir,"FRAME.@FRAME@.ecb")
> +-config=B.REPORT.ECB,preprocessed=show
> +-config=B.REPORT.ECB,macros=10
> +
> +-enable=B.EXPLAIN
> +
> +-eval_file=toolchain.ecl
> +-eval_file=public_APIs.ecl
> +-eval_file=out_of_scope.ecl
> +-eval_file=deviations.ecl
> +-eval_file=call_properties.ecl
> +-eval_file=tagging.ecl
> +-eval_file=concat(set,".ecl")
> +
> +-doc="Hide reports in external code."
> +-reports+={hide,all_exp_external}
> diff --git a/automation/eclair_analysis/ECLAIR/analyze.sh b/automation/eclair_analysis/ECLAIR/analyze.sh
> new file mode 100755
> index 0000000000..47cdbb03ce
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/analyze.sh
> @@ -0,0 +1,106 @@
> +#!/bin/bash
> +# Stop immediately if any executed command has exit status different from 0.
> +set -e
> +set -o pipefail
> +
> +script_name="$(basename "$0")"
> +
> +fatal() {
> +  echo "${script_name}: $*" >&2
> +  exit 1
> +}
> +
> +usage() {
> +  fatal "Usage: ${script_name} <ARM64|X86_64> <Set0|Set1|Set2|Set3>"
> +}
> +
> +if [[ $# -ne 2 ]]; then
> +  usage
> +fi
> +
> +# Absolute path of the ECLAIR bin directory.
> +export ECLAIR_BIN_DIR=/opt/bugseng/eclair/bin/
> +
> +# Directory where this script resides: usually in a directory named "ECLAIR".
> +SCRIPT_DIR="$(
> +  cd "$(dirname "$0")"
> +  echo "${PWD}"
> +)"
> +# Directory where to put all ECLAIR output and temporary files.
> +if [[ -z "${ECLAIR_OUTPUT_DIR:-}" ]]; then
> +  ECLAIR_OUTPUT_DIR="${PWD}/ECLAIR/out"
> +fi
> +
> +export ECLAIR_DIAGNOSTICS_OUTPUT="${ECLAIR_OUTPUT_DIR}/ANALYSIS.log"
> +# Set the variable for the build log file.
> +ECLAIR_BUILD_LOG=${ECLAIR_OUTPUT_DIR}/BUILD.log
> +# Set the variable for the report log file.
> +ECLAIR_REPORT_LOG=${ECLAIR_OUTPUT_DIR}/REPORT.log
> +
> +if [[ "$1" = "X86_64" ]]; then
> +  export CROSS_COMPILE=
> +  export XEN_TARGET_ARCH=x86_64
> +  EXTRA_ECLAIR_ENV_OPTIONS=-disable=MC3R1.R20.7
> +elif [[ "$1" = "ARM64" ]]; then
> +  export CROSS_COMPILE=aarch64-linux-gnu-
> +  export XEN_TARGET_ARCH=arm64
> +else
> +  fatal "Unknown configuration: $1"
> +fi
> +
> +VARIANT="${XEN_TARGET_ARCH}"
> +
> +# Used in analysis.ecl
> +case "$2" in
> +Set0|Set1|Set2|Set3)
> +  export SET="$2"
> +  ;;
> +*)
> +  fatal "Unknown configuration: $2"
> +  ;;
> +esac
> +
> +export CC_ALIASES="${CROSS_COMPILE}gcc-12"
> +export CXX_ALIASES="${CROSS_COMPILE}g++-12"
> +export LD_ALIASES="${CROSS_COMPILE}ld"
> +export AR_ALIASES="${CROSS_COMPILE}ar"
> +export AS_ALIASES="${CROSS_COMPILE}as"
> +export FILEMANIP_ALIASES="cp mv ${CROSS_COMPILE}objcopy"
> +
> +# ECLAIR binary data directory and workspace.
> +export ECLAIR_DATA_DIR="${ECLAIR_OUTPUT_DIR}/.data"
> +# ECLAIR workspace.
> +export ECLAIR_WORKSPACE="${ECLAIR_DATA_DIR}/eclair_workspace"
> +
> +# Identifies the particular build of the project.
> +export ECLAIR_PROJECT_NAME="XEN_${VARIANT}-${SET}"
> +# All paths mentioned in ECLAIR reports that are below this directory
> +# will be presented as relative to ECLAIR_PROJECT_ROOT.
> +export ECLAIR_PROJECT_ROOT="${PWD}"
> +
> +# Erase and recreate the output directory and the data directory.
> +rm -rf "${ECLAIR_OUTPUT_DIR:?}/*"
> +mkdir -p "${ECLAIR_DATA_DIR}"
> +
> +# Perform the build (from scratch) in an ECLAIR environment.
> +"${ECLAIR_BIN_DIR}eclair_env" \
> +    "-config_file='${SCRIPT_DIR}/analysis.ecl'" \
> +    "${EXTRA_ECLAIR_ENV_OPTIONS}" \
> +  -- "${SCRIPT_DIR}/../build.sh" "$1" | tee "${ECLAIR_BUILD_LOG}"
> +
> +
> +# Create the project database.
> +PROJECT_ECD="${ECLAIR_OUTPUT_DIR}/PROJECT.ecd"
> +find "${ECLAIR_DATA_DIR}" -maxdepth 1 -name "FRAME.*.ecb" |
> +  sort | xargs cat |
> +  "${ECLAIR_BIN_DIR}eclair_report" \
> +    "-create_db='${PROJECT_ECD}'" \
> +    -load=/dev/stdin > "${ECLAIR_REPORT_LOG}" 2>&1
> +
> +# Create the Jenkins reports file.
> +"${ECLAIR_BIN_DIR}eclair_report" \
> +  "-db='${PROJECT_ECD}'" \
> +  "-eval_file='${SCRIPT_DIR}/report.ecl'" \
> +  >> "${ECLAIR_REPORT_LOG}" 2>&1
> +
> +"${SCRIPT_DIR}/print_analyzed_files.sh" "${PROJECT_ECD}" "${ECLAIR_OUTPUT_DIR}"
> diff --git a/automation/eclair_analysis/ECLAIR/call_properties.ecl b/automation/eclair_analysis/ECLAIR/call_properties.ecl
> new file mode 100644
> index 0000000000..3f7794bf8b
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/call_properties.ecl
> @@ -0,0 +1,106 @@
> +
> +-call_properties+={"name(printk)", {"pointee_write(1..=never)", "taken()"}}
> +-call_properties+={"name(debugtrace_printk)", {"pointee_write(1..=never)", "taken()"}}
> +-call_properties+={"name(panic)", {"pointee_write(1..=never)", "taken()"}}
> +-call_properties+={"macro(^domain_crash$)", {"pointee_write(2..=never)", "taken()"}}
> +-call_properties+={"macro(^(g?d|mm_)?printk$)", {"pointee_write(2..=never)", "taken()"}}
> +-call_properties+={"macro(^guest_bug_on_failed$)", {"pointee_write(1=never)", "taken()"}}
> +-call_properties+={"macro(^spin_lock_init_prof$)", {"pointee_write(2=never)", "taken()"}}
> +-call_properties+={"macro(^sched_test_func$)", {"pointee_write(1..=never)", "taken()"}}
> +-call_properties+={"macro(^dev_(info|warn)$)", {"pointee_write(1..=never)", "taken()"}}
> +-call_properties+={"macro(^PAGING_DEBUG$)", {"pointee_write(1..=never)", "taken()"}}
> +-call_properties+={"macro(^ACPI_(WARNING|ERROR|INFO)$)", {"pointee_write(1..=never)", "taken()"}}
> +-call_properties+={"name(fdt_get_property_by_offset_)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(read_atomic_size)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(device_tree_get_reg)", {"pointee_write(4..=always)", "pointee_read(4..=never)", "taken()"}}
> +-call_properties+={"name(dt_get_range)", {"pointee_write(3..=always)", "pointee_read(3..=never)", "taken()"}}
> +-call_properties+={"name(parse_static_mem_prop)", {"pointee_write(2..=always)", "pointee_read(2..=never)", "taken()"}}
> +-call_properties+={"name(get_ttbr_and_gran_64bit)", {"pointee_write(1..2=always)", "pointee_read(1..2=never)", "taken()"}}
> +-call_properties+={"name(hvm_emulate_init_once)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(__vmread)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(hvm_pci_decode_addr)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(vpci_mmcfg_decode_addr)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(x86emul_decode)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(unmap_grant_ref)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(arm_smmu_cmdq_build_cmd)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(pci_size_mem_bar)", {"pointee_write(4=always)", "pointee_read(4=never)", "taken()"}}
> +-call_properties+={"name(_hvm_read_entry)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(hvm_map_guest_frame_rw)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(guest_cpuid)", {"pointee_write(4=always)", "pointee_read(4=never)", "taken()"}}
> +-call_properties+={"name(epte_get_entry_emt)", {"pointee_write(5=always)", "pointee_read(5=never)", "taken()"}}
> +-call_properties+={"name(mcheck_mca_logout)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(set_field_in_reg_u32)", {"pointee_write(5=always)", "pointee_read(5=never)", "taken()"}}
> +-call_properties+={"name(alloc_affinity_masks)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(xasprintf)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(find_non_smt)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(call_rcu)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(getdomaininfo)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"^MAPPING_(INSERT|SEARCH)\\(.*$", {"pointee_write(2..=always)", "pointee_read(2..=never)", "taken()"}}
> +-call_properties+={"name(FormatDec)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(FormatHex)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(p2m_get_ioreq_server)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(elf_memset_unchecked)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(set_iommu_pte_present)", {"pointee_write(7=always)", "pointee_read(7=never)", "taken()"}}
> +-call_properties+={"name(clear_iommu_pte_present)", {"pointee_write(4=always)", "pointee_read(4=never)", "taken()"}}
> +-call_properties+={"name(vcpu_runstate_get)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(va_start)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(sgi_target_init)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(get_hw_residencies)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(x86_cpu_policy_to_featureset)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"^simple_strtou?ll?\\(.*$", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(msi_compose_msg)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(print_tainted)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(get_hvm_registers)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(x86_insn_modrm)", {"pointee_write(2..3=always)", "pointee_read(2..3=never)", "taken()"}}
> +-call_properties+={"name(cpuid_count_leaf)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(rcu_lock_remote_domain_by_id)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(cpuid_count)", {"pointee_write(3..=always)", "pointee_read(3..=never)", "taken()"}}
> +-call_properties+={"name(efi_boot_mem_unused)", {"pointee_write(1..=always)", "pointee_read(1..=never)", "taken()"}}
> +-call_properties+={"name(collect_time_info)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(setup_xstate_comp)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"name(map_domain_gfn)", {"pointee_read(5=never)", "taken()"}}
> +-call_properties+={"name(fdt_getprop)", {"pointee_read(4=never)", "taken()"}}
> +-call_properties+={"name(fdt_get_name)", {"pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(fdt_get_property)", {"pointee_read(4=never)", "taken()"}}
> +-call_properties+={"name(pci_get_host_bridge_segment)", {"pointee_read(2=never)", "taken()"}}
> +-call_properties+={"name(dt_get_property)", {"pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(dt_property_read_u32)", {"pointee_read(3=never)", "taken()"}}
> +-call_properties+={"name(dt_device_get_paddr)", {"pointee_read(3..4=never)", "taken()"}}
> +-call_properties+={"name(get_evtchn_dt_property)", {"pointee_write(2..3=maybe)", "pointee_read(2..3=never)", "taken()"}}
> +-call_properties+={"name(setup_chosen_node)", {"pointee_write(2..3=maybe)", "pointee_read(2..3=never)", "taken()"}}
> +-call_properties+={"name(queue_remove_raw)", {"pointee_read(2=never)", "taken()"}}
> +-call_properties+={"macro(^memset$)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"macro(^va_start$)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"macro(^memcmp$)", {"pointee_write(1..2=never)", "taken()"}}
> +-call_properties+={"macro(^memcpy$)", {"pointee_write(1=always&&2..=never)", "pointee_read(1=never&&2..=always)", "taken()"}}
> +
> +-doc_begin="Property inferred as a consequence of the semantics of device_tree_get_reg"
> +-call_properties+={"name(acquire_static_memory_bank)", {"pointee_write(4..=always)", "pointee_read(4..=never)", "taken()"}}
> +-doc_end
> +
> +-doc_begin="Property inferred as a consequence of the semantics of dt_set_cell"
> +-call_properties+={"name(set_interrupt)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-doc_end
> +
> +-doc_begin="Property inferred as a consequence of the semantics of __p2m_get_mem_access"
> +-call_properties+={"name(p2m_get_mem_access)", {"pointee_write(3=always)", "pointee_read(3=never)", "taken()"}}
> +-doc_end
> +
> +-doc_begin="This function has alternative definitions with props {write=always,read=never} and {write=never,read=never}"
> +-call_properties+={"name(alloc_cpumask_var)", {"pointee_write(1=maybe)", "pointee_read(1=never)", "taken()"}}
> +-doc_end
> +
> +-doc_begin="Property inferred as a consequence of the semantics of alloc_cpumask_var"
> +-call_properties+={"name(xenctl_bitmap_to_cpumask)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-doc_end
> +
> +-doc_begin="The call to bitmap_and causes the pointee of dstp to be always written"
> +-call_properties+={"^cpumask_(and|andnot|clear|copy|complement).*$", {"pointee_write(1=always)", "pointee_read(1=never)" "taken()"}}
> +-call_properties+={"^bitmap_(andnot|complement|fill).*$", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-doc_end
> +
> +-doc_begin="The .*copy_(to|from).* helpers all have a memcpy-like expectation that the destination is a copy of the source.
> +Furthermore, their uses do initialize the involved variables as needed by futher uses in the caller."
> +-call_properties+={"macro(^(__)?(raw_)?copy_from_(paddr|guest|compat)(_offset)?$)", {"pointee_write(1=always)", "pointee_read(1=never)", "taken()"}}
> +-call_properties+={"macro(^(__)?copy_to_(guest|compat)(_offset)?$)", {"pointee_write(2=always)", "pointee_read(2=never)", "taken()"}}
> +-doc_end
> diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
> new file mode 100644
> index 0000000000..e1a06daf2f
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
> @@ -0,0 +1,298 @@
> +### Set 1 ###
> +
> +#
> +# Series 2.
> +#
> +
> +-doc_begin="The compiler implementation guarantees that the unreachable code is removed.
> +Constant expressions and unreachable branches of if and switch statements are expected."
> +-config=MC3R1.R2.1,+reports={safe,"first_area(^.*has an invariantly.*$)"}
> +-config=MC3R1.R2.1,+reports={safe,"first_area(^.*incompatible with labeled statement$)"}
> +-doc_end
> +
> +-doc_begin="Some functions are intended to be not referenced."
> +-config=MC3R1.R2.1,+reports={deliberate,"first_area(^.*is never referenced$)"}
> +-doc_end
> +
> +-doc_begin="Unreachability in the following macros are expected and safe."
> +-config=MC3R1.R2.1,statements+={safe,"macro(name(BUG||assert_failed||ERROR_EXIT||ERROR_EXIT_DOM||PIN_FAIL))"}
> +-doc_end
> +
> +-doc_begin="Proving compliance with respect to Rule 2.2 is generally impossible:
> +see https://arxiv.org/abs/2212.13933 for details. Moreover, peer review gives us
> +confidence that no evidence of errors in the program's logic has been missed due
> +to undetected violations of Rule 2.2, if any. Testing on time behavior gives us
> +confidence on the fact that, should the program contain dead code that is not
> +removed by the compiler, the resulting slowdown is negligible."
> +-config=MC3R1.R2.2,reports+={disapplied,"any()"}
> +-doc_end
> +
> +#
> +# Series 3.
> +#
> +
> +-doc_begin="Comments starting with '/*' and containing hyperlinks are safe as
> +they are not instances of commented-out code."
> +-config=MC3R1.R3.1,reports+={safe, "first_area(text(^.*https?://.*$))"}
> +-doc_end
> +
> +#
> +# Series 4.
> +#
> +
> +-doc_begin="The directive has been accepted only for the ARM codebase."
> +-config=MC3R1.D4.3,reports+={disapplied,"!(any_area(any_loc(file(^xen/arch/arm/arm64/.*$))))"}
> +-doc_end
> +
> +-doc_begin="Depending on the compiler, rewriting the following function-like
> +macros as inline functions is not guaranteed to have the same effect."
> +-config=MC3R1.D4.9,macros+={deliberate,"name(likely)"}
> +-config=MC3R1.D4.9,macros+={deliberate,"name(unlikely)"}
> +-config=MC3R1.D4.9,macros+={deliberate,"name(unreachable)"}
> +-doc_end
> +
> +-doc_begin="These macros can be used on both pointers and unsigned long type values."
> +-config=MC3R1.D4.9,macros+={safe,"name(virt_to_maddr)"}
> +-config=MC3R1.D4.9,macros+={safe,"name(virt_to_mfn)"}
> +-doc_end
> +
> +-doc_begin="Rewriting variadic macros as variadic functions might have a negative impact on safety."
> +-config=MC3R1.D4.9,macros+={deliberate,"variadic()"}
> +-doc_end
> +
> +-doc_begin="Rewriting macros with arguments that are, in turn, arguments of
> +__builtin_constant_p() can change the behavior depending on the optimization
> +level."
> +-config=MC3R1.D4.9,macro_argument_context+="skip_to(class(type||expr||decl,any),
> +                                            call(name(__builtin_constant_p)))"
> +-doc_end
> +
> +-doc_begin="Function-like macros defined in public headers are meant to be
> +usable in C89 mode without any extensions. Hence they cannot be replaced by
> +inline functions."
> +-config=MC3R1.D4.9,macros+={deliberate, "loc(file(api:public))"}
> +-doc_end
> +
> +-doc_begin="This header file is autogenerated or empty, therefore it poses no
> +risk if included more than once."
> +-file_tag+={empty_header, "^xen/arch/arm/efi/runtime\\.h$"}
> +-file_tag+={autogen_headers, "^xen/include/xen/compile\\.h$||^xen/include/generated/autoconf.h$||^xen/include/xen/hypercall-defs.h$"}
> +-config=MC3R1.D4.10,reports+={safe, "all_area(all_loc(file(empty_header||autogen_headers)))"}
> +-doc_end
> +
> +-doc_begin="Files that are intended to be included more than once do not need to
> +conform to the directive."
> +-config=MC3R1.D4.10,reports+={safe, "first_area(text(^/\\* This file is legitimately included multiple times\\. \\*/$, begin-4))"}
> +-config=MC3R1.D4.10,reports+={safe, "first_area(text(^/\\* Generated file, do not edit! \\*/$, begin-3))"}
> +-doc_end
> +
> +#
> +# Series 5.
> +#
> +
> +-doc_begin="The project adopted the rule with an exception listed in
> +'docs/misra/rules.rst'"
> +-config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^READ_SYSREG$))&&any_exp(macro(^WRITE_SYSREG$))))"}
> +-config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^max_t$))&&any_exp(macro(^min_t$))))"}
> +-config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^read[bwlq]$))&&any_exp(macro(^read[bwlq]_relaxed$))))"}
> +-config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^per_cpu$))&&any_exp(macro(^this_cpu$))))"}
> +-doc_end
> +
> +-doc_begin="The identifier 'fdt' is a widely-used name, for which no suitable
> +substitute can be found. It is understood in 'xen/arch/arm/efi-boot.h' that the
> +static variable 'fdt' cannot be confused with parameter names of the function
> +declarations that are present in the file."
> +-file_tag+={efi_boot_h, "^xen/arch/arm/efi/efi-boot\\.h$"}
> +-config=MC3R1.R5.3,reports+={deliberate, "any_area(decl(kind(var)&&static_storage()&&^fdt$)&&any_loc(file(efi_boot_h)))"}
> +-doc_end
> +
> +-doc_begin="The identifier 'start' is a widely-used name, for which no suitable
> +substitute can be found. It is understood in 'xen/include/xen/kernel.h' that the
> +extern variable 'start' cannot be confused with omonymous parameter names of the
> +function declarations where that variable is visible."
> +-file_tag+={kernel_h, "^xen/include/xen/kernel\\.h$"}
> +-config=MC3R1.R5.3,reports+={deliberate, "any_area(decl(kind(var)&&linkage(external)&&^start$)&&any_loc(file(kernel_h)))"}
> +-doc_end
> +
> +-doc_begin="Function-like macros cannot be confused with identifiers that are
> +neither functions nor pointers to functions."
> +-config=MC3R1.R5.5,reports={safe,"all_area(decl(node(enum_decl||record_decl||field_decl||param_decl||var_decl)&&!type(canonical(address((node(function||function_no_proto))))))||macro(function_like()))"}
> +-doc_end
> +
> +-doc_begin="The use of these identifiers for both macro names and other entities
> +is deliberate and does not generate developer confusion."
> +-config=MC3R1.R5.5,reports+={safe, "any_area(text(^\\s*/\\*\\s+SAF-[0-9]+-safe\\s+MC3R1\\.R5\\.5.*$, begin-1))"}
> +-doc_end
> +
> +-doc_begin="The definition of macros and functions ending in '_bit' that use the
> +same identifier in 'bitops.h' is deliberate and safe."
> +-file_tag+={bitops_h, "^xen/arch/x86/include/asm/bitops\\.h$"}
> +-config=MC3R1.R5.5,reports+={safe, "all_area((decl(^.*_bit\\(.*$)||macro(^.*_bit$))&&all_loc(file(bitops_h)))"}
> +-doc_end
> +
> +-doc_begin="The definition of macros and functions beginning in 'str' or 'mem'
> +that use the same identifier in 'xen/include/xen/string.h' is deliberate and
> +safe."
> +-file_tag+={string_h, "^xen/include/xen/string\\.h$"}
> +-config=MC3R1.R5.5,reports+={safe, "any_area((decl(^(mem|str).*$)||macro(^(mem|str).*$))&&all_loc(file(string_h)))"}
> +-doc_end
> +
> +#
> +# Series 7.
> +#
> +
> +-doc_begin="Usage of the following constants is safe, since they are given as-is
> +in the inflate algorithm specification and there is therefore no risk of them
> +being interpreted as decimal constants."
> +-config=MC3R1.R7.1,literals={safe, "^0(007|37|070|213|236|300|321|330|331|332|333|334|335|337|371)$"}
> +-doc_end
> +
> +-doc_begin="Violations in files that maintainers have asked to not modify in the
> +context of R7.2."
> +-file_tag+={adopted_r7_2,"^xen/include/xen/libfdt/.*$"}
> +-file_tag+={adopted_r7_2,"^xen/arch/x86/include/asm/x86_64/efibind.h$"}
> +-file_tag+={adopted_r7_2,"^xen/include/efi/efiapi\\.h$"}
> +-file_tag+={adopted_r7_2,"^xen/include/efi/efidef\\.h$"}
> +-file_tag+={adopted_r7_2,"^xen/include/efi/efiprot\\.h$"}
> +-file_tag+={adopted_r7_2,"^xen/arch/x86/cpu/intel\\.c$"}
> +-file_tag+={adopted_r7_2,"^xen/arch/x86/cpu/amd\\.c$"}
> +-file_tag+={adopted_r7_2,"^xen/arch/x86/cpu/common\\.c$"}
> +-config=MC3R1.R7.2,reports+={deliberate,"any_area(any_loc(file(adopted_r7_2)))"}
> +-doc_end
> +
> +-doc_begin="Violations caused by __HYPERVISOR_VIRT_START are related to the
> +particular use of it done in xen_mk_ulong."
> +-config=MC3R1.R7.2,reports+={deliberate,"any_area(any_loc(macro(name(BUILD_BUG_ON))))"}
> +-doc_end
> +
> +-doc_begin="The following string literals are assigned to pointers to non
> +const-qualified char."
> +-config=MC3R1.R7.4,reports+={safe, "any_area(text(^\\s*/\\*\\s+SAF-[0-9]+-safe\\s+MC3R1\\.R7\\.4.*$, begin-1))"}
> +-doc_end
> +
> +-doc_begin="Allow pointers of non-character type as long as the pointee is
> +const-qualified."
> +-config=MC3R1.R7.4,same_pointee=false
> +-doc_end
> +
> +#
> +# Series 8.
> +#
> +
> +-doc_begin="The following variables are compiled in multiple translation units
> +belonging to different executables and therefore are safe."
> +-config=MC3R1.R8.6,declarations+={safe, "name(current_stack_pointer||bsearch||sort)"}
> +-doc_end
> +
> +-doc_begin="Declarations without definitions are allowed (specifically when the
> +definition is compiled-out or optimized-out by the compiler)"
> +-config=MC3R1.R8.6,reports+={deliberate, "first_area(^.*has no definition$)"}
> +-doc_end
> +
> +-doc_begin="The gnu_inline attribute without static is deliberately allowed."
> +-config=MC3R1.R8.10,declarations+={deliberate,"property(gnu_inline)"}
> +-doc_end
> +
> +#
> +# Series 9.
> +#
> +
> +-doc_begin="The following variables are written before being set, therefore no
> +access to uninitialized memory locations happens, as explained in the deviation
> +comment."
> +-config=MC3R1.R9.1,reports+={safe, "any_area(text(^\\s*/\\*\\s+SAF-[0-9]+-safe\\s+MC3R1\\.R9\\.1.*$, begin-1))"}
> +-doc_end
> +
> +-doc_begin="Violations in files that maintainers have asked to not modify in the
> +context of R9.1."
> +-file_tag+={adopted_r9_1,"^xen/arch/arm/arm64/lib/find_next_bit\\.c$"}
> +-config=MC3R1.R9.1,reports+={deliberate,"any_area(any_loc(file(adopted_r9_1)))"}
> +-doc_end
> +
> +-doc_begin="The possibility of committing mistakes by specifying an explicit
> +dimension is higher than omitting the dimension."
> +-config=MC3R1.R9.5,reports+={deliberate, "any()"}
> +-doc_end
> +
> +### Set 2 ###
> +
> +#
> +# Series 10.
> +#
> +
> +-doc_begin="The value-preserving conversions of integer constants are safe"
> +-config=MC3R1.R10.1,etypes={safe,"any()","preserved_integer_constant()"}
> +-config=MC3R1.R10.3,etypes={safe,"any()","preserved_integer_constant()"}
> +-config=MC3R1.R10.4,etypes={safe,"any()","preserved_integer_constant()||sibling(rhs,preserved_integer_constant())"}
> +-doc_end
> +
> +-doc_begin="Shifting non-negative integers to the right is safe."
> +-config=MC3R1.R10.1,etypes+={safe,
> +  "stmt(node(binary_operator)&&operator(shr))",
> +  "src_expr(definitely_in(0..))"}
> +-doc_end
> +
> +-doc_begin="Shifting non-negative integers to the left is safe if the result is
> +still non-negative."
> +-config=MC3R1.R10.1,etypes+={safe,
> +  "stmt(node(binary_operator)&&operator(shl)&&definitely_in(0..))",
> +  "src_expr(definitely_in(0..))"}
> +-doc_end
> +
> +-doc_begin="Bitwise logical operations on non-negative integers are safe."
> +-config=MC3R1.R10.1,etypes+={safe,
> +  "stmt(node(binary_operator)&&operator(and||or||xor))",
> +  "src_expr(definitely_in(0..))"}
> +-doc_end
> +
> +-doc_begin="The implicit conversion to Boolean for logical operator arguments is well known to all Xen developers to be a comparison with 0"
> +-config=MC3R1.R10.1,etypes+={safe, "stmt(operator(logical)||node(conditional_operator||binary_conditional_operator))", "dst_type(ebool||boolean)"}
> +-doc_end
> +
> +### Set 3 ###
> +
> +#
> +# Series 18.
> +#
> +
> +-doc_begin="FIXME: explain why pointer differences involving this macro are safe."
> +-config=MC3R1.R18.2,reports+={safe,"all_area(all_loc(any_exp(macro(^ACPI_PTR_DIFF$))))"}
> +-doc_end
> +
> +-doc_begin="FIXME: explain why pointer differences involving this macro are safe."
> +-config=MC3R1.R18.2,reports+={safe,"all_area(all_loc(any_exp(macro(^page_to_mfn$))))"}
> +-doc_end
> +
> +-doc_begin="FIXME: explain why pointer differences involving this macro are safe."
> +-config=MC3R1.R18.2,reports+={safe,"all_area(all_loc(any_exp(macro(^page_to_pdx$))))"}
> +-doc_end
> +
> +#
> +# Series 20.
> +#
> +
> +-doc_begin="Code violating Rule 20.7 is safe when macro parameters are used: (1)
> +as function arguments; (2) as macro arguments; (3) as array indices; (4) as lhs
> +in assignments."
> +-config=MC3R1.R20.7,expansion_context=
> +{safe, "context(__call_expr_arg_contexts)"},
> +{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(node(array_subscript_expr), subscript)))"},
> +{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(operator(assign), lhs)))"},
> +{safe, "left_right(^[(,\\[]$,^[),\\]]$)"}
> +-doc_end
> +
> +#
> +# Developer confusion
> +#
> +
> +-doc="Selection for reports that are fully contained in adopted code."
> +-report_selector+={adopted_report,"all_area(!kind(culprit||evidence)||all_loc(all_exp(adopted||pseudo)))"}
> +
> +-doc_begin="Adopted code is not meant to be read, reviewed or modified by human
> +programmers:no developers' confusion is not possible. In addition, adopted code
> +is assumed to work as is. Reports that are fully contained in adopted code are
> +hidden/tagged with the 'adopted' tag."
> +-service_selector={developer_confusion_guidelines,"^(MC3R1\\.R2\\.1|MC3R1\\.R2\\.2|MC3R1\\.R2\\.3|MC3R1\\.R2\\.4|MC3R1\\.R2\\.5|MC3R1\\.R2\\.6|MC3R1\\.R2\\.7|MC3R1\\.R4\\.1|MC3R1\\.R5\\.3|MC3R1\\.R5\\.6|MC3R1\\.R5\\.7|MC3R1\\.R5\\.8|MC3R1\\.R5\\.9|MC3R1\\.R7\\.1|MC3R1\\.R7\\.2|MC3R1\\.R7\\.3|MC3R1\\.R8\\.7|MC3R1\\.R8\\.8|MC3R1\\.R8\\.9|MC3R1\\.R8\\.11|MC3R1\\.R8\\.12|MC3R1\\.R8\\.13|MC3R1\\.R9\\.3|MC3R1\\.R9\\.4|MC3R1\\.R9\\.5|MC3R1\\.R10\\.2|MC3R1\\.R10\\.5|MC3R1\\.R10\\.6|MC3R1\\.R10\\.7|MC3R1\\.R10\\.8|MC3R1\\.R11\\.9|MC3R1\\.R12\\.1|MC3R1\\.R12\\.3|MC3R1\\.R12\\.4|MC3R1\\.R13\\.5|MC3R1\\.R14\\.1|MC3R1\\.R14\\.2|MC3R1\\.R14\\.3|MC3R1\\.R15\\.1|MC3R1\\.R15\\.2|MC3R1\\.R15\\.3|MC3R1\\.R15\\.4|MC3R1\\.R15\\.5|MC3R1\\.R15\\.6|MC3R1\\.R15\\.7|MC3R1\\.R16\\.1|MC3R1\\.R16\\.2|MC3R1\\.R16\\.3|MC3R1\\.R16\\.4|MC3R1\\.R16\\.5|MC3R1\\.R16\\.6|MC3R1\\.R16\\.7|MC3R1\\.R17\\.7|MC3R1\\.R17\\.8|MC3R1\\.R18\\.4|MC3R1\\.R18\\.5)$"
> +}
> +-config=developer_confusion_guidelines,reports+={relied,adopted_report}
> +-doc_end
> diff --git a/automation/eclair_analysis/ECLAIR/out_of_scope.ecl b/automation/eclair_analysis/ECLAIR/out_of_scope.ecl
> new file mode 100644
> index 0000000000..44db6997b5
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/out_of_scope.ecl
> @@ -0,0 +1,127 @@
> +-doc_begin="Imported from Linux: ignore for now."
> +-file_tag+={adopted,"^xen/common/libfdt/.*$"}
> +-file_tag+={adopted,"^xen/include/xen/libfdt/.*$"}
> +-file_tag+={adopted,"^xen/common/xz/.*$"}
> +-file_tag+={adopted,"^xen/common/zstd/.*$"}
> +-file_tag+={adopted,"^xen/drivers/acpi/apei/.*$"}
> +-file_tag+={adopted,"^xen/drivers/acpi/tables/.*$"}
> +-file_tag+={adopted,"^xen/drivers/acpi/utilities/.*$"}
> +-file_tag+={adopted,"^xen/drivers/video/font_.*$"}
> +-file_tag+={adopted,"^xen/arch/arm/arm64/cpufeature\\.c$"}
> +-file_tag+={adopted,"^xen/arch/arm/arm64/insn\\.c$"}
> +-file_tag+={adopted,"^xen/arch/arm/arm64/lib/find_next_bit\\.c$"}
> +-file_tag+={adopted,"^xen/common/bitmap\\.c$"}
> +-file_tag+={adopted,"^xen/common/bunzip2\\.c$"}
> +-file_tag+={adopted,"^xen/common/earlycpio\\.c$"}
> +-file_tag+={adopted,"^xen/common/inflate\\.c$"}
> +-file_tag+={adopted,"^xen/common/lzo\\.c$"}
> +-file_tag+={adopted,"^xen/common/lz4/decompress\\.c$"}
> +-file_tag+={adopted,"^xen/common/radix-tree\\.c$"}
> +-file_tag+={adopted,"^xen/common/ubsan/ubsan\\.c$"}
> +-file_tag+={adopted,"^xen/drivers/acpi/hwregs\\.c$"}
> +-file_tag+={adopted,"^xen/drivers/acpi/numa\\.c$"}
> +-file_tag+={adopted,"^xen/drivers/acpi/osl\\.c$"}
> +-file_tag+={adopted,"^xen/drivers/acpi/tables\\.c$"}
> +-file_tag+={adopted,"^xen/lib/list-sort\\.c$"}
> +-file_tag+={adopted,"^xen/lib/rbtree\\.c$"}
> +-file_tag+={adopted,"^xen/lib/xxhash.*\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/acpi/boot\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/acpi/cpu_idle\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/acpi/cpufreq/cpufreq\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/acpi/cpuidle_menu\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/acpi/lib\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/cpu/amd\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/cpu/centaur\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/cpu/common\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/cpu/hygon\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/cpu/intel\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/cpu/intel_cacheinfo\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/cpu/mcheck/non-fatal\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/cpu/mtrr/.*$"}
> +-file_tag+={adopted,"^xen/arch/x86/cpu/mwait-idle\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/delay\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/dmi_scan\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/mpparse\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/srat\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/time\\.c$"}
> +-file_tag+={adopted,"^xen/arch/x86/x86_64/mmconf-fam10h\\.c$"}
> +-doc_end
> +
> +-doc_begin="Intel specific source files are out of scope."
> +-file_tag+={out_of_scope,"^xen/arch/x86/cpu/intel\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/cpu/intel_cacheinfo\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/cpu/microcode/intel\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/cpu/shanghai\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/hvm/vmx/.*$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/include/asm/hvm/vmx/.*$"}
> +-file_tag+={out_of_scope,"^xen/drivers/passthrough/vtd/.*$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/cpu/mcheck/mce_intel\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/cpu/mwait-idle\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/cpu/vpmu_intel\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/tsx\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/mm/altp2m\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/mm/p2m-ept\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/mm/hap/nested_ept\\.c$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/include/asm/altp2m\\.h$"}
> +-file_tag+={out_of_scope,"^xen/arch/x86/include/asm/intel-family\\.h$"}
> +-doc_end
> +
> +-doc_begin="Not in scope initially as it generates many violations and it is not enabled in safety configurations."
> +-file_tag+={adopted,"^xen/xsm/flask/.*$"}
> +-doc_end
> +
> +-doc_begin="unlz4.c implementation by Yann Collet, the others un* are from Linux, ignore for now."
> +-file_tag+={adopted,"^xen/common/un.*\\.c$"}
> +-doc_end
> +
> +-doc_begin="Origin is external and documented in xen/crypto/README.source ."
> +-file_tag+={adopted,"^xen/crypto/.*$"}
> +-doc_end
> +
> +-doc_begin="Files imported from the gnu-efi package"
> +-file_tag+={adopted,"^xen/include/efi/.*$"}
> +-file_tag+={adopted,"^xen/arch/x86/include/asm/x86_64/efibind\\.h$"}
> +-doc_end
> +
> +-doc_begin="Build tools are out of scope."
> +-file_tag+={out_of_scope_tools,"^xen/tools/.*$"}
> +-file_tag+={out_of_scope_tools,"^xen/arch/x86/efi/mkreloc\\.c$"}
> +-file_tag+={out_of_scope_tools,"^xen/arch/x86/boot/mkelf32\\.c$"}
> +-doc_end
> +
> +-doc_begin="Out of scope headers."
> +-file_tag+={out_of_scope,"^xen/include/xen/bitmap\\.h$"}
> +-file_tag+={out_of_scope,"^xen/include/xen/earlycpio\\.h$"}
> +-file_tag+={out_of_scope,"^xen/include/xen/lzo\\.h$"}
> +-file_tag+={out_of_scope,"^xen/include/xen/lz4\\.h$"}
> +-file_tag+={out_of_scope,"^xen/common/lz4/defs\\.h$"}
> +-file_tag+={out_of_scope,"^xen/include/xen/radix-tree\\.h$"}
> +-file_tag+={out_of_scope,"^xen/include/xen/list_sort\\.h$"}
> +-file_tag+={out_of_scope,"^xen/include/xen/rbtree\\.h$"}
> +-file_tag+={out_of_scope,"^xen/include/xen/xxhash\\.h$"}
> +-doc_end
> +
> +-doc_begin="Headers under xen/include/public/ are the description of the public
> +hypercall ABI so the community is extremely conservative in making changes
> +there, because the interface is maintained for backward compatibility: ignore
> +for now."
> +-file_tag+={hypercall_ABI, "^xen/include/public/.*$"}
> +-source_files+={hide, hypercall_ABI}
> +-doc_end
> +
> +-doc_begin="Consider out-of-scope files external to the project."
> +-file_tag+={external, out_of_scope}
> +-doc_end
> +
> +-doc_begin="Consider adopted files external to the project."
> +-file_tag+={external, adopted}
> +-doc_end
> +
> +-doc_begin="Disregard out-of-scope tools."
> +-frames+={hide,"main(out_of_scope_tools)"}
> +-doc_end
> +
> +-doc_begin="The build performs speculative calls with target /dev/null: this
> +frames should be ignored."
> +-frames+={hide,"target(^/dev/null$)"}
> +-doc_end
> diff --git a/automation/eclair_analysis/ECLAIR/print_analyzed_files.sh b/automation/eclair_analysis/ECLAIR/print_analyzed_files.sh
> new file mode 100755
> index 0000000000..c19a8ecbd0
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/print_analyzed_files.sh
> @@ -0,0 +1,66 @@
> +#!/bin/bash
> +# Stop immediately if any executed command has exit status different from 0.
> +set -eu
> +
> +script_name="$(basename "$0")"
> +script_dir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
> +
> +fatal() {
> +  echo "${script_name}: $*" >&2
> +  exit 1
> +}
> +
> +usage() {
> +  fatal "Usage: ${script_name} DATABASE OUT_DIR"
> +}
> +
> +extrapolate_regex() {
> +  lookbehind=$1
> +  file=$2
> +  grep -Po "(?<=${lookbehind}\"\\^).*(?=\\$\")" "${file}" | sed 's/\\\\/\\/'
> +}
> +
> +if [ $# -lt 2 ]; then
> +  usage
> +fi
> +
> +DB=$1
> +OUT_DIR=$2
> +
> +files_txt="${OUT_DIR}/files.txt"
> +files_c_txt="${OUT_DIR}/files_c.txt"
> +files_h_txt="${OUT_DIR}/files_h.txt"
> +exclusions_txt="${OUT_DIR}/exclusions.txt"
> +
> +
> +if [[ ! -d "${OUT_DIR}" ]]; then
> +  mkdir -p "${OUT_DIR}"
> +else
> +  rm -f "${files_txt}"
> +  rm -f "${files_c_txt}"
> +  rm -f "${files_h_txt}"
> +  rm -f "${exclusions_txt}"
> +fi
> +
> +# Generating txt report with files
> +"${ECLAIR_BIN_DIR}eclair_report" -db="${DB}" -files_txt="${files_txt}"
> +
> +{
> +  # Extracting out of scope code
> +  out_of_scope_ecl="${script_dir}/out_of_scope.ecl"
> +  extrapolate_regex adopted,             "${out_of_scope_ecl}"
> +  extrapolate_regex out_of_scope_tools,  "${out_of_scope_ecl}"
> +  extrapolate_regex out_of_scope,        "${out_of_scope_ecl}"
> +  extrapolate_regex hypercall_ABI,       "${out_of_scope_ecl}"
> +  extrapolate_regex "hide, "             "${out_of_scope_ecl}"
> +} >"${exclusions_txt}"
> +sort -o "${exclusions_txt}" -u "${exclusions_txt}"
> +
> +# Removing exclusions from files_txt
> +grep -E -v "(object: |/dev/pipe)" "${files_txt}" > "${files_txt}.tmp"
> +grep -vf "${exclusions_txt}" "${files_txt}.tmp" > "${files_txt}"
> +rm "${files_txt}.tmp"
> +# Creating files with only headers
> +grep -Ev "(xen.*\.(h\w+|[^h]\w*) |.*ecl)" "${files_txt}" > "${files_h_txt}"
> +# Creating files with only c files
> +grep -Ev "(xen.*\.(c\w+|[^c]\w*) |.*ecl)" "${files_txt}" > "${files_c_txt}"
> diff --git a/automation/eclair_analysis/ECLAIR/public_APIs.ecl b/automation/eclair_analysis/ECLAIR/public_APIs.ecl
> new file mode 100644
> index 0000000000..9701a295e6
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/public_APIs.ecl
> @@ -0,0 +1,6 @@
> +# Definition of the public APIs.
> +
> +-doc="All Xen public headers."
> +-file_tag+={api:public,"^xen/include/public/.*\\.h$"}
> +
> +-public_files+=api:public
> diff --git a/automation/eclair_analysis/ECLAIR/report.ecl b/automation/eclair_analysis/ECLAIR/report.ecl
> new file mode 100644
> index 0000000000..6ee324746c
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/report.ecl
> @@ -0,0 +1,4 @@
> +# eclair_report
> +
> +reports_codeclimate("gl-code-quality-report.json")
> +
> diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/eclair_analysis/ECLAIR/tagging.ecl
> new file mode 100644
> index 0000000000..ef2e56e186
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
> @@ -0,0 +1,34 @@
> +-doc="Hide reports marked as compliant."
> +-remap_rtag={compliant,hide}
> +
> +-doc="Hide reports marked as safe."
> +-remap_rtag={safe,hide}
> +
> +-doc="Hide reports marked as relied."
> +-remap_rtag={relied,hide}
> +
> +-doc="Hide reports marked as deliberate."
> +-remap_rtag={deliberate,hide}
> +
> +-doc="Hide reports marked as disapplied."
> +-remap_rtag={disapplied,hide}
> +
> +#######################
> +# Accepted guidelines #
> +#######################
> +
> +-doc="Accepted guidelines as reported in XEN/docs/misra/rules.rst"
> +-service_selector={accepted_guidelines,"^(MC3R1\\.D1\\.1|MC3R1\\.D2\\.1|MC3R1\\.D4\\.3|MC3R1\\.D4\\.7|MC3R1\\.D4\\.10|MC3R1\\.D4\\.11|MC3R1\\.D4\\.14|MC3R1\\.R1\\.1|MC3R1\\.R1\\.3|MC3R1\\.R1\\.4|MC3R1\\.R2\\.1|MC3R1\\.R2\\.6|MC3R1\\.R2\\.2|MC3R1\\.R3\\.1|MC3R1\\.R3\\.2|MC3R1\\.R4\\.1|MC3R1\\.R4\\.2|MC3R1\\.R5\\.1|MC3R1\\.R5\\.2|MC3R1\\.R5\\.3|MC3R1\\.R5\\.4|MC3R1\\.R5\\.6|MC3R1\\.R6\\.1|MC3R1\\.R6\\.2|MC3R1\\.R7\\.1|MC3R1\\.R7\\.2|MC3R1\\.R7\\.3|MC3R1\\.R7\\.4|MC3R1\\.R8\\.1|MC3R1\\.R8\\.2|MC3R1\\.R8\\.3|MC3R1\\.R8\\.4|MC3R1\\.R8\\.5|MC3R1\\.R8\\.6|MC3R1\\.R8\\.8|MC3R1\\.R8\\.10|MC3R1\\.R8\\.12|MC3R1\\.R8\\.14|MC3R1\\.R9\\.1|MC3R1\\.R9\\.2|MC3R1\\.R9\\.3|MC3R1\\.R9\\.4|MC3R1\\.R9\\.5|MC3R1\\.R12\\.5|MC3R1\\.R13\\.6|MC3R1\\.R13\\.1|MC3R1\\.R14\\.1|MC3R1\\.R16\\.7|MC3R1\\.R17\\.3|MC3R1\\.R17\\.4|MC3R1\\.R17\\.6|MC3R1\\.R18\\.3|MC3R1\\.R19\\.1|MC3R1\\.R20\\.7|MC3R1\\.R20\\.13|MC3R1\\.R20\\.14|MC3R1\\.R21\\.13|MC3R1\\.R21\\.17|MC3R1\\.R21\\.18|MC3R1\\.R21\\.19|MC3R1\\.R21\\.20|MC3R1\\
 .R21\\.21|MC3R1\\.R22\\.2|MC3R1\\.R22\\.4|MC3R1\\.R22\\.5|MC3R1\\.R22\\.6)$"
> +}
> +-doc="All reports of accepted guidelines are tagged as accepted."
> +-reports+={status:accepted,"service(accepted_guidelines)"}
> +
> +####################
> +# Clean guidelines #
> +####################
> +
> +-doc_begin="Clean guidelines: new violations for these guidelines are not accepted."
> +-service_selector={clean_guidelines,"^(MC3R1\\.D1\\.1|MC3R1\\.D2\\.1|MC3R1\\.D4\\.11|MC3R1\\.D4\\.14|MC3R1\\.R1\\.4|MC3R1\\.R2\\.2|MC3R1\\.R3\\.2|MC3R1\\.R5\\.1|MC3R1\\.R5\\.2|MC3R1\\.R5\\.4|MC3R1\\.R6\\.1|MC3R1\\.R6\\.2|MC3R1\\.R7\\.1|MC3R1\\.R8\\.1|MC3R1\\.R8\\.5|MC3R1\\.R8\\.8|MC3R1\\.R8\\.10|MC3R1\\.R8\\.12|MC3R1\\.R8\\.14|MC3R1\\.R9\\.2|MC3R1\\.R9\\.4|MC3R1\\.R9\\.5|MC3R1\\.R12\\.5|MC3R1\\.R17\\.3|MC3R1\\.R17\\.6|MC3R1\\.R21\\.13|MC3R1\\.R21\\.19|MC3R1\\.R21\\.21|MC3R1\\.R22\\.2|MC3R1\\.R22\\.4|MC3R1\\.R22\\.5)$"
> +}
> +-reports+={clean:added,"service(clean_guidelines)"}
> +-doc_end
> diff --git a/automation/eclair_analysis/ECLAIR/toolchain.ecl b/automation/eclair_analysis/ECLAIR/toolchain.ecl
> new file mode 100644
> index 0000000000..e6cd289b5e
> --- /dev/null
> +++ b/automation/eclair_analysis/ECLAIR/toolchain.ecl
> @@ -0,0 +1,275 @@
> +# Compilers.
> +-file_tag+={GCC_ARM64,"^/usr/bin/aarch64-linux-gnu-gcc-12$"}
> +-file_tag+={GCC_X86_64,"^/usr/bin/x86_64-linux-gnu-gcc-12$"}
> +
> +# Manuals.
> +-setq=GCC_MANUAL,"https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc.pdf"
> +-setq=CPP_MANUAL,"https://gcc.gnu.org/onlinedocs/gcc-12.1.0/cpp.pdf"
> +-setq=ARM64_ABI_MANUAL,"https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs64/aapcs64.rst"
> +-setq=X86_64_ABI_MANUAL,"https://gitlab.com/x86-psABIs/x86-64-ABI/-/jobs/artifacts/master/raw/x86-64-ABI/abi.pdf?job=build"
> +-setq=ARM64_LIBC_MANUAL,"https://www.gnu.org/software/libc/manual/pdf/libc.pdf"
> +-setq=X86_64_LIBC_MANUAL,"https://www.gnu.org/software/libc/manual/pdf/libc.pdf"
> +-setq=C99_STD,"ISO/IEC 9899:1999"
> +
> +-doc_begin="
> +    _Static_assert: see Section \"2.1 C Language\" of "GCC_MANUAL".
> +    asm, __asm__: see Sections \"6.48 Alternate Keywords\" and \"6.47 How to Use Inline Assembly Language in C Code\" of "GCC_MANUAL".
> +    __volatile__: see Sections \"6.48 Alternate Keywords\" and \"6.47.2.1 Volatile\" of "GCC_MANUAL".
> +    __const__, __inline__, __inline: see Section \"6.48 Alternate Keywords\" of "GCC_MANUAL".
> +    typeof, __typeof__: see Section \"6.7 Referring to a Type with typeof\" of "GCC_MANUAL".
> +    __alignof__, __alignof: see Sections \"6.48 Alternate Keywords\" and \"6.44 Determining the Alignment of Functions, Types or Variables\" of "GCC_MANUAL".
> +    __attribute__: see Section \"6.39 Attribute Syntax\" of "GCC_MANUAL".
> +    __builtin_types_compatible_p: see Section \"6.59 Other Built-in Functions Provided by GCC\" of "GCC_MANUAL".
> +    __builtin_va_arg: non-documented GCC extension.
> +    __builtin_offsetof: see Section \"6.53 Support for offsetof\" of "GCC_MANUAL".
> +"
> +-config=STD.tokenext,behavior+={c99, GCC_ARM64, "^(_Static_assert|asm|__asm__|__volatile__|__const__|__inline__|typeof|__typeof__|__alignof__|__attribute__|__builtin_types_compatible_p|__builtin_va_arg|__builtin_offsetof)$"}
> +-config=STD.tokenext,behavior+={c99, GCC_X86_64, "^(_Static_assert|asm|__asm__|__volatile__|__const__|__inline__|__inline|typeof|__typeof__|__alignof__|__alignof|__attribute__|__builtin_types_compatible_p|__builtin_va_arg|__builtin_offsetof)$"}
> +-doc_end
> +
> +-doc_begin="Non-documented GCC extension."
> +-config=STD.emptinit,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.emptinit,behavior+={c99,GCC_X86_64,specified}
> +#-config=STD.emptinit,behavior+={c18,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="See Section \"6.24 Arithmetic on void- and Function-Pointers\" of "GCC_MANUAL"."
> +-config=STD.vptrarth,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.vptrarth,behavior+={c99,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="See Section \"6.1 Statements and Declarations in Expressions\" of "GCC_MANUAL"."
> +-config=STD.stmtexpr,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.stmtexpr,behavior+={c99,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="See Section \"6.19 Structures with No Members\" of "GCC_MANUAL"."
> +-config=STD.emptrecd,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.emptrecd,behavior+={c99,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="See Section \"6.18 Arrays of Length Zero\" of "GCC_MANUAL"."
> +-config=STD.arayzero,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.arayzero,behavior+={c99,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="See Section \"6.8 Conditionals with Omitted Operands\" of "GCC_MANUAL"."
> +-config=STD.bincondl,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.bincondl,behavior+={c99,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="See Section \"6.30 Case Ranges\" of "GCC_MANUAL"."
> +-config=STD.caseuplw,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.caseuplw,behavior+={c99,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="See Section \"6.63 Unnamed Structure and Union Fields\" of "GCC_MANUAL"."
> +-config=STD.anonfild,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.anonfild,behavior+={c99,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="Non-documented GCC extension."
> +-config=STD.emptdecl,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.emptdecl,behavior+={c99,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="Non-documented GCC extension."
> +-config=STD.emptenum,behavior+={c99,GCC_ARM64,specified}
> +-doc_end
> +
> +-doc_begin="Non-documented GCC extension."
> +-config=STD.pteincmp,behavior+={c99,GCC_ARM64,specified}
> +-config=STD.pteincmp,behavior+={c99,GCC_X86_64,specified}
> +#-config=STD.pteincmp,behavior+={c18,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="Non-documented GCC extension."
> +-config=STD.funojptr,behavior+={c99,GCC_X86_64,specified}
> +-doc_end
> +
> +-doc_begin="
> +    ext_paste_comma: see Section \"6.21 Macros with a Variable Number of Arguments\" of "GCC_MANUAL".
> +    ext_missing_varargs_arg: see Section \"6.21 Macros with a Variable Number of Arguments\" of "GCC_MANUAL".
> +    ext_named_variadic_macro: see Section \"6.21 Macros with a Variable Number of Arguments\" of "GCC_MANUAL".
> +    ext_return_has_void_expr: see the documentation for -Wreturn-type in Section \"3.8 Options to Request or Suppress Warnings\" of "GCC_MANUAL".
> +    ext_gnu_statement_expr_macro: see Section \"6.1 Statements and Declarations in Expressions\" of "GCC_MANUAL".
> +    ext_sizeof_alignof_void_type: see Section \"6.24 Arithmetic on void- and Function-Pointers\" of "GCC_MANUAL".
> +    ext_forward_ref_enum_def: see Section \"6.49 Incomplete enum Types\" of "GCC_MANUAL".
> +    ext_flexible_array_in_struct: see Section \"6.18 Arrays of Length Zero\" of "GCC_MANUAL".
> +    ext_flexible_array_in_array: see Section \"6.18 Arrays of Length Zero\" of "GCC_MANUAL".
> +    ext_enum_value_not_int: non-documented GCC extension.
> +    ext_gnu_array_range: see Section \"6.29 Designated Initializers\" of "GCC_MANUAL".
> +"
> +-config=STD.diag,behavior+={c99,GCC_ARM64,"^(ext_paste_comma|ext_missing_varargs_arg|ext_named_variadic_macro|ext_return_has_void_expr|ext_gnu_statement_expr_macro|ext_sizeof_alignof_void_type|ext_forward_ref_enum_def|ext_gnu_array_range)$"}
> +-config=STD.diag,behavior+={c99,GCC_X86_64,"^(ext_paste_comma|ext_missing_varargs_arg|ext_named_variadic_macro|ext_return_has_void_expr|ext_gnu_statement_expr_macro|ext_sizeof_alignof_void_type|ext_flexible_array_in_struct|ext_flexible_array_in_array|ext_enum_value_not_int|ext_gnu_array_range)$"}
> +-doc_end
> +
> +-doc_begin="The maximum size of an object is defined in the MAX_SIZE macro, and for a 32 bit architecture is 8MB.
> +    The maximum size for an array is defined in the PTRDIFF_MAX and in a 32 bit architecture is 2^30-1.
> +    See occurrences of these macros in "GCC_MANUAL"."
> +-config=STD.byteobjt,behavior+={c99, GCC_ARM64, 8388608}
> +-config=STD.byteobjt,behavior+={c99, GCC_X86_64, 8388608}
> +-doc_end
> +
> +-doc_begin="See Section \"11.2 Implementation limits\" of "CPP_MANUAL"."
> +-config=STD.charline,behavior+={c99, GCC_ARM64, 5000}
> +-config=STD.charline,behavior+={c99, GCC_X86_64, 12000}
> +-doc_end
> +
> +-doc_begin="See Section \"11.2 Implementation limits\" of "CPP_MANUAL"."
> +-config=STD.inclnest,behavior+={c99, GCC_ARM64, 24}
> +-config=STD.inclnest,behavior+={c99, GCC_X86_64, 32}
> +-doc_end
> +
> +-doc_begin="FIXME: why is C90 used?"
> +-config=STD.ppifnest,behavior+={c90, GCC_X86_64, 32}
> +-doc_end
> +
> +-doc_begin="See Section \"4.12 Statements\" of "GCC_MANUAL"."
> +-config=STD.caselimt,behavior+={c99, GCC_X86_64, 1500}
> +-doc_end
> +
> +-doc_begin="See Section \"6.9 128-bit Integers\" of "GCC_MANUAL"."
> +-config=STD.stdtypes,behavior+={c99, GCC_X86_64, "__uint128_t"}
> +-doc_end
> +
> +-doc_begin="FIXME: Non-documented GCC extension?"
> +-config=STD.charescp,behavior={c99, GCC_X86_64, "^m$"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.9 Structures, Unions, Enumerations, and Bit-Fields\" of "GCC_MANUAL"."
> +-config=STD.bitfldtp, +behavior={c99, GCC_ARM64, "unsigned char;unsigned short;unsigned long;unsigned long long"}
> +-config=STD.bitfldtp, +behavior={c99, GCC_X86_64, "unsigned char;unsigned short;unsigned long;enum"}
> +-doc_end
> +
> +-doc_begin="
> +    #pragma pack: see Section \"6.62.11 Structure-Layout Pragmas\" of "GCC_MANUAL".
> +    #pragma GCC visibility: see Section \"6.62.14 Visibility Pragmas\" of "GCC_MANUAL".
> +"
> +-config=STD.nonstdc,behavior={c99, GCC_ARM64, "^(pack\\(|GCC visibility (push|pop)).*$"}
> +-config=STD.nonstdc,behavior={c99, GCC_X86_64, "^(pack\\(|GCC visibility (push|pop)).*$"}
> +-doc_end
> +
> +-doc_begin="See Section \"1.1 Character sets\" of "CPP_MANUAL".  We assume the locale is not restricting any UTF-8 characters being part of the source character set."
> +-config=STD.charset,behavior={c99, GCC_ARM64, "utf8"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.3 Identifiers\" of "GCC_MANUAL"."
> +-config=STD.extidsig, behavior+={c99, GCC_ARM64, "63"}
> +-config=STD.extidsig, behavior+={c99, GCC_X86_64, "63"}
> +-doc_end
> +
> +#
> +# Documentation for relied-upon implementation-defined behaviors (Dir 1.1)
> +#
> +
> +-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \"8.1 Data types\" of "ARM64_ABI_MANUAL"."
> +-config=STD.bytebits,behavior={c99, GCC_ARM64, "8"}
> +-config=STD.charsobj,behavior={c99, GCC_ARM64, "utf8"}
> +-config=STD.charsval,behavior={c99, GCC_ARM64, "utf8"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
> +-config=STD.bytebits,behavior={c99, GCC_X86_64, "8"}
> +-config=STD.charsobj,behavior={c99, GCC_X86_64, "utf8"}
> +-config=STD.charsval,behavior={c99, GCC_X86_64, "utf8"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and the documentation for -finput-charset=charset in the same manual."
> +-config=STD.charsmap,behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.charsmap,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and the documentation for -fexec-charset=charset and -finput-charset=charset in the same manual."
> +-config=STD.charsmem,behavior={c99, GCC_ARM64, "utf8"}
> +-config=STD.charsmem,behavior={c99, GCC_X86_64, "utf8"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.1 Translation\" of "GCC_MANUAL"."
> +-config=STD.diagidnt,behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.diagidnt,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and the documentation for -fexec-charset=charset in the same manual."
> +-config=STD.execvals,behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.execvals,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="Given that Xen is compiled in hosted mode, ECLAIR cannot exclude the independency from program termination implementation-defined behavior.  See \"Section 25.7 Program Termination\" of "ARM64_LIBC_MANUAL"."
> +-config=STD.exitstat,behavior={c99, GCC_ARM64, "specified"}
> +-doc_end
> +
> +-doc_begin="Given that Xen is compiled in hosted mode, ECLAIR cannot exclude the independency from program termination implementation-defined behavior.  See \"Section 25.7 Program Termination\" of "X86_64_LIBC_MANUAL"."
> +-config=STD.exitstat,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Chapter \"2 Header Files\" of "CPP_MANUAL"."
> +-config=STD.inclangl,behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.inclangl,behavior={c99, GCC_X86_64, "specified"}
> +-config=STD.inclfile,behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.inclfile,behavior={c99, GCC_X86_64, "specified"}
> +-config=STD.inclhead,behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.inclhead,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.5 Integers\" of "GCC_MANUAL"."
> +-config=STD.signdint,behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.signdint,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.15 Architecture\" of "GCC_MANUAL" and Chapter \"5   Data types and alignment\" of "ARM64_ABI_MANUAL"."
> +-config=STD.objbytes,behavior={c99, GCC_ARM64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.15 Architecture\" of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
> +-config=STD.objbytes,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"3.4 Stringizing\" of "CPP_MANUAL"."
> +-config=STD.stringfy,behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.stringfy,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.9 Structures, Unions, Enumerations, and Bit-Fields\"
> + of "GCC_MANUAL" and Section \"8.1.8 Bit-fields\" of "ARM64_ABI_MANUAL"."
> +-config=STD.bitfldby,+behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.bitfldor,+behavior={c99, GCC_ARM64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.9 Structures, Unions, Enumerations, and Bit-Fields\"
> + of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
> +-config=STD.bitfldby,+behavior={c99, GCC_X86_64, "specified"}
> +-config=STD.bitfldor,+behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.10 Qualifiers\" of "GCC_MANUAL"."
> +-config=STD.volatltp,+behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.volatltp,+behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.15 Architecture\" of "GCC_MANUAL" and Chapter \"5   Data types and alignment\" of "ARM64_ABI_MANUAL"."
> +-config=STD.stdmacro,behavior={c99, GCC_ARM64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.15 Architecture\" of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
> +-config=STD.stdmacro,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \"11.1 Implementation-defined behavior\" of "CPP_MANUAL"."
> +-config=STD.widestng,behavior={c99, GCC_ARM64, "specified"}
> +-config=STD.widestng,behavior={c99, GCC_X86_64, "specified"}
> +-config=STD.multbtsl,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.13 Preprocessing Directives\" of "GCC_MANUAL" and Section \"7 Pragmas\" of "CPP_MANUAL"."
> +-config=STD.pragmdir,behavior={c99, GCC_ARM64, "^(pack\\(|GCC visibility (push|pop)).*$"}
> +-config=STD.pragmdir,behavior={c99, GCC_X86_64, "^(pack\\(|GCC visibility (push|pop)).*$"}
> +-doc_end
> +
> +-doc_begin="See Section \"6.9 128-bit Integers\" of "GCC_MANUAL"."
> +-config=STD.extinttp,behavior={c99, GCC_X86_64, "__uint128_t"}
> +-doc_end
> +
> +-doc_begin="See Section \"4.13 Preprocessing Directives\" of "GCC_MANUAL" and Section \"11.1 Implementation-defined behavior\" of "CPP_MANUAL"."
> +-config=STD.inclexpd,behavior={c99, GCC_X86_64, "specified"}
> +-doc_end
> -- 
> 2.34.1
> 
--8323329-957209064-1690315409=:3118466--


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 20:04:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 20:04:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569914.891103 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOOGI-0007vg-Dc; Tue, 25 Jul 2023 20:04:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569914.891103; Tue, 25 Jul 2023 20:04:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOOGI-0007vZ-8i; Tue, 25 Jul 2023 20:04:02 +0000
Received: by outflank-mailman (input) for mailman id 569914;
 Tue, 25 Jul 2023 20:04:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ITxH=DL=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qOOGG-0007un-Fh
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 20:04:00 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6381d33f-2b26-11ee-b240-6b7b168915f2;
 Tue, 25 Jul 2023 22:03:58 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 0042F618BF;
 Tue, 25 Jul 2023 20:03:55 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E902C433C8;
 Tue, 25 Jul 2023 20:03:53 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6381d33f-2b26-11ee-b240-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690315434;
	bh=MzWzGRJivhRCcOXKFZ9+FWvezZzk8r0YsmFhI005yyM=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=rq/lMFfDg/g7E5mxu15Mc5NzFFsEDboZOQ38N4vxTsqoqhP5P6kXFyCYhCDpXAlQM
	 ABzt7dVLvTkRDgXJhICKJ4FCIcCC5SjWe9d+3ZzduUM/TUvy50qF2ZiBTHismgB+eo
	 KtsZ7mHwmlERk65srxYUrrym+YizF0F2elhSLO11jAjQlvuTiOYoG4SRAtgFqmHGqa
	 mQ9JYyEA2yvfD9yZvL2ZJXSWEmrIJkSd/U3b5eGRY0dcjXO0W23JjTDbCI1vjORrDU
	 HbcBOI0DhchkRmcB0iKuIZnhXBRfmg1KoT39zZdY9W8t0W19+KwoucwA8Whng7pEKB
	 DtKwN0VBwMM9w==
Date: Tue, 25 Jul 2023 13:03:51 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Doug Goldstein <cardoe@cardoe.com>, 
    Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [XEN PATCH 2/4] automation: Add xen builds for the ECLAIR
 analyses
In-Reply-To: <256dd32f1496400c7fc8554aa03db417e729c741.1690294965.git.simone.ballarin@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307251256420.3118466@ubuntu-linux-20-04-desktop>
References: <cover.1690294965.git.simone.ballarin@bugseng.com> <256dd32f1496400c7fc8554aa03db417e729c741.1690294965.git.simone.ballarin@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 25 Jul 2023, Simone Ballarin wrote:
> This patch defines an ARM64 and a X86_64 build for the
> ECLAIR pipelines.
> 
> These files are used by the analyze.sh script in
> automation/eclair_analysis: it initially calls prepare.sh,
> then runs into an ECLAIR environment build.sh.
> 
> Only the toolchain invocations triggered by build.sh
> are analyzed; the prepare.sh script is instead intended
> to perform all the required operations for building xen
> that are not supposed to be analyzed: e.g. dependencies
> build.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> --
> Changes in v3:
> - split build definitions in a separate patch.
> 
> Changes in v2:
> - add ECLAIR configuration files (before they were fetched from a separate
>   repository);
> - now the pipeline fails if there are new violations of guidelines tagged
>   with clean:added.
> ---
>  automation/eclair_analysis/Makefile.prepare |   6 +
>  automation/eclair_analysis/build.sh         |  44 ++++++
>  automation/eclair_analysis/prepare.sh       |  42 ++++++
>  automation/eclair_analysis/xen_arm_config   | 147 +++++++++++++++++++
>  automation/eclair_analysis/xen_x86_config   | 152 ++++++++++++++++++++
>  5 files changed, 391 insertions(+)
>  create mode 100644 automation/eclair_analysis/Makefile.prepare
>  create mode 100755 automation/eclair_analysis/build.sh
>  create mode 100755 automation/eclair_analysis/prepare.sh
>  create mode 100644 automation/eclair_analysis/xen_arm_config
>  create mode 100644 automation/eclair_analysis/xen_x86_config
> 
> diff --git a/automation/eclair_analysis/Makefile.prepare b/automation/eclair_analysis/Makefile.prepare
> new file mode 100644
> index 0000000000..90f4a31172
> --- /dev/null
> +++ b/automation/eclair_analysis/Makefile.prepare
> @@ -0,0 +1,6 @@
> +include Makefile
> +prepare:
> +	$(Q)$(MAKE) $(build)=tools
> +	$(Q)$(MAKE) $(build)=. include/xen/compile.h
> +	$(Q)$(MAKE) $(build)=include all
> +	$(Q)$(MAKE) $(build)=arch/$(SRCARCH) include
> diff --git a/automation/eclair_analysis/build.sh b/automation/eclair_analysis/build.sh
> new file mode 100755
> index 0000000000..ec087dd822
> --- /dev/null
> +++ b/automation/eclair_analysis/build.sh
> @@ -0,0 +1,44 @@
> +#!/bin/bash
> +# Stop immediately if any executed command has exit status different from 0.
> +set -e
> +
> +script_name="$(basename "$0")"
> +
> +fatal() {
> +  echo "${script_name}: $*" >&2
> +  exit 1
> +}
> +
> +usage() {
> +  fatal "Usage: ${script_name} <ARM64|X86_64>"
> +}
> +
> +if [ $# -ne 1 ]; then
> +  usage
> +fi
> +
> +if [ "$1" = "X86_64" ]; then
> +  export CROSS_COMPILE=
> +  export XEN_TARGET_ARCH=x86_64
> +elif [ "$1" = "ARM64" ]; then
> +  export CROSS_COMPILE=aarch64-linux-gnu-
> +  export XEN_TARGET_ARCH=arm64
> +else
> +  fatal "Unknown configuration: $1"
> +fi
> +
> +if [[ -f /proc/cpuinfo ]]; then
> +  PROCESSORS=$(grep -c ^processor /proc/cpuinfo)
> +else
> +  PROCESSORS=6
> +fi
> +
> +(
> +  cd xen
> +
> +  make "-j${PROCESSORS}" "-l${PROCESSORS}.0"    \
> +       "CROSS_COMPILE=${CROSS_COMPILE}"         \
> +       "CC=${CROSS_COMPILE}gcc-12"              \
> +       "CXX=${CROSS_COMPILE}g++-12"             \
> +       "XEN_TARGET_ARCH=${XEN_TARGET_ARCH}"
> +)
> diff --git a/automation/eclair_analysis/prepare.sh b/automation/eclair_analysis/prepare.sh
> new file mode 100755
> index 0000000000..275a1a3f51
> --- /dev/null
> +++ b/automation/eclair_analysis/prepare.sh
> @@ -0,0 +1,42 @@
> +#!/bin/bash
> +# Stop immediately if any executed command has exit status different from 0.
> +set -e
> +
> +script_name="$(basename "$0")"
> +script_dir="$(
> +  cd "$(dirname "$0")"
> +  echo "${PWD}"
> +)"
> +
> +fatal() {
> +  echo "${script_name}: $*" >&2
> +  exit 1
> +}
> +
> +usage() {
> +  fatal "Usage: ${script_name}"
> +}
> +
> +if [ $# -ne 1 ]; then
> +  usage
> +  exit 1
> +fi
> +
> +export XEN_TARGET_ARCH
> +
> +if [ "$1" = "X86_64" ]; then
> +  CONFIG_FILE="${script_dir}/xen_x86_config"
> +  XEN_TARGET_ARCH=x86_64
> +elif [ "$1" = "ARM64" ]; then
> +  CONFIG_FILE="${script_dir}/xen_arm_config"
> +  XEN_TARGET_ARCH=arm64
> +else
> +  fatal "Unknown configuration: $1"
> +fi
> +
> +(
> +    cd xen
> +    cp "${CONFIG_FILE}" .config
> +    make clean
> +    make -f ${script_dir}/Makefile.prepare prepare
> +)
> diff --git a/automation/eclair_analysis/xen_arm_config b/automation/eclair_analysis/xen_arm_config
> new file mode 100644
> index 0000000000..82102b889e
> --- /dev/null
> +++ b/automation/eclair_analysis/xen_arm_config
> @@ -0,0 +1,147 @@
> +# File provided in
> +# Re: Xen MISRA C: Source files in scope and out of scope
> +# from:	Stefano Stabellini <stefano.stabellini@amd.com>
> +# date:	6 giu 2023, 02:53
> +
> +#
> +# Automatically generated file; DO NOT EDIT.
> +# Xen/arm 4.18-unstable Configuration
> +#
> +CONFIG_CC_IS_GCC=y
> +CONFIG_GCC_VERSION=90400
> +CONFIG_CLANG_VERSION=0
> +CONFIG_LD_IS_GNU=y
> +CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE=y
> +CONFIG_ARM_64=y
> +CONFIG_ARM=y
> +CONFIG_ARCH_DEFCONFIG="arch/arm/configs/arm64_defconfig"
> +
> +# UBSAN
> +CONFIG_UBSAN=n
> +
> +#
> +# Architecture Features
> +#
> +CONFIG_ARM64_SVE=n
> +CONFIG_64BIT=y
> +CONFIG_NR_CPUS=4
> +# CONFIG_ACPI is not set
> +CONFIG_ARM_EFI=y
> +CONFIG_GICV3=y
> +CONFIG_HAS_ITS=y
> +CONFIG_HVM=y
> +# CONFIG_NEW_VGIC is not set
> +CONFIG_SBSA_VUART_CONSOLE=y
> +CONFIG_ARM_SSBD=y
> +CONFIG_HARDEN_BRANCH_PREDICTOR=y
> +# CONFIG_TEE is not set
> +# CONFIG_STATIC_SHM is not set
> +# end of Architecture Features
> +
> +#
> +# ARM errata workaround via the alternative framework
> +#
> +CONFIG_ARM64_ERRATUM_827319=y
> +CONFIG_ARM64_ERRATUM_824069=y
> +CONFIG_ARM64_ERRATUM_819472=y
> +CONFIG_ARM64_ERRATUM_843419=y
> +CONFIG_ARM64_ERRATUM_832075=y
> +CONFIG_ARM64_ERRATUM_834220=y
> +CONFIG_ARM_ERRATUM_858921=y
> +CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y
> +CONFIG_ARM64_ERRATUM_1286807=y
> +# end of ARM errata workaround via the alternative framework
> +
> +CONFIG_ARM64_HARDEN_BRANCH_PREDICTOR=y
> +# CONFIG_ALL_PLAT is not set
> +# CONFIG_QEMU is not set
> +# CONFIG_RCAR3 is not set
> +CONFIG_MPSOC=y
> +# CONFIG_NO_PLAT is not set
> +CONFIG_MPSOC_PLATFORM=y
> +
> +#
> +# Common Features
> +#
> +CONFIG_GRANT_TABLE=y
> +CONFIG_HAS_ALTERNATIVE=y
> +CONFIG_HAS_DEVICE_TREE=y
> +CONFIG_HAS_FAST_MULTIPLY=y
> +CONFIG_HAS_PDX=y
> +CONFIG_HAS_PMAP=y
> +# CONFIG_MEM_ACCESS is not set
> +CONFIG_STATIC_MEMORY=y
> +
> +#
> +# Speculative hardening
> +#
> +CONFIG_SPECULATIVE_HARDEN_ARRAY=y
> +# end of Speculative hardening
> +
> +# CONFIG_HYPFS is not set
> +CONFIG_IOREQ_SERVER=y
> +# CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP is not set
> +# CONFIG_XSM is not set
> +# CONFIG_ARGO is not set
> +
> +#
> +# Schedulers
> +#
> +# CONFIG_SCHED_CREDIT is not set
> +CONFIG_SCHED_CREDIT2=y
> +# CONFIG_SCHED_RTDS is not set
> +# CONFIG_SCHED_ARINC653 is not set
> +CONFIG_SCHED_NULL=y
> +CONFIG_SCHED_CREDIT2_DEFAULT=y
> +# CONFIG_SCHED_NULL_DEFAULT is not set
> +CONFIG_SCHED_DEFAULT="credit2"
> +# end of Schedulers
> +
> +CONFIG_BOOT_TIME_CPUPOOLS=y
> +# CONFIG_LIVEPATCH is not set
> +# CONFIG_ENFORCE_UNIQUE_SYMBOLS is not set
> +CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS=y
> +CONFIG_CMDLINE=""
> +CONFIG_DOM0_MEM=""
> +CONFIG_DTB_FILE=""
> +# CONFIG_TRACEBUFFER is not set
> +# end of Common Features
> +
> +#
> +# Device Drivers
> +#
> +# CONFIG_HAS_NS16550 is not set
> +CONFIG_HAS_CADENCE_UART=y
> +# CONFIG_HAS_IMX_LPUART is not set
> +# CONFIG_HAS_MVEBU is not set
> +# CONFIG_HAS_MESON is not set
> +CONFIG_HAS_PL011=y
> +# CONFIG_HAS_SCIF is not set
> +CONFIG_SERIAL_TX_BUFSIZE=16384
> +CONFIG_HAS_PASSTHROUGH=y
> +CONFIG_ARM_SMMU=y
> +CONFIG_ARM_SMMU_V3=y
> +# CONFIG_IPMMU_VMSA is not set
> +CONFIG_IOMMU_FORCE_PT_SHARE=y
> +# end of Device Drivers
> +
> +CONFIG_EXPERT=y
> +CONFIG_UNSUPPORTED=y
> +
> +#
> +# Debugging Options
> +#
> +CONFIG_DEBUG=y
> +CONFIG_FRAME_POINTER=y
> +CONFIG_COVERAGE=y
> +CONFIG_DEBUG_LOCK_PROFILE=y
> +CONFIG_DEBUG_LOCKS=y
> +CONFIG_PERF_COUNTERS=y
> +CONFIG_PERF_ARRAYS=y
> +CONFIG_VERBOSE_DEBUG=y
> +CONFIG_DEVICE_TREE_DEBUG=y
> +CONFIG_SCRUB_DEBUG=y
> +CONFIG_DEBUG_TRACE=y
> +CONFIG_XMEM_POOL_POISON=y
> +CONFIG_DEBUG_INFO=y
> +# end of Debugging Options
> diff --git a/automation/eclair_analysis/xen_x86_config b/automation/eclair_analysis/xen_x86_config
> new file mode 100644
> index 0000000000..9b2709bfc8
> --- /dev/null
> +++ b/automation/eclair_analysis/xen_x86_config
> @@ -0,0 +1,152 @@
> +# File provided in
> +# Re: Xen MISRA C: Source files in scope and out of scope
> +# from:	Stefano Stabellini <stefano.stabellini@amd.com> 
> +# date:	6 giu 2023, 02:53
> +
> +#
> +# Automatically generated file; DO NOT EDIT.
> +# Xen/x86 4.18-unstable Configuration
> +#
> +CONFIG_CC_IS_GCC=y
> +CONFIG_GCC_VERSION=90400
> +CONFIG_CLANG_VERSION=0
> +CONFIG_LD_IS_GNU=y
> +CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE=y
> +CONFIG_X86_64=y
> +CONFIG_X86=y
> +CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
> +CONFIG_CC_HAS_INDIRECT_THUNK=y
> +CONFIG_HAS_AS_CET_SS=y
> +CONFIG_HAS_CC_CET_IBT=y
> +
> +CONFIG_REQUIRE_NX=n
> +
> +#
> +# Architecture Features
> +#
> +CONFIG_64BIT=y
> +CONFIG_NR_CPUS=16
> +CONFIG_NR_NUMA_NODES=2
> +# CONFIG_PV is not set
> +CONFIG_HVM=y
> +# CONFIG_XEN_SHSTK is not set
> +# CONFIG_XEN_IBT is not set
> +# CONFIG_SHADOW_PAGING is not set
> +# CONFIG_BIGMEM is not set
> +# CONFIG_HVM_FEP is not set
> +# CONFIG_TBOOT is not set
> +CONFIG_XEN_ALIGN_DEFAULT=y
> +# CONFIG_XEN_ALIGN_2M is not set
> +CONFIG_X2APIC_PHYSICAL=y
> +# CONFIG_XEN_GUEST is not set
> +# CONFIG_HYPERV_GUEST is not set
> +# CONFIG_MEM_PAGING is not set
> +# CONFIG_MEM_SHARING is not set
> +# end of Architecture Features
> +
> +#
> +# Common Features
> +#
> +CONFIG_COMPAT=y
> +CONFIG_CORE_PARKING=y
> +CONFIG_GRANT_TABLE=y
> +CONFIG_ALTERNATIVE_CALL=y
> +CONFIG_ARCH_MAP_DOMAIN_PAGE=y
> +CONFIG_GENERIC_BUG_FRAME=y
> +CONFIG_HAS_ALTERNATIVE=y
> +CONFIG_HAS_COMPAT=y
> +CONFIG_HAS_EX_TABLE=y
> +CONFIG_HAS_FAST_MULTIPLY=y
> +CONFIG_HAS_IOPORTS=y
> +CONFIG_HAS_KEXEC=y
> +CONFIG_HAS_PDX=y
> +CONFIG_HAS_SCHED_GRANULARITY=y
> +CONFIG_HAS_UBSAN=y
> +CONFIG_MEM_ACCESS_ALWAYS_ON=y
> +CONFIG_MEM_ACCESS=y
> +CONFIG_NEEDS_LIBELF=y
> +CONFIG_NUMA=y
> +
> +#
> +# Speculative hardening
> +#
> +CONFIG_INDIRECT_THUNK=y
> +CONFIG_SPECULATIVE_HARDEN_ARRAY=y
> +CONFIG_SPECULATIVE_HARDEN_BRANCH=y
> +# end of Speculative hardening
> +
> +# CONFIG_HYPFS is not set
> +CONFIG_IOREQ_SERVER=y
> +# CONFIG_KEXEC is not set
> +# CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP is not set
> +# CONFIG_XENOPROF is not set
> +# CONFIG_XSM is not set
> +# CONFIG_ARGO is not set
> +
> +#
> +# Schedulers
> +#
> +# CONFIG_SCHED_CREDIT is not set
> +CONFIG_SCHED_CREDIT2=y
> +# CONFIG_SCHED_RTDS is not set
> +# CONFIG_SCHED_ARINC653 is not set
> +CONFIG_SCHED_NULL=y
> +CONFIG_SCHED_CREDIT2_DEFAULT=y
> +# CONFIG_SCHED_NULL_DEFAULT is not set
> +CONFIG_SCHED_DEFAULT="credit2"
> +# end of Schedulers
> +
> +# CONFIG_LIVEPATCH is not set
> +# CONFIG_ENFORCE_UNIQUE_SYMBOLS is not set
> +# CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS is not set
> +CONFIG_CMDLINE=""
> +CONFIG_DOM0_MEM=""
> +# CONFIG_TRACEBUFFER is not set
> +# end of Common Features
> +
> +#
> +# Device Drivers
> +#
> +CONFIG_ACPI=y
> +CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y
> +CONFIG_ACPI_NUMA=y
> +CONFIG_HAS_NS16550=y
> +CONFIG_HAS_EHCI=y
> +CONFIG_SERIAL_TX_BUFSIZE=16384
> +# CONFIG_XHCI is not set
> +CONFIG_HAS_CPUFREQ=y
> +CONFIG_HAS_PASSTHROUGH=y
> +CONFIG_AMD_IOMMU=y
> +# CONFIG_INTEL_IOMMU is not set
> +# CONFIG_IOMMU_QUARANTINE_NONE is not set
> +CONFIG_IOMMU_QUARANTINE_BASIC=y
> +# CONFIG_IOMMU_QUARANTINE_SCRATCH_PAGE is not set
> +CONFIG_HAS_PCI=y
> +CONFIG_HAS_PCI_MSI=y
> +CONFIG_VIDEO=y
> +CONFIG_VGA=y
> +CONFIG_HAS_VPCI=y
> +# end of Device Drivers
> +
> +CONFIG_EXPERT=y
> +CONFIG_UNSUPPORTED=y
> +CONFIG_ARCH_SUPPORTS_INT128=y
> +
> +#
> +# Debugging Options
> +#
> +CONFIG_DEBUG=y
> +# CONFIG_CRASH_DEBUG is not set
> +CONFIG_GDBSX=y
> +CONFIG_FRAME_POINTER=y
> +# CONFIG_COVERAGE is not set
> +# CONFIG_DEBUG_LOCK_PROFILE is not set
> +CONFIG_DEBUG_LOCKS=y
> +# CONFIG_PERF_COUNTERS is not set
> +CONFIG_VERBOSE_DEBUG=y
> +CONFIG_SCRUB_DEBUG=y
> +# CONFIG_UBSAN is not set
> +# CONFIG_DEBUG_TRACE is not set
> +CONFIG_XMEM_POOL_POISON=y
> +CONFIG_DEBUG_INFO=y
> +# end of Debugging Options
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 20:04:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 20:04:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569917.891112 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOOGU-0008JR-L2; Tue, 25 Jul 2023 20:04:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569917.891112; Tue, 25 Jul 2023 20:04:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOOGU-0008JK-Hk; Tue, 25 Jul 2023 20:04:14 +0000
Received: by outflank-mailman (input) for mailman id 569917;
 Tue, 25 Jul 2023 20:04:14 +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
 <SRS0=ITxH=DL=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qOOGU-0007eJ-4Q
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 20:04:14 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6b414cfa-2b26-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 22:04:12 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 0D51B618C8;
 Tue, 25 Jul 2023 20:04:10 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5D79C433C7;
 Tue, 25 Jul 2023 20:04:08 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6b414cfa-2b26-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690315449;
	bh=r7943TNMVTwSC/B1IcUyjTt6hjhXpZgyfnjfNW39iTg=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=BvF4xksihg2woe3slUinRA9hWccA5u+qETcT4gDz/TvD1Fe5ISKqL/vc3TTXebE+9
	 L8/nL6qfc8bYXeU3kMMVBDqMn0XiUsFaV/h6fEc6UiE0UjRp72rO5mP4nMnaxFgyqq
	 8cKj/x/kOun2A8uDLZCc5MIDM7JhyAuTQzkO9MQvM3LU4RzrjJKix9QLWmbYea2Emp
	 8Z3x0S/heaKF3tBzvrSGIaed3mDlsU6WyT4Hux+OY4mQrIMNf0U6r42I5f2rEQmYux
	 W1cjFGrgB97jIg3qolfyKpEGpqXjw0Ovb/TkTnrPj+3pxap5C5Hek430Ys/JCUVpmr
	 lgE8cRfHg6Pxw==
Date: Tue, 25 Jul 2023 13:04:05 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Doug Goldstein <cardoe@cardoe.com>, 
    Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [XEN PATCH 3/4] automation: Add ECLAIR pipelines
In-Reply-To: <5e0b4afa229e29914392ffee736129f5ec2462cd.1690294965.git.simone.ballarin@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307251247360.3118466@ubuntu-linux-20-04-desktop>
References: <cover.1690294965.git.simone.ballarin@bugseng.com> <5e0b4afa229e29914392ffee736129f5ec2462cd.1690294965.git.simone.ballarin@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 25 Jul 2023, Simone Ballarin wrote:
> Add two pipelines that analyze an ARM64 and a X86_64 build with the
> ECLAIR static analyzer on the guidelines contained in Set1.
> 
> The analysis configuration is stored in automation/eclair_analysis.
> 
> All commits on the xen-project/xen:staging branch will be analyzed
> and their artifacts will be stored indefinitely; the integration will
> report differential information with respect to the previous analysis.
> 
> All commits on other branches or repositories will be analyzed and
> only the last ten artifacts will be kept; the integration will report
> differential information with respect to the analysis done on the common
> ancestor with xen-project/xen:staging (if available).
> 
> Currently the pipeline variable ENABLE_ECLAIR_BOT is set to "n".
> Doing so disables the generation of comments with the analysis summary
> on the commit threads. The variable can be set to "y" if the a masked
> variable named ECLAIR_BOT_TOKEN is set with the impersonation token of
> an account with enough privileges to write on all repositories.
> 
> Additionaly any repository should be able to read a masked variable
> named WTOKEN with the token provided by BUGSENG.
> 
> The analysis fails if it contains violations of guidelines tagged as
> clean:added. The list of clean guidelines are maintained in
> automation/eclair_analysis/ECLAIR/tagging.ecl.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

This patch looks good to me, just one question before I give my
acked-by.


> --
> Changes in v3:
> - split definitions of the ECLAIR pipelines in a separate patch;
> - if the WTOKEN variable is missing now the analysis fails immediately.
> 
> Changes in v2:
> - add ECLAIR configuration files (before they were fetched from a separate
>     repository);
> - now the pipeline fails if there are new violations of guidelines tagged
>     with clean:added.
> ---
>  .gitlab-ci.yml                    |  2 ++
>  automation/gitlab-ci/analyze.yaml | 38 +++++++++++++++++++++++++++++++
>  automation/gitlab-ci/build.yaml   |  1 +
>  automation/scripts/eclair         | 34 +++++++++++++++++++++++++++
>  4 files changed, 75 insertions(+)
>  create mode 100644 automation/gitlab-ci/analyze.yaml
>  create mode 100755 automation/scripts/eclair
> 
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index c8bd7519d5..ee5430b8b7 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -1,7 +1,9 @@
>  stages:
> +  - analyze
>    - build
>    - test
>  
>  include:
> +  - 'automation/gitlab-ci/analyze.yaml'
>    - 'automation/gitlab-ci/build.yaml'
>    - 'automation/gitlab-ci/test.yaml'
> diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
> new file mode 100644
> index 0000000000..3d8166572b
> --- /dev/null
> +++ b/automation/gitlab-ci/analyze.yaml
> @@ -0,0 +1,38 @@
> +.eclair-analysis:
> +  stage: analyze
> +  tags:
> +    - eclair-analysis
> +  variables:
> +    ECLAIR_OUTPUT_DIR: "ECLAIR_out"
> +    ANALYSIS_KIND: "normal"
> +    ENABLE_ECLAIR_BOT: "n"
> +    AUTO_PR_BRANCH: "staging"
> +    AUTO_PR_REPOSITORY: "xen-project/xen"
> +  artifacts:
> +    when: always
> +    paths:
> +      - "${ECLAIR_OUTPUT_DIR}/*.log"
> +      - "${ECLAIR_OUTPUT_DIR}/*.txt"
> +      - '*.log'
> +    reports:
> +      codequality: gl-code-quality-report.json

How do I access "gl-code-quality-report.json" or otherwise any other
meaningful ECLAIR output? If I browse the job artifacts I see all the
various logs but no gl-code-quality-report.json.

Scrolling up from the bottom of the job console output I see:

Browse analysis: https://saas.eclairit.com:3787/fs/var/local/eclair/xen-project.ecdf/xen-project/people/sstabellini/xen/ECLAIR_normal/ppp2/ARM64/4732041018/index.html

And if I click on the link, I can access a web interface with the
results. Is that the intended way to access the job output?

If so, would it be possible to print out the message "Browse
analysis:..." as the very last message to make it easier to spot? After
it at the moment I can see:

>From https://gitlab.com:443/xen-project/xen
 * [new branch]            4.10.0-shim-comet   -> autoPRRemote/4.10.0-shim-comet
 [...]

The long list of branch names hides the "Browse analysis" link.


BTW I really like the graphics output, e.g.:
https://saas.eclairit.com:3787/fs/var/local/eclair/xen-project.ecdf/xen-project/people/sstabellini/xen/ECLAIR_normal/ppp2/ARM64/4732041018/PROJECT.ecd;/by_service.html#service/first_file&kind

Very nice and clear!


> +eclair-x86_64:
> +  extends: .eclair-analysis
> +  variables:
> +    LOGFILE: "eclair-x86_64.log"
> +    VARIANT: "X86_64"
> +    RULESET: "Set1"
> +  script:
> +    - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
> +  allow_failure: true
> +
> +eclair-ARM64:
> +  extends: .eclair-analysis
> +  variables:
> +    LOGFILE: "eclair-ARM64.log"
> +    VARIANT: "ARM64"
> +    RULESET: "Set1"
> +  script:
> +    - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
> +  allow_failure: true
> diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
> index c401f62d61..f01e2c32bb 100644
> --- a/automation/gitlab-ci/build.yaml
> +++ b/automation/gitlab-ci/build.yaml
> @@ -11,6 +11,7 @@
>        - '*.log'
>        - '*/*.log'
>      when: always
> +  needs: []
>    except:
>      - master
>      - smoke
> diff --git a/automation/scripts/eclair b/automation/scripts/eclair
> new file mode 100755
> index 0000000000..55888617b3
> --- /dev/null
> +++ b/automation/scripts/eclair
> @@ -0,0 +1,34 @@
> +#!/bin/sh -eu
> +
> +ECLAIR_ANALYSIS_DIR=automation/eclair_analysis
> +ECLAIR_DIR="${ECLAIR_ANALYSIS_DIR}/ECLAIR"
> +ECLAIR_OUTPUT_DIR=$(realpath "${ECLAIR_OUTPUT_DIR}")
> +
> +if [ -z "${WTOKEN:-}" ]; then
> +    echo "Failure: the WTOKEN variable is not defined." >&2
> +    exit 1
> +fi
> +
> +"${ECLAIR_ANALYSIS_DIR}/prepare.sh" "${VARIANT}"
> +
> +ex=0
> +"${ECLAIR_DIR}/analyze.sh" "${VARIANT}" "${RULESET}" || ex=$?
> +"${ECLAIR_DIR}/action_log.sh" ANALYSIS_LOG \
> +                             "ECLAIR analysis log" \
> +                             "${ECLAIR_OUTPUT_DIR}/ANALYSIS.log" \
> +                             "${ex}"
> +"${ECLAIR_DIR}/action_log.sh" REPORT_LOG \
> +                             "ECLAIR report log" \
> +                             "${ECLAIR_OUTPUT_DIR}/REPORT.log" \
> +                             "${ex}"
> +[ "${ex}" = 0 ] || exit "${ex}"
> +"${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
> +
> +# Fail in case of new reports
> +"${ECLAIR_DIR}/action_clean_added.sh" "${ECLAIR_OUTPUT_DIR}" || ex=$?
> +"${ECLAIR_DIR}/action_log.sh" DIFF_CHECK_LOG \
> +                             "ECLAIR diff check" \
> +                             "${ECLAIR_OUTPUT_DIR}/clean_added.log" \
> +                             "${ex}"
> +
> +[ "${ex}" = 0 ] || exit "${ex}"
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 20:04:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 20:04:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569922.891121 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOOGl-0000XL-TQ; Tue, 25 Jul 2023 20:04:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569922.891121; Tue, 25 Jul 2023 20:04:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOOGl-0000XE-QU; Tue, 25 Jul 2023 20:04:31 +0000
Received: by outflank-mailman (input) for mailman id 569922;
 Tue, 25 Jul 2023 20:04:30 +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
 <SRS0=ITxH=DL=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qOOGk-0007eJ-M9
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 20:04:30 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 75e2fb5b-2b26-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 22:04:29 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id D9F11618BF;
 Tue, 25 Jul 2023 20:04:27 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 115CFC433C7;
 Tue, 25 Jul 2023 20:04:25 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 75e2fb5b-2b26-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690315467;
	bh=7gVxt2p9J+lMgJ/yqUQ6jfFkLIHiGqhGDrlWV1ES+8o=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=UZsShGzA0zIFPJgOQITJXdpq0QjeTFU6fn33FnxX99pWzBGfTINLTW7lyR+9s3JRb
	 QvLI1TcQNs7nSF54d33m+e0H6U0S4JQz6LwhqPYlrP7oyQ/2/Fa8pLjLKjggPvZc3N
	 FjPp6QXU3ZM5eT/7cx9hgf8NVPeWeXroOHft6C2QBGpjNlOFxArU3XEK9aXKntvvzW
	 NRvSzsGtEOv1qe+ZFj9KXbVn2vaTM1DzfYpMGj4VEA4NuAIHTvXxyyVHAW6ydAHM1d
	 X1RPk63Beb0fPayXll4DuhHwTko/MzsdZ2UskRu9IcWzdiny4L9NIpOvdwtwpXtGIR
	 Nz7/+Z9tP4dFg==
Date: Tue, 25 Jul 2023 13:04:24 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Wei Liu <wl@xen.org>
Subject: Re: [XEN PATCH 4/4] maintainers: Add ECLAIR reviewer
In-Reply-To: <dfe59e554a25a180b9bece8fd6a0f9a142654004.1690294965.git.simone.ballarin@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307251243380.3118466@ubuntu-linux-20-04-desktop>
References: <cover.1690294965.git.simone.ballarin@bugseng.com> <dfe59e554a25a180b9bece8fd6a0f9a142654004.1690294965.git.simone.ballarin@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 25 Jul 2023, Simone Ballarin wrote:
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
> 
> --
> Changes in v3:
> - split maintainer add in a separate patch;
> - substitute blanks with tabs;
> - fix file paths;
> - change role from maintainer to reviewer.
> 
> Changes in v2:
> - add ECLAIR configuration files (before they were fetched from a separate
>   repository);
> - now the pipeline fails if there are new violations of guidelines tagged
>   with clean:added.
> ---
>  MAINTAINERS | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 180e57dac4..66ff0ed710 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -305,6 +305,12 @@ F:	xen/include/xen/libfdt/
>  F:	xen/include/xen/device_tree.h
>  F:	xen/drivers/passthrough/device_tree.c
>  
> +ECLAIR
> +R:	Simone Ballarin <simone.ballarin@bugseng.com>
> +S:	Supported
> +F: 	automation/eclair_analysis/
> +F: 	automation/scripts/eclair

There is still a whitespace problem: it is supposed to be only tabs, not
1 space then 1 tab. However, it can be fixed on commit:

Acked-by: Stefano Stabellini <sstabellini@kernel.org>



>  EFI
>  M:	Jan Beulich <jbeulich@suse.com>
>  S:	Supported
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 20:05:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 20:05:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569925.891132 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOOHs-0001QL-7H; Tue, 25 Jul 2023 20:05:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569925.891132; Tue, 25 Jul 2023 20:05:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOOHs-0001QE-46; Tue, 25 Jul 2023 20:05:40 +0000
Received: by outflank-mailman (input) for mailman id 569925;
 Tue, 25 Jul 2023 20:05:39 +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
 <SRS0=ITxH=DL=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qOOHr-0001Q3-EK
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 20:05:39 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9e825415-2b26-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 22:05:37 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id EDE51618C9;
 Tue, 25 Jul 2023 20:05:35 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 864CDC433C7;
 Tue, 25 Jul 2023 20:05:33 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9e825415-2b26-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690315535;
	bh=3ScwuRJk5g9SME3JJg8b/X5kSsRELo3qrdBKYbKb3XQ=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=T32KfYrShD+ElY+dOmldViqCOX59pxdrCP3xT66yHTkpKpT7sS8AZHeEnCxfSjwEg
	 vSbPSu3caVVKpcZsuVUMPoGYO+/VcQGxdA8zin6zjjpswSLawXuuRYl/IOlZdiPZLh
	 r2e5h6AER3IWUm7exnchYxGONuY5qTk/dPiWCAvY1RmGzxo+UZ84FsaxLI1vDAL7An
	 TAP6pb2amaUCY1nV2NF0ikMIpgn82pDy5liG/gEtao2EdWklC/4rmExRgljuUR7D8V
	 hEsm1gdBUJ8WWJz+Nzq80xCZThu3+hCP28ca77g9QYY6Sw8BWCC2YOTP9Gclog0AMN
	 v/i7kYBjoJolw==
Date: Tue, 25 Jul 2023 13:05:31 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org, 
    michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, 
    consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, 
    Bertrand Marquis <bertrand.marquis@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [RFC PATCH 0/4] fix some issues related to MISRA C:2012 Rule
 9.1
In-Reply-To: <cover.1689329728.git.nicola.vetrini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307251042130.3118466@ubuntu-linux-20-04-desktop>
References: <cover.1689329728.git.nicola.vetrini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

For the record, as I mentioned during the call today, I asked to
postpone the 9.1 work for later, because it is going to take a lot of
work and discussions to figure out a good way forward for all these
cases. There are at least 3-5 different sub-classes for this issues. So
I think it would be better for the Xen community to make more progress
with other rules and violations fixes first.


On Fri, 14 Jul 2023, Nicola Vetrini wrote:
> This patch series is aimed at discussing different categories of
> patterns concerning local variables that are possibly not
> initialized in all code paths, which results in hard-to-prove
> correctness. The main categories are as follows:
> 
> 1. Variables initialized by passing a pointer to them to a function.
>    Many such functions are coupled with error handling which results
> 	 in the variable not being initialized.
> 
> 2. Some variables are used in switch statements and the control flow
>    ensures that all code paths do initialize them, but due to the
> 	 presence of goto statements, the flow is harder to follow.
> 
> I emphasize that, as far as I can tell, the code is already
> compliant with the rule, but there is room for improvement, especially
> on the side of allowing automatic checks to be more effective.
> 
> Nicola Vetrini (4):
>   xen/arm: justify or initialize conditionally uninitialized variables
>   xen/arm64: bitops: justify uninitialized variable inside a macro
>   xen/arm: initialize conditionally uninitialized local variables
>   xen/arm: initialize conditionally uninitialized local variables
> 
>  docs/misra/safe.json                        | 24 +++++++++++++++
>  xen/arch/arm/arm64/lib/bitops.c             |  3 ++
>  xen/arch/arm/arm64/lib/find_next_bit.c      |  1 +
>  xen/arch/arm/bootfdt.c                      |  6 ++++
>  xen/arch/arm/cpuerrata.c                    |  6 ++--
>  xen/arch/arm/decode.c                       |  2 ++
>  xen/arch/arm/dm.c                           |  2 +-
>  xen/arch/arm/domain_build.c                 | 29 ++++++++++++++----
>  xen/arch/arm/domctl.c                       |  8 ++---
>  xen/arch/arm/efi/efi-boot.h                 |  6 ++--
>  xen/arch/arm/gic-v3-its.c                   |  9 +++---
>  xen/arch/arm/gic-v3-lpi.c                   | 17 ++++++-----
>  xen/arch/arm/guest_walk.c                   | 12 ++++----
>  xen/arch/arm/include/asm/guest_atomics.h    |  3 ++
>  xen/arch/arm/include/asm/p2m.h              | 10 ++++---
>  xen/arch/arm/mm.c                           |  1 +
>  xen/arch/arm/p2m.c                          | 33 ++++++++++++---------
>  xen/arch/arm/platforms/xilinx-zynqmp-eemi.c | 10 ++-----
>  xen/arch/arm/psci.c                         | 10 +++----
>  xen/drivers/char/pl011.c                    |  2 +-
>  20 files changed, 129 insertions(+), 65 deletions(-)
> 
> --
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 20:29:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 20:29:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569929.891142 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOOel-00043N-7m; Tue, 25 Jul 2023 20:29:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569929.891142; Tue, 25 Jul 2023 20:29:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOOel-00043G-3L; Tue, 25 Jul 2023 20:29:19 +0000
Received: by outflank-mailman (input) for mailman id 569929;
 Tue, 25 Jul 2023 20:29:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=1Iib=DL=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qOOej-000438-QS
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 20:29:17 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id df1260b3-2b29-11ee-b240-6b7b168915f2;
 Tue, 25 Jul 2023 22:28:53 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.163.26.148])
 by support.bugseng.com (Postfix) with ESMTPSA id D4C994EE0738;
 Tue, 25 Jul 2023 22:28:50 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: df1260b3-2b29-11ee-b240-6b7b168915f2
Message-ID: <5332da19-a9d8-f9fb-62b3-b1dbdf7982dc@bugseng.com>
Date: Tue, 25 Jul 2023 22:28:49 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v2] xen/spinlock: mechanically rename parameter name
 'debug'
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>,
 Jan Beulich <jbeulich@suse.com>
Cc: michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
References: <87c0f41e43a1c95ef7d8923c77a2072eb9baee96.1690276551.git.nicola.vetrini@bugseng.com>
 <120ed841-5e0f-e27b-9937-5599dc75d84a@suse.com>
 <alpine.DEB.2.22.394.2307251235090.3118466@ubuntu-linux-20-04-desktop>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <alpine.DEB.2.22.394.2307251235090.3118466@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 25/07/23 21:37, Stefano Stabellini wrote:
> On Tue, 25 Jul 2023, Jan Beulich wrote:
>> On 25.07.2023 11:17, Nicola Vetrini wrote:
>>> Rule 5.3 has the following headline:
>>> "An identifier declared in an inner scope shall not hide an
>>> identifier declared in an outer scope"
>>>
>>> To avoid any confusion resulting from the parameter 'debug'
>>> hiding the homonymous function declared at
>>> 'xen/arch/x86/include/asm/processor.h:428'
>>> the rename of parameters s/debug/lkdbg/ is performed.
>>>
>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>> ---
>>> Changes in v2:
>>> - s/dbg/lkdbg/
>>
>> But only in some of the cases. E.g. ...
>>
>>> -static void check_barrier(union lock_debug *debug)
>>> +static void check_barrier(union lock_debug *dbg)
>>
>> ... not here (there are a few more).
> 
> I agree with Jan: these are all union lock_debug parameters, so it would
> make sense to me to use lkdbg everywhere in this patch.

Yes, indeed, that's unintentional. Can this be done on commit or should 
I send a v3?

Regards,

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 20:30:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 20:30:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569934.891152 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOOfR-0004Xx-Ey; Tue, 25 Jul 2023 20:30:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569934.891152; Tue, 25 Jul 2023 20:30:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOOfR-0004Xq-Bi; Tue, 25 Jul 2023 20:30:01 +0000
Received: by outflank-mailman (input) for mailman id 569934;
 Tue, 25 Jul 2023 20:30:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ITxH=DL=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qOOfQ-000438-6T
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 20:30:00 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 05f12735-2b2a-11ee-b240-6b7b168915f2;
 Tue, 25 Jul 2023 22:29:59 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id DC6246186A;
 Tue, 25 Jul 2023 20:29:57 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDEC3C433C7;
 Tue, 25 Jul 2023 20:29:55 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 05f12735-2b2a-11ee-b240-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690316997;
	bh=R1o1FjC5+1850Wd0jwg1cn2b9IHmCqMVJ75KmrE/uMo=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=IpozL/zK5nIUMQ4979+ku+b3d0SI23fwjnQAO9/QjU9CvRPln7YX6noeCWPWJG5Xi
	 gE1/Pw2Grs/tTSpCovxbPcqSbpkcaj9Fios4gZTTMhACqyIIXba5aHYwAeW0bllaV8
	 5V7gkJ3xRRfV+hfcftTBMRMf3Z5F31w2LVNTrnTk8THJB9HaZOaJgnbfBxkC1ocIPQ
	 1nJBrYRWFlSgUmM0wJfoF3QxBtwJbum1X86az0jeyYuQnUZHcKOn7L/qWg1wGwnvuK
	 IqIPppAaHTBpvMWD5TZLArj6l5Nj6SpdZLkpsMOVQrnnH486x+eF7o2ak2aJ1oBF9y
	 bqUpHJImTdymA==
Date: Tue, 25 Jul 2023 13:29:54 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    Jan Beulich <jbeulich@suse.com>, michal.orzel@amd.com, 
    xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, 
    consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>, 
    Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v2] xen/spinlock: mechanically rename parameter name
 'debug'
In-Reply-To: <5332da19-a9d8-f9fb-62b3-b1dbdf7982dc@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307251329430.3118466@ubuntu-linux-20-04-desktop>
References: <87c0f41e43a1c95ef7d8923c77a2072eb9baee96.1690276551.git.nicola.vetrini@bugseng.com> <120ed841-5e0f-e27b-9937-5599dc75d84a@suse.com> <alpine.DEB.2.22.394.2307251235090.3118466@ubuntu-linux-20-04-desktop>
 <5332da19-a9d8-f9fb-62b3-b1dbdf7982dc@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 25 Jul 2023, Nicola Vetrini wrote:
> On 25/07/23 21:37, Stefano Stabellini wrote:
> > On Tue, 25 Jul 2023, Jan Beulich wrote:
> > > On 25.07.2023 11:17, Nicola Vetrini wrote:
> > > > Rule 5.3 has the following headline:
> > > > "An identifier declared in an inner scope shall not hide an
> > > > identifier declared in an outer scope"
> > > > 
> > > > To avoid any confusion resulting from the parameter 'debug'
> > > > hiding the homonymous function declared at
> > > > 'xen/arch/x86/include/asm/processor.h:428'
> > > > the rename of parameters s/debug/lkdbg/ is performed.
> > > > 
> > > > Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> > > > ---
> > > > Changes in v2:
> > > > - s/dbg/lkdbg/
> > > 
> > > But only in some of the cases. E.g. ...
> > > 
> > > > -static void check_barrier(union lock_debug *debug)
> > > > +static void check_barrier(union lock_debug *dbg)
> > > 
> > > ... not here (there are a few more).
> > 
> > I agree with Jan: these are all union lock_debug parameters, so it would
> > make sense to me to use lkdbg everywhere in this patch.
> 
> Yes, indeed, that's unintentional. Can this be done on commit or should I send
> a v3?

Please send an update if possible


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 20:47:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 20:47:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569938.891161 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOOvu-00078h-R4; Tue, 25 Jul 2023 20:47:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569938.891161; Tue, 25 Jul 2023 20:47:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOOvu-00078a-OH; Tue, 25 Jul 2023 20:47:02 +0000
Received: by outflank-mailman (input) for mailman id 569938;
 Tue, 25 Jul 2023 20:47:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=1Iib=DL=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qOOvu-00078T-AP
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 20:47:02 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 672ea056-2b2c-11ee-b240-6b7b168915f2;
 Tue, 25 Jul 2023 22:47:00 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.163.26.148])
 by support.bugseng.com (Postfix) with ESMTPSA id 906644EE0738;
 Tue, 25 Jul 2023 22:46:58 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 672ea056-2b2c-11ee-b240-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH v3] xen/spinlock: mechanically rename parameter name 'debug'
Date: Tue, 25 Jul 2023 22:45:33 +0200
Message-Id: <a66f1084686b77b098c5ccf3d0cf5f52980fdf5a.1690317797.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rule 5.3 has the following headline:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope"

To avoid any confusion resulting from the parameter 'debug'
hiding the homonymous function declared at
'xen/arch/x86/include/asm/processor.h:428'
the rename of parameters s/debug/lkdbg/ is performed.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
Changes in v2:
- s/dbg/lkdbg/
Changes in v3:
- Added missing renames for consistency
---
 xen/common/spinlock.c      | 38 +++++++++++++++++++-------------------
 xen/include/xen/spinlock.h |  6 +++---
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index 7f453234a9..d4088f910d 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -78,7 +78,7 @@ static int __init cf_check lockdebug_init(void)
 }
 presmp_initcall(lockdebug_init);
 
-void check_lock(union lock_debug *debug, bool try)
+void check_lock(union lock_debug *lkdbg, bool try)
 {
     bool irq_safe = !local_irq_is_enabled();
     unsigned int cpu = smp_processor_id();
@@ -118,12 +118,12 @@ void check_lock(union lock_debug *debug, bool try)
     if ( try && irq_safe )
         return;
 
-    if ( unlikely(debug->irq_safe != irq_safe) )
+    if ( unlikely(lkdbg->irq_safe != irq_safe) )
     {
         union lock_debug seen, new = { 0 };
 
         new.irq_safe = irq_safe;
-        seen.val = cmpxchg(&debug->val, LOCK_DEBUG_INITVAL, new.val);
+        seen.val = cmpxchg(&lkdbg->val, LOCK_DEBUG_INITVAL, new.val);
 
         if ( !seen.unseen && seen.irq_safe == !irq_safe )
         {
@@ -137,14 +137,14 @@ void check_lock(union lock_debug *debug, bool try)
         return;
 
     for ( i = 0; i < nr_taken; i++ )
-        if ( taken[i] == debug )
+        if ( taken[i] == lkdbg )
         {
-            printk("CHECKLOCK FAILURE: lock at %p taken recursively\n", debug);
+            printk("CHECKLOCK FAILURE: lock at %p taken recursively\n", lkdbg);
             BUG();
         }
 }
 
-static void check_barrier(union lock_debug *debug)
+static void check_barrier(union lock_debug *lkdbg)
 {
     if ( unlikely(atomic_read(&spin_debug) <= 0) )
         return;
@@ -160,10 +160,10 @@ static void check_barrier(union lock_debug *debug)
      * However, if we spin on an IRQ-unsafe lock with IRQs disabled then that
      * is clearly wrong, for the same reason outlined in check_lock() above.
      */
-    BUG_ON(!local_irq_is_enabled() && !debug->irq_safe);
+    BUG_ON(!local_irq_is_enabled() && !lkdbg->irq_safe);
 }
 
-void lock_enter(const union lock_debug *debug)
+void lock_enter(const union lock_debug *lkdbg)
 {
     unsigned int cpu = smp_processor_id();
     const union lock_debug **taken = per_cpu(locks_taken, cpu);
@@ -176,7 +176,7 @@ void lock_enter(const union lock_debug *debug)
     local_irq_save(flags);
 
     if ( *nr_taken < lock_depth_size )
-        taken[(*nr_taken)++] = debug;
+        taken[(*nr_taken)++] = lkdbg;
     else if ( !max_depth_reached )
     {
         max_depth_reached = true;
@@ -187,7 +187,7 @@ void lock_enter(const union lock_debug *debug)
     local_irq_restore(flags);
 }
 
-void lock_exit(const union lock_debug *debug)
+void lock_exit(const union lock_debug *lkdbg)
 {
     unsigned int cpu = smp_processor_id();
     const union lock_debug **taken = per_cpu(locks_taken, cpu);
@@ -202,7 +202,7 @@ void lock_exit(const union lock_debug *debug)
 
     for ( i = *nr_taken; i > 0; i-- )
     {
-        if ( taken[i - 1] == debug )
+        if ( taken[i - 1] == lkdbg )
         {
             memmove(taken + i - 1, taken + i,
                     (*nr_taken - i) * sizeof(*taken));
@@ -217,28 +217,28 @@ void lock_exit(const union lock_debug *debug)
 
     if ( !max_depth_reached )
     {
-        printk("CHECKLOCK released lock at %p not recorded!\n", debug);
+        printk("CHECKLOCK released lock at %p not recorded!\n", lkdbg);
         WARN();
     }
 
     local_irq_restore(flags);
 }
 
-static void got_lock(union lock_debug *debug)
+static void got_lock(union lock_debug *lkdbg)
 {
-    debug->cpu = smp_processor_id();
+    lkdbg->cpu = smp_processor_id();
 
-    lock_enter(debug);
+    lock_enter(lkdbg);
 }
 
-static void rel_lock(union lock_debug *debug)
+static void rel_lock(union lock_debug *lkdbg)
 {
     if ( atomic_read(&spin_debug) > 0 )
-        BUG_ON(debug->cpu != smp_processor_id());
+        BUG_ON(lkdbg->cpu != smp_processor_id());
 
-    lock_exit(debug);
+    lock_exit(lkdbg);
 
-    debug->cpu = SPINLOCK_NO_CPU;
+    lkdbg->cpu = SPINLOCK_NO_CPU;
 }
 
 void spin_debug_enable(void)
diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index 0a02a527dc..464af705eb 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -22,9 +22,9 @@ union lock_debug {
     };
 };
 #define _LOCK_DEBUG { LOCK_DEBUG_INITVAL }
-void check_lock(union lock_debug *debug, bool try);
-void lock_enter(const union lock_debug *debug);
-void lock_exit(const union lock_debug *debug);
+void check_lock(union lock_debug *lkdbg, bool try);
+void lock_enter(const union lock_debug *lkdbg);
+void lock_exit(const union lock_debug *lkdbg);
 void spin_debug_enable(void);
 void spin_debug_disable(void);
 #else
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 21:12:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 21:12:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569943.891172 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOPK0-0002Aj-PB; Tue, 25 Jul 2023 21:11:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569943.891172; Tue, 25 Jul 2023 21:11:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOPK0-0002Ac-M2; Tue, 25 Jul 2023 21:11:56 +0000
Received: by outflank-mailman (input) for mailman id 569943;
 Tue, 25 Jul 2023 21:11:55 +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
 <SRS0=ITxH=DL=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qOPJz-0002AW-Ma
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 21:11:55 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e04d8bd4-2b2f-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 23:11:53 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id CB191618E8;
 Tue, 25 Jul 2023 21:11:51 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89B81C433C8;
 Tue, 25 Jul 2023 21:11:49 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e04d8bd4-2b2f-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690319511;
	bh=BccyWhHxVtzXVV1SfzyvMedv3ZHTo4U7zPNJUlSTYus=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=NDuqURV8VnsnB5AD5wh+2u3iNpVVntkm36+EPCcJHUphfFSFONjZ449UdLYuNRgS/
	 4Y9sLHQNvLcYnEbm8LsF5NRASAFJzPjTRhI0C+0QDMDspvz6lp4OxTlMbML623YibS
	 CibdG8JHE7w/q15PbFznntxRvncTk+ojpfrEXDIOvgimMhCiTuboONtfN5BSLYmeNV
	 GHZNgT8mhAz2RhVUiFLroi6GtDQosEDToBfUH3Dv+v6hUN1TePl6E+OBtNNpxXb2eo
	 rhec1QZsVqbXaT83gO7Q3vSG2L1NylHYPzjr8/GfUgr3zqsE4tM77S2R0RvHYQ43ok
	 5zhOPIY4fMPDg==
Date: Tue, 25 Jul 2023 14:11:47 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org, 
    michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, 
    consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>
Subject: Re: [XEN PATCH v3] xen/spinlock: mechanically rename parameter name
 'debug'
In-Reply-To: <a66f1084686b77b098c5ccf3d0cf5f52980fdf5a.1690317797.git.nicola.vetrini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307251411410.3118466@ubuntu-linux-20-04-desktop>
References: <a66f1084686b77b098c5ccf3d0cf5f52980fdf5a.1690317797.git.nicola.vetrini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 25 Jul 2023, Nicola Vetrini wrote:
> Rule 5.3 has the following headline:
> "An identifier declared in an inner scope shall not hide an
> identifier declared in an outer scope"
> 
> To avoid any confusion resulting from the parameter 'debug'
> hiding the homonymous function declared at
> 'xen/arch/x86/include/asm/processor.h:428'
> the rename of parameters s/debug/lkdbg/ is performed.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes in v2:
> - s/dbg/lkdbg/
> Changes in v3:
> - Added missing renames for consistency
> ---
>  xen/common/spinlock.c      | 38 +++++++++++++++++++-------------------
>  xen/include/xen/spinlock.h |  6 +++---
>  2 files changed, 22 insertions(+), 22 deletions(-)
> 
> diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
> index 7f453234a9..d4088f910d 100644
> --- a/xen/common/spinlock.c
> +++ b/xen/common/spinlock.c
> @@ -78,7 +78,7 @@ static int __init cf_check lockdebug_init(void)
>  }
>  presmp_initcall(lockdebug_init);
>  
> -void check_lock(union lock_debug *debug, bool try)
> +void check_lock(union lock_debug *lkdbg, bool try)
>  {
>      bool irq_safe = !local_irq_is_enabled();
>      unsigned int cpu = smp_processor_id();
> @@ -118,12 +118,12 @@ void check_lock(union lock_debug *debug, bool try)
>      if ( try && irq_safe )
>          return;
>  
> -    if ( unlikely(debug->irq_safe != irq_safe) )
> +    if ( unlikely(lkdbg->irq_safe != irq_safe) )
>      {
>          union lock_debug seen, new = { 0 };
>  
>          new.irq_safe = irq_safe;
> -        seen.val = cmpxchg(&debug->val, LOCK_DEBUG_INITVAL, new.val);
> +        seen.val = cmpxchg(&lkdbg->val, LOCK_DEBUG_INITVAL, new.val);
>  
>          if ( !seen.unseen && seen.irq_safe == !irq_safe )
>          {
> @@ -137,14 +137,14 @@ void check_lock(union lock_debug *debug, bool try)
>          return;
>  
>      for ( i = 0; i < nr_taken; i++ )
> -        if ( taken[i] == debug )
> +        if ( taken[i] == lkdbg )
>          {
> -            printk("CHECKLOCK FAILURE: lock at %p taken recursively\n", debug);
> +            printk("CHECKLOCK FAILURE: lock at %p taken recursively\n", lkdbg);
>              BUG();
>          }
>  }
>  
> -static void check_barrier(union lock_debug *debug)
> +static void check_barrier(union lock_debug *lkdbg)
>  {
>      if ( unlikely(atomic_read(&spin_debug) <= 0) )
>          return;
> @@ -160,10 +160,10 @@ static void check_barrier(union lock_debug *debug)
>       * However, if we spin on an IRQ-unsafe lock with IRQs disabled then that
>       * is clearly wrong, for the same reason outlined in check_lock() above.
>       */
> -    BUG_ON(!local_irq_is_enabled() && !debug->irq_safe);
> +    BUG_ON(!local_irq_is_enabled() && !lkdbg->irq_safe);
>  }
>  
> -void lock_enter(const union lock_debug *debug)
> +void lock_enter(const union lock_debug *lkdbg)
>  {
>      unsigned int cpu = smp_processor_id();
>      const union lock_debug **taken = per_cpu(locks_taken, cpu);
> @@ -176,7 +176,7 @@ void lock_enter(const union lock_debug *debug)
>      local_irq_save(flags);
>  
>      if ( *nr_taken < lock_depth_size )
> -        taken[(*nr_taken)++] = debug;
> +        taken[(*nr_taken)++] = lkdbg;
>      else if ( !max_depth_reached )
>      {
>          max_depth_reached = true;
> @@ -187,7 +187,7 @@ void lock_enter(const union lock_debug *debug)
>      local_irq_restore(flags);
>  }
>  
> -void lock_exit(const union lock_debug *debug)
> +void lock_exit(const union lock_debug *lkdbg)
>  {
>      unsigned int cpu = smp_processor_id();
>      const union lock_debug **taken = per_cpu(locks_taken, cpu);
> @@ -202,7 +202,7 @@ void lock_exit(const union lock_debug *debug)
>  
>      for ( i = *nr_taken; i > 0; i-- )
>      {
> -        if ( taken[i - 1] == debug )
> +        if ( taken[i - 1] == lkdbg )
>          {
>              memmove(taken + i - 1, taken + i,
>                      (*nr_taken - i) * sizeof(*taken));
> @@ -217,28 +217,28 @@ void lock_exit(const union lock_debug *debug)
>  
>      if ( !max_depth_reached )
>      {
> -        printk("CHECKLOCK released lock at %p not recorded!\n", debug);
> +        printk("CHECKLOCK released lock at %p not recorded!\n", lkdbg);
>          WARN();
>      }
>  
>      local_irq_restore(flags);
>  }
>  
> -static void got_lock(union lock_debug *debug)
> +static void got_lock(union lock_debug *lkdbg)
>  {
> -    debug->cpu = smp_processor_id();
> +    lkdbg->cpu = smp_processor_id();
>  
> -    lock_enter(debug);
> +    lock_enter(lkdbg);
>  }
>  
> -static void rel_lock(union lock_debug *debug)
> +static void rel_lock(union lock_debug *lkdbg)
>  {
>      if ( atomic_read(&spin_debug) > 0 )
> -        BUG_ON(debug->cpu != smp_processor_id());
> +        BUG_ON(lkdbg->cpu != smp_processor_id());
>  
> -    lock_exit(debug);
> +    lock_exit(lkdbg);
>  
> -    debug->cpu = SPINLOCK_NO_CPU;
> +    lkdbg->cpu = SPINLOCK_NO_CPU;
>  }
>  
>  void spin_debug_enable(void)
> diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
> index 0a02a527dc..464af705eb 100644
> --- a/xen/include/xen/spinlock.h
> +++ b/xen/include/xen/spinlock.h
> @@ -22,9 +22,9 @@ union lock_debug {
>      };
>  };
>  #define _LOCK_DEBUG { LOCK_DEBUG_INITVAL }
> -void check_lock(union lock_debug *debug, bool try);
> -void lock_enter(const union lock_debug *debug);
> -void lock_exit(const union lock_debug *debug);
> +void check_lock(union lock_debug *lkdbg, bool try);
> +void lock_enter(const union lock_debug *lkdbg);
> +void lock_exit(const union lock_debug *lkdbg);
>  void spin_debug_enable(void);
>  void spin_debug_disable(void);
>  #else
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 21:36:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 21:36:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569947.891182 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOPhg-0004gf-Ly; Tue, 25 Jul 2023 21:36:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569947.891182; Tue, 25 Jul 2023 21:36:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOPhg-0004gY-Id; Tue, 25 Jul 2023 21:36:24 +0000
Received: by outflank-mailman (input) for mailman id 569947;
 Tue, 25 Jul 2023 21:36:23 +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
 <SRS0=+x6f=DL=citrix.com=prvs=56398a583=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qOPhf-0004gS-Eq
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 21:36:23 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4938044b-2b33-11ee-8613-37d641c3527e;
 Tue, 25 Jul 2023 23:36:18 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4938044b-2b33-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690320978;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=mvn9oerAoDJsBTRn8jerLe70SaYH10dbTzqeGfG1m3w=;
  b=QTa35A0HBdxMVWw59SE5vVnHZCXW5y6y8hQNc3hUY27DepkYB1el+iyR
   i9qCsCfHQg+oGRTfPPGQLsaF+8L4OSEnW2W7FMYkPpPwSUQH9UIveLPAZ
   GUM+mlitU0E/EZgCqjKLsPbOxCJolqInNtanMvOY4hHna3va2jNTyMExI
   A=;
Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 117303372
X-Ironport-Server: esa2.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:YbBDka9O4ugowmfrtHe0DrUDgH6TJUtcMsCJ2f8bNWPcYEJGY0x3z
 GpLUGGPPK2CajShLdEkPo3j8EoPucDczoc3Hgtq/yo8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s
 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk
 d7pqojUNUTNNwRcawr40Ird7ks21BjOkGlA5AdmOqoW5A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YueAd2STj6zBkXSF+wBL+qj6zEiq792usEuEVWtRGsVdB58SMHfiLqVxLjM2YqYRJd
 6nyedsgSGvQngTZtTTPAh/YwCSz+e78q4PeHQ9dmca1DU=
X-Talos-CUID: 9a23:doksmGGryia3TPG2qmJH2VQvGud1TkeGxX7TBgiCA0NiWJqKHAo=
X-Talos-MUID: 9a23:gFb9+AYd7m64k+BTiAH2vR1ha9ZTw6myBV0h0tI2t/mbHHkl
X-IronPort-AV: E=Sophos;i="6.01,231,1684814400"; 
   d="scan'208";a="117303372"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
	<JBeulich@suse.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>
Subject: [PATCH] x86/cpu-policy: Advertise MSR_ARCH_CAPS to guests by default
Date: Tue, 25 Jul 2023 22:36:11 +0100
Message-ID: <20230725213611.2405811-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

With xl/libxl now able to control the policy bits for MSR_ARCH_CAPS, it is
safe to advertise to guests by default.  In turn, we don't need the special
case to expose details to dom0.

This advertises MSR_ARCH_CAPS to guests on *all* Intel hardware, even if the
register content ends up being empty.  This is necessary in order to safely
level two hosts which cross the Broadwell/Skylake divide.

On Cascade Lake and later hardware, guests can now see RDCL_NO (not vulnerable
to Meltdown) amongst others.  This causes substantial performance
improvements, as guests are no longer applying software mitigations in cases
where they don't need to.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>

Not to go in before Roger's libxl changes...
---
 xen/arch/x86/cpu-policy.c                   | 11 -----------
 xen/include/public/arch-x86/cpufeatureset.h |  2 +-
 2 files changed, 1 insertion(+), 12 deletions(-)

diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c
index f40eeb8be8dc..1f954d4e5940 100644
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -888,17 +888,6 @@ void __init init_dom0_cpuid_policy(struct domain *d)
     if ( cpu_has_itsc )
         p->extd.itsc = true;
 
-    /*
-     * Expose the "hardware speculation behaviour" bits of ARCH_CAPS to dom0,
-     * so dom0 can turn off workarounds as appropriate.  Temporary, until the
-     * domain policy logic gains a better understanding of MSRs.
-     */
-    if ( is_hardware_domain(d) && cpu_has_arch_caps )
-    {
-        p->feat.arch_caps = true;
-        p->arch_caps.raw = host_cpu_policy.arch_caps.raw;
-    }
-
     /* Apply dom0-cpuid= command line settings, if provided. */
     if ( dom0_cpuid_cmdline )
     {
diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/public/arch-x86/cpufeatureset.h
index ce7407d6a10c..6d20810cb9d1 100644
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -271,7 +271,7 @@ XEN_CPUFEATURE(AVX512_FP16,   9*32+23) /*A  AVX512 FP16 instructions */
 XEN_CPUFEATURE(IBRSB,         9*32+26) /*A  IBRS and IBPB support (used by Intel) */
 XEN_CPUFEATURE(STIBP,         9*32+27) /*A  STIBP */
 XEN_CPUFEATURE(L1D_FLUSH,     9*32+28) /*S  MSR_FLUSH_CMD and L1D flush. */
-XEN_CPUFEATURE(ARCH_CAPS,     9*32+29) /*!a IA32_ARCH_CAPABILITIES MSR */
+XEN_CPUFEATURE(ARCH_CAPS,     9*32+29) /*!A IA32_ARCH_CAPABILITIES MSR */
 XEN_CPUFEATURE(CORE_CAPS,     9*32+30) /*   IA32_CORE_CAPABILITIES MSR */
 XEN_CPUFEATURE(SSBD,          9*32+31) /*A  MSR_SPEC_CTRL.SSBD available */
 
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Tue Jul 25 21:41:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 21:41:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569951.891192 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOPmX-0006BB-Bk; Tue, 25 Jul 2023 21:41:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569951.891192; Tue, 25 Jul 2023 21:41:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOPmX-0006B4-96; Tue, 25 Jul 2023 21:41:25 +0000
Received: by outflank-mailman (input) for mailman id 569951;
 Tue, 25 Jul 2023 21:41:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOPmV-0006Au-Vq; Tue, 25 Jul 2023 21:41:23 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOPmV-0006Ou-TH; Tue, 25 Jul 2023 21:41:23 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOPmV-0001De-Dz; Tue, 25 Jul 2023 21:41:23 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOPmV-0001Ja-DR; Tue, 25 Jul 2023 21:41:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=5zcxsWZfDv6zSLFjjm7eEQDBa0aiuUkGeGjBDrdorEw=; b=wqkHSPM+7MtUn4RvX0NIxD4Go0
	olobbY+DP1VS7wlEoNTvJGguvunp67hetU6Zlgfksqr+9vgmdG218yegT25688Vzq8rQ+a8k0yX1B
	gzH1ABIMTYmbbm208YRkyIN3eZLm8ScYE2gamTrIL+clIKTICJitzrVsClMdy4dpXIKg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181997-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.17-testing test] 181997: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-4.17-testing:test-amd64-i386-migrupgrade:xen-install/dst_host:fail:heisenbug
    xen-4.17-testing:test-amd64-i386-migrupgrade:xen-install/src_host:fail:heisenbug
    xen-4.17-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=3141a0b85c37b76e069ec7dcb906ff202f5c4075
X-Osstest-Versions-That:
    xen=69611e5b3c43f52ce130b89ac4c6bb1c2aeb25d3
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 25 Jul 2023 21:41:23 +0000

flight 181997 xen-4.17-testing real [real]
flight 182014 xen-4.17-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181997/
http://logs.test-lab.xenproject.org/osstest/logs/182014/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-migrupgrade 11 xen-install/dst_host fail in 182014 pass in 181997
 test-amd64-i386-migrupgrade 10 xen-install/src_host fail pass in 182014-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181945
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181945
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181945
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181945
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181945
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181945
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181945
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181945
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181945
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181945
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181945
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181945
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  3141a0b85c37b76e069ec7dcb906ff202f5c4075
baseline version:
 xen                  69611e5b3c43f52ce130b89ac4c6bb1c2aeb25d3

Last test of basis   181945  2023-07-21 06:36:55 Z    4 days
Testing same since   181997  2023-07-24 16:37:35 Z    1 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   69611e5b3c..3141a0b85c  3141a0b85c37b76e069ec7dcb906ff202f5c4075 -> stable-4.17


From xen-devel-bounces@lists.xenproject.org Tue Jul 25 23:35:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 25 Jul 2023 23:35:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569988.891206 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qORYO-0000aR-4y; Tue, 25 Jul 2023 23:34:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569988.891206; Tue, 25 Jul 2023 23:34:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qORYO-0000aK-1v; Tue, 25 Jul 2023 23:34:56 +0000
Received: by outflank-mailman (input) for mailman id 569988;
 Tue, 25 Jul 2023 23:34:54 +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 <SRS0=I1ML=DL=intel.com=lkp@srs-se1.protection.inumbo.net>)
 id 1qORYM-0000aE-1E
 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2023 23:34:54 +0000
Received: from mga04.intel.com (mga04.intel.com [192.55.52.120])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d7b77bb6-2b43-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 01:34:49 +0200 (CEST)
Received: from orsmga008.jf.intel.com ([10.7.209.65])
 by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 25 Jul 2023 16:34:46 -0700
Received: from lkp-server02.sh.intel.com (HELO 953e8cd98f7d) ([10.239.97.151])
 by orsmga008.jf.intel.com with ESMTP; 25 Jul 2023 16:34:40 -0700
Received: from kbuild by 953e8cd98f7d with local (Exim 4.96)
 (envelope-from <lkp@intel.com>) id 1qORY7-0000Qn-2W;
 Tue, 25 Jul 2023 23:34:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d7b77bb6-2b43-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690328089; x=1721864089;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=C5xyKe5/WjYZUNBE8/1FHjpgxl/fMdUuo5xkgVP7J8Y=;
  b=kprEQkvDUSYB8VY754hEFOqF9OPVst5QCXBOombACoxddVdAJ8Mbz8BO
   y9j/KrfHTk0kNkhfEjXQ4yyYfSYlXsID0sZf9EIi/TX/LVvMyZop1imT1
   64drc3Kd0NKooYGQmtnluxbjXPtzNonbi2AjsEfyh3fCNbE97dgA2E1xx
   aaMJLxRLAvRgg3DdTPC34a3yt2ZxKKe/CslwvJn3r42X3sqowcsjUBjQB
   dx252wRrrF9rDLbw+TCCIsr/0xZ113UfcaSUUuRc19bOhFluME1UWyRw+
   xYejA5PKL7S0aB2oQJYOBJaBmZ8Dv4PdkJNAh/qxn/GIqPGRtCVMeqIah
   g==;
X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="366747677"
X-IronPort-AV: E=Sophos;i="6.01,231,1684825200"; 
   d="scan'208";a="366747677"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="755945611"
X-IronPort-AV: E=Sophos;i="6.01,231,1684825200"; 
   d="scan'208";a="755945611"
Date: Wed, 26 Jul 2023 07:33:59 +0800
From: kernel test robot <lkp@intel.com>
To: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org, linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org, linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org, kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Mike Rapoport <rppt@kernel.org>
Subject: Re: [PATCH mm-unstable v7 12/31] powerpc: Convert various functions
 to use ptdescs
Message-ID: <202307260706.qNPJSnjR-lkp@intel.com>
References: <20230725042051.36691-13-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20230725042051.36691-13-vishal.moola@gmail.com>

Hi Vishal,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on next-20230725]
[cannot apply to powerpc/next powerpc/fixes s390/features geert-m68k/for-next geert-m68k/for-linus linus/master v6.5-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Vishal-Moola-Oracle/mm-Add-PAGE_TYPE_OP-folio-functions/20230725-122458
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20230725042051.36691-13-vishal.moola%40gmail.com
patch subject: [PATCH mm-unstable v7 12/31] powerpc: Convert various functions to use ptdescs
config: powerpc-randconfig-r034-20230725 (https://download.01.org/0day-ci/archive/20230726/202307260706.qNPJSnjR-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20230726/202307260706.qNPJSnjR-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307260706.qNPJSnjR-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from arch/powerpc/mm/pgtable-frag.c:12:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:672:
   arch/powerpc/include/asm/io-defs.h:45:1: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic]
      45 | DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c),
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      46 |                  (p, b, c), pio, p)
         |                  ~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:669:3: note: expanded from macro 'DEF_PCI_AC_NORET'
     669 |                 __do_##name al;                                 \
         |                 ^~~~~~~~~~~~~~
   <scratch space>:40:1: note: expanded from here
      40 | __do_insw
         | ^
   arch/powerpc/include/asm/io.h:610:56: note: expanded from macro '__do_insw'
     610 | #define __do_insw(p, b, n)      readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
         |                                        ~~~~~~~~~~~~~~~~~~~~~^
   In file included from arch/powerpc/mm/pgtable-frag.c:12:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:672:
   arch/powerpc/include/asm/io-defs.h:47:1: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic]
      47 | DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      48 |                  (p, b, c), pio, p)
         |                  ~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:669:3: note: expanded from macro 'DEF_PCI_AC_NORET'
     669 |                 __do_##name al;                                 \
         |                 ^~~~~~~~~~~~~~
   <scratch space>:42:1: note: expanded from here
      42 | __do_insl
         | ^
   arch/powerpc/include/asm/io.h:611:56: note: expanded from macro '__do_insl'
     611 | #define __do_insl(p, b, n)      readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
         |                                        ~~~~~~~~~~~~~~~~~~~~~^
   In file included from arch/powerpc/mm/pgtable-frag.c:12:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:672:
   arch/powerpc/include/asm/io-defs.h:49:1: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic]
      49 | DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      50 |                  (p, b, c), pio, p)
         |                  ~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:669:3: note: expanded from macro 'DEF_PCI_AC_NORET'
     669 |                 __do_##name al;                                 \
         |                 ^~~~~~~~~~~~~~
   <scratch space>:44:1: note: expanded from here
      44 | __do_outsb
         | ^
   arch/powerpc/include/asm/io.h:612:58: note: expanded from macro '__do_outsb'
     612 | #define __do_outsb(p, b, n)     writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
         |                                         ~~~~~~~~~~~~~~~~~~~~~^
   In file included from arch/powerpc/mm/pgtable-frag.c:12:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:672:
   arch/powerpc/include/asm/io-defs.h:51:1: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic]
      51 | DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      52 |                  (p, b, c), pio, p)
         |                  ~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:669:3: note: expanded from macro 'DEF_PCI_AC_NORET'
     669 |                 __do_##name al;                                 \
         |                 ^~~~~~~~~~~~~~
   <scratch space>:46:1: note: expanded from here
      46 | __do_outsw
         | ^
   arch/powerpc/include/asm/io.h:613:58: note: expanded from macro '__do_outsw'
     613 | #define __do_outsw(p, b, n)     writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
         |                                         ~~~~~~~~~~~~~~~~~~~~~^
   In file included from arch/powerpc/mm/pgtable-frag.c:12:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:672:
   arch/powerpc/include/asm/io-defs.h:53:1: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic]
      53 | DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      54 |                  (p, b, c), pio, p)
         |                  ~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:669:3: note: expanded from macro 'DEF_PCI_AC_NORET'
     669 |                 __do_##name al;                                 \
         |                 ^~~~~~~~~~~~~~
   <scratch space>:48:1: note: expanded from here
      48 | __do_outsl
         | ^
   arch/powerpc/include/asm/io.h:614:58: note: expanded from macro '__do_outsl'
     614 | #define __do_outsl(p, b, n)     writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
         |                                         ~~~~~~~~~~~~~~~~~~~~~^
>> arch/powerpc/mm/pgtable-frag.c:125:22: error: use of undeclared identifier 'page'
     125 |         BUG_ON(atomic_read(&page->pt_frag_refcount) <= 0);
         |                             ^
   7 errors generated.

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for HOTPLUG_CPU
   Depends on [n]: SMP [=y] && (PPC_PSERIES [=n] || PPC_PMAC [=n] || PPC_POWERNV [=n] || FSL_SOC_BOOKE [=n])
   Selected by [y]:
   - PM_SLEEP_SMP [=y] && SMP [=y] && (ARCH_SUSPEND_POSSIBLE [=y] || ARCH_HIBERNATION_POSSIBLE [=y]) && PM_SLEEP [=y]


vim +/page +125 arch/powerpc/mm/pgtable-frag.c

0203dd58d897cbd Hugh Dickins          2023-07-11  117  
a95d133c8643cae Christophe Leroy      2018-11-29  118  void pte_fragment_free(unsigned long *table, int kernel)
a95d133c8643cae Christophe Leroy      2018-11-29  119  {
e18a6b21f4c0c0c Vishal Moola (Oracle  2023-07-24  120) 	struct ptdesc *ptdesc = virt_to_ptdesc(table);
a95d133c8643cae Christophe Leroy      2018-11-29  121  
e18a6b21f4c0c0c Vishal Moola (Oracle  2023-07-24  122) 	if (pagetable_is_reserved(ptdesc))
e18a6b21f4c0c0c Vishal Moola (Oracle  2023-07-24  123) 		return free_reserved_ptdesc(ptdesc);
645d5ce2f7d6cb4 Aneesh Kumar K.V      2020-07-09  124  
a95d133c8643cae Christophe Leroy      2018-11-29 @125  	BUG_ON(atomic_read(&page->pt_frag_refcount) <= 0);
e18a6b21f4c0c0c Vishal Moola (Oracle  2023-07-24  126) 	if (atomic_dec_and_test(&ptdesc->pt_frag_refcount)) {
0203dd58d897cbd Hugh Dickins          2023-07-11  127  		if (kernel)
e18a6b21f4c0c0c Vishal Moola (Oracle  2023-07-24  128) 			pagetable_free(ptdesc);
e18a6b21f4c0c0c Vishal Moola (Oracle  2023-07-24  129) 		else if (folio_test_clear_active(ptdesc_folio(ptdesc)))
e18a6b21f4c0c0c Vishal Moola (Oracle  2023-07-24  130) 			call_rcu(&ptdesc->pt_rcu_head, pte_free_now);
0203dd58d897cbd Hugh Dickins          2023-07-11  131  		else
e18a6b21f4c0c0c Vishal Moola (Oracle  2023-07-24  132) 			pte_free_now(&ptdesc->pt_rcu_head);
0203dd58d897cbd Hugh Dickins          2023-07-11  133  	}
a95d133c8643cae Christophe Leroy      2018-11-29  134  }
0203dd58d897cbd Hugh Dickins          2023-07-11  135  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 00:34:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 00:34:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.569998.891215 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOSU0-0007Wa-2c; Wed, 26 Jul 2023 00:34:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 569998.891215; Wed, 26 Jul 2023 00:34:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOSU0-0007WT-01; Wed, 26 Jul 2023 00:34:28 +0000
Received: by outflank-mailman (input) for mailman id 569998;
 Wed, 26 Jul 2023 00:34:26 +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
 <SRS0=j0A2=DM=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qOSTx-0007WN-VA
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 00:34:25 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2ac97e73-2b4c-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 02:34:23 +0200 (CEST)
Received: from mail-vs1-f43.google.com (mail-vs1-f43.google.com
 [209.85.217.43])
 by support.bugseng.com (Postfix) with ESMTPSA id BF52C4EE073C
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 02:34:22 +0200 (CEST)
Received: by mail-vs1-f43.google.com with SMTP id
 ada2fe7eead31-44758510539so31072137.2
 for <xen-devel@lists.xenproject.org>; Tue, 25 Jul 2023 17:34:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2ac97e73-2b4c-11ee-8613-37d641c3527e
X-Gm-Message-State: ABy/qLZxdpEiNCJ10R6GvFPiKcOrFdjDXAGyhv6tQTA45ntE+U2wsYx9
	T+KfcM8TU21FxzLm712521T216wqd2IcNmLH7yQ=
X-Google-Smtp-Source: APBJJlHmA2dYS0aHd4Om4w3JopZjDnO48tPcyQUCDek+IivVZYs/R8zqZLWFVguZ9PZmy9tTxnUURDcB1ks3COuIPUM=
X-Received: by 2002:a05:6102:99:b0:447:5054:e36a with SMTP id
 t25-20020a056102009900b004475054e36amr379123vsp.28.1690331661466; Tue, 25 Jul
 2023 17:34:21 -0700 (PDT)
MIME-Version: 1.0
References: <cover.1690294965.git.simone.ballarin@bugseng.com>
 <5e0b4afa229e29914392ffee736129f5ec2462cd.1690294965.git.simone.ballarin@bugseng.com>
 <alpine.DEB.2.22.394.2307251247360.3118466@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2307251247360.3118466@ubuntu-linux-20-04-desktop>
From: Simone Ballarin <simone.ballarin@bugseng.com>
Date: Wed, 26 Jul 2023 02:34:10 +0200
X-Gmail-Original-Message-ID: <CAFHJcJu6jeYDQj6Z3HdSQF6ODVyWroDinvhp0JwxevoeFwAW-Q@mail.gmail.com>
Message-ID: <CAFHJcJu6jeYDQj6Z3HdSQF6ODVyWroDinvhp0JwxevoeFwAW-Q@mail.gmail.com>
Subject: Re: [XEN PATCH 3/4] automation: Add ECLAIR pipelines
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
	Doug Goldstein <cardoe@cardoe.com>
Content-Type: multipart/alternative; boundary="0000000000003c04c206015902f9"

--0000000000003c04c206015902f9
Content-Type: text/plain; charset="UTF-8"

Il giorno mar 25 lug 2023 alle ore 22:04 Stefano Stabellini <
sstabellini@kernel.org> ha scritto:

> How do I access "gl-code-quality-report.json" or otherwise any other
> meaningful ECLAIR output? If I browse the job artifacts I see all the
> various logs but no gl-code-quality-report.json.
>

gl-code-quality-report.json is a GitLab-specific artifact that GitLab
exploits
to provide some features called Code Quality (
https://docs.gitlab.com/ee/ci/testing/code_quality.html).
The file is not supposed to be used outside of the context of the Code
Quality
features.

ECLAIR can produce stand-alone artifacts in various formats and
we can decide to store some of them in the job artifacts (see
https://www.bugseng.com/eclair/reports for an exhaustive list).

Scrolling up from the bottom of the job console output I see:
>
> Browse analysis:
> https://saas.eclairit.com:3787/fs/var/local/eclair/xen-project.ecdf/xen-project/people/sstabellini/xen/ECLAIR_normal/ppp2/ARM64/4732041018/index.html
>
> And if I click on the link, I can access a web interface with the
> results. Is that the intended way to access the job output?
>

The link in the console is just a way to access the analysis results.
Typically the most
convenient one is the message written by the integration in the commit
thread,
see here an example:
https://eclairit.com:8444/swquality/eclair_demo/-/commit/0d312f8ebca6c4e98eabbeaf9b0fcb8b4a4344d9
.
To enable this feature you have to provide an impersonation token to the
integration,
you can find more information on the commit message.

If so, would it be possible to print out the message "Browse
> analysis:..." as the very last message to make it easier to spot? After
> it at the moment I can see:
>
> From https://gitlab.com:443/xen-project/xen
>  * [new branch]            4.10.0-shim-comet   ->
> autoPRRemote/4.10.0-shim-comet
>  [...]
>
> The long list of branch names hides the "Browse analysis" link.
>
> Ok. I will try also to remove the warnings.

>
> BTW I really like the graphics output, e.g.:
>
> https://saas.eclairit.com:3787/fs/var/local/eclair/xen-project.ecdf/xen-project/people/sstabellini/xen/ECLAIR_normal/ppp2/ARM64/4732041018/PROJECT.ecd;/by_service.html#service/first_file&kind
>
> Very nice and clear!
>
>

-- 
Simone Ballarin, M.Sc.

Field Application Engineer, BUGSENG (https://bugseng.com
<http://bugseng.com>)

--0000000000003c04c206015902f9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">Il giorno mar 25 lug 2023 alle ore 22=
:04 Stefano Stabellini &lt;<a href=3D"mailto:sstabellini@kernel.org">sstabe=
llini@kernel.org</a>&gt; ha scritto: <br></div><blockquote class=3D"gmail_q=
uote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,2=
04);padding-left:1ex">
How do I access &quot;gl-code-quality-report.json&quot; or otherwise any ot=
her<br>
meaningful ECLAIR output? If I browse the job artifacts I see all the<br>
various logs but no gl-code-quality-report.json.<br></blockquote><div>=C2=
=A0</div><div>gl-code-quality-report.json is a GitLab-specific artifact tha=
t GitLab exploits</div><div>to provide some features called Code Quality (<=
a href=3D"https://docs.gitlab.com/ee/ci/testing/code_quality.html">https://=
docs.gitlab.com/ee/ci/testing/code_quality.html</a>).</div><div>The file is=
 not supposed to be used outside of the context of the Code Quality</div><d=
iv>features.</div><div><br></div><div>ECLAIR can produce stand-alone artifa=
cts in various formats and<br></div><div>we can decide to store some of the=
m in the job artifacts (see=C2=A0<div><a href=3D"https://www.bugseng.com/ec=
lair/reports">https://www.bugseng.com/eclair/reports</a> for an exhaustive =
list).</div></div><div><br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex">
Scrolling up from the bottom of the job console output I see:<br>
<br>
Browse analysis: <a href=3D"https://saas.eclairit.com:3787/fs/var/local/ecl=
air/xen-project.ecdf/xen-project/people/sstabellini/xen/ECLAIR_normal/ppp2/=
ARM64/4732041018/index.html" rel=3D"noreferrer" target=3D"_blank">https://s=
aas.eclairit.com:3787/fs/var/local/eclair/xen-project.ecdf/xen-project/peop=
le/sstabellini/xen/ECLAIR_normal/ppp2/ARM64/4732041018/index.html</a><br>
<br>
And if I click on the link, I can access a web interface with the<br>
results. Is that the intended way to access the job output?<br></blockquote=
><div><br></div><div>The link in the console is just a way to access the an=
alysis results. Typically the most</div><div>convenient one is the message =
written by the integration in the commit thread,</div><div>see here an exam=
ple: <a href=3D"https://eclairit.com:8444/swquality/eclair_demo/-/commit/0d=
312f8ebca6c4e98eabbeaf9b0fcb8b4a4344d9">https://eclairit.com:8444/swquality=
/eclair_demo/-/commit/0d312f8ebca6c4e98eabbeaf9b0fcb8b4a4344d9</a>.</div><d=
iv>To enable this feature you have to provide an impersonation token to the=
 integration,</div><div>you can find more information on the commit message=
.</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px=
 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
If so, would it be possible to print out the message &quot;Browse<br>
analysis:...&quot; as the very last message to make it easier to spot? Afte=
r<br>
it at the moment I can see:<br>
<br>
>From <a href=3D"https://gitlab.com:443/xen-project/xen" rel=3D"noreferrer" =
target=3D"_blank">https://gitlab.com:443/xen-project/xen</a><br>
=C2=A0* [new branch]=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 4.10.0-shim-c=
omet=C2=A0 =C2=A0-&gt; autoPRRemote/4.10.0-shim-comet<br>
=C2=A0[...]<br>
<br>
The long list of branch names hides the &quot;Browse analysis&quot; link.<b=
r>
<br></blockquote><div>Ok. I will try also to remove the warnings.<br></div>=
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
BTW I really like the graphics output, e.g.:<br>
<a href=3D"https://saas.eclairit.com:3787/fs/var/local/eclair/xen-project.e=
cdf/xen-project/people/sstabellini/xen/ECLAIR_normal/ppp2/ARM64/4732041018/=
PROJECT.ecd;/by_service.html#service/first_file&amp;kind" rel=3D"noreferrer=
" target=3D"_blank">https://saas.eclairit.com:3787/fs/var/local/eclair/xen-=
project.ecdf/xen-project/people/sstabellini/xen/ECLAIR_normal/ppp2/ARM64/47=
32041018/PROJECT.ecd;/by_service.html#service/first_file&amp;kind</a><br>
<br>
Very nice and clear!<br>
<br>
</blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre=
fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"l=
tr">Simone Ballarin, M.Sc.<br><br><div>Field Application Engineer, BUGSENG =
(<a href=3D"http://bugseng.com" target=3D"_blank">https://bugseng.com</a>)<=
/div></div></div></div>

--0000000000003c04c206015902f9--


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 00:57:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 00:57:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570007.891226 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOSqH-0001d3-TF; Wed, 26 Jul 2023 00:57:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570007.891226; Wed, 26 Jul 2023 00:57:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOSqH-0001cw-Pm; Wed, 26 Jul 2023 00:57:29 +0000
Received: by outflank-mailman (input) for mailman id 570007;
 Wed, 26 Jul 2023 00:57:28 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOSqG-0001ck-Jm; Wed, 26 Jul 2023 00:57:28 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOSqG-0002uD-Gk; Wed, 26 Jul 2023 00:57:28 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOSqG-0001AI-0l; Wed, 26 Jul 2023 00:57:28 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOSqG-0000fo-0G; Wed, 26 Jul 2023 00:57:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=d5IGnN41QRbS+nOBL3BTkiBXKydq5jMlBSPZy7txokY=; b=FPLN2K6B+vzX/dnzONwoFnvt6c
	LWEGezGvfsfAs0ZVn8sWbMi4VBxVqFifAmntRCHzU6YKVN1j5B3Zk+dCBoBFfdYasGbcBmLseyIsj
	G0/icXyJ52+W7wQnH7/NHUcvRJs+t94TSU6WgJwYbeH3S/C6gbA9gXWNOpsMtJJ2Ud5M=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182015-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 182015: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=1f8a6a99b225d34cf608f47b2938092e310f9e03
X-Osstest-Versions-That:
    xen=0b1171be87698bc7d14760383c0770aeb6e41dd4
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 26 Jul 2023 00:57:28 +0000

flight 182015 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182015/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  1f8a6a99b225d34cf608f47b2938092e310f9e03
baseline version:
 xen                  0b1171be87698bc7d14760383c0770aeb6e41dd4

Last test of basis   182009  2023-07-25 07:00:31 Z    0 days
Testing same since   182015  2023-07-25 22:02:06 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Federico Serafini <federico.serafini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Leo Yan <leo.yan@linaro.org>
  Nicola Vetrini <nicola.vetrini@bugseng.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   0b1171be87..1f8a6a99b2  1f8a6a99b225d34cf608f47b2938092e310f9e03 -> smoke


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 01:18:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 01:18:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570012.891236 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOTAN-0002U3-FY; Wed, 26 Jul 2023 01:18:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570012.891236; Wed, 26 Jul 2023 01:18:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOTAN-0002Tw-Cq; Wed, 26 Jul 2023 01:18:15 +0000
Received: by outflank-mailman (input) for mailman id 570012;
 Wed, 26 Jul 2023 01:18:14 +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
 <SRS0=ot2o=DM=epam.com=prvs=15712f9dd8=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qOTAM-0002Tq-Fp
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 01:18:14 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 47a4a0a0-2b52-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 03:18:09 +0200 (CEST)
Received: from pps.filterd (m0174680.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36PFb7rm015969; Wed, 26 Jul 2023 01:18:04 GMT
Received: from eur01-db5-obe.outbound.protection.outlook.com
 (mail-db5eur01lp2059.outbound.protection.outlook.com [104.47.2.59])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3s2cyajgbn-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Wed, 26 Jul 2023 01:18:03 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS2PR03MB8931.eurprd03.prod.outlook.com (2603:10a6:20b:5e4::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Wed, 26 Jul
 2023 01:17:59 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023
 01:17:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 47a4a0a0-2b52-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=kvGYdWVqaXNIqqDduQmkTY+tRzP7ZvGIAk6sOMclSCcJDQ3Tx+lhQFNdNzkHl/gRmZXkV+zVqgYZlzYj6KYXjtOJFPBvJh4MwykNZ8zsHhcNh1G4aqmaiTzT6lDx67mlbmAFnB3zPEArZcMiDvb5KRHnwgUofWmHLAJ6puauzeMrWNzXdNiTppS4lltE1cF4nTOnP1J0Qwzz12o22p1BwVtw0nVPHxww1lF0QpfwtQaz8qpU5LZg+7BXfz/4jwWbj2BW2ozm6atfkm7b2O5hmzh2DhpjSMO0QRlxSos3OX4Mp36sOh18mS6WEP61M8Hmkv+a4YtjkQJ6wa+NzwKT8A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=1wny++3Z+5dF2zHE07NGn++JV3fjfjds8cr0EYH+O24=;
 b=NT8QtnYTrh55NDUduA0TMX7+N64A5IOONMFVvksymwcNrcu/4n5omNvkwc2hmkV8LOvRHXZ/NLE1c0ytvZpRE2FyeNQa0124BluyyskqAeyChY6kj4vB8a9kLrkto1MP5H4fb1fOl76XWyOEkAryEZb/ZiKlFogqjp41Y/Em1w5HER3KfUE9UiceorVrDbSb84fNoeWFGZpyHnhxFnjKSFKw9MrmJo56BD/o302bnlVqyTqaBlQuYAJ3bP6SyKiWe8FHcepeKC6+HwTWlBdPnjvvIN3TPsXRg5MwvSmFyivTZhOKzNi9oNeKr+oaO87SeU4Dc4cbUSgwKLhWbufzyg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=1wny++3Z+5dF2zHE07NGn++JV3fjfjds8cr0EYH+O24=;
 b=V/plGfWoNgwus4x9eHTCC0XdugPRPTXB3/9GoELp3kb9aMc2fzs4AJ72gXMfQ02WyoggKSqtJDy9ZGMapqNXfstpZUjJMUVq000/3CPn1mbmoYRtm9Uy7LnNjOMgQlorHewLO8zJP3YN4tDXdeIClPrkX+lzLFqzpOHfkJ+JEdTdESkfxfBnQ8FRVbpWvtjPU/K5Se/miwd4qe9NZNIGcDPjFFee0NQvIaP2gTVDvhf5aLjSh4dgP0UrlWYDxdIfRe3WkTSe84BAMSVZ++qtUi5iBY1x5B8IYwYOWrw2GSTrLToQWuJpjugbD0FkriaiGT1H3b4N2CXxrSpZAsvybg==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
        Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
        Jan Beulich
	<jbeulich@suse.com>
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Thread-Topic: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Thread-Index: AQHZuqGrLMJPz1ipBEu4urExXp8yi6/CgxUAgAWEoIA=
Date: Wed, 26 Jul 2023 01:17:58 +0000
Message-ID: <87ila7cvy2.fsf@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local>
In-Reply-To: <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: mu4e 1.8.9; emacs 28.2
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS2PR03MB8931:EE_
x-ms-office365-filtering-correlation-id: e8013b9a-9ca7-4b3e-02bf-08db8d76262c
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 gIFFt1yrw0CVrdZU382iRzhM86v1xaPFSIqFxvJLTe3vYUhZ3KLHBe6ZCHsjLc3t9n1G9GAc86JYzIc6/xXavbNH26qAydug859fEDuxyq5ypRLE1ZMSzY7ANw9aEOkcfcqsy3pzdDcsh9aCV5f4vXYsWmo+CwRCmlJOV9aoqzyTCxUzCOM7+QaiuxOfRGibwc+MgWNF7+Bl4hLcqEXaqzT/XK86OBb39mBJPXYSOCYRTwiruqbK0RkttNyHgXVQcE/5OZQIv0BxBSub86Y4Xrigmq4Wf5LkwvI42aKKzm336Wn0J8nHwNolfdkDl3kzzqnL9uWStR6IvojG71XIRBnuqpS5s7bgifgfCB/K5fZmiPBtG43rFBH6u+uxKm+6N3wKVcUEJaDDBq8QZGOiDgiY7zm3J2V6chhM8AiZmkGvO40DbVeQj5LLpjGi898pkDZwQ/y28N7Vy15y7VktZY8YGU3g4K97+k1XSqIBfIdllrcXkzb7qJImxkcFT81z5x6yO0nvFHfJnvAx8Q3xdnkHCwe3t1dJVSCKqFAf3kN3mpwAC0sLMj2ufvCI8ibxVYmwpUxQBmccYnI7MbSLL6BB8ykXDDHTEgVwU1wIjsnIAy0p90BnNROpPl7SPlVQa5M9YeqtXMLS7DOr+wx1ew==
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(39860400002)(346002)(136003)(376002)(451199021)(122000001)(66946007)(64756008)(2616005)(83380400001)(66476007)(66446008)(6916009)(66556008)(4326008)(316002)(71200400001)(6512007)(6486002)(478600001)(54906003)(186003)(91956017)(26005)(55236004)(6506007)(2906002)(76116006)(30864003)(36756003)(38070700005)(86362001)(41300700001)(38100700002)(8676002)(5660300002)(8936002)(579004)(309714004);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?TFMrUEZFZU9TbXkxUUtpZjA0Q0Fia2VmR1pzUUhsbm5zODgwakJMbFJBcUhy?=
 =?utf-8?B?empnUHhyMUJxZHdndlVmdUJNZU93eG1JaHV6RGcxQTRhd1FoUGVIYmFQenRZ?=
 =?utf-8?B?V2VZWmhUUVIrRHJQWUgwd05Kc2JTKy9KM3lZTW1NSXUvZkNBNzg3d1Rka0hy?=
 =?utf-8?B?TmJOMGd1QzNDTW9rSzZvc0s1R0l6Q1JnckJOa3dEb0xvNUdMNTdCV2RMR0lX?=
 =?utf-8?B?SE5QeG5SYkhwZzUzR0IyQUhYVHN5Vzk1UWRDUU5xL3lPemFBcUpTT3N0ekNv?=
 =?utf-8?B?eXVpYnp1eCtwblIySkdvQWtld3F0ZitWcVBxWXJnQTJCZ0FKRklkWXJWSFFi?=
 =?utf-8?B?T25EcDJyRk52UG92MldTNDhsMzFCcXZXQzdlSlRWNmpTYWI5cEZEOVk0Wmxw?=
 =?utf-8?B?ZmEzYUU3MS9hRnNBSURtcTY2dk1wcUtVMVZQTUpiL1FIVzl2TFMwZVdXQWE5?=
 =?utf-8?B?ZFRTVWs1SUppeVlya09TdmIrNGxlcjZxMDhXeWxjYUI5TStuSitHQjkvbE9x?=
 =?utf-8?B?SE5uaUhWZ1pnKzR5c0w5bVJNdUthd3FyNXF4RGhsMUNmb0dXUGg3L2pBQXYz?=
 =?utf-8?B?aFJoTnM2YWxmS05WeXY0UGthczNjSkFTZGZ4YW03dDdHZmkvZW8yeFh0eVYy?=
 =?utf-8?B?Q05FMlJ0TUN1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=
 =?utf-8?B?YmJNRiswbDk1a28yS1VDTlRVOTJzdVlkSzJ4bTlCWFYyRTV5S20rRDZPYXR5?=
 =?utf-8?B?cWIzdVpuOTNJT294U0xRajF6MmVhWEx6ZEQydVFVdU5qK3cxeWY5dTJoVnNs?=
 =?utf-8?B?K1ZCZFZ2cVBYWFQ2b3dkMG14NHBMYTROZ2JuaGYvZnJyZ2hvMUJuT0ZoZTVx?=
 =?utf-8?B?QlpCUjVDbE84ZERiOVRFU1BZb1hTQnZzZFl5amY1T1QvWXhoVGNTVVU5VE5k?=
 =?utf-8?B?cVgwTmVRb0wwcmloTEc1WnR2d0FZZ2tkQzBHTEZGcmFObGEweER3VkdKMlRM?=
 =?utf-8?B?RjVlM2c4TmEzdmw1R25tVS96OU5iUitFRUY1bTliY25uOWdnSklrVVhVVXd3?=
 =?utf-8?B?a0lNaWdPSnNrb0RFbm5OWnYvclh3cmN3cnVBVkVWOGxCVHBudlQ1VjdJamdN?=
 =?utf-8?B?amFKZk1qZ0hGNzZCV1BVQW45Q0ZCaTBjdjZyL0QyVUMwL3J2VDRhdkJEUVFR?=
 =?utf-8?B?dUlLQ2c4V2t6N2JmNzhybVcyT0dWSGh0U0lBUHIxTUt1MTlVTjg0K3o2c0pO?=
 =?utf-8?B?bVo5T1YzNDI3WWF6M0hBakg2M2hyYlh0MkFJeFVUaTg5RGtwU0x1elpTR3Fz?=
 =?utf-8?B?bXc9PQ==?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <334F9A6A514D684BA3ECF4CA19D880C7@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e8013b9a-9ca7-4b3e-02bf-08db8d76262c
X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jul 2023 01:17:58.8600
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: txeIr4RqsYFjhZS0fPr2ECshBd6nlFoV8awboG0G0IO7ryj28HVLnI5/XO+3ptGckxhZTU2PdAWgwuWE0pKN/YxmtW2wCbvsPWHunMT7CnI=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB8931
X-Proofpoint-ORIG-GUID: pGoUGR6hArc6j32MRKmv5zajHf2EJ4O9
X-Proofpoint-GUID: pGoUGR6hArc6j32MRKmv5zajHf2EJ4O9
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-25_14,2023-07-25_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501
 lowpriorityscore=0 impostorscore=0 adultscore=0 phishscore=0 bulkscore=0
 malwarescore=0 mlxscore=0 spamscore=0 suspectscore=0 clxscore=1015
 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307260010

DQpIaSBSb2dlciwNCg0KUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+IHdy
aXRlczoNCg0KPiBPbiBUaHUsIEp1bCAyMCwgMjAyMyBhdCAxMjozMjozMUFNICswMDAwLCBWb2xv
ZHlteXIgQmFiY2h1ayB3cm90ZToNCj4+IEZyb206IE9sZWtzYW5kciBBbmRydXNoY2hlbmtvIDxv
bGVrc2FuZHJfYW5kcnVzaGNoZW5rb0BlcGFtLmNvbT4NCj4+IA0KPj4gVXNlIGEgcHJldmlvdXNs
eSBpbnRyb2R1Y2VkIHBlci1kb21haW4gcmVhZC93cml0ZSBsb2NrIHRvIGNoZWNr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ZWRpY2F0ZWQgbG9jayBm
b3IgTVNJIHJlbGF0ZWQgaGFuZGxpbmcsIGFzDQo+IHRoYXQncyB0aGUgb25seSBwbGFjZSB3aGVy
ZSBJIHRoaW5rIHdlIGhhdmUgdGhpcyBwYXR0ZXJuIG9mIHRha2luZyB0aGUNCj4gcGNpZGV2c19s
b2NrIGFmdGVyIHRoZSBkLT5wY2lfbG9jay4NCg0KSSdsbCBtZW50aW9uIHRoaXMgaW4gdGhlIGNv
bW1pdCBtZXNzYWdlLiBJcyB0aGVyZSBzb21ldGhpbmcgZWxzZSB0aGF0IEkNCnNob3VsZCBkbyBy
aWdodCBub3c/DQoNCi0tIA0KV0JSLCBWb2xvZHlteXI=


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 01:38:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 01:38:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570016.891246 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOTU9-000505-71; Wed, 26 Jul 2023 01:38:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570016.891246; Wed, 26 Jul 2023 01:38:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOTU9-0004zx-2j; Wed, 26 Jul 2023 01:38:41 +0000
Received: by outflank-mailman (input) for mailman id 570016;
 Wed, 26 Jul 2023 01:38:39 +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
 <SRS0=ot2o=DM=epam.com=prvs=15712f9dd8=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qOTU7-0004zr-FI
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 01:38:39 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 23684803-2b55-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 03:38:36 +0200 (CEST)
Received: from pps.filterd (m0174680.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36PFrCOE015982; Wed, 26 Jul 2023 01:38:34 GMT
Received: from eur01-he1-obe.outbound.protection.outlook.com
 (mail-he1eur01lp2055.outbound.protection.outlook.com [104.47.0.55])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3s2cyajhyu-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Wed, 26 Jul 2023 01:38:34 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by DU2PR03MB7911.eurprd03.prod.outlook.com (2603:10a6:10:2d6::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Wed, 26 Jul
 2023 01:38:31 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023
 01:38:30 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 23684803-2b55-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=i5zab0OABzXrO8RlA20lUUNuMJTYBHDN7pF0iIa0qeg0h9ar+fJTQLL+iQQHT+P0Te4TP8N+tdl+Qduz5iTQmOLQ2Ms/H+7PoqppKS0lNPHJI4fvKPyhREO3RuBg4L4AfMYkxZKg+mUX/6RX4T1KOR/5BMiO/DbMfUVWGDVk3SoB7NlWjssl8NgEbn8nIuPuxt8dGgjmljQ7bAQ1d+mH4vqHZ9qmcWzC99XJCJ6/EOe8688/fEMf+Ar2PrDmjrEfXuvownc55TIauWviu1WHLb8KGV3qh7RMCDhM90yEoWh4SdrmMPMgQN3cs1/SaZcTQBVk7MAuIwqtNR4ZQRhqCg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=wT0Xxc9bBT63t16BhROnt1FKdJVXGEf4DnaTiAMu6lk=;
 b=YVuGaStkGOc921aSMdpgDi3xIawZAeA3IyNDxZ4LVGC90DEsIOev/GHh798N7rpC5DLHLGV3CAImIuKwW2n8iFzWCA9a3uqVxGCEVhlbX3449jOhYG+F5qAuVcBQVhyiSPo9kgAiRg5TrgANAn8+OpU0iAoUQkMFeFIv1NooBujTC3IDuLrFQcaEFLT0Eic2vtaZYS6kceVYKUCODiPGfQzIeDGZh5tdqZyedud5n191AQ3QBW+EM1Fm/WBFHthy4yW2LcXw85+yk5f3cBXmL+/41zeD56WBKjg1HMIzfIlhPbK74dFI9vT/H+UvZkkYWJDIgnaYZJ5WZCWggVjHRQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=wT0Xxc9bBT63t16BhROnt1FKdJVXGEf4DnaTiAMu6lk=;
 b=esLFKy1UntXsexI4xP2oLeqeLw0jXCLYVgkjUxFwjjSm5KTBGx1hM8nNYQTOGewLGNg4S5AZgsZrVPC8N6aU+gJlTGuDILni/Vr39BOXJVNfWDCydasaG49OQ2VzsHi9XCVpLfqLN2dmg9Iv5doCG/jArC1nnyUYZao89hz8dGeCZqnR9hJkPeIxqHmwfXyutOxiW+jkOVDXx1CJibAirLFUgIQz7Gq3RovPQIi2Odn/ByQm5t7wGS+QPKBUazqofqXIuHMluetKo5Nl5u20qK5wM5U/QkgdeNftVv9TIUtq6yEre5trfWkNXfvnJFDox0PH6WttAoF8DjmHsao3SA==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
        Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH v8 04/13] vpci: add hooks for PCI device assign/de-assign
Thread-Topic: [PATCH v8 04/13] vpci: add hooks for PCI device assign/de-assign
Thread-Index: AQHZuqGrBGIo4QxjlkuKy7Wb3D/bwa/CmGeAgAizHoA=
Date: Wed, 26 Jul 2023 01:38:30 +0000
Message-ID: <875y67cuzu.fsf@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-5-volodymyr_babchuk@epam.com>
 <ZLkqWXJtYlsJ4M61@MacBook-Air-de-Roger.local>
In-Reply-To: <ZLkqWXJtYlsJ4M61@MacBook-Air-de-Roger.local>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: mu4e 1.8.9; emacs 28.2
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|DU2PR03MB7911:EE_
x-ms-office365-filtering-correlation-id: 2779397f-896c-47d2-f7b8-08db8d790460
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 lr1DeucuiOvRBwFsrp4d6fdlymk1BFaalPp6DMKzYida5uyjDS5X++pSVm34t2Gflv2pccEOere25x9Cq/4BMVVGWLlLWJX9hC8rUKqylt+rF0ZjsaeTxntAXMOzrXSuN8EwgDzrFFS1VnysoHuz/ywLHKmIFxVfKTIk1zrmkmhC9bhOcYa1otbo6D2TOOVd3BZ3vgFmpZ7hZFiD/Rz4FAsYKHpfDfr7xomCuZfom+CnrmQ8imju9vnZnOcMKUHUigihw7hk6RKRrzpIXQHWo1+Km7hEG++WM3q8YEXfXUjUi6WZP+WY1vtsCh2lXBf+Ng4fS/gGHQ7IwZulafuWnTE1In55gsu6/Z9ZxO9MKxAXDeuY8r1tzOLalrCVtOyigWrG9/dkTYyZDTb39rfycNZfc0m0dATLnOCLEM9fCWQsIkc3u2DkdZUh6zAaIin8x1P3oAp41W82RWc0pIeonxAE8vtt+aJEu3NV+tWgEJ2QizLo4leJ9xnxwoWjhI9i2jjBkNUIZf2p0PsF0pXDX3VuHeMdXK3XQ7x/bUoOPI2hNNIcFmdHwW3CQe8HDTaO9frIX3Rw1Kp7DfEt7B8R3jb/kd+rwyhK7sxhbV5YPxMWno7tlC52dinS0GWLnwQa
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(396003)(366004)(39860400002)(346002)(451199021)(66946007)(54906003)(6512007)(71200400001)(122000001)(6486002)(38100700002)(478600001)(41300700001)(4326008)(8676002)(5660300002)(66556008)(66446008)(66476007)(64756008)(76116006)(91956017)(316002)(6916009)(8936002)(2616005)(186003)(83380400001)(107886003)(55236004)(26005)(6506007)(86362001)(36756003)(38070700005)(2906002);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?R1NFNkM0cU9lZnZyUWl3VHNsc2k5dVlZVm5XMUhKODVTdHJkT0NKMlRWZnpm?=
 =?utf-8?B?R1IxK3dPeitXNFNHM3ZzRldaUEU2NkNWVktDejVySzhzekJCUnVoSWhjdHdM?=
 =?utf-8?B?cWpkRWY4VUxmNFFidk9jSHFUd2toQmtmUldGd0xuM2pxVUE1UjVXNng5cmRF?=
 =?utf-8?B?N21VU3lnQVRXS3BadmdzMFBrOXhESm8rZ3Y4VzZGR0tYSDk3R3dGbURLZG4x?=
 =?utf-8?B?WDMwdkxyV0Z5VHVzUFg0VzFxUjBBZVljYWNjMCs1Z2VnOE9RamxXNEk2RjBq?=
 =?utf-8?B?QXdjS0t6RVFEWDZOV2c5c01QT253NmdDQ2laNHFnSkpBWW8yZUh1T3RsK0Vn?=
 =?utf-8?B?REU3eFlYYitENEF1QmxJT1JiOVduY2lnZEUzbXk4cTlVdXRUWGtWY292dlVk?=
 =?utf-8?B?RTdINU14cmVkSFhEU3pyZUdTcVF4cmIxT3FSSUxvb2RkWmxaa1FmT0Jlb1lo?=
 =?utf-8?B?WDhjN01pQVVmTmZjWEFTbCs1cUdzbFBWeWU3ZUxzOTRKbEpJUng4ekRTaGpY?=
 =?utf-8?B?MUx5Qjg3ZFF5NmV5K3loTHBnL3FFOWlhaVBOT29DMXNTOVZISFFZQXVNWVJ2?=
 =?utf-8?B?Wi9tZjVqcm8wU3djWG9XV1dTZjJt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Y4NFo2M29n?=
 =?utf-8?B?NFpLMXJsd1E2ZjNvQU01SlB2b3Bic3ByRFZjY1YvZzNJL250SU9raG5nbVBG?=
 =?utf-8?B?aHJLK2d1TDRmd1h0Q21pbjdDRWkvTmJybmVIbHp3ZEwzK3U3alhuZTlhS0FR?=
 =?utf-8?B?aUt0R0tkdVVZQ1dTYUQ2QVNLL0xyZ1l0UGZwK0E0aUJPVW9jaE93YjNXNitV?=
 =?utf-8?B?dXRENkVzZVBCdlIra0p2RTV3RFoyUDREcnNSQit0M3BrZ2xMa0o1SStrajV5?=
 =?utf-8?B?NEVJdkdrVlNPblRGUFJoY2M3UXJEMkRuRURMQ1NGMDhyajVQVVhINSt2eVE4?=
 =?utf-8?B?Sm9lVmhrZE1Yc3JQRUYwa28yOWRvMGNUUVN0QUxSU0hZTHlxTlRWRnZqVjdJ?=
 =?utf-8?B?QWRraEhYbW9TVDVlbVFUWWdXNmVLNVFXMERmdGJNWkZTZlUyUlJSK1Y4eFp6?=
 =?utf-8?B?d3dqUWRIZ3Z3TFVJQ3pJSjI4YS8wb2FsaVhUcDJMWGx2SHB6ajBTYU1aeVdU?=
 =?utf-8?B?b082OXlmQ1B2cEtGcGxFWHhhSlZkV2htakdoKzNXZFYraE9KUUh2a3pacXc1?=
 =?utf-8?B?QkpDcVhNbHpnV0U3M0NDb3Z4V1BwcC9heGdHSEpkeUM3STRVL3ZNZmpsOWNh?=
 =?utf-8?B?SkZUQVdUZzVIaExZSjVKTE4rS2FtUEMxWTB1bDRXVjI4UkdTSGtBb2ViN2V2?=
 =?utf-8?B?aHc9PQ==?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <A4BD6D6EBC07C44591668F798CD782FE@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2779397f-896c-47d2-f7b8-08db8d790460
X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jul 2023 01:38:30.6590
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: HL306N/Dffw/lGR3Y0v34a4/g8BcxYmJg1Lk/T1P5yfkIzO/lGNe/FA/oYJQS2zqwJZXMLjO3vgdcw+s5k+cpoxdCLxt8zcFjAS9A/TFRH0=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR03MB7911
X-Proofpoint-ORIG-GUID: 2oMF9KW8dz_sSj4Js_0Kt7ZGMxFS0Rrq
X-Proofpoint-GUID: 2oMF9KW8dz_sSj4Js_0Kt7ZGMxFS0Rrq
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-25_14,2023-07-25_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501
 lowpriorityscore=0 impostorscore=0 adultscore=0 phishscore=0 bulkscore=0
 malwarescore=0 mlxscore=0 spamscore=0 suspectscore=0 clxscore=1015
 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307260013

DQpIaSBSb2dlciwNCg0KUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+IHdy
aXRlczoNCg0KPiBPbiBUaHUsIEp1bCAyMCwgMjAyMyBhdCAxMjozMjozMUFNICswMDAwLCBWb2xv
ZHlteXIgQmFiY2h1ayB3cm90ZToNCj4+IEZyb206IE9sZWtzYW5kciBBbmRydXNoY2hlbmtvIDxv
bGVrc2FuZHJfYW5kcnVzaGNoZW5rb0BlcGFtLmN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ZGV2aWNlIHZwY2lfcmVtb3ZlX2RldmljZQ0KPj4gKyNlbHNlDQo+PiArc3RhdGljIGlubGlu
ZSBpbnQgdnBjaV9hc3NpZ25fZGV2aWNlKHN0cnVjdCBwY2lfZGV2ICpwZGV2KQ0KPj4gK3sNCj4+
ICsgICAgcmV0dXJuIDA7DQo+PiArfTsNCj4+ICsNCj4+ICtzdGF0aWMgaW5saW5lIHZvaWQgdnBj
aV9kZWFzc2lnbl9kZXZpY2Uoc3RydWN0IHBjaV9kZXYgKnBkZXYpDQo+PiArew0KPj4gK307DQo+
PiArI2VuZGlmDQo+DQo+IEkgZG9uJ3QgdGhpbmsgdGhlcmUncyBtdWNoIHBvaW50IGluIGludHJv
ZHVjaW5nIG5ldyBmdW5jdGlvbnMsIHNlZQ0KPiBhYm92ZS4gIEknbSBmaW5lIGlmIHRoZSBjdXJy
ZW50IG9uZXMgd2FudCB0byBiZSByZW5hbWVkIHRvDQo+IHZwY2lfeyxkZX1hc3NpZ25fZGV2aWNl
KCksIGJ1dCBhZGRpbmcgZGVmaW5lcyBsaWtlIHRoZSBhYm92ZSBqdXN0DQo+IG1ha2VzIHRoZSBj
b2RlIGhhcmRlciB0byBmb2xsb3cuDQoNCkdvb2QgaWRlYSwgdGhhbmtzLCBJJ2xsIGp1c3QgcmVu
YW1lIHRoZSBvcmlnaW5hbCBmdW5jdGlvbnMuDQoNCi0tIA0KV0JSLCBWb2xvZHlteXI=


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 02:09:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 02:09:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570019.891256 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOTxO-0000LQ-Ex; Wed, 26 Jul 2023 02:08:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570019.891256; Wed, 26 Jul 2023 02:08:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOTxO-0000LJ-Bj; Wed, 26 Jul 2023 02:08:54 +0000
Received: by outflank-mailman (input) for mailman id 570019;
 Wed, 26 Jul 2023 02:08:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOTxN-0000L9-31; Wed, 26 Jul 2023 02:08:53 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOTxM-0003CQ-Vg; Wed, 26 Jul 2023 02:08:53 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOTxM-0004pJ-Dq; Wed, 26 Jul 2023 02:08:52 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOTxM-0006zW-BI; Wed, 26 Jul 2023 02:08:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=4NmOv/PMO3Aa/toScsX2rVJDXqZjm6RPkP57i3GFZ4o=; b=5+Ikf5AyRpWIEjzht5NQk39RLg
	e3uVtfjPL+jOl5tmSB2R82A5Cs685GuVNOcLspMlGUY+CXIn9Qi7Vj26X9mB9gXDzOjwCsBS2fQzo
	DaraMi2O/QpDRv62Jc/2QyGGaY3lD7Cm1C2phONvXnubRZL31CwMicYcZfQZ9zdZGVM0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-181998-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.16-testing test] 181998: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-4.16-testing:test-amd64-i386-freebsd10-amd64:guest-localmigrate/x10:fail:heisenbug
    xen-4.16-testing:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=82c5ab6be04a1f5544e38ed5198e79b91cecac45
X-Osstest-Versions-That:
    xen=78f53920f406fe973bb70011ae36d6a53abf6942
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 26 Jul 2023 02:08:52 +0000

flight 181998 xen-4.16-testing real [real]
flight 182017 xen-4.16-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/181998/
http://logs.test-lab.xenproject.org/osstest/logs/182017/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-freebsd10-amd64 19 guest-localmigrate/x10 fail pass in 182017-retest

Tests which did not succeed, but are not blocking:
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop       fail blocked in 181882
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181882
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181882
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181882
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181882
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181882
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181882
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181882
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181882
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt   16 saverestore-support-check fail starved in 181882
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check fail starved in 181882
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail starved in 181882

version targeted for testing:
 xen                  82c5ab6be04a1f5544e38ed5198e79b91cecac45
baseline version:
 xen                  78f53920f406fe973bb70011ae36d6a53abf6942

Last test of basis   181882  2023-07-18 14:43:22 Z    7 days
Testing same since   181998  2023-07-24 16:37:44 Z    1 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              fail    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   78f53920f4..82c5ab6be0  82c5ab6be04a1f5544e38ed5198e79b91cecac45 -> stable-4.16


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 05:06:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 05:06:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570032.891270 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOWjE-00027b-N4; Wed, 26 Jul 2023 05:06:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570032.891270; Wed, 26 Jul 2023 05:06:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOWjE-00027U-KK; Wed, 26 Jul 2023 05:06:28 +0000
Received: by outflank-mailman (input) for mailman id 570032;
 Wed, 26 Jul 2023 05:06:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4FIp=DM=chromium.org=keescook@srs-se1.protection.inumbo.net>)
 id 1qOWjD-00027O-6k
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 05:06:27 +0000
Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com
 [2607:f8b0:4864:20::12c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2b28e3e9-2b72-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 07:06:25 +0200 (CEST)
Received: by mail-il1-x12c.google.com with SMTP id
 e9e14a558f8ab-345ff33d286so34974825ab.3
 for <xen-devel@lists.xenproject.org>; Tue, 25 Jul 2023 22:06:25 -0700 (PDT)
Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net.
 [198.0.35.241]) by smtp.gmail.com with ESMTPSA id
 r6-20020a17090b050600b00263f8915aa3sm403053pjz.31.2023.07.25.22.06.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 25 Jul 2023 22:06:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2b28e3e9-2b72-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=chromium.org; s=google; t=1690347984; x=1690952784;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date:from:to
         :cc:subject:date:message-id:reply-to;
        bh=tmGKZXvFDMSt/MQnC/Qf6RLrkBNfiFOMqTa3/cRFfBM=;
        b=HpM5yG4cPMOI4g7J2ML/wywtLhXSPDcIw27EgNoR1eaysHRUghNsQa1CVFyuUAEwvX
         fWzJS0hFXHrT3G/o0mvvVC85Jp9vP4G7bIpjK2DZWWR/bt8fxMCqC6qyqurnpwNOfrRa
         8GSF5BlhNkJtAEhz1qKUhP1S+H1rss0XFCMlk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690347984; x=1690952784;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=tmGKZXvFDMSt/MQnC/Qf6RLrkBNfiFOMqTa3/cRFfBM=;
        b=IES5/CAO5Sf+eADW6fKkvK/WrfF4SU3hAmRqgSwcOhIy0DwBJcBudnbz0UrKsEchGN
         23YhrzYHtp+UBYAM3kaUgcbtcsPxY4DD6EJZRuuhFRWXMZ/fgnX0Ru+O2GG/Xh3JGu/g
         qIrzHvHdZPGCmfFOv8Vjov9l5pw3g3Ba4w9mdJeXJciBOA6n7IhwnpJ9aTdA4gNBOrYK
         EuoQjBEt7b9Agy4b9S2E/AdVYQR/Wg9PBK8cZ4nQHl0B5ngxCSu0f82Zl1KL3OnPtTiN
         yVQ8M9c8p+3Wyvej9ZcrfS/5h6Y7INAhAXWhP/X6efafsRguUBjk8gpN6Bt2eRGuP55T
         XzhA==
X-Gm-Message-State: ABy/qLaCzYKZZ0m4a+oHZ1Pl08s+tgRgc8r3rafJ8xtBJQlfLz1rwBBk
	fRiQWMnLvQKLLAJqYrw6RYMTUQ==
X-Google-Smtp-Source: APBJJlExucCvHwFwC28cPUJygH09CZyu73vKbLqvGtjOqjwXWWyODHqB7sygcwh6Ce//CESFn54lfg==
X-Received: by 2002:a05:6e02:ed0:b0:345:d470:baa6 with SMTP id i16-20020a056e020ed000b00345d470baa6mr1023335ilk.29.1690347983818;
        Tue, 25 Jul 2023 22:06:23 -0700 (PDT)
Date: Tue, 25 Jul 2023 22:06:22 -0700
From: Kees Cook <keescook@chromium.org>
To: Juergen Gross <jgross@suse.com>
Cc: Nathan Chancellor <nathan@kernel.org>,
	Bagas Sanjaya <bagasdotme@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	"David S. Miller" <davem@davemloft.net>,
	sander44 <ionut_n2001@yahoo.com>,
	Linux Xen <xen-devel@lists.xenproject.org>,
	Linux BPF <bpf@vger.kernel.org>,
	Linux Networking <netdev@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Regressions <regressions@lists.linux.dev>,
	gustavoars@kernel.org
Subject: Re: Fwd: UBSAN: index 1 is out of range for type
 'xen_netif_rx_sring_entry [1]'
Message-ID: <202307252204.09AC0089@keescook>
References: <7e3841ce-011d-5ba6-9dae-7b14e07b5c4b@gmail.com>
 <20230723000657.GA878540@dev-arch.thelio-3990X>
 <e208365f-dbc6-06d1-ccc9-3b2e945a0bff@suse.com>
 <73019154-6a34-f714-96b5-b43038569feb@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <73019154-6a34-f714-96b5-b43038569feb@suse.com>

On Tue, Jul 25, 2023 at 03:34:26PM +0200, Juergen Gross wrote:
> On 25.07.23 15:24, Juergen Gross wrote:
> > On 23.07.23 02:06, Nathan Chancellor wrote:
> > > On Sat, Jul 22, 2023 at 07:21:05AM +0700, Bagas Sanjaya wrote:
> > > > Hi,
> > > > 
> > > > I notice a regression report on Bugzilla [1]. Quoting from it:
> > > > 
> > > > > Hi Kernel Team,
> > > > > 
> > > > > I rebuild today latest version from mainline repo.
> > > > > And i notice issue regarding xen-netfront.c.
> > > > > 
> > > > > Error:
> > > > > [    3.477400] ================================================================================
> > > > > [    3.477633] UBSAN: array-index-out-of-bounds in
> > > > > drivers/net/xen-netfront.c:1291:3
> > > > > [    3.477858] index 1 is out of range for type 'xen_netif_rx_sring_entry [1]'
> > > > > [    3.478085] CPU: 0 PID: 700 Comm: NetworkManager Not
> > > > > tainted 6.5.0-rc2-1-generation1 #3
> > > > > [    3.478088] Hardware name: Intel Corporation
> > > > > W2600CR/W2600CR, BIOS SE5C600.86B.02.06.0007.082420181029
> > > > > 01/13/2022
> > > > > [    3.478090] Call Trace:
> > > > > [    3.478092]  <IRQ>
> > > > > [    3.478097]  dump_stack_lvl+0x48/0x70
> > > > > [    3.478105]  dump_stack+0x10/0x20
> > > > > [    3.478107]  __ubsan_handle_out_of_bounds+0xc6/0x110
> > > > > [    3.478114]  xennet_poll+0xa94/0xac0
> > > > > [    3.478118]  ? generic_smp_call_function_single_interrupt+0x13/0x20
> > > > > [    3.478125]  __napi_poll+0x33/0x200
> > > > > [    3.478131]  net_rx_action+0x181/0x2e0
> > > > > [    3.478135]  __do_softirq+0xd9/0x346
> > > > > [    3.478139]  do_softirq.part.0+0x41/0x80
> > > > > [    3.478144]  </IRQ>
> > > > > [    3.478145]  <TASK>
> > > > > [    3.478146]  __local_bh_enable_ip+0x72/0x80
> > > > > [    3.478149]  _raw_spin_unlock_bh+0x1d/0x30
> > > > > [    3.478151]  xennet_open+0x75/0x160
> > > > > [    3.478154]  __dev_open+0x105/0x1d0
> > > > > [    3.478156]  __dev_change_flags+0x1b5/0x230
> > > > > [    3.478158]  dev_change_flags+0x27/0x80
> > > > > [    3.478160]  do_setlink+0x3d2/0x12b0
> > > > > [    3.478164]  ? __nla_validate_parse+0x5b/0xdb0
> > > > > [    3.478169]  __rtnl_newlink+0x6f6/0xb10
> > > > > [    3.478173]  ? rtnl_newlink+0x2f/0x80
> > > > > [    3.478177]  rtnl_newlink+0x48/0x80
> > > > > [    3.478180]  rtnetlink_rcv_msg+0x170/0x430
> > > > > [    3.478183]  ? fib6_clean_node+0xad/0x190
> > > > > [    3.478188]  ? __pfx_rtnetlink_rcv_msg+0x10/0x10
> > > > > [    3.478191]  netlink_rcv_skb+0x5d/0x110
> > > > > [    3.478195]  rtnetlink_rcv+0x15/0x30
> > > > > [    3.478198]  netlink_unicast+0x247/0x390
> > > > > [    3.478200]  netlink_sendmsg+0x25e/0x4e0
> > > > > [    3.478202]  sock_sendmsg+0xaf/0xc0
> > > > > [    3.478204]  ____sys_sendmsg+0x2a9/0x350
> > > > > [    3.478206]  ___sys_sendmsg+0x9a/0xf0
> > > > > [    3.478212]  ? _copy_from_iter+0x80/0x4a0
> > > > > [    3.478217]  __sys_sendmsg+0x89/0xf0
> > > > > [    3.478220]  __x64_sys_sendmsg+0x1d/0x30
> > > > > [    3.478222]  do_syscall_64+0x5c/0x90
> > > > > [    3.478226]  ? do_syscall_64+0x68/0x90
> > > > > [    3.478228]  ? ksys_write+0xe6/0x100
> > > > > [    3.478232]  ? exit_to_user_mode_prepare+0x49/0x220
> > > > > [    3.478236]  ? syscall_exit_to_user_mode+0x1b/0x50
> > > > > [    3.478240]  ? do_syscall_64+0x68/0x90
> > > > > [    3.478242]  ? do_syscall_64+0x68/0x90
> > > > > [    3.478243]  ? irqentry_exit_to_user_mode+0x9/0x30
> > > > > [    3.478246]  ? irqentry_exit+0x43/0x50
> > > > > [    3.478248]  ? sysvec_xen_hvm_callback+0x4b/0xd0
> > > > > [    3.478250]  entry_SYSCALL_64_after_hwframe+0x6e/0xd8
> > > > > [    3.478253] RIP: 0033:0x7f973c244e4d
> > > > > [    3.478268] Code: 28 89 54 24 1c 48 89 74 24 10 89 7c 24
> > > > > 08 e8 ca ee ff ff 8b 54 24 1c 48 8b 74 24 10 41 89 c0 8b 7c
> > > > > 24 08 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 33 44 89
> > > > > c7 48 89 44 24 08 e8 fe ee ff ff 48
> > > > > [    3.478270] RSP: 002b:00007fff4777f470 EFLAGS: 00000293
> > > > > ORIG_RAX: 000000000000002e
> > > > > [    3.478273] RAX: ffffffffffffffda RBX: 00005583087c6480
> > > > > RCX: 00007f973c244e4d
> > > > > [    3.478274] RDX: 0000000000000000 RSI: 00007fff4777f4c0
> > > > > RDI: 000000000000000c
> > > > > [    3.478276] RBP: 00007fff4777f4c0 R08: 0000000000000000
> > > > > R09: 0000000000000000
> > > > > [    3.478277] R10: 0000000000000000 R11: 0000000000000293
> > > > > R12: 00005583087c6480
> > > > > [    3.478279] R13: 00007fff4777f668 R14: 00007fff4777f65c
> > > > > R15: 0000000000000000
> > > > > [    3.478283]  </TASK>
> > > > > [    3.478284] ================================================================================
> > > > > [    3.685513] ================================================================================
> > > > > [    3.685751] UBSAN: array-index-out-of-bounds in
> > > > > drivers/net/xen-netfront.c:485:7
> > > > > [    3.686111] index 1 is out of range for type 'xen_netif_tx_sring_entry [1]'
> > > > > [    3.686379] CPU: 1 PID: 697 Comm: avahi-daemon Not
> > > > > tainted 6.5.0-rc2-1-generation1 #3
> > > > > [    3.686381] Hardware name: Intel Corporation
> > > > > W2600CR/W2600CR, BIOS SE5C600.86B.02.06.0007.082420181029
> > > > > 01/13/2022
> > > > > [    3.686385] Call Trace:
> > > > > [    3.686388]  <TASK>
> > > > > [    3.686391]  dump_stack_lvl+0x48/0x70
> > > > > [    3.686399]  dump_stack+0x10/0x20
> > > > > [    3.686399]  __ubsan_handle_out_of_bounds+0xc6/0x110
> > > > > [    3.686403]  xennet_tx_setup_grant+0x1f7/0x230
> > > > > [    3.686403]  ? __pfx_xennet_tx_setup_grant+0x10/0x10
> > > > > [    3.686403]  gnttab_foreach_grant_in_range+0x5c/0x100
> > > > > [    3.686415]  xennet_start_xmit+0x428/0x990
> > > > > [    3.686415]  ? kmem_cache_alloc_node+0x1b1/0x3b0
> > > > > [    3.686415]  dev_hard_start_xmit+0x68/0x1e0
> > > > > [    3.686415]  sch_direct_xmit+0x10b/0x350
> > > > > [    3.686415]  __dev_queue_xmit+0x512/0xda0
> > > > > [    3.686439]  ? ___neigh_create+0x6cb/0x970
> > > > > [    3.686439]  neigh_resolve_output+0x118/0x1e0
> > > > > [    3.686446]  ip_finish_output2+0x181/0x540
> > > > > [    3.686450]  ? netif_rx_internal+0x46/0x140
> > > > > [    3.686456]  __ip_finish_output+0xb6/0x180
> > > > > [    3.686456]  ? dev_loopback_xmit+0x86/0x110
> > > > > [    3.686456]  ip_finish_output+0x29/0x100
> > > > > [    3.686456]  ip_mc_output+0x95/0x2e0
> > > > > [    3.686456]  ? __pfx_ip_finish_output+0x10/0x10
> > > > > [    3.686456]  ip_send_skb+0x9f/0xb0
> > > > > [    3.686456]  udp_send_skb+0x158/0x380
> > > > > [    3.686475]  udp_sendmsg+0xb84/0xf20
> > > > > [    3.686475]  ? do_sys_poll+0x3a1/0x5f0
> > > > > [    3.686483]  ? __pfx_ip_generic_getfrag+0x10/0x10
> > > > > [    3.686483]  inet_sendmsg+0x76/0x80
> > > > > [    3.686483]  ? inet_sendmsg+0x76/0x80
> > > > > [    3.686483]  sock_sendmsg+0xa8/0xc0
> > > > > [    3.686483]  ? _copy_from_user+0x30/0xa0
> > > > > [    3.686483]  ____sys_sendmsg+0x2a9/0x350
> > > > > [    3.686483]  ___sys_sendmsg+0x9a/0xf0
> > > > > [    3.686483]  __sys_sendmsg+0x89/0xf0
> > > > > [    3.686483]  __x64_sys_sendmsg+0x1d/0x30
> > > > > [    3.686483]  do_syscall_64+0x5c/0x90
> > > > > [    3.686483]  ? exit_to_user_mode_prepare+0x49/0x220
> > > > > [    3.686483]  ? syscall_exit_to_user_mode+0x1b/0x50
> > > > > [    3.686483]  ? do_syscall_64+0x68/0x90
> > > > > [    3.686483]  ? syscall_exit_to_user_mode+0x1b/0x50
> > > > > [    3.686483]  ? do_syscall_64+0x68/0x90
> > > > > [    3.686483]  entry_SYSCALL_64_after_hwframe+0x6e/0xd8
> > > > > [    3.686483] RIP: 0033:0x7ff365942e13
> > > > > [    3.686483] Code: 8b 15 b9 a1 00 00 f7 d8 64 89 02 48 c7
> > > > > c0 ff ff ff ff eb b8 0f 1f 00 64 8b 04 25 18 00 00 00 85 c0
> > > > > 75 14 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 55 c3 0f
> > > > > 1f 40 00 48 83 ec 28 89 54 24 1c 48
> > > > > [    3.686483] RSP: 002b:00007ffc7bf1ca78 EFLAGS: 00000246
> > > > > ORIG_RAX: 000000000000002e
> > > > > [    3.686483] RAX: ffffffffffffffda RBX: 00005596bd24c900
> > > > > RCX: 00007ff365942e13
> > > > > [    3.686483] RDX: 0000000000000000 RSI: 00007ffc7bf1cb30
> > > > > RDI: 000000000000000c
> > > > > [    3.686483] RBP: 000000000000000c R08: 0000000000000004
> > > > > R09: 0000000000000019
> > > > > [    3.686483] R10: 00007ff365a1ca94 R11: 0000000000000246
> > > > > R12: 00007ffc7bf1cb30
> > > > > [    3.686483] R13: 0000000000000002 R14: 00005596bd235f9c
> > > > > R15: 0000000000000000
> > > > > [    3.686483]  </TASK>
> > > > > [    3.686483] ================================================================================
> > > > > [    3.686858] ================================================================================
> > > > > [    3.687190] UBSAN: array-index-out-of-bounds in
> > > > > drivers/net/xen-netfront.c:413:4
> > > > > [    3.687501] index 1 is out of range for type 'xen_netif_tx_sring_entry [1]'
> > > > > [    3.687800] CPU: 18 PID: 0 Comm: swapper/18 Not tainted
> > > > > 6.5.0-rc2-1-generation1 #3
> > > > > [    3.687804] Hardware name: Intel Corporation
> > > > > W2600CR/W2600CR, BIOS SE5C600.86B.02.06.0007.082420181029
> > > > > 01/13/2022
> > > > > [    3.687806] Call Trace:
> > > > > [    3.687808]  <IRQ>
> > > > > [    3.687812]  dump_stack_lvl+0x48/0x70
> > > > > [    3.687819]  dump_stack+0x10/0x20
> > > > > [    3.687821]  __ubsan_handle_out_of_bounds+0xc6/0x110
> > > > > [    3.687827]  xennet_tx_buf_gc+0x34a/0x440
> > > > > [    3.687831]  xennet_handle_tx.constprop.0+0x49/0x90
> > > > > [    3.687834]  xennet_tx_interrupt+0x32/0x70
> > > > > [    3.687837]  __handle_irq_event_percpu+0x4f/0x1b0
> > > > > [    3.687842]  handle_irq_event+0x39/0x80
> > > > > [    3.687846]  handle_edge_irq+0x8c/0x230
> > > > > [    3.687849]  handle_irq_desc+0x40/0x60
> > > > > [    3.687851]  generic_handle_irq+0x1f/0x30
> > > > > [    3.687854]  handle_irq_for_port+0x8e/0x180
> > > > > [    3.687858]  ? _raw_spin_unlock_irqrestore+0x11/0x60
> > > > > [    3.687861]  __evtchn_fifo_handle_events+0x221/0x330
> > > > > [    3.687866]  evtchn_fifo_handle_events+0xe/0x20
> > > > > [    3.687869]  __xen_evtchn_do_upcall+0x72/0xd0
> > > > > [    3.687873]  xen_hvm_evtchn_do_upcall+0xe/0x20
> > > > > [    3.687876]  __sysvec_xen_hvm_callback+0x53/0x70
> > > > > [    3.687880]  sysvec_xen_hvm_callback+0x8d/0xd0
> > > > > [    3.687884]  </IRQ>
> > > > > [    3.687885]  <TASK>
> > > > > [    3.687886]  asm_sysvec_xen_hvm_callback+0x1b/0x20
> > > > > [    3.687891] RIP: 0010:pv_native_safe_halt+0xb/0x10
> > > > > [    3.687896] Code: 0b 66 66 2e 0f 1f 84 00 00 00 00 00 0f
> > > > > 1f 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 eb 07
> > > > > 0f 00 2d 49 cc 33 00 fb f4 <c3> cc cc cc cc 90 90 90 90 90
> > > > > 90 90 90 90 90 90 90 90 90 90 90 55
> > > > > [    3.687898] RSP: 0000:ffffad85c0147e08 EFLAGS: 00000246
> > > > > [    3.687901] RAX: ffffffffa00d39a0 RBX: 0000000000000002
> > > > > RCX: 0000000000000000
> > > > > [    3.687902] RDX: 0000000000000002 RSI: ffffffffa14d28e0
> > > > > RDI: ffff920446abda00
> > > > > [    3.687904] RBP: ffffad85c0147e18 R08: 0000000000000000
> > > > > R09: 0000000000000000
> > > > > [    3.687905] R10: 0000000000000000 R11: 0000000000000000
> > > > > R12: 0000000000000002
> > > > > [    3.687906] R13: 0000000000000002 R14: 0000000000000002
> > > > > R15: ffffffffa14d29c8
> > > > > [    3.687909]  ? __pfx_intel_idle_hlt+0x10/0x10
> > > > > [    3.687913]  ? intel_idle_hlt+0xc/0x40
> > > > > [    3.687916]  cpuidle_enter_state+0xa0/0x730
> > > > > [    3.687920]  cpuidle_enter+0x2e/0x50
> > > > > [    3.687924]  call_cpuidle+0x23/0x60
> > > > > [    3.687928]  do_idle+0x207/0x260
> > > > > [    3.687932]  cpu_startup_entry+0x1d/0x20
> > > > > [    3.687934]  start_secondary+0x129/0x160
> > > > > [    3.687939]  secondary_startup_64_no_verify+0x17e/0x18b
> > > > > [    3.687945]  </TASK>
> > > > > [    3.687946] ================================================================================
> > > > > [    4.624607] bridge: filtering via arp/ip/ip6tables is no
> > > > > longer available by default. Update your scripts to load
> > > > > br_netfilter if you need this.
> > > > > [    4.629153] Bridge firewalling registered
> > > > > [    4.745355] Initializing XFRM netlink socket
> > > > > [    4.794107] loop8: detected capacity change from 0 to 8
> > > > > [    7.104544] rfkill: input handler disabled
> > > > > [   26.445163] ================================================================================
> > > > > [   26.445171] UBSAN: array-index-out-of-bounds in
> > > > > drivers/net/xen-netfront.c:807:4
> > > > > [   26.445175] index 109 is out of range for type
> > > > > 'xen_netif_tx_sring_entry [1]'
> > > > > [   26.445178] CPU: 8 PID: 1729 Comm: sshd Not tainted
> > > > > 6.5.0-rc2-1-generation1 #3
> > > > > [   26.445180] Hardware name: Intel Corporation
> > > > > W2600CR/W2600CR, BIOS SE5C600.86B.02.06.0007.082420181029
> > > > > 01/13/2022
> > > > > [   26.445181] Call Trace:
> > > > > [   26.445185]  <TASK>
> > > > > [   26.445185]  dump_stack_lvl+0x48/0x70
> > > > > [   26.445185]  dump_stack+0x10/0x20
> > > > > [   26.445200]  __ubsan_handle_out_of_bounds+0xc6/0x110
> > > > > [   26.445206]  xennet_start_xmit+0x932/0x990
> > > > > [   26.445211]  dev_hard_start_xmit+0x68/0x1e0
> > > > > [   26.445216]  sch_direct_xmit+0x10b/0x350
> > > > > [   26.445220]  __dev_queue_xmit+0x512/0xda0
> > > > > [   26.445224]  ip_finish_output2+0x261/0x540
> > > > > [   26.445225]  __ip_finish_output+0xb6/0x180
> > > > > [   26.445225]  ip_finish_output+0x29/0x100
> > > > > [   26.445234]  ip_output+0x73/0x120
> > > > > [   26.445234]  ? __pfx_ip_finish_output+0x10/0x10
> > > > > [   26.445238]  ip_local_out+0x61/0x70
> > > > > [   26.445238]  __ip_queue_xmit+0x18d/0x470
> > > > > [   26.445238]  ip_queue_xmit+0x15/0x30
> > > > > [   26.445238]  __tcp_transmit_skb+0xb39/0xcc0
> > > > > [   26.445238]  tcp_write_xmit+0x595/0x1570
> > > > > [   26.445238]  ? _copy_from_iter+0x80/0x4a0
> > > > > [   26.445256]  __tcp_push_pending_frames+0x37/0x110
> > > > > [   26.445259]  tcp_push+0x123/0x190
> > > > > [   26.445260]  tcp_sendmsg_locked+0xafe/0xed0
> > > > > [   26.445264]  tcp_sendmsg+0x2c/0x50
> > > > > [   26.445268]  inet_sendmsg+0x42/0x80
> > > > > [   26.445268]  sock_write_iter+0x160/0x180
> > > > > [   26.445274]  vfs_write+0x397/0x440
> > > > > [   26.445274]  ksys_write+0xc9/0x100
> > > > > [   26.445274]  __x64_sys_write+0x19/0x30
> > > > > [   26.445274]  do_syscall_64+0x5c/0x90
> > > > > [   26.445287]  ? syscall_exit_to_user_mode+0x1b/0x50
> > > > > [   26.445290]  ? do_syscall_64+0x68/0x90
> > > > > [   26.445290]  ? do_syscall_64+0x68/0x90
> > > > > [   26.445294]  ? do_syscall_64+0x68/0x90
> > > > > [   26.445294]  ? syscall_exit_to_user_mode+0x1b/0x50
> > > > > [   26.445298]  ? do_syscall_64+0x68/0x90
> > > > > [   26.445300]  ? exc_page_fault+0x94/0x1b0
> > > > > [   26.445302]  entry_SYSCALL_64_after_hwframe+0x6e/0xd8
> > > > > [   26.445306] RIP: 0033:0x7f26c4c3d473
> > > > > [   26.445318] Code: 8b 15 21 2a 0e 00 f7 d8 64 89 02 48 c7
> > > > > c0 ff ff ff ff eb b7 0f 1f 00 64 8b 04 25 18 00 00 00 85 c0
> > > > > 75 14 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 55 c3 0f
> > > > > 1f 40 00 48 83 ec 28 48 89 54 24 18
> > > > > [   26.445321] RSP: 002b:00007ffdee7b5528 EFLAGS: 00000246
> > > > > ORIG_RAX: 0000000000000001
> > > > > [   26.445321] RAX: ffffffffffffffda RBX: 0000000000000700
> > > > > RCX: 00007f26c4c3d473
> > > > > [   26.445321] RDX: 0000000000000700 RSI: 000055567032e230
> > > > > RDI: 0000000000000004
> > > > > [   26.445321] RBP: 0000555670313d70 R08: fffffffffffffff0
> > > > > R09: 0000000000000000
> > > > > [   26.445321] R10: 0000000000000000 R11: 0000000000000246
> > > > > R12: 000055566fcb2768
> > > > > [   26.445321] R13: 0000000000000000 R14: 0000000000000004
> > > > > R15: 000055566fc67a80
> > > > > [   26.445332]  </TASK>
> > > > > [   26.445333] ================================================================================
> > > > 
> > > > See Bugzilla for the full thread and attached dmesg.
> > > > 
> > > > Anyway, I'm adding it to regzbot:
> > > > 
> > > > #regzbot introduced: 8446066bf8c1f9f
> > > > https://bugzilla.kernel.org/show_bug.cgi?id=217693
> > > > 
> > > > Thanks.
> > > > 
> > > > [1]: https://bugzilla.kernel.org/show_bug.cgi?id=217693
> > > 
> > > I doubt it is 8446066bf8c1f9f that causes this. Based on the comment
> > > next to the 'ring[1]' in DEFINE_RING_TYPES() in
> > > include/xen/interface/io/ring.h, this is probably caused/exposed by
> > > commit df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") in
> > > 6.5-rc1, which causes that array to no longer be a flexible array but an
> > > array with one element, which would cause UBSAN to complain about an
> > > array access past index one. Adding Kees and Gustavo.
> > 
> > I agree.
> > 
> > > 
> > > Unfortunately, it seems this file is vendored from Xen, so I assume it
> > > would need to be fixed there then pulled into Linux:
> > > 
> > > https://github.com/xen-project/xen/tree/master/xen/include/public/io/ring.h
> > 
> > No, I don't think it will be possible to change this in the Xen tree easily.
> > 
> > Especially the public Xen headers are meant to be compatible with a large
> > variety of compilers, including rather old ones.
> > 
> > This means that ring[1] can't be easily swapped with ring[], as that would
> > cause compile time errors with some compilers.
> > 
> > Just modifying the Linux side header is an option, though, as we don't need
> > the same wide range of supported compilers as Xen.
> > 
> > I'll send a patch for that purpose.
> 
> Oh, in fact there is a way in Xen to do that correctly. It schould be enough to
> use ring[XEN_FLEX_ARRAY_DIM], which will do the right thing.
> 
> So I'll write a Xen patch first, after all.

Perfect! I went to go look, and yes, this is good:

/* Define a variable length array (depends on compiler). */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define XEN_FLEX_ARRAY_DIM
#elif defined(__GNUC__)
#define XEN_FLEX_ARRAY_DIM  0
#else
#define XEN_FLEX_ARRAY_DIM  1 /* variable size */
#endif

Be careful, of course, going from [1] to [], if anything is using
sizeof() on the structure.

Thanks for fixing this!

-Kees

-- 
Kees Cook


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 05:29:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 05:29:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570035.891280 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOX5f-0004dM-JC; Wed, 26 Jul 2023 05:29:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570035.891280; Wed, 26 Jul 2023 05:29:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOX5f-0004dF-Ex; Wed, 26 Jul 2023 05:29:39 +0000
Received: by outflank-mailman (input) for mailman id 570035;
 Wed, 26 Jul 2023 05:29:38 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOX5e-0004d5-7r; Wed, 26 Jul 2023 05:29:38 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOX5e-00081T-3B; Wed, 26 Jul 2023 05:29:38 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOX5d-0006sP-Nq; Wed, 26 Jul 2023 05:29:37 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOX5d-0004xz-NN; Wed, 26 Jul 2023 05:29:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=7G9QnqIFUXR1w8U+zxAvK9Icz7Z6iGLvCiTIsp2UfME=; b=NYeCI1qtPvA4eFyC8Z+TeP6JMz
	evZwHNgqUGMWeqNbJJIOUl1m0z1v3/zuvsSRcj8XOXrc4g6RYrz/iPUU2MDn+jDjkomg3WpcadKU+
	8jeMFc2ZUOcyM5BO0xTlbBBTVZF9+3jnIKKp3xzCEhxqwly2kh8Y5pTQ2rACbDramRo0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182018-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 182018: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=25a6745fe886e88fe175a50dcab4562c65b7cea3
X-Osstest-Versions-That:
    ovmf=dcf05f958eb409095bf330cf8b8f12fe4c940880
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 26 Jul 2023 05:29:37 +0000

flight 182018 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182018/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 25a6745fe886e88fe175a50dcab4562c65b7cea3
baseline version:
 ovmf                 dcf05f958eb409095bf330cf8b8f12fe4c940880

Last test of basis   181988  2023-07-24 04:10:50 Z    2 days
Testing same since   182018  2023-07-26 01:10:45 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Nickle Wang <nicklew@nvidia.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   dcf05f958e..25a6745fe8  25a6745fe886e88fe175a50dcab4562c65b7cea3 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 05:45:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 05:45:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570039.891289 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOXLN-00072D-St; Wed, 26 Jul 2023 05:45:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570039.891289; Wed, 26 Jul 2023 05:45:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOXLN-000726-QD; Wed, 26 Jul 2023 05:45:53 +0000
Received: by outflank-mailman (input) for mailman id 570039;
 Wed, 26 Jul 2023 05:45:52 +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 <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOXLM-000720-Ac
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 05:45:52 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on2060d.outbound.protection.outlook.com
 [2a01:111:f400:fe13::60d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ac1e7dd8-2b77-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 07:45:48 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB9844.eurprd04.prod.outlook.com (2603:10a6:10:4c4::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 05:45:46 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 05:45:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ac1e7dd8-2b77-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=XRX15/tuN08dF3JzQz0ehevupaeLcvzbnDE/qKSjanLQQX0zDCqjG9L1geZYfZUDWUW3UtOX7NhyHQeGQa+xbem8atkvyOfjou8X0cDITNnKKciaRIECiF5adzeAIB1xfTnBKNrrCJW8jGnFPC7FxAoniXnnsimePn9lS/Y0n2YoMa86H695NdxmmSy+Quspb5eY7E5eXJ/ncOSnyJwig7o/Gipd0vlHoLKAvLNlBuTTLO4dC/3hlT2rHDAdpWO5jhYn/DYD9kecBMmvqxjArRi5AguuSYO5+kjz8yhhaKQtqkMN3ZoqUkC0z8ZhyZFD6E02dk21M0vhvCVmgZKXGQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=bfTJgB1Z47UjsQD6hvXl+p7JOl1JmNINLAZ7kgUbkUY=;
 b=O+DNvludD8Kyes25c/6R8+7P2gLmFktVInzZZR2mwvTOgav1U4br2ItQnPgzd39OsKiXPvwTwLvGc+MGioTXGUQgFIH73aXGlXXSLmvm1Hwbnz70Ak99EQcn/0C69iGzl0fgIE29phwKVn4mFh8OGNBcVrSRr+qBnG3yUn6RKBbdZdw8W9PYtNpOnAB/+n3hrGKR8JJrk0nANNOPPRJdVCeFhiBJllpUho415X8dqr4XcuRDvp4UtueYeQPaDshw2lbAOth/l/Ur4PsuTkxCUG4hAF8dSxy7MT6TM00SoRutVmZ0DesqA7h0TNFsw3yXBu5a6NnQ6uqPjz13UqvAvw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=bfTJgB1Z47UjsQD6hvXl+p7JOl1JmNINLAZ7kgUbkUY=;
 b=vLr6wrmTNKCcW2OFRXoFkYFmuXUn1k4pf2JcxviqpuUfKEz0+8UHxBZ+UIoQvlyoXyMMBAHH+kKpjQR4m0rw1iATYivKiZg5gv8PORHvPD5yqNYBkdKKEJRj3rht2wo5wUKISGB809VFxCOnJHge/bs9qLP5s+EUD1Y0rY/zUzZtaxsC2rfl4Q4Qr2/P3qwhPeI0XqPt3erZqOkW1fB9cOPLDV4YDkznCOwjSu7BDGVaD9KB/+i3lKsA2rD/cPMq+PDs75vmGlzddn8BrY442TQcNUWgBNtYq0voxFOFnfFdb2abEEywBNUp9VbWHZj/7q1SVxnr7iF6/VdkdhX52w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <0a7742a3-7f94-de37-cab7-ef54ffcef8ac@suse.com>
Date: Wed, 26 Jul 2023 07:45:44 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v2] xen/spinlock: mechanically rename parameter name
 'debug'
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 Stefano Stabellini <sstabellini@kernel.org>
Cc: michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
References: <87c0f41e43a1c95ef7d8923c77a2072eb9baee96.1690276551.git.nicola.vetrini@bugseng.com>
 <120ed841-5e0f-e27b-9937-5599dc75d84a@suse.com>
 <alpine.DEB.2.22.394.2307251235090.3118466@ubuntu-linux-20-04-desktop>
 <5332da19-a9d8-f9fb-62b3-b1dbdf7982dc@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <5332da19-a9d8-f9fb-62b3-b1dbdf7982dc@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0123.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:94::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB9844:EE_
X-MS-Office365-Filtering-Correlation-Id: b38e46bd-4815-4987-8cc3-08db8d9b8f1d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	03DLNUNLKQ/WX3wc+YrQUQb7hlI1Ve6Px86jr7UaMVb1bpd7BSNN9op1X6Zfr3pJ6vNTCrJgzbWf222H7hruvZKgyJwdrQi4TKh/NY3mGwxDRfjKq3O1rvARBL6Sw9Kb9dAz9m9ZF0eotjOrD3kRz0cjrE+l5TL1c3wj+kPNbBy2KE1yerguUlz9GdysVDPN5RglTRSjwxFpW8F1/IA4GgAqO3QcCephTA82YJcyxOEm0qTP16yjIeJ9abWkjLB7O3THHb50/KG+8JO43sqGZngnoQo1q3AG0stIGUwmoKRQacsVcPcmzq3XDPixuQWh3t9zKixud1HpTypWuAu/ywvEXEWrsNFBqLvqG8txC0AhTDSav0mml3zC5quG1vdm9Fhj2fM4EScET8Dw+sOCzIcua+6NtrEA1PgEag59ashzh3RZp1ZgFWuKNOPnlizO0hV2DEM3FgyCxtkvWpubIBCDB/0CLwi0/8gvpgJYINaQd2AMPPzalnixVy9Jru89M051WoYS7KG9FsFIlTOQRoQnJQUJmvUYqDgl/0WZEOpNUAOrWSVmEbFvp0fLEtGl26tqzf5add+gKTiL3CIp3PRtZeSqnL3PZTDh1IMgn7FLy12UQdV1kiZNGoXjmQSjWq5li/Nd2M8NOyL65yywhg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(396003)(136003)(39860400002)(366004)(451199021)(186003)(26005)(2616005)(6506007)(53546011)(4326008)(83380400001)(66476007)(8676002)(316002)(8936002)(66946007)(66556008)(41300700001)(5660300002)(6512007)(7416002)(6486002)(54906003)(2906002)(478600001)(110136005)(38100700002)(36756003)(86362001)(31696002)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eE1rZkI5QlMzNlFYMDB0VWJuQnlVOHIvUnBNZzRnN3NzTjFxTG1TZHdxSkNZ?=
 =?utf-8?B?N0lzTmxIZUFMUE9JSWxBVHBrL3hXaEZ3ejlDQVRGZkZLOXhqOGUyUmsxQXB4?=
 =?utf-8?B?ZUo5UmN6Y2R0NkRCdW53VXBEbFd6UGtYTjNyZXI4L3JVM2RGanZ5WFIrUWNx?=
 =?utf-8?B?S2psRlFjOWgxR2Z5ekxIcktuVkxUTE5mZG52SWJyQmJQemFrYk05K1ZRRkxW?=
 =?utf-8?B?cWJRZDFPdFgzODZLRGdrRVF6c1pvV0k3YkQ4RnJ3ckNoOVZYNzFMMkwzSEIz?=
 =?utf-8?B?WVZkZnZNVm5IY2wxUXdIVi9DY1EvMjNRTlpsUE5pc0huMmtBV1lEV0dtZlp4?=
 =?utf-8?B?V0t4dGgxUjhBSjU3N2d6M05Hdzg1NStaUUNzMU9IUFZaczdQYmovVWtuSWI1?=
 =?utf-8?B?aXR3TEhHMEFXa3djSTJZR1RmVmtMZUJaQVdIL3d0OTFVaW9kWDU1TW54cEhv?=
 =?utf-8?B?dWRDbFFkZUN2a2xKNXRqVGd1eEUyMGkwSUtMazR1RS95NWU1RFY5RW1kNG5J?=
 =?utf-8?B?VTFjazUxM0RrWjU0elo3cTlkd1pPaGIvbGliUEs2T3BOcUhqRUlweWZSNVFN?=
 =?utf-8?B?TzhSRTFVeUsvd2hwRWdZR3ZkdzJwWFhOZ0x5TzNHMUhSeHA4S0RDc0xnWi8v?=
 =?utf-8?B?d2wvdGY0WktUdWJCWS81ZXNNUnFna1BjdWJ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?B?ZERVeHRpc3NzY2FkbWl1b0ZCOW1Cakd1L3BHVHR6bW9wU0I3dEcrNDd4WEFt?=
 =?utf-8?B?RmNTN3M4QVgrWmEyaEUwc1RLNGtZNlhOQytBRTlqa2FUL3oxOGExVjYrM254?=
 =?utf-8?B?WHhMdEFab1J2WTF4WjlyV1MxSHU4VGxYSWtBbUgzMk1DK1MzMkdKZ2tkaG9C?=
 =?utf-8?B?TnhMdnpzUXBEQXpIc1JSRS9BeHZBUG1JVi9wRUFOZzN0MkwvUjQ2UlgzWWxp?=
 =?utf-8?B?NUtLSWdaVzNUNlRRZGRnNXJkNU5ZMTFCeC9Ba3luaGpuallVK1pwckNGdlls?=
 =?utf-8?B?Vm5tSVpDL3RkNXlNQzdmTTJUUEdsaDJjSzFCRTFrcGpWZUNjNEZXSFVzd0NN?=
 =?utf-8?B?bEw5bHROcmxuY1RmNmI4ZlhxcldZN2RPMXZFN2pRNDgrOVVlWlRScXRCcGVJ?=
 =?utf-8?B?NWFTT3JnWWowb2tja21wdnlsVmRKRE52NWc3dy9ieGNyeEhqRnpYNk82VGJ2?=
 =?utf-8?B?UUlEWnlJYjlJWFFjQWJzbTJ2dUh6TlZ3cFlUVmFZQXFoYXVPUmQrb2E2TXB4?=
 =?utf-8?Q?W/BUfhHfLcClvpUqaFjKiOu2r?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b38e46bd-4815-4987-8cc3-08db8d9b8f1d
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 05:45:46.5390
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ijeT6SArPVE67VxfZDuc4bQNsZpSuEy7lavvmE8WmKKPM8rR19l2AE8UakDj8H5SJK5kQdiOfCgCNQzEHfehgQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9844

On 25.07.2023 22:28, Nicola Vetrini wrote:
> 
> 
> On 25/07/23 21:37, Stefano Stabellini wrote:
>> On Tue, 25 Jul 2023, Jan Beulich wrote:
>>> On 25.07.2023 11:17, Nicola Vetrini wrote:
>>>> Rule 5.3 has the following headline:
>>>> "An identifier declared in an inner scope shall not hide an
>>>> identifier declared in an outer scope"
>>>>
>>>> To avoid any confusion resulting from the parameter 'debug'
>>>> hiding the homonymous function declared at
>>>> 'xen/arch/x86/include/asm/processor.h:428'
>>>> the rename of parameters s/debug/lkdbg/ is performed.
>>>>
>>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>>> ---
>>>> Changes in v2:
>>>> - s/dbg/lkdbg/
>>>
>>> But only in some of the cases. E.g. ...
>>>
>>>> -static void check_barrier(union lock_debug *debug)
>>>> +static void check_barrier(union lock_debug *dbg)
>>>
>>> ... not here (there are a few more).
>>
>> I agree with Jan: these are all union lock_debug parameters, so it would
>> make sense to me to use lkdbg everywhere in this patch.
> 
> Yes, indeed, that's unintentional. Can this be done on commit or should 
> I send a v3?

This wants to be a v3, but I'd suggest to wait a little with this until
we've decided whether to go the alternative route and rename the entry
point symbol that's colliding here. I would prefer this in general, but
even more so if sooner or later we'd rename most of them anyway.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 05:53:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 05:53:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570042.891300 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOXSK-00007I-OJ; Wed, 26 Jul 2023 05:53:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570042.891300; Wed, 26 Jul 2023 05:53:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOXSK-00007B-LK; Wed, 26 Jul 2023 05:53:04 +0000
Received: by outflank-mailman (input) for mailman id 570042;
 Wed, 26 Jul 2023 05:53:02 +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 <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOXSI-000072-Pe
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 05:53:02 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2062a.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::62a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ad9ee7bb-2b78-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 07:53:00 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VI1PR04MB7071.eurprd04.prod.outlook.com (2603:10a6:800:128::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 05:52:56 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 05:52:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ad9ee7bb-2b78-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=gxNSldRVJi9nkXyvlTADH84U0QjSr4eW0DFLza0l8O9d8+lNjElFa4Z+hfL1ROiFD8ct5QJowmDgZFji+VBoDLE3OSeph1Y0Z0/uCXxve9Tk4TtkDKNCUfnxvRFq6AFd0O0GdKnL7BJYBTBwk/UbKHWoXd9oPe4LcmuXAjUfws8jUAWhdU1xFDGZkSWXNxJ2kAnq8X8niaXnarG/3jLTnQu1V5fyToeI5NDj2hkbPzv4cd95IDJ7OjUcbP2kPFxsxSa0iYcOvFmtTvZA7cPWiXR5PNuS1zvwXn3sGV2kF+D2n4oV2l2k0ITJ2oa02Gode5DvCy5RzaIIFxyWL/tlrA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=aS6UQ+TKDV/R5njROLJvzhx0AdGNSS1JKv1CcpTuLz8=;
 b=Z6UC9yt0R9JvmxUmtFv/m+mO/UDdIVQSrr5FAUqFYh4RqEMcLpnMYgZmSJWBhb1O7GiUNuBGa4EzrgKVCtkGQd/ZHAGC8tZTQ0yqnmEgfwnTGjRztNCT2aH63jDlUtGzjmWyESR0v7/laGzaEA2A2z9rxp7j7wrelQX4kYUEsHSdV82YecpybciVjOnoZ3FuEfg7+9c6riaXoc7DjtlJXp7XIeYPp10djqThad7JGKYDWRUs/cmrS1R8Osolz5QdMgBz+m1fg+3a7f74TRy0BCaImyxKVR2Rspttw3kxPJ3uop+yZjmtLOJ85vpsipIjq/tsbFCwzcnOjfIf+PshoA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=aS6UQ+TKDV/R5njROLJvzhx0AdGNSS1JKv1CcpTuLz8=;
 b=O/+001xRS4jyYZuRjblPiSN782ihHNpEPXBqFHr6rq1QD+00k5l81RcLzRD8nPgb8UUL1XEh1bsx/cWRq4UrmAWs9t90Zr9uzbViWig6U7/OQNIzJLtACHNfzaKtLXnBBNU76F6dq8qQMIfFotvxKC7b+9U7YggqzFssR7/CIirZ54XtakMo6ECl/EzGa1d06P3j+hU2ngvv7T66FQfrVQF7koxxs1rvGj6zMicKzKRvyMKpqtp8hwn72MPjvLSXz/zTTHtt4Z4yc7BeEm42tuHGya4HUCqOHvlFo+j6g7cLQMbe1EDG1uglF4O74g9YqP3kg2ohCVsYRB7CLuS6fg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <6cd0c3e2-ecae-971a-5c86-cf408591bee9@suse.com>
Date: Wed, 26 Jul 2023 07:52:55 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] xen/public: fix flexible array definitions
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org, Juergen Gross <jgross@suse.com>
References: <20230725135557.20518-1-jgross@suse.com>
 <5ba647c0-fc74-595e-5fe3-658f4662f16e@suse.com>
 <f54fcb50-15c5-aa72-60fa-6370547bb9f2@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <f54fcb50-15c5-aa72-60fa-6370547bb9f2@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0092.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a9::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VI1PR04MB7071:EE_
X-MS-Office365-Filtering-Correlation-Id: cf97cc64-70f5-4f2c-e362-08db8d9c8f92
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	4xKC1Z3b9panNnWkt9MY9x48UMTfW7aCg/amIdhOWrYSflXAyG3vCU+pZWdb9hkAlXqyNl0nFtn+FZemPIIvsOGOXIBcBkrD8MUYDaKIckEUCcB/z8AydWpib2vAd9zo/02j+OTlnHPJ29k63Qfdx7hye1z6hsNfEf1DFWefplnjgbGbpahKpCaSOOZPd2ogXSc8o6uMJS++DN2qpE5I2LjG0QM/3x6FyMd+lMz50TNmvk2d8pSqgbMKNuJq73+r50760qZgNIoODJruO3VweStymyBAKKBKGvq27VB4Ek8Jbk58vAWSzL2y/9Fjp9tejnKTE4lJ+Sa5mr1FjgUBM/CtEMFIcBwqA3SGe84SCpDYsE3rcAHsUzaqB6y9pmO7JdSSqxZARywoBkA0x2LTao2MnsQc/K8yKjKANoZmVmbp6QaftqXL4CQc16AWJbt7RCVfT9t8eQv9Y5rYJmUIZcCnT4jwwHSw724Cw8Bm+zUEbXRXWsC4i7aOpIZwBTziJVEd77GNE3XZP7dBVwS3Wu67cG5uvWoq4NbzYgRlcQRpE43YsSMaDNqlyPh3M8YwAuZOcHBOKWEZsS4kfFuZKud6ykQSLGZ9D3ropewPn5xkb8D2adi5MQKkbs9WuSC7vVSWLzwI5kfLmPIUksqsyw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(396003)(136003)(39860400002)(366004)(451199021)(107886003)(186003)(26005)(2616005)(6506007)(53546011)(4326008)(83380400001)(66476007)(8676002)(316002)(6916009)(8936002)(66946007)(66556008)(41300700001)(5660300002)(6512007)(966005)(6486002)(2906002)(478600001)(38100700002)(36756003)(86362001)(31696002)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eXdxVUVmMGEvSjBleWhVWTF0ZXdTY2dNK2NTT0owQmtjOGUreXlGTldxRVg4?=
 =?utf-8?B?anJoSEFaWHgwRFQ0RFMyNGVLcVAwRWowNTAvV08zTU93RHVtK1VGRXF1VzFp?=
 =?utf-8?B?WnhvaFBYaVBwc3AxZFBjanNMdTAzNnZzanJTejhMQ0FHVlN4bkFpYkpQb0Ir?=
 =?utf-8?B?UnJ6dEhqUHRPb3lnUGFlbWdMOHRFTTdCdGZFUTMxMnRDL093U25zQWRGOWZx?=
 =?utf-8?B?OWUwQXpkdFBpeXVYU0VtcmNRZzkvZXlQTjdaN2NSN2lkZmJrcFNTU0NvdVpH?=
 =?utf-8?B?VGNrTXgwZ1ZNUXgvU21RQkh5YWZnZnlFc1FndEtDcDBRWkFmT1R4dENndVk0?=
 =?utf-8?B?dVh3ZExla1VGNGNVSWhoZzdBY01jSnI5QjF3UlNIbkxjd3ArbTZZMEJEeWpx?=
 =?utf-8?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id: cf97cc64-70f5-4f2c-e362-08db8d9c8f92
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 05:52:56.7980
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: hhECBqxdr8QsktLwS6VJucgCkEVWWUey5/4ezxEMoGq+LmihPBHSdOGdUpdMW+brGzxzL+XjtfZ3u/3VFyXUAA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7071

On 25.07.2023 18:59, Andrew Cooper wrote:
> On 25/07/2023 5:16 pm, Jan Beulich wrote:
>> On 25.07.2023 15:55, Juergen Gross wrote:
>>> Flexible arrays in public headers can be problematic with some
>>> compilers.
>>>
>>> Replace them with arr[XEN_FLEX_ARRAY_DIM] in order to avoid compilation
>>> errors.
>>>
>>> This includes arrays defined as "arr[1]", as seen with a recent Linux
>>> kernel [1].
>>>
>>> [1]: https://bugzilla.kernel.org/show_bug.cgi?id=217693
>>>
>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>> I think we need to be careful here: What if someone somewhere applies
>> sizeof() to any of the types you alter?
> 
> Then the code was most likely wrong already.

That's possible to judge only when seeing the code in question.

>>  The resulting value would
>> change with the changes you propose, which we cannot allow to happen
>> in a stable interface. Therefore imo it can only be an opt-in feature
>> to have these arrays no longer be one-element ones.
> 
> I don't consider this an issue.
> 
> If people take an update to the headers and their code stops compiling,
> then of course they fix the compilation issue.Â  That's normal.

The code may continue to compile fine, and even appear to work initially.

> It's unreasonable to take opt-in features to a set of headers intended
> to be vendored in the first place, to work around a corner case that's
> likely buggy already.

The original intention clearly was to allow use of these headers as is.
Anyway, I've voiced my view, yet if there are enough people agreeing
with you, then so be it.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 06:03:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 06:03:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570046.891311 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOXcT-0001hv-NM; Wed, 26 Jul 2023 06:03:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570046.891311; Wed, 26 Jul 2023 06:03:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOXcT-0001ho-Ip; Wed, 26 Jul 2023 06:03:33 +0000
Received: by outflank-mailman (input) for mailman id 570046;
 Wed, 26 Jul 2023 06:03:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOXcR-0001he-Ls; Wed, 26 Jul 2023 06:03:31 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOXcR-0000N5-IF; Wed, 26 Jul 2023 06:03:31 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOXcR-0007hu-1f; Wed, 26 Jul 2023 06:03:31 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOXcR-0006DQ-1G; Wed, 26 Jul 2023 06:03:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=cWjbu8VFmylnUq6zdXk8NDQVuRKhWrkcReBRSWuPLZI=; b=Z4ZPH5oJWkp3RGzxJb/VIHvXGF
	N1jT20xdqUjex27JwlCsgPsUICzoacgPiNIhplJPis3mUOPvXNYSPlV/lS20AerITsGa90VV048Tx
	agy0Q4dtAhKsFb7zn5Z6yWoaSJxd2RRaGcY9VVL5sI/L345dEZJhOYU/uXuQ5FUB2Wo0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182001-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-5.4 test] 182001: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-5.4:test-armhf-armhf-xl-multivcpu:guest-start:fail:heisenbug
    linux-5.4:test-amd64-i386-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    linux-5.4:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit1:guest-start/debian.repeat:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=27745d94abe1036a3423cb8577b665c01725e321
X-Osstest-Versions-That:
    linux=b30db4f7e45f3c17cca2ba5be6f22762837a6e34
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 26 Jul 2023 06:03:31 +0000

flight 182001 linux-5.4 real [real]
flight 182019 linux-5.4 real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/182001/
http://logs.test-lab.xenproject.org/osstest/logs/182019/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-multivcpu 14 guest-start        fail pass in 182019-retest
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 182019-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail blocked in 181623
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check fail in 182019 never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check fail in 182019 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181623
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181623
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181623
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181623
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181623
 test-armhf-armhf-xl-credit1  18 guest-start/debian.repeat    fail  like 181623
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181623
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181623
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181623
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181623
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181623
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181623
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                27745d94abe1036a3423cb8577b665c01725e321
baseline version:
 linux                b30db4f7e45f3c17cca2ba5be6f22762837a6e34

Last test of basis   181623  2023-06-28 08:40:44 Z   27 days
Testing same since   182001  2023-07-24 17:45:59 Z    1 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Borislav Petkov (AMD) <bp@alien8.de>
  Greg Kroah-Hartman <gregkh@linuxfoundation.org>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   b30db4f7e45f..27745d94abe1  27745d94abe1036a3423cb8577b665c01725e321 -> tested/linux-5.4


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 06:19:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 06:19:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570053.891320 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOXrk-0003KP-2N; Wed, 26 Jul 2023 06:19:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570053.891320; Wed, 26 Jul 2023 06:19:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOXrj-0003KI-Vn; Wed, 26 Jul 2023 06:19:19 +0000
Received: by outflank-mailman (input) for mailman id 570053;
 Wed, 26 Jul 2023 06:19:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=iO1l=DM=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qOXri-0003KC-CV
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 06:19:18 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5913cf19-2b7c-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 08:19:16 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 3D59321D4F;
 Wed, 26 Jul 2023 06:19:16 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0F88D139BD;
 Wed, 26 Jul 2023 06:19:16 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id War+AeS6wGSkBQAAMHmgww
 (envelope-from <jgross@suse.com>); Wed, 26 Jul 2023 06:19:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5913cf19-2b7c-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690352356; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=I+X9jDRcdGU4ikmY96k4/Zociwi0/HUX25UBQWYR4zc=;
	b=SwwA1waNMCMdz1iTjOXJuAFHH4tL+X0pY8JrtITM+0lFMzzq0nbbdq6/FiFDUPjTwFF0Rm
	9UmlnQ2ypLViygyiLozd6R2mP6sewxXckT98/LO3XeVQA2wc8hqcy9DMCzpuQlbM+pHA85
	KNNho6mtTWNSt43aojB4zT1Z1YwtCkc=
Message-ID: <a6370aa2-ec6c-259f-3e24-bc1a74ead2a6@suse.com>
Date: Wed, 26 Jul 2023 08:19:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v3 08/25] tools/xenstore: make hashtable key and value
 parameters const
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-9-jgross@suse.com>
 <2c981a1a-b020-3908-8b9b-8821daec9457@xen.org>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <2c981a1a-b020-3908-8b9b-8821daec9457@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------k6R60Yqxbr0AHJ9o96ztcvnT"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------k6R60Yqxbr0AHJ9o96ztcvnT
Content-Type: multipart/mixed; boundary="------------xVutYgRy1uPh0DSozQRF8JV1";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <a6370aa2-ec6c-259f-3e24-bc1a74ead2a6@suse.com>
Subject: Re: [PATCH v3 08/25] tools/xenstore: make hashtable key and value
 parameters const
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-9-jgross@suse.com>
 <2c981a1a-b020-3908-8b9b-8821daec9457@xen.org>
In-Reply-To: <2c981a1a-b020-3908-8b9b-8821daec9457@xen.org>

--------------xVutYgRy1uPh0DSozQRF8JV1
Content-Type: multipart/mixed; boundary="------------zZtgOxDU0Ok0HOxI0XLxD8tg"

--------------zZtgOxDU0Ok0HOxI0XLxD8tg
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjUuMDcuMjMgMTg6MDgsIEp1bGllbi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kgdGhpbmsgdGhpcyBpcyBhIHByZXR0eSBiYWQgaWRlYS4NCj4gDQo+
IENhbiB5b3UgY2xhcmlmeSB3aHkgeW91IGFyZSBkb2luZyBsaWtlIHRoYXQ/DQoNClRoZSB2
YWx1ZSBpcyBuZXZlciBjaGFuZ2VkIGJ5IHRoZSBoYXNodGFibGUgY29kZSwgYnV0IGl0IG1p
Z2h0IGJlIGNoYW5nZWQgYnkNCmUuZy4gYSBjYWxsZXIgb2YgaGFzaHRhYmxlX3NlYXJjaCgp
IChzZWUgZS5nLiBjYWxsZXJzIG9mIGZpbmRfZG9tYWluX3N0cnVjdCgpKS4NCg0KU29tZXdo
ZXJlIEkgbmVlZCB0byBjYXN0IHRoZSBjb25zdCBhd2F5LiBJIGNvdWxkIGRvIHNvIGluIGhh
c2h0YWJsZV9zZWFyY2goKQ0KaW4gY2FzZSB5b3UgcHJlZmVyIG1lIHRvIGRvIHNvLg0KDQoN
Ckp1ZXJnZW4NCg==
--------------zZtgOxDU0Ok0HOxI0XLxD8tg
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1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4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------zZtgOxDU0Ok0HOxI0XLxD8tg--

--------------xVutYgRy1uPh0DSozQRF8JV1--

--------------k6R60Yqxbr0AHJ9o96ztcvnT
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmTAuuMFAwAAAAAACgkQsN6d1ii/Ey+U
/Qf+IFlBMtDDnVvFOKmQp7Gt9wDPX+ILAqqjKbVhVgoJ8SD/CGVYv200w/xHwpEmAcjNFYR/jt0i
tUWRmJXTupog+/W9uzg9CdBqrjuJApzyzVpJBngoNHjYrRKQH1VbflcJu+ifJj0QB0tK7v1aCru6
SC8FZ1DcdBmRmjJfPeoFspZo0j5x0lPY/gsQifyFk7PMqTczEI0cPDswpMa/TXyPeFdvpCohMnF1
/Iu3Lire+alEZmGqATp2b8F08kAiRocFV033Ss+9krgnQ1NaPYXlOGyBkiYIsQY+E+ctilLYw+AI
z5zu7gVC4krr1FEDFpflflJcvXzuKvsB9LzPf2Gapw==
=Rj8R
-----END PGP SIGNATURE-----

--------------k6R60Yqxbr0AHJ9o96ztcvnT--


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 06:29:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 06:29:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570058.891330 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOY1i-0004uF-Vo; Wed, 26 Jul 2023 06:29:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570058.891330; Wed, 26 Jul 2023 06:29:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOY1i-0004u8-T7; Wed, 26 Jul 2023 06:29:38 +0000
Received: by outflank-mailman (input) for mailman id 570058;
 Wed, 26 Jul 2023 06:29:37 +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 <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOY1h-0004ty-Lt
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 06:29:37 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2045.outbound.protection.outlook.com [40.107.7.45])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c96ee804-2b7d-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 08:29:34 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS4PR04MB9689.eurprd04.prod.outlook.com (2603:10a6:20b:4fc::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Wed, 26 Jul
 2023 06:29:05 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 06:29:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c96ee804-2b7d-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=EZpj9yaOvkwlKRpDrWaleCsCWiPuF+A2EephhUZTj9zy0br3/fUuPZcDTamc0mm0Gz2FpG0pPp6BzSmEP4yBRq7uerBVkTn4L3H0mQLFHb03K+JRPnBfKaKbnbp4TXAZ4dKxqeenL3JyGlMi73mz1ZGTVgy7d3KeevXxZslXDJQkMYQgLtdLVffiDq83j2A1CM0dlmCqaNkkoy9mOhT9ynMZ4YPQ+KJCKq6R0SNS9939LZ6VQ3Tlzw5ScVNtO9n8QR5Mr8DeO84Y+V2j3ysukMQ4mSbotdmKOVbDpRe9bwseO4Q8uhAT9NbLjqfIhdQmhrAcWrOrcuK+JIi7+bDpQQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3iFl+lqTtvkDipS8RQHWuLeyJZ15ebJ2Niudrj8cq4k=;
 b=NEiSSjuKn/VZ8/gWmt9Mmf+dwTSfd9ansp7KLg/lwkLG3Sd2eopGn878bBryIPFsJpJzXdhP4UTSZPk2bsIXd849ByaxpQ8B0XH7j96HZ71whb7UtMK3m5kDOrj4BjekYHb/kA1uz7LoFIAKnbFPwnSJvEBygUiXKtlQZjmwT7AeoD/zES+yqy/0iR9m8WkSZ8Ea0YG5+9GYt9CDqP4IenLBb+vopxm8jVf1g2TBPTkjB2MIzHX9+TgUYXMrgxiGDXrDgg4AYbHxfBGE3M7hzEONCYRK8uOWoj+RwBynNIAe3WoM6YZZAvxnvrqawFszRBsZjGMjOga4eMNWUkjmwQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3iFl+lqTtvkDipS8RQHWuLeyJZ15ebJ2Niudrj8cq4k=;
 b=BRYqfA9HuR1pLg4liqf/hntTnFNhQVs2cLQtTZ59g0nIBcbQ4gSSYeZdMTB0vDkAMGrxAeuqu1diHfdelBImgsvTKkmqalwUwiMZc4upRJvv+IIPDXerTgJhRy/We9QiIJGZSWHvLYGWnd2YgEtqWfIQO7VNq+hlHE0W+4JIKoPfTyq+QmXJW/TMIa4UVkZ8e+1eO40wqoFQsAwfElJ0jnNrr+VbalgutYBsp/lMHthGahzKvoXKyR+xg9qGF3KWJ5DVl/0YRq/fuW/15gk3ld8gUnxadrkZ4Hcd27AodI0Nqd9FXAC+PMU1gU/79XzebUKBD7vqHiGgjC2ZdvaqjQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <d35833cd-acf7-f326-3f17-ad87d63ff3e6@suse.com>
Date: Wed, 26 Jul 2023 08:29:02 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 1/2] restrict concept of pIRQ to x86
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: Julien Grall <julien@xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <85e59fd5-9a06-48b4-ba7e-81865d44e332@suse.com>
 <98f51b96-8a1c-7f33-b4d3-1744174df465@suse.com>
 <0cd9d94b-0a8d-a3e1-d683-04fac1572750@xen.org>
 <8cdf9179-7b3f-5a52-ff02-8ededbe03e0c@suse.com>
 <4a6bd691-95e1-ad15-1054-b43460c85b32@xen.org>
 <ceb81450-90ff-ffbe-431c-37bc60c7946a@suse.com>
In-Reply-To: <ceb81450-90ff-ffbe-431c-37bc60c7946a@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0094.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a9::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS4PR04MB9689:EE_
X-MS-Office365-Filtering-Correlation-Id: 160c31af-8c93-4d22-f151-08db8da19bc5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	SfkmNu20RWHWV1WtjURw3Zjq8/toJkDEq7OAjzmxbS9raoSFgUX8M5HNrYFI2uSf0VkPOP+PRWtmy8Idj8U1vzsa++UwmpcwpzQvOQZwhp7am0+ouoUAoJjTsnDRGbwwEIbiSPdHi6FqLUnAsPgw+B+W28qqsQGUvABASd+nmBv4TYuZbxEieif3nwezOIfDkx8qbkoDCoBWbp2uK1nCSeZlqR85hNTWWyBUy9SEjGa2RZZZfk60wW+Bkp9Pfrmp3cq1vxCiXHInqGb9M26oyAEd7CURTW9uISgh4e5vnAtpKoqP9/s+S9I9zG7sNlL9JUcL/CVQ4zWEN6FmkXIOXuNOSKVJ808n7kJkEch9fhowr/O0+DoQLAjSx/sqYLlgZ9UcMP1+64S3hcw62RYQEGZS/HGiVubJgGGTJVpvwGX93ZjPxSBYDewmkNTrnF8JnwyGVZTqn05Ps1GhyzJFrie2/60eVTlNozm222HNyubls4Xe02GqUjCspF0PmmTPbsokf5i6U1Zg2g8oO1aH9ylTaaeyO6AFoTwzKjewlUvouL+o0V3sRTYFdbw7ulcNor2bCOTf3o0PAVwsTQqoq28sqsMHlxLnERMDMO3YhefSEUHkUznDhRXX8g+NbTc5ZZ6U0p/MwoA+3fasTtnfYw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(396003)(366004)(376002)(136003)(451199021)(316002)(83380400001)(66946007)(66476007)(2616005)(4326008)(6916009)(186003)(66556008)(6486002)(54906003)(478600001)(6512007)(2906002)(53546011)(26005)(6506007)(86362001)(31696002)(38100700002)(36756003)(41300700001)(8676002)(8936002)(5660300002)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?L0RYWmxYN0RCVS9QUHBsMEJra3BvRkorZUZXWXVhQmQzbGhCQ0F1NkdWWVhN?=
 =?utf-8?B?aVNISFBYZ2RrWjJDcEVpZUZSQjl6TUlxcWFKOXdhODI3UmRCbUFRclVYTW9O?=
 =?utf-8?B?dmpZdHBGVG4xUVlXT0ZHVFJNa2V3Z3ByMUNhd2pzUzNacTVJeUNDQTAvYnZv?=
 =?utf-8?B?VXdYdWFsVVJlc2tpVFBDK01URXhVOGF2b2VMbTNOR1NZbkoxSlBKUGZ3WkNQ?=
 =?utf-8?B?bWpOZ2c5NVMrNi9LSWwyNjhOSEdvT2lWYjFJaGRlZHBtcnQ1WUo3d05ITC8v?=
 =?utf-8?B?SE03aVdqQWduMUVUQWQzVkJPQVVqV1R5N0hIcUVEdTdPWGo3UTlNVkdZZlRl?=
 =?utf-8?B?TXFndXIvZVpweU5UZnpBd20zcUVvZWVBR244WEtRaWZQdHRuWmNWaDV0Y1lF?=
 =?utf-8?B?dXR0MFFpZzkrdjNRWm9kSHlXZTlxSTllb28zVUQxemFiVkdwMldQSXZETUQ4?=
 =?utf-8?B?bkFlNzhqUVFBN0NxUVBuNUpqZTlHdGpvK3hGbmJTZlFOUkRDOHdwWUE3dUJU?=
 =?utf-8?B?eTJZZklqTHdZY3hUYnFsanl3M0xjdExTc3psZ0N4S3F1V3JuK2Z1WmkwODdn?=
 =?utf-8?B?T0U5T3VKYlNQYlN2Y2pFK1BVeFZ1SnE0aWhabGJ3bzBwL215aUM5Sm5LVjJG?=
 =?utf-8?B?Z2hsNGRsZUhsM09jVVVsdHQ1VDRTakJaUGNjZ29lSmdTb2FHREFqd1F5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Nma2o3dkw2Y002azNwUWhHTXUvVHY1QitIRngwMGx3QXdMajls?=
 =?utf-8?B?TnpFZkg5dk9nSjV3Vk9SSEZuS3ZZWHphNXVwTDZqdUlFb1E4YWxNSGc0bVVN?=
 =?utf-8?B?QWJMeDFzWlIwam91M1NTaFczS24wbnZhcm9YWU5Tb2E0bVBsS29lMW1mVWFV?=
 =?utf-8?B?S0U4ajIycXZSY0JFZ0dHSE5EOGVQUkErQUh5Y053Wmk3SHVnSnB0cW1MblZW?=
 =?utf-8?B?Q2lsVlNObnR5K2dYTmdRSlRnYVBiV2d2d1o4VVJ6dXJMMmxVblVjeVFLeXRL?=
 =?utf-8?B?Q3k3dEhqUmlkTHJYOVh3dGlCcE1Gb2JSLy9SRndGbjNMaHJoTXF3SkVTeTJt?=
 =?utf-8?B?MGZERjFpc3V2dnRsT290L2x3SGpuRTIvQzlVWXJGUk42VDF6MUtBQ1ViU3Nv?=
 =?utf-8?B?S2hoTlFyVjJhMlNxL3BGdnNSYnVtRUF2OGdIb05qaS9iaDFVYmZack9tTlRm?=
 =?utf-8?B?ZkVZTTgvaXJGdDBTL2VXYVd3aUpwcHgxenlKRzFvODFUVUxjVmdJR2NOUTFV?=
 =?utf-8?Q?aCRrcMLPxoB9kXVqab0QPgLH1?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 160c31af-8c93-4d22-f151-08db8da19bc5
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 06:29:04.7604
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: SRBCh9J4/RUifj2UhCqFh1CWpDLDHaz/wAOxeKxxsRUDjFcXh8ea4iqTwiYxYgPHZczGymXTa32NIrdABhQWDQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9689

On 17.07.2023 17:24, Jan Beulich wrote:
> On 14.07.2023 11:28, Julien Grall wrote:
>> On 11/07/2023 13:29, Jan Beulich wrote:
>>> On 10.07.2023 22:59, Julien Grall wrote:
>>>>> ---
>>>>> I'm not really certain about XEN_DOMCTL_irq_permission: With pIRQ-s not
>>>>> used, the prior pIRQ -> IRQ translation cannot have succeeded on Arm, so
>>>>> quite possibly the entire domctl is unused there? Yet then how is access
>>>>> to particular device IRQs being granted/revoked?
>>>
>>> (Leaving this in context, as it'll be relevant for the last comment you
>>> gave.)
>>
>> Sorry I missed this comment.
>>
>>  > so quite possibly the entire domctl is unused there?
>>
>> You are right, the domctl permission is not used on Arm.
>>
>>  >  Yet then how is access to particular device IRQs being granted/revoked?
>>
>> At the moment, a device can only be attached at domain creation and 
>> detached when the domain is destroyed. Also, only the toolstack can map 
>> IRQs. So we don't need to worry for granting/revoking IRQs.
> 
> Thanks for clarifying.
> 
>>>>> --- a/xen/common/domctl.c
>>>>> +++ b/xen/common/domctl.c
>>>>> @@ -683,11 +683,13 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
>>>>>            unsigned int pirq = op->u.irq_permission.pirq, irq;
>>>>>            int allow = op->u.irq_permission.allow_access;
>>>>>    
>>>>> +#ifdef CONFIG_HAS_PIRQ
>>>>>            if ( pirq >= current->domain->nr_pirqs )
>>>>>            {
>>>>>                ret = -EINVAL;
>>>>>                break;
>>>>>            }
>>>>> +#endif
>>>>
>>>> This #ifdef reads a little bit strange. If we can get away with the
>>>> check for Arm, then why can't when CONFIG_HAS_PIRQ=y? Overall, a comment
>>>> would be helpful.
>>>
>>> As per the post-commit-message remark first of all I need to understand
>>> why things were the way they were, and why (whether) that was correct
>>> (or at least entirely benign) for Arm in the first place. Only then I'll
>>> (hopefully) be in the position of putting a sensible comment here.
>>>
>>> One thing is clear, I suppose: Without the #ifdef the code wouldn't
>>> build. Yet imo if things all matched up, it should have been buildable
>>> either way already in the past. Hence the questions.
>>
>> Right, it would not build. But does this check really matter even in the 
>> case where CONFIG_HAS_PIRQ=y? Looking at the code, it sounds like more 
>> an optimization/a way to return a different error code if there value is 
>> too high. For the domctl, it doesn't seem to be worth it, the more if we 
>> need to add #ifdef.
> 
> I wouldn't call it an optimization. The check has always been there, with
> b72cea07db32 transforming it (largely) into what we have today. In fact
> in an initial attempt I had gone further and also #ifdef-ed out the
> pirq_access_permitted() (and iirc the pirq variable altogether), seeing
> that without HAS_PIRQ the incoming field can only sensibly hold an IRQ.
> But then I thought that this would be going too far, leading to me
> undoing part of the change.
> 
> If we dropped the check, we'd start relying on domain_pirq_to_irq()
> (invoked by pirq_access_permitted()) to always fail cleanly for an out-
> of-range input. While I think that holds, it would still feel a little
> like making the code (slightly) less robust. But yes, I think doing so
> would be an option. (Still I also think that returning EINVAL for
> obviously out-of-range values is somewhat better than EPERM.) Yet then
> ...
> 
>> With that, the rest of the domctl should mostly work for Arm.
> 
> ..., taking into account also your clarification at the top, I wonder
> whether we shouldn't #ifdef out the entire subop.

The more I think about it, the better this option looks to me. libxl
doesn't use the sub-op for Arm (from all I can tell), so the only
worrying in-tree parts are that the libxc functions is exposed both
via the Python and OCamL bindings (without there being an in-tree
consumer, again from all I can tell).

Since I'd like to get v3 out (first and foremost because meanwhile
I've also found bugs fixing of which preferably would take this
change as a prereq, or else the build would break on Arm afaict), I'd
appreciate feedback (of course also from anyone else on the Cc list).
I guess unless I hear otherwise, I'll make the change.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 06:34:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 06:34:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570060.891340 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOY68-0006Jz-HI; Wed, 26 Jul 2023 06:34:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570060.891340; Wed, 26 Jul 2023 06:34:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOY68-0006Js-Eb; Wed, 26 Jul 2023 06:34:12 +0000
Received: by outflank-mailman (input) for mailman id 570060;
 Wed, 26 Jul 2023 06:34:11 +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 <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOY67-0006Jm-2D
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 06:34:11 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20611.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::611])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6cd1fa9a-2b7e-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 08:34:09 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBAPR04MB7269.eurprd04.prod.outlook.com (2603:10a6:10:1a4::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 06:34:07 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 06:34:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6cd1fa9a-2b7e-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=XuGS1WEZ8znwPZES/QRh9M+RcFG2blrUX+NRuRLPdc2jKWDKmmCVNfZuLfw0JZYiEXXitwza/NtSYJgsAiVIpJz1oiwrBuFt2aL6A5gYHFN0Fcdrzose8f0aTq5sDBcFBd5Tumxrtd7onmeCqyfcrR+F13r6pI3PV1ikpInGu1AdAxcKxc9XOxmqnX0dJZDP2cwlV/nKzJ9kgQQwWnlWcG+7xVdA2/gqQjohRnZUR86c5fHGshmEWXMmw6OVNaCFpdf6c+lweGBgeamdTcSAQnBUD53pI7N/HueHz+YYExKZbe74mUXqikYgmCA3+g9z5JMESWZNjoYOR1nuBkiuWw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=wPAda3NxuYrN5eM+4qGSUW0FwYcB+s3cz+gelEC9PeI=;
 b=evU0ABe8m0fpuZx9u0vkkEXlcFb0jZVyD5RKPviJu8PAkJ4KCa8LlwswmwW8136d0TdlYdhx+vE/BESnMK57Jm3AD8trjKJp0DZUYsJuznuvNFv87AUaT1DR3C5q6za3hzdtzYw5eBxhyz90BMQxir9rg5meHI/KVFGfFGZ1rN2Pgf/im8q0Q0HpKA0LnBJywL6i30C0XdEWefMQNRQJuOvK/04IEiodAxqjnP00TuEDytss0ruqK5/VAC3WXYal81kYyhHuYda1g/5dZMtO+/lDoSSzQ7P0AQKfcmzC1oDyXaABfG3OMN+Fm5nd+0iT0slAEmsDiRIAzgPH3WBIgQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=wPAda3NxuYrN5eM+4qGSUW0FwYcB+s3cz+gelEC9PeI=;
 b=k6YHs8B6ELAFP0D7kkGqoVp6IY2kpur1GWrXfPGEGtWIv72jwXr6JmTv5bzJVjHDARXD2HLDmuEHcWMdQuQuvi+a0aaI0BPk2eMPn9FS9a1PgDcTEACidOEc66WWg6pSSbSoIICjthPBLwJWHE/vr3alTToA4gOx0Ladk5GSukOp1ioLzBgd4aUQ3cpm0tEf9XIgUCcznUMh8c83EnlC07OYZEzEIQunMzcTdmM+t83/J5PHiBlwWFR1unrSmp+JSIUyu+pNAw22FyHZM2oAdkGxE5PkTOQFu24b+jIMhsSmYdx+IUlD3CD6zBiKLmt+zcYWlJx4PFZl8iI5OF23gg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <11a3ae18-508b-cf08-2803-bc4aaeec7353@suse.com>
Date: Wed, 26 Jul 2023 08:34:05 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v3] xen/spinlock: mechanically rename parameter name
 'debug'
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
References: <a66f1084686b77b098c5ccf3d0cf5f52980fdf5a.1690317797.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <a66f1084686b77b098c5ccf3d0cf5f52980fdf5a.1690317797.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0181.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9f::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBAPR04MB7269:EE_
X-MS-Office365-Filtering-Correlation-Id: 40f5a34d-87a6-4523-16bc-08db8da2501c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	rqQm4noCK8jkk0kWLnqNKY2CpLkaxVRLLrQfbbYlV4fYjugf4YrblDaRVzSJb3pPEeSAk9CZlEazQNacVBQDxelvxn7nvBt55gjiyHbnbwX69BrPoLVZghVkwjUJuTnMvjawHBgKAigaIzGsAv9tsqxFLsTFa54ANLd1vOYGTEpKi5XjOreCNby6tgfbxMKC7UBni65oZPdN7ytELZurwEuwowdEkMX8cw1SHXogLhw7rV7bHOxEwTfCz/y4fWO19UbwxmGe92UcKqGD/BTPQuthhI4HmhCBoHKfmtx7Vx7w2xLxfiFl6zyVKhTd8KhJMQozPCFXNcTi41oe0NahAmy4+AreoImwbkBPeNrMFw9XGnuKkubrTh4YktGULylVgyTCOeJie9LRjlXnCQYg0rfiK/vxuAaE8JB+hwzyegcwFBdoPED9R9YwDAoZo0JkuQMuMJEbNQa9jUuctHmsL6yg/FigcvtjE9Pz5+wqqfl8VgQhF3HhyGtO+RbTIBi9oZJvb/lDs2xggPE7v6z+ILydgXFlS1CuCFl4947inEjpPJa0Wrwqs/wmOtwSFUOqgs0W+BluXfWd9P/QI7KQB5KJ7iAZrwoLa1gbA8mNgX6GA469GU9BqVsekYAbqyOoRe8SMS1EU2OGQa64qpVOtQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(39860400002)(376002)(366004)(136003)(346002)(451199021)(66946007)(6512007)(66476007)(66556008)(41300700001)(4326008)(6916009)(6486002)(316002)(38100700002)(36756003)(2906002)(478600001)(4744005)(54906003)(2616005)(186003)(31686004)(5660300002)(8676002)(8936002)(7416002)(31696002)(53546011)(6506007)(26005)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aG1HZW1va3p0WkFYRlRMOHEyZ3VPUDJYcklBenpyUVR6MUM5QXRPTlNaNGVu?=
 =?utf-8?B?V1hpenZ4S1R4Ly9YdVhad0FSMCs4UWhOS1FrQWIwUW9XTW5sWi91L0pTanFn?=
 =?utf-8?B?R2pkTGx3cm9uckdMS1U5eFNQV0w3aStmcjhDYno1bXhQNEF1NHVRMlN6ekNl?=
 =?utf-8?B?enlmWG1kUTVUWURGaVVhaUNpdVdqa3dDRWhDa3MzNTQyYUdZZEx0SWVNdjlz?=
 =?utf-8?B?NG8yd0Noek1POXU0WFROenZMWEl5eWR5NWRtR1J4L0VZTElSWCtCMlNGSmg4?=
 =?utf-8?B?S1p5NXdMWF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IRUNNdGhxUmNXVE1DRlV6NHN3OEFzZGVuY3djUTBWU1JxVkRtcTRw?=
 =?utf-8?Q?ptIWmME9ZHnO2AwmrybA/hbRg?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 40f5a34d-87a6-4523-16bc-08db8da2501c
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 06:34:07.2567
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: o9L6JOHfD0H154jS6fxPPlMxKm3WDvL2YYKRI6qDkKBByX7rNHHG7s88PnluHuEywSsolTk/tSowgL16jcGPnw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7269

On 25.07.2023 22:45, Nicola Vetrini wrote:
> Rule 5.3 has the following headline:
> "An identifier declared in an inner scope shall not hide an
> identifier declared in an outer scope"
> 
> To avoid any confusion resulting from the parameter 'debug'
> hiding the homonymous function declared at
> 'xen/arch/x86/include/asm/processor.h:428'
> the rename of parameters s/debug/lkdbg/ is performed.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
> Changes in v2:
> - s/dbg/lkdbg/
> Changes in v3:
> - Added missing renames for consistency

Hmm, you asked whether to send v3, but then you didn't wait for an
answer. So to repeat what I said there: I'd prefer if we could first
settle whether to rename the conflicting x86 symbol.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 06:39:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 06:39:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570064.891350 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYAv-0006zi-6J; Wed, 26 Jul 2023 06:39:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570064.891350; Wed, 26 Jul 2023 06:39:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYAv-0006zb-3H; Wed, 26 Jul 2023 06:39:09 +0000
Received: by outflank-mailman (input) for mailman id 570064;
 Wed, 26 Jul 2023 06:39:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOYAu-0006zS-2d
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 06:39:08 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20610.outbound.protection.outlook.com
 [2a01:111:f400:7d00::610])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1dcf471d-2b7f-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 08:39:07 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8604.eurprd04.prod.outlook.com (2603:10a6:20b:43b::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 06:39:04 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 06:39:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1dcf471d-2b7f-11ee-b242-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=eQoEArJ+Ocb9YQy9/dhJJ6M5YvOoM4xC+tlbEJUCOUW3031NRezEW3JsX8S3iko32rXGxPodJUuj8boJS6B9pE762ZKFzZRFI7tr9dz8R7yhZpMb65tyvDip1qpUDaQVSWnEELQ3qjpR1xqYZoh2mTK9b4r75sliOd0RfZ3W9a1gXu4QW2ev80BvqMtYsrCdqg0un/7SYpAj8RcrGPJvhGq+X0otQ/RkOGb5V2klZdUm7dbwgLmRHbxx34AMXYiV5Sisy9gNVaDhtmRK4oP3HpcFNl07y1+i5J4ca8cktr9QIlLTDhUnJmEsBOrUAAFSh3v/8b7rGGbm+7bglJyRoQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=J9AE0Vb4bcT6Fi0slcd1PzH0iQsO5wnomwC2k11hBAw=;
 b=k22UtrDyYNut0KNJ6ShYbCkplfsXiOUN1UiqoyXlayj7Rtg/yLsAuKZC5+UGUp9Q/m2Kd+YAUwDL8zpv2n5kZva61CcHQSNIQjtQ0AsZEkUIWHyOaFLi3AEmCMcuyweMBqqH3O91NuA3lWSrbuYslRrsVzkVlBBHxEaxyFXWTh/Aa8zvO1IcBapQpdTZc1H+X5GfZas8c4YVIPj/JYJb8Ew98075LsotgvmtitV6XfFncQgKB3s6wUI/Hecn1aREkYm0RvtAaxOchpnll46YKMJ8MvXNs6qHzimfjw8k9KgBrdHrSHi4qrTvnK3NprBNDvTz1hPZOf2d9lF45EgDwQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=J9AE0Vb4bcT6Fi0slcd1PzH0iQsO5wnomwC2k11hBAw=;
 b=YV6gK24JG8Bmed80umZOXRnYTdl9v9WLCn44sSR82gqvD52orQQZmRV/1VapweKiu/CpvgMaj61CkV+l/kaU2chCZsfk3537PbHk5kGQ45sCNtChju8SUfVKXnmrxKh/bCfpWpjAOJlp68Zne/W86Ir5qdMWh9pC5f2ngSA+KHNGqbqpCHqrnwIo4N2RNlzL+Ah4DK1nyyezcQyStQkIog3k0vXkMEAkDfpNLgg3iR2AMhUyY8NhLA6XOHRzGdVtvdojQkmyc4oSJmIOywgqwt5DGbtEtqRXCBDBflla47ZR/7JrPXr0jojXDdCEMkkTxiNtKhNu4Ufb8iNS4siO1Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <0bef8b24-860c-fbba-fad1-92be1fb7e165@suse.com>
Date: Wed, 26 Jul 2023 08:39:01 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Content-Language: en-US
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local> <87ila7cvy2.fsf@epam.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <87ila7cvy2.fsf@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0014.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a::24) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8604:EE_
X-MS-Office365-Filtering-Correlation-Id: 43c76f31-f747-4c68-02b7-08db8da30124
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	pFOuZrYE3NjmCl3vfTkCerOAbgxRmo4YkCFbQM2RaRuqFdjbhn28eZehp2xogwbnSWG6MDwDEyeqsd8UW5bFbp2ivuzMcxU7vhrupKQEfeGl3Y42rIVdaQoFj/TAisLgotBVLnHKdWiQJ4hYO8sVEy2hR30LEMqhqkQUKwbBpgbrFPxQv24r2cFHKDqkWY5uLFci5Vj5U1V2Lh3ehaQs6AnvYCkfmHi0VvEXUeUJgTcCiwjpj+XIElt6xjzFwbo3jt43pHa+/V8w3yZBmteb4y5rCeF3X2fkMGSrnYiMZVBPSIDds8wIWtg4wGGLXqY/R7ZMrDH5J7DyBlDHnid11Sz5NxxPO5pOL2CY6cTOTMSVZ9T7YXluLup2pU79MtD20R+UJYP8MI2yqMbYPKxUURjKZ9WFKnlaXPuyYIr2K8RKdsIHt8zWn9vKZUKTSfy+ng2SOy5PJnDEdMUBS4nZJQCgc+HHfJsbPLW7XT9FkfGrsxI7yWrP3Jy2QvtTi5InLGdNo2KXNIe6W6Zu2t5lx1fc8FoJA8UpKCJk4AaPgFTPudfNOFOGAPi9VFQi1s/MLAWk0Na6z2KrwW4KjgQCXWMQGVMy8YN8nahGGmYF46BYCS18JHtxEwN0FZ3uDsOPn3tbowFeEibeHF43k2UYMg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199021)(2906002)(6506007)(186003)(26005)(31696002)(53546011)(83380400001)(86362001)(38100700002)(2616005)(478600001)(6486002)(6512007)(6666004)(36756003)(54906003)(66476007)(66556008)(66946007)(41300700001)(316002)(4326008)(6916009)(8676002)(8936002)(5660300002)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aXdHQ2twTHptZEdPVzhYb25MdWpvb3c5ZzIza2JCY0ZiUW42eXdOc0Jla0FS?=
 =?utf-8?B?N2VXTGV6R0ZiZURwMjZ6UEg5eldyOGJoUzlEckxxZS9ybWVKRDJkWUx2VXVU?=
 =?utf-8?B?N3JUMUxhek9IN2V4NWlQWEUwRS9POU9LRnlsYVZyMnk3QVNnOTZIK3cwS2pj?=
 =?utf-8?B?a3lyQUMwMjROajQyOTczSDVmcGNrOGJ1ZWRid1NTUkFGUHdrdnhUZisrUFMy?=
 =?utf-8?B?NWR0aCtpWXdiOFZKL042V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OXV6K3dsNDRVRTYyWWJIbFI1enZ1bzZxNkdQZzdjTUsvYmcxYmYwbWxwekta?=
 =?utf-8?B?NjRpWWNpYjlJZkRjQmdnS1pxdkYzbFVLMHJrRXZINmVhRmpCOW4wekZRaU1R?=
 =?utf-8?Q?BMSSqAG0H23njEQ93sO/sX+bV?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 43c76f31-f747-4c68-02b7-08db8da30124
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 06:39:04.2634
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: fjUIdnII0PnM9OJBKoKOGatiWvPURM2IBCIkGS8llfBBmrWp45ZxmpWFgKkQK9n5Gfnw3rxNE7BLftpoExwGaA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8604

On 26.07.2023 03:17, Volodymyr Babchuk wrote:
> Roger Pau MonnÃ© <roger.pau@citrix.com> writes:
>> On Thu, Jul 20, 2023 at 12:32:31AM +0000, Volodymyr Babchuk wrote:
>>> --- a/xen/arch/x86/hvm/vmsi.c
>>> +++ b/xen/arch/x86/hvm/vmsi.c
>>> @@ -895,6 +895,8 @@ int vpci_msix_arch_print(const struct vpci_msix *msix)
>>>  {
>>>      unsigned int i;
>>>  
>>> +    ASSERT(rw_is_locked(&msix->pdev->domain->pci_lock));
>>> +
>>>      for ( i = 0; i < msix->max_entries; i++ )
>>>      {
>>>          const struct vpci_msix_entry *entry = &msix->entries[i];
>>> @@ -913,7 +915,9 @@ int vpci_msix_arch_print(const struct vpci_msix *msix)
>>>              struct pci_dev *pdev = msix->pdev;
>>>  
>>>              spin_unlock(&msix->pdev->vpci->lock);
>>> +            read_unlock(&pdev->domain->pci_lock);
>>>              process_pending_softirqs();
>>> +            read_lock(&pdev->domain->pci_lock);
>>
>> This should be a read_trylock(), much like the spin_trylock() below.
> 
> vpci_dump_msi() expects that vpci_msix_arch_print() will return holding
> this lock. I can rework both functions, of course. But then we will in
> situation when we need to known exact behavior of vpci_dump_msi() wrt of
> locks in the calling code...

Your reply sounds as if you hadn't seen my earlier suggestion on this
matter (making the behavior match also for the now 2nd lock involved).

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 06:42:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 06:42:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570066.891359 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYDx-0008Pm-JR; Wed, 26 Jul 2023 06:42:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570066.891359; Wed, 26 Jul 2023 06:42:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYDx-0008Pf-Go; Wed, 26 Jul 2023 06:42:17 +0000
Received: by outflank-mailman (input) for mailman id 570066;
 Wed, 26 Jul 2023 06:42:16 +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
 <SRS0=eYuv=DM=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qOYDw-0008PZ-8e
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 06:42:16 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8ddfd381-2b7f-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 08:42:14 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.163.26.92])
 by support.bugseng.com (Postfix) with ESMTPSA id CECDE4EE0738;
 Wed, 26 Jul 2023 08:42:11 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8ddfd381-2b7f-11ee-8613-37d641c3527e
Message-ID: <f424fc5b-6266-3d04-b494-0448fa453b75@bugseng.com>
Date: Wed, 26 Jul 2023 08:42:09 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v3] xen/spinlock: mechanically rename parameter name
 'debug'
To: Jan Beulich <jbeulich@suse.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
References: <a66f1084686b77b098c5ccf3d0cf5f52980fdf5a.1690317797.git.nicola.vetrini@bugseng.com>
 <11a3ae18-508b-cf08-2803-bc4aaeec7353@suse.com>
Content-Language: en-US
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <11a3ae18-508b-cf08-2803-bc4aaeec7353@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 26/07/23 08:34, Jan Beulich wrote:
> On 25.07.2023 22:45, Nicola Vetrini wrote:
>> Rule 5.3 has the following headline:
>> "An identifier declared in an inner scope shall not hide an
>> identifier declared in an outer scope"
>>
>> To avoid any confusion resulting from the parameter 'debug'
>> hiding the homonymous function declared at
>> 'xen/arch/x86/include/asm/processor.h:428'
>> the rename of parameters s/debug/lkdbg/ is performed.
>>
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>> ---
>> Changes in v2:
>> - s/dbg/lkdbg/
>> Changes in v3:
>> - Added missing renames for consistency
> 
> Hmm, you asked whether to send v3, but then you didn't wait for an
> answer. So to repeat what I said there: I'd prefer if we could first
> settle whether to rename the conflicting x86 symbol.
> 

Stefano replied asking for a v3 [1] before I had a chance to read your 
message this morning.

[1] 
https://lore.kernel.org/xen-devel/0a7742a3-7f94-de37-cab7-ef54ffcef8ac@suse.com/T/#m14b4eebd936e3b349491a1b9f46a17a5d9bb9c30

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 06:44:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 06:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570071.891370 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYFi-0000XT-U0; Wed, 26 Jul 2023 06:44:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570071.891370; Wed, 26 Jul 2023 06:44:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYFi-0000XL-RB; Wed, 26 Jul 2023 06:44:06 +0000
Received: by outflank-mailman (input) for mailman id 570071;
 Wed, 26 Jul 2023 06:44:05 +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
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOYFg-0000XE-Uw
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 06:44:05 +0000
Received: from out-61.mta0.migadu.com (out-61.mta0.migadu.com [91.218.175.61])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ce43c991-2b7f-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 08:44:02 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ce43c991-2b7f-11ee-8613-37d641c3527e
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690353840;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=YDI8U6PdofMAM+26dtva4DhYN8CfrTBJVsyyEyUmUJk=;
	b=JVhERSJePvENAHBAgsa9OJJHaRlTw1nxE/2vqXO6bAT1NEIguIR4Z7zl+KZu3QxiQoEeNj
	itt0w/sFcR1t3TE/kHw4vv0c4tice4bs18/XxKOP2DGo15RFxhKVe/K3nETF4Nc/e2R2RE
	tGZT/88BILp+nV9lPF3v22OFrdOyZPs=
MIME-Version: 1.0
Subject: Re: [PATCH v2 10/47] gfs2: dynamically allocate the gfs2-glock
 shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-11-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 14:43:32 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>,
 yujie.liu@intel.com,
 Greg KH <gregkh@linuxfoundation.org>,
 LKML <linux-kernel@vger.kernel.org>,
 Linux Memory Management List <linux-mm@kvack.org>,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev <netdev@vger.kernel.org>,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <8D4D19B4-C362-42E0-899B-8D802AB6A002@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-11-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> Use new APIs to dynamically allocate the gfs2-glock shrinker.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 06:48:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 06:48:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570074.891380 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYJk-00019j-Fk; Wed, 26 Jul 2023 06:48:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570074.891380; Wed, 26 Jul 2023 06:48:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYJk-00019c-Bk; Wed, 26 Jul 2023 06:48:16 +0000
Received: by outflank-mailman (input) for mailman id 570074;
 Wed, 26 Jul 2023 06:48:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOYJj-00019W-8H
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 06:48:15 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2059.outbound.protection.outlook.com [40.107.7.59])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 648f41fa-2b80-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 08:48:14 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB7612.eurprd04.prod.outlook.com (2603:10a6:10:202::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 06:47:44 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 06:47:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 648f41fa-2b80-11ee-b242-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hGwU1C5EO+btJtuGOQd4koBobG9bWW+iPIcxeTPJjYCR05SrOv1Tx7pB2d8p/xXEw8EXFmopo+mYg4OT3RvfHqV+pZcSY8oLJa68tpx2jDTwCMQlEq16QOp9a2S93bh2ICMaaelz6a2S7QWygKLr99+kzeM4DLaVhxsLjvlGb6SVy5SHxwFaez4GA/L3cmdh/6QMa5pu9JX0GTWJumLQbBxSMPfcJNjiuWGLKckDjGXkUWgM5HAIv+pMP/08kgoW3WOsy6f2mknRi420Pw5LvTIBnK+xK6dU7d8lc/R+XGRfXH6IZurfPZ31xLxJ7yzUHIf+X459bzYEyUia9RhwXw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=cv/S8H7VBVCXw65UxxrbNttfmXrKo98kPc4TNsom7Ns=;
 b=JKnFP6sVwefppiMuVGrp5bGprP5/q+gkI9rz0YfIDdCOTxt1dLk6WHFxazR0OUMgsoUdG+n9RkcZJU7D1MJtpblOtNpjrtWt0ezErwhjypYG6XrCdZ6erpEeVbWL3E56Q3PqR3CQ+ZcA/mzEp5QB8qFcBr7DsRGbCvWla7ChIk/CDiPJhQdaKWsu9vECXRRmy6mBw8XRWwKdbxTPK1g4dqPad7l7/7LmVWXKRfPpIpoDCeAlYxQcRKANXEkZftVVvWuEy3HtD8jINjZR5ADscrIHjyvy1BMeNOkcZQ7fG+UUZrFIlOgYPTtClqHLcs23htK1Q2zhGDUn0YHNx6hf2Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=cv/S8H7VBVCXw65UxxrbNttfmXrKo98kPc4TNsom7Ns=;
 b=y+FJRB6xUfx06G5zETY1+4S/lz5fGnL4T2KVCv/kjFMvUcRBtJOA5LlUf4kGTDwD7tEMGVx64Xm2BWwDu/fgZ/d3Ci8XHA8M+CAJRWMqR8XytCvMKNuRsNefzVeLoSbaKnBTQnbHy84hvjBGO0sA9A8QP/gM0zI3JiijxVhZkPya1iB1sOt9BN83JVYCm0cLrFszUxn+gVbOEgNaULdeSQ6S1LJi8C3uouX43I9HzfhG4suCLmeET/+fNNxbRLIQ8XXqGjQLekvh6I/2XqIgeOGSwkSgbH9dtFrB3Wxnas9oG/Mt9c3L1ZGhZxuvMlsyKxy9RB4fQEqVPSsxf1AgYw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <8914bf47-c4ca-4a14-6a92-b5b23ee739a0@suse.com>
Date: Wed, 26 Jul 2023 08:47:42 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v3] xen/spinlock: mechanically rename parameter name
 'debug'
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
References: <a66f1084686b77b098c5ccf3d0cf5f52980fdf5a.1690317797.git.nicola.vetrini@bugseng.com>
 <11a3ae18-508b-cf08-2803-bc4aaeec7353@suse.com>
 <f424fc5b-6266-3d04-b494-0448fa453b75@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <f424fc5b-6266-3d04-b494-0448fa453b75@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0252.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:af::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB7612:EE_
X-MS-Office365-Filtering-Correlation-Id: f73f085b-dd7e-4935-8886-08db8da43740
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	twxlW7kvJFfdy3HKFGlikCsyvCACZ4B2DwVV3NaW6C2BC0Z8s3dhTx5hopFLOeHzq3x04zYn2QFGWZzdAKLZkihmjfnom9kZe5zTw0hEOxDI377WF7Wx1ektmKAKKQnXejRaG0BdJKe8M9VzSbYWxbLWnh28nwoIResYdRsr1gC3WjtkGAw445McqjugJYfcHB50irQhQmJ/EXt8OI7sPflqsTRItl+dNgYAi0ItCu4sjkrXYoZzkMkvmoFc6u/4DQqm9QxKyDovJ7KKPlz0lRgTY+jBinnBZFx+FlUpCO0H4PYxjt28B1sFX+G3xBt2gpz8NNOjwNjaBtm2V2sLIP+xzvXX8E0ywi1butgEWGe6dkIek95jizq5KHFRyz3nu03fVwYfkZX6d7cgQiAWuaASLVLHlPb9yuPlzQH0ZARijA2ivKSxcE0bd256dWd80oXd4QjbK6lqjhOYIYFjABGogM9x7WWmQ1j7VlGmNurfk3QQm86qE8HryVdCQfkSQ8wHXMZaES028JgMNCIAhOM/h3lS3Ku0+6imf+1Doq0q0Tpfgby5I1Snc706a7B7QhzFKoO3n74+zxKh8z+lGpvonWpnOkjh9llbml7uTuNNoLhQSgK1e06u9jn08o0qaPVPdqPZx6BqnRQYFqEegw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(366004)(376002)(39860400002)(136003)(396003)(451199021)(6512007)(6486002)(54906003)(478600001)(2616005)(26005)(53546011)(186003)(6506007)(2906002)(66556008)(66476007)(66946007)(6916009)(4326008)(316002)(8936002)(8676002)(7416002)(5660300002)(41300700001)(38100700002)(36756003)(86362001)(31696002)(83380400001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TDFDQU93ZkZzZGorZ0VsRFFTbVc5bEF6ME4xdVVUdU4zL3BlSTJDbllJY0s2?=
 =?utf-8?B?dFo1QmY4L01aY1ZkSWlLbHhzZUNyOVNob05NdzBZSG1rcU1tU1NsVUMyWkhR?=
 =?utf-8?B?U0JBcENQYW5NZ0RCdjVRUXFaTkdNSlFGMkdxOG1tZ0NiamFkWXg5Q3FGdk8w?=
 =?utf-8?B?Y0pVY09wbEVyeGVON0NsaWxiSUVZNTVwajR0WXljODBaUlJPYTRhM083ZDNT?=
 =?utf-8?B?cy9OWnEvVHlUaTRHWFRmYjhXRGJHWjB5WEN3NlJObFpqQkJ6TFNHMDhFS0s2?=
 =?utf-8?B?WmY4a1lQSE5ZVnZBK0U5U2JyNEtwN2FING9HaEg0ekVjMDg2WUU5TFBLWWZM?=
 =?utf-8?B?dDV6empPZHA4TEpTUHNaTUtZNXNKakpldEpGalpIa3VsQjF3eVpsaFU4YldX?=
 =?utf-8?B?bENEQk16RzVMejZMMjVEYnBmZVVGb3E2L3UrNElRM1BSLzlPYVVRVlp3NnNC?=
 =?utf-8?B?MTY3bllmMTAyZVdVazFRVmg5eEtoYVpoSm8wa0NzMWpZNWlUVjVWSWg3Nmpm?=
 =?utf-8?B?SGV1Yk8wRjdYelhWTFRZNWEvQUUvRTVCYTQ2Tmp3R2xEcGdiOVJqempud1ZW?=
 =?utf-8?B?ZXZKaVAyS2NBRjNsWVUzRnpaNEl2djdwU09iY09jRjlxYVVQUnVnbW8yNmQw?=
 =?utf-8?B?Mm5uejZSUDFxRUIxMExtaVhhdksxd3RqWC9xbHRxYldnV2RWWndEZlRnMHR4?=
 =?utf-8?B?Z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EZ5VG93TEg5OWhRRjNiT0V5?=
 =?utf-8?B?aFJuZFFMWlBFRWVxbDE4R0hiL3UvVzN2YXl6Y2pDSHVaekVVY2l2eWE1VVFz?=
 =?utf-8?B?aDViUnlWNjFXelIvWlpzSGVLeVorY3dpaUI4aEpPam1NU3RETDljZ0xaNlAz?=
 =?utf-8?B?Q2MwK1NsTGhLT2J6dFNZSG9wMjdwT0x3THB4TWo2ZmRlSHp5dWtNYWZYWG1r?=
 =?utf-8?B?czdQM0VvUnpWUDNRMzRqRVNsNTdRMUhESERqSTlqNklCU1ZlemVuRnJiaVVo?=
 =?utf-8?B?WTJWdXJZYk9MTGxuaklXUUJ4ZDJVUERXV2UwMkRycFpPT1dCZ1NHRFZQZ0cr?=
 =?utf-8?B?ajlpUTZKYU41YnJuRkQ1dUVzOGRTZHJ5N1UzbzdZeEtHcHJQSVJzemRHZTBv?=
 =?utf-8?B?TkRWQUNsK3hJUjRuTWdwZG1CelcxYkpxQTJEemRydnovajVtTTFBN2hRTEhk?=
 =?utf-8?B?dE9RU0tQWU4vMjZVdllVcDVhUk4wVGdSMEt6WTZ5QVVMS3N5UWhoeEZhMFZp?=
 =?utf-8?Q?79bQajz+AI4H+6X/FS92qJBu3?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f73f085b-dd7e-4935-8886-08db8da43740
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 06:47:44.5483
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: oGqESEMYkJzpoowWoO/smYs89aP/bXB5MtDXuDy6jzmOzONNiCmILjLLcAIRpr+WWaht/cLAvzPxVPnXk50wFQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7612

On 26.07.2023 08:42, Nicola Vetrini wrote:
> On 26/07/23 08:34, Jan Beulich wrote:
>> On 25.07.2023 22:45, Nicola Vetrini wrote:
>>> Rule 5.3 has the following headline:
>>> "An identifier declared in an inner scope shall not hide an
>>> identifier declared in an outer scope"
>>>
>>> To avoid any confusion resulting from the parameter 'debug'
>>> hiding the homonymous function declared at
>>> 'xen/arch/x86/include/asm/processor.h:428'
>>> the rename of parameters s/debug/lkdbg/ is performed.
>>>
>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>> ---
>>> Changes in v2:
>>> - s/dbg/lkdbg/
>>> Changes in v3:
>>> - Added missing renames for consistency
>>
>> Hmm, you asked whether to send v3, but then you didn't wait for an
>> answer. So to repeat what I said there: I'd prefer if we could first
>> settle whether to rename the conflicting x86 symbol.
>>
> 
> Stefano replied asking for a v3 [1] before I had a chance to read your 
> message this morning.

Right, sorry, I spotted his reply only after seeing the v3.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 06:49:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 06:49:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570077.891390 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYKo-0001gG-OC; Wed, 26 Jul 2023 06:49:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570077.891390; Wed, 26 Jul 2023 06:49:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYKo-0001g9-LA; Wed, 26 Jul 2023 06:49:22 +0000
Received: by outflank-mailman (input) for mailman id 570077;
 Wed, 26 Jul 2023 06:49:21 +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
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOYKn-0001g1-Ma
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 06:49:21 +0000
Received: from out-3.mta0.migadu.com (out-3.mta0.migadu.com
 [2001:41d0:1004:224b::3])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8b7c962c-2b80-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 08:49:19 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8b7c962c-2b80-11ee-8613-37d641c3527e
Message-ID: <e7204276-9de5-17eb-90ae-e51657d73ef4@linux.dev>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690354158;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=07kRInGgcVMiksfMsun8p4HGvWms170mUSINrsZDIPU=;
	b=SItOX2s1O2xRbklfqsU1E20kPvGPKi6lNjfeuPsz787gwDukUtasKQC+RRJ78xAQZyjij6
	0JlhE8ny7YCW/WIa1zfjcf/R7sJjT11NiI0YLFw4BmC6xi+4P258FcCDYig5b0NazpkEtw
	pJl7w1nj4tDpMcmLDY8eVxmHbXISOTw=
Date: Wed, 26 Jul 2023 14:49:05 +0800
MIME-Version: 1.0
Subject: Re: [PATCH v2 11/47] gfs2: dynamically allocate the gfs2-qd shrinker
To: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz,
 roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org,
 paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com, cel@kernel.org,
 senozhatsky@chromium.org, yujie.liu@intel.com, gregkh@linuxfoundation.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-12-zhengqi.arch@bytedance.com>
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-12-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Migadu-Flow: FLOW_OUT



On 2023/7/24 17:43, Qi Zheng wrote:
> Use new APIs to dynamically allocate the gfs2-qd shrinker.
>
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> ---
>   fs/gfs2/main.c  |  6 +++---
>   fs/gfs2/quota.c | 26 ++++++++++++++++++++------
>   fs/gfs2/quota.h |  3 ++-
>   3 files changed, 25 insertions(+), 10 deletions(-)
>
> diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
> index afcb32854f14..e47b1cc79f59 100644
> --- a/fs/gfs2/main.c
> +++ b/fs/gfs2/main.c
> @@ -147,7 +147,7 @@ static int __init init_gfs2_fs(void)
>   	if (!gfs2_trans_cachep)
>   		goto fail_cachep8;
>   
> -	error = register_shrinker(&gfs2_qd_shrinker, "gfs2-qd");
> +	error = gfs2_qd_shrinker_init();
>   	if (error)
>   		goto fail_shrinker;
>   
> @@ -196,7 +196,7 @@ static int __init init_gfs2_fs(void)
>   fail_wq2:
>   	destroy_workqueue(gfs_recovery_wq);
>   fail_wq1:
> -	unregister_shrinker(&gfs2_qd_shrinker);
> +	gfs2_qd_shrinker_exit();
>   fail_shrinker:
>   	kmem_cache_destroy(gfs2_trans_cachep);
>   fail_cachep8:
> @@ -229,7 +229,7 @@ static int __init init_gfs2_fs(void)
>   
>   static void __exit exit_gfs2_fs(void)
>   {
> -	unregister_shrinker(&gfs2_qd_shrinker);
> +	gfs2_qd_shrinker_exit();
>   	gfs2_glock_exit();
>   	gfs2_unregister_debugfs();
>   	unregister_filesystem(&gfs2_fs_type);
> diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
> index 704192b73605..bc9883cea847 100644
> --- a/fs/gfs2/quota.c
> +++ b/fs/gfs2/quota.c
> @@ -186,13 +186,27 @@ static unsigned long gfs2_qd_shrink_count(struct shrinker *shrink,
>   	return vfs_pressure_ratio(list_lru_shrink_count(&gfs2_qd_lru, sc));
>   }
>   
> -struct shrinker gfs2_qd_shrinker = {
> -	.count_objects = gfs2_qd_shrink_count,
> -	.scan_objects = gfs2_qd_shrink_scan,
> -	.seeks = DEFAULT_SEEKS,
> -	.flags = SHRINKER_NUMA_AWARE,
> -};
> +static struct shrinker *gfs2_qd_shrinker;
> +
> +int gfs2_qd_shrinker_init(void)

It's better to declare this as __init.

> +{
> +	gfs2_qd_shrinker = shrinker_alloc(SHRINKER_NUMA_AWARE, "gfs2-qd");
> +	if (!gfs2_qd_shrinker)
> +		return -ENOMEM;
> +
> +	gfs2_qd_shrinker->count_objects = gfs2_qd_shrink_count;
> +	gfs2_qd_shrinker->scan_objects = gfs2_qd_shrink_scan;
> +	gfs2_qd_shrinker->seeks = DEFAULT_SEEKS;
> +
> +	shrinker_register(gfs2_qd_shrinker);
>   
> +	return 0;
> +}
> +
> +void gfs2_qd_shrinker_exit(void)
> +{
> +	shrinker_unregister(gfs2_qd_shrinker);
> +}
>   
>   static u64 qd2index(struct gfs2_quota_data *qd)
>   {
> diff --git a/fs/gfs2/quota.h b/fs/gfs2/quota.h
> index 21ada332d555..f9cb863373f7 100644
> --- a/fs/gfs2/quota.h
> +++ b/fs/gfs2/quota.h
> @@ -59,7 +59,8 @@ static inline int gfs2_quota_lock_check(struct gfs2_inode *ip,
>   }
>   
>   extern const struct quotactl_ops gfs2_quotactl_ops;
> -extern struct shrinker gfs2_qd_shrinker;
> +int gfs2_qd_shrinker_init(void);
> +void gfs2_qd_shrinker_exit(void);
>   extern struct list_lru gfs2_qd_lru;
>   extern void __init gfs2_quota_hash_init(void);
>   



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 06:56:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 06:56:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570081.891399 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYS1-0003Ea-Jj; Wed, 26 Jul 2023 06:56:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570081.891399; Wed, 26 Jul 2023 06:56:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYS1-0003ET-H0; Wed, 26 Jul 2023 06:56:49 +0000
Received: by outflank-mailman (input) for mailman id 570081;
 Wed, 26 Jul 2023 06:56:48 +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
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOYS0-0003EN-H0
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 06:56:48 +0000
Received: from out-31.mta0.migadu.com (out-31.mta0.migadu.com [91.218.175.31])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 95bd6c23-2b81-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 08:56:46 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 95bd6c23-2b81-11ee-8613-37d641c3527e
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690354604;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=iRSsWjwJWJm0w66UpDxeIgipl7hfuaOyOCsxu+C6pfw=;
	b=fLBccTgkUBKz+7mp2vpdax5b//tdE6o8KHxFPHqqwVKz7MJpPUPmKHdreLsGwkoc6LHrby
	eKJEV8M03TBc0lNZVTziQzpZDpwNWgRk//6nCOH2FdX5IVPjiYy8aPcSL2n3jJh6liljtQ
	bur38KbAtnKoTl3fANkdXjft4nJjjHo=
MIME-Version: 1.0
Subject: Re: [PATCH v2 12/47] NFSv4.2: dynamically allocate the nfs-xattr
 shrinkers
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-13-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 14:55:58 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 senozhatsky@chromium.org,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <BC7BC8BE-D508-42D4-8C99-6C7576AECBB5@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-13-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> Use new APIs to dynamically allocate the nfs-xattr shrinkers.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 06:58:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 06:58:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570084.891409 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYTQ-0003mz-UE; Wed, 26 Jul 2023 06:58:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570084.891409; Wed, 26 Jul 2023 06:58:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYTQ-0003ms-RL; Wed, 26 Jul 2023 06:58:16 +0000
Received: by outflank-mailman (input) for mailman id 570084;
 Wed, 26 Jul 2023 06:58:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOYTP-0003gT-5L
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 06:58:15 +0000
Received: from out-53.mta1.migadu.com (out-53.mta1.migadu.com [95.215.58.53])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ca53b0c9-2b81-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 08:58:14 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ca53b0c9-2b81-11ee-b242-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690354693;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=vJECzEbg6AvUr2F/gs+Gdm9ozTbMv8VDjSGrHUhWzDY=;
	b=h66bJdZfshf2g1RLUpKqwxN7lHNgmJn36kolmPZUX2Aqc09HU6VbZ+x+Z0DjP9YGQTMTaE
	Bmqs9Mr+MJHT0UpOpBW+6O4BcvF6xaU81Xxo7qywI9w5gMUx1fYGe1bTsluzGucfJTYdAa
	elPkOC38C2T6cXpSojcQr4ueQ4x5eAU=
MIME-Version: 1.0
Subject: Re: [PATCH v2 13/47] nfs: dynamically allocate the nfs-acl shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-14-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 14:57:20 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>,
 yujie.liu@intel.com,
 Greg KH <gregkh@linuxfoundation.org>,
 LKML <linux-kernel@vger.kernel.org>,
 Linux Memory Management List <linux-mm@kvack.org>,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev <netdev@vger.kernel.org>,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <344A2B0E-8A25-494A-A8E1-5C75441B965D@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-14-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> Use new APIs to dynamically allocate the nfs-acl shrinker.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 06:58:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 06:58:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570085.891420 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYTd-00048V-5w; Wed, 26 Jul 2023 06:58:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570085.891420; Wed, 26 Jul 2023 06:58:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYTd-00048O-1l; Wed, 26 Jul 2023 06:58:29 +0000
Received: by outflank-mailman (input) for mailman id 570085;
 Wed, 26 Jul 2023 06:58:27 +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 <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOYTb-00046K-O1
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 06:58:27 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2062a.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::62a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d0f5f0fc-2b81-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 08:58:25 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8944.eurprd04.prod.outlook.com (2603:10a6:102:20f::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Wed, 26 Jul
 2023 06:58:23 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 06:58:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d0f5f0fc-2b81-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=nNtVIyNK9r5nxgZ7mqt1b9m2JpEYWL15dQ46rriWF9LMxecxyXD6G8R+KjkZn0v7Z2EUR1ivMj4ItMTAYmPi6/unnc4b3EIDU5bLmbVm0Dtoo92Tk5MTTvZ0SSkIDoEhwu5+EcBvcoL9ZP+Ce+qMj0ucZzOt/GG0lFVRZwlkZ6RIrIz0IYRAPN8yZsSCHJMXwXh6avD/rQ0cQQDjWY0/2/dDPMu65ln+IE5h27tpKIbmsbo7AgEShImMTJ70LS23vmHT8caEz1M9E0GW2UjOikp7LwASYg8yJcztvv1MPlXCXWdwrSTLlzqKFa8UCS/vPt2J2K+plbhKkbFsuR8uMA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=vCZKq6tggTefDdsAdG5ZksUbgsc10sUhZIUnGfnlVak=;
 b=mBRlM5yZf1Hhen67R+QNdHLS5TWHqSzY5OG6BNoe2lOIJ1dz0we3ghRqJc/qj9Vtp04szRUJjrMOIFIODaUy9a6uQNa+rGLNl0zymoxVjuuFvuERYf7RcJoPMyLlALbTVJLTHNb4Y+iEn89cJ4ns6L/Uegt8781NqTiUraj0DYyFvWgGRkiql0p5mu972daBUPuh9I0+Hd4YOJccpe8jfd3rYUWf1QU6+q8K9UdCUKPraikYEJtNgMVZG8GuH8N4jX3dOVoerK+5l1WSuM1KDA+HuJD1NUWjjcUZfXUAtWmzfyPOLoelmfSnatLm02PR4XR12VDTKV0/GgbbNJb0Sw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=vCZKq6tggTefDdsAdG5ZksUbgsc10sUhZIUnGfnlVak=;
 b=jMTnK3bHVcwjlaRj5LCD/lTJbESZi+BJQPmaz2LJJ7brAKkLeXN8XR8kVhjg6GqI5lQNF2kjInFtn9zsGhQU95kAr6T5y7X3nhv0SEwsQKixvHAwmLA4MUnAKZfIFetICk0UABW8EANXuGDwnZG8/eLdI0VoOfoYrXmgrh9GOuiAfLSzN2JJVwHOTUpj7pSkCxIbSGaWtfWb2Q9VKeFkOli3vz53hGOsEbT6IsvuE8wqRCfubkh/PBB8j5Ul7vuI+10Ull+yWugGGkH38rZVd4oWyCnJEvB5IcHlHP/kr/ZkphPLwYGekQ4fe0ftWnJw67TWBnRS+CwofUASwhgo9g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <4025d346-848b-730e-38a3-de7763edcf39@suse.com>
Date: Wed, 26 Jul 2023 08:58:20 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] x86/cpu-policy: Advertise MSR_ARCH_CAPS to guests by
 default
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
References: <20230725213611.2405811-1-andrew.cooper3@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230725213611.2405811-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0156.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:98::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8944:EE_
X-MS-Office365-Filtering-Correlation-Id: 6152739b-7557-49e9-fd7b-08db8da5b3c6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	R0g2gyyEVNPuG9Raqwi0nJtHGkVgYUn3EgwFp7MMsYCmOHfYcZsj9ykgigKdO+5bXfNMCWyLJ7duP0vqNbxHDZAiroVK+ygUhmoRS0WDJra9Ib/KlaBq5rYe/55KJn9uy7J++1dokdCZkyLhn9wfVMOEWB9qGt2pUHNiNcoATPt7OtX6KhwYW96/DkVKynhTyubqqWveuCODyJei92XNQdzqnDfQaFM9rUHZ8uLlO1uHajfeCbQg/NrebcX6GStSDAKGfExiPrwrHZolpy9hnGnEgWzVctazBrAdulayGmVEujKkywc1xIMk5esoMxPdUe5oMOb9FbxLHaPFdmKUJExOWz/R9OzsdNKOeC2EcpnKVtX4T0zOYAQHFCaewakZYnW8TKGKqBz8jowaK4hZHW4YNEG1CYBZwG5RIbW74EPGJX93BS4DtZQ1mzyuE6FK6OsgaHQXE49hcjrdmhvpBZNr6YGL7oPfhvXHV0QsnAJPevMkTmnUqSreBp0IB7u1p8UeyksIQ4Q5HvYcOmoPEXwgvjXG4zHGGo0GjyS5m0/KcCMNbvdqUfS52Oy7KYv6SNPNG767LHDRmxtNscUbSYwIT+OYVcg1cDd+ef/PoTXJcDk/843Q2KUnp5kxzzbD/mmaaSIRsLAsnu2L+sV/xw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(39860400002)(136003)(366004)(346002)(376002)(451199021)(6506007)(26005)(186003)(53546011)(2616005)(4326008)(83380400001)(66476007)(316002)(6916009)(6486002)(66556008)(66946007)(8936002)(8676002)(5660300002)(6512007)(41300700001)(478600001)(54906003)(2906002)(38100700002)(36756003)(31696002)(86362001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?d0liaWxHSUF2VzkzK1dCb2Y3R3MwRzVoRlp1Rno2bnJ5UldwR0ZHQ2x6dG52?=
 =?utf-8?B?WjNpR0w2N2FTUVJnYUk4cnJzd1ZBNlh0QXVoVWhudDBlQ1Zoek9yYk5HUU5H?=
 =?utf-8?B?V01jTldDbk1EVk5rWG9rODVqTGVOby9ZNzJwU1Iwenl2TTl6MDVUNFRQWGJI?=
 =?utf-8?B?TUUwcmRJQkdGc3pHK29PckNGN1lVMllLZHQvRXVTdW9UMkgrNjY3SSthdWJx?=
 =?utf-8?B?U1EzYWs5S0s1b2xMSUZWOUZ2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VlM?=
 =?utf-8?B?Y2F3enJST05OUEsyUnJ5VkU2WmRIYTJPRXFseVRka05MVExNMEJLK2NML1k0?=
 =?utf-8?B?NC83THJqc0pncWlOOTdCbGJicjVxL0VOM1lwWm1DK0g2Z0thUXNRMWthMklN?=
 =?utf-8?Q?O6QouEdfnlpwZPmLj573H+nCD?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6152739b-7557-49e9-fd7b-08db8da5b3c6
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 06:58:22.9874
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: pnuceHHJZXxIDAjB4U/OoTEHaucRrG9ckNWy/SjcmXVAqU+lsP0lI2fwjNS2jSnmvHHU61mWqfrisN9pPV4QaA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8944

On 25.07.2023 23:36, Andrew Cooper wrote:
> With xl/libxl now able to control the policy bits for MSR_ARCH_CAPS, it is
> safe to advertise to guests by default.  In turn, we don't need the special
> case to expose details to dom0.
> 
> This advertises MSR_ARCH_CAPS to guests on *all* Intel hardware, even if the
> register content ends up being empty.  This is necessary in order to safely
> level two hosts which cross the Broadwell/Skylake divide.

Could you expand on this, so one won't have to dig out details from
elsewhere?

> On Cascade Lake and later hardware, guests can now see RDCL_NO (not vulnerable
> to Meltdown) amongst others.  This causes substantial performance
> improvements, as guests are no longer applying software mitigations in cases
> where they don't need to.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
> CC: Wei Liu <wl@xen.org>
> 
> Not to go in before Roger's libxl changes...

I was about to comment on the "now able to", when I saw this.

Preferably with a little bit more detail added to the description
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 06:59:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 06:59:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570089.891430 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYUk-0004sS-EX; Wed, 26 Jul 2023 06:59:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570089.891430; Wed, 26 Jul 2023 06:59:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYUk-0004sL-BH; Wed, 26 Jul 2023 06:59:38 +0000
Received: by outflank-mailman (input) for mailman id 570089;
 Wed, 26 Jul 2023 06:59:37 +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
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOYUj-0004s3-Lx
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 06:59:37 +0000
Received: from out-50.mta0.migadu.com (out-50.mta0.migadu.com [91.218.175.50])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fad20ad0-2b81-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 08:59:35 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fad20ad0-2b81-11ee-8613-37d641c3527e
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690354775;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=Uv3CnAnXFWAb1Qfc6DYGZ2zStBaDmHQahM10yM3E8NM=;
	b=jD53phpyWPV1m6lZJFSij23z5l3BtMZ3Nm78UJiIwyWe54WQrTuB+sE65oVwbOCaOC4LVW
	IQLhspnZBS8xdLdXGppCnRW57Ryb0UwsUR0bMOKoxDhTEU7CwRK7a6TaSyxs47bGtrMftD
	EYhZrEwmNT7OG6AMmxQHn4AvJzBEbco=
MIME-Version: 1.0
Subject: Re: [PATCH v2 14/47] nfsd: dynamically allocate the nfsd-filecache
 shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-15-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 14:59:06 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 senozhatsky@chromium.org,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <864F467A-C237-44F9-9271-945146948336@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-15-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> Use new APIs to dynamically allocate the nfsd-filecache shrinker.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:00:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:00:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570091.891440 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYVU-0006H2-MM; Wed, 26 Jul 2023 07:00:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570091.891440; Wed, 26 Jul 2023 07:00:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYVU-0006Gv-Jd; Wed, 26 Jul 2023 07:00:24 +0000
Received: by outflank-mailman (input) for mailman id 570091;
 Wed, 26 Jul 2023 07:00:23 +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
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOYVT-0006Gg-N4
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:00:23 +0000
Received: from out-28.mta0.migadu.com (out-28.mta0.migadu.com [91.218.175.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1653794a-2b82-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 09:00:21 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1653794a-2b82-11ee-8613-37d641c3527e
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690354821;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=OC4KPzU6tciOrfm8EFdW/zf4963ci4mLF+j8l1KE5tM=;
	b=iDZQzOerHRE+IOt6kDpFe/TDB+N4qMvQTQndP12lYqhs3OrJd5JfINtesZHtptfd9iC616
	/Xb+r1wFTA+uxkP+jFrdX8hbQcjrGCMcJ2CcELtL1UjS+fWQpVujDpOM7OXMN1vC4ZHnGG
	o/IYYCnTDc7xLzZrYv28Q3UtMNEdLjE=
MIME-Version: 1.0
Subject: Re: [PATCH v2 15/47] quota: dynamically allocate the dquota-cache
 shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-16-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 14:59:35 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 senozhatsky@chromium.org,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <425A7B54-A16E-4B93-A1EE-F6860F15C559@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-16-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> Use new APIs to dynamically allocate the dquota-cache shrinker.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:00:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:00:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570093.891449 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYVz-0006nk-U6; Wed, 26 Jul 2023 07:00:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570093.891449; Wed, 26 Jul 2023 07:00:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYVz-0006nd-Rc; Wed, 26 Jul 2023 07:00:55 +0000
Received: by outflank-mailman (input) for mailman id 570093;
 Wed, 26 Jul 2023 07:00:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOYVz-0006nN-1x
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:00:55 +0000
Received: from out-60.mta0.migadu.com (out-60.mta0.migadu.com [91.218.175.60])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 299df9a1-2b82-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 09:00:54 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 299df9a1-2b82-11ee-b242-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690354853;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=vPvKdDrljW6F/uCSplNpQplPV8vRRURSjQLOuFds+Ao=;
	b=aaSBBHeBtwwGqsWMnojqRVsl/STDmmnYtUnl5ZO4CtbJBB+yMsEQoYCMTU1jXiNn7BQJ5o
	TY2b0wzcluA2pEgVpI6zUX6jG/ZH5Pzg0tSizSeLRNZh0UJXNUcxmFOyz901cApQh34Dur
	CIKrvfbRyMRXngths0iuBPdRZIsqJNY=
MIME-Version: 1.0
Subject: Re: [PATCH v2 16/47] ubifs: dynamically allocate the ubifs-slab
 shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-17-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:00:21 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 senozhatsky@chromium.org,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <76B579EB-401B-46DD-9666-180F9EAA18BF@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-17-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> Use new APIs to dynamically allocate the ubifs-slab shrinker.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:05:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:05:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570095.891460 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYa7-0007VH-Ez; Wed, 26 Jul 2023 07:05:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570095.891460; Wed, 26 Jul 2023 07:05:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYa7-0007VA-CD; Wed, 26 Jul 2023 07:05:11 +0000
Received: by outflank-mailman (input) for mailman id 570095;
 Wed, 26 Jul 2023 07:05:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOYa6-0007V4-4p
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:05:10 +0000
Received: from out-53.mta1.migadu.com (out-53.mta1.migadu.com [95.215.58.53])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c18ff6a3-2b82-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 09:05:09 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c18ff6a3-2b82-11ee-b242-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690355108;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=KXYamYs9irq65yhoLRu1td82YuFMeMDqOuwaU+oDyHM=;
	b=USoqEnOQU6eM3+N9zIAHCDwhNC+8+UNIWLHIgerhexBlGJCaVmSRSO1wU4o3mjHNGYO9Rs
	DYRZMApHrS1Pjvb6NJH1mJ50Vk6voJ6kQPH4oorM80xUHt6/RAFEITooiN15iQlceLlIh+
	2SDmjYt2iC3yWxkOb7vPU57vNB82awk=
MIME-Version: 1.0
Subject: Re: [PATCH v2 17/47] rcu: dynamically allocate the rcu-lazy shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-18-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:04:30 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 senozhatsky@chromium.org,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <3A164818-56E1-4EB4-A927-1B2D23B81659@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-18-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> =
wrote:
>=20
> Use new APIs to dynamically allocate the rcu-lazy shrinker.
>=20
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> ---
> kernel/rcu/tree_nocb.h | 19 +++++++++++--------
> 1 file changed, 11 insertions(+), 8 deletions(-)
>=20
> diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h
> index 43229d2b0c44..919f17561733 100644
> --- a/kernel/rcu/tree_nocb.h
> +++ b/kernel/rcu/tree_nocb.h
> @@ -1397,12 +1397,7 @@ lazy_rcu_shrink_scan(struct shrinker *shrink, =
struct shrink_control *sc)
> return count ? count : SHRINK_STOP;
> }
>=20
> -static struct shrinker lazy_rcu_shrinker =3D {
> -	.count_objects =3D lazy_rcu_shrink_count,
> -	.scan_objects =3D lazy_rcu_shrink_scan,
> -	.batch =3D 0,
> -	.seeks =3D DEFAULT_SEEKS,
> -};
> +static struct shrinker *lazy_rcu_shrinker;

Seems there is no users of this variable, maybe we could drop
this.



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:06:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:06:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570098.891470 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYb3-00085U-SB; Wed, 26 Jul 2023 07:06:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570098.891470; Wed, 26 Jul 2023 07:06:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYb3-00085N-PK; Wed, 26 Jul 2023 07:06:09 +0000
Received: by outflank-mailman (input) for mailman id 570098;
 Wed, 26 Jul 2023 07:06:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOYb1-00085E-Ty
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:06:07 +0000
Received: from out-7.mta1.migadu.com (out-7.mta1.migadu.com
 [2001:41d0:203:375::7])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e3b6cf1b-2b82-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 09:06:07 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e3b6cf1b-2b82-11ee-b242-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690355165;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=qP6Rsnsz9/WW+azSq2vXZZSPSLEyAJb/Z8peE40gYgo=;
	b=vw9dtxapJigzblTo3NGynfsv+/mQB1bNWjl6Q4rEAUF9PXc7LtA8X1zBeOoHG+17byUEV5
	rePGXHXPmPLeGOzGrE1/eqTwEdZgvDm17pzQtihT75dgxUeL35Q3sxqIVQekgyvV9/7bXJ
	pXhSlPCuY6BK9bze6xRNH/dP9jDuXVc=
MIME-Version: 1.0
Subject: Re: [PATCH v2 18/47] rcu: dynamically allocate the rcu-kfree shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-19-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:05:26 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 senozhatsky@chromium.org,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <07191509-5186-487B-96D5-F859498CB93E@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-19-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> =
wrote:
>=20
> Use new APIs to dynamically allocate the rcu-kfree shrinker.
>=20
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> ---
> kernel/rcu/tree.c | 21 +++++++++++++--------
> 1 file changed, 13 insertions(+), 8 deletions(-)
>=20
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 1449cb69a0e0..d068ce3567fc 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -3445,12 +3445,7 @@ kfree_rcu_shrink_scan(struct shrinker *shrink, =
struct shrink_control *sc)
> return freed =3D=3D 0 ? SHRINK_STOP : freed;
> }
>=20
> -static struct shrinker kfree_rcu_shrinker =3D {
> -	.count_objects =3D kfree_rcu_shrink_count,
> -	.scan_objects =3D kfree_rcu_shrink_scan,
> -	.batch =3D 0,
> -	.seeks =3D DEFAULT_SEEKS,
> -};
> +static struct shrinker *kfree_rcu_shrinker;

Same as patch #17.=


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:10:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:10:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570100.891481 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYfd-00017f-Em; Wed, 26 Jul 2023 07:10:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570100.891481; Wed, 26 Jul 2023 07:10:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYfd-00017Y-AN; Wed, 26 Jul 2023 07:10:53 +0000
Received: by outflank-mailman (input) for mailman id 570100;
 Wed, 26 Jul 2023 07:10:52 +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
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOYfc-00017S-C7
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:10:52 +0000
Received: from out-44.mta0.migadu.com (out-44.mta0.migadu.com [91.218.175.44])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8cb85d9f-2b83-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 09:10:50 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8cb85d9f-2b83-11ee-8613-37d641c3527e
Message-ID: <d41d09bc-7c1c-f708-ecfa-ffac59bf58ad@linux.dev>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690355449;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=Jvc7jyiFGsEgqDLQ8SvDwKCvjECMcl21zak/YPsttTU=;
	b=MJNzwcgKcI8WMs1vcHIk9odpFzXJXYJZkCEqMlLlvbf0FvKHK96bLJs5XTXQyUPcTsHXLS
	nIqAIZhilsKlD4q7ONNAKGG+YEnzT1SMJk3OhEOossreA6CsEZNAbhHhb/1A0W8D/Gm3Q3
	yKiIjz335Q++bI56PmpRINRM4YbGaI0=
Date: Wed, 26 Jul 2023 15:10:21 +0800
MIME-Version: 1.0
Subject: Re: [PATCH v2 19/47] mm: thp: dynamically allocate the thp-related
 shrinkers
To: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz,
 roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org,
 paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com, cel@kernel.org,
 senozhatsky@chromium.org, yujie.liu@intel.com, gregkh@linuxfoundation.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-20-zhengqi.arch@bytedance.com>
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-20-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Migadu-Flow: FLOW_OUT



On 2023/7/24 17:43, Qi Zheng wrote:
> Use new APIs to dynamically allocate the thp-zero and thp-deferred_split
> shrinkers.
>
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> ---
>   mm/huge_memory.c | 69 +++++++++++++++++++++++++++++++-----------------
>   1 file changed, 45 insertions(+), 24 deletions(-)
>
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index 8c94b34024a2..4db5a1834d81 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -65,7 +65,11 @@ unsigned long transparent_hugepage_flags __read_mostly =
>   	(1<<TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG)|
>   	(1<<TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG);
>   
> -static struct shrinker deferred_split_shrinker;
> +static struct shrinker *deferred_split_shrinker;
> +static unsigned long deferred_split_count(struct shrinker *shrink,
> +					  struct shrink_control *sc);
> +static unsigned long deferred_split_scan(struct shrinker *shrink,
> +					 struct shrink_control *sc);
>   
>   static atomic_t huge_zero_refcount;
>   struct page *huge_zero_page __read_mostly;
> @@ -229,11 +233,7 @@ static unsigned long shrink_huge_zero_page_scan(struct shrinker *shrink,
>   	return 0;
>   }
>   
> -static struct shrinker huge_zero_page_shrinker = {
> -	.count_objects = shrink_huge_zero_page_count,
> -	.scan_objects = shrink_huge_zero_page_scan,
> -	.seeks = DEFAULT_SEEKS,
> -};
> +static struct shrinker *huge_zero_page_shrinker;

Same as patch #17.

>   
>   #ifdef CONFIG_SYSFS
>   static ssize_t enabled_show(struct kobject *kobj,
> @@ -454,6 +454,40 @@ static inline void hugepage_exit_sysfs(struct kobject *hugepage_kobj)
>   }
>   #endif /* CONFIG_SYSFS */
>   
> +static int thp_shrinker_init(void)

Better to declare it as __init.

> +{
> +	huge_zero_page_shrinker = shrinker_alloc(0, "thp-zero");
> +	if (!huge_zero_page_shrinker)
> +		return -ENOMEM;
> +
> +	deferred_split_shrinker = shrinker_alloc(SHRINKER_NUMA_AWARE |
> +						 SHRINKER_MEMCG_AWARE |
> +						 SHRINKER_NONSLAB,
> +						 "thp-deferred_split");
> +	if (!deferred_split_shrinker) {
> +		shrinker_free_non_registered(huge_zero_page_shrinker);
> +		return -ENOMEM;
> +	}
> +
> +	huge_zero_page_shrinker->count_objects = shrink_huge_zero_page_count;
> +	huge_zero_page_shrinker->scan_objects = shrink_huge_zero_page_scan;
> +	huge_zero_page_shrinker->seeks = DEFAULT_SEEKS;
> +	shrinker_register(huge_zero_page_shrinker);
> +
> +	deferred_split_shrinker->count_objects = deferred_split_count;
> +	deferred_split_shrinker->scan_objects = deferred_split_scan;
> +	deferred_split_shrinker->seeks = DEFAULT_SEEKS;
> +	shrinker_register(deferred_split_shrinker);
> +
> +	return 0;
> +}
> +
> +static void thp_shrinker_exit(void)

Same as here.

> +{
> +	shrinker_unregister(huge_zero_page_shrinker);
> +	shrinker_unregister(deferred_split_shrinker);
> +}
> +
>   static int __init hugepage_init(void)
>   {
>   	int err;
> @@ -482,12 +516,9 @@ static int __init hugepage_init(void)
>   	if (err)
>   		goto err_slab;
>   
> -	err = register_shrinker(&huge_zero_page_shrinker, "thp-zero");
> -	if (err)
> -		goto err_hzp_shrinker;
> -	err = register_shrinker(&deferred_split_shrinker, "thp-deferred_split");
> +	err = thp_shrinker_init();
>   	if (err)
> -		goto err_split_shrinker;
> +		goto err_shrinker;
>   
>   	/*
>   	 * By default disable transparent hugepages on smaller systems,
> @@ -505,10 +536,8 @@ static int __init hugepage_init(void)
>   
>   	return 0;
>   err_khugepaged:
> -	unregister_shrinker(&deferred_split_shrinker);
> -err_split_shrinker:
> -	unregister_shrinker(&huge_zero_page_shrinker);
> -err_hzp_shrinker:
> +	thp_shrinker_exit();
> +err_shrinker:
>   	khugepaged_destroy();
>   err_slab:
>   	hugepage_exit_sysfs(hugepage_kobj);
> @@ -2851,7 +2880,7 @@ void deferred_split_folio(struct folio *folio)
>   #ifdef CONFIG_MEMCG
>   		if (memcg)
>   			set_shrinker_bit(memcg, folio_nid(folio),
> -					 deferred_split_shrinker.id);
> +					 deferred_split_shrinker->id);
>   #endif
>   	}
>   	spin_unlock_irqrestore(&ds_queue->split_queue_lock, flags);
> @@ -2925,14 +2954,6 @@ static unsigned long deferred_split_scan(struct shrinker *shrink,
>   	return split;
>   }
>   
> -static struct shrinker deferred_split_shrinker = {
> -	.count_objects = deferred_split_count,
> -	.scan_objects = deferred_split_scan,
> -	.seeks = DEFAULT_SEEKS,
> -	.flags = SHRINKER_NUMA_AWARE | SHRINKER_MEMCG_AWARE |
> -		 SHRINKER_NONSLAB,
> -};
> -
>   #ifdef CONFIG_DEBUG_FS
>   static void split_huge_pages_all(void)
>   {



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:12:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:12:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570102.891490 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYh5-0001eV-OW; Wed, 26 Jul 2023 07:12:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570102.891490; Wed, 26 Jul 2023 07:12:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYh5-0001eO-Lf; Wed, 26 Jul 2023 07:12:23 +0000
Received: by outflank-mailman (input) for mailman id 570102;
 Wed, 26 Jul 2023 07:12:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOYh4-0001eI-Ks
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:12:22 +0000
Received: from out-25.mta1.migadu.com (out-25.mta1.migadu.com [95.215.58.25])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c332b527-2b83-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 09:12:21 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c332b527-2b83-11ee-b242-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690355540;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=3alJFErDP2kwm77gyuNSGQkYOJLqXt+yE3nd00upks4=;
	b=vFtGC5wfJTYRsW6KFexwkQT3iRPwDHegF5FOg2h20LJFCKDKgiueZl1TgVj25vGIeLy7ev
	gbMI47WpJ3SatO/WJHqfwuqpLbaPS/nnmDmyz+2u4x5goaLDmfN+L7AmLPQ0S7B/YtBgkI
	d+QZKno/sWpLFHvrrBRFsFnaygfyjd4=
MIME-Version: 1.0
Subject: Re: [PATCH v2 20/47] sunrpc: dynamically allocate the sunrpc_cred
 shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-21-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:11:36 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 senozhatsky@chromium.org,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <D2E8BDAB-A8E8-40D2-BCC5-FEF97C9D721D@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-21-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> Use new APIs to dynamically allocate the sunrpc_cred shrinker.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:14:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:14:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570105.891500 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYij-0002E0-3e; Wed, 26 Jul 2023 07:14:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570105.891500; Wed, 26 Jul 2023 07:14:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYij-0002Dt-0h; Wed, 26 Jul 2023 07:14:05 +0000
Received: by outflank-mailman (input) for mailman id 570105;
 Wed, 26 Jul 2023 07:14:03 +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
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOYih-0002Dj-LB
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:14:03 +0000
Received: from out-3.mta0.migadu.com (out-3.mta0.migadu.com [91.218.175.3])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ff11c44a-2b83-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 09:14:01 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ff11c44a-2b83-11ee-8613-37d641c3527e
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690355641;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=PGcKZp3hFkU5xFrSCjAkw6H7DFoCu3eaWoJYWwGl/BE=;
	b=oAdnd9nZjeI3kyPEsvbWMnutbGwA6A/dnneU8CJq7+Jt5loXWooRhnwIByjGtqjMSkXONA
	pNjiGN0aO6zYh0sGJrXLfhIGW2JwY9JyCA6cMT7CdHDW/adI6zyBptMVHroPA7pSViOJ/f
	hCfYb58R4eJqbPwcBX6PzM13HtrcK50=
MIME-Version: 1.0
Subject: Re: [PATCH v2 21/47] mm: workingset: dynamically allocate the
 mm-shadow shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-22-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:13:37 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <08F2140B-0684-4FB0-8FB9-CEB88882F884@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-22-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> =
wrote:
>=20
> Use new APIs to dynamically allocate the mm-shadow shrinker.
>=20
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> ---
> mm/workingset.c | 26 ++++++++++++++------------
> 1 file changed, 14 insertions(+), 12 deletions(-)
>=20
> diff --git a/mm/workingset.c b/mm/workingset.c
> index 4686ae363000..4bc85f739b13 100644
> --- a/mm/workingset.c
> +++ b/mm/workingset.c
> @@ -762,12 +762,7 @@ static unsigned long scan_shadow_nodes(struct =
shrinker *shrinker,
> NULL);
> }
>=20
> -static struct shrinker workingset_shadow_shrinker =3D {
> -	.count_objects =3D count_shadow_nodes,
> -	.scan_objects =3D scan_shadow_nodes,
> -	.seeks =3D 0, /* ->count reports only fully expendable nodes */
> -	.flags =3D SHRINKER_NUMA_AWARE | SHRINKER_MEMCG_AWARE,
> -};
> +static struct shrinker *workingset_shadow_shrinker;


Same as patch #17.=


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:16:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:16:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570110.891511 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYlC-0002pP-H3; Wed, 26 Jul 2023 07:16:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570110.891511; Wed, 26 Jul 2023 07:16:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYlC-0002pH-Cq; Wed, 26 Jul 2023 07:16:38 +0000
Received: by outflank-mailman (input) for mailman id 570110;
 Wed, 26 Jul 2023 07:16:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOYlA-0002pB-Rw
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:16:36 +0000
Received: from out-7.mta0.migadu.com (out-7.mta0.migadu.com [91.218.175.7])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5ae9f9d3-2b84-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 09:16:35 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5ae9f9d3-2b84-11ee-b242-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690355795;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=D9nV4Gkwsjrr4/95UoI7nAR6TO/qI/lblnfLq6UsstM=;
	b=GN2j9vh2yOL79kRSdyksTtnS6NLSWm3pqace0LlbvJbsUtBuOWKaOFqFI1x2Gwlrwmnstj
	qq8J0QgybstmeW5uMSmzXD5PGEe4vfK3am0PPA/1MT9BMOHcQr+Msowj7sFjpB4siS73jQ
	C2Exy1Nss1FPxGRLcy6vcv7TsLEuQ08=
MIME-Version: 1.0
Subject: Re: [PATCH v2 22/47] drm/i915: dynamically allocate the i915_gem_mm
 shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-23-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:15:47 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <82139544-DF2B-42FB-A323-5E4F0598EF4E@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-23-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the i915_gem_mm shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct drm_i915_private.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:23:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:23:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570114.891520 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYrS-0004Jj-4i; Wed, 26 Jul 2023 07:23:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570114.891520; Wed, 26 Jul 2023 07:23:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYrS-0004Jc-25; Wed, 26 Jul 2023 07:23:06 +0000
Received: by outflank-mailman (input) for mailman id 570114;
 Wed, 26 Jul 2023 07:23:04 +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
 <SRS0=+seJ=DM=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qOYrQ-0004JS-Rz
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:23:04 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 418c92ed-2b85-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 09:23:02 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.163.26.92])
 by support.bugseng.com (Postfix) with ESMTPSA id F07B14EE0738;
 Wed, 26 Jul 2023 09:23:00 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 418c92ed-2b85-11ee-8613-37d641c3527e
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH] xen: use parameter name 'mcs' in arch_do_multicall_call()
Date: Wed, 26 Jul 2023 09:22:52 +0200
Message-Id: <cf380b972333d56858b10d6dd61b6033d3782fce.1690355367.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Make function declaration and definition consistent using the same
parameter name ('mcs' do denote a pointer to an 'mc_state').
This addresses a violation of MISRA C:2012 Rule 8.3: "All declarations of an
object or function shall use the same names and type qualifiers".

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/arch/arm/traps.c        | 4 ++--
 xen/include/xen/multicall.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index d1ef787638..eab2fcfc02 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1470,9 +1470,9 @@ static bool check_multicall_32bit_clean(struct multicall_entry *multi)
     return true;
 }
 
-enum mc_disposition arch_do_multicall_call(struct mc_state *state)
+enum mc_disposition arch_do_multicall_call(struct mc_state *mcs)
 {
-    struct multicall_entry *multi = &state->call;
+    struct multicall_entry *multi = &mcs->call;
 
     if ( multi->op >= ARRAY_SIZE(hypercall_args) )
     {
diff --git a/xen/include/xen/multicall.h b/xen/include/xen/multicall.h
index ac8238660a..5bebeca7b2 100644
--- a/xen/include/xen/multicall.h
+++ b/xen/include/xen/multicall.h
@@ -25,6 +25,6 @@ enum mc_disposition {
     mc_continue,
     mc_exit,
     mc_preempt,
-} arch_do_multicall_call(struct mc_state *mc);
+} arch_do_multicall_call(struct mc_state *mcs);
 
 #endif /* __XEN_MULTICALL_H__ */
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:24:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:24:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570119.891530 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYsj-0004qV-Eb; Wed, 26 Jul 2023 07:24:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570119.891530; Wed, 26 Jul 2023 07:24:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYsj-0004qO-BG; Wed, 26 Jul 2023 07:24:25 +0000
Received: by outflank-mailman (input) for mailman id 570119;
 Wed, 26 Jul 2023 07:24:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOYsi-0004qC-HH
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:24:24 +0000
Received: from out-34.mta1.migadu.com (out-34.mta1.migadu.com [95.215.58.34])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 71823979-2b85-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 09:24:23 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 71823979-2b85-11ee-b242-6b7b168915f2
Message-ID: <17de3f5b-3bef-be38-9801-0e84cfe8539b@linux.dev>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690356262;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=nTTDffXkzxVXBy4JmC8uLINROt4TIYQk3fp5u25NUNM=;
	b=BnM6ObbVvlHjNT0EQ9FNfJjw5uDAlrCLhNEcIu2YqjXKf/vGuoud+hHft88ZtRNtDuEwCg
	tBOK3Iz/LamlBXXb/s2VBKik1ft+6SPkGLcP8h8g11eIlgemJmkdkTnX+9qLAUoZF66N+E
	FHLnBM7v5jm+QRNUOfsvfgruR8wkbzM=
Date: Wed, 26 Jul 2023 15:24:02 +0800
MIME-Version: 1.0
Subject: Re: [PATCH v2 23/47] drm/msm: dynamically allocate the drm-msm_gem
 shrinker
To: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz,
 roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org,
 paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com, cel@kernel.org,
 senozhatsky@chromium.org, yujie.liu@intel.com, gregkh@linuxfoundation.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-24-zhengqi.arch@bytedance.com>
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-24-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Migadu-Flow: FLOW_OUT



On 2023/7/24 17:43, Qi Zheng wrote:
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the drm-msm_gem shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct msm_drm_private.
>
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

A nit bellow.

> ---
>   drivers/gpu/drm/msm/msm_drv.c          |  4 ++-
>   drivers/gpu/drm/msm/msm_drv.h          |  4 +--
>   drivers/gpu/drm/msm/msm_gem_shrinker.c | 36 ++++++++++++++++----------
>   3 files changed, 28 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> index 891eff8433a9..7f6933be703f 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -461,7 +461,9 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
>   	if (ret)
>   		goto err_msm_uninit;
>   
> -	msm_gem_shrinker_init(ddev);
> +	ret = msm_gem_shrinker_init(ddev);
> +	if (ret)
> +		goto err_msm_uninit;
>   
>   	if (priv->kms_init) {
>   		ret = priv->kms_init(ddev);
> diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
> index e13a8cbd61c9..84523d4a1e58 100644
> --- a/drivers/gpu/drm/msm/msm_drv.h
> +++ b/drivers/gpu/drm/msm/msm_drv.h
> @@ -217,7 +217,7 @@ struct msm_drm_private {
>   	} vram;
>   
>   	struct notifier_block vmap_notifier;
> -	struct shrinker shrinker;
> +	struct shrinker *shrinker;
>   
>   	struct drm_atomic_state *pm_state;
>   
> @@ -279,7 +279,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
>   unsigned long msm_gem_shrinker_shrink(struct drm_device *dev, unsigned long nr_to_scan);
>   #endif
>   
> -void msm_gem_shrinker_init(struct drm_device *dev);
> +int msm_gem_shrinker_init(struct drm_device *dev);
>   void msm_gem_shrinker_cleanup(struct drm_device *dev);
>   
>   int msm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma);
> diff --git a/drivers/gpu/drm/msm/msm_gem_shrinker.c b/drivers/gpu/drm/msm/msm_gem_shrinker.c
> index f38296ad8743..7daab1298c11 100644
> --- a/drivers/gpu/drm/msm/msm_gem_shrinker.c
> +++ b/drivers/gpu/drm/msm/msm_gem_shrinker.c
> @@ -34,8 +34,7 @@ static bool can_block(struct shrink_control *sc)
>   static unsigned long
>   msm_gem_shrinker_count(struct shrinker *shrinker, struct shrink_control *sc)
>   {
> -	struct msm_drm_private *priv =
> -		container_of(shrinker, struct msm_drm_private, shrinker);
> +	struct msm_drm_private *priv = shrinker->private_data;
>   	unsigned count = priv->lru.dontneed.count;
>   
>   	if (can_swap())
> @@ -100,8 +99,7 @@ active_evict(struct drm_gem_object *obj)
>   static unsigned long
>   msm_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc)
>   {
> -	struct msm_drm_private *priv =
> -		container_of(shrinker, struct msm_drm_private, shrinker);
> +	struct msm_drm_private *priv = shrinker->private_data;
>   	struct {
>   		struct drm_gem_lru *lru;
>   		bool (*shrink)(struct drm_gem_object *obj);
> @@ -148,10 +146,11 @@ msm_gem_shrinker_shrink(struct drm_device *dev, unsigned long nr_to_scan)
>   	struct shrink_control sc = {
>   		.nr_to_scan = nr_to_scan,
>   	};
> -	int ret;
> +	unsigned long ret = SHRINK_STOP;
>   
>   	fs_reclaim_acquire(GFP_KERNEL);
> -	ret = msm_gem_shrinker_scan(&priv->shrinker, &sc);
> +	if (priv->shrinker)
> +		ret = msm_gem_shrinker_scan(priv->shrinker, &sc);
>   	fs_reclaim_release(GFP_KERNEL);
>   
>   	return ret;
> @@ -210,16 +209,27 @@ msm_gem_shrinker_vmap(struct notifier_block *nb, unsigned long event, void *ptr)
>    *
>    * This function registers and sets up the msm shrinker.
>    */
> -void msm_gem_shrinker_init(struct drm_device *dev)
> +int msm_gem_shrinker_init(struct drm_device *dev)
>   {
>   	struct msm_drm_private *priv = dev->dev_private;
> -	priv->shrinker.count_objects = msm_gem_shrinker_count;
> -	priv->shrinker.scan_objects = msm_gem_shrinker_scan;
> -	priv->shrinker.seeks = DEFAULT_SEEKS;
> -	WARN_ON(register_shrinker(&priv->shrinker, "drm-msm_gem"));
> +
> +	priv->shrinker = shrinker_alloc(0, "drm-msm_gem");
> +	if (!priv->shrinker) {

Just "if (WARN_ON(!priv->shrinker))"

> +		WARN_ON(1);
> +		return -ENOMEM;
> +	}
> +
> +	priv->shrinker->count_objects = msm_gem_shrinker_count;
> +	priv->shrinker->scan_objects = msm_gem_shrinker_scan;
> +	priv->shrinker->seeks = DEFAULT_SEEKS;
> +	priv->shrinker->private_data = priv;
> +
> +	shrinker_register(priv->shrinker);
>   
>   	priv->vmap_notifier.notifier_call = msm_gem_shrinker_vmap;
>   	WARN_ON(register_vmap_purge_notifier(&priv->vmap_notifier));
> +
> +	return 0;
>   }
>   
>   /**
> @@ -232,8 +242,8 @@ void msm_gem_shrinker_cleanup(struct drm_device *dev)
>   {
>   	struct msm_drm_private *priv = dev->dev_private;
>   
> -	if (priv->shrinker.nr_deferred) {
> +	if (priv->shrinker) {
>   		WARN_ON(unregister_vmap_purge_notifier(&priv->vmap_notifier));
> -		unregister_shrinker(&priv->shrinker);
> +		shrinker_unregister(priv->shrinker);
>   	}
>   }



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:25:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:25:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570122.891540 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYtz-0005Us-Ru; Wed, 26 Jul 2023 07:25:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570122.891540; Wed, 26 Jul 2023 07:25:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYtz-0005Ul-P8; Wed, 26 Jul 2023 07:25:43 +0000
Received: by outflank-mailman (input) for mailman id 570122;
 Wed, 26 Jul 2023 07:25:42 +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
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOYty-0005Ub-Ub
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:25:42 +0000
Received: from out-62.mta0.migadu.com (out-62.mta0.migadu.com [91.218.175.62])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9fadd459-2b85-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 09:25:40 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9fadd459-2b85-11ee-8613-37d641c3527e
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690356339;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=zvdjs6nZtoAJTeUNZnzlMBg+3W9EeQfEjhMJc2aooOM=;
	b=S2kua2S04Evo6/UraSJyk1agL/DLGyhTxgzf2kveiPAUMLzy8KFKZaoPl72LwAbMUUU5KX
	yI90TImY1RmSccSZNS94f8DfCPZ1jkBAfVxRDDBOpVRhB+p5BTP1ltZuaxYaeg0c8hKX8y
	9ZHbolk78fhzGoCn5zkqLPSgrNIAnzc=
MIME-Version: 1.0
Subject: Re: [PATCH v2 25/47] dm: dynamically allocate the dm-bufio shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-26-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:24:47 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 senozhatsky@chromium.org,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <BE042CCF-24A0-4311-B245-25C675974173@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-26-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the dm-bufio shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct dm_bufio_client.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:26:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:26:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570124.891549 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYuv-000643-6A; Wed, 26 Jul 2023 07:26:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570124.891549; Wed, 26 Jul 2023 07:26:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYuv-00063w-3e; Wed, 26 Jul 2023 07:26:41 +0000
Received: by outflank-mailman (input) for mailman id 570124;
 Wed, 26 Jul 2023 07:26:12 +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
 <SRS0=PSyE=DM=fromorbit.com=david@srs-se1.protection.inumbo.net>)
 id 1qOYuR-0005Ub-Sz
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:26:12 +0000
Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com
 [2607:f8b0:4864:20::42e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b00f842a-2b85-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 09:26:08 +0200 (CEST)
Received: by mail-pf1-x42e.google.com with SMTP id
 d2e1a72fcca58-668704a5b5bso5929168b3a.0
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 00:26:08 -0700 (PDT)
Received: from dread.disaster.area (pa49-186-119-116.pa.vic.optusnet.com.au.
 [49.186.119.116]) by smtp.gmail.com with ESMTPSA id
 r5-20020a62e405000000b00666e649ca46sm10751809pfh.101.2023.07.26.00.26.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 00:26:06 -0700 (PDT)
Received: from dave by dread.disaster.area with local (Exim 4.96)
 (envelope-from <david@fromorbit.com>) id 1qOYuK-00AfFC-0I;
 Wed, 26 Jul 2023 17:26:04 +1000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b00f842a-2b85-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=fromorbit-com.20221208.gappssmtp.com; s=20221208; t=1690356367; x=1690961167;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=+zeJUC9bLKU1rvuVX6lYw88hUmzqKAeHPtzffozeycY=;
        b=tq09HWgUpDUq6byqrA2ODCQvkmm9az77yWJFeqeVMy0FdFbQydZS+cUOs64uJ2SB3t
         JVe6zLPb5fssr5t5MVQUOU3aAgE6xxOU2jteEAzPtsSb8VWd+wB8OkrdKfGE1jZhlj5w
         TjyyAjaB4CZbrKROQT36TogKeOKjWN45v44UiK/0cxwlhI07RMRGs/cyjwVDCOvRwded
         lUKql7WZYCe6f5lQSR03cISDY6tgj5wgcwRkwmI723xyLURdjFU3QXYzRwiEbnZzpb+Y
         l5EpmyZiiiT3lVpIPopVTNPz1HtZxyTgaW+3XYB75cUNHtZ/C6Tv2cVXxlw6MGh6VRdH
         zVDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690356367; x=1690961167;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=+zeJUC9bLKU1rvuVX6lYw88hUmzqKAeHPtzffozeycY=;
        b=ZGUOfa1toK6SQyVZJarM8UyvYRa2CNdrbmOWhA1NV19U9Wo8+2E2fly19agZe+mi3V
         TwRxuz5rtYudFYREdjI+m3ByLgPFJeU6XnSyrDzy1TKaDhMxysDkIHPTtaQk6ltiAyeA
         SwZ04GuMZqrUafBTwbmPKgRrK24R8OCcqhQQc69xb8iMoI6rln4ESWia0qlC6SYVszN+
         JAWIvKLnR1vu+oTpZ7VY/EOAPJmbkX2V8jaNlj+buChtBPfp/JK33kUV2hNdjF+AxWX7
         ka819+EY5U/0sHpp4t9hjzbCtSD0fcRg9LF3RoeAueW6VJWYRN7MUtnxk9p98tbQG30c
         Ymnw==
X-Gm-Message-State: ABy/qLaT1zUfKs+wPhQlcpdKI4k8zzjUf2t403quHFswvpvWqx6JmYDO
	+5RmHxuEDcnmaYYzfR435ZvuMQ==
X-Google-Smtp-Source: APBJJlH5b0OufxURLtAQUAf05ozn4hmRBD/Qn/v7OHyNHGefhP7kmXIN/eqXKV4z4NaYW1ZZNRUFVA==
X-Received: by 2002:a05:6a00:a0d:b0:67a:a906:9edb with SMTP id p13-20020a056a000a0d00b0067aa9069edbmr1921084pfh.30.1690356367307;
        Wed, 26 Jul 2023 00:26:07 -0700 (PDT)
Date: Wed, 26 Jul 2023 17:26:04 +1000
From: Dave Chinner <david@fromorbit.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: akpm@linux-foundation.org, tkhai@ya.ru, vbabka@suse.cz,
	roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org,
	paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com,
	cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com,
	gregkh@linuxfoundation.org, muchun.song@linux.dev,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
	kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org, linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org, netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com, linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 03/47] mm: shrinker: add infrastructure for
 dynamically allocating shrinker
Message-ID: <ZMDKjBCZH6+OP5gW@dread.disaster.area>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-4-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20230724094354.90817-4-zhengqi.arch@bytedance.com>

On Mon, Jul 24, 2023 at 05:43:10PM +0800, Qi Zheng wrote:
> Currently, the shrinker instances can be divided into the following three
> types:
> 
> a) global shrinker instance statically defined in the kernel, such as
>    workingset_shadow_shrinker.
> 
> b) global shrinker instance statically defined in the kernel modules, such
>    as mmu_shrinker in x86.
> 
> c) shrinker instance embedded in other structures.
> 
> For case a, the memory of shrinker instance is never freed. For case b,
> the memory of shrinker instance will be freed after synchronize_rcu() when
> the module is unloaded. For case c, the memory of shrinker instance will
> be freed along with the structure it is embedded in.
> 
> In preparation for implementing lockless slab shrink, we need to
> dynamically allocate those shrinker instances in case c, then the memory
> can be dynamically freed alone by calling kfree_rcu().
> 
> So this commit adds the following new APIs for dynamically allocating
> shrinker, and add a private_data field to struct shrinker to record and
> get the original embedded structure.
> 
> 1. shrinker_alloc()
> 
> Used to allocate shrinker instance itself and related memory, it will
> return a pointer to the shrinker instance on success and NULL on failure.
> 
> 2. shrinker_free_non_registered()
> 
> Used to destroy the non-registered shrinker instance.

This is a bit nasty

> 
> 3. shrinker_register()
> 
> Used to register the shrinker instance, which is same as the current
> register_shrinker_prepared().
> 
> 4. shrinker_unregister()

rename this "shrinker_free()" and key the two different freeing
cases on the SHRINKER_REGISTERED bit rather than mostly duplicating
the two.

void shrinker_free(struct shrinker *shrinker)
{
	struct dentry *debugfs_entry = NULL;
	int debugfs_id;

	if (!shrinker)
		return;

	down_write(&shrinker_rwsem);
	if (shrinker->flags & SHRINKER_REGISTERED) {
		list_del(&shrinker->list);
		debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);
	} else if (IS_ENABLED(CONFIG_SHRINKER_DEBUG)) {
		kfree_const(shrinker->name);
	}

	if (shrinker->flags & SHRINKER_MEMCG_AWARE)
		unregister_memcg_shrinker(shrinker);
	up_write(&shrinker_rwsem);

	if (debugfs_entry)
		shrinker_debugfs_remove(debugfs_entry, debugfs_id);

	kfree(shrinker->nr_deferred);
	kfree(shrinker);
}
EXPORT_SYMBOL_GPL(shrinker_free);

-- 
Dave Chinner
david@fromorbit.com


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:26:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:26:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570126.891560 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYv4-0006Me-Eh; Wed, 26 Jul 2023 07:26:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570126.891560; Wed, 26 Jul 2023 07:26:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYv4-0006MX-Bc; Wed, 26 Jul 2023 07:26:50 +0000
Received: by outflank-mailman (input) for mailman id 570126;
 Wed, 26 Jul 2023 07:26:48 +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
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOYv2-0006LX-KD
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:26:48 +0000
Received: from out-6.mta0.migadu.com (out-6.mta0.migadu.com [91.218.175.6])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c6ba701f-2b85-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 09:26:46 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c6ba701f-2b85-11ee-8613-37d641c3527e
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690356405;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=x/YPwJU0rwLy+AuHnuxjdCUhH1EzE6WkopZ0kgAJ1Qo=;
	b=UA4cvi/GGMdckJQ6g4p3+u38P404cT3MaC3q014wQwvll1a4nrZdfsP6/l2xBOvqxQBZnG
	/GB100BFGEJn37pYrEcJWPkcPwCehM0mCMv1erArHez8P+wU/wx/xg2YNYRHWyz7GvCoJN
	LWY2Z8xIEtpCzuJK57wk7wbFhJGlyYE=
MIME-Version: 1.0
Subject: Re: [PATCH v2 26/47] dm zoned: dynamically allocate the dm-zoned-meta
 shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-27-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:25:47 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 senozhatsky@chromium.org,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <BAEA7759-FA46-40A3-B37B-AE657905A25F@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-27-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the dm-zoned-meta shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct dmz_metadata.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:28:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:28:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570130.891570 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYwA-0007Ai-Q1; Wed, 26 Jul 2023 07:27:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570130.891570; Wed, 26 Jul 2023 07:27:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOYwA-0007Ab-LQ; Wed, 26 Jul 2023 07:27:58 +0000
Received: by outflank-mailman (input) for mailman id 570130;
 Wed, 26 Jul 2023 07:27:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOYw9-0007AK-3t
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:27:57 +0000
Received: from out-17.mta0.migadu.com (out-17.mta0.migadu.com
 [2001:41d0:1004:224b::11])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f02c2c96-2b85-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 09:27:56 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f02c2c96-2b85-11ee-b242-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690356475;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=kddOZo1OB/dnx2Sd2Hp9HvVcJFH2vK8XN/l3RDrCzYA=;
	b=a/sL/5lBqKAXrNPPoGDoF4xs326hzfVSG6fDcE24LmH82hZ/SqypmSeuU9lQJ3KTx+xcp1
	7al1E8o2xtQTLBYQCCJl5EzU27s8InsUsoNIWntcSz8ycucQarnPdtrwtOYnknCdh1RCgu
	fJXvZ2Nwuby67i5oc/L72SWSvxqIPXA=
MIME-Version: 1.0
Subject: Re: [PATCH v2 27/47] md/raid5: dynamically allocate the md-raid5
 shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-28-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:27:13 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <8A1603B9-570E-45DE-9597-90C3E2825A7A@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-28-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the md-raid5 shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct r5conf.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:32:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:32:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570134.891580 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZ0Y-0000Dc-Ch; Wed, 26 Jul 2023 07:32:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570134.891580; Wed, 26 Jul 2023 07:32:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZ0Y-0000DV-7W; Wed, 26 Jul 2023 07:32:30 +0000
Received: by outflank-mailman (input) for mailman id 570134;
 Wed, 26 Jul 2023 07:32:29 +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
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOZ0X-0000DJ-3V
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:32:29 +0000
Received: from out-9.mta1.migadu.com (out-9.mta1.migadu.com [95.215.58.9])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 91bb1b9f-2b86-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 09:32:26 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 91bb1b9f-2b86-11ee-8613-37d641c3527e
Message-ID: <4ee26da4-314e-0517-5d9a-31fb107368ef@linux.dev>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690356746;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=OYGRVTqgscFQdcJoAIv1RQJgZK2J3Xems6RanwsA4o0=;
	b=GCsKw+CqeG0NLvU5JG9vhNLkiCqBIozjq4+mghrN4n54qEc8Ada19ZBzziy+rqbgGP2UKc
	TRnfIbI6wQqD1XzBynZ64zgbT937OIDi9314tjiKBhNwZptVDCqjhQglYT3NeOO47ZzKdD
	/L1dy0OB1iSvzxJ2Vh5k44+kOPJOpuA=
Date: Wed, 26 Jul 2023 15:32:10 +0800
MIME-Version: 1.0
Subject: Re: [PATCH v2 28/47] bcache: dynamically allocate the md-bcache
 shrinker
To: Qi Zheng <zhengqi.arch@bytedance.com>, akpm@linux-foundation.org,
 david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz, roman.gushchin@linux.dev,
 djwong@kernel.org, brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu,
 steven.price@arm.com, cel@kernel.org, senozhatsky@chromium.org,
 yujie.liu@intel.com, gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-29-zhengqi.arch@bytedance.com>
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-29-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Migadu-Flow: FLOW_OUT



On 2023/7/24 17:43, Qi Zheng wrote:
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the md-bcache shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct cache_set.
>
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> ---
>   drivers/md/bcache/bcache.h |  2 +-
>   drivers/md/bcache/btree.c  | 27 ++++++++++++++++-----------
>   drivers/md/bcache/sysfs.c  |  3 ++-
>   3 files changed, 19 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
> index 5a79bb3c272f..c622bc50f81b 100644
> --- a/drivers/md/bcache/bcache.h
> +++ b/drivers/md/bcache/bcache.h
> @@ -541,7 +541,7 @@ struct cache_set {
>   	struct bio_set		bio_split;
>   
>   	/* For the btree cache */
> -	struct shrinker		shrink;
> +	struct shrinker		*shrink;
>   
>   	/* For the btree cache and anything allocation related */
>   	struct mutex		bucket_lock;
> diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
> index fd121a61f17c..c176c7fc77d9 100644
> --- a/drivers/md/bcache/btree.c
> +++ b/drivers/md/bcache/btree.c
> @@ -667,7 +667,7 @@ static int mca_reap(struct btree *b, unsigned int min_order, bool flush)
>   static unsigned long bch_mca_scan(struct shrinker *shrink,
>   				  struct shrink_control *sc)
>   {
> -	struct cache_set *c = container_of(shrink, struct cache_set, shrink);
> +	struct cache_set *c = shrink->private_data;
>   	struct btree *b, *t;
>   	unsigned long i, nr = sc->nr_to_scan;
>   	unsigned long freed = 0;
> @@ -734,7 +734,7 @@ static unsigned long bch_mca_scan(struct shrinker *shrink,
>   static unsigned long bch_mca_count(struct shrinker *shrink,
>   				   struct shrink_control *sc)
>   {
> -	struct cache_set *c = container_of(shrink, struct cache_set, shrink);
> +	struct cache_set *c = shrink->private_data;
>   
>   	if (c->shrinker_disabled)
>   		return 0;
> @@ -752,8 +752,8 @@ void bch_btree_cache_free(struct cache_set *c)
>   
>   	closure_init_stack(&cl);
>   
> -	if (c->shrink.list.next)
> -		unregister_shrinker(&c->shrink);
> +	if (c->shrink)
> +		shrinker_unregister(c->shrink);
>   
>   	mutex_lock(&c->bucket_lock);
>   
> @@ -828,14 +828,19 @@ int bch_btree_cache_alloc(struct cache_set *c)
>   		c->verify_data = NULL;
>   #endif
>   
> -	c->shrink.count_objects = bch_mca_count;
> -	c->shrink.scan_objects = bch_mca_scan;
> -	c->shrink.seeks = 4;
> -	c->shrink.batch = c->btree_pages * 2;
> +	c->shrink = shrinker_alloc(0, "md-bcache:%pU", c->set_uuid);
> +	if (!c->shrink) {
> +		pr_warn("bcache: %s: could not allocate shrinker\n", __func__);
> +		return -ENOMEM;

Seems you have cheanged the semantic of this. In the past,
it is better to have a shrinker, but now it becomes a mandatory.
Right? I don't know if it is acceptable. From my point of view,
just do the cleanup, don't change any behaviour.

> +	}
> +
> +	c->shrink->count_objects = bch_mca_count;
> +	c->shrink->scan_objects = bch_mca_scan;
> +	c->shrink->seeks = 4;
> +	c->shrink->batch = c->btree_pages * 2;
> +	c->shrink->private_data = c;
>   
> -	if (register_shrinker(&c->shrink, "md-bcache:%pU", c->set_uuid))
> -		pr_warn("bcache: %s: could not register shrinker\n",
> -				__func__);
> +	shrinker_register(c->shrink);
>   
>   	return 0;
>   }
> diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
> index 0e2c1880f60b..45d8af755de6 100644
> --- a/drivers/md/bcache/sysfs.c
> +++ b/drivers/md/bcache/sysfs.c
> @@ -866,7 +866,8 @@ STORE(__bch_cache_set)
>   
>   		sc.gfp_mask = GFP_KERNEL;
>   		sc.nr_to_scan = strtoul_or_return(buf);
> -		c->shrink.scan_objects(&c->shrink, &sc);
> +		if (c->shrink)
> +			c->shrink->scan_objects(c->shrink, &sc);
>   	}
>   
>   	sysfs_strtoul_clamp(congested_read_threshold_us,



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:36:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:36:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570136.891589 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZ4Y-0000qY-QK; Wed, 26 Jul 2023 07:36:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570136.891589; Wed, 26 Jul 2023 07:36:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZ4Y-0000qR-Nk; Wed, 26 Jul 2023 07:36:38 +0000
Received: by outflank-mailman (input) for mailman id 570136;
 Wed, 26 Jul 2023 07:36:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOZ4X-0000qI-6F
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:36:37 +0000
Received: from out-62.mta0.migadu.com (out-62.mta0.migadu.com
 [2001:41d0:1004:224b::3e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 25cdabc3-2b87-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 09:36:35 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 25cdabc3-2b87-11ee-b242-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690356994;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=Yrw1e5tQhbkMga7eJrUip2ycPtsuLn9P74mG8ros/F0=;
	b=XkkSjxLZhEs+WTu6Lxce6yw56JkcjLLE3W9mi8l7oiUYes2Mt2Kx9x4+hwiBhDOxzRpaVC
	pfsRiMgi/wQngx46uSL66saqLbu8FkMymz5gIEi/n4cwHkh93N7+NRLIrXwMgbBpn3V0mr
	W8L4NvyZa4l7hBRrr+6H7xx0fZlpIGk=
MIME-Version: 1.0
Subject: Re: [PATCH v2 29/47] vmw_balloon: dynamically allocate the
 vmw-balloon shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-30-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:35:42 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <1D40C9FD-84F6-40BA-8D2C-0DF05882C933@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-30-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the vmw-balloon shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct vmballoon.
> 
> And we can simply exit vmballoon_init() when registering the shrinker
> fails. So the shrinker_registered indication is redundant, just remove it.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Nice cleanup.

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:37:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:37:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570139.891600 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZ5J-0001Qk-7i; Wed, 26 Jul 2023 07:37:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570139.891600; Wed, 26 Jul 2023 07:37:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZ5J-0001Qd-4f; Wed, 26 Jul 2023 07:37:25 +0000
Received: by outflank-mailman (input) for mailman id 570139;
 Wed, 26 Jul 2023 07:37:23 +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
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOZ5H-0001LE-Mc
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:37:23 +0000
Received: from out-51.mta0.migadu.com (out-51.mta0.migadu.com [91.218.175.51])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 41b272cb-2b87-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 09:37:22 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 41b272cb-2b87-11ee-8613-37d641c3527e
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690357041;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=FH3LyfLyqkvA0uofohdpfMljRn5zgQbiJWs64hRJpqc=;
	b=COPHaz+wHjiUlAHsjP58xdsSSXA6rPPl39Mqp3hq6OVH+Fq0km6xEhEcWCRhxhX26w/v20
	C9+jDmrUpEHzECadLd9w01EIqvkiKvcuovvFjSED4El7k+dj7Pu3N2tGkGTqTXRyLg+bIG
	Dtp5bL/dBJohTZeYRyhYg3+TCZ3pysU=
MIME-Version: 1.0
Subject: Re: [PATCH v2 30/47] virtio_balloon: dynamically allocate the
 virtio-balloon shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-31-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:36:34 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <1934CDDA-BE23-4048-B924-2C954817F1A1@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-31-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the virtio-balloon shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct virtio_balloon.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:40:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:40:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570142.891610 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZ7m-00023h-KG; Wed, 26 Jul 2023 07:39:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570142.891610; Wed, 26 Jul 2023 07:39:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZ7m-00023a-Go; Wed, 26 Jul 2023 07:39:58 +0000
Received: by outflank-mailman (input) for mailman id 570142;
 Wed, 26 Jul 2023 07:39:57 +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
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOZ7k-00022i-VR
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:39:56 +0000
Received: from out-2.mta1.migadu.com (out-2.mta1.migadu.com [95.215.58.2])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9ce24b57-2b87-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 09:39:55 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9ce24b57-2b87-11ee-8613-37d641c3527e
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690357193;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=l8aJXSNw5+elc1iE01vL5l3NT4M+siQK80IPjT8jgIg=;
	b=eGqsf3Kk+wnqjw4p+oAcS2NZWo54D2sWzelRyzyU4NPUv0q8nn2S8BOMGAPnmnxcfiOTkk
	SKKt5tpkWGMdRMREQoEzpDPmf2FxPGibaSJmfDS71vzjSCkQXyzoliP1NPeTVqbA/vFWi5
	npjPE4PA44NIs8OFJIOh1TEq9vI5PX4=
MIME-Version: 1.0
Subject: Re: [PATCH v2 31/47] mbcache: dynamically allocate the mbcache
 shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-32-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:39:06 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <9A3DA627-8ADC-429E-B751-C1BD6362967A@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-32-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the mbcache shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct mb_cache.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:41:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:41:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570144.891620 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZ9V-0003Rc-U0; Wed, 26 Jul 2023 07:41:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570144.891620; Wed, 26 Jul 2023 07:41:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZ9V-0003RV-RH; Wed, 26 Jul 2023 07:41:45 +0000
Received: by outflank-mailman (input) for mailman id 570144;
 Wed, 26 Jul 2023 07:41:43 +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
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOZ9T-0003RL-O8
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:41:43 +0000
Received: from out-2.mta0.migadu.com (out-2.mta0.migadu.com [91.218.175.2])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dc841f46-2b87-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 09:41:41 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dc841f46-2b87-11ee-8613-37d641c3527e
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690357301;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=1INRpyFGosC7x9b2U65MfTc+prZG/Zt8kNIAIpUXzvc=;
	b=rJayuXz/AZIoTh/aJ821z2UtGYXRhf7SaFISnV6xdmFmcSOAugz50dRL7nxfhIEtCQbOTg
	iIpArugvYTdRT1OJGdpeURT9QNHUnNNwNxIZAZlJQKpbcVUfBLkRuPek5FTrtrIzUA92Qs
	V5aiV1ZbRn27rBgCbBkAjrHv7ewFxNg=
MIME-Version: 1.0
Subject: Re: [PATCH v2 32/47] ext4: dynamically allocate the ext4-es shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-33-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:40:52 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 senozhatsky@chromium.org,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <866DDDA8-3F7E-4E7A-BA8D-D6DA1707E106@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-33-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the ext4-es shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct ext4_sb_info.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:42:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:42:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570146.891630 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZA1-0003xd-75; Wed, 26 Jul 2023 07:42:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570146.891630; Wed, 26 Jul 2023 07:42:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZA1-0003xW-40; Wed, 26 Jul 2023 07:42:17 +0000
Received: by outflank-mailman (input) for mailman id 570146;
 Wed, 26 Jul 2023 07:42:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOZA0-0003tJ-FI
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:42:16 +0000
Received: from out-25.mta0.migadu.com (out-25.mta0.migadu.com
 [2001:41d0:1004:224b::19])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f0dd7645-2b87-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 09:42:16 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f0dd7645-2b87-11ee-b242-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690357335;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=Ekk4aAWFJ4+PlEX4rrtlrp4hyCRFU3jGz4GFExFiN/4=;
	b=LFo7zp7M+/SxvVshzDJAkc4p4tV6E2GJDNPazCKrtnnFX7LZc9vNkPXQlbkMtTxwpTMldW
	wmyQAQreYZza1uKi7E+g//lo6ktN/ymSykPq/iHUJ0FDx8RsRCRPcKGyvxypKIP4obmT3h
	BmWZ270GHRn0AZA6RUZrPZSNu4KiSUs=
MIME-Version: 1.0
Subject: Re: [PATCH v2 33/47] jbd2,ext4: dynamically allocate the jbd2-journal
 shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-34-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:41:34 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 senozhatsky@chromium.org,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <042841CB-2C3C-4028-85E5-D3B8BCAAE7F7@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-34-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the jbd2-journal shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct journal_s.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:42:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:42:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570148.891640 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZAX-0004V4-Fy; Wed, 26 Jul 2023 07:42:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570148.891640; Wed, 26 Jul 2023 07:42:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZAX-0004Ux-Cv; Wed, 26 Jul 2023 07:42:49 +0000
Received: by outflank-mailman (input) for mailman id 570148;
 Wed, 26 Jul 2023 07:42:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOZAW-0003tJ-Ah
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:42:48 +0000
Received: from out-2.mta0.migadu.com (out-2.mta0.migadu.com [91.218.175.2])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 03dd8b61-2b88-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 09:42:47 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 03dd8b61-2b88-11ee-b242-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690357367;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=sHsfFkR4QfVtKdCmZWWuai/7pRgjRV7Fwpvvp689XLQ=;
	b=kQIZJHiBXKEyfUw++Gt7CmDeF/gp4x/WJWsPHXHoM14s7TZLdgeqA1TLVS3/zFPChKJizq
	dYYijpPBbftJTCu+Yc4kTKpy6KYUTWGN/LuT98RvkKAI2rgEWayiqCtMhV8TO7Ixq122qw
	RKD8aMAISKIZgBvhWHP88mwBittZc0o=
MIME-Version: 1.0
Subject: Re: [PATCH v2 36/47] xfs: dynamically allocate the xfs-buf shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-37-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:42:06 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 senozhatsky@chromium.org,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <E060442B-6748-4436-A825-2573F022293E@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-37-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the xfs-buf shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct xfs_buftarg.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:43:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:43:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570150.891650 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZBA-00053R-Oy; Wed, 26 Jul 2023 07:43:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570150.891650; Wed, 26 Jul 2023 07:43:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZBA-00053K-L4; Wed, 26 Jul 2023 07:43:28 +0000
Received: by outflank-mailman (input) for mailman id 570150;
 Wed, 26 Jul 2023 07:43:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOZB9-000533-Eu
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:43:27 +0000
Received: from out-6.mta0.migadu.com (out-6.mta0.migadu.com [91.218.175.6])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1acb12c1-2b88-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 09:43:26 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1acb12c1-2b88-11ee-b242-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690357405;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=+aerI/sO0j2fmQVgjSVx0YO7MkLGWoxsUQn7du25+U0=;
	b=F+MJm/neBJbq7tW7eIkjIVqgdq36l373zW3oIPnHFEgcEO1ErqNG0rkAJcj4mKstGsmy6p
	MJoebA2utTLKaQltPP+gkceIYICCJsEmZisKkNbcYMVLD4F1Y7MjGsWhMbpE+a9xd07m05
	Y5cUxoHDptpMUDVldJ/eAJXVrJl4pbg=
MIME-Version: 1.0
Subject: Re: [PATCH v2 37/47] xfs: dynamically allocate the xfs-inodegc
 shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-38-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:42:45 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <FB641EED-655F-4F87-83DC-1B2B30ECCC24@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-38-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the xfs-inodegc shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct xfs_mount.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:43:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:43:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570152.891660 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZBc-0005Zq-0p; Wed, 26 Jul 2023 07:43:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570152.891660; Wed, 26 Jul 2023 07:43:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZBb-0005Zj-TV; Wed, 26 Jul 2023 07:43:55 +0000
Received: by outflank-mailman (input) for mailman id 570152;
 Wed, 26 Jul 2023 07:43:54 +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
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOZBa-0005ZS-Du
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:43:54 +0000
Received: from out-42.mta0.migadu.com (out-42.mta0.migadu.com [91.218.175.42])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2a53c965-2b88-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 09:43:52 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2a53c965-2b88-11ee-8613-37d641c3527e
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690357431;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=a3ULO+Vxmkb6xksXoS4ybd7NRJZ1IUtzBzsRjrvus9c=;
	b=nYQ62uKjxX88WM5P8sDgL4eT+IxccKZ1Bz9uh79DZNvhsKrwxOFwGCLy84LISyYseR95J2
	yYS6BxTbWUyEJx1Geopid+DDx1DrJ04Fmbfb1W5NRe89QJmgxfeZm0I8SUGCOcTGjkjLL+
	GWNJBEk3EgYkStTpHlPsv4QWLHeCki4=
MIME-Version: 1.0
Subject: Re: [PATCH v2 38/47] xfs: dynamically allocate the xfs-qm shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-39-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:43:12 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 senozhatsky@chromium.org,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <99BAA621-E9B3-4D87-A1DD-D5242D0BC483@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-39-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the xfs-qm shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct xfs_quotainfo.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:44:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:44:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570153.891670 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZBz-00065X-7t; Wed, 26 Jul 2023 07:44:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570153.891670; Wed, 26 Jul 2023 07:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZBz-00065Q-4u; Wed, 26 Jul 2023 07:44:19 +0000
Received: by outflank-mailman (input) for mailman id 570153;
 Wed, 26 Jul 2023 07:44:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOZBx-000533-FV
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:44:17 +0000
Received: from out-9.mta0.migadu.com (out-9.mta0.migadu.com [91.218.175.9])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3910d8ad-2b88-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 09:44:16 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3910d8ad-2b88-11ee-b242-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690357456;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=YERirZpLP4FYzC9W9Cuhwy4vJFALDqDsk3pczk62JOQ=;
	b=kOMq/HUlDvH603KrUUEza/PyymEgyIbW/Pmz8Heb+hJF3i5dVIkpDD+1wHWXrClPqGAw2s
	a+xs9b+zND6HNviDHK0RhcBhFdy5suPaPW4D1t29z7ZNacrVxFACfaaCFl7IiD41gZEpbX
	ZxOTECTjTAugfJjk//XKlUEVfOYnzaA=
MIME-Version: 1.0
Subject: Re: [PATCH v2 39/47] zsmalloc: dynamically allocate the mm-zspool
 shrinker
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-40-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:43:36 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 senozhatsky@chromium.org,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <D4BCB662-30A7-430C-965F-DC993F9E061A@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-40-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the mm-zspool shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct zs_pool.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:46:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:46:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570157.891679 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZDu-0006rW-OA; Wed, 26 Jul 2023 07:46:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570157.891679; Wed, 26 Jul 2023 07:46:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZDu-0006rP-LS; Wed, 26 Jul 2023 07:46:18 +0000
Received: by outflank-mailman (input) for mailman id 570157;
 Wed, 26 Jul 2023 07:46:17 +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
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOZDt-0006rH-JK
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:46:17 +0000
Received: from out-50.mta0.migadu.com (out-50.mta0.migadu.com [91.218.175.50])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7f33b7a3-2b88-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 09:46:14 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7f33b7a3-2b88-11ee-8613-37d641c3527e
Message-ID: <2eb5ac60-d03f-c770-144c-67c23337a899@linux.dev>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690357574;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=6QEBEdTPSAaW2OQqcLE7rLGuRZIVN6+LeTsJ4l/CyeM=;
	b=PIFD02mpMzjRcZ3366WsMtp53hA717Gy3vvuYw5Rhd/AopVnoI+xS2zEoD80dtXmig5iVU
	e+udj9BpG++3X4I7Xha4OWZFfxbVXmw3wbp6r/NHzIwAOXaSD+OnSfxRqvRN624pP6oj8J
	xGsejw6XWW8uEiG+p7ecCRE5blMqFKA=
Date: Wed, 26 Jul 2023 15:45:56 +0800
MIME-Version: 1.0
Subject: Re: [PATCH v2 40/47] fs: super: dynamically allocate the s_shrink
To: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz,
 roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org,
 paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com, cel@kernel.org,
 senozhatsky@chromium.org, yujie.liu@intel.com, gregkh@linuxfoundation.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-41-zhengqi.arch@bytedance.com>
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-41-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Migadu-Flow: FLOW_OUT



On 2023/7/24 17:43, Qi Zheng wrote:
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the s_shrink, so that it can be freed asynchronously
> using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical
> section when releasing the struct super_block.
>
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:47:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:47:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570159.891690 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZEh-0007Nj-1k; Wed, 26 Jul 2023 07:47:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570159.891690; Wed, 26 Jul 2023 07:47:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZEg-0007Nc-V2; Wed, 26 Jul 2023 07:47:06 +0000
Received: by outflank-mailman (input) for mailman id 570159;
 Wed, 26 Jul 2023 07:47:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOZEf-0007Iy-MX
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:47:06 +0000
Received: from out-21.mta1.migadu.com (out-21.mta1.migadu.com [95.215.58.21])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9cccfb5e-2b88-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 09:47:04 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9cccfb5e-2b88-11ee-b242-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690357623;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=lV04jvP8W8LNW2Kdx9OGtJJXOK+PRwBDtTJvLO2k0O8=;
	b=A1IT/mDyqCYg/eZlKui2dOCDbtV9vcqXl9T4EWfeMyoTOxzomY6KoFbjH3rpReTDbPfsfJ
	K5atv+26vraBcFbcpy/C7gkXvTsNPWbCbiQe0KDCsfWYxtMWjl4ywgutS72yJZxYJTddGS
	b9VME/xTROC1FWYlT+hqUtLqjkxqrlo=
MIME-Version: 1.0
Subject: Re: [PATCH v2 41/47] mm: shrinker: remove old APIs
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-42-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:46:14 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 senozhatsky@chromium.org,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <779E809B-6E3B-49B7-9C2A-970183E49C5A@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-42-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> Now no users are using the old APIs, just remove them.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:49:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:49:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570161.891700 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZGi-0007xr-Bs; Wed, 26 Jul 2023 07:49:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570161.891700; Wed, 26 Jul 2023 07:49:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZGi-0007xk-8t; Wed, 26 Jul 2023 07:49:12 +0000
Received: by outflank-mailman (input) for mailman id 570161;
 Wed, 26 Jul 2023 07:49:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CD/9=DM=citrix.com=prvs=564dce665=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOZGh-0007xa-80
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:49:11 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e62af5ea-2b88-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 09:49:09 +0200 (CEST)
Received: from mail-bn8nam11lp2168.outbound.protection.outlook.com (HELO
 NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.168])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 26 Jul 2023 03:49:02 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB6796.namprd03.prod.outlook.com (2603:10b6:a03:40f::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Wed, 26 Jul
 2023 07:48:56 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023
 07:48:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e62af5ea-2b88-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690357749;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=SE47op0HEEDrmbHoTDRhu/OoehIb5+HBrV+++AapGUw=;
  b=bJ1g+sdHHWVisF2Vq13xvGBYOspY9pKiNR5JqUTw1NS2ioS8l40zmI52
   7GoUKuKiw8c0u9lbJXoqVzlLn2XqJFFBNLfSYtbyfbt308IwE72Bt/t3H
   ReKbsAmjYqZqhWgGG5Vc3JvwKkhIPQB1jKXZu32jp1kycWWsUqngpexIb
   I=;
X-IronPort-RemoteIP: 104.47.58.168
X-IronPort-MID: 116760279
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:Qwp1JaOiqmjUh2fvrR2BlsFynXyQoLVcMsEvi/4bfWQNrUoqhmcOn
 zROCj/UMviJYmDxLYp/O4zgoEIFu57VyoJjHgto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v
 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/
 Nj/uKUzAnf8s9JPGjxSs/vrRC9H5qyo42tH5AFmP5ingXeF/5UrJMNHTU2OByOQrrl8RoaSW
 +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ
 HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0rxeXEJJr
 cdbEQEQQE7Yhr2GzImgU9A506zPLOGzVG8ekldJ6GiASNwAEdXESaiM4sJE1jAtgMwIBezZe
 8cSdTtoalLHfgFLPVAUTpk5mY9EhFGmK2Ee9A3T+PpxujaDpOBy+OGF3N79YNuFSN8Thk+Fj
 mnH4374ElcRM9n3JT+tqyvy2bGXx3yqMG4UPPqC1MZHo3TU/zceDVotagO4h9y+yVHrDrqzL
 GRRoELCt5Ma5EGtC9XwQRC8iHqFpQIHHcpdFfUg7wOAwbaS5ByWbkAbShZRZdpgs9U5LRQo2
 UWOhMjBHiF0vfueTnf1y1uPhTa7OCxQJ2lSYyYBFFIB+4O6/tF1iQ/TRNF+FqLzlsfyBTz73
 zGNqm45mqkXiskIka68+Dgrng6Rm3QAdSZtji2/Y45vxloRiFKND2Bw1WXm0A==
IronPort-HdrOrdr: A9a23:UndslqE8vA4KWb/vpLqEHseALOsnbusQ8zAXPiBKJCC9vPb5qy
 nOpoV86faQslwssR4b9uxoVJPvfZqYz+8W3WBzB8bEYOCFghrKEGgK1+KLrwEIWReOk9K1vZ
 0KT0EUMqyVMbEVt6fHCAnTKade/DGEmprY+9s3GR1WPHBXg6IL1XYINu6CeHcGPTWvnfACZe
 ehDswsnUvZRV0nKv6VK1MiROb5q9jChPvdEGI7705O0nj0sduwgoSKaSSl4g==
X-Talos-CUID: 9a23:WBMAm2D8SQF0fwv6E3NOqW0TQvtmS0zA4imLIhCIBV1yUYTAHA==
X-Talos-MUID: 9a23:zaeTtQTkTH8wNeoJRXSrvhNaGeRBpJ31BUVKqqpeuO+hMm9vbmI=
X-IronPort-AV: E=Sophos;i="6.01,231,1684814400"; 
   d="scan'208";a="116760279"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Y4LFjwx1O5JSwgBCPPMrxtpxAGQ5yQE8P+QELwe252mbJSw8dt+7JTZISkHeRdqaAofMb+Ral4B9nJBfwY6QJfU6ZIY/yMS6JnCyBMwmNCoAWadfV6Mk7aqREWYSvtD31a2iIlJnG73SNFMi617Dl5vVlxAQ+sMYKJeSRB2iMDKhvQ47Kz3JaD1KtKtKkLq0XXy3oMTnZGemUsAdsjgrbned0I1gJyraSBFpGulw0cTzcuYfVP1d0eXqNv5jGbK5ZKcLM+utbjksL6y6O5ndVXPRdThvCwqQBwDcMbP2zDUi1RiBkgJjy3aIS7izYIdedrczJbNsAcgWOLpSPsR74g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=r+MWjzVZzTsodB8oBO+0pO3Mr9z7FxPsIv/eUC+lvc8=;
 b=A+M1C7TIYRai3oK0HnwnzkWGq9ApAMPvWbHXvvC7vYSivezoMTByrOhML1xMr1UKAixbLQHnd4NNPP7tx5hsgdkYefrc0AU0HW70v9gYZCU7jIvKGUyGYH+0xPWNI2I3nmDOtlcejWYDvjuCPbag6gMzEkMbumgn5l1+9UZCHCaX4b8hUMW0GGxtiiDAp4ao9x1UOE34PAJNodaR3vcvOPwKjrFVV/LX6SbSvfBmrmPXu+krheSpp3B09FX3JQlMNVak5cdhO+hH2cvKct/nT7JF/QN+twZ4qVyiUZB2yQsU2f0UUIpHtGPVpPBpMTM5L0SNVU0KZalNZZ5aeTgkuQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=r+MWjzVZzTsodB8oBO+0pO3Mr9z7FxPsIv/eUC+lvc8=;
 b=Y/40WiJOfLA25Zi0fJJ7n/BQHMxpaA6F2ORU4afADk0hdnOUz6TNp3GqHhtn3BS3H/2rintL7fbJqy760+x1H0b/zetNw0XjlMz404IrHbCI9hbsHF0AswQ2vrgcWCvWRcCZstAPBy9gs+iHqDsFub5ymn+M3nodTW54ecc7BEI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v5 3/6] libxl: introduce MSR data in libxl_cpuid_policy
Date: Wed, 26 Jul 2023 09:47:53 +0200
Message-ID: <20230726074753.74934-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230725130558.58094-4-roger.pau@citrix.com>
References: <20230725130558.58094-4-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P123CA0072.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1::36) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB6796:EE_
X-MS-Office365-Filtering-Correlation-Id: e212396e-6658-4858-5805-08db8dacc36c
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	g/0qPe0RP7VxlJqpdhhdgvqkUnKfibmBDQquzwFc5WoRMIAORETuPCsRj/WvOCG/YTK45r4gx7Wfx6we0hZRKkVBbuxfpfARrMjhCCOnybyHLC/O4Ksbi59dftmSgrravbzTemtcUOFK1yyFXnHF543ZgRaRYTN0+/AbabxaEQkG547EF6OrGanr/0ooJwY5px0ls0exWf2XBOsB2Hrz+0gNO3Fvv/6w/1jtrVdGWY7Y+lvubvshiA/cJrssY38q5TLSkzcHlmlNrUWhIFmoyyIq2/K5K5DdwdFYL0pYeKM7uyMFrUZ3HXLzNJFL7mSSXG+s0FbNFLQVy2101OsgMzwYbFmbSSAyKrGrgTwhIToXAL+XYv4gkf3VvdGxOHGy7k+agIshmnEoD3GuH2LUYp2l6Mr3gyzw0OIhirNC8APezf0C9nFKT8YcgOYvdsmtrCQK941E8P9CELHej2ogvc0KG2IGu0HPlzcrON8SVPBXpU9VUJOeNwotRUtvi9G1yUIwmrH9Gm/hQAWkjidXpu12NuC8jKR4HAbqyT0JF7ntMiv/Z7T+EHbUNky27jeu
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(366004)(376002)(39860400002)(396003)(346002)(451199021)(66946007)(2616005)(66476007)(83380400001)(82960400001)(38100700002)(41300700001)(36756003)(86362001)(8936002)(5660300002)(8676002)(6486002)(478600001)(54906003)(66556008)(316002)(6916009)(4326008)(2906002)(6512007)(186003)(6506007)(26005)(1076003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NWFRTm5qc1RPOFdUR3FPV29GY0RkWnAwU2d0OVd3NEdLOERDN0dndE5UaUpo?=
 =?utf-8?B?QVRscEhINkxtaWtJZFp4Zm1XOFQzUnE5VmlPbDFCYkxWRmhRWktDZm9ocGlj?=
 =?utf-8?B?NHNRY2E4OCtMY2hFdUNMbFd0MDBSdkJYUmF0cEFrZGIxb1orWVVmZXlaY0Vj?=
 =?utf-8?B?dFkwNFVkRXFzdVVtNWZKWU43bHgvdmNiK2s5bFBsSDY0L3psczZ3OGVhMk5n?=
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Hj/rU0n9L5Z9dDxObm2kla76tCgYAljf8VDW6SOZtyTyLDdcrIIo+GR94D/8bJrOcQdV1pQ2+EUHaXluCEkiNEmAUp30tWNNPZatn
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e212396e-6658-4858-5805-08db8dacc36c
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 07:48:55.8953
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: sOgZ0j07XhmOuFXdjiTZ4gcp9z+HH+Am9+e/bh2HYryE6HDPqe6DRydUYRxsemV9E02UGJEWX5h/uE1lACOYzg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB6796

Add a new array field to libxl_cpuid_policy in order to store the MSR
policies.

Adding the MSR data in the libxl_cpuid_policy_list type is done so
that existing users can seamlessly pass MSR features as part of the
CPUID data, without requiring the introduction of a separate
domain_build_info field, and a new set of handlers functions.

Note that support for parsing the old JSON format is kept, as that's
required in order to restore domains or received migrations from
previous tool versions.  Differentiation between the old and the new
formats is done based on whether the contents of the 'cpuid' field is
an array or a map JSON object.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
---
Changes since v4:
 - Add comment.

Changes since v3:
 - Keep support for the old json format in the parse function.

Changes since v2:
 - Unconditionally call free().
 - Implement the JSON marshaling functions.
---
 tools/libs/light/libxl_cpuid.c    | 160 +++++++++++++++++++++++++++---
 tools/libs/light/libxl_internal.h |   1 +
 tools/libs/light/libxl_types.idl  |   2 +-
 3 files changed, 146 insertions(+), 17 deletions(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index 3c8b2a72c0b8..2b53637e8a54 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -16,7 +16,7 @@
 
 int libxl__cpuid_policy_is_empty(libxl_cpuid_policy_list *pl)
 {
-    return !libxl_cpuid_policy_list_length(pl);
+    return !*pl || (!libxl_cpuid_policy_list_length(pl) && !(*pl)->msr);
 }
 
 void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl)
@@ -40,6 +40,8 @@ void libxl_cpuid_dispose(libxl_cpuid_policy_list *pl)
         free(policy->cpuid);
     }
 
+    free(policy->msr);
+
     free(policy);
     *pl = NULL;
     return;
@@ -516,7 +518,8 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
 
     r = xc_cpuid_apply_policy(ctx->xch, domid, restore, NULL, 0,
                               pae, itsc, nested_virt,
-                              info->cpuid ? info->cpuid->cpuid : NULL, NULL);
+                              info->cpuid ? info->cpuid->cpuid : NULL,
+                              info->cpuid ? info->cpuid->msr : NULL);
     if (r)
         LOGEVD(ERROR, -r, domid, "Failed to apply CPUID policy");
 
@@ -528,16 +531,22 @@ static const char *input_names[2] = { "leaf", "subleaf" };
 static const char *policy_names[4] = { "eax", "ebx", "ecx", "edx" };
 /*
  * Aiming for:
- * [
- *     { 'leaf':    'val-eax',
- *       'subleaf': 'val-ecx',
- *       'eax':     'filter',
- *       'ebx':     'filter',
- *       'ecx':     'filter',
- *       'edx':     'filter' },
- *     { 'leaf':    'val-eax', ..., 'eax': 'filter', ... },
- *     ... etc ...
- * ]
+ * {   'cpuid': [
+ *              { 'leaf':    'val-eax',
+ *                'subleaf': 'val-ecx',
+ *                'eax':     'filter',
+ *                'ebx':     'filter',
+ *                'ecx':     'filter',
+ *                'edx':     'filter' },
+ *              { 'leaf':    'val-eax', ..., 'eax': 'filter', ... },
+ *              ... etc ...
+ *     ],
+ *     'msr': [
+ *            { 'index': 'val-index',
+ *              'policy': 'filter', },
+ *              ... etc ...
+ *     ],
+ * }
  */
 
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
@@ -545,9 +554,16 @@ yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
 {
     libxl_cpuid_policy_list policy = *pl;
     struct xc_xend_cpuid *cpuid;
+    const struct xc_msr *msr;
     yajl_gen_status s;
     int i, j;
 
+    s = yajl_gen_map_open(hand);
+    if (s != yajl_gen_status_ok) goto out;
+
+    s = libxl__yajl_gen_asciiz(hand, "cpuid");
+    if (s != yajl_gen_status_ok) goto out;
+
     s = yajl_gen_array_open(hand);
     if (s != yajl_gen_status_ok) goto out;
 
@@ -582,6 +598,39 @@ yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
 
 empty:
     s = yajl_gen_array_close(hand);
+    if (s != yajl_gen_status_ok) goto out;
+
+    s = libxl__yajl_gen_asciiz(hand, "msr");
+    if (s != yajl_gen_status_ok) goto out;
+
+    s = yajl_gen_array_open(hand);
+    if (s != yajl_gen_status_ok) goto out;
+
+    if (!policy || !policy->msr) goto done;
+    msr = policy->msr;
+
+    for (i = 0; msr[i].index != XC_MSR_INPUT_UNUSED; i++) {
+        s = yajl_gen_map_open(hand);
+        if (s != yajl_gen_status_ok) goto out;
+
+        s = libxl__yajl_gen_asciiz(hand, "index");
+        if (s != yajl_gen_status_ok) goto out;
+        s = yajl_gen_integer(hand, msr[i].index);
+        if (s != yajl_gen_status_ok) goto out;
+        s = libxl__yajl_gen_asciiz(hand, "policy");
+        if (s != yajl_gen_status_ok) goto out;
+        s = yajl_gen_string(hand,
+                            (const unsigned char *)msr[i].policy, 64);
+        if (s != yajl_gen_status_ok) goto out;
+
+        s = yajl_gen_map_close(hand);
+        if (s != yajl_gen_status_ok) goto out;
+    }
+
+done:
+    s = yajl_gen_array_close(hand);
+    if (s != yajl_gen_status_ok) goto out;
+    s = yajl_gen_map_close(hand);
 out:
     return s;
 }
@@ -592,17 +641,40 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
 {
     int i, size;
     struct xc_xend_cpuid *l;
+    struct xc_msr *msr;
+    const libxl__json_object *co;
     flexarray_t *array;
+    bool cpuid_only = false;
+
+    /*
+     * Old JSON field was an array with just the CPUID data.  With the addition
+     * of MSRs the object is now a map with two array fields.
+     *
+     * Use the object format to detect whether the passed data contains just
+     * CPUID leafs and thus is an array, or does also contain MSRs and is a
+     * map.
+     */
+    if (libxl__json_object_is_array(o)) {
+        co = o;
+        cpuid_only = true;
+        goto parse_cpuid;
+    }
 
-    if (!libxl__json_object_is_array(o))
+    if (!libxl__json_object_is_map(o))
         return ERROR_FAIL;
 
-    array = libxl__json_object_get_array(o);
+    co = libxl__json_map_get("cpuid", o, JSON_ARRAY);
+    if (!libxl__json_object_is_array(co))
+        return ERROR_FAIL;
+
+parse_cpuid:
+    *p = libxl__calloc(NOGC, 1, sizeof(**p));
+
+    array = libxl__json_object_get_array(co);
     if (!array->count)
-        return 0;
+        goto cpuid_empty;
 
     size = array->count;
-    *p = libxl__calloc(NOGC, 1, sizeof(**p));
     /* need one extra slot as sentinel */
     l = (*p)->cpuid = libxl__calloc(NOGC, size + 1,
                                     sizeof(struct xc_xend_cpuid));
@@ -641,6 +713,42 @@ int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
                     libxl__strdup(NOGC, libxl__json_object_get_string(r));
         }
     }
+    if (cpuid_only)
+        return 0;
+
+cpuid_empty:
+    co = libxl__json_map_get("msr", o, JSON_ARRAY);
+    if (!libxl__json_object_is_array(co))
+        return ERROR_FAIL;
+
+    array = libxl__json_object_get_array(co);
+    if (!array->count)
+        return 0;
+    size = array->count;
+    /* need one extra slot as sentinel */
+    msr = (*p)->msr = libxl__calloc(NOGC, size + 1, sizeof(struct xc_msr));
+
+    msr[size].index = XC_MSR_INPUT_UNUSED;
+
+    for (i = 0; i < size; i++) {
+        const libxl__json_object *t, *r;
+
+        if (flexarray_get(array, i, (void**)&t) != 0)
+            return ERROR_FAIL;
+
+        if (!libxl__json_object_is_map(t))
+            return ERROR_FAIL;
+
+        r = libxl__json_map_get("index", t, JSON_INTEGER);
+        if (!r) return ERROR_FAIL;
+        msr[i].index = libxl__json_object_get_integer(r);
+        r = libxl__json_map_get("policy", t, JSON_STRING);
+        if (!r) return ERROR_FAIL;
+        if (strlen(libxl__json_object_get_string(r)) !=
+            ARRAY_SIZE(msr[i].policy) - 1)
+            return ERROR_FAIL;
+        strcpy(msr[i].policy, libxl__json_object_get_string(r));
+    }
 
     return 0;
 }
@@ -677,6 +785,10 @@ void libxl_cpuid_policy_list_copy(libxl_ctx *ctx,
     }
 
     *pdst = libxl__calloc(NOGC, 1, sizeof(**pdst));
+
+    if (!(*psrc)->cpuid)
+        goto copy_msr;
+
     dst = &(*pdst)->cpuid;
     src = &(*psrc)->cpuid;
     len = libxl_cpuid_policy_list_length(psrc);
@@ -696,6 +808,22 @@ void libxl_cpuid_policy_list_copy(libxl_ctx *ctx,
                 (*dst)[i].policy[j] = NULL;
     }
 
+copy_msr:
+    if ((*psrc)->msr) {
+        const struct xc_msr *msr = (*psrc)->msr;
+
+        for (i = 0; msr[i].index != XC_MSR_INPUT_UNUSED; i++)
+            ;
+        len = i;
+        (*pdst)->msr = libxl__calloc(NOGC, len + 1, sizeof(struct xc_msr));
+        (*pdst)->msr[len].index = XC_MSR_INPUT_UNUSED;
+
+        for (i = 0; i < len; i++) {
+            (*pdst)->msr[i].index = msr[i].index;
+            strcpy((*pdst)->msr[i].policy, msr[i].policy);
+        }
+    }
+
 out:
     GC_FREE;
 }
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index ef882cff3912..b1a7cd9f615b 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -4871,6 +4871,7 @@ _hidden int libxl__domain_set_paging_mempool_size(
 
 struct libxl__cpu_policy {
     struct xc_xend_cpuid *cpuid;
+    struct xc_msr *msr;
 };
 
 #endif
diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
index 9e48bb772646..fd2f3f6e485f 100644
--- a/tools/libs/light/libxl_types.idl
+++ b/tools/libs/light/libxl_types.idl
@@ -19,7 +19,7 @@ libxl_mac = Builtin("mac", json_parse_type="JSON_STRING", passby=PASS_BY_REFEREN
 libxl_bitmap = Builtin("bitmap", json_parse_type="JSON_ARRAY", dispose_fn="libxl_bitmap_dispose", passby=PASS_BY_REFERENCE,
                        check_default_fn="libxl_bitmap_is_empty", copy_fn="libxl_bitmap_copy_alloc")
 libxl_cpuid_policy_list = Builtin("cpuid_policy_list", dispose_fn="libxl_cpuid_dispose", passby=PASS_BY_REFERENCE,
-                                  json_parse_type="JSON_ARRAY", check_default_fn="libxl__cpuid_policy_is_empty",
+                                  json_parse_type="JSON_ANY", check_default_fn="libxl__cpuid_policy_is_empty",
                                   copy_fn="libxl_cpuid_policy_list_copy")
 
 libxl_string_list = Builtin("string_list", dispose_fn="libxl_string_list_dispose", passby=PASS_BY_REFERENCE,
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 07:57:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 07:57:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570169.891709 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZOX-00014V-5J; Wed, 26 Jul 2023 07:57:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570169.891709; Wed, 26 Jul 2023 07:57:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZOX-00014O-2o; Wed, 26 Jul 2023 07:57:17 +0000
Received: by outflank-mailman (input) for mailman id 570169;
 Wed, 26 Jul 2023 07:57:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOZOV-00014I-GA
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 07:57:15 +0000
Received: from out-15.mta1.migadu.com (out-15.mta1.migadu.com [95.215.58.15])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 081dca14-2b8a-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 09:57:13 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 081dca14-2b8a-11ee-b242-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690358232;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=DrTjaApThAuzzzwg/AJ38QfJI73QqK5cZWNfOYAaBzo=;
	b=wmb9Oc63rqgJphlqbAiUGQf+QfWRu1BB5RekgtePch6TWeTBhXF8/rZbaJe3xMLy22V28n
	AB61q+qfNpO4zxg1WfzVWjZzQVs0/ao+ef/zXMB6L8A11iP2pUjCxTGOuptX1W/mgnuJdh
	cKneJyV5E4YSzAPypp2CHjNMfrcxLhY=
MIME-Version: 1.0
Subject: Re: [PATCH v2 42/47] drm/ttm: introduce pool_shrink_rwsem
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-43-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 15:56:40 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>,
 yujie.liu@intel.com,
 gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: 7bit
Message-Id: <FB7D0111-36DB-4F76-831B-4D20E997EB93@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-43-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> Currently, the synchronize_shrinkers() is only used by TTM pool. It only
> requires that no shrinkers run in parallel.
> 
> After we use RCU+refcount method to implement the lockless slab shrink,
> we can not use shrinker_rwsem or synchronize_rcu() to guarantee that all
> shrinker invocations have seen an update before freeing memory.
> 
> So we introduce a new pool_shrink_rwsem to implement a private
> synchronize_shrinkers(), so as to achieve the same purpose.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 08:08:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 08:08:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570180.891719 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZYy-0003DA-N5; Wed, 26 Jul 2023 08:08:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570180.891719; Wed, 26 Jul 2023 08:08:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZYy-0003D3-KR; Wed, 26 Jul 2023 08:08:04 +0000
Received: by outflank-mailman (input) for mailman id 570180;
 Wed, 26 Jul 2023 08:08:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=oEth=DM=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qOZYx-0003Cp-4P
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 08:08:03 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8a72bd2d-2b8b-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 10:08:01 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-4f9fdb0ef35so10259999e87.0
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 01:08:01 -0700 (PDT)
Received: from [192.168.202.116] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 d26-20020ac25eda000000b004fe12dbd35fsm79631lfq.271.2023.07.26.01.07.59
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 01:08:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8a72bd2d-2b8b-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690358881; x=1690963681;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=DE6RFim+qXYzoOaObVpgU/iAADQeBudNCkA//A54Cdg=;
        b=F3q3DinjH9UgyYkV53lvZbBflyMd262y6Ro7YgBoonf8nTz/i3wasxXRrpb2x4es5d
         DxFjwlof76WaS44fqY/F3T+8V48FYGwf/mZ4vPM9BGrrElpSp4bb3KnzqsVr/z6L1ZKn
         wsc/t9bhKU2HgQnAb3g/cG0CyVni/ddTffJa24uALLOvsv+cgkCD+et5X/QNrnKlzWXx
         NmZgCglSfRWnLjLWaM8tUCDViSvQT5ZiaKvub/c2qwjjo/4HnClJPoceehtNlrTjzosM
         pjbfvIHvuPP1UvVeNraNGYYEytVZJZULvbLAVeHTDAqOg8a6mYI3X9yh9rbbn+DslB0Z
         KDWA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690358881; x=1690963681;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=DE6RFim+qXYzoOaObVpgU/iAADQeBudNCkA//A54Cdg=;
        b=UjphMuFNwgch2QYPn8nNu86XZrIseIImSp1w0UBbWPmZ+QvKgoVSmFx7RJF6WLLYS2
         WBrqwk3EOIJAVe16VgHwpfZIcHqEl9HBNutVF5aRVgmR3tiBGMLbK37LbPlHCCJ3qOtr
         iJnKo3SibzzCUqasTQiko601fFd7p77gr1ErlD99Dk+eUJ5H6RuoElUk2aYWeSPTDqjL
         jit86o6406SvmA2//1Dz3qIGX9lMpoZVkFZ8SwShBtiyOYg9HlorwR5mMwKxoI3iNTP8
         +9BNOoFBzV6PoMapHWe10QKAmPtUdtRstH3x8F6mfT5sOWGTVI5njs4ACLzzLEo6ujQX
         ngsw==
X-Gm-Message-State: ABy/qLbe0kCBNYHv30EqgfdYAGtUynmyAkNXQ+EcMmramVgedjiJN9Uf
	new0ylcpPCU8OofbWUjvbKw=
X-Google-Smtp-Source: APBJJlF8LYGK5OrwKzfib37JjXbfV2pZEod0ieFdh9A7Mj/eeD3+G6MIL0xZqiN4NXCNHy544kieUQ==
X-Received: by 2002:a05:6512:15a5:b0:4f7:55e4:4665 with SMTP id bp37-20020a05651215a500b004f755e44665mr924479lfb.56.1690358881125;
        Wed, 26 Jul 2023 01:08:01 -0700 (PDT)
Message-ID: <9309ca34c386c48f2bff4ea8851b82cd8aa29a6a.camel@gmail.com>
Subject: Re: [PATCH] xen: Drop the (almost) unused extern start[]
From: Oleksii <oleksii.kurochko@gmail.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>, Xen-devel
	 <xen-devel@lists.xenproject.org>
Cc: Jan Beulich <JBeulich@suse.com>, Roger Pau =?ISO-8859-1?Q?Monn=E9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>, Stefano Stabellini
 <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>, 
 Bob Eshleman <bobbyeshleman@gmail.com>, Alistair Francis
 <alistair.francis@wdc.com>, Connor Davis <connojdavis@gmail.com>, Roberto
 Bagnara <roberto.bagnara@bugseng.com>
Date: Wed, 26 Jul 2023 11:07:58 +0300
In-Reply-To: <20230725182049.2384427-1-andrew.cooper3@citrix.com>
References: <20230725182049.2384427-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Tue, 2023-07-25 at 19:20 +0100, Andrew Cooper wrote:
> This global variable is shadowed by plenty local variables, violating
> MISRA
> rule 5.3.=C2=A0 Some architectures happen to have a symbol by the name of
> start in
> their head.S's, but it's not a useful symbol to reference from C.
>=20
> In fact, the single use of the global start[] in RISC-V is wrong and
> means to
> use _start[] as the linker symbol at the beginning of the .text
> section, not
> the function which happens to be in the same location.
>=20
> Fix RISC-V to use the right symbol for it's calculation, and drop the
> extern.
>=20
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Really missed '_start'.

Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
> CC: Wei Liu <wl@xen.org>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Julien Grall <julien@xen.org>
> CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
> CC: Bertrand Marquis <bertrand.marquis@arm.com>
> CC: Bob Eshleman <bobbyeshleman@gmail.com>
> CC: Alistair Francis <alistair.francis@wdc.com>
> CC: Connor Davis <connojdavis@gmail.com>
> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> CC: Roberto Bagnara <roberto.bagnara@bugseng.com>
>=20
> I'm expecting:
>=20
> =C2=A0
> https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/945105609
>=20
> to come back and show green, but Gitlab is very backed up right now.=C2=
=A0
> I've
> compiled each architecture locally.
> ---
> =C2=A0xen/arch/riscv/mm.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 2 +-
> =C2=A0xen/include/xen/kernel.h | 2 +-
> =C2=A02 files changed, 2 insertions(+), 2 deletions(-)
>=20
> diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
> index fddb3cd0bdeb..99ed5e9623cc 100644
> --- a/xen/arch/riscv/mm.c
> +++ b/xen/arch/riscv/mm.c
> @@ -148,7 +148,7 @@ static bool __init
> check_pgtbl_mode_support(struct mmu_desc *mmu_desc,
> =C2=A0
> =C2=A0=C2=A0=C2=A0=C2=A0 unsigned long aligned_load_start =3D load_start =
& level_map_mask;
> =C2=A0=C2=A0=C2=A0=C2=A0 unsigned long aligned_page_size =3D
> XEN_PT_LEVEL_SIZE(page_table_level);
> -=C2=A0=C2=A0=C2=A0 unsigned long xen_size =3D (unsigned long)(_end - sta=
rt);
> +=C2=A0=C2=A0=C2=A0 unsigned long xen_size =3D (unsigned long)(_end - _st=
art);
> =C2=A0
> =C2=A0=C2=A0=C2=A0=C2=A0 if ( (load_start + xen_size) > (aligned_load_sta=
rt +
> aligned_page_size) )
> =C2=A0=C2=A0=C2=A0=C2=A0 {
> diff --git a/xen/include/xen/kernel.h b/xen/include/xen/kernel.h
> index 9ac2694dc7b1..46b3c9c02625 100644
> --- a/xen/include/xen/kernel.h
> +++ b/xen/include/xen/kernel.h
> @@ -66,7 +66,7 @@
> =C2=A0})
> =C2=A0
> =C2=A0/* SAF-0-safe */
> -extern char _start[], _end[], start[];
> +extern char _start[], _end[];
> =C2=A0#define is_kernel(p) ({=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 \
> =C2=A0=C2=A0=C2=A0=C2=A0 char *__p =3D (char *)(unsigned long)(p);=C2=A0=
=C2=A0=C2=A0=C2=A0 \
> =C2=A0=C2=A0=C2=A0=C2=A0 (__p >=3D _start) && (__p < _end);=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 \
>=20
> base-commit: 0b1171be87698bc7d14760383c0770aeb6e41dd4



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 08:08:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 08:08:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570182.891729 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZZq-0003it-VM; Wed, 26 Jul 2023 08:08:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570182.891729; Wed, 26 Jul 2023 08:08:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZZq-0003im-Sp; Wed, 26 Jul 2023 08:08:58 +0000
Received: by outflank-mailman (input) for mailman id 570182;
 Wed, 26 Jul 2023 08:08:57 +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
 <SRS0=PSyE=DM=fromorbit.com=david@srs-se1.protection.inumbo.net>)
 id 1qOZZp-0003iO-HL
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 08:08:57 +0000
Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com
 [2607:f8b0:4864:20::432])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a9d1cfbb-2b8b-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 10:08:55 +0200 (CEST)
Received: by mail-pf1-x432.google.com with SMTP id
 d2e1a72fcca58-686be28e1a8so468624b3a.0
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 01:08:55 -0700 (PDT)
Received: from dread.disaster.area (pa49-186-119-116.pa.vic.optusnet.com.au.
 [49.186.119.116]) by smtp.gmail.com with ESMTPSA id
 w2-20020a170902e88200b001a24cded097sm12426907plg.236.2023.07.26.01.08.52
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 01:08:53 -0700 (PDT)
Received: from dave by dread.disaster.area with local (Exim 4.96)
 (envelope-from <david@fromorbit.com>) id 1qOZZi-00Afxb-0y;
 Wed, 26 Jul 2023 18:08:50 +1000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a9d1cfbb-2b8b-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=fromorbit-com.20221208.gappssmtp.com; s=20221208; t=1690358934; x=1690963734;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=rPtpzUEslahCE2fhb6v9FLtKmqwh/pul7nSSkK8nPUc=;
        b=3FtP6nyx+rPcvJcblHl1Mu2LvC6NkDi8xEgEFylBPkAlQaYADspiGMJ27o0GgAuj9z
         McDVZgCUGviszUiy5R0bXahfbrRAfjxnAxmHNnPbaM1LXdSCHnASLGDwytdN0by6FDcI
         RpceDu/PcRlhyfyf4mYkuokxgwLuCVwRBZl0phBMBuXEmpOfHBU9f5yCZoh2dEO+7TTN
         DCOxQvb0O++5gEaT2a05V97Ei89pJv+cbAW7+SqulKGKTdXaXFuVtxE2YrWoJBaFXRhx
         fYB72/J5kZ33VcSsegtqBeEJQacLBG5vKC0M6tbbiCEw9x2oLmMOMSwg9ysSaFAgqAI5
         sgYQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690358934; x=1690963734;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=rPtpzUEslahCE2fhb6v9FLtKmqwh/pul7nSSkK8nPUc=;
        b=EB60zKcHp458G2Sufyth5De25bn9p2WsbXKrPlfLpGV6nqz3+he4q73sPYjml8YE+T
         ZaHtpHh9VRV2x7YE17mWUmkQ2DngjrpBhITmJJB2OgZjLofJ3HimDzSFRxyJYYB7p29A
         OIr1IzoJYAVrjjviamnAVlEoHmdOPYbxviknSvK7Va6NmjQxH+dBrg1tAOnhb9JJvxwg
         p5K+Yrk7BoAVKzA5Emn63PUcRZCe5N+BjO9U2QZKibdqCNVuaAhm1eBoilhpSg1MdBef
         l10BfLiu9MvNLY9nua3hsXzKAUd6TB+2wurCNotgzY5tR55YcO9L+trqrFo6pdvsKKoV
         omPQ==
X-Gm-Message-State: ABy/qLbKX9e8TH2qt5LWpdKdZyE6AymfWQnBXWGCOub6bx8YTNldizrs
	abwKBs/6FTEfd7aMH0TDH8B6Dw==
X-Google-Smtp-Source: APBJJlGxMb49Gcu6ThVo/6V+1HjCftCctRIBl06nDIbsd9lTZYFUn832db0oPfgPkp12tATT7U4xCA==
X-Received: by 2002:a05:6a20:1058:b0:138:dbff:f52b with SMTP id gt24-20020a056a20105800b00138dbfff52bmr934336pzc.22.1690358933657;
        Wed, 26 Jul 2023 01:08:53 -0700 (PDT)
Date: Wed, 26 Jul 2023 18:08:50 +1000
From: Dave Chinner <david@fromorbit.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: akpm@linux-foundation.org, tkhai@ya.ru, vbabka@suse.cz,
	roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org,
	paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com,
	cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com,
	gregkh@linuxfoundation.org, muchun.song@linux.dev,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
	kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org, linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org, netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com, linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 44/47] mm: shrinker: make global slab shrink lockless
Message-ID: <ZMDUkoIXUlTkCSYL@dread.disaster.area>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-45-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20230724094354.90817-45-zhengqi.arch@bytedance.com>

On Mon, Jul 24, 2023 at 05:43:51PM +0800, Qi Zheng wrote:
> The shrinker_rwsem is a global read-write lock in shrinkers subsystem,
> which protects most operations such as slab shrink, registration and
> unregistration of shrinkers, etc. This can easily cause problems in the
> following cases.
> 
> 1) When the memory pressure is high and there are many filesystems
>    mounted or unmounted at the same time, slab shrink will be affected
>    (down_read_trylock() failed).
> 
>    Such as the real workload mentioned by Kirill Tkhai:
> 
>    ```
>    One of the real workloads from my experience is start
>    of an overcommitted node containing many starting
>    containers after node crash (or many resuming containers
>    after reboot for kernel update). In these cases memory
>    pressure is huge, and the node goes round in long reclaim.
>    ```
> 
> 2) If a shrinker is blocked (such as the case mentioned
>    in [1]) and a writer comes in (such as mount a fs),
>    then this writer will be blocked and cause all
>    subsequent shrinker-related operations to be blocked.
> 
> Even if there is no competitor when shrinking slab, there may still be a
> problem. The down_read_trylock() may become a perf hotspot with frequent
> calls to shrink_slab(). Because of the poor multicore scalability of
> atomic operations, this can lead to a significant drop in IPC
> (instructions per cycle).
> 
> We used to implement the lockless slab shrink with SRCU [2], but then
> kernel test robot reported -88.8% regression in
> stress-ng.ramfs.ops_per_sec test case [3], so we reverted it [4].
> 
> This commit uses the refcount+RCU method [5] proposed by Dave Chinner
> to re-implement the lockless global slab shrink. The memcg slab shrink is
> handled in the subsequent patch.
> 
> For now, all shrinker instances are converted to dynamically allocated and
> will be freed by kfree_rcu(). So we can use rcu_read_{lock,unlock}() to
> ensure that the shrinker instance is valid.
> 
> And the shrinker instance will not be run again after unregistration. So
> the structure that records the pointer of shrinker instance can be safely
> freed without waiting for the RCU read-side critical section.
> 
> In this way, while we implement the lockless slab shrink, we don't need to
> be blocked in unregister_shrinker().
> 
> The following are the test results:
> 
> stress-ng --timeout 60 --times --verify --metrics-brief --ramfs 9 &
> 
> 1) Before applying this patchset:
> 
> setting to a 60 second run per stressor
> dispatching hogs: 9 ramfs
> stressor       bogo ops real time  usr time  sys time   bogo ops/s     bogo ops/s
>                           (secs)    (secs)    (secs)   (real time) (usr+sys time)
> ramfs            735238     60.00     12.37    363.70     12253.05        1955.08
> for a 60.01s run time:
>    1440.27s available CPU time
>      12.36s user time   (  0.86%)
>     363.70s system time ( 25.25%)
>     376.06s total time  ( 26.11%)
> load average: 10.79 4.47 1.69
> passed: 9: ramfs (9)
> failed: 0
> skipped: 0
> successful run completed in 60.01s (1 min, 0.01 secs)
> 
> 2) After applying this patchset:
> 
> setting to a 60 second run per stressor
> dispatching hogs: 9 ramfs
> stressor       bogo ops real time  usr time  sys time   bogo ops/s     bogo ops/s
>                           (secs)    (secs)    (secs)   (real time) (usr+sys time)
> ramfs            746677     60.00     12.22    367.75     12443.70        1965.13
> for a 60.01s run time:
>    1440.26s available CPU time
>      12.21s user time   (  0.85%)
>     367.75s system time ( 25.53%)
>     379.96s total time  ( 26.38%)
> load average: 8.37 2.48 0.86
> passed: 9: ramfs (9)
> failed: 0
> skipped: 0
> successful run completed in 60.01s (1 min, 0.01 secs)
> 
> We can see that the ops/s has hardly changed.
> 
> [1]. https://lore.kernel.org/lkml/20191129214541.3110-1-ptikhomirov@virtuozzo.com/
> [2]. https://lore.kernel.org/lkml/20230313112819.38938-1-zhengqi.arch@bytedance.com/
> [3]. https://lore.kernel.org/lkml/202305230837.db2c233f-yujie.liu@intel.com/
> [4]. https://lore.kernel.org/all/20230609081518.3039120-1-qi.zheng@linux.dev/
> [5]. https://lore.kernel.org/lkml/ZIJhou1d55d4H1s0@dread.disaster.area/
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> ---
>  include/linux/shrinker.h | 19 +++++++---
>  mm/shrinker.c            | 75 ++++++++++++++++++++++++++--------------
>  mm/shrinker_debug.c      | 52 +++++++++++++++++++++-------
>  3 files changed, 104 insertions(+), 42 deletions(-)
> 
> diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
> index 36977a70bebb..335da93cccee 100644
> --- a/include/linux/shrinker.h
> +++ b/include/linux/shrinker.h
> @@ -4,6 +4,7 @@
>  
>  #include <linux/atomic.h>
>  #include <linux/types.h>
> +#include <linux/refcount.h>
>  
>  #define SHRINKER_UNIT_BITS	BITS_PER_LONG
>  
> @@ -86,6 +87,10 @@ struct shrinker {
>  	long batch;	/* reclaim batch size, 0 = default */
>  	int seeks;	/* seeks to recreate an obj */
>  	unsigned flags;
> +	bool registered;
> +
> +	refcount_t refcount;
> +	struct rcu_head rcu;
>  
>  	void *private_data;
>  
> @@ -106,14 +111,13 @@ struct shrinker {
>  #define DEFAULT_SEEKS 2 /* A good number if you don't know better. */
>  
>  /* Flags */
> -#define SHRINKER_REGISTERED	(1 << 0)
> -#define SHRINKER_NUMA_AWARE	(1 << 1)
> -#define SHRINKER_MEMCG_AWARE	(1 << 2)
> +#define SHRINKER_NUMA_AWARE	(1 << 0)
> +#define SHRINKER_MEMCG_AWARE	(1 << 1)
>  /*
>   * It just makes sense when the shrinker is also MEMCG_AWARE for now,
>   * non-MEMCG_AWARE shrinker should not have this flag set.
>   */
> -#define SHRINKER_NONSLAB	(1 << 3)
> +#define SHRINKER_NONSLAB	(1 << 2)
>  
>  unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
>  			  int priority);
> @@ -122,6 +126,13 @@ void shrinker_free_non_registered(struct shrinker *shrinker);
>  void shrinker_register(struct shrinker *shrinker);
>  void shrinker_unregister(struct shrinker *shrinker);
>  
> +static inline bool shrinker_try_get(struct shrinker *shrinker)
> +{
> +	return READ_ONCE(shrinker->registered) &&
> +	       refcount_inc_not_zero(&shrinker->refcount);
> +}

Why do we care about shrinker->registered here? If we don't set
the refcount to 1 until we have fully initialised everything, then
the shrinker code can key entirely off the reference count and
none of the lookup code needs to care about whether the shrinker is
registered or not.

> +void shrinker_put(struct shrinker *shrinker);
> +
>  #ifdef CONFIG_SHRINKER_DEBUG
>  extern int shrinker_debugfs_add(struct shrinker *shrinker);
>  extern struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
> diff --git a/mm/shrinker.c b/mm/shrinker.c
> index 8a1fe844f1a4..8e3334749552 100644
> --- a/mm/shrinker.c
> +++ b/mm/shrinker.c
> @@ -2,10 +2,13 @@
>  #include <linux/memcontrol.h>
>  #include <linux/rwsem.h>
>  #include <linux/shrinker.h>
> +#include <linux/rculist.h>
> +#include <linux/spinlock.h>
>  #include <trace/events/vmscan.h>
>  
>  LIST_HEAD(shrinker_list);
>  DECLARE_RWSEM(shrinker_rwsem);
> +DEFINE_SPINLOCK(shrinker_lock);
>  
>  #ifdef CONFIG_MEMCG
>  static int shrinker_nr_max;
> @@ -450,6 +453,18 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
>  	return freed;
>  }
>  
> +void shrinker_put(struct shrinker *shrinker)
> +{
> +	if (refcount_dec_and_test(&shrinker->refcount)) {
> +		spin_lock(&shrinker_lock);
> +		list_del_rcu(&shrinker->list);
> +		spin_unlock(&shrinker_lock);
> +
> +		kfree(shrinker->nr_deferred);
> +		kfree_rcu(shrinker, rcu);
> +	}
> +}

Urk, no.

We want the shrinker_free() code to block waiting for the shrinker
reference count to go to zero, because the shrinkers can reference
structures that are associated with the path that is freeing the
shrinker.

i.e. we do not want to free the superblock of a filesystem whilst
the shrinker is still running, but the way you've done this is that
the shrinker can run whilst the structure that contains it has been
torn down.

This should use a completion, then it is always safe under
rcu_read_lock().  This also gets rid of the shrinker_lock spin lock,
which only exists because we can't take a blocking lock under
rcu_read_lock(). i.e:


void shrinker_put(struct shrinker *shrinker)
{
	if (refcount_dec_and_test(&shrinker->refcount))
		complete(&shrinker->done);
}

void shrinker_free()
{
	.....
	refcount_dec(&shrinker->refcount);
	wait_for_completion(&shrinker->done);
	/*
	 * lookups on the shrinker will now all fail as refcount has
	 * fallen to zero. We can now remove it from the lists and
	 * free it.
	 */
	down_write(shrinker_rwsem);
	list_del_rcu(&shrinker->list);
	up_write(&shrinker_rwsem);
	call_rcu(shrinker->rcu_head, shrinker_free_rcu_cb);
}

....

> @@ -686,11 +711,14 @@ EXPORT_SYMBOL(shrinker_free_non_registered);
>  
>  void shrinker_register(struct shrinker *shrinker)
>  {
> -	down_write(&shrinker_rwsem);
> -	list_add_tail(&shrinker->list, &shrinker_list);
> -	shrinker->flags |= SHRINKER_REGISTERED;
> +	refcount_set(&shrinker->refcount, 1);
> +
> +	spin_lock(&shrinker_lock);
> +	list_add_tail_rcu(&shrinker->list, &shrinker_list);
> +	spin_unlock(&shrinker_lock);
> +
>  	shrinker_debugfs_add(shrinker);
> -	up_write(&shrinker_rwsem);
> +	WRITE_ONCE(shrinker->registered, true);
>  }
>  EXPORT_SYMBOL(shrinker_register);

This just looks wrong - you are trying to use WRITE_ONCE() as a
release barrier to indicate that the shrinker is now set up fully.
That's not necessary - the refcount is an atomic and along with the
rcu locks they should provides all the barriers we need. i.e.

void shrinker_register(struct shrinker *shrinker)
{
	down_write(&shrinker_rwsem);
	list_add_tail_rcu(&shrinker->list, &shrinker_list);
	shrinker->flags |= SHRINKER_REGISTERED;
	shrinker_debugfs_add(shrinker);
	up_write(&shrinker_rwsem);

	/*
	 * now the shrinker is fully set up, take the first
	 * reference to it to indicate that lookup operations are
	 * now allowed to use it via shrinker_try_get().
	 */
	refcount_set(&shrinker->refcount, 1);
}

> diff --git a/mm/shrinker_debug.c b/mm/shrinker_debug.c
> index f1becfd45853..c5573066adbf 100644
> --- a/mm/shrinker_debug.c
> +++ b/mm/shrinker_debug.c
> @@ -5,6 +5,7 @@
>  #include <linux/seq_file.h>
>  #include <linux/shrinker.h>
>  #include <linux/memcontrol.h>
> +#include <linux/rculist.h>
>  
>  /* defined in vmscan.c */
>  extern struct rw_semaphore shrinker_rwsem;
> @@ -161,17 +162,21 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
>  {
>  	struct dentry *entry;
>  	char buf[128];
> -	int id;
> -
> -	lockdep_assert_held(&shrinker_rwsem);
> +	int id, ret = 0;
>  
>  	/* debugfs isn't initialized yet, add debugfs entries later. */
>  	if (!shrinker_debugfs_root)
>  		return 0;
>  
> +	down_write(&shrinker_rwsem);
> +	if (shrinker->debugfs_entry)
> +		goto fail;
> +
>  	id = ida_alloc(&shrinker_debugfs_ida, GFP_KERNEL);
> -	if (id < 0)
> -		return id;
> +	if (id < 0) {
> +		ret = id;
> +		goto fail;
> +	}
>  	shrinker->debugfs_id = id;
>  
>  	snprintf(buf, sizeof(buf), "%s-%d", shrinker->name, id);
> @@ -180,7 +185,8 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
>  	entry = debugfs_create_dir(buf, shrinker_debugfs_root);
>  	if (IS_ERR(entry)) {
>  		ida_free(&shrinker_debugfs_ida, id);
> -		return PTR_ERR(entry);
> +		ret = PTR_ERR(entry);
> +		goto fail;
>  	}
>  	shrinker->debugfs_entry = entry;
>  
> @@ -188,7 +194,10 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
>  			    &shrinker_debugfs_count_fops);
>  	debugfs_create_file("scan", 0220, entry, shrinker,
>  			    &shrinker_debugfs_scan_fops);
> -	return 0;
> +
> +fail:
> +	up_write(&shrinker_rwsem);
> +	return ret;
>  }
>  
>  int shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...)
> @@ -243,6 +252,11 @@ struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
>  	shrinker->name = NULL;
>  
>  	*debugfs_id = entry ? shrinker->debugfs_id : -1;
> +	/*
> +	 * Ensure that shrinker->registered has been set to false before
> +	 * shrinker->debugfs_entry is set to NULL.
> +	 */
> +	smp_wmb();
>  	shrinker->debugfs_entry = NULL;
>  
>  	return entry;
> @@ -266,14 +280,26 @@ static int __init shrinker_debugfs_init(void)
>  	shrinker_debugfs_root = dentry;
>  
>  	/* Create debugfs entries for shrinkers registered at boot */
> -	down_write(&shrinker_rwsem);
> -	list_for_each_entry(shrinker, &shrinker_list, list)
> +	rcu_read_lock();
> +	list_for_each_entry_rcu(shrinker, &shrinker_list, list) {
> +		if (!shrinker_try_get(shrinker))
> +			continue;
> +		rcu_read_unlock();
> +
>  		if (!shrinker->debugfs_entry) {
> -			ret = shrinker_debugfs_add(shrinker);
> -			if (ret)
> -				break;
> +			/* Paired with smp_wmb() in shrinker_debugfs_detach() */
> +			smp_rmb();
> +			if (READ_ONCE(shrinker->registered))
> +				ret = shrinker_debugfs_add(shrinker);
>  		}
> -	up_write(&shrinker_rwsem);
> +
> +		rcu_read_lock();
> +		shrinker_put(shrinker);
> +
> +		if (ret)
> +			break;
> +	}
> +	rcu_read_unlock();
>  
>  	return ret;
>  }

And all this churn and complexity can go away because the
shrinker_rwsem is still used to protect shrinker_register()
entirely....

-Dave.
-- 
Dave Chinner
david@fromorbit.com


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 08:20:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 08:20:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570184.891740 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZlE-00068W-15; Wed, 26 Jul 2023 08:20:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570184.891740; Wed, 26 Jul 2023 08:20:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZlD-00068P-Tb; Wed, 26 Jul 2023 08:20:43 +0000
Received: by outflank-mailman (input) for mailman id 570184;
 Wed, 26 Jul 2023 08:20:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qOZlC-00068J-B4
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 08:20:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qOZlB-0004HR-D6; Wed, 26 Jul 2023 08:20:41 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qOZlB-0007uY-70; Wed, 26 Jul 2023 08:20:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=W0DJyua12lvqbd3sCYRyDdR+9JCOG3MY4JRuZHDUj+I=; b=G8bM+Oz0XYsxiDpdt13Lux0jMN
	IdA9w8thgki/4/7YkSX6/CELt6ggqbgDGsBIYx1/htU4CpQchrl1CmKtuEDYhJ55q9tkHWo1YkMH0
	aC3NTcsv0lCq7cetIhQ+4G2po7RfWIsmJYq3wS2SKIDyy6VG0ZJpihtzHDDhjo2COr5k=;
Message-ID: <f0a115a6-843e-74ff-7f0f-28cf0545932e@xen.org>
Date: Wed, 26 Jul 2023 09:20:39 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 08/25] tools/xenstore: make hashtable key and value
 parameters const
Content-Language: en-GB
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-9-jgross@suse.com>
 <2c981a1a-b020-3908-8b9b-8821daec9457@xen.org>
 <a6370aa2-ec6c-259f-3e24-bc1a74ead2a6@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <a6370aa2-ec6c-259f-3e24-bc1a74ead2a6@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Juergen,

On 26/07/2023 07:19, Juergen Gross wrote:
> On 25.07.23 18:08, Julien Grall wrote:
>> Hi,
>>
>> On 24/07/2023 12:02, Juergen Gross wrote:
>>> The key and value are never modified by hashtable code, so they should
>>> be marked as const.
>>
>> You wrote this but...
>>
>>>
>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>>> ---
>>> V3:
>>> - make value const, too.
>>> ---
>>> Â  tools/xenstore/hashtable.c | 7 ++++---
>>> Â  tools/xenstore/hashtable.h | 4 ++--
>>> Â  2 files changed, 6 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c
>>> index 11f6bf8f15..670dc01003 100644
>>> --- a/tools/xenstore/hashtable.c
>>> +++ b/tools/xenstore/hashtable.c
>>> @@ -11,7 +11,8 @@
>>> Â  struct entry
>>> Â  {
>>> -Â Â Â  void *k, *v;
>>> +Â Â Â  const void *k;
>>> +Â Â Â  void *v;
>>
>>
>> ... this is not const and ...
>>
>>> Â Â Â Â Â  unsigned int h;
>>> Â Â Â Â Â  struct entry *next;
>>> Â  };
>>> @@ -140,7 +141,7 @@ static int hashtable_expand(struct hashtable *h)
>>> Â Â Â Â Â  return 0;
>>> Â  }
>>> -int hashtable_add(struct hashtable *h, void *k, void *v)
>>> +int hashtable_add(struct hashtable *h, const void *k, const void *v)
>>> Â  {
>>> Â Â Â Â Â  /* This method allows duplicate keys - but they shouldn't be 
>>> used */
>>> Â Â Â Â Â  unsigned int index;
>>> @@ -164,7 +165,7 @@ int hashtable_add(struct hashtable *h, void *k, 
>>> void *v)
>>> Â Â Â Â Â  e->k = k;
>>> Â Â Â Â Â  if (h->flags & HASHTABLE_FREE_KEY)
>>> Â Â Â Â Â Â Â Â Â  talloc_steal(e, k);
>>> -Â Â Â  e->v = v;
>>> +Â Â Â  e->v = (void *)v;
>>
>> ... you cast-away the const here. I think this is a pretty bad idea.
>>
>> Can you clarify why you are doing like that?
> 
> The value is never changed by the hashtable code, but it might be 
> changed by
> e.g. a caller of hashtable_search() (see e.g. callers of 
> find_domain_struct()).
> 
> Somewhere I need to cast the const away. I could do so in 
> hashtable_search()
> in case you prefer me to do so.

My problem is not with the placement of the const but the fact you are 
removing the const.

I agree that the hashtable code is not meant to modify the content. 
However, as you wrote, the caller of hashtable_search() could modify the 
content. So, for me, the value should not be const in the hashtable code.

To give a concrete example, with the current interface we are telling 
the user that what they store in the hashtable can be modified at some 
point. By adding 'const' for the value in hashtable_add(), we can 
mislead a user to think it is fine to store static string, yet this is 
not enforced all the way through. So one could mistakenly think that 
values returned hashtable_search() can be modified. And the compiler 
will not be here to help enforcing it because you cast-away the const.

Do you have any code in this series that requires the 'const' in 
hashtable_add()? If so, can you point me to the patch and I will have a 
look?

If not, then I will strongly argue that this should be dropped because 
dropping a const is always a recipe for disaster.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 08:28:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 08:28:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570189.891750 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZs6-0006p0-Qp; Wed, 26 Jul 2023 08:27:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570189.891750; Wed, 26 Jul 2023 08:27:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOZs6-0006ot-Nd; Wed, 26 Jul 2023 08:27:50 +0000
Received: by outflank-mailman (input) for mailman id 570189;
 Wed, 26 Jul 2023 08:27:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+seJ=DM=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qOZs4-0006on-IT
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 08:27:48 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4cc25310-2b8e-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 10:27:47 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.163.229.19])
 by support.bugseng.com (Postfix) with ESMTPSA id 8A7A54EE0738;
 Wed, 26 Jul 2023 10:27:45 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4cc25310-2b8e-11ee-b242-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH] xen/event: address violations of MISRA C:2012 Rules 8.2 and 8.3
Date: Wed, 26 Jul 2023 10:27:38 +0200
Message-Id: <367ab3b09deaab82dfea0e833eeceaf8de49f5c1.1690359344.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Give a name to unnamed parameters thus addressing violations of
MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
named parameters").
Keep consistency between parameter names and types used in function
declarations and the ones used in the corresponding function
definitions, thus addressing violations of MISRA C:2012 Rule 8.3
("All declarations of an object or function shall use the same names
and type qualifiers").

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/include/xen/event.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 8eae9984a9..8e509e0784 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -48,10 +48,10 @@ int set_global_virq_handler(struct domain *d, uint32_t virq);
  *  @d:        Domain to which physical IRQ should be sent
  *  @pirq:     Physical IRQ number
  */
-void send_guest_pirq(struct domain *, const struct pirq *);
+void send_guest_pirq(struct domain *d, const struct pirq *pirq);
 
 /* Send a notification from a given domain's event-channel port. */
-int evtchn_send(struct domain *d, unsigned int lport);
+int evtchn_send(struct domain *ld, unsigned int lport);
 
 /* Bind a local event-channel port to the specified VCPU. */
 int evtchn_bind_vcpu(evtchn_port_t port, unsigned int vcpu_id);
@@ -69,7 +69,7 @@ int evtchn_close(struct domain *d1, int port1, bool guest);
 void evtchn_free(struct domain *d, struct evtchn *chn);
 
 /* Allocate a specific event channel port. */
-int evtchn_allocate_port(struct domain *d, unsigned int port);
+int evtchn_allocate_port(struct domain *d, evtchn_port_t port);
 
 /* Allocate a new event channel */
 int __must_check evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc,
@@ -78,7 +78,7 @@ int __must_check evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc,
 /* Bind an event channel port to interdomain */
 int __must_check evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind,
                                          struct domain *ld,
-                                         evtchn_port_t port);
+                                         evtchn_port_t lport);
 
 /* Unmask a local event-channel port. */
 int evtchn_unmask(unsigned int port);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 08:43:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 08:43:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570195.891760 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOa6q-0000lo-4C; Wed, 26 Jul 2023 08:43:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570195.891760; Wed, 26 Jul 2023 08:43:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOa6p-0000lh-Vz; Wed, 26 Jul 2023 08:43:03 +0000
Received: by outflank-mailman (input) for mailman id 570195;
 Wed, 26 Jul 2023 08:43:03 +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
 <SRS0=CD/9=DM=citrix.com=prvs=564dce665=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOa6p-0000lb-7e
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 08:43:03 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6c8bb2c6-2b90-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 10:43:00 +0200 (CEST)
Received: from mail-bn8nam12lp2170.outbound.protection.outlook.com (HELO
 NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.170])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 26 Jul 2023 04:42:56 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by CH2PR03MB5221.namprd03.prod.outlook.com (2603:10b6:610:90::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 08:42:54 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023
 08:42:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6c8bb2c6-2b90-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690360980;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=XZFA3NODJPufjDyBWNkLFfqREMyNIbBPtxlPsMSHlpI=;
  b=ZSlYTvBBdLI1HQxzUPlZSU9uLmCfa5MXLtolG54/qsm7pqavNnQWjhKM
   Uk5slI0ftxIieHvbXaU33gtWPA0bZv3EPaQNqXLmqi+OuM8qgjXreMceg
   yCJrdlG9+1B+6yJ6aAwwszPLm8LVdmLbeG6eEfkp7mdv5NDdFkCvEIneF
   U=;
X-IronPort-RemoteIP: 104.47.55.170
X-IronPort-MID: 120099612
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:VjU3IK783t4WQsaZxnBqeAxRtP/GchMFZxGqfqrLsTDasY5as4F+v
 mVNDWqFPazfZTGjf9FyPd7j/BtTv8fTzYdrGgdkrX0xHi5G8cbLO4+Ufxz6V8+wwm8vb2o8t
 plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraCYnsrLeNdYH9JoQp5nOIkiZJfj9G8Agec0
 fv/uMSaM1K+s9JOGjt8B5mr9lU35ZwehBtC5gZlPa8R4QeE/5UoJMl3yZ+ZfiOQrrZ8RoZWd
 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4
 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5m1
 KRDFAJdcEq4rPOI57iJTdJCt/t8BZy+VG8fkikIITDxK98DGMq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aM6Ag3d83gt
 DMQVlYvWk9dwbnDtCPxoRC9lTITH+mVTrgx8lC79wh04eMCIbDIGmGUhQjgsGgq/IQDonSXO
 uyIotfB7vmIXH1EYhE0gXiU91ZKGUYUscSptEnMmj+7/7jO8nvrKjWYfzTLL3iHXItXX7+GG
 IKWHzpKMBJ/imQKzbFadjqKgXQk2DEjOVN+fLhjp0uIaA2R/lxjjQ=
X-Talos-CUID: 9a23:B9FNCW4CeEs9k3S8ddss1RZPJvJ1bCfm52buBEWKDl1HeYLKYArF
X-Talos-MUID: =?us-ascii?q?9a23=3AmDDuUgzIM3pEkgN7YVyTXPbqUnSaqKa1F1ILqa1?=
 =?us-ascii?q?Xgfi/NipdHgyFk2mzf6Zyfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,231,1684814400"; 
   d="scan'208";a="120099612"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=G+ErOwoU0amxwD9Eqt3+F/hkMP/Phzq9Q68FbdPY1ovIB9LU9RuUzetRrIpcOtITySKNbGCSCDqQ12DlE7qgo70yhohyS30hQ4I0pq0ISwplXRMtr4bacNeYeNyjPzWwkq+KMLYKDlkh146CWs3KM73/PeOnq44SZIx1CG7Fe585oz3Di+bYEL3eer1iD+dNNhk/0+II3n2r5cS+7HR7SF0b9LyETaiRIbut/iMr83LClHqUS/sbCGG+tprYNjrdmPshRUC6GuHZkXwbBJkX34rA3d9/hFlKAaVQsQhZbU77bj7szsSUSpWTk9qsI8mov2zsqHq8tOSzr1bPshSiEA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Xu5DTKTOnkrNQYMrvMddhJv/W0069m8B2szg4ae1OLo=;
 b=c5rZ10XgjdgakCgGUt6XRaEHyv1+oYQYh8PcYQfO6FitUF3v9BR4XsY012BUb3jkgmKQafS0Fawm6xyISBi/b81/RU0cmeY1u3jsmmIj2vV/AcMOSt0TmfuhstAVuCOPlCR1Kd85kaYycpgSi77ztnoz2qyVLNcBcgdSLniRQGSHobAxgbyzTEr8zskqEoVIBWrYmkVOC6nvjXYSp3dmS/JcJS9jh9PcW7+zL6S/YZH89zmVBKoiSdtwI9u9FgWgTmsOuzgaNMz1l0mKwh+zuLOwOv5mFTuUdqxg0JYu/uZnullKPU4N9IHGj9BKssobtrdAfG3CC/PY//PEhBsJCA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Xu5DTKTOnkrNQYMrvMddhJv/W0069m8B2szg4ae1OLo=;
 b=tyQKh1X2RszE2SmOWSILzvlqK7xJKBXBy3fp2nr+CV/P+B+GQLoUvZKyaQiX9f+HJBU1cVUeqFoBLhbQltFVVWRYmApUgW4B4dYHKBLuyIuKAshpER8QwSQ0kAPTA3O9SUrK/Zyakwp03LmHNLFB52BalyANwYPl74O4bXYJ+tI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Wed, 26 Jul 2023 10:42:48 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH v8 04/13] vpci: add hooks for PCI device assign/de-assign
Message-ID: <ZMDciOYZTLv_sYYA@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-5-volodymyr_babchuk@epam.com>
 <ZLkqWXJtYlsJ4M61@MacBook-Air-de-Roger.local>
 <875y67cuzu.fsf@epam.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <875y67cuzu.fsf@epam.com>
X-ClientProxiedBy: LNXP123CA0019.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:d2::31) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|CH2PR03MB5221:EE_
X-MS-Office365-Filtering-Correlation-Id: f45d7311-904b-46a0-b70c-08db8db44dce
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	QGyscLut7cfD/tD/XlhAUflzWlKePiEzMnkXU+paU46CBdRSZvP7htJauHMu0gZCx6DTITsKpo0S0k5segZXTc5dA5UufyA01BnHt16tZwzHrL/StZIxpDWvqCjvKc7OwsX+hzVpwKV9Q8m1YUOoospAS0v9kt0fZUJljjW9/2WwmUwGP9v6u37jzwnUrMP9USrxUhdcAP55Fi1ZZVLfYGQG1Cu9PIHVCxs6cT5pClxczxYYYS0wD3fr3Rp4+Wx4IlthkdC3tevq5+R9gf6ZdpeuyE//SBS32GfFwfVnKM7slEETxxyrCs9ctxFzxc9gcg87xEz3AZsEs6D4imk58PwHPTj1TQn1CxQTjw9FE/epL9qpnVxTJ3v4DBD3fQddNQ+PGjS70INj9tLNaNgI7G1TO0xBSWrEmKtQ2JuXarpp3G9yxy1K+j0lbZp3hIi3PI0PpIT9vvQQMZKTLhMkBS/J+M5hOUlf7pmOXALlayOMesAQfZ/uPVL/HWclirV2hZm/3GUK1v5ZJr72cEoY6CTkmqt5r8rIjuXihiYkP8U/wUpK5zGzpg9N9U3ff1N0
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(396003)(136003)(366004)(39860400002)(451199021)(6512007)(6486002)(54906003)(478600001)(6666004)(9686003)(83380400001)(85182001)(86362001)(2906002)(66556008)(66476007)(186003)(6506007)(26005)(82960400001)(38100700002)(66946007)(6916009)(316002)(4326008)(41300700001)(8936002)(8676002)(5660300002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RlB1WmVueFdyVlRSeEdOd3o2b2J0MTJWdm9FWHUwT0UwRTB6WUE5am5LdGhY?=
 =?utf-8?B?dnlYaU4ySlFSM0Y1eFZvWDRKS2UxZlZxRUVvOTh1Z2JtdTFQWDU1SWtKWUtx?=
 =?utf-8?B?aVhSZHNZOUhNWWk5SGVJakd1eW1aejlka1N4ejdZa0JxdnY2NXVrQlI1aUNx?=
 =?utf-8?B?OG1NRUt6U2h1OVYrNEYzWEtLTmpHZDBiaHl0dmRuZFBpTEphckRPWWs4S3BK?=
 =?utf-8?B?OHAxYXRWbFRmQmlUOXVzNlVERCs5Z1FMeDVsaDFhMDFaL3VucndoVXk1QzZZ?=
 =?utf-8?B?RHdYd0hEL3FFUFQ1Nk0wa09pTVZWV01LSkZlTDY5bnJxQXlzbDNOUUhOclBQ?=
 =?utf-8?B?c1N1UmhibUt5YU1RRjhObERubnY2MlE4Yi81QTI1Mnl5UGxrdXZwZ2JqdzYz?=
 =?utf-8?B?cU14NEJLTHpBeG9xMkJDL0VvWmNqcG9MZWExanBhcXNPRDdOV0k1WG1yWmYw?=
 =?utf-8?B?YmNLaElaTDF1dzllOURlNkZ3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ExternalHop-MessageData-0:
	gqywMeY+xQYzEmUJ+S4kPUw2da22Aww29QHgT1HIwoL0YoxXFrIpznz/t/G+nXZ/jIHz1lPS+jnMpbGSP0WBulq1nVdKXQ9WyGj5Zx8XlVuyWlJ5OAcW0fI4SszHEmVuuff2BGq4nDLSabz7BuAUeZPKiqxsDbJ30QwtuJBrIgZ+q72Lv/kJSYgsgtyVt0RMa3FmRYfNmUqytKLpG/NvCcua3r3hPpEZJBRbl+JGQHHyYlmi1YddiZDOzVk86T/hQDmMOoqDGdlAN+YCmKZCGt7b4YfD8pjYL+dRrLv2pLAwLg8RrDZ1bgW7lW7pW6jnWpFfquDvtq7yScoIT2+7653mOImL8NtJBgSWCJAIKF/pk9BQu8TJA7MKIDH+WuoAwV0dxRpCd5YfsvVpm7YcH62pDOo10RhsjKWolQ4ss3bvxleh/pV12fR+ji9c9Gf9D9NvcqxAX+M1BeT1LdBvjjw1KLAiopleaBnpSgcYQ72hzKPi2deinjvddgQlHU46mmCiF9Gon86E0fntZlE/cS9JjPYOH2QiMuTrgll3hvqYrcXs+TcTr0+O+uFnC3bZQp3632BNg7HTpT/nfjzp5fzo97+vPkLfgT13kXp317tKV0rlNE4s5FTNaJ9jyzq49yO0SEY4cUYeTY6oL2YXXO59gHE5gs5Cy2BScofkBb1c2EdfEwQ7opQVAsuja/EBQMcVIfbJF6y9RCkmWiMMmNkNfiyaLywXofaRWQ8QImOyRzImBqxDlfFtrdtHlBxeWXq+eAlSK9mHEvXeswD+R3BMVeGIeA9f28SN0Ce03jg=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f45d7311-904b-46a0-b70c-08db8db44dce
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 08:42:54.5453
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 58fRPdEcSm7fpa9xuuPHwJIJYlidf4yfL5B71uJasSwWJ99isY2q8k3XfXkJq+1KeJ2ftFo38sVfiFBcd9vkKQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR03MB5221

On Wed, Jul 26, 2023 at 01:38:30AM +0000, Volodymyr Babchuk wrote:
> 
> Hi Roger,
> 
> Roger Pau MonnÃ© <roger.pau@citrix.com> writes:
> 
> > On Thu, Jul 20, 2023 at 12:32:31AM +0000, Volodymyr Babchuk wrote:
> >> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> >> @@ -1509,6 +1517,19 @@ static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn, u32 flag)
> >>          rc = iommu_call(hd->platform_ops, assign_device, d, devfn,
> >>                          pci_to_dev(pdev), flag);
> >>      }
> >> +    if ( rc )
> >> +        goto done;
> >> +
> >> +    devfn = pdev->devfn;
> >> +    write_lock(&pdev->domain->pci_lock);
> >> +    rc = vpci_assign_device(pdev);
> >> +    write_unlock(&pdev->domain->pci_lock);
> >> +    if ( rc && deassign_device(d, seg, bus, devfn) )
> >> +    {
> >> +        printk(XENLOG_ERR "%pd: %pp was left partially assigned\n",
> >> +               d, &PCI_SBDF(seg, bus, devfn));
> >
> > &pdev->sbdf?  Then you can get of the devfn usage above.
> 
> Yes, thanks.
> 
> >> +        domain_crash(d);
> >
> > This seems like a bit different from the other error paths in the
> > function, isn't it fine to return an error and let the caller handle
> > the deassign?
> 
> I believe, intention was to not leave device in an unknown state: we
> failed both assign_device() and deassign_device() call, so what to do
> now? But yes, I think you are right and it is better to let caller to
> decide what to do next.

I don't think it would be a security risk to leave the device in that
state.  For domUs the guest won't get access to the device registers
anyway as we use an allow list approach.  Also deassign_device() is
not called when we fail to assign one of the phantom functions.

We don't seem to undo any of the work in assign_device() on error so
it should be fine to not do the call to deassign_device() on error to
initialize vPCI.

> >
> > Also, if we really need to call deassign_device() we must do so for
> > all possible phantom devices, see the above loop around
> > iommu_call(..., assing_device, ...);
> 
> But deassign_device() has the loop for all phantom devices that already
> does all the work. Unless I miss something, of course.

No, you are right, a single call is fine.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 08:44:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 08:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570197.891769 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOa8G-0001Il-DA; Wed, 26 Jul 2023 08:44:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570197.891769; Wed, 26 Jul 2023 08:44:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOa8G-0001Ie-Ad; Wed, 26 Jul 2023 08:44:32 +0000
Received: by outflank-mailman (input) for mailman id 570197;
 Wed, 26 Jul 2023 08:44:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=iO1l=DM=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qOa8F-0001IY-8Q
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 08:44:31 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a27c8a36-2b90-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 10:44:30 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 4F2E61F74A;
 Wed, 26 Jul 2023 08:44:29 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 263AE139BD;
 Wed, 26 Jul 2023 08:44:29 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id d+bbB+3cwGSGTgAAMHmgww
 (envelope-from <jgross@suse.com>); Wed, 26 Jul 2023 08:44:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a27c8a36-2b90-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690361069; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=+L4bV9A3r7ZQPoItmh52b7MPUNFug+pWtexA1gSBeJg=;
	b=YYgqFDSRl67jXm/1C6geiCWQfmvkMjTd3PJntCNptuCljnuGg5MK35nh8NSD/H8M1Zgwlu
	hRjTyJUf8zCMAPWM9g5drFlZXZtrjDrWxYqtdnMrzRmoyuRYn4KjoT44fkvweRtioT/BWV
	kj0463ajHmBRexRFDjwNmRwQUj4njXk=
Message-ID: <3d2daedf-b2c0-5a26-a57d-4742f69f08b7@suse.com>
Date: Wed, 26 Jul 2023 10:44:28 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-9-jgross@suse.com>
 <2c981a1a-b020-3908-8b9b-8821daec9457@xen.org>
 <a6370aa2-ec6c-259f-3e24-bc1a74ead2a6@suse.com>
 <f0a115a6-843e-74ff-7f0f-28cf0545932e@xen.org>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v3 08/25] tools/xenstore: make hashtable key and value
 parameters const
In-Reply-To: <f0a115a6-843e-74ff-7f0f-28cf0545932e@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------HcqkV0qsmzf808KTJkaI7EnF"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------HcqkV0qsmzf808KTJkaI7EnF
Content-Type: multipart/mixed; boundary="------------IxMF7yNro0sfm27XhShMNOb5";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <3d2daedf-b2c0-5a26-a57d-4742f69f08b7@suse.com>
Subject: Re: [PATCH v3 08/25] tools/xenstore: make hashtable key and value
 parameters const
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-9-jgross@suse.com>
 <2c981a1a-b020-3908-8b9b-8821daec9457@xen.org>
 <a6370aa2-ec6c-259f-3e24-bc1a74ead2a6@suse.com>
 <f0a115a6-843e-74ff-7f0f-28cf0545932e@xen.org>
In-Reply-To: <f0a115a6-843e-74ff-7f0f-28cf0545932e@xen.org>

--------------IxMF7yNro0sfm27XhShMNOb5
Content-Type: multipart/mixed; boundary="------------4YYRWBuh4xJX9GVFUWJSGnr4"

--------------4YYRWBuh4xJX9GVFUWJSGnr4
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjYuMDcuMjMgMTA6MjAsIEp1bGllbiBHcmFsbCB3cm90ZToNCj4gSGkgSnVlcmdlbiwN
Cj4gDQo+IE9uIDI2LzA3LzIwMjMgMDc6MTksIEp1ZXJnZW4gR3Jvc3Mgd3JvdGU6DQo+PiBP
biAyNS4wNy4yMyAxODowOCwgSnVsaWVuIEdyYWxsIHdyb3RlOg0KPj4+IEhpLA0KPj4+DQo+
Pj4gT24gMjQvMDcvMjAyMyAxMjowMiwgSnVlcmdlbiBHcm9zcyB3cm90ZToNCj4+Pj4gVGhl
IGtleSBhbmQgdmFsdWUgYXJlIG5ldmVyIG1vZGlmaWVkIGJ5IGhhc2h0YWJsZSBjb2RlLCBz
byB0aGV5IHNob3VsZA0KPj4+PiBiZSBtYXJrZWQgYXMgY29uc3QuDQo+Pj4NCj4+PiBZb3Ug
d3JvdGUgdGhpcyBidXQuLi4NCj4+Pg0KPj4+Pg0KPj4+PiBTaWduZWQtb2ZmLWJ5OiBKdWVy
Z2VuIEdyb3NzIDxqZ3Jvc3NAc3VzZS5jb20+DQo+Pj4+IC0tLQ0KPj4+PiBWMzoNCj4+Pj4g
LSBtYWtlIHZhbHVlIGNvbnN0LCB0b28uDQo+Pj4+IC0tLQ0KPj4+PiDCoCB0b29scy94ZW5z
dG9yZS9oYXNodGFibGUuYyB8IDcgKysrKy0tLQ0KPj4+P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mb3IgZGlzYXN0ZXIuDQoN
CkRlcGVuZHMgSU1PLg0KDQpJIGJlbGlldmUgaXQgaXMgYmV0dGVyIGFzIEkndmUgZG9uZSBp
dCwgYnV0IGluIGNhc2UgeW91IGluc2lzdCBvbiBpdCBJIGNhbiBkcm9wDQp0aGUgcGF0Y2gu
DQoNCkFuIGFsdGVybmF0aXZlIHdvdWxkIGJlIG1ha2UgaGFzaHRhYmxlX3NlYXJjaCgpIHJl
dHVybiBhIGNvbnN0IGFuZCBvbmx5IGNhc3QgdGhlDQpjb25zdCBhd2F5IHdoZXJlIGl0IGlz
IHJlYWxseSBuZWVkZWQgKGFuZCBwcm9iYWJseSB3aXRoIGEgcHJvbWluZW50IGNvbW1lbnQg
YXQNCnRoZSByZWxhdGVkIGhhc2h0YWJsZV9hZGQoKSBwbGFjZSkuIEkgdGhpbmsgdGhpcyB3
aWxsIGhpdCB4ZW5zdG9yZWRfZG9tYWluLmMgdXNlDQpjYXNlcyBvbmx5Lg0KDQoNCkp1ZXJn
ZW4NCg==
--------------4YYRWBuh4xJX9GVFUWJSGnr4
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc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zz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------4YYRWBuh4xJX9GVFUWJSGnr4--

--------------IxMF7yNro0sfm27XhShMNOb5--

--------------HcqkV0qsmzf808KTJkaI7EnF
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmTA3OwFAwAAAAAACgkQsN6d1ii/Ey/I
pgf8Dmvx5rQ7U/QXq0qoVYOayR6mhNNmKoYdFpe+FiJOTH1NtTQSwv3nK3u3KxsuBx/B74EKJId7
vYwktLLdRnyGaMSV6A8aQbl7+H1GmBNdiPTCMcGzAhv2XZne/hYUZpDX+AVAwOX3x1ZXtKyC9MoH
4IoVryMgh83/ob5I/P41aCMwMPMS65GevUhjQ3GKhZ9S5dPhgUKmUCuNbFicpGYALJJSqbos2uvN
g1snCQwOeR9Qgqj5ezhj8NXZwoOKRjKuQwARrF+faj+YujgR5RYJLV0CohaNtCj9J7KYnaBUlW2n
a5lhtnb4GAT1QWxlyXdEBv7nPc7U1pAxMmjTCsnZow==
=ILHv
-----END PGP SIGNATURE-----

--------------HcqkV0qsmzf808KTJkaI7EnF--


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 09:02:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 09:02:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570207.891779 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOaP6-0003s3-2P; Wed, 26 Jul 2023 09:01:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570207.891779; Wed, 26 Jul 2023 09:01:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOaP5-0003rw-VH; Wed, 26 Jul 2023 09:01:55 +0000
Received: by outflank-mailman (input) for mailman id 570207;
 Wed, 26 Jul 2023 09:01:54 +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 <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOaP3-0003rl-WE
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 09:01:54 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0604.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::604])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0f407675-2b93-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 11:01:51 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8525.eurprd04.prod.outlook.com (2603:10a6:102:210::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 09:01:48 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 09:01:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0f407675-2b93-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=h5zfiGEdYOd1osWf4uyX0WXtvNSzzQgx6Arhkgrrs3k5Qh9iG7ta3ZTbG5oPhxjI3mNDTibOMDiU/fECuaBG546kQfqSoSxucF4AnzkoLGnvBk+6UXKqV+mEx/ljz08WgHd3Gg3xVb+kFGnZkz2biCd0j87aIJytK4PzNR3MOxzi9uRgs99Ghlz/haDImAGcH5aYNLfkk96RX/mX/8WKVQP6UXFDfuSNQru4TEH8ujJ6QwrGu+Fwt0Y8zeYZJrZAVoR2y6Xms767gVElyxbc8hs0noh+S8u7MgrTlEVf59dDCDkQ7CaBpILF9SrF5JuPDdFRmCMrfkera1JOvGbjrg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=eerz2M6E3rou8hNyM7yvUbjxsnb1T8UVB51DrYTxpTg=;
 b=VL1+ypIl3gUkdcXbUCRmApEoDGgr8lb3HrHC0Cndcar0tQujJJBuFxmp0S1MXUa4rFvWy53oWnrINsi2ERcETjfA9iirFEJFSjOFCF931eWRVUwiMnZ31o9WQ+saq5HCfQhz3FJjEQLiw2zpYgvxewrnd8iWsmPalDam6wKgmh4CwDUkAzo7koFChh9Z/CFJFmUvrHgrTsba5VnjLfozjIpMhOQdWW+tEo0qeh7MPcrtD/wgb0fk86DAcxUmHFw1gb/0UO1RSsavzsehyVjhdgIdPd2PP9UE6Qp+kgUb7OrmPlyZYdiVNfm7Rmb6D51VBbaTXJNvlUV378aKv6CImQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=eerz2M6E3rou8hNyM7yvUbjxsnb1T8UVB51DrYTxpTg=;
 b=Vo+ecHzP+rEMeKZcOkqm7IbhjhBUML7ndKWQl5ahnXYfWvXqbJkBy2idewF1wdLktbgqXNBg0/lzyB7Y5cv6SgnFIYnds3MUxrRuW7UBXqXMHvb5n1Q2e8Um6cNjb2stgp6M3l9fi0GE8+UBl2UcHJDonxrkRpsBDO+48uDPF3dJOCN0kLKityHJ7Oubape+KLrIBPmH1/F8mxFv+SEyuQluaEwHYroyHKevLgyJDbSveTP0tcnWnLhuvEBEkVydjeDLrZ/Klf8ZPBWRKndMjkQ7swBohSom3c+SiIkPozz+N7pvKD3S+Mvs41eBc3qdo4FU+dtbOYyMIcre01da0w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <dabe1210-486a-3ee9-f568-77d651e7ef85@suse.com>
Date: Wed, 26 Jul 2023 11:01:45 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] xen: use parameter name 'mcs' in
 arch_do_multicall_call()
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <cf380b972333d56858b10d6dd61b6033d3782fce.1690355367.git.federico.serafini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <cf380b972333d56858b10d6dd61b6033d3782fce.1690355367.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0041.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:48::6) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8525:EE_
X-MS-Office365-Filtering-Correlation-Id: 120a2221-9848-4c04-f995-08db8db6f1c7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Df+qxvnfA8+gtK3bCIjitLA9pFQxGq7h4Ry+2oTN+PJ7I+83Y9b7KX5uy4Uw8Kvp7yFa9HrzKGz+aUgx/+B7sSbosf0DI6LBwIbHJVuQTM1zTtQ8vUV9+m8LgfcWsd5tkJZKs8n5VBFMXRLACfxY5+YtfxCf8xLEOhHHE+tf9GxinbncN/qY1YGl/TTNOJo3l8ALByELEto5ey7R03AsbYHxx2WlyQiWxIA8lnvRWlboynksC52f2YYkP9VWV/1ZenrwgWtjqCVdSDh79wMi9Aj2QtsV2p/pgaY1pTVzE7G3slJIko9XLHuRXJz2RgDFYWQx3k5XP8Onv+Hr3cSB54UTXQPyohwj1qm76KGMykdN13JVFY++BOat4HIUpw82hy89Oih/S3mRhLRH3IExA3iiafs5m/hSkI02O/r9ki7nTxgVboHJ0fP4/hSQZwE8Wdeio2qeE+CeS4+39PfKkLkq90iFFBW9vtz8b4s7zW6fvCGDrYN0qEIs4ATT9rkUMeRWdD+omZhCab9RgqBFZyzuoO5ghZrBFFCbTwrVnD3wDyO8WUl7Wu5wGV+PDQkJXHL615YCzxUCszOphjz50EcTvSiUonEIookuObB7sPsogor0dcIZXdG+bIvoyRkGEPwlkuhoDfMUhB+Z8o9lzg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(396003)(376002)(136003)(39860400002)(366004)(451199021)(31686004)(186003)(26005)(2906002)(6506007)(4744005)(31696002)(86362001)(6916009)(7416002)(36756003)(8936002)(8676002)(316002)(54906003)(6666004)(6486002)(4326008)(6512007)(478600001)(38100700002)(41300700001)(5660300002)(66946007)(66556008)(66476007)(53546011)(2616005)(83380400001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-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seGNmV3Zxd0Q4ZUJHOEEyVVBRaVpJalBwNHhaRHAr?=
 =?utf-8?B?aWRkVXZFY2NnOVcrT05HcWlsbGQyVU9TSFpWZjU3cS9mbFIzOE9WL0RsN3F5?=
 =?utf-8?B?b01BWE1wWThIMDZLRWcrYmlJTFlnbFlxLzJTekRlOTFGWHBiZmpHRFprL0s1?=
 =?utf-8?B?VDlqT3F3bnNsbi9aVis5OTNpdVRTZVhjd3A4Z3V2ckNKRXM3MmtwSFVNK1Rt?=
 =?utf-8?B?NUNVOGpJKzJWbHlIN1FKalp4NUhPWnc5Tjd5K0FhTGRRUmczS1ZLVG9FUk1J?=
 =?utf-8?B?OGMzeG9OdXNVbXA5NVcybEUzVC91WWZldXlDMjUzbmFPOHdxVTN4RTQ4VlBh?=
 =?utf-8?B?MVoyb0hOQ1BNd2ZZVVIxb0NaZXdyb0N2Y21udXFXWTlsUnpucU52VGhWeU1H?=
 =?utf-8?Q?jLy4jGmu2wu3Dgl8E21vUKxlD?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 120a2221-9848-4c04-f995-08db8db6f1c7
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 09:01:48.4683
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 1tPt6y3e5e6LcM0nuO4wtw2ZmF3xOCIRH1PcWxsn5ld9w0+W8BV8/Xdoh+5qH0QTUSNvMmZoHVJFeuIFRVyAwA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8525

On 26.07.2023 09:22, Federico Serafini wrote:
> Make function declaration and definition consistent using the same
> parameter name ('mcs' do denote a pointer to an 'mc_state').
> This addresses a violation of MISRA C:2012 Rule 8.3: "All declarations of an
> object or function shall use the same names and type qualifiers".
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> ---
>  xen/arch/arm/traps.c        | 4 ++--
>  xen/include/xen/multicall.h | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)

What about x86'es function?

Jan



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 09:02:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 09:02:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570210.891790 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOaQ7-0004OB-BF; Wed, 26 Jul 2023 09:02:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570210.891790; Wed, 26 Jul 2023 09:02:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOaQ7-0004O4-8S; Wed, 26 Jul 2023 09:02:59 +0000
Received: by outflank-mailman (input) for mailman id 570210;
 Wed, 26 Jul 2023 09:02:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOaQ5-0004Ns-8s
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 09:02:57 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20606.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::606])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 35d05405-2b93-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 11:02:56 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8444.eurprd04.prod.outlook.com (2603:10a6:102:1db::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Wed, 26 Jul
 2023 09:02:53 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 09:02:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 35d05405-2b93-11ee-b242-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=bexB1pbBE3rJPmhOoXoH+sL4taVqVrsZ+NKGPXWrPf1k1ZxUh90qhWHHLlFiAg6f2QEz5AWCqTrYvAOk+Fs9aFpIANjvcCa+w4tNEoYEiKPUhM4uqmz7zfL9qFfuuk5zthr/7fejkvl+96y6pozq2k04SA31QSGyxZqBmSbhaguQqdCSAMaa4wCbs/7jfBHtZs0aMySa8bO2cPVp4MwWzhD9JAV4j8J8RCO/srZyr3bUwKiD6J/WiV94TNzyI3Gz+J7SRwwzFO7lx7xPSAC6IhpdknOyPBqZp3NWHroxIVt80DtVxoIpJc3ONJVNcjwaBosqXzByMDzv9r6V974Pcw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=lEgJCvBymPbM8CXAwgiZMX6SziJJAZib21PsajGtb6Y=;
 b=gdD4kJoqnUSoT5MYca9paLYIH+DvuD2cWZwvLtT58eqDQVG69PYZL8fekQ7WSzBYPwSCwqhnwYrS9ISohIUrgO2RLsfOOzUeYYMgpeBonvs2YNCEWw10ndBv2NvE+Xdn94fBXRQP1XV70UU8epZQk03IKVyOD1JBoWvZ2eYsZGxhigDFaBbzhPI3ApE1psDiwCPwBxD5RBAUVqnQT0NTImA8EkRcfBgmhpK1s7heEoEwin4h7zywP+Vz+/tg16eXI/hF1h0z93Csx8I5Fk6ni4dNharqNtmst0QXh4e9kJLZ0doISmQLO1Bex4AA1OoWmlka2F5GooO9pnLT4ANPgQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=lEgJCvBymPbM8CXAwgiZMX6SziJJAZib21PsajGtb6Y=;
 b=tdAuzPmGzFXTKHjIrbOjUtzn5TM6mDnZrFVqcyxTt3iFc5Tm/E0nJeUyl+N8/WAz80L8RPe3c6JU4nDmyRpntomW6V0BpBZzcQstVOvtZJVhsoq3CuYxo/DZgbIzGZsiFEmbYugRZiLaPe8oCEEmUIcT/KevGycMotVuYYJW1PjOSC6JhnQpgvDSaHXdQpXSv0XtrudFjjJi2WpMbBJ18CrzY4mbZl4+Y/NncnSYbnkASj/lC4MziSIHcObrvE/KiuNDiva1LsTKP3LMPtaegcJ8ija8cfLcNx8RpkRo9l/nszfka7DvBUTmDAsBPHdbOfMkcK+79KmAkCoNE9GF1A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <664d53b1-1616-3acc-4b08-7ac482e443ab@suse.com>
Date: Wed, 26 Jul 2023 11:02:51 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] xen/event: address violations of MISRA C:2012 Rules
 8.2 and 8.3
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <367ab3b09deaab82dfea0e833eeceaf8de49f5c1.1690359344.git.federico.serafini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <367ab3b09deaab82dfea0e833eeceaf8de49f5c1.1690359344.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0117.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9d::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8444:EE_
X-MS-Office365-Filtering-Correlation-Id: 6e30e9c2-e1a0-4dba-ec7c-08db8db7188d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	4wOBN+7DqNPxfr4cNtZSO14VrMnenZ9amZZWBN1NNZ26QZ4U8W/sYeAqQdR6ai1Tz/q6OXg2LmkPY20uFyRBX1y+yLqKmBMQyzJLMG4PphFNDVUiqmn77JTx6gP0uKcF3GtsXAPiW0EUsZx0Pl4WsJSanM2GKZmQdKqLRs5KmHaKsE2GwjAYLW55vbJ7/j0kN21qB4cxUfF65dZPwJ591sOZQhedEU3vAmWbtvntSnNBN+vGSmuMEnPmORcmWLf3qHK9hQH0M1uq2dvs+we1agyHheiImUbARchLv0wUWXDLd6lJ2tdDVu51pRfeuRxbmAMpS/bixbEWezHc6xOrrkYabK74PhD8//PuFbjlU/cC7TAOnPpnUBGbDooBvOTVT+CMfI/1gjCZcfGFhdVKSfFxBc3qYSrrN8dDthqMGl4M2GV9m6w6qgFXPpQYrAMQaBNmE5IUEnW+81Y1GxaMtokMTSQEWcYs87yq0Uys7T0Bq9529/UPFD0i/k6zt3SfhPj657jluUSGmHu5XVtKwgEyTDA08aLpM4ztUNkRikdvCruWtWQCzKrz5rHM23tW1yUeuaZxjrwkywXUMangwXdNWR4qulDAMwud2QXWsJCrSFLrjJnEXZGy1plvqLe1cGI5qtEMHECYCdHSVivpKQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(346002)(39860400002)(376002)(136003)(451199021)(186003)(2616005)(6506007)(26005)(53546011)(54906003)(478600001)(86362001)(31696002)(36756003)(6486002)(66556008)(41300700001)(316002)(66476007)(66946007)(6916009)(38100700002)(8936002)(2906002)(8676002)(4744005)(4326008)(5660300002)(6512007)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?T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=
 =?utf-8?B?b1Bua01xV0hNU1hSUFJkbi9kWmsvOGNVSVpQZXFnbVlyYk9VSDZiSnR5L1cy?=
 =?utf-8?B?VW9IVjdac2JyTmU3S3dReUNUTS9TMWVWVzU4SWppc29NV3Q0SFZhZXVzN0xp?=
 =?utf-8?B?dTlzYllaVWJZMW1FZnlBRWxLUnlNV285RWZCaERkbDBab1BzVXFZYWtLWmdX?=
 =?utf-8?B?ZWY4ZnRqNytJZk1sbTQ5em9xRVJ1TVFOOEQyeEM3dytQcTNQZEEvS2ZZV1dC?=
 =?utf-8?B?ajVZN3QwYUE3Tm0yWWx6NEJKbUc3WTg4R3dUcStmQ2N6Y0oyQitqSGVKL2Jt?=
 =?utf-8?B?bHZjSS9LTldvNC9tdUw3VS9pYzRncTRISUtZNUdyaGFvZkRtK1FpOTdKYlRp?=
 =?utf-8?Q?Su3EJVXgH8FkShIM4HtKnqZEU?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6e30e9c2-e1a0-4dba-ec7c-08db8db7188d
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 09:02:53.4714
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: SV6GjmH4eswd9nN+w+tUpSiWHXwwe3bt1c0/ZMUaH/sDzKVlvxrJC882NOBb+pnxoZN8Y+h/rAWhuMg5hH60VQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8444

On 26.07.2023 10:27, Federico Serafini wrote:
> Give a name to unnamed parameters thus addressing violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names and types used in function
> declarations and the ones used in the corresponding function
> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
> ("All declarations of an object or function shall use the same names
> and type qualifiers").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 09:14:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 09:14:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570212.891799 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOabG-0005y4-At; Wed, 26 Jul 2023 09:14:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570212.891799; Wed, 26 Jul 2023 09:14:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOabG-0005xx-8A; Wed, 26 Jul 2023 09:14:30 +0000
Received: by outflank-mailman (input) for mailman id 570212;
 Wed, 26 Jul 2023 09:14:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7qZ+=DM=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOabE-0005xr-V4
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 09:14:29 +0000
Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com
 [2607:f8b0:4864:20::431])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d0cf75b4-2b94-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 11:14:26 +0200 (CEST)
Received: by mail-pf1-x431.google.com with SMTP id
 d2e1a72fcca58-6862d4a1376so1658106b3a.0
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 02:14:26 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 f13-20020aa78b0d000000b006815fbe3245sm10999998pfd.37.2023.07.26.02.14.11
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 26 Jul 2023 02:14:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d0cf75b4-2b94-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690362865; x=1690967665;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=/CEWWslQ6JRIcxWLpzXErjeuLKPqXLpeeNrG0RittG0=;
        b=I3KXDVsNZkZkuHySHT+7GWxUFOEURGUG8DKW/uSkEUX9NAh5BxZruCb6I7dMvZVAZp
         gsbdGCxz8Ek9MEWYKBET899voNBoDRWjZhWTGqOkdiqJvYMIu89z6Y9ah3jNNgYJvmXe
         Ynyibhx5k2BqOJ8kTOB1j8+dHCtoSqjccCQyKrRToAfOvHIxUPGvJI4XwsvGDIJs06k4
         8UkoomoCP1d/we1vQJY/HKL4Ldc1XzpJ76adbBgaJNhbNz340Yq4eG/RdHVXX03WkC40
         lRLRDZ4CrOQxHgzNE8n8ymMoEoXG0N/DL2iV7w9wV2y2yTzS9rwi2nR608KOVDSDoCfD
         iYbg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690362865; x=1690967665;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=/CEWWslQ6JRIcxWLpzXErjeuLKPqXLpeeNrG0RittG0=;
        b=UlVsECREUCwuB5Q7rdXIuBWIXAWH5PGnLtmldVmOZtkAxwssD1eqrCI84ll9TfuZGY
         /fCKjc3cPBCB04MDJk/FMaXw2aoSCIxLpKnzos6erHYqwEd/+Hw8G4tESdXVjnK9Vvyy
         Rsg2honSls1MqoEWzszH0DoxgrWoiDnTo027enI8xOuAhs3KUtME6maCHWbv5XQzRIt/
         7vxGtgB/4McKVyaxROhYsV5G0YnQI2JUVWNMoRrXqpjNS6oaOcP0dpjIAJlztoIZlqHo
         i3DGMO5YTi2cM7P6KlY75veSXQuP0dleGRkj2agcBwkdoNQLgY/dJ/FIYHObkdFSTXhi
         Oiig==
X-Gm-Message-State: ABy/qLbBbTxNUjQQPgdVF62eGYeyLxzTmzWzfDgIfJFJNZcqHszUMuSY
	3wRNxq1qi7HfUyczP5odXhLTug==
X-Google-Smtp-Source: APBJJlGoXxnnO1iRfxB9PGRuwMGmdgeETCuWP6k42EmfJJj8AnwarjYqC2btd9IS9Qo2Ingl4K7QKw==
X-Received: by 2002:aa7:8615:0:b0:681:9fe0:b543 with SMTP id p21-20020aa78615000000b006819fe0b543mr1640368pfn.2.1690362864530;
        Wed, 26 Jul 2023 02:14:24 -0700 (PDT)
Message-ID: <19ad6d06-8a14-6102-5eae-2134dc2c5061@bytedance.com>
Date: Wed, 26 Jul 2023 17:14:09 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 44/47] mm: shrinker: make global slab shrink lockless
Content-Language: en-US
To: Dave Chinner <david@fromorbit.com>
Cc: akpm@linux-foundation.org, tkhai@ya.ru, vbabka@suse.cz,
 roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org,
 paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com, cel@kernel.org,
 senozhatsky@chromium.org, yujie.liu@intel.com, gregkh@linuxfoundation.org,
 muchun.song@linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org,
 x86@kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-45-zhengqi.arch@bytedance.com>
 <ZMDUkoIXUlTkCSYL@dread.disaster.area>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <ZMDUkoIXUlTkCSYL@dread.disaster.area>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Dave,

On 2023/7/26 16:08, Dave Chinner wrote:
> On Mon, Jul 24, 2023 at 05:43:51PM +0800, Qi Zheng wrote:
>> The shrinker_rwsem is a global read-write lock in shrinkers subsystem,
>> which protects most operations such as slab shrink, registration and
>> unregistration of shrinkers, etc. This can easily cause problems in the
>> following cases.
>>
>> 1) When the memory pressure is high and there are many filesystems
>>     mounted or unmounted at the same time, slab shrink will be affected
>>     (down_read_trylock() failed).
>>
>>     Such as the real workload mentioned by Kirill Tkhai:
>>
>>     ```
>>     One of the real workloads from my experience is start
>>     of an overcommitted node containing many starting
>>     containers after node crash (or many resuming containers
>>     after reboot for kernel update). In these cases memory
>>     pressure is huge, and the node goes round in long reclaim.
>>     ```
>>
>> 2) If a shrinker is blocked (such as the case mentioned
>>     in [1]) and a writer comes in (such as mount a fs),
>>     then this writer will be blocked and cause all
>>     subsequent shrinker-related operations to be blocked.
>>
>> Even if there is no competitor when shrinking slab, there may still be a
>> problem. The down_read_trylock() may become a perf hotspot with frequent
>> calls to shrink_slab(). Because of the poor multicore scalability of
>> atomic operations, this can lead to a significant drop in IPC
>> (instructions per cycle).
>>
>> We used to implement the lockless slab shrink with SRCU [2], but then
>> kernel test robot reported -88.8% regression in
>> stress-ng.ramfs.ops_per_sec test case [3], so we reverted it [4].
>>
>> This commit uses the refcount+RCU method [5] proposed by Dave Chinner
>> to re-implement the lockless global slab shrink. The memcg slab shrink is
>> handled in the subsequent patch.
>>
>> For now, all shrinker instances are converted to dynamically allocated and
>> will be freed by kfree_rcu(). So we can use rcu_read_{lock,unlock}() to
>> ensure that the shrinker instance is valid.
>>
>> And the shrinker instance will not be run again after unregistration. So
>> the structure that records the pointer of shrinker instance can be safely
>> freed without waiting for the RCU read-side critical section.
>>
>> In this way, while we implement the lockless slab shrink, we don't need to
>> be blocked in unregister_shrinker().
>>
>> The following are the test results:
>>
>> stress-ng --timeout 60 --times --verify --metrics-brief --ramfs 9 &
>>
>> 1) Before applying this patchset:
>>
>> setting to a 60 second run per stressor
>> dispatching hogs: 9 ramfs
>> stressor       bogo ops real time  usr time  sys time   bogo ops/s     bogo ops/s
>>                            (secs)    (secs)    (secs)   (real time) (usr+sys time)
>> ramfs            735238     60.00     12.37    363.70     12253.05        1955.08
>> for a 60.01s run time:
>>     1440.27s available CPU time
>>       12.36s user time   (  0.86%)
>>      363.70s system time ( 25.25%)
>>      376.06s total time  ( 26.11%)
>> load average: 10.79 4.47 1.69
>> passed: 9: ramfs (9)
>> failed: 0
>> skipped: 0
>> successful run completed in 60.01s (1 min, 0.01 secs)
>>
>> 2) After applying this patchset:
>>
>> setting to a 60 second run per stressor
>> dispatching hogs: 9 ramfs
>> stressor       bogo ops real time  usr time  sys time   bogo ops/s     bogo ops/s
>>                            (secs)    (secs)    (secs)   (real time) (usr+sys time)
>> ramfs            746677     60.00     12.22    367.75     12443.70        1965.13
>> for a 60.01s run time:
>>     1440.26s available CPU time
>>       12.21s user time   (  0.85%)
>>      367.75s system time ( 25.53%)
>>      379.96s total time  ( 26.38%)
>> load average: 8.37 2.48 0.86
>> passed: 9: ramfs (9)
>> failed: 0
>> skipped: 0
>> successful run completed in 60.01s (1 min, 0.01 secs)
>>
>> We can see that the ops/s has hardly changed.
>>
>> [1]. https://lore.kernel.org/lkml/20191129214541.3110-1-ptikhomirov@virtuozzo.com/
>> [2]. https://lore.kernel.org/lkml/20230313112819.38938-1-zhengqi.arch@bytedance.com/
>> [3]. https://lore.kernel.org/lkml/202305230837.db2c233f-yujie.liu@intel.com/
>> [4]. https://lore.kernel.org/all/20230609081518.3039120-1-qi.zheng@linux.dev/
>> [5]. https://lore.kernel.org/lkml/ZIJhou1d55d4H1s0@dread.disaster.area/
>>
>> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
>> ---
>>   include/linux/shrinker.h | 19 +++++++---
>>   mm/shrinker.c            | 75 ++++++++++++++++++++++++++--------------
>>   mm/shrinker_debug.c      | 52 +++++++++++++++++++++-------
>>   3 files changed, 104 insertions(+), 42 deletions(-)
>>
>> diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
>> index 36977a70bebb..335da93cccee 100644
>> --- a/include/linux/shrinker.h
>> +++ b/include/linux/shrinker.h
>> @@ -4,6 +4,7 @@
>>   
>>   #include <linux/atomic.h>
>>   #include <linux/types.h>
>> +#include <linux/refcount.h>
>>   
>>   #define SHRINKER_UNIT_BITS	BITS_PER_LONG
>>   
>> @@ -86,6 +87,10 @@ struct shrinker {
>>   	long batch;	/* reclaim batch size, 0 = default */
>>   	int seeks;	/* seeks to recreate an obj */
>>   	unsigned flags;
>> +	bool registered;
>> +
>> +	refcount_t refcount;
>> +	struct rcu_head rcu;
>>   
>>   	void *private_data;
>>   
>> @@ -106,14 +111,13 @@ struct shrinker {
>>   #define DEFAULT_SEEKS 2 /* A good number if you don't know better. */
>>   
>>   /* Flags */
>> -#define SHRINKER_REGISTERED	(1 << 0)
>> -#define SHRINKER_NUMA_AWARE	(1 << 1)
>> -#define SHRINKER_MEMCG_AWARE	(1 << 2)
>> +#define SHRINKER_NUMA_AWARE	(1 << 0)
>> +#define SHRINKER_MEMCG_AWARE	(1 << 1)
>>   /*
>>    * It just makes sense when the shrinker is also MEMCG_AWARE for now,
>>    * non-MEMCG_AWARE shrinker should not have this flag set.
>>    */
>> -#define SHRINKER_NONSLAB	(1 << 3)
>> +#define SHRINKER_NONSLAB	(1 << 2)
>>   
>>   unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
>>   			  int priority);
>> @@ -122,6 +126,13 @@ void shrinker_free_non_registered(struct shrinker *shrinker);
>>   void shrinker_register(struct shrinker *shrinker);
>>   void shrinker_unregister(struct shrinker *shrinker);
>>   
>> +static inline bool shrinker_try_get(struct shrinker *shrinker)
>> +{
>> +	return READ_ONCE(shrinker->registered) &&
>> +	       refcount_inc_not_zero(&shrinker->refcount);
>> +}
> 
> Why do we care about shrinker->registered here? If we don't set
> the refcount to 1 until we have fully initialised everything, then
> the shrinker code can key entirely off the reference count and
> none of the lookup code needs to care about whether the shrinker is
> registered or not.

The purpose of checking shrinker->registered here is to stop running
shrinker after calling shrinker_free(), which can prevent the following
situations from happening:

CPU 0                 CPU 1

shrinker_try_get()

                        shrinker_try_get()

shrinker_put()
shrinker_try_get()
                        shrinker_put()

This chance of this happening is small, but theoretically possible, so
I added this check.

> 
>> +void shrinker_put(struct shrinker *shrinker);
>> +
>>   #ifdef CONFIG_SHRINKER_DEBUG
>>   extern int shrinker_debugfs_add(struct shrinker *shrinker);
>>   extern struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
>> diff --git a/mm/shrinker.c b/mm/shrinker.c
>> index 8a1fe844f1a4..8e3334749552 100644
>> --- a/mm/shrinker.c
>> +++ b/mm/shrinker.c
>> @@ -2,10 +2,13 @@
>>   #include <linux/memcontrol.h>
>>   #include <linux/rwsem.h>
>>   #include <linux/shrinker.h>
>> +#include <linux/rculist.h>
>> +#include <linux/spinlock.h>
>>   #include <trace/events/vmscan.h>
>>   
>>   LIST_HEAD(shrinker_list);
>>   DECLARE_RWSEM(shrinker_rwsem);
>> +DEFINE_SPINLOCK(shrinker_lock);
>>   
>>   #ifdef CONFIG_MEMCG
>>   static int shrinker_nr_max;
>> @@ -450,6 +453,18 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
>>   	return freed;
>>   }
>>   
>> +void shrinker_put(struct shrinker *shrinker)
>> +{
>> +	if (refcount_dec_and_test(&shrinker->refcount)) {
>> +		spin_lock(&shrinker_lock);
>> +		list_del_rcu(&shrinker->list);
>> +		spin_unlock(&shrinker_lock);
>> +
>> +		kfree(shrinker->nr_deferred);
>> +		kfree_rcu(shrinker, rcu);
>> +	}
>> +}
> 
> Urk, no.
> 
> We want the shrinker_free() code to block waiting for the shrinker
> reference count to go to zero, because the shrinkers can reference
> structures that are associated with the path that is freeing the
> shrinker.
> 
> i.e. we do not want to free the superblock of a filesystem whilst
> the shrinker is still running, but the way you've done this is that
> the shrinker can run whilst the structure that contains it has been
> torn down.

Oh, I missed this. I will change it back to use completion as soon as
possible.

> 
> This should use a completion, then it is always safe under
> rcu_read_lock().  This also gets rid of the shrinker_lock spin lock,
> which only exists because we can't take a blocking lock under
> rcu_read_lock(). i.e:
> 
> 
> void shrinker_put(struct shrinker *shrinker)
> {
> 	if (refcount_dec_and_test(&shrinker->refcount))
> 		complete(&shrinker->done);
> }
> 
> void shrinker_free()
> {
> 	.....
> 	refcount_dec(&shrinker->refcount);

I guess what you mean is shrinker_put(), because here may be the last
refcount.

> 	wait_for_completion(&shrinker->done);
> 	/*
> 	 * lookups on the shrinker will now all fail as refcount has
> 	 * fallen to zero. We can now remove it from the lists and
> 	 * free it.
> 	 */
> 	down_write(shrinker_rwsem);
> 	list_del_rcu(&shrinker->list);
> 	up_write(&shrinker_rwsem);
> 	call_rcu(shrinker->rcu_head, shrinker_free_rcu_cb);
> }
> 
> ....
> 
>> @@ -686,11 +711,14 @@ EXPORT_SYMBOL(shrinker_free_non_registered);
>>   
>>   void shrinker_register(struct shrinker *shrinker)
>>   {
>> -	down_write(&shrinker_rwsem);
>> -	list_add_tail(&shrinker->list, &shrinker_list);
>> -	shrinker->flags |= SHRINKER_REGISTERED;
>> +	refcount_set(&shrinker->refcount, 1);
>> +
>> +	spin_lock(&shrinker_lock);
>> +	list_add_tail_rcu(&shrinker->list, &shrinker_list);
>> +	spin_unlock(&shrinker_lock);
>> +
>>   	shrinker_debugfs_add(shrinker);
>> -	up_write(&shrinker_rwsem);
>> +	WRITE_ONCE(shrinker->registered, true);
>>   }
>>   EXPORT_SYMBOL(shrinker_register);
> 
> This just looks wrong - you are trying to use WRITE_ONCE() as a
> release barrier to indicate that the shrinker is now set up fully.
> That's not necessary - the refcount is an atomic and along with the
> rcu locks they should provides all the barriers we need. i.e.

The reason I used WRITE_ONCE() here is because the shrinker->registered
will be read and written concurrently (read in shrinker_try_get() and
written in shrinker_free()), which is why I added shrinker::registered
field instead of using SHRINKER_REGISTERED flag (this can reduce the
addition of WRITE_ONCE()/READ_ONCE()).

> 
> void shrinker_register(struct shrinker *shrinker)
> {
> 	down_write(&shrinker_rwsem);
> 	list_add_tail_rcu(&shrinker->list, &shrinker_list);
> 	shrinker->flags |= SHRINKER_REGISTERED;
> 	shrinker_debugfs_add(shrinker);
> 	up_write(&shrinker_rwsem);
> 
> 	/*
> 	 * now the shrinker is fully set up, take the first
> 	 * reference to it to indicate that lookup operations are
> 	 * now allowed to use it via shrinker_try_get().
> 	 */
> 	refcount_set(&shrinker->refcount, 1);
> }
> 
>> diff --git a/mm/shrinker_debug.c b/mm/shrinker_debug.c
>> index f1becfd45853..c5573066adbf 100644
>> --- a/mm/shrinker_debug.c
>> +++ b/mm/shrinker_debug.c
>> @@ -5,6 +5,7 @@
>>   #include <linux/seq_file.h>
>>   #include <linux/shrinker.h>
>>   #include <linux/memcontrol.h>
>> +#include <linux/rculist.h>
>>   
>>   /* defined in vmscan.c */
>>   extern struct rw_semaphore shrinker_rwsem;
>> @@ -161,17 +162,21 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
>>   {
>>   	struct dentry *entry;
>>   	char buf[128];
>> -	int id;
>> -
>> -	lockdep_assert_held(&shrinker_rwsem);
>> +	int id, ret = 0;
>>   
>>   	/* debugfs isn't initialized yet, add debugfs entries later. */
>>   	if (!shrinker_debugfs_root)
>>   		return 0;
>>   
>> +	down_write(&shrinker_rwsem);
>> +	if (shrinker->debugfs_entry)
>> +		goto fail;
>> +
>>   	id = ida_alloc(&shrinker_debugfs_ida, GFP_KERNEL);
>> -	if (id < 0)
>> -		return id;
>> +	if (id < 0) {
>> +		ret = id;
>> +		goto fail;
>> +	}
>>   	shrinker->debugfs_id = id;
>>   
>>   	snprintf(buf, sizeof(buf), "%s-%d", shrinker->name, id);
>> @@ -180,7 +185,8 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
>>   	entry = debugfs_create_dir(buf, shrinker_debugfs_root);
>>   	if (IS_ERR(entry)) {
>>   		ida_free(&shrinker_debugfs_ida, id);
>> -		return PTR_ERR(entry);
>> +		ret = PTR_ERR(entry);
>> +		goto fail;
>>   	}
>>   	shrinker->debugfs_entry = entry;
>>   
>> @@ -188,7 +194,10 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
>>   			    &shrinker_debugfs_count_fops);
>>   	debugfs_create_file("scan", 0220, entry, shrinker,
>>   			    &shrinker_debugfs_scan_fops);
>> -	return 0;
>> +
>> +fail:
>> +	up_write(&shrinker_rwsem);
>> +	return ret;
>>   }
>>   
>>   int shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...)
>> @@ -243,6 +252,11 @@ struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
>>   	shrinker->name = NULL;
>>   
>>   	*debugfs_id = entry ? shrinker->debugfs_id : -1;
>> +	/*
>> +	 * Ensure that shrinker->registered has been set to false before
>> +	 * shrinker->debugfs_entry is set to NULL.
>> +	 */
>> +	smp_wmb();
>>   	shrinker->debugfs_entry = NULL;
>>   
>>   	return entry;
>> @@ -266,14 +280,26 @@ static int __init shrinker_debugfs_init(void)
>>   	shrinker_debugfs_root = dentry;
>>   
>>   	/* Create debugfs entries for shrinkers registered at boot */
>> -	down_write(&shrinker_rwsem);
>> -	list_for_each_entry(shrinker, &shrinker_list, list)
>> +	rcu_read_lock();
>> +	list_for_each_entry_rcu(shrinker, &shrinker_list, list) {
>> +		if (!shrinker_try_get(shrinker))
>> +			continue;
>> +		rcu_read_unlock();
>> +
>>   		if (!shrinker->debugfs_entry) {
>> -			ret = shrinker_debugfs_add(shrinker);
>> -			if (ret)
>> -				break;
>> +			/* Paired with smp_wmb() in shrinker_debugfs_detach() */
>> +			smp_rmb();
>> +			if (READ_ONCE(shrinker->registered))
>> +				ret = shrinker_debugfs_add(shrinker);
>>   		}
>> -	up_write(&shrinker_rwsem);
>> +
>> +		rcu_read_lock();
>> +		shrinker_put(shrinker);
>> +
>> +		if (ret)
>> +			break;
>> +	}
>> +	rcu_read_unlock();
>>   
>>   	return ret;
>>   }
> 
> And all this churn and complexity can go away because the
> shrinker_rwsem is still used to protect shrinker_register()
> entirely....

My consideration is that during this process, there may be a
driver probe failure and then shrinker_free() is called (the
shrinker_debugfs_init() is called in late_initcall stage). In
this case, we need to use RCU+refcount to ensure that the shrinker
is not freed.

And after switching back to using completion, the smp_rmb()/smp_wmb()
is no longer needed.

Thanks,
Qi

> 
> -Dave.


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 09:21:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 09:21:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570220.891810 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOahh-0007Wo-3g; Wed, 26 Jul 2023 09:21:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570220.891810; Wed, 26 Jul 2023 09:21:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOahh-0007Wh-0w; Wed, 26 Jul 2023 09:21:09 +0000
Received: by outflank-mailman (input) for mailman id 570220;
 Wed, 26 Jul 2023 09:21:07 +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
 <SRS0=7qZ+=DM=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOahf-0007Wb-Rn
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 09:21:07 +0000
Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com
 [2607:f8b0:4864:20::d30])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id beebeadc-2b95-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 11:21:05 +0200 (CEST)
Received: by mail-io1-xd30.google.com with SMTP id
 ca18e2360f4ac-77dcff76e35so80533739f.1
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 02:21:05 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j1-20020a63b601000000b005638a70110bsm9005279pgf.65.2023.07.26.02.20.52
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 26 Jul 2023 02:21:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: beebeadc-2b95-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690363264; x=1690968064;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=7Vnbbe8QuBX5IRYOyrvoqHk8WWyxAnIOQvNq7rt3Y5Y=;
        b=kMv6YWq3e1+EWrbASVGI+G088ii73Fem/3I6VWvBzdurPzbdbS5fA2RHQQMLz4AOt4
         QngIWAV+s2uZUHK0vckMw0bfgtFV0R5eMbZlIk8/4w/wEVCJ5y5HwXF0DUiZjpzQho8t
         GXjQcaARWKdDQm6TOuzP1j52qtjLaAhVczvWaaLuobF1qPY5atrskgUIXJQL3lYTey8z
         3gvyQ55zN42zfh91LApyOvBpv3V6BxPnFobMIvKLNhs41DtS3MI2Zhwie6ylRR2RxuF8
         50dWB5Tz79PFVi03oGgeTfo0ercw9F6h7q/ECB9SYkDgRGeW/OcVP5UyZnJ2fh3Kr582
         LeCg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690363264; x=1690968064;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=7Vnbbe8QuBX5IRYOyrvoqHk8WWyxAnIOQvNq7rt3Y5Y=;
        b=fPQ9KnqkOdzaDtOjm5QxHkwehmqxvfJ9ycjwue6F0B/UWzJLRCjX3XcLc3kRtS2hSu
         PRlp327tUAVzCtGs7diTunnbj8JGuu3HH9Up23+70KX7wm+VLP61VQOvmkcFqIi8ddgo
         i8oZKR90dDBq1RcpsYj+BJZsyzLMQYcy6ABN/WjelF6c+bUs6JwuKGpDPH+SIMF1vVh/
         ZveM4xmGNG8U6T8+hg4WFkRgfczzlMBxrQY8OgH1m8Do6Dvs1AhQIqBIsRi/xr0WRgZG
         8p7e2jMmu+wyNZjONTdjbCY2mAGtBG16bfJQRflucrqLy6irYuD4lI1ognwdBiquRvbz
         vZTQ==
X-Gm-Message-State: ABy/qLb5mnIOo2UGWQEPrhUJEq3oQivqZQ5VprQktf0zPHBqdbybANhR
	W6G8DnxqlkX97KM+SPwuhT2UYw==
X-Google-Smtp-Source: APBJJlFD+0JL20cmcfz8xSZcxHSPSuKA9am5rBHzXLXGZAWVolxxOeef+bBAtrNC9deWoQ1MX3gUWg==
X-Received: by 2002:a6b:3b44:0:b0:787:1926:54ed with SMTP id i65-20020a6b3b44000000b00787192654edmr1450699ioa.1.1690363264233;
        Wed, 26 Jul 2023 02:21:04 -0700 (PDT)
Message-ID: <0caf10e8-e54b-3c1b-7df5-d95adc757ba7@bytedance.com>
Date: Wed, 26 Jul 2023 17:20:49 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 03/47] mm: shrinker: add infrastructure for dynamically
 allocating shrinker
Content-Language: en-US
To: Dave Chinner <david@fromorbit.com>
Cc: akpm@linux-foundation.org, tkhai@ya.ru, vbabka@suse.cz,
 roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org,
 paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com, cel@kernel.org,
 senozhatsky@chromium.org, yujie.liu@intel.com, gregkh@linuxfoundation.org,
 muchun.song@linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org,
 x86@kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-4-zhengqi.arch@bytedance.com>
 <ZMDKjBCZH6+OP5gW@dread.disaster.area>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <ZMDKjBCZH6+OP5gW@dread.disaster.area>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Dave,

On 2023/7/26 15:26, Dave Chinner wrote:
> On Mon, Jul 24, 2023 at 05:43:10PM +0800, Qi Zheng wrote:
>> Currently, the shrinker instances can be divided into the following three
>> types:
>>
>> a) global shrinker instance statically defined in the kernel, such as
>>     workingset_shadow_shrinker.
>>
>> b) global shrinker instance statically defined in the kernel modules, such
>>     as mmu_shrinker in x86.
>>
>> c) shrinker instance embedded in other structures.
>>
>> For case a, the memory of shrinker instance is never freed. For case b,
>> the memory of shrinker instance will be freed after synchronize_rcu() when
>> the module is unloaded. For case c, the memory of shrinker instance will
>> be freed along with the structure it is embedded in.
>>
>> In preparation for implementing lockless slab shrink, we need to
>> dynamically allocate those shrinker instances in case c, then the memory
>> can be dynamically freed alone by calling kfree_rcu().
>>
>> So this commit adds the following new APIs for dynamically allocating
>> shrinker, and add a private_data field to struct shrinker to record and
>> get the original embedded structure.
>>
>> 1. shrinker_alloc()
>>
>> Used to allocate shrinker instance itself and related memory, it will
>> return a pointer to the shrinker instance on success and NULL on failure.
>>
>> 2. shrinker_free_non_registered()
>>
>> Used to destroy the non-registered shrinker instance.
> 
> This is a bit nasty
> 
>>
>> 3. shrinker_register()
>>
>> Used to register the shrinker instance, which is same as the current
>> register_shrinker_prepared().
>>
>> 4. shrinker_unregister()
> 
> rename this "shrinker_free()" and key the two different freeing
> cases on the SHRINKER_REGISTERED bit rather than mostly duplicating
> the two.

OK, will do in the next version.

> 
> void shrinker_free(struct shrinker *shrinker)
> {
> 	struct dentry *debugfs_entry = NULL;
> 	int debugfs_id;
> 
> 	if (!shrinker)
> 		return;
> 
> 	down_write(&shrinker_rwsem);
> 	if (shrinker->flags & SHRINKER_REGISTERED) {
> 		list_del(&shrinker->list);
> 		debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);
> 	} else if (IS_ENABLED(CONFIG_SHRINKER_DEBUG)) {
> 		kfree_const(shrinker->name);
> 	}
> 
> 	if (shrinker->flags & SHRINKER_MEMCG_AWARE)
> 		unregister_memcg_shrinker(shrinker);
> 	up_write(&shrinker_rwsem);
> 
> 	if (debugfs_entry)
> 		shrinker_debugfs_remove(debugfs_entry, debugfs_id);
> 
> 	kfree(shrinker->nr_deferred);
> 	kfree(shrinker);
> }
> EXPORT_SYMBOL_GPL(shrinker_free);

Ah, I will change all new APIs to use EXPORT_SYMBOL_GPL().

Thanks,
Qi

> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 09:22:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 09:22:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570224.891820 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOaiq-00083h-BZ; Wed, 26 Jul 2023 09:22:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570224.891820; Wed, 26 Jul 2023 09:22:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOaiq-00083a-8j; Wed, 26 Jul 2023 09:22:20 +0000
Received: by outflank-mailman (input) for mailman id 570224;
 Wed, 26 Jul 2023 09:22:18 +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
 <SRS0=7qZ+=DM=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOaio-00083O-Os
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 09:22:18 +0000
Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com
 [2607:f8b0:4864:20::42c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e9393fdc-2b95-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 11:22:16 +0200 (CEST)
Received: by mail-pf1-x42c.google.com with SMTP id
 d2e1a72fcca58-66d6a9851f3so1487684b3a.0
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 02:22:16 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 k11-20020aa790cb000000b006827c26f147sm10955045pfk.138.2023.07.26.02.22.03
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 26 Jul 2023 02:22:14 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e9393fdc-2b95-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690363335; x=1690968135;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=xHFf+qIXuXcHU2hnpeM9isQldhnSqSauyHf1oBu4R8I=;
        b=jAMndxc3vAfZ9MlugwiN2m1td4+ENgo1ZcEkULNu4w0l2e+7SjL15Aj8xsnH/hg6mq
         Yuh7Pj+WIpy+9FKbmqcmIZPowwXwCsZ/HE/uYPa/USpf5RWRvsmKXdX1EOhGqDHtCRhA
         5Tx4ycmmPjyUjagwQ6weN00EPkG2yYEGVkFAeT+5NL38WWOxpIAWxDe7x+TtdzGSmFXw
         AaN6OIhFdWcuFQV9AajQEHTHNR/HQhAWIjBkgsz+1GmBQBDd2nNKfKbDgsLcpETIdF18
         CdbQtqtDxhcETBnzscklNfC8QDSVXvKpexDlKf4G6IIrjU6vkXpbe5y1T2yEBA/OqHN2
         vBww==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690363335; x=1690968135;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=xHFf+qIXuXcHU2hnpeM9isQldhnSqSauyHf1oBu4R8I=;
        b=kr93BDMSTmjuJd/Bi8eOEXyqaoAuWdKmyPBiKcgAmDlVCq6zsAWscW1nCU1V48M5CE
         gky7i8F2vdC27yUB2hrTltP9CdYsYD6vsghe8Ytfh6WseOP8jMfWODYFWz32nbXTG6hE
         9QIZeYGRj1y4fJmPHReJvdjW4XsS79WQa5URdcD3BTyl/gX2tFf+Vqe/eAknFMy+fyAV
         iJ4hP5goy1XztPubRIskQiQVJRhyHokB4enamO6JF6ZR4L/iZ5d/9JeOeAY4KnRppsSR
         mHumVwKBFWXP33tjjqcxCjtrhDCk+X/0ZiPJoP4cNYomuabtsHNQxIxoFAFYIJ8ddp+V
         nQYw==
X-Gm-Message-State: ABy/qLZk22cSl96U7UyTNjYEOEtE5jF7jOOYdqYm+o/Xd+pzLv5ZROow
	ad17psKN8ASj7d/xPMbzwNNgEA==
X-Google-Smtp-Source: APBJJlGzKLkoeooTK7rnc1fJ6mfD6dUCrzzNETRC7Ci4c1Yh8zXhisYlXfajH5gn3qqQbLizO8XVQA==
X-Received: by 2002:a05:6a20:729a:b0:100:b92b:e8be with SMTP id o26-20020a056a20729a00b00100b92be8bemr1779967pzk.2.1690363335131;
        Wed, 26 Jul 2023 02:22:15 -0700 (PDT)
Message-ID: <d96777ce-be8a-1665-dd00-1e696e5575a8@bytedance.com>
Date: Wed, 26 Jul 2023 17:22:02 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 11/47] gfs2: dynamically allocate the gfs2-qd shrinker
Content-Language: en-US
To: Muchun Song <muchun.song@linux.dev>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz,
 roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org,
 paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com, cel@kernel.org,
 senozhatsky@chromium.org, yujie.liu@intel.com, gregkh@linuxfoundation.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-12-zhengqi.arch@bytedance.com>
 <e7204276-9de5-17eb-90ae-e51657d73ef4@linux.dev>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <e7204276-9de5-17eb-90ae-e51657d73ef4@linux.dev>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 2023/7/26 14:49, Muchun Song wrote:
> 
> 
> On 2023/7/24 17:43, Qi Zheng wrote:
>> Use new APIs to dynamically allocate the gfs2-qd shrinker.
>>
>> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
>> ---
>> Â  fs/gfs2/main.cÂ  |Â  6 +++---
>> Â  fs/gfs2/quota.c | 26 ++++++++++++++++++++------
>> Â  fs/gfs2/quota.h |Â  3 ++-
>> Â  3 files changed, 25 insertions(+), 10 deletions(-)
>>
>> diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
>> index afcb32854f14..e47b1cc79f59 100644
>> --- a/fs/gfs2/main.c
>> +++ b/fs/gfs2/main.c
>> @@ -147,7 +147,7 @@ static int __init init_gfs2_fs(void)
>> Â Â Â Â Â  if (!gfs2_trans_cachep)
>> Â Â Â Â Â Â Â Â Â  goto fail_cachep8;
>> -Â Â Â  error = register_shrinker(&gfs2_qd_shrinker, "gfs2-qd");
>> +Â Â Â  error = gfs2_qd_shrinker_init();
>> Â Â Â Â Â  if (error)
>> Â Â Â Â Â Â Â Â Â  goto fail_shrinker;
>> @@ -196,7 +196,7 @@ static int __init init_gfs2_fs(void)
>> Â  fail_wq2:
>> Â Â Â Â Â  destroy_workqueue(gfs_recovery_wq);
>> Â  fail_wq1:
>> -Â Â Â  unregister_shrinker(&gfs2_qd_shrinker);
>> +Â Â Â  gfs2_qd_shrinker_exit();
>> Â  fail_shrinker:
>> Â Â Â Â Â  kmem_cache_destroy(gfs2_trans_cachep);
>> Â  fail_cachep8:
>> @@ -229,7 +229,7 @@ static int __init init_gfs2_fs(void)
>> Â  static void __exit exit_gfs2_fs(void)
>> Â  {
>> -Â Â Â  unregister_shrinker(&gfs2_qd_shrinker);
>> +Â Â Â  gfs2_qd_shrinker_exit();
>> Â Â Â Â Â  gfs2_glock_exit();
>> Â Â Â Â Â  gfs2_unregister_debugfs();
>> Â Â Â Â Â  unregister_filesystem(&gfs2_fs_type);
>> diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
>> index 704192b73605..bc9883cea847 100644
>> --- a/fs/gfs2/quota.c
>> +++ b/fs/gfs2/quota.c
>> @@ -186,13 +186,27 @@ static unsigned long gfs2_qd_shrink_count(struct 
>> shrinker *shrink,
>> Â Â Â Â Â  return vfs_pressure_ratio(list_lru_shrink_count(&gfs2_qd_lru, sc));
>> Â  }
>> -struct shrinker gfs2_qd_shrinker = {
>> -Â Â Â  .count_objects = gfs2_qd_shrink_count,
>> -Â Â Â  .scan_objects = gfs2_qd_shrink_scan,
>> -Â Â Â  .seeks = DEFAULT_SEEKS,
>> -Â Â Â  .flags = SHRINKER_NUMA_AWARE,
>> -};
>> +static struct shrinker *gfs2_qd_shrinker;
>> +
>> +int gfs2_qd_shrinker_init(void)
> 
> It's better to declare this as __init.

OK, Will do.

> 
>> +{
>> +Â Â Â  gfs2_qd_shrinker = shrinker_alloc(SHRINKER_NUMA_AWARE, "gfs2-qd");
>> +Â Â Â  if (!gfs2_qd_shrinker)
>> +Â Â Â Â Â Â Â  return -ENOMEM;
>> +
>> +Â Â Â  gfs2_qd_shrinker->count_objects = gfs2_qd_shrink_count;
>> +Â Â Â  gfs2_qd_shrinker->scan_objects = gfs2_qd_shrink_scan;
>> +Â Â Â  gfs2_qd_shrinker->seeks = DEFAULT_SEEKS;
>> +
>> +Â Â Â  shrinker_register(gfs2_qd_shrinker);
>> +Â Â Â  return 0;
>> +}
>> +
>> +void gfs2_qd_shrinker_exit(void)
>> +{
>> +Â Â Â  shrinker_unregister(gfs2_qd_shrinker);
>> +}
>> Â  static u64 qd2index(struct gfs2_quota_data *qd)
>> Â  {
>> diff --git a/fs/gfs2/quota.h b/fs/gfs2/quota.h
>> index 21ada332d555..f9cb863373f7 100644
>> --- a/fs/gfs2/quota.h
>> +++ b/fs/gfs2/quota.h
>> @@ -59,7 +59,8 @@ static inline int gfs2_quota_lock_check(struct 
>> gfs2_inode *ip,
>> Â  }
>> Â  extern const struct quotactl_ops gfs2_quotactl_ops;
>> -extern struct shrinker gfs2_qd_shrinker;
>> +int gfs2_qd_shrinker_init(void);
>> +void gfs2_qd_shrinker_exit(void);
>> Â  extern struct list_lru gfs2_qd_lru;
>> Â  extern void __init gfs2_quota_hash_init(void);
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 09:23:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 09:23:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570226.891830 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOajj-0000AT-Lc; Wed, 26 Jul 2023 09:23:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570226.891830; Wed, 26 Jul 2023 09:23:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOajj-0000AI-I9; Wed, 26 Jul 2023 09:23:15 +0000
Received: by outflank-mailman (input) for mailman id 570226;
 Wed, 26 Jul 2023 09:23:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=cNwf=DM=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1qOaji-0000A4-FN
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 09:23:14 +0000
Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com
 [2a00:1450:4864:20::336])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0b7a164f-2b96-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 11:23:13 +0200 (CEST)
Received: by mail-wm1-x336.google.com with SMTP id
 5b1f17b1804b1-3fbab0d0b88so5070715e9.0
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 02:23:13 -0700 (PDT)
Received: from [192.168.24.200] (54-240-197-226.amazon.com. [54.240.197.226])
 by smtp.gmail.com with ESMTPSA id
 f12-20020adfe90c000000b0031758e7ba6dsm11331347wrm.40.2023.07.26.02.23.11
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 26 Jul 2023 02:23:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0b7a164f-2b96-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690363393; x=1690968193;
        h=content-transfer-encoding:in-reply-to:organization:references:cc:to
         :content-language:subject:reply-to:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=fFQvuvTA0rApmyYbTz3tv5ZD3yKdHhVxq/4ZpYUd/aI=;
        b=AtnzzCtWg9h1M4tC8McICoStSn5jsjyoy+ew/xxN9mQBvEjNEHl4ER4tog0WNTSZzo
         lnglCuW3q0LPjKsD218sZEoandOW/q3lMtLwl+AsxR77MD1dRSn6X4XsvmWtrVsRzKqx
         HbfPYIBT6TxK3K/jd6jQgve3nBOLC+EBwnaFgWkBW/bEPc9WdxNixXHxIENuQ9+Y0kRV
         tkmfEhQsP1If3YM9jxQa5m8PT5p0Ub6KPO7nxZUQjDOXEjdxwxm8WTXDkSM5RaDye+/0
         2MZnNxRwkbUTt4TxF81R5wSwn6CjJ+KCgdvb+SNVvfYFZPMzLAg7XwyhXJ8AVnP28zIp
         IjCw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690363393; x=1690968193;
        h=content-transfer-encoding:in-reply-to:organization:references:cc:to
         :content-language:subject:reply-to:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=fFQvuvTA0rApmyYbTz3tv5ZD3yKdHhVxq/4ZpYUd/aI=;
        b=hdbZRRl+mtB28xIdLa3AjNLSxeF2eoOPfp9UdhJD9pEs91swJ9Hs1piqUQPKxfYzG8
         I9PftDYvQyrx2P8mgSjMM4o0Die71uVR+AdOp6IYem6+JQgz482d9xZN8lHn7XvcSzyO
         K1WTzstr5CpampBBOfP6gS6wkz/mR5jIgifHgKwERQn/Eq+7MBtu+RlIq8OU8oSmZ1kx
         EOguLivZ+gdjGLY8PtVT1GCut7zPiwKQt/Jnzyk4bLi87Rrd+rfytMdnsXPDARwH3H5d
         33gpLLYcLxuZcVfAfr58GUi/yzcKTV23heNwwbAw3DzFllAd+DfHPZKCwE3duMRjNKmq
         9MXw==
X-Gm-Message-State: ABy/qLZM2L0yjyU4vCUWoHqRFzdUL3O6Q9DZKy3nSSWtIoC6VGiOAR9b
	8F0AJFMRQv51M9dNWz4t44I=
X-Google-Smtp-Source: APBJJlEokAR5XBWIWrvKx0TqxfcWcSIIEbmM36Ox1s94Psz19r/IEQDX+DN0c5KH+aLxaizghWa1VQ==
X-Received: by 2002:a05:600c:3b88:b0:3fa:91d0:8ddb with SMTP id n8-20020a05600c3b8800b003fa91d08ddbmr4148536wms.14.1690363392741;
        Wed, 26 Jul 2023 02:23:12 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <2ce9338f-30a3-e240-6cf6-a0280294c14f@xen.org>
Date: Wed, 26 Jul 2023 10:23:11 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Reply-To: paul@xen.org
Subject: Re: [PATCH] hw/xen: Clarify (lack of) error handling in
 transaction_commit()
Content-Language: en-US
To: David Woodhouse <dwmw2@infradead.org>,
 Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
 Joao Martins <joao.m.martins@oracle.com>,
 Ankur Arora <ankur.a.arora@oracle.com>,
 Stefano Stabellini <sstabellini@kernel.org>, vikram.garhwal@amd.com,
 Anthony Perard <anthony.perard@citrix.com>, xen-devel@lists.xenproject.org,
 Juan Quintela <quintela@redhat.com>,
 "Dr . David Alan Gilbert" <dgilbert@redhat.com>
References: <20230307182707.2298618-1-dwmw2@infradead.org>
 <20230307182707.2298618-6-dwmw2@infradead.org>
 <CAFEAcA9gzJGMqsEY5TuNmb74RskgUTMW+XcqGV53n3SsKyVVXg@mail.gmail.com>
 <CAFEAcA9aFv5c4S=Pyf3dMU-v9FnNJqWTQ7ZbiDQLTjh8Qou71g@mail.gmail.com>
 <CAFEAcA--FqeioUdPb9sr5fEy3q0H0swcp+rbGxoNbhgMkYdC+A@mail.gmail.com>
 <20076888f6bdf06a65aafc5cf954260965d45b97.camel@infradead.org>
Organization: Xen Project
In-Reply-To: <20076888f6bdf06a65aafc5cf954260965d45b97.camel@infradead.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 20/06/2023 18:58, David Woodhouse wrote:
> From: David Woodhouse <dwmw@amazon.co.uk>
> 
> Coverity was unhappy (CID 1508359) because we didn't check the return of
> init_walk_op() in transaction_commit(), despite doing so at every other
> call site.
> 
> Strictly speaking, this is a false positive since it can never fail. It
> only fails for invalid user input (transaction ID or path), and both of
> those are hard-coded to known sane values in this invocation.
> 
> But Coverity doesn't know that, and neither does the casual reader of the
> code.
> 
> Returning an error here would be weird, since the transaction *is*
> committed by this point; all the walk_op is doing is firing watches on
> the newly-committed changed nodes. So make it a g_assert(!ret), since
> it really should never happen.
> 
> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
> ---
>   hw/i386/kvm/xenstore_impl.c | 12 +++++++++++-
>   1 file changed, 11 insertions(+), 1 deletion(-)
> 

Reviewed-by: Paul Durrant <paul@xen.org>



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 09:25:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 09:25:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570228.891840 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOalh-0000nl-0b; Wed, 26 Jul 2023 09:25:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570228.891840; Wed, 26 Jul 2023 09:25:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOalg-0000ne-UC; Wed, 26 Jul 2023 09:25:16 +0000
Received: by outflank-mailman (input) for mailman id 570228;
 Wed, 26 Jul 2023 09:25:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7qZ+=DM=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOalf-0000nU-8o
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 09:25:15 +0000
Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com
 [2607:f8b0:4864:20::429])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 52639c57-2b96-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 11:25:13 +0200 (CEST)
Received: by mail-pf1-x429.google.com with SMTP id
 d2e1a72fcca58-66d6a9851f3so1488064b3a.0
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 02:25:13 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 h2-20020aa786c2000000b00682a99b01basm2004283pfo.0.2023.07.26.02.25.00
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 26 Jul 2023 02:25:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 52639c57-2b96-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690363511; x=1690968311;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=ajWZi1kTG9ZsFll3P13XRfH/M90QTcK5ZSE2yNZ8xrc=;
        b=FbQ/cU5KkBidPkx8Y2uGYCzGutSB6xNfkWiQEKQsSST8W9zvQhHhApft87PlLY8dLU
         DGKfOcVpxkQTOOl80Aro56BnjlNO41fZWD7CmV5GDlB1LjEDjOf3Kop2mVKp+naFiQzY
         As6MgqOMDkFvMljdz6Un/7KTBl/NUqtiNwtAlVNm8YXgeUKehHDEJVTDK07iwDWpbMUs
         Auk85ACWfB5lfW+mTAMWhogzlI0RHaQpyoe7zLfXc22574NosN/xSHT+kEdNg0VX/lgH
         cTQssA2/OElC5yJBDMwL3y7p8+2qs+uUi9JaKT2yW1TXFErKU2nPA1SSCU5AFvvQq6bi
         em9Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690363511; x=1690968311;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=ajWZi1kTG9ZsFll3P13XRfH/M90QTcK5ZSE2yNZ8xrc=;
        b=BHEEJckP7eaB8D0QikCiQtP4eomjRjU0mJG3Al8GAPffEJEe4i98u2HVdnkAHjLsBU
         8M7t/9Yl8lLfVO/5EP6D8xOv6OMtkbjBuyUEygq0z6y+D3X/MPqen8BReCImfV9+76U5
         VMObDGLLBAxj8fNXTen6HVjDsnfAVA6gE37mH1ZOMw1O16mUCBKwAbi/w/iwQpwDXB7C
         x0Ix8Da4z+P1lGf97Va/MuZ85+c2WFppKcx5DTw/biiwElnbERzskGCXSrVolnfaOseb
         8Z4B8m47LyGZzOeMnYEMAMJ0mPN3OJ+/H+YAaNFpuZsqfiJceygVUlqIB+DVizEfsoTQ
         3iYA==
X-Gm-Message-State: ABy/qLbx0K+tdik/qO7PLxOGcccWfX3qxTmEedDlv2vc/xl9TXEe4kgO
	8D3U/Div5kLaLAbmKj+T6arS7Q==
X-Google-Smtp-Source: APBJJlH7Lt4w+KKgSvUzSkJhF0oF8+b3ljHzveqc3Noqsk7KflIEw6xDKQ/sXRTNdo5n0Hc+oIf56w==
X-Received: by 2002:a05:6a20:729a:b0:100:b92b:e8be with SMTP id o26-20020a056a20729a00b00100b92be8bemr1785615pzk.2.1690363511718;
        Wed, 26 Jul 2023 02:25:11 -0700 (PDT)
Message-ID: <491f5c8f-ccc6-dab8-71b3-caeedc8c4b39@bytedance.com>
Date: Wed, 26 Jul 2023 17:24:58 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 17/47] rcu: dynamically allocate the rcu-lazy shrinker
Content-Language: en-US
To: Muchun Song <muchun.song@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>, david@fromorbit.com,
 tkhai@ya.ru, Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>, djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>, "Paul E. McKenney"
 <paulmck@kernel.org>, tytso@mit.edu, steven.price@arm.com, cel@kernel.org,
 senozhatsky@chromium.org, yujie.liu@intel.com, gregkh@linuxfoundation.org,
 linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-18-zhengqi.arch@bytedance.com>
 <3A164818-56E1-4EB4-A927-1B2D23B81659@linux.dev>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <3A164818-56E1-4EB4-A927-1B2D23B81659@linux.dev>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 2023/7/26 15:04, Muchun Song wrote:
> 
> 
>> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
>>
>> Use new APIs to dynamically allocate the rcu-lazy shrinker.
>>
>> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
>> ---
>> kernel/rcu/tree_nocb.h | 19 +++++++++++--------
>> 1 file changed, 11 insertions(+), 8 deletions(-)
>>
>> diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h
>> index 43229d2b0c44..919f17561733 100644
>> --- a/kernel/rcu/tree_nocb.h
>> +++ b/kernel/rcu/tree_nocb.h
>> @@ -1397,12 +1397,7 @@ lazy_rcu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
>> return count ? count : SHRINK_STOP;
>> }
>>
>> -static struct shrinker lazy_rcu_shrinker = {
>> -	.count_objects = lazy_rcu_shrink_count,
>> -	.scan_objects = lazy_rcu_shrink_scan,
>> -	.batch = 0,
>> -	.seeks = DEFAULT_SEEKS,
>> -};
>> +static struct shrinker *lazy_rcu_shrinker;
> 
> Seems there is no users of this variable, maybe we could drop
> this.

Yeah, will change it to a local variable. And the patch #15 is
the same.

> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 09:28:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 09:28:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570230.891850 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOaoQ-0001Ol-EK; Wed, 26 Jul 2023 09:28:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570230.891850; Wed, 26 Jul 2023 09:28:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOaoQ-0001Oe-BO; Wed, 26 Jul 2023 09:28:06 +0000
Received: by outflank-mailman (input) for mailman id 570230;
 Wed, 26 Jul 2023 09:28:06 +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
 <SRS0=7qZ+=DM=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOaoP-0001OY-VH
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 09:28:05 +0000
Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com
 [2607:f8b0:4864:20::436])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b79bdbb7-2b96-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 11:28:03 +0200 (CEST)
Received: by mail-pf1-x436.google.com with SMTP id
 d2e1a72fcca58-6864c144897so1488717b3a.1
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 02:28:03 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 l73-20020a633e4c000000b00563da87a52dsm1901427pga.40.2023.07.26.02.27.49
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 26 Jul 2023 02:28:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b79bdbb7-2b96-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690363681; x=1690968481;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=3q/836hkNQMpcz/8YX2aFfQHacV0FqcsnRX2KDKmGK4=;
        b=VrX61tolI6lx5cf13TzjBUi7Jr7lyRI0PErux25Ugwzya6Gr7la8Z5mF2+cskv3TWz
         UBVd0Z5Poj3PRTux8odPv45l8gQzAXnTFOr3Tf8UDx7d9uUEKzN37AEVIKYy6agrhmgA
         YruSiWL83SB/lZ95d/ocS5Ez1ClN1w8sLcjpu26a2KNj8aWhEC89NaIXAD4IQeJcJzfH
         uYL7oLGt6F17I0XKTtTRSbeLX7ktBDSzYJstMwVG/599hz7kBf24kzbOMqBXrGbap2ZR
         iYE22Dihl4RYEd6b6MxzHd9sXrRhtrB75dhklT8m88pkRrstmkcW4eCpJX3cURQ8vJOi
         rydw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690363681; x=1690968481;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=3q/836hkNQMpcz/8YX2aFfQHacV0FqcsnRX2KDKmGK4=;
        b=KbbdKJvg0NPP8/jGOS7cX8LoIUXuc3X6n0bi8bwGErtf6RX0Nfbn5zStAcnS2Z7U5p
         vpWb1FaY+wc7fXI7JyKNtYjCASu5n/PSHo88nLsO0159dI3xgU65Fo0JW6ol/KJG+tw1
         leSco5I310QW3qr+kPbho5TBDJNeSNBGRASmNAVjCnn+YbFoCyHUPPjpsB/h37MdrTXk
         rN6cOcCTLCmDHp3wur5e15HHaA3ztYq6e0SbmBdKU0gGP8/GAxZNG5f1JPfxzZflBgns
         RFx2TENdwpwONg9HUQdaHYNVe2HM43CKSmr/0HrfRrpNHPaYQmnEF4s9RGAl+XcuxIP3
         4OxQ==
X-Gm-Message-State: ABy/qLaaTggfAebmpIQEtV2aJN2JaVJ2ojmauT9eY2NAO2yPGeTlkDXe
	WtgAU9PHChJ1uoH5w3vtWE6ZLA==
X-Google-Smtp-Source: APBJJlFbGXVT1jvZWB8OqMMjwV1wWa8tPHrXXzsgQ/SF73jQ8jhDFJz/C4eSTJgkpJW81UF91auuJQ==
X-Received: by 2002:a05:6a20:3c90:b0:134:d4d3:f0a5 with SMTP id b16-20020a056a203c9000b00134d4d3f0a5mr1941746pzj.2.1690363681365;
        Wed, 26 Jul 2023 02:28:01 -0700 (PDT)
Message-ID: <665ccd89-8434-fc45-4813-c6412ef80c10@bytedance.com>
Date: Wed, 26 Jul 2023 17:27:47 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 19/47] mm: thp: dynamically allocate the thp-related
 shrinkers
Content-Language: en-US
To: Muchun Song <muchun.song@linux.dev>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz,
 roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org,
 paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com, cel@kernel.org,
 senozhatsky@chromium.org, yujie.liu@intel.com, gregkh@linuxfoundation.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-20-zhengqi.arch@bytedance.com>
 <d41d09bc-7c1c-f708-ecfa-ffac59bf58ad@linux.dev>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <d41d09bc-7c1c-f708-ecfa-ffac59bf58ad@linux.dev>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 2023/7/26 15:10, Muchun Song wrote:
> 
> 
> On 2023/7/24 17:43, Qi Zheng wrote:
>> Use new APIs to dynamically allocate the thp-zero and thp-deferred_split
>> shrinkers.
>>
>> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
>> ---
>> Â  mm/huge_memory.c | 69 +++++++++++++++++++++++++++++++-----------------
>> Â  1 file changed, 45 insertions(+), 24 deletions(-)
>>
>> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
>> index 8c94b34024a2..4db5a1834d81 100644
>> --- a/mm/huge_memory.c
>> +++ b/mm/huge_memory.c
>> @@ -65,7 +65,11 @@ unsigned long transparent_hugepage_flags 
>> __read_mostly =
>> Â Â Â Â Â  (1<<TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG)|
>> Â Â Â Â Â  (1<<TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG);
>> -static struct shrinker deferred_split_shrinker;
>> +static struct shrinker *deferred_split_shrinker;
>> +static unsigned long deferred_split_count(struct shrinker *shrink,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct shrink_control *sc);
>> +static unsigned long deferred_split_scan(struct shrinker *shrink,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct shrink_control *sc);
>> Â  static atomic_t huge_zero_refcount;
>> Â  struct page *huge_zero_page __read_mostly;
>> @@ -229,11 +233,7 @@ static unsigned long 
>> shrink_huge_zero_page_scan(struct shrinker *shrink,
>> Â Â Â Â Â  return 0;
>> Â  }
>> -static struct shrinker huge_zero_page_shrinker = {
>> -Â Â Â  .count_objects = shrink_huge_zero_page_count,
>> -Â Â Â  .scan_objects = shrink_huge_zero_page_scan,
>> -Â Â Â  .seeks = DEFAULT_SEEKS,
>> -};
>> +static struct shrinker *huge_zero_page_shrinker;
> 
> Same as patch #17.

OK, will do.

> 
>> Â  #ifdef CONFIG_SYSFS
>> Â  static ssize_t enabled_show(struct kobject *kobj,
>> @@ -454,6 +454,40 @@ static inline void hugepage_exit_sysfs(struct 
>> kobject *hugepage_kobj)
>> Â  }
>> Â  #endif /* CONFIG_SYSFS */
>> +static int thp_shrinker_init(void)
> 
> Better to declare it as __init.

Will do.

> 
>> +{
>> +Â Â Â  huge_zero_page_shrinker = shrinker_alloc(0, "thp-zero");
>> +Â Â Â  if (!huge_zero_page_shrinker)
>> +Â Â Â Â Â Â Â  return -ENOMEM;
>> +
>> +Â Â Â  deferred_split_shrinker = shrinker_alloc(SHRINKER_NUMA_AWARE |
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  SHRINKER_MEMCG_AWARE |
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  SHRINKER_NONSLAB,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  "thp-deferred_split");
>> +Â Â Â  if (!deferred_split_shrinker) {
>> +Â Â Â Â Â Â Â  shrinker_free_non_registered(huge_zero_page_shrinker);
>> +Â Â Â Â Â Â Â  return -ENOMEM;
>> +Â Â Â  }
>> +
>> +Â Â Â  huge_zero_page_shrinker->count_objects = 
>> shrink_huge_zero_page_count;
>> +Â Â Â  huge_zero_page_shrinker->scan_objects = shrink_huge_zero_page_scan;
>> +Â Â Â  huge_zero_page_shrinker->seeks = DEFAULT_SEEKS;
>> +Â Â Â  shrinker_register(huge_zero_page_shrinker);
>> +
>> +Â Â Â  deferred_split_shrinker->count_objects = deferred_split_count;
>> +Â Â Â  deferred_split_shrinker->scan_objects = deferred_split_scan;
>> +Â Â Â  deferred_split_shrinker->seeks = DEFAULT_SEEKS;
>> +Â Â Â  shrinker_register(deferred_split_shrinker);
>> +
>> +Â Â Â  return 0;
>> +}
>> +
>> +static void thp_shrinker_exit(void)
> 
> Same as here.

Will do.

> 
>> +{
>> +Â Â Â  shrinker_unregister(huge_zero_page_shrinker);
>> +Â Â Â  shrinker_unregister(deferred_split_shrinker);
>> +}
>> +
>> Â  static int __init hugepage_init(void)
>> Â  {
>> Â Â Â Â Â  int err;
>> @@ -482,12 +516,9 @@ static int __init hugepage_init(void)
>> Â Â Â Â Â  if (err)
>> Â Â Â Â Â Â Â Â Â  goto err_slab;
>> -Â Â Â  err = register_shrinker(&huge_zero_page_shrinker, "thp-zero");
>> -Â Â Â  if (err)
>> -Â Â Â Â Â Â Â  goto err_hzp_shrinker;
>> -Â Â Â  err = register_shrinker(&deferred_split_shrinker, 
>> "thp-deferred_split");
>> +Â Â Â  err = thp_shrinker_init();
>> Â Â Â Â Â  if (err)
>> -Â Â Â Â Â Â Â  goto err_split_shrinker;
>> +Â Â Â Â Â Â Â  goto err_shrinker;
>> Â Â Â Â Â  /*
>> Â Â Â Â Â Â  * By default disable transparent hugepages on smaller systems,
>> @@ -505,10 +536,8 @@ static int __init hugepage_init(void)
>> Â Â Â Â Â  return 0;
>> Â  err_khugepaged:
>> -Â Â Â  unregister_shrinker(&deferred_split_shrinker);
>> -err_split_shrinker:
>> -Â Â Â  unregister_shrinker(&huge_zero_page_shrinker);
>> -err_hzp_shrinker:
>> +Â Â Â  thp_shrinker_exit();
>> +err_shrinker:
>> Â Â Â Â Â  khugepaged_destroy();
>> Â  err_slab:
>> Â Â Â Â Â  hugepage_exit_sysfs(hugepage_kobj);
>> @@ -2851,7 +2880,7 @@ void deferred_split_folio(struct folio *folio)
>> Â  #ifdef CONFIG_MEMCG
>> Â Â Â Â Â Â Â Â Â  if (memcg)
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  set_shrinker_bit(memcg, folio_nid(folio),
>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  deferred_split_shrinker.id);
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  deferred_split_shrinker->id);
>> Â  #endif
>> Â Â Â Â Â  }
>> Â Â Â Â Â  spin_unlock_irqrestore(&ds_queue->split_queue_lock, flags);
>> @@ -2925,14 +2954,6 @@ static unsigned long deferred_split_scan(struct 
>> shrinker *shrink,
>> Â Â Â Â Â  return split;
>> Â  }
>> -static struct shrinker deferred_split_shrinker = {
>> -Â Â Â  .count_objects = deferred_split_count,
>> -Â Â Â  .scan_objects = deferred_split_scan,
>> -Â Â Â  .seeks = DEFAULT_SEEKS,
>> -Â Â Â  .flags = SHRINKER_NUMA_AWARE | SHRINKER_MEMCG_AWARE |
>> -Â Â Â Â Â Â Â Â  SHRINKER_NONSLAB,
>> -};
>> -
>> Â  #ifdef CONFIG_DEBUG_FS
>> Â  static void split_huge_pages_all(void)
>> Â  {
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 09:28:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 09:28:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570233.891860 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOap6-0001xM-QV; Wed, 26 Jul 2023 09:28:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570233.891860; Wed, 26 Jul 2023 09:28:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOap6-0001xF-NY; Wed, 26 Jul 2023 09:28:48 +0000
Received: by outflank-mailman (input) for mailman id 570233;
 Wed, 26 Jul 2023 09:28:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7qZ+=DM=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOap5-0001x4-L4
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 09:28:47 +0000
Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com
 [2607:f8b0:4864:20::434])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d17ef206-2b96-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 11:28:46 +0200 (CEST)
Received: by mail-pf1-x434.google.com with SMTP id
 d2e1a72fcca58-6748a616e17so1654066b3a.1
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 02:28:46 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 bc2-20020a170902930200b001a95f632340sm12591323plb.46.2023.07.26.02.28.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 26 Jul 2023 02:28:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d17ef206-2b96-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690363725; x=1690968525;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=ET5z1iXVl3TCzfyIPhSPq9r+sES1n7GH6hJTCnF+vYo=;
        b=RgneqgkXKODRrFr78EJ2DiU2LP1auMSsEluGXDNHK2/ImK1m1wgxIc9rc0KyChzerd
         9pp9E0d70JkoKPUeaRftr+jglcQl9qJ1NHO80UjvVHwRcDm/HyYkv/adcdLVyb0tT2RZ
         DBfPuhO0Xzb3EkxZ8Lnv+NpBNxlgzINPxdWjI2p4gXmhxr9F42wMDqq5WIk8CWvg0ei0
         04D2fNryYi6h/fKlwXKsAJNXxbdFzcjkeSQHK+ZzWAzpfHtAdyeZZlzM27TnNlh1u/69
         UWlC2QlusG6aR16W+ARLMoeEnjaKWlhVg7tepMtvkY5m/QLzYLh0WRDX9uQBe16cx9gs
         O9rw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690363725; x=1690968525;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=ET5z1iXVl3TCzfyIPhSPq9r+sES1n7GH6hJTCnF+vYo=;
        b=DVT14IToXNNTvevJP3hcAztg4g5NlleMUzCMVmUi+KYNKoq97fhhuUiGE5hXoA2DZk
         Bvq37fgYc6n130ygbIdjkPq62qyogmujdUC7U3mXshoAiTJ6XwdYmC+InmovGSi1p6fJ
         L5zweflCT/Djoh60prMZxEkRPEKCMjg/z9PuTq1EvBL5hzZNhxwtiojeh/4UE5DER0yP
         BFqIWSe1XBzw29vfJaitDH1aJ1zjofN2zP9TX/ob25KLjTRmuJ3UFN8CF74hZG/MnyEN
         DI10UXzukyMKcGv2xAhnQ7bDY3m6MA0Vvx6kM4iVKTDkAxSCXvJ4E4U0B24T+t8OaSns
         v3Bg==
X-Gm-Message-State: ABy/qLYM3ejtkKIpZE+bdKoOXgPpSpfi6OKsHgejUf3C2vVGb2JEwP6X
	d7NanlpTp4d1sMDk6jjaDJj5tQ==
X-Google-Smtp-Source: APBJJlFvSUUJYrPzKxRMgKGWHa7iMtrF7iaocGD/XAPkPO20BZ2/Wf52mLvF02dnCC8LpFHDclZgZw==
X-Received: by 2002:a17:903:41c8:b0:1bb:83ec:832 with SMTP id u8-20020a17090341c800b001bb83ec0832mr2040388ple.2.1690363724990;
        Wed, 26 Jul 2023 02:28:44 -0700 (PDT)
Message-ID: <acb14ed0-b9ca-e7c9-e81b-a2db290a1b94@bytedance.com>
Date: Wed, 26 Jul 2023 17:28:30 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 21/47] mm: workingset: dynamically allocate the
 mm-shadow shrinker
Content-Language: en-US
To: Muchun Song <muchun.song@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>, david@fromorbit.com,
 tkhai@ya.ru, Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>, djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>, "Paul E. McKenney"
 <paulmck@kernel.org>, tytso@mit.edu, steven.price@arm.com, cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>, yujie.liu@intel.com,
 gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
 linux-mm@kvack.org, x86@kernel.org, kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org, linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org, linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-22-zhengqi.arch@bytedance.com>
 <08F2140B-0684-4FB0-8FB9-CEB88882F884@linux.dev>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <08F2140B-0684-4FB0-8FB9-CEB88882F884@linux.dev>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 2023/7/26 15:13, Muchun Song wrote:
> 
> 
>> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> wrote:
>>
>> Use new APIs to dynamically allocate the mm-shadow shrinker.
>>
>> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
>> ---
>> mm/workingset.c | 26 ++++++++++++++------------
>> 1 file changed, 14 insertions(+), 12 deletions(-)
>>
>> diff --git a/mm/workingset.c b/mm/workingset.c
>> index 4686ae363000..4bc85f739b13 100644
>> --- a/mm/workingset.c
>> +++ b/mm/workingset.c
>> @@ -762,12 +762,7 @@ static unsigned long scan_shadow_nodes(struct shrinker *shrinker,
>> NULL);
>> }
>>
>> -static struct shrinker workingset_shadow_shrinker = {
>> -	.count_objects = count_shadow_nodes,
>> -	.scan_objects = scan_shadow_nodes,
>> -	.seeks = 0, /* ->count reports only fully expendable nodes */
>> -	.flags = SHRINKER_NUMA_AWARE | SHRINKER_MEMCG_AWARE,
>> -};
>> +static struct shrinker *workingset_shadow_shrinker;
> 
> 
> Same as patch #17.

OK, will do.



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 09:29:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 09:29:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570236.891870 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOapf-0002UG-1e; Wed, 26 Jul 2023 09:29:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570236.891870; Wed, 26 Jul 2023 09:29:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOape-0002U9-VI; Wed, 26 Jul 2023 09:29:22 +0000
Received: by outflank-mailman (input) for mailman id 570236;
 Wed, 26 Jul 2023 09:29:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qOapd-0002Tz-RN
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 09:29:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qOapd-0005kg-3l; Wed, 26 Jul 2023 09:29:21 +0000
Received: from [15.248.2.150] (helo=[10.24.67.30])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qOapc-0002Wf-R2; Wed, 26 Jul 2023 09:29:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=84H0gbAZAv7krrCpVksJiF1SmJZa0HrIDPZK/lKzpOU=; b=rc+rSeBaSLKU1qIjXNKuxWsUZR
	5Z9+6i61lKzThpjwYoYCeJKCa0Q+DcJK+piIUfi/Wd9rfIa4xawh9FyglqI7c2U+QaomRlfJAaCG0
	23J3+RyqqkpNMXzW34uPc62xMCdWRJn7xtUtPNPYKgcRkgo9+FTkg+H6D8f1Cgatm750=;
Message-ID: <c86e0983-6b51-c5be-a666-20fd407b2537@xen.org>
Date: Wed, 26 Jul 2023 10:29:19 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 08/25] tools/xenstore: make hashtable key and value
 parameters const
Content-Language: en-GB
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-9-jgross@suse.com>
 <2c981a1a-b020-3908-8b9b-8821daec9457@xen.org>
 <a6370aa2-ec6c-259f-3e24-bc1a74ead2a6@suse.com>
 <f0a115a6-843e-74ff-7f0f-28cf0545932e@xen.org>
 <3d2daedf-b2c0-5a26-a57d-4742f69f08b7@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <3d2daedf-b2c0-5a26-a57d-4742f69f08b7@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 26/07/2023 09:44, Juergen Gross wrote:
> On 26.07.23 10:20, Julien Grall wrote:
>> To give a concrete example, with the current interface we are telling 
>> the user that what they store in the hashtable can be modified at some 
>> point. By adding 'const' for the value in hashtable_add(), we can 
>> mislead a user to think it is fine to store static string, yet this is 
>> not enforced all the way through. So one could mistakenly think that 
>> values returned hashtable_search() can be modified. And the compiler 
>> will not be here to help enforcing it because you cast-away the const.
> 
> Yes, like in the case of strstr().
> 
> It takes two const char * parameters and it is returning char *, even 
> with it
> pointing into the first parameter.

This is a pretty good example on how to not write an interface. :)

> 
>> Do you have any code in this series that requires the 'const' in 
>> hashtable_add()? If so, can you point me to the patch and I will have 
>> a look?
> 
> I had it when writing this patch, but this requirement is gone now. But 
> please
> note that this means to drop the const from db_write(), too.
> 
>> If not, then I will strongly argue that this should be dropped because 
>> dropping a const is always a recipe for disaster.
> 
> Depends IMO.
> 
> I believe it is better as I've done it,
> but in case you insist on it I 
> can drop
> the patch.

Well... I can always be swayed if there is a good argument to make it 
const. So far, you mention that hashtable doesn't modify the content but 
you don't really explain why waiving away the help from the compiler is 
ok. Therefore, to me it seems the downside is bigger than the benefit.

Also, I am not asking to drop the patch. The const on the key is ok. I 
am only requesting to remove the const on the value.

> 
> An alternative would be make hashtable_search() return a const and only 
> cast the
> const away where it is really needed (and probably with a prominent 
> comment at
> the related hashtable_add() place). I think this will hit 
> xenstored_domain.c use
> cases only.

Again, this still means we are casting away the const somewhere. This is 
the part I am against if there is no strong justification for it (i.e. 
there is no other way to do it).

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 09:31:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 09:31:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570239.891880 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOark-0003zJ-Eh; Wed, 26 Jul 2023 09:31:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570239.891880; Wed, 26 Jul 2023 09:31:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOark-0003zC-Ag; Wed, 26 Jul 2023 09:31:32 +0000
Received: by outflank-mailman (input) for mailman id 570239;
 Wed, 26 Jul 2023 09:31:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7qZ+=DM=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOari-0003z4-Nk
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 09:31:30 +0000
Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com
 [2607:f8b0:4864:20::536])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 32d90906-2b97-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 11:31:29 +0200 (CEST)
Received: by mail-pg1-x536.google.com with SMTP id
 41be03b00d2f7-55b78bf0423so262347a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 02:31:29 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 z5-20020aa791c5000000b0065446092699sm11395167pfa.141.2023.07.26.02.31.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 26 Jul 2023 02:31:27 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 32d90906-2b97-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690363888; x=1690968688;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=1c1HMAKYJ9E5B+Yw2yBJ71y5Qnnu7lxJRJAz0VpzdjM=;
        b=EQF1AXz3x2yXYd4qjMocTxTPUv5xmp+rmGdaUf3NNuCw5J/jTQ4A7IZT9vF7epjgJn
         KpwUuVkJ6HJRDUdWsR7NfWHbSXC8PWsHFdh4oIHUbaD9e84jeocWSrQORf7q4ywyRFQs
         1LGzZPZFXEkz9W3LLj6dH3mxCQb9lJbVi2esRgVEZwICTBL25qmDvMRXpJTk+hKerksQ
         5luk2+UVNUyo38NcOvmQg3etwWF0YvvBh8PEUa0Itb7+IS99+a0eXqafnZ8swwiJM5Cj
         hj/kRKpfCuHQwUVrKGY+/fSvHLFGiflLsA9oD4Oo9Kuwpr8gW47+Nnd/Sw58xHubMwbF
         Qyeg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690363888; x=1690968688;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=1c1HMAKYJ9E5B+Yw2yBJ71y5Qnnu7lxJRJAz0VpzdjM=;
        b=RINSYD2Z5FYBZhviQ9rhNNtDZ3RgKNLhDjoiLcFfNBnAWyyaqrVGyfWBmMejxr4wjo
         uab5hajvxtxKnKPyVdCqBev5rcgEwAKS97TN0VU4Ztn6t8qkcmxnJybP70u+qBSD+Iln
         mE+CfDMnafi/ipK6cnCFFmsiBpReA98Q1NkDi99nBB2+RNQdde2sE106TnzPpaVzlf2m
         TwjE05oZZtuLPXOhC3gJ6J6xLZG/Dz4NOUzH2AMscCEso86I26yik7tZrZnCPRrrd4S0
         FCld7oqEQp5WKhsQ1QusoBOtAosLrUgZCRb6/3sIIq3hkPc3pwoqdgWRXT8siFo1Mz+A
         0qAw==
X-Gm-Message-State: ABy/qLYXx2Dcrfda7X4yPWFtRk9qLScT+MEaXDT8VIsnNPOrw5Qb85xw
	85Z8OY4T1pBQkM0NCMItew3ZUg==
X-Google-Smtp-Source: APBJJlEqsGncSKz6JEtDSHUBqLuH7hBKwqIpyMup6VZ4SlPsq4lxhQ8OawAhUiBJ+OlnlseBEBKBeQ==
X-Received: by 2002:a05:6a00:4a10:b0:686:b990:560f with SMTP id do16-20020a056a004a1000b00686b990560fmr1620878pfb.2.1690363888304;
        Wed, 26 Jul 2023 02:31:28 -0700 (PDT)
Message-ID: <b941338c-56e7-65e7-da45-bfefc484ad80@bytedance.com>
Date: Wed, 26 Jul 2023 17:31:14 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 23/47] drm/msm: dynamically allocate the drm-msm_gem
 shrinker
Content-Language: en-US
To: Muchun Song <muchun.song@linux.dev>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz,
 roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org,
 paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com, cel@kernel.org,
 senozhatsky@chromium.org, yujie.liu@intel.com, gregkh@linuxfoundation.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-24-zhengqi.arch@bytedance.com>
 <17de3f5b-3bef-be38-9801-0e84cfe8539b@linux.dev>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <17de3f5b-3bef-be38-9801-0e84cfe8539b@linux.dev>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 2023/7/26 15:24, Muchun Song wrote:
> 
> 
> On 2023/7/24 17:43, Qi Zheng wrote:
>> In preparation for implementing lockless slab shrink, use new APIs to
>> dynamically allocate the drm-msm_gem shrinker, so that it can be freed
>> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
>> read-side critical section when releasing the struct msm_drm_private.
>>
>> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> 
> Reviewed-by: Muchun Song <songmuchun@bytedance.com>
> 
> A nit bellow.
> 
>> ---
>> Â  drivers/gpu/drm/msm/msm_drv.cÂ Â Â Â Â Â Â Â Â  |Â  4 ++-
>> Â  drivers/gpu/drm/msm/msm_drv.hÂ Â Â Â Â Â Â Â Â  |Â  4 +--
>> Â  drivers/gpu/drm/msm/msm_gem_shrinker.c | 36 ++++++++++++++++----------
>> Â  3 files changed, 28 insertions(+), 16 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/msm_drv.c 
>> b/drivers/gpu/drm/msm/msm_drv.c
>> index 891eff8433a9..7f6933be703f 100644
>> --- a/drivers/gpu/drm/msm/msm_drv.c
>> +++ b/drivers/gpu/drm/msm/msm_drv.c
>> @@ -461,7 +461,9 @@ static int msm_drm_init(struct device *dev, const 
>> struct drm_driver *drv)
>> Â Â Â Â Â  if (ret)
>> Â Â Â Â Â Â Â Â Â  goto err_msm_uninit;
>> -Â Â Â  msm_gem_shrinker_init(ddev);
>> +Â Â Â  ret = msm_gem_shrinker_init(ddev);
>> +Â Â Â  if (ret)
>> +Â Â Â Â Â Â Â  goto err_msm_uninit;
>> Â Â Â Â Â  if (priv->kms_init) {
>> Â Â Â Â Â Â Â Â Â  ret = priv->kms_init(ddev);
>> diff --git a/drivers/gpu/drm/msm/msm_drv.h 
>> b/drivers/gpu/drm/msm/msm_drv.h
>> index e13a8cbd61c9..84523d4a1e58 100644
>> --- a/drivers/gpu/drm/msm/msm_drv.h
>> +++ b/drivers/gpu/drm/msm/msm_drv.h
>> @@ -217,7 +217,7 @@ struct msm_drm_private {
>> Â Â Â Â Â  } vram;
>> Â Â Â Â Â  struct notifier_block vmap_notifier;
>> -Â Â Â  struct shrinker shrinker;
>> +Â Â Â  struct shrinker *shrinker;
>> Â Â Â Â Â  struct drm_atomic_state *pm_state;
>> @@ -279,7 +279,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, 
>> void *data,
>> Â  unsigned long msm_gem_shrinker_shrink(struct drm_device *dev, 
>> unsigned long nr_to_scan);
>> Â  #endif
>> -void msm_gem_shrinker_init(struct drm_device *dev);
>> +int msm_gem_shrinker_init(struct drm_device *dev);
>> Â  void msm_gem_shrinker_cleanup(struct drm_device *dev);
>> Â  int msm_gem_prime_mmap(struct drm_gem_object *obj, struct 
>> vm_area_struct *vma);
>> diff --git a/drivers/gpu/drm/msm/msm_gem_shrinker.c 
>> b/drivers/gpu/drm/msm/msm_gem_shrinker.c
>> index f38296ad8743..7daab1298c11 100644
>> --- a/drivers/gpu/drm/msm/msm_gem_shrinker.c
>> +++ b/drivers/gpu/drm/msm/msm_gem_shrinker.c
>> @@ -34,8 +34,7 @@ static bool can_block(struct shrink_control *sc)
>> Â  static unsigned long
>> Â  msm_gem_shrinker_count(struct shrinker *shrinker, struct 
>> shrink_control *sc)
>> Â  {
>> -Â Â Â  struct msm_drm_private *priv =
>> -Â Â Â Â Â Â Â  container_of(shrinker, struct msm_drm_private, shrinker);
>> +Â Â Â  struct msm_drm_private *priv = shrinker->private_data;
>> Â Â Â Â Â  unsigned count = priv->lru.dontneed.count;
>> Â Â Â Â Â  if (can_swap())
>> @@ -100,8 +99,7 @@ active_evict(struct drm_gem_object *obj)
>> Â  static unsigned long
>> Â  msm_gem_shrinker_scan(struct shrinker *shrinker, struct 
>> shrink_control *sc)
>> Â  {
>> -Â Â Â  struct msm_drm_private *priv =
>> -Â Â Â Â Â Â Â  container_of(shrinker, struct msm_drm_private, shrinker);
>> +Â Â Â  struct msm_drm_private *priv = shrinker->private_data;
>> Â Â Â Â Â  struct {
>> Â Â Â Â Â Â Â Â Â  struct drm_gem_lru *lru;
>> Â Â Â Â Â Â Â Â Â  bool (*shrink)(struct drm_gem_object *obj);
>> @@ -148,10 +146,11 @@ msm_gem_shrinker_shrink(struct drm_device *dev, 
>> unsigned long nr_to_scan)
>> Â Â Â Â Â  struct shrink_control sc = {
>> Â Â Â Â Â Â Â Â Â  .nr_to_scan = nr_to_scan,
>> Â Â Â Â Â  };
>> -Â Â Â  int ret;
>> +Â Â Â  unsigned long ret = SHRINK_STOP;
>> Â Â Â Â Â  fs_reclaim_acquire(GFP_KERNEL);
>> -Â Â Â  ret = msm_gem_shrinker_scan(&priv->shrinker, &sc);
>> +Â Â Â  if (priv->shrinker)
>> +Â Â Â Â Â Â Â  ret = msm_gem_shrinker_scan(priv->shrinker, &sc);
>> Â Â Â Â Â  fs_reclaim_release(GFP_KERNEL);
>> Â Â Â Â Â  return ret;
>> @@ -210,16 +209,27 @@ msm_gem_shrinker_vmap(struct notifier_block *nb, 
>> unsigned long event, void *ptr)
>> Â Â  *
>> Â Â  * This function registers and sets up the msm shrinker.
>> Â Â  */
>> -void msm_gem_shrinker_init(struct drm_device *dev)
>> +int msm_gem_shrinker_init(struct drm_device *dev)
>> Â  {
>> Â Â Â Â Â  struct msm_drm_private *priv = dev->dev_private;
>> -Â Â Â  priv->shrinker.count_objects = msm_gem_shrinker_count;
>> -Â Â Â  priv->shrinker.scan_objects = msm_gem_shrinker_scan;
>> -Â Â Â  priv->shrinker.seeks = DEFAULT_SEEKS;
>> -Â Â Â  WARN_ON(register_shrinker(&priv->shrinker, "drm-msm_gem"));
>> +
>> +Â Â Â  priv->shrinker = shrinker_alloc(0, "drm-msm_gem");
>> +Â Â Â  if (!priv->shrinker) {
> 
> Just "if (WARN_ON(!priv->shrinker))"

As suggested by Steven Pric in patch #24, this warning is
unnecessary, so I will remove it in the next version.

> 
>> +Â Â Â Â Â Â Â  WARN_ON(1);
>> +Â Â Â Â Â Â Â  return -ENOMEM;
>> +Â Â Â  }
>> +
>> +Â Â Â  priv->shrinker->count_objects = msm_gem_shrinker_count;
>> +Â Â Â  priv->shrinker->scan_objects = msm_gem_shrinker_scan;
>> +Â Â Â  priv->shrinker->seeks = DEFAULT_SEEKS;
>> +Â Â Â  priv->shrinker->private_data = priv;
>> +
>> +Â Â Â  shrinker_register(priv->shrinker);
>> Â Â Â Â Â  priv->vmap_notifier.notifier_call = msm_gem_shrinker_vmap;
>> Â Â Â Â Â  WARN_ON(register_vmap_purge_notifier(&priv->vmap_notifier));
>> +
>> +Â Â Â  return 0;
>> Â  }
>> Â  /**
>> @@ -232,8 +242,8 @@ void msm_gem_shrinker_cleanup(struct drm_device *dev)
>> Â  {
>> Â Â Â Â Â  struct msm_drm_private *priv = dev->dev_private;
>> -Â Â Â  if (priv->shrinker.nr_deferred) {
>> +Â Â Â  if (priv->shrinker) {
>> Â Â Â Â Â Â Â Â Â  WARN_ON(unregister_vmap_purge_notifier(&priv->vmap_notifier));
>> -Â Â Â Â Â Â Â  unregister_shrinker(&priv->shrinker);
>> +Â Â Â Â Â Â Â  shrinker_unregister(priv->shrinker);
>> Â Â Â Â Â  }
>> Â  }
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 09:31:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 09:31:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570240.891889 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOary-0004Ld-KG; Wed, 26 Jul 2023 09:31:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570240.891889; Wed, 26 Jul 2023 09:31:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOary-0004LW-Hi; Wed, 26 Jul 2023 09:31:46 +0000
Received: by outflank-mailman (input) for mailman id 570240;
 Wed, 26 Jul 2023 09:31:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pzNf=DM=linux.dev=muchun.song@srs-se1.protection.inumbo.net>)
 id 1qOarw-0003z4-8p
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 09:31:44 +0000
Received: from out-63.mta0.migadu.com (out-63.mta0.migadu.com [91.218.175.63])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3b3b2762-2b97-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 11:31:43 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3b3b2762-2b97-11ee-b242-6b7b168915f2
Content-Type: text/plain;
	charset=us-ascii
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1690363901;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=C9JATXkXZaN7f0jrXVOoaEMLIPnzZ4EB9BwhBVu88/k=;
	b=BJaw31GHkPVMB5J3bFLk7nCWUXBih3Evut0vs64rGABml16vhPPP+VTCvSpnvcgPtpNdnt
	lUE24RniQLpCmG5kFgpHNW+1PDmB/qhB9l9vhPT5YKqpl2p08nrVkD19PS1VqQI3/KFSOu
	LvMc1Yox7zbU5EqPQ+5oAKbHUZVLA0E=
MIME-Version: 1.0
Subject: Re: [PATCH v2 43/47] mm: shrinker: add a secondary array for
 shrinker_info::{map, nr_deferred}
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Muchun Song <muchun.song@linux.dev>
In-Reply-To: <20230724094354.90817-44-zhengqi.arch@bytedance.com>
Date: Wed, 26 Jul 2023 17:30:53 +0800
Cc: Andrew Morton <akpm@linux-foundation.org>,
 david@fromorbit.com,
 tkhai@ya.ru,
 Vlastimil Babka <vbabka@suse.cz>,
 Roman Gushchin <roman.gushchin@linux.dev>,
 djwong@kernel.org,
 Christian Brauner <brauner@kernel.org>,
 "Paul E. McKenney" <paulmck@kernel.org>,
 tytso@mit.edu,
 steven.price@arm.com,
 cel@kernel.org,
 Sergey Senozhatsky <senozhatsky@chromium.org>,
 yujie.liu@intel.com,
 Greg KH <gregkh@linuxfoundation.org>,
 LKML <linux-kernel@vger.kernel.org>,
 Linux Memory Management List <linux-mm@kvack.org>,
 x86@kernel.org,
 kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org,
 netdev <netdev@vger.kernel.org>,
 dri-devel@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com,
 linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org,
 virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org,
 linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org,
 linux-btrfs@vger.kernel.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <B421DD89-09B5-4488-BEC1-D6F88C6DE75A@linux.dev>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-44-zhengqi.arch@bytedance.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
X-Migadu-Flow: FLOW_OUT



> On Jul 24, 2023, at 17:43, Qi Zheng <zhengqi.arch@bytedance.com> =
wrote:
>=20
> Currently, we maintain two linear arrays per node per memcg, which are
> shrinker_info::map and shrinker_info::nr_deferred. And we need to =
resize
> them when the shrinker_nr_max is exceeded, that is, allocate a new =
array,
> and then copy the old array to the new array, and finally free the old
> array by RCU.
>=20
> For shrinker_info::map, we do set_bit() under the RCU lock, so we may =
set
> the value into the old map which is about to be freed. This may cause =
the
> value set to be lost. The current solution is not to copy the old map =
when
> resizing, but to set all the corresponding bits in the new map to 1. =
This
> solves the data loss problem, but bring the overhead of more pointless
> loops while doing memcg slab shrink.
>=20
> For shrinker_info::nr_deferred, we will only modify it under the read =
lock
> of shrinker_rwsem, so it will not run concurrently with the resizing. =
But
> after we make memcg slab shrink lockless, there will be the same data =
loss
> problem as shrinker_info::map, and we can't work around it like the =
map.
>=20
> For such resizable arrays, the most straightforward idea is to change =
it
> to xarray, like we did for list_lru [1]. We need to do xa_store() in =
the
> list_lru_add()-->set_shrinker_bit(), but this will cause memory
> allocation, and the list_lru_add() doesn't accept failure. A possible
> solution is to pre-allocate, but the location of pre-allocation is not
> well determined.
>=20
> Therefore, this commit chooses to introduce a secondary array for
> shrinker_info::{map, nr_deferred}, so that we only need to copy this
> secondary array every time the size is resized. Then even if we get =
the
> old secondary array under the RCU lock, the found map and nr_deferred =
are
> also true, so no data is lost.
>=20
> [1]. =
https://lore.kernel.org/all/20220228122126.37293-13-songmuchun@bytedance.c=
om/
>=20
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 09:33:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 09:33:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570243.891900 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOau2-000565-0p; Wed, 26 Jul 2023 09:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570243.891900; Wed, 26 Jul 2023 09:33:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOau1-00055y-UE; Wed, 26 Jul 2023 09:33:53 +0000
Received: by outflank-mailman (input) for mailman id 570243;
 Wed, 26 Jul 2023 09:33:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7qZ+=DM=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOau0-00055q-Mq
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 09:33:52 +0000
Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com
 [2607:f8b0:4864:20::42a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 876a947c-2b97-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 11:33:51 +0200 (CEST)
Received: by mail-pf1-x42a.google.com with SMTP id
 d2e1a72fcca58-682a5465e9eso1487411b3a.1
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 02:33:51 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 n5-20020a170902d2c500b001b89466a5f4sm12582766plc.105.2023.07.26.02.33.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 26 Jul 2023 02:33:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 876a947c-2b97-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690364030; x=1690968830;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=0oULOTnWb1HIc+jcDQkyDbPD+ewEuK6cRZsxNFZBJHs=;
        b=QJhhRpaTfMAfucHkCz2d9TS31hpYk30s2kQKv681O+Sl1mLTZQhZq5VKb4l9mXe+gX
         5Eax6ixoNcCSNY9H6aAkwgnBd/g9cM9X43ylT+UhHbYekfmlgjo/JXqlix6WaCFQ7jVV
         2D4QfnYhGItzA17GFTgozRmivkdC7H5IwsXEWhmkOBzQK5UpXhnT6Ls+I4I3tsoeozxU
         24KbqK2Cq3sIWZ8RaqWYBiX9Q9627K0AND5qR2t9+dtM8IjHsDiCPK6lh5ggLgTON/bP
         sMZVbirBGOz1XlXtXsxmGmw+9U7+KmVQpZdmOnau0hPanAHKCfZx0jR+DbnWSE4a/7ep
         yq9Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690364030; x=1690968830;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=0oULOTnWb1HIc+jcDQkyDbPD+ewEuK6cRZsxNFZBJHs=;
        b=aCz8/IJvpMpamembywLq1FXpfnLtT3odfFWWgW3GtkguBAbyFabzEIr0PyKbGHIzRW
         ZTYwBHThDfGeEN7qW55cQ6H+31ecxHdRUnDseuIhNq97DlCv6f6Y9C+wS7MNQLP9v2Zl
         jfvXKS38G8l24vUvVKq/KpVt8MwdbvEi0/MB6Jm33aBdfA+IHNDA9Z3/60e2XJysrxHP
         cV/XmZGRFybgbgfdCPHhAq7zAu9iN/O+/NXZCmGZFXFH8hzppLIK1GodPW4iSZCBFTVC
         pyBcdl8fEy8WIObRJLNNpl/Sd99FMn0+/oz9dAQqhRn/bldCCmhuqO6CPk5JIpzGuf2E
         WPMA==
X-Gm-Message-State: ABy/qLb+VlwzbjZ/Ms1QFx/4V1ip0eSVwBmhLwEUKDHMnN8pZO5KavxZ
	fw4InBD69IML5BSqEQ04JmCxcw==
X-Google-Smtp-Source: APBJJlG8LKe8O0SB++JE7Hsj6dMankp6b2TdGG8KZmgQCX7ZvwrXNm6kysx08G1J6PXDjDRRJyafNA==
X-Received: by 2002:a17:903:32c9:b0:1b8:5827:8763 with SMTP id i9-20020a17090332c900b001b858278763mr2037984plr.4.1690364030014;
        Wed, 26 Jul 2023 02:33:50 -0700 (PDT)
Message-ID: <0f12022e-5dd2-fb1c-f018-05f8ff0303ae@bytedance.com>
Date: Wed, 26 Jul 2023 17:33:36 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 28/47] bcache: dynamically allocate the md-bcache
 shrinker
Content-Language: en-US
To: Muchun Song <muchun.song@linux.dev>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz,
 roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org,
 paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com, cel@kernel.org,
 senozhatsky@chromium.org, yujie.liu@intel.com, gregkh@linuxfoundation.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-29-zhengqi.arch@bytedance.com>
 <4ee26da4-314e-0517-5d9a-31fb107368ef@linux.dev>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <4ee26da4-314e-0517-5d9a-31fb107368ef@linux.dev>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 2023/7/26 15:32, Muchun Song wrote:
> 
> 
> On 2023/7/24 17:43, Qi Zheng wrote:
>> In preparation for implementing lockless slab shrink, use new APIs to
>> dynamically allocate the md-bcache shrinker, so that it can be freed
>> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
>> read-side critical section when releasing the struct cache_set.
>>
>> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
>> ---
>> Â  drivers/md/bcache/bcache.h |Â  2 +-
>> Â  drivers/md/bcache/btree.cÂ  | 27 ++++++++++++++++-----------
>> Â  drivers/md/bcache/sysfs.cÂ  |Â  3 ++-
>> Â  3 files changed, 19 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
>> index 5a79bb3c272f..c622bc50f81b 100644
>> --- a/drivers/md/bcache/bcache.h
>> +++ b/drivers/md/bcache/bcache.h
>> @@ -541,7 +541,7 @@ struct cache_set {
>> Â Â Â Â Â  struct bio_setÂ Â Â Â Â Â Â  bio_split;
>> Â Â Â Â Â  /* For the btree cache */
>> -Â Â Â  struct shrinkerÂ Â Â Â Â Â Â  shrink;
>> +Â Â Â  struct shrinkerÂ Â Â Â Â Â Â  *shrink;
>> Â Â Â Â Â  /* For the btree cache and anything allocation related */
>> Â Â Â Â Â  struct mutexÂ Â Â Â Â Â Â  bucket_lock;
>> diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
>> index fd121a61f17c..c176c7fc77d9 100644
>> --- a/drivers/md/bcache/btree.c
>> +++ b/drivers/md/bcache/btree.c
>> @@ -667,7 +667,7 @@ static int mca_reap(struct btree *b, unsigned int 
>> min_order, bool flush)
>> Â  static unsigned long bch_mca_scan(struct shrinker *shrink,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct shrink_control *sc)
>> Â  {
>> -Â Â Â  struct cache_set *c = container_of(shrink, struct cache_set, 
>> shrink);
>> +Â Â Â  struct cache_set *c = shrink->private_data;
>> Â Â Â Â Â  struct btree *b, *t;
>> Â Â Â Â Â  unsigned long i, nr = sc->nr_to_scan;
>> Â Â Â Â Â  unsigned long freed = 0;
>> @@ -734,7 +734,7 @@ static unsigned long bch_mca_scan(struct shrinker 
>> *shrink,
>> Â  static unsigned long bch_mca_count(struct shrinker *shrink,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct shrink_control *sc)
>> Â  {
>> -Â Â Â  struct cache_set *c = container_of(shrink, struct cache_set, 
>> shrink);
>> +Â Â Â  struct cache_set *c = shrink->private_data;
>> Â Â Â Â Â  if (c->shrinker_disabled)
>> Â Â Â Â Â Â Â Â Â  return 0;
>> @@ -752,8 +752,8 @@ void bch_btree_cache_free(struct cache_set *c)
>> Â Â Â Â Â  closure_init_stack(&cl);
>> -Â Â Â  if (c->shrink.list.next)
>> -Â Â Â Â Â Â Â  unregister_shrinker(&c->shrink);
>> +Â Â Â  if (c->shrink)
>> +Â Â Â Â Â Â Â  shrinker_unregister(c->shrink);
>> Â Â Â Â Â  mutex_lock(&c->bucket_lock);
>> @@ -828,14 +828,19 @@ int bch_btree_cache_alloc(struct cache_set *c)
>> Â Â Â Â Â Â Â Â Â  c->verify_data = NULL;
>> Â  #endif
>> -Â Â Â  c->shrink.count_objects = bch_mca_count;
>> -Â Â Â  c->shrink.scan_objects = bch_mca_scan;
>> -Â Â Â  c->shrink.seeks = 4;
>> -Â Â Â  c->shrink.batch = c->btree_pages * 2;
>> +Â Â Â  c->shrink = shrinker_alloc(0, "md-bcache:%pU", c->set_uuid);
>> +Â Â Â  if (!c->shrink) {
>> +Â Â Â Â Â Â Â  pr_warn("bcache: %s: could not allocate shrinker\n", __func__);
>> +Â Â Â Â Â Â Â  return -ENOMEM;
> 
> Seems you have cheanged the semantic of this. In the past,
> it is better to have a shrinker, but now it becomes a mandatory.
> Right? I don't know if it is acceptable. From my point of view,
> just do the cleanup, don't change any behaviour.

Oh, should return 0 here, will do.

> 
>> +Â Â Â  }
>> +
>> +Â Â Â  c->shrink->count_objects = bch_mca_count;
>> +Â Â Â  c->shrink->scan_objects = bch_mca_scan;
>> +Â Â Â  c->shrink->seeks = 4;
>> +Â Â Â  c->shrink->batch = c->btree_pages * 2;
>> +Â Â Â  c->shrink->private_data = c;
>> -Â Â Â  if (register_shrinker(&c->shrink, "md-bcache:%pU", c->set_uuid))
>> -Â Â Â Â Â Â Â  pr_warn("bcache: %s: could not register shrinker\n",
>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  __func__);
>> +Â Â Â  shrinker_register(c->shrink);
>> Â Â Â Â Â  return 0;
>> Â  }
>> diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
>> index 0e2c1880f60b..45d8af755de6 100644
>> --- a/drivers/md/bcache/sysfs.c
>> +++ b/drivers/md/bcache/sysfs.c
>> @@ -866,7 +866,8 @@ STORE(__bch_cache_set)
>> Â Â Â Â Â Â Â Â Â  sc.gfp_mask = GFP_KERNEL;
>> Â Â Â Â Â Â Â Â Â  sc.nr_to_scan = strtoul_or_return(buf);
>> -Â Â Â Â Â Â Â  c->shrink.scan_objects(&c->shrink, &sc);
>> +Â Â Â Â Â Â Â  if (c->shrink)
>> +Â Â Â Â Â Â Â Â Â Â Â  c->shrink->scan_objects(c->shrink, &sc);
>> Â Â Â Â Â  }
>> Â Â Â Â Â  sysfs_strtoul_clamp(congested_read_threshold_us,
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 09:34:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 09:34:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570246.891910 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOauZ-0005ev-C2; Wed, 26 Jul 2023 09:34:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570246.891910; Wed, 26 Jul 2023 09:34:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOauZ-0005eo-9J; Wed, 26 Jul 2023 09:34:27 +0000
Received: by outflank-mailman (input) for mailman id 570246;
 Wed, 26 Jul 2023 09:34:26 +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
 <SRS0=+seJ=DM=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qOauY-0005ea-Fk
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 09:34:26 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9b3990e4-2b97-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 11:34:24 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.163.229.19])
 by support.bugseng.com (Postfix) with ESMTPSA id 658754EE0738;
 Wed, 26 Jul 2023 11:34:22 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9b3990e4-2b97-11ee-8613-37d641c3527e
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Wei Liu <wl@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [XEN PATCH v2] xen: use parameter name 'mcs' in arch_do_multicall_call()
Date: Wed, 26 Jul 2023 11:34:14 +0200
Message-Id: <e71bac85a2b7f92a6438f97048cc6cddc917768d.1690362993.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Make function declaration and definition consistent using the same
parameter name ('mcs' do denote a pointer to an 'mc_state').
This addresses a violation of MISRA C:2012 Rule 8.3: "All declarations
of an object or function shall use the same names and type qualifiers".

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
Changes in v2:
  - added forgotten changes about x86.
---
 xen/arch/arm/traps.c        | 4 ++--
 xen/arch/x86/hypercall.c    | 6 +++---
 xen/include/xen/multicall.h | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index d1ef787638..eab2fcfc02 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1470,9 +1470,9 @@ static bool check_multicall_32bit_clean(struct multicall_entry *multi)
     return true;
 }
 
-enum mc_disposition arch_do_multicall_call(struct mc_state *state)
+enum mc_disposition arch_do_multicall_call(struct mc_state *mcs)
 {
-    struct multicall_entry *multi = &state->call;
+    struct multicall_entry *multi = &mcs->call;
 
     if ( multi->op >= ARRAY_SIZE(hypercall_args) )
     {
diff --git a/xen/arch/x86/hypercall.c b/xen/arch/x86/hypercall.c
index cc9a6a9d59..01cd73040d 100644
--- a/xen/arch/x86/hypercall.c
+++ b/xen/arch/x86/hypercall.c
@@ -203,15 +203,15 @@ int hypercall_xlat_continuation(unsigned int *id, unsigned int nr,
     return rc;
 }
 
-enum mc_disposition arch_do_multicall_call(struct mc_state *state)
+enum mc_disposition arch_do_multicall_call(struct mc_state *mcs)
 {
     const struct domain *currd = current->domain;
 
     if ( is_pv_domain(currd) )
-        return pv_do_multicall_call(state);
+        return pv_do_multicall_call(mcs);
 
     if ( is_hvm_domain(currd) )
-        return hvm_do_multicall_call(state);
+        return hvm_do_multicall_call(mcs);
 
     return mc_exit;
 }
diff --git a/xen/include/xen/multicall.h b/xen/include/xen/multicall.h
index ac8238660a..5bebeca7b2 100644
--- a/xen/include/xen/multicall.h
+++ b/xen/include/xen/multicall.h
@@ -25,6 +25,6 @@ enum mc_disposition {
     mc_continue,
     mc_exit,
     mc_preempt,
-} arch_do_multicall_call(struct mc_state *mc);
+} arch_do_multicall_call(struct mc_state *mcs);
 
 #endif /* __XEN_MULTICALL_H__ */
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 09:35:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 09:35:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570251.891920 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOavR-0006G7-Lr; Wed, 26 Jul 2023 09:35:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570251.891920; Wed, 26 Jul 2023 09:35:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOavR-0006G0-ID; Wed, 26 Jul 2023 09:35:21 +0000
Received: by outflank-mailman (input) for mailman id 570251;
 Wed, 26 Jul 2023 09:35:20 +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
 <SRS0=CD/9=DM=citrix.com=prvs=564dce665=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOavQ-0006Fo-De
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 09:35:20 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b9cf4dad-2b97-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 11:35:17 +0200 (CEST)
Received: from mail-bn8nam12lp2176.outbound.protection.outlook.com (HELO
 NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.176])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 26 Jul 2023 05:35:14 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by PH7PR03MB7265.namprd03.prod.outlook.com (2603:10b6:510:24c::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Wed, 26 Jul
 2023 09:35:11 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023
 09:35:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b9cf4dad-2b97-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690364117;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=jNmmY+NO2EhkOFX7iHrNJPZ6no1mtsrD7TGuLC2I3RI=;
  b=AnMXHsA6elLCz3vz1EDH9iHP80nAqSNw8zoVf8wDeFI4hefs+4i4esAr
   RwTMgmBmiBFOE1qqCg5FlXhfN+tQh1+2edCqwrppqNXwrh0NIqg2+dtEw
   H5WKEWM7ClNwsLlU4S+mFC8R5oIe8ZbTD6H0lWW/V/rqt6GiEVsM05oji
   I=;
X-IronPort-RemoteIP: 104.47.55.176
X-IronPort-MID: 117498820
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:MCDAp6BsLasNVBVW//niw5YqxClBgxIJ4kV8jS/XYbTApDIqg2FWz
 msWCGyEbP6Na2L2cttxOYSxpBkGv5fXyt9nQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h
 yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs
 t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GxC4wRkDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS
 uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada
 jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIw3Lp0IEFi5
 aUiEy0yakncusiqn46lY7w57igjBJGD0II3nFhFlGucJ9B2BJfJTuPN+MNS2yo2ioZWB/HCa
 sEFaD1pKhPdfxlIPVRRA5U79AuqriCnL3sE9xTI+OxuvDa7IA9ZidABNPLPfdOHX4NNl1uwr
 WPa5WXpRBodMbRzzBLcqy3w17+fx3uTtIQ6GqG6ytpvnxqq/EMBEEUvd0CSmsOXhRvrMz5YA
 wlOksY0loAM80isQsj4TgePineOtR4BWPJdC+Q/rgqKz8L88wufQ2QJUDNFQNgnr9MtAywn0
 EeTmNHkDiApt6eaIVq68rqXtjq0NTIiBGkOfzIfTQAF7t/gp6k+lhvKCN1kFcadjNf4BDXxy
 DCitzUlivMYistj6kmg1VXOgjbprJ6ZSAcwv1/TRjj8sV0/Y5O5bYu171Sd9exHMIuSUliGu
 j4DhtSa6+cNS5qKkURhXdkwIV1g3N7dWBW0vLKlN8BJG+iFk5J7Qb1t3Q==
IronPort-HdrOrdr: A9a23:aBW52qFGJCcr0ng7pLqFiJLXdLJyesId70hD6qkvc3Fom52j/f
 xGws5x6faVslkssb8b6LW90Y27MAvhHPlOkPIs1NaZLXDbUQ6TQL2KgrGD/9SNIVycygcZ79
 YbT0EcMqyOMbEZt7ec3ODQKb9Jrri6GeKT9IHjJh9WPH1XgspbnmNE42igYy9LrF4sP+tFKH
 PQ3LswmxOQPVAsKuirDHgMWObO4/XNiZLdeBYDQzI39QWUijusybjiVzyVxA0XXT9jyaortT
 GtqX2y2oyT99WAjjPM3W7a6Jpb3PPn19t4HcSJzuQFNzn2jQ6sRYJ5H5mPpio8ru2D4Esj1P
 PMvxAjFcJu7G65RBD/nTLdny3blBo+4X7rzlGVxVPlvMzCXTo/T+5Mn5hQfBf141cp+IgU6t
 MC40up875sST/QliX04NbFEzlsi0qPuHIn1coelWZWX4cyYKJY6aYf4ERWOpEdGz+S0vFvLM
 BeSOXnoNpGe1KTaH7U+kFp3dyXR3w2WiyLR0AT0/blpgR+rTRc9Q811cYflnAP+NYWUJ9f/d
 nJNaxuifVnUtIWRbgVPpZOfeKHTkj2BT7cOmObJlrqUIsdPWjWlpLx6LIpoMm3ZZ0zyocokp
 ipaiIWiYcLQTOvNSSy5uwJzviUK1/NHwgFi/suq6SRg4eMBYYCaka4ORUTe8jJmYRsPiSUYY
 f2BHtsOY6SEYLfI/c24+TAYegiFZA/arxghj9pYSP4nuv7bqvXi8f8TNH/YJLQLBdMYBKNPp
 JEZkm/GPl9
X-Talos-CUID: 9a23:vnjzDW/m479Hl8An+tyVv2hIGeEFXm2E9kzNHEvhVltDVOKpV3bFrQ==
X-Talos-MUID: =?us-ascii?q?9a23=3AGwSQTAwARjdyOWKSaZBRLzYBlvuaqKqyCnwplIp?=
 =?us-ascii?q?BgvOrJzQoAhWGpQ+NbIByfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,231,1684814400"; 
   d="scan'208";a="117498820"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=aXUWoi6tbJOaNlTr9y4/NUwy1AwRzefJWA5kTuP+QybgYbd8vRfngoTYoPP0VPL2POhCPWCsmNnzdsvzHRxtIjQqs55OiD+YgUliiuJqr1riqm5GpdLZaCALUCpj5oi48HbrjakZFYieOlpAMLrmVM88u/xXrlsi6TdKOzIgNHt8n1b8+3UcLQgj3DDLt8fqzufgPLc6RrFYwJeJGPmxlefxLpiTHxGNCan/yJeCp4c+Lqli1VFZ+YFsWAXfZDbNbsaJLl5r0Qu4fJhU3TmoxvFf0iE5dN54M+qqRMZN0leTRzeVMIDt3SB6Hmf3dhtVKJi8XV6NSPj9Iv0xRPzEqg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=KCLsC0ku5B5hltACDy8oGZ1tmwawrdHwzTyCTqtUdq0=;
 b=JIWPR+47mjVlYnV6l+yVIXgGpO5xOUHSGtQ0RXEPS1vkJMzc1gSaUMfNeaMUki9hjyvCZLYs/UlhLM1zxknoNs0Tblg5D0+iaMsiDpwqbZMsxwzdOwwuU5TNXCBF1macJyNd++xz027Q4nroKC+WT3jrFUvX+8irxf5ogfgQFlOMR+qlw9XqN1Ty0hKLNXMpIAVisRt1uGva1LSS0Lp9V+6kdy2CUiN034VBMSXDSSLwPnF1vV6e72e6FGs3UcR8Qv3wq0pavrALwpmNro4RncV1kb1IwtHFkZGLXIopBJw/J6+kGgMiyI4c8IQpPxki86TmdAbl4mFuHX/gCU91Cw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KCLsC0ku5B5hltACDy8oGZ1tmwawrdHwzTyCTqtUdq0=;
 b=BNXSKomkkGdfzpQIEqgvlHJPPIeqtn02WRRoWshk8XZdUlB8vjyEL7OFUOMRGZKKH1FveEmqmdxzBLZ2j9J1MRUz1hkz3gyqefMAPDpPuruGHN7toO0tlZo8s/+RdxG8L3/MKbIl9r0r+n1azIDDNFd16AD+/gF1znB2SQ0BO5w=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Wed, 26 Jul 2023 11:35:03 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Message-ID: <ZMDox0WwumxMGnzV@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local>
 <87ila7cvy2.fsf@epam.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <87ila7cvy2.fsf@epam.com>
X-ClientProxiedBy: LO4P123CA0514.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:272::21) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|PH7PR03MB7265:EE_
X-MS-Office365-Filtering-Correlation-Id: 739b906e-0e3e-492d-d747-08db8dbb9b5b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	s+Kkl+PrRBNxqDqYM3TVV7ESgPy3T7QeZ350tjvWXxpEdkPeZ8w66BH5TbuFi99gsOItQhWz5AHC+dbIhxxCv/BICfyZKzcURymIn1q3z9zGP/xfUxXm9uHVYniWs3OOpoGN1LCYF5Vcx9PWLBNHlhRvSeeCE2si40v5ucPw1D4VK+wKXH4seqY3YWkZkgAmuFX5YRU2QiQbGLSmpOS4Gg8HwFX2Iyvti6sSfkkTWm8GH6YkVnqWi8DW18rREedYIJwAbKKVq9F7fx+d0DF1c/3/BZEcZ9vdMR4MDgLAkbQohlWM9Nd2/3+RcM4YrcMyqTxn2JiCshXjauH6g+3X5mVIG3ES2FzKoX88OIEOmC8eRFJ0k+9/Fhmpzd5RAksTtwq0h4RV4CZfH9g7lpdFDPxbvMMLX7hpfrHFcVSSiCBNiA2j2ymHajRySW6z/rZuizyMud7P68YGRfUkYpvH4/r6G98/VvMW2wLOeWUb5ATCW6apULdzDpDeX/8eRX0WARb/94r4HvAzHmIF1qiDz0MXAURVr5YWMZK6VTanp/Ym2FSvqRs9MHWOrTxbQb+h
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(39860400002)(376002)(136003)(346002)(451199021)(186003)(6506007)(26005)(83380400001)(5660300002)(66946007)(4326008)(66556008)(6916009)(8936002)(316002)(41300700001)(66476007)(8676002)(9686003)(6512007)(6666004)(6486002)(54906003)(478600001)(2906002)(38100700002)(82960400001)(85182001)(86362001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?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4NnJlP9U2XgTpe2Pk9wSqkBzmVoi8lMkktBx1ce45O+BNhPT73WFE+I8VqY0cEe3nah/+ne8Ri5Ey0qMoh9zaObQyU/ZFkPGiyk5iVJSmIUe9Uotv9CMk+Q+MqKz72/ZN8JirA7VnsOEOjLlpUcF6E7s2kM8Mql2UgUJj2s4F9bgcbbGba+gyrsk7fiOYOeggiuT2EPgIkaNaXTfA/lH1MSQmTjypDuCSuZdsjfd3kclpyx5oICyauJEJ6wxrOo5Zwjve2iL90mo6tJlUQ3SCYQ3U/aHBQMzdcDeaxSXbbwPV3iUYNQ0+skcy0TcjFANHPICPacJLQ6Ug/Wx8xkoiScO09OxQc2UJFz+wghcOSrXMcFfgN0X3I6jODh0AZFzIH6ApE3kr1ICnFtIsz3wpaVT8IiG4A==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 739b906e-0e3e-492d-d747-08db8dbb9b5b
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 09:35:11.3092
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: pH99//EslV0OfDghoJHt+l0scqketwqVIy/iplB1Ao3v0KOq6wAbtfWc/nRegZoN5n0K8yaRNAydRFhtEb9VDA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR03MB7265

On Wed, Jul 26, 2023 at 01:17:58AM +0000, Volodymyr Babchuk wrote:
> 
> Hi Roger,
> 
> Roger Pau MonnÃ© <roger.pau@citrix.com> writes:
> 
> > On Thu, Jul 20, 2023 at 12:32:31AM +0000, Volodymyr Babchuk wrote:
> >> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> >> @@ -498,6 +537,7 @@ void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
> >>          ASSERT(data_offset < size);
> >>      }
> >>      spin_unlock(&pdev->vpci->lock);
> >> +    unlock_locks(d);
> >
> > There's one issue here, some handlers will cal pcidevs_lock(), which
> > will result in a lock over inversion, as in the previous patch we
> > agreed that the locking order was pcidevs_lock first, d->pci_lock
> > after.
> >
> > For example the MSI control_write() handler will call
> > vpci_msi_arch_enable() which takes the pcidevs lock.  I think I will
> > have to look into using a dedicated lock for MSI related handling, as
> > that's the only place where I think we have this pattern of taking the
> > pcidevs_lock after the d->pci_lock.
> 
> I'll mention this in the commit message. Is there something else that I
> should do right now?

Well, I don't think we want to commit this as-is with a known lock
inversion.

The functions that require the pcidevs lock are:

pt_irq_{create,destroy}_bind()
unmap_domain_pirq()

AFAICT those functions require the lock in order to assert that the
underlying device doesn't go away, as they do also use d->event_lock
in order to get exclusive access to the data fields.  Please double
check that I'm not mistaken.

If that's accurate you will have to check the call tree that spawns
from those functions in order to modify the asserts to check for
either the pcidevs or the per-domain pci_list lock being taken.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 09:39:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 09:39:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570253.891930 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOazV-0006ub-6s; Wed, 26 Jul 2023 09:39:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570253.891930; Wed, 26 Jul 2023 09:39:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOazV-0006uU-3O; Wed, 26 Jul 2023 09:39:33 +0000
Received: by outflank-mailman (input) for mailman id 570253;
 Wed, 26 Jul 2023 09:39:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=cZQN=DM=citrix.com=prvs=564d97ffe=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qOazT-0006uO-UC
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 09:39:31 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4fe8d212-2b98-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 11:39:29 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4fe8d212-2b98-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690364369;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=afQNycwQ8SL8jHDWJIWPGZ08pAZH9RO4t59kJB4zMWo=;
  b=ZLkT0vZqK722PdeoR5pQzsjaDEr/qZx69UShUX8bwsaBby7O7JCHAWr2
   mfYNHWsJ9moQnkUvP4Nv6X0dHIxXTuthdvi+ovlHMaqOvAxpaLM84FaOO
   t8lfuK38Mwv1sBh8K6NZqMN+JlZde25HqcETjyJr+8gGLKfuaBLBSRFlo
   0=;
Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 117916674
X-Ironport-Server: esa1.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:MhnJoaqyXUPu7XnRYhhRBfcyG6xeBmIYZRIvgKrLsJaIsI4StFCzt
 garIBmEOPrbZzTwL4siYI2/8R8Hv5PSzoAwGwBtpH1hHi9DoJuZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weBzSRNVvrzGInqR5fGatgMdgKFb
 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo
 OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay
 RAXABQETEmCmfCb+6rhWOdFo/8vFPGsOrpK7xmMzRmBZRonaZXKQqGM7t5ExjYgwMtJGJ4yZ
 eJAN2ApNk6ZJUQSZBFOUslWcOSA3xETdxVxrl6PqLVxyG/U1AFri5DmMcbPe8zMTsJQ9qqdj
 jufoDWgXE9FaLRzzxK6/UD1tOLLuhncUa9DH62V989Fr3a6kzl75Bo+CgLg/KjRZlSFc8JSL
 QkY9zQjqYA29Ve3VZ/tUhugunmGsxUAHd1KHIUS6guA167V6AaxHXUfQ3hKb9lOnNAybSwn0
 BmOhdyBONB0mOTLEzTHrO7S9G7sf3FPdgfueBPoUyMh6vu6oZ8hoynXFMRtOYuOguXNXjfJl
 mXiQDcFu1kDsSIa//zlrAic2233+Mmhoh0dvVuOAD/8hu9tTMv8PtHztwCGhRpVBNzBJmRtq
 kTojCR3AAomKZiW3BKAT+wWdF1Cz6bUaWaM6bKD8nRIythMx5JAVdoKiN2GDB01WvvogBewC
 KMphStf5YVIIFyhZrJtboS6BqwClPaxTY+9B6CEN4EfM/CdkTNrGgk0PiZ8OEi0zSARfVwXY
 8/HIa5A815EYUiY8NZGb7hEiuJ6rszP7WjSWYr633yaPUm2PRaopUM+GALWNIgRtfrUyDg5B
 v4Db6NmPT0DCryhCsQWmKZPRW03wY8TXM2r9p0NKbPfemKL2ggJUpfs/F/oQKQ994w9qwsC1
 ijVtpNwoLYnuUD6FA==
IronPort-HdrOrdr: A9a23:boX9RK0pE7CyRpYUCRcFOAqjBIgkLtp133Aq2lEZdPU1SKClfq
 WV98jzuiWatN98Yh8dcLK7Scq9qALnlKKdiLN5Vd3OYOCBghrLEGgI1+vfKlPbakrD398Y+a
 B8c7VvTP3cZGIK6/oSOTPIdurIFuP3lJyVuQ==
X-Talos-CUID: 9a23:KxIFCm2c5XPKsNAsc3qwCrxfPskHK3zD3lrrOxWqB09Mc7GtcRiWwfYx
X-Talos-MUID: 9a23:b8Q71QsBqxQS2+naDM2nuz5QbfVl54OUL0kgwJ4Wlsi1GgNbEmLI
X-IronPort-AV: E=Sophos;i="6.01,231,1684814400"; 
   d="scan'208";a="117916674"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
	<jbeulich@suse.com>, Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>, Wei Liu
	<wl@xen.org>
Subject: [PATCH v2] x86/cpu-policy: Advertise MSR_ARCH_CAPS to guests by default
Date: Wed, 26 Jul 2023 10:39:18 +0100
Message-ID: <20230726093918.2418025-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <4025d346-848b-730e-38a3-de7763edcf39@suse.com>
References: <4025d346-848b-730e-38a3-de7763edcf39@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

With xl/libxl now able to control the policy bits for MSR_ARCH_CAPS, it is
safe to advertise to guests by default.  In turn, we don't need the special
case to expose details to dom0.

This advertises MSR_ARCH_CAPS to guests on *all* Intel hardware, even if the
register content ends up being empty.

  - Advertising ARCH_CAPS and not RSBA signals "retpoline is safe here and
    everywhere you might migrate to".  This is important because it avoids the
    guest kernel needing to rely on model checks.

  - Alternatively, levelling for safety across the Broadwell/Skylake divide
    requires advertising ARCH_CAPS and RSBA, meaning "retpoline not safe on
    some hardware you might migrate to".

On Cascade Lake and later hardware, guests can now see RDCL_NO (not vulnerable
to Meltdown) amongst others.  This causes substantial performance
improvements, as guests are no longer applying software mitigations in cases
where they don't need to.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>

Not to go in before Roger's libxl changes...

v2:
 * Extend the commit message.
---
 xen/arch/x86/cpu-policy.c                   | 11 -----------
 xen/include/public/arch-x86/cpufeatureset.h |  2 +-
 2 files changed, 1 insertion(+), 12 deletions(-)

diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c
index f40eeb8be8dc..1f954d4e5940 100644
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -888,17 +888,6 @@ void __init init_dom0_cpuid_policy(struct domain *d)
     if ( cpu_has_itsc )
         p->extd.itsc = true;
 
-    /*
-     * Expose the "hardware speculation behaviour" bits of ARCH_CAPS to dom0,
-     * so dom0 can turn off workarounds as appropriate.  Temporary, until the
-     * domain policy logic gains a better understanding of MSRs.
-     */
-    if ( is_hardware_domain(d) && cpu_has_arch_caps )
-    {
-        p->feat.arch_caps = true;
-        p->arch_caps.raw = host_cpu_policy.arch_caps.raw;
-    }
-
     /* Apply dom0-cpuid= command line settings, if provided. */
     if ( dom0_cpuid_cmdline )
     {
diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/public/arch-x86/cpufeatureset.h
index ce7407d6a10c..6d20810cb9d1 100644
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -271,7 +271,7 @@ XEN_CPUFEATURE(AVX512_FP16,   9*32+23) /*A  AVX512 FP16 instructions */
 XEN_CPUFEATURE(IBRSB,         9*32+26) /*A  IBRS and IBPB support (used by Intel) */
 XEN_CPUFEATURE(STIBP,         9*32+27) /*A  STIBP */
 XEN_CPUFEATURE(L1D_FLUSH,     9*32+28) /*S  MSR_FLUSH_CMD and L1D flush. */
-XEN_CPUFEATURE(ARCH_CAPS,     9*32+29) /*!a IA32_ARCH_CAPABILITIES MSR */
+XEN_CPUFEATURE(ARCH_CAPS,     9*32+29) /*!A IA32_ARCH_CAPABILITIES MSR */
 XEN_CPUFEATURE(CORE_CAPS,     9*32+30) /*   IA32_CORE_CAPABILITIES MSR */
 XEN_CPUFEATURE(SSBD,          9*32+31) /*A  MSR_SPEC_CTRL.SSBD available */
 
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 09:48:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 09:48:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570256.891940 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOb8H-0008QM-1i; Wed, 26 Jul 2023 09:48:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570256.891940; Wed, 26 Jul 2023 09:48:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOb8G-0008QF-VD; Wed, 26 Jul 2023 09:48:36 +0000
Received: by outflank-mailman (input) for mailman id 570256;
 Wed, 26 Jul 2023 09:48:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOb8F-0008Pz-4j
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 09:48:35 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on20627.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::627])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 959cf06b-2b99-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 11:48:34 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB7771.eurprd04.prod.outlook.com (2603:10a6:10:1e6::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 09:48:32 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 09:48:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 959cf06b-2b99-11ee-b242-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=L7XQOgIpGjrtyJqcILuwTFyUvAzNdE7PqZ2O8OH1pe/O6C57D+8kGJww1J/3c6yN42qnYh1THRkl+hIdiTH5VWl75COY/n8rB1cX4lISBarzhgMtJdhVheSzzfh2/mM1ziqWJcy0q2/JqtGak6FLfnj6aPIm4Lw25Or/MhDQzn/2q6rxbyCeeui6FGlTxNnMqGIdTncVmz0aGpBjEC8fvOImuxWDGAOh/QYa7km6VoDnrJlatdGsu3gx42NUH190IuvVTMoAvlaGmCcTY6naLS2vwb0Kw5l5LNyWWT8tVsyvmQT25ZRigs7BLdbekZMTIqP8XmKG8f/J+5h5hAu4yw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=rrCzlX0qMBt5gC+20+ygP/ys8E1TGMb1XcnnG2jJBrg=;
 b=ahT41bwFGhKF9RRI7VpTn8ugVQEyBLss+mteRsOnSuTG2gOFlpRatdayGF8zTAxNzJskVvtSQnbwsCBw2WtroN669hjvWCyPbMZeGa2P0x3iieTnuy5woQpuBurlzws64178bF+9pIMSa3wAdVevyND7OoCXJ9rRzJ0rn3Aj8HmZ+hqmh+bBt6UPFJn6cMEXtMrXd3cEJZz1pF+IcIeVIUf3TaJ505mjq5dtMaiY0A58lC0qhbhv25mi7QWkJf/wCXXd+hYp1kMe0V9mCT6gqO9N9St4Wim12x8TLrIh+v2sz3djDPI+dcWvs/6CuA4eiup0Jgjb3e+DkVPbd0Ci0g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=rrCzlX0qMBt5gC+20+ygP/ys8E1TGMb1XcnnG2jJBrg=;
 b=SKhFUBn3eYPhhmvex7Re43I4cXGgGumJcFut7fm+P/ac7eF+XDdF/MZC7nrvDwkNHFa00cM0PoE+AjpkoWY039p7EI962P5NNxIBOs8eCruDwu2QaOaC7Th++hAflxHpeC9/bmw0nlyiJYmbwOfP/pV9hmQgULtQh1YF0A8pfIUZQh2VM0mC/nx0WO+OW7y5vkEQ1/cpSURNUAU8gy21quvAegsGuvcViRKFd5D6HtPrpwWM3KW+vToMYXxEHLIB2hr1HGCP8/8VK53zUBYkH//M++g14+XgRopzMpzGmOIQQqJYJGVz9YrDvJJOQoaZOcdqYVzGNC87s7r8tEIqqQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <95bc8788-fa37-0dd6-8380-6a05ea57a0a4@suse.com>
Date: Wed, 26 Jul 2023 11:48:29 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v2] xen: use parameter name 'mcs' in
 arch_do_multicall_call()
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <e71bac85a2b7f92a6438f97048cc6cddc917768d.1690362993.git.federico.serafini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <e71bac85a2b7f92a6438f97048cc6cddc917768d.1690362993.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0106.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a3::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB7771:EE_
X-MS-Office365-Filtering-Correlation-Id: 447e7bce-1107-4639-6bc7-08db8dbd78e7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	qJnPlGnbdx5ZDvDCuzq/kP0DyQm6fmfdiPp2NAJhzHJrXbg5OumeC3tUnuPVWTGlsHulzx2+pEYjS8UUlP2zF1yzsLQIC2wDTndz1PgsEpHfCoNRnaoh1IvMG2guyGH/LrbwHDWOnnAHHGLUPSdBJjiWWDKsE0+mbeN8Z1034oali46/KubCfEAQUXCwYHI4F9cAYP12UQetD9cE+lVjXrOOFAQItlOQrhawZ4VyMhNw+eQruYxemdy00rYEUMVOAXZNiWvYhMT8ZYjMs+znbt0/yqRa/ixoYZXWWD3u7iKvdX0FHFqY8zUPcFqnODzh+UjcJAb40/vNUkIoOM+HkVlGnC6wU6NdiQCmR6+4aaBUtg444uvLm2JGY3wwjzWr29gXkrEqpamfGtSr8c27OXhdsTGHRQ0DCmRpQp9ioexgiV0PZelGrZtEwcQvenEpCyYEzvaBkK23r2eM7MieIb27kPrCRV29DTMf/ffv6/RkcdPAp3A5hHdLsnFmnbaaTLsNnyaYQvN8ksluMcqKOEJBMcTx3dgjxa5SzAZwb9HBjbJH3Nzw4TEG5onaHg6E0Q73TzKYlUHXgQM9YDRIiBRDMpkjYxLQgHH5mdxztf9nKBPOKQ3241xkSpNn+yYG8P5obgR+sNJOj7/OEw6jIA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(396003)(39860400002)(376002)(366004)(346002)(451199021)(31686004)(6512007)(6486002)(54906003)(478600001)(6666004)(36756003)(86362001)(31696002)(4744005)(2906002)(66556008)(2616005)(66476007)(53546011)(186003)(6506007)(26005)(38100700002)(66946007)(6916009)(316002)(4326008)(41300700001)(8936002)(8676002)(7416002)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NkRqOWpSK0wxTEhpRVViSkErSHh0elhuYXdXak1EbW40Nzhid1l1RWgveUpF?=
 =?utf-8?B?aGZBc0ZFa0tSOUNUQUFYU2JwbTRpS2d1KzZQbXVkTmhlYzlFY0J6S1B3eFpD?=
 =?utf-8?B?ME54TDZUTDlrejV0elUrR1F3M3RKblRIcWliREw2T21oNHB5OVFnbHNZbWE2?=
 =?utf-8?B?aXB0L2s5dzg5QlJ6M2o3MjM1NjI1ZWlhaHNrNERkTGhyRktVdWZRUGZ5enNx?=
 =?utf-8?B?cEdWR0QvQytHb3VjeFMvODhIaEFiNzZoSHRIRjVkNFNSaTRBL3Z1UFBwTEFP?=
 =?utf-8?B?eVBHWVhId0FqNlcvYXRzVkNQUXJ2eVJXOHVBYzd6b1VGa2h2VlZxUGJxY2xm?=
 =?utf-8?B?aUZ6V2ZWWThGTWI2UGduTDR1bGxiQzNrc2prMlpabTVBbllTc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ginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 447e7bce-1107-4639-6bc7-08db8dbd78e7
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 09:48:32.0909
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: f8jbiZhETgQt9bpMw6nDQEBQvtR/4sM+x6qcB3+N4Zu/D1PRhWjmlPk+AKJVvPcFcSHlUdIFi8qfxmv/q0OsHg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7771

On 26.07.2023 11:34, Federico Serafini wrote:
> Make function declaration and definition consistent using the same
> parameter name ('mcs' do denote a pointer to an 'mc_state').
> This addresses a violation of MISRA C:2012 Rule 8.3: "All declarations
> of an object or function shall use the same names and type qualifiers".
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 10:08:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 10:08:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570260.891949 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qObRW-0002bY-RI; Wed, 26 Jul 2023 10:08:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570260.891949; Wed, 26 Jul 2023 10:08:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qObRW-0002bR-Oe; Wed, 26 Jul 2023 10:08:30 +0000
Received: by outflank-mailman (input) for mailman id 570260;
 Wed, 26 Jul 2023 10:08:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CD/9=DM=citrix.com=prvs=564dce665=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qObRV-0002bL-Bg
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 10:08:29 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5c22f1ca-2b9c-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 12:08:27 +0200 (CEST)
Received: from mail-dm6nam04lp2040.outbound.protection.outlook.com (HELO
 NAM04-DM6-obe.outbound.protection.outlook.com) ([104.47.73.40])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 26 Jul 2023 06:08:24 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by DM6PR03MB5324.namprd03.prod.outlook.com (2603:10b6:5:24c::22) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Wed, 26 Jul
 2023 10:08:22 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023
 10:08:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5c22f1ca-2b9c-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690366107;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=v583aDy8zZS0zxJwtcisrDeikqyUV9Gr34UD6YLrM2M=;
  b=a7LSZhYZwJQMRVOthp4B49ow+ctNySO+oOLJU/Xj17riVoYI5DgP+NlJ
   e+A85SGblmO1Ni9Lq8LvrOi5oDEBk/+yFNxk1Z7DRHuWfpL83Eg/vQu7x
   vK5ef/25O0iFAOJdVaqEnLo/oNcrMmrvi6AfB02dDAMUnhv+S2hQSXA+L
   s=;
X-IronPort-RemoteIP: 104.47.73.40
X-IronPort-MID: 117363276
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:42Xp8q72SbZoe1CRdmeXZQxRtPvGchMFZxGqfqrLsTDasY5as4F+v
 jMbDGqBO/jYMDD2ftp2Odu/9koA7JfTydQwSQpp+S8wHi5G8cbLO4+Ufxz6V8+wwm8vb2o8t
 plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraCYnsrLeNdYH9JoQp5nOIkiZJfj9G8Agec0
 fv/uMSaM1K+s9JOGjt8B5mr9lU35ZwehBtC5gZlPa8R4QeE/5UoJMl3yZ+ZfiOQrrZ8RoZWd
 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4
 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5m7
 txBdRkRNEG/u/u1+L2GTe91ifgzBZy+VG8fkikIITDxK98DGcyGb4CUoNhS0XE3m9xEGuvYa
 4wBcz1zYR/cYhpJfFAKFJY5m+TujX76G9FagAvN+exrvC6Ml0otiNABM/KMEjCObd9SkUuC4
 HrP4kzyAw0ANczZwj2Amp6prraWwnilA9hNStVU8NZRsVqOnl4sKycGfmv88OuXjUike/Fmf
 hl8Fi0G6PJaGFaQZtv3UgC8oXWElgUBQNcWGOo/gCmSzoLE7gDfAXILJhZCZcInsokqRDUs/
 l6Pg97tQzdotdW9UXuA8p+EoDX0PjIaRUcSaClBQQYb7t3LpIAokgmJXttlCLSyjND+BXf32
 T/ikcQlr7AajMpO26Dl+1nC226ovsKRElZz4RjLVGW46A8/fJSie4Gj9Vnc67BHMZqdSV6C+
 nMDnqBy8dwzMH1ErwTVKM1lIV1jz6/t3OH06bK3I6Qcyg==
IronPort-HdrOrdr: A9a23:Ty+vp6qiloiJ7A/KrzoChqoaV5oveYIsimQD101hICG9JPbo8/
 xG/c566faasl0ssR0b8+xoW5PgfZq/z/FICNIqTNKftWDd0QOVxedZgLcKqAePJ8SRzIJgPQ
 gLSdkYNDVdZ2IK7voTQWODYrQd/OU=
X-Talos-CUID: 9a23:aGN+gWMG6u8++e5DQwk+qWcIQJEZTmTe9HjtJEmhBlp5YejA
X-Talos-MUID: =?us-ascii?q?9a23=3ACqY8ow27iYLG8W6XQ43G3V2+uDUj2JWpFRg/rrY?=
 =?us-ascii?q?8q+K0cn1iFTCblhSUe9py?=
X-IronPort-AV: E=Sophos;i="6.01,231,1684814400"; 
   d="scan'208";a="117363276"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=D5PBKeqUQTQC/EhWfyuXqm780wNp3wClTTIlXlBVEMDTeS+XdG7IKwYO4cew5C0dhu9YLd3Zca99jHox7jTIiohjxNFAsdMy9hjDRDMsmrvvB0laWfYoEL5/Lh9ej65tAzwBWt37VPLfq2JFRYP20kLx3ithMmDesr54ykqW9tAo21loem6SVb2ANAHVHGne5ucaWf85OgkUsiPuAf5FAM6wGOYXewh+EEMucxGjgeEnt/gBN0WGmOan0RFYHT/kNA6rgaDK7v+s2aWq0SflrDVntqxftIYSkT8x25t7Cqqi1jaPLc5ZscjnQuG+34m0j3DPsG4t5oC882ivzXEahg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=wC6chUNrgyfNv0/hreGukj96USzDpkoCgiDxE/KSRWc=;
 b=c7biTNsXACiFRnPRsw+LVehAURhn9JZUXrxP7BDD5H3NmJ44JZLMJQHGII/9wWupDUcLr2LyxmWoZpDZTqp1A0EvVIwqhDcKon/MzIXuoSPjlN5KEgZv9JQNqufV+ovyfuuKFp3JWoTZnf1wjedRvhXq6HVAwGIja+JzBZKa5w1qCDXR5UPB+XzsQY5pL0l53ufa7q9s+rxycfx6z3V9pRgDVfhs1SrW0+lopblbftqHZ/4zyXcU4L9O4NZ3hyF61PB4En3pEg2pmYItHxQ8kmoXRYJtjGQgNz7VCIM7dWRykfJBWvy60iRh74zFV/A22V/XKNCRdqj/MDZoZ0yxCg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=wC6chUNrgyfNv0/hreGukj96USzDpkoCgiDxE/KSRWc=;
 b=ghfNQ5kWzXykWJqfUBGIH9wM0Fec+CVr3n8Ma1qBCqroLnPVpbI12YWWNdCs17h+4CdW225POiPVQuYMFT6RG0dAqMjJbbAfFxSoNtNsb5+F1s3kgpPBmiSLvVAmbCvNf3O2Zisa1+m2WGKRFFIkZM0Gjf1UCSf5wnJJElAq7zg=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Wed, 26 Jul 2023 12:08:15 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	Kevin Tian <kevin.tian@intel.com>, Paul Durrant <paul@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 4/5] x86/iommu: pass full IO-APIC RTE for remapping
 table update
Message-ID: <ZMDwj0ucZjsr_-dr@MacBook-Air-de-Roger.local>
References: <20230718124334.36548-1-roger.pau@citrix.com>
 <20230718124334.36548-5-roger.pau@citrix.com>
 <cddab03e-dd17-c684-71cd-5476ffbc0b4d@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <cddab03e-dd17-c684-71cd-5476ffbc0b4d@suse.com>
X-ClientProxiedBy: LO4P123CA0017.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:150::22) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|DM6PR03MB5324:EE_
X-MS-Office365-Filtering-Correlation-Id: 62b1fdf3-fdbf-4be0-d767-08db8dc03e07
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	+RIGWWTm4Cgbdyp4m/rjV/SBMxGzeHALhf5M3DyZbOKvukscBI0ovqYdWQEvHY8sueAQ2R0xqtd1CaWMx7EifS84R+L6A4PuPRGHxOVjvumZeSgGeYhRRYLWzHnYQvCFV4t24Z1lLNg01nYAKvxdxtn1N7q015M5M0ElK8y3Uy4BTZI5qCu7CpRuDu4a3QZg4XLr4yFFN2JC6A0DbCS7GHN6J2SOl/vgYdR6LH5XqCVOG6v9NqyZvjEZYYlCvpnc1rAq9tC92qInONAs9Rx7bMahyN9GAisOH9vxXhu9xmgdRNiEfeOcTVDC8+iU0HMdxI70+R5a9uwcf0yogt259pdouXoDHgyJT681Nkk4CWXuUa5+KO7qzPM74l3BICmR6LbpoW13nYtkXSyRtUGwwOMt8wXq9fJG3VzDrO3TlhHrk0sLarAr4P1oVkqVN7xuq/8ilHLQHMfDKL1Tt3ypSYePiGD8pXBbSfCOrevASlf8OhGXs3u/4UK62vZ1loNwap4wHxYuIhuQm343PjKbWdji4nHaktvRBhIwsikv5j2IbIAI3T0wj5iM4dU135tY
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(39860400002)(136003)(366004)(396003)(451199021)(186003)(6506007)(53546011)(26005)(83380400001)(478600001)(82960400001)(54906003)(6666004)(86362001)(66556008)(85182001)(6486002)(316002)(41300700001)(66476007)(4326008)(6916009)(2906002)(66946007)(8936002)(8676002)(38100700002)(15650500001)(5660300002)(6512007)(9686003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dkp4KzdrZzhOYmNxWE9pNCt0aTFDZlRKMzU2SW9FQ1diTmor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NU3RQNerCDiQEHGyq2s4xQ/4vqImrMcxkRgnW/CZkRvCkENKW7C3bY4Gz5tbQfVaEemFFEoz0L1XY7LKdQ4Gu94nJtQ+zS0erIzvSe8MFKWVQ3iiQirgrtgiXnhfy6AVI6ZIZgewXwBQu7zKQAD+CyJpni3dnQP8V6A1IzN7d7bOb1zMdhViIOTeg0RXAw7Br+62JgPEysoTTb2xCCxDTm+58mD9M1fyNif2skWVGWS1YY7R+w44lndrilHlnJGmFhah0KY8zwqrMMDn3ktyQPzhk6f2IrHLKHs4o7iXCBaDJMQoQep7OOHmeM3emEbx3SPpNmXyJ1rRFtrhVODwrRFDpixdUtYzU+chS/dsCI5zY0PqfN998yiuFw=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 62b1fdf3-fdbf-4be0-d767-08db8dc03e07
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 10:08:22.0355
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: LrnHl2436ZMU3YvxzVjrXUAZ7KlBVWgBOqDHzAf1jJLVfW532oYtXg42E90mQU5t6pjkHZu7sxep8c/hPxidiA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB5324

On Wed, Jul 19, 2023 at 12:37:47PM +0200, Jan Beulich wrote:
> On 18.07.2023 14:43, Roger Pau Monne wrote:
> > @@ -439,36 +427,47 @@ unsigned int cf_check io_apic_read_remap_rte(
> >  }
> >  
> >  void cf_check io_apic_write_remap_rte(
> > -    unsigned int apic, unsigned int reg, unsigned int value)
> > +    unsigned int apic, unsigned int pin, uint64_t raw)
> >  {
> > -    unsigned int pin = (reg - 0x10) / 2;
> > +    struct IO_xAPIC_route_entry rte = { .raw = raw };
> >      struct IO_xAPIC_route_entry old_rte = { };
> >      struct IO_APIC_route_remap_entry *remap_rte;
> > -    unsigned int rte_upper = (reg & 1) ? 1 : 0;
> >      struct vtd_iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic));
> > -    int saved_mask;
> > -
> > -    old_rte = __ioapic_read_entry(apic, pin, true);
> > +    bool masked = true;
> > +    int rc;
> >  
> >      remap_rte = (struct IO_APIC_route_remap_entry *) &old_rte;
> >  
> > -    /* mask the interrupt while we change the intremap table */
> > -    saved_mask = remap_rte->mask;
> > -    remap_rte->mask = 1;
> > -    __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
> > -    remap_rte->mask = saved_mask;
> > -
> > -    if ( ioapic_rte_to_remap_entry(iommu, apic, pin,
> > -                                   &old_rte, rte_upper, value) )
> > +    if ( !cpu_has_cx16 )
> >      {
> > -        __io_apic_write(apic, reg, value);
> > +       /*
> > +        * Cannot atomically update the IRTE entry: mask the IO-APIC pin to
> > +        * avoid interrupts seeing an inconsistent IRTE entry.
> > +        */
> > +        old_rte = __ioapic_read_entry(apic, pin, true);
> > +        if ( !old_rte.mask )
> > +        {
> > +            masked = false;
> > +            old_rte.mask = 1;
> > +            __ioapic_write_entry(apic, pin, true, old_rte);
> > +        }
> > +    }
> >  
> > -        /* Recover the original value of 'mask' bit */
> > -        if ( rte_upper )
> > -            __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
> > +    rc = ioapic_rte_to_remap_entry(iommu, apic, pin, &old_rte, rte);
> 
> I realize it has been like this before, but passing &old_rte here is
> odd. We already have its properly typed alias: remap_rte. All the
> called function does is do the same type cast again. Question is
> whether ...
> 
> > +    if ( rc )
> > +    {
> > +        if ( !masked )
> > +        {
> > +            /* Recover the original value of 'mask' bit */
> > +            old_rte.mask = 0;
> > +            __ioapic_write_entry(apic, pin, true, old_rte);
> > +        }
> > +        dprintk(XENLOG_ERR VTDPREFIX,
> > +                "failed to update IRTE for IO-APIC#%u pin %u: %d\n",
> > +                apic, pin, rc);
> > +        return;
> >      }
> > -    else
> > -        __ioapic_write_entry(apic, pin, true, old_rte);
> > +    __ioapic_write_entry(apic, pin, true, old_rte);
> 
> ... the further uses of old_rte then won't end up yet more confusing
> than they already are (first and foremost again because of "old" not
> being applicable here).

I've instead opted to remove remap_rte from io_apic_write_remap_rte(),
as it was unused.  I've also added a comment to clarify the usage of
old_rte when ioapic_rte_to_remap_entry() returns success.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 10:21:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 10:21:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570265.891960 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qObda-00050p-Vu; Wed, 26 Jul 2023 10:20:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570265.891960; Wed, 26 Jul 2023 10:20:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qObda-00050i-SV; Wed, 26 Jul 2023 10:20:58 +0000
Received: by outflank-mailman (input) for mailman id 570265;
 Wed, 26 Jul 2023 10:20:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=O1Wu=DM=arm.com=Hongda.Deng@srs-se1.protection.inumbo.net>)
 id 1qObdZ-00050W-0y
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 10:20:57 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on061d.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::61d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1a8413cc-2b9e-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 12:20:55 +0200 (CEST)
Received: from DUZPR01CA0163.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4b3::25) by GV1PR08MB7986.eurprd08.prod.outlook.com
 (2603:10a6:150:9e::16) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Wed, 26 Jul
 2023 10:20:52 +0000
Received: from DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4b3:cafe::b6) by DUZPR01CA0163.outlook.office365.com
 (2603:10a6:10:4b3::25) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29 via Frontend
 Transport; Wed, 26 Jul 2023 10:20:51 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT013.mail.protection.outlook.com (100.127.142.222) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6631.29 via Frontend Transport; Wed, 26 Jul 2023 10:20:51 +0000
Received: ("Tessian outbound f5de790fcf89:v145");
 Wed, 26 Jul 2023 10:20:51 +0000
Received: from 6b26572f93bf.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 8102DD6F-CDD5-4579-9E7F-F993A0B46C99.1; 
 Wed, 26 Jul 2023 10:20:40 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6b26572f93bf.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 26 Jul 2023 10:20:40 +0000
Received: from DU0PR08MB7664.eurprd08.prod.outlook.com (2603:10a6:10:315::5)
 by DBBPR08MB5995.eurprd08.prod.outlook.com (2603:10a6:10:20b::10) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 10:20:37 +0000
Received: from DU0PR08MB7664.eurprd08.prod.outlook.com
 ([fe80::cab8:a6f0:2154:bfe9]) by DU0PR08MB7664.eurprd08.prod.outlook.com
 ([fe80::cab8:a6f0:2154:bfe9%7]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 10:20:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1a8413cc-2b9e-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=JbEJPUGjsyryRbDAnuvh67rnSBq3+uUXFpvjgJi7cXM=;
 b=s4XxmSBj+48expwpTUNa51Yh3Uu5TlFidvHxcQ7iA7t3j4FRpsQ9VZ/Y9M2Sg/75ULiKiW0Iwe9piEC6hjVCczYo77+D8AjAphcgAe0JjjqmiZ32Zl5sI+pZ0q35ZXKqh+sBErZ9BQhIyIsxWrxyk1qSHss/h38qOhiwpU0w89M=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 5b6146215ea4feee
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=bCx5kToR0Q5tXAyVF7XpIGPs+qrOlbpsG4TghPjLisy3ZVvowHuNjtZkbPoO3vJBAHmHXgfY1gjaWayo2U8/hMjxotqA3HzPR98tdS7ZzRd+jSjtOVBX/ADRqp5kjHvfWmZ+7a5txy/gciAbgRK/pcH/7BGYzgtdXHh8UYO3Q8QaqdxSuGkBgZNEOJeOYPA9S9Iy1mv7CE8BwzXPiXQcjvHKnAbGoE79mA7/sy8gVVeM9pIPP3Oex/5ArlbIprl/9D7KWB4rzK/8AdSWHo/XFN7M3YRTzFe1EK5iicQ1DrMDOe96GeeYZBb/pDgLg7uNU6oLPg0BjWP33iI4hPXIkQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=JbEJPUGjsyryRbDAnuvh67rnSBq3+uUXFpvjgJi7cXM=;
 b=L0XH0Ug5/DU6uIpAXlX5RukYTNwUyrMQ9Y60LnufQcN7qUex61eYZ/Ai2w/KaNRbVNwr0CEQq554kepZPNHvb85aUY1ptNcv9isKwriT2C6lu7oz72Vk/h/ne3XQ09Z15M6/8OoxGjXZ/mT8v1PAa+xbsHhTQQhSog/NSfWB+WrsKSKA9Pv8bBUnIGXn/GJuYBOsEG62kByCpInrIcxcvdzf6PBuLxIj6E2G0f5SChv3a7WbHOgbvpzQPKVTuuzvvt/u8OZ7ayRFi4kWJeRLFQ4xECFXxq3gBzkpx4QoIjM9eSQtnlaJWC+9C4yaJR14kDYHTiy8810YgVlCO71n5Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=JbEJPUGjsyryRbDAnuvh67rnSBq3+uUXFpvjgJi7cXM=;
 b=s4XxmSBj+48expwpTUNa51Yh3Uu5TlFidvHxcQ7iA7t3j4FRpsQ9VZ/Y9M2Sg/75ULiKiW0Iwe9piEC6hjVCczYo77+D8AjAphcgAe0JjjqmiZ32Zl5sI+pZ0q35ZXKqh+sBErZ9BQhIyIsxWrxyk1qSHss/h38qOhiwpU0w89M=
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
Message-ID: <27ac40a8-4d9c-b55f-f7cc-506df8188400@arm.com>
Date: Wed, 26 Jul 2023 18:20:27 +0800
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v5 1/2] tools/console: Add escape argument to configure
 escape character
Content-Language: en-US
To: Peter Hoyes <peter.hoyes@arm.com>, xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com, wei.chen@arm.com, luca.fancellu@arm.com,
 Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230712102917.37763-1-peter.hoyes@arm.com>
 <20230712102917.37763-2-peter.hoyes@arm.com>
From: Hongda Deng <hongda.deng@arm.com>
In-Reply-To: <20230712102917.37763-2-peter.hoyes@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: SI2PR04CA0002.apcprd04.prod.outlook.com
 (2603:1096:4:197::17) To DU0PR08MB7664.eurprd08.prod.outlook.com
 (2603:10a6:10:315::5)
MIME-Version: 1.0
X-MS-TrafficTypeDiagnostic:
	DU0PR08MB7664:EE_|DBBPR08MB5995:EE_|DBAEUR03FT013:EE_|GV1PR08MB7986:EE_
X-MS-Office365-Filtering-Correlation-Id: 40c00d15-ee8c-4e28-825d-08db8dc1fcd3
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 xhcD2rlctzq6tbJTxiLQ5tFrcimlZZi6dcg0OegKJ3C22VKcBUpfMg75n3CZTm5TwS+DGbhLCi9JZR+iM9eTprUKf6Km6BBPRpN2qB/8xfdvsmU5eILotDWNoR64g3Sen7kJZg7bnY9cF8UqAh2WYypLAHS2GD2GwcqpToK+O/xIC1kK9dp/tkWPxKmteL8yzyGSAEiQvlYMEh1f/WrXAhl806Q1o+AinLlsvUPpZU6Q/K7EYsXya7CGItW2eONcSEoNo1++JdTErxYk/OntxuDTaruMAvj/d9pbZciAS1VIBPSyRwVs+CF4eKtcj0S4B9f0vNvlUvOddSSUMX4H/iaiL7LV7U1SI4MVooMQydlR9MrFCUes7/6Tb4dM2xqzmO8tDqD1Itkfm6oYnrb58zLAcHopWSPUnWl0mt1+wJzsedHbNnvO2HPQA5rDL+WWRtb2kpYMDK6B+Yo5olAVhKF4cA2TqADoTnJY6Cl9s0wSyyU/4AasnlJuYazCWW+WAMlhZJelcpzfRfY/leY8AERosSo5Q914LqAOGTb8eT7LWFe+A3FlkNM9HCXso0ph6xZZtaEqZUlQwmBvTeHp/g1QTL3rXkQpjdjEVRI9YWdySEm5s7Zjdl3xRt2xjf+tOuk+HRWAZEwuK3eh/QeEBA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR08MB7664.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(376002)(136003)(346002)(366004)(451199021)(6666004)(6486002)(478600001)(83380400001)(53546011)(26005)(6506007)(6512007)(4326008)(54906003)(66476007)(66556008)(66946007)(186003)(2616005)(38100700002)(31686004)(44832011)(8676002)(8936002)(5660300002)(2906002)(316002)(41300700001)(86362001)(31696002)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB5995
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	44d87275-3908-439d-00a5-08db8dc1f3e3
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	cGQU98lfQEN5JXv64tfjLgN9Oy9TlsFOGiWV56tzFK6uuHKZnDcq/RrPbFo4bbzvMYrzwspQC3aUDoHJtCz3Urb80+iZm3sgyKd/5m884bgOEAv+SfhqrLsH65N/zNs3SANPoZ5iMMlNor3tntoR4Lautffaj4eDeNWkGHI4/pSLMBXIBxBc8SQ2Ln2m79h+AQwZE5ICOntrIudaKVIZPdVtzdFH9/8tZUsq+E4fhupUggyOgw3q9uMLGNGk5zHqbST56F2TMh0DqYP7LClG296sK+QkvDAa1qtkj3mjwVBJ8v1LBgOxkwS8aidc9eGkTybdPlSGYDRKSQzDXwIFPbNdXr3rZxTgs1/iZcYBc6UMfKJ4SIQ1NxUy+x8siR3mPZNn0DlnlxDn8NxjUC8794iihL/k9vX0v0abWhegBIGvE+6VNmul11FNsLyXahJDpcAcaREEBXKnXMa9egGOY9+yQHavrNnC6IMyEmd3Lxgx8wySv+ao01YwQft4AnJrKGGBTxhfE4qgXkrDGtwGdwHLT2TmdnNAKWQzOjwvKSbhjzM9YOFpvkO83RRa/AyndAmnT7fWuZt74VgHpLhpa+nDuI7ePpvmvTV91/a3LnjzP4sh/ZdvH5Pu6u1ywD8jcYWf+I+YRXgELsaBPYO+LeDSM0QarP3eyCPGNOfPHnd9BeKsrpUhJFAhc+l1zggZ60bINSuBjJN9pfHUdQgcaX6fGeROP5KztFwR0Cj0oQ/ymCKEyjbKldQn0/+BTyot40+R+QPCKzbyKu8PcB777g==
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(396003)(39860400002)(136003)(82310400008)(451199021)(40470700004)(46966006)(36840700001)(36756003)(86362001)(356005)(81166007)(31696002)(31686004)(82740400003)(40460700003)(40480700001)(478600001)(2906002)(54906003)(36860700001)(186003)(2616005)(26005)(6506007)(47076005)(336012)(53546011)(107886003)(41300700001)(8676002)(6666004)(6512007)(6486002)(5660300002)(44832011)(316002)(4326008)(70586007)(83380400001)(8936002)(70206006)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 10:20:51.2981
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 40c00d15-ee8c-4e28-825d-08db8dc1fcd3
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB7986


On 2023/7/12 18:29, Peter Hoyes wrote:
> From: Peter Hoyes <Peter.Hoyes@arm.com>
>
> Dom0 may be accessed via telnet, meaning the default escape character
> (which is the same as telnet's) cannot be directly used to exit the
> console. It would be helpful to make the escape character customizable
> in such use cases.
>
> Add --escape argument to console tool for this purpose.
>
> Add argument to getopt options, parse and validate the escape character
> and pass value to console_loop.
>
> If --escape is not specified, it falls back to the existing behavior
> using DEFAULT_ESCAPE_SEQUENCE.
>
> Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
> ---
> Changes in v5:
> - Add this changelog
>
> Changes in v4:
> - Improve validation of the escape_character optarg
>
> Changes in v3:
> - Re-add the Reviewed-By tag accidentally removed in v2
>
> Changes in v2:
> - Drop the tags intended only for internal use at Arm
>
>   tools/console/client/main.c | 21 +++++++++++++++++----
>   1 file changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/tools/console/client/main.c b/tools/console/client/main.c
> index 6775006488..d2dcc3ddca 100644
> --- a/tools/console/client/main.c
> +++ b/tools/console/client/main.c
> @@ -42,7 +42,7 @@
>   #include <xenstore.h>
>   #include "xenctrl.h"
>   
> -#define ESCAPE_CHARACTER 0x1d
> +#define DEFAULT_ESCAPE_CHARACTER 0x1d
>   
>   static volatile sig_atomic_t received_signal = 0;
>   static char lockfile[sizeof (XEN_LOCK_DIR "/xenconsole.") + 8] = { 0 };
> @@ -77,6 +77,7 @@ static void usage(const char *program) {
>   	       "  -n, --num N      use console number N\n"
>   	       "  --type TYPE      console type. must be 'pv', 'serial' or 'vuart'\n"
>   	       "  --start-notify-fd N file descriptor used to notify parent\n"
> +	       "  --escape E       escape sequence to exit console\n"
>   	       , program);
>   }
>   
> @@ -174,7 +175,7 @@ static void restore_term(int fd, struct termios *old)
>   }
>   
>   static int console_loop(int fd, struct xs_handle *xs, char *pty_path,
> -		        bool interactive)
> +			bool interactive, char escape_character)
>   {
>   	int ret, xs_fd = xs_fileno(xs), max_fd = -1;
>   
> @@ -215,7 +216,7 @@ static int console_loop(int fd, struct xs_handle *xs, char *pty_path,
>   			char msg[60];
>   
>   			len = read(STDIN_FILENO, msg, sizeof(msg));
> -			if (len == 1 && msg[0] == ESCAPE_CHARACTER) {
> +			if (len == 1 && msg[0] == escape_character) {
>   				return 0;
>   			}
>   
> @@ -335,6 +336,7 @@ int main(int argc, char **argv)
>   		{ "help",    0, 0, 'h' },
>   		{ "start-notify-fd", 1, 0, 's' },
>   		{ "interactive", 0, 0, 'i' },
> +		{ "escape",  1, 0, 'e' },
>   		{ 0 },
>   
>   	};
> @@ -345,6 +347,7 @@ int main(int argc, char **argv)
>   	console_type type = CONSOLE_INVAL;
>   	bool interactive = 0;
>   	const char *console_names = "serial, pv, vuart";
> +	char escape_character = DEFAULT_ESCAPE_CHARACTER;
>   
>   	while((ch = getopt_long(argc, argv, sopt, lopt, &opt_ind)) != -1) {
>   		switch(ch) {
> @@ -375,6 +378,16 @@ int main(int argc, char **argv)
>   		case 'i':
>   			interactive = 1;
>   			break;
> +		case 'e':
> +			if (optarg[0] == '^' && optarg[1] && optarg[2] == '\0')
> +				escape_character = optarg[1] & 0x1f;
> +			else if (optarg[0] && optarg[1] == '\0')
> +				escape_character = optarg[0];
> +			else {
> +				fprintf(stderr, "Invalid escape argument\n");
> +				exit(EINVAL);
> +			}
> +			break;
>   		default:
>   			fprintf(stderr, "Invalid argument\n");
>   			fprintf(stderr, "Try `%s --help' for more information.\n",
> @@ -493,7 +506,7 @@ int main(int argc, char **argv)
>   		close(start_notify_fd);
>   	}
>   
> -	console_loop(spty, xs, path, interactive);
> +	console_loop(spty, xs, path, interactive, escape_character);
>   
>   	free(path);
>   	free(dom_path);

Nice work~

Reviewed-by: Hongda Deng <hongda.deng@arm.com>



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 10:21:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 10:21:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570268.891969 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qObeU-0005Zw-AX; Wed, 26 Jul 2023 10:21:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570268.891969; Wed, 26 Jul 2023 10:21:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qObeU-0005Zp-7l; Wed, 26 Jul 2023 10:21:54 +0000
Received: by outflank-mailman (input) for mailman id 570268;
 Wed, 26 Jul 2023 10:21:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qObeT-0005Zb-4H; Wed, 26 Jul 2023 10:21:53 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qObeT-00070d-1p; Wed, 26 Jul 2023 10:21:53 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qObeS-0005kf-Im; Wed, 26 Jul 2023 10:21:52 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qObeS-0005Rc-IK; Wed, 26 Jul 2023 10:21:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=+yuHf6h0PRjEIzVgvdyecjBIZLpLQgNvtAVVUYjxXN0=; b=TxsSR84lflS9VjGSjb1TKnWOpN
	c2C4FMJLR2gaGH0PB7AhfqOYMgMlvtvFFqIhT/jPpFj8w3LfGvvT9wxTF0/5CMtzGVQqEkO1OZYfr
	6cUg5FOS6X1Pw97iggYHaOwhP3TGJmuj/lZj0HaUjtsxSMa3hs5zkYWnjPtSLkKMooss=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182004-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 182004: tolerable FAIL - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt-raw:guest-start:fail:heisenbug
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=411cbe7199ce533ae5fa78f5558dddca6f88ef1a
X-Osstest-Versions-That:
    libvirt=6c3ef66cc6d60d35e86206fd7b78178c4d0cbb88
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 26 Jul 2023 10:21:52 +0000

flight 182004 libvirt real [real]
flight 182020 libvirt real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/182004/
http://logs.test-lab.xenproject.org/osstest/logs/182020/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-libvirt-raw 13 guest-start         fail pass in 182020-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail in 182020 like 181966
 test-armhf-armhf-libvirt-raw 14 migrate-support-check fail in 182020 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181966
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181966
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass

version targeted for testing:
 libvirt              411cbe7199ce533ae5fa78f5558dddca6f88ef1a
baseline version:
 libvirt              6c3ef66cc6d60d35e86206fd7b78178c4d0cbb88

Last test of basis   181966  2023-07-22 04:21:55 Z    4 days
Testing same since   182004  2023-07-25 04:20:37 Z    1 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Oleg Vasilev <oleg.vasilev@virtuozzo.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   6c3ef66cc6..411cbe7199  411cbe7199ce533ae5fa78f5558dddca6f88ef1a -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 10:32:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 10:32:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570281.891980 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOboI-0007Ci-Cl; Wed, 26 Jul 2023 10:32:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570281.891980; Wed, 26 Jul 2023 10:32:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOboI-0007Cb-8X; Wed, 26 Jul 2023 10:32:02 +0000
Received: by outflank-mailman (input) for mailman id 570281;
 Wed, 26 Jul 2023 10:32:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOboG-0007CV-Vp
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 10:32:01 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on0625.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::625])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a6dd6676-2b9f-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 12:31:59 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB8055.eurprd04.prod.outlook.com (2603:10a6:20b:2a4::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Wed, 26 Jul
 2023 10:31:57 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 10:31:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a6dd6676-2b9f-11ee-b242-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=DpKsRspCO8z6xSPzxaXb84xg9DwZH6n7V4fr6un0m3iH1B5VTXms+p0mUiRw6+lJ/3s9hBprRqjZdtfnGkEseZhyjvo2ZQybI85oWm7YuBzG4RW1l+gRRE9W/kboQ1Dzg0Bp2V2uc+uzcSPmoRVTZyDJOfQQ/r3GRUq31D732Uo9OCvv6dcAhPTxLV0Wz3uJtnbo6V2ptbAFA2qNrSXBjEN0CaxC0bvBFTV4HEUGeYK/Roo+j6ec1utMRpXE6pTyOa8oNHXcAShJa31PhQanhMR6Vo1ZMVMMHglI+PCgpBgnjokFDcbTbKOUpZ4/uGrHAxpDk87om/gkmZp9Tx2zqA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=x54BF867RplKc+ogBqz1C629hCeUocCx2/oZXgNJ1Fs=;
 b=WKIo36GcOa+srVBhh9yotK5zF/egGyc9dCxu1wbh/FTdILCnURw/L92yTVrHuRd35Szwo8rtJNo8Fd2ayH1pgrzpIHVH/nRZ1CBKfjaIbxha2ZuKFoANip8OuFwYE52gVAPYfsf/oh2PlYa0mgRKI5cLweZAjQ7FPpoIbJGrdTSQskOeZ3poPzPECVTg1HNgM6lwRuEoOhlbgGKakh1yohEAuOc1McgZBbBeozj9nP8QbjVa8gcKGEOXSPDqkYNTI0fvquhyj26kRL7H6f+40SQRgFtaId50KEPnNlxSI7D6xAoaMcUS1KilKpBsnV0zkWjqiTq38ySEXUiILZ5/5A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=x54BF867RplKc+ogBqz1C629hCeUocCx2/oZXgNJ1Fs=;
 b=hZkVE1FpjFG37w9Rv/6jrZocom4iO7fcsXhzOLKNM2rbej4Kokddv3pnHXA6b6JVMWm+psycFmhxlqLB2xrr5Oz8lijGcHG6HNu+WjC3LXsGGatH4NoSxtXRe4Oh7X+clT8earEnYoEZhguGLbmm3bKZGVpET7goLWaq3JJ0dxNxsw5scj81y7AC5XkNzrHVqQ++UTat7/y6UL4CjCBtiu/pjEqKqO6GxcGwx81bd/rKSUBRe1t/CInaCSs6uSGAX/0+9aWYwMGzWiIGY3r9acv9Fw2AegtaMLTPDmv3m3YdRFcg5qCNHyd5FBN9dx8q2e13vfl5VLb1CLrHRTWMNA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <10ce72fb-4fb7-67de-41ec-7291dbac0038@suse.com>
Date: Wed, 26 Jul 2023 12:31:54 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v3 0/5] x86: allow Kconfig control over psABI level
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Content-Language: en-US
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0146.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:96::20) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB8055:EE_
X-MS-Office365-Filtering-Correlation-Id: e5ee546b-6511-49ec-0863-08db8dc38961
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	pLSJSi+isVylIuSS351HYq64h3P1unBWkeBy720dhGXjWf8JNgkaaVYCVzLG0lifDeL0edGbuWzJwE3zJ+iKCqr/+SYKJhx0bDWORAgmeTabzm8akjP7vjSjoThzk9wEaw6FAOxd/TCIShDqfkTu+aHn0O7T4vKWUIWVL+9pivtvug2srzwTQ5lueLj8MikUAJWNhjQqd5LIfCDX0R7s/AZ2ZLIWrdK2cR677imy3o14XGU25JJg4Tc0QBJjH21gSnPzC7+qGYfBPZaPjv//tzR1HsCPrMYide9f/nPRK2t5GG9mc3+LK1lePpzzo9j21RZR57JyAOIib10h3ELLcaMGw89aBM4Sir453kcnMVUYO+3Yk00Vtnw3voQQvZbV9COpRQ0qvLiBJdOKqYjX4o1lzI+LeYh7fzf5tF3442gtK0zqT+JWxYfa8EPcsJuDNu0VEYHBGl8aza0I/LWZo0ysWO19hKL4PCAAdAV0kh95/GfQ/hEOgCrFF3YGmEZkT9QgDEr4Wy5kF9WBAQ/SbPRse+RNzY/57u17K5P2yOix0YQd/9KxPnAisy6nAiaBjJjHDoEL5hLNK+7G1KDf2584Qw/c53DXmdWM2wQDzZ+0K+CnarjUimGgKb7vFfVL890E+qKhgoEf8wF7Is0kug==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(366004)(346002)(136003)(396003)(451199021)(31686004)(8676002)(8936002)(5660300002)(66899021)(41300700001)(316002)(6916009)(2906002)(4326008)(6486002)(66556008)(66476007)(54906003)(66946007)(478600001)(6512007)(26005)(186003)(4744005)(6506007)(86362001)(31696002)(36756003)(2616005)(38100700002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?M3JNcm8raUk0T3JpUnBlZDc4QzR6YW55cTNIUWVZc1p6TTllQW9HZVJseGZV?=
 =?utf-8?B?RFcyVS9mWC8yMFpSN2RtdGZuR2NzMTRUbHVzb0k5eUdjVDA4NWlmeGpWbmlS?=
 =?utf-8?B?Wm9NeDlmMDREY21JeXpwUTZCaWs1RnBRUytkNHkxUjlIZUdRdzRJUkJtenlD?=
 =?utf-8?B?d1hwbXg4L3h1OGdPdFdIOWlNOTlEbjR1Rk05ZmdRbnVMZHVnNi8yQkFvYmx2?=
 =?utf-8?B?NWVTcTRSUklTREJLMUNvOGQvY01qTURIdHpma2k5RDF6SDFOWUtlSURHb25H?=
 =?utf-8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9UQ2QzMCszRkppNUdPQW5i?=
 =?utf-8?B?QVJMbS9kZ3lqUElIUC93bFJlaUR3ZlB3cUdTTy9ST0F4M2NDMG5JV2JCRGFV?=
 =?utf-8?Q?eOXudBUz11VFxjzY1a1mp/JiL?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e5ee546b-6511-49ec-0863-08db8dc38961
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 10:31:56.8044
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ewpiydfTSwQFeIFGrO+/CNPHZcWfJkHcdbe827Spa9oLfT7AIHwizQ9nhCrlhsf6Dpufnw0Ue/T+TmtZ03HoMA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8055

As discussed in Prague, with some minor add-ons (patch 2 replacing a much
older patch under the same title).

v3 addresses issues found as well as review feedback; see individual
patches for details. Patch 3 in particular continues to raises several
questions as well, though.

1: build: make cc-option properly deal with unrecognized sub-options
2: build: permit Kconfig control over how to deal with unsatisfiable choices
3: allow Kconfig control over psABI level
4: use POPCNT for hweight<N>() when available
5: short-circuit certain cpu_has_* when x86-64-v{2,3} are in effect

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 10:33:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 10:33:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570282.891990 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qObpS-0007hz-LW; Wed, 26 Jul 2023 10:33:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570282.891990; Wed, 26 Jul 2023 10:33:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qObpS-0007hs-II; Wed, 26 Jul 2023 10:33:14 +0000
Received: by outflank-mailman (input) for mailman id 570282;
 Wed, 26 Jul 2023 10:33:13 +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 <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qObpR-0007hm-92
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 10:33:13 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on2061f.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::61f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d1606bcb-2b9f-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 12:33:11 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB9175.eurprd04.prod.outlook.com (2603:10a6:20b:44a::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 10:33:09 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 10:33:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d1606bcb-2b9f-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=kEKu4H5/KA/7ug4A//MCHkUTExtYmWcW/xp8/4bv4ryRMoP93r/tTQKpTowX/7UUjIsKFADjfRdnWVnaq2W3+c30od/O0RgZeL8O0kheB6g1AYz7gxbLU6w/q4GU5XKKRZc+0aA4t5G8pLIITEdKEge5HXrKUWw+ourARIPSDso1854UhPksdXc/YOX7puoRGrKx5M01BfjcCSzpd4jF2IIb/BQSNHLswzwnFMrBnFljPk9k5Qo+goRQ5JVomfs8+FqYK8QEnHfouFenf/i0ThCBuSt/SW/g8AznOdtbrXK81YuJtGebOedW8tgve601oGg0XXdhrxr3dE+a9NVwOg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BUQNrBvwkCW3i8IvMZ9HOVhTuG/uMRjUcx7MUJQ2KDs=;
 b=BqiMFfDHMyCh6kt6o/J9vFXJIUoOERDjuXhf5T1MLG3pWGLRbEZLfTovXT0Pzn7MySSZPP8lCDTm9dj2/4htp5A3y0XOkyEr2tv9J7r/SNd/5P7Nhp4MxH4IQrEa+lQsIHy+Wj8KwkTs+u4+fj1ZzPIN2j74gpHjHctJJOe3uRcLi13Lms5zNnPsiJPE4BE4gaNwnYX8bFfPmECT1svyAK0z62jamfAFg5fPy0bUO+mdhMuChIyl7z+wD8KMOD0VVszkoGzIpb8g4B0FVREKxY93KT4DKacYiLeVOlH84Lbev69trJInBcfllr8Pzvh8xGRVoiWB/k7hWUM77Cxbsw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BUQNrBvwkCW3i8IvMZ9HOVhTuG/uMRjUcx7MUJQ2KDs=;
 b=F3D/c9wASpnoUlsGnSkTbc28lFwnr/C060k4jXaM1+dUCfh9+GTASptadQrHCGsBhQEwazmmcGwrCgGy5CgbbVOEWlCTps1EEE2avS5E5jQK+0Aa3JBivjMtHslhd+DlSvf4gfMXceeV2FDdp0kcWQDrbhMb2cZU1egursNJ+w4ioffJIBqNByv4om3dU0je2LXzPfDFkEpwMKaEcGL2DJaE0CtkUuSM4FmK7vQZprgjxOnReg3G3vzoXAbPa1uo5MrPfGrPc53LMFlgzto5gKS7lQbYLBLfrNfNtVnKs4534H6/0+NBR8cJF27Zpvih4NNemhKu6JNTch3r0fUXSg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <60da37cf-abec-be58-d433-e98eec0c59bd@suse.com>
Date: Wed, 26 Jul 2023 12:33:07 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v3 1/5] build: make cc-option properly deal with unrecognized
 sub-options
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Anthony Perard <anthony.perard@citrix.com>
References: <10ce72fb-4fb7-67de-41ec-7291dbac0038@suse.com>
In-Reply-To: <10ce72fb-4fb7-67de-41ec-7291dbac0038@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0248.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:af::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB9175:EE_
X-MS-Office365-Filtering-Correlation-Id: 0f0894e5-913e-4ea7-586a-08db8dc3b487
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	dO0ZO6NNcmo7vhh8sQOispNr04T0/FSewxKg/zkrAlnNXFCD1u6N4jPF4AivX+bqW2U4BwkvyUmkX/jSdDm0O2zY9iQS0YnlHMww32VeZsuTQ4Pze2SbKWxXSQ30YWDGYlhjdqRkqG6795DdegWcpRl7zMqWBPHKV7cMI6ECp0dR+PyenpdE4qeod63VDooZ2NqVu0rtrJo+cQ2cCiXrV0qcyHPAP+Ifzx3TIzKJD3xX0mt7W9owWI77uBeTOQ9XPXpwxLAlwc3Kvh+L+cp8Khev4CbB8A9EdE2U8LJJvmSrI5FF8ArKs+KNUTZp0zPgbPSbNINuFsOh1f/Ieb6ZvJIwn5Ws0yqbmg+LsHHbw3PLLCYtla9U+eKq/rUVxx7IkWVhqrw2bw0LZuhzT9pmgP+78iNUd9CYuP1GhBQ681ylC/Ye4a9IikEsjUP/zVP4tdoas6KQxOKeKXeYgyBZdX4asysEWFVUoNfRVDl4MgTB/LWIB2Pp19k9juDv5tu1N4L3R8+A3Xx6iN0Tcj39NEw5iouULOPFYlvuZdBhnGcBl6I25uRkHm6e+4/UUtK34E4xkjIlj9cGM+RmR5r2pig6vB/QaSxz2xJHKmqbk1yKTm9+dZS6HP2Jubu7UytEvOrGSjAJRUN+wXc5qWqfVQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(376002)(366004)(396003)(136003)(451199021)(54906003)(6512007)(6486002)(478600001)(66476007)(2616005)(26005)(186003)(6506007)(2906002)(66556008)(6916009)(66946007)(316002)(4326008)(5660300002)(8936002)(8676002)(41300700001)(38100700002)(86362001)(31696002)(83380400001)(36756003)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ekZXRnFaMFByNlhFUW05bi9qYVZJaUJxWHg2L3JBK3RFeWxTN3lSRTRFTDhC?=
 =?utf-8?B?RTY3dk5ZeEY2L0wrclZhWXlGSnNHOEc1ZmN2Z0s5b0ZQNjVtditLbUphQjBo?=
 =?utf-8?B?MnNEcnVlQWEzWVQ2K002SkpQOHMwS1JwdDAyOWtlcy82MlNCdGMrYk92SExH?=
 =?utf-8?B?Tkc0OFZBVWlUOExWbGpjSmFCVnorcEFOOGVSb0QzKzc2c1NoQmNGbTFuNFVV?=
 =?utf-8?B?Q3hzQTJoZCtVbmRFbFN6elNhcTFyVTlzZGcyU3Q0K0VMNTRZeFFEK3lWcHRI?=
 =?utf-8?B?cDR0Qzg1NUMza3NTdG5KcUlPTHMrK1FVNnl0S003SnZrQ2NzZnVERVUrOXJ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OHRrY1lNSFlaLzdSU1RCOS9WN2JPTkk3?=
 =?utf-8?Q?47GkpKplqgKSbZ/oEEne9OdGs?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0f0894e5-913e-4ea7-586a-08db8dc3b487
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 10:33:09.3501
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: CLHqeQ3epvvmn3b8VZyKNOaBn/Pp5f/+DzKI6LXyt3+u+E2CTPbbU/O7dmO5EM7Ex+mLj/YABvE1EhLi/HXiww==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9175

In options like -march=, it may be only the sub-option which is
unrecognized by the compiler. In such an event the error message often
splits option and argument, typically saying something like "bad value
'<argument>' for '<option>'. Extend the grep invocation accordingly,
also accounting for Clang to not mention e.g. -march at all when an
incorrect argument was given for it.

To keep things halfway readable, re-wrap and re-indent the entire
construct.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
In principle -e "$$pat" could now be omitted from the grep invocation,
since if that matches, both $$opt and $$arg will, too. But I thought I'd
leave it for completeness.
---
v3: Fix build with make 4.3 and newer, where the treatment of \# has
    changed.
v2: Further relax grep patterns for clang, which doesn't mention -march
    when complaining about an invalid argument to it.

--- a/Config.mk
+++ b/Config.mk
@@ -8,6 +8,7 @@ endif
 comma   := ,
 open    := (
 close   := )
+sharp   := \#
 squote  := '
 #' Balancing squote, to help syntax highlighting
 empty   :=
@@ -90,9 +91,14 @@ PYTHON_PREFIX_ARG ?= --prefix="$(prefix)
 # of which would indicate an "unrecognized command-line option" warning/error.
 #
 # Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
-cc-option = $(shell if test -z "`echo 'void*p=1;' | \
-              $(1) $(2) -c -o /dev/null -x c - 2>&1 | grep -- $(2:-Wa$(comma)%=%) -`"; \
-              then echo "$(2)"; else echo "$(3)"; fi ;)
+cc-option = $(shell pat='$(2:-Wa$(comma)%=%)'; \
+                    opt="$${pat%%=*}" arg="$${pat$(sharp)*=}"; \
+                    if test -z "`echo 'void*p=1;' | \
+                                 $(1) $(2) -c -o /dev/null -x c - 2>&1 | \
+                                 grep -e "$$pat" -e "$$opt" -e "$$arg" -`"; \
+                    then echo "$(2)"; \
+                    else echo "$(3)"; \
+                    fi;)
 
 # cc-option-add: Add an option to compilation flags, but only if supported.
 # Usage: $(call cc-option-add CFLAGS,CC,-march=winchip-c6)



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 10:34:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 10:34:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570285.891999 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qObqC-0008JM-3E; Wed, 26 Jul 2023 10:34:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570285.891999; Wed, 26 Jul 2023 10:34:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qObqC-0008JF-05; Wed, 26 Jul 2023 10:34:00 +0000
Received: by outflank-mailman (input) for mailman id 570285;
 Wed, 26 Jul 2023 10:33:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qObqB-00089h-3h
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 10:33:59 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on20607.outbound.protection.outlook.com
 [2a01:111:f400:fe13::607])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id edb30fa0-2b9f-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 12:33:58 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB9175.eurprd04.prod.outlook.com (2603:10a6:20b:44a::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 10:33:56 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 10:33:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: edb30fa0-2b9f-11ee-b242-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=eIlGtv243838urcZISZZpaCepcZ0enGGrTcprCxv0A3SV2m/hkRUMutPlRVLhoMVrXmJhZH3g8KmqbQ2/e5ckV6bbYIlnmO3UrfvGg7FLOclX41XH3vpeTH3qI1lAG+bCbXpPX9QM7CaygRee5gJORyp97k7A14M0gHSD1YWrSaUahWvsHYeNPAc+E4Y6c2MkiepQI15fHshvcSoF+TXmkGW+miHKh7FtamBso6hvTlMsl/wWm9IqCo+rmHUGxvh9pH9DoOEMPduoibeuNVgTPpQ/Gj/Uz0rn/bx/7D+KX8hpbKAfIY2l60zGweibIWH4AxL2mlc63Pcg0rzq3+EzA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=TBwtNBln1PoPHd4P5QDMVI0TR5/7gNq72VnGJQQ+6LE=;
 b=hTX9lA5Ds1kpSxMCuHEdGG0otfSroxP2chakMD7qwUbLt+/B41PwIL1z8Qlx7mDRvHDprQDeO/F9YRw6luIiuHN3CLOOwVO9o37bcF9dnN+w65Li09mPztO3qdvmRHANqVZHiWPqCbDdqqYekl03xSxU/WS5k3sT8c0GIcAGzQizEYjrjz9iu7lv7lbhBYAJnl2Fu0jqO+FpftECrrNZRGDn+9uMhgwRq8sf2nvDGCmSiuK5kvYeAmoozvNNxZL0TismpQDhO+DXju3uKGz/6Xg7zYUKv8cHPsgBzSrMdbCKuOzNp5xEwQLNuFLNrbeIr9w1PZu6Wn0smXsJC4nJUw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=TBwtNBln1PoPHd4P5QDMVI0TR5/7gNq72VnGJQQ+6LE=;
 b=AcrVotX6iyA6bHD+au+pVhACXLpD+EsjGv8T0G2jDLrex9YUcfNeEvY20Zeqk9Wf71reIpyM18PvXGUpPVZ0o2b0u70F2n0fKiFRa67sDxUwC8I4il42IvyS/VMqCYCxYRW0718W9rHc7NXwyCqcHdhsDGGS7HOAcWF3ioL/xy8z6bS2BhTCrMCPDt3yeGT5zbCCsP2jJCup6LTFSQWMnLnwjOAuIO7KZGyH70SmjhOxpFIKKTKr6BeH/HbiUtZZjrOKkdtf27qtvyxUze0z4NsFMg/LUvhV4HTsmzvMTxBclhmymztSNYjFC7lw5SuTpQYdRtw8Rz0CXYQ3rdLWrw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <14b578f9-b612-4bb8-e558-983be6f72386@suse.com>
Date: Wed, 26 Jul 2023 12:33:54 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v3 2/5] build: permit Kconfig control over how to deal with
 unsatisfiable choices
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Anthony Perard <anthony.perard@citrix.com>
References: <10ce72fb-4fb7-67de-41ec-7291dbac0038@suse.com>
In-Reply-To: <10ce72fb-4fb7-67de-41ec-7291dbac0038@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0244.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:af::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB9175:EE_
X-MS-Office365-Filtering-Correlation-Id: 9badda2b-1be2-4954-5f6f-08db8dc3d07b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	xUliL8az7+whMLLTPui9pgrZBhy9ZFHCteFU2RpdUoAQ/tWnnZwdkzwXc6VVApGpFJPH/kk5eH56dPOTBc3w3Yg/OA6GVa7wIz8YnvowLbVLU/JzkybbCo1dSh8v6eoTT5YjkTghJrOcP/LiVAZ/k07e5uRRe7KP8HvAMDbOHdU7dYBG0JdN8K1+EsAGLNPcPFVGCr0O+Ab/DCbLRAFaeogXcO/dbpEvXAZcbqsIvM0edHpqbB7tyxlyOQk2H5RKnFwaeV9h032XqY76ptOgYw0fn2pfbjHVLn1ZeFAfnAch33FqblGhkRkmaYkkvU18CRJ1U2RVunNkTDjGEeEHarZe2JBo1nK0+me3r1iL3i4YD9uI6nppSRAOKr/b9HnjfoC6XcfjS6OsZTBZQUEkUd93fOIuB0E610tLzf5rQKeP0xLN7e5bmHw/WLvgWkE5p4/x1jBclS9W5x+u7+iTGIEavmTyovPq360o4zYXmdOkduqkn7pIzW4vvbVgtCAjncn/5nTSKQcMiy+dxINWKa6FkIqsO6GnbWRFrwM38s7h1oCn1OLuF7qvjXX9JTeiStz4uvV0Q4MIiEIGxkBdX1bcTx+m0Dk81JaUiywaQwGQFgwTGQKfnZbxKxG3tSNqLzjXajUZ+3RJS/yXCkQuYg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(376002)(366004)(396003)(136003)(451199021)(54906003)(6512007)(6486002)(478600001)(66476007)(2616005)(26005)(186003)(6506007)(2906002)(66556008)(6916009)(66946007)(316002)(4326008)(5660300002)(8936002)(8676002)(41300700001)(38100700002)(86362001)(31696002)(83380400001)(36756003)(31686004)(66899021)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?N3RPUytGREw3YWJpWU9YWHY1VFVESVE4bkV0WGEyOGtyaDRTVGZkdTZrVlIz?=
 =?utf-8?B?YTJiQlBPSVRGbnBnOCtkSytGT2FrWU50c1l0empyTUV4TGNKVElkUmdEdVVT?=
 =?utf-8?B?SzRzcVhBbDB3RWtFMVlFcEFaVDJPcGxUbTFnWVNYUndLUkNjNXRiRWtoRTJY?=
 =?utf-8?B?Y3dIV2dVWE4rN1pTb0I3VUk0QjhpTEIvSWdSUzlRZG9jcUdXZmFPOXJlYzFt?=
 =?utf-8?B?RUlKYmFOYmVTT1FGbWdTR2p5Mm1OMW9FK3VoaEhQL21zZXUxZlVxME1XN0Nl?=
 =?utf-8?B?UGdQcVNaVXVVU3hiY3BqVnpML2svRG1kYzNNM2RuM3RWN1R4elZhcUJ4Wmhz?=
 =?utf-8?B?ZzA1N0dCN0RMWmhWQnVKUUc5SkVKYW5reDA0Z2JESHNpdFdtVGh2NHlFM2NR?=
 =?utf-8?B?cWh5enFqS1lOcWVjUzhPbW1sZmxkOFJza28wcmRRTGp3NWlvRUwwTGdRMzFN?=
 =?utf-8?B?WkZ1TWEwZzJSS2VnQkZmelY1YzhEK2ZwOExxWlU4OHY0YkZBd2tvREE4VXNl?=
 =?utf-8?B?cmErV3UybytBTnZRb2V0SG9rZ3UwSm5BT2htSjJ1Mk9rS0dMTDNQZ1BiRWl2?=
 =?utf-8?B?SVFVTXdXYjdqdG53THJHbmJwQ1dZdktrS2FCMUZwdDNXTFZHTzVGVTA4M0pF?=
 =?utf-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ZzbGdmazNMaUM1cGJFeHVGaHREbmxO?=
 =?utf-8?B?MVRjY0liY1h3YXBaTUNDa200N3FsMmRqMmVZdmdDVUZITE9yZEVFQlpiaHJx?=
 =?utf-8?B?WUU3SUh0eWQxQnlHbkw2UUFUU2YwYW9DdTkyUjNydjh0Z2doeDVaQXppNGFF?=
 =?utf-8?B?ZlpDUFViZEVzWGNSdkxQaWNWK2hjNGlpdThFczlhZ0VXblJ3djdmMTlOc3JF?=
 =?utf-8?B?Y2QrY2FFdmJqQ2Y0dUttdzIwY1dmQ3lQNnZma0Y2NTUvdy9Zc2UrT2RuNDN5?=
 =?utf-8?B?Rk1WYnViNkRnbFo4QlBzazZaRW83VWdnSnZKdmlqM3VESFVISklGV1lTZEhq?=
 =?utf-8?B?dEJCTWRTcjVqRk5VREsreElEek0xYk5USU5OUWFYZkFxYzBrVEZxK0hWbVBV?=
 =?utf-8?B?bTRTQXFybmlNUlB5ZkppWi92TmZzZ2VueDRJVjkvU084LzhTcHJ3amVab3Ez?=
 =?utf-8?B?THF6Y0N4cWFLT3FoRHIxbDh6azVXQW5xWWFzZVpLcTNlMndMK0xLS2M0M3FB?=
 =?utf-8?B?clBsbnpJMjZGME1YZVRubHNuNkdBTDRvbkNGSWxHQjA0TVMwRTYydHFpSUdE?=
 =?utf-8?Q?KzdnCJ/ke9f0J8aMZFy7sAWJg?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9badda2b-1be2-4954-5f6f-08db8dc3d07b
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 10:33:56.0156
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: p+4ysTVEqNcniNVNTmV+pRBm7v+Bw3NF0wzep7Rc2SgcF5tsaaPupkS0tsMDf6fazqtMzJxMoVM2Kg5CQ13sag==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9175

Some options we allow the build admin to select may require new enough
tool chain components to fulfill (partly or entirely). Provide yet
another control to pick what action to take at the end of the build
process - be silent about this, warn, or fail the build.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
This may not be fine grained enough: Optimization settings (like added
by "x86: allow Kconfig control over psABI level") may want dealing with
differently than security relevant ones (like XEN_SHSTK or XEN_IBT).

Whether to do this uniformly at the end of the build is up for
discussion: In the "warn" case we will want the resulting output late,
so it is more likely to be noticed. In the "fail build" case though we
may want the failure to occur early.
---
v3: New.

--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -64,6 +64,25 @@ config UNSUPPORTED
 	  preview features as defined by SUPPORT.md. (Note that if an option
 	  doesn't depend on UNSUPPORTED it doesn't imply that is supported.)
 
+choice
+	prompt "How to deal with settings which cannot be satisified"
+	default UNSATISFIED_WARNING
+	help
+	  Some selectable options may depend on e.g. tool chain functionality.
+	  Select here how to deal with such when actually building a such
+	  configured hypervisor.
+
+config UNSATISFIED_SILENT
+	bool "silent"
+
+config UNSATISFIED_WARNING
+	bool "emit warnings"
+
+config UNSATISFIED_ERROR
+	bool "fail the build"
+
+endchoice
+
 config LTO
 	bool "Link Time Optimisation"
 	depends on BROKEN
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -588,6 +588,10 @@ $(TARGET): outputmakefile FORCE
 	$(Q)$(MAKE) $(build)=arch/$(SRCARCH) include
 	$(Q)$(MAKE) $(build)=. arch/$(SRCARCH)/include/asm/asm-offsets.h
 	$(Q)$(MAKE) $(build)=. MKRELOC=$(MKRELOC) 'ALL_OBJS=$(ALL_OBJS-y)' 'ALL_LIBS=$(ALL_LIBS-y)' $@
+ifneq ($(CONFIG_UNSATISFIED_SILENT),y)
+	$(Q)$(if $(strip $(XEN_CONFIG_UNSATISFIED)),$(MAKE),:) \
+	    $(build)=. 'XEN_CONFIG_UNSATISFIED=$(XEN_CONFIG_UNSATISFIED)' check_unsatisfied
+endif
 
 SUBDIRS = xsm arch common crypto drivers lib test
 define all_sources
--- a/xen/build.mk
+++ b/xen/build.mk
@@ -88,3 +88,11 @@ targets += prelink.o
 
 $(TARGET): prelink.o FORCE
 	$(Q)$(MAKE) $(build)=arch/$(SRCARCH) $@
+
+PHONY += check_unsatisfied
+check_unsatisfied:
+	$(Q): $(if $(filter y,$(CONFIG_UNSATISFIED_WARNING)), \
+	           $(warning The following selections could not be satisfied:), \
+	           $(shell echo 'The following selections could not be satisfied:' >&2)) \
+	      $(foreach c,$(sort $(XEN_CONFIG_UNSATISFIED)),$(shell echo ' - CONFIG_$c' >&2)) \
+	      $(if $(filter y,$(CONFIG_UNSATISFIED_ERROR)),$(error Failing build))



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 10:34:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 10:34:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570287.892010 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qObqZ-0000Lo-B1; Wed, 26 Jul 2023 10:34:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570287.892010; Wed, 26 Jul 2023 10:34:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qObqZ-0000Lh-85; Wed, 26 Jul 2023 10:34:23 +0000
Received: by outflank-mailman (input) for mailman id 570287;
 Wed, 26 Jul 2023 10:34:21 +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 <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qObqX-0000JJ-O9
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 10:34:21 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on2060c.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::60c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fa43eba7-2b9f-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 12:34:19 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB9175.eurprd04.prod.outlook.com (2603:10a6:20b:44a::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 10:34:18 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 10:34:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fa43eba7-2b9f-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Amg9aCqrhZjQQYcofkVt0WyW9aFCqhUsc/1LoL4KJ9WpuvvvLLmNH7zyKn3gZBxYuhF6Eau3X6EkRbxwnUI1lkCL2nWSPsgr2//Gnq4tOcOJLdxF8aiujtvtngdvc0KMQ7zDfkwwa6AbyZH1x5zHy1tr6X6P5sm5EI4CjW29YLROgAbOiiuZXXaFHTfoim/RoRmp8GHbYtLVSpHQNLmXahzeLWjh4x8EvBWrfN+fpaY4my0KEMkHlF2uCE8P8Y6qVOO5F/Ek6IYFy99c7O8DurRPsFOY1GogIMxtcFPMInlCQQwafWq3wnxwq2aB57ffiBVdV8jNCGwL70e1tFEjOQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=TPlKNfVxQjdacpVGXLYkRGRaFkfGEJC8kPssuPwlEoU=;
 b=CHZLd8BxrxOILk+9VcZIhf4Bv1no3OUexskYRKHRhGHG4FYx4ByndqJoLUWE/lrp/evaQIVQLZR4/gI0xncI8jO5wtLOaAxDfIpCbvoXn7tvjyuewSWu6eTAGmXzAVEU+KBKNB56B4DLTTYpVtYSuu5hQQpGREffbpxbOyIeduODFicj6hC1//4Iig8r/Yfobl2Ll5iQom0GIswTtOHuI5TH3asr6AohLOAbJkC1g5pq7hDwA4OIIoM4zr1JeK47pqI9srakrz/xR/nKxTjpanhpZG7pcv/qYwOg6HMAtEEyiTptkDqf42oNajAA5c9xDUg4L2nkPEPC2hrYDg1ciQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=TPlKNfVxQjdacpVGXLYkRGRaFkfGEJC8kPssuPwlEoU=;
 b=ipwkk5+OLkiHvxKV23r/UDXB31ecXzYGJK6xgDUSnDMsDuBy03+Xvcr+2HBTe9VxchV+RXp6KdYahEgqVZ9r2DsPQdfOEoBZxBceUKXOFVae7ujBRLdsTcrngzIgSeZLnOlG8/vtSfTSXAhKJL+fqqgo0Cf7vPy8t9WAM0GGlmqOgjzncSd+bfiy2/QeATLpEORdhrUfndVFyK36pMNC4k5YRzo4HYvpcajeI94gFP/jEiM1G6zRUG46siG4tcTNnlfT3KtkTbsAtMIKbBYgE0a0wFIZ2emSSIx+J24N4a8ToEaj5fVMbd4YHH/9N93Z8PjvQPPrrPFalNj88D86mw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3c819879-d113-facd-b025-b062e68bb6a1@suse.com>
Date: Wed, 26 Jul 2023 12:34:15 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v3 3/5] x86: allow Kconfig control over psABI level
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <10ce72fb-4fb7-67de-41ec-7291dbac0038@suse.com>
In-Reply-To: <10ce72fb-4fb7-67de-41ec-7291dbac0038@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0097.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a9::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB9175:EE_
X-MS-Office365-Filtering-Correlation-Id: d97ce499-2a6a-4e29-17c9-08db8dc3dd7b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	CL2WyjQ9i5UA4x8FButp0SkHhuwwDJNq1PUiC7wLmjHttd56NiSvNidxdkj3sEKw1nGBzD+8Uo2tBzz+yjZGR4Qbp9SRh5wo4gAtSmzq/7zjnhTXJBxAB+oEzi7N/f9OZnhn0Ah9ZhdNhpc/3FGN2i7P17gChO9rgoc8qevlZtAHPoodop1ufLNt2Y1MiJzXw1DkfIAISHGoThrFdBlIZ/qhyIJzm78Jpt2wQb9iC46UcMbXDlnxaf5dzIl3u0IVdJoa02z1Mnto6wqm11ePB8iE1qj9LQPsRTNPKuTCXOfQosq0WAVpsuUyBgvJNgYhzseH1kigVmKYrhhE8GUG5+IbTJCrVSdCnjZGmrGgqcpOMupasw90PvEQBOilYikpm3bOaV2VfRH7XXlfDVBm68UD8o+BLjeq+8Ne7YOFziZWTalKk+LJ///JtjVFGj2zfuObYzqn2GuuUoDxsEnGl3GL3UXLJmRtXANSFXVZ9y7o8E3iUOn5Ydq5hLkwhAwALcDSdIuETGErLcfFxPWSlTGmsr1Y+rWl1qkJLv0HLG/ojF9FhmQmtqQPkmO1fN/QMc1HvZQNQmyqwiOwGJZ8J1R5fYxbWPwsLUt5G+4Bsp1/DBU3MlZmhZNtZD2a9dTap4q4O9h0rFkyz5p5bxPhig==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(376002)(366004)(396003)(136003)(451199021)(54906003)(6512007)(6486002)(6666004)(478600001)(66476007)(2616005)(26005)(186003)(6506007)(2906002)(66556008)(6916009)(66946007)(316002)(4326008)(5660300002)(8936002)(8676002)(41300700001)(38100700002)(86362001)(31696002)(83380400001)(36756003)(31686004)(66899021)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UjBKOE1LM1lrbmpPVzBsVmlDNldRUmwxUnBxYjJFTjduYXJNcnk0cXdJU0xJ?=
 =?utf-8?B?OWFaTWhiZFROT0ZvUTlDTlZoOUoxc0dkUDc5a1NmbXZXaThFb0xIMWFuL2ha?=
 =?utf-8?B?QlBET3V5MjA1Qkl1ZzdtdDNEeXh2MGlzN2JhS0owZFNQbm1kUHZrQUN0Z2Vs?=
 =?utf-8?B?aEZGZzYxUmZJZTdLcENpK0Jja2JKNUlsYjE0RDJNNEZyRkR2anozTzlHRmtL?=
 =?utf-8?B?TW5YQ3JBcXU5cVEzY0xobUw5Z1h4Vy9taGdtaWNmd01vb3o2bXpya1dIclhz?=
 =?utf-8?B?c1o4WXBPOVFiTDRMRzcycUdRM1JNY0dBRU9pVzBCSEtnN1MzTEg5TGs1QVRQ?=
 =?utf-8?B?V3BkVk1YUDRjT1R5ZGZ1cDFkNUVFc3pGNnJmak80YjJTdWE5OXRkM3VLN2w4?=
 =?utf-8?B?ek1YczlCOHJtUHE3UUFXODNRUDg0T1Z6RnArQ0RZVGFzNVJiZWQySTZ2YjBv?=
 =?utf-8?B?REhlc3lTR3ZYNjRjemxMNnZTa1NBUXhsbW5xVUo5WjRZTlNFRUF0MEpqMTNY?=
 =?utf-8?B?VlZCQ0JLQURiV0M0VXplS2w2Q0ZsYU5yMXpHekRiM3FPaG8vRlpNdDdqWVhF?=
 =?utf-8?B?eEllT1RYd3RjQXJLRVQyUTVKUUdLWGp3dlMyMnIzc2NFSXNOdk53UFpqeldB?=
 =?utf-8?B?WGVHTUNPOGFZR3l4NGt2Z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dzVkY2L1ZMaURW?=
 =?utf-8?B?VkxKSGF6OXhaVkY0OEZHMG1wejUwbDBxTXJCQ0F2UHZlbnBncTVIeFVHOUdU?=
 =?utf-8?B?dWd3Mkk5SnpvUFZlYmxMZkpuakJZcGt3VVFxaGJMekxMdUFscm9BeWdaVmtG?=
 =?utf-8?B?a0J4K1FVR3pRMVYzRHdlZy9nL2huQXY0emQxOVVodHNlUS9FREtyajVob0t6?=
 =?utf-8?B?Nm5xd0hIT3oyRUEwUEZTdllrMVhyNk9zQzdwMGZvQktjMnpTKzVhVHZMM1dK?=
 =?utf-8?B?a2VyRTJhS09pZDNaaytNdllob002aEpiVUxHU1NGT0JWeTFQaFlWTjJqZzlo?=
 =?utf-8?B?YTdqN21ZWnU3US9IZ2VmTmxJaVdMYnF0QUp5MVJyQ1RpMS9ybUFmMytZY2ll?=
 =?utf-8?B?dmMrTldSTE8xbDlSS0tPYzBFazVsVDdhR21ZOGNDWFp5K2swNDB2a0hDdmVr?=
 =?utf-8?B?STRNK0VocFMzZTBGblIzWmh1bFBnWW1qVlVmNGlieVRBMUlnZzhDWEpGMUUr?=
 =?utf-8?B?dmNZMFRzdS81anZ3bm9mckdOT0ZEeUw1QXdRUllmbGd6bE9vdmtZME1kZnZl?=
 =?utf-8?Q?nU4dNM/6PNrvPcsyuSC7RtFxM?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d97ce499-2a6a-4e29-17c9-08db8dc3dd7b
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 10:34:18.3412
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ZHPiCP0ljD7tcCAq5uDNGbK1XYXpTj1lvlyVMlIjVYpxku22BduGB8mKdc65pmNv0+TsAHciJwmHUROzQSHrrg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9175

Newer hardware offers more efficient and/or flexible and/or capable
instructions, some of which we can make good use of in the hypervisor
as well. Allow a basic way (no alternatives patching) of enabling their
use. Of course this means that hypervisors thus built won't work
anymore on older, less capable hardware.

Since older compilers (apparently gcc10 / clang11 and older) won't
recognize -march=x86-64-v2 etc, also addd fallback logic passing
-mpopcnt and alike explicitly.

Note that in efi_arch_cpu() the filling of 7c0 and 7d0 are forward-
looking; we only require 7b0, but we need to use cpuid_count() anyway.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
TBD: While the added assembly code goes strictly from the CONFIG_*
     settings, EFI code uses the compiler provided manifest constants
     where available (just like the subsequent "x86: short-circuit
     certain cpu_has_* when x86-64-v{2,3} are in effect"). While I
     generally prefer it that way, this comes with a downside: If we
     ever started to use one of the ISA extensions in assembly code
     (and then keyed to the CONFIG_* settings), things could break. I
     don't view us doing this as very likely though, as then we'd need
     to have two (or more) variants of such assembly code, which we
     would likely want to avoid. (What I'd like to avoid is using the
     compiler manifest constants in assembly code: In principle we ought
     to filter out any -march= when constructing AFLAGS, and perhaps
     at least all -m... and -f... options. Compilers might rightfully
     complain about their use as inapplicable, much like we've seen for
     -Wl,... when no linking is done.)

TBD: While we don't document most "cpuid=no-*" options (and hence imply
     their use to be unsupported), using e.g. "cpuid=no-popcnt" with a
     V2=y hypervisor clearly can't have the intended effect, and hence
     might perhaps better be flagged in some way.

TBD: v2 also includes LAHF/SAHF. Since we don't use floating point and
     hence FPU insns, we ought to be okay not explicitly checking for
     it. But there is a certain amount of risk of the compiler finding
     some "smart" use for one or both of the insns. However, if we were
     to check the feature, we'd need to account for the quirk that
     init_amd() also works around.

Whereas the baseline -> v2 step isn't much of a difference (we'll gain
more there by a subsequent patch), v2 -> v3, while presumably (or shall
I say hopefully) faster, yields an overall growth of .text size by (in
my build) about 2k. The primary reason for this appear to be conversions
of SHL-by-immediate to SHLX.

The VGA output attempt in early (MB/MB2) boot code does not appear to
work (anymore?). The serial output may work, but only if - without any
setup in Xen - both sides agree on the serial settings (baud rate etc).
Hence the feature checks added on the legacy paths are of limited use.
---
v3: Add fallback logic and use logic from new prereq change.
v2: Also cover XSAVE. Add early boot feature checking.

--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -118,6 +118,36 @@ config HVM
 
 	  If unsure, say Y.
 
+choice
+	prompt "base psABI level"
+	default X86_64_BASELINE
+	help
+	  The psABI defines 4 levels of ISA extension sets as a coarse granular
+	  way of identifying advanced functionality that would be uniformly
+	  available in respectively newer hardware.  While v4 is not really of
+	  interest for Xen, the others can be selected here, making the
+	  resulting Xen no longer work on older hardware.  This option won't
+	  have any effect if the toolchain doesn't support the distinction.
+
+	  If unsure, stick to the default.
+
+config X86_64_BASELINE
+	bool "baseline"
+
+config X86_64_V2
+	bool "v2"
+	help
+	  This enables POPCNT and CX16, besides other extensions which are of
+	  no interest here.
+
+config X86_64_V3
+	bool "v3"
+	help
+	  This enables BMI, BMI2, LZCNT, MOVBE, and XSAVE, besides other
+	  extensions which are of no interest here.
+
+endchoice
+
 config XEN_SHSTK
 	bool "Supervisor Shadow Stacks"
 	depends on HAS_AS_CET_SS
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -36,6 +36,29 @@ CFLAGS += -mno-red-zone -fpic
 # the SSE setup for variadic function calls.
 CFLAGS += -mno-mmx -mno-sse $(call cc-option,$(CC),-mskip-rax-setup)
 
+# Enable the selected baseline ABI, if supported by the compiler.
+x86-64-$(CONFIG_X86_64_BASELINE) :=
+x86-64-$(CONFIG_X86_64_V2) := x86-64-v2
+x86-64-$(CONFIG_X86_64_V3) := x86-64-v3
+
+ifneq ($(x86-64-y),)
+CFLAGS-psabi := $(call cc-option,$(CC),-march=$(x86-64-y))
+
+ifeq ($(CFLAGS-psabi),)
+# Fall back to using the subset of -m... options that are of interest.
+x86-64-v2 := -mpopcnt -mcx16
+x86-64-v3 := $(x86-64-v2) -mbmi -mbmi2 -mlzcnt -mmovbe -mxsave
+$(call cc-options-add,CFLAGS-psabi,CC,$($(x86-64-y)))
+
+ifneq ($(strip $(CFLAGS-psabi)),$($(x86-64-y)))
+$(warning Options not recognized by $(CC): $(filter-out $(CFLAGS-psabi),$($(x86-64-y))))
+XEN_CONFIG_UNSATISFIED += X86_64_Vn
+endif
+endif # CFLAGS-psabi
+
+CFLAGS += $(CFLAGS-psabi)
+endif # x86-64-y
+
 ifeq ($(CONFIG_INDIRECT_THUNK),y)
 # Compile with gcc thunk-extern, indirect-branch-register if available.
 CFLAGS-$(CONFIG_CC_IS_GCC) += -mindirect-branch=thunk-extern
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -124,6 +124,12 @@ multiboot2_header:
 .Lbad_efi_msg: .asciz "ERR: EFI IA-32 platforms are not supported!"
 .Lbag_alg_msg: .asciz "ERR: Xen must be loaded at a 2Mb boundary!"
 .Lno_nx_msg:   .asciz "ERR: Not an NX-capable CPU!"
+#if defined(CONFIG_X86_64_V2) || defined(CONFIG_X86_64_V3)
+.Lno_x86_64_v2_msg: .asciz "ERR: Not an x86-64-v2 capable CPU!"
+#endif
+#ifdef CONFIG_X86_64_V3
+.Lno_x86_64_v3_msg: .asciz "ERR: Not an x86-64-v3 capable CPU!"
+#endif
 
         .section .init.data, "aw", @progbits
         .align 4
@@ -156,9 +162,20 @@ early_error: /* Here to improve the disa
         jmp     .Lget_vtb
 #ifdef CONFIG_REQUIRE_NX
 .Lno_nx:
+        pop     %ecx
         mov     $sym_offs(.Lno_nx_msg), %ecx
         jmp     .Lget_vtb
 #endif
+#if defined(CONFIG_X86_64_V2) || defined(CONFIG_X86_64_V3)
+.Lno_x86_64_v2:
+        mov     $sym_offs(.Lno_x86_64_v2_msg), %ecx
+        jmp     .Lget_vtb
+#endif
+#ifdef CONFIG_X86_64_V3
+.Lno_x86_64_v3:
+        mov     $sym_offs(.Lno_x86_64_v3_msg), %ecx
+        jmp     .Lget_vtb
+#endif
 .Lmb2_no_st:
         /*
          * Here we are on EFI platform. vga_text_buffer was zapped earlier
@@ -657,6 +674,7 @@ trampoline_setup:
         mov     $1, %eax
         cpuid
         mov     %ecx, CPUINFO_FEATURE_OFFSET(X86_FEATURE_HYPERVISOR) + sym_esi(boot_cpu_data)
+        mov     %ecx, %edi
 
         mov     $0x80000000,%eax
         cpuid
@@ -674,6 +692,9 @@ trampoline_setup:
         bt      $cpufeat_bit(X86_FEATURE_LM),%edx
         jnc     .Lbad_cpu
 
+        /* Preserve %ecx for later use. */
+        push    %ecx
+
         /*
          * Check for NX
          *   - If Xen was compiled requiring it simply assert it's
@@ -724,6 +745,36 @@ trampoline_setup:
 .Lno_nx:
 #endif
 
+        /* Restore CPUID[80000001].ecx output. */
+        pop     %ecx
+
+#if defined(CONFIG_X86_64_V2) || defined(CONFIG_X86_64_V3)
+        mov     $cpufeat_mask(X86_FEATURE_POPCNT) | cpufeat_mask(X86_FEATURE_CX16), %eax
+        and     %edi, %eax
+        cmp     $cpufeat_mask(X86_FEATURE_POPCNT) | cpufeat_mask(X86_FEATURE_CX16), %eax
+        jne     .Lno_x86_64_v2
+#endif
+
+#ifdef CONFIG_X86_64_V3
+        mov     $cpufeat_mask(X86_FEATURE_MOVBE) | cpufeat_mask(X86_FEATURE_XSAVE), %eax
+        and     %edi, %eax
+        cmp     $cpufeat_mask(X86_FEATURE_MOVBE) | cpufeat_mask(X86_FEATURE_XSAVE), %eax
+        jne     .Lno_x86_64_v3
+        bt      $cpufeat_bit(X86_FEATURE_ABM), %ecx
+        jnc     .Lno_x86_64_v3
+        xor     %eax, %eax
+        cpuid
+        cmp     $7, %eax
+        jb      .Lno_x86_64_v3
+        mov     $7, %eax
+        xor     %ecx, %ecx
+        cpuid
+        mov     $cpufeat_mask(X86_FEATURE_BMI1) | cpufeat_mask(X86_FEATURE_BMI2), %eax
+        and     %ebx, %eax
+        cmp     $cpufeat_mask(X86_FEATURE_BMI1) | cpufeat_mask(X86_FEATURE_BMI2), %eax
+        jne     .Lno_x86_64_v3
+#endif
+
         /* Stash TSC to calculate a good approximation of time-since-boot */
         rdtsc
         mov     %eax,     sym_esi(boot_tsc_stamp)
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -740,29 +740,53 @@ static void __init efi_arch_handle_modul
 
 static void __init efi_arch_cpu(void)
 {
-    uint32_t eax = cpuid_eax(0x80000000);
+    uint32_t eax = cpuid_eax(0), dummy;
     uint32_t *caps = boot_cpu_data.x86_capability;
 
     boot_tsc_stamp = rdtsc();
 
-    caps[FEATURESET_1c] = cpuid_ecx(1);
+    if ( eax )
+        caps[FEATURESET_1c] = cpuid_ecx(1);
 
-    if ( (eax >> 16) == 0x8000 && eax > 0x80000000 )
-    {
-        caps[FEATURESET_e1d] = cpuid_edx(0x80000001);
-
-        /*
-         * This check purposefully doesn't use cpu_has_nx because
-         * cpu_has_nx bypasses the boot_cpu_data read if Xen was compiled
-         * with CONFIG_REQUIRE_NX
-         */
-        if ( IS_ENABLED(CONFIG_REQUIRE_NX) &&
-             !boot_cpu_has(X86_FEATURE_NX) )
-            blexit(L"This build of Xen requires NX support");
-
-        if ( cpu_has_nx )
-            trampoline_efer |= EFER_NXE;
-    }
+    if ( eax >= 7 )
+        cpuid_count(7, 0, &dummy,
+                    &caps[FEATURESET_7b0],
+                    &caps[FEATURESET_7c0],
+                    &caps[FEATURESET_7d0]);
+
+    eax = cpuid_eax(0x80000000U);
+    if ( (eax >> 16) == 0x8000 && eax > 0x80000000U )
+        cpuid(0x80000001U, &dummy, &dummy,
+              &caps[FEATURESET_e1c], &caps[FEATURESET_e1d]);
+
+    /*
+     * Checks here purposefully don't use cpu_has_* because they bypass
+     * boot_cpu_data reads if Xen was compiled with respective CONFIG_*.
+     */
+#define CHK(ppsym, feat) do {                                        \
+        if ( IS_ENABLED(ppsym) &&                                    \
+             !boot_cpu_has(X86_FEATURE_ ## feat) )                   \
+            blexit(L"This build of Xen requires " #feat " support"); \
+    } while ( false )
+
+    CHK(CONFIG_REQUIRE_NX, NX);
+
+    /* x86-64-v2 */
+    CHK(__POPCNT__, POPCNT);
+    CHK(CONFIG_X86_64_V2, CX16);
+    CHK(CONFIG_X86_64_V3, CX16);
+
+    /* x86-64-v3 */
+    CHK(__ABM__, ABM); /* LZCNT */
+    CHK(__BMI__, BMI1);
+    CHK(__BMI2__, BMI2);
+    CHK(__MOVBE__, MOVBE);
+    CHK(__XSAVE__, XSAVE);
+
+#undef CHK
+
+    if ( cpu_has_nx )
+        trampoline_efer |= EFER_NXE;
 }
 
 static void __init efi_arch_blexit(void)



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 10:34:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 10:34:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570290.892020 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qObqs-0000sa-NW; Wed, 26 Jul 2023 10:34:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570290.892020; Wed, 26 Jul 2023 10:34:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qObqs-0000sT-Kh; Wed, 26 Jul 2023 10:34:42 +0000
Received: by outflank-mailman (input) for mailman id 570290;
 Wed, 26 Jul 2023 10:34:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qObqr-0000pF-94
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 10:34:41 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on20606.outbound.protection.outlook.com
 [2a01:111:f400:fe13::606])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0698903f-2ba0-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 12:34:40 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB9175.eurprd04.prod.outlook.com (2603:10a6:20b:44a::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 10:34:39 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 10:34:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0698903f-2ba0-11ee-b242-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Kki6fVBK4bJS/poodZ3FhNqFU38J2KWcqpy5QhAKDaeYBkVtqlKLOkexGP2M4azXVey2Y9bTYYmO7/G2GdXQyWmsu5VA8vyAgrSNhwlI8AwTZrnGcwqd0uHnfoD36dZ52jEDAwH9fCa5cDFaDINEpUjeNVsqGnzmKFA/HTHluDr9Dh/bDRtvvvGuFx5OPkEdclOdy7m1Kc6uX1x0kU+W2uqF0QbAsBaLRqKZPoEFmR+Qb2XraEfvvZvdKCgp4D+E9dgLd/SiXCNDFr30SESDFUNtZrOUThvq5acRKOIbdFXxxrwUsCW4eeB9hYH5yVZkW4bevBTnqaNO32QDBsveIA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4bXX4UWXnWt29w89tvGp0cf+LqZaRKTS56ciKBNCO2k=;
 b=b3P2K6SwCJdzJ1CDg60+v4aRD7vZ7uC3BReNRQD222Q8qeJFAhiFGS2oth9oZJFshJvSkFLsk4ijgzhl46LZpUa4KmR3A/wLzweFDFM0bGKI+fkjMmjT6HEAiOpVn519xYJwdTxUiO+uGqCwLIHthhG0Bsm73ZpxJGX+RC9Sop/xj/CU6xWoPlPTnVVAizYjNlm5EoyU/R+G94iaJ7uIFAs113R+B2hnzGIUF3txw5RUnuIqisPxjTF+SM95+6rPXlp3yGL40WA/Z/nZGTW4aNfURKRVnXPEj84GXI8EjuPyW+TuyT8QRFizi57zAXs/181fcomMjXsfJ79QZbIMqQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4bXX4UWXnWt29w89tvGp0cf+LqZaRKTS56ciKBNCO2k=;
 b=sEar2vZFCtLy4pccu4KzcUj9IsA3ZHTNPo2KD3JPuCwIP3iNB0+5c+SH9BBxPEKGDqO5znCwz7PnZ0fanYbrF7y5gkhCuPMtqWJpFy495sbseMu9mQzG0EEb5j/XJDS69iSHEPt27+cMRGJONn017mTTCopX9H4pny3g9x53+z7jW2GzNq1NUY1llM/fgg97Ueb9HDzWJcTTwD9wJvlUbguELzZpuNvJDp2Y/kK7udRn6JaqafG7+PDMtPKQiPH3kobh/Gdbl7TXvQG/UTkgzFYOFvnoJZmgGG+TBvE4fMxKnAY4S+5awYIIHBhuMPQ1dymbVvudvk+sSxTp4Tq0Bw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <4fdfecbc-0ed3-dc1c-379c-3a556fea8b89@suse.com>
Date: Wed, 26 Jul 2023 12:34:37 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v3 4/5] x86: use POPCNT for hweight<N>() when available
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <10ce72fb-4fb7-67de-41ec-7291dbac0038@suse.com>
In-Reply-To: <10ce72fb-4fb7-67de-41ec-7291dbac0038@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0139.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9e::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB9175:EE_
X-MS-Office365-Filtering-Correlation-Id: ef695472-c47a-4302-3aca-08db8dc3ea20
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	pXLW/0KF4oJYbWL5xCtn/ARmSF8xBgOhebIURnVwOoKCRONcIQDuH3DLlQqFO5XFWdc0OKtlQAYqEoljrK5WcvcG4cBskCnzerq8eYXmr4VHQwLiuWuEaYe9YPCYJkxczQyoUBJmtV/INqgbw+fSbgQCgzv6baFfMiYGVowSWXjSdbMojCzoLqKsA0/ZS7dclQj6bha3dpJDXoLJXTktZrv57nW1gV4obHQmi2hQrFEO5wQocmE8XQAfQdEwTCRkqK6MaptMLf9FnfCsmWwLu3wy/sbkH1nbbkGJs4JDcC+GG256vx75xN7js6oj4N9MECHZTlfdrBOQUhZETHe1vs8vsQcQuBMcv9D8ShB+JtKAs9sMFm0HvZ4f9qFHQWl39XOZCedc2FSr1ktUzbL1vKIYLk/lzCnFbMWv60EDql9ZZde8kT/1ihooBfFnIQWfDDRLf3zhyDEW592wWbvxVRNjYLc08mOS4J1K8M720TPShgb9yT0DI6sefZ9qc0UsLi8gWab+yQbHMhN3d95SWuZS5X/zxXWVDQxOiuGBFdzfr12D7f6U/a5xwz5X9jr5yoehDHntZNOTJoAoXdXug0kDgIwn1Cs1cKSaX7RpUR/NDN/er+SwSXf4DF/Wc4vrklokYLAeOMK75sG0N/CmzWsxp+ahHWzJX/K22zrJBhu+t2cpkfO2ln5wKoCBgwCB
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(376002)(366004)(396003)(136003)(451199021)(54906003)(6512007)(6486002)(478600001)(66476007)(2616005)(26005)(186003)(6506007)(2906002)(4744005)(66556008)(6916009)(66946007)(316002)(4326008)(5660300002)(8936002)(8676002)(41300700001)(38100700002)(86362001)(31696002)(36756003)(31686004)(16393002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bDFGcjc3YStNbGZRT2YrODhVaEl3WTkxcWJnNVlwazNGeFg4dDdkc3hkRWJ0?=
 =?utf-8?B?cEVyZDhYZDVuN0ZtTFlZRFoza01PYW5jaDcwQ3R3a1V2dEtyUkdBLzVOK2xM?=
 =?utf-8?B?ZVZ4cWFSb0dFaWlJMFAzVHpzZlp0QzgzemFrejJBYU1ENkR5bzhUTWRDQjkz?=
 =?utf-8?B?ZTYrNmxYVllobTFTODBEUENtRjlYcW9EMG5OZGVmSUtlZ2FDaTdlbmFnTEZq?=
 =?utf-8?B?ZFNmaEJTWkFBRC9vdUlqOXZpNGVVSTJUclpCL0hndjBnZFlxU1pISksrUERK?=
 =?utf-8?B?TjlIWCtKRWplclZwTFBjT1ZCK2tuOXdKNjNZSXI3ODBBSXdaOEpLWnpPNjI3?=
 =?utf-8?B?M3NLemp1a2c0M054Vm9ZVVBrZ2dJWGI3YWxiZm13dmtnOEhxVGpvRmd5b3lz?=
 =?utf-8?B?YzQweGs0bFdTZUh2YTlvdzFLS1Z3L0l3a2xqTkpkd1g1ZU9KOWhXbzhJTDBT?=
 =?utf-8?B?cTZoNGNPZlgyajdvUnQ1RXhiaG1NVGpjOC8yQjlKVmpNY3Q3cDcxNGRsT3dU?=
 =?utf-8?B?ZEJkZWZPRjJQQ244RXM2dWo5N1hReTcwdmxML1pablNJUDZsd3FmZ3d6cnFN?=
 =?utf-8?B?eUdQelpaVzNWc1J1QlZoblp0NGFlRGpVNUgwTTRpYXlwNTh2bWdpdEZ1QVpw?=
 =?utf-8?B?UUxXYVJ6NmR2QjhCMkxoSWc1czE3ajZPYTg1Q29MNzBzbzFBa0JPN21zUUl0?=
 =?utf-8?B?ZEd2ZlR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RMUJLbWNEOTA4R2xJ?=
 =?utf-8?B?UmtZMmxFcExFTXNITklSZnhtMERoKzFGWU1MRWtKZjNQUFI5ZzJXR0VCTjlw?=
 =?utf-8?B?VHVRQW14cU9TamNaalM1cTFocGJpd2tXWDE1WStvNzZlT0ExOUZLd2c1NUM5?=
 =?utf-8?B?MXhxY0tHNFNtejVidHp2TnF3TGZTU2dtSU5icGU2MWRMYmNZZjFLc3pxbk54?=
 =?utf-8?B?TGRLV0Vubm9RTFBYNWNoak1Uc1NlNGtiNHBFNWgzekwxekQ3MmZsdEJjajhU?=
 =?utf-8?B?K1ZTSzZoSnVvQnFUVGpYTE9OZ0xsQTRjOGdiV0gvNnlHYVQ0anRKQ1A0UlVu?=
 =?utf-8?B?TWR4VDlJSU1CTUtMV2pTbjNnRmFvZ2lTZGdYTzk3T0wwcXZVTFdnL00xTW9l?=
 =?utf-8?B?OEZkaWdJZURsZ29Jei9oSENtUWxRdGFROWJoUXFEVGlpYS9vRkhXTjZYNk9x?=
 =?utf-8?B?ZDJuem5RN3QvS2NNK2FIcDlsUXJZb3FhMkg1NnQydTYyVGVCYnUwa2daN0lP?=
 =?utf-8?Q?FOYfIYNJDYo26K3A/j3vaxYvF?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ef695472-c47a-4302-3aca-08db8dc3ea20
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 10:34:39.0999
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: lk65ibqpXKDPWL9c04qQzQapaxG+okr/vOFnnayq0JF7IknSqo+DmEZEiuxZa0dWgG1oP7y2hi6vaokGj8IyIQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9175

This is faster than using the software implementation, and the insn is
available on all half-way recent hardware. Use the respective compiler
builtins when available.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Jason Andryuk <jandryuk@gmail.com>

--- a/xen/arch/x86/include/asm/bitops.h
+++ b/xen/arch/x86/include/asm/bitops.h
@@ -475,9 +475,16 @@ static inline int fls(unsigned int x)
  *
  * The Hamming Weight of a number is the total number of bits set in it.
  */
+#ifdef __POPCNT__
+#define hweight64(x) __builtin_popcountll(x)
+#define hweight32(x) __builtin_popcount(x)
+#define hweight16(x) __builtin_popcount((uint16_t)(x))
+#define hweight8(x)  __builtin_popcount((uint8_t)(x))
+#else
 #define hweight64(x) generic_hweight64(x)
 #define hweight32(x) generic_hweight32(x)
 #define hweight16(x) generic_hweight16(x)
 #define hweight8(x) generic_hweight8(x)
+#endif
 
 #endif /* _X86_BITOPS_H */



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 10:35:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 10:35:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570292.892030 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qObrO-0001Xz-1D; Wed, 26 Jul 2023 10:35:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570292.892030; Wed, 26 Jul 2023 10:35:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qObrN-0001Xp-UC; Wed, 26 Jul 2023 10:35:13 +0000
Received: by outflank-mailman (input) for mailman id 570292;
 Wed, 26 Jul 2023 10:35:12 +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 <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qObrM-0000JJ-0h
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 10:35:12 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20602.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::602])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 18786356-2ba0-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 12:35:10 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB9175.eurprd04.prod.outlook.com (2603:10a6:20b:44a::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 10:35:08 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 10:35:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 18786356-2ba0-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Uq9CgiWYX/RWkQ2UTKQ7FAI9AZQHGTcVKFqWjeXdZRUHIvce38Bs+sErV1gn0AmYFigdHjFdvZUOrZNP2bWRy8MI5OEo1Js1DfvZWeVJkQdxAThKLiRGmunH0DES/Crr2VuXOlDRf3ICibSVcl8MAL8In4R8a8EKn942IkxRPkQJmIMJBGYJFsKxeTzqoUHHquSdfqiEL6RspqfIfxXsHkFYUAagy2sy30rs4WxWG0ZFJcYdNPQDZe20h/6asPnpAbpMHoN3oINwnLRhv+dgNZXFHHP6lJ2MHYUy+t/l/l9vt0RyuWCtTplZN0TUGPyipsnLJRSRJvPnSsmGz2tvMw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=L7fll069aCOGhw/Ujfnzc7eYrLnddgaGWv3jfKQz64w=;
 b=hXIUzDngWICNoHZZyVas9DwoxToew+ySpHApwhblOjigvYovQqT1LdvSHTjVw1KiiM2eYjAj1RKTu+vh04MsCNwM0QjE+ygYjqrDjWmKRE/K2nQJfQYRuPAj/A7T6LbNdgz981tLIbzBXiOyAcpXafULKhGkQqDi2Lifr/0XYEiotEHsu25b5R9phHeSkYCATZoJafATl5jAZx/0Rl1PIe1nj9dqOTXK6J36G4CPN3Ej7ZPwrTjakm+0y0U48B45SdF7MPpYYUAXYL8sqd/OXD6AvgOG+p5dthmAWq/adnEPm3J2lAin4PCD46PtcPJrnhJ9F3awF88Ha2nU9x7V0A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=L7fll069aCOGhw/Ujfnzc7eYrLnddgaGWv3jfKQz64w=;
 b=a9BEUIZHRI4N248NyvYpGbKaxTnc/hWC3dABl/e63jDTeIcbAjeW9JWKQE41Tbz2KAettUOG28vSJVOZeXWYIG7BmU9Y+nU3slMj+Id7toIctVt+I4oX5jCyjAS3BK/3jaDAbiatWlrCsTG6H9pN8LhmD/FJ9MX6fwbNCIh72emXTvyzgB7/9rKVoGKtZ1q1D9atTbJyksIaVKw6z0sdJW9MP7B4m5iEvGKzvClAWwfg3evvGhGHyy7gTi3r2XmxWycWifLQaTjd9iCgQ/AKbrsPIQcUc6epoTEqYjokfSC0U+zlEl7wXzalFoMU4e0XkGfBOOj6I6RurT1Xe6u7uw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <367db8f8-3287-d694-e591-efcffaf9ee99@suse.com>
Date: Wed, 26 Jul 2023 12:35:02 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v3 5/5] x86: short-circuit certain cpu_has_* when
 x86-64-v{2,3} are in effect
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <10ce72fb-4fb7-67de-41ec-7291dbac0038@suse.com>
In-Reply-To: <10ce72fb-4fb7-67de-41ec-7291dbac0038@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0086.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9b::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB9175:EE_
X-MS-Office365-Filtering-Correlation-Id: 7566a849-3fc9-4cae-5308-08db8dc3fb61
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	ifCeFUCnR6lwHLjtHZipaMwiJracc2ZrDpwhR6tR8Wg9cwCsgzPH4BOIuw7zyRT8bcVOOpdyutDgZhb/4eT6+avo0s1jLftAHSI87+gLFbH/qacaEM3LX2uasbTZ0748Y5LHAh3ldFL6q+Dg1JdHCJ6PZVCmQ/leJARFfKlkAm6xgLF+STadqcY6NIyQXMLwr7YQqGyK9veDzUc4s6vC4Cxh15M5+j1AAPR4xstdAVH45wNHSpWiJhUjRrdv+wvD0BrjGh/3KJrYXCQCD40oYANF+O9joxYvj5+K2yxhJTrmajER6eYpMbke8G9m8YrDfLOD0yKA2lbpmKD4AczAZPuxT3QvEkbGr+vbo3+fy6A7kRJuKC7R1xvMiDhSVtFocEWq0P5fc5LkxR727A0wQjXorKrQzJyh2WeBY2gs0vUnOazu1ZpqZT2Mxy478uv/PtankHmQyiz9SMq2T9y1XjatxiVPu4q7yygvBeoUAuQO6bwkYVSnaDtsG0jad5nWN1jAouL8ncmPwVJOSorYmXHB9ZU19nZ0ESFNe1ngUBalKn36A7YcnDgNzwyPYpnxaxc2BCeIGkLSK1iVo1nepejU0Zfgni4wTKRFViNUociq5wDY3xjlrBXNgcf//nsXVGHJen9yatuv9+iVNVkziw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(376002)(366004)(396003)(136003)(451199021)(54906003)(6512007)(6486002)(6666004)(478600001)(66476007)(2616005)(26005)(186003)(6506007)(2906002)(66556008)(6916009)(66946007)(316002)(4326008)(5660300002)(8936002)(8676002)(41300700001)(38100700002)(86362001)(31696002)(36756003)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?b3M2djdiOUo3QnJzTFZUMjhBYVFSdEdtV2VIbDd1eE9VeFZDU2xnWEdEWXR0?=
 =?utf-8?B?a2FLY01kS09yQU5zTDh0SXhtYnJMck9LaVptZkF0WXhxWTdOMlo3V3JTbExY?=
 =?utf-8?B?YzgxZEhoQ3pIUm01ZzQvMWg2b0tzZ0MwNlRXdUtaM29HZ1djaFVlNDQ2ZDZm?=
 =?utf-8?B?M0xWYWNCVXBuMDUxQTZWb0dmOUcxeWdCY1FtTGk4bld5ZXdUL1l6Mml0V09k?=
 =?utf-8?B?ZnR3V2dmQXUxclg2MzhoSWcvK1Q1SEx2RGtURStReU9oeHovNGlJcWwyd0ph?=
 =?utf-8?B?QjRXNnVzWk9VNGJJYmdid1pSZlJQeTBvR3FVYmRZSnJqb0taVjlNZ2VzbmNs?=
 =?utf-8?B?UW1NWXZtTzh3UzRhd3I2YVJrdytGMXg4eEZ0aDlsazVMeWpNVm1yMTlrL1lm?=
 =?utf-8?B?UVBvd2xyMXZTUUgvdkpFZ2NmWnowYnlPNVptTTFXTDFOcmY1dzdCQkZsWFV3?=
 =?utf-8?B?NlRrT2NTVUVpTTIwbVlpdEc4QThURFAwM2ZXVnpuKzErUHZjK0FPaUxPZWw0?=
 =?utf-8?B?QTZwR1JDMWpZZE52cmdIK1ZmS2o5a29mT3JMMFE2enBzOVpKeWlHdFhWNGdr?=
 =?utf-8?B?b3BEM1I2U05Qd0lidDVxQVVLQkFWUG80b1lTd2lhQ3FHZ1FwUDdmNTI2eEhu?=
 =?utf-8?B?Wll0VVVrVWg2c3ZFZklpb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amNtU3M3Y0RZZTErRkJa?=
 =?utf-8?B?aVBxWDQ5ekF6MVcwOEJWQUkvbzQzREFDNFlqOW9CMnR2clZhOVp2YmlVSk8y?=
 =?utf-8?B?VnBYTGpsUnNENjErUjB4NnRmakZaT3FsbXhSVDlOZGtKZ0R4azQ4dmNMRDBU?=
 =?utf-8?B?ZVQ0ck56TklER1dUTkxPS0g4VXMxRG95SjRDTjJjY210OWhwNTVyTHVlbjZX?=
 =?utf-8?B?VWtNUEJvb2NaTHIvWUJUeTgvK0JJZk9qVTB4RFpyUlBBajNXSTBoQzJCYllS?=
 =?utf-8?B?Z3B5QXVBTThwdnd2SWNHMlQ2MEMwZy96T0kvdndjekRoMlFvOXR4V3B3Um15?=
 =?utf-8?B?T3BRZEl2Sm51bXVOSk9jK1dDWFc2UnNaUWtWYTMyeW5mdGhJRzAxekovNWdE?=
 =?utf-8?B?Q0RkZlg5SjVrb0d5QW1jeHE5VFFqMmtZYjdVYWVVRXQybzhZcGk4bHpUV3lh?=
 =?utf-8?B?NXhLNDVIUktMTHRodHJheElkLzY1eUJjcjlZakFXSHBXYjYwTmp2bGNEVWdO?=
 =?utf-8?B?UllLWkFGeUVjOUNNQlQ1RTcvSzhYblNOVzRyWG1BbTJWUWdNTjIxYTFvcktZ?=
 =?utf-8?Q?X+TDxK3YPCCTlKYV/nAwjjPWR?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7566a849-3fc9-4cae-5308-08db8dc3fb61
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 10:35:07.9880
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: FS2i1ATqXtHVRibKZdJw23TtvmgxYh4uNG+nEizuc7zhEwY4dLjrzq+n0j814i1zMUfYa7d8V1L1NvRUD0aJSw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9175

Certain fallback code can be made subject to DCE this way. Note that
CX16 has no compiler provided manifest constant, so CONFIG_* are used
there instead. Note also that we don't have cpu_has_movbe nor
cpu_has_lzcnt (aka cpu_has_abm).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Of course we could use IS_ENABLED(CONFIG_X86_64_V<n>) everywhere, but as
CX16 shows this isn't necessarily better than the #if/#else approach
based on compiler-provided manifest symbols. While not really intended
to be used that way, it looks as if we could also use
IS_ENABLED(__POPCNT__) and alike if we thought this would end up neater
(because of avoiding the #ifdef).

We could go further and also short-circuit SSE*, AVX and alike, which we
don't use outside of the emulator. This then would of course call for
also having a way to select x86-64-v4.
---
v2: Also cover XSAVE.

--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -76,15 +76,25 @@ static inline bool boot_cpu_has(unsigned
 #define cpu_has_eist            boot_cpu_has(X86_FEATURE_EIST)
 #define cpu_has_ssse3           boot_cpu_has(X86_FEATURE_SSSE3)
 #define cpu_has_fma             boot_cpu_has(X86_FEATURE_FMA)
-#define cpu_has_cx16            boot_cpu_has(X86_FEATURE_CX16)
+#define cpu_has_cx16            (IS_ENABLED(CONFIG_X86_64_V2) || \
+                                 IS_ENABLED(CONFIG_X86_64_V3) || \
+                                 boot_cpu_has(X86_FEATURE_CX16))
 #define cpu_has_pdcm            boot_cpu_has(X86_FEATURE_PDCM)
 #define cpu_has_pcid            boot_cpu_has(X86_FEATURE_PCID)
 #define cpu_has_sse4_1          boot_cpu_has(X86_FEATURE_SSE4_1)
 #define cpu_has_sse4_2          boot_cpu_has(X86_FEATURE_SSE4_2)
 #define cpu_has_x2apic          boot_cpu_has(X86_FEATURE_X2APIC)
+#ifdef __POPCNT__
+#define cpu_has_popcnt          true
+#else
 #define cpu_has_popcnt          boot_cpu_has(X86_FEATURE_POPCNT)
+#endif
 #define cpu_has_aesni           boot_cpu_has(X86_FEATURE_AESNI)
+#ifdef __XSAVE__
+#define cpu_has_xsave           true
+#else
 #define cpu_has_xsave           boot_cpu_has(X86_FEATURE_XSAVE)
+#endif
 #define cpu_has_avx             boot_cpu_has(X86_FEATURE_AVX)
 #define cpu_has_f16c            boot_cpu_has(X86_FEATURE_F16C)
 #define cpu_has_rdrand          boot_cpu_has(X86_FEATURE_RDRAND)
@@ -114,11 +124,19 @@ static inline bool boot_cpu_has(unsigned
 #define cpu_has_xsaves          boot_cpu_has(X86_FEATURE_XSAVES)
 
 /* CPUID level 0x00000007:0.ebx */
+#ifdef __BMI__
+#define cpu_has_bmi1            true
+#else
 #define cpu_has_bmi1            boot_cpu_has(X86_FEATURE_BMI1)
+#endif
 #define cpu_has_hle             boot_cpu_has(X86_FEATURE_HLE)
 #define cpu_has_avx2            boot_cpu_has(X86_FEATURE_AVX2)
 #define cpu_has_smep            boot_cpu_has(X86_FEATURE_SMEP)
+#ifdef __BMI2__
+#define cpu_has_bmi2            true
+#else
 #define cpu_has_bmi2            boot_cpu_has(X86_FEATURE_BMI2)
+#endif
 #define cpu_has_invpcid         boot_cpu_has(X86_FEATURE_INVPCID)
 #define cpu_has_rtm             boot_cpu_has(X86_FEATURE_RTM)
 #define cpu_has_pqe             boot_cpu_has(X86_FEATURE_PQE)



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 10:42:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 10:42:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570294.892040 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOby3-0003C0-LV; Wed, 26 Jul 2023 10:42:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570294.892040; Wed, 26 Jul 2023 10:42:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOby3-0003Bt-IV; Wed, 26 Jul 2023 10:42:07 +0000
Received: by outflank-mailman (input) for mailman id 570294;
 Wed, 26 Jul 2023 10:42:07 +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 <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOby3-0003Bn-AH
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 10:42:07 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on0619.outbound.protection.outlook.com
 [2a01:111:f400:fe02::619])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0ffbf0aa-2ba1-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 12:42:05 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB8PR04MB6828.eurprd04.prod.outlook.com (2603:10a6:10:113::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Wed, 26 Jul
 2023 10:42:02 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 10:42:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0ffbf0aa-2ba1-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Dv+G2PljGTRYju51bE7EcRxPuf//IjsHNgsg8O8BSZTjDo551f+5Ec2aGH8T/rviNRzHDxmiZxs+25vT4KqCCzRO+R8UuoWEmzALqAt8bHMZ45xrHPDQ9Isg3UvteILTLc1daEzjLPURx54pawVYtbLu0Dj8Bmb/V1qjb8M41rHaaboHJlhZF5jlwriJESRrc5xRyVM1XCsMpk8IcgAdzubiDLgVSQRTBpumaagqX6UQgh6lh2MnFW2kNukYFCOZJ13Sqcsl337/OLLE4svyR6kcstMCGBNtwb/vg6CMB98a2946yD+3H+dtVnKiDAnCLVrlZrMGlcEPeHw5rIqyQw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5kslvcGE2F0R7sANvGqX9gghrY4Y889SAtYbuo1YxJQ=;
 b=DwJMlnQvQu4KGtUPUOV/nkPAY1BEbfmTRs8c5wvGvNLkBW7lIPwu1KqWas2ZbJBTiYKyGgcRZ0qP3SRh/amd/T1vAhOFqaQBo8qUp3NySkNWqHHABeg4l8iRhRZ6CSdM1kFxUVhlYbSoWVF86Ri0bQOrpy6ehlKWR57Jr0VJKkm7TdvyyyVRg4yVdaeJyHT/7R+E2xfic8YGj9klSi1b6nPgeD+SYhqEaurEZ+OSBFdlLMnfsE1YK8b8gIYxkMKpx/MNPvaE3LPpT19uZYY6lX5J1HAvFphiVUL1X5wFpAwfDnKSEwI/dVqhAVJ2cSEH9o9G8s+f4PlTlzhdJzh7YA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5kslvcGE2F0R7sANvGqX9gghrY4Y889SAtYbuo1YxJQ=;
 b=Z+JO0rwmtN9Y1UkzpQ31BufTHMlSdQ15huFNSpooC9AR5/+ZKRGWPAau6YOWHBnW+HV60hb96Z8QdvKrhbiLY6IyRK3qp86vLecQ2HarBF0s/fyx9akgRV00bV1mPGIOC3uMYIB4vVtE7kBEz/aUCaHbsJ/luAsjy4R2GQuGqQ9PThgw4dkY2PQNCpKaX8Gp385DYD8QqdVJYUq2ivJ7DhNi9voGu2tC49QRqWf7NhABYSfote3hUiKJq9lZtcOJEopSfrUELsntOQ8RKoHfnmqmNL94AxBN83/FqPjIF6zu2Kou6Np7OkgYtnP/QlhWcs0BDkkpK4zMxfrv1SsJ/Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <a7f49430-5933-8388-f73b-3f75a5877bf4@suse.com>
Date: Wed, 26 Jul 2023 12:42:00 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Anthony Perard <anthony.perard@citrix.com>, Wei Liu <wl@xen.org>,
 Juergen Gross <jgross@suse.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] libxenstat/Linux: pass nul-terminated string to strpbrk()
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0160.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:99::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB8PR04MB6828:EE_
X-MS-Office365-Filtering-Correlation-Id: 6b95216e-b304-4888-1b60-08db8dc4f212
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	tNaTQaIfcadOFLMtlQflc67fbR1Zu3gpS3XFthz9Vad2lGXB8BSkm5bqf8OOa92TmDt4jGg8jRLgTu4PFS17kkXqpUrae2rCPZed/JU/JSW9JD3gXuZPugaKD2ZbuiWZs+h8vxnS5Y1FKU7Tpk14KxyGPeeaXQvCR9mPzP4XwxFAIEyhyC58JbBOj1Tmtp+NFyQZYraSMaYJQPfTADLqv1thcL2HwhIM4ku6rTuc6f2MIpN3tZOoU6BpspN4C061qtixMvmCigYlxSqvxYaA/nMsPXOXE+KKyK+02qKBUbV0pfUotfCIpzWhVfVD4DuM/F60l54xK76/BUQS+qaRlE2iw7191iXvML9enX2AlJv/5H46cADQ4I54Bbk4kt3IX/QtLOH/SInQgwOGN3pLHenqcclk4O7GTgPUGSTEtk1Js3X7uQEmAc+/qO2etyu96mOiZPZ1e5Ke82D+t1+YeaKHK13t47dH1tJlQp+jF+k3VLLcZYBw+lE95rPclEOp0s4iMJQSGN58KM3Q0Yg2zB1PnPTW+pLN+GqLru1jJ58tnVyZ0O/xmtYw6Fatx/CYgRe1bJrErfdXGI61pPAQWS7N3pWucMDmP460pL7vhgKOvRy3Unows+5aE6Zf9YFUU8K6aaeGAPb7N2C4LZhKTDQv+aM0amUl4Jqp9jIGmAbQyvcQUteTCni21JiCIK5T
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(396003)(366004)(39860400002)(136003)(451199021)(54906003)(478600001)(6486002)(38100700002)(6512007)(41300700001)(5660300002)(8676002)(2616005)(66556008)(6916009)(66476007)(316002)(4326008)(66946007)(8936002)(186003)(107886003)(6506007)(26005)(86362001)(31696002)(2906002)(36756003)(31686004)(66899021)(133343001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eUhyR3VxT3BsN3MrbWFCbzFUa3dRZU1PM2h6cXFyUXVrbnZOTkw5dS9PU2Fx?=
 =?utf-8?B?K3Mxbjk0VWplOFg5NlpueTh6bGlNdUl2bms1ako0TG0wYzU5UWp5Yk8yRWZq?=
 =?utf-8?B?QzdLL1ZxU0lZUjI3N2V6cm1NdEZ4TjEvbWVGRzhzMjgzeGZNSUNUaWNPTTB0?=
 =?utf-8?B?cGpyR0tDSWlxU2w4QW9qWmlxUFBIRGdSclZIRk0wUkExQzN3MEJuaDlyVmlq?=
 =?utf-8?B?a0hKL0ZOVVJRTjdaZDFFVThONkdiSmtwUCtTU1FhR3I2K0o5czgwWXArZEI3?=
 =?utf-8?B?Y1l5d0ROSmx3M3U3Y2N4UTBoMXlyVkVUSjEzd1VhMUVpdDZQK0tGQnBicEFz?=
 =?utf-8?B?UHNCN0QyV05HTWZtNFN0OGw4ZVlEUHYzR2orVU5MUlozQTBzNUsxdmV5dlQ2?=
 =?utf-8?B?Zi92V20xLzhqL21zcTVtQzBFd2VQMmRad2ZjMXR5dmVEdnhpT2M3WEptUGcw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
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 10:42:01.8587
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: fSTFN+3vbdQh5kSn4b0sX5ZiJ9bEibJQlX6DTC318qhBYG+KqSDQolKntGjHqdKHOb+3XNdBvwZSf0f0rfEbLQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6828

While what "tmp" points to has been cleared at the end of the first
iteration of parseNetDevLine()'s main loop, this is too late for the
first iteration's invocation of strpbrk() (copying the interface name).
Properly nul-terminate the string at population time instead, removing
the late clearing.

While there also eliminate a confusing (because of being wrong) comment:
A regex parsing error would be handled one further scope outwards. Here
we're dealing with field 1 vs any of the later fields.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Of course the function leaves much to be desired.

We had a report of a problem which may have been because of the issue
addressed here. Sadly the reporter hasn't come back with any results, so
I have to submit this largely "blindly".

--- a/tools/libs/stat/xenstat_linux.c
+++ b/tools/libs/stat/xenstat_linux.c
@@ -169,6 +169,7 @@ static int parseNetDevLine(char *line, c
 							matches[i].rm_so + 1) * sizeof(char));
 				for (x = matches[i].rm_so; x < matches[i].rm_eo; x++)
 					tmp[x - matches[i].rm_so] = line[x];
+				tmp[x - matches[i].rm_so] = 0;
 
 				/* We populate all the fields from /proc/net/dev line */
 				if (i > 1) {
@@ -225,15 +226,11 @@ static int parseNetDevLine(char *line, c
 							break;
 					}
 				}
-				else
-				/* There were errors when parsing this directly in RE. strpbrk() helps */
-				if (iface != NULL) {
+				else if (iface != NULL) {
 					char *tmp2 = strpbrk(tmp, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
 					if (tmp2 != NULL)
 						strcpy(iface, tmp2);
 				}
-
-				memset(tmp, 0, matches[i].rm_eo - matches[i].rm_so);
 			}
 		}
 	}


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 11:04:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 11:04:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570305.892059 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOcJX-00061W-PM; Wed, 26 Jul 2023 11:04:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570305.892059; Wed, 26 Jul 2023 11:04:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOcJX-00061M-Mp; Wed, 26 Jul 2023 11:04:19 +0000
Received: by outflank-mailman (input) for mailman id 570305;
 Wed, 26 Jul 2023 11:04:18 +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
 <SRS0=j0A2=DM=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qOcJW-000611-7w
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 11:04:18 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 28a7ae0b-2ba4-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 13:04:15 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.26.92])
 by support.bugseng.com (Postfix) with ESMTPSA id 21AE84EE073A;
 Wed, 26 Jul 2023 13:04:14 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 28a7ae0b-2ba4-11ee-8613-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v4 1/4] x86/vmx: address violations of MISRA C:2012 Rule 7.2
Date: Wed, 26 Jul 2023 13:03:36 +0200
Message-Id: <6c2473a29d60460bf69382fd1e983752634b6992.1690368810.git.simone.ballarin@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690368810.git.simone.ballarin@bugseng.com>
References: <cover.1690368810.git.simone.ballarin@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type.

For the sake of uniformity, the following changes are made:
- add the 'U' suffix to macros near
  'CPU_BASED_ACTIVATE_SECONDARY_CONTROLS' and
  'SECONDARY_EXEC_NOTIFY_VM_EXITING' macros in 'vmcs.h'
- add the 'U' suffix to macros near 'INTR_INFO_VALID_MASK'
  macro in 'vmx.h'

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v4:
- change commit headline

Changes in v3:
- change 'Signed-off-by' ordering
- change commit message
- remove unnecessary changes in 'vvmx.c'
- add 'uint32_t' casts in 'vvmx.c'
- add missing 'U' in 'vmcs.h' macros
- change macro to '(1u << 31)' in 'vmx.h'
- remove unnecessary changes to 'vmx.h'

Changes in v2:
- minor change to commit title
- change commit message
- remove unnecessary changes in 'vpmu_intel.c' and 'vmx.h'
- add 'ULL' suffix in 'vpmu_intel.c'
- add zero-padding to constants in 'vmx.h'
- add missing 'U' in 'vmx.h'
---
 xen/arch/x86/cpu/vpmu_intel.c           |  2 +-
 xen/arch/x86/hvm/vmx/vmcs.c             |  6 +-
 xen/arch/x86/hvm/vmx/vvmx.c             |  8 +--
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h | 84 ++++++++++++-------------
 xen/arch/x86/include/asm/hvm/vmx/vmx.h  | 16 ++---
 5 files changed, 58 insertions(+), 58 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index fa5b40c65c..6330c89b47 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -945,7 +945,7 @@ const struct arch_vpmu_ops *__init core2_vpmu_init(void)
     fixed_counters_mask = ~((1ull << core2_get_bitwidth_fix_count()) - 1);
     global_ctrl_mask = ~((((1ULL << fixed_pmc_cnt) - 1) << 32) |
                          ((1ULL << arch_pmc_cnt) - 1));
-    global_ovf_ctrl_mask = ~(0xC000000000000000 |
+    global_ovf_ctrl_mask = ~(0xC000000000000000ULL |
                              (((1ULL << fixed_pmc_cnt) - 1) << 32) |
                              ((1ULL << arch_pmc_cnt) - 1));
     if ( version > 2 )
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 13719cc923..6cefb88aec 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -911,7 +911,7 @@ void vmx_clear_msr_intercept(struct vcpu *v, unsigned int msr,
         if ( type & VMX_MSR_W )
             clear_bit(msr, msr_bitmap->write_low);
     }
-    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
+    else if ( (msr >= 0xc0000000U) && (msr <= 0xc0001fffU) )
     {
         msr &= 0x1fff;
         if ( type & VMX_MSR_R )
@@ -939,7 +939,7 @@ void vmx_set_msr_intercept(struct vcpu *v, unsigned int msr,
         if ( type & VMX_MSR_W )
             set_bit(msr, msr_bitmap->write_low);
     }
-    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
+    else if ( (msr >= 0xc0000000U) && (msr <= 0xc0001fffU) )
     {
         msr &= 0x1fff;
         if ( type & VMX_MSR_R )
@@ -957,7 +957,7 @@ bool vmx_msr_is_intercepted(struct vmx_msr_bitmap *msr_bitmap,
     if ( msr <= 0x1fff )
         return test_bit(msr, is_write ? msr_bitmap->write_low
                                       : msr_bitmap->read_low);
-    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
+    else if ( (msr >= 0xc0000000U) && (msr <= 0xc0001fffU) )
         return test_bit(msr & 0x1fff, is_write ? msr_bitmap->write_high
                                                : msr_bitmap->read_high);
     else
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 16b0ef82b6..b7be424afb 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -263,7 +263,7 @@ uint64_t get_vvmcs_virtual(void *vvmcs, uint32_t vmcs_encoding)
             res >>= 32;
         break;
     case VVMCS_WIDTH_32:
-        res &= 0xffffffff;
+        res = (uint32_t)res;
         break;
     case VVMCS_WIDTH_NATURAL:
     default:
@@ -315,14 +315,14 @@ void set_vvmcs_virtual(void *vvmcs, uint32_t vmcs_encoding, uint64_t val)
     case VVMCS_WIDTH_64:
         if ( enc.access_type )
         {
-            res &= 0xffffffff;
+            res = (uint32_t)res;
             res |= val << 32;
         }
         else
             res = val;
         break;
     case VVMCS_WIDTH_32:
-        res = val & 0xffffffff;
+        res = (uint32_t)val;
         break;
     case VVMCS_WIDTH_NATURAL:
     default:
@@ -2306,7 +2306,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         break;
     case MSR_IA32_VMX_CR0_FIXED1:
         /* allow 0-settings for all bits */
-        data = 0xffffffff;
+        data = 0xffffffffU;
         break;
     case MSR_IA32_VMX_CR4_FIXED0:
         /* VMXE bit must be 1 in VMX operation */
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
index d07fcb2bc9..e056643993 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
@@ -187,27 +187,27 @@ bool_t __must_check vmx_vmcs_try_enter(struct vcpu *v);
 void vmx_vmcs_exit(struct vcpu *v);
 void vmx_vmcs_reload(struct vcpu *v);
 
-#define CPU_BASED_VIRTUAL_INTR_PENDING        0x00000004
-#define CPU_BASED_USE_TSC_OFFSETING           0x00000008
-#define CPU_BASED_HLT_EXITING                 0x00000080
-#define CPU_BASED_INVLPG_EXITING              0x00000200
-#define CPU_BASED_MWAIT_EXITING               0x00000400
-#define CPU_BASED_RDPMC_EXITING               0x00000800
-#define CPU_BASED_RDTSC_EXITING               0x00001000
-#define CPU_BASED_CR3_LOAD_EXITING            0x00008000
-#define CPU_BASED_CR3_STORE_EXITING           0x00010000
-#define CPU_BASED_CR8_LOAD_EXITING            0x00080000
-#define CPU_BASED_CR8_STORE_EXITING           0x00100000
-#define CPU_BASED_TPR_SHADOW                  0x00200000
-#define CPU_BASED_VIRTUAL_NMI_PENDING         0x00400000
-#define CPU_BASED_MOV_DR_EXITING              0x00800000
-#define CPU_BASED_UNCOND_IO_EXITING           0x01000000
-#define CPU_BASED_ACTIVATE_IO_BITMAP          0x02000000
-#define CPU_BASED_MONITOR_TRAP_FLAG           0x08000000
-#define CPU_BASED_ACTIVATE_MSR_BITMAP         0x10000000
-#define CPU_BASED_MONITOR_EXITING             0x20000000
-#define CPU_BASED_PAUSE_EXITING               0x40000000
-#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000
+#define CPU_BASED_VIRTUAL_INTR_PENDING        0x00000004U
+#define CPU_BASED_USE_TSC_OFFSETING           0x00000008U
+#define CPU_BASED_HLT_EXITING                 0x00000080U
+#define CPU_BASED_INVLPG_EXITING              0x00000200U
+#define CPU_BASED_MWAIT_EXITING               0x00000400U
+#define CPU_BASED_RDPMC_EXITING               0x00000800U
+#define CPU_BASED_RDTSC_EXITING               0x00001000U
+#define CPU_BASED_CR3_LOAD_EXITING            0x00008000U
+#define CPU_BASED_CR3_STORE_EXITING           0x00010000U
+#define CPU_BASED_CR8_LOAD_EXITING            0x00080000U
+#define CPU_BASED_CR8_STORE_EXITING           0x00100000U
+#define CPU_BASED_TPR_SHADOW                  0x00200000U
+#define CPU_BASED_VIRTUAL_NMI_PENDING         0x00400000U
+#define CPU_BASED_MOV_DR_EXITING              0x00800000U
+#define CPU_BASED_UNCOND_IO_EXITING           0x01000000U
+#define CPU_BASED_ACTIVATE_IO_BITMAP          0x02000000U
+#define CPU_BASED_MONITOR_TRAP_FLAG           0x08000000U
+#define CPU_BASED_ACTIVATE_MSR_BITMAP         0x10000000U
+#define CPU_BASED_MONITOR_EXITING             0x20000000U
+#define CPU_BASED_PAUSE_EXITING               0x40000000U
+#define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000U
 extern u32 vmx_cpu_based_exec_control;
 
 #define PIN_BASED_EXT_INTR_MASK         0x00000001
@@ -238,26 +238,26 @@ extern u32 vmx_vmexit_control;
 #define VM_ENTRY_LOAD_BNDCFGS           0x00010000
 extern u32 vmx_vmentry_control;
 
-#define SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES 0x00000001
-#define SECONDARY_EXEC_ENABLE_EPT               0x00000002
-#define SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING 0x00000004
-#define SECONDARY_EXEC_ENABLE_RDTSCP            0x00000008
-#define SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE   0x00000010
-#define SECONDARY_EXEC_ENABLE_VPID              0x00000020
-#define SECONDARY_EXEC_WBINVD_EXITING           0x00000040
-#define SECONDARY_EXEC_UNRESTRICTED_GUEST       0x00000080
-#define SECONDARY_EXEC_APIC_REGISTER_VIRT       0x00000100
-#define SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY    0x00000200
-#define SECONDARY_EXEC_PAUSE_LOOP_EXITING       0x00000400
-#define SECONDARY_EXEC_ENABLE_INVPCID           0x00001000
-#define SECONDARY_EXEC_ENABLE_VM_FUNCTIONS      0x00002000
-#define SECONDARY_EXEC_ENABLE_VMCS_SHADOWING    0x00004000
-#define SECONDARY_EXEC_ENABLE_PML               0x00020000
-#define SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS   0x00040000
-#define SECONDARY_EXEC_XSAVES                   0x00100000
-#define SECONDARY_EXEC_TSC_SCALING              0x02000000
-#define SECONDARY_EXEC_BUS_LOCK_DETECTION       0x40000000
-#define SECONDARY_EXEC_NOTIFY_VM_EXITING        0x80000000
+#define SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES 0x00000001U
+#define SECONDARY_EXEC_ENABLE_EPT               0x00000002U
+#define SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING 0x00000004U
+#define SECONDARY_EXEC_ENABLE_RDTSCP            0x00000008U
+#define SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE   0x00000010U
+#define SECONDARY_EXEC_ENABLE_VPID              0x00000020U
+#define SECONDARY_EXEC_WBINVD_EXITING           0x00000040U
+#define SECONDARY_EXEC_UNRESTRICTED_GUEST       0x00000080U
+#define SECONDARY_EXEC_APIC_REGISTER_VIRT       0x00000100U
+#define SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY    0x00000200U
+#define SECONDARY_EXEC_PAUSE_LOOP_EXITING       0x00000400U
+#define SECONDARY_EXEC_ENABLE_INVPCID           0x00001000U
+#define SECONDARY_EXEC_ENABLE_VM_FUNCTIONS      0x00002000U
+#define SECONDARY_EXEC_ENABLE_VMCS_SHADOWING    0x00004000U
+#define SECONDARY_EXEC_ENABLE_PML               0x00020000U
+#define SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS   0x00040000U
+#define SECONDARY_EXEC_XSAVES                   0x00100000U
+#define SECONDARY_EXEC_TSC_SCALING              0x02000000U
+#define SECONDARY_EXEC_BUS_LOCK_DETECTION       0x40000000U
+#define SECONDARY_EXEC_NOTIFY_VM_EXITING        0x80000000U
 extern u32 vmx_secondary_exec_control;
 
 #define VMX_EPT_EXEC_ONLY_SUPPORTED                         0x00000001
@@ -346,7 +346,7 @@ extern u64 vmx_ept_vpid_cap;
 #define cpu_has_vmx_notify_vm_exiting \
     (vmx_secondary_exec_control & SECONDARY_EXEC_NOTIFY_VM_EXITING)
 
-#define VMCS_RID_TYPE_MASK              0x80000000
+#define VMCS_RID_TYPE_MASK              0x80000000U
 
 /* GUEST_INTERRUPTIBILITY_INFO flags. */
 #define VMX_INTR_SHADOW_STI             0x00000001
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
index c84acc221d..d4b335a2bc 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
@@ -137,7 +137,7 @@ static inline void pi_clear_sn(struct pi_desc *pi_desc)
 /*
  * Exit Reasons
  */
-#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000
+#define VMX_EXIT_REASONS_FAILED_VMENTRY (1u << 31)
 #define VMX_EXIT_REASONS_BUS_LOCK       (1u << 26)
 
 #define EXIT_REASON_EXCEPTION_NMI       0
@@ -209,12 +209,12 @@ static inline void pi_clear_sn(struct pi_desc *pi_desc)
  * Note INTR_INFO_NMI_UNBLOCKED_BY_IRET is also used with Exit Qualification
  * field for EPT violations, PML full and SPP-related event vmexits.
  */
-#define INTR_INFO_VECTOR_MASK           0xff            /* 7:0 */
-#define INTR_INFO_INTR_TYPE_MASK        0x700           /* 10:8 */
-#define INTR_INFO_DELIVER_CODE_MASK     0x800           /* 11 */
-#define INTR_INFO_NMI_UNBLOCKED_BY_IRET 0x1000          /* 12 */
-#define INTR_INFO_VALID_MASK            0x80000000      /* 31 */
-#define INTR_INFO_RESVD_BITS_MASK       0x7ffff000
+#define INTR_INFO_VECTOR_MASK           0x000000ffU     /* 7:0 */
+#define INTR_INFO_INTR_TYPE_MASK        0x00000700U     /* 10:8 */
+#define INTR_INFO_DELIVER_CODE_MASK     0x00000800U     /* 11 */
+#define INTR_INFO_NMI_UNBLOCKED_BY_IRET 0x00001000U     /* 12 */
+#define INTR_INFO_VALID_MASK            0x80000000U     /* 31 */
+#define INTR_INFO_RESVD_BITS_MASK       0x7ffff000U
 
 /*
  * Exit Qualifications for NOTIFY VM EXIT
@@ -607,7 +607,7 @@ static inline void vmx_pi_hooks_assign(struct domain *d) {}
 static inline void vmx_pi_hooks_deassign(struct domain *d) {}
 #endif
 
-#define APIC_INVALID_DEST           0xffffffff
+#define APIC_INVALID_DEST           0xffffffffU
 
 /* EPT violation qualifications definitions */
 typedef union ept_qual {
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 11:04:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 11:04:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570306.892069 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOcJZ-0006Gu-0r; Wed, 26 Jul 2023 11:04:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570306.892069; Wed, 26 Jul 2023 11:04:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOcJY-0006Gl-Tw; Wed, 26 Jul 2023 11:04:20 +0000
Received: by outflank-mailman (input) for mailman id 570306;
 Wed, 26 Jul 2023 11:04:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=j0A2=DM=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qOcJX-0005mC-Lx
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 11:04:19 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2aeff599-2ba4-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 13:04:19 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.26.92])
 by support.bugseng.com (Postfix) with ESMTPSA id 46FF34EE073C;
 Wed, 26 Jul 2023 13:04:18 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2aeff599-2ba4-11ee-b242-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Jan Beulich <jbeulich@suse.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v4 2/4] xen/vpci: address violations of MISRA C:2012 Rule 7.2
Date: Wed, 26 Jul 2023 13:03:37 +0200
Message-Id: <2cb770d946c4bf858a41271fd7b9985f789ca149.1690368810.git.simone.ballarin@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690368810.git.simone.ballarin@bugseng.com>
References: <cover.1690368810.git.simone.ballarin@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v4:
- change commit headline

Changes in v3:
- change 'Signed-off-by' ordering
- add 'uint32_t' casts in 'msi.c' and 'msix.c'

Changes in v2:
- minor change to commit title
- change commit message
---
 xen/drivers/vpci/msi.c  | 2 +-
 xen/drivers/vpci/msix.c | 2 +-
 xen/drivers/vpci/vpci.c | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/vpci/msi.c b/xen/drivers/vpci/msi.c
index 8f2b59e61a..bf5fe2f981 100644
--- a/xen/drivers/vpci/msi.c
+++ b/xen/drivers/vpci/msi.c
@@ -124,7 +124,7 @@ static void cf_check address_hi_write(
     struct vpci_msi *msi = data;
 
     /* Clear and update high part. */
-    msi->address &= 0xffffffff;
+    msi->address  = (uint32_t)msi->address;
     msi->address |= (uint64_t)val << 32;
 
     update_msi(pdev, msi);
diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 25bde77586..2090168f42 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -531,7 +531,7 @@ static int cf_check msix_write(
 
     case PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET:
         entry->updated = true;
-        entry->addr &= 0xffffffff;
+        entry->addr  = (uint32_t)entry->addr;
         entry->addr |= (uint64_t)data << 32;
         break;
 
diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index d73fa76302..3bec9a4153 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -319,7 +319,7 @@ static void vpci_write_hw(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
 static uint32_t merge_result(uint32_t data, uint32_t new, unsigned int size,
                              unsigned int offset)
 {
-    uint32_t mask = 0xffffffff >> (32 - 8 * size);
+    uint32_t mask = 0xffffffffU >> (32 - 8 * size);
 
     return (data & ~(mask << (offset * 8))) | ((new & mask) << (offset * 8));
 }
@@ -402,7 +402,7 @@ uint32_t vpci_read(pci_sbdf_t sbdf, unsigned int reg, unsigned int size)
         data = merge_result(data, tmp_data, size - data_offset, data_offset);
     }
 
-    return data & (0xffffffff >> (32 - 8 * size));
+    return data & (0xffffffffU >> (32 - 8 * size));
 }
 
 /*
@@ -427,7 +427,7 @@ static void vpci_write_helper(const struct pci_dev *pdev,
         data = merge_result(val, data, size, offset);
     }
 
-    r->write(pdev, r->offset, data & (0xffffffff >> (32 - 8 * r->size)),
+    r->write(pdev, r->offset, data & (0xffffffffU >> (32 - 8 * r->size)),
              r->private);
 }
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 11:04:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 11:04:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570304.892049 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOcJU-0005mP-HQ; Wed, 26 Jul 2023 11:04:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570304.892049; Wed, 26 Jul 2023 11:04:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOcJU-0005mI-Eu; Wed, 26 Jul 2023 11:04:16 +0000
Received: by outflank-mailman (input) for mailman id 570304;
 Wed, 26 Jul 2023 11:04:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=j0A2=DM=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qOcJT-0005mC-5m
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 11:04:15 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 27719c83-2ba4-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 13:04:13 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.26.92])
 by support.bugseng.com (Postfix) with ESMTPSA id C98084EE0738;
 Wed, 26 Jul 2023 13:04:11 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 27719c83-2ba4-11ee-b242-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Paul Durrant <paul@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [XEN PATCH 0/4] xen: address violations of MISRA C:2012 Rule 7.2
Date: Wed, 26 Jul 2023 13:03:35 +0200
Message-Id: <cover.1690368810.git.simone.ballarin@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose headline
states:
"A 'u' or 'U' suffix shall be applied to all integer constants that are
represented in an unsigned type".

These violations are caused by the missing "u" or "U" suffix in unsigned
integer constants, such as:

xen/arch/x86/hvm/hypercall.c:132.17-132.26
if ( (eax & 0x80000000) && is_viridian_domain(currd) )

If a rule is not met, changes are needed in order to achieve compliance.
The patches in this series achieve compliance for MISRA C:2012 Rule 7.2 by
adding the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Gianluca Luparini (4):
  x86/vmx: address violations of MISRA C:2012 Rule 7.2
  xen/vpci: address violations of MISRA C:2012 Rule 7.2
  x86/viridian: address violations of MISRA C:2012 Rule 7.2
  xen/x86: address violations of MISRA C:2012 Rule 7.2

 xen/arch/x86/apic.c                          |   2 +-
 xen/arch/x86/cpu-policy.c                    |  18 +-
 xen/arch/x86/cpu/mcheck/mce-apei.c           |   4 +-
 xen/arch/x86/cpu/vpmu_intel.c                |   2 +-
 xen/arch/x86/cpuid.c                         |   8 +-
 xen/arch/x86/efi/efi-boot.h                  |   6 +-
 xen/arch/x86/extable.c                       |   2 +-
 xen/arch/x86/hvm/hypercall.c                 |   2 +-
 xen/arch/x86/hvm/pmtimer.c                   |   4 +-
 xen/arch/x86/hvm/stdvga.c                    |  50 +++---
 xen/arch/x86/hvm/viridian/viridian.c         |   2 +-
 xen/arch/x86/hvm/vlapic.c                    |   6 +-
 xen/arch/x86/hvm/vmx/vmcs.c                  |   6 +-
 xen/arch/x86/hvm/vmx/vvmx.c                  |   8 +-
 xen/arch/x86/include/asm/apicdef.h           |   2 +-
 xen/arch/x86/include/asm/config.h            |   2 +-
 xen/arch/x86/include/asm/guest/hyperv-tlfs.h |  28 +--
 xen/arch/x86/include/asm/hpet.h              |   2 +-
 xen/arch/x86/include/asm/hvm/trace.h         |   4 +-
 xen/arch/x86/include/asm/hvm/vioapic.h       |   2 +-
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h      |  84 ++++-----
 xen/arch/x86/include/asm/hvm/vmx/vmx.h       |  16 +-
 xen/arch/x86/include/asm/msi.h               |   2 +-
 xen/arch/x86/include/asm/msr-index.h         | 180 +++++++++----------
 xen/arch/x86/include/asm/pci.h               |   8 +-
 xen/arch/x86/include/asm/x86-defns.h         |  24 +--
 xen/arch/x86/percpu.c                        |   2 +-
 xen/arch/x86/psr.c                           |   2 +-
 xen/arch/x86/spec_ctrl.c                     |   8 +-
 xen/arch/x86/x86_64/pci.c                    |   2 +-
 xen/arch/x86/x86_emulate/x86_emulate.h       |   2 +-
 xen/drivers/vpci/msi.c                       |   2 +-
 xen/drivers/vpci/msix.c                      |   2 +-
 xen/drivers/vpci/vpci.c                      |   6 +-
 xen/lib/x86/cpuid.c                          |   8 +-
 xen/lib/x86/policy.c                         |   2 +-
 36 files changed, 255 insertions(+), 255 deletions(-)

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 11:04:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 11:04:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570312.892080 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOcJk-0006fi-7y; Wed, 26 Jul 2023 11:04:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570312.892080; Wed, 26 Jul 2023 11:04:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOcJk-0006fU-50; Wed, 26 Jul 2023 11:04:32 +0000
Received: by outflank-mailman (input) for mailman id 570312;
 Wed, 26 Jul 2023 11:04:30 +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
 <SRS0=j0A2=DM=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qOcJi-000611-7q
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 11:04:30 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3085ba2e-2ba4-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 13:04:28 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.26.92])
 by support.bugseng.com (Postfix) with ESMTPSA id 7CA684EE0738;
 Wed, 26 Jul 2023 13:04:27 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3085ba2e-2ba4-11ee-8613-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Paul Durrant <paul@xen.org>,
	Wei Liu <wl@xen.org>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v4 3/4] x86/viridian: address violations of MISRA C:2012 Rule 7.2
Date: Wed, 26 Jul 2023 13:03:38 +0200
Message-Id: <3007febabe8a13259dc10b566d23a27a89b75358.1690368810.git.simone.ballarin@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690368810.git.simone.ballarin@bugseng.com>
References: <cover.1690368810.git.simone.ballarin@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type and also to other
literals used in the same contexts or near violations, when their positive
nature is immediately clear. The latter changes are done for the sake of
uniformity.

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v4:
- change commit headline
- add Reviewed-by

Changes in v3:
- create this commit for 'viridian.c' and 'hyperv-tlfs.h'
---
 xen/arch/x86/hvm/viridian/viridian.c         |  2 +-
 xen/arch/x86/include/asm/guest/hyperv-tlfs.h | 28 ++++++++++----------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 7405c117bc..61171e3363 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -291,7 +291,7 @@ static void enable_hypercall_page(struct domain *d)
      * calling convention) to differentiate Xen and Viridian hypercalls.
      */
     *(u8  *)(p + 0) = 0x0d; /* orl $0x80000000, %eax */
-    *(u32 *)(p + 1) = 0x80000000;
+    *(u32 *)(p + 1) = 0x80000000U;
     *(u8  *)(p + 5) = 0x0f; /* vmcall/vmmcall */
     *(u8  *)(p + 6) = 0x01;
     *(u8  *)(p + 7) = (cpu_has_vmx ? 0xc1 : 0xd9);
diff --git a/xen/arch/x86/include/asm/guest/hyperv-tlfs.h b/xen/arch/x86/include/asm/guest/hyperv-tlfs.h
index 38f997a0c8..a6915ad731 100644
--- a/xen/arch/x86/include/asm/guest/hyperv-tlfs.h
+++ b/xen/arch/x86/include/asm/guest/hyperv-tlfs.h
@@ -471,30 +471,30 @@ typedef struct _HV_REFERENCE_TSC_PAGE {
 
 /* Define hypervisor message types. */
 enum hv_message_type {
-	HVMSG_NONE			= 0x00000000,
+	HVMSG_NONE			= 0x00000000U,
 
 	/* Memory access messages. */
-	HVMSG_UNMAPPED_GPA		= 0x80000000,
-	HVMSG_GPA_INTERCEPT		= 0x80000001,
+	HVMSG_UNMAPPED_GPA		= 0x80000000U,
+	HVMSG_GPA_INTERCEPT		= 0x80000001U,
 
 	/* Timer notification messages. */
-	HVMSG_TIMER_EXPIRED			= 0x80000010,
+	HVMSG_TIMER_EXPIRED			= 0x80000010U,
 
 	/* Error messages. */
-	HVMSG_INVALID_VP_REGISTER_VALUE	= 0x80000020,
-	HVMSG_UNRECOVERABLE_EXCEPTION	= 0x80000021,
-	HVMSG_UNSUPPORTED_FEATURE		= 0x80000022,
+	HVMSG_INVALID_VP_REGISTER_VALUE	= 0x80000020U,
+	HVMSG_UNRECOVERABLE_EXCEPTION	= 0x80000021U,
+	HVMSG_UNSUPPORTED_FEATURE		= 0x80000022U,
 
 	/* Trace buffer complete messages. */
-	HVMSG_EVENTLOG_BUFFERCOMPLETE	= 0x80000040,
+	HVMSG_EVENTLOG_BUFFERCOMPLETE	= 0x80000040U,
 
 	/* Platform-specific processor intercept messages. */
-	HVMSG_X64_IOPORT_INTERCEPT		= 0x80010000,
-	HVMSG_X64_MSR_INTERCEPT		= 0x80010001,
-	HVMSG_X64_CPUID_INTERCEPT		= 0x80010002,
-	HVMSG_X64_EXCEPTION_INTERCEPT	= 0x80010003,
-	HVMSG_X64_APIC_EOI			= 0x80010004,
-	HVMSG_X64_LEGACY_FP_ERROR		= 0x80010005
+	HVMSG_X64_IOPORT_INTERCEPT		= 0x80010000U,
+	HVMSG_X64_MSR_INTERCEPT		= 0x80010001U,
+	HVMSG_X64_CPUID_INTERCEPT		= 0x80010002U,
+	HVMSG_X64_EXCEPTION_INTERCEPT	= 0x80010003U,
+	HVMSG_X64_APIC_EOI			= 0x80010004U,
+	HVMSG_X64_LEGACY_FP_ERROR		= 0x80010005U
 };
 
 /* Define synthetic interrupt controller message flags. */
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 11:04:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 11:04:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570318.892090 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOcJt-0007Dw-NQ; Wed, 26 Jul 2023 11:04:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570318.892090; Wed, 26 Jul 2023 11:04:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOcJt-0007Dn-JM; Wed, 26 Jul 2023 11:04:41 +0000
Received: by outflank-mailman (input) for mailman id 570318;
 Wed, 26 Jul 2023 11:04:41 +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
 <SRS0=j0A2=DM=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qOcJs-000611-OT
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 11:04:40 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 35fe85c4-2ba4-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 13:04:37 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.26.92])
 by support.bugseng.com (Postfix) with ESMTPSA id 8B47E4EE0738;
 Wed, 26 Jul 2023 13:04:36 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 35fe85c4-2ba4-11ee-8613-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Gianluca Luparini <gianluca.luparini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [XEN PATCH v4 4/4] xen/x86: address violations of MISRA C:2012 Rule 7.2
Date: Wed, 26 Jul 2023 13:03:39 +0200
Message-Id: <3790011b9d9235fd0c3fd2016ee25feb37e925f5.1690368810.git.simone.ballarin@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690368810.git.simone.ballarin@bugseng.com>
References: <cover.1690368810.git.simone.ballarin@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Gianluca Luparini <gianluca.luparini@bugseng.com>

The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
headline states:
"A 'u' or 'U' suffix shall be applied to all integer constants
that are represented in an unsigned type".

Add the 'U' suffix to integers literals with unsigned type.
Use _AC() for macro costants that are used also in assembly files.

For the sake of uniformity, the following changes are made:
- add the 'U' suffix to all first macro's arguments in 'mce-apei.c'
- add the 'U' suffix to switch cases in 'cpuid.c'
- add 'U' suffixes to 'mask16' in 'stdvga.c'
- add the 'U' suffix to macros in 'pci.h'
- use _AC() for macros near 'X86_CR0_PG'

Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com>
Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v4:
- change commit headline
- remove 'U' suffix from '0xffff' in 'cpu-policy.c'
- remove some changes in 'msr-index.h'
- remove changes in 'irq.c' and 'acpi_mmcfg.c'

Changes in v3:
- change 'Signed-off-by' ordering
- change commit message
- add 'UL' in 'extable.c'
- fix indentation in 'cpu-policy.c'
- remove excessive suffixes in 'mce-apei.c'
- add 'UL' in 'x86-defns.h'
- remove changes to 'sr_mask' in 'stdvga.c'
- remove comments to 'gr_mask' in 'stdvga.c'
- move 'viridian.c' and 'hyperv-tlfs.h' in a separate commit

Changes in v2:
- minor change to commit title
- change commit message
- remove comments from 'gr_mask' in 'stdvga.c'
- correct code style in 'trace.h'
- add fix in 'extable.c'
- remove changes in 'x86-defns.h', 'msr-index.h' and 'xen-x86_64.h'
---
 xen/arch/x86/apic.c                    |   2 +-
 xen/arch/x86/cpu-policy.c              |  18 +--
 xen/arch/x86/cpu/mcheck/mce-apei.c     |   4 +-
 xen/arch/x86/cpuid.c                   |   8 +-
 xen/arch/x86/efi/efi-boot.h            |   6 +-
 xen/arch/x86/extable.c                 |   2 +-
 xen/arch/x86/hvm/hypercall.c           |   2 +-
 xen/arch/x86/hvm/pmtimer.c             |   4 +-
 xen/arch/x86/hvm/stdvga.c              |  50 +++----
 xen/arch/x86/hvm/vlapic.c              |   6 +-
 xen/arch/x86/include/asm/apicdef.h     |   2 +-
 xen/arch/x86/include/asm/config.h      |   2 +-
 xen/arch/x86/include/asm/hpet.h        |   2 +-
 xen/arch/x86/include/asm/hvm/trace.h   |   4 +-
 xen/arch/x86/include/asm/hvm/vioapic.h |   2 +-
 xen/arch/x86/include/asm/msi.h         |   2 +-
 xen/arch/x86/include/asm/msr-index.h   | 180 ++++++++++++-------------
 xen/arch/x86/include/asm/pci.h         |   8 +-
 xen/arch/x86/include/asm/x86-defns.h   |  24 ++--
 xen/arch/x86/percpu.c                  |   2 +-
 xen/arch/x86/psr.c                     |   2 +-
 xen/arch/x86/spec_ctrl.c               |   8 +-
 xen/arch/x86/x86_64/pci.c              |   2 +-
 xen/arch/x86/x86_emulate/x86_emulate.h |   2 +-
 xen/lib/x86/cpuid.c                    |   8 +-
 xen/lib/x86/policy.c                   |   2 +-
 26 files changed, 177 insertions(+), 177 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 41879230ec..1109c0d9cf 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1211,7 +1211,7 @@ static void __init calibrate_APIC_clock(void)
      * Setup the APIC counter to maximum. There is no way the lapic
      * can underflow in the 100ms detection time frame.
      */
-    __setup_APIC_LVTT(0xffffffff);
+    __setup_APIC_LVTT(0xffffffffU);
 
     bus_freq = calibrate_apic_timer();
     if ( !bus_freq )
diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c
index f40eeb8be8..b0c7e3bd02 100644
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -321,7 +321,7 @@ static void recalculate_misc(struct cpu_policy *p)
         p->extd.vendor_edx = p->basic.vendor_edx;
 
         p->extd.raw_fms = p->basic.raw_fms;
-        p->extd.raw[0x1].b &= 0xff00ffff;
+        p->extd.raw[0x1].b &= 0xff00ffffU;
         p->extd.e1d |= p->basic._1d & CPUID_COMMON_1D_FEATURES;
 
         p->extd.raw[0x8].a &= 0x0000ffff; /* GuestMaxPhysAddr hidden. */
@@ -378,10 +378,10 @@ static void __init calculate_host_policy(void)
      * this information.
      */
     if ( cpu_has_lfence_dispatch )
-        max_extd_leaf = max(max_extd_leaf, 0x80000021);
+        max_extd_leaf = max(max_extd_leaf, 0x80000021U);
 
-    p->extd.max_leaf = 0x80000000 | min_t(uint32_t, max_extd_leaf & 0xffff,
-                                          ARRAY_SIZE(p->extd.raw) - 1);
+    p->extd.max_leaf = 0x80000000U | min_t(uint32_t, max_extd_leaf & 0xffff,
+                                           ARRAY_SIZE(p->extd.raw) - 1);
 
     x86_cpu_featureset_to_policy(boot_cpu_data.x86_capability, p);
     recalculate_xstate(p);
@@ -768,11 +768,11 @@ void recalculate_cpuid_policy(struct domain *d)
 
     p->basic.max_leaf   = min(p->basic.max_leaf,   max->basic.max_leaf);
     p->feat.max_subleaf = min(p->feat.max_subleaf, max->feat.max_subleaf);
-    p->extd.max_leaf    = 0x80000000 | min(p->extd.max_leaf & 0xffff,
-                                           ((p->x86_vendor & (X86_VENDOR_AMD |
-                                                              X86_VENDOR_HYGON))
-                                            ? CPUID_GUEST_NR_EXTD_AMD
-                                            : CPUID_GUEST_NR_EXTD_INTEL) - 1);
+    p->extd.max_leaf    = 0x80000000U | min(p->extd.max_leaf & 0xffff,
+                                            ((p->x86_vendor & (X86_VENDOR_AMD |
+                                                               X86_VENDOR_HYGON))
+                                             ? CPUID_GUEST_NR_EXTD_AMD
+                                             : CPUID_GUEST_NR_EXTD_INTEL) - 1);
 
     x86_cpu_policy_to_featureset(p, fs);
     x86_cpu_policy_to_featureset(max, max_fs);
diff --git a/xen/arch/x86/cpu/mcheck/mce-apei.c b/xen/arch/x86/cpu/mcheck/mce-apei.c
index 53b6735896..b895020882 100644
--- a/xen/arch/x86/cpu/mcheck/mce-apei.c
+++ b/xen/arch/x86/cpu/mcheck/mce-apei.c
@@ -37,10 +37,10 @@
 #include "mce.h"
 
 #define CPER_CREATOR_MCE						\
-	UUID_LE(0x75a574e3, 0x5052, 0x4b29, 0x8a, 0x8e, 0xbe, 0x2c,	\
+	UUID_LE(0x75a574e3U, 0x5052, 0x4b29, 0x8a, 0x8e, 0xbe, 0x2c,	\
 		0x64, 0x90, 0xb8, 0x9d)
 #define CPER_SECTION_TYPE_MCE						\
-	UUID_LE(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96,	\
+	UUID_LE(0xfe08ffbeU, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96,	\
 		0x04, 0x4a, 0x38, 0xfc)
 
 /*
diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c
index 455a09b2dd..7290a979c6 100644
--- a/xen/arch/x86/cpuid.c
+++ b/xen/arch/x86/cpuid.c
@@ -93,7 +93,7 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
         }
         break;
 
-    case 0x40000000 ... 0x400000ff:
+    case 0x40000000U ... 0x400000ffU:
         if ( is_viridian_domain(d) )
             return cpuid_viridian_leaves(v, leaf, subleaf, res);
 
@@ -103,10 +103,10 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
          * Intel reserve up until 0x4fffffff for hypervisor use.  AMD reserve
          * only until 0x400000ff, but we already use double that.
          */
-    case 0x40000100 ... 0x400001ff:
+    case 0x40000100U ... 0x400001ffU:
         return cpuid_hypervisor_leaves(v, leaf, subleaf, res);
 
-    case 0x80000000 ... 0x80000000 + CPUID_GUEST_NR_EXTD - 1:
+    case 0x80000000U ... 0x80000000U + CPUID_GUEST_NR_EXTD - 1:
         ASSERT((p->extd.max_leaf & 0xffff) < ARRAY_SIZE(p->extd.raw));
         if ( (leaf & 0xffff) > min_t(uint32_t, p->extd.max_leaf & 0xffff,
                                      ARRAY_SIZE(p->extd.raw) - 1) )
@@ -352,7 +352,7 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
         }
         break;
 
-    case 0x80000001:
+    case 0x80000001U:
         /* SYSCALL is hidden outside of long mode on Intel. */
         if ( p->x86_vendor == X86_VENDOR_INTEL &&
              is_hvm_domain(d) && !hvm_long_mode_active(v) )
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 92f4cfe8bd..eebc54180b 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -740,16 +740,16 @@ static void __init efi_arch_handle_module(const struct file *file,
 
 static void __init efi_arch_cpu(void)
 {
-    uint32_t eax = cpuid_eax(0x80000000);
+    uint32_t eax = cpuid_eax(0x80000000U);
     uint32_t *caps = boot_cpu_data.x86_capability;
 
     boot_tsc_stamp = rdtsc();
 
     caps[FEATURESET_1c] = cpuid_ecx(1);
 
-    if ( (eax >> 16) == 0x8000 && eax > 0x80000000 )
+    if ( (eax >> 16) == 0x8000 && eax > 0x80000000U )
     {
-        caps[FEATURESET_e1d] = cpuid_edx(0x80000001);
+        caps[FEATURESET_e1d] = cpuid_edx(0x80000001U);
 
         /*
          * This check purposefully doesn't use cpu_has_nx because
diff --git a/xen/arch/x86/extable.c b/xen/arch/x86/extable.c
index c3771c2e39..0e8694c188 100644
--- a/xen/arch/x86/extable.c
+++ b/xen/arch/x86/extable.c
@@ -141,7 +141,7 @@ static int __init cf_check stub_selftest(void)
           .rax = 0x0123456789abcdef,
           .res.fields.trapnr = X86_EXC_GP },
         { .opc = { endbr64, 0x02, 0x04, 0x04, 0xc3 }, /* add (%rsp,%rax),%al */
-          .rax = 0xfedcba9876543210,
+          .rax = 0xfedcba9876543210UL,
           .res.fields.trapnr = X86_EXC_SS },
         { .opc = { endbr64, 0xcc, 0xc3, 0xc3, 0xc3 }, /* int3 */
           .res.fields.trapnr = X86_EXC_BP },
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 20d266ffd5..eeb73e1aa5 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen/arch/x86/hvm/hypercall.c
@@ -129,7 +129,7 @@ int hvm_hypercall(struct cpu_user_regs *regs)
         break;
     }
 
-    if ( (eax & 0x80000000) && is_viridian_domain(currd) )
+    if ( (eax & 0x80000000U) && is_viridian_domain(currd) )
     {
         int ret;
 
diff --git a/xen/arch/x86/hvm/pmtimer.c b/xen/arch/x86/hvm/pmtimer.c
index 2145c531b6..eb4a455763 100644
--- a/xen/arch/x86/hvm/pmtimer.c
+++ b/xen/arch/x86/hvm/pmtimer.c
@@ -40,8 +40,8 @@
 #define SCI_IRQ 9
 
 /* We provide a 32-bit counter (must match the TMR_VAL_EXT bit in the FADT) */
-#define TMR_VAL_MASK  (0xffffffff)
-#define TMR_VAL_MSB   (0x80000000)
+#define TMR_VAL_MASK  (0xffffffffU)
+#define TMR_VAL_MSB   (0x80000000U)
 
 /* Dispatch SCIs based on the PM1a_STS and PM1a_EN registers */
 static void pmt_update_sci(PMTState *s)
diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index 798a9a0549..d3dfb9b689 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -39,22 +39,22 @@
 
 #define PAT(x) (x)
 static const uint32_t mask16[16] = {
-    PAT(0x00000000),
-    PAT(0x000000ff),
-    PAT(0x0000ff00),
-    PAT(0x0000ffff),
-    PAT(0x00ff0000),
-    PAT(0x00ff00ff),
-    PAT(0x00ffff00),
-    PAT(0x00ffffff),
-    PAT(0xff000000),
-    PAT(0xff0000ff),
-    PAT(0xff00ff00),
-    PAT(0xff00ffff),
-    PAT(0xffff0000),
-    PAT(0xffff00ff),
-    PAT(0xffffff00),
-    PAT(0xffffffff),
+    PAT(0x00000000U),
+    PAT(0x000000ffU),
+    PAT(0x0000ff00U),
+    PAT(0x0000ffffU),
+    PAT(0x00ff0000U),
+    PAT(0x00ff00ffU),
+    PAT(0x00ffff00U),
+    PAT(0x00ffffffU),
+    PAT(0xff000000U),
+    PAT(0xff0000ffU),
+    PAT(0xff00ff00U),
+    PAT(0xff00ffffU),
+    PAT(0xffff0000U),
+    PAT(0xffff00ffU),
+    PAT(0xffffff00U),
+    PAT(0xffffffffU),
 };
 
 /* force some bits to zero */
@@ -70,15 +70,15 @@ static const uint8_t sr_mask[8] = {
 };
 
 static const uint8_t gr_mask[9] = {
-    (uint8_t)~0xf0, /* 0x00 */
-    (uint8_t)~0xf0, /* 0x01 */
-    (uint8_t)~0xf0, /* 0x02 */
-    (uint8_t)~0xe0, /* 0x03 */
-    (uint8_t)~0xfc, /* 0x04 */
-    (uint8_t)~0x84, /* 0x05 */
-    (uint8_t)~0xf0, /* 0x06 */
-    (uint8_t)~0xf0, /* 0x07 */
-    (uint8_t)~0x00, /* 0x08 */
+    (uint8_t)~0xf0,
+    (uint8_t)~0xf0,
+    (uint8_t)~0xf0,
+    (uint8_t)~0xe0,
+    (uint8_t)~0xfc,
+    (uint8_t)~0x84,
+    (uint8_t)~0xf0,
+    (uint8_t)~0xf0,
+    (uint8_t)~0x00,
 };
 
 static uint8_t *vram_getb(struct hvm_hw_stdvga *s, unsigned int a)
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index c7ce82d064..a8e87c4446 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -237,7 +237,7 @@ bool_t vlapic_match_dest(
     case APIC_DEST_NOSHORT:
         if ( dest_mode )
             return vlapic_match_logical_addr(target, dest);
-        return (dest == _VLAPIC_ID(target, 0xffffffff)) ||
+        return (dest == _VLAPIC_ID(target, 0xffffffffU)) ||
                (dest == VLAPIC_ID(target));
 
     case APIC_DEST_SELF:
@@ -467,7 +467,7 @@ static bool_t is_multicast_dest(struct vlapic *vlapic, unsigned int short_hand,
         return short_hand != APIC_DEST_SELF;
 
     if ( vlapic_x2apic_mode(vlapic) )
-        return dest_mode ? hweight16(dest) > 1 : dest == 0xffffffff;
+        return dest_mode ? hweight16(dest) > 1 : dest == 0xffffffffU;
 
     if ( dest_mode )
         return hweight8(dest &
@@ -831,7 +831,7 @@ void vlapic_reg_write(struct vcpu *v, unsigned int reg, uint32_t val)
         break;
 
     case APIC_ICR2:
-        vlapic_set_reg(vlapic, APIC_ICR2, val & 0xff000000);
+        vlapic_set_reg(vlapic, APIC_ICR2, val & 0xff000000U);
         break;
 
     case APIC_LVTT:         /* LVT Timer Reg */
diff --git a/xen/arch/x86/include/asm/apicdef.h b/xen/arch/x86/include/asm/apicdef.h
index 2440d83c8d..7f21d3f49c 100644
--- a/xen/arch/x86/include/asm/apicdef.h
+++ b/xen/arch/x86/include/asm/apicdef.h
@@ -8,7 +8,7 @@
  * Ingo Molnar <mingo@redhat.com>, 1999, 2000
  */
 
-#define		APIC_DEFAULT_PHYS_BASE	0xfee00000
+#define		APIC_DEFAULT_PHYS_BASE	0xfee00000U
  
 #define		APIC_ID		0x20
 #define			APIC_ID_MASK		(0xFFu<<24)
diff --git a/xen/arch/x86/include/asm/config.h b/xen/arch/x86/include/asm/config.h
index fbc4bb3416..bbced338be 100644
--- a/xen/arch/x86/include/asm/config.h
+++ b/xen/arch/x86/include/asm/config.h
@@ -257,7 +257,7 @@ extern unsigned char boot_edid_info[128];
 #endif /* CONFIG_PV32 */
 
 #define MACH2PHYS_COMPAT_VIRT_START    HYPERVISOR_COMPAT_VIRT_START
-#define MACH2PHYS_COMPAT_VIRT_END      0xFFE00000
+#define MACH2PHYS_COMPAT_VIRT_END      0xFFE00000U
 #define MACH2PHYS_COMPAT_NR_ENTRIES(d) \
     ((MACH2PHYS_COMPAT_VIRT_END-MACH2PHYS_COMPAT_VIRT_START(d))>>2)
 
diff --git a/xen/arch/x86/include/asm/hpet.h b/xen/arch/x86/include/asm/hpet.h
index 9919f74730..c5e8e9c8db 100644
--- a/xen/arch/x86/include/asm/hpet.h
+++ b/xen/arch/x86/include/asm/hpet.h
@@ -41,7 +41,7 @@
 #define HPET_TN_ROUTE		0x3e00
 #define HPET_TN_FSB		0x4000
 #define HPET_TN_FSB_CAP		0x8000
-#define HPET_TN_RESERVED	0xffff0081
+#define HPET_TN_RESERVED	0xffff0081U
 #define HPET_TN_INT_ROUTE_CAP	(0xffffffffULL << 32)
 
 
diff --git a/xen/arch/x86/include/asm/hvm/trace.h b/xen/arch/x86/include/asm/hvm/trace.h
index 696e42eb94..9d7a3c6e51 100644
--- a/xen/arch/x86/include/asm/hvm/trace.h
+++ b/xen/arch/x86/include/asm/hvm/trace.h
@@ -58,7 +58,7 @@
 #define DO_TRC_HVM_VLAPIC           DEFAULT_HVM_MISC
 
 
-#define TRC_PAR_LONG(par) ((par)&0xFFFFFFFF),((par)>>32)
+#define TRC_PAR_LONG(par) ((uint32_t)par), ((par) >> 32)
 
 #define TRACE_2_LONG_2D(_e, d1, d2, ...) \
     TRACE_4D(_e, d1, d2)
@@ -93,7 +93,7 @@
     HVMTRACE_ND(evt, 0, 0)
 
 #define HVMTRACE_LONG_1D(evt, d1)                  \
-                   HVMTRACE_2D(evt ## 64, (d1) & 0xFFFFFFFF, (d1) >> 32)
+                   HVMTRACE_2D(evt ## 64, (uint32_t)d1, (d1) >> 32)
 #define HVMTRACE_LONG_2D(evt, d1, d2, ...)              \
                    HVMTRACE_3D(evt ## 64, d1, d2)
 #define HVMTRACE_LONG_3D(evt, d1, d2, d3, ...)      \
diff --git a/xen/arch/x86/include/asm/hvm/vioapic.h b/xen/arch/x86/include/asm/hvm/vioapic.h
index 2944ec20dd..68af6dce79 100644
--- a/xen/arch/x86/include/asm/hvm/vioapic.h
+++ b/xen/arch/x86/include/asm/hvm/vioapic.h
@@ -32,7 +32,7 @@
 #define VIOAPIC_EDGE_TRIG  0
 #define VIOAPIC_LEVEL_TRIG 1
 
-#define VIOAPIC_DEFAULT_BASE_ADDRESS  0xfec00000
+#define VIOAPIC_DEFAULT_BASE_ADDRESS  0xfec00000U
 #define VIOAPIC_MEM_LENGTH            0x100
 
 /* Direct registers. */
diff --git a/xen/arch/x86/include/asm/msi.h b/xen/arch/x86/include/asm/msi.h
index a53ade95c9..d89723d009 100644
--- a/xen/arch/x86/include/asm/msi.h
+++ b/xen/arch/x86/include/asm/msi.h
@@ -37,7 +37,7 @@
  */
 
 #define MSI_ADDR_BASE_HI            0
-#define MSI_ADDR_BASE_LO            0xfee00000
+#define MSI_ADDR_BASE_LO            0xfee00000U
 #define MSI_ADDR_BASE_MASK          (~0xfffff)
 #define MSI_ADDR_HEADER             MSI_ADDR_BASE_LO
 
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 2382fc8e11..4b9004cdc3 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -30,7 +30,7 @@
 
 #define MSR_INTEL_CORE_THREAD_COUNT         0x00000035
 #define  MSR_CTC_THREAD_MASK                0x0000ffff
-#define  MSR_CTC_CORE_MASK                  0xffff0000
+#define  MSR_CTC_CORE_MASK                  0xffff0000U
 
 #define MSR_SPEC_CTRL                       0x00000048
 #define  SPEC_CTRL_IBRS                     (_AC(1, ULL) <<  0)
@@ -168,7 +168,7 @@
 #define MSR_UARCH_MISC_CTRL                 0x00001b01
 #define  UARCH_CTRL_DOITM                   (_AC(1, ULL) <<  0)
 
-#define MSR_EFER                            0xc0000080 /* Extended Feature Enable Register */
+#define MSR_EFER                            _AC(0xc0000080, U)  /* Extended Feature Enable Register */
 #define  EFER_SCE                           (_AC(1, ULL) <<  0) /* SYSCALL Enable */
 #define  EFER_LME                           (_AC(1, ULL) <<  8) /* Long Mode Enable */
 #define  EFER_LMA                           (_AC(1, ULL) << 10) /* Long Mode Active */
@@ -181,35 +181,35 @@
     (EFER_SCE | EFER_LME | EFER_LMA | EFER_NXE | EFER_SVME | EFER_FFXSE | \
      EFER_AIBRSE)
 
-#define MSR_STAR                            0xc0000081 /* legacy mode SYSCALL target */
-#define MSR_LSTAR                           0xc0000082 /* long mode SYSCALL target */
-#define MSR_CSTAR                           0xc0000083 /* compat mode SYSCALL target */
-#define MSR_SYSCALL_MASK                    0xc0000084 /* EFLAGS mask for syscall */
-#define MSR_FS_BASE                         0xc0000100 /* 64bit FS base */
-#define MSR_GS_BASE                         0xc0000101 /* 64bit GS base */
-#define MSR_SHADOW_GS_BASE                  0xc0000102 /* SwapGS GS shadow */
-#define MSR_TSC_AUX                         0xc0000103 /* Auxiliary TSC */
+#define MSR_STAR                            0xc0000081U /* legacy mode SYSCALL target */
+#define MSR_LSTAR                           0xc0000082U /* long mode SYSCALL target */
+#define MSR_CSTAR                           0xc0000083U /* compat mode SYSCALL target */
+#define MSR_SYSCALL_MASK                    0xc0000084U /* EFLAGS mask for syscall */
+#define MSR_FS_BASE                         0xc0000100U /* 64bit FS base */
+#define MSR_GS_BASE                         0xc0000101U /* 64bit GS base */
+#define MSR_SHADOW_GS_BASE                  0xc0000102U /* SwapGS GS shadow */
+#define MSR_TSC_AUX                         0xc0000103U /* Auxiliary TSC */
 
-#define MSR_K8_SYSCFG                       0xc0010010
+#define MSR_K8_SYSCFG                       0xc0010010U
 #define  SYSCFG_MTRR_FIX_DRAM_EN            (_AC(1, ULL) << 18)
 #define  SYSCFG_MTRR_FIX_DRAM_MOD_EN        (_AC(1, ULL) << 19)
 #define  SYSCFG_MTRR_VAR_DRAM_EN            (_AC(1, ULL) << 20)
 #define  SYSCFG_MTRR_TOM2_EN                (_AC(1, ULL) << 21)
 #define  SYSCFG_TOM2_FORCE_WB               (_AC(1, ULL) << 22)
 
-#define MSR_K8_IORR_BASE0                   0xc0010016
-#define MSR_K8_IORR_MASK0                   0xc0010017
-#define MSR_K8_IORR_BASE1                   0xc0010018
-#define MSR_K8_IORR_MASK1                   0xc0010019
+#define MSR_K8_IORR_BASE0                   0xc0010016U
+#define MSR_K8_IORR_MASK0                   0xc0010017U
+#define MSR_K8_IORR_BASE1                   0xc0010018U
+#define MSR_K8_IORR_MASK1                   0xc0010019U
 
-#define MSR_K8_TSEG_BASE                    0xc0010112 /* AMD doc: SMMAddr */
-#define MSR_K8_TSEG_MASK                    0xc0010113 /* AMD doc: SMMMask */
+#define MSR_K8_TSEG_BASE                    0xc0010112U /* AMD doc: SMMAddr */
+#define MSR_K8_TSEG_MASK                    0xc0010113U /* AMD doc: SMMMask */
 
-#define MSR_K8_VM_CR                        0xc0010114
+#define MSR_K8_VM_CR                        0xc0010114U
 #define  VM_CR_INIT_REDIRECTION             (_AC(1, ULL) <<  1)
 #define  VM_CR_SVM_DISABLE                  (_AC(1, ULL) <<  4)
 
-#define MSR_VIRT_SPEC_CTRL                  0xc001011f /* Layout matches MSR_SPEC_CTRL */
+#define MSR_VIRT_SPEC_CTRL                  0xc001011fU /* Layout matches MSR_SPEC_CTRL */
 
 /*
  * Legacy MSR constants in need of cleanup.  No new MSRs below this comment.
@@ -293,7 +293,7 @@
 #define CMCI_EN 			(1UL<<30)
 #define CMCI_THRESHOLD_MASK		0x7FFF
 
-#define MSR_AMD64_MC0_MASK		0xc0010044
+#define MSR_AMD64_MC0_MASK		0xc0010044U
 
 #define MSR_IA32_MCx_CTL(x)		(MSR_IA32_MC0_CTL + 4*(x))
 #define MSR_IA32_MCx_STATUS(x)		(MSR_IA32_MC0_STATUS + 4*(x))
@@ -325,82 +325,82 @@
 
 /* K7/K8 MSRs. Not complete. See the architecture manual for a more
    complete list. */
-#define MSR_K7_EVNTSEL0			0xc0010000
-#define MSR_K7_PERFCTR0			0xc0010004
-#define MSR_K7_EVNTSEL1			0xc0010001
-#define MSR_K7_PERFCTR1			0xc0010005
-#define MSR_K7_EVNTSEL2			0xc0010002
-#define MSR_K7_PERFCTR2			0xc0010006
-#define MSR_K7_EVNTSEL3			0xc0010003
-#define MSR_K7_PERFCTR3			0xc0010007
-#define MSR_K8_TOP_MEM1			0xc001001a
-#define MSR_K8_TOP_MEM2			0xc001001d
-
-#define MSR_K8_HWCR			0xc0010015
+#define MSR_K7_EVNTSEL0			0xc0010000U
+#define MSR_K7_PERFCTR0			0xc0010004U
+#define MSR_K7_EVNTSEL1			0xc0010001U
+#define MSR_K7_PERFCTR1			0xc0010005U
+#define MSR_K7_EVNTSEL2			0xc0010002U
+#define MSR_K7_PERFCTR2			0xc0010006U
+#define MSR_K7_EVNTSEL3			0xc0010003U
+#define MSR_K7_PERFCTR3			0xc0010007U
+#define MSR_K8_TOP_MEM1			0xc001001aU
+#define MSR_K8_TOP_MEM2			0xc001001dU
+
+#define MSR_K8_HWCR			0xc0010015U
 #define K8_HWCR_TSC_FREQ_SEL		(1ULL << 24)
 #define K8_HWCR_CPUID_USER_DIS		(1ULL << 35)
 
-#define MSR_K7_FID_VID_CTL		0xc0010041
-#define MSR_K7_FID_VID_STATUS		0xc0010042
-#define MSR_K8_PSTATE_LIMIT		0xc0010061
-#define MSR_K8_PSTATE_CTRL		0xc0010062
-#define MSR_K8_PSTATE_STATUS		0xc0010063
-#define MSR_K8_PSTATE0			0xc0010064
-#define MSR_K8_PSTATE1			0xc0010065
-#define MSR_K8_PSTATE2			0xc0010066
-#define MSR_K8_PSTATE3			0xc0010067
-#define MSR_K8_PSTATE4			0xc0010068
-#define MSR_K8_PSTATE5			0xc0010069
-#define MSR_K8_PSTATE6			0xc001006A
-#define MSR_K8_PSTATE7			0xc001006B
-#define MSR_K8_ENABLE_C1E		0xc0010055
-#define MSR_K8_VM_HSAVE_PA		0xc0010117
-
-#define MSR_AMD_FAM15H_EVNTSEL0		0xc0010200
-#define MSR_AMD_FAM15H_PERFCTR0		0xc0010201
-#define MSR_AMD_FAM15H_EVNTSEL1		0xc0010202
-#define MSR_AMD_FAM15H_PERFCTR1		0xc0010203
-#define MSR_AMD_FAM15H_EVNTSEL2		0xc0010204
-#define MSR_AMD_FAM15H_PERFCTR2		0xc0010205
-#define MSR_AMD_FAM15H_EVNTSEL3		0xc0010206
-#define MSR_AMD_FAM15H_PERFCTR3		0xc0010207
-#define MSR_AMD_FAM15H_EVNTSEL4		0xc0010208
-#define MSR_AMD_FAM15H_PERFCTR4		0xc0010209
-#define MSR_AMD_FAM15H_EVNTSEL5		0xc001020a
-#define MSR_AMD_FAM15H_PERFCTR5		0xc001020b
-
-#define MSR_AMD_L7S0_FEATURE_MASK	0xc0011002
-#define MSR_AMD_THRM_FEATURE_MASK	0xc0011003
-#define MSR_K8_FEATURE_MASK		0xc0011004
-#define MSR_K8_EXT_FEATURE_MASK		0xc0011005
+#define MSR_K7_FID_VID_CTL		0xc0010041U
+#define MSR_K7_FID_VID_STATUS		0xc0010042U
+#define MSR_K8_PSTATE_LIMIT		0xc0010061U
+#define MSR_K8_PSTATE_CTRL		0xc0010062U
+#define MSR_K8_PSTATE_STATUS		0xc0010063U
+#define MSR_K8_PSTATE0			0xc0010064U
+#define MSR_K8_PSTATE1			0xc0010065U
+#define MSR_K8_PSTATE2			0xc0010066U
+#define MSR_K8_PSTATE3			0xc0010067U
+#define MSR_K8_PSTATE4			0xc0010068U
+#define MSR_K8_PSTATE5			0xc0010069U
+#define MSR_K8_PSTATE6			0xc001006AU
+#define MSR_K8_PSTATE7			0xc001006BU
+#define MSR_K8_ENABLE_C1E		0xc0010055U
+#define MSR_K8_VM_HSAVE_PA		0xc0010117U
+
+#define MSR_AMD_FAM15H_EVNTSEL0		0xc0010200U
+#define MSR_AMD_FAM15H_PERFCTR0		0xc0010201U
+#define MSR_AMD_FAM15H_EVNTSEL1		0xc0010202U
+#define MSR_AMD_FAM15H_PERFCTR1		0xc0010203U
+#define MSR_AMD_FAM15H_EVNTSEL2		0xc0010204U
+#define MSR_AMD_FAM15H_PERFCTR2		0xc0010205U
+#define MSR_AMD_FAM15H_EVNTSEL3		0xc0010206U
+#define MSR_AMD_FAM15H_PERFCTR3		0xc0010207U
+#define MSR_AMD_FAM15H_EVNTSEL4		0xc0010208U
+#define MSR_AMD_FAM15H_PERFCTR4		0xc0010209U
+#define MSR_AMD_FAM15H_EVNTSEL5		0xc001020aU
+#define MSR_AMD_FAM15H_PERFCTR5		0xc001020bU
+
+#define MSR_AMD_L7S0_FEATURE_MASK	0xc0011002U
+#define MSR_AMD_THRM_FEATURE_MASK	0xc0011003U
+#define MSR_K8_FEATURE_MASK			0xc0011004U
+#define MSR_K8_EXT_FEATURE_MASK		0xc0011005U
 
 /* AMD64 MSRs */
-#define MSR_AMD64_NB_CFG		0xc001001f
+#define MSR_AMD64_NB_CFG		0xc001001fU
 #define AMD64_NB_CFG_CF8_EXT_ENABLE_BIT	46
-#define MSR_AMD64_LS_CFG		0xc0011020
-#define MSR_AMD64_IC_CFG		0xc0011021
-#define MSR_AMD64_DC_CFG		0xc0011022
-#define MSR_AMD64_DE_CFG		0xc0011029
+#define MSR_AMD64_LS_CFG		0xc0011020U
+#define MSR_AMD64_IC_CFG		0xc0011021U
+#define MSR_AMD64_DC_CFG		0xc0011022U
+#define MSR_AMD64_DE_CFG		0xc0011029U
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
-#define MSR_AMD64_EX_CFG		0xc001102c
-#define MSR_AMD64_DE_CFG2		0xc00110e3
+#define MSR_AMD64_EX_CFG		0xc001102cU
+#define MSR_AMD64_DE_CFG2		0xc00110e3U
 
-#define MSR_AMD64_DR0_ADDRESS_MASK	0xc0011027
-#define MSR_AMD64_DR1_ADDRESS_MASK	0xc0011019
-#define MSR_AMD64_DR2_ADDRESS_MASK	0xc001101a
-#define MSR_AMD64_DR3_ADDRESS_MASK	0xc001101b
+#define MSR_AMD64_DR0_ADDRESS_MASK	0xc0011027U
+#define MSR_AMD64_DR1_ADDRESS_MASK	0xc0011019U
+#define MSR_AMD64_DR2_ADDRESS_MASK	0xc001101aU
+#define MSR_AMD64_DR3_ADDRESS_MASK	0xc001101bU
 
 /* AMD Family10h machine check MSRs */
-#define MSR_F10_MC4_MISC1		0xc0000408
-#define MSR_F10_MC4_MISC2		0xc0000409
-#define MSR_F10_MC4_MISC3		0xc000040A
+#define MSR_F10_MC4_MISC1		0xc0000408U
+#define MSR_F10_MC4_MISC2		0xc0000409U
+#define MSR_F10_MC4_MISC3		0xc000040AU
 
 /* AMD Family10h Bus Unit MSRs */
-#define MSR_F10_BU_CFG 		0xc0011023
-#define MSR_F10_BU_CFG2		0xc001102a
+#define MSR_F10_BU_CFG 		0xc0011023U
+#define MSR_F10_BU_CFG2		0xc001102aU
 
 /* Other AMD Fam10h MSRs */
-#define MSR_FAM10H_MMIO_CONF_BASE	0xc0010058
+#define MSR_FAM10H_MMIO_CONF_BASE	0xc0010058U
 #define FAM10H_MMIO_CONF_ENABLE         (1<<0)
 #define FAM10H_MMIO_CONF_BUSRANGE_MASK	0xf
 #define FAM10H_MMIO_CONF_BUSRANGE_SHIFT 2
@@ -409,22 +409,22 @@
 
 /* AMD Microcode MSRs */
 #define MSR_AMD_PATCHLEVEL		0x0000008b
-#define MSR_AMD_PATCHLOADER		0xc0010020
+#define MSR_AMD_PATCHLOADER		0xc0010020U
 
 /* AMD TSC RATE MSR */
-#define MSR_AMD64_TSC_RATIO		0xc0000104
+#define MSR_AMD64_TSC_RATIO		0xc0000104U
 
 /* AMD Lightweight Profiling MSRs */
-#define MSR_AMD64_LWP_CFG		0xc0000105
-#define MSR_AMD64_LWP_CBADDR		0xc0000106
+#define MSR_AMD64_LWP_CFG		0xc0000105U
+#define MSR_AMD64_LWP_CBADDR		0xc0000106U
 
 /* AMD OS Visible Workaround MSRs */
-#define MSR_AMD_OSVW_ID_LENGTH          0xc0010140
-#define MSR_AMD_OSVW_STATUS             0xc0010141
+#define MSR_AMD_OSVW_ID_LENGTH          0xc0010140U
+#define MSR_AMD_OSVW_STATUS             0xc0010141U
 
 /* AMD Protected Processor Inventory Number */
-#define MSR_AMD_PPIN_CTL                0xc00102f0
-#define MSR_AMD_PPIN                    0xc00102f1
+#define MSR_AMD_PPIN_CTL                0xc00102f0U
+#define MSR_AMD_PPIN                    0xc00102f1U
 
 /* VIA Cyrix defined MSRs*/
 #define MSR_VIA_FCR			0x00001107
diff --git a/xen/arch/x86/include/asm/pci.h b/xen/arch/x86/include/asm/pci.h
index f4a58c8acf..e1dd12eb19 100644
--- a/xen/arch/x86/include/asm/pci.h
+++ b/xen/arch/x86/include/asm/pci.h
@@ -3,10 +3,10 @@
 
 #include <xen/mm.h>
 
-#define CF8_BDF(cf8)     (  ((cf8) & 0x00ffff00) >> 8)
-#define CF8_ADDR_LO(cf8) (   (cf8) & 0x000000fc)
-#define CF8_ADDR_HI(cf8) (  ((cf8) & 0x0f000000) >> 16)
-#define CF8_ENABLED(cf8) (!!((cf8) & 0x80000000))
+#define CF8_BDF(cf8)     (  ((cf8) & 0x00ffff00U) >> 8)
+#define CF8_ADDR_LO(cf8) (   (cf8) & 0x000000fcU)
+#define CF8_ADDR_HI(cf8) (  ((cf8) & 0x0f000000U) >> 16)
+#define CF8_ENABLED(cf8) (!!((cf8) & 0x80000000U))
 
 #define IS_SNB_GFX(id) (id == 0x01068086 || id == 0x01168086 \
                         || id == 0x01268086 || id == 0x01028086 \
diff --git a/xen/arch/x86/include/asm/x86-defns.h b/xen/arch/x86/include/asm/x86-defns.h
index e350227e57..6c1aff948c 100644
--- a/xen/arch/x86/include/asm/x86-defns.h
+++ b/xen/arch/x86/include/asm/x86-defns.h
@@ -30,17 +30,17 @@
 /*
  * Intel CPU flags in CR0
  */
-#define X86_CR0_PE              0x00000001 /* Enable Protected Mode    (RW) */
-#define X86_CR0_MP              0x00000002 /* Monitor Coprocessor      (RW) */
-#define X86_CR0_EM              0x00000004 /* Require FPU Emulation    (RO) */
-#define X86_CR0_TS              0x00000008 /* Task Switched            (RW) */
-#define X86_CR0_ET              0x00000010 /* Extension type           (RO) */
-#define X86_CR0_NE              0x00000020 /* Numeric Error Reporting  (RW) */
-#define X86_CR0_WP              0x00010000 /* Supervisor Write Protect (RW) */
-#define X86_CR0_AM              0x00040000 /* Alignment Checking       (RW) */
-#define X86_CR0_NW              0x20000000 /* Not Write-Through        (RW) */
-#define X86_CR0_CD              0x40000000 /* Cache Disable            (RW) */
-#define X86_CR0_PG              0x80000000 /* Paging                   (RW) */
+#define X86_CR0_PE              _AC(0x00000001, U) /* Enable Protected Mode    (RW) */
+#define X86_CR0_MP              _AC(0x00000002, U) /* Monitor Coprocessor      (RW) */
+#define X86_CR0_EM              _AC(0x00000004, U) /* Require FPU Emulation    (RO) */
+#define X86_CR0_TS              _AC(0x00000008, U) /* Task Switched            (RW) */
+#define X86_CR0_ET              _AC(0x00000010, U) /* Extension type           (RO) */
+#define X86_CR0_NE              _AC(0x00000020, U) /* Numeric Error Reporting  (RW) */
+#define X86_CR0_WP              _AC(0x00010000, U) /* Supervisor Write Protect (RW) */
+#define X86_CR0_AM              _AC(0x00040000, U) /* Alignment Checking       (RW) */
+#define X86_CR0_NW              _AC(0x20000000, U) /* Not Write-Through        (RW) */
+#define X86_CR0_CD              _AC(0x40000000, U) /* Cache Disable            (RW) */
+#define X86_CR0_PG              _AC(0x80000000, U) /* Paging                   (RW) */
 
 /*
  * Intel CPU flags in CR3
@@ -103,7 +103,7 @@
 /*
  * Debug status flags in DR6.
  */
-#define X86_DR6_DEFAULT         0xffff0ff0  /* Default %dr6 value. */
+#define X86_DR6_DEFAULT         0xffff0ff0UL  /* Default %dr6 value. */
 
 /*
  * Debug control flags in DR7.
diff --git a/xen/arch/x86/percpu.c b/xen/arch/x86/percpu.c
index 288050cdba..1ebeb65ad6 100644
--- a/xen/arch/x86/percpu.c
+++ b/xen/arch/x86/percpu.c
@@ -12,7 +12,7 @@ unsigned long __per_cpu_offset[NR_CPUS];
  * possible #PF at (NULL + a little) which has security implications in the
  * context of PV guests.
  */
-#define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
+#define INVALID_PERCPU_AREA (0x8000000000000000UL - (long)__per_cpu_start)
 #define PERCPU_ORDER get_order_from_bytes(__per_cpu_data_end - __per_cpu_start)
 
 void __init percpu_init_areas(void)
diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index a1e0af27c5..5581b4717a 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -191,7 +191,7 @@ static struct feat_node *feat_l2_cat;
 static struct feat_node *feat_mba;
 
 /* Common functions */
-#define cat_default_val(len) (0xffffffff >> (32 - (len)))
+#define cat_default_val(len) (0xffffffffU >> (32 - (len)))
 
 /*
  * get_cdp_data - get DATA COS register value from input COS ID.
diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index 4081cef200..b030ad8a5b 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -398,8 +398,8 @@ static void __init print_details(enum ind_thunk thunk)
         cpuid_count(7, 0, &max, &tmp, &tmp, &_7d0);
     if ( max >= 2 )
         cpuid_count(7, 2, &tmp, &tmp, &tmp, &_7d2);
-    if ( boot_cpu_data.extended_cpuid_level >= 0x80000008 )
-        cpuid(0x80000008, &tmp, &e8b, &tmp, &tmp);
+    if ( boot_cpu_data.extended_cpuid_level >= 0x80000008U )
+        cpuid(0x80000008U, &tmp, &e8b, &tmp, &tmp);
     if ( cpu_has_arch_caps )
         rdmsrl(MSR_ARCH_CAPABILITIES, caps);
 
@@ -1337,8 +1337,8 @@ void __init init_speculation_mitigations(void)
          * TODO: Adjust cpu_has_svm_spec_ctrl to be usable earlier on boot.
          */
         if ( opt_msr_sc_hvm &&
-             (boot_cpu_data.extended_cpuid_level >= 0x8000000a) &&
-             (cpuid_edx(0x8000000a) & (1u << SVM_FEATURE_SPEC_CTRL)) )
+             (boot_cpu_data.extended_cpuid_level >= 0x8000000aU) &&
+             (cpuid_edx(0x8000000aU) & (1u << SVM_FEATURE_SPEC_CTRL)) )
             setup_force_cpu_cap(X86_FEATURE_SC_MSR_HVM);
     }
 
diff --git a/xen/arch/x86/x86_64/pci.c b/xen/arch/x86/x86_64/pci.c
index aad1c3f7cf..8d33429103 100644
--- a/xen/arch/x86/x86_64/pci.c
+++ b/xen/arch/x86/x86_64/pci.c
@@ -9,7 +9,7 @@
 #include <asm/io.h>
 
 #define PCI_CONF_ADDRESS(sbdf, reg) \
-    (0x80000000 | ((sbdf).bdf << 8) | ((reg) & ~3))
+    (0x80000000U | ((sbdf).bdf << 8) | ((reg) & ~3))
 
 uint8_t pci_conf_read8(pci_sbdf_t sbdf, unsigned int reg)
 {
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h
index 698750267a..d92be69d84 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.h
+++ b/xen/arch/x86/x86_emulate/x86_emulate.h
@@ -620,7 +620,7 @@ struct x86_emulate_ctxt
  * below).
  * Hence no separate #define-s get added.
  */
-#define X86EMUL_OPC_EXT_MASK         0xffff0000
+#define X86EMUL_OPC_EXT_MASK         0xffff0000U
 #define X86EMUL_OPC(ext, byte)       ((uint8_t)(byte) | \
                                       MASK_INSR((ext), X86EMUL_OPC_EXT_MASK))
 /*
diff --git a/xen/lib/x86/cpuid.c b/xen/lib/x86/cpuid.c
index 07e5501914..a4ea579ebe 100644
--- a/xen/lib/x86/cpuid.c
+++ b/xen/lib/x86/cpuid.c
@@ -217,10 +217,10 @@ void x86_cpu_policy_fill_native(struct cpu_policy *p)
     }
 
     /* Extended leaves. */
-    cpuid_leaf(0x80000000, &p->extd.raw[0]);
+    cpuid_leaf(0x80000000U, &p->extd.raw[0]);
     for ( i = 1; i <= MIN(p->extd.max_leaf & 0xffffU,
                           ARRAY_SIZE(p->extd.raw) - 1); ++i )
-        cpuid_leaf(0x80000000 + i, &p->extd.raw[i]);
+        cpuid_leaf(0x80000000U + i, &p->extd.raw[i]);
 
     /* Don't report leaves from possible lower level hypervisor, for now. */
     p->hv_limit = 0;
@@ -421,7 +421,7 @@ int x86_cpuid_copy_to_buffer(const struct cpu_policy *p,
     /* Extended leaves. */
     for ( leaf = 0; leaf <= MIN(p->extd.max_leaf & 0xfffful,
                                 ARRAY_SIZE(p->extd.raw) - 1); ++leaf )
-        COPY_LEAF(0x80000000 | leaf, XEN_CPUID_NO_SUBLEAF, &p->extd.raw[leaf]);
+        COPY_LEAF(0x80000000U | leaf, XEN_CPUID_NO_SUBLEAF, &p->extd.raw[leaf]);
 
 #undef COPY_LEAF
 
@@ -521,7 +521,7 @@ int x86_cpuid_copy_from_buffer(struct cpu_policy *p,
             p->hv2_limit = l.a;
             break;
 
-        case 0x80000000 ... 0x80000000 + ARRAY_SIZE(p->extd.raw) - 1:
+        case 0x80000000U ... 0x80000000U + ARRAY_SIZE(p->extd.raw) - 1:
             if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
                 goto out_of_range;
 
diff --git a/xen/lib/x86/policy.c b/xen/lib/x86/policy.c
index a9c60000af..f033d22785 100644
--- a/xen/lib/x86/policy.c
+++ b/xen/lib/x86/policy.c
@@ -22,7 +22,7 @@ int x86_cpu_policies_are_compatible(const struct cpu_policy *host,
         FAIL_CPUID(7, 0);
 
     if ( guest->extd.max_leaf > host->extd.max_leaf )
-        FAIL_CPUID(0x80000000, NA);
+        FAIL_CPUID(0x80000000U, NA);
 
     /* TODO: Audit more CPUID data. */
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 11:07:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 11:07:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570324.892100 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOcMF-0000E9-9v; Wed, 26 Jul 2023 11:07:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570324.892100; Wed, 26 Jul 2023 11:07:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOcMF-0000E2-6c; Wed, 26 Jul 2023 11:07:07 +0000
Received: by outflank-mailman (input) for mailman id 570324;
 Wed, 26 Jul 2023 11:07:06 +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 <SRS0=iO1l=DM=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qOcMD-0000Dq-Ur
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 11:07:05 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8d0cb608-2ba4-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 13:07:03 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 4BE6D1F85D;
 Wed, 26 Jul 2023 11:07:03 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1681C139BD;
 Wed, 26 Jul 2023 11:07:03 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 2Ku7A1f+wGRzGwAAMHmgww
 (envelope-from <jgross@suse.com>); Wed, 26 Jul 2023 11:07:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8d0cb608-2ba4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690369623; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=xQWth3HzOAPEhRj/NFkcxnmXAC1Etzn2prwQAeyTUxo=;
	b=PKOvFZXpo3HUa55kGL+KKfrZVuOBp5igY+iKdOkLUIgn0VUbhKvJ/zSpWBqX1HLJioRdfj
	Vio/4AIzqzXAzUw/gW5S1/YzHWhIMjZsOh8ZsV8vNjZ5owh+vmRbz2spM7oQB+iDJ/sunC
	IEB38jOVywkB4+NJ8GsdmA2WtsQKgf4=
Message-ID: <97a8e4e8-2955-f9bd-d5f2-7244061ee6f4@suse.com>
Date: Wed, 26 Jul 2023 13:07:02 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v3 08/25] tools/xenstore: make hashtable key and value
 parameters const
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-9-jgross@suse.com>
 <2c981a1a-b020-3908-8b9b-8821daec9457@xen.org>
 <a6370aa2-ec6c-259f-3e24-bc1a74ead2a6@suse.com>
 <f0a115a6-843e-74ff-7f0f-28cf0545932e@xen.org>
 <3d2daedf-b2c0-5a26-a57d-4742f69f08b7@suse.com>
 <c86e0983-6b51-c5be-a666-20fd407b2537@xen.org>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <c86e0983-6b51-c5be-a666-20fd407b2537@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------hxI3ibq4dVH3R8hdfmK307so"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------hxI3ibq4dVH3R8hdfmK307so
Content-Type: multipart/mixed; boundary="------------li9gz3XuiA5paHgFlJDTK25C";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <97a8e4e8-2955-f9bd-d5f2-7244061ee6f4@suse.com>
Subject: Re: [PATCH v3 08/25] tools/xenstore: make hashtable key and value
 parameters const
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-9-jgross@suse.com>
 <2c981a1a-b020-3908-8b9b-8821daec9457@xen.org>
 <a6370aa2-ec6c-259f-3e24-bc1a74ead2a6@suse.com>
 <f0a115a6-843e-74ff-7f0f-28cf0545932e@xen.org>
 <3d2daedf-b2c0-5a26-a57d-4742f69f08b7@suse.com>
 <c86e0983-6b51-c5be-a666-20fd407b2537@xen.org>
In-Reply-To: <c86e0983-6b51-c5be-a666-20fd407b2537@xen.org>

--------------li9gz3XuiA5paHgFlJDTK25C
Content-Type: multipart/mixed; boundary="------------gxjfkNeBN6AFtqGmsbVc5Gzl"

--------------gxjfkNeBN6AFtqGmsbVc5Gzl
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjYuMDcuMjMgMTE6MjksIEp1bGllbiBHcmFsbCB3cm90ZToNCj4gSGksDQo+IA0KPiBP
biAyNi8wNy8yMDIzIDA5OjQ0LCBKdWVyZ2VuIEdyb3NzIHdyb3RlOg0KPj4gT24gMjYuMDcu
MjMgMTA6MjAsIEp1bGllbiBHcmFsbCB3cm90ZToNCj4+PiBUbyBnaXZlIGEgY29uY3JldGUg
ZXhhbXBsZSwgd2l0aCB0aGUgY3VycmVudCBpbnRlcmZhY2Ugd2UgYXJlIHRlbGxpbmcgdGhl
IA0KPj4+IHVzZXIgdGhhdCB3aGF0IHRoZXkgc3RvcmUgaW4gdGhlIGhhc2h0YWJsZSBjYW4g
YmUgbW9kaWZpZWQgYXQgc29tZSBwb2ludC4gQnkgDQo+Pj4gYWRkaW5nICdjb25zdCcgZm9y
IHRoZSB2YWx1ZSBp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0byByZW1vdmUgdGhlIGNvbnN0IG9uIHRoZSB2YWx1ZS4NCj4gDQo+Pg0KPj4gQW4gYWx0
ZXJuYXRpdmUgd291bGQgYmUgbWFrZSBoYXNodGFibGVfc2VhcmNoKCkgcmV0dXJuIGEgY29u
c3QgYW5kIG9ubHkgY2FzdCB0aGUNCj4+IGNvbnN0IGF3YXkgd2hlcmUgaXQgaXMgcmVhbGx5
IG5lZWRlZCAoYW5kIHByb2JhYmx5IHdpdGggYSBwcm9taW5lbnQgY29tbWVudCBhdA0KPj4g
dGhlIHJlbGF0ZWQgaGFzaHRhYmxlX2FkZCgpIHBsYWNlKS4gSSB0aGluayB0aGlzIHdpbGwg
aGl0IHhlbnN0b3JlZF9kb21haW4uYyB1c2UNCj4+IGNhc2VzIG9ubHkuDQo+IA0KPiBBZ2Fp
biwgdGhpcyBzdGlsbCBtZWFucyB3ZSBhcmUgY2FzdGluZyBhd2F5IHRoZSBjb25zdCBzb21l
d2hlcmUuIFRoaXMgaXMgdGhlIA0KPiBwYXJ0IEkgYW0gYWdhaW5zdCBpZiB0aGVyZSBpcyBu
byBzdHJvbmcganVzdGlmaWNhdGlvbiBmb3IgaXQgKGkuZS4gdGhlcmUgaXMgbm8gDQo+IG90
aGVyIHdheSB0byBkbyBpdCkuDQoNCk9rYXksIEknbGwgZHJvcCB0aGUgY29uc3QgYXR0cmli
dXRlIGZvciB0aGUgdmFsdWUgcGFyYW1ldGVyLg0KDQoNCkp1ZXJnZW4NCg0K
--------------gxjfkNeBN6AFtqGmsbVc5Gzl
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EO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
N1EblHI//x/e2AaIHpzK5h88NEawQsaNRpNSrcfbFmAg987ATQRTjHAWAQgAyzH6
AOODMBjgfWE9VeCgsrwH3exNAU32gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------gxjfkNeBN6AFtqGmsbVc5Gzl--

--------------li9gz3XuiA5paHgFlJDTK25C--

--------------hxI3ibq4dVH3R8hdfmK307so
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmTA/lYFAwAAAAAACgkQsN6d1ii/Ey/S
1wf+Mt5NGdZbmpH7qfz3nEynpaQ8lzKpVHFpfyiMw5sDPnYvOe0Z73RpjyAgzYzbFuqsiIlWz+Yt
Qu1tHp8VqoXSEmbcGfqt8Yhn5M6bW2LJrBRuG2Ye1V9SpITkBasOUClpv/eRkySX9Ay4u+UBewb9
OE4L+kC9Wr3iKTvyZmT5CaVDOK2r0k+3kaG8sg2EZiYcBWJ0i729D2bCcrzgnMVq6pqbdrqt1D8x
fLYT0S4cT8zuXaFlLJP4SIT8Igg7ZUJKoa4YQso9ljNGdATs3oQekg55bSPRX75yuC0cVJAr5m72
WHdJw53DTj4s36iPdbhppycOkovgZTHOu7Ph3N8A9w==
=vJjD
-----END PGP SIGNATURE-----

--------------hxI3ibq4dVH3R8hdfmK307so--


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 11:13:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 11:13:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570336.892143 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOcSO-0002Rt-OI; Wed, 26 Jul 2023 11:13:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570336.892143; Wed, 26 Jul 2023 11:13:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOcSO-0002RK-LA; Wed, 26 Jul 2023 11:13:28 +0000
Received: by outflank-mailman (input) for mailman id 570336;
 Wed, 26 Jul 2023 11:13:27 +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
 <SRS0=LYfz=DM=xenbits.xen.org=andrewcoop@srs-se1.protection.inumbo.net>)
 id 1qOcSN-0001km-5L
 for xen-devel@lists.xen.org; Wed, 26 Jul 2023 11:13:27 +0000
Received: from mail.xenproject.org (mail.xenproject.org [104.130.215.37])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6c58eb4e-2ba5-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 13:13:20 +0200 (CEST)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1qOcS0-00084H-SG; Wed, 26 Jul 2023 11:13:04 +0000
Received: from andrewcoop by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1qOcS0-0007bb-Pt; Wed, 26 Jul 2023 11:13:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6c58eb4e-2ba5-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:CC:From:To:MIME-Version:
	Content-Transfer-Encoding:Content-Type;
	bh=Hy6QSi/95sh5Gms38RZprGTol6LrLiupnOt52RrznXg=; b=XR6tfhaBxTQYooRc2anjTTDM+l
	yezEFVS7WgjNxCoRjoiMCAWB566MSbGsXQvj8q1rDroONhFv2iwy3bLm8cxiX06TBJ9jnwld2AQ8G
	UcMCSliUSjmHk1eWp0rlX+UBcmmOx9eSsAon/7O7bQa3oz/15Xy+V1bkZbsqp5Hlekeg=;
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.509 (Entity 5.509)
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
 xen-users@lists.xen.org, oss-security@lists.openwall.com
From: Xen.org security team <security@xen.org>
CC: Xen.org security team <security-team-members@xen.org>
Subject: Xen Security Advisory 433 v2 (CVE-2023-20593) - x86/AMD: Zenbleed
Message-Id: <E1qOcS0-0007bb-Pt@xenbits.xenproject.org>
Date: Wed, 26 Jul 2023 11:13:04 +0000

--=separator
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

            Xen Security Advisory CVE-2023-20593 / XSA-433
                              version 2

                          x86/AMD: Zenbleed

UPDATES IN VERSION 2
====================

Include the CVE, which was missed accidentally in the rush of
timelines repeatedly moving underfoot.

ISSUE DESCRIPTION
=================

Researchers at Google have discovered Zenbleed, a hardware bug causing
corruption of the vector registers.

When a VZEROUPPER instruction is discarded as part of a bad transient
execution path, its effect on internal tracking are not unwound
correctly.  This manifests as the wrong micro-architectural state
becoming architectural, and corrupting the vector registers.

Note: While this malfunction is related to speculative execution, this
      is not a speculative sidechannel vulnerability.

The corruption is not random.  It happens to be stale values from the
physical vector register file, a structure competitively shared between
sibling threads.  Therefore, an attacker can directly access data from
the sibling thread, or from a more privileged context.

For more details, see:
  https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7008.html
  https://github.com/google/security-research/security/advisories/GHSA-v6wh-rxpg-cmm8

IMPACT
======

With very low probability, corruption of the vector registers can occur.
This data corruption causes mis-calculations in subsequent logic.

An attacker can exploit this bug to read data from different contexts on
the same core.  Examples of such data includes key material, cypher and
plaintext from the AES-NI instructions, or the contents of REP-MOVS
instructions, commonly used to implement memcpy().

VULNERABLE SYSTEMS
==================

Systems running all versions of Xen are affected.

This bug is specific to the AMD Zen2 microarchitecture.  AMD do not
believe that other microarchitectures are affected.

MITIGATION
==========

This issue can be mitigated by disabling AVX, either by booting Xen with
`cpuid=no-avx` on the command line, or by specifying `cpuid="host:avx=0"` in
the vm.cfg file of all untrusted VMs.  However, this will come with a
significant impact on the system and is not recommended for anyone able to
deploy the microcode or patch described below.

RESOLUTION
==========

AMD are producing microcode updates to address the bug.  Consult your
dom0 OS vendor.  This microcode is effective when late-loaded, which can
be performed on a live system without reboot.

In cases where microcode is not available, the appropriate attached
patch updates Xen to use a control register to avoid the issue.

Note that patches for released versions are generally prepared to
apply to the stable branches, and may not apply cleanly to the most
recent release tarball.  Downstreams are encouraged to update to the
tip of the stable branch before applying these patches.

xsa433.patch           xen-unstable
xsa433-4.17.patch      Xen 4.17.x
xsa433-4.16.patch      Xen 4.16.x
xsa433-4.15.patch      Xen 4.15.x
xsa433-4.14.patch      Xen 4.14.x

$ sha256sum xsa433*
a9331733b63e3e566f1436a48e9bd9e8b86eb48da6a8ced72ff4affb7859e027  xsa433.patch
6f1db2a2078b0152631f819f8ddee21720dabe185ec49dc9806d4a9d3478adfd  xsa433-4.14.patch
ca3a92605195307ae9b6ff87240beb52a097c125a760c919d7b9a0aff6e557c0  xsa433-4.15.patch
e5e94b3de68842a1c8d222802fb204d64acd118e3293c8e909dfaf3ada23d912  xsa433-4.16.patch
41d12104869b7e8307cd93af1af12b4fd75a669aeff15d31b234dc72981ae407  xsa433-4.17.patch
$

NOTE CONCERNING TIMELINE
========================

This issue is subject to coordinated disclosure on August 8th.  The
discoverer chose to publish details ahead of this timeline.
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmTA/2cMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZ0EIH/02n/gvMGF5RCwfs/uvwjsQASAgELWTgAFv+tXOG
yLZWCxNkWAWDxTWAEWfdcSsLCN8GDc4c6lNuhqnV3mVsIDiGSHmXgSkI9pcCQ79T
2KTgC+ncMM4yeYTI5SUL4xvzzIQ/38t5gK5+AyPxg3jpMhCLEz2dJwbjgd4CKai+
ax+l3cX9ibLj/lQQwvgkPXweAVsfILnCAB5J1VQb1Jw0DWauYJLurMj0flz82a2O
NftdEx3b5ADDxXHdE52J5p/kpXMDohdPm0R07Y63j+eY+QJADLHfwE+n4pqyzvDf
kPEGUtxbcCj4VygmO6xrHgoHYqaGbRYeHJyHEt4jpZDLwP4=
=9wn5
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa433.patch"
Content-Disposition: attachment; filename="xsa433.patch"
Content-Transfer-Encoding: base64

RnJvbTogQW5kcmV3IENvb3BlciA8YW5kcmV3LmNvb3BlcjNAY2l0cml4LmNv
bT4KU3ViamVjdDogeDg2L2FtZDogTWl0aWdhdGlvbnMgZm9yIFplbmJsZWVk
CgpaZW5ibGVlZCBpcyBhIG1hbGZ1bmN0aW9uIG9uIEFNRCBaZW4yIHVhcmNo
IHBhcnRzIHdoaWNoIHJlc3VsdHMgaW4gY29ycnVwdGlvbgpvZiB0aGUgdmVj
dG9yIHJlZ2lzdGVycy4gIEFuIGF0dGFja2VyIGNhbiB0cmlnZ2VyIHRoaXMg
YnVnIGRlbGliZXJhdGVseSBpbgpvcmRlciB0byBhY2Nlc3Mgc3RhbGUgZGF0
YSBpbiB0aGUgcGh5c2ljYWwgdmVjdG9yIHJlZ2lzdGVyIGZpbGUuICBUaGlz
IGNhbgppbmNsdWRlIGRhdGEgZnJvbSBzaWJsaW5nIHRocmVhZHMsIG9yIGEg
aGlnaGVyLXByaXZpbGVnZSBjb250ZXh0LgoKTWljcm9jb2RlIGlzIHRoZSBw
cmVmZXJyZWQgbWl0aWdhdGlvbiBidXQgaW4gdGhlIGNhc2UgdGhhdCdzIG5v
dCBhdmFpbGFibGUgdXNlCnRoZSBjaGlja2VuYml0IGFzIG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I2Miw4IEBAIHN0YXRpYyBpbnQgY2ZfY2hlY2sgYXBwbHlfbWljcm9jb2Rl
KGNvbnN0IHN0cnVjdCBtaWNyb2NvZGVfcGF0Y2ggKnBhdGNoKQogICAgICAg
ICAgICAibWljcm9jb2RlOiBDUFUldSB1cGRhdGVkIGZyb20gcmV2aXNpb24g
JSN4IHRvICUjeCwgZGF0ZSA9ICUwNHgtJTAyeC0lMDJ4XG4iLAogICAgICAg
ICAgICBjcHUsIG9sZF9yZXYsIHJldiwgcGF0Y2gtPnllYXIsIHBhdGNoLT5t
b250aCwgcGF0Y2gtPmRheSk7CiAKKyAgICBhbWRfY2hlY2tfemVuYmxlZWQo
KTsKKwogICAgIHJldHVybiAwOwogfQogCmRpZmYgLS1naXQgYS94ZW4vYXJj
aC94ODYvaW5jbHVkZS9hc20vcHJvY2Vzc29yLmggYi94ZW4vYXJjaC94ODYv
aW5jbHVkZS9hc20vcHJvY2Vzc29yLmgKaW5kZXggM2IzY2Y1MTgxNGY4Li5j
MDUyOWNjM2Q5ODQgMTAwNjQ0Ci0tLSBhL3hlbi9hcmNoL3g4Ni9pbmNsdWRl
L2FzbS9wcm9jZXNzb3IuaAorKysgYi94ZW4vYXJjaC94ODYvaW5jbHVkZS9h
c20vcHJvY2Vzc29yLmgKQEAgLTU0Nyw2ICs1NDcsOCBAQCBlbnVtIGFwX2Jv
b3RfbWV0aG9kIHsKIH07CiBleHRlcm4gZW51bSBhcF9ib290X21ldGhvZCBh
cF9ib290X21ldGhvZDsKIAordm9pZCBhbWRfY2hlY2tfemVuYmxlZWQodm9p
ZCk7CisKICNlbmRpZiAvKiAhX19BU1NFTUJMWV9fICovCiAKICNlbmRpZiAv
KiBfX0FTTV9YODZfUFJPQ0VTU09SX0ggKi8KCg==

--=separator
Content-Type: application/octet-stream; name="xsa433-4.14.patch"
Content-Disposition: attachment; filename="xsa433-4.14.patch"
Content-Transfer-Encoding: base64

RnJvbTogQW5kcmV3IENvb3BlciA8YW5kcmV3LmNv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RleCAzZmY3Y2M1ODA3ZTcuLjcx
YjQ1NGQ5ODRhYyAxMDA2NDQKLS0tIGEveGVuL2luY2x1ZGUvYXNtLXg4Ni9w
cm9jZXNzb3IuaAorKysgYi94ZW4vaW5jbHVkZS9hc20teDg2L3Byb2Nlc3Nv
ci5oCkBAIC02MzUsNiArNjM1LDggQEAgdm9pZCB0c3hfaW5pdCh2b2lkKTsK
IHZvaWQgdXBkYXRlX21jdV9vcHRfY3RybCh2b2lkKTsKIHZvaWQgc2V0X2lu
X21jdV9vcHRfY3RybCh1aW50MzJfdCBtYXNrLCB1aW50MzJfdCB2YWwpOwog
Cit2b2lkIGFtZF9jaGVja196ZW5ibGVlZCh2b2lkKTsKKwogI2VuZGlmIC8q
ICFfX0FTU0VNQkxZX18gKi8KIAogI2VuZGlmIC8qIF9fQVNNX1g4Nl9QUk9D
RVNTT1JfSCAqLwoK

--=separator
Content-Type: application/octet-stream; name="xsa433-4.15.patch"
Content-Disposition: attachment; filename="xsa433-4.15.patch"
Content-Transfer-Encoding: base64

RnJvbTogQW5kcmV3IENvb3BlciA8YW5kcmV3LmNvb3BlcjNAY2l0cml4LmNv
bT4KU3ViamVjdDogeDg2L2FtZDogTWl0aWdhdGlvbnMgZm9yIFplbmJsZWVk
CgpaZW5ibGVlZCBpcyBhIG1hbGZ1bmN0aW9uIG9uIEFNRCBaZW4yIHVhcmNo
IHBhcnRzIHdoaWNoIHJlc3VsdHMgaW4gY29ycnVwdGlvbgpvZiB0aGUgdmVj
dG9yIHJlZ2lzdGVycy4gIEFuIGF0dGFja2VyIGNhbiB0cmlnZ2VyIHRoaXMg
YnVnIGRlbGliZXJhdGVseSBpbgpvcmRlciB0byBhY2Nlc3Mgc3RhbGUgZGF0
YSBpbiB0aGUgcGh5c2ljYWwgdmVjdG9yIHJlZ2lzdGVyIGZpbGUuICBUaGlz
IGNhbgppbmNsdWRlIGRhdGEgZnJvbSBzaWJsaW5nIHRocmVhZHMsIG9yIGEg
aGlnaGVyLXBya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YmE0OTY3Yzcw
Li45MDYyOWJlZTBkYWIgMTAwNjQ0Ci0tLSBhL3hlbi9hcmNoL3g4Ni9jcHUv
bWljcm9jb2RlL2FtZC5jCisrKyBiL3hlbi9hcmNoL3g4Ni9jcHUvbWljcm9j
b2RlL2FtZC5jCkBAIC0yNTQsNiArMjU0LDggQEAgc3RhdGljIGludCBhcHBs
eV9taWNyb2NvZGUoY29uc3Qgc3RydWN0IG1pY3JvY29kZV9wYXRjaCAqcGF0
Y2gpCiAgICAgcHJpbnRrKFhFTkxPR19XQVJOSU5HICJtaWNyb2NvZGU6IENQ
VSV1IHVwZGF0ZWQgZnJvbSByZXZpc2lvbiAlI3ggdG8gJSN4XG4iLAogICAg
ICAgICAgICBjcHUsIG9sZF9yZXYsIHJldik7CiAKKyAgICBhbWRfY2hlY2tf
emVuYmxlZWQoKTsKKwogICAgIHJldHVybiAwOwogfQogCmRpZmYgLS1naXQg
YS94ZW4vaW5jbHVkZS9hc20teDg2L3Byb2Nlc3Nvci5oIGIveGVuL2luY2x1
ZGUvYXNtLXg4Ni9wcm9jZXNzb3IuaAppbmRleCBjODc0NWUxZjMxYWEuLjdi
NWJhNDFhNDBhMCAxMDA2NDQKLS0tIGEveGVuL2luY2x1ZGUvYXNtLXg4Ni9w
cm9jZXNzb3IuaAorKysgYi94ZW4vaW5jbHVkZS9hc20teDg2L3Byb2Nlc3Nv
ci5oCkBAIC02NDEsNiArNjQxLDggQEAgZW51bSBhcF9ib290X21ldGhvZCB7
CiB9OwogZXh0ZXJuIGVudW0gYXBfYm9vdF9tZXRob2QgYXBfYm9vdF9tZXRo
b2Q7CiAKK3ZvaWQgYW1kX2NoZWNrX3plbmJsZWVkKHZvaWQpOworCiAjZW5k
aWYgLyogIV9fQVNTRU1CTFlfXyAqLwogCiAjZW5kaWYgLyogX19BU01fWDg2
X1BST0NFU1NPUl9IICovCgo=

--=separator
Content-Type: application/octet-stream; name="xsa433-4.16.patch"
Content-Disposition: attachment; filename="xsa433-4.16.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Dg2L3Byb2Nlc3Nvci5oIGIv
eGVuL2luY2x1ZGUvYXNtLXg4Ni9wcm9jZXNzb3IuaAppbmRleCAzZDhhYWNk
M2FhYjIuLjk2NjIxZWMzOWY4YiAxMDA2NDQKLS0tIGEveGVuL2luY2x1ZGUv
YXNtLXg4Ni9wcm9jZXNzb3IuaAorKysgYi94ZW4vaW5jbHVkZS9hc20teDg2
L3Byb2Nlc3Nvci5oCkBAIC02MzksNiArNjM5LDggQEAgZW51bSBhcF9ib290
X21ldGhvZCB7CiB9OwogZXh0ZXJuIGVudW0gYXBfYm9vdF9tZXRob2QgYXBf
Ym9vdF9tZXRob2Q7CiAKK3ZvaWQgYW1kX2NoZWNrX3plbmJsZWVkKHZvaWQp
OworCiAjZW5kaWYgLyogIV9fQVNTRU1CTFlfXyAqLwogCiAjZW5kaWYgLyog
X19BU01fWDg2X1BST0NFU1NPUl9IICovCgo=

--=separator
Content-Type: application/octet-stream; name="xsa433-4.17.patch"
Content-Disposition: attachment; filename="xsa433-4.17.patch"
Content-Transfer-Encoding: base64

RnJvbTogQW5kcmV3IENvb3BlciA8YW5kcmV3LmNvb3BlcjNAY2l0cml4LmNv
bT4KU3ViamVjdDogeDg2L2FtZDogTWl0aWdhdGlvbnMgZm9yIFplbmJsZWVk
CgpaZW5ibGVlZCBpcyBhIG1hbGZ1bmN0aW9uIG9uIEFNRCBaZW4yIHVhcmNo
IHBhcnRzIHdoaWNoIHJlc3VsdHMgaW4gY29ycnVwdGlvbgpvZiB0aGUgdmVj
dG9yIHJlZ2lzdGVycy4gIEFuIGF0dGFja2VyIGNhbiB0cmlnZ2VyIHRoaXMg
YnVnIGRlbGliZXJhdGVseSBpbgpvcmRlciB0byBhY2Nlc3Mgc3RhbGUgZGF0
YSBpbiB0aGUgcGh5c2ljYWwgdmVjdG9yIHJlZ2lzdGVyIGZpbGUuICBUaGlz
IGNhbgppbmNsdWRlIGRhdGEgZnJvbSBzaWJsaW5nIHRocmVhZHMsIG9yIGEg
aGln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X0FTTV9YODZfUFJPQ0VTU09SX0ggKi8KCg==

--=separator--


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 11:23:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 11:23:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570405.892153 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOcby-0005Hs-Pp; Wed, 26 Jul 2023 11:23:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570405.892153; Wed, 26 Jul 2023 11:23:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOcby-0005Hl-N0; Wed, 26 Jul 2023 11:23:22 +0000
Received: by outflank-mailman (input) for mailman id 570405;
 Wed, 26 Jul 2023 11:23:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=oEth=DM=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qOcbx-0005Hf-BC
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 11:23:21 +0000
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
 [2a00:1450:4864:20::62e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d2f8e0ab-2ba6-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 13:23:20 +0200 (CEST)
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-98e39784a85so189576266b.1
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 04:23:20 -0700 (PDT)
Received: from [192.168.202.116] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 n26-20020a170906165a00b00992b2c5598csm9433515ejd.128.2023.07.26.04.23.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 04:23:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d2f8e0ab-2ba6-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690370599; x=1690975399;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=11UNgujpwEKJdz6Z2I3iV3kHoCW2D5RSZkF6p2hXuUk=;
        b=b73neL91vYEsQUwof69NMTAWp/Jh6OIGuTdBaa+ir82gk5ULQkMCprML0GvjvZ7etE
         gth74njHzbFadGRnd/JusGl8P2ZlMeaD9LuccZaVr4qzUfgmwBXI5m5x6JpjBkPaeTyH
         g+0XfV8p43jbRRfHs119QBwjvWxplRy3kJ4004NycNaabLtQp9qoe9EibC9EfJeOZeHA
         8SfLWuxz7j4KfYSO1oiPhiNXa9LmyGXSPMQuCieTyii3vH6P+uXRGqscQ4yqUX1f60T6
         UQRUK+pBTBtwy4j006hS47h+3Dyc5+bBSktJClS4Aw5HZhQNqwRPLCZk4UsLqnCJ2sjL
         xU4Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690370599; x=1690975399;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=11UNgujpwEKJdz6Z2I3iV3kHoCW2D5RSZkF6p2hXuUk=;
        b=NoXc1cCCDj/pfLLSRxhqAZ5+JfZ/2AxDynrqiqZqu7/KyTsyHaNGGzo1joiXX+9Ux+
         RCeUHX3xeLCAryvjQS/Kh2ln1+T7LeO3G6Pnl6RsrrPeWF9JpIXKDJGQcaTNROfcIljK
         5Iv1AQaGlZAx8wyzqOOXpHNz9N+5uT8q+2OEZw0kZ+rFHVu4mWVB4nTMbCOfpOiM64y4
         2IuHbLN+PORbv0J37EP+mypB+bfl3CgWWc1YMjSnFMNvSA774jdH7Ou1KX2K7yI5lPbV
         g5hv6IwlZb3b5Ni7OvPZSJoTB5c1pi1aF3YckPIMUMZCq0qlpjRH9gQJ/fIn+1/geRiE
         TuhA==
X-Gm-Message-State: ABy/qLZDVsvEqHOGSGUStVc+nvhYB8oOdp0ZDdjadDnA3j7bi0mZ34hd
	q7xkJNmcxzXN6ybAX9OFaAYW/i2fCfM=
X-Google-Smtp-Source: APBJJlF8xjzF1kpLrsK56ZWfomeBhLEIKT81Zl2ARjgMbB8wU3PEXYdIZXFq4jyFIIFuHblW4Hvdmg==
X-Received: by 2002:a17:907:a047:b0:99b:484b:21b4 with SMTP id gz7-20020a170907a04700b0099b484b21b4mr2101028ejc.8.1690370598876;
        Wed, 26 Jul 2023 04:23:18 -0700 (PDT)
Message-ID: <a370548e30aaa8c1160ecd5f2eccfcc10002a8f9.camel@gmail.com>
Subject: Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping
From: Oleksii <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>,  Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>, Connor Davis
 <connojdavis@gmail.com>
Date: Wed, 26 Jul 2023 14:23:17 +0300
In-Reply-To: <a8ab1829ab718dda869db3df3348ded211e81967.1690191480.git.oleksii.kurochko@gmail.com>
References: <cover.1690191480.git.oleksii.kurochko@gmail.com>
	 <a8ab1829ab718dda869db3df3348ded211e81967.1690191480.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: base64
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

SGkgYWxsLAoKSSB3b3VsZCBsaWtlIHRvIGFzayBmb3IgYWR2aWNlIG9uIHdoZXRoZXIgaXQgd291
bGQgYmUgZWFzaWVyLCBsZXNzIGJ1Zy0KcHJvdm9raW5nICggZHVyaW5nIGlkZW50aXR5IG1hcHBp
bmcgdG8gcmVtb3ZlIG9mIHdob2xlIFhlbiApIHRvIGhhdmUgYQpzZXBhcmF0ZSBpZGVudGl0eSBz
ZWN0aW9uIHRoYXQgd29uJ3QgYmUgbW9yZSB0aGFuIFBBR0VfU0laRS4KClBsZWFzZSB0YWtlIGEg
bG9vayBhdCB0aGUgY2hhbmdlcyBiZWxvdy4gQ29tbWVudHMgYXJlIHdlbGNvbWUuCgpkaWZmIC0t
Z2l0IGEveGVuL2FyY2gvcmlzY3YvbW0uYyBiL3hlbi9hcmNoL3Jpc2N2L21tLmMKaW5kZXggN2Qx
YThiZWJhOC4uYmE0YWY0OGZjNiAxMDA2NDQKLS0tIGEveGVuL2FyY2gvcmlzY3YvbW0uYworKysg
Yi94ZW4vYXJjaC9yaXNjdi9tbS5jCkBAIC0yNiw2ICsyNiw4IEBAIHN0YXRpYyB1bnNpZ25lZCBs
b25nIF9fcm9fYWZ0ZXJfaW5pdCBwaHlzX29mZnNldDsKwqAjZGVmaW5lIExPQURfVE9fTElOSyhh
ZGRyKSAoKHVuc2lnbmVkIGxvbmcpKGFkZHIpIC0gcGh5c19vZmZzZX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VOVC4KwqAgKi8K
wqBBU1NFUlQoX2VuZCAtIF9zdGFydCA8PSBNQigyKSwgIlhlbiB0b28gbGFyZ2UgZm9yIGVhcmx5
LWJvb3QKYXNzdW1wdGlvbnMiKQorCitBU1NFUlQoX2lkZW50X2VuZCAtIF9pZGVudF9zdGFydCA8
PSBLQig0KSwgIklkZW50aXR5IHNlY3Rpb24gaXMgYmlnZ2VyCnRoZW4gNEtiIikKCn4gT2xla3Np
aQo=



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 11:55:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 11:55:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570414.892168 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOd6n-0000MB-8s; Wed, 26 Jul 2023 11:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570414.892168; Wed, 26 Jul 2023 11:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOd6n-0000M4-6E; Wed, 26 Jul 2023 11:55:13 +0000
Received: by outflank-mailman (input) for mailman id 570414;
 Wed, 26 Jul 2023 11:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOd6m-0000Lr-Pr; Wed, 26 Jul 2023 11:55:12 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOd6m-0000dI-OC; Wed, 26 Jul 2023 11:55:12 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOd6m-0008Hn-7F; Wed, 26 Jul 2023 11:55:12 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOd6m-0004os-6c; Wed, 26 Jul 2023 11:55:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=+uUSafMUpKpJoFr8Us3eJBMEjN1+B7zBM1jfDT8uq/M=; b=0YGGlTKvtLA1+3xRbA6+kSzdNY
	s+R/Zs/lsHX00U+jNO5y2PotfaXi8Hk1n8fvTJRrHGyT8Qtc6bvNFL78D2Vyb21/JdSVNkWJu1PKF
	SqkkrsYuu8CzqBE1YzBSjJy9hDWRjVE3ArMZ2klY7gHXize9mL082p9YQZeDHTjMbYKc=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182016-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.17-testing test] 182016: tolerable trouble: fail/pass/starved - PUSHED
X-Osstest-Failures:
    xen-4.17-testing:test-amd64-i386-migrupgrade:xen-install/dst_host:fail:heisenbug
    xen-4.17-testing:test-amd64-i386-migrupgrade:xen-install/src_host:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-raw:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit1:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-qcow2:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-raw:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-vhd:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-xsm:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit2:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-thunderx:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-vhd:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit1:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-multivcpu:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-rtds:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-xsm:hosts-allocate:starved:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit2:hosts-allocate:starved:nonblocking
X-Osstest-Versions-This:
    xen=04f14792a6c7a4e4cd8fda10b29c7e72837c5433
X-Osstest-Versions-That:
    xen=3141a0b85c37b76e069ec7dcb906ff202f5c4075
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 26 Jul 2023 11:55:12 +0000

flight 182016 xen-4.17-testing real [real]
flight 182022 xen-4.17-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/182016/
http://logs.test-lab.xenproject.org/osstest/logs/182022/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-migrupgrade 11 xen-install/dst_host fail pass in 182022-retest

Tests which did not succeed, but are not blocking:
 test-amd64-i386-migrupgrade  10 xen-install/src_host         fail  like 181997
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181997
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181997
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181997
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181997
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181997
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181997
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181997
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181997
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181997
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw  3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl           3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl-credit1   3 hosts-allocate               starved  n/a
 test-armhf-armhf-libvirt      3 hosts-allocate               starved  n/a
 test-armhf-armhf-libvirt-qcow2  3 hosts-allocate               starved  n/a
 test-armhf-armhf-libvirt-raw  3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-vhd       3 hosts-allocate               starved  n/a
 test-arm64-arm64-libvirt-xsm  3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl-credit2   3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl-thunderx  3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl-vhd       3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl           3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-credit1   3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-multivcpu  3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-rtds      3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl-xsm       3 hosts-allocate               starved  n/a
 test-armhf-armhf-xl-credit2   3 hosts-allocate               starved  n/a

version targeted for testing:
 xen                  04f14792a6c7a4e4cd8fda10b29c7e72837c5433
baseline version:
 xen                  3141a0b85c37b76e069ec7dcb906ff202f5c4075

Last test of basis   181997  2023-07-24 16:37:35 Z    1 days
Testing same since   182016  2023-07-26 00:36:44 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Michal Orzel <michal.orzel@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          starved 
 test-armhf-armhf-xl                                          starved 
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 starved 
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      starved 
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  starved 
 test-armhf-armhf-xl-credit1                                  starved 
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  starved 
 test-armhf-armhf-xl-credit2                                  starved 
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     starved 
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                starved 
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               starved 
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 starved 
 test-armhf-armhf-libvirt-raw                                 starved 
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     starved 
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 starved 
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      starved 
 test-armhf-armhf-xl-vhd                                      starved 
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   3141a0b85c..04f14792a6  04f14792a6c7a4e4cd8fda10b29c7e72837c5433 -> stable-4.17


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 11:58:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 11:58:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570419.892177 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOd9d-00010T-S4; Wed, 26 Jul 2023 11:58:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570419.892177; Wed, 26 Jul 2023 11:58:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOd9d-00010M-On; Wed, 26 Jul 2023 11:58:09 +0000
Received: by outflank-mailman (input) for mailman id 570419;
 Wed, 26 Jul 2023 11:58:09 +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 <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOd9d-00010E-3X
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 11:58:09 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on062e.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::62e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ae7fc88b-2bab-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 13:58:06 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8318.eurprd04.prod.outlook.com (2603:10a6:102:1c0::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 11:58:04 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 11:58:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ae7fc88b-2bab-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=YrMGus5gezlx8M/UCBw6/fnu3cORow+W+/J8CB6EUR7LWxHLlkGpCXneglLtfayBaz3AmJYmonDHib9/rKnbcCrCYX4eOVkGoSBNAo/nnfPKwhmw4SofuHPA2/Wgy2pI4KU/tnRYaBwVRiLp56aEkY8AGBrIflg1oXcTf7VBNd52y7FYi3073w55WO5smPjXa838rJZTb2vgppEMTV+AbRuHtW4z8O3PTZaasfZAkfYv9ofGMg9E4q9eIGpiOSTNVJQMkyd4bEKWBq3o5u/0czAHsI+nn0/gCMH6Li265CCPSqY0zpMX+7sB9FwxA3ER/PadTSdQZ+xuR9LjlgAyQw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=1Kv64caLvCUE45jELVeNvwxD26DIDkltWkvIeQWmpBw=;
 b=J0laxt5eZYAKxdYBkD+3OD2zEuezMrhYIJkQv7D0lYyzWKacdNtj9pLwy+ygTT2lQ+7kM50hEeHnF19yW0/bpm6JFLuiBqngLClU21jF1LdaM2mOOWPFFXSJeg7HUYWW1GxwW7w2ZlbzehfBDn3uEIv6Fj7BNI0xOwEHcY6kd3ExCB2F0XWIEJ+UFtmGY+xM1Wb1oElb4EbpKy10X/+tRO479TDJULawinZi8B4NDiMpp6aRE/I6A1LFkp4hL963E0ShSCb0BcJNF4sMNLbL2ZMki6ZAPgmY8EPxKEQ8HIcWuqyxIdSdCR/ZoKCJc0+CG+L+uJQWfooWXk/gLFs3yA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=1Kv64caLvCUE45jELVeNvwxD26DIDkltWkvIeQWmpBw=;
 b=3yJfR2r7ov5RDkH8FNe7/t/MTm6yPkRWRTGgg5VHpITIO0ChKPr2LQSy5O7NgbbVTJAX92wNG69M6BvLE2Cr25FN8HCS4ygsVW8+A200B9UVOVaDeQhYO5JB9oEfygmaJEt68x9sVkoI9FIZ1tpLYZnRR0EkSCPTc0GeTczKILMwOvnV60kKYc6RjM2sW5Egr8sYZJ0FUcB0fqfBmUcSB2T/DQ0VfLkM4GlZfobyY6c6B4yHAE6ktWZiUWtu+OtvU+F7O3jBT61VuRTnayi6wqXHJnGPxcp7ss1p0Zs/6jBQU6GZpDOPVfDtnYY+ql1YbrdylXbzIMz9U8myFmJkDQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <6675f535-7cf7-dd55-4ebe-82ba486029f7@suse.com>
Date: Wed, 26 Jul 2023 13:58:01 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1690191480.git.oleksii.kurochko@gmail.com>
 <a8ab1829ab718dda869db3df3348ded211e81967.1690191480.git.oleksii.kurochko@gmail.com>
 <a370548e30aaa8c1160ecd5f2eccfcc10002a8f9.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <a370548e30aaa8c1160ecd5f2eccfcc10002a8f9.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0183.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9f::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8318:EE_
X-MS-Office365-Filtering-Correlation-Id: bc4acc53-e0cb-43d2-6ab4-08db8dcf9132
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	46ZTXzXnKZLPgSE2L53tYetjLAF0xz6h6KSHmTRBQsgLNmYlYdehcGww205UhrIb2IXx17oYX7+oao65rL5+BkdJwtcIMb2a07Pvdh2GvLqdtk5+ZgYbUF+nexASL27+S7gQEkfBCY9XsVN+Kms70hZScLsuFUUTNWD9VSSoAcxmy9If8yTrPeMEwmtL+XKUrIS5BX/pCGg9LQwUU0A95hHvD9lzSQnTTkGN3x06BiGsTGUwLylDbFSlKl+3+SXJPxMDG2d3Drvl1MvwDE5L6HJCRuhJm/9z/xdVlgIhZuvZYZdB1EehFKDYVB2ZN+TxIt+FXbNQ85nVrYxbmpF2MZ5of/ypZ69tAph5X3e5jhfJSRg/BoadOKQ/uT/DuGvFlg39PXtDGEov3Id7ZHj3icjhfvWqHKnyCa+Vy5T0V3Xe3E1ezCzEo+Gj2H2BQZ58gN/PS6joqPJlnpxalml5kAtUoy4ExQCYNyV7KCdmo+Y1C/equMkZ2iZiUNsBYQxaaZ8kO3URhBlqDNuEspK3f/q19id8TJiiNFq8uK3joCc+CG4FLpbiwgHBRLWX4TNKJ3SIxXm7AoXfFWkJn4fRSUVSnzJp1qodw8d+FM3V+huEVU0tUrjc+DUYcWr2NYuNW7bmMuEEi4wa2BppKt/29w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(366004)(396003)(376002)(136003)(451199021)(478600001)(6512007)(54906003)(6486002)(6666004)(66476007)(2616005)(186003)(26005)(6506007)(53546011)(2906002)(66556008)(6916009)(4326008)(316002)(5660300002)(8676002)(8936002)(66946007)(41300700001)(38100700002)(31696002)(86362001)(36756003)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?V3Y0T2RpbXQvZ0RZNys5NEJPTmF3cm1McEJ6a2hCb0VyV0t3cVNVOVh2aU1r?=
 =?utf-8?B?SmVHbDlHYXV3bzk4OVNmcUxEdWswTm5kdE9zOEhQRFBKUkJSUVljRkxJUlE2?=
 =?utf-8?B?OWVmbWV2OTVTdVVNTkN5ZGhObURTd3UyLzdkVHJONmR3aFhsWUxueERPVktY?=
 =?utf-8?B?Ukt5eS9LT0tzSTZqbE1DemhZT0d2SjRhbXRFVEJ1SXA4RDB5bWJNeGVDdXZJ?=
 =?utf-8?B?enpWYTc3VlV2K1RLV1JhL21HQzBkMWNNcU9WUUowWk0ycVVGaWYwdjUyc1cy?=
 =?utf-8?B?d05GODdjbFArNE80YmdYK3dKWjNONEphc2IyUzlEdG9QQTFjeU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ydlpsRXVYaGE2MlNmUE81c3NEdndjWUY1WWd2STN1?=
 =?utf-8?Q?iZQOwuXa1SHNPdTnlX+rpjHkk?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bc4acc53-e0cb-43d2-6ab4-08db8dcf9132
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 11:58:03.8951
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: +kNKNDT+xPvbib6dxBNAHiafTihU/cw7FgFGmwz+I9p5QOxsjyXn6gBsZDh1RGHwzhbimohmHYDJxRA6KO+8YA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8318

On 26.07.2023 13:23, Oleksii wrote:
> I would like to ask for advice on whether it would be easier, less bug-
> provoking ( during identity mapping to remove of whole Xen ) to have a
> separate identity section that won't be more than PAGE_SIZE.

I'm afraid you can't safely do this in C, or at least not without
further checking on what the compiler actually did.

> @@ -264,6 +268,19 @@ void __init enable_mmu(void)
> Â  Â  Â  Â  Â  Â  Â  Â RV_STAGE1_MODE << SATP_MODE_SHIFT);
> Â }
> Â 
> +void __attribute__((naked)) __section(".ident") turn_on_mmu(unsigned
> long ra)

Did you read what gcc doc says about "naked"? Extended asm() isn't
supported there. Since ...

> +{
> + Â  Â /* Ensure page table writes precede loading the SATP */
> + Â  Â sfence_vma();
> +
> + Â  Â /* Enable the MMU and load the new pagetable for Xen */
> + Â  Â csr_write(CSR_SATP,
> + Â  Â  Â  Â  Â  Â  Â PFN_DOWN((unsigned long)stage1_pgtbl_root) |
> + Â  Â  Â  Â  Â  Â  Â RV_STAGE1_MODE << SATP_MODE_SHIFT);
> +
> + Â  Â asm volatile( "jr %0\n" : : "r"(ra) );
> +}

... none of this really requires C, I think we're at the point where
(iirc) Andrew's and my suggestion wants following, moving this to
assembly code (at which point it doesn't need to be a separate
function). You can still build page tables in C, of course. (Likely
you then also won't need a separate section; some minimal alignment
guarantees ought to suffice to make sure the critical code is
confined to a single page.)

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 12:02:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 12:02:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570428.892188 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOdEC-0002fi-Ne; Wed, 26 Jul 2023 12:02:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570428.892188; Wed, 26 Jul 2023 12:02:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOdEC-0002fb-KO; Wed, 26 Jul 2023 12:02:52 +0000
Received: by outflank-mailman (input) for mailman id 570428;
 Wed, 26 Jul 2023 12:02:51 +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 <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOdEB-0002fV-Mm
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 12:02:51 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on20629.outbound.protection.outlook.com
 [2a01:111:f400:fe16::629])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 57165d8d-2bac-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 14:02:49 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB8PR04MB6796.eurprd04.prod.outlook.com (2603:10a6:10:11e::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 12:02:46 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 12:02:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 57165d8d-2bac-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=XG20joKvqirFTaCqE1USMXW+UEHo9/wejWM+phgtkdp6M63x0sYIDHgqM/VDrChdSHE1mkiebjvTEdFH8XlUmFILTdWRVX9EDmcFeLCeMbjy6eOd5DC2x0ab3ywhfhQJs3vbbh7quhWsWbixa8pMvIBSZ/5LCFS1y7peLk5U0VrSXu44IwyCmWdwsMfslWbDbuKjVzcFdn3w3ay3KgXlhKuBJjmwUZLjmbGLUK7C/vD1yKJHKMK+iVbVfMq+Gf4zD0axBY1fQueGN7c4kwhzbDL9ZGQ09Lhp1Nz2H2Ud9gtAJK0B5aJWAI/EmTLalrzczEeWh5umiav8i5EHHQpfnQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=RG9VRrX54zmq5tzgSL5KgTqxGYFT+5kJRwPkBC3Tx+Q=;
 b=NW7cWyLgj+Wl9EOS/Ml6gIQFayRY8XL120Y/l0WheSTa/JmpcVHoAjn8B2UAQcGPgoLIPH834mWc150oDrkDeO7flmZDbNrj55HhDsZnFEqyaR5yfZQbiRTde1JvEeMh8cMYxJw6LaFuSN5yZpQssYTlppmwrrWlHcHxPdJe9rH/t/fe4uEhrj9DlMmdCPG+Xh6Nkg7G4BuYZfA4ccSHBMydvwRqX4mBRAhRs6h/B4DQUyup/HsI3O6XtzZmyy7OOcqaY05Z39q7ow8bt7RDM1GEimdh4W/2C7Sm8IiBreNwJSnXP9TyP5cu5ZdSYf1G8mfV46vgEJ/px6OqRXSmBg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RG9VRrX54zmq5tzgSL5KgTqxGYFT+5kJRwPkBC3Tx+Q=;
 b=hw3wO3H3UyczgFvxuX0f4LwB5suNQ4otBZaqUYmY44DF3FYRca0qvCzjLOSMLGbUXfHHkO8mCtSQGeoncugCa+wk3KGAPmsXyzDcaGPt15HaN47zXCVaBuFqqK4JqCW2wl0/7ljKeZBjO3JbKWih2WDpD9SkYZCB9n9ZK5DelIIBnHXVi2jMLtM390jUj0HJY9yPeSSn10DsDNREm84O1F4d0UJ7P2ApwXOgO26uhXU5IlOefjzGZtpHe7RxWEBtHwC5K0WLL7CPbDE1m73NMBVGPBCkb5V6m+oFSdDrQF02sge8tTw8hBLu1CoSnSIEFcfcqqpVL8NMx05Q9/kHZg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <c07a7651-b45a-a6f9-8dcd-f4237a51d2ca@suse.com>
Date: Wed, 26 Jul 2023 14:02:44 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH 0/4] xen: address violations of MISRA C:2012 Rule 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Jun Nakajima <jun.nakajima@intel.com>,
 Kevin Tian <kevin.tian@intel.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>, Paul Durrant <paul@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1690368810.git.simone.ballarin@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <cover.1690368810.git.simone.ballarin@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0137.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:96::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB8PR04MB6796:EE_
X-MS-Office365-Filtering-Correlation-Id: 30be8ee8-5d08-4bda-bc26-08db8dd0399f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	hB77DYbrAbW/N3j6U3Lr5NaMgVPP7zixI4tpPt51PzItUjnSC8vyuLHB/XuGbwk1H0Lsac1+g1xwqxczd5oFC3KMzSo1RI3EYYBxB7gAvZeotzsm55TJqJ8/As+bAf5XHMN25ghhdtwxgFFmJkmWYxrlP93c7J9getiPs6DvIYd+RhcltcAvUePQiPIrtacMB3FDHfG+eQfp6ko+bkaNXnQV0jb2yQiWnJuahiuN9O0o6vzLmdk7kfOfF4enroRwPYfQ5wJMaH/ccWL+EM6DEt9SZq/GVg42mymL8SoHScKPTslVUIQYpQMchwhHVNS29X+RZZ2ySctSTWKjXb675/5Hrd0dSPcMFcGJ574FT6oO3X9e1u/pnROhrL3pdvABQGSSY2LSPtTIomvL+Za1wbgJEIYh9pMGA6myh0G3TlR2Az2NPrEBwt9GCpr26QgTBwqo8pjwkWO6oThExi9eVVZZ2yvfuwcwOdSgksYKpw5epR/VfwuROtjdGUSZx8GakutjewzoB+tkh5NLSSLV6gWUULwwsbrEjjOWu2fgdMRCYTg9SFG8AzyzzVNfpEpsPiq38X6Sw05wPohyKbJiQ16gEN7Fidy+Th8XUDPg5Pqb2TzYbGGLwdQNeMnRHNSFt0PbXB3RmQ3Hj8zpg6mX+w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(396003)(39860400002)(376002)(366004)(346002)(451199021)(31686004)(6512007)(6486002)(54906003)(478600001)(83380400001)(36756003)(86362001)(31696002)(2906002)(66556008)(2616005)(66476007)(53546011)(186003)(6506007)(26005)(38100700002)(66946007)(6916009)(316002)(4326008)(41300700001)(8936002)(8676002)(7416002)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-M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QmoyQVFYS3o4azRRNVVpamxyeENPNTVEd0prNzV4WmJaVlFtWjZ4?=
 =?utf-8?B?NndVZXlVdGhIdThleVFOTXJxYnhJUXA0UFNNYXlNUGZEK3ZMWi96RmZSQTRn?=
 =?utf-8?B?K3lCditleFNSMnRGYmpnV2dZQ3lHV3lBVWZJV3M0MG5RVXoxM280SkEvTURM?=
 =?utf-8?B?em1scUgxN1U2d28vTzRGeTFVYk10VmVMZnRmeDVHc2s0VExMdCtDY3ZKdTlQ?=
 =?utf-8?B?ZUk3VGcwMXNVcE5wKy9LczVzN0grVUpJVkJhME9OQVZFazVKQmY1M3Q0czBw?=
 =?utf-8?B?emZmdlFTMXRDUVhnOUhYMjlqWXl2ZDhuczc3UXZJM1F6QlBvajR1MmRxRG9m?=
 =?utf-8?B?c0VzNDBQYlhLeEdpcVNrbVA0ek9FaVdlWCtzYmZRTllqWmYzeWhDK2Y4Z0JG?=
 =?utf-8?Q?SeW7iCHof4E7qUypZjqBtsw+N?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 30be8ee8-5d08-4bda-bc26-08db8dd0399f
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 12:02:46.3827
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: mb981W9QqnGUZSp9KAodOy2ppnvl+kgwnIRiD0F95FTxVGxYDOYeMTUfyw8kzLt6AF+e7SiznGMrNq2UxDv7AQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6796

On 26.07.2023 13:03, Simone Ballarin wrote:
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose headline
> states:
> "A 'u' or 'U' suffix shall be applied to all integer constants that are
> represented in an unsigned type".
> 
> These violations are caused by the missing "u" or "U" suffix in unsigned
> integer constants, such as:
> 
> xen/arch/x86/hvm/hypercall.c:132.17-132.26
> if ( (eax & 0x80000000) && is_viridian_domain(currd) )
> 
> If a rule is not met, changes are needed in order to achieve compliance.
> The patches in this series achieve compliance for MISRA C:2012 Rule 7.2 by
> adding the 'U' suffix to integers literals with unsigned type and also to other
> literals used in the same contexts or near violations, when their positive
> nature is immediately clear. The latter changes are done for the sake of
> uniformity.
> 
> Gianluca Luparini (4):
>   x86/vmx: address violations of MISRA C:2012 Rule 7.2
>   xen/vpci: address violations of MISRA C:2012 Rule 7.2
>   x86/viridian: address violations of MISRA C:2012 Rule 7.2
>   xen/x86: address violations of MISRA C:2012 Rule 7.2

Looks like this is v4 of a previously larger series, where fair parts have
gone in already?

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 12:34:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 12:34:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570438.892197 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOdiH-000678-26; Wed, 26 Jul 2023 12:33:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570438.892197; Wed, 26 Jul 2023 12:33:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOdiG-000671-VL; Wed, 26 Jul 2023 12:33:56 +0000
Received: by outflank-mailman (input) for mailman id 570438;
 Wed, 26 Jul 2023 12:33:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=j0A2=DM=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qOdiF-00066v-38
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 12:33:55 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ae69d944-2bb0-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 14:33:53 +0200 (CEST)
Received: from mail-ua1-f45.google.com (mail-ua1-f45.google.com
 [209.85.222.45])
 by support.bugseng.com (Postfix) with ESMTPSA id 550234EE073A
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 14:33:53 +0200 (CEST)
Received: by mail-ua1-f45.google.com with SMTP id
 a1e0cc1a2514c-79a2216a22fso1077706241.0
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 05:33:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ae69d944-2bb0-11ee-b242-6b7b168915f2
X-Gm-Message-State: ABy/qLZJ1JB6AAMO5nWRlC9N2kDazTCh/6hxQysRsVyck7TnqjRSXIcD
	6ThyuiNqsUW5/TZBy/jh5a4O3nd7BVebGf8rv7I=
X-Google-Smtp-Source: APBJJlGSZWIKhDOn+TsWOWaK9kwYqJ02IbVDNFMfPhMxLre5SFORL/00K+TajtUIwGu9aIE4PLYjvq0PExO34gSPLnA=
X-Received: by 2002:a67:fd45:0:b0:443:92dc:51ce with SMTP id
 g5-20020a67fd45000000b0044392dc51cemr1023509vsr.35.1690374832106; Wed, 26 Jul
 2023 05:33:52 -0700 (PDT)
MIME-Version: 1.0
References: <cover.1690368810.git.simone.ballarin@bugseng.com> <c07a7651-b45a-a6f9-8dcd-f4237a51d2ca@suse.com>
In-Reply-To: <c07a7651-b45a-a6f9-8dcd-f4237a51d2ca@suse.com>
From: Simone Ballarin <simone.ballarin@bugseng.com>
Date: Wed, 26 Jul 2023 14:33:40 +0200
X-Gmail-Original-Message-ID: <CAFHJcJu5=Jtyzuz57WW=T7h4cV8Svo-Nv4s7q19iLPAzdsBX5Q@mail.gmail.com>
Message-ID: <CAFHJcJu5=Jtyzuz57WW=T7h4cV8Svo-Nv4s7q19iLPAzdsBX5Q@mail.gmail.com>
Subject: Re: [XEN PATCH 0/4] xen: address violations of MISRA C:2012 Rule 7.2
To: Jan Beulich <jbeulich@suse.com>
Cc: consulting@bugseng.com, Jun Nakajima <jun.nakajima@intel.com>, 
	Kevin Tian <kevin.tian@intel.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, Wei Liu <wl@xen.org>, 
	Paul Durrant <paul@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="00000000000067bc3e0601630f8c"

--00000000000067bc3e0601630f8c
Content-Type: text/plain; charset="UTF-8"

Il giorno mer 26 lug 2023 alle ore 14:02 Jan Beulich <jbeulich@suse.com> ha
scritto:

> On 26.07.2023 13:03, Simone Ballarin wrote:
> > The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline
> > states:
> > "A 'u' or 'U' suffix shall be applied to all integer constants that are
> > represented in an unsigned type".
> >
> > These violations are caused by the missing "u" or "U" suffix in unsigned
> > integer constants, such as:
> >
> > xen/arch/x86/hvm/hypercall.c:132.17-132.26
> > if ( (eax & 0x80000000) && is_viridian_domain(currd) )
> >
> > If a rule is not met, changes are needed in order to achieve compliance.
> > The patches in this series achieve compliance for MISRA C:2012 Rule 7.2
> by
> > adding the 'U' suffix to integers literals with unsigned type and also
> to other
> > literals used in the same contexts or near violations, when their
> positive
> > nature is immediately clear. The latter changes are done for the sake of
> > uniformity.
> >
> > Gianluca Luparini (4):
> >   x86/vmx: address violations of MISRA C:2012 Rule 7.2
> >   xen/vpci: address violations of MISRA C:2012 Rule 7.2
> >   x86/viridian: address violations of MISRA C:2012 Rule 7.2
> >   xen/x86: address violations of MISRA C:2012 Rule 7.2
>
> Looks like this is v4 of a previously larger series, where fair parts have
> gone in already?
>
> Jan
>

Yes, it is. I accidentally removed the v4 from the object.
In this submission, I've dropped the commits that have
been already merged.

-- 
Simone Ballarin, M.Sc.

Field Application Engineer, BUGSENG (https://bugseng.com
<http://bugseng.com>)

--00000000000067bc3e0601630f8c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">Il giorno mer 26 lug 2023 alle ore 14=
:02 Jan Beulich &lt;<a href=3D"mailto:jbeulich@suse.com">jbeulich@suse.com<=
/a>&gt; ha scritto:<br></div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1=
ex">On 26.07.2023 13:03, Simone Ballarin wrote:<br>
&gt; The xen sources contains violations of MISRA C:2012 Rule 7.2 whose hea=
dline<br>
&gt; states:<br>
&gt; &quot;A &#39;u&#39; or &#39;U&#39; suffix shall be applied to all inte=
ger constants that are<br>
&gt; represented in an unsigned type&quot;.<br>
&gt; <br>
&gt; These violations are caused by the missing &quot;u&quot; or &quot;U&qu=
ot; suffix in unsigned<br>
&gt; integer constants, such as:<br>
&gt; <br>
&gt; xen/arch/x86/hvm/hypercall.c:132.17-132.26<br>
&gt; if ( (eax &amp; 0x80000000) &amp;&amp; is_viridian_domain(currd) )<br>
&gt; <br>
&gt; If a rule is not met, changes are needed in order to achieve complianc=
e.<br>
&gt; The patches in this series achieve compliance for MISRA C:2012 Rule 7.=
2 by<br>
&gt; adding the &#39;U&#39; suffix to integers literals with unsigned type =
and also to other<br>
&gt; literals used in the same contexts or near violations, when their posi=
tive<br>
&gt; nature is immediately clear. The latter changes are done for the sake =
of<br>
&gt; uniformity.<br>
&gt; <br>
&gt; Gianluca Luparini (4):<br>
&gt;=C2=A0 =C2=A0x86/vmx: address violations of MISRA C:2012 Rule 7.2<br>
&gt;=C2=A0 =C2=A0xen/vpci: address violations of MISRA C:2012 Rule 7.2<br>
&gt;=C2=A0 =C2=A0x86/viridian: address violations of MISRA C:2012 Rule 7.2<=
br>
&gt;=C2=A0 =C2=A0xen/x86: address violations of MISRA C:2012 Rule 7.2<br>
<br>
Looks like this is v4 of a previously larger series, where fair parts have<=
br>
gone in already?<br>
<br>
Jan<br>
</blockquote></div><br clear=3D"all"><div>Yes, it is. I accidentally remove=
d the v4 from the object.</div><div>In this submission, I&#39;ve dropped th=
e commits that have</div><div>been already merged.</div><br><span class=3D"=
gmail_signature_prefix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signa=
ture"><div dir=3D"ltr">Simone Ballarin, M.Sc.<br><br><div>Field Application=
 Engineer, BUGSENG (<a href=3D"http://bugseng.com" target=3D"_blank">https:=
//bugseng.com</a>)</div></div></div></div>

--00000000000067bc3e0601630f8c--


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 12:36:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 12:36:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570445.892207 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOdkg-0006gd-E7; Wed, 26 Jul 2023 12:36:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570445.892207; Wed, 26 Jul 2023 12:36:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOdkg-0006gW-BT; Wed, 26 Jul 2023 12:36:26 +0000
Received: by outflank-mailman (input) for mailman id 570445;
 Wed, 26 Jul 2023 12:36:25 +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 <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOdkf-0006gQ-Af
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 12:36:25 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on2062f.outbound.protection.outlook.com
 [2a01:111:f400:7d00::62f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 06f1f1f8-2bb1-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 14:36:22 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU2PR04MB8855.eurprd04.prod.outlook.com (2603:10a6:10:2e2::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 12:36:20 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 12:36:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 06f1f1f8-2bb1-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Q0RDJiCHeHwYJwDa0mVciueyIzL4LEYfcOFUgCXt4iwYA4sTVj7RAU9fmAqLxhpAEf1nIpIfdxM3k9Fh63iHgRfLVgbi7MxuL+Mm/s1gimlGOYrZCDq0TLHxHZ5dBJFw7XGA0ofYvO96fc75MaPLLMWUZo6VpfY2I/Y+l/izD8s5XiBODIgUs5gArYg1UF6Z8kDlzkBiQlegWstipwSLubBkRPHBM1G8F0+jS4v+VoekKTbygdxSOWNfow2yPzphgFt8TrCazaV86GSk8q6/woS32ehlOWJ/aUDxbno+bLQHpQwRQQts88OewZY++sTpNYavj9a9a4+nqKBt55Beog==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Odh/OGpsVFDuLFtbWW/1+v106jR6zhabbrs75Pm7Xn4=;
 b=OxK5a+wCKhXYRcjiosFo6vt7udX6RrH8x8iBQ69iJ8dmzQoh940SNZb+pfWJmT7jHZZHhnl8sql1OAG6kj8PpNuDUcpBnakpIuKNgUDb4F5vJSlm53U/UE2os/LT4P2y8PoVEElNOiSE7SeBEKnKMEDhy7oAKzfLodMNwT6NJoIO3444Ka7MlMRg8TParNJtAOOeRjOUkg7iP7B2ny6Zks66YksppTJv9BLQkSc7bu8KuQIkthIAKqSdnTw1vRshOi31/AgeHwhj6fT1wsRPkBvFH6fUR4VS1ecfD2LFbwtXUqkPCNa2UHNWJCCIDLpERT5p0EWUfRTew+0wqQwRig==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Odh/OGpsVFDuLFtbWW/1+v106jR6zhabbrs75Pm7Xn4=;
 b=Lmg1pslkLuXAiyB34O7j5zXzaBhD2CKtZP2FbKpQgZ/H1sTOZUhjHkO1Whamswwt8HjmiIh2YD2rayDyxr+mzY6PuIKWLogxMvRG4cp3E7H4SnXzDZW+ZrxniSit7doG1Eq9vSUZW+XWtzEalUsLLr3xsgQDpal/ZFgLDs741gQ06vEqovlPPlrUHDPqZDzf+TV5zqS8qKY2xGnuKQrHmNiMIJ40f560YZbsozrSIoxeKcAUlF4uarCWH9KflZ5YclFPc7W8ReoHt9vGveLbULfUszhOdYeNl5rIIz4iT5uqruco+ggYMHl+oQCwXWdApkF0meLZLFaqYZ9Yble3HA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <5292942c-17b4-6b7b-a1a9-fdec87418379@suse.com>
Date: Wed, 26 Jul 2023 14:36:17 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] vpci: add permission checks to map_range()
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <20230724153741.42374-1-roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230724153741.42374-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0037.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:48::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU2PR04MB8855:EE_
X-MS-Office365-Filtering-Correlation-Id: 379631f7-719e-4fe5-3a7b-08db8dd4e9f7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	IsGWj/bJ8Zs5dpOQFU1Ns6P+s46LUqZnMdAqzhi+EU6Pr0zFwQd3ZDZ+aLVOd+Wtw5IZR3wqApyCdFDlLagneT/5TnErGyoKagZq6u8sXp1nxWynKFXf1XlHVt1qcTEOZGgSMUGSKkPUQFHc/sG7ee5gEBmowTlBFgPo7NQTpMC/avOXeex5DDPH/aAl1djgm7OIx64RNZy+e7INrMQKMQLX/ORviYrj5AVa80Ey/y+BOwpUb1igr91XTguT6GfCIOT7GYMBuHibA/A9kLN7VHnfXSJ+LqFNJ2ctwVToOSzX/6ae8xCjPMVEjv8c+eSbh/cso3n0O+EqWJZj/OQRqotdt8/rmJYsS+gCGYLIkFUxOXkyiYO1vXlCoyDAS6VW9m/LuwjATxzZ8xe5xrGA0sPgnBDRrZe3b2ugOrOhEQUU2mo2+vCuDY1jcO6i+RU0o5RS+5eA6va88RjK38tCuZwg2ZpoSPRQdOLHkZCgQgTSvYBD/tadAOtmNZ55vDydOTBM2ueBX9/YTJwB5VAdFF5XURCFLKcSE9WMsM5eOZCrEY5YsG72VJsY0m2UAAh8wsT0d5Srd4gtKYAiPVqgBUVIMRKfkYI4nIheALt6FrJyA6hyiVMxUpQm65DqEoxNJPbVI1tA9FIT/ddlAJZneA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(366004)(136003)(396003)(376002)(451199021)(86362001)(6512007)(6486002)(6666004)(38100700002)(186003)(83380400001)(36756003)(2616005)(31696002)(6506007)(26005)(53546011)(66556008)(6916009)(66476007)(4326008)(66946007)(2906002)(316002)(5660300002)(41300700001)(8676002)(31686004)(8936002)(478600001)(54906003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WmsxUnJ4WXBlbFB3ZisyU3FzTEFoS21GVk9jblFyZDlidzZqUVVKZVNFbTMz?=
 =?utf-8?B?ZElDV3o2MUUzSS9wWU5oM29oMEF5QWZqTWRkaFdHR3VXc2hvZ3hOaDN1L2kz?=
 =?utf-8?B?VzlaclhuSThSYjlKN0tucnYwelM3cTNDajNOTDVNelU0dDhrczV2d2FEeVBG?=
 =?utf-8?B?UW5hWTZoOHFDQTcwY2I2by9Pa2g0Y2dHOFJTL2RzTE5Rdzd6aXo0TTgzdW1I?=
 =?utf-8?B?b3pvRzRDam5ZK3ZHREZ2K2NlbGJCUWZUVjhGVnRsZ1FsQVY2RVBYQXZPNkJq?=
 =?utf-8?B?UXBYZERvZUdNOGdFR2s2RWJiUEFrZURPRElwTGxZODQ5elQxNDBXbkI0VDdK?=
 =?utf-8?B?TXBMWUx2TXBmVXQ3NFRpaFphKzNkT3ovVHpGWXdpaE1qaGtzM0d3WmIvLzg2?=
 =?utf-8?B?clJVTXBlLzFpTzlqOU11RWJoTnY0YzVYYmhuNHE2Yy9MO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3a7b-08db8dd4e9f7
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 12:36:20.2430
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: NX+71NretOGB5oShJoeoP82h82ocfAs1eJXO+X7Vdh1VfFM78JfqG4EmK1m0Selsbj3PzsfaASV0Ij0t4IODnQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8855

On 24.07.2023 17:37, Roger Pau Monne wrote:
> @@ -1184,6 +1177,20 @@ int __init dom0_construct_pvh(struct domain *d, const module_t *image,
>  
>      printk(XENLOG_INFO "*** Building a PVH Dom%d ***\n", d->domain_id);
>  
> +    if ( is_hardware_domain(d) )
> +    {
> +        /*
> +         * Setup permissions early so that calls to add MMIO regions to the
> +         * p2m as part of vPCI setup don't fail due to permission checks.
> +         */
> +        rc = dom0_setup_permissions(d);
> +        if ( rc )
> +        {
> +            printk("%pd unable to setup permissions: %d\n", d, rc);

The switch from panic() to printk() may want mentioning in the description
as deliberate. (The usefulness of %pd here is debatable, as it can't be
other than Dom0. But I don't mind.)

> @@ -43,6 +46,21 @@ static int cf_check map_range(
>      {
>          unsigned long size = e - s + 1;
>  
> +        if ( !iomem_access_permitted(map->d, s, e) )
> +        {
> +            gprintk(XENLOG_WARNING,
> +                    "%pd denied access to MMIO range [%#lx, %#lx]\n", s, e);

This doesn't look like it would compile. Also gprintk() logs current,
which I'm not sure is generally applicable here. IOW I think it wants
to be

            printk(XENLOG_G_WARNING,
                   "%pd denied access to MMIO range [%#lx, %#lx]\n",
                   map->d, s, e);

Same for the other log message then.

Another Dom0 related concern can probably be put off until we actually
get a report of this failing (which may be more likely because of the
XSM check below): The function being used as a callback passed to
rangeset_consume_ranges(), failure may affect just a single BAR, while
the incoming range may cover multiple of them in one go. Depending on
what functionality such a BAR covers, the device may remain usable (a
typical example of what I'm thinking of is a multi-function device
having serial and/or parallel port on it, which are fine to be driven
via I/O ports even if driving via MMIO is possible [and would likely
be more efficient]). Of course, to allow some MMIO bars to be used
while prohibiting use of some others, further trickery may be needed.
But not exposing the device to Dom0 at all doesn't seem very nice in
such a case.

Jan

> +            return -EPERM;
> +        }
> +
> +        rc = xsm_iomem_mapping(XSM_HOOK, map->d, s, e, map->map);
> +        if ( rc )
> +        {
> +            gprintk(XENLOG_WARNING,
> +                    "%pd XSM denied access to MMIO range [%#lx, %#lx]\n", s, e);
> +            return rc;
> +        }
> +
>          /*
>           * ARM TODOs:
>           * - On ARM whether the memory is prefetchable or not should be passed



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 12:55:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 12:55:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570451.892218 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOe3A-0001Ci-21; Wed, 26 Jul 2023 12:55:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570451.892218; Wed, 26 Jul 2023 12:55:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOe39-0001Cb-VS; Wed, 26 Jul 2023 12:55:31 +0000
Received: by outflank-mailman (input) for mailman id 570451;
 Wed, 26 Jul 2023 12:55:31 +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
 <SRS0=CD/9=DM=citrix.com=prvs=564dce665=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOe39-0001CQ-6L
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 12:55:31 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b0912e93-2bb3-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 14:55:27 +0200 (CEST)
Received: from mail-bn8nam11lp2169.outbound.protection.outlook.com (HELO
 NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.169])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 26 Jul 2023 08:55:21 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by BN8PR03MB4964.namprd03.prod.outlook.com (2603:10b6:408:7d::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 12:55:19 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023
 12:55:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b0912e93-2bb3-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690376128;
  h=from:to:cc:subject:date:message-id:
   content-transfer-encoding:mime-version;
  bh=vgqRWK8tfo9aj9a9p03VkjdiV16dejpwJLjBoq41gu8=;
  b=V6zjRx8xeg12up/aOoWOgkOqeRF7tkHNv2hDKDyY6ImFu5OLDd3KFL8A
   yBsBfQaysFNw/fu3U7fYuH3WcSsJRalhiO4/MzaEEBUimos1vlNCVeA86
   qo/mrTu55nP8wT+EAhTqhvOM0GvqKwW/YBUWf+HxQAVBhnwE8x4LqXAlR
   c=;
X-IronPort-RemoteIP: 104.47.58.169
X-IronPort-MID: 120127588
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:NuKOsqzm9QTAwKTDWOF6t+f1xyrEfRIJ4+MujC+fZmUNrF6WrkUOm
 mYdXDyObPvZNGP1edp+aN+z80MO7Z/WyN8wTQVq+SAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhP64T5TcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KX4W3
 +A1BxQNVSGaiOOZway5V/Rvqf12eaEHPKtH0p1h5RfwKK9/BLrlE+DN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjiVlVIguFTuGIO9ltiiX8Jak1zev
 mvb12/4HgsbJJqUzj/tHneE37WXxHmkBdJCfFG+3vw6kUOc3kcfMT4TSgWEitTgpkznZesKf
 iT4/QJr98De7neDXtT7GhG1vnOAlhodQMZLVf037hmXzajZ6BrfAXILJhZDYtE7sM49RRQxy
 0SE2djuAFRHr7m9WX+bsLCOoluaOiULLGlEeS4NSyME5cXupMc4iRenZs5qDaqdntDzXzbqz
 Fi3QDMWgrwSiYsB0fW99FWe2ja0/MGXH0gy+xndWX+j4kVhfom5aoe06F/dq/FdMIKeSVrHt
 38B8ySD0N0z4Vi2vHTlaI0w8HuBvJ5p7BW0bYZTIqQc
IronPort-HdrOrdr: A9a23:EshOta5Vcb4Ca1RpagPXwOTXdLJyesId70hD6qkoc20wTiSZ//
 rDoB1p726StN9xYgBapTnuAsm9qB/nn6KdpLNhWItKPzOWwldATrsSjrcKqgeIc0bDH6xmpM
 VdmsNFZ+EYeGIasS+M2meF+rgbreVvu5rY49s2h00dND2CRZsQlztENg==
X-Talos-CUID: 9a23:Mt9VOm58YZD4pPTJ4Nss6xY+Bu0KVn3m/W7fImC5F2R0Vb66cArF
X-Talos-MUID: =?us-ascii?q?9a23=3AnEp/xQzAiep/pW8pjoOGXievCemaqKb+GV4Cib4?=
 =?us-ascii?q?KguqBKnJPEBrEoDbufLZyfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,232,1684814400"; 
   d="scan'208";a="120127588"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ekE9ZPfTSMGRoqn9tpy3J1VtC886DfN/ZiIXIClea0wc6ERZHC8bZ1/JAZttTCUSI+Ob3epaIDzJWUMhF/V93MjQO5hAny8VD3RwUKohkLn7QjY9l49f4gjOPTOjOyNCejdMIA1k/A0gL22Cuoh7WqP40wZKdAkTNqJSWsD73mM8IlsRbChHrnsZkka816BKItE4ebtlYi7x+EmlWOLxn4EVjwQD5GkPsNZKOK1en1sRC9p0v8wnOxpRtstXQHkIz1zmjRv2Gf9dMaVHpOd73dGkSCgEYx5twW665O7Q3T4P5YboSOu8douMHR19tLt5Elbl9nqVI0KE+MgZTd708Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=941+6Z5AEQVFDdrwbl2Gn52ILruhhjASKWT6E8DQ61Q=;
 b=b/KDyKUcl8gG7ODXTw8Z+RuPDLgUGsfMWiZtijC/3Aqaw01WitSVR0XEwX0oCCfUCTqXuMNNFCN8zkJTZsxxUrxbtxIHq8kmeG6JydZ7Td84Y0FwGKKZLABEUqruMRIESu085j9Snb/c17OlCIZ5SEvRWbSf307g2amH3fgbhFmazYLI34TJzus2efyPuajfPwq24Ht0ufV2SOf8ZaHEELi42APWgkZEFzQ5Yi5GZPnDjptyU9rpQcAmYKCD1bNke8xXIVBF1Vfb2VyeOE7ZYKPPJjdhVFuNGN5L+DPSH9KRKsZO/saFp80hVFWhqgfLj3UjjaakryCM4f51H7Omcg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=941+6Z5AEQVFDdrwbl2Gn52ILruhhjASKWT6E8DQ61Q=;
 b=gGPDcTaU5IWKDW9FTeGSntrJTjYPuc2EyZYxNf3Urf7YIzB9zisDlzQGuKXF8aQJjS6ldkVeHdVqqSpHSiZWy5JTg3l1slRtcII9CM28qyIgE0/Et5HRR6UJEcrOFTRcOJX78ptkAudR4SW8FmXFRXp7gCOghaOBMFrky3gcQQQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>,
	Kevin Tian <kevin.tian@intel.com>,
	Paul Durrant <paul@xen.org>
Subject: [PATCH v3 0/4] x86/ioapic: fix edge triggered interrupt migration
Date: Wed, 26 Jul 2023 14:55:04 +0200
Message-ID: <20230726125508.78704-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0368.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:18e::13) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|BN8PR03MB4964:EE_
X-MS-Office365-Filtering-Correlation-Id: b0cca426-8858-471a-4a51-08db8dd7907c
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	2dewUWWefGGV7TShxJOes85JiwfYurrcT56tA8lo+v5jvcmOKMD6ZGtBNEyFpv8MX2jIcfmaN4f3aO/SivOWZeLNIJcXcLPbVgeGVMjzyb7MCljU8g+QcYS4cO/lHDWwrjgY2cHeBkZJJ8tx9H2mJ4hZXGoOCu1UVSfUyuSvu4yQDhMInYHbCERTdwcyUEJeRyoJAEaTwoTYZ4khL1mXECB+XrPM1xOB0CMWBlBoR3hOedOt4vZpFSXz0A3ghBwisSfV0jEx2v63bMDacxXCTfQoh3LGOUeTBgROx63mq0RfONWyFl0Rslsl8u/bWcOPs95402/e4+znf/24RLg0orpjM9O9dLNpbo2Om/SP7Zn5XPhHYcygnAz5+AsEJvJVK3JdmR2Pu0W/xImhc1TqUw+k7FDJTFUP9rgfCdR0xOVYjSrU4St85Msrbn6XWW7AmZKp7rPhLpFG+N7IvSQOsL9TePmBrE7G7tbdKTnPvJWNnmJdIBqyynZSJd2kd0kHo2P3p9C3PzvcuNqIqOgKlAjRQbTnRTAK1JP0qZThbIEKtIpBGjJUBhqYNnWW4oPa
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(136003)(396003)(346002)(366004)(451199021)(41300700001)(26005)(6506007)(478600001)(38100700002)(6512007)(86362001)(36756003)(6916009)(4326008)(8676002)(8936002)(186003)(316002)(66946007)(66476007)(66556008)(5660300002)(2906002)(2616005)(83380400001)(66899021)(54906003)(82960400001)(6486002)(1076003)(6666004);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VmtjU3ViSGlpYWpFMjJtaXNWRllUeDlEcy9yWExpQ2VneWx5TFF6S0ZkUVpn?=
 =?utf-8?B?S2VzVnBzNHJ4YjJsN0hnMzB6M1NDbkFPLzdJQ2VKTUZjRlRqbUY3ZGxBY1Ev?=
 =?utf-8?B?RzZnNVNidnVCWHY5S1BPWXE2NUdIQWdGdFNDQjVrZmZjWjNncEN3K2Z4cU12?=
 =?utf-8?B?ZmFTZTVoWHRtaEpsZE1wMzJacXpFckVqaitRNVgzcGp4UkFlcUlMZDRLOUNq?=
 =?utf-8?B?U3hwVmthaXNDTU1PNnJ1Uk9qbHpsZEs3eFZYNEErUkla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SY6tLByu7JNJcyLchAMtsi4PBiM+dAhStYBf8lIFx/TN0Qwqppc6qHGSxVSX07FSJEg5reRnPjAhIHohEBPz7b42VFpIcK0lZj4=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b0cca426-8858-471a-4a51-08db8dd7907c
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 12:55:18.7542
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: EPG3siw1JzIGY74DcHeovQ6niTGjN9ydVeZ4voGRJUywCuyb/SJfZwahxwsR8rvNiI2Vhgejg/yjdsuOVCESWQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR03MB4964

Hello,

Following series attempts to solve the issue with IO-APIC edge triggered
interrupts seeing an inconsistent IRTE when injected while being
migrated.

It's been simplified a bit from the original RFC, and does make the
logic in the IOMMU RTE update handlers cleaner, as those get passed the
full RTE.

When not using interrupt remapping the logic is left as-is.  One further
change would be to mask edge triggered interrupts, as destination and
vector cannot be changed atomically when dealing with plain IO-APIC
RTEs.

The previously final patch to switch AMD IOMMU to use atomic RTE updates
has been drop pending feedback from AMD on whether that approach is
suitable.

Thanks, Roger.

Roger Pau Monne (4):
  x86/ioapic: add a raw field to RTE struct
  x86/ioapic: RTE modifications must use ioapic_write_entry
  iommu/vtd: rename io_apic_read_remap_rte() local variable
  x86/iommu: pass full IO-APIC RTE for remapping table update

 xen/arch/x86/include/asm/io_apic.h       |  65 ++++++-----
 xen/arch/x86/include/asm/iommu.h         |   3 +-
 xen/arch/x86/io_apic.c                   |  46 ++++----
 xen/drivers/passthrough/amd/iommu.h      |   2 +-
 xen/drivers/passthrough/amd/iommu_intr.c | 106 ++---------------
 xen/drivers/passthrough/vtd/extern.h     |   2 +-
 xen/drivers/passthrough/vtd/intremap.c   | 140 +++++++++++------------
 xen/drivers/passthrough/x86/iommu.c      |   4 +-
 xen/include/xen/iommu.h                  |   3 +-
 9 files changed, 142 insertions(+), 229 deletions(-)

-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 12:55:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 12:55:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570452.892228 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOe3C-0001RV-Bf; Wed, 26 Jul 2023 12:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570452.892228; Wed, 26 Jul 2023 12:55:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOe3C-0001RO-7O; Wed, 26 Jul 2023 12:55:34 +0000
Received: by outflank-mailman (input) for mailman id 570452;
 Wed, 26 Jul 2023 12:55:33 +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
 <SRS0=CD/9=DM=citrix.com=prvs=564dce665=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOe3B-0001CQ-3h
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 12:55:33 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b36a6c9f-2bb3-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 14:55:30 +0200 (CEST)
Received: from mail-bn8nam11lp2169.outbound.protection.outlook.com (HELO
 NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.169])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 26 Jul 2023 08:55:26 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by BN8PR03MB4964.namprd03.prod.outlook.com (2603:10b6:408:7d::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 12:55:25 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023
 12:55:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b36a6c9f-2bb3-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690376131;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=bMzgoEGHShhbiGsSDEpVwuBzCaDU2yGfCvh44S0Z3qQ=;
  b=Erf8FKv2YH6y1qP+A928acrHb2AMSL7AL8KPp5IVHuK9+jCQqjbGU83g
   FsS6uU/kqpDzXMCeS3v927UvYolVgkxPGhyEinFJSGXuo7CSgAydmVglU
   Ib4l5qGeazbSD06dlWTeTvqwZNtvf6SgXTXxEb8nsjBLiytZ3KdWOch8j
   c=;
X-IronPort-RemoteIP: 104.47.58.169
X-IronPort-MID: 120127620
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:veLOHKAxjqi+VhVW/xXiw5YqxClBgxIJ4kV8jS/XYbTApG8i1z1Tz
 mIaDGGEPK6NMDSjet4kad+xpxkC757RzIc2QQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h
 yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs
 t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GxC4ARnDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS
 uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada
 jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIw3ecwK0EX2
 84idhctXxmypum75++VVbw57igjBJGD0II3nFhFlGicJ9B2BJfJTuPN+MNS2yo2ioZWB/HCa
 sEFaD1pKhPdfxlIPVRRA5U79AuqriCnL3sE9xTI9exuvTm7IA9ZidABNPLPfdOHX4NNl1uwr
 WPa5WXpRBodMbRzzBLcqCr13LCRx3uTtIQ6PpGj2/Izu3Cvm3ESDRcaFkS/+uKIoxvrMz5YA
 wlOksY0loAi+UruQtTjUhmQpH+fogVaS9dWC/c96gyG1uzT+QnxLmoOQyNFadcmnNQrXjFs3
 ViM9/v2ARR/vbvTTmiSnp+XoC2zP24JLGYETS4CUQYBpdLkpekOYgnnS99iFOu/iI3zEDSpm
 jSS9nFg1vMUkNIB0Li98RbfmTWwq5PVTwkzoALKQmai6QA/b4mgD2C11WXmAT97BN7xZjG8U
 LIswaByMMhm4UmxqRGw
IronPort-HdrOrdr: A9a23:h5Kqoq6NGMH8xBKXzwPXwAzXdLJyesId70hD6qkQc3Fom62j5q
 WTdZEgvyMc5wx/ZJhNo7690cq7MBHhHPxOgbX5VI3KNGXbUQOTR72KhrGSoAEIdReeygZcv5
 0QCZSXCrfLfCVHZRCR2njFLz4iquP3j5xBnY3lvhNQpZkBUdAZ0+9+YDzrdXFedU19KrcSMo
 GT3cZDryrIQwVtUizqbkN1OdQqvrfw5evbXSI=
X-Talos-CUID: =?us-ascii?q?9a23=3A/6twHWlOkxUsGjE1gFpYQBlolIzXOVrci13wemG?=
 =?us-ascii?q?KMzhOaIyceH6b9YQ5vdU7zg=3D=3D?=
X-Talos-MUID: =?us-ascii?q?9a23=3AgYWqrgzLeAtcmp1AY4YwAZgyrt2aqI6CE20ByK4?=
 =?us-ascii?q?rh5SZNCl6N3SCiG+sc6Zyfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,232,1684814400"; 
   d="scan'208";a="120127620"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=VzBIK6YZDTIP5DWTjpYUuszDOxjnRx4ppz1IBHpVFhBJIH5zcKji9OL0Lis3D+add8m+HJ1qENAaNV8777oId2yQeIhaMQcImCCzX4yjvRMHXgk26Km5U7eSco/WyX3NT4wLJyjEn0j92Eey9veZUmVkgXTw2xajOvLi/qnCfE9TB+KYhB7pxuwqHy839a7kwqIjrQzKR2wd31hquM+hmAIcllmaKidKSFx24ig8CU82uOTXvehcYARRbLBusJpymXz9c+5C8JFqrD7jjp2TPxxmlwzdjymIONQZKaC5ZX3F93kj23KqXbMgMTnalKQLO/VImISY13Trtiyihpej7g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=N4+akuxj11Pm6MmCcIs2+XB2xj50RQ6f8LRImtxUdTY=;
 b=Cq7pMRXbRDnLGQjGdGxF5qZp1NvptzIuPSMJ4nU+7wUi4rZftCGGpRWVix0mj5sGB678WJM8a1PHC4h46an2v8R1/2T3cNK2Z3mcpqCeP74q9lawdUHfuxHz0uSTNsdBGZj5AkB+ItFcoUDvoCTg3L5IL0485MU9QNGG4wtCYfD5maNMq/n0efTCUkAwox3dpKpTnIC+xOirPCevPY2b2NVJOTPrgFYenRI08VkaD/sa2w8KUmtO3aQtbc8/uJLfGuNBCzBAx0G+hqz4vEk2gA759NDDcRXfWLiL7Arb19lke2S0uV87tUzyt22LdH+w4M4XxhYDU6GZVT1RxSiZeA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=N4+akuxj11Pm6MmCcIs2+XB2xj50RQ6f8LRImtxUdTY=;
 b=YGQEu1EDh64fe+NsBtzBeaUjv3G+bMX2yqk8DkuEgQySGycdNgZVUq482DA98IukQfN1G2q1/hk9RaU4naOFXrVpknt/MEs+bKLttDy/uMH2yYu+HGhD9f//8Mq/bKx3fMXhMdelzSM7lYWnC371qaQZON/+7/OzO27KCXJWagM=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>,
	Kevin Tian <kevin.tian@intel.com>
Subject: [PATCH v3 1/4] x86/ioapic: add a raw field to RTE struct
Date: Wed, 26 Jul 2023 14:55:05 +0200
Message-ID: <20230726125508.78704-2-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726125508.78704-1-roger.pau@citrix.com>
References: <20230726125508.78704-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P265CA0295.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:a5::19) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|BN8PR03MB4964:EE_
X-MS-Office365-Filtering-Correlation-Id: 9165da2f-8aec-4ed7-a238-08db8dd7942e
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	mEpAiIZsL1RG3FSHtj+lZIxpOIn3ANWHSxxAa2L+FqbRPkWXCEVFDahluBXgN7WnWWWGxtd2yALcOipdhEdrRiZdaiB+NNYMjQrdNTcVvg6AgygiTFSJHfpvAyfS8mrr5mGFJ9XGvYVavR+80ZI3DivAu7vENt7W8LpE81Xa9bPwPpTs5eckMUdmSF866T3K8KNehgqLUaG7Jl92BfwnKW8uGuAaUTUlrcY4bjJH+ZhLKw9wK89FJ/SnIeFrSR3mMl/GxLaLFUl4gDcYwWGU7ZoLPKxWmBkDC9WfE5mIl5JJrOPsDsXXE93OvLQzXL9Wp464Gp5g/2J1tx/qE/UTPWKhEDajFVYCm9lNiJ6ntHGwR8jmImeKl2McMMk5F1b3OGlBVUwzGt8a8uXdu5MYDXcLuY4kTuWqARTwywcKDjN2qtcqeTbOKY60spaTNcgumzCjAu9HALHfOsthCUCyYO3+41pJJr+DA3RQVdUfWaFZBtULbmAPcZ23VJeRauBL/KOkXs7hnmbXQQbvLYl5jXRbfq0W9C1K6jSdIilJFVX1NFWgS2zB6t9f5VYarVcy
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(136003)(396003)(346002)(366004)(451199021)(41300700001)(26005)(6506007)(478600001)(38100700002)(6512007)(86362001)(36756003)(6916009)(4326008)(8676002)(8936002)(186003)(316002)(66946007)(66476007)(66556008)(5660300002)(2906002)(2616005)(83380400001)(54906003)(82960400001)(6486002)(1076003)(6666004);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TGlPOWx6dktTVjdFb1Jtc0JXTTFReWNBMy8zRDRZanNoN1pwb1JMN0pZRFI2?=
 =?utf-8?B?QjBJUTNOOC9yT1JVU0NhTEQ0Y0dLc2xMbTFBUmJYWEdDNHFQaWliV05jN2lC?=
 =?utf-8?B?enNWRnBLZzh0azJpdTQ5QTl5QS8wcmZwWFV6em12K3lVYUhJYU1lc3pScE9u?=
 =?utf-8?B?eVo3Y1ByRXg1WUF0UE03Mm8xZUJ1c1dQU0VDK3dhTVRvdWpmTWNPbW1ZZU1H?=
 =?utf-8?B?QTBUaXplTlhuaU1KWVN4MEFUMHk3N0VQcXh6aWhpU2tXRzZva0tMUHJuS3VB?=
 =?utf-8?B?eEFkeUhpeU5xdkhldlBYcktQRDJBd2Roc3djVkFha1RobW9IcDZudGVFZDM4?=
 =?utf-8?B?OEpWdG5JOG42ZHNhZFJtM2EyR3lhRWZNK040Nk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ry8xU09iVHA5SmxoZDZUdGZiVHJTZUFVVzlaa0hQWndjcklZ?=
 =?utf-8?B?OVE9PQ==?=
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	gDprcMIUIgK/zonqQj5risU1zYm3BEKFrbaUM8JO7oN5QeGVmzWOUJUENFrnVEtgoQNkqOauCy/CmPiV9C+L2XosfzLpfQL/DwYikycygrDP4MXnrZjXfFDy9DuPrlOGGPh3MYerPiOpbBaeqd4eVmTTS0NhAAO1FJnJGXOeXRJX0D0mEbs8rZGpnQbZxqTqH+JGOuUpVASMGCaIXXE8KznaUH0nR/3Yok2eMgsqwBhz/or+4JnNjzLb+EiDrNxxfQjrluAuGWBk+Y/gx2+FixkMkURB9P8SuIE6kM0UmKPEndIMKPzV96jol0+i2u+E2Z8wOf6jButUtQFYeZa45o/c1aUyBbvR8lm4TrCqshS19wr/GlJZrf/k4klk4ZMx8XLkszDCIzslZCzb4USAdtjCwRIfHyTgQFL4UYQP10+0GCovTA4O8tykzpHhZz5ACGPEvxxLg+iJLm+4/jJ2vnUIAGaaumePS0AxalrdFIBc2eW48Sw/yEOHVanDXschxlItzymGSCnd81a0H64WeOlG+6yJvCjbOEOCSw2umb15T9h+BgzXkfIZJhw6jFRmKQYTzXId8v5lzPr9N9htPc/8CzqGGIv72s8vkqpHE7qqZlmoP7YcPh9ONwz+xhQjGPjlUTQtGAdSdEmSWHabfvESBTd3wg+Vseg+QPwXixFxrVapeno4EcarzLZJrfefdY63GRgFu82h27IU61I9ZY/ZlKoHeOkzTx5FR76PpB0p0hGtAGP6yaM6ucd6ZOpZupeAVCJugT/h7Bc4dGiWP8iyA0yVAR7h2bV/q0mxMTbXgfuL6Bb9e9taAmy7xPhWxxeQW7XfF1lP+8I7xTcXS7ml4E7NFBU+oEJeHDVeA7Y=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9165da2f-8aec-4ed7-a238-08db8dd7942e
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 12:55:24.9031
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ldUOxp+XZZwdSCW8jzQle3pSSvhZypuPoDfoFM6p+BvOJo2XU0M6gjK1XLraEUQKEk/X1prozUTonSz4cNUWNQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR03MB4964

Further changes will require access to the full RTE as a single value
in order to pass it to IOMMU interrupt remapping handlers.

No functional change intended.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes since v1:
 - Fix initializers.
---
Tested on gitlab CI, builds on all compilers used there.
---
 xen/arch/x86/include/asm/io_apic.h       | 57 +++++++++++++-----------
 xen/arch/x86/io_apic.c                   |  2 +-
 xen/drivers/passthrough/amd/iommu_intr.c |  4 +-
 xen/drivers/passthrough/vtd/intremap.c   |  4 +-
 4 files changed, 35 insertions(+), 32 deletions(-)

diff --git a/xen/arch/x86/include/asm/io_apic.h b/xen/arch/x86/include/asm/io_apic.h
index bd8cb95f46b1..4c4777b68a51 100644
--- a/xen/arch/x86/include/asm/io_apic.h
+++ b/xen/arch/x86/include/asm/io_apic.h
@@ -90,35 +90,38 @@ enum ioapic_irq_destination_types {
 };
 
 struct IO_APIC_route_entry {
-    unsigned int vector:8;
-    unsigned int delivery_mode:3; /*
-                                   * 000: FIXED
-                                   * 001: lowest prio
-                                   * 111: ExtINT
-                                   */
-    unsigned int dest_mode:1;     /* 0: physical, 1: logical */
-    unsigned int delivery_status:1;
-    unsigned int polarity:1;      /* 0: low, 1: high */
-    unsigned int irr:1;
-    unsigned int trigger:1;       /* 0: edge, 1: level */
-    unsigned int mask:1;          /* 0: enabled, 1: disabled */
-    unsigned int __reserved_2:15;
-
     union {
         struct {
-            unsigned int __reserved_1:24;
-            unsigned int physical_dest:4;
-            unsigned int __reserved_2:4;
-        } physical;
-
-        struct {
-            unsigned int __reserved_1:24;
-            unsigned int logical_dest:8;
-        } logical;
-
-        /* used when Interrupt Remapping with EIM is enabled */
-        unsigned int dest32;
-    } dest;
+            unsigned int vector:8;
+            unsigned int delivery_mode:3; /*
+                                           * 000: FIXED
+                                           * 001: lowest prio
+                                           * 111: ExtINT
+                                           */
+            unsigned int dest_mode:1;     /* 0: physical, 1: logical */
+            unsigned int delivery_status:1;
+            unsigned int polarity:1;      /* 0: low, 1: high */
+            unsigned int irr:1;
+            unsigned int trigger:1;       /* 0: edge, 1: level */
+            unsigned int mask:1;          /* 0: enabled, 1: disabled */
+            unsigned int __reserved_2:15;
+
+            union {
+                struct {
+                    unsigned int __reserved_1:24;
+                    unsigned int physical_dest:4;
+                    unsigned int __reserved_2:4;
+                } physical;
+
+                struct {
+                    unsigned int __reserved_1:24;
+                    unsigned int logical_dest:8;
+                } logical;
+                unsigned int dest32;
+            } dest;
+        };
+        uint64_t raw;
+    };
 };
 
 /*
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 25a08b1ea6c6..aada2ef96c62 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2360,7 +2360,7 @@ int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval)
 int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
 {
     int apic, pin, irq, ret, pirq;
-    struct IO_APIC_route_entry rte = { 0 };
+    struct IO_APIC_route_entry rte = { };
     unsigned long flags;
     struct irq_desc *desc;
 
diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index f4de09f43180..9e6be3be3515 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -352,8 +352,8 @@ static int update_intremap_entry_from_ioapic(
 void cf_check amd_iommu_ioapic_update_ire(
     unsigned int apic, unsigned int reg, unsigned int value)
 {
-    struct IO_APIC_route_entry old_rte = { 0 };
-    struct IO_APIC_route_entry new_rte = { 0 };
+    struct IO_APIC_route_entry old_rte = { };
+    struct IO_APIC_route_entry new_rte = { };
     unsigned int rte_lo = (reg & 1) ? reg - 1 : reg;
     unsigned int pin = (reg - 0x10) / 2;
     int seg, bdf, rc;
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index b39bc832821a..786388b4d9c7 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -419,7 +419,7 @@ unsigned int cf_check io_apic_read_remap_rte(
 {
     unsigned int ioapic_pin = (reg - 0x10) / 2;
     int index;
-    struct IO_xAPIC_route_entry old_rte = { 0 };
+    struct IO_xAPIC_route_entry old_rte = { };
     int rte_upper = (reg & 1) ? 1 : 0;
     struct vtd_iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic));
 
@@ -442,7 +442,7 @@ void cf_check io_apic_write_remap_rte(
     unsigned int apic, unsigned int reg, unsigned int value)
 {
     unsigned int ioapic_pin = (reg - 0x10) / 2;
-    struct IO_xAPIC_route_entry old_rte = { 0 };
+    struct IO_xAPIC_route_entry old_rte = { };
     struct IO_APIC_route_remap_entry *remap_rte;
     unsigned int rte_upper = (reg & 1) ? 1 : 0;
     struct vtd_iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic));
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 12:55:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 12:55:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570453.892238 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOe3K-0001lW-OE; Wed, 26 Jul 2023 12:55:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570453.892238; Wed, 26 Jul 2023 12:55:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOe3K-0001lP-Jj; Wed, 26 Jul 2023 12:55:42 +0000
Received: by outflank-mailman (input) for mailman id 570453;
 Wed, 26 Jul 2023 12:55:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CD/9=DM=citrix.com=prvs=564dce665=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOe3I-0001jo-CN
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 12:55:40 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b7b7f66c-2bb3-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 14:55:39 +0200 (CEST)
Received: from mail-mw2nam12lp2047.outbound.protection.outlook.com (HELO
 NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.47])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 26 Jul 2023 08:55:32 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by BN8PR03MB4964.namprd03.prod.outlook.com (2603:10b6:408:7d::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 12:55:29 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023
 12:55:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b7b7f66c-2bb3-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690376139;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=zxay+fjWD7Q5pjhPAAOErwHFFjDdYjv3cBVue6zMQvQ=;
  b=UzUMAE7xkJYZZhhgSIa1MvfzyaN2xR4WecxT7nenBvUXnu2EmPRczdwr
   UVShtfjtGvmx75lNLCWmIHFF3h+FrP1mirGUrpUnq86wwcnlY0qxdGgqj
   PYV7vAg00yBBiJbvoOgN3u2dGDerbPxYNXfCONSYvLg9BDbUImLSRNilr
   U=;
X-IronPort-RemoteIP: 104.47.66.47
X-IronPort-MID: 116199184
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:l2IvhapeVVd8piE7VNWL7hA+nrFeBmI/ZBIvgKrLsJaIsI4StFCzt
 garIBnQbq2MamH1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9uWIsmjfE1J5HPD234sebBf8VDJuQmPG7lSLOXS?=
 =?us-ascii?q?CUSVOV4aLd3Gap6h/nJ87?=
X-Talos-MUID: 9a23:fJbMDAo48WfW1mYYoXsezxR5HcxMvbutMnEqzYsCm9mCLC1IBg7I2Q==
X-IronPort-AV: E=Sophos;i="6.01,232,1684814400"; 
   d="scan'208";a="116199184"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=a9B4AOSp9zIPZFpqoJuyyk7aP8v9boiWOmt0kQIHHxfsK/RFQb4eeUACCs1qR3rdvlcWlSv8y2dPhqMmHjmaMZZ00lI49GUZbLSJ6E6fij25W8mrqNDO5RW5JOLnG1afE0i2scaWyF51ZsQp6DkM5RzHt44rkgcNNFFfsHKHT2ViFssKRauhkPrn22LXBQFaqqG+S23W2fmEvUsclczJ7M6ZFOhuCTXZViBEQGsCegc4+S93Ba3C4SswDQ6vEBUTj87YRyk4s3F1b9FhrGnLVKCAteksT9m7IIhePo8Vnlj48/B2Z5amzgY9FMFq1+U1fyZrpyp5BLtnx6hHzMLmJg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=nMLLJuQaKwbKD73WGXmC1pk5x2poKlwnGry2jF/xGuI=;
 b=LSnir7jDBSvxRELJ8Wosain9sc9uvY3E2/LEPzFCazrHjBYaU7ypo6Ztj8uqNVv+jic0h8DLVa9+9Ww6jyDmSl2svtX//sYnle0UalyoHGxp654SixHwGBumdu/V3h1h0b3ovun1A4Khb0hdrQLa07yzUDamJTZ+MlEw6yQ8Qi/gk6DOdcVoEMDj6MLrwDjsMMwjpTox/vxouesZfKgaTIDkjGcKPqUb/qh8m5xJPqz/1V79MLaiYb6bbjwstCGrJmEbVkkNkjy4CXU2Pxs+ECXphAt1/VzhojW2zhtcfkGw7M0XT7B1udlcDm+IIzJKDnjWC037GLJaeg2r9qp8+Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=nMLLJuQaKwbKD73WGXmC1pk5x2poKlwnGry2jF/xGuI=;
 b=cbncixaf/saD6QfzODfJKu20cdwGAUH5A4zYypOIzmZTLiUZ345N1w3Rz6SjkmniM/rI0qTi9CsSJTyGBY8GE1gWfsZ2ZNlAjfitlPudLzphGLjfDGy6pvw2nuI6i7R1PdfB9pctECX0Fft+S0fY/HPNiVS1i9RDLzKSOZ3K1sc=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v3 2/4] x86/ioapic: RTE modifications must use ioapic_write_entry
Date: Wed, 26 Jul 2023 14:55:06 +0200
Message-ID: <20230726125508.78704-3-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726125508.78704-1-roger.pau@citrix.com>
References: <20230726125508.78704-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0031.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2ae::7) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|BN8PR03MB4964:EE_
X-MS-Office365-Filtering-Correlation-Id: fa60e983-b585-4408-73a1-08db8dd796eb
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	AqD/nR5ahdisSEphxqk3A54xMqVKYV1RzR/1caJSCW/a3vMCVgRoTeQ4vcfVr9qwKdhnlYxwfDycO0vbl/TOQXBEUZ+c0Sk3fhQw0yGv+rfUSdLzhdWvOts22L7UsAW1Hvmdc38qScISLQNbHl+/TvJJfwURiQsyFWLLzr0R2CwAG3l3LH1l38WMmPZ3hIXUC3Eq4oZp2UX8YtoNbld0sCI/cyA0C3c+dJUIgJoiS/GlbtiqPu1Teqc/QSG5SKRJ74c0pqN7B0wu5X/MZhHDJYY3z/o+L/HtpY3Xn4vgcFEKy9whkn2yKmS+4NvlH9aDG/HuNTmjxWEOlCic/dGk1PjQbMpFEW8mio/I8HSz4J4PTJ2whkQePrP6n2xPlInfpaFSjfFjygWUOK9LwnNWUOY3NtqYpJ5XqPCZaEa0hLJ/a1S2H3yorKvH0EuW10qTXrHv8eJDSTmj4x6nwuKWvhiOJuOI/U1sANMYmGFBOE8O8A6vDP+0WEl9+tWWWKvMxj7hVqLMUpHLXf+LDeKrBB7cXZizxXWTRF/C+qQ19DtjbBmvxZ0h1pRwfTaOWWY3
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(136003)(396003)(346002)(366004)(451199021)(41300700001)(26005)(6506007)(478600001)(38100700002)(6512007)(86362001)(36756003)(6916009)(4326008)(8676002)(8936002)(186003)(316002)(66946007)(66476007)(66556008)(5660300002)(2906002)(2616005)(83380400001)(54906003)(82960400001)(6486002)(1076003)(6666004);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eDhvUi9aS3RMcVhtOGUwUmxkSlpSRjlJbHIvL056YytpTnU2ajRlTzZmMmFD?=
 =?utf-8?B?NFF0SjEzSWN3ZG1GdHltdk80VnJFaXgwak03SktacmhtNVdoL2hYZjVleFFu?=
 =?utf-8?B?dWhsYUhQYUlHdHUrMm5OZlZDbW5aQjFyOVgyTklJQTNzM3AreVFQcEthT0wy?=
 =?utf-8?B?SXpHYVFyZmM5TUVydkVHN0l6dmZTbXpwdlE5bG1ZdGl1VmFCV1BjZk9FWEVJ?=
 =?utf-8?B?SWQrWkJrdDRnMjlZcjBnQkZ2K2hTMEphc254VlpldDlyZGVCNEROS09kMHVa?=
 =?utf-8?B?Vzl6cUpXOUFTZVg5NnY4bUMzcURpTGx6OHRyaEYzNUNGWGlkNWdjSGlGcjMx?=
 =?utf-8?B?aXc3dVpmdU9OSUpEa2grRVhYM2g4d3NHOC8yOUl2TUtpSmhtd3FDemg5TU5X?=
 =?utf-8?B?czhWNVVXVnRUUDY2U1JBRmJiQklkVE9pZnNpcXBDZzVTOVRNY1VXTmhyMmJs?=
 =?utf-8?B?UnpXcUY4Qm4zL3Y0SnVLR3hlUG9Fd0xncExhdkhZbk9JV1JmUTJnWGdROVJT?=
 =?utf-8?B?d0pNcDRxSERTcU13OERwV2tzRmN4NjNVYng3UWpBK2wrYzRLN01YeVlXVzRE?=
 =?utf-8?B?Z3V5ckEvaDEwVTlXRWU2eEVVNE1ER2tIdTVTMlhNa3RTb2tMdnBjdUFHckM5?=
 =?utf-8?B?ZEt5QWZCMmtZelVpWjlNdDdKMjBzTVRDWXVaVkI5aU55UDhMRlF5ZWFmc21o?=
 =?utf-8?B?aDV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TvigE3A3FtZecwg0MYJgJyjCLhB0B2EGbOEviacQYm+xgL1HWY1x5moQ+MMsCHFG5Wpge/hVJzV9YptDZLoGp/dmqoOfwdJ0ZgEfZCZq6uGYcyyxSU65CkAWhLjxj3nNzl92Ha04iOnHwPst+hmgjTVqMtz1DobMEAH4zwZngnPGx17b1FanIwx414e97UZ9gVnP/SJv1p18UdoLdY1spxv4vG7M6GfEcZ/s2qRsne41HhMysW3P2AoJfvs3DzKcQJ2EEHZhD2RmCrziXc0S4Dhu7EDlbPgSiskD62134n8N9MR/8RM9S5DmxRzKbq7rxgwXgikfbSc+F/Otk6rY8gkwzc57RkxEOkkjBx4B9cLf/Cwc7d9PzgSQdZ1Ch9Mqyhuws47yPh4YerbuK3wQb1oM8bK1+rAZdhxBHrAMa8pyfbK+7C3LcKe7tfVDYDpGI1mkryf0BjqqWjShwmD861DB+W7pwENsPb3kxnTlnJEw8LmoxulUaMkKFkBC+XbXWX5VDdpJ8xFA4Nsjg3QB1WhzLNNbv1+OfECtzsJ07jDMI3QppC1CWR2PwEQg3qWfU+B8nNp2BTA==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: fa60e983-b585-4408-73a1-08db8dd796eb
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 12:55:29.3953
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: /OdzZk6HnEBfL5HbK+6yWylqyxbxD83YJZh/HYx7bwBBQa4w7B+qagLRvAhsNqBxa+LQN2CNw0wNInSKsqsXAA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR03MB4964

Do not allow to write to RTE registers using io_apic_write and instead
require changes to RTE to be performed using ioapic_write_entry.

This is in preparation for passing the full contents of the RTE to the
IOMMU interrupt remapping handlers, so remapping entries for IO-APIC
RTEs can be updated atomically when possible.

While immediately this commit might expand the number of MMIO accesses
in order to update an IO-APIC RTE, further changes will benefit from
getting the full RTE value passed to the IOMMU handlers, as the logic
is greatly simplified when the IOMMU handlers can get the complete RTE
value in one go.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
Changes since v2:
 - Also adjust __ioapic_read_entry().

Changes since v1:
 - Reinstate io_apic_modify().
 - Expand commit message.
---
 xen/arch/x86/include/asm/io_apic.h       |  8 ++---
 xen/arch/x86/io_apic.c                   | 43 ++++++++++++------------
 xen/drivers/passthrough/amd/iommu_intr.c |  6 ----
 3 files changed, 25 insertions(+), 32 deletions(-)

diff --git a/xen/arch/x86/include/asm/io_apic.h b/xen/arch/x86/include/asm/io_apic.h
index 4c4777b68a51..9165da2281ae 100644
--- a/xen/arch/x86/include/asm/io_apic.h
+++ b/xen/arch/x86/include/asm/io_apic.h
@@ -162,8 +162,8 @@ static inline void __io_apic_write(unsigned int apic, unsigned int reg, unsigned
 
 static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value)
 {
-    if ( ioapic_reg_remapped(reg) )
-        return iommu_update_ire_from_apic(apic, reg, value);
+    /* RTE writes must use ioapic_write_entry. */
+    BUG_ON(reg >= 0x10);
     __io_apic_write(apic, reg, value);
 }
 
@@ -173,8 +173,8 @@ static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned i
  */
 static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value)
 {
-    if ( ioapic_reg_remapped(reg) )
-        return iommu_update_ire_from_apic(apic, reg, value);
+    /* RTE writes must use ioapic_write_entry. */
+    BUG_ON(reg >= 0x10);
     *(IO_APIC_BASE(apic) + 4) = value;
 }
 
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index aada2ef96c62..041233b9b706 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -237,15 +237,15 @@ struct IO_APIC_route_entry __ioapic_read_entry(
 {
     union entry_union eu;
 
-    if ( raw )
+    if ( raw || !iommu_intremap )
     {
         eu.w1 = __io_apic_read(apic, 0x10 + 2 * pin);
         eu.w2 = __io_apic_read(apic, 0x11 + 2 * pin);
     }
     else
     {
-        eu.w1 = io_apic_read(apic, 0x10 + 2 * pin);
-        eu.w2 = io_apic_read(apic, 0x11 + 2 * pin);
+        eu.w1 = iommu_read_apic_from_ire(apic, 0x10 + 2 * pin);
+        eu.w2 = iommu_read_apic_from_ire(apic, 0x11 + 2 * pin);
     }
 
     return eu.entry;
@@ -269,15 +269,15 @@ void __ioapic_write_entry(
 {
     union entry_union eu = { .entry = e };
 
-    if ( raw )
+    if ( raw || !iommu_intremap )
     {
         __io_apic_write(apic, 0x11 + 2 * pin, eu.w2);
         __io_apic_write(apic, 0x10 + 2 * pin, eu.w1);
     }
     else
     {
-        io_apic_write(apic, 0x11 + 2 * pin, eu.w2);
-        io_apic_write(apic, 0x10 + 2 * pin, eu.w1);
+        iommu_update_ire_from_apic(apic, 0x11 + 2 * pin, eu.w2);
+        iommu_update_ire_from_apic(apic, 0x10 + 2 * pin, eu.w1);
     }
 }
 
@@ -433,16 +433,17 @@ static void modify_IO_APIC_irq(unsigned int irq, unsigned int enable,
                                unsigned int disable)
 {
     struct irq_pin_list *entry = irq_2_pin + irq;
-    unsigned int pin, reg;
 
     for (;;) {
-        pin = entry->pin;
+        unsigned int pin = entry->pin;
+        struct IO_APIC_route_entry rte;
+
         if (pin == -1)
             break;
-        reg = io_apic_read(entry->apic, 0x10 + pin*2);
-        reg &= ~disable;
-        reg |= enable;
-        io_apic_modify(entry->apic, 0x10 + pin*2, reg);
+        rte = __ioapic_read_entry(entry->apic, pin, false);
+        rte.raw &= ~(uint64_t)disable;
+        rte.raw |= enable;
+        __ioapic_write_entry(entry->apic, pin, false, rte);
         if (!entry->next)
             break;
         entry = irq_2_pin + entry->next;
@@ -584,16 +585,16 @@ set_ioapic_affinity_irq(struct irq_desc *desc, const cpumask_t *mask)
             dest = SET_APIC_LOGICAL_ID(dest);
         entry = irq_2_pin + irq;
         for (;;) {
-            unsigned int data;
+            struct IO_APIC_route_entry rte;
+
             pin = entry->pin;
             if (pin == -1)
                 break;
 
-            io_apic_write(entry->apic, 0x10 + 1 + pin*2, dest);
-            data = io_apic_read(entry->apic, 0x10 + pin*2);
-            data &= ~IO_APIC_REDIR_VECTOR_MASK;
-            data |= MASK_INSR(desc->arch.vector, IO_APIC_REDIR_VECTOR_MASK);
-            io_apic_modify(entry->apic, 0x10 + pin*2, data);
+            rte = __ioapic_read_entry(entry->apic, pin, false);
+            rte.dest.dest32 = dest;
+            rte.vector = desc->arch.vector;
+            __ioapic_write_entry(entry->apic, pin, false, rte);
 
             if (!entry->next)
                 break;
@@ -2127,10 +2128,8 @@ void ioapic_resume(void)
             reg_00.bits.ID = mp_ioapics[apic].mpc_apicid;
             __io_apic_write(apic, 0, reg_00.raw);
         }
-        for (i = 0; i < nr_ioapic_entries[apic]; i++, entry++) {
-            __io_apic_write(apic, 0x11+2*i, *(((int *)entry)+1));
-            __io_apic_write(apic, 0x10+2*i, *(((int *)entry)+0));
-        }
+        for (i = 0; i < nr_ioapic_entries[apic]; i++, entry++)
+            __ioapic_write_entry(apic, i, true, *entry);
     }
     spin_unlock_irqrestore(&ioapic_lock, flags);
 }
diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index 9e6be3be3515..f32c418a7e49 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -361,12 +361,6 @@ void cf_check amd_iommu_ioapic_update_ire(
     struct amd_iommu *iommu;
     unsigned int idx;
 
-    if ( !iommu_intremap )
-    {
-        __io_apic_write(apic, reg, value);
-        return;
-    }
-
     idx = ioapic_id_to_index(IO_APIC_ID(apic));
     if ( idx == MAX_IO_APICS )
         return;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 12:55:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 12:55:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570454.892248 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOe3R-0002D2-Vn; Wed, 26 Jul 2023 12:55:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570454.892248; Wed, 26 Jul 2023 12:55:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOe3R-0002Ct-S2; Wed, 26 Jul 2023 12:55:49 +0000
Received: by outflank-mailman (input) for mailman id 570454;
 Wed, 26 Jul 2023 12:55:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CD/9=DM=citrix.com=prvs=564dce665=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOe3Q-0001jo-FC
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 12:55:48 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bc57d75f-2bb3-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 14:55:46 +0200 (CEST)
Received: from mail-bn8nam11lp2169.outbound.protection.outlook.com (HELO
 NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.169])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 26 Jul 2023 08:55:44 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by BN8PR03MB4964.namprd03.prod.outlook.com (2603:10b6:408:7d::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 12:55:41 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023
 12:55:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bc57d75f-2bb3-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690376146;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=CRRrGtlxVDsayUpdf1CxS8gHCC+pHA7DUrtuAZHECHw=;
  b=APQL3qW8wrnxALyZpCcOz64xkfy0W6CgIlTVdsm/mP7CqlS6EOYYfye+
   R71A9/eWgoMfPnNatjDrEIhfio532UqHqYOpisaKtjYVQMq4XjKpI/s4u
   UttO/vFEEHKQMRJQsYwdVKwcgKh95joGLEMAK0H60V4A3QMdtT0k/wXZY
   0=;
X-IronPort-RemoteIP: 104.47.58.169
X-IronPort-MID: 116792215
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:MucwbKIhriFc4MOsFE+RE5QlxSXFcZb7ZxGr2PjKsXjdYENS0mYOy
 GUeCGmEa63Zajf2KIpxat7i/RlQsZDRztAxTQplqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws
 Jb5rta31GWNglaYCUpKrfrawP9TlK6q4mhA4QZgPakjUGL2zBH5MrpOfcldEFOgKmVkNrbSb
 /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/
 jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5JJmFH0
 uw3LQlVbzWFnf+7mo2mG+tj05FLwMnDZOvzu1lG5BSAVLMMZ8CGRK/Ho9hFwD03m8ZCW+7EY
 NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/dnpTGNnWSd05C0WDbRUsaNSshP2F6Ru
 0rN/njjAwFcP9uaodaA2iv12LCex3miBer+EpWfqa9toWaYy1A0CT07X1Kk/feV1FSXDoc3x
 0s8v3BGQbIJ3FymSJzxUgO1pFaAvwUAQJxAHusi8gaPx6HIpQGDCQAsTDRMddgnv88eXiEx2
 xmCmNaBLSNrmK2YTzSa7Lj8hTC/JykTa3MDbCksTA0Z7t2lq4Y25jrXR8tnOL64iJvyAz6Y/
 tyRhC03hrFWh8hb0ay+pAnDm2j1+MmPSRMp7ALKWG7j9hl+eIOue42v7x7c8OpEK4GaCFKGu
 RDohvSj0QzHNrnV/ATlfQnHNOvBCyqtWNEEvWNSIg==
IronPort-HdrOrdr: A9a23:fBM5yKpIrLc9y6o2dJz52EIaV5rveYIsimQD101hICG9Evb0qy
 nOpoV/6faQslwssR4b9uxoVJPvfZq+z+8W3WByB9eftWDd0QPFEGgL1+DfKlbbak7DH4BmtJ
 uJc8JFeafN5VoRt7eG3OFveexQvOVu88qT9JjjJ28Gd3APV0n5hT0JcjpyFCdNNW57LKt8Lr
 WwzOxdqQGtfHwGB/7LfUXsD4D41rv2fIuNW29+OyIa
X-Talos-CUID: =?us-ascii?q?9a23=3ALDz/VWkns8RI2LScpA0ZDqWApn3XOUP6zH73M2C?=
 =?us-ascii?q?9MD5obbuPVFLKx741kcU7zg=3D=3D?=
X-Talos-MUID: 9a23:N3O1dgUht0wc6Y7q/Biz1TZDD8xl34OvKG0HmIpateXaLwUlbg==
X-IronPort-AV: E=Sophos;i="6.01,232,1684814400"; 
   d="scan'208";a="116792215"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=PsShorozq6bP8KiXXnMLHMKGKVkZ6FqGRBWzjPPmkfofIESCECXhqW7xvyueV75mwNxyAsgboCBu1Xjt/V1NipwTLLuEH+3PYeuzD/bwc4IHNDGkSYpS1jHeSoOoEYb5SEGD2lxsaAW7GCsg4Q1VaurlfhBvQDFCpM3JsI1ADoNWglkp6sfBKQW8vu/FrZBuIcfiKeUfEQb3S3n4aYczw+yo7S7clUeC7d3dWVQxsZgN2tMFrh8PHnkbLDj21KJGkExzpW53VKbkI9ELYJK9241A1XGHOnCWgwJSdzgNgOJtD60cnqnJONhb6C1B2Sr2SlsV8chS/HrLW3/JvvRSew==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=2XXAI2e/6yxqBnTr/7xfNoPXQZLGgoX9+YJfRXXMKKw=;
 b=AG9BdWWS/IKfcEHkuyhth1GVsTYMzd46DJ06XQvyRF41vUa4tP7gF8bKfUZXCnLjBzZXPjMpjANdnMGsqeVslGfn7aVvECnt4NGv2ovhEnsUmncYuOZmsvZmkhabOtNiE7hFkH8zwWx4+i/oYlDMqEDSq2XdMgExh3pRqUkUSPdS2EOT2JH33reAWie9lkdToMhhLsbN8pgQyrro65QbEOpVUgs6zWfmpuEVZjaGc2sLv0Tmr3h57dw7xDjmxVYsiegbtdZ9964+uZNh9cJ05PvzH0OQZ2dYmsXnsdh4in0TYfcQughGMncmwygo4Xwvq5vZNd6kh/+KGQ5jY1YBZw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=2XXAI2e/6yxqBnTr/7xfNoPXQZLGgoX9+YJfRXXMKKw=;
 b=tM5W3CzhTfJuXaiSVcTCYEMqr13z50ybfUQ0tPL8U9baRWV1tEnf9ll0KlY/s7VZqbVw0yp+t6P3wMIyp8+JWma/zg/LoEbN8L1DhVsjsn+FWGgomwVmr/o4Pgvr5Re9ImnSz/U4KvgIoPmCLytqZQtwalZD+crIs+ZxNUmGj9E=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>,
	Kevin Tian <kevin.tian@intel.com>,
	Paul Durrant <paul@xen.org>
Subject: [PATCH v3 4/4] x86/iommu: pass full IO-APIC RTE for remapping table update
Date: Wed, 26 Jul 2023 14:55:08 +0200
Message-ID: <20230726125508.78704-5-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726125508.78704-1-roger.pau@citrix.com>
References: <20230726125508.78704-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0276.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:37a::16) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|BN8PR03MB4964:EE_
X-MS-Office365-Filtering-Correlation-Id: bb422968-1c71-47fc-0830-08db8dd79dcd
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	2oQ1x+rsyPsNiemDZozRv1fyGwDoCt5UyKYdpxwSg7YCQ8tA4y10L4dCa26tJodXXNT2iWUQTPlGae8vbW0UR2d+M6HyyUlZo958iH66ZvHfrjhbz8dSuyljxxs6cJZJgKoGG/kcy27WUJugQ9JZJS3EX3TdrePAfTzWaF99aoxjyiefgt9YllKFsBXNzfkulYPHqgNZjI3O/1Zgz5HeXAyk9ONgqDTXgO00gEJmqohDwBmtfzmyqXlV4Fm0v7CSTB3FWoBhTrIMLuW+wIffkxoCqYIvVQLZSwoH9Rq5rNbg2lIVjtIUhIlcntwDWpznAIr/mdgXuoY6sVN/RHlBXsC2+yA2BcbCjws1Z8pLtLghert9xa5TY2Ke3+jhqB5hkliYEbqx+1N/nVvyfxGqk9Az9mWLIuEfjlXPki1Eobz5pm7L3X92wj9mi6paPA7yUYcoE4ZA/mWCN7jmavlFJvHjqm/SqFwNmX4WMSf2gMahDZhEGFcgGlKydbQbhXLFTNQUnUBn+X2F69gjL7t4a5nX3BJbnLSQGQqPeeQdOiw1rzixIYDY3vDeUsx7u64v
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(136003)(396003)(346002)(366004)(451199021)(41300700001)(26005)(6506007)(478600001)(38100700002)(6512007)(86362001)(36756003)(6916009)(4326008)(8676002)(8936002)(186003)(316002)(66946007)(66476007)(66556008)(5660300002)(2906002)(2616005)(83380400001)(54906003)(82960400001)(6486002)(1076003)(6666004)(15650500001)(30864003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?R2llZW0rdW5ranNWQjFJM3JUVllsNnVWWVMrSjAvd252LzhFN2RtcGRzRENL?=
 =?utf-8?B?NUdzRnBpZG5scUNUendORzl5R3hBRkU5SWliNEJXY01NTmdhcVNmckptMjkv?=
 =?utf-8?B?K0h1MEZwSE10WGpIaW5icTNHL1prcVBidkJLWktoYkFheTYxbi9HV1ZZU3Rx?=
 =?utf-8?B?M1QxSHFiTlRCVFdNYklsMm56Y3EvYzM3cWYzSERrcndPcWozaW5xT3JwM05p?=
 =?utf-8?B?Q2tCdHJWYmNtS3NLRFlmOXlobzU1U0RPWXM0TEVMOUFnQzVnelU0dkdPUTN5?=
 =?utf-8?B?dHVBNFZORDZFbjV0Mk9vRDdoQnJnbjZCc3BvTHNhWWtoNGhNTUJHQUtHdE1r?=
 =?utf-8?B?eFpDd05GUzM5cUM4Z0dzTXBMbDlaU25PVVc4MDZiOTlvRGNSb0NlaXYzM3Y4?=
 =?utf-8?B?c2kwTzNBY25hSENSSFo2N1pwUmd4SDY0UjQxdEdneDFTMmo1dTNYM25MY1pw?=
 =?utf-8?B?Y3RKMVlkT2U1c2FYL2VHOWJ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kLuh1fLXNV7rcRkwgPMJRYB0Lndh7In9Rr8f9qIUwc5X960/Vo4Nh7EPKxFVsXhhnFM/f6i950mbMsRr5JY5PFad0mjxSnwmgkXlvlPuSmaaDtnsoOXh2pgAZXLxjy2V9BqzZrVrBcbTVT3WZfNDH8WSfR18pqr6eQcfZBLGDEKjk8hPsP5DbRGUIo36kdEUd1XZkasJk3Kr+3v1jBVaNqUMmuCuPRZg0PCjmRRXXyUoCbDgo/F5eZbSgoVkCDI7vv2Ssn+rZGqXsMYj+3cfqZZmiQMVw5VZ09Sh0cafzMSnlr7mcBDpJ9FwPqHD3EpB0Wvp5GERN3loOMKQVW44tKYXhy6cdP4zfd8JfKSncoJXcHvGDhEAZPy/0HDZQu9rsHCUzBXjdjl6xEcL6zZkOlL3ub3fhGpnCOW7kt0gKwd3VnVATSeIBkI+48yZpYALJbOvRMoOyq+dC8Dwd75rX3XQ+dUJ2onBpXp1PypRqIDrOw396gfuaEMDj6aWnkZzjTxVMOT555xVAeTFDg9HPQTXXBQM5SswTvN+aLHRN4+Ykru/iuNfB4kClTxqVLCDxj3Ub8Gxd5kTFrCTNBPCR4pO6xmYyMl05PUJBzJ6FUcC6chEuy71gK8mB8XVlji70r6efO1v4nv1x/wNgcLal/js/k1a1qOSRS/tAlkOZKyhpXOVYkcj2GcN0olfPU8xECYlKgLL5YyEYMQlEAfzZrguwEyTyWzqUbyqDDAv5D5NLYXhSMJ/QoYu6wsP//zdtikPaTkBVwiWdZdXijY5VCpJ1Om6/7v/WKXySvSvI4a+p0VCDmCoizAK+tgBYf7XQVI38KCRfgsgz8XhVY2gcn0MbFYpE7b7cFy4=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bb422968-1c71-47fc-0830-08db8dd79dcd
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 12:55:41.5017
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: bYTHuYrqouCslHS9NllfKyDARJouvHu3X3mNEgvZQdWYbetCyf3/1vziLkpilteAMNkWHmgWPTGbb9cKJ3uuag==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR03MB4964

So that the remapping entry can be updated atomically when possible.

Doing such update atomically will avoid Xen having to mask the IO-APIC
pin prior to performing any interrupt movements (ie: changing the
destination and vector fields), as the interrupt remapping entry is
always consistent.

This also simplifies some of the logic on both VT-d and AMD-Vi
implementations, as having the full RTE available instead of half of
it avoids to possibly read and update the missing other half from
hardware.

While there remove the explicit zeroing of new_ire fields in
ioapic_rte_to_remap_entry() and initialize the variable at definition
so all fields are zeroed.  Note fields could be also initialized with
final values at definition, but I found that likely too much to be
done at this time.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
Changes since v2:
 - Remove unneeded initialization.
 - Use 'rte' as parameter name for update_ire_from_apic()
   implementations.
 - Fix comment style in ioapic_rte_to_remap_entry().
 - Fix requirement for atomic write in update_irte() call from
   ioapic_rte_to_remap_entry().
 - Remove remap_rte from io_apic_write_remap_rte().
---
Note that certain combination of changes to the RTE are impossible to
handle atomically. For example changing the vector and/or destination
fields together with the triggering mode is impossible to be performed
atomically (as the destination and vector is set in the IRTE, but the
triggering mode is set in the RTE).  Xen doesn't attempt to perform
such changes in a single update to the RTE anyway, so it's fine.

Naming the iommu_update_ire_from_apic() parameter RTE is not really
correct, as the format of the passed value expands the destination
field to be 32bits (in order to fit an x2APIC ID).  Passing an
IO_APIC_route_entry struct is not possible due to the circular
dependency that would create between io_apic.h and iommu.h.  It might
be possible to move IO_APIC_route_entry declaration to a different
header, but I haven't looked into it.
---
 xen/arch/x86/include/asm/iommu.h         |   3 +-
 xen/arch/x86/io_apic.c                   |   5 +-
 xen/drivers/passthrough/amd/iommu.h      |   2 +-
 xen/drivers/passthrough/amd/iommu_intr.c | 100 ++---------------
 xen/drivers/passthrough/vtd/extern.h     |   2 +-
 xen/drivers/passthrough/vtd/intremap.c   | 136 +++++++++++------------
 xen/drivers/passthrough/x86/iommu.c      |   4 +-
 xen/include/xen/iommu.h                  |   3 +-
 8 files changed, 86 insertions(+), 169 deletions(-)

diff --git a/xen/arch/x86/include/asm/iommu.h b/xen/arch/x86/include/asm/iommu.h
index 0540cd9faa87..eb720205e25e 100644
--- a/xen/arch/x86/include/asm/iommu.h
+++ b/xen/arch/x86/include/asm/iommu.h
@@ -84,7 +84,8 @@ struct iommu_init_ops {
 
 extern const struct iommu_init_ops *iommu_init_ops;
 
-void iommu_update_ire_from_apic(unsigned int apic, unsigned int reg, unsigned int value);
+void iommu_update_ire_from_apic(unsigned int apic, unsigned int pin,
+                                uint64_t rte);
 unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int reg);
 int iommu_setup_hpet_msi(struct msi_desc *);
 
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 041233b9b706..b3afef8933d7 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -275,10 +275,7 @@ void __ioapic_write_entry(
         __io_apic_write(apic, 0x10 + 2 * pin, eu.w1);
     }
     else
-    {
-        iommu_update_ire_from_apic(apic, 0x11 + 2 * pin, eu.w2);
-        iommu_update_ire_from_apic(apic, 0x10 + 2 * pin, eu.w1);
-    }
+        iommu_update_ire_from_apic(apic, pin, e.raw);
 }
 
 static void ioapic_write_entry(
diff --git a/xen/drivers/passthrough/amd/iommu.h b/xen/drivers/passthrough/amd/iommu.h
index 8bc3c35b1bb1..5429ada58ef5 100644
--- a/xen/drivers/passthrough/amd/iommu.h
+++ b/xen/drivers/passthrough/amd/iommu.h
@@ -300,7 +300,7 @@ int cf_check amd_iommu_free_intremap_table(
 unsigned int amd_iommu_intremap_table_order(
     const void *irt, const struct amd_iommu *iommu);
 void cf_check amd_iommu_ioapic_update_ire(
-    unsigned int apic, unsigned int reg, unsigned int value);
+    unsigned int apic, unsigned int pin, uint64_t rte);
 unsigned int cf_check amd_iommu_read_ioapic_from_ire(
     unsigned int apic, unsigned int reg);
 int cf_check amd_iommu_msi_msg_update_ire(
diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index f32c418a7e49..e83a2a932af8 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -247,11 +247,6 @@ static void update_intremap_entry(const struct amd_iommu *iommu,
     }
 }
 
-static inline int get_rte_index(const struct IO_APIC_route_entry *rte)
-{
-    return rte->vector | (rte->delivery_mode << 8);
-}
-
 static inline void set_rte_index(struct IO_APIC_route_entry *rte, int offset)
 {
     rte->vector = (u8)offset;
@@ -267,7 +262,6 @@ static int update_intremap_entry_from_ioapic(
     int bdf,
     struct amd_iommu *iommu,
     struct IO_APIC_route_entry *rte,
-    bool_t lo_update,
     u16 *index)
 {
     unsigned long flags;
@@ -315,31 +309,6 @@ static int update_intremap_entry_from_ioapic(
         spin_lock(lock);
     }
 
-    if ( fresh )
-        /* nothing */;
-    else if ( !lo_update )
-    {
-        /*
-         * Low half of incoming RTE is already in remapped format,
-         * so need to recover vector and delivery mode from IRTE.
-         */
-        ASSERT(get_rte_index(rte) == offset);
-        if ( iommu->ctrl.ga_en )
-            vector = entry.ptr128->full.vector;
-        else
-            vector = entry.ptr32->flds.vector;
-        /* The IntType fields match for both formats. */
-        delivery_mode = entry.ptr32->flds.int_type;
-    }
-    else if ( x2apic_enabled )
-    {
-        /*
-         * High half of incoming RTE was read from the I/O APIC and hence may
-         * not hold the full destination, so need to recover full destination
-         * from IRTE.
-         */
-        dest = get_full_dest(entry.ptr128);
-    }
     update_intremap_entry(iommu, entry, vector, delivery_mode, dest_mode, dest);
 
     spin_unlock_irqrestore(lock, flags);
@@ -350,14 +319,11 @@ static int update_intremap_entry_from_ioapic(
 }
 
 void cf_check amd_iommu_ioapic_update_ire(
-    unsigned int apic, unsigned int reg, unsigned int value)
+    unsigned int apic, unsigned int pin, uint64_t rte)
 {
-    struct IO_APIC_route_entry old_rte = { };
-    struct IO_APIC_route_entry new_rte = { };
-    unsigned int rte_lo = (reg & 1) ? reg - 1 : reg;
-    unsigned int pin = (reg - 0x10) / 2;
+    struct IO_APIC_route_entry old_rte;
+    struct IO_APIC_route_entry new_rte = { .raw = rte };
     int seg, bdf, rc;
-    bool saved_mask, fresh = false;
     struct amd_iommu *iommu;
     unsigned int idx;
 
@@ -373,58 +339,23 @@ void cf_check amd_iommu_ioapic_update_ire(
     {
         AMD_IOMMU_WARN("failed to find IOMMU for IO-APIC @ %04x:%04x\n",
                        seg, bdf);
-        __io_apic_write(apic, reg, value);
+        __ioapic_write_entry(apic, pin, true, new_rte);
         return;
     }
 
-    /* save io-apic rte lower 32 bits */
-    *((u32 *)&old_rte) =  __io_apic_read(apic, rte_lo);
-    saved_mask = old_rte.mask;
-
-    if ( reg == rte_lo )
-    {
-        *((u32 *)&new_rte) = value;
-        /* read upper 32 bits from io-apic rte */
-        *(((u32 *)&new_rte) + 1) = __io_apic_read(apic, reg + 1);
-    }
-    else
-    {
-        *((u32 *)&new_rte) = *((u32 *)&old_rte);
-        *(((u32 *)&new_rte) + 1) = value;
-    }
-
-    if ( ioapic_sbdf[idx].pin_2_idx[pin] >= INTREMAP_MAX_ENTRIES )
-    {
-        ASSERT(saved_mask);
-
-        /*
-         * There's nowhere except the IRTE to store a full 32-bit destination,
-         * so we may not bypass entry allocation and updating of the low RTE
-         * half in the (usual) case of the high RTE half getting written first.
-         */
-        if ( new_rte.mask && !x2apic_enabled )
-        {
-            __io_apic_write(apic, reg, value);
-            return;
-        }
-
-        fresh = true;
-    }
-
+    old_rte = __ioapic_read_entry(apic, pin, true);
     /* mask the interrupt while we change the intremap table */
-    if ( !saved_mask )
+    if ( !old_rte.mask )
     {
         old_rte.mask = 1;
-        __io_apic_write(apic, rte_lo, *((u32 *)&old_rte));
+        __ioapic_write_entry(apic, pin, true, old_rte);
     }
 
     /* Update interrupt remapping entry */
     rc = update_intremap_entry_from_ioapic(
-             bdf, iommu, &new_rte, reg == rte_lo,
+             bdf, iommu, &new_rte,
              &ioapic_sbdf[idx].pin_2_idx[pin]);
 
-    __io_apic_write(apic, reg, ((u32 *)&new_rte)[reg != rte_lo]);
-
     if ( rc )
     {
         /* Keep the entry masked. */
@@ -433,20 +364,7 @@ void cf_check amd_iommu_ioapic_update_ire(
         return;
     }
 
-    /* For lower bits access, return directly to avoid double writes */
-    if ( reg == rte_lo )
-        return;
-
-    /*
-     * Unmask the interrupt after we have updated the intremap table. Also
-     * write the low half if a fresh entry was allocated for a high half
-     * update in x2APIC mode.
-     */
-    if ( !saved_mask || (x2apic_enabled && fresh) )
-    {
-        old_rte.mask = saved_mask;
-        __io_apic_write(apic, rte_lo, *((u32 *)&old_rte));
-    }
+    __ioapic_write_entry(apic, pin, true, new_rte);
 }
 
 unsigned int cf_check amd_iommu_read_ioapic_from_ire(
diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 39602d1f88f8..b684e9393d1a 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -92,7 +92,7 @@ int cf_check intel_iommu_get_reserved_device_memory(
 unsigned int cf_check io_apic_read_remap_rte(
     unsigned int apic, unsigned int reg);
 void cf_check io_apic_write_remap_rte(
-    unsigned int apic, unsigned int reg, unsigned int value);
+    unsigned int apic, unsigned int ioapic_pin, uint64_t rte);
 
 struct msi_desc;
 struct msi_msg;
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 05df6d5759b1..4101fd6bccaf 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -328,15 +328,14 @@ static int remap_entry_to_ioapic_rte(
 
 static int ioapic_rte_to_remap_entry(struct vtd_iommu *iommu,
     int apic, unsigned int ioapic_pin, struct IO_xAPIC_route_entry *old_rte,
-    unsigned int rte_upper, unsigned int value)
+    struct IO_xAPIC_route_entry new_rte)
 {
     struct iremap_entry *iremap_entry = NULL, *iremap_entries;
-    struct iremap_entry new_ire;
+    struct iremap_entry new_ire = { };
     struct IO_APIC_route_remap_entry *remap_rte;
-    struct IO_xAPIC_route_entry new_rte;
     int index;
     unsigned long flags;
-    bool init = false;
+    bool init = false, masked = old_rte->mask;
 
     remap_rte = (struct IO_APIC_route_remap_entry *) old_rte;
     spin_lock_irqsave(&iommu->intremap.lock, flags);
@@ -364,48 +363,40 @@ static int ioapic_rte_to_remap_entry(struct vtd_iommu *iommu,
 
     new_ire = *iremap_entry;
 
-    if ( rte_upper )
-    {
-        if ( x2apic_enabled )
-            new_ire.remap.dst = value;
-        else
-            new_ire.remap.dst = (value >> 24) << 8;
-    }
+    if ( x2apic_enabled )
+        new_ire.remap.dst = new_rte.dest.dest32;
     else
-    {
-        *(((u32 *)&new_rte) + 0) = value;
-        new_ire.remap.fpd = 0;
-        new_ire.remap.dm = new_rte.dest_mode;
-        new_ire.remap.tm = new_rte.trigger;
-        new_ire.remap.dlm = new_rte.delivery_mode;
-        /* Hardware require RH = 1 for LPR delivery mode */
-        new_ire.remap.rh = (new_ire.remap.dlm == dest_LowestPrio);
-        new_ire.remap.avail = 0;
-        new_ire.remap.res_1 = 0;
-        new_ire.remap.vector = new_rte.vector;
-        new_ire.remap.res_2 = 0;
-
-        set_ioapic_source_id(IO_APIC_ID(apic), &new_ire);
-        new_ire.remap.res_3 = 0;
-        new_ire.remap.res_4 = 0;
-        new_ire.remap.p = 1;     /* finally, set present bit */
-
-        /* now construct new ioapic rte entry */
-        remap_rte->vector = new_rte.vector;
-        remap_rte->delivery_mode = 0;    /* has to be 0 for remap format */
-        remap_rte->index_15 = (index >> 15) & 0x1;
-        remap_rte->index_0_14 = index & 0x7fff;
-
-        remap_rte->delivery_status = new_rte.delivery_status;
-        remap_rte->polarity = new_rte.polarity;
-        remap_rte->irr = new_rte.irr;
-        remap_rte->trigger = new_rte.trigger;
-        remap_rte->mask = new_rte.mask;
-        remap_rte->reserved = 0;
-        remap_rte->format = 1;    /* indicate remap format */
-    }
-
-    update_irte(iommu, iremap_entry, &new_ire, !init);
+        new_ire.remap.dst = (new_rte.dest.dest32 >> 24) << 8;
+
+    new_ire.remap.dm = new_rte.dest_mode;
+    new_ire.remap.tm = new_rte.trigger;
+    new_ire.remap.dlm = new_rte.delivery_mode;
+    /* Hardware require RH = 1 for LPR delivery mode. */
+    new_ire.remap.rh = (new_ire.remap.dlm == dest_LowestPrio);
+    new_ire.remap.vector = new_rte.vector;
+
+    set_ioapic_source_id(IO_APIC_ID(apic), &new_ire);
+    /* Finally, set present bit. */
+    new_ire.remap.p = 1;
+
+    /* Now construct new ioapic rte entry. */
+    remap_rte->vector = new_rte.vector;
+    /* Has to be 0 for remap format. */
+    remap_rte->delivery_mode = 0;
+    remap_rte->index_15 = (index >> 15) & 0x1;
+    remap_rte->index_0_14 = index & 0x7fff;
+
+    remap_rte->delivery_status = new_rte.delivery_status;
+    remap_rte->polarity = new_rte.polarity;
+    remap_rte->irr = new_rte.irr;
+    remap_rte->trigger = new_rte.trigger;
+    remap_rte->mask = new_rte.mask;
+    remap_rte->reserved = 0;
+    /* Indicate remap format. */
+    remap_rte->format = 1;
+
+    /* If cmpxchg16b is not available the caller must mask the IO-APIC pin. */
+    update_irte(iommu, iremap_entry, &new_ire, !init && !masked);
     iommu_sync_cache(iremap_entry, sizeof(*iremap_entry));
     iommu_flush_iec_index(iommu, 0, index);
 
@@ -439,36 +430,45 @@ unsigned int cf_check io_apic_read_remap_rte(
 }
 
 void cf_check io_apic_write_remap_rte(
-    unsigned int apic, unsigned int reg, unsigned int value)
+    unsigned int apic, unsigned int pin, uint64_t rte)
 {
-    unsigned int pin = (reg - 0x10) / 2;
+    struct IO_xAPIC_route_entry new_rte = { .raw = rte };
     struct IO_xAPIC_route_entry old_rte = { };
-    struct IO_APIC_route_remap_entry *remap_rte;
-    unsigned int rte_upper = (reg & 1) ? 1 : 0;
     struct vtd_iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic));
-    int saved_mask;
-
-    old_rte = __ioapic_read_entry(apic, pin, true);
+    bool masked = true;
+    int rc;
 
-    remap_rte = (struct IO_APIC_route_remap_entry *) &old_rte;
-
-    /* mask the interrupt while we change the intremap table */
-    saved_mask = remap_rte->mask;
-    remap_rte->mask = 1;
-    __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
-    remap_rte->mask = saved_mask;
-
-    if ( ioapic_rte_to_remap_entry(iommu, apic, pin,
-                                   &old_rte, rte_upper, value) )
+    if ( !cpu_has_cx16 )
     {
-        __io_apic_write(apic, reg, value);
+       /*
+        * Cannot atomically update the IRTE entry: mask the IO-APIC pin to
+        * avoid interrupts seeing an inconsistent IRTE entry.
+        */
+        old_rte = __ioapic_read_entry(apic, pin, true);
+        if ( !old_rte.mask )
+        {
+            masked = false;
+            old_rte.mask = 1;
+            __ioapic_write_entry(apic, pin, true, old_rte);
+        }
+    }
 
-        /* Recover the original value of 'mask' bit */
-        if ( rte_upper )
-            __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
+    rc = ioapic_rte_to_remap_entry(iommu, apic, pin, &old_rte, new_rte);
+    if ( rc )
+    {
+        if ( !masked )
+        {
+            /* Recover the original value of 'mask' bit */
+            old_rte.mask = 0;
+            __ioapic_write_entry(apic, pin, true, old_rte);
+        }
+        dprintk(XENLOG_ERR VTDPREFIX,
+                "failed to update IRTE for IO-APIC#%u pin %u: %d\n",
+                apic, pin, rc);
+        return;
     }
-    else
-        __ioapic_write_entry(apic, pin, true, old_rte);
+    /* old_rte will contain the updated IO-APIC RTE on success. */
+    __ioapic_write_entry(apic, pin, true, old_rte);
 }
 
 static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
index be71a4c4641c..d290855959f2 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -158,9 +158,9 @@ int iommu_enable_x2apic(void)
 }
 
 void iommu_update_ire_from_apic(
-    unsigned int apic, unsigned int reg, unsigned int value)
+    unsigned int apic, unsigned int pin, uint64_t rte)
 {
-    iommu_vcall(&iommu_ops, update_ire_from_apic, apic, reg, value);
+    iommu_vcall(&iommu_ops, update_ire_from_apic, apic, pin, rte);
 }
 
 unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int reg)
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 405db59971c5..9335cd074cff 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -278,7 +278,8 @@ struct iommu_ops {
     int (*enable_x2apic)(void);
     void (*disable_x2apic)(void);
 
-    void (*update_ire_from_apic)(unsigned int apic, unsigned int reg, unsigned int value);
+    void (*update_ire_from_apic)(unsigned int apic, unsigned int pin,
+                                 uint64_t rte);
     unsigned int (*read_apic_from_ire)(unsigned int apic, unsigned int reg);
 
     int (*setup_hpet_msi)(struct msi_desc *);
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 12:55:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 12:55:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570455.892258 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOe3V-0002aG-Ea; Wed, 26 Jul 2023 12:55:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570455.892258; Wed, 26 Jul 2023 12:55:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOe3V-0002Zy-Ae; Wed, 26 Jul 2023 12:55:53 +0000
Received: by outflank-mailman (input) for mailman id 570455;
 Wed, 26 Jul 2023 12:55:51 +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
 <SRS0=CD/9=DM=citrix.com=prvs=564dce665=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOe3T-0001CQ-IK
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 12:55:51 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bce348e0-2bb3-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 14:55:48 +0200 (CEST)
Received: from mail-bn8nam11lp2168.outbound.protection.outlook.com (HELO
 NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.168])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 26 Jul 2023 08:55:37 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by BN8PR03MB4964.namprd03.prod.outlook.com (2603:10b6:408:7d::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 12:55:35 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023
 12:55:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bce348e0-2bb3-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690376148;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=bh4Z8vh88aCCNmW7xSNaFT+TLYRAGdh+7EtGhKnpcyM=;
  b=EIYkI08XCQtk2+uGXGFwdj5SDDvpoEoBp8mb+sMb4Td+0whFu5r/Ypda
   w4CtuPwnM5dIH/IVpsEXHZJmBi4EdOoQn4hfzs23yK1umkxAwrgvY34Jc
   Usnbbbe4L3dUvEIqNsQ5HuyaNcnLZduaNvPY7APrCFL5Yb3zRyZqi/NSq
   g=;
X-IronPort-RemoteIP: 104.47.58.168
X-IronPort-MID: 117378940
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:5udgSqPq1WUma2fvrR27lsFynXyQoLVcMsEvi/4bfWQNrUoj0jAPy
 TQfDW+PO/beYDD2ftt/PNvnoR9Vup6BxocyHQto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v
 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/
 Nj/uKUzAnf8s9JPGjxSs/vrRC9H5qyo42tH5AJmPJingXeF/5UrJMNHTU2OByOQrrl8RoaSW
 +vFx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microsoft.com; cv=none;
 b=JDasyB5TZgPHZAM+mPeZ1c0ukBDqzSeBJhJHkrJvpSXDVqLljJsE6cy+Xh7MxhjVl+hjeFxC8ccRnXiolC25MlSqOMMiYtUB6GF+EOUdACb/YYZnz7o1TnrQLbOq9hJLym5eQ84TK7xRqIAbi6YbdV6tSyz3siQNQHvVJ6szLJ0oPMkNyK7UCCJpEb9xG7k6iP4Hb2vu0LWqTGI3FYMi8sp5DcyD9j89nkXqZE9nTcWNg+F5QwQK43IDhk+JXwxTrCC8aSqKZ/gKHIPXOnOv3eh6yuX6Pu6+8O6c/63OItIMcCa7JVszNjpBVHrEsWkIM+tQ9YW7Y64aW7p3SL4bew==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OCnIUZuAFwbePOekwR0bgT5Rjf2c+Q+JJrHWHdx6kO0=;
 b=WeXUSrpOzQm6l6Z01xn/C+5GLtfIyKnM/niSa4I7yhBjnc4SkuEZMIrUSoNaMKADx0jYNzMNvFvTJi0baSmgNu+C/3AH+IgbTDYj7bVdEqVlUndtGvW7j8t3bAGVhK7SIjtpx0uLOqA4uxpJzv89QfAyMYxc//tjZPDVXVMJTmI/EH++dcvmhEmEYK5wG1ajJrd7JZRzAgw0GKyCKkSYHn9Yxcqrz+eIBG1OIz/IwCdT2pMBInl6ZcT7yvQ+DUy+mE+paWnA66M2tCuoV5hQR/c0gl4HdmUt8/2+fDWK71Xw5aIt/fWqgCNPpG/DDVb0KR4lgSYSSnTmYwc/R+fp8A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OCnIUZuAFwbePOekwR0bgT5Rjf2c+Q+JJrHWHdx6kO0=;
 b=aw2pxS4DvHy55c2vqFEBqqoUPFbhtfrRkJwIBy5t1CHLdBCAtiH5MgZU23FdkgEQzACgEn4SifltjXhHZLRvxstGGE2uvsmbC4pFv+27+na3peo9yzgI6XaEoMNW+ZGypmpcO2HxYQ1xkxPUHiltGgn4XvHui7eVgQ/1OlVG9Mg=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Kevin Tian <kevin.tian@intel.com>
Subject: [PATCH v3 3/4] iommu/vtd: rename io_apic_read_remap_rte() local variable
Date: Wed, 26 Jul 2023 14:55:07 +0200
Message-ID: <20230726125508.78704-4-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726125508.78704-1-roger.pau@citrix.com>
References: <20230726125508.78704-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0050.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:152::19) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|BN8PR03MB4964:EE_
X-MS-Office365-Filtering-Correlation-Id: 05c993ae-b706-4df8-95b6-08db8dd79a64
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	rsuX25YaLgty21Zgp56Twt61XV7LWbzdklqs/i8fD1PXS2ra2jxaZFMa4+gTRNKAeKgot4DLL29uF6Ne7SlEZwNUkMP0E7ZZ5G3B/gH8YBugGFU77DC+L6EmE4bH+0CnYVMMKwRVSTFZEGi0lyFh6LvVmHwmrI57Fj68ko00//aFAQB2XwJguNh9CTIKiu4RpxukUPaYsWEGZbMVicsNAwKhiLudRAJ6qBcUObix+FqFGSaZ5UykqUazrUj4TYAucHqWxz7epI8oJj5CKolcf9IvCS/yDPYeHEMP0AYnd3+HMI8DjfuNSejpM7Cx75t9nLmW5/1En/DM9eBbDlQndj9oBLOVIuXI6NROOkQNt7F20tMvFk6VLDabcTvytktR1eYeGmAQUSykgbFCLmmFops/jgpOQN6f1vEgr4dDj3lfZz3G/9OHRGDi4DC/5dVS+9xf1ahznzJ961JIEDs/vX2hpSBvIiRJ1gYGLyHAKFpAEiOJvpRXP+dOtW6wuo7pC5bpr++DyEZbY1aemRV3lQFo7HNwgY/bZP3v9k7h09h652xC0EBzJQEVbOn/Sfoc
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(136003)(396003)(346002)(366004)(451199021)(41300700001)(26005)(6506007)(478600001)(38100700002)(6512007)(86362001)(36756003)(6916009)(4326008)(8676002)(8936002)(186003)(316002)(66946007)(66476007)(66556008)(5660300002)(2906002)(2616005)(83380400001)(54906003)(82960400001)(6486002)(1076003)(6666004);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Sy84R01aQkJGRVRwR21KNGVYdlRlcFhKN1J5dWFZM1ZMem5yUWZrNVNVTHJJ?=
 =?utf-8?B?YUQzOUhLVEhJeWN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eaRR/sFlciyWJroC70kdGyKgaz9zC4kaw71X+E1nr10WdfM2YCbHL1rMs25w9IedCrwN6oYITkNO9bsN1cNgl0Kz1F1vCw64kZPEP9wPjlr2aRgbNagZggiT7hchXl3IOoiOk4jlauzcTKUkvnys8x+K8cqzf21cmJ9YviJJCr8+og9PgiBCwapNEcebeN1BsIzFXr+ieYrP7AIVruqzzHPjnFqrklwW0VX8PPaWWYaKZUkAiqKsSoCB/5/ZoROezzkyaoHVbcfrMgCzTTRWF/co
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 05c993ae-b706-4df8-95b6-08db8dd79a64
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 12:55:35.3066
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: MjQADlq0io1FZS6S7/+T7vvnOwwJgEwIvz5ujzl5HX+ySKJbPxMLz7ECB7btYP7FafmoEB9sNT4m9GgGysyMrQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR03MB4964

Preparatory change to unify the IO-APIC pin variable name between
io_apic_read_remap_rte() and amd_iommu_ioapic_update_ire(), so that
the local variable can be made a function parameter with the same name
across vendors.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
Changes since v1:
 - New in this version.
---
 xen/drivers/passthrough/vtd/intremap.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 786388b4d9c7..05df6d5759b1 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -441,14 +441,14 @@ unsigned int cf_check io_apic_read_remap_rte(
 void cf_check io_apic_write_remap_rte(
     unsigned int apic, unsigned int reg, unsigned int value)
 {
-    unsigned int ioapic_pin = (reg - 0x10) / 2;
+    unsigned int pin = (reg - 0x10) / 2;
     struct IO_xAPIC_route_entry old_rte = { };
     struct IO_APIC_route_remap_entry *remap_rte;
     unsigned int rte_upper = (reg & 1) ? 1 : 0;
     struct vtd_iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic));
     int saved_mask;
 
-    old_rte = __ioapic_read_entry(apic, ioapic_pin, true);
+    old_rte = __ioapic_read_entry(apic, pin, true);
 
     remap_rte = (struct IO_APIC_route_remap_entry *) &old_rte;
 
@@ -458,7 +458,7 @@ void cf_check io_apic_write_remap_rte(
     __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
     remap_rte->mask = saved_mask;
 
-    if ( ioapic_rte_to_remap_entry(iommu, apic, ioapic_pin,
+    if ( ioapic_rte_to_remap_entry(iommu, apic, pin,
                                    &old_rte, rte_upper, value) )
     {
         __io_apic_write(apic, reg, value);
@@ -468,7 +468,7 @@ void cf_check io_apic_write_remap_rte(
             __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
     }
     else
-        __ioapic_write_entry(apic, ioapic_pin, true, old_rte);
+        __ioapic_write_entry(apic, pin, true, old_rte);
 }
 
 static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 12:58:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 12:58:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570463.892268 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOe6F-00045o-Sl; Wed, 26 Jul 2023 12:58:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570463.892268; Wed, 26 Jul 2023 12:58:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOe6F-00045h-Q3; Wed, 26 Jul 2023 12:58:43 +0000
Received: by outflank-mailman (input) for mailman id 570463;
 Wed, 26 Jul 2023 12:58:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOe6E-00045V-Mp; Wed, 26 Jul 2023 12:58:42 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOe6E-00023P-Iw; Wed, 26 Jul 2023 12:58:42 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOe6E-0001WM-5K; Wed, 26 Jul 2023 12:58:42 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOe6E-0000P7-4q; Wed, 26 Jul 2023 12:58:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=mz4kfdIoBx/e0e2r9rX7cTDUaEbNUhbx2o1FKb2R5tQ=; b=bcUZDGOpLG2th1Hoj7V225rrgP
	6AxoAav9Qj9sPMdv7pxnYunf7pQ9/rJrrSIN81CaMhzM7h8RQl9qi9FeRP8lMTRFOUlnfnhdGIhHz
	5uKbZiit3FcFmfRlY9pbj2xZeMX+x5HZz/h9bmslwO9tOGr1yKWVkPSiaAH2pkNjBGhc=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182006-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 182006: tolerable FAIL - PUSHED
X-Osstest-Failures:
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=885fc169f09f5915ce037263d20a59eb226d473d
X-Osstest-Versions-That:
    qemuu=d1181d29370a4318a9f11ea92065bea6bb159f83
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 26 Jul 2023 12:58:42 +0000

flight 182006 qemu-mainline real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182006/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181952
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181952
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181952
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181952
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181952
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181952
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181952
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181952
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass

version targeted for testing:
 qemuu                885fc169f09f5915ce037263d20a59eb226d473d
baseline version:
 qemuu                d1181d29370a4318a9f11ea92065bea6bb159f83

Last test of basis   181952  2023-07-21 10:07:07 Z    5 days
Testing same since   181993  2023-07-24 13:37:28 Z    1 days    2 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alistair Francis <alistair.francis@wdc.com>
  Anton Johansson <anjo@rev.ng>
  Anushree Mathur <anushree.mathur@linux.vnet.ibm.com>
  Benjamin Gray <bgray@linux.ibm.com>
  Bin Meng <bmeng@tinylab.org>
  Conor Dooley <conor.dooley@microchip.com>
  Ilya Leoshkevich <iii@linux.ibm.com>
  Jordan Niethe <jniethe5@gmail.com>
  Luca Bonissi <qemu@bonslack.org>
  Michael Tokarev <mjt@tls.msk.ru>
  Peter Maydell <peter.maydell@linaro.org>
  Richard Henderson <richard.henderson@linaro.org>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/qemu-xen.git
   d1181d2937..885fc169f0  885fc169f09f5915ce037263d20a59eb226d473d -> upstream-tested


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 13:12:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 13:12:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570474.892277 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOeJY-0006ar-7c; Wed, 26 Jul 2023 13:12:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570474.892277; Wed, 26 Jul 2023 13:12:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOeJY-0006ak-53; Wed, 26 Jul 2023 13:12:28 +0000
Received: by outflank-mailman (input) for mailman id 570474;
 Wed, 26 Jul 2023 13:12:26 +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
 <SRS0=oEth=DM=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qOeJV-0006ac-Vv
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 13:12:26 +0000
Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com
 [2a00:1450:4864:20::52c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0f7ce240-2bb6-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 15:12:24 +0200 (CEST)
Received: by mail-ed1-x52c.google.com with SMTP id
 4fb4d7f45d1cf-5227799c224so786989a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 06:12:24 -0700 (PDT)
Received: from [192.168.202.116] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 g15-20020a056402180f00b0051e1660a34esm8723767edy.51.2023.07.26.06.12.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 06:12:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0f7ce240-2bb6-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690377143; x=1690981943;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=HDTniEgvf2D3va1x2sfnKodoK2X+DyoDT6DraSd22Dg=;
        b=ML9Wr4iWhZnLY1EatIOaEgf12T/vl7QeV7b5Zy9/PX8HEDL7ghHsPIqiBcymTTZeRF
         efO210jUTIt6Csk6zdKblQnuOEiC1c9DX3UybqMRaHW1ItfJjO/7RRE0fKqXuDjl/fTI
         p/Lf7/uTpWYFOxAxfS8yvCS6zd08UuXywPectf8kCL2zZlOF14s/R6U1X97hfEncUKSN
         sp3PDI0R8RTVsyhMUQoLXy2GhWMsrEuu0Ceje9gdjkJoFf/Aw/F6Suu3iTAl7JUldo5a
         PRJil4fKb6FvEnuWBe/RX7WLgf72EQNhH2xToefDTo/WoyQLMGPKwWJMr74wFZcu6KGA
         8WMg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690377143; x=1690981943;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=HDTniEgvf2D3va1x2sfnKodoK2X+DyoDT6DraSd22Dg=;
        b=ccz+HwyODKvXhfaJ20H1uWcf/hTuPH0wt4HKa7B59JzkbdnGAD/+mG8pFEmHUgMvmU
         lmgApbGUraakOOBcF1OovhHZg8VgqChOOYQeqLTrEFms8XgNB1NqigMdsNR/P67+Ei1c
         HzKMTMMz6J+qzlga57Nemis6fgkQ1PHuYJqZ85YcMfboMeYtZHVcMt8CVbNWZWxX/xCN
         C8nvxsdjPazjZ93iEY+sefZQA8zBhySjWUA2hcUMQH00kyIqvNIPkF1vJVmvjGE4qo3/
         Z4N79wMn6iw1pUdpRQO9/gfBdWT0cMMuoGah64h6SqK63CKAPWuTEvOkQuEOlbU+chdG
         FbNw==
X-Gm-Message-State: ABy/qLaVH4KMfvyn7k6MuRPjkv0tv4ToOGdE43PxvMljzUX3vhQ/Y6sr
	TkVnmyGX+P0ChbW10BFIFe8=
X-Google-Smtp-Source: APBJJlE96rbl/yWZnu2DQtd+GzkZJdtnaN+O/pzPHxSXe5H23ljhfBBwXdWGufbwmWWYVbjzSxSkiw==
X-Received: by 2002:a50:fc16:0:b0:522:3a89:a79d with SMTP id i22-20020a50fc16000000b005223a89a79dmr1391090edr.2.1690377143299;
        Wed, 26 Jul 2023 06:12:23 -0700 (PDT)
Message-ID: <4deb8c44cf639af66ad7f5b9b42180554e08d5cf.camel@gmail.com>
Subject: Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Bob Eshleman
	 <bobbyeshleman@gmail.com>, Alistair Francis <alistair.francis@wdc.com>, 
	Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
Date: Wed, 26 Jul 2023 16:12:22 +0300
In-Reply-To: <6675f535-7cf7-dd55-4ebe-82ba486029f7@suse.com>
References: <cover.1690191480.git.oleksii.kurochko@gmail.com>
	 <a8ab1829ab718dda869db3df3348ded211e81967.1690191480.git.oleksii.kurochko@gmail.com>
	 <a370548e30aaa8c1160ecd5f2eccfcc10002a8f9.camel@gmail.com>
	 <6675f535-7cf7-dd55-4ebe-82ba486029f7@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Wed, 2023-07-26 at 13:58 +0200, Jan Beulich wrote:
> On 26.07.2023 13:23, Oleksii wrote:
> > I would like to ask for advice on whether it would be easier, less
> > bug-
> > provoking ( during identity mapping to remove of whole Xen ) to
> > have a
> > separate identity section that won't be more than PAGE_SIZE.
>=20
> I'm afraid you can't safely do this in C, or at least not without
> further checking on what the compiler actually did.
>=20
> > @@ -264,6 +268,19 @@ void __init enable_mmu(void)
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0RV_STAGE1_MODE <=
< SATP_MODE_SHIFT);
> > =C2=A0}
> > =C2=A0
> > +void __attribute__((naked)) __section(".ident")
> > turn_on_mmu(unsigned
> > long ra)
>=20
> Did you read what gcc doc says about "naked"? Extended asm() isn't
> supported there. Since ...
>=20
> > +{
> > + =C2=A0 =C2=A0/* Ensure page table writes precede loading the SATP */
> > + =C2=A0 =C2=A0sfence_vma();
> > +
> > + =C2=A0 =C2=A0/* Enable the MMU and load the new pagetable for Xen */
> > + =C2=A0 =C2=A0csr_write(CSR_SATP,
> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PFN_DOWN((unsigned lo=
ng)stage1_pgtbl_root) |
> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0RV_STAGE1_MODE << SAT=
P_MODE_SHIFT);
> > +
> > + =C2=A0 =C2=A0asm volatile( "jr %0\n" : : "r"(ra) );
> > +}
>=20
> ... none of this really requires C, I think we're at the point where
> (iirc) Andrew's and my suggestion wants following, moving this to
> assembly code (at which point it doesn't need to be a separate
> function). You can still build page tables in C, of course. (Likely
> you then also won't need a separate section; some minimal alignment
> guarantees ought to suffice to make sure the critical code is
> confined to a single page.)

Thanks. I'll move all of this to assembly code.
Regarding alignment it is needed alignment on start and end of
function:
    .balign PAGE_SIZE
    GLOBAL(turn_on_mmu)
        ...
    .balign PAGE_SIZE
    ENDPROC(turn_on_mmu)

Does the better way exist?

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 13:37:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 13:37:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570479.892288 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOehl-0000hC-0c; Wed, 26 Jul 2023 13:37:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570479.892288; Wed, 26 Jul 2023 13:37:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOehk-0000h5-TT; Wed, 26 Jul 2023 13:37:28 +0000
Received: by outflank-mailman (input) for mailman id 570479;
 Wed, 26 Jul 2023 13:37:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CD/9=DM=citrix.com=prvs=564dce665=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOehj-0000gz-S2
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 13:37:27 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8e20f85a-2bb9-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 15:37:26 +0200 (CEST)
Received: from mail-dm6nam04lp2040.outbound.protection.outlook.com (HELO
 NAM04-DM6-obe.outbound.protection.outlook.com) ([104.47.73.40])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 26 Jul 2023 09:37:19 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by PH0PR03MB6592.namprd03.prod.outlook.com (2603:10b6:510:bb::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 13:37:17 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023
 13:37:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8e20f85a-2bb9-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690378646;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=9KVJiarTHFwOuGunmlfrn9vJfXfousl960l8fHxPWTA=;
  b=SQ8Jt9xfepY6KULBr81E1UDkE+xOIoEKIeZSnR7TYcPUEvITi4I6UEUA
   FqsPUI5fVIi8wf8i2QR7r9xdqsP72e0nPDZbktAxYWefenv+Gtc9jHwAs
   twKPWkwcALbdkQBrDciimn7C+7kIzJxxKk9b5M1hA72ksbVVz4wzFZSCx
   4=;
X-IronPort-RemoteIP: 104.47.73.40
X-IronPort-MID: 116799156
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:9RB8fa5ePRGCJjgktAx6NgxRtP3GchMFZxGqfqrLsTDasY5as4F+v
 mcXWm2PPf2JNDTze4gjb4rg/BsH7JTSx4VlTlZq+3hhHi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q?9a23=3AUvhXaw1qYXUlHPDmb+/97AEmDTUj+5nyD2ECu5Y?=
 =?us-ascii?q?6tuaGCnRwFGum0muva9py?=
X-IronPort-AV: E=Sophos;i="6.01,232,1684814400"; 
   d="scan'208";a="116799156"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KEgZPc3iUetaGkRwje5bqbms9oo1Mr0OHqEEnv4EHwCPyB7Sy3hxhBWX8Y+u2XCwrPUCUYpwl+AdeWHZWUCjwrYUoeJhaTIREiugxRvtqHp76UU1XLaW2VoptUFb3avbsz8hu8sR3bDZM0vLf0NSDfWbEXoSA0ruOPK7tEwyGoMbYLP8zANvwj5STHcSKArUEpkbtOyb9Oif7Wx4pUQqtfo8wmC9ycoS58w8xEtUq6qxnhE126vptaHyM6Zuh9TZ7JErCFf8lh3cxXILLT151nvAkE+nsCs0goPj5lVcBhrlykbFlrAKo+KvM2dPehIl48vC1YtaK9DGK8llbn2NkQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Ej03+lMAaLOLBjlUuvv0T0UXsgOo/q90Ko3UE49jVZ8=;
 b=fRz77yjB2JwKjhPm0qFrwdb/gbPadBm7KE2D+01P2TfJ6hrtRddjk1mRA9R6DjNLZ/+GikyS5gEXB4Qp9j/iOW0nas+neEk9Zz0GGy+KCnKDj3kZzONoaV7Pkh2eoTEcNyXFeZmZM1TcrUmfYmt0D5Uur4TMw+43ZUvjgZq6ukR7g0BPdxpejaR3nJR1EkKamRGX9VDxteD4neS3VQ+rcPGV48/JjqLR52fAiIE76fRbv34M3iE99zNSGMJ6s3xeEq8TrzssUXtGlJIhtWg1i20HwvsGc3bLCb2gZTWTnw69T66blSFoHmaAQDoLhKpi5UwuU8TVIYGmq3DqPuEnBw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Ej03+lMAaLOLBjlUuvv0T0UXsgOo/q90Ko3UE49jVZ8=;
 b=to3gmp/CtHTz7qDDRYhryiTT8RrpTp+Hr8Q+nCzkIFZcYT1m3Mtg9My5GOuxVSRkPBBhPtOWesacECb2PZSoKIA4sZfaweQOM8qdzEyCjSn7aq4Tj8UGhiTTrkUjXDiB20Ob4hMMFjrqgTqIsLzEtdsJWDdYCpb/t6IhBYOl640=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Wed, 26 Jul 2023 15:37:11 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] vpci: add permission checks to map_range()
Message-ID: <ZMEhhxE-ozW3eYYx@MacBook-Air-de-Roger.local>
References: <20230724153741.42374-1-roger.pau@citrix.com>
 <5292942c-17b4-6b7b-a1a9-fdec87418379@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <5292942c-17b4-6b7b-a1a9-fdec87418379@suse.com>
X-ClientProxiedBy: LO4P265CA0006.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2ad::20) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|PH0PR03MB6592:EE_
X-MS-Office365-Filtering-Correlation-Id: ac325e0b-4eb5-4af8-88ac-08db8ddd6d5f
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	TlDp0dHW4jU9NAiH5JCmVyPFZZNPSrw1xTQbjSqgjBPNfdheDjUz/tCpNh+uw3mLk6tzTB96nMC+ZWHPjMMaGYMH9tpP+onexkmvqunqOCUTxHUOGsMshmgbdaL9jTJM6SZkLs68EY4GP1l1KFS8HEuI10mKWwNkH0mpAp3bhGbMLr8eGmvXYGg45zToLXVOCjbLDBKe1nYVfLdPMLNz/4wx6+521wLKNLqFnUvayEXnbUBx95XnW04GjrdFXb1Pji4lYVUS1RLwCSRB2tCKXmoJ1fGLDiyj3A/U8mNvd+6/fcq7qJlHGIHWpeqZoKEDqBK1XAD9x2HoyE+SSver8LsUhwepzwCLbjhAbKL+wQycPtd3IoxVqE2j1Ne3ap8Cho78d49x1hfUCRREacm0pozX4ngi65Dxw85mbrWFKPjmf3Y64lH7Ia0Hidxne8+WqPIW+K4EtfaqgXLp5dYgqYS32DXZCqQqNYffnG2PwAYHWVXRJuQ1o7coAZrFC79Wvh8GJilNX8mfb4zFFpKt8ghtidURGvVejQYUhhqJOgPEByeWUD37Bzqlublo3X4O
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(366004)(346002)(376002)(396003)(451199021)(9686003)(6486002)(54906003)(6512007)(6666004)(478600001)(66476007)(53546011)(26005)(186003)(6506007)(2906002)(66556008)(66946007)(6916009)(4326008)(316002)(8936002)(5660300002)(8676002)(41300700001)(82960400001)(38100700002)(85182001)(86362001)(83380400001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?S2JFTzJTeE9YZDFsVTdGVXB0Yk05c0NhVFh4Ukc3V2VlZWRlc1NUYUp1bDJr?=
 =?utf-8?B?bVJ5TmlPaEcxWDYyaFhOQnFJRTh5UUdzVUZYOGh0WXZSLzUwaTNwS1U3NDBv?=
 =?utf-8?B?NVhqNjE5UmhZNEx0dFNnb1pYWS80ZEpnNjFyYm05T0tudllBWVdjclNNTVVD?=
 =?utf-8?B?RTBlb0VjbExPSjR1U1AwM2EzdXFPNXhmRi85ZTFxSFl3UlVWT2xnd0Z3OG5m?=
 =?utf-8?B?UGt3WlpQeGZCVFRDeEpMYTV5Zk9XcjlRN0FaUnRQbGlDVGdDZFRLUE02M0Nk?=
 =?utf-8?B?Q2MwNVpwUGNiSUdtbnc4YnUrMUpVVkpZb0pLcXk5TUphenFlT3I1aTVzaDBt?=
 =?utf-8?B?dWtpZ09sai9yTGpOL1N1dDZKVDJjUnh1ZHNpVW03NTR6SXAzZUpBTm5Cdlcz?=
 =?utf-8?B?eUsyY1gvTmZkYzRvMkVPNkRsdCtOU1p1QnUvKzRVS0tGNW9QdVgzZXk4T3hs?=
 =?utf-8?B?REgvSFpSdzU3MjNtdDZIRFVNS01JZXY3eXI5aERkMWp0S1ZvRHRNTVRweU5W?=
 =?utf-8?B?OXhVYThKL3pBaDZtL29ZSDNIT0pMMTBwYUpKaUNzTUhVRWFmcS9uaVZYZWly?=
 =?utf-8?B?cTNvWjNaZ2tJOXhZejIxSUpxWFZtOUN3T2FTcHE2ZjN0MHdTUXBRdDdUcjd1?=
 =?utf-8?B?S0hLSDdhK3pUUTVEWXBhQkZYUWNRWXVqdGlFQ3pIam9ScEMvSlNWMGJMdi9Z?=
 =?utf-8?B?RGN4eFJESW5i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XVV6KIvRg0naDMSOFYlhNYgI/nrxIv9d3SJSQZwHyf7KWhzynWP6ODtH6iJYpTmM+DNdAqWC9/QQsy0bbBbmogp2e8OitDECLwGszzd2lzvhGdVY7bodHQAJuv47QGAZuAJBFabZdXpw4cT2fkDQWcSuELUv7sk7pTTtV7vREIz1ggMDWEfF0GY8ViQ4M+HbuReamKtGiDM3vwkCMI7Saj08fNLRktUzkaIHLlzavRRJ8CRtqsbWsv7KOTk/bKZpGOWkSXYlAUKYbJelM1zD8WkD89MRH5BkvkEUZ7qFMhKokQwPbyuHa6h045eg6xoPeXzguGQiLnFKFGuDpF1ycFrWGJxoufaq6z+b19DDIYLCHmTgHlsTMfqniu2YpZaG9BRs0G7+rw8OlGJCZzamA7a4zamqIii4Sx0C2EUcAk8tGEHoGu0HoYstMJyORK1T0mXDbTMUCDSnRwvZYd/hPzqzUTa4HfdTv1AD/LWalAePqjVzRWRSN+u1H9gNS1KZ0/NF+ttVnEmmwgQZoqprYJfKG25u5ml1ny90/jTAOaJbBKkSssdVbseMxUFzED9w9VWzyTzgXFNFxUBGeI+hJAOq6DhgYZNKQ42Vp+9sWaab19RxuRsk
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ac325e0b-4eb5-4af8-88ac-08db8ddd6d5f
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 13:37:16.7897
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 2K4TR95pgTwNnFQWXyCzNDWGZtu+5cXtrQtclqfp2479oIdwt1HAxxgttNGwosQL2//NDdA4EwSCxIp1hp2Wdg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB6592

On Wed, Jul 26, 2023 at 02:36:17PM +0200, Jan Beulich wrote:
> On 24.07.2023 17:37, Roger Pau Monne wrote:
> > @@ -1184,6 +1177,20 @@ int __init dom0_construct_pvh(struct domain *d, const module_t *image,
> >  
> >      printk(XENLOG_INFO "*** Building a PVH Dom%d ***\n", d->domain_id);
> >  
> > +    if ( is_hardware_domain(d) )
> > +    {
> > +        /*
> > +         * Setup permissions early so that calls to add MMIO regions to the
> > +         * p2m as part of vPCI setup don't fail due to permission checks.
> > +         */
> > +        rc = dom0_setup_permissions(d);
> > +        if ( rc )
> > +        {
> > +            printk("%pd unable to setup permissions: %d\n", d, rc);
> 
> The switch from panic() to printk() may want mentioning in the description
> as deliberate. (The usefulness of %pd here is debatable, as it can't be
> other than Dom0. But I don't mind.)

The printk just above uses Dom%d, so I assumed it was best to not
hardcode 0 here either.

> > @@ -43,6 +46,21 @@ static int cf_check map_range(
> >      {
> >          unsigned long size = e - s + 1;
> >  
> > +        if ( !iomem_access_permitted(map->d, s, e) )
> > +        {
> > +            gprintk(XENLOG_WARNING,
> > +                    "%pd denied access to MMIO range [%#lx, %#lx]\n", s, e);
> 
> This doesn't look like it would compile. Also gprintk() logs current,
> which I'm not sure is generally applicable here. IOW I think it wants
> to be
> 
>             printk(XENLOG_G_WARNING,
>                    "%pd denied access to MMIO range [%#lx, %#lx]\n",
>                    map->d, s, e);
> 
> Same for the other log message then.

Oh great.  I changed the format of those before sending and didn't
rebuild properly.

> Another Dom0 related concern can probably be put off until we actually
> get a report of this failing (which may be more likely because of the
> XSM check below): The function being used as a callback passed to
> rangeset_consume_ranges(), failure may affect just a single BAR, while
> the incoming range may cover multiple of them in one go. Depending on
> what functionality such a BAR covers, the device may remain usable (a
> typical example of what I'm thinking of is a multi-function device
> having serial and/or parallel port on it, which are fine to be driven
> via I/O ports even if driving via MMIO is possible [and would likely
> be more efficient]). Of course, to allow some MMIO bars to be used
> while prohibiting use of some others, further trickery may be needed.
> But not exposing the device to Dom0 at all doesn't seem very nice in
> such a case.

Hm, I see.  For dom0 we might want to consider ignoring mapping
failures, the problem is that we would need to narrow down the pages
not allowed to be mapped, as part of the range passed to map_range()
might be allowed.  We would need to resort to checking permissions on
a page by page basis, which is not overly nice.

I think it's more likely for such BARs to be marked as read-only
(instead of denying access), in which case the checking here would
still be OK.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 13:59:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 13:59:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570490.892297 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOf2i-0003AG-O6; Wed, 26 Jul 2023 13:59:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570490.892297; Wed, 26 Jul 2023 13:59:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOf2i-0003A9-Kw; Wed, 26 Jul 2023 13:59:08 +0000
Received: by outflank-mailman (input) for mailman id 570490;
 Wed, 26 Jul 2023 13:59:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+seJ=DM=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qOf2h-0003A3-83
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 13:59:07 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9554d16d-2bbc-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 15:59:05 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.163.229.19])
 by support.bugseng.com (Postfix) with ESMTPSA id 26F2E4EE0738;
 Wed, 26 Jul 2023 15:59:04 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9554d16d-2bbc-11ee-b242-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH] xen/kernel: change parameter name in add_taint() definition
Date: Wed, 26 Jul 2023 15:58:55 +0200
Message-Id: <5692c7c51de63d67865208be2be7bf011f171540.1690378948.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Change parameter name from 'flag' to 'taint' for consistency with
the corresponding declaration.
This addresses a violation of MISRA C:2012 Rule 8.3: "All declarations
of an object or function shall use the same names and type qualifiers".

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/common/kernel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index 719b08d6c7..fb919f3d9c 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -397,9 +397,9 @@ char *print_tainted(char *str)
     return str;
 }
 
-void add_taint(unsigned int flag)
+void add_taint(unsigned int taint)
 {
-    tainted |= flag;
+    tainted |= taint;
 }
 
 extern const initcall_t __initcall_start[], __presmp_initcall_end[],
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 14:05:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 14:05:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570495.892307 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOf8m-0004iH-C0; Wed, 26 Jul 2023 14:05:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570495.892307; Wed, 26 Jul 2023 14:05:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOf8m-0004iA-9S; Wed, 26 Jul 2023 14:05:24 +0000
Received: by outflank-mailman (input) for mailman id 570495;
 Wed, 26 Jul 2023 14:05:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CD/9=DM=citrix.com=prvs=564dce665=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOf8k-0004i4-U6
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 14:05:23 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 737ec043-2bbd-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 16:05:20 +0200 (CEST)
Received: from mail-mw2nam10lp2106.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.106])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 26 Jul 2023 10:04:37 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by DM6PR03MB5242.namprd03.prod.outlook.com (2603:10b6:5:22a::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 14:04:29 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023
 14:04:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 737ec043-2bbd-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690380320;
  h=from:to:cc:subject:date:message-id:
   content-transfer-encoding:mime-version;
  bh=l7UNq7uk8x9OS9jS6u08AWpWKBlKLaFvY3Qe8MW629E=;
  b=YDM47ZUj2iGY5UGY5/a6+AZ8seXLcuVpKsp6hMVBW0mTeY/IZjMaTNwj
   cd2MH/bfeu9pUzS0KkNiES13mhvckiV6nSby02rY/wHUB6TL3mfjhc3oo
   TWWf25Eb0M2ameelhpVvxQ1noIb4Pd0R8dMh0kf31FRKIZHieExKglt38
   M=;
X-IronPort-RemoteIP: 104.47.55.106
X-IronPort-MID: 117947617
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:FP5kVqP6C/g//5fvrR1ilsFynXyQoLVcMsEvi/4bfWQNrUp31TcOm
 2dJWmmBafjcZ2enL4hwao6woUkDuJLRytZrTgto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v
 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/
 Nj/uKUzAnf8s9JPGjxSs/vrRC9H5qyo42tH5AJmPJingXeF/5UrJMNHTU2OByOQrrl8RoaSW
 +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ
 HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0s8mClwQy
 61EFGFOR06tlri43Y6HbMA506zPLOGzVG8ekldJ6GiBSNMZG9XESaiM4sJE1jAtgMwIBezZe
 8cSdTtoalLHfgFLPVAUTpk5mY9EhFGmK2Ee9A3T+PdxujCNpOBy+OGF3N79YNuFSN8Thk+Fj
 mnH4374ElcRM9n3JT+tqyvz17OQw3qkMG4UPKSSqKNTj3PM/2YsUScUaUueueu5k1HrDrqzL
 GRRoELCt5Ma5EGtC9XwQRC8iHqFpQIHHcpdFfUg7wOAwbaS5ByWbkAGRDNcbN0ttOctWCcnk
 FSOmrvBGjhHoLCTD3WH+d+8oSupPCkJLUcLfSIeURYe+N7nvZ0yiRTUCN1kFcaIYsbdHDjxx
 3WPs3I4jrBK1coTjfzjoxbAni6moYXPQkgt/ALLU2m57wR/Iom4e4iv7lud5vFFRGqEcmS8U
 LE/s5D2xIgz4VulxXflrDkldF1x28u4DQ==
IronPort-HdrOrdr: A9a23:8zWlpahXXnDNAJVQcMmslRyFCXBQXh4ji2hC6mlwRA09TyX5ra
 2TdZUgpHrJYVMqMk3I9uruBEDtex3hHP1OkOss1NWZPDUO0VHARO1fBOPZqAEIcBeOldK1u5
 0AT0B/YueAd2STj6zBkXSF+wBL+qj6zEiq792usEuEVWtRGsVdB58SMHfiLqVxLjM2YqYRJd
 6nyedsgSGvQngTZtTTPAh/YwCSz+e78q4PeHQ9dmca1DU=
X-Talos-CUID: =?us-ascii?q?9a23=3AN8QWJmnqgCh3zRWvkoG1vyywYuLXOVSMx0qOHR7?=
 =?us-ascii?q?kNTcqYeO7WAWe5Z9YteM7zg=3D=3D?=
X-Talos-MUID: =?us-ascii?q?9a23=3AALHENgzgIVavSkL3LN8ELm/FfWaaqL2EVh00nrt?=
 =?us-ascii?q?ZgsO7bBZyBye4lCa3W5Byfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,232,1684814400"; 
   d="scan'208";a="117947617"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CJkaluvpG2ezqjsppayi5Fs3WQOp1OicuyqkP73nUCAgvu6TD2Q3j07fzQW5ph1Ug7NjWYI7F5VDFEtrrjyWA0GfxwLRacJVyYNpeW/Re/AZ+1VQlL63N8+4faqJTXwWfxX5v39batCAe3rJile72ekNIE32WMY3PCAf4jNGxDPMVXXVSCkr0TkHY0bhWHCDug//tCIzPOGE7NsYbJxgMeljvJFbgrbhx/g1psDpQvPzw5PBGHMKMQMvrf0E6atmUu8qdRZn4CFBKAXKJA3KZYOypxXEnoi3iTKPFcCHWRw86IhbwQLJJNY5NqpZ4YQJtAEwfiQQuTpYH2awkP7wVg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MnEWWUfvOcmz8ybJ8ODIiL5aPtA3hSbeJIbuVR3sO7s=;
 b=NT+mI7Bu1Ajs/aH3XgblI8S7/hE/fqGpab4YUZ3r2iyt29JwHhsIfKFVE99YENkRBiUAlmOUMqa11x4eYjWshU/pU76G/QgFSD9kJFLoPz5L9ZDGqsLypQGMBSIidB6tBXVXCtuzhRwk8C0bMEWhAPCt7h9dbUNgvUS6X1wxzGpWoLS38AMSuYcNegd4HQenIqOqeWsnjy1/IiWfMK/ySNzWhvyTrL/ME101jbjFyOgq0Wt7AReWqAUmsOv9ecRnrJheYCoMrxlvrRl6DQMwNz+BrZnH8qxJzCtzWRNF1hF3z7FANk2rDO27V0lV//g/JlkVY3w1Z7CKq2/SM9WrWQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MnEWWUfvOcmz8ybJ8ODIiL5aPtA3hSbeJIbuVR3sO7s=;
 b=oXtULbFBY/0PhwW7CS6HjwDGL8ZOrw9c8HSa8TDQRShFI3QkAU2RTpfK5DWgi0NkCP3zxI2LN54F3sz5DCg450TeYP7rHlUatnPzy4zXedi8oPmTz8wR5VDYOZtpZoEMk2jeQ7MSaVTY/KSddMfWRUsVyQIGwPklJX1IxZgvTO8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: [PATCH v2] vpci: add permission checks to map_range()
Date: Wed, 26 Jul 2023 16:01:32 +0200
Message-ID: <20230726140132.80151-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P302CA0029.GBRP302.PROD.OUTLOOK.COM
 (2603:10a6:600:2c1::20) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|DM6PR03MB5242:EE_
X-MS-Office365-Filtering-Correlation-Id: d26634b0-126c-4cfc-045c-08db8de13a13
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	pyyBYVUfyWWz/pB76cKERneo2gAdVQUQexLiQlgowHIkSMtw3NMxe8dfDtTbeOx607TLduDI3CntyvICZisft0gM3AenQPKNZ+ufdutBTUzhfoFpfKlCCrVAe8JOxow09Dmm8QjvwtxKw+seliSOjj4JnXyIzaIQpTDjNaTssKHIp6VahWk/ZWApb2s/3LvwMdA3BFRT6SIWxAgMhzFLR4IlEOoGHp2aClYoLT4hrHpiQ9vYU3tZIzrCBXqii3kyszj4RxvbzWXMwD22c/ruSj1W70TWCxO0duXhyFgyOiAErxz5gIh3A8MXQ5hBZZCWn0OBvx218mE5hgVatdgsGYNujm1ZPu/Y+rtH6xLRc7boK06BlUi7C2LgLBcccRMUIIuWr4576tRrMH+Yq/MDwrRcTpIDthv7Jauc7Q4ErOd8rtk8jV14hADLT68fI2NGcmgF+Rpw2RR/ONEb2c/0jUEyDMlMDmaV+TbacXrBR63p6ovSJsL+zNYBxoCnsY5OwdIBq7hLwjFAm7/ebRT0Z557LZP5/Tx7Q+jXek/5zMI=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(136003)(396003)(346002)(366004)(451199021)(41300700001)(26005)(6506007)(478600001)(38100700002)(6512007)(86362001)(36756003)(6916009)(4326008)(8676002)(8936002)(186003)(316002)(66946007)(66476007)(66556008)(5660300002)(2906002)(2616005)(83380400001)(54906003)(82960400001)(6486002)(1076003)(6666004);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SDVwa29DcVYwdENUQW1EV1lDdWFtODRFK3pncDNtV0hRTW5oVmZtcmR5YVBI?=
 =?utf-8?B?NG10OWJab01DSm9Qejk3REdOcTB0NVcrQWdEdUJDV0VhZzBEdVJ1VC9RWDFZ?=
 =?utf-8?B?MTBCTndUYnMxRGFTclZTcHUybzJNSUtsR1pHdjFVS0J6UG1VZXpGM2JQdE9a?=
 =?utf-8?B?bU1qUEFYL3MzVW84cDhvQVNVcW9EcWZJR0t2RzFGclEwckpoL0JaT2M4RUpQ?=
 =?utf-8?B?V3RqcFArUTR4b3hBQlRoZ0dDOWJpNTYvdFowSFJ0YXF5R2lsRkRIMCtjQks5?=
 =?utf-8?B?bUE4SHRtb0RKOUFIRS9vRmx6cXEybTlOc0VvUlBncE5abGdOblp1ZnFKVDlU?=
 =?utf-8?B?bk1WK09IUXFESFhGTTFIcWxjUEZKK3Z4cVBWaWp2eHZMcnpZTU5EV3N4Nms5?=
 =?utf-8?B?NDJRWnM2RjVyeUVLNGZGeHJJVTVnZUl5RU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-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	JfLykDCZhqvO5lqUVpcO2g8VrOrNq0rGALISeeCAHcrChqoXeo+PJrpW9JMCeptwUT8D34y/U5hxcMB8AZfsMHlOxk7d/4YG/7FJ7DlIq0x+GN2W08JFO264yTudfZam0Aqz6t3jZ6OcIv8blu+4lxCkaxUsN3QcMUI2AsC0UOdvyaIm8mfRk/GUFaDD/rYi6xI7e6aOFp0kdr4cmZ1zwTRmQ3bPlAM50b5femz2pn9WmyOm82T0XTtawH7zjOBjGkxWC2ZVvGA/mmOzBrJ0ZK8LYSOMdXBohnecCJGGWLyUCuS7/74ihL8SjuFhqQNAWqcH0dSwDNc6xelAiFrMefTnuBZvcbMgL0PhRM7bHxfZiVUe9vfC6sdWDoOiT3I80nLmoz50hN0UFLEi6nB7dADBtVx4KmvdaGgENXRBJ3PLUNuFjWo7DvJKBYuGSVTqn/jDOMN4S6rY0HSFHtEn+9DOcawAGFKR3Ke/274iXkRcM25df8aefLOD4vWnmhFGNHkknaNTuQMMke5aT1uIIA5jW9l76AoaOo8kOZMXfRDYdxY2sORPImlLnnbkrgoGR1Wjcy6stH3UuxAZtzjW8kZL91mg/3MiJOWdRnDP6ZOxRB0JkYBYsp63qhF+WFvLXBTb/Cxd2c258XMB2pXMnYYNuF6hpz3qdCv2OvPdIKebe98REkLdCnOVip+kDjxWQEhbRv/EnCSUiwLx6UT/thyQA4kuAFdGhN/8h1kywvlfp38TJpsjQM5WlFGgDrL0IEkJiBAQgoqFtSu6CT1I2nQOm6R7pIr6L0p/TRz/OshNZwXjb0nmV0BsIJCvk/X3zoBtQMRqTYnYv16oNsZ1IW5LNVITwyjj30ERo/Ax4QmtVFxOBCjvIiYVAosfBxo/
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d26634b0-126c-4cfc-045c-08db8de13a13
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 14:04:28.7326
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: IehIX2qfpIgILrs22kH+AdL9akhUASLx0fTKVj6VqpZyG+Oia+gMx4SXWwijwIZPqbGPKdqjZGUphcZSspV0jA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB5242

Just like it's done for the XEN_DOMCTL_memory_mapping hypercall, add
the permissions checks to vPCI map_range(), which is used to map the
BARs into the domain p2m.

Adding those checks requires that for x86 PVH hardware domain builder
the permissions are set before initializing the IOMMU, or else
attempts to initialize vPCI done as part of IOMMU device setup will
fail due to missing permissions to create the BAR mappings.

While moving the call to dom0_setup_permissions() convert the panic()
used for error handling to a printk, the caller will already panic if
required.

Fixes: 9c244fdef7e7 ('vpci: add header handlers')
Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
Changes since v1:
 - Fix printk calls.
 - Expand commit message.
---
I'm unsure whether on ARM MMIO permissions are properly set for the
hardware domain, but I don't have a system to test with.
---
 xen/arch/x86/hvm/dom0_build.c | 21 ++++++++++++++-------
 xen/drivers/vpci/header.c     | 20 ++++++++++++++++++++
 2 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index a7ae9c3b046e..bc0e290db612 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -715,13 +715,6 @@ static int __init pvh_setup_cpus(struct domain *d, paddr_t entry,
         return rc;
     }
 
-    rc = dom0_setup_permissions(d);
-    if ( rc )
-    {
-        panic("Unable to setup Dom0 permissions: %d\n", rc);
-        return rc;
-    }
-
     update_domain_wallclock_time(d);
 
     v->is_initialised = 1;
@@ -1184,6 +1177,20 @@ int __init dom0_construct_pvh(struct domain *d, const module_t *image,
 
     printk(XENLOG_INFO "*** Building a PVH Dom%d ***\n", d->domain_id);
 
+    if ( is_hardware_domain(d) )
+    {
+        /*
+         * Setup permissions early so that calls to add MMIO regions to the
+         * p2m as part of vPCI setup don't fail due to permission checks.
+         */
+        rc = dom0_setup_permissions(d);
+        if ( rc )
+        {
+            printk("%pd unable to setup permissions: %d\n", d, rc);
+            return rc;
+        }
+    }
+
     /*
      * NB: MMCFG initialization needs to be performed before iommu
      * initialization so the iommu code can fetch the MMCFG regions used by the
diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index b41556d00746..60f7049e3498 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -17,10 +17,13 @@
  * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <xen/iocap.h>
 #include <xen/sched.h>
 #include <xen/softirq.h>
 #include <xen/vpci.h>
 
+#include <xsm/xsm.h>
+
 #include <asm/event.h>
 #include <asm/p2m.h>
 
@@ -43,6 +46,23 @@ static int cf_check map_range(
     {
         unsigned long size = e - s + 1;
 
+        if ( !iomem_access_permitted(map->d, s, e) )
+        {
+            printk(XENLOG_G_WARNING
+                   "%pd denied access to MMIO range [%#lx, %#lx]\n",
+                   map->d, s, e);
+            return -EPERM;
+        }
+
+        rc = xsm_iomem_mapping(XSM_HOOK, map->d, s, e, map->map);
+        if ( rc )
+        {
+            printk(XENLOG_G_WARNING
+                   "%pd XSM denied access to MMIO range [%#lx, %#lx]: %d\n",
+                   map->d, s, e, rc);
+            return rc;
+        }
+
         /*
          * ARM TODOs:
          * - On ARM whether the memory is prefetchable or not should be passed
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 14:12:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 14:12:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570499.892317 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOfFq-0006EH-7l; Wed, 26 Jul 2023 14:12:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570499.892317; Wed, 26 Jul 2023 14:12:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOfFq-0006EA-4y; Wed, 26 Jul 2023 14:12:42 +0000
Received: by outflank-mailman (input) for mailman id 570499;
 Wed, 26 Jul 2023 14:12:41 +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 <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOfFp-0006E4-82
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 14:12:41 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0601.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::601])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7a1906c7-2bbe-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 16:12:39 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB8462.eurprd04.prod.outlook.com (2603:10a6:10:2cd::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 14:12:36 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 14:12:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7a1906c7-2bbe-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BFbtVzY+lOxBNKxHP9noVnCaslLnjjhyiy1LikHNUDj3cdaEc6EWjk27RgCn7dQ3DKx1mTrdKewSzmiBSfS/3OuG7TF0BlY6nTGOf65l/9sdQOk8OJ9Jvh/LhXxrUMr39MjqzUeoXNTOu9i8/9Umfd9EnKftYejtUFw1Ux0Z0AskQe771yC0cbwtIKP/R3sf1UHlbn3i6by1t54pTVakLmGLOgKrSyF2rSqVgDsiQFhX11xKHvYEw2/dtCxsyp9B+WDaQwpSitYaK1t9oCz3EI/1uWMEzVCOJpbSPwp3VVQnHsRvmXEwToB0S+EkA0+3aWlZRhDznnDLz4tjRnrhSw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=jL04yurkGtyz156fGqsgNZlRHShJIqC5zxFWErY8//w=;
 b=BNynR19gfscgROrE7k6d3D3wajRO4T8L6v8Gez2PM7j/I6fR+/53BMvZ9XGcYwye6wGDt2JopIXPSJ4+6V5he4/6OrqNkpkj5ZD0TbuEu+76Xnn+mvVBW4ewIwnDWUF7xq7I+5qbM5mgYzbNZE6UBOjagjOseq4Zk/MW01mMqn41rf1x1FAm3SASjFlpoOEr0dQzzFsyvsKxzgqnofz3+DQmcvSoIq5Tj5jGw+s4Y0cd4O0H4jHCuWpv3jjSQNMZAA/0c2knpGsJ5Bpa5S6OVZeIDKBPiIOw2FDUVfak5Rj9lsPvRHZgLahtJtIsn3CFJIqgC7tsXvFOdcxBrcwk9g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=jL04yurkGtyz156fGqsgNZlRHShJIqC5zxFWErY8//w=;
 b=vVMPdeXCc9yoHkNAHaiXeA/k0TPgPxRh7j5Cw3Tm4zOcnqyRSnHO4jrnPIHpU3CLMeXkwpKqVXs2w51rcihQvX/p/slWHkJI6oRfsfiJ1zmR8ZYjD715GhtJAOACZ1/auD+0RnGF2vzhTOV5SSIHklA+6fLYO4dCVYHeOM/b2eNP4tYW0sCSXZSAvDrXBHo4QozBsFrDJNEF7k3mWezGdp1QFBrVe2X7Idw19MTYVPtWV32xKmEALgP5pbsVdo8Vn0EO3w3H36Qb5FrdLlRwY8Ok6Zha/OaZ3gRDaa2vbuE2mvXmPVzd3uQAFNkVRaI3N+nmS9A44RY+0jfXVbwF6g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <4cffbfd2-b452-42e5-cafa-8a72ac9ce33c@suse.com>
Date: Wed, 26 Jul 2023 16:12:34 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] vpci: add permission checks to map_range()
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <20230724153741.42374-1-roger.pau@citrix.com>
 <5292942c-17b4-6b7b-a1a9-fdec87418379@suse.com>
 <ZMEhhxE-ozW3eYYx@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZMEhhxE-ozW3eYYx@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0094.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a9::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB8462:EE_
X-MS-Office365-Filtering-Correlation-Id: 0471ace6-6850-4c1e-dcea-08db8de25cfd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	M/wQxQwn8hwMDRNgx+oG2PizmXyPO8pJqK4fctPRaOV/hb9O2WlL4kWpMT1+1YiyHvRn23M+qED7Vg2DAhoQOWejnDUohQkAdFnuzgXGkXVHiYoD0BtyuetjkUs4LkeFlCT+tg27BollG/u0Mj1ZcnT3znolPVwU5Qug9l94VM8HPCTn0DPYwm2SZ94kPigshIUfYZpWStAjZX0HmTfe6RNlwNsRaOCPIJLyUjX4eNB2eItQnudfJWRn7Xb7S1LhQvmxe/BbuO2W7CgUEDHJgXY/M7zfm2HcpuVJIRwLcXFNiUICASionXo1/+liaB0qMuxIMaYDUXT9Xb2dQMF7u1QtMofBlzxEXgiNwRQoWIdSXhSVz5l+hTLTLf7RslxjyvcwbgQqQn3hDmJyXrQkJ9kOKUBduqQlUD6BVec9Fi52/qDYe1YDuPwC9i/WuzpktndoYWdY1+/S5gIIGpzX2np2URY8RzzH+5mzBXCGbWV/t7jHOwtEf0cMxzWJwKX8LV9HHO9GQO8evs2dITmle7krkQVxgplvRZ7l7LD/SRHxDGRBjEgNVz2XYbIBXe8RDPUQLoD66/vgL3p1+mn12G2kHClyYpkTbDZWk829J1GQ9plc3Sz1GFJXB/P/Gdu9T+K5EU38Xg0gC/4k38gfSg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(366004)(396003)(136003)(376002)(451199021)(6486002)(54906003)(6512007)(478600001)(66476007)(2616005)(53546011)(26005)(186003)(6506007)(2906002)(66556008)(66946007)(6916009)(4326008)(316002)(8936002)(5660300002)(8676002)(41300700001)(38100700002)(36756003)(86362001)(31696002)(83380400001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Tkp2b0ZiT2Z6aVNibnB4djRnd0JSZkxHbldNbGt4RGcyaGtydGE5c25BaVhj?=
 =?utf-8?B?TllYZFhHeVpUWi94cndRaUNKckNTQXBjNlNhdUsrcEI1SE14UkFlRG1iWUZz?=
 =?utf-8?B?a3JlUkFVeVVaYVhYZTY5U3BQM0tWdEUwRUI0WS81elk3aDlrSlBlcjR2L2Z2?=
 =?utf-8?B?alVwQnNmSHJ4VzNoZVdaTjRQenNxdzV3VnJzTDkzd0IvWjRIRytQVTViOVh6?=
 =?utf-8?B?MDVOdHlkcGpIUjVHK1cvSkxEZ1hyb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ZkeHY4RFNxVDFDUk5oZzhsLy8rUzBmaG1WOWVUcWNoeXB2?=
 =?utf-8?B?YVBsY3hOK2ZHeVM3UWJJM005U1BXV21ESXFjZ21rQ0JQNzhWMFY3dmo1bWts?=
 =?utf-8?Q?jgGWDhb60PUUjlooSdpygaC5S?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0471ace6-6850-4c1e-dcea-08db8de25cfd
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 14:12:36.7262
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 0S/oA0xjNA1IB2YT4wvlAlS64IkL8FQU0APSJn8sOwGsrqmSs7wa/XU19aRi47GufC6k4nK0ns1cNfUXxdWkGQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8462

On 26.07.2023 15:37, Roger Pau MonnÃ© wrote:
> On Wed, Jul 26, 2023 at 02:36:17PM +0200, Jan Beulich wrote:
>> Another Dom0 related concern can probably be put off until we actually
>> get a report of this failing (which may be more likely because of the
>> XSM check below): The function being used as a callback passed to
>> rangeset_consume_ranges(), failure may affect just a single BAR, while
>> the incoming range may cover multiple of them in one go. Depending on
>> what functionality such a BAR covers, the device may remain usable (a
>> typical example of what I'm thinking of is a multi-function device
>> having serial and/or parallel port on it, which are fine to be driven
>> via I/O ports even if driving via MMIO is possible [and would likely
>> be more efficient]). Of course, to allow some MMIO bars to be used
>> while prohibiting use of some others, further trickery may be needed.
>> But not exposing the device to Dom0 at all doesn't seem very nice in
>> such a case.
> 
> Hm, I see.  For dom0 we might want to consider ignoring mapping
> failures, the problem is that we would need to narrow down the pages
> not allowed to be mapped, as part of the range passed to map_range()
> might be allowed.  We would need to resort to checking permissions on
> a page by page basis, which is not overly nice.

Right, all of which is why I prefixed the while paragraph with "can
probably be put off until ...".

> I think it's more likely for such BARs to be marked as read-only
> (instead of denying access), in which case the checking here would
> still be OK.

Maybe, but (a) granting r/o access may still be beyond what an XSM
policy intends and (b) might be a problem when reads have side
effects.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 14:15:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 14:15:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570502.892328 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOfID-0006oS-MA; Wed, 26 Jul 2023 14:15:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570502.892328; Wed, 26 Jul 2023 14:15:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOfID-0006oL-Hr; Wed, 26 Jul 2023 14:15:09 +0000
Received: by outflank-mailman (input) for mailman id 570502;
 Wed, 26 Jul 2023 14:15:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=aDiv=DM=gmail.com=olekstysh@srs-se1.protection.inumbo.net>)
 id 1qOfIC-0006oF-Ui
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 14:15:08 +0000
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com
 [2a00:1450:4864:20::130])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d30c8a82-2bbe-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 16:15:08 +0200 (CEST)
Received: by mail-lf1-x130.google.com with SMTP id
 2adb3069b0e04-4fbf09a9139so10762717e87.2
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 07:15:08 -0700 (PDT)
Received: from EPUAKYIW03DD.. ([91.123.150.167])
 by smtp.gmail.com with ESMTPSA id
 gs18-20020a170906f19200b00993150e5325sm9645290ejb.60.2023.07.26.07.15.05
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 07:15:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d30c8a82-2bbe-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690380907; x=1690985707;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=jzJIWLVJPizuccfU5mglOf7x8qeqp2QJuoUd5Jf7Ia4=;
        b=pRwNnJjRl8VHxEMRy0nveMAxJPsnQ/LqbF3f57keiEnpXhToWHK6v6mmPhqnw1hs3u
         BV3Z1TVR9fWWAWI2D7U0RciuldsSg8vRNpFDb5ccf3EMKVF4Kb68t/ty36sRDgo7lBZX
         F8W3fT2FhAsKLJvlJguiquzpIHX7K+DR75chO+AnXupGhQpBR7vd1GqjEPrV0udL+t7N
         y/31bx8EZuEfqBJO5XXZhmgG5HYAyUDmAL8r4u9dnAuTZTj5FcTkCJjF5Pmkrdffq3gM
         Kxdv6HXnb0N2CumkPsMpWaSUgbDr8qjV/qMvoq7gcHimMCb7W9vZo8M5KABqXfZ2TmoH
         PaRg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690380907; x=1690985707;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=jzJIWLVJPizuccfU5mglOf7x8qeqp2QJuoUd5Jf7Ia4=;
        b=E7bO6ovnCDred1ogXzJOSftk7mwGNVp4llJ1II0WVh/m3NnoQwZAMXtDb7KcNqU/Q0
         a81YaHwDuPnrsbHd+rGTRhOEci8F+yCIIP47Yt70T7lk39T7yZF3eUvrFgr4bGvdf7wp
         czrq1+UxXoMB6WW8c76PfQb94KZdWMHG1zQDsLyL80zdM9oMq0XRaIGvc35Nn8ECfSX6
         R1kE35+US4l2Ip4QIF6vhUounm1eHiGN31fy6Lm2F9Bk/KBkGlv9fO9JE7OdDrCCczwG
         GyuWk4BxEIeAHZH52qfgKNie0XGPP5Z2h+ZSb70BMuvINxGjkhS+cUycAm7S9UuCqDgH
         HuHw==
X-Gm-Message-State: ABy/qLYAGT4IMilIXhc6bZjlnz+hgy7d1HNaziNpcvB8cy3rt12X7x8j
	vZpWfgqZuOnD7MSD1jyOqIXz4PqGh5U=
X-Google-Smtp-Source: APBJJlEcqF/4JN44dZj18obkrwfVl5r4SG7cpXYozv3jkL1cxEA3Tpvwk4gFFyob6Oj1TUSqWDKbZg==
X-Received: by 2002:a19:5042:0:b0:4fd:c8dc:2f55 with SMTP id z2-20020a195042000000b004fdc8dc2f55mr1750874lfj.66.1690380906857;
        Wed, 26 Jul 2023 07:15:06 -0700 (PDT)
From: Oleksandr Tyshchenko <olekstysh@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Viresh Kumar <viresh.kumar@linaro.org>
Subject: [PATCH] libxl: Add missing libxl__virtio_devtype to device_type_tbl array
Date: Wed, 26 Jul 2023 17:14:59 +0300
Message-Id: <20230726141459.985463-1-olekstysh@gmail.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

Without it being present it won't be possible to use some
libxl__device_type's callbacks for virtio devices as the common code
can only invoke these callbacks (by dereferencing a pointer) for valid
libxl__device_type's elements when iterating over device_type_tbl[].

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
---
 tools/libs/light/libxl_create.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
index 393c535579..c91059d713 100644
--- a/tools/libs/light/libxl_create.c
+++ b/tools/libs/light/libxl_create.c
@@ -1887,6 +1887,7 @@ const libxl__device_type *device_type_tbl[] = {
     &libxl__dtdev_devtype,
     &libxl__vdispl_devtype,
     &libxl__vsnd_devtype,
+    &libxl__virtio_devtype,
     NULL
 };
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 14:34:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 14:34:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570513.892337 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOfbC-0000qM-8X; Wed, 26 Jul 2023 14:34:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570513.892337; Wed, 26 Jul 2023 14:34:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOfbC-0000qF-5f; Wed, 26 Jul 2023 14:34:46 +0000
Received: by outflank-mailman (input) for mailman id 570513;
 Wed, 26 Jul 2023 14:34:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=AABE=DM=infradead.org=willy@srs-se1.protection.inumbo.net>)
 id 1qOfbA-0000pZ-D5
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 14:34:45 +0000
Received: from casper.infradead.org (casper.infradead.org
 [2001:8b0:10b:1236::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8f29fde8-2bc1-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 16:34:43 +0200 (CEST)
Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red
 Hat Linux)) id 1qOfaj-006ZNN-Ab; Wed, 26 Jul 2023 14:34:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8f29fde8-2bc1-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version:
	References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=LsxQl+7lQmIvtLS3uUz+2Tc5wtoeEEVBoFirY9Yb6fg=; b=NgbwQpzKHdyAWsUCxnsImKimDt
	jHF2WmVqPjDVwWh4+qnqFx9EB6EzhJPFMjClBGjD6Hvhy3cDKu8QpNdQ/vu4YdRehqVe79OoriWgn
	rYVzFWxwc/SS+7+suUkf1PvWW2cp4TLFdh0VHNZVCP6elPEQsoL4zq+DlNr+Vsyy6zVTCVD4+BPLu
	7MT7tbbN4QAXyKU4tauvNJ5ES+/Xow+YcL4kRLee8APN/cRVWSBVwKBSDtrmdoa20ei7j/6b/nKQ6
	9EjL4wZbYuEHOXjGbdk1LQrEamw4aC90nEjbS99sxd1PPE9PWCMbzElXWmFd7Um+DcVnLHPQet+QT
	TJw896fg==;
Date: Wed, 26 Jul 2023 15:34:17 +0100
From: Matthew Wilcox <willy@infradead.org>
To: Hugh Dickins <hughd@google.com>
Cc: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org,
	linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org, linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org, linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org, kvm@vger.kernel.org,
	Catalin Marinas <catalin.marinas@arm.com>,
	Huacai Chen <chenhuacai@kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Dinh Nguyen <dinguyen@kernel.org>, Jonas Bonn <jonas@southpole.se>,
	David Hildenbrand <david@redhat.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	"David S. Miller" <davem@davemloft.net>,
	Richard Weinberger <richard@nod.at>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Christophe Leroy <christophe.leroy@csgroup.eu>
Subject: Re: [PATCH mm-unstable v7 00/31] Split ptdesc from struct page
Message-ID: <ZMEu6VcTqPj69bQ7@casper.infradead.org>
References: <20230725042051.36691-1-vishal.moola@gmail.com>
 <5296514f-cdd1-9526-2e83-a21e76e86e5@google.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <5296514f-cdd1-9526-2e83-a21e76e86e5@google.com>

On Mon, Jul 24, 2023 at 09:41:36PM -0700, Hugh Dickins wrote:
> On Mon, 24 Jul 2023, Vishal Moola (Oracle) wrote:
> 
> > The MM subsystem is trying to shrink struct page. This patchset
> > introduces a memory descriptor for page table tracking - struct ptdesc.
> > 
> > This patchset introduces ptdesc, splits ptdesc from struct page, and
> > converts many callers of page table constructor/destructors to use ptdescs.
> > 
> > Ptdesc is a foundation to further standardize page tables, and eventually
> > allow for dynamic allocation of page tables independent of struct page.
> > However, the use of pages for page table tracking is quite deeply
> > ingrained and varied across archictectures, so there is still a lot of
> > work to be done before that can happen.
> 
> Others may differ, but it remains the case that I see no point to this
> patchset, until the minimal descriptor that replaces struct page is
> working, and struct page then becomes just overhead.  Until that time,
> let architectures continue to use struct page as they do - whyever not?

Because it's easier for architecture maintainers to understand what they
should and shouldn't be using.  Look at the definition:

+struct ptdesc {
+	unsigned long __page_flags;
+
+	union {
+		struct rcu_head pt_rcu_head;
+		struct list_head pt_list;
+		struct {
+			unsigned long _pt_pad_1;
+			pgtable_t pmd_huge_pte;
+		};
+	};
+	unsigned long __page_mapping;
+
+	union {
+		struct mm_struct *pt_mm;
+		atomic_t pt_frag_refcount;
+	};
+
+	union {
+		unsigned long _pt_pad_2;
+#if ALLOC_SPLIT_PTLOCKS
+		spinlock_t *ptl;
+#else
+		spinlock_t ptl;
+#endif
+	};
+	unsigned int __page_type;
+	atomic_t _refcount;
+#ifdef CONFIG_MEMCG
+	unsigned long pt_memcg_data;
+#endif
+};

It's still a 31-line struct definition, I'll grant you.  But it's far
easier to comprehend than the definition of struct page (~140 lines).
An architecture maintainer can look at it and see what might be available,
and what is already used.  And hopefully we'll have less "Oh, I'll just
use page->private".  It's really not fair to expect arch maintainers to
learn so much about the mm.

It's still messier than I would like, but I don't think we can do better
for now.  I don't understand why you're so interested in delaying doing
this work.


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 14:51:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 14:51:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570521.892348 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOfqh-0003Ic-Hj; Wed, 26 Jul 2023 14:50:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570521.892348; Wed, 26 Jul 2023 14:50:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOfqh-0003IV-Dv; Wed, 26 Jul 2023 14:50:47 +0000
Received: by outflank-mailman (input) for mailman id 570521;
 Wed, 26 Jul 2023 14:50:46 +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 <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOfqg-0003IP-4I
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 14:50:46 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20601.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::601])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cb730afa-2bc3-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 16:50:43 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VE1PR04MB7392.eurprd04.prod.outlook.com (2603:10a6:800:1b2::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 14:50:40 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 14:50:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cb730afa-2bc3-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=B04bfbLeqaYgrpUXXXu0/gPA4H4iE6PipoPEsjVZtipi2OQ21eC9qUcPWZgFkzNIEAZo/zMYbg+fOrNz+4AIanVA3x600GxNb68HvM31Gzy9BmvWJk+xsaU72WgmmP4mLuuURdGnUOGNh0kPzjHL71Dpukyj+VzxQY1kT96dUoyP+9gcWHKMRC4VKqaJQqJiVq15EJkNQiiKJmVDCRUxhx8oOJOL++fYNcsjbDOtA/hTXwF7XpjM5Rv+HYjMXOA2Gg1yOZ94YOVvcR9/Xxp886y61UeN1ICW71L5vSRLA3fThgUg9aIcBGrNf4Cuq0iqe6/y/eJtT/NdrM2p9mlw+Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=t/+7aOrL/bJ/KQd2wEwAofJ2XrcTnus/CzmcUnnAoSM=;
 b=FihqdE48+Wcej6OUWVNkxpDDjTse906BhG/YNMzQmbqHCPKG59eK8HkmxGgt+XD2EJioLkm676KOLYIvYR/ttCN/S58nfMR4a8LYMOkgsJo7oYEH+vK2SjzBthjwf6BF0Y8qGeKOUWkKwAjVKew6iGU4vnF8CUCKDuMI6joJdhCvvEFvz5SilTX6gViJwPAYQQKu4XdhOW4QfJe7BKGRuR/zWSPSauYw0Us8onCGxRCx/CfeRPDwkOIOqgsr7jfQ9g1CcjFn/PpC3/CJzLn/Cx279G4bSgqjewZ8oSwY79EdZjUM2JpM1KuBT29wJ68XA00ngqx5A4EvrMM0b4zMKQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=t/+7aOrL/bJ/KQd2wEwAofJ2XrcTnus/CzmcUnnAoSM=;
 b=i87Q8N6kWUZBp1n2RIGCBRyAuxmTY0V3Oib0fVPku8cT3ndsg635B4wx18ee9qIcDBtPENOdloGEafj3G9K6AO3ON7WeVi/9xZAZJzrqAuOzepFZJ5OYJEYQV6sQrzVA7jVzjPjtYx2mLaT3N8HhoDh7v5QTWNAzIFzSlRJlxzS4Qj3rgLPJChVFxKQz9y6QlWK6vq1ukAuURy3aPkyKnG0E8w+o3bFVkHto1glwjd384XYo2c3QDwVoJ25BHIaD/xyWRjBzu0N3FFz/9MuS6OuYQZDMVKxihEpsXWWPJ/Uz+aviglx5lobko2CWO/m5b/u6nC1ZVMslKG54l6BrAQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <969aacb8-a608-be01-f0f5-34fb1cc61d62@suse.com>
Date: Wed, 26 Jul 2023 16:50:38 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] libxl: Add missing libxl__virtio_devtype to
 device_type_tbl array
Content-Language: en-US
To: Oleksandr Tyshchenko <olekstysh@gmail.com>
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, Wei Liu
 <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>,
 Juergen Gross <jgross@suse.com>, Viresh Kumar <viresh.kumar@linaro.org>,
 xen-devel@lists.xenproject.org
References: <20230726141459.985463-1-olekstysh@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230726141459.985463-1-olekstysh@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0230.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b2::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VE1PR04MB7392:EE_
X-MS-Office365-Filtering-Correlation-Id: 508d7ac6-798c-4459-105f-08db8de7ae59
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	7OorgryX5rsb2vCBQhvgJj0z+0lpgJob16lxsaG75ahVcVX7Jt+OgV5dGgEr60XPkFKSeQE9xejD4Y/jjpKlHkE4/keI7kGNJOPMtPgD68W/KL8AihjNmLIFkmxHW2cOo41HIjg7Zpw5IwKNkoMniIABSees45uVNYtmlBtSZSscG8NI/Ze91DqISZgsZ4Myy3iQJWnwLkP68VrC2pCoJlvMgQYdQHO9efxeRWIIdusjC2ZyRD+8PSlFTNkI5Nth32/pQ3g1ab8HbhJ+rZQ6m3Nj7DvZ98WghcrOHEtFuzJi9+L4ocCo3t4exGc/S1lrLVsNPxFqff3p8Ojpb77jCqsq9wVm8wGS7QQeaHnKBd3FJmyFptWZHjFX99LCUw6llvbVK1l43LDd5Tyu1raG6GRMWMDjc/+P7T9R6uPEuMqD4q+rec2bUJZfdi5MAugFRjMf2yCOfZUq8r+g2bB6XT/ieaVtdfKFDPpEIv6dcslD7UYSAj/VTQmBSl0ihagfhNe0OlAFgr2kX4iJbIsOcTE/MW2PhHfhllZK0tNCU8MuLwJL89NNYio/Lnze9t0p1RY4VfCLErOXvOjjiM5jzW5OugSn/9oFYpSr0giORiYECq17vkeu8wBPmY+DWYlRZl9kxcXROmj148Sk/lbJfd7U2zE6RkC+S/Uj5nr2BocfzGmXRDPd+W5Srlp6JzDS
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(136003)(396003)(39860400002)(346002)(451199021)(478600001)(2616005)(6512007)(6506007)(26005)(186003)(53546011)(31686004)(6486002)(54906003)(4326008)(66946007)(6916009)(66556008)(66476007)(38100700002)(5660300002)(8676002)(8936002)(2906002)(41300700001)(316002)(86362001)(31696002)(36756003)(101420200003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MHBjTkFTNWlGdksrdkMzV0c4empGL1AyL1d6WHhpTjM4WWxGK3NvbVR3LzRl?=
 =?utf-8?B?SnFiU0FTdVNSOU5wRWlrNXZRR2luaTNacG9GYUJZMjQwSDlZZWtJK1lRYnk3?=
 =?utf-8?B?NHBiVTdrZFFxRUxHdzdpYitvK3ZXTlFsM2c2MVBFSS9Qb1pJeEdUaHB0Z2Z1?=
 =?utf-8?B?QW9tUHB0cFRtS2wwOHNBOUFhN0xvWnVWTmh2akkwSUp1WFFhb25YS2c1Z3Rk?=
 =?utf-8?B?SXlRcjgwa0RndnQzUS9pdHBxZ0JHdytvejVia0pRaitaRm1ocTc5K3c5Nm5U?=
 =?utf-8?B?V3hUcm9IUXRnTzFkT000NnpQRUtJUUxMMko5YjBkVUwzZTdndHFoeWx5SXdt?=
 =?utf-8?B?bUhpTVVrQndPT1ZKQW03OGN3bnVvRit0MmxDRUtuWk5ieEhzMnNEb1RGV2Rr?=
 =?utf-8?B?TWl0ZC9iSTNnQ3dpS1JRRzhGRUQ2N1dNTDJaUU1TTWJZY1NSczZFaWtBODlQ?=
 =?utf-8?B?NkcwR3BiRlp2czNwK3VaMGxVdmdISTUvTm9IdnFlZkpZNjdUWUVBVFdMaVEz?=
 =?utf-8?B?V3QzZ0YvLzM3NnczS0k0bXlyeEpHdzRmZXdrZTQ1cUhLK0FPcGp0c2hZYkVp?=
 =?utf-8?B?a0N5NVpCWDhNQXY0RVRlN1NuTXl3UEFsMTRCTEgzQXlBZkxDL0ltTlN0bFV4?=
 =?utf-8?B?YkJnRERmQ0JPVzV4Y1ZTdS9rT1dXYmQ2N2crNHhoUXRXSTNFaXFHd0J5UjVs?=
 =?ut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dFUXZHdTdaeTFwMXRrRHI1L1BtaThj?=
 =?utf-8?B?djNuY2htL2wzOW9SbVlHdGdWZzRuMFRIUlBsRzRDUTUwd1RobVM1WTZud2J0?=
 =?utf-8?B?MmJYYWorbHAwQzVmc0RLaStHdzFxdlAwK21qZXlLaHEzUFZaOFQ1NTJyS0E4?=
 =?utf-8?B?Q2twTTBIT2xZMU1SbFRoNlZ0NE5zcTVONjllUTZyOWdrUUVVekZQUzJraGhk?=
 =?utf-8?B?MkNKL0Q3YXlDSTl0UmJqcCtOK1MyWVFoOENoQjRnUHRtd3l4cDR5R2NBb0dG?=
 =?utf-8?B?Sk1iRFMvRHgrbERDMGxVY01NaTFtb2FYQnVqQWs1L2l5UTB4dTVlWWpDWlBK?=
 =?utf-8?B?dG5uclhWQnU5aEhndTY1ZURRR3JOQ3lOUnRHOWpiSENJeHVPR0NoVkpacDk5?=
 =?utf-8?B?OWtZNVRpbWErYllCZHdJVHE5azFCV2V2Y29GMmhkZTRySVlPQndvOXZRR3Q4?=
 =?utf-8?B?UTgva2ZNQ3RwbUxUSG9peXdzY0tqN2JZaWtuYUtkRGZrbktZamRPMEFFa3li?=
 =?utf-8?Q?z055bKb8TJ4plN4E2ekUODLdx?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 508d7ac6-798c-4459-105f-08db8de7ae59
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 14:50:40.6262
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: hive8/+MXT/ooaGywPdnvLUiT5xpsO1o8Uuc6QHttqiyNdQuXz4iYSJr5AiSyRp89XIL9PFn70P7bV6tyIgFEg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7392

On 26.07.2023 16:14, Oleksandr Tyshchenko wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 
> Without it being present it won't be possible to use some
> libxl__device_type's callbacks for virtio devices as the common code
> can only invoke these callbacks (by dereferencing a pointer) for valid
> libxl__device_type's elements when iterating over device_type_tbl[].
> 
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> ---
>  tools/libs/light/libxl_create.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
> index 393c535579..c91059d713 100644
> --- a/tools/libs/light/libxl_create.c
> +++ b/tools/libs/light/libxl_create.c
> @@ -1887,6 +1887,7 @@ const libxl__device_type *device_type_tbl[] = {
>      &libxl__dtdev_devtype,
>      &libxl__vdispl_devtype,
>      &libxl__vsnd_devtype,
> +    &libxl__virtio_devtype,
>      NULL
>  };

>From description and nature of the change this looks like a Fixes:
tag would be warranted.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 14:52:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 14:52:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570524.892357 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOfrw-0003rf-W9; Wed, 26 Jul 2023 14:52:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570524.892357; Wed, 26 Jul 2023 14:52:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOfrw-0003rY-TX; Wed, 26 Jul 2023 14:52:04 +0000
Received: by outflank-mailman (input) for mailman id 570524;
 Wed, 26 Jul 2023 14:52:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOfrw-0003rO-AS
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 14:52:04 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2072.outbound.protection.outlook.com [40.107.7.72])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fb6bb467-2bc3-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 16:52:03 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8441.eurprd04.prod.outlook.com (2603:10a6:102:1d8::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 14:51:34 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 14:51:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fb6bb467-2bc3-11ee-b242-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=oOJ0acIzN9cJ64JZ4NDRvxGWNhnG/9f51EDhSw12ETIaDkfJVfY5slV+cBzhtp68S7wC+6UPvqywpeyW/kLflBIDkQx9f1lTJuTDuOts7SSJe0HBv3ErDhgbaAtwbLLKa30Jkw+5dqa54L6jV4pDkDtJ6fPiajxnaEQ9PJdGoSR52nVxBsCwbWOZW4PnpQcQYvQJ5ES4ofU67fYz3meV8HhBG68pa2iaL/39t0ML73BuySdhlunewHDDg+Y3sXajl8ajCtMPhA+MGcg4vZ1VCUiRAleVrSNEFBjRUgmOWCNwzGXVNJW5/ej1Ie8rthCDftC3QVy6IWwFByzFC0NBng==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=QkR2/tc8X1DQ2RRfb7if8Eu/1sexbo3H5KgNsoAXpRQ=;
 b=LNr3+JqXt0RfSJvxsdyMfa87husKMr94/wx19tZAtQbndwEydpWb1jrshN+ybYKqM7+y8rqfD5DY0jZTZaRLUDD7m0k/O/T9MVoZzDADDbauKtH94krX1wXSYxbNjmMXGWkBgEW/vh/O0KNC2tksdxIDJuuYrKemI2fwikEnedtqFBpMxWVMoalHeCbulEH9fEtwyZHsbwxySAF+gFlubxRXEUTprxbiI04P7HjfsCRrrT99LXeiPAaZL0pbnF4OadkIiHAPMdmUNYUlerXVcdmJmBlDm7TbKut+UwkxkIZE5IpcBBuu6h7ofyQBuqV5hubqygjv48yj/1xhzWvI9w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QkR2/tc8X1DQ2RRfb7if8Eu/1sexbo3H5KgNsoAXpRQ=;
 b=aoJsNCqvY5JTtBbx5gupt7+jjwTTC66cftD33TgZClHcnHJ8U1CESvFpSYXjhlrxfHURURQmGCkgYVV/KiDFChiemU3QW6IJco88vHyz6U5L4vZ2zt+1xlTJQJmE/wdiyUvOfeNceWVBkQ4Ua6rFVl3EkkrEzgt3mYAJL5Y7J+n9cL6Vcto0Jj5wqlm+XIAxPFA7kmqumiXLPoi0zoskXb6q1Oz9ZGfqDNGsodBr3tVwb+YQ7lYSCD6j7RY8gEilv/C99zzG8YyvTn76dpKU2AZHlKoq1GmmdradDOhoK0sTtzckX/k6o5vwiiKCj8Otml8bmZCN7d932wCR18KoAg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <8bfff663-4cfa-c5b3-8e8a-27204c417c60@suse.com>
Date: Wed, 26 Jul 2023 16:51:32 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] xen/kernel: change parameter name in add_taint()
 definition
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <5692c7c51de63d67865208be2be7bf011f171540.1690378948.git.federico.serafini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <5692c7c51de63d67865208be2be7bf011f171540.1690378948.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0238.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b2::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8441:EE_
X-MS-Office365-Filtering-Correlation-Id: 6081d922-c742-4e2a-0ac0-08db8de7ce3b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	vCai8iFJgO0Qn0EyrfodboTgU69AWchQywF4A3R2PqSc4HR94eZd+wwNsT4xa/gvV4StdO93aSR2i/ALQm6i0LLWCrXF8iiuxo76FPSbTVhVumnnVmGBxAgBMcnNxSZVDaiOIvdUw0xptg35glTxXh+UMfwtrtiQ7gAHsAYneRZkQODVKUGI5jWr+E2o4mTVUGCp2KNPi5Ye9TpZ4RClIqUDX4ibiEqH/b3LLsM3YHkuotseVGDONzBcFpvUJyg13eTlKfAuNPSuP8RraqX7HjMHy8JRllJ4XrHEHJZWlyDXjDKC1c3+bL/TVTuv+V+rEQkWqhvNloebvWxtQ9EiP2aFRAJcF0bkYhm+jg2GbDhBQen2uBHIyVOoZnBl82nzUeunRnW6hq85hBeWKqnZCtl0CgPS+YXkIQ8QfUh2RV2ssKeF/iceQc2N0hu9V9NwFsUMrxmuCLpFjQ74KlBXnXc5WBLWNjNU1fqi7q1/P7FLWL02CVd1ng8wHGHrMu8XWJyk2gNqLT0MSp2clMRg9pymf/xae8aFRtHpxN6maql47j0g01wbm33p/tqeG6qMeRQZYSikLvljESMyZM5KYuFt42q3MACRureNIZBhsGvswfdwmbu04mVrK0nroiFtmGtaDuTr66U9fPVJdvghdQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(39860400002)(396003)(366004)(136003)(376002)(451199021)(2906002)(6486002)(2616005)(38100700002)(36756003)(4744005)(186003)(5660300002)(86362001)(31686004)(31696002)(41300700001)(8676002)(316002)(6506007)(26005)(8936002)(53546011)(66556008)(6916009)(478600001)(6512007)(66476007)(4326008)(66946007)(54906003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ejhNdVd6U3hRSGdIODN2dC82RldNZGpDZjVIclpldDVIeGh6VVBFcnFXSVpK?=
 =?utf-8?B?eVFkb0VLeEdEb213UCtVdTdHYUZEaDRLa2h0OHlvL0NNTjUxSkxJcGRoN3Vn?=
 =?utf-8?B?OFN4UnpYcUtlZmNrTWV5TUJOUHlaQis0R3VSbHh4Z2RoTGZxUnd0cnY2dyt2?=
 =?utf-8?B?MkVvMy9TLzdiN3ZyTExzUjVpZEJLRnpLeUlTZ2hKNm40SElwOHV4bEdmb3Bu?=
 =?utf-8?B?SWZrWlZGcllrNUpSQXdkV3ozWE1NUW44dkZkYkRmeFhxRU1qVnJyWWVBMU10?=
 =?utf-8?B?SCtVVWZFQ0NBOTVhY3h0MWRJa1lNaEI5MitYQ2FiK0xYdFRUajFoL3d2WmZ1?=
 =?utf-8?B?NHhpV29hU2ZpWHFTc2tObk9YMUZFK0JWSCtBZFJzdFE5RTBmR3lWazl6bTdG?=
 =?utf-8?B?NklRdDZJR0tYNDMyTWRMalJ1d201Z1ByWjlURU9XcERQU01NTkRZSVhqRVdW?=
 =?utf-8?B?VWc3QkM3dWRGUjdiM0JkL28xZ0RrQTFkckZlVEhHQmlXZGgvUGpCZ25QSjR1?=
 =?utf-8?B?dVVhTi90MTBkQ2U3NTV6Z0xSblJTdEhCa3Uvem50Und3ODAzWU1raUF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N5aGhYUlIzV1ZoSWNPN2UreHFxRmdtQWJXSk8xVnZ3ZUF0UXNLSVNP?=
 =?utf-8?B?KzJZUFVuNjBGdTZoZUNISXgwa09wMmluSUcyYkhXRDMzdUtjeFQ4clVTT0lw?=
 =?utf-8?B?UkxJTkVLZ3BSbVp5U1Q3a1BYeHJ5dXlIVG5MMHZSUXFwMTJuNEtNZ0lTVTF3?=
 =?utf-8?B?aVI1S2RUUGdTSDhCU2E0MmVZVUVOSmZOVW9JSktDcEZBSTh2Rk96aW9USmRS?=
 =?utf-8?B?RURjQWlxZHRKc25kdXRqamk4Yys5WS8xN25hMzhTbFJmSjBnN0pTT0I4Z1Yw?=
 =?utf-8?B?bU1GZGdvT2hxS0RtNUtKSitSTkxVN21jRE9aR1VzOEwzRWdxcGhIeEVML05D?=
 =?utf-8?B?Q2dVQ0oyVDdYSFMvYXJFRXgzZjhqdHFncVhhSXkwc0lJNVRwUW5sRXRySTdn?=
 =?utf-8?B?TE8xeGdPYitVdm8zenluaG5PMTc3Ymk4V21GSGY1THVaL3BNYlJsUjNLNlM5?=
 =?utf-8?B?engxV3N5UUlpM3RyVnJoZWg5V2MxUXBaWnhtc3ZtVWFaZDU0Z2ZVc3lxQ1ZQ?=
 =?utf-8?B?SUZGVW05ME9LS0NCazN3SlR2R3pzWkN0ZEREeXVJRUpHSmJVRUNCaDc1cG9r?=
 =?utf-8?B?Um9PeXlNSzNQekJhcWJmQkF0V2ZxbGpmZE1EZmFEUHZiQmg0ank5a21oZk9K?=
 =?utf-8?Q?cRNBZAmIDSnPsu9ddbXXv6Ava?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6081d922-c742-4e2a-0ac0-08db8de7ce3b
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 14:51:34.1857
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: VYYc2JnzKFstaxVl6yeVcCYITiMZ9n5ZVgGhOBsuN0V4LeU8wUBkt1wH8uqkPdA2dlhlof3xSOtPdNIulPq5KQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8441

On 26.07.2023 15:58, Federico Serafini wrote:
> Change parameter name from 'flag' to 'taint' for consistency with
> the corresponding declaration.
> This addresses a violation of MISRA C:2012 Rule 8.3: "All declarations
> of an object or function shall use the same names and type qualifiers".
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 14:54:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 14:54:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570526.892367 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOfuB-0004Qw-Cy; Wed, 26 Jul 2023 14:54:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570526.892367; Wed, 26 Jul 2023 14:54:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOfuB-0004Qp-AU; Wed, 26 Jul 2023 14:54:23 +0000
Received: by outflank-mailman (input) for mailman id 570526;
 Wed, 26 Jul 2023 14:54:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOfu9-0004Qf-Sn
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 14:54:21 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on0631.outbound.protection.outlook.com
 [2a01:111:f400:fe02::631])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4d210cc2-2bc4-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 16:54:20 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8100.eurprd04.prod.outlook.com (2603:10a6:20b:3e3::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 14:54:17 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 14:54:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4d210cc2-2bc4-11ee-b242-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=NeXBo3hfv9kAUVSDoph9MWQC8X2cfQyniLkBOv2usn0EiBw5aXKgW6te/t32si4TywBQwrT8udYMx2kDzeAR2U1uI4NtYsO/kH9lvv/ANsUFnASi36B+CDxQ6jViE0lUhF1c+mNQQDO5LWytYjdxqDGZGl9WnfbbowDBO5t4uVqCFH1zjbtOW+behGRuxMeXWvQh/VzaWaKQEM1F12JCnU0QwzyMFScDAF/EP4devOhuvUAmfjtNm9U/ucvQipAxAq80PFl0PMn9n6T1ASzUNLBvQfVAmrBTcpHbt+9NZ5baiFinJx16OWJYDyCgZNcuqgvFDTSzPH/wH6gJcpuuhw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=bqAYqWtayfuq+5rHXVM/D4d7b6c8HBXRhH9aHqA1pwk=;
 b=Qp42XLSIOzxC3Yw6T6U1Kgv+maS3Ro0vwFVKori5WFbKfd2uk7vC9Rk493fH7GWeFTBbcMl0TQ8bayxXfdbS0DoZmwkCMkkD1RREj+zfD0x4VQhz8WFT2d8uXgdn/ydJOkh8EGUgmlbGyJvthfH0Z1DhXkTuFUOj9IG6epJUwjrx2DuAnV1pImrJ/NNr2fToQcWrElaI+0QmHXrYCEkSsMKeZ2Nfyp0TQlAZGQOiVjJRrJvN1BERimoMGtM/F5GDntAwAraVNgfoA5ksm5bZUlDdyki0DP04ItKFdkgmU2E/kAIyYtHL+UHq90XcWnvsru3pQZS63g9CvLs0CeLVDw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=bqAYqWtayfuq+5rHXVM/D4d7b6c8HBXRhH9aHqA1pwk=;
 b=RpmjsqGaFIa6Uuamn4RV1GRcHdMfnl7XVmTmE1iPbYXNApqsRyPs4Sx/1dX0l7WJBWd8S1irZCJgEzC8pH5bmHK4z0EMN94yWyTFVkqO18IDFiA+V3/+K5BDTEhKy8N8m6TQhTwfZ/3uL3BqMdiik0lNZONlV0gUogVuCIB6QkkfpTniTjLDISE5fSVnJrQ6mUKqMUkcI0C7sc3x8GuV4HA2G5ujpBTdq/j9o+1XG7najz2RzszNe6+MGaEHPJNbF0WiR09ueTSCt375OQP0reV6YCMeRCDbuBo7Srx/kgZibFWXbdhg7rdgV9aok2DFXzHVFN5D0fKDS5iB8OfbZw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <c998690c-2891-d65d-575f-ced52daaa8c0@suse.com>
Date: Wed, 26 Jul 2023 16:54:15 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2] vpci: add permission checks to map_range()
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <20230726140132.80151-1-roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230726140132.80151-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0080.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1f::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8100:EE_
X-MS-Office365-Filtering-Correlation-Id: c418683d-95c9-4791-b329-08db8de82fbd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Gz4IWGPx2lnSfZphCFMcgw7EC0yW0zCTdskkMhfjqkjfo9J/6RZqHfA6m27pCqXmlAqTVvqcmaOirVRDHyxhEg0gMuJkAol6Nt2ve+45jx7NMYG9JnX9UceWM58XQJgPzWEygxtfK3i1Bjbv8YSXHOybn1sh0XxggvUv8r08fC+h0JwML9nWalZgCOvfxDFviQljCR+ZBZdX9uqHBEaMNtlmeiGKiELeMkUJmRaSgMH/n0cOYbC0VS2ayIRGtuo8l2pzLKtFgfSiRk3I3dNjxFvBMPE00Hwpwb9y+8A0edYtUiceHvepuaTe8lMBuVojtlQDSXCornHj2UJw0t26SSf2iH9DWmGYqTZ09JDQZN3MAkoxn18dPArSYXOd3ehPwFxWjf6sXtGSf+Z1jrcYaOVXd4d6aJwVRHXXxTJfMXmKKS1SHvSje6GpXgGYJeZEb/B7zpl+xjuStwNmhurw7SC76QTw2tiR8m1qvlDRvEW41qM2TKoF7tutNBy9oLlFi6j58BSRmu4w7AG2DiAZ3VBs7y/6eKkfEc9jsSbtDTPT/ueL8ApIPG0lvaOrnxzFZkzieAmoil81kkI+jNHebESEIdGutdbLbWfLg0V3WVnCDVuWdNhAF5wBOiyBFj6z7VzZZcQRJBKkiqp04vl/XQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(366004)(39860400002)(396003)(136003)(376002)(451199021)(86362001)(316002)(31696002)(8936002)(8676002)(2616005)(41300700001)(5660300002)(4744005)(2906002)(4326008)(66946007)(186003)(66556008)(66476007)(6916009)(54906003)(31686004)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Ylc2WU15MmZONUorSDJq?=
 =?utf-8?B?NWRlTHZKalV6UDU0WkF6UWVTVW8yNFROTW4vR0NJdnE5dzJXekZHdHZ2bFVk?=
 =?utf-8?B?RUx3NjQxeWR2K2YrU296azkrenVGemZZc1NkWkdOSFhKWWRXSFdpT0o5NDdV?=
 =?utf-8?B?MUR0dFROZzJBUTFqMW02NEVQN1ZGMmV4VGJqSlZOczcxWUVuWURIRmNOdkFX?=
 =?utf-8?B?dGptVUxqVU5Ca21wYUhxWG5SN2pseTZyQ2drbHVnelh4MmJoN3JqOXdBMEhs?=
 =?utf-8?B?UE5iUWxXVmoxb1Iwa3hWdFh2M1p2TU5WT2tVOUVCZndGbE1oaUZaYkVsNXpZ?=
 =?utf-8?B?NkhDVmMyakxSdG1KMWczN2N2SzQ4NWhaZzZWeHZRbUEyUVQ1TWppSW1hcS8v?=
 =?utf-8?B?Q2dNeFpqTjFHdjFrZ2xGWUhkeFVvenFzbWlrYlgwbWtraklPM0hTMEM5M0l4?=
 =?utf-8?B?V2IyclV6d3NYclkrRkpQVUIrNVV3WGJ0RkV4VUlhcmNBT2hsSzBPcjVQSFFn?=
 =?utf-8?Q?KuE3uT30goB95jV3+HoKvZaBD?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c418683d-95c9-4791-b329-08db8de82fbd
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 14:54:17.7153
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ux18UCxU/nL+r1MjSOpF6/OFkD9y6dEfzgAfpl44uZmyA9n52ze4Labr/QL3xDtOysYOUVnMlIGw2P8Sb3VRtA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8100

On 26.07.2023 16:01, Roger Pau Monne wrote:
> Just like it's done for the XEN_DOMCTL_memory_mapping hypercall, add
> the permissions checks to vPCI map_range(), which is used to map the
> BARs into the domain p2m.
> 
> Adding those checks requires that for x86 PVH hardware domain builder
> the permissions are set before initializing the IOMMU, or else
> attempts to initialize vPCI done as part of IOMMU device setup will
> fail due to missing permissions to create the BAR mappings.
> 
> While moving the call to dom0_setup_permissions() convert the panic()
> used for error handling to a printk, the caller will already panic if
> required.
> 
> Fixes: 9c244fdef7e7 ('vpci: add header handlers')
> Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Wed Jul 26 15:00:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 15:00:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570528.892378 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOg09-00060f-1c; Wed, 26 Jul 2023 15:00:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570528.892378; Wed, 26 Jul 2023 15:00:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOg08-00060Y-VB; Wed, 26 Jul 2023 15:00:32 +0000
Received: by outflank-mailman (input) for mailman id 570528;
 Wed, 26 Jul 2023 15:00:31 +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 <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOg07-00060C-OZ
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 15:00:31 +0000
Received: from EUR03-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur03on20625.outbound.protection.outlook.com
 [2a01:111:f400:fe1b::625])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 28d3df11-2bc5-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 17:00:29 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DUZPR04MB9918.eurprd04.prod.outlook.com (2603:10a6:10:4db::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Wed, 26 Jul
 2023 15:00:25 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 15:00:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 28d3df11-2bc5-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=h9XM/0o0wK+J8AuqORxPAyMXCbra+qNHMSeTZhdCXKMhoIF0SEzk9SFBhZvPPXgZl3go438QyOCLrjiPVvrP52BfpLeczgZHg8pLLX15xEPj0p5DKkNaieRGaPgX5bc9azatIx+jGTI7pu/MLgOCLjB883czXMqfwTE/uBvjP+RejbDwaUGRstySoXGqXt5t8FpsDNnq1WBacj+wYqp5F4YlZGQt++ooMrYMri+laUbaX/J3I0laf1JnbfXNasEYQOPQddUt80yO+ewYWCEjl2yD8jTDvauX5tRL1xA6LvmngPZ3O4DYhsXUSUCwz4Px7qeMoo+tyY4R/FJIUBktsQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=tKDgIRzS6g0SCT9y8ZYDmvY8ivnpVEKA0Wu3YWwRvYY=;
 b=hTPkDcFYQ0/30abY2SWcb1aOmin9cMkA5cvOVCFOZNX2MZdy9Ew5KmRjsK/RVzwr67ildqyaWSCh1fFgjVNlTAx4Vxs0ca0SWjqCjEtGSa/YAIBqkOMDqT+AoDnmwUIVrxBAMU+3agIT8yRPkfNm/QKSjBHRW+lfdyB5FIrquB9FH9Uc7ApTGLlWThcoz9Qy5V6JsLofo21erlmeXa3RQjAFWRRzNt0OLS+hXGxjcfq6q6vonjmoo4RiGQ8r7yOeMjg31PkzaP6fWcypLuE1EbQPJtOF3Pce+fG3FYrxjjVkoXhscxPjRGAC1tB1jk9ukNFzyQGWcC84FwQgnqr/uQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=tKDgIRzS6g0SCT9y8ZYDmvY8ivnpVEKA0Wu3YWwRvYY=;
 b=EThdlWsDPOu/b8CbC+xed+Ne464vyjSfbrIOfs1s0/9SQ8NeoOY614AutxEelEpvprumzmaFTVNIQF7SZHwLe5U+BbPoEiFSQeX0cgI0egKmYwsBGt6TgKYM4rYntlKKPT3gbnG2Q9odiirGFyDlYPQ+lR1LKBmqHjjf9xRPsgoI7RalrsVhk0UFNpLy7DpkMbNNsQ2L4D1VTi0kSTsf3EK2JTcKJ5XTvc/gLe9k99oR8JEGuV1TMcPY+PveGrDzu6C9YXA5axrqhDexctjIhTrEoMLCorHf7P/fSQEez/xOc2HikD9ey7xJjrSX92VGfjDmZTd/G2lPSuP7yu+slA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <5a40abd4-edc2-0de0-99ed-d23174940d66@suse.com>
Date: Wed, 26 Jul 2023 17:00:22 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1690191480.git.oleksii.kurochko@gmail.com>
 <a8ab1829ab718dda869db3df3348ded211e81967.1690191480.git.oleksii.kurochko@gmail.com>
 <a370548e30aaa8c1160ecd5f2eccfcc10002a8f9.camel@gmail.com>
 <6675f535-7cf7-dd55-4ebe-82ba486029f7@suse.com>
 <4deb8c44cf639af66ad7f5b9b42180554e08d5cf.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <4deb8c44cf639af66ad7f5b9b42180554e08d5cf.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0157.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a2::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DUZPR04MB9918:EE_
X-MS-Office365-Filtering-Correlation-Id: 6a3ad295-5d76-48f4-6fb3-08db8de90a48
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Y8CnHAoDhDa458ZFSCiMrnhBDHf8AgbCa3+hy4BtRKGKWh72WE19WKUU1jlmyQ55ciYwAGmFkqr7rcPtuhQLZGUH1lmFOsDdhEyJ8GaSr9Zr8yvHzFuBG0Z+uHgy5i54ZKUqz0nNIJnV/XHVqkfwdF50IUSDqLuD7IJJhoe8R1U3rpSb1qegMU0WG2uqokBDIAAvntrLHdKA4YVknq4qYgKc2fZnad0R4jALCtrOdR0E7T+jTZPy9Y1F1H1AP5DmcNCMM2U7V+HJepATLthH4E8IYKO3MPLyLgfALSjN41b13TsdRRqOyauPSZffOgq8gIBm7qkD2hUscCch1+/rVljmDQ+tY51r9OSPECHurgYQqk74UOYGCSdSuZ6pLpUoabdMgZxRGjCziFEUpCZGDv+XPEoYfNPeBFB7+RKZXf7p6IyYdMvW/0FC/36yoFBWiJcNAfwq/ixAltsaNKrO/cb3Bl+m44zEeNjhcDKc9ZdziWcPq7r9T9KizThyD+E+l9T/7UkieDVKNETGXDMNkd1TvIo/8PhA3JpiEXCRS5CpgmEk+MZQd8PEFholD/vkNsHEW9YXEvomnTWC1dNMuRucEl7NghOd3QjWD8/9eALAQW80H2BvWwN9iv5gO6B7PW2XyN2C+FuqDvde++yWJA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(39860400002)(346002)(396003)(366004)(376002)(451199021)(26005)(53546011)(6506007)(38100700002)(31696002)(2906002)(478600001)(6512007)(86362001)(54906003)(6486002)(36756003)(316002)(8676002)(8936002)(5660300002)(31686004)(2616005)(4326008)(41300700001)(6916009)(66946007)(66556008)(66476007)(186003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cjQ0bXo2bVdYV0wxcG9jandZVWE2dFZKVXBCdUVTZjVnbEtOSVFmcjAxMWV0?=
 =?utf-8?B?QllmcGJkclJDTEs0Q0pOZnp2cC9NOVVFbE1peVZiZVlpU2xHV0ppMytRbHBr?=
 =?utf-8?B?amtRNVQzUWM0RVNLN0hWMzhWWFQ0MlFJeldtdDlYU1BObythRHhUUDgzdDJV?=
 =?utf-8?B?K0R6c3doejV3UklVRHJIMUZUMmJpVnp5Z2JxU2NkemM2a2pSTHpPWHdSaDBS?=
 =?utf-8?B?YWUrcEd5V1ZRTUM3R2FQSEJnLzVPNjk5eWVVdThlYzFCVFNlM2pMbWk4RWdQ?=
 =?utf-8?B?bjRGR0NmSlplTmkxWkJNbW4zaXI5Y0RBaXRGUXJuVEhnRU9mbWkxT0EwcjBV?=
 =?utf-8?B?dTBjV3lVL1ROVExrWE9CVXdyUTAyMEFTVUFHdnYyTjlUdW9IZHJmdWhGQXpJ?=
 =?utf-8?B?UlFKVnpsT3puSEkyOTZRLzAvM2RnOWxQLzRRUGxJK1ZZLzZOMmh0RHl3bmty?=
 =?utf-8?B?Y0ZuRWZhdG4rM1dTVjJJOFdXYmtKUm9WRVQyWHorYklXbFZqZXlYTHNoLysz?=
 =?utf-8?B?RmJENGs3aFV3UklQK29qS3Q2V1F3Mk82Z3ZKNmJWZWg4dUIvZEI1S2JSQmRh?=
 =?utf-8?B?VGMybFNEWjdLS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YjBYY09nRlphazNHSDltVmNBM2V0?=
 =?utf-8?B?OHVnZEFQcDhRdjBQWDY3M2h3azBIVnFDVHkzbGpLSmVieWdIek9UTTlzNE1Y?=
 =?utf-8?B?cWZMK1RKaEVHSHZJMFNDSmI0UWN3QkRFS1JpT1drM3hrcWg3RVdXSE5xZlVr?=
 =?utf-8?B?RmRMZ1FKZEhQT21xc1ZFQjdOdjB0VHVtQ21uNDF2TlgrS1hUMkJLcFh2Sisr?=
 =?utf-8?B?SFFpTFAwYXN4N3BBaTFRU1cydnNuYUJNSTV1WkZSdXV6cGw4R3lFMTVsczRj?=
 =?utf-8?B?am1VdVl5UWVKRVRkOVFXb0ZyT2xCdGlieTFhSitSaGVUVFR3QmpxL2pRYjhu?=
 =?utf-8?B?Z2pDNDg0Y2k5dzdERThuRHBQbkRnRGVBSmVtRzB6ZHE3WDJpNkgrUHZaSVpL?=
 =?utf-8?B?aTZ2Nm81WC9WOVYzUjlYeXl1amlla2c0Tlh1bnhPclE5bXY4dnl6OTFNZTVq?=
 =?utf-8?B?U3FHbGZmMlZlWWNiNHRCUy9ka3ZUVDM0VVh3M2VUaWhZQTVtV0lMeHdFWCtM?=
 =?utf-8?B?M3lwMm1UN3JiaVRZTGI2Y1FnbXNuYUxIY3RnN1NuNmd6alJJTm8xU2xlb2Q5?=
 =?utf-8?B?RE5oQXhsTlIrZHkrNytvK1VIVDhqVXBHVytmUlJTazNGMm41Uk1sZzVLendx?=
 =?utf-8?Q?Zxgf7D8ze7znIVLZmm/gjaG6Z?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6a3ad295-5d76-48f4-6fb3-08db8de90a48
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 15:00:24.3790
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 3ULBDSGX+OJlDRSx+foSzSqH/WvZbn0sMw3TBm3CFEG3LegRc1KTbKERalKtRiapQF9krjPT3KK9l4O9jYQ0IA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DUZPR04MB9918

On 26.07.2023 15:12, Oleksii wrote:
> On Wed, 2023-07-26 at 13:58 +0200, Jan Beulich wrote:
>> On 26.07.2023 13:23, Oleksii wrote:
>>> I would like to ask for advice on whether it would be easier, less
>>> bug-
>>> provoking ( during identity mapping to remove of whole Xen ) to
>>> have a
>>> separate identity section that won't be more than PAGE_SIZE.
>>
>> I'm afraid you can't safely do this in C, or at least not without
>> further checking on what the compiler actually did.
>>
>>> @@ -264,6 +268,19 @@ void __init enable_mmu(void)
>>> Â  Â  Â  Â  Â  Â  Â  Â RV_STAGE1_MODE << SATP_MODE_SHIFT);
>>> Â }
>>> Â 
>>> +void __attribute__((naked)) __section(".ident")
>>> turn_on_mmu(unsigned
>>> long ra)
>>
>> Did you read what gcc doc says about "naked"? Extended asm() isn't
>> supported there. Since ...
>>
>>> +{
>>> + Â  Â /* Ensure page table writes precede loading the SATP */
>>> + Â  Â sfence_vma();
>>> +
>>> + Â  Â /* Enable the MMU and load the new pagetable for Xen */
>>> + Â  Â csr_write(CSR_SATP,
>>> + Â  Â  Â  Â  Â  Â  Â PFN_DOWN((unsigned long)stage1_pgtbl_root) |
>>> + Â  Â  Â  Â  Â  Â  Â RV_STAGE1_MODE << SATP_MODE_SHIFT);
>>> +
>>> + Â  Â asm volatile( "jr %0\n" : : "r"(ra) );
>>> +}
>>
>> ... none of this really requires C, I think we're at the point where
>> (iirc) Andrew's and my suggestion wants following, moving this to
>> assembly code (at which point it doesn't need to be a separate
>> function). You can still build page tables in C, of course. (Likely
>> you then also won't need a separate section; some minimal alignment
>> guarantees ought to suffice to make sure the critical code is
>> confined to a single page.)
> 
> Thanks. I'll move all of this to assembly code.
> Regarding alignment it is needed alignment on start and end of
> function:
>     .balign PAGE_SIZE
>     GLOBAL(turn_on_mmu)
>         ...
>     .balign PAGE_SIZE
>     ENDPROC(turn_on_mmu)
> 
> Does the better way exist?

The function is only going to be a handful of instructions. Its
alignment doesn't need to be larger than the next power of 2. I
expect you'll be good with 64-byte alignment. (In no case do you
need to align the end of the function: Putting other stuff there
is not a problem at all.) What you want in any event is a build
time check that the within-a-page constraint is met.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 15:13:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 15:13:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570532.892388 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgCx-0007cu-Aj; Wed, 26 Jul 2023 15:13:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570532.892388; Wed, 26 Jul 2023 15:13:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgCx-0007cn-7R; Wed, 26 Jul 2023 15:13:47 +0000
Received: by outflank-mailman (input) for mailman id 570532;
 Wed, 26 Jul 2023 15:13:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KuT5=DM=epam.com=prvs=1571f163cb=oleksandr_tyshchenko@srs-se1.protection.inumbo.net>)
 id 1qOgCv-0007ch-EA
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 15:13:45 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 01b72449-2bc7-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 17:13:43 +0200 (CEST)
Received: from pps.filterd (m0174676.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36QBD7Y0026900; Wed, 26 Jul 2023 15:13:39 GMT
Received: from eur02-vi1-obe.outbound.protection.outlook.com
 (mail-vi1eur02lp2044.outbound.protection.outlook.com [104.47.11.44])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3s2wtk21cm-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Wed, 26 Jul 2023 15:13:38 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com (2603:10a6:10:ed::15)
 by DU0PR03MB9780.eurprd03.prod.outlook.com (2603:10a6:10:44a::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Wed, 26 Jul
 2023 15:13:33 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::3a00:d290:e446:d887]) by DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::3a00:d290:e446:d887%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023
 15:13:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 01b72449-2bc7-11ee-b242-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=l718wescjBx9Z++SBpwhwE/pw06CbBRMk5b6woE5Lt/N/woCvLG85e8OiOcx3ejxdmNMLXEoFOkFFBkSMQrxVMBKNQkWnMLtWaMjGCjbHM/hzqWBVYwUJsgdZblpLpRqmSpj8txiHi0oDQSnvvzsnOVZYpjbBsSoCW1mPcegHqm9Q16BdPSPbU5uJy3PZMkA75unl9acgkpNlBOad37+ttI5gPkAEadc4NqlchhzekhlyzPNAKfHOrViQTYMKHaLskIqWkT+j6kWfCdjMu8QVWaBPmukcduzmlyfjVVaovT5/I82srYTHinfQf3FIk0Oae0Vl1hIoKEkqASNJy3J6A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=rr+eS77ylG4iI+Pt6PsZZob+13jF2qBqZatQSXE7LwU=;
 b=KccT8ovswkvFfJ5/IaE+Hj2uxVVWHnj01tnz064Cb+ALYvasK5bInYVzI+QmecVFI/7rrQ/lw8FTwKRBRv/MWJSq1WjNpPk8OmA3tzubZ/v/ScfV0prpcRTSsCN90vlBnXyfs7aMm4jpFx5Sw1T7FdGcgf70UVrdDpH7lehWuUxL5g9Mua4vmQgpyZc1HCNCWJVWyQ4fW7RDBAyMK5MT+qruAqO/AgHj2GwcZG//1QhG/PvxNrVjA3+npjFYH/jL+4lDaMllNz9UAd2VZTCnkCS31lSXUEQJ6Sw1v0SK3JFUjJvfPODsrGQf3mPFdY4j9RbgVVH8skRmywxdmCioUw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=rr+eS77ylG4iI+Pt6PsZZob+13jF2qBqZatQSXE7LwU=;
 b=Kg/6NKqHXTnuIndB6V/jVVEjxVIjQmjX3Bhz8248/pEyY2M+NrRjeswhu6nuxwfyLkoTdP59oWiCXncCTT2gg6ndfhVPUCZPhm/+OMOr9slZxyEvBS4h4x8dqap23zNC34sJgkF3I7/khnNe1GeWAZg4FzjumalkvMQUyd+wqd58fSiTc4P8fds0ylx9565Ni4VnOc0nls1YBZJkLkKMa2GvZAzxB16vWzqMiT5EGC3l1X+phLhn7JJOpPhaf7nQU3QHB1pVF+DddpxMN6XP8UmRZu5zJMhMaSEqGf7A5KAxyk1UL4t9ww0oS8XeBJkKe6qg6VNgA95QeNXV1hSl0A==
From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Wei Liu <wl@xen.org>, Oleksandr Tyshchenko <olekstysh@gmail.com>,
        Anthony
 PERARD <anthony.perard@citrix.com>,
        Juergen Gross <jgross@suse.com>,
        Viresh
 Kumar <viresh.kumar@linaro.org>,
        "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] libxl: Add missing libxl__virtio_devtype to
 device_type_tbl array
Thread-Topic: [PATCH] libxl: Add missing libxl__virtio_devtype to
 device_type_tbl array
Thread-Index: AQHZv8uYlQiykVHkhkC1aQss9HQu9q/MIX0AgAAGYQA=
Date: Wed, 26 Jul 2023 15:13:33 +0000
Message-ID: <35a1988d-94a5-9f2e-2478-ab08268f02b0@epam.com>
References: <20230726141459.985463-1-olekstysh@gmail.com>
 <969aacb8-a608-be01-f0f5-34fb1cc61d62@suse.com>
In-Reply-To: <969aacb8-a608-be01-f0f5-34fb1cc61d62@suse.com>
Accept-Language: en-US, ru-RU
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DB8PR03MB6108:EE_|DU0PR03MB9780:EE_
x-ms-office365-filtering-correlation-id: 44532c63-74f5-47e8-60b2-08db8deae09a
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 0y8R1Shb+f6G7vzPyAhbCYsGdmz0CMNUsj8I+I/qdr5GSGQZ+yD+tzCVrz3oJrQtStebUCmz8zauLq0fWR9NeEmlInqjTKdU5I4lEaSDWGoP9OhF0TUJ48p7VVIRCLUulPTzYf/QDTl2RuV34v8C9mcANdOGkN6e+3l6LoOrvTPM6mmdGshyiFQjbdHJjxJPJbwxQr4lhiOfkf9XenQhtmv68uNEHmzfhK+B55r7YFVFG9eoMUeyT8cxgQjN9IIbNf6xvAYo52h2B8Ox3gJMoyeYEthzQXSHbQnfnz4SpZoECMwp5P3SnlqhcGAjtWWQfFXsnsazR+MZQoKB9wGANx9VOifour5WR2cJyK6LxeHhZbePPk8CUvKDyM5CuNXDPhdgDkxaqoT2cPsfLX7gAzv9R3IgD43UTKn3rY/ffDMPu5Hx+sUH57Cbi9xf2aFX4UVvyKr/y1zRpSwO9I8r0+3esbVEdXYLMLKOXZBdU0G9IQaDGcivBgjE9Kr/nypHpOtU/RyVMRX5glr4XVIjB0cTKEfzsBXRFNRf+SO+U7WgvKBdyZDBqm3rKsuwmXt8viQZO7EHUgoOO0IYeSvun6J+vKUSD3JqZnPbTePq2SKG7A09Jpdzpe+//VYbAlN3fz1tpBEaxpXAlGrWTd5prfBVi2aH8RWBiB2SL552sHawovVAoBDDnA5+Gxl3w1C1
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR03MB6108.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(396003)(39860400002)(346002)(366004)(451199021)(26005)(186003)(41300700001)(122000001)(53546011)(478600001)(64756008)(86362001)(66556008)(66446008)(91956017)(71200400001)(36756003)(76116006)(38070700005)(66946007)(66476007)(316002)(4326008)(6916009)(31696002)(6512007)(6506007)(54906003)(38100700002)(6486002)(5660300002)(8676002)(2906002)(8936002)(2616005)(31686004)(101420200003)(45980500001);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?MkVOc2xVVlJQaElyT2cxUW1kR2NydUlnbGw2RnhVdE5ZNzk2UjQwQ0NOdGUr?=
 =?utf-8?B?dkZsZUpERFBuMnAxVjdWUmVILy9PeER2SmZTaXkxMmRKNXhmemc3bkpBdkp2?=
 =?utf-8?B?cW5kVjZaZ2tqWEJMNUhQRU1uNENYMmpCLzQyZTMvT0ZSMzVZVmNGVFRhR0Iz?=
 =?utf-8?B?NkRsNDVsNTFYMlc5NVJSTm1jYVpKNXZReEkyVVMrNDM0UVYwbXM5TXNwcExY?=
 =?utf-8?B?Qk0xbVdDcGZKL3UrUUxpaUZKN3VCVG5LMDhEUmxsQ1o5eTlUSjZDV2NOS0pn?=
 =?utf-8?B?bFR0eHdhbE5SNmozS2dzUWUrRVF6ZmRtdUdMTDRYbmFxK0tRR1NSd0NNZmxs?=
 =?utf-8?B?b2RYRUVVYWEvdzhDVVZ2bmdHTzFLMkYxMnI5bldkSmtkOG1hU1hGaSthbFZk?=
 =?utf-8?B?dGs5eHRwdkxOYVhtVEh4Y29UcFVhNlBFWkJHOTkxWSthNkUycXp4YjhDV3k2?=
 =?utf-8?B?bEJ4TzdqaHp5aW1TaVFXU0NuT3pQZEJWb1N3Ny8zMWhNM1l5VlltaXl0dkgx?=
 =?utf-8?B?RmZaOUhVWFBGSEZIbDlib0FJUUNCTEtCUEhrMW10b2lHeC9aZ2hYcU90Qnhs?=
 =?utf-8?B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M3lLblNrbmRCSVJNWGJTajFk?=
 =?utf-8?B?bjVZLzlrRVJrNVpycCtoRVVXU1ZISGJqTSswYVlab3FhUnM3L3ZHUldBaEZr?=
 =?utf-8?B?Tmt5UjZXOC9rWXJRZTVpcVAzdG5HYnhLM2FhNGMyd3BQQk54VGRCdG9xZEpQ?=
 =?utf-8?B?d3l2Q2krZ0R3TUtXeit5aVllQi9sWW9rby80QWVpRk9rSWFVQWp4Q1FJQjc4?=
 =?utf-8?B?ZFJqOHp2OEs5L0p1QjVJWjRsdHhOWFNDRHByUmZzai8vd3JKNkxDWlhpYnd2?=
 =?utf-8?B?Q3hqc2d0VytMdFBicUJlQ1RVenhrYk8xcTBLcExPZW41MFdNV3pLbmlRaTNr?=
 =?utf-8?B?ZGlIak00ejJPb0s3TW1ZaWNldFJackVidXFvSmZtbzlWUHJlSW5peGJ6cG9Y?=
 =?utf-8?B?N3VsdURna2FadnFqcVdlTEx0UitlaUdXMTA5SDRnU25VOXdhMFVJeFpxQjlu?=
 =?utf-8?B?NEJkNW9GalVJcloveExobzFCcWYvZk5paFdYN01TQ2xUMkhiNEpGZXVaZ0dO?=
 =?utf-8?B?MndQV0l6aFZ1L0crN1Rxalp3N28wRXBrU3Z2WlQ3d21wQ1Z2S2ROTm0yMjYz?=
 =?utf-8?B?SUZnNVJNVC83MGd0N2VGL3h4b0FTRG9FT0p0Y2d4N2NXdk9ocTVlaFpaRmVY?=
 =?utf-8?B?R2ZGaUtvUDhsTzNGR1QwNm5WdGdwWk1tNjQyTUpvd0dJWVZIUHRncUdBOWJy?=
 =?utf-8?Q?JYnUfophCzSMCYRF+Hm7wNo=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <E54F1041148198468C32B760EED3D954@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DB8PR03MB6108.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 44532c63-74f5-47e8-60b2-08db8deae09a
X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jul 2023 15:13:33.2508
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 4ed3aS8IhNOFPPw4pIivQI7YhSyB5zLR8eOK+TboiHZd7T1lcHMumXMHN6tNZ5j94XVDkxm2yKIiNqvrH5BKYgiXcLr40yD6sS5QRnuR0Cw=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR03MB9780
X-Proofpoint-ORIG-GUID: TmcrXfujWJtQRCmEs5k5dT8TsSoizc1y
X-Proofpoint-GUID: TmcrXfujWJtQRCmEs5k5dT8TsSoizc1y
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-26_06,2023-07-26_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 spamscore=0
 mlxscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501
 mlxlogscore=947 impostorscore=0 suspectscore=0 malwarescore=0
 clxscore=1011 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307260136

DQoNCk9uIDI2LjA3LjIzIDE3OjUwLCBKYW4gQmV1bGljaCB3cm90ZToNCg0KSGVsbG8gSmFuDQoN
Cg0KPiBPbiAyNi4wNy4yMDIzIDE2OjE0LCBPbGVrc2FuZHIgVHlzaGNoZW5rbyB3cm90ZToNCj4+
IEZyb206IE9sZWtzYW5kciBUeXNoY2hlbmtvIDxvbGVrc2FuZHJfdHlzaGNoZW5rb0BlcGFtLmNv
bT4NCj4+DQo+PiBXaXRob3V0IG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dHlwZSwNCj4+ICAgICAgICZsaWJ4bF9fdnNuZF9kZXZ0eXBlLA0KPj4gKyAgICAmbGlieGxf
X3ZpcnRpb19kZXZ0eXBlLA0KPj4gICAgICAgTlVMTA0KPj4gICB9Ow0KPiANCj4gIEZyb20gZGVz
Y3JpcHRpb24gYW5kIG5hdHVyZSBvZiB0aGUgY2hhbmdlIHRoaXMgbG9va3MgbGlrZSBhIEZpeGVz
Og0KPiB0YWcgd291bGQgYmUgd2FycmFudGVkLg0KDQpMb29rcyBsaWtlLCB5ZXMuIFRoYW5rcy4N
Cg0KSSBndWVzcywgdGhpcyBzaG91bGQgcG9pbnQgdG8gdGhlIGNvbW1pdCB0aGF0IGludHJvZHVj
ZWQgDQpsaWJ4bF9fdmlydGlvX2RldnR5cGUNCg0KRml4ZXM6IDQzYmE1MjAyZTJlZSAoJ2xpYnhs
OiBhZGQgc3VwcG9ydCBmb3IgZ2VuZXJpYyB2aXJ0aW8gZGV2aWNlJykNCg0KDQo+IA0KPiBKYW4=


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 15:23:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 15:23:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570542.892397 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgMZ-0000jm-8A; Wed, 26 Jul 2023 15:23:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570542.892397; Wed, 26 Jul 2023 15:23:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgMZ-0000jf-5G; Wed, 26 Jul 2023 15:23:43 +0000
Received: by outflank-mailman (input) for mailman id 570542;
 Wed, 26 Jul 2023 15:23:41 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOgMX-0000jV-QI; Wed, 26 Jul 2023 15:23:41 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOgMX-0005O9-LS; Wed, 26 Jul 2023 15:23:41 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOgMX-00006q-9x; Wed, 26 Jul 2023 15:23:41 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOgMX-0005BI-9T; Wed, 26 Jul 2023 15:23:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=vzXt9EYc4N2eEG6cZxEnF8+G+3pHCTVkuT4Gdh9UBxQ=; b=1Sew/TG4VMIhRs/lNtET5T4bGw
	EDpe95Izft2fo+FSgNJa1ArCCcA8DrNULzYNi8QPHXBykCk2UbjZ21d7wDlTDwj5ukyiPUg4i4md6
	OHzbNKwylaBnPUz+tJinLfNHYBa51LMY3uMNmXOLq/B393XJ7GzF2+m1ZFhf2B3I1WIw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182024-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 182024: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=3d2d4ea026df73c37a7df7e216443cbf652ff892
X-Osstest-Versions-That:
    xen=1f8a6a99b225d34cf608f47b2938092e310f9e03
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 26 Jul 2023 15:23:41 +0000

flight 182024 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182024/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  3d2d4ea026df73c37a7df7e216443cbf652ff892
baseline version:
 xen                  1f8a6a99b225d34cf608f47b2938092e310f9e03

Last test of basis   182015  2023-07-25 22:02:06 Z    0 days
Testing same since   182024  2023-07-26 13:01:24 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Anthony PERARD <anthony.perard@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Roger Pau Monne <roger.pau@citrix.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   1f8a6a99b2..3d2d4ea026  3d2d4ea026df73c37a7df7e216443cbf652ff892 -> smoke


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 15:28:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 15:28:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570548.892408 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgRA-0001Mb-R1; Wed, 26 Jul 2023 15:28:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570548.892408; Wed, 26 Jul 2023 15:28:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgRA-0001MU-NK; Wed, 26 Jul 2023 15:28:28 +0000
Received: by outflank-mailman (input) for mailman id 570548;
 Wed, 26 Jul 2023 15:28:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=oEth=DM=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qOgR9-0001MO-AX
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 15:28:27 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1084d88a-2bc9-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 17:28:26 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-992dcae74e0so1106002966b.3
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 08:28:26 -0700 (PDT)
Received: from [192.168.202.116] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 ci13-20020a170906c34d00b0099bca8b9a31sm728399ejb.100.2023.07.26.08.28.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 08:28:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1084d88a-2bc9-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690385306; x=1690990106;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=SG7ScnTYDVuAu5vg3c2uyxalkGm6IEfVezzFndoNadk=;
        b=WpVQz+kws12+VEM15Oq1QLm7N/ylPFFIbQFXfwegphq5RVgGngfOhzyA292ME8hFn8
         SqgAFiH/KEKv2h8SXJTGAp5dAWUVpwwHPbITA291PBGYcVdTuehz0XozcvXsFDvvAtko
         9xujukbBpqZBR/GzxU1hCUk9d1TR4mJJrYU5xEtqyDV5WdElxFfXPVAzAvGY3QeI3YRD
         EcsmPUf5zvACNPz9dUD7JcIqKl8i2H4vlVW6QwiQvHGGGm6Q23PVjk4VQM27uMcK33sV
         HnUVctqHekS1JivcBiLjwr7FCrN881h6kQyKHnlLkA9VN9JjEvBHzagqrdAWVLLEsBzZ
         dOwA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690385306; x=1690990106;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=SG7ScnTYDVuAu5vg3c2uyxalkGm6IEfVezzFndoNadk=;
        b=GejTCqG2ENcGG2PwNI5yR9Rfxmyf0bEDfSygQGFzYxVH92ZzFDrImAyyWktS6iKplH
         ugOAEALhAJONxU0Qfh2VH2obpTT4vYvyShBAzte8WXDdCr38BOrKFBjH1xZX0y2H78Fc
         o1uy0UMdns1R6vsCwxzXXqmllCdrkvYTWrlq3wV3z3N8j/U0687v4H/VUS7bFru1C1xl
         sQQk+3yKC1cM+wp91V9dOj9G4QNx9T8telw/A0AiYgrs31vVI+6gNgUt5tXiYOJhAnJl
         qEGU7AFHyj7RB77+ZpJfQUwGH95kCj4RgdvocIi0jRqvFJYZXs0lBsiN2PrvicPuA8Ak
         BEhQ==
X-Gm-Message-State: ABy/qLZ6kjqHRmPgfM7PGubHXr2d2GR+Prz+vIN3aQh3EULRyY9xWgDC
	5f8KnL0AHqY/MEFdCYgzYVo=
X-Google-Smtp-Source: APBJJlEDpK3dmPXFq4Dd5q2lydQzZ+v6FTdT5HYrm5zvTMY8PvGAyvCfohVY+kzEgBlu9sgVz8lMWA==
X-Received: by 2002:a17:906:74d8:b0:987:e23f:6d7a with SMTP id z24-20020a17090674d800b00987e23f6d7amr2232341ejl.25.1690385305357;
        Wed, 26 Jul 2023 08:28:25 -0700 (PDT)
Message-ID: <de4204862d2912611b004a9b2067b3743c0fbfbf.camel@gmail.com>
Subject: Re: [PATCH v3 6/8] RISC-V: annotate entry points with type and size
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>, "xen-devel@lists.xenproject.org"
	 <xen-devel@lists.xenproject.org>
Cc: Bobby Eshleman <bobbyeshleman@gmail.com>, Alistair Francis
 <alistair.francis@wdc.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, George Dunlap
 <george.dunlap@citrix.com>,  Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
Date: Wed, 26 Jul 2023 18:28:23 +0300
In-Reply-To: <60e57a9b-8091-0e6a-6066-2364d7d5441a@suse.com>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
	 <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
	 <959bdb6d-9b6c-cde0-9459-c83cd3f58b18@suse.com>
	 <60e57a9b-8091-0e6a-6066-2364d7d5441a@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Mon, 2023-07-10 at 10:58 +0200, Jan Beulich wrote:
> On 10.07.2023 10:56, Jan Beulich wrote:
> > Use the generic framework in xen/linkage.h. No change in generated
> > code
> > except of course the converted symbols change to be hidden ones and
> > gain
> > a valid size.
> >=20
> > Signed-off-by: Jan Beulich <jbeulich@suse.com>
>=20
> I'm sorry, the Cc list was incomplete here. Adding back the remaining
> REST
> maintainers.
>=20
> Jan
>=20
> > ---
> > Probably count_args_exp() should move to macros.h, but I first
> > wanted to
> > see whether anyone can suggest any better approach for checking
> > whether
> > a defined macro expands to nothing.
What about introduction of conditional macros ?
Something similar to:
#include <stdio.h>

#define CONDITIONAL_RETURN(arg1, arg2) CONDITIONAL_RETURN_IMPL(arg1,
arg2, EMPTY)

#define EMPTY(...) ""

#define CONDITIONAL_RETURN_IMPL(arg1, arg2, empty_check) \
    CONDITIONAL_RETURN_##empty_check(arg1, arg2)

#define CONDITIONAL_RETURN_EMPTY(arg1, arg2) \
    CONDITIONAL_RETURN_ARG1(arg1, arg2)

#define CONDITIONAL_RETURN_ARG1(arg1, arg2) arg1, arg2

#define CONDITIONAL_RETURN_ARG2(arg1, arg2) arg1

int main() {
    int a =3D 42;
    const char* b =3D "hello";

    // Second argument is not empty, both arguments are returned
    printf("Case 1: %d, %s\n", CONDITIONAL_RETURN(a, b));  // Prints:
Case 1: 42, hello

    // Second argument is empty, only the first argument is returned
    printf("Case 2: %d, %s\n", CONDITIONAL_RETURN(a, "")); // Prints:
Case 2: 42,

    return 0;
}

and then define DO_CODE_ALIGN using CONDITIONAL_RETURN?


~ Oleksii

> > ---
> > v3: New.
> >=20
> > --- a/xen/arch/riscv/entry.S
> > +++ b/xen/arch/riscv/entry.S
> > @@ -5,7 +5,7 @@
> > =C2=A0#include <asm/traps.h>
> > =C2=A0
> > =C2=A0/* WIP: only works while interrupting Xen context */
> > -ENTRY(handle_trap)
> > +FUNC(handle_trap)
> > =C2=A0
> > =C2=A0=C2=A0=C2=A0=C2=A0 /* Exceptions from xen */
> > =C2=A0save_to_stack:
> > @@ -92,3 +92,4 @@ restore_registers:
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 REG_L=C2=A0=C2=A0 sp, =
CPU_USER_REGS_SP(sp)
> > =C2=A0
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sret
> > +END(handle_trap)
> > --- a/xen/arch/riscv/include/asm/asm.h
> > +++ b/xen/arch/riscv/include/asm/asm.h
> > @@ -7,6 +7,7 @@
> > =C2=A0#define _ASM_RISCV_ASM_H
> > =C2=A0
> > =C2=A0#ifdef __ASSEMBLY__
> > +#include <xen/linkage.h>
> > =C2=A0#define __ASM_STR(x)=C2=A0=C2=A0=C2=A0x
> > =C2=A0#else
> > =C2=A0#define __ASM_STR(x)=C2=A0=C2=A0=C2=A0#x
> > --- a/xen/arch/riscv/include/asm/config.h
> > +++ b/xen/arch/riscv/include/asm/config.h
> > @@ -67,12 +67,8 @@
> > =C2=A0
> > =C2=A0/* Linkage for RISCV */
> > =C2=A0#ifdef __ASSEMBLY__
> > -#define ALIGN .align 4
> > -
> > -#define ENTRY(name)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 \
> > -=C2=A0 .globl name;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 \
> > -=C2=A0 ALIGN;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 \
> > -=C2=A0 name:
> > +#define CODE_ALIGN 16
> > +#define CODE_FILL /* empty */
> > =C2=A0#endif
> > =C2=A0
> > =C2=A0#ifdef CONFIG_RISCV_64
> > --- a/xen/arch/riscv/riscv64/head.S
> > +++ b/xen/arch/riscv/riscv64/head.S
> > @@ -8,7 +8,7 @@
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0 a0=
 -> hart_id ( bootcpu_id )
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0 a1=
 -> dtb_base=20
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */
> > -ENTRY(start)
> > +FUNC(start)
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* Mask all interrupts=
 */
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 csrw=C2=A0=C2=A0=C2=A0=
 CSR_SIE, zero
> > =C2=A0
> > @@ -30,13 +30,14 @@ ENTRY(start)
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 jal=C2=A0=C2=A0=C2=A0=
=C2=A0 reset_stack
> > =C2=A0
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tail=C2=A0=C2=A0=C2=A0=
 start_xen
> > +END(start)
> > =C2=A0
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .section .text, "ax", =
%progbits
> > =C2=A0
> > -ENTRY(reset_stack)
> > +FUNC(reset_stack)
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 la=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 sp, cpu0_boot_stack
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 li=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 t0, STACK_SIZE
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 add=C2=A0=C2=A0=C2=A0=
=C2=A0 sp, sp, t0
> > =C2=A0
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret
> > -
> > +END(reset_stack)
> > --- a/xen/include/xen/linkage.h
> > +++ b/xen/include/xen/linkage.h
> > @@ -37,17 +37,28 @@
> > =C2=A0
> > =C2=A0#define END(name) .size name, . - name
> > =C2=A0
> > +/*
> > + * CODE_FILL in particular may need to expand to nothing (e.g. for
> > RISC-V), in
> > + * which case we also need to get rid of the comma in the .balign
> > directive.
> > + */
> > +#define count_args_exp(args...) count_args(args)
> > +#if count_args_exp(CODE_FILL)
> > +# define DO_CODE_ALIGN(algn...) LASTARG(CODE_ALIGN, ## algn),
> > CODE_FILL
> > +#else
> > +# define DO_CODE_ALIGN(algn...) LASTARG(CODE_ALIGN, ## algn)
> > +#endif
> > +
> > =C2=A0#define FUNC(name, algn...) \
> > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SYM(name, FUNC, GLOBAL, LAS=
TARG(CODE_ALIGN, ## algn),
> > CODE_FILL)
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SYM(name, FUNC, GLOBAL, DO_=
CODE_ALIGN(algn))
> > =C2=A0#define LABEL(name, algn...) \
> > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SYM(name, NONE, GLOBAL, LAS=
TARG(CODE_ALIGN, ## algn),
> > CODE_FILL)
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SYM(name, NONE, GLOBAL, DO_=
CODE_ALIGN(algn))
> > =C2=A0#define DATA(name, algn...) \
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SYM(name, DATA, GLOBAL=
, LASTARG(DATA_ALIGN, ## algn),
> > DATA_FILL)
> > =C2=A0
> > =C2=A0#define FUNC_LOCAL(name, algn...) \
> > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SYM(name, FUNC, LOCAL, LAST=
ARG(CODE_ALIGN, ## algn),
> > CODE_FILL)
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SYM(name, FUNC, LOCAL, DO_C=
ODE_ALIGN(algn))
> > =C2=A0#define LABEL_LOCAL(name, algn...) \
> > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SYM(name, NONE, LOCAL, LAST=
ARG(CODE_ALIGN, ## algn),
> > CODE_FILL)
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SYM(name, NONE, LOCAL, DO_C=
ODE_ALIGN(algn))
> > =C2=A0#define DATA_LOCAL(name, algn...) \
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SYM(name, DATA, LOCAL,=
 LASTARG(DATA_ALIGN, ## algn),
> > DATA_FILL)
> > =C2=A0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 15:32:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 15:32:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570550.892418 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgUj-0002mA-90; Wed, 26 Jul 2023 15:32:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570550.892418; Wed, 26 Jul 2023 15:32:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgUj-0002m3-6N; Wed, 26 Jul 2023 15:32:09 +0000
Received: by outflank-mailman (input) for mailman id 570550;
 Wed, 26 Jul 2023 15:32:08 +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 <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOgUi-0002lx-ET
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 15:32:08 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20622.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::622])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 93b07a7d-2bc9-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 17:32:06 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB8361.eurprd04.prod.outlook.com (2603:10a6:10:24d::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 15:32:04 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 15:32:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 93b07a7d-2bc9-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KArKxr1HL3kau/2MquWtbpDr1IKwnD298WBQSEWJzniCvLyw2gV4oGebfJwJv357tz9RzSBRY9u6oOAtXjJZynYLL9AE9Sdi08xw1QYicpbyo2TVJdWmDHkvpMiESD984NHMZm940O8uSFcguIKR1fCvBOxkW3+RBrLwH39qQUe+kDfNUPxluks27Gg+g/AOEp/DfbKP4f0SurXIBHWXeAiwTSY/dpvFiy8WXMF7ymb4aVbzbUODTHNsRsuzzq2gd3CbnFS32hrU6kkhXD0BgQxTxx05BFLtijc82VRjtAR2+HZ9NFrrbYVFZ3khac8QsC+Jg00S350fbUer45tDfQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=APNkYEc1Pe7otDgPHN053skWp7ycJiqiy0FuABNe7ds=;
 b=NTSk5k7Ouso3UgrvIckMsRED5ITrNKiEavJuKfMuCJbpKEprnhKpWKaQGgbqKfJP28JZq9lmADGsX2RKssC0wf8Dz6RmjhWnJAiXFY3mxzzY/fu+S0HTRbDAuJXBj2XSElRWwlVTtsrGEQPOxT/CuVVsUjl5LgjcVTWhsLpuvxqK8a/iO3VdyHQufWcABGk76HtsGk7MS1jkY3gA58jeYUxDsOK1E+GA3eHjq7yU/d+mHTyUwFy+df4F79SXqm6gkg0bR7XCNd431Io2nYZQzgawtJqNtiUpuRezkvCVQmxtcnZU7CNqwyQUsuBvHcZTI1Cnu+hZzMqW/1HTA3fgkA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=APNkYEc1Pe7otDgPHN053skWp7ycJiqiy0FuABNe7ds=;
 b=AEpYUiu+cTvxX79nHPMAY5O4AqlpFgOLfQqOIpp6vKDUJ+ppfVDiHM/Ropj0++9QAgm1PG0Qlcurf/7wDid/hGQY4UeJ/XX+qmPj4C9DlMJnmPxQnaR1Zfgzov7hcN1Z16OP+NcL7ZWdkkTN13ZmARTCdtRAmz8KYYqq5TyCoackCm4QoPqnllB2jMOpXJ6R572WqCo4gYMGlx6AGcudmA3MXSIrxjDAo1eG8PGBMUyc2qSUxxr4VXoOMTi0ATW3vUSK8kPylK6sEP+d4r6jylceFXtn/dSRdTkqQpXfKVpcXaAF4/4jfHKUC5hqDa4Widi9xSSn4F32fXNcQWUVWQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ab870428-fbce-240a-d4c7-4298fbed4050@suse.com>
Date: Wed, 26 Jul 2023 17:32:02 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v5 3/4] xen/ppc: Implement early serial printk on pseries
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 xen-devel@lists.xenproject.org
References: <cover.1689958538.git.sanastasio@raptorengineering.com>
 <f326168638ae05f5f387e4fa018ac2ed057bac8c.1689958538.git.sanastasio@raptorengineering.com>
 <019914c7-c6ca-70b9-6c90-e1891f4201c4@suse.com>
 <cf7e418f-763a-6f27-d498-c88b19c8a9eb@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <cf7e418f-763a-6f27-d498-c88b19c8a9eb@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0175.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b4::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB8361:EE_
X-MS-Office365-Filtering-Correlation-Id: 35241951-eaf3-4726-17af-08db8ded76ca
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	HgsV9T+IrYC7g1RVPCR0or0YcSFkMOameu8D1IGzQ4dfsZIpr8t231dC60ncf8dqGPVI4hV4AJezTZ1IVUtrQHQ4Yc3Lr8PU79rV409fwFhZKMg7S7TlZMchlSOKxsERgI1AHhQo4+erlhOX9oCpQ4iEcAmpJBEF04HYswhxnqHnECHYPp4biAODIqEHKN+k6dDg/5R0QX3poFEApUdrk0uS5RGo425GMnhaLpGtmh+D+YAWQq4Cl5V8d0u23Sb6racLcb8zp3lzq3a3Od1bpwFN5EbPvi/U5jaPWGtCLmLyxg5RqcmMCz/d3F6Y/tdZLQ9caGlCzsXme7vPvIfrJBurYRgE4cl1LS6xwXkjuZI7MkkO4UIUGmrZW+3COhakafCJYUp2NE5lEKceaUVxaDIArgdDDXSZsFJlr0Xnj2BBCXMHF0RsNmU8BVLqK/TOeiIX9li93j3xqkViEspiCp2wDmgJ9/aG8jfxdXg6lrUKwRNcaJTZEnu7hqhjS2pobB8sLqqI4P9IWq4idU/4apkw4L8VhHiyqB1QymxNusWgJPNzXI+W/Rw1L5FPsXwGvkQxp4lDdjN3SfUPPDxS/rg5hSr5+1qKq+wVUGAKcUp029rJhOm+EtAnZXx7T5oYhBxqd1nms8sj+rTr6BbG2Q==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(396003)(346002)(136003)(366004)(451199021)(478600001)(31696002)(54906003)(38100700002)(86362001)(6916009)(4326008)(316002)(66476007)(66556008)(66946007)(6506007)(186003)(6512007)(6486002)(26005)(53546011)(5660300002)(8676002)(8936002)(41300700001)(2906002)(2616005)(36756003)(83380400001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZTFTQ3hlVWpwY1VYRU9yU3NzbkUxcE1lNW1QY0dubjVpNC9zVlphSS9sQXVm?=
 =?utf-8?B?OEl4THVNNlJHZmc4V0xMV0VWVnVDZnhqZHFWSUVyd0FBbEREbTUzTTA3eGdG?=
 =?utf-8?B?aGd1bE0ybXp2eVdNcFFOMGs1cHZHOWJCK09hM1p6STdGL3NKQmhxK0NwZlJz?=
 =?utf-8?B?WmM1NzJWUmprOWhEb1dOTDZYNWNEc3dwNE9MQXNsQytiSmZKRDdEVTNtS1pr?=
 =?utf-8?B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npZeG1xQlNjam9h?=
 =?utf-8?B?K1lKbFdKSUJ0YlJwNDBRaWpDRVhhNlk0dmQ4NGdjY3J2eGxwaExDa05RVVNE?=
 =?utf-8?B?VG9DVVpQeG90Um83RmMwd2JGSG9WSjdTVFV2VVpBRDRtMXA1RmpaZ1FLVnNp?=
 =?utf-8?Q?sfMo+RVpn/bIzb73MzkkGy/Qp?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 35241951-eaf3-4726-17af-08db8ded76ca
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 15:32:04.4488
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: VP74jqyXoWVtOSfQMC7eaig5dLjz5iFevzeVIF594VkmslWxL2nM1RGcQuhP8Ng+A3IU8stUFv8uTi9pHxpqeQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8361

On 24.07.2023 17:06, Shawn Anastasio wrote:
> On 7/24/23 7:40 AM, Jan Beulich wrote:
>> On 21.07.2023 19:02, Shawn Anastasio wrote:
>>> On typical Power VMs (e.g. QEMU's -M pseries), a variety of services
>>> including an early serial console are provided by Open Firmware.
>>> Implement the required interfaces to call into Open Firmware and write
>>> to the serial console.
>>>
>>> Since Open Firmware runs in 32-bit Big Endian mode and Xen runs in
>>> 64-bit Little Endian mode, a thunk is required to save/restore
>>> any potentially-clobbered registers as well as to perform the
>>> required endianness switch. Thankfully, linux already has such
>>> a routine, which was imported into ppc64/of-call.S.
>>>
>>> Support for bare metal (PowerNV) will be implemented in a future
>>> patch.
>>>
>>> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
>>
>> While I've committed the earlier two patches, I had to back out this
>> one. In my environment (gcc13) the build fails due an unresolved
>> reference to memset() out of boot-of.c (supposedly from of_call()).
> 
> Does removing the `{ 0 }` initializer to `struct of_service s` on line
> 43 resolve this?

Yes, that's what's causing the call (and removing, whether or not correct,
helps).

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 15:41:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 15:41:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570557.892430 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgdU-0004NU-8n; Wed, 26 Jul 2023 15:41:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570557.892430; Wed, 26 Jul 2023 15:41:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgdU-0004NN-6F; Wed, 26 Jul 2023 15:41:12 +0000
Received: by outflank-mailman (input) for mailman id 570557;
 Wed, 26 Jul 2023 15:41:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jA8X=DM=arm.com=Rahul.Singh@srs-se1.protection.inumbo.net>)
 id 1qOgdT-0004NH-7m
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 15:41:11 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20627.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::627])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d6b0bf32-2bca-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 17:41:08 +0200 (CEST)
Received: from DB9PR02CA0021.eurprd02.prod.outlook.com (2603:10a6:10:1d9::26)
 by AM9PR08MB5907.eurprd08.prod.outlook.com (2603:10a6:20b:2da::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 15:41:05 +0000
Received: from DBAEUR03FT021.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:1d9:cafe::a6) by DB9PR02CA0021.outlook.office365.com
 (2603:10a6:10:1d9::26) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29 via Frontend
 Transport; Wed, 26 Jul 2023 15:41:05 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT021.mail.protection.outlook.com (100.127.142.184) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6631.29 via Frontend Transport; Wed, 26 Jul 2023 15:41:04 +0000
Received: ("Tessian outbound f9124736ff4f:v145");
 Wed, 26 Jul 2023 15:41:04 +0000
Received: from 586bf998e5a3.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 BD2ED1A4-EB80-426A-8863-B6F2807F1993.1; 
 Wed, 26 Jul 2023 15:40:58 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 586bf998e5a3.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 26 Jul 2023 15:40:58 +0000
Received: from AS8PR08MB7158.eurprd08.prod.outlook.com (2603:10a6:20b:404::24)
 by AS8PR08MB8897.eurprd08.prod.outlook.com (2603:10a6:20b:5b8::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 15:40:55 +0000
Received: from AS8PR08MB7158.eurprd08.prod.outlook.com
 ([fe80::845:4a4f:5c99:2788]) by AS8PR08MB7158.eurprd08.prod.outlook.com
 ([fe80::845:4a4f:5c99:2788%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023
 15:40:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d6b0bf32-2bca-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=HiPVImh54WcPda150a82xUPDrANFLQnSjE/Im/HPrG0=;
 b=7zk8GFdixmwbFe7OFyHimdPJmFKr+iMQJ6eUpQ4o0/VwXWKIUsNF78I03DBY48YvRC6wC+1fik9DbbUchf6FgzQu8NNPN5MJj9jhNekoOthKNOzFx/kaMgP3dzrsKLdLEJ+JfXZ2eWM1dHoCTV0Y07X95pP40ZibrCSDX3Fusmo=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 332b62812d23cc47
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=QF/9jetbFdYsieSnTr1edlWQ3egXewbEtoIem1C2o3JELysK3UZjb15K22ukVretBqY4yEBNpiDd0a/w6R10pyHCMJXJfFs36Tp0lBxNX/7MEc1sx64lCTYmyrTpIFDnLT2Z3yH6DxEdMJhVA7JN5CO8sqknSXjAfhJLW0b0lzaP4qLdl5FiX+/pqpwtQ3aowmajvXBOAL6YV3Rb0PIGX8hkLpAH3rcpBbwtpkvmdVFbqAkH2NJLWuZNWTBq8nlVNPuJ5WoaBVy3BU+nJpbARQhFNB4+E/UfmwZiKQbaruzlsPce/YiAIG+7Ycr8kAmWQYbbbOmEqWGMhBesMPMQIg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=HiPVImh54WcPda150a82xUPDrANFLQnSjE/Im/HPrG0=;
 b=DdglyCVn4DAuEd5TXszERbHFwqr9QiR7q/U7Uy9FijnQpYghTTb4gRmA+qWlW5Yzb3b2/8xYfDs2j1vG/dULgS6Z/cIlMyBBYQh3DgMXCEh/z4nUPifZDs+hIYpK8WQskb/yrG/JneiJCms/e9e59VVW00qMUVWUjpA/jLVeT8d3QIquuXPLG2CeNW+tiYyMZdQu8z/yNM7iBZxKWfHlEA/nng44DPhEteEo5VfmvybrdJuzNJPlBZb6xw0X4O/nM44kiAeOAZgxqkBtttBqiNCualyaXABUzOyk9IibVHGclbUdDIsPy4lRaeqXrAx+cFQqCb8N3LLC5/cLv4Jh2Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=HiPVImh54WcPda150a82xUPDrANFLQnSjE/Im/HPrG0=;
 b=7zk8GFdixmwbFe7OFyHimdPJmFKr+iMQJ6eUpQ4o0/VwXWKIUsNF78I03DBY48YvRC6wC+1fik9DbbUchf6FgzQu8NNPN5MJj9jhNekoOthKNOzFx/kaMgP3dzrsKLdLEJ+JfXZ2eWM1dHoCTV0Y07X95pP40ZibrCSDX3Fusmo=
From: Rahul Singh <Rahul.Singh@arm.com>
To: Roger Pau Monne <roger.pau@citrix.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Jan Beulich
	<jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu
	<wl@xen.org>, "Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: Re: [PATCH v2] vpci: add permission checks to map_range()
Thread-Topic: [PATCH v2] vpci: add permission checks to map_range()
Thread-Index: AQHZv8pFQRXFGkDWd0GJKKtbGNV896/ML4QA
Date: Wed, 26 Jul 2023 15:40:55 +0000
Message-ID: <CEA89699-7807-4949-BA03-2819FA0D89F7@arm.com>
References: <20230726140132.80151-1-roger.pau@citrix.com>
In-Reply-To: <20230726140132.80151-1-roger.pau@citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AS8PR08MB7158:EE_|AS8PR08MB8897:EE_|DBAEUR03FT021:EE_|AM9PR08MB5907:EE_
X-MS-Office365-Filtering-Correlation-Id: edbcf8ff-3bf4-4727-a8e4-08db8deeb8fa
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 NRV5NsmrAFxZMOQRObXMnYk70VpabaQkq2Ky15pGMfCdEVDdvMPYE1HFVVFhkD4CBT4o+qfEWMjDTKpMqhBeWLmpzMaWG196iKkMvB10dVLAblkAfKX9fIrJRWYWRae5ydZkX3MX/pfaBb6iF6eKys8V+DvjDLHFmmvL9lOB+CP7iCbqNeIzBoQlfujZkcni31V5Er5+vyfz4mDxUA70g3oJLb1uFGFUFuqbZHYpzl6P+Ob+rSviTOoQHhazleAnhhXcUEs9BYHfade6VIzRTTa8OcHIF+qSWZgEXMDtTMj4727/BdB+gfDiH7dEbdcZRLvz9G4Gg86PHATZeADKgtVtsLuXAoQF9R9O9eA25zm6BqvHs2tYW0tuyQ3EFkGMWY1bHhxVbrq/ERzFDGAS1oqNj46lciPE5z2TA7wUFvRtbYV9CDVBGhZQBYCD2I8sZPX8xbUY8OdhvFSpzbc+/EIHm/enozVTBBsvsRlS9oieA+zKQvi6jGhxpahfktzt0V+CzoAiV/L6RgVYHP+Xae5ozsbXvAwoUtLnTfjjjkObREQCUYiyMBvtlS3P4GJkbtU7GwXhUHyQAswiSLjaAP7sjZwqFyH0Ep0GAQdeTENbsFNPhQaanJ3pbdES5LgYvdwmw5EuC1fQU5T9uBi51w==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB7158.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(366004)(376002)(39860400002)(396003)(136003)(451199021)(8676002)(5660300002)(2616005)(186003)(33656002)(26005)(6506007)(53546011)(86362001)(8936002)(71200400001)(6916009)(4326008)(316002)(6486002)(38070700005)(64756008)(41300700001)(66556008)(66946007)(66446008)(6512007)(66476007)(76116006)(478600001)(4744005)(91956017)(122000001)(54906003)(2906002)(38100700002)(36756003)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <AEDB3B9B7D01D74280E1E569E58F3F9C@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8897
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT021.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	361c74d7-308c-492f-eccc-08db8deeb385
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	0K/qTPoHHHo0HEMJgkI/iRujPxVrwbmJ9tMoIcXDi8OH7njyNfhYcWk90AA1stLj1T8UH9riCw+2AHNpWdP0thzEkyyHyo7JM4xZxQtUlqmr81KC0dAyUn6dEsBOGuWuhixodMBbY77OvqYkbWC4tkMnrLwgsXj3kLIIM/yW/qoTOnMCSBqX54YP7EhmDPWID8oBi+cAetWXZsUBHIOzx83+YEB2jMEdd0QHjj5I9M0ijbu69589QFiE2AySzXzB0Dbc1Iquz0v1MLNlnHL4Fg6X0qUqZC65mypnpDzhIRr32G3Ze3Q7IE+I5DqZizAY0tOFoEIR6IGvdflLiK7G2ZFmqABgqbvcEFqy1QDqG9QBvtCISrt1yQ4DRU2g1xaUWqhcO5qtq/gl9IH+ojcakds6LSsibVcO9wcxcI8BuvM52YmfFN2zgxgoyL0fmnVD7d9zbOzOz5kvmKUqa5drXaLlSR69xtjHj5KTg2R2igtVUETThcpvHStnjScQp8eaeWzHAglC8hWK2Xhe0/A2ZU9UcR80rH+W9xqnsjO2zyAraJ5MoW9wQPMkQThtsnbdLUrW+jQoeqosUOinNO/wYcOUOOLI6EA2g0AmP8vfy9aAZ0sQHfANZneTc6dhZhrqZUXA5WzZ6ApNsUgM5yp69NXUPKZwntM+z8UvxIVraRZHZBAnPomODP2agLPqJ8N2hfWHaen1Ndjy1/vUQjIa5/wl0uQKuJbYoavWB7+q3m2j1+WW1lr0Bq/NeD8GHfW5
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(346002)(376002)(136003)(451199021)(82310400008)(36840700001)(40470700004)(46966006)(6486002)(356005)(82740400003)(478600001)(47076005)(53546011)(6506007)(107886003)(6512007)(26005)(4326008)(81166007)(54906003)(70206006)(70586007)(336012)(186003)(36860700001)(2616005)(5660300002)(8676002)(6862004)(8936002)(33656002)(40460700003)(4744005)(316002)(41300700001)(2906002)(40480700001)(86362001)(36756003);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 15:41:04.8068
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: edbcf8ff-3bf4-4727-a8e4-08db8deeb8fa
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT021.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB5907

SGkgUm9nZXIsDQoN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yLnBhdUBjaXRyaXguY29tPg0KDQpJIHRlc3RlZCB0aGUgcGF0Y2ggb24gQVJNIGJvYXJk
IHdpdGggdlBDSSBlbmFibGVkIGV2ZXJ5dGhpbmcgd29ya3MuDQoNClJldmlld2VkLWJ5OiBSYWh1
bCBTaW5naCA8cmFodWwuc2luZ2hAYXJtLmNvbT4NClRlc3RlZC1ieTogUmFodWwgU2luZ2ggPHJh
aHVsLnNpbmdoQGFybS5jb20+DQoNClJlZ2FyZHMsDQpSYWh1bA0KDQo=


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 15:42:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 15:42:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570559.892440 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgek-0004tn-JU; Wed, 26 Jul 2023 15:42:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570559.892440; Wed, 26 Jul 2023 15:42:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgek-0004tg-Gi; Wed, 26 Jul 2023 15:42:30 +0000
Received: by outflank-mailman (input) for mailman id 570559;
 Wed, 26 Jul 2023 15:42:28 +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
 <SRS0=cp0x=DM=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qOgei-0004tK-O4
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 15:42:28 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 03f9a5a9-2bcb-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 17:42:25 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 62C4A82857CB;
 Wed, 26 Jul 2023 10:42:23 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id 9Qd7TQYlRt_R; Wed, 26 Jul 2023 10:42:22 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 8E0DE82858BD;
 Wed, 26 Jul 2023 10:42:22 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id Css-cbOf54Gl; Wed, 26 Jul 2023 10:42:22 -0500 (CDT)
Received: from [192.168.82.115] (c-98-222-97-219.hsd1.il.comcast.net
 [98.222.97.219])
 by mail.rptsys.com (Postfix) with ESMTPSA id 979FA82857CB;
 Wed, 26 Jul 2023 10:42:21 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 03f9a5a9-2bcb-11ee-8613-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 8E0DE82858BD
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1690386142; bh=vFrBIsBlrdha+MVX+yrqK5PHmRm3VMuYHZwSyCyQo5Y=;
	h=Message-ID:Date:MIME-Version:To:From;
	b=GOTPzW75t1kBGanxr1juW5MSsKZ++jlU+oIEpCXOvE65AkOGanji8cbw9JeDa0U6G
	 UgoujAWPOTqu1To5UH4pdMZBdOk1Wdv3NzcayLDGw6cYiBLjsfAN2KCiAiLyj3fug9
	 hoJDCujdUsLDkSxZmEU/jtMLqMRchF2sjf02+cTw=
X-Virus-Scanned: amavisd-new at rptsys.com
Message-ID: <825b00d0-432b-5db8-fe12-2266dffdf06f@raptorengineering.com>
Date: Wed, 26 Jul 2023 10:42:20 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v5 3/4] xen/ppc: Implement early serial printk on pseries
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 xen-devel@lists.xenproject.org
References: <cover.1689958538.git.sanastasio@raptorengineering.com>
 <f326168638ae05f5f387e4fa018ac2ed057bac8c.1689958538.git.sanastasio@raptorengineering.com>
 <019914c7-c6ca-70b9-6c90-e1891f4201c4@suse.com>
 <cf7e418f-763a-6f27-d498-c88b19c8a9eb@raptorengineering.com>
 <ab870428-fbce-240a-d4c7-4298fbed4050@suse.com>
From: Shawn Anastasio <sanastasio@raptorengineering.com>
In-Reply-To: <ab870428-fbce-240a-d4c7-4298fbed4050@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 7/26/23 10:32 AM, Jan Beulich wrote:
> On 24.07.2023 17:06, Shawn Anastasio wrote:
>> On 7/24/23 7:40 AM, Jan Beulich wrote:
>>> On 21.07.2023 19:02, Shawn Anastasio wrote:
>>>> On typical Power VMs (e.g. QEMU's -M pseries), a variety of services
>>>> including an early serial console are provided by Open Firmware.
>>>> Implement the required interfaces to call into Open Firmware and write
>>>> to the serial console.
>>>>
>>>> Since Open Firmware runs in 32-bit Big Endian mode and Xen runs in
>>>> 64-bit Little Endian mode, a thunk is required to save/restore
>>>> any potentially-clobbered registers as well as to perform the
>>>> required endianness switch. Thankfully, linux already has such
>>>> a routine, which was imported into ppc64/of-call.S.
>>>>
>>>> Support for bare metal (PowerNV) will be implemented in a future
>>>> patch.
>>>>
>>>> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
>>>
>>> While I've committed the earlier two patches, I had to back out this
>>> one. In my environment (gcc13) the build fails due an unresolved
>>> reference to memset() out of boot-of.c (supposedly from of_call()).
>>
>> Does removing the `{ 0 }` initializer to `struct of_service s` on line
>> 43 resolve this?
> 
> Yes, that's what's causing the call (and removing, whether or not correct,
> helps).

Thanks for confirming. Removing it should be fine since the code
manually initializes all of the other fields of the struct. The only
behavioral difference is that the members of `ofs_args` at indices >=
nargs would be left uninitialized. This shouldn't be an issue though
since we're guarding reads of the array on `nargs` and `nrets` and thus
only read explicitly initialized values (and of course, firmware would
do the same).

Naturally we can't avoid memset calls forever. I have lib/ building
locally, but if we could get this series in without having to make those
changes here that'd be great.

> Jan

Thanks,
Shawn



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 15:43:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 15:43:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570566.892450 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgfz-0005SH-Uy; Wed, 26 Jul 2023 15:43:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570566.892450; Wed, 26 Jul 2023 15:43:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgfz-0005SA-Rr; Wed, 26 Jul 2023 15:43:47 +0000
Received: by outflank-mailman (input) for mailman id 570566;
 Wed, 26 Jul 2023 15:43:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOgfy-0005RY-5S
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 15:43:46 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on061e.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::61e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 340c492b-2bcb-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 17:43:45 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VI1PR04MB9908.eurprd04.prod.outlook.com (2603:10a6:800:1d0::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Wed, 26 Jul
 2023 15:43:41 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 15:43:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 340c492b-2bcb-11ee-b242-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CnB775esu5VDFHyzoru35TYHjt2JKw3ogCCRhFJyzGbG9sAxKnzGqhoim1A4Rut+ODN9Yfv+4ntkR1UZIBkCZ5/XAMNQ9WMq5wrcu0hjcncDJ9M83gCQeKgVOXe+ccL4EdMQ0RuJxNrEvN8UZi0LuJKxoPOwqqJdigThtQGGRXqFCz1TE8jPYm32f84aLSfLBtLFRmrMhEol2cr0KqRLUGxMG8zHVxYPZ61IfxteqdWPM45RlG8tzgQfYCS8khGQm/R8rFBMfNtPnxHg7SkVjmdAkJ0LYbNhQ8te+xuu0gELhQMInK/MJlFjaVOWN/spacEukF9A+Q9B7Yfwwszf+Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=pMC4RJzItodQMYR5VcVof/3DJxX9dbh0E7tFCUgdzVQ=;
 b=NcujP57KHVEpv42y9aCUng9k81IxuOqvti2FDIMisx7m/Kv24wKw0DpuRQzCMtbuSqvoKtZA9jsmdiqds1NiqcDjrR6KERQjVmv32WaeYptHGnJ1UN04MgU39/AQfHMOPfrHY2RmLRw7TbeeFtLRjj4At0wsvd45mcqbrYj050t0BXdXn3C8uoELInc1RERys8CZUYGErXXms8rxu6CRl6KBif3IXRZ5fGrED7BtuIaXEz5oC3X83ACQq0eKP//OIX9bFNka+KfVmEOzQe4dogRKSYepPC5l5eEjfwBUz2Rw21OfyCFRoWevK614uzqiBT0sjjGqt6QAWYyKttEg9w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=pMC4RJzItodQMYR5VcVof/3DJxX9dbh0E7tFCUgdzVQ=;
 b=g+kcOse/yf4VGC4sELA9a98P+G6WzPekkokQyDGN31djxF/eiN9vr+UPjp/icb3V3CF9LrX2kohg33Gp525XAyPbkt1MFhbi9iRN6wGP6QykzQpJJnBx/pX6JkDdGmqh5sYm/cO2Kb6lDoje04TrPZRuWUG5PkgllWcRCQDyj/ygD7TfZ6URjl9KOf1aRSRH/+PGDuH54vEvimX1eYsJDdVnJirSD+cPT4XkwZGcigdCboZhAHr37Q9kh2AVtaE9ysNpPNZsZxOs3ofhyuNnj2oC3hZSzM9RpDXEiqxBHyh0sIFW8VzYe4OgLnW31Jx8Xg6TnXFeUZp8BAadPkDOoA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <f721e9e2-b73e-71ec-c337-bc3ad2352246@suse.com>
Date: Wed, 26 Jul 2023 17:43:38 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 6/8] RISC-V: annotate entry points with type and size
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Bobby Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
 <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
 <959bdb6d-9b6c-cde0-9459-c83cd3f58b18@suse.com>
 <60e57a9b-8091-0e6a-6066-2364d7d5441a@suse.com>
 <de4204862d2912611b004a9b2067b3743c0fbfbf.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <de4204862d2912611b004a9b2067b3743c0fbfbf.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0139.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:96::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VI1PR04MB9908:EE_
X-MS-Office365-Filtering-Correlation-Id: 2395a9c2-9ccb-472a-0d1e-08db8def1600
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	UC3bXPVDl1f8OI2vUXo4X3kJ7EjmrIjRz/Ep7a4u7vqFWws2GZGEpgJeKXPGmsnm/WSKv65u0WXSKh51WHti02LXIMyX2LInc+sJCkp594NoobPMTAx0oNqcMjVS0WxnD1KQ/nowRWaywsXMGFsYR19qcov5fIDl5PWHtfWCBKk4D69fd+FHtWpqHlNgaDS/Yb9G5Ah5VMWJFnS54kDgseHnohkbG7V6qdDN0Lqf/HN3Ls3qGZD7jptXKXlxgiTQDvJnHw9C9kb11SzoVe77L5ydhOAsttbWzMz5Ghb+5zuGYqeqP+ZjZCt+6kPHoD91aXH7U5A2tL/dnb00an0B/AUy7tdOWH0lENvyYpNN9oxrXzqCp3XH0uxP/uK7t+HOQIv+eomRV5aTdUWthOrX/4c2BsovN3OUL75YSTeixN/kvsYNNIPENte3UekYjJ5o5pQdH1db9HhlBzaLg/7+UpUi8EOHBXi6NzD9xDGFpD+0tEU96GhkkEso0Dq/3ATM/+a8NY2nCetbLnoyBR4YYsr36vCEK3HKL5U/fbTwQuhpDxow8sKT/EnvmkKL2w1WAVRxkiT0dUHNaW7gClKClSgHoo29pBUKb/MrUsAQvGeQZaa9X3zqeBKYdbfndUeKzpXy1jQ7T6yUmkSTwqmb5g==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(396003)(136003)(376002)(39860400002)(451199021)(54906003)(66556008)(66946007)(66476007)(2616005)(36756003)(6512007)(83380400001)(86362001)(31696002)(38100700002)(186003)(6506007)(6666004)(26005)(6486002)(53546011)(478600001)(31686004)(41300700001)(5660300002)(2906002)(316002)(6916009)(4326008)(8676002)(8936002)(7416002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZXRSMXMwN2ZFS2M3UkYrc0dWbGluZkp2OG1PQkdaU01EQ1Z0Y2ViL1lZMWh2?=
 =?utf-8?B?WTgxME5ISEgrT1p4TjdFSm1BQytYVnVBY1ltTStoK3FsYlZ5WUZaZHNJc3k3?=
 =?utf-8?B?SVBBdVZKVUFVOVUxaFEzVjhYbllMRzZlK3VWZkwzSXI1OUNOOGM1WkRMS1Vi?=
 =?utf-8?B?U3VmWkZWRTNDRkcycnpSY1JvOEZJR1FtZEdEYTc0WXVqbnlSWC9hR0c0bTVP?=
 =?utf-8?B?SGRtTHNjSkpkYzB4R1E3YzV3MGFEWGgrWnMrVURHK3FuU0Q5dFFKdXYwbVRv?=
 =?ut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EJoRlpPUzdiVTh1R0ExM2JlNFViR0s3NVph?=
 =?utf-8?B?M0xnQzBkSDBWVVYwOVIzNU81M3dtN2l1R3kwTDVqS0NIUDhFU2ZWa25kRld4?=
 =?utf-8?Q?bjizM/fGvvKzwUd4q8ScrxEbX?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2395a9c2-9ccb-472a-0d1e-08db8def1600
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 15:43:41.0095
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: XKMdW7s8ogjuZJx8XVrJ2YPX60MnvqPhMHs5umnjEYOYgA9wkjJuQH8M3pAgsvJt7USKPlX18TMD3HczHhmo+g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB9908

On 26.07.2023 17:28, Oleksii wrote:
> On Mon, 2023-07-10 at 10:58 +0200, Jan Beulich wrote:
>> On 10.07.2023 10:56, Jan Beulich wrote:
>>> Use the generic framework in xen/linkage.h. No change in generated
>>> code
>>> except of course the converted symbols change to be hidden ones and
>>> gain
>>> a valid size.
>>>
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>
>> I'm sorry, the Cc list was incomplete here. Adding back the remaining
>> REST
>> maintainers.
>>
>> Jan
>>
>>> ---
>>> Probably count_args_exp() should move to macros.h, but I first
>>> wanted to
>>> see whether anyone can suggest any better approach for checking
>>> whether
>>> a defined macro expands to nothing.
> What about introduction of conditional macros ?
> Something similar to:
> #include <stdio.h>
> 
> #define CONDITIONAL_RETURN(arg1, arg2) CONDITIONAL_RETURN_IMPL(arg1,
> arg2, EMPTY)
> 
> #define EMPTY(...) ""
> 
> #define CONDITIONAL_RETURN_IMPL(arg1, arg2, empty_check) \
>     CONDITIONAL_RETURN_##empty_check(arg1, arg2)
> 
> #define CONDITIONAL_RETURN_EMPTY(arg1, arg2) \
>     CONDITIONAL_RETURN_ARG1(arg1, arg2)
> 
> #define CONDITIONAL_RETURN_ARG1(arg1, arg2) arg1, arg2
> 
> #define CONDITIONAL_RETURN_ARG2(arg1, arg2) arg1

I don't see how this would be used in your scheme. It ...

> int main() {
>     int a = 42;
>     const char* b = "hello";
> 
>     // Second argument is not empty, both arguments are returned
>     printf("Case 1: %d, %s\n", CONDITIONAL_RETURN(a, b));  // Prints:
> Case 1: 42, hello
> 
>     // Second argument is empty, only the first argument is returned
>     printf("Case 2: %d, %s\n", CONDITIONAL_RETURN(a, "")); // Prints:
> Case 2: 42,

... certainly isn't here, or this likely would cause at least a warning
from the compiler (for there being too few arguments to printf()) and
then a runtime UB for interpreting something as a pointer to a string
which likely isn't.

>     return 0;
> }
> 
> and then define DO_CODE_ALIGN using CONDITIONAL_RETURN?

Afaict instead of getting rid of the comma, you'd actually add ""
after it. What am I missing?

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 15:45:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 15:45:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570569.892460 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOghn-00063V-9c; Wed, 26 Jul 2023 15:45:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570569.892460; Wed, 26 Jul 2023 15:45:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOghn-00063O-6x; Wed, 26 Jul 2023 15:45:39 +0000
Received: by outflank-mailman (input) for mailman id 570569;
 Wed, 26 Jul 2023 15:45:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOghl-000626-OG
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 15:45:37 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on20627.outbound.protection.outlook.com
 [2a01:111:f400:fe16::627])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 76b00937-2bcb-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 17:45:37 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VI1PR04MB9908.eurprd04.prod.outlook.com (2603:10a6:800:1d0::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Wed, 26 Jul
 2023 15:45:34 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 15:45:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 76b00937-2bcb-11ee-b242-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=RuukAH57hSROk9eOL7yUvnAC8/kCLPq43spMkF82wRWRrqHbM6I/u25N4IQcPwoVDabMuLEwGJOCLzDTYsSJ4CW6xrJuWBJmxAPGGONZdnKoWmz3fPMJqlIqvE+WwnoQbzAkonRiK6FmSsqMy4pAYoRjIvLqqYDCXrQ5NeiZSMaNrrp4C7q+7d/soRVET385cHI3uTzpiZLBAX4wMpdRWoQ9uEdibBPX1Kchvlz2NrW9f6H7LIf8DSer73SD0wuNFgtXDitME8mbUnFNe0KnrZyMSsS+Cd5DObJj7jcAvB4LCOf5frn5ABJwiUxZFsqE8Vgra5EA87avQ/yUUW+EhQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ySz/SFnjsUPAdbt+mpclW9aPO7ASJpsNoKdb4AiohCM=;
 b=kRL57QaZ2euyeFts0sE1KlwdGybzcsSXciLXHDpdPRoPXckADDsTZwUvSUkjZeXpIOhGY0ZYEWFys08SO14QqppY1ZMrP6LnxY29/EItteUO9e2pDrRhP+ozv65JJASTsigj4CP3iBu+uX6qdjykb02CczZNAA+ba5bO/ntbHz418aDq2OgsRfcEJpUT6cGZ2ETuAp2Nvs8kZDedt2XkgmYyDwrh3SVk2rMegSg1D7f4fWfFD6LJ5SxjCLs/lAnGd3rly2UYrg9BoKt3VtyntsmSyhnr2ikuFXJ+vaL6WjVnggKDdZTdIyG8jLa8j/CHqOO9MmNIijS7i9gjZS8U2g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ySz/SFnjsUPAdbt+mpclW9aPO7ASJpsNoKdb4AiohCM=;
 b=X5+Zhdv1SZlOePgFHPSmcpPfjg56AvnSpUDrIdOdQlepwi4MRC6WJO1dks0t3Kvx4f7sMpLosxlz5SXKCg/FjCE1SnZ9EyiGtqJ4fRk813PKn3rNATeonODKTk8LgonqimvzkTJyns71IKfWzj4hwz1weWqfjY6iWTKHP4aDfqtVODhldw41TB5aQg49kWNnywPs66zbePSzfE4Twvj8A56T+e1Cb/10moHt3cKc95W83da8FXr6G/Y9wLNc5t6rgGFUe/wwS2B365NeBYtNhsJZuWoVS5WXlWzeZXEpG7EJ8B9ajWldOh74BLt4oxqtqgJroetym4wW87QWpeTbIA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <d4bd511d-965a-153b-a649-ff9c679a006d@suse.com>
Date: Wed, 26 Jul 2023 17:45:32 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v5 3/4] xen/ppc: Implement early serial printk on pseries
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 xen-devel@lists.xenproject.org
References: <cover.1689958538.git.sanastasio@raptorengineering.com>
 <f326168638ae05f5f387e4fa018ac2ed057bac8c.1689958538.git.sanastasio@raptorengineering.com>
 <019914c7-c6ca-70b9-6c90-e1891f4201c4@suse.com>
 <cf7e418f-763a-6f27-d498-c88b19c8a9eb@raptorengineering.com>
 <ab870428-fbce-240a-d4c7-4298fbed4050@suse.com>
 <825b00d0-432b-5db8-fe12-2266dffdf06f@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <825b00d0-432b-5db8-fe12-2266dffdf06f@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0085.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1f::22) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VI1PR04MB9908:EE_
X-MS-Office365-Filtering-Correlation-Id: 74bb4c54-d606-48a0-1594-08db8def59d8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	K39cOPEfAJHjDX5RH8NWi1o22zcYSjubfALC4/dd4ynXOuDCowbiQkF6P87crmd5XjSpd1ZU5bLkgjaIctQc1WBwkffNAkpvWl/SSm++cQFppm1DvkLFiNTCVdHn2cYAi2SjBq/BKNIJJagVjwkqWBozeYgkMZf0npgnFjnqLflSu3cGysnMaatrwRzzKN8+1vBFc8OJGk4MN8hSixidm4EnBpBKi54/v6VPZ73vXCwdqZck9ofigQYl4FnQMX8/Ddz91wlhD6u1lRR0jVIOwEkESovxdkDDRfCkMOPccqQKsfvzTyo/yV8qngT8twOwGI53TFZ7oTnALeF139CVV0Odv+e4GL+hFuv5orIhe6Wrnf9ereaGHoBRezsM8WqVwAEADIm8nerQa9/P2qY/q+x1a7QE+HWZlUFPlznMCL1I0Ji0L2+dfCERvXOKGyq/jrR1vM/UK418CuQfqVvKELCNS/eruhPDq3OwavAa48mJorPLluEbhFbe8EWcTwDEJ8e8m+RgO1tuidb65XcV1XwwV2SHxbHKyOZ5uWDvLNf25edFQCnxrELuSI0RGYYFPikaBWY2Y5+xbAFvpU5y01/SCZSR+S3BcezXJn/XY4sI//wiORfdneDiTolF/Vy4sq5PD6xE8eqBnBgiwBvAtQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(396003)(136003)(376002)(39860400002)(451199021)(54906003)(66556008)(66946007)(66476007)(2616005)(36756003)(6512007)(83380400001)(86362001)(31696002)(38100700002)(186003)(6506007)(26005)(6486002)(53546011)(478600001)(31686004)(41300700001)(5660300002)(2906002)(316002)(6916009)(4326008)(8676002)(8936002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZDRxeFRmdnlxNTllTkt2ZGhrQVVLR2IySzM3NFpTbDUwamxPbmFNVVVjcnU5?=
 =?utf-8?B?V3hTc1F5UzBNREhhSDVZUlBnc25CWTZ0VWdSRmZtcWpyMlk5V3NybHRQMHVn?=
 =?utf-8?B?YlFJRmdoS08ybTA1N2c4YlNQOENHZXZhV0s2dXNrbDZoTkpRTXh4OUJqNWp1?=
 =?utf-8?B?dWU5UlhPNXcxUWRXSUtheFE3d0xVUFNLVlJLdGVZa0hpZkdZdzZlRFBzR3hs?=
 =?utf-8?B?RGVOWlkyamZCdDZlNVJ5OVZoV1R3aStwOTc0WFZ6RVh6MjUwR2Vzb2p0REtC?=
 =?utf-8?B?eDBGT3ZTdkRZK3NXNGxYbmQvMHd5SDJuUTRqcTBlWCtkT2RPTWFVdmdjNDVu?=
 =?utf-8?B?NDdkT2E5QTVscHA0SG1HUTNTVTdaTm9Od2gvZzJpckhXanpXM2ZPQVVHOG9O?=
 =?utf-8?B?b3lveDhyeGF4MFMwZmE1SnF5VEdRckRYbE9TR1FVUEJBNVI4WTFIbldkcktj?=
 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AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 15:45:34.8328
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: /XXcJvu66yzc7v6aJ5DhXUfCoVs+8CPQcjYuv3oL0UfcN9Yf6znQFNbcp0lrvKk4edpfR5ixWu4kkIzH+3cqCw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB9908

On 26.07.2023 17:42, Shawn Anastasio wrote:
> On 7/26/23 10:32 AM, Jan Beulich wrote:
>> On 24.07.2023 17:06, Shawn Anastasio wrote:
>>> On 7/24/23 7:40 AM, Jan Beulich wrote:
>>>> On 21.07.2023 19:02, Shawn Anastasio wrote:
>>>>> On typical Power VMs (e.g. QEMU's -M pseries), a variety of services
>>>>> including an early serial console are provided by Open Firmware.
>>>>> Implement the required interfaces to call into Open Firmware and write
>>>>> to the serial console.
>>>>>
>>>>> Since Open Firmware runs in 32-bit Big Endian mode and Xen runs in
>>>>> 64-bit Little Endian mode, a thunk is required to save/restore
>>>>> any potentially-clobbered registers as well as to perform the
>>>>> required endianness switch. Thankfully, linux already has such
>>>>> a routine, which was imported into ppc64/of-call.S.
>>>>>
>>>>> Support for bare metal (PowerNV) will be implemented in a future
>>>>> patch.
>>>>>
>>>>> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
>>>>
>>>> While I've committed the earlier two patches, I had to back out this
>>>> one. In my environment (gcc13) the build fails due an unresolved
>>>> reference to memset() out of boot-of.c (supposedly from of_call()).
>>>
>>> Does removing the `{ 0 }` initializer to `struct of_service s` on line
>>> 43 resolve this?
>>
>> Yes, that's what's causing the call (and removing, whether or not correct,
>> helps).
> 
> Thanks for confirming. Removing it should be fine since the code
> manually initializes all of the other fields of the struct. The only
> behavioral difference is that the members of `ofs_args` at indices >=
> nargs would be left uninitialized. This shouldn't be an issue though
> since we're guarding reads of the array on `nargs` and `nrets` and thus
> only read explicitly initialized values (and of course, firmware would
> do the same).
> 
> Naturally we can't avoid memset calls forever. I have lib/ building
> locally, but if we could get this series in without having to make those
> changes here that'd be great.

Are you suggesting I should put in this patch almost as is, with just
that initializer dropped?

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 15:53:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 15:53:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570573.892470 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgor-0007eN-3p; Wed, 26 Jul 2023 15:52:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570573.892470; Wed, 26 Jul 2023 15:52:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgor-0007eG-1J; Wed, 26 Jul 2023 15:52:57 +0000
Received: by outflank-mailman (input) for mailman id 570573;
 Wed, 26 Jul 2023 15:52:56 +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
 <SRS0=cp0x=DM=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qOgoq-0007eA-2n
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 15:52:56 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7b05f531-2bcc-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 17:52:53 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id B0D6A82858BD;
 Wed, 26 Jul 2023 10:52:52 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id Lyy6uhMLNw86; Wed, 26 Jul 2023 10:52:51 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id A54168285A08;
 Wed, 26 Jul 2023 10:52:51 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id egHo1gWlkq9W; Wed, 26 Jul 2023 10:52:51 -0500 (CDT)
Received: from [192.168.82.115] (c-98-222-97-219.hsd1.il.comcast.net
 [98.222.97.219])
 by mail.rptsys.com (Postfix) with ESMTPSA id 2526F82858BD;
 Wed, 26 Jul 2023 10:52:51 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7b05f531-2bcc-11ee-8613-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com A54168285A08
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1690386771; bh=yT0Yoz2hTvrJdF+QjdNptiYp8M6z7LZ26vnknsmHxfs=;
	h=Message-ID:Date:MIME-Version:To:From;
	b=GXog7oNRSAnxQGs/tU4q445w3scSVc8ql88ID1MBMrIJ6dIf148C2Bf368S5PsuQR
	 nnOXONJs/UHB19SvX/F6AbWhf7FQnOhXVNHgAkPsknLdroFdAaB4kJ61c3QBwZySLH
	 o9zUXp7D8Hn4s4NZII67Q/CUe8HcBtuaGbN7cVVg=
X-Virus-Scanned: amavisd-new at rptsys.com
Message-ID: <5cddd8ae-f020-0113-9270-97bc1b68036a@raptorengineering.com>
Date: Wed, 26 Jul 2023 10:52:50 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v5 3/4] xen/ppc: Implement early serial printk on pseries
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 xen-devel@lists.xenproject.org
References: <cover.1689958538.git.sanastasio@raptorengineering.com>
 <f326168638ae05f5f387e4fa018ac2ed057bac8c.1689958538.git.sanastasio@raptorengineering.com>
 <019914c7-c6ca-70b9-6c90-e1891f4201c4@suse.com>
 <cf7e418f-763a-6f27-d498-c88b19c8a9eb@raptorengineering.com>
 <ab870428-fbce-240a-d4c7-4298fbed4050@suse.com>
 <825b00d0-432b-5db8-fe12-2266dffdf06f@raptorengineering.com>
 <d4bd511d-965a-153b-a649-ff9c679a006d@suse.com>
From: Shawn Anastasio <sanastasio@raptorengineering.com>
In-Reply-To: <d4bd511d-965a-153b-a649-ff9c679a006d@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 7/26/23 10:45 AM, Jan Beulich wrote:
> On 26.07.2023 17:42, Shawn Anastasio wrote:
>> On 7/26/23 10:32 AM, Jan Beulich wrote:
>>> On 24.07.2023 17:06, Shawn Anastasio wrote:
>>>> On 7/24/23 7:40 AM, Jan Beulich wrote:
>>>>> On 21.07.2023 19:02, Shawn Anastasio wrote:
>>>>>> On typical Power VMs (e.g. QEMU's -M pseries), a variety of services
>>>>>> including an early serial console are provided by Open Firmware.
>>>>>> Implement the required interfaces to call into Open Firmware and write
>>>>>> to the serial console.
>>>>>>
>>>>>> Since Open Firmware runs in 32-bit Big Endian mode and Xen runs in
>>>>>> 64-bit Little Endian mode, a thunk is required to save/restore
>>>>>> any potentially-clobbered registers as well as to perform the
>>>>>> required endianness switch. Thankfully, linux already has such
>>>>>> a routine, which was imported into ppc64/of-call.S.
>>>>>>
>>>>>> Support for bare metal (PowerNV) will be implemented in a future
>>>>>> patch.
>>>>>>
>>>>>> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
>>>>>
>>>>> While I've committed the earlier two patches, I had to back out this
>>>>> one. In my environment (gcc13) the build fails due an unresolved
>>>>> reference to memset() out of boot-of.c (supposedly from of_call()).
>>>>
>>>> Does removing the `{ 0 }` initializer to `struct of_service s` on line
>>>> 43 resolve this?
>>>
>>> Yes, that's what's causing the call (and removing, whether or not correct,
>>> helps).
>>
>> Thanks for confirming. Removing it should be fine since the code
>> manually initializes all of the other fields of the struct. The only
>> behavioral difference is that the members of `ofs_args` at indices >=
>> nargs would be left uninitialized. This shouldn't be an issue though
>> since we're guarding reads of the array on `nargs` and `nrets` and thus
>> only read explicitly initialized values (and of course, firmware would
>> do the same).
>>
>> Naturally we can't avoid memset calls forever. I have lib/ building
>> locally, but if we could get this series in without having to make those
>> changes here that'd be great.
> 
> Are you suggesting I should put in this patch almost as is, with just
> that initializer dropped?

Yes. I've tested the change locally and it still behaves correctly, so
if dropping it removes the memset invocation on your toolchain then I'd
say the patch is fine to go with that initializer dropped.

I could also submit a v6 with the initializer dropped, if you'd be more
comfortable with that.

> Jan

Thanks,
Shawn


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 15:54:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 15:54:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570575.892481 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgqN-0008AO-Ea; Wed, 26 Jul 2023 15:54:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570575.892481; Wed, 26 Jul 2023 15:54:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgqN-0008AH-Bs; Wed, 26 Jul 2023 15:54:31 +0000
Received: by outflank-mailman (input) for mailman id 570575;
 Wed, 26 Jul 2023 15:54:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=oEth=DM=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qOgqM-0008A9-Gf
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 15:54:30 +0000
Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com
 [2a00:1450:4864:20::12a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b4184d45-2bcc-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 17:54:29 +0200 (CEST)
Received: by mail-lf1-x12a.google.com with SMTP id
 2adb3069b0e04-4fdd14c1fbfso10924640e87.1
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 08:54:29 -0700 (PDT)
Received: from [192.168.202.116] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 j16-20020a19f510000000b004fb964d48e6sm3366507lfb.95.2023.07.26.08.54.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 08:54:27 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b4184d45-2bcc-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690386868; x=1690991668;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=fDaekb2eZKhs05UpY7NvEXKQr60RjhtMKkrszbB5REE=;
        b=opFDl23ijlVnlrQbaptVD7/2ee4gDTmZ8TWIuOfD4vg9+vI8Zi9REOA5IFNoFnCyy4
         KNfPblirDYaqThukkdxPp65DpUATgMBoZbPcfCHXjS10NYEBxS5R7DVJlAA3TH+pIEc0
         /O4L65DbpfJ49ys2shrb9Q0w+uzGLGUWQze5RIpogwCwA3TZLfaJ8QSJ8MQHOYB3CaBc
         MJgUExdH8dQGWtA5sDg7GbqLpuG5YTvHc/Lbg3ohc2Zcha2U8GIKTAcC9sB8l68sEuQH
         8hx9J2meTS8Iy+dzpZXtJ2lG6Mgy6w4wG9Jhjklas8/psGVe5kJa84oivcxizAjx2PXT
         gMdQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690386868; x=1690991668;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=fDaekb2eZKhs05UpY7NvEXKQr60RjhtMKkrszbB5REE=;
        b=jlfkgA1pDptaVgj/WnChCXk422mz+cvPAmxkHxrsqcRGhr2r9ZAOA0i/8RBiEO/H4q
         P8EnUQ97kDPvI/hd0jzl5ARRrjR5Zu/xr0itETlxNIVGd5OPSObBFsaV+cJJL7lnf7Y1
         0olrhBgeph++bkPT/J/Waj3w6bbLC4P2v4Cszt/AEOr9BKihCMHfcan8hLPAuQTiJG+X
         F/xjATV0OEkg9pn/8PQs1lPePESOR9ArFNtW+AOMbYszyIY23QGE/ckQi1+Wf+HcmIuH
         rBZ6WTiT8aAtVozPcKt7p8Qgn9DV+N+xgzaG9msv2mi9YNZ+U+5aOSr2eBPb7ltoTBou
         fhjQ==
X-Gm-Message-State: ABy/qLZNBCEJ0uh0Q3ftz/+q8O8RelmjdYe/5/qbmvYDSUT5n7eDHqTO
	BmD9FWMiPR/dPdN3vOlpV94=
X-Google-Smtp-Source: APBJJlGT9Q7CuaS5SG770G3TudrQQz9JgJObA8PUdlrA9XzulO8Rud/L8vqhPLPvzWace/wGm0aSZQ==
X-Received: by 2002:a05:6512:6c4:b0:4f8:77db:1d9e with SMTP id u4-20020a05651206c400b004f877db1d9emr1667151lff.12.1690386868195;
        Wed, 26 Jul 2023 08:54:28 -0700 (PDT)
Message-ID: <dee3624525f9530aaf3252c6c4fa6eb5262e76cd.camel@gmail.com>
Subject: Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Bob Eshleman
	 <bobbyeshleman@gmail.com>, Alistair Francis <alistair.francis@wdc.com>, 
	Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
Date: Wed, 26 Jul 2023 18:54:27 +0300
In-Reply-To: <5a40abd4-edc2-0de0-99ed-d23174940d66@suse.com>
References: <cover.1690191480.git.oleksii.kurochko@gmail.com>
	 <a8ab1829ab718dda869db3df3348ded211e81967.1690191480.git.oleksii.kurochko@gmail.com>
	 <a370548e30aaa8c1160ecd5f2eccfcc10002a8f9.camel@gmail.com>
	 <6675f535-7cf7-dd55-4ebe-82ba486029f7@suse.com>
	 <4deb8c44cf639af66ad7f5b9b42180554e08d5cf.camel@gmail.com>
	 <5a40abd4-edc2-0de0-99ed-d23174940d66@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Wed, 2023-07-26 at 17:00 +0200, Jan Beulich wrote:
> On 26.07.2023 15:12, Oleksii wrote:
> > On Wed, 2023-07-26 at 13:58 +0200, Jan Beulich wrote:
> > > On 26.07.2023 13:23, Oleksii wrote:
> > > > I would like to ask for advice on whether it would be easier,
> > > > less
> > > > bug-
> > > > provoking ( during identity mapping to remove of whole Xen ) to
> > > > have a
> > > > separate identity section that won't be more than PAGE_SIZE.
> > >=20
> > > I'm afraid you can't safely do this in C, or at least not without
> > > further checking on what the compiler actually did.
> > >=20
> > > > @@ -264,6 +268,19 @@ void __init enable_mmu(void)
> > > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0RV_STAGE1_MO=
DE << SATP_MODE_SHIFT);
> > > > =C2=A0}
> > > > =C2=A0
> > > > +void __attribute__((naked)) __section(".ident")
> > > > turn_on_mmu(unsigned
> > > > long ra)
> > >=20
> > > Did you read what gcc doc says about "naked"? Extended asm()
> > > isn't
> > > supported there. Since ...
> > >=20
> > > > +{
> > > > + =C2=A0 =C2=A0/* Ensure page table writes precede loading the SATP=
 */
> > > > + =C2=A0 =C2=A0sfence_vma();
> > > > +
> > > > + =C2=A0 =C2=A0/* Enable the MMU and load the new pagetable for Xen=
 */
> > > > + =C2=A0 =C2=A0csr_write(CSR_SATP,
> > > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PFN_DOWN((unsigne=
d long)stage1_pgtbl_root) |
> > > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0RV_STAGE1_MODE <<=
 SATP_MODE_SHIFT);
> > > > +
> > > > + =C2=A0 =C2=A0asm volatile( "jr %0\n" : : "r"(ra) );
> > > > +}
> > >=20
> > > ... none of this really requires C, I think we're at the point
> > > where
> > > (iirc) Andrew's and my suggestion wants following, moving this to
> > > assembly code (at which point it doesn't need to be a separate
> > > function). You can still build page tables in C, of course.
> > > (Likely
> > > you then also won't need a separate section; some minimal
> > > alignment
> > > guarantees ought to suffice to make sure the critical code is
> > > confined to a single page.)
> >=20
> > Thanks. I'll move all of this to assembly code.
> > Regarding alignment it is needed alignment on start and end of
> > function:
> > =C2=A0=C2=A0=C2=A0 .balign PAGE_SIZE
> > =C2=A0=C2=A0=C2=A0 GLOBAL(turn_on_mmu)
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ...
> > =C2=A0=C2=A0=C2=A0 .balign PAGE_SIZE
> > =C2=A0=C2=A0=C2=A0 ENDPROC(turn_on_mmu)
> >=20
> > Does the better way exist?
>=20
> The function is only going to be a handful of instructions. Its
> alignment doesn't need to be larger than the next power of 2. I
> expect you'll be good with 64-byte alignment. (In no case do you
> need to align the end of the function: Putting other stuff there
> is not a problem at all.) What you want in any event is a build
> time check that the within-a-page constraint is met.
But shouldn't be an address be aligned to a boundary equal to page
size?

According to the RISC-V privileged spec:
Any level of PTE may be a leaf PTE, so in addition to 4 KiB pages, Sv39
supports 2 MiB megapages
and 1 GiB gigapages, each of which must be virtually and physically
aligned to a boundary equal
to its size. A page-fault exception is raised if the physical address
is insufficiently aligned.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 15:56:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 15:56:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570578.892490 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgs9-0000Lk-O2; Wed, 26 Jul 2023 15:56:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570578.892490; Wed, 26 Jul 2023 15:56:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgs9-0000Ld-LV; Wed, 26 Jul 2023 15:56:21 +0000
Received: by outflank-mailman (input) for mailman id 570578;
 Wed, 26 Jul 2023 15:56:20 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOgs8-0000LR-QL; Wed, 26 Jul 2023 15:56:20 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOgs8-0006Ac-NK; Wed, 26 Jul 2023 15:56:20 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOgs8-00019S-Dc; Wed, 26 Jul 2023 15:56:20 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOgs8-00015f-D8; Wed, 26 Jul 2023 15:56:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=WFrNtglKhcjS1Ok6p6ZW35IXJT1R3HE6ucdpCybbT2w=; b=DanLxe/tYiSDzM0Wc/3UsY9hei
	DchkCU9ztSHasBwvUWJZSWevN+CElrJaBsmcgR55nLSn5m+WXYUvwh7/Qg2kRD8aqzZ1UXvAJNwS4
	Rur1MaGpDjCHf4hYLulMMa/nAW+/dJIKa+1sOB4y1ZD+4P/posYmo9lxodNfmdc92spM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182011-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 182011: regressions - FAIL
X-Osstest-Failures:
    linux-linus:build-arm64-xsm:xen-build:fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:guest-localmigrate/x10:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:guest-localmigrate/x10:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:guest-start/debianhvm.repeat:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:build-check(1):blocked:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=0b5547c51827e053cc754db47d3ec3e6c2c451d2
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 26 Jul 2023 15:56:20 +0000

flight 182011 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182011/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-arm64-xsm               6 xen-build                fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2  20 guest-localmigrate/x10   fail REGR. vs. 180278
 test-amd64-amd64-xl-credit1  20 guest-localmigrate/x10   fail REGR. vs. 180278
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail REGR. vs. 180278
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 20 guest-start/debianhvm.repeat fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-xl-xsm       1 build-check(1)               blocked  n/a
 test-arm64-arm64-libvirt-xsm  1 build-check(1)               blocked  n/a
 test-armhf-armhf-libvirt   16 saverestore-support-check fail blocked in 180278
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail blocked in 180278
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check fail blocked in 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass

version targeted for testing:
 linux                0b5547c51827e053cc754db47d3ec3e6c2c451d2
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z  100 days
Failing since        180281  2023-04-17 06:24:36 Z  100 days  189 attempts
Testing same since   182011  2023-07-25 10:46:27 Z    1 days    1 attempts

------------------------------------------------------------
3820 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              fail    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 blocked 
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      blocked 
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 642031 lines long.)


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 15:59:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 15:59:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570585.892501 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgvQ-00011v-DC; Wed, 26 Jul 2023 15:59:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570585.892501; Wed, 26 Jul 2023 15:59:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOgvQ-00011o-9f; Wed, 26 Jul 2023 15:59:44 +0000
Received: by outflank-mailman (input) for mailman id 570585;
 Wed, 26 Jul 2023 15:59:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=aSls=DM=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOgvP-00011i-DO
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 15:59:43 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0613.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::613])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6e9b3c8e-2bcd-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 17:59:42 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB7606.eurprd04.prod.outlook.com (2603:10a6:20b:23e::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul
 2023 15:59:39 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6609.032; Wed, 26 Jul 2023
 15:59:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6e9b3c8e-2bcd-11ee-b242-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LZRfCoUDJiohrVeTK+SeLA6x8E/uTn7r6d8rk5AtT1/JxXzbim9vUzU0EjseykbHap0uj/rPM0whZyv/Lc9IsqQ7zpAj2Ax4bt9Q8x9fiatBzxvitH3m2orHWz5MeFID1UCRIVZIZSFrwffIUrR2FGQcDVud6mrQZXteg4unLaYQGWfMUVxCJ9n7EOVoZPRo0DHK0R7XWSKgUpDcfuB8Iz/DvSvV0mGVf1iI5YZonX18uKXUEyvSK2ujvi04XTKdccGLJL3QZR/HVpo9fJ+o4QTc9zCDnnPn9BmgUvuvf+6NGFfU2YM/K4MjYrK5lix3KEItcvztZKN9WkGBra/s2A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=cKf3oPTm1/CMIOBWEXl0cm2Ke4cVYtZ0HR4HXECaUxw=;
 b=c8UIr1a3uqgxpyh4W6xAZabLRWHT3JVwjG9BGoIGxvUjrWSDoBEb6dINt0PnbpHGbhWe7rgaFmYkhDrQz7SamdbFnrlnUYKFLMtVhgkn29GHCU2kYJSn27B2TcRx4j9ozxkb0I+YfghIItUoBwDkt0NSlBMSg5MyOJheXALZ7x3GxsZifg8nB/NrI8/d8XroztPqG4dVLY1aNXyyD4R7nz+Gsv1jPmzIqxNOrY5SyfT3xi/VU3QKgK5/POcHZdV8Queqch/BLRje26IZqJrrXLVQVyLYIGu4CCkA8SYTtf3PtUi6JxiKqA96SeDPlxZfmBg7kXPjKxsd1QvU10zfNw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=cKf3oPTm1/CMIOBWEXl0cm2Ke4cVYtZ0HR4HXECaUxw=;
 b=r13CWfb1LhuKKtuonSslHjOsh8CyQwXlJrkIZVWGqRJUS++a76TgyLgBscwSoehCfSJ5RCQBsj4IfWnH42O7Sz34t9OAJfb1ReJ0T4Li9/inidvvYQfWurPqas/FuuLPHn+SFcyQI1tgG3alm//Rd63HAKK1nIXEh/FcFMOgOeD1NxTzn8HB+o3yrlZjRFMN91VQPS3a+GfJCk8DONFqA9HvoZAgXl0/CuYsNjZmO95vNV3PhD9bSidQOvZHVS91ghfShazpm0LNM7wLVZJFiLE4jdVgnLPFip2FgJZKGZKVERbKMXXogCSVPzCjqlYFDemh9xte9s7+q90sZTAkww==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <79b20131-46c2-9e54-e615-18a346b83b8d@suse.com>
Date: Wed, 26 Jul 2023 17:59:38 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1690191480.git.oleksii.kurochko@gmail.com>
 <a8ab1829ab718dda869db3df3348ded211e81967.1690191480.git.oleksii.kurochko@gmail.com>
 <a370548e30aaa8c1160ecd5f2eccfcc10002a8f9.camel@gmail.com>
 <6675f535-7cf7-dd55-4ebe-82ba486029f7@suse.com>
 <4deb8c44cf639af66ad7f5b9b42180554e08d5cf.camel@gmail.com>
 <5a40abd4-edc2-0de0-99ed-d23174940d66@suse.com>
 <dee3624525f9530aaf3252c6c4fa6eb5262e76cd.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <dee3624525f9530aaf3252c6c4fa6eb5262e76cd.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0060.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4b::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB7606:EE_
X-MS-Office365-Filtering-Correlation-Id: d125d003-c8a5-4a12-cb34-08db8df15177
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	/hM+iXptjdekJL9OrkebURlOGSo/izjoe0CL/HORF2RP0y8h2WtPjhFwOIO6mf7saRJ12/LLCFZ7iGu7aVkiOTlUA8t7EAu+fQpWnrK+2jrTe6dHIntjt5bKCeXdGYcN16dSgc01IqPObeL+3MWBkil0vw8wHmtJkk2z2YbBqsXMMiR5Hew8ifXk3klf1GIEyrWHnntBLeVVnvioJLFKFkCR50WuT5v4zQw5NwO5l6MfmSL9LfwI1il30OdJ2XCeWkFYXGUu1RMcWlBltXmz0dNpbKquqjpSEwq+l2cejAEeT8rL5abeZEBijSSqyoVFavwFFdR9W2h+/uDHRUhOXsHus41shwebwHkde6k/h8Lo7phHz4+VI6YWKK83rSJjdYfrV4ZMzEZ42qWBzqBnVMdKaM1NU87Ouziate5R3o7pOfFLT80T13EeioHwPgtJqo7ZgkZPe7kOs5fvn9P2kar3ie4Y1qQxNptzUvDkaag6XK+znGAJw4rrKq+Q58XRr/8jh/U60hK1zuEDkALoth0EvP2O1rKsLnxWHhbv2yhWUbp6H9Ro8eS/AMw9z2ZmrVqdXQIOCaNLcXaiqI1ymU7nWjlUIN6810i3nCRb3aZZG+Mt+T3Nq8QTvrjYUHjiy0eDFffvgioewtY6AZbNbA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(39860400002)(136003)(346002)(366004)(376002)(451199021)(36756003)(478600001)(31696002)(54906003)(38100700002)(86362001)(66476007)(66946007)(5660300002)(4326008)(6916009)(316002)(66556008)(6506007)(186003)(6512007)(6486002)(26005)(53546011)(8676002)(8936002)(41300700001)(2906002)(2616005)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?b3I3WEdkRkdhZVQ0UWRNR0d6cU52bzRmTnh0andkTTZGRWJsazk2YUNzYnlU?=
 =?utf-8?B?NTd4ZTMrZE9LQWQ1Qjk4blMrK1JGWHEwcUFWZndTZjBsTi94a3NxTlNzYkoy?=
 =?utf-8?B?azhHNlNFL3JIUXgrQk5pNTlzVkI2UWFFa2xPcE4yU2d3N2hBRmhoWjZUK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eHVrTGVpUDR1NWZnalp5?=
 =?utf-8?B?c3pJa2N5TjMrT2xVMExxanV0R21JYkQzY1BEdkJzWVQxeTNsS016VStNZjJV?=
 =?utf-8?B?VFBSZEZoaXM1eHdha2tiSEgrSnZpK3B1UENYTVBHeUpEYnZFNVJmeDdRcWRI?=
 =?utf-8?B?R29rY3d1WnFtOGVsMGVtTDAvenJVSVdJbjdQc3ZMQzM1MlpEZ0ZYaUdSMFRD?=
 =?utf-8?Q?dsFKdANdMLRD9nXbQpybfr0TC?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d125d003-c8a5-4a12-cb34-08db8df15177
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 15:59:39.7774
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: SvZ/pssuormwt4Rti9ughLhzdwMgg+gKCHDlS2y9iyA6CBgxRN1iD/w7bzFP24xq9h8EHFmwl+f7Hwljk4IL2Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7606

On 26.07.2023 17:54, Oleksii wrote:
> On Wed, 2023-07-26 at 17:00 +0200, Jan Beulich wrote:
>> On 26.07.2023 15:12, Oleksii wrote:
>>> On Wed, 2023-07-26 at 13:58 +0200, Jan Beulich wrote:
>>>> On 26.07.2023 13:23, Oleksii wrote:
>>>>> I would like to ask for advice on whether it would be easier,
>>>>> less
>>>>> bug-
>>>>> provoking ( during identity mapping to remove of whole Xen ) to
>>>>> have a
>>>>> separate identity section that won't be more than PAGE_SIZE.
>>>>
>>>> I'm afraid you can't safely do this in C, or at least not without
>>>> further checking on what the compiler actually did.
>>>>
>>>>> @@ -264,6 +268,19 @@ void __init enable_mmu(void)
>>>>> Â  Â  Â  Â  Â  Â  Â  Â RV_STAGE1_MODE << SATP_MODE_SHIFT);
>>>>> Â }
>>>>> Â 
>>>>> +void __attribute__((naked)) __section(".ident")
>>>>> turn_on_mmu(unsigned
>>>>> long ra)
>>>>
>>>> Did you read what gcc doc says about "naked"? Extended asm()
>>>> isn't
>>>> supported there. Since ...
>>>>
>>>>> +{
>>>>> + Â  Â /* Ensure page table writes precede loading the SATP */
>>>>> + Â  Â sfence_vma();
>>>>> +
>>>>> + Â  Â /* Enable the MMU and load the new pagetable for Xen */
>>>>> + Â  Â csr_write(CSR_SATP,
>>>>> + Â  Â  Â  Â  Â  Â  Â PFN_DOWN((unsigned long)stage1_pgtbl_root) |
>>>>> + Â  Â  Â  Â  Â  Â  Â RV_STAGE1_MODE << SATP_MODE_SHIFT);
>>>>> +
>>>>> + Â  Â asm volatile( "jr %0\n" : : "r"(ra) );
>>>>> +}
>>>>
>>>> ... none of this really requires C, I think we're at the point
>>>> where
>>>> (iirc) Andrew's and my suggestion wants following, moving this to
>>>> assembly code (at which point it doesn't need to be a separate
>>>> function). You can still build page tables in C, of course.
>>>> (Likely
>>>> you then also won't need a separate section; some minimal
>>>> alignment
>>>> guarantees ought to suffice to make sure the critical code is
>>>> confined to a single page.)
>>>
>>> Thanks. I'll move all of this to assembly code.
>>> Regarding alignment it is needed alignment on start and end of
>>> function:
>>> Â Â Â  .balign PAGE_SIZE
>>> Â Â Â  GLOBAL(turn_on_mmu)
>>> Â Â Â Â Â Â Â  ...
>>> Â Â Â  .balign PAGE_SIZE
>>> Â Â Â  ENDPROC(turn_on_mmu)
>>>
>>> Does the better way exist?
>>
>> The function is only going to be a handful of instructions. Its
>> alignment doesn't need to be larger than the next power of 2. I
>> expect you'll be good with 64-byte alignment. (In no case do you
>> need to align the end of the function: Putting other stuff there
>> is not a problem at all.) What you want in any event is a build
>> time check that the within-a-page constraint is met.
> But shouldn't be an address be aligned to a boundary equal to page
> size?
> 
> According to the RISC-V privileged spec:
> Any level of PTE may be a leaf PTE, so in addition to 4 KiB pages, Sv39
> supports 2 MiB megapages
> and 1 GiB gigapages, each of which must be virtually and physically
> aligned to a boundary equal
> to its size. A page-fault exception is raised if the physical address
> is insufficiently aligned.

You'd simply map the page containing the chunk, i.e. masking off the
low 12 bits. If far enough away from the Xen virtual range, you could
as well map a 2M page masking off the low 21 bits, or a 1G page with
the low 30 bits of the address cleared.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 16:21:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 16:21:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570592.892510 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOhGE-0004uY-43; Wed, 26 Jul 2023 16:21:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570592.892510; Wed, 26 Jul 2023 16:21:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOhGE-0004uR-0i; Wed, 26 Jul 2023 16:21:14 +0000
Received: by outflank-mailman (input) for mailman id 570592;
 Wed, 26 Jul 2023 16:21:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=j0A2=DM=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qOhGC-0004uL-IA
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 16:21:12 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6ec485e9-2bd0-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 18:21:10 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.26.92])
 by support.bugseng.com (Postfix) with ESMTPSA id 790DC4EE0738;
 Wed, 26 Jul 2023 18:21:09 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6ec485e9-2bd0-11ee-b242-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH v4 0/4] automation: Add ECLAIR pipelines
Date: Wed, 26 Jul 2023 18:20:46 +0200
Message-Id: <cover.1690387393.git.simone.ballarin@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This patch series adds two pipelines that analyze an ARM64 and a X86_64
build with the ECLAIR static analyzer on the guidelines contained in Set1.
The builds analyzed are the ones triggered by automation/eclair_analysis/build.sh.

automation/eclair_analysis/ECLAIR contains the ECLAIR configuration files
(.ecl files) and scripts that implement the integration (action* scripts).

All commits on the xen-project/xen:staging branch will be analyzed
and their artifacts will be stored indefinitely; the integration will
report differential information with respect to the previous analysis.

All commits on other branches or repositories will be analyzed and
only the last ten artifacts will be kept; the integration will report
differential information with respect to the analysis done on the common
ancestor with xen-project/xen:staging (if available).

Additionaly any repository should be able to read a masked variable
named WTOKEN with the token provided by BUGSENG, otherwise the pipeline
will fail.

The analysis fails if it contains violations of guidelines tagged as
clean:added. The list of clean guidelines are maintained in
automation/eclair_analysis/ECLAIR/tagging.ecl.

--
Changes in v4:
- move link to the analysis results at the end of the console log
- avoid git warning
- avoid undesired git logs
- remove undesired blanks in MAINTAINERS

Simone Ballarin (4):
  automation: Add ECLAIR utilities and settings
  automation: Add xen builds for the ECLAIR analyses
  automation: Add ECLAIR pipelines
  maintainers: Add ECLAIR reviewer

 .gitlab-ci.yml                                |   2 +
 MAINTAINERS                                   |   6 +
 automation/eclair_analysis/ECLAIR/Set1.ecl    |  59 ++++
 automation/eclair_analysis/ECLAIR/Set2.ecl    |  25 ++
 automation/eclair_analysis/ECLAIR/Set3.ecl    |  67 ++++
 .../eclair_analysis/ECLAIR/action.helpers     | 193 ++++++++++++
 .../eclair_analysis/ECLAIR/action.settings    | 172 ++++++++++
 .../ECLAIR/action_clean_added.sh              |  36 +++
 .../eclair_analysis/ECLAIR/action_log.sh      |  15 +
 .../ECLAIR/action_pull_request.sh             |  57 ++++
 .../eclair_analysis/ECLAIR/action_push.sh     |  95 ++++++
 .../ECLAIR/action_upload_sarif.sh             |  31 ++
 .../eclair_analysis/ECLAIR/analysis.ecl       |  25 ++
 automation/eclair_analysis/ECLAIR/analyze.sh  | 106 +++++++
 .../ECLAIR/call_properties.ecl                | 106 +++++++
 .../eclair_analysis/ECLAIR/deviations.ecl     | 298 ++++++++++++++++++
 .../eclair_analysis/ECLAIR/out_of_scope.ecl   | 127 ++++++++
 .../ECLAIR/print_analyzed_files.sh            |  66 ++++
 .../eclair_analysis/ECLAIR/public_APIs.ecl    |   6 +
 automation/eclair_analysis/ECLAIR/report.ecl  |   4 +
 automation/eclair_analysis/ECLAIR/tagging.ecl |  34 ++
 .../eclair_analysis/ECLAIR/toolchain.ecl      | 275 ++++++++++++++++
 automation/eclair_analysis/Makefile.prepare   |   6 +
 automation/eclair_analysis/build.sh           |  44 +++
 automation/eclair_analysis/prepare.sh         |  42 +++
 automation/eclair_analysis/xen_arm_config     | 147 +++++++++
 automation/eclair_analysis/xen_x86_config     | 152 +++++++++
 automation/gitlab-ci/analyze.yaml             |  38 +++
 automation/gitlab-ci/build.yaml               |   1 +
 automation/scripts/eclair                     |  34 ++
 30 files changed, 2269 insertions(+)
 create mode 100644 automation/eclair_analysis/ECLAIR/Set1.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/Set2.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/Set3.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/action.helpers
 create mode 100644 automation/eclair_analysis/ECLAIR/action.settings
 create mode 100755 automation/eclair_analysis/ECLAIR/action_clean_added.sh
 create mode 100755 automation/eclair_analysis/ECLAIR/action_log.sh
 create mode 100644 automation/eclair_analysis/ECLAIR/action_pull_request.sh
 create mode 100755 automation/eclair_analysis/ECLAIR/action_push.sh
 create mode 100755 automation/eclair_analysis/ECLAIR/action_upload_sarif.sh
 create mode 100644 automation/eclair_analysis/ECLAIR/analysis.ecl
 create mode 100755 automation/eclair_analysis/ECLAIR/analyze.sh
 create mode 100644 automation/eclair_analysis/ECLAIR/call_properties.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/deviations.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/out_of_scope.ecl
 create mode 100755 automation/eclair_analysis/ECLAIR/print_analyzed_files.sh
 create mode 100644 automation/eclair_analysis/ECLAIR/public_APIs.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/report.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/tagging.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/toolchain.ecl
 create mode 100644 automation/eclair_analysis/Makefile.prepare
 create mode 100755 automation/eclair_analysis/build.sh
 create mode 100755 automation/eclair_analysis/prepare.sh
 create mode 100644 automation/eclair_analysis/xen_arm_config
 create mode 100644 automation/eclair_analysis/xen_x86_config
 create mode 100644 automation/gitlab-ci/analyze.yaml
 create mode 100755 automation/scripts/eclair

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 16:21:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 16:21:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570596.892520 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOhGp-0005Op-C0; Wed, 26 Jul 2023 16:21:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570596.892520; Wed, 26 Jul 2023 16:21:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOhGp-0005Oi-99; Wed, 26 Jul 2023 16:21:51 +0000
Received: by outflank-mailman (input) for mailman id 570596;
 Wed, 26 Jul 2023 16:21:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=j0A2=DM=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qOhGm-0004uL-Ot
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 16:21:49 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8449b2e1-2bd0-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 18:21:46 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.26.92])
 by support.bugseng.com (Postfix) with ESMTPSA id E35F34EE0738;
 Wed, 26 Jul 2023 18:21:45 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8449b2e1-2bd0-11ee-b242-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: [XEN PATCH v4 1/4] automation: Add ECLAIR utilities and settings
Date: Wed, 26 Jul 2023 18:20:47 +0200
Message-Id: <89a92ffbe80070f9b88f5b0c34e7679746873e92.1690387393.git.simone.ballarin@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690387393.git.simone.ballarin@bugseng.com>
References: <cover.1690387393.git.simone.ballarin@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

The files with extension ecl are ECLAIR configurations that
are loaded during the analysis phase or during the report
generation phase: analysis.ecl is the main file for the analysis
phase, while reports.ecl is the one for the report phase.
All other ecl files are included by one of the two main ones.

The actions* scripts implement the integration with the CI server,
they are completely general and can be amended to work with any CI
server. Their presence in xen.git is recommended so that maintainance
would be easier.

analyze.sh is the script that actually triggers the analysis.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>

--
Changes in v4:
- avoid warning from git fetch
- add --quit to git fetch
- add 'Acked-by'

Changes in v3:
- split ECLAIR configurations and scripts in a separate patch;
- remove references to "Task (a): Xen Coding Guidelines v1.0".

Changes in v2:
- add ECLAIR configuration files (before they were fetched from a separate
    repository);
- now the pipeline fails if there are new violations of guidelines tagged
    with clean:added.
---
 automation/eclair_analysis/ECLAIR/Set1.ecl    |  59 ++++
 automation/eclair_analysis/ECLAIR/Set2.ecl    |  25 ++
 automation/eclair_analysis/ECLAIR/Set3.ecl    |  67 ++++
 .../eclair_analysis/ECLAIR/action.helpers     | 193 ++++++++++++
 .../eclair_analysis/ECLAIR/action.settings    | 172 ++++++++++
 .../ECLAIR/action_clean_added.sh              |  36 +++
 .../eclair_analysis/ECLAIR/action_log.sh      |  15 +
 .../ECLAIR/action_pull_request.sh             |  57 ++++
 .../eclair_analysis/ECLAIR/action_push.sh     |  95 ++++++
 .../ECLAIR/action_upload_sarif.sh             |  31 ++
 .../eclair_analysis/ECLAIR/analysis.ecl       |  25 ++
 automation/eclair_analysis/ECLAIR/analyze.sh  | 106 +++++++
 .../ECLAIR/call_properties.ecl                | 106 +++++++
 .../eclair_analysis/ECLAIR/deviations.ecl     | 298 ++++++++++++++++++
 .../eclair_analysis/ECLAIR/out_of_scope.ecl   | 127 ++++++++
 .../ECLAIR/print_analyzed_files.sh            |  66 ++++
 .../eclair_analysis/ECLAIR/public_APIs.ecl    |   6 +
 automation/eclair_analysis/ECLAIR/report.ecl  |   4 +
 automation/eclair_analysis/ECLAIR/tagging.ecl |  34 ++
 .../eclair_analysis/ECLAIR/toolchain.ecl      | 275 ++++++++++++++++
 20 files changed, 1797 insertions(+)
 create mode 100644 automation/eclair_analysis/ECLAIR/Set1.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/Set2.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/Set3.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/action.helpers
 create mode 100644 automation/eclair_analysis/ECLAIR/action.settings
 create mode 100755 automation/eclair_analysis/ECLAIR/action_clean_added.sh
 create mode 100755 automation/eclair_analysis/ECLAIR/action_log.sh
 create mode 100644 automation/eclair_analysis/ECLAIR/action_pull_request.sh
 create mode 100755 automation/eclair_analysis/ECLAIR/action_push.sh
 create mode 100755 automation/eclair_analysis/ECLAIR/action_upload_sarif.sh
 create mode 100644 automation/eclair_analysis/ECLAIR/analysis.ecl
 create mode 100755 automation/eclair_analysis/ECLAIR/analyze.sh
 create mode 100644 automation/eclair_analysis/ECLAIR/call_properties.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/deviations.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/out_of_scope.ecl
 create mode 100755 automation/eclair_analysis/ECLAIR/print_analyzed_files.=
sh
 create mode 100644 automation/eclair_analysis/ECLAIR/public_APIs.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/report.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/tagging.ecl
 create mode 100644 automation/eclair_analysis/ECLAIR/toolchain.ecl

diff --git a/automation/eclair_analysis/ECLAIR/Set1.ecl b/automation/eclair=
_analysis/ECLAIR/Set1.ecl
new file mode 100644
index 0000000000..86b8e7e772
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/Set1.ecl
@@ -0,0 +1,59 @@
+-doc_begin=3D"Set 1 of Xen MISRA C guidelines"
+-enable=3DMC3R1.R9.1
+-enable=3DMC3R1.R12.5
+-enable=3DMC3R1.R17.3
+-enable=3DMC3R1.R17.4
+-enable=3DMC3R1.R17.6
+-enable=3DMC3R1.R19.1
+-enable=3DMC3R1.R21.13
+-enable=3DMC3R1.R21.17
+-enable=3DMC3R1.R21.18
+-enable=3DMC3R1.R21.19
+-enable=3DMC3R1.R21.20
+-enable=3DMC3R1.R21.21
+-enable=3DMC3R1.R22.2
+-enable=3DMC3R1.R22.4
+-enable=3DMC3R1.R22.5
+-enable=3DMC3R1.R22.6
+-enable=3DMC3R1.D1.1
+-enable=3DMC3R1.D2.1
+-enable=3DMC3R1.D4.1
+-enable=3DMC3R1.D4.3
+-enable=3DMC3R1.D4.7
+-enable=3DMC3R1.D4.10
+-enable=3DMC3R1.D4.11
+-enable=3DMC3R1.D4.14
+-enable=3DMC3R1.R1.1
+-enable=3DMC3R1.R1.3
+-enable=3DMC3R1.R1.4
+-enable=3DMC3R1.R2.1
+-enable=3DMC3R1.R2.2
+-enable=3DMC3R1.R3.1
+-enable=3DMC3R1.R3.2
+-enable=3DMC3R1.R4.1
+-enable=3DMC3R1.R5.1
+-enable=3DMC3R1.R5.2
+-enable=3DMC3R1.R5.3
+-enable=3DMC3R1.R5.4
+-enable=3DMC3R1.R5.6
+-enable=3DMC3R1.R6.1
+-enable=3DMC3R1.R6.2
+-enable=3DMC3R1.R7.1
+-enable=3DMC3R1.R7.2
+-enable=3DMC3R1.R7.3
+-enable=3DMC3R1.R7.4
+-enable=3DMC3R1.R8.1
+-enable=3DMC3R1.R8.2
+-enable=3DMC3R1.R8.3
+-enable=3DMC3R1.R8.4
+-enable=3DMC3R1.R8.5
+-enable=3DMC3R1.R8.6
+-enable=3DMC3R1.R8.8
+-enable=3DMC3R1.R8.10
+-enable=3DMC3R1.R8.12
+-enable=3DMC3R1.R8.14
+-enable=3DMC3R1.R9.2
+-enable=3DMC3R1.R9.3
+-enable=3DMC3R1.R9.4
+-enable=3DMC3R1.R9.5
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/Set2.ecl b/automation/eclair=
_analysis/ECLAIR/Set2.ecl
new file mode 100644
index 0000000000..7608335cf4
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/Set2.ecl
@@ -0,0 +1,25 @@
+-doc_begin=3D"Set 2 of Xen MISRA C guidelines"
+-enable=3DMC3R1.R10.1
+-enable=3DMC3R1.R10.2
+-enable=3DMC3R1.R10.3
+-enable=3DMC3R1.R10.4
+-enable=3DMC3R1.R10.6
+-enable=3DMC3R1.R10.7
+-enable=3DMC3R1.R10.8
+-enable=3DMC3R1.R11.1
+-enable=3DMC3R1.R11.2
+-enable=3DMC3R1.R11.3
+-enable=3DMC3R1.R11.6
+-enable=3DMC3R1.R11.7
+-enable=3DMC3R1.R11.8
+-enable=3DMC3R1.R11.9
+-enable=3DMC3R1.R12.2
+-enable=3DMC3R1.R13.1
+-enable=3DMC3R1.R13.2
+-enable=3DMC3R1.R13.5
+-enable=3DMC3R1.R13.6
+-enable=3DMC3R1.R14.1
+-enable=3DMC3R1.R14.2
+-enable=3DMC3R1.R14.3
+-enable=3DMC3R1.R14.4
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/Set3.ecl b/automation/eclair=
_analysis/ECLAIR/Set3.ecl
new file mode 100644
index 0000000000..d2c2c4b21f
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/Set3.ecl
@@ -0,0 +1,67 @@
+-doc_begin=3D"Set 3 of Xen MISRA C guidelines"
+-enable=3DMC3R1.D4.12
+-enable=3DMC3R1.R5.5
+-enable=3DMC3R1.R5.7
+-enable=3DMC3R1.R5.8
+-enable=3DMC3R1.R15.2
+-enable=3DMC3R1.R15.3
+-enable=3DMC3R1.R15.6
+-enable=3DMC3R1.R15.7
+-enable=3DMC3R1.R16.1
+-enable=3DMC3R1.R16.2
+-enable=3DMC3R1.R16.3
+-enable=3DMC3R1.R16.4
+-enable=3DMC3R1.R16.5
+-enable=3DMC3R1.R16.6
+-enable=3DMC3R1.R16.7
+-enable=3DMC3R1.R17.1
+-enable=3DMC3R1.R17.2
+-enable=3DMC3R1.R17.5
+-enable=3DMC3R1.R17.7
+-enable=3DMC3R1.R18.1
+-enable=3DMC3R1.R18.2
+-enable=3DMC3R1.R18.3
+-enable=3DMC3R1.R18.6
+-enable=3DMC3R1.R18.7
+-enable=3DMC3R1.R18.8
+-enable=3DMC3R1.R20.2
+-enable=3DMC3R1.R20.3
+-enable=3DMC3R1.R20.4
+-enable=3DMC3R1.R20.6
+-enable=3DMC3R1.R20.7
+-enable=3DMC3R1.R20.8
+-enable=3DMC3R1.R20.9
+-enable=3DMC3R1.R20.11
+-enable=3DMC3R1.R20.12
+-enable=3DMC3R1.R20.13
+-enable=3DMC3R1.R20.14
+-enable=3DMC3R1.R21.1
+-enable=3DMC3R1.R21.2
+-enable=3DMC3R1.R21.3
+-enable=3DMC3R1.R21.4
+-enable=3DMC3R1.R21.5
+-enable=3DMC3R1.R21.6
+-enable=3DMC3R1.R21.7
+-enable=3DMC3R1.R21.8
+-enable=3DMC3R1.R21.9
+-enable=3DMC3R1.R21.10
+-enable=3DMC3R1.R21.12
+-enable=3DMC3R1.R21.14
+-enable=3DMC3R1.R21.15
+-enable=3DMC3R1.R21.16
+-enable=3DMC3R1.R22.1
+-enable=3DMC3R1.R22.3
+-enable=3DMC3R1.R22.7
+-enable=3DMC3R1.R22.8
+-enable=3DMC3R1.R22.9
+-enable=3DMC3R1.R22.10
+-enable=3DMC3R1.R2.6
+-enable=3DMC3R1.R4.2
+-doc_end
+
+-doc_begin=3D"Guidelines added with Xen MISRA C Task (a): Xen Coding Guide=
lines v1.1, June 1, 2023"
+-enable=3DMC3R1.R21.11
+-enable=3DMC3R1.D4.4
+-enable=3DMC3R1.R8.9
+-enable=3DMC3R1.R12.4
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/action.helpers b/automation/=
eclair_analysis/ECLAIR/action.helpers
new file mode 100644
index 0000000000..2ad6428eaa
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action.helpers
@@ -0,0 +1,193 @@
+if [ -n "${GITLAB_CI:-}" ]; then
+    ci=3Dgitlab
+elif [ -n "${GITHUB_ACTION:-}" ]; then
+    ci=3Dgithub
+elif [ -n "${JENKINS_HOME:-}" ]; then
+    ci=3Djenkins
+else
+    echo "Unexpected CI/CD context" >&2
+    exit 1
+fi
+
+esc=3D$(printf '\e')
+cr=3D$(printf '\r')
+
+open_section() {
+    id=3D$1
+    title=3D$2
+    collapsed=3D$3
+    echo "${esc}[0Ksection_start:$(date +%s):${id}${collapsed}${cr}${esc}[=
0K${esc}[1m${esc}[36m${title}${esc}[m"
+}
+
+close_section() {
+    id=3D$1
+    echo "${esc}[0Ksection_end:$(date +%s):${id}${cr}${esc}[0K"
+}
+
+summary() {
+    fixedReports=3D
+    newReports=3D
+    unfixedReports=3D
+    while read -r line; do
+        var=3D${line%%: *}
+        val=3D${line#*: }
+        eval "${var}=3D${val}"
+    done <"${updateLog}"
+
+    case "${ci}" in
+    github)
+        nl=3D"\\"
+        ;;
+    gitlab)
+        nl=3D
+        ;;
+    jenkins)
+        nl=3D"<br/>"
+        ;;
+    *)
+        nl=3D
+        ;;
+    esac
+
+    if [ -z "${newReports}" ]; then
+        fixedMsg=3D
+        unfixedMsg=3D"Unfixed reports: ${unfixedReports}"
+        countsMsg=3D"${unfixedMsg}"
+    else
+        fixedMsg=3D"Fixed reports: ${fixedReports}"
+        unfixedMsg=3D"Unfixed reports: ${unfixedReports} [new: ${newReport=
s}]"
+        countsMsg=3D"${fixedMsg}${nl}
+${unfixedMsg}"
+    fi
+    case "${ci}" in
+    jenkins)
+        cat <<EOF >"${summaryTxt}"
+${countsMsg}                                                              =
                ${nl}
+<a href=3D"https://www.bugseng.com/eclair">
+  <img src=3D"${eclairReportUrlPrefix}/rsrc/eclair.svg" width=3D"100" />
+</a>
+<h3>${jobHeadline}</h3>
+<a href=3D"${indexHtmlUrl}">Browse analysis results</a>
+EOF
+        ;;
+    *)
+        cat <<EOF >"${summaryTxt}"
+<a href=3D"https://www.bugseng.com/eclair">
+  <img src=3D"${eclairReportUrlPrefix}/rsrc/eclair.svg" width=3D"100" />
+</a>
+Analysis Summary
+
+${jobHeadline}${nl}
+${countsMsg}${nl}
+[Browse analysis](${indexHtmlUrl})
+EOF
+        ;;
+    esac
+
+    case ${ci} in
+    github)
+        cat "${summaryTxt}" >"${GITHUB_STEP_SUMMARY}"
+        ;;
+    gitlab)
+        open_section ECLAIR_summary "ECLAIR analysis summary" ""
+        # Generate summary and print it (GitLab-specific)
+        cat <<EOF
+${jobHeadline}
+${countsMsg}
+Browse analysis: ${esc}[33m${indexHtmlUrl}${esc}[m
+EOF
+        close_section ECLAIR_summary
+        ;;
+    jenkins)
+        cat <<EOF
+${jobHeadline}
+${fixedMsg}
+${unfixedMsg}
+Browse analysis: ${indexHtmlUrl}
+EOF
+        ;;
+    *)
+        echo "Unexpected CI/CD context" >&2
+        exit 1
+        ;;
+    esac
+}
+
+log_file() {
+    section_id=3D$1
+    section_name=3D$2
+    file=3D$3
+    exit_code=3D$4
+    if [ "${exit_code}" =3D 0 ]; then
+        collapsed=3D[collapsed=3Dtrue]
+    else
+        collapsed=3D
+    fi
+
+    case ${ci} in
+    github | jenkins)
+        echo "${section_name}"
+        ;;
+    gitlab)
+        open_section "${section_id}" "${section_name}" "${collapsed}"
+        ;;
+    *)
+        echo "Unexpected CI/CD context" >&2
+        exit 1
+        ;;
+    esac
+
+    cat "${file}"
+
+    case ${ci} in
+    github | jenkins) ;;
+    gitlab)
+        close_section "${section_id}"
+        ;;
+    *) ;;
+    esac
+}
+
+maybe_log_file_exit() {
+    section_id=3D$1
+    section_name=3D$2
+    file=3D$3
+    exit_code=3D$4
+
+    case ${ci} in
+    github | jenkins)
+        echo "${section_name}"
+        ;;
+    gitlab)
+        open_section "${section_id}" "${section_name}" ""
+        ;;
+    *)
+        echo "Unexpected CI/CD context" >&2
+        exit 1
+        ;;
+    esac
+
+    if [ "${exit_code}" !=3D 0 ]; then
+        cat "${file}"
+    fi
+
+    case ${ci} in
+    github | jenkins) ;;
+    gitlab)
+        close_section "${section_id}"
+        ;;
+    *) ;;
+    esac
+    return "${exit_code}"
+}
+
+is_enabled() {
+    case "$1" in
+    true | TRUE | y | Y | yes | YES | 1)
+        return 0
+        ;;
+    *)
+        return 1
+        ;;
+    esac
+}
diff --git a/automation/eclair_analysis/ECLAIR/action.settings b/automation=
/eclair_analysis/ECLAIR/action.settings
new file mode 100644
index 0000000000..96426811a8
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action.settings
@@ -0,0 +1,172 @@
+variantSubDir=3D
+variantHeadline=3D
+if [ -n "${VARIANT:-}" ]; then
+    variantSubDir=3D"/${VARIANT}"
+    variantHeadline=3D" [${VARIANT}]"
+fi
+
+# AUTO PR Feature
+# If the following variables are defined, then all pipelines
+# of other branches will be considered pull-requests to
+# autoPRBranch.
+# Customized
+autoPRRepository=3D"${AUTO_PR_REPOSITORY:-}"
+# Customized
+autoPRBranch=3D"${AUTO_PR_BRANCH:-}"
+
+# Customized
+artifactsRoot=3D/var/local/eclair
+
+case "${ci}" in
+github)
+    # To be customized
+    repository=3D"${GITHUB_REPOSITORY}"
+    jobId=3D"${GITHUB_RUN_NUMBER}"
+
+    autoPRRemoteUrl=3D"${GITHUB_SERVER_URL}/${autoPRRepository:-}.git"
+
+    case "${GITHUB_EVENT_NAME}" in
+    pull_request*)
+        event=3Dpull_request
+        pullRequestId=3D"${GITHUB_EVENT_PULL_REQUEST_NUMBER}"
+        pullRequestHeadRepo=3D"${PR_HEAD_REPO}"
+        pullRequestHeadRef=3D"${PR_HEAD_REF}"
+        pullRequestBaseRef=3D"${PR_BASE_REF}"
+        pullRequestUser=3D"${PR_USER}"
+        # baseCommitId and headCommitId are the most recent merge points w=
ithout conflicts
+        git fetch -q --deepen=3D2
+        baseCommitId=3D$(git show -s --pretty=3D%H HEAD^1)
+        headCommitId=3D$(git show -s --pretty=3D%H HEAD^2)
+        ;;
+    push | workflow_dispatch)
+        event=3Dpush
+        # Extract the branch name from "refs/heads/<branch>"
+        branch=3D"${GITHUB_REF#refs/heads/}"
+        headCommitId=3D"${GITHUB_SHA}"
+        pushUser=3D"${GITHUB_ACTOR}"
+        ;;
+    *)
+        echo "Unexpected GITHUB_REF ${GITHUB_REF}" >&2
+        exit 1
+        ;;
+    esac
+    ;;
+gitlab)
+    # Customized
+    repository=3D"${CI_PROJECT_PATH}"
+    jobId=3D"${CI_JOB_ID}"
+
+    gitlabApiUrl=3D"${CI_SERVER_PROTOCOL}://${CI_SERVER_HOST}:${CI_SERVER_=
PORT}/api/v4"
+    autoPRRemoteUrl=3D"${CI_SERVER_PROTOCOL}://${CI_SERVER_HOST}:${CI_SERV=
ER_PORT}/${autoPRRepository:-}.git"
+
+    # Customized
+    gitlabBotToken=3D"${ECLAIR_BOT_TOKEN:-}"
+
+    case "${CI_PIPELINE_SOURCE}" in
+    merge_request_event)
+        event=3Dpull_request
+        pullRequestId=3D"${CI_MERGE_REQUEST_IID}"
+        pullRequestHeadRef=3D"${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
+        pullRequestHeadRepo=3D"${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH}"
+        pullRequestBaseRef=3D"${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}"
+        pullRequestUser=3D"${GITLAB_USER_LOGIN}"
+        headCommitId=3D"${CI_COMMIT_SHA}"
+        baseCommitId=3D"${CI_MERGE_REQUEST_DIFF_BASE_SHA}"
+        ;;
+    push | pipeline | web)
+        event=3Dpush
+        branch=3D"${CI_COMMIT_BRANCH}"
+        headCommitId=3D"${CI_COMMIT_SHA}"
+        pushUser=3D"${GITLAB_USER_NAME}"
+        ;;
+    *)
+        echo "Unexpected event ${CI_PIPELINE_SOURCE}" >&2
+        exit 1
+        ;;
+    esac
+    ;;
+jenkins)
+    # To be customized
+    repository=3D"${JOB_BASE_NAME}"
+    project=3D"${JOB_NAME}"
+    jobId=3D"${BUILD_NUMBER}"
+
+    jenkinsApiUrl=3D"${JENKINS_URL}"
+    autoPRRemoteUrl=3D"${JENKINS_URL}/${autoPRRepository:-}.git"
+
+    # To be customized
+    jenkinsBotUsername=3D"${ECLAIR_BOT_USERNAME:-}"
+    jenkinsBotToken=3D"${ECLAIR_BOT_TOKEN:-}"
+
+    event=3Dpush
+    branch=3D"${GIT_BRANCH}"
+    headCommitId=3D"${GIT_COMMIT}"
+    pushUser=3D$(git show --pretty=3D'format:%aN' -s)
+    ;;
+*)
+    echo "Unexpected CI/CD context" >&2
+    exit 1
+    ;;
+esac
+
+if [ "${event}" =3D "push" ] && [ -n "${autoPRBranch:-}" ]; then
+    # AUTO PR Feature enabled
+    if ! [ "${branch}" =3D "${autoPRBranch}" ] ||
+        ! [ "${repository}" =3D "${autoPRRepository}" ]; then
+        event=3Dauto_pull_request
+    fi
+fi
+
+case "${event}" in
+pull_request)
+    subDir=3D"${pullRequestHeadRepo}.ecdf/${pullRequestBaseRef}"
+    jobHeadline=3D"ECLAIR ${ANALYSIS_KIND} on repository ${repository}: ${=
pullRequestUser} wants to merge ${pullRequestHeadRepo}:${pullRequestHeadRef=
} (${headCommitId}) into ${pullRequestBaseRef} (${baseCommitId})"
+    ;;
+push)
+    subDir=3D"${branch}"
+    jobHeadline=3D"ECLAIR ${ANALYSIS_KIND} on repository ${repository}: br=
anch ${branch} (${headCommitId})"
+    badgeLabel=3D"ECLAIR ${ANALYSIS_KIND} ${branch}${variantHeadline} #${j=
obId}"
+    ;;
+auto_pull_request)
+    git remote remove autoPRRemote || true
+    git remote add autoPRRemote "${autoPRRemoteUrl}"
+    git fetch -q autoPRRemote
+    subDir=3D"${branch}"
+    baseCommitId=3D$(git merge-base "autoPRRemote/${autoPRBranch}" HEAD)
+    jobHeadline=3D"ECLAIR ${ANALYSIS_KIND} on repository ${repository}: ${=
pushUser} wants to merge ${repository}:${branch} (${headCommitId}) into ${a=
utoPRRepository}/${autoPRBranch} (${baseCommitId})"
+    ;;
+*)
+    echo "Unexpected event ${event}" >&2
+    exit 1
+    ;;
+esac
+
+case "${repository}" in
+xen-project/xen)
+    # Customized
+    keepOldAnalyses=3D0
+    ;;
+xen-project/*)
+    # Customized
+    keepOldAnalyses=3D10
+    ;;
+*)
+    echo "Unexpected repository" >&2
+    exit 1
+    ;;
+esac
+
+ECLAIR_BIN_DIR=3D/opt/bugseng/eclair/bin/
+
+artifactsDir=3D"${artifactsRoot}/xen-project.ecdf/${repository}/ECLAIR_${A=
NALYSIS_KIND}"
+subDir=3D"${subDir}${variantSubDir}"
+jobHeadline=3D"${jobHeadline}${variantHeadline}"
+
+# Customized
+eclairReportUrlPrefix=3Dhttps://saas.eclairit.com:3787
+
+jobDir=3D"${artifactsDir}/${subDir}/${jobId}"
+updateLog=3D"${analysisOutputDir}/update.log"
+commentLog=3D"${analysisOutputDir}/comment.json"
+indexHtmlUrl=3D"${eclairReportUrlPrefix}/fs${jobDir}/index.html"
+summaryTxt=3D"${analysisOutputDir}/summary.txt"
diff --git a/automation/eclair_analysis/ECLAIR/action_clean_added.sh b/auto=
mation/eclair_analysis/ECLAIR/action_clean_added.sh
new file mode 100755
index 0000000000..59bc35fd13
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action_clean_added.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -eu
+
+usage() {
+    echo "Usage: $0 ANALYSIS_OUTPUT_DIR" >&2
+    exit 2
+}
+
+[ $# -eq 1 ] || usage
+
+analysisOutputDir=3D$1
+
+cleanAddedTxt=3D"${analysisOutputDir}/clean_added.log"
+
+# Load settings and helpers
+. "$(dirname "$0")/action.helpers"
+. "$(dirname "$0")/action.settings"
+
+unexpectedReports=3D$("${ECLAIR_BIN_DIR}eclair_report" \
+    "-db=3D'${analysisOutputDir}/PROJECT.ecd'" \
+    "-sel_unfixed=3Dunfixed" \
+    "-sel_tag_glob=3Dclean_added,clean,added" \
+    "-print=3D'',reports_count()")
+
+if [ "${unexpectedReports}" -gt 0 ]; then
+    cat <<EOF >"${cleanAddedTxt}"
+Failure: ${unexpectedReports} unexpected reports found.
+Unexpected reports are tagged 'clean:added'.
+EOF
+    exit 1
+else
+    cat <<EOF >"${cleanAddedTxt}"
+Success: No unexpected reports.
+EOF
+fi
diff --git a/automation/eclair_analysis/ECLAIR/action_log.sh b/automation/e=
clair_analysis/ECLAIR/action_log.sh
new file mode 100755
index 0000000000..67125b08f3
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action_log.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -eu
+
+usage() {
+    echo "Usage: $0 SECTION_ID SECTION_NAME FILE EXIT_CODE" >&2
+    exit 2
+}
+
+[ $# -eq 4 ] || usage
+
+# Load settings and helpers
+. "$(dirname "$0")/action.helpers"
+
+log_file "$@"
diff --git a/automation/eclair_analysis/ECLAIR/action_pull_request.sh b/aut=
omation/eclair_analysis/ECLAIR/action_pull_request.sh
new file mode 100644
index 0000000000..68f7e6282e
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+set -eu
+
+usage() {
+    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR COMMIT_ID" >&2
+    exit 2
+}
+
+[ $# -eq 2 ] || usage
+
+wtoken=3D$1
+analysisOutputDir=3D$2
+
+# Load settings and helpers
+. "$(dirname "$0")/action.helpers"
+. "$(dirname "$0")/action.settings"
+
+curl -sS "${eclairReportUrlPrefix}/ext/update_pull_request" \
+    -F "wtoken=3D${wtoken}" \
+    -F "artifactsDir=3D${artifactsDir}" \
+    -F "subDir=3D${subDir}" \
+    -F "jobId=3D${jobId}" \
+    -F "jobHeadline=3D${jobHeadline}" \
+    -F "baseCommitId=3D${baseCommitId}" \
+    -F "keepOldAnalyses=3D${keepOldAnalyses}" \
+    -F "db=3D@${analysisOutputDir}/PROJECT.ecd" \
+    >"${updateLog}"
+ex=3D0
+grep -Fq "unfixedReports: " "${updateLog}" || ex=3D$?
+maybe_log_file_exit PUBLISH_RESULT "Publishing results" "${updateLog}" "${=
ex}"
+
+summary
+
+if is_enabled "${ENABLE_ECLAIR_BOT:-}"; then
+    case ${ci} in
+    github)
+        ex=3D0
+        gh api \
+            --method POST \
+            "/repos/${repository}/issues/${pullRequestId}/comments" \
+            -F "body=3D@${summaryTxt}" \
+            --silent >"${commentLog}" 2>&1 || ex=3D$?
+        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "=
${ex}"
+        ;;
+    gitlab)
+        curl -sS --request POST \
+            "${gitlabApiUrl}/projects/${CI_PROJECT_ID}/merge_requests/${pu=
llRequestId}/notes" \
+            -H "PRIVATE-TOKEN: ${gitlabBotToken}" \
+            -F "body=3D<${summaryTxt}" >"${commentLog}"
+        ex=3D0
+        grep -Fq "Unfixed reports: " "${commentLog}" || ex=3D$?
+        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "=
${ex}"
+        ;;
+    *) ;;
+    esac
+fi
diff --git a/automation/eclair_analysis/ECLAIR/action_push.sh b/automation/=
eclair_analysis/ECLAIR/action_push.sh
new file mode 100755
index 0000000000..45215fbf00
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action_push.sh
@@ -0,0 +1,95 @@
+#!/bin/sh
+
+set -eu
+
+usage() {
+    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR" >&2
+    exit 2
+}
+
+[ $# -eq 2 ] || usage
+
+wtoken=3D$1
+analysisOutputDir=3D$2
+
+# Load settings and helpers
+. "$(dirname "$0")/action.helpers"
+. "$(dirname "$0")/action.settings"
+
+case "${event}" in
+push)
+    curl -sS "${eclairReportUrlPrefix}/ext/update_push" \
+        -F "wtoken=3D${wtoken}" \
+        -F "artifactsDir=3D${artifactsDir}" \
+        -F "subDir=3D${subDir}" \
+        -F "jobId=3D${jobId}" \
+        -F "jobHeadline=3D${jobHeadline}" \
+        -F "commitId=3D${headCommitId}" \
+        -F "badgeLabel=3D${badgeLabel}" \
+        -F "keepOldAnalyses=3D${keepOldAnalyses}" \
+        -F "db=3D@${analysisOutputDir}/PROJECT.ecd" \
+        >"${updateLog}"
+    ;;
+auto_pull_request)
+    curl -sS "${eclairReportUrlPrefix}/ext/update_pull_request" \
+        -F "wtoken=3D${wtoken}" \
+        -F "artifactsDir=3D${artifactsDir}" \
+        -F "subDir=3D${subDir}" \
+        -F "jobId=3D${jobId}" \
+        -F "jobHeadline=3D${jobHeadline}" \
+        -F "baseCommitId=3D${baseCommitId}" \
+        -F "keepOldAnalyses=3D${keepOldAnalyses}" \
+        -F "db=3D@${analysisOutputDir}/PROJECT.ecd" \
+        >"${updateLog}"
+    ;;
+*)
+    echo "Unexpected event ${event}" >&2
+    exit 1
+    ;;
+esac
+
+ex=3D0
+grep -Fq "unfixedReports: " "${updateLog}" || ex=3D$?
+maybe_log_file_exit PUBLISH_RESULT "Publishing results" "${updateLog}" "${=
ex}"
+
+summary
+
+if is_enabled "${ENABLE_ECLAIR_BOT:-}"; then
+    case ${ci} in
+    github)
+        ex=3D0
+        gh api \
+            --method POST \
+            "/repos/${repository}/commits/${headCommitId}/comments" \
+            -F "body=3D@${summaryTxt}" \
+            --silent >"${commentLog}" 2>&1 || ex=3D$?
+        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "=
${ex}"
+        ;;
+    gitlab)
+        curl -sS --request POST \
+            "${gitlabApiUrl}/projects/${CI_PROJECT_ID}/repository/commits/=
${CI_COMMIT_SHA}/comments" \
+            -H "PRIVATE-TOKEN: ${gitlabBotToken}" \
+            -F "note=3D<${summaryTxt}" >"${commentLog}"
+        ex=3D0
+        grep -Fq "Unfixed reports: " "${commentLog}" || ex=3D$?
+        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "=
${ex}"
+        ;;
+    jenkins)
+        ex=3D0
+        curl \
+            --user "${jenkinsBotUsername}:${jenkinsBotToken}" \
+            --data-urlencode "description=3D$(cat "${summaryTxt}")" \
+            --data-urlencode "Submit=3DSubmit" \
+            "${jenkinsApiUrl}job/${project}/${jobId}/submitDescription" \
+            >"${commentLog}" 2>&1 || ex=3D$?
+        curl \
+            --user "${jenkinsBotUsername}:${jenkinsBotToken}" \
+            --data-urlencode "description=3D$(cat "${summaryTxt}")" \
+            --data-urlencode "Submit=3DSubmit" \
+            "${jenkinsApiUrl}job/${project}/submitDescription" \
+            >"${commentLog}" 2>&1 || ex=3D$?
+        maybe_log_file_exit ADD_COMMENT "Adding comment" "${commentLog}" "=
${ex}"
+        ;;
+    *) ;;
+    esac
+fi
diff --git a/automation/eclair_analysis/ECLAIR/action_upload_sarif.sh b/aut=
omation/eclair_analysis/ECLAIR/action_upload_sarif.sh
new file mode 100755
index 0000000000..60b8034fcc
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/action_upload_sarif.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+set -eu
+
+usage() {
+    echo "Usage: $0 SARIF_FILE" >&2
+    exit 2
+}
+
+[ $# -eq 1 ] || usage
+
+HERE=3D$( (
+    cd "$(dirname "$0")"
+    echo "${PWD}"
+))
+
+. "${HERE}/action.helpers"
+
+sarifFile=3D$1
+sarifPayload=3D${HERE}/sarif.gz.b64
+uploadLog=3D${HERE}/upload_sarif.log
+
+gzip -c "${sarifFile}" | base64 -w0 >"${sarifPayload}"
+
+ex=3D0
+gh api --method POST -H "Accept: application/vnd.github+json" \
+    "/repos/${GITHUB_REPOSITORY}/code-scanning/sarifs" \
+    -f "commit_sha=3D${GITHUB_SHA}" -f "ref=3D${GITHUB_REF}" \
+    -F "sarif=3D@${sarifPayload}" \
+    --silent >"${uploadLog}" 2>&1 || ex=3D$?
+maybe_log_file_exit ADD_COMMENT "Uploading SARIF" "${uploadLog}" "${ex}"
diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/ec=
lair_analysis/ECLAIR/analysis.ecl
new file mode 100644
index 0000000000..fe418d6da1
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -0,0 +1,25 @@
+-setq=3Dset,getenv("SET")
+-project_name=3Dgetenv("ECLAIR_PROJECT_NAME")
+-project_root=3Dgetenv("ECLAIR_PROJECT_ROOT")
+
+-setq=3Ddata_dir,getenv("ECLAIR_DATA_DIR")
+
+-verbose
+
+-enable=3DB.REPORT.ECB
+-config=3DB.REPORT.ECB,output=3Djoin_paths(data_dir,"FRAME.@FRAME@.ecb")
+-config=3DB.REPORT.ECB,preprocessed=3Dshow
+-config=3DB.REPORT.ECB,macros=3D10
+
+-enable=3DB.EXPLAIN
+
+-eval_file=3Dtoolchain.ecl
+-eval_file=3Dpublic_APIs.ecl
+-eval_file=3Dout_of_scope.ecl
+-eval_file=3Ddeviations.ecl
+-eval_file=3Dcall_properties.ecl
+-eval_file=3Dtagging.ecl
+-eval_file=3Dconcat(set,".ecl")
+
+-doc=3D"Hide reports in external code."
+-reports+=3D{hide,all_exp_external}
diff --git a/automation/eclair_analysis/ECLAIR/analyze.sh b/automation/ecla=
ir_analysis/ECLAIR/analyze.sh
new file mode 100755
index 0000000000..47cdbb03ce
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/analyze.sh
@@ -0,0 +1,106 @@
+#!/bin/bash
+# Stop immediately if any executed command has exit status different from =
0.
+set -e
+set -o pipefail
+
+script_name=3D"$(basename "$0")"
+
+fatal() {
+  echo "${script_name}: $*" >&2
+  exit 1
+}
+
+usage() {
+  fatal "Usage: ${script_name} <ARM64|X86_64> <Set0|Set1|Set2|Set3>"
+}
+
+if [[ $# -ne 2 ]]; then
+  usage
+fi
+
+# Absolute path of the ECLAIR bin directory.
+export ECLAIR_BIN_DIR=3D/opt/bugseng/eclair/bin/
+
+# Directory where this script resides: usually in a directory named "ECLAI=
R".
+SCRIPT_DIR=3D"$(
+  cd "$(dirname "$0")"
+  echo "${PWD}"
+)"
+# Directory where to put all ECLAIR output and temporary files.
+if [[ -z "${ECLAIR_OUTPUT_DIR:-}" ]]; then
+  ECLAIR_OUTPUT_DIR=3D"${PWD}/ECLAIR/out"
+fi
+
+export ECLAIR_DIAGNOSTICS_OUTPUT=3D"${ECLAIR_OUTPUT_DIR}/ANALYSIS.log"
+# Set the variable for the build log file.
+ECLAIR_BUILD_LOG=3D${ECLAIR_OUTPUT_DIR}/BUILD.log
+# Set the variable for the report log file.
+ECLAIR_REPORT_LOG=3D${ECLAIR_OUTPUT_DIR}/REPORT.log
+
+if [[ "$1" =3D "X86_64" ]]; then
+  export CROSS_COMPILE=3D
+  export XEN_TARGET_ARCH=3Dx86_64
+  EXTRA_ECLAIR_ENV_OPTIONS=3D-disable=3DMC3R1.R20.7
+elif [[ "$1" =3D "ARM64" ]]; then
+  export CROSS_COMPILE=3Daarch64-linux-gnu-
+  export XEN_TARGET_ARCH=3Darm64
+else
+  fatal "Unknown configuration: $1"
+fi
+
+VARIANT=3D"${XEN_TARGET_ARCH}"
+
+# Used in analysis.ecl
+case "$2" in
+Set0|Set1|Set2|Set3)
+  export SET=3D"$2"
+  ;;
+*)
+  fatal "Unknown configuration: $2"
+  ;;
+esac
+
+export CC_ALIASES=3D"${CROSS_COMPILE}gcc-12"
+export CXX_ALIASES=3D"${CROSS_COMPILE}g++-12"
+export LD_ALIASES=3D"${CROSS_COMPILE}ld"
+export AR_ALIASES=3D"${CROSS_COMPILE}ar"
+export AS_ALIASES=3D"${CROSS_COMPILE}as"
+export FILEMANIP_ALIASES=3D"cp mv ${CROSS_COMPILE}objcopy"
+
+# ECLAIR binary data directory and workspace.
+export ECLAIR_DATA_DIR=3D"${ECLAIR_OUTPUT_DIR}/.data"
+# ECLAIR workspace.
+export ECLAIR_WORKSPACE=3D"${ECLAIR_DATA_DIR}/eclair_workspace"
+
+# Identifies the particular build of the project.
+export ECLAIR_PROJECT_NAME=3D"XEN_${VARIANT}-${SET}"
+# All paths mentioned in ECLAIR reports that are below this directory
+# will be presented as relative to ECLAIR_PROJECT_ROOT.
+export ECLAIR_PROJECT_ROOT=3D"${PWD}"
+
+# Erase and recreate the output directory and the data directory.
+rm -rf "${ECLAIR_OUTPUT_DIR:?}/*"
+mkdir -p "${ECLAIR_DATA_DIR}"
+
+# Perform the build (from scratch) in an ECLAIR environment.
+"${ECLAIR_BIN_DIR}eclair_env" \
+    "-config_file=3D'${SCRIPT_DIR}/analysis.ecl'" \
+    "${EXTRA_ECLAIR_ENV_OPTIONS}" \
+  -- "${SCRIPT_DIR}/../build.sh" "$1" | tee "${ECLAIR_BUILD_LOG}"
+
+
+# Create the project database.
+PROJECT_ECD=3D"${ECLAIR_OUTPUT_DIR}/PROJECT.ecd"
+find "${ECLAIR_DATA_DIR}" -maxdepth 1 -name "FRAME.*.ecb" |
+  sort | xargs cat |
+  "${ECLAIR_BIN_DIR}eclair_report" \
+    "-create_db=3D'${PROJECT_ECD}'" \
+    -load=3D/dev/stdin > "${ECLAIR_REPORT_LOG}" 2>&1
+
+# Create the Jenkins reports file.
+"${ECLAIR_BIN_DIR}eclair_report" \
+  "-db=3D'${PROJECT_ECD}'" \
+  "-eval_file=3D'${SCRIPT_DIR}/report.ecl'" \
+  >> "${ECLAIR_REPORT_LOG}" 2>&1
+
+"${SCRIPT_DIR}/print_analyzed_files.sh" "${PROJECT_ECD}" "${ECLAIR_OUTPUT_=
DIR}"
diff --git a/automation/eclair_analysis/ECLAIR/call_properties.ecl b/automa=
tion/eclair_analysis/ECLAIR/call_properties.ecl
new file mode 100644
index 0000000000..3f7794bf8b
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/call_properties.ecl
@@ -0,0 +1,106 @@
+
+-call_properties+=3D{"name(printk)", {"pointee_write(1..=3Dnever)", "taken=
()"}}
+-call_properties+=3D{"name(debugtrace_printk)", {"pointee_write(1..=3Dneve=
r)", "taken()"}}
+-call_properties+=3D{"name(panic)", {"pointee_write(1..=3Dnever)", "taken(=
)"}}
+-call_properties+=3D{"macro(^domain_crash$)", {"pointee_write(2..=3Dnever)=
", "taken()"}}
+-call_properties+=3D{"macro(^(g?d|mm_)?printk$)", {"pointee_write(2..=3Dne=
ver)", "taken()"}}
+-call_properties+=3D{"macro(^guest_bug_on_failed$)", {"pointee_write(1=3Dn=
ever)", "taken()"}}
+-call_properties+=3D{"macro(^spin_lock_init_prof$)", {"pointee_write(2=3Dn=
ever)", "taken()"}}
+-call_properties+=3D{"macro(^sched_test_func$)", {"pointee_write(1..=3Dnev=
er)", "taken()"}}
+-call_properties+=3D{"macro(^dev_(info|warn)$)", {"pointee_write(1..=3Dnev=
er)", "taken()"}}
+-call_properties+=3D{"macro(^PAGING_DEBUG$)", {"pointee_write(1..=3Dnever)=
", "taken()"}}
+-call_properties+=3D{"macro(^ACPI_(WARNING|ERROR|INFO)$)", {"pointee_write=
(1..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(fdt_get_property_by_offset_)", {"pointee_write(=
3=3Dalways)", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(read_atomic_size)", {"pointee_write(2=3Dalways)=
", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(device_tree_get_reg)", {"pointee_write(4..=3Dal=
ways)", "pointee_read(4..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(dt_get_range)", {"pointee_write(3..=3Dalways)",=
 "pointee_read(3..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(parse_static_mem_prop)", {"pointee_write(2..=3D=
always)", "pointee_read(2..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(get_ttbr_and_gran_64bit)", {"pointee_write(1..2=
=3Dalways)", "pointee_read(1..2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(hvm_emulate_init_once)", {"pointee_write(1=3Dal=
ways)", "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(__vmread)", {"pointee_write(2=3Dalways)", "poin=
tee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(hvm_pci_decode_addr)", {"pointee_write(3=3Dalwa=
ys)", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(vpci_mmcfg_decode_addr)", {"pointee_write(3=3Da=
lways)", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(x86emul_decode)", {"pointee_write(1=3Dalways)",=
 "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(unmap_grant_ref)", {"pointee_write(2=3Dalways)"=
, "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(arm_smmu_cmdq_build_cmd)", {"pointee_write(1=3D=
always)", "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(pci_size_mem_bar)", {"pointee_write(4=3Dalways)=
", "pointee_read(4=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(_hvm_read_entry)", {"pointee_write(2=3Dalways)"=
, "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(hvm_map_guest_frame_rw)", {"pointee_write(3=3Da=
lways)", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(guest_cpuid)", {"pointee_write(4=3Dalways)", "p=
ointee_read(4=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(epte_get_entry_emt)", {"pointee_write(5=3Dalway=
s)", "pointee_read(5=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(mcheck_mca_logout)", {"pointee_write(3=3Dalways=
)", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(set_field_in_reg_u32)", {"pointee_write(5=3Dalw=
ays)", "pointee_read(5=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(alloc_affinity_masks)", {"pointee_write(1=3Dalw=
ays)", "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(xasprintf)", {"pointee_write(1=3Dalways)", "poi=
ntee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(find_non_smt)", {"pointee_write(2=3Dalways)", "=
pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(call_rcu)", {"pointee_write(1=3Dalways)", "poin=
tee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(getdomaininfo)", {"pointee_write(2=3Dalways)", =
"pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"^MAPPING_(INSERT|SEARCH)\\(.*$", {"pointee_write(2..=
=3Dalways)", "pointee_read(2..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(FormatDec)", {"pointee_write(2=3Dalways)", "poi=
ntee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(FormatHex)", {"pointee_write(3=3Dalways)", "poi=
ntee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(p2m_get_ioreq_server)", {"pointee_write(2=3Dalw=
ays)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(elf_memset_unchecked)", {"pointee_write(1=3Dalw=
ays)", "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(set_iommu_pte_present)", {"pointee_write(7=3Dal=
ways)", "pointee_read(7=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(clear_iommu_pte_present)", {"pointee_write(4=3D=
always)", "pointee_read(4=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(vcpu_runstate_get)", {"pointee_write(2=3Dalways=
)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(va_start)", {"pointee_write(1=3Dalways)", "poin=
tee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(sgi_target_init)", {"pointee_write(1=3Dalways)"=
, "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(get_hw_residencies)", {"pointee_write(2=3Dalway=
s)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(x86_cpu_policy_to_featureset)", {"pointee_write=
(2=3Dalways)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"^simple_strtou?ll?\\(.*$", {"pointee_write(2=3Dalway=
s)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(msi_compose_msg)", {"pointee_write(3=3Dalways)"=
, "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(print_tainted)", {"pointee_write(1=3Dalways)", =
"pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(get_hvm_registers)", {"pointee_write(3=3Dalways=
)", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(x86_insn_modrm)", {"pointee_write(2..3=3Dalways=
)", "pointee_read(2..3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(cpuid_count_leaf)", {"pointee_write(3=3Dalways)=
", "pointee_read(3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(rcu_lock_remote_domain_by_id)", {"pointee_write=
(2=3Dalways)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(cpuid_count)", {"pointee_write(3..=3Dalways)", =
"pointee_read(3..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(efi_boot_mem_unused)", {"pointee_write(1..=3Dal=
ways)", "pointee_read(1..=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(collect_time_info)", {"pointee_write(2=3Dalways=
)", "pointee_read(2=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(setup_xstate_comp)", {"pointee_write(1=3Dalways=
)", "pointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(map_domain_gfn)", {"pointee_read(5=3Dnever)", "=
taken()"}}
+-call_properties+=3D{"name(fdt_getprop)", {"pointee_read(4=3Dnever)", "tak=
en()"}}
+-call_properties+=3D{"name(fdt_get_name)", {"pointee_read(3=3Dnever)", "ta=
ken()"}}
+-call_properties+=3D{"name(fdt_get_property)", {"pointee_read(4=3Dnever)",=
 "taken()"}}
+-call_properties+=3D{"name(pci_get_host_bridge_segment)", {"pointee_read(2=
=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(dt_get_property)", {"pointee_read(3=3Dnever)", =
"taken()"}}
+-call_properties+=3D{"name(dt_property_read_u32)", {"pointee_read(3=3Dneve=
r)", "taken()"}}
+-call_properties+=3D{"name(dt_device_get_paddr)", {"pointee_read(3..4=3Dne=
ver)", "taken()"}}
+-call_properties+=3D{"name(get_evtchn_dt_property)", {"pointee_write(2..3=
=3Dmaybe)", "pointee_read(2..3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(setup_chosen_node)", {"pointee_write(2..3=3Dmay=
be)", "pointee_read(2..3=3Dnever)", "taken()"}}
+-call_properties+=3D{"name(queue_remove_raw)", {"pointee_read(2=3Dnever)",=
 "taken()"}}
+-call_properties+=3D{"macro(^memset$)", {"pointee_write(1=3Dalways)", "poi=
ntee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"macro(^va_start$)", {"pointee_write(1=3Dalways)", "p=
ointee_read(1=3Dnever)", "taken()"}}
+-call_properties+=3D{"macro(^memcmp$)", {"pointee_write(1..2=3Dnever)", "t=
aken()"}}
+-call_properties+=3D{"macro(^memcpy$)", {"pointee_write(1=3Dalways&&2..=3D=
never)", "pointee_read(1=3Dnever&&2..=3Dalways)", "taken()"}}
+
+-doc_begin=3D"Property inferred as a consequence of the semantics of devic=
e_tree_get_reg"
+-call_properties+=3D{"name(acquire_static_memory_bank)", {"pointee_write(4=
..=3Dalways)", "pointee_read(4..=3Dnever)", "taken()"}}
+-doc_end
+
+-doc_begin=3D"Property inferred as a consequence of the semantics of dt_se=
t_cell"
+-call_properties+=3D{"name(set_interrupt)", {"pointee_write(1=3Dalways)", =
"pointee_read(1=3Dnever)", "taken()"}}
+-doc_end
+
+-doc_begin=3D"Property inferred as a consequence of the semantics of __p2m=
_get_mem_access"
+-call_properties+=3D{"name(p2m_get_mem_access)", {"pointee_write(3=3Dalway=
s)", "pointee_read(3=3Dnever)", "taken()"}}
+-doc_end
+
+-doc_begin=3D"This function has alternative definitions with props {write=
=3Dalways,read=3Dnever} and {write=3Dnever,read=3Dnever}"
+-call_properties+=3D{"name(alloc_cpumask_var)", {"pointee_write(1=3Dmaybe)=
", "pointee_read(1=3Dnever)", "taken()"}}
+-doc_end
+
+-doc_begin=3D"Property inferred as a consequence of the semantics of alloc=
_cpumask_var"
+-call_properties+=3D{"name(xenctl_bitmap_to_cpumask)", {"pointee_write(1=
=3Dalways)", "pointee_read(1=3Dnever)", "taken()"}}
+-doc_end
+
+-doc_begin=3D"The call to bitmap_and causes the pointee of dstp to be alwa=
ys written"
+-call_properties+=3D{"^cpumask_(and|andnot|clear|copy|complement).*$", {"p=
ointee_write(1=3Dalways)", "pointee_read(1=3Dnever)" "taken()"}}
+-call_properties+=3D{"^bitmap_(andnot|complement|fill).*$", {"pointee_writ=
e(1=3Dalways)", "pointee_read(1=3Dnever)", "taken()"}}
+-doc_end
+
+-doc_begin=3D"The .*copy_(to|from).* helpers all have a memcpy-like expect=
ation that the destination is a copy of the source.
+Furthermore, their uses do initialize the involved variables as needed by =
futher uses in the caller."
+-call_properties+=3D{"macro(^(__)?(raw_)?copy_from_(paddr|guest|compat)(_o=
ffset)?$)", {"pointee_write(1=3Dalways)", "pointee_read(1=3Dnever)", "taken=
()"}}
+-call_properties+=3D{"macro(^(__)?copy_to_(guest|compat)(_offset)?$)", {"p=
ointee_write(2=3Dalways)", "pointee_read(2=3Dnever)", "taken()"}}
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/=
eclair_analysis/ECLAIR/deviations.ecl
new file mode 100644
index 0000000000..e1a06daf2f
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -0,0 +1,298 @@
+### Set 1 ###
+
+#
+# Series 2.
+#
+
+-doc_begin=3D"The compiler implementation guarantees that the unreachable =
code is removed.
+Constant expressions and unreachable branches of if and switch statements =
are expected."
+-config=3DMC3R1.R2.1,+reports=3D{safe,"first_area(^.*has an invariantly.*$=
)"}
+-config=3DMC3R1.R2.1,+reports=3D{safe,"first_area(^.*incompatible with lab=
eled statement$)"}
+-doc_end
+
+-doc_begin=3D"Some functions are intended to be not referenced."
+-config=3DMC3R1.R2.1,+reports=3D{deliberate,"first_area(^.*is never refere=
nced$)"}
+-doc_end
+
+-doc_begin=3D"Unreachability in the following macros are expected and safe=
."
+-config=3DMC3R1.R2.1,statements+=3D{safe,"macro(name(BUG||assert_failed||E=
RROR_EXIT||ERROR_EXIT_DOM||PIN_FAIL))"}
+-doc_end
+
+-doc_begin=3D"Proving compliance with respect to Rule 2.2 is generally imp=
ossible:
+see https://arxiv.org/abs/2212.13933 for details. Moreover, peer review gi=
ves us
+confidence that no evidence of errors in the program's logic has been miss=
ed due
+to undetected violations of Rule 2.2, if any. Testing on time behavior giv=
es us
+confidence on the fact that, should the program contain dead code that is =
not
+removed by the compiler, the resulting slowdown is negligible."
+-config=3DMC3R1.R2.2,reports+=3D{disapplied,"any()"}
+-doc_end
+
+#
+# Series 3.
+#
+
+-doc_begin=3D"Comments starting with '/*' and containing hyperlinks are sa=
fe as
+they are not instances of commented-out code."
+-config=3DMC3R1.R3.1,reports+=3D{safe, "first_area(text(^.*https?://.*$))"}
+-doc_end
+
+#
+# Series 4.
+#
+
+-doc_begin=3D"The directive has been accepted only for the ARM codebase."
+-config=3DMC3R1.D4.3,reports+=3D{disapplied,"!(any_area(any_loc(file(^xen/=
arch/arm/arm64/.*$))))"}
+-doc_end
+
+-doc_begin=3D"Depending on the compiler, rewriting the following function-=
like
+macros as inline functions is not guaranteed to have the same effect."
+-config=3DMC3R1.D4.9,macros+=3D{deliberate,"name(likely)"}
+-config=3DMC3R1.D4.9,macros+=3D{deliberate,"name(unlikely)"}
+-config=3DMC3R1.D4.9,macros+=3D{deliberate,"name(unreachable)"}
+-doc_end
+
+-doc_begin=3D"These macros can be used on both pointers and unsigned long =
type values."
+-config=3DMC3R1.D4.9,macros+=3D{safe,"name(virt_to_maddr)"}
+-config=3DMC3R1.D4.9,macros+=3D{safe,"name(virt_to_mfn)"}
+-doc_end
+
+-doc_begin=3D"Rewriting variadic macros as variadic functions might have a=
 negative impact on safety."
+-config=3DMC3R1.D4.9,macros+=3D{deliberate,"variadic()"}
+-doc_end
+
+-doc_begin=3D"Rewriting macros with arguments that are, in turn, arguments=
 of
+__builtin_constant_p() can change the behavior depending on the optimizati=
on
+level."
+-config=3DMC3R1.D4.9,macro_argument_context+=3D"skip_to(class(type||expr||=
decl,any),
+                                            call(name(__builtin_constant_p=
)))"
+-doc_end
+
+-doc_begin=3D"Function-like macros defined in public headers are meant to =
be
+usable in C89 mode without any extensions. Hence they cannot be replaced by
+inline functions."
+-config=3DMC3R1.D4.9,macros+=3D{deliberate, "loc(file(api:public))"}
+-doc_end
+
+-doc_begin=3D"This header file is autogenerated or empty, therefore it pos=
es no
+risk if included more than once."
+-file_tag+=3D{empty_header, "^xen/arch/arm/efi/runtime\\.h$"}
+-file_tag+=3D{autogen_headers, "^xen/include/xen/compile\\.h$||^xen/includ=
e/generated/autoconf.h$||^xen/include/xen/hypercall-defs.h$"}
+-config=3DMC3R1.D4.10,reports+=3D{safe, "all_area(all_loc(file(empty_heade=
r||autogen_headers)))"}
+-doc_end
+
+-doc_begin=3D"Files that are intended to be included more than once do not=
 need to
+conform to the directive."
+-config=3DMC3R1.D4.10,reports+=3D{safe, "first_area(text(^/\\* This file i=
s legitimately included multiple times\\. \\*/$, begin-4))"}
+-config=3DMC3R1.D4.10,reports+=3D{safe, "first_area(text(^/\\* Generated f=
ile, do not edit! \\*/$, begin-3))"}
+-doc_end
+
+#
+# Series 5.
+#
+
+-doc_begin=3D"The project adopted the rule with an exception listed in
+'docs/misra/rules.rst'"
+-config=3DMC3R1.R5.3,reports+=3D{safe, "any_area(any_loc(any_exp(macro(^RE=
AD_SYSREG$))&&any_exp(macro(^WRITE_SYSREG$))))"}
+-config=3DMC3R1.R5.3,reports+=3D{safe, "any_area(any_loc(any_exp(macro(^ma=
x_t$))&&any_exp(macro(^min_t$))))"}
+-config=3DMC3R1.R5.3,reports+=3D{safe, "any_area(any_loc(any_exp(macro(^re=
ad[bwlq]$))&&any_exp(macro(^read[bwlq]_relaxed$))))"}
+-config=3DMC3R1.R5.3,reports+=3D{safe, "any_area(any_loc(any_exp(macro(^pe=
r_cpu$))&&any_exp(macro(^this_cpu$))))"}
+-doc_end
+
+-doc_begin=3D"The identifier 'fdt' is a widely-used name, for which no sui=
table
+substitute can be found. It is understood in 'xen/arch/arm/efi-boot.h' tha=
t the
+static variable 'fdt' cannot be confused with parameter names of the funct=
ion
+declarations that are present in the file."
+-file_tag+=3D{efi_boot_h, "^xen/arch/arm/efi/efi-boot\\.h$"}
+-config=3DMC3R1.R5.3,reports+=3D{deliberate, "any_area(decl(kind(var)&&sta=
tic_storage()&&^fdt$)&&any_loc(file(efi_boot_h)))"}
+-doc_end
+
+-doc_begin=3D"The identifier 'start' is a widely-used name, for which no s=
uitable
+substitute can be found. It is understood in 'xen/include/xen/kernel.h' th=
at the
+extern variable 'start' cannot be confused with omonymous parameter names =
of the
+function declarations where that variable is visible."
+-file_tag+=3D{kernel_h, "^xen/include/xen/kernel\\.h$"}
+-config=3DMC3R1.R5.3,reports+=3D{deliberate, "any_area(decl(kind(var)&&lin=
kage(external)&&^start$)&&any_loc(file(kernel_h)))"}
+-doc_end
+
+-doc_begin=3D"Function-like macros cannot be confused with identifiers tha=
t are
+neither functions nor pointers to functions."
+-config=3DMC3R1.R5.5,reports=3D{safe,"all_area(decl(node(enum_decl||record=
_decl||field_decl||param_decl||var_decl)&&!type(canonical(address((node(fun=
ction||function_no_proto))))))||macro(function_like()))"}
+-doc_end
+
+-doc_begin=3D"The use of these identifiers for both macro names and other =
entities
+is deliberate and does not generate developer confusion."
+-config=3DMC3R1.R5.5,reports+=3D{safe, "any_area(text(^\\s*/\\*\\s+SAF-[0-=
9]+-safe\\s+MC3R1\\.R5\\.5.*$, begin-1))"}
+-doc_end
+
+-doc_begin=3D"The definition of macros and functions ending in '_bit' that=
 use the
+same identifier in 'bitops.h' is deliberate and safe."
+-file_tag+=3D{bitops_h, "^xen/arch/x86/include/asm/bitops\\.h$"}
+-config=3DMC3R1.R5.5,reports+=3D{safe, "all_area((decl(^.*_bit\\(.*$)||mac=
ro(^.*_bit$))&&all_loc(file(bitops_h)))"}
+-doc_end
+
+-doc_begin=3D"The definition of macros and functions beginning in 'str' or=
 'mem'
+that use the same identifier in 'xen/include/xen/string.h' is deliberate a=
nd
+safe."
+-file_tag+=3D{string_h, "^xen/include/xen/string\\.h$"}
+-config=3DMC3R1.R5.5,reports+=3D{safe, "any_area((decl(^(mem|str).*$)||mac=
ro(^(mem|str).*$))&&all_loc(file(string_h)))"}
+-doc_end
+
+#
+# Series 7.
+#
+
+-doc_begin=3D"Usage of the following constants is safe, since they are giv=
en as-is
+in the inflate algorithm specification and there is therefore no risk of t=
hem
+being interpreted as decimal constants."
+-config=3DMC3R1.R7.1,literals=3D{safe, "^0(007|37|070|213|236|300|321|330|=
331|332|333|334|335|337|371)$"}
+-doc_end
+
+-doc_begin=3D"Violations in files that maintainers have asked to not modif=
y in the
+context of R7.2."
+-file_tag+=3D{adopted_r7_2,"^xen/include/xen/libfdt/.*$"}
+-file_tag+=3D{adopted_r7_2,"^xen/arch/x86/include/asm/x86_64/efibind.h$"}
+-file_tag+=3D{adopted_r7_2,"^xen/include/efi/efiapi\\.h$"}
+-file_tag+=3D{adopted_r7_2,"^xen/include/efi/efidef\\.h$"}
+-file_tag+=3D{adopted_r7_2,"^xen/include/efi/efiprot\\.h$"}
+-file_tag+=3D{adopted_r7_2,"^xen/arch/x86/cpu/intel\\.c$"}
+-file_tag+=3D{adopted_r7_2,"^xen/arch/x86/cpu/amd\\.c$"}
+-file_tag+=3D{adopted_r7_2,"^xen/arch/x86/cpu/common\\.c$"}
+-config=3DMC3R1.R7.2,reports+=3D{deliberate,"any_area(any_loc(file(adopted=
_r7_2)))"}
+-doc_end
+
+-doc_begin=3D"Violations caused by __HYPERVISOR_VIRT_START are related to =
the
+particular use of it done in xen_mk_ulong."
+-config=3DMC3R1.R7.2,reports+=3D{deliberate,"any_area(any_loc(macro(name(B=
UILD_BUG_ON))))"}
+-doc_end
+
+-doc_begin=3D"The following string literals are assigned to pointers to non
+const-qualified char."
+-config=3DMC3R1.R7.4,reports+=3D{safe, "any_area(text(^\\s*/\\*\\s+SAF-[0-=
9]+-safe\\s+MC3R1\\.R7\\.4.*$, begin-1))"}
+-doc_end
+
+-doc_begin=3D"Allow pointers of non-character type as long as the pointee =
is
+const-qualified."
+-config=3DMC3R1.R7.4,same_pointee=3Dfalse
+-doc_end
+
+#
+# Series 8.
+#
+
+-doc_begin=3D"The following variables are compiled in multiple translation=
 units
+belonging to different executables and therefore are safe."
+-config=3DMC3R1.R8.6,declarations+=3D{safe, "name(current_stack_pointer||b=
search||sort)"}
+-doc_end
+
+-doc_begin=3D"Declarations without definitions are allowed (specifically w=
hen the
+definition is compiled-out or optimized-out by the compiler)"
+-config=3DMC3R1.R8.6,reports+=3D{deliberate, "first_area(^.*has no definit=
ion$)"}
+-doc_end
+
+-doc_begin=3D"The gnu_inline attribute without static is deliberately allo=
wed."
+-config=3DMC3R1.R8.10,declarations+=3D{deliberate,"property(gnu_inline)"}
+-doc_end
+
+#
+# Series 9.
+#
+
+-doc_begin=3D"The following variables are written before being set, theref=
ore no
+access to uninitialized memory locations happens, as explained in the devi=
ation
+comment."
+-config=3DMC3R1.R9.1,reports+=3D{safe, "any_area(text(^\\s*/\\*\\s+SAF-[0-=
9]+-safe\\s+MC3R1\\.R9\\.1.*$, begin-1))"}
+-doc_end
+
+-doc_begin=3D"Violations in files that maintainers have asked to not modif=
y in the
+context of R9.1."
+-file_tag+=3D{adopted_r9_1,"^xen/arch/arm/arm64/lib/find_next_bit\\.c$"}
+-config=3DMC3R1.R9.1,reports+=3D{deliberate,"any_area(any_loc(file(adopted=
_r9_1)))"}
+-doc_end
+
+-doc_begin=3D"The possibility of committing mistakes by specifying an expl=
icit
+dimension is higher than omitting the dimension."
+-config=3DMC3R1.R9.5,reports+=3D{deliberate, "any()"}
+-doc_end
+
+### Set 2 ###
+
+#
+# Series 10.
+#
+
+-doc_begin=3D"The value-preserving conversions of integer constants are sa=
fe"
+-config=3DMC3R1.R10.1,etypes=3D{safe,"any()","preserved_integer_constant()=
"}
+-config=3DMC3R1.R10.3,etypes=3D{safe,"any()","preserved_integer_constant()=
"}
+-config=3DMC3R1.R10.4,etypes=3D{safe,"any()","preserved_integer_constant()=
||sibling(rhs,preserved_integer_constant())"}
+-doc_end
+
+-doc_begin=3D"Shifting non-negative integers to the right is safe."
+-config=3DMC3R1.R10.1,etypes+=3D{safe,
+  "stmt(node(binary_operator)&&operator(shr))",
+  "src_expr(definitely_in(0..))"}
+-doc_end
+
+-doc_begin=3D"Shifting non-negative integers to the left is safe if the re=
sult is
+still non-negative."
+-config=3DMC3R1.R10.1,etypes+=3D{safe,
+  "stmt(node(binary_operator)&&operator(shl)&&definitely_in(0..))",
+  "src_expr(definitely_in(0..))"}
+-doc_end
+
+-doc_begin=3D"Bitwise logical operations on non-negative integers are safe=
."
+-config=3DMC3R1.R10.1,etypes+=3D{safe,
+  "stmt(node(binary_operator)&&operator(and||or||xor))",
+  "src_expr(definitely_in(0..))"}
+-doc_end
+
+-doc_begin=3D"The implicit conversion to Boolean for logical operator argu=
ments is well known to all Xen developers to be a comparison with 0"
+-config=3DMC3R1.R10.1,etypes+=3D{safe, "stmt(operator(logical)||node(condi=
tional_operator||binary_conditional_operator))", "dst_type(ebool||boolean)"}
+-doc_end
+
+### Set 3 ###
+
+#
+# Series 18.
+#
+
+-doc_begin=3D"FIXME: explain why pointer differences involving this macro =
are safe."
+-config=3DMC3R1.R18.2,reports+=3D{safe,"all_area(all_loc(any_exp(macro(^AC=
PI_PTR_DIFF$))))"}
+-doc_end
+
+-doc_begin=3D"FIXME: explain why pointer differences involving this macro =
are safe."
+-config=3DMC3R1.R18.2,reports+=3D{safe,"all_area(all_loc(any_exp(macro(^pa=
ge_to_mfn$))))"}
+-doc_end
+
+-doc_begin=3D"FIXME: explain why pointer differences involving this macro =
are safe."
+-config=3DMC3R1.R18.2,reports+=3D{safe,"all_area(all_loc(any_exp(macro(^pa=
ge_to_pdx$))))"}
+-doc_end
+
+#
+# Series 20.
+#
+
+-doc_begin=3D"Code violating Rule 20.7 is safe when macro parameters are u=
sed: (1)
+as function arguments; (2) as macro arguments; (3) as array indices; (4) a=
s lhs
+in assignments."
+-config=3DMC3R1.R20.7,expansion_context=3D
+{safe, "context(__call_expr_arg_contexts)"},
+{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(node(arr=
ay_subscript_expr), subscript)))"},
+{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(operator=
(assign), lhs)))"},
+{safe, "left_right(^[(,\\[]$,^[),\\]]$)"}
+-doc_end
+
+#
+# Developer confusion
+#
+
+-doc=3D"Selection for reports that are fully contained in adopted code."
+-report_selector+=3D{adopted_report,"all_area(!kind(culprit||evidence)||al=
l_loc(all_exp(adopted||pseudo)))"}
+
+-doc_begin=3D"Adopted code is not meant to be read, reviewed or modified b=
y human
+programmers:no developers' confusion is not possible. In addition, adopted=
 code
+is assumed to work as is. Reports that are fully contained in adopted code=
 are
+hidden/tagged with the 'adopted' tag."
+-service_selector=3D{developer_confusion_guidelines,"^(MC3R1\\.R2\\.1|MC3R=
1\\.R2\\.2|MC3R1\\.R2\\.3|MC3R1\\.R2\\.4|MC3R1\\.R2\\.5|MC3R1\\.R2\\.6|MC3R=
1\\.R2\\.7|MC3R1\\.R4\\.1|MC3R1\\.R5\\.3|MC3R1\\.R5\\.6|MC3R1\\.R5\\.7|MC3R=
1\\.R5\\.8|MC3R1\\.R5\\.9|MC3R1\\.R7\\.1|MC3R1\\.R7\\.2|MC3R1\\.R7\\.3|MC3R=
1\\.R8\\.7|MC3R1\\.R8\\.8|MC3R1\\.R8\\.9|MC3R1\\.R8\\.11|MC3R1\\.R8\\.12|MC=
3R1\\.R8\\.13|MC3R1\\.R9\\.3|MC3R1\\.R9\\.4|MC3R1\\.R9\\.5|MC3R1\\.R10\\.2|=
MC3R1\\.R10\\.5|MC3R1\\.R10\\.6|MC3R1\\.R10\\.7|MC3R1\\.R10\\.8|MC3R1\\.R11=
\\.9|MC3R1\\.R12\\.1|MC3R1\\.R12\\.3|MC3R1\\.R12\\.4|MC3R1\\.R13\\.5|MC3R1\=
\.R14\\.1|MC3R1\\.R14\\.2|MC3R1\\.R14\\.3|MC3R1\\.R15\\.1|MC3R1\\.R15\\.2|M=
C3R1\\.R15\\.3|MC3R1\\.R15\\.4|MC3R1\\.R15\\.5|MC3R1\\.R15\\.6|MC3R1\\.R15\=
\.7|MC3R1\\.R16\\.1|MC3R1\\.R16\\.2|MC3R1\\.R16\\.3|MC3R1\\.R16\\.4|MC3R1\\=
.R16\\.5|MC3R1\\.R16\\.6|MC3R1\\.R16\\.7|MC3R1\\.R17\\.7|MC3R1\\.R17\\.8|MC=
3R1\\.R18\\.4|MC3R1\\.R18\\.5)$"
+}
+-config=3Ddeveloper_confusion_guidelines,reports+=3D{relied,adopted_report}
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/out_of_scope.ecl b/automatio=
n/eclair_analysis/ECLAIR/out_of_scope.ecl
new file mode 100644
index 0000000000..44db6997b5
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/out_of_scope.ecl
@@ -0,0 +1,127 @@
+-doc_begin=3D"Imported from Linux: ignore for now."
+-file_tag+=3D{adopted,"^xen/common/libfdt/.*$"}
+-file_tag+=3D{adopted,"^xen/include/xen/libfdt/.*$"}
+-file_tag+=3D{adopted,"^xen/common/xz/.*$"}
+-file_tag+=3D{adopted,"^xen/common/zstd/.*$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/apei/.*$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/tables/.*$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/utilities/.*$"}
+-file_tag+=3D{adopted,"^xen/drivers/video/font_.*$"}
+-file_tag+=3D{adopted,"^xen/arch/arm/arm64/cpufeature\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/arm/arm64/insn\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/arm/arm64/lib/find_next_bit\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/bitmap\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/bunzip2\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/earlycpio\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/inflate\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/lzo\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/lz4/decompress\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/radix-tree\\.c$"}
+-file_tag+=3D{adopted,"^xen/common/ubsan/ubsan\\.c$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/hwregs\\.c$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/numa\\.c$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/osl\\.c$"}
+-file_tag+=3D{adopted,"^xen/drivers/acpi/tables\\.c$"}
+-file_tag+=3D{adopted,"^xen/lib/list-sort\\.c$"}
+-file_tag+=3D{adopted,"^xen/lib/rbtree\\.c$"}
+-file_tag+=3D{adopted,"^xen/lib/xxhash.*\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/acpi/boot\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/acpi/cpu_idle\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/acpi/cpufreq/cpufreq\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/acpi/cpuidle_menu\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/acpi/lib\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/amd\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/centaur\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/common\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/hygon\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/intel\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/intel_cacheinfo\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/mcheck/non-fatal\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/mtrr/.*$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/cpu/mwait-idle\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/delay\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/dmi_scan\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/mpparse\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/srat\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/time\\.c$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/x86_64/mmconf-fam10h\\.c$"}
+-doc_end
+
+-doc_begin=3D"Intel specific source files are out of scope."
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/intel\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/intel_cacheinfo\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/microcode/intel\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/shanghai\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/hvm/vmx/.*$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/include/asm/hvm/vmx/.*$"}
+-file_tag+=3D{out_of_scope,"^xen/drivers/passthrough/vtd/.*$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/mcheck/mce_intel\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/mwait-idle\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/cpu/vpmu_intel\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/tsx\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/mm/altp2m\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/mm/p2m-ept\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/mm/hap/nested_ept\\.c$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/include/asm/altp2m\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/arch/x86/include/asm/intel-family\\.h$"}
+-doc_end
+
+-doc_begin=3D"Not in scope initially as it generates many violations and i=
t is not enabled in safety configurations."
+-file_tag+=3D{adopted,"^xen/xsm/flask/.*$"}
+-doc_end
+
+-doc_begin=3D"unlz4.c implementation by Yann Collet, the others un* are fr=
om Linux, ignore for now."
+-file_tag+=3D{adopted,"^xen/common/un.*\\.c$"}
+-doc_end
+
+-doc_begin=3D"Origin is external and documented in xen/crypto/README.sourc=
e ."
+-file_tag+=3D{adopted,"^xen/crypto/.*$"}
+-doc_end
+
+-doc_begin=3D"Files imported from the gnu-efi package"
+-file_tag+=3D{adopted,"^xen/include/efi/.*$"}
+-file_tag+=3D{adopted,"^xen/arch/x86/include/asm/x86_64/efibind\\.h$"}
+-doc_end
+
+-doc_begin=3D"Build tools are out of scope."
+-file_tag+=3D{out_of_scope_tools,"^xen/tools/.*$"}
+-file_tag+=3D{out_of_scope_tools,"^xen/arch/x86/efi/mkreloc\\.c$"}
+-file_tag+=3D{out_of_scope_tools,"^xen/arch/x86/boot/mkelf32\\.c$"}
+-doc_end
+
+-doc_begin=3D"Out of scope headers."
+-file_tag+=3D{out_of_scope,"^xen/include/xen/bitmap\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/earlycpio\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/lzo\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/lz4\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/common/lz4/defs\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/radix-tree\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/list_sort\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/rbtree\\.h$"}
+-file_tag+=3D{out_of_scope,"^xen/include/xen/xxhash\\.h$"}
+-doc_end
+
+-doc_begin=3D"Headers under xen/include/public/ are the description of the=
 public
+hypercall ABI so the community is extremely conservative in making changes
+there, because the interface is maintained for backward compatibility: ign=
ore
+for now."
+-file_tag+=3D{hypercall_ABI, "^xen/include/public/.*$"}
+-source_files+=3D{hide, hypercall_ABI}
+-doc_end
+
+-doc_begin=3D"Consider out-of-scope files external to the project."
+-file_tag+=3D{external, out_of_scope}
+-doc_end
+
+-doc_begin=3D"Consider adopted files external to the project."
+-file_tag+=3D{external, adopted}
+-doc_end
+
+-doc_begin=3D"Disregard out-of-scope tools."
+-frames+=3D{hide,"main(out_of_scope_tools)"}
+-doc_end
+
+-doc_begin=3D"The build performs speculative calls with target /dev/null: =
this
+frames should be ignored."
+-frames+=3D{hide,"target(^/dev/null$)"}
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/print_analyzed_files.sh b/au=
tomation/eclair_analysis/ECLAIR/print_analyzed_files.sh
new file mode 100755
index 0000000000..c19a8ecbd0
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/print_analyzed_files.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+# Stop immediately if any executed command has exit status different from =
0.
+set -eu
+
+script_name=3D"$(basename "$0")"
+script_dir=3D"$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null =
&& pwd )"
+
+fatal() {
+  echo "${script_name}: $*" >&2
+  exit 1
+}
+
+usage() {
+  fatal "Usage: ${script_name} DATABASE OUT_DIR"
+}
+
+extrapolate_regex() {
+  lookbehind=3D$1
+  file=3D$2
+  grep -Po "(?<=3D${lookbehind}\"\\^).*(?=3D\\$\")" "${file}" | sed 's/\\\=
\/\\/'
+}
+
+if [ $# -lt 2 ]; then
+  usage
+fi
+
+DB=3D$1
+OUT_DIR=3D$2
+
+files_txt=3D"${OUT_DIR}/files.txt"
+files_c_txt=3D"${OUT_DIR}/files_c.txt"
+files_h_txt=3D"${OUT_DIR}/files_h.txt"
+exclusions_txt=3D"${OUT_DIR}/exclusions.txt"
+
+
+if [[ ! -d "${OUT_DIR}" ]]; then
+  mkdir -p "${OUT_DIR}"
+else
+  rm -f "${files_txt}"
+  rm -f "${files_c_txt}"
+  rm -f "${files_h_txt}"
+  rm -f "${exclusions_txt}"
+fi
+
+# Generating txt report with files
+"${ECLAIR_BIN_DIR}eclair_report" -db=3D"${DB}" -files_txt=3D"${files_txt}"
+
+{
+  # Extracting out of scope code
+  out_of_scope_ecl=3D"${script_dir}/out_of_scope.ecl"
+  extrapolate_regex adopted,             "${out_of_scope_ecl}"
+  extrapolate_regex out_of_scope_tools,  "${out_of_scope_ecl}"
+  extrapolate_regex out_of_scope,        "${out_of_scope_ecl}"
+  extrapolate_regex hypercall_ABI,       "${out_of_scope_ecl}"
+  extrapolate_regex "hide, "             "${out_of_scope_ecl}"
+} >"${exclusions_txt}"
+sort -o "${exclusions_txt}" -u "${exclusions_txt}"
+
+# Removing exclusions from files_txt
+grep -E -v "(object: |/dev/pipe)" "${files_txt}" > "${files_txt}.tmp"
+grep -vf "${exclusions_txt}" "${files_txt}.tmp" > "${files_txt}"
+rm "${files_txt}.tmp"
+# Creating files with only headers
+grep -Ev "(xen.*\.(h\w+|[^h]\w*) |.*ecl)" "${files_txt}" > "${files_h_txt}"
+# Creating files with only c files
+grep -Ev "(xen.*\.(c\w+|[^c]\w*) |.*ecl)" "${files_txt}" > "${files_c_txt}"
diff --git a/automation/eclair_analysis/ECLAIR/public_APIs.ecl b/automation=
/eclair_analysis/ECLAIR/public_APIs.ecl
new file mode 100644
index 0000000000..9701a295e6
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/public_APIs.ecl
@@ -0,0 +1,6 @@
+# Definition of the public APIs.
+
+-doc=3D"All Xen public headers."
+-file_tag+=3D{api:public,"^xen/include/public/.*\\.h$"}
+
+-public_files+=3Dapi:public
diff --git a/automation/eclair_analysis/ECLAIR/report.ecl b/automation/ecla=
ir_analysis/ECLAIR/report.ecl
new file mode 100644
index 0000000000..6ee324746c
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/report.ecl
@@ -0,0 +1,4 @@
+# eclair_report
+
+reports_codeclimate("gl-code-quality-report.json")
+
diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/ecl=
air_analysis/ECLAIR/tagging.ecl
new file mode 100644
index 0000000000..ef2e56e186
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
@@ -0,0 +1,34 @@
+-doc=3D"Hide reports marked as compliant."
+-remap_rtag=3D{compliant,hide}
+
+-doc=3D"Hide reports marked as safe."
+-remap_rtag=3D{safe,hide}
+
+-doc=3D"Hide reports marked as relied."
+-remap_rtag=3D{relied,hide}
+
+-doc=3D"Hide reports marked as deliberate."
+-remap_rtag=3D{deliberate,hide}
+
+-doc=3D"Hide reports marked as disapplied."
+-remap_rtag=3D{disapplied,hide}
+
+#######################
+# Accepted guidelines #
+#######################
+
+-doc=3D"Accepted guidelines as reported in XEN/docs/misra/rules.rst"
+-service_selector=3D{accepted_guidelines,"^(MC3R1\\.D1\\.1|MC3R1\\.D2\\.1|=
MC3R1\\.D4\\.3|MC3R1\\.D4\\.7|MC3R1\\.D4\\.10|MC3R1\\.D4\\.11|MC3R1\\.D4\\.=
14|MC3R1\\.R1\\.1|MC3R1\\.R1\\.3|MC3R1\\.R1\\.4|MC3R1\\.R2\\.1|MC3R1\\.R2\\=
.6|MC3R1\\.R2\\.2|MC3R1\\.R3\\.1|MC3R1\\.R3\\.2|MC3R1\\.R4\\.1|MC3R1\\.R4\\=
.2|MC3R1\\.R5\\.1|MC3R1\\.R5\\.2|MC3R1\\.R5\\.3|MC3R1\\.R5\\.4|MC3R1\\.R5\\=
.6|MC3R1\\.R6\\.1|MC3R1\\.R6\\.2|MC3R1\\.R7\\.1|MC3R1\\.R7\\.2|MC3R1\\.R7\\=
.3|MC3R1\\.R7\\.4|MC3R1\\.R8\\.1|MC3R1\\.R8\\.2|MC3R1\\.R8\\.3|MC3R1\\.R8\\=
.4|MC3R1\\.R8\\.5|MC3R1\\.R8\\.6|MC3R1\\.R8\\.8|MC3R1\\.R8\\.10|MC3R1\\.R8\=
\.12|MC3R1\\.R8\\.14|MC3R1\\.R9\\.1|MC3R1\\.R9\\.2|MC3R1\\.R9\\.3|MC3R1\\.R=
9\\.4|MC3R1\\.R9\\.5|MC3R1\\.R12\\.5|MC3R1\\.R13\\.6|MC3R1\\.R13\\.1|MC3R1\=
\.R14\\.1|MC3R1\\.R16\\.7|MC3R1\\.R17\\.3|MC3R1\\.R17\\.4|MC3R1\\.R17\\.6|M=
C3R1\\.R18\\.3|MC3R1\\.R19\\.1|MC3R1\\.R20\\.7|MC3R1\\.R20\\.13|MC3R1\\.R20=
\\.14|MC3R1\\.R21\\.13|MC3R1\\.R21\\.17|MC3R1\\.R21\\.18|MC3R1\\.R21\\.19|M=
C3R1\\.R21\\.20|MC3R1\\.R21\\.21|MC3R1\\.R22\\.2|MC3R1\\.R22\\.4|MC3R1\\.R2=
2\\.5|MC3R1\\.R22\\.6)$"
+}
+-doc=3D"All reports of accepted guidelines are tagged as accepted."
+-reports+=3D{status:accepted,"service(accepted_guidelines)"}
+
+####################
+# Clean guidelines #
+####################
+
+-doc_begin=3D"Clean guidelines: new violations for these guidelines are no=
t accepted."
+-service_selector=3D{clean_guidelines,"^(MC3R1\\.D1\\.1|MC3R1\\.D2\\.1|MC3=
R1\\.D4\\.11|MC3R1\\.D4\\.14|MC3R1\\.R1\\.4|MC3R1\\.R2\\.2|MC3R1\\.R3\\.2|M=
C3R1\\.R5\\.1|MC3R1\\.R5\\.2|MC3R1\\.R5\\.4|MC3R1\\.R6\\.1|MC3R1\\.R6\\.2|M=
C3R1\\.R7\\.1|MC3R1\\.R8\\.1|MC3R1\\.R8\\.5|MC3R1\\.R8\\.8|MC3R1\\.R8\\.10|=
MC3R1\\.R8\\.12|MC3R1\\.R8\\.14|MC3R1\\.R9\\.2|MC3R1\\.R9\\.4|MC3R1\\.R9\\.=
5|MC3R1\\.R12\\.5|MC3R1\\.R17\\.3|MC3R1\\.R17\\.6|MC3R1\\.R21\\.13|MC3R1\\.=
R21\\.19|MC3R1\\.R21\\.21|MC3R1\\.R22\\.2|MC3R1\\.R22\\.4|MC3R1\\.R22\\.5)$"
+}
+-reports+=3D{clean:added,"service(clean_guidelines)"}
+-doc_end
diff --git a/automation/eclair_analysis/ECLAIR/toolchain.ecl b/automation/e=
clair_analysis/ECLAIR/toolchain.ecl
new file mode 100644
index 0000000000..e6cd289b5e
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/toolchain.ecl
@@ -0,0 +1,275 @@
+# Compilers.
+-file_tag+=3D{GCC_ARM64,"^/usr/bin/aarch64-linux-gnu-gcc-12$"}
+-file_tag+=3D{GCC_X86_64,"^/usr/bin/x86_64-linux-gnu-gcc-12$"}
+
+# Manuals.
+-setq=3DGCC_MANUAL,"https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc.pdf"
+-setq=3DCPP_MANUAL,"https://gcc.gnu.org/onlinedocs/gcc-12.1.0/cpp.pdf"
+-setq=3DARM64_ABI_MANUAL,"https://github.com/ARM-software/abi-aa/blob/60a8=
eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs64/aapcs64.rst"
+-setq=3DX86_64_ABI_MANUAL,"https://gitlab.com/x86-psABIs/x86-64-ABI/-/jobs=
/artifacts/master/raw/x86-64-ABI/abi.pdf?job=3Dbuild"
+-setq=3DARM64_LIBC_MANUAL,"https://www.gnu.org/software/libc/manual/pdf/li=
bc.pdf"
+-setq=3DX86_64_LIBC_MANUAL,"https://www.gnu.org/software/libc/manual/pdf/l=
ibc.pdf"
+-setq=3DC99_STD,"ISO/IEC 9899:1999"
+
+-doc_begin=3D"
+    _Static_assert: see Section \"2.1 C Language\" of "GCC_MANUAL".
+    asm, __asm__: see Sections \"6.48 Alternate Keywords\" and \"6.47 How =
to Use Inline Assembly Language in C Code\" of "GCC_MANUAL".
+    __volatile__: see Sections \"6.48 Alternate Keywords\" and \"6.47.2.1 =
Volatile\" of "GCC_MANUAL".
+    __const__, __inline__, __inline: see Section \"6.48 Alternate Keywords=
\" of "GCC_MANUAL".
+    typeof, __typeof__: see Section \"6.7 Referring to a Type with typeof\=
" of "GCC_MANUAL".
+    __alignof__, __alignof: see Sections \"6.48 Alternate Keywords\" and \=
"6.44 Determining the Alignment of Functions, Types or Variables\" of "GCC_=
MANUAL".
+    __attribute__: see Section \"6.39 Attribute Syntax\" of "GCC_MANUAL".
+    __builtin_types_compatible_p: see Section \"6.59 Other Built-in Functi=
ons Provided by GCC\" of "GCC_MANUAL".
+    __builtin_va_arg: non-documented GCC extension.
+    __builtin_offsetof: see Section \"6.53 Support for offsetof\" of "GCC_=
MANUAL".
+"
+-config=3DSTD.tokenext,behavior+=3D{c99, GCC_ARM64, "^(_Static_assert|asm|=
__asm__|__volatile__|__const__|__inline__|typeof|__typeof__|__alignof__|__a=
ttribute__|__builtin_types_compatible_p|__builtin_va_arg|__builtin_offsetof=
)$"}
+-config=3DSTD.tokenext,behavior+=3D{c99, GCC_X86_64, "^(_Static_assert|asm=
|__asm__|__volatile__|__const__|__inline__|__inline|typeof|__typeof__|__ali=
gnof__|__alignof|__attribute__|__builtin_types_compatible_p|__builtin_va_ar=
g|__builtin_offsetof)$"}
+-doc_end
+
+-doc_begin=3D"Non-documented GCC extension."
+-config=3DSTD.emptinit,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.emptinit,behavior+=3D{c99,GCC_X86_64,specified}
+#-config=3DSTD.emptinit,behavior+=3D{c18,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.24 Arithmetic on void- and Function-Pointers=
\" of "GCC_MANUAL"."
+-config=3DSTD.vptrarth,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.vptrarth,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.1 Statements and Declarations in Expressions=
\" of "GCC_MANUAL"."
+-config=3DSTD.stmtexpr,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.stmtexpr,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.19 Structures with No Members\" of "GCC_MANU=
AL"."
+-config=3DSTD.emptrecd,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.emptrecd,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.18 Arrays of Length Zero\" of "GCC_MANUAL"."
+-config=3DSTD.arayzero,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.arayzero,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.8 Conditionals with Omitted Operands\" of "G=
CC_MANUAL"."
+-config=3DSTD.bincondl,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.bincondl,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.30 Case Ranges\" of "GCC_MANUAL"."
+-config=3DSTD.caseuplw,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.caseuplw,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"See Section \"6.63 Unnamed Structure and Union Fields\" of "=
GCC_MANUAL"."
+-config=3DSTD.anonfild,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.anonfild,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"Non-documented GCC extension."
+-config=3DSTD.emptdecl,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.emptdecl,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"Non-documented GCC extension."
+-config=3DSTD.emptenum,behavior+=3D{c99,GCC_ARM64,specified}
+-doc_end
+
+-doc_begin=3D"Non-documented GCC extension."
+-config=3DSTD.pteincmp,behavior+=3D{c99,GCC_ARM64,specified}
+-config=3DSTD.pteincmp,behavior+=3D{c99,GCC_X86_64,specified}
+#-config=3DSTD.pteincmp,behavior+=3D{c18,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"Non-documented GCC extension."
+-config=3DSTD.funojptr,behavior+=3D{c99,GCC_X86_64,specified}
+-doc_end
+
+-doc_begin=3D"
+    ext_paste_comma: see Section \"6.21 Macros with a Variable Number of A=
rguments\" of "GCC_MANUAL".
+    ext_missing_varargs_arg: see Section \"6.21 Macros with a Variable Num=
ber of Arguments\" of "GCC_MANUAL".
+    ext_named_variadic_macro: see Section \"6.21 Macros with a Variable Nu=
mber of Arguments\" of "GCC_MANUAL".
+    ext_return_has_void_expr: see the documentation for -Wreturn-type in S=
ection \"3.8 Options to Request or Suppress Warnings\" of "GCC_MANUAL".
+    ext_gnu_statement_expr_macro: see Section \"6.1 Statements and Declara=
tions in Expressions\" of "GCC_MANUAL".
+    ext_sizeof_alignof_void_type: see Section \"6.24 Arithmetic on void- a=
nd Function-Pointers\" of "GCC_MANUAL".
+    ext_forward_ref_enum_def: see Section \"6.49 Incomplete enum Types\" o=
f "GCC_MANUAL".
+    ext_flexible_array_in_struct: see Section \"6.18 Arrays of Length Zero=
\" of "GCC_MANUAL".
+    ext_flexible_array_in_array: see Section \"6.18 Arrays of Length Zero\=
" of "GCC_MANUAL".
+    ext_enum_value_not_int: non-documented GCC extension.
+    ext_gnu_array_range: see Section \"6.29 Designated Initializers\" of "=
GCC_MANUAL".
+"
+-config=3DSTD.diag,behavior+=3D{c99,GCC_ARM64,"^(ext_paste_comma|ext_missi=
ng_varargs_arg|ext_named_variadic_macro|ext_return_has_void_expr|ext_gnu_st=
atement_expr_macro|ext_sizeof_alignof_void_type|ext_forward_ref_enum_def|ex=
t_gnu_array_range)$"}
+-config=3DSTD.diag,behavior+=3D{c99,GCC_X86_64,"^(ext_paste_comma|ext_miss=
ing_varargs_arg|ext_named_variadic_macro|ext_return_has_void_expr|ext_gnu_s=
tatement_expr_macro|ext_sizeof_alignof_void_type|ext_flexible_array_in_stru=
ct|ext_flexible_array_in_array|ext_enum_value_not_int|ext_gnu_array_range)$=
"}
+-doc_end
+
+-doc_begin=3D"The maximum size of an object is defined in the MAX_SIZE mac=
ro, and for a 32 bit architecture is 8MB.
+    The maximum size for an array is defined in the PTRDIFF_MAX and in a 3=
2 bit architecture is 2^30-1.
+    See occurrences of these macros in "GCC_MANUAL"."
+-config=3DSTD.byteobjt,behavior+=3D{c99, GCC_ARM64, 8388608}
+-config=3DSTD.byteobjt,behavior+=3D{c99, GCC_X86_64, 8388608}
+-doc_end
+
+-doc_begin=3D"See Section \"11.2 Implementation limits\" of "CPP_MANUAL"."
+-config=3DSTD.charline,behavior+=3D{c99, GCC_ARM64, 5000}
+-config=3DSTD.charline,behavior+=3D{c99, GCC_X86_64, 12000}
+-doc_end
+
+-doc_begin=3D"See Section \"11.2 Implementation limits\" of "CPP_MANUAL"."
+-config=3DSTD.inclnest,behavior+=3D{c99, GCC_ARM64, 24}
+-config=3DSTD.inclnest,behavior+=3D{c99, GCC_X86_64, 32}
+-doc_end
+
+-doc_begin=3D"FIXME: why is C90 used?"
+-config=3DSTD.ppifnest,behavior+=3D{c90, GCC_X86_64, 32}
+-doc_end
+
+-doc_begin=3D"See Section \"4.12 Statements\" of "GCC_MANUAL"."
+-config=3DSTD.caselimt,behavior+=3D{c99, GCC_X86_64, 1500}
+-doc_end
+
+-doc_begin=3D"See Section \"6.9 128-bit Integers\" of "GCC_MANUAL"."
+-config=3DSTD.stdtypes,behavior+=3D{c99, GCC_X86_64, "__uint128_t"}
+-doc_end
+
+-doc_begin=3D"FIXME: Non-documented GCC extension?"
+-config=3DSTD.charescp,behavior=3D{c99, GCC_X86_64, "^m$"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.9 Structures, Unions, Enumerations, and Bit-=
Fields\" of "GCC_MANUAL"."
+-config=3DSTD.bitfldtp, +behavior=3D{c99, GCC_ARM64, "unsigned char;unsign=
ed short;unsigned long;unsigned long long"}
+-config=3DSTD.bitfldtp, +behavior=3D{c99, GCC_X86_64, "unsigned char;unsig=
ned short;unsigned long;enum"}
+-doc_end
+
+-doc_begin=3D"
+    #pragma pack: see Section \"6.62.11 Structure-Layout Pragmas\" of "GCC=
_MANUAL".
+    #pragma GCC visibility: see Section \"6.62.14 Visibility Pragmas\" of =
"GCC_MANUAL".
+"
+-config=3DSTD.nonstdc,behavior=3D{c99, GCC_ARM64, "^(pack\\(|GCC visibilit=
y (push|pop)).*$"}
+-config=3DSTD.nonstdc,behavior=3D{c99, GCC_X86_64, "^(pack\\(|GCC visibili=
ty (push|pop)).*$"}
+-doc_end
+
+-doc_begin=3D"See Section \"1.1 Character sets\" of "CPP_MANUAL".  We assu=
me the locale is not restricting any UTF-8 characters being part of the sou=
rce character set."
+-config=3DSTD.charset,behavior=3D{c99, GCC_ARM64, "utf8"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.3 Identifiers\" of "GCC_MANUAL"."
+-config=3DSTD.extidsig, behavior+=3D{c99, GCC_ARM64, "63"}
+-config=3DSTD.extidsig, behavior+=3D{c99, GCC_X86_64, "63"}
+-doc_end
+
+#
+# Documentation for relied-upon implementation-defined behaviors (Dir 1.1)
+#
+
+-doc_begin=3D"See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \=
"8.1 Data types\" of "ARM64_ABI_MANUAL"."
+-config=3DSTD.bytebits,behavior=3D{c99, GCC_ARM64, "8"}
+-config=3DSTD.charsobj,behavior=3D{c99, GCC_ARM64, "utf8"}
+-config=3DSTD.charsval,behavior=3D{c99, GCC_ARM64, "utf8"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \=
"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
+-config=3DSTD.bytebits,behavior=3D{c99, GCC_X86_64, "8"}
+-config=3DSTD.charsobj,behavior=3D{c99, GCC_X86_64, "utf8"}
+-config=3DSTD.charsval,behavior=3D{c99, GCC_X86_64, "utf8"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.4 Characters\" of "GCC_MANUAL" and the docum=
entation for -finput-charset=3Dcharset in the same manual."
+-config=3DSTD.charsmap,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.charsmap,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.4 Characters\" of "GCC_MANUAL" and the docum=
entation for -fexec-charset=3Dcharset and -finput-charset=3Dcharset in the =
same manual."
+-config=3DSTD.charsmem,behavior=3D{c99, GCC_ARM64, "utf8"}
+-config=3DSTD.charsmem,behavior=3D{c99, GCC_X86_64, "utf8"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.1 Translation\" of "GCC_MANUAL"."
+-config=3DSTD.diagidnt,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.diagidnt,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.4 Characters\" of "GCC_MANUAL" and the docum=
entation for -fexec-charset=3Dcharset in the same manual."
+-config=3DSTD.execvals,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.execvals,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"Given that Xen is compiled in hosted mode, ECLAIR cannot exc=
lude the independency from program termination implementation-defined behav=
ior.  See \"Section 25.7 Program Termination\" of "ARM64_LIBC_MANUAL"."
+-config=3DSTD.exitstat,behavior=3D{c99, GCC_ARM64, "specified"}
+-doc_end
+
+-doc_begin=3D"Given that Xen is compiled in hosted mode, ECLAIR cannot exc=
lude the independency from program termination implementation-defined behav=
ior.  See \"Section 25.7 Program Termination\" of "X86_64_LIBC_MANUAL"."
+-config=3DSTD.exitstat,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Chapter \"2 Header Files\" of "CPP_MANUAL"."
+-config=3DSTD.inclangl,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.inclangl,behavior=3D{c99, GCC_X86_64, "specified"}
+-config=3DSTD.inclfile,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.inclfile,behavior=3D{c99, GCC_X86_64, "specified"}
+-config=3DSTD.inclhead,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.inclhead,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.5 Integers\" of "GCC_MANUAL"."
+-config=3DSTD.signdint,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.signdint,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.15 Architecture\" of "GCC_MANUAL" and Chapte=
r \"5   Data types and alignment\" of "ARM64_ABI_MANUAL"."
+-config=3DSTD.objbytes,behavior=3D{c99, GCC_ARM64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.15 Architecture\" of "GCC_MANUAL" and Sectio=
n \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
+-config=3DSTD.objbytes,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"3.4 Stringizing\" of "CPP_MANUAL"."
+-config=3DSTD.stringfy,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.stringfy,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.9 Structures, Unions, Enumerations, and Bit-=
Fields\"
+ of "GCC_MANUAL" and Section \"8.1.8 Bit-fields\" of "ARM64_ABI_MANUAL"."
+-config=3DSTD.bitfldby,+behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.bitfldor,+behavior=3D{c99, GCC_ARM64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.9 Structures, Unions, Enumerations, and Bit-=
Fields\"
+ of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_=
MANUAL"."
+-config=3DSTD.bitfldby,+behavior=3D{c99, GCC_X86_64, "specified"}
+-config=3DSTD.bitfldor,+behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.10 Qualifiers\" of "GCC_MANUAL"."
+-config=3DSTD.volatltp,+behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.volatltp,+behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.15 Architecture\" of "GCC_MANUAL" and Chapte=
r \"5   Data types and alignment\" of "ARM64_ABI_MANUAL"."
+-config=3DSTD.stdmacro,behavior=3D{c99, GCC_ARM64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.15 Architecture\" of "GCC_MANUAL" and Sectio=
n \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
+-config=3DSTD.stdmacro,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \=
"11.1 Implementation-defined behavior\" of "CPP_MANUAL"."
+-config=3DSTD.widestng,behavior=3D{c99, GCC_ARM64, "specified"}
+-config=3DSTD.widestng,behavior=3D{c99, GCC_X86_64, "specified"}
+-config=3DSTD.multbtsl,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.13 Preprocessing Directives\" of "GCC_MANUAL=
" and Section \"7 Pragmas\" of "CPP_MANUAL"."
+-config=3DSTD.pragmdir,behavior=3D{c99, GCC_ARM64, "^(pack\\(|GCC visibili=
ty (push|pop)).*$"}
+-config=3DSTD.pragmdir,behavior=3D{c99, GCC_X86_64, "^(pack\\(|GCC visibil=
ity (push|pop)).*$"}
+-doc_end
+
+-doc_begin=3D"See Section \"6.9 128-bit Integers\" of "GCC_MANUAL"."
+-config=3DSTD.extinttp,behavior=3D{c99, GCC_X86_64, "__uint128_t"}
+-doc_end
+
+-doc_begin=3D"See Section \"4.13 Preprocessing Directives\" of "GCC_MANUAL=
" and Section \"11.1 Implementation-defined behavior\" of "CPP_MANUAL"."
+-config=3DSTD.inclexpd,behavior=3D{c99, GCC_X86_64, "specified"}
+-doc_end
--=20
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 16:21:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 16:21:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570597.892531 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOhGq-0005eP-SB; Wed, 26 Jul 2023 16:21:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570597.892531; Wed, 26 Jul 2023 16:21:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOhGq-0005eI-OL; Wed, 26 Jul 2023 16:21:52 +0000
Received: by outflank-mailman (input) for mailman id 570597;
 Wed, 26 Jul 2023 16:21:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=j0A2=DM=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qOhGp-0004uL-QP
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 16:21:51 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 86d869b5-2bd0-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 18:21:51 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.26.92])
 by support.bugseng.com (Postfix) with ESMTPSA id 766C14EE073C;
 Wed, 26 Jul 2023 18:21:50 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 86d869b5-2bd0-11ee-b242-6b7b168915f2
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [XEN PATCH v4 3/4] automation: Add ECLAIR pipelines
Date: Wed, 26 Jul 2023 18:20:49 +0200
Message-Id: <4da07f65cf6f2e2d9ccffa479f3cb8165f273fdc.1690387393.git.simone.ballarin@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690387393.git.simone.ballarin@bugseng.com>
References: <cover.1690387393.git.simone.ballarin@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add two pipelines that analyze an ARM64 and a X86_64 build with the
ECLAIR static analyzer on the guidelines contained in Set1.

The analysis configuration is stored in automation/eclair_analysis.

All commits on the xen-project/xen:staging branch will be analyzed
and their artifacts will be stored indefinitely; the integration will
report differential information with respect to the previous analysis.

All commits on other branches or repositories will be analyzed and
only the last ten artifacts will be kept; the integration will report
differential information with respect to the analysis done on the common
ancestor with xen-project/xen:staging (if available).

Currently the pipeline variable ENABLE_ECLAIR_BOT is set to "n".
Doing so disables the generation of comments with the analysis summary
on the commit threads. The variable can be set to "y" if the a masked
variable named ECLAIR_BOT_TOKEN is set with the impersonation token of
an account with enough privileges to write on all repositories.

Additionaly any repository should be able to read a masked variable
named WTOKEN with the token provided by BUGSENG.

The analysis fails if it contains violations of guidelines tagged as
clean:added. The list of clean guidelines are maintained in
automation/eclair_analysis/ECLAIR/tagging.ecl.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

--
Changes in v4:
- move link to the analysis results at the end of the console log

Changes in v3:
- split definitions of the ECLAIR pipelines in a separate patch;
- if the WTOKEN variable is missing now the analysis fails immediately.

Changes in v2:
- add ECLAIR configuration files (before they were fetched from a separate
    repository);
- now the pipeline fails if there are new violations of guidelines tagged
    with clean:added.
---
 .gitlab-ci.yml                    |  2 ++
 automation/gitlab-ci/analyze.yaml | 38 +++++++++++++++++++++++++++++++
 automation/gitlab-ci/build.yaml   |  1 +
 automation/scripts/eclair         | 34 +++++++++++++++++++++++++++
 4 files changed, 75 insertions(+)
 create mode 100644 automation/gitlab-ci/analyze.yaml
 create mode 100755 automation/scripts/eclair

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c8bd7519d5..ee5430b8b7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,7 +1,9 @@
 stages:
+  - analyze
   - build
   - test
 
 include:
+  - 'automation/gitlab-ci/analyze.yaml'
   - 'automation/gitlab-ci/build.yaml'
   - 'automation/gitlab-ci/test.yaml'
diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
new file mode 100644
index 0000000000..3d8166572b
--- /dev/null
+++ b/automation/gitlab-ci/analyze.yaml
@@ -0,0 +1,38 @@
+.eclair-analysis:
+  stage: analyze
+  tags:
+    - eclair-analysis
+  variables:
+    ECLAIR_OUTPUT_DIR: "ECLAIR_out"
+    ANALYSIS_KIND: "normal"
+    ENABLE_ECLAIR_BOT: "n"
+    AUTO_PR_BRANCH: "staging"
+    AUTO_PR_REPOSITORY: "xen-project/xen"
+  artifacts:
+    when: always
+    paths:
+      - "${ECLAIR_OUTPUT_DIR}/*.log"
+      - "${ECLAIR_OUTPUT_DIR}/*.txt"
+      - '*.log'
+    reports:
+      codequality: gl-code-quality-report.json
+
+eclair-x86_64:
+  extends: .eclair-analysis
+  variables:
+    LOGFILE: "eclair-x86_64.log"
+    VARIANT: "X86_64"
+    RULESET: "Set1"
+  script:
+    - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
+  allow_failure: true
+
+eclair-ARM64:
+  extends: .eclair-analysis
+  variables:
+    LOGFILE: "eclair-ARM64.log"
+    VARIANT: "ARM64"
+    RULESET: "Set1"
+  script:
+    - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
+  allow_failure: true
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index c401f62d61..f01e2c32bb 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -11,6 +11,7 @@
       - '*.log'
       - '*/*.log'
     when: always
+  needs: []
   except:
     - master
     - smoke
diff --git a/automation/scripts/eclair b/automation/scripts/eclair
new file mode 100755
index 0000000000..813a56eb6a
--- /dev/null
+++ b/automation/scripts/eclair
@@ -0,0 +1,34 @@
+#!/bin/sh -eu
+
+ECLAIR_ANALYSIS_DIR=automation/eclair_analysis
+ECLAIR_DIR="${ECLAIR_ANALYSIS_DIR}/ECLAIR"
+ECLAIR_OUTPUT_DIR=$(realpath "${ECLAIR_OUTPUT_DIR}")
+
+if [ -z "${WTOKEN:-}" ]; then
+    echo "Failure: the WTOKEN variable is not defined." >&2
+    exit 1
+fi
+
+"${ECLAIR_ANALYSIS_DIR}/prepare.sh" "${VARIANT}"
+
+ex=0
+"${ECLAIR_DIR}/analyze.sh" "${VARIANT}" "${RULESET}" || ex=$?
+"${ECLAIR_DIR}/action_log.sh" ANALYSIS_LOG \
+                             "ECLAIR analysis log" \
+                             "${ECLAIR_OUTPUT_DIR}/ANALYSIS.log" \
+                             "${ex}"
+"${ECLAIR_DIR}/action_log.sh" REPORT_LOG \
+                             "ECLAIR report log" \
+                             "${ECLAIR_OUTPUT_DIR}/REPORT.log" \
+                             "${ex}"
+[ "${ex}" = 0 ] || exit "${ex}"
+
+# Fail in case of new reports
+"${ECLAIR_DIR}/action_clean_added.sh" "${ECLAIR_OUTPUT_DIR}" || ex=$?
+"${ECLAIR_DIR}/action_log.sh" DIFF_CHECK_LOG \
+                             "ECLAIR diff check" \
+                             "${ECLAIR_OUTPUT_DIR}/clean_added.log" \
+                             "${ex}"
+
+"${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
+[ "${ex}" = 0 ] || exit "${ex}"
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 16:21:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 16:21:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570598.892537 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOhGr-0005i7-8Q; Wed, 26 Jul 2023 16:21:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570598.892537; Wed, 26 Jul 2023 16:21:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOhGr-0005hr-0Z; Wed, 26 Jul 2023 16:21:53 +0000
Received: by outflank-mailman (input) for mailman id 570598;
 Wed, 26 Jul 2023 16:21:52 +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
 <SRS0=j0A2=DM=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qOhGq-0005Wu-2W
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 16:21:52 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 85d03ff1-2bd0-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 18:21:49 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.26.92])
 by support.bugseng.com (Postfix) with ESMTPSA id C93B24EE073A;
 Wed, 26 Jul 2023 18:21:48 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 85d03ff1-2bd0-11ee-8613-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [XEN PATCH v4 2/4] automation: Add xen builds for the ECLAIR analyses
Date: Wed, 26 Jul 2023 18:20:48 +0200
Message-Id: <5f41e020cd16c96a039fe5e23d5df0984edae1dc.1690387393.git.simone.ballarin@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690387393.git.simone.ballarin@bugseng.com>
References: <cover.1690387393.git.simone.ballarin@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

This patch defines an ARM64 and a X86_64 build for the
ECLAIR pipelines.

These files are used by the analyze.sh script in
automation/eclair_analysis: it initially calls prepare.sh,
then runs into an ECLAIR environment build.sh.

Only the toolchain invocations triggered by build.sh
are analyzed; the prepare.sh script is instead intended
to perform all the required operations for building xen
that are not supposed to be analyzed: e.g. dependencies
build.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

--
Changes in v4:
- add 'Reviewed-by'

Changes in v3:
- split build definitions in a separate patch

Changes in v2:
- add ECLAIR configuration files (before they were fetched from a separate
  repository);
- now the pipeline fails if there are new violations of guidelines tagged
  with clean:added.
---
 automation/eclair_analysis/Makefile.prepare |   6 +
 automation/eclair_analysis/build.sh         |  44 ++++++
 automation/eclair_analysis/prepare.sh       |  42 ++++++
 automation/eclair_analysis/xen_arm_config   | 147 +++++++++++++++++++
 automation/eclair_analysis/xen_x86_config   | 152 ++++++++++++++++++++
 5 files changed, 391 insertions(+)
 create mode 100644 automation/eclair_analysis/Makefile.prepare
 create mode 100755 automation/eclair_analysis/build.sh
 create mode 100755 automation/eclair_analysis/prepare.sh
 create mode 100644 automation/eclair_analysis/xen_arm_config
 create mode 100644 automation/eclair_analysis/xen_x86_config

diff --git a/automation/eclair_analysis/Makefile.prepare b/automation/eclai=
r_analysis/Makefile.prepare
new file mode 100644
index 0000000000..90f4a31172
--- /dev/null
+++ b/automation/eclair_analysis/Makefile.prepare
@@ -0,0 +1,6 @@
+include Makefile
+prepare:
+	$(Q)$(MAKE) $(build)=3Dtools
+	$(Q)$(MAKE) $(build)=3D. include/xen/compile.h
+	$(Q)$(MAKE) $(build)=3Dinclude all
+	$(Q)$(MAKE) $(build)=3Darch/$(SRCARCH) include
diff --git a/automation/eclair_analysis/build.sh b/automation/eclair_analys=
is/build.sh
new file mode 100755
index 0000000000..ec087dd822
--- /dev/null
+++ b/automation/eclair_analysis/build.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+# Stop immediately if any executed command has exit status different from =
0.
+set -e
+
+script_name=3D"$(basename "$0")"
+
+fatal() {
+  echo "${script_name}: $*" >&2
+  exit 1
+}
+
+usage() {
+  fatal "Usage: ${script_name} <ARM64|X86_64>"
+}
+
+if [ $# -ne 1 ]; then
+  usage
+fi
+
+if [ "$1" =3D "X86_64" ]; then
+  export CROSS_COMPILE=3D
+  export XEN_TARGET_ARCH=3Dx86_64
+elif [ "$1" =3D "ARM64" ]; then
+  export CROSS_COMPILE=3Daarch64-linux-gnu-
+  export XEN_TARGET_ARCH=3Darm64
+else
+  fatal "Unknown configuration: $1"
+fi
+
+if [[ -f /proc/cpuinfo ]]; then
+  PROCESSORS=3D$(grep -c ^processor /proc/cpuinfo)
+else
+  PROCESSORS=3D6
+fi
+
+(
+  cd xen
+
+  make "-j${PROCESSORS}" "-l${PROCESSORS}.0"    \
+       "CROSS_COMPILE=3D${CROSS_COMPILE}"         \
+       "CC=3D${CROSS_COMPILE}gcc-12"              \
+       "CXX=3D${CROSS_COMPILE}g++-12"             \
+       "XEN_TARGET_ARCH=3D${XEN_TARGET_ARCH}"
+)
diff --git a/automation/eclair_analysis/prepare.sh b/automation/eclair_anal=
ysis/prepare.sh
new file mode 100755
index 0000000000..275a1a3f51
--- /dev/null
+++ b/automation/eclair_analysis/prepare.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+# Stop immediately if any executed command has exit status different from =
0.
+set -e
+
+script_name=3D"$(basename "$0")"
+script_dir=3D"$(
+  cd "$(dirname "$0")"
+  echo "${PWD}"
+)"
+
+fatal() {
+  echo "${script_name}: $*" >&2
+  exit 1
+}
+
+usage() {
+  fatal "Usage: ${script_name}"
+}
+
+if [ $# -ne 1 ]; then
+  usage
+  exit 1
+fi
+
+export XEN_TARGET_ARCH
+
+if [ "$1" =3D "X86_64" ]; then
+  CONFIG_FILE=3D"${script_dir}/xen_x86_config"
+  XEN_TARGET_ARCH=3Dx86_64
+elif [ "$1" =3D "ARM64" ]; then
+  CONFIG_FILE=3D"${script_dir}/xen_arm_config"
+  XEN_TARGET_ARCH=3Darm64
+else
+  fatal "Unknown configuration: $1"
+fi
+
+(
+    cd xen
+    cp "${CONFIG_FILE}" .config
+    make clean
+    make -f ${script_dir}/Makefile.prepare prepare
+)
diff --git a/automation/eclair_analysis/xen_arm_config b/automation/eclair_=
analysis/xen_arm_config
new file mode 100644
index 0000000000..82102b889e
--- /dev/null
+++ b/automation/eclair_analysis/xen_arm_config
@@ -0,0 +1,147 @@
+# File provided in=0D
+# Re: Xen MISRA C: Source files in scope and out of scope=0D
+# from:	Stefano Stabellini <stefano.stabellini@amd.com>=0D
+# date:	6 giu 2023, 02:53=0D
+=0D
+#=0D
+# Automatically generated file; DO NOT EDIT.=0D
+# Xen/arm 4.18-unstable Configuration=0D
+#=0D
+CONFIG_CC_IS_GCC=3Dy=0D
+CONFIG_GCC_VERSION=3D90400=0D
+CONFIG_CLANG_VERSION=3D0=0D
+CONFIG_LD_IS_GNU=3Dy=0D
+CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE=3Dy=0D
+CONFIG_ARM_64=3Dy=0D
+CONFIG_ARM=3Dy=0D
+CONFIG_ARCH_DEFCONFIG=3D"arch/arm/configs/arm64_defconfig"=0D
+=0D
+# UBSAN=0D
+CONFIG_UBSAN=3Dn=0D
+=0D
+#=0D
+# Architecture Features=0D
+#=0D
+CONFIG_ARM64_SVE=3Dn=0D
+CONFIG_64BIT=3Dy=0D
+CONFIG_NR_CPUS=3D4=0D
+# CONFIG_ACPI is not set=0D
+CONFIG_ARM_EFI=3Dy=0D
+CONFIG_GICV3=3Dy=0D
+CONFIG_HAS_ITS=3Dy=0D
+CONFIG_HVM=3Dy=0D
+# CONFIG_NEW_VGIC is not set=0D
+CONFIG_SBSA_VUART_CONSOLE=3Dy=0D
+CONFIG_ARM_SSBD=3Dy=0D
+CONFIG_HARDEN_BRANCH_PREDICTOR=3Dy=0D
+# CONFIG_TEE is not set=0D
+# CONFIG_STATIC_SHM is not set=0D
+# end of Architecture Features=0D
+=0D
+#=0D
+# ARM errata workaround via the alternative framework=0D
+#=0D
+CONFIG_ARM64_ERRATUM_827319=3Dy=0D
+CONFIG_ARM64_ERRATUM_824069=3Dy=0D
+CONFIG_ARM64_ERRATUM_819472=3Dy=0D
+CONFIG_ARM64_ERRATUM_843419=3Dy=0D
+CONFIG_ARM64_ERRATUM_832075=3Dy=0D
+CONFIG_ARM64_ERRATUM_834220=3Dy=0D
+CONFIG_ARM_ERRATUM_858921=3Dy=0D
+CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=3Dy=0D
+CONFIG_ARM64_ERRATUM_1286807=3Dy=0D
+# end of ARM errata workaround via the alternative framework=0D
+=0D
+CONFIG_ARM64_HARDEN_BRANCH_PREDICTOR=3Dy=0D
+# CONFIG_ALL_PLAT is not set=0D
+# CONFIG_QEMU is not set=0D
+# CONFIG_RCAR3 is not set=0D
+CONFIG_MPSOC=3Dy=0D
+# CONFIG_NO_PLAT is not set=0D
+CONFIG_MPSOC_PLATFORM=3Dy=0D
+=0D
+#=0D
+# Common Features=0D
+#=0D
+CONFIG_GRANT_TABLE=3Dy=0D
+CONFIG_HAS_ALTERNATIVE=3Dy=0D
+CONFIG_HAS_DEVICE_TREE=3Dy=0D
+CONFIG_HAS_FAST_MULTIPLY=3Dy=0D
+CONFIG_HAS_PDX=3Dy=0D
+CONFIG_HAS_PMAP=3Dy=0D
+# CONFIG_MEM_ACCESS is not set=0D
+CONFIG_STATIC_MEMORY=3Dy=0D
+=0D
+#=0D
+# Speculative hardening=0D
+#=0D
+CONFIG_SPECULATIVE_HARDEN_ARRAY=3Dy=0D
+# end of Speculative hardening=0D
+=0D
+# CONFIG_HYPFS is not set=0D
+CONFIG_IOREQ_SERVER=3Dy=0D
+# CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP is not set=0D
+# CONFIG_XSM is not set=0D
+# CONFIG_ARGO is not set=0D
+=0D
+#=0D
+# Schedulers=0D
+#=0D
+# CONFIG_SCHED_CREDIT is not set=0D
+CONFIG_SCHED_CREDIT2=3Dy=0D
+# CONFIG_SCHED_RTDS is not set=0D
+# CONFIG_SCHED_ARINC653 is not set=0D
+CONFIG_SCHED_NULL=3Dy=0D
+CONFIG_SCHED_CREDIT2_DEFAULT=3Dy=0D
+# CONFIG_SCHED_NULL_DEFAULT is not set=0D
+CONFIG_SCHED_DEFAULT=3D"credit2"=0D
+# end of Schedulers=0D
+=0D
+CONFIG_BOOT_TIME_CPUPOOLS=3Dy=0D
+# CONFIG_LIVEPATCH is not set=0D
+# CONFIG_ENFORCE_UNIQUE_SYMBOLS is not set=0D
+CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS=3Dy=0D
+CONFIG_CMDLINE=3D""=0D
+CONFIG_DOM0_MEM=3D""=0D
+CONFIG_DTB_FILE=3D""=0D
+# CONFIG_TRACEBUFFER is not set=0D
+# end of Common Features=0D
+=0D
+#=0D
+# Device Drivers=0D
+#=0D
+# CONFIG_HAS_NS16550 is not set=0D
+CONFIG_HAS_CADENCE_UART=3Dy=0D
+# CONFIG_HAS_IMX_LPUART is not set=0D
+# CONFIG_HAS_MVEBU is not set=0D
+# CONFIG_HAS_MESON is not set=0D
+CONFIG_HAS_PL011=3Dy=0D
+# CONFIG_HAS_SCIF is not set=0D
+CONFIG_SERIAL_TX_BUFSIZE=3D16384=0D
+CONFIG_HAS_PASSTHROUGH=3Dy=0D
+CONFIG_ARM_SMMU=3Dy=0D
+CONFIG_ARM_SMMU_V3=3Dy=0D
+# CONFIG_IPMMU_VMSA is not set=0D
+CONFIG_IOMMU_FORCE_PT_SHARE=3Dy=0D
+# end of Device Drivers=0D
+=0D
+CONFIG_EXPERT=3Dy=0D
+CONFIG_UNSUPPORTED=3Dy=0D
+=0D
+#=0D
+# Debugging Options=0D
+#=0D
+CONFIG_DEBUG=3Dy=0D
+CONFIG_FRAME_POINTER=3Dy=0D
+CONFIG_COVERAGE=3Dy=0D
+CONFIG_DEBUG_LOCK_PROFILE=3Dy=0D
+CONFIG_DEBUG_LOCKS=3Dy=0D
+CONFIG_PERF_COUNTERS=3Dy=0D
+CONFIG_PERF_ARRAYS=3Dy=0D
+CONFIG_VERBOSE_DEBUG=3Dy=0D
+CONFIG_DEVICE_TREE_DEBUG=3Dy=0D
+CONFIG_SCRUB_DEBUG=3Dy=0D
+CONFIG_DEBUG_TRACE=3Dy=0D
+CONFIG_XMEM_POOL_POISON=3Dy=0D
+CONFIG_DEBUG_INFO=3Dy=0D
+# end of Debugging Options=0D
diff --git a/automation/eclair_analysis/xen_x86_config b/automation/eclair_=
analysis/xen_x86_config
new file mode 100644
index 0000000000..9b2709bfc8
--- /dev/null
+++ b/automation/eclair_analysis/xen_x86_config
@@ -0,0 +1,152 @@
+# File provided in=0D
+# Re: Xen MISRA C: Source files in scope and out of scope=0D
+# from:	Stefano Stabellini <stefano.stabellini@amd.com> =0D
+# date:	6 giu 2023, 02:53=0D
+=0D
+#=0D
+# Automatically generated file; DO NOT EDIT.=0D
+# Xen/x86 4.18-unstable Configuration=0D
+#=0D
+CONFIG_CC_IS_GCC=3Dy=0D
+CONFIG_GCC_VERSION=3D90400=0D
+CONFIG_CLANG_VERSION=3D0=0D
+CONFIG_LD_IS_GNU=3Dy=0D
+CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE=3Dy=0D
+CONFIG_X86_64=3Dy=0D
+CONFIG_X86=3Dy=0D
+CONFIG_ARCH_DEFCONFIG=3D"arch/x86/configs/x86_64_defconfig"=0D
+CONFIG_CC_HAS_INDIRECT_THUNK=3Dy=0D
+CONFIG_HAS_AS_CET_SS=3Dy=0D
+CONFIG_HAS_CC_CET_IBT=3Dy=0D
+=0D
+CONFIG_REQUIRE_NX=3Dn=0D
+=0D
+#=0D
+# Architecture Features=0D
+#=0D
+CONFIG_64BIT=3Dy=0D
+CONFIG_NR_CPUS=3D16=0D
+CONFIG_NR_NUMA_NODES=3D2=0D
+# CONFIG_PV is not set=0D
+CONFIG_HVM=3Dy=0D
+# CONFIG_XEN_SHSTK is not set=0D
+# CONFIG_XEN_IBT is not set=0D
+# CONFIG_SHADOW_PAGING is not set=0D
+# CONFIG_BIGMEM is not set=0D
+# CONFIG_HVM_FEP is not set=0D
+# CONFIG_TBOOT is not set=0D
+CONFIG_XEN_ALIGN_DEFAULT=3Dy=0D
+# CONFIG_XEN_ALIGN_2M is not set=0D
+CONFIG_X2APIC_PHYSICAL=3Dy=0D
+# CONFIG_XEN_GUEST is not set=0D
+# CONFIG_HYPERV_GUEST is not set=0D
+# CONFIG_MEM_PAGING is not set=0D
+# CONFIG_MEM_SHARING is not set=0D
+# end of Architecture Features=0D
+=0D
+#=0D
+# Common Features=0D
+#=0D
+CONFIG_COMPAT=3Dy=0D
+CONFIG_CORE_PARKING=3Dy=0D
+CONFIG_GRANT_TABLE=3Dy=0D
+CONFIG_ALTERNATIVE_CALL=3Dy=0D
+CONFIG_ARCH_MAP_DOMAIN_PAGE=3Dy=0D
+CONFIG_GENERIC_BUG_FRAME=3Dy=0D
+CONFIG_HAS_ALTERNATIVE=3Dy=0D
+CONFIG_HAS_COMPAT=3Dy=0D
+CONFIG_HAS_EX_TABLE=3Dy=0D
+CONFIG_HAS_FAST_MULTIPLY=3Dy=0D
+CONFIG_HAS_IOPORTS=3Dy=0D
+CONFIG_HAS_KEXEC=3Dy=0D
+CONFIG_HAS_PDX=3Dy=0D
+CONFIG_HAS_SCHED_GRANULARITY=3Dy=0D
+CONFIG_HAS_UBSAN=3Dy=0D
+CONFIG_MEM_ACCESS_ALWAYS_ON=3Dy=0D
+CONFIG_MEM_ACCESS=3Dy=0D
+CONFIG_NEEDS_LIBELF=3Dy=0D
+CONFIG_NUMA=3Dy=0D
+=0D
+#=0D
+# Speculative hardening=0D
+#=0D
+CONFIG_INDIRECT_THUNK=3Dy=0D
+CONFIG_SPECULATIVE_HARDEN_ARRAY=3Dy=0D
+CONFIG_SPECULATIVE_HARDEN_BRANCH=3Dy=0D
+# end of Speculative hardening=0D
+=0D
+# CONFIG_HYPFS is not set=0D
+CONFIG_IOREQ_SERVER=3Dy=0D
+# CONFIG_KEXEC is not set=0D
+# CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP is not set=0D
+# CONFIG_XENOPROF is not set=0D
+# CONFIG_XSM is not set=0D
+# CONFIG_ARGO is not set=0D
+=0D
+#=0D
+# Schedulers=0D
+#=0D
+# CONFIG_SCHED_CREDIT is not set=0D
+CONFIG_SCHED_CREDIT2=3Dy=0D
+# CONFIG_SCHED_RTDS is not set=0D
+# CONFIG_SCHED_ARINC653 is not set=0D
+CONFIG_SCHED_NULL=3Dy=0D
+CONFIG_SCHED_CREDIT2_DEFAULT=3Dy=0D
+# CONFIG_SCHED_NULL_DEFAULT is not set=0D
+CONFIG_SCHED_DEFAULT=3D"credit2"=0D
+# end of Schedulers=0D
+=0D
+# CONFIG_LIVEPATCH is not set=0D
+# CONFIG_ENFORCE_UNIQUE_SYMBOLS is not set=0D
+# CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS is not set=0D
+CONFIG_CMDLINE=3D""=0D
+CONFIG_DOM0_MEM=3D""=0D
+# CONFIG_TRACEBUFFER is not set=0D
+# end of Common Features=0D
+=0D
+#=0D
+# Device Drivers=0D
+#=0D
+CONFIG_ACPI=3Dy=0D
+CONFIG_ACPI_LEGACY_TABLES_LOOKUP=3Dy=0D
+CONFIG_ACPI_NUMA=3Dy=0D
+CONFIG_HAS_NS16550=3Dy=0D
+CONFIG_HAS_EHCI=3Dy=0D
+CONFIG_SERIAL_TX_BUFSIZE=3D16384=0D
+# CONFIG_XHCI is not set=0D
+CONFIG_HAS_CPUFREQ=3Dy=0D
+CONFIG_HAS_PASSTHROUGH=3Dy=0D
+CONFIG_AMD_IOMMU=3Dy=0D
+# CONFIG_INTEL_IOMMU is not set=0D
+# CONFIG_IOMMU_QUARANTINE_NONE is not set=0D
+CONFIG_IOMMU_QUARANTINE_BASIC=3Dy=0D
+# CONFIG_IOMMU_QUARANTINE_SCRATCH_PAGE is not set=0D
+CONFIG_HAS_PCI=3Dy=0D
+CONFIG_HAS_PCI_MSI=3Dy=0D
+CONFIG_VIDEO=3Dy=0D
+CONFIG_VGA=3Dy=0D
+CONFIG_HAS_VPCI=3Dy=0D
+# end of Device Drivers=0D
+=0D
+CONFIG_EXPERT=3Dy=0D
+CONFIG_UNSUPPORTED=3Dy=0D
+CONFIG_ARCH_SUPPORTS_INT128=3Dy=0D
+=0D
+#=0D
+# Debugging Options=0D
+#=0D
+CONFIG_DEBUG=3Dy=0D
+# CONFIG_CRASH_DEBUG is not set=0D
+CONFIG_GDBSX=3Dy=0D
+CONFIG_FRAME_POINTER=3Dy=0D
+# CONFIG_COVERAGE is not set=0D
+# CONFIG_DEBUG_LOCK_PROFILE is not set=0D
+CONFIG_DEBUG_LOCKS=3Dy=0D
+# CONFIG_PERF_COUNTERS is not set=0D
+CONFIG_VERBOSE_DEBUG=3Dy=0D
+CONFIG_SCRUB_DEBUG=3Dy=0D
+# CONFIG_UBSAN is not set=0D
+# CONFIG_DEBUG_TRACE is not set=0D
+CONFIG_XMEM_POOL_POISON=3Dy=0D
+CONFIG_DEBUG_INFO=3Dy=0D
+# end of Debugging Options=0D
--=20
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 16:21:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 16:21:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570599.892551 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOhGv-0006DG-B3; Wed, 26 Jul 2023 16:21:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570599.892551; Wed, 26 Jul 2023 16:21:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOhGv-0006D7-7e; Wed, 26 Jul 2023 16:21:57 +0000
Received: by outflank-mailman (input) for mailman id 570599;
 Wed, 26 Jul 2023 16:21:55 +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
 <SRS0=j0A2=DM=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1qOhGt-0005Wu-K5
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 16:21:55 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8896b9c5-2bd0-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 18:21:54 +0200 (CEST)
Received: from beta.bugseng.com (unknown [37.163.26.92])
 by support.bugseng.com (Postfix) with ESMTPSA id 472CE4EE073D;
 Wed, 26 Jul 2023 18:21:53 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8896b9c5-2bd0-11ee-8613-37d641c3527e
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH v4 4/4] maintainers: Add ECLAIR reviewer
Date: Wed, 26 Jul 2023 18:20:50 +0200
Message-Id: <4a58005750f39f517cd49fb37da5e17b8efe076e.1690387393.git.simone.ballarin@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690387393.git.simone.ballarin@bugseng.com>
References: <cover.1690387393.git.simone.ballarin@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
--

Changes in v4:
- add 'Acked-by'
- remove undesired blanks

Changes in v3:
- split maintainer add in a separate patch;
- substitute blanks with tabs;
- change role from maintainer to reviewer.

Changes in v2:
- add ECLAIR configuration files (before they were fetched from a separate
  repository);
- now the pipeline fails if there are new violations of guidelines tagged
  with clean:added.
---
 MAINTAINERS | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 180e57dac4..d8a02a6c19 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -305,6 +305,12 @@ F:	xen/include/xen/libfdt/
 F:	xen/include/xen/device_tree.h
 F:	xen/drivers/passthrough/device_tree.c
 
+ECLAIR
+R:	Simone Ballarin <simone.ballarin@bugseng.com>
+S:	Supported
+F:	automation/eclair_analysis/
+F:	automation/scripts/eclair
+
 EFI
 M:	Jan Beulich <jbeulich@suse.com>
 S:	Supported
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 16:54:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 16:54:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570619.892561 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOhmD-0002Ax-OP; Wed, 26 Jul 2023 16:54:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570619.892561; Wed, 26 Jul 2023 16:54:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOhmD-0002Aq-L6; Wed, 26 Jul 2023 16:54:17 +0000
Received: by outflank-mailman (input) for mailman id 570619;
 Wed, 26 Jul 2023 16:54:15 +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
 <SRS0=QPkR=DM=invisiblethingslab.com=demi@srs-se1.protection.inumbo.net>)
 id 1qOhmB-0002Ak-6e
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 16:54:15 +0000
Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com
 [66.111.4.28]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0a3eefee-2bd5-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 18:54:11 +0200 (CEST)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.nyi.internal (Postfix) with ESMTP id 8E4515C0198;
 Wed, 26 Jul 2023 12:54:09 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute5.internal (MEProxy); Wed, 26 Jul 2023 12:54:09 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed,
 26 Jul 2023 12:54:08 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0a3eefee-2bd5-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-transfer-encoding
	:content-type:date:date:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to; s=fm3; t=1690390449; x=1690476849; bh=ZSGL4tfDeh
	02pkZ94/2tVJRMmAk+Vt00ZLy1MQBP55Y=; b=pYszA4HxujdUCNeHbCaGgqeAQO
	7OxCMPtp39OADgyPrJ6IGJ3WDJaUUCQkw8W4IeToBQ6U4npachIhLOcYUEccTkHl
	qwxZYsglorioRcl0KRpIUKpXyip8suW05TtFMYr1bMH+QKswOV4d9LwXFvry/Xqg
	3oGtzYH6hzJsEQMNzoghVgTZbVv5cXGYVVBFzbpOnwwA/OILuUYNbEc0j8Efosv4
	9uyrpqIPgliYk7JCXuYe8+oaUI3ZpqLm3gMS5amW6wQbBYkNgv2zKepmA9xW4uIA
	9x7mlKYcI/Ut2b66V4Iyh7mb65OBOckVpOgTewFszt3A6YWEbnJnJU/utLfQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-transfer-encoding
	:content-type:date:date:feedback-id:feedback-id:from:from
	:in-reply-to:in-reply-to:message-id:mime-version:references
	:reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy
	:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1690390449; x=
	1690476849; bh=ZSGL4tfDeh02pkZ94/2tVJRMmAk+Vt00ZLy1MQBP55Y=; b=p
	6FSQOuj/2H3hSBngWtVOKyF58NPGfdIzkHe6K93sZ3hfbatPDPmekGd2XGMw5Ah9
	3gW25iltNtEqN1Box5KAUKiZ+4MHJxflrNs/41tqdzMPmO60q3wmDwTTZnIdR5uw
	Vk+PPTPEHATApmQN8Tq/vdpvUx+nPf11G0pPsKRym/fJ2l3lZfg0ZqvGF6Z6XTtg
	NLxi/VAz3s8Tee8l05WxbQvqPPuhFYMWdHlV9MTNQZopu1SKZ9bUtPRTbFD1gHgn
	r02JTsH9aMaD+mBvaoJHFXdlcafXRZzBa9GPodVTznA88drZPOO/OidmXIJ4LxUM
	L4iUUdL27Um39/kAps+Qg==
X-ME-Sender: <xms:sU_BZDVanUH1yxDKB6VmX3u-TXXoyxnMdmkrbZ5tFPl4usVaxA_VTg>
    <xme:sU_BZLki3bVKhpGN6QQuXJgCS8krimxJhOyLwUPlkviarwwgJ9I2aEAlL4YARhBfi
    r9L0C3Frfa_FdY>
X-ME-Received: <xmr:sU_BZPZWRoRDmNl96z1D2Kl0ydEC3gzDR2om4Pn6Mn6UNbD-ORKbbM34bd9aZGG3lubCRSqXH-s>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedriedvgddutdehucetufdoteggodetrfdotf
    fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
    uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
    cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepffgvmhhi
    ucforghrihgvucfqsggvnhhouhhruceouggvmhhisehinhhvihhsihgslhgvthhhihhngh
    hslhgrsgdrtghomheqnecuggftrfgrthhtvghrnhepgefhffegieektedtgfffvdfhhfdt
    veeiieeuffduvdehieehjeekhfelieehkeelnecuffhomhgrihhnpehquhgsvghsqdhosh
    drohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm
    peguvghmihesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm
X-ME-Proxy: <xmx:sU_BZOV2v0ctPrKU6GoLv_zHGVZq5Zp0SlKSNGomctJo6_eWv_muyA>
    <xmx:sU_BZNkht_7Ir8BBPzKzBddfkdmBcXTmWsPqS_Imo8MMQ6ttIwVfVw>
    <xmx:sU_BZLf7VN-6yIGWIZglx92ys71yADS85Ww7VdyGX2cggU-IHARG5Q>
    <xmx:sU_BZGD08CUwH15ywy98aCsXj9BdYpf1yKfWakXHMXnutqeuv3OXUA>
Feedback-ID: iac594737:Fastmail
From: Demi Marie Obenour <demi@invisiblethingslab.com>
To: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Demi Marie Obenour <demi@invisiblethingslab.com>,
	Xen developer discussion <xen-devel@lists.xenproject.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	stable@vger.kernel.org
Subject: [PATCH v4] xen: speed up grant-table reclaim
Date: Wed, 26 Jul 2023 12:52:41 -0400
Message-ID: <20230726165354.1252-1-demi@invisiblethingslab.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230627172216.1359-1-demi@invisiblethingslab.com>
References: <20230627172216.1359-1-demi@invisiblethingslab.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

When a grant entry is still in use by the remote domain, Linux must put
it on a deferred list.  Normally, this list is very short, because
the PV network and block protocols expect the backend to unmap the grant
first.  However, Qubes OS's GUI protocol is subject to the constraints
of the X Window System, and as such winds up with the frontend unmapping
the window first.  As a result, the list can grow very large, resulting
in a massive memory leak and eventual VM freeze.

To partially solve this problem, make the number of entries that the VM
will attempt to free at each iteration tunable.  The default is still
10, but it can be overridden via a module parameter.

This is Cc: stable because (when combined with appropriate userspace
changes) it fixes a severe performance and stability problem for Qubes
OS users.

Cc: stable@vger.kernel.org
Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com>
---
 Documentation/ABI/testing/sysfs-module | 11 +++++++
 drivers/xen/grant-table.c              | 40 +++++++++++++++++++-------
 2 files changed, 40 insertions(+), 11 deletions(-)

Changes since v3:
- do not mention Kconfig in the commit message.
- add entry to Documentation/ABI for the new sysfs entry.

Changes since v2:
- use atomic_inc_return(x) and atomic_dec_return(x) instead of
  atomic_add_return(1, x) and atomic_sub_return(1, x) respectively.
- move module_param macro closer to the definition of
  free_per_iteration.
- add blank line between declarations and statements.

Changes since v1:
- drop setting default via Kconfig

diff --git a/Documentation/ABI/testing/sysfs-module b/Documentation/ABI/testing/sysfs-module
index 08886367d0470e8d8922703a7d5174077801c2a8..62addab47d0c5908d26ec2f5d07db5ce21833566 100644
--- a/Documentation/ABI/testing/sysfs-module
+++ b/Documentation/ABI/testing/sysfs-module
@@ -60,3 +60,14 @@ Description:	Module taint flags:
 			C   staging driver module
 			E   unsigned module
 			==  =====================
+
+What:		/sys/module/grant_table/parameters/free_per_iteration
+Date:		July 2023
+KernelVersion:	6.5 but backported to all supported stable branches
+Contact:	Xen developer discussion <xen-devel@lists.xenproject.org>
+Description:	Read and write number of grant entries to attempt to free per iteration.
+
+		Note: Future versions of Xen and Linux may provide a better
+		interface for controlling the rate of deferred grant reclaim
+		or may not need it at all.
+Users:		Qubes OS (https://www.qubes-os.org)
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index e1ec725c2819d4d5dede063eb00d86a6d52944c0..f13c3b76ad1eb7110e2a2981e9fa4e504174e431 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -498,14 +498,21 @@ static LIST_HEAD(deferred_list);
 static void gnttab_handle_deferred(struct timer_list *);
 static DEFINE_TIMER(deferred_timer, gnttab_handle_deferred);
 
+static atomic64_t deferred_count;
+static atomic64_t leaked_count;
+static unsigned int free_per_iteration = 10;
+module_param(free_per_iteration, uint, 0600);
+
 static void gnttab_handle_deferred(struct timer_list *unused)
 {
-	unsigned int nr = 10;
+	unsigned int nr = READ_ONCE(free_per_iteration);
+	const bool ignore_limit = nr == 0;
 	struct deferred_entry *first = NULL;
 	unsigned long flags;
+	size_t freed = 0;
 
 	spin_lock_irqsave(&gnttab_list_lock, flags);
-	while (nr--) {
+	while ((ignore_limit || nr--) && !list_empty(&deferred_list)) {
 		struct deferred_entry *entry
 			= list_first_entry(&deferred_list,
 					   struct deferred_entry, list);
@@ -515,10 +522,14 @@ static void gnttab_handle_deferred(struct timer_list *unused)
 		list_del(&entry->list);
 		spin_unlock_irqrestore(&gnttab_list_lock, flags);
 		if (_gnttab_end_foreign_access_ref(entry->ref)) {
+			uint64_t ret = atomic64_dec_return(&deferred_count);
+
 			put_free_entry(entry->ref);
-			pr_debug("freeing g.e. %#x (pfn %#lx)\n",
-				 entry->ref, page_to_pfn(entry->page));
+			pr_debug("freeing g.e. %#x (pfn %#lx), %llu remaining\n",
+				 entry->ref, page_to_pfn(entry->page),
+				 (unsigned long long)ret);
 			put_page(entry->page);
+			freed++;
 			kfree(entry);
 			entry = NULL;
 		} else {
@@ -530,21 +541,22 @@ static void gnttab_handle_deferred(struct timer_list *unused)
 		spin_lock_irqsave(&gnttab_list_lock, flags);
 		if (entry)
 			list_add_tail(&entry->list, &deferred_list);
-		else if (list_empty(&deferred_list))
-			break;
 	}
-	if (!list_empty(&deferred_list) && !timer_pending(&deferred_timer)) {
+	if (list_empty(&deferred_list))
+		WARN_ON(atomic64_read(&deferred_count));
+	else if (!timer_pending(&deferred_timer)) {
 		deferred_timer.expires = jiffies + HZ;
 		add_timer(&deferred_timer);
 	}
 	spin_unlock_irqrestore(&gnttab_list_lock, flags);
+	pr_debug("Freed %zu references", freed);
 }
 
 static void gnttab_add_deferred(grant_ref_t ref, struct page *page)
 {
 	struct deferred_entry *entry;
 	gfp_t gfp = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL;
-	const char *what = KERN_WARNING "leaking";
+	uint64_t leaked, deferred;
 
 	entry = kmalloc(sizeof(*entry), gfp);
 	if (!page) {
@@ -567,10 +579,16 @@ static void gnttab_add_deferred(grant_ref_t ref, struct page *page)
 			add_timer(&deferred_timer);
 		}
 		spin_unlock_irqrestore(&gnttab_list_lock, flags);
-		what = KERN_DEBUG "deferring";
+		deferred = atomic64_inc_return(&deferred_count);
+		leaked = atomic64_read(&leaked_count);
+		pr_debug("deferring g.e. %#x (pfn %#lx) (total deferred %llu, total leaked %llu)\n",
+			 ref, page ? page_to_pfn(page) : -1, deferred, leaked);
+	} else {
+		deferred = atomic64_read(&deferred_count);
+		leaked = atomic64_inc_return(&leaked_count);
+		pr_warn("leaking g.e. %#x (pfn %#lx) (total deferred %llu, total leaked %llu)\n",
+			ref, page ? page_to_pfn(page) : -1, deferred, leaked);
 	}
-	printk("%s g.e. %#x (pfn %#lx)\n",
-	       what, ref, page ? page_to_pfn(page) : -1);
 }
 
 int gnttab_try_end_foreign_access(grant_ref_t ref)
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 16:55:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 16:55:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570625.892571 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOhnK-0002l5-7D; Wed, 26 Jul 2023 16:55:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570625.892571; Wed, 26 Jul 2023 16:55:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOhnK-0002ky-4f; Wed, 26 Jul 2023 16:55:26 +0000
Received: by outflank-mailman (input) for mailman id 570625;
 Wed, 26 Jul 2023 16:55:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=oEth=DM=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qOhnJ-0002kq-6A
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 16:55:25 +0000
Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com
 [2a00:1450:4864:20::52b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 36934a24-2bd5-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 18:55:24 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5221e2e69bdso6285284a12.2
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 09:55:24 -0700 (PDT)
Received: from [192.168.202.116] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 o17-20020aa7c511000000b0052275deb475sm876803edq.23.2023.07.26.09.55.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 09:55:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 36934a24-2bd5-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690390523; x=1690995323;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=Va8RyAuChcJCgwDXPThjGMYkGClfzUhKnHxi5Ri1rY0=;
        b=RrCvM9MT+3P9K8JTvNHpPIvPRIeh9LNPCif9sISfktEx6inDrceukFmR2JZapNpzOP
         6vdhywVF319EwRuCg7PA/d2tZKbI1EjRVGeWubDLcWS710W8vrvHrgpY3dJgjXqd9Xsg
         6OeiKGx1BCsvq/d0zeMd3S5MASo5pr/j7X9hDKB5V8l4kUp+xUwFw2G+JymdV8MTwTta
         B8qzrR1wtKTtqnc7j2iXEVQXtRlwWKomxm24hz3vmrMycM2fzm7Z5+PunmVqePBAREMX
         +odso/cplfx6YSqpMqY+hhy2iBuPfB4IZPvjEtSNLWkVNpApkYNZFvGgeEJGgGAjYXfx
         TJIg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690390523; x=1690995323;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=Va8RyAuChcJCgwDXPThjGMYkGClfzUhKnHxi5Ri1rY0=;
        b=jCCVtzVfNoqduPuNsLlhVRR/fTaxLOrXhG3iYuUjklDU4BFzirp9R9BIOKa+M3+ulH
         wYLDGSApi9yjPm5YG78gOoOes8rZhC1cfS39D7oPHYVi9K9MTvSTJF1S+eZAfLdkDiHX
         sViM0i/DYOYS1wzsghh3lyte2Kx4DLeTbQMnjNAXx5IkPJf+we0/jZZ+QRDUKUd0bvvE
         RG/V3yr/TZtpnxKo8H6EqIHMmFais/AZPru/bIwIEiNSz1j7qvgSGYY5cVKPyx9N8vTw
         T5lX/wHGt0yWJP132/tpbTlzKiDYjvTlTUC5DS2HkTrlKXgtNcvQKaAn18HFik+5Litp
         r6ew==
X-Gm-Message-State: ABy/qLYmYkJX4MYOxxycghTTAZYWdTOplKnfgSKNa/iBDSw88gYqUj6U
	ArZ6e1GmtQdsxzPb8gr/hYs=
X-Google-Smtp-Source: APBJJlH+bKJo6GE/XpCWSP+QVeX/AFdXxDl1Wy/ZvXV7C+JyezaUXq1l6KxQNnJwwi5wNi6GXKte0Q==
X-Received: by 2002:aa7:d352:0:b0:51e:362d:b172 with SMTP id m18-20020aa7d352000000b0051e362db172mr1864844edr.32.1690390523295;
        Wed, 26 Jul 2023 09:55:23 -0700 (PDT)
Message-ID: <f4a0f0c2a61c0e1d1313c734fbed539d5dd6b93b.camel@gmail.com>
Subject: Re: [PATCH v3 6/8] RISC-V: annotate entry points with type and size
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Bobby Eshleman <bobbyeshleman@gmail.com>, Alistair Francis
 <alistair.francis@wdc.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, George Dunlap
 <george.dunlap@citrix.com>,  Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, 
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Date: Wed, 26 Jul 2023 19:55:22 +0300
In-Reply-To: <f721e9e2-b73e-71ec-c337-bc3ad2352246@suse.com>
References: <e4bf47ca-2ae6-1fd4-56a6-e4e777150b64@suse.com>
	 <a4907ba1-a247-f96d-54e4-090f27665b20@suse.com>
	 <959bdb6d-9b6c-cde0-9459-c83cd3f58b18@suse.com>
	 <60e57a9b-8091-0e6a-6066-2364d7d5441a@suse.com>
	 <de4204862d2912611b004a9b2067b3743c0fbfbf.camel@gmail.com>
	 <f721e9e2-b73e-71ec-c337-bc3ad2352246@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Wed, 2023-07-26 at 17:43 +0200, Jan Beulich wrote:
> On 26.07.2023 17:28, Oleksii wrote:
> > On Mon, 2023-07-10 at 10:58 +0200, Jan Beulich wrote:
> > > On 10.07.2023 10:56, Jan Beulich wrote:
> > > > Use the generic framework in xen/linkage.h. No change in
> > > > generated
> > > > code
> > > > except of course the converted symbols change to be hidden ones
> > > > and
> > > > gain
> > > > a valid size.
> > > >=20
> > > > Signed-off-by: Jan Beulich <jbeulich@suse.com>
> > >=20
> > > I'm sorry, the Cc list was incomplete here. Adding back the
> > > remaining
> > > REST
> > > maintainers.
> > >=20
> > > Jan
> > >=20
> > > > ---
> > > > Probably count_args_exp() should move to macros.h, but I first
> > > > wanted to
> > > > see whether anyone can suggest any better approach for checking
> > > > whether
> > > > a defined macro expands to nothing.
> > What about introduction of conditional macros ?
> > Something similar to:
> > #include <stdio.h>
> >=20
> > #define CONDITIONAL_RETURN(arg1, arg2)
> > CONDITIONAL_RETURN_IMPL(arg1,
> > arg2, EMPTY)
> >=20
> > #define EMPTY(...) ""
> >=20
> > #define CONDITIONAL_RETURN_IMPL(arg1, arg2, empty_check) \
> > =C2=A0=C2=A0=C2=A0 CONDITIONAL_RETURN_##empty_check(arg1, arg2)
> >=20
> > #define CONDITIONAL_RETURN_EMPTY(arg1, arg2) \
> > =C2=A0=C2=A0=C2=A0 CONDITIONAL_RETURN_ARG1(arg1, arg2)
> >=20
> > #define CONDITIONAL_RETURN_ARG1(arg1, arg2) arg1, arg2
> >=20
> > #define CONDITIONAL_RETURN_ARG2(arg1, arg2) arg1
>=20
> I don't see how this would be used in your scheme. It ...
>=20
> > int main() {
> > =C2=A0=C2=A0=C2=A0 int a =3D 42;
> > =C2=A0=C2=A0=C2=A0 const char* b =3D "hello";
> >=20
> > =C2=A0=C2=A0=C2=A0 // Second argument is not empty, both arguments are =
returned
> > =C2=A0=C2=A0=C2=A0 printf("Case 1: %d, %s\n", CONDITIONAL_RETURN(a, b))=
;=C2=A0 //
> > Prints:
> > Case 1: 42, hello
> >=20
> > =C2=A0=C2=A0=C2=A0 // Second argument is empty, only the first argument=
 is
> > returned
> > =C2=A0=C2=A0=C2=A0 printf("Case 2: %d, %s\n", CONDITIONAL_RETURN(a, "")=
); //
> > Prints:
> > Case 2: 42,
>=20
> ... certainly isn't here, or this likely would cause at least a
> warning
> from the compiler (for there being too few arguments to printf()) and
> then a runtime UB for interpreting something as a pointer to a string
> which likely isn't.
>=20
> > =C2=A0=C2=A0=C2=A0 return 0;
> > }
> >=20
> > and then define DO_CODE_ALIGN using CONDITIONAL_RETURN?
>=20
> Afaict instead of getting rid of the comma, you'd actually add ""
> after it. What am I missing?
You are right. I missed that actually it returns "".

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 17:09:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 17:09:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570629.892581 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi0d-0004Qk-CI; Wed, 26 Jul 2023 17:09:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570629.892581; Wed, 26 Jul 2023 17:09:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi0d-0004Qd-8y; Wed, 26 Jul 2023 17:09:11 +0000
Received: by outflank-mailman (input) for mailman id 570629;
 Wed, 26 Jul 2023 17:09:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Pn9P=DM=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qOi0c-0004QX-Dc
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 17:09:10 +0000
Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com
 [2a00:1450:4864:20::52c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 22a5e896-2bd7-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 19:09:09 +0200 (CEST)
Received: by mail-ed1-x52c.google.com with SMTP id
 4fb4d7f45d1cf-5221e487e08so18423a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 10:09:09 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 22a5e896-2bd7-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690391349; x=1690996149;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=XuQFtCmaQChQNFDM3bDswWPcQ+lWFT/tUMMXj0Sc1KE=;
        b=fiuQnsOawlHOw2pSThp6YlE6UsyZk2KbDF3i+avo/wP6nxNCMJhHhTyGwZa5xY91uo
         QQPBvkN4IVTOR190yntnB0FJOSaq78FWscPa3v4vRoo8FlK19uisze8XKWJsRhb5R48G
         BQJjgo5zl4w+hVmtsQOOrSrWIgjmfcqJh39mNi/p34ugWOEJQ6jro5qrL+uOJgfOSFzp
         D+ehaNs4amolwBuOAWDybD8GsPb+5VxKOy8dxWrYuKYEmOvfWkq1u0CIQewAW3zMXhVA
         /QyWOXRS0ahSMFLwAW+M3/aXQl1fQ0NZvqqumo5hPmC1JJnj2NRbXXuryrA33ZeIgC5/
         r6Bw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690391349; x=1690996149;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=XuQFtCmaQChQNFDM3bDswWPcQ+lWFT/tUMMXj0Sc1KE=;
        b=JASu9iE89W/TrOTHnl8o/e8b8UOl+9xmdzQePjoZseqNq6NdptIySf0gPK1NCsP72h
         LAaq3+nkLaDG6FW/dGgjk6Ni0YbseTd5NcJ/cTvhXvzQPOgpZna1Qe+cVenVabzw/DqR
         uYcQ5vYUTq3J0Le/SqTMA1Vr51bCZEUwxByNwO/dEoE1c1ISRh3BWlqGcKPmakUQFBKw
         7h9SUnaWRhWRSMJS9AbMbsarOZqKOYIJNTL5nVSDHRxZddv6xaVus5vhE6uCFB2bj+3O
         VTtFIir8TTC5n2MJTHDOVHquvpaJS7RbkeO4EmrLLnRmrRw6Jru8NW/2XaJjCbS1Qgde
         vNpA==
X-Gm-Message-State: ABy/qLa7tqP9MHhCn9i/+xF/EqAlKyKiB09uALyZMAeHEn1JLbUOYuHC
	6b28HmPdPKujcq5wrBdE4KGXfwnxQ+mH8sGl6pg=
X-Google-Smtp-Source: APBJJlEG3m0KY4MBemSEXmIhF6/eZDFud60v3YH4tIuTuS5NxQjiqE1UK+TieeN9I4gdghGqGWPD2XkgDWfiUkSr8KA=
X-Received: by 2002:a05:6402:1847:b0:522:29c9:d30 with SMTP id
 v7-20020a056402184700b0052229c90d30mr2289484edy.10.1690391348886; Wed, 26 Jul
 2023 10:09:08 -0700 (PDT)
MIME-Version: 1.0
References: <20230724125857.11133-1-jandryuk@gmail.com> <20230724125857.11133-7-jandryuk@gmail.com>
 <7636d3d2-c78d-711a-ed90-aedd1b464c6c@suse.com> <CAKf6xpt1LzKMv7E-G3sTpUWrEApy+BX8z7dG69oS1upHcpytMg@mail.gmail.com>
 <d3d8123e-2b81-d3e0-3883-83dcdaf99700@suse.com> <CAKf6xpsE_=XYWcC8Q6NhKkboMajnOKZAsfUpOROeGuhU+7CTdw@mail.gmail.com>
 <3f43f36d-b661-ea65-e8de-d1c4fba34509@suse.com>
In-Reply-To: <3f43f36d-b661-ea65-e8de-d1c4fba34509@suse.com>
From: Jason Andryuk <jandryuk@gmail.com>
Date: Wed, 26 Jul 2023 13:08:57 -0400
Message-ID: <CAKf6xpuMwHff_SRHfeX7xTt+HPDS9tkO9ab-h=jfyp9F09U2LA@mail.gmail.com>
Subject: Re: [PATCH v6 06/15] cpufreq: Add Hardware P-State (HWP) driver
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, 
	Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 25, 2023 at 10:37=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wr=
ote:
>
> On 25.07.2023 15:26, Jason Andryuk wrote:

> >     #define hwp_err(cpu, fmt, args...) \
> >         printk(XENLOG_ERR "HWP: CPU%u error: " fmt, cpu, args)
>
> ..., just that you're missing the ##:
>
>     #define hwp_err(cpu, fmt, args...) \
>         printk(XENLOG_ERR "HWP: CPU%u error: " fmt, cpu, ## args)

Thanks.  I thought I was trying to avoid the use of "##", which sent
me off in the wrong direction.

Regards,
Jason


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 17:10:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 17:10:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570631.892590 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi1j-0005ne-LJ; Wed, 26 Jul 2023 17:10:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570631.892590; Wed, 26 Jul 2023 17:10:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi1j-0005nX-IW; Wed, 26 Jul 2023 17:10:19 +0000
Received: by outflank-mailman (input) for mailman id 570631;
 Wed, 26 Jul 2023 17:10:18 +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
 <SRS0=Pn9P=DM=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qOi1h-0005nP-VZ
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 17:10:17 +0000
Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com
 [2607:f8b0:4864:20::f2d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 49631b4d-2bd7-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 19:10:15 +0200 (CEST)
Received: by mail-qv1-xf2d.google.com with SMTP id
 6a1803df08f44-63d09d886a6so397906d6.2
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 10:10:15 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 s17-20020a0ca611000000b0063d1aa446e2sm1248019qva.59.2023.07.26.10.10.11
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 10:10:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 49631b4d-2bd7-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690391413; x=1690996213;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=aqabqG54N5FkkdtDMamD9uQTj07nTP3p+qQtsWvth28=;
        b=JyQfIAC2j3WiPl0LiIb0Fa0BEyAIUQywMCa9SlTFb9mYeUJ2EaBnZde/TWtP68sUcT
         LGDTg7SL2r2T89DjbVPQPdWCfWn7OomLqmM46yWGq+GAMUTCELIwRU1xD024Tc5QqVKz
         XiuGDEHSxooK9Qx2aMF90GE6hOxLRKysJvDlJwm9dZsPKluMZbITHOJJgl5FRswxdl2f
         sKTTX1T6bKZqdttuaWj7+JmE1ggg9iPNDxPiIm06x3T80Eyh3WZZtX1s5cyg7vtlHaoQ
         MhLUr+KL/jJJx0fMlmSw4m8G/Jfe9gpvSW2C6YMGZhHAKXlNSCxNMz81wVdLWhiJ0whD
         OxXA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690391413; x=1690996213;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=aqabqG54N5FkkdtDMamD9uQTj07nTP3p+qQtsWvth28=;
        b=BGXR21SRVhPjTIYR8v7M6CeQv6SbKIRk2HqYaUyw+Xs9nLIxKr7yjcSHYWZ+JJgkZv
         0GKPmNLwHIdKmIThJYGGixuH8NO8k0H4Z7f8+v8QEO5DJD5Efy1FOcbjBpE9etal5DTW
         uD8IlWUA2qCNgjacs5u3udl01a7b4/7ik/w9VDPR6QCgYwjOpEY68dxVaSlsRyoIxlgg
         4zXvcG1mI9jf2RB6XyxQv2KmWvllvBSHvXlRnzPZybQDhTbpbhjfvKBMoUIWm1j9YUgw
         4mDgJCmB/KrEn7UbDG9SGHqPe6j5s4qtLJ8np6h+WUWLQyf9hXuXVEr8NipTuAumfmu6
         irig==
X-Gm-Message-State: ABy/qLaRcGRUNTi8GzXozZ7eRsv/CrsnXYj/mm3NaJ9PXgsJC8bKVOgf
	2y4XGKH+XKMzs/1Wu5BtejdYC+dTGpA=
X-Google-Smtp-Source: APBJJlEB2Pk94f559fVULgNo4jMpQJDt9+JAmDKPAyvslNL0yQa6q8tQEQ5qAXdxfIBTjbe/w85Jiw==
X-Received: by 2002:a0c:b34e:0:b0:63c:f797:b0be with SMTP id a14-20020a0cb34e000000b0063cf797b0bemr1909035qvf.40.1690391413437;
        Wed, 26 Jul 2023 10:10:13 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Henry Wang <Henry.Wang@arm.com>,
	Community Manager <community.manager@xenproject.org>
Subject: [PATCH v7 00/15] Intel Hardware P-States (HWP) support
Date: Wed, 26 Jul 2023 13:09:30 -0400
Message-ID: <20230726170945.34961-1-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Hi,

This patch series adds Hardware-Controlled Performance States (HWP) for
Intel processors to Xen.

v2 was only partially reviewed, so v3 is mostly a reposting of v2.  In v2 &
v3, I think I addressed all comments for v1.  I kept patch 11 "xenpm:
Factor out a non-fatal cpuid_parse variant", with a v2 comment
explaining why I keep it.

v3 adds "xen/x86: Tweak PDC bits when using HWP".  Qubes testing revealed
an issue where enabling HWP can crash firwmare code (maybe SMM).  This
requires a Linux change to get the PDC bits from Xen and pass them to
ACPI.  Roger has a patch [0] to set the PDC bits.  Roger's 3 patch
series was tested with "xen/x86: Tweak PDC bits when using HWP" on
affected hardware and allowed proper operation.

v4:
There is a large amount or renaming from HWP/hwp to CPPC/cppc in the series.
The driver remains hwp_ prefixed since it is dealing with the hardware
interface.  The sysctl, xc and xenpm interfaces were renamed to cppc to
be the generic ACPI CPPC (Collaborative Processor Performance Control)
interface.

struct xen_get_cpufreq_para was re-organized in a binary compatible
fashion to nest scaling governor options.  This allows the cppc support
to use uint32_t's for its parameters.

HWP is now enabled with a top-level cpufreq=hwp option.  It will
fallback to cpufreq=xen if hwp is unavailable.  This seems like the most
user-friendly option.  Since the user was trying to specify *some*
cpufreq, we should give them the best that we can instead of disabling
the functionality.

"xenpm: Factor out a non-fatal cpuid_parse variant" was dropped.
set-cpufreq-cppc expects either a cpu number or none specified, which
implies all.

Some patches were re-arrange - "xen/x86: Tweak PDC bits when using HWP"
now comes immediately after "cpufreq: Add Hardware P-State (HWP) driver"

The implementation of "cpufreq: Allow restricting to internal governors
only " changed, so I removed Jan's Ack.

v5:
HWP is enabled with a toplevel cpufreq=hwp option.  There is no fallback
by default, but a cpufreq=hwp;xen syntax is now supported.  That tries
hwp first.  If HWP registration is unsuccessful, then xen registration
is performed as a fallback.

More changes from Jan's feedback.  They are typically minor and
documented in individual patches.

v6:
After some discussion, the cpufreq=hwp;xen syntax is retained, with the
global applicability of "verbose" mention in docs.  Minor tweaks
elsewhere as documented in individual patches.

v7:
Minor tweaks from review feedback - documented in respective patches.
Jan previously asked for a toolstack side review / ack of 
"[PATCH 04/15] xen/sysctl: Nest cpufreq scaling options"

Previous cover letter:

With HWP, the processor makes its own determinations for frequency
selection, though users can set some parameters and preferences.  There
is also Turbo Boost which dynamically pushes the max frequency if
possible.

The existing governors don't work with HWP since they select frequencies
and HWP doesn't expose those.  Therefore a dummy hwp-interal governor is
used that doesn't do anything.

xenpm get-cpufreq-para is extended to show HWP parameters, and
set-cpufreq-cppc is added to set them.

A lightly loaded OpenXT laptop showed ~1W power savings according to
powertop.  A mostly idle Fedora system (dom0 only) showed a more modest
power savings.

This is for a 10th gen 6-core 1600 MHz base 4900 MHZ max cpu.  In the
default balance mode, Turbo Boost doesn't exceed 4GHz.  Tweaking the
energy_perf preference with `xenpm set-cpufreq-para balance ene:64`,
I've seen the CPU hit 4.7GHz before throttling down and bouncing around
between 4.3 and 4.5 GHz.  Curiously the other cores read ~4GHz when
turbo boost takes affect.  This was done after pinning all dom0 cores,
and using taskset to pin to vCPU/pCPU 11 and running a bash tightloop.

HWP defaults to disabled and running with the existing HWP configuration
- it doesn't reconfigure by default.  It can be enabled with
cpufreq=hwp.

Hardware Duty Cycling (HDC) is another feature to autonomously powerdown
things.  It defaults to enabled when HWP is enabled, but HDC can be
disabled on the command line.  cpufreq=xen:hwp,no-hdc

I've only tested on 8th gen and 10th gen systems with activity window
and energy_perf support.  So the pathes for CPUs lacking those features
are untested.

Fast MSR support was removed in v2.  The model specific checking was not
done properly, and I don't have hardware to test with.  Since writes are
expected to be infrequent, I just removed the code.

This changes the systcl_pm_op hypercall, so that wants review.

Regards,
Jason

[0] https://lore.kernel.org/xen-devel/20221121102113.41893-3-roger.pau@citrix.com/

Jason Andryuk (15):
  cpufreq: Allow restricting to internal governors only
  cpufreq: Add perf_freq to cpuinfo
  cpufreq: Export intel_feature_detect
  xen/sysctl: Nest cpufreq scaling options
  pmstat&xenpm: Re-arrage for cpufreq union
  cpufreq: Add Hardware P-State (HWP) driver
  xen/x86: Tweak PDC bits when using HWP
  xenpm: Change get-cpufreq-para output for hwp
  cpufreq: Export HWP parameters to userspace as CPPC
  libxc: Include cppc_para in definitions
  xenpm: Print HWP/CPPC parameters
  xen: Add SET_CPUFREQ_HWP xen_sysctl_pm_op
  libxc: Add xc_set_cpufreq_cppc
  xenpm: Add set-cpufreq-cppc subcommand
  CHANGELOG: Add Intel HWP entry

 CHANGELOG.md                                 |   2 +-
 docs/misc/xen-command-line.pandoc            |  20 +-
 tools/include/xenctrl.h                      |  28 +-
 tools/libs/ctrl/xc_pm.c                      |  42 +-
 tools/misc/xenpm.c                           | 392 ++++++++++-
 xen/arch/x86/acpi/cpufreq/Makefile           |   1 +
 xen/arch/x86/acpi/cpufreq/cpufreq.c          |  31 +-
 xen/arch/x86/acpi/cpufreq/hwp.c              | 658 +++++++++++++++++++
 xen/arch/x86/acpi/lib.c                      |   5 +
 xen/arch/x86/cpu/mcheck/mce_intel.c          |   6 +
 xen/arch/x86/include/asm/cpufeature.h        |  12 +-
 xen/arch/x86/include/asm/msr-index.h         |  16 +-
 xen/drivers/acpi/pmstat.c                    | 100 +--
 xen/drivers/cpufreq/cpufreq.c                |  60 +-
 xen/drivers/cpufreq/cpufreq_misc_governors.c |   9 +
 xen/drivers/cpufreq/cpufreq_ondemand.c       |   3 +
 xen/drivers/cpufreq/utility.c                |   1 +
 xen/include/acpi/cpufreq/cpufreq.h           |  22 +
 xen/include/acpi/pdc_intel.h                 |   1 +
 xen/include/public/sysctl.h                  | 144 +++-
 20 files changed, 1432 insertions(+), 121 deletions(-)
 create mode 100644 xen/arch/x86/acpi/cpufreq/hwp.c

-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 17:10:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 17:10:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570632.892600 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi1m-00063M-T6; Wed, 26 Jul 2023 17:10:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570632.892600; Wed, 26 Jul 2023 17:10:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi1m-00063D-QO; Wed, 26 Jul 2023 17:10:22 +0000
Received: by outflank-mailman (input) for mailman id 570632;
 Wed, 26 Jul 2023 17:10:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Pn9P=DM=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qOi1l-00062Z-Jb
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 17:10:21 +0000
Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com
 [2607:f8b0:4864:20::235])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4c9e991f-2bd7-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 19:10:20 +0200 (CEST)
Received: by mail-oi1-x235.google.com with SMTP id
 5614622812f47-3a36b30aa7bso57651b6e.3
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 10:10:20 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 s17-20020a0ca611000000b0063d1aa446e2sm1248019qva.59.2023.07.26.10.10.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 10:10:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4c9e991f-2bd7-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690391419; x=1690996219;
        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=vNQhWJqSLtysm6iaINr+s0i3gnrhiDBqgnXkQD6RBcM=;
        b=krlaHJoIy3yBZiPoFJmrsH44untMDFcqlyD42tIv3J0pv1sayVDAZc3MYTKOUgkuGS
         QPdQK/0vaXkl655PX/IPtnDWBOgTDLQPo3kn2UstKajS8y+3wAyNEG+naNWGwMByi/lu
         wP14L80U5G0WULeBjTy3ECD/HyIkIYSshUjdMufVrdsSrtzB/nTD8VedVoUTd/Bi3Uv+
         h6dWVD0sFSQirDp6RWdJlTjaaLdUayfHbsqYJJfqrLz+kMlJjQkoaW/fRPyWpNH/XDoy
         Vsc4pnaNr8JQGVkAd0AStuPZzKUgy8ZBY3AG81WtREZOKMckbgYm+CNad6fuzpxTsp8W
         c2MA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690391419; x=1690996219;
        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=vNQhWJqSLtysm6iaINr+s0i3gnrhiDBqgnXkQD6RBcM=;
        b=g+iUq6yMhpmwpJ8+MxQ/ZoJpY75xdHrsH4lP8OBwYCXhu/F/zLMxEQ87aJyqk6H9iq
         cTrGE8anW8Pp+UWzGOffcIftWaL5lRe97P1UUVTMytIb0UNwLOfXb9OMTF62SlFZQ6O4
         9x0BdivppiP9pvLSUT/YVR+J83uqA+QxiWVb/EOcL5Irtss9cFQIbLFxIqiOYWyb8Fm6
         rTB3FIfO6OpJhibmGHT7AgA8R0HEUTdUegR1+l44LRDW1QKRY+/nsaiI+62YNWd4drYR
         XsAGBJv68yEuJHOzEXR96x8vLVNIlH/5lPJnVBiyFv2NCavgve6nNEa10ETL1KVKk4+N
         /deQ==
X-Gm-Message-State: ABy/qLYyrWhyhtoHIN/7PSkcC+Mtdjqoaos4AIy/jNCcdKnfPWLokDw6
	iWpoIBowjAa7ZC6ykB+nfIbE4AhH+4U=
X-Google-Smtp-Source: APBJJlFRa4l4v0YcVbLUCneCpGdNXFzCSJ8gSt8eoF0HC+kuPqGKrhColbbOUeFLOo40dYB+FiTYQA==
X-Received: by 2002:a05:6808:2119:b0:3a4:25ab:eecb with SMTP id r25-20020a056808211900b003a425abeecbmr101465oiw.51.1690391418755;
        Wed, 26 Jul 2023 10:10:18 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v7 01/15] cpufreq: Allow restricting to internal governors only
Date: Wed, 26 Jul 2023 13:09:31 -0400
Message-ID: <20230726170945.34961-2-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726170945.34961-1-jandryuk@gmail.com>
References: <20230726170945.34961-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

For hwp, the standard governors are not usable, and only the internal
one is applicable.  Add the cpufreq_governor_internal boolean to
indicate when an internal governor, like hwp, will be used.  This is set
during presmp_initcall, and governor registration can be skipped when
called during initcall.

This way unusable governors are not registered, and only compatible
governors are advertised to userspace.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v6:
Add Jan's Ack

v5:
Check cpufreq_governor_internal and skip registration as applicable
Remove internal flag

v4:
Rework to use an internal flag
Removed Jan's Ack since the approach is different.

v3:
Switch to initdata
Add Jan Acked-by
Commit message s/they/the/ typo
Don't register hwp-internal when running non-hwp - Marek

v2:
Switch to "-internal"
Add blank line in header
---
 xen/drivers/cpufreq/cpufreq.c                | 1 +
 xen/drivers/cpufreq/cpufreq_misc_governors.c | 9 +++++++++
 xen/drivers/cpufreq/cpufreq_ondemand.c       | 3 +++
 xen/include/acpi/cpufreq/cpufreq.h           | 2 ++
 4 files changed, 15 insertions(+)

diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 2321c7dd07..67a58d409b 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -56,6 +56,7 @@ struct cpufreq_dom {
 };
 static LIST_HEAD_READ_MOSTLY(cpufreq_dom_list_head);
 
+bool __initdata cpufreq_governor_internal;
 struct cpufreq_governor *__read_mostly cpufreq_opt_governor;
 LIST_HEAD_READ_MOSTLY(cpufreq_governor_list);
 
diff --git a/xen/drivers/cpufreq/cpufreq_misc_governors.c b/xen/drivers/cpufreq/cpufreq_misc_governors.c
index f5571f5486..0327fad23b 100644
--- a/xen/drivers/cpufreq/cpufreq_misc_governors.c
+++ b/xen/drivers/cpufreq/cpufreq_misc_governors.c
@@ -120,6 +120,9 @@ static int __init cf_check cpufreq_gov_userspace_init(void)
 {
     unsigned int cpu;
 
+    if ( cpufreq_governor_internal )
+        return 0;
+
     for_each_online_cpu(cpu)
         per_cpu(cpu_set_freq, cpu) = userspace_cmdline_freq;
     register_cpu_notifier(&cpufreq_userspace_cpu_nfb);
@@ -162,6 +165,9 @@ struct cpufreq_governor cpufreq_gov_performance = {
 
 static int __init cf_check cpufreq_gov_performance_init(void)
 {
+    if ( cpufreq_governor_internal )
+        return 0;
+
     return cpufreq_register_governor(&cpufreq_gov_performance);
 }
 __initcall(cpufreq_gov_performance_init);
@@ -201,6 +207,9 @@ struct cpufreq_governor cpufreq_gov_powersave = {
 
 static int __init cf_check cpufreq_gov_powersave_init(void)
 {
+    if ( cpufreq_governor_internal )
+        return 0;
+
     return cpufreq_register_governor(&cpufreq_gov_powersave);
 }
 __initcall(cpufreq_gov_powersave_init);
diff --git a/xen/drivers/cpufreq/cpufreq_ondemand.c b/xen/drivers/cpufreq/cpufreq_ondemand.c
index fbcd14d6c3..06cfc88d30 100644
--- a/xen/drivers/cpufreq/cpufreq_ondemand.c
+++ b/xen/drivers/cpufreq/cpufreq_ondemand.c
@@ -360,6 +360,9 @@ struct cpufreq_governor cpufreq_gov_dbs = {
 
 static int __init cf_check cpufreq_gov_dbs_init(void)
 {
+    if ( cpufreq_governor_internal )
+        return 0;
+
     return cpufreq_register_governor(&cpufreq_gov_dbs);
 }
 __initcall(cpufreq_gov_dbs_init);
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 35dcf21e8f..44fc4c58fc 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -116,6 +116,8 @@ extern struct cpufreq_governor cpufreq_gov_powersave;
 
 extern struct list_head cpufreq_governor_list;
 
+extern bool cpufreq_governor_internal;
+
 extern int cpufreq_register_governor(struct cpufreq_governor *governor);
 extern struct cpufreq_governor *__find_governor(const char *governor);
 #define CPUFREQ_DEFAULT_GOVERNOR &cpufreq_gov_dbs
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 17:10:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 17:10:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570633.892611 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi1q-0006LK-9v; Wed, 26 Jul 2023 17:10:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570633.892611; Wed, 26 Jul 2023 17:10:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi1q-0006L9-6n; Wed, 26 Jul 2023 17:10:26 +0000
Received: by outflank-mailman (input) for mailman id 570633;
 Wed, 26 Jul 2023 17:10:25 +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
 <SRS0=Pn9P=DM=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qOi1p-0005nP-2d
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 17:10:25 +0000
Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com
 [2607:f8b0:4864:20::72b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4e13bdb8-2bd7-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 19:10:22 +0200 (CEST)
Received: by mail-qk1-x72b.google.com with SMTP id
 af79cd13be357-76714caf466so3088285a.1
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 10:10:23 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 s17-20020a0ca611000000b0063d1aa446e2sm1248019qva.59.2023.07.26.10.10.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 10:10:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4e13bdb8-2bd7-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690391422; x=1690996222;
        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=tj29XCVclI+6QGR1ahwKo+P0a4dIzt4OqPyhJ7hCJ/k=;
        b=eiNoAZOOGxuceqVWp2ammLbsp+637AYhLdnzo/0ZgxzBvrtaq/7uczbqwToMHwCL9E
         oP32llNkDgxa8zP4LsbwJoqD16+zUHi78FHC9YjOSXyKZ5uxvGUOLg1nHOjC6wPD+zWi
         sYu5S4u6biDs31r7OwSU5St5l8xkNlmAUI/qPBnmWqh3lZzikIuv+yx1KV1zGv1tO3/9
         fnrI4zs7ewI7Inv00OkJt0SxMICp3IxGFLEeRJZ74Z7gO3NQqLTmtkIh7mVao1N7DDUA
         RhoBzKygdg0ei/g21svSV5bhFi7J1W4MmMdIx+BlIOmk7ssiMESmezgf437BqkCeQFTV
         0R+A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690391422; x=1690996222;
        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=tj29XCVclI+6QGR1ahwKo+P0a4dIzt4OqPyhJ7hCJ/k=;
        b=SPj/4Bd8rxqm+LULiosc7LsGRMJp6qIuStOoD/mOf0G73Zt/K3nhpVRWTVstH12GGn
         lq1YT4GVAIWahqv8NoHzySXRA5k5jsiCJOc8uLaX9aGZzsVSPTAjq0f4Ab5qk0eSts1c
         9umej9Si+kYS5A8p1NgPVKQ7WLx7Ij3gjxx/3NkaObja1NhRvZNMOiRlufvPrzREBBPQ
         TRhw7IW6xg90vqC5D05aCdJKtWI42FurRyqf6lmYqMPxnQspAxVNq+BZJyW2uW1MRFeY
         cB9ZfZg11spYUSkCg/I59VAJVxK/iX2th3aGhKff7SRRKhgP4tZzGkEp4gSuNJasLAd3
         xCdQ==
X-Gm-Message-State: ABy/qLZTA7CmW33FaPhdklilMLFSEGEe0SOA0qcKvt+mIh9/JJuxhtfh
	Dst5MJqje9YWl5v4FV3urEmT7syTZi8=
X-Google-Smtp-Source: APBJJlH48lxLuLRRThOdDWjI4a2VBOKN76LvDeNPxc5mjqX3/N56ultLiZRko5Yq4i6oiox/KX6AjQ==
X-Received: by 2002:a05:6214:5294:b0:637:85e3:2a2d with SMTP id kj20-20020a056214529400b0063785e32a2dmr2779361qvb.58.1690391421785;
        Wed, 26 Jul 2023 10:10:21 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v7 02/15] cpufreq: Add perf_freq to cpuinfo
Date: Wed, 26 Jul 2023 13:09:32 -0400
Message-ID: <20230726170945.34961-3-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726170945.34961-1-jandryuk@gmail.com>
References: <20230726170945.34961-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

acpi-cpufreq scales the aperf/mperf measurements by max_freq, but HWP
needs to scale by base frequency.  Settings max_freq to base_freq
"works" but the code is not obvious, and returning values to userspace
is tricky.  Add an additonal perf_freq member which is used for scaling
aperf/mperf measurements.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v3:
Add Jan's Ack

I don't like this, but it seems the best way to re-use the common
aperf/mperf code.  The other option would be to add wrappers that then
do the acpi vs. hwp scaling.
---
 xen/arch/x86/acpi/cpufreq/cpufreq.c | 2 +-
 xen/drivers/cpufreq/utility.c       | 1 +
 xen/include/acpi/cpufreq/cpufreq.h  | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index 2e0067fbe5..6c70d04395 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -316,7 +316,7 @@ unsigned int get_measured_perf(unsigned int cpu, unsigned int flag)
     else
         perf_percent = 0;
 
-    return policy->cpuinfo.max_freq * perf_percent / 100;
+    return policy->cpuinfo.perf_freq * perf_percent / 100;
 }
 
 static unsigned int cf_check get_cur_freq_on_cpu(unsigned int cpu)
diff --git a/xen/drivers/cpufreq/utility.c b/xen/drivers/cpufreq/utility.c
index 9eb7ecedcd..6831f62851 100644
--- a/xen/drivers/cpufreq/utility.c
+++ b/xen/drivers/cpufreq/utility.c
@@ -236,6 +236,7 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
 
     policy->min = policy->cpuinfo.min_freq = min_freq;
     policy->max = policy->cpuinfo.max_freq = max_freq;
+    policy->cpuinfo.perf_freq = max_freq;
     policy->cpuinfo.second_max_freq = second_max_freq;
 
     if (policy->min == ~0)
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 44fc4c58fc..1f1898d811 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -37,6 +37,9 @@ extern struct acpi_cpufreq_data *cpufreq_drv_data[NR_CPUS];
 struct cpufreq_cpuinfo {
     unsigned int        max_freq;
     unsigned int        second_max_freq;    /* P1 if Turbo Mode is on */
+    unsigned int        perf_freq; /* Scaling freq for aperf/mpref.
+                                      acpi-cpufreq uses max_freq, but HWP uses
+                                      base_freq.*/
     unsigned int        min_freq;
     unsigned int        transition_latency; /* in 10^(-9) s = nanoseconds */
 };
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 17:10:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 17:10:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570634.892621 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi1t-0006e9-Jx; Wed, 26 Jul 2023 17:10:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570634.892621; Wed, 26 Jul 2023 17:10:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi1t-0006du-Gn; Wed, 26 Jul 2023 17:10:29 +0000
Received: by outflank-mailman (input) for mailman id 570634;
 Wed, 26 Jul 2023 17:10:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Pn9P=DM=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qOi1r-00062Z-Uu
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 17:10:27 +0000
Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com
 [2607:f8b0:4864:20::735])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 50c90e80-2bd7-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 19:10:27 +0200 (CEST)
Received: by mail-qk1-x735.google.com with SMTP id
 af79cd13be357-76ae5b44426so2498385a.2
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 10:10:27 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 s17-20020a0ca611000000b0063d1aa446e2sm1248019qva.59.2023.07.26.10.10.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 10:10:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 50c90e80-2bd7-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690391425; x=1690996225;
        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=6N7tHO/NpGPoNencisuqLlnFkoHrBAPddvPlzfIc1r8=;
        b=CZom+YTmDnHiRp8FX7mQxKkFsjyAiG0xPZHEu7bkMTB673t77gvfq5VsZwXCsew/9w
         vidT6gQwl7G0G3a1iRR09VS5rr547Ztov18JL0StBbHpric4NvntKEpbV9k/Zr2BX7NX
         pzVN+3wQ1MrnlRgLsrjTidioCPwdL/ahTXW/lETGU8O1lUyQkl/Vp5xXpX5zMta3+qjP
         s9bRRlk3gtKw2HsHO7mJfCvH4JaENOMSqDYxoatmHWt38LtQ+CDYI/RTMiNdXoVbJUIh
         NSP3KYAIZyIJYyxSeX80IzJAlbqJgOGL0UXmE9wP/dxx4obr3KYrmV+RDgKiIUTgNn4D
         GTBw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690391425; x=1690996225;
        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=6N7tHO/NpGPoNencisuqLlnFkoHrBAPddvPlzfIc1r8=;
        b=k1VpMK4JIIjbDOSHMEZsL61ubNws6mKJ1EKNEN5xj5zGS/U1AUiCFr6PfTsGi+ON/1
         tBwEQsovlKgmKibRRT/VBA7sf3gE1TU2HzMCkHctlFKgm2NjxUqc+vzrzkUMvYnE2q9L
         A/mTYn0Yp0IxvqrtiFNnTvfD3h0ABlS5iPn846dg/2knLdlI63XNakG+wEgUBbTtapmz
         c0Yc2HzBJq7a8pEStuujlA4gGpLVF49P9S5TopdC3oP9jwo61gcP2I2Iiu49dU1OwlHI
         2SUOjoeY/eRw8Cd1tWFVOyj8WIP1F0//3A4b76YX19Xeshvlmhtkip2x9U4/nOKLQmSI
         fbyg==
X-Gm-Message-State: ABy/qLYhTt41I2Ur/n3aTcYbjYZsvR5v4sGWBoFjjuq1JxLLpuRLqy7s
	HtQb90/Oa/if41K6dcg7hZuCFBXHWsM=
X-Google-Smtp-Source: APBJJlHkSob2x7uUuh5jB8GE9zJTKb2Ot+bP8m9J4kEKe8C794coO7B/Sr8vfeQt0Ngm6wQ91Ljipg==
X-Received: by 2002:a0c:e5ce:0:b0:635:f4e3:8842 with SMTP id u14-20020a0ce5ce000000b00635f4e38842mr2416231qvm.48.1690391425476;
        Wed, 26 Jul 2023 10:10:25 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v7 03/15] cpufreq: Export intel_feature_detect
Date: Wed, 26 Jul 2023 13:09:33 -0400
Message-ID: <20230726170945.34961-4-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726170945.34961-1-jandryuk@gmail.com>
References: <20230726170945.34961-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Export feature_detect as intel_feature_detect so it can be re-used by
HWP.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v4:
Add Jan's Ack

v3:
Remove void * cast when calling intel_feature_detect

v2:
export intel_feature_detect with typed pointer
Move intel_feature_detect to acpi/cpufreq/cpufreq.h since the
declaration now contains struct cpufreq_policy *.
---
 xen/arch/x86/acpi/cpufreq/cpufreq.c | 8 ++++++--
 xen/include/acpi/cpufreq/cpufreq.h  | 2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index 6c70d04395..f1cc473b4f 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -339,9 +339,8 @@ static unsigned int cf_check get_cur_freq_on_cpu(unsigned int cpu)
     return extract_freq(get_cur_val(cpumask_of(cpu)), data);
 }
 
-static void cf_check feature_detect(void *info)
+void intel_feature_detect(struct cpufreq_policy *policy)
 {
-    struct cpufreq_policy *policy = info;
     unsigned int eax;
 
     eax = cpuid_eax(6);
@@ -353,6 +352,11 @@ static void cf_check feature_detect(void *info)
     }
 }
 
+static void cf_check feature_detect(void *info)
+{
+    intel_feature_detect(info);
+}
+
 static unsigned int check_freqs(const cpumask_t *mask, unsigned int freq,
                                 struct acpi_cpufreq_data *data)
 {
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 1f1898d811..482ea5b0de 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -243,4 +243,6 @@ int write_userspace_scaling_setspeed(unsigned int cpu, unsigned int freq);
 void cpufreq_dbs_timer_suspend(void);
 void cpufreq_dbs_timer_resume(void);
 
+void intel_feature_detect(struct cpufreq_policy *policy);
+
 #endif /* __XEN_CPUFREQ_PM_H__ */
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 17:10:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 17:10:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570635.892631 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi1y-00073u-Sj; Wed, 26 Jul 2023 17:10:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570635.892631; Wed, 26 Jul 2023 17:10:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi1y-00073n-PD; Wed, 26 Jul 2023 17:10:34 +0000
Received: by outflank-mailman (input) for mailman id 570635;
 Wed, 26 Jul 2023 17:10:33 +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
 <SRS0=Pn9P=DM=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qOi1x-0005nP-NP
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 17:10:33 +0000
Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com
 [2607:f8b0:4864:20::f2c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 531ec029-2bd7-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 19:10:31 +0200 (CEST)
Received: by mail-qv1-xf2c.google.com with SMTP id
 6a1803df08f44-63d0bf91362so601996d6.0
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 10:10:31 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 s17-20020a0ca611000000b0063d1aa446e2sm1248019qva.59.2023.07.26.10.10.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 10:10:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 531ec029-2bd7-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690391430; x=1690996230;
        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=htBvMGWbD3+u7hn1x0QKNR+1N7bjYI+3CVNCpwjhGVA=;
        b=T831vii0YgY07Z83L01Nj+iwJhMaaz7XI15DD/yV3qoOJds9xxSNaNsCqjlrL43oCq
         8tjSpqwX+QHZu1CG+QENU0kpzMfcgj4miZNkXbK6bP3W2yKpP16IdazuMPthLAc3jUFY
         YLE9EwjxaAU7PWVY6UFMenZiNDyfe9CkpUxji4dKUqXf0Efqq8IwCuI0qGYd76UH9bwf
         Vs+RxWaWld/Jakt8RxhMsUXC7jlGYsJUarxFRn3SnKQ2iwB45kIqOQHTHdrv3T7eBp6+
         HbTZh2PtEo/923DvhctJGV0PmlDKDhyAO+t9kvakWD/lp7FKOpEZv6aJy/OzjhDC6Qq8
         G2LQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690391430; x=1690996230;
        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=htBvMGWbD3+u7hn1x0QKNR+1N7bjYI+3CVNCpwjhGVA=;
        b=UoYoPGyG+OLEYXXK1HMxSYgOsQGoZihHrUr3KIvp6uvHG+4qcXGv65WIVx7rcJ16mr
         5mX+1Mc3HiHQDp+gmEJdN8reL0mbzdl8SqMOMj/L5SN2dNpXUSuZIVZdIMkMDvXtm7ur
         Th02vLiHJ4PtVrO0z+cG9Xe3CReIC2+DnnNv3Spn1wefoYKG3DvfM0vHJEIoeRfIscP2
         pfNWc90dxihXHGdxK5ZaRtFje8EaUQWkaJmnBA5/9KNa4XQoPgIV6YMzgqw5LqRCnlMt
         XWYhm42wKygPt1C9ibvSRf43SJIVFQbn+tYr3nxMGQhpJcyyIkxPCCNYWNhf5XLtMT6n
         wtXA==
X-Gm-Message-State: ABy/qLZSckS7pPZ84YYKeXkRNr2UzU2d79Z3Y4i5hCTKIG7PWFzvNM3w
	dO1NOlK79L4S/7S5JYgiCXwESVijYro=
X-Google-Smtp-Source: APBJJlEREOjNO2Sz+3O5ek1BYsZDupOCxHqMM3ho46YsPKPtLSo8vNBvKHt32oHt2UDSo7uGa9eDHg==
X-Received: by 2002:a0c:d84c:0:b0:634:7c34:6c96 with SMTP id i12-20020a0cd84c000000b006347c346c96mr2056727qvj.7.1690391430198;
        Wed, 26 Jul 2023 10:10:30 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v7 04/15] xen/sysctl: Nest cpufreq scaling options
Date: Wed, 26 Jul 2023 13:09:34 -0400
Message-ID: <20230726170945.34961-5-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726170945.34961-1-jandryuk@gmail.com>
References: <20230726170945.34961-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add a union and struct so that most of the scaling variables of struct
xen_get_cpufreq_para are within in a binary-compatible layout.  This
allows cppc_para to live in the larger union and use uint32_ts - struct
xen_cppc_para will be 10 uint32_t's.

The new scaling struct is 3 * uint32_t + 16 bytes CPUFREQ_NAME_LEN + 4 *
uint32_t for xen_ondemand = 11 uint32_t.  That means the old size is
retained, int32_t turbo_enabled doesn't move and it's binary compatible.

The out-of-context memcpy() in xc_get_cpufreq_para() now handles the
copying of the fields removed there.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
NOTE: Jan would like a toolside review / ack because:
    Nevertheless I continue to be uncertain about all of this: Parts of
    the struct can apparently go out of sync with the sysctl struct, but
    other parts have to remain in sync without there being an
    appropriate build-time check (checking merely sizes clearly isn't
    enough). Therefore I'd really like to have a toolstack side review /
    ack here as well.

v6:
Add Jan's Reviewed-by

v5:
Expand commit message
Change comment to driver/governor
---
 tools/include/xenctrl.h     | 22 +++++++++++++---------
 tools/libs/ctrl/xc_pm.c     |  7 +------
 tools/misc/xenpm.c          | 24 ++++++++++++------------
 xen/drivers/acpi/pmstat.c   | 27 ++++++++++++++-------------
 xen/include/public/sysctl.h | 22 +++++++++++++---------
 5 files changed, 53 insertions(+), 49 deletions(-)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index dba33d5d0f..8aedb952a0 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1909,16 +1909,20 @@ struct xc_get_cpufreq_para {
     uint32_t cpuinfo_cur_freq;
     uint32_t cpuinfo_max_freq;
     uint32_t cpuinfo_min_freq;
-    uint32_t scaling_cur_freq;
-
-    char scaling_governor[CPUFREQ_NAME_LEN];
-    uint32_t scaling_max_freq;
-    uint32_t scaling_min_freq;
-
-    /* for specific governor */
     union {
-        xc_userspace_t userspace;
-        xc_ondemand_t ondemand;
+        struct {
+            uint32_t scaling_cur_freq;
+
+            char scaling_governor[CPUFREQ_NAME_LEN];
+            uint32_t scaling_max_freq;
+            uint32_t scaling_min_freq;
+
+            /* for specific governor */
+            union {
+                xc_userspace_t userspace;
+                xc_ondemand_t ondemand;
+            } u;
+        } s;
     } u;
 
     int32_t turbo_enabled;
diff --git a/tools/libs/ctrl/xc_pm.c b/tools/libs/ctrl/xc_pm.c
index c3a9864bf7..6e751e242f 100644
--- a/tools/libs/ctrl/xc_pm.c
+++ b/tools/libs/ctrl/xc_pm.c
@@ -265,17 +265,12 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
         user_para->cpuinfo_cur_freq = sys_para->cpuinfo_cur_freq;
         user_para->cpuinfo_max_freq = sys_para->cpuinfo_max_freq;
         user_para->cpuinfo_min_freq = sys_para->cpuinfo_min_freq;
-        user_para->scaling_cur_freq = sys_para->scaling_cur_freq;
-        user_para->scaling_max_freq = sys_para->scaling_max_freq;
-        user_para->scaling_min_freq = sys_para->scaling_min_freq;
         user_para->turbo_enabled    = sys_para->turbo_enabled;
 
         memcpy(user_para->scaling_driver,
                 sys_para->scaling_driver, CPUFREQ_NAME_LEN);
-        memcpy(user_para->scaling_governor,
-                sys_para->scaling_governor, CPUFREQ_NAME_LEN);
 
-        /* copy to user_para no matter what cpufreq governor */
+        /* copy to user_para no matter what cpufreq driver/governor */
         BUILD_BUG_ON(sizeof(((struct xc_get_cpufreq_para *)0)->u) !=
 		     sizeof(((struct xen_get_cpufreq_para *)0)->u));
 
diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 1bb6187e56..ee8ce5d5f2 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -730,39 +730,39 @@ static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
     printf("scaling_avail_gov    : %s\n",
            p_cpufreq->scaling_available_governors);
 
-    printf("current_governor     : %s\n", p_cpufreq->scaling_governor);
-    if ( !strncmp(p_cpufreq->scaling_governor,
+    printf("current_governor     : %s\n", p_cpufreq->u.s.scaling_governor);
+    if ( !strncmp(p_cpufreq->u.s.scaling_governor,
                   "userspace", CPUFREQ_NAME_LEN) )
     {
         printf("  userspace specific :\n");
         printf("    scaling_setspeed : %u\n",
-               p_cpufreq->u.userspace.scaling_setspeed);
+               p_cpufreq->u.s.u.userspace.scaling_setspeed);
     }
-    else if ( !strncmp(p_cpufreq->scaling_governor,
+    else if ( !strncmp(p_cpufreq->u.s.scaling_governor,
                        "ondemand", CPUFREQ_NAME_LEN) )
     {
         printf("  ondemand specific  :\n");
         printf("    sampling_rate    : max [%u] min [%u] cur [%u]\n",
-               p_cpufreq->u.ondemand.sampling_rate_max,
-               p_cpufreq->u.ondemand.sampling_rate_min,
-               p_cpufreq->u.ondemand.sampling_rate);
+               p_cpufreq->u.s.u.ondemand.sampling_rate_max,
+               p_cpufreq->u.s.u.ondemand.sampling_rate_min,
+               p_cpufreq->u.s.u.ondemand.sampling_rate);
         printf("    up_threshold     : %u\n",
-               p_cpufreq->u.ondemand.up_threshold);
+               p_cpufreq->u.s.u.ondemand.up_threshold);
     }
 
     printf("scaling_avail_freq   :");
     for ( i = 0; i < p_cpufreq->freq_num; i++ )
         if ( p_cpufreq->scaling_available_frequencies[i] ==
-             p_cpufreq->scaling_cur_freq )
+             p_cpufreq->u.s.scaling_cur_freq )
             printf(" *%d", p_cpufreq->scaling_available_frequencies[i]);
         else
             printf(" %d", p_cpufreq->scaling_available_frequencies[i]);
     printf("\n");
 
     printf("scaling frequency    : max [%u] min [%u] cur [%u]\n",
-           p_cpufreq->scaling_max_freq,
-           p_cpufreq->scaling_min_freq,
-           p_cpufreq->scaling_cur_freq);
+           p_cpufreq->u.s.scaling_max_freq,
+           p_cpufreq->u.s.scaling_min_freq,
+           p_cpufreq->u.s.scaling_cur_freq);
 
     printf("turbo mode           : %s\n",
            p_cpufreq->turbo_enabled ? "enabled" : "disabled or n/a");
diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index 1bae635101..f5a9ac3f1a 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -258,37 +258,38 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
         cpufreq_driver.get ? cpufreq_driver.get(op->cpuid) : policy->cur;
     op->u.get_para.cpuinfo_max_freq = policy->cpuinfo.max_freq;
     op->u.get_para.cpuinfo_min_freq = policy->cpuinfo.min_freq;
-    op->u.get_para.scaling_cur_freq = policy->cur;
-    op->u.get_para.scaling_max_freq = policy->max;
-    op->u.get_para.scaling_min_freq = policy->min;
+
+    op->u.get_para.u.s.scaling_cur_freq = policy->cur;
+    op->u.get_para.u.s.scaling_max_freq = policy->max;
+    op->u.get_para.u.s.scaling_min_freq = policy->min;
 
     if ( cpufreq_driver.name[0] )
-        strlcpy(op->u.get_para.scaling_driver, 
+        strlcpy(op->u.get_para.scaling_driver,
             cpufreq_driver.name, CPUFREQ_NAME_LEN);
     else
         strlcpy(op->u.get_para.scaling_driver, "Unknown", CPUFREQ_NAME_LEN);
 
     if ( policy->governor->name[0] )
-        strlcpy(op->u.get_para.scaling_governor, 
+        strlcpy(op->u.get_para.u.s.scaling_governor,
             policy->governor->name, CPUFREQ_NAME_LEN);
     else
-        strlcpy(op->u.get_para.scaling_governor, "Unknown", CPUFREQ_NAME_LEN);
+        strlcpy(op->u.get_para.u.s.scaling_governor, "Unknown", CPUFREQ_NAME_LEN);
 
     /* governor specific para */
-    if ( !strncasecmp(op->u.get_para.scaling_governor,
+    if ( !strncasecmp(op->u.get_para.u.s.scaling_governor,
                       "userspace", CPUFREQ_NAME_LEN) )
     {
-        op->u.get_para.u.userspace.scaling_setspeed = policy->cur;
+        op->u.get_para.u.s.u.userspace.scaling_setspeed = policy->cur;
     }
 
-    if ( !strncasecmp(op->u.get_para.scaling_governor,
+    if ( !strncasecmp(op->u.get_para.u.s.scaling_governor,
                       "ondemand", CPUFREQ_NAME_LEN) )
     {
         ret = get_cpufreq_ondemand_para(
-            &op->u.get_para.u.ondemand.sampling_rate_max,
-            &op->u.get_para.u.ondemand.sampling_rate_min,
-            &op->u.get_para.u.ondemand.sampling_rate,
-            &op->u.get_para.u.ondemand.up_threshold);
+            &op->u.get_para.u.s.u.ondemand.sampling_rate_max,
+            &op->u.get_para.u.s.u.ondemand.sampling_rate_min,
+            &op->u.get_para.u.s.u.ondemand.sampling_rate,
+            &op->u.get_para.u.s.u.ondemand.up_threshold);
     }
     op->u.get_para.turbo_enabled = cpufreq_get_turbo_status(op->cpuid);
 
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index fa7147de47..c11c0b1a6c 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -317,16 +317,20 @@ struct xen_get_cpufreq_para {
     uint32_t cpuinfo_cur_freq;
     uint32_t cpuinfo_max_freq;
     uint32_t cpuinfo_min_freq;
-    uint32_t scaling_cur_freq;
-
-    char scaling_governor[CPUFREQ_NAME_LEN];
-    uint32_t scaling_max_freq;
-    uint32_t scaling_min_freq;
-
-    /* for specific governor */
     union {
-        struct  xen_userspace userspace;
-        struct  xen_ondemand ondemand;
+        struct {
+            uint32_t scaling_cur_freq;
+
+            char scaling_governor[CPUFREQ_NAME_LEN];
+            uint32_t scaling_max_freq;
+            uint32_t scaling_min_freq;
+
+            /* for specific governor */
+            union {
+                struct  xen_userspace userspace;
+                struct  xen_ondemand ondemand;
+            } u;
+        } s;
     } u;
 
     int32_t turbo_enabled;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 17:10:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 17:10:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570636.892641 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi23-0007WR-57; Wed, 26 Jul 2023 17:10:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570636.892641; Wed, 26 Jul 2023 17:10:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi23-0007WE-1i; Wed, 26 Jul 2023 17:10:39 +0000
Received: by outflank-mailman (input) for mailman id 570636;
 Wed, 26 Jul 2023 17:10:37 +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
 <SRS0=Pn9P=DM=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qOi21-0005nP-B8
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 17:10:37 +0000
Received: from mail-ua1-x936.google.com (mail-ua1-x936.google.com
 [2607:f8b0:4864:20::936])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 555528b1-2bd7-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 19:10:35 +0200 (CEST)
Received: by mail-ua1-x936.google.com with SMTP id
 a1e0cc1a2514c-79a31d66002so35475241.3
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 10:10:35 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 s17-20020a0ca611000000b0063d1aa446e2sm1248019qva.59.2023.07.26.10.10.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 10:10:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 555528b1-2bd7-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690391434; x=1690996234;
        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=UU4SMiJdUktv8hEdzVKy8V3KsteeHcG1cOr0eV9yG8I=;
        b=XOqyjTz5zQOrBJP/LGz68gTg1LGP/fJzke5nj6V32BwrkjjGkdrqGEvc9Ns2WGnOjM
         5WpEssIBKHG4tf1ksN9qHZitYzCtT2q6+DNwdJAH8eZikryEWrhIWjdnT75cS3irOWHT
         ANiIKUyqXLADUWxlQ2onn0tD6G43MwHYreR2PKu6TkK/JSjAJwsd5x6itWMXpqbWLQfA
         rG50cxhnbSsjiRQyFrKeXxEPEPwmrLS9lwTta3TAE5djgoeBkF3To/pujKGJ/hgRirtU
         SHAfKMiiA5kRPgGqGn0oM0o3eIPnZ9RmaeA1Z1/1tqDHvnCq1GmMXqa1h0NUi+m64o1a
         CwFQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690391434; x=1690996234;
        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=UU4SMiJdUktv8hEdzVKy8V3KsteeHcG1cOr0eV9yG8I=;
        b=J7v8LuZU7PNUS6fNDI/NL55qabg5SQTteZ0oSjsuwzjPnZBVf9dQ6xrQw2VjxxRCCY
         r331O59emvPoyeOY6uC46Jmli3bO6fT/KDrxM8zGrZcsTU80lWNuLSPIRQace3o46uTK
         sHGQ8pIC+Ch5fqB6tVvgmlgQKqZFcr4SqiA85mzXx+v85c64n6Rj6JhaP5hKaBIRFRfh
         v2ELFySINBhIEW4d3ImDYo0ckIVh6Rwqeumwv3FABGQDEZ8gegCctneymb6TpaYPPH0j
         Hb3inN6U2iTodHEp7j/GHIEE2lLmoJQdxX7S3D3hvH+GxSfFM0Lek248Z3ZuGAjjLMNm
         b7JQ==
X-Gm-Message-State: ABy/qLblhdrz55DHh4Bpk1Flzgm9bcJEh9LJnVrxbXtiryGvnI03m3NP
	esOT5ZRS/5b7I0CnTHTuepXwgkIayco=
X-Google-Smtp-Source: APBJJlEH0+eyDIoFFsLzRezURkNtZT+DVR/bZxbTmYOfS6ExuDSeLBjXTnQrRh5vLKasYHnXJoa4Hg==
X-Received: by 2002:a1f:da05:0:b0:471:1785:e838 with SMTP id r5-20020a1fda05000000b004711785e838mr1872264vkg.2.1690391433942;
        Wed, 26 Jul 2023 10:10:33 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v7 05/15] pmstat&xenpm: Re-arrage for cpufreq union
Date: Wed, 26 Jul 2023 13:09:35 -0400
Message-ID: <20230726170945.34961-6-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726170945.34961-1-jandryuk@gmail.com>
References: <20230726170945.34961-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rearrange code now that xen_sysctl_pm_op's get_para fields has the
nested union and struct.  In particular, the scaling governor
information like scaling_available_governors is inside the union, so it
is not always available.  Move those fields (op->u.get_para.u.s.u.*)
together as well as the common fields (ones outside the union like
op->u.get_para.turbo_enabled).

With that, gov_num may be 0, so bounce buffer handling needs
to be modified.

scaling_governor and other fields inside op->u.get_para.u.s.u.* won't be
used for hwp, so this will simplify the change when hwp support is
introduced and re-indents these lines all together.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v6:
Add Jan's Ack

v5:
Remove some formatting changes
Expand commit message
---
 tools/libs/ctrl/xc_pm.c   | 12 ++++++++----
 tools/misc/xenpm.c        |  3 ++-
 xen/drivers/acpi/pmstat.c | 24 ++++++++++++------------
 3 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/tools/libs/ctrl/xc_pm.c b/tools/libs/ctrl/xc_pm.c
index 6e751e242f..cea3eab22e 100644
--- a/tools/libs/ctrl/xc_pm.c
+++ b/tools/libs/ctrl/xc_pm.c
@@ -221,7 +221,7 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
     {
         if ( (!user_para->affected_cpus)                    ||
              (!user_para->scaling_available_frequencies)    ||
-             (!user_para->scaling_available_governors) )
+             (user_para->gov_num && !user_para->scaling_available_governors) )
         {
             errno = EINVAL;
             return -1;
@@ -230,12 +230,15 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
             goto unlock_1;
         if ( xc_hypercall_bounce_pre(xch, scaling_available_frequencies) )
             goto unlock_2;
-        if ( xc_hypercall_bounce_pre(xch, scaling_available_governors) )
+        if ( user_para->gov_num &&
+             xc_hypercall_bounce_pre(xch, scaling_available_governors) )
             goto unlock_3;
 
         set_xen_guest_handle(sys_para->affected_cpus, affected_cpus);
         set_xen_guest_handle(sys_para->scaling_available_frequencies, scaling_available_frequencies);
-        set_xen_guest_handle(sys_para->scaling_available_governors, scaling_available_governors);
+        if ( user_para->gov_num )
+            set_xen_guest_handle(sys_para->scaling_available_governors,
+                                 scaling_available_governors);
     }
 
     sysctl.cmd = XEN_SYSCTL_pm_op;
@@ -278,7 +281,8 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
     }
 
 unlock_4:
-    xc_hypercall_bounce_post(xch, scaling_available_governors);
+    if ( user_para->gov_num )
+        xc_hypercall_bounce_post(xch, scaling_available_governors);
 unlock_3:
     xc_hypercall_bounce_post(xch, scaling_available_frequencies);
 unlock_2:
diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index ee8ce5d5f2..1c474c3b59 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -811,7 +811,8 @@ static int show_cpufreq_para_by_cpuid(xc_interface *xc_handle, int cpuid)
             ret = -ENOMEM;
             goto out;
         }
-        if (!(p_cpufreq->scaling_available_governors =
+        if (p_cpufreq->gov_num &&
+            !(p_cpufreq->scaling_available_governors =
               malloc(p_cpufreq->gov_num * CPUFREQ_NAME_LEN * sizeof(char))))
         {
             fprintf(stderr,
diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index f5a9ac3f1a..d67d99e62f 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -239,6 +239,18 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
     if ( ret )
         return ret;
 
+    op->u.get_para.cpuinfo_cur_freq =
+        cpufreq_driver.get ? cpufreq_driver.get(op->cpuid) : policy->cur;
+    op->u.get_para.cpuinfo_max_freq = policy->cpuinfo.max_freq;
+    op->u.get_para.cpuinfo_min_freq = policy->cpuinfo.min_freq;
+    op->u.get_para.turbo_enabled = cpufreq_get_turbo_status(op->cpuid);
+
+    if ( cpufreq_driver.name[0] )
+        strlcpy(op->u.get_para.scaling_driver,
+            cpufreq_driver.name, CPUFREQ_NAME_LEN);
+    else
+        strlcpy(op->u.get_para.scaling_driver, "Unknown", CPUFREQ_NAME_LEN);
+
     if ( !(scaling_available_governors =
            xzalloc_array(char, gov_num * CPUFREQ_NAME_LEN)) )
         return -ENOMEM;
@@ -254,21 +266,10 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
     if ( ret )
         return ret;
 
-    op->u.get_para.cpuinfo_cur_freq =
-        cpufreq_driver.get ? cpufreq_driver.get(op->cpuid) : policy->cur;
-    op->u.get_para.cpuinfo_max_freq = policy->cpuinfo.max_freq;
-    op->u.get_para.cpuinfo_min_freq = policy->cpuinfo.min_freq;
-
     op->u.get_para.u.s.scaling_cur_freq = policy->cur;
     op->u.get_para.u.s.scaling_max_freq = policy->max;
     op->u.get_para.u.s.scaling_min_freq = policy->min;
 
-    if ( cpufreq_driver.name[0] )
-        strlcpy(op->u.get_para.scaling_driver,
-            cpufreq_driver.name, CPUFREQ_NAME_LEN);
-    else
-        strlcpy(op->u.get_para.scaling_driver, "Unknown", CPUFREQ_NAME_LEN);
-
     if ( policy->governor->name[0] )
         strlcpy(op->u.get_para.u.s.scaling_governor,
             policy->governor->name, CPUFREQ_NAME_LEN);
@@ -291,7 +292,6 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
             &op->u.get_para.u.s.u.ondemand.sampling_rate,
             &op->u.get_para.u.s.u.ondemand.up_threshold);
     }
-    op->u.get_para.turbo_enabled = cpufreq_get_turbo_status(op->cpuid);
 
     return ret;
 }
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 17:10:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 17:10:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570639.892651 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi28-000885-Ii; Wed, 26 Jul 2023 17:10:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570639.892651; Wed, 26 Jul 2023 17:10:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi28-00087u-EU; Wed, 26 Jul 2023 17:10:44 +0000
Received: by outflank-mailman (input) for mailman id 570639;
 Wed, 26 Jul 2023 17:10:43 +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
 <SRS0=Pn9P=DM=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qOi27-0005nP-6r
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 17:10:43 +0000
Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com
 [2607:f8b0:4864:20::f2e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5820708e-2bd7-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 19:10:39 +0200 (CEST)
Received: by mail-qv1-xf2e.google.com with SMTP id
 6a1803df08f44-63cf28db24cso549936d6.2
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 10:10:40 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 s17-20020a0ca611000000b0063d1aa446e2sm1248019qva.59.2023.07.26.10.10.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 10:10:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5820708e-2bd7-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690391438; x=1690996238;
        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=931lREy3WYHGGnNULLLqvu6+U4HwFHYQvep3+EFccAk=;
        b=GxfnGO60pXz951mCVf40puLkMdEuAIHbPaempxlLDrcxcMGFUca+fGOA7niRqMB4Za
         I/AikYX+OHKGH+lZR4Wp5T+QJ6sW/tp6dl/QLQHnyb/TtXygbx2lKQ09TQFr7rV1Lj7w
         ncNYD8HvaIL1pD0i+OdNLFug4jh+7EYQQ6u+Y9USpgXev0LdwplQyJx+Byw8SsvYQZfJ
         rtMb316lbwj8HNFJiPB7bK4Ne0AruvEfSr4Y+vmCcJQpXSjfqCCpnACdwjcexfsZ1nnw
         5J5F5GaPB0xhRKcGS6Vudlo1fm8daPPIFh3+66ja2oZ0Gk4j63D3rWSf2HSEHDQ7Obn0
         Dwvg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690391438; x=1690996238;
        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=931lREy3WYHGGnNULLLqvu6+U4HwFHYQvep3+EFccAk=;
        b=WYTF/QaTmTHxLxDyV/2RI1SJOu9R6wiTYH5pXhsp14IicnUHASql8tzQPy9+amxonP
         VWayLjdxo7LEtkqYZPMoDMS5t68HXzKnZ14+kH7M8d2ECtrYf1hVzu6wtsoHMQDUUPlz
         i2LSFRbZLV3nHj20Ab4wpsfJoD7RT9NL9QJcxx/d5IgprATFU0GREWktZ+6RM1q3IXI9
         pCSSWDsj1sOFbju6VdR9q2gegr0DnOVLXol98aCBlRsOPcIqy/kD2kRH1WsicF+/LHb6
         sCmLk77hCxtun+ig+ZS8LT8WwXAUAVcrLuWa7N8Ts2gp7eg3ljBD/EycdXHEAzZMsyEY
         LLzQ==
X-Gm-Message-State: ABy/qLZBBnUbRIVI5WIawN06/IvuQDt694NZL+8I4Qk+RCAtmPlpkY2m
	Bnqxwt5UDG7xn1WZFreU15XSARFyVvU=
X-Google-Smtp-Source: APBJJlGcXA5gbr9U0src3LThnWV+X3z5WKxOO50NFNK+Jd8DiDaHMLFmuBTNN9/hbwTDGP4dca058A==
X-Received: by 2002:a0c:e404:0:b0:63d:77d:be74 with SMTP id o4-20020a0ce404000000b0063d077dbe74mr2273875qvl.59.1690391438286;
        Wed, 26 Jul 2023 10:10:38 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v7 06/15] cpufreq: Add Hardware P-State (HWP) driver
Date: Wed, 26 Jul 2023 13:09:36 -0400
Message-ID: <20230726170945.34961-7-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726170945.34961-1-jandryuk@gmail.com>
References: <20230726170945.34961-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

>From the Intel SDM: "Hardware-Controlled Performance States (HWP), which
autonomously selects performance states while utilizing OS supplied
performance guidance hints."

Enable HWP to run in autonomous mode by poking the correct MSRs.  HWP is
disabled by default, and cpufreq=hwp enables it.

cpufreq= parsing is expanded to allow cpufreq=hwp;xen.  This allows
trying HWP and falling back to xen if not available.  Only hwp and xen
are supported for this fallback feature.  hdc is a sub-option under hwp
(i.e.  cpufreq=hwp,hdc=0) as is verbose.

There is no interface to configure - xen_sysctl_pm_op/xenpm will
be extended to configure in subsequent patches.  It will run with the
default values, which should be the default 0x80 (out of 0x0-0xff)
energy/performance preference.

Unscientific powertop measurement of an mostly idle, customized OpenXT
install:
A 10th gen 6-core laptop showed battery discharge drop from ~9.x to
~7.x watts.
A 8th gen 4-core laptop dropped from ~10 to ~9

Power usage depends on many factors, especially display brightness, but
this does show a power saving in balanced mode when CPU utilization is
low.

HWP isn't compatible with an external governor - it doesn't take
explicit frequency requests.  Therefore a minimal internal governor,
hwp, is also added as a placeholder.

While adding to the xen-command-line.pandoc entry, un-nest verbose from
minfreq.  They are independent.

With cpufreq=hwp,verbose, HWP prints processor capabilities that are not
used by the code, like HW_FEEDBACK.  This is done because otherwise
there isn't a convenient way to query the information.

Xen doesn't use the HWP interrupt, so it is disabled like in the Linux
pstate driver.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
We disable on cpuid_level < 0x16.  cpuid(0x16) is used to get the cpu
frequencies for calculating the APERF/MPERF.  Without it, things would
still work, but the average cpu frequency output would be wrong.

My 8th & 10th gen test systems both report:
(XEN) HWP: 1 notify: 1 act_window: 1 energy_perf: 1 pkg_level: 0 peci: 0
(XEN) HWP: Hardware Duty Cycling (HDC) supported
(XEN) HWP: HW_FEEDBACK not supported

We can't use parse_boolean() since it requires a single name=val string
and cpufreq_handle_common_option is provided two strings.  Use
parse_bool() and manual handle no-hwp.

FAST_IA32_HWP_REQUEST was removed in v2.  The check in v1 was wrong,
it's a model specific feature and the CPUID bit is only available
after enabling via the MSR.  Support was untested since I don't have
hardware with the feature.  Writes are expected to be infrequent, so
just leave it out.

---
v2:
Alphabetize headers
Re-work driver registration
name hwp_drv_data anonymous union "hw"
Drop hwp_verbose_cont
style cleanups
Condense hwp_governor switch
hwp_cpufreq_target remove .raw from hwp_req assignment
Use typed-pointer in a few functions
Pass type to xzalloc
Add HWP_ENERGY_PERF_BALANCE/IA32_ENERGY_BIAS_BALANCE defines
Add XEN_HWP_GOVERNOR define for "hwp-internal"
Capitalize CPUID and MSR defines
Change '_' to '-' for energy-perf & act-window
Read-modify-write MSRs updates
Use FAST_IA32_HWP_REQUEST_MSR_ENABLE define
constify pointer in hwp_set_misc_turbo
Add space after non-fallthrough break in governor switch
Add IA32_ENERGY_BIAS_MASK define
Check CPUID_PM_LEAK for energy bias when needed
Fail initialization with curr_req = -1
Fold hwp_read_capabilities into hwp_init_msrs
Add command line cpufreq=xen:hwp
Add command line cpufreq=xen:hdc
Use per_cpu for hwp_drv_data pointers
Move hwp_energy_perf_bias call into hwp_write_request
energy_perf 0 is valid, so hwp_energy_perf_bias cannot be skipped
Ensure we don't generate interrupts
Remove Fast Write of Uncore MSR
Initialize hwp_drv_data from curr_req
Use SPDX line instead of license text in hwp.c

v3:
Add cf_check to cpufreq_gov_hwp_init() - Marek
Print cpuid_level with %#x - Marek

v4:
Use BIT() for CPUID and MSR bits
Move __initdata after type
Add __ro_after_init to feature_*
Remove aperf/mperf comment
Move feature_hwp_energy_perf { to newline
Remove _IA32_ infix
Use unsigned int & bool for bitfields
Require energy perf pref (Remove ENERGY_PERF_BIAS support)
Initialize activity_window
Return errors on wrmsr failure
Change command line to: cpufreq=xen:hwp
Move hdc into the hwp-specific handle_options
Drop feature_hwp_energy_perf, feature_hwp_pkg_level_ctl & feature_hwp_peci
Print features before exiting when energy/performance preference isn't available
Disable HWP MSR on initialization error
Change hwp_ print macros to add prefixes
Disable HDC when hdc=0 - (opt_hdc no longer initdata)
Mark hwp governor internal and use "hwp" name
Add XEN_HWP_DRIVER
Use top-level cpufreq=hwp command line option
Document that cpufreq=hwp falls back to cpufreq=xen without hardware
Add SPDX suffix GPL-2.0-only

v5:
Use _AC() macro in MSR_IA32_MISC_ENABLE_TURBO_DISENGAGE definition
hwp_err arg re-ordering
Use XEN_HWP_DRIVER_NAME
Use cpufreq.h for all declarations
Clear feature_hdc on failure and print a message
Use unnamed bitfields instead of reservered
Remove asm/io.h include
static DEFINE_PER_CPU_READ_MOSTLY(struct hwp_drv_data
Remove some empty newlines
Align feature_hdc assignment
Remove feature_hwp
Remove unnecesary return at end of void hwp_init_msrs()
BUILD_BUG_ON member variable
Reformat a compound if
Clear pre_cpu hwp_drv_data before xfree()
Only print HWP capabilities for CPU 0
Specify processor models in turbo comment
Use arg[1] in setup_cpufreq_option()
Remove some log messages
Drop double newline
Parse verbose as a boolean instead of the custom parsing.
Support cpufreq=hwp;xen fallback
Call hwp_available() from hwp_register_driver()
Move cpufreq_govenor_internal setting to hwp_register_driver

v6:
docs: mention verbose applies to both.
Use cpufreq=hwp;xen,verbose example with verbose at then end.
Declare induction i inside for loop
Add CPUFREQ_none
Only call cpufreq fallback for -ENODEV
Brace on newline fixes
hdc_set_pkg_hdc_ctl()/hdc_set_pm_ctl1() return boolean
Continue without hdc
Consolidate hdc if statement
Use hwp_req variable for BUILD_BUG_ON
Newline between declarations and statement
__initdata for cpufreq_xen_opts/cpufreq_xen_cnt
Only print HWP_REQUEST when differing from BSP.
Remove MSR_PM_ENABLE printing
Move hdc_set_pkg_hdc_ctl(), hdc_set_pm_ctl1(), hwp_get_cpu_speeds(), and
  hwp_init_msrs() to before their sole caller, hwp_cpufreq_cpu_init()
Fix cpufreq= parsing without options (set ret=0)
Drop stray s NULL check
Return -EINVAL from hwp_cmdline_parse()
Latch first CPU HWP request and print differences
Use strpbrk to split on ',' or ':' for arg in xen/hwp do..while
Limit hwp parsing error to just current option with %.*s and (end ?: e) - s
docs: Expand and clarify the handling of `verbose` with cpufreq fallbacks.

v7:
s/##_VA_ARGS/## args/ in macros
Add __init to hwp_handle_option
Add comment for 0 cpuid freqs
Reword intel_feature_detect comment.
Fix indent for HDC failure
Make first_run static and use for first cpu latching
hwp_set_misc_turbo() return -EACCES on error
s/end/*end/ in setup_cpufreq_option()
---
 docs/misc/xen-command-line.pandoc     |  20 +-
 xen/arch/x86/acpi/cpufreq/Makefile    |   1 +
 xen/arch/x86/acpi/cpufreq/cpufreq.c   |  21 +-
 xen/arch/x86/acpi/cpufreq/hwp.c       | 524 ++++++++++++++++++++++++++
 xen/arch/x86/include/asm/cpufeature.h |  12 +-
 xen/arch/x86/include/asm/msr-index.h  |  15 +-
 xen/drivers/cpufreq/cpufreq.c         |  59 ++-
 xen/include/acpi/cpufreq/cpufreq.h    |  10 +
 xen/include/public/sysctl.h           |   2 +
 9 files changed, 649 insertions(+), 15 deletions(-)
 create mode 100644 xen/arch/x86/acpi/cpufreq/hwp.c

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 4060ebdc5d..f77542de47 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -499,7 +499,7 @@ If set, force use of the performance counters for oprofile, rather than detectin
 available support.
 
 ### cpufreq
-> `= none | {{ <boolean> | xen } [:[powersave|performance|ondemand|userspace][,<maxfreq>][,[<minfreq>][,[verbose]]]]} | dom0-kernel`
+> `= none | {{ <boolean> | xen } { [:[powersave|performance|ondemand|userspace][,[<maxfreq>]][,[<minfreq>]]] } [,verbose]} | dom0-kernel | hwp[:[<hdc>][,verbose]]`
 
 > Default: `xen`
 
@@ -510,6 +510,24 @@ choice of `dom0-kernel` is deprecated and not supported by all Dom0 kernels.
 * `<maxfreq>` and `<minfreq>` are integers which represent max and min processor frequencies
   respectively.
 * `verbose` option can be included as a string or also as `verbose=<integer>`
+  for `xen`.  It is a boolean for `hwp`.
+* `hwp` selects Hardware-Controlled Performance States (HWP) on supported Intel
+  hardware.  HWP is a Skylake+ feature which provides better CPU power
+  management.  The default is disabled.  If `hwp` is selected, but hardware
+  support is not available, Xen will fallback to cpufreq=xen.
+* `<hdc>` is a boolean to enable Hardware Duty Cycling (HDC).  HDC enables the
+  processor to autonomously force physical package components into idle state.
+  The default is enabled, but the option only applies when `hwp` is enabled.
+
+There is also support for `;`-separated fallback options:
+`cpufreq=hwp;xen,verbose`.  This first tries `hwp` and falls back to `xen` if
+unavailable.  Note: The `verbose` suboption is handled globally.  Setting it
+for either the primary or fallback option applies to both irrespective of where
+it is specified.
+
+Note: grub2 requires to escape or quote ';', so `"cpufreq=hwp;xen"` should be
+specified within double quotes inside grub.cfg.  Refer to the grub2
+documentation for more information.
 
 ### cpuid (x86)
 > `= List of comma separated booleans`
diff --git a/xen/arch/x86/acpi/cpufreq/Makefile b/xen/arch/x86/acpi/cpufreq/Makefile
index f75da9b9ca..db83aa6b14 100644
--- a/xen/arch/x86/acpi/cpufreq/Makefile
+++ b/xen/arch/x86/acpi/cpufreq/Makefile
@@ -1,2 +1,3 @@
 obj-y += cpufreq.o
+obj-y += hwp.o
 obj-y += powernow.o
diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index f1cc473b4f..61b62c370a 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -642,7 +642,26 @@ static int __init cf_check cpufreq_driver_init(void)
         switch ( boot_cpu_data.x86_vendor )
         {
         case X86_VENDOR_INTEL:
-            ret = cpufreq_register_driver(&acpi_cpufreq_driver);
+            ret = -ENOENT;
+
+            for ( unsigned int i = 0; i < cpufreq_xen_cnt; i++ )
+            {
+                switch ( cpufreq_xen_opts[i] )
+                {
+                case CPUFREQ_xen:
+                    ret = cpufreq_register_driver(&acpi_cpufreq_driver);
+                    break;
+                case CPUFREQ_hwp:
+                    ret = hwp_register_driver();
+                    break;
+                case CPUFREQ_none:
+                    ret = 0;
+                    break;
+                }
+
+                if ( ret != -ENODEV )
+                    break;
+            }
             break;
 
         case X86_VENDOR_AMD:
diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
new file mode 100644
index 0000000000..e9a6d23e38
--- /dev/null
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -0,0 +1,524 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * hwp.c cpufreq driver to run Intel Hardware P-States (HWP)
+ *
+ * Copyright (C) 2021 Jason Andryuk <jandryuk@gmail.com>
+ */
+
+#include <xen/cpumask.h>
+#include <xen/init.h>
+#include <xen/param.h>
+#include <xen/xmalloc.h>
+#include <asm/msr.h>
+#include <acpi/cpufreq/cpufreq.h>
+
+static bool __ro_after_init feature_hwp_notification;
+static bool __ro_after_init feature_hwp_activity_window;
+
+static bool __ro_after_init feature_hdc;
+
+static bool __ro_after_init opt_cpufreq_hdc = true;
+
+union hwp_request
+{
+    struct
+    {
+        unsigned int min_perf:8;
+        unsigned int max_perf:8;
+        unsigned int desired:8;
+        unsigned int energy_perf:8;
+        unsigned int activity_window:10;
+        bool package_control:1;
+        unsigned int :16;
+        bool activity_window_valid:1;
+        bool energy_perf_valid:1;
+        bool desired_valid:1;
+        bool max_perf_valid:1;
+        bool min_perf_valid:1;
+    };
+    uint64_t raw;
+};
+
+struct hwp_drv_data
+{
+    union
+    {
+        uint64_t hwp_caps;
+        struct
+        {
+            unsigned int highest:8;
+            unsigned int guaranteed:8;
+            unsigned int most_efficient:8;
+            unsigned int lowest:8;
+            unsigned int :32;
+        } hw;
+    };
+    union hwp_request curr_req;
+    int ret;
+    uint16_t activity_window;
+    uint8_t minimum;
+    uint8_t maximum;
+    uint8_t desired;
+    uint8_t energy_perf;
+};
+static DEFINE_PER_CPU_READ_MOSTLY(struct hwp_drv_data *, hwp_drv_data);
+
+#define hwp_err(cpu, fmt, args...) \
+    printk(XENLOG_ERR "HWP: CPU%u error: " fmt, cpu, ## args)
+#define hwp_info(fmt, args...)    printk(XENLOG_INFO "HWP: " fmt, ## args)
+#define hwp_verbose(fmt, args...)                         \
+({                                                        \
+    if ( cpufreq_verbose )                                \
+        printk(XENLOG_DEBUG "HWP: " fmt, ## args);        \
+})
+
+static int cf_check hwp_governor(struct cpufreq_policy *policy,
+                                 unsigned int event)
+{
+    int ret;
+
+    if ( policy == NULL )
+        return -EINVAL;
+
+    switch ( event )
+    {
+    case CPUFREQ_GOV_START:
+    case CPUFREQ_GOV_LIMITS:
+        ret = 0;
+        break;
+
+    case CPUFREQ_GOV_STOP:
+    default:
+        ret = -EINVAL;
+        break;
+    }
+
+    return ret;
+}
+
+static bool __init hwp_handle_option(const char *s, const char *end)
+{
+    int ret;
+
+    ret = parse_boolean("verbose", s, end);
+    if ( ret >= 0 )
+    {
+        cpufreq_verbose = ret;
+        return true;
+    }
+
+    ret = parse_boolean("hdc", s, end);
+    if ( ret >= 0 )
+    {
+        opt_cpufreq_hdc = ret;
+        return true;
+    }
+
+    return false;
+}
+
+int __init hwp_cmdline_parse(const char *s, const char *e)
+{
+    do
+    {
+        const char *end = strpbrk(s, ",;");
+
+        if ( !hwp_handle_option(s, end) )
+        {
+            printk(XENLOG_WARNING "cpufreq/hwp: option '%.*s' not recognized\n",
+                   (int)((end ?: e) - s), s);
+
+            return -EINVAL;
+        }
+
+        s = end ? ++end : end;
+    } while ( s && s < e );
+
+    return 0;
+}
+
+static struct cpufreq_governor cpufreq_gov_hwp =
+{
+    .name          = "hwp",
+    .governor      = hwp_governor,
+};
+
+static int __init cf_check cpufreq_gov_hwp_init(void)
+{
+    if ( !cpufreq_governor_internal )
+        return 0;
+
+    return cpufreq_register_governor(&cpufreq_gov_hwp);
+}
+__initcall(cpufreq_gov_hwp_init);
+
+static bool __init hwp_available(void)
+{
+    unsigned int eax;
+
+    if ( boot_cpu_data.cpuid_level < CPUID_PM_LEAF )
+    {
+        hwp_verbose("cpuid_level (%#x) lacks HWP support\n",
+                    boot_cpu_data.cpuid_level);
+
+        return false;
+    }
+
+    if ( boot_cpu_data.cpuid_level < 0x16 )
+    {
+        hwp_info("HWP disabled: cpuid_level %#x < 0x16 lacks CPU freq info\n",
+                 boot_cpu_data.cpuid_level);
+
+        return false;
+    }
+
+    eax = cpuid_eax(CPUID_PM_LEAF);
+
+    hwp_verbose("%d notify: %d act-window: %d energy-perf: %d pkg-level: %d peci: %d\n",
+                !!(eax & CPUID6_EAX_HWP),
+                !!(eax & CPUID6_EAX_HWP_NOTIFICATION),
+                !!(eax & CPUID6_EAX_HWP_ACTIVITY_WINDOW),
+                !!(eax & CPUID6_EAX_HWP_ENERGY_PERFORMANCE_PREFERENCE),
+                !!(eax & CPUID6_EAX_HWP_PACKAGE_LEVEL_REQUEST),
+                !!(eax & CPUID6_EAX_HWP_PECI));
+
+    if ( !(eax & CPUID6_EAX_HWP) )
+        return false;
+
+    if ( !(eax & CPUID6_EAX_HWP_ENERGY_PERFORMANCE_PREFERENCE) )
+    {
+        hwp_verbose("disabled: No energy/performance preference available");
+
+        return false;
+    }
+
+    feature_hwp_notification    = eax & CPUID6_EAX_HWP_NOTIFICATION;
+    feature_hwp_activity_window = eax & CPUID6_EAX_HWP_ACTIVITY_WINDOW;
+    feature_hdc                 = eax & CPUID6_EAX_HDC;
+
+    hwp_verbose("Hardware Duty Cycling (HDC) %ssupported%s\n",
+                feature_hdc ? "" : "not ",
+                feature_hdc ? opt_cpufreq_hdc ? ", enabled" : ", disabled"
+                            : "");
+
+    hwp_verbose("HW_FEEDBACK %ssupported\n",
+                (eax & CPUID6_EAX_HW_FEEDBACK) ? "" : "not ");
+
+    hwp_info("Using HWP for cpufreq\n");
+
+    return true;
+}
+
+static int cf_check hwp_cpufreq_verify(struct cpufreq_policy *policy)
+{
+    struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
+
+    if ( !feature_hwp_activity_window && data->activity_window )
+    {
+        hwp_verbose("HWP activity window not supported\n");
+
+        return -EINVAL;
+    }
+
+    return 0;
+}
+
+static void cf_check hwp_write_request(void *info)
+{
+    const struct cpufreq_policy *policy = info;
+    struct hwp_drv_data *data = this_cpu(hwp_drv_data);
+    union hwp_request hwp_req = data->curr_req;
+
+    data->ret = 0;
+
+    BUILD_BUG_ON(sizeof(hwp_req) != sizeof(hwp_req.raw));
+    if ( wrmsr_safe(MSR_HWP_REQUEST, hwp_req.raw) )
+    {
+        hwp_verbose("CPU%u: error wrmsr_safe(MSR_HWP_REQUEST, %lx)\n",
+                    policy->cpu, hwp_req.raw);
+        rdmsr_safe(MSR_HWP_REQUEST, data->curr_req.raw);
+        data->ret = -EINVAL;
+    }
+}
+
+static int cf_check hwp_cpufreq_target(struct cpufreq_policy *policy,
+                                       unsigned int target_freq,
+                                       unsigned int relation)
+{
+    unsigned int cpu = policy->cpu;
+    struct hwp_drv_data *data = per_cpu(hwp_drv_data, cpu);
+    /* Zero everything to ensure reserved bits are zero... */
+    union hwp_request hwp_req = { .raw = 0 };
+
+    /* .. and update from there */
+    hwp_req.min_perf = data->minimum;
+    hwp_req.max_perf = data->maximum;
+    hwp_req.desired = data->desired;
+    hwp_req.energy_perf = data->energy_perf;
+    if ( feature_hwp_activity_window )
+        hwp_req.activity_window = data->activity_window;
+
+    if ( hwp_req.raw == data->curr_req.raw )
+        return 0;
+
+    data->curr_req = hwp_req;
+
+    on_selected_cpus(cpumask_of(cpu), hwp_write_request, policy, 1);
+
+    return data->ret;
+}
+
+static bool hdc_set_pkg_hdc_ctl(unsigned int cpu, bool val)
+{
+    uint64_t msr;
+
+    if ( rdmsr_safe(MSR_PKG_HDC_CTL, msr) )
+    {
+        hwp_err(cpu, "rdmsr_safe(MSR_PKG_HDC_CTL)\n");
+        return false;
+    }
+
+    if ( val )
+        msr |= PKG_HDC_CTL_HDC_PKG_ENABLE;
+    else
+        msr &= ~PKG_HDC_CTL_HDC_PKG_ENABLE;
+
+    if ( wrmsr_safe(MSR_PKG_HDC_CTL, msr) )
+    {
+        hwp_err(cpu, "wrmsr_safe(MSR_PKG_HDC_CTL): %016lx\n", msr);
+        return false;
+    }
+
+    return true;
+}
+
+static bool hdc_set_pm_ctl1(unsigned int cpu, bool val)
+{
+    uint64_t msr;
+
+    if ( rdmsr_safe(MSR_PM_CTL1, msr) )
+    {
+        hwp_err(cpu, "rdmsr_safe(MSR_PM_CTL1)\n");
+        return false;
+    }
+
+    if ( val )
+        msr |= PM_CTL1_HDC_ALLOW_BLOCK;
+    else
+        msr &= ~PM_CTL1_HDC_ALLOW_BLOCK;
+
+    if ( wrmsr_safe(MSR_PM_CTL1, msr) )
+    {
+        hwp_err(cpu, "wrmsr_safe(MSR_PM_CTL1): %016lx\n", msr);
+        return false;
+    }
+
+    return true;
+}
+
+static void hwp_get_cpu_speeds(struct cpufreq_policy *policy)
+{
+    uint32_t base_khz, max_khz, bus_khz, edx;
+
+    cpuid(0x16, &base_khz, &max_khz, &bus_khz, &edx);
+
+    /*
+     * Zero values are acceptable - they are not used for calculations
+     * and only returned to userspace.
+     */
+    policy->cpuinfo.perf_freq = base_khz * 1000;
+    policy->cpuinfo.min_freq = base_khz * 1000;
+    policy->cpuinfo.max_freq = max_khz * 1000;
+    policy->min = base_khz * 1000;
+    policy->max = max_khz * 1000;
+    policy->cur = 0;
+}
+
+static void cf_check hwp_init_msrs(void *info)
+{
+    struct cpufreq_policy *policy = info;
+    struct hwp_drv_data *data = this_cpu(hwp_drv_data);
+    uint64_t val;
+
+    /*
+     * Package level MSR, but we don't have a good idea of packages here, so
+     * just do it everytime.
+     */
+    if ( rdmsr_safe(MSR_PM_ENABLE, val) )
+    {
+        hwp_err(policy->cpu, "rdmsr_safe(MSR_PM_ENABLE)\n");
+        data->curr_req.raw = -1;
+        return;
+    }
+
+    /* Ensure we don't generate interrupts */
+    if ( feature_hwp_notification )
+        wrmsr_safe(MSR_HWP_INTERRUPT, 0);
+
+    if ( !(val & PM_ENABLE_HWP_ENABLE) )
+    {
+        val |= PM_ENABLE_HWP_ENABLE;
+        if ( wrmsr_safe(MSR_PM_ENABLE, val) )
+        {
+            hwp_err(policy->cpu, "wrmsr_safe(MSR_PM_ENABLE, %lx)\n", val);
+            data->curr_req.raw = -1;
+            return;
+        }
+    }
+
+    if ( rdmsr_safe(MSR_HWP_CAPABILITIES, data->hwp_caps) )
+    {
+        hwp_err(policy->cpu, "rdmsr_safe(MSR_HWP_CAPABILITIES)\n");
+        goto error;
+    }
+
+    if ( rdmsr_safe(MSR_HWP_REQUEST, data->curr_req.raw) )
+    {
+        hwp_err(policy->cpu, "rdmsr_safe(MSR_HWP_REQUEST)\n");
+        goto error;
+    }
+
+    /* Check for turbo support. */
+    intel_feature_detect(policy);
+
+    if ( feature_hdc &&
+         (!hdc_set_pkg_hdc_ctl(policy->cpu, opt_cpufreq_hdc) ||
+          !hdc_set_pm_ctl1(policy->cpu, opt_cpufreq_hdc)) )
+    {
+        hwp_err(policy->cpu, "Disabling HDC support\n");
+        feature_hdc = false;
+    }
+
+    hwp_get_cpu_speeds(policy);
+
+    return;
+
+ error:
+    data->curr_req.raw = -1;
+    val &= ~PM_ENABLE_HWP_ENABLE;
+    if ( wrmsr_safe(MSR_PM_ENABLE, val) )
+        hwp_err(policy->cpu, "wrmsr_safe(MSR_PM_ENABLE, %lx)\n", val);
+}
+
+static int cf_check hwp_cpufreq_cpu_init(struct cpufreq_policy *policy)
+{
+    static union hwp_request initial_req;
+    unsigned int cpu = policy->cpu;
+    struct hwp_drv_data *data;
+    static bool first_run = true;
+
+    data = xzalloc(struct hwp_drv_data);
+    if ( !data )
+        return -ENOMEM;
+
+    policy->governor = &cpufreq_gov_hwp;
+
+    per_cpu(hwp_drv_data, cpu) = data;
+
+    on_selected_cpus(cpumask_of(cpu), hwp_init_msrs, policy, 1);
+
+    if ( data->curr_req.raw == -1 )
+    {
+        hwp_err(cpu, "Could not initialize HWP properly\n");
+        per_cpu(hwp_drv_data, cpu) = NULL;
+        xfree(data);
+        return -ENODEV;
+    }
+
+    data->minimum = data->curr_req.min_perf;
+    data->maximum = data->curr_req.max_perf;
+    data->desired = data->curr_req.desired;
+    data->energy_perf = data->curr_req.energy_perf;
+    data->activity_window = data->curr_req.activity_window;
+
+    if ( first_run )
+    {
+        hwp_verbose("CPU%u: HWP_CAPABILITIES: %016lx\n", cpu, data->hwp_caps);
+        initial_req = data->curr_req;
+    }
+
+    if ( first_run || data->curr_req.raw != initial_req.raw )
+    {
+        hwp_verbose("CPU%u: rdmsr HWP_REQUEST %016lx\n", cpu,
+                    data->curr_req.raw);
+        first_run = false;
+    }
+
+    return 0;
+}
+
+static int cf_check hwp_cpufreq_cpu_exit(struct cpufreq_policy *policy)
+{
+    struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
+
+    per_cpu(hwp_drv_data, policy->cpu) = NULL;
+    xfree(data);
+
+    return 0;
+}
+
+/*
+ * The SDM reads like turbo should be disabled with MSR_IA32_PERF_CTL and
+ * PERF_CTL_TURBO_DISENGAGE, but that does not seem to actually work, at least
+ * with testing on i7-10810U and i7-8550U.  MSR_MISC_ENABLE and
+ * MISC_ENABLE_TURBO_DISENGAGE is what Linux uses and seems to work.
+ */
+static void cf_check hwp_set_misc_turbo(void *info)
+{
+    const struct cpufreq_policy *policy = info;
+    struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
+    uint64_t msr;
+
+    data->ret = 0;
+
+    if ( rdmsr_safe(MSR_IA32_MISC_ENABLE, msr) )
+    {
+        hwp_verbose("CPU%u: error rdmsr_safe(MSR_IA32_MISC_ENABLE)\n",
+                    policy->cpu);
+        data->ret = -EACCES;
+
+        return;
+    }
+
+    if ( policy->turbo == CPUFREQ_TURBO_ENABLED )
+        msr &= ~MSR_IA32_MISC_ENABLE_TURBO_DISENGAGE;
+    else
+        msr |= MSR_IA32_MISC_ENABLE_TURBO_DISENGAGE;
+
+    if ( wrmsr_safe(MSR_IA32_MISC_ENABLE, msr) )
+    {
+        hwp_verbose("CPU%u: error wrmsr_safe(MSR_IA32_MISC_ENABLE): %016lx\n",
+                    policy->cpu, msr);
+        data->ret = -EACCES;
+    }
+}
+
+static int cf_check hwp_cpufreq_update(int cpuid, struct cpufreq_policy *policy)
+{
+    on_selected_cpus(cpumask_of(cpuid), hwp_set_misc_turbo, policy, 1);
+
+    return per_cpu(hwp_drv_data, cpuid)->ret;
+}
+
+static const struct cpufreq_driver __initconstrel hwp_cpufreq_driver =
+{
+    .name   = XEN_HWP_DRIVER_NAME,
+    .verify = hwp_cpufreq_verify,
+    .target = hwp_cpufreq_target,
+    .init   = hwp_cpufreq_cpu_init,
+    .exit   = hwp_cpufreq_cpu_exit,
+    .update = hwp_cpufreq_update,
+};
+
+int __init hwp_register_driver(void)
+{
+    int ret;
+
+    if ( !hwp_available() )
+        return -ENODEV;
+
+    ret = cpufreq_register_driver(&hwp_cpufreq_driver);
+    cpufreq_governor_internal = (ret == 0);
+
+    return ret;
+}
diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h
index 64e1dad225..93466441f5 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -52,8 +52,16 @@ static inline bool boot_cpu_has(unsigned int feat)
     return cpu_has(&boot_cpu_data, feat);
 }
 
-#define CPUID_PM_LEAF                    6
-#define CPUID6_ECX_APERFMPERF_CAPABILITY 0x1
+#define CPUID_PM_LEAF                                6
+#define CPUID6_EAX_HWP                               BIT(7, U)
+#define CPUID6_EAX_HWP_NOTIFICATION                  BIT(8, U)
+#define CPUID6_EAX_HWP_ACTIVITY_WINDOW               BIT(9, U)
+#define CPUID6_EAX_HWP_ENERGY_PERFORMANCE_PREFERENCE BIT(10, U)
+#define CPUID6_EAX_HWP_PACKAGE_LEVEL_REQUEST         BIT(11, U)
+#define CPUID6_EAX_HDC                               BIT(13, U)
+#define CPUID6_EAX_HWP_PECI                          BIT(16, U)
+#define CPUID6_EAX_HW_FEEDBACK                       BIT(19, U)
+#define CPUID6_ECX_APERFMPERF_CAPABILITY             BIT(0, U)
 
 /* CPUID level 0x00000001.edx */
 #define cpu_has_fpu             1
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 2382fc8e11..56f93cb8e2 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -151,6 +151,13 @@
 
 #define MSR_PKRS                            0x000006e1
 
+#define MSR_PM_ENABLE                       0x00000770
+#define  PM_ENABLE_HWP_ENABLE               BIT(0, ULL)
+
+#define MSR_HWP_CAPABILITIES                0x00000771
+#define MSR_HWP_INTERRUPT                   0x00000773
+#define MSR_HWP_REQUEST                     0x00000774
+
 #define MSR_X2APIC_FIRST                    0x00000800
 #define MSR_X2APIC_LAST                     0x000008ff
 
@@ -165,6 +172,11 @@
 #define  PASID_PASID_MASK                   0x000fffff
 #define  PASID_VALID                        (_AC(1, ULL) << 31)
 
+#define MSR_PKG_HDC_CTL                     0x00000db0
+#define  PKG_HDC_CTL_HDC_PKG_ENABLE         BIT(0, ULL)
+#define MSR_PM_CTL1                         0x00000db1
+#define  PM_CTL1_HDC_ALLOW_BLOCK            BIT(0, ULL)
+
 #define MSR_UARCH_MISC_CTRL                 0x00001b01
 #define  UARCH_CTRL_DOITM                   (_AC(1, ULL) <<  0)
 
@@ -466,7 +478,8 @@
 #define MSR_IA32_MISC_ENABLE_MONITOR_ENABLE (1<<18)
 #define MSR_IA32_MISC_ENABLE_LIMIT_CPUID  (1<<22)
 #define MSR_IA32_MISC_ENABLE_XTPR_DISABLE (1<<23)
-#define MSR_IA32_MISC_ENABLE_XD_DISABLE   (_AC(1, ULL) << 34)
+#define MSR_IA32_MISC_ENABLE_XD_DISABLE      (_AC(1, ULL) << 34)
+#define MSR_IA32_MISC_ENABLE_TURBO_DISENGAGE (_AC(1, ULL) << 38)
 
 #define MSR_IA32_TSC_DEADLINE		0x000006E0
 #define MSR_IA32_ENERGY_PERF_BIAS	0x000001b0
diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 67a58d409b..81bda5df23 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -63,12 +63,19 @@ LIST_HEAD_READ_MOSTLY(cpufreq_governor_list);
 /* set xen as default cpufreq */
 enum cpufreq_controller cpufreq_controller = FREQCTL_xen;
 
-static int __init cpufreq_cmdline_parse(const char *s);
+enum cpufreq_xen_opt __initdata cpufreq_xen_opts[2] = { CPUFREQ_xen,
+                                                        CPUFREQ_none };
+unsigned int __initdata cpufreq_xen_cnt = 1;
+
+static int __init cpufreq_cmdline_parse(const char *s, const char *e);
 
 static int __init cf_check setup_cpufreq_option(const char *str)
 {
-    const char *arg = strpbrk(str, ",:");
+    const char *arg = strpbrk(str, ",:;");
     int choice;
+    int ret = -EINVAL;
+
+    cpufreq_xen_cnt = 0;
 
     if ( !arg )
         arg = strchr(str, '\0');
@@ -89,15 +96,45 @@ static int __init cf_check setup_cpufreq_option(const char *str)
         return 0;
     }
 
-    if ( choice > 0 || !cmdline_strcmp(str, "xen") )
+    do
     {
-        xen_processor_pmbits |= XEN_PROCESSOR_PM_PX;
-        cpufreq_controller = FREQCTL_xen;
-        if ( *arg && *(arg + 1) )
-            return cpufreq_cmdline_parse(arg + 1);
-    }
+        const char *end = strchr(str, ';');
+
+        if ( end == NULL )
+            end = strchr(str, '\0');
+
+        arg = strpbrk(str, ",:");
+        if ( !arg || arg > end )
+            arg = strchr(str, '\0');
+
+        if ( cpufreq_xen_cnt == ARRAY_SIZE(cpufreq_xen_opts) )
+            return -E2BIG;
+
+        if ( choice > 0 || !cmdline_strcmp(str, "xen") )
+        {
+            xen_processor_pmbits |= XEN_PROCESSOR_PM_PX;
+            cpufreq_controller = FREQCTL_xen;
+            cpufreq_xen_opts[cpufreq_xen_cnt++] = CPUFREQ_xen;
+            ret = 0;
+            if ( arg[0] && arg[1] )
+                ret = cpufreq_cmdline_parse(arg + 1, end);
+        }
+        else if ( choice < 0 && !cmdline_strcmp(str, "hwp") )
+        {
+            xen_processor_pmbits |= XEN_PROCESSOR_PM_PX;
+            cpufreq_controller = FREQCTL_xen;
+            cpufreq_xen_opts[cpufreq_xen_cnt++] = CPUFREQ_hwp;
+            ret = 0;
+            if ( arg[0] && arg[1] )
+                ret = hwp_cmdline_parse(arg + 1, end);
+        }
+        else
+            ret = -EINVAL;
+
+        str = *end ? ++end : end;
+    } while ( choice < 0 && ret == 0 && *str );
 
-    return (choice < 0) ? -EINVAL : 0;
+    return (choice < 0) ? ret : 0;
 }
 custom_param("cpufreq", setup_cpufreq_option);
 
@@ -576,7 +613,7 @@ static int __init cpufreq_handle_common_option(const char *name, const char *val
     return 0;
 }
 
-static int __init cpufreq_cmdline_parse(const char *s)
+static int __init cpufreq_cmdline_parse(const char *s, const char *e)
 {
     static struct cpufreq_governor *__initdata cpufreq_governors[] =
     {
@@ -592,6 +629,8 @@ static int __init cpufreq_cmdline_parse(const char *s)
     int rc = 0;
 
     strlcpy(buf, s, sizeof(buf));
+    if (e - s < sizeof(buf))
+        buf[e - s] = '\0';
     do {
         char *val, *end = strchr(str, ',');
         unsigned int i;
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 482ea5b0de..cfe975814e 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -24,6 +24,13 @@ DECLARE_PER_CPU(spinlock_t, cpufreq_statistic_lock);
 
 extern bool_t cpufreq_verbose;
 
+enum cpufreq_xen_opt {
+    CPUFREQ_none,
+    CPUFREQ_xen,
+    CPUFREQ_hwp,
+};
+extern enum cpufreq_xen_opt cpufreq_xen_opts[2];
+extern unsigned int cpufreq_xen_cnt;
 struct cpufreq_governor;
 
 struct acpi_cpufreq_data {
@@ -245,4 +252,7 @@ void cpufreq_dbs_timer_resume(void);
 
 void intel_feature_detect(struct cpufreq_policy *policy);
 
+int hwp_cmdline_parse(const char *s, const char *e);
+int hwp_register_driver(void);
+
 #endif /* __XEN_CPUFREQ_PM_H__ */
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index c11c0b1a6c..5a30b16fcf 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -296,6 +296,8 @@ struct xen_ondemand {
     uint32_t up_threshold;
 };
 
+#define XEN_HWP_DRIVER_NAME "hwp"
+
 /*
  * cpufreq para name of this structure named
  * same as sysfs file name of native linux
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 17:10:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 17:10:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570642.892661 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi2B-0008Vc-2q; Wed, 26 Jul 2023 17:10:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570642.892661; Wed, 26 Jul 2023 17:10:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi2A-0008VS-Uq; Wed, 26 Jul 2023 17:10:46 +0000
Received: by outflank-mailman (input) for mailman id 570642;
 Wed, 26 Jul 2023 17:10:45 +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
 <SRS0=Pn9P=DM=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qOi29-0005nP-B2
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 17:10:45 +0000
Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com
 [2607:f8b0:4864:20::f2e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5a23fe7f-2bd7-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 19:10:43 +0200 (CEST)
Received: by mail-qv1-xf2e.google.com with SMTP id
 6a1803df08f44-63d03d3cac6so436136d6.2
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 10:10:43 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 s17-20020a0ca611000000b0063d1aa446e2sm1248019qva.59.2023.07.26.10.10.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 10:10:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5a23fe7f-2bd7-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690391442; x=1690996242;
        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=BC4KCbQaicpEfX3GeSqBCseD+2+53viJE6p7BIzEEpg=;
        b=ndtmflJBJ3YpsDmboHGO5jxzRiGA0QQkW8Kn9KHIuE5zXhNppgNSLsNw6L2zeewH47
         L8JEoqYsnFRSSrvn4poHVvTDSH24PYG/rYF3E6nj53SUjPeQHQhSaP93ETMPIv2pHY6/
         M5wtPzcvt4B8gKdf7iHJdsuR8r8qanLdcF14r1PwVHqNPSIBkcDeOCa/s8SXXpQyFDrp
         6p+sTd5c2C2XJ/iKbSJBrzWyvvZm8uMKeUavnfRukNoIpTWR0uwOJ4g3Ba+sf6tW2G4n
         dESNKTi3FPvjHE3jLtHInGN97F1IjHHvtZ9bNBtd/xDPpaMfTLQ7NZVINqhhbn7q1bsL
         QdHQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690391442; x=1690996242;
        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=BC4KCbQaicpEfX3GeSqBCseD+2+53viJE6p7BIzEEpg=;
        b=dEqNGfaD5T9fGCje4NztSpEwe7Fi6kbLNPb92s0hIVrrf4EobhQFiyf+3BHDm+D8A3
         8BWyCoy6uhsy4luNj4gcafVY725+k9lD6RDa68ZBwoxH30lX3QXsh7X8MZx9JFe7Cvin
         gIHnJewu7U18i4MCbmuPzLPk0fdQ2Gb2qYogrE32qj8uR2sNTOshVwgqbpcQKzrNaMTq
         APQ6b0q0HsLHA2zXd4IvfhpCk97wtjVPDiIhKY/ehnWXK30E9yj7MBGTQgu1YSpEV6TG
         g5W4K7MJ1v/UkgOOM079FGgMPyLDnA3EIq3rp1Br0GHU909WZ2SlZ3nkUMv5GvYXXyQM
         qMEQ==
X-Gm-Message-State: ABy/qLZdKJhJ68XMb7uyoNyLf5bb4b172C+Qf9S2b6biP4dKz4xW7wHr
	9Zc87rYHXzIJBho1LJQYKsdZSYyM2rw=
X-Google-Smtp-Source: APBJJlETq+JdfQM6svwqAHt0eXz7N837lk5Ch/SoYIZabylFcWDTbaKfV8RLlJm3y3lVB5DJMJJmvw==
X-Received: by 2002:a0c:f84b:0:b0:635:f3c2:e88f with SMTP id g11-20020a0cf84b000000b00635f3c2e88fmr2101475qvo.33.1690391441963;
        Wed, 26 Jul 2023 10:10:41 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v7 07/15] xen/x86: Tweak PDC bits when using HWP
Date: Wed, 26 Jul 2023 13:09:37 -0400
Message-ID: <20230726170945.34961-8-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726170945.34961-1-jandryuk@gmail.com>
References: <20230726170945.34961-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Qubes testing of HWP support had a report of a laptop, Thinkpad X1
Carbon Gen 4 with a Skylake processor, locking up during boot when HWP
is enabled.  A user found a kernel bug that seems to be the same issue:
https://bugzilla.kernel.org/show_bug.cgi?id=110941.

That bug was fixed by Linux commit a21211672c9a ("ACPI / processor:
Request native thermal interrupt handling via _OSC").  The tl;dr is SMM
crashes when it receives thermal interrupts, so Linux calls the ACPI
_OSC method to take over interrupt handling.

The Linux fix looks at the CPU features to decide whether or not to call
_OSC with bit 12 set to take over native interrupt handling.  Xen needs
some way to communicate HWP to Dom0 for making an equivalent call.

Xen exposes modified PDC bits via the platform_op set_pminfo hypercall.
Expand that to set bit 12 when HWP is present and in use.

Any generated interrupt would be handled by Xen's thermal drive, which
clears the status.

Bit 12 isn't named in the linux header and is open coded in Linux's
usage.  Name it ACPI_PDC_CPPC_NATIVE_INTR.

This will need a corresponding linux patch to pick up and apply the PDC
bits.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
v5:
Minor fixup for feature_hwp removal
Use cpurfreq.h for declaration

v4:
Added __ro_after_init
s/ACPI_PDC_CPPC_NTV_INT/ACPI_PDC_CPPC_NATIVE_INTR/
Remove _IA32_
Fixup for opt_cpufreq_hwp removal
Add Jan Reviewed-by

v3:
New
---
 xen/arch/x86/acpi/cpufreq/hwp.c      | 9 +++++++++
 xen/arch/x86/acpi/lib.c              | 5 +++++
 xen/arch/x86/cpu/mcheck/mce_intel.c  | 6 ++++++
 xen/arch/x86/include/asm/msr-index.h | 1 +
 xen/include/acpi/cpufreq/cpufreq.h   | 1 +
 xen/include/acpi/pdc_intel.h         | 1 +
 6 files changed, 23 insertions(+)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index e9a6d23e38..33039ad39e 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -12,6 +12,8 @@
 #include <asm/msr.h>
 #include <acpi/cpufreq/cpufreq.h>
 
+static bool __ro_after_init hwp_in_use;
+
 static bool __ro_after_init feature_hwp_notification;
 static bool __ro_after_init feature_hwp_activity_window;
 
@@ -152,6 +154,11 @@ static int __init cf_check cpufreq_gov_hwp_init(void)
 }
 __initcall(cpufreq_gov_hwp_init);
 
+bool hwp_active(void)
+{
+    return hwp_in_use;
+}
+
 static bool __init hwp_available(void)
 {
     unsigned int eax;
@@ -204,6 +211,8 @@ static bool __init hwp_available(void)
     hwp_verbose("HW_FEEDBACK %ssupported\n",
                 (eax & CPUID6_EAX_HW_FEEDBACK) ? "" : "not ");
 
+    hwp_in_use = true;
+
     hwp_info("Using HWP for cpufreq\n");
 
     return true;
diff --git a/xen/arch/x86/acpi/lib.c b/xen/arch/x86/acpi/lib.c
index 43831b92d1..51cb082ca0 100644
--- a/xen/arch/x86/acpi/lib.c
+++ b/xen/arch/x86/acpi/lib.c
@@ -26,6 +26,8 @@
 #include <asm/fixmap.h>
 #include <asm/mwait.h>
 
+#include <acpi/cpufreq/cpufreq.h>
+
 u32 __read_mostly acpi_smi_cmd;
 u8 __read_mostly acpi_enable_value;
 u8 __read_mostly acpi_disable_value;
@@ -140,5 +142,8 @@ int arch_acpi_set_pdc_bits(u32 acpi_id, u32 *pdc, u32 mask)
 	    !(ecx & CPUID5_ECX_INTERRUPT_BREAK))
 		pdc[2] &= ~(ACPI_PDC_C_C1_FFH | ACPI_PDC_C_C2C3_FFH);
 
+	if (hwp_active())
+		pdc[2] |= ACPI_PDC_CPPC_NATIVE_INTR;
+
 	return 0;
 }
diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index 2f23f02923..4045c6591d 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -15,6 +15,9 @@
 #include <asm/p2m.h>
 #include <asm/mce.h>
 #include <asm/apic.h>
+
+#include <acpi/cpufreq/cpufreq.h>
+
 #include "mce.h"
 #include "x86_mca.h"
 #include "barrier.h"
@@ -64,6 +67,9 @@ static void cf_check intel_thermal_interrupt(struct cpu_user_regs *regs)
 
     ack_APIC_irq();
 
+    if ( hwp_active() )
+        wrmsr_safe(MSR_HWP_STATUS, 0);
+
     if ( NOW() < per_cpu(next, cpu) )
         return;
 
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 56f93cb8e2..f2410fc8c8 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -157,6 +157,7 @@
 #define MSR_HWP_CAPABILITIES                0x00000771
 #define MSR_HWP_INTERRUPT                   0x00000773
 #define MSR_HWP_REQUEST                     0x00000774
+#define MSR_HWP_STATUS                      0x00000777
 
 #define MSR_X2APIC_FIRST                    0x00000800
 #define MSR_X2APIC_LAST                     0x000008ff
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index cfe975814e..6737798e25 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -254,5 +254,6 @@ void intel_feature_detect(struct cpufreq_policy *policy);
 
 int hwp_cmdline_parse(const char *s, const char *e);
 int hwp_register_driver(void);
+bool hwp_active(void);
 
 #endif /* __XEN_CPUFREQ_PM_H__ */
diff --git a/xen/include/acpi/pdc_intel.h b/xen/include/acpi/pdc_intel.h
index 4fb719d6f5..abaa098b51 100644
--- a/xen/include/acpi/pdc_intel.h
+++ b/xen/include/acpi/pdc_intel.h
@@ -17,6 +17,7 @@
 #define ACPI_PDC_C_C1_FFH		(0x0100)
 #define ACPI_PDC_C_C2C3_FFH		(0x0200)
 #define ACPI_PDC_SMP_P_HWCOORD		(0x0800)
+#define ACPI_PDC_CPPC_NATIVE_INTR	(0x1000)
 
 #define ACPI_PDC_EST_CAPABILITY_SMP	(ACPI_PDC_SMP_C1PT | \
 					 ACPI_PDC_C_C1_HALT | \
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 17:10:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 17:10:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570644.892671 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi2D-0000Vl-Dl; Wed, 26 Jul 2023 17:10:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570644.892671; Wed, 26 Jul 2023 17:10:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi2D-0000VR-AG; Wed, 26 Jul 2023 17:10:49 +0000
Received: by outflank-mailman (input) for mailman id 570644;
 Wed, 26 Jul 2023 17:10:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Pn9P=DM=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qOi2B-00062Z-Sq
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 17:10:47 +0000
Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com
 [2607:f8b0:4864:20::f2a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5ca9b2f5-2bd7-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 19:10:47 +0200 (CEST)
Received: by mail-qv1-xf2a.google.com with SMTP id
 6a1803df08f44-63cf28db24cso550706d6.2
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 10:10:47 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 s17-20020a0ca611000000b0063d1aa446e2sm1248019qva.59.2023.07.26.10.10.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 10:10:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5ca9b2f5-2bd7-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690391446; x=1690996246;
        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=aw1/CynLpBcgrYjNJfRHcPPsQKW2D4eyDyqElDmf4oI=;
        b=XE+5H+/U1l/JxMKuf+cgNLruiSGEGVMAvoOMBIduVqTeAbDcyYvFLzfw7XfkhzDb+F
         e5XogSOT+akLkdYONu+p2x9Al7H/FAUj8r42z/WCULB2U4bwooNMS3EV+atuImiiixsp
         MIEDEQU7RpGKlZnEdcWh2XEN1pD2ubeFhqubBqa8Lp/YkctR+Ra4Y76Iuxily0No2Xk2
         YiQOKjeLOg7SHQL9mtk2H5uxYaVtJmf1Tqhvgaq+RQm6E2u6qxZfj5Cklmx9YTvDVJ0J
         C25JIjzMVF/6KYeT63Q9/7uX0Y+fo5Tc+6vaQ8qVUmpkss0vr8t4lnh33YPMpiB/kITO
         b94Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690391446; x=1690996246;
        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=aw1/CynLpBcgrYjNJfRHcPPsQKW2D4eyDyqElDmf4oI=;
        b=lIV3nftCHWfHUqFWaVZIybZITaD4P+5NnC8uQcF9OsZhSYY3g5EfyzOppmBpZn6PEK
         m/l8mzKBMrS79tFZO7qaZfJ9Pxpw4m5iyR9SmE+TGBahA/NXowkJbQMJDPybTY+6pDa4
         TpFK0X4X/UUWCKomwr77w5Fvteus6W555PgL6GqAbC/1uWHRuQTanqsFirU/EceLlOsK
         d3HaCUzfQF07ep6liSunD1DvJt4CsfVYXSEY92+NixF0oY4lQ4ySDEYwnDP/qcAQgUk7
         Wug2JdXNaikqW18IMzvqSvjf21AGU2BjpXU69jdYSw7Yx6+3a9W2qTgTYrkfsI11BZ2j
         /w4Q==
X-Gm-Message-State: ABy/qLYAzhd/Rt6iPjIUysdB8n8xSdGVnNN5CqHT1mg8jgWuBH9fMfvw
	EqcyrY98wmdnChfvbalQ6wW14exIsQ8=
X-Google-Smtp-Source: APBJJlEjSvs2/Oa0C32f1xVjEOrBadhDvwiyg6kw0oc7YfDXdb2ZE5QHS5PkoFLT/v054+G0w1pD0w==
X-Received: by 2002:a0c:f4d1:0:b0:62d:f515:9320 with SMTP id o17-20020a0cf4d1000000b0062df5159320mr2319724qvm.28.1690391445720;
        Wed, 26 Jul 2023 10:10:45 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v7 08/15] xenpm: Change get-cpufreq-para output for hwp
Date: Wed, 26 Jul 2023 13:09:38 -0400
Message-ID: <20230726170945.34961-9-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726170945.34961-1-jandryuk@gmail.com>
References: <20230726170945.34961-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

When using HWP, some of the returned data is not applicable.  In that
case, we should just omit it to avoid confusing the user.  So switch to
printing the base and max frequencies since those are relevant to HWP.
Similarly, stop printing the CPU frequencies since those do not apply.
The scaling fields are also no longer printed.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v5:
Use XEN_HWP_DRIVER_NAME
Add Jan's Ack

v4:
s/turbo/max/
Check for XEN_HWP_DRIVER driver instead of "-internal"

v2:
Use full governor name XEN_HWP_GOVERNOR to change output
Style fixes
---
 tools/misc/xenpm.c | 83 +++++++++++++++++++++++++---------------------
 1 file changed, 46 insertions(+), 37 deletions(-)

diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 1c474c3b59..21c93386de 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -711,6 +711,7 @@ void start_gather_func(int argc, char *argv[])
 /* print out parameters about cpu frequency */
 static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
 {
+    bool hwp = strcmp(p_cpufreq->scaling_driver, XEN_HWP_DRIVER_NAME) == 0;
     int i;
 
     printf("cpu id               : %d\n", cpuid);
@@ -720,49 +721,57 @@ static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
         printf(" %d", p_cpufreq->affected_cpus[i]);
     printf("\n");
 
-    printf("cpuinfo frequency    : max [%u] min [%u] cur [%u]\n",
-           p_cpufreq->cpuinfo_max_freq,
-           p_cpufreq->cpuinfo_min_freq,
-           p_cpufreq->cpuinfo_cur_freq);
+    if ( hwp )
+        printf("cpuinfo frequency    : base [%u] max [%u]\n",
+               p_cpufreq->cpuinfo_min_freq,
+               p_cpufreq->cpuinfo_max_freq);
+    else
+        printf("cpuinfo frequency    : max [%u] min [%u] cur [%u]\n",
+               p_cpufreq->cpuinfo_max_freq,
+               p_cpufreq->cpuinfo_min_freq,
+               p_cpufreq->cpuinfo_cur_freq);
 
     printf("scaling_driver       : %s\n", p_cpufreq->scaling_driver);
 
-    printf("scaling_avail_gov    : %s\n",
-           p_cpufreq->scaling_available_governors);
-
-    printf("current_governor     : %s\n", p_cpufreq->u.s.scaling_governor);
-    if ( !strncmp(p_cpufreq->u.s.scaling_governor,
-                  "userspace", CPUFREQ_NAME_LEN) )
-    {
-        printf("  userspace specific :\n");
-        printf("    scaling_setspeed : %u\n",
-               p_cpufreq->u.s.u.userspace.scaling_setspeed);
-    }
-    else if ( !strncmp(p_cpufreq->u.s.scaling_governor,
-                       "ondemand", CPUFREQ_NAME_LEN) )
+    if ( !hwp )
     {
-        printf("  ondemand specific  :\n");
-        printf("    sampling_rate    : max [%u] min [%u] cur [%u]\n",
-               p_cpufreq->u.s.u.ondemand.sampling_rate_max,
-               p_cpufreq->u.s.u.ondemand.sampling_rate_min,
-               p_cpufreq->u.s.u.ondemand.sampling_rate);
-        printf("    up_threshold     : %u\n",
-               p_cpufreq->u.s.u.ondemand.up_threshold);
-    }
+        printf("scaling_avail_gov    : %s\n",
+               p_cpufreq->scaling_available_governors);
 
-    printf("scaling_avail_freq   :");
-    for ( i = 0; i < p_cpufreq->freq_num; i++ )
-        if ( p_cpufreq->scaling_available_frequencies[i] ==
-             p_cpufreq->u.s.scaling_cur_freq )
-            printf(" *%d", p_cpufreq->scaling_available_frequencies[i]);
-        else
-            printf(" %d", p_cpufreq->scaling_available_frequencies[i]);
-    printf("\n");
+        printf("current_governor     : %s\n", p_cpufreq->u.s.scaling_governor);
+        if ( !strncmp(p_cpufreq->u.s.scaling_governor,
+                      "userspace", CPUFREQ_NAME_LEN) )
+        {
+            printf("  userspace specific :\n");
+            printf("    scaling_setspeed : %u\n",
+                   p_cpufreq->u.s.u.userspace.scaling_setspeed);
+        }
+        else if ( !strncmp(p_cpufreq->u.s.scaling_governor,
+                           "ondemand", CPUFREQ_NAME_LEN) )
+        {
+            printf("  ondemand specific  :\n");
+            printf("    sampling_rate    : max [%u] min [%u] cur [%u]\n",
+                   p_cpufreq->u.s.u.ondemand.sampling_rate_max,
+                   p_cpufreq->u.s.u.ondemand.sampling_rate_min,
+                   p_cpufreq->u.s.u.ondemand.sampling_rate);
+            printf("    up_threshold     : %u\n",
+                   p_cpufreq->u.s.u.ondemand.up_threshold);
+        }
+
+        printf("scaling_avail_freq   :");
+        for ( i = 0; i < p_cpufreq->freq_num; i++ )
+            if ( p_cpufreq->scaling_available_frequencies[i] ==
+                 p_cpufreq->u.s.scaling_cur_freq )
+                printf(" *%d", p_cpufreq->scaling_available_frequencies[i]);
+            else
+                printf(" %d", p_cpufreq->scaling_available_frequencies[i]);
+        printf("\n");
 
-    printf("scaling frequency    : max [%u] min [%u] cur [%u]\n",
-           p_cpufreq->u.s.scaling_max_freq,
-           p_cpufreq->u.s.scaling_min_freq,
-           p_cpufreq->u.s.scaling_cur_freq);
+        printf("scaling frequency    : max [%u] min [%u] cur [%u]\n",
+               p_cpufreq->u.s.scaling_max_freq,
+               p_cpufreq->u.s.scaling_min_freq,
+               p_cpufreq->u.s.scaling_cur_freq);
+    }
 
     printf("turbo mode           : %s\n",
            p_cpufreq->turbo_enabled ? "enabled" : "disabled or n/a");
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 17:10:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 17:10:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570646.892681 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi2K-00016k-Ns; Wed, 26 Jul 2023 17:10:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570646.892681; Wed, 26 Jul 2023 17:10:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi2K-00016b-Jv; Wed, 26 Jul 2023 17:10:56 +0000
Received: by outflank-mailman (input) for mailman id 570646;
 Wed, 26 Jul 2023 17:10:56 +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
 <SRS0=Pn9P=DM=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qOi2J-0005nP-Vr
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 17:10:55 +0000
Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com
 [2607:f8b0:4864:20::f32])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 60510bed-2bd7-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 19:10:53 +0200 (CEST)
Received: by mail-qv1-xf32.google.com with SMTP id
 6a1803df08f44-63cff46ddb8so5962326d6.1
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 10:10:54 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 s17-20020a0ca611000000b0063d1aa446e2sm1248019qva.59.2023.07.26.10.10.48
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 10:10:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 60510bed-2bd7-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690391452; x=1690996252;
        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=K2sbheRINo4VFvlSN5rNXGSmFJJ8xrco/X7vhWz8eac=;
        b=PUgtygZ2PxRMkOmMBkfTx5nM1kb06bcbsMZ2Q9iZC7AMrRAVFeIL96veVLFdL5gSdO
         Hn2w+pKfhxsBWWquodC0bkg0vxu0G8rMtR8Fq1O9Lf861QJxMSrQrVlgwa9hTsf0hAG5
         5G6WBBI97u+NN+YDuOkCD9qpIoQ9yNIHOJGwvgY7c/NOSfrK8Js3ko6rh6/wU6bh+ZX8
         2LU7Dh3WGMo/2nJ+Qsn6X19YMfOyNWGZeBVaAwtTXphR4BstTka5htVbN7agGCw8LiGW
         HkF5lVqZC1wN7gCOi/8Kv7qwxMCFTMKisutgpHeuyqLEkqotXmVXjPUZaIipn9SQon95
         CkAw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690391452; x=1690996252;
        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=K2sbheRINo4VFvlSN5rNXGSmFJJ8xrco/X7vhWz8eac=;
        b=kYECaWh0/jcnlHmvSZDIYoY6OaE7vvw+VgFBNCaZMZ0JrqkqXXo3LLZ8A+brO044VW
         WD/+5CodUuSU5gDGbDtRTD/Q/L9lqlx3+UHFuKjw1MjkGEza1/dKoP/AJzRTDguartcj
         4iz2T3YVvsGirnaogsK5hTo5BSBUal4jApl7zCru8zmmdq7W06BsieLPaQKNmNgKzFYE
         2Q+jzR+oL2fYsrdXpq/glnGKT7U95AFNRAXYm0IFIqPj8S4l0XTx55TWiEK25G3l6Zmk
         D6c0u4XaIVugqbzwDBuXgVQCOhCCv5ftztV/khT0BoRMgcOFL2oEFC98Zy4oefXRUsEN
         DuoQ==
X-Gm-Message-State: ABy/qLa/TSFRtVwk11euj1PEGhMemzky1EVH2z+QRgHN2LmsWuim2e4F
	Et737Kt0n48ebjg72bayoWWKrpF/ES8=
X-Google-Smtp-Source: APBJJlE73X9ug3IokrAryclx1+D8g36w/zKCkqzGfvPPweuuNqfRWPweY/RmfK3IMYBkazq4v7/bPw==
X-Received: by 2002:ad4:5c47:0:b0:635:f546:83d0 with SMTP id a7-20020ad45c47000000b00635f54683d0mr192322qva.11.1690391452343;
        Wed, 26 Jul 2023 10:10:52 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v7 09/15] cpufreq: Export HWP parameters to userspace as CPPC
Date: Wed, 26 Jul 2023 13:09:39 -0400
Message-ID: <20230726170945.34961-10-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726170945.34961-1-jandryuk@gmail.com>
References: <20230726170945.34961-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Extend xen_get_cpufreq_para to return hwp parameters.  HWP is an
implementation of ACPI CPPC (Collaborative Processor Performance
Control).  Use the CPPC name since that might be useful in the future
for AMD P-state.

We need the features bitmask to indicate fields supported by the actual
hardware - this only applies to activity window for the time being.

The HWP most_efficient is mapped to CPPC lowest_nonlinear, and guaranteed is
mapped to nominal.  CPPC has a guaranteed that is optional while nominal
is required.  ACPI spec says "If this register is not implemented, OSPM
assumes guaranteed performance is always equal to nominal performance."

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v2:
Style fixes
Don't bump XEN_SYSCTL_INTERFACE_VERSION
Drop cpufreq.h comment divider
Expand xen_hwp_para comment
Add HWP activity window mantissa/exponent defines
Handle union rename
Add const to get_hwp_para
Remove hw_ prefix from xen_hwp_para members
Use XEN_HWP_GOVERNOR
Use per_cpu for hwp_drv_data

v4:
Fixup for opt_cpufreq_hwp/hdc removal
get_hwp_para() takes cpu as arg
XEN_ prefix HWP_ACT_WINDOW_*
Drop HWP_ACT_WINDOW_EXPONENT_SHIFT - shift MASK
Remove Energy Bias (0-15) EPP fallback
Rename xen_hwp_para to xen_cppc_para
s/hwp/cppc/
Use scaling driver to switch output

v5:
Use XEN_HWP_DRIVER_NAME
Use cpufreq.h for declarations
Fixup some comments
Drop const from unsigned int cpu
Drop some unnecessary { }
Use strncmp
Switch sizeof(char) to sizeof(*scaling_available_governors)
Reindent copy_to_guest call
Add "HWP: " prefix to sysctl comments for cppc->hwp mapping

v6:
Drop commit message uint8_t paragraph
sysctl.h s/They/They're/
Fix indent and add parens for read_scaling_available_governors() args
Add Jan's Ack
---
 xen/arch/x86/acpi/cpufreq/hwp.c    | 23 ++++++++++
 xen/drivers/acpi/pmstat.c          | 74 ++++++++++++++++--------------
 xen/include/acpi/cpufreq/cpufreq.h |  2 +
 xen/include/public/sysctl.h        | 56 ++++++++++++++++++++++
 4 files changed, 121 insertions(+), 34 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index 33039ad39e..2cbfa1ce33 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -519,6 +519,29 @@ static const struct cpufreq_driver __initconstrel hwp_cpufreq_driver =
     .update = hwp_cpufreq_update,
 };
 
+int get_hwp_para(unsigned int cpu,
+                 struct xen_cppc_para *cppc_para)
+{
+    const struct hwp_drv_data *data = per_cpu(hwp_drv_data, cpu);
+
+    if ( data == NULL )
+        return -ENODATA;
+
+    cppc_para->features         =
+        (feature_hwp_activity_window ? XEN_SYSCTL_CPPC_FEAT_ACT_WINDOW : 0);
+    cppc_para->lowest           = data->hw.lowest;
+    cppc_para->lowest_nonlinear = data->hw.most_efficient;
+    cppc_para->nominal          = data->hw.guaranteed;
+    cppc_para->highest          = data->hw.highest;
+    cppc_para->minimum          = data->minimum;
+    cppc_para->maximum          = data->maximum;
+    cppc_para->desired          = data->desired;
+    cppc_para->energy_perf      = data->energy_perf;
+    cppc_para->activity_window  = data->activity_window;
+
+    return 0;
+}
+
 int __init hwp_register_driver(void)
 {
     int ret;
diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index d67d99e62f..e4e2df94a7 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -251,46 +251,52 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
     else
         strlcpy(op->u.get_para.scaling_driver, "Unknown", CPUFREQ_NAME_LEN);
 
-    if ( !(scaling_available_governors =
-           xzalloc_array(char, gov_num * CPUFREQ_NAME_LEN)) )
-        return -ENOMEM;
-    if ( (ret = read_scaling_available_governors(scaling_available_governors,
-                gov_num * CPUFREQ_NAME_LEN * sizeof(char))) )
+    if ( !strncmp(op->u.get_para.scaling_driver, XEN_HWP_DRIVER_NAME,
+                      CPUFREQ_NAME_LEN) )
+        ret = get_hwp_para(policy->cpu, &op->u.get_para.u.cppc_para);
+    else
     {
+        if ( !(scaling_available_governors =
+               xzalloc_array(char, gov_num * CPUFREQ_NAME_LEN)) )
+            return -ENOMEM;
+        if ( (ret = read_scaling_available_governors(
+                        scaling_available_governors,
+                        (gov_num * CPUFREQ_NAME_LEN *
+                         sizeof(*scaling_available_governors)))) )
+        {
+            xfree(scaling_available_governors);
+            return ret;
+        }
+        ret = copy_to_guest(op->u.get_para.scaling_available_governors,
+                            scaling_available_governors,
+                            gov_num * CPUFREQ_NAME_LEN);
         xfree(scaling_available_governors);
-        return ret;
-    }
-    ret = copy_to_guest(op->u.get_para.scaling_available_governors,
-                scaling_available_governors, gov_num * CPUFREQ_NAME_LEN);
-    xfree(scaling_available_governors);
-    if ( ret )
-        return ret;
+        if ( ret )
+            return ret;
 
-    op->u.get_para.u.s.scaling_cur_freq = policy->cur;
-    op->u.get_para.u.s.scaling_max_freq = policy->max;
-    op->u.get_para.u.s.scaling_min_freq = policy->min;
+        op->u.get_para.u.s.scaling_cur_freq = policy->cur;
+        op->u.get_para.u.s.scaling_max_freq = policy->max;
+        op->u.get_para.u.s.scaling_min_freq = policy->min;
 
-    if ( policy->governor->name[0] )
-        strlcpy(op->u.get_para.u.s.scaling_governor,
-            policy->governor->name, CPUFREQ_NAME_LEN);
-    else
-        strlcpy(op->u.get_para.u.s.scaling_governor, "Unknown", CPUFREQ_NAME_LEN);
+        if ( policy->governor->name[0] )
+            strlcpy(op->u.get_para.u.s.scaling_governor,
+                policy->governor->name, CPUFREQ_NAME_LEN);
+        else
+            strlcpy(op->u.get_para.u.s.scaling_governor, "Unknown",
+                    CPUFREQ_NAME_LEN);
 
-    /* governor specific para */
-    if ( !strncasecmp(op->u.get_para.u.s.scaling_governor,
-                      "userspace", CPUFREQ_NAME_LEN) )
-    {
-        op->u.get_para.u.s.u.userspace.scaling_setspeed = policy->cur;
-    }
+        /* governor specific para */
+        if ( !strncasecmp(op->u.get_para.u.s.scaling_governor,
+                          "userspace", CPUFREQ_NAME_LEN) )
+            op->u.get_para.u.s.u.userspace.scaling_setspeed = policy->cur;
 
-    if ( !strncasecmp(op->u.get_para.u.s.scaling_governor,
-                      "ondemand", CPUFREQ_NAME_LEN) )
-    {
-        ret = get_cpufreq_ondemand_para(
-            &op->u.get_para.u.s.u.ondemand.sampling_rate_max,
-            &op->u.get_para.u.s.u.ondemand.sampling_rate_min,
-            &op->u.get_para.u.s.u.ondemand.sampling_rate,
-            &op->u.get_para.u.s.u.ondemand.up_threshold);
+        if ( !strncasecmp(op->u.get_para.u.s.scaling_governor,
+                          "ondemand", CPUFREQ_NAME_LEN) )
+            ret = get_cpufreq_ondemand_para(
+                &op->u.get_para.u.s.u.ondemand.sampling_rate_max,
+                &op->u.get_para.u.s.u.ondemand.sampling_rate_min,
+                &op->u.get_para.u.s.u.ondemand.sampling_rate,
+                &op->u.get_para.u.s.u.ondemand.up_threshold);
     }
 
     return ret;
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 6737798e25..f90e9d3a6c 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -255,5 +255,7 @@ void intel_feature_detect(struct cpufreq_policy *policy);
 int hwp_cmdline_parse(const char *s, const char *e);
 int hwp_register_driver(void);
 bool hwp_active(void);
+int get_hwp_para(unsigned int cpu,
+                 struct xen_cppc_para *cppc_para);
 
 #endif /* __XEN_CPUFREQ_PM_H__ */
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 5a30b16fcf..cf27f8f2f9 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -296,6 +296,61 @@ struct xen_ondemand {
     uint32_t up_threshold;
 };
 
+struct xen_cppc_para {
+    /* OUT */
+    /* activity_window supported if set */
+#define XEN_SYSCTL_CPPC_FEAT_ACT_WINDOW  (1 << 0)
+    uint32_t features; /* bit flags for features */
+    /*
+     * See Intel SDM: HWP Performance Range and Dynamic Capabilities
+     *
+     * These four are 0-255 hardware-provided values.  They're "continuous,
+     * abstract unit-less, performance" values.  Smaller numbers are slower
+     * and larger ones are faster.
+     */
+    uint32_t lowest;
+    uint32_t lowest_nonlinear; /* HWP: most_efficient */
+    uint32_t nominal; /* HWP: guaranteed */
+    uint32_t highest;
+    /*
+     * See Intel SDM: IA32_HWP_REQUEST MSR (Address: 774H Logical Processor
+     * Scope)
+     *
+     * These are all hints, and the processor may deviate outside of them.
+     * Values below are 0-255.
+     *
+     * minimum and maximum can be set to the above hardware values to constrain
+     * operation.  The full range 0-255 is accepted and will be clipped by
+     * hardware.
+     */
+    uint32_t minimum;
+    uint32_t maximum;
+    /*
+     * An explicit performance hint, disabling hardware selection.
+     * 0 lets the hardware decide.
+     */
+    uint32_t desired;
+    /*
+     * Hint to hardware for energy/performance preference.
+     * 0:   Performance
+     * 128: Balance (Default)
+     * 255: Powersaving
+     */
+    uint32_t energy_perf;
+    /*
+     * Activity Window is a moving history window for the processor's operation
+     * calculations, controlling responsiveness.  Measured in microseconds
+     * encoded as:
+     *
+     * bits 6:0   - 7bit mantissa
+     * bits 9:7   - 3bit base-10 exponent
+     * btis 15:10 - Unused - must be 0
+     */
+#define XEN_CPPC_ACT_WINDOW_MANTISSA_MASK  0x07f
+#define XEN_CPPC_ACT_WINDOW_EXPONENT_MASK  0x380
+    uint32_t activity_window;
+};
+
 #define XEN_HWP_DRIVER_NAME "hwp"
 
 /*
@@ -333,6 +388,7 @@ struct xen_get_cpufreq_para {
                 struct  xen_ondemand ondemand;
             } u;
         } s;
+        struct xen_cppc_para cppc_para;
     } u;
 
     int32_t turbo_enabled;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 17:11:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 17:11:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570650.892690 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi2Q-0001oy-71; Wed, 26 Jul 2023 17:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570650.892690; Wed, 26 Jul 2023 17:11:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi2Q-0001o2-3o; Wed, 26 Jul 2023 17:11:02 +0000
Received: by outflank-mailman (input) for mailman id 570650;
 Wed, 26 Jul 2023 17:11:00 +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
 <SRS0=Pn9P=DM=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qOi2O-0005nP-KU
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 17:11:00 +0000
Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com
 [2607:f8b0:4864:20::22f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 632e1871-2bd7-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 19:10:58 +0200 (CEST)
Received: by mail-oi1-x22f.google.com with SMTP id
 5614622812f47-3a5ad44dc5aso59885b6e.3
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 10:10:59 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 s17-20020a0ca611000000b0063d1aa446e2sm1248019qva.59.2023.07.26.10.10.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 10:10:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 632e1871-2bd7-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690391457; x=1690996257;
        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=5g90NEIr2gEQRrKv4KW4CuJMuwsS8xE3NxELsPnfYWs=;
        b=ieIvb0nsEqn45EN9wBUG7zCS0ysQE3YMY/JPe3LBe5YSqZVCLms2wsrlKDh6wggile
         LjQT8tcD2aEifnw6oE7EsHtLIDhmp7BWcvmsdMDuO/aSvt/vaDLeG2TBTyZR37+paTRQ
         sMWBeoc2Z0OfMWHSnCHY4mUyv/VUEQcEEQ+MdT8n7g2XexZwKdoH62D7quutmw7KtcOD
         XjRSWq+4DFXTkz9Koj9b38WyPMtm8ZNYs4ZcUyGCCYC5n+gDehy+ctS8caP7/hNv/gFW
         unVctgbgLcORrCrEbED9R9Smopv+SNuog6F0XqCzAAL/vmiDz9eGHl+W8cNcwPwZb6fX
         gELg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690391457; x=1690996257;
        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=5g90NEIr2gEQRrKv4KW4CuJMuwsS8xE3NxELsPnfYWs=;
        b=KSTiZew5Gsriszzvf4ff8HO1W8ceTcq+YMeKoVYeJ1aB16HkNRxHMMz9v9Mc/X3P1V
         tTqObSMl0R71JCWevdaE1B1fyttvN4BGNqgqREC7PCGB3W4JK+VFh5xEY6STwqV9O9Nw
         OFqEVNFwrOuUjKPMBAcvQXoSHrRrVRezmUaV1AcyyX/zPYVKSM+pwmlLSm4ORV3+MMfp
         vsemXZ5FisEAXdcgHv0zrPs6xF1feiuPDBASoLVzXTVpPzxVP9m62Sicq9TPPse8XBqH
         PF7tXz8s8Gl78Rbo5kSOGvVdaI+g+ytEF6LySjHSEFoBLQoiV1LOpGpjt7Af/p4TNpcQ
         954Q==
X-Gm-Message-State: ABy/qLas6AIG8varAeUWoYueVYmeskk/eLKGQU0rg/gH3ka4UWBc5nxk
	KsG1/Ux3EgCaJcvcRL0xnXPYnqTwREE=
X-Google-Smtp-Source: APBJJlEupFohQgvxB5P2BCuegnEvzZJOKE+6E6RhSIp0mlGObHvccrBu5ABGhPxiXxPdStE3Xh90nQ==
X-Received: by 2002:a05:6808:bc7:b0:3a3:eab8:8c40 with SMTP id o7-20020a0568080bc700b003a3eab88c40mr135683oik.54.1690391457086;
        Wed, 26 Jul 2023 10:10:57 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v7 10/15] libxc: Include cppc_para in definitions
Date: Wed, 26 Jul 2023 13:09:40 -0400
Message-ID: <20230726170945.34961-11-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726170945.34961-1-jandryuk@gmail.com>
References: <20230726170945.34961-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Expose the cppc_para fields through libxc.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
---
v4:
Rename hwp to cppc
Add Anthony's Ack
---
 tools/include/xenctrl.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index 8aedb952a0..2092632296 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1892,6 +1892,7 @@ int xc_smt_disable(xc_interface *xch);
  */
 typedef struct xen_userspace xc_userspace_t;
 typedef struct xen_ondemand xc_ondemand_t;
+typedef struct xen_cppc_para xc_cppc_para_t;
 
 struct xc_get_cpufreq_para {
     /* IN/OUT variable */
@@ -1923,6 +1924,7 @@ struct xc_get_cpufreq_para {
                 xc_ondemand_t ondemand;
             } u;
         } s;
+        xc_cppc_para_t cppc_para;
     } u;
 
     int32_t turbo_enabled;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 17:17:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 17:17:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570656.892701 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi8Y-0003l6-Vj; Wed, 26 Jul 2023 17:17:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570656.892701; Wed, 26 Jul 2023 17:17:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi8Y-0003kz-Ro; Wed, 26 Jul 2023 17:17:22 +0000
Received: by outflank-mailman (input) for mailman id 570656;
 Wed, 26 Jul 2023 17:17:20 +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
 <SRS0=Pn9P=DM=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qOi2S-0005nP-GG
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 17:11:04 +0000
Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com
 [2607:f8b0:4864:20::f2c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 65880181-2bd7-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 19:11:02 +0200 (CEST)
Received: by mail-qv1-xf2c.google.com with SMTP id
 6a1803df08f44-6378cec43ddso375246d6.2
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 10:11:02 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 s17-20020a0ca611000000b0063d1aa446e2sm1248019qva.59.2023.07.26.10.10.59
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 10:11:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 65880181-2bd7-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690391461; x=1690996261;
        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=imeu59UbyEmxk/60do4rzt8IPOfqsoGRviRd+fRZmSg=;
        b=cfCWBHQN8Rx3skIwDb8tQKTb4yWLK4tNuauqP7/MkSC+Nyh3LyrBID5/Boz2Gx4Zwl
         KZxZirZdeRGoY15ZRY2G+pvyiZXofrEdvFGe+HJeHw13kfcszDjc4hL+p7J6SG8aZSEJ
         JyP8EtgLp1zRNihXxGq1XhJw2D205C8Fo2gr+u8BMiZUVdgg5DF3kjgA5x3MlZp/06LJ
         KmVbJ2f9CAJDW3JY3goGxrEyTyx6JDUQa/DByhUOl4Gx/7ZzqOWeBjYP0tEBkV9yqufn
         r6lDya10frr0lN54lmVKbYjpP3wtP9aj3BfpJbKocPFfcwiH12a10hAz22DUAeEI7/Zk
         boRQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690391461; x=1690996261;
        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=imeu59UbyEmxk/60do4rzt8IPOfqsoGRviRd+fRZmSg=;
        b=NWCNpzIq0AdqzEat3spWQlSaS1s66TWf0CzEhCVOJzXQrEeoF34045YfwS7lI+L6Pb
         Jsp65jVdPj1Bn4qGhXj3W4rX9URjkNOqyNZ1w77Y66duzw/ANCYjWlovH45mo4klGPT+
         R65hVukc07nrKiN5GAVNQ3/z/DjQfRsMrsFSixcspXJnhtbikrLhNarVfwak//aVV4Y1
         0bxHbqQy+arzf6XU8/3pQZrH6wdvbQJbrBb1ns3ZMq6AGbJ53Rn0mHDAJnRIx5WA1crc
         GQR6Y6btqboQbiaSHN6tmMzl+WM+dbmr2FmjBEuUvc75CE+IC8DpjZuIIVs0GRlB4EKv
         84iQ==
X-Gm-Message-State: ABy/qLZtrCV8lJXPW/IvQ4w8sKyxhG72g8BWkhBfV4wzOxvGwsp2i4eZ
	Dq4Dr4k7nwqw0shwEh8uotaB+JQlgtU=
X-Google-Smtp-Source: APBJJlE+vt1k5qigt2ot0tq2Cf86zCqHXL5I/dtYIhfnyiUGkSEF61FqmaMokrlG483z9w5brciStw==
X-Received: by 2002:a0c:e305:0:b0:63c:fbd0:84a6 with SMTP id s5-20020a0ce305000000b0063cfbd084a6mr2839134qvl.5.1690391461166;
        Wed, 26 Jul 2023 10:11:01 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v7 11/15] xenpm: Print HWP/CPPC parameters
Date: Wed, 26 Jul 2023 13:09:41 -0400
Message-ID: <20230726170945.34961-12-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726170945.34961-1-jandryuk@gmail.com>
References: <20230726170945.34961-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Print HWP-specific parameters.  Some are always present, but others
depend on hardware support.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
v2:
Style fixes
Declare i outside loop
Replace repearted hardware/configured limits with spaces
Fixup for hw_ removal
Use XEN_HWP_GOVERNOR
Use HWP_ACT_WINDOW_EXPONENT_*
Remove energy_perf hw autonomous - 0 doesn't mean autonomous

v4:
Return activity_window from calculate_hwp_activity_window
Use blanks instead of _ in output
Use MASK_EXTR
Check XEN_HWP_DRIVER name since governor is no longer returned
s/hwp/cppc

v5:
Add Jan's Reviewed-by
---
 tools/misc/xenpm.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 21c93386de..3abd99fd20 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -708,6 +708,46 @@ void start_gather_func(int argc, char *argv[])
     pause();
 }
 
+static unsigned int calculate_activity_window(const xc_cppc_para_t *cppc,
+                                              const char **units)
+{
+    unsigned int mantissa = MASK_EXTR(cppc->activity_window,
+                                      XEN_CPPC_ACT_WINDOW_MANTISSA_MASK);
+    unsigned int exponent = MASK_EXTR(cppc->activity_window,
+                                      XEN_CPPC_ACT_WINDOW_EXPONENT_MASK);
+    unsigned int multiplier = 1;
+    unsigned int i;
+
+    /*
+     * SDM only states a 0 register is hardware selected, and doesn't mention
+     * a 0 mantissa with a non-0 exponent.  Only special case a 0 register.
+     */
+    if ( cppc->activity_window == 0 )
+    {
+        *units = "hardware selected";
+
+        return 0;
+    }
+
+    if ( exponent >= 6 )
+    {
+        *units = "s";
+        exponent -= 6;
+    }
+    else if ( exponent >= 3 )
+    {
+        *units = "ms";
+        exponent -= 3;
+    }
+    else
+        *units = "us";
+
+    for ( i = 0; i < exponent; i++ )
+        multiplier *= 10;
+
+    return mantissa * multiplier;
+}
+
 /* print out parameters about cpu frequency */
 static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
 {
@@ -772,6 +812,32 @@ static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
                p_cpufreq->u.s.scaling_min_freq,
                p_cpufreq->u.s.scaling_cur_freq);
     }
+    else
+    {
+        const xc_cppc_para_t *cppc = &p_cpufreq->u.cppc_para;
+
+        printf("cppc variables       :\n");
+        printf("  hardware limits    : lowest [%u] lowest nonlinear [%u]\n",
+               cppc->lowest, cppc->lowest_nonlinear);
+        printf("                     : nominal [%u] highest [%u]\n",
+               cppc->nominal, cppc->highest);
+        printf("  configured limits  : min [%u] max [%u] energy perf [%u]\n",
+               cppc->minimum, cppc->maximum, cppc->energy_perf);
+
+        if ( cppc->features & XEN_SYSCTL_CPPC_FEAT_ACT_WINDOW )
+        {
+            unsigned int activity_window;
+            const char *units;
+
+            activity_window = calculate_activity_window(cppc, &units);
+            printf("                     : activity_window [%u %s]\n",
+                   activity_window, units);
+        }
+
+        printf("                     : desired [%u%s]\n",
+               cppc->desired,
+               cppc->desired ? "" : " hw autonomous");
+    }
 
     printf("turbo mode           : %s\n",
            p_cpufreq->turbo_enabled ? "enabled" : "disabled or n/a");
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 17:17:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 17:17:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570661.892713 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi8Z-0003uN-GJ; Wed, 26 Jul 2023 17:17:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570661.892713; Wed, 26 Jul 2023 17:17:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi8Z-0003tC-By; Wed, 26 Jul 2023 17:17:23 +0000
Received: by outflank-mailman (input) for mailman id 570661;
 Wed, 26 Jul 2023 17:17:21 +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
 <SRS0=Pn9P=DM=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qOi2j-0005nP-QP
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 17:11:21 +0000
Received: from mail-vs1-xe34.google.com (mail-vs1-xe34.google.com
 [2607:f8b0:4864:20::e34])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6fe5d449-2bd7-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 19:11:19 +0200 (CEST)
Received: by mail-vs1-xe34.google.com with SMTP id
 ada2fe7eead31-44757af136cso14433137.3
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 10:11:20 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 s17-20020a0ca611000000b0063d1aa446e2sm1248019qva.59.2023.07.26.10.11.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 10:11:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6fe5d449-2bd7-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690391478; x=1690996278;
        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=wIB5Z/ggG5eJ8M2F2JBMwNaYc9A5YlbhT5y/HdVUB7g=;
        b=i6jixsyaZ39eQkyDMG2g2c4UpEA1PEFFmE0zEADrlJ36oqzICRuU7Fv+UHs2lF03JB
         Q11hQjU2R46sWY4p2ZXIR2/GGnk/gWTpGKNp7gd0avUxUHA12sXjR3vE6Pw24ANzPiVx
         CptPVMLnfyF6QeHibjl8CcxI6HANdIZBAqXmLAxJRZjYBWCMBcwKO4qapxOOwPW3wD7K
         C4ijSLPdidWSj4qm/6UA1Gxnbq0+mULORy+T4RLqcGMdUaQXZvvMizEjTvGvFn0ly65X
         uflwgHV851IddZe2qkf6O4dDWUTJVm3UaeiNosjfVQARZtSQXk3DmvRD/yLeIwDYnVwC
         O6nw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690391478; x=1690996278;
        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=wIB5Z/ggG5eJ8M2F2JBMwNaYc9A5YlbhT5y/HdVUB7g=;
        b=T8zT6P/dyr4BH5hA1WGSdNNLhL0wXXqD7oUl4WTTsZMKnQUyfItQXA1AhpMWkDqZgG
         mX5D4gqcHjo17wSF1iBmQEBeN5BQcAZbsMGNEI/MPLmW/f4Nlg61H3+06PryJ9vYd1p2
         MJDFF+dCmUkbfAYq1ss2JBueIcYiFuKwzpHMkWuaHwgLv+5NkkbhO7POuJwmZZLDP8Ye
         8U/Km9fFfz4a9gqrSTAatKnw1djZtlFqXLgkmX1ZWPbTMT/N2nlmuWTN4tFCXfxRDLd6
         CTvwCQbM7v/OMYWteFcLEx9ifJVRGULNk2YEkfvXSyElsAdJp6/qFysHEXb92Q73/Io/
         VHmg==
X-Gm-Message-State: ABy/qLaf1enoKvVi/Kkv8lIEbfj/tOvoz6Qv63lej9OjCY+8KUQOFdoR
	gB8XbfuuuYR4LgP2Dugdr9wrWBCYxhE=
X-Google-Smtp-Source: APBJJlGbfOVaJ6JhFnY4cR2crCc3Eb+DisFFZbx74DJbPeLPPfwaRq2ZeagfuZLH46r4KPc7asidLg==
X-Received: by 2002:a67:ef92:0:b0:443:66b9:b8f0 with SMTP id r18-20020a67ef92000000b0044366b9b8f0mr2027430vsp.10.1690391478530;
        Wed, 26 Jul 2023 10:11:18 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v7 13/15] libxc: Add xc_set_cpufreq_cppc
Date: Wed, 26 Jul 2023 13:09:43 -0400
Message-ID: <20230726170945.34961-14-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726170945.34961-1-jandryuk@gmail.com>
References: <20230726170945.34961-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add xc_set_cpufreq_cppc to allow calling xen_systctl_pm_op
SET_CPUFREQ_CPPC.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
---
v2:
Mark xc_set_hwp_para_t const

v4:
s/hwp/cppc/
Add Anthony's Ack

v5:
Remove const and copy back result
---
 tools/include/xenctrl.h |  4 ++++
 tools/libs/ctrl/xc_pm.c | 23 +++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index 2092632296..52f42fb5b6 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1930,11 +1930,15 @@ struct xc_get_cpufreq_para {
     int32_t turbo_enabled;
 };
 
+typedef struct xen_set_cppc_para xc_set_cppc_para_t;
+
 int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
                         struct xc_get_cpufreq_para *user_para);
 int xc_set_cpufreq_gov(xc_interface *xch, int cpuid, char *govname);
 int xc_set_cpufreq_para(xc_interface *xch, int cpuid,
                         int ctrl_type, int ctrl_value);
+int xc_set_cpufreq_cppc(xc_interface *xch, int cpuid,
+                        xc_set_cppc_para_t *set_cppc);
 int xc_get_cpufreq_avgfreq(xc_interface *xch, int cpuid, int *avg_freq);
 
 int xc_set_sched_opt_smt(xc_interface *xch, uint32_t value);
diff --git a/tools/libs/ctrl/xc_pm.c b/tools/libs/ctrl/xc_pm.c
index cea3eab22e..1f267147f6 100644
--- a/tools/libs/ctrl/xc_pm.c
+++ b/tools/libs/ctrl/xc_pm.c
@@ -329,6 +329,29 @@ int xc_set_cpufreq_para(xc_interface *xch, int cpuid,
     return xc_sysctl(xch, &sysctl);
 }
 
+int xc_set_cpufreq_cppc(xc_interface *xch, int cpuid,
+                        xc_set_cppc_para_t *set_cppc)
+{
+    DECLARE_SYSCTL;
+    int ret;
+
+    if ( !xch )
+    {
+        errno = EINVAL;
+        return -1;
+    }
+    sysctl.cmd = XEN_SYSCTL_pm_op;
+    sysctl.u.pm_op.cmd = SET_CPUFREQ_CPPC;
+    sysctl.u.pm_op.cpuid = cpuid;
+    sysctl.u.pm_op.u.set_cppc = *set_cppc;
+
+    ret = xc_sysctl(xch, &sysctl);
+
+    *set_cppc = sysctl.u.pm_op.u.set_cppc;
+
+    return ret;
+}
+
 int xc_get_cpufreq_avgfreq(xc_interface *xch, int cpuid, int *avg_freq)
 {
     int ret = 0;
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 17:17:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 17:17:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570665.892731 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi8a-0004KJ-IK; Wed, 26 Jul 2023 17:17:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570665.892731; Wed, 26 Jul 2023 17:17:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi8a-0004Hb-AF; Wed, 26 Jul 2023 17:17:24 +0000
Received: by outflank-mailman (input) for mailman id 570665;
 Wed, 26 Jul 2023 17:17:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Pn9P=DM=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qOi2v-00062Z-3b
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 17:11:33 +0000
Received: from mail-vk1-xa29.google.com (mail-vk1-xa29.google.com
 [2607:f8b0:4864:20::a29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 77ad7ed3-2bd7-11ee-b242-6b7b168915f2;
 Wed, 26 Jul 2023 19:11:32 +0200 (CEST)
Received: by mail-vk1-xa29.google.com with SMTP id
 71dfb90a1353d-4864cc561aeso20610e0c.0
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 10:11:32 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 s17-20020a0ca611000000b0063d1aa446e2sm1248019qva.59.2023.07.26.10.11.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 10:11:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 77ad7ed3-2bd7-11ee-b242-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690391491; x=1690996291;
        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=7fKIbOA4RKJwyWZPk8ACAEU8hAgIi7aDz2OnDwWBK4c=;
        b=cEqPDTYN4jp1bM38ONyapZb5sjjHHtuoRMvn7/AOYco0cl9A39Uw+AeJ7Vx0yGadKh
         g+GryXW4l38nradggkyUGKrTGZSAG7a3yOXd9d2ULPO1TR39s115caF4uK5ZRZhuAcXI
         gbgcQh2kyRlTkSaolEQ5nKAk4nAykM2Ux5RQWAdkYUlw2+IDVv87ugyxd2PfoYuxQ95O
         yiYqzJzMOB/ATv6MHqkU0fiEVQzc7y9HNGXMj1oL1V7U281QwgPsGpeH6e4dXPj/yJbX
         GN7DPHi/8k4p2l3+MwtfPLtoB2u7hURT57nUzVmTvYW2HxEdxPkFskS0dW6A1gWzJM/U
         NKuA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690391491; x=1690996291;
        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=7fKIbOA4RKJwyWZPk8ACAEU8hAgIi7aDz2OnDwWBK4c=;
        b=F5D5TdJIGrkJqXw92S0Z5HWRIv+4KFZjNYNL2Lcnav7AWo0dXdwvyeBsbzq09y0QUr
         uuYh7fEslSZCjbMA+bY15FW3sOLLPyHICbLU36tyukB53i4rqDaVw6s+KQaP6O5yYIbH
         ZKbIakxLrv6+f/jSnZB+v1Id0cFWvJwUiiSj0CCEJLdcOQXVMpPpPs5FcUdoY1/+vSKb
         owdSRa6CYPDhZHml58uFZc471GDoEN9UM3PVMs8YxhBKvASWEzNOtBO5RFA0GCRKHK7w
         S4WR79Jpe71XgRhMXQO0Lj3JrEFRZ3GaOr1FwjZj4FLARWtA4zgB7woX88Azdkv0Jh9+
         KCeg==
X-Gm-Message-State: ABy/qLax+V1rpxbqkgWNXryiWZMaViLqCYOCg4bVgtrA64y01sxMZd0t
	KSAdmrDGUZgkOTuPrvZ90j6qLPT0h9k=
X-Google-Smtp-Source: APBJJlEWDBNLI3jM2iCnuUvrRJIpeItyiY4vKwD9Ygri4G5qaqR/i40OGmB/BoJ79bDVPyjBY8Tohw==
X-Received: by 2002:a1f:dd44:0:b0:486:4c0e:9ae5 with SMTP id u65-20020a1fdd44000000b004864c0e9ae5mr1882323vkg.13.1690391490884;
        Wed, 26 Jul 2023 10:11:30 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Henry Wang <Henry.Wang@arm.com>,
	Community Manager <community.manager@xenproject.org>
Subject: [PATCH v7 15/15] CHANGELOG: Add Intel HWP entry
Date: Wed, 26 Jul 2023 13:09:45 -0400
Message-ID: <20230726170945.34961-16-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726170945.34961-1-jandryuk@gmail.com>
References: <20230726170945.34961-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Henry Wang <Henry.Wang@arm.com>
---
v3:
Position under existing Added section
Add Henry's Ack

v2:
Add blank line
---
 CHANGELOG.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7d7e0590f8..8d6e6c3088 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -24,7 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - xl/libxl can customize SMBIOS strings for HVM guests.
  - Add support for AVX512-FP16 on x86.
  - On Arm, Xen supports guests running SVE/SVE2 instructions. (Tech Preview)
-
+ - Add Intel Hardware P-States (HWP) cpufreq driver.
 
 ## [4.17.0](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.17.0) - 2022-12-12
 
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 17:17:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 17:17:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570660.892705 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi8Z-0003nW-7X; Wed, 26 Jul 2023 17:17:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570660.892705; Wed, 26 Jul 2023 17:17:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi8Z-0003mI-23; Wed, 26 Jul 2023 17:17:23 +0000
Received: by outflank-mailman (input) for mailman id 570660;
 Wed, 26 Jul 2023 17:17:21 +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
 <SRS0=Pn9P=DM=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qOi2f-0005nP-Sk
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 17:11:17 +0000
Received: from mail-vk1-xa2d.google.com (mail-vk1-xa2d.google.com
 [2607:f8b0:4864:20::a2d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6d5bbe92-2bd7-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 19:11:15 +0200 (CEST)
Received: by mail-vk1-xa2d.google.com with SMTP id
 71dfb90a1353d-460eb67244eso14761e0c.1
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 10:11:15 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 s17-20020a0ca611000000b0063d1aa446e2sm1248019qva.59.2023.07.26.10.11.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 10:11:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6d5bbe92-2bd7-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690391474; x=1690996274;
        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=JCi5HaPn3Xps1XhyXm+DfozNO0fjTdxPuxSUYqHSx3Q=;
        b=QKSBu0CJbw4jvtof2NIUzuQfKhuoB/4YB6+TugWvyYBDRWHt+O1mMl+L8IiFvwpoLw
         mSZti1m6z6FdywVdRvbtvjRZD5Yum0s1MjvNOo1Gd5MUHoKKBl70JF88WxhygHMFeqXO
         siPiTF7TAbLaoPT8FVCk1ao2SnSk5XzCGbu0SCmhe+GaNQQFaUblI3+AJrIi4ppdrLPu
         CjtuZMm4uYXuezyI8v1OMUb+LDnw/tPF9F6yPrd9U4SDl2pfilVnqflIbkZixzH6MHJ1
         IegXcAT4+Q7L73dZPDMZY53VK4WR7fNmEpCqHCcBLsPEsqZmH+4/ZYPCnyrUDqHAWEML
         R/dg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690391474; x=1690996274;
        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=JCi5HaPn3Xps1XhyXm+DfozNO0fjTdxPuxSUYqHSx3Q=;
        b=WYn/274q0rrFPjIthE7BM4iEwgea3yTx9T+yAE6Ty9xx/eNdAYdKyDnmiJDQmP0/Oe
         MSazFOEmVTt+xjFSi7SIBpRZizkn4F6r/3d1g4vE7+qRpB2YpGXJ3/uoC77OYT17V5gX
         CeEwUSKNGSPiOfq1fM8Py+Jso+bFkQJXNtLQ4lFmUzl92bNdarijGXBFpS8/tXdSwOez
         tvnuE4PtMYzR0CfHasbMHJS9Z42PzuIEs/cgg4DtemYpnCfNsvEM6yNs6YOxVJ3pW0bh
         qAknW4r1vSNL2SX0/oslK+hpIYFw96C6vYQ4jM03WMIRhhqvBQWBvN8Bj5KlgNknx+pv
         GsIg==
X-Gm-Message-State: ABy/qLaIXQXGDX11BIDB3fXJ+x/QvsHd5bbqn1RUBq4a79fz1hawuN8Y
	lATUHyzfgZFW25bS/S9jhhQPoXdvpmU=
X-Google-Smtp-Source: APBJJlGuGAhlyw4qgQUlaL2FJdN0ZutGtZhpCc/OfEfdsDWNEVCdRD702YEb5ZdlnQ0J8ETF5Ax5tw==
X-Received: by 2002:a1f:c402:0:b0:485:f674:dcea with SMTP id u2-20020a1fc402000000b00485f674dceamr1585279vkf.16.1690391474118;
        Wed, 26 Jul 2023 10:11:14 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v7 12/15] xen: Add SET_CPUFREQ_HWP xen_sysctl_pm_op
Date: Wed, 26 Jul 2023 13:09:42 -0400
Message-ID: <20230726170945.34961-13-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726170945.34961-1-jandryuk@gmail.com>
References: <20230726170945.34961-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add SET_CPUFREQ_HWP xen_sysctl_pm_op to set HWP parameters.  The sysctl
supports setting multiple values simultaneously as indicated by the
set_params bits.  This allows atomically applying new HWP configuration
via a single wrmsr.

XEN_SYSCTL_HWP_SET_PRESET_BALANCE/PERFORMANCE/POWERSAVE provide three
common presets.  Setting them depends on hardware limits which the
hypervisor is already caching.  So using them allows skipping a
hypercall to query the limits (lowest/highest) to then set those same
values.  The code is organized to allow a preset to be refined with
additional parameters if desired.

"most_efficient" and "guaranteed" could be additional presets in the
future, but the are not added now.  Those levels can change at runtime,
but we don't have code in place to monitor and update for those events.

Since activity window may not be supported by all hardware, omit writing
it when not supported, and return that fact to userspace by updating
set_params.

CPPC parameter checking disallows setting reserved bytes and ensure
values are only non-zero when the corresponding set_params bit is set.
There is no range checking (0-255 is allowed) since hardware is
documented to clip internally.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
v7:
Fix brace placement
Add Jan's R-b

v6:
Add () around bit test
Add U suffix to XEN_SYSCTL_ constants
Change -EINVAL returns to -ENOENT/-EOPNOTSUPP
Return success for no-op set_hwp_para()

v5:
Use cpufreq.h for include
Add () around bit test
Fix Configure typo
Drop duplicated energy_perf comment
Define XEN_SYSCTL_CPPC_ACT_WINDOW_MASK from *_MANTISSA_MASK and *_EXPONENT_MASK
Re-order XEN_SYSCTL_CPPC_SET_* flags to match field and hardware order.
Remove const from set_cppc param to update set_params
Skip Activity Window if not supported by hardware and clear set_params
Make parameter parsing consistent
Add an exit path when there are no parameters to write.
Expand the header file to cover the IN/OUT set_params.
Remove the "desired" lowest/highest checking as hardware clips internally

v4:
Remove IA32_ENERGY_BIAS support
Validate parameters don't exceed 255
Use CPPC/cppc name
set_cppc_para() add const
set_cppc_para() return hwp_cpufreq_target()
Expand sysctl comments

v3:
Remove cpufreq_governor_internal from set_cpufreq_hwp

v2:
Update for naming anonymous union
Drop hwp_err for invalid input in set_hwp_para()
Drop uint16_t cast in XEN_SYSCTL_HWP_SET_PARAM_MASK
Drop parens for HWP_SET_PRESET defines
Reference activity_window format comment
Place SET_CPUFREQ_HWP after SET_CPUFREQ_PARA
Add {HWP,IA32}_ENERGY_PERF_MAX_{PERFORMANCE,POWERSAVE} defines
Order defines before fields in sysctl.h
Use XEN_HWP_GOVERNOR
Use per_cpu for hwp_drv_data
---
 xen/arch/x86/acpi/cpufreq/hwp.c    | 102 +++++++++++++++++++++++++++++
 xen/drivers/acpi/pmstat.c          |  17 +++++
 xen/include/acpi/cpufreq/cpufreq.h |   2 +
 xen/include/public/sysctl.h        |  64 ++++++++++++++++++
 4 files changed, 185 insertions(+)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index 2cbfa1ce33..f6d445a8eb 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -21,6 +21,10 @@ static bool __ro_after_init feature_hdc;
 
 static bool __ro_after_init opt_cpufreq_hdc = true;
 
+#define HWP_ENERGY_PERF_MAX_PERFORMANCE 0
+#define HWP_ENERGY_PERF_BALANCE         0x80
+#define HWP_ENERGY_PERF_MAX_POWERSAVE   0xff
+
 union hwp_request
 {
     struct
@@ -542,6 +546,104 @@ int get_hwp_para(unsigned int cpu,
     return 0;
 }
 
+int set_hwp_para(struct cpufreq_policy *policy,
+                 struct xen_set_cppc_para *set_cppc)
+{
+    unsigned int cpu = policy->cpu;
+    struct hwp_drv_data *data = per_cpu(hwp_drv_data, cpu);
+    bool cleared_act_window = false;
+
+    if ( data == NULL )
+        return -ENOENT;
+
+    /* Validate all parameters - Disallow reserved bits. */
+    if ( set_cppc->minimum > 255 ||
+         set_cppc->maximum > 255 ||
+         set_cppc->desired > 255 ||
+         set_cppc->energy_perf > 255 ||
+         (set_cppc->set_params & ~XEN_SYSCTL_CPPC_SET_PARAM_MASK) ||
+         (set_cppc->activity_window & ~XEN_SYSCTL_CPPC_ACT_WINDOW_MASK) )
+        return -EINVAL;
+
+    /* Only allow values if params bit is set. */
+    if ( (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_DESIRED) &&
+          set_cppc->desired) ||
+         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_MINIMUM) &&
+          set_cppc->minimum) ||
+         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_MAXIMUM) &&
+          set_cppc->maximum) ||
+         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ENERGY_PERF) &&
+          set_cppc->energy_perf) ||
+         (!(set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ACT_WINDOW) &&
+          set_cppc->activity_window) )
+        return -EINVAL;
+
+    /* Clear out activity window if lacking HW supported. */
+    if ( (set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ACT_WINDOW) &&
+         !feature_hwp_activity_window )
+    {
+        set_cppc->set_params &= ~XEN_SYSCTL_CPPC_SET_ACT_WINDOW;
+        cleared_act_window = true;
+    }
+
+    /* Return if there is nothing to do. */
+    if ( set_cppc->set_params == 0 )
+        return 0;
+
+    /* Apply presets */
+    switch ( set_cppc->set_params & XEN_SYSCTL_CPPC_SET_PRESET_MASK )
+    {
+    case XEN_SYSCTL_CPPC_SET_PRESET_POWERSAVE:
+        data->minimum = data->hw.lowest;
+        data->maximum = data->hw.lowest;
+        data->activity_window = 0;
+        data->energy_perf = HWP_ENERGY_PERF_MAX_POWERSAVE;
+        data->desired = 0;
+        break;
+
+    case XEN_SYSCTL_CPPC_SET_PRESET_PERFORMANCE:
+        data->minimum = data->hw.highest;
+        data->maximum = data->hw.highest;
+        data->activity_window = 0;
+        data->energy_perf = HWP_ENERGY_PERF_MAX_PERFORMANCE;
+        data->desired = 0;
+        break;
+
+    case XEN_SYSCTL_CPPC_SET_PRESET_BALANCE:
+        data->minimum = data->hw.lowest;
+        data->maximum = data->hw.highest;
+        data->activity_window = 0;
+        data->energy_perf = HWP_ENERGY_PERF_BALANCE;
+        data->desired = 0;
+        break;
+
+    case XEN_SYSCTL_CPPC_SET_PRESET_NONE:
+        break;
+
+    default:
+        return -EINVAL;
+    }
+
+    /* Further customize presets if needed */
+    if ( set_cppc->set_params & XEN_SYSCTL_CPPC_SET_MINIMUM )
+        data->minimum = set_cppc->minimum;
+
+    if ( set_cppc->set_params & XEN_SYSCTL_CPPC_SET_MAXIMUM )
+        data->maximum = set_cppc->maximum;
+
+    if ( set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ENERGY_PERF )
+        data->energy_perf = set_cppc->energy_perf;
+
+    if ( set_cppc->set_params & XEN_SYSCTL_CPPC_SET_DESIRED )
+        data->desired = set_cppc->desired;
+
+    if ( set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ACT_WINDOW )
+        data->activity_window = set_cppc->activity_window &
+                                XEN_SYSCTL_CPPC_ACT_WINDOW_MASK;
+
+    return hwp_cpufreq_target(policy, 0, 0);
+}
+
 int __init hwp_register_driver(void)
 {
     int ret;
diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index e4e2df94a7..85097d463c 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -400,6 +400,19 @@ static int set_cpufreq_para(struct xen_sysctl_pm_op *op)
     return ret;
 }
 
+static int set_cpufreq_cppc(struct xen_sysctl_pm_op *op)
+{
+    struct cpufreq_policy *policy = per_cpu(cpufreq_cpu_policy, op->cpuid);
+
+    if ( !policy || !policy->governor )
+        return -ENOENT;
+
+    if ( !hwp_active() )
+        return -EOPNOTSUPP;
+
+    return set_hwp_para(policy, &op->u.set_cppc);
+}
+
 int do_pm_op(struct xen_sysctl_pm_op *op)
 {
     int ret = 0;
@@ -472,6 +485,10 @@ int do_pm_op(struct xen_sysctl_pm_op *op)
         break;
     }
 
+    case SET_CPUFREQ_CPPC:
+        ret = set_cpufreq_cppc(op);
+        break;
+
     case GET_CPUFREQ_AVGFREQ:
     {
         op->u.get_avgfreq = cpufreq_driver_getavg(op->cpuid, USR_GETAVG);
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index f90e9d3a6c..281e3f513d 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -257,5 +257,7 @@ int hwp_register_driver(void);
 bool hwp_active(void);
 int get_hwp_para(unsigned int cpu,
                  struct xen_cppc_para *cppc_para);
+int set_hwp_para(struct cpufreq_policy *policy,
+                 struct xen_set_cppc_para *set_cppc);
 
 #endif /* __XEN_CPUFREQ_PM_H__ */
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index cf27f8f2f9..3975050248 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -351,6 +351,68 @@ struct xen_cppc_para {
     uint32_t activity_window;
 };
 
+/*
+ * Set CPPC values.
+ *
+ * Configure the parameters for CPPC.  Set bits in set_params control which
+ * values are applied.  If a bit is not set in set_params, the field must be
+ * zero.
+ *
+ * For HWP specifically, values must be limited to 0-255 or within
+ * XEN_SYSCTL_CPPC_ACT_WINDOW_MASK for activity window.  Set bits outside the
+ * range will be returned as -EINVAL.
+ *
+ * Activity Window may not be supported by the hardware.  In that case, the
+ * returned set_params will clear XEN_SYSCTL_CPPC_SET_ACT_WINDOW to indicate
+ * that it was not applied - though the rest of the values will be applied.
+ *
+ * There are a set of presets along with individual fields.  Presets are
+ * applied first, and then individual fields.  This allows customizing
+ * a preset without having to specify every value.
+ *
+ * The preset options values are as follows:
+ *
+ * preset      | minimum | maxium  | energy_perf
+ * ------------+---------+---------+----------------
+ * powersave   | lowest  | lowest  | powersave (255)
+ * ------------+---------+---------+----------------
+ * balance     | lowest  | highest | balance (128)
+ * ------------+---------+---------+----------------
+ * performance | highest | highest | performance (0)
+ *
+ * desired and activity_window are set to 0, hardware selected.
+ */
+struct xen_set_cppc_para {
+#define XEN_SYSCTL_CPPC_SET_MINIMUM              (1U << 0)
+#define XEN_SYSCTL_CPPC_SET_MAXIMUM              (1U << 1)
+#define XEN_SYSCTL_CPPC_SET_DESIRED              (1U << 2)
+#define XEN_SYSCTL_CPPC_SET_ENERGY_PERF          (1U << 3)
+#define XEN_SYSCTL_CPPC_SET_ACT_WINDOW           (1U << 4)
+#define XEN_SYSCTL_CPPC_SET_PRESET_MASK          0xf0000000U
+#define XEN_SYSCTL_CPPC_SET_PRESET_NONE          0x00000000U
+#define XEN_SYSCTL_CPPC_SET_PRESET_BALANCE       0x10000000U
+#define XEN_SYSCTL_CPPC_SET_PRESET_POWERSAVE     0x20000000U
+#define XEN_SYSCTL_CPPC_SET_PRESET_PERFORMANCE   0x30000000U
+#define XEN_SYSCTL_CPPC_SET_PARAM_MASK \
+        (XEN_SYSCTL_CPPC_SET_PRESET_MASK | \
+         XEN_SYSCTL_CPPC_SET_MINIMUM     | \
+         XEN_SYSCTL_CPPC_SET_MAXIMUM     | \
+         XEN_SYSCTL_CPPC_SET_DESIRED     | \
+         XEN_SYSCTL_CPPC_SET_ENERGY_PERF | \
+         XEN_SYSCTL_CPPC_SET_ACT_WINDOW  )
+    /* IN/OUT */
+    uint32_t set_params; /* bitflags for valid values */
+    /* See comments in struct xen_cppc_para. */
+    /* IN */
+    uint32_t minimum;
+    uint32_t maximum;
+    uint32_t desired;
+    uint32_t energy_perf;
+#define XEN_SYSCTL_CPPC_ACT_WINDOW_MASK (XEN_CPPC_ACT_WINDOW_MANTISSA_MASK | \
+                                         XEN_CPPC_ACT_WINDOW_EXPONENT_MASK)
+    uint32_t activity_window;
+};
+
 #define XEN_HWP_DRIVER_NAME "hwp"
 
 /*
@@ -418,6 +480,7 @@ struct xen_sysctl_pm_op {
     #define SET_CPUFREQ_GOV            (CPUFREQ_PARA | 0x02)
     #define SET_CPUFREQ_PARA           (CPUFREQ_PARA | 0x03)
     #define GET_CPUFREQ_AVGFREQ        (CPUFREQ_PARA | 0x04)
+    #define SET_CPUFREQ_CPPC           (CPUFREQ_PARA | 0x05)
 
     /* set/reset scheduler power saving option */
     #define XEN_SYSCTL_pm_op_set_sched_opt_smt    0x21
@@ -444,6 +507,7 @@ struct xen_sysctl_pm_op {
         struct xen_get_cpufreq_para get_para;
         struct xen_set_cpufreq_gov  set_gov;
         struct xen_set_cpufreq_para set_para;
+        struct xen_set_cppc_para    set_cppc;
         uint64_aligned_t get_avgfreq;
         uint32_t                    set_sched_opt_smt;
 #define XEN_SYSCTL_CX_UNLIMITED 0xffffffffU
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 17:17:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 17:17:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570663.892723 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi8a-0004BH-3s; Wed, 26 Jul 2023 17:17:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570663.892723; Wed, 26 Jul 2023 17:17:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOi8Z-00047y-SP; Wed, 26 Jul 2023 17:17:23 +0000
Received: by outflank-mailman (input) for mailman id 570663;
 Wed, 26 Jul 2023 17:17:21 +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
 <SRS0=Pn9P=DM=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qOi2p-0005nP-6l
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 17:11:27 +0000
Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com
 [2607:f8b0:4864:20::f34])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 72e669bf-2bd7-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 19:11:24 +0200 (CEST)
Received: by mail-qv1-xf34.google.com with SMTP id
 6a1803df08f44-63d1238c300so549856d6.0
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 10:11:25 -0700 (PDT)
Received: from pm2-ws13.praxislan02.com
 (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com.
 [207.172.141.204]) by smtp.gmail.com with ESMTPSA id
 s17-20020a0ca611000000b0063d1aa446e2sm1248019qva.59.2023.07.26.10.11.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 10:11:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 72e669bf-2bd7-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690391483; x=1690996283;
        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=gblVHwIRoZ9Cb4sFC+wqThP0YWJWsFM4Sph0J9w8nz0=;
        b=D/SWrGlHIE6OS7AXo5KLJiE8Br+n1jnkH8WKomZZqlzMcviXZe6PTZcGcfUgKTxe8a
         3oQErkwbUYqbAqDx+IRKwL9ga+YX3e8MxaMs0B4YsVQoC1T2oxa8J3HRtmkfiUB+4xZP
         5VIymmdRpDDx0gvaY9XOJ4T9GmQQUgx8zAkcyRtvdLxgSUOY2vEtm10Ykbn/LP1ZWimu
         TUdZqItCoczrq8MuUswS+/7u/l1a+vyAt10dwfAr2T3NCubAUcEbh14PPHKjSmE6I7C9
         dFaHM8B54aYbIOp2KnQeYBHxgvTPWIq9YKtQdJQAgsAxbCfFWKvts9rmz4jpfZt8ZBM8
         vY/w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690391483; x=1690996283;
        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=gblVHwIRoZ9Cb4sFC+wqThP0YWJWsFM4Sph0J9w8nz0=;
        b=XnrtUUONlgl2sCOO+nRy9q+I15JJF5TFEd7hHBg4eY+/30jtS5NlcIngInUi+Of/2X
         MmHdBA+k3GqW1de8INNZaKobzWMf4VOK1VfWK/k37M/HvTI1jdUeCXQ03XKJUAe+QdpX
         PL8okvevPhcTDfm4OrpvBqKot+LJuTYeSIpBmEuz0xvwgvPfOPvgTLSOAnbZu4ZtHdzD
         Bt/dE/YzuLgdhAuCDlTrcxsHGUULiLertuodZmHhISb+YeNGJ64Bthz9OCAZ4bC1Tmp+
         fu1aNWonT1tPrd419Gw9wDFp+GqkqNJr/JZzqe5tHYw80WQjdv/3xvEUBYEcW6jarD1/
         Ok+g==
X-Gm-Message-State: ABy/qLYY3Jrsk42sOJCbo/hiMmfbLAbYAJG7L2nFRk/2VU7mZLDpwN1O
	pw7GJ1d/hHogrzjNw+EMF3JQparLTn0=
X-Google-Smtp-Source: APBJJlG2mAz/7i4T/ZOBnN5tJ9K+wAlzEb7gRCKFXz3COj83bkobJ2TfnYtmAcMUvOa/JCwPEV69zA==
X-Received: by 2002:a05:6214:80b:b0:631:6eea:c4f0 with SMTP id df11-20020a056214080b00b006316eeac4f0mr2169372qvb.48.1690391483494;
        Wed, 26 Jul 2023 10:11:23 -0700 (PDT)
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jason Andryuk <jandryuk@gmail.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v7 14/15] xenpm: Add set-cpufreq-cppc subcommand
Date: Wed, 26 Jul 2023 13:09:44 -0400
Message-ID: <20230726170945.34961-15-jandryuk@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726170945.34961-1-jandryuk@gmail.com>
References: <20230726170945.34961-1-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

set-cpufreq-cppc allows setting the Hardware P-State (HWP) parameters.

It can be run on all or just a single cpu.  There are presets of
balance, powersave & performance.  Those can be further tweaked by
param:val arguments as explained in the usage description.

Parameter names are just checked to the first 3 characters to shorten
typing.

Some options are hardware dependent, and ranges can be found in
get-cpufreq-para.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v5:
Make i unsigned int
Use local max_cpuid instead of max_cpu_nr
Add Jan's Ack
Check set_params and print a message if activity window wasn't set

v4:
Remove energy bias 0-15 & 7 references
Use MASK_INSR
Fixup { placement
Drop extra case in parse_activity_window
strcmp suffix
Expand help text
s/hwp/cppc/
Use isdigit() to check cpuid - otherwise run on all CPUs.

v2:
Compare provided parameter name and not just 3 characters.
Use "-" in parameter names
Remove hw_
Replace sscanf with strchr & strtoul.
Remove toplevel error message with lower level ones.
Help text s/127/128/
Help text mention truncation.
Avoid some truncation rounding down by adding 5 before division.
Help test mention default microseconds
Also comment the limit check written to avoid overflow.
---
 tools/misc/xenpm.c | 244 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 244 insertions(+)

diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 3abd99fd20..0877f43946 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -16,6 +16,8 @@
  */
 #define MAX_NR_CPU 512
 
+#include <ctype.h>
+#include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -67,6 +69,30 @@ void show_help(void)
             " set-max-cstate        <num>|'unlimited' [<num2>|'unlimited']\n"
             "                                     set the C-State limitation (<num> >= 0) and\n"
             "                                     optionally the C-sub-state limitation (<num2> >= 0)\n"
+            " set-cpufreq-cppc      [cpuid] [balance|performance|powersave] <param:val>*\n"
+            "                                     set Hardware P-State (HWP) parameters\n"
+            "                                     on CPU <cpuid> or all if omitted.\n"
+            "                                     optionally a preset of one of:\n"
+            "                                       balance|performance|powersave\n"
+            "                                     an optional list of param:val arguments\n"
+            "                                       minimum:N (0-255)\n"
+            "                                       maximum:N (0-255)\n"
+            "                                           get-cpufreq-para lowest/highest\n"
+            "                                           values are limits for\n"
+            "                                           minumum/maximum.\n"
+            "                                       desired:N (0-255)\n"
+            "                                           set explicit performance target.\n"
+            "                                           non-zero disables auto-HWP mode.\n"
+            "                                       energy-perf:N (0-255)\n"
+            "                                                   energy/performance hint\n"
+            "                                                   lower - favor performance\n"
+            "                                                   higher - favor powersave\n"
+            "                                                   128 - balance\n"
+            "                                       act-window:N{,m,u}s range 1us-1270s\n"
+            "                                           window for internal calculations.\n"
+            "                                           units default to \"us\" if unspecified.\n"
+            "                                           truncates un-representable values.\n"
+            "                                           0 lets the hardware decide.\n"
             " start [seconds]                     start collect Cx/Px statistics,\n"
             "                                     output after CTRL-C or SIGINT or several seconds.\n"
             " enable-turbo-mode     [cpuid]       enable Turbo Mode for processors that support it.\n"
@@ -1292,6 +1318,223 @@ void disable_turbo_mode(int argc, char *argv[])
                 errno, strerror(errno));
 }
 
+/*
+ * Parse activity_window:NNN{us,ms,s} and validate range.
+ *
+ * Activity window is a 7bit mantissa (0-127) with a 3bit exponent (0-7) base
+ * 10 in microseconds.  So the range is 1 microsecond to 1270 seconds.  A value
+ * of 0 lets the hardware autonomously select the window.
+ *
+ * Return 0 on success
+ *       -1 on error
+ */
+static int parse_activity_window(xc_set_cppc_para_t *set_cppc, unsigned long u,
+                                 const char *suffix)
+{
+    unsigned int exponent = 0;
+    unsigned int multiplier = 1;
+
+    if ( suffix && suffix[0] )
+    {
+        if ( strcmp(suffix, "s") == 0 )
+        {
+            multiplier = 1000 * 1000;
+            exponent = 6;
+        }
+        else if ( strcmp(suffix, "ms") == 0 )
+        {
+            multiplier = 1000;
+            exponent = 3;
+        }
+        else if ( strcmp(suffix, "us") != 0 )
+        {
+            fprintf(stderr, "invalid activity window units: \"%s\"\n", suffix);
+
+            return -1;
+        }
+    }
+
+    /* u * multipler > 1270 * 1000 * 1000 transformed to avoid overflow. */
+    if ( u > 1270 * 1000 * 1000 / multiplier )
+    {
+        fprintf(stderr, "activity window is too large\n");
+
+        return -1;
+    }
+
+    /* looking for 7 bits of mantissa and 3 bits of exponent */
+    while ( u > 127 )
+    {
+        u += 5; /* Round up to mitigate truncation rounding down
+                   e.g. 128 -> 120 vs 128 -> 130. */
+        u /= 10;
+        exponent += 1;
+    }
+
+    set_cppc->activity_window =
+        MASK_INSR(exponent, XEN_CPPC_ACT_WINDOW_EXPONENT_MASK) |
+        MASK_INSR(u, XEN_CPPC_ACT_WINDOW_MANTISSA_MASK);
+    set_cppc->set_params |= XEN_SYSCTL_CPPC_SET_ACT_WINDOW;
+
+    return 0;
+}
+
+static int parse_cppc_opts(xc_set_cppc_para_t *set_cppc, int *cpuid,
+                           int argc, char *argv[])
+{
+    int i = 0;
+
+    if ( argc < 1 )
+    {
+        fprintf(stderr, "Missing arguments\n");
+        return -1;
+    }
+
+    if ( isdigit(argv[i][0]) )
+    {
+        if ( sscanf(argv[i], "%d", cpuid) != 1 || *cpuid < 0 )
+        {
+            fprintf(stderr, "Could not parse cpuid \"%s\"\n", argv[i]);
+            return -1;
+        }
+
+        i++;
+    }
+
+    if ( i == argc )
+    {
+        fprintf(stderr, "Missing arguments\n");
+        return -1;
+    }
+
+    if ( strcasecmp(argv[i], "powersave") == 0 )
+    {
+        set_cppc->set_params = XEN_SYSCTL_CPPC_SET_PRESET_POWERSAVE;
+        i++;
+    }
+    else if ( strcasecmp(argv[i], "performance") == 0 )
+    {
+        set_cppc->set_params = XEN_SYSCTL_CPPC_SET_PRESET_PERFORMANCE;
+        i++;
+    }
+    else if ( strcasecmp(argv[i], "balance") == 0 )
+    {
+        set_cppc->set_params = XEN_SYSCTL_CPPC_SET_PRESET_BALANCE;
+        i++;
+    }
+
+    for ( ; i < argc; i++)
+    {
+        unsigned long val;
+        char *param = argv[i];
+        char *value;
+        char *suffix;
+        int ret;
+
+        value = strchr(param, ':');
+        if ( value == NULL )
+        {
+            fprintf(stderr, "\"%s\" is an invalid cppc parameter\n", argv[i]);
+            return -1;
+        }
+
+        value[0] = '\0';
+        value++;
+
+        errno = 0;
+        val = strtoul(value, &suffix, 10);
+        if ( (errno && val == ULONG_MAX) || value == suffix )
+        {
+            fprintf(stderr, "Could not parse number \"%s\"\n", value);
+            return -1;
+        }
+
+        if ( strncasecmp(param, "act-window", strlen(param)) == 0 )
+        {
+            ret = parse_activity_window(set_cppc, val, suffix);
+            if (ret)
+                return -1;
+
+            continue;
+        }
+
+        if ( val > 255 )
+        {
+            fprintf(stderr, "\"%s\" value \"%lu\" is out of range\n", param,
+                    val);
+            return -1;
+        }
+
+        if ( suffix && suffix[0] )
+        {
+            fprintf(stderr, "Suffix \"%s\" is invalid\n", suffix);
+            return -1;
+        }
+
+        if ( strncasecmp(param, "minimum", MAX(2, strlen(param))) == 0 )
+        {
+            set_cppc->minimum = val;
+            set_cppc->set_params |= XEN_SYSCTL_CPPC_SET_MINIMUM;
+        }
+        else if ( strncasecmp(param, "maximum", MAX(2, strlen(param))) == 0 )
+        {
+            set_cppc->maximum = val;
+            set_cppc->set_params |= XEN_SYSCTL_CPPC_SET_MAXIMUM;
+        }
+        else if ( strncasecmp(param, "desired", strlen(param)) == 0 )
+        {
+            set_cppc->desired = val;
+            set_cppc->set_params |= XEN_SYSCTL_CPPC_SET_DESIRED;
+        }
+        else if ( strncasecmp(param, "energy-perf", strlen(param)) == 0 )
+        {
+            set_cppc->energy_perf = val;
+            set_cppc->set_params |= XEN_SYSCTL_CPPC_SET_ENERGY_PERF;
+        }
+        else
+        {
+            fprintf(stderr, "\"%s\" is an invalid parameter\n", param);
+            return -1;
+        }
+    }
+
+    if ( set_cppc->set_params == 0 )
+    {
+        fprintf(stderr, "No parameters set in request\n");
+        return -1;
+    }
+
+    return 0;
+}
+
+static void cppc_set_func(int argc, char *argv[])
+{
+    xc_set_cppc_para_t set_cppc = {};
+    unsigned int max_cpuid = max_cpu_nr;
+    int cpuid = -1;
+    unsigned int i = 0;
+    uint32_t set_params;
+
+    if ( parse_cppc_opts(&set_cppc, &cpuid, argc, argv) )
+        exit(EINVAL);
+
+    if ( cpuid != -1 )
+    {
+        i = cpuid;
+        max_cpuid = i + 1;
+    }
+
+    set_params = set_cppc.set_params;
+    for ( ; i < max_cpuid; i++ ) {
+        if ( xc_set_cpufreq_cppc(xc_handle, i, &set_cppc) )
+            fprintf(stderr, "[CPU%d] failed to set cppc params (%d - %s)\n",
+                    i, errno, strerror(errno));
+    }
+
+    if ( (set_params ^ set_cppc.set_params) & XEN_SYSCTL_CPPC_SET_ACT_WINDOW )
+        printf("Activity window not supported and omitted\n");
+}
+
 struct {
     const char *name;
     void (*function)(int argc, char *argv[]);
@@ -1302,6 +1545,7 @@ struct {
     { "get-cpufreq-average", cpufreq_func },
     { "start", start_gather_func },
     { "get-cpufreq-para", cpufreq_para_func },
+    { "set-cpufreq-cppc", cppc_set_func },
     { "set-scaling-maxfreq", scaling_max_freq_func },
     { "set-scaling-minfreq", scaling_min_freq_func },
     { "set-scaling-governor", scaling_governor_func },
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 26 18:40:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 18:40:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570687.892750 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOjQN-0006J7-B4; Wed, 26 Jul 2023 18:39:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570687.892750; Wed, 26 Jul 2023 18:39:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOjQN-0006J0-8I; Wed, 26 Jul 2023 18:39:51 +0000
Received: by outflank-mailman (input) for mailman id 570687;
 Wed, 26 Jul 2023 18:39:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=oEth=DM=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qOjQM-0006Iu-9y
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 18:39:50 +0000
Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com
 [2a00:1450:4864:20::133])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cc720c75-2be3-11ee-b243-6b7b168915f2;
 Wed, 26 Jul 2023 20:39:48 +0200 (CEST)
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-4fde022de07so169967e87.1
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 11:39:48 -0700 (PDT)
Received: from [192.168.202.116] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 h4-20020ac25964000000b004fe142afd1esm217505lfp.152.2023.07.26.11.39.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 11:39:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cc720c75-2be3-11ee-b243-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690396788; x=1691001588;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=M74KkJWeLhXF7Leg8AJ/X7+H++Tcs2iotik08Z3CZAk=;
        b=Hj32TAUfFhWjCbyFr/FTlDfQTedJcHxshSt3fLNptNH/miHbAVGTQX2mgK9gIH0w4N
         uRsZVMFDtImOarr0nlS4jSbULvhhxjNZ0chSQmpuEcqxNSTpuvaPqibKcq6US0jcP3nh
         JVfZyst93Nj5utKGUR7ujeowZ8EG0Bgym/Bq/TkA0vtMrMFOIAvKEJSDu8MwZxgKX3fE
         cRZoSEbX/wLD2fJp5Fu6OIM+0KCBnTf+A0GIbtcnrB7SYXrsQgcr3SnoOjRLr5ayvJdE
         /7OPVEEGq6CbLaZTBHDrRdW+VNsdcCvJtiQH7Swtl1BCHh8z+bNJwAP8Gzynywass7dl
         vc/g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690396788; x=1691001588;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=M74KkJWeLhXF7Leg8AJ/X7+H++Tcs2iotik08Z3CZAk=;
        b=ZJYAot+IO7z1w7LWdGhMbtMd4uyJx3PP/1WCqeKS2uuUPXJbnZz0xBT+wl7us8P9cZ
         siMQcfdHHqr5wGRplaCDen8oxhwKzCmx1cXuak0XmNAJ9+UpBMxaW5XJJJEA5cR3uQHN
         FLIY1YvkS80u49ti9uOzc9EIDh7oLDmXdSZZgsCThdRinZyfvjLuwgfjlaUVaPcTy9uF
         jTMQJPU1zG7gMBdkiPabcMmVGRNJG9F0Ydb7sDglWcHGW0fHPgzbXDwO7RXeylDVP7OX
         PlEgLlKG0J2cxG1mo7nV2Xr33T6O8ux+F6TGGGYSdS16SSg2HkpzefkyM2y3dZ7pChdV
         GYCQ==
X-Gm-Message-State: ABy/qLbVDs5Kmxn0fUsxh+kxvzwSuvm3XOyTHqE/KQKrSLdn2BqTT8dw
	BeSMrMBKinUVCG7AtdE67b4=
X-Google-Smtp-Source: APBJJlHJvbo9x7CqkCFgI2JGqDCqQMih7Q65Mz9B1ICJ8Qp5BZ+r5qca8DTC7sbM2aSjXjINQA37Xw==
X-Received: by 2002:a05:6512:1146:b0:4fb:a990:bb28 with SMTP id m6-20020a056512114600b004fba990bb28mr17697lfg.18.1690396787456;
        Wed, 26 Jul 2023 11:39:47 -0700 (PDT)
Message-ID: <b219699f928b9e86a3b0af9656bfe0e083d3cfdc.camel@gmail.com>
Subject: Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Bob Eshleman
	 <bobbyeshleman@gmail.com>, Alistair Francis <alistair.francis@wdc.com>, 
	Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
Date: Wed, 26 Jul 2023 21:39:46 +0300
In-Reply-To: <79b20131-46c2-9e54-e615-18a346b83b8d@suse.com>
References: <cover.1690191480.git.oleksii.kurochko@gmail.com>
	 <a8ab1829ab718dda869db3df3348ded211e81967.1690191480.git.oleksii.kurochko@gmail.com>
	 <a370548e30aaa8c1160ecd5f2eccfcc10002a8f9.camel@gmail.com>
	 <6675f535-7cf7-dd55-4ebe-82ba486029f7@suse.com>
	 <4deb8c44cf639af66ad7f5b9b42180554e08d5cf.camel@gmail.com>
	 <5a40abd4-edc2-0de0-99ed-d23174940d66@suse.com>
	 <dee3624525f9530aaf3252c6c4fa6eb5262e76cd.camel@gmail.com>
	 <79b20131-46c2-9e54-e615-18a346b83b8d@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Wed, 2023-07-26 at 17:59 +0200, Jan Beulich wrote:
> On 26.07.2023 17:54, Oleksii wrote:
> > On Wed, 2023-07-26 at 17:00 +0200, Jan Beulich wrote:
> > > On 26.07.2023 15:12, Oleksii wrote:
> > > > On Wed, 2023-07-26 at 13:58 +0200, Jan Beulich wrote:
> > > > > On 26.07.2023 13:23, Oleksii wrote:
> > > > > > I would like to ask for advice on whether it would be
> > > > > > easier,
> > > > > > less
> > > > > > bug-
> > > > > > provoking ( during identity mapping to remove of whole Xen
> > > > > > ) to
> > > > > > have a
> > > > > > separate identity section that won't be more than
> > > > > > PAGE_SIZE.
> > > > >=20
> > > > > I'm afraid you can't safely do this in C, or at least not
> > > > > without
> > > > > further checking on what the compiler actually did.
> > > > >=20
> > > > > > @@ -264,6 +268,19 @@ void __init enable_mmu(void)
> > > > > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0RV_STAGE=
1_MODE << SATP_MODE_SHIFT);
> > > > > > =C2=A0}
> > > > > > =C2=A0
> > > > > > +void __attribute__((naked)) __section(".ident")
> > > > > > turn_on_mmu(unsigned
> > > > > > long ra)
> > > > >=20
> > > > > Did you read what gcc doc says about "naked"? Extended asm()
> > > > > isn't
> > > > > supported there. Since ...
> > > > >=20
> > > > > > +{
> > > > > > + =C2=A0 =C2=A0/* Ensure page table writes precede loading the =
SATP
> > > > > > */
> > > > > > + =C2=A0 =C2=A0sfence_vma();
> > > > > > +
> > > > > > + =C2=A0 =C2=A0/* Enable the MMU and load the new pagetable for=
 Xen
> > > > > > */
> > > > > > + =C2=A0 =C2=A0csr_write(CSR_SATP,
> > > > > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PFN_DOWN((uns=
igned long)stage1_pgtbl_root) |
> > > > > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0RV_STAGE1_MOD=
E << SATP_MODE_SHIFT);
> > > > > > +
> > > > > > + =C2=A0 =C2=A0asm volatile( "jr %0\n" : : "r"(ra) );
> > > > > > +}
> > > > >=20
> > > > > ... none of this really requires C, I think we're at the
> > > > > point
> > > > > where
> > > > > (iirc) Andrew's and my suggestion wants following, moving
> > > > > this to
> > > > > assembly code (at which point it doesn't need to be a
> > > > > separate
> > > > > function). You can still build page tables in C, of course.
> > > > > (Likely
> > > > > you then also won't need a separate section; some minimal
> > > > > alignment
> > > > > guarantees ought to suffice to make sure the critical code is
> > > > > confined to a single page.)
> > > >=20
> > > > Thanks. I'll move all of this to assembly code.
> > > > Regarding alignment it is needed alignment on start and end of
> > > > function:
> > > > =C2=A0=C2=A0=C2=A0 .balign PAGE_SIZE
> > > > =C2=A0=C2=A0=C2=A0 GLOBAL(turn_on_mmu)
> > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ...
> > > > =C2=A0=C2=A0=C2=A0 .balign PAGE_SIZE
> > > > =C2=A0=C2=A0=C2=A0 ENDPROC(turn_on_mmu)
> > > >=20
> > > > Does the better way exist?
> > >=20
> > > The function is only going to be a handful of instructions. Its
> > > alignment doesn't need to be larger than the next power of 2. I
> > > expect you'll be good with 64-byte alignment. (In no case do you
> > > need to align the end of the function: Putting other stuff there
> > > is not a problem at all.) What you want in any event is a build
> > > time check that the within-a-page constraint is met.
> > But shouldn't be an address be aligned to a boundary equal to page
> > size?
> >=20
> > According to the RISC-V privileged spec:
> > Any level of PTE may be a leaf PTE, so in addition to 4 KiB pages,
> > Sv39
> > supports 2 MiB megapages
> > and 1 GiB gigapages, each of which must be virtually and physically
> > aligned to a boundary equal
> > to its size. A page-fault exception is raised if the physical
> > address
> > is insufficiently aligned.
>=20
> You'd simply map the page containing the chunk, i.e. masking off the
> low 12 bits. If far enough away from the Xen virtual range, you could
> as well map a 2M page masking off the low 21 bits, or a 1G page with
> the low 30 bits of the address cleared.
Agree, then it will work.

But still it doesn't clear what to do if turn_on_mmu will be bigger
then 64 ( ASSERT( (turn_on_mmu_end - turn_on_mmu) <=3D 64 ) somewhere in
xen.lds.S ). Right now turn_on_mmu() function is 0x22 bytes and it is
enough ( we are sure that we don't cross 4k boundary ) to be 64-byte
aligned. But if the size will be more then 64 bytes then the alignment
need to be changed to 0x128.
Am i right?


~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 21:32:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 21:32:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570693.892761 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOm71-0007am-5y; Wed, 26 Jul 2023 21:32:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570693.892761; Wed, 26 Jul 2023 21:32:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOm71-0007af-1k; Wed, 26 Jul 2023 21:32:03 +0000
Received: by outflank-mailman (input) for mailman id 570693;
 Wed, 26 Jul 2023 21:32:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOm70-0007aV-8F; Wed, 26 Jul 2023 21:32:02 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOm70-0006Jd-4B; Wed, 26 Jul 2023 21:32:02 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOm6z-0005pG-J8; Wed, 26 Jul 2023 21:32:01 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOm6z-0007wX-Ij; Wed, 26 Jul 2023 21:32:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=iwmYBbHkAi7zYpC6Ih7kKFCDn+F1sy0YbBR1z8/vNuQ=; b=kS/mlFpO5IZfXTSRNLDd1VFLFD
	DZT6Fv86vQNp1G9IHJsOjpJaly1kNtE/41pkUrFp33sL1pcclsIixDLlkEP+w5hHUT4PRsrF0EM0o
	EyyytfjysM+QyQHkuL0MloQXXdJXoCgLLgUWd26dOkPN1WCMvVJ3eNDWzlNJo4FeVMQM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182012-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 182012: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-xl-vhd:guest-start:fail:heisenbug
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=0b1171be87698bc7d14760383c0770aeb6e41dd4
X-Osstest-Versions-That:
    xen=0c53c638e16278078371ce028c74693841d7738a
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 26 Jul 2023 21:32:01 +0000

flight 182012 xen-unstable real [real]
flight 182026 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/182012/
http://logs.test-lab.xenproject.org/osstest/logs/182026/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-vhd      13 guest-start         fail pass in 182026-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-vhd     14 migrate-support-check fail in 182026 never pass
 test-armhf-armhf-xl-vhd 15 saverestore-support-check fail in 182026 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 181987
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 181987
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 181987
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 181987
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 181987
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 181987
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 181987
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 181987
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 181987
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 181987
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 181987
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 181987
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 xen                  0b1171be87698bc7d14760383c0770aeb6e41dd4
baseline version:
 xen                  0c53c638e16278078371ce028c74693841d7738a

Last test of basis   181987  2023-07-24 01:53:36 Z    2 days
Failing since        182000  2023-07-24 17:07:02 Z    2 days    2 attempts
Testing same since   182012  2023-07-25 19:27:43 Z    1 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Federico Serafini <federico.serafini@bugseng.com>
  George Dunlap <george.dunlap@cloud.com>
  Jan Beulich <jbeulich@suse.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>
  Shawn Anastasio <sanastasio@raptorengineering.com>
  Stefano Stabellini <stefano.stabellini@amd.com>
  Viresh Kumar <viresh.kumar@linaro.org>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      fail    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   0c53c638e1..0b1171be87  0b1171be87698bc7d14760383c0770aeb6e41dd4 -> master


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 21:35:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 21:35:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570705.892798 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOmAb-00005Z-2D; Wed, 26 Jul 2023 21:35:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570705.892798; Wed, 26 Jul 2023 21:35:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOmAa-00005S-Vv; Wed, 26 Jul 2023 21:35:44 +0000
Received: by outflank-mailman (input) for mailman id 570705;
 Wed, 26 Jul 2023 21:35:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a+Ze=DM=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1qOmAY-00005M-SP
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 21:35:43 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on2061b.outbound.protection.outlook.com
 [2a01:111:f400:7eab::61b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5e40b386-2bfc-11ee-b244-6b7b168915f2;
 Wed, 26 Jul 2023 23:35:41 +0200 (CEST)
Received: from MW4PR04CA0066.namprd04.prod.outlook.com (2603:10b6:303:6b::11)
 by DM6PR12MB4075.namprd12.prod.outlook.com (2603:10b6:5:21d::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Wed, 26 Jul
 2023 21:35:34 +0000
Received: from CO1NAM11FT004.eop-nam11.prod.protection.outlook.com
 (2603:10b6:303:6b:cafe::c3) by MW4PR04CA0066.outlook.office365.com
 (2603:10b6:303:6b::11) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29 via Frontend
 Transport; Wed, 26 Jul 2023 21:35:33 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CO1NAM11FT004.mail.protection.outlook.com (10.13.175.89) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.6631.29 via Frontend Transport; Wed, 26 Jul 2023 21:35:33 +0000
Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 26 Jul
 2023 16:35:31 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB08.amd.com
 (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 26 Jul
 2023 14:35:20 -0700
Received: from [192.168.137.15] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend
 Transport; Wed, 26 Jul 2023 16:35:19 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5e40b386-2bfc-11ee-b244-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=fG7HyC2Bxe08k+RaQMOawaQeFM6vp1jaFnsg8slTnlDqiVryvIBNsQtYJbUADkihMhsDyf+RgKh4EabBnqjS6PYKPySqwGb8YpIaWYhCVa3zC/UdcX1zskl3GWPUXvFvnqKiVf0/qnSgMwAsqJcyVzOjbETOSDgXRXesGNhQ8d9IPaotUHgeWtAaxXUcXGfJTUzMx3e2LjlZwWfenBAgXR2rlRCNyKwe3Q3qME+KApgquru6j+EnRgevblN0elQ8Car7N19OoENsuefKZUj/bDRffVGpuDT6gWbPpmv8YsKeOAeiNSg2xIaHJAU9Oa2t9bXXA5S+MSeYTkqfXXVJaQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=VEtqnk7taNfauppgoMb1LMd6Ota8enF/Hph/uJAOkQA=;
 b=SA5in9qXJvbAcDCwJLD9fkr2yBPgHLqF2fSVpEdKUJ/zxFuvfQZk+M5zIsLKe+B6v1CBC6LRIpk6Ki74gP2M7Xs06MVlIdZMPW8/wwygsJekiu3lAP22NSevvVQ3kgUbO43UYMuhyD4t0MN7+Ezuc5Qcl6YcTgXu9Dan3bZoJF8j36+HSfkF84OILTuEjwOFauQMJF/SnU7TP8DWgquUfA6iyE2wKc2ytGR9o2MeZtxvOWWapl+6/Z2Cg3ptdlYPKAz8DK6kPPCrIOMrehZocv0pfjTLcGJ74+LB5VS089YN3rMwTYIFG3YVeuRIfVkzH34akQtYj5phbY76UaeSmg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=epam.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=VEtqnk7taNfauppgoMb1LMd6Ota8enF/Hph/uJAOkQA=;
 b=rpdQZnSZ9pKtcddnawBrcJoEbgq0ydpktraZNZCMZCZrVcRxj0JsCuUg25UijIwdDHf5EkEtytsJh2xpSI/bdoIA3WQU4csNbMJ6ncU/vcCfp+12aZqb7M8r3stwmZ8vnTs8aTU5rJruB7CHOuQNKwikU5YZKF37b7j3FCoEt5s=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <76fd0583-bb94-6159-0adf-89c67beaa64b@amd.com>
Date: Wed, 26 Jul 2023 17:35:26 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
Subject: Re: [PATCH v8 11/13] vpci: add initial support for virtual PCI bus
 topology
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>, Jan Beulich
	<jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-12-volodymyr_babchuk@epam.com>
Content-Language: en-US
In-Reply-To: <20230720003205.1828537-12-volodymyr_babchuk@epam.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1NAM11FT004:EE_|DM6PR12MB4075:EE_
X-MS-Office365-Filtering-Correlation-Id: 8d8158df-3dbb-4554-6681-08db8e203e29
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	qXE2Q+bcJYm940jYrkRQRldn/n9cCq58z0HJuKGHqtg30a0vZzgUoQGnRQs1gPEKG/nXKzmvb9yP72jchJiljO8eCMyvOom8a+OJICLTQv0G613ftmriTnkC/kx/AVmxgSFHPh9wF3WcX8JB1USUzfIK3zU9VDq/Of7aiVEmvvAmU9f7xYvugNjzVcNnm5qLHGwxdQJHn+7R8Bc+ZT/dmf6Bc3yZYpyVKerf2etguIR+ZGPBt4qCNCwAIE31Yzf0Gfq7OOwZ2ck/6nkyal7Touf7/s41pymwJGdi0KYYr8itNykwKGCdNsWGAoEFad8n/XvVmXr2XHrx7B+E0wfva+WKpsZLuKBWRAbCTxpM/L2ZCscX91ysCwGhq5Td5gFBLZIYbYRJPLtecNwwi4Hn9etAKWyGNNkuDgzIMJtKXJVKN0HW1KnluDq3MLvXo03SlPR8F55udpDxqi++rTfG6/+K4b7BoEL+oGOAzHXvurhFkpxOH5IkxsOyhlf5Xt/udvb+d+SBrd9xts7RcRLM3mzZCsGNmZ6JUJUbXgR3GQjGFuSXgJLPBBJJASmP+ONT8qUlgr+k7KS4T14U5p8n0YxAcPL4l0exMCzwurEZ1xVz9lcTd5z6b99txu5J1HgC5fzskMgUWxbEDxlSLQZSN2OOKhP+pAfiHFqKZ0fnqeWunmkjwddqQY69hZ/5pwegFtgR9cTQYD4fNZAbLjEnVB5B6ye5rmVEs+pExlslDHKWr2NugOdfeMm5vYeudWA/RDYLzy/x858ThnjNm7PbPlvMDUlGClVXmCJWpTpCWpk=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(376002)(346002)(451199021)(82310400008)(36840700001)(40470700004)(46966006)(316002)(16576012)(41300700001)(2906002)(44832011)(5660300002)(40460700003)(8936002)(8676002)(36756003)(31696002)(40480700001)(86362001)(26005)(53546011)(356005)(82740400003)(478600001)(6666004)(47076005)(83380400001)(36860700001)(186003)(426003)(336012)(2616005)(31686004)(70206006)(4326008)(110136005)(81166007)(54906003)(70586007)(36900700001)(43740500002);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 21:35:33.4492
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 8d8158df-3dbb-4554-6681-08db8e203e29
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1NAM11FT004.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4075

On 7/19/23 20:32, Volodymyr Babchuk wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> 
> Assign SBDF to the PCI devices being passed through with bus 0.
> The resulting topology is where PCIe devices reside on the bus 0 of the
> root complex itself (embedded endpoints).
> This implementation is limited to 32 devices which are allowed on
> a single PCI bus.
> 
> Please note, that at the moment only function 0 of a multifunction
> device can be passed through.
> 
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> ---
> Since v8:
> - Added write lock in add_virtual_device
> Since v6:
> - re-work wrt new locking scheme
> - OT: add ASSERT(pcidevs_write_locked()); to add_virtual_device()
> Since v5:
> - s/vpci_add_virtual_device/add_virtual_device and make it static
> - call add_virtual_device from vpci_assign_device and do not use
>   REGISTER_VPCI_INIT machinery
> - add pcidevs_locked ASSERT
> - use DECLARE_BITMAP for vpci_dev_assigned_map
> Since v4:
> - moved and re-worked guest sbdf initializers
> - s/set_bit/__set_bit
> - s/clear_bit/__clear_bit
> - minor comment fix s/Virtual/Guest/
> - added VPCI_MAX_VIRT_DEV constant (PCI_SLOT(~0) + 1) which will be used
>   later for counting the number of MMIO handlers required for a guest
>   (Julien)
> Since v3:
>  - make use of VPCI_INIT
>  - moved all new code to vpci.c which belongs to it
>  - changed open-coded 31 to PCI_SLOT(~0)
>  - added comments and code to reject multifunction devices with
>    functions other than 0
>  - updated comment about vpci_dev_next and made it unsigned int
>  - implement roll back in case of error while assigning/deassigning devices
>  - s/dom%pd/%pd
> Since v2:
>  - remove casts that are (a) malformed and (b) unnecessary
>  - add new line for better readability
>  - remove CONFIG_HAS_VPCI_GUEST_SUPPORT ifdef's as the relevant vPCI
>     functions are now completely gated with this config
>  - gate common code with CONFIG_HAS_VPCI_GUEST_SUPPORT
> New in v2
> ---
>  xen/drivers/vpci/vpci.c | 72 ++++++++++++++++++++++++++++++++++++++++-
>  xen/include/xen/sched.h |  8 +++++
>  xen/include/xen/vpci.h  | 11 +++++++
>  3 files changed, 90 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
> index ca3505ecb7..baaafe4a2a 100644
> --- a/xen/drivers/vpci/vpci.c
> +++ b/xen/drivers/vpci/vpci.c
> @@ -46,6 +46,16 @@ void vpci_remove_device(struct pci_dev *pdev)
>          return;
> 
>      spin_lock(&pdev->vpci->lock);
> +
> +#ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
> +    if ( pdev->vpci->guest_sbdf.sbdf != ~0 )
> +    {
> +        __clear_bit(pdev->vpci->guest_sbdf.dev,
> +                    &pdev->domain->vpci_dev_assigned_map);
> +        pdev->vpci->guest_sbdf.sbdf = ~0;
> +    }
> +#endif
> +
>      while ( !list_empty(&pdev->vpci->handlers) )
>      {
>          struct vpci_register *r = list_first_entry(&pdev->vpci->handlers,
> @@ -101,6 +111,10 @@ int vpci_add_handlers(struct pci_dev *pdev)
>      INIT_LIST_HEAD(&pdev->vpci->handlers);
>      spin_lock_init(&pdev->vpci->lock);
> 
> +#ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
> +    pdev->vpci->guest_sbdf.sbdf = ~0;
> +#endif
> +
>      for ( i = 0; i < NUM_VPCI_INIT; i++ )
>      {
>          rc = __start_vpci_array[i](pdev);
> @@ -115,6 +129,54 @@ int vpci_add_handlers(struct pci_dev *pdev)
>  }
> 
>  #ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
> +static int add_virtual_device(struct pci_dev *pdev)
> +{
> +    struct domain *d = pdev->domain;
> +    pci_sbdf_t sbdf = { 0 };
> +    unsigned long new_dev_number;
> +
> +    if ( is_hardware_domain(d) )
> +        return 0;
> +
> +    ASSERT(pcidevs_locked());
> +
> +    /*
> +     * Each PCI bus supports 32 devices/slots at max or up to 256 when
> +     * there are multi-function ones which are not yet supported.
> +     */
> +    if ( pdev->info.is_extfn )
> +    {
> +        gdprintk(XENLOG_ERR, "%pp: only function 0 passthrough supported\n",
> +                 &pdev->sbdf);
> +        return -EOPNOTSUPP;
> +    }
> +
> +    write_lock(&pdev->domain->pci_lock);

This should be replaced with an ASSERT, same as the one in vpci_add_handlers() above.

The lock is already acquired a few patches before this in the caller in
drivers/passthrough/pci.c:assign_device()

1524     write_lock(&pdev->domain->pci_lock);
1525     rc = vpci_assign_device(pdev);
1526     write_unlock(&pdev->domain->pci_lock);

> +    new_dev_number = find_first_zero_bit(d->vpci_dev_assigned_map,
> +                                         VPCI_MAX_VIRT_DEV);
> +    if ( new_dev_number >= VPCI_MAX_VIRT_DEV )
> +    {
> +        write_unlock(&pdev->domain->pci_lock);
> +        return -ENOSPC;
> +    }
> +
> +    __set_bit(new_dev_number, &d->vpci_dev_assigned_map);
> +
> +    /*
> +     * Both segment and bus number are 0:
> +     *  - we emulate a single host bridge for the guest, e.g. segment 0
> +     *  - with bus 0 the virtual devices are seen as embedded
> +     *    endpoints behind the root complex
> +     *
> +     * TODO: add support for multi-function devices.
> +     */
> +    sbdf.devfn = PCI_DEVFN(new_dev_number, 0);
> +    pdev->vpci->guest_sbdf = sbdf;
> +    write_unlock(&pdev->domain->pci_lock);
> +
> +    return 0;
> +}
> +
>  /* Notify vPCI that device is assigned to guest. */
>  int vpci_assign_device(struct pci_dev *pdev)
>  {
> @@ -125,8 +187,16 @@ int vpci_assign_device(struct pci_dev *pdev)
> 
>      rc = vpci_add_handlers(pdev);
>      if ( rc )
> -        vpci_deassign_device(pdev);
> +        goto fail;
> +
> +    rc = add_virtual_device(pdev);
> +    if ( rc )
> +        goto fail;
> +
> +    return 0;
> 
> + fail:
> +    vpci_deassign_device(pdev);
>      return rc;
>  }
>  #endif /* CONFIG_HAS_VPCI_GUEST_SUPPORT */
> diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
> index 80dd150bbf..478bd21f3e 100644
> --- a/xen/include/xen/sched.h
> +++ b/xen/include/xen/sched.h
> @@ -461,6 +461,14 @@ struct domain
>  #ifdef CONFIG_HAS_PCI
>      struct list_head pdev_list;
>      rwlock_t pci_lock;
> +#ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
> +    /*
> +     * The bitmap which shows which device numbers are already used by the
> +     * virtual PCI bus topology and is used to assign a unique SBDF to the
> +     * next passed through virtual PCI device.
> +     */
> +    DECLARE_BITMAP(vpci_dev_assigned_map, VPCI_MAX_VIRT_DEV);
> +#endif
>  #endif
> 
>  #ifdef CONFIG_HAS_PASSTHROUGH
> diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
> index 6099d2141d..c55c45f7a1 100644
> --- a/xen/include/xen/vpci.h
> +++ b/xen/include/xen/vpci.h
> @@ -21,6 +21,13 @@ typedef int vpci_register_init_t(struct pci_dev *dev);
> 
>  #define VPCI_ECAM_BDF(addr)     (((addr) & 0x0ffff000) >> 12)
> 
> +/*
> + * Maximum number of devices supported by the virtual bus topology:
> + * each PCI bus supports 32 devices/slots at max or up to 256 when
> + * there are multi-function ones which are not yet supported.
> + */
> +#define VPCI_MAX_VIRT_DEV       (PCI_SLOT(~0) + 1)
> +
>  #define REGISTER_VPCI_INIT(x, p)                \
>    static vpci_register_init_t *const x##_entry  \
>                 __used_section(".data.vpci." p) = x
> @@ -155,6 +162,10 @@ struct vpci {
>              struct vpci_arch_msix_entry arch;
>          } entries[];
>      } *msix;
> +#ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
> +    /* Guest SBDF of the device. */
> +    pci_sbdf_t guest_sbdf;
> +#endif
>  #endif
>  };
> 
> --
> 2.41.0
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 21:49:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 21:49:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570709.892809 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOmO6-0001gw-87; Wed, 26 Jul 2023 21:49:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570709.892809; Wed, 26 Jul 2023 21:49:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOmO6-0001gp-53; Wed, 26 Jul 2023 21:49:42 +0000
Received: by outflank-mailman (input) for mailman id 570709;
 Wed, 26 Jul 2023 21:49:40 +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
 <SRS0=WQ2z=DM=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qOmO4-0001gj-Si
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 21:49:40 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 50f1e62d-2bfe-11ee-8613-37d641c3527e;
 Wed, 26 Jul 2023 23:49:38 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 2EC8C61CAA;
 Wed, 26 Jul 2023 21:49:37 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1140CC433C8;
 Wed, 26 Jul 2023 21:49:34 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 50f1e62d-2bfe-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690408176;
	bh=k6JzFsTM6CuwnCTwJvVhnX6+N8p+POnDE7tjOkQfUd8=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=DSjQIYYw1KXtv2BYZ8v6Wtgr1AUPLOJB+fdLf8lQiCRii85YlXLCeFtHw6YZMXJ8V
	 UXgzQL47d5vBRP+oP2VaiaE98ANepjCeFD42wwoSFce4lfThkEg/lY1W7Tb+kMA/Lr
	 HCcXHW/z7sKcGju5snIcenRtXew3tFh1FN0OspF7A7TWOPQvBANDMiEOsour6BTLr5
	 sJW5ouxOkepxjKhW8JpnaRpx6OcFPiCmbZGNYyHc9xtHIXfQRPfG9JoN72pznj942f
	 ceu4DrsdhGdO721erSfHuepT9kHB+/v7Y4GgXoPSzIflxE1qFfIANrtLAxV8+zwiPa
	 hbi8uoKGBCwtQ==
Date: Wed, 26 Jul 2023 14:49:33 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Nicola Vetrini <nicola.vetrini@bugseng.com>, sstabellini@kernel.org, 
    michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, 
    consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>, 
    Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v3] xen/spinlock: mechanically rename parameter name
 'debug'
In-Reply-To: <8914bf47-c4ca-4a14-6a92-b5b23ee739a0@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307261448010.3118466@ubuntu-linux-20-04-desktop>
References: <a66f1084686b77b098c5ccf3d0cf5f52980fdf5a.1690317797.git.nicola.vetrini@bugseng.com> <11a3ae18-508b-cf08-2803-bc4aaeec7353@suse.com> <f424fc5b-6266-3d04-b494-0448fa453b75@bugseng.com> <8914bf47-c4ca-4a14-6a92-b5b23ee739a0@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 26 Jul 2023, Jan Beulich wrote:
> On 26.07.2023 08:42, Nicola Vetrini wrote:
> > On 26/07/23 08:34, Jan Beulich wrote:
> >> On 25.07.2023 22:45, Nicola Vetrini wrote:
> >>> Rule 5.3 has the following headline:
> >>> "An identifier declared in an inner scope shall not hide an
> >>> identifier declared in an outer scope"
> >>>
> >>> To avoid any confusion resulting from the parameter 'debug'
> >>> hiding the homonymous function declared at
> >>> 'xen/arch/x86/include/asm/processor.h:428'
> >>> the rename of parameters s/debug/lkdbg/ is performed.
> >>>
> >>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> >>> ---
> >>> Changes in v2:
> >>> - s/dbg/lkdbg/
> >>> Changes in v3:
> >>> - Added missing renames for consistency
> >>
> >> Hmm, you asked whether to send v3, but then you didn't wait for an
> >> answer. So to repeat what I said there: I'd prefer if we could first
> >> settle whether to rename the conflicting x86 symbol.
> >>
> > 
> > Stefano replied asking for a v3 [1] before I had a chance to read your 
> > message this morning.
> 
> Right, sorry, I spotted his reply only after seeing the v3.

For what is worth I prefer the current implementation compared to
renaming debug()


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 22:11:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 22:11:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570711.892819 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOmj3-00052s-Sm; Wed, 26 Jul 2023 22:11:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570711.892819; Wed, 26 Jul 2023 22:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOmj3-00052l-Px; Wed, 26 Jul 2023 22:11:21 +0000
Received: by outflank-mailman (input) for mailman id 570711;
 Wed, 26 Jul 2023 22:11:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=WQ2z=DM=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qOmj2-00052f-Sh
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 22:11:20 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 57f5085d-2c01-11ee-b245-6b7b168915f2;
 Thu, 27 Jul 2023 00:11:18 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 3E40661CD9;
 Wed, 26 Jul 2023 22:11:17 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2CD5BC433C7;
 Wed, 26 Jul 2023 22:11:15 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 57f5085d-2c01-11ee-b245-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690409476;
	bh=2sx6Kx5ktO3GO/vgUIqQ9/lB0mkfr6+u29AoXvxh6A8=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=fF/9C3VX0WqMoalnqIi48Ha1L7ol8TATJ4x/EuwaxQifd7Xya882/GLgWAbM6TD35
	 0FLVEdMq6BZIpLQY9TM2RGZR4AIqlbQ/5h8NqZYuFAFFdBtpGWjJyIRrlKBKlXW+2g
	 CQcf6IgbgN8cD0QSiqCvlE2+O0+a9tQw3d1H9CgY0H2Pd7LDxVX19oExDz5w1spdlS
	 WfWvZNiY7Hu7Hkm0mFelsaaemLNp573aMdRXTaIsCReRazzXAbaMrCcwH0ycoT150o
	 Mb494iEbX7VtwVfCAP//fOE1cp2U1KqeIcC/JdfFvvJsnTQQbPy/CCErqSC5gR3r9c
	 hmcrwlR9RFm1A==
Date: Wed, 26 Jul 2023 15:11:13 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
    Bertrand Marquis <bertrand.marquis@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Wei Liu <wl@xen.org>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Subject: Re: [XEN PATCH v2] xen: use parameter name 'mcs' in
 arch_do_multicall_call()
In-Reply-To: <e71bac85a2b7f92a6438f97048cc6cddc917768d.1690362993.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307261511050.3118466@ubuntu-linux-20-04-desktop>
References: <e71bac85a2b7f92a6438f97048cc6cddc917768d.1690362993.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 26 Jul 2023, Federico Serafini wrote:
> Make function declaration and definition consistent using the same
> parameter name ('mcs' do denote a pointer to an 'mc_state').
> This addresses a violation of MISRA C:2012 Rule 8.3: "All declarations
> of an object or function shall use the same names and type qualifiers".
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
> Changes in v2:
>   - added forgotten changes about x86.
> ---
>  xen/arch/arm/traps.c        | 4 ++--
>  xen/arch/x86/hypercall.c    | 6 +++---
>  xen/include/xen/multicall.h | 2 +-
>  3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index d1ef787638..eab2fcfc02 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -1470,9 +1470,9 @@ static bool check_multicall_32bit_clean(struct multicall_entry *multi)
>      return true;
>  }
>  
> -enum mc_disposition arch_do_multicall_call(struct mc_state *state)
> +enum mc_disposition arch_do_multicall_call(struct mc_state *mcs)
>  {
> -    struct multicall_entry *multi = &state->call;
> +    struct multicall_entry *multi = &mcs->call;
>  
>      if ( multi->op >= ARRAY_SIZE(hypercall_args) )
>      {
> diff --git a/xen/arch/x86/hypercall.c b/xen/arch/x86/hypercall.c
> index cc9a6a9d59..01cd73040d 100644
> --- a/xen/arch/x86/hypercall.c
> +++ b/xen/arch/x86/hypercall.c
> @@ -203,15 +203,15 @@ int hypercall_xlat_continuation(unsigned int *id, unsigned int nr,
>      return rc;
>  }
>  
> -enum mc_disposition arch_do_multicall_call(struct mc_state *state)
> +enum mc_disposition arch_do_multicall_call(struct mc_state *mcs)
>  {
>      const struct domain *currd = current->domain;
>  
>      if ( is_pv_domain(currd) )
> -        return pv_do_multicall_call(state);
> +        return pv_do_multicall_call(mcs);
>  
>      if ( is_hvm_domain(currd) )
> -        return hvm_do_multicall_call(state);
> +        return hvm_do_multicall_call(mcs);
>  
>      return mc_exit;
>  }
> diff --git a/xen/include/xen/multicall.h b/xen/include/xen/multicall.h
> index ac8238660a..5bebeca7b2 100644
> --- a/xen/include/xen/multicall.h
> +++ b/xen/include/xen/multicall.h
> @@ -25,6 +25,6 @@ enum mc_disposition {
>      mc_continue,
>      mc_exit,
>      mc_preempt,
> -} arch_do_multicall_call(struct mc_state *mc);
> +} arch_do_multicall_call(struct mc_state *mcs);
>  
>  #endif /* __XEN_MULTICALL_H__ */
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 22:46:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 22:46:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570722.892828 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOnGw-00009I-Cp; Wed, 26 Jul 2023 22:46:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570722.892828; Wed, 26 Jul 2023 22:46:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOnGw-00009B-AF; Wed, 26 Jul 2023 22:46:22 +0000
Received: by outflank-mailman (input) for mailman id 570722;
 Wed, 26 Jul 2023 22:46:20 +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
 <SRS0=WQ2z=DM=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qOnGu-000093-Nq
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 22:46:20 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3a2ad4c1-2c06-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 00:46:16 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id BC1E261BAF;
 Wed, 26 Jul 2023 22:46:14 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 715FBC433C7;
 Wed, 26 Jul 2023 22:46:13 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3a2ad4c1-2c06-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690411574;
	bh=OJau1cjSjo6ZzIQjr32LB/ViHqrF1ZecQ6sE0m5nOC4=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=uXBUbj1fyosaGU/PgiM8elnhFM6PbZzU3pqz3SSW7uowN/VEGZp6AsV/NCCApWjnc
	 RHWtz6XJdbIvljAAbSAmKO6Nst1Kk7ZGMtquLWkMbm8TeSt6Sxd3co2lDvKFKcvorN
	 BbNvG12cf5NyXu3IdzFxfOA55vz3+/7E4ugVJHLnaZtj0Xu4bovRrFypcrhkbYPa/o
	 EhZE0ErcMeMbv1+GrwlLsdktVJxOMvnS5mXS5klVEij6M71Qu+sZNtFxDVF1Qz8LxW
	 pmcqS+eA2eP17H9t5A9GLSQFEJ2gj/7iwLmg7jWy/S6OXBXGxiGcCt8Xc33MBkRCcI
	 fRb5ezzE48JfQ==
Date: Wed, 26 Jul 2023 15:46:11 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Doug Goldstein <cardoe@cardoe.com>, 
    Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [XEN PATCH v4 3/4] automation: Add ECLAIR pipelines
In-Reply-To: <4da07f65cf6f2e2d9ccffa479f3cb8165f273fdc.1690387393.git.simone.ballarin@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307261512360.3118466@ubuntu-linux-20-04-desktop>
References: <cover.1690387393.git.simone.ballarin@bugseng.com> <4da07f65cf6f2e2d9ccffa479f3cb8165f273fdc.1690387393.git.simone.ballarin@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 26 Jul 2023, Simone Ballarin wrote:
> Add two pipelines that analyze an ARM64 and a X86_64 build with the
> ECLAIR static analyzer on the guidelines contained in Set1.
> 
> The analysis configuration is stored in automation/eclair_analysis.
> 
> All commits on the xen-project/xen:staging branch will be analyzed
> and their artifacts will be stored indefinitely; the integration will
> report differential information with respect to the previous analysis.
> 
> All commits on other branches or repositories will be analyzed and
> only the last ten artifacts will be kept; the integration will report
> differential information with respect to the analysis done on the common
> ancestor with xen-project/xen:staging (if available).
> 
> Currently the pipeline variable ENABLE_ECLAIR_BOT is set to "n".
> Doing so disables the generation of comments with the analysis summary
> on the commit threads. The variable can be set to "y" if the a masked
> variable named ECLAIR_BOT_TOKEN is set with the impersonation token of
> an account with enough privileges to write on all repositories.
> 
> Additionaly any repository should be able to read a masked variable
> named WTOKEN with the token provided by BUGSENG.
> 
> The analysis fails if it contains violations of guidelines tagged as
> clean:added. The list of clean guidelines are maintained in
> automation/eclair_analysis/ECLAIR/tagging.ecl.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

I committed the series with one change:

> --

This needs to be exactly --- so that git am will remove the content
below on commit. In this case I removed it manually.


> Changes in v4:
> - move link to the analysis results at the end of the console log
> 
> Changes in v3:
> - split definitions of the ECLAIR pipelines in a separate patch;
> - if the WTOKEN variable is missing now the analysis fails immediately.
> 
> Changes in v2:
> - add ECLAIR configuration files (before they were fetched from a separate
>     repository);
> - now the pipeline fails if there are new violations of guidelines tagged
>     with clean:added.
> ---
>  .gitlab-ci.yml                    |  2 ++
>  automation/gitlab-ci/analyze.yaml | 38 +++++++++++++++++++++++++++++++
>  automation/gitlab-ci/build.yaml   |  1 +
>  automation/scripts/eclair         | 34 +++++++++++++++++++++++++++
>  4 files changed, 75 insertions(+)
>  create mode 100644 automation/gitlab-ci/analyze.yaml
>  create mode 100755 automation/scripts/eclair
> 
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index c8bd7519d5..ee5430b8b7 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -1,7 +1,9 @@
>  stages:
> +  - analyze
>    - build
>    - test
>  
>  include:
> +  - 'automation/gitlab-ci/analyze.yaml'
>    - 'automation/gitlab-ci/build.yaml'
>    - 'automation/gitlab-ci/test.yaml'
> diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
> new file mode 100644
> index 0000000000..3d8166572b
> --- /dev/null
> +++ b/automation/gitlab-ci/analyze.yaml
> @@ -0,0 +1,38 @@
> +.eclair-analysis:
> +  stage: analyze
> +  tags:
> +    - eclair-analysis
> +  variables:
> +    ECLAIR_OUTPUT_DIR: "ECLAIR_out"
> +    ANALYSIS_KIND: "normal"
> +    ENABLE_ECLAIR_BOT: "n"
> +    AUTO_PR_BRANCH: "staging"
> +    AUTO_PR_REPOSITORY: "xen-project/xen"
> +  artifacts:
> +    when: always
> +    paths:
> +      - "${ECLAIR_OUTPUT_DIR}/*.log"
> +      - "${ECLAIR_OUTPUT_DIR}/*.txt"
> +      - '*.log'
> +    reports:
> +      codequality: gl-code-quality-report.json
> +
> +eclair-x86_64:
> +  extends: .eclair-analysis
> +  variables:
> +    LOGFILE: "eclair-x86_64.log"
> +    VARIANT: "X86_64"
> +    RULESET: "Set1"
> +  script:
> +    - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
> +  allow_failure: true
> +
> +eclair-ARM64:
> +  extends: .eclair-analysis
> +  variables:
> +    LOGFILE: "eclair-ARM64.log"
> +    VARIANT: "ARM64"
> +    RULESET: "Set1"
> +  script:
> +    - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
> +  allow_failure: true
> diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
> index c401f62d61..f01e2c32bb 100644
> --- a/automation/gitlab-ci/build.yaml
> +++ b/automation/gitlab-ci/build.yaml
> @@ -11,6 +11,7 @@
>        - '*.log'
>        - '*/*.log'
>      when: always
> +  needs: []
>    except:
>      - master
>      - smoke
> diff --git a/automation/scripts/eclair b/automation/scripts/eclair
> new file mode 100755
> index 0000000000..813a56eb6a
> --- /dev/null
> +++ b/automation/scripts/eclair
> @@ -0,0 +1,34 @@
> +#!/bin/sh -eu
> +
> +ECLAIR_ANALYSIS_DIR=automation/eclair_analysis
> +ECLAIR_DIR="${ECLAIR_ANALYSIS_DIR}/ECLAIR"
> +ECLAIR_OUTPUT_DIR=$(realpath "${ECLAIR_OUTPUT_DIR}")
> +
> +if [ -z "${WTOKEN:-}" ]; then
> +    echo "Failure: the WTOKEN variable is not defined." >&2
> +    exit 1
> +fi
> +
> +"${ECLAIR_ANALYSIS_DIR}/prepare.sh" "${VARIANT}"
> +
> +ex=0
> +"${ECLAIR_DIR}/analyze.sh" "${VARIANT}" "${RULESET}" || ex=$?
> +"${ECLAIR_DIR}/action_log.sh" ANALYSIS_LOG \
> +                             "ECLAIR analysis log" \
> +                             "${ECLAIR_OUTPUT_DIR}/ANALYSIS.log" \
> +                             "${ex}"
> +"${ECLAIR_DIR}/action_log.sh" REPORT_LOG \
> +                             "ECLAIR report log" \
> +                             "${ECLAIR_OUTPUT_DIR}/REPORT.log" \
> +                             "${ex}"
> +[ "${ex}" = 0 ] || exit "${ex}"
> +
> +# Fail in case of new reports
> +"${ECLAIR_DIR}/action_clean_added.sh" "${ECLAIR_OUTPUT_DIR}" || ex=$?
> +"${ECLAIR_DIR}/action_log.sh" DIFF_CHECK_LOG \
> +                             "ECLAIR diff check" \
> +                             "${ECLAIR_OUTPUT_DIR}/clean_added.log" \
> +                             "${ex}"
> +
> +"${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
> +[ "${ex}" = 0 ] || exit "${ex}"
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 23:09:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 23:09:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570733.892839 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOndg-0002sA-CR; Wed, 26 Jul 2023 23:09:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570733.892839; Wed, 26 Jul 2023 23:09:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOndg-0002s3-8z; Wed, 26 Jul 2023 23:09:52 +0000
Received: by outflank-mailman (input) for mailman id 570733;
 Wed, 26 Jul 2023 23:09:51 +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
 <SRS0=PSyE=DM=fromorbit.com=david@srs-se1.protection.inumbo.net>)
 id 1qOnde-0002rx-RI
 for xen-devel@lists.xenproject.org; Wed, 26 Jul 2023 23:09:50 +0000
Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com
 [2607:f8b0:4864:20::634])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 83b6e381-2c09-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 01:09:48 +0200 (CEST)
Received: by mail-pl1-x634.google.com with SMTP id
 d9443c01a7336-1b8b4748fe4so2420295ad.1
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 16:09:48 -0700 (PDT)
Received: from dread.disaster.area (pa49-186-119-116.pa.vic.optusnet.com.au.
 [49.186.119.116]) by smtp.gmail.com with ESMTPSA id
 u9-20020a17090341c900b001ac95be5081sm58846ple.307.2023.07.26.16.09.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 16:09:45 -0700 (PDT)
Received: from dave by dread.disaster.area with local (Exim 4.96)
 (envelope-from <david@fromorbit.com>) id 1qOndW-00AvaD-0j;
 Thu, 27 Jul 2023 09:09:42 +1000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 83b6e381-2c09-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=fromorbit-com.20221208.gappssmtp.com; s=20221208; t=1690412986; x=1691017786;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=bNBWi9BFA7oJZNyI/XnA5H8tHZCJl01gNE0DBxlvZ40=;
        b=Lnuap/X4mLRvumv8rxik6XXAmLQssX2LaTRnfxOwbhhRA6q+4W8DfrIsG7kVikG4Iw
         ozUx9bZZDKNb4aqqrWuoDs7rpphs2fFB4IjiULQPXjflO/XhZA2vc5TzngrkqmMIM5UL
         tCjpn3hCX/GmJvs5MwDi73VFwiTs9hADB2Cru8fy0ICxuL68/fE/7pFEUcb8ihUp2Ey5
         GxMGCc+rwQuZGeGguv2m2EFaBOeJPE6kWVGxSMJPh4gYWl2FbXQzGnA0u5AYkb1ckWFe
         PYG7wUThiNHKJJU/Kftp/PqqvyLMK20NIq4IuXuyA0M1JDxZWj46ZkNyp0CVDzf4FlQ+
         b/TA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690412986; x=1691017786;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=bNBWi9BFA7oJZNyI/XnA5H8tHZCJl01gNE0DBxlvZ40=;
        b=GPs/Rf8wgBIHi/0S21CgodHMFbewrCpgj21k1uE2CzlCGfiwlSR7C4eGHvReIBT/Mn
         5zEa4qUs1xCfqqR4JKBr7FFxmrDfZfyV+tFuTd0cla/Aya/qBKJo8AJ1IIm9j1C6HFaW
         KNs63SttuHgmX/OONvVIhilix97twv+vc2C+2MhhQAQY78mx/6YEs1VRuz4PhIy6ODqg
         TE3eaOtJ4v1iA5jt9sh70PyyJttLKjqHlw/q/61XrxjaoqnaE7aaGIANECa58OHZcKwl
         Jj6tM2PaZ7LInhbRDVVUeSAR3BBDvPWQ7oLl21ARgXdKueUOI8I3Xf0U6lpV6QfqTLbk
         jnNg==
X-Gm-Message-State: ABy/qLavri4eCdp+g3fmxJC6k6ucHhIBQn/3eNNEf4sbhX1q/1DVvH9g
	FTvv/oIYZwRY97GR2bel/jGN6A==
X-Google-Smtp-Source: APBJJlHUt9d2hTqe2ud94c6lNUCrPn/cPviOHGLjkBp5h1xJnkt7lTpPKllT1sxo0CM9mi2vK7HwDA==
X-Received: by 2002:a17:902:c10c:b0:1b8:b382:f6c3 with SMTP id 12-20020a170902c10c00b001b8b382f6c3mr2914213pli.13.1690412986476;
        Wed, 26 Jul 2023 16:09:46 -0700 (PDT)
Date: Thu, 27 Jul 2023 09:09:42 +1000
From: Dave Chinner <david@fromorbit.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: akpm@linux-foundation.org, tkhai@ya.ru, vbabka@suse.cz,
	roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org,
	paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com,
	cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com,
	gregkh@linuxfoundation.org, muchun.song@linux.dev,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
	kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org, linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org, netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com, linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 44/47] mm: shrinker: make global slab shrink lockless
Message-ID: <ZMGnthZAh48JF+eV@dread.disaster.area>
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-45-zhengqi.arch@bytedance.com>
 <ZMDUkoIXUlTkCSYL@dread.disaster.area>
 <19ad6d06-8a14-6102-5eae-2134dc2c5061@bytedance.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <19ad6d06-8a14-6102-5eae-2134dc2c5061@bytedance.com>

On Wed, Jul 26, 2023 at 05:14:09PM +0800, Qi Zheng wrote:
> On 2023/7/26 16:08, Dave Chinner wrote:
> > On Mon, Jul 24, 2023 at 05:43:51PM +0800, Qi Zheng wrote:
> > > @@ -122,6 +126,13 @@ void shrinker_free_non_registered(struct shrinker *shrinker);
> > >   void shrinker_register(struct shrinker *shrinker);
> > >   void shrinker_unregister(struct shrinker *shrinker);
> > > +static inline bool shrinker_try_get(struct shrinker *shrinker)
> > > +{
> > > +	return READ_ONCE(shrinker->registered) &&
> > > +	       refcount_inc_not_zero(&shrinker->refcount);
> > > +}
> > 
> > Why do we care about shrinker->registered here? If we don't set
> > the refcount to 1 until we have fully initialised everything, then
> > the shrinker code can key entirely off the reference count and
> > none of the lookup code needs to care about whether the shrinker is
> > registered or not.
> 
> The purpose of checking shrinker->registered here is to stop running
> shrinker after calling shrinker_free(), which can prevent the following
> situations from happening:
> 
> CPU 0                 CPU 1
> 
> shrinker_try_get()
> 
>                        shrinker_try_get()
> 
> shrinker_put()
> shrinker_try_get()
>                        shrinker_put()

I don't see any race here? What is wrong with having multiple active
users at once?

> > 
> > This should use a completion, then it is always safe under
> > rcu_read_lock().  This also gets rid of the shrinker_lock spin lock,
> > which only exists because we can't take a blocking lock under
> > rcu_read_lock(). i.e:
> > 
> > 
> > void shrinker_put(struct shrinker *shrinker)
> > {
> > 	if (refcount_dec_and_test(&shrinker->refcount))
> > 		complete(&shrinker->done);
> > }
> > 
> > void shrinker_free()
> > {
> > 	.....
> > 	refcount_dec(&shrinker->refcount);
> 
> I guess what you mean is shrinker_put(), because here may be the last
> refcount.

Yes, I did.

> > 	wait_for_completion(&shrinker->done);
> > 	/*
> > 	 * lookups on the shrinker will now all fail as refcount has
> > 	 * fallen to zero. We can now remove it from the lists and
> > 	 * free it.
> > 	 */
> > 	down_write(shrinker_rwsem);
> > 	list_del_rcu(&shrinker->list);
> > 	up_write(&shrinker_rwsem);
> > 	call_rcu(shrinker->rcu_head, shrinker_free_rcu_cb);
> > }
> > 
> > ....
> > 
> > > @@ -686,11 +711,14 @@ EXPORT_SYMBOL(shrinker_free_non_registered);
> > >   void shrinker_register(struct shrinker *shrinker)
> > >   {
> > > -	down_write(&shrinker_rwsem);
> > > -	list_add_tail(&shrinker->list, &shrinker_list);
> > > -	shrinker->flags |= SHRINKER_REGISTERED;
> > > +	refcount_set(&shrinker->refcount, 1);
> > > +
> > > +	spin_lock(&shrinker_lock);
> > > +	list_add_tail_rcu(&shrinker->list, &shrinker_list);
> > > +	spin_unlock(&shrinker_lock);
> > > +
> > >   	shrinker_debugfs_add(shrinker);
> > > -	up_write(&shrinker_rwsem);
> > > +	WRITE_ONCE(shrinker->registered, true);
> > >   }
> > >   EXPORT_SYMBOL(shrinker_register);
> > 
> > This just looks wrong - you are trying to use WRITE_ONCE() as a
> > release barrier to indicate that the shrinker is now set up fully.
> > That's not necessary - the refcount is an atomic and along with the
> > rcu locks they should provides all the barriers we need. i.e.
> 
> The reason I used WRITE_ONCE() here is because the shrinker->registered
> will be read and written concurrently (read in shrinker_try_get() and
> written in shrinker_free()), which is why I added shrinker::registered
> field instead of using SHRINKER_REGISTERED flag (this can reduce the
> addition of WRITE_ONCE()/READ_ONCE()).

Using WRITE_ONCE/READ_ONCE doesn't provide memory barriers needed to
use the field like this. You need release/acquire memory ordering
here. i.e. smp_store_release()/smp_load_acquire().

As it is, the refcount_inc_not_zero() provides a control dependency,
as documented in include/linux/refcount.h, refcount_dec_and_test()
provides release memory ordering. The only thing I think we may need
is a write barrier before refcount_set(), such that if
refcount_inc_not_zero() sees a non-zero value, it is guaranteed to
see an initialised structure...

i.e. refcounts provide all the existence and initialisation
guarantees. Hence I don't see the need to use shrinker->registered
like this and it can remain a bit flag protected by the
shrinker_rwsem().


> > void shrinker_register(struct shrinker *shrinker)
> > {
> > 	down_write(&shrinker_rwsem);
> > 	list_add_tail_rcu(&shrinker->list, &shrinker_list);
> > 	shrinker->flags |= SHRINKER_REGISTERED;
> > 	shrinker_debugfs_add(shrinker);
> > 	up_write(&shrinker_rwsem);
> > 
> > 	/*
> > 	 * now the shrinker is fully set up, take the first
> > 	 * reference to it to indicate that lookup operations are
> > 	 * now allowed to use it via shrinker_try_get().
> > 	 */
> > 	refcount_set(&shrinker->refcount, 1);
> > }
> > 
> > > diff --git a/mm/shrinker_debug.c b/mm/shrinker_debug.c
> > > index f1becfd45853..c5573066adbf 100644
> > > --- a/mm/shrinker_debug.c
> > > +++ b/mm/shrinker_debug.c
> > > @@ -5,6 +5,7 @@
> > >   #include <linux/seq_file.h>
> > >   #include <linux/shrinker.h>
> > >   #include <linux/memcontrol.h>
> > > +#include <linux/rculist.h>
> > >   /* defined in vmscan.c */
> > >   extern struct rw_semaphore shrinker_rwsem;
> > > @@ -161,17 +162,21 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
> > >   {
> > >   	struct dentry *entry;
> > >   	char buf[128];
> > > -	int id;
> > > -
> > > -	lockdep_assert_held(&shrinker_rwsem);
> > > +	int id, ret = 0;
> > >   	/* debugfs isn't initialized yet, add debugfs entries later. */
> > >   	if (!shrinker_debugfs_root)
> > >   		return 0;
> > > +	down_write(&shrinker_rwsem);
> > > +	if (shrinker->debugfs_entry)
> > > +		goto fail;
> > > +
> > >   	id = ida_alloc(&shrinker_debugfs_ida, GFP_KERNEL);
> > > -	if (id < 0)
> > > -		return id;
> > > +	if (id < 0) {
> > > +		ret = id;
> > > +		goto fail;
> > > +	}
> > >   	shrinker->debugfs_id = id;
> > >   	snprintf(buf, sizeof(buf), "%s-%d", shrinker->name, id);
> > > @@ -180,7 +185,8 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
> > >   	entry = debugfs_create_dir(buf, shrinker_debugfs_root);
> > >   	if (IS_ERR(entry)) {
> > >   		ida_free(&shrinker_debugfs_ida, id);
> > > -		return PTR_ERR(entry);
> > > +		ret = PTR_ERR(entry);
> > > +		goto fail;
> > >   	}
> > >   	shrinker->debugfs_entry = entry;
> > > @@ -188,7 +194,10 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
> > >   			    &shrinker_debugfs_count_fops);
> > >   	debugfs_create_file("scan", 0220, entry, shrinker,
> > >   			    &shrinker_debugfs_scan_fops);
> > > -	return 0;
> > > +
> > > +fail:
> > > +	up_write(&shrinker_rwsem);
> > > +	return ret;
> > >   }
> > >   int shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...)
> > > @@ -243,6 +252,11 @@ struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
> > >   	shrinker->name = NULL;
> > >   	*debugfs_id = entry ? shrinker->debugfs_id : -1;
> > > +	/*
> > > +	 * Ensure that shrinker->registered has been set to false before
> > > +	 * shrinker->debugfs_entry is set to NULL.
> > > +	 */
> > > +	smp_wmb();
> > >   	shrinker->debugfs_entry = NULL;
> > >   	return entry;
> > > @@ -266,14 +280,26 @@ static int __init shrinker_debugfs_init(void)
> > >   	shrinker_debugfs_root = dentry;
> > >   	/* Create debugfs entries for shrinkers registered at boot */
> > > -	down_write(&shrinker_rwsem);
> > > -	list_for_each_entry(shrinker, &shrinker_list, list)
> > > +	rcu_read_lock();
> > > +	list_for_each_entry_rcu(shrinker, &shrinker_list, list) {
> > > +		if (!shrinker_try_get(shrinker))
> > > +			continue;
> > > +		rcu_read_unlock();
> > > +
> > >   		if (!shrinker->debugfs_entry) {
> > > -			ret = shrinker_debugfs_add(shrinker);
> > > -			if (ret)
> > > -				break;
> > > +			/* Paired with smp_wmb() in shrinker_debugfs_detach() */
> > > +			smp_rmb();
> > > +			if (READ_ONCE(shrinker->registered))
> > > +				ret = shrinker_debugfs_add(shrinker);
> > >   		}
> > > -	up_write(&shrinker_rwsem);
> > > +
> > > +		rcu_read_lock();
> > > +		shrinker_put(shrinker);
> > > +
> > > +		if (ret)
> > > +			break;
> > > +	}
> > > +	rcu_read_unlock();
> > >   	return ret;
> > >   }
> > 
> > And all this churn and complexity can go away because the
> > shrinker_rwsem is still used to protect shrinker_register()
> > entirely....
> 
> My consideration is that during this process, there may be a
> driver probe failure and then shrinker_free() is called (the
> shrinker_debugfs_init() is called in late_initcall stage). In
> this case, we need to use RCU+refcount to ensure that the shrinker
> is not freed.

Yeah, you're trying to work around the lack of a
wait_for_completion() call in shrinker_free().

With that, this doesn't need RCU at all, and the iteration can be
done fully under the shrinker_rwsem() safely and so none of this
code needs to change.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com


From xen-devel-bounces@lists.xenproject.org Wed Jul 26 23:16:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Jul 2023 23:16:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570736.892849 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOnkQ-0004MK-3U; Wed, 26 Jul 2023 23:16:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570736.892849; Wed, 26 Jul 2023 23:16:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOnkQ-0004MD-0g; Wed, 26 Jul 2023 23:16:50 +0000
Received: by outflank-mailman (input) for mailman id 570736;
 Wed, 26 Jul 2023 23:16:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOnkO-0004M3-JL; Wed, 26 Jul 2023 23:16:48 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOnkO-0000GI-EO; Wed, 26 Jul 2023 23:16:48 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOnkO-0000x5-2X; Wed, 26 Jul 2023 23:16:48 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOnkO-0005fA-1l; Wed, 26 Jul 2023 23:16:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=dopUkjWOyVpCNGKVDxLpJlNF5w5jRfp99oSNmUc7lbs=; b=Zeq0XkQRS5ckXNaFQt5mDsV3nY
	1DKHSZ7GdRguzpQIUlTa3pQrGiTnHoYFctRs++24QVgyPFHrDeIDhyB6KnMhp26BB5D3hay2R62Nh
	uuYO7c8mPWI+n1IIpx5NFC/COvQFRH3D3vs89DIPq1meFUX1XphkaPdRqQKXJZLJU4Gw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182021-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 182021: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=ea4c67f56769b292fdb03dc3e626bde22111c79d
X-Osstest-Versions-That:
    libvirt=411cbe7199ce533ae5fa78f5558dddca6f88ef1a
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 26 Jul 2023 23:16:48 +0000

flight 182021 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182021/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail blocked in 182004
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182004
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 182004
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 libvirt              ea4c67f56769b292fdb03dc3e626bde22111c79d
baseline version:
 libvirt              411cbe7199ce533ae5fa78f5558dddca6f88ef1a

Last test of basis   182004  2023-07-25 04:20:37 Z    1 days
Testing same since   182021  2023-07-26 10:25:25 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Han Han <hhan@redhat.com>
  Michal Privoznik <mprivozn@redhat.com>
  Oleg Vasilev <oleg.vasilev@virtuozzo.com>
  Pavel Borecki <pavel.borecki@gmail.com>
  Peter Krempa <pkrempa@redhat.com>
  Tim Wiederhake <twiederh@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   411cbe7199..ea4c67f567  ea4c67f56769b292fdb03dc3e626bde22111c79d -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 00:57:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 00:57:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570756.892859 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOpJT-0006y8-Cp; Thu, 27 Jul 2023 00:57:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570756.892859; Thu, 27 Jul 2023 00:57:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOpJT-0006y1-A5; Thu, 27 Jul 2023 00:57:07 +0000
Received: by outflank-mailman (input) for mailman id 570756;
 Thu, 27 Jul 2023 00:57:05 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Q9bz=DN=epam.com=prvs=1572de9637=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qOpJR-0006xv-7H
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 00:57:05 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7f326619-2c18-11ee-b246-6b7b168915f2;
 Thu, 27 Jul 2023 02:57:03 +0200 (CEST)
Received: from pps.filterd (m0174676.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36QGP4N6026454; Thu, 27 Jul 2023 00:57:00 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2057.outbound.protection.outlook.com [104.47.13.57])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3s2wtk3pyj-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 27 Jul 2023 00:57:00 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS8PR03MB8394.eurprd03.prod.outlook.com (2603:10a6:20b:526::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 00:56:55 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 00:56:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7f326619-2c18-11ee-b246-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BChNfXacez+hg2QbzLtDisznDXr3obN5xDPQzc8MQd4OXIW9iwgoEcDvh6CTqgS5RCoZmmuvfO/lR2V5y7cG8edk1jD5Twy4aNBj08JvSNfcNPUtMaOg8esKl3aRjhulnsmcRqclGy8+pz132eGgxTnF9HdJutWMNWtUR7ZgFHoM4TLcdhfVk0M3Bsd8Sq+1TlZYm0bsecvGnGZnF3QVur3uxvemA/GZrnwipL2G2OZJdIi6EXGfAB7d8Fa0+PV+46OF116nacx7LuqdjBWtAX3CAJHGjLUQnk9mpFZz/altfof1P8waDEEF24MhBT+NMognKPNv9rmaU3h2RxkvfQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4zvYSg9XZJzXH2On3TfL2LgzVK+msbqdA11xLOM0gLQ=;
 b=Dn5OAMsfTe3V3wYcAgLqZ7NHH1n/bW+1y0QMdndmGZrZwXw9gCW94NWU8cNptUZdzrzQSqVlkULP+dY7OScK4iIRXkEKWV5Ns80hT0E24g/4FfF56CP4xb12sUZAdgy0d4BePqRYE2gQnOq3KMFUVqyGdiuv10iDOCbRQm/e0b2dlI5m0nxP14fSXagm9eHA5Ms018hZucb7GzYLhZOPSgYJaRn4Vntag4TXiZbrHwvwwnho4CcPcnXdAKUMTh7yhfN6voJ6qaS1t8+VQhCjVKOg0rvppSMD24wKVPWw7MxGLNKA/9rmVOEHC9/gy+sMevcffkvvuumtX/y3pT6P7w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4zvYSg9XZJzXH2On3TfL2LgzVK+msbqdA11xLOM0gLQ=;
 b=GGq5a1C9hTZ9LA7tUQHpRd8IIGfWoEm9Oraq0+uA+1zzq/9V97zkXFPLJeRbd5xLzSjBn5Dzn40QKipvfz2IlSLOIq4/Ha6rutI/EkNvVT52jDVlW7AXVek6z/48qvCzaW0CWOLxg4TNM6/RQisTS/KDwXQm39D2uiYG7UE4f2m9/LMQUXROhX8PVjdZ1FnCyokQtIpO0IbtVH1HfXWa8HKesrYZIoT1WOPvhEGpTlEoNyXqJZGYIVN7t7qpYQxW3kyV0BijgiLq/xaKuzIAglnm7Wa02GIngACA7h4R9rWg/0a5glgPusE3+4q7Sam8qG7zk1bCk2TQOmWLiG9ZDw==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
        Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
        Jan Beulich
	<jbeulich@suse.com>
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Thread-Topic: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Thread-Index: AQHZuqGrLMJPz1ipBEu4urExXp8yi6/CgxUAgAWEoICAA8vwgIAA+VsA
Date: Thu, 27 Jul 2023 00:56:54 +0000
Message-ID: <87y1j2b296.fsf@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local> <87ila7cvy2.fsf@epam.com>
 <ZMDox0WwumxMGnzV@MacBook-Air-de-Roger.local>
In-Reply-To: <ZMDox0WwumxMGnzV@MacBook-Air-de-Roger.local>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: mu4e 1.8.9; emacs 28.2
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS8PR03MB8394:EE_
x-ms-office365-filtering-correlation-id: 55481ec9-3e0b-4cb1-4a3f-08db8e3c5f2b
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 uFd5f0VReXUD4c5Oorugtv8AA3jenA3rRwas33uAeDfROofkRylYbYBclLU9958bi1IVXoHs1O+gCFgn55eMPYvAKUWA73g3ugfy+gKbdj4apXtHtzrZ1ecLwlCHmx5nU5MzEu7OH00SvSfgNedCrzozYvR2oFAFWCcCUPTYMRYin+uY919/VXcN9kbNp2kDnkQS3yIV2zsXKUWPIyyzSX98alrp4ipRvqs49tkcgTINPbJAA6kuKAiE+1VjdfI6HuYo0y2yZo3lGwpA+si9XGAa+fvyDTR9Xup/Bcwl7sI3uY/cvQt4T0qsaKxSXP9nXKUB33qAfOU6MQCPvhBm+yr5CuNvjYLawxF3MgZhWd6yoZVdDN7ui5kiCJh3+P4zVbcfHwqga4hxwMnKXuxJ8X6gFnBw8httMU4Z1P5KzjYXbPKGoLtcp0u2KsvcDE21PRLTuZ6rYegLvI9w22N09y1eY57SiSOqrpZt60gv2HMGkDOa4YCdZCTLeR080wYq1FjRero1rsi8EVeogiPcN8GTLFLTCLWAF/NUOSi+MxXxeGOPVBqPXaQbBiAgi04+MsKY61M6Rk5f2Q1miapkUaPN/+xwEXYFAxMZmYz9sVhmgEQp3Q4/4RieeozRSWup
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(396003)(136003)(39860400002)(366004)(451199021)(26005)(2616005)(6506007)(71200400001)(55236004)(186003)(83380400001)(8676002)(64756008)(316002)(41300700001)(66446008)(76116006)(91956017)(6916009)(8936002)(66476007)(4326008)(66556008)(66946007)(5660300002)(6486002)(6512007)(478600001)(54906003)(2906002)(38100700002)(122000001)(36756003)(86362001)(38070700005);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?azRkeTlJYUN0MGVYdll0c3hIa0dmcVBEdFI4d2Zldmt4K0RvM0szYW9EOEVn?=
 =?utf-8?B?WnJ6R3k2R0tIck44VmUvRUVTdmM0Ni9LQkFlUXZwbGd3cENPRk1qOHRDZ3VE?=
 =?utf-8?B?U21PRWVCSy91TVN5NFVDbHpYTnhaakwzN3Yzb0Z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VG1EV0U3aHFieXNRczNkeU9EYTJTODRZQ1V1SlltMER3L3NtT1dwYUJlVUxR?=
 =?utf-8?B?WUxMaGV1N1NtQXRJS0M1bDVMeml5Z1JHVG1PUU84WVhlb3I5VW4zOUszMEJT?=
 =?utf-8?B?d05zM0JJYUNydHRPUHZXeTM0RXBha21ZbUtjR1BobFZXUndpYUNYdmRPOUNJ?=
 =?utf-8?B?TTJnTjJ3ZVROYUwyWG9qbzF5Nm5LY1NmZXgzbDRKbVhoejh2cFYxWDNqTUpq?=
 =?utf-8?B?bWppOXNZNmhhWkJJWDM2L1BPNjdVaEVCNEdoSHJBWk9abWh3UzFObHNlRnAv?=
 =?utf-8?B?anc9PQ==?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <22DE2E44A749A74584E3C836AF8801CF@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 55481ec9-3e0b-4cb1-4a3f-08db8e3c5f2b
X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jul 2023 00:56:54.8665
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: y+TDRRyqyKSRdmwf+7t+QJMiway1FFoWrMTqlJcmD4tD6hkXki+o2Rs5YdLBTyRzUKF1Tyx9dQjDOq63U0qV7p2XUbl6AzsGjL1BUkz0XYg=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB8394
X-Proofpoint-ORIG-GUID: HJQvLlpmPw3Pjravn3pQnj1JzHjxH1HJ
X-Proofpoint-GUID: HJQvLlpmPw3Pjravn3pQnj1JzHjxH1HJ
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-26_08,2023-07-26_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 spamscore=0
 mlxscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501
 mlxlogscore=892 impostorscore=0 suspectscore=0 malwarescore=0
 clxscore=1015 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307270006

SGkgUm9nZXIsDQoNClJvZ2VyIFBhdSBNb25uw6kgPHJvZ2VyLnBhdUBjaXRyaXguY29tPiB3cml0
ZXM6DQoNCj4gT24gV2VkLCBKdWwgMjYsIDIwMjMgYXQgMDE6MTc6NThBTSArMDAwMCwgVm9sb2R5
bXlyIEJhYmNodWsgd3JvdGU6DQo+PiANCj4+IEhpIFJvZ2VyLA0KPj4gDQo+PiBSb2dlciBQYXUg
TW9ubsOpIDxyb2dlci5wYXVAY2l0cml4LmNvbT4gd3JpdGVzOg0KPj4gDQo+PiA+IE9uIFRodSwg
SnVsIDIwLCAyMDIzIGF0IDEyOjMyOjMxQU0gKzAwMDAsIFZvbG9keW15ciBCYWJjaHVrIHdyb3Rl
Og0KPj4gPj4gRnJvbTogT2xla3NhbmRyIEFuZHJ1c2hjaGVua28gPG9sZWtzYW5kcl9hbmRydXNo
Y2hlbmtvQGVwYW0uY29tPg0KPj4gPj4gQEAgLTQ5OCw2ICs1MzcsNyBAQCB2b2lkIHZwY2lfd3Jp
dGUocGNpX3NiZGZfdCBzYmRmLCB1bnNpZ25lZCBpbnQgcmVnLCB1bnNpZ25lZCBpbnQgc2l6ZSwN
Cj4+ID4+ICAgICAgICAgIEFTU0VSVChkYXRhX29mZnNldCA8IHNpemUpOw0KPj4gPj4gICAgICB9
DQo+PiA+PiAgICAgIHNwaW5fdW5sb2NrKCZwZGV2LT52cGNpL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6IGh2bV9w
aV91cGRhdGVfaXJ0ZSgpLCB3aGljaCBjYWxscyBJTy1NTVUgY29kZSB2aWENCnZteF9waV91cGRh
dGVfaXJ0ZSgpOg0KDQphbWRfaW9tbXVfbXNpX21zZ191cGRhdGVfaXJlKCkgb3IgbXNpX21zZ193
cml0ZV9yZW1hcF9ydGUoKS4NCg0KQm90aCBmdW5jdGlvbnMgcmVhZCBiYXNpYyBwZGV2IGZpZWxk
cyBsaWtlIHNiZmQgb3IgdHlwZS4gSSBzZWUgbm8NCnByb2JsZW0gdGhlcmUsIGFzIHZhbHVlcyBv
ZiB0aG9zZSBmaWVsZHMgYXJlIG5vdCBzdXBwb3NlZCB0byBiZSBjaGFuZ2VkLg0KQWxzbyB0aG9z
ZSBmdW5jdGlvbiB1c2Ugb3duIGxvY2tzIHRvIHByb3RlY3Qgc2hhcmVkIHN0YXRlLiBCdXQgYXMg
SU8tTU1VDQpjb2RlIGlzIHF1aXRlIGNvbnZvbHV0ZWQgaXQgaXMgaGFyZCB0byBiZSBzdXJlIHRo
YXQgaXQgaXMgc2FmZSB0byBjYWxsDQp0aG9zZSBmdW5jdGlvbnMgd2l0aG91dCBob2xkaW5nIHBk
ZXZzX2xvY2suIEFsbCBJIGNhbiBzYXkgaXMgdGhhdCB0aG9zZQ0KZnVuY3Rpb25zIGFuZCB0aGVp
ciBjYWxsZWVzIGhhdmUgbm8gQVNTRVJUKHBjaWRldnNfbG9ja2VkKCkpLg0KDQotLSANCldCUiwg
Vm9sb2R5bXly


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 01:52:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 01:52:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570762.892869 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOqAT-0003BF-Kn; Thu, 27 Jul 2023 01:51:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570762.892869; Thu, 27 Jul 2023 01:51:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOqAT-0003At-Ey; Thu, 27 Jul 2023 01:51:53 +0000
Received: by outflank-mailman (input) for mailman id 570762;
 Thu, 27 Jul 2023 01:51:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOqAS-0003Aj-D1; Thu, 27 Jul 2023 01:51:52 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOqAS-00037x-BJ; Thu, 27 Jul 2023 01:51:52 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOqAR-0000v7-P3; Thu, 27 Jul 2023 01:51:51 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOqAR-0004FQ-NB; Thu, 27 Jul 2023 01:51:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=3QoPhrpJZ6QKq1EfABzsXIZj8ybymlYylqpTB7NNBq0=; b=fltPDPF14/JScg/NYE8JY684Hz
	f7fon8RzvT0W2MKZgsdBC+bsxz4p8qhGKPaCzEfWNPjzutHq+sVZVsexfzlBp9oFlM2D/qxDfSLSe
	9Eiq9A8/kpJDV4Uo0YiWSUkQMSUbC8Y/2YDc49AeWavbeDUgzWPUTQqOnLvSUiRFtMsk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182028-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 182028: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=f126d7eeba33a1de04f6d9f6f64855637d4eadb9
X-Osstest-Versions-That:
    xen=3d2d4ea026df73c37a7df7e216443cbf652ff892
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 27 Jul 2023 01:51:51 +0000

flight 182028 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182028/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  f126d7eeba33a1de04f6d9f6f64855637d4eadb9
baseline version:
 xen                  3d2d4ea026df73c37a7df7e216443cbf652ff892

Last test of basis   182024  2023-07-26 13:01:24 Z    0 days
Testing same since   182028  2023-07-26 23:00:27 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Federico Serafini <federico.serafini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Simone Ballarin <simone.ballarin@bugseng.com>
  Stefano Stabellini <sstabellini@kernel.org>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   3d2d4ea026..f126d7eeba  f126d7eeba33a1de04f6d9f6f64855637d4eadb9 -> smoke


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 03:35:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 03:35:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570771.892879 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOrm7-0005Fr-Vn; Thu, 27 Jul 2023 03:34:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570771.892879; Thu, 27 Jul 2023 03:34:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOrm7-0005Fk-TH; Thu, 27 Jul 2023 03:34:51 +0000
Received: by outflank-mailman (input) for mailman id 570771;
 Thu, 27 Jul 2023 03:34:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOrm6-0005Fe-H5
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 03:34:50 +0000
Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com
 [2607:f8b0:4864:20::42e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 88d96e68-2c2e-11ee-b246-6b7b168915f2;
 Thu, 27 Jul 2023 05:34:48 +0200 (CEST)
Received: by mail-pf1-x42e.google.com with SMTP id
 d2e1a72fcca58-686f6231bdeso51605b3a.1
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 20:34:48 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 z25-20020aa791d9000000b006828ee9fa69sm328803pfa.206.2023.07.26.20.34.35
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 26 Jul 2023 20:34:46 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 88d96e68-2c2e-11ee-b246-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690428886; x=1691033686;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=pSHiqW/1Kwa6XMfrutppYGKtzk0jA+6GZMwxRhGaywI=;
        b=JH3Gdn8erluTpD0SiBv0fHlvH29QoJbVthZHImXx40T/IvgK0JIjZ0GSYiuzzLmgEA
         bHXNFFpOY9uD+vNkdeoyqNVINpCZUHYDiHMEBDkcaaYiJnpqdxqxP9HCH+uCZSOxVPaX
         a40KLwmD/5OmsTBlZF8d2TLCkDFfaCI3tBilLI9wA3S9O/RNu5Wh5IyCFOIuf9bbZc9M
         BojY8O58Av3dHh2cjAZwQFUo45GIDCrR2qRfQCljzavnidON0gNgsmWW0OgyxUqV3yLa
         +g0Rro6R0vH8urzZTF9hLw+CTeEMI8A36Bu5e/fFgdet0UR9Esy2HUMsL8V+5OEcbFBS
         k6XQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690428886; x=1691033686;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=pSHiqW/1Kwa6XMfrutppYGKtzk0jA+6GZMwxRhGaywI=;
        b=Xvo3ue5qEB1/OyMJHyjJs3rVpnmsEDak3tshJPYKLYOnRKmQABF+0x5pSU/Fxt5rNP
         MMY9YTmFXB8lVpRbCLiafYHoH7rzMCx6MH2cC2A5VLvg40Jk9R/gkD2wN20TAToo9pnV
         38TUvZjSPzhKDdolNiF1D/CTFNnQsPvbsbCosTFZCu9lW0wcce6hjePeGhcnVCLhdHTo
         LILGiLXoukkjgAAOs1zDVq8OiW8qONOsDqCfIyb6H6sIGgfCRGow55buCFC/u1ihksHJ
         FXomo6oiB1MJN657Oyl0lBEzRdUwQM7+MoVkHKQoz1DooIN42rTcyvXQkzazkfrYvCya
         jPbg==
X-Gm-Message-State: ABy/qLawpVH4/Y6jirxKZ7NyGq5yxqAfo+wrI1j0qaaxOLquQH1pgmvc
	HNW6wRcX2uR3llfDJlKXfdR7IQ==
X-Google-Smtp-Source: APBJJlGnfHXNUKtpZ8goterp0kPe1+GeF2c87BsTqhWXyrNp01VQ9DDS/+17IDHKN7LAqAttouOeag==
X-Received: by 2002:a05:6a21:339b:b0:137:4fd0:e2e6 with SMTP id yy27-20020a056a21339b00b001374fd0e2e6mr5017607pzb.6.1690428886364;
        Wed, 26 Jul 2023 20:34:46 -0700 (PDT)
Message-ID: <c942e424-276d-4df7-4917-d61063ab8502@bytedance.com>
Date: Thu, 27 Jul 2023 11:34:30 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v2 44/47] mm: shrinker: make global slab shrink lockless
Content-Language: en-US
To: Dave Chinner <david@fromorbit.com>
Cc: akpm@linux-foundation.org, tkhai@ya.ru, vbabka@suse.cz,
 roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org,
 paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com, cel@kernel.org,
 senozhatsky@chromium.org, yujie.liu@intel.com, gregkh@linuxfoundation.org,
 muchun.song@linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org,
 x86@kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org
References: <20230724094354.90817-1-zhengqi.arch@bytedance.com>
 <20230724094354.90817-45-zhengqi.arch@bytedance.com>
 <ZMDUkoIXUlTkCSYL@dread.disaster.area>
 <19ad6d06-8a14-6102-5eae-2134dc2c5061@bytedance.com>
 <ZMGnthZAh48JF+eV@dread.disaster.area>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <ZMGnthZAh48JF+eV@dread.disaster.area>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Dave,

On 2023/7/27 07:09, Dave Chinner wrote:
> On Wed, Jul 26, 2023 at 05:14:09PM +0800, Qi Zheng wrote:
>> On 2023/7/26 16:08, Dave Chinner wrote:
>>> On Mon, Jul 24, 2023 at 05:43:51PM +0800, Qi Zheng wrote:
>>>> @@ -122,6 +126,13 @@ void shrinker_free_non_registered(struct shrinker *shrinker);
>>>>    void shrinker_register(struct shrinker *shrinker);
>>>>    void shrinker_unregister(struct shrinker *shrinker);
>>>> +static inline bool shrinker_try_get(struct shrinker *shrinker)
>>>> +{
>>>> +	return READ_ONCE(shrinker->registered) &&
>>>> +	       refcount_inc_not_zero(&shrinker->refcount);
>>>> +}
>>>
>>> Why do we care about shrinker->registered here? If we don't set
>>> the refcount to 1 until we have fully initialised everything, then
>>> the shrinker code can key entirely off the reference count and
>>> none of the lookup code needs to care about whether the shrinker is
>>> registered or not.
>>
>> The purpose of checking shrinker->registered here is to stop running
>> shrinker after calling shrinker_free(), which can prevent the following
>> situations from happening:
>>
>> CPU 0                 CPU 1
>>
>> shrinker_try_get()
>>
>>                         shrinker_try_get()
>>
>> shrinker_put()
>> shrinker_try_get()
>>                         shrinker_put()
> 
> I don't see any race here? What is wrong with having multiple active
> users at once?

Maybe I'm overthinking. What I think is that if there are multiple users
at once, it may cause the above-mentioned livelock, which will cause
shrinker_free() to wait for a long time. But this probability should be
very low.

> 
>>>
>>> This should use a completion, then it is always safe under
>>> rcu_read_lock().  This also gets rid of the shrinker_lock spin lock,
>>> which only exists because we can't take a blocking lock under
>>> rcu_read_lock(). i.e:
>>>
>>>
>>> void shrinker_put(struct shrinker *shrinker)
>>> {
>>> 	if (refcount_dec_and_test(&shrinker->refcount))
>>> 		complete(&shrinker->done);
>>> }
>>>
>>> void shrinker_free()
>>> {
>>> 	.....
>>> 	refcount_dec(&shrinker->refcount);
>>
>> I guess what you mean is shrinker_put(), because here may be the last
>> refcount.
> 
> Yes, I did.
> 
>>> 	wait_for_completion(&shrinker->done);
>>> 	/*
>>> 	 * lookups on the shrinker will now all fail as refcount has
>>> 	 * fallen to zero. We can now remove it from the lists and
>>> 	 * free it.
>>> 	 */
>>> 	down_write(shrinker_rwsem);
>>> 	list_del_rcu(&shrinker->list);
>>> 	up_write(&shrinker_rwsem);
>>> 	call_rcu(shrinker->rcu_head, shrinker_free_rcu_cb);
>>> }
>>>
>>> ....
>>>
>>>> @@ -686,11 +711,14 @@ EXPORT_SYMBOL(shrinker_free_non_registered);
>>>>    void shrinker_register(struct shrinker *shrinker)
>>>>    {
>>>> -	down_write(&shrinker_rwsem);
>>>> -	list_add_tail(&shrinker->list, &shrinker_list);
>>>> -	shrinker->flags |= SHRINKER_REGISTERED;
>>>> +	refcount_set(&shrinker->refcount, 1);
>>>> +
>>>> +	spin_lock(&shrinker_lock);
>>>> +	list_add_tail_rcu(&shrinker->list, &shrinker_list);
>>>> +	spin_unlock(&shrinker_lock);
>>>> +
>>>>    	shrinker_debugfs_add(shrinker);
>>>> -	up_write(&shrinker_rwsem);
>>>> +	WRITE_ONCE(shrinker->registered, true);
>>>>    }
>>>>    EXPORT_SYMBOL(shrinker_register);
>>>
>>> This just looks wrong - you are trying to use WRITE_ONCE() as a
>>> release barrier to indicate that the shrinker is now set up fully.
>>> That's not necessary - the refcount is an atomic and along with the
>>> rcu locks they should provides all the barriers we need. i.e.
>>
>> The reason I used WRITE_ONCE() here is because the shrinker->registered
>> will be read and written concurrently (read in shrinker_try_get() and
>> written in shrinker_free()), which is why I added shrinker::registered
>> field instead of using SHRINKER_REGISTERED flag (this can reduce the
>> addition of WRITE_ONCE()/READ_ONCE()).
> 
> Using WRITE_ONCE/READ_ONCE doesn't provide memory barriers needed to
> use the field like this. You need release/acquire memory ordering
> here. i.e. smp_store_release()/smp_load_acquire().
> 
> As it is, the refcount_inc_not_zero() provides a control dependency,
> as documented in include/linux/refcount.h, refcount_dec_and_test()
> provides release memory ordering. The only thing I think we may need
> is a write barrier before refcount_set(), such that if
> refcount_inc_not_zero() sees a non-zero value, it is guaranteed to
> see an initialised structure...
> 
> i.e. refcounts provide all the existence and initialisation
> guarantees. Hence I don't see the need to use shrinker->registered
> like this and it can remain a bit flag protected by the
> shrinker_rwsem().

Ah, I didn't consider the memory order with refcount when I added
WRITE_ONCE/READ_ONCE to shrinker->registered, just didn't want KCSAN
to complain (there are multiple visitors at the same time, one of which
is a writer).

And the livelock case mentioned above is indeed unlikely to happen, so
I will delete shrinker->registered in the next version.

> 
> 
>>> void shrinker_register(struct shrinker *shrinker)
>>> {
>>> 	down_write(&shrinker_rwsem);
>>> 	list_add_tail_rcu(&shrinker->list, &shrinker_list);
>>> 	shrinker->flags |= SHRINKER_REGISTERED;
>>> 	shrinker_debugfs_add(shrinker);
>>> 	up_write(&shrinker_rwsem);
>>>
>>> 	/*
>>> 	 * now the shrinker is fully set up, take the first
>>> 	 * reference to it to indicate that lookup operations are
>>> 	 * now allowed to use it via shrinker_try_get().
>>> 	 */
>>> 	refcount_set(&shrinker->refcount, 1);
>>> }
>>>
>>>> diff --git a/mm/shrinker_debug.c b/mm/shrinker_debug.c
>>>> index f1becfd45853..c5573066adbf 100644
>>>> --- a/mm/shrinker_debug.c
>>>> +++ b/mm/shrinker_debug.c
>>>> @@ -5,6 +5,7 @@
>>>>    #include <linux/seq_file.h>
>>>>    #include <linux/shrinker.h>
>>>>    #include <linux/memcontrol.h>
>>>> +#include <linux/rculist.h>
>>>>    /* defined in vmscan.c */
>>>>    extern struct rw_semaphore shrinker_rwsem;
>>>> @@ -161,17 +162,21 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
>>>>    {
>>>>    	struct dentry *entry;
>>>>    	char buf[128];
>>>> -	int id;
>>>> -
>>>> -	lockdep_assert_held(&shrinker_rwsem);
>>>> +	int id, ret = 0;
>>>>    	/* debugfs isn't initialized yet, add debugfs entries later. */
>>>>    	if (!shrinker_debugfs_root)
>>>>    		return 0;
>>>> +	down_write(&shrinker_rwsem);
>>>> +	if (shrinker->debugfs_entry)
>>>> +		goto fail;
>>>> +
>>>>    	id = ida_alloc(&shrinker_debugfs_ida, GFP_KERNEL);
>>>> -	if (id < 0)
>>>> -		return id;
>>>> +	if (id < 0) {
>>>> +		ret = id;
>>>> +		goto fail;
>>>> +	}
>>>>    	shrinker->debugfs_id = id;
>>>>    	snprintf(buf, sizeof(buf), "%s-%d", shrinker->name, id);
>>>> @@ -180,7 +185,8 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
>>>>    	entry = debugfs_create_dir(buf, shrinker_debugfs_root);
>>>>    	if (IS_ERR(entry)) {
>>>>    		ida_free(&shrinker_debugfs_ida, id);
>>>> -		return PTR_ERR(entry);
>>>> +		ret = PTR_ERR(entry);
>>>> +		goto fail;
>>>>    	}
>>>>    	shrinker->debugfs_entry = entry;
>>>> @@ -188,7 +194,10 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
>>>>    			    &shrinker_debugfs_count_fops);
>>>>    	debugfs_create_file("scan", 0220, entry, shrinker,
>>>>    			    &shrinker_debugfs_scan_fops);
>>>> -	return 0;
>>>> +
>>>> +fail:
>>>> +	up_write(&shrinker_rwsem);
>>>> +	return ret;
>>>>    }
>>>>    int shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...)
>>>> @@ -243,6 +252,11 @@ struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
>>>>    	shrinker->name = NULL;
>>>>    	*debugfs_id = entry ? shrinker->debugfs_id : -1;
>>>> +	/*
>>>> +	 * Ensure that shrinker->registered has been set to false before
>>>> +	 * shrinker->debugfs_entry is set to NULL.
>>>> +	 */
>>>> +	smp_wmb();
>>>>    	shrinker->debugfs_entry = NULL;
>>>>    	return entry;
>>>> @@ -266,14 +280,26 @@ static int __init shrinker_debugfs_init(void)
>>>>    	shrinker_debugfs_root = dentry;
>>>>    	/* Create debugfs entries for shrinkers registered at boot */
>>>> -	down_write(&shrinker_rwsem);
>>>> -	list_for_each_entry(shrinker, &shrinker_list, list)
>>>> +	rcu_read_lock();
>>>> +	list_for_each_entry_rcu(shrinker, &shrinker_list, list) {
>>>> +		if (!shrinker_try_get(shrinker))
>>>> +			continue;
>>>> +		rcu_read_unlock();
>>>> +
>>>>    		if (!shrinker->debugfs_entry) {
>>>> -			ret = shrinker_debugfs_add(shrinker);
>>>> -			if (ret)
>>>> -				break;
>>>> +			/* Paired with smp_wmb() in shrinker_debugfs_detach() */
>>>> +			smp_rmb();
>>>> +			if (READ_ONCE(shrinker->registered))
>>>> +				ret = shrinker_debugfs_add(shrinker);
>>>>    		}
>>>> -	up_write(&shrinker_rwsem);
>>>> +
>>>> +		rcu_read_lock();
>>>> +		shrinker_put(shrinker);
>>>> +
>>>> +		if (ret)
>>>> +			break;
>>>> +	}
>>>> +	rcu_read_unlock();
>>>>    	return ret;
>>>>    }
>>>
>>> And all this churn and complexity can go away because the
>>> shrinker_rwsem is still used to protect shrinker_register()
>>> entirely....
>>
>> My consideration is that during this process, there may be a
>> driver probe failure and then shrinker_free() is called (the
>> shrinker_debugfs_init() is called in late_initcall stage). In
>> this case, we need to use RCU+refcount to ensure that the shrinker
>> is not freed.
> 
> Yeah, you're trying to work around the lack of a
> wait_for_completion() call in shrinker_free().
> 
> With that, this doesn't need RCU at all, and the iteration can be
> done fully under the shrinker_rwsem() safely and so none of this
> code needs to change.

Oh, indeed, here does not need to be changed.

Thanks,
Qi

> 
> Cheers,
> 
> Dave.


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 03:38:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 03:38:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570774.892888 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOrpQ-0005qa-FP; Thu, 27 Jul 2023 03:38:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570774.892888; Thu, 27 Jul 2023 03:38:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOrpQ-0005qT-Cx; Thu, 27 Jul 2023 03:38:16 +0000
Received: by outflank-mailman (input) for mailman id 570774;
 Thu, 27 Jul 2023 03:38:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOrpP-0005qH-8e; Thu, 27 Jul 2023 03:38:15 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOrpP-0006JG-4g; Thu, 27 Jul 2023 03:38:15 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qOrpO-0004wK-N4; Thu, 27 Jul 2023 03:38:14 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qOrpO-00046m-MW; Thu, 27 Jul 2023 03:38:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Oa61qWnmQWILHpimu9AQOFKrv2papVZKn86FXkpqquA=; b=PuILOGRvpy8XFAX8sitoTP6Rnf
	xq7a2Xiijw2z7Ml3darh98dVrFVF4ksOV8IWNJe+9M5NCdZWPGriFwp0xTmeU/B0HttNDW9glsWpR
	zgRWsM3DxaTEZjceF88beblluDpyzVtQR7cxR6NCTYllh2F8EPKvljMwkYIkgeXOJQaI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182023-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 182023: tolerable FAIL - PUSHED
X-Osstest-Failures:
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=6cb2011fedf8c4e7b66b4a3abd6b42c1bae99ce6
X-Osstest-Versions-That:
    qemuu=885fc169f09f5915ce037263d20a59eb226d473d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 27 Jul 2023 03:38:14 +0000

flight 182023 qemu-mainline real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182023/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182006
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 182006
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182006
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 182006
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 182006
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182006
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182006
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 182006
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 qemuu                6cb2011fedf8c4e7b66b4a3abd6b42c1bae99ce6
baseline version:
 qemuu                885fc169f09f5915ce037263d20a59eb226d473d

Last test of basis   182006  2023-07-25 05:21:48 Z    1 days
Testing same since   182023  2023-07-26 13:00:59 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrei Gudkov <gudkov.andrei@huawei.com>
  Ani Sinha <anisinha@redhat.com>
  Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
  Bernhard Beschow <shentey@gmail.com>
  Guenter Roeck <linux@roeck-us.net>
  Ilya Leoshkevich <iii@linux.ibm.com>
  Juan Quintela <quintela@redhat.com>
  Markus Armbruster <armbru@redhat.com>
  Michael Tokarev <mjt@tls.msk.ru>
  Peter Maydell <peter.maydell@linaro.org>
  Peter Xu <peterx@redhat.com>
  Philippe Mathieu-DaudÃ© <philmd@linaro.org>
  Sean Estabrooks <sean.estabrooks@gmail.com>
  Thomas Huth <huth@tuxfamily.org>
  Thomas Huth <thuth@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/qemu-xen.git
   885fc169f0..6cb2011fed  6cb2011fedf8c4e7b66b4a3abd6b42c1bae99ce6 -> upstream-tested


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 05:15:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 05:15:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570781.892899 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOtLD-0008D1-Gh; Thu, 27 Jul 2023 05:15:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570781.892899; Thu, 27 Jul 2023 05:15:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOtLD-0008Cu-Bw; Thu, 27 Jul 2023 05:15:11 +0000
Received: by outflank-mailman (input) for mailman id 570781;
 Thu, 27 Jul 2023 05:15:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kK8p=DN=linaro.org=viresh.kumar@srs-se1.protection.inumbo.net>)
 id 1qOtLB-0008Co-Bn
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 05:15:09 +0000
Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com
 [2607:f8b0:4864:20::431])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8c7702fa-2c3c-11ee-b246-6b7b168915f2;
 Thu, 27 Jul 2023 07:15:07 +0200 (CEST)
Received: by mail-pf1-x431.google.com with SMTP id
 d2e1a72fcca58-686b643df5dso440794b3a.1
 for <xen-devel@lists.xenproject.org>; Wed, 26 Jul 2023 22:15:07 -0700 (PDT)
Received: from localhost ([122.172.87.195]) by smtp.gmail.com with ESMTPSA id
 iw12-20020a170903044c00b001bbbc655ca1sm497667plb.219.2023.07.26.22.15.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Jul 2023 22:15:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8c7702fa-2c3c-11ee-b246-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690434905; x=1691039705;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=IqB43PdmbcTw3ufSyQ43JzmiXWlC5qoPqlYdpi0HhWU=;
        b=hf7QWxp3ar4MlFB5JLFFXxpezzS0Ih4ly9DH1KLy2sZujvYzui17Pqr4iInmPdd+AW
         Rbh2paRnkEd8YcKkwWNZfQQMPpgYP+w+SCXYy4Dq92bKc+BEgIV53cRx+pp/85GumokE
         ny0cKtGJanZnZL/9UufrTRr7GEG7w277pm3qux9CbNlnbsDGbQx3vn8YZEWH6lRlfQ+c
         bPgjjmA26ZfgpqmUunQyhCfOVa7HNQS2gvz4AXW2dW7NjhthSp3VIxdHn4yFth2kmWxR
         bhQrMZjgWuFztLyML9KA2xlIy6cp4TCuExVhbKAV45BLDnGflxGzdh0ogoJP+UJdtoO1
         0GTA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690434905; x=1691039705;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=IqB43PdmbcTw3ufSyQ43JzmiXWlC5qoPqlYdpi0HhWU=;
        b=SxFo+XQkB6xGAgd9BYiOnP2xAueeGvgRnlpVHqrakbZhnMD103DX0aFWPegOu5qJ5D
         2KVTqBbW5040SWZOWb06Zum8n5Jgijl4CZivuQXo8+kaKjl3gkxnDjvvmoo6DJCHa+sQ
         fyPy2U5Ua0Nkhz4Ch7CeHm5tO4/imhtjaZCqfJq6fjmcOQZETrB7RMzKUERp+9VgilcZ
         mUmK+mXqpO/pxPyt8uCbGYPZ571gPPs5d98OIrfqM6gqEmA+cR4+Yv4JjivXWF3X23kR
         GQDDXrrPSgqhHa56QhN0DpjOYNB226GT5s0EpuagcEoWK4GMzxjCiS3I9bqyqdT2yl3P
         Rmag==
X-Gm-Message-State: ABy/qLYI2ciySMBrQM2n+AS87gRqnVvDPSVEeG9V/qsJK4V2Xpt2peDN
	KixpfG/X1mvqZ/qsrL1SzttbAw==
X-Google-Smtp-Source: APBJJlEMiFAtgaJQTG65kCCrdS97rmEW1MfWMKFi0qwBcIbLxvgB5x3ZMnkyt+g9hsEdIjt2iXVs+g==
X-Received: by 2002:a05:6a20:3d2a:b0:133:901:fe55 with SMTP id y42-20020a056a203d2a00b001330901fe55mr4402761pzi.38.1690434905485;
        Wed, 26 Jul 2023 22:15:05 -0700 (PDT)
Date: Thu, 27 Jul 2023 10:45:02 +0530
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Oleksandr Tyshchenko <olekstysh@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH] libxl: Add missing libxl__virtio_devtype to
 device_type_tbl array
Message-ID: <20230727051502.wtwi3k5ojhjduhql@vireshk-i7>
References: <20230726141459.985463-1-olekstysh@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20230726141459.985463-1-olekstysh@gmail.com>

On 26-07-23, 17:14, Oleksandr Tyshchenko wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 
> Without it being present it won't be possible to use some
> libxl__device_type's callbacks for virtio devices as the common code
> can only invoke these callbacks (by dereferencing a pointer) for valid
> libxl__device_type's elements when iterating over device_type_tbl[].
> 
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> ---
>  tools/libs/light/libxl_create.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
> index 393c535579..c91059d713 100644
> --- a/tools/libs/light/libxl_create.c
> +++ b/tools/libs/light/libxl_create.c
> @@ -1887,6 +1887,7 @@ const libxl__device_type *device_type_tbl[] = {
>      &libxl__dtdev_devtype,
>      &libxl__vdispl_devtype,
>      &libxl__vsnd_devtype,
> +    &libxl__virtio_devtype,
>      NULL
>  };

Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 05:30:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 05:30:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570784.892909 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOtaI-0002G5-OO; Thu, 27 Jul 2023 05:30:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570784.892909; Thu, 27 Jul 2023 05:30:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOtaI-0002Fy-KF; Thu, 27 Jul 2023 05:30:46 +0000
Received: by outflank-mailman (input) for mailman id 570784;
 Thu, 27 Jul 2023 05:30:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=PqFe=DN=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qOtaI-0002Fs-52
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 05:30:46 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bbd82790-2c3e-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 07:30:44 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 32D7021B82;
 Thu, 27 Jul 2023 05:30:44 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 03D6F138E5;
 Thu, 27 Jul 2023 05:30:43 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id EqrzOgMBwmRbfwAAMHmgww
 (envelope-from <jgross@suse.com>); Thu, 27 Jul 2023 05:30:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bbd82790-2c3e-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690435844; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=S85VZ1Bg5eFUHBIs1TmYsF9LGbx0r23IuB4QCTVlNMY=;
	b=jaIEt0aMR2Rp2VPqgJKXQC0xEILQNQocmtuJOqjqp2fDyp36rnHfZBMevcBUyU/cH2cyvd
	wvmRIYCEksZbsmaihBb/qkV4mwRxi2t9a7BYZJf9OcaXzVE/WSyx4/ODMCVNQDUsWYc0g7
	BxjIqlOtmvEs5xTnRSXTA+tAFLtMN8k=
Message-ID: <6842949f-a955-b73b-7a9e-8e93657b2f40@suse.com>
Date: Thu, 27 Jul 2023 07:30:42 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v4] xen: speed up grant-table reclaim
Content-Language: en-US
To: Demi Marie Obenour <demi@invisiblethingslab.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Xen developer discussion <xen-devel@lists.xenproject.org>,
 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
 stable@vger.kernel.org
References: <20230627172216.1359-1-demi@invisiblethingslab.com>
 <20230726165354.1252-1-demi@invisiblethingslab.com>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <20230726165354.1252-1-demi@invisiblethingslab.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------ZGkv1JTl5MGJG34IhnAZglmk"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------ZGkv1JTl5MGJG34IhnAZglmk
Content-Type: multipart/mixed; boundary="------------f8E1sN4Er4CzU5ittAAqYdAW";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Demi Marie Obenour <demi@invisiblethingslab.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Xen developer discussion <xen-devel@lists.xenproject.org>,
 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
 stable@vger.kernel.org
Message-ID: <6842949f-a955-b73b-7a9e-8e93657b2f40@suse.com>
Subject: Re: [PATCH v4] xen: speed up grant-table reclaim
References: <20230627172216.1359-1-demi@invisiblethingslab.com>
 <20230726165354.1252-1-demi@invisiblethingslab.com>
In-Reply-To: <20230726165354.1252-1-demi@invisiblethingslab.com>

--------------f8E1sN4Er4CzU5ittAAqYdAW
Content-Type: multipart/mixed; boundary="------------fmbcQldT8wBclasItfmALE0m"

--------------fmbcQldT8wBclasItfmALE0m
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjYuMDcuMjMgMTg6NTIsIERlbWkgTWFyaWUgT2Jlbm91ciB3cm90ZToNCj4gV2hlbiBh
IGdyYW50IGVudHJ5IGlzIHN0aWxsIGluIHVzZSBieSB0aGUgcmVtb3RlIGRvbWFpbiwgTGlu
dXggbXVzdCBwdXQNCj4gaXQgb24gYSBkZWZlcnJl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zLg0KPiAN
Cj4gQ2M6IHN0YWJsZUB2Z2VyLmtlcm5lbC5vcmcNCj4gU2lnbmVkLW9mZi1ieTogRGVtaSBN
YXJpZSBPYmVub3VyIDxkZW1pQGludmlzaWJsZXRoaW5nc2xhYi5jb20+DQoNClJldmlld2Vk
LWJ5OiBKdWVyZ2VuIEdyb3NzIDxqZ3Jvc3NAc3VzZS5jb20+DQoNCg0KSnVlcmdlbg0KDQo=

--------------fmbcQldT8wBclasItfmALE0m
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WG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8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------fmbcQldT8wBclasItfmALE0m--

--------------f8E1sN4Er4CzU5ittAAqYdAW--

--------------ZGkv1JTl5MGJG34IhnAZglmk
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmTCAQMFAwAAAAAACgkQsN6d1ii/Ey9v
7Af/UcL9ZwVgufL4OUPDqEaWGp9Lpg9u3jqURxOBY104E9Cpm2kjwilzEPNs8+6l+kKA/8ucD4Fj
LV7IQ/N+HNTasVNnK9Ew20m/t1Q++KBqJ4/MLoKabEjsGDSZOMadsZWIk0CXh+tJoGIU793qEH22
fvP1qkKK83ErkeSbVsU0kBPFzHmzqe4LVBgcP1Stou992Go8M3GXM6ZnHUQ7de6zrwylMzw8CyHA
ayAGfP6uxbAXH4dO0KhMM7oE1+w1RfWHPZII6a/FVJ7wGWSx0V4xiWa0ZSJdejIg+P4hA+hhFhoM
s9XCOuh3L8ZIRT9jTX/YPEPiVoabo/5/n2fd24+YNg==
=cvz8
-----END PGP SIGNATURE-----

--------------ZGkv1JTl5MGJG34IhnAZglmk--


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 05:54:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 05:54:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570788.892918 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOtx5-0004jg-Hk; Thu, 27 Jul 2023 05:54:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570788.892918; Thu, 27 Jul 2023 05:54:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOtx5-0004jZ-F7; Thu, 27 Jul 2023 05:54:19 +0000
Received: by outflank-mailman (input) for mailman id 570788;
 Thu, 27 Jul 2023 05:54:18 +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 <SRS0=PqFe=DN=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qOtx4-0004jT-Hr
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 05:54:18 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0531daae-2c42-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 07:54:16 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 02B9A1F383;
 Thu, 27 Jul 2023 05:54:16 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id CF38D1341F;
 Thu, 27 Jul 2023 05:54:15 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id bevrMIcGwmR9CQAAMHmgww
 (envelope-from <jgross@suse.com>); Thu, 27 Jul 2023 05:54:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0531daae-2c42-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690437256; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=cTOhp7gzTtljGoWxVjaxLCsraETAq5ShPGu+HEHGneU=;
	b=kouLPPETSOQji+YuSUZn4VWQKS38RgenGK9AuclG8s5ievjs7AzqDgqsOlJl1+fMqv40FM
	8EX1svd4id95S4IoS4r4lOHX7tqoGuwy3MCbd+n5t9HUDlBYSontHJhTeeHL8/zEiGcc09
	d7prEswbfzVVCVah8B615qZWUBsT0+c=
Message-ID: <a54de6ad-ecbd-4f79-f82a-2f54be38bde7@suse.com>
Date: Thu, 27 Jul 2023 07:54:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH] xenbus: check xen_domain in xenbus_probe_initcall
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: oleksandr_tyshchenko@epam.com, xen-devel@lists.xenproject.org,
 pmladek@suse.com
References: <alpine.DEB.2.22.394.2307211609140.3118466@ubuntu-linux-20-04-desktop>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307211609140.3118466@ubuntu-linux-20-04-desktop>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------Cr8v2k08dQPD0rbCXOR0kF4U"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------Cr8v2k08dQPD0rbCXOR0kF4U
Content-Type: multipart/mixed; boundary="------------jEc0T0g0KIX9PQpz0HsSEoCn";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: oleksandr_tyshchenko@epam.com, xen-devel@lists.xenproject.org,
 pmladek@suse.com
Message-ID: <a54de6ad-ecbd-4f79-f82a-2f54be38bde7@suse.com>
Subject: Re: [PATCH] xenbus: check xen_domain in xenbus_probe_initcall
References: <alpine.DEB.2.22.394.2307211609140.3118466@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2307211609140.3118466@ubuntu-linux-20-04-desktop>

--------------jEc0T0g0KIX9PQpz0HsSEoCn
Content-Type: multipart/mixed; boundary="------------YtQ5G1DImMCnPEcdyeqV0D72"

--------------YtQ5G1DImMCnPEcdyeqV0D72
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjIuMDcuMjMgMDE6MTMsIFN0ZWZhbm8gU3RhYmVsbGluaSB3cm90ZToNCj4gVGhlIHNh
bWUgd2F5IHdlIGFscmVhZHkgZG8gaW4geGVuYnVzX2luaXQuDQo+IEZpeGVzIHRoZSBmb2xs
b3dpbmcgd2FybmluZzoNCj4gDQo+IFsgIDM1Mi4xNzU1NjNdIFRyeWluZyB0byBmcmV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+DQoNClB1c2hlZCB0byB4ZW4vdGlwLmdpdCBm
b3ItbGludXMtNi41YQ0KDQoNCkp1ZXJnZW4NCg0K
--------------YtQ5G1DImMCnPEcdyeqV0D72
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5RnNVUJbvoPHZ8SlM4KWm8rG+lIkGurq
qu5gu8q8ZMKdsdGC4bBxdQKDKHEFExLJK/nRPFmAuGlId1E3fe10v5QL+qHI3EIP
tyfE7i9Hz6rVwi7lWKgh7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d3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------YtQ5G1DImMCnPEcdyeqV0D72--

--------------jEc0T0g0KIX9PQpz0HsSEoCn--

--------------Cr8v2k08dQPD0rbCXOR0kF4U
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmTCBocFAwAAAAAACgkQsN6d1ii/Ey8N
hgf/ZULN+ts5xyA7sfl0WnA7tusFl3CDVWcLQVBCAhDSmm29HHTkPjQNbwBNWUKw7lWS5ZBQmGMM
yhwwtFtRi18vF4Qm7yrnhoL6oEpayrtOxXPfQ4rc1dzdfUEzHOiQ1loxWbrNH962HLqoSp7PaSsN
Vmq3bokMo+LHLTs26B88ahBbE8NlRncfHA3DvWF+7AIqqX408na6aepoB3bqXCZp1sC5IhN6B92I
W3cMxkJZGmIF5v9eznj0JFiO4JO+cyWJplHUAH1kL5Q55IALlAI1ZTGWHj/JOBVK9s/x44Pmhfwl
wC7XPk7IQjdZkcLX4WKaoV3qJEKgK2Ir3alOrn96fQ==
=9R1l
-----END PGP SIGNATURE-----

--------------Cr8v2k08dQPD0rbCXOR0kF4U--


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 05:54:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 05:54:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570790.892928 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOtxc-0005B2-Pt; Thu, 27 Jul 2023 05:54:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570790.892928; Thu, 27 Jul 2023 05:54:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOtxc-0005As-N2; Thu, 27 Jul 2023 05:54:52 +0000
Received: by outflank-mailman (input) for mailman id 570790;
 Thu, 27 Jul 2023 05:54:51 +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 <SRS0=PqFe=DN=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qOtxb-0004jT-EE
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 05:54:51 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 191a6f30-2c42-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 07:54:49 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 6F00E21B4A;
 Thu, 27 Jul 2023 05:54:49 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2B1C81341F;
 Thu, 27 Jul 2023 05:54:49 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id s8W7CKkGwmS6CQAAMHmgww
 (envelope-from <jgross@suse.com>); Thu, 27 Jul 2023 05:54:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 191a6f30-2c42-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690437289; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=6FH6OIxXDPjwY8sydASc46G8K1EY8W062wfCfb4fRCg=;
	b=HqhW8p9pnfIc8hqmnaUp9hzNa5djKaGAydk7hjJ130knCRHZNpY0aXsgitgLTSt/zZRQBu
	cy7ISdtJ3xNeHUbFtZnD2Mku0dyyGFtwolteWJ7DA9lr/Bm9q9oevlOnCVE5GVw5stMK+S
	34P2us1ndd5uo7U+ZAgeTG+gkSZC6bk=
Message-ID: <270ed8f7-c645-502e-39c5-c93823037b9c@suse.com>
Date: Thu, 27 Jul 2023 07:54:48 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v3] xen/evtchn: Introduce new IOCTL to bind static evtchn
Content-Language: en-US
To: Rahul Singh <rahul.singh@arm.com>, xen-devel@lists.xenproject.org,
 linux-kernel@vger.kernel.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 David Woodhouse <dwmw@amazon.co.uk>, Jane Malalane <jane.malalane@citrix.com>
References: <ae7329bf1713f83e4aad4f3fa0f316258c40a3e9.1689677042.git.rahul.singh@arm.com>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <ae7329bf1713f83e4aad4f3fa0f316258c40a3e9.1689677042.git.rahul.singh@arm.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------4Tdk1AVzYvRkV0W5o1dum3uz"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------4Tdk1AVzYvRkV0W5o1dum3uz
Content-Type: multipart/mixed; boundary="------------JsMbhU8vs3WUa8yM8kUzxvI6";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Rahul Singh <rahul.singh@arm.com>, xen-devel@lists.xenproject.org,
 linux-kernel@vger.kernel.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 David Woodhouse <dwmw@amazon.co.uk>, Jane Malalane <jane.malalane@citrix.com>
Message-ID: <270ed8f7-c645-502e-39c5-c93823037b9c@suse.com>
Subject: Re: [PATCH v3] xen/evtchn: Introduce new IOCTL to bind static evtchn
References: <ae7329bf1713f83e4aad4f3fa0f316258c40a3e9.1689677042.git.rahul.singh@arm.com>
In-Reply-To: <ae7329bf1713f83e4aad4f3fa0f316258c40a3e9.1689677042.git.rahul.singh@arm.com>

--------------JsMbhU8vs3WUa8yM8kUzxvI6
Content-Type: multipart/mixed; boundary="------------m72s06cVtq9GZZjNVYRxdBq1"

--------------m72s06cVtq9GZZjNVYRxdBq1
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMTguMDcuMjMgMTM6MzEsIFJhaHVsIFNpbmdoIHdyb3RlOg0KPiBYZW4gNC4x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0byByZW1vdmUgdGhlIG9wZW4tY29kZWQgdmVyc2lvbiBvZiB0aGUNCj4g
ZXZ0Y2huIGNsb3NlIGluIGRyaXZlcnMveGVuL2V2dGNobi5jIGZpbGUgYW5kIHVzZSB4ZW5f
ZXZ0Y2huX2Nsb3NlKCkuDQo+IA0KPiBTaWduZWQtb2ZmLWJ5OiBSYWh1bCBTaW5naCA8cmFo
dWwuc2luZ2hAYXJtLmNvbT4NCg0KUHVzaGVkIHRvIHhlbi90aXAuZ2l0IGZvci1saW51cy02
LjVhDQoNCg0KSnVlcmdlbg0KDQo=
--------------m72s06cVtq9GZZjNVYRxdBq1
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYq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YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------m72s06cVtq9GZZjNVYRxdBq1--

--------------JsMbhU8vs3WUa8yM8kUzxvI6--

--------------4Tdk1AVzYvRkV0W5o1dum3uz
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmTCBqgFAwAAAAAACgkQsN6d1ii/Ey8p
3Af9HHbe22wpgQFipYJxDkdLtVudyWkHZ3Ao6K1SlQa5Cz+AO/CBQ28CrN2WnxSCfpmnzyhJ1YY/
1Zk3NcI4Jqs6Aj7vw3LCcpS/t1JpH2p5+xqS6dwW3HsVZ6/NTyT46iQFRnC3CxR+YT8KwsUfN80v
Ru85mn2Nm41J61JUFJEtJj66VVjeRuF2zVh2zG+/dOA+NsvvezP5RImEpYA8mmGYnUDnNjn0VBVG
aICgbAYCZ4qgPbJyMu8h8gdYWWUWmDet4yl6IfRhGNAvVSRbUtKdoYHplFPvQfgzmOht50W7XqVD
s3AoPqpeakiehqZrd9vGVk+sxN8RUCzfoZioTSGDWw==
=kdGh
-----END PGP SIGNATURE-----

--------------4Tdk1AVzYvRkV0W5o1dum3uz--


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 07:23:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 07:23:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570798.892939 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvLM-0006CN-9A; Thu, 27 Jul 2023 07:23:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570798.892939; Thu, 27 Jul 2023 07:23:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvLM-0006CG-6W; Thu, 27 Jul 2023 07:23:28 +0000
Received: by outflank-mailman (input) for mailman id 570798;
 Thu, 27 Jul 2023 07:23:26 +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 <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOvLK-0006CA-Jc
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 07:23:26 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2071.outbound.protection.outlook.com [40.107.7.71])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 78c11b46-2c4e-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 09:23:24 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAWPR04MB9815.eurprd04.prod.outlook.com (2603:10a6:102:381::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 07:22:54 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 07:22:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 78c11b46-2c4e-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Y06UicKAxexGybne+xN5TTm0Kdy8R7BCfk/hahTmj9ml1+KsqsEzn5AD3bNSazWkv7dHWzDOt0R5+FoWWq8wJELVH3GxILBFoVaSulkvM518Mxg4jRdPZ+7O6ezEh0ZQSKOJqjCw6hZn57rpPW5zkOYvF7iTmRLm1IPG8vbePjd5npnZqbCxf4lzS+BOx3bJOqU9rtVJhiEgtNIzWzKsKG3RysDrjOJJamGJIeIeg9xXv5yR3CzzArF6ANr31h4mZ3+KNlNaqJfPGNzsWvRe23SxHc3KuaCBviAcOfs2CCpivEaP7p1asTNOJJeVV4hijNQImxtMepHD2AMkiVQWcg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ajb5dH+/30TDlvLOwU6kzYci+WIhf1DmlNaqP1u90xE=;
 b=PV5Jd62DfAtzCdmInoFqz7jJyYafa69f/LP90BTWehnOpDe0K4GP1HwU8ygnnpCis8kzYnGJoBOgkenB2/K2lQOT5eDP+oMIjk9Re0kmEEYgnIfzL+jLTPCmWL+S2SQi1URcpkE0Fu2MCJHi4Msq/1zbCLI1mgUtkZgou00QZTvgtLRpV0O2SRFPh0NH/s/DJI7aoEXzOpnqkkwAVEGV27vkOBx5Yxb8cgejpIrp1aFwiqsLbw7LUxO8El272va7pmtJ1u99DQyUncyguvKEajecimmbTzbrSNcKRiGvCYjJsOvUqRYfjwe9WejNoTuA9942G4kqWXMCxf+uBA687Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ajb5dH+/30TDlvLOwU6kzYci+WIhf1DmlNaqP1u90xE=;
 b=tdsuBuQD4oTqRCi3chy4Ms+7EKZlyO2J08IrFev61NQIBkTtYFFzM3AxcQvfgD12fGhkJ5QaxIDiuxKuz7lhe/A2NbJ+5nopuCtBvf76LsGJ2M6NfLSGu45dCSXIJMK4NUjmhLns+XJpJhN3l9ycw16meABhz0v4LTldFZEXatpkvsxpZAiB5tdUu6Pkr8x9cPywdIbe6JI05bHUNkPnkv800IIJReDMQrTLElF5rkSFH3N7ojI9lOVsRbXVYPCdWQp685KG6Oljf2wsDBhIPEStWKVDQ2fWX1Fe6jjnBHSIWOCktw+Zw5GmMd1GitM17UpZFwqQBYQ/0aAi5OThNA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <d099b736-22cf-0502-df37-9ae7b14d048a@suse.com>
Date: Thu, 27 Jul 2023 09:22:51 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v3] xen/spinlock: mechanically rename parameter name
 'debug'
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Nicola Vetrini <nicola.vetrini@bugseng.com>, michal.orzel@amd.com,
 xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
References: <a66f1084686b77b098c5ccf3d0cf5f52980fdf5a.1690317797.git.nicola.vetrini@bugseng.com>
 <11a3ae18-508b-cf08-2803-bc4aaeec7353@suse.com>
 <f424fc5b-6266-3d04-b494-0448fa453b75@bugseng.com>
 <8914bf47-c4ca-4a14-6a92-b5b23ee739a0@suse.com>
 <alpine.DEB.2.22.394.2307261448010.3118466@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307261448010.3118466@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0223.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ac::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAWPR04MB9815:EE_
X-MS-Office365-Filtering-Correlation-Id: 94f62e58-79f4-40c1-67bf-08db8e724b02
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	U0/iYOoH3+swTB/LHO/PFfBKFjTdj1Twtw8O2tcPj8wpLdWSHbs7tQzVZEqbtNbcmtOeHdmAIcLnd1tf1rBrB1NwunEWBXgkcxZpwHWgr7pgYPztiNiurwEDJJ5RwBcJnvDriZxYTbWQkwIRxt2RGQaeNFPI7gxA86k4M0e+Bvhc62YrQhRVsfCzcNg9B4PKw0QPUgNliHbfZ+tjshy9Zl5NbWwvuFSENATly05GMAgqLIbF1mhZsUMc65rq5UaEx/hapzl0Wr9gNeaCkoqe5C4kOLrUDdZ8yGq6mYgdZCNr9xsi6fH0y7zWme4VsSoKBqFhmpyEWPpVJJd6tQBexKGtFwfjWRDrdE9kEh8+2P+dLSSmJkCni18TOgBIOZA6wX4S9A2aV8Tt+CX866DAV2wJ3K9V84FwJfx7wfkY+suuYWxObQpjCgCrDf9pUeOB155TkZNeObtSZLrOevNLRaBKmFfN2or0FRfvHsbE+zFYkqJlKgnVYiwSKLK98810uo9bj3kRm/PzUdqiCTwR+BgC1sch9XETu1iQ0KHg8VuDiMDa+mYATrRzDWvtGN57hRDM7lFEijBVSIg0JvYrab4U9lkulFuPDR0YjpixRc6kHTlL8qASmXymKt0GW9JZxyDzBQKTA13qD5clQQlBfQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(376002)(396003)(366004)(39860400002)(346002)(451199021)(478600001)(54906003)(6512007)(6666004)(6486002)(2616005)(186003)(26005)(53546011)(6506007)(2906002)(66476007)(66556008)(6916009)(316002)(66946007)(4326008)(7416002)(5660300002)(8936002)(8676002)(41300700001)(38100700002)(31696002)(36756003)(86362001)(83380400001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UmR4VFQ5N2NhTFllS3VXWlp0dXRNbnQ1cnh2MklFUXh6Y2dCS2h0QUMzQ1N4?=
 =?ut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T0NNWlk3YUR0ZjZEeGVZ?=
 =?utf-8?B?czQ0cndKNDJYbHVhZXFCZmRVdVlpbTNXckRIZUJsMkNjbS8zellZZlMwUHJF?=
 =?utf-8?B?S1NCKzdrenJNU1JKTEMwQ2FmLzROYXJ1eStIUzROZjNkb25XeUkzWWNIcEVa?=
 =?utf-8?B?UHBSck0yeUdWRnVueVVsMUh5QzVxb1lwR2tHQ1JLRWFzak9rMFE2L0hWaDhi?=
 =?utf-8?B?WHpBN283aUtURlZGcjFTYUF5b3hhaEhhUHlMMGhXSVBzZXdjcXdwdy90cWVQ?=
 =?utf-8?B?TzJyMS9HVjNBVVVGSXVqVVU1T1piZGFpOXk5WTE4M0pTUzRFdjllNXFtbU80?=
 =?utf-8?Q?+NoVO7Bc4+TN4JahmqBNDMd2J?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 94f62e58-79f4-40c1-67bf-08db8e724b02
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 07:22:54.1704
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: AmC30+D0oLpfGU/JN7bgwRlM1zziFz4NSB4dX+A4eItvO46CljGsicRrqDFD7SC0aXSVXhlvK8EYLJt9uPpnmQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9815

On 26.07.2023 23:49, Stefano Stabellini wrote:
> On Wed, 26 Jul 2023, Jan Beulich wrote:
>> On 26.07.2023 08:42, Nicola Vetrini wrote:
>>> On 26/07/23 08:34, Jan Beulich wrote:
>>>> On 25.07.2023 22:45, Nicola Vetrini wrote:
>>>>> Rule 5.3 has the following headline:
>>>>> "An identifier declared in an inner scope shall not hide an
>>>>> identifier declared in an outer scope"
>>>>>
>>>>> To avoid any confusion resulting from the parameter 'debug'
>>>>> hiding the homonymous function declared at
>>>>> 'xen/arch/x86/include/asm/processor.h:428'
>>>>> the rename of parameters s/debug/lkdbg/ is performed.
>>>>>
>>>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>>>> ---
>>>>> Changes in v2:
>>>>> - s/dbg/lkdbg/
>>>>> Changes in v3:
>>>>> - Added missing renames for consistency
>>>>
>>>> Hmm, you asked whether to send v3, but then you didn't wait for an
>>>> answer. So to repeat what I said there: I'd prefer if we could first
>>>> settle whether to rename the conflicting x86 symbol.
>>>>
>>>
>>> Stefano replied asking for a v3 [1] before I had a chance to read your 
>>> message this morning.
>>
>> Right, sorry, I spotted his reply only after seeing the v3.
> 
> For what is worth I prefer the current implementation compared to
> renaming debug()

I don't. My replacement name suggestions were only "just in case"; I
don't really like them.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 07:25:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 07:25:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570800.892948 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvNc-0006lV-Kg; Thu, 27 Jul 2023 07:25:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570800.892948; Thu, 27 Jul 2023 07:25:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvNc-0006lO-I8; Thu, 27 Jul 2023 07:25:48 +0000
Received: by outflank-mailman (input) for mailman id 570800;
 Thu, 27 Jul 2023 07:25:46 +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 <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOvNa-0006lI-Rg
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 07:25:46 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on0608.outbound.protection.outlook.com
 [2a01:111:f400:fe02::608])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cc689de3-2c4e-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 09:25:44 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB8032.eurprd04.prod.outlook.com (2603:10a6:102:ba::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 07:25:42 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 07:25:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cc689de3-2c4e-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=kCn3VYQyr+5KjGk+sGoi0jwBMzh6/6OUKACVVFlkheFDTd8+EnhEE44Z/e3piUKEUB6DrUbD5Qf38lfr/Ic8eTUzYrGKq1vbF+iO+NGu9v49VtK0UshD3oKRdLyPYtAMkNuh1H+E9yMyNVWaOtRGx9M20w4QlPse2jhpuDjplCfTXjROK+ulgJiYyADtpleh5i9uORNwo2cNDnu08hbLECOR1gSGGs4H9wQSRM0nsn6fOERg+FyaJFDfUzr3axNDFaNZhLS0EZ+txFvENI7G5O0TbP2VWTg/+VvfnOYcvVeVBzTFKLMcjz3CidRZtGrlgjIMmYmxPzW+2VtAdJHYjQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=x7C2FFgGzEfISBoMK8DcLO46eX3ACJj++EcD9eY4iAQ=;
 b=MbJ0ZAT+E0Vr7Ch5oOlCRP/AA0V+Yml/kB96h7qdgjueaFIClCcHnJQ5NKkmfGLXt8ZBkQeAt1hEDNQ74Aa0zU0fTEBLZ00l7mmzbdtPWVpGFLQCF0QdBHpKkHDN6avQWExGaCLt6OcddTJMj46zzzoqfQT6ELnQ3i/Er+h/QFWyVn+UpmZ6jc0yBSHcmTT9ZpTxCbe0GVWWTzZtszB6N7qrap7QfYX26w9Z/lgapCksP/SuPRLdLiEhwNBhGwRWMAjYhxny6xtioTYKNA8roLEhXx3clrV0LO7G5URBMKParamibrCmBArg9/VlPL2bxNSTru8IyYrKBVF4jGBAjA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=x7C2FFgGzEfISBoMK8DcLO46eX3ACJj++EcD9eY4iAQ=;
 b=EAJk4zn4V8tHZvhazJwQqg2jM7BfhY+IsTTnrQ7SdxcyECmk+tCe3F+qCy88fvwaGylMhD8POZRb2KmGMT/A12ZROuKFTXZdw0lJABu4+jS23fg5ZpkFEtmQ9jcFKSEPgRh7beBjBg+ISP/aq84+pnRMTNNN5Il+cYwAYTfftUz+18/esyzjIjZwju7QfrETfhPDzK1/SUKZQA902HuS+VMc4JyUvDZ8Lg6f9ekVEbDtNxzQZlRqFURMbmSKg6jtLJ8HpkEk/NSnpPcuue8Yz/30VpKAjSo3N0a84sC08mFwRhyA0GczfqLXMM2Kom6ZCiaieVb1KsRYI57nl5Dkcw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <53dc4f15-cdff-100e-eeff-f7bad24436a2@suse.com>
Date: Thu, 27 Jul 2023 09:25:39 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping
Content-Language: en-US
To: Oleksii <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1690191480.git.oleksii.kurochko@gmail.com>
 <a8ab1829ab718dda869db3df3348ded211e81967.1690191480.git.oleksii.kurochko@gmail.com>
 <a370548e30aaa8c1160ecd5f2eccfcc10002a8f9.camel@gmail.com>
 <6675f535-7cf7-dd55-4ebe-82ba486029f7@suse.com>
 <4deb8c44cf639af66ad7f5b9b42180554e08d5cf.camel@gmail.com>
 <5a40abd4-edc2-0de0-99ed-d23174940d66@suse.com>
 <dee3624525f9530aaf3252c6c4fa6eb5262e76cd.camel@gmail.com>
 <79b20131-46c2-9e54-e615-18a346b83b8d@suse.com>
 <b219699f928b9e86a3b0af9656bfe0e083d3cfdc.camel@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <b219699f928b9e86a3b0af9656bfe0e083d3cfdc.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0156.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:98::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB8032:EE_
X-MS-Office365-Filtering-Correlation-Id: 7951627f-90f0-4cb6-a0e7-08db8e72af1b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	ONDP1WnyGJKrOBHAD5OwJDUgJqGMShWuBKDT968kV5ES6dTwDzgIQutsJg77gOqAKbqbYDwtwT2M2kUZAqaVUv4xk2Al/mU6K+fLyG+bjrtcChPR3truNFKJl6co42EGdg1ZZ4CdwikAfEI0cFVooKI95JJVYcHp7MXF4jmal5gBb5sNAOwTTdyNXQW3WOshgyJ12ilLl8Ak6KnF1M0hcFiT6ceD+SJdzITSnGY1dhTcAL+qwfa3gnn5VSyzf3s4lv8MOd/l8cBqfHvSHoCf7XUUX5TIZbYF3piQ8JILfH40jvw7+MxANh1/Ug+GFjWYrfot1vo/jVgzxDBlKLaWUCzExtl0/MebFLOSjPbz3s0Wx4EHhQtDY3o1OXUnmyM2K3hWVMK1kA1lSCygj57MeJ0nTJPhjvsQuKULG51ioIDvQH+Sn/MfEGK2DtdSu/LMbJqoMiJ1gr0bT2w8MAYQqtVd4nnOCUmUYITAPV0zum6GaEc7PRRK928pvOVxr4k9xKya+C4YFIFOEn9QuWD9cX60VJJLyQGZ4JovWLtZHOjCnrBGwMPpYRiYJ+6iXRwA1X1N2p4UyE3EiGMafs1Lv3ZhQbemn3tc4E53swhGOk9KfLSi8vQ7hob3Je9OmO3jizMSRZOrt2HNKwC/gIDzLg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(39860400002)(376002)(396003)(136003)(451199021)(2906002)(41300700001)(316002)(5660300002)(8936002)(8676002)(36756003)(86362001)(31696002)(6512007)(53546011)(6506007)(26005)(478600001)(6666004)(6486002)(186003)(31686004)(2616005)(38100700002)(6916009)(4326008)(66476007)(66556008)(66946007)(54906003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bWx3YmR4TTJZS3k5UGhPS01rUWQyMkNzYmlDVXhrZWU4K2xEcXpreERkQldm?=
 =?utf-8?B?OGNxQWpRcy9EeVRDTXB6c1NFZFZOUGRzYWhXUDU3V0FPMFBmZTBiZDNZeHJK?=
 =?utf-8?B?NVhiOGpGUDZjVEdhT2R6MUlmZlNBUTJLS1B6YWRDTnV6TE93cU9LTkNndlZr?=
 =?utf-8?B?TTAwM09VcGhlL2hLcHJsK0VhVytwU2NhdTRzWlU0eUZxOHEzZmkzVitIVUJ4?=
 =?utf-8?B?Q01mZWhhTkdEcWY4eW5NbUhIK1QzUjdqR3BBdlh3RHdrTnQ0OEdSNnNaenQ2?=
 =?utf-8?B?MHNjQmRFbmVLRFQxeG5OaUI3eGtOeUZwcUhWdWMwODZETkttaEJyR3RIdFhC?=
 =?utf-8?B?eDZvMnlJTEljSldoRW5GRDJYRFdw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zh7pdfn/8e/Ldnl2gaoy7VtyM?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7951627f-90f0-4cb6-a0e7-08db8e72af1b
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 07:25:41.9721
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: kGB/5K7Pa+Y+Cp44AxocDCJeho9AC2AzFnCLjwtQmikbJN7/DItg8FiIej2OBiSL545BX0wtQhBVJy/LO7WPww==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB8032

On 26.07.2023 20:39, Oleksii wrote:
> On Wed, 2023-07-26 at 17:59 +0200, Jan Beulich wrote:
>> On 26.07.2023 17:54, Oleksii wrote:
>>> On Wed, 2023-07-26 at 17:00 +0200, Jan Beulich wrote:
>>>> On 26.07.2023 15:12, Oleksii wrote:
>>>>> On Wed, 2023-07-26 at 13:58 +0200, Jan Beulich wrote:
>>>>>> On 26.07.2023 13:23, Oleksii wrote:
>>>>>>> I would like to ask for advice on whether it would be
>>>>>>> easier,
>>>>>>> less
>>>>>>> bug-
>>>>>>> provoking ( during identity mapping to remove of whole Xen
>>>>>>> ) to
>>>>>>> have a
>>>>>>> separate identity section that won't be more than
>>>>>>> PAGE_SIZE.
>>>>>>
>>>>>> I'm afraid you can't safely do this in C, or at least not
>>>>>> without
>>>>>> further checking on what the compiler actually did.
>>>>>>
>>>>>>> @@ -264,6 +268,19 @@ void __init enable_mmu(void)
>>>>>>> Â  Â  Â  Â  Â  Â  Â  Â RV_STAGE1_MODE << SATP_MODE_SHIFT);
>>>>>>> Â }
>>>>>>> Â 
>>>>>>> +void __attribute__((naked)) __section(".ident")
>>>>>>> turn_on_mmu(unsigned
>>>>>>> long ra)
>>>>>>
>>>>>> Did you read what gcc doc says about "naked"? Extended asm()
>>>>>> isn't
>>>>>> supported there. Since ...
>>>>>>
>>>>>>> +{
>>>>>>> + Â  Â /* Ensure page table writes precede loading the SATP
>>>>>>> */
>>>>>>> + Â  Â sfence_vma();
>>>>>>> +
>>>>>>> + Â  Â /* Enable the MMU and load the new pagetable for Xen
>>>>>>> */
>>>>>>> + Â  Â csr_write(CSR_SATP,
>>>>>>> + Â  Â  Â  Â  Â  Â  Â PFN_DOWN((unsigned long)stage1_pgtbl_root) |
>>>>>>> + Â  Â  Â  Â  Â  Â  Â RV_STAGE1_MODE << SATP_MODE_SHIFT);
>>>>>>> +
>>>>>>> + Â  Â asm volatile( "jr %0\n" : : "r"(ra) );
>>>>>>> +}
>>>>>>
>>>>>> ... none of this really requires C, I think we're at the
>>>>>> point
>>>>>> where
>>>>>> (iirc) Andrew's and my suggestion wants following, moving
>>>>>> this to
>>>>>> assembly code (at which point it doesn't need to be a
>>>>>> separate
>>>>>> function). You can still build page tables in C, of course.
>>>>>> (Likely
>>>>>> you then also won't need a separate section; some minimal
>>>>>> alignment
>>>>>> guarantees ought to suffice to make sure the critical code is
>>>>>> confined to a single page.)
>>>>>
>>>>> Thanks. I'll move all of this to assembly code.
>>>>> Regarding alignment it is needed alignment on start and end of
>>>>> function:
>>>>> Â Â Â  .balign PAGE_SIZE
>>>>> Â Â Â  GLOBAL(turn_on_mmu)
>>>>> Â Â Â Â Â Â Â  ...
>>>>> Â Â Â  .balign PAGE_SIZE
>>>>> Â Â Â  ENDPROC(turn_on_mmu)
>>>>>
>>>>> Does the better way exist?
>>>>
>>>> The function is only going to be a handful of instructions. Its
>>>> alignment doesn't need to be larger than the next power of 2. I
>>>> expect you'll be good with 64-byte alignment. (In no case do you
>>>> need to align the end of the function: Putting other stuff there
>>>> is not a problem at all.) What you want in any event is a build
>>>> time check that the within-a-page constraint is met.
>>> But shouldn't be an address be aligned to a boundary equal to page
>>> size?
>>>
>>> According to the RISC-V privileged spec:
>>> Any level of PTE may be a leaf PTE, so in addition to 4 KiB pages,
>>> Sv39
>>> supports 2 MiB megapages
>>> and 1 GiB gigapages, each of which must be virtually and physically
>>> aligned to a boundary equal
>>> to its size. A page-fault exception is raised if the physical
>>> address
>>> is insufficiently aligned.
>>
>> You'd simply map the page containing the chunk, i.e. masking off the
>> low 12 bits. If far enough away from the Xen virtual range, you could
>> as well map a 2M page masking off the low 21 bits, or a 1G page with
>> the low 30 bits of the address cleared.
> Agree, then it will work.
> 
> But still it doesn't clear what to do if turn_on_mmu will be bigger
> then 64 ( ASSERT( (turn_on_mmu_end - turn_on_mmu) <= 64 ) somewhere in
> xen.lds.S ). Right now turn_on_mmu() function is 0x22 bytes and it is
> enough ( we are sure that we don't cross 4k boundary ) to be 64-byte
> aligned. But if the size will be more then 64 bytes then the alignment
> need to be changed to 0x128.
> Am i right?

Well, to 128 (without 0x), but yes. That function isn't very likely to
change much, though.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 07:37:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 07:37:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570802.892958 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvYy-0008Iu-Lr; Thu, 27 Jul 2023 07:37:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570802.892958; Thu, 27 Jul 2023 07:37:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvYy-0008In-J5; Thu, 27 Jul 2023 07:37:32 +0000
Received: by outflank-mailman (input) for mailman id 570802;
 Thu, 27 Jul 2023 07:37:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOvYy-0008Ih-68
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 07:37:32 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2061e.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::61e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 714792fe-2c50-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 09:37:31 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM7PR04MB7144.eurprd04.prod.outlook.com (2603:10a6:20b:11b::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 07:37:28 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 07:37:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 714792fe-2c50-11ee-b247-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=POjhJz5Wvx5/BtSC5WkXEexH+tzu+TaVgCXhbJa/xQlG+F5GIaw0f7Yh71toDRBN+TETnD2/MTidXUGK8wZSVFVruEw8WZo3M9rqSIF0bp7OYMOahrCyD2YApZRjLYYZkzE3/+17xoMivPN8EnLM4f/5Z2L+nLSPoM+4Q94GqvFwH/l5pSF+u9uF8k1uvItpLtSvE3nXG/OP0xvPHLSYs012F3irRqMyV2BTFf0SowDtVIIO3+8fB2O7yFLxBL5jPUm9W9jNPdS5pLVb7AH3s/nKtDF1F5Eud0h7cQ93uZajBdwXXT6o450wkJXwM8Jb/ZwIJ2jW5y5tSnOSvSuxww==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=F3t8Tm0erRdGxFTnPkL7fis5y1VjtbTpebza6W88aH4=;
 b=eD3gDIrLecTOdAUsC/o/jGa9N/2rvrrWuuRpaszHGocMd5kY6Sh2N59D6Q8xxy7pfAKGXIVkqKLXI3rnKsh1oN5+W5QK1/oxW1/o/WLxXqhWsL0UnHnWNEonc8kS6QzmVeGnDhRO+hXYfkOtRov+xNDtP4lw52v9a2kAiR3aIsi81pVsHy3fc32+lEBmGE+VJNBSzWHhQ6Fea4Ti4icMtHkoXuNN8s2SvyR8TAUEFy0cmuVku0DqylQ3uNbmWsxXKL8s9Tr1XUNiYiHR2Mi+T9RZJFaRZMjru6Ld3Dk6I6xIXmkcP+vGiVqGzhe/nFxkFNOSeO9YMdib/EI3Tl/ZyA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=F3t8Tm0erRdGxFTnPkL7fis5y1VjtbTpebza6W88aH4=;
 b=pD2r3mTJ6wkwBzgiub7a2D4Ko611EMyDMvY084UD5MJZJE1YONY7HWLFuFQTsmNG1+n3noILXQRU2KTk2wh7JeDK/oZQOAizla7wrVTVfbZVUdwxvWZY6PhHSHkdYeltkafwjc5iv2ae3eApr+EuU57vWnpHIyEP27xR8UaRVCE5vBtpJnv268A+QU0cMcRsK9vUcQp6JN0lz++TfhwYx1GzTvrLKGTB5buUez6C8DTiN9+d9FUEvKUBI+GBUXf7cip4y+hlzdjywQYElHlbssCcUPvRZno/c4YtY0TVMB34nXXaSdvKvmDyqBfPh8+WcgpbOXMnnaQeVNarx9YhVA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <7cb0d24e-2bda-dcda-4874-2c01ba179947@suse.com>
Date: Thu, 27 Jul 2023 09:37:25 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v3 0/3] new CONFIG_HAS_PIRQ and extra_guest_irqs adjustment
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Content-Language: en-US
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0156.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:98::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM7PR04MB7144:EE_
X-MS-Office365-Filtering-Correlation-Id: fb029cb4-6539-4f86-10c5-08db8e7453d5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	uVAdC363rP7ddyFEAmvI6cjjK/kF48TjELXAW/KWBdAK3Wz0QEK7iQxL4f266e3yKpHwKNspPYJdw8j+KUhlUepQPB9c0eBAIs+1tAK/CzH74eKLg3mQhJyjP4tOMcfUzrZHhRJuVP4F8Uq6rMhC9yG6fvuRbZmBzOw4X01K1pVbRmrJRtSDtrm6X4o0fFNTiJL8Cr72ri5Ss5ATClwGHSm82umVkBqFgSVN9RoHOiGHTkyQWZjsRg+YCTIDswu2uxIhctsEzbqEz3MgxmduTn4ap/qPko+ux3WXXbOsP64lYDRuURJod+WLUO2ey00erJKzEfGevucnkUOqH/2j+QaHl9D9AjUB1waYPa+6PzxRLOW8wIqipIKYo8NXprtHIhgYpoQhxFidU5vBxhfcH3fj6aD6b/3LKsCSSeEnMDGPs2OnNdXWTnkOskPbIh/zAVV5WvbJnMDYggNiRke+kYA1FdRF/ExxpZdWUnMOjRoULgyTE1EBZ3XZxpeOurQiU3phkrKC95sLQFh9VzdpTN+ZtCBZ8Le2EvURg8huh8YvTqIeQK49kNVSysAD9IvdEgIDjUjYjXGS8WQXHTxKoizmnoti4mKXGCN9HbxwrkAe3GAo0eh09PfuHqQO8Nbdd0MowBmbTZOKmSE4b95jxg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(366004)(136003)(396003)(376002)(39860400002)(451199021)(54906003)(38100700002)(478600001)(6666004)(6486002)(8936002)(8676002)(5660300002)(36756003)(2906002)(86362001)(31696002)(558084003)(6916009)(4326008)(66946007)(66556008)(66476007)(41300700001)(316002)(2616005)(26005)(6506007)(6512007)(186003)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WlcvM1VrRkxxNDJsaXBGRkdDVXJacGpiZ0NEWXNiRXcrMFZTeGlCZnJScFZQ?=
 =?utf-8?B?TVFMZEdZVWEwcjdNNjNTNEpWWjlTM3ZTMU9ORHNJSGN2a1BtYnJpVzdJbmZq?=
 =?utf-8?B?M3BlSE54NXdjY0s5L2RNcHF4dXRpYnlzSGR3ZTBRMkVndFdMV09hMmFQYmY3?=
 =?utf-8?B?MjdQa3p3TXZqYXY3QzdPcVZEYU1JODBaVHIrelk1c0YzUFYyVUJIZURnOHVE?=
 =?utf-8?B?bW5HS2NJekhoSG5PNVd3czRnc29IZXE2NnljY2swN3JYNHYrWkgzaHJaWUhP?=
 =?utf-8?B?djVlU0hWM21mdU9nRVNuRm11QVFEQ2V3ZUxwOUN6enQwakxOSGt2OXhLcjlH?=
 =?utf-8?B?U0RZZXh2aUlTZ1hnMjVMeGdHU21IM1FmN0NlM1l1OWtWaFNjeVFDVmJlMG5G?=
 =?utf-8?B?anNVN2R1Y3VJc2oxOFRDb2V5Mmd5Z0pGb1h0L0VBUC91UzIxaU5wYkV1Z2d0?=
 =?utf-8?B?MUw2a1NUbFMvTVU4RjdJMksya1RMZS9jYU5ZVHFnZVBsMlhuWUZPYkVGTk9v?=
 =?utf-8?B?dXdRaUlxekU0SFZBM1VXZmFtWnRTRldiNnpySkVoaDMzbFkzVEI0T2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SzVRaEZyYUlTaUpneEtsN0htRVF2c0QwVWY1VlhNaE00?=
 =?utf-8?B?dDQvNlpoaThCc2hxVVRITm9GM1NYTzFucmorVEt0dUVBMWFoTWFPWGprTDVY?=
 =?utf-8?B?dE1HM0hXT3RpMDk4Z0tqWmJzelZ5QTgxMXdJV1FVMnVkdG1HK1RleTRVbVlD?=
 =?utf-8?B?aktXQm1Rd1UrR2l0WEF1bHpDYkpmNG1WTG9KOUVFemVENHRlSzcxNURKTlVC?=
 =?utf-8?B?Sjk4L1pGVUxIUWFRb3JxK3V4ZUpzTUszRzRhMFRhVXJHZWNvUjE3eWgvcHRL?=
 =?utf-8?B?c05GcjB3WHFUU3o1UkNmMmFCMEVDcWh0Nk13WVc5bnRvMTBKdlVTTXpyREo4?=
 =?utf-8?B?UVVpdUZDV0lYMlhuQk1WR2xGaStyNzZDUTVMZ0JtT3FGUGhIOC9MS0VyaGJn?=
 =?utf-8?B?UEc0N2FMdVhqT2Y1Z3hoWnZlM2YrSlBnTnRsbnIxSTNubGNBWUZqN3M4RXk2?=
 =?utf-8?B?MmxUR3BudWFOTEFMZEswa0haRVVmUE9qcTRPaDhJUW15QkwvckZZZ1Rud3hr?=
 =?utf-8?B?eGRxVTUxcEdjN2tQdWg4V2RNZHhxdlU0dU42YWo5TVJRVEJqOHI5QkRXaVU0?=
 =?utf-8?B?WjNVeFBLTHNqN0NEdU5BbERleEQyMlZ3alcrcGhpUEZQVWhZeXo2TEdRNUtI?=
 =?utf-8?Q?QOMefDsxzq8TEHv5iCiH0BWn1?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: fb029cb4-6539-4f86-10c5-08db8e7453d5
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 07:37:27.8646
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: kB7oyT5WtJUVFW8VE1cQaeEYEE4/mw21hEaK8D6rldcztvwZ5VpbX+RkX5+yUIdhHMEPuppj0JmFMDcDzlBBvQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB7144

New patch 2 addresses issues found while looking at pirq_cleanup_check()
in a Misra context.

1: restrict concept of pIRQ to x86
2: pirq_cleanup_check() leaks
3: cmdline: document and enforce "extra_guest_irqs" upper bounds

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 07:38:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 07:38:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570805.892969 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvZg-0000Qz-3R; Thu, 27 Jul 2023 07:38:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570805.892969; Thu, 27 Jul 2023 07:38:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvZg-0000Qs-0H; Thu, 27 Jul 2023 07:38:16 +0000
Received: by outflank-mailman (input) for mailman id 570805;
 Thu, 27 Jul 2023 07:38:14 +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 <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOvZe-0000FZ-9d
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 07:38:14 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20627.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::627])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8a26532c-2c50-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 09:38:12 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB8026.eurprd04.prod.outlook.com (2603:10a6:10:1ed::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 07:38:09 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 07:38:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8a26532c-2c50-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=dpLkLxMeWipIXfdCY25mI1kARJQhsvnEy2Q3VqRrpnYjlndNkp6MPIzuQQ/wQtKT9fh/P8cldfvRmZ6WcpunK5Q/pE0BGAisJYv2ARPa2KazTwgRLq2BuKYOI6oxVIR/mXoOgHuJQFMuFx+6LVgRblOpkWvoVI/LYs79Xvy4FwZmSrLT0eS3CgGWitOYEwetGoj0XJmBCog83v9IEMUVUVLfgRMDDai5t2JhZiAu2DeT0yY4Y84OktXQUMFtJ7rcNS+DYBf7bGnWiYvxiI2xZWSshPq2SxrzxjFrT+5d8W3UqjagiADmuh+4duXq9U2MBxxJpj1u3tmgH7eE+Jz1Kg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=taHtIzeBIdPQZ8hfsCK1k6WHI3O8TZ4BTx1jK1HZDlM=;
 b=CL1Pm90bMihvxK3goMiwpNxApJdm3mPBengCooGA43ZkMx9XUwKx/Pay+B31c9IPOpB6uYxCBLuMvFsjhl1anWbmKm+OJx26+Am3r+OTg4WQZvEDUPrJw62WdyRFvHlHLB7yj684vrOmaLPlSaAZx1GBjzdOt3LMbdUUQxVHUluiPHQwevBosuuqffL/IBQVc1J3tkZwyynf/F+nhGjgZXzcbEsSQrapmENB2MfRJtUQFAzXx1FeVUmOQ6pBZ0aJBGgScqAsVB6dHVvKIMl76rhrV51E8MHx75ZpphiCUl1ITJHMMHSO5jMh2am5jLi1Ba4aFeWzLJNjp0wSIN6QYQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=taHtIzeBIdPQZ8hfsCK1k6WHI3O8TZ4BTx1jK1HZDlM=;
 b=nPYKliH+B/aR+3Iq+2lMIu+iHa3iWDBQKHrkEEmwi2L1+1YWSGtuA9arV45lVHbhXtTWxydGaRbmrFRkpfBPXSgdPMQsGFxWDC3ZIQCktWPQuZk6hbv9Xi4w8KzISThDQnNn75vAPvhDzaDpflRCRbICDGXSYKzXv7S269aJC9wRk639OGbPy9GA8yW2ULG/4w/5wBK6e5tHqZk3M5+riFcxeU3sNKDQ7aFJ4FxjNF67LVSRv7vge05keJ/7sGcF4Qlt0BpK9wanJsQy9mtnGMLZGnMInfrikaDCR2+tFdAB5H39PZTD6QnrW3FoFn9Hy7+20aXJD0YcmNnvaDvLFw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e58f365c-13bf-3ad7-cf37-ca1ea043750b@suse.com>
Date: Thu, 27 Jul 2023 09:38:07 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v3 1/3] restrict concept of pIRQ to x86
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>
References: <7cb0d24e-2bda-dcda-4874-2c01ba179947@suse.com>
In-Reply-To: <7cb0d24e-2bda-dcda-4874-2c01ba179947@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0144.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:98::18) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB8026:EE_
X-MS-Office365-Filtering-Correlation-Id: 76c16a22-ddc8-483e-4177-08db8e746cce
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	6pslMkiDn1JtJT0lHkUYCjfK0yjDPRJE4YZPiKIzv8z/hy/rAiaJWiA9KylgHEbImyNQyHlVkCO7DFRVmV+n7RoOgy5+cybxHOsdjpyKQpnn5WCYrvTf7WCxGMz//R0nxeVJhmx5LFSi9JfxUUXgtC15rbROjlP+P0/7laDYtrnxa/ubrb8S2MztjFAWJ4Sjp5kGsIAQii2o6AsANTDLHnDyPrO7HZAAYUkTSZFAWbhZpvKcTSSnFOdlDch+WzDHGwIpIyVMiXOiEbbgI2w4XnhmCbD+nC6mmeNv41yqvUUqg9ALRAIMvSNtomE1Jh9lxNmQyQNgBY7qzZVeQ5o/+5V++nMg+RjqfXyvHKF90B4eTj5gP0TqtMImZmGmT0PQAATPiIq7GTrBFFVygUMLFxGA69Ukol1aQk4mHNI00fak1YSeFGu52P0LjPPSOI3f+vwKNV/9xD5pJoYK8fCaiv4r3lfQKadkhGmDVhVRPT1cYMsxJ8mFY4/u22DAPfNl6OMxhxgmblNAdE15znMvXrR7egnCdhqFiHNcJ5nBk/16rB8ki8CKj/Et2H+L6MK04jBaJfAsbDFf01g+CE+53aKLoIDiEkns/eEI1GvSg7Ha01uIyusbwSBk1TqgIuU+hCNoSVIj3DUDvuKfm6A3PQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(396003)(39860400002)(136003)(366004)(376002)(451199021)(6486002)(478600001)(83380400001)(6506007)(26005)(6512007)(6916009)(4326008)(54906003)(66556008)(66476007)(66946007)(186003)(2616005)(38100700002)(31686004)(8936002)(8676002)(5660300002)(2906002)(316002)(41300700001)(86362001)(31696002)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cDEyK1pXbU5wNWduM1RyZTl4Z2xrNTloK1dmbWJPTlhoV1dZNnYvQTF6dTcz?=
 =?utf-8?B?a1VTQkNnWlh4a3d2WFZOWk95TFhUTTdkZDlWMTRGOEs5SW1Fb2gyR0tOSkxw?=
 =?utf-8?B?YlZUY3VBcVo2K1dvaUZ6cWFPdXZSVkFXbnA0VnpRS1hKa0czV3lxM2g0YkxG?=
 =?utf-8?B?ZWRiaFA2TkZibUVpZ2dxYWN5bkpYS3JoVFdLb2Z5bXVmNytWQ0o0cGxlUktH?=
 =?utf-8?B?R3dDZzEwc3VpUFdUNnV0QzBZdnpGNXZSb245cHZGWjFrcTA3M0xLa01QSmo4?=
 =?utf-8?B?YlB5d2YwdllrMmIyb1ZJbkZCU3VpWFB1aFJFWDhpd3lCS04xWDdGRlZCZ090?=
 =?utf-8?B?bnJBbEdxcFgzTkh5ZXd0RHMycTRHeVZ1WDI0RkVIMzZickw0TEV5UVNXTis1?=
 =?utf-8?B?UUpBd01FUWxZZzRaaldDcTRORmM2WHFMVFhodTJPVUVadnlCZGJ0TE9KMjF1?=
 =?utf-8?B?VWdTdmVqc1RCYUZJWFJ2R0xmRGZEMHhkUGJEQ0FWTFZQL2ZXUGQ5dDN0K2h5?=
 =?utf-8?B?dlVTWk1oWC9XUm4rL3RuME9UMi9VS283R05CUFgzaGJxNzdlMUd1bHVobnFx?=
 =?utf-8?B?KzhyR3FlcnM3cGZVcTNtQ24vQU93YkRhdFpoRUdxcHlvU05tYUZ1azZrMmgz?=
 =?utf-8?B?a091NnkxajUvbXUwektaeGZnRVErdERHNjlKbGRWMWYzZmtGcWNDZGlsWEN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RU1xMXNOUGIrbnVxSG41VzBqM0hmQ0xJN3dBcTgralFnWVZ6K2xD?=
 =?utf-8?B?VzJ3S0EyRk5HbGo2SEtUamQvZ0JvcDFpeTM5dFpZS2swczBtMGpiSkRseXhB?=
 =?utf-8?B?Y0JvbWt4a204cGh3bHk2ZEIzZHpmQTNieW1SSmNQQmlIVC9CVnMxcmJPM3Ar?=
 =?utf-8?B?bFc5WkF4S0NKRU84Q2dJYktTT3lhQ25DaGNPYnYydnZ1Qm9RK29IQ3ZyRmtN?=
 =?utf-8?B?SENtN3dvM0NjaE1RcnhLUndlazQxc3pHa1QwcGdpbCtoVkFHZWIwUUVnTjU0?=
 =?utf-8?B?UEVhTFdtRHNZczdrSHFUa2JHMzBrdVQ3c083Ym56MjM4RDcrZkJGSHNjMmJW?=
 =?utf-8?B?QjJialpxdytrM1gxSjdHY09IcVdBL2FKTmNGeXdTZnFSNUVabjhTMUczd20w?=
 =?utf-8?B?THc0b3FLU0E0NUxKMDFjeFFWMUdjUEhrbVJsSll4MFMrR3BZNEk4bFdCYkRj?=
 =?utf-8?B?dFh3Y2l4eVZzVmVLNHA1WFNIQnpiTzNZM2Z1N0MxZmdTeWxxQlB6KzRwTGlD?=
 =?utf-8?Q?xVbxbqrPWDWepOfDgjEWxQtrr?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 76c16a22-ddc8-483e-4177-08db8e746cce
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 07:38:09.7606
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: EpjO4hO3cF0JxkUdOJEXxijokyqF4+mTgfJ+kVK8nfetsHO3bHHLAz8hC3UiUIG+IK51ObhzgLsjRenBEC3ocQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB8026

... by way of a new arch-selectable Kconfig control.

Note that some smaller pieces of code are left without #ifdef, to keep
things better readable. Hence items like ECS_PIRQ, nr_static_irqs, or
domain_pirq_to_irq() remain uniformly.

As to XEN_DOMCTL_irq_permission - this, despite having a uniformly
available wrapper in libxc, is unused on Arm: libxl bypasses those
calls, and the Python and OCamL bindings have no users at all.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v3: Move #ifdef in xen/common/domctl.c around the entire sub-op.
    Re-base.
v2: New.

--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1136,7 +1136,7 @@ introduced with the Nehalem architecture
       intended as an emergency option for people who first chose fast, then
       change their minds to secure, and wish not to reboot.**
 
-### extra_guest_irqs
+### extra_guest_irqs (x86)
 > `= [<domU number>][,<dom0 number>]`
 
 > Default: `32,<variable>`
--- a/xen/arch/arm/include/asm/irq.h
+++ b/xen/arch/arm/include/asm/irq.h
@@ -52,7 +52,6 @@ struct arch_irq_desc {
 
 extern const unsigned int nr_irqs;
 #define nr_static_irqs NR_IRQS
-#define arch_hwdom_irqs(domid) NR_IRQS
 
 struct irq_desc;
 struct irqaction;
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -25,6 +25,7 @@ config X86
 	select HAS_PCI
 	select HAS_PCI_MSI
 	select HAS_PDX
+	select HAS_PIRQ
 	select HAS_SCHED_GRANULARITY
 	select HAS_UBSAN
 	select HAS_VPCI if HVM
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -56,6 +56,9 @@ config HAS_KEXEC
 config HAS_PDX
 	bool
 
+config HAS_PIRQ
+	bool
+
 config HAS_PMAP
 	bool
 
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -350,6 +350,8 @@ static int late_hwdom_init(struct domain
 #endif
 }
 
+#ifdef CONFIG_HAS_PIRQ
+
 static unsigned int __read_mostly extra_hwdom_irqs;
 static unsigned int __read_mostly extra_domU_irqs = 32;
 
@@ -364,6 +366,8 @@ static int __init cf_check parse_extra_g
 }
 custom_param("extra_guest_irqs", parse_extra_guest_irqs);
 
+#endif /* CONFIG_HAS_PIRQ */
+
 static int __init cf_check parse_dom0_param(const char *s)
 {
     const char *ss;
@@ -682,6 +686,7 @@ struct domain *domain_create(domid_t dom
     if ( is_system_domain(d) && !is_idle_domain(d) )
         return d;
 
+#ifdef CONFIG_HAS_PIRQ
     if ( !is_idle_domain(d) )
     {
         if ( !is_hardware_domain(d) )
@@ -693,6 +698,7 @@ struct domain *domain_create(domid_t dom
 
         radix_tree_init(&d->pirq_tree);
     }
+#endif
 
     if ( (err = arch_domain_create(d, config, flags)) != 0 )
         goto fail;
@@ -784,7 +790,9 @@ struct domain *domain_create(domid_t dom
     {
         evtchn_destroy(d);
         evtchn_destroy_final(d);
+#ifdef CONFIG_HAS_PIRQ
         radix_tree_destroy(&d->pirq_tree, free_pirq_struct);
+#endif
     }
     if ( init_status & INIT_watchdog )
         watchdog_domain_destroy(d);
@@ -1180,7 +1188,9 @@ static void cf_check complete_domain_des
 
     evtchn_destroy_final(d);
 
+#ifdef CONFIG_HAS_PIRQ
     radix_tree_destroy(&d->pirq_tree, free_pirq_struct);
+#endif
 
     xfree(d->vcpu);
 
@@ -1893,6 +1903,8 @@ long do_vm_assist(unsigned int cmd, unsi
 }
 #endif
 
+#ifdef CONFIG_HAS_PIRQ
+
 struct pirq *pirq_get_info(struct domain *d, int pirq)
 {
     struct pirq *info = pirq_info(d, pirq);
@@ -1922,6 +1934,8 @@ void cf_check free_pirq_struct(void *ptr
     call_rcu(&pirq->rcu_head, _free_pirq_struct);
 }
 
+#endif /* CONFIG_HAS_PIRQ */
+
 struct migrate_info {
     long (*func)(void *data);
     void *data;
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -648,6 +648,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         }
         break;
 
+#ifdef CONFIG_HAS_PIRQ
     case XEN_DOMCTL_irq_permission:
     {
         unsigned int pirq = op->u.irq_permission.pirq, irq;
@@ -667,6 +668,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
             ret = irq_deny_access(d, irq);
         break;
     }
+#endif
 
     case XEN_DOMCTL_iomem_permission:
     {
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -567,6 +567,7 @@ static int evtchn_bind_ipi(evtchn_bind_i
     return rc;
 }
 
+#ifdef CONFIG_HAS_PIRQ
 
 static void link_pirq_port(int port, struct evtchn *chn, struct vcpu *v)
 {
@@ -592,9 +593,11 @@ static void unlink_pirq_port(struct evtc
             chn->u.pirq.prev_port;
 }
 
+#endif /* CONFIG_HAS_PIRQ */
 
 static int evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
 {
+#ifdef CONFIG_HAS_PIRQ
     struct evtchn *chn;
     struct domain *d = current->domain;
     struct vcpu   *v = d->vcpu[0];
@@ -664,6 +667,9 @@ static int evtchn_bind_pirq(evtchn_bind_
     write_unlock(&d->event_lock);
 
     return rc;
+#else /* !CONFIG_HAS_PIRQ */
+    return -EOPNOTSUPP;
+#endif
 }
 
 
@@ -696,6 +702,7 @@ int evtchn_close(struct domain *d1, int
     case ECS_UNBOUND:
         break;
 
+#ifdef CONFIG_HAS_PIRQ
     case ECS_PIRQ: {
         struct pirq *pirq = pirq_info(d1, chn1->u.pirq.irq);
 
@@ -705,14 +712,13 @@ int evtchn_close(struct domain *d1, int
                 pirq_guest_unbind(d1, pirq);
             pirq->evtchn = 0;
             pirq_cleanup_check(pirq, d1);
-#ifdef CONFIG_X86
             if ( is_hvm_domain(d1) && domain_pirq_to_irq(d1, pirq->pirq) > 0 )
                 unmap_domain_pirq_emuirq(d1, pirq->pirq);
-#endif
         }
         unlink_pirq_port(chn1, d1->vcpu[chn1->notify_vcpu_id]);
         break;
     }
+#endif
 
     case ECS_VIRQ: {
         struct vcpu *v;
@@ -1122,6 +1128,8 @@ int evtchn_bind_vcpu(evtchn_port_t port,
     case ECS_INTERDOMAIN:
         chn->notify_vcpu_id = v->vcpu_id;
         break;
+
+#ifdef CONFIG_HAS_PIRQ
     case ECS_PIRQ:
         if ( chn->notify_vcpu_id == v->vcpu_id )
             break;
@@ -1131,6 +1139,8 @@ int evtchn_bind_vcpu(evtchn_port_t port,
                           cpumask_of(v->processor));
         link_pirq_port(port, chn, v);
         break;
+#endif
+
     default:
         rc = -EINVAL;
         break;
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -438,12 +438,14 @@ struct domain
 
     struct grant_table *grant_table;
 
+#ifdef CONFIG_HAS_PIRQ
     /*
      * Interrupt to event-channel mappings and other per-guest-pirq data.
      * Protected by the domain's event-channel spinlock.
      */
     struct radix_tree_root pirq_tree;
     unsigned int     nr_pirqs;
+#endif
 
     unsigned int     options;         /* copy of createdomain flags */
 



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 07:38:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 07:38:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570806.892979 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvZz-0000rr-BU; Thu, 27 Jul 2023 07:38:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570806.892979; Thu, 27 Jul 2023 07:38:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvZz-0000ra-7B; Thu, 27 Jul 2023 07:38:35 +0000
Received: by outflank-mailman (input) for mailman id 570806;
 Thu, 27 Jul 2023 07:38:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOvZx-0000oV-Il
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 07:38:33 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20627.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::627])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9636c91a-2c50-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 09:38:32 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB8026.eurprd04.prod.outlook.com (2603:10a6:10:1ed::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 07:38:31 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 07:38:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9636c91a-2c50-11ee-b247-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=S36Ixr4Z+Ln7tN/dSjpT2baYv+w+4WIJiQR4Y7v84Fm+jtYj2MFZjWvXX9jfOYlzeb3//uzQVAU9LPIVp5Y0KMOmFavrmOw2MXoNZrSXTonHXQ7MAbCbFLkP8VsfDVHV9Vo0cKC4TJYM6snAho+ZqwvE7jxptQ1ZyIpDiboUpLvB2WSzEwTlhvA6q5JkrWAHv90IUL++jVckFvUIvgKBHvuoItsuF4V89wPg9Pvu7UJSCwM16rlQ4jILKfUr31WP9HfhWoAYtLlAq9QJOoBQqibggntGDOo4SXRJ0dCPU9LgT/a5/BnuZ0mRfl/AYlNiKtnFKwxQkhk1BdUBiIZBYg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=42G1q1cbtqLAMoOILaHON+bdi1vm2gokigDbkHTcLas=;
 b=im54/SKoplx/5mwC6VfvATT4eOkoJI7tyUjARqxjVN5ipGGcNV7SU+Dd/F61wI29u2vLS/cmzjv6E6ePCZKhD3UeT61rrCdr8omA9YMCHdhGvRBdxDhCYVWEYREY3zqNNrSKEtNS+w3vbAyGOwk7KI6f+eXt15leHVQ7j616GCcNwDyYSqjLSDJwYxzeCEOVXoV7pl8bvO+1MldyQpRkl8w65N6G9/jodYJc6lBD0o5Tx7nH3a8s8T9mTZvd4sbWTih2BcnfvnWFZ113V/05pM5baLH2pxekg4fymNa8f236e9Zj1NehNvyXRybWeuvjAspx/dIM3FvU3RaW88erIg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=42G1q1cbtqLAMoOILaHON+bdi1vm2gokigDbkHTcLas=;
 b=C0f1ociMyS9vc9x+0AzwYlBDRBJ2/UxqacI/na6zD+u+AdonkZvChNia62dtt/tz4YlDTSVK+0VeH7AHSdoCUU27RfR0WiRVLvv/MHXJLheKlYh3lgemwBXVKSPXGlAbElpXgRvSYpvD222Jh7BlHM7v0kPCm2zhmHboZu+p4ima15joL+SvgPwYl79uPTfkUTSj8scy6J16rKFoU2v3fXZSQD1Syf0E9PIbedDnhhYoglz8mvXlMKqdx68eZXoLOx2v6t7bfGyiyH4TZVUQU59xGdjB5vDiOBLtst9/Ev5vvtDJIh7Qs1BtNUKfv/nZIKcpdDLPJx8CfHLNVjN0Wg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <5641f8eb-5736-8ccc-122b-b3b47c1bac28@suse.com>
Date: Thu, 27 Jul 2023 09:38:29 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v3 2/3] pirq_cleanup_check() leaks
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <7cb0d24e-2bda-dcda-4874-2c01ba179947@suse.com>
In-Reply-To: <7cb0d24e-2bda-dcda-4874-2c01ba179947@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0245.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:af::6) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB8026:EE_
X-MS-Office365-Filtering-Correlation-Id: d0e47f9d-840e-464a-5cba-08db8e747992
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	SQg/baH/L+3HTi5t7EeuF7Jhyc36KxHdDA/186cQTCKdqBaQBR3kCTRqmRPvkVptJPolJL1kbmkVqYYh8GnB4SEI/zmLASS4+c9P0ebAKY3+hho5p/NBEczDvJbofFnkcs0+hk8n1Q29UsRNvTnT3Ewk9LoHl6OGbIXuwj2DxBqLrFaC/cciePAI/8tQshKOpThh5CVZuShAyCFocY2jiCmCtx4KOejW1mPs5X2ugqiPGRtt3xosfHJWmlJFYVj4TWw1Hhmi/Zn1tMuG317a9omN/zATFCbLygIeluSyd0Us5T/we8vh2uE9+keft3L3Zj/HjlJOAWwmq0hw6xLn5hLGchSoOBBUy53nKJNl8FCrwvEDCPDXXSkR32aonyAKH03J8n8YBbZOFcAQFJFPdd6nemJvv5rQKTAvIj/kaFQ7rMnCy72yh5TT5Pipd1gyKqoX9MDxok9wirtrNGMl0PnVPl/2+LRoL9Ii3VtS+KswnwXM9273upk5UxtemDCu5Me0pp3qxDmtG4QTUD00AgZpESeSNPYyp3lpL9emORIr50h5AxxE1VaAlnyPtwsgFiJbk6eKQeFp5xWFZJW53wsFVZT+O3LtLv5Zuab2jJM9vqR5qxOD5ej9TARvV6dGt4s4MREPYYRnIAJ+5ZH/UA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(396003)(39860400002)(136003)(366004)(376002)(451199021)(6486002)(478600001)(83380400001)(6506007)(26005)(6512007)(6916009)(4326008)(54906003)(66556008)(66476007)(66946007)(186003)(2616005)(38100700002)(31686004)(8936002)(8676002)(5660300002)(2906002)(316002)(41300700001)(86362001)(31696002)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RVBhQ2tpNTRDZ0RWRVMyZmNySmRZSFNsZXVvZjhzbC90ZmE2TlZuWmNNaG4x?=
 =?utf-8?B?THlsTEFsRGlPYld5d3V6OW1lbGFvcDJDSjdNRUhXd2dyTzZjRUpUaE5YWTg4?=
 =?utf-8?B?VnhiVkE1aDJ0RGUzRnBmanBweEJ4VFdBWEZhN3lGb0NkekVLMTM3eloyQ3lk?=
 =?utf-8?B?RDN3ellyc2dBQUIwOGtLKzZ5VDdCKzVKSVBtaTNJaWYvd29sd1dFQlFIOWYx?=
 =?utf-8?B?OXRpdFBGNFErTjRRbTl3NnQ5ak5MK1g1SXRhYzF3L3BhOWVzV1dadTloaTF5?=
 =?utf-8?B?dTE4RGFaV1ZRR04vWFBWSUdOSmk4NjJTemdhRkRuc3F4ZVVCT3RTY0N5L0Fs?=
 =?utf-8?B?RzBiTWVPVmI4UTR0dGIvWFNTTm10Z1lMTjI4ellyWHRwSy8zZ3BrbTFnOG9G?=
 =?utf-8?B?Y0V0Y1BTcGFqeHdiWm8rUGZhdkl3QzlrTTdhdDZqTDI4ZWZ1UzAvbjJ3ZjR3?=
 =?utf-8?B?ZE5BQStURzM2UTVVamlLYytjdVZ2bGw2dTUyWXppYUdVODBZeVpNUnZaMDRG?=
 =?utf-8?B?RzVaT3ZxMzAyWDBDVWFnOGNYRkpSVzJlbmM3UUNvMTcyTlNSQjd2T1hlc2dz?=
 =?utf-8?B?anF4V2FDOHRwREFsV0JWU0h6UFdyZTA1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
 =?utf-8?B?VHZ5eG5BK0c1bmkxM0ltUEIzRFVIRmJjQ1pGRFUrWEdES2JPU25xcTJaMmhq?=
 =?utf-8?B?ZEpRY3JRTFAyandNdG1ramVydVVDTWVKcjBjSDN5aHFmdC9UVUlTOXdZM2w2?=
 =?utf-8?B?TGY5Ui8zb1pxOFNYQTh1UFJITE0xcm9GOTFYYmhwMVpmS2hrMnA3YTNSdGxl?=
 =?utf-8?B?OEMvVEFoL0FWWVAzRlN5cU9WYWFQVStiWEp2a1NrREFPSEpJSVdvMjE5Wk4x?=
 =?utf-8?B?RWhPTWxjVWxISmswcVNDMEcrREt6eDI2blV1OGRhMzNiVFVuMUpXVStNZmd3?=
 =?utf-8?B?Znh3NW1XRkhER0txOXhZME9TRFVwejNnWEtaVUY1VUhZRjhTYWQwWEdnQzRI?=
 =?utf-8?B?L2grSzhZVVFBZWloRmp1TnVCMkV2L3BySmFGZlk1L3ZvdDZ5NkRuQW8yVm01?=
 =?utf-8?B?ckVIQjZVWWZjOUg2b0RsaGxBNWZuOWpVc3hBbjBiY3RXbi95NjN1RndLZ1Fl?=
 =?utf-8?B?WC9iSk5rVlN5VUhhWU5zTVQ0Tlc0UHBveFVabFdHZHB4Tjc2Sk41TVdrOWhv?=
 =?utf-8?B?ZEdpUFlUNnpoRzFuSDVHNEJNSTV0NHpZaFdhQm5YbUI5cEdMNzJSV1RFczE4?=
 =?utf-8?Q?g2FLT96rF7IwML60nqmP49Nua?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d0e47f9d-840e-464a-5cba-08db8e747992
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 07:38:31.1934
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: swjeH4W5T0YnuLfNMSpgIRAZZEoeAnVaSz4EnZ2iiuAz2brzEmkuQnZvDJCIVMWWVXrRcfdhquAaPDKU6TIz+Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB8026

Its original introduction had two issues: For one the "common" part of
the checks (carried out in the macro) was inverted. And then after
removal from the radix tree the structure wasn't scheduled for freeing.
(All structures still left in the radix tree would be freed upon domain
destruction, though.)

For the freeing to be safe even if it didn't use RCU (i.e. to avoid use-
after-free), re-arrange checks/operations in evtchn_close(), such that
the pointer wouldn't be used anymore after calling pirq_cleanup_check()
(noting that unmap_domain_pirq_emuirq() itself calls the function in the
success case).

Fixes: c24536b636f2 ("replace d->nr_pirqs sized arrays with radix tree")
Fixes: 79858fee307c ("xen: fix hvm_domain_use_pirq's behavior")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
This is fallout from me looking into whether the function and macro of
the same name could be suitably split, to please Misra rule 5.5. The
idea was apparently that the check done in the macro is the "common"
part, and the actual function would be per-architecture. Pretty clearly
this, if need be, could also be achieved by naming the actual function
e.g. arch_pirq_cleanup_check().

Despite my testing of this (to a certain degree), I'm wary of the
change, since the code has been the way it was for about 12 years. It
feels like I'm overlooking something crucial ...

The wrong check is also what explains why Arm got away without
implementing the function (prior to "restrict concept of pIRQ to x86"):
The compiler simply eliminated the two calls from event_channel.c.
---
v3: New.

--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1349,6 +1349,7 @@ void (pirq_cleanup_check)(struct pirq *p
 
     if ( radix_tree_delete(&d->pirq_tree, pirq->pirq) != pirq )
         BUG();
+    free_pirq_struct(pirq);
 }
 
 /* Flush all ready EOIs from the top of this CPU's pending-EOI stack. */
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -711,9 +711,10 @@ int evtchn_close(struct domain *d1, int
             if ( !is_hvm_domain(d1) )
                 pirq_guest_unbind(d1, pirq);
             pirq->evtchn = 0;
-            pirq_cleanup_check(pirq, d1);
-            if ( is_hvm_domain(d1) && domain_pirq_to_irq(d1, pirq->pirq) > 0 )
-                unmap_domain_pirq_emuirq(d1, pirq->pirq);
+            if ( !is_hvm_domain(d1) ||
+                 domain_pirq_to_irq(d1, pirq->pirq) <= 0 ||
+                 unmap_domain_pirq_emuirq(d1, pirq->pirq) < 0 )
+                pirq_cleanup_check(pirq, d1);
         }
         unlink_pirq_port(chn1, d1->vcpu[chn1->notify_vcpu_id]);
         break;
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -158,7 +158,7 @@ extern struct pirq *pirq_get_info(struct
 void pirq_cleanup_check(struct pirq *, struct domain *);
 
 #define pirq_cleanup_check(pirq, d) \
-    ((pirq)->evtchn ? pirq_cleanup_check(pirq, d) : (void)0)
+    (!(pirq)->evtchn ? pirq_cleanup_check(pirq, d) : (void)0)
 
 extern void pirq_guest_eoi(struct pirq *);
 extern void desc_guest_eoi(struct irq_desc *, struct pirq *);



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 07:39:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 07:39:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570809.892989 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvaP-0001Ts-Im; Thu, 27 Jul 2023 07:39:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570809.892989; Thu, 27 Jul 2023 07:39:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvaP-0001Tl-G0; Thu, 27 Jul 2023 07:39:01 +0000
Received: by outflank-mailman (input) for mailman id 570809;
 Thu, 27 Jul 2023 07:39:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOvaO-0000oV-BL
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 07:39:00 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2061e.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::61e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a65a739e-2c50-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 09:38:59 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB8026.eurprd04.prod.outlook.com (2603:10a6:10:1ed::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 07:38:58 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 07:38:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a65a739e-2c50-11ee-b247-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hwjPV5rzFikFiImdAsVzsAfrUIrIiieX6RTXK2Z7CmM2zNU+5wc/7sZ4kOrKx0QrtCDNLH1Fo+Da+4Rh517guPk3vi8CXgVzdnQq82dVfve96vF1oyABseynDVOmJ8IaWBq0TzDpWgURENshRpjKy6vfoIUWDT5Nd8q5G7oY+m9vdVGx5dVQnxf2j1kMvhhRsyma2KuAztn8xPlA42rcb2hTqBVc4WkaDG1UgNK/6d0U8uNrcfyROJ0kgHpfddgv+nAKpxg5x9VpjRqdgSkRePjxXDo5Ixf0W+bs/h0hJFgcJqoOOv68M1hn3+J5VqQE3Hd4Ef5w3gXj5tSjMSQuRQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LcI5ZJzazpf4rWCLgNaHF2wR1tw4mKVTroN0tDPQMsM=;
 b=U5dZHRlscsMqLLIRSNZWHgpMpz4xrpal9KLc28xPSJ2VffYoO/G+O6BlPmVhj5/kZJ7GB+RkQElm2QX3L/C6lJiyDa/4oZe1oZZX8zyq+7wFFBp2tfUOvEeXCxAdjc9K37wwgh0u6maWVx2N+qSTnDfIwkTdG9AGosKCYKnjoTXmclxKLArIJ5pUq6u7BvvqVFMOBtCYKCRqLBbyaE/nqCEsTKYVdAAP9Apqjsiefx5qD9+SAZgzrKpxd0n7tUNrQjCgy10x5co69BJw/z/md2/2j9F303DGLPhWY8PkCrjao8cYhn85dp1pR91oHO9GSVw8QcmIZbM8rZZuM1DPpQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LcI5ZJzazpf4rWCLgNaHF2wR1tw4mKVTroN0tDPQMsM=;
 b=Aj9Yno/MvACaO1g0NEFklF3LLItAvZSh8FpqY0/jNUCt8ihsDAQ/zB98M00X7RUqxZBFbBEJ+/DNR8qlGdHFXYMXDR0NJ4Abnox9kSIbCOh+a/VkY1HZ5tAsUsVUvl6tuXfR72k39MENP9YsTvDGvVmZpB1zvKRkPgHat3ULliIn7hBigVPcM7QiNIdYfh6u2cQqOOxnWFbCvQk7wtOyjlvN9t4mWI2+mISkvid+L4LHyAX/YGnprkaLasShl7CYPEe/uiNBL02z5OIM4ePeHNouVD5MZey72b5gRoeqNk6DyWwDAHbGAO4ruOTm9gSoCm8MoIi9ITBS2LHdXqy6Xw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3c3a1d0c-06f2-a392-b2f9-381bed5c5e7b@suse.com>
Date: Thu, 27 Jul 2023 09:38:55 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: [PATCH v3 3/3] cmdline: document and enforce "extra_guest_irqs" upper
 bounds
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <7cb0d24e-2bda-dcda-4874-2c01ba179947@suse.com>
In-Reply-To: <7cb0d24e-2bda-dcda-4874-2c01ba179947@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0226.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b2::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB8026:EE_
X-MS-Office365-Filtering-Correlation-Id: e357e203-fb80-4bb8-3ddd-08db8e74898f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	tddKRQH9BPT2hKmHa75uwHZdQw5ByTpVpyxtjSi84jDQ4cdb/omKBMBfPNy7oX5CnZNzJc7khVtJHd+fm7HgODXfgvb8YScdBEBkIkdzbJuUQPcSal4s2WPsCh9srUuu6UlC6pGicK6/MnUZFoyJ9b2b/KcLxgUImikSMpp5hjaluCR7UVkoHKndNCevo0kPL3ocaWoAzofTlDVyyKANnzYCFqoEgUrG5sq4fCFRlNutVY1gLpY3mOHl9U7oASbtkM3oWVqlbI95D++eY0yozC2lTCZ4HVFFKIJRhotH/XMIZNKdH33M5cRjw6hDWCAptDjTPCIMxq1UVHjb06ztyeDZpeyeM2if1T1X0iIkFH3HJ9E2SdBgqi9OIGdTHRQadNdOTyOLhbPIn/kkJaJkBmo4cLqlwLznkgWaiEIw6AwP0sTFKTj+c914TQ809TkDRaUSlVwlADDb+eFQaNSfb9tmVEb2Qa96UR8UV3ccd+GtU111xy71Dx0b/3NzEQ6jWutTHs6aWN21hC5O6XqqhHDFxQpUP7wRbI58Wbvk4xeloeCMP4E56J+8pziogGCxkIn2gttMrKjndTtvr1gGvGIdhAbvAk00YgZKYjEGSGAIbby2U77uKYm64HI9ezN4oShUeKUDXA6+z+pFxHh8Xw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(396003)(39860400002)(136003)(366004)(376002)(451199021)(6666004)(6486002)(478600001)(83380400001)(6506007)(26005)(6512007)(6916009)(4326008)(54906003)(66556008)(66476007)(66946007)(186003)(2616005)(38100700002)(31686004)(8936002)(8676002)(5660300002)(2906002)(316002)(41300700001)(86362001)(31696002)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Y2R6bTJEV2h4U0ZhMTBjYW5MTytCb0FuZXJNVVZhQlZHeGdtUXVaSkxVSzJ3?=
 =?utf-8?B?MENPVi9HeTJ0OWE4NW4rRWxKL0FGWDBJMzdQSmdOZ0JPcURNVUpnbjV0WDhM?=
 =?utf-8?B?VDZjREpPbEhRd0FOS2ExMEk3Sk1NZ3d1U1FpYjE0MkpPejc1UjFZUHVxL09T?=
 =?utf-8?B?NGRRTVVhaWNDKzVCV1NuaUJ3OVZRL2ZhNENydllxK1pOMllBMEsyUTNpUTJh?=
 =?utf-8?B?eUIxYUhacEJ5SUVpV3ZVdnRpa09MK05WSmhVeWpQZGJzUEVQSHBWSzg1VlFk?=
 =?utf-8?B?Z2hmc0hTczYyM3VtemhNRStDcC9OZVZlTVRmS051K01Na1Q2eFhyWnVMVlBS?=
 =?utf-8?B?YVh3eUF3Zk5aUTg0akpNU2N4ZlNnWUZSOTA1eHZFNFhkclUvVFZtSjhJRGtn?=
 =?utf-8?B?Z1JPc09pYTZGSFhRWE9ibVpVMENkQnpHazFoYjFneGpsdGJ2eTJuMFlwaXVK?=
 =?utf-8?B?YWdDQlFnR3EySUE5TWlyYVh3MStPVWpFVHNNdXBRWGhOWUluaXkzQSsweE9W?=
 =?utf-8?B?NUtFUTVIU0VONFVxd0dybHRNV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Qm91NVgxSmZ2?=
 =?utf-8?B?YXBoYUF2L1poTU5VOHVnd1ByZ1p5ZVhRNWRuVHRsY1Z2WGFONGpUak5GdmRR?=
 =?utf-8?B?VE52Q3VBd2FVYmhEVCtMS2UrSldRdlRrM0RhVUl3d1ZGajlwSEpCL1F3dkxF?=
 =?utf-8?B?aWk5bmpOYkI3bWZHSjBDTUFZcUczMU5rQ1hZb3Rsb2NDV2gwYXZveGtaMHp4?=
 =?utf-8?B?NTVjcFJEOThpVXFTM3NjeWI5MGRYQmhWVExGdzZHOS9ITktMcm42N0VVVFdy?=
 =?utf-8?B?VmNWWjVSbjdQRUJYcDhKZ2x0aGNVKzV4eFE1emxubWs3bWV2Tkw0NlNhL2xr?=
 =?utf-8?B?TmRDcTBENm13MnRGWW14MFFVV0kvQlZSZEd3d0taUldwVytFYkdaakg4L0F2?=
 =?utf-8?B?TEhKbFhBci9jeWtvSU1PM0xwRHgxTWV6ZUhRMkg5M3ZoVXExZ2JlL0V0Skxh?=
 =?utf-8?B?Y0VTQzh2WTBreUcrQXUzZy9wUnAwYzQxamNET0JISkNwcStjaFNiY1d4ZG9B?=
 =?utf-8?B?Z25oOUJmVVlrbENXUHNab0xoTzZ2SzA3bkkwckNQSUtZemc0VTJSbGxDaWxY?=
 =?utf-8?B?MUdtc1kxVi9QS0VSVGY5cGdLcVArN0RjUC9TdjYxZW1KYjkrTDQ5c3RIb3Jn?=
 =?utf-8?B?ZUNDOXNBTDZKNEViajNYaDBqSE84Y3RFT2s4dCt0N0hpZE1UTlIwdW9hVDYw?=
 =?utf-8?Q?XHAbYzBZx/lf5jFfm9n2GeXGm?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e357e203-fb80-4bb8-3ddd-08db8e74898f
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 07:38:58.7502
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: u0zbVvRQOV3DmCAIw7+qnOc+Eovgqu1z68HmgyMm5pw31KL68/KIYfQVeA9YiWE72HUc9lO2PjNoe++uMfv1KQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB8026

PHYSDEVOP_pirq_eoi_gmfn_v<N> accepting just a single GFN implies that no
more than 32k pIRQ-s can be used by a domain on x86. Document this upper
bound.

To also enforce the limit, (ab)use both arch_hwdom_irqs() (changing its
parameter type) and setup_system_domains(). This is primarily to avoid
exposing the two static variables or introducing yet further arch hooks.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Instead of passing dom_xen into arch_hwdom_irqs(), NULL could also be
used. That would make the connection to setup_system_domains() yet more
weak, though.

Passing the domain pointer instead of the domain ID would also allow
to return a possibly different value if sensible for PVH Dom0 (which
presently has no access to PHYSDEVOP_pirq_eoi_gmfn_v<N> in the first
place).
---
v2: Also enforce these bounds. Adjust doc to constrain the bound to x86
    only. Re-base over new earlier patch.

--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1146,7 +1146,8 @@ common for all domUs, while the optional
 is for dom0.  Changing the setting for domU has no impact on dom0 and vice
 versa.  For example to change dom0 without changing domU, use
 `extra_guest_irqs=,512`.  The default value for Dom0 and an eventual separate
-hardware domain is architecture dependent.
+hardware domain is architecture dependent.  The upper limit for both values on
+x86 is such that the resulting total number of IRQs can't be higher than 32768.
 Note that specifying zero as domU value means zero, while for dom0 it means
 to use the default.
 
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2663,18 +2663,21 @@ void __init ioapic_init(void)
            nr_irqs_gsi, nr_irqs - nr_irqs_gsi);
 }
 
-unsigned int arch_hwdom_irqs(domid_t domid)
+unsigned int arch_hwdom_irqs(const struct domain *d)
 {
     unsigned int n = fls(num_present_cpus());
 
-    if ( !domid )
+    if ( is_system_domain(d) )
+        return PAGE_SIZE * BITS_PER_BYTE;
+
+    if ( !d->domain_id )
         n = min(n, dom0_max_vcpus());
     n = min(nr_irqs_gsi + n * NR_DYNAMIC_VECTORS, nr_irqs);
 
     /* Bounded by the domain pirq eoi bitmap gfn. */
     n = min_t(unsigned int, n, PAGE_SIZE * BITS_PER_BYTE);
 
-    printk("Dom%d has maximum %u PIRQs\n", domid, n);
+    printk("%pd has maximum %u PIRQs\n", d, n);
 
     return n;
 }
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -693,7 +693,7 @@ struct domain *domain_create(domid_t dom
             d->nr_pirqs = nr_static_irqs + extra_domU_irqs;
         else
             d->nr_pirqs = extra_hwdom_irqs ? nr_static_irqs + extra_hwdom_irqs
-                                           : arch_hwdom_irqs(domid);
+                                           : arch_hwdom_irqs(d);
         d->nr_pirqs = min(d->nr_pirqs, nr_irqs);
 
         radix_tree_init(&d->pirq_tree);
@@ -819,6 +819,24 @@ void __init setup_system_domains(void)
     if ( IS_ERR(dom_xen) )
         panic("Failed to create d[XEN]: %ld\n", PTR_ERR(dom_xen));
 
+#ifdef CONFIG_HAS_PIRQ
+    /* Bound-check values passed via "extra_guest_irqs=". */
+    {
+        unsigned int n = max(arch_hwdom_irqs(dom_xen), nr_static_irqs);
+
+        if ( extra_hwdom_irqs > n - nr_static_irqs )
+        {
+            extra_hwdom_irqs = n - nr_static_irqs;
+            printk(XENLOG_WARNING "hwdom IRQs bounded to %u\n", n);
+        }
+        if ( extra_domU_irqs > max(32U, n - nr_static_irqs) )
+        {
+            extra_domU_irqs = n - nr_static_irqs;
+            printk(XENLOG_WARNING "domU IRQs bounded to %u\n", n);
+        }
+    }
+#endif
+
     /*
      * Initialise our DOMID_IO domain.
      * This domain owns I/O pages that are within the range of the page_info
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -173,8 +173,9 @@ extern irq_desc_t *pirq_spin_lock_irq_de
 
 unsigned int set_desc_affinity(struct irq_desc *, const cpumask_t *);
 
+/* When passed a system domain, this returns the maximum permissible value. */
 #ifndef arch_hwdom_irqs
-unsigned int arch_hwdom_irqs(domid_t);
+unsigned int arch_hwdom_irqs(const struct domain *);
 #endif
 
 #ifndef arch_evtchn_bind_pirq



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 07:42:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 07:42:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570812.892999 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvdI-00033d-6C; Thu, 27 Jul 2023 07:42:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570812.892999; Thu, 27 Jul 2023 07:42:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvdI-00033W-3J; Thu, 27 Jul 2023 07:42:00 +0000
Received: by outflank-mailman (input) for mailman id 570812;
 Thu, 27 Jul 2023 07:41:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOvdH-00033Q-I2
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 07:41:59 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on20612.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::612])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1062f7c7-2c51-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 09:41:58 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB8315.eurprd04.prod.outlook.com (2603:10a6:10:25c::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 07:41:53 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 07:41:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1062f7c7-2c51-11ee-b247-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CemJIm2a6qQZLErdUp2cSLA5bRB2udLJwRYchbwpOghrA4mCb6Bcg9b3fJNkxJdaNNxnrNT3mvqacm/ABLL8/U+tfHesqZe4SNR/ASEkdAHEubbVgmR0/70VCN6goAwpNPgWDhxGDZdKlYsz1GsEM4MBHrMNd+yDY90j7Mav+/gee5tyYBmFwFnG8g/1b76BQSPI8j7tRR4Y/P9F351sCMV3CChbSir65CsjATplcyBIgdXme1HrWnMXMBEIw/dQrOfqUIkcKsgrnslGbEA7wF3mM4C9X27rGk3UJgO75REVgKdIUT6NtpDtLtWkY99sWSl0DDp5G7AicdaQiBx+rg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yugv+Oxfr7fM35GP/2dRc8DQW9d8ksnpCiwi74A5u58=;
 b=Ta4V+SliSoHijmNH/Kzp0s+Jszyp51KaDF/+NTl/8j46ORI0AIQYGFYjfuzedOA1McYgYh7pTmzuKKhwJf4CV6DEmNnaVrF7L/o9qzGfvBJnIpo8Xg7Jrc6HSDGcsO4UoALmiEgBue3jgiKmNdoof8ouTo3pg1LmgqV+8PXsiwNWYT9LFXQ7XKPoSPnN7lFvCRJDiadZj4gqv4vUtniZE5+zFYYxA1DZhjqmhBqr77ypPdaWTS2cNhTK/6ApQG0fGTAWFmmciZ5jfC2llps/HRSePGma430uDaqLG/bIfzBZyDNt1zpX6jsynSDGMZGQdkXX4EDoxLLWLIbhsUK+KA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yugv+Oxfr7fM35GP/2dRc8DQW9d8ksnpCiwi74A5u58=;
 b=ACgshgSH8m2uTuqenG0VL8kcHVZzEJMA2HO90mUbnSJGMgh5dan/2kAcp0J31SFLX5oCbBBXopA703YWfEBERr5HEtbHmHQV6e/cQ4p+V+otdjI0C2gH2uWV/XVQL0jh4Vt9zh6J5rZaGRlt6yf9fo50k6m52mJkmqnIqBhvxoFGBO/dX1KioV7hYCncc4YiTfFlgbI2dYBplfx1N4hpTZ4sQ9VA4xaYiuMKWLneQiTKeP4snDcb7Oa19uuf7qb9mottiGYqyGgj7Fy2dg18HFDyKkcumzRrjapATCQqdm5slkidYhJgZ6wfsqsrNDz1repMnHwBi7NwXx4vxvWLCw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <999aae1d-fb85-6550-9798-64cf88d7faf3@suse.com>
Date: Thu, 27 Jul 2023 09:41:50 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Content-Language: en-US
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local> <87ila7cvy2.fsf@epam.com>
 <ZMDox0WwumxMGnzV@MacBook-Air-de-Roger.local> <87y1j2b296.fsf@epam.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <87y1j2b296.fsf@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0001.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:15::6) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB8315:EE_
X-MS-Office365-Filtering-Correlation-Id: b34f3022-1ba8-4bb4-9df7-08db8e74f220
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	b3nFM7YEZQXLG3G/7u3noyFE8D1fswo1WZVPGtH+ZopBv/3LnbzIBRsc9SkMscgwu9uOZXPRAaNZDCoqnXiWQepDxvm5N3r6V99PxKIt/K1DgCriyJh33ddTPNe9w/tZ3pwkJA4yND+MPQ4/PzPnlC/PXpb57AGwB5WoGgyOEO4Rv1Kq7bBLln19X87estq2BvzG2ZaBtO5fA4MMRiHyuZ9AKDxWXtx9HBJxKEnvo5ido+mspsIxBQDcu3621J0IS+YED4QTEuS5Y7i1/5799Iw6x55JQhDbia/l+WnwZ2cDRCFeVILf9iWmOXbHDzrQ1NHszhmljlse98EUNMzQcSTQNYxhLuN5lSDbC9aDrmVq3s0Rw45MxsRUvYlsZijMPkLG8Jw6dQ/TkbWamsvwmIqLAz/Vdnplm1JpHrVqL19OM6BHYXB1poVNyDqlLFxeeWhVKI8Z0gOEjGbI99aPFr0EYqbcwIG5ipNN+S7t5u64bvcgvZgmcpQDKg6KOYk1yI9uWydQ9eYivwppmcjaPT3PJNbX+XaxSxlEaLp7VUmBkwrL7wnKfVtN0vDNx7WS4KCrfkf946pNk9ZmWX+dk7poURoTw6FB9S2kkkFTu8DkiDqAgU1R2rVrnAQpidPslmAD8LFRV5hZWTU8TxV6Mw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(396003)(39860400002)(136003)(366004)(376002)(451199021)(6486002)(478600001)(83380400001)(6506007)(26005)(6512007)(53546011)(6916009)(4326008)(54906003)(66556008)(66476007)(66946007)(186003)(2616005)(38100700002)(31686004)(8936002)(8676002)(5660300002)(2906002)(316002)(41300700001)(86362001)(31696002)(36756003)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lc1YxbWpsWXQvTSt1bDV5OG92ZGF4WVU0?=
 =?utf-8?B?RExVQllXblV3Qk1vd1pJUXhyYXZPQUowSVN2VXdWNVJJdHM0amdqRCtrVjVE?=
 =?utf-8?B?aWtkMUczTUtDbXh6QlBza0ZpSVdqYnE3b2RydkZKTlRzbldkdi9TQ2JJU1c2?=
 =?utf-8?B?T2pDZDFEMEQySDNQSEg4Zm84ZnJuUk81TzBVdHVIbjEwdkhYLzQyTU1EaTVK?=
 =?utf-8?B?c1FKbGdJMDdnam1jQWRGL0ErTHkxd0Q4ajNnZVVOVFFhWXVvM0lpS1VJNGxJ?=
 =?utf-8?B?OHdML3JCR3lHZi9zcmRKNmRyMDFOUUlneHI1SE9HZ3cvc3AwTUlUKzFLa0t2?=
 =?utf-8?B?MC90WmovY0M1VHU5SjVTb0FCKzhONkdtdTlPT0xrZkRZeXd6L3RQdjdGZ3Zn?=
 =?utf-8?B?b0p3S2JKQ2RmUmpTUUxKTno5Smt0cnFqZjZRdWsyTVc0LzlCbG55WjJDbUJh?=
 =?utf-8?Q?gU+pxaHdiFPhIbKvTS8B82El2?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b34f3022-1ba8-4bb4-9df7-08db8e74f220
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 07:41:53.4205
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: aFDQZWluIYQWwyO6lO7d2MwhC2mxzQM84bIxTt2/nDh/r8fQtwzHFsSqNL/P2E+IDVtk5GCdLvjMGkPLHwqoRQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8315

On 27.07.2023 02:56, Volodymyr Babchuk wrote:
> Hi Roger,
> 
> Roger Pau MonnÃ© <roger.pau@citrix.com> writes:
> 
>> On Wed, Jul 26, 2023 at 01:17:58AM +0000, Volodymyr Babchuk wrote:
>>>
>>> Hi Roger,
>>>
>>> Roger Pau MonnÃ© <roger.pau@citrix.com> writes:
>>>
>>>> On Thu, Jul 20, 2023 at 12:32:31AM +0000, Volodymyr Babchuk wrote:
>>>>> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
>>>>> @@ -498,6 +537,7 @@ void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
>>>>>          ASSERT(data_offset < size);
>>>>>      }
>>>>>      spin_unlock(&pdev->vpci->lock);
>>>>> +    unlock_locks(d);
>>>>
>>>> There's one issue here, some handlers will cal pcidevs_lock(), which
>>>> will result in a lock over inversion, as in the previous patch we
>>>> agreed that the locking order was pcidevs_lock first, d->pci_lock
>>>> after.
>>>>
>>>> For example the MSI control_write() handler will call
>>>> vpci_msi_arch_enable() which takes the pcidevs lock.  I think I will
>>>> have to look into using a dedicated lock for MSI related handling, as
>>>> that's the only place where I think we have this pattern of taking the
>>>> pcidevs_lock after the d->pci_lock.
>>>
>>> I'll mention this in the commit message. Is there something else that I
>>> should do right now?
>>
>> Well, I don't think we want to commit this as-is with a known lock
>> inversion.
>>
>> The functions that require the pcidevs lock are:
>>
>> pt_irq_{create,destroy}_bind()
>> unmap_domain_pirq()
>>
>> AFAICT those functions require the lock in order to assert that the
>> underlying device doesn't go away, as they do also use d->event_lock
>> in order to get exclusive access to the data fields.  Please double
>> check that I'm not mistaken.
> 
> You are right, all three function does not access any of PCI state
> directly. However...
> 
>> If that's accurate you will have to check the call tree that spawns
>> from those functions in order to modify the asserts to check for
>> either the pcidevs or the per-domain pci_list lock being taken.
> 
> ... I checked calls for PT_IRQ_TYPE_MSI case, there is only call that
> bothers me: hvm_pi_update_irte(), which calls IO-MMU code via
> vmx_pi_update_irte():
> 
> amd_iommu_msi_msg_update_ire() or msi_msg_write_remap_rte().
> 
> Both functions read basic pdev fields like sbfd or type. I see no
> problem there, as values of those fields are not supposed to be changed.

But whether fields are basic or will never change doesn't matter when
the pdev struct itself suddenly disappears.

Jan

> Also those function use own locks to protect shared state. But as IO-MMU
> code is quite convoluted it is hard to be sure that it is safe to call
> those functions without holding pdevs_lock. All I can say is that those
> functions and their callees have no ASSERT(pcidevs_locked()).
> 



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 07:48:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 07:48:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570814.893008 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvja-0003gX-S9; Thu, 27 Jul 2023 07:48:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570814.893008; Thu, 27 Jul 2023 07:48:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvja-0003gQ-PK; Thu, 27 Jul 2023 07:48:30 +0000
Received: by outflank-mailman (input) for mailman id 570814;
 Thu, 27 Jul 2023 07:48:29 +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
 <SRS0=SoSB=DN=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qOvjZ-0003gK-HT
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 07:48:29 +0000
Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com
 [2a00:1450:4864:20::536])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f89849ec-2c51-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 09:48:27 +0200 (CEST)
Received: by mail-ed1-x536.google.com with SMTP id
 4fb4d7f45d1cf-51e28cac164so3981890a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 00:48:27 -0700 (PDT)
Received: from [192.168.202.116] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 h19-20020a17090634d300b009890e402a6bsm440946ejb.221.2023.07.27.00.48.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 00:48:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f89849ec-2c51-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690444106; x=1691048906;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=U8NLpW781GKymwKVOk2qo+XyaFk+izYC0ZOXPVUGqDM=;
        b=mL1HeQ6tPfav0tGwbDdw999A+NhFmPi0sRew7Vhv5Y2UcXaRn0ED3N4fYEb6YWLqL8
         Fdbqff4U9w4EBB9v6hTLLCX/+FHR4tP6HUtQp5vDZJ1DgUAZoIrP+7QtL18LHeK4wGod
         JwTtmN4Rf0JqBccoxs1EYddyxOkXjci/Ffp+F88PiRr85PHGiQuFkHgw8RUDoCCdmUcr
         8Akpprmlqrjasy4mtZDl+s0hrFGCAr5v+RbFKnbFPIYkspweeePkj25cCKpofbNc0EUS
         Mc+/YH5nVMNeUR0y1bxMKzkTHMdoIesIPSh70sssvCfTg2Na7sRd+2HRtzCoD2AUK9OK
         6YUA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690444106; x=1691048906;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=U8NLpW781GKymwKVOk2qo+XyaFk+izYC0ZOXPVUGqDM=;
        b=dFkq6B/5DrhD+TIp8VoFTigdcojBCaQv0soTVyBwFygF2lUKMD9tPX/svqK0iKgMgk
         JisFIQO1wcfYQTtPxUFGQLgMjZKOth+TYquHpqungI0uhbU7tbweiKa7A1+UxnMjs6XH
         IvbeiWc/6zwqt3oWHFtpSrretu3G7PuAa9BUffqz6b7RaXrVmMLV3H3J2MNudiyyUqeN
         7Jvci8Ezt8QIdlYUZP/ECi3zBnVSrxyHZHrL56zvQVUlV1I9zChm1mwqog43D0DzF6G6
         k7G3vtyYl4hAvZ3+STpLEWV3JecTdE16xgPhAVZrkrDRTdEIIaVhsNaHTAQH42dycJHf
         kaGQ==
X-Gm-Message-State: ABy/qLZCu9zHBZi3dauptaG7NkuzTOgvrxIvjHKawDAwVDnExDmDcRUy
	cXCVtOhZYGAR1bg+Xb5i4QQ=
X-Google-Smtp-Source: APBJJlHm4qASaXxX5+tYRp4+0LkF1r/Lv0BpJWvZPj/BleMR5MwSQlAHgbNhWXQlaz/HnCMUiI3aiw==
X-Received: by 2002:a17:907:a407:b0:993:da5f:5a9b with SMTP id sg7-20020a170907a40700b00993da5f5a9bmr1574971ejc.8.1690444106274;
        Thu, 27 Jul 2023 00:48:26 -0700 (PDT)
Message-ID: <87318bad13fc380dc6de502b290f7263085729db.camel@gmail.com>
Subject: Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping
From: Oleksii <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Bob Eshleman
	 <bobbyeshleman@gmail.com>, Alistair Francis <alistair.francis@wdc.com>, 
	Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
Date: Thu, 27 Jul 2023 10:48:25 +0300
In-Reply-To: <53dc4f15-cdff-100e-eeff-f7bad24436a2@suse.com>
References: <cover.1690191480.git.oleksii.kurochko@gmail.com>
	 <a8ab1829ab718dda869db3df3348ded211e81967.1690191480.git.oleksii.kurochko@gmail.com>
	 <a370548e30aaa8c1160ecd5f2eccfcc10002a8f9.camel@gmail.com>
	 <6675f535-7cf7-dd55-4ebe-82ba486029f7@suse.com>
	 <4deb8c44cf639af66ad7f5b9b42180554e08d5cf.camel@gmail.com>
	 <5a40abd4-edc2-0de0-99ed-d23174940d66@suse.com>
	 <dee3624525f9530aaf3252c6c4fa6eb5262e76cd.camel@gmail.com>
	 <79b20131-46c2-9e54-e615-18a346b83b8d@suse.com>
	 <b219699f928b9e86a3b0af9656bfe0e083d3cfdc.camel@gmail.com>
	 <53dc4f15-cdff-100e-eeff-f7bad24436a2@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 
MIME-Version: 1.0

On Thu, 2023-07-27 at 09:25 +0200, Jan Beulich wrote:
> On 26.07.2023 20:39, Oleksii wrote:
> > On Wed, 2023-07-26 at 17:59 +0200, Jan Beulich wrote:
> > > On 26.07.2023 17:54, Oleksii wrote:
> > > > On Wed, 2023-07-26 at 17:00 +0200, Jan Beulich wrote:
> > > > > On 26.07.2023 15:12, Oleksii wrote:
> > > > > > On Wed, 2023-07-26 at 13:58 +0200, Jan Beulich wrote:
> > > > > > > On 26.07.2023 13:23, Oleksii wrote:
> > > > > > > > I would like to ask for advice on whether it would be
> > > > > > > > easier,
> > > > > > > > less
> > > > > > > > bug-
> > > > > > > > provoking ( during identity mapping to remove of whole
> > > > > > > > Xen
> > > > > > > > ) to
> > > > > > > > have a
> > > > > > > > separate identity section that won't be more than
> > > > > > > > PAGE_SIZE.
> > > > > > >=20
> > > > > > > I'm afraid you can't safely do this in C, or at least not
> > > > > > > without
> > > > > > > further checking on what the compiler actually did.
> > > > > > >=20
> > > > > > > > @@ -264,6 +268,19 @@ void __init enable_mmu(void)
> > > > > > > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0RV_S=
TAGE1_MODE << SATP_MODE_SHIFT);
> > > > > > > > =C2=A0}
> > > > > > > > =C2=A0
> > > > > > > > +void __attribute__((naked)) __section(".ident")
> > > > > > > > turn_on_mmu(unsigned
> > > > > > > > long ra)
> > > > > > >=20
> > > > > > > Did you read what gcc doc says about "naked"? Extended
> > > > > > > asm()
> > > > > > > isn't
> > > > > > > supported there. Since ...
> > > > > > >=20
> > > > > > > > +{
> > > > > > > > + =C2=A0 =C2=A0/* Ensure page table writes precede loading =
the
> > > > > > > > SATP
> > > > > > > > */
> > > > > > > > + =C2=A0 =C2=A0sfence_vma();
> > > > > > > > +
> > > > > > > > + =C2=A0 =C2=A0/* Enable the MMU and load the new pagetable=
 for
> > > > > > > > Xen
> > > > > > > > */
> > > > > > > > + =C2=A0 =C2=A0csr_write(CSR_SATP,
> > > > > > > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PFN_DOWN(=
(unsigned
> > > > > > > > long)stage1_pgtbl_root) |
> > > > > > > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0RV_STAGE1=
_MODE << SATP_MODE_SHIFT);
> > > > > > > > +
> > > > > > > > + =C2=A0 =C2=A0asm volatile( "jr %0\n" : : "r"(ra) );
> > > > > > > > +}
> > > > > > >=20
> > > > > > > ... none of this really requires C, I think we're at the
> > > > > > > point
> > > > > > > where
> > > > > > > (iirc) Andrew's and my suggestion wants following, moving
> > > > > > > this to
> > > > > > > assembly code (at which point it doesn't need to be a
> > > > > > > separate
> > > > > > > function). You can still build page tables in C, of
> > > > > > > course.
> > > > > > > (Likely
> > > > > > > you then also won't need a separate section; some minimal
> > > > > > > alignment
> > > > > > > guarantees ought to suffice to make sure the critical
> > > > > > > code is
> > > > > > > confined to a single page.)
> > > > > >=20
> > > > > > Thanks. I'll move all of this to assembly code.
> > > > > > Regarding alignment it is needed alignment on start and end
> > > > > > of
> > > > > > function:
> > > > > > =C2=A0=C2=A0=C2=A0 .balign PAGE_SIZE
> > > > > > =C2=A0=C2=A0=C2=A0 GLOBAL(turn_on_mmu)
> > > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ...
> > > > > > =C2=A0=C2=A0=C2=A0 .balign PAGE_SIZE
> > > > > > =C2=A0=C2=A0=C2=A0 ENDPROC(turn_on_mmu)
> > > > > >=20
> > > > > > Does the better way exist?
> > > > >=20
> > > > > The function is only going to be a handful of instructions.
> > > > > Its
> > > > > alignment doesn't need to be larger than the next power of 2.
> > > > > I
> > > > > expect you'll be good with 64-byte alignment. (In no case do
> > > > > you
> > > > > need to align the end of the function: Putting other stuff
> > > > > there
> > > > > is not a problem at all.) What you want in any event is a
> > > > > build
> > > > > time check that the within-a-page constraint is met.
> > > > But shouldn't be an address be aligned to a boundary equal to
> > > > page
> > > > size?
> > > >=20
> > > > According to the RISC-V privileged spec:
> > > > Any level of PTE may be a leaf PTE, so in addition to 4 KiB
> > > > pages,
> > > > Sv39
> > > > supports 2 MiB megapages
> > > > and 1 GiB gigapages, each of which must be virtually and
> > > > physically
> > > > aligned to a boundary equal
> > > > to its size. A page-fault exception is raised if the physical
> > > > address
> > > > is insufficiently aligned.
> > >=20
> > > You'd simply map the page containing the chunk, i.e. masking off
> > > the
> > > low 12 bits. If far enough away from the Xen virtual range, you
> > > could
> > > as well map a 2M page masking off the low 21 bits, or a 1G page
> > > with
> > > the low 30 bits of the address cleared.
> > Agree, then it will work.
> >=20
> > But still it doesn't clear what to do if turn_on_mmu will be bigger
> > then 64 ( ASSERT( (turn_on_mmu_end - turn_on_mmu) <=3D 64 ) somewhere
> > in
> > xen.lds.S ). Right now turn_on_mmu() function is 0x22 bytes and it
> > is
> > enough ( we are sure that we don't cross 4k boundary ) to be 64-
> > byte
> > aligned. But if the size will be more then 64 bytes then the
> > alignment
> > need to be changed to 0x128.
> > Am i right?
>=20
> Well, to 128 (without 0x), but yes. That function isn't very likely
> to
> change much, though.
Thanks.

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 07:51:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 07:51:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570816.893019 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvmN-00055g-B8; Thu, 27 Jul 2023 07:51:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570816.893019; Thu, 27 Jul 2023 07:51:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvmN-00055Z-7o; Thu, 27 Jul 2023 07:51:23 +0000
Received: by outflank-mailman (input) for mailman id 570816;
 Thu, 27 Jul 2023 07:51:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=6FcI=DN=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1qOvmM-00055T-4J
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 07:51:22 +0000
Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com
 [2a00:1450:4864:20::430])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 601bf925-2c52-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 09:51:21 +0200 (CEST)
Received: by mail-wr1-x430.google.com with SMTP id
 ffacd0b85a97d-31758eb5db8so679770f8f.2
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 00:51:21 -0700 (PDT)
Received: from [192.168.12.179] (54-240-197-231.amazon.com. [54.240.197.231])
 by smtp.gmail.com with ESMTPSA id
 r1-20020a5d4941000000b00314427091a2sm1172046wrs.98.2023.07.27.00.51.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 27 Jul 2023 00:51:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 601bf925-2c52-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690444280; x=1691049080;
        h=content-transfer-encoding:in-reply-to:organization:references:cc:to
         :content-language:subject:reply-to:user-agent:mime-version:date
         :message-id:from:from:to:cc:subject:date:message-id:reply-to;
        bh=cdITa7Wq+4eiw2rue221D0NdRfR3sO7CGc4YXAsZpSM=;
        b=dfYJocuFX58uoB/lZ0qThGXsuRnYBqoi2FczdSNLnCnSLRkoXQNPGbqscm7s7QXOSN
         FzoaNjtTp1pw3G8AB/C3WBb/v9Zz3wGvjPSXwnd1tulDZflBAM4cuGfoGR1wdiHy6AFZ
         5q0vMBOhdGuruljsur4GtxG4GXwZ3LFBQ+M0P42xj2Z/CF4Bp1ugHEu03XySzsE/w6Rv
         e3tLkfZjHy2gcfPMYGmyNb0TTPZzYIjuHmlBn6DFAGXNUbGNinTQdXCLw9kMAbzGHws0
         VCKrVaqyn4ggI8nOXizWAKwD2ChUSnPLwNivjjwqz+Yd0tnZLxTXX19ahk1XvABnQXge
         Zigw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690444280; x=1691049080;
        h=content-transfer-encoding:in-reply-to:organization:references:cc:to
         :content-language:subject:reply-to:user-agent:mime-version:date
         :message-id:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=cdITa7Wq+4eiw2rue221D0NdRfR3sO7CGc4YXAsZpSM=;
        b=ka/VtrLd0y90JHMjG1zZ8AND40FxJAsw9CUZZYGtjbKdOauJWs3MwJRFt6NTyzGC2Z
         ikSAfBUW/IqhKkrLn5wTPV+Ty9gRRvPJ7RrmtQzNtYWcyBL7MzolhTpBmemHg/mmG2tv
         MQpk9LvrnhgEL6Djx8EIb/XcnAgd0shvJMUcr4L7wWqZiXDzzuH7+Bfsx+gT1MI53rUq
         P2tDgMNZkRJx0p2sBFTyd3Y5LzhP6mxPS5+Cl/qqPgHZ7tMha6JHmFgTYdtIf4lQTJ64
         MFVIdH3UcBnmxoz1r1ohzPDzXYlxQkQBypi5EbGaGzt7fWLXw1xsAWI+ZsUx9nmh003G
         XdBA==
X-Gm-Message-State: ABy/qLaHW5yRTa7VOxI7HZ1IDrMgveORKX8sEROSwXzgjRWjU/puTQqz
	tR8oUFcrpkxdzNRuYblZ3wE=
X-Google-Smtp-Source: APBJJlGbm9sqXaDx4iRrqGi6MDRxZyjeroAuBLvHzibVYdsWVshwxb9/DgAr9sAx8eQh64NKb/DGLQ==
X-Received: by 2002:a5d:45cf:0:b0:313:f1c8:a963 with SMTP id b15-20020a5d45cf000000b00313f1c8a963mr1266338wrs.2.1690444280046;
        Thu, 27 Jul 2023 00:51:20 -0700 (PDT)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: Paul Durrant <paul@xen.org>
Message-ID: <3aaaa43e-b129-35aa-f07d-d50200a4c2ec@xen.org>
Date: Thu, 27 Jul 2023 08:51:18 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Reply-To: paul@xen.org
Subject: Re: [PATCH v1] xen-platform: do full PCI reset during unplug of IDE
 devices
Content-Language: en-US
To: Olaf Hering <olaf@aepfle.de>, xen-devel@lists.xenproject.org,
 qemu-devel@nongnu.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Anthony Perard <anthony.perard@citrix.com>,
 "Michael S. Tsirkin" <mst@redhat.com>,
 Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
 Paolo Bonzini <pbonzini@redhat.com>,
 Richard Henderson <richard.henderson@linaro.org>,
 Eduardo Habkost <eduardo@habkost.net>
References: <20230720072950.20198-1-olaf@aepfle.de>
Organization: Xen Project
In-Reply-To: <20230720072950.20198-1-olaf@aepfle.de>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 20/07/2023 08:29, Olaf Hering wrote:
> The IDE unplug function needs to reset the entire PCI device, to make
> sure all state is initialized to defaults. This is done by calling
> pci_device_reset, which resets not only the chip specific registers, but
> also all PCI state. This fixes "unplug" in a Xen HVM domU with the
> modular legacy xenlinux PV drivers.
> 
> Commit ee358e919e38 ("hw/ide/piix: Convert reset handler to
> DeviceReset") changed the way how the the disks are unplugged. Prior
> this commit the PCI device remained unchanged. After this change,
> piix_ide_reset is exercised after the "unplug" command, which was not
> the case prior that commit. This function resets the command register.
> As a result the ata_piix driver inside the domU will see a disabled PCI
> device. The generic PCI code will reenable the PCI device. On the qemu
> side, this runs pci_default_write_config/pci_update_mappings. Here a
> changed address is returned by pci_bar_address, this is the address
> which was truncated in piix_ide_reset. In case of a Xen HVM domU, the
> address changes from 0xc120 to 0xc100. This truncation was a bug in
> piix_ide_reset, which was fixed in commit 230dfd9257 ("hw/ide/piix:
> properly initialize the BMIBA register"). If pci_xen_ide_unplug had used
> pci_device_reset, the PCI registers would have been properly reset, and
> commit ee358e919e38 would have not introduced a regression for this
> specific domU environment.
> 
> While the unplug is supposed to hide the IDE disks, the changed BMIBA
> address broke the UHCI device. In case the domU has an USB tablet
> configured, to recive absolute pointer coordinates for the GUI, it will
> cause a hang during device discovery of the partly discovered USB hid
> device. Reading the USBSTS word size register will fail. The access ends
> up in the QEMU piix-bmdma device, instead of the expected uhci device.
> Here a byte size request is expected, and a value of ~0 is returned. As
> a result the UCHI driver sees an error state in the register, and turns
> off the UHCI controller.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> ---
>   hw/i386/xen/xen_platform.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 

Reviewed-by: Paul Durrant <paul@xen.org>



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 07:53:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 07:53:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570818.893028 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvoW-0005eH-N0; Thu, 27 Jul 2023 07:53:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570818.893028; Thu, 27 Jul 2023 07:53:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvoW-0005eA-KM; Thu, 27 Jul 2023 07:53:36 +0000
Received: by outflank-mailman (input) for mailman id 570818;
 Thu, 27 Jul 2023 07:53:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOvoV-0005e4-76
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 07:53:35 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2074.outbound.protection.outlook.com [40.107.13.74])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id af8a5037-2c52-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 09:53:34 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBBPR04MB7868.eurprd04.prod.outlook.com (2603:10a6:10:1f1::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Thu, 27 Jul
 2023 07:53:04 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 07:53:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: af8a5037-2c52-11ee-b247-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=g9XGLro4NiKNppWBVxev77fH6n+ZeyiI3YEiEtXjBc8fvKS4NZ/YdmEXBsk5USTyOQb2dQAvxq1V3MGHmkRcURpm+E9f47x0WS+WSCdEEjnEBgq134Pt23WET/L1Uhqn6FsyNSnYT/Bmw/7JpzwJvVLcQet2guWTrnFNfJUH4MLdarwEaRLft5kw9ZjNlsfQxChCevZeJ05I/D6OnjZI+l3Ci4oJju0BI//fR9AF4x5fEJb6bztSNRFwhEmZh+YYIInstNgV0q8TKQU9kcM2SXNLp3FDlJnr8edI14+hRh5d0RvJ/JBhMgCpkTGubcc6iMTqbKBCCAAYcaoLDlYwKw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=dasr7o8iHHwkZxg49CQhbvh0zVtG2GDXonEtaYW5K6c=;
 b=W2LcyDLZnpP68haIgakulkJ8LJsFN10NC01vNjGzAviEUK2n/BFiapEqLFOPptW9GgLVPnLdNTqpJMBJ6TZODZHROfRRIdoxXBiy4IKWKdJ3LD122qRQ6ep4LkTBx7f31Q4x0T1KyoXEn30h/FJvVenC38XHRol4kU4R9XGN7RWz1geiE5Lt+fal06GBhMwiuJRKM4qI1U3a3B5UD4JupPsVLzOU8GdG9LADkxUSS7JCcB+8PsjTgtIC0WFboolzDYWu4skr5Kxtn88qHopK0w/9NFtdXOppcgEu88XlXGw8n4UrFGXnJqEjI1Gx1fAJ+adNIyovumDyPgpwskHO/A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=dasr7o8iHHwkZxg49CQhbvh0zVtG2GDXonEtaYW5K6c=;
 b=sodf5q+JVIIt+ulesBqjJu1X2AG02Lb04cSV+4T9YvSiDIGhZy41lNvIgorj583xWOJyJ/YMrxEXrCoQs7vmUmgEx2nyhTorS+JX5wT1AwLzJWJOxdt6Ly1e3VRIfuv0SiDoh5bUF+eGf63r0Gy6Zh4e8rXllGUD47xmuAyaIwcnoiIXOBUfFCYlSIXOwo62HhBfTNiH6re1fhFcAHEe830AOp0LFj8YsEsGsC5VvMFZ4w7ZlIizqIRjY2vLdgQ/n7A8iYZTolM5qT1qM8Dxn3xs+pwbHO7wTkO3w04o4Y5tCXnYLC2LP3JbkbfrawZnJuVsAv6TNZLCdRlagasKVw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <5aaf37aa-cb7d-59e5-5e0b-40fa73177d35@suse.com>
Date: Thu, 27 Jul 2023 09:53:01 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 2/2] tools/xenstore: fix get_spec_node()
Content-Language: en-US
To: Juergen Gross <jgross@suse.com>
Cc: Wei Liu <wl@xen.org>, Julien Grall <julien@xen.org>,
 Anthony PERARD <anthony.perard@citrix.com>, Julien Grall
 <jgrall@amazon.com>, xen-devel@lists.xenproject.org
References: <20230724103324.4207-1-jgross@suse.com>
 <20230724103324.4207-3-jgross@suse.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230724103324.4207-3-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0225.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ac::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBBPR04MB7868:EE_
X-MS-Office365-Filtering-Correlation-Id: 418333a1-8434-426d-2987-08db8e7681be
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	WN0fPD7n5OObhPQy32DxnJixINKG9oKCKzx2DmuTrC062b5ReN+UJWspCXokEBlPX7JAmXKLLgb7ihCQFyeO4DmRjjR9So+yYnpYY8Cb/OojmLe00098k8wCWLJWnKu9lp0NYPzK3DZBGG+WuRGwApugz6Habn7BKJ/CLKghYbU0lHEXV+MY0t2JzRVTIQ4KBOEfSEdRMpD25BQwf6dORJwQNVuCWmOcE+bH+T23YgdnYU88TOmzmAG6OPOkA2zpEAb8oTLNooLVLbHIg/b5Hq1VCuzTThrM9LoypTcLFCS8bWv7zDQexNGrQbWNrfshZOqi7ptIS9NGBv0HCTQ3ZnDqafgk0NIKJ3c7QHHsuh8P4q5aJ6DsIlRv26/PaQAw85swntuDc+tIxr7hT88ERhzKIQlMZ4TmZ/fZIKIhJAKZ1PQwS7X0ULvv4i4nZquBUDX+oxSp11G4JeSxIrb7ko5kocGOFR6mHSVVMKZTHulReUOrddQaAzMYCUFTul/yf/VPBOJrDA4Jf9xUWGoDtdd8CGHVZA+n3arGy6JsYRnvf5YzXNAyAl9wqBY6UNsGabNGXP95b2eqqyfY07Tu6idRrUpAtWHPhm7AVbdT/CEmmIYaXMQiMqVbDREBArGkAZ8h1M1bechjh6mZxxpKZg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(136003)(366004)(346002)(376002)(451199021)(36756003)(31696002)(86362001)(4744005)(2906002)(31686004)(83380400001)(186003)(53546011)(6506007)(26005)(6512007)(6666004)(37006003)(38100700002)(478600001)(54906003)(6486002)(66476007)(316002)(4326008)(6636002)(66556008)(8676002)(8936002)(41300700001)(5660300002)(66946007)(6862004)(2616005)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eXdjTlViNW1Ka0ZhRUlMUkZ4dU04RjlUdUtYYmtGTmExMmtJeWxSV2VRdUNS?=
 =?utf-8?B?K2V0YVAvOGNYR0lySGtWc2ZjVUowMjZHODM1ZGk0N1dSRWFtNURIUS9qVmE5?=
 =?utf-8?B?QWl2MHQ3K2svRVVtKzlEaFJremVpeUZKRTNUbERQWmNReVpBRmpUbXhVWm1G?=
 =?utf-8?B?MVZPeW9TbXZ5aGtkS2tWTjF5VW9NSEFiZVY3K0UrMTE0MngwZENrWXM1d3U1?=
 =?utf-8?B?bWZlaU04ZVZSOWU2UmVHUHJ5Zy83cjJUaE9NSDNFcEV5SDBIREJYRUd2cVBi?=
 =?utf-8?B?VFBkaXRuTTlPRDFyK2Eyd0hoSVQ0K0k3ZlMxQ3kxY3hSRHNsaGxORmd1TjhK?=
 =?utf-8?B?UXRnRWlsWEplOElSSVFVclJuTWg1aVgrcDFRODk3ZHlKU2Rwa1lJQzFXNXp2?=
 =?utf-8?B?UTM5Zzd4TEJWK2wvUThLNnpmQjFJa0tEWWZOV1JxOWdVVzJXT2x5TzJzK0JM?=
 =?utf-8?B?UFBpbi8zYXM0T2xHOXVTZ3VETmFqdndtT3NrOFh3NmJZVWxlT08wajFqSVZr?=
 =?utf-8?B?S2hsTjNlTllRZmxYZlQyNmtUVnVmR0J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SlF2L05pLzBH?=
 =?utf-8?B?THdad1FoZ2NIQjVxNEF3RERQaW1RZFJxa040QXNCY092MmREa1N1UWZrdWVj?=
 =?utf-8?B?VThFb0FhQmZyUHJFQi9OTksxWWNKeiticFdwalo5S0NnMk95b3pmOEVDQXpp?=
 =?utf-8?B?WkthemRCZGlGazBMWitPMVVjYndqakJWcFcrd3lEc3Vqc3RuVW1xTmt5Q2pC?=
 =?utf-8?B?VEtWazlwY2pPdWo4dTVzLzlpNWExUnd4S1ArSXg2V1BuVlFiU0Z3SUVhSmtO?=
 =?utf-8?B?YVNCM3FRd1BYOGpCbkk0UktyVjg4Q3NybU5rK0dXbGEwbnJLU3JrNXhvZ2Uv?=
 =?utf-8?B?azlyS3k1dUxJUGZWZjJVZVNTb2JDYU9PeUlGczFmQkowb2xrMDVwZ2R6WE56?=
 =?utf-8?B?NVovUzFkeW0xdFVLemFneGhTaGtBYUFybHAzc0E5SWxYdGl2NEpLZVJrZ3Bo?=
 =?utf-8?B?V0dXWkhkNDg4YVpjTkUxbXo2bW1TOWVJMCtpb08xL2JvbFBneWxCSTNxSzRU?=
 =?utf-8?B?K09ialpzRVZjUXRGVVhWRkpKdUdYbVpsSWE3TjZScEVFa0ZnTitSL1l5cWNU?=
 =?utf-8?B?QkpDdzRITTlGUHBGWnFVMGQwSnFDWjNQeEFQNGlyMWd2RFZmNi9KTVBGOG96?=
 =?utf-8?B?RUJOdDE1aDJBUFNJU0JDS1BBSHdPYkxsbVhBTjNVcmFseVhZZmZPdHREaFRG?=
 =?utf-8?Q?P71vfPV/VkmHIscqRS1MGcRIF?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 418333a1-8434-426d-2987-08db8e7681be
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 07:53:04.4818
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: kTAzm2yp+e8Ek3/l658gmyXiayiGMt+fj8fYD2Vm6727CcOoi9xJssL/1BE/LbUaXuUlcOofU4hxGXHW+zUJOA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7868

On 24.07.2023 12:33, Juergen Gross wrote:
> In case get_spec_node() is being called for a special node starting
> with '@' it won't set *canonical_name. This can result in a crash of
> xenstored due to dereferencing the uninitialized name in
> fire_watches().
> 
> This is no security issue as it requires either a privileged caller or
> ownership of the special node in question by an unprivileged caller
> (which is questionable, as this would make the owner privileged in some
> way).
> 
> Fixes: d6bb63924fc2 ("tools/xenstore: introduce dummy nodes for special watch paths")
> Signed-off-by: Juergen Gross <jgross@suse.com>
> Reviewed-by: Julien Grall <jgrall@amazon.com>

I've committed the two patches, and I've queued this one for backporting.
Can at least one of you please confirm that the earlier patch is not
intended to be backported, and that instead a cast will need adding in
the backport of the one here?

Jan



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 07:55:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 07:55:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570821.893039 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvq8-0006Gj-6M; Thu, 27 Jul 2023 07:55:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570821.893039; Thu, 27 Jul 2023 07:55:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvq8-0006Gc-3c; Thu, 27 Jul 2023 07:55:16 +0000
Received: by outflank-mailman (input) for mailman id 570821;
 Thu, 27 Jul 2023 07:55:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=PqFe=DN=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qOvq7-0006GU-Lm
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 07:55:15 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id eb33f8a3-2c52-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 09:55:14 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id CC40B1F383;
 Thu, 27 Jul 2023 07:55:13 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 96804138E5;
 Thu, 27 Jul 2023 07:55:13 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id NdwpI+EiwmSjPwAAMHmgww
 (envelope-from <jgross@suse.com>); Thu, 27 Jul 2023 07:55:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eb33f8a3-2c52-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690444513; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=n2AfT1XuDgxh0PdO3odPNxZTqVfhIkrrDdOKZ66El8U=;
	b=J5GH5iKbLd520UmmsINhCaOvoimPC56mLS6/vR8EVG+uQ5Lznypy2Whpn5fpFNK5rrQClK
	9jQCnzrHEfluOLPkGJVRUelMl5pFEgMMvqNtzRzDvwBzBIJC/9dTn4f7S8yZ/xvexzvpeq
	eYw1oa8axJAiAW75DS6x3z+wCvITWek=
Message-ID: <a937b261-d42d-888f-7460-ed431b725c45@suse.com>
Date: Thu, 27 Jul 2023 09:55:12 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v3 2/2] tools/xenstore: fix get_spec_node()
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Wei Liu <wl@xen.org>, Julien Grall <julien@xen.org>,
 Anthony PERARD <anthony.perard@citrix.com>, Julien Grall
 <jgrall@amazon.com>, xen-devel@lists.xenproject.org
References: <20230724103324.4207-1-jgross@suse.com>
 <20230724103324.4207-3-jgross@suse.com>
 <5aaf37aa-cb7d-59e5-5e0b-40fa73177d35@suse.com>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <5aaf37aa-cb7d-59e5-5e0b-40fa73177d35@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------xaZYuYAlUASuSDyk0nEJL35Z"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------xaZYuYAlUASuSDyk0nEJL35Z
Content-Type: multipart/mixed; boundary="------------CsAqVwrx3QLtGr21yAOgKlHP";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Wei Liu <wl@xen.org>, Julien Grall <julien@xen.org>,
 Anthony PERARD <anthony.perard@citrix.com>, Julien Grall
 <jgrall@amazon.com>, xen-devel@lists.xenproject.org
Message-ID: <a937b261-d42d-888f-7460-ed431b725c45@suse.com>
Subject: Re: [PATCH v3 2/2] tools/xenstore: fix get_spec_node()
References: <20230724103324.4207-1-jgross@suse.com>
 <20230724103324.4207-3-jgross@suse.com>
 <5aaf37aa-cb7d-59e5-5e0b-40fa73177d35@suse.com>
In-Reply-To: <5aaf37aa-cb7d-59e5-5e0b-40fa73177d35@suse.com>

--------------CsAqVwrx3QLtGr21yAOgKlHP
Content-Type: multipart/mixed; boundary="------------mujG7OEgZL2dpWTCO050Z2fL"

--------------mujG7OEgZL2dpWTCO050Z2fL
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjcuMDcuMjMgMDk6NTMsIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAyNC4wNy4yMDIz
IDEyOjMzLCBKdWVyZ2VuIEdyb3NzIHdyb3RlOg0KPj4gSW4gY2FzZSBnZXRfc3BlY19ub2Rl
KCkgaXMgYmVpbmcgY2FsbGVkIGZvciBhIHNwZWNpYWwgbm9kZSBzdGFydGluZw0KPj4gd2l0
aCAnQCcgaXQgd29uJ3Qgc2V0ICpjYW5vbmljYWxfbmFtZS4gVGhpcyBjYW4gcmVzdWx0IGlu
IGEgY3Jhc2ggb2YNCj4+IHhlbnN0b3JlZCBkdWUgdG8gZGVyZWZlcmVuY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xhbi4NCg0KDQpKdWVyZ2VuDQo=
--------------mujG7OEgZL2dpWTCO050Z2fL
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5RnNVUJbvoPHZ8SlM4KWm8rG+lIkGurq
qu5gu8q8ZMKdsdGC4bBxdQKDKHEFExLJK/nRPFmAuGlId1E3fe10v5QL+qHI3EIP
tyfE7i9Hz6rVwi7lWKgh7pe0ZvatAudZ+JNIlBKptb64FaiIOAWDCx1SzR9KdWVy
Z2VuIEd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G86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------mujG7OEgZL2dpWTCO050Z2fL--

--------------CsAqVwrx3QLtGr21yAOgKlHP--

--------------xaZYuYAlUASuSDyk0nEJL35Z
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmTCIuAFAwAAAAAACgkQsN6d1ii/Ey8O
gwgAiKLmHWzA9ZT2zgnNECyUlBmNInIvV1P7AMgZpQh/JxE7bHwTdqxOMSUc2oakz+VOGyMRM39k
jvxTKWy3N3fVX8zr8pw7e3XDEKUNe96WPK4HTHoRXZHeBGVFB5kqzDbNFkmb8AqpUPV1o6fibnL7
QHVWjnnT9fCTQg6+dVS5dn7gVi1oGrRwO6faQ4y2rKmu3lDLRR4L8HUQ0tdLU1+EpDbYh2uUIXLJ
9A6GyNcrHsjlIBu94XxhXCfHwb3QwU8UYYkEvVRC+EiVpU+hSq9I/W4BW5vtMg+x7xjZHlVOG7O+
KpppaFfLHE4cutvK6QR6Jk+/WzdYOIOpeE482tgkaA==
=kGzW
-----END PGP SIGNATURE-----

--------------xaZYuYAlUASuSDyk0nEJL35Z--


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 07:56:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 07:56:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570823.893049 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvr6-0006o7-GM; Thu, 27 Jul 2023 07:56:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570823.893049; Thu, 27 Jul 2023 07:56:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOvr6-0006o0-DQ; Thu, 27 Jul 2023 07:56:16 +0000
Received: by outflank-mailman (input) for mailman id 570823;
 Thu, 27 Jul 2023 07:56:15 +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 <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOvr5-0006nq-2A
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 07:56:15 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20623.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::623])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0e47169c-2c53-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 09:56:13 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB7798.eurprd04.prod.outlook.com (2603:10a6:20b:2a3::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 07:56:10 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 07:56:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0e47169c-2c53-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Dzg0D3pOwl0i/eYnwRJNXWuCFrv1CFsj5lwwrLYe8TtrcWmb2+jNVbKagjKVYRh21QBFhNK2JxDiMu6OmqsaD5U7Cx1F2XjLqvlUTX0hlP220Mu5rfJtgwlHQXrfbskmuRCYQIwWWfwReWdAjXYnlVd+2WbPNtfC3gnJMxmbhiopOB7aegaDS5ZCwt5yAXvvh1sQgmVm+MRvzKQOR/QvZ8zeupjNYGk+q0/juW0G4xJgE+qGFqQdghHTv3ty1EzDHJYSAlKrW1aWH2SkPqK17j9M3n7PB8IguYO2H2TcuvRaf/neqzDG/syJPxGgVITa9HA35/VR2B7SOAOZPoWhNw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=x6uRZHeEOxuz1S/2fBVUYkIpbMNhp6erjcMWGv5MTBU=;
 b=BgUpFzLtDCrBdoGzQDkTVds1GQco2c9PJCj3bxGpVKSsf+khs8LB0EeL31U3wBOzC5+VCQMXZhJj0Q+3Ays49G2u7KAgBICRijQuR8JGtZmQcglO819OokIxgfk8vy5JumSmpn+lUVOdPBGDY2cjsz2gVm7pgKtZjejstQucE0QzrRzm7jJAE5sE+z8Za4mbdTFvarHi2yicLNN8Fk4pnaBURcoav2jG9vFg6OTKiRp7CUoH1ndu8BkM0FmoEQ5eJty9lGTNS97urKU2qdNxpf2klk6E9aRMod38sCpFG4r4w84ewonkz/0HfVaNq5M5/vEDoYHj592tlQ1EJt7JCQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=x6uRZHeEOxuz1S/2fBVUYkIpbMNhp6erjcMWGv5MTBU=;
 b=vyzsu9byD/zSRH5pqIW/g+XdgzHDGXD+IrTfHM6yIRjFlb4kN35cdND87xGQtsCAhkFPLRa5Qxiet7++DON6GckJWIjb16YR8VLTPYb6z9iEf7aM2waiuSjNZJs9uLySjtfN3SV09Ke3i9Rf23XXFIKyQfSUdNVMTNIN21enQeg48ZFfly6ZW/UBPM/6XP5UCL/+MKtZ875y/sQo0SBdSFp7ohSbFlSvpnSxIZ2NP52o6XPW0DZm+0F6m82mZo0l+MVGy+8JVLJah2j6oIgpREtnKUtR/+KheFdT1FbisKHCDAOexFBnOBnh3K28PSkR2brAkxqGLmR//Ktzd7OrmQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <a277dacd-56f6-a5ab-6982-b5cc4f9d507c@suse.com>
Date: Thu, 27 Jul 2023 09:56:08 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2] vpci: add permission checks to map_range()
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>
References: <20230726140132.80151-1-roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230726140132.80151-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0064.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:93::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB7798:EE_
X-MS-Office365-Filtering-Correlation-Id: 2c1860ec-aaac-45d3-3b92-08db8e76f125
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	w2fd2j+9rpCoZ+boX4DYpzyn2DSCi3O0bBUZkLxmE5kWc3F5tfaAZwLgprZRkTxAInCHpQpcBDezjDsQEpxgI0UHyJOUUrQj4EPzhK2LadJds+hsSCktZ/ZLyghPFxvqhqXk3WYBwp59qQlYYgRo70LzsLF4659c4crhSnbspBChjbkUG71yKR0l57w4RY6zZ9vrFVLLGQ1NwPZYGOLm+AWG4GQ7+1unrV+Gyjzo1Nb2YPKZEPWpG3dv9Y/7sSUlessR3/lqNCTAeoV7eLnmOxtsD9tXURpz8flqMCKe+zpN3kPoMIp61LyktkoR/vFzwR+1gaCF+ve0EVCG+AXknMmhcIU8+N7PhDuZMgwnGQp3Fzf9aDKdcXgI/ca+38HuFZmPtVOO0q41FCM5QDWNKvs6UZwlvlvsMYHFRFEbi64FvNNNI5WFTYbGzW/+vkJ9Q3CTKhduMowOq1u7Oja4qUZIN3ExbkIDF7vvHzqZHOCKr6uARafQmbyUDyZYX/T2uvNLT9Aqh3MC5FMyEeCh1z111ArRF5vPYPSF5IVlF8JoCLtQyMFcBMv/pUaoNPz0nM871DtkGHoDnrHH7igo6/0/EnmWUjovUl0Bn0fUSHarblfLr4ZxorxtG24IZppF8hqVCLrOstarCQk1WSAiZQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(396003)(366004)(136003)(346002)(451199021)(54906003)(6512007)(478600001)(6486002)(66476007)(26005)(53546011)(186003)(6506007)(2616005)(2906002)(4744005)(66556008)(316002)(4326008)(5660300002)(8936002)(41300700001)(8676002)(6916009)(66946007)(38100700002)(86362001)(31696002)(36756003)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?c0syNEdjbGo1V0hwMk5jM2RIbXpjV1BtTXVGaU1rek5wSXJ6S2lwaWpTN1dZ?=
 =?utf-8?B?VXVYZmVzT2p4WmZsbUhYZHFNYVV2enBVNExFMlZoNTdQSUFOdU1QalRDZjJQ?=
 =?utf-8?B?a0RXRm5xZG5uQ0YxcmZGZW81VjlRMFMxc2p4R2RON3VNSWFDa0JNZ25WZDJ0?=
 =?utf-8?B?dTgvazZJQ3FBazFWajcrN3NGYmRnelpGT1o2OUhpMnhuVGcyMFB2OFFpWVM0?=
 =?utf-8?B?VTBabjR3QWlsZks1TUtJOFZEQkdtQWZOSGU5bDR0ZjVQZ0dEeEY1QUZqSnJt?=
 =?utf-8?B?YWtFL1NKWmtFMTFEV3d4S08rVmVqSHUrK2JXZWVidlNBVGhpRXdESEFXQjRB?=
 =?utf-8?B?YU83UlpxOWZZb0xOamtNQVdyd2JBeWFndngxNlhqMWxISUIrSmRjU1R2eDZv?=
 =?utf-8?B?a0dyN2F6aWtMemFFMElqWG1RUnJYcHZHNDVUdkp3b0pibVlGN1MzcWgwcUFp?=
 =?utf-8?B?ZWdJRGR0NW40UGh4aUxqdHovQ2RTVnV0NS9LNFhVNEVXc1NtKy9QLzFpWjRK?=
 =?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ITmlma1BkQkJJTFNDZ1E4YnJPbitZRDhjODA4REFxZTN0?=
 =?utf-8?B?ZkE2emlQdVVkYVRHVVluQkhLaS9hMk91Z1hWanl2clc1YkFxQnNzWTJqQ0VG?=
 =?utf-8?B?ekcyRDV3cFV2RFFLNnYxU2MraHpRbmJENDFsR1BvYUhMQy8wZkxVU2hRL2dL?=
 =?utf-8?B?TkU3TG15RHdLZHdJYTNpVWFFVzhsUTBmRHFNeCsyTGhiM2VETGtxay9KdjFH?=
 =?utf-8?B?R0VGYk9OdVd0TzRGSXBIYytid3YyYW5TcjcwTUhiVDJELzh3RmUzb3lRTW9n?=
 =?utf-8?B?MDNORmZxK3ZXRVVKbkZEbjhEOURYekFENXNCNERzbEhURzMrQ1ZMZ1Fkanpw?=
 =?utf-8?B?SUxEVEcxczQzOGh4VXNPdjBmNnBGUHFBbXFiOE5pd3ZVaWwwYnBnZTdieTFK?=
 =?utf-8?B?TlA4dlpqQytiS214MWIwN3ZtL0NRS011djdvZXloQ2xHL0kyak1DSnUrY1NY?=
 =?utf-8?B?a3hEaFRWR3NNOTlKZEpYeGU3a3R6SHA2MTg5MVlzNmVKZUFnelNkRERCb01E?=
 =?utf-8?B?UUVoVzJ4cGVJLzlhdzNXb3RUS2E4TW5wekZ5MlZONndMYXd0dkFVaFZJSi9K?=
 =?utf-8?B?cFordlJoQUpJb1d1NnpFUjFWUTBDQnFhS1FhK0EyTGQ1YWVNRmFPalhQK2cy?=
 =?utf-8?B?ZGN1MTZ3RFU0b3R2NjZlSnl0ck5Xb0V5VEwrY3VYZ3hYdkdFdmhoUUgyQ0Nm?=
 =?utf-8?Q?IS5HCk2wlr28te3rHhtg5hp60?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2c1860ec-aaac-45d3-3b92-08db8e76f125
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 07:56:10.7319
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: L0WobuZOlkPRM+sQsXuxU//GlHQyrVu363Dou3fOrBLQW4K2Bkb9v+7lRghSeOuzA4dMxDlBz8Wln2UDqlOX1A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7798

On 26.07.2023 16:01, Roger Pau Monne wrote:
> Just like it's done for the XEN_DOMCTL_memory_mapping hypercall, add
> the permissions checks to vPCI map_range(), which is used to map the
> BARs into the domain p2m.
> 
> Adding those checks requires that for x86 PVH hardware domain builder
> the permissions are set before initializing the IOMMU, or else
> attempts to initialize vPCI done as part of IOMMU device setup will
> fail due to missing permissions to create the BAR mappings.
> 
> While moving the call to dom0_setup_permissions() convert the panic()
> used for error handling to a printk, the caller will already panic if
> required.
> 
> Fixes: 9c244fdef7e7 ('vpci: add header handlers')
> Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

I've committed this, but despite the Fixes: tag I'm not sure this
wants backporting. Thoughts?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:06:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:06:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570832.893069 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw0a-0000l8-84; Thu, 27 Jul 2023 08:06:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570832.893069; Thu, 27 Jul 2023 08:06:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw0a-0000l1-5H; Thu, 27 Jul 2023 08:06:04 +0000
Received: by outflank-mailman (input) for mailman id 570832;
 Thu, 27 Jul 2023 08:06:03 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw0Z-0000Tn-Ez
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:06:03 +0000
Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com
 [2607:f8b0:4864:20::42b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6c81eda0-2c54-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:06:01 +0200 (CEST)
Received: by mail-pf1-x42b.google.com with SMTP id
 d2e1a72fcca58-686f6231bdeso112239b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:06:01 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.05.48
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:05:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6c81eda0-2c54-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445160; x=1691049960;
        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=CmSKD1W4o1llBpukOwDAPdWOg+LYzWoL67ya0UPwqvg=;
        b=bWsdCjXI/QTCbfrXnl1D1RHs1UzV532bO1xy0F2QKWdmxdeZNg1bc8fwYppoEa2Sii
         fv3Dw05OLiEoJFGdDqA0cK2BR0yissZW0QGh0p8G2jYOCo1VM3qmhhRKOuDu3Ld44+HC
         IlU/6E6PL7OGmulpkRgvQIFGvR7K7vSKmFATJlzNsM5VU0kfb+Q9ux9XLDln9HSGLjNa
         erFo50JbYYva+gdlhuASAFmcGCxJk1UklUElA3OcQq/NsulVXFSALP8x8A3jEL8k5O2s
         pAuqLDXkBW250K5e8xHlcez81V5k+DmAOms7sfdEUrryxL8JhS9LUOK5EJtF0pDaEYI9
         8JWQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445160; x=1691049960;
        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=CmSKD1W4o1llBpukOwDAPdWOg+LYzWoL67ya0UPwqvg=;
        b=gqNPJuMfSGEqI/zGCh9TK4NygELo+WN1S2ddpaqfW7o8uLNQMDz97l1w7xlMjH5lk3
         E7o1nkQibmvRGYNJfovQjUPDKRINaK8wpBLZuujiEgIozjEQbn+47djs+HAXXX9T7tgT
         IWadpqNpt8hpl+1IQERzKHXblf2JNkYlTjDlROuGPr7OiJ1GmaRNNVUt/Uw0gelP3ieP
         hV0cQzoOmZiiUkfE86kilCjjgykl2OXf/rcQVgd3RpbJ0fS2sj73VtrurngZTW7pnP2S
         6wFqz7ewWFnS6kYiKCq6U9y/7vHs+82clqsD8QbDRPIj6t9giJK8U5ySu9Fg4kvFn89Q
         2vWg==
X-Gm-Message-State: ABy/qLaTq6f8uJ1QNHwbhsPsbxYTLmO356nLm396nvLDXq9TatIS551i
	yY/1VLvY6SJCc5fkaWn7oF1ONg==
X-Google-Smtp-Source: APBJJlGsBl3klUilUFzaktHEHOMbkNlcOB/1K8g6HjcIbYlgfdxi92AgDTolw1HjCRkDLU6/tzA6hQ==
X-Received: by 2002:a05:6a21:78a8:b0:137:3eba:b81f with SMTP id bf40-20020a056a2178a800b001373ebab81fmr6002609pzc.3.1690445159927;
        Thu, 27 Jul 2023 01:05:59 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Carlos Llamas <cmllamas@google.com>
Subject: [PATCH v3 01/49] binder: fix memory leak in binder_init()
Date: Thu, 27 Jul 2023 16:04:14 +0800
Message-Id: <20230727080502.77895-2-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In binder_init(), the destruction of binder_alloc_shrinker_init() is not
performed in the wrong path, which will cause memory leaks. So this commit
introduces binder_alloc_shrinker_exit() and calls it in the wrong path to
fix that.

Fixes: f2517eb76f1f ("android: binder: Add global lru shrinker to binder")
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Acked-by: Carlos Llamas <cmllamas@google.com>
---
 drivers/android/binder.c       | 1 +
 drivers/android/binder_alloc.c | 6 ++++++
 drivers/android/binder_alloc.h | 1 +
 3 files changed, 8 insertions(+)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 486c8271cab7..d720f93d8b19 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -6617,6 +6617,7 @@ static int __init binder_init(void)
 
 err_alloc_device_names_failed:
 	debugfs_remove_recursive(binder_debugfs_dir_entry_root);
+	binder_alloc_shrinker_exit();
 
 	return ret;
 }
diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
index 662a2a2e2e84..e3db8297095a 100644
--- a/drivers/android/binder_alloc.c
+++ b/drivers/android/binder_alloc.c
@@ -1087,6 +1087,12 @@ int binder_alloc_shrinker_init(void)
 	return ret;
 }
 
+void binder_alloc_shrinker_exit(void)
+{
+	unregister_shrinker(&binder_shrinker);
+	list_lru_destroy(&binder_alloc_lru);
+}
+
 /**
  * check_buffer() - verify that buffer/offset is safe to access
  * @alloc: binder_alloc for this proc
diff --git a/drivers/android/binder_alloc.h b/drivers/android/binder_alloc.h
index 138d1d5af9ce..dc1e2b01dd64 100644
--- a/drivers/android/binder_alloc.h
+++ b/drivers/android/binder_alloc.h
@@ -129,6 +129,7 @@ extern struct binder_buffer *binder_alloc_new_buf(struct binder_alloc *alloc,
 						  int pid);
 extern void binder_alloc_init(struct binder_alloc *alloc);
 extern int binder_alloc_shrinker_init(void);
+extern void binder_alloc_shrinker_exit(void);
 extern void binder_alloc_vma_close(struct binder_alloc *alloc);
 extern struct binder_buffer *
 binder_alloc_prepare_to_free(struct binder_alloc *alloc,
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:06:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:06:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570831.893059 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw0S-0000U0-T2; Thu, 27 Jul 2023 08:05:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570831.893059; Thu, 27 Jul 2023 08:05:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw0S-0000Tt-Pb; Thu, 27 Jul 2023 08:05:56 +0000
Received: by outflank-mailman (input) for mailman id 570831;
 Thu, 27 Jul 2023 08:05:55 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw0Q-0000Tn-JN
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:05:55 +0000
Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com
 [2607:f8b0:4864:20::42c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 655128e2-2c54-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:05:49 +0200 (CEST)
Received: by mail-pf1-x42c.google.com with SMTP id
 d2e1a72fcca58-686f74a8992so77094b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:05:49 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.05.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:05:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 655128e2-2c54-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445148; x=1691049948;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=qdw/R1TEr1q6uUENoD+Woah5iYuWx4u9kScfP8x1rxA=;
        b=UUJaeFKAdq/JSi5KDicB1qh4QBmRcV8RkxHtwurNfyrC9pvt0PpJjH65AQH5l7q+9C
         LBSbbXBKaKVPiOBm5Fcd7UwqnCv/nEH/yt0y5LrhuYjiTeYJnf52fAGE42aPOuO3ed4I
         CH7E03GStk9tqzsUMP9cj27lKTUxq4yf7rn8YSn3a1/cGCpMeTGgVRRuuMbsr0zMmRBv
         oFevVOT5MMhRX1z1WtEnmwtuG+UoVxDf5GDWIQJoDIkeB0n3AbOwh1FoMsy9IWleLQsE
         a2RKQ5yrgmmGdYoGmSpmONZKAmN9Gsyqp+HtxmVjQ9FehgBv4a+hpgIRjC2ZmCuobuW+
         eCOw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445148; x=1691049948;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=qdw/R1TEr1q6uUENoD+Woah5iYuWx4u9kScfP8x1rxA=;
        b=dybMxsafcB/1ttbEZRyOzOK/8hb2vv9DKf4j5WcQyEFm8sQVjLTSdsExtTJEO/DmXM
         U2vOoWEx/dn9qk+qcF02kGPKJvy1k9tH9rHVg1ljTRrawUqA+fVvYbU+M3X2e48RQqfK
         2ABRQTGEJr7F0T4Q85ugiKZ02zFrGggQubwkxuLALykzAbXD3lr7XBt+Kn7jvGIGPn42
         cpY+zyYX+keHu240ME/7DYY2gXI/DA67KQFWT5vohKPkeGGi+LpcwHOIT8Fk7/t1sFq0
         sLsKbH2IfKj4J7NQ7gTaYzQgBH4GXkIZ4xbbMMRc+g5CGVoKRZd9Ssj58RLlkPIOA7SL
         EoFw==
X-Gm-Message-State: ABy/qLY+mIFgHPfbuXlnSibiF/PYsOQ82FVoBzFFHnlXKo9my8VZd1+P
	erjG6NFl2eySZhnvZ6I2lLuStg==
X-Google-Smtp-Source: APBJJlHb1kgnpQXfb8RS/UAhh8zGcgdqY4J3wYE+oXj/zAg8rYeLxmGzIhYoi+ua72NIH6S8sFTnXQ==
X-Received: by 2002:a05:6a20:1595:b0:137:30db:bc1e with SMTP id h21-20020a056a20159500b0013730dbbc1emr5685837pzj.3.1690445147652;
        Thu, 27 Jul 2023 01:05:47 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v3 00/49] use refcount+RCU method to implement lockless slab shrink
Date: Thu, 27 Jul 2023 16:04:13 +0800
Message-Id: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Hi all,

1. Background
=============

We used to implement the lockless slab shrink with SRCU [1], but then kernel
test robot reported -88.8% regression in stress-ng.ramfs.ops_per_sec test
case [2], so we reverted it [3].

This patch series aims to re-implement the lockless slab shrink using the
refcount+RCU method proposed by Dave Chinner [4].

[1]. https://lore.kernel.org/lkml/20230313112819.38938-1-zhengqi.arch@bytedance.com/
[2]. https://lore.kernel.org/lkml/202305230837.db2c233f-yujie.liu@intel.com/
[3]. https://lore.kernel.org/all/20230609081518.3039120-1-qi.zheng@linux.dev/
[4]. https://lore.kernel.org/lkml/ZIJhou1d55d4H1s0@dread.disaster.area/

2. Implementation
=================

Currently, the shrinker instances can be divided into the following three types:

a) global shrinker instance statically defined in the kernel, such as
   workingset_shadow_shrinker.

b) global shrinker instance statically defined in the kernel modules, such as
   mmu_shrinker in x86.

c) shrinker instance embedded in other structures.

For case a, the memory of shrinker instance is never freed. For case b, the
memory of shrinker instance will be freed after synchronize_rcu() when the
module is unloaded. For case c, the memory of shrinker instance will be freed
along with the structure it is embedded in.

In preparation for implementing lockless slab shrink, we need to dynamically
allocate those shrinker instances in case c, then the memory can be dynamically
freed alone by calling kfree_rcu().

This patchset adds the following new APIs for dynamically allocating shrinker,
and add a private_data field to struct shrinker to record and get the original
embedded structure.

1. shrinker_alloc()
2. shrinker_register()
3. shrinker_free()

In order to simplify shrinker-related APIs and make shrinker more independent of
other kernel mechanisms, this patchset uses the above APIs to convert all
shrinkers (including case a and b) to dynamically allocated, and then remove all
existing APIs. This will also have another advantage mentioned by Dave Chinner:

```
The other advantage of this is that it will break all the existing out of tree
code and third party modules using the old API and will no longer work with a
kernel using lockless slab shrinkers. They need to break (both at the source and
binary levels) to stop bad things from happening due to using uncoverted
shrinkers in the new setup.
```

Then we free the shrinker by calling call_rcu(), and use rcu_read_{lock,unlock}()
to ensure that the shrinker instance is valid. And the shrinker::refcount
mechanism ensures that the shrinker instance will not be run again after
unregistration. So the structure that records the pointer of shrinker instance
can be safely freed without waiting for the RCU read-side critical section.

In this way, while we implement the lockless slab shrink, we don't need to be
blocked in unregister_shrinker() to wait RCU read-side critical section.

PATCH 1: fix memory leak in binder_init()
PATCH 2: move some shrinker-related function declarations to mm/internal.h
PATCH 3: move shrinker-related code into a separate file
PATCH 4: remove redundant shrinker_rwsem in debugfs operations
PATCH 5: add infrastructure for dynamically allocating shrinker
PATCH 6 ~ 23: dynamically allocate the shrinker instances in case a and b
PATCH 24 ~ 42: dynamically allocate the shrinker instances in case c
PATCH 43: remove old APIs
PATCH 44: introduce pool_shrink_rwsem to implement private synchronize_shrinkers()
PATCH 45: add a secondary array for shrinker_info::{map, nr_deferred}
PATCH 46 ~ 47: implement the lockless slab shrink
PATCH 48 ~ 49: convert shrinker_rwsem to mutex

3. Testing
==========

3.1 slab shrink stress test
---------------------------

We can reproduce the down_read_trylock() hotspot through the following script:

```

DIR="/root/shrinker/memcg/mnt"

do_create()
{
    mkdir -p /sys/fs/cgroup/memory/test
    echo 4G > /sys/fs/cgroup/memory/test/memory.limit_in_bytes
    for i in `seq 0 $1`;
    do
        mkdir -p /sys/fs/cgroup/memory/test/$i;
        echo $$ > /sys/fs/cgroup/memory/test/$i/cgroup.procs;
        mkdir -p $DIR/$i;
    done
}

do_mount()
{
    for i in `seq $1 $2`;
    do
        mount -t tmpfs $i $DIR/$i;
    done
}

do_touch()
{
    for i in `seq $1 $2`;
    do
        echo $$ > /sys/fs/cgroup/memory/test/$i/cgroup.procs;
        dd if=/dev/zero of=$DIR/$i/file$i bs=1M count=1 &
    done
}

case "$1" in
  touch)
    do_touch $2 $3
    ;;
  test)
    do_create 4000
    do_mount 0 4000
    do_touch 0 3000
    ;;
  *)
    exit 1
    ;;
esac
```

Save the above script, then run test and touch commands. Then we can use the
following perf command to view hotspots:

perf top -U -F 999

1) Before applying this patchset:

  40.44%  [kernel]            [k] down_read_trylock
  17.59%  [kernel]            [k] up_read
  13.64%  [kernel]            [k] pv_native_safe_halt
  11.90%  [kernel]            [k] shrink_slab
   8.21%  [kernel]            [k] idr_find
   2.71%  [kernel]            [k] _find_next_bit
   1.36%  [kernel]            [k] shrink_node
   0.81%  [kernel]            [k] shrink_lruvec
   0.80%  [kernel]            [k] __radix_tree_lookup
   0.50%  [kernel]            [k] do_shrink_slab
   0.21%  [kernel]            [k] list_lru_count_one
   0.16%  [kernel]            [k] mem_cgroup_iter

2) After applying this patchset:

  60.17%  [kernel]           [k] shrink_slab
  20.42%  [kernel]           [k] pv_native_safe_halt
   3.03%  [kernel]           [k] do_shrink_slab
   2.73%  [kernel]           [k] shrink_node
   2.27%  [kernel]           [k] shrink_lruvec
   2.00%  [kernel]           [k] __rcu_read_unlock
   1.92%  [kernel]           [k] mem_cgroup_iter
   0.98%  [kernel]           [k] __rcu_read_lock
   0.91%  [kernel]           [k] osq_lock
   0.63%  [kernel]           [k] mem_cgroup_calculate_protection
   0.55%  [kernel]           [k] shrinker_put
   0.46%  [kernel]           [k] list_lru_count_one

We can see that the first perf hotspot becomes shrink_slab, which is what we
expect.

3.2 registeration and unregisteration stress test
-------------------------------------------------

Run the command below to test:

stress-ng --timeout 60 --times --verify --metrics-brief --ramfs 9 &

1) Before applying this patchset:

setting to a 60 second run per stressor
dispatching hogs: 9 ramfs
stressor       bogo ops real time  usr time  sys time   bogo ops/s     bogo ops/s
                          (secs)    (secs)    (secs)   (real time) (usr+sys time)
ramfs            735238     60.00     12.37    363.70     12253.05        1955.08
for a 60.01s run time:
   1440.27s available CPU time
     12.36s user time   (  0.86%)
    363.70s system time ( 25.25%)
    376.06s total time  ( 26.11%)
load average: 10.79 4.47 1.69
passed: 9: ramfs (9)
failed: 0
skipped: 0
successful run completed in 60.01s (1 min, 0.01 secs)

2) After applying this patchset:

setting to a 60 second run per stressor
dispatching hogs: 9 ramfs
stressor       bogo ops real time  usr time  sys time   bogo ops/s     bogo ops/s
                          (secs)    (secs)    (secs)   (real time) (usr+sys time)
ramfs            746698     60.00     12.45    376.16     12444.02        1921.47
for a 60.01s run time:
   1440.28s available CPU time
     12.44s user time   (  0.86%)
    376.16s system time ( 26.12%)
    388.60s total time  ( 26.98%)
load average: 9.01 3.85 1.49
passed: 9: ramfs (9)
failed: 0
skipped: 0
successful run completed in 60.01s (1 min, 0.01 secs)

We can see that the ops/s has hardly changed.

This series is based on next-20230726.

Comments and suggestions are welcome.

Thanks,
Qi

Changelog in v2 -> v3:
 - add the patch that [PATCH v3 07/49] depends on
 - move some shrinker-related function declarations to mm/internal.h
   (suggested by Muchun Song)
 - combine shrinker_free_non_registered() and shrinker_unregister() into
   shrinker_free() (suggested by Dave Chinner)
 - add missing __init and fix return value in bch_btree_cache_alloc()
   (pointed by Muchun Song)
 - remove unnecessary WARN_ON() (pointed by Steven Price)
 - go back to use completion to implement lockless slab shrink
   (pointed by Dave Chinner)
 - collect Acked-bys and Reviewed-bys
 - rebase onto the next-20230726.

Changelog in v1 -> v2:
 - implement the new APIs and convert all shrinkers to use it.
   (suggested by Dave Chinner)
 - fix UAF in PATCH [05/29] (pointed by Steven Price)
 - add a secondary array for shrinker_info::{map, nr_deferred}
 - re-implement the lockless slab shrink
   (Since unifying the processing of global and memcg slab shrink needs to
    modify the startup sequence (As I mentioned in https://lore.kernel.org/lkml/38b14080-4ce5-d300-8a0a-c630bca6806b@bytedance.com/),
    I finally choose to process them separately.)
 - collect Acked-bys

Qi Zheng (49):
  binder: fix memory leak in binder_init()
  mm: move some shrinker-related function declarations to mm/internal.h
  mm: vmscan: move shrinker-related code into a separate file
  mm: shrinker: remove redundant shrinker_rwsem in debugfs operations
  mm: shrinker: add infrastructure for dynamically allocating shrinker
  kvm: mmu: dynamically allocate the x86-mmu shrinker
  binder: dynamically allocate the android-binder shrinker
  drm/ttm: dynamically allocate the drm-ttm_pool shrinker
  xenbus/backend: dynamically allocate the xen-backend shrinker
  erofs: dynamically allocate the erofs-shrinker
  f2fs: dynamically allocate the f2fs-shrinker
  gfs2: dynamically allocate the gfs2-glock shrinker
  gfs2: dynamically allocate the gfs2-qd shrinker
  NFSv4.2: dynamically allocate the nfs-xattr shrinkers
  nfs: dynamically allocate the nfs-acl shrinker
  nfsd: dynamically allocate the nfsd-filecache shrinker
  quota: dynamically allocate the dquota-cache shrinker
  ubifs: dynamically allocate the ubifs-slab shrinker
  rcu: dynamically allocate the rcu-lazy shrinker
  rcu: dynamically allocate the rcu-kfree shrinker
  mm: thp: dynamically allocate the thp-related shrinkers
  sunrpc: dynamically allocate the sunrpc_cred shrinker
  mm: workingset: dynamically allocate the mm-shadow shrinker
  drm/i915: dynamically allocate the i915_gem_mm shrinker
  drm/msm: dynamically allocate the drm-msm_gem shrinker
  drm/panfrost: dynamically allocate the drm-panfrost shrinker
  dm: dynamically allocate the dm-bufio shrinker
  dm zoned: dynamically allocate the dm-zoned-meta shrinker
  md/raid5: dynamically allocate the md-raid5 shrinker
  bcache: dynamically allocate the md-bcache shrinker
  vmw_balloon: dynamically allocate the vmw-balloon shrinker
  virtio_balloon: dynamically allocate the virtio-balloon shrinker
  mbcache: dynamically allocate the mbcache shrinker
  ext4: dynamically allocate the ext4-es shrinker
  jbd2,ext4: dynamically allocate the jbd2-journal shrinker
  nfsd: dynamically allocate the nfsd-client shrinker
  nfsd: dynamically allocate the nfsd-reply shrinker
  xfs: dynamically allocate the xfs-buf shrinker
  xfs: dynamically allocate the xfs-inodegc shrinker
  xfs: dynamically allocate the xfs-qm shrinker
  zsmalloc: dynamically allocate the mm-zspool shrinker
  fs: super: dynamically allocate the s_shrink
  mm: shrinker: remove old APIs
  drm/ttm: introduce pool_shrink_rwsem
  mm: shrinker: add a secondary array for shrinker_info::{map,
    nr_deferred}
  mm: shrinker: make global slab shrink lockless
  mm: shrinker: make memcg slab shrink lockless
  mm: shrinker: hold write lock to reparent shrinker nr_deferred
  mm: shrinker: convert shrinker_rwsem to mutex

 arch/x86/kvm/mmu/mmu.c                        |  18 +-
 drivers/android/binder.c                      |   1 +
 drivers/android/binder_alloc.c                |  35 +-
 drivers/android/binder_alloc.h                |   1 +
 drivers/gpu/drm/i915/gem/i915_gem_shrinker.c  |  30 +-
 drivers/gpu/drm/i915/i915_drv.h               |   2 +-
 drivers/gpu/drm/msm/msm_drv.c                 |   4 +-
 drivers/gpu/drm/msm/msm_drv.h                 |   4 +-
 drivers/gpu/drm/msm/msm_gem_shrinker.c        |  34 +-
 drivers/gpu/drm/panfrost/panfrost_device.h    |   2 +-
 drivers/gpu/drm/panfrost/panfrost_drv.c       |   6 +-
 drivers/gpu/drm/panfrost/panfrost_gem.h       |   2 +-
 .../gpu/drm/panfrost/panfrost_gem_shrinker.c  |  30 +-
 drivers/gpu/drm/ttm/ttm_pool.c                |  38 +-
 drivers/md/bcache/bcache.h                    |   2 +-
 drivers/md/bcache/btree.c                     |  27 +-
 drivers/md/bcache/sysfs.c                     |   3 +-
 drivers/md/dm-bufio.c                         |  26 +-
 drivers/md/dm-cache-metadata.c                |   2 +-
 drivers/md/dm-zoned-metadata.c                |  28 +-
 drivers/md/raid5.c                            |  25 +-
 drivers/md/raid5.h                            |   2 +-
 drivers/misc/vmw_balloon.c                    |  38 +-
 drivers/virtio/virtio_balloon.c               |  25 +-
 drivers/xen/xenbus/xenbus_probe_backend.c     |  18 +-
 fs/btrfs/super.c                              |   2 +-
 fs/erofs/utils.c                              |  20 +-
 fs/ext4/ext4.h                                |   2 +-
 fs/ext4/extents_status.c                      |  22 +-
 fs/f2fs/super.c                               |  32 +-
 fs/gfs2/glock.c                               |  20 +-
 fs/gfs2/main.c                                |   6 +-
 fs/gfs2/quota.c                               |  26 +-
 fs/gfs2/quota.h                               |   3 +-
 fs/jbd2/journal.c                             |  27 +-
 fs/kernfs/mount.c                             |   2 +-
 fs/mbcache.c                                  |  23 +-
 fs/nfs/nfs42xattr.c                           |  87 +-
 fs/nfs/super.c                                |  20 +-
 fs/nfsd/filecache.c                           |  22 +-
 fs/nfsd/netns.h                               |   4 +-
 fs/nfsd/nfs4state.c                           |  20 +-
 fs/nfsd/nfscache.c                            |  31 +-
 fs/proc/root.c                                |   2 +-
 fs/quota/dquot.c                              |  18 +-
 fs/super.c                                    |  38 +-
 fs/ubifs/super.c                              |  22 +-
 fs/xfs/xfs_buf.c                              |  25 +-
 fs/xfs/xfs_buf.h                              |   2 +-
 fs/xfs/xfs_icache.c                           |  26 +-
 fs/xfs/xfs_mount.c                            |   4 +-
 fs/xfs/xfs_mount.h                            |   2 +-
 fs/xfs/xfs_qm.c                               |  26 +-
 fs/xfs/xfs_qm.h                               |   2 +-
 include/linux/fs.h                            |   2 +-
 include/linux/jbd2.h                          |   2 +-
 include/linux/memcontrol.h                    |  12 +-
 include/linux/shrinker.h                      |  67 +-
 kernel/rcu/tree.c                             |  22 +-
 kernel/rcu/tree_nocb.h                        |  20 +-
 mm/Makefile                                   |   4 +-
 mm/huge_memory.c                              |  69 +-
 mm/internal.h                                 |  41 +
 mm/shrinker.c                                 | 770 ++++++++++++++++++
 mm/shrinker_debug.c                           |  45 +-
 mm/vmscan.c                                   | 701 ----------------
 mm/workingset.c                               |  27 +-
 mm/zsmalloc.c                                 |  28 +-
 net/sunrpc/auth.c                             |  19 +-
 69 files changed, 1534 insertions(+), 1234 deletions(-)
 create mode 100644 mm/shrinker.c

-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:06:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:06:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570834.893079 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw0o-0001Gn-Ej; Thu, 27 Jul 2023 08:06:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570834.893079; Thu, 27 Jul 2023 08:06:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw0o-0001Gg-C9; Thu, 27 Jul 2023 08:06:18 +0000
Received: by outflank-mailman (input) for mailman id 570834;
 Thu, 27 Jul 2023 08:06:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw0m-0001DS-Pt
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:06:16 +0000
Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com
 [2607:f8b0:4864:20::42b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 73c860c0-2c54-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:06:14 +0200 (CEST)
Received: by mail-pf1-x42b.google.com with SMTP id
 d2e1a72fcca58-6862d4a1376so188187b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:06:13 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.06.00
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:06:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 73c860c0-2c54-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445172; x=1691049972;
        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=hMz0NiXWW4aad/y0uXjwCFa/Ag/H17CXQFU4sIH/+zs=;
        b=AHxGvLfHLl40j8B2JJRU5s4VfBVIfkKAsI0cQEyx34RUKm+kvHJrB2iQzGzRnBcS3v
         6USwrAVD49Q91VdWL412Beuc1lh9luLsvseTAfwZXNQFTlfXj/44XL3QSDLO3kE477UK
         PuQisTQDtaTenLhmz9UxJrWIk76t/9C2sGl3AoIFTG0F/GG2DtEXlZsFxPta58HNNxGh
         nuotqk/EcRuGp6B6DpQqHvzB1OaU8/LVfrpsdfcpoHM2+LjVOOXNlq+MDZzMAY0XeOby
         XoS1N9oa25ZJEGOvTPLqpEaa/2bkazEZHcopiam72Y0TXS5KlF1vjQrUn3lGIfR4Oiwn
         FzZg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445172; x=1691049972;
        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=hMz0NiXWW4aad/y0uXjwCFa/Ag/H17CXQFU4sIH/+zs=;
        b=XJuVC8r8RudjUWkm6AUFFEDOAq8+rqiF/7IqAKzCWaWcA2ucKnU8ontW57lDtgMik5
         4Ev7uxgqFOV1++eTl3GW44Sx12tH8Ih5Z4kwRo9JFqCfUvKOgVoNXOveEiB1bSrCFUPj
         Un01ncIKHQrFKgF6rd3dAC5F/cYktUXqNdlcZJOLBIvCzzxvU/CF4WZwwZ28oPqhXZ0B
         Mmg0aIzPPx1zNoTfnEtSah4Le8hNxAByV6Kwm0OdKTTWLEj8ZPURrQBJnnpU361SGp4V
         vzBlMjsdMZOP7ToItO1Znq1u7TRGstuHMxrtz4r0HB7FeaOiHang4jvL+q2Ocd/MtMaJ
         DfPw==
X-Gm-Message-State: ABy/qLaw3IQ9W+IKerVuCJt9FwDrwNjYUsv6sI6HqpF78td8SxaCwUUl
	gZGpabVIvxiFYN7A2VUcy6rdGA==
X-Google-Smtp-Source: APBJJlELtr5cWJQ0To//AtRPEOYgFBMbhSo+p4MsXdX0IoPp5bJSVuIL2HKgeywTxbzsVW+qtVe8tQ==
X-Received: by 2002:a05:6a00:4792:b0:668:834d:4bd with SMTP id dh18-20020a056a00479200b00668834d04bdmr4674312pfb.0.1690445172123;
        Thu, 27 Jul 2023 01:06:12 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v3 02/49] mm: move some shrinker-related function declarations to mm/internal.h
Date: Thu, 27 Jul 2023 16:04:15 +0800
Message-Id: <20230727080502.77895-3-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The following functions are only used inside the mm subsystem, so it's
better to move their declarations to the mm/internal.h file.

1. shrinker_debugfs_add()
2. shrinker_debugfs_detach()
3. shrinker_debugfs_remove()

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 include/linux/shrinker.h | 19 -------------------
 mm/internal.h            | 28 ++++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 19 deletions(-)

diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
index 224293b2dd06..8dc15aa37410 100644
--- a/include/linux/shrinker.h
+++ b/include/linux/shrinker.h
@@ -106,28 +106,9 @@ extern void free_prealloced_shrinker(struct shrinker *shrinker);
 extern void synchronize_shrinkers(void);
 
 #ifdef CONFIG_SHRINKER_DEBUG
-extern int shrinker_debugfs_add(struct shrinker *shrinker);
-extern struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
-					      int *debugfs_id);
-extern void shrinker_debugfs_remove(struct dentry *debugfs_entry,
-				    int debugfs_id);
 extern int __printf(2, 3) shrinker_debugfs_rename(struct shrinker *shrinker,
 						  const char *fmt, ...);
 #else /* CONFIG_SHRINKER_DEBUG */
-static inline int shrinker_debugfs_add(struct shrinker *shrinker)
-{
-	return 0;
-}
-static inline struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
-						     int *debugfs_id)
-{
-	*debugfs_id = -1;
-	return NULL;
-}
-static inline void shrinker_debugfs_remove(struct dentry *debugfs_entry,
-					   int debugfs_id)
-{
-}
 static inline __printf(2, 3)
 int shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...)
 {
diff --git a/mm/internal.h b/mm/internal.h
index 5a03bc4782a2..8aeaf16ae039 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -1135,4 +1135,32 @@ struct vma_prepare {
 	struct vm_area_struct *remove;
 	struct vm_area_struct *remove2;
 };
+
+/*
+ * shrinker related functions
+ */
+
+#ifdef CONFIG_SHRINKER_DEBUG
+extern int shrinker_debugfs_add(struct shrinker *shrinker);
+extern struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
+					      int *debugfs_id);
+extern void shrinker_debugfs_remove(struct dentry *debugfs_entry,
+				    int debugfs_id);
+#else /* CONFIG_SHRINKER_DEBUG */
+static inline int shrinker_debugfs_add(struct shrinker *shrinker)
+{
+	return 0;
+}
+static inline struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
+						     int *debugfs_id)
+{
+	*debugfs_id = -1;
+	return NULL;
+}
+static inline void shrinker_debugfs_remove(struct dentry *debugfs_entry,
+					   int debugfs_id)
+{
+}
+#endif /* CONFIG_SHRINKER_DEBUG */
+
 #endif	/* __MM_INTERNAL_H */
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:06:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:06:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570835.893089 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw0z-0001l7-Nv; Thu, 27 Jul 2023 08:06:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570835.893089; Thu, 27 Jul 2023 08:06:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw0z-0001ku-Ke; Thu, 27 Jul 2023 08:06:29 +0000
Received: by outflank-mailman (input) for mailman id 570835;
 Thu, 27 Jul 2023 08:06:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw0x-0001DS-Oc
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:06:27 +0000
Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com
 [2607:f8b0:4864:20::435])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7b30bb57-2c54-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:06:26 +0200 (CEST)
Received: by mail-pf1-x435.google.com with SMTP id
 d2e1a72fcca58-6748a616e17so182285b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:06:25 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.06.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:06:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7b30bb57-2c54-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445184; x=1691049984;
        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=vI5hWAAeOUoE+dMovb/D2X/oBxOfX13HzrcTYb1vz0I=;
        b=dFcunJeB79ox2F0Rn+L+Ss/aWoXzDxKcNTgoMtSiuj+R85Grv/ifhPoCAYtSbfGHwD
         TN0TMZIT88znj2keZ9rlGhcrxVh5zoF7ou5zBLgFYZ+8GtzSkW6ttwEwzrVZ73rrcsKk
         Bt5NstGzjNj5wQR0SJsSiScfi/AoSbSgUURLi5AbKNlwLcHNXojaazr7TUzXr0VxgpPh
         ilOatJLN9iwU3xsY4z4CNud6NNYXu/Juzbmnr02ENPJJbLqLArfiZgortFTjSKEVsx2h
         SvmWtZ3p0UXGsnvcQZtSSU/TR+kHNVgIw9puhY5Un5ogXuVZgRJ5ohSqB3ZskthfsuP1
         MspA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445184; x=1691049984;
        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=vI5hWAAeOUoE+dMovb/D2X/oBxOfX13HzrcTYb1vz0I=;
        b=GaAtsFOGFyDrXV2k89o6kOP4In8uJ12OWXb4l+GeTnbqdGf1xzEJ+J4VyZ+MMQVuyC
         hg+avfM9sUXoiKh57r1r73B04k0vsnyO8QqeK/JcvTTYQIgEVD7nPZrLUH0ByFwKHUWm
         y2+pp/Z4PGnzXXTQdXS/oU804IXjFqQygmWBklaDVZScE7rTKMfeaw6VsJAxAsF+YMoK
         veCX+wHq1EMu4aIHw0L3LD3uSsW4AO7Qik98a8sOqbY3iER55o2Ev08zhWZMD7b/FB7r
         lYHeJafi0bNTRrdGotixoYLv5FJ9FVg6JO2qjRxCejwwyYo7P45AEyxFnbDZvtTLFvk+
         f+KQ==
X-Gm-Message-State: ABy/qLYnXJsjvwlt5mh6rtyKxxep7qKMhdZ7gNUGw/fE5mC0YI0Hi5YH
	n6OvKexi3RTsHjDe4rKJKA8S0A==
X-Google-Smtp-Source: APBJJlEb99v7+CdH8B0GZsAuMmdcyj4bEuOvXz2nhojj2e+pKLrqUoZ6mCJVVpRQiMktWs/uO/mPuA==
X-Received: by 2002:a05:6a20:3d21:b0:134:76d6:7f7 with SMTP id y33-20020a056a203d2100b0013476d607f7mr5758628pzi.4.1690445184293;
        Thu, 27 Jul 2023 01:06:24 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v3 03/49] mm: vmscan: move shrinker-related code into a separate file
Date: Thu, 27 Jul 2023 16:04:16 +0800
Message-Id: <20230727080502.77895-4-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The mm/vmscan.c file is too large, so separate the shrinker-related
code from it into a separate file. No functional changes.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 mm/Makefile   |   4 +-
 mm/internal.h |   2 +
 mm/shrinker.c | 709 ++++++++++++++++++++++++++++++++++++++++++++++++++
 mm/vmscan.c   | 701 -------------------------------------------------
 4 files changed, 713 insertions(+), 703 deletions(-)
 create mode 100644 mm/shrinker.c

diff --git a/mm/Makefile b/mm/Makefile
index e6d9a1d5e84d..48a2ab9f86ac 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -48,8 +48,8 @@ endif
 
 obj-y			:= filemap.o mempool.o oom_kill.o fadvise.o \
 			   maccess.o page-writeback.o folio-compat.o \
-			   readahead.o swap.o truncate.o vmscan.o shmem.o \
-			   util.o mmzone.o vmstat.o backing-dev.o \
+			   readahead.o swap.o truncate.o vmscan.o shrinker.o \
+			   shmem.o util.o mmzone.o vmstat.o backing-dev.o \
 			   mm_init.o percpu.o slab_common.o \
 			   compaction.o show_mem.o\
 			   interval_tree.o list_lru.o workingset.o \
diff --git a/mm/internal.h b/mm/internal.h
index 8aeaf16ae039..8b82038dcc6a 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -1139,6 +1139,8 @@ struct vma_prepare {
 /*
  * shrinker related functions
  */
+unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
+			  int priority);
 
 #ifdef CONFIG_SHRINKER_DEBUG
 extern int shrinker_debugfs_add(struct shrinker *shrinker);
diff --git a/mm/shrinker.c b/mm/shrinker.c
new file mode 100644
index 000000000000..043c87ccfab4
--- /dev/null
+++ b/mm/shrinker.c
@@ -0,0 +1,709 @@
+// SPDX-License-Identifier: GPL-2.0
+#include <linux/memcontrol.h>
+#include <linux/rwsem.h>
+#include <linux/shrinker.h>
+#include <trace/events/vmscan.h>
+
+#include "internal.h"
+
+LIST_HEAD(shrinker_list);
+DECLARE_RWSEM(shrinker_rwsem);
+
+#ifdef CONFIG_MEMCG
+static int shrinker_nr_max;
+
+/* The shrinker_info is expanded in a batch of BITS_PER_LONG */
+static inline int shrinker_map_size(int nr_items)
+{
+	return (DIV_ROUND_UP(nr_items, BITS_PER_LONG) * sizeof(unsigned long));
+}
+
+static inline int shrinker_defer_size(int nr_items)
+{
+	return (round_up(nr_items, BITS_PER_LONG) * sizeof(atomic_long_t));
+}
+
+void free_shrinker_info(struct mem_cgroup *memcg)
+{
+	struct mem_cgroup_per_node *pn;
+	struct shrinker_info *info;
+	int nid;
+
+	for_each_node(nid) {
+		pn = memcg->nodeinfo[nid];
+		info = rcu_dereference_protected(pn->shrinker_info, true);
+		kvfree(info);
+		rcu_assign_pointer(pn->shrinker_info, NULL);
+	}
+}
+
+int alloc_shrinker_info(struct mem_cgroup *memcg)
+{
+	struct shrinker_info *info;
+	int nid, size, ret = 0;
+	int map_size, defer_size = 0;
+
+	down_write(&shrinker_rwsem);
+	map_size = shrinker_map_size(shrinker_nr_max);
+	defer_size = shrinker_defer_size(shrinker_nr_max);
+	size = map_size + defer_size;
+	for_each_node(nid) {
+		info = kvzalloc_node(sizeof(*info) + size, GFP_KERNEL, nid);
+		if (!info) {
+			free_shrinker_info(memcg);
+			ret = -ENOMEM;
+			break;
+		}
+		info->nr_deferred = (atomic_long_t *)(info + 1);
+		info->map = (void *)info->nr_deferred + defer_size;
+		info->map_nr_max = shrinker_nr_max;
+		rcu_assign_pointer(memcg->nodeinfo[nid]->shrinker_info, info);
+	}
+	up_write(&shrinker_rwsem);
+
+	return ret;
+}
+
+static struct shrinker_info *shrinker_info_protected(struct mem_cgroup *memcg,
+						     int nid)
+{
+	return rcu_dereference_protected(memcg->nodeinfo[nid]->shrinker_info,
+					 lockdep_is_held(&shrinker_rwsem));
+}
+
+static int expand_one_shrinker_info(struct mem_cgroup *memcg,
+				    int map_size, int defer_size,
+				    int old_map_size, int old_defer_size,
+				    int new_nr_max)
+{
+	struct shrinker_info *new, *old;
+	struct mem_cgroup_per_node *pn;
+	int nid;
+	int size = map_size + defer_size;
+
+	for_each_node(nid) {
+		pn = memcg->nodeinfo[nid];
+		old = shrinker_info_protected(memcg, nid);
+		/* Not yet online memcg */
+		if (!old)
+			return 0;
+
+		/* Already expanded this shrinker_info */
+		if (new_nr_max <= old->map_nr_max)
+			continue;
+
+		new = kvmalloc_node(sizeof(*new) + size, GFP_KERNEL, nid);
+		if (!new)
+			return -ENOMEM;
+
+		new->nr_deferred = (atomic_long_t *)(new + 1);
+		new->map = (void *)new->nr_deferred + defer_size;
+		new->map_nr_max = new_nr_max;
+
+		/* map: set all old bits, clear all new bits */
+		memset(new->map, (int)0xff, old_map_size);
+		memset((void *)new->map + old_map_size, 0, map_size - old_map_size);
+		/* nr_deferred: copy old values, clear all new values */
+		memcpy(new->nr_deferred, old->nr_deferred, old_defer_size);
+		memset((void *)new->nr_deferred + old_defer_size, 0,
+		       defer_size - old_defer_size);
+
+		rcu_assign_pointer(pn->shrinker_info, new);
+		kvfree_rcu(old, rcu);
+	}
+
+	return 0;
+}
+
+static int expand_shrinker_info(int new_id)
+{
+	int ret = 0;
+	int new_nr_max = round_up(new_id + 1, BITS_PER_LONG);
+	int map_size, defer_size = 0;
+	int old_map_size, old_defer_size = 0;
+	struct mem_cgroup *memcg;
+
+	if (!root_mem_cgroup)
+		goto out;
+
+	lockdep_assert_held(&shrinker_rwsem);
+
+	map_size = shrinker_map_size(new_nr_max);
+	defer_size = shrinker_defer_size(new_nr_max);
+	old_map_size = shrinker_map_size(shrinker_nr_max);
+	old_defer_size = shrinker_defer_size(shrinker_nr_max);
+
+	memcg = mem_cgroup_iter(NULL, NULL, NULL);
+	do {
+		ret = expand_one_shrinker_info(memcg, map_size, defer_size,
+					       old_map_size, old_defer_size,
+					       new_nr_max);
+		if (ret) {
+			mem_cgroup_iter_break(NULL, memcg);
+			goto out;
+		}
+	} while ((memcg = mem_cgroup_iter(NULL, memcg, NULL)) != NULL);
+out:
+	if (!ret)
+		shrinker_nr_max = new_nr_max;
+
+	return ret;
+}
+
+void set_shrinker_bit(struct mem_cgroup *memcg, int nid, int shrinker_id)
+{
+	if (shrinker_id >= 0 && memcg && !mem_cgroup_is_root(memcg)) {
+		struct shrinker_info *info;
+
+		rcu_read_lock();
+		info = rcu_dereference(memcg->nodeinfo[nid]->shrinker_info);
+		if (!WARN_ON_ONCE(shrinker_id >= info->map_nr_max)) {
+			/* Pairs with smp mb in shrink_slab() */
+			smp_mb__before_atomic();
+			set_bit(shrinker_id, info->map);
+		}
+		rcu_read_unlock();
+	}
+}
+
+static DEFINE_IDR(shrinker_idr);
+
+static int prealloc_memcg_shrinker(struct shrinker *shrinker)
+{
+	int id, ret = -ENOMEM;
+
+	if (mem_cgroup_disabled())
+		return -ENOSYS;
+
+	down_write(&shrinker_rwsem);
+	/* This may call shrinker, so it must use down_read_trylock() */
+	id = idr_alloc(&shrinker_idr, shrinker, 0, 0, GFP_KERNEL);
+	if (id < 0)
+		goto unlock;
+
+	if (id >= shrinker_nr_max) {
+		if (expand_shrinker_info(id)) {
+			idr_remove(&shrinker_idr, id);
+			goto unlock;
+		}
+	}
+	shrinker->id = id;
+	ret = 0;
+unlock:
+	up_write(&shrinker_rwsem);
+	return ret;
+}
+
+static void unregister_memcg_shrinker(struct shrinker *shrinker)
+{
+	int id = shrinker->id;
+
+	BUG_ON(id < 0);
+
+	lockdep_assert_held(&shrinker_rwsem);
+
+	idr_remove(&shrinker_idr, id);
+}
+
+static long xchg_nr_deferred_memcg(int nid, struct shrinker *shrinker,
+				   struct mem_cgroup *memcg)
+{
+	struct shrinker_info *info;
+
+	info = shrinker_info_protected(memcg, nid);
+	return atomic_long_xchg(&info->nr_deferred[shrinker->id], 0);
+}
+
+static long add_nr_deferred_memcg(long nr, int nid, struct shrinker *shrinker,
+				  struct mem_cgroup *memcg)
+{
+	struct shrinker_info *info;
+
+	info = shrinker_info_protected(memcg, nid);
+	return atomic_long_add_return(nr, &info->nr_deferred[shrinker->id]);
+}
+
+void reparent_shrinker_deferred(struct mem_cgroup *memcg)
+{
+	int i, nid;
+	long nr;
+	struct mem_cgroup *parent;
+	struct shrinker_info *child_info, *parent_info;
+
+	parent = parent_mem_cgroup(memcg);
+	if (!parent)
+		parent = root_mem_cgroup;
+
+	/* Prevent from concurrent shrinker_info expand */
+	down_read(&shrinker_rwsem);
+	for_each_node(nid) {
+		child_info = shrinker_info_protected(memcg, nid);
+		parent_info = shrinker_info_protected(parent, nid);
+		for (i = 0; i < child_info->map_nr_max; i++) {
+			nr = atomic_long_read(&child_info->nr_deferred[i]);
+			atomic_long_add(nr, &parent_info->nr_deferred[i]);
+		}
+	}
+	up_read(&shrinker_rwsem);
+}
+#else
+static int prealloc_memcg_shrinker(struct shrinker *shrinker)
+{
+	return -ENOSYS;
+}
+
+static void unregister_memcg_shrinker(struct shrinker *shrinker)
+{
+}
+
+static long xchg_nr_deferred_memcg(int nid, struct shrinker *shrinker,
+				   struct mem_cgroup *memcg)
+{
+	return 0;
+}
+
+static long add_nr_deferred_memcg(long nr, int nid, struct shrinker *shrinker,
+				  struct mem_cgroup *memcg)
+{
+	return 0;
+}
+#endif /* CONFIG_MEMCG */
+
+static long xchg_nr_deferred(struct shrinker *shrinker,
+			     struct shrink_control *sc)
+{
+	int nid = sc->nid;
+
+	if (!(shrinker->flags & SHRINKER_NUMA_AWARE))
+		nid = 0;
+
+	if (sc->memcg &&
+	    (shrinker->flags & SHRINKER_MEMCG_AWARE))
+		return xchg_nr_deferred_memcg(nid, shrinker,
+					      sc->memcg);
+
+	return atomic_long_xchg(&shrinker->nr_deferred[nid], 0);
+}
+
+
+static long add_nr_deferred(long nr, struct shrinker *shrinker,
+			    struct shrink_control *sc)
+{
+	int nid = sc->nid;
+
+	if (!(shrinker->flags & SHRINKER_NUMA_AWARE))
+		nid = 0;
+
+	if (sc->memcg &&
+	    (shrinker->flags & SHRINKER_MEMCG_AWARE))
+		return add_nr_deferred_memcg(nr, nid, shrinker,
+					     sc->memcg);
+
+	return atomic_long_add_return(nr, &shrinker->nr_deferred[nid]);
+}
+
+#define SHRINK_BATCH 128
+
+static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
+				    struct shrinker *shrinker, int priority)
+{
+	unsigned long freed = 0;
+	unsigned long long delta;
+	long total_scan;
+	long freeable;
+	long nr;
+	long new_nr;
+	long batch_size = shrinker->batch ? shrinker->batch
+					  : SHRINK_BATCH;
+	long scanned = 0, next_deferred;
+
+	freeable = shrinker->count_objects(shrinker, shrinkctl);
+	if (freeable == 0 || freeable == SHRINK_EMPTY)
+		return freeable;
+
+	/*
+	 * copy the current shrinker scan count into a local variable
+	 * and zero it so that other concurrent shrinker invocations
+	 * don't also do this scanning work.
+	 */
+	nr = xchg_nr_deferred(shrinker, shrinkctl);
+
+	if (shrinker->seeks) {
+		delta = freeable >> priority;
+		delta *= 4;
+		do_div(delta, shrinker->seeks);
+	} else {
+		/*
+		 * These objects don't require any IO to create. Trim
+		 * them aggressively under memory pressure to keep
+		 * them from causing refetches in the IO caches.
+		 */
+		delta = freeable / 2;
+	}
+
+	total_scan = nr >> priority;
+	total_scan += delta;
+	total_scan = min(total_scan, (2 * freeable));
+
+	trace_mm_shrink_slab_start(shrinker, shrinkctl, nr,
+				   freeable, delta, total_scan, priority);
+
+	/*
+	 * Normally, we should not scan less than batch_size objects in one
+	 * pass to avoid too frequent shrinker calls, but if the slab has less
+	 * than batch_size objects in total and we are really tight on memory,
+	 * we will try to reclaim all available objects, otherwise we can end
+	 * up failing allocations although there are plenty of reclaimable
+	 * objects spread over several slabs with usage less than the
+	 * batch_size.
+	 *
+	 * We detect the "tight on memory" situations by looking at the total
+	 * number of objects we want to scan (total_scan). If it is greater
+	 * than the total number of objects on slab (freeable), we must be
+	 * scanning at high prio and therefore should try to reclaim as much as
+	 * possible.
+	 */
+	while (total_scan >= batch_size ||
+	       total_scan >= freeable) {
+		unsigned long ret;
+		unsigned long nr_to_scan = min(batch_size, total_scan);
+
+		shrinkctl->nr_to_scan = nr_to_scan;
+		shrinkctl->nr_scanned = nr_to_scan;
+		ret = shrinker->scan_objects(shrinker, shrinkctl);
+		if (ret == SHRINK_STOP)
+			break;
+		freed += ret;
+
+		count_vm_events(SLABS_SCANNED, shrinkctl->nr_scanned);
+		total_scan -= shrinkctl->nr_scanned;
+		scanned += shrinkctl->nr_scanned;
+
+		cond_resched();
+	}
+
+	/*
+	 * The deferred work is increased by any new work (delta) that wasn't
+	 * done, decreased by old deferred work that was done now.
+	 *
+	 * And it is capped to two times of the freeable items.
+	 */
+	next_deferred = max_t(long, (nr + delta - scanned), 0);
+	next_deferred = min(next_deferred, (2 * freeable));
+
+	/*
+	 * move the unused scan count back into the shrinker in a
+	 * manner that handles concurrent updates.
+	 */
+	new_nr = add_nr_deferred(next_deferred, shrinker, shrinkctl);
+
+	trace_mm_shrink_slab_end(shrinker, shrinkctl->nid, freed, nr, new_nr, total_scan);
+	return freed;
+}
+
+#ifdef CONFIG_MEMCG
+static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
+			struct mem_cgroup *memcg, int priority)
+{
+	struct shrinker_info *info;
+	unsigned long ret, freed = 0;
+	int i;
+
+	if (!mem_cgroup_online(memcg))
+		return 0;
+
+	if (!down_read_trylock(&shrinker_rwsem))
+		return 0;
+
+	info = shrinker_info_protected(memcg, nid);
+	if (unlikely(!info))
+		goto unlock;
+
+	for_each_set_bit(i, info->map, info->map_nr_max) {
+		struct shrink_control sc = {
+			.gfp_mask = gfp_mask,
+			.nid = nid,
+			.memcg = memcg,
+		};
+		struct shrinker *shrinker;
+
+		shrinker = idr_find(&shrinker_idr, i);
+		if (unlikely(!shrinker || !(shrinker->flags & SHRINKER_REGISTERED))) {
+			if (!shrinker)
+				clear_bit(i, info->map);
+			continue;
+		}
+
+		/* Call non-slab shrinkers even though kmem is disabled */
+		if (!memcg_kmem_online() &&
+		    !(shrinker->flags & SHRINKER_NONSLAB))
+			continue;
+
+		ret = do_shrink_slab(&sc, shrinker, priority);
+		if (ret == SHRINK_EMPTY) {
+			clear_bit(i, info->map);
+			/*
+			 * After the shrinker reported that it had no objects to
+			 * free, but before we cleared the corresponding bit in
+			 * the memcg shrinker map, a new object might have been
+			 * added. To make sure, we have the bit set in this
+			 * case, we invoke the shrinker one more time and reset
+			 * the bit if it reports that it is not empty anymore.
+			 * The memory barrier here pairs with the barrier in
+			 * set_shrinker_bit():
+			 *
+			 * list_lru_add()     shrink_slab_memcg()
+			 *   list_add_tail()    clear_bit()
+			 *   <MB>               <MB>
+			 *   set_bit()          do_shrink_slab()
+			 */
+			smp_mb__after_atomic();
+			ret = do_shrink_slab(&sc, shrinker, priority);
+			if (ret == SHRINK_EMPTY)
+				ret = 0;
+			else
+				set_shrinker_bit(memcg, nid, i);
+		}
+		freed += ret;
+
+		if (rwsem_is_contended(&shrinker_rwsem)) {
+			freed = freed ? : 1;
+			break;
+		}
+	}
+unlock:
+	up_read(&shrinker_rwsem);
+	return freed;
+}
+#else /* !CONFIG_MEMCG */
+static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
+			struct mem_cgroup *memcg, int priority)
+{
+	return 0;
+}
+#endif /* CONFIG_MEMCG */
+
+/**
+ * shrink_slab - shrink slab caches
+ * @gfp_mask: allocation context
+ * @nid: node whose slab caches to target
+ * @memcg: memory cgroup whose slab caches to target
+ * @priority: the reclaim priority
+ *
+ * Call the shrink functions to age shrinkable caches.
+ *
+ * @nid is passed along to shrinkers with SHRINKER_NUMA_AWARE set,
+ * unaware shrinkers will receive a node id of 0 instead.
+ *
+ * @memcg specifies the memory cgroup to target. Unaware shrinkers
+ * are called only if it is the root cgroup.
+ *
+ * @priority is sc->priority, we take the number of objects and >> by priority
+ * in order to get the scan target.
+ *
+ * Returns the number of reclaimed slab objects.
+ */
+unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
+			  int priority)
+{
+	unsigned long ret, freed = 0;
+	struct shrinker *shrinker;
+
+	/*
+	 * The root memcg might be allocated even though memcg is disabled
+	 * via "cgroup_disable=memory" boot parameter.  This could make
+	 * mem_cgroup_is_root() return false, then just run memcg slab
+	 * shrink, but skip global shrink.  This may result in premature
+	 * oom.
+	 */
+	if (!mem_cgroup_disabled() && !mem_cgroup_is_root(memcg))
+		return shrink_slab_memcg(gfp_mask, nid, memcg, priority);
+
+	if (!down_read_trylock(&shrinker_rwsem))
+		goto out;
+
+	list_for_each_entry(shrinker, &shrinker_list, list) {
+		struct shrink_control sc = {
+			.gfp_mask = gfp_mask,
+			.nid = nid,
+			.memcg = memcg,
+		};
+
+		ret = do_shrink_slab(&sc, shrinker, priority);
+		if (ret == SHRINK_EMPTY)
+			ret = 0;
+		freed += ret;
+		/*
+		 * Bail out if someone want to register a new shrinker to
+		 * prevent the registration from being stalled for long periods
+		 * by parallel ongoing shrinking.
+		 */
+		if (rwsem_is_contended(&shrinker_rwsem)) {
+			freed = freed ? : 1;
+			break;
+		}
+	}
+
+	up_read(&shrinker_rwsem);
+out:
+	cond_resched();
+	return freed;
+}
+
+/*
+ * Add a shrinker callback to be called from the vm.
+ */
+static int __prealloc_shrinker(struct shrinker *shrinker)
+{
+	unsigned int size;
+	int err;
+
+	if (shrinker->flags & SHRINKER_MEMCG_AWARE) {
+		err = prealloc_memcg_shrinker(shrinker);
+		if (err != -ENOSYS)
+			return err;
+
+		shrinker->flags &= ~SHRINKER_MEMCG_AWARE;
+	}
+
+	size = sizeof(*shrinker->nr_deferred);
+	if (shrinker->flags & SHRINKER_NUMA_AWARE)
+		size *= nr_node_ids;
+
+	shrinker->nr_deferred = kzalloc(size, GFP_KERNEL);
+	if (!shrinker->nr_deferred)
+		return -ENOMEM;
+
+	return 0;
+}
+
+#ifdef CONFIG_SHRINKER_DEBUG
+int prealloc_shrinker(struct shrinker *shrinker, const char *fmt, ...)
+{
+	va_list ap;
+	int err;
+
+	va_start(ap, fmt);
+	shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
+	va_end(ap);
+	if (!shrinker->name)
+		return -ENOMEM;
+
+	err = __prealloc_shrinker(shrinker);
+	if (err) {
+		kfree_const(shrinker->name);
+		shrinker->name = NULL;
+	}
+
+	return err;
+}
+#else
+int prealloc_shrinker(struct shrinker *shrinker, const char *fmt, ...)
+{
+	return __prealloc_shrinker(shrinker);
+}
+#endif
+
+void free_prealloced_shrinker(struct shrinker *shrinker)
+{
+#ifdef CONFIG_SHRINKER_DEBUG
+	kfree_const(shrinker->name);
+	shrinker->name = NULL;
+#endif
+	if (shrinker->flags & SHRINKER_MEMCG_AWARE) {
+		down_write(&shrinker_rwsem);
+		unregister_memcg_shrinker(shrinker);
+		up_write(&shrinker_rwsem);
+		return;
+	}
+
+	kfree(shrinker->nr_deferred);
+	shrinker->nr_deferred = NULL;
+}
+
+void register_shrinker_prepared(struct shrinker *shrinker)
+{
+	down_write(&shrinker_rwsem);
+	list_add_tail(&shrinker->list, &shrinker_list);
+	shrinker->flags |= SHRINKER_REGISTERED;
+	shrinker_debugfs_add(shrinker);
+	up_write(&shrinker_rwsem);
+}
+
+static int __register_shrinker(struct shrinker *shrinker)
+{
+	int err = __prealloc_shrinker(shrinker);
+
+	if (err)
+		return err;
+	register_shrinker_prepared(shrinker);
+	return 0;
+}
+
+#ifdef CONFIG_SHRINKER_DEBUG
+int register_shrinker(struct shrinker *shrinker, const char *fmt, ...)
+{
+	va_list ap;
+	int err;
+
+	va_start(ap, fmt);
+	shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
+	va_end(ap);
+	if (!shrinker->name)
+		return -ENOMEM;
+
+	err = __register_shrinker(shrinker);
+	if (err) {
+		kfree_const(shrinker->name);
+		shrinker->name = NULL;
+	}
+	return err;
+}
+#else
+int register_shrinker(struct shrinker *shrinker, const char *fmt, ...)
+{
+	return __register_shrinker(shrinker);
+}
+#endif
+EXPORT_SYMBOL(register_shrinker);
+
+/*
+ * Remove one
+ */
+void unregister_shrinker(struct shrinker *shrinker)
+{
+	struct dentry *debugfs_entry;
+	int debugfs_id;
+
+	if (!(shrinker->flags & SHRINKER_REGISTERED))
+		return;
+
+	down_write(&shrinker_rwsem);
+	list_del(&shrinker->list);
+	shrinker->flags &= ~SHRINKER_REGISTERED;
+	if (shrinker->flags & SHRINKER_MEMCG_AWARE)
+		unregister_memcg_shrinker(shrinker);
+	debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);
+	up_write(&shrinker_rwsem);
+
+	shrinker_debugfs_remove(debugfs_entry, debugfs_id);
+
+	kfree(shrinker->nr_deferred);
+	shrinker->nr_deferred = NULL;
+}
+EXPORT_SYMBOL(unregister_shrinker);
+
+/**
+ * synchronize_shrinkers - Wait for all running shrinkers to complete.
+ *
+ * This is equivalent to calling unregister_shrink() and register_shrinker(),
+ * but atomically and with less overhead. This is useful to guarantee that all
+ * shrinker invocations have seen an update, before freeing memory, similar to
+ * rcu.
+ */
+void synchronize_shrinkers(void)
+{
+	down_write(&shrinker_rwsem);
+	up_write(&shrinker_rwsem);
+}
+EXPORT_SYMBOL(synchronize_shrinkers);
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 4039620d30fe..07bc58af6f26 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -35,7 +35,6 @@
 #include <linux/cpuset.h>
 #include <linux/compaction.h>
 #include <linux/notifier.h>
-#include <linux/rwsem.h>
 #include <linux/delay.h>
 #include <linux/kthread.h>
 #include <linux/freezer.h>
@@ -188,246 +187,7 @@ struct scan_control {
  */
 int vm_swappiness = 60;
 
-LIST_HEAD(shrinker_list);
-DECLARE_RWSEM(shrinker_rwsem);
-
 #ifdef CONFIG_MEMCG
-static int shrinker_nr_max;
-
-/* The shrinker_info is expanded in a batch of BITS_PER_LONG */
-static inline int shrinker_map_size(int nr_items)
-{
-	return (DIV_ROUND_UP(nr_items, BITS_PER_LONG) * sizeof(unsigned long));
-}
-
-static inline int shrinker_defer_size(int nr_items)
-{
-	return (round_up(nr_items, BITS_PER_LONG) * sizeof(atomic_long_t));
-}
-
-static struct shrinker_info *shrinker_info_protected(struct mem_cgroup *memcg,
-						     int nid)
-{
-	return rcu_dereference_protected(memcg->nodeinfo[nid]->shrinker_info,
-					 lockdep_is_held(&shrinker_rwsem));
-}
-
-static int expand_one_shrinker_info(struct mem_cgroup *memcg,
-				    int map_size, int defer_size,
-				    int old_map_size, int old_defer_size,
-				    int new_nr_max)
-{
-	struct shrinker_info *new, *old;
-	struct mem_cgroup_per_node *pn;
-	int nid;
-	int size = map_size + defer_size;
-
-	for_each_node(nid) {
-		pn = memcg->nodeinfo[nid];
-		old = shrinker_info_protected(memcg, nid);
-		/* Not yet online memcg */
-		if (!old)
-			return 0;
-
-		/* Already expanded this shrinker_info */
-		if (new_nr_max <= old->map_nr_max)
-			continue;
-
-		new = kvmalloc_node(sizeof(*new) + size, GFP_KERNEL, nid);
-		if (!new)
-			return -ENOMEM;
-
-		new->nr_deferred = (atomic_long_t *)(new + 1);
-		new->map = (void *)new->nr_deferred + defer_size;
-		new->map_nr_max = new_nr_max;
-
-		/* map: set all old bits, clear all new bits */
-		memset(new->map, (int)0xff, old_map_size);
-		memset((void *)new->map + old_map_size, 0, map_size - old_map_size);
-		/* nr_deferred: copy old values, clear all new values */
-		memcpy(new->nr_deferred, old->nr_deferred, old_defer_size);
-		memset((void *)new->nr_deferred + old_defer_size, 0,
-		       defer_size - old_defer_size);
-
-		rcu_assign_pointer(pn->shrinker_info, new);
-		kvfree_rcu(old, rcu);
-	}
-
-	return 0;
-}
-
-void free_shrinker_info(struct mem_cgroup *memcg)
-{
-	struct mem_cgroup_per_node *pn;
-	struct shrinker_info *info;
-	int nid;
-
-	for_each_node(nid) {
-		pn = memcg->nodeinfo[nid];
-		info = rcu_dereference_protected(pn->shrinker_info, true);
-		kvfree(info);
-		rcu_assign_pointer(pn->shrinker_info, NULL);
-	}
-}
-
-int alloc_shrinker_info(struct mem_cgroup *memcg)
-{
-	struct shrinker_info *info;
-	int nid, size, ret = 0;
-	int map_size, defer_size = 0;
-
-	down_write(&shrinker_rwsem);
-	map_size = shrinker_map_size(shrinker_nr_max);
-	defer_size = shrinker_defer_size(shrinker_nr_max);
-	size = map_size + defer_size;
-	for_each_node(nid) {
-		info = kvzalloc_node(sizeof(*info) + size, GFP_KERNEL, nid);
-		if (!info) {
-			free_shrinker_info(memcg);
-			ret = -ENOMEM;
-			break;
-		}
-		info->nr_deferred = (atomic_long_t *)(info + 1);
-		info->map = (void *)info->nr_deferred + defer_size;
-		info->map_nr_max = shrinker_nr_max;
-		rcu_assign_pointer(memcg->nodeinfo[nid]->shrinker_info, info);
-	}
-	up_write(&shrinker_rwsem);
-
-	return ret;
-}
-
-static int expand_shrinker_info(int new_id)
-{
-	int ret = 0;
-	int new_nr_max = round_up(new_id + 1, BITS_PER_LONG);
-	int map_size, defer_size = 0;
-	int old_map_size, old_defer_size = 0;
-	struct mem_cgroup *memcg;
-
-	if (!root_mem_cgroup)
-		goto out;
-
-	lockdep_assert_held(&shrinker_rwsem);
-
-	map_size = shrinker_map_size(new_nr_max);
-	defer_size = shrinker_defer_size(new_nr_max);
-	old_map_size = shrinker_map_size(shrinker_nr_max);
-	old_defer_size = shrinker_defer_size(shrinker_nr_max);
-
-	memcg = mem_cgroup_iter(NULL, NULL, NULL);
-	do {
-		ret = expand_one_shrinker_info(memcg, map_size, defer_size,
-					       old_map_size, old_defer_size,
-					       new_nr_max);
-		if (ret) {
-			mem_cgroup_iter_break(NULL, memcg);
-			goto out;
-		}
-	} while ((memcg = mem_cgroup_iter(NULL, memcg, NULL)) != NULL);
-out:
-	if (!ret)
-		shrinker_nr_max = new_nr_max;
-
-	return ret;
-}
-
-void set_shrinker_bit(struct mem_cgroup *memcg, int nid, int shrinker_id)
-{
-	if (shrinker_id >= 0 && memcg && !mem_cgroup_is_root(memcg)) {
-		struct shrinker_info *info;
-
-		rcu_read_lock();
-		info = rcu_dereference(memcg->nodeinfo[nid]->shrinker_info);
-		if (!WARN_ON_ONCE(shrinker_id >= info->map_nr_max)) {
-			/* Pairs with smp mb in shrink_slab() */
-			smp_mb__before_atomic();
-			set_bit(shrinker_id, info->map);
-		}
-		rcu_read_unlock();
-	}
-}
-
-static DEFINE_IDR(shrinker_idr);
-
-static int prealloc_memcg_shrinker(struct shrinker *shrinker)
-{
-	int id, ret = -ENOMEM;
-
-	if (mem_cgroup_disabled())
-		return -ENOSYS;
-
-	down_write(&shrinker_rwsem);
-	/* This may call shrinker, so it must use down_read_trylock() */
-	id = idr_alloc(&shrinker_idr, shrinker, 0, 0, GFP_KERNEL);
-	if (id < 0)
-		goto unlock;
-
-	if (id >= shrinker_nr_max) {
-		if (expand_shrinker_info(id)) {
-			idr_remove(&shrinker_idr, id);
-			goto unlock;
-		}
-	}
-	shrinker->id = id;
-	ret = 0;
-unlock:
-	up_write(&shrinker_rwsem);
-	return ret;
-}
-
-static void unregister_memcg_shrinker(struct shrinker *shrinker)
-{
-	int id = shrinker->id;
-
-	BUG_ON(id < 0);
-
-	lockdep_assert_held(&shrinker_rwsem);
-
-	idr_remove(&shrinker_idr, id);
-}
-
-static long xchg_nr_deferred_memcg(int nid, struct shrinker *shrinker,
-				   struct mem_cgroup *memcg)
-{
-	struct shrinker_info *info;
-
-	info = shrinker_info_protected(memcg, nid);
-	return atomic_long_xchg(&info->nr_deferred[shrinker->id], 0);
-}
-
-static long add_nr_deferred_memcg(long nr, int nid, struct shrinker *shrinker,
-				  struct mem_cgroup *memcg)
-{
-	struct shrinker_info *info;
-
-	info = shrinker_info_protected(memcg, nid);
-	return atomic_long_add_return(nr, &info->nr_deferred[shrinker->id]);
-}
-
-void reparent_shrinker_deferred(struct mem_cgroup *memcg)
-{
-	int i, nid;
-	long nr;
-	struct mem_cgroup *parent;
-	struct shrinker_info *child_info, *parent_info;
-
-	parent = parent_mem_cgroup(memcg);
-	if (!parent)
-		parent = root_mem_cgroup;
-
-	/* Prevent from concurrent shrinker_info expand */
-	down_read(&shrinker_rwsem);
-	for_each_node(nid) {
-		child_info = shrinker_info_protected(memcg, nid);
-		parent_info = shrinker_info_protected(parent, nid);
-		for (i = 0; i < child_info->map_nr_max; i++) {
-			nr = atomic_long_read(&child_info->nr_deferred[i]);
-			atomic_long_add(nr, &parent_info->nr_deferred[i]);
-		}
-	}
-	up_read(&shrinker_rwsem);
-}
 
 /* Returns true for reclaim through cgroup limits or cgroup interfaces. */
 static bool cgroup_reclaim(struct scan_control *sc)
@@ -468,27 +228,6 @@ static bool writeback_throttling_sane(struct scan_control *sc)
 	return false;
 }
 #else
-static int prealloc_memcg_shrinker(struct shrinker *shrinker)
-{
-	return -ENOSYS;
-}
-
-static void unregister_memcg_shrinker(struct shrinker *shrinker)
-{
-}
-
-static long xchg_nr_deferred_memcg(int nid, struct shrinker *shrinker,
-				   struct mem_cgroup *memcg)
-{
-	return 0;
-}
-
-static long add_nr_deferred_memcg(long nr, int nid, struct shrinker *shrinker,
-				  struct mem_cgroup *memcg)
-{
-	return 0;
-}
-
 static bool cgroup_reclaim(struct scan_control *sc)
 {
 	return false;
@@ -557,39 +296,6 @@ static void flush_reclaim_state(struct scan_control *sc)
 	}
 }
 
-static long xchg_nr_deferred(struct shrinker *shrinker,
-			     struct shrink_control *sc)
-{
-	int nid = sc->nid;
-
-	if (!(shrinker->flags & SHRINKER_NUMA_AWARE))
-		nid = 0;
-
-	if (sc->memcg &&
-	    (shrinker->flags & SHRINKER_MEMCG_AWARE))
-		return xchg_nr_deferred_memcg(nid, shrinker,
-					      sc->memcg);
-
-	return atomic_long_xchg(&shrinker->nr_deferred[nid], 0);
-}
-
-
-static long add_nr_deferred(long nr, struct shrinker *shrinker,
-			    struct shrink_control *sc)
-{
-	int nid = sc->nid;
-
-	if (!(shrinker->flags & SHRINKER_NUMA_AWARE))
-		nid = 0;
-
-	if (sc->memcg &&
-	    (shrinker->flags & SHRINKER_MEMCG_AWARE))
-		return add_nr_deferred_memcg(nr, nid, shrinker,
-					     sc->memcg);
-
-	return atomic_long_add_return(nr, &shrinker->nr_deferred[nid]);
-}
-
 static bool can_demote(int nid, struct scan_control *sc)
 {
 	if (!numa_demotion_enabled)
@@ -671,413 +377,6 @@ static unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru,
 	return size;
 }
 
-/*
- * Add a shrinker callback to be called from the vm.
- */
-static int __prealloc_shrinker(struct shrinker *shrinker)
-{
-	unsigned int size;
-	int err;
-
-	if (shrinker->flags & SHRINKER_MEMCG_AWARE) {
-		err = prealloc_memcg_shrinker(shrinker);
-		if (err != -ENOSYS)
-			return err;
-
-		shrinker->flags &= ~SHRINKER_MEMCG_AWARE;
-	}
-
-	size = sizeof(*shrinker->nr_deferred);
-	if (shrinker->flags & SHRINKER_NUMA_AWARE)
-		size *= nr_node_ids;
-
-	shrinker->nr_deferred = kzalloc(size, GFP_KERNEL);
-	if (!shrinker->nr_deferred)
-		return -ENOMEM;
-
-	return 0;
-}
-
-#ifdef CONFIG_SHRINKER_DEBUG
-int prealloc_shrinker(struct shrinker *shrinker, const char *fmt, ...)
-{
-	va_list ap;
-	int err;
-
-	va_start(ap, fmt);
-	shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
-	va_end(ap);
-	if (!shrinker->name)
-		return -ENOMEM;
-
-	err = __prealloc_shrinker(shrinker);
-	if (err) {
-		kfree_const(shrinker->name);
-		shrinker->name = NULL;
-	}
-
-	return err;
-}
-#else
-int prealloc_shrinker(struct shrinker *shrinker, const char *fmt, ...)
-{
-	return __prealloc_shrinker(shrinker);
-}
-#endif
-
-void free_prealloced_shrinker(struct shrinker *shrinker)
-{
-#ifdef CONFIG_SHRINKER_DEBUG
-	kfree_const(shrinker->name);
-	shrinker->name = NULL;
-#endif
-	if (shrinker->flags & SHRINKER_MEMCG_AWARE) {
-		down_write(&shrinker_rwsem);
-		unregister_memcg_shrinker(shrinker);
-		up_write(&shrinker_rwsem);
-		return;
-	}
-
-	kfree(shrinker->nr_deferred);
-	shrinker->nr_deferred = NULL;
-}
-
-void register_shrinker_prepared(struct shrinker *shrinker)
-{
-	down_write(&shrinker_rwsem);
-	list_add_tail(&shrinker->list, &shrinker_list);
-	shrinker->flags |= SHRINKER_REGISTERED;
-	shrinker_debugfs_add(shrinker);
-	up_write(&shrinker_rwsem);
-}
-
-static int __register_shrinker(struct shrinker *shrinker)
-{
-	int err = __prealloc_shrinker(shrinker);
-
-	if (err)
-		return err;
-	register_shrinker_prepared(shrinker);
-	return 0;
-}
-
-#ifdef CONFIG_SHRINKER_DEBUG
-int register_shrinker(struct shrinker *shrinker, const char *fmt, ...)
-{
-	va_list ap;
-	int err;
-
-	va_start(ap, fmt);
-	shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
-	va_end(ap);
-	if (!shrinker->name)
-		return -ENOMEM;
-
-	err = __register_shrinker(shrinker);
-	if (err) {
-		kfree_const(shrinker->name);
-		shrinker->name = NULL;
-	}
-	return err;
-}
-#else
-int register_shrinker(struct shrinker *shrinker, const char *fmt, ...)
-{
-	return __register_shrinker(shrinker);
-}
-#endif
-EXPORT_SYMBOL(register_shrinker);
-
-/*
- * Remove one
- */
-void unregister_shrinker(struct shrinker *shrinker)
-{
-	struct dentry *debugfs_entry;
-	int debugfs_id;
-
-	if (!(shrinker->flags & SHRINKER_REGISTERED))
-		return;
-
-	down_write(&shrinker_rwsem);
-	list_del(&shrinker->list);
-	shrinker->flags &= ~SHRINKER_REGISTERED;
-	if (shrinker->flags & SHRINKER_MEMCG_AWARE)
-		unregister_memcg_shrinker(shrinker);
-	debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);
-	up_write(&shrinker_rwsem);
-
-	shrinker_debugfs_remove(debugfs_entry, debugfs_id);
-
-	kfree(shrinker->nr_deferred);
-	shrinker->nr_deferred = NULL;
-}
-EXPORT_SYMBOL(unregister_shrinker);
-
-/**
- * synchronize_shrinkers - Wait for all running shrinkers to complete.
- *
- * This is equivalent to calling unregister_shrink() and register_shrinker(),
- * but atomically and with less overhead. This is useful to guarantee that all
- * shrinker invocations have seen an update, before freeing memory, similar to
- * rcu.
- */
-void synchronize_shrinkers(void)
-{
-	down_write(&shrinker_rwsem);
-	up_write(&shrinker_rwsem);
-}
-EXPORT_SYMBOL(synchronize_shrinkers);
-
-#define SHRINK_BATCH 128
-
-static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
-				    struct shrinker *shrinker, int priority)
-{
-	unsigned long freed = 0;
-	unsigned long long delta;
-	long total_scan;
-	long freeable;
-	long nr;
-	long new_nr;
-	long batch_size = shrinker->batch ? shrinker->batch
-					  : SHRINK_BATCH;
-	long scanned = 0, next_deferred;
-
-	freeable = shrinker->count_objects(shrinker, shrinkctl);
-	if (freeable == 0 || freeable == SHRINK_EMPTY)
-		return freeable;
-
-	/*
-	 * copy the current shrinker scan count into a local variable
-	 * and zero it so that other concurrent shrinker invocations
-	 * don't also do this scanning work.
-	 */
-	nr = xchg_nr_deferred(shrinker, shrinkctl);
-
-	if (shrinker->seeks) {
-		delta = freeable >> priority;
-		delta *= 4;
-		do_div(delta, shrinker->seeks);
-	} else {
-		/*
-		 * These objects don't require any IO to create. Trim
-		 * them aggressively under memory pressure to keep
-		 * them from causing refetches in the IO caches.
-		 */
-		delta = freeable / 2;
-	}
-
-	total_scan = nr >> priority;
-	total_scan += delta;
-	total_scan = min(total_scan, (2 * freeable));
-
-	trace_mm_shrink_slab_start(shrinker, shrinkctl, nr,
-				   freeable, delta, total_scan, priority);
-
-	/*
-	 * Normally, we should not scan less than batch_size objects in one
-	 * pass to avoid too frequent shrinker calls, but if the slab has less
-	 * than batch_size objects in total and we are really tight on memory,
-	 * we will try to reclaim all available objects, otherwise we can end
-	 * up failing allocations although there are plenty of reclaimable
-	 * objects spread over several slabs with usage less than the
-	 * batch_size.
-	 *
-	 * We detect the "tight on memory" situations by looking at the total
-	 * number of objects we want to scan (total_scan). If it is greater
-	 * than the total number of objects on slab (freeable), we must be
-	 * scanning at high prio and therefore should try to reclaim as much as
-	 * possible.
-	 */
-	while (total_scan >= batch_size ||
-	       total_scan >= freeable) {
-		unsigned long ret;
-		unsigned long nr_to_scan = min(batch_size, total_scan);
-
-		shrinkctl->nr_to_scan = nr_to_scan;
-		shrinkctl->nr_scanned = nr_to_scan;
-		ret = shrinker->scan_objects(shrinker, shrinkctl);
-		if (ret == SHRINK_STOP)
-			break;
-		freed += ret;
-
-		count_vm_events(SLABS_SCANNED, shrinkctl->nr_scanned);
-		total_scan -= shrinkctl->nr_scanned;
-		scanned += shrinkctl->nr_scanned;
-
-		cond_resched();
-	}
-
-	/*
-	 * The deferred work is increased by any new work (delta) that wasn't
-	 * done, decreased by old deferred work that was done now.
-	 *
-	 * And it is capped to two times of the freeable items.
-	 */
-	next_deferred = max_t(long, (nr + delta - scanned), 0);
-	next_deferred = min(next_deferred, (2 * freeable));
-
-	/*
-	 * move the unused scan count back into the shrinker in a
-	 * manner that handles concurrent updates.
-	 */
-	new_nr = add_nr_deferred(next_deferred, shrinker, shrinkctl);
-
-	trace_mm_shrink_slab_end(shrinker, shrinkctl->nid, freed, nr, new_nr, total_scan);
-	return freed;
-}
-
-#ifdef CONFIG_MEMCG
-static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
-			struct mem_cgroup *memcg, int priority)
-{
-	struct shrinker_info *info;
-	unsigned long ret, freed = 0;
-	int i;
-
-	if (!mem_cgroup_online(memcg))
-		return 0;
-
-	if (!down_read_trylock(&shrinker_rwsem))
-		return 0;
-
-	info = shrinker_info_protected(memcg, nid);
-	if (unlikely(!info))
-		goto unlock;
-
-	for_each_set_bit(i, info->map, info->map_nr_max) {
-		struct shrink_control sc = {
-			.gfp_mask = gfp_mask,
-			.nid = nid,
-			.memcg = memcg,
-		};
-		struct shrinker *shrinker;
-
-		shrinker = idr_find(&shrinker_idr, i);
-		if (unlikely(!shrinker || !(shrinker->flags & SHRINKER_REGISTERED))) {
-			if (!shrinker)
-				clear_bit(i, info->map);
-			continue;
-		}
-
-		/* Call non-slab shrinkers even though kmem is disabled */
-		if (!memcg_kmem_online() &&
-		    !(shrinker->flags & SHRINKER_NONSLAB))
-			continue;
-
-		ret = do_shrink_slab(&sc, shrinker, priority);
-		if (ret == SHRINK_EMPTY) {
-			clear_bit(i, info->map);
-			/*
-			 * After the shrinker reported that it had no objects to
-			 * free, but before we cleared the corresponding bit in
-			 * the memcg shrinker map, a new object might have been
-			 * added. To make sure, we have the bit set in this
-			 * case, we invoke the shrinker one more time and reset
-			 * the bit if it reports that it is not empty anymore.
-			 * The memory barrier here pairs with the barrier in
-			 * set_shrinker_bit():
-			 *
-			 * list_lru_add()     shrink_slab_memcg()
-			 *   list_add_tail()    clear_bit()
-			 *   <MB>               <MB>
-			 *   set_bit()          do_shrink_slab()
-			 */
-			smp_mb__after_atomic();
-			ret = do_shrink_slab(&sc, shrinker, priority);
-			if (ret == SHRINK_EMPTY)
-				ret = 0;
-			else
-				set_shrinker_bit(memcg, nid, i);
-		}
-		freed += ret;
-
-		if (rwsem_is_contended(&shrinker_rwsem)) {
-			freed = freed ? : 1;
-			break;
-		}
-	}
-unlock:
-	up_read(&shrinker_rwsem);
-	return freed;
-}
-#else /* CONFIG_MEMCG */
-static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
-			struct mem_cgroup *memcg, int priority)
-{
-	return 0;
-}
-#endif /* CONFIG_MEMCG */
-
-/**
- * shrink_slab - shrink slab caches
- * @gfp_mask: allocation context
- * @nid: node whose slab caches to target
- * @memcg: memory cgroup whose slab caches to target
- * @priority: the reclaim priority
- *
- * Call the shrink functions to age shrinkable caches.
- *
- * @nid is passed along to shrinkers with SHRINKER_NUMA_AWARE set,
- * unaware shrinkers will receive a node id of 0 instead.
- *
- * @memcg specifies the memory cgroup to target. Unaware shrinkers
- * are called only if it is the root cgroup.
- *
- * @priority is sc->priority, we take the number of objects and >> by priority
- * in order to get the scan target.
- *
- * Returns the number of reclaimed slab objects.
- */
-static unsigned long shrink_slab(gfp_t gfp_mask, int nid,
-				 struct mem_cgroup *memcg,
-				 int priority)
-{
-	unsigned long ret, freed = 0;
-	struct shrinker *shrinker;
-
-	/*
-	 * The root memcg might be allocated even though memcg is disabled
-	 * via "cgroup_disable=memory" boot parameter.  This could make
-	 * mem_cgroup_is_root() return false, then just run memcg slab
-	 * shrink, but skip global shrink.  This may result in premature
-	 * oom.
-	 */
-	if (!mem_cgroup_disabled() && !mem_cgroup_is_root(memcg))
-		return shrink_slab_memcg(gfp_mask, nid, memcg, priority);
-
-	if (!down_read_trylock(&shrinker_rwsem))
-		goto out;
-
-	list_for_each_entry(shrinker, &shrinker_list, list) {
-		struct shrink_control sc = {
-			.gfp_mask = gfp_mask,
-			.nid = nid,
-			.memcg = memcg,
-		};
-
-		ret = do_shrink_slab(&sc, shrinker, priority);
-		if (ret == SHRINK_EMPTY)
-			ret = 0;
-		freed += ret;
-		/*
-		 * Bail out if someone want to register a new shrinker to
-		 * prevent the registration from being stalled for long periods
-		 * by parallel ongoing shrinking.
-		 */
-		if (rwsem_is_contended(&shrinker_rwsem)) {
-			freed = freed ? : 1;
-			break;
-		}
-	}
-
-	up_read(&shrinker_rwsem);
-out:
-	cond_resched();
-	return freed;
-}
-
 static unsigned long drop_slab_node(int nid)
 {
 	unsigned long freed = 0;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:06:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:06:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570838.893099 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw19-0002Ev-47; Thu, 27 Jul 2023 08:06:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570838.893099; Thu, 27 Jul 2023 08:06:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw19-0002Ek-1F; Thu, 27 Jul 2023 08:06:39 +0000
Received: by outflank-mailman (input) for mailman id 570838;
 Thu, 27 Jul 2023 08:06:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw18-0001DS-Ne
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:06:38 +0000
Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com
 [2607:f8b0:4864:20::432])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 825f735c-2c54-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:06:38 +0200 (CEST)
Received: by mail-pf1-x432.google.com with SMTP id
 d2e1a72fcca58-6862d4a1376so188273b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:06:38 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.06.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:06:36 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 825f735c-2c54-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445196; x=1691049996;
        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=5ddhCZTkz2TFo7oGCFzg4uU7nrLecafIDKLLill2eh8=;
        b=EEgKRQyP19rDGzyMkxrAyrND65/av9N1ZEpraFKdjf5iHd/PgC9Uhy/xnwzeo3ff8l
         m3TJD5UzpvFEDeBzcRtJtOD/qHmmEUSLFJuussVMd7PAkAK7iQKGftfC2f44nNeUEfJr
         mKle0CkHpRLYz5sWKpGW6Zb4t5WjMo/pANabwTgogYiGmsOD2+fKJGiw7ZJ36fC4jq2K
         1KqECLKCfE0K//MR+hlNLb+3ZgY7viYlU4DaknQaSi+VFe2dV+fDBnzCaNkdmNFv1cVa
         f6nuMbduVm+LsREYRbVVclCckYchB0Qi+6OZAWegvIeaDdeHomKe1HhIBSolAxF7uDUX
         dSVQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445196; x=1691049996;
        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=5ddhCZTkz2TFo7oGCFzg4uU7nrLecafIDKLLill2eh8=;
        b=KpkhO3ib/ws80p6i3aibXDdWBdgk3DYmWAj0z6lv+56SSVfX/aOUqYImOle7oWbxWO
         jnLHdtQvfpxRt16w5zqJcZDxQXkBnsPzpuWwAcgUPfX8JehTZmGD4zHkeE5TxAED5MaO
         nv3Xr+HjHcrTvtR4vmDNkg4adKwp+qzuPWb97/xG5mmqNCOOQwfo2KSq78MDnlkcWn+P
         GH8WlUAfXLAo7qmmxfHcW44ssfePwgnPsGGivpI6T8r5sztzPuGmIwKL2M7+Nz7ZQKl5
         gbmO7Vu6AjhYLZWJ/Y6ftlWsFOj/3NNmzKpdWddf7/AXcZ8/5cxxc9ud9tXc5BYDABhT
         sF9A==
X-Gm-Message-State: ABy/qLYdL06Sw92fJyb9wPT1vJ3ivi1wTsUDxDzIzyaAj3IDCDjy8HdZ
	EbwASkp9W+I18nx31w9ybhrE4w==
X-Google-Smtp-Source: APBJJlGC9GcjpF//RTfgHk/e3ibfMuX5WCzda5QO/QIZ+yDcAz1vV0DX9dFwhd70yzWPOAQ384luFQ==
X-Received: by 2002:a05:6a21:6da1:b0:134:1671:6191 with SMTP id wl33-20020a056a216da100b0013416716191mr5882289pzb.0.1690445196605;
        Thu, 27 Jul 2023 01:06:36 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 04/49] mm: shrinker: remove redundant shrinker_rwsem in debugfs operations
Date: Thu, 27 Jul 2023 16:04:17 +0800
Message-Id: <20230727080502.77895-5-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The debugfs_remove_recursive() will wait for debugfs_file_put() to return,
so the shrinker will not be freed when doing debugfs operations (such as
shrinker_debugfs_count_show() and shrinker_debugfs_scan_write()), so there
is no need to hold shrinker_rwsem during debugfs operations.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 mm/shrinker_debug.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/mm/shrinker_debug.c b/mm/shrinker_debug.c
index 3ab53fad8876..f1becfd45853 100644
--- a/mm/shrinker_debug.c
+++ b/mm/shrinker_debug.c
@@ -55,11 +55,6 @@ static int shrinker_debugfs_count_show(struct seq_file *m, void *v)
 	if (!count_per_node)
 		return -ENOMEM;
 
-	ret = down_read_killable(&shrinker_rwsem);
-	if (ret) {
-		kfree(count_per_node);
-		return ret;
-	}
 	rcu_read_lock();
 
 	memcg_aware = shrinker->flags & SHRINKER_MEMCG_AWARE;
@@ -92,7 +87,6 @@ static int shrinker_debugfs_count_show(struct seq_file *m, void *v)
 	} while ((memcg = mem_cgroup_iter(NULL, memcg, NULL)) != NULL);
 
 	rcu_read_unlock();
-	up_read(&shrinker_rwsem);
 
 	kfree(count_per_node);
 	return ret;
@@ -117,7 +111,6 @@ static ssize_t shrinker_debugfs_scan_write(struct file *file,
 	struct mem_cgroup *memcg = NULL;
 	int nid;
 	char kbuf[72];
-	ssize_t ret;
 
 	read_len = size < (sizeof(kbuf) - 1) ? size : (sizeof(kbuf) - 1);
 	if (copy_from_user(kbuf, buf, read_len))
@@ -146,12 +139,6 @@ static ssize_t shrinker_debugfs_scan_write(struct file *file,
 		return -EINVAL;
 	}
 
-	ret = down_read_killable(&shrinker_rwsem);
-	if (ret) {
-		mem_cgroup_put(memcg);
-		return ret;
-	}
-
 	sc.nid = nid;
 	sc.memcg = memcg;
 	sc.nr_to_scan = nr_to_scan;
@@ -159,7 +146,6 @@ static ssize_t shrinker_debugfs_scan_write(struct file *file,
 
 	shrinker->scan_objects(shrinker, &sc);
 
-	up_read(&shrinker_rwsem);
 	mem_cgroup_put(memcg);
 
 	return size;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:06:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:06:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570842.893109 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw1P-0002q2-Cv; Thu, 27 Jul 2023 08:06:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570842.893109; Thu, 27 Jul 2023 08:06:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw1P-0002pt-AH; Thu, 27 Jul 2023 08:06:55 +0000
Received: by outflank-mailman (input) for mailman id 570842;
 Thu, 27 Jul 2023 08:06:54 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw1O-0000Tn-3j
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:06:54 +0000
Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com
 [2607:f8b0:4864:20::430])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8a77b17e-2c54-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:06:51 +0200 (CEST)
Received: by mail-pf1-x430.google.com with SMTP id
 d2e1a72fcca58-6862d4a1376so188337b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:06:51 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.06.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:06:48 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8a77b17e-2c54-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445210; x=1691050010;
        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=BqN9tp9prAKwSL/xaaZwvgP8yGlZqKh7lkz65rMIkwI=;
        b=GBN6icr0hE5mqHPTJBEmQxE0sSmLZpA0St1dP4Z/yKynevT5W5Jxqj0TR7Mr4urM6a
         rcvFQA+K57yE1B1k6K85qRXWvWixdU3NSLe4VzCycF5GoWTLlRciA5X2RKhqi0HQoE8b
         1a0IYfWezvO06Io3dLOeFyq1ZqsXTQYxhrgkmMYVYzQ0UKpbC4ibvswUM8qhqUbr7+wb
         uRN2A2UnEH8zWwCm8m7EgP4dOqoYkNd5OlXdJtG3fRVi7RhcVNJSFfLr6LMTE1C8b+sp
         ezPa3QCc3RdGZTkOuGv4gf4U4junA2Kk+3yhYNlyx/A90D5GFHra7wi3SwF/mLuKqPhB
         hHsQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445210; x=1691050010;
        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=BqN9tp9prAKwSL/xaaZwvgP8yGlZqKh7lkz65rMIkwI=;
        b=dbrfhHwRHymirwnotjv1S0oCnPJG4+SD8kecGAPOhRLG0RT6MMnakSrqNncmPUd1kE
         onTDLHUKBRpUeSvbUelevWAEc/g0fGvdxMCGmbnY8RTM3Hm/7N7hacPlrHZ2kucSIkrN
         55yr8Vxe66D7YX51xazHWwYNxbzNZhvdm+tOcBuB0h/Szqw6XmTbojIbcyVbtGSntFjY
         sJVs8U3xPhmp8WXT5cFnBjHGeA1GKF+Uo06BfI5tXzPTkRF2DMvpCRtYgN+ntcqIkooS
         hfBmbTIwf7/trW4dSwBHD3wPUf5t52cnj6cQQvenPQS0PFoD+h/6wMKLEXDfID1/KWLK
         w7Yw==
X-Gm-Message-State: ABy/qLZ+S86UDskfSWrbMqTwH8xYBZjwMyV3AsaHLLa86bWj6828f+h7
	Yb11T2xgUEnvZq9OOUUusOmvPw==
X-Google-Smtp-Source: APBJJlGqyHUGzcwYP72gZn72jBkXTN2mSwLe5z3KDdW3R9YyUcC+gdVHx8KhimUXzhfrGyXx8SlIVg==
X-Received: by 2002:a05:6a20:918e:b0:11a:dbb3:703b with SMTP id v14-20020a056a20918e00b0011adbb3703bmr5539836pzd.6.1690445210111;
        Thu, 27 Jul 2023 01:06:50 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v3 05/49] mm: shrinker: add infrastructure for dynamically allocating shrinker
Date: Thu, 27 Jul 2023 16:04:18 +0800
Message-Id: <20230727080502.77895-6-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Currently, the shrinker instances can be divided into the following three
types:

a) global shrinker instance statically defined in the kernel, such as
   workingset_shadow_shrinker.

b) global shrinker instance statically defined in the kernel modules, such
   as mmu_shrinker in x86.

c) shrinker instance embedded in other structures.

For case a, the memory of shrinker instance is never freed. For case b,
the memory of shrinker instance will be freed after synchronize_rcu() when
the module is unloaded. For case c, the memory of shrinker instance will
be freed along with the structure it is embedded in.

In preparation for implementing lockless slab shrink, we need to
dynamically allocate those shrinker instances in case c, then the memory
can be dynamically freed alone by calling kfree_rcu().

So this commit adds the following new APIs for dynamically allocating
shrinker, and add a private_data field to struct shrinker to record and
get the original embedded structure.

1. shrinker_alloc()

Used to allocate shrinker instance itself and related memory, it will
return a pointer to the shrinker instance on success and NULL on failure.

2. shrinker_register()

Used to register the shrinker instance, which is same as the current
register_shrinker_prepared().

3. shrinker_free()

Used to unregister (if needed) and free the shrinker instance.

In order to simplify shrinker-related APIs and make shrinker more
independent of other kernel mechanisms, subsequent submissions will use
the above API to convert all shrinkers (including case a and b) to
dynamically allocated, and then remove all existing APIs.

This will also have another advantage mentioned by Dave Chinner:

```
The other advantage of this is that it will break all the existing
out of tree code and third party modules using the old API and will
no longer work with a kernel using lockless slab shrinkers. They
need to break (both at the source and binary levels) to stop bad
things from happening due to using uncoverted shrinkers in the new
setup.
```

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 include/linux/shrinker.h |   7 +++
 mm/internal.h            |  11 +++++
 mm/shrinker.c            | 101 +++++++++++++++++++++++++++++++++++++++
 mm/shrinker_debug.c      |  17 ++++++-
 4 files changed, 134 insertions(+), 2 deletions(-)

diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
index 8dc15aa37410..cc23ff0aee20 100644
--- a/include/linux/shrinker.h
+++ b/include/linux/shrinker.h
@@ -70,6 +70,8 @@ struct shrinker {
 	int seeks;	/* seeks to recreate an obj */
 	unsigned flags;
 
+	void *private_data;
+
 	/* These are for internal use */
 	struct list_head list;
 #ifdef CONFIG_MEMCG
@@ -95,6 +97,11 @@ struct shrinker {
  * non-MEMCG_AWARE shrinker should not have this flag set.
  */
 #define SHRINKER_NONSLAB	(1 << 3)
+#define SHRINKER_ALLOCATED	(1 << 4)
+
+struct shrinker *shrinker_alloc(unsigned int flags, const char *fmt, ...);
+void shrinker_register(struct shrinker *shrinker);
+void shrinker_free(struct shrinker *shrinker);
 
 extern int __printf(2, 3) prealloc_shrinker(struct shrinker *shrinker,
 					    const char *fmt, ...);
diff --git a/mm/internal.h b/mm/internal.h
index 8b82038dcc6a..38434175df86 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -1144,6 +1144,9 @@ unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
 
 #ifdef CONFIG_SHRINKER_DEBUG
 extern int shrinker_debugfs_add(struct shrinker *shrinker);
+extern int shrinker_debugfs_name_alloc(struct shrinker *shrinker,
+				       const char *fmt, va_list ap);
+extern void shrinker_debugfs_name_free(struct shrinker *shrinker);
 extern struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
 					      int *debugfs_id);
 extern void shrinker_debugfs_remove(struct dentry *debugfs_entry,
@@ -1153,6 +1156,14 @@ static inline int shrinker_debugfs_add(struct shrinker *shrinker)
 {
 	return 0;
 }
+static inline int shrinker_debugfs_name_alloc(struct shrinker *shrinker,
+					      const char *fmt, va_list ap)
+{
+	return 0;
+}
+static inline void shrinker_debugfs_name_free(struct shrinker *shrinker)
+{
+}
 static inline struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
 						     int *debugfs_id)
 {
diff --git a/mm/shrinker.c b/mm/shrinker.c
index 043c87ccfab4..43a375f954f3 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -550,6 +550,107 @@ unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
 	return freed;
 }
 
+struct shrinker *shrinker_alloc(unsigned int flags, const char *fmt, ...)
+{
+	struct shrinker *shrinker;
+	unsigned int size;
+	va_list ap;
+	int err;
+
+	shrinker = kzalloc(sizeof(struct shrinker), GFP_KERNEL);
+	if (!shrinker)
+		return NULL;
+
+	va_start(ap, fmt);
+	err = shrinker_debugfs_name_alloc(shrinker, fmt, ap);
+	va_end(ap);
+	if (err)
+		goto err_name;
+
+	shrinker->flags = flags | SHRINKER_ALLOCATED;
+
+	if (flags & SHRINKER_MEMCG_AWARE) {
+		err = prealloc_memcg_shrinker(shrinker);
+		if (err == -ENOSYS)
+			shrinker->flags &= ~SHRINKER_MEMCG_AWARE;
+		else if (err == 0)
+			goto done;
+		else
+			goto err_flags;
+	}
+
+	/*
+	 * The nr_deferred is available on per memcg level for memcg aware
+	 * shrinkers, so only allocate nr_deferred in the following cases:
+	 *  - non memcg aware shrinkers
+	 *  - !CONFIG_MEMCG
+	 *  - memcg is disabled by kernel command line
+	 */
+	size = sizeof(*shrinker->nr_deferred);
+	if (flags & SHRINKER_NUMA_AWARE)
+		size *= nr_node_ids;
+
+	shrinker->nr_deferred = kzalloc(size, GFP_KERNEL);
+	if (!shrinker->nr_deferred)
+		goto err_flags;
+
+done:
+	return shrinker;
+
+err_flags:
+	shrinker_debugfs_name_free(shrinker);
+err_name:
+	kfree(shrinker);
+	return NULL;
+}
+EXPORT_SYMBOL_GPL(shrinker_alloc);
+
+void shrinker_register(struct shrinker *shrinker)
+{
+	if (unlikely(!(shrinker->flags & SHRINKER_ALLOCATED))) {
+		pr_warn("Must use shrinker_alloc() to dynamically allocate the shrinker");
+		return;
+	}
+
+	down_write(&shrinker_rwsem);
+	list_add_tail(&shrinker->list, &shrinker_list);
+	shrinker->flags |= SHRINKER_REGISTERED;
+	shrinker_debugfs_add(shrinker);
+	up_write(&shrinker_rwsem);
+}
+EXPORT_SYMBOL_GPL(shrinker_register);
+
+void shrinker_free(struct shrinker *shrinker)
+{
+	struct dentry *debugfs_entry = NULL;
+	int debugfs_id;
+
+	if (!shrinker)
+		return;
+
+	down_write(&shrinker_rwsem);
+	if (shrinker->flags & SHRINKER_REGISTERED) {
+		list_del(&shrinker->list);
+		debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);
+		shrinker->flags &= ~SHRINKER_REGISTERED;
+	} else {
+		shrinker_debugfs_name_free(shrinker);
+	}
+
+	if (shrinker->flags & SHRINKER_MEMCG_AWARE)
+		unregister_memcg_shrinker(shrinker);
+	up_write(&shrinker_rwsem);
+
+	if (debugfs_entry)
+		shrinker_debugfs_remove(debugfs_entry, debugfs_id);
+
+	kfree(shrinker->nr_deferred);
+	shrinker->nr_deferred = NULL;
+
+	kfree(shrinker);
+}
+EXPORT_SYMBOL_GPL(shrinker_free);
+
 /*
  * Add a shrinker callback to be called from the vm.
  */
diff --git a/mm/shrinker_debug.c b/mm/shrinker_debug.c
index f1becfd45853..506257585408 100644
--- a/mm/shrinker_debug.c
+++ b/mm/shrinker_debug.c
@@ -191,6 +191,20 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
 	return 0;
 }
 
+int shrinker_debugfs_name_alloc(struct shrinker *shrinker, const char *fmt,
+				va_list ap)
+{
+	shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
+
+	return shrinker->name ? 0 : -ENOMEM;
+}
+
+void shrinker_debugfs_name_free(struct shrinker *shrinker)
+{
+	kfree_const(shrinker->name);
+	shrinker->name = NULL;
+}
+
 int shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...)
 {
 	struct dentry *entry;
@@ -239,8 +253,7 @@ struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
 
 	lockdep_assert_held(&shrinker_rwsem);
 
-	kfree_const(shrinker->name);
-	shrinker->name = NULL;
+	shrinker_debugfs_name_free(shrinker);
 
 	*debugfs_id = entry ? shrinker->debugfs_id : -1;
 	shrinker->debugfs_entry = NULL;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:07:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:07:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570844.893119 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw1Z-0003Kb-K7; Thu, 27 Jul 2023 08:07:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570844.893119; Thu, 27 Jul 2023 08:07:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw1Z-0003KP-HU; Thu, 27 Jul 2023 08:07:05 +0000
Received: by outflank-mailman (input) for mailman id 570844;
 Thu, 27 Jul 2023 08:07:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw1Y-0001DS-4f
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:07:04 +0000
Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com
 [2607:f8b0:4864:20::435])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 91ab0368-2c54-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:07:03 +0200 (CEST)
Received: by mail-pf1-x435.google.com with SMTP id
 d2e1a72fcca58-6748a616e17so182441b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:07:03 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.06.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:07:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 91ab0368-2c54-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445222; x=1691050022;
        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=hJ9OcOwqZEZhIoLNGrov7as0vMS5t1dTfm2Sm9qefJI=;
        b=AioCATUlkHfrdNMX26y5cMG8yiZzcrqJVPo4kMJoo0a/SPBGZMItYxbURGlfK0qQ3U
         pdquqHjvBnBibcfcPa96/7pchRYEBHxyNnf24E8fTswl7dwSe4DIa81z6/ovJRcM58gW
         OCn1XGDPuwokH00bwAsXcK1Gr5D3vpz/ZXjhjYJknWBgLZAbQPwFGeGyEdzXyVgOqH5z
         Y8WwL8gpftvasBEeZpl0cei4t7+d2ZCdr5qxpBrrzaVJwzr8lwB/25SUTyxKcTGn9xox
         E7xpcSMCUuenHibKLxGm6dPJne0R4y90eWbLKKoQI9m29dm8UqZ2/hC+L12FcXTeAlus
         bdTQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445222; x=1691050022;
        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=hJ9OcOwqZEZhIoLNGrov7as0vMS5t1dTfm2Sm9qefJI=;
        b=IlHdMEw+rgnFb/oOmqdzwjaGP0E+SruBA7w9Wr97O8ui3b1GZXncLmJU8ewdULS2cX
         twfWr3L8bv22+S9IdEOEeOlqFxkGXaRIrGX6ay/WcfWQht1O13xkMpoNiq2C4Ccn5jB/
         QJj3xHwPqDh+TUagjPPuQ0q2KPyrHOoZDBbm34DKgIFdfbQRz7bGE88kPOFUjU1KLA7S
         4D0UR2MK5PMN/elSrAIWidGpchVYJ21Aw1gTQcoIQCfdtits/qm23akWA6GlaquCEEgL
         ogxGCPJhaytrplmN4OX4yyjInr9vYa3buKHQ376181uBihZKa6C8/D7NIoVTelvATerf
         rf6A==
X-Gm-Message-State: ABy/qLZLc+7Ln1t08SXHTE6uLu08Tzfy0LRckq+WURCaaFyqgFJ6FvWy
	D7/mhHZYWcGDz4KB/0XO7YqWYQ==
X-Google-Smtp-Source: APBJJlEQjBlPfpR5V6JAfBPtQGnM4uH9f200On7b1qJi/VneGv5RiS5uPlFi7ClY0YXsCiY0kjcbBw==
X-Received: by 2002:aa7:8615:0:b0:681:9fe0:b543 with SMTP id p21-20020aa78615000000b006819fe0b543mr4619538pfn.2.1690445222261;
        Thu, 27 Jul 2023 01:07:02 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 06/49] kvm: mmu: dynamically allocate the x86-mmu shrinker
Date: Thu, 27 Jul 2023 16:04:19 +0800
Message-Id: <20230727080502.77895-7-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the x86-mmu shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 arch/x86/kvm/mmu/mmu.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index ec169f5c7dce..15fc92a24a26 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -6847,11 +6847,7 @@ static unsigned long mmu_shrink_count(struct shrinker *shrink,
 	return percpu_counter_read_positive(&kvm_total_used_mmu_pages);
 }
 
-static struct shrinker mmu_shrinker = {
-	.count_objects = mmu_shrink_count,
-	.scan_objects = mmu_shrink_scan,
-	.seeks = DEFAULT_SEEKS * 10,
-};
+static struct shrinker *mmu_shrinker;
 
 static void mmu_destroy_caches(void)
 {
@@ -6984,10 +6980,16 @@ int kvm_mmu_vendor_module_init(void)
 	if (percpu_counter_init(&kvm_total_used_mmu_pages, 0, GFP_KERNEL))
 		goto out;
 
-	ret = register_shrinker(&mmu_shrinker, "x86-mmu");
-	if (ret)
+	mmu_shrinker = shrinker_alloc(0, "x86-mmu");
+	if (!mmu_shrinker)
 		goto out_shrinker;
 
+	mmu_shrinker->count_objects = mmu_shrink_count;
+	mmu_shrinker->scan_objects = mmu_shrink_scan;
+	mmu_shrinker->seeks = DEFAULT_SEEKS * 10;
+
+	shrinker_register(mmu_shrinker);
+
 	return 0;
 
 out_shrinker:
@@ -7009,7 +7011,7 @@ void kvm_mmu_vendor_module_exit(void)
 {
 	mmu_destroy_caches();
 	percpu_counter_destroy(&kvm_total_used_mmu_pages);
-	unregister_shrinker(&mmu_shrinker);
+	shrinker_free(mmu_shrinker);
 }
 
 /*
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:07:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:07:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570845.893128 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw1k-0003uM-Rx; Thu, 27 Jul 2023 08:07:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570845.893128; Thu, 27 Jul 2023 08:07:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw1k-0003uA-OR; Thu, 27 Jul 2023 08:07:16 +0000
Received: by outflank-mailman (input) for mailman id 570845;
 Thu, 27 Jul 2023 08:07:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw1j-0001DS-U7
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:07:15 +0000
Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com
 [2607:f8b0:4864:20::433])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 98a60b38-2c54-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:07:15 +0200 (CEST)
Received: by mail-pf1-x433.google.com with SMTP id
 d2e1a72fcca58-6748a616e17so182492b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:07:15 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.07.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:07:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 98a60b38-2c54-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445234; x=1691050034;
        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=YQ2nJ797AaeiRC4tEbuFSwr/qroaEGD64TBkJX9gwcc=;
        b=krf0rRSBuACihGG0HOfvmWM3fExNQmmDQBZSFypO9OF26g2F9IRQXNjarXAj+rDJ2F
         j6wi8ORGszAJ8F4/2B5RfozFOO9c5wQvkPuwF+U0dnMIFYzI2u+dIV518lO0Mey/M0g+
         DAIhAFbNX4boMgnEYCrLvSqMruXRlIM+AwHL8QP9OXWtql9jawORm8JA9K2pNt2CM3by
         1AI1wCMU2elwBWzc8zmddDhb5S57BlUFVrs7Qpu26KSs608fAqSWn4u6Hcxn6Nu/AYp6
         eAYr/PxpZmg2LEli6lhHn6OsT6FdGj3gL7SNMtigAeYxmILx7EQ2Lx+oYLfIsw664x5Q
         hi2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445234; x=1691050034;
        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=YQ2nJ797AaeiRC4tEbuFSwr/qroaEGD64TBkJX9gwcc=;
        b=X95cG6rPCP0rstvpjT0/lw88JgM0VDu1zU0JCXR+GtTfYb2O++85M9QC0Pgz/17vyx
         F6Bs1d33mETYjGbd+mqUGoy0v98+mxcwK1NunT2naYtdNlAwSMXa4u22OLRjWgTYKsVr
         yApVFGdlx59fPZf6hC8uNzqrT9Q/Yo4GR6cfe3a5ZxqZoN4rwzMvVYq649bbeNd72rTl
         xDKC1/RAxht3OKxBz291kp/pkP93T59lXpju5OaidV/E0Vo6ROULugi+VN0erQhTuOBs
         aYFiBLdMAJ6XgglBGxDkrnaSZdkZU4+S25UF/pnGbp8IqqEH6FWNqk2eIE/tqRyZ8bOh
         QSoA==
X-Gm-Message-State: ABy/qLaUIvyGEks/kLRvpa+trkCGO+ajiDQEKqyXBqHxQgpIEGKEp57z
	Qk5H4mXilpjFHnDKhCuYycEfGw==
X-Google-Smtp-Source: APBJJlExJjCwBoW4B5netumBOqdfs5+SJLDXxiJ/1dno6haNjCE+wUan/A+nwEsop7KuM9iLlMTgjA==
X-Received: by 2002:a05:6a20:918e:b0:11a:dbb3:703b with SMTP id v14-20020a056a20918e00b0011adbb3703bmr5540739pzd.6.1690445233998;
        Thu, 27 Jul 2023 01:07:13 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v3 07/49] binder: dynamically allocate the android-binder shrinker
Date: Thu, 27 Jul 2023 16:04:20 +0800
Message-Id: <20230727080502.77895-8-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the android-binder shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 drivers/android/binder_alloc.c | 31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
index e3db8297095a..62675cedd38e 100644
--- a/drivers/android/binder_alloc.c
+++ b/drivers/android/binder_alloc.c
@@ -1053,11 +1053,7 @@ binder_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
 			    NULL, sc->nr_to_scan);
 }
 
-static struct shrinker binder_shrinker = {
-	.count_objects = binder_shrink_count,
-	.scan_objects = binder_shrink_scan,
-	.seeks = DEFAULT_SEEKS,
-};
+static struct shrinker *binder_shrinker;
 
 /**
  * binder_alloc_init() - called by binder_open() for per-proc initialization
@@ -1077,19 +1073,30 @@ void binder_alloc_init(struct binder_alloc *alloc)
 
 int binder_alloc_shrinker_init(void)
 {
-	int ret = list_lru_init(&binder_alloc_lru);
+	int ret;
 
-	if (ret == 0) {
-		ret = register_shrinker(&binder_shrinker, "android-binder");
-		if (ret)
-			list_lru_destroy(&binder_alloc_lru);
+	ret = list_lru_init(&binder_alloc_lru);
+	if (ret)
+		return ret;
+
+	binder_shrinker = shrinker_alloc(0, "android-binder");
+	if (!binder_shrinker) {
+		list_lru_destroy(&binder_alloc_lru);
+		return -ENOMEM;
 	}
-	return ret;
+
+	binder_shrinker->count_objects = binder_shrink_count;
+	binder_shrinker->scan_objects = binder_shrink_scan;
+	binder_shrinker->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(binder_shrinker);
+
+	return 0;
 }
 
 void binder_alloc_shrinker_exit(void)
 {
-	unregister_shrinker(&binder_shrinker);
+	shrinker_free(binder_shrinker);
 	list_lru_destroy(&binder_alloc_lru);
 }
 
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:07:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:07:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570849.893139 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw1z-0004eV-AR; Thu, 27 Jul 2023 08:07:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570849.893139; Thu, 27 Jul 2023 08:07:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw1z-0004eG-6I; Thu, 27 Jul 2023 08:07:31 +0000
Received: by outflank-mailman (input) for mailman id 570849;
 Thu, 27 Jul 2023 08:07:29 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw1x-0000Tn-Rq
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:07:29 +0000
Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com
 [2607:f8b0:4864:20::432])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a002fc58-2c54-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:07:28 +0200 (CEST)
Received: by mail-pf1-x432.google.com with SMTP id
 d2e1a72fcca58-686f74a8992so77396b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:07:28 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.07.14
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:07:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a002fc58-2c54-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445246; x=1691050046;
        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=ppdDbzxLfV7T8uyJ0+LWzuRMVQS50F9BO9dGotbDPbU=;
        b=KpqQJYQnD6XZcHjbv/+muTq0vlYb8upK5OWv1aGKt50KKzUi7i+JzF6oBUUsqnnZ8J
         r8wNd0ItebBMmbL+7PFob82/siVz2lcTITJgiPWkofH/9LJHrT7eh309V59HxxQ0mOlE
         DIoyoSTd+eeARDBsSwfCZZT+D1eJ9vMkwqGXz/n2dx2kEZLuZLLaNunG9PbX3wXH0AxZ
         KS3Doj3WekVbT+DS1JWdAAgXSNDy2XRSFj8TbzZy0Apg5FVE8T/dZYbRy2KedtCvtde/
         VVp4H8rT9xtwGwXR6cSDDmcPYDcWy0CdFKjtAgYv/8XnYUvwEF4uwit6TMoEpzOExIim
         mxxA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445246; x=1691050046;
        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=ppdDbzxLfV7T8uyJ0+LWzuRMVQS50F9BO9dGotbDPbU=;
        b=BoL7dOFWH4Zc0q+U2+7qcNg6I1XAtHIlmWiUkuKw+FbOkufw9kFFBiZL2dQnGai2B0
         cc6SpWa/0zLbJLZ+yUykLl4uwtos3QNAJUMkA0IyvhaW+XLA136mRJBW28t/9uAMbFW8
         T1rwP/d0cwSIswBCGNfMFIUwc08Zx1BZxBsKPj8Tv/XO8bWMX3llfH/KO3iM4MWHlZh2
         65zzT9lJlI+vsDr90PWBVcIGuVwrLKk2zGFAElDKxQvdsJvjiTzEbJrgvnmbmxNxg7Ny
         2RPIQAShc0XUz/HyQfcWGVCz4Ww44a4PhFibXylgpF5wP/GB3hb/78ZHmaDtNEE1kd3Y
         OpLg==
X-Gm-Message-State: ABy/qLYiXzRFCetgm5IoDw1LsEwMkc8mmLe5c3S8WGVHK3sPFR8REFQE
	Q1wfMDwToyZuSFSGFtPDlhrCuQ==
X-Google-Smtp-Source: APBJJlG6gnRngQzsFbw9KnzolcByCK3s/MKtuzn55eodinGMlyRsxgSHfIHEIFN3Q1pZ+W9H3PfVAg==
X-Received: by 2002:a05:6a00:2b90:b0:67d:308b:97ef with SMTP id dv16-20020a056a002b9000b0067d308b97efmr4583872pfb.2.1690445246349;
        Thu, 27 Jul 2023 01:07:26 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 08/49] drm/ttm: dynamically allocate the drm-ttm_pool shrinker
Date: Thu, 27 Jul 2023 16:04:21 +0800
Message-Id: <20230727080502.77895-9-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the drm-ttm_pool shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 drivers/gpu/drm/ttm/ttm_pool.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
index cddb9151d20f..c9c9618c0dce 100644
--- a/drivers/gpu/drm/ttm/ttm_pool.c
+++ b/drivers/gpu/drm/ttm/ttm_pool.c
@@ -73,7 +73,7 @@ static struct ttm_pool_type global_dma32_uncached[MAX_ORDER + 1];
 
 static spinlock_t shrinker_lock;
 static struct list_head shrinker_list;
-static struct shrinker mm_shrinker;
+static struct shrinker *mm_shrinker;
 
 /* Allocate pages of size 1 << order with the given gfp_flags */
 static struct page *ttm_pool_alloc_page(struct ttm_pool *pool, gfp_t gfp_flags,
@@ -734,8 +734,8 @@ static int ttm_pool_debugfs_shrink_show(struct seq_file *m, void *data)
 	struct shrink_control sc = { .gfp_mask = GFP_NOFS };
 
 	fs_reclaim_acquire(GFP_KERNEL);
-	seq_printf(m, "%lu/%lu\n", ttm_pool_shrinker_count(&mm_shrinker, &sc),
-		   ttm_pool_shrinker_scan(&mm_shrinker, &sc));
+	seq_printf(m, "%lu/%lu\n", ttm_pool_shrinker_count(mm_shrinker, &sc),
+		   ttm_pool_shrinker_scan(mm_shrinker, &sc));
 	fs_reclaim_release(GFP_KERNEL);
 
 	return 0;
@@ -779,10 +779,17 @@ int ttm_pool_mgr_init(unsigned long num_pages)
 			    &ttm_pool_debugfs_shrink_fops);
 #endif
 
-	mm_shrinker.count_objects = ttm_pool_shrinker_count;
-	mm_shrinker.scan_objects = ttm_pool_shrinker_scan;
-	mm_shrinker.seeks = 1;
-	return register_shrinker(&mm_shrinker, "drm-ttm_pool");
+	mm_shrinker = shrinker_alloc(0, "drm-ttm_pool");
+	if (!mm_shrinker)
+		return -ENOMEM;
+
+	mm_shrinker->count_objects = ttm_pool_shrinker_count;
+	mm_shrinker->scan_objects = ttm_pool_shrinker_scan;
+	mm_shrinker->seeks = 1;
+
+	shrinker_register(mm_shrinker);
+
+	return 0;
 }
 
 /**
@@ -802,6 +809,6 @@ void ttm_pool_mgr_fini(void)
 		ttm_pool_type_fini(&global_dma32_uncached[i]);
 	}
 
-	unregister_shrinker(&mm_shrinker);
+	shrinker_free(mm_shrinker);
 	WARN_ON(!list_empty(&shrinker_list));
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:08:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:08:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570852.893148 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw2y-0005W0-Jn; Thu, 27 Jul 2023 08:08:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570852.893148; Thu, 27 Jul 2023 08:08:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw2y-0005Vt-HH; Thu, 27 Jul 2023 08:08:32 +0000
Received: by outflank-mailman (input) for mailman id 570852;
 Thu, 27 Jul 2023 08:08:32 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw2y-0005Vh-1S
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:08:32 +0000
Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com
 [2607:f8b0:4864:20::435])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c51907b5-2c54-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:08:30 +0200 (CEST)
Received: by mail-pf1-x435.google.com with SMTP id
 d2e1a72fcca58-686f6231bdeso112710b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:08:30 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.08.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:08:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c51907b5-2c54-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445308; x=1691050108;
        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=PjmSZHUI5/Kx8ZOfBbo02iydikdUH/y22dszJBbwnrc=;
        b=Xysv3RsPsBshttSMBUyUOf01pFj7ACJomxAeSKClYNtUM/IzDnc+1qcVpxKo3Yk7lI
         PMJO/0QAsBuNTHH31vZSyAI+mqZzOZhxUKyEZ0z882UMy5ds0dV7wjv4n79QhgQIluxL
         7aiFKUJGI5uVRXEWRoqfDwEepuojrPx+nt9lSRf3+jabTyI60DcKdVq5RfgL5+gSsYt+
         gIHfo7xL/z2KDHdpCbDlWUD9Wlzvl0HFxAouF/jEEZTs97EVMQFcZk2wLBhFoNV93wDr
         cOODQ3G+tMDc7b4BNamRJNYxJL3PiF9jIw3/5zQqa59OSVfyqIzXn4AyZmUz4TWVr103
         SUHw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445308; x=1691050108;
        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=PjmSZHUI5/Kx8ZOfBbo02iydikdUH/y22dszJBbwnrc=;
        b=DPvImIYWBukbraitExO3cq0n0+LzAjgi0dsSNIEf0g5Ih3Ae76YPDIarD+8NCzEdTZ
         DOFgDxbaoRZbFio+QnSme4JCuqXe6c8RlIdA9I+i4uvUdNODUxvUgqkMIYDXIkwA8AJT
         pcw2ZutVdwlxw1TSXwJMU523bbU2/L3SIZ9J3wtH/eAa6G0eJtxp6Ow0nZRGiGuxHkYe
         1YFjyOk+lPhWihSr3K/LueJmbNui3hQHXm7iNUH6t5cilwnX4ElSXlqfFYv4enMROZ8p
         cO+1hKKY6Xy19wIwrwbeu7efFVJv+E6f1HHDtAamhDr+tZAbQq8pNBnpGqKB8su8XWgR
         hz2Q==
X-Gm-Message-State: ABy/qLaP93D1i5eVVSTG05ZbVidAPJYESeMKV699midUr61FV5/VXzsI
	UsdzY1bkx++DRDBydUaXeE+wnQ==
X-Google-Smtp-Source: APBJJlEap1sNysOWJSQnWaDnt336ll2X4eQUWxGjP7f0SXFaJg3Iw5H2LPNpa2qt6BR3D4CNzXfNwg==
X-Received: by 2002:a05:6a00:4a0e:b0:677:3439:874a with SMTP id do14-20020a056a004a0e00b006773439874amr5196539pfb.3.1690445308627;
        Thu, 27 Jul 2023 01:08:28 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v3 13/49] gfs2: dynamically allocate the gfs2-qd shrinker
Date: Thu, 27 Jul 2023 16:04:26 +0800
Message-Id: <20230727080502.77895-14-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the gfs2-qd shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 fs/gfs2/main.c  |  6 +++---
 fs/gfs2/quota.c | 26 ++++++++++++++++++++------
 fs/gfs2/quota.h |  3 ++-
 3 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
index afcb32854f14..e47b1cc79f59 100644
--- a/fs/gfs2/main.c
+++ b/fs/gfs2/main.c
@@ -147,7 +147,7 @@ static int __init init_gfs2_fs(void)
 	if (!gfs2_trans_cachep)
 		goto fail_cachep8;
 
-	error = register_shrinker(&gfs2_qd_shrinker, "gfs2-qd");
+	error = gfs2_qd_shrinker_init();
 	if (error)
 		goto fail_shrinker;
 
@@ -196,7 +196,7 @@ static int __init init_gfs2_fs(void)
 fail_wq2:
 	destroy_workqueue(gfs_recovery_wq);
 fail_wq1:
-	unregister_shrinker(&gfs2_qd_shrinker);
+	gfs2_qd_shrinker_exit();
 fail_shrinker:
 	kmem_cache_destroy(gfs2_trans_cachep);
 fail_cachep8:
@@ -229,7 +229,7 @@ static int __init init_gfs2_fs(void)
 
 static void __exit exit_gfs2_fs(void)
 {
-	unregister_shrinker(&gfs2_qd_shrinker);
+	gfs2_qd_shrinker_exit();
 	gfs2_glock_exit();
 	gfs2_unregister_debugfs();
 	unregister_filesystem(&gfs2_fs_type);
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index aa5fd06d47bc..6cbf323bc4d0 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -186,13 +186,27 @@ static unsigned long gfs2_qd_shrink_count(struct shrinker *shrink,
 	return vfs_pressure_ratio(list_lru_shrink_count(&gfs2_qd_lru, sc));
 }
 
-struct shrinker gfs2_qd_shrinker = {
-	.count_objects = gfs2_qd_shrink_count,
-	.scan_objects = gfs2_qd_shrink_scan,
-	.seeks = DEFAULT_SEEKS,
-	.flags = SHRINKER_NUMA_AWARE,
-};
+static struct shrinker *gfs2_qd_shrinker;
+
+int __init gfs2_qd_shrinker_init(void)
+{
+	gfs2_qd_shrinker = shrinker_alloc(SHRINKER_NUMA_AWARE, "gfs2-qd");
+	if (!gfs2_qd_shrinker)
+		return -ENOMEM;
+
+	gfs2_qd_shrinker->count_objects = gfs2_qd_shrink_count;
+	gfs2_qd_shrinker->scan_objects = gfs2_qd_shrink_scan;
+	gfs2_qd_shrinker->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(gfs2_qd_shrinker);
 
+	return 0;
+}
+
+void gfs2_qd_shrinker_exit(void)
+{
+	shrinker_free(gfs2_qd_shrinker);
+}
 
 static u64 qd2index(struct gfs2_quota_data *qd)
 {
diff --git a/fs/gfs2/quota.h b/fs/gfs2/quota.h
index 21ada332d555..f0d54dcbbc75 100644
--- a/fs/gfs2/quota.h
+++ b/fs/gfs2/quota.h
@@ -59,7 +59,8 @@ static inline int gfs2_quota_lock_check(struct gfs2_inode *ip,
 }
 
 extern const struct quotactl_ops gfs2_quotactl_ops;
-extern struct shrinker gfs2_qd_shrinker;
+int __init gfs2_qd_shrinker_init(void);
+void gfs2_qd_shrinker_exit(void);
 extern struct list_lru gfs2_qd_lru;
 extern void __init gfs2_quota_hash_init(void);
 
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:08:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:08:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570854.893159 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw3M-00063b-So; Thu, 27 Jul 2023 08:08:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570854.893159; Thu, 27 Jul 2023 08:08:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw3M-00063U-PF; Thu, 27 Jul 2023 08:08:56 +0000
Received: by outflank-mailman (input) for mailman id 570854;
 Thu, 27 Jul 2023 08:08:55 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw3L-0005Vh-Ml
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:08:55 +0000
Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com
 [2607:f8b0:4864:20::42c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d3799171-2c54-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:08:54 +0200 (CEST)
Received: by mail-pf1-x42c.google.com with SMTP id
 d2e1a72fcca58-686f74a8992so77591b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:08:54 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.08.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:08:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d3799171-2c54-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445332; x=1691050132;
        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=9TzzNXWnGUC4v0Im6lZC1fetjV0NX81rj7dQA53Eb1w=;
        b=fVbo4B1Sn0AGX1nNJK0Eo1gukSsful8PC6Tpi9R2ay4P+tk9frdioPsIm2s6rPxi46
         ++BpYvSQrpfhaqWc0rmuBFjQPz0zzH5N+AGXb67rsChsvEkjfu687Mjmoln0lCJnbS1t
         S6gxfZ/pYInNuKorknrCkgDtrsNJQ+5b+KQpVkQdCPQpNRB6D3agySMM3uM99/xhPotu
         rAoYyPnK20sDnc7vY5XomSSW5p6ngHpl0qbTjtgeFdhf5V6H8EL0+GE/5QBEhSY2aRe8
         CqIfoMbQ3ZACqieIYGVBf+Lq9zLueZGm5ISvf4EF/2FFF37Zi67sB1q+1Y4ZesHEzWZS
         zb1w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445332; x=1691050132;
        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=9TzzNXWnGUC4v0Im6lZC1fetjV0NX81rj7dQA53Eb1w=;
        b=Lyv+PyUCnP4yKg893kPTVDNcdc/0k/WVQsByLBqbrPWmML9NA/b6YAnNkoxsEZtVSx
         NUrv8KEDxruLzgZH4JG/gdVeN0wMgENt8FzxBl5+wv5qvqyxd5Xgbbp3fRV1f8ehL4vm
         /p7X1sPTT8PNC/ps888WEpGZcYoARz16jjoawJ5H1ZoD6cBNWdh3XPt9SIi7XqRForWH
         tQxkc5uHRbl6rYZ2uNgmhf4J1vVKXkahSsZHYY6C4a8RotEKgMy8cu9wgKTz05fSLmP6
         K27NYpqq2GXMytfMrIgJUUQs/YnlxhojGcrEQK1h79Msn/t2YF7lX1/ODpyFh1hkHbkG
         WbpQ==
X-Gm-Message-State: ABy/qLbucnOywEqheuaNGWEvrOdgSMX3l+KFhXq5Di/RxJAUjdk73vSX
	+Efwiq6Te/MATh9ioUfbfQrjjg==
X-Google-Smtp-Source: APBJJlFfoYzSpk6JWYRi+8IvWqqU5f15Mb/GG4zvV09auI3h1+KA8DLVYcizqJGa8aoS7uGFfDYCtA==
X-Received: by 2002:a05:6a00:488e:b0:677:bb4c:c321 with SMTP id dk14-20020a056a00488e00b00677bb4cc321mr4639246pfb.0.1690445332713;
        Thu, 27 Jul 2023 01:08:52 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 15/49] nfs: dynamically allocate the nfs-acl shrinker
Date: Thu, 27 Jul 2023 16:04:28 +0800
Message-Id: <20230727080502.77895-16-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the nfs-acl shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 fs/nfs/super.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 2284f749d892..072d82e1be06 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -129,11 +129,7 @@ static void nfs_ssc_unregister_ops(void)
 }
 #endif /* CONFIG_NFS_V4_2 */
 
-static struct shrinker acl_shrinker = {
-	.count_objects	= nfs_access_cache_count,
-	.scan_objects	= nfs_access_cache_scan,
-	.seeks		= DEFAULT_SEEKS,
-};
+static struct shrinker *acl_shrinker;
 
 /*
  * Register the NFS filesystems
@@ -153,9 +149,17 @@ int __init register_nfs_fs(void)
 	ret = nfs_register_sysctl();
 	if (ret < 0)
 		goto error_2;
-	ret = register_shrinker(&acl_shrinker, "nfs-acl");
-	if (ret < 0)
+
+	acl_shrinker = shrinker_alloc(0, "nfs-acl");
+	if (!acl_shrinker)
 		goto error_3;
+
+	acl_shrinker->count_objects = nfs_access_cache_count;
+	acl_shrinker->scan_objects = nfs_access_cache_scan;
+	acl_shrinker->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(acl_shrinker);
+
 #ifdef CONFIG_NFS_V4_2
 	nfs_ssc_register_ops();
 #endif
@@ -175,7 +179,7 @@ int __init register_nfs_fs(void)
  */
 void __exit unregister_nfs_fs(void)
 {
-	unregister_shrinker(&acl_shrinker);
+	shrinker_free(acl_shrinker);
 	nfs_unregister_sysctl();
 	unregister_nfs4_fs();
 #ifdef CONFIG_NFS_V4_2
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:09:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:09:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570855.893169 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw3l-0006Zf-4T; Thu, 27 Jul 2023 08:09:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570855.893169; Thu, 27 Jul 2023 08:09:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw3l-0006ZY-1V; Thu, 27 Jul 2023 08:09:21 +0000
Received: by outflank-mailman (input) for mailman id 570855;
 Thu, 27 Jul 2023 08:09:19 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw3j-0005Vh-RS
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:09:19 +0000
Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com
 [2607:f8b0:4864:20::42c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e1d5d31c-2c54-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:09:18 +0200 (CEST)
Received: by mail-pf1-x42c.google.com with SMTP id
 d2e1a72fcca58-686f6231bdeso112893b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:09:18 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.09.05
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:09:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e1d5d31c-2c54-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445357; x=1691050157;
        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=1//FAyntSoVVhHGcFkYF5rOUv8OYZDaOr/FI52lXs1g=;
        b=WprFfHhwxvgCbIOGEhvz/77THpnE+uaWMbMuLLIIDpVeL3Jz2616v8wLFkzo7HZvSd
         TNFFTtJffBxh3fLTgZ0hA52iTzwFJ1lb7YC8GT96AcRGLEmRK6UnsPg5TF0WeT/gBbXI
         n3D8mngVfbe3MYXC32UZAJFJiGuaHBVIWM9CunOWIYu990kGDPAj43N4rpm3m8rpgsHd
         02xW2JacWcelFq3TAnDCLUfDJo66VYYZvDcSFvyxJpg5YwEtAXcJf/FphGWJu7IrCr2v
         NhF0NyS2ftTWJJ0Gd6+a6tHW0SZpG4hIgkFC42XLIYM9ZEOFnWGm8ZzCwBndTMQ8KaY8
         M1zg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445357; x=1691050157;
        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=1//FAyntSoVVhHGcFkYF5rOUv8OYZDaOr/FI52lXs1g=;
        b=bOGLjYdLS0gut4AL2V7vDysHIdtah1JRh4DaOcBI0ODqs9qsRFkODZ5elNPhTeLuxY
         FWdZOplQ08gG3IE+zj/a2auZiteRH9im4r552i2vu8i92CdjA4lJMQnoOMLr9Tsd84WK
         P4Hb2ObmKasFdpYOx46K1oZNY77Xphd30dpwAs8lxPZpdN3kuVKQ0ZegcEqC7SKamCdB
         fuNSkgXBv7uJwqPNmbbLUm1Qj630akFWawv8ovA3RZmiZMNaluI+UW4Eqa/EtYqhK8Nf
         cYvuwJcE2tta42lKO46PwjIassDqhnLidhouRx68IBD7BTTfays6P5IekqHS74W1AVnf
         suvw==
X-Gm-Message-State: ABy/qLbcyFZevcvhx5bYSSn6RSHUc0SB0qxEx99IQ7ys7vzAxpll+OBS
	TvU8dcRk3oeOu/qJzDP4PJjBHg==
X-Google-Smtp-Source: APBJJlHvmYnqUEfQMupLlQUSLLnEPxVICkIYSDMBUwnFYoQAuRxCEO7ekKLA8kJr4NX0LnRrY6UJ3A==
X-Received: by 2002:a05:6a00:13a3:b0:676:2a5c:7bc5 with SMTP id t35-20020a056a0013a300b006762a5c7bc5mr5229938pfg.1.1690445356761;
        Thu, 27 Jul 2023 01:09:16 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 17/49] quota: dynamically allocate the dquota-cache shrinker
Date: Thu, 27 Jul 2023 16:04:30 +0800
Message-Id: <20230727080502.77895-18-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the dquota-cache shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 fs/quota/dquot.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index e8232242dd34..8883e6992f7c 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -791,12 +791,6 @@ dqcache_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
 	percpu_counter_read_positive(&dqstats.counter[DQST_FREE_DQUOTS]));
 }
 
-static struct shrinker dqcache_shrinker = {
-	.count_objects = dqcache_shrink_count,
-	.scan_objects = dqcache_shrink_scan,
-	.seeks = DEFAULT_SEEKS,
-};
-
 /*
  * Safely release dquot and put reference to dquot.
  */
@@ -2957,6 +2951,7 @@ static int __init dquot_init(void)
 {
 	int i, ret;
 	unsigned long nr_hash, order;
+	struct shrinker *dqcache_shrinker;
 
 	printk(KERN_NOTICE "VFS: Disk quotas %s\n", __DQUOT_VERSION__);
 
@@ -2991,8 +2986,15 @@ static int __init dquot_init(void)
 	pr_info("VFS: Dquot-cache hash table entries: %ld (order %ld,"
 		" %ld bytes)\n", nr_hash, order, (PAGE_SIZE << order));
 
-	if (register_shrinker(&dqcache_shrinker, "dquota-cache"))
-		panic("Cannot register dquot shrinker");
+	dqcache_shrinker = shrinker_alloc(0, "dquota-cache");
+	if (!dqcache_shrinker)
+		panic("Cannot allocate dquot shrinker");
+
+	dqcache_shrinker->count_objects = dqcache_shrink_count;
+	dqcache_shrinker->scan_objects = dqcache_shrink_scan;
+	dqcache_shrinker->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(dqcache_shrinker);
 
 	return 0;
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:09:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:09:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570856.893179 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw3y-0006zT-Bq; Thu, 27 Jul 2023 08:09:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570856.893179; Thu, 27 Jul 2023 08:09:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw3y-0006z3-8p; Thu, 27 Jul 2023 08:09:34 +0000
Received: by outflank-mailman (input) for mailman id 570856;
 Thu, 27 Jul 2023 08:09:32 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw3w-0005Vh-JJ
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:09:32 +0000
Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com
 [2607:f8b0:4864:20::433])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e96888dd-2c54-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:09:31 +0200 (CEST)
Received: by mail-pf1-x433.google.com with SMTP id
 d2e1a72fcca58-682b1768a0bso174988b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:09:30 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.09.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:09:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e96888dd-2c54-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445369; x=1691050169;
        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=et7oKjMo2RpAm9eGe6PO8KzXkO6yMET8jj6KuxhxE1o=;
        b=ZArGb8yz+8ycxhYpd3TfnObsbskAktwxKp/LK6E+gx1lOsm2QqxHLjO1qFt766mx4G
         4UOFzMb5rOBT3wq7QpcOo/50dqnABPqLouzBdNx69dJP3kndLHofbdJgcQSOE87tIEP3
         gOFIB0th/ApJ4utKzdT3r6irRm20AGsjylo629bfexLkXBuL+hMcZdtnwSmPAtxRA7F8
         l3r/R789CkvCTacsaPitu2Mn9fHBZCoAT7Xd7Py97lY3Lp4c0X3H7O8uSS1JwsanI4Cy
         Pf3LZprk/pnZjQej6Xzx3T3CJ+QGRGxZd7LUmSV8XGImv+0X4BPv+EIagOcfGqekhivR
         Bv+Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445369; x=1691050169;
        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=et7oKjMo2RpAm9eGe6PO8KzXkO6yMET8jj6KuxhxE1o=;
        b=Uqxq1PNqQg5M+u6b4EIpc4ClaBoGkJMh5LfXEq0bg3TPQBgDJH72W9g0BbTZEZ8K6l
         1cEIWJJB9oYzQRLR1GuXIakCzKOqp1HRCUA3PLEN7MYJ1wnx9oI1pALItfEgWfW0NS09
         QB4fnZOw19L++6cWlJUmrPMvboHPlJqd3MKUN1TCngf72CYp/KvuWxm1sRR/CtyZf8Ii
         KJp8qijCvu1w6wdUXlpu0m/g0UDbaUhVLu2rl2k/twg5YvQdPXjFc5INhbp5U7I7eR06
         ZyYor+9Uez9Cc2AKZFEe7d5yL88vZ/KPEGX2mFnWrYWvVj63NPp0wcctdtUJOybFXDwG
         PD0w==
X-Gm-Message-State: ABy/qLZu5KG8s8XOvKHR5g7Id6ru0QnHXhXXD4PSl4GAtGZ86/nKiV7A
	cd9cVVtNHEAcGNX2jf2A1lWyVg==
X-Google-Smtp-Source: APBJJlGUbAM65UTyBU06poLXl/mtaX6EX5YDf65AxeW9rsxnsdAR4xxA054nRzBMt6Eu4ihj5O0Oaw==
X-Received: by 2002:a05:6a20:7da5:b0:137:3941:17b3 with SMTP id v37-20020a056a207da500b00137394117b3mr5573135pzj.6.1690445369382;
        Thu, 27 Jul 2023 01:09:29 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 18/49] ubifs: dynamically allocate the ubifs-slab shrinker
Date: Thu, 27 Jul 2023 16:04:31 +0800
Message-Id: <20230727080502.77895-19-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the ubifs-slab shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 fs/ubifs/super.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index b08fb28d16b5..c690782388a8 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -54,11 +54,7 @@ module_param_cb(default_version, &ubifs_default_version_ops, &ubifs_default_vers
 static struct kmem_cache *ubifs_inode_slab;
 
 /* UBIFS TNC shrinker description */
-static struct shrinker ubifs_shrinker_info = {
-	.scan_objects = ubifs_shrink_scan,
-	.count_objects = ubifs_shrink_count,
-	.seeks = DEFAULT_SEEKS,
-};
+static struct shrinker *ubifs_shrinker_info;
 
 /**
  * validate_inode - validate inode.
@@ -2373,7 +2369,7 @@ static void inode_slab_ctor(void *obj)
 
 static int __init ubifs_init(void)
 {
-	int err;
+	int err = -ENOMEM;
 
 	BUILD_BUG_ON(sizeof(struct ubifs_ch) != 24);
 
@@ -2439,10 +2435,16 @@ static int __init ubifs_init(void)
 	if (!ubifs_inode_slab)
 		return -ENOMEM;
 
-	err = register_shrinker(&ubifs_shrinker_info, "ubifs-slab");
-	if (err)
+	ubifs_shrinker_info = shrinker_alloc(0, "ubifs-slab");
+	if (!ubifs_shrinker_info)
 		goto out_slab;
 
+	ubifs_shrinker_info->count_objects = ubifs_shrink_count;
+	ubifs_shrinker_info->scan_objects = ubifs_shrink_scan;
+	ubifs_shrinker_info->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(ubifs_shrinker_info);
+
 	err = ubifs_compressors_init();
 	if (err)
 		goto out_shrinker;
@@ -2467,7 +2469,7 @@ static int __init ubifs_init(void)
 	dbg_debugfs_exit();
 	ubifs_compressors_exit();
 out_shrinker:
-	unregister_shrinker(&ubifs_shrinker_info);
+	shrinker_free(ubifs_shrinker_info);
 out_slab:
 	kmem_cache_destroy(ubifs_inode_slab);
 	return err;
@@ -2483,7 +2485,7 @@ static void __exit ubifs_exit(void)
 	dbg_debugfs_exit();
 	ubifs_sysfs_exit();
 	ubifs_compressors_exit();
-	unregister_shrinker(&ubifs_shrinker_info);
+	shrinker_free(ubifs_shrinker_info);
 
 	/*
 	 * Make sure all delayed rcu free inodes are flushed before we
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:10:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:10:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570858.893189 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw4X-00009j-QC; Thu, 27 Jul 2023 08:10:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570858.893189; Thu, 27 Jul 2023 08:10:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw4X-00009Z-NR; Thu, 27 Jul 2023 08:10:09 +0000
Received: by outflank-mailman (input) for mailman id 570858;
 Thu, 27 Jul 2023 08:10:08 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw4W-0005Vh-Iy
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:10:08 +0000
Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com
 [2607:f8b0:4864:20::436])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id febf9b3f-2c54-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:10:06 +0200 (CEST)
Received: by mail-pf1-x436.google.com with SMTP id
 d2e1a72fcca58-6862d4a1376so189008b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:10:06 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.09.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:10:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: febf9b3f-2c54-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445405; x=1691050205;
        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=zAZIQD5LE19JLWIPx8KiiULhQHk9tWBr8sqfFcta/MI=;
        b=NqYwP+7q26BX+05EQAE55Kus0VTZ4uDrn8hA+JsQeQZJT9fqe02P3PtEqTbWL+ex0x
         YIFFlprB9LN8XpWOyzBWvs6bF2o1el7zRiKvHm2Vd5z2Or8QA2PiX1E8ylBDH7Szeeh9
         /iQcvqB1l/KdO3epgECrqpXSIR/s/RJamq92lbZYEsjapR5/FUExLIHgiZunap4eHVCx
         zA39TmQ89NL3AupWiP9iOshQQO6k89rLp1YMDCuDF8tqw1FNGVEm51b05cxcsW4A6ycO
         oxBBen2ORAG64Kh5EsfwftGMbRswk1n9HcylImCxbc9GAVmkCHyiC5Q0TKVbaeRFnqta
         TxEw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445405; x=1691050205;
        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=zAZIQD5LE19JLWIPx8KiiULhQHk9tWBr8sqfFcta/MI=;
        b=QbzMAGoczIfyXl5S8CxvYiK4v2mFWMbHhLd7bpOQ7pFqQURzvYM5nUZ6PJMgRs6+jf
         w5Sa6HeCn10PGYBvIM6LXcVwWzIaKR6JZEXGkn3zXahWslGueul4qmQ6k0rx2/KfIwXN
         yTb/smojVnVm8WKWtxwkRFz3+rjgFkJjDrrpOK3trsLHhSAb3fYc5K0K9vB6uP8w9sxm
         GbQx6fgo1h1+jQZMq3r3r0zYOxLycUMHp8gow2FqhICIv/tOVQZ77nKncntenMYNHYVJ
         ZY3s8NA3xyUV7qP/rznyiISPDnNjBOqvXf1X+bpEEKwB7matBDPX8RgYQNKaq3exZD8Z
         YaXw==
X-Gm-Message-State: ABy/qLZLE3UONh3kxhQEpPd5lRyip7QdppI2UXpCh+jDYrOuk7+JX5qi
	Ss19lSoVgjZAoAOYH9ugayDYoA==
X-Google-Smtp-Source: APBJJlGpZH0OiKzZvwM26WklEwoVdvnyU6bL6rc8uFjIqbOYU7fWKIX23eNXK117O9K5uschqUp2Jg==
X-Received: by 2002:a05:6a00:4a83:b0:679:a1f1:a5f8 with SMTP id dr3-20020a056a004a8300b00679a1f1a5f8mr4623296pfb.3.1690445405268;
        Thu, 27 Jul 2023 01:10:05 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v3 21/49] mm: thp: dynamically allocate the thp-related shrinkers
Date: Thu, 27 Jul 2023 16:04:34 +0800
Message-Id: <20230727080502.77895-22-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the thp-zero and thp-deferred_split
shrinkers.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 mm/huge_memory.c | 69 +++++++++++++++++++++++++++++++-----------------
 1 file changed, 45 insertions(+), 24 deletions(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index e371503f7746..a0dbb55b4913 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -65,7 +65,11 @@ unsigned long transparent_hugepage_flags __read_mostly =
 	(1<<TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG)|
 	(1<<TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG);
 
-static struct shrinker deferred_split_shrinker;
+static struct shrinker *deferred_split_shrinker;
+static unsigned long deferred_split_count(struct shrinker *shrink,
+					  struct shrink_control *sc);
+static unsigned long deferred_split_scan(struct shrinker *shrink,
+					 struct shrink_control *sc);
 
 static atomic_t huge_zero_refcount;
 struct page *huge_zero_page __read_mostly;
@@ -229,11 +233,7 @@ static unsigned long shrink_huge_zero_page_scan(struct shrinker *shrink,
 	return 0;
 }
 
-static struct shrinker huge_zero_page_shrinker = {
-	.count_objects = shrink_huge_zero_page_count,
-	.scan_objects = shrink_huge_zero_page_scan,
-	.seeks = DEFAULT_SEEKS,
-};
+static struct shrinker *huge_zero_page_shrinker;
 
 #ifdef CONFIG_SYSFS
 static ssize_t enabled_show(struct kobject *kobj,
@@ -454,6 +454,40 @@ static inline void hugepage_exit_sysfs(struct kobject *hugepage_kobj)
 }
 #endif /* CONFIG_SYSFS */
 
+static int __init thp_shrinker_init(void)
+{
+	huge_zero_page_shrinker = shrinker_alloc(0, "thp-zero");
+	if (!huge_zero_page_shrinker)
+		return -ENOMEM;
+
+	deferred_split_shrinker = shrinker_alloc(SHRINKER_NUMA_AWARE |
+						 SHRINKER_MEMCG_AWARE |
+						 SHRINKER_NONSLAB,
+						 "thp-deferred_split");
+	if (!deferred_split_shrinker) {
+		shrinker_free(huge_zero_page_shrinker);
+		return -ENOMEM;
+	}
+
+	huge_zero_page_shrinker->count_objects = shrink_huge_zero_page_count;
+	huge_zero_page_shrinker->scan_objects = shrink_huge_zero_page_scan;
+	huge_zero_page_shrinker->seeks = DEFAULT_SEEKS;
+	shrinker_register(huge_zero_page_shrinker);
+
+	deferred_split_shrinker->count_objects = deferred_split_count;
+	deferred_split_shrinker->scan_objects = deferred_split_scan;
+	deferred_split_shrinker->seeks = DEFAULT_SEEKS;
+	shrinker_register(deferred_split_shrinker);
+
+	return 0;
+}
+
+static void __init thp_shrinker_exit(void)
+{
+	shrinker_free(huge_zero_page_shrinker);
+	shrinker_free(deferred_split_shrinker);
+}
+
 static int __init hugepage_init(void)
 {
 	int err;
@@ -482,12 +516,9 @@ static int __init hugepage_init(void)
 	if (err)
 		goto err_slab;
 
-	err = register_shrinker(&huge_zero_page_shrinker, "thp-zero");
-	if (err)
-		goto err_hzp_shrinker;
-	err = register_shrinker(&deferred_split_shrinker, "thp-deferred_split");
+	err = thp_shrinker_init();
 	if (err)
-		goto err_split_shrinker;
+		goto err_shrinker;
 
 	/*
 	 * By default disable transparent hugepages on smaller systems,
@@ -505,10 +536,8 @@ static int __init hugepage_init(void)
 
 	return 0;
 err_khugepaged:
-	unregister_shrinker(&deferred_split_shrinker);
-err_split_shrinker:
-	unregister_shrinker(&huge_zero_page_shrinker);
-err_hzp_shrinker:
+	thp_shrinker_exit();
+err_shrinker:
 	khugepaged_destroy();
 err_slab:
 	hugepage_exit_sysfs(hugepage_kobj);
@@ -2833,7 +2862,7 @@ void deferred_split_folio(struct folio *folio)
 #ifdef CONFIG_MEMCG
 		if (memcg)
 			set_shrinker_bit(memcg, folio_nid(folio),
-					 deferred_split_shrinker.id);
+					 deferred_split_shrinker->id);
 #endif
 	}
 	spin_unlock_irqrestore(&ds_queue->split_queue_lock, flags);
@@ -2907,14 +2936,6 @@ static unsigned long deferred_split_scan(struct shrinker *shrink,
 	return split;
 }
 
-static struct shrinker deferred_split_shrinker = {
-	.count_objects = deferred_split_count,
-	.scan_objects = deferred_split_scan,
-	.seeks = DEFAULT_SEEKS,
-	.flags = SHRINKER_NUMA_AWARE | SHRINKER_MEMCG_AWARE |
-		 SHRINKER_NONSLAB,
-};
-
 #ifdef CONFIG_DEBUG_FS
 static void split_huge_pages_all(void)
 {
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:10:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:10:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570859.893199 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw4v-0000i7-2G; Thu, 27 Jul 2023 08:10:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570859.893199; Thu, 27 Jul 2023 08:10:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw4u-0000i0-Vh; Thu, 27 Jul 2023 08:10:32 +0000
Received: by outflank-mailman (input) for mailman id 570859;
 Thu, 27 Jul 2023 08:10:32 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw4u-0005Vh-6J
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:10:32 +0000
Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com
 [2607:f8b0:4864:20::436])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0cf55329-2c55-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:10:30 +0200 (CEST)
Received: by mail-pf1-x436.google.com with SMTP id
 d2e1a72fcca58-686f74a8992so77879b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:10:30 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.10.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:10:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0cf55329-2c55-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445429; x=1691050229;
        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=uDu/4z0sff3MNLq2Hem41DvJLtW9HR7Ht2OY0+o3IBw=;
        b=iVGfsyXkMcKNuSj4S4+ETT1e5FnNKRSLwcupS7aKQrOa2P/cg11EPb/fa7MepSVN0c
         souD70V3XZBCWCF1GY2G8kOBoazYK/GwCZP5iJVITEwRi2CFhPhtCnmN6NHRYDRfscjM
         ei11bn/3SqGlS2cI+uWxsIZ60GgV8/Th1+KRHAcGdOM/vcClXnAdg9IcKu5dXKtmCkaz
         1Uv1368bMlurEfH1GvebpNgAfjlYTQWl+OVWRYv+SAitVhKYxMqk7I6vstlqXAV5ZTFg
         13mCns35aGRuj+msRJnkqY3lYp1C9AqbhcZNDVttxslcFzKIxthPN+0g8mDIqHh31rTQ
         XhNA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445429; x=1691050229;
        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=uDu/4z0sff3MNLq2Hem41DvJLtW9HR7Ht2OY0+o3IBw=;
        b=h8x7d0IF7UOBd6HFjTCgoZYhJ7nelUszyK0cM5JGe4S5iZlGVERlJnOHfqpH7JNSAo
         Tg0Ku9E6ijTzooB7sWQ7qlxLkwLw9RZ6QVYuSu6oeQmYb05FeDZ0nf9z047K9BOvGyEW
         gufeyhyXu4XJGtAhbl28rCpt8uok9ILwJlLK5YK1L7Ov3Zz3vyTm3LfUcyIqcFjQ8zOc
         1HWdvU9PLs7lLd+D91C9HYFDkcnzx8JhWNlKF5nF5Tpi/rgESja90b3zg82MmoOnb6ij
         3/lLjwmicErKkgBOy0lHRb4dNZFsC42BJLkzi5sCB3q7fGQUNF4qVUj60LPWjbwtuDq5
         4FXw==
X-Gm-Message-State: ABy/qLajoh3MWymY/TKOPJyDYYAzT7FJqA6gQQrQ2s+Ohli279wuCi++
	IkHZoinxNYA3R69GLWPtPRBCTg==
X-Google-Smtp-Source: APBJJlHGswV8UzzwdSNooBFOlXCa2QxTNwcJjWEIeOA/B6KtVME+e61/tgitLanHgBraDSTbcyHPAw==
X-Received: by 2002:a05:6a20:1595:b0:137:30db:bc1e with SMTP id h21-20020a056a20159500b0013730dbbc1emr5696433pzj.3.1690445429121;
        Thu, 27 Jul 2023 01:10:29 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v3 23/49] mm: workingset: dynamically allocate the mm-shadow shrinker
Date: Thu, 27 Jul 2023 16:04:36 +0800
Message-Id: <20230727080502.77895-24-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the mm-shadow shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 mm/workingset.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/mm/workingset.c b/mm/workingset.c
index da58a26d0d4d..3c53138903a7 100644
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@ -763,13 +763,6 @@ static unsigned long scan_shadow_nodes(struct shrinker *shrinker,
 					NULL);
 }
 
-static struct shrinker workingset_shadow_shrinker = {
-	.count_objects = count_shadow_nodes,
-	.scan_objects = scan_shadow_nodes,
-	.seeks = 0, /* ->count reports only fully expendable nodes */
-	.flags = SHRINKER_NUMA_AWARE | SHRINKER_MEMCG_AWARE,
-};
-
 /*
  * Our list_lru->lock is IRQ-safe as it nests inside the IRQ-safe
  * i_pages lock.
@@ -778,9 +771,10 @@ static struct lock_class_key shadow_nodes_key;
 
 static int __init workingset_init(void)
 {
+	struct shrinker *workingset_shadow_shrinker;
 	unsigned int timestamp_bits;
 	unsigned int max_order;
-	int ret;
+	int ret = -ENOMEM;
 
 	BUILD_BUG_ON(BITS_PER_LONG < EVICTION_SHIFT);
 	/*
@@ -797,17 +791,24 @@ static int __init workingset_init(void)
 	pr_info("workingset: timestamp_bits=%d max_order=%d bucket_order=%u\n",
 	       timestamp_bits, max_order, bucket_order);
 
-	ret = prealloc_shrinker(&workingset_shadow_shrinker, "mm-shadow");
-	if (ret)
+	workingset_shadow_shrinker = shrinker_alloc(SHRINKER_NUMA_AWARE |
+						    SHRINKER_MEMCG_AWARE,
+						    "mm-shadow");
+	if (!workingset_shadow_shrinker)
 		goto err;
+
 	ret = __list_lru_init(&shadow_nodes, true, &shadow_nodes_key,
-			      &workingset_shadow_shrinker);
+			      workingset_shadow_shrinker);
 	if (ret)
 		goto err_list_lru;
-	register_shrinker_prepared(&workingset_shadow_shrinker);
+
+	workingset_shadow_shrinker->count_objects = count_shadow_nodes;
+	workingset_shadow_shrinker->scan_objects = scan_shadow_nodes;
+
+	shrinker_register(workingset_shadow_shrinker);
 	return 0;
 err_list_lru:
-	free_prealloced_shrinker(&workingset_shadow_shrinker);
+	shrinker_free(workingset_shadow_shrinker);
 err:
 	return ret;
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:10:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:10:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570860.893209 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw5K-0001GS-Bs; Thu, 27 Jul 2023 08:10:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570860.893209; Thu, 27 Jul 2023 08:10:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw5K-0001GL-9C; Thu, 27 Jul 2023 08:10:58 +0000
Received: by outflank-mailman (input) for mailman id 570860;
 Thu, 27 Jul 2023 08:10:57 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw5I-0005Vh-Uy
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:10:56 +0000
Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com
 [2607:f8b0:4864:20::42f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1b977ad6-2c55-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:10:55 +0200 (CEST)
Received: by mail-pf1-x42f.google.com with SMTP id
 d2e1a72fcca58-682eef7d752so204303b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:10:55 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.10.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:10:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1b977ad6-2c55-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445453; x=1691050253;
        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=Tu9w5C30y8MI/napZavPwFZ6nIJBEFlaB1CCEG9BfCw=;
        b=SsnsAPan45QSmQpJqAj4mS8LLavDombkZ7lBafLri7RggDFTDcpBOPuNyPBGUpCtjr
         o6WPy8R5HZiwm+Xan4YH//v4pvtUrfeXD65Yl1az+1fl+mR3tGlsBglM3Vyq8SiK2wyq
         igQhG5qCvspbkK2WSeD0wTcUc/mVkzohC4cNnc0XbtmIoWLvLOUFPW/6keJGSZm27mRz
         h/WfB+fRpcVUE83zuhvMF8jYZ5b4nmh/qAHVpz3lROeGSQfLjlNrgG+gcbPX1nT5Mc7l
         SChQ2Lyx0ddDcRFnW8nA/XTZimbKDOI/X2WL7QqkejXsVeMe1ddjPlvbW0l5uaRLNo6A
         kpeA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445453; x=1691050253;
        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=Tu9w5C30y8MI/napZavPwFZ6nIJBEFlaB1CCEG9BfCw=;
        b=F+u8Qifj4qONNm7/7GW54rckd9CNqQdY1Zk6LgGx1uxWM4wpEqKML3KIBaCUZZ+Tsd
         wDSuPkRXNAr9siIlKoyo0W/XaJaMFql4eNmz7ck8MPhUYVsuf5VAlNrw5XcfBj9R0lXv
         UzS386SRqeYtc9VloOfibIuKF1S8B+vSMJVvnS15a/3nczRLjVmz6LVr/OC4O2lty1YY
         FjgrkrSXhvwEs2pEd8lr/R/q2A7ZS7GPpuABwkj3S+TSMM083V4l4Cb+CEVfKlXEYKDw
         H4xqQ7NVcLnLRBTzS4NOpuTjvrZwKmIKJO/xoT0XClVy3aRGEcTq4GeQpt9zh7b9fJvN
         HBGg==
X-Gm-Message-State: ABy/qLYEyJ2HAXpnb+4x1CfN9pmmRagW9KrxjTo9GqrwcSnzavnekBBz
	M9m2WzGZdcguiWsdQRjV3y9gSg==
X-Google-Smtp-Source: APBJJlH8SkZovaBL43/tLWqoZ3fBR0XBkmVGy0uXARpdi3AER3WOYf3EsHJKszN8s65be9uhrbpx8A==
X-Received: by 2002:a05:6a20:12d3:b0:125:6443:4eb8 with SMTP id v19-20020a056a2012d300b0012564434eb8mr5769272pzg.5.1690445453524;
        Thu, 27 Jul 2023 01:10:53 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 25/49] drm/msm: dynamically allocate the drm-msm_gem shrinker
Date: Thu, 27 Jul 2023 16:04:38 +0800
Message-Id: <20230727080502.77895-26-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the drm-msm_gem shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct msm_drm_private.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 drivers/gpu/drm/msm/msm_drv.c          |  4 ++-
 drivers/gpu/drm/msm/msm_drv.h          |  4 +--
 drivers/gpu/drm/msm/msm_gem_shrinker.c | 34 ++++++++++++++++----------
 3 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 4bd028fa7500..7f20249d6071 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -462,7 +462,9 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
 	if (ret)
 		goto err_msm_uninit;
 
-	msm_gem_shrinker_init(ddev);
+	ret = msm_gem_shrinker_init(ddev);
+	if (ret)
+		goto err_msm_uninit;
 
 	if (priv->kms_init) {
 		ret = priv->kms_init(ddev);
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index 02fd6c7d0bb7..e2fc56f161b5 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -221,7 +221,7 @@ struct msm_drm_private {
 	} vram;
 
 	struct notifier_block vmap_notifier;
-	struct shrinker shrinker;
+	struct shrinker *shrinker;
 
 	struct drm_atomic_state *pm_state;
 
@@ -283,7 +283,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
 unsigned long msm_gem_shrinker_shrink(struct drm_device *dev, unsigned long nr_to_scan);
 #endif
 
-void msm_gem_shrinker_init(struct drm_device *dev);
+int msm_gem_shrinker_init(struct drm_device *dev);
 void msm_gem_shrinker_cleanup(struct drm_device *dev);
 
 struct sg_table *msm_gem_prime_get_sg_table(struct drm_gem_object *obj);
diff --git a/drivers/gpu/drm/msm/msm_gem_shrinker.c b/drivers/gpu/drm/msm/msm_gem_shrinker.c
index f38296ad8743..20699993e4f8 100644
--- a/drivers/gpu/drm/msm/msm_gem_shrinker.c
+++ b/drivers/gpu/drm/msm/msm_gem_shrinker.c
@@ -34,8 +34,7 @@ static bool can_block(struct shrink_control *sc)
 static unsigned long
 msm_gem_shrinker_count(struct shrinker *shrinker, struct shrink_control *sc)
 {
-	struct msm_drm_private *priv =
-		container_of(shrinker, struct msm_drm_private, shrinker);
+	struct msm_drm_private *priv = shrinker->private_data;
 	unsigned count = priv->lru.dontneed.count;
 
 	if (can_swap())
@@ -100,8 +99,7 @@ active_evict(struct drm_gem_object *obj)
 static unsigned long
 msm_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc)
 {
-	struct msm_drm_private *priv =
-		container_of(shrinker, struct msm_drm_private, shrinker);
+	struct msm_drm_private *priv = shrinker->private_data;
 	struct {
 		struct drm_gem_lru *lru;
 		bool (*shrink)(struct drm_gem_object *obj);
@@ -148,10 +146,11 @@ msm_gem_shrinker_shrink(struct drm_device *dev, unsigned long nr_to_scan)
 	struct shrink_control sc = {
 		.nr_to_scan = nr_to_scan,
 	};
-	int ret;
+	unsigned long ret = SHRINK_STOP;
 
 	fs_reclaim_acquire(GFP_KERNEL);
-	ret = msm_gem_shrinker_scan(&priv->shrinker, &sc);
+	if (priv->shrinker)
+		ret = msm_gem_shrinker_scan(priv->shrinker, &sc);
 	fs_reclaim_release(GFP_KERNEL);
 
 	return ret;
@@ -210,16 +209,25 @@ msm_gem_shrinker_vmap(struct notifier_block *nb, unsigned long event, void *ptr)
  *
  * This function registers and sets up the msm shrinker.
  */
-void msm_gem_shrinker_init(struct drm_device *dev)
+int msm_gem_shrinker_init(struct drm_device *dev)
 {
 	struct msm_drm_private *priv = dev->dev_private;
-	priv->shrinker.count_objects = msm_gem_shrinker_count;
-	priv->shrinker.scan_objects = msm_gem_shrinker_scan;
-	priv->shrinker.seeks = DEFAULT_SEEKS;
-	WARN_ON(register_shrinker(&priv->shrinker, "drm-msm_gem"));
+
+	priv->shrinker = shrinker_alloc(0, "drm-msm_gem");
+	if (!priv->shrinker)
+		return -ENOMEM;
+
+	priv->shrinker->count_objects = msm_gem_shrinker_count;
+	priv->shrinker->scan_objects = msm_gem_shrinker_scan;
+	priv->shrinker->seeks = DEFAULT_SEEKS;
+	priv->shrinker->private_data = priv;
+
+	shrinker_register(priv->shrinker);
 
 	priv->vmap_notifier.notifier_call = msm_gem_shrinker_vmap;
 	WARN_ON(register_vmap_purge_notifier(&priv->vmap_notifier));
+
+	return 0;
 }
 
 /**
@@ -232,8 +240,8 @@ void msm_gem_shrinker_cleanup(struct drm_device *dev)
 {
 	struct msm_drm_private *priv = dev->dev_private;
 
-	if (priv->shrinker.nr_deferred) {
+	if (priv->shrinker) {
 		WARN_ON(unregister_vmap_purge_notifier(&priv->vmap_notifier));
-		unregister_shrinker(&priv->shrinker);
+		shrinker_free(priv->shrinker);
 	}
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:12:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:12:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570862.893219 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw6U-0001uv-Mt; Thu, 27 Jul 2023 08:12:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570862.893219; Thu, 27 Jul 2023 08:12:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw6U-0001uo-IV; Thu, 27 Jul 2023 08:12:10 +0000
Received: by outflank-mailman (input) for mailman id 570862;
 Thu, 27 Jul 2023 08:12:09 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw6T-0001uZ-FJ
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:12:09 +0000
Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com
 [2607:f8b0:4864:20::42d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 46a65dae-2c55-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:12:07 +0200 (CEST)
Received: by mail-pf1-x42d.google.com with SMTP id
 d2e1a72fcca58-682ae5d4184so171381b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:12:07 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.11.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:12:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 46a65dae-2c55-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445526; x=1691050326;
        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=2n4eBW/y496rw0R30jGqgr9PaTd+TyGx4MFgxeJTY98=;
        b=DFuBBIj0qr+rYIge0pXV6Iz/WQCtDScPhobpwepkK1qFA4vWSgHpJ4XkcYuuPfpNPf
         m1KmSzju36tqFFEerRbxzoJUh0jIYJTO7HIOFb+RZm+pVFB00ovmyWsAOFYYwfcBZmMb
         e24YxGtb0LaJS553DCfCR3CRRqCI01KNxWybG2aaWT/P5M881ZLs+BB0bNl6iFKLm1jP
         1CGPhfxCNsRDquotgL0k/wpTHggVzHbYlQp/c6oXuHB7Tn0FP6ZxNpyiHbKUJJqBcB/S
         A1bIsa86Qg72/76knWel/9Oqk1Wqg5ySfdUAutMowRhvxEtU3jYo18G5n5eEy4cYbgQS
         NQLw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445526; x=1691050326;
        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=2n4eBW/y496rw0R30jGqgr9PaTd+TyGx4MFgxeJTY98=;
        b=MCswUnUo2FIMzgnQMIoIjfzVC168rtFCnTU3EtA5MBdAhgkQR/8tLQHtuqeVymJKAh
         PqmvYFuDEQgNNhCUc1JWzx1hOUuFRPBpcTIAW0nOPDGDS5FIQ1VJ31Q1zl/4et+Fbbg4
         jDr19CPV7zfYRgLk6rIrS0fuX56pM/uoMFAKGIVcOuNGTBsHubJstShZCg+GgCJtJD1b
         MGb2sFMM2LoMyNOhuYTa2zpcs3b4UW+atK/qPpj31zI2QjAF63sP3cnMOCwCOlkLNZgZ
         aQp7XY0AkyUdzMnU62PhWIJ3KjfLw/jLShP0rNCR3RFMXHgLXjTTRtyaWPufDhI+R3gk
         y3Dg==
X-Gm-Message-State: ABy/qLb5hEAukzmJDOx8urQmTM3pag3CkKrk9SrDQi0/uISFt+qexrt/
	CYBP4Zh37O8Rp1NvIUEp63ZQCw==
X-Google-Smtp-Source: APBJJlHcYWOCpFnX36R6RazQvm5Mh7k9Kqh4ud2Oospjm3wjIj4ouKJfJr17R2K3rHFvQEDvt90Syw==
X-Received: by 2002:a05:6a00:4685:b0:675:8521:ddc7 with SMTP id de5-20020a056a00468500b006758521ddc7mr4426362pfb.0.1690445525874;
        Thu, 27 Jul 2023 01:12:05 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 31/49] vmw_balloon: dynamically allocate the vmw-balloon shrinker
Date: Thu, 27 Jul 2023 16:04:44 +0800
Message-Id: <20230727080502.77895-32-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the vmw-balloon shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct vmballoon.

And we can simply exit vmballoon_init() when registering the shrinker
fails. So the shrinker_registered indication is redundant, just remove it.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 drivers/misc/vmw_balloon.c | 38 ++++++++++++--------------------------
 1 file changed, 12 insertions(+), 26 deletions(-)

diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c
index 9ce9b9e0e9b6..ac2cdb6cdf74 100644
--- a/drivers/misc/vmw_balloon.c
+++ b/drivers/misc/vmw_balloon.c
@@ -380,16 +380,7 @@ struct vmballoon {
 	/**
 	 * @shrinker: shrinker interface that is used to avoid over-inflation.
 	 */
-	struct shrinker shrinker;
-
-	/**
-	 * @shrinker_registered: whether the shrinker was registered.
-	 *
-	 * The shrinker interface does not handle gracefully the removal of
-	 * shrinker that was not registered before. This indication allows to
-	 * simplify the unregistration process.
-	 */
-	bool shrinker_registered;
+	struct shrinker *shrinker;
 };
 
 static struct vmballoon balloon;
@@ -1568,29 +1559,27 @@ static unsigned long vmballoon_shrinker_count(struct shrinker *shrinker,
 
 static void vmballoon_unregister_shrinker(struct vmballoon *b)
 {
-	if (b->shrinker_registered)
-		unregister_shrinker(&b->shrinker);
-	b->shrinker_registered = false;
+	shrinker_free(b->shrinker);
 }
 
 static int vmballoon_register_shrinker(struct vmballoon *b)
 {
-	int r;
-
 	/* Do nothing if the shrinker is not enabled */
 	if (!vmwballoon_shrinker_enable)
 		return 0;
 
-	b->shrinker.scan_objects = vmballoon_shrinker_scan;
-	b->shrinker.count_objects = vmballoon_shrinker_count;
-	b->shrinker.seeks = DEFAULT_SEEKS;
+	b->shrinker = shrinker_alloc(0, "vmw-balloon");
+	if (!b->shrinker)
+		return -ENOMEM;
 
-	r = register_shrinker(&b->shrinker, "vmw-balloon");
+	b->shrinker->scan_objects = vmballoon_shrinker_scan;
+	b->shrinker->count_objects = vmballoon_shrinker_count;
+	b->shrinker->seeks = DEFAULT_SEEKS;
+	b->shrinker->private_data = b;
 
-	if (r == 0)
-		b->shrinker_registered = true;
+	shrinker_register(b->shrinker);
 
-	return r;
+	return 0;
 }
 
 /*
@@ -1883,7 +1872,7 @@ static int __init vmballoon_init(void)
 
 	error = vmballoon_register_shrinker(&balloon);
 	if (error)
-		goto fail;
+		return error;
 
 	/*
 	 * Initialization of compaction must be done after the call to
@@ -1905,9 +1894,6 @@ static int __init vmballoon_init(void)
 	vmballoon_debugfs_init(&balloon);
 
 	return 0;
-fail:
-	vmballoon_unregister_shrinker(&balloon);
-	return error;
 }
 
 /*
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:12:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:12:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570864.893229 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw6t-0002SE-4I; Thu, 27 Jul 2023 08:12:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570864.893229; Thu, 27 Jul 2023 08:12:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw6t-0002S7-0U; Thu, 27 Jul 2023 08:12:35 +0000
Received: by outflank-mailman (input) for mailman id 570864;
 Thu, 27 Jul 2023 08:12:33 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw6r-0001uZ-6r
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:12:33 +0000
Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com
 [2607:f8b0:4864:20::434])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 551987c5-2c55-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:12:31 +0200 (CEST)
Received: by mail-pf1-x434.google.com with SMTP id
 d2e1a72fcca58-6748a616e17so183566b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:12:31 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.12.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:12:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 551987c5-2c55-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445550; x=1691050350;
        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=xVRvDV5EwClRaurogoo7jeCmWiPiam6NNimoVigpYsU=;
        b=VWs5xsEpAgA4DYNqF8K/FN4j7udZSbXqCeXnxv3YTG0Ik0TL2nl/Ugga9u7R+ZJeNR
         Wigeakgpk32H5TPwyUhkE7IqyM04zeUMVcePDa9eTKcIqF7mvyeMYMdU6pDKFeWcNWaR
         qvQCy7Nu/xowW6gGi5vD7bu0NuXZ8UlBiffMC2ufEn1khdTpqjsjaFRzBjIrPJfwSFKG
         LuwPnQLNAsZ+sSXWuMdy2i4BIcl75Eemb6JwQ/h/qU8W848mv79pSK1svvdUmrASzQOQ
         aQzV7ZNEhcTzx5oZvxCfNrl/tTU7BbbCJB9SufDvnC5P9J0UXQ5a+DGx/aTVEKn/U2IP
         9i7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445550; x=1691050350;
        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=xVRvDV5EwClRaurogoo7jeCmWiPiam6NNimoVigpYsU=;
        b=Co+Tzr4CJk538Et8RxlMqxQ/m4ZsH6yTuKWX8G6kDeZRoQvCIKEunKdir0rWOQ0utX
         0fLQG3H9zXQ9mvP9WU1zGu4hQqvHEJ8O2vrcRLzuIg5r+CRAWmwTdVsC8WX49e7WBvC5
         C1ZjczeaAkPS20AGDgbWLxQLHubi2rRCM949CAIzxRZzCRuS6KNV7ENgM3fWL+d7fOAN
         0QTbmDLBome7pdLlXbMDwcHPTobuPY2NYue9lYEeg3+VfgjIdhjDpdHclj1+NdxiqR/L
         qicqLZYTR13879TdR7S+DUk71bk1+9HS/vrdplQaQgmEVKw4Wyjt1nF6+bngJOi/gEB3
         KWpQ==
X-Gm-Message-State: ABy/qLavh3HolSoCx3xpd9MSztiOcsdZIFeO/ELLw83VUXUiEeJUSZSB
	bZue7NckC7aF5k73p/A/9S5t6w==
X-Google-Smtp-Source: APBJJlF08KF/2Ja1GiYKXzi0SbMDWba0XluK8fJxZEI3QrufrkFF+7lpMuNnhPZU1iQtSxNfzq1jqw==
X-Received: by 2002:a05:6a21:32a9:b0:136:f3ef:4d2 with SMTP id yt41-20020a056a2132a900b00136f3ef04d2mr6069372pzb.3.1690445550183;
        Thu, 27 Jul 2023 01:12:30 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 33/49] mbcache: dynamically allocate the mbcache shrinker
Date: Thu, 27 Jul 2023 16:04:46 +0800
Message-Id: <20230727080502.77895-34-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the mbcache shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct mb_cache.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 fs/mbcache.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/fs/mbcache.c b/fs/mbcache.c
index 2a4b8b549e93..0d1e24e9a5e3 100644
--- a/fs/mbcache.c
+++ b/fs/mbcache.c
@@ -37,7 +37,7 @@ struct mb_cache {
 	struct list_head	c_list;
 	/* Number of entries in cache */
 	unsigned long		c_entry_count;
-	struct shrinker		c_shrink;
+	struct shrinker		*c_shrink;
 	/* Work for shrinking when the cache has too many entries */
 	struct work_struct	c_shrink_work;
 };
@@ -293,8 +293,7 @@ EXPORT_SYMBOL(mb_cache_entry_touch);
 static unsigned long mb_cache_count(struct shrinker *shrink,
 				    struct shrink_control *sc)
 {
-	struct mb_cache *cache = container_of(shrink, struct mb_cache,
-					      c_shrink);
+	struct mb_cache *cache = shrink->private_data;
 
 	return cache->c_entry_count;
 }
@@ -333,8 +332,7 @@ static unsigned long mb_cache_shrink(struct mb_cache *cache,
 static unsigned long mb_cache_scan(struct shrinker *shrink,
 				   struct shrink_control *sc)
 {
-	struct mb_cache *cache = container_of(shrink, struct mb_cache,
-					      c_shrink);
+	struct mb_cache *cache = shrink->private_data;
 	return mb_cache_shrink(cache, sc->nr_to_scan);
 }
 
@@ -377,15 +375,20 @@ struct mb_cache *mb_cache_create(int bucket_bits)
 	for (i = 0; i < bucket_count; i++)
 		INIT_HLIST_BL_HEAD(&cache->c_hash[i]);
 
-	cache->c_shrink.count_objects = mb_cache_count;
-	cache->c_shrink.scan_objects = mb_cache_scan;
-	cache->c_shrink.seeks = DEFAULT_SEEKS;
-	if (register_shrinker(&cache->c_shrink, "mbcache-shrinker")) {
+	cache->c_shrink = shrinker_alloc(0, "mbcache-shrinker");
+	if (!cache->c_shrink) {
 		kfree(cache->c_hash);
 		kfree(cache);
 		goto err_out;
 	}
 
+	cache->c_shrink->count_objects = mb_cache_count;
+	cache->c_shrink->scan_objects = mb_cache_scan;
+	cache->c_shrink->seeks = DEFAULT_SEEKS;
+	cache->c_shrink->private_data = cache;
+
+	shrinker_register(cache->c_shrink);
+
 	INIT_WORK(&cache->c_shrink_work, mb_cache_shrink_worker);
 
 	return cache;
@@ -406,7 +409,7 @@ void mb_cache_destroy(struct mb_cache *cache)
 {
 	struct mb_cache_entry *entry, *next;
 
-	unregister_shrinker(&cache->c_shrink);
+	shrinker_free(cache->c_shrink);
 
 	/*
 	 * We don't bother with any locking. Cache must not be used at this
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:13:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:13:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570866.893239 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw7t-00033b-Ca; Thu, 27 Jul 2023 08:13:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570866.893239; Thu, 27 Jul 2023 08:13:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw7t-00033U-9q; Thu, 27 Jul 2023 08:13:37 +0000
Received: by outflank-mailman (input) for mailman id 570866;
 Thu, 27 Jul 2023 08:13:36 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw7s-00033O-PD
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:13:36 +0000
Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com
 [2607:f8b0:4864:20::42d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7ac84365-2c55-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:13:34 +0200 (CEST)
Received: by mail-pf1-x42d.google.com with SMTP id
 d2e1a72fcca58-66d6a9851f3so168716b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:13:34 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.13.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:13:32 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7ac84365-2c55-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445613; x=1691050413;
        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=jaqVlo27zysQOw4inLaa7RWYi61naAqQm5GJ5upJpN4=;
        b=AiXoaCJQdjYD9eYmeEdrfJ7ezATe9Yx6/bwBgW+5G+EPOMCuXYwEAcwi/JFENHTjN3
         RLofwFvJd4EkqfH7Ye6KmIjKXgnfjEMN6IQZZPzERz8d2kaa1LDxbOfy1pXfbOXi//fW
         yPmgpOzP5ISM/DRd0jetvScx//7ssTCBUe2enciakCKenXGhXZrdb9q6vjgbH3ZMQFpH
         R1cJwZwEOETjjGMipjwgI0l9uWlKWu8vb1MB9swWpnARqP7hyemEh7msGfN9mYd5xYpI
         D03dkm0FvaoEJlj9bRrg4eXRdtCSaQUY5I5xaJER5wRv+adUsRWUp3ZNy7xFaIahEhPe
         Q+Lw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445613; x=1691050413;
        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=jaqVlo27zysQOw4inLaa7RWYi61naAqQm5GJ5upJpN4=;
        b=kISB6xE+hUyre96vvQxRogHnUM1YiwZDygU1kt3sY7WJNRsoOExBS9gBnybWR3l4+T
         sdGCu6OfkW3DssHhVbBUl8D9wUvGJCfK8YllwNyxL6j3H1SoGUvuoJHJx3OZZY+3Dk1Z
         QlGk1Q4w5zx/68lMnhRFLx0AdVyK5L1PNPqjP0d5nkJhQMAADNp/A4qPxe75Bnhlcqta
         oyEC/ebaHuhq15Ii0emc/iAv/3XyDJquY9qA4tXLB0wNFoDsnI/WlvAUqvlJpNy9pFhs
         IkoibrJgRSmHRvUB9R3se15UZrTBfpMlRNZ6J2g+BSDLksUgB8VVYiPla/E9NI8w3XP8
         Ky8Q==
X-Gm-Message-State: ABy/qLbAvqNPAbDV+XY4zdI0Hqm+yCf4HxANLzQqotKEs/DnXQ3Nulng
	sUDY21awajSR7cWEiyhlzGJmLw==
X-Google-Smtp-Source: APBJJlG+tRTw+eNG8sDYXmQBYWrWDa50m7E6kRjtDYwVrWUQOS5ovTAWRl9t0zD5rxSD0dIJ86GpuQ==
X-Received: by 2002:a05:6a00:2d82:b0:675:8627:a291 with SMTP id fb2-20020a056a002d8200b006758627a291mr4587660pfb.3.1690445613284;
        Thu, 27 Jul 2023 01:13:33 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 38/49] xfs: dynamically allocate the xfs-buf shrinker
Date: Thu, 27 Jul 2023 16:04:51 +0800
Message-Id: <20230727080502.77895-39-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the xfs-buf shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct xfs_buftarg.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 fs/xfs/xfs_buf.c | 25 ++++++++++++++-----------
 fs/xfs/xfs_buf.h |  2 +-
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 15d1e5a7c2d3..715730fc91cb 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1906,8 +1906,7 @@ xfs_buftarg_shrink_scan(
 	struct shrinker		*shrink,
 	struct shrink_control	*sc)
 {
-	struct xfs_buftarg	*btp = container_of(shrink,
-					struct xfs_buftarg, bt_shrinker);
+	struct xfs_buftarg	*btp = shrink->private_data;
 	LIST_HEAD(dispose);
 	unsigned long		freed;
 
@@ -1929,8 +1928,7 @@ xfs_buftarg_shrink_count(
 	struct shrinker		*shrink,
 	struct shrink_control	*sc)
 {
-	struct xfs_buftarg	*btp = container_of(shrink,
-					struct xfs_buftarg, bt_shrinker);
+	struct xfs_buftarg	*btp = shrink->private_data;
 	return list_lru_shrink_count(&btp->bt_lru, sc);
 }
 
@@ -1938,7 +1936,7 @@ void
 xfs_free_buftarg(
 	struct xfs_buftarg	*btp)
 {
-	unregister_shrinker(&btp->bt_shrinker);
+	shrinker_free(btp->bt_shrinker);
 	ASSERT(percpu_counter_sum(&btp->bt_io_count) == 0);
 	percpu_counter_destroy(&btp->bt_io_count);
 	list_lru_destroy(&btp->bt_lru);
@@ -2021,13 +2019,18 @@ xfs_alloc_buftarg(
 	if (percpu_counter_init(&btp->bt_io_count, 0, GFP_KERNEL))
 		goto error_lru;
 
-	btp->bt_shrinker.count_objects = xfs_buftarg_shrink_count;
-	btp->bt_shrinker.scan_objects = xfs_buftarg_shrink_scan;
-	btp->bt_shrinker.seeks = DEFAULT_SEEKS;
-	btp->bt_shrinker.flags = SHRINKER_NUMA_AWARE;
-	if (register_shrinker(&btp->bt_shrinker, "xfs-buf:%s",
-			      mp->m_super->s_id))
+	btp->bt_shrinker = shrinker_alloc(SHRINKER_NUMA_AWARE, "xfs-buf:%s",
+					  mp->m_super->s_id);
+	if (!btp->bt_shrinker)
 		goto error_pcpu;
+
+	btp->bt_shrinker->count_objects = xfs_buftarg_shrink_count;
+	btp->bt_shrinker->scan_objects = xfs_buftarg_shrink_scan;
+	btp->bt_shrinker->seeks = DEFAULT_SEEKS;
+	btp->bt_shrinker->private_data = btp;
+
+	shrinker_register(btp->bt_shrinker);
+
 	return btp;
 
 error_pcpu:
diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h
index 549c60942208..4e6969a675f7 100644
--- a/fs/xfs/xfs_buf.h
+++ b/fs/xfs/xfs_buf.h
@@ -102,7 +102,7 @@ typedef struct xfs_buftarg {
 	size_t			bt_logical_sectormask;
 
 	/* LRU control structures */
-	struct shrinker		bt_shrinker;
+	struct shrinker		*bt_shrinker;
 	struct list_lru		bt_lru;
 
 	struct percpu_counter	bt_io_count;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:13:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:13:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570867.893249 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw85-0003Pk-M3; Thu, 27 Jul 2023 08:13:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570867.893249; Thu, 27 Jul 2023 08:13:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw85-0003Pd-IA; Thu, 27 Jul 2023 08:13:49 +0000
Received: by outflank-mailman (input) for mailman id 570867;
 Thu, 27 Jul 2023 08:13:48 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw84-00033O-DK
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:13:48 +0000
Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com
 [2607:f8b0:4864:20::42d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 81e82518-2c55-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:13:46 +0200 (CEST)
Received: by mail-pf1-x42d.google.com with SMTP id
 d2e1a72fcca58-686f74a8992so78431b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:13:46 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.13.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:13:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 81e82518-2c55-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445625; x=1691050425;
        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=vAE6p5mA5n3yxm+4IPfXfMLc8MGv4J5wg3qHubren08=;
        b=dkRrWVkSv9/U3+e6QsQd29dMPuttcg2M13ZLMDEEIMbfSamBJHJdLtNY2sbEZ+YzhY
         5BtYLYzutGknAA+e956eNSlbl7nK+9UwGbTk4YjZb6fHHFpCk0FXoHpJAi6M0jM7aFZF
         +CarAybA7Fmb9F2zoNtgG1DfzDYBp6eqgkICDj2Asy83tRT0LF5pvIpkdtR75UYStLmf
         37kqliTWk9DV3Fw2NufQf0BV5/WVkKX05IEilefRJ/OwJCaH2LBTkZCCI3ZIC5RNHqLc
         p1thIF8tkbzc9m+CHBYGB6mtVDqiYNqHlAVUDSIfQN8XwfU9rYwJVwEXJvC3bJUByZYt
         Gdag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445625; x=1691050425;
        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=vAE6p5mA5n3yxm+4IPfXfMLc8MGv4J5wg3qHubren08=;
        b=OF8C4wDBou0E9zk2tMsPY9ITkjDkHGwqkQTt4t5Xhv6q3sCT2Vt+Y8m+4hy7gh64a4
         Wccv4PR9inspQ80oaTeDvalKoNU9/vdAHWUQw+TmNqwdoszihZPTUytDdroms24xI9gG
         2uyIj5aQj0HXZnQoTzdcV2lTOG4ao0mn+StdTx9p6I9CArRLxGkbTXjuq3WlCg16Z1rY
         1HtWW6HRCPOA0bLIID2Lq3sAorTyxfv8pBVYi1yS/jEdl0QwCpplPrrekmYDWKQ4Et9r
         kvlDncjdVLz6En++9/BQsH3R4yLgDpYlYUjmh/dF5mlUJRPfF3cKjfWZUa7u+2l1XQY9
         o5QA==
X-Gm-Message-State: ABy/qLbsGFMgKz3EbK9WQH5RcxQoAkUurKrvf3cqXDhUE2luYJD7nyyi
	6ty4Luz9D8GLdAHDcAmEyGYsLg==
X-Google-Smtp-Source: APBJJlGsGKc/yd3ypxFPLcm5JieT1oixTNIsPQhWBcbXzQEArQwAQppjIOSAREcWHLbqRGZH8ALcGA==
X-Received: by 2002:a05:6a20:7d87:b0:12e:f6e6:882b with SMTP id v7-20020a056a207d8700b0012ef6e6882bmr6446407pzj.1.1690445625322;
        Thu, 27 Jul 2023 01:13:45 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 39/49] xfs: dynamically allocate the xfs-inodegc shrinker
Date: Thu, 27 Jul 2023 16:04:52 +0800
Message-Id: <20230727080502.77895-40-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the xfs-inodegc shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct xfs_mount.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 fs/xfs/xfs_icache.c | 26 +++++++++++++++-----------
 fs/xfs/xfs_mount.c  |  4 ++--
 fs/xfs/xfs_mount.h  |  2 +-
 3 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 453890942d9f..751c380afd5a 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -2225,8 +2225,7 @@ xfs_inodegc_shrinker_count(
 	struct shrinker		*shrink,
 	struct shrink_control	*sc)
 {
-	struct xfs_mount	*mp = container_of(shrink, struct xfs_mount,
-						   m_inodegc_shrinker);
+	struct xfs_mount	*mp = shrink->private_data;
 	struct xfs_inodegc	*gc;
 	int			cpu;
 
@@ -2247,8 +2246,7 @@ xfs_inodegc_shrinker_scan(
 	struct shrinker		*shrink,
 	struct shrink_control	*sc)
 {
-	struct xfs_mount	*mp = container_of(shrink, struct xfs_mount,
-						   m_inodegc_shrinker);
+	struct xfs_mount	*mp = shrink->private_data;
 	struct xfs_inodegc	*gc;
 	int			cpu;
 	bool			no_items = true;
@@ -2284,13 +2282,19 @@ int
 xfs_inodegc_register_shrinker(
 	struct xfs_mount	*mp)
 {
-	struct shrinker		*shrink = &mp->m_inodegc_shrinker;
+	mp->m_inodegc_shrinker = shrinker_alloc(SHRINKER_NONSLAB,
+						"xfs-inodegc:%s",
+						mp->m_super->s_id);
+	if (!mp->m_inodegc_shrinker)
+		return -ENOMEM;
+
+	mp->m_inodegc_shrinker->count_objects = xfs_inodegc_shrinker_count;
+	mp->m_inodegc_shrinker->scan_objects = xfs_inodegc_shrinker_scan;
+	mp->m_inodegc_shrinker->seeks = 0;
+	mp->m_inodegc_shrinker->batch = XFS_INODEGC_SHRINKER_BATCH;
+	mp->m_inodegc_shrinker->private_data = mp;
 
-	shrink->count_objects = xfs_inodegc_shrinker_count;
-	shrink->scan_objects = xfs_inodegc_shrinker_scan;
-	shrink->seeks = 0;
-	shrink->flags = SHRINKER_NONSLAB;
-	shrink->batch = XFS_INODEGC_SHRINKER_BATCH;
+	shrinker_register(mp->m_inodegc_shrinker);
 
-	return register_shrinker(shrink, "xfs-inodegc:%s", mp->m_super->s_id);
+	return 0;
 }
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index fb87ffb48f7f..640d09891a4e 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -1018,7 +1018,7 @@ xfs_mountfs(
  out_log_dealloc:
 	xfs_log_mount_cancel(mp);
  out_inodegc_shrinker:
-	unregister_shrinker(&mp->m_inodegc_shrinker);
+	shrinker_free(mp->m_inodegc_shrinker);
  out_fail_wait:
 	if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp)
 		xfs_buftarg_drain(mp->m_logdev_targp);
@@ -1100,7 +1100,7 @@ xfs_unmountfs(
 #if defined(DEBUG)
 	xfs_errortag_clearall(mp);
 #endif
-	unregister_shrinker(&mp->m_inodegc_shrinker);
+	shrinker_free(mp->m_inodegc_shrinker);
 	xfs_free_perag(mp);
 
 	xfs_errortag_del(mp);
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index e2866e7fa60c..562c294ca08e 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -217,7 +217,7 @@ typedef struct xfs_mount {
 	atomic_t		m_agirotor;	/* last ag dir inode alloced */
 
 	/* Memory shrinker to throttle and reprioritize inodegc */
-	struct shrinker		m_inodegc_shrinker;
+	struct shrinker		*m_inodegc_shrinker;
 	/*
 	 * Workqueue item so that we can coalesce multiple inode flush attempts
 	 * into a single flush.
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:14:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:14:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570869.893259 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw8G-0003tp-Un; Thu, 27 Jul 2023 08:14:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570869.893259; Thu, 27 Jul 2023 08:14:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw8G-0003ti-Rw; Thu, 27 Jul 2023 08:14:00 +0000
Received: by outflank-mailman (input) for mailman id 570869;
 Thu, 27 Jul 2023 08:13:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw8F-0003rz-RR
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:13:59 +0000
Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com
 [2607:f8b0:4864:20::42c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 89166a0b-2c55-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:13:58 +0200 (CEST)
Received: by mail-pf1-x42c.google.com with SMTP id
 d2e1a72fcca58-682eef7d752so204934b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:13:58 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.13.45
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:13:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 89166a0b-2c55-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445637; x=1691050437;
        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=wkWZ9/xaCXa97bQ5JXnZc5xW9B3SNGrJMT1hKcCw6ws=;
        b=EDfCdETq+fWum4Z4rVmLJcfO1jsg67VgnqiA/czndVSbNlSpbiLUxCCQQbrycQZD4N
         jQ6ZzEztmrAV1/GQh0DPbs4MerEzMqTN5oUJT+1JgEVVCAFedy/wmgVhs7WN/b/b654/
         J3bWoofyGEQUeJzT2evHimB9xJj54scgZA3ezNM1eyl//hvUHn6qW8m2jc5RxZ9Q53pq
         qjYZmev8IqT72hXdHUOA71yDJ6nyeNuVcIJzjtWGkynPPHPpyqKgHAKZWC3Im8l22hhd
         2mNa6yYVElvUfcaQGhKZMnwewb3KL70R9vxxm9ctoitBRKZ5V08UPUQRdkaKB4nkVDWK
         NCpQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445637; x=1691050437;
        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=wkWZ9/xaCXa97bQ5JXnZc5xW9B3SNGrJMT1hKcCw6ws=;
        b=gHZ+ZyCIbWsP3kzj7h6z3p3szFVmDrUcFruGdswXZDcQjsRrANLoutjg4BNqZF2yzR
         UPXUIKndQTkL3WyuCQJZ9PACMro6MamR1cWOhKGU3Ve4hhutjNUCNAPFAMN1lR30idve
         rSL9hOdJ780PYdpupqVpOLUphRBMpL+zS+p1GIda2rK9IlotIiXEWiaA92hutxzL4zJz
         lG6HR9cFYtLQUlaPoHRA3VEyjPqVOthNLfycUmLxEfZa9ZiLAtOTv2kBhHWUbW6ioYzU
         fMuYCNQ0F3s4xectK6EPEQT0UtW8+AkPho/muhru2gXMI342B3Q3fcmNM+RStBSpkktk
         IzDg==
X-Gm-Message-State: ABy/qLZ7YlFOWt3hdbdzML7DVNDbnDdaSWQBsHSNFwxoJMjwdf2JcjB4
	Z27OqDWmy9NO2G1doAzibZqsjA==
X-Google-Smtp-Source: APBJJlHv3kehM44VAWCca2syD2CKM7i434EcumRqZh5gO/U3rxv+9ZnIssQP5Ien17rj+O8gWl3H0Q==
X-Received: by 2002:a05:6a00:1586:b0:67f:8ef5:2643 with SMTP id u6-20020a056a00158600b0067f8ef52643mr5213351pfk.2.1690445637383;
        Thu, 27 Jul 2023 01:13:57 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 40/49] xfs: dynamically allocate the xfs-qm shrinker
Date: Thu, 27 Jul 2023 16:04:53 +0800
Message-Id: <20230727080502.77895-41-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the xfs-qm shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct xfs_quotainfo.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 fs/xfs/xfs_qm.c | 26 +++++++++++++-------------
 fs/xfs/xfs_qm.h |  2 +-
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index 6abcc34fafd8..032f0a208bd2 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -504,8 +504,7 @@ xfs_qm_shrink_scan(
 	struct shrinker		*shrink,
 	struct shrink_control	*sc)
 {
-	struct xfs_quotainfo	*qi = container_of(shrink,
-					struct xfs_quotainfo, qi_shrinker);
+	struct xfs_quotainfo	*qi = shrink->private_data;
 	struct xfs_qm_isolate	isol;
 	unsigned long		freed;
 	int			error;
@@ -539,8 +538,7 @@ xfs_qm_shrink_count(
 	struct shrinker		*shrink,
 	struct shrink_control	*sc)
 {
-	struct xfs_quotainfo	*qi = container_of(shrink,
-					struct xfs_quotainfo, qi_shrinker);
+	struct xfs_quotainfo	*qi = shrink->private_data;
 
 	return list_lru_shrink_count(&qi->qi_lru, sc);
 }
@@ -680,16 +678,18 @@ xfs_qm_init_quotainfo(
 	if (XFS_IS_PQUOTA_ON(mp))
 		xfs_qm_set_defquota(mp, XFS_DQTYPE_PROJ, qinf);
 
-	qinf->qi_shrinker.count_objects = xfs_qm_shrink_count;
-	qinf->qi_shrinker.scan_objects = xfs_qm_shrink_scan;
-	qinf->qi_shrinker.seeks = DEFAULT_SEEKS;
-	qinf->qi_shrinker.flags = SHRINKER_NUMA_AWARE;
-
-	error = register_shrinker(&qinf->qi_shrinker, "xfs-qm:%s",
-				  mp->m_super->s_id);
-	if (error)
+	qinf->qi_shrinker = shrinker_alloc(SHRINKER_NUMA_AWARE, "xfs-qm:%s",
+					   mp->m_super->s_id);
+	if (!qinf->qi_shrinker)
 		goto out_free_inos;
 
+	qinf->qi_shrinker->count_objects = xfs_qm_shrink_count;
+	qinf->qi_shrinker->scan_objects = xfs_qm_shrink_scan;
+	qinf->qi_shrinker->seeks = DEFAULT_SEEKS;
+	qinf->qi_shrinker->private_data = qinf;
+
+	shrinker_register(qinf->qi_shrinker);
+
 	return 0;
 
 out_free_inos:
@@ -718,7 +718,7 @@ xfs_qm_destroy_quotainfo(
 	qi = mp->m_quotainfo;
 	ASSERT(qi != NULL);
 
-	unregister_shrinker(&qi->qi_shrinker);
+	shrinker_free(qi->qi_shrinker);
 	list_lru_destroy(&qi->qi_lru);
 	xfs_qm_destroy_quotainos(qi);
 	mutex_destroy(&qi->qi_tree_lock);
diff --git a/fs/xfs/xfs_qm.h b/fs/xfs/xfs_qm.h
index 9683f0457d19..d5c9fc4ba591 100644
--- a/fs/xfs/xfs_qm.h
+++ b/fs/xfs/xfs_qm.h
@@ -63,7 +63,7 @@ struct xfs_quotainfo {
 	struct xfs_def_quota	qi_usr_default;
 	struct xfs_def_quota	qi_grp_default;
 	struct xfs_def_quota	qi_prj_default;
-	struct shrinker		qi_shrinker;
+	struct shrinker		*qi_shrinker;
 
 	/* Minimum and maximum quota expiration timestamp values. */
 	time64_t		qi_expiry_min;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:14:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:14:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570870.893268 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw8U-0004Uc-AS; Thu, 27 Jul 2023 08:14:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570870.893268; Thu, 27 Jul 2023 08:14:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw8U-0004UT-7p; Thu, 27 Jul 2023 08:14:14 +0000
Received: by outflank-mailman (input) for mailman id 570870;
 Thu, 27 Jul 2023 08:14:12 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw8S-00033O-Hk
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:14:12 +0000
Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com
 [2607:f8b0:4864:20::42e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9042e661-2c55-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:14:10 +0200 (CEST)
Received: by mail-pf1-x42e.google.com with SMTP id
 d2e1a72fcca58-6748a616e17so183912b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:14:10 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.13.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:14:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9042e661-2c55-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445649; x=1691050449;
        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=sPvPF+4cfnCSPpn5pwfgQmnhLHHD8eUNQAmayNodhE0=;
        b=YUtSHImzHFhUVx7c3A38/9eSWP8Y2UYGj1FAohSpraRjdigKG79oH7xXGVv/st6Oxo
         VyXpyLT7a2poDQM1BLbe2YZ2f+F4NjGwYTjXKgOmjtdNRT3EltoPRUERX0NGCPGwABx/
         guLbSxl8SczSn7UsZFsKIT2jSYiALWPELONV4dGxl+BgYW8LTo4BMAXY89ObnQ5bwB+z
         TeqwZ6TJLFD7PjgbTEQMgvSuaTCzQbN9MksnEsjGQ7GcxsQYflnPZl/UkK6mnnTiCX+x
         HfuT7U9+62kKpSnlvuoFhz2dd+gEGZ79L6Z5RTD7Q/dArvGRObCoRNap6LnHLL+kySjl
         YAWg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445649; x=1691050449;
        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=sPvPF+4cfnCSPpn5pwfgQmnhLHHD8eUNQAmayNodhE0=;
        b=GfHz4XvKeE3MTcuEYCkRMEBmyP0muy2xMd551khM+m9BT6THIKZcyosOQDg5KNnSKp
         nRCP9HGohj2guoY8o8CSB4cPuPB+Q5pFiAJn4cFesAIvFSLnb4kVSGMf1mGqXwNYU8xK
         n+OhAkwwvWduEv0v8Yu5IsPcdTFETII+9wagG5NQ0EVPWNpABAl4Mr4eP/r9MgMhqqFF
         R7SVDFvtl3k8Tiq88h+QH1s452aP2W1p0HeWsZVyaMP0lTUzuAOrGB+Yb7Fp9vDYxu+M
         QSndin8naEhuZr2Whic7Z32Nu9Sh02EMG+DQkIPVX/LZbNkPEQsfV/saXoXrpaTFCJHE
         8Qyg==
X-Gm-Message-State: ABy/qLbncW7gy2siJANwwRni9h+/SwmkjOMGZi10XoJVhVHnAxxBCEZS
	GCYIwQAORUyN2hPuSpSxH3fUCA==
X-Google-Smtp-Source: APBJJlHWG/nG8cYGh+bA6ihiUuY1h+OmDGzY+AfGFIW0cwXlJC7qa3aS8ftT4KQ6i8EuYK6gaQtAEg==
X-Received: by 2002:a05:6a20:918e:b0:11a:dbb3:703b with SMTP id v14-20020a056a20918e00b0011adbb3703bmr5557054pzd.6.1690445649366;
        Thu, 27 Jul 2023 01:14:09 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 41/49] zsmalloc: dynamically allocate the mm-zspool shrinker
Date: Thu, 27 Jul 2023 16:04:54 +0800
Message-Id: <20230727080502.77895-42-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the mm-zspool shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct zs_pool.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 mm/zsmalloc.c | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index b96230402a8d..e63302e07c97 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -229,7 +229,7 @@ struct zs_pool {
 	struct zs_pool_stats stats;
 
 	/* Compact classes */
-	struct shrinker shrinker;
+	struct shrinker *shrinker;
 
 #ifdef CONFIG_ZSMALLOC_STAT
 	struct dentry *stat_dentry;
@@ -2086,8 +2086,7 @@ static unsigned long zs_shrinker_scan(struct shrinker *shrinker,
 		struct shrink_control *sc)
 {
 	unsigned long pages_freed;
-	struct zs_pool *pool = container_of(shrinker, struct zs_pool,
-			shrinker);
+	struct zs_pool *pool = shrinker->private_data;
 
 	/*
 	 * Compact classes and calculate compaction delta.
@@ -2105,8 +2104,7 @@ static unsigned long zs_shrinker_count(struct shrinker *shrinker,
 	int i;
 	struct size_class *class;
 	unsigned long pages_to_free = 0;
-	struct zs_pool *pool = container_of(shrinker, struct zs_pool,
-			shrinker);
+	struct zs_pool *pool = shrinker->private_data;
 
 	for (i = ZS_SIZE_CLASSES - 1; i >= 0; i--) {
 		class = pool->size_class[i];
@@ -2121,18 +2119,24 @@ static unsigned long zs_shrinker_count(struct shrinker *shrinker,
 
 static void zs_unregister_shrinker(struct zs_pool *pool)
 {
-	unregister_shrinker(&pool->shrinker);
+	shrinker_free(pool->shrinker);
 }
 
 static int zs_register_shrinker(struct zs_pool *pool)
 {
-	pool->shrinker.scan_objects = zs_shrinker_scan;
-	pool->shrinker.count_objects = zs_shrinker_count;
-	pool->shrinker.batch = 0;
-	pool->shrinker.seeks = DEFAULT_SEEKS;
+	pool->shrinker = shrinker_alloc(0, "mm-zspool:%s", pool->name);
+	if (!pool->shrinker)
+		return -ENOMEM;
+
+	pool->shrinker->scan_objects = zs_shrinker_scan;
+	pool->shrinker->count_objects = zs_shrinker_count;
+	pool->shrinker->batch = 0;
+	pool->shrinker->seeks = DEFAULT_SEEKS;
+	pool->shrinker->private_data = pool;
 
-	return register_shrinker(&pool->shrinker, "mm-zspool:%s",
-				 pool->name);
+	shrinker_register(pool->shrinker);
+
+	return 0;
 }
 
 static int calculate_zspage_chain_size(int class_size)
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:14:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:14:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570874.893278 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw8f-0004xL-Iq; Thu, 27 Jul 2023 08:14:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570874.893278; Thu, 27 Jul 2023 08:14:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw8f-0004x9-G1; Thu, 27 Jul 2023 08:14:25 +0000
Received: by outflank-mailman (input) for mailman id 570874;
 Thu, 27 Jul 2023 08:14:24 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw8e-00033O-Nk
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:14:24 +0000
Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com
 [2607:f8b0:4864:20::432])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9770cbbe-2c55-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:14:22 +0200 (CEST)
Received: by mail-pf1-x432.google.com with SMTP id
 d2e1a72fcca58-686f74a8992so78537b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:14:22 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.14.09
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:14:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9770cbbe-2c55-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445661; x=1691050461;
        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=Z8shjZqP4Y8hZDaFLi0y7A+vG6rpfakjLEwLFWECHfw=;
        b=M90va2ss9YMh+De8/KZ+mVAcBrFGEU+GzcGNqxT+B7hxTFEFMd5WuiRk55c0waVg/i
         KUSKiUTPKXnQRLgL7+hNGJB6n7fW48sv8jtOOA7F/yud6N73bo3romR87IwxTWFghhtj
         +YqkOMHpv3kLBbjEgh8NplH0r6imKflx3JaCipHnW/k8FR0eXG63PDYGiheNwgxfAvYO
         s4RNvSYPNCMRAhjFOV4c7zk3yoOMMnjDLt+tw6HnbliXEGOVORcHeWA+2V79c3P+B/9H
         uhy/DS05CaNG4GhbfQJuetBgKgR0N62DJbP4l44spA0q6/uulU3xcf96dcv+7F9txF9C
         bWPA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445661; x=1691050461;
        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=Z8shjZqP4Y8hZDaFLi0y7A+vG6rpfakjLEwLFWECHfw=;
        b=VOpdvJfuZFA5/E6GVNQ4TFaoq2bOZoIrBIqKREajL686uCnOtga925EmmUk84vZb2O
         wmmbvXdP6Z4YLgfw3i5f1YY8IjPXKI1Ed4qrrOm9rCN3lzFjXt1aiFEiTyxQhQCh6QTV
         mlBv84v4W/4SnyId844w8DKAN538NeDae/TMzCFn5zac7QsnEtSyx/Cnx/oJnK843VVr
         hBaKAJKuOBiVmXgn9nNU33mQSO0XETY5KHyLm3bfh5N32naDWx21gzg7pGrQN8HAp0ce
         fyRzHG0GzJKXgY8f8YTJt4j0L/Qs+lvFJ4Nx2rgCBW1kfVI8NPEFferdLZX7eFyG8C/s
         nEgw==
X-Gm-Message-State: ABy/qLbCE3I3YYxZEeSoLzwDS23fHX6FC6Rg4rSFLp6dMc+MpQA5Do8t
	+loP0tV6hAYCppVMgJhf+K39+A==
X-Google-Smtp-Source: APBJJlFLUJzqiKbCmr51AmVixakC62oPoMujZW4POdUPOnyVlrtViOXc2TPW8l2+gcY0Xyv3B9lWUA==
X-Received: by 2002:a05:6a20:4304:b0:111:a0e5:d2b7 with SMTP id h4-20020a056a20430400b00111a0e5d2b7mr5727834pzk.4.1690445661472;
        Thu, 27 Jul 2023 01:14:21 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 42/49] fs: super: dynamically allocate the s_shrink
Date: Thu, 27 Jul 2023 16:04:55 +0800
Message-Id: <20230727080502.77895-43-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the s_shrink, so that it can be freed asynchronously
using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical
section when releasing the struct super_block.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 fs/btrfs/super.c   |  2 +-
 fs/kernfs/mount.c  |  2 +-
 fs/proc/root.c     |  2 +-
 fs/super.c         | 36 ++++++++++++++++++++----------------
 include/linux/fs.h |  2 +-
 5 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index cffdd6f7f8e8..4c9c878b0da4 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1519,7 +1519,7 @@ static struct dentry *btrfs_mount_root(struct file_system_type *fs_type,
 			error = -EBUSY;
 	} else {
 		snprintf(s->s_id, sizeof(s->s_id), "%pg", bdev);
-		shrinker_debugfs_rename(&s->s_shrink, "sb-%s:%s", fs_type->name,
+		shrinker_debugfs_rename(s->s_shrink, "sb-%s:%s", fs_type->name,
 					s->s_id);
 		btrfs_sb(s)->bdev_holder = fs_type;
 		error = btrfs_fill_super(s, fs_devices, data);
diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c
index d49606accb07..2657ff1181f1 100644
--- a/fs/kernfs/mount.c
+++ b/fs/kernfs/mount.c
@@ -256,7 +256,7 @@ static int kernfs_fill_super(struct super_block *sb, struct kernfs_fs_context *k
 	sb->s_time_gran = 1;
 
 	/* sysfs dentries and inodes don't require IO to create */
-	sb->s_shrink.seeks = 0;
+	sb->s_shrink->seeks = 0;
 
 	/* get root inode, initialize and unlock it */
 	down_read(&kf_root->kernfs_rwsem);
diff --git a/fs/proc/root.c b/fs/proc/root.c
index a86e65a608da..22b78b28b477 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -188,7 +188,7 @@ static int proc_fill_super(struct super_block *s, struct fs_context *fc)
 	s->s_stack_depth = FILESYSTEM_MAX_STACK_DEPTH;
 
 	/* procfs dentries and inodes don't require IO to create */
-	s->s_shrink.seeks = 0;
+	s->s_shrink->seeks = 0;
 
 	pde_get(&proc_root);
 	root_inode = proc_get_inode(s, &proc_root);
diff --git a/fs/super.c b/fs/super.c
index da68584815e4..68b3877af941 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -67,7 +67,7 @@ static unsigned long super_cache_scan(struct shrinker *shrink,
 	long	dentries;
 	long	inodes;
 
-	sb = container_of(shrink, struct super_block, s_shrink);
+	sb = shrink->private_data;
 
 	/*
 	 * Deadlock avoidance.  We may hold various FS locks, and we don't want
@@ -120,7 +120,7 @@ static unsigned long super_cache_count(struct shrinker *shrink,
 	struct super_block *sb;
 	long	total_objects = 0;
 
-	sb = container_of(shrink, struct super_block, s_shrink);
+	sb = shrink->private_data;
 
 	/*
 	 * We don't call trylock_super() here as it is a scalability bottleneck,
@@ -182,7 +182,7 @@ static void destroy_unused_super(struct super_block *s)
 	security_sb_free(s);
 	put_user_ns(s->s_user_ns);
 	kfree(s->s_subtype);
-	free_prealloced_shrinker(&s->s_shrink);
+	shrinker_free(s->s_shrink);
 	/* no delays needed */
 	destroy_super_work(&s->destroy_work);
 }
@@ -259,16 +259,20 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags,
 	s->s_time_min = TIME64_MIN;
 	s->s_time_max = TIME64_MAX;
 
-	s->s_shrink.seeks = DEFAULT_SEEKS;
-	s->s_shrink.scan_objects = super_cache_scan;
-	s->s_shrink.count_objects = super_cache_count;
-	s->s_shrink.batch = 1024;
-	s->s_shrink.flags = SHRINKER_NUMA_AWARE | SHRINKER_MEMCG_AWARE;
-	if (prealloc_shrinker(&s->s_shrink, "sb-%s", type->name))
+	s->s_shrink = shrinker_alloc(SHRINKER_NUMA_AWARE | SHRINKER_MEMCG_AWARE,
+				     "sb-%s", type->name);
+	if (!s->s_shrink)
 		goto fail;
-	if (list_lru_init_memcg(&s->s_dentry_lru, &s->s_shrink))
+
+	s->s_shrink->seeks = DEFAULT_SEEKS;
+	s->s_shrink->scan_objects = super_cache_scan;
+	s->s_shrink->count_objects = super_cache_count;
+	s->s_shrink->batch = 1024;
+	s->s_shrink->private_data = s;
+
+	if (list_lru_init_memcg(&s->s_dentry_lru, s->s_shrink))
 		goto fail;
-	if (list_lru_init_memcg(&s->s_inode_lru, &s->s_shrink))
+	if (list_lru_init_memcg(&s->s_inode_lru, s->s_shrink))
 		goto fail;
 	return s;
 
@@ -326,7 +330,7 @@ void deactivate_locked_super(struct super_block *s)
 {
 	struct file_system_type *fs = s->s_type;
 	if (atomic_dec_and_test(&s->s_active)) {
-		unregister_shrinker(&s->s_shrink);
+		shrinker_free(s->s_shrink);
 		fs->kill_sb(s);
 
 		/*
@@ -599,7 +603,7 @@ struct super_block *sget_fc(struct fs_context *fc,
 	hlist_add_head(&s->s_instances, &s->s_type->fs_supers);
 	spin_unlock(&sb_lock);
 	get_filesystem(s->s_type);
-	register_shrinker_prepared(&s->s_shrink);
+	shrinker_register(s->s_shrink);
 	return s;
 
 share_extant_sb:
@@ -678,7 +682,7 @@ struct super_block *sget(struct file_system_type *type,
 	hlist_add_head(&s->s_instances, &type->fs_supers);
 	spin_unlock(&sb_lock);
 	get_filesystem(type);
-	register_shrinker_prepared(&s->s_shrink);
+	shrinker_register(s->s_shrink);
 	return s;
 }
 EXPORT_SYMBOL(sget);
@@ -1312,7 +1316,7 @@ int get_tree_bdev(struct fs_context *fc,
 		down_write(&s->s_umount);
 	} else {
 		snprintf(s->s_id, sizeof(s->s_id), "%pg", bdev);
-		shrinker_debugfs_rename(&s->s_shrink, "sb-%s:%s",
+		shrinker_debugfs_rename(s->s_shrink, "sb-%s:%s",
 					fc->fs_type->name, s->s_id);
 		sb_set_blocksize(s, block_size(bdev));
 		error = fill_super(s, fc);
@@ -1385,7 +1389,7 @@ struct dentry *mount_bdev(struct file_system_type *fs_type,
 		down_write(&s->s_umount);
 	} else {
 		snprintf(s->s_id, sizeof(s->s_id), "%pg", bdev);
-		shrinker_debugfs_rename(&s->s_shrink, "sb-%s:%s",
+		shrinker_debugfs_rename(s->s_shrink, "sb-%s:%s",
 					fs_type->name, s->s_id);
 		sb_set_blocksize(s, block_size(bdev));
 		error = fill_super(s, data, flags & SB_SILENT ? 1 : 0);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 891cf662b26f..500238213fd9 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1232,7 +1232,7 @@ struct super_block {
 
 	const struct dentry_operations *s_d_op; /* default d_op for dentries */
 
-	struct shrinker s_shrink;	/* per-sb shrinker handle */
+	struct shrinker *s_shrink;	/* per-sb shrinker handle */
 
 	/* Number of inodes with nlink == 0 but still referenced */
 	atomic_long_t s_remove_count;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:14:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:14:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570876.893288 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw8s-0005Y0-Rp; Thu, 27 Jul 2023 08:14:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570876.893288; Thu, 27 Jul 2023 08:14:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw8s-0005Xs-Ow; Thu, 27 Jul 2023 08:14:38 +0000
Received: by outflank-mailman (input) for mailman id 570876;
 Thu, 27 Jul 2023 08:14:37 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw8r-00033O-8O
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:14:37 +0000
Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com
 [2607:f8b0:4864:20::434])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9ee76aca-2c55-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:14:35 +0200 (CEST)
Received: by mail-pf1-x434.google.com with SMTP id
 d2e1a72fcca58-686f6231bdeso113997b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:14:35 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.14.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:14:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9ee76aca-2c55-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445674; x=1691050474;
        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=G6s8y0Dka4KE4srOwy3I0FSAaIGrcYmvE6JrVZfCpDs=;
        b=MBKqtR+m6tRDLwGbmGnhkuL4q0cqlWsjDeU7ZVRwaOZMOF0riGkcJrkyInKFI0pYis
         mWaNeHtwDzmym2/d2f7OIfkckgap6Prz7ne5Q+65Q9kFa2z8w6TXtQPQCrjIFsYVVR2m
         PRIs97KnddHeo2KzvpuxuJU//NWKLj0FPiuARmlExd2GlY1ot6WyHoUBUu1qPjJUPpT3
         ZsG43k1Oz59Ii0r86zAALutb1Gd6A6cdhWxvrkZ21MO6UtDcxtLUaksPoYyR3li5MX3H
         RGe7M6IrmRvaAAMZm9ToAYQ8mPB0OkHGFsJVWBGXFBUa+qGlQpcM3sB1mv4YN0cfvLiI
         gBbg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445674; x=1691050474;
        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=G6s8y0Dka4KE4srOwy3I0FSAaIGrcYmvE6JrVZfCpDs=;
        b=bmosZXmwJHVfANF+Cb1+yo72aPyNyyzzUJ6dsbgycsneONQ6GAbwv2gi8e/xu+kUym
         XRCsOML7hMSFLCa5FOzAmDwwuskdRTbOFJGKIQpzd9egYv3O66FG8TjPKIhYmpSMap1G
         8o1pSCyucwB3ZLSv0AxW1rKEGyCHFMWsNcXE1C3Gd2MEA+NwGaQEFkrZOixpcq3UWFF/
         Iu0+t3G3SAq/cSm+t16zljqdvJPDepAzrGbzeviuf10L+NQTcAQ+i1QG1wsXVlO3MVeV
         9+O/z4aKp1HCVOeskoLrjgBWZAvRK8xUvihzzziRR6MzE5kkil6OIr9fYZLNbB3FwNKp
         bVzA==
X-Gm-Message-State: ABy/qLbKk7EA310IKU2MHfYHWFicbT1gBMAMcJ8gXpjdKqjkFgtzTUFd
	LRFSSA2HzJ2eDcB981u1Asda5A==
X-Google-Smtp-Source: APBJJlHZc+tyEor0irWiukNNv0+VJsTfo/jEPBj29UYMUTILxfRG5SoeWB7BzCnWVmRXaEQSTc0xVA==
X-Received: by 2002:a05:6a00:4a0e:b0:677:3439:874a with SMTP id do14-20020a056a004a0e00b006773439874amr5210105pfb.3.1690445673911;
        Thu, 27 Jul 2023 01:14:33 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 43/49] mm: shrinker: remove old APIs
Date: Thu, 27 Jul 2023 16:04:56 +0800
Message-Id: <20230727080502.77895-44-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Now no users are using the old APIs, just remove them.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 include/linux/shrinker.h |   7 --
 mm/shrinker.c            | 143 ---------------------------------------
 2 files changed, 150 deletions(-)

diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
index cc23ff0aee20..c55c07c3f0cb 100644
--- a/include/linux/shrinker.h
+++ b/include/linux/shrinker.h
@@ -103,13 +103,6 @@ struct shrinker *shrinker_alloc(unsigned int flags, const char *fmt, ...);
 void shrinker_register(struct shrinker *shrinker);
 void shrinker_free(struct shrinker *shrinker);
 
-extern int __printf(2, 3) prealloc_shrinker(struct shrinker *shrinker,
-					    const char *fmt, ...);
-extern void register_shrinker_prepared(struct shrinker *shrinker);
-extern int __printf(2, 3) register_shrinker(struct shrinker *shrinker,
-					    const char *fmt, ...);
-extern void unregister_shrinker(struct shrinker *shrinker);
-extern void free_prealloced_shrinker(struct shrinker *shrinker);
 extern void synchronize_shrinkers(void);
 
 #ifdef CONFIG_SHRINKER_DEBUG
diff --git a/mm/shrinker.c b/mm/shrinker.c
index 43a375f954f3..3ab301ff122d 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -651,149 +651,6 @@ void shrinker_free(struct shrinker *shrinker)
 }
 EXPORT_SYMBOL_GPL(shrinker_free);
 
-/*
- * Add a shrinker callback to be called from the vm.
- */
-static int __prealloc_shrinker(struct shrinker *shrinker)
-{
-	unsigned int size;
-	int err;
-
-	if (shrinker->flags & SHRINKER_MEMCG_AWARE) {
-		err = prealloc_memcg_shrinker(shrinker);
-		if (err != -ENOSYS)
-			return err;
-
-		shrinker->flags &= ~SHRINKER_MEMCG_AWARE;
-	}
-
-	size = sizeof(*shrinker->nr_deferred);
-	if (shrinker->flags & SHRINKER_NUMA_AWARE)
-		size *= nr_node_ids;
-
-	shrinker->nr_deferred = kzalloc(size, GFP_KERNEL);
-	if (!shrinker->nr_deferred)
-		return -ENOMEM;
-
-	return 0;
-}
-
-#ifdef CONFIG_SHRINKER_DEBUG
-int prealloc_shrinker(struct shrinker *shrinker, const char *fmt, ...)
-{
-	va_list ap;
-	int err;
-
-	va_start(ap, fmt);
-	shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
-	va_end(ap);
-	if (!shrinker->name)
-		return -ENOMEM;
-
-	err = __prealloc_shrinker(shrinker);
-	if (err) {
-		kfree_const(shrinker->name);
-		shrinker->name = NULL;
-	}
-
-	return err;
-}
-#else
-int prealloc_shrinker(struct shrinker *shrinker, const char *fmt, ...)
-{
-	return __prealloc_shrinker(shrinker);
-}
-#endif
-
-void free_prealloced_shrinker(struct shrinker *shrinker)
-{
-#ifdef CONFIG_SHRINKER_DEBUG
-	kfree_const(shrinker->name);
-	shrinker->name = NULL;
-#endif
-	if (shrinker->flags & SHRINKER_MEMCG_AWARE) {
-		down_write(&shrinker_rwsem);
-		unregister_memcg_shrinker(shrinker);
-		up_write(&shrinker_rwsem);
-		return;
-	}
-
-	kfree(shrinker->nr_deferred);
-	shrinker->nr_deferred = NULL;
-}
-
-void register_shrinker_prepared(struct shrinker *shrinker)
-{
-	down_write(&shrinker_rwsem);
-	list_add_tail(&shrinker->list, &shrinker_list);
-	shrinker->flags |= SHRINKER_REGISTERED;
-	shrinker_debugfs_add(shrinker);
-	up_write(&shrinker_rwsem);
-}
-
-static int __register_shrinker(struct shrinker *shrinker)
-{
-	int err = __prealloc_shrinker(shrinker);
-
-	if (err)
-		return err;
-	register_shrinker_prepared(shrinker);
-	return 0;
-}
-
-#ifdef CONFIG_SHRINKER_DEBUG
-int register_shrinker(struct shrinker *shrinker, const char *fmt, ...)
-{
-	va_list ap;
-	int err;
-
-	va_start(ap, fmt);
-	shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
-	va_end(ap);
-	if (!shrinker->name)
-		return -ENOMEM;
-
-	err = __register_shrinker(shrinker);
-	if (err) {
-		kfree_const(shrinker->name);
-		shrinker->name = NULL;
-	}
-	return err;
-}
-#else
-int register_shrinker(struct shrinker *shrinker, const char *fmt, ...)
-{
-	return __register_shrinker(shrinker);
-}
-#endif
-EXPORT_SYMBOL(register_shrinker);
-
-/*
- * Remove one
- */
-void unregister_shrinker(struct shrinker *shrinker)
-{
-	struct dentry *debugfs_entry;
-	int debugfs_id;
-
-	if (!(shrinker->flags & SHRINKER_REGISTERED))
-		return;
-
-	down_write(&shrinker_rwsem);
-	list_del(&shrinker->list);
-	shrinker->flags &= ~SHRINKER_REGISTERED;
-	if (shrinker->flags & SHRINKER_MEMCG_AWARE)
-		unregister_memcg_shrinker(shrinker);
-	debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);
-	up_write(&shrinker_rwsem);
-
-	shrinker_debugfs_remove(debugfs_entry, debugfs_id);
-
-	kfree(shrinker->nr_deferred);
-	shrinker->nr_deferred = NULL;
-}
-EXPORT_SYMBOL(unregister_shrinker);
-
 /**
  * synchronize_shrinkers - Wait for all running shrinkers to complete.
  *
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:15:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:15:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570878.893299 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw9e-0006Kk-5T; Thu, 27 Jul 2023 08:15:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570878.893299; Thu, 27 Jul 2023 08:15:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOw9e-0006Kb-1J; Thu, 27 Jul 2023 08:15:26 +0000
Received: by outflank-mailman (input) for mailman id 570878;
 Thu, 27 Jul 2023 08:15:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw9c-0006Jy-Hz
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:15:24 +0000
Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com
 [2607:f8b0:4864:20::433])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bb9e76f4-2c55-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:15:23 +0200 (CEST)
Received: by mail-pf1-x433.google.com with SMTP id
 d2e1a72fcca58-6748a616e17so184173b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:15:23 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.15.10
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:15:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bb9e76f4-2c55-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445722; x=1691050522;
        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=kfKKsEp61SZUnTy00HUcIO/dAXsDrrCBrc1q4f5gA2g=;
        b=EAS6K8pjZHV2xJO1k0B0O2ENzb3/Vvl+c5sC6vZF5+RNctHPYXK3F4aD7Xzt8amvSX
         Sp0sM3dY6nrfZgyX03OOoIKbasLRWXH327iv4+GYUr4WlO1QPIHvBbrRjUoddMLJYEtj
         qslIbW38aWpZfadSfI+TaMUP7PcrUPJ3woAJMv4ugKgPJM767PAG7K9gWxMSKIL9CKj3
         w5CY/SzoV5mu91kUw+3ztoEROa7i9Mv96qiOzuHElFUZjh2ImlDQY3RLu003MMnVyV3S
         TQhJNq9ppxsbvsUjd927IP6iiwsq7VIfzEbkN9zPwoI9Valaw0w8Qu8JFGFsYg3rQsoY
         gM7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445722; x=1691050522;
        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=kfKKsEp61SZUnTy00HUcIO/dAXsDrrCBrc1q4f5gA2g=;
        b=UIR1bHE5XQMd6LYWsVakQgJdXoUQFZWZGlIgaQ9Q3g15mQFx6aqd4KHE+yu+xqevb6
         rEnhDa+N2p4g44n6IXMpyrK/47M32O9RBJrJWJ+VLHiK6kzbGIuINkzQ1FJ8dkwEya86
         JlVY7zCuQghK0LxKt2SQMk823V8GFoWiIjiqKyoMm6K2UdjvMPV4Rcqf5IsMtgCl2vUV
         AzXla0dPTRckgOPGUJdwm9SFp/i57YPpPrHL/rFPhebVsvFVUMXw4gijM4HAc/1JZrRe
         32YiaDetHP1xn/JmBY+HT8NbuylBvvU8Uw4gPVmdOJiFvbSIyAka/VM+juq1eWsWDeyu
         Fciw==
X-Gm-Message-State: ABy/qLZGSjw4kmQA0ugSb1GpJWQmfu2Cc6QsDhvO/FYzi7GBYFsOkQ0y
	7VZDUuqdejYITvi/czcKiuhArw==
X-Google-Smtp-Source: APBJJlGaIHiWHX80BWphqmbYYC2Qe9rA0t1NXuG9/ru/q26OnfFQXVEhM5bGyqGhtVnixSectLT5LA==
X-Received: by 2002:a05:6a00:4792:b0:668:834d:4bd with SMTP id dh18-20020a056a00479200b00668834d04bdmr4689753pfb.0.1690445722143;
        Thu, 27 Jul 2023 01:15:22 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v3 47/49] mm: shrinker: make memcg slab shrink lockless
Date: Thu, 27 Jul 2023 16:05:00 +0800
Message-Id: <20230727080502.77895-48-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Like global slab shrink, this commit also uses refcount+RCU method to make
memcg slab shrink lockless.

Use the following script to do slab shrink stress test:

```

DIR="/root/shrinker/memcg/mnt"

do_create()
{
    mkdir -p /sys/fs/cgroup/memory/test
    echo 4G > /sys/fs/cgroup/memory/test/memory.limit_in_bytes
    for i in `seq 0 $1`;
    do
        mkdir -p /sys/fs/cgroup/memory/test/$i;
        echo $$ > /sys/fs/cgroup/memory/test/$i/cgroup.procs;
        mkdir -p $DIR/$i;
    done
}

do_mount()
{
    for i in `seq $1 $2`;
    do
        mount -t tmpfs $i $DIR/$i;
    done
}

do_touch()
{
    for i in `seq $1 $2`;
    do
        echo $$ > /sys/fs/cgroup/memory/test/$i/cgroup.procs;
        dd if=/dev/zero of=$DIR/$i/file$i bs=1M count=1 &
    done
}

case "$1" in
  touch)
    do_touch $2 $3
    ;;
  test)
    do_create 4000
    do_mount 0 4000
    do_touch 0 3000
    ;;
  *)
    exit 1
    ;;
esac
```

Save the above script, then run test and touch commands. Then we can use
the following perf command to view hotspots:

perf top -U -F 999

1) Before applying this patchset:

  40.44%  [kernel]            [k] down_read_trylock
  17.59%  [kernel]            [k] up_read
  13.64%  [kernel]            [k] pv_native_safe_halt
  11.90%  [kernel]            [k] shrink_slab
   8.21%  [kernel]            [k] idr_find
   2.71%  [kernel]            [k] _find_next_bit
   1.36%  [kernel]            [k] shrink_node
   0.81%  [kernel]            [k] shrink_lruvec
   0.80%  [kernel]            [k] __radix_tree_lookup
   0.50%  [kernel]            [k] do_shrink_slab
   0.21%  [kernel]            [k] list_lru_count_one
   0.16%  [kernel]            [k] mem_cgroup_iter

2) After applying this patchset:

  60.17%  [kernel]           [k] shrink_slab
  20.42%  [kernel]           [k] pv_native_safe_halt
   3.03%  [kernel]           [k] do_shrink_slab
   2.73%  [kernel]           [k] shrink_node
   2.27%  [kernel]           [k] shrink_lruvec
   2.00%  [kernel]           [k] __rcu_read_unlock
   1.92%  [kernel]           [k] mem_cgroup_iter
   0.98%  [kernel]           [k] __rcu_read_lock
   0.91%  [kernel]           [k] osq_lock
   0.63%  [kernel]           [k] mem_cgroup_calculate_protection
   0.55%  [kernel]           [k] shrinker_put
   0.46%  [kernel]           [k] list_lru_count_one

We can see that the first perf hotspot becomes shrink_slab, which is what
we expect.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 mm/shrinker.c | 80 ++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 54 insertions(+), 26 deletions(-)

diff --git a/mm/shrinker.c b/mm/shrinker.c
index d318f5621862..fee6f62904fb 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -107,6 +107,12 @@ static struct shrinker_info *shrinker_info_protected(struct mem_cgroup *memcg,
 					 lockdep_is_held(&shrinker_rwsem));
 }
 
+static struct shrinker_info *shrinker_info_rcu(struct mem_cgroup *memcg,
+					       int nid)
+{
+	return rcu_dereference(memcg->nodeinfo[nid]->shrinker_info);
+}
+
 static int expand_one_shrinker_info(struct mem_cgroup *memcg, int new_size,
 				    int old_size, int new_nr_max)
 {
@@ -198,7 +204,7 @@ void set_shrinker_bit(struct mem_cgroup *memcg, int nid, int shrinker_id)
 		struct shrinker_info_unit *unit;
 
 		rcu_read_lock();
-		info = rcu_dereference(memcg->nodeinfo[nid]->shrinker_info);
+		info = shrinker_info_rcu(memcg, nid);
 		unit = info->unit[shriner_id_to_index(shrinker_id)];
 		if (!WARN_ON_ONCE(shrinker_id >= info->map_nr_max)) {
 			/* Pairs with smp mb in shrink_slab() */
@@ -211,7 +217,7 @@ void set_shrinker_bit(struct mem_cgroup *memcg, int nid, int shrinker_id)
 
 static DEFINE_IDR(shrinker_idr);
 
-static int prealloc_memcg_shrinker(struct shrinker *shrinker)
+static int shrinker_memcg_alloc(struct shrinker *shrinker)
 {
 	int id, ret = -ENOMEM;
 
@@ -219,7 +225,6 @@ static int prealloc_memcg_shrinker(struct shrinker *shrinker)
 		return -ENOSYS;
 
 	down_write(&shrinker_rwsem);
-	/* This may call shrinker, so it must use down_read_trylock() */
 	id = idr_alloc(&shrinker_idr, shrinker, 0, 0, GFP_KERNEL);
 	if (id < 0)
 		goto unlock;
@@ -237,7 +242,7 @@ static int prealloc_memcg_shrinker(struct shrinker *shrinker)
 	return ret;
 }
 
-static void unregister_memcg_shrinker(struct shrinker *shrinker)
+static void shrinker_memcg_remove(struct shrinker *shrinker)
 {
 	int id = shrinker->id;
 
@@ -253,10 +258,15 @@ static long xchg_nr_deferred_memcg(int nid, struct shrinker *shrinker,
 {
 	struct shrinker_info *info;
 	struct shrinker_info_unit *unit;
+	long nr_deferred;
 
-	info = shrinker_info_protected(memcg, nid);
+	rcu_read_lock();
+	info = shrinker_info_rcu(memcg, nid);
 	unit = info->unit[shriner_id_to_index(shrinker->id)];
-	return atomic_long_xchg(&unit->nr_deferred[shriner_id_to_offset(shrinker->id)], 0);
+	nr_deferred = atomic_long_xchg(&unit->nr_deferred[shriner_id_to_offset(shrinker->id)], 0);
+	rcu_read_unlock();
+
+	return nr_deferred;
 }
 
 static long add_nr_deferred_memcg(long nr, int nid, struct shrinker *shrinker,
@@ -264,10 +274,16 @@ static long add_nr_deferred_memcg(long nr, int nid, struct shrinker *shrinker,
 {
 	struct shrinker_info *info;
 	struct shrinker_info_unit *unit;
+	long nr_deferred;
 
-	info = shrinker_info_protected(memcg, nid);
+	rcu_read_lock();
+	info = shrinker_info_rcu(memcg, nid);
 	unit = info->unit[shriner_id_to_index(shrinker->id)];
-	return atomic_long_add_return(nr, &unit->nr_deferred[shriner_id_to_offset(shrinker->id)]);
+	nr_deferred =
+		atomic_long_add_return(nr, &unit->nr_deferred[shriner_id_to_offset(shrinker->id)]);
+	rcu_read_unlock();
+
+	return nr_deferred;
 }
 
 void reparent_shrinker_deferred(struct mem_cgroup *memcg)
@@ -299,12 +315,12 @@ void reparent_shrinker_deferred(struct mem_cgroup *memcg)
 	up_read(&shrinker_rwsem);
 }
 #else
-static int prealloc_memcg_shrinker(struct shrinker *shrinker)
+static int shrinker_memcg_alloc(struct shrinker *shrinker)
 {
 	return -ENOSYS;
 }
 
-static void unregister_memcg_shrinker(struct shrinker *shrinker)
+static void shrinker_memcg_remove(struct shrinker *shrinker)
 {
 }
 
@@ -464,18 +480,23 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
 	if (!mem_cgroup_online(memcg))
 		return 0;
 
-	if (!down_read_trylock(&shrinker_rwsem))
-		return 0;
-
-	info = shrinker_info_protected(memcg, nid);
+again:
+	rcu_read_lock();
+	info = shrinker_info_rcu(memcg, nid);
 	if (unlikely(!info))
 		goto unlock;
 
-	for (; index < shriner_id_to_index(info->map_nr_max); index++) {
+	if (index < shriner_id_to_index(info->map_nr_max)) {
 		struct shrinker_info_unit *unit;
 
 		unit = info->unit[index];
 
+		/*
+		 * The shrinker_info_unit will not be freed, so we can
+		 * safely release the RCU lock here.
+		 */
+		rcu_read_unlock();
+
 		for_each_set_bit(offset, unit->map, SHRINKER_UNIT_BITS) {
 			struct shrink_control sc = {
 				.gfp_mask = gfp_mask,
@@ -485,12 +506,14 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
 			struct shrinker *shrinker;
 			int shrinker_id = calc_shrinker_id(index, offset);
 
+			rcu_read_lock();
 			shrinker = idr_find(&shrinker_idr, shrinker_id);
-			if (unlikely(!shrinker || !(shrinker->flags & SHRINKER_REGISTERED))) {
-				if (!shrinker)
-					clear_bit(offset, unit->map);
+			if (unlikely(!shrinker || !shrinker_try_get(shrinker))) {
+				clear_bit(offset, unit->map);
+				rcu_read_unlock();
 				continue;
 			}
+			rcu_read_unlock();
 
 			/* Call non-slab shrinkers even though kmem is disabled */
 			if (!memcg_kmem_online() &&
@@ -523,15 +546,20 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
 					set_shrinker_bit(memcg, nid, shrinker_id);
 			}
 			freed += ret;
-
-			if (rwsem_is_contended(&shrinker_rwsem)) {
-				freed = freed ? : 1;
-				goto unlock;
-			}
+			shrinker_put(shrinker);
 		}
+
+		/*
+		 * We have already exited the read-side of rcu critical section
+		 * before calling do_shrink_slab(), the shrinker_info may be
+		 * released in expand_one_shrinker_info(), so reacquire the
+		 * shrinker_info.
+		 */
+		index++;
+		goto again;
 	}
 unlock:
-	up_read(&shrinker_rwsem);
+	rcu_read_unlock();
 	return freed;
 }
 #else /* !CONFIG_MEMCG */
@@ -638,7 +666,7 @@ struct shrinker *shrinker_alloc(unsigned int flags, const char *fmt, ...)
 	shrinker->flags = flags | SHRINKER_ALLOCATED;
 
 	if (flags & SHRINKER_MEMCG_AWARE) {
-		err = prealloc_memcg_shrinker(shrinker);
+		err = shrinker_memcg_alloc(shrinker);
 		if (err == -ENOSYS)
 			shrinker->flags &= ~SHRINKER_MEMCG_AWARE;
 		else if (err == 0)
@@ -731,7 +759,7 @@ void shrinker_free(struct shrinker *shrinker)
 	}
 
 	if (shrinker->flags & SHRINKER_MEMCG_AWARE)
-		unregister_memcg_shrinker(shrinker);
+		shrinker_memcg_remove(shrinker);
 	up_write(&shrinker_rwsem);
 
 	if (debugfs_entry)
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570884.893326 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBZ-0007KA-O1; Thu, 27 Jul 2023 08:17:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570884.893326; Thu, 27 Jul 2023 08:17:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBZ-0007Ij-Fi; Thu, 27 Jul 2023 08:17:25 +0000
Received: by outflank-mailman (input) for mailman id 570884;
 Thu, 27 Jul 2023 08:17:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw7S-0001DS-8w
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:13:10 +0000
Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com
 [2607:f8b0:4864:20::42b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6bd67f85-2c55-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:13:09 +0200 (CEST)
Received: by mail-pf1-x42b.google.com with SMTP id
 d2e1a72fcca58-66d6a9851f3so168608b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:13:09 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.12.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:13:07 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6bd67f85-2c55-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445588; x=1691050388;
        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=SQyM2U1mZ/Gwc1nAOvYev1L9XLZmdJlRT0RgZ5HuwGo=;
        b=kd6rt5g6FvxszAExAWwDvnGLZ3nlFI6+LjpyYA2SwsBpfxyntyz5JxeLs4IsuFoqam
         BPrbW0IZbPo4bp5jr8CP6dW+kXsV2/xzlGqHNQMPkgHqzMSniXcziiHnCVK42nJM1noq
         S50aGwia7MX8euX+8hfeRRERjX2qwSrJrcd+yJ4VULel6DaWSf6W0hZ/qFtzG1N+JN0n
         uQB95m4CN8ZeNY7Xsu+pZiPFb9O3G4aVUw6FAsCxKpZx+yuB9vunfivBBZ8XUQHuWQvc
         AX+QkUyO8AP8Aa2+4wftvFDhdV62VUn8gnj7NjCNsCf/vREHbdt8IjenIeReKEgqNeKN
         BvoA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445588; x=1691050388;
        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=SQyM2U1mZ/Gwc1nAOvYev1L9XLZmdJlRT0RgZ5HuwGo=;
        b=bowyAzA4AazocHU6kFWdOSWCRTQcTNSRT5Ztx53ts5F2HkJRhtam8aQo0d1IJI0Gck
         70fcR6xIhIOVdHCkBNpHNOSU/BPn0Gv72iOjBhaAdyWjqT5fUgdyfh9ay5NI8n45+vyD
         +eA4uBAYW8uFXOD5jwhQWfQFArhE8w9wJdkObKWbNIUOZ3cQ3TZ+4d/RUh+Ui6H9Vprm
         JPG0gixeUShYGObbieEQjMaG1toUYGur4owCz59FsxYSqevyiDS1QeNVtWvHp49yqwY1
         NiTrrzUl/b6LJjbwoYhzMwtp5/b3Iy+c9UdBgACg8L9bpxznxRj/p/Egl1jqtoISm4S5
         wg7g==
X-Gm-Message-State: ABy/qLZTFrcyrEsrg9Gk9Orf0PVUkDe6Gz6BlVD7NVHyxImvjpQA11+r
	z87+/5cd1T2Uha88x9LL1w/4Zw==
X-Google-Smtp-Source: APBJJlGx3t3etMepgJMVu+n+Us77oI88lCmbMpzaxwGd8c6y1MJ13X5vnrHVztpBTHVV1RS/gpzzOQ==
X-Received: by 2002:a05:6a21:3281:b0:137:514a:982d with SMTP id yt1-20020a056a21328100b00137514a982dmr6062167pzb.6.1690445588272;
        Thu, 27 Jul 2023 01:13:08 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Chuck Lever <chuck.lever@oracle.com>,
	Jeff Layton <jlayton@kernel.org>
Subject: [PATCH v3 36/49] nfsd: dynamically allocate the nfsd-client shrinker
Date: Thu, 27 Jul 2023 16:04:49 +0800
Message-Id: <20230727080502.77895-37-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the nfsd-client shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct nfsd_net.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Acked-by: Chuck Lever <chuck.lever@oracle.com>
Acked-by: Jeff Layton <jlayton@kernel.org>
---
 fs/nfsd/netns.h     |  2 +-
 fs/nfsd/nfs4state.c | 20 ++++++++++++--------
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h
index ec49b200b797..f669444d5336 100644
--- a/fs/nfsd/netns.h
+++ b/fs/nfsd/netns.h
@@ -195,7 +195,7 @@ struct nfsd_net {
 	int			nfs4_max_clients;
 
 	atomic_t		nfsd_courtesy_clients;
-	struct shrinker		nfsd_client_shrinker;
+	struct shrinker		*nfsd_client_shrinker;
 	struct work_struct	nfsd_shrinker_work;
 };
 
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index ef7118ebee00..75334a43ded4 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4388,8 +4388,7 @@ static unsigned long
 nfsd4_state_shrinker_count(struct shrinker *shrink, struct shrink_control *sc)
 {
 	int count;
-	struct nfsd_net *nn = container_of(shrink,
-			struct nfsd_net, nfsd_client_shrinker);
+	struct nfsd_net *nn = shrink->private_data;
 
 	count = atomic_read(&nn->nfsd_courtesy_clients);
 	if (!count)
@@ -8123,12 +8122,17 @@ static int nfs4_state_create_net(struct net *net)
 	INIT_WORK(&nn->nfsd_shrinker_work, nfsd4_state_shrinker_worker);
 	get_net(net);
 
-	nn->nfsd_client_shrinker.scan_objects = nfsd4_state_shrinker_scan;
-	nn->nfsd_client_shrinker.count_objects = nfsd4_state_shrinker_count;
-	nn->nfsd_client_shrinker.seeks = DEFAULT_SEEKS;
-
-	if (register_shrinker(&nn->nfsd_client_shrinker, "nfsd-client"))
+	nn->nfsd_client_shrinker = shrinker_alloc(0, "nfsd-client");
+	if (!nn->nfsd_client_shrinker)
 		goto err_shrinker;
+
+	nn->nfsd_client_shrinker->scan_objects = nfsd4_state_shrinker_scan;
+	nn->nfsd_client_shrinker->count_objects = nfsd4_state_shrinker_count;
+	nn->nfsd_client_shrinker->seeks = DEFAULT_SEEKS;
+	nn->nfsd_client_shrinker->private_data = nn;
+
+	shrinker_register(nn->nfsd_client_shrinker);
+
 	return 0;
 
 err_shrinker:
@@ -8226,7 +8230,7 @@ nfs4_state_shutdown_net(struct net *net)
 	struct list_head *pos, *next, reaplist;
 	struct nfsd_net *nn = net_generic(net, nfsd_net_id);
 
-	unregister_shrinker(&nn->nfsd_client_shrinker);
+	shrinker_free(nn->nfsd_client_shrinker);
 	cancel_work(&nn->nfsd_shrinker_work);
 	cancel_delayed_work_sync(&nn->laundromat_work);
 	locks_end_grace(&nn->nfsd4_manager);
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570886.893336 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBa-0007UN-A6; Thu, 27 Jul 2023 08:17:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570886.893336; Thu, 27 Jul 2023 08:17:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBZ-0007T4-TU; Thu, 27 Jul 2023 08:17:25 +0000
Received: by outflank-mailman (input) for mailman id 570886;
 Thu, 27 Jul 2023 08:17:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw64-0001DS-B7
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:11:44 +0000
Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com
 [2607:f8b0:4864:20::42a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 38a03c80-2c55-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:11:43 +0200 (CEST)
Received: by mail-pf1-x42a.google.com with SMTP id
 d2e1a72fcca58-686f6231bdeso113471b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:11:43 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.11.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:11:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 38a03c80-2c55-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445502; x=1691050302;
        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=LaFX3BwmrpvhCQ7689MuoFj6fWFWMuerWJZNZNxWVVc=;
        b=SGV84iDT12fuj4KQ/vgxpHx68bD/8JsYSa9nhb7ntFAq0TKpEUCTaHREzmRsJ3Oz9G
         gFKmoptXd+Bze48vx/wk2NbZ7T10E7S2MEqYjOuFeG7krpKwSKpfVHBIQRglXfDWTvzO
         H6VjPKPaTyQraf7CXaxRYntDfW/rFmDGA8pIc8wp3mkyDCZKtDmTVn+WhnbJ9UTHRuGw
         cfWrmdeiaPvvoPdILYK4+expmzf+8d5vjjDAS5qG8jY/gHHW1jvZoSyULsapwlJ7yOSa
         R+fxk2s2E87YRuuXF3DsPLATcyScHTHvPiXBlY0TGTmF0pFa842v0dWDdf9orTc8Pn3s
         TgHw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445502; x=1691050302;
        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=LaFX3BwmrpvhCQ7689MuoFj6fWFWMuerWJZNZNxWVVc=;
        b=UCl29DLWo7TBt37dHoh+CsmkvvRldhJ6GTk72XgBKlTbw+OdV3RmV6BAl3Zpt3IbkC
         Ke/45wyjhDY3G0gjTcLlln8KwPopRX1S7Pa88zI2EgUzx1skFFSwaanPri4o2GFuqCXB
         slQ+vFU+ciPy8NeF9OKFpCnLkwGGHa1PQovzMkJJ1lhjs7XsfJYoiduHO/7bFpeU62bb
         1QJ5GXlQxvRH8AKTeHhUqwiSnwKsm8og7u12iWLvrvMWbNkKtHvd7XGZqXuWm4xrTyXI
         uR/+X4CB2GFSem+MC2T5V2XqqWtp2wFm5tODEx0pgTZJlTmxr8UmUoOWqwcasmFfVLQJ
         jPyg==
X-Gm-Message-State: ABy/qLYchj62JlTZwiwz5igl2R0vMxHmeMEVP3IHVf/bvy9TM1mAztup
	H+RVKXvzbQmLCWpKXDTO/SoN1w==
X-Google-Smtp-Source: APBJJlE5krPFtX55mdmbm5NUPWWjP9qjtSRaT4qUAQtTa6jtnXVyWfbzlnq9LXdP1SlmgTnMsVycpA==
X-Received: by 2002:a05:6a21:78a8:b0:137:3eba:b81f with SMTP id bf40-20020a056a2178a800b001373ebab81fmr6016028pzc.3.1690445502183;
        Thu, 27 Jul 2023 01:11:42 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 29/49] md/raid5: dynamically allocate the md-raid5 shrinker
Date: Thu, 27 Jul 2023 16:04:42 +0800
Message-Id: <20230727080502.77895-30-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the md-raid5 shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct r5conf.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 drivers/md/raid5.c | 25 ++++++++++++++-----------
 drivers/md/raid5.h |  2 +-
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 85b3004594e0..fbb4e6f5ff43 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7414,7 +7414,7 @@ static void free_conf(struct r5conf *conf)
 
 	log_exit(conf);
 
-	unregister_shrinker(&conf->shrinker);
+	shrinker_free(conf->shrinker);
 	free_thread_groups(conf);
 	shrink_stripes(conf);
 	raid5_free_percpu(conf);
@@ -7462,7 +7462,7 @@ static int raid5_alloc_percpu(struct r5conf *conf)
 static unsigned long raid5_cache_scan(struct shrinker *shrink,
 				      struct shrink_control *sc)
 {
-	struct r5conf *conf = container_of(shrink, struct r5conf, shrinker);
+	struct r5conf *conf = shrink->private_data;
 	unsigned long ret = SHRINK_STOP;
 
 	if (mutex_trylock(&conf->cache_size_mutex)) {
@@ -7483,7 +7483,7 @@ static unsigned long raid5_cache_scan(struct shrinker *shrink,
 static unsigned long raid5_cache_count(struct shrinker *shrink,
 				       struct shrink_control *sc)
 {
-	struct r5conf *conf = container_of(shrink, struct r5conf, shrinker);
+	struct r5conf *conf = shrink->private_data;
 
 	if (conf->max_nr_stripes < conf->min_nr_stripes)
 		/* unlikely, but not impossible */
@@ -7718,18 +7718,21 @@ static struct r5conf *setup_conf(struct mddev *mddev)
 	 * it reduces the queue depth and so can hurt throughput.
 	 * So set it rather large, scaled by number of devices.
 	 */
-	conf->shrinker.seeks = DEFAULT_SEEKS * conf->raid_disks * 4;
-	conf->shrinker.scan_objects = raid5_cache_scan;
-	conf->shrinker.count_objects = raid5_cache_count;
-	conf->shrinker.batch = 128;
-	conf->shrinker.flags = 0;
-	ret = register_shrinker(&conf->shrinker, "md-raid5:%s", mdname(mddev));
-	if (ret) {
-		pr_warn("md/raid:%s: couldn't register shrinker.\n",
+	conf->shrinker = shrinker_alloc(0, "md-raid5:%s", mdname(mddev));
+	if (!conf->shrinker) {
+		pr_warn("md/raid:%s: couldn't allocate shrinker.\n",
 			mdname(mddev));
 		goto abort;
 	}
 
+	conf->shrinker->seeks = DEFAULT_SEEKS * conf->raid_disks * 4;
+	conf->shrinker->scan_objects = raid5_cache_scan;
+	conf->shrinker->count_objects = raid5_cache_count;
+	conf->shrinker->batch = 128;
+	conf->shrinker->private_data = conf;
+
+	shrinker_register(conf->shrinker);
+
 	sprintf(pers_name, "raid%d", mddev->new_level);
 	rcu_assign_pointer(conf->thread,
 			   md_register_thread(raid5d, mddev, pers_name));
diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h
index 97a795979a35..22bea20eccbd 100644
--- a/drivers/md/raid5.h
+++ b/drivers/md/raid5.h
@@ -670,7 +670,7 @@ struct r5conf {
 	wait_queue_head_t	wait_for_stripe;
 	wait_queue_head_t	wait_for_overlap;
 	unsigned long		cache_state;
-	struct shrinker		shrinker;
+	struct shrinker		*shrinker;
 	int			pool_size; /* number of disks in stripeheads in pool */
 	spinlock_t		device_lock;
 	struct disk_info	*disks;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570882.893313 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBY-00077v-Sy; Thu, 27 Jul 2023 08:17:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570882.893313; Thu, 27 Jul 2023 08:17:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBY-000770-PC; Thu, 27 Jul 2023 08:17:24 +0000
Received: by outflank-mailman (input) for mailman id 570882;
 Thu, 27 Jul 2023 08:17:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw6d-0001DS-QO
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:12:19 +0000
Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com
 [2607:f8b0:4864:20::432])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4dcc8253-2c55-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:12:19 +0200 (CEST)
Received: by mail-pf1-x432.google.com with SMTP id
 d2e1a72fcca58-682eef7d752so204692b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:12:19 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.12.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:12:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4dcc8253-2c55-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445538; x=1691050338;
        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=nhs5C6wYTK112tB0Y3rKeCsMBEmGx3fQoCnqZ3HCCLA=;
        b=P3BNYmrnn+aNeQX6tJNAWjBR47qoFVwe6V1hXSSWwFyS61HuOjfx1CldC/bVPLDS4b
         tBSPVcIpokpC1gG54dPeypV2gv1H1PsrEki/AFkEglXm+WyAmzSAHFAjlypTbwzHUkTv
         XwwWUlwnKhA8sSKQw+cOvBa/dT3CBu+sYvYNSpbwNT6pp20knmU+insJC0lJR8d7KNA/
         XFw3RfaoZY9/IU0U207vkdiCmyduxENHuADRmTAqpUtqVvF1N7pwLKXyEsFC4IstCLHw
         nMtpKLIm0n/1aYuhmB1FsTVe4JczwGUa2wEUGkSK8KQu0Fafs8lJ3mpNN+7ETdaWOSMf
         16qA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445538; x=1691050338;
        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=nhs5C6wYTK112tB0Y3rKeCsMBEmGx3fQoCnqZ3HCCLA=;
        b=lWYg4m5M1/yVa45hyldKI6h7ePuCbU6nDbI/Bw/WF75WmyVFWieuT1Csku2dVpj0FB
         YtJpZO9t7/J5/w09xJ5HuVBx4VfIFQhYYbr3B2UCg14UXJ0b4vIJ5Ps5B57Bo7xqgkS2
         iXde+DYz3lqWkyrqxBzgkD39PNC4DOhCFDlDGX7vSb95aSZz4dGnxe9t/i82K3ugxo8S
         VrJ5aDn3lA4rSHAaco+4y8uX32kttjjYfvDIrqkQy1ZCC8TA3gJxUx2x4zM+BcRuOjtc
         1rUkbpo9d0RSQmJgZS8c5UKbKdswgpSgqii3OdhSllS3Glg3CMpI91EZgWpKG2YbTCAv
         JtZg==
X-Gm-Message-State: ABy/qLb8iurP0mJldCPcu2GVZbForD2uWoAKrTpdzOStgvWE79kTjDNi
	63Wa5wp5G96h+jkrPpI9mzvYsw==
X-Google-Smtp-Source: APBJJlELYJ+VP3jkb44itFX28rq7UhufR3zr/NDN3xCao+bv4nVfpqzapahZiZsalg40ZmAEO1GP5Q==
X-Received: by 2002:a05:6a00:13a3:b0:676:2a5c:7bc5 with SMTP id t35-20020a056a0013a300b006762a5c7bc5mr5236670pfg.1.1690445537850;
        Thu, 27 Jul 2023 01:12:17 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 32/49] virtio_balloon: dynamically allocate the virtio-balloon shrinker
Date: Thu, 27 Jul 2023 16:04:45 +0800
Message-Id: <20230727080502.77895-33-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the virtio-balloon shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct virtio_balloon.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 drivers/virtio/virtio_balloon.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 5b15936a5214..82e6087073a9 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -111,7 +111,7 @@ struct virtio_balloon {
 	struct virtio_balloon_stat stats[VIRTIO_BALLOON_S_NR];
 
 	/* Shrinker to return free pages - VIRTIO_BALLOON_F_FREE_PAGE_HINT */
-	struct shrinker shrinker;
+	struct shrinker *shrinker;
 
 	/* OOM notifier to deflate on OOM - VIRTIO_BALLOON_F_DEFLATE_ON_OOM */
 	struct notifier_block oom_nb;
@@ -816,8 +816,7 @@ static unsigned long shrink_free_pages(struct virtio_balloon *vb,
 static unsigned long virtio_balloon_shrinker_scan(struct shrinker *shrinker,
 						  struct shrink_control *sc)
 {
-	struct virtio_balloon *vb = container_of(shrinker,
-					struct virtio_balloon, shrinker);
+	struct virtio_balloon *vb = shrinker->private_data;
 
 	return shrink_free_pages(vb, sc->nr_to_scan);
 }
@@ -825,8 +824,7 @@ static unsigned long virtio_balloon_shrinker_scan(struct shrinker *shrinker,
 static unsigned long virtio_balloon_shrinker_count(struct shrinker *shrinker,
 						   struct shrink_control *sc)
 {
-	struct virtio_balloon *vb = container_of(shrinker,
-					struct virtio_balloon, shrinker);
+	struct virtio_balloon *vb = shrinker->private_data;
 
 	return vb->num_free_page_blocks * VIRTIO_BALLOON_HINT_BLOCK_PAGES;
 }
@@ -847,16 +845,23 @@ static int virtio_balloon_oom_notify(struct notifier_block *nb,
 
 static void virtio_balloon_unregister_shrinker(struct virtio_balloon *vb)
 {
-	unregister_shrinker(&vb->shrinker);
+	shrinker_free(vb->shrinker);
 }
 
 static int virtio_balloon_register_shrinker(struct virtio_balloon *vb)
 {
-	vb->shrinker.scan_objects = virtio_balloon_shrinker_scan;
-	vb->shrinker.count_objects = virtio_balloon_shrinker_count;
-	vb->shrinker.seeks = DEFAULT_SEEKS;
+	vb->shrinker = shrinker_alloc(0, "virtio-balloon");
+	if (!vb->shrinker)
+		return -ENOMEM;
 
-	return register_shrinker(&vb->shrinker, "virtio-balloon");
+	vb->shrinker->scan_objects = virtio_balloon_shrinker_scan;
+	vb->shrinker->count_objects = virtio_balloon_shrinker_count;
+	vb->shrinker->seeks = DEFAULT_SEEKS;
+	vb->shrinker->private_data = vb;
+
+	shrinker_register(vb->shrinker);
+
+	return 0;
 }
 
 static int virtballoon_probe(struct virtio_device *vdev)
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570887.893342 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBa-0007e0-R1; Thu, 27 Jul 2023 08:17:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570887.893342; Thu, 27 Jul 2023 08:17:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBa-0007bS-Bu; Thu, 27 Jul 2023 08:17:26 +0000
Received: by outflank-mailman (input) for mailman id 570887;
 Thu, 27 Jul 2023 08:17:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw7G-0001DS-2Q
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:12:58 +0000
Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com
 [2607:f8b0:4864:20::42b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 648554fb-2c55-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:12:57 +0200 (CEST)
Received: by mail-pf1-x42b.google.com with SMTP id
 d2e1a72fcca58-682ae5d4184so171541b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:12:57 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.12.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:12:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 648554fb-2c55-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445576; x=1691050376;
        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=48waxWZGd1WUnLYaDrTSxvJywKXLcopaiUkWgt7j5Rg=;
        b=h7BzAXWMeO6q413o2q8QBGFyYtSJJQDVtscFkPudih7uYq32KqAohX6ko7JdrT58zZ
         jQesZevPWI16RJ584HoFfkctqZliFhC+Sy5DmGf4/p07EAXTPpKceV5c/mFhCQtFe2kc
         GT00j/8cVqT7gjAO9UrE6yMmEVq+vAOowivD6U/C54ThBKsCCzPpN8b7GVd2fZWCigOk
         vXp6v9qkHcNnCSidh0rHnK6MCacYxO0sYof9O+5/aUkm0GolyNtTHq/urdLytozqbZlU
         y5SGivZA8rDsT4B1CBykaduW0zvqtcacoHqzhUYbcvZiZaKGJdqILCFM7NZx5HG0wVY2
         fpkw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445576; x=1691050376;
        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=48waxWZGd1WUnLYaDrTSxvJywKXLcopaiUkWgt7j5Rg=;
        b=PYiRjA403JtO2ZwDdSI9rLR4+3r6X1dh+OKTxZcLE9weWyOAW+ziK76rb3tz9li9vU
         iQw6nscYy/tIsFAXj2i1ZnpGiDTVRLq+bB3vdyNGXtC45jeOQKB1xG35Q9T6F5N9zZ/E
         uLjXNWamMJrT49oZ3w0NPH3lAduLMarRLSwJou7/sZytPCdw4n1oXrQlGBuHPk0stMjv
         7yJF0pXdD9KdPYyto92P16f9UrkoulHNlhzzEvkxrOkOekkN/N41rzIEKbRY5VpywQfL
         +SGlypMZpRCos/6GI95n+I8eJ7JHdSp7aKdSic4L0m9fKoUJpvz07daBq8nsLMJqX4ge
         3FCQ==
X-Gm-Message-State: ABy/qLbFqaS2naScURNRce86NjAPXflOCNzulpM+rtJ55TpcW9Htm+bw
	MvKV1JpljzenzOFM7V/uxbJEgA==
X-Google-Smtp-Source: APBJJlGlNC1VbP/jxEyWXSRyFxMRuhVQW95Y9Ngz7T3+dCe8qyleorovPEoXgtcixk5kZ4l7rZv1Dg==
X-Received: by 2002:a05:6a00:4a10:b0:686:b990:560f with SMTP id do16-20020a056a004a1000b00686b990560fmr4386534pfb.2.1690445576006;
        Thu, 27 Jul 2023 01:12:56 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 35/49] jbd2,ext4: dynamically allocate the jbd2-journal shrinker
Date: Thu, 27 Jul 2023 16:04:48 +0800
Message-Id: <20230727080502.77895-36-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the jbd2-journal shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct journal_s.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 fs/jbd2/journal.c    | 27 +++++++++++++++++----------
 include/linux/jbd2.h |  2 +-
 2 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 1b5a45ab62b0..4c421da03fee 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -1298,7 +1298,7 @@ static int jbd2_min_tag_size(void)
 static unsigned long jbd2_journal_shrink_scan(struct shrinker *shrink,
 					      struct shrink_control *sc)
 {
-	journal_t *journal = container_of(shrink, journal_t, j_shrinker);
+	journal_t *journal = shrink->private_data;
 	unsigned long nr_to_scan = sc->nr_to_scan;
 	unsigned long nr_shrunk;
 	unsigned long count;
@@ -1324,7 +1324,7 @@ static unsigned long jbd2_journal_shrink_scan(struct shrinker *shrink,
 static unsigned long jbd2_journal_shrink_count(struct shrinker *shrink,
 					       struct shrink_control *sc)
 {
-	journal_t *journal = container_of(shrink, journal_t, j_shrinker);
+	journal_t *journal = shrink->private_data;
 	unsigned long count;
 
 	count = percpu_counter_read_positive(&journal->j_checkpoint_jh_count);
@@ -1412,19 +1412,26 @@ static journal_t *journal_init_common(struct block_device *bdev,
 	journal->j_superblock = (journal_superblock_t *)bh->b_data;
 
 	journal->j_shrink_transaction = NULL;
-	journal->j_shrinker.scan_objects = jbd2_journal_shrink_scan;
-	journal->j_shrinker.count_objects = jbd2_journal_shrink_count;
-	journal->j_shrinker.seeks = DEFAULT_SEEKS;
-	journal->j_shrinker.batch = journal->j_max_transaction_buffers;
 
 	if (percpu_counter_init(&journal->j_checkpoint_jh_count, 0, GFP_KERNEL))
 		goto err_cleanup;
 
-	if (register_shrinker(&journal->j_shrinker, "jbd2-journal:(%u:%u)",
-			      MAJOR(bdev->bd_dev), MINOR(bdev->bd_dev))) {
+	journal->j_shrinker = shrinker_alloc(0, "jbd2-journal:(%u:%u)",
+					     MAJOR(bdev->bd_dev),
+					     MINOR(bdev->bd_dev));
+	if (!journal->j_shrinker) {
 		percpu_counter_destroy(&journal->j_checkpoint_jh_count);
 		goto err_cleanup;
 	}
+
+	journal->j_shrinker->scan_objects = jbd2_journal_shrink_scan;
+	journal->j_shrinker->count_objects = jbd2_journal_shrink_count;
+	journal->j_shrinker->seeks = DEFAULT_SEEKS;
+	journal->j_shrinker->batch = journal->j_max_transaction_buffers;
+	journal->j_shrinker->private_data = journal;
+
+	shrinker_register(journal->j_shrinker);
+
 	return journal;
 
 err_cleanup:
@@ -2187,9 +2194,9 @@ int jbd2_journal_destroy(journal_t *journal)
 		brelse(journal->j_sb_buffer);
 	}
 
-	if (journal->j_shrinker.flags & SHRINKER_REGISTERED) {
+	if (journal->j_shrinker) {
 		percpu_counter_destroy(&journal->j_checkpoint_jh_count);
-		unregister_shrinker(&journal->j_shrinker);
+		shrinker_free(journal->j_shrinker);
 	}
 	if (journal->j_proc_entry)
 		jbd2_stats_proc_exit(journal);
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 44c298aa58d4..beb4c4586320 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -891,7 +891,7 @@ struct journal_s
 	 * Journal head shrinker, reclaim buffer's journal head which
 	 * has been written back.
 	 */
-	struct shrinker		j_shrinker;
+	struct shrinker		*j_shrinker;
 
 	/**
 	 * @j_checkpoint_jh_count:
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570888.893350 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBb-0007rt-D9; Thu, 27 Jul 2023 08:17:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570888.893350; Thu, 27 Jul 2023 08:17:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBb-0007q2-2A; Thu, 27 Jul 2023 08:17:27 +0000
Received: by outflank-mailman (input) for mailman id 570888;
 Thu, 27 Jul 2023 08:17:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw2k-0001DS-3z
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:08:18 +0000
Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com
 [2607:f8b0:4864:20::42e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bdb5db1d-2c54-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:08:17 +0200 (CEST)
Received: by mail-pf1-x42e.google.com with SMTP id
 d2e1a72fcca58-682eef7d752so203652b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:08:17 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.08.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:08:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bdb5db1d-2c54-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445296; x=1691050096;
        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=XAY9+N2BbVQBjCT3MmFWkPxUR/2vf6o4m+CtMBoAzag=;
        b=LFYvlia4velFDizk2hHXlBW7f/l7rbfbGMuqLFZUpWLlBrVWlN4fEmfbvc4omxzXDA
         GS62NEHVqB0PFgv0flEq3EjMDASyoMQLwnHtJ15RD867cmoYFSzpLBJze2MH0FTuVYWD
         NsiHc1gWK/drytRuk+pd4JkJ3rj2hRu9B8SocS/OtbfY5xFfSOGukZMVRW73BQpYmdrG
         /5Ymr320vt1GGeIXCFFSw58+k2f5zcvch0LSG0bHy5CbC3AFLqLQjQMF/E7WQcKZk1m8
         rvHs1btuYuzdVvuVmWOj+XioQ9BrFWnwjxo07/zHn9Dajw02v1LQ6Dr1U7VOL/6BCiXk
         S4AA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445296; x=1691050096;
        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=XAY9+N2BbVQBjCT3MmFWkPxUR/2vf6o4m+CtMBoAzag=;
        b=Jj5vy9s1yoVsX7jl7gqFOT3ZN0mzCN4Bx7DI4to2tEFU60J317Y0LGycGGcsRx2fuG
         e2WHERVPG7dTgH9L7jMKvEwqNb6Et5Yx4pol7vx/+AQkevv09lABnPocoxqE/YjYaZ+7
         aH9EkJeEi8KHvkROsSIcwHZpq+JptDsnD9hRzsMNVqb5G89FJ30lVlQ+psMAzvvrQWO5
         MjUBbU0UaN8HMqYYQRaxdwvCJ5/SGb7Qpx+b0DM9M9Ker3+5gPqh1jdTOJ34+hGs5Kmh
         L6rgXw8tq+b2UAzsfU/wcR68gapR2vCWnzp3BohGccq+XZlm1NR6M84PH+pXdD0WPsGG
         sf3A==
X-Gm-Message-State: ABy/qLbDhh6B3t+GlGHXoGXV67mD0GHqhLy787G5Nvr/4AD1t2fl2+js
	I5ORPxeZsGVe7R392RRPmfmt2g==
X-Google-Smtp-Source: APBJJlFXIDspBDKYt+edW+ekZSGIMkDEJizocNVTOvlzV7xMQBKW4TeDX8VYOaL7MgnXn0ggLAa8Tw==
X-Received: by 2002:a05:6a00:1586:b0:67f:8ef5:2643 with SMTP id u6-20020a056a00158600b0067f8ef52643mr5200829pfk.2.1690445296182;
        Thu, 27 Jul 2023 01:08:16 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 12/49] gfs2: dynamically allocate the gfs2-glock shrinker
Date: Thu, 27 Jul 2023 16:04:25 +0800
Message-Id: <20230727080502.77895-13-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the gfs2-glock shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 fs/gfs2/glock.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 1438e7465e30..8d582ba7514f 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -2046,11 +2046,7 @@ static unsigned long gfs2_glock_shrink_count(struct shrinker *shrink,
 	return vfs_pressure_ratio(atomic_read(&lru_count));
 }
 
-static struct shrinker glock_shrinker = {
-	.seeks = DEFAULT_SEEKS,
-	.count_objects = gfs2_glock_shrink_count,
-	.scan_objects = gfs2_glock_shrink_scan,
-};
+static struct shrinker *glock_shrinker;
 
 /**
  * glock_hash_walk - Call a function for glock in a hash bucket
@@ -2472,13 +2468,19 @@ int __init gfs2_glock_init(void)
 		return -ENOMEM;
 	}
 
-	ret = register_shrinker(&glock_shrinker, "gfs2-glock");
-	if (ret) {
+	glock_shrinker = shrinker_alloc(0, "gfs2-glock");
+	if (!glock_shrinker) {
 		destroy_workqueue(glock_workqueue);
 		rhashtable_destroy(&gl_hash_table);
-		return ret;
+		return -ENOMEM;
 	}
 
+	glock_shrinker->count_objects = gfs2_glock_shrink_count;
+	glock_shrinker->scan_objects = gfs2_glock_shrink_scan;
+	glock_shrinker->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(glock_shrinker);
+
 	for (i = 0; i < GLOCK_WAIT_TABLE_SIZE; i++)
 		init_waitqueue_head(glock_wait_table + i);
 
@@ -2487,7 +2489,7 @@ int __init gfs2_glock_init(void)
 
 void gfs2_glock_exit(void)
 {
-	unregister_shrinker(&glock_shrinker);
+	shrinker_free(glock_shrinker);
 	rhashtable_destroy(&gl_hash_table);
 	destroy_workqueue(glock_workqueue);
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570883.893321 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBZ-0007Ft-CV; Thu, 27 Jul 2023 08:17:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570883.893321; Thu, 27 Jul 2023 08:17:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBZ-0007Di-50; Thu, 27 Jul 2023 08:17:25 +0000
Received: by outflank-mailman (input) for mailman id 570883;
 Thu, 27 Jul 2023 08:17:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw2M-0001DS-0t
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:07:54 +0000
Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com
 [2607:f8b0:4864:20::429])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id af55437d-2c54-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:07:53 +0200 (CEST)
Received: by mail-pf1-x429.google.com with SMTP id
 d2e1a72fcca58-6748a616e17so182602b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:07:53 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.07.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:07:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: af55437d-2c54-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445272; x=1691050072;
        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=ubpyp4SIhGXjO6/VTKiZvWjlRzyN8ANvKHVN5xSGnIw=;
        b=JnEFWCJ0lfqLQ09KAhpDiGnRAmdtfYhke3aIyqMGyaI1u+7/j8X1g+ymABPYujVt+w
         cz28zAP40524HNhXDL9Q5SofaC1n/CPA+MmByiqiYd170BhvKkwUMWNTWGQlZaYnqgaR
         FBpKNnlG1vtBshrp2zrDJ2SvCtcPtO2Uoxi7Td9WriKIRN+9BBM1kAj+4w0IHie3PsAJ
         NEqh91Op9gs693bzhjwiJV1tmOiwkF+OnmYUm9c5BSiHcRPJXsNw4NR6JZLqvW90Jp1l
         wYlHCbMfcgp//O2TdulFnaEsdlVg5OO3iU4DnTCf9/O5RCqrJgKtWA6LRsXmBpSaFsGJ
         4ftA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445272; x=1691050072;
        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=ubpyp4SIhGXjO6/VTKiZvWjlRzyN8ANvKHVN5xSGnIw=;
        b=WL33xsU7BIQaweCGqVmD2YzxcT5rMgIRVUB936mvHFQHe3QJupCOFd5sjm59wZgWJJ
         jRziqJj7yXKw0+GJGQBHdA+yakO+VL1qiOvoPcQcA9DvZDMc7R8FO6K8zN8YPu+JEg+E
         fi1r0qZgSnH1qX+/QkFy8pdwnSACNfIozlgZOCJAU/a+NvCx3FNJ7v0p20TXS4x4JiMP
         wzE8oPWlBKv+1yavFBOnWsAHJ6WTBYaMwJxoFKFv7qr+DnAWpBe3nSkLENb2SyqDDU5A
         TI1bSCO0pk3WyFx4sEE08QU9W9RdmaW0MeCVIrJpsJhXpO8qwSo/kJu1xhbuhNhLHtbS
         FF5w==
X-Gm-Message-State: ABy/qLboAoEosXBF7L2EnsCsahS1LJrNSi+977KsqT/zUGgwKdVXKn5n
	rfWDCwnyAspS0b0/KRrMlgqAYA==
X-Google-Smtp-Source: APBJJlH8Hm//FCUnZvKJ1Fsda02AnYQWQqq2rUtStc8LnYU5/NdJ+w8F5lFLyohrr/NHLskzxbNOmQ==
X-Received: by 2002:a05:6a00:2d09:b0:682:59aa:178d with SMTP id fa9-20020a056a002d0900b0068259aa178dmr4647270pfb.1.1690445272018;
        Thu, 27 Jul 2023 01:07:52 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 10/49] erofs: dynamically allocate the erofs-shrinker
Date: Thu, 27 Jul 2023 16:04:23 +0800
Message-Id: <20230727080502.77895-11-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the erofs-shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 fs/erofs/utils.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/fs/erofs/utils.c b/fs/erofs/utils.c
index cc6fb9e98899..6e1a828e6ca3 100644
--- a/fs/erofs/utils.c
+++ b/fs/erofs/utils.c
@@ -270,19 +270,25 @@ static unsigned long erofs_shrink_scan(struct shrinker *shrink,
 	return freed;
 }
 
-static struct shrinker erofs_shrinker_info = {
-	.scan_objects = erofs_shrink_scan,
-	.count_objects = erofs_shrink_count,
-	.seeks = DEFAULT_SEEKS,
-};
+static struct shrinker *erofs_shrinker_info;
 
 int __init erofs_init_shrinker(void)
 {
-	return register_shrinker(&erofs_shrinker_info, "erofs-shrinker");
+	erofs_shrinker_info = shrinker_alloc(0, "erofs-shrinker");
+	if (!erofs_shrinker_info)
+		return -ENOMEM;
+
+	erofs_shrinker_info->count_objects = erofs_shrink_count;
+	erofs_shrinker_info->scan_objects = erofs_shrink_scan;
+	erofs_shrinker_info->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(erofs_shrinker_info);
+
+	return 0;
 }
 
 void erofs_exit_shrinker(void)
 {
-	unregister_shrinker(&erofs_shrinker_info);
+	shrinker_free(erofs_shrinker_info);
 }
 #endif	/* !CONFIG_EROFS_FS_ZIP */
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570881.893309 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBY-00075R-MN; Thu, 27 Jul 2023 08:17:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570881.893309; Thu, 27 Jul 2023 08:17:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBY-00075K-Hu; Thu, 27 Jul 2023 08:17:24 +0000
Received: by outflank-mailman (input) for mailman id 570881;
 Thu, 27 Jul 2023 08:17:23 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOwA1-00033O-IM
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:15:49 +0000
Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com
 [2607:f8b0:4864:20::430])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ca01f94b-2c55-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:15:47 +0200 (CEST)
Received: by mail-pf1-x430.google.com with SMTP id
 d2e1a72fcca58-682eef7d752so205247b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:15:47 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.15.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:15:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ca01f94b-2c55-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445746; x=1691050546;
        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=V+VUr/yqCBhRzWtIhjCO81y0MQsQ8/nBil0vz0xF6BE=;
        b=TaRPl345AKbrAIMueUHfPwp1x6uI6QP6FYTf0gbRl5pBKvfKuQ+QWduLyPJpV8ScsL
         Q5TivksWMgrstH3HdJCskaPbEKYgZ24uChwqAdIFrOrWwAa2WQwZ8NT8kZyVgbNoH85T
         do2ODt4uNF4INjJdWRp+atPQdybcUxTwq7Q7CB0q5LWN8BolV4yvFIRahlHyro/xVHih
         Vepy/KyZesG0IyAMF6CRgG8Mi1ITRqBiZ02IP7raj5LrBsVY5eCkMeBoD4m40xyPsJDZ
         tcd1kL8KzTvRLgjfGcyP08MdoeQiDGrvVHZmsG1n2bLc4Z4qfZKKlhoGJ8kGn6E5dkaY
         Cwmw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445746; x=1691050546;
        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=V+VUr/yqCBhRzWtIhjCO81y0MQsQ8/nBil0vz0xF6BE=;
        b=HU45NpbJsGqyJieNsTRoPPAvQGbtYvRcFPe+1YnB5UztVy3TC6wp58o8rPRKB4ui2H
         EgsXre5KF7fjJ3VsIT6adbHGAIQrOrC84sKLK+yAZiRPQ0IH27WpiGjKoDT4wwWuMqQV
         UcFXdqjdgaMyOXzvsyg5iUPWDtydlWxBl+8N0Xp9sad0BdPQFoFYXeu8DZXTCmahSBd2
         21Sy7CA/nP128e6GhJr/v/0rTtEa6jmy/A/rkBdK6dhce3aTeAXsacYZgXJ8glMcITp7
         6a3fMkFXDbXYnVvmmctmQKdX3oIZ7BWMoLM2kLH+tEJy7yoi8WNi2sVZwrnvhDrAQ49D
         QvHw==
X-Gm-Message-State: ABy/qLYKkwXFtEMn7Pd34nW8y/M/yfa4Em1V8F4mfdswBUx+mBeaR5Ay
	YW09nPhAvb/6Evz5/E1vLciIPA==
X-Google-Smtp-Source: APBJJlEPnp3RDXXbUxyHg3EG2jnu2Scq2lS38vCuYEIB7nQxuybwzYpkjm+dcqMi61BwYttNjNAkLg==
X-Received: by 2002:aa7:84d0:0:b0:686:bf43:60fa with SMTP id x16-20020aa784d0000000b00686bf4360famr5267613pfn.0.1690445746275;
        Thu, 27 Jul 2023 01:15:46 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v3 49/49] mm: shrinker: convert shrinker_rwsem to mutex
Date: Thu, 27 Jul 2023 16:05:02 +0800
Message-Id: <20230727080502.77895-50-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Now there are no readers of shrinker_rwsem, so we can simply replace it
with mutex lock.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 drivers/md/dm-cache-metadata.c |  2 +-
 fs/super.c                     |  2 +-
 mm/shrinker.c                  | 28 ++++++++++++++--------------
 mm/shrinker_debug.c            | 14 +++++++-------
 4 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c
index acffed750e3e..9e0c69958587 100644
--- a/drivers/md/dm-cache-metadata.c
+++ b/drivers/md/dm-cache-metadata.c
@@ -1828,7 +1828,7 @@ int dm_cache_metadata_abort(struct dm_cache_metadata *cmd)
 	 * Replacement block manager (new_bm) is created and old_bm destroyed outside of
 	 * cmd root_lock to avoid ABBA deadlock that would result (due to life-cycle of
 	 * shrinker associated with the block manager's bufio client vs cmd root_lock).
-	 * - must take shrinker_rwsem without holding cmd->root_lock
+	 * - must take shrinker_mutex without holding cmd->root_lock
 	 */
 	new_bm = dm_block_manager_create(cmd->bdev, DM_CACHE_METADATA_BLOCK_SIZE << SECTOR_SHIFT,
 					 CACHE_MAX_CONCURRENT_LOCKS);
diff --git a/fs/super.c b/fs/super.c
index 68b3877af941..fdde72e2a357 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -54,7 +54,7 @@ static char *sb_writers_name[SB_FREEZE_LEVELS] = {
  * One thing we have to be careful of with a per-sb shrinker is that we don't
  * drop the last active reference to the superblock from within the shrinker.
  * If that happens we could trigger unregistering the shrinker from within the
- * shrinker path and that leads to deadlock on the shrinker_rwsem. Hence we
+ * shrinker path and that leads to deadlock on the shrinker_mutex. Hence we
  * take a passive reference to the superblock to avoid this from occurring.
  */
 static unsigned long super_cache_scan(struct shrinker *shrink,
diff --git a/mm/shrinker.c b/mm/shrinker.c
index a12dede5d21f..3d44a335ef3c 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -8,7 +8,7 @@
 #include "internal.h"
 
 LIST_HEAD(shrinker_list);
-DECLARE_RWSEM(shrinker_rwsem);
+DEFINE_MUTEX(shrinker_mutex);
 
 #ifdef CONFIG_MEMCG
 static int shrinker_nr_max;
@@ -80,7 +80,7 @@ int alloc_shrinker_info(struct mem_cgroup *memcg)
 	int nid, ret = 0;
 	int array_size = 0;
 
-	down_write(&shrinker_rwsem);
+	mutex_lock(&shrinker_mutex);
 	array_size = shrinker_unit_size(shrinker_nr_max);
 	for_each_node(nid) {
 		info = kvzalloc_node(sizeof(*info) + array_size, GFP_KERNEL, nid);
@@ -91,7 +91,7 @@ int alloc_shrinker_info(struct mem_cgroup *memcg)
 			goto err;
 		rcu_assign_pointer(memcg->nodeinfo[nid]->shrinker_info, info);
 	}
-	up_write(&shrinker_rwsem);
+	mutex_unlock(&shrinker_mutex);
 
 	return ret;
 
@@ -104,7 +104,7 @@ static struct shrinker_info *shrinker_info_protected(struct mem_cgroup *memcg,
 						     int nid)
 {
 	return rcu_dereference_protected(memcg->nodeinfo[nid]->shrinker_info,
-					 lockdep_is_held(&shrinker_rwsem));
+					 lockdep_is_held(&shrinker_mutex));
 }
 
 static struct shrinker_info *shrinker_info_rcu(struct mem_cgroup *memcg,
@@ -161,7 +161,7 @@ static int expand_shrinker_info(int new_id)
 	if (!root_mem_cgroup)
 		goto out;
 
-	lockdep_assert_held(&shrinker_rwsem);
+	lockdep_assert_held(&shrinker_mutex);
 
 	new_size = shrinker_unit_size(new_nr_max);
 	old_size = shrinker_unit_size(shrinker_nr_max);
@@ -224,7 +224,7 @@ static int shrinker_memcg_alloc(struct shrinker *shrinker)
 	if (mem_cgroup_disabled())
 		return -ENOSYS;
 
-	down_write(&shrinker_rwsem);
+	mutex_lock(&shrinker_mutex);
 	id = idr_alloc(&shrinker_idr, shrinker, 0, 0, GFP_KERNEL);
 	if (id < 0)
 		goto unlock;
@@ -238,7 +238,7 @@ static int shrinker_memcg_alloc(struct shrinker *shrinker)
 	shrinker->id = id;
 	ret = 0;
 unlock:
-	up_write(&shrinker_rwsem);
+	mutex_unlock(&shrinker_mutex);
 	return ret;
 }
 
@@ -248,7 +248,7 @@ static void shrinker_memcg_remove(struct shrinker *shrinker)
 
 	BUG_ON(id < 0);
 
-	lockdep_assert_held(&shrinker_rwsem);
+	lockdep_assert_held(&shrinker_mutex);
 
 	idr_remove(&shrinker_idr, id);
 }
@@ -299,7 +299,7 @@ void reparent_shrinker_deferred(struct mem_cgroup *memcg)
 		parent = root_mem_cgroup;
 
 	/* Prevent from concurrent shrinker_info expand */
-	down_write(&shrinker_rwsem);
+	mutex_lock(&shrinker_mutex);
 	for_each_node(nid) {
 		child_info = shrinker_info_protected(memcg, nid);
 		parent_info = shrinker_info_protected(parent, nid);
@@ -312,7 +312,7 @@ void reparent_shrinker_deferred(struct mem_cgroup *memcg)
 			}
 		}
 	}
-	up_write(&shrinker_rwsem);
+	mutex_unlock(&shrinker_mutex);
 }
 #else
 static int shrinker_memcg_alloc(struct shrinker *shrinker)
@@ -708,11 +708,11 @@ void shrinker_register(struct shrinker *shrinker)
 		return;
 	}
 
-	down_write(&shrinker_rwsem);
+	mutex_lock(&shrinker_mutex);
 	list_add_tail_rcu(&shrinker->list, &shrinker_list);
 	shrinker->flags |= SHRINKER_REGISTERED;
 	shrinker_debugfs_add(shrinker);
-	up_write(&shrinker_rwsem);
+	mutex_unlock(&shrinker_mutex);
 
 	init_completion(&shrinker->done);
 	/*
@@ -745,7 +745,7 @@ void shrinker_free(struct shrinker *shrinker)
 		wait_for_completion(&shrinker->done);
 	}
 
-	down_write(&shrinker_rwsem);
+	mutex_lock(&shrinker_mutex);
 	if (shrinker->flags & SHRINKER_REGISTERED) {
 		/*
 		 * Lookups on the shrinker are over and will fail in the future,
@@ -760,7 +760,7 @@ void shrinker_free(struct shrinker *shrinker)
 
 	if (shrinker->flags & SHRINKER_MEMCG_AWARE)
 		shrinker_memcg_remove(shrinker);
-	up_write(&shrinker_rwsem);
+	mutex_unlock(&shrinker_mutex);
 
 	if (debugfs_entry)
 		shrinker_debugfs_remove(debugfs_entry, debugfs_id);
diff --git a/mm/shrinker_debug.c b/mm/shrinker_debug.c
index 506257585408..368fa0484a44 100644
--- a/mm/shrinker_debug.c
+++ b/mm/shrinker_debug.c
@@ -7,7 +7,7 @@
 #include <linux/memcontrol.h>
 
 /* defined in vmscan.c */
-extern struct rw_semaphore shrinker_rwsem;
+extern struct mutex shrinker_mutex;
 extern struct list_head shrinker_list;
 
 static DEFINE_IDA(shrinker_debugfs_ida);
@@ -163,7 +163,7 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
 	char buf[128];
 	int id;
 
-	lockdep_assert_held(&shrinker_rwsem);
+	lockdep_assert_held(&shrinker_mutex);
 
 	/* debugfs isn't initialized yet, add debugfs entries later. */
 	if (!shrinker_debugfs_root)
@@ -220,7 +220,7 @@ int shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...)
 	if (!new)
 		return -ENOMEM;
 
-	down_write(&shrinker_rwsem);
+	mutex_lock(&shrinker_mutex);
 
 	old = shrinker->name;
 	shrinker->name = new;
@@ -238,7 +238,7 @@ int shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...)
 			shrinker->debugfs_entry = entry;
 	}
 
-	up_write(&shrinker_rwsem);
+	mutex_unlock(&shrinker_mutex);
 
 	kfree_const(old);
 
@@ -251,7 +251,7 @@ struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
 {
 	struct dentry *entry = shrinker->debugfs_entry;
 
-	lockdep_assert_held(&shrinker_rwsem);
+	lockdep_assert_held(&shrinker_mutex);
 
 	shrinker_debugfs_name_free(shrinker);
 
@@ -279,14 +279,14 @@ static int __init shrinker_debugfs_init(void)
 	shrinker_debugfs_root = dentry;
 
 	/* Create debugfs entries for shrinkers registered at boot */
-	down_write(&shrinker_rwsem);
+	mutex_lock(&shrinker_mutex);
 	list_for_each_entry(shrinker, &shrinker_list, list)
 		if (!shrinker->debugfs_entry) {
 			ret = shrinker_debugfs_add(shrinker);
 			if (ret)
 				break;
 		}
-	up_write(&shrinker_rwsem);
+	mutex_unlock(&shrinker_mutex);
 
 	return ret;
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570891.893356 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBb-00084p-Vw; Thu, 27 Jul 2023 08:17:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570891.893356; Thu, 27 Jul 2023 08:17:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBb-00081z-ME; Thu, 27 Jul 2023 08:17:27 +0000
Received: by outflank-mailman (input) for mailman id 570891;
 Thu, 27 Jul 2023 08:17:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw73-0001DS-GN
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:12:45 +0000
Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com
 [2607:f8b0:4864:20::42f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5d081b33-2c55-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:12:44 +0200 (CEST)
Received: by mail-pf1-x42f.google.com with SMTP id
 d2e1a72fcca58-682eef7d752so204774b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:12:44 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.12.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:12:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5d081b33-2c55-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445563; x=1691050363;
        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=QelXbRgYcu/a7kVf8tT2xmPKs8Q6fhUGUeX576V7Nl8=;
        b=X2/dKeRh3K1ZUeUXRmYcuLAwkmDYhdwx9iwlPAtXfC0B4vHXtLguXST30gjNSIXFT7
         OLt7OLAHNBNYpcouioFmzFwp83h1VVZBZI/b5TZHZteUiScXCbvweVFodKUOy9sCj8AV
         ZENggnGp80mAUTxGhU/fnzaRvZdNkV5cPcoIInnSny5prudiipt4/IqGTm49bA8p77kr
         6rthKHnFEd97DZ60+ymFLTYrwmYvoXhejWrNb12L9I2KL1LTnT8oJzoHo7/LmyIBjEhr
         5sNbvq2AFaPoM5/YQzjEzmuEQi5h7hErc8c8ASDByEVVMFkteQf8s6ncJNWVLrxavMEP
         hYjw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445563; x=1691050363;
        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=QelXbRgYcu/a7kVf8tT2xmPKs8Q6fhUGUeX576V7Nl8=;
        b=PozO8OHkorhZ22Q6zI/xjaVlVwPVrktZUx4236FIx0yG7NKXdOl4w50abr21swfw6G
         zB0y2+jWbVOeIFjIu3uCmXWjF5iUNcwsBhs6qAA0H8vML+O6s0F7eHZOF0vFSMpTreCP
         KIB/KTZnZfDE2sUcHsVPnPkF3U5vcUEI3KduPKe4n9/OEvf3T8S1P/5eUkQU3d5R8Wcr
         vZiAa8tm1hLlfPFypuZvyeh/qpUXqn54uPs9+5Ga29u5M0Y09fO2l7AqLfZOzLyQkXaK
         sfDlsRPYBvS/CkRytIMYfBxmxzK1sBMXNh7epxVABVFeR8Tw6dRx9Zj52waNi7EmISJR
         MhBA==
X-Gm-Message-State: ABy/qLYCoTqZ02MQ+7LdeWabS98+F2AqEyMETK6Tqlb8/xbErKZyicJk
	fCqndpdG98fPuyBPS0d81gMwVA==
X-Google-Smtp-Source: APBJJlG3us3D1/FzajU+z+h8urvbqwZdl/1CQD95N0Bm05n475Xxe2FLYU/iNliwdKbEyGNSdPUcwg==
X-Received: by 2002:a05:6a00:13a3:b0:676:2a5c:7bc5 with SMTP id t35-20020a056a0013a300b006762a5c7bc5mr5237596pfg.1.1690445563409;
        Thu, 27 Jul 2023 01:12:43 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 34/49] ext4: dynamically allocate the ext4-es shrinker
Date: Thu, 27 Jul 2023 16:04:47 +0800
Message-Id: <20230727080502.77895-35-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the ext4-es shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct ext4_sb_info.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 fs/ext4/ext4.h           |  2 +-
 fs/ext4/extents_status.c | 22 ++++++++++++----------
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 1e2259d9967d..82397bf0b33e 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1657,7 +1657,7 @@ struct ext4_sb_info {
 	__u32 s_csum_seed;
 
 	/* Reclaim extents from extent status tree */
-	struct shrinker s_es_shrinker;
+	struct shrinker *s_es_shrinker;
 	struct list_head s_es_list;	/* List of inodes with reclaimable extents */
 	long s_es_nr_inode;
 	struct ext4_es_stats s_es_stats;
diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
index 9b5b8951afb4..74bb64fadbc4 100644
--- a/fs/ext4/extents_status.c
+++ b/fs/ext4/extents_status.c
@@ -1596,7 +1596,7 @@ static unsigned long ext4_es_count(struct shrinker *shrink,
 	unsigned long nr;
 	struct ext4_sb_info *sbi;
 
-	sbi = container_of(shrink, struct ext4_sb_info, s_es_shrinker);
+	sbi = shrink->private_data;
 	nr = percpu_counter_read_positive(&sbi->s_es_stats.es_stats_shk_cnt);
 	trace_ext4_es_shrink_count(sbi->s_sb, sc->nr_to_scan, nr);
 	return nr;
@@ -1605,8 +1605,7 @@ static unsigned long ext4_es_count(struct shrinker *shrink,
 static unsigned long ext4_es_scan(struct shrinker *shrink,
 				  struct shrink_control *sc)
 {
-	struct ext4_sb_info *sbi = container_of(shrink,
-					struct ext4_sb_info, s_es_shrinker);
+	struct ext4_sb_info *sbi = shrink->private_data;
 	int nr_to_scan = sc->nr_to_scan;
 	int ret, nr_shrunk;
 
@@ -1690,14 +1689,17 @@ int ext4_es_register_shrinker(struct ext4_sb_info *sbi)
 	if (err)
 		goto err3;
 
-	sbi->s_es_shrinker.scan_objects = ext4_es_scan;
-	sbi->s_es_shrinker.count_objects = ext4_es_count;
-	sbi->s_es_shrinker.seeks = DEFAULT_SEEKS;
-	err = register_shrinker(&sbi->s_es_shrinker, "ext4-es:%s",
-				sbi->s_sb->s_id);
-	if (err)
+	sbi->s_es_shrinker = shrinker_alloc(0, "ext4-es:%s", sbi->s_sb->s_id);
+	if (!sbi->s_es_shrinker)
 		goto err4;
 
+	sbi->s_es_shrinker->scan_objects = ext4_es_scan;
+	sbi->s_es_shrinker->count_objects = ext4_es_count;
+	sbi->s_es_shrinker->seeks = DEFAULT_SEEKS;
+	sbi->s_es_shrinker->private_data = sbi;
+
+	shrinker_register(sbi->s_es_shrinker);
+
 	return 0;
 err4:
 	percpu_counter_destroy(&sbi->s_es_stats.es_stats_shk_cnt);
@@ -1716,7 +1718,7 @@ void ext4_es_unregister_shrinker(struct ext4_sb_info *sbi)
 	percpu_counter_destroy(&sbi->s_es_stats.es_stats_cache_misses);
 	percpu_counter_destroy(&sbi->s_es_stats.es_stats_all_cnt);
 	percpu_counter_destroy(&sbi->s_es_stats.es_stats_shk_cnt);
-	unregister_shrinker(&sbi->s_es_shrinker);
+	shrinker_free(sbi->s_es_shrinker);
 }
 
 /*
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570893.893379 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBd-0000LR-WF; Thu, 27 Jul 2023 08:17:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570893.893379; Thu, 27 Jul 2023 08:17:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBd-0000Jw-PC; Thu, 27 Jul 2023 08:17:29 +0000
Received: by outflank-mailman (input) for mailman id 570893;
 Thu, 27 Jul 2023 08:17:27 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw2A-0000Tn-Ut
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:07:42 +0000
Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com
 [2607:f8b0:4864:20::430])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a7f9273a-2c54-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:07:41 +0200 (CEST)
Received: by mail-pf1-x430.google.com with SMTP id
 d2e1a72fcca58-682b1768a0bso174674b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:07:41 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.07.26
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:07:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a7f9273a-2c54-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445259; x=1691050059;
        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=bO4yc6b0222dRNj48HoFyPuU9QjRVolFKKVhhMGpLKw=;
        b=bsOGFEHMBlylId/BUUU6j2E7pnjQ9uMa3Dv7D6LoIY48uPLQavKrpj689NrNUpNLTl
         Aanz7sKMrDaOTTGh4q0MwHTWAvihn1jLx/NBWz0K9CQrFU5rnVI5CzfKG4yO6ADEleGk
         +0iHBjbO0i9m2+usUNEX9xFmZ3EhQv1mJHg4H05ocCDdgDOngyKPTxLLXx+aCRh/qeWu
         DaVggQ15a1Fk3lZ/quyODiCtb+FgmREKB0V2Ac2I9AcArTAe8N9Pb2STGieOdKv9GKuP
         YDdg42gSOnr6HuMRpDchso7LM2qcKeKJNp+Y2dbUP8m4urT1oK6m0eJU2zmqUir1DcF2
         Lspg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445259; x=1691050059;
        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=bO4yc6b0222dRNj48HoFyPuU9QjRVolFKKVhhMGpLKw=;
        b=M9O7sDayoabJlIu+DRbGXEDWGO21EFB1N95fisxwKgkD0Q9UFwNHRDa3WYE1gV9CLJ
         B5UXv62qXB3ZRVaja49F9A+8+4Q0sOCpagCseHolFkRIAdfiONxJ3seWE4a8rPQS8KyR
         Dep4+YLYA2gITr9LdNMK7ndViKXUYfl6yGRt2UX8Cqu4XFYo6fYp44rVk8czFqttUORk
         Z5bILAdj36/lpcAqJRWkw0iaYUa9+RpfOgaAz1zjCfo6s3OqvzjmERtVzX6oCCWNtfjV
         069tKd6e9u9OEYX1s9fbQQP+dhrx5tB8adnJlymnCTjJ5Algj5mvOIuRGVRpntCt9WHd
         lmHw==
X-Gm-Message-State: ABy/qLbH8PqRWCeoz2/9EQ7tAe3YXJWgZiLEJv208uiyKhBvfYvJPwKC
	/sksUHx1c+1so141WRl99lM7fA==
X-Google-Smtp-Source: APBJJlEtjuu7JvMViG/zI1+BRK6QgnXajX34xFKdSMMqB1WswZOW9mIhLIlLvIrLtx031P4ulw5hGg==
X-Received: by 2002:a05:6a20:9381:b0:137:8f19:1de7 with SMTP id x1-20020a056a20938100b001378f191de7mr6160325pzh.0.1690445259706;
        Thu, 27 Jul 2023 01:07:39 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 09/49] xenbus/backend: dynamically allocate the xen-backend shrinker
Date: Thu, 27 Jul 2023 16:04:22 +0800
Message-Id: <20230727080502.77895-10-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the xen-backend shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 drivers/xen/xenbus/xenbus_probe_backend.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/xen/xenbus/xenbus_probe_backend.c b/drivers/xen/xenbus/xenbus_probe_backend.c
index da96c260e26b..929c41a5ccee 100644
--- a/drivers/xen/xenbus/xenbus_probe_backend.c
+++ b/drivers/xen/xenbus/xenbus_probe_backend.c
@@ -284,13 +284,9 @@ static unsigned long backend_shrink_memory_count(struct shrinker *shrinker,
 	return 0;
 }
 
-static struct shrinker backend_memory_shrinker = {
-	.count_objects = backend_shrink_memory_count,
-	.seeks = DEFAULT_SEEKS,
-};
-
 static int __init xenbus_probe_backend_init(void)
 {
+	struct shrinker *backend_memory_shrinker;
 	static struct notifier_block xenstore_notifier = {
 		.notifier_call = backend_probe_and_watch
 	};
@@ -305,8 +301,16 @@ static int __init xenbus_probe_backend_init(void)
 
 	register_xenstore_notifier(&xenstore_notifier);
 
-	if (register_shrinker(&backend_memory_shrinker, "xen-backend"))
-		pr_warn("shrinker registration failed\n");
+	backend_memory_shrinker = shrinker_alloc(0, "xen-backend");
+	if (!backend_memory_shrinker) {
+		pr_warn("shrinker allocation failed\n");
+		return 0;
+	}
+
+	backend_memory_shrinker->count_objects = backend_shrink_memory_count;
+	backend_memory_shrinker->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(backend_memory_shrinker);
 
 	return 0;
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570894.893387 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBf-0000Xn-6m; Thu, 27 Jul 2023 08:17:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570894.893387; Thu, 27 Jul 2023 08:17:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBe-0000VL-JO; Thu, 27 Jul 2023 08:17:30 +0000
Received: by outflank-mailman (input) for mailman id 570894;
 Thu, 27 Jul 2023 08:17:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw55-0001DS-61
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:10:43 +0000
Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com
 [2607:f8b0:4864:20::42b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 142c4fa7-2c55-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:10:42 +0200 (CEST)
Received: by mail-pf1-x42b.google.com with SMTP id
 d2e1a72fcca58-682ae5d4184so171173b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:10:42 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.10.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:10:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 142c4fa7-2c55-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445441; x=1691050241;
        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=41xmtjHXWdMgLIKiQIRlxv7trVO9ZOyoGRN9dVMIVRc=;
        b=jJgBI8VQPI/Z/ccNdZLQtiBsmt12TPxNxcyEmmLc3cIOt24zWvO/St4DfrzxY5Admf
         3SDYEYmgqkbX/HCmKk1mhlFmceeqU6DbMAGX6sKGDtq8kQ9lxaCqTKXpNvB2geQpeb/h
         vsR6q4NMVpErQyh+gExoRBpaWXOpdpMQoCMJklMeKJXld9SnNAjyhQYKrvvJBu4rqMJ/
         BskSxQtm7+yyLnANci339dgBsgl+QpehmZaSNibUdDIkrrPM4ocpVsZrOOzcHGIll593
         Cyr5YWDE/4EhF6WmCmYK5tukhzqSpwAn7rBK0/njtLGQr3gzTYmZeQalMU7Drn0Ngg3k
         gxSA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445441; x=1691050241;
        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=41xmtjHXWdMgLIKiQIRlxv7trVO9ZOyoGRN9dVMIVRc=;
        b=cM0aEXn5AIVyT3O6nvD1xe+3mlvh4uWwQmTUG1LG33mRqOYDoFwhuDajgo8VkyFAlR
         XHP6O50eDqFIwBl/FUG95b123wnrLI9b+6sYdx6SZsPl4ER6WYWGera7if0gDaTdDTVy
         lAoEfB0o9MBoKzHuroUnkjAu739nvHDFOsRnlj3Hiwhe6Rxe5GSilYUmrXkn5GXNFGNI
         RU7OZydMK8THoI9+VFDd4UxOlbZTEpHRuDiNO9Fr8zmRvid/cUPVZ0TRb8ddVkbzcZNp
         lRh1VSXqv1ifybWwMxYpjRiXy8QHNNZ5HaIo6n0gfSOwMHHFHC3W1raqsGocCV3EixjM
         fOtw==
X-Gm-Message-State: ABy/qLZO07wSQJxLO1ChF/4XHc/41TDTbVU99QQyxTBmtleW4Z4N/X9X
	bZp7atyMfwWLeSP4uGQvU6LR9A==
X-Google-Smtp-Source: APBJJlFv8o3eRUEIkT8KpumLsadZadNPzVgwQnm8JqI4lPxEdXnFu9DFIlRiQ246ApgsoZodQYjNqA==
X-Received: by 2002:a05:6a20:1590:b0:137:4fd0:e2e1 with SMTP id h16-20020a056a20159000b001374fd0e2e1mr5901952pzj.4.1690445441148;
        Thu, 27 Jul 2023 01:10:41 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 24/49] drm/i915: dynamically allocate the i915_gem_mm shrinker
Date: Thu, 27 Jul 2023 16:04:37 +0800
Message-Id: <20230727080502.77895-25-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the i915_gem_mm shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct drm_i915_private.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_shrinker.c | 30 +++++++++++---------
 drivers/gpu/drm/i915/i915_drv.h              |  2 +-
 2 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c b/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c
index 214763942aa2..4504eb4f31d5 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c
@@ -284,8 +284,7 @@ unsigned long i915_gem_shrink_all(struct drm_i915_private *i915)
 static unsigned long
 i915_gem_shrinker_count(struct shrinker *shrinker, struct shrink_control *sc)
 {
-	struct drm_i915_private *i915 =
-		container_of(shrinker, struct drm_i915_private, mm.shrinker);
+	struct drm_i915_private *i915 = shrinker->private_data;
 	unsigned long num_objects;
 	unsigned long count;
 
@@ -302,8 +301,8 @@ i915_gem_shrinker_count(struct shrinker *shrinker, struct shrink_control *sc)
 	if (num_objects) {
 		unsigned long avg = 2 * count / num_objects;
 
-		i915->mm.shrinker.batch =
-			max((i915->mm.shrinker.batch + avg) >> 1,
+		i915->mm.shrinker->batch =
+			max((i915->mm.shrinker->batch + avg) >> 1,
 			    128ul /* default SHRINK_BATCH */);
 	}
 
@@ -313,8 +312,7 @@ i915_gem_shrinker_count(struct shrinker *shrinker, struct shrink_control *sc)
 static unsigned long
 i915_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc)
 {
-	struct drm_i915_private *i915 =
-		container_of(shrinker, struct drm_i915_private, mm.shrinker);
+	struct drm_i915_private *i915 = shrinker->private_data;
 	unsigned long freed;
 
 	sc->nr_scanned = 0;
@@ -422,12 +420,18 @@ i915_gem_shrinker_vmap(struct notifier_block *nb, unsigned long event, void *ptr
 
 void i915_gem_driver_register__shrinker(struct drm_i915_private *i915)
 {
-	i915->mm.shrinker.scan_objects = i915_gem_shrinker_scan;
-	i915->mm.shrinker.count_objects = i915_gem_shrinker_count;
-	i915->mm.shrinker.seeks = DEFAULT_SEEKS;
-	i915->mm.shrinker.batch = 4096;
-	drm_WARN_ON(&i915->drm, register_shrinker(&i915->mm.shrinker,
-						  "drm-i915_gem"));
+	i915->mm.shrinker = shrinker_alloc(0, "drm-i915_gem");
+	if (!i915->mm.shrinker) {
+		drm_WARN_ON(&i915->drm, 1);
+	} else {
+		i915->mm.shrinker->scan_objects = i915_gem_shrinker_scan;
+		i915->mm.shrinker->count_objects = i915_gem_shrinker_count;
+		i915->mm.shrinker->seeks = DEFAULT_SEEKS;
+		i915->mm.shrinker->batch = 4096;
+		i915->mm.shrinker->private_data = i915;
+
+		shrinker_register(i915->mm.shrinker);
+	}
 
 	i915->mm.oom_notifier.notifier_call = i915_gem_shrinker_oom;
 	drm_WARN_ON(&i915->drm, register_oom_notifier(&i915->mm.oom_notifier));
@@ -443,7 +447,7 @@ void i915_gem_driver_unregister__shrinker(struct drm_i915_private *i915)
 		    unregister_vmap_purge_notifier(&i915->mm.vmap_notifier));
 	drm_WARN_ON(&i915->drm,
 		    unregister_oom_notifier(&i915->mm.oom_notifier));
-	unregister_shrinker(&i915->mm.shrinker);
+	shrinker_free(i915->mm.shrinker);
 }
 
 void i915_gem_shrinker_taints_mutex(struct drm_i915_private *i915,
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 682ef2b5c7d5..389e8bf140d7 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -163,7 +163,7 @@ struct i915_gem_mm {
 
 	struct notifier_block oom_notifier;
 	struct notifier_block vmap_notifier;
-	struct shrinker shrinker;
+	struct shrinker *shrinker;
 
 #ifdef CONFIG_MMU_NOTIFIER
 	/**
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570895.893396 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBg-0000k1-5c; Thu, 27 Jul 2023 08:17:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570895.893396; Thu, 27 Jul 2023 08:17:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBf-0000fo-EL; Thu, 27 Jul 2023 08:17:31 +0000
Received: by outflank-mailman (input) for mailman id 570895;
 Thu, 27 Jul 2023 08:17:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw7e-0001DS-M6
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:13:22 +0000
Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com
 [2607:f8b0:4864:20::42d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7337ba1d-2c55-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:13:22 +0200 (CEST)
Received: by mail-pf1-x42d.google.com with SMTP id
 d2e1a72fcca58-686f74a8992so78333b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:13:22 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.13.08
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:13:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7337ba1d-2c55-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445600; x=1691050400;
        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=f+7Rjo519K3FhaZ9jqPWNUITMom2L2BqSXFVMuCYJXE=;
        b=iCbLBUqUt9Nmpfx9vnMv71z6ZoxeAA3Kwx+3hOoXd1GaTMzDfIKBdQZJLnwkBZI0pa
         Lp64e3iwzE/rImCGGIb1ibgUBPxOPSIGFFuuYRtSxlo+aqH0+DTZDA4mGtoxEeFwJjn7
         eVXRc7yr9jM32bf+/xn99rZxVedfvtJlhFw9fGMGNkAD3ORupJUg3X+ANXG24/AH/vl7
         jpmLaXt1oCEYJ/yvLZ0XDwvzYMWndPPs0hfwCexWDUJDE/XQyc02dMzlI6K63u7Ep8SN
         XNSeVfJxqvuXvz57tL/Yxcln+9J35CIKIXgWOW2mH/cpcfLsA9vX9cNULDu6wCRYP4Zg
         0nEA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445600; x=1691050400;
        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=f+7Rjo519K3FhaZ9jqPWNUITMom2L2BqSXFVMuCYJXE=;
        b=KN+FtBZG9Eb7xWeGZ6a52wUd09GppizWmVJ4XdVwwlY3qymoEcHWNV64/spodXV6Tn
         d0Hsu3iP7jpLXjCb47sLJHbX8wPMk4ebYbz3CTqyVuyUYsE/cNKsLCAeUKizvrSA5Uyn
         26GNTX17BJzxFRnADiMWOvf2FHTX5ZhED7CkBBzKUUNa9AwP7RJYPGISjHqrmoASlMGd
         COSIy2/A5fFyJDpN8yg40SuDJktpZd/D26cMC2k9QYyXR1qkCBzjA58aegtvTMoW1CKQ
         q70DfToDZdM/AyHN1vnAi1W3QWqYWHStKQXJ4SGlvJVIH15DylEsdW2atmGCoktfajyV
         AMxQ==
X-Gm-Message-State: ABy/qLYeG8kszThrQxOkfkMUsLlpi3WQNNkpXYjOkRjwn1yPb74jKCXr
	DpAMfa+/tmRMp8nvS/0S5Pnebg==
X-Google-Smtp-Source: APBJJlFVIfpGcg6LJptv9vKKDXXp5NoXAxRgeIF2Co73Rpi3BTRYlDiWRgj+jM16dBQ5q2UaSpGRNg==
X-Received: by 2002:a05:6a20:729a:b0:100:b92b:e8be with SMTP id o26-20020a056a20729a00b00100b92be8bemr5583609pzk.2.1690445600629;
        Thu, 27 Jul 2023 01:13:20 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Chuck Lever <chuck.lever@oracle.com>,
	Jeff Layton <jlayton@kernel.org>
Subject: [PATCH v3 37/49] nfsd: dynamically allocate the nfsd-reply shrinker
Date: Thu, 27 Jul 2023 16:04:50 +0800
Message-Id: <20230727080502.77895-38-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the nfsd-reply shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct nfsd_net.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Acked-by: Chuck Lever <chuck.lever@oracle.com>
Acked-by: Jeff Layton <jlayton@kernel.org>
---
 fs/nfsd/netns.h    |  2 +-
 fs/nfsd/nfscache.c | 31 ++++++++++++++++---------------
 2 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h
index f669444d5336..ab303a8b77d5 100644
--- a/fs/nfsd/netns.h
+++ b/fs/nfsd/netns.h
@@ -177,7 +177,7 @@ struct nfsd_net {
 	/* size of cache when we saw the longest hash chain */
 	unsigned int             longest_chain_cachesize;
 
-	struct shrinker		nfsd_reply_cache_shrinker;
+	struct shrinker		*nfsd_reply_cache_shrinker;
 
 	/* tracking server-to-server copy mounts */
 	spinlock_t              nfsd_ssc_lock;
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index 80621a709510..fd56a52aa5fb 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -201,26 +201,29 @@ int nfsd_reply_cache_init(struct nfsd_net *nn)
 {
 	unsigned int hashsize;
 	unsigned int i;
-	int status = 0;
 
 	nn->max_drc_entries = nfsd_cache_size_limit();
 	atomic_set(&nn->num_drc_entries, 0);
 	hashsize = nfsd_hashsize(nn->max_drc_entries);
 	nn->maskbits = ilog2(hashsize);
 
-	nn->nfsd_reply_cache_shrinker.scan_objects = nfsd_reply_cache_scan;
-	nn->nfsd_reply_cache_shrinker.count_objects = nfsd_reply_cache_count;
-	nn->nfsd_reply_cache_shrinker.seeks = 1;
-	status = register_shrinker(&nn->nfsd_reply_cache_shrinker,
-				   "nfsd-reply:%s", nn->nfsd_name);
-	if (status)
-		return status;
-
 	nn->drc_hashtbl = kvzalloc(array_size(hashsize,
 				sizeof(*nn->drc_hashtbl)), GFP_KERNEL);
 	if (!nn->drc_hashtbl)
+		return -ENOMEM;
+
+	nn->nfsd_reply_cache_shrinker = shrinker_alloc(0, "nfsd-reply:%s",
+						       nn->nfsd_name);
+	if (!nn->nfsd_reply_cache_shrinker)
 		goto out_shrinker;
 
+	nn->nfsd_reply_cache_shrinker->scan_objects = nfsd_reply_cache_scan;
+	nn->nfsd_reply_cache_shrinker->count_objects = nfsd_reply_cache_count;
+	nn->nfsd_reply_cache_shrinker->seeks = 1;
+	nn->nfsd_reply_cache_shrinker->private_data = nn;
+
+	shrinker_register(nn->nfsd_reply_cache_shrinker);
+
 	for (i = 0; i < hashsize; i++) {
 		INIT_LIST_HEAD(&nn->drc_hashtbl[i].lru_head);
 		spin_lock_init(&nn->drc_hashtbl[i].cache_lock);
@@ -229,7 +232,7 @@ int nfsd_reply_cache_init(struct nfsd_net *nn)
 
 	return 0;
 out_shrinker:
-	unregister_shrinker(&nn->nfsd_reply_cache_shrinker);
+	kvfree(nn->drc_hashtbl);
 	printk(KERN_ERR "nfsd: failed to allocate reply cache\n");
 	return -ENOMEM;
 }
@@ -239,7 +242,7 @@ void nfsd_reply_cache_shutdown(struct nfsd_net *nn)
 	struct nfsd_cacherep *rp;
 	unsigned int i;
 
-	unregister_shrinker(&nn->nfsd_reply_cache_shrinker);
+	shrinker_free(nn->nfsd_reply_cache_shrinker);
 
 	for (i = 0; i < nn->drc_hashsize; i++) {
 		struct list_head *head = &nn->drc_hashtbl[i].lru_head;
@@ -323,8 +326,7 @@ nfsd_prune_bucket_locked(struct nfsd_net *nn, struct nfsd_drc_bucket *b,
 static unsigned long
 nfsd_reply_cache_count(struct shrinker *shrink, struct shrink_control *sc)
 {
-	struct nfsd_net *nn = container_of(shrink,
-				struct nfsd_net, nfsd_reply_cache_shrinker);
+	struct nfsd_net *nn = shrink->private_data;
 
 	return atomic_read(&nn->num_drc_entries);
 }
@@ -343,8 +345,7 @@ nfsd_reply_cache_count(struct shrinker *shrink, struct shrink_control *sc)
 static unsigned long
 nfsd_reply_cache_scan(struct shrinker *shrink, struct shrink_control *sc)
 {
-	struct nfsd_net *nn = container_of(shrink,
-				struct nfsd_net, nfsd_reply_cache_shrinker);
+	struct nfsd_net *nn = shrink->private_data;
 	unsigned long freed = 0;
 	LIST_HEAD(dispose);
 	unsigned int i;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570896.893405 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBh-00010u-6l; Thu, 27 Jul 2023 08:17:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570896.893405; Thu, 27 Jul 2023 08:17:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBg-0000vc-El; Thu, 27 Jul 2023 08:17:32 +0000
Received: by outflank-mailman (input) for mailman id 570896;
 Thu, 27 Jul 2023 08:17:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw38-0001DS-NI
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:08:42 +0000
Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com
 [2607:f8b0:4864:20::42a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cc518a37-2c54-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:08:42 +0200 (CEST)
Received: by mail-pf1-x42a.google.com with SMTP id
 d2e1a72fcca58-6862d4a1376so188749b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:08:42 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.08.28
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:08:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cc518a37-2c54-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445320; x=1691050120;
        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=XXAG7UeexodYStcT1Y2gz+/6q+0E2xrK+D1h2eKApUE=;
        b=FYj50vEzpqpR7/JHkZvpr0BbTAfzFzYsY4J3w1nZqjf0BTlUYZg3ENXBt/E7bux565
         4DCZMkbhxlQ4uTban0w+5H7n5bf7VgzCbRNW1xqy8V5Ii4h7bosDaVHN++mTVrl/7/23
         WZSmzaLueVj3BrcJoWAHCGvwk4IeXhgQ2bRNwNFy4V/7BgrLzTS5YJPWuEtp82HeU9Up
         caVaRRGf3jcxw3YWyZv3sYid2tLZtftHEV5/wvAbdGp4oPWlqnmvAPY3i6LJ0BE1y1ID
         4Y8Xa75Xt3wm60SqSMunOKTUxH6aZ+1fGysddWTaZe8OA5PjpbdliSp8jUu0Z/6yBQXn
         rqWA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445320; x=1691050120;
        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=XXAG7UeexodYStcT1Y2gz+/6q+0E2xrK+D1h2eKApUE=;
        b=XPZsxtfPVyh03M8Kz2Mt9G5xd5nEA8cSH28d/0dABm/5brZjOnE4hO2FordZ08CRXU
         30I5oSIJuUe7/TJC75MUVUE0kwSDjC0nvDiJQgm6//ol6FZieLNby/2wBbC8eu7vwQGf
         VL6CGOAV51WWRgzwjtV5pFFCzYwNjlcdj8MTrsYt9WcA9UrErQeV9VlNcQW/7Bf7CMs+
         vPO85THHRS/xwkryo3RGntsa6rIhVBouzCeZQcA6S0qW9dxqQe843Lkpkwxv8f7MCW95
         n0VuMhjfBpmyq3ZRJaP8fONwK8UXvizr3/pSiiISxR258Ebpx1qGQ3EicwINJyBaSrWI
         z/eg==
X-Gm-Message-State: ABy/qLZRfQb93lbmpw0VLcOSa25z+hvDeoBUOo4SQg44jMkj7ELylvK7
	Jc0xaH0U4RnkW+qPvccEG+7Mvg==
X-Google-Smtp-Source: APBJJlHkKWPiTWl3kfFSQlaHJ4f9EFj8oaHZmEibAoOMDshGtR3BMo+XERT90zfJYijHcIQQmSOpWQ==
X-Received: by 2002:a05:6a21:32a9:b0:136:f3ef:4d2 with SMTP id yt41-20020a056a2132a900b00136f3ef04d2mr6059155pzb.3.1690445320596;
        Thu, 27 Jul 2023 01:08:40 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 14/49] NFSv4.2: dynamically allocate the nfs-xattr shrinkers
Date: Thu, 27 Jul 2023 16:04:27 +0800
Message-Id: <20230727080502.77895-15-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the nfs-xattr shrinkers.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 fs/nfs/nfs42xattr.c | 87 +++++++++++++++++++++++----------------------
 1 file changed, 44 insertions(+), 43 deletions(-)

diff --git a/fs/nfs/nfs42xattr.c b/fs/nfs/nfs42xattr.c
index 911f634ba3da..2ad66a8922f4 100644
--- a/fs/nfs/nfs42xattr.c
+++ b/fs/nfs/nfs42xattr.c
@@ -796,28 +796,9 @@ static unsigned long nfs4_xattr_cache_scan(struct shrinker *shrink,
 static unsigned long nfs4_xattr_entry_scan(struct shrinker *shrink,
 					   struct shrink_control *sc);
 
-static struct shrinker nfs4_xattr_cache_shrinker = {
-	.count_objects	= nfs4_xattr_cache_count,
-	.scan_objects	= nfs4_xattr_cache_scan,
-	.seeks		= DEFAULT_SEEKS,
-	.flags		= SHRINKER_MEMCG_AWARE,
-};
-
-static struct shrinker nfs4_xattr_entry_shrinker = {
-	.count_objects	= nfs4_xattr_entry_count,
-	.scan_objects	= nfs4_xattr_entry_scan,
-	.seeks		= DEFAULT_SEEKS,
-	.batch		= 512,
-	.flags		= SHRINKER_MEMCG_AWARE,
-};
-
-static struct shrinker nfs4_xattr_large_entry_shrinker = {
-	.count_objects	= nfs4_xattr_entry_count,
-	.scan_objects	= nfs4_xattr_entry_scan,
-	.seeks		= 1,
-	.batch		= 512,
-	.flags		= SHRINKER_MEMCG_AWARE,
-};
+static struct shrinker *nfs4_xattr_cache_shrinker;
+static struct shrinker *nfs4_xattr_entry_shrinker;
+static struct shrinker *nfs4_xattr_large_entry_shrinker;
 
 static enum lru_status
 cache_lru_isolate(struct list_head *item,
@@ -943,7 +924,7 @@ nfs4_xattr_entry_scan(struct shrinker *shrink, struct shrink_control *sc)
 	struct nfs4_xattr_entry *entry;
 	struct list_lru *lru;
 
-	lru = (shrink == &nfs4_xattr_large_entry_shrinker) ?
+	lru = (shrink == nfs4_xattr_large_entry_shrinker) ?
 	    &nfs4_xattr_large_entry_lru : &nfs4_xattr_entry_lru;
 
 	freed = list_lru_shrink_walk(lru, sc, entry_lru_isolate, &dispose);
@@ -971,7 +952,7 @@ nfs4_xattr_entry_count(struct shrinker *shrink, struct shrink_control *sc)
 	unsigned long count;
 	struct list_lru *lru;
 
-	lru = (shrink == &nfs4_xattr_large_entry_shrinker) ?
+	lru = (shrink == nfs4_xattr_large_entry_shrinker) ?
 	    &nfs4_xattr_large_entry_lru : &nfs4_xattr_entry_lru;
 
 	count = list_lru_shrink_count(lru, sc);
@@ -991,18 +972,34 @@ static void nfs4_xattr_cache_init_once(void *p)
 	INIT_LIST_HEAD(&cache->dispose);
 }
 
-static int nfs4_xattr_shrinker_init(struct shrinker *shrinker,
-				    struct list_lru *lru, const char *name)
+typedef unsigned long (*count_objects_cb)(struct shrinker *s,
+					  struct shrink_control *sc);
+typedef unsigned long (*scan_objects_cb)(struct shrinker *s,
+					 struct shrink_control *sc);
+
+static int __init nfs4_xattr_shrinker_init(struct shrinker **shrinker,
+					   struct list_lru *lru, const char *name,
+					   count_objects_cb count,
+					   scan_objects_cb scan, long batch, int seeks)
 {
-	int ret = 0;
+	int ret;
 
-	ret = register_shrinker(shrinker, name);
-	if (ret)
+	*shrinker = shrinker_alloc(SHRINKER_MEMCG_AWARE, name);
+	if (!*shrinker)
+		return -ENOMEM;
+
+	ret = list_lru_init_memcg(lru, *shrinker);
+	if (ret) {
+		shrinker_free(*shrinker);
 		return ret;
+	}
 
-	ret = list_lru_init_memcg(lru, shrinker);
-	if (ret)
-		unregister_shrinker(shrinker);
+	(*shrinker)->count_objects = count;
+	(*shrinker)->scan_objects = scan;
+	(*shrinker)->batch = batch;
+	(*shrinker)->seeks = seeks;
+
+	shrinker_register(*shrinker);
 
 	return ret;
 }
@@ -1010,7 +1007,7 @@ static int nfs4_xattr_shrinker_init(struct shrinker *shrinker,
 static void nfs4_xattr_shrinker_destroy(struct shrinker *shrinker,
 					struct list_lru *lru)
 {
-	unregister_shrinker(shrinker);
+	shrinker_free(shrinker);
 	list_lru_destroy(lru);
 }
 
@@ -1026,27 +1023,31 @@ int __init nfs4_xattr_cache_init(void)
 		return -ENOMEM;
 
 	ret = nfs4_xattr_shrinker_init(&nfs4_xattr_cache_shrinker,
-				       &nfs4_xattr_cache_lru,
-				       "nfs-xattr_cache");
+				       &nfs4_xattr_cache_lru, "nfs-xattr_cache",
+				       nfs4_xattr_cache_count,
+				       nfs4_xattr_cache_scan, 0, DEFAULT_SEEKS);
 	if (ret)
 		goto out1;
 
 	ret = nfs4_xattr_shrinker_init(&nfs4_xattr_entry_shrinker,
-				       &nfs4_xattr_entry_lru,
-				       "nfs-xattr_entry");
+				       &nfs4_xattr_entry_lru, "nfs-xattr_entry",
+				       nfs4_xattr_entry_count,
+				       nfs4_xattr_entry_scan, 512, DEFAULT_SEEKS);
 	if (ret)
 		goto out2;
 
 	ret = nfs4_xattr_shrinker_init(&nfs4_xattr_large_entry_shrinker,
 				       &nfs4_xattr_large_entry_lru,
-				       "nfs-xattr_large_entry");
+				       "nfs-xattr_large_entry",
+				       nfs4_xattr_entry_count,
+				       nfs4_xattr_entry_scan, 512, 1);
 	if (!ret)
 		return 0;
 
-	nfs4_xattr_shrinker_destroy(&nfs4_xattr_entry_shrinker,
+	nfs4_xattr_shrinker_destroy(nfs4_xattr_entry_shrinker,
 				    &nfs4_xattr_entry_lru);
 out2:
-	nfs4_xattr_shrinker_destroy(&nfs4_xattr_cache_shrinker,
+	nfs4_xattr_shrinker_destroy(nfs4_xattr_cache_shrinker,
 				    &nfs4_xattr_cache_lru);
 out1:
 	kmem_cache_destroy(nfs4_xattr_cache_cachep);
@@ -1056,11 +1057,11 @@ int __init nfs4_xattr_cache_init(void)
 
 void nfs4_xattr_cache_exit(void)
 {
-	nfs4_xattr_shrinker_destroy(&nfs4_xattr_large_entry_shrinker,
+	nfs4_xattr_shrinker_destroy(nfs4_xattr_large_entry_shrinker,
 				    &nfs4_xattr_large_entry_lru);
-	nfs4_xattr_shrinker_destroy(&nfs4_xattr_entry_shrinker,
+	nfs4_xattr_shrinker_destroy(nfs4_xattr_entry_shrinker,
 				    &nfs4_xattr_entry_lru);
-	nfs4_xattr_shrinker_destroy(&nfs4_xattr_cache_shrinker,
+	nfs4_xattr_shrinker_destroy(nfs4_xattr_cache_shrinker,
 				    &nfs4_xattr_cache_lru);
 	kmem_cache_destroy(nfs4_xattr_cache_cachep);
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570898.893412 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBi-0001Mh-8G; Thu, 27 Jul 2023 08:17:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570898.893412; Thu, 27 Jul 2023 08:17:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBh-0001Gt-OE; Thu, 27 Jul 2023 08:17:33 +0000
Received: by outflank-mailman (input) for mailman id 570898;
 Thu, 27 Jul 2023 08:17:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw47-0001DS-JC
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:09:43 +0000
Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com
 [2607:f8b0:4864:20::434])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f0acd366-2c54-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:09:43 +0200 (CEST)
Received: by mail-pf1-x434.google.com with SMTP id
 d2e1a72fcca58-686f74a8992so77702b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:09:43 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.09.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:09:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f0acd366-2c54-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445381; x=1691050181;
        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=GSWsN00ewH1CUxuL2on0amogNZtYjpfZMPk3tXk1MLc=;
        b=Uigp99md2Rr3CXBoApAa/OORnqo8B1J7RivQ80kk84PuD/8/0U/wiHIiPqvPSjzBq+
         4mgkiCdsVsAk9/e2muldWgdoE75BspngFHkVey9mAlq6MnrgeN5Z2UVnZxuIj86jdS6R
         rAWjfbsFjXDEfm8YOidjdqca7DNptBkelH0HrT7nXcdFtSlvKmDtxqUQOqWjbYzyZulg
         AN7Mzxd848XhJE6ClueXrvuJZWX5X85+XT80LyTl5276AdX2DnTvKQaDsxfVQAKr1XxX
         WaB1fRqts+Skr4BpFNBdK0X00kCFzaVEUe4nziyxeBmy6RtpnTKoOQLFGVCxxQosoZyC
         4x+w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445381; x=1691050181;
        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=GSWsN00ewH1CUxuL2on0amogNZtYjpfZMPk3tXk1MLc=;
        b=ju+zjutvd0iXdzeEnS5tAt+cVYV1XuSpUOaDOjXJ0SkG6xS44qAVjIZbbFFl5HCihE
         e4VFVxkMfDrD79C6WCTZBq5RuFovFZBBp0v3eVy0o/jU4FFqvfNWTNKVFPoGswGeG+pl
         PZ3+znUuTMG++jt0SDFZZ+8dkgEEL1nOtVe0q7ltutZ+y0Kz00SdNuQsIME6wx+lDoUm
         nRa4IdO4Y9EfFnV+da1ybuE3XmWX2fRmSGs/r53bTgXdKV4WcxCxKnxFO3bPJ5RJlbe6
         M4NnX6yHEbfq6GZZ0BlyQKZWs97XvEx4Cj7uEBgP5qkg4Gn8GIpmszSUJWDASx+ygRlj
         cgSg==
X-Gm-Message-State: ABy/qLad5SsIK2pDbE5wZOwKtLdyvlmfCg3RJic4Hso1TeXzQYV2uaVd
	8T5EP/ligjfYhyPiKN+yOCaWiA==
X-Google-Smtp-Source: APBJJlHVjyqYSo1ak3Z7chV1yhtxMPzG2+b/e8BLYdWQhXdIbtZlkhi04HlfYJAG9z5TWY/X++2RBQ==
X-Received: by 2002:a05:6a20:729a:b0:100:b92b:e8be with SMTP id o26-20020a056a20729a00b00100b92be8bemr5576237pzk.2.1690445381598;
        Thu, 27 Jul 2023 01:09:41 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v3 19/49] rcu: dynamically allocate the rcu-lazy shrinker
Date: Thu, 27 Jul 2023 16:04:32 +0800
Message-Id: <20230727080502.77895-20-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the rcu-lazy shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 kernel/rcu/tree_nocb.h | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h
index 5598212d1f27..e1c59c33738a 100644
--- a/kernel/rcu/tree_nocb.h
+++ b/kernel/rcu/tree_nocb.h
@@ -1396,13 +1396,6 @@ lazy_rcu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
 
 	return count ? count : SHRINK_STOP;
 }
-
-static struct shrinker lazy_rcu_shrinker = {
-	.count_objects = lazy_rcu_shrink_count,
-	.scan_objects = lazy_rcu_shrink_scan,
-	.batch = 0,
-	.seeks = DEFAULT_SEEKS,
-};
 #endif // #ifdef CONFIG_RCU_LAZY
 
 void __init rcu_init_nohz(void)
@@ -1410,6 +1403,7 @@ void __init rcu_init_nohz(void)
 	int cpu;
 	struct rcu_data *rdp;
 	const struct cpumask *cpumask = NULL;
+	struct shrinker * __maybe_unused lazy_rcu_shrinker;
 
 #if defined(CONFIG_NO_HZ_FULL)
 	if (tick_nohz_full_running && !cpumask_empty(tick_nohz_full_mask))
@@ -1436,8 +1430,16 @@ void __init rcu_init_nohz(void)
 		return;
 
 #ifdef CONFIG_RCU_LAZY
-	if (register_shrinker(&lazy_rcu_shrinker, "rcu-lazy"))
-		pr_err("Failed to register lazy_rcu shrinker!\n");
+	lazy_rcu_shrinker = shrinker_alloc(0, "rcu-lazy");
+	if (!lazy_rcu_shrinker) {
+		pr_err("Failed to allocate lazy_rcu shrinker!\n");
+	} else {
+		lazy_rcu_shrinker->count_objects = lazy_rcu_shrink_count;
+		lazy_rcu_shrinker->scan_objects = lazy_rcu_shrink_scan;
+		lazy_rcu_shrinker->seeks = DEFAULT_SEEKS;
+
+		shrinker_register(lazy_rcu_shrinker);
+	}
 #endif // #ifdef CONFIG_RCU_LAZY
 
 	if (!cpumask_subset(rcu_nocb_mask, cpu_possible_mask)) {
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570900.893425 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBk-0001rq-A4; Thu, 27 Jul 2023 08:17:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570900.893425; Thu, 27 Jul 2023 08:17:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBk-0001oB-0W; Thu, 27 Jul 2023 08:17:36 +0000
Received: by outflank-mailman (input) for mailman id 570900;
 Thu, 27 Jul 2023 08:17:33 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw9R-00033O-Qr
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:15:13 +0000
Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com
 [2607:f8b0:4864:20::42c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b4aa3c15-2c55-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:15:11 +0200 (CEST)
Received: by mail-pf1-x42c.google.com with SMTP id
 d2e1a72fcca58-682ae5d4184so171871b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:15:11 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.14.58
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:15:09 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b4aa3c15-2c55-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445710; x=1691050510;
        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=VvZzKGLWBPnU/YifQKDl8Wb9pt+zZKHS88YiwcrJMO0=;
        b=Q9tqRuTfW+cY5srbHn7u8IP29b5ufDGfp68smV7E8fCftTGxosTYM3eDhoIDWtvZOS
         DRED9X92lIXCPbqcQpIlzzNJl6Y97wba6ST6WufRGhIvIpuge106NPqvp5c2ehyU/Asd
         oMSA8Tv1DuVK+y2e86ZmSQomDeERnbVDEUOxskrhk9BtE3TwMnb685MJvFtGPrph/mim
         WUrL9AIFCCdRfI7Aqv+dUVQoQAzWWodSjUeYusw3M4ZTGfzP+pFvJNDluf8pwba1l8gY
         qAENLjZRBpCKMNG/eYYva8ELPdIrnFs1AFMKEYzGL9aFEWuygoSzbktPATbV892qAF+O
         GibA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445710; x=1691050510;
        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=VvZzKGLWBPnU/YifQKDl8Wb9pt+zZKHS88YiwcrJMO0=;
        b=VPKpkkTGlzDysfu5ICnKNqfELY/AuDWuzRJG2KPa7kBG6lm5GsQ6LC0CQOsbDGc8/g
         FZMH1DooP3dBq8PgXlBhbdUQ5j1SXPW6lMO4sWLsktIwI2yMAvovCy0wxNOGlCChQ2kM
         LxeTItFEjubnaNdUj05f1Qum0GmGCWvyFCmbr/CnX26DPlWPne7iRPc1VXjhgs2dmI/+
         fS+E9qN+xu+jPPj8FEWAuE37QnsagjLJJm/I/zAMgN7OE9knFp8bTqdsDybLBHUdCEFf
         vXSZXlr1TCkypPZt5nvVU+u4ZobftC8PPpfYqeQOwMacaMePZMs/J9Gtn+LCOT6FkWUS
         00VQ==
X-Gm-Message-State: ABy/qLaDl6fT2ooYZci1dFCI3mNpbIeQeefLYOen1Z0ubT+lExXvG9mN
	4GtQJkNjW8KwwLDLslCd88XKnQ==
X-Google-Smtp-Source: APBJJlFdwRyoe8DFBb0YfEbWLnk7UTz07biEby4+6kjTFVFVYib+WaYPD1SK6i9vhrIynDbldBSUcQ==
X-Received: by 2002:a62:1d04:0:b0:66f:3fc5:6167 with SMTP id d4-20020a621d04000000b0066f3fc56167mr4406413pfd.1.1690445710333;
        Thu, 27 Jul 2023 01:15:10 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v3 46/49] mm: shrinker: make global slab shrink lockless
Date: Thu, 27 Jul 2023 16:04:59 +0800
Message-Id: <20230727080502.77895-47-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The shrinker_rwsem is a global read-write lock in shrinkers subsystem,
which protects most operations such as slab shrink, registration and
unregistration of shrinkers, etc. This can easily cause problems in the
following cases.

1) When the memory pressure is high and there are many filesystems
   mounted or unmounted at the same time, slab shrink will be affected
   (down_read_trylock() failed).

   Such as the real workload mentioned by Kirill Tkhai:

   ```
   One of the real workloads from my experience is start
   of an overcommitted node containing many starting
   containers after node crash (or many resuming containers
   after reboot for kernel update). In these cases memory
   pressure is huge, and the node goes round in long reclaim.
   ```

2) If a shrinker is blocked (such as the case mentioned
   in [1]) and a writer comes in (such as mount a fs),
   then this writer will be blocked and cause all
   subsequent shrinker-related operations to be blocked.

Even if there is no competitor when shrinking slab, there may still be a
problem. The down_read_trylock() may become a perf hotspot with frequent
calls to shrink_slab(). Because of the poor multicore scalability of
atomic operations, this can lead to a significant drop in IPC
(instructions per cycle).

We used to implement the lockless slab shrink with SRCU [2], but then
kernel test robot reported -88.8% regression in
stress-ng.ramfs.ops_per_sec test case [3], so we reverted it [4].

This commit uses the refcount+RCU method [5] proposed by Dave Chinner
to re-implement the lockless global slab shrink. The memcg slab shrink is
handled in the subsequent patch.

For now, all shrinker instances are converted to dynamically allocated and
will be freed by call_rcu(). So we can use rcu_read_{lock,unlock}() to
ensure that the shrinker instance is valid.

And the shrinker instance will not be run again after unregistration. So
the structure that records the pointer of shrinker instance can be safely
freed without waiting for the RCU read-side critical section.

In this way, while we implement the lockless slab shrink, we don't need to
be blocked in unregister_shrinker().

The following are the test results:

stress-ng --timeout 60 --times --verify --metrics-brief --ramfs 9 &

1) Before applying this patchset:

setting to a 60 second run per stressor
dispatching hogs: 9 ramfs
stressor       bogo ops real time  usr time  sys time   bogo ops/s     bogo ops/s
                          (secs)    (secs)    (secs)   (real time) (usr+sys time)
ramfs            735238     60.00     12.37    363.70     12253.05        1955.08
for a 60.01s run time:
   1440.27s available CPU time
     12.36s user time   (  0.86%)
    363.70s system time ( 25.25%)
    376.06s total time  ( 26.11%)
load average: 10.79 4.47 1.69
passed: 9: ramfs (9)
failed: 0
skipped: 0
successful run completed in 60.01s (1 min, 0.01 secs)

2) After applying this patchset:

setting to a 60 second run per stressor
dispatching hogs: 9 ramfs
stressor       bogo ops real time  usr time  sys time   bogo ops/s     bogo ops/s
                          (secs)    (secs)    (secs)   (real time) (usr+sys time)
ramfs            746698     60.00     12.45    376.16     12444.02        1921.47
for a 60.01s run time:
   1440.28s available CPU time
     12.44s user time   (  0.86%)
    376.16s system time ( 26.12%)
    388.60s total time  ( 26.98%)
load average: 9.01 3.85 1.49
passed: 9: ramfs (9)
failed: 0
skipped: 0
successful run completed in 60.01s (1 min, 0.01 secs)

We can see that the ops/s has hardly changed.

[1]. https://lore.kernel.org/lkml/20191129214541.3110-1-ptikhomirov@virtuozzo.com/
[2]. https://lore.kernel.org/lkml/20230313112819.38938-1-zhengqi.arch@bytedance.com/
[3]. https://lore.kernel.org/lkml/202305230837.db2c233f-yujie.liu@intel.com/
[4]. https://lore.kernel.org/all/20230609081518.3039120-1-qi.zheng@linux.dev/
[5]. https://lore.kernel.org/lkml/ZIJhou1d55d4H1s0@dread.disaster.area/

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 include/linux/shrinker.h | 17 ++++++++++
 mm/shrinker.c            | 70 +++++++++++++++++++++++++++++-----------
 2 files changed, 68 insertions(+), 19 deletions(-)

diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
index eb342994675a..f06225f18531 100644
--- a/include/linux/shrinker.h
+++ b/include/linux/shrinker.h
@@ -4,6 +4,8 @@
 
 #include <linux/atomic.h>
 #include <linux/types.h>
+#include <linux/refcount.h>
+#include <linux/completion.h>
 
 #define SHRINKER_UNIT_BITS	BITS_PER_LONG
 
@@ -87,6 +89,10 @@ struct shrinker {
 	int seeks;	/* seeks to recreate an obj */
 	unsigned flags;
 
+	refcount_t refcount;
+	struct completion done;
+	struct rcu_head rcu;
+
 	void *private_data;
 
 	/* These are for internal use */
@@ -120,6 +126,17 @@ struct shrinker *shrinker_alloc(unsigned int flags, const char *fmt, ...);
 void shrinker_register(struct shrinker *shrinker);
 void shrinker_free(struct shrinker *shrinker);
 
+static inline bool shrinker_try_get(struct shrinker *shrinker)
+{
+	return refcount_inc_not_zero(&shrinker->refcount);
+}
+
+static inline void shrinker_put(struct shrinker *shrinker)
+{
+	if (refcount_dec_and_test(&shrinker->refcount))
+		complete(&shrinker->done);
+}
+
 #ifdef CONFIG_SHRINKER_DEBUG
 extern int __printf(2, 3) shrinker_debugfs_rename(struct shrinker *shrinker,
 						  const char *fmt, ...);
diff --git a/mm/shrinker.c b/mm/shrinker.c
index 1911c06b8af5..d318f5621862 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -2,6 +2,7 @@
 #include <linux/memcontrol.h>
 #include <linux/rwsem.h>
 #include <linux/shrinker.h>
+#include <linux/rculist.h>
 #include <trace/events/vmscan.h>
 
 #include "internal.h"
@@ -577,33 +578,42 @@ unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
 	if (!mem_cgroup_disabled() && !mem_cgroup_is_root(memcg))
 		return shrink_slab_memcg(gfp_mask, nid, memcg, priority);
 
-	if (!down_read_trylock(&shrinker_rwsem))
-		goto out;
-
-	list_for_each_entry(shrinker, &shrinker_list, list) {
+	rcu_read_lock();
+	list_for_each_entry_rcu(shrinker, &shrinker_list, list) {
 		struct shrink_control sc = {
 			.gfp_mask = gfp_mask,
 			.nid = nid,
 			.memcg = memcg,
 		};
 
+		if (!shrinker_try_get(shrinker))
+			continue;
+
+		/*
+		 * We can safely unlock the RCU lock here since we already
+		 * hold the refcount of the shrinker.
+		 */
+		rcu_read_unlock();
+
 		ret = do_shrink_slab(&sc, shrinker, priority);
 		if (ret == SHRINK_EMPTY)
 			ret = 0;
 		freed += ret;
+
 		/*
-		 * Bail out if someone want to register a new shrinker to
-		 * prevent the registration from being stalled for long periods
-		 * by parallel ongoing shrinking.
+		 * This shrinker may be deleted from shrinker_list and freed
+		 * after the shrinker_put() below, but this shrinker is still
+		 * used for the next traversal. So it is necessary to hold the
+		 * RCU lock first to prevent this shrinker from being freed,
+		 * which also ensures that the next shrinker that is traversed
+		 * will not be freed (even if it is deleted from shrinker_list
+		 * at the same time).
 		 */
-		if (rwsem_is_contended(&shrinker_rwsem)) {
-			freed = freed ? : 1;
-			break;
-		}
+		rcu_read_lock();
+		shrinker_put(shrinker);
 	}
 
-	up_read(&shrinker_rwsem);
-out:
+	rcu_read_unlock();
 	cond_resched();
 	return freed;
 }
@@ -671,13 +681,29 @@ void shrinker_register(struct shrinker *shrinker)
 	}
 
 	down_write(&shrinker_rwsem);
-	list_add_tail(&shrinker->list, &shrinker_list);
+	list_add_tail_rcu(&shrinker->list, &shrinker_list);
 	shrinker->flags |= SHRINKER_REGISTERED;
 	shrinker_debugfs_add(shrinker);
 	up_write(&shrinker_rwsem);
+
+	init_completion(&shrinker->done);
+	/*
+	 * Now the shrinker is fully set up, take the first reference to it to
+	 * indicate that lookup operations are now allowed to use it via
+	 * shrinker_try_get().
+	 */
+	refcount_set(&shrinker->refcount, 1);
 }
 EXPORT_SYMBOL_GPL(shrinker_register);
 
+static void shrinker_free_rcu_cb(struct rcu_head *head)
+{
+	struct shrinker *shrinker = container_of(head, struct shrinker, rcu);
+
+	kfree(shrinker->nr_deferred);
+	kfree(shrinker);
+}
+
 void shrinker_free(struct shrinker *shrinker)
 {
 	struct dentry *debugfs_entry = NULL;
@@ -686,9 +712,18 @@ void shrinker_free(struct shrinker *shrinker)
 	if (!shrinker)
 		return;
 
+	if (shrinker->flags & SHRINKER_REGISTERED) {
+		shrinker_put(shrinker);
+		wait_for_completion(&shrinker->done);
+	}
+
 	down_write(&shrinker_rwsem);
 	if (shrinker->flags & SHRINKER_REGISTERED) {
-		list_del(&shrinker->list);
+		/*
+		 * Lookups on the shrinker are over and will fail in the future,
+		 * so we can now remove it from the lists and free it.
+		 */
+		list_del_rcu(&shrinker->list);
 		debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);
 		shrinker->flags &= ~SHRINKER_REGISTERED;
 	} else {
@@ -702,9 +737,6 @@ void shrinker_free(struct shrinker *shrinker)
 	if (debugfs_entry)
 		shrinker_debugfs_remove(debugfs_entry, debugfs_id);
 
-	kfree(shrinker->nr_deferred);
-	shrinker->nr_deferred = NULL;
-
-	kfree(shrinker);
+	call_rcu(&shrinker->rcu, shrinker_free_rcu_cb);
 }
 EXPORT_SYMBOL_GPL(shrinker_free);
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570902.893436 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBm-00025P-34; Thu, 27 Jul 2023 08:17:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570902.893436; Thu, 27 Jul 2023 08:17:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBl-00023g-3F; Thu, 27 Jul 2023 08:17:37 +0000
Received: by outflank-mailman (input) for mailman id 570902;
 Thu, 27 Jul 2023 08:17:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw5f-0001DS-KL
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:11:19 +0000
Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com
 [2607:f8b0:4864:20::436])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 29ec020c-2c55-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:11:19 +0200 (CEST)
Received: by mail-pf1-x436.google.com with SMTP id
 d2e1a72fcca58-686f74a8992so78040b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:11:19 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.11.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:11:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 29ec020c-2c55-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445477; x=1691050277;
        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=/uDURfJnJhgp6SdQN0dR835bsVpn4QFEXgmrOE/fnW4=;
        b=XMYYvlyXrTmu7TBUMUrS0fAERGM3ULbRWCn4in2BRNinhRwId1ryL35VoKr2h4Rx+U
         HjLlRWIKGbBKN0lkokdfiXe7DL4/cW8JhUixM/OhO46u6zDYby/ZSHvD4zMfuAy6v0wa
         kMUIVYEZOCmoajTRWB9O5pPKf2KXDL1RA9QX/iWGDKdd+7AiEQpaXll5+7XF5hXMtboW
         QGfdfOEZoiLr6B07ra4S8ESol/cU0lfuHqis0vxsY6ajpZNCyt33YYUETwhkXmLJyVVM
         wWI0H3b2jkyty5FrIH3eGt0u2K+zpCq6JQc2FhUeW7es/kOOMNTlHxQiuG1Uqt5RUvfA
         07oA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445477; x=1691050277;
        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=/uDURfJnJhgp6SdQN0dR835bsVpn4QFEXgmrOE/fnW4=;
        b=F/IPUh+LYugWmlMW9u+M8jnegfgyxuv8903p141VoeIGN1F2ke5xmha8DLk9Pgpbud
         69bWMEyE0H2RyT78EsLT28bMfhOAFBnlLTrHTk6/BPseUNhQPFJsB7qnXpaAAZ/P09iJ
         O4lcTEvrbknmcLj1/HwbwkiIKLbIbP+dqp9x52mocmdjyU8qFMy2vOdu9aXQgHSp9Sui
         cKYsKLWu1WJC4TWRK/nhqFemfN0OGoFnetfzq52fPTfXv/kqZEcfBN5UFeeRhTlolXgj
         4zClKPmeYUYHqy7FkWWUlT23oaC8ejV2ANevHjUIM1N2wumsEtMI4rt9btXfctAs5LSv
         EBPg==
X-Gm-Message-State: ABy/qLY6/8YD4uqHjQymnJoiq8oLlNIhpM+5m5mUInuvWN4cEHNR481a
	A0OIInZHZ/1vwngzDmwLmB6bVg==
X-Google-Smtp-Source: APBJJlG87NINI+/+i4SJ1KgSTM1EJ+JwVd/Dy5o7cICQ6coQ1cuBExOC2izM/xbO/Jy48XOYsOKRHA==
X-Received: by 2002:a05:6a00:2b90:b0:67d:308b:97ef with SMTP id dv16-20020a056a002b9000b0067d308b97efmr4590349pfb.2.1690445477689;
        Thu, 27 Jul 2023 01:11:17 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 27/49] dm: dynamically allocate the dm-bufio shrinker
Date: Thu, 27 Jul 2023 16:04:40 +0800
Message-Id: <20230727080502.77895-28-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the dm-bufio shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct dm_bufio_client.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 drivers/md/dm-bufio.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index bc309e41d074..5a9124b83d53 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -963,7 +963,7 @@ struct dm_bufio_client {
 
 	sector_t start;
 
-	struct shrinker shrinker;
+	struct shrinker *shrinker;
 	struct work_struct shrink_work;
 	atomic_long_t need_shrink;
 
@@ -2368,7 +2368,7 @@ static unsigned long dm_bufio_shrink_scan(struct shrinker *shrink, struct shrink
 {
 	struct dm_bufio_client *c;
 
-	c = container_of(shrink, struct dm_bufio_client, shrinker);
+	c = shrink->private_data;
 	atomic_long_add(sc->nr_to_scan, &c->need_shrink);
 	queue_work(dm_bufio_wq, &c->shrink_work);
 
@@ -2377,7 +2377,7 @@ static unsigned long dm_bufio_shrink_scan(struct shrinker *shrink, struct shrink
 
 static unsigned long dm_bufio_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
 {
-	struct dm_bufio_client *c = container_of(shrink, struct dm_bufio_client, shrinker);
+	struct dm_bufio_client *c = shrink->private_data;
 	unsigned long count = cache_total(&c->cache);
 	unsigned long retain_target = get_retain_buffers(c);
 	unsigned long queued_for_cleanup = atomic_long_read(&c->need_shrink);
@@ -2490,15 +2490,19 @@ struct dm_bufio_client *dm_bufio_client_create(struct block_device *bdev, unsign
 	INIT_WORK(&c->shrink_work, shrink_work);
 	atomic_long_set(&c->need_shrink, 0);
 
-	c->shrinker.count_objects = dm_bufio_shrink_count;
-	c->shrinker.scan_objects = dm_bufio_shrink_scan;
-	c->shrinker.seeks = 1;
-	c->shrinker.batch = 0;
-	r = register_shrinker(&c->shrinker, "dm-bufio:(%u:%u)",
-			      MAJOR(bdev->bd_dev), MINOR(bdev->bd_dev));
-	if (r)
+	c->shrinker = shrinker_alloc(0, "dm-bufio:(%u:%u)",
+				     MAJOR(bdev->bd_dev), MINOR(bdev->bd_dev));
+	if (!c->shrinker)
 		goto bad;
 
+	c->shrinker->count_objects = dm_bufio_shrink_count;
+	c->shrinker->scan_objects = dm_bufio_shrink_scan;
+	c->shrinker->seeks = 1;
+	c->shrinker->batch = 0;
+	c->shrinker->private_data = c;
+
+	shrinker_register(c->shrinker);
+
 	mutex_lock(&dm_bufio_clients_lock);
 	dm_bufio_client_count++;
 	list_add(&c->client_list, &dm_bufio_all_clients);
@@ -2537,7 +2541,7 @@ void dm_bufio_client_destroy(struct dm_bufio_client *c)
 
 	drop_buffers(c);
 
-	unregister_shrinker(&c->shrinker);
+	shrinker_free(c->shrinker);
 	flush_work(&c->shrink_work);
 
 	mutex_lock(&dm_bufio_clients_lock);
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570903.893439 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBn-0002al-Vm; Thu, 27 Jul 2023 08:17:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570903.893439; Thu, 27 Jul 2023 08:17:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBn-0002Tt-6H; Thu, 27 Jul 2023 08:17:39 +0000
Received: by outflank-mailman (input) for mailman id 570903;
 Thu, 27 Jul 2023 08:17:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw4h-0001DS-5J
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:10:19 +0000
Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com
 [2607:f8b0:4864:20::42b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 05e7b41e-2c55-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:10:18 +0200 (CEST)
Received: by mail-pf1-x42b.google.com with SMTP id
 d2e1a72fcca58-686f74a8992so77854b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:10:18 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.10.05
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:10:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 05e7b41e-2c55-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445417; x=1691050217;
        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=PYuXWIGRd3SDQUNwBNnDU/RFUGkEJd0z6ud/pRWhp58=;
        b=T9ifvBS7grSXMXHZ+aFeKzum6pF3H2DhLFdohTJRx7vF7szcBG6tJ5VPINqCVu3pCX
         FmubTvt88b5ysMWaYtFibatbXMnoo6Jib8lbo65gbMoj4iY6HbdoFrEeXgYSqYC9Jqe0
         PGHsLAS4RpAPQjTV72r0GtDUpuZ/ybvTZ9EZC90EXosh65ardfAALzeVYgFduHUdYxNh
         uE3GuwKiv2CyHXolQ3XZqpbE7oSyCW4E0iZzkXVJZoTlkXjievgPAGhg1+Kv8s/E0hIi
         dyIaavdNWwWhQNwuCKJwqWG502/DMJOkmwjObTrka2ckcmNrtUCmvsEGY2FZ9fmQFWZZ
         aE4g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445417; x=1691050217;
        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=PYuXWIGRd3SDQUNwBNnDU/RFUGkEJd0z6ud/pRWhp58=;
        b=SnNk0akUpxp1nbMMAXmwZWTgN/6mGHzWn5/W5CmwpFE08Tt/QeAsXhD2BcXLBAXRxO
         5bHvGG+GxlurqIENciAxg3ZSKV+YLO7rKOUMXnLQAOJGDK0SSCVP/rCc+xqT5QTKfigY
         ZIGwGciCHb60tfFoXePfgGo3HBmEosBEeIu8HS9MixGWnNpPgz6FoUT61fsyfI8NNT1k
         lLI0IyvBZxJv6nWWdT+KlqAjO6yrsS+t4VhMyWEDfBR9xB2VZ47naevA4mjyaglYj58i
         JS4lBkvqhRWYg2lsKKjFwEYRHh0bnVcl/gMXqHmy72cvnE2rZy2aMMjksG5FggKZWt9a
         xPOA==
X-Gm-Message-State: ABy/qLaTLgK4rIC3ljmuwQmkaNybempP8GXn1crxXR2l53RnlTo/Ds4W
	fMeUxQ0bD9kp5dUs0P+OwNGLHw==
X-Google-Smtp-Source: APBJJlFP1iLC566NPrkWwKL0iKI9L1P+4s+IlmNKaBmXVe5HE8WAAvDQ5uBELCFt4/l7YPuEeyQdfQ==
X-Received: by 2002:a05:6a21:7882:b0:123:3ec2:360d with SMTP id bf2-20020a056a21788200b001233ec2360dmr5970181pzc.5.1690445417252;
        Thu, 27 Jul 2023 01:10:17 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 22/49] sunrpc: dynamically allocate the sunrpc_cred shrinker
Date: Thu, 27 Jul 2023 16:04:35 +0800
Message-Id: <20230727080502.77895-23-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the sunrpc_cred shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 net/sunrpc/auth.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index 2f16f9d17966..6b898b1be6f5 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -861,11 +861,7 @@ rpcauth_uptodatecred(struct rpc_task *task)
 		test_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) != 0;
 }
 
-static struct shrinker rpc_cred_shrinker = {
-	.count_objects = rpcauth_cache_shrink_count,
-	.scan_objects = rpcauth_cache_shrink_scan,
-	.seeks = DEFAULT_SEEKS,
-};
+static struct shrinker *rpc_cred_shrinker;
 
 int __init rpcauth_init_module(void)
 {
@@ -874,9 +870,16 @@ int __init rpcauth_init_module(void)
 	err = rpc_init_authunix();
 	if (err < 0)
 		goto out1;
-	err = register_shrinker(&rpc_cred_shrinker, "sunrpc_cred");
-	if (err < 0)
+	rpc_cred_shrinker = shrinker_alloc(0, "sunrpc_cred");
+	if (!rpc_cred_shrinker)
 		goto out2;
+
+	rpc_cred_shrinker->count_objects = rpcauth_cache_shrink_count;
+	rpc_cred_shrinker->scan_objects = rpcauth_cache_shrink_scan;
+	rpc_cred_shrinker->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(rpc_cred_shrinker);
+
 	return 0;
 out2:
 	rpc_destroy_authunix();
@@ -887,5 +890,5 @@ int __init rpcauth_init_module(void)
 void rpcauth_remove_module(void)
 {
 	rpc_destroy_authunix();
-	unregister_shrinker(&rpc_cred_shrinker);
+	shrinker_free(rpc_cred_shrinker);
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570904.893452 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBp-0002p6-Pl; Thu, 27 Jul 2023 08:17:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570904.893452; Thu, 27 Jul 2023 08:17:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBo-0002ms-Dp; Thu, 27 Jul 2023 08:17:40 +0000
Received: by outflank-mailman (input) for mailman id 570904;
 Thu, 27 Jul 2023 08:17:36 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw9p-00033O-C4
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:15:37 +0000
Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com
 [2607:f8b0:4864:20::429])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c2de682b-2c55-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:15:35 +0200 (CEST)
Received: by mail-pf1-x429.google.com with SMTP id
 d2e1a72fcca58-686f74a8992so78697b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:15:35 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.15.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:15:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c2de682b-2c55-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445734; x=1691050534;
        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=X5ij/O+E/bk/tTzX9mgxwiCynzBHcXx4EKtI9EsHayo=;
        b=j4pDVeMcXcw7i7IAx1DNlz6iKEYUEIabVz59nN5q7bAhCS1y2gOKuzdzTgG4j/dBwO
         H4HIbZq+pOLjZVM5UGP2bbBpIOa2ebzQlUp84F0j/JFisMPJqEmZ2hJuFivDCiuZb9qk
         P5NgTQLX0gtg3X+vGmP6/3oCCgeQ9FljDUkAtb6pQhQ/VT+3lIzONbNoOLFITLjS+g+5
         Vjj6M2H3z3FRG2iT9u3T7VH/LPW2zOuTNtSoF+jLae0SEMd2/P/I3VxNY7Hl9q3RH2MH
         NSqRY7EFleJMoWuU3X7ly6d0/rJ15DhvMCCJQ4sCCtoszhR0yDF7rbG/n/mEuDtWN3AJ
         wtVg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445734; x=1691050534;
        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=X5ij/O+E/bk/tTzX9mgxwiCynzBHcXx4EKtI9EsHayo=;
        b=XJsoXp/405VqOlPXagSsug/xYETzKSnjjjF23DbFRr3/6+3PiSqky3LLijO9qg8Hwm
         mXpng5TUehk7eI42EzuONlqrchjiXIWKGHvXDk9w93K9PjpsOhG05pwJEHuTRXebnT4O
         kD4NrgVC8+fAwFHgH2GjHGjhyO4Dk5mJvLniJwDqEfR80kQq/vktbzASz8WqersBtub8
         +U4smKBJ211eAiUrd3IWGspaX9wXj1EGrMn7kUXnJhgoyllbYPW91+fIFay/Yi7BlKb6
         HgSp1AJpKEw8mPzbwaFRvyLpvMaZo4MSlGrzHC285/4lzUbNyFlZGkV8qAJ+XsOtzbBe
         kfDg==
X-Gm-Message-State: ABy/qLY/VgciWOKkKngpZZLnxIbBesVU7i0OvL+UU1nZlBqMrTFj7lM3
	Mq69gNL+NdNCrN43lEZ8twkxPA==
X-Google-Smtp-Source: APBJJlGCk2Vrs4jG84R1mGLjwsvlQmrr2Zz0KCmUr/tZ9etimLEYhkynVpF/d5AFiEeYea7/v2C0Wg==
X-Received: by 2002:a05:6a20:7d87:b0:12e:f6e6:882b with SMTP id v7-20020a056a207d8700b0012ef6e6882bmr6451328pzj.1.1690445734330;
        Thu, 27 Jul 2023 01:15:34 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v3 48/49] mm: shrinker: hold write lock to reparent shrinker nr_deferred
Date: Thu, 27 Jul 2023 16:05:01 +0800
Message-Id: <20230727080502.77895-49-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

For now, reparent_shrinker_deferred() is the only holder of read lock of
shrinker_rwsem. And it already holds the global cgroup_mutex, so it will
not be called in parallel.

Therefore, in order to convert shrinker_rwsem to shrinker_mutex later,
here we change to hold the write lock of shrinker_rwsem to reparent.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 mm/shrinker.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/shrinker.c b/mm/shrinker.c
index fee6f62904fb..a12dede5d21f 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -299,7 +299,7 @@ void reparent_shrinker_deferred(struct mem_cgroup *memcg)
 		parent = root_mem_cgroup;
 
 	/* Prevent from concurrent shrinker_info expand */
-	down_read(&shrinker_rwsem);
+	down_write(&shrinker_rwsem);
 	for_each_node(nid) {
 		child_info = shrinker_info_protected(memcg, nid);
 		parent_info = shrinker_info_protected(parent, nid);
@@ -312,7 +312,7 @@ void reparent_shrinker_deferred(struct mem_cgroup *memcg)
 			}
 		}
 	}
-	up_read(&shrinker_rwsem);
+	up_write(&shrinker_rwsem);
 }
 #else
 static int shrinker_memcg_alloc(struct shrinker *shrinker)
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570905.893461 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBs-0003bV-DR; Thu, 27 Jul 2023 08:17:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570905.893461; Thu, 27 Jul 2023 08:17:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBr-0003TT-9A; Thu, 27 Jul 2023 08:17:43 +0000
Received: by outflank-mailman (input) for mailman id 570905;
 Thu, 27 Jul 2023 08:17:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw6F-0001DS-Vu
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:11:55 +0000
Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com
 [2607:f8b0:4864:20::435])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3f88120e-2c55-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:11:55 +0200 (CEST)
Received: by mail-pf1-x435.google.com with SMTP id
 d2e1a72fcca58-686f6231bdeso113528b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:11:55 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.11.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:11:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3f88120e-2c55-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445514; x=1691050314;
        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=v2xQZfHf5bNVsT7uWSGQWuu07PHxrGT3T56hFvtqSrg=;
        b=lyW6JZhnNvjcNaB7GqN1uV2v79yXaXII/N9CUBx8Ax42gYi0bx7SyKZlp7ota5OGyc
         xz3LFUjbyjINutpLynebvvBHzacoCfStfnIiREC/M8s52LB/S8PozvhLHL2LaKHkf4jF
         9DRdteQ8XPpE6p0UjhjwxUS6BE53kxXxgyc4CEqj+ED289GAULMwnheYekYUqCpohGt5
         Gmsuq+KFKYVL89VZVFvc5W/65nqN5yxt+BmUFxBx+3K9aBUApmiSNjlOWSgfmJvwi5CC
         101OAH2cZQROpO/yBfNUpOitoioZFpWL88ogBko0HO5BvQ0gPjZ0smA8q12LAj1M0Z4O
         lOvA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445514; x=1691050314;
        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=v2xQZfHf5bNVsT7uWSGQWuu07PHxrGT3T56hFvtqSrg=;
        b=cQ5SnCCEn3ja/1qqP1DWXtMY+LlFT7LQKqk4zdVGaMlMj8OHGCctiH8ad8t7T7FCdG
         QjKyuDI02GvhwvjDOTe4LhGnykz+HUn3GijdjsSM455klFyOEGkmeYCBHMC7TUnSnNjL
         FSDbZ1/KKQq5v2YnFwt5bQhjwMVvUu0ZS8jjYxN3LpeAZZFukPK2e6yBYSnRNQgOwaes
         qcwcf2OuDcFvZUmA0PF70yZBj0tW5QVb+394+y7GYMQEDS4q/efhQ761d1BJslNwdx5+
         vbIk8OtNsKUgSNA9Ih9IgiuImBXU1o21q9oK6l7NgfzqLpH9+fiG6ruboQ2NCJvNIwgN
         7KUg==
X-Gm-Message-State: ABy/qLZ+ShOtV6fjHbtZ3eD6QDYRXEUVfJVmNDhnvH5lWDHN7LbFrNsp
	0fWGb6wLY9Yd9ORqlyjBhSn5GA==
X-Google-Smtp-Source: APBJJlFvU3cjl1WLZK8F+guGojMG4R1fFJkvV7n2FNowsaFmG5z+7vBu+UKq72H6C7V5uf+meL2LRA==
X-Received: by 2002:a05:6a00:4a0e:b0:677:3439:874a with SMTP id do14-20020a056a004a0e00b006773439874amr5204339pfb.3.1690445513983;
        Thu, 27 Jul 2023 01:11:53 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v3 30/49] bcache: dynamically allocate the md-bcache shrinker
Date: Thu, 27 Jul 2023 16:04:43 +0800
Message-Id: <20230727080502.77895-31-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the md-bcache shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct cache_set.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 drivers/md/bcache/bcache.h |  2 +-
 drivers/md/bcache/btree.c  | 27 ++++++++++++++++-----------
 drivers/md/bcache/sysfs.c  |  3 ++-
 3 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
index 5a79bb3c272f..c622bc50f81b 100644
--- a/drivers/md/bcache/bcache.h
+++ b/drivers/md/bcache/bcache.h
@@ -541,7 +541,7 @@ struct cache_set {
 	struct bio_set		bio_split;
 
 	/* For the btree cache */
-	struct shrinker		shrink;
+	struct shrinker		*shrink;
 
 	/* For the btree cache and anything allocation related */
 	struct mutex		bucket_lock;
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index fd121a61f17c..ae5cbb55861f 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -667,7 +667,7 @@ static int mca_reap(struct btree *b, unsigned int min_order, bool flush)
 static unsigned long bch_mca_scan(struct shrinker *shrink,
 				  struct shrink_control *sc)
 {
-	struct cache_set *c = container_of(shrink, struct cache_set, shrink);
+	struct cache_set *c = shrink->private_data;
 	struct btree *b, *t;
 	unsigned long i, nr = sc->nr_to_scan;
 	unsigned long freed = 0;
@@ -734,7 +734,7 @@ static unsigned long bch_mca_scan(struct shrinker *shrink,
 static unsigned long bch_mca_count(struct shrinker *shrink,
 				   struct shrink_control *sc)
 {
-	struct cache_set *c = container_of(shrink, struct cache_set, shrink);
+	struct cache_set *c = shrink->private_data;
 
 	if (c->shrinker_disabled)
 		return 0;
@@ -752,8 +752,8 @@ void bch_btree_cache_free(struct cache_set *c)
 
 	closure_init_stack(&cl);
 
-	if (c->shrink.list.next)
-		unregister_shrinker(&c->shrink);
+	if (c->shrink)
+		shrinker_free(c->shrink);
 
 	mutex_lock(&c->bucket_lock);
 
@@ -828,14 +828,19 @@ int bch_btree_cache_alloc(struct cache_set *c)
 		c->verify_data = NULL;
 #endif
 
-	c->shrink.count_objects = bch_mca_count;
-	c->shrink.scan_objects = bch_mca_scan;
-	c->shrink.seeks = 4;
-	c->shrink.batch = c->btree_pages * 2;
+	c->shrink = shrinker_alloc(0, "md-bcache:%pU", c->set_uuid);
+	if (!c->shrink) {
+		pr_warn("bcache: %s: could not allocate shrinker\n", __func__);
+		return 0;
+	}
+
+	c->shrink->count_objects = bch_mca_count;
+	c->shrink->scan_objects = bch_mca_scan;
+	c->shrink->seeks = 4;
+	c->shrink->batch = c->btree_pages * 2;
+	c->shrink->private_data = c;
 
-	if (register_shrinker(&c->shrink, "md-bcache:%pU", c->set_uuid))
-		pr_warn("bcache: %s: could not register shrinker\n",
-				__func__);
+	shrinker_register(c->shrink);
 
 	return 0;
 }
diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
index 0e2c1880f60b..45d8af755de6 100644
--- a/drivers/md/bcache/sysfs.c
+++ b/drivers/md/bcache/sysfs.c
@@ -866,7 +866,8 @@ STORE(__bch_cache_set)
 
 		sc.gfp_mask = GFP_KERNEL;
 		sc.nr_to_scan = strtoul_or_return(buf);
-		c->shrink.scan_objects(&c->shrink, &sc);
+		if (c->shrink)
+			c->shrink->scan_objects(c->shrink, &sc);
 	}
 
 	sysfs_strtoul_clamp(congested_read_threshold_us,
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570906.893471 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBu-00045L-75; Thu, 27 Jul 2023 08:17:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570906.893471; Thu, 27 Jul 2023 08:17:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBt-0003wj-0e; Thu, 27 Jul 2023 08:17:45 +0000
Received: by outflank-mailman (input) for mailman id 570906;
 Thu, 27 Jul 2023 08:17:41 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw9G-00033O-Mj
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:15:02 +0000
Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com
 [2607:f8b0:4864:20::430])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ad9d58d4-2c55-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:15:00 +0200 (CEST)
Received: by mail-pf1-x430.google.com with SMTP id
 d2e1a72fcca58-6862d4a1376so189965b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:15:00 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.14.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:14:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ad9d58d4-2c55-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445698; x=1691050498;
        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=hyLc13iHrkV+klh05yD71xFAgQY4jD2CPzn+LZNOh3k=;
        b=j/RnjlDR/6PJZ/VyI7X0aptMT1iXf8RcI3J7hjmtLDlbxdSOVetAiPedXKNsMAsgMH
         vW2t4XX80i81CSKm1+58CCJFBxWJpCYufXIihrr1Qh0iO58Dre4wc/nYIv2x1kkcDjep
         Q77tkS1cKyF/pOEivdyfGUKn80RYpS5tTRhJav3vzv1noykGmdY/2w8uvsgxbLtx6BmO
         OFB/9kEDCl8hjuP0RIabQrnt0SteIjjBa9je+XXYyBGZ78X0iI751Sfa8HKvZa7gdAPd
         T87WUXRoY50jn0E4HH6vQWiTU2dwGY69uu92bxpk78xQ0HZ4QCB+dWaTfpG84kK4Opxe
         wgjg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445698; x=1691050498;
        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=hyLc13iHrkV+klh05yD71xFAgQY4jD2CPzn+LZNOh3k=;
        b=NrV11H+JvBTZLVxWTk0EW+FsO4CcAJiWRnxB3m6mI52iWVt5pTLj2ZJFBe49QfPVAd
         ZRa3HFg9K6Jf5KqK88fCOGxiZnDRqXwp4zgVu30fmSRg9w3j8c1nRyG5dALrJ+lHKhfp
         sPkY6AYpuFl/3DHqyJ6AWL8TLG3a9VCaVOnPNmmRgkwKWaciDJ3TmzsfZkXjDF7uGz2n
         3w1A82k4/R5X2Ncg8ExeLzX0l/eUHhXp93BPHT2pRuJAwUvMklg133sXoIe9zDl5Hl7F
         mDjfaATtImwpMfIPFDJkPIWRMzAvpXVZaW6Uat6X6pN+wKlF2rtlNCfn0g/mO3iKQQTU
         S0lQ==
X-Gm-Message-State: ABy/qLZg0Sr8XlGZD8MeZx4zS6aHH5oyuN1a9iWuNkLy/vHtsei8rVcp
	Q1BPKkzmqySl8rj13+9g3uo2gw==
X-Google-Smtp-Source: APBJJlHHYMtR97FgZwPKg/I4FvBtMIi/WenRh8r+QxTKT4uZnBzRavnMRN782PTiMjlEUg18pWA/Fw==
X-Received: by 2002:a05:6a20:8f23:b0:137:8ddf:4647 with SMTP id b35-20020a056a208f2300b001378ddf4647mr5934103pzk.2.1690445698478;
        Thu, 27 Jul 2023 01:14:58 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 45/49] mm: shrinker: add a secondary array for shrinker_info::{map, nr_deferred}
Date: Thu, 27 Jul 2023 16:04:58 +0800
Message-Id: <20230727080502.77895-46-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Currently, we maintain two linear arrays per node per memcg, which are
shrinker_info::map and shrinker_info::nr_deferred. And we need to resize
them when the shrinker_nr_max is exceeded, that is, allocate a new array,
and then copy the old array to the new array, and finally free the old
array by RCU.

For shrinker_info::map, we do set_bit() under the RCU lock, so we may set
the value into the old map which is about to be freed. This may cause the
value set to be lost. The current solution is not to copy the old map when
resizing, but to set all the corresponding bits in the new map to 1. This
solves the data loss problem, but bring the overhead of more pointless
loops while doing memcg slab shrink.

For shrinker_info::nr_deferred, we will only modify it under the read lock
of shrinker_rwsem, so it will not run concurrently with the resizing. But
after we make memcg slab shrink lockless, there will be the same data loss
problem as shrinker_info::map, and we can't work around it like the map.

For such resizable arrays, the most straightforward idea is to change it
to xarray, like we did for list_lru [1]. We need to do xa_store() in the
list_lru_add()-->set_shrinker_bit(), but this will cause memory
allocation, and the list_lru_add() doesn't accept failure. A possible
solution is to pre-allocate, but the location of pre-allocation is not
well determined.

Therefore, this commit chooses to introduce a secondary array for
shrinker_info::{map, nr_deferred}, so that we only need to copy this
secondary array every time the size is resized. Then even if we get the
old secondary array under the RCU lock, the found map and nr_deferred are
also true, so no data is lost.

[1]. https://lore.kernel.org/all/20220228122126.37293-13-songmuchun@bytedance.com/

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 include/linux/memcontrol.h |  12 +-
 include/linux/shrinker.h   |  17 +++
 mm/shrinker.c              | 250 +++++++++++++++++++++++--------------
 3 files changed, 172 insertions(+), 107 deletions(-)

diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index e765d1ff9cbb..2c9327d27c3b 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -21,6 +21,7 @@
 #include <linux/vmstat.h>
 #include <linux/writeback.h>
 #include <linux/page-flags.h>
+#include <linux/shrinker.h>
 
 struct mem_cgroup;
 struct obj_cgroup;
@@ -88,17 +89,6 @@ struct mem_cgroup_reclaim_iter {
 	unsigned int generation;
 };
 
-/*
- * Bitmap and deferred work of shrinker::id corresponding to memcg-aware
- * shrinkers, which have elements charged to this memcg.
- */
-struct shrinker_info {
-	struct rcu_head rcu;
-	atomic_long_t *nr_deferred;
-	unsigned long *map;
-	int map_nr_max;
-};
-
 struct lruvec_stats_percpu {
 	/* Local (CPU and cgroup) state */
 	long state[NR_VM_NODE_STAT_ITEMS];
diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
index 025c8070dd86..eb342994675a 100644
--- a/include/linux/shrinker.h
+++ b/include/linux/shrinker.h
@@ -5,6 +5,23 @@
 #include <linux/atomic.h>
 #include <linux/types.h>
 
+#define SHRINKER_UNIT_BITS	BITS_PER_LONG
+
+/*
+ * Bitmap and deferred work of shrinker::id corresponding to memcg-aware
+ * shrinkers, which have elements charged to the memcg.
+ */
+struct shrinker_info_unit {
+	atomic_long_t nr_deferred[SHRINKER_UNIT_BITS];
+	DECLARE_BITMAP(map, SHRINKER_UNIT_BITS);
+};
+
+struct shrinker_info {
+	struct rcu_head rcu;
+	int map_nr_max;
+	struct shrinker_info_unit *unit[];
+};
+
 /*
  * This struct is used to pass information from page reclaim to the shrinkers.
  * We consolidate the values for easier extension later.
diff --git a/mm/shrinker.c b/mm/shrinker.c
index a27779ed3798..1911c06b8af5 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -12,15 +12,50 @@ DECLARE_RWSEM(shrinker_rwsem);
 #ifdef CONFIG_MEMCG
 static int shrinker_nr_max;
 
-/* The shrinker_info is expanded in a batch of BITS_PER_LONG */
-static inline int shrinker_map_size(int nr_items)
+static inline int shrinker_unit_size(int nr_items)
 {
-	return (DIV_ROUND_UP(nr_items, BITS_PER_LONG) * sizeof(unsigned long));
+	return (DIV_ROUND_UP(nr_items, SHRINKER_UNIT_BITS) * sizeof(struct shrinker_info_unit *));
 }
 
-static inline int shrinker_defer_size(int nr_items)
+static inline void shrinker_unit_free(struct shrinker_info *info, int start)
 {
-	return (round_up(nr_items, BITS_PER_LONG) * sizeof(atomic_long_t));
+	struct shrinker_info_unit **unit;
+	int nr, i;
+
+	if (!info)
+		return;
+
+	unit = info->unit;
+	nr = DIV_ROUND_UP(info->map_nr_max, SHRINKER_UNIT_BITS);
+
+	for (i = start; i < nr; i++) {
+		if (!unit[i])
+			break;
+
+		kvfree(unit[i]);
+		unit[i] = NULL;
+	}
+}
+
+static inline int shrinker_unit_alloc(struct shrinker_info *new,
+				       struct shrinker_info *old, int nid)
+{
+	struct shrinker_info_unit *unit;
+	int nr = DIV_ROUND_UP(new->map_nr_max, SHRINKER_UNIT_BITS);
+	int start = old ? DIV_ROUND_UP(old->map_nr_max, SHRINKER_UNIT_BITS) : 0;
+	int i;
+
+	for (i = start; i < nr; i++) {
+		unit = kvzalloc_node(sizeof(*unit), GFP_KERNEL, nid);
+		if (!unit) {
+			shrinker_unit_free(new, start);
+			return -ENOMEM;
+		}
+
+		new->unit[i] = unit;
+	}
+
+	return 0;
 }
 
 void free_shrinker_info(struct mem_cgroup *memcg)
@@ -32,6 +67,7 @@ void free_shrinker_info(struct mem_cgroup *memcg)
 	for_each_node(nid) {
 		pn = memcg->nodeinfo[nid];
 		info = rcu_dereference_protected(pn->shrinker_info, true);
+		shrinker_unit_free(info, 0);
 		kvfree(info);
 		rcu_assign_pointer(pn->shrinker_info, NULL);
 	}
@@ -40,28 +76,27 @@ void free_shrinker_info(struct mem_cgroup *memcg)
 int alloc_shrinker_info(struct mem_cgroup *memcg)
 {
 	struct shrinker_info *info;
-	int nid, size, ret = 0;
-	int map_size, defer_size = 0;
+	int nid, ret = 0;
+	int array_size = 0;
 
 	down_write(&shrinker_rwsem);
-	map_size = shrinker_map_size(shrinker_nr_max);
-	defer_size = shrinker_defer_size(shrinker_nr_max);
-	size = map_size + defer_size;
+	array_size = shrinker_unit_size(shrinker_nr_max);
 	for_each_node(nid) {
-		info = kvzalloc_node(sizeof(*info) + size, GFP_KERNEL, nid);
-		if (!info) {
-			free_shrinker_info(memcg);
-			ret = -ENOMEM;
-			break;
-		}
-		info->nr_deferred = (atomic_long_t *)(info + 1);
-		info->map = (void *)info->nr_deferred + defer_size;
+		info = kvzalloc_node(sizeof(*info) + array_size, GFP_KERNEL, nid);
+		if (!info)
+			goto err;
 		info->map_nr_max = shrinker_nr_max;
+		if (shrinker_unit_alloc(info, NULL, nid))
+			goto err;
 		rcu_assign_pointer(memcg->nodeinfo[nid]->shrinker_info, info);
 	}
 	up_write(&shrinker_rwsem);
 
 	return ret;
+
+err:
+	free_shrinker_info(memcg);
+	return -ENOMEM;
 }
 
 static struct shrinker_info *shrinker_info_protected(struct mem_cgroup *memcg,
@@ -71,15 +106,12 @@ static struct shrinker_info *shrinker_info_protected(struct mem_cgroup *memcg,
 					 lockdep_is_held(&shrinker_rwsem));
 }
 
-static int expand_one_shrinker_info(struct mem_cgroup *memcg,
-				    int map_size, int defer_size,
-				    int old_map_size, int old_defer_size,
-				    int new_nr_max)
+static int expand_one_shrinker_info(struct mem_cgroup *memcg, int new_size,
+				    int old_size, int new_nr_max)
 {
 	struct shrinker_info *new, *old;
 	struct mem_cgroup_per_node *pn;
 	int nid;
-	int size = map_size + defer_size;
 
 	for_each_node(nid) {
 		pn = memcg->nodeinfo[nid];
@@ -92,21 +124,18 @@ static int expand_one_shrinker_info(struct mem_cgroup *memcg,
 		if (new_nr_max <= old->map_nr_max)
 			continue;
 
-		new = kvmalloc_node(sizeof(*new) + size, GFP_KERNEL, nid);
+		new = kvmalloc_node(sizeof(*new) + new_size, GFP_KERNEL, nid);
 		if (!new)
 			return -ENOMEM;
 
-		new->nr_deferred = (atomic_long_t *)(new + 1);
-		new->map = (void *)new->nr_deferred + defer_size;
 		new->map_nr_max = new_nr_max;
 
-		/* map: set all old bits, clear all new bits */
-		memset(new->map, (int)0xff, old_map_size);
-		memset((void *)new->map + old_map_size, 0, map_size - old_map_size);
-		/* nr_deferred: copy old values, clear all new values */
-		memcpy(new->nr_deferred, old->nr_deferred, old_defer_size);
-		memset((void *)new->nr_deferred + old_defer_size, 0,
-		       defer_size - old_defer_size);
+		/* copy old values, allocate all new values */
+		memcpy(new->unit, old->unit, old_size);
+		if (shrinker_unit_alloc(new, old, nid)) {
+			kvfree(new);
+			return -ENOMEM;
+		}
 
 		rcu_assign_pointer(pn->shrinker_info, new);
 		kvfree_rcu(old, rcu);
@@ -118,9 +147,8 @@ static int expand_one_shrinker_info(struct mem_cgroup *memcg,
 static int expand_shrinker_info(int new_id)
 {
 	int ret = 0;
-	int new_nr_max = round_up(new_id + 1, BITS_PER_LONG);
-	int map_size, defer_size = 0;
-	int old_map_size, old_defer_size = 0;
+	int new_nr_max = round_up(new_id + 1, SHRINKER_UNIT_BITS);
+	int new_size, old_size = 0;
 	struct mem_cgroup *memcg;
 
 	if (!root_mem_cgroup)
@@ -128,15 +156,12 @@ static int expand_shrinker_info(int new_id)
 
 	lockdep_assert_held(&shrinker_rwsem);
 
-	map_size = shrinker_map_size(new_nr_max);
-	defer_size = shrinker_defer_size(new_nr_max);
-	old_map_size = shrinker_map_size(shrinker_nr_max);
-	old_defer_size = shrinker_defer_size(shrinker_nr_max);
+	new_size = shrinker_unit_size(new_nr_max);
+	old_size = shrinker_unit_size(shrinker_nr_max);
 
 	memcg = mem_cgroup_iter(NULL, NULL, NULL);
 	do {
-		ret = expand_one_shrinker_info(memcg, map_size, defer_size,
-					       old_map_size, old_defer_size,
+		ret = expand_one_shrinker_info(memcg, new_size, old_size,
 					       new_nr_max);
 		if (ret) {
 			mem_cgroup_iter_break(NULL, memcg);
@@ -150,17 +175,34 @@ static int expand_shrinker_info(int new_id)
 	return ret;
 }
 
+static inline int shriner_id_to_index(int shrinker_id)
+{
+	return shrinker_id / SHRINKER_UNIT_BITS;
+}
+
+static inline int shriner_id_to_offset(int shrinker_id)
+{
+	return shrinker_id % SHRINKER_UNIT_BITS;
+}
+
+static inline int calc_shrinker_id(int index, int offset)
+{
+	return index * SHRINKER_UNIT_BITS + offset;
+}
+
 void set_shrinker_bit(struct mem_cgroup *memcg, int nid, int shrinker_id)
 {
 	if (shrinker_id >= 0 && memcg && !mem_cgroup_is_root(memcg)) {
 		struct shrinker_info *info;
+		struct shrinker_info_unit *unit;
 
 		rcu_read_lock();
 		info = rcu_dereference(memcg->nodeinfo[nid]->shrinker_info);
+		unit = info->unit[shriner_id_to_index(shrinker_id)];
 		if (!WARN_ON_ONCE(shrinker_id >= info->map_nr_max)) {
 			/* Pairs with smp mb in shrink_slab() */
 			smp_mb__before_atomic();
-			set_bit(shrinker_id, info->map);
+			set_bit(shriner_id_to_offset(shrinker_id), unit->map);
 		}
 		rcu_read_unlock();
 	}
@@ -209,26 +251,31 @@ static long xchg_nr_deferred_memcg(int nid, struct shrinker *shrinker,
 				   struct mem_cgroup *memcg)
 {
 	struct shrinker_info *info;
+	struct shrinker_info_unit *unit;
 
 	info = shrinker_info_protected(memcg, nid);
-	return atomic_long_xchg(&info->nr_deferred[shrinker->id], 0);
+	unit = info->unit[shriner_id_to_index(shrinker->id)];
+	return atomic_long_xchg(&unit->nr_deferred[shriner_id_to_offset(shrinker->id)], 0);
 }
 
 static long add_nr_deferred_memcg(long nr, int nid, struct shrinker *shrinker,
 				  struct mem_cgroup *memcg)
 {
 	struct shrinker_info *info;
+	struct shrinker_info_unit *unit;
 
 	info = shrinker_info_protected(memcg, nid);
-	return atomic_long_add_return(nr, &info->nr_deferred[shrinker->id]);
+	unit = info->unit[shriner_id_to_index(shrinker->id)];
+	return atomic_long_add_return(nr, &unit->nr_deferred[shriner_id_to_offset(shrinker->id)]);
 }
 
 void reparent_shrinker_deferred(struct mem_cgroup *memcg)
 {
-	int i, nid;
+	int nid, index, offset;
 	long nr;
 	struct mem_cgroup *parent;
 	struct shrinker_info *child_info, *parent_info;
+	struct shrinker_info_unit *child_unit, *parent_unit;
 
 	parent = parent_mem_cgroup(memcg);
 	if (!parent)
@@ -239,9 +286,13 @@ void reparent_shrinker_deferred(struct mem_cgroup *memcg)
 	for_each_node(nid) {
 		child_info = shrinker_info_protected(memcg, nid);
 		parent_info = shrinker_info_protected(parent, nid);
-		for (i = 0; i < child_info->map_nr_max; i++) {
-			nr = atomic_long_read(&child_info->nr_deferred[i]);
-			atomic_long_add(nr, &parent_info->nr_deferred[i]);
+		for (index = 0; index < shriner_id_to_index(child_info->map_nr_max); index++) {
+			child_unit = child_info->unit[index];
+			parent_unit = parent_info->unit[index];
+			for (offset = 0; offset < SHRINKER_UNIT_BITS; offset++) {
+				nr = atomic_long_read(&child_unit->nr_deferred[offset]);
+				atomic_long_add(nr, &parent_unit->nr_deferred[offset]);
+			}
 		}
 	}
 	up_read(&shrinker_rwsem);
@@ -407,7 +458,7 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
 {
 	struct shrinker_info *info;
 	unsigned long ret, freed = 0;
-	int i;
+	int offset, index = 0;
 
 	if (!mem_cgroup_online(memcg))
 		return 0;
@@ -419,56 +470,63 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
 	if (unlikely(!info))
 		goto unlock;
 
-	for_each_set_bit(i, info->map, info->map_nr_max) {
-		struct shrink_control sc = {
-			.gfp_mask = gfp_mask,
-			.nid = nid,
-			.memcg = memcg,
-		};
-		struct shrinker *shrinker;
+	for (; index < shriner_id_to_index(info->map_nr_max); index++) {
+		struct shrinker_info_unit *unit;
 
-		shrinker = idr_find(&shrinker_idr, i);
-		if (unlikely(!shrinker || !(shrinker->flags & SHRINKER_REGISTERED))) {
-			if (!shrinker)
-				clear_bit(i, info->map);
-			continue;
-		}
+		unit = info->unit[index];
 
-		/* Call non-slab shrinkers even though kmem is disabled */
-		if (!memcg_kmem_online() &&
-		    !(shrinker->flags & SHRINKER_NONSLAB))
-			continue;
+		for_each_set_bit(offset, unit->map, SHRINKER_UNIT_BITS) {
+			struct shrink_control sc = {
+				.gfp_mask = gfp_mask,
+				.nid = nid,
+				.memcg = memcg,
+			};
+			struct shrinker *shrinker;
+			int shrinker_id = calc_shrinker_id(index, offset);
 
-		ret = do_shrink_slab(&sc, shrinker, priority);
-		if (ret == SHRINK_EMPTY) {
-			clear_bit(i, info->map);
-			/*
-			 * After the shrinker reported that it had no objects to
-			 * free, but before we cleared the corresponding bit in
-			 * the memcg shrinker map, a new object might have been
-			 * added. To make sure, we have the bit set in this
-			 * case, we invoke the shrinker one more time and reset
-			 * the bit if it reports that it is not empty anymore.
-			 * The memory barrier here pairs with the barrier in
-			 * set_shrinker_bit():
-			 *
-			 * list_lru_add()     shrink_slab_memcg()
-			 *   list_add_tail()    clear_bit()
-			 *   <MB>               <MB>
-			 *   set_bit()          do_shrink_slab()
-			 */
-			smp_mb__after_atomic();
-			ret = do_shrink_slab(&sc, shrinker, priority);
-			if (ret == SHRINK_EMPTY)
-				ret = 0;
-			else
-				set_shrinker_bit(memcg, nid, i);
-		}
-		freed += ret;
+			shrinker = idr_find(&shrinker_idr, shrinker_id);
+			if (unlikely(!shrinker || !(shrinker->flags & SHRINKER_REGISTERED))) {
+				if (!shrinker)
+					clear_bit(offset, unit->map);
+				continue;
+			}
 
-		if (rwsem_is_contended(&shrinker_rwsem)) {
-			freed = freed ? : 1;
-			break;
+			/* Call non-slab shrinkers even though kmem is disabled */
+			if (!memcg_kmem_online() &&
+			    !(shrinker->flags & SHRINKER_NONSLAB))
+				continue;
+
+			ret = do_shrink_slab(&sc, shrinker, priority);
+			if (ret == SHRINK_EMPTY) {
+				clear_bit(offset, unit->map);
+				/*
+				 * After the shrinker reported that it had no objects to
+				 * free, but before we cleared the corresponding bit in
+				 * the memcg shrinker map, a new object might have been
+				 * added. To make sure, we have the bit set in this
+				 * case, we invoke the shrinker one more time and reset
+				 * the bit if it reports that it is not empty anymore.
+				 * The memory barrier here pairs with the barrier in
+				 * set_shrinker_bit():
+				 *
+				 * list_lru_add()     shrink_slab_memcg()
+				 *   list_add_tail()    clear_bit()
+				 *   <MB>               <MB>
+				 *   set_bit()          do_shrink_slab()
+				 */
+				smp_mb__after_atomic();
+				ret = do_shrink_slab(&sc, shrinker, priority);
+				if (ret == SHRINK_EMPTY)
+					ret = 0;
+				else
+					set_shrinker_bit(memcg, nid, shrinker_id);
+			}
+			freed += ret;
+
+			if (rwsem_is_contended(&shrinker_rwsem)) {
+				freed = freed ? : 1;
+				goto unlock;
+			}
 		}
 	}
 unlock:
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570907.893484 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBx-0004vr-6q; Thu, 27 Jul 2023 08:17:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570907.893484; Thu, 27 Jul 2023 08:17:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBv-0004pS-Uq; Thu, 27 Jul 2023 08:17:47 +0000
Received: by outflank-mailman (input) for mailman id 570907;
 Thu, 27 Jul 2023 08:17:43 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw93-00033O-HB
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:14:49 +0000
Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com
 [2607:f8b0:4864:20::435])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a6506140-2c55-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:14:47 +0200 (CEST)
Received: by mail-pf1-x435.google.com with SMTP id
 d2e1a72fcca58-682eef7d752so205079b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:14:47 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.14.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:14:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a6506140-2c55-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445686; x=1691050486;
        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=dp1PQp+5gTkm4DG/kxrQVAZ0rB7KyI/rGW6TiEnUaUw=;
        b=MqP96Bm9fq0jb+xCLhNx3qXYFKB4F/mSOAZlWu4Jm1FlamJjkRz7LK2fKulsbN+LSn
         l0VYmbaw65P+tcDvLp0k7E9haUqgvwJAWE6OpcHuKyrg08ULwJDb+WP/772xDJT911c7
         7zPxywkNsS4PFeXucHGoe87Ta2cj9HmvnL8UOM3A93e62EY5SL9atdoN3JsX9JTRnBw0
         N6tNSQutP8zPFknN6y/kLRagvKGA92ju9GvGVVfPXxOrB71gJD9FTKmQ9dcanmCJl0Mj
         XtJnZ+1w8I86OoTRE6esFmZWRayBNnTg+LYaUjuJMZuWhMZx1Zg8pNqMQLhwRUKqGlU2
         KUKQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445686; x=1691050486;
        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=dp1PQp+5gTkm4DG/kxrQVAZ0rB7KyI/rGW6TiEnUaUw=;
        b=VEJTOlEJWjQ0AO0nqO8OrFVWuy7cf22T+o686Z+IAy98OR7IHJZdolCu42wZJBynSP
         JVrbhWq7nUkT6IOwMDMYIEIW4ilcKRhih+rJ19ZSHjtud5SsEfPZKCGyNCjnjbTWd7V0
         Td4TJBWR2CFqkbpHQiFSS0Oqg+x5hv1bw+BehGANwI7P1FWscP1rjA9EEr5x/hjtUfbu
         OJGfGSZ3DQ/sLZXqGgzdfD2Gm3wib5yq3BzuA+015Y/tzyWQF16SXaJ4W7UBrWAIKY1x
         KkXF4F7BFwGh7qssS7tRFGmvSelIhSspf8N524K7wzp1QoJ4txUKlH62Er0f1cfv7+tR
         yLRA==
X-Gm-Message-State: ABy/qLYensfhvpPSXq3b+Rw/V8ahKY4xop6kZfgT4lF4APnTaOzNzgzC
	nD5qc7YOH9BXvFGfbzbgomDXyQ==
X-Google-Smtp-Source: APBJJlEKqhcD6VVO3jjfSZcBy2+bKwiVuLncssOJVtvwGRfgIG5yeQydG6zmLtiTondHAX8WGQ4FoA==
X-Received: by 2002:a05:6a20:841d:b0:133:7a67:b477 with SMTP id c29-20020a056a20841d00b001337a67b477mr6364506pzd.1.1690445686337;
        Thu, 27 Jul 2023 01:14:46 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 44/49] drm/ttm: introduce pool_shrink_rwsem
Date: Thu, 27 Jul 2023 16:04:57 +0800
Message-Id: <20230727080502.77895-45-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Currently, the synchronize_shrinkers() is only used by TTM pool. It only
requires that no shrinkers run in parallel.

After we use RCU+refcount method to implement the lockless slab shrink,
we can not use shrinker_rwsem or synchronize_rcu() to guarantee that all
shrinker invocations have seen an update before freeing memory.

So we introduce a new pool_shrink_rwsem to implement a private
synchronize_shrinkers(), so as to achieve the same purpose.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 drivers/gpu/drm/ttm/ttm_pool.c | 15 +++++++++++++++
 include/linux/shrinker.h       |  2 --
 mm/shrinker.c                  | 15 ---------------
 3 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
index c9c9618c0dce..38b4c280725c 100644
--- a/drivers/gpu/drm/ttm/ttm_pool.c
+++ b/drivers/gpu/drm/ttm/ttm_pool.c
@@ -74,6 +74,7 @@ static struct ttm_pool_type global_dma32_uncached[MAX_ORDER + 1];
 static spinlock_t shrinker_lock;
 static struct list_head shrinker_list;
 static struct shrinker *mm_shrinker;
+static DECLARE_RWSEM(pool_shrink_rwsem);
 
 /* Allocate pages of size 1 << order with the given gfp_flags */
 static struct page *ttm_pool_alloc_page(struct ttm_pool *pool, gfp_t gfp_flags,
@@ -317,6 +318,7 @@ static unsigned int ttm_pool_shrink(void)
 	unsigned int num_pages;
 	struct page *p;
 
+	down_read(&pool_shrink_rwsem);
 	spin_lock(&shrinker_lock);
 	pt = list_first_entry(&shrinker_list, typeof(*pt), shrinker_list);
 	list_move_tail(&pt->shrinker_list, &shrinker_list);
@@ -329,6 +331,7 @@ static unsigned int ttm_pool_shrink(void)
 	} else {
 		num_pages = 0;
 	}
+	up_read(&pool_shrink_rwsem);
 
 	return num_pages;
 }
@@ -572,6 +575,18 @@ void ttm_pool_init(struct ttm_pool *pool, struct device *dev,
 }
 EXPORT_SYMBOL(ttm_pool_init);
 
+/**
+ * synchronize_shrinkers - Wait for all running shrinkers to complete.
+ *
+ * This is useful to guarantee that all shrinker invocations have seen an
+ * update, before freeing memory, similar to rcu.
+ */
+static void synchronize_shrinkers(void)
+{
+	down_write(&pool_shrink_rwsem);
+	up_write(&pool_shrink_rwsem);
+}
+
 /**
  * ttm_pool_fini - Cleanup a pool
  *
diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
index c55c07c3f0cb..025c8070dd86 100644
--- a/include/linux/shrinker.h
+++ b/include/linux/shrinker.h
@@ -103,8 +103,6 @@ struct shrinker *shrinker_alloc(unsigned int flags, const char *fmt, ...);
 void shrinker_register(struct shrinker *shrinker);
 void shrinker_free(struct shrinker *shrinker);
 
-extern void synchronize_shrinkers(void);
-
 #ifdef CONFIG_SHRINKER_DEBUG
 extern int __printf(2, 3) shrinker_debugfs_rename(struct shrinker *shrinker,
 						  const char *fmt, ...);
diff --git a/mm/shrinker.c b/mm/shrinker.c
index 3ab301ff122d..a27779ed3798 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -650,18 +650,3 @@ void shrinker_free(struct shrinker *shrinker)
 	kfree(shrinker);
 }
 EXPORT_SYMBOL_GPL(shrinker_free);
-
-/**
- * synchronize_shrinkers - Wait for all running shrinkers to complete.
- *
- * This is equivalent to calling unregister_shrink() and register_shrinker(),
- * but atomically and with less overhead. This is useful to guarantee that all
- * shrinker invocations have seen an update, before freeing memory, similar to
- * rcu.
- */
-void synchronize_shrinkers(void)
-{
-	down_write(&shrinker_rwsem);
-	up_write(&shrinker_rwsem);
-}
-EXPORT_SYMBOL(synchronize_shrinkers);
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570911.893491 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBy-00056q-9X; Thu, 27 Jul 2023 08:17:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570911.893491; Thu, 27 Jul 2023 08:17:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBw-00053I-Up; Thu, 27 Jul 2023 08:17:48 +0000
Received: by outflank-mailman (input) for mailman id 570911;
 Thu, 27 Jul 2023 08:17:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw3W-0001DS-OQ
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:09:06 +0000
Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com
 [2607:f8b0:4864:20::436])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id daad8221-2c54-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:09:06 +0200 (CEST)
Received: by mail-pf1-x436.google.com with SMTP id
 d2e1a72fcca58-682ae5d4184so170865b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:09:06 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.08.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:09:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: daad8221-2c54-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445345; x=1691050145;
        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=XxxR7cKF9GXj8MC2HKPXqv6o5/ypcgPst5/afOqmqdU=;
        b=f78FOiI4CNId+Ml2PzU7mY1IxHereBLlHPf7s7X8Gy+u8ge3z2zcNtZJbXgkJ1G/QR
         Bypsj3Qfs4NqFk8L9OHPUra+lfok5RS+DDluwPHI9kxnAJLSgVKbtyU1LC00kLM6jzmr
         VkgjJJoznrUMJZqGeb8qVz0Juy94c4XL4Hr58JZjfVBDwwW2089Gloj9mnDr01+e3vie
         ATN8u6YkhMkKc+i92NbP56LSIJl/sZe4eRd/+9U9Zz62iXDekK8cKEfr5HTH0aUYxIkr
         BT13YNvigorKsMJZpm5Ugf1VrzOLWJZerOzcVEByhulhpkn1iKJBA5Dz0oLwz2cUXQdL
         iC6Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445345; x=1691050145;
        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=XxxR7cKF9GXj8MC2HKPXqv6o5/ypcgPst5/afOqmqdU=;
        b=ZqWGaJ7ZJO8HJDnSUkn1nVtorDYYt/Mt2v0eu9BIBHbGnH7hVgu9i+eBjPupZA52nW
         hUxHD9HclXjcAyuJRiDRZfoYIkey3e5/m5ULp//PQY+nBnCc3TImOFBiKWJGO/a0ovnJ
         bOYbuxO71upTeyN906zOy/yPvMHBngaecRRhgVI5TanFOaM+jQe4NsgTuCIl/FEjFIBC
         WtOSKGJ0NfESfpe1PvQBrWXN7BAvKbF6+zAJUvpgVgvPAlEUqp0nJQIggRoe2BIzcDVR
         60lAPxqredmYr0+5iEzAyaYhqAhnBQiHua3kdbglfUOiz2czP3rRbrzvKoecZMhSkYsh
         AUtA==
X-Gm-Message-State: ABy/qLaRH6e0VZddnGgjvwfd7c6pPPGtAAyQSRObX7fK58YraIPQtJYi
	9rkNnaxb5+okiPMOrzkeTz1Jiw==
X-Google-Smtp-Source: APBJJlFoKDsbKkERIQGnm+LFaFeLpxhRzI1EaDrRxfTAKZLr632PKwn78Yey2tH1KRLEMSWua5HIxg==
X-Received: by 2002:a05:6a00:4a10:b0:686:b990:560f with SMTP id do16-20020a056a004a1000b00686b990560fmr4379620pfb.2.1690445344746;
        Thu, 27 Jul 2023 01:09:04 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 16/49] nfsd: dynamically allocate the nfsd-filecache shrinker
Date: Thu, 27 Jul 2023 16:04:29 +0800
Message-Id: <20230727080502.77895-17-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the nfsd-filecache shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 fs/nfsd/filecache.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
index ee9c923192e0..872eb9501965 100644
--- a/fs/nfsd/filecache.c
+++ b/fs/nfsd/filecache.c
@@ -521,11 +521,7 @@ nfsd_file_lru_scan(struct shrinker *s, struct shrink_control *sc)
 	return ret;
 }
 
-static struct shrinker	nfsd_file_shrinker = {
-	.scan_objects = nfsd_file_lru_scan,
-	.count_objects = nfsd_file_lru_count,
-	.seeks = 1,
-};
+static struct shrinker *nfsd_file_shrinker;
 
 /**
  * nfsd_file_cond_queue - conditionally unhash and queue a nfsd_file
@@ -746,12 +742,18 @@ nfsd_file_cache_init(void)
 		goto out_err;
 	}
 
-	ret = register_shrinker(&nfsd_file_shrinker, "nfsd-filecache");
-	if (ret) {
-		pr_err("nfsd: failed to register nfsd_file_shrinker: %d\n", ret);
+	nfsd_file_shrinker = shrinker_alloc(0, "nfsd-filecache");
+	if (!nfsd_file_shrinker) {
+		pr_err("nfsd: failed to allocate nfsd_file_shrinker\n");
 		goto out_lru;
 	}
 
+	nfsd_file_shrinker->count_objects = nfsd_file_lru_count;
+	nfsd_file_shrinker->scan_objects = nfsd_file_lru_scan;
+	nfsd_file_shrinker->seeks = 1;
+
+	shrinker_register(nfsd_file_shrinker);
+
 	ret = lease_register_notifier(&nfsd_file_lease_notifier);
 	if (ret) {
 		pr_err("nfsd: unable to register lease notifier: %d\n", ret);
@@ -774,7 +776,7 @@ nfsd_file_cache_init(void)
 out_notifier:
 	lease_unregister_notifier(&nfsd_file_lease_notifier);
 out_shrinker:
-	unregister_shrinker(&nfsd_file_shrinker);
+	shrinker_free(nfsd_file_shrinker);
 out_lru:
 	list_lru_destroy(&nfsd_file_lru);
 out_err:
@@ -891,7 +893,7 @@ nfsd_file_cache_shutdown(void)
 		return;
 
 	lease_unregister_notifier(&nfsd_file_lease_notifier);
-	unregister_shrinker(&nfsd_file_shrinker);
+	shrinker_free(nfsd_file_shrinker);
 	/*
 	 * make sure all callers of nfsd_file_lru_cb are done before
 	 * calling nfsd_file_cache_purge
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570915.893495 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBz-0005hl-Fe; Thu, 27 Jul 2023 08:17:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570915.893495; Thu, 27 Jul 2023 08:17:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwBy-0005Xp-QH; Thu, 27 Jul 2023 08:17:50 +0000
Received: by outflank-mailman (input) for mailman id 570915;
 Thu, 27 Jul 2023 08:17:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw2Y-0001DS-8M
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:08:06 +0000
Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com
 [2607:f8b0:4864:20::432])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b69e362c-2c54-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:08:05 +0200 (CEST)
Received: by mail-pf1-x432.google.com with SMTP id
 d2e1a72fcca58-682eef7d752so203608b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:08:05 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.07.52
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:08:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b69e362c-2c54-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445284; x=1691050084;
        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=f+zNYaRC7WOrXvS9MeEiQUBTAQfjLjc/pgN/esuhj34=;
        b=abLX7f3+1Jx7z4l7fMDPHLPoRZGZ9R0nM8ns3oWVX7aiHujgqPmDptRXrf7K4N1NV7
         iafFd1vKgmMytglgpeByIm2etm8PBx6nYdrahZ4g0/dxHWR3bRoC5c0K2oAToNHdR0rs
         G85XXQ+OMNSfgkQPICGhKu4AFUznJk92yyLKwDX6t68bXy1Y1afxgcqF2Hrs2hRsS8Pi
         1cVGQ/135Rq8DHs2i32YJ/uaSpZLHmMFkQEdBwI9bGEy1fU1/6Py8qR+g4Mw2XtURfuH
         rP2vSQAfzwsm7AmoQxkWOyj1kIWSKeW+aRYJEV/VwcFYAz1pgMCM8AVBtPjE13HITA/4
         GS9w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445284; x=1691050084;
        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=f+zNYaRC7WOrXvS9MeEiQUBTAQfjLjc/pgN/esuhj34=;
        b=ON2esgHiMC0M5Sj0i2TMZmd3cgusgPhavypVfpsPwEURV9MfkAWiI0oijL9K08jDCy
         nLu533kYoozIzWTNWzegt16KPXjphWDD8AbsYNlgAOV+Z2HsAvb5iEvXJ4jvZdLDdi2G
         nCZ6ivU9/Q4gR3UmNa81XRre01CCV3MFVVocdU87qzLs0GrT00y/+xvbeEx2GDGMP+wl
         /0pluz4IJuwsi4Ya2zk8LHs2i4siGDUFHPeeuyhYIuuzPtDANXUfKAhBitRyzPETIAsD
         VC6/fPglJmSzbCJs1WiBAH5HW2RWDmQOR7lVVVABS0Y0Q2BGrpvejZg6Xrhpl8ui4lxY
         xIYg==
X-Gm-Message-State: ABy/qLYO37Q35BWLWXn+j1zroKgBBWnfUdWWiM1I1y44AUydYGgIKtDb
	FdzgUASITnG92QeSZYH6wxtslA==
X-Google-Smtp-Source: APBJJlHpYZMPheHhGtAzh7w//Dgf2VgsvvziRNiT4CodVVfE3Y9RoyQKb/hEjPAgUidNi6thlhXB+g==
X-Received: by 2002:a05:6a20:4286:b0:12d:77e:ba3 with SMTP id o6-20020a056a20428600b0012d077e0ba3mr6418674pzj.0.1690445284151;
        Thu, 27 Jul 2023 01:08:04 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 11/49] f2fs: dynamically allocate the f2fs-shrinker
Date: Thu, 27 Jul 2023 16:04:24 +0800
Message-Id: <20230727080502.77895-12-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the f2fs-shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 fs/f2fs/super.c | 32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index a123f1378d57..9200b67aa745 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -83,11 +83,27 @@ void f2fs_build_fault_attr(struct f2fs_sb_info *sbi, unsigned int rate,
 #endif
 
 /* f2fs-wide shrinker description */
-static struct shrinker f2fs_shrinker_info = {
-	.scan_objects = f2fs_shrink_scan,
-	.count_objects = f2fs_shrink_count,
-	.seeks = DEFAULT_SEEKS,
-};
+static struct shrinker *f2fs_shrinker_info;
+
+static int __init f2fs_init_shrinker(void)
+{
+	f2fs_shrinker_info = shrinker_alloc(0, "f2fs-shrinker");
+	if (!f2fs_shrinker_info)
+		return -ENOMEM;
+
+	f2fs_shrinker_info->count_objects = f2fs_shrink_count;
+	f2fs_shrinker_info->scan_objects = f2fs_shrink_scan;
+	f2fs_shrinker_info->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(f2fs_shrinker_info);
+
+	return 0;
+}
+
+static void f2fs_exit_shrinker(void)
+{
+	shrinker_free(f2fs_shrinker_info);
+}
 
 enum {
 	Opt_gc_background,
@@ -4937,7 +4953,7 @@ static int __init init_f2fs_fs(void)
 	err = f2fs_init_sysfs();
 	if (err)
 		goto free_garbage_collection_cache;
-	err = register_shrinker(&f2fs_shrinker_info, "f2fs-shrinker");
+	err = f2fs_init_shrinker();
 	if (err)
 		goto free_sysfs;
 	err = register_filesystem(&f2fs_fs_type);
@@ -4982,7 +4998,7 @@ static int __init init_f2fs_fs(void)
 	f2fs_destroy_root_stats();
 	unregister_filesystem(&f2fs_fs_type);
 free_shrinker:
-	unregister_shrinker(&f2fs_shrinker_info);
+	f2fs_exit_shrinker();
 free_sysfs:
 	f2fs_exit_sysfs();
 free_garbage_collection_cache:
@@ -5014,7 +5030,7 @@ static void __exit exit_f2fs_fs(void)
 	f2fs_destroy_post_read_processing();
 	f2fs_destroy_root_stats();
 	unregister_filesystem(&f2fs_fs_type);
-	unregister_shrinker(&f2fs_shrinker_info);
+	f2fs_exit_shrinker();
 	f2fs_exit_sysfs();
 	f2fs_destroy_garbage_collection_cache();
 	f2fs_destroy_extent_cache();
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570917.893506 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwC1-00064b-Bi; Thu, 27 Jul 2023 08:17:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570917.893506; Thu, 27 Jul 2023 08:17:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwC0-0005yF-20; Thu, 27 Jul 2023 08:17:52 +0000
Received: by outflank-mailman (input) for mailman id 570917;
 Thu, 27 Jul 2023 08:17:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw5T-0001DS-OP
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:11:07 +0000
Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com
 [2607:f8b0:4864:20::436])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 22d168aa-2c55-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:11:07 +0200 (CEST)
Received: by mail-pf1-x436.google.com with SMTP id
 d2e1a72fcca58-6748a616e17so183287b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:11:07 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.10.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:11:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 22d168aa-2c55-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445466; x=1691050266;
        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=vjqO/ZPr/Go39gpx6DVg0WzFepitwPif37hI1XuxbyE=;
        b=KWf7bMy1nbQ37OxDK+aLk4UU+d+DpidRt45gsv6WisntZ5r23wZ3pYKMCoLchBsQxQ
         dbRrJ4b0aFwJmGna2/IEy8T8QiKnn2NACgYbVRTrckTcQDGJyAPHMooOCl62MUAwOoyA
         JbZysBi4oQBt301gAOSv+2GS8dKtdtSP0nG8DKgUtI05eGkdQUUBXQMQvZN3o0luNYiw
         8kcVk8roCfN8SKqwYrPgL6wyyB4sigzvUww4WP5NJ+eSnXEpjiht6HKW6ptfgHl7+XLv
         6NnbrWDfXzNY62UnzW5yOMd63/qymxxfuyafQ4go8x2ZHPA9qwKwZ1PQJSZV3Wy/oPgn
         SKCg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445466; x=1691050266;
        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=vjqO/ZPr/Go39gpx6DVg0WzFepitwPif37hI1XuxbyE=;
        b=DAr3LBZWDPaMckVC/wnvFReQO7mODTePKaCarOPlBko5XPAagDFCyxog0YXMJworqD
         UL9xzg19kYYc26jBryJZPUxIe8QIbRUd95Nybqxt1Ngw6kdzK1TEfNmbdOz3kUMtZa7p
         Nlz4eEqq93hGk3De7a2FwIpySoKlFv7AQpFV0med7lvhZJduVZEl1JpvM+MdYQXonx9D
         488RfBC/RpeaJMo/jQFQnJaY3GK6TnOAKTaUR4AbAxPfBCMB+il1nZGvoG8w+pGOafez
         dct54VGIkSa/jX8Hu1uFugtNKHMXWKbHaLVXCgiL1wjqlZTMM5KVtda6FAhUnwz+UBHU
         6Y6A==
X-Gm-Message-State: ABy/qLY+WyeQMxoSJT0slFcFgmVBE8YFvQfqTyrDHbN5bjYGa3jW8mwo
	boFoblf268+WIrh5zcEgv2B9Cw==
X-Google-Smtp-Source: APBJJlHsQWiMeK1ZGCoT9EMqzV36W3zQjtsLKzuNfdQAXhrStS5DTpZT9lorCJhzpRLn0tDb83CKIQ==
X-Received: by 2002:aa7:8615:0:b0:681:9fe0:b543 with SMTP id p21-20020aa78615000000b006819fe0b543mr4626555pfn.2.1690445465777;
        Thu, 27 Jul 2023 01:11:05 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v3 26/49] drm/panfrost: dynamically allocate the drm-panfrost shrinker
Date: Thu, 27 Jul 2023 16:04:39 +0800
Message-Id: <20230727080502.77895-27-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the drm-panfrost shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct panfrost_device.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Steven Price <steven.price@arm.com>
---
 drivers/gpu/drm/panfrost/panfrost_device.h    |  2 +-
 drivers/gpu/drm/panfrost/panfrost_drv.c       |  6 +++-
 drivers/gpu/drm/panfrost/panfrost_gem.h       |  2 +-
 .../gpu/drm/panfrost/panfrost_gem_shrinker.c  | 30 +++++++++++--------
 4 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h
index b0126b9fbadc..e667e5689353 100644
--- a/drivers/gpu/drm/panfrost/panfrost_device.h
+++ b/drivers/gpu/drm/panfrost/panfrost_device.h
@@ -118,7 +118,7 @@ struct panfrost_device {
 
 	struct mutex shrinker_lock;
 	struct list_head shrinker_list;
-	struct shrinker shrinker;
+	struct shrinker *shrinker;
 
 	struct panfrost_devfreq pfdevfreq;
 };
diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index a2ab99698ca8..e1d0e3a23757 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -601,10 +601,14 @@ static int panfrost_probe(struct platform_device *pdev)
 	if (err < 0)
 		goto err_out1;
 
-	panfrost_gem_shrinker_init(ddev);
+	err = panfrost_gem_shrinker_init(ddev);
+	if (err)
+		goto err_out2;
 
 	return 0;
 
+err_out2:
+	drm_dev_unregister(ddev);
 err_out1:
 	pm_runtime_disable(pfdev->dev);
 	panfrost_device_fini(pfdev);
diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.h b/drivers/gpu/drm/panfrost/panfrost_gem.h
index ad2877eeeccd..863d2ec8d4f0 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gem.h
+++ b/drivers/gpu/drm/panfrost/panfrost_gem.h
@@ -81,7 +81,7 @@ panfrost_gem_mapping_get(struct panfrost_gem_object *bo,
 void panfrost_gem_mapping_put(struct panfrost_gem_mapping *mapping);
 void panfrost_gem_teardown_mappings_locked(struct panfrost_gem_object *bo);
 
-void panfrost_gem_shrinker_init(struct drm_device *dev);
+int panfrost_gem_shrinker_init(struct drm_device *dev);
 void panfrost_gem_shrinker_cleanup(struct drm_device *dev);
 
 #endif /* __PANFROST_GEM_H__ */
diff --git a/drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c b/drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c
index 6a71a2555f85..3dfe2b7ccdd9 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c
+++ b/drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c
@@ -18,8 +18,7 @@
 static unsigned long
 panfrost_gem_shrinker_count(struct shrinker *shrinker, struct shrink_control *sc)
 {
-	struct panfrost_device *pfdev =
-		container_of(shrinker, struct panfrost_device, shrinker);
+	struct panfrost_device *pfdev = shrinker->private_data;
 	struct drm_gem_shmem_object *shmem;
 	unsigned long count = 0;
 
@@ -65,8 +64,7 @@ static bool panfrost_gem_purge(struct drm_gem_object *obj)
 static unsigned long
 panfrost_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc)
 {
-	struct panfrost_device *pfdev =
-		container_of(shrinker, struct panfrost_device, shrinker);
+	struct panfrost_device *pfdev = shrinker->private_data;
 	struct drm_gem_shmem_object *shmem, *tmp;
 	unsigned long freed = 0;
 
@@ -97,13 +95,22 @@ panfrost_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc)
  *
  * This function registers and sets up the panfrost shrinker.
  */
-void panfrost_gem_shrinker_init(struct drm_device *dev)
+int panfrost_gem_shrinker_init(struct drm_device *dev)
 {
 	struct panfrost_device *pfdev = dev->dev_private;
-	pfdev->shrinker.count_objects = panfrost_gem_shrinker_count;
-	pfdev->shrinker.scan_objects = panfrost_gem_shrinker_scan;
-	pfdev->shrinker.seeks = DEFAULT_SEEKS;
-	WARN_ON(register_shrinker(&pfdev->shrinker, "drm-panfrost"));
+
+	pfdev->shrinker = shrinker_alloc(0, "drm-panfrost");
+	if (!pfdev->shrinker)
+		return -ENOMEM;
+
+	pfdev->shrinker->count_objects = panfrost_gem_shrinker_count;
+	pfdev->shrinker->scan_objects = panfrost_gem_shrinker_scan;
+	pfdev->shrinker->seeks = DEFAULT_SEEKS;
+	pfdev->shrinker->private_data = pfdev;
+
+	shrinker_register(pfdev->shrinker);
+
+	return 0;
 }
 
 /**
@@ -116,7 +123,6 @@ void panfrost_gem_shrinker_cleanup(struct drm_device *dev)
 {
 	struct panfrost_device *pfdev = dev->dev_private;
 
-	if (pfdev->shrinker.nr_deferred) {
-		unregister_shrinker(&pfdev->shrinker);
-	}
+	if (pfdev->shrinker)
+		shrinker_free(pfdev->shrinker);
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:17:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:17:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570919.893522 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwC4-00072w-GJ; Thu, 27 Jul 2023 08:17:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570919.893522; Thu, 27 Jul 2023 08:17:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwC3-0006vL-9Q; Thu, 27 Jul 2023 08:17:55 +0000
Received: by outflank-mailman (input) for mailman id 570919;
 Thu, 27 Jul 2023 08:17:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw4J-0001DS-Gc
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:09:55 +0000
Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com
 [2607:f8b0:4864:20::434])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f7be168d-2c54-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:09:54 +0200 (CEST)
Received: by mail-pf1-x434.google.com with SMTP id
 d2e1a72fcca58-686f6231bdeso113061b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:09:54 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.09.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:09:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f7be168d-2c54-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445393; x=1691050193;
        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=YHU8OaKZwBmHAPsd+ulZSL5GxfVyMtJ49ZlHBntG+/k=;
        b=Ws66ywmifmcLi+WS7kmIq1OGsH1BFTj57lSknLEKHfbjZoq0FCk32P7hFix2O77y/C
         4VExY7boGbko1TLXa8rf04m6+c8ScNg+Ye07GBCAr/bT75kG0yI8bdxHraEPkF+rcUYR
         8BmftTtO1b4i7ZeslsgPT7KHdxn3xY8ziOGXEmWj+FzniwFS8tNvAxdGJbvq/4djXF38
         gQDVTQD96XEDgWvn9v9d4yLEL0qbZzBxPnvHBbbs4StP2CGFCs0AHk/pzAfhLwFN3LYv
         MATNwQY8c4ti2yb34XlOR1fjl5eoQUN5qPDBlkMol6h4RrCuQdh3qGqhSkTUZQAnG9Jo
         zXhA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445393; x=1691050193;
        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=YHU8OaKZwBmHAPsd+ulZSL5GxfVyMtJ49ZlHBntG+/k=;
        b=JcE3udefSyuYrWXUBa74TzXuFE2IUXzC1+wzptbjJsrSzFij+1kGvnFz+ylqICnjiG
         exCIXY8NCFU5kBYkVaoKOPG0mCjH9EPJH5YjjeWwGVpBjbig+lH7ifNjBNZRKeQBF/sI
         qSjGl2HWAiwz7lqNvNCmrXbZ3Oc1DrPLP6tER46WYidrIbaDJHORK9Pt1au9UUzsBG6M
         o9rNyuEgFyUIq4aat+Gk9B2cty++9WIBwVuc1wzrI0O97CM6lYMjqG44mh3NyCcoR60u
         R5dxX9/wZw43uSoFWOM4X54k5zVhPhnB9v6VM9yaVanSyMd/yVL62MKQniK1urGqPP5v
         n0Lg==
X-Gm-Message-State: ABy/qLZoEJbWD8zWoH2tnA526TTjdtg5u9Kgk644ROwBCGFXkjENDGVw
	WGB4Dn5EocUW2JeJtiQk4z0syg==
X-Google-Smtp-Source: APBJJlFl46sZLt7x9x1yarGXcrDY9BzfubiI/ML/2A4f5iYMwILGEdxBDjTGuKdYIeQS2k9MfMDqhg==
X-Received: by 2002:a05:6a00:4a0e:b0:677:3439:874a with SMTP id do14-20020a056a004a0e00b006773439874amr5199798pfb.3.1690445393467;
        Thu, 27 Jul 2023 01:09:53 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v3 20/49] rcu: dynamically allocate the rcu-kfree shrinker
Date: Thu, 27 Jul 2023 16:04:33 +0800
Message-Id: <20230727080502.77895-21-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use new APIs to dynamically allocate the rcu-kfree shrinker.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 kernel/rcu/tree.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index cb1caefa8bd0..6d2f82f79c65 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3449,13 +3449,6 @@ kfree_rcu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
 	return freed == 0 ? SHRINK_STOP : freed;
 }
 
-static struct shrinker kfree_rcu_shrinker = {
-	.count_objects = kfree_rcu_shrink_count,
-	.scan_objects = kfree_rcu_shrink_scan,
-	.batch = 0,
-	.seeks = DEFAULT_SEEKS,
-};
-
 void __init kfree_rcu_scheduler_running(void)
 {
 	int cpu;
@@ -4931,6 +4924,7 @@ static void __init kfree_rcu_batch_init(void)
 {
 	int cpu;
 	int i, j;
+	struct shrinker *kfree_rcu_shrinker;
 
 	/* Clamp it to [0:100] seconds interval. */
 	if (rcu_delay_page_cache_fill_msec < 0 ||
@@ -4962,8 +4956,18 @@ static void __init kfree_rcu_batch_init(void)
 		INIT_DELAYED_WORK(&krcp->page_cache_work, fill_page_cache_func);
 		krcp->initialized = true;
 	}
-	if (register_shrinker(&kfree_rcu_shrinker, "rcu-kfree"))
-		pr_err("Failed to register kfree_rcu() shrinker!\n");
+
+	kfree_rcu_shrinker = shrinker_alloc(0, "rcu-kfree");
+	if (!kfree_rcu_shrinker) {
+		pr_err("Failed to allocate kfree_rcu() shrinker!\n");
+		return;
+	}
+
+	kfree_rcu_shrinker->count_objects = kfree_rcu_shrink_count;
+	kfree_rcu_shrinker->scan_objects = kfree_rcu_shrink_scan;
+	kfree_rcu_shrinker->seeks = DEFAULT_SEEKS;
+
+	shrinker_register(kfree_rcu_shrinker);
 }
 
 void __init rcu_init(void)
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:18:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:18:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570928.893539 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwC7-0008G6-PY; Thu, 27 Jul 2023 08:17:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570928.893539; Thu, 27 Jul 2023 08:17:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwC7-0008C0-De; Thu, 27 Jul 2023 08:17:59 +0000
Received: by outflank-mailman (input) for mailman id 570928;
 Thu, 27 Jul 2023 08:17:57 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOw5t-0005Vh-9m
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:11:33 +0000
Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com
 [2607:f8b0:4864:20::436])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 315f2256-2c55-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:11:31 +0200 (CEST)
Received: by mail-pf1-x436.google.com with SMTP id
 d2e1a72fcca58-682eef7d752so204431b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:11:31 -0700 (PDT)
Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.11.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 01:11:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 315f2256-2c55-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690445490; x=1691050290;
        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=ze2BfjPj3zI6XK14aBXxwpj9cG5VKS+QoT9VkWxAsig=;
        b=lwOoY+OdQN9yyaycuuDe1xOBPNuMdpjPWf9iVdWyTJX4Rze1Ujyu7FqyyXfPUD3aU2
         0geNSiBV+SjLplmH7ILvbtRHCHKM3vLFmOVDmsv1BEm9fkWkTRAM1imR53z99mDpf0IW
         ffoAdzAoMkEyhpVqT3oRFQGqTsCjJOMqkqnQ0DFV07QdT6HdoSrpGoFduwBz2OfpOwFt
         CWOX0mmKGcSRamco0Cg7QpPpz6Lx/kpTjodIKj6Sfbh0QvlZA2O3b8FhSM1hAbz32D/P
         0DhVwgLc1Xu9esSsJfTXPYkz1XSyCT4LoDf/9vVVRpeHu2USWPZ+XNt9qGqYRzfEx2BR
         Y6jQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690445490; x=1691050290;
        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=ze2BfjPj3zI6XK14aBXxwpj9cG5VKS+QoT9VkWxAsig=;
        b=Gwd0DrzSuKIqLKfRAdl+lO7JlAgRExzMSIRulfOjRksYQ1mSvAG74yPEUOli1RKjCx
         D7l7PwvOv66TalHScFQBCXnPJ5uYMrc1PgDA18/R7gLdoXpcBOgL3qFSW219IOKb+noe
         SGCUEZ+gPvvOWEO4BOQzQVHMBax0ayDwq8f7WyUklzQP7OZmZlB7wdHhy+oZ09XRxAq9
         hQwOVvjSXHYRrpgXrvDQZm/z/DrCFSJiGZFsP67gpn+mCnntyPdFKtbXZ5bBXhpGKZBS
         JLA09gcIXBuu/WaOFgl/q/7tyzhdM6O+lePLYE0rns2FuZyGE9Cz6uY5YporUIf/V5XS
         p+rw==
X-Gm-Message-State: ABy/qLZCKK7qhQlEp0kqEsAZ1MhV9BIzGIOpVeInQNqODv623d9GgGQb
	9NKkouvV8pskSPAsMk4ocZAL8w==
X-Google-Smtp-Source: APBJJlFMZtECqV3NWJubuagzux89byKCTiavknA18umD2w/BadGADzl49oXppHX8YppKwxO9L0rdOg==
X-Received: by 2002:a05:6a00:1586:b0:67f:8ef5:2643 with SMTP id u6-20020a056a00158600b0067f8ef52643mr5208150pfk.2.1690445490190;
        Thu, 27 Jul 2023 01:11:30 -0700 (PDT)
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: akpm@linux-foundation.org,
	david@fromorbit.com,
	tkhai@ya.ru,
	vbabka@suse.cz,
	roman.gushchin@linux.dev,
	djwong@kernel.org,
	brauner@kernel.org,
	paulmck@kernel.org,
	tytso@mit.edu,
	steven.price@arm.com,
	cel@kernel.org,
	senozhatsky@chromium.org,
	yujie.liu@intel.com,
	gregkh@linuxfoundation.org,
	muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org,
	linux-mm@kvack.org,
	x86@kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net,
	cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org,
	netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com,
	linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [PATCH v3 28/49] dm zoned: dynamically allocate the dm-zoned-meta shrinker
Date: Thu, 27 Jul 2023 16:04:41 +0800
Message-Id: <20230727080502.77895-29-zhengqi.arch@bytedance.com>
X-Mailer: git-send-email 2.24.3 (Apple Git-128)
In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the dm-zoned-meta shrinker, so that it can be freed
asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
read-side critical section when releasing the struct dmz_metadata.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 drivers/md/dm-zoned-metadata.c | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c
index 9d3cca8e3dc9..0bcb26a43578 100644
--- a/drivers/md/dm-zoned-metadata.c
+++ b/drivers/md/dm-zoned-metadata.c
@@ -187,7 +187,7 @@ struct dmz_metadata {
 	struct rb_root		mblk_rbtree;
 	struct list_head	mblk_lru_list;
 	struct list_head	mblk_dirty_list;
-	struct shrinker		mblk_shrinker;
+	struct shrinker		*mblk_shrinker;
 
 	/* Zone allocation management */
 	struct mutex		map_lock;
@@ -615,7 +615,7 @@ static unsigned long dmz_shrink_mblock_cache(struct dmz_metadata *zmd,
 static unsigned long dmz_mblock_shrinker_count(struct shrinker *shrink,
 					       struct shrink_control *sc)
 {
-	struct dmz_metadata *zmd = container_of(shrink, struct dmz_metadata, mblk_shrinker);
+	struct dmz_metadata *zmd = shrink->private_data;
 
 	return atomic_read(&zmd->nr_mblks);
 }
@@ -626,7 +626,7 @@ static unsigned long dmz_mblock_shrinker_count(struct shrinker *shrink,
 static unsigned long dmz_mblock_shrinker_scan(struct shrinker *shrink,
 					      struct shrink_control *sc)
 {
-	struct dmz_metadata *zmd = container_of(shrink, struct dmz_metadata, mblk_shrinker);
+	struct dmz_metadata *zmd = shrink->private_data;
 	unsigned long count;
 
 	spin_lock(&zmd->mblk_lock);
@@ -2936,19 +2936,23 @@ int dmz_ctr_metadata(struct dmz_dev *dev, int num_dev,
 	 */
 	zmd->min_nr_mblks = 2 + zmd->nr_map_blocks + zmd->zone_nr_bitmap_blocks * 16;
 	zmd->max_nr_mblks = zmd->min_nr_mblks + 512;
-	zmd->mblk_shrinker.count_objects = dmz_mblock_shrinker_count;
-	zmd->mblk_shrinker.scan_objects = dmz_mblock_shrinker_scan;
-	zmd->mblk_shrinker.seeks = DEFAULT_SEEKS;
 
 	/* Metadata cache shrinker */
-	ret = register_shrinker(&zmd->mblk_shrinker, "dm-zoned-meta:(%u:%u)",
-				MAJOR(dev->bdev->bd_dev),
-				MINOR(dev->bdev->bd_dev));
-	if (ret) {
-		dmz_zmd_err(zmd, "Register metadata cache shrinker failed");
+	zmd->mblk_shrinker = shrinker_alloc(0,  "dm-zoned-meta:(%u:%u)",
+					    MAJOR(dev->bdev->bd_dev),
+					    MINOR(dev->bdev->bd_dev));
+	if (!zmd->mblk_shrinker) {
+		dmz_zmd_err(zmd, "Allocate metadata cache shrinker failed");
 		goto err;
 	}
 
+	zmd->mblk_shrinker->count_objects = dmz_mblock_shrinker_count;
+	zmd->mblk_shrinker->scan_objects = dmz_mblock_shrinker_scan;
+	zmd->mblk_shrinker->seeks = DEFAULT_SEEKS;
+	zmd->mblk_shrinker->private_data = zmd;
+
+	shrinker_register(zmd->mblk_shrinker);
+
 	dmz_zmd_info(zmd, "DM-Zoned metadata version %d", zmd->sb_version);
 	for (i = 0; i < zmd->nr_devs; i++)
 		dmz_print_dev(zmd, i);
@@ -2995,7 +2999,7 @@ int dmz_ctr_metadata(struct dmz_dev *dev, int num_dev,
  */
 void dmz_dtr_metadata(struct dmz_metadata *zmd)
 {
-	unregister_shrinker(&zmd->mblk_shrinker);
+	shrinker_free(zmd->mblk_shrinker);
 	dmz_cleanup_metadata(zmd);
 	kfree(zmd);
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:26:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:26:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570935.893559 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwK5-0005DJ-JK; Thu, 27 Jul 2023 08:26:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570935.893559; Thu, 27 Jul 2023 08:26:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwK5-0005DC-Gc; Thu, 27 Jul 2023 08:26:13 +0000
Received: by outflank-mailman (input) for mailman id 570935;
 Thu, 27 Jul 2023 08:26:12 +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
 <SRS0=Us1z=DN=citrix.com=prvs=565118259=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qOwK4-0005D6-7B
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:26:12 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3ad9bd73-2c57-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:26:07 +0200 (CEST)
Received: from mail-dm6nam12lp2176.outbound.protection.outlook.com (HELO
 NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.176])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 27 Jul 2023 04:26:04 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by CH2PR03MB5318.namprd03.prod.outlook.com (2603:10b6:610:9d::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 08:26:02 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 08:26:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3ad9bd73-2c57-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690446367;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=shHWKyk90/Hfp6MAtzwA6VErmUUQXNzN++/Q/XHQQwM=;
  b=h08OkuNJQrSU0OQMLusQnD6X/bfDbqySLSoXQND6ZVOHU21LU13YheD8
   NCTqfj3a6SCWyBNrA2hzhmnNF0WSmMTCZm4nwiQWDiQ7H6XKFl/axfy1c
   EWB+3rKoCa3+ZwYwtrYq6uTGX8gkKE9OdVwyz84l+wIg5T+SbXbA60EQr
   Y=;
X-IronPort-RemoteIP: 104.47.59.176
X-IronPort-MID: 117488951
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:s8jFf65+UEhiPkHdUZymQAxRtPzGchMFZxGqfqrLsTDasY5as4F+v
 mZJXW3SPPiOYTTyL98iPd/npk1T78LXnN5qTwNp/Cw2Hi5G8cbLO4+Ufxz6V8+wwm8vb2o8t
 plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraCYnsrLeNdYH9JoQp5nOIkiZJfj9G8Agec0
 fv/uMSaM1K+s9JOGjt8B5mr9lU35ZwehBtC5gZlPa8R4weH/5UoJMl3yZ+ZfiOQrrZ8RoZWd
 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4
 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5m3
 9EWOGsVazm4oM2K3I++YMVohJR+I5y+VG8fkikIITDxK98DGMqGb4CUoNhS0XE3m9xEGuvYa
 4wBcz1zYR/cYhpJfFAKFJY5m+TujX76G9FagAvN+exrvC6OnUooj+aF3Nn9I7RmQe1PmUmVv
 CTe9nnRCRAGLt2PjzGC9xpAg8eWxHynCNJDSeTQGvhCgEKD5GwhGRItDgWnjOal1BfmZvADN
 BlBksYphe1onKCxdfH/VRClpH+PvjYHRsFdVeY97Wml1a788wufQG8eQVZpeNEg8cM7WzEu/
 luIhM/yQyxitqWPTnCQ/avSqim9UQAZNXQHZDMEZQId7sP/vZooiRbSUtdkFrXzhdrwcQwc2
 BiPpSk6wrkW08gC0vzh+Uid2m3y4J/UUgQy+wPbGHq/6R90b5KkYIru7kXH6fFHL8CSSVzpU
 GU4pvVyJdsmVfml/BFhis1UdF11z55p6AHhvGM=
IronPort-HdrOrdr: A9a23:fb7m7qyTSU8c25CZlSx6KrPwKb1zdoMgy1knxilNoH1uA6qlfq
 WV98jzuiWE7Ar5NEtBpTniAtjmfZq/z/NICOAqVN/JYOCBghrKEGgI1/qG/9SPIVydygdr78
 tdmnlFaeEZXDBB4/oTvmGDfOod/A==
X-Talos-CUID: 9a23:8TDJZm0pNpJo68ENLNDcGbxfMO0rYibFyV7rBGCEFVtsYpGRSw/N9/Yx
X-Talos-MUID: 9a23:KTd1jwSYnZDUVhfqRXTsmyFANPV57J/1VlwgjolY4pG5F3BvbmI=
X-IronPort-AV: E=Sophos;i="6.01,234,1684814400"; 
   d="scan'208";a="117488951"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=iWQ84w2o3hjClyPPfg/MU4Oq4hEpblX+Wvp52uoLUYXyqR2/q6M1kBappmPFk5CLxLuW83OGXKAbEHpKGGGNFji5VlXLov/UW7KEP8DSFJCIMfsbJv9LSRuwdyMkmkGROqOcB5kDN7/fXOLGSx0HCwbL3HHTQklCOL+V3UTFeXh9+UWWHX6oYtFCh7r/5dFQH75Ioao0QnZdz3w1e0u3ADdWSJnGyTu/bCUfXGfv+9drHcRiduKmT0BLT7NTLebQX/lku2ru8u9JWPdSB3Tkq/FfQZds2vhq6JS1wJNb4N2P4PgUBqxCJ6y2QxBpeHyj+nyc0hqPDLvnZhkbRBKwYQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=VNjCh4pwS6BGBBQD4CbzVFwJV4oSjIKiofyVPcj8q3A=;
 b=Q58FlUjMsKRoz2Q2LjsU5SYKY7gKubcwTUIhm8hTBUd5gah1D8eQ5sI4CTS6Br7qEUdigQPavPw9jnD4zZGGEtohhqhnHvKkhIyfOH8LtbxH0aFDW4tPuZ68n+m3sqtfJRz0L8V7gK8LeRLerxlnREpP+JOns+/bKApswRvYUD8DUTD7bRoPOot4JBqhva8oxaziioGSdXTOsPwwahnqOr1jcMnBErQUppbknVv8moHmHzwXsGL1hM0nhGU9zJ3eUAREU+9Tpj7Y0P8AtNbiA4y3YELXkoHlWmYF36Wa64edyvTLYIvCKPamAWq0rsFjOT2P2KQmQWkSVg1a8Z9zZw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=VNjCh4pwS6BGBBQD4CbzVFwJV4oSjIKiofyVPcj8q3A=;
 b=wyWW2+Ef4ApTGyJKM5okJTONHk3JGFvii6/e5WRaUXzZfh1t1/A2MkYYKtwu4ALBsBagG4c1VB3zvmwiloHUUwpZ6PI+EQRYTh3B9UoY+u2wdutI1ZAG8waOCSxG6Z29sbzK5gbTS04oIwaGBhYQNAD6wjW+kBS8FFNr0eeSrWo=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Thu, 27 Jul 2023 10:25:37 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: Re: [PATCH v2] vpci: add permission checks to map_range()
Message-ID: <ZMIqAdIUvegizoQS@MacBook-Air-de-Roger.local>
References: <20230726140132.80151-1-roger.pau@citrix.com>
 <a277dacd-56f6-a5ab-6982-b5cc4f9d507c@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <a277dacd-56f6-a5ab-6982-b5cc4f9d507c@suse.com>
X-ClientProxiedBy: LO4P265CA0060.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2af::6) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|CH2PR03MB5318:EE_
X-MS-Office365-Filtering-Correlation-Id: 338905a5-702c-4d33-900f-08db8e7b1d11
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	RA4F8vRwIK5tmezzdSiY/B2ENpgUXFi+nJtBel2zV4QuhdnJ4JSkeo2kII55khsNjY1dMX4N3K8UQdib6BiHM2uqdr7BaGnUSu13w4cAc8xix8ZlVmBjD30j8Okz/Df1HVZz7iahXWgF16xSm9sT2sQJuVdg3lTGPedqN/GjPDkyIcBMiOztR1m6P4GOf3SbQ6soMMEHc6Bwnu7bt9v73SjNk4txQIxDlnPdspgzgkEhqmNsgmivv2cN2Rmpyp08/45O4lOzPss61ZOTTELIImDSvCLDmZ4X1xc+mZRpkVwNkP3tP8hZ8SDgPT9BhgwRpXquoz40Hil3vZxfiVd6zPhU33tppbAOkZn8sYNDgRgNSFG3JtLdPFrvVdyk5iYBnPgVOR0og68egiU29avq9C6nAtorHthez+OFSqR5ydzGHi7h9d2MNNWzTZ1y7vhBa00CFx0fNqfpjckmCjWeFozhsWlUTHyBiff6rXP0+KqTnqiA/75YZhEac6xEDYrjwxkcbeFNKrgY+JncBDufeQojCCplWXXtxcj7H2rV1Ead73H7yeUmXMpn4yi8kLEh
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(396003)(366004)(376002)(39860400002)(451199021)(9686003)(6512007)(6666004)(54906003)(6486002)(478600001)(66556008)(53546011)(186003)(26005)(6506007)(2906002)(66476007)(4326008)(316002)(5660300002)(8936002)(8676002)(41300700001)(66946007)(82960400001)(6916009)(38100700002)(85182001)(86362001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Zk9HTzhOQlVXSXZuYkFDcUZ4Z1dLL1lBR3l5SW1IT1hwSXBnMWVZZnYxdEhk?=
 =?utf-8?B?RUVQR1FkZ1BLNVdzbXRRNnF4QTBYWlhYSFUvcUptdVkydFJWZ2RTL0oxNWRT?=
 =?utf-8?B?NWhrcXFLMExQd3Q1WG1xeGc3TFZDVW9TZXZUdEUvWFk2anNXYVBhLytGbHBE?=
 =?utf-8?B?aDkzRmZuK1ZSb2VCODdsYXVMb2U5TlUvOG41Ty82b3owRXNJSWVnYWVKT3F2?=
 =?utf-8?B?Q2hwREx6TFBJQTV6QTFlaGY4RkxjVlF0Q0ZyTVdUTTRNbVhINXR2emlDMUIy?=
 =?utf-8?B?eGNpN09QS053TDlLYTJuWG0wS0djUmo4d3BGVTFJaWtjWCsrcVIydlBJZEUz?=
 =?utf-8?B?WGd2cjBlNzljOWhtdjdxbE9uR0dNQWo2SEEyc0YzTWU3MkZmdjh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VlUMkJad1FFa2tSaEhEeG9YalJ2?=
 =?utf-8?B?MXc9PQ==?=
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	4j6HrFxF/+Okg46lK9Lnzpl8fD3TsWZuQ/WRpNIks6CjFLeyG7PKSi0Ez0HrC0UvQQXBM2Rfo6Owgf6djYpHrJoZXxEo72Z7SSyIaDAec5Tsm80/6hNPBVb+y4MsKUptiIsiUsvopYfWgMgh9H9u9ycpcjI/VtcCQv0yNkbXeYDWbvqKbnWtcl9nC/v5xBc/BdtukpDC4bkzK6RPz85XSEFtmMdq/wzeJPljbErak6uB/x1rlrjuBNEyy483hTok5RR74/IANcaC31XK2OqxL7SWc//nqDTTo4M8FLePWouVZeNCsQrj+PtTWi5Hbk7Qs4JP+WSX7bRK6PSXF8dIZeqOz4eGy3zcJu+aumzFpMukyRuwZsZhb2EYRpKcRSejmVLsfTOxGdj4SmNJ8rDKxd+WHENg3pska+B7Kffl0KOvMDlA2CSJWIBx6mkyPB7C9uVUXp2vSMLQ76iE/QGlmCBLsMfYrMH1KD7LLzDJwQHh+ry046NW8AOB72X2psT5rKm7GN0Z1qe19mlRqAdRyTWLtLmbGJVddXv6eOaIFAOtXsx2SiE01h6n/pX2JGlMXPqfHo605T99BZhFyGJtbc2GNx/PAesFCpoQv/4DobXE7nlxjTNJeKiVLmWxSqEJzOo3myEaZlNxWpE88FOoxJFaTY0mDO1dVtvovr1A3/TNLWYNmA1Rjj7lY6AXPmS3UsQxhW+BiH2J2FopR87eOMeemsp370gGAaF3Y2J/imQkgjb5cNPWIiUF+7A//0EOUChScxj2sQ83annvJtH3tCYm4sWlZCGoYl6ZDBoWFmBs55V7vLbcXyKz3YM/b64gTZiksWkcYKIbw6Rp1G0L7snHkvKI9pnxGRV4Rw1jIv8d4x7qquLpoQjR4752uH36
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 338905a5-702c-4d33-900f-08db8e7b1d11
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 08:26:02.4348
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: CD9zzxyZzsZbK5h/4g3SbUYz8UW3Z5yex0WTho9b5l+X1GAm4Nz9cujn7EBSVgxOInxzhKra1R+elDOPYnmvQw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR03MB5318

On Thu, Jul 27, 2023 at 09:56:08AM +0200, Jan Beulich wrote:
> On 26.07.2023 16:01, Roger Pau Monne wrote:
> > Just like it's done for the XEN_DOMCTL_memory_mapping hypercall, add
> > the permissions checks to vPCI map_range(), which is used to map the
> > BARs into the domain p2m.
> > 
> > Adding those checks requires that for x86 PVH hardware domain builder
> > the permissions are set before initializing the IOMMU, or else
> > attempts to initialize vPCI done as part of IOMMU device setup will
> > fail due to missing permissions to create the BAR mappings.
> > 
> > While moving the call to dom0_setup_permissions() convert the panic()
> > used for error handling to a printk, the caller will already panic if
> > required.
> > 
> > Fixes: 9c244fdef7e7 ('vpci: add header handlers')
> > Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> 
> I've committed this, but despite the Fixes: tag I'm not sure this
> wants backporting. Thoughts?

It was IMO an omission from that commit, however given vPCI so far is
only used by dom0 (an in experimental mode) I don't see much reason to
backport it.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:28:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:28:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570941.893569 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwM2-0005nt-W2; Thu, 27 Jul 2023 08:28:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570941.893569; Thu, 27 Jul 2023 08:28:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwM2-0005nm-S6; Thu, 27 Jul 2023 08:28:14 +0000
Received: by outflank-mailman (input) for mailman id 570941;
 Thu, 27 Jul 2023 08:28:14 +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
 <SRS0=LQce=DN=arm.com=Rahul.Singh@srs-se1.protection.inumbo.net>)
 id 1qOwM1-0005nV-Sa
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:28:13 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2041.outbound.protection.outlook.com [40.107.13.41])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 84e4444c-2c57-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:28:10 +0200 (CEST)
Received: from AS4P190CA0036.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5d1::7)
 by AM9PR08MB6004.eurprd08.prod.outlook.com (2603:10a6:20b:285::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 08:27:34 +0000
Received: from AM7EUR03FT007.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:5d1:cafe::48) by AS4P190CA0036.outlook.office365.com
 (2603:10a6:20b:5d1::7) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29 via Frontend
 Transport; Thu, 27 Jul 2023 08:27:34 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT007.mail.protection.outlook.com (100.127.140.242) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6631.29 via Frontend Transport; Thu, 27 Jul 2023 08:27:34 +0000
Received: ("Tessian outbound ba2f3d95109c:v145");
 Thu, 27 Jul 2023 08:27:33 +0000
Received: from ad388fb1f4ef.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 5EE72499-661C-4BD7-802B-D83046ADFC0E.1; 
 Thu, 27 Jul 2023 08:27:27 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ad388fb1f4ef.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 27 Jul 2023 08:27:27 +0000
Received: from AS8PR08MB7158.eurprd08.prod.outlook.com (2603:10a6:20b:404::24)
 by GV1PR08MB7364.eurprd08.prod.outlook.com (2603:10a6:150:23::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 08:27:23 +0000
Received: from AS8PR08MB7158.eurprd08.prod.outlook.com
 ([fe80::845:4a4f:5c99:2788]) by AS8PR08MB7158.eurprd08.prod.outlook.com
 ([fe80::845:4a4f:5c99:2788%3]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 08:27:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 84e4444c-2c57-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=aKxpga72nqPY4sgEjHuulPIqRAsInboxIb0rF9uA1/4=;
 b=M0PYPUY7yEOqU9lQLxMW5qFRr5O3phckIzZFWRhvGFeiwN+rz2EAfgq7i0nFfWQ1AHAbJ8UYuOyVXow3Ih8X6asyy88rB4lpuAa4kJ6zJ9iTHo9jeLaby6tV2I9WAOmaLYprPgUkd3pToka+ST9fZe6I9r6kDB954R6+mRY3JjU=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 00da35aab5e9d6bc
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Te6cPj1ISvk9W1LIClQYlvgzcs5Shk2rVQ+XuEeQ9Yfob9LoKR2vCPC6WSRE5LyC2Ytzsn8e0PLlqVmHfVGy6dVFXI3PV83Oxt0nWEQo3fOoNI4tySCidREH6poa4pJTdQ5M1aXMehtceSsYDEMv4QCiNTW1PipHnY4wcabhcN0Il1EFrABmgLZvcNNCQijMP6/+xoQ62MNWlZb8KVMjFB8QU32oweymAvkKR/x8qDz6sKyrItTGLvM021uBMctYnrkrDaMVqdMbwu4K2bD5STJby/Q82M/24WMHX0CGPq9KCDYMFK24MJB//b+V4l4i3jDQpgsDbsclhAmDttreFg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=aKxpga72nqPY4sgEjHuulPIqRAsInboxIb0rF9uA1/4=;
 b=h7hFharNKOIgAjsPykpAH2SpFuSYAbeuUbhdlFMozmWclNMfDwxRD/rozUKmK6J4oHMim44u/ecnEyOzAWQ3xa7pp0euvKTUT7hr990MocGoCk84QYSkPAXK1mLZFQ768w+dKaTGObQRT3RvLzCbPrFcoX3sJSdhajundbH011ah1vlDz5qUWF0prZNsknta4zWXSaccbQEBA8rd6jYywRRARPWhi0uw6D0zmWdW3YTBXdAXXBnvSc5rMrFYOuqi93uwFeAYZ7vt7K0staQUZrBRUTam0eDVD7E05Hx8Az9EpbbW9UK3z6T5G4VhG6Ma8BNAH8DcFapTeOwViRJsUQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=aKxpga72nqPY4sgEjHuulPIqRAsInboxIb0rF9uA1/4=;
 b=M0PYPUY7yEOqU9lQLxMW5qFRr5O3phckIzZFWRhvGFeiwN+rz2EAfgq7i0nFfWQ1AHAbJ8UYuOyVXow3Ih8X6asyy88rB4lpuAa4kJ6zJ9iTHo9jeLaby6tV2I9WAOmaLYprPgUkd3pToka+ST9fZe6I9r6kDB954R6+mRY3JjU=
From: Rahul Singh <Rahul.Singh@arm.com>
To: Juergen Gross <jgross@suse.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, "linux-kernel@vger.kernel.org"
	<linux-kernel@vger.kernel.org>, Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, David Woodhouse <dwmw@amazon.co.uk>, Jane
 Malalane <jane.malalane@citrix.com>
Subject: Re: [PATCH v3] xen/evtchn: Introduce new IOCTL to bind static evtchn
Thread-Topic: [PATCH v3] xen/evtchn: Introduce new IOCTL to bind static evtchn
Thread-Index: AQHZuWtwf8IRAxHBCk+t/yOpmXpN2a/NKtwAgAAqfQA=
Date: Thu, 27 Jul 2023 08:27:22 +0000
Message-ID: <5EB0D195-8DEF-4817-89DC-62BAEB888720@arm.com>
References:
 <ae7329bf1713f83e4aad4f3fa0f316258c40a3e9.1689677042.git.rahul.singh@arm.com>
 <270ed8f7-c645-502e-39c5-c93823037b9c@suse.com>
In-Reply-To: <270ed8f7-c645-502e-39c5-c93823037b9c@suse.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AS8PR08MB7158:EE_|GV1PR08MB7364:EE_|AM7EUR03FT007:EE_|AM9PR08MB6004:EE_
X-MS-Office365-Filtering-Correlation-Id: 032d36ee-8285-48a5-d6ec-08db8e7b53d9
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 P1zpJMGgpurO2DQUlna42pz++yajc5J5TyoQ3Sog1QoqTrAn5iKJB37MxmR0rZzZCo+1iC0oRBbjtxQHZWw9ua9S+kzrjwpVynphChJUQRLMLiPmFzFgPcSEUs/hJTgl3HeUS/98RHjsSAtl+xXSwxUKi7NSVeO+UB4A+VmWk76Z1r3/oVpzd/GiKuouCuXbUVAo/W4Mszufv4sxkwtNifIyJ5ynYiV3Jbpx+81jDYUlsIZpIn46GQzo3yLp7+xpgiFl4gWZZJ44aewZqhrtWprolar3TMxHk6/o3CUB13werLRb4/1exobqIoMuY6JdpcDDrjTXIkJz01xsCy6zjvqI+KatZebcvENlfFrIgtBNBWBeQhNkEBRuFvJeGZNmaavZEuOtjFci11mgvDIFr8T8sRXuRsr5KqdDunw6VAxKrZWFi/ZAoC9T8oGMUUrGUi86XkVMUUHL4Sr0OBKiLGl2OWAy0zJcAXqvOl14Spaazm/UxAze5I2sIUIF8gf0AOOl1EKXhj9X294xI2KNWNoWHFoepMiy0WYW8fg9Z4fhsrxWrpyro+6NZ8yzLxN8AZpIynxMrpGmAUWtbruWQPD/0Qg5ev5D5moIYH4ZU+lNf515UY/s7QjoV8hYfnkcjAjx11In7o1o3tkKb6niEg==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB7158.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(366004)(136003)(396003)(376002)(39860400002)(451199021)(83380400001)(54906003)(5660300002)(2906002)(2616005)(6486002)(38070700005)(71200400001)(53546011)(26005)(86362001)(6512007)(38100700002)(91956017)(478600001)(122000001)(41300700001)(316002)(66446008)(186003)(66556008)(66946007)(66476007)(76116006)(64756008)(6506007)(33656002)(6916009)(8676002)(8936002)(36756003)(4326008)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <22E9F541B7EE654BA363FABC7684315D@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB7364
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT007.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	95435532-9fb3-406f-aa17-08db8e7b4d20
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	a+plm0jjeyzo4+3fGjtblnPOWwhpq7H6TcjWzxFsAQmUPjuEtDsgGPKi08frD6XJVEv2OPdu56Hi1A6ocpaIvRAEUlqxiFJAKfntp6dTW/ochwlwaXWRk9Jby2Qel50Rmv+/xPzvDkSLljVBvtGEOUu6PqTH2lUnHrzfayw89DTPGC8yEG7MasbMPs0NUH2JBUm6LZYmk6RbpgmUuHyLO44owFnCPJn5v4DvzlIXSyNtZXlwAGPQCJ2uHw8558bhFKHG5PbLL6ftr2UYrZujEZ7PXdkBCzKg8gzAplMBLf1e8i2bnyL+VziJu82rqZeDVU02BcAkCB609Su6M8S0l/1ynG5j45JdwixWCpQu9Bx/+6v2MGAbalXOvZ7nzpi2R5oORtwD9+6CgCzL9dHq6IbAMGn70HcXLTeqIeWsxreDWDxcJ0iHJls9dJkzvNz33Plei2GWffFSIn4I7tqFfoiG3DQqW4pxBrWl89cWa8QpOwxZtW/5BUkWtBukzHV4QT/k3K64qrPOAqzdznXJYvPzQxAsoX8ICM4Y9lgN3RyuU6vQPjJzlh9ddZ4jOMuV741Yu1vW4d7JwGeeqXJzgsUxKLC2xRE4WKQoiswaXb78ZF+bfYQ2Zgz3dgpu/XLMuLH3MLvjijZOpYajqZ6WQ0fBemtUBVo3IIZyXAi7TzfyOSGdG4rdHeUMFMekD2r1XjcctZ+mEemxFOgI4gV68t65T23e8JnuCK+q76DGpCMr3tIm0sD14zI2kRemSIwm
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(39860400002)(376002)(396003)(82310400008)(451199021)(36840700001)(40470700004)(46966006)(6486002)(6512007)(54906003)(478600001)(83380400001)(36860700001)(86362001)(40460700003)(36756003)(33656002)(40480700001)(6862004)(53546011)(2906002)(2616005)(47076005)(107886003)(336012)(6506007)(26005)(186003)(82740400003)(81166007)(70586007)(316002)(70206006)(4326008)(41300700001)(8936002)(356005)(8676002)(5660300002);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 08:27:34.1339
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 032d36ee-8285-48a5-d6ec-08db8e7b53d9
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT007.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6004

SEkgSnVlcmdlbiwNCg0KPiBPbiAyNyBKdWwgMjAyMywgYXQgNjo1NCBhbSwgSnVlcmdlbiBHcm9z
cyA8amdyb3NzQHN1c2UuY29tPiB3cm90ZToNCj4gDQo+IE9uIDE4LjA3LjIzIDEzOjMxLCBSYWh1
bCBTaW5naCB3cm90ZToNCj4+IFhlbiA0L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IHRvIHJlbW92ZSB0aGUgb3Blbi1jb2RlZCB2ZXJzaW9uIG9mIHRoZQ0KPj4gZXZ0Y2huIGNs
b3NlIGluIGRyaXZlcnMveGVuL2V2dGNobi5jIGZpbGUgYW5kIHVzZSB4ZW5fZXZ0Y2huX2Nsb3Nl
KCkuDQo+PiBTaWduZWQtb2ZmLWJ5OiBSYWh1bCBTaW5naCA8cmFodWwuc2luZ2hAYXJtLmNvbT4N
Cj4gDQo+IFB1c2hlZCB0byB4ZW4vdGlwLmdpdCBmb3ItbGludXMtNi41YQ0KDQpUaGFua3MuDQoN
ClJlZ2FyZHMsDQpSYWh1bA0KDQo=


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:36:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:36:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570952.893579 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwTY-0007Vn-Th; Thu, 27 Jul 2023 08:36:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570952.893579; Thu, 27 Jul 2023 08:36:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwTY-0007Vg-Pd; Thu, 27 Jul 2023 08:36:00 +0000
Received: by outflank-mailman (input) for mailman id 570952;
 Thu, 27 Jul 2023 08:30:11 +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
 <SRS0=1hVV=DN=kernel.org=dlemoal@srs-se1.protection.inumbo.net>)
 id 1qOwNv-0007OS-Hd
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:30:11 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cb3228f2-2c57-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 10:30:09 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 6549661D96;
 Thu, 27 Jul 2023 08:30:07 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06711C433C7;
 Thu, 27 Jul 2023 08:30:02 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cb3228f2-2c57-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690446606;
	bh=lgMwb11ItIJ27YCsuj2akQ0e0AMgpISaoiuOUrGiITY=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=Tr4M7HQ3pxhso0Q/eg4xKtwD0lUURtq4zUL2WnDxbX7YJArr/oNtVx0HKmYWbVJCj
	 uZ3CjjOq76HigUmfxsBIfU5BJp2UCC8gXysiCMyY4oUiNa0NyuYtXgOb+GgYI2e2UD
	 q/DMid3QMY2nJGias56vfjnyYrQ2kAGyvOg7az/lKKcQPYsllW1cAnQl1FfA/ktsaA
	 ypQoOxGNqaMUpP2GFbXa8+1QKt5gSsrAShH7O9rxadTFuFxweU5IvbZDayprJj2afQ
	 IGlbjA9TtQP0FcoHyTXu4yjcQ81VS0g2mOFp+HrXHsn6/kAwTiNlXyj4HVftm6tXbg
	 kxbv5Cd7EwHzQ==
Message-ID: <baaf7de4-9a0e-b953-2b6a-46e60c415614@kernel.org>
Date: Thu, 27 Jul 2023 17:30:01 +0900
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 28/49] dm zoned: dynamically allocate the dm-zoned-meta
 shrinker
Content-Language: en-US
To: Qi Zheng <zhengqi.arch@bytedance.com>, akpm@linux-foundation.org,
 david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz, roman.gushchin@linux.dev,
 djwong@kernel.org, brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu,
 steven.price@arm.com, cel@kernel.org, senozhatsky@chromium.org,
 yujie.liu@intel.com, gregkh@linuxfoundation.org, muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 Muchun Song <songmuchun@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
 <20230727080502.77895-29-zhengqi.arch@bytedance.com>
From: Damien Le Moal <dlemoal@kernel.org>
Organization: Western Digital Research
In-Reply-To: <20230727080502.77895-29-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 7/27/23 17:04, Qi Zheng wrote:
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the dm-zoned-meta shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct dmz_metadata.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> Reviewed-by: Muchun Song <songmuchun@bytedance.com>
> ---
>  drivers/md/dm-zoned-metadata.c | 28 ++++++++++++++++------------
>  1 file changed, 16 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c
> index 9d3cca8e3dc9..0bcb26a43578 100644
> --- a/drivers/md/dm-zoned-metadata.c
> +++ b/drivers/md/dm-zoned-metadata.c
> @@ -187,7 +187,7 @@ struct dmz_metadata {
>  	struct rb_root		mblk_rbtree;
>  	struct list_head	mblk_lru_list;
>  	struct list_head	mblk_dirty_list;
> -	struct shrinker		mblk_shrinker;
> +	struct shrinker		*mblk_shrinker;
>  
>  	/* Zone allocation management */
>  	struct mutex		map_lock;
> @@ -615,7 +615,7 @@ static unsigned long dmz_shrink_mblock_cache(struct dmz_metadata *zmd,
>  static unsigned long dmz_mblock_shrinker_count(struct shrinker *shrink,
>  					       struct shrink_control *sc)
>  {
> -	struct dmz_metadata *zmd = container_of(shrink, struct dmz_metadata, mblk_shrinker);
> +	struct dmz_metadata *zmd = shrink->private_data;
>  
>  	return atomic_read(&zmd->nr_mblks);
>  }
> @@ -626,7 +626,7 @@ static unsigned long dmz_mblock_shrinker_count(struct shrinker *shrink,
>  static unsigned long dmz_mblock_shrinker_scan(struct shrinker *shrink,
>  					      struct shrink_control *sc)
>  {
> -	struct dmz_metadata *zmd = container_of(shrink, struct dmz_metadata, mblk_shrinker);
> +	struct dmz_metadata *zmd = shrink->private_data;
>  	unsigned long count;
>  
>  	spin_lock(&zmd->mblk_lock);
> @@ -2936,19 +2936,23 @@ int dmz_ctr_metadata(struct dmz_dev *dev, int num_dev,
>  	 */
>  	zmd->min_nr_mblks = 2 + zmd->nr_map_blocks + zmd->zone_nr_bitmap_blocks * 16;
>  	zmd->max_nr_mblks = zmd->min_nr_mblks + 512;
> -	zmd->mblk_shrinker.count_objects = dmz_mblock_shrinker_count;
> -	zmd->mblk_shrinker.scan_objects = dmz_mblock_shrinker_scan;
> -	zmd->mblk_shrinker.seeks = DEFAULT_SEEKS;
>  
>  	/* Metadata cache shrinker */
> -	ret = register_shrinker(&zmd->mblk_shrinker, "dm-zoned-meta:(%u:%u)",
> -				MAJOR(dev->bdev->bd_dev),
> -				MINOR(dev->bdev->bd_dev));
> -	if (ret) {
> -		dmz_zmd_err(zmd, "Register metadata cache shrinker failed");
> +	zmd->mblk_shrinker = shrinker_alloc(0,  "dm-zoned-meta:(%u:%u)",
> +					    MAJOR(dev->bdev->bd_dev),
> +					    MINOR(dev->bdev->bd_dev));
> +	if (!zmd->mblk_shrinker) {
> +		dmz_zmd_err(zmd, "Allocate metadata cache shrinker failed");

ret is not set here, so dmz_ctr_metadata() will return success. You need to add:
		ret = -ENOMEM;
or something.
>  		goto err;
>  	}
>  
> +	zmd->mblk_shrinker->count_objects = dmz_mblock_shrinker_count;
> +	zmd->mblk_shrinker->scan_objects = dmz_mblock_shrinker_scan;
> +	zmd->mblk_shrinker->seeks = DEFAULT_SEEKS;
> +	zmd->mblk_shrinker->private_data = zmd;
> +
> +	shrinker_register(zmd->mblk_shrinker);

I fail to see how this new shrinker API is better... Why isn't there a
shrinker_alloc_and_register() function ? That would avoid adding all this code
all over the place as the new API call would be very similar to the current
shrinker_register() call with static allocation.

> +
>  	dmz_zmd_info(zmd, "DM-Zoned metadata version %d", zmd->sb_version);
>  	for (i = 0; i < zmd->nr_devs; i++)
>  		dmz_print_dev(zmd, i);
> @@ -2995,7 +2999,7 @@ int dmz_ctr_metadata(struct dmz_dev *dev, int num_dev,
>   */
>  void dmz_dtr_metadata(struct dmz_metadata *zmd)
>  {
> -	unregister_shrinker(&zmd->mblk_shrinker);
> +	shrinker_free(zmd->mblk_shrinker);
>  	dmz_cleanup_metadata(zmd);
>  	kfree(zmd);
>  }

-- 
Damien Le Moal
Western Digital Research



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 08:55:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 08:55:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570959.893588 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwmh-0001h6-GA; Thu, 27 Jul 2023 08:55:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570959.893588; Thu, 27 Jul 2023 08:55:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwmh-0001gz-DS; Thu, 27 Jul 2023 08:55:47 +0000
Received: by outflank-mailman (input) for mailman id 570959;
 Thu, 27 Jul 2023 08:55:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOwmf-0001gt-5i
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 08:55:45 +0000
Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com
 [2607:f8b0:4864:20::430])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5dea95f4-2c5b-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 10:55:43 +0200 (CEST)
Received: by mail-pf1-x430.google.com with SMTP id
 d2e1a72fcca58-6748a616e17so192451b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 01:55:43 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 iy15-20020a170903130f00b001bbb1eec92esm1023927plb.281.2023.07.27.01.55.30
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 27 Jul 2023 01:55:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5dea95f4-2c5b-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690448142; x=1691052942;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=WiPjRg1/kjwO6K5zl232SDHPqYtmZOtFvHbsJXMq+7g=;
        b=Umb+YV+a9lWFhAL8II9iFkMStUOOBYcco6VfVBA99lXKZrqzVwUjfYjnKm4Dm0LFjT
         qdoJauj14z5/Q/ALZNZe4hty9eUQzFUzAPUNYhh89WT1GQpVMRyZmNBBpLKeWi1ZbclH
         LZhMvQeV3S/E/ICy+9O5ITOO1Phn4D+1/k/6DGPG+fLuYZVwP+5BQnq4IpnQhN9xTXZe
         rfTcvD1n0zxeVBrWB1YcR+3kK3++SSPnDRJs7hwNhsakSHiwU6PBsTieOJN2pDWuMDWg
         xnIMDcCLv5tsUy7qwBc5TOF+eIq3rIHBy6gcXooMjKSZ0a9wuV4u6V1UPp0vjKeCWB6q
         aakQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690448142; x=1691052942;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=WiPjRg1/kjwO6K5zl232SDHPqYtmZOtFvHbsJXMq+7g=;
        b=TM61EoSrZOqF6bNXSRPH9jWi4WMEonYIj6xLN2RDAPC8LVYgLU4nFt2Sd1nTclO4O3
         5Vf8IpwzGKhFEhAQhV67CjUVhztPGXCtCKFNKbbWBodQWx225ZIXw5U/H0O9MuBLD8TK
         yRbd2yYagApumgQL7nx6xnigs76atehjgWnHI0xK6h8qP5qbS5hTXfCAg3GC4tMJf8d8
         Jr+z6pURiGZo1K6LyLKCQLO3QktyUuDuI0qMgVVFwb7msy5g9nd0ju1ZU/wy11jmHKXc
         VtMksua1Xrfjc0N2Qqp0onRqeGGbKVavmU8B4efoZ1rqDJk6G7shigtvxBw07VV0OEps
         fLkg==
X-Gm-Message-State: ABy/qLa3L9FaOOMS3duzIQIFtynBiB4WrJIe2oOSxCc8T5zRmgY63wvB
	H1UDB9CboAdf6YASJgY4WyGD6uCtlrcnvm/VBEE=
X-Google-Smtp-Source: APBJJlGwmdjot/rbtwF9nTotnOmqaOAtVmCVUqRrFxhkDx7eGx5gFUYRsJSjv9frk6zdjI0egP1lkA==
X-Received: by 2002:a17:902:e891:b0:1b3:d4bb:3515 with SMTP id w17-20020a170902e89100b001b3d4bb3515mr5854967plg.0.1690448141745;
        Thu, 27 Jul 2023 01:55:41 -0700 (PDT)
Message-ID: <56ee1d92-28ee-81cb-9c41-6ca7ea6556b0@bytedance.com>
Date: Thu, 27 Jul 2023 16:55:27 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 28/49] dm zoned: dynamically allocate the dm-zoned-meta
 shrinker
Content-Language: en-US
To: Damien Le Moal <dlemoal@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 Muchun Song <songmuchun@bytedance.com>, akpm@linux-foundation.org,
 david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz, roman.gushchin@linux.dev,
 djwong@kernel.org, brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu,
 steven.price@arm.com, cel@kernel.org, senozhatsky@chromium.org,
 yujie.liu@intel.com, gregkh@linuxfoundation.org, muchun.song@linux.dev
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
 <20230727080502.77895-29-zhengqi.arch@bytedance.com>
 <baaf7de4-9a0e-b953-2b6a-46e60c415614@kernel.org>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <baaf7de4-9a0e-b953-2b6a-46e60c415614@kernel.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 2023/7/27 16:30, Damien Le Moal wrote:
> On 7/27/23 17:04, Qi Zheng wrote:
>> In preparation for implementing lockless slab shrink, use new APIs to
>> dynamically allocate the dm-zoned-meta shrinker, so that it can be freed
>> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
>> read-side critical section when releasing the struct dmz_metadata.
>>
>> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
>> Reviewed-by: Muchun Song <songmuchun@bytedance.com>
>> ---
>>   drivers/md/dm-zoned-metadata.c | 28 ++++++++++++++++------------
>>   1 file changed, 16 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c
>> index 9d3cca8e3dc9..0bcb26a43578 100644
>> --- a/drivers/md/dm-zoned-metadata.c
>> +++ b/drivers/md/dm-zoned-metadata.c
>> @@ -187,7 +187,7 @@ struct dmz_metadata {
>>   	struct rb_root		mblk_rbtree;
>>   	struct list_head	mblk_lru_list;
>>   	struct list_head	mblk_dirty_list;
>> -	struct shrinker		mblk_shrinker;
>> +	struct shrinker		*mblk_shrinker;
>>   
>>   	/* Zone allocation management */
>>   	struct mutex		map_lock;
>> @@ -615,7 +615,7 @@ static unsigned long dmz_shrink_mblock_cache(struct dmz_metadata *zmd,
>>   static unsigned long dmz_mblock_shrinker_count(struct shrinker *shrink,
>>   					       struct shrink_control *sc)
>>   {
>> -	struct dmz_metadata *zmd = container_of(shrink, struct dmz_metadata, mblk_shrinker);
>> +	struct dmz_metadata *zmd = shrink->private_data;
>>   
>>   	return atomic_read(&zmd->nr_mblks);
>>   }
>> @@ -626,7 +626,7 @@ static unsigned long dmz_mblock_shrinker_count(struct shrinker *shrink,
>>   static unsigned long dmz_mblock_shrinker_scan(struct shrinker *shrink,
>>   					      struct shrink_control *sc)
>>   {
>> -	struct dmz_metadata *zmd = container_of(shrink, struct dmz_metadata, mblk_shrinker);
>> +	struct dmz_metadata *zmd = shrink->private_data;
>>   	unsigned long count;
>>   
>>   	spin_lock(&zmd->mblk_lock);
>> @@ -2936,19 +2936,23 @@ int dmz_ctr_metadata(struct dmz_dev *dev, int num_dev,
>>   	 */
>>   	zmd->min_nr_mblks = 2 + zmd->nr_map_blocks + zmd->zone_nr_bitmap_blocks * 16;
>>   	zmd->max_nr_mblks = zmd->min_nr_mblks + 512;
>> -	zmd->mblk_shrinker.count_objects = dmz_mblock_shrinker_count;
>> -	zmd->mblk_shrinker.scan_objects = dmz_mblock_shrinker_scan;
>> -	zmd->mblk_shrinker.seeks = DEFAULT_SEEKS;
>>   
>>   	/* Metadata cache shrinker */
>> -	ret = register_shrinker(&zmd->mblk_shrinker, "dm-zoned-meta:(%u:%u)",
>> -				MAJOR(dev->bdev->bd_dev),
>> -				MINOR(dev->bdev->bd_dev));
>> -	if (ret) {
>> -		dmz_zmd_err(zmd, "Register metadata cache shrinker failed");
>> +	zmd->mblk_shrinker = shrinker_alloc(0,  "dm-zoned-meta:(%u:%u)",
>> +					    MAJOR(dev->bdev->bd_dev),
>> +					    MINOR(dev->bdev->bd_dev));
>> +	if (!zmd->mblk_shrinker) {
>> +		dmz_zmd_err(zmd, "Allocate metadata cache shrinker failed");
> 
> ret is not set here, so dmz_ctr_metadata() will return success. You need to add:
> 		ret = -ENOMEM;
> or something.

Indeed, will fix.

>>   		goto err;
>>   	}
>>   
>> +	zmd->mblk_shrinker->count_objects = dmz_mblock_shrinker_count;
>> +	zmd->mblk_shrinker->scan_objects = dmz_mblock_shrinker_scan;
>> +	zmd->mblk_shrinker->seeks = DEFAULT_SEEKS;
>> +	zmd->mblk_shrinker->private_data = zmd;
>> +
>> +	shrinker_register(zmd->mblk_shrinker);
> 
> I fail to see how this new shrinker API is better... Why isn't there a
> shrinker_alloc_and_register() function ? That would avoid adding all this code
> all over the place as the new API call would be very similar to the current
> shrinker_register() call with static allocation.

In some registration scenarios, memory needs to be allocated in advance.
So we continue to use the previous prealloc/register_prepared()
algorithm. The shrinker_alloc_and_register() is just a helper function
that combines the two, and this increases the number of APIs that
shrinker exposes to the outside, so I choose not to add this helper.

Thanks,
Qi

> 
>> +
>>   	dmz_zmd_info(zmd, "DM-Zoned metadata version %d", zmd->sb_version);
>>   	for (i = 0; i < zmd->nr_devs; i++)
>>   		dmz_print_dev(zmd, i);
>> @@ -2995,7 +2999,7 @@ int dmz_ctr_metadata(struct dmz_dev *dev, int num_dev,
>>    */
>>   void dmz_dtr_metadata(struct dmz_metadata *zmd)
>>   {
>> -	unregister_shrinker(&zmd->mblk_shrinker);
>> +	shrinker_free(zmd->mblk_shrinker);
>>   	dmz_cleanup_metadata(zmd);
>>   	kfree(zmd);
>>   }
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 09:07:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 09:07:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570961.893599 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwxp-0003Gn-G4; Thu, 27 Jul 2023 09:07:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570961.893599; Thu, 27 Jul 2023 09:07:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwxp-0003Gg-Ch; Thu, 27 Jul 2023 09:07:17 +0000
Received: by outflank-mailman (input) for mailman id 570961;
 Thu, 27 Jul 2023 09:07:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOwxo-0003Ga-Hb
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 09:07:16 +0000
Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com
 [2607:f8b0:4864:20::434])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f9d91b61-2c5c-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 11:07:14 +0200 (CEST)
Received: by mail-pf1-x434.google.com with SMTP id
 d2e1a72fcca58-66d6a9851f3so176603b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 02:07:14 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 a11-20020a170902ee8b00b001b7e63cfa19sm1063627pld.234.2023.07.27.02.07.00
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 27 Jul 2023 02:07:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f9d91b61-2c5c-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690448833; x=1691053633;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=UKiGuCYavgdrONYSlKU+hjlx/AzCB2LKMORbFgw7HEo=;
        b=DjrROq91sf6Va+7++jhnZLLfMfZ3NpR+vs103Gffs3+O08HW6byjEgnIqMIjx7XVVU
         6Esw8LCCRNx5FIzgZD2yLlNtiJ3fWUXbMzLdc62rKZLebfjHSG7L7jgEMl0D1hE7ZoNg
         HZ2c9Q9i+LL0tt0iImhvHFOK+Hduw2G0dP+6wK+guSG8W2Nz3BegBODQY1lmNQJ14Dz4
         uuXi2h/k5/64PvGOHou6Defqpklm1cGUHs8RqpArf+xI1YmvbpRswY34ry3JAORO90Jx
         4NSzh0j5w+vqWxK/Ia35MiibA4wNxyya8QHOgB3QIdRRJ50Wt48gZu09EVgownqRkh1E
         f6DQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690448833; x=1691053633;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=UKiGuCYavgdrONYSlKU+hjlx/AzCB2LKMORbFgw7HEo=;
        b=lzowHeMegd9YBC1uLkS7sQaTfX9g6yVzKfecE+6CLfK208ahA6XG8QtfTjXBxRGd16
         fmjSkyBuIFe/NO1EReSYwHgb0P56BSq1E/zUzd6QqhzfPnwgQg/K5mFGj0VjFnyHqb4/
         1dNmr1pHCBVrcdhXRYRLuPh6k3eO4inOqbhRt/i0XTZeVWoQaO6ntZTKXaN9pd3P43Vv
         kdlAfhqSMJiIwT4TvaCMxVbQIdglUJ3rMkq2JjbMLh7orYU5gW+yFGsHNHFDm+w/rxa8
         mg5oy5cS5CFAsISn9C3mt1LP60EFWDF0CofkgCapKycPjByJulkmtSxa/P/7Z2S63S3t
         QRhA==
X-Gm-Message-State: ABy/qLbSln4JN0SM4nLDMy6DBpyVZAKTOfSOJfIYwG3mVzPXgfHOWWb7
	eZuMxCxshLEdneaEEiPrtEZJGQ==
X-Google-Smtp-Source: APBJJlEquEzidizjgrmS1e55j2UU3CMKKyxPnlaVqAXQYQ+ePfvdxx8A4f9JU/BbmCjGKzVhoGuchQ==
X-Received: by 2002:a17:90a:128e:b0:263:25f9:65b2 with SMTP id g14-20020a17090a128e00b0026325f965b2mr4139877pja.4.1690448832920;
        Thu, 27 Jul 2023 02:07:12 -0700 (PDT)
Message-ID: <19461737-db63-2ab5-110b-e65035881ae2@bytedance.com>
Date: Thu, 27 Jul 2023 17:06:57 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 15/49] nfs: dynamically allocate the nfs-acl shrinker
Content-Language: en-US
To: akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru,
 vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org,
 brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com,
 cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com,
 gregkh@linuxfoundation.org, muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 Muchun Song <songmuchun@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
 <20230727080502.77895-16-zhengqi.arch@bytedance.com>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <20230727080502.77895-16-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 2023/7/27 16:04, Qi Zheng wrote:
> Use new APIs to dynamically allocate the nfs-acl shrinker.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> Reviewed-by: Muchun Song <songmuchun@bytedance.com>
> ---
>   fs/nfs/super.c | 20 ++++++++++++--------
>   1 file changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
> index 2284f749d892..072d82e1be06 100644
> --- a/fs/nfs/super.c
> +++ b/fs/nfs/super.c
> @@ -129,11 +129,7 @@ static void nfs_ssc_unregister_ops(void)
>   }
>   #endif /* CONFIG_NFS_V4_2 */
>   
> -static struct shrinker acl_shrinker = {
> -	.count_objects	= nfs_access_cache_count,
> -	.scan_objects	= nfs_access_cache_scan,
> -	.seeks		= DEFAULT_SEEKS,
> -};
> +static struct shrinker *acl_shrinker;
>   
>   /*
>    * Register the NFS filesystems
> @@ -153,9 +149,17 @@ int __init register_nfs_fs(void)
>   	ret = nfs_register_sysctl();
>   	if (ret < 0)
>   		goto error_2;
> -	ret = register_shrinker(&acl_shrinker, "nfs-acl");
> -	if (ret < 0)
> +
> +	acl_shrinker = shrinker_alloc(0, "nfs-acl");
> +	if (!acl_shrinker)
>   		goto error_3;

Here should set ret to -ENOMEM, will fix.

> +
> +	acl_shrinker->count_objects = nfs_access_cache_count;
> +	acl_shrinker->scan_objects = nfs_access_cache_scan;
> +	acl_shrinker->seeks = DEFAULT_SEEKS;
> +
> +	shrinker_register(acl_shrinker);
> +
>   #ifdef CONFIG_NFS_V4_2
>   	nfs_ssc_register_ops();
>   #endif
> @@ -175,7 +179,7 @@ int __init register_nfs_fs(void)
>    */
>   void __exit unregister_nfs_fs(void)
>   {
> -	unregister_shrinker(&acl_shrinker);
> +	shrinker_free(acl_shrinker);
>   	nfs_unregister_sysctl();
>   	unregister_nfs4_fs();
>   #ifdef CONFIG_NFS_V4_2


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 09:09:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 09:09:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570963.893609 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwzd-0003rC-Ql; Thu, 27 Jul 2023 09:09:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570963.893609; Thu, 27 Jul 2023 09:09:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOwzd-0003r5-NY; Thu, 27 Jul 2023 09:09:09 +0000
Received: by outflank-mailman (input) for mailman id 570963;
 Thu, 27 Jul 2023 09:09:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOwzc-0003qs-6d
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 09:09:08 +0000
Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com
 [2607:f8b0:4864:20::42e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3d072c08-2c5d-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 11:09:07 +0200 (CEST)
Received: by mail-pf1-x42e.google.com with SMTP id
 d2e1a72fcca58-686f74a8992so86526b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 02:09:07 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 f17-20020a635551000000b00563ea47c948sm930669pgm.53.2023.07.27.02.08.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 27 Jul 2023 02:09:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3d072c08-2c5d-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690448946; x=1691053746;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=4HPzHhawuqBHwf73jZH4M+rJ1h4rzhX4x1A5fzulUtE=;
        b=XVbZZB1bCuIddvCOd7ZdoZjiMRRT7dPd70cLEHChe028013CtZN4CJhyjaofMQGOCp
         aGQjkAdZJwrw0kO7FWCF+3wJu4Bs3hfpCHjXHte7v9cy4EJx3v2HSegV5fKDUggsvKcE
         rfw3ctmBIqNX3YVyLliz70Ow03c79YTqviRSUBhyV37ISoYoH05fZe12pteMem3zIYaK
         h5yTEuui+F8UDLetCnDn4Wd0BNAlUwOjTRf0Uzpr8uRBgvycDrHuoECz5/KoSjtrxNcd
         VFQA9eIykS0N+Aj/4rgCWZN2Q01gf7n56+E22JNqNX6qv8VxHS7PwBWWAHU3NZ4I85Kn
         Kvtw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690448946; x=1691053746;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=4HPzHhawuqBHwf73jZH4M+rJ1h4rzhX4x1A5fzulUtE=;
        b=SnjpS4AKFqclMXkqp99AnsAhy5ll4x5RNA5aYr2StEvgdBNpQlfuy7u5RMuDqAZmhv
         A7tWy+cxQOUsT9CpZN5IWXO+OS/8hKHIK73/bbTpztvnTpKf6cVN/2AJYUh6IBklZM76
         9c5uxel9XtVZqvFo473YU821NKvq6Rb80RA1MNp0WQIyXxuUTVjINKw5DIOhTbsI29oh
         1Do3zzPM7jObJbNnnky1ugq/Hgr2nCNkWbBlRz/cYGF8YbVf/3zkYg9y0jc12D64cVwp
         F4CWr7phJIrEGX2b2LsgIbCEBUwtGVj9eIm1zfcHwZWhrfa0ng4iZKBViGNhqKseZVwt
         KabQ==
X-Gm-Message-State: ABy/qLaIAfl+QpjikRJZHvDgu75UxuqSye2N44DEYBVEF1jeTkpeCIGT
	A/Rj9HTWN9j4xxOjkQvsiDfR6g==
X-Google-Smtp-Source: APBJJlGcM2GBnp4i4GpCfKYembVJdmGwthtzp39QltAoTiMbksVAbVCn2LuGL8UI/2xPGfcHp3vTrQ==
X-Received: by 2002:a05:6a20:1595:b0:137:30db:bc1e with SMTP id h21-20020a056a20159500b0013730dbbc1emr5836590pzj.3.1690448945731;
        Thu, 27 Jul 2023 02:09:05 -0700 (PDT)
Message-ID: <8951e9da-15ae-f05e-a9a4-a9354249cee2@bytedance.com>
Date: Thu, 27 Jul 2023 17:08:52 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 16/49] nfsd: dynamically allocate the nfsd-filecache
 shrinker
Content-Language: en-US
To: akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru,
 vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org,
 brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com,
 cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com,
 gregkh@linuxfoundation.org, muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 Muchun Song <songmuchun@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
 <20230727080502.77895-17-zhengqi.arch@bytedance.com>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <20230727080502.77895-17-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 2023/7/27 16:04, Qi Zheng wrote:
> Use new APIs to dynamically allocate the nfsd-filecache shrinker.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> Reviewed-by: Muchun Song <songmuchun@bytedance.com>
> ---
>   fs/nfsd/filecache.c | 22 ++++++++++++----------
>   1 file changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
> index ee9c923192e0..872eb9501965 100644
> --- a/fs/nfsd/filecache.c
> +++ b/fs/nfsd/filecache.c
> @@ -521,11 +521,7 @@ nfsd_file_lru_scan(struct shrinker *s, struct shrink_control *sc)
>   	return ret;
>   }
>   
> -static struct shrinker	nfsd_file_shrinker = {
> -	.scan_objects = nfsd_file_lru_scan,
> -	.count_objects = nfsd_file_lru_count,
> -	.seeks = 1,
> -};
> +static struct shrinker *nfsd_file_shrinker;
>   
>   /**
>    * nfsd_file_cond_queue - conditionally unhash and queue a nfsd_file
> @@ -746,12 +742,18 @@ nfsd_file_cache_init(void)
>   		goto out_err;
>   	}
>   
> -	ret = register_shrinker(&nfsd_file_shrinker, "nfsd-filecache");
> -	if (ret) {
> -		pr_err("nfsd: failed to register nfsd_file_shrinker: %d\n", ret);
> +	nfsd_file_shrinker = shrinker_alloc(0, "nfsd-filecache");
> +	if (!nfsd_file_shrinker) {

Here should set ret to -ENOMEM, will fix.

> +		pr_err("nfsd: failed to allocate nfsd_file_shrinker\n");
>   		goto out_lru;
>   	}
>   
> +	nfsd_file_shrinker->count_objects = nfsd_file_lru_count;
> +	nfsd_file_shrinker->scan_objects = nfsd_file_lru_scan;
> +	nfsd_file_shrinker->seeks = 1;
> +
> +	shrinker_register(nfsd_file_shrinker);
> +
>   	ret = lease_register_notifier(&nfsd_file_lease_notifier);
>   	if (ret) {
>   		pr_err("nfsd: unable to register lease notifier: %d\n", ret);
> @@ -774,7 +776,7 @@ nfsd_file_cache_init(void)
>   out_notifier:
>   	lease_unregister_notifier(&nfsd_file_lease_notifier);
>   out_shrinker:
> -	unregister_shrinker(&nfsd_file_shrinker);
> +	shrinker_free(nfsd_file_shrinker);
>   out_lru:
>   	list_lru_destroy(&nfsd_file_lru);
>   out_err:
> @@ -891,7 +893,7 @@ nfsd_file_cache_shutdown(void)
>   		return;
>   
>   	lease_unregister_notifier(&nfsd_file_lease_notifier);
> -	unregister_shrinker(&nfsd_file_shrinker);
> +	shrinker_free(nfsd_file_shrinker);
>   	/*
>   	 * make sure all callers of nfsd_file_lru_cb are done before
>   	 * calling nfsd_file_cache_purge


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 09:11:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 09:11:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570966.893619 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOx1h-0005L9-A9; Thu, 27 Jul 2023 09:11:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570966.893619; Thu, 27 Jul 2023 09:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOx1h-0005L2-77; Thu, 27 Jul 2023 09:11:17 +0000
Received: by outflank-mailman (input) for mailman id 570966;
 Thu, 27 Jul 2023 09:11:15 +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
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOx1f-0005Kp-Oe
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 09:11:15 +0000
Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com
 [2607:f8b0:4864:20::434])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 88509f7e-2c5d-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 11:11:13 +0200 (CEST)
Received: by mail-pf1-x434.google.com with SMTP id
 d2e1a72fcca58-66d6a9851f3so177066b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 02:11:13 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 h4-20020aa786c4000000b00682a99b01basm1038080pfo.0.2023.07.27.02.11.00
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 27 Jul 2023 02:11:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 88509f7e-2c5d-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690449072; x=1691053872;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=cACJ3NT7rSPHksG1CSCDv/QZVUluNTqq4KXvaW886oI=;
        b=lKnOasFRjAEbGh7P40XbzLKtOkahlmVFUDvqCWW3ZgaRuzNJSwp4sTaKgMwNwz+Jpc
         hA4nVDJPH5aqf4q8bVxcWLUkzXpK23oeAFnlJRwJaEUIleLrrgs7btXzJpx3+9HaPfQV
         hGIP/T6lERVA8hpdk6KZN9Q4J/+wilHe5ZItz/9QQ1qHO3gv2Y4k+BaS5cDcOKz/WLAL
         6NaRvNv6KF2mZ19RDXY6rbQZ5sQKyx2Yj2LrfaBgxjqmYdHbumQCN0WmWtbB+gjDIGzm
         PXmUTQGLOY5T8H3PnVo3H27NG4eQhipuKvHt4yAhK97ujnI+IJGqA8lmlUO0fy4wYeay
         +oXw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690449072; x=1691053872;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=cACJ3NT7rSPHksG1CSCDv/QZVUluNTqq4KXvaW886oI=;
        b=cLKYmsXoIJjzMKxts0wtJh2wUb10a7ZVCMI7xdczE7FlZwA5awcabiq6hvyr9yGjfs
         yrSGm0ch4XMkssaMbq/BqAUSswZs26l/NbZDxztObVTPW4pUjyCzMZyGa1Kv+93neSQJ
         lvYqC0MSNEoeCi3aQ2IGAExPiDMO/s9rNSz+dp1uyjuesxinCL+M1cse51Plbp+hjxjp
         lgJt/qPouQIqGBKt5xWTvdC7aZa1xQI5HVP2l0XPWOoRb1wvFQZkApVg/75S4DAGjwzC
         CzMUoo8xHaDWVmuw5Rm4hGLRj6yOIioZqehqON3GD2KAclvB4NwrjoCm8I2vdIriTGuC
         BQGA==
X-Gm-Message-State: ABy/qLbTJGCg63TK4Iiey55p3meKgb8/gK5dCaJnJ93mdlMjClADr+3f
	Uhc1h9RcicKGzzC2+GUJxqpZkQ==
X-Google-Smtp-Source: APBJJlFfFWIsc+pfSeu4dzuDSzimKXTbXaekoL0gFKsbHel8kB/qljY4u0PtyM2mUW/wDh3jQGEPVg==
X-Received: by 2002:a05:6a00:2d82:b0:675:8627:a291 with SMTP id fb2-20020a056a002d8200b006758627a291mr4692915pfb.3.1690449072033;
        Thu, 27 Jul 2023 02:11:12 -0700 (PDT)
Message-ID: <1eb30b9e-c43b-b81e-4d96-5d6fa4f2894a@bytedance.com>
Date: Thu, 27 Jul 2023 17:10:57 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 22/49] sunrpc: dynamically allocate the sunrpc_cred
 shrinker
Content-Language: en-US
To: akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru,
 vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org,
 brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com,
 cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com,
 gregkh@linuxfoundation.org, muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 Muchun Song <songmuchun@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
 <20230727080502.77895-23-zhengqi.arch@bytedance.com>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <20230727080502.77895-23-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 2023/7/27 16:04, Qi Zheng wrote:
> Use new APIs to dynamically allocate the sunrpc_cred shrinker.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> Reviewed-by: Muchun Song <songmuchun@bytedance.com>
> ---
>   net/sunrpc/auth.c | 19 +++++++++++--------
>   1 file changed, 11 insertions(+), 8 deletions(-)
> 
> diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
> index 2f16f9d17966..6b898b1be6f5 100644
> --- a/net/sunrpc/auth.c
> +++ b/net/sunrpc/auth.c
> @@ -861,11 +861,7 @@ rpcauth_uptodatecred(struct rpc_task *task)
>   		test_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) != 0;
>   }
>   
> -static struct shrinker rpc_cred_shrinker = {
> -	.count_objects = rpcauth_cache_shrink_count,
> -	.scan_objects = rpcauth_cache_shrink_scan,
> -	.seeks = DEFAULT_SEEKS,
> -};
> +static struct shrinker *rpc_cred_shrinker;
>   
>   int __init rpcauth_init_module(void)
>   {
> @@ -874,9 +870,16 @@ int __init rpcauth_init_module(void)
>   	err = rpc_init_authunix();
>   	if (err < 0)
>   		goto out1;
> -	err = register_shrinker(&rpc_cred_shrinker, "sunrpc_cred");
> -	if (err < 0)
> +	rpc_cred_shrinker = shrinker_alloc(0, "sunrpc_cred");
> +	if (!rpc_cred_shrinker)

Here should set err to -ENOMEM, will fix.

>   		goto out2;
> +
> +	rpc_cred_shrinker->count_objects = rpcauth_cache_shrink_count;
> +	rpc_cred_shrinker->scan_objects = rpcauth_cache_shrink_scan;
> +	rpc_cred_shrinker->seeks = DEFAULT_SEEKS;
> +
> +	shrinker_register(rpc_cred_shrinker);
> +
>   	return 0;
>   out2:
>   	rpc_destroy_authunix();
> @@ -887,5 +890,5 @@ int __init rpcauth_init_module(void)
>   void rpcauth_remove_module(void)
>   {
>   	rpc_destroy_authunix();
> -	unregister_shrinker(&rpc_cred_shrinker);
> +	shrinker_free(rpc_cred_shrinker);
>   }


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 09:13:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 09:13:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570968.893629 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOx3l-0005ub-Lu; Thu, 27 Jul 2023 09:13:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570968.893629; Thu, 27 Jul 2023 09:13:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOx3l-0005uU-J9; Thu, 27 Jul 2023 09:13:25 +0000
Received: by outflank-mailman (input) for mailman id 570968;
 Thu, 27 Jul 2023 09:13:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOx3k-0005uO-2e
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 09:13:24 +0000
Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com
 [2607:f8b0:4864:20::42d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d59d9c3a-2c5d-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 11:13:23 +0200 (CEST)
Received: by mail-pf1-x42d.google.com with SMTP id
 d2e1a72fcca58-6862d4a1376so201875b3a.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 02:13:23 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 m26-20020a056a00165a00b006687b41c4dasm1017146pfc.110.2023.07.27.02.13.09
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 27 Jul 2023 02:13:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d59d9c3a-2c5d-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690449201; x=1691054001;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=ab3i02uMNDVjAVrJgavtDQnv7B+TbSMr9u4LPtdCXIk=;
        b=DcofMrRnwJynNkdGxtjH9DqKXau2yqZGatjPtAtzn+O56nMmwXuVd7ToeAQUojKhyr
         PVIHt52Ove4HfRkW5Jz6nWPZD9BmVLc7SbBBPIeMe8wFyfKaQIk+EbU0k3nRPfOKNwBh
         oCNv2ZD1HFVJTkxvMKWyxXL9Onk9dGrGolbp1H25aJz81J4GYNUwPghcXVGUuE5zAHUa
         mP22aBPwBQ4pP/D5mY0ghxG8TnuQLNORwYORdeX0ZvQJ20+Z3LaIninEXnknTqruUQCo
         Za3jxS8cFIItCGBaY6f3hGkZx+gttPFDrR9vIxhOGVxid7Al6RP9znkmq9WOz9AcYgeV
         IdKg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690449201; x=1691054001;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=ab3i02uMNDVjAVrJgavtDQnv7B+TbSMr9u4LPtdCXIk=;
        b=fthJEdtmsB1QaLFQOlFBVrF4sIbMNLBpvE22HbmRn5VSURtWDq4DC6U0dOp1bin6ZU
         z2hutfU8yQOwhtPYwJfSLxS6mZt31O4INdO7D4yDtlIW7cSh9MQnqxZyHDolGnVUlBTs
         a7ajzrnZwJ18oWsOwpX8rLbrTJ+H/FaS2ELsYwu1T195tZA5yS9KwzCyPlfDgJyOMuAJ
         5oVxuwvu9bK52cNMnlDOLHaY08vJKgonw2dlNojMD18v48XRxRlG+0LrFpfA1awSTMxc
         vyAUdBjPM48uTmzNt1yCXtpB3KzQng5eoKYKC44hV/p9AzNsB+oh4Fl8cgqU+2EChmGI
         5nng==
X-Gm-Message-State: ABy/qLaPKovRhSPXiYr62WJOgcsD61RW8yyGnp9iAuQawbNgELEwq14H
	IAfUIsgO8sUiFS1oJDtc+1sfrw==
X-Google-Smtp-Source: APBJJlGBn5Xl2QFHzxgRMihSAaLd28csKz8Em946xGdOgBfe3ljiGqu5+YaMyvDFvdIkqmZPd3zpbQ==
X-Received: by 2002:a05:6a00:4792:b0:668:834d:4bd with SMTP id dh18-20020a056a00479200b00668834d04bdmr4787709pfb.0.1690449201600;
        Thu, 27 Jul 2023 02:13:21 -0700 (PDT)
Message-ID: <961f6055-a395-8490-4c22-765a30668460@bytedance.com>
Date: Thu, 27 Jul 2023 17:13:07 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 27/49] dm: dynamically allocate the dm-bufio shrinker
Content-Language: en-US
To: akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru,
 vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org,
 brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com,
 cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com,
 gregkh@linuxfoundation.org, muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 Muchun Song <songmuchun@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
 <20230727080502.77895-28-zhengqi.arch@bytedance.com>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <20230727080502.77895-28-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 2023/7/27 16:04, Qi Zheng wrote:
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the dm-bufio shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct dm_bufio_client.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> Reviewed-by: Muchun Song <songmuchun@bytedance.com>
> ---
>   drivers/md/dm-bufio.c | 26 +++++++++++++++-----------
>   1 file changed, 15 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
> index bc309e41d074..5a9124b83d53 100644
> --- a/drivers/md/dm-bufio.c
> +++ b/drivers/md/dm-bufio.c
> @@ -963,7 +963,7 @@ struct dm_bufio_client {
>   
>   	sector_t start;
>   
> -	struct shrinker shrinker;
> +	struct shrinker *shrinker;
>   	struct work_struct shrink_work;
>   	atomic_long_t need_shrink;
>   
> @@ -2368,7 +2368,7 @@ static unsigned long dm_bufio_shrink_scan(struct shrinker *shrink, struct shrink
>   {
>   	struct dm_bufio_client *c;
>   
> -	c = container_of(shrink, struct dm_bufio_client, shrinker);
> +	c = shrink->private_data;
>   	atomic_long_add(sc->nr_to_scan, &c->need_shrink);
>   	queue_work(dm_bufio_wq, &c->shrink_work);
>   
> @@ -2377,7 +2377,7 @@ static unsigned long dm_bufio_shrink_scan(struct shrinker *shrink, struct shrink
>   
>   static unsigned long dm_bufio_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
>   {
> -	struct dm_bufio_client *c = container_of(shrink, struct dm_bufio_client, shrinker);
> +	struct dm_bufio_client *c = shrink->private_data;
>   	unsigned long count = cache_total(&c->cache);
>   	unsigned long retain_target = get_retain_buffers(c);
>   	unsigned long queued_for_cleanup = atomic_long_read(&c->need_shrink);
> @@ -2490,15 +2490,19 @@ struct dm_bufio_client *dm_bufio_client_create(struct block_device *bdev, unsign
>   	INIT_WORK(&c->shrink_work, shrink_work);
>   	atomic_long_set(&c->need_shrink, 0);
>   
> -	c->shrinker.count_objects = dm_bufio_shrink_count;
> -	c->shrinker.scan_objects = dm_bufio_shrink_scan;
> -	c->shrinker.seeks = 1;
> -	c->shrinker.batch = 0;
> -	r = register_shrinker(&c->shrinker, "dm-bufio:(%u:%u)",
> -			      MAJOR(bdev->bd_dev), MINOR(bdev->bd_dev));
> -	if (r)
> +	c->shrinker = shrinker_alloc(0, "dm-bufio:(%u:%u)",
> +				     MAJOR(bdev->bd_dev), MINOR(bdev->bd_dev));
> +	if (!c->shrinker)

Here should set r to -ENOMEM, will fix.

>   		goto bad;
>   
> +	c->shrinker->count_objects = dm_bufio_shrink_count;
> +	c->shrinker->scan_objects = dm_bufio_shrink_scan;
> +	c->shrinker->seeks = 1;
> +	c->shrinker->batch = 0;
> +	c->shrinker->private_data = c;
> +
> +	shrinker_register(c->shrinker);
> +
>   	mutex_lock(&dm_bufio_clients_lock);
>   	dm_bufio_client_count++;
>   	list_add(&c->client_list, &dm_bufio_all_clients);
> @@ -2537,7 +2541,7 @@ void dm_bufio_client_destroy(struct dm_bufio_client *c)
>   
>   	drop_buffers(c);
>   
> -	unregister_shrinker(&c->shrinker);
> +	shrinker_free(c->shrinker);
>   	flush_work(&c->shrink_work);
>   
>   	mutex_lock(&dm_bufio_clients_lock);


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 09:16:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 09:16:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570970.893639 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOx6J-0006WI-49; Thu, 27 Jul 2023 09:16:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570970.893639; Thu, 27 Jul 2023 09:16:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOx6J-0006WB-0e; Thu, 27 Jul 2023 09:16:03 +0000
Received: by outflank-mailman (input) for mailman id 570970;
 Thu, 27 Jul 2023 09:16:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOx6H-0006W3-OP
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 09:16:01 +0000
Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com
 [2607:f8b0:4864:20::102c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 336a3921-2c5e-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 11:16:00 +0200 (CEST)
Received: by mail-pj1-x102c.google.com with SMTP id
 98e67ed59e1d1-2659b1113c2so146151a91.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 02:16:00 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 bv21-20020a17090af19500b0026596b8f33asm2403500pjb.40.2023.07.27.02.15.47
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 27 Jul 2023 02:15:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 336a3921-2c5e-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690449359; x=1691054159;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=pSf6nVkdhsvxhtXxVh7cgsa4dxLg7VE+dk8AIIS4uIA=;
        b=gs/PU4tG46kQg+lGivKEpQm67BWRBr/3B5K5J0ZjcDJiH4VmN/xAYLr567/KvCeKyO
         Sxv9KoDe1Fgjt2T5xGL5ntjIo2URj6N4iyAFFdnIg9R3abku7q3pHpjtx5uyfVGaAvYO
         XtiYYOqXBfNiFu1rjUbVMMYVt5QxVT4/F43UKIFaCuAs9bCstLLngxCL3ODWliEci9Sz
         ElL4V2hOOxLgo9+060cMLFPSS0lDlqR1ZhVgYCnGDkIpUHSxXftLLIhthhd9SgFzYboG
         fvp5YOTqEFeGRzV75GGLb7yIHnFGlXJ5ArnypIHw3PlhSwR6sQo5O1DaMDPfX3YeBn9C
         fAww==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690449359; x=1691054159;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=pSf6nVkdhsvxhtXxVh7cgsa4dxLg7VE+dk8AIIS4uIA=;
        b=fJ4/dWij66tWksR/xcFrpCclGqxY18+hz+1hjug2wunDzMGwx0ikuPkyh/lbDOU2Gq
         Vbf2ztuhOND94d65GoUC+28CIAg8RfCLPvnnuTm+KgzzJQdaB0Fdofuus1AI8wYPXo5x
         Qjkm6/Q/xBCPnZiD5AXVddRdrVXkHRBBEEmqfzi1gQc2HQ9B6tHu6dzQ7sa/Q0Hcz9xA
         ET13mE2KdtmQCLR5lfsjix997NFFAD92g92i/Po0MxM/Wgwmjj4Fz4VSxr81EYXU8C18
         xKoqmGXrQRWj8O2d+A3j1ojosXoESkGPR8oT+d60VcgL73vlwQ/kdqXCP1moTVn4xvDI
         bmFA==
X-Gm-Message-State: ABy/qLZQtAz7k8zGaUFNfd3JusQllEpHZ2tzuyYftu0lyRmEpKyAV6Ni
	V5JwkLTZL22PSlJjrLtGz5Xslw==
X-Google-Smtp-Source: APBJJlFWNasuQyGNPy0hcIGkgu46yCpujoddgwDeBo2nmYNJTDqcdO/STO03uju2nKSJGm9+FY3b7g==
X-Received: by 2002:a17:90a:7c48:b0:268:38a7:842e with SMTP id e8-20020a17090a7c4800b0026838a7842emr4155117pjl.2.1690449358970;
        Thu, 27 Jul 2023 02:15:58 -0700 (PDT)
Message-ID: <8f8aa0d6-8f5c-958d-096d-d4c6d3e71e7a@bytedance.com>
Date: Thu, 27 Jul 2023 17:15:44 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 29/49] md/raid5: dynamically allocate the md-raid5
 shrinker
Content-Language: en-US
To: akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru,
 vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org,
 brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com,
 cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com,
 gregkh@linuxfoundation.org, muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 Muchun Song <songmuchun@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
 <20230727080502.77895-30-zhengqi.arch@bytedance.com>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <20230727080502.77895-30-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 2023/7/27 16:04, Qi Zheng wrote:
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the md-raid5 shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct r5conf.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> Reviewed-by: Muchun Song <songmuchun@bytedance.com>
> ---
>   drivers/md/raid5.c | 25 ++++++++++++++-----------
>   drivers/md/raid5.h |  2 +-
>   2 files changed, 15 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index 85b3004594e0..fbb4e6f5ff43 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -7414,7 +7414,7 @@ static void free_conf(struct r5conf *conf)
>   
>   	log_exit(conf);
>   
> -	unregister_shrinker(&conf->shrinker);
> +	shrinker_free(conf->shrinker);
>   	free_thread_groups(conf);
>   	shrink_stripes(conf);
>   	raid5_free_percpu(conf);
> @@ -7462,7 +7462,7 @@ static int raid5_alloc_percpu(struct r5conf *conf)
>   static unsigned long raid5_cache_scan(struct shrinker *shrink,
>   				      struct shrink_control *sc)
>   {
> -	struct r5conf *conf = container_of(shrink, struct r5conf, shrinker);
> +	struct r5conf *conf = shrink->private_data;
>   	unsigned long ret = SHRINK_STOP;
>   
>   	if (mutex_trylock(&conf->cache_size_mutex)) {
> @@ -7483,7 +7483,7 @@ static unsigned long raid5_cache_scan(struct shrinker *shrink,
>   static unsigned long raid5_cache_count(struct shrinker *shrink,
>   				       struct shrink_control *sc)
>   {
> -	struct r5conf *conf = container_of(shrink, struct r5conf, shrinker);
> +	struct r5conf *conf = shrink->private_data;
>   
>   	if (conf->max_nr_stripes < conf->min_nr_stripes)
>   		/* unlikely, but not impossible */
> @@ -7718,18 +7718,21 @@ static struct r5conf *setup_conf(struct mddev *mddev)
>   	 * it reduces the queue depth and so can hurt throughput.
>   	 * So set it rather large, scaled by number of devices.
>   	 */
> -	conf->shrinker.seeks = DEFAULT_SEEKS * conf->raid_disks * 4;
> -	conf->shrinker.scan_objects = raid5_cache_scan;
> -	conf->shrinker.count_objects = raid5_cache_count;
> -	conf->shrinker.batch = 128;
> -	conf->shrinker.flags = 0;
> -	ret = register_shrinker(&conf->shrinker, "md-raid5:%s", mdname(mddev));
> -	if (ret) {
> -		pr_warn("md/raid:%s: couldn't register shrinker.\n",
> +	conf->shrinker = shrinker_alloc(0, "md-raid5:%s", mdname(mddev));
> +	if (!conf->shrinker) {

Here should set ret to -ENOMEM, will fix.

> +		pr_warn("md/raid:%s: couldn't allocate shrinker.\n",
>   			mdname(mddev));
>   		goto abort;
>   	}
>   
> +	conf->shrinker->seeks = DEFAULT_SEEKS * conf->raid_disks * 4;
> +	conf->shrinker->scan_objects = raid5_cache_scan;
> +	conf->shrinker->count_objects = raid5_cache_count;
> +	conf->shrinker->batch = 128;
> +	conf->shrinker->private_data = conf;
> +
> +	shrinker_register(conf->shrinker);
> +
>   	sprintf(pers_name, "raid%d", mddev->new_level);
>   	rcu_assign_pointer(conf->thread,
>   			   md_register_thread(raid5d, mddev, pers_name));
> diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h
> index 97a795979a35..22bea20eccbd 100644
> --- a/drivers/md/raid5.h
> +++ b/drivers/md/raid5.h
> @@ -670,7 +670,7 @@ struct r5conf {
>   	wait_queue_head_t	wait_for_stripe;
>   	wait_queue_head_t	wait_for_overlap;
>   	unsigned long		cache_state;
> -	struct shrinker		shrinker;
> +	struct shrinker		*shrinker;
>   	int			pool_size; /* number of disks in stripeheads in pool */
>   	spinlock_t		device_lock;
>   	struct disk_info	*disks;


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 09:16:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 09:16:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570971.893649 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOx6Q-0006nb-BI; Thu, 27 Jul 2023 09:16:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570971.893649; Thu, 27 Jul 2023 09:16:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOx6Q-0006nU-8N; Thu, 27 Jul 2023 09:16:10 +0000
Received: by outflank-mailman (input) for mailman id 570971;
 Thu, 27 Jul 2023 09:16:09 +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
 <SRS0=o85N=DN=citrix.com=prvs=5659ebe79=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qOx6P-0006nD-R0
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 09:16:09 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 35d13b47-2c5e-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 11:16:05 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 35d13b47-2c5e-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690449365;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=btc558rjz9ZQrySV2UKToDcsFfhkolEBCXRy8DW+EXU=;
  b=AdXreoqK3lxtp9JYxV/lr1vRBD/Kr1OdqQVEDEH7sYnS1zKepifz8iY6
   n25XldulGLeGiWIzultvZk/SIAyTF8P0LwzTPrO6Bq8albGzUrBiHL9PB
   FNwTPDBlgWb7Eq7gRXgWDQ8HyRDVDam+Te0MjffyUW+ZSD5XBhYYUg7m5
   Q=;
Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 116312952
X-Ironport-Server: esa5.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:n2P0jqJOnQugFi9DFE+RAJUlxSXFcZb7ZxGr2PjKsXjdYENS3mAFm
 mAeWGuHO/2CZ2f3eo8ibYy29BtX6JTXzdRhSQRlqX01Q3x08seUX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3NXqJhS5hbHNE0JfB8yRLXLtDG49GKMBsIOh4rLc4pRO2J
 tFcE/i97j10Ymyv01wggVPV9eSOqDzDadqyAheY
IronPort-HdrOrdr: A9a23:FNrn+6yhh3TK8eZ3XRgRKrPxU+skLtp133Aq2lEZdPWaSL3iqy
 nOpoVr6faQslwssR4b6La90cW7MArhHNtOkPQs1NSZLXfbURWTXftfBOLZqlWKJ8S9zJ8g6U
 4KSdkANDSfNykDsS842mWFOudl7t+A/qWlwc/a1HtkQBEvQ7pr7gdnBgvzKCxLbTgDK5w+Gp
 +RouJDvDapdGRSRt+wB3kbU+WGicbMiIujQRNuPX4aAcu14A+A2frVFR6X2xtbfjVEhZcumF
 K18DDR1+GMtfe0zxOZ82PI9ZxZlJ/c0d4rPr3otiHYEFrRozftSoJmVbiP+A01u+2m5RILnb
 D30nUdFvU2xXXWcGS45SbtwAXp3XIT8HqK8y79vVLT5eL+Qjw+B45+iYkcWB7Y50081esMt5
 6jFlj2i6Zq
X-Talos-CUID: =?us-ascii?q?9a23=3AhvK/0Gmm35Kr+oZ45a6ihseKjWXXOWf2w12NKnG?=
 =?us-ascii?q?CNTlgV7S3a2DAp7M+zNU7zg=3D=3D?=
X-Talos-MUID: =?us-ascii?q?9a23=3A7kLfPgzxWoQoZ3TWJ9NkXiyzZs6aqOe/On8Il48?=
 =?us-ascii?q?KgfuFJRB3JGagrRGZGLZyfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,234,1684814400"; 
   d="scan'208";a="116312952"
Date: Thu, 27 Jul 2023 10:15:53 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Jason Andryuk <jandryuk@gmail.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>,
	"Julien Grall" <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>, <xen-devel@lists.xenproject.org>
Subject: Re: [XEN PATCH v2 4/5] build: evaluate XEN_BUILD_* and XEN_DOMAIN on
 first use
Message-ID: <b74752d6-54b2-4dd1-88a9-c23ceb014e56@perard>
References: <20230622153005.31604-1-anthony.perard@citrix.com>
 <20230622153005.31604-5-anthony.perard@citrix.com>
 <edc3f2b5-8722-7f11-f759-b87d71a840ef@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <edc3f2b5-8722-7f11-f759-b87d71a840ef@suse.com>

On Fri, Jun 23, 2023 at 10:07:02AM +0200, Jan Beulich wrote:
> On 22.06.2023 17:30, Anthony PERARD wrote:
> > --- a/xen/Makefile
> > +++ b/xen/Makefile
> > @@ -11,10 +11,10 @@ export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
> >  -include xen-version
> >  
> >  export XEN_WHOAMI	?= $(USER)
> > -export XEN_DOMAIN	?= $(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))
> > -export XEN_BUILD_DATE	?= $(shell LC_ALL=C date)
> > -export XEN_BUILD_TIME	?= $(shell LC_ALL=C date +%T)
> > -export XEN_BUILD_HOST	?= $(shell hostname)
> > +export XEN_DOMAIN	?= $(eval XEN_DOMAIN := $(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown])))$(XEN_DOMAIN)
> > +export XEN_BUILD_DATE	?= $(eval XEN_BUILD_DATE := $(shell LC_ALL=C date))$(XEN_BUILD_DATE)
> > +export XEN_BUILD_TIME	?= $(eval XEN_BUILD_TIME := $(shell LC_ALL=C date +%T))$(XEN_BUILD_TIME)
> > +export XEN_BUILD_HOST	?= $(eval XEN_BUILD_HOST := $(shell hostname))$(XEN_BUILD_HOST)
> 
> Interesting approach. It looks like it should be independent of make's
> internal workings, but I still wonder: Is this documented somewhere,
> so we won't be caught by surprise of it not working anymore because of
> some change to make's internals?

So, this is a makefile trick that I've seen on someone's blog post.

But I tried to find evidence in the GNU make manual if variable expansion is
expected to work like that, and I can't. So I can imagine one day make
doing expansion of variable in parallel, or were the result of the eval
would happen only on the next line. So I don't know if this approach is
always going to work.

Maybe we could go for a safer alternative:

Simply replacing ?= by something actually documented in the manual, and
then replacing = by := .

    ifeq ($(origin XEN_BUILD_DATE), undefined)
    export XEN_BUILD_DATE := $(shell LC_ALL=C date)
    endif

An alternative, with a macro could be:

    set-shell-if-undef = $(if $(filter undefined,$(origin $(1))),$(eval $(1) := $(shell $(2))))

    $(call set-shell-if-undef,XEN_BUILD_DATE,LC_ALL=C date)
    export XEN_BUILD_DATE

But this kind of hide that a shell command is been called. But having
$(shell) as parameter of call $(call) mean the shell command is always
called even when unneeded.

But then, with the macro, I'm not sure where to put it, to be able to
use it here and in Config.mk for the next patch, another file in
xen.git/config/*.mk ?

Should I replace all the eval with "ifeq (); endif" ?

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 09:17:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 09:17:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570975.893659 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOx86-0007gr-S0; Thu, 27 Jul 2023 09:17:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570975.893659; Thu, 27 Jul 2023 09:17:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOx86-0007gi-P9; Thu, 27 Jul 2023 09:17:54 +0000
Received: by outflank-mailman (input) for mailman id 570975;
 Thu, 27 Jul 2023 09:17:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOx85-0007gW-E1
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 09:17:53 +0000
Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com
 [2607:f8b0:4864:20::62a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 75641255-2c5e-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 11:17:51 +0200 (CEST)
Received: by mail-pl1-x62a.google.com with SMTP id
 d9443c01a7336-1bb91c20602so949045ad.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 02:17:51 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 x3-20020a170902ea8300b001b8c3c7b102sm1099792plb.127.2023.07.27.02.17.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 27 Jul 2023 02:17:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 75641255-2c5e-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690449470; x=1691054270;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=zDAeke9dPI5F1DLlt143+V+9EjjOTI/Ym3kFZW9NJks=;
        b=GMz7Ro63z/YezVqKkIH1jrxAzOT75QcUy09pRQPD7AgfWuYvUeuW5VEqNC1XIv9vFN
         mRwt8c6aGV8kgK9lP5FEKupjXOG/bSxCUR1Wt+sQMg8uYMaVdTfESuVXyke/16/L/yN6
         lgXVNg46bwMvdgDL/au4WPig1MVEHeG5wVY0ujpNjiLSHIkveiLIrECL7sZMPk2KN/og
         cOXK7BC9rcgfo0JQrpwRHwvNtz6wdTJySW4bqDUFHi4zdm4Oj9K7/OLBxIv3WQBH67f1
         OvlGd9tRajLpgSW70SF8ktMkDj4Bt1BHUDLO+7r2qg+4O9VtPvpOqNWx1A6uYkZBjzBr
         UEhA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690449470; x=1691054270;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=zDAeke9dPI5F1DLlt143+V+9EjjOTI/Ym3kFZW9NJks=;
        b=EtBuADm/twQrO0pNUjMntqNEENGiqo5DRuyel3MpmqAEBYHpdzwqBDk0OFFtN+w1WB
         aawgPM+PXyuhFx7KihZt+vrv7mHLU1JIl3poezn3SaO3aoeqJu6O1qV5JureXW72BXg6
         WH1QI+316ZQS++IaRRD90ACdKBI+RhrEudy1wBzc/Ei3sBnhU2RIxcfaLd0nqGZvsfKS
         jBkuQxXP0IvieRMY0GJkEJjytPBdOoaw0Il/oBkLnk7gO+VutQywAtKjkok5RcbAl4SE
         jiz05gQBo21BQ1NJCQa+jcqSio1J7bGywovACuHLx3WdttoD0yFNBNuoDUQFx8Bj97Yy
         m/zA==
X-Gm-Message-State: ABy/qLbnawjpWZVBDf4BXgxsGC6jQ221nJSQ5Zg5JF9cbWRYNBh0R7nR
	+fD31Gh+1h9WDkuv8k6dNIxuTw==
X-Google-Smtp-Source: APBJJlEO2aWJnLprK4RcTuXXptsAhhV2CWniExK2SV0FTWirST2PpjxVowXAUeeRM51pJjQHZWKeBg==
X-Received: by 2002:a17:902:dac6:b0:1b8:9fc4:2733 with SMTP id q6-20020a170902dac600b001b89fc42733mr5853252plx.3.1690449469696;
        Thu, 27 Jul 2023 02:17:49 -0700 (PDT)
Message-ID: <df02ac8e-b9b3-1582-7d11-fb5ab54f2e64@bytedance.com>
Date: Thu, 27 Jul 2023 17:17:36 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 34/49] ext4: dynamically allocate the ext4-es shrinker
Content-Language: en-US
To: akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru,
 vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org,
 brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com,
 cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com,
 gregkh@linuxfoundation.org, muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 Muchun Song <songmuchun@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
 <20230727080502.77895-35-zhengqi.arch@bytedance.com>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <20230727080502.77895-35-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 2023/7/27 16:04, Qi Zheng wrote:
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the ext4-es shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct ext4_sb_info.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> Reviewed-by: Muchun Song <songmuchun@bytedance.com>
> ---
>   fs/ext4/ext4.h           |  2 +-
>   fs/ext4/extents_status.c | 22 ++++++++++++----------
>   2 files changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> index 1e2259d9967d..82397bf0b33e 100644
> --- a/fs/ext4/ext4.h
> +++ b/fs/ext4/ext4.h
> @@ -1657,7 +1657,7 @@ struct ext4_sb_info {
>   	__u32 s_csum_seed;
>   
>   	/* Reclaim extents from extent status tree */
> -	struct shrinker s_es_shrinker;
> +	struct shrinker *s_es_shrinker;
>   	struct list_head s_es_list;	/* List of inodes with reclaimable extents */
>   	long s_es_nr_inode;
>   	struct ext4_es_stats s_es_stats;
> diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
> index 9b5b8951afb4..74bb64fadbc4 100644
> --- a/fs/ext4/extents_status.c
> +++ b/fs/ext4/extents_status.c
> @@ -1596,7 +1596,7 @@ static unsigned long ext4_es_count(struct shrinker *shrink,
>   	unsigned long nr;
>   	struct ext4_sb_info *sbi;
>   
> -	sbi = container_of(shrink, struct ext4_sb_info, s_es_shrinker);
> +	sbi = shrink->private_data;
>   	nr = percpu_counter_read_positive(&sbi->s_es_stats.es_stats_shk_cnt);
>   	trace_ext4_es_shrink_count(sbi->s_sb, sc->nr_to_scan, nr);
>   	return nr;
> @@ -1605,8 +1605,7 @@ static unsigned long ext4_es_count(struct shrinker *shrink,
>   static unsigned long ext4_es_scan(struct shrinker *shrink,
>   				  struct shrink_control *sc)
>   {
> -	struct ext4_sb_info *sbi = container_of(shrink,
> -					struct ext4_sb_info, s_es_shrinker);
> +	struct ext4_sb_info *sbi = shrink->private_data;
>   	int nr_to_scan = sc->nr_to_scan;
>   	int ret, nr_shrunk;
>   
> @@ -1690,14 +1689,17 @@ int ext4_es_register_shrinker(struct ext4_sb_info *sbi)
>   	if (err)
>   		goto err3;
>   
> -	sbi->s_es_shrinker.scan_objects = ext4_es_scan;
> -	sbi->s_es_shrinker.count_objects = ext4_es_count;
> -	sbi->s_es_shrinker.seeks = DEFAULT_SEEKS;
> -	err = register_shrinker(&sbi->s_es_shrinker, "ext4-es:%s",
> -				sbi->s_sb->s_id);
> -	if (err)
> +	sbi->s_es_shrinker = shrinker_alloc(0, "ext4-es:%s", sbi->s_sb->s_id);
> +	if (!sbi->s_es_shrinker)

Here should set err to -ENOMEM, will fix.

>   		goto err4;
>   
> +	sbi->s_es_shrinker->scan_objects = ext4_es_scan;
> +	sbi->s_es_shrinker->count_objects = ext4_es_count;
> +	sbi->s_es_shrinker->seeks = DEFAULT_SEEKS;
> +	sbi->s_es_shrinker->private_data = sbi;
> +
> +	shrinker_register(sbi->s_es_shrinker);
> +
>   	return 0;
>   err4:
>   	percpu_counter_destroy(&sbi->s_es_stats.es_stats_shk_cnt);
> @@ -1716,7 +1718,7 @@ void ext4_es_unregister_shrinker(struct ext4_sb_info *sbi)
>   	percpu_counter_destroy(&sbi->s_es_stats.es_stats_cache_misses);
>   	percpu_counter_destroy(&sbi->s_es_stats.es_stats_all_cnt);
>   	percpu_counter_destroy(&sbi->s_es_stats.es_stats_shk_cnt);
> -	unregister_shrinker(&sbi->s_es_shrinker);
> +	shrinker_free(sbi->s_es_shrinker);
>   }
>   
>   /*


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 09:20:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 09:20:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570977.893668 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOxAF-0000dS-73; Thu, 27 Jul 2023 09:20:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570977.893668; Thu, 27 Jul 2023 09:20:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOxAF-0000dL-4V; Thu, 27 Jul 2023 09:20:07 +0000
Received: by outflank-mailman (input) for mailman id 570977;
 Thu, 27 Jul 2023 09:20:05 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOxAD-0000Wp-GC
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 09:20:05 +0000
Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com
 [2607:f8b0:4864:20::535])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c4d8eff8-2c5e-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 11:20:04 +0200 (CEST)
Received: by mail-pg1-x535.google.com with SMTP id
 41be03b00d2f7-55b78bf0423so53660a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 02:20:04 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 5-20020a170902c24500b001bbb7d8fff2sm1109046plg.116.2023.07.27.02.19.50
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 27 Jul 2023 02:20:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c4d8eff8-2c5e-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690449603; x=1691054403;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=cb79b5va6gFfSJneJi5lY4rGeRwgOukMupryAUVW6kI=;
        b=YCWSTu9U7oWMIxlz666y2QG523oA3QX5qQv7ZytrRVu6fJw8dRHyUfgDIT1gU69FG8
         THUguZfsi1KeJApNPmw0jxmv7f8KFlV4UTxlH9XbeulHxoa/ldWA269gxLsqPd7fsDUL
         3wrs7fjkTjLEvVIuFKVgIWoEr+OE7ZGV4f2QptD03saCT0x1g+4lQFRHQ9ruqft2Rhft
         lQsKff8YPeqYMpcr6auHVhvyZ4A0b6O2v3t87pxn8FkR9lCy8v/ntqGuUNKm9Zf3rtD1
         Pt/WGCyBPHzJX+fw7G8Ac9jWyGkR4LQhg8QoLvoZwbFMr8CqGaDCh/cUGTEJkXif0gLU
         NqYA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690449603; x=1691054403;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=cb79b5va6gFfSJneJi5lY4rGeRwgOukMupryAUVW6kI=;
        b=WCaj/Mku0JPj1G4+bdkxKYV4fCawTs6o6O+XFJUMko2AK/7QGcOT+CzwwhCTbueEMq
         MFhS/m7nok9lcEAyaKcR1OYVTb7ONfNCLISbiEqzSZhXbGhk+ooa58JooVTfAofc+adK
         ACQ0fk4fFUGS0NCBtv9d+S4MuqQwf2bor5QIkkLWBGNY9nlpGKY7d30FLdZb984546P7
         tlJT+q8SvUzN0dTKangwW5L5ZAvFhv6hDS1OBx+Yqy8jKaCzYurluvFXTyHNknbkNyTe
         Y0+dyShOBkN79MufM+tNf36djYCERLAo1VZHRRpuLvfcvLtWbuLC7lWhotDQv0pp2u6J
         KGlA==
X-Gm-Message-State: ABy/qLYr4qEy0b69LstmAMlCja+xUgvE795ax3wnxQZyNZxMwxNC8XXB
	aK7C2J5E2ieB8EqhnNN662DBOQ==
X-Google-Smtp-Source: APBJJlH+dm0mCsob/js+yZXnXAfwEH4KDToex0aS0MQ56gbjyJxo+xxDZzOa2lZ9gy3mjvwdmWQa2g==
X-Received: by 2002:a17:902:da82:b0:1b8:811:b079 with SMTP id j2-20020a170902da8200b001b80811b079mr5785873plx.0.1690449602958;
        Thu, 27 Jul 2023 02:20:02 -0700 (PDT)
Message-ID: <5f1b85b8-3655-1700-4d16-fa056b31ceeb@bytedance.com>
Date: Thu, 27 Jul 2023 17:19:49 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 40/49] xfs: dynamically allocate the xfs-qm shrinker
Content-Language: en-US
To: akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru,
 vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org,
 brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com,
 cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com,
 gregkh@linuxfoundation.org, muchun.song@linux.dev
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 Muchun Song <songmuchun@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
 <20230727080502.77895-41-zhengqi.arch@bytedance.com>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <20230727080502.77895-41-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 2023/7/27 16:04, Qi Zheng wrote:
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the xfs-qm shrinker, so that it can be freed
> asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU
> read-side critical section when releasing the struct xfs_quotainfo.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> Reviewed-by: Muchun Song <songmuchun@bytedance.com>
> ---
>   fs/xfs/xfs_qm.c | 26 +++++++++++++-------------
>   fs/xfs/xfs_qm.h |  2 +-
>   2 files changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
> index 6abcc34fafd8..032f0a208bd2 100644
> --- a/fs/xfs/xfs_qm.c
> +++ b/fs/xfs/xfs_qm.c
> @@ -504,8 +504,7 @@ xfs_qm_shrink_scan(
>   	struct shrinker		*shrink,
>   	struct shrink_control	*sc)
>   {
> -	struct xfs_quotainfo	*qi = container_of(shrink,
> -					struct xfs_quotainfo, qi_shrinker);
> +	struct xfs_quotainfo	*qi = shrink->private_data;
>   	struct xfs_qm_isolate	isol;
>   	unsigned long		freed;
>   	int			error;
> @@ -539,8 +538,7 @@ xfs_qm_shrink_count(
>   	struct shrinker		*shrink,
>   	struct shrink_control	*sc)
>   {
> -	struct xfs_quotainfo	*qi = container_of(shrink,
> -					struct xfs_quotainfo, qi_shrinker);
> +	struct xfs_quotainfo	*qi = shrink->private_data;
>   
>   	return list_lru_shrink_count(&qi->qi_lru, sc);
>   }
> @@ -680,16 +678,18 @@ xfs_qm_init_quotainfo(
>   	if (XFS_IS_PQUOTA_ON(mp))
>   		xfs_qm_set_defquota(mp, XFS_DQTYPE_PROJ, qinf);
>   
> -	qinf->qi_shrinker.count_objects = xfs_qm_shrink_count;
> -	qinf->qi_shrinker.scan_objects = xfs_qm_shrink_scan;
> -	qinf->qi_shrinker.seeks = DEFAULT_SEEKS;
> -	qinf->qi_shrinker.flags = SHRINKER_NUMA_AWARE;
> -
> -	error = register_shrinker(&qinf->qi_shrinker, "xfs-qm:%s",
> -				  mp->m_super->s_id);
> -	if (error)
> +	qinf->qi_shrinker = shrinker_alloc(SHRINKER_NUMA_AWARE, "xfs-qm:%s",
> +					   mp->m_super->s_id);
> +	if (!qinf->qi_shrinker)

Here should set error to -ENOMEM, will fix.

>   		goto out_free_inos;
>   
> +	qinf->qi_shrinker->count_objects = xfs_qm_shrink_count;
> +	qinf->qi_shrinker->scan_objects = xfs_qm_shrink_scan;
> +	qinf->qi_shrinker->seeks = DEFAULT_SEEKS;
> +	qinf->qi_shrinker->private_data = qinf;
> +
> +	shrinker_register(qinf->qi_shrinker);
> +
>   	return 0;
>   
>   out_free_inos:
> @@ -718,7 +718,7 @@ xfs_qm_destroy_quotainfo(
>   	qi = mp->m_quotainfo;
>   	ASSERT(qi != NULL);
>   
> -	unregister_shrinker(&qi->qi_shrinker);
> +	shrinker_free(qi->qi_shrinker);
>   	list_lru_destroy(&qi->qi_lru);
>   	xfs_qm_destroy_quotainos(qi);
>   	mutex_destroy(&qi->qi_tree_lock);
> diff --git a/fs/xfs/xfs_qm.h b/fs/xfs/xfs_qm.h
> index 9683f0457d19..d5c9fc4ba591 100644
> --- a/fs/xfs/xfs_qm.h
> +++ b/fs/xfs/xfs_qm.h
> @@ -63,7 +63,7 @@ struct xfs_quotainfo {
>   	struct xfs_def_quota	qi_usr_default;
>   	struct xfs_def_quota	qi_grp_default;
>   	struct xfs_def_quota	qi_prj_default;
> -	struct shrinker		qi_shrinker;
> +	struct shrinker		*qi_shrinker;
>   
>   	/* Minimum and maximum quota expiration timestamp values. */
>   	time64_t		qi_expiry_min;


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 09:31:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 09:31:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570980.893679 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOxLU-0002LN-9k; Thu, 27 Jul 2023 09:31:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570980.893679; Thu, 27 Jul 2023 09:31:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOxLU-0002LG-5w; Thu, 27 Jul 2023 09:31:44 +0000
Received: by outflank-mailman (input) for mailman id 570980;
 Thu, 27 Jul 2023 09:31:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOxLS-0002LA-T6
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 09:31:42 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20615.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::615])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 64b413c2-2c60-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 11:31:41 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB9594.eurprd04.prod.outlook.com (2603:10a6:102:23c::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 09:31:38 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 09:31:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 64b413c2-2c60-11ee-b247-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=j6TBHZgiXLOvHuKoWpFQnAdBTaoP7F22FT6o83HrA3GgKv/FVNt9SEnJVpNi3CXvgPfXfQTetepJeyMcG51yRYWKzujrPpiQuk4hdghJQF4RQXFRMNq6wprBtNVHmu7ynrB69XagC5QvYymVbqXyBmDS1QkhxI2qhcfjOSE2KLDnKkqtyVkNFesTl50T3YXFSJczbFVnHd30GMLC170nFEjpYGebq7AvAdB3c9tKcm83Z4XfVUn2Gl3TGnhz2WygX/q1xfaGYG5www0jeBwePf8MlOQIlROTv37imvW3QnDwYFW2zuLfL2AKu54e9cYi4m8r2fC47iMvp0rIR4gCqw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=xLpJFLAgX5XwxIGAjxrlSA+u5Xi6+nr7t2qpdXlKHyA=;
 b=fRUByzQzOJjXVUhqd/5oAbB9mbVIN+Q7YskiBXYi1dcfkWlvPrbdNiDyIVbkfGGx8od+eOIvbw0Itd1HyxLMT4+3UhSp/0LYuJri6PjTe9wUlfxRr65gMjHy/wLtj7ouEXyg5zRdQwQz9ZBzM3Ua5jyWXRCMthCMhjxTR6xz5iRYBYckmZjlk/mEvFuSJKfwbaq5aoPiPMvaW66TwWWWzxP3kgLKqbVMTe0xmW+J4SQDcvHzWQhXSfqdzLi4K5IK6GVUQj3gkNFK2cUnBx02VjK62RvuDlEXc4+9XdNZtZue+vKA/TfD/tRAf5ln/Z2YL4Er/PZAIeDZFWvCVfLaKw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=xLpJFLAgX5XwxIGAjxrlSA+u5Xi6+nr7t2qpdXlKHyA=;
 b=QaOOAuksE78UG/dJRi9Wnqh77YIZ4DGoc/JNIndBUj/xsQ3PrDg3meFe6l4pqSr4aKOPQa88YP2G+cV6Iqzhn8ZGYIqKesTCYaVXUTmTS30Aq6tgp3KUx4u3zvvQ8SFNZHi3q4mpQajWffoUcvHuPB3xbXasJm8mMyVHTzveylzsyxZU5T98wgt/9zDvTQijUqAhA/soidBV4q23qmH93VOKAuSiMkfds/DUPlNPpx9sdvxN8Z7CNfXuEAwPEBmNy07bxYapTXqJfLcpy2wvBk9831GKMY+khc5MH3q/oE+gzQTXFfO54ELz89bq3FanLEY2nDO+6FxQ5HVKCRDAaA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3bd3384a-f59b-455a-f6e8-6f170e554ded@suse.com>
Date: Thu, 27 Jul 2023 11:31:35 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v2 4/5] build: evaluate XEN_BUILD_* and XEN_DOMAIN on
 first use
Content-Language: en-US
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: Jason Andryuk <jandryuk@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230622153005.31604-1-anthony.perard@citrix.com>
 <20230622153005.31604-5-anthony.perard@citrix.com>
 <edc3f2b5-8722-7f11-f759-b87d71a840ef@suse.com>
 <b74752d6-54b2-4dd1-88a9-c23ceb014e56@perard>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <b74752d6-54b2-4dd1-88a9-c23ceb014e56@perard>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0059.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:49::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB9594:EE_
X-MS-Office365-Filtering-Correlation-Id: 3aff0ea8-e7ee-4230-be42-08db8e84471c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	myJFZgKsMBJQ9v5/Ame8L2s0sqtfjN/TsynoiYOav+nYIPmDhxrls3Kq98fzKkSQzDTzmjhjVS98gf0x9VclDT+7atc/2jp8PdTPvOP3vClFCFymYw5GhZWQnuv1T3p7q1dhTl2aRpA4d3Mx4po4gPNnbJo4Q4ct+jH5sUByCm8XRYZwosTTBowoGEEO5dyIZT3bGHYaSXFTB/V4hvUS4DbiIvjtsbhP/1NA1iGkYNQMOigo8ivct+CF8OaO3P+lHKSzQQjK8iviHJKEUdvgMzOmZv6SM8ScGbPBvLxCqzXOCUFFFmU7gwCSFawFPRR0Z6L5HW6P0cUxrdOTKT4JjfLxLH0rDbV2F9Tvy1snaD1Y8xn6LvXt/nHNDAk7Wl1Qu5gpqKfDHSFhjLC1wUXqIDi3SXRxCfB1wKP31fF4PEJ4/w6mQVlzQk1FaFhc6ArTTs6WmSZjP7BcBm7P6VwVupxP9yMOzU5w1adSsVOvk40QqXVx82vt342VIT/logjXKFdiPsuVXsZM1jhQRQ9F6+Y+HXbqP75rT3HkCCtvPPLA8Mk1230DYysRqeB1ARdqRACyXyIbly+228t77le6v+8+OUf++ryhBiCjIveSi1hTHO04inDHB1kkPAp85dSL6dkNKRfGFzYVzx8+w3Fwdg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(39860400002)(136003)(376002)(396003)(451199021)(2906002)(316002)(8936002)(8676002)(5660300002)(41300700001)(36756003)(86362001)(31696002)(6486002)(6666004)(54906003)(478600001)(26005)(6506007)(53546011)(186003)(31686004)(2616005)(66946007)(66556008)(38100700002)(6512007)(66476007)(4326008)(6916009)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NkQxZEcwV0NOT3pSTi9paitmZDNObXpEbjIxdi9GNU9GM3dTQ3l4dnJVWnQx?=
 =?utf-8?B?L1hlaUkxSGd2bE5YVmdpbTNSQlhXc3g4QW9ZMDRIVHBseWJPd0p3SG5qTUh6?=
 =?utf-8?B?b1ZEWGs0TWVOWDg3SEszdWJKREE3QUlLMnFOcVJMSysvYThsZmU1a0M4SmJz?=
 =?utf-8?B?cld1WENwU1I3V2lXaysrVFhUd3M5YmEwUWtpQi9CcXplb3ZBRGFIaHM1VVRK?=
 =?utf-8?B?WEx4M2trcTJUSzhCaURZOEpNQ2tEaitpTFlSNDd5cWpCL0hrK3YyR0pZbHI5?=
 =?utf-8?B?ckYwUUd6SkcxUlk5WTZoaGNvZitjMWNtZG9SMnI3YlRiaUJ5Y0xRcUtHY3FN?=
 =?utf-8?B?ZTJwVU55S3ptVWppeExUSmx6MWErcUNMbmRGUVNGZzBiUEVtVVptUjBFU0VH?=
 =?utf-8?B?ZFJXSW5oM05NRWVxWGRxRWFHdkQ3K0NQSWx4cUpCWkI5V1RlWVppSGRkU1B1?=
 =?utf-8?B?Zk5HNkE5QmZ2V1ZPd3k1SmxMcU1jSDQ2S29leTRMOWwwS1VQTDBHRzFsc0N0?=
 =?utf-8?B?YmRWS2w5S1FicHBPeE9ZL3NqanRnT1labXBWV0F0R2plTXBBMGRVTm5GZnRr?=
 =?utf-8?B?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dS94QzRBMmhrelk4VEE2eEpv?=
 =?utf-8?B?d3o2Nk14bENNZTVDQmpicDYwc2NPem1pTENMeGkzMjRYQWVmNFdnNGYrOElN?=
 =?utf-8?B?RnpSaDZyT3E1Q1psOXlPM0s3dUh6YWpTUWI1ZktKSHZsRGdzdldudlhCaDlk?=
 =?utf-8?B?TGNmVVZtTXlvYjV0U3k2YVNSbUtSaU0xcE8vZTM3dlJUazNZS1pNWTFhSTRp?=
 =?utf-8?B?S0ZtcmJYVlFvcW9wbmY3OGc3S1VDN3dqOVUxWDh5UmVRRi9lb2RUK1hCcWov?=
 =?utf-8?B?aWZxV0dsRHQ3TlVxRzZ4b0RJM0hEakxmTW55cVBibWV0WHpJanFsbXJzdkxm?=
 =?utf-8?B?WUlRd0FRQTloTk1kSjlFaWhnV09SQnIwWDd2aXkwWm1IYkNuZzFwcUtGamF6?=
 =?utf-8?B?M2Z4R0Nab3kzMVgrbVl5MEV0aTRQREdiVE1FTzBUTm5ySjBhWGpmWnpKZGZt?=
 =?utf-8?B?bU1ieTIyTlc4b09yYzlMRjdTS1NtQ1dwbTFYcDZieFR1aW5rSFZ1Zk9HSnN6?=
 =?utf-8?B?N29zUmVzdGhQUWNxRFpiRUNzNmVIUTdMN2pMS2FHRzN5YTlST2VQa0lBSnR0?=
 =?utf-8?B?NGw2Wk52YXVsVkEyT0JaZFB2c1dJZkg5Q01CVy9NRFZDSUpXcXlQQW84MC9s?=
 =?utf-8?Q?/P85qKZvHAzGb/p0Qz+rczW3a?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3aff0ea8-e7ee-4230-be42-08db8e84471c
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 09:31:38.4377
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: gYHjNG4fisoyxtUyi3+6F28bKDWYwg9oyS0UzhF9RXR3yoNSHndWlWOJPTgJDxW5bJfEvA2Ies2GTkU9dNm4Yg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9594

On 27.07.2023 11:15, Anthony PERARD wrote:
> On Fri, Jun 23, 2023 at 10:07:02AM +0200, Jan Beulich wrote:
>> On 22.06.2023 17:30, Anthony PERARD wrote:
>>> --- a/xen/Makefile
>>> +++ b/xen/Makefile
>>> @@ -11,10 +11,10 @@ export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
>>>  -include xen-version
>>>  
>>>  export XEN_WHOAMI	?= $(USER)
>>> -export XEN_DOMAIN	?= $(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))
>>> -export XEN_BUILD_DATE	?= $(shell LC_ALL=C date)
>>> -export XEN_BUILD_TIME	?= $(shell LC_ALL=C date +%T)
>>> -export XEN_BUILD_HOST	?= $(shell hostname)
>>> +export XEN_DOMAIN	?= $(eval XEN_DOMAIN := $(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown])))$(XEN_DOMAIN)
>>> +export XEN_BUILD_DATE	?= $(eval XEN_BUILD_DATE := $(shell LC_ALL=C date))$(XEN_BUILD_DATE)
>>> +export XEN_BUILD_TIME	?= $(eval XEN_BUILD_TIME := $(shell LC_ALL=C date +%T))$(XEN_BUILD_TIME)
>>> +export XEN_BUILD_HOST	?= $(eval XEN_BUILD_HOST := $(shell hostname))$(XEN_BUILD_HOST)
>>
>> Interesting approach. It looks like it should be independent of make's
>> internal workings, but I still wonder: Is this documented somewhere,
>> so we won't be caught by surprise of it not working anymore because of
>> some change to make's internals?
> 
> So, this is a makefile trick that I've seen on someone's blog post.
> 
> But I tried to find evidence in the GNU make manual if variable expansion is
> expected to work like that, and I can't. So I can imagine one day make
> doing expansion of variable in parallel, or were the result of the eval
> would happen only on the next line. So I don't know if this approach is
> always going to work.
> 
> Maybe we could go for a safer alternative:
> 
> Simply replacing ?= by something actually documented in the manual, and
> then replacing = by := .
> 
>     ifeq ($(origin XEN_BUILD_DATE), undefined)
>     export XEN_BUILD_DATE := $(shell LC_ALL=C date)
>     endif
> 
> An alternative, with a macro could be:
> 
>     set-shell-if-undef = $(if $(filter undefined,$(origin $(1))),$(eval $(1) := $(shell $(2))))
> 
>     $(call set-shell-if-undef,XEN_BUILD_DATE,LC_ALL=C date)
>     export XEN_BUILD_DATE
> 
> But this kind of hide that a shell command is been called. But having
> $(shell) as parameter of call $(call) mean the shell command is always
> called even when unneeded.
> 
> But then, with the macro, I'm not sure where to put it, to be able to
> use it here and in Config.mk for the next patch, another file in
> xen.git/config/*.mk ?
> 
> Should I replace all the eval with "ifeq (); endif" ?

I think that would be best (and I prefer that form anyway for being more
clear as to what it does).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 09:50:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 09:50:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570982.893689 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOxdh-0004pI-Rb; Thu, 27 Jul 2023 09:50:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570982.893689; Thu, 27 Jul 2023 09:50:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOxdh-0004pB-Ox; Thu, 27 Jul 2023 09:50:33 +0000
Received: by outflank-mailman (input) for mailman id 570982;
 Thu, 27 Jul 2023 09:50:32 +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
 <SRS0=o85N=DN=citrix.com=prvs=5659ebe79=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qOxdg-0004p5-BI
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 09:50:32 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 03f6ef42-2c63-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 11:50:28 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 03f6ef42-2c63-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690451429;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=tu42iGY8C5IV0AXXoKFmGk7Z3IhlsoOFTrmklBED3VU=;
  b=Ekey2SyxHwgMqYEEKIlR+ahqg2On3hK+L1zKzAL5VxH700HSwnOLPLlB
   SjIDwAZE5YQy4IFMIANvSxyl9BLtFFeB0cKjAcJFlR7n3disZIS4HTeGj
   crizXsDEMdAkJcPetBwN5Ju2El9q+o6AufQV6MUNRjYwq77qzY/Ds1wbA
   8=;
Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 120249465
X-Ironport-Server: esa4.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:tokWpai6L3XT/KQtiwxfqN16X161hhAKZh0ujC45NGQN5FlHY01je
 htvDG2APPeKNjGmKNsnat7koBxQvJWHytZjHFM+qSAwEiwb9cadCdqndUqhZCn6wu8v7q5Ex
 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv
 cKai8DEMRqu1iUc3lg8sspvkzsx+qyr0N8klgZmP6sT4wWBzyB94K83fsldEVOpGuG4IcbiL
 wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ
 OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+
 tQxFw4dNwLbv97pza65FOB83Z8eMczSadZ3VnFIlVk1DN4jSJHHBa7L+cVZzHE7gcUm8fT2P
 pRDL2A1NVKZPkMJYw1MYH49tL7Aan3XejtEqFWTtOwv7nLa1gBZ27nxKtvFPNeNQK25m27B/
 DqcozWlXExy2Nq3xiSE+1KcnLD2ryLAH4BMPYSztaVFjwjGroAUIEJPDgbqyRWjsWa5X99cM
 FAF4SoGoq079UjtRd74NzWorXjBshMCVt54F+wh9BrL2qfS+xyeBGUPUnhGctNOnMgySD8x3
 1mFheT1FCdvu72YT3Ga3rqMpDb0Mi8QRUcdYQcUQA1D5MPsyKkxgQjIVc1LC7Oug5v+HjSY6
 y6LtiUlh/MQkMsCzY2//FbOmTXqoYLGJiY8/gjNV3ipxh94boWiIYev7DDmAe1oddjDCAPb5
 T5dxpbYtbpVZX2QqMCTaMwyIqHw9a69DGLRnVwxFol6rAmw/kf2KOi8/wpCyFdV3tcsIGG4O
 BSC4lMJuPe/L1PxM/YpPtvZ59ACiPG5SI+7Dq28gs9mOMAZSeORwM15iad8NUjJmVNkr6wwM
 IzznS2EXSdDUvQPINZbqo4gPV4XKsMWnzm7qWjTlUjP7FZnTCf9pU05GFWPdPsly6iPvR/Y9
 d1SX+PTlUQHC7ygOHaGqtZMRbzvEZTdLcqowyCwXrfdSjeK5Ul7U6OBqV/fU9INc1tpehfgo
 SjmBx4wJKvXjnzbMwSaAk2Pm5u2NauTWUkTZHR2VX7xgihLXGpaxPtHH3fBVeV9pbMLID8dZ
 6VtRvhs9dwWFW+cpmVCNcKmxGGgHTzy7T+z0+OeSGBXV/Zdq8bhobcIoiOHGPEyMxeK
IronPort-HdrOrdr: A9a23:9DRafq58yULtO2tNiQPXwAzXdLJyesId70hD6qkQc3Fom62j5q
 WTdZEgvyMc5wx/ZJhNo7690cq7MBHhHPxOgbX5VI3KNGXbUQOTR72KhrGSoAEIdReeygZcv5
 0QCZSXCrfLfCVHZRCR2njFLz4iquP3j5xBnY3lvhNQpZkBUdAZ0+9+YDzrdXFedU19KrcSMo
 GT3cZDryrIQwVtUizqbkN1OdQqvrfw5evbXSI=
X-Talos-CUID: =?us-ascii?q?9a23=3Asex2vWvdwKYF/yCkqM3Knfcn6IsMTUPNlWWIG3P?=
 =?us-ascii?q?nBHprFrSFEgSt5aZdxp8=3D?=
X-Talos-MUID: 9a23:ZQbKFgb74YBdWuBTuCHtjRFSLphR0aWVT0JTuKwN+JKrOnkl
X-IronPort-AV: E=Sophos;i="6.01,234,1684814400"; 
   d="scan'208";a="120249465"
Date: Thu, 27 Jul 2023 10:50:14 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Oleksandr Tyshchenko <olekstysh@gmail.com>
CC: <xen-devel@lists.xenproject.org>, Oleksandr Tyshchenko
	<oleksandr_tyshchenko@epam.com>, Wei Liu <wl@xen.org>, Juergen Gross
	<jgross@suse.com>, Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: [PATCH] libxl: Add missing libxl__virtio_devtype to
 device_type_tbl array
Message-ID: <670c22f9-135d-4022-8272-78af3e28c011@perard>
References: <20230726141459.985463-1-olekstysh@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230726141459.985463-1-olekstysh@gmail.com>

On Wed, Jul 26, 2023 at 05:14:59PM +0300, Oleksandr Tyshchenko wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 
> Without it being present it won't be possible to use some
> libxl__device_type's callbacks for virtio devices as the common code
> can only invoke these callbacks (by dereferencing a pointer) for valid
> libxl__device_type's elements when iterating over device_type_tbl[].

Did you notice an issue with it been missing from device_type_tbl[] ?
Because to me it looks like all the functions that are using
device_type_tbl will just skip over virtio devtype.

domcreate_attach_devices:
    skip virtio because ".skip_attach = 1"

libxl__need_xenpv_qemu:
    skip virtio because "dm_needed" is NULL

retrieve_domain_configuration_end:
    skip because "compare" is "libxl_device_virtio_compare" which is NULL

libxl__update_domain_configuration:
    skip because "update_config" is NULL.

So, I think the patch is fine, adding virtio to the device_type_tbl
array is good for completeness, but the patch description may be
misleading.

Did I miss something?

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 10:14:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 10:14:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570985.893699 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOy0Y-0007Sg-LR; Thu, 27 Jul 2023 10:14:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570985.893699; Thu, 27 Jul 2023 10:14:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOy0Y-0007SZ-Ir; Thu, 27 Jul 2023 10:14:10 +0000
Received: by outflank-mailman (input) for mailman id 570985;
 Thu, 27 Jul 2023 10:14:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=lU1s=DN=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qOy0X-0007SQ-E1
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 10:14:09 +0000
Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com
 [2a00:1450:4864:20::52d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 526b1f3b-2c66-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 12:14:07 +0200 (CEST)
Received: by mail-ed1-x52d.google.com with SMTP id
 4fb4d7f45d1cf-5221f3affe4so971741a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 03:14:07 -0700 (PDT)
Received: from EMEAENGAAD19049. (default-46-102-197-194.interdsl.co.uk.
 [46.102.197.194]) by smtp.gmail.com with ESMTPSA id
 qk29-20020a170906d9dd00b0098e34446464sm594912ejb.25.2023.07.27.03.14.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 03:14:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 526b1f3b-2c66-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690452847; x=1691057647;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=yhoEl2UxsuhEj718Ec/sLvf/pVoPE/8RHWDMwTl0r0I=;
        b=RcrtIEP8M7xbCqPSdgWPgNnb2YIcKfxh4lFM/EN+Xh5490jP+W6YM01SCrYKIKGbDF
         EJdBFwAGJVrAEc8MQIReyV592JbA+vqql78JYxHtMKwzXb7hbDAKudN21sCRVUIJ2tSd
         pVgc15n5j4gU26Rykvozwlrfd2YFtidrvIXW0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690452847; x=1691057647;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=yhoEl2UxsuhEj718Ec/sLvf/pVoPE/8RHWDMwTl0r0I=;
        b=ak7tBaPKfgMlCCh5nukyJaCD/WgLO3xLjUTsWjrvhzy8u39hS7MfrOwAE6b7vy3j5o
         3ATrDgc5UfIGoXFNRyJ9NgTzXQ9TkAKcr8hLQP3c76aT7afTN1pAE0r9+06dD0OPXuCj
         8fHRGOsU33QxsZMzbVpZK7p74CJYAgfPtqMFcrgCzPfwWtPTHTfOyoHQ/50bhPYullTk
         z4s7gL6ew/tYOrPYc+JwJTAg9nOeQODfGIhd9PDPVPE5JjNo9e9+4rT2ZdhsaEz2iEtL
         PfbfG98S0ufryXVnHbGXExQkDTbOFr74C8Y84jYbJgJQIykGifxzKXpbmK01BPmMDrXm
         z9rg==
X-Gm-Message-State: ABy/qLZ428TH/sGVc1quNbwQhLBGBUBMbIpp6s92bMDRawMGBW6414QT
	DBmgBvUO1enb1FSx6vdC8jUguA==
X-Google-Smtp-Source: APBJJlFfYcxrZ5guFc8s/pNZ4x3IXQOnusARslwkl4dIKtX9TwwZRzuxsOwdNVCZiwElx1jb2999Ew==
X-Received: by 2002:a17:907:b12:b0:973:d076:67ab with SMTP id h18-20020a1709070b1200b00973d07667abmr1355678ejl.42.1690452847230;
        Thu, 27 Jul 2023 03:14:07 -0700 (PDT)
Message-ID: <64c2436e.170a0220.2aacd.218c@mx.google.com>
X-Google-Original-Message-ID: <ZMJDbHlEwvlvzcjU@EMEAENGAAD19049.>
Date: Thu, 27 Jul 2023 11:14:04 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Julien Grall <julien@xen.org>,
	Xen-devel <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH 6/8] mm/pdx: Standardize region validation wrt pdx
 compression
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-7-alejandro.vallejo@cloud.com>
 <1eb58b83-87ee-d738-08b0-948a8b48773a@xen.org>
 <64be6c1c.7b0a0220.49ba9.0e38@mx.google.com>
 <79ecab0a-cb91-cc95-fd31-c76ec287fa9b@xen.org>
 <0d28d9cd-8cb3-6d03-94d3-e07a4dab9e95@suse.com>
 <dc76516e-2334-798a-216e-5ad983fea2f9@xen.org>
 <58b1901c-f5ee-8617-a5f8-0666c4ef51e6@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <58b1901c-f5ee-8617-a5f8-0666c4ef51e6@suse.com>

On Tue, Jul 25, 2023 at 04:34:42PM +0200, Jan Beulich wrote:
> On 25.07.2023 16:27, Julien Grall wrote:
> > Hi,
> > 
> > On 25/07/2023 07:51, Jan Beulich wrote:
> >> On 24.07.2023 20:20, Julien Grall wrote:
> >>> On 24/07/2023 13:18, Alejandro Vallejo wrote:
> >>>> On Fri, Jul 21, 2023 at 06:05:51PM +0100, Julien Grall wrote:
> >>>>> Hi Alejandro,
> >>>>>
> >>>>> On 17/07/2023 17:03, Alejandro Vallejo wrote:
> >>>>>> +bool pdx_is_region_compressible(unsigned long smfn, unsigned long emfn)
> >>>>>
> >>>>> For newer interface, I would rather prefer if we use start + size. It is
> >>>>> easier to reason (you don't have to wonder whether 'emfn' is inclusive or
> >>>>> not) and avoid issue in the case you are trying to handle a region right at
> >>>>> the end of the address space as emfn would be 0 in the non-inclusive case
> >>>>> (not much a concern for MFNs as the last one should be invalid, but it makes
> >>>>> harder to reason).
> >>>> I could agree on this, but every single caller is based on (smfn, emfn),
> >>>> so it needlessly forces every caller to perform conversions where the
> >>>> callee can do it just once.
> >>>
> >>> That's indeed one way to see it. The problem is that...
> >>>
> >>>> That said, I think your point makes sense and
> >>>> it ought to be done. Probably as as part of a bigger refactor where
> >>>> (smfn, emfn)-based functions are turned into (base, len) variants.
> >>>
> >>> ... clean-up tends to be put in the back-burner and we just continue to
> >>> add new use. This makes the task to remove every use a lot more
> >>> difficult. So there is a point when one has to say no more.
> >>>
> >>> Therefore, I would strongly prefer if each callers are doing the
> >>> computation. The rest can be removed leisurely.
> >>>
> >>> Let see what the opinion of the other maintainers.
> >>
> >> I think [a,b] ranges are fine to pass, and may even be preferable over
> >> passing a size. I'm specifically using that term that you also used:
> >> "size" (or "length") is ambiguous when talking about page granular
> >> items - is it in bytes or number of pages?
> > 
> > I was referring to the number of pages. I don't think it make sense to 
> > have it in bytes given the start is a frame.
> > 
> >> Especially in the former
> >> case calculations at the call sites would be quite a bit more cumbersome.
> >> I could agree with (mfn,nr) tuples
> > 
> > Ok. So your objection of my proposal is just about the name, right? If 
> > so, I didn't put too much thought behind the naming when I sent my 
> > original e-mail. I am open to any.
> 
> Something like "nr" would be fine with me, for example.
> 
> > , but as said I think inclusive
> >> ranges are also fine to use (and would be less of a problem at the call
> >> sites here, afaics).
> > 
> > The problem with range is that it can lead to confusion on whether the 
> > end is inclusive or exclusive. We had one bug recently in the Arm PCI 
> > code because of that.
> 
> It's a matter of properly writing it down, I would say.
> 
> > So I would like to get rid of any use of range in new functions.
> 
> Hmm, seems to need further input from other maintainers / committers
> then.
> 
> Jan

>From the look of things, I think I'm leaning on the side of Julien. The
ranges are always ambiguous in the absence of a strong code convention, but
it appears to be absent in the codebase. i.e: Are they meant to be
inclusive or exclusive? Traditionally I've seen and used the later more
often for ease of arithmetic, while from your last message you seem to be
mentioning the latter.

If the point is to disambiguate without resorting to conventions then
there's only realistic one option I see. Would refactoring it to
"paddr_t base, size_t npages" satisfy you both? If this is something to be
taken into account for future code we probably want a gitlab ticket to
refactor everything else to (base,[npages|noctets]) too. e.g:
XENPF_mem_hotadd uses the [spfn, epfn) convention, and so do a bunch of
other pieces in x86 and common code.

Thanks,
Alejandro


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 10:19:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 10:19:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570987.893709 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOy5p-00085H-8G; Thu, 27 Jul 2023 10:19:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570987.893709; Thu, 27 Jul 2023 10:19:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOy5p-00085A-5b; Thu, 27 Jul 2023 10:19:37 +0000
Received: by outflank-mailman (input) for mailman id 570987;
 Thu, 27 Jul 2023 10:19:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOy5n-000854-Ua
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 10:19:35 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on2062f.outbound.protection.outlook.com
 [2a01:111:f400:7d00::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 15530bd6-2c67-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 12:19:34 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB7760.eurprd04.prod.outlook.com (2603:10a6:102:c5::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 10:19:32 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 10:19:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 15530bd6-2c67-11ee-b247-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hB4sx1npFz4VLL9e/o8E0s7iLoK94ZnJ0LCX8as2kkQidczQ76I1JsKE4Ey0Z8TxkeSOOnLShVUoHpg76nCJCizkczDbnsJ0df0xrJ820FEh83hXveojIhvM3g3XbqtW37o+ypCB4/WWnA6u7vQL9/N5s4hsFTnKxFvBFnAiGQX21YBqLcsHwXyRD8KID1F+kViflHGJpP4SLQAGXxQuYCIZ4owQ6YB5L/A98DKbQG11QzcEmFEVDVjW5Ln69eK7F9CtU+zXt2knJJNdYxhBCNBLLCfSgKeoRADTZesWZIhOtTgyVqp0znp4TUCrsSdUiEp+6oKzYg1RBgMTINSChQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=KFIYahveLcQkZuh/2TJ4AvaZjoejtF05bPahnmjIU4w=;
 b=MTGfC81KU+IxNiRF/yZriqWIvqpJsOKoZU3pg6OA9ipypZM5UkRFKvi+NDGU9Y7uhSlDHugvLGo1QWc/cM7Lprwl7CgHq2bV7CjfCNlH/r3g5zwUKjMVUcqNDBlBIbMetUpe6zCuOlZaJhPo1b284uzU6a33UMbLpCnlA1Dx7np2Nn4Nwgs3G43VD4EpUz1ON4fCQGGJmtJ/sF0A28rPEJ1GdKlNFH2iEEz1msESzmAdYSwVE5c/R48w26pxLLMet61zIXwEwetpp2EugKVBdi9QPG0+hnf8bopTveb1uafaXMdD2+60vY/AQNGm4xIbJu2DFYrfPFijLT4V5O84gg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KFIYahveLcQkZuh/2TJ4AvaZjoejtF05bPahnmjIU4w=;
 b=w0l1n8Reeb6GZ/1emfg2ShhD3IvF43tpjl4sYS/nRdApY7bII0vkXD42ENvWpbQ9gcNc7vmDWdnTbZ53594iQTodalXlu8d1Ys3Ydy5qtYaRlH/gH3qSPKnvXstkSacPOPplJ/a2Sd9uurVuZGSl97i+UcKRyoUCU5h47zXvB23H0gbEF8u8mzSDyrCIFg+J2cSkFRpoKelNxfKbDTay6Yu8+a8Uzx+Ppd1qCeRocf+yg9wIZvDh3OgL82aURMvkTUeVBmfEo2gNEEGn5srE0cIxtKe5V/G4rjRNqDLZKJrrg3q3zaDlUmPnA0VnWrFlpvZ8Qc05Fo+nmxSEOFJ3dQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <a87e6df6-9236-f90b-1fbc-3c348023b307@suse.com>
Date: Thu, 27 Jul 2023 12:19:29 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 6/8] mm/pdx: Standardize region validation wrt pdx
 compression
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Julien Grall <julien@xen.org>, Xen-devel
 <xen-devel@lists.xenproject.org>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <20230717160318.2113-1-alejandro.vallejo@cloud.com>
 <20230717160318.2113-7-alejandro.vallejo@cloud.com>
 <1eb58b83-87ee-d738-08b0-948a8b48773a@xen.org>
 <64be6c1c.7b0a0220.49ba9.0e38@mx.google.com>
 <79ecab0a-cb91-cc95-fd31-c76ec287fa9b@xen.org>
 <0d28d9cd-8cb3-6d03-94d3-e07a4dab9e95@suse.com>
 <dc76516e-2334-798a-216e-5ad983fea2f9@xen.org>
 <58b1901c-f5ee-8617-a5f8-0666c4ef51e6@suse.com>
 <64c2436e.170a0220.2aacd.218c@mx.google.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <64c2436e.170a0220.2aacd.218c@mx.google.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0141.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:95::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB7760:EE_
X-MS-Office365-Filtering-Correlation-Id: 4d6aa5ed-603e-42a8-a2f2-08db8e8af812
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	5Crh/nRJCQboAz3zRbVjLtiARKs+Jftlm4zvCMqPDzCkjC9s8RtcR53w4Xw/683DJmaHwfW2pK6t7+jZyb7tFUnGbbWFCtDUPNgK2iLZT8JGlD4VUALaDDGIhknQVOASSrNUFey6tcgyM6RaFaVJBo47E1/9Hraj1Y7fbkSSuHx4inKCKVhz+o6RFi6CVHUhhaQQPw9xg+vx2nvf5Ceeg4Oiw2e9+nkriJJNxdShdKCp9Gu91S97Gts3Z0pRxQZFVWYZT0w0gkJMSaHnIK0zVBDa9C/m8zAFs8ClQWttFtvUjEB64wgZShZLHjDtPuB2TNKItBWgAbsXYI/i47ejA5PNulHdi0gwy+FAaFEL7AwDOiK/eBiQ1UQNwqd5q5ZRNEPfr5ZHQ3hb9JAnBbHAHEEWSb02sI6RHCLQpFEpbq9p0MPdGULoMNPvjZsKs5fkNhb+C0muE9JnIGHl25JUkOubVzVZ8RdzNzONnBBFMx/z1jbQNODYXGlzxJbeF3gw6jL6ykWrpTEeso83PN7O5UjMFhqE6rQnT5xxWvToLvkDrM/C1czNWcI4N405ORPPEntnHJ8vb5dxpfpV7Twj2AzwfQOeZ/F0bjiL+y965zMyJuK85QmcAOoh1VafvKRd55EZSPFJlDa/acL09Y2SOQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(346002)(376002)(366004)(136003)(451199021)(2906002)(41300700001)(316002)(5660300002)(8936002)(8676002)(36756003)(86362001)(31696002)(6512007)(26005)(6506007)(53546011)(478600001)(6666004)(6486002)(83380400001)(186003)(31686004)(2616005)(6916009)(4326008)(38100700002)(66476007)(66556008)(66946007)(54906003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?c0RlajlveTZVamp0TlRKTng0Q1ovWDl6N0s3YmVyVURPYUp3eHRFYUhUZnBZ?=
 =?utf-8?B?T1ZjN3JjME1HTUZoV2RXRXovV0p4SUFpVmZ5NnNJMXVwdjIwWUNESGFPSFpk?=
 =?utf-8?B?QmVVRG9rYzMyTENLa1VTS0xiUDd0eXNnY05PcFZZT0xsTVhMN3FKbktia1k2?=
 =?utf-8?B?L1pXOFlRVW5FaUR6dkFpU3dCRkdLRGhIRzRaZkJMWjFnOFFRdUV3RUVUNFVQ?=
 =?utf-8?B?YTVZd1hlL0lSWnR2WWdzT0g5a21kUHZZSWRiS2ZDMlhXR3FPSTNsNHNuUzkr?=
 =?utf-8?B?VDhKeUlITitySGRwaUt5UW5iY1lzMWl4cEJnamZFUmMrTGgzdDNoeVJtUVUy?=
 =?utf-8?B?N2NnKy8r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utf-8?Q?HRm2dLUi3yuF9GlXZzL2HWOUI?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4d6aa5ed-603e-42a8-a2f2-08db8e8af812
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 10:19:32.3925
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: eKCaEFDI0NCQESfeDE6Py7W8HyhBSIudo6+Yr+YU3rN7cZo8rXHABM0Uixytyno29JBfkXdaG61UHBH0q/kTJw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7760

On 27.07.2023 12:14, Alejandro Vallejo wrote:
> On Tue, Jul 25, 2023 at 04:34:42PM +0200, Jan Beulich wrote:
>> On 25.07.2023 16:27, Julien Grall wrote:
>>> Hi,
>>>
>>> On 25/07/2023 07:51, Jan Beulich wrote:
>>>> On 24.07.2023 20:20, Julien Grall wrote:
>>>>> On 24/07/2023 13:18, Alejandro Vallejo wrote:
>>>>>> On Fri, Jul 21, 2023 at 06:05:51PM +0100, Julien Grall wrote:
>>>>>>> Hi Alejandro,
>>>>>>>
>>>>>>> On 17/07/2023 17:03, Alejandro Vallejo wrote:
>>>>>>>> +bool pdx_is_region_compressible(unsigned long smfn, unsigned long emfn)
>>>>>>>
>>>>>>> For newer interface, I would rather prefer if we use start + size. It is
>>>>>>> easier to reason (you don't have to wonder whether 'emfn' is inclusive or
>>>>>>> not) and avoid issue in the case you are trying to handle a region right at
>>>>>>> the end of the address space as emfn would be 0 in the non-inclusive case
>>>>>>> (not much a concern for MFNs as the last one should be invalid, but it makes
>>>>>>> harder to reason).
>>>>>> I could agree on this, but every single caller is based on (smfn, emfn),
>>>>>> so it needlessly forces every caller to perform conversions where the
>>>>>> callee can do it just once.
>>>>>
>>>>> That's indeed one way to see it. The problem is that...
>>>>>
>>>>>> That said, I think your point makes sense and
>>>>>> it ought to be done. Probably as as part of a bigger refactor where
>>>>>> (smfn, emfn)-based functions are turned into (base, len) variants.
>>>>>
>>>>> ... clean-up tends to be put in the back-burner and we just continue to
>>>>> add new use. This makes the task to remove every use a lot more
>>>>> difficult. So there is a point when one has to say no more.
>>>>>
>>>>> Therefore, I would strongly prefer if each callers are doing the
>>>>> computation. The rest can be removed leisurely.
>>>>>
>>>>> Let see what the opinion of the other maintainers.
>>>>
>>>> I think [a,b] ranges are fine to pass, and may even be preferable over
>>>> passing a size. I'm specifically using that term that you also used:
>>>> "size" (or "length") is ambiguous when talking about page granular
>>>> items - is it in bytes or number of pages?
>>>
>>> I was referring to the number of pages. I don't think it make sense to 
>>> have it in bytes given the start is a frame.
>>>
>>>> Especially in the former
>>>> case calculations at the call sites would be quite a bit more cumbersome.
>>>> I could agree with (mfn,nr) tuples
>>>
>>> Ok. So your objection of my proposal is just about the name, right? If 
>>> so, I didn't put too much thought behind the naming when I sent my 
>>> original e-mail. I am open to any.
>>
>> Something like "nr" would be fine with me, for example.
>>
>>> , but as said I think inclusive
>>>> ranges are also fine to use (and would be less of a problem at the call
>>>> sites here, afaics).
>>>
>>> The problem with range is that it can lead to confusion on whether the 
>>> end is inclusive or exclusive. We had one bug recently in the Arm PCI 
>>> code because of that.
>>
>> It's a matter of properly writing it down, I would say.
>>
>>> So I would like to get rid of any use of range in new functions.
>>
>> Hmm, seems to need further input from other maintainers / committers
>> then.
>>
>> Jan
> 
> From the look of things, I think I'm leaning on the side of Julien. The
> ranges are always ambiguous in the absence of a strong code convention, but
> it appears to be absent in the codebase. i.e: Are they meant to be
> inclusive or exclusive? Traditionally I've seen and used the later more
> often for ease of arithmetic, while from your last message you seem to be
> mentioning the latter.
> 
> If the point is to disambiguate without resorting to conventions then
> there's only realistic one option I see. Would refactoring it to
> "paddr_t base, size_t npages" satisfy you both?

If we are to refactor, then yes except it shouldn't be size_t. I can be
unsigned int (when we know more than 4 billion pages aren't possible)
or unsigned long.

Jan

> If this is something to be
> taken into account for future code we probably want a gitlab ticket to
> refactor everything else to (base,[npages|noctets]) too. e.g:
> XENPF_mem_hotadd uses the [spfn, epfn) convention, and so do a bunch of
> other pieces in x86 and common code.
> 
> Thanks,
> Alejandro
> 



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 10:20:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 10:20:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570989.893718 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOy77-000137-IB; Thu, 27 Jul 2023 10:20:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570989.893718; Thu, 27 Jul 2023 10:20:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOy77-000130-Ff; Thu, 27 Jul 2023 10:20:57 +0000
Received: by outflank-mailman (input) for mailman id 570989;
 Thu, 27 Jul 2023 10:20:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=1hVV=DN=kernel.org=dlemoal@srs-se1.protection.inumbo.net>)
 id 1qOy75-00012p-Ot
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 10:20:55 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 43df2f2d-2c67-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 12:20:53 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 44B6761DD3;
 Thu, 27 Jul 2023 10:20:52 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9266C433C8;
 Thu, 27 Jul 2023 10:20:47 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 43df2f2d-2c67-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690453251;
	bh=Uv0jglg4XDxm5uiOcl1Fs0VDdmS3vnj5J06IHksC3j0=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=VjGCTE5fXWQGMkstr5mWfG/olGcukHbx9MJ5gIHM1kJfwo/BiFcjiuEaiA2TxQad6
	 b/CL9D78jYHhDiLBxLD9gCBB6CtR9Pngnq1E4RM+cWQl1ITCzXzhPBEMorh0UStJGb
	 V5QypMia7H1mT7Yv9W7oIRfkDRB1G3xJIxfo7Y/Lymzj+mXx3lcBAFmRFbWxhh8lk9
	 h4N9LjcMkMC3/ZfJEah0qCVly/fWQ4ostsbFgLI1m7GG/WQbkHJ87BAgn9cUsNUERW
	 XrnUyEDaK9+tFU+Iukly/qv+tfC9IZiVkgJJJYsmEkH+2gmJEivzAz4IAcCpkEsNUW
	 WY8rxT9ubVHrA==
Message-ID: <ba0868b2-9f90-3d81-1c91-8810057fb3ce@kernel.org>
Date: Thu, 27 Jul 2023 19:20:46 +0900
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 28/49] dm zoned: dynamically allocate the dm-zoned-meta
 shrinker
Content-Language: en-US
To: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 Muchun Song <songmuchun@bytedance.com>, akpm@linux-foundation.org,
 david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz, roman.gushchin@linux.dev,
 djwong@kernel.org, brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu,
 steven.price@arm.com, cel@kernel.org, senozhatsky@chromium.org,
 yujie.liu@intel.com, gregkh@linuxfoundation.org, muchun.song@linux.dev
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
 <20230727080502.77895-29-zhengqi.arch@bytedance.com>
 <baaf7de4-9a0e-b953-2b6a-46e60c415614@kernel.org>
 <56ee1d92-28ee-81cb-9c41-6ca7ea6556b0@bytedance.com>
From: Damien Le Moal <dlemoal@kernel.org>
Organization: Western Digital Research
In-Reply-To: <56ee1d92-28ee-81cb-9c41-6ca7ea6556b0@bytedance.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 7/27/23 17:55, Qi Zheng wrote:
>>> Â Â Â Â Â Â Â Â Â  goto err;
>>> Â Â Â Â Â  }
>>> Â  +Â Â Â  zmd->mblk_shrinker->count_objects = dmz_mblock_shrinker_count;
>>> +Â Â Â  zmd->mblk_shrinker->scan_objects = dmz_mblock_shrinker_scan;
>>> +Â Â Â  zmd->mblk_shrinker->seeks = DEFAULT_SEEKS;
>>> +Â Â Â  zmd->mblk_shrinker->private_data = zmd;
>>> +
>>> +Â Â Â  shrinker_register(zmd->mblk_shrinker);
>>
>> I fail to see how this new shrinker API is better... Why isn't there a
>> shrinker_alloc_and_register() function ? That would avoid adding all this code
>> all over the place as the new API call would be very similar to the current
>> shrinker_register() call with static allocation.
> 
> In some registration scenarios, memory needs to be allocated in advance.
> So we continue to use the previous prealloc/register_prepared()
> algorithm. The shrinker_alloc_and_register() is just a helper function
> that combines the two, and this increases the number of APIs that
> shrinker exposes to the outside, so I choose not to add this helper.

And that results in more code in many places instead of less code + a simple
inline helper in the shrinker header file... So not adding that super simple
helper is not exactly the best choice in my opinion.

-- 
Damien Le Moal
Western Digital Research



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 10:27:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 10:27:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570991.893729 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyDU-0001hE-7p; Thu, 27 Jul 2023 10:27:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570991.893729; Thu, 27 Jul 2023 10:27:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyDU-0001h7-4G; Thu, 27 Jul 2023 10:27:32 +0000
Received: by outflank-mailman (input) for mailman id 570991;
 Thu, 27 Jul 2023 10:27:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=o85N=DN=citrix.com=prvs=5659ebe79=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qOyDS-0001gy-Lv
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 10:27:30 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2ee8a21c-2c68-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 12:27:28 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2ee8a21c-2c68-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690453648;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=bXBuogiBSSXFmWb2iq5w7ozQSgdS58uuxOYhLD+Umro=;
  b=VyFRl7z2u14EEEZorkqP5QkSWPty22qhVQ3AWYWfC90KgyhP8xqaSVWJ
   OxruZ6o8pxpUIXsadlFMx+PtkVRI0dxhSLnKkcqLfov4xdvKVtWmhN+/+
   s0GJtSfOPtQftDh9HmiW/QTvV1jP64frzw4ediABAYJCNbPuSaDmlboIg
   c=;
Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 117502348
X-Ironport-Server: esa2.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:MX1h2KzydVGschFF6VZ6t+fXxirEfRIJ4+MujC+fZmUNrF6WrkVUn
 2BNWjiBbvfcY2b8KN8nPd+y/UhUvcXcydExSANq+CAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhP68T5TcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KWF+0
 N48CRNOVzGC3NmfzImRTM5Ditt2eaEHPKtH0p1h5TTQDPJgSpHfWaTao9Rf2V/chOgXQ6yYP
 ZBAL2MyMlKZOUYn1lQ/UfrSmM+hgGX/dDtJ7kqYv6Mt70DYzRBr0airO93QEjCPbZwMwRvA/
 DmarwwVBDlBDOa0+zOo70uvqeCUogTmAKICBLO3o6sCbFq7mTVIVUx+uUGAifuwjEKkSs9cA
 0MR8ysq66M18SSDXtT7GhG1vnOAlhodQMZLVf037hmXzajZ6BrfAXILJhZebPQ2uclwQiYlv
 neLkMnuHidHq6CORDSW8bL8hTG4NDURLGQCTTQZVgZD6N7myKkxkxbOQ9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814400"; 
   d="scan'208";a="117502348"
Date: Thu, 27 Jul 2023 11:27:21 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Jason Andryuk <jandryuk@gmail.com>
CC: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>, Juergen Gross
	<jgross@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap
	<george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v7 04/15] xen/sysctl: Nest cpufreq scaling options
Message-ID: <5a6365b0-7809-4287-96fa-be7809d664c8@perard>
References: <20230726170945.34961-1-jandryuk@gmail.com>
 <20230726170945.34961-5-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230726170945.34961-5-jandryuk@gmail.com>

On Wed, Jul 26, 2023 at 01:09:34PM -0400, Jason Andryuk wrote:
> Add a union and struct so that most of the scaling variables of struct
> xen_get_cpufreq_para are within in a binary-compatible layout.  This
> allows cppc_para to live in the larger union and use uint32_ts - struct
> xen_cppc_para will be 10 uint32_t's.
> 
> The new scaling struct is 3 * uint32_t + 16 bytes CPUFREQ_NAME_LEN + 4 *
> uint32_t for xen_ondemand = 11 uint32_t.  That means the old size is
> retained, int32_t turbo_enabled doesn't move and it's binary compatible.
> 
> The out-of-context memcpy() in xc_get_cpufreq_para() now handles the
> copying of the fields removed there.
> 
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> ---
> NOTE: Jan would like a toolside review / ack because:
>     Nevertheless I continue to be uncertain about all of this: Parts of
>     the struct can apparently go out of sync with the sysctl struct, but
>     other parts have to remain in sync without there being an
>     appropriate build-time check (checking merely sizes clearly isn't
>     enough). Therefore I'd really like to have a toolstack side review /
>     ack here as well.

I wish we could just use "struct xen_get_cpufreq_para" instead of
having to make a copy to replace the XEN_GUEST_HANDLE_*() macro.

Next I guess we could try to have something like the compat layer in xen
is doing, with plenty of CHECK_FIELD_ and other CHECK_* macro, but that
would be a lot of work. (xen/include/xen/compat.h and how it's used in
xen/include/compat/xlat.h)

Unless you feel like adding more build check, I guess the patch is good
enough like that:
Acked-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 10:32:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 10:32:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570994.893738 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyHw-0003Al-U0; Thu, 27 Jul 2023 10:32:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570994.893738; Thu, 27 Jul 2023 10:32:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyHw-0003Ae-RR; Thu, 27 Jul 2023 10:32:08 +0000
Received: by outflank-mailman (input) for mailman id 570994;
 Thu, 27 Jul 2023 10:32:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Q9bz=DN=epam.com=prvs=1572de9637=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qOyHv-0003AY-Ps
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 10:32:07 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d477ef09-2c68-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 12:32:06 +0200 (CEST)
Received: from pps.filterd (m0174679.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36R9jbsI019300; Thu, 27 Jul 2023 10:32:02 GMT
Received: from eur04-he1-obe.outbound.protection.outlook.com
 (mail-he1eur04lp2054.outbound.protection.outlook.com [104.47.13.54])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3s3p7xr5yk-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 27 Jul 2023 10:32:01 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AM7PR03MB6515.eurprd03.prod.outlook.com (2603:10a6:20b:1c0::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 10:31:57 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 10:31:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d477ef09-2c68-11ee-b247-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=TS6qD5nrfDxX23JYyCPhWAclKxBm5cSTudtUo89WA5WFqkG0sZuhVKB0VdJFOKCh/02tMfWxLEQX49BlHmg95pAq30R11hv6sWHiseBwKaYt+IYvrb/M5wwKSMo/muqg7uHPJiRPoyR/23jkMBznGsx8x0ejTITx8sMNgSEii8B5po7eNeTSOQEyrlbeRuMuOjB2cdusMeh9pGwi8804WcyilHLT5so6yZzRHQfRD5LO5iF8EaFZaYT8xWtdeRf4R25JHRRsRctbwu2xo9foJ0biYxdQ/VTd0nyBnnEFscy67hBomdxI4Jfx5EtBSM8E3re57uOVtoOdGSxEqptFcw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=zLa84VPEgrBJX2PUmcYAtZebknww0/wNa0EDs0+4GFg=;
 b=QQ6dY3K+D+s+OVu8vrc5mOwob9Q4TvO7SVKveWkNSq9m55t75XwKU62hbt+2AZvPUcZZSbKEetms9M6ux9o2ehxUU/xYbgFun/vJ3FJhIy7frQ9z5Pdyotwn0MdZ05lvvpXYqkxTq7yR0rIi/LkuBJ4e+5Ro+HhrkMcILuB3mvcNecZYnJL5eHI4kzvf3SvH+RbJ8Sx+yfLzvVmhsDHe1D/q66MTd6DvNiHO+z0DcdWp5hzLziCa1edUYR8DCCKdyXNMVXxEzjEoL0Gp3Y2KlIj/hgiUbWgPWG+b8MU5JlXQYdx8Jzvuotof7rCibxL6JpBK4CXlADk25ubvqsuHwQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=zLa84VPEgrBJX2PUmcYAtZebknww0/wNa0EDs0+4GFg=;
 b=ZNGI4h8KN8gmABtSJc3bAKI6VMY+QI3Qg2r4hdhiG4DKImYKTVm0rfWZGNvxcg4Llck/E0pNionFnoDNYGevYJ7aQu3XPrDOT0iJxtzegMOSfNca/I2DL5BoN6IQiVwozS56YPzCGKrIWrWe+pba4i62hDBhZwHs+nQO3x67wJw+z7k1J7Zf7jFvFtfEeApt0QwHpkgSUMd5+TjSeQ1GxBJ0CbMysQVrSzfZ62Qwpo/oWT0tru8vanmKiJtQUNAz2NRbJFK6sjOylvaOJbTTbdNMMRLyUhzV1DsXtHzav8llfxia5GZMJCghKGqbSxGyWKoRR9VNsiDak6676q2Nvg==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: Jan Beulich <jbeulich@suse.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
        Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
        =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Thread-Topic: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Thread-Index: 
 AQHZuqGrLMJPz1ipBEu4urExXp8yi6/CgxUAgAWEoICAA8vwgIAA+VsAgAB5WACAAC7UgA==
Date: Thu, 27 Jul 2023 10:31:56 +0000
Message-ID: <87r0otbq78.fsf@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local> <87ila7cvy2.fsf@epam.com>
 <ZMDox0WwumxMGnzV@MacBook-Air-de-Roger.local> <87y1j2b296.fsf@epam.com>
 <999aae1d-fb85-6550-9798-64cf88d7faf3@suse.com>
In-Reply-To: <999aae1d-fb85-6550-9798-64cf88d7faf3@suse.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: mu4e 1.8.9; emacs 28.2
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AM7PR03MB6515:EE_
x-ms-office365-filtering-correlation-id: bee0e650-f86e-45d7-7208-08db8e8cb3ef
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 QTwo0O6RXOLhW7tPgrpiXMhUaAYhLNyPgvMEw05bY6JUDFC1I98tUPzun1ttf5rBqys30Qza9LBtxR2ZZBVvwntmg6EF3koS+tr5HTekbU+MhomYA/6zjZfXw6pM5FVhFrvpBTnenZxdsHUYd0thDhXm5gsuGVLDPEUQACLS3enfWnedZAuRaKBxk0F8nUpsI1se7opmYH72ZANbJVoEpucKqgFCnAgT5jjDTHCiiKPRu9Cqx6/uoWGUXhZW7YT2IyLEkQuT2tcw5PVO7k9kvTKuiqk/eQIgrr9+BAOqWIrf1UncLTJQRVu8xM0tyAhsn+cvYEf90EEMyyrxQV8vZm5C1CxC2655nLig02JgUW/uj4JLVooOvOOjJeXhY3jC7XBNkI/u5Xag7jtjkz5GfOx273G6z8gJcwC5PmlFXIBtkaDjl5zZ4FLk4lXoytJn6DpMhDkd5joVEO5ES3iFiWOpUYkRGedvHl3RaEL5KxCMeKWlpQTXbglS6HRMAyKPDtc3heHjw1YMUtrBTPSaEWhIkl0CbaQTlsOK2iL4HvFeK0cuIV2ykvGkJx7847QTiWxM6IFfAv+v1tBqKT4v5zFlZsRGg5jjrAOfIJhcn27aBsstiH6IZH+VioF/qTFQ
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(366004)(39860400002)(136003)(376002)(396003)(451199021)(86362001)(2906002)(8676002)(8936002)(38070700005)(83380400001)(5660300002)(316002)(91956017)(76116006)(64756008)(66946007)(66556008)(66476007)(66446008)(38100700002)(6916009)(4326008)(36756003)(2616005)(54906003)(122000001)(186003)(6486002)(26005)(53546011)(55236004)(6506007)(478600001)(71200400001)(41300700001)(6512007);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?MUFHc1hyVEdDaURhY29yclpQTjdkazFLSUh3TURMOVhiU0N4NFpKbXFaWHlj?=
 =?utf-8?B?VU9hNC9CMkF5N3FTRXBJYVhMaEVCcTdvYnROcldreUxBV1Q0OXZ2eWNkUitG?=
 =?utf-8?B?WVlPTU55aDJLdVpmNk5oSG9EOEMvMENURVVjbXVlbTZ3WjF1am54cERBNWZv?=
 =?utf-8?B?WHl5YjBXL05NNTNnRFNPUHp1NlJBODlxME5IcndjUWJKUkZtRUFOUC9mRzlU?=
 =?utf-8?B?RXdqSGV6V3l6dnE3ME5pcWRmMG9Bb0VRb09wdzdZcU9Yb2ZISDNRakhDWjVX?=
 =?utf-8?B?Yzg2dmRhZ1BvRGdNMVNkbDQwUHQ5c0c5YTM3SzFjOTd3VStxZlc1UEMwZVFF?=
 =?utf-8?B?Q1UxVVZHdkxVc0kwZUhtVEN5a2FtVy84dEJPMHdtc2JITGp6ekRYV2pnTXJK?=
 =?utf-8?B?MitFdTI2bnBDKy8wbjRSMEY1L2tqd3NYaEs1akFhZHFSYU8xdVBsVHJ0M1Vq?=
 =?utf-8?B?SFlUK1VTL3BFWEtsNS9qK3cyd2xuTDNBT1I0TnVLTW5iVVlUVTlkcVJHdTBv?=
 =?utf-8?B?cE9CNWZTSy9KREZpQU9hQ0lEZUJvRW9WUkRCSnpqS1lrRjNqZHVmN243a1pS?=
 =?utf-8?B?cWFqMVVyK0dFQkJTUDcyUk92eHBqalBNQUhz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Y1BB?=
 =?utf-8?B?cHBnakRvT2dtU0FDMnYwTnc2bjk5Rk9ya09vUFV3TTQ0anc0bG5mRHowQnZL?=
 =?utf-8?B?NHlUbmRZanBqK2dtQi9Kc1R0b3MyZHBDUm5lUHQwL2dMVHBSU2xqRXRtdWh3?=
 =?utf-8?B?b0g0bml0bERrZzB5UzNDVWRud1A1Q1hxUGJWNm1GZk9PUHpDME5sb24xc2FW?=
 =?utf-8?B?QUFBWC8vb2hHVnZTTTdnRnp1WU5RVWgvSXJldmtudmRFUmp4OExMTk85eUVl?=
 =?utf-8?B?VWJkK0Z1VkNtdTFwYXNvRUx1cVJzTUVIRTg2MVU0bDZMSGJuYkhpRW02RjNN?=
 =?utf-8?B?S3N6bVBMVWM0bUVKZ3NYWWFjdGxzWGswMFBxeVFURDJ2L1drYVNrZ09UYThh?=
 =?utf-8?B?T2IvbEhCalZaQWhRMnJsU1FvZWZnT1ovanZwU0k2WGVSVXFvekhTcmlJUXB5?=
 =?utf-8?B?dERsT0NDcGNOUVFBTXg3MGt6LzYzZy9Mb0ZRcXY0akhXdG5ydDliN2hMNUdE?=
 =?utf-8?B?TTFGRXVvbC9FTlNYVWdnV1ByWGJpMzZqRGNzVkVQd3VHSHNVcDVEWjFhQjZG?=
 =?utf-8?B?cXNaczNKaGloU0lud0dHQ3c4QjMyZWhnV1pyVFdKaEZSaU10OEhuejUrN05O?=
 =?utf-8?B?SHVhWGJvNUMzZ3J5NDFCUjc0b2xJNk9lNi9IcENsQ0M4TVpWOGZBMGUzQzhz?=
 =?utf-8?B?VGc9PQ==?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <DCA321D02ADB224DAAA5E83265D7B780@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bee0e650-f86e-45d7-7208-08db8e8cb3ef
X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jul 2023 10:31:56.8434
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: VGa/dd8rUJYw9kef2hYKHPhBgQQUu7ynAaVGVr0zB0lBKOO8ocobo14P73rK9nFyEpr3BYiRuKKlPgA0D1n3PQ0PtWBULLujjBP3/J80MFQ=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR03MB6515
X-Proofpoint-GUID: EIii4BxC85ozcCG3VKTHB8jWZPmyZ5OJ
X-Proofpoint-ORIG-GUID: EIii4BxC85ozcCG3VKTHB8jWZPmyZ5OJ
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-27_06,2023-07-26_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0
 mlxlogscore=738 spamscore=0 clxscore=1015 priorityscore=1501 mlxscore=0
 lowpriorityscore=0 adultscore=0 malwarescore=0 impostorscore=0
 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307270094

DQpIaSBKYW4NCg0KSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPiB3cml0ZXM6DQoNCj4g
T24gMjcuMDcuMjAyMyAwMjo1NiwgVm9sb2R5bXlyIEJhYmNodWsgd3JvdGU6DQo+PiBIaSBSb2dl
ciwNCj4+IA0KPj4gUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+IHdyaXRl
czoNCj4+IA0KPj4+IE9uIFdlZCwgSnVsIDI2LCAyMDIzIGF0IDAxOjE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BzZWUgbm8NCj4+IHByb2JsZW0gdGhlcmUsIGFzIHZhbHVlcyBvZiB0aG9zZSBm
aWVsZHMgYXJlIG5vdCBzdXBwb3NlZCB0byBiZSBjaGFuZ2VkLg0KPg0KPiBCdXQgd2hldGhlciBm
aWVsZHMgYXJlIGJhc2ljIG9yIHdpbGwgbmV2ZXIgY2hhbmdlIGRvZXNuJ3QgbWF0dGVyIHdoZW4N
Cj4gdGhlIHBkZXYgc3RydWN0IGl0c2VsZiBzdWRkZW5seSBkaXNhcHBlYXJzLg0KDQpUaGlzIGlz
IG5vdCBhIHByb2JsZW0sIGFzIGl0IGlzIGV4cGVjdGVkIHRoYXQgZC0+cGNpX2xvY2sgaXMgYmVp
bmcgaGVsZCwNCnNvIHBkZXYgc3RydWN0dXJlIHdpbGwgbm90IGRpc2FwcGVhci4gSSBhbSB0cnlp
bmcgdG8gYW5zd2VyIGFub3RoZXINCnF1ZXN0aW9uOiBpcyBkLT5wY2lfbG9jayBlbm91Z2ggb3Ig
cGNpZGV2c19sb2NrIGlzIGFsc28gc2hvdWxkIHJlcXVpcmVkPw0KDQotLSANCldCUiwgVm9sb2R5
bXly


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 10:32:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 10:32:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570995.893749 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyIJ-0003Zz-67; Thu, 27 Jul 2023 10:32:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570995.893749; Thu, 27 Jul 2023 10:32:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyIJ-0003Zs-3V; Thu, 27 Jul 2023 10:32:31 +0000
Received: by outflank-mailman (input) for mailman id 570995;
 Thu, 27 Jul 2023 10:32:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eXb/=DN=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qOyIH-0003AY-Gv
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 10:32:29 +0000
Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com
 [2607:f8b0:4864:20::1032])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e146129c-2c68-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 12:32:28 +0200 (CEST)
Received: by mail-pj1-x1032.google.com with SMTP id
 98e67ed59e1d1-2659b1113c2so160323a91.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 03:32:28 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 8-20020a17090a018800b0026309d57724sm2755058pjc.39.2023.07.27.03.32.13
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 27 Jul 2023 03:32:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e146129c-2c68-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690453945; x=1691058745;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=4VsKgOIlO7JTMbURB3u+V7Qr/QzOpc+0Bt56AjhAYAM=;
        b=Zr/NhsMbDbdIdSqoueTQTw00LusmUmyLrdR7MeDx+ZO5Q+75jdmzv373GL0Ee5CtKr
         W6fluKiuFJCg5ZU3kW0Km101UvphMU1vBCY7hDEO6TFqab4XzqrIV8fVDPR2Owpqim7U
         N3OX4eAxVQVjc5z6Zvv7YweV9TAIgzv2mVUZoaytYD45Z4tHHiC7Kn023GaYmi5v6RKy
         g9n+r/2KPb5qfD2ZK/MDUQIwCLsfUVl7c4q/2XRu1uefpNinWMEwlZLohyik+zojbFUF
         urJtl81vW3ulTBjRT5ht+WLfC03kh8PaMNuzZ2kESl6uu5dT49u0KrVoAN4kKuQ8SPSD
         k2iA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690453945; x=1691058745;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=4VsKgOIlO7JTMbURB3u+V7Qr/QzOpc+0Bt56AjhAYAM=;
        b=hiYtVNOLMofMExT6wPK2p09gI80E55bQSADjs+iexaICMoQ34iiA5TRvg+wCo9n/Kk
         d8rlmKKEN8y23QlLW6+SKB+6r2n/1kfXdjhIa0RuAls4euubJMDRLa9cTHGS2O6qZj9f
         a8UIRHMYlWkBfz3xQC+Vh3Oqvb4n2comrC+q7/Bkc4k6fcTTUUWBSjLD4HSyPV+k1gDa
         btO2DmZ6K+mEYt3MJvzLJXAtilDeJj60+UIKPMIXQNyThBtWslTj+6RHCRQBBroIXUJb
         A68ELgrPoqYZM5diWNeCyImg1bArW30z/2zzyYwKSyN43x+zh2CRj4iGiJCAZTAAZOQ7
         iZrg==
X-Gm-Message-State: ABy/qLZeq59bkmZ/Y+N9X0y1hpJ3wxaarLS3bs7fwllpIVpukvc/0Mmq
	AFtpeWTFD4eex4F1xXr4JIK7yw==
X-Google-Smtp-Source: APBJJlGmzPZn88CMJAqpsojyTb97uikW28yo5O3pi8rH8SDlSH8BwjASuoOudfeGFyxgCSRxAf0mLA==
X-Received: by 2002:a17:90a:1b06:b0:263:2312:60c2 with SMTP id q6-20020a17090a1b0600b00263231260c2mr4299433pjq.3.1690453945653;
        Thu, 27 Jul 2023 03:32:25 -0700 (PDT)
Message-ID: <cc819e13-cb25-ddaa-e0e3-7328f5ea3a4f@bytedance.com>
Date: Thu, 27 Jul 2023 18:32:10 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 28/49] dm zoned: dynamically allocate the dm-zoned-meta
 shrinker
Content-Language: en-US
To: Damien Le Moal <dlemoal@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 Muchun Song <songmuchun@bytedance.com>, akpm@linux-foundation.org,
 david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz, roman.gushchin@linux.dev,
 djwong@kernel.org, brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu,
 steven.price@arm.com, cel@kernel.org, senozhatsky@chromium.org,
 yujie.liu@intel.com, gregkh@linuxfoundation.org, muchun.song@linux.dev
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
 <20230727080502.77895-29-zhengqi.arch@bytedance.com>
 <baaf7de4-9a0e-b953-2b6a-46e60c415614@kernel.org>
 <56ee1d92-28ee-81cb-9c41-6ca7ea6556b0@bytedance.com>
 <ba0868b2-9f90-3d81-1c91-8810057fb3ce@kernel.org>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <ba0868b2-9f90-3d81-1c91-8810057fb3ce@kernel.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 2023/7/27 18:20, Damien Le Moal wrote:
> On 7/27/23 17:55, Qi Zheng wrote:
>>>>  Â Â Â Â Â Â Â Â Â  goto err;
>>>>  Â Â Â Â Â  }
>>>>  Â  +Â Â Â  zmd->mblk_shrinker->count_objects = dmz_mblock_shrinker_count;
>>>> +Â Â Â  zmd->mblk_shrinker->scan_objects = dmz_mblock_shrinker_scan;
>>>> +Â Â Â  zmd->mblk_shrinker->seeks = DEFAULT_SEEKS;
>>>> +Â Â Â  zmd->mblk_shrinker->private_data = zmd;
>>>> +
>>>> +Â Â Â  shrinker_register(zmd->mblk_shrinker);
>>>
>>> I fail to see how this new shrinker API is better... Why isn't there a
>>> shrinker_alloc_and_register() function ? That would avoid adding all this code
>>> all over the place as the new API call would be very similar to the current
>>> shrinker_register() call with static allocation.
>>
>> In some registration scenarios, memory needs to be allocated in advance.
>> So we continue to use the previous prealloc/register_prepared()
>> algorithm. The shrinker_alloc_and_register() is just a helper function
>> that combines the two, and this increases the number of APIs that
>> shrinker exposes to the outside, so I choose not to add this helper.
> 
> And that results in more code in many places instead of less code + a simple
> inline helper in the shrinker header file... So not adding that super simple

It also needs to be exported to the driver for use.

> helper is not exactly the best choice in my opinion.

Hm, either one is fine for me. If no one else objects, I can add this
helper. ;)

> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 10:38:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 10:38:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.570998.893759 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyO8-0004LM-Qe; Thu, 27 Jul 2023 10:38:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 570998.893759; Thu, 27 Jul 2023 10:38:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyO8-0004LF-O1; Thu, 27 Jul 2023 10:38:32 +0000
Received: by outflank-mailman (input) for mailman id 570998;
 Thu, 27 Jul 2023 10:38:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Tn4a=DN=epam.com=prvs=157204e9ea=oleksandr_tyshchenko@srs-se1.protection.inumbo.net>)
 id 1qOyO6-0004L9-S1
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 10:38:30 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b925c9ff-2c69-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 12:38:29 +0200 (CEST)
Received: from pps.filterd (m0174677.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36RAQPwG006731; Thu, 27 Jul 2023 10:38:25 GMT
Received: from eur05-am6-obe.outbound.protection.outlook.com
 (mail-am6eur05lp2104.outbound.protection.outlook.com [104.47.18.104])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3s36wyu425-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 27 Jul 2023 10:38:23 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com (2603:10a6:10:ed::15)
 by DU2PR03MB7848.eurprd03.prod.outlook.com (2603:10a6:10:2d3::14) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 10:38:03 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::3a00:d290:e446:d887]) by DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::3a00:d290:e446:d887%3]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 10:38:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b925c9ff-2c69-11ee-b247-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=HTwqXwOz/seFC69WulJWy9viYNytZMIoni3gzkpGTiA0PhSIovpoeZIWX/2gvIfTau/olTE/T0yZJvFq1z2OjhBqxnn8ZyOY1q6mj4LeezCvnzTn1QdF87QALssaZM89MApwEOS3Hkcw/7+XATIFfpaMhRYXbw3XumiDl9SR+VSpHV9y76EGfsru4r+y8vFR7cb+TOWAe/HD4tomvFcgbjtdjn72NAU7b1tFZqeT64xEYLsErE6E9APKZ24FY+JysOiUYGHoOi5+GQD8rUhxF/8140VDToRTTt05dSKXoXiVkd+vJnNNZu2PpkEg4dsjyL4bPczBXaiZpsrNavHfZg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=fwE9A2LIVRsx1sJwOm8QTIoJsbgF1CFusqbdAye2whU=;
 b=Ao3dX1zYC6+xAmZw8NS+cI4A9WDLB/Hr7CyQ553TMEy1UYJQCNhR+hWYFYqe9MYvNbt/etWMe0OU7C4igvlJyZm3B5pWXn2BK0JoJM5F+WsM+ICWJq/Ez17lANR/GWtFAujeGnG0xJB4+BEl/IeYhEnORkTUpRh6LCiRWs0Yoxo+5ue7QJt4pysb4wXsIS6r/9aS65WZb1/g303jUI+oaGeFuYPYRNOoW0qpkmaZVVPtSACMzFQrfjBxqYaYNzeAps1dVboTWCwS7Hz0ZjFqOPVcH3FStPve6GMBMcVx618JrvtJF7K1IZ2W8TUFntbfj7vCdFGJ1vSnNv3zfVHCoQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fwE9A2LIVRsx1sJwOm8QTIoJsbgF1CFusqbdAye2whU=;
 b=iHGQn9eIS+n0dNc0fuIlhYEI/XXLP2sXTluCuA76OxvaRzYEHkLN4mlRsO7hJ4xzA35GDeKMMMncbJjHentLeaP4YncNeN25ad6WycpQkZRMLAWc8zv93EuDpcrGeCD5BjIudyPaVtsIJTrlXRrtFFkWtr071F0bN/uyUgdKtrRUn3rj5L5rEyMhuh7Z3VwHD06KXB9RXJeZkUVEFObX1U9esqpXlKXlwv7tkad6A6MzyR9ftv1xH0cy8SqGqm5se8OvPvHzD0JLsCbMJzbqSaHJd6QD7K2hPd3qxe4nF6wkbc5mzCxbQwjQDCYX4kzVpMXh4vsJkPCHZmNhT75qMg==
From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
To: Anthony PERARD <anthony.perard@citrix.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
        Wei Liu
	<wl@xen.org>, Oleksandr Tyshchenko <olekstysh@gmail.com>,
        Juergen Gross
	<jgross@suse.com>,
        Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: [PATCH] libxl: Add missing libxl__virtio_devtype to
 device_type_tbl array
Thread-Topic: [PATCH] libxl: Add missing libxl__virtio_devtype to
 device_type_tbl array
Thread-Index: AQHZv8uYlQiykVHkhkC1aQss9HQu9q/NX+QAgAANWwA=
Date: Thu, 27 Jul 2023 10:38:03 +0000
Message-ID: <5360d7ae-b754-99f9-686f-882bdc33e7eb@epam.com>
References: <20230726141459.985463-1-olekstysh@gmail.com>
 <670c22f9-135d-4022-8272-78af3e28c011@perard>
In-Reply-To: <670c22f9-135d-4022-8272-78af3e28c011@perard>
Accept-Language: en-US, ru-RU
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DB8PR03MB6108:EE_|DU2PR03MB7848:EE_
x-ms-office365-filtering-correlation-id: 1c76d446-a178-4e30-f1bb-08db8e8d8e66
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 t8lJKnXq/8eDRtgsXliM2LGZp8wQagYUOtDrkMtIDeu++kMrtxzZJGIRV4LgLc+nuNqHu4PdaUVzwrOmVNTFJyTWp3XA1s7+KvVfou0M2JfLaDVh+hIvtNcYa5YihXSqEz950Ca4EEMX5zdcxZdUEtRK7FhdfBv2cn4GBUXDJrqXG3e2iFKqYPjuSs84Texva21q+34VVSaeS4aq8UC7r13fnnp4JTNqc++rklzsk7UZ6/XVBKaVmIK6/XKSlkobizyP+I5cMvtfPTIOKwxzBaSbAeIrv2BNcZbChnOs7QKd4OV8O/O0NUAjGXLpbCtJtfGgUyDnwT6igpaYcCIPDkDLMKOtgz728aTN/QnHQ6axq4SpTG2EmFBpzixtQ4Kot0QUoNVyvivuallOeUD8SV7ikwa25LaK0o+giVVKWOPn3LI3vbA8AQYzrmA5Dun3uBLBpNxkM6GgCK2Ds5Ho+mwKWKW58oCkUr4JjKtPNnHzPznOurBduGo2JwIsmBnPxteUNAKXxiDOw9JU5ugFSazKVqM1wpwjejumy6FjXGUxXWN3kj4aSrifkUiexaehLJGwgS1/Bl6X+AEIKxF6JIXiJNSDwuJI6edunaoZU3ygY4H/dFpxc+Y0aZXo7rqvvyZRcX9WyqH+CZCSFOgGZxFu8z7Nd71dUDXGSPqmrm54qgNsVYOZyq6Cj48J81NA
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR03MB6108.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199021)(6486002)(83380400001)(71200400001)(478600001)(26005)(53546011)(6506007)(6512007)(2616005)(66446008)(66476007)(38100700002)(91956017)(122000001)(54906003)(66556008)(64756008)(6916009)(4326008)(186003)(66946007)(76116006)(31686004)(8936002)(8676002)(5660300002)(2906002)(316002)(41300700001)(86362001)(31696002)(36756003)(38070700005)(101420200003)(45980500001);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-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MnhtbTVuUXEzNnk0Mi9U?=
 =?utf-8?B?RVdHQk5sdmdHeVFSK1BMMmIxL25BWHdYVU9vRlF0dE05ck9kL0lFUElUVUgy?=
 =?utf-8?B?eUlLWmtUekNKbzdMTFlQN1VBckxVdFhuUWlKdk5TOXJXUFNiNlpNNHlvR1lH?=
 =?utf-8?B?a2RTa2dITlRYSnJRLytrOHd1b2JDSFpFdmhVQmk1NDd6WTA3M0RzdmNITGpp?=
 =?utf-8?B?TmtOMzZjUlVuWG8zVFUybzFTZU5PL2lzdWZoSDJHWENZc1RmcVJEempVVVZR?=
 =?utf-8?B?UHZ3eWpQbjc5VmNaZHNOZk1HRys1YnB2NHR1MGJJak1iUnlJSmJlUHRraEdv?=
 =?utf-8?B?YXFMOUNldThHM2VkemZ5a3owemxLUWQ2bU5zQ0t3UTJNZ2VlMFcxb2dyQ2o3?=
 =?utf-8?B?T1pPSXhxRFUrNWd5ekZ1VDZ4eEdxb21PZnR4T1YxcHE0T1VSWWh4bmNPSWp1?=
 =?utf-8?Q?vBzxc3Xxhg64WTVwrOE2kck=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <547A6BD1FE1BCD4D831DF14A0F186EDC@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DB8PR03MB6108.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1c76d446-a178-4e30-f1bb-08db8e8d8e66
X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jul 2023 10:38:03.3603
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: D5NhRU6uOvkN9Z59o5wf6lQdxR97H7s9OIzURuT49kfDtwo0Gf6gGCeSNUh6TKF+3qSIHaEaUOLsWXRgiAYKM22HiZ3cfJVaNDKnhRfxFPU=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR03MB7848
X-Proofpoint-ORIG-GUID: UrmSiBSJsAGPEcmcIXacaWAYmXC_kBF5
X-Proofpoint-GUID: UrmSiBSJsAGPEcmcIXacaWAYmXC_kBF5
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-27_05,2023-07-26_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxlogscore=690
 phishscore=0 adultscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0
 mlxscore=0 priorityscore=1501 bulkscore=0 spamscore=0 impostorscore=0
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000
 definitions=main-2307270095

DQoNCk9uIDI3LjA3LjIzIDEyOjUwLCBBbnRob255IFBFUkFSRCB3cm90ZToNCg0KSGVsbG8gQW50
aG9ueQ0KDQo+IE9uIFdlZCwgSnVsIDI2LCAyMDIzIGF0IDA1OjE0OjU5UE0gKzAzMDAsIE9sZWtz
YW5kciBUeXNoY2hlbmtvIHdyb3RlOg0KPj4gRnJvbTogT2xla3NhbmRyIFR5c2hjaGVua28gPG9s
ZWtzYW5kcl90eXNoY2hlbmtvQGVwYW0uY29tPg0KPj4NCj4+IFdpdGhvdXQgaXQgYmVpbmcgcHJl
c2VudCBpdCB3b24ndCBiZSBwb3NzaWJsZSB0byB1c2Ugc29tZQ0KPj4gbGlieGxfX2RldmljZV90
eXBlJ3MgY2FsbGJhY2tzIGZvciB2aXJ0aW8gZGV2aWNlcyBhcyB0aGUgY29tbW9uIGNvZGUNCj4+
IGNhbiBvbmx5IGludm9rZSB0aGVzZSBjYWxsYmFja3MgKGJ5IGRlcmVmZXJlbmNpbmcgYSBwb2lu
dGV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archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 10:46:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571001.893768 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyVM-0005uf-MB; Thu, 27 Jul 2023 10:46:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571001.893768; Thu, 27 Jul 2023 10:46:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyVM-0005uY-Jh; Thu, 27 Jul 2023 10:46:00 +0000
Received: by outflank-mailman (input) for mailman id 571001;
 Thu, 27 Jul 2023 10:45:59 +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
 <SRS0=mGGP=DN=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qOyVL-0005uQ-Oo
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 10:45:59 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c42f73ef-2c6a-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 12:45:57 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.161.207.213])
 by support.bugseng.com (Postfix) with ESMTPSA id B38DB4EE073F;
 Thu, 27 Jul 2023 12:45:54 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c42f73ef-2c6a-11ee-8613-37d641c3527e
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: simone.ballarin@bugseng.com,
	xen-devel@lists.xenproject.org
Cc: Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH 3/4] x86/mm: mechanically rename variable to avoid shadowing
Date: Thu, 27 Jul 2023 12:45:43 +0200
Message-Id: <62f4a9e7a19b37c970e52f138a6eeb8f7363b7bc.1690449587.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690449587.git.nicola.vetrini@bugseng.com>
References: <cover.1690449587.git.nicola.vetrini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The rename s/p2mt/t/ is done to avoid shadowing the same declaration
in the enclosing scope.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
Is the semantics of the function altered if the inner declaration
is removed entirely?
---
 xen/arch/x86/mm/p2m.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 714358f953..fa9f7616e8 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2439,12 +2439,12 @@ int xenmem_add_to_physmap_one(
 
     case XENMAPSPACE_gmfn:
     {
-        p2m_type_t p2mt;
+        p2m_type_t t;
 
         gfn = idx;
-        mfn = get_gfn_unshare(d, gfn, &p2mt);
+        mfn = get_gfn_unshare(d, gfn, &t);
         /* If the page is still shared, exit early */
-        if ( p2m_is_shared(p2mt) )
+        if ( p2m_is_shared(t) )
         {
             put_gfn(d, gfn);
             return -ENOMEM;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 10:46:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 10:46:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571002.893778 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyVT-0006Bm-TH; Thu, 27 Jul 2023 10:46:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571002.893778; Thu, 27 Jul 2023 10:46:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyVT-0006Bd-Qg; Thu, 27 Jul 2023 10:46:07 +0000
Received: by outflank-mailman (input) for mailman id 571002;
 Thu, 27 Jul 2023 10:46:07 +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
 <SRS0=o85N=DN=citrix.com=prvs=5659ebe79=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qOyVT-0005uQ-As
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 10:46:07 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c69b1a9e-2c6a-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 12:46:02 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c69b1a9e-2c6a-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690454762;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=BUw7+zeVQ4Yt6rN2cLxd2PTsfKKz6t8bkg9dXC3lD4A=;
  b=friIZLRUuyhX+NwoKWgkcvhiZkF75zoQOJyfpEQze1u3M9Kh4tapvFG7
   dhn6HYDtm+5p7lA2nZbZuGzMEUqaMJELjymyesyN2eIp/3603Z9aY6TTU
   TdxJN/sXRkUTXsAlovkhlxapmYh6HALImYwJseNORl93aI0TFmyJL+J6E
   8=;
Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 120254669
X-Ironport-Server: esa4.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:A8vgiKBOASEfwxVW/+rjw5YqxClBgxIJ4kV8jS/XYbTApDJz3zMGz
 jRLCzqOOvaOZWCgKNkiPt61/E0EvpTRn4IyQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h
 yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs
 t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GxC4QRnDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS
 uDKyq2O/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AZniWhILXFvAB0WKK+VSJcREWndQttp
 uIHZIObeEZBjBB/LvHCGHTKbodKLLsys+VbSi19RpQZDAvUoUlyzpQTj+cFEgefng3OXL6fq
 DsmvauY1CbCAoqhgHQPAh7YwG5naytqLvWJSQeAgIh6k2kkTOs5dfBYmOl9yZbaSpL3bAhtV
 LkvmXCl8OemsD+8AbYy2jQq65bg8Ts0fxKAMDksLltFhzczjywYZhnWfm8sCsuoOepgWxa6O
 Xxnw==
X-Talos-CUID: 9a23:Hl0WM27TLeG71Mqpf9ss0UEXCME8U13n61jiHU2IB39oU5SqRgrF
X-Talos-MUID: =?us-ascii?q?9a23=3AZx87Ggxh1oVJBEBCWppEEOIpTvmaqJu1WUY3zrg?=
 =?us-ascii?q?WgPvHJXxpFnSe1yWqXYByfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,234,1684814400"; 
   d="scan'208";a="120254669"
Date: Thu, 27 Jul 2023 11:45:51 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Jason Andryuk <jandryuk@gmail.com>
CC: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>, Juergen Gross
	<jgross@suse.com>, Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v7 05/15] pmstat&xenpm: Re-arrage for cpufreq union
Message-ID: <2e25ad50-085e-430c-b027-bd386b50a7ea@perard>
References: <20230726170945.34961-1-jandryuk@gmail.com>
 <20230726170945.34961-6-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230726170945.34961-6-jandryuk@gmail.com>

On Wed, Jul 26, 2023 at 01:09:35PM -0400, Jason Andryuk wrote:
> Rearrange code now that xen_sysctl_pm_op's get_para fields has the
> nested union and struct.  In particular, the scaling governor
> information like scaling_available_governors is inside the union, so it
> is not always available.  Move those fields (op->u.get_para.u.s.u.*)
> together as well as the common fields (ones outside the union like
> op->u.get_para.turbo_enabled).
> 
> With that, gov_num may be 0, so bounce buffer handling needs
> to be modified.
> 
> scaling_governor and other fields inside op->u.get_para.u.s.u.* won't be
> used for hwp, so this will simplify the change when hwp support is
> introduced and re-indents these lines all together.
> 
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> Acked-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 10:48:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 10:48:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571006.893788 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyXq-00072N-9H; Thu, 27 Jul 2023 10:48:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571006.893788; Thu, 27 Jul 2023 10:48:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyXq-00072G-6e; Thu, 27 Jul 2023 10:48:34 +0000
Received: by outflank-mailman (input) for mailman id 571006;
 Thu, 27 Jul 2023 10:48:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mGGP=DN=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qOyXp-00072A-Br
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 10:48:33 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2123079f-2c6b-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 12:48:32 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.161.207.213])
 by support.bugseng.com (Postfix) with ESMTPSA id 48FD94EE073F;
 Thu, 27 Jul 2023 12:48:30 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2123079f-2c6b-11ee-b247-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Paul Durrant <paul@xen.org>,
	George Dunlap <george.dunlap@citrix.com>
Subject: [XEN PATCH 0/4] address violations of MISRA C:2012 Rule 5.3 on x86
Date: Thu, 27 Jul 2023 12:47:58 +0200
Message-Id: <cover.1690449587.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This series aims to address some violations of MISRA C:2012 Rule 5.3:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope"

To resolve such violations two strategies have been applied:

1. rename several function parameters or local variables;
2. remove a local variable declaration in an inner scope, if
   using the outer variable does not change the semantics of the function.

Nicola Vetrini (4):
  x86: mechanically rename to address MISRA C:2012 Rule 5.3
  x86/emulate: move a variable declaration to address MISRA C:2012 Rule
    5.3
  x86/mm: mechanically rename variable to avoid shadowing
  x86: avoid shadowing to address MISRA C:2012 Rule 5.3

 xen/arch/x86/apic.c                    |  8 ++++----
 xen/arch/x86/cpu/mcheck/mce.c          | 12 ++++++------
 xen/arch/x86/cpu/mwait-idle.c          | 24 ++++++++++++------------
 xen/arch/x86/domain.c                  |  2 +-
 xen/arch/x86/e820.c                    |  6 +++---
 xen/arch/x86/emul-i8254.c              |  2 +-
 xen/arch/x86/hvm/emulate.c             |  6 +++---
 xen/arch/x86/include/asm/e820.h        |  2 +-
 xen/arch/x86/include/asm/hvm/save.h    |  8 ++++----
 xen/arch/x86/include/asm/hvm/vpt.h     |  2 +-
 xen/arch/x86/mm/p2m.c                  |  6 +++---
 xen/arch/x86/psr.c                     |  4 ++--
 xen/arch/x86/traps.c                   |  4 ++--
 xen/arch/x86/x86_emulate/x86_emulate.c | 14 ++++++--------
 14 files changed, 49 insertions(+), 51 deletions(-)

--
2.34.1


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 10:48:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 10:48:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571007.893799 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyXs-0007Hf-GV; Thu, 27 Jul 2023 10:48:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571007.893799; Thu, 27 Jul 2023 10:48:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyXs-0007HY-DR; Thu, 27 Jul 2023 10:48:36 +0000
Received: by outflank-mailman (input) for mailman id 571007;
 Thu, 27 Jul 2023 10:48:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mGGP=DN=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qOyXq-00072A-Ub
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 10:48:34 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 221be437-2c6b-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 12:48:34 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.161.207.213])
 by support.bugseng.com (Postfix) with ESMTPSA id 836C64EE0741;
 Thu, 27 Jul 2023 12:48:32 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 221be437-2c6b-11ee-b247-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH 1/4] x86: mechanically rename to address MISRA C:2012 Rule 5.3
Date: Thu, 27 Jul 2023 12:47:59 +0200
Message-Id: <614dd6fe03ab82db83eabc430b27435b19096791.1690449587.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690449587.git.nicola.vetrini@bugseng.com>
References: <cover.1690449587.git.nicola.vetrini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rule 5.3 has the following headline:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope"

The renames done by this patch avoid shadowing from happening.
They are as follows:
- s/str/s/ in 'lapic_disable'
- s/str/level/ in '(apic|mce)_set_verbosity'
- s/str/state_str/ in 'mwait_idle_probe'
- s/str/memmap_name/ in 'init_e820'
- s/i/j/ in 'mce_action' (the shadowing here is due to macro
  'x86_mcinfo_lookup' that defines 'i' as a loop counter)
- s/desc/descriptor/ in '_hvm_load_entry'
- s/socket_info/sock_info/ in 'do_write_psr_msrs'
- s/debug_stack_lines/dbg_stack_lines/ in 'compat_show_guest_stack'

The parameter 'cpu_khz' that causes a violation in 'pit_init'
is unused, and hence can be removed.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
Function 'str' in 'xen/arch/x86/include/asm/desc.h'
causes the shadowing.
---
 xen/arch/x86/apic.c                 |  8 ++++----
 xen/arch/x86/cpu/mcheck/mce.c       | 12 ++++++------
 xen/arch/x86/cpu/mwait-idle.c       | 24 ++++++++++++------------
 xen/arch/x86/domain.c               |  2 +-
 xen/arch/x86/e820.c                 |  6 +++---
 xen/arch/x86/emul-i8254.c           |  2 +-
 xen/arch/x86/include/asm/e820.h     |  2 +-
 xen/arch/x86/include/asm/hvm/save.h |  8 ++++----
 xen/arch/x86/include/asm/hvm/vpt.h  |  2 +-
 xen/arch/x86/psr.c                  |  4 ++--
 xen/arch/x86/traps.c                |  4 ++--
 11 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 41879230ec..57ec500408 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -760,7 +760,7 @@ int lapic_resume(void)
  * Original code written by Keir Fraser.
  */
 
-static int __init cf_check lapic_disable(const char *str)
+static int __init cf_check lapic_disable(const char *s)
 {
     enable_local_apic = -1;
     setup_clear_cpu_cap(X86_FEATURE_APIC);
@@ -769,11 +769,11 @@ static int __init cf_check lapic_disable(const char *str)
 custom_param("nolapic", lapic_disable);
 boolean_param("lapic", enable_local_apic);
 
-static int __init cf_check apic_set_verbosity(const char *str)
+static int __init cf_check apic_set_verbosity(const char *level)
 {
-    if (strcmp("debug", str) == 0)
+    if (strcmp("debug", level) == 0)
         apic_verbosity = APIC_DEBUG;
-    else if (strcmp("verbose", str) == 0)
+    else if (strcmp("verbose", level) == 0)
         apic_verbosity = APIC_VERBOSE;
     else
         return -EINVAL;
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index c2173cfc78..9d76a462a7 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -63,9 +63,9 @@ struct mca_banks *mca_allbanks;
 #endif
 
 int mce_verbosity;
-static int __init cf_check mce_set_verbosity(const char *str)
+static int __init cf_check mce_set_verbosity(const char *level)
 {
-    if ( strcmp("verbose", str) == 0 )
+    if ( strcmp("verbose", level) == 0 )
         mce_verbosity = MCE_VERBOSE;
     else
         return -EINVAL;
@@ -1746,7 +1746,7 @@ static enum mce_result mce_action(const struct cpu_user_regs *regs,
     struct mcinfo_common *mic = NULL;
     struct mca_binfo binfo;
     const struct mca_error_handler *handlers = mce_dhandlers;
-    unsigned int i, handler_num = mce_dhandler_num;
+    unsigned int j, handler_num = mce_dhandler_num;
 
     /* When in mce context, regs is valid */
     if ( regs )
@@ -1780,11 +1780,11 @@ static enum mce_result mce_action(const struct cpu_user_regs *regs,
         binfo.mib = (struct mcinfo_bank *)mic;
         binfo.bank = binfo.mib->mc_bank;
         bank_result = MCER_NOERROR;
-        for ( i = 0; i < handler_num; i++ )
+        for ( j = 0; j < handler_num; j++ )
         {
-            if ( handlers[i].owned_error(binfo.mib->mc_status) )
+            if ( handlers[j].owned_error(binfo.mib->mc_status) )
             {
-                handlers[i].recovery_handler(&binfo, &bank_result, regs);
+                handlers[j].recovery_handler(&binfo, &bank_result, regs);
                 if ( worst_result < bank_result )
                     worst_result = bank_result;
                 break;
diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index ff5c808bc9..8abe14773d 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -1429,7 +1429,7 @@ static int __init mwait_idle_probe(void)
 {
 	unsigned int eax, ebx, ecx;
 	const struct x86_cpu_id *id = x86_match_cpu(intel_idle_ids);
-	const char *str;
+	const char *state_str;
 
 	if (!id) {
 		pr_debug(PREFIX "does not run on family %d model %d\n",
@@ -1471,10 +1471,10 @@ static int __init mwait_idle_probe(void)
 	pr_debug(PREFIX "lapic_timer_reliable_states %#x\n",
 		 lapic_timer_reliable_states);
 
-	str = preferred_states;
-	if (isdigit(str[0]))
-		preferred_states_mask = simple_strtoul(str, &str, 0);
-	else if (str[0])
+	state_str = preferred_states;
+	if (isdigit(state_str[0]))
+		preferred_states_mask = simple_strtoul(state_str, &state_str, 0);
+	else if (state_str[0])
 	{
 		const char *ss;
 
@@ -1482,13 +1482,13 @@ static int __init mwait_idle_probe(void)
 			const struct cpuidle_state *state = icpu->state_table;
 			unsigned int bit = 1;
 
-			ss = strchr(str, ',');
+			ss = strchr(state_str, ',');
 			if (!ss)
-				ss = strchr(str, '\0');
+				ss = strchr(state_str, '\0');
 
 			for (; state->name[0]; ++state) {
 				bit <<= 1;
-				if (!cmdline_strcmp(str, state->name)) {
+				if (!cmdline_strcmp(state_str, state->name)) {
 					preferred_states_mask |= bit;
 					break;
 				}
@@ -1496,13 +1496,13 @@ static int __init mwait_idle_probe(void)
 			if (!state->name[0])
 				break;
 
-			str = ss + 1;
+			state_str = ss + 1;
 		} while (*ss);
 
-		str -= str == ss + 1;
+		state_str -= state_str == ss + 1;
 	}
-	if (str[0])
-		printk("unrecognized \"preferred-cstates=%s\"\n", str);
+	if (state_str[0])
+		printk("unrecognized \"preferred-cstates=%s\"\n", state_str);
 
 	mwait_idle_state_table_update();
 
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 5f66c2ae33..fe86a7f853 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -858,7 +858,7 @@ int arch_domain_create(struct domain *d,
     }
 
     /* PV/PVH guests get an emulated PIT too for video BIOSes to use. */
-    pit_init(d, cpu_khz);
+    pit_init(d);
 
     /*
      * If the FPU does not save FCS/FDS then we can always
diff --git a/xen/arch/x86/e820.c b/xen/arch/x86/e820.c
index 0b89935510..5bff35c4cf 100644
--- a/xen/arch/x86/e820.c
+++ b/xen/arch/x86/e820.c
@@ -683,11 +683,11 @@ int __init reserve_e820_ram(struct e820map *e820, uint64_t s, uint64_t e)
     return e820_change_range_type(e820, s, e, E820_RAM, E820_RESERVED);
 }
 
-unsigned long __init init_e820(const char *str, struct e820map *raw)
+unsigned long __init init_e820(const char *memmap_name, struct e820map *raw)
 {
     if ( e820_verbose )
     {
-        printk("Initial %s RAM map:\n", str);
+        printk("Initial %s RAM map:\n", memmap_name);
         print_e820_memory_map(raw->map, raw->nr_map);
     }
 
@@ -696,7 +696,7 @@ unsigned long __init init_e820(const char *str, struct e820map *raw)
     if ( cpu_has_hypervisor )
         hypervisor_e820_fixup(&e820);
 
-    printk("%s RAM map:\n", str);
+    printk("%s RAM map:\n", memmap_name);
     print_e820_memory_map(e820.map, e820.nr_map);
 
     return find_max_pfn();
diff --git a/xen/arch/x86/emul-i8254.c b/xen/arch/x86/emul-i8254.c
index a81232fc55..41ec4a1ef1 100644
--- a/xen/arch/x86/emul-i8254.c
+++ b/xen/arch/x86/emul-i8254.c
@@ -495,7 +495,7 @@ void pit_reset(struct domain *d)
     spin_unlock(&pit->lock);
 }
 
-void pit_init(struct domain *d, unsigned long cpu_khz)
+void pit_init(struct domain *d)
 {
     PITState *pit = domain_vpit(d);
 
diff --git a/xen/arch/x86/include/asm/e820.h b/xen/arch/x86/include/asm/e820.h
index 92f5efa4f5..5cb1915a6e 100644
--- a/xen/arch/x86/include/asm/e820.h
+++ b/xen/arch/x86/include/asm/e820.h
@@ -31,7 +31,7 @@ extern int e820_change_range_type(
     uint32_t orig_type, uint32_t new_type);
 extern int e820_add_range(
     struct e820map *, uint64_t s, uint64_t e, uint32_t type);
-extern unsigned long init_e820(const char *, struct e820map *);
+extern unsigned long init_e820(const char *memmap_name, struct e820map *raw);
 extern void print_e820_memory_map(const struct e820entry *map,
     unsigned int entries);
 extern struct e820map e820;
diff --git a/xen/arch/x86/include/asm/hvm/save.h b/xen/arch/x86/include/asm/hvm/save.h
index 535cf68ed2..4d0a062b2c 100644
--- a/xen/arch/x86/include/asm/hvm/save.h
+++ b/xen/arch/x86/include/asm/hvm/save.h
@@ -49,21 +49,21 @@ void _hvm_read_entry(struct hvm_domain_context *h,
  */
 #define _hvm_load_entry(_x, _h, _dst, _strict) ({                       \
     int r;                                                              \
-    struct hvm_save_descriptor *desc                                    \
+    struct hvm_save_descriptor *descriptor                              \
         = (struct hvm_save_descriptor *)&(_h)->data[(_h)->cur];         \
     if ( (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x),                 \
                HVM_SAVE_LENGTH(_x), (_strict))) == 0 )                  \
     {                                                                   \
         _hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH(_x));             \
         if ( HVM_SAVE_HAS_COMPAT(_x) &&                                 \
-             desc->length != HVM_SAVE_LENGTH(_x) )                      \
-            r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length);          \
+             descriptor->length != HVM_SAVE_LENGTH(_x) )                \
+            r = HVM_SAVE_FIX_COMPAT(_x, (_dst), descriptor->length);    \
     }                                                                   \
     else if (HVM_SAVE_HAS_COMPAT(_x)                                    \
              && (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x),          \
                        HVM_SAVE_LENGTH_COMPAT(_x), (_strict))) == 0 ) { \
         _hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH_COMPAT(_x));      \
-        r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length);              \
+        r = HVM_SAVE_FIX_COMPAT(_x, (_dst), descriptor->length);        \
     }                                                                   \
     r; })
 
diff --git a/xen/arch/x86/include/asm/hvm/vpt.h b/xen/arch/x86/include/asm/hvm/vpt.h
index 2af76ca8dc..feb0bf43f1 100644
--- a/xen/arch/x86/include/asm/hvm/vpt.h
+++ b/xen/arch/x86/include/asm/hvm/vpt.h
@@ -179,7 +179,7 @@ void destroy_periodic_time(struct periodic_time *pt);
 int pv_pit_handler(int port, int data, int write);
 void pit_reset(struct domain *d);
 
-void pit_init(struct domain *d, unsigned long cpu_khz);
+void pit_init(struct domain *d);
 void pit_stop_channel0_irq(PITState * pit);
 void pit_deinit(struct domain *d);
 void rtc_init(struct domain *d);
diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index a1e0af27c5..90bcb25e60 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -1252,7 +1252,7 @@ static void cf_check do_write_psr_msrs(void *data)
 {
     const struct cos_write_info *info = data;
     unsigned int i, index, cos = info->cos;
-    const struct psr_socket_info *socket_info =
+    const struct psr_socket_info *sock_info =
         get_socket_info(cpu_to_socket(smp_processor_id()));
 
     /*
@@ -1261,7 +1261,7 @@ static void cf_check do_write_psr_msrs(void *data)
      */
     for ( index = i = 0; i < ARRAY_SIZE(feat_props); i++ )
     {
-        struct feat_node *feat = socket_info->features[i];
+        struct feat_node *feat = sock_info->features[i];
         const struct feat_props *props = feat_props[i];
         unsigned int cos_num, j;
 
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 4229bda159..f32cd2126d 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -196,7 +196,7 @@ void show_code(const struct cpu_user_regs *regs)
 
 static void compat_show_guest_stack(struct vcpu *v,
                                     const struct cpu_user_regs *regs,
-                                    int debug_stack_lines)
+                                    int dbg_stack_lines)
 {
     unsigned int i, *stack, addr, mask = STACK_SIZE;
     void *stack_page = NULL;
@@ -233,7 +233,7 @@ static void compat_show_guest_stack(struct vcpu *v,
             mask = PAGE_SIZE;
     }
 
-    for ( i = 0; i < debug_stack_lines * 8; i++ )
+    for ( i = 0; i < dbg_stack_lines * 8; i++ )
     {
         if ( (((long)stack - 1) ^ ((long)(stack + 1) - 1)) & mask )
             break;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 10:48:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 10:48:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571008.893809 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyXt-0007XR-OR; Thu, 27 Jul 2023 10:48:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571008.893809; Thu, 27 Jul 2023 10:48:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyXt-0007XJ-Kh; Thu, 27 Jul 2023 10:48:37 +0000
Received: by outflank-mailman (input) for mailman id 571008;
 Thu, 27 Jul 2023 10:48:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mGGP=DN=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qOyXr-00072A-UA
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 10:48:35 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 22dfe1fc-2c6b-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 12:48:35 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.161.207.213])
 by support.bugseng.com (Postfix) with ESMTPSA id 25CF34EE0742;
 Thu, 27 Jul 2023 12:48:34 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 22dfe1fc-2c6b-11ee-b247-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Paul Durrant <paul@xen.org>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH 2/4] x86/emulate: move a variable declaration to address MISRA C:2012 Rule 5.3
Date: Thu, 27 Jul 2023 12:48:00 +0200
Message-Id: <bc3a28abf9f00bf67cf5ee64bd89e7d38e321c06.1690449587.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690449587.git.nicola.vetrini@bugseng.com>
References: <cover.1690449587.git.nicola.vetrini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The declaration of local variable 'bytes' in 'hvmemul_rep_stos' causes
the shadowing of the same variable defined in the enclosing scope,
hence the declaration has been moved inside the scope where it's used,
with a different name.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/x86/hvm/emulate.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 75ee98a73b..0d41928ff3 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -2024,15 +2024,15 @@ static int cf_check hvmemul_rep_stos(
 
     switch ( p2mt )
     {
-        unsigned long bytes;
         char *buf;
 
     default:
         /* Allocate temporary buffer. */
         for ( ; ; )
         {
-            bytes = *reps * bytes_per_rep;
-            buf = xmalloc_bytes(bytes);
+            unsigned long bytes_tmp;
+            bytes_tmp = *reps * bytes_per_rep;
+            buf = xmalloc_bytes(bytes_tmp);
             if ( buf || *reps <= 1 )
                 break;
             *reps >>= 1;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 10:48:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 10:48:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571009.893816 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyXu-0007eg-Aj; Thu, 27 Jul 2023 10:48:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571009.893816; Thu, 27 Jul 2023 10:48:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyXu-0007dP-4I; Thu, 27 Jul 2023 10:48:38 +0000
Received: by outflank-mailman (input) for mailman id 571009;
 Thu, 27 Jul 2023 10:48:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mGGP=DN=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qOyXt-00072A-AK
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 10:48:37 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 23a35fcd-2c6b-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 12:48:36 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.161.207.213])
 by support.bugseng.com (Postfix) with ESMTPSA id 71A354EE0743;
 Thu, 27 Jul 2023 12:48:35 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 23a35fcd-2c6b-11ee-b247-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH 3/4] x86/mm: mechanically rename variable to avoid shadowing
Date: Thu, 27 Jul 2023 12:48:01 +0200
Message-Id: <62f4a9e7a19b37c970e52f138a6eeb8f7363b7bc.1690449587.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690449587.git.nicola.vetrini@bugseng.com>
References: <cover.1690449587.git.nicola.vetrini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The rename s/p2mt/t/ is done to avoid shadowing the same declaration
in the enclosing scope.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
Is the semantics of the function altered if the inner declaration
is removed entirely?
---
 xen/arch/x86/mm/p2m.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 714358f953..fa9f7616e8 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2439,12 +2439,12 @@ int xenmem_add_to_physmap_one(
 
     case XENMAPSPACE_gmfn:
     {
-        p2m_type_t p2mt;
+        p2m_type_t t;
 
         gfn = idx;
-        mfn = get_gfn_unshare(d, gfn, &p2mt);
+        mfn = get_gfn_unshare(d, gfn, &t);
         /* If the page is still shared, exit early */
-        if ( p2m_is_shared(p2mt) )
+        if ( p2m_is_shared(t) )
         {
             put_gfn(d, gfn);
             return -ENOMEM;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 10:48:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 10:48:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571010.893828 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyXv-000833-Jv; Thu, 27 Jul 2023 10:48:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571010.893828; Thu, 27 Jul 2023 10:48:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyXv-00082V-FC; Thu, 27 Jul 2023 10:48:39 +0000
Received: by outflank-mailman (input) for mailman id 571010;
 Thu, 27 Jul 2023 10:48:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mGGP=DN=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qOyXu-00072A-EH
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 10:48:38 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 244a3d2d-2c6b-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 12:48:37 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.161.207.213])
 by support.bugseng.com (Postfix) with ESMTPSA id B13644EE0744;
 Thu, 27 Jul 2023 12:48:36 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 244a3d2d-2c6b-11ee-b247-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH 4/4] x86: avoid shadowing to address MISRA C:2012 Rule 5.3
Date: Thu, 27 Jul 2023 12:48:02 +0200
Message-Id: <10606d7429239b5a2b7dffcb22eeb1ce5e73e991.1690449587.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690449587.git.nicola.vetrini@bugseng.com>
References: <cover.1690449587.git.nicola.vetrini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rule 5.3 has the following headline:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope"

The declaration of local variable 'cpuid_leaf' causes
shadowing with the homonymous function to happen, therefore
the variable is renamed to avoid this.

Local variable 'cr4' that shadows a previous declaration is
removed, as it is unnecessary and doing so does not alter the
semantics.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 2de1be7996..9403beb20f 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1483,7 +1483,7 @@ x86_emulate(
     {
         enum x86_segment seg;
         struct segment_register cs, sreg;
-        struct cpuid_leaf cpuid_leaf;
+        struct cpuid_leaf res;
         uint64_t msr_val;
         unsigned int i, n;
         unsigned long dummy;
@@ -5024,13 +5024,13 @@ x86_emulate(
         generate_exception_if((msr_val & MSR_MISC_FEATURES_CPUID_FAULTING),
                               X86_EXC_GP, 0); /* Faulting active? (Inc. CPL test) */
 
-        rc = ops->cpuid(_regs.eax, _regs.ecx, &cpuid_leaf, ctxt);
+        rc = ops->cpuid(_regs.eax, _regs.ecx, &res, ctxt);
         if ( rc != X86EMUL_OKAY )
             goto done;
-        _regs.r(ax) = cpuid_leaf.a;
-        _regs.r(bx) = cpuid_leaf.b;
-        _regs.r(cx) = cpuid_leaf.c;
-        _regs.r(dx) = cpuid_leaf.d;
+        _regs.r(ax) = res.a;
+        _regs.r(bx) = res.b;
+        _regs.r(cx) = res.c;
+        _regs.r(dx) = res.d;
         break;
 
     case X86EMUL_OPC(0x0f, 0xa3): bt: /* bt */
@@ -8408,8 +8408,6 @@ x86_emulate(
         generate_exception(X86_EXC_MF);
     if ( stub_exn.info.fields.trapnr == X86_EXC_XM )
     {
-        unsigned long cr4;
-
         if ( !ops->read_cr || ops->read_cr(4, &cr4, ctxt) != X86EMUL_OKAY )
             cr4 = X86_CR4_OSXMMEXCPT;
         generate_exception(cr4 & X86_CR4_OSXMMEXCPT ? X86_EXC_XM : X86_EXC_UD);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 10:48:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 10:48:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571011.893838 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyXx-0008Oc-Sw; Thu, 27 Jul 2023 10:48:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571011.893838; Thu, 27 Jul 2023 10:48:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyXx-0008OQ-QA; Thu, 27 Jul 2023 10:48:41 +0000
Received: by outflank-mailman (input) for mailman id 571011;
 Thu, 27 Jul 2023 10:48:40 +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
 <SRS0=mGGP=DN=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qOyXw-0008Gd-Kg
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 10:48:40 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 24c44e3c-2c6b-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 12:48:38 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.161.207.213])
 by support.bugseng.com (Postfix) with ESMTPSA id C7D524EE0745;
 Thu, 27 Jul 2023 12:48:37 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 24c44e3c-2c6b-11ee-8613-37d641c3527e
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>
Subject: [XEN PATCH 0/4] address violations of MISRA C:2012 Rule 5.3 on x86
Date: Thu, 27 Jul 2023 12:48:03 +0200
Message-Id: <cover.1690449118.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690449587.git.nicola.vetrini@bugseng.com>
References: <cover.1690449587.git.nicola.vetrini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This series aims to address some violations of MISRA C:2012 Rule 5.3:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope"

To resolve such violations two strategies have been applied:

1. rename several function parameters or local variables;
2. remove a local variable declaration in an inner scope, if
   using the outer variable does not change the semantics of the function.

Nicola Vetrini (4):
  x86: mechanically rename to address MISRA C:2012 Rule 5.3
  x86/emulate: move a variable declaration to address MISRA C:2012 Rule
    5.3
  x86/mm: mechanically rename variable to avoid shadowing
  x86: address MISRA C:2012 Rule 5.3

 xen/arch/x86/apic.c                    |  8 ++++----
 xen/arch/x86/cpu/mcheck/mce.c          | 12 ++++++------
 xen/arch/x86/cpu/mwait-idle.c          | 24 ++++++++++++------------
 xen/arch/x86/domain.c                  |  2 +-
 xen/arch/x86/e820.c                    |  6 +++---
 xen/arch/x86/emul-i8254.c              |  2 +-
 xen/arch/x86/hvm/emulate.c             |  6 +++---
 xen/arch/x86/include/asm/e820.h        |  2 +-
 xen/arch/x86/include/asm/hvm/save.h    |  8 ++++----
 xen/arch/x86/include/asm/hvm/vpt.h     |  2 +-
 xen/arch/x86/mm/p2m.c                  |  6 +++---
 xen/arch/x86/psr.c                     |  4 ++--
 xen/arch/x86/traps.c                   |  4 ++--
 xen/arch/x86/x86_emulate/x86_emulate.c | 14 ++++++--------
 14 files changed, 49 insertions(+), 51 deletions(-)

--
2.34.1


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 11:01:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 11:01:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571026.893849 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyk7-0003tO-13; Thu, 27 Jul 2023 11:01:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571026.893849; Thu, 27 Jul 2023 11:01:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyk6-0003tH-UW; Thu, 27 Jul 2023 11:01:14 +0000
Received: by outflank-mailman (input) for mailman id 571026;
 Thu, 27 Jul 2023 11:01:13 +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
 <SRS0=o85N=DN=citrix.com=prvs=5659ebe79=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qOyk5-0003tB-5z
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 11:01:13 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e40a3f24-2c6c-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 13:01:10 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e40a3f24-2c6c-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690455670;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=t2Panjkrfb0v/TjF0vQ8rWppUIjJHB4J6qX3CKwUfEk=;
  b=CMGFOAPBbrb9W9/yA5Q7mOScmfWf+oy9iIZ7gwVjx2N6Wc+LmrbZjROA
   HY8O+iN77ofqcPXI8mXMJ76SKyI5to/gVJUQnzd18eycxymkchzYjoCIc
   A5j3b75V8ur2nX5a+3v7u26Ijd9YxwBW48880k4GchPA7LqTJwUa7clx8
   A=;
Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 116323400
X-Ironport-Server: esa5.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:/rhnLa8T0TBziq5ZDb8uDrUDqX6TJUtcMsCJ2f8bNWPcYEJGY0x3m
 mYYC2vXM/7Zajege41/YYiz9hsDuMDTxtRiHApq+C08E34SpcT7XtnIdU2Y0wF+jCHgZBk+s
 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk
 d7pqojUNUTNNwRcawr40Ird7ks21BjOkGlA5AdmOqoU5Aa2e0Q9V/rzG4ngdxMUfaEMdgKKb
 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDA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iZxAWN2uqEuFkTsaE52IMT0JcDpyfSVNNW97OaY=
X-Talos-CUID: 9a23:0WNNeW1VzSuedEXIHgWTK7xfRpl1Smzg3UzrDnSRI3o2FraZbw/T5/Yx
X-Talos-MUID: 9a23:kiZ+HwRa59OB/EtMRXTKjyhpC/t545/1Sxs8ios9mvGZLBdZbmI=
X-IronPort-AV: E=Sophos;i="6.01,234,1684814400"; 
   d="scan'208";a="116323400"
Date: Thu, 27 Jul 2023 12:00:54 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Jason Andryuk <jandryuk@gmail.com>
CC: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>, Jan Beulich
	<jbeulich@suse.com>
Subject: Re: [PATCH v7 08/15] xenpm: Change get-cpufreq-para output for hwp
Message-ID: <30360e09-5ae9-4232-a8fe-5b9f9deccf97@perard>
References: <20230726170945.34961-1-jandryuk@gmail.com>
 <20230726170945.34961-9-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230726170945.34961-9-jandryuk@gmail.com>

On Wed, Jul 26, 2023 at 01:09:38PM -0400, Jason Andryuk wrote:
> diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
> index 1c474c3b59..21c93386de 100644
> --- a/tools/misc/xenpm.c
> +++ b/tools/misc/xenpm.c
> @@ -711,6 +711,7 @@ void start_gather_func(int argc, char *argv[])
>  /* print out parameters about cpu frequency */
>  static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
>  {
> +    bool hwp = strcmp(p_cpufreq->scaling_driver, XEN_HWP_DRIVER_NAME) == 0;
>      int i;
>  
>      printf("cpu id               : %d\n", cpuid);
> @@ -720,49 +721,57 @@ static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
>      printf("scaling_driver       : %s\n", p_cpufreq->scaling_driver);
>  
> +    if ( !hwp )

This test kind of feels wrong. Should we test instead the thing we want
to print? Maybe declaring another bool, something like "bool
scaling_governor = !hwp" just below the declaration of "bool hwp"?
Otherwise, if there's another technology that comes along that isn't
"hwp" and not something that can be printed with this, there's going to
be some kind of hidden bug (even if probably easy to spot during
development).

>      {
> +        printf("scaling_avail_gov    : %s\n",
> +               p_cpufreq->scaling_available_governors);


Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 11:02:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 11:02:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571028.893858 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOylf-0004QN-DM; Thu, 27 Jul 2023 11:02:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571028.893858; Thu, 27 Jul 2023 11:02:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOylf-0004QG-AN; Thu, 27 Jul 2023 11:02:51 +0000
Received: by outflank-mailman (input) for mailman id 571028;
 Thu, 27 Jul 2023 11:02:50 +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
 <SRS0=dT6+=DN=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qOyle-0004QA-8h
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 11:02:50 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1f34debb-2c6d-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 13:02:48 +0200 (CEST)
Received: from [172.20.10.2] (unknown [37.160.234.46])
 by support.bugseng.com (Postfix) with ESMTPSA id 2BDF34EE073F;
 Thu, 27 Jul 2023 13:02:47 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1f34debb-2c6d-11ee-8613-37d641c3527e
Message-ID: <31b72cda-2ef0-2f3c-4e83-948d7b763f19@bugseng.com>
Date: Thu, 27 Jul 2023 13:02:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH 2/3] xen/arm: irq: address violations of MISRA C: 2012
 Rules 8.2 and 8.3
Content-Language: en-US, it
To: Stefano Stabellini <sstabellini@kernel.org>,
 Jan Beulich <jbeulich@suse.com>
Cc: consulting@bugseng.com, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 xen-devel@lists.xenproject.org
References: <cover.1690217195.git.federico.serafini@bugseng.com>
 <a62e88a9c29cf7866c251968b5a5b6865aff4a2a.1690217195.git.federico.serafini@bugseng.com>
 <a81326f4-e018-b461-ebec-9ef2ff5dc4df@suse.com>
 <alpine.DEB.2.22.394.2307251226180.3118466@ubuntu-linux-20-04-desktop>
From: Federico Serafini <federico.serafini@bugseng.com>
Organization: BUGSENG srl
In-Reply-To: <alpine.DEB.2.22.394.2307251226180.3118466@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hello Jan, Stefano,

On 25/07/23 21:32, Stefano Stabellini wrote:
> On Tue, 25 Jul 2023, Jan Beulich wrote:
>> On 24.07.2023 19:50, Federico Serafini wrote:
>>> @@ -182,7 +182,8 @@ void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask)
>>>   }
>>>   
>>>   int request_irq(unsigned int irq, unsigned int irqflags,
>>> -                void (*handler)(int, void *, struct cpu_user_regs *),
>>> +                void (*handler)(int irq, void *dev_id,
>>> +                                struct cpu_user_regs *regs),
>>>                   const char *devname, void *dev_id)
>>>   {
>>
>> Before we accept patches, don't we need to first settle on whether to
>> apply the rule(s) also to function type declarations (and not just
>> ordinary prototypes)?
> 
> Yes, in retrospect we should have found agreement on this issue this
> morning but I forgot to bring it up :-(  Ooops.
> 
> (I think the agreement was to change the function type declarations too,
> that's why docs/misra/rules.rst doesn't have a note about this, but I
> don't want to make assumptions as I am not certain.)

I have ready a patch for violations of rules 8.2 and 8.3 in
xen/include/xen/iommu.h.
I am talking about this, in this IRQ thread, because I think the 
following two options also apply for an eventual v2 patch for the IRQ 
module, until a decision about rule 8.2 and function pointers is taken:

1) Split patches and submit only the changes *not* involving function
    pointers.
2) In the meantime that you make a decision,
    I submit patches thus addressing the existing violations.

I personally prefer the second one, but please let me know what you
think.

Regards
-- 
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 11:08:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 11:08:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571030.893870 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyqh-00054I-2Y; Thu, 27 Jul 2023 11:08:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571030.893870; Thu, 27 Jul 2023 11:08:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOyqg-00054B-UP; Thu, 27 Jul 2023 11:08:02 +0000
Received: by outflank-mailman (input) for mailman id 571030;
 Thu, 27 Jul 2023 11:08:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=RfsC=DN=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1qOyqf-000542-3c
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 11:08:01 +0000
Received: from sender4-of-o50.zoho.com (sender4-of-o50.zoho.com
 [136.143.188.50]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d7baf831-2c6d-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 13:07:59 +0200 (CEST)
Received: from [10.10.1.94] (static-72-81-132-2.bltmmd.fios.verizon.net
 [72.81.132.2]) by mx.zohomail.com
 with SMTPS id 1690456069410632.3201078848144;
 Thu, 27 Jul 2023 04:07:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d7baf831-2c6d-11ee-b247-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; t=1690456072; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=cqZ9HDVq8rctYo2627CbbrKdDZdThT5NAa+ZwxyxNxsaNJBJlP8RcARyFA3BZpFZ+PUMkYQ4c681YIwujGuoAYB9spM3iuCa58XdAAXNtbm63i30d0hjWPBCHWmDdorma5WwKjDsj4Lyex/tNk2+cgO5Zrv+YbuuUlp1R77Yn4Q=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1690456072; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; 
	bh=lpKA5PHRg3WWL504PILmYBYaZ5GD8vX74mjfOTcAdGQ=; 
	b=YAvA8/J48pgHcLArErgPtZAAYXJ6Wlybjim/4y2a4/jbdYXnIWZGwZgUpvEZhijGLSfLzftJ1VFAuk7E0NUshx1ENibwTIfbi25DP36EAOc3x1xnVqmWi2niCp7siNtjJooP3UPkC/vIKqu37uKaxCPWw/CqaULFBt/2cfNhPww=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1690456072;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To;
	bh=lpKA5PHRg3WWL504PILmYBYaZ5GD8vX74mjfOTcAdGQ=;
	b=StC/ZIY7L4MpKu66Y7MYqgspKpqC3rVcvoks4b+RGOtcmd1Sv2v28Gyt3QbdtWW9
	ObEfUpjnwKqYN2UDS+zLIbv05O2nkbmq1kQ84Ha/x/aR/vW1e6inxc9MzqiIzB8kMT8
	VycNpjvEKZ0BAtGCYb5d7vnFPoY7m2sdKWh3taGE=
Message-ID: <d46a1bf9-2f66-542a-9e7f-3d298ad1adb2@apertussolutions.com>
Date: Thu, 27 Jul 2023 07:07:46 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [PATCH v2] vpci: add permission checks to map_range()
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>, Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230726140132.80151-1-roger.pau@citrix.com>
 <a277dacd-56f6-a5ab-6982-b5cc4f9d507c@suse.com>
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
In-Reply-To: <a277dacd-56f6-a5ab-6982-b5cc4f9d507c@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External



On 7/27/23 03:56, Jan Beulich wrote:
> On 26.07.2023 16:01, Roger Pau Monne wrote:
>> Just like it's done for the XEN_DOMCTL_memory_mapping hypercall, add
>> the permissions checks to vPCI map_range(), which is used to map the
>> BARs into the domain p2m.
>>
>> Adding those checks requires that for x86 PVH hardware domain builder
>> the permissions are set before initializing the IOMMU, or else
>> attempts to initialize vPCI done as part of IOMMU device setup will
>> fail due to missing permissions to create the BAR mappings.
>>
>> While moving the call to dom0_setup_permissions() convert the panic()
>> used for error handling to a printk, the caller will already panic if
>> required.
>>
>> Fixes: 9c244fdef7e7 ('vpci: add header handlers')
>> Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> 
> I've committed this, but despite the Fixes: tag I'm not sure this
> wants backporting. Thoughts?
> 
> Jan

 From a cursory review thus far, since this introduced a new XSM hook 
site, shouldn't this have at least had an Rb by an XSM 
reviewer/maintainer? I would have replied sooner, but have been on 
holiday for last two weeks.

V/r,
Daniel P. Smith


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 11:28:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 11:28:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571033.893879 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOz9y-0007cw-KE; Thu, 27 Jul 2023 11:27:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571033.893879; Thu, 27 Jul 2023 11:27:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOz9y-0007cp-HV; Thu, 27 Jul 2023 11:27:58 +0000
Received: by outflank-mailman (input) for mailman id 571033;
 Thu, 27 Jul 2023 11:27:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOz9x-0007ch-C4
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 11:27:57 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2080.outbound.protection.outlook.com [40.107.13.80])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a1c36661-2c70-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 13:27:56 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VI1PR04MB7040.eurprd04.prod.outlook.com (2603:10a6:800:121::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 11:27:25 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 11:27:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a1c36661-2c70-11ee-b247-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=QBGddS7JazcrSuHDW716ap69wrlkkP/Zh9Pl0YeVoBn/Ia9ryB350AaRH4wVc1rnLDtPSG4hxnT8LC0uteLle7EgdQ4+D6miLQpGGkSDLBIJklydBMDFlBJIa6sTyp9skPTE1FAlIbUDsLQyIvdaVacfXUszsleV9/whn7wlCZ9H5474SUplijaHFhvftoMyRAIGG1fZD8sHPkQS3CJEd6qpMXmYlMOmX7+UNfOtKVO2RIsZtn3TyE+y3XFEyE552yaePkYnGfuOXMWct5h8j+GTJO4EwfeIb2YWHXMNqOUqOd37HE323k3Qq68VgDcMv9AfGcEk8hacnEhaQZCf5g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ZyrbDGTEaI8lZX5HsJm7bC/L+4G+KfvaMIdhYnjCcAQ=;
 b=fcVmbdgfcYw800YOKfpkXc0i54xPIgBMybJ9LcwK7or/S8lr3P58WrdQVcmoI32Zqp+kKfcdpDxdsHNI0JC0BBMOvni6VJRxXrUsrDLRFBuoTD0TB8imjLwERnmf0OfoVsSJRTEEB6qwQJPWGE900F3mttYKpbT2IpE0zFLCnMPN94rWJUJzYHT1ld6JLlQCTSaounrFAA930YtVc5Qf26uUmyV5ddV8ixGS4EF4dPVTu8kfYIvcqfAoZbkj0z7O40J19Kw1tpsciOMzJINeRVeBIUxtwTT/0AhS0oiw2gXHHFeDaXFEW1sqoMuqPIb423qZ8oCb3QoiKHcNE/PpKA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ZyrbDGTEaI8lZX5HsJm7bC/L+4G+KfvaMIdhYnjCcAQ=;
 b=3VEKUrdVd07rrEhyzxjQ2Ts+G4etAQM+sX2t97swaLil3CDOEM9iYN4bpj0cKTXGFGkm4lU7RVfGHEj7Tnt1reiwy59IKPGvxPHreMZPub/wE/W9q9LSot2xLjKMMGNPbbpo9nYpgSViObkZ2xSgxFCMY5o++ut46TC8uuq3SmJmMQTJWBsr64HHRUVexlj0E43iYFteSBYyj3R23uQlLRwvpQJVjgFuuwdXmXdpRm0w7U1i86iMnZju/pZ4QsD1vycfIOPLZ9BBvQqSpm28U4n+svt/yTBUoTtPI2jtWu8qh8fQIgkCySIObKVnZr7Hv73cHaUsDCsCLHsfRyW3xQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <f479517d-10db-4723-65a2-38c85f72d96e@suse.com>
Date: Thu, 27 Jul 2023 13:27:23 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH 2/3] xen/arm: irq: address violations of MISRA C: 2012
 Rules 8.2 and 8.3
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 xen-devel@lists.xenproject.org, Stefano Stabellini <sstabellini@kernel.org>
References: <cover.1690217195.git.federico.serafini@bugseng.com>
 <a62e88a9c29cf7866c251968b5a5b6865aff4a2a.1690217195.git.federico.serafini@bugseng.com>
 <a81326f4-e018-b461-ebec-9ef2ff5dc4df@suse.com>
 <alpine.DEB.2.22.394.2307251226180.3118466@ubuntu-linux-20-04-desktop>
 <31b72cda-2ef0-2f3c-4e83-948d7b763f19@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <31b72cda-2ef0-2f3c-4e83-948d7b763f19@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0115.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a3::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VI1PR04MB7040:EE_
X-MS-Office365-Filtering-Correlation-Id: bbf9c66f-21db-4e12-79ba-08db8e9473b6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	ZMe8YdwrD0mKOZLEQaRrEgxHIG93T/TwLHylP86Q2T4KALmprnRe8gV6W4Z16h3MsxzYYSjk4p9ftrAdV4SbVU8EexMo9bor5X5Df0SXM9jyBttgAcKlp+G5dJQXPgCtjli6LTNE5XfHy7054WMXNKV4k5/GM93Gvx8vxHej8BV+Z7JJpoqs2gdGkiYBuenKvawnS34XLcsl9jVCU6W7oDkGRk8WDTZovHx7KYUVv84LPkb20GlkwN9zt1D7Kmwmt6x12aCfw5I7X8b2KLKPy6uE7AL0265r8JDnWcdDIhyUoWHv2SZbVAqZTQ20BOi8qUCankSXrNJz0vlh53IwjEwcIz5DFQDYy0CpoNEhPqhe2ODNqiuD7G5jIDR0vSAWogYaunuqdT4BGSLiRBVHwDuZJl/R5hLE8cAMsEpjVQHDjmuy44DU0eZKpMwJcFE2AWGPEnub/rjfHyARo+pU6s3jAhcAHtDPUns2zpZrZN2ZrUDl7yHe2dkMYxsePjZDyjZo3bBNhWcRiUXeRIIbdWPakKcXLMpG7resm007SOhlwJDBR3hiYPSA/aWaEzwzYxJzEN9YsKZL6YOHQkFkTpAdXJMWsd+8Psovn3LwtqlzXI5mbESGw7/R/OptjGWPzA2NAwzercAEtLcHcOJs+g==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(376002)(136003)(39860400002)(346002)(366004)(451199021)(26005)(6506007)(54906003)(478600001)(53546011)(186003)(6486002)(66476007)(4326008)(6916009)(2616005)(31686004)(6512007)(83380400001)(66556008)(38100700002)(66946007)(5660300002)(41300700001)(66899021)(316002)(2906002)(8936002)(8676002)(86362001)(31696002)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?anVzYkRYclRDRVVtVTNxM29DQlJuckhOM0tYSFByOG5hL0RLYzBjYnI1QS9Q?=
 =?utf-8?B?Y1FPUWd5eT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8?B?aDlnc0RoVzRaTGUvN2RJbEJNa1dCU1pTNVlabTZmWWhvbWhoVzM3YldaY0NG?=
 =?utf-8?B?dElMWUh3akNFS0VPREZoVjJPZ1pQMnlOOEpzOVQzb01YUkc4NmV6eG5jS0hk?=
 =?utf-8?B?U3hMejFnRENBVkhaSThiSllSd2Z2K2VIYjk2WkQ3Y3JZblo4cnZUQXBGU05i?=
 =?utf-8?B?c1V4NmxFdFBUcDE5MzNnYXpXektqSTNzOVhJOGhIRFh4eStYVXp1ZTM0RklB?=
 =?utf-8?B?U1huMk93VUZ1b0RQOU9DeGpzSVRnbFMyOWRKRHlNTVpRZjZFRkFjZCtJdFFq?=
 =?utf-8?Q?RsS8il8W3/CGXvh2f9P3hJuaD?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bbf9c66f-21db-4e12-79ba-08db8e9473b6
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 11:27:25.2560
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: SMTVRCXMGL2j0jyy9gkmpgssKuVRZgf0zhHdhe5N5iAQ6rixvjK1hmo2m2RM22p2TIldmf0Ylm8VFHBXpegrFw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7040

On 27.07.2023 13:02, Federico Serafini wrote:
> Hello Jan, Stefano,
> 
> On 25/07/23 21:32, Stefano Stabellini wrote:
>> On Tue, 25 Jul 2023, Jan Beulich wrote:
>>> On 24.07.2023 19:50, Federico Serafini wrote:
>>>> @@ -182,7 +182,8 @@ void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask)
>>>>   }
>>>>   
>>>>   int request_irq(unsigned int irq, unsigned int irqflags,
>>>> -                void (*handler)(int, void *, struct cpu_user_regs *),
>>>> +                void (*handler)(int irq, void *dev_id,
>>>> +                                struct cpu_user_regs *regs),
>>>>                   const char *devname, void *dev_id)
>>>>   {
>>>
>>> Before we accept patches, don't we need to first settle on whether to
>>> apply the rule(s) also to function type declarations (and not just
>>> ordinary prototypes)?
>>
>> Yes, in retrospect we should have found agreement on this issue this
>> morning but I forgot to bring it up :-(  Ooops.
>>
>> (I think the agreement was to change the function type declarations too,
>> that's why docs/misra/rules.rst doesn't have a note about this, but I
>> don't want to make assumptions as I am not certain.)
> 
> I have ready a patch for violations of rules 8.2 and 8.3 in
> xen/include/xen/iommu.h.
> I am talking about this, in this IRQ thread, because I think the 
> following two options also apply for an eventual v2 patch for the IRQ 
> module, until a decision about rule 8.2 and function pointers is taken:
> 
> 1) Split patches and submit only the changes *not* involving function
>     pointers.
> 2) In the meantime that you make a decision,
>     I submit patches thus addressing the existing violations.
> 
> I personally prefer the second one, but please let me know what you
> think.

It's not entirely clear to me what 2 means, as I wouldn't expect you
intend to deal with "violations" which we may decide aren't any in
out world.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 11:32:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 11:32:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571036.893889 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzE4-0000hI-BA; Thu, 27 Jul 2023 11:32:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571036.893889; Thu, 27 Jul 2023 11:32:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzE4-0000hB-87; Thu, 27 Jul 2023 11:32:12 +0000
Received: by outflank-mailman (input) for mailman id 571036;
 Thu, 27 Jul 2023 11:32:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=o85N=DN=citrix.com=prvs=5659ebe79=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qOzE2-0000gu-5w
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 11:32:10 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 373ec5da-2c71-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 13:32:08 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 373ec5da-2c71-11ee-b247-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690457527;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=Ru4DxDajKdtMdEVunn88lORpczmvQj/BqUIh0L27F7A=;
  b=JFOMWvMeJC/YI99t8EGJ28+eJbIsKIuXXcgp70b/YkgyN9dLiOhGCfa6
   04UnbJram7XRu1iHHgXa+JsW96rs2NMIvV640RUiuVgE02JclmPUXZEFr
   UXYKZGsPE67M/ePgvQXoG5iG3gRKeWtR96TOslPHzZ3rOgbhcp6tAF8AS
   U=;
Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 118065567
X-Ironport-Server: esa1.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:bdqBCapBL9T69rjhw0tpkFD0ZGNeBmIxZRIvgKrLsJaIsI4StFCzt
 garIBmHOPaJZWuneN93O9m3oB9Q6JLSmN9jHVdo+S4xFC1G8ZuZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weBzSZNVfrzGInqR5fGatgMdgKFb
 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo
 OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay
 RAXADsqQB2YrPjo+YLhbtNsi99/KIrLPZxK7xmMzRmBZRonaZXKQqGM7t5ExjYgwMtJGJ4yZ
 eJAN2ApNk6ZJUQSZBFOUslWcOSA3xETdxVRrk6VoqwmpXDe1gVr3JDmMcbPe8zMTsJQ9qqdj
 jufrzynX0xEa7RzzxLd0WKI2fHguh/2Z5BNKeKA0vVVm1GMkzl75Bo+CgLg/KjRZlSFc9BWL
 UAO6zcthac3/U2vCNL6WnWQsHOC+xIRRddUO+k78x2WjLrZ5R6DAWoJRSIHb8Yp3OcpQRQ62
 1nPmMnmbRRturCITXOW9p+PsCi/fyMSKAcqbDcJVwIf7/H/oYs4iVTESdMLLUKupoSrQ3eqm
 WnM9XVgwexJ1qbnyplX43jMpByhvbPTEDcFvCHtXm++sgc6RI+6MtnABUfg0RpQEGqIZgDf7
 SBfypPOtLxm4YKlz3LUHrhUdF29z7PcaWCH3wYyd3U03271k0NPa7y8992XyK1BFs8fMQHkb
 0bI0e+6zM8CZSD6BUObjm/YNijL8UQDPY6/PhwsRoASCqWdjSfelM2UWWae3nr2jG8nmrwlN
 JGQfK6EVChLUf82kmDpFrxFjtfHIxzSI0uJG/gXKDz+j9KjiIO9E+9ZYDNikMhnhE97nOkl2
 4kGbJbbo/mueOb/fjPW4eYuwaMidBAG6WTNg5UPLIare1M2cFzN/teNmdvNjaQ5xfUK/goJl
 1nhMnJlJK3X3CKccljbNSg4M9sCn/9X9BoGAMDlBn7ws1BLXGplxP13m0cfFVX/yNFe8A==
IronPort-HdrOrdr: A9a23:3qOgE6F7Ybujv/+ApLqEw8eALOsnbusQ8zAXPiFKOHlom6mj/a
 2TdZsguSMc5Ax/ZJhYo6H4BEDiewK/yXcW2+ks1N6ZNWHbUQ2TQr2KhrGSoAEIdReeygdr79
 YFT0EvMrbN5IBB/L3HCdODYrAdKQS8gceVbDvlvg9QpN9RGttd0zs=
X-Talos-CUID: 9a23:Z3p6fG5//3oMPs6PJdss/2k6F9sOaCPk/C30GU+1EjptC52UVgrF
X-Talos-MUID: =?us-ascii?q?9a23=3A8t4olAxY5ke/tbpV/qYSQp5Mn2OaqPyNGGRSj7o?=
 =?us-ascii?q?hh8S7J3NNZA+5hwusTpByfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,234,1684814400"; 
   d="scan'208";a="118065567"
Date: Thu, 27 Jul 2023 12:32:01 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Jason Andryuk <jandryuk@gmail.com>
CC: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>, Jan Beulich
	<jbeulich@suse.com>
Subject: Re: [PATCH v7 11/15] xenpm: Print HWP/CPPC parameters
Message-ID: <882c0e9f-8e66-4be3-aecf-477d38da9371@perard>
References: <20230726170945.34961-1-jandryuk@gmail.com>
 <20230726170945.34961-12-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230726170945.34961-12-jandryuk@gmail.com>

On Wed, Jul 26, 2023 at 01:09:41PM -0400, Jason Andryuk wrote:
> @@ -772,6 +812,32 @@ static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
>                 p_cpufreq->u.s.scaling_min_freq,
>                 p_cpufreq->u.s.scaling_cur_freq);
>      }
> +    else
> +    {

I feel like this could be confusing. In this function, we have both:
    if ( hwp ) { this; } else { that; }
and
    if ( !hwp ) { that; } else { this; }

If we could have the condition in the same order, or use the same
condition for both "true" blocks, that would be nice.


> +        const xc_cppc_para_t *cppc = &p_cpufreq->u.cppc_para;
> +
> +        printf("cppc variables       :\n");
> +        printf("  hardware limits    : lowest [%u] lowest nonlinear [%u]\n",
> +               cppc->lowest, cppc->lowest_nonlinear);

All these %u should be %"PRIu32", right? Even if the rest of the
function is bogus... and even if it's probably be a while before %PRIu32
is different from %u.

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 11:35:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 11:35:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571039.893899 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzHT-0001Jg-RG; Thu, 27 Jul 2023 11:35:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571039.893899; Thu, 27 Jul 2023 11:35:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzHT-0001JZ-Mz; Thu, 27 Jul 2023 11:35:43 +0000
Received: by outflank-mailman (input) for mailman id 571039;
 Thu, 27 Jul 2023 11:35:42 +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 <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOzHS-0001JP-Hm
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 11:35:42 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20615.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::615])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b6b9b66a-2c71-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 13:35:40 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB9517.eurprd04.prod.outlook.com (2603:10a6:102:229::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 11:35:38 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 11:35:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b6b9b66a-2c71-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BO8zXo9dOiwV6NfNnpuVRZzUKcA9xYPABM7dcToQhDGQQnaO4/BhWlAgkpp+d4eC8IUH0Vw9pT2UVLhkUygzpnvBDjBm0Rk79UqLawYwrZGP4Es/bTQcQrrFvOAbWdq1lzVcAQcn2wHJColfmUtyj5sf4UfBPh2BL2q6z3Jd105qxzJGMAE7fuyw5uVzxhQtbv3W+Dc7BhNYW2S0gSAgVYIEqSJ5aziGxH8NXfovy5auQIH40mbbl/l4W3P0IEglxMaBiN6gD7MlwZ+3XTRuNL5wPRGACQxBh0DJKexExOY0fr1hjpEG4vL/V+WAMlbtqIQ07+nhTcVzOgoXw89VEw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=FZ7Bt4bKzvvAUqYc1pqZEPq1l2hAsBEIywIW2BTRUXg=;
 b=kaR4BTwtj36XbEDtxLMbwrT3u69/DV0LL0kR4U24L9d2YP2z2wss1o2bnUF2JQ+Z7cqzDn9avbbyhkFOLlXqkeOc1DDGw4k15guLoiNB/TVlkecbArU5w9E/110XwoNZzymkwrJWazeS5+cu+1LvU+qS54KORcdLFtXSWgxq9PRpu5F+k85fAHQSl/HuQLUlS+i6frUkupEmrqAyZA2q31TsFmRhY7bq2az48hdu1A2jZ+Ca9e9VIjJ9fxAox7WrzOwKSE0jOMyc9YrMJU3FT/5SGyKn6meAg62mr1CmuRaCT0FC5Q7jfN/pub9jopw0/TLXKHnVn8QsPDjkCT6JjQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=FZ7Bt4bKzvvAUqYc1pqZEPq1l2hAsBEIywIW2BTRUXg=;
 b=RdEicMvQjizu2pV7YdHJPSmstTFfD4qJJAQW4WJIpc1YqRxcSXdFC1jdjdr0I0bfk88bC8LKnIdJOxRChryhZM+f8Wy20w7IctLkjOpKN+UjpMNCzvzSDADwNpazcEcQ7koHKYsLi+WPZt10KSFiC6dyyfkkneG3Ypj/5kM5dpR+sJryeuuoHphi7hMnNW0XM+UrFIhW64AoeGpKF0YZzLBhoXFOQ+Sdem4UjS6fFNdpe88sQ3zMHIoATvSEWfP9cIKU4/W0/y8Mh46nuCTfzWouf4wUMrRFS6MU04h6GuOpSWWvOOBtLfYZnFG8RvVslr/vFQhMjadMIBbwEJusZQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <099d7f75-95bc-2c43-0d74-433fc70bb27f@suse.com>
Date: Thu, 27 Jul 2023 13:35:36 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2] vpci: add permission checks to map_range()
Content-Language: en-US
To: "Daniel P. Smith" <dpsmith@apertussolutions.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org, Roger Pau Monne <roger.pau@citrix.com>
References: <20230726140132.80151-1-roger.pau@citrix.com>
 <a277dacd-56f6-a5ab-6982-b5cc4f9d507c@suse.com>
 <d46a1bf9-2f66-542a-9e7f-3d298ad1adb2@apertussolutions.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <d46a1bf9-2f66-542a-9e7f-3d298ad1adb2@apertussolutions.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0041.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:92::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB9517:EE_
X-MS-Office365-Filtering-Correlation-Id: 9eed8331-680f-4d62-a57c-08db8e9599a1
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	XUU3HcOWN2Sbm8xWa5zCC72szd4Y+gHhmPXGK7U7Z2aMQU5vzr8xblTty0/caqoCrEOuJsNkaiN3IqhWg1Gjok2NIEvDZ2R8005DSAgu8eYgTKn3rPPpwI0ToycX8TcCj7fvQRbqzKJuySATLclnt4S9pLrz1SJgnUDcJntXsop9rGtFpiY8chjmKoACImc088sWcqqWpo4o5l8+yp6G8hvZLgxG7j0wAzNw5vhgFIa/z6Zk/PEblbFDyn63us+O7/dh86ojhsyo6juLIeli1B2ESooJyKfa73+nZu+vRm2sCTHD5AayRXEAE/zbeW2mGhOd2om7EGEmHuhKZW1akiQDmn4dzF1Tv4LmfXZvYeahQu4dZocQUvN1b9RWr3KnvYShCrz0ob4JsUDebGLUZw0crSkmt3v0C+BIpPL81CfUvqJHahhFA/8q3iyEYpzYPg2H20rkfYchtiyt5fE4uWQU60UAsa9Tc+eKbHzymViSl8sLyAXewLIeMNn7wuzUwYNXzc+3wwpjHEdjI+IhAEgozRBGW7rq0gZURpj0DIalcxc/4WXAyq7T5LTng0xBH/2e2P6d7Ays7QsPV1QeWVzMf4y414RuQlDa4MLfLbSw407ANl+2ZbvG1CODONptE9AjUXM/TCv4FV22Pl8QNA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(396003)(366004)(39860400002)(136003)(346002)(451199021)(478600001)(6506007)(6512007)(2616005)(53546011)(186003)(26005)(54906003)(31686004)(6486002)(66476007)(66556008)(6916009)(66946007)(4326008)(38100700002)(5660300002)(8936002)(8676002)(2906002)(41300700001)(316002)(31696002)(86362001)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NlR2MUMwQks4TnVnYlpLYktXV0RlczlTdzg4QTgvUlVHUDZiUnVFUFQvWXhP?=
 =?utf-8?B?RE5uVWxmcGNZQ3hjZ1pVV1kybWdXQTl3QjBEZDlXR212MDBYaGNCcmcyMEJa?=
 =?utf-8?B?MGhKd0s0cVJJQkhBZ25WQ1BOZ3NLRkQybkVvOXdxMklKRWRsOWg3eWRYVzgr?=
 =?utf-8?B?WUZxRHNmV3Q2SGpsMlhqamhRcjE5N0pPMW11bU55blBZOWw1SWFsbStEQmN5?=
 =?utf-8?B?cVpsZDdROTJLMXkwVFQxanh3SFArSHYwT3FPYU9jbTRtdFQranN5Ykt5dXJY?=
 =?utf-8?B?aVZnVUw1YjdZVmJOTzhBeFBIZlBBS2NaSlJId3MxT2JUeVlCS0RaTVZRRTR2?=
 =?utf-8?B?WWZ5bE9ad0FDZXBsRHNPa0hpV2M5eDFVWW1PYkNVVkhJWDh5RGVNRE9TZlQ0?=
 =?utf-8?B?cUlYZXVnTFg5NlNrcTg5NXNkem1jcDV5c3JzTHVFVjZMME52eHJZVTl0TVpX?=
 =?utf-8?B?WlJOVDRubmY5ZTRrd0RJeE9hSWZOUjl4NUpWNENtYjdHZGNCc0dmUFd5OHFX?=
 =?utf-8?B?YlF1ZitxdVFQRjRYZTB2YVczcjNKS1BsRm8wZC9DOFJkemNuQkZlYkh1YjJX?=
 =?utf-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TDNOTnZPcEc5cjRETlVkY3lLVHpJdmkvVk0vTUZ0ME9V?=
 =?utf-8?B?L1JuanNPUUZVRTF4THR1K0NrZStrS2NFZmhFUUNCRnh1Q3hzWWVaN284Rit5?=
 =?utf-8?B?VzcwK256aW5jalROTmdPbFY5bTBXZTNxVjltV2IxMlNUR1hkNEFLWWozcDRK?=
 =?utf-8?B?THRxcUY4SEhjUjcvbW8wR05zRUp6MkIxMmYwYWhMdGdWQjBFT1djK3NCZnBy?=
 =?utf-8?B?N21iTWl4WXVsZkcybDdmWlltZTl5NzdvN2lWNHJGS3NsQXBSbU9GcDMySEVE?=
 =?utf-8?B?dDlCMzFwNThJMUhETHNPTDJIK3d4OWxqUlpMY1pNWE1HM1M1b2xSY3BmY1Y2?=
 =?utf-8?B?NkZtNnFwL3dSTmdFTmxJSHp2ZFNtN2g5aE1JR0RVL0g5TWxxSWNmckREM2sz?=
 =?utf-8?B?Z0s4ODdVM1c0cjlSWU5GUlpxNGQ1eXFtQXpUdE1WWmZ3VW1oMW1rNHFRME10?=
 =?utf-8?B?L0dhNXlDbFpubnZ0NGM0S1Y2SUJjV2d6MDJETXNaVnRxeUs4S1VwM3NvNm84?=
 =?utf-8?B?aGRmM3lHYXV3Z2o1SDF4SmNxZldGZ0kxL0xWVEdqazZ3SGhWWnNPNy9nNzhZ?=
 =?utf-8?B?MVRjVzF5ZytJVk80OHBHbmJSc2JMZWlzdFNvR0VyNFdlSytqaUVIKzc5cHlR?=
 =?utf-8?Q?pr4HfyzuDjLfn14/u5z1+2yss?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9eed8331-680f-4d62-a57c-08db8e9599a1
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 11:35:38.3097
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: DLVPhZE4dhUl4pGB+uGodVAdXuIaq4EMGn2pVok+Zooa2sfBf9l9JryBPjbPiMj6euGHlT7cpGuGydH6fveMOQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9517

On 27.07.2023 13:07, Daniel P. Smith wrote:
> 
> 
> On 7/27/23 03:56, Jan Beulich wrote:
>> On 26.07.2023 16:01, Roger Pau Monne wrote:
>>> Just like it's done for the XEN_DOMCTL_memory_mapping hypercall, add
>>> the permissions checks to vPCI map_range(), which is used to map the
>>> BARs into the domain p2m.
>>>
>>> Adding those checks requires that for x86 PVH hardware domain builder
>>> the permissions are set before initializing the IOMMU, or else
>>> attempts to initialize vPCI done as part of IOMMU device setup will
>>> fail due to missing permissions to create the BAR mappings.
>>>
>>> While moving the call to dom0_setup_permissions() convert the panic()
>>> used for error handling to a printk, the caller will already panic if
>>> required.
>>>
>>> Fixes: 9c244fdef7e7 ('vpci: add header handlers')
>>> Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
>>
>> I've committed this, but despite the Fixes: tag I'm not sure this
>> wants backporting. Thoughts?
> 
>  From a cursory review thus far, since this introduced a new XSM hook 
> site, shouldn't this have at least had an Rb by an XSM 
> reviewer/maintainer?

Probably, but already back then I said this model isn't going to work
flawlessly.

> I would have replied sooner, but have been on holiday for last two weeks.

I guess there was no way for us to know without you sending a note to
private@ (which, I will admit, you may not even have been aware of).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 11:37:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 11:37:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571041.893909 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzJN-0001tL-4l; Thu, 27 Jul 2023 11:37:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571041.893909; Thu, 27 Jul 2023 11:37:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzJN-0001tE-2A; Thu, 27 Jul 2023 11:37:41 +0000
Received: by outflank-mailman (input) for mailman id 571041;
 Thu, 27 Jul 2023 11:37:40 +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 <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOzJM-0001t6-6y
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 11:37:40 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20616.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::616])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fc502d90-2c71-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 13:37:38 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB9641.eurprd04.prod.outlook.com (2603:10a6:102:23f::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 11:37:35 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 11:37:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fc502d90-2c71-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=D/B0EmtJ+UxNJ/Q6qP1mrd2JMnqcRlzNwq4Gzwl4HHW6/c+eGa8VoRRbFk2qN5vQaACeZf1cMyIYkqu7wvM3N6AZkPsVP5nRzDJ5KXBDKR1PtCBNk66SzGAYrq6edHi2FSeKh5IT8W2q1cs9r5Zn9rJ05kWq0LUYmAeqxYCelXTQK0i/7QTSGINVQJjtChfz1dmPVANXem3inHyd+3Iy0ceKf5FX8ai8XrDO4LAIn70fjnlZ4aVce9Xu05YjDQbb1lR9LUN0z7PY/0AeZSEgBPrEQ2TONNuH8nvSm+BNvoHUe3lf59SYGjZRVRcNxWfS5pjMq+zKYFzOgXNZ0C6A4A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3AV0qgEI5SmJZrQHVynjin2zn7w148wWi6i+SzLlsGQ=;
 b=OegfAUtI5KfHelYnkmFWBAn5OwP//EdkPoWKZrg+EGdeHR5al7ONVwyvtRGtKBwMCqz8bsdC3ABHJlyrwVdO1GVxpdexTpZUNcW3k26JEflVofkb5v5lttnXxxHcc7zRkLNsyY/XIoU+8xDYjSv1adxY377IXJZWmf29aL88L9zi52eNCFRHc6Yo5BnUXf2G/SmwaDRj/pLJOVESDPMGFpkTFl4CFMbmMNUuG/KJYF5nOojV+NPIVJ3AutQx8QKMQRfj8cuDBpUNOosiVjC9I0Li/If6Xv8Yu7SfK3UBm3jMxcCXEOr4LSpBkniktKLc3gYPRSovZA6nFgq8nL5GvA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3AV0qgEI5SmJZrQHVynjin2zn7w148wWi6i+SzLlsGQ=;
 b=MbPxx75HVbuaEl5la8xw9RiO/ClIWLT0k49tnXiDC/pIjq4je1CuNqO7PTNOXcG5iU3qg+Q4ES6te+FfvUVk3UH5kmiYKsclIPDG3TdNgZwtn7AO8cvM0rWnwUTNjv5AZuDVKOmlErFN+7E/aJQ3OegJQtvpwSj6nEOq8pNTD+ovQWT6OXvXXxqKn5DsRQM4WPKCTkMoX2BdOkstJCxUVZcrE6+35XS0hJ1tObyhndOhgDTByRq8r2OKcywzBXKZJZjAXyp7nYH4mF4A0lhwdE1w+qdMgi7h3xODG7/4/73prCOS7dY7vHKmUY3tSH3Lew3VSPqjXVl5Dc107niqkw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <2d5c6adf-321d-5bbc-c5b5-4ea3d255bf42@suse.com>
Date: Thu, 27 Jul 2023 13:37:33 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Content-Language: en-US
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local> <87ila7cvy2.fsf@epam.com>
 <ZMDox0WwumxMGnzV@MacBook-Air-de-Roger.local> <87y1j2b296.fsf@epam.com>
 <999aae1d-fb85-6550-9798-64cf88d7faf3@suse.com> <87r0otbq78.fsf@epam.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <87r0otbq78.fsf@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0021.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1c::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB9641:EE_
X-MS-Office365-Filtering-Correlation-Id: 8299a801-d6a1-49fa-c9ee-08db8e95df8a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	M0pw2uAxOBVsO+Of4stJSFI693RPLFMPVxmc3RbEnWpodrh0zCh8n6G6VJOBmihi9xld6I46d8pWZXXdYRcge1JeK5Vr9S3drCdtLDJbzNG/L0NsNXIEdKViOlKHirbOE274kzz992yPKc3rzYuNb0E/EX+vouafpn8TV6Qu0HLWKqhhG6Q+A0dCUg/NIW0AIE0BDaHSbkKkAFT/3Fy76DBaaEybmv5H+tX+AsZAKQuqc/w/TueWo2e3cyLmmzkol7ErizNt1AbD5X3ic52rNvB7c2bncB6G8oUeCH15H+5ws8WLSo7acdcBL9rW16NRmTFrG1afzYXcLsVAqfBt2PkzT1Bd7gCnzSx/j8uWB7Yf8vin5aOsed53hbBYDHaHTOaGFyrY7quBGC9m2CNS7gp7LWDp2YveUXdqmXEDW4FshhsdPH5iOyBgOgTx9IKl0CTJJnH7Ogc4IACKJNkEPfUnCIYbA3DnZTNlhXlUczfpv2CALy4dAPHhy9YpGYc9e7LZ4Jd9XZ+QvHwJGrQxJ9dDDeVaL5cNSiUbvPf1PX+2G61iG6phdkPjsnRQBXKeTAxuxuKSv73plRqtroH6yMTabR+OYTPizF/jCKzOLiIH24j9EPnkGBi01k3oC/YAf3qMtcaBxqslke73yoDYbA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(366004)(136003)(396003)(39860400002)(451199021)(31686004)(2906002)(83380400001)(2616005)(6506007)(26005)(186003)(53546011)(6512007)(6486002)(478600001)(54906003)(86362001)(66946007)(38100700002)(31696002)(41300700001)(4326008)(66476007)(66556008)(8676002)(6916009)(316002)(8936002)(5660300002)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RlQwYnY1SlpqSzhvaDJoWThuK29JYnEwSnhNWk4vRE1rYzVLS1owS3h3TlM2?=
 =?utf-8?B?WGRHZ0pTd254MFoyL3BUZWEyVDJwUXRyMWFOT0FBYUdITU1mZDZ6R1ZQQ1l1?=
 =?utf-8?B?alc1Sm8zSW53YXk1NmN2TTViZVBseTB3MlZ3MFJPUE9rVXh5eEFLTE9rYnR2?=
 =?utf-8?B?TVc3YkcrRG94UjlpVlpwZ3FUTmZVbjUzVXFNdX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?b2xVL1dNRFp6K0QrOStkRDJpK1NLeFNXaG9KcHpVampCNHJxVTRFM0M5TkZB?=
 =?utf-8?B?SFNCQTdRelo5TXNaK3FSSWpNbnIrbG0vUlQ3MWUzZEJMTzBMMDdRMm5menBl?=
 =?utf-8?B?ajQvU2kzdlJ5bWpNek1EcDdJU1dvYnFJd0thRVdIZklQQ2k4RXRIZHZkZGtp?=
 =?utf-8?Q?wC8bqbAsBH6oh34jIBi/6aQCb?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8299a801-d6a1-49fa-c9ee-08db8e95df8a
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 11:37:35.5917
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 7ELx31/TcTrJZWq7e37IngpAU3H9Chb0KiwZUiHjjjAMk9ma8CKIKjyHXqh5H1iSsCz//whzGn61D3mxXywFaA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9641

On 27.07.2023 12:31, Volodymyr Babchuk wrote:
> 
> Hi Jan
> 
> Jan Beulich <jbeulich@suse.com> writes:
> 
>> On 27.07.2023 02:56, Volodymyr Babchuk wrote:
>>> Hi Roger,
>>>
>>> Roger Pau MonnÃ© <roger.pau@citrix.com> writes:
>>>
>>>> On Wed, Jul 26, 2023 at 01:17:58AM +0000, Volodymyr Babchuk wrote:
>>>>>
>>>>> Hi Roger,
>>>>>
>>>>> Roger Pau MonnÃ© <roger.pau@citrix.com> writes:
>>>>>
>>>>>> On Thu, Jul 20, 2023 at 12:32:31AM +0000, Volodymyr Babchuk wrote:
>>>>>>> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
>>>>>>> @@ -498,6 +537,7 @@ void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
>>>>>>>          ASSERT(data_offset < size);
>>>>>>>      }
>>>>>>>      spin_unlock(&pdev->vpci->lock);
>>>>>>> +    unlock_locks(d);
>>>>>>
>>>>>> There's one issue here, some handlers will cal pcidevs_lock(), which
>>>>>> will result in a lock over inversion, as in the previous patch we
>>>>>> agreed that the locking order was pcidevs_lock first, d->pci_lock
>>>>>> after.
>>>>>>
>>>>>> For example the MSI control_write() handler will call
>>>>>> vpci_msi_arch_enable() which takes the pcidevs lock.  I think I will
>>>>>> have to look into using a dedicated lock for MSI related handling, as
>>>>>> that's the only place where I think we have this pattern of taking the
>>>>>> pcidevs_lock after the d->pci_lock.
>>>>>
>>>>> I'll mention this in the commit message. Is there something else that I
>>>>> should do right now?
>>>>
>>>> Well, I don't think we want to commit this as-is with a known lock
>>>> inversion.
>>>>
>>>> The functions that require the pcidevs lock are:
>>>>
>>>> pt_irq_{create,destroy}_bind()
>>>> unmap_domain_pirq()
>>>>
>>>> AFAICT those functions require the lock in order to assert that the
>>>> underlying device doesn't go away, as they do also use d->event_lock
>>>> in order to get exclusive access to the data fields.  Please double
>>>> check that I'm not mistaken.
>>>
>>> You are right, all three function does not access any of PCI state
>>> directly. However...
>>>
>>>> If that's accurate you will have to check the call tree that spawns
>>>> from those functions in order to modify the asserts to check for
>>>> either the pcidevs or the per-domain pci_list lock being taken.
>>>
>>> ... I checked calls for PT_IRQ_TYPE_MSI case, there is only call that
>>> bothers me: hvm_pi_update_irte(), which calls IO-MMU code via
>>> vmx_pi_update_irte():
>>>
>>> amd_iommu_msi_msg_update_ire() or msi_msg_write_remap_rte().
>>>
>>> Both functions read basic pdev fields like sbfd or type. I see no
>>> problem there, as values of those fields are not supposed to be changed.
>>
>> But whether fields are basic or will never change doesn't matter when
>> the pdev struct itself suddenly disappears.
> 
> This is not a problem, as it is expected that d->pci_lock is being held,
> so pdev structure will not disappear. I am trying to answer another
> question: is d->pci_lock enough or pcidevs_lock is also should required?

To answer such questions, may I ask that you first firmly write down
(and submit) what each of the locks guards?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 11:46:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 11:46:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571043.893919 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzSF-0003Qy-2E; Thu, 27 Jul 2023 11:46:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571043.893919; Thu, 27 Jul 2023 11:46:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzSE-0003Qr-UT; Thu, 27 Jul 2023 11:46:50 +0000
Received: by outflank-mailman (input) for mailman id 571043;
 Thu, 27 Jul 2023 11:46:50 +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
 <SRS0=RfsC=DN=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1qOzSD-0003Ql-VY
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 11:46:49 +0000
Received: from sender4-of-o50.zoho.com (sender4-of-o50.zoho.com
 [136.143.188.50]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 42c8eb69-2c73-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 13:46:46 +0200 (CEST)
Received: from [10.10.1.94] (static-72-81-132-2.bltmmd.fios.verizon.net
 [72.81.132.2]) by mx.zohomail.com
 with SMTPS id 1690458398151729.4027551687199;
 Thu, 27 Jul 2023 04:46:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 42c8eb69-2c73-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; t=1690458400; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=HV2Ipr99h8fCj2oOFcH1axBbseGE8bQBWvG+j6+XdplFSqcR+O21KMHPw6Qsj/PzHob7swtHuN008q/iI0/tP6WVrBHoMVFHDHpHCPQDh6fSDSzLeZn3DO2wevjUylmi98yKjEfN5xKEtmW7f7jbOFOVfmAYssby3/cnxnAYzAM=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1690458400; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; 
	bh=K0GLp8MK3QdMiirM3gElxDw+KxMOPbQPaby+TbtZNRY=; 
	b=Q1YUUbyb8R6tH+pfmthYzJzfVp+aUaeG20dypIoVUY2bpNBV4sbmMfTrZp4MiyMNx0CKK/NiMB1t1JWH2dgUkZPdnytWiTOqmuEHzTe+jW17pcXPDEzdEoLqxZNKxdc+4xipKfBjJdf5DTtBIEOuAFE5YBh+ndH7n078EVfXd/Q=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1690458400;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To;
	bh=K0GLp8MK3QdMiirM3gElxDw+KxMOPbQPaby+TbtZNRY=;
	b=bdPIGQ6NNnchOV+E5XFvmZd2qcf/XP1mn3WiZwwPVeqIQl7QsvFERIy2LuDAsOgQ
	Nb7u5/xkEf/elVgwPdu1BC5sB2fJNdu46vuHAFrY7sLdm34Ul2uzlmXirTnRFvjXA2n
	wGwv0I+E/brLRV0QjkyGeiW7YQ5d8o1nlNGy+xAw=
Message-ID: <2994c9b8-c803-1fd9-20df-0d25d2b66c49@apertussolutions.com>
Date: Thu, 27 Jul 2023 07:46:35 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [PATCH 03/10] x86 setup: change bootstrap map to accept new boot
 module structures
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>,
 Christopher Clark <christopher.w.clark@gmail.com>
Cc: xen-devel@lists.xenproject.org, stefano.stabellini@amd.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Luca Fancellu <luca.fancellu@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Rich Persaud <persaur@gmail.com>, Stefano Stabellini <sstabellini@kernel.org>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
 <20230701071835.41599-4-christopher.w.clark@gmail.com>
 <alpine.DEB.2.22.394.2307081144340.761183@ubuntu-linux-20-04-desktop>
 <CACMJ4GYE6PW1SY35dhs4XkXd9ru25igrvMCrh4pJMWEBNNz0YQ@mail.gmail.com>
 <CACMJ4Gb_ZwKSjP7qzfQj98YQjSpBdFuWzeGQJUNNqst0GdXCOw@mail.gmail.com>
 <4e0a0fc9-0c1b-4725-5692-de67ee68a980@suse.com>
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
In-Reply-To: <4e0a0fc9-0c1b-4725-5692-de67ee68a980@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External



On 7/21/23 02:14, Jan Beulich wrote:
> On 21.07.2023 00:12, Christopher Clark wrote:
>> On Thu, Jul 13, 2023 at 11:51â€¯PM Christopher Clark <
>> christopher.w.clark@gmail.com> wrote:
>>
>>>
>>>
>>> On Sat, Jul 8, 2023 at 11:47â€¯AM Stefano Stabellini <sstabellini@kernel.org>
>>> wrote:
>>>
>>>> On Sat, 1 Jul 2023, Christopher Clark wrote:
>>>>> To convert the x86 boot logic from multiboot to boot module structures,
>>>>> change the bootstrap map function to accept a boot module parameter.
>>>>>
>>>>> To allow incremental change from multiboot to boot modules across all
>>>>> x86 setup logic, provide a temporary inline wrapper that still accepts a
>>>>> multiboot module parameter and use it where necessary. The wrapper is
>>>>> placed in a new arch/x86 header <asm/boot.h> to avoid putting a static
>>>>> inline function into an existing header that has no such functions
>>>>> already. This new header will be expanded with additional functions in
>>>>> subsequent patches in this series.
>>>>>
>>>>> No functional change intended.
>>>>>
>>>>> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
>>>>> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
>>>>>
>>>>
>>>> [...]
>>>>
>>>>> diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
>>>>> index b72ae31a66..eb93cc3439 100644
>>>>> --- a/xen/include/xen/bootinfo.h
>>>>> +++ b/xen/include/xen/bootinfo.h
>>>>> @@ -10,6 +10,9 @@
>>>>>   #endif
>>>>>
>>>>>   struct boot_module {
>>>>> +    paddr_t start;
>>>>> +    size_t size;
>>>>
>>>> I think size should be paddr_t (instead of size_t) to make sure it is
>>>> the right size on both 64-bit and 32-bit architectures that support
>>>> 64-bit addresses.
>>>>
>>>
>>> Thanks, that explanation does make sense - ack.
>>>
>>
>> I've come back to reconsider this as it doesn't seem right to me to store a
>> non-address value (which this will always be) in a type explicitly defined
>> to hold an address: addresses may have architectural alignment requirements
>> whereas a size value is just a number of bytes so will not. The point of a
>> size_t value is that size_t is defined to be large enough to hold the size
>> of any valid object in memory, so I think this was right as-is.
> 
> "Any object in memory" implies virtual addresses (or more generally addresses
> which can be used for accessing objects). This isn't the case when considering
> physical addresses - there may be far more memory in a system than can be made
> accessible all in one go.

That is not my understanding of it, but I could be wrong. My 
understanding based on all the debates I have read online around this 
topic is that the intent in the spec is that size_t has to be able to 
hold a value that represents the largest object the CPU can manipulate 
with general purpose operations. From which I understand to mean as 
large as the largest register a CPU instruction may use for a size 
argument to a general purpose instruction. On x86_64, that is a 64bit 
register, as I don't believe the SSE/AVX registers are counted even 
though the are used by compiler/libc implementations to optimize some 
memory operations.

 From what I have seen for Xen, this is currently reflected in the x86 
code base, as size_t is 32bits for the early 32bit code and 64bits for 
Xen proper.

That aside, another objection I have to the use of paddr_t is that it is 
type abuse. Types are meant to convey context to the intended use of the 
variable and enable the ability to enforce proper usage of the variable, 
otherwise we might as well just use u64/uint64_t and be done. The 
field's purpose is to convey a size of an object, and labeling it a type 
that is intended for physical address objects violates both intents 
behind declaring a type, it asserts an invalid context and enables 
violations of type checking.

V/r,
Daniel P. Smith


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 11:49:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 11:49:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571046.893929 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzUs-00044f-Ir; Thu, 27 Jul 2023 11:49:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571046.893929; Thu, 27 Jul 2023 11:49:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzUs-00044Y-GJ; Thu, 27 Jul 2023 11:49:34 +0000
Received: by outflank-mailman (input) for mailman id 571046;
 Thu, 27 Jul 2023 11:49:33 +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
 <SRS0=RfsC=DN=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1qOzUr-00044Q-An
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 11:49:33 +0000
Received: from sender4-of-o50.zoho.com (sender4-of-o50.zoho.com
 [136.143.188.50]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a536f4af-2c73-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 13:49:31 +0200 (CEST)
Received: from [10.10.1.94] (static-72-81-132-2.bltmmd.fios.verizon.net
 [72.81.132.2]) by mx.zohomail.com
 with SMTPS id 1690458564247471.85456630296505;
 Thu, 27 Jul 2023 04:49:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a536f4af-2c73-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; t=1690458566; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=gXvNQD/B37SUazoul36QQN75dhLbIyRL4Z3fnJwsad7npIEHh4kJ02Hmi2+uuwIvMvhKt5YnieevRVOz5WDpHFQYL6nwq4AigLu5UD69HDV2VKlpcs+6TEkyG0Dui7OFqaWN41DehBF4b5UMgirjW+Bsuarraof3a42ODrLXFt4=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1690458566; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; 
	bh=e+alQMFX4pSomvz1LTwwiEHw4w0qcGyOmOW8Lw2aLCk=; 
	b=Y5GhQg/nuztbGtIjZNx38gUda7uALuEWrE/oXyZpDs2lHCrwDVe6XStKzbiQy+zfmiqqEUl21dBgAzeQKBiwQJgrnKZrEg4MLhKb8LxsF2HEj8rNFROQf5zv05/HFcKdzjhIs3aVxbY3oPPPfE4w/ncckkIDe1laJZxvDYqLmLI=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1690458566;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To;
	bh=e+alQMFX4pSomvz1LTwwiEHw4w0qcGyOmOW8Lw2aLCk=;
	b=m7BGcX8euDuFjgNKnr0OiS0HhzDgCC2k9J0UvuqGrruVuTGZHUuOVuQOXyjaeW7+
	Sxb3FcyeXT4G21+alwj/m26JgEj5w52tj/rGtWwFYZbe8xcHNTvLJqnc2b/JmIeICAZ
	kq0ddbLn7IAnaTNAghUH17KVIzape7HUiIj/p9e4=
Message-ID: <2e85b750-5e40-d1a5-9546-8b8c9528a240@apertussolutions.com>
Date: Thu, 27 Jul 2023 07:49:21 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [PATCH 03/10] x86 setup: change bootstrap map to accept new boot
 module structures
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>,
 Jan Beulich <jbeulich@suse.com>
Cc: Christopher Clark <christopher.w.clark@gmail.com>,
 xen-devel@lists.xenproject.org, stefano.stabellini@amd.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Luca Fancellu <luca.fancellu@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Rich Persaud <persaur@gmail.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
 <20230701071835.41599-4-christopher.w.clark@gmail.com>
 <alpine.DEB.2.22.394.2307081144340.761183@ubuntu-linux-20-04-desktop>
 <CACMJ4GYE6PW1SY35dhs4XkXd9ru25igrvMCrh4pJMWEBNNz0YQ@mail.gmail.com>
 <CACMJ4Gb_ZwKSjP7qzfQj98YQjSpBdFuWzeGQJUNNqst0GdXCOw@mail.gmail.com>
 <4e0a0fc9-0c1b-4725-5692-de67ee68a980@suse.com>
 <alpine.DEB.2.22.394.2307211507530.3118466@ubuntu-linux-20-04-desktop>
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
In-Reply-To: <alpine.DEB.2.22.394.2307211507530.3118466@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External



On 7/21/23 18:08, Stefano Stabellini wrote:
> On Fri, 21 Jul 2023, Jan Beulich wrote:
>> On 21.07.2023 00:12, Christopher Clark wrote:
>>> On Thu, Jul 13, 2023 at 11:51â€¯PM Christopher Clark <
>>> christopher.w.clark@gmail.com> wrote:
>>>
>>>>
>>>>
>>>> On Sat, Jul 8, 2023 at 11:47â€¯AM Stefano Stabellini <sstabellini@kernel.org>
>>>> wrote:
>>>>
>>>>> On Sat, 1 Jul 2023, Christopher Clark wrote:
>>>>>> To convert the x86 boot logic from multiboot to boot module structures,
>>>>>> change the bootstrap map function to accept a boot module parameter.
>>>>>>
>>>>>> To allow incremental change from multiboot to boot modules across all
>>>>>> x86 setup logic, provide a temporary inline wrapper that still accepts a
>>>>>> multiboot module parameter and use it where necessary. The wrapper is
>>>>>> placed in a new arch/x86 header <asm/boot.h> to avoid putting a static
>>>>>> inline function into an existing header that has no such functions
>>>>>> already. This new header will be expanded with additional functions in
>>>>>> subsequent patches in this series.
>>>>>>
>>>>>> No functional change intended.
>>>>>>
>>>>>> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
>>>>>> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
>>>>>>
>>>>>
>>>>> [...]
>>>>>
>>>>>> diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
>>>>>> index b72ae31a66..eb93cc3439 100644
>>>>>> --- a/xen/include/xen/bootinfo.h
>>>>>> +++ b/xen/include/xen/bootinfo.h
>>>>>> @@ -10,6 +10,9 @@
>>>>>>   #endif
>>>>>>
>>>>>>   struct boot_module {
>>>>>> +    paddr_t start;
>>>>>> +    size_t size;
>>>>>
>>>>> I think size should be paddr_t (instead of size_t) to make sure it is
>>>>> the right size on both 64-bit and 32-bit architectures that support
>>>>> 64-bit addresses.
>>>>>
>>>>
>>>> Thanks, that explanation does make sense - ack.
>>>>
>>>
>>> I've come back to reconsider this as it doesn't seem right to me to store a
>>> non-address value (which this will always be) in a type explicitly defined
>>> to hold an address: addresses may have architectural alignment requirements
>>> whereas a size value is just a number of bytes so will not. The point of a
>>> size_t value is that size_t is defined to be large enough to hold the size
>>> of any valid object in memory, so I think this was right as-is.
>>
>> "Any object in memory" implies virtual addresses (or more generally addresses
>> which can be used for accessing objects). This isn't the case when considering
>> physical addresses - there may be far more memory in a system than can be made
>> accessible all in one go.
> 
> Right. And I think size_t is defined as 32-bit in Xen which is a
> problem.

In x86 32bit early boot code it is 32bits, but in Xen proper it is 
64bits. That is why in the 32bit HL code, a second set of structures was 
used with macros to ensure the structures used 64bit values for field 
types that are not 64bits in 32bit mode code.

v/r,
dps


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 11:58:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 11:58:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571048.893938 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzdU-0005a7-Cr; Thu, 27 Jul 2023 11:58:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571048.893938; Thu, 27 Jul 2023 11:58:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzdU-0005a0-AJ; Thu, 27 Jul 2023 11:58:28 +0000
Received: by outflank-mailman (input) for mailman id 571048;
 Thu, 27 Jul 2023 11:58:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOzdS-0005Zu-Sr
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 11:58:26 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on0625.outbound.protection.outlook.com
 [2a01:111:f400:fe02::625])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e412c20f-2c74-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 13:58:25 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBAPR04MB7238.eurprd04.prod.outlook.com (2603:10a6:10:1aa::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 11:58:22 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 11:58:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e412c20f-2c74-11ee-b247-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=i3+debvI/F75cR/uxHOwHijk+O6rqspygRytZb+w7t3bdWfsarL6Mz2O0bSi5w+i4IA9bxAauHETo5J1XwS+Em1xe2fIhoAwwGJlTwvEmIDLTfD5+43onlxFD6LUUxN+0yy7R/54tpn1MHUYp3EK8pCCSik9j06dOSr2dgVZ6TrEjYqAz9J0ej3AeSC/Y35IT0xoQpbdDgt45NwvgXqhupKNr9o92ToOeo/BWfGacsimPK7gsyxkVwYDIPG5GY7+4pWfy7TJFN1nVo9l7hcivm8/OklMWSgjPA2uivL0pxPbtuRs7uR6tDfOLtbsPVP3k8XdQ7HJ/A67M3asvhRSAQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=UmjArt7j1aO/KD8A+nQ2MfzfLHFly5OvmXbtyxJjLkQ=;
 b=cP5/Q4vYMg9Lvncq5VkvSNebwH/zkGgr1k8gLvddzma+MdXVgwanasGAzgnqxuSaavyp+me8nPzzNn/7y+L1lsa0Gs91h/xBDuqp0IqH0LAlfDPJ14Zko7rLUZqeYG4biitdEL0i175dVFP7bLvjBvdiiQ/ZcwZVyyAiaK4VcCWQ61EZRg225Mpj36kHffXNsYiJX8i/3Ods7aCJInHfZ1atcis+k5ZiYWCUIILrN0QG1RaiKAlDH7OKq9lrCTVLEf7q9QIReZhxISaUmAt8YQP66j2+YJUfg3qlO/GZVhfZ789KVitzzEiPZLcaixEboC/0y4dX04Oput60jJA/pg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=UmjArt7j1aO/KD8A+nQ2MfzfLHFly5OvmXbtyxJjLkQ=;
 b=0USdvKkvfs5YxZxz12QaNlMLiRLve6XLPK8H/YJuNDp3kAAht1sMeyD4aw1kJrsdXPum9DN9296cZZgESpEIjjtPBKoW28z7EbjpBEAnCnnGLvGTtzpoLiMeT+xXc22sb54s0S3PhpLiR7GUg7sqEwMcxeMSmGg7oLin1BLYUzJmql+8i8q6C+znYcCi804Hu0NQMO65Me92VkjBn/fPogt8sZwbEsQIC0WUyV7W0dsHY0aGLQwiTcnBXWaojnKYPK09Mn5mhFoGVsMbAsAcj3aoDBnf+VY83UYj968OUZjiXJTAhkVBk7/cvd3LbaIrD9zT0BTudzfycSRrq2ynXg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ca85fd2e-45a5-32c3-cb4b-1042be6c6915@suse.com>
Date: Thu, 27 Jul 2023 13:58:19 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 03/10] x86 setup: change bootstrap map to accept new boot
 module structures
Content-Language: en-US
To: "Daniel P. Smith" <dpsmith@apertussolutions.com>
Cc: xen-devel@lists.xenproject.org, stefano.stabellini@amd.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Luca Fancellu <luca.fancellu@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Rich Persaud <persaur@gmail.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Christopher Clark <christopher.w.clark@gmail.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
 <20230701071835.41599-4-christopher.w.clark@gmail.com>
 <alpine.DEB.2.22.394.2307081144340.761183@ubuntu-linux-20-04-desktop>
 <CACMJ4GYE6PW1SY35dhs4XkXd9ru25igrvMCrh4pJMWEBNNz0YQ@mail.gmail.com>
 <CACMJ4Gb_ZwKSjP7qzfQj98YQjSpBdFuWzeGQJUNNqst0GdXCOw@mail.gmail.com>
 <4e0a0fc9-0c1b-4725-5692-de67ee68a980@suse.com>
 <2994c9b8-c803-1fd9-20df-0d25d2b66c49@apertussolutions.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <2994c9b8-c803-1fd9-20df-0d25d2b66c49@apertussolutions.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0035.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1c::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBAPR04MB7238:EE_
X-MS-Office365-Filtering-Correlation-Id: 5907880d-c7aa-44de-c64f-08db8e98c665
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	FKY23H2akY8lc2/3CinbrPUa2jCBCnGbElCL5Gppnmj+xh25Im5l4o1WLzX/rTMOBGyyTQ6w4pT4UIwlHn3eIEz6nx3ILfO78n1ZYeIBfCzPJ+LUFIimSlDGtNIW99vqYObOKDFWbOn/fX81MDtchD6aikk1rNYxkpv0n7lqnmYxYpit5dUNJs1ph+vM1w96V9GhIeSvy7GbXDJtK1VQoES+s+ZPYthg4ZawnNQ0y7cKImt344KGDDHVXehlwYCmaDTiQ92ymHv0sBB3kujVU0JJz6n530hEuTim7euQc2ZEqG+84Xt5MAxG18JO6jxI693fivztL4poBta6EuWjA7d0+rwUJNMAufDGJc6GfHq5+oGsnQ3QbitTLzMftPFNLH7jGMmHVZEP3OlK7iB78AmtxSVvjjAQYUfIYrMomn2OyTpxMFFmheNeTXLE6QjvnvRdc1UMmRXsHkPpfPNsitw9GOr9eObOPqejd74Jw5HyazgOnV/kAIyrEvAZPQTitDM5R3b3mQ60xqW1BC5fGVzVe6up188j+IJuLNY2xKHs5G6nLyw6a9l48NmEc/Pr3JZRNAoqT9+iTVvuggB/qYGMKC+MQgZN/VF0A1qNklStHVHXdobOCuQzyCYWv3KUP5LYzy067SLG0MYiyoOtMg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(136003)(376002)(366004)(346002)(451199021)(478600001)(6486002)(54906003)(6512007)(6666004)(26005)(186003)(53546011)(6506007)(2616005)(2906002)(66556008)(66476007)(316002)(4326008)(5660300002)(8936002)(7416002)(66946007)(41300700001)(6916009)(8676002)(38100700002)(31696002)(86362001)(36756003)(83380400001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SnFzYXBjM3dMM0NJNUYxZzJKMEVsN01jbmZkMXZXMFgySDArajlvN2hGWjk0?=
 =?utf-8?B?bkZOaXdndGhNVzVqNERpKzRHZ0lOdkwvY0VxZzhSYUZuNXhGVk9aNkpteHc4?=
 =?utf-8?B?M3ZMNSthRktRdXhuR0RLTE9qOW5Wd1FEd2VYTkhCb1M0eU9zL2o2SWU1ajVF?=
 =?utf-8?B?ZnFDYUI1MlRCajY5TUMvcHZNSDUxbVN5bFIxN2g3cmh0WDJZWjUrWGQ5bFBI?=
 =?utf-8?B?dW1pVFF2ZVRHVmRPZnpOdWlaZWNWaFdzNmduR280SDU4bW9XRk1pRDdnM0g1?=
 =?utf-8?B?ZkU3c1JtTnBXRTlCaDE2ZVc0MXBZUER0Q0RJRFplTFlNTHMwNW90QVdLSmNy?=
 =?utf-8?B?ZUExTGdyZkNWaDRxOHA1OFlrMSt6OUtqV01vVmxvZTdTYUc4OUpZVy9lK2Y4?=
 =?utf-8?B?SmQ2ZXA0OHVlSjAwNzJDcDYyc1lKVG1Eb05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d-c7aa-44de-c64f-08db8e98c665
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 11:58:22.1041
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: JjTU61jhYyq8WAluvusrq5yUgYyELuBzzgPZvoAHR+v+FHXfueNbCr3R4JtTCwDZXyDIBQfnq3RFtkwSLIRSTA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7238

On 27.07.2023 13:46, Daniel P. Smith wrote:
> 
> 
> On 7/21/23 02:14, Jan Beulich wrote:
>> On 21.07.2023 00:12, Christopher Clark wrote:
>>> On Thu, Jul 13, 2023 at 11:51â€¯PM Christopher Clark <
>>> christopher.w.clark@gmail.com> wrote:
>>>
>>>>
>>>>
>>>> On Sat, Jul 8, 2023 at 11:47â€¯AM Stefano Stabellini <sstabellini@kernel.org>
>>>> wrote:
>>>>
>>>>> On Sat, 1 Jul 2023, Christopher Clark wrote:
>>>>>> To convert the x86 boot logic from multiboot to boot module structures,
>>>>>> change the bootstrap map function to accept a boot module parameter.
>>>>>>
>>>>>> To allow incremental change from multiboot to boot modules across all
>>>>>> x86 setup logic, provide a temporary inline wrapper that still accepts a
>>>>>> multiboot module parameter and use it where necessary. The wrapper is
>>>>>> placed in a new arch/x86 header <asm/boot.h> to avoid putting a static
>>>>>> inline function into an existing header that has no such functions
>>>>>> already. This new header will be expanded with additional functions in
>>>>>> subsequent patches in this series.
>>>>>>
>>>>>> No functional change intended.
>>>>>>
>>>>>> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
>>>>>> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
>>>>>>
>>>>>
>>>>> [...]
>>>>>
>>>>>> diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
>>>>>> index b72ae31a66..eb93cc3439 100644
>>>>>> --- a/xen/include/xen/bootinfo.h
>>>>>> +++ b/xen/include/xen/bootinfo.h
>>>>>> @@ -10,6 +10,9 @@
>>>>>>   #endif
>>>>>>
>>>>>>   struct boot_module {
>>>>>> +    paddr_t start;
>>>>>> +    size_t size;
>>>>>
>>>>> I think size should be paddr_t (instead of size_t) to make sure it is
>>>>> the right size on both 64-bit and 32-bit architectures that support
>>>>> 64-bit addresses.
>>>>>
>>>>
>>>> Thanks, that explanation does make sense - ack.
>>>>
>>>
>>> I've come back to reconsider this as it doesn't seem right to me to store a
>>> non-address value (which this will always be) in a type explicitly defined
>>> to hold an address: addresses may have architectural alignment requirements
>>> whereas a size value is just a number of bytes so will not. The point of a
>>> size_t value is that size_t is defined to be large enough to hold the size
>>> of any valid object in memory, so I think this was right as-is.
>>
>> "Any object in memory" implies virtual addresses (or more generally addresses
>> which can be used for accessing objects). This isn't the case when considering
>> physical addresses - there may be far more memory in a system than can be made
>> accessible all in one go.
> 
> That is not my understanding of it, but I could be wrong. My 
> understanding based on all the debates I have read online around this 
> topic is that the intent in the spec is that size_t has to be able to 
> hold a value that represents the largest object the CPU can manipulate 
> with general purpose operations. From which I understand to mean as 
> large as the largest register a CPU instruction may use for a size 
> argument to a general purpose instruction. On x86_64, that is a 64bit 
> register, as I don't believe the SSE/AVX registers are counted even 
> though the are used by compiler/libc implementations to optimize some 
> memory operations.

I can't see how this relates to my earlier remark.

>  From what I have seen for Xen, this is currently reflected in the x86 
> code base, as size_t is 32bits for the early 32bit code and 64bits for 
> Xen proper.
> 
> That aside, another objection I have to the use of paddr_t is that it is 
> type abuse. Types are meant to convey context to the intended use of the 
> variable and enable the ability to enforce proper usage of the variable, 
> otherwise we might as well just use u64/uint64_t and be done. The 
> field's purpose is to convey a size of an object,

You use "object" here again, when in physical address space (with paging
enabled) this isn't an appropriate term.

> and labeling it a type 
> that is intended for physical address objects violates both intents 
> behind declaring a type, it asserts an invalid context and enables 
> violations of type checking.

It is type abuse to a certain extent, yes, but what do you do? We could
invent psize_t, but that would (afaics) always match paddr_t. uint64_t
otoh may be too larger for 32-bit platforms which only know a 32-bit
wide physical address space.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:06:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:06:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571051.893949 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzla-00079u-Dc; Thu, 27 Jul 2023 12:06:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571051.893949; Thu, 27 Jul 2023 12:06:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzla-00079n-AC; Thu, 27 Jul 2023 12:06:50 +0000
Received: by outflank-mailman (input) for mailman id 571051;
 Thu, 27 Jul 2023 12:06:49 +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
 <SRS0=C0z/=DN=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qOzlZ-00079h-Ee
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 12:06:49 +0000
Received: from frasgout12.his.huawei.com
 (ecs-14-137-139-154.compute.hwclouds-dns.com [14.137.139.154])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0d79d0b2-2c76-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 14:06:44 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.227])
 by frasgout12.his.huawei.com (SkyGuard) with ESMTP id 4RBTg867Jwz9xFb5
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 19:53:24 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.209.69])
 by APP2 (Coremail) with SMTP id GxC2BwBnGkGaXcJkfMYUBQ--.33878S2;
 Thu, 27 Jul 2023 13:06:05 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0d79d0b2-2c76-11ee-8613-37d641c3527e
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM),
	linux-mm@kvack.org (open list:SLAB ALLOCATOR)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v6 0/9] Allow dynamic allocation of software IO TLB bounce buffers
Date: Thu, 27 Jul 2023 14:05:28 +0200
Message-Id: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2BwBnGkGaXcJkfMYUBQ--.33878S2
X-Coremail-Antispam: 1UD129KBjvJXoW3Wr1Dtw1rJr47Aw4kKrykZrb_yoWDJw4fpF
	WrK34ftF4qqryxA3s7Ca18GFyrKa1kGry5GrWFvryrur13Cr1j93WktayrXFW7Gr40vF12
	qFyYvw13uw1DZ3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDU0xBIdaVrnRJUUU9v14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0
	rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02
	1l84ACjcxK6xIIjxv20xvE14v26r1j6r1xM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4j
	6r4UJwA2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr
	0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj
	6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr
	0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E
	8cxan2IY04v7MxkF7I0Ew4C26cxK6c8Ij28IcwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4
	IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1r
	MI8E67AF67kF1VAFwI0_Wrv_Gr1UMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr
	0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWr
	Jr0_WFyUJwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4UJV
	WxJrUvcSsGvfC2KfnxnUUI43ZEXa7VUj1xR3UUUUU==
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

Motivation
==========

The software IO TLB was designed with these assumptions:

1) It would not be used much. Small systems (little RAM) don't need it, and
   big systems (lots of RAM) would have modern DMA controllers and an IOMMU
   chip to handle legacy devices.
2) A small fixed memory area (64 MiB by default) is sufficient to
   handle the few cases which require a bounce buffer.
3) 64 MiB is little enough that it has no impact on the rest of the
   system.
4) Bounce buffers require large contiguous chunks of low memory. Such
   memory is precious and can be allocated only early at boot.

It turns out they are not always true:

1) Embedded systems may have more than 4GiB RAM but no IOMMU and legacy
   32-bit peripheral busses and/or DMA controllers.
2) CoCo VMs use bounce buffers for all I/O but may need substantially more
   than 64 MiB.
3) Embedded developers put as many features as possible into the available
   memory. A few dozen "missing" megabytes may limit what features can be
   implemented.
4) If CMA is available, it can allocate large continuous chunks even after
   the system has run for some time.

Goals
=====

The goal of this work is to start with a small software IO TLB at boot and
expand it later when/if needed.

Design
======

This version of the patch series retains the current slot allocation
algorithm with multiple areas to reduce lock contention, but additional
slots can be added when necessary.

These alternatives have been considered:

- Allocate and free buffers as needed using direct DMA API. This works
  quite well, except in CoCo VMs where each allocation/free requires
  decrypting/encrypting memory, which is a very expensive operation.

- Allocate a very large software IO TLB at boot, but allow to migrate pages
  to/from it (like CMA does). For systems with CMA, this would mean two big
  allocations at boot. Finding the balance between CMA, SWIOTLB and rest of
  available RAM can be challenging. More importantly, there is no clear
  benefit compared to allocating SWIOTLB memory pools from the CMA.

Implementation Constraints
==========================

These constraints have been taken into account:

1) Minimize impact on devices which do not benefit from the change.
2) Minimize the number of memory decryption/encryption operations.
3) Avoid contention on a lock or atomic variable to preserve parallel
   scalability.

Additionally, the software IO TLB code is also used to implement restricted
DMA pools. These pools are restricted to a pre-defined physical memory
region and must not use any other memory. In other words, dynamic
allocation of memory pools must be disabled for restricted DMA pools.

Data Structures
===============

The existing struct io_tlb_mem is the central type for a SWIOTLB allocator,
but it now contains multiple memory pools::

  io_tlb_mem
  +---------+   io_tlb_pool
  | SWIOTLB | 	+-------+   +-------+   +-------+
  |allocator|-->|default|-->|dynamic|-->|dynamic|-->...
  |    	    |  	|memory |   |memory |   |memory |
  +---------+ 	| pool  |   | pool  |   | pool  |
	      	+-------+   +-------+   +-------+

The allocator structure contains global state (such as flags and counters)
and structures needed to schedule new allocations. Each memory pool
contains the actual buffer slots and metadata. The first memory pool in the
list is the default memory pool allocated statically at early boot.

New memory pools are allocated from a kernel worker thread. That's because
bounce buffers are allocated when mapping a DMA buffer, which may happen in
interrupt context where large atomic allocations would probably fail.
Allocation from process context is much more likely to succeed, especially
if it can use CMA.

Nonetheless, the onset of a load spike may fill up the SWIOTLB before the
worker has a chance to run. In that case, try to allocate a small transient
memory pool to accommodate the request. If memory is encrypted and the
device cannot do DMA to encrypted memory, this buffer is allocated from the
coherent atomic DMA memory pool. Reducing the size of SWIOTLB may therefore
require increasing the size of the coherent pool with the "coherent_pool"
command-line parameter.

Performance
===========

All testing compared a vanilla v6.4-rc6 kernel with a fully patched
kernel. The kernel was booted with "swiotlb=force" to allow stress-testing
the software IO TLB on a high-performance device that would otherwise not
need it. CONFIG_DEBUG_FS was set to 'y' to match the configuration of
popular distribution kernels; it is understood that parallel workloads
suffer from contention on the recently added debugfs atomic counters.

These benchmarks were run:

- small: single-threaded I/O of 4 KiB blocks,
- big: single-threaded I/O of 64 KiB blocks,
- 4way: 4-way parallel I/O of 4 KiB blocks.

In all tested cases, the default 64 MiB SWIOTLB would be sufficient (but
wasteful). The "default" pair of columns shows performance impact when
booted with 64 MiB SWIOTLB (i.e. current state). The "growing" pair of
columns shows the impact when booted with a 1 MiB initial SWIOTLB, which
grew to 5 MiB at run time. The "var" column in the tables below is the
coefficient of variance over 5 runs of the test, the "diff" column is the
difference in read-write I/O bandwidth (MiB/s). The very first column is
the coefficient of variance in the results of the base unpatched kernel.

First, on an x86 VM against a QEMU virtio SATA driver backed by a RAM-based
block device on the host:

	base	   default	   growing
	var	var	diff	var	diff
small	1.96%	0.47%	-1.5%	0.52%	-2.2%
big	2.03%	1.35%	+0.9%	2.22%	+2.9%
4way	0.80%	0.45%	-0.7%	1.22%	<0.1%

Second, on a Raspberry Pi4 with 8G RAM and a class 10 A1 microSD card:

	base	   default	   growing
	var	var	diff	var	diff
small	1.09%	1.69%	+0.5%	2.14%	-0.2%
big	0.03%	0.28%	-0.5%	0.03%	-0.1%
4way	5.15%	2.39%	+0.2%	0.66%	<0.1%

Third, on a CoCo VM. This was a bigger system, so I also added a 24-thread
parallel I/O test:

	base	   default	   growing
	var	var	diff	var	diff
small	2.41%	6.02%	+1.1%	10.33%	+6.7%
big	9.20%	2.81%	-0.6%	16.84%	-0.2%
4way	0.86%	2.66%	-0.1%	 2.22%	-4.9%
24way	3.19%	6.19%	+4.4%	 4.08%	-5.9%

Note the increased variance of the CoCo VM, although the host was not
otherwise loaded. These are caused by the first run, which includes the
overhead of allocating additional bounce buffers and sharing them with the
hypervisor. The system was not rebooted between successive runs.

Parallel tests suffer from a reduced number of areas in the dynamically
allocated memory pools. This can be improved by allocating a larger pool
from CMA (not implemented in this series yet).

I have no good explanation for the increase in performance of the
24-thread I/O test with the default (non-growing) memory pool. Although the
difference is within variance, it seems to be real. The average bandwidth
is consistently above that of the unpatched kernel.

To sum it up:

- All workloads benefit from reduced memory footprint.
- No performance regressions have been observed with the default size of
  the software IO TLB.
- Most workloads retain their former performance even if the software IO
  TLB grows at run time.

Changelog
=========

Changes from v5:
- Re-introduce is_swiotlb_allocated(), now again required because of commit
  b035f5a6d852 ("mm: slab: reduce the kmalloc() minimum alignment if DMA
  bouncing possible").

Changes from v4:
- Guard the code with a CONFIG_SWIOTLB_DYNAMIC option
- Remove is_swiotlb_allocated(); instead, prevent repeated initialization
  in swiotlb_init_late()
- Rename default_swiotlb_start() to default_swiotlb_base()
- Embed the default struct io_tlb_pool into struct io_tlb_mem
- Do not re-introduce struct io_tlb_pool.used

Changes from v3:
- Provide swiotlb_is_allocated() instead of extending swiotlb_is_active().
- Do not grow SWIOTLB if its address has been queried (affects Octeon).
- Do not grow SWIOTLB if a remap function is used (affects Xen PV).
- Use dma_mask instead of coherent_dma_mask.
- Replace complex ternary operators with if-else blocks.

Changes from v2:
- Complete rewrite using dynamically allocated memory pools rather
  than a list of individual buffers
- Depend on other SWIOTLB fixes (already sent)
- Fix Xen and MIPS Octeon builds

Changes from RFC:
- Track dynamic buffers per device instead of per swiotlb
- Use a linked list instead of a maple tree
- Move initialization of swiotlb fields of struct device to a
  helper function
- Rename __lookup_dyn_slot() to lookup_dyn_slot_locked()
- Introduce per-device flag if dynamic buffers are in use
- Add one more user of DMA_ATTR_MAY_SLEEP
- Add kernel-doc comments for new (and some old) code
- Properly escape '*' in dma-attributes.rst

Petr Tesarik (9):
  swiotlb: bail out of swiotlb_init_late() if swiotlb is already
    allocated
  swiotlb: make io_tlb_default_mem local to swiotlb.c
  swiotlb: add documentation and rename swiotlb_do_find_slots()
  swiotlb: separate memory pool data from other allocator data
  swiotlb: add a flag whether SWIOTLB is allowed to grow
  swiotlb: if swiotlb is full, fall back to a transient memory pool
  swiotlb: determine potential physical address limit
  swiotlb: allocate a new memory pool when existing pools are full
  swiotlb: search the software IO TLB only if the device makes use of it

 arch/arm/xen/mm.c           |  10 +-
 arch/mips/pci/pci-octeon.c  |   2 +-
 arch/x86/kernel/pci-dma.c   |  12 +-
 drivers/base/core.c         |   4 +-
 drivers/xen/swiotlb-xen.c   |   2 +-
 include/linux/device.h      |  10 +-
 include/linux/dma-mapping.h |   2 +
 include/linux/swiotlb.h     | 131 +++++--
 kernel/dma/Kconfig          |  13 +
 kernel/dma/direct.c         |   2 +-
 kernel/dma/swiotlb.c        | 683 ++++++++++++++++++++++++++++++++----
 mm/slab_common.c            |   5 +-
 12 files changed, 770 insertions(+), 106 deletions(-)

-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:07:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:07:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571052.893959 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzlp-0007SA-Lj; Thu, 27 Jul 2023 12:07:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571052.893959; Thu, 27 Jul 2023 12:07:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzlp-0007Rz-HW; Thu, 27 Jul 2023 12:07:05 +0000
Received: by outflank-mailman (input) for mailman id 571052;
 Thu, 27 Jul 2023 12:07:04 +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
 <SRS0=C0z/=DN=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qOzlo-00079h-Cg
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 12:07:04 +0000
Received: from frasgout13.his.huawei.com (unknown [14.137.139.46])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 17a2d36d-2c76-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 14:07:02 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.228])
 by frasgout13.his.huawei.com (SkyGuard) with ESMTP id 4RBTjl4nZ5z9xFHD
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 19:55:39 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.209.69])
 by APP2 (Coremail) with SMTP id GxC2BwBnGkGaXcJkfMYUBQ--.33878S3;
 Thu, 27 Jul 2023 13:06:23 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 17a2d36d-2c76-11ee-8613-37d641c3527e
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM),
	linux-mm@kvack.org (open list:SLAB ALLOCATOR)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v6 1/9] swiotlb: bail out of swiotlb_init_late() if swiotlb is already allocated
Date: Thu, 27 Jul 2023 14:05:29 +0200
Message-Id: <04fd8e9caf7acf45651e1bea3878f59f0b390b9e.1690459412.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
References: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2BwBnGkGaXcJkfMYUBQ--.33878S3
X-Coremail-Antispam: 1UD129KBjvJXoW7WFWxCFyrZr4rWFyUXry5urg_yoW8uFykp3
	43AFyvgF4jgas7ArW5C3WDZF1Yka1kK347urW5Wr13Jr15Jw45Kr1DKrWakrWrWFW8WF4S
	yFy8ZF1Fv3W2qw7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDU0xBIdaVrnRJUUUQq14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0
	rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_Jr4l82xGYIkIc2
	x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0
	Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UM2
	8EF7xvwVC2z280aVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4UJVWxJr1l
	e2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI
	8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwAC
	jcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7CjxVA2Y2ka0x
	kIwI1lc7CjxVAaw2AFwI0_Jw0_GFylc7CjxVAKzI0EY4vE52x082I5MxAIw28IcxkI7VAK
	I48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7
	xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWrXVW8Jr1lIxkGc2Ij64vIr41lIxAIcVC0
	I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UMIIF0xvE42
	xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF
	7I0E14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43ZEXa7VUjjNt3UUUUU==
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

If swiotlb is allocated, immediately return 0, so callers do not have to
check io_tlb_default_mem.nslabs explicitly.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 arch/arm/xen/mm.c         | 10 ++++------
 arch/x86/kernel/pci-dma.c | 12 ++++++------
 kernel/dma/swiotlb.c      |  3 +++
 3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c
index 3d826c0b5fee..882cd70c7a2f 100644
--- a/arch/arm/xen/mm.c
+++ b/arch/arm/xen/mm.c
@@ -125,12 +125,10 @@ static int __init xen_mm_init(void)
 		return 0;
 
 	/* we can work with the default swiotlb */
-	if (!io_tlb_default_mem.nslabs) {
-		rc = swiotlb_init_late(swiotlb_size_or_default(),
-				       xen_swiotlb_gfp(), NULL);
-		if (rc < 0)
-			return rc;
-	}
+	rc = swiotlb_init_late(swiotlb_size_or_default(),
+			       xen_swiotlb_gfp(), NULL);
+	if (rc < 0)
+		return rc;
 
 	cflush.op = 0;
 	cflush.a.dev_bus_addr = 0;
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index de6be0a3965e..08988b0a1c91 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -86,16 +86,16 @@ static void __init pci_xen_swiotlb_init(void)
 
 int pci_xen_swiotlb_init_late(void)
 {
+	int rc;
+
 	if (dma_ops == &xen_swiotlb_dma_ops)
 		return 0;
 
 	/* we can work with the default swiotlb */
-	if (!io_tlb_default_mem.nslabs) {
-		int rc = swiotlb_init_late(swiotlb_size_or_default(),
-					   GFP_KERNEL, xen_swiotlb_fixup);
-		if (rc < 0)
-			return rc;
-	}
+	rc = swiotlb_init_late(swiotlb_size_or_default(),
+			       GFP_KERNEL, xen_swiotlb_fixup);
+	if (rc < 0)
+		return rc;
 
 	/* XXX: this switches the dma ops under live devices! */
 	dma_ops = &xen_swiotlb_dma_ops;
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 2b83e3ad9dca..66fc8ec9ae45 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -384,6 +384,9 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 	bool retried = false;
 	int rc = 0;
 
+	if (io_tlb_default_mem.nslabs)
+		return 0;
+
 	if (swiotlb_force_disable)
 		return 0;
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:07:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:07:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571055.893969 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzm5-0007v5-Sl; Thu, 27 Jul 2023 12:07:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571055.893969; Thu, 27 Jul 2023 12:07:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzm5-0007uy-Pi; Thu, 27 Jul 2023 12:07:21 +0000
Received: by outflank-mailman (input) for mailman id 571055;
 Thu, 27 Jul 2023 12:07:20 +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
 <SRS0=C0z/=DN=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qOzm4-00079h-Ko
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 12:07:20 +0000
Received: from frasgout13.his.huawei.com (unknown [14.137.139.46])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 22533dea-2c76-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 14:07:19 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.228])
 by frasgout13.his.huawei.com (SkyGuard) with ESMTP id 4RBTk54tX4z9xFGX
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 19:55:57 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.209.69])
 by APP2 (Coremail) with SMTP id GxC2BwBnGkGaXcJkfMYUBQ--.33878S4;
 Thu, 27 Jul 2023 13:06:41 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 22533dea-2c76-11ee-8613-37d641c3527e
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM),
	linux-mm@kvack.org (open list:SLAB ALLOCATOR)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v6 2/9] swiotlb: make io_tlb_default_mem local to swiotlb.c
Date: Thu, 27 Jul 2023 14:05:30 +0200
Message-Id: <e97d4eca870c3eb2ca86e173e22c0d0b14485bbf.1690459412.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
References: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2BwBnGkGaXcJkfMYUBQ--.33878S4
X-Coremail-Antispam: 1UD129KBjvJXoW3Jr4DZw13KF1DAF48Zw13Arb_yoWxZry7pr
	yUAFyrGF42qrn7urW3Cw1kAF1Ygwn2kay7CryS9wn8Z3WDJwn5JFWDtrWYyr1rJrW8uF4f
	AFyvvryYkF47Aw7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDU0xBIdaVrnRJUUUQm14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0
	rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_Jryl82xGYIkIc2
	x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0
	Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw
	A2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr0_Cr1U
	M2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjx
	v20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1l
	F7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8cxan2
	IY04v7MxkF7I0En4kS14v26r1q6r43MxkF7I0Ew4C26cxK6c8Ij28IcwCF04k20xvY0x0E
	wIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E74
	80Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Wrv_Gr1UMIIYrxkI7VAKI48JMIIF0xvE
	2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1lIxAIcV
	CF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIE
	c7CjxVAFwI0_Gr1j6F4UJbIYCTnIWIevJa73UjIFyTuYvjfU1tCzDUUUU
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

SWIOTLB implementation details should not be exposed to the rest of the
kernel. This will allow to make changes to the implementation without
modifying non-swiotlb code.

To avoid breaking existing users, provide helper functions for the few
required fields.

As a bonus, using a helper function to initialize struct device allows to
get rid of an #ifdef in driver core.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 arch/mips/pci/pci-octeon.c |  2 +-
 drivers/base/core.c        |  4 +---
 drivers/xen/swiotlb-xen.c  |  2 +-
 include/linux/swiotlb.h    | 25 +++++++++++++++++++++++-
 kernel/dma/swiotlb.c       | 39 +++++++++++++++++++++++++++++++++++++-
 mm/slab_common.c           |  5 ++---
 6 files changed, 67 insertions(+), 10 deletions(-)

diff --git a/arch/mips/pci/pci-octeon.c b/arch/mips/pci/pci-octeon.c
index e457a18cbdc5..d19d9d456309 100644
--- a/arch/mips/pci/pci-octeon.c
+++ b/arch/mips/pci/pci-octeon.c
@@ -664,7 +664,7 @@ static int __init octeon_pci_setup(void)
 
 		/* BAR1 movable regions contiguous to cover the swiotlb */
 		octeon_bar1_pci_phys =
-			io_tlb_default_mem.start & ~((1ull << 22) - 1);
+			default_swiotlb_base() & ~((1ull << 22) - 1);
 
 		for (index = 0; index < 32; index++) {
 			union cvmx_pci_bar1_indexx bar1_index;
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 3dff5037943e..46d1d78c5beb 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -3108,9 +3108,7 @@ void device_initialize(struct device *dev)
     defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL)
 	dev->dma_coherent = dma_default_coherent;
 #endif
-#ifdef CONFIG_SWIOTLB
-	dev->dma_io_tlb_mem = &io_tlb_default_mem;
-#endif
+	swiotlb_dev_init(dev);
 }
 EXPORT_SYMBOL_GPL(device_initialize);
 
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index 67aa74d20162..946bd56f0ac5 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -381,7 +381,7 @@ xen_swiotlb_sync_sg_for_device(struct device *dev, struct scatterlist *sgl,
 static int
 xen_swiotlb_dma_supported(struct device *hwdev, u64 mask)
 {
-	return xen_phys_to_dma(hwdev, io_tlb_default_mem.end - 1) <= mask;
+	return xen_phys_to_dma(hwdev, default_swiotlb_limit()) <= mask;
 }
 
 const struct dma_map_ops xen_swiotlb_dma_ops = {
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 4e52cd5e0bdc..2d453b3e7771 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -110,7 +110,6 @@ struct io_tlb_mem {
 	atomic_long_t used_hiwater;
 #endif
 };
-extern struct io_tlb_mem io_tlb_default_mem;
 
 static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
 {
@@ -128,13 +127,22 @@ static inline bool is_swiotlb_force_bounce(struct device *dev)
 
 void swiotlb_init(bool addressing_limited, unsigned int flags);
 void __init swiotlb_exit(void);
+void swiotlb_dev_init(struct device *dev);
 size_t swiotlb_max_mapping_size(struct device *dev);
+bool is_swiotlb_allocated(void);
 bool is_swiotlb_active(struct device *dev);
 void __init swiotlb_adjust_size(unsigned long size);
+phys_addr_t default_swiotlb_base(void);
+phys_addr_t default_swiotlb_limit(void);
 #else
 static inline void swiotlb_init(bool addressing_limited, unsigned int flags)
 {
 }
+
+static inline void swiotlb_dev_init(struct device *dev)
+{
+}
+
 static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
 {
 	return false;
@@ -151,6 +159,11 @@ static inline size_t swiotlb_max_mapping_size(struct device *dev)
 	return SIZE_MAX;
 }
 
+static inline bool is_swiotlb_allocated(void)
+{
+	return false;
+}
+
 static inline bool is_swiotlb_active(struct device *dev)
 {
 	return false;
@@ -159,6 +172,16 @@ static inline bool is_swiotlb_active(struct device *dev)
 static inline void swiotlb_adjust_size(unsigned long size)
 {
 }
+
+static inline phys_addr_t default_swiotlb_base(void)
+{
+	return 0;
+}
+
+static inline phys_addr_t default_swiotlb_limit(void)
+{
+	return 0;
+}
 #endif /* CONFIG_SWIOTLB */
 
 extern void swiotlb_print_info(void);
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 66fc8ec9ae45..0b173303e088 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -71,7 +71,7 @@ struct io_tlb_slot {
 static bool swiotlb_force_bounce;
 static bool swiotlb_force_disable;
 
-struct io_tlb_mem io_tlb_default_mem;
+static struct io_tlb_mem io_tlb_default_mem;
 
 static unsigned long default_nslabs = IO_TLB_DEFAULT_SIZE >> IO_TLB_SHIFT;
 static unsigned long default_nareas;
@@ -489,6 +489,15 @@ void __init swiotlb_exit(void)
 	memset(mem, 0, sizeof(*mem));
 }
 
+/**
+ * swiotlb_dev_init() - initialize swiotlb fields in &struct device
+ * @dev:	Device to be initialized.
+ */
+void swiotlb_dev_init(struct device *dev)
+{
+	dev->dma_io_tlb_mem = &io_tlb_default_mem;
+}
+
 /*
  * Return the offset into a iotlb slot required to keep the device happy.
  */
@@ -953,6 +962,14 @@ size_t swiotlb_max_mapping_size(struct device *dev)
 	return ((size_t)IO_TLB_SIZE) * IO_TLB_SEGSIZE - min_align;
 }
 
+/**
+ * is_swiotlb_allocated() - check if the default software IO TLB is initialized
+ */
+bool is_swiotlb_allocated(void)
+{
+	return io_tlb_default_mem.nslabs;
+}
+
 bool is_swiotlb_active(struct device *dev)
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
@@ -961,6 +978,26 @@ bool is_swiotlb_active(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(is_swiotlb_active);
 
+/**
+ * default_swiotlb_base() - get the base address of the default SWIOTLB
+ *
+ * Get the lowest physical address used by the default software IO TLB pool.
+ */
+phys_addr_t default_swiotlb_base(void)
+{
+	return io_tlb_default_mem.start;
+}
+
+/**
+ * default_swiotlb_limit() - get the address limit of the default SWIOTLB
+ *
+ * Get the highest physical address used by the default software IO TLB pool.
+ */
+phys_addr_t default_swiotlb_limit(void)
+{
+	return io_tlb_default_mem.end - 1;
+}
+
 #ifdef CONFIG_DEBUG_FS
 
 static int io_tlb_used_get(void *data, u64 *val)
diff --git a/mm/slab_common.c b/mm/slab_common.c
index d1555ea2981a..c639dba9a3b7 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -864,10 +864,9 @@ void __init setup_kmalloc_cache_index_table(void)
 
 static unsigned int __kmalloc_minalign(void)
 {
-#ifdef CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC
-	if (io_tlb_default_mem.nslabs)
+	if (IS_ENABLED(CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC) &&
+	    is_swiotlb_allocated())
 		return ARCH_KMALLOC_MINALIGN;
-#endif
 	return dma_get_cache_alignment();
 }
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:07:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:07:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571057.893979 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzmQ-0008W6-9Z; Thu, 27 Jul 2023 12:07:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571057.893979; Thu, 27 Jul 2023 12:07:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzmQ-0008Vt-6G; Thu, 27 Jul 2023 12:07:42 +0000
Received: by outflank-mailman (input) for mailman id 571057;
 Thu, 27 Jul 2023 12:07:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C0z/=DN=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qOzmO-0007nh-AK
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 12:07:40 +0000
Received: from frasgout11.his.huawei.com (unknown [14.137.139.23])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2cdb9d17-2c76-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 14:07:37 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.229])
 by frasgout11.his.huawei.com (SkyGuard) with ESMTP id 4RBTkP0885z9v7gP
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 19:56:13 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.209.69])
 by APP2 (Coremail) with SMTP id GxC2BwBnGkGaXcJkfMYUBQ--.33878S5;
 Thu, 27 Jul 2023 13:06:59 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2cdb9d17-2c76-11ee-b247-6b7b168915f2
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM),
	linux-mm@kvack.org (open list:SLAB ALLOCATOR)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v6 3/9] swiotlb: add documentation and rename swiotlb_do_find_slots()
Date: Thu, 27 Jul 2023 14:05:31 +0200
Message-Id: <2398ad9c61fd686d99d4d7077d8755e19e54b6eb.1690459412.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
References: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2BwBnGkGaXcJkfMYUBQ--.33878S5
X-Coremail-Antispam: 1UD129KBjvJXoW3GrWfGF4UuFy8tF1xZF1kKrg_yoW7ur4rpF
	4rt3Z8tFs8Jr1xC39Fkw48uF1S9w4kK347uFWavryF9rnrJr9agFyktrW5XFyrJFW8uF4U
	Ja4avr48Gr43Xr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDU0xBIdaVrnRJUUUQm14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0
	rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JrWl82xGYIkIc2
	x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0
	Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw
	A2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr0_Cr1U
	M2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjx
	v20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1l
	F7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8cxan2
	IY04v7MxkF7I0En4kS14v26r1q6r43MxkF7I0Ew4C26cxK6c8Ij28IcwCF04k20xvY0x0E
	wIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E74
	80Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Wrv_Gr1UMIIYrxkI7VAKI48JMIIF0xvE
	2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1lIxAIcV
	CF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIE
	c7CjxVAFwI0_Gr1j6F4UJbIYCTnIWIevJa73UjIFyTuYvjfU8YFADUUUU
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

Add some kernel-doc comments and move the existing documentation of struct
io_tlb_slot to its correct location. The latter was forgotten in commit
942a8186eb445 ("swiotlb: move struct io_tlb_slot to swiotlb.c").

Use the opportunity to give swiotlb_do_find_slots() a more descriptive name
and make it clear how it differs from swiotlb_find_slots().

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/swiotlb.h | 15 +++++++---
 kernel/dma/swiotlb.c    | 61 +++++++++++++++++++++++++++++++++++++----
 2 files changed, 66 insertions(+), 10 deletions(-)

diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 2d453b3e7771..31625ae507ea 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -76,10 +76,6 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t phys,
  * @nslabs:	The number of IO TLB blocks (in groups of 64) between @start and
  *		@end. For default swiotlb, this is command line adjustable via
  *		setup_io_tlb_npages.
- * @list:	The free list describing the number of free entries available
- *		from each index.
- * @orig_addr:	The original address corresponding to a mapped entry.
- * @alloc_size:	Size of the allocated buffer.
  * @debugfs:	The dentry to debugfs.
  * @late_alloc:	%true if allocated using the page allocator
  * @force_bounce: %true if swiotlb bouncing is forced
@@ -111,6 +107,17 @@ struct io_tlb_mem {
 #endif
 };
 
+/**
+ * is_swiotlb_buffer() - check if a physical address belongs to a swiotlb
+ * @dev:        Device which has mapped the buffer.
+ * @paddr:      Physical address within the DMA buffer.
+ *
+ * Check if @paddr points into a bounce buffer.
+ *
+ * Return:
+ * * %true if @paddr points into a bounce buffer
+ * * %false otherwise
+ */
 static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 0b173303e088..ef5d5e41a17f 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -62,6 +62,13 @@
 
 #define INVALID_PHYS_ADDR (~(phys_addr_t)0)
 
+/**
+ * struct io_tlb_slot - IO TLB slot descriptor
+ * @orig_addr:	The original address corresponding to a mapped entry.
+ * @alloc_size:	Size of the allocated buffer.
+ * @list:	The free list describing the number of free entries available
+ *		from each index.
+ */
 struct io_tlb_slot {
 	phys_addr_t orig_addr;
 	size_t alloc_size;
@@ -635,11 +642,22 @@ static void dec_used(struct io_tlb_mem *mem, unsigned int nslots)
 }
 #endif /* CONFIG_DEBUG_FS */
 
-/*
- * Find a suitable number of IO TLB entries size that will fit this request and
- * allocate a buffer from that IO TLB pool.
+/**
+ * swiotlb_area_find_slots() - search for slots in one IO TLB memory area
+ * @dev:	Device which maps the buffer.
+ * @area_index:	Index of the IO TLB memory area to be searched.
+ * @orig_addr:	Original (non-bounced) IO buffer address.
+ * @alloc_size: Total requested size of the bounce buffer,
+ *		including initial alignment padding.
+ * @alloc_align_mask:	Required alignment of the allocated buffer.
+ *
+ * Find a suitable sequence of IO TLB entries for the request and allocate
+ * a buffer from the given IO TLB memory area.
+ * This function takes care of locking.
+ *
+ * Return: Index of the first allocated slot, or -1 on error.
  */
-static int swiotlb_do_find_slots(struct device *dev, int area_index,
+static int swiotlb_area_find_slots(struct device *dev, int area_index,
 		phys_addr_t orig_addr, size_t alloc_size,
 		unsigned int alloc_align_mask)
 {
@@ -734,6 +752,19 @@ static int swiotlb_do_find_slots(struct device *dev, int area_index,
 	return slot_index;
 }
 
+/**
+ * swiotlb_find_slots() - search for slots in the whole swiotlb
+ * @dev:	Device which maps the buffer.
+ * @orig_addr:	Original (non-bounced) IO buffer address.
+ * @alloc_size: Total requested size of the bounce buffer,
+ *		including initial alignment padding.
+ * @alloc_align_mask:	Required alignment of the allocated buffer.
+ *
+ * Search through the whole software IO TLB to find a sequence of slots that
+ * match the allocation constraints.
+ *
+ * Return: Index of the first allocated slot, or -1 on error.
+ */
 static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
 		size_t alloc_size, unsigned int alloc_align_mask)
 {
@@ -742,8 +773,8 @@ static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
 	int i = start, index;
 
 	do {
-		index = swiotlb_do_find_slots(dev, i, orig_addr, alloc_size,
-					      alloc_align_mask);
+		index = swiotlb_area_find_slots(dev, i, orig_addr, alloc_size,
+						alloc_align_mask);
 		if (index >= 0)
 			return index;
 		if (++i >= mem->nareas)
@@ -755,6 +786,15 @@ static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
 
 #ifdef CONFIG_DEBUG_FS
 
+/**
+ * mem_used() - get number of used slots in an allocator
+ * @mem:	Software IO TLB allocator.
+ *
+ * The result is accurate in this version of the function, because an atomic
+ * counter is available if CONFIG_DEBUG_FS is set.
+ *
+ * Return: Number of used slots.
+ */
 static unsigned long mem_used(struct io_tlb_mem *mem)
 {
 	return atomic_long_read(&mem->total_used);
@@ -762,6 +802,15 @@ static unsigned long mem_used(struct io_tlb_mem *mem)
 
 #else /* !CONFIG_DEBUG_FS */
 
+/**
+ * mem_used() - get number of used slots in an allocator
+ * @mem:	Software IO TLB allocator.
+ *
+ * The result is not accurate, because there is no locking of individual
+ * areas.
+ *
+ * Return: Approximate number of used slots.
+ */
 static unsigned long mem_used(struct io_tlb_mem *mem)
 {
 	int i;
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:07:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:07:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571060.893988 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzmf-0000ge-HI; Thu, 27 Jul 2023 12:07:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571060.893988; Thu, 27 Jul 2023 12:07:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzmf-0000gR-EB; Thu, 27 Jul 2023 12:07:57 +0000
Received: by outflank-mailman (input) for mailman id 571060;
 Thu, 27 Jul 2023 12:07:56 +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
 <SRS0=C0z/=DN=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qOzme-00079h-KP
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 12:07:56 +0000
Received: from frasgout12.his.huawei.com
 (ecs-14-137-139-154.compute.hwclouds-dns.com [14.137.139.154])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 37855e0a-2c76-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 14:07:54 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.227])
 by frasgout12.his.huawei.com (SkyGuard) with ESMTP id 4RBThW2ymrz9yDrh
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 19:54:35 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.209.69])
 by APP2 (Coremail) with SMTP id GxC2BwBnGkGaXcJkfMYUBQ--.33878S6;
 Thu, 27 Jul 2023 13:07:17 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 37855e0a-2c76-11ee-8613-37d641c3527e
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM),
	linux-mm@kvack.org (open list:SLAB ALLOCATOR)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v6 4/9] swiotlb: separate memory pool data from other allocator data
Date: Thu, 27 Jul 2023 14:05:32 +0200
Message-Id: <df03c5688d7ba59dca1c08e5a76a08f6b77cddae.1690459412.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
References: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2BwBnGkGaXcJkfMYUBQ--.33878S6
X-Coremail-Antispam: 1UD129KBjvAXoWfCF4rZw4DCr18Wr1xWF1kGrg_yoW8Zw15Ao
	W7GFnrWw4fJryjkFW7Aan3Jr47uayqka1rAF1rZay5Xayjyr4Ygw1fta15Xw13Wr1fGFWx
	AwnxWa48WF4kAr18n29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7v73VFW2AGmfu7bjvjm3
	AaLaJ3UjIYCTnIWjp_UUUOl7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20EY4v20xva
	j40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r126s0DM28Irc
	Ia0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l
	84ACjcxK6xIIjxv20xvE14v26r1I6r4UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4UJV
	WxJr1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr1j
	6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7V
	C0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j
	6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x0262
	8vn2kIc2xKxwCY1x0262kKe7AKxVWUtVW8ZwCY1x0264kExVAvwVAq07x20xyl42xK82IY
	c2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s
	026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26rWY6r4UJwCIc40Y0x0EwIxGrwCI
	42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UMI
	IF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E
	87Iv6xkF7I0E14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43ZEXa7VUUMKZtUUUUU==
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

Carve out memory pool specific fields from struct io_tlb_mem. The original
struct now contains shared data for the whole allocator, while the new
struct io_tlb_pool contains data that is specific to one memory pool of
(potentially) many.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/device.h  |   2 +-
 include/linux/swiotlb.h |  45 +++++++----
 kernel/dma/swiotlb.c    | 175 +++++++++++++++++++++++++---------------
 3 files changed, 140 insertions(+), 82 deletions(-)

diff --git a/include/linux/device.h b/include/linux/device.h
index bbaeabd04b0d..d9754a68ba95 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -625,7 +625,7 @@ struct device_physical_location {
  * @dma_pools:	Dma pools (if dma'ble device).
  * @dma_mem:	Internal for coherent mem override.
  * @cma_area:	Contiguous memory area for dma allocations
- * @dma_io_tlb_mem: Pointer to the swiotlb pool used.  Not for driver use.
+ * @dma_io_tlb_mem: Software IO TLB allocator.  Not for driver use.
  * @archdata:	For arch-specific additions.
  * @of_node:	Associated device tree node.
  * @fwnode:	Associated device node supplied by platform firmware.
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 31625ae507ea..247f0ab8795a 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -62,8 +62,7 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t phys,
 #ifdef CONFIG_SWIOTLB
 
 /**
- * struct io_tlb_mem - IO TLB Memory Pool Descriptor
- *
+ * struct io_tlb_pool - IO TLB memory pool descriptor
  * @start:	The start address of the swiotlb memory pool. Used to do a quick
  *		range check to see if the memory was in fact allocated by this
  *		API.
@@ -73,15 +72,34 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t phys,
  * @vaddr:	The vaddr of the swiotlb memory pool. The swiotlb memory pool
  *		may be remapped in the memory encrypted case and store virtual
  *		address for bounce buffer operation.
- * @nslabs:	The number of IO TLB blocks (in groups of 64) between @start and
- *		@end. For default swiotlb, this is command line adjustable via
- *		setup_io_tlb_npages.
+ * @nslabs:	The number of IO TLB slots between @start and @end. For the
+ *		default swiotlb, this can be adjusted with a boot parameter,
+ *		see setup_io_tlb_npages().
+ * @late_alloc:	%true if allocated using the page allocator.
+ * @nareas:	Number of areas in the pool.
+ * @area_nslabs: Number of slots in each area.
+ * @areas:	Array of memory area descriptors.
+ * @slots:	Array of slot descriptors.
+ */
+struct io_tlb_pool {
+	phys_addr_t start;
+	phys_addr_t end;
+	void *vaddr;
+	unsigned long nslabs;
+	bool late_alloc;
+	unsigned int nareas;
+	unsigned int area_nslabs;
+	struct io_tlb_area *areas;
+	struct io_tlb_slot *slots;
+};
+
+/**
+ * struct io_tlb_mem - Software IO TLB allocator
+ * @defpool:	Default (initial) IO TLB memory pool descriptor.
+ * @nslabs:	Total number of IO TLB slabs in all pools.
  * @debugfs:	The dentry to debugfs.
- * @late_alloc:	%true if allocated using the page allocator
  * @force_bounce: %true if swiotlb bouncing is forced
  * @for_alloc:  %true if the pool is used for memory allocation
- * @nareas:  The area number in the pool.
- * @area_nslabs: The slot number in the area.
  * @total_used:	The total number of slots in the pool that are currently used
  *		across all areas. Used only for calculating used_hiwater in
  *		debugfs.
@@ -89,18 +107,11 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t phys,
  *		in debugfs.
  */
 struct io_tlb_mem {
-	phys_addr_t start;
-	phys_addr_t end;
-	void *vaddr;
+	struct io_tlb_pool defpool;
 	unsigned long nslabs;
 	struct dentry *debugfs;
-	bool late_alloc;
 	bool force_bounce;
 	bool for_alloc;
-	unsigned int nareas;
-	unsigned int area_nslabs;
-	struct io_tlb_area *areas;
-	struct io_tlb_slot *slots;
 #ifdef CONFIG_DEBUG_FS
 	atomic_long_t total_used;
 	atomic_long_t used_hiwater;
@@ -122,7 +133,7 @@ static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
 
-	return mem && paddr >= mem->start && paddr < mem->end;
+	return mem && paddr >= mem->defpool.start && paddr < mem->defpool.end;
 }
 
 static inline bool is_swiotlb_force_bounce(struct device *dev)
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index ef5d5e41a17f..616113760b60 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -209,7 +209,7 @@ void __init swiotlb_adjust_size(unsigned long size)
 
 void swiotlb_print_info(void)
 {
-	struct io_tlb_mem *mem = &io_tlb_default_mem;
+	struct io_tlb_pool *mem = &io_tlb_default_mem.defpool;
 
 	if (!mem->nslabs) {
 		pr_warn("No low mem\n");
@@ -238,7 +238,7 @@ static inline unsigned long nr_slots(u64 val)
  */
 void __init swiotlb_update_mem_attributes(void)
 {
-	struct io_tlb_mem *mem = &io_tlb_default_mem;
+	struct io_tlb_pool *mem = &io_tlb_default_mem.defpool;
 	unsigned long bytes;
 
 	if (!mem->nslabs || mem->late_alloc)
@@ -247,9 +247,8 @@ void __init swiotlb_update_mem_attributes(void)
 	set_memory_decrypted((unsigned long)mem->vaddr, bytes >> PAGE_SHIFT);
 }
 
-static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,
-		unsigned long nslabs, unsigned int flags,
-		bool late_alloc, unsigned int nareas)
+static void swiotlb_init_io_tlb_pool(struct io_tlb_pool *mem, phys_addr_t start,
+		unsigned long nslabs, bool late_alloc, unsigned int nareas)
 {
 	void *vaddr = phys_to_virt(start);
 	unsigned long bytes = nslabs << IO_TLB_SHIFT, i;
@@ -261,8 +260,6 @@ static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,
 	mem->nareas = nareas;
 	mem->area_nslabs = nslabs / mem->nareas;
 
-	mem->force_bounce = swiotlb_force_bounce || (flags & SWIOTLB_FORCE);
-
 	for (i = 0; i < mem->nareas; i++) {
 		spin_lock_init(&mem->areas[i].lock);
 		mem->areas[i].index = 0;
@@ -319,7 +316,7 @@ static void __init *swiotlb_memblock_alloc(unsigned long nslabs,
 void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 		int (*remap)(void *tlb, unsigned long nslabs))
 {
-	struct io_tlb_mem *mem = &io_tlb_default_mem;
+	struct io_tlb_pool *mem = &io_tlb_default_mem.defpool;
 	unsigned long nslabs;
 	unsigned int nareas;
 	size_t alloc_size;
@@ -330,6 +327,9 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 	if (swiotlb_force_disable)
 		return;
 
+	io_tlb_default_mem.force_bounce =
+		swiotlb_force_bounce || (flags & SWIOTLB_FORCE);
+
 	if (!default_nareas)
 		swiotlb_adjust_nareas(num_possible_cpus());
 
@@ -363,8 +363,9 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 		return;
 	}
 
-	swiotlb_init_io_tlb_mem(mem, __pa(tlb), nslabs, flags, false,
-				default_nareas);
+	swiotlb_init_io_tlb_pool(mem, __pa(tlb), nslabs, false,
+				 default_nareas);
+	io_tlb_default_mem.nslabs = nslabs;
 
 	if (flags & SWIOTLB_VERBOSE)
 		swiotlb_print_info();
@@ -383,7 +384,7 @@ void __init swiotlb_init(bool addressing_limit, unsigned int flags)
 int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 		int (*remap)(void *tlb, unsigned long nslabs))
 {
-	struct io_tlb_mem *mem = &io_tlb_default_mem;
+	struct io_tlb_pool *mem = &io_tlb_default_mem.defpool;
 	unsigned long nslabs = ALIGN(size >> IO_TLB_SHIFT, IO_TLB_SEGSIZE);
 	unsigned int nareas;
 	unsigned char *vstart = NULL;
@@ -397,6 +398,8 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 	if (swiotlb_force_disable)
 		return 0;
 
+	io_tlb_default_mem.force_bounce = swiotlb_force_bounce;
+
 	if (!default_nareas)
 		swiotlb_adjust_nareas(num_possible_cpus());
 
@@ -448,8 +451,9 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 
 	set_memory_decrypted((unsigned long)vstart,
 			     (nslabs << IO_TLB_SHIFT) >> PAGE_SHIFT);
-	swiotlb_init_io_tlb_mem(mem, virt_to_phys(vstart), nslabs, 0, true,
-				nareas);
+	swiotlb_init_io_tlb_pool(mem, virt_to_phys(vstart), nslabs, true,
+				 nareas);
+	io_tlb_default_mem.nslabs = nslabs;
 
 	swiotlb_print_info();
 	return 0;
@@ -463,7 +467,7 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 
 void __init swiotlb_exit(void)
 {
-	struct io_tlb_mem *mem = &io_tlb_default_mem;
+	struct io_tlb_pool *mem = &io_tlb_default_mem.defpool;
 	unsigned long tbl_vaddr;
 	size_t tbl_size, slots_size;
 	unsigned int area_order;
@@ -519,7 +523,7 @@ static unsigned int swiotlb_align_offset(struct device *dev, u64 addr)
 static void swiotlb_bounce(struct device *dev, phys_addr_t tlb_addr, size_t size,
 			   enum dma_data_direction dir)
 {
-	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
+	struct io_tlb_pool *mem = &dev->dma_io_tlb_mem->defpool;
 	int index = (tlb_addr - mem->start) >> IO_TLB_SHIFT;
 	phys_addr_t orig_addr = mem->slots[index].orig_addr;
 	size_t alloc_size = mem->slots[index].alloc_size;
@@ -601,7 +605,7 @@ static inline unsigned long get_max_slots(unsigned long boundary_mask)
 	return nr_slots(boundary_mask + 1);
 }
 
-static unsigned int wrap_area_index(struct io_tlb_mem *mem, unsigned int index)
+static unsigned int wrap_area_index(struct io_tlb_pool *mem, unsigned int index)
 {
 	if (index >= mem->area_nslabs)
 		return 0;
@@ -645,6 +649,7 @@ static void dec_used(struct io_tlb_mem *mem, unsigned int nslots)
 /**
  * swiotlb_area_find_slots() - search for slots in one IO TLB memory area
  * @dev:	Device which maps the buffer.
+ * @pool:	Memory pool to be searched.
  * @area_index:	Index of the IO TLB memory area to be searched.
  * @orig_addr:	Original (non-bounced) IO buffer address.
  * @alloc_size: Total requested size of the bounce buffer,
@@ -657,15 +662,14 @@ static void dec_used(struct io_tlb_mem *mem, unsigned int nslots)
  *
  * Return: Index of the first allocated slot, or -1 on error.
  */
-static int swiotlb_area_find_slots(struct device *dev, int area_index,
-		phys_addr_t orig_addr, size_t alloc_size,
+static int swiotlb_area_find_slots(struct device *dev, struct io_tlb_pool *pool,
+		int area_index, phys_addr_t orig_addr, size_t alloc_size,
 		unsigned int alloc_align_mask)
 {
-	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
-	struct io_tlb_area *area = mem->areas + area_index;
+	struct io_tlb_area *area = pool->areas + area_index;
 	unsigned long boundary_mask = dma_get_seg_boundary(dev);
 	dma_addr_t tbl_dma_addr =
-		phys_to_dma_unencrypted(dev, mem->start) & boundary_mask;
+		phys_to_dma_unencrypted(dev, pool->start) & boundary_mask;
 	unsigned long max_slots = get_max_slots(boundary_mask);
 	unsigned int iotlb_align_mask =
 		dma_get_min_align_mask(dev) | alloc_align_mask;
@@ -677,7 +681,7 @@ static int swiotlb_area_find_slots(struct device *dev, int area_index,
 	unsigned int slot_index;
 
 	BUG_ON(!nslots);
-	BUG_ON(area_index >= mem->nareas);
+	BUG_ON(area_index >= pool->nareas);
 
 	/*
 	 * For allocations of PAGE_SIZE or larger only look for page aligned
@@ -694,19 +698,19 @@ static int swiotlb_area_find_slots(struct device *dev, int area_index,
 	stride = (iotlb_align_mask >> IO_TLB_SHIFT) + 1;
 
 	spin_lock_irqsave(&area->lock, flags);
-	if (unlikely(nslots > mem->area_nslabs - area->used))
+	if (unlikely(nslots > pool->area_nslabs - area->used))
 		goto not_found;
 
-	slot_base = area_index * mem->area_nslabs;
+	slot_base = area_index * pool->area_nslabs;
 	index = area->index;
 
-	for (slots_checked = 0; slots_checked < mem->area_nslabs; ) {
+	for (slots_checked = 0; slots_checked < pool->area_nslabs; ) {
 		slot_index = slot_base + index;
 
 		if (orig_addr &&
 		    (slot_addr(tbl_dma_addr, slot_index) &
 		     iotlb_align_mask) != (orig_addr & iotlb_align_mask)) {
-			index = wrap_area_index(mem, index + 1);
+			index = wrap_area_index(pool, index + 1);
 			slots_checked++;
 			continue;
 		}
@@ -719,10 +723,10 @@ static int swiotlb_area_find_slots(struct device *dev, int area_index,
 		if (!iommu_is_span_boundary(slot_index, nslots,
 					    nr_slots(tbl_dma_addr),
 					    max_slots)) {
-			if (mem->slots[slot_index].list >= nslots)
+			if (pool->slots[slot_index].list >= nslots)
 				goto found;
 		}
-		index = wrap_area_index(mem, index + stride);
+		index = wrap_area_index(pool, index + stride);
 		slots_checked += stride;
 	}
 
@@ -732,58 +736,79 @@ static int swiotlb_area_find_slots(struct device *dev, int area_index,
 
 found:
 	for (i = slot_index; i < slot_index + nslots; i++) {
-		mem->slots[i].list = 0;
-		mem->slots[i].alloc_size = alloc_size - (offset +
+		pool->slots[i].list = 0;
+		pool->slots[i].alloc_size = alloc_size - (offset +
 				((i - slot_index) << IO_TLB_SHIFT));
 	}
 	for (i = slot_index - 1;
 	     io_tlb_offset(i) != IO_TLB_SEGSIZE - 1 &&
-	     mem->slots[i].list; i--)
-		mem->slots[i].list = ++count;
+	     pool->slots[i].list; i--)
+		pool->slots[i].list = ++count;
 
 	/*
 	 * Update the indices to avoid searching in the next round.
 	 */
-	area->index = wrap_area_index(mem, index + nslots);
+	area->index = wrap_area_index(pool, index + nslots);
 	area->used += nslots;
 	spin_unlock_irqrestore(&area->lock, flags);
 
-	inc_used_and_hiwater(mem, nslots);
+	inc_used_and_hiwater(dev->dma_io_tlb_mem, nslots);
 	return slot_index;
 }
 
 /**
- * swiotlb_find_slots() - search for slots in the whole swiotlb
+ * swiotlb_pool_find_slots() - search for slots in one memory pool
  * @dev:	Device which maps the buffer.
+ * @pool:	Memory pool to be searched.
  * @orig_addr:	Original (non-bounced) IO buffer address.
  * @alloc_size: Total requested size of the bounce buffer,
  *		including initial alignment padding.
  * @alloc_align_mask:	Required alignment of the allocated buffer.
  *
- * Search through the whole software IO TLB to find a sequence of slots that
- * match the allocation constraints.
+ * Search through one memory pool to find a sequence of slots that match the
+ * allocation constraints.
  *
  * Return: Index of the first allocated slot, or -1 on error.
  */
-static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
-		size_t alloc_size, unsigned int alloc_align_mask)
+static int swiotlb_pool_find_slots(struct device *dev, struct io_tlb_pool *pool,
+		phys_addr_t orig_addr, size_t alloc_size,
+		unsigned int alloc_align_mask)
 {
-	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
-	int start = raw_smp_processor_id() & (mem->nareas - 1);
+	int start = raw_smp_processor_id() & (pool->nareas - 1);
 	int i = start, index;
 
 	do {
-		index = swiotlb_area_find_slots(dev, i, orig_addr, alloc_size,
-						alloc_align_mask);
+		index = swiotlb_area_find_slots(dev, pool, i, orig_addr,
+						alloc_size, alloc_align_mask);
 		if (index >= 0)
 			return index;
-		if (++i >= mem->nareas)
+		if (++i >= pool->nareas)
 			i = 0;
 	} while (i != start);
 
 	return -1;
 }
 
+/**
+ * swiotlb_find_slots() - search for slots in the whole swiotlb
+ * @dev:	Device which maps the buffer.
+ * @orig_addr:	Original (non-bounced) IO buffer address.
+ * @alloc_size: Total requested size of the bounce buffer,
+ *		including initial alignment padding.
+ * @alloc_align_mask:	Required alignment of the allocated buffer.
+ *
+ * Search through the whole software IO TLB to find a sequence of slots that
+ * match the allocation constraints.
+ *
+ * Return: Index of the first allocated slot, or -1 on error.
+ */
+static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
+		size_t alloc_size, unsigned int alloc_align_mask)
+{
+	return swiotlb_pool_find_slots(dev, &dev->dma_io_tlb_mem->defpool,
+				       orig_addr, alloc_size, alloc_align_mask);
+}
+
 #ifdef CONFIG_DEBUG_FS
 
 /**
@@ -802,6 +827,24 @@ static unsigned long mem_used(struct io_tlb_mem *mem)
 
 #else /* !CONFIG_DEBUG_FS */
 
+/**
+ * mem_pool_used() - get number of used slots in a memory pool
+ * @pool:	Software IO TLB memory pool.
+ *
+ * The result is not accurate, see mem_used().
+ *
+ * Return: Approximate number of used slots.
+ */
+static unsigned long mem_pool_used(struct io_tlb_pool *pool)
+{
+	int i;
+	unsigned long used = 0;
+
+	for (i = 0; i < pool->nareas; i++)
+		used += pool->areas[i].used;
+	return used;
+}
+
 /**
  * mem_used() - get number of used slots in an allocator
  * @mem:	Software IO TLB allocator.
@@ -813,12 +856,7 @@ static unsigned long mem_used(struct io_tlb_mem *mem)
  */
 static unsigned long mem_used(struct io_tlb_mem *mem)
 {
-	int i;
-	unsigned long used = 0;
-
-	for (i = 0; i < mem->nareas; i++)
-		used += mem->areas[i].used;
-	return used;
+	return mem_pool_used(&mem->defpool);
 }
 
 #endif /* CONFIG_DEBUG_FS */
@@ -830,6 +868,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
 	unsigned int offset = swiotlb_align_offset(dev, orig_addr);
+	struct io_tlb_pool *pool;
 	unsigned int i;
 	int index;
 	phys_addr_t tlb_addr;
@@ -864,9 +903,10 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
 	 * This is needed when we sync the memory.  Then we sync the buffer if
 	 * needed.
 	 */
+	pool = &mem->defpool;
 	for (i = 0; i < nr_slots(alloc_size + offset); i++)
-		mem->slots[index + i].orig_addr = slot_addr(orig_addr, i);
-	tlb_addr = slot_addr(mem->start, index) + offset;
+		pool->slots[index + i].orig_addr = slot_addr(orig_addr, i);
+	tlb_addr = slot_addr(pool->start, index) + offset;
 	/*
 	 * When dir == DMA_FROM_DEVICE we could omit the copy from the orig
 	 * to the tlb buffer, if we knew for sure the device will
@@ -880,7 +920,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
 
 static void swiotlb_release_slots(struct device *dev, phys_addr_t tlb_addr)
 {
-	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
+	struct io_tlb_pool *mem = &dev->dma_io_tlb_mem->defpool;
 	unsigned long flags;
 	unsigned int offset = swiotlb_align_offset(dev, tlb_addr);
 	int index = (tlb_addr - offset - mem->start) >> IO_TLB_SHIFT;
@@ -924,7 +964,7 @@ static void swiotlb_release_slots(struct device *dev, phys_addr_t tlb_addr)
 	area->used -= nslots;
 	spin_unlock_irqrestore(&area->lock, flags);
 
-	dec_used(mem, nslots);
+	dec_used(dev->dma_io_tlb_mem, nslots);
 }
 
 /*
@@ -1034,7 +1074,7 @@ EXPORT_SYMBOL_GPL(is_swiotlb_active);
  */
 phys_addr_t default_swiotlb_base(void)
 {
-	return io_tlb_default_mem.start;
+	return io_tlb_default_mem.defpool.start;
 }
 
 /**
@@ -1044,7 +1084,7 @@ phys_addr_t default_swiotlb_base(void)
  */
 phys_addr_t default_swiotlb_limit(void)
 {
-	return io_tlb_default_mem.end - 1;
+	return io_tlb_default_mem.defpool.end - 1;
 }
 
 #ifdef CONFIG_DEBUG_FS
@@ -1120,6 +1160,7 @@ static inline void swiotlb_create_debugfs_files(struct io_tlb_mem *mem,
 struct page *swiotlb_alloc(struct device *dev, size_t size)
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
+	struct io_tlb_pool *pool;
 	phys_addr_t tlb_addr;
 	int index;
 
@@ -1130,7 +1171,8 @@ struct page *swiotlb_alloc(struct device *dev, size_t size)
 	if (index == -1)
 		return NULL;
 
-	tlb_addr = slot_addr(mem->start, index);
+	pool = &mem->defpool;
+	tlb_addr = slot_addr(pool->start, index);
 
 	return pfn_to_page(PFN_DOWN(tlb_addr));
 }
@@ -1167,29 +1209,34 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem,
 	 * to it.
 	 */
 	if (!mem) {
+		struct io_tlb_pool *pool;
+
 		mem = kzalloc(sizeof(*mem), GFP_KERNEL);
 		if (!mem)
 			return -ENOMEM;
+		pool = &mem->defpool;
 
-		mem->slots = kcalloc(nslabs, sizeof(*mem->slots), GFP_KERNEL);
-		if (!mem->slots) {
+		pool->slots = kcalloc(nslabs, sizeof(*pool->slots), GFP_KERNEL);
+		if (!pool->slots) {
 			kfree(mem);
 			return -ENOMEM;
 		}
 
-		mem->areas = kcalloc(nareas, sizeof(*mem->areas),
+		pool->areas = kcalloc(nareas, sizeof(*pool->areas),
 				GFP_KERNEL);
-		if (!mem->areas) {
-			kfree(mem->slots);
+		if (!pool->areas) {
+			kfree(pool->slots);
 			kfree(mem);
 			return -ENOMEM;
 		}
 
 		set_memory_decrypted((unsigned long)phys_to_virt(rmem->base),
 				     rmem->size >> PAGE_SHIFT);
-		swiotlb_init_io_tlb_mem(mem, rmem->base, nslabs, SWIOTLB_FORCE,
-					false, nareas);
+		swiotlb_init_io_tlb_pool(pool, rmem->base, nslabs,
+					 false, nareas);
+		mem->force_bounce = true;
 		mem->for_alloc = true;
+		mem->nslabs = nslabs;
 
 		rmem->priv = mem;
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:08:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:08:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571062.893999 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzmw-0001DR-Tc; Thu, 27 Jul 2023 12:08:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571062.893999; Thu, 27 Jul 2023 12:08:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzmw-0001DI-Q3; Thu, 27 Jul 2023 12:08:14 +0000
Received: by outflank-mailman (input) for mailman id 571062;
 Thu, 27 Jul 2023 12:08:13 +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
 <SRS0=C0z/=DN=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qOzmv-00079h-RE
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 12:08:13 +0000
Received: from frasgout13.his.huawei.com (unknown [14.137.139.46])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 421f00d7-2c76-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 14:08:12 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.229])
 by frasgout13.his.huawei.com (SkyGuard) with ESMTP id 4RBTl64ydFz9xFH9
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 19:56:50 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.209.69])
 by APP2 (Coremail) with SMTP id GxC2BwBnGkGaXcJkfMYUBQ--.33878S7;
 Thu, 27 Jul 2023 13:07:34 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 421f00d7-2c76-11ee-8613-37d641c3527e
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM),
	linux-mm@kvack.org (open list:SLAB ALLOCATOR)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v6 5/9] swiotlb: add a flag whether SWIOTLB is allowed to grow
Date: Thu, 27 Jul 2023 14:05:33 +0200
Message-Id: <3ddf2f1af1d3dae79672670bd6a2d76630195015.1690459412.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
References: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2BwBnGkGaXcJkfMYUBQ--.33878S7
X-Coremail-Antispam: 1UD129KBjvJXoWxWrW8XF1fKr1fZr13Wr4UArb_yoWrWryUpF
	15XF4rtF4IqF1xArZ7Cw1xGF9akw4kKrW3urWa9ry5Ar15Jw1Yq3WDKayYq34Fqrs2qF4a
	qFyS9F1Ykr17ZwUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDU0xBIdaVrnRJUUUQC14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0
	rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYI
	kIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2
	z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F
	4UJwA2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr0_
	Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6x
	IIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_
	Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8c
	xan2IY04v7MxkF7I0En4kS14v26r1q6r43MxkF7I0Ew4C26cxK6c8Ij28IcwCF04k20xvY
	0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I
	0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Wrv_Gr1UMIIYrxkI7VAKI48JMIIF
	0xvE2Ix0cI8IcVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1lIx
	AIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2
	jsIEc7CjxVAFwI0_Gr1j6F4UJbIYCTnIWIevJa73UjIFyTuYvjfU1pBTDUUUU
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

Add a config option (CONFIG_SWIOTLB_DYNAMIC) to enable or disable dynamic
allocation of additional bounce buffers.

If this option is set, mark the default SWIOTLB as able to grow and
restricted DMA pools as unable.

However, if the address of the default memory pool is explicitly queried,
make the default SWIOTLB also unable to grow. This is currently used to set
up PCI BAR movable regions on some Octeon MIPS boards which may not be able
to use a SWIOTLB pool elsewhere in physical memory. See octeon_pci_setup()
for more details.

If a remap function is specified, it must be also called on any dynamically
allocated pools, but there are some issues:

- The remap function may block, so it should not be called from an atomic
  context.
- There is no corresponding unremap() function if the memory pool is
  freed.
- The only in-tree implementation (xen_swiotlb_fixup) requires that the
  number of slots in the memory pool is a multiple of SWIOTLB_SEGSIZE.

Keep it simple for now and disable growing the SWIOTLB if a remap function
was specified.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/swiotlb.h |  4 ++++
 kernel/dma/Kconfig      | 13 +++++++++++++
 kernel/dma/swiotlb.c    | 13 +++++++++++++
 3 files changed, 30 insertions(+)

diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 247f0ab8795a..57be2a0a9fbf 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -100,6 +100,7 @@ struct io_tlb_pool {
  * @debugfs:	The dentry to debugfs.
  * @force_bounce: %true if swiotlb bouncing is forced
  * @for_alloc:  %true if the pool is used for memory allocation
+ * @can_grow:	%true if more pools can be allocated dynamically.
  * @total_used:	The total number of slots in the pool that are currently used
  *		across all areas. Used only for calculating used_hiwater in
  *		debugfs.
@@ -112,6 +113,9 @@ struct io_tlb_mem {
 	struct dentry *debugfs;
 	bool force_bounce;
 	bool for_alloc;
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	bool can_grow;
+#endif
 #ifdef CONFIG_DEBUG_FS
 	atomic_long_t total_used;
 	atomic_long_t used_hiwater;
diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig
index 11d077003205..68c61fdf2b44 100644
--- a/kernel/dma/Kconfig
+++ b/kernel/dma/Kconfig
@@ -90,6 +90,19 @@ config SWIOTLB
 	bool
 	select NEED_DMA_MAP_STATE
 
+config SWIOTLB_DYNAMIC
+	bool "Dynamic allocation of DMA bounce buffers"
+	default n
+	depends on SWIOTLB
+	help
+	  This enables dynamic resizing of the software IO TLB. The kernel
+	  starts with one memory pool at boot and it will allocate additional
+	  pools as needed. To reduce run-time kernel memory requirements, you
+	  may have to specify a smaller size of the initial pool using
+	  "swiotlb=" on the kernel command line.
+
+	  If unsure, say N.
+
 config DMA_BOUNCE_UNALIGNED_KMALLOC
 	bool
 	depends on SWIOTLB
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 616113760b60..346857581b75 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -330,6 +330,11 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 	io_tlb_default_mem.force_bounce =
 		swiotlb_force_bounce || (flags & SWIOTLB_FORCE);
 
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	if (!remap)
+		io_tlb_default_mem.can_grow = true;
+#endif
+
 	if (!default_nareas)
 		swiotlb_adjust_nareas(num_possible_cpus());
 
@@ -400,6 +405,11 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 
 	io_tlb_default_mem.force_bounce = swiotlb_force_bounce;
 
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	if (!remap)
+		io_tlb_default_mem.can_grow = true;
+#endif
+
 	if (!default_nareas)
 		swiotlb_adjust_nareas(num_possible_cpus());
 
@@ -1074,6 +1084,9 @@ EXPORT_SYMBOL_GPL(is_swiotlb_active);
  */
 phys_addr_t default_swiotlb_base(void)
 {
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	io_tlb_default_mem.can_grow = false;
+#endif
 	return io_tlb_default_mem.defpool.start;
 }
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:09:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:09:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571067.894009 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOznq-00024F-5U; Thu, 27 Jul 2023 12:09:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571067.894009; Thu, 27 Jul 2023 12:09:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOznq-000246-2L; Thu, 27 Jul 2023 12:09:10 +0000
Received: by outflank-mailman (input) for mailman id 571067;
 Thu, 27 Jul 2023 12:09:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C0z/=DN=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qOzno-00023t-3W
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 12:09:08 +0000
Received: from frasgout11.his.huawei.com (unknown [14.137.139.23])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 62a99901-2c76-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 14:09:06 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.228])
 by frasgout11.his.huawei.com (SkyGuard) with ESMTP id 4RBTm55NSvz9v7gb
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 19:57:41 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.209.69])
 by APP2 (Coremail) with SMTP id GxC2BwBnGkGaXcJkfMYUBQ--.33878S10;
 Thu, 27 Jul 2023 13:08:28 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 62a99901-2c76-11ee-b247-6b7b168915f2
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM),
	linux-mm@kvack.org (open list:SLAB ALLOCATOR)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v6 8/9] swiotlb: allocate a new memory pool when existing pools are full
Date: Thu, 27 Jul 2023 14:05:36 +0200
Message-Id: <59726de69fe83ccb80e5ce95f83d033deac12b12.1690459412.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
References: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2BwBnGkGaXcJkfMYUBQ--.33878S10
X-Coremail-Antispam: 1UD129KBjvJXoW3ZrWfGFyxAryxCr4UJFWfAFb_yoWkXrW3pF
	y5Aa47KFWUXrn7CFy2k3WUCF1a9w4vkr47CrWa9rn8Zrn7Wrn5tFyqkryYqr95JF4DZF13
	tFWYvF15uw47Zw7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDU0xBIdaVrnRJUUUQl14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0
	rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYI
	kIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2
	z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F
	4UJwA2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z280aVCY1x0267AKxVWxJr0_
	GcWle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2I
	x0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8
	JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7CjxVA2Y2
	ka0xkIwI1lc7CjxVAaw2AFwI0_Jw0_GFylc7CjxVAKzI0EY4vE52x082I5MxAIw28IcxkI
	7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxV
	Cjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWrXVW8Jr1lIxkGc2Ij64vIr41lIxAI
	cVC0I7IYx2IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJwCI42
	IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280
	aVCY1x0267AKxVWxJr0_GcJvcSsGvfC2KfnxnUUI43ZEXa7VUUMKZtUUUUU==
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

When swiotlb_find_slots() cannot find suitable slots, schedule the
allocation of a new memory pool. It is not possible to allocate the pool
immediately, because this code may run in interrupt context, which is not
suitable for large memory allocations. This means that the memory pool will
be available too late for the currently requested mapping, but the stress
on the software IO TLB allocator is likely to continue, and subsequent
allocations will benefit from the additional pool eventually.

Keep all memory pools for an allocator in an RCU list to avoid locking on
the read side. For modifications, add a new spinlock to struct io_tlb_mem.

The spinlock also protects updates to the total number of slabs (nslabs in
struct io_tlb_mem), but not reads of the value. Readers may therefore
encounter a stale value, but this is not an issue:

- swiotlb_tbl_map_single() and is_swiotlb_active() only check for non-zero
  value. This is ensured by the existence of the default memory pool,
  allocated at boot.

- The exact value is used only for non-critical purposes (debugfs, kernel
  messages).

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/swiotlb.h |   8 +++
 kernel/dma/swiotlb.c    | 148 +++++++++++++++++++++++++++++++++-------
 2 files changed, 131 insertions(+), 25 deletions(-)

diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 9825fa14abe4..8371c92a0271 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -8,6 +8,7 @@
 #include <linux/types.h>
 #include <linux/limits.h>
 #include <linux/spinlock.h>
+#include <linux/workqueue.h>
 
 struct device;
 struct page;
@@ -104,12 +105,16 @@ struct io_tlb_pool {
 /**
  * struct io_tlb_mem - Software IO TLB allocator
  * @defpool:	Default (initial) IO TLB memory pool descriptor.
+ * @pool:	IO TLB memory pool descriptor (if not dynamic).
  * @nslabs:	Total number of IO TLB slabs in all pools.
  * @debugfs:	The dentry to debugfs.
  * @force_bounce: %true if swiotlb bouncing is forced
  * @for_alloc:  %true if the pool is used for memory allocation
  * @can_grow:	%true if more pools can be allocated dynamically.
  * @phys_limit:	Maximum allowed physical address.
+ * @lock:	Lock to synchronize changes to the list.
+ * @pools:	List of IO TLB memory pool descriptors (if dynamic).
+ * @dyn_alloc:	Dynamic IO TLB pool allocation work.
  * @total_used:	The total number of slots in the pool that are currently used
  *		across all areas. Used only for calculating used_hiwater in
  *		debugfs.
@@ -125,6 +130,9 @@ struct io_tlb_mem {
 #ifdef CONFIG_SWIOTLB_DYNAMIC
 	bool can_grow;
 	u64 phys_limit;
+	spinlock_t lock;
+	struct list_head pools;
+	struct work_struct dyn_alloc;
 #endif
 #ifdef CONFIG_DEBUG_FS
 	atomic_long_t total_used;
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index ca3aa03f37ba..1560a3e484b9 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -79,8 +79,23 @@ struct io_tlb_slot {
 static bool swiotlb_force_bounce;
 static bool swiotlb_force_disable;
 
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+
+static void swiotlb_dyn_alloc(struct work_struct *work);
+
+static struct io_tlb_mem io_tlb_default_mem = {
+	.lock = __SPIN_LOCK_UNLOCKED(io_tlb_default_mem.lock),
+	.pools = LIST_HEAD_INIT(io_tlb_default_mem.pools),
+	.dyn_alloc = __WORK_INITIALIZER(io_tlb_default_mem.dyn_alloc,
+					swiotlb_dyn_alloc),
+};
+
+#else  /* !CONFIG_SWIOTLB_DYNAMIC */
+
 static struct io_tlb_mem io_tlb_default_mem;
 
+#endif	/* CONFIG_SWIOTLB_DYNAMIC */
+
 static unsigned long default_nslabs = IO_TLB_DEFAULT_SIZE >> IO_TLB_SHIFT;
 static unsigned long default_nareas;
 
@@ -278,6 +293,23 @@ static void swiotlb_init_io_tlb_pool(struct io_tlb_pool *mem, phys_addr_t start,
 	return;
 }
 
+/**
+ * add_mem_pool() - add a memory pool to the allocator
+ * @mem:	Software IO TLB allocator.
+ * @pool:	Memory pool to be added.
+ */
+static void add_mem_pool(struct io_tlb_mem *mem, struct io_tlb_pool *pool)
+{
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	spin_lock(&mem->lock);
+	list_add_rcu(&pool->node, &mem->pools);
+	mem->nslabs += pool->nslabs;
+	spin_unlock(&mem->lock);
+#else
+	mem->nslabs = pool->nslabs;
+#endif
+}
+
 static void __init *swiotlb_memblock_alloc(unsigned long nslabs,
 		unsigned int flags,
 		int (*remap)(void *tlb, unsigned long nslabs))
@@ -375,7 +407,7 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 
 	swiotlb_init_io_tlb_pool(mem, __pa(tlb), nslabs, false,
 				 default_nareas);
-	io_tlb_default_mem.nslabs = nslabs;
+	add_mem_pool(&io_tlb_default_mem, mem);
 
 	if (flags & SWIOTLB_VERBOSE)
 		swiotlb_print_info();
@@ -474,7 +506,7 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 			     (nslabs << IO_TLB_SHIFT) >> PAGE_SHIFT);
 	swiotlb_init_io_tlb_pool(mem, virt_to_phys(vstart), nslabs, true,
 				 nareas);
-	io_tlb_default_mem.nslabs = nslabs;
+	add_mem_pool(&io_tlb_default_mem, mem);
 
 	swiotlb_print_info();
 	return 0;
@@ -625,44 +657,83 @@ static void swiotlb_free_tlb(void *vaddr, size_t bytes)
 /**
  * swiotlb_alloc_pool() - allocate a new IO TLB memory pool
  * @dev:	Device for which a memory pool is allocated.
- * @nslabs:	Desired number of slabs.
+ * @minslabs:	Minimum number of slabs.
+ * @nslabs:	Desired (maximum) number of slabs.
+ * @nareas:	Number of areas.
  * @phys_limit:	Maximum DMA buffer physical address.
  * @gfp:	GFP flags for the allocations.
  *
- * Allocate and initialize a new IO TLB memory pool.
+ * Allocate and initialize a new IO TLB memory pool. The actual number of
+ * slabs may be reduced if allocation of @nslabs fails. If even
+ * @minslabs cannot be allocated, this function fails.
  *
  * Return: New memory pool, or %NULL on allocation failure.
  */
 static struct io_tlb_pool *swiotlb_alloc_pool(struct device *dev,
-		unsigned int nslabs, u64 phys_limit, gfp_t gfp)
+		unsigned long minslabs, unsigned long nslabs,
+		unsigned int nareas, u64 phys_limit, gfp_t gfp)
 {
 	struct io_tlb_pool *pool;
+	unsigned int slot_order;
 	struct page *tlb;
 	size_t pool_size;
 	size_t tlb_size;
 
-	pool_size = sizeof(*pool) + array_size(sizeof(*pool->areas), 1) +
-		array_size(sizeof(*pool->slots), nslabs);
+	pool_size = sizeof(*pool) + array_size(sizeof(*pool->areas), nareas);
 	pool = kzalloc(pool_size, gfp);
 	if (!pool)
 		goto error;
 	pool->areas = (void *)pool + sizeof(*pool);
-	pool->slots = (void *)pool->areas + sizeof(*pool->areas);
 
 	tlb_size = nslabs << IO_TLB_SHIFT;
-	tlb = swiotlb_alloc_tlb(dev, tlb_size, phys_limit, gfp);
-	if (!tlb)
-		goto error_tlb;
+	while (!(tlb = swiotlb_alloc_tlb(dev, tlb_size, phys_limit, gfp))) {
+		if (nslabs <= minslabs)
+			goto error_tlb;
+		nslabs = ALIGN(nslabs >> 1, IO_TLB_SEGSIZE);
+		nareas = limit_nareas(nareas, nslabs);
+		tlb_size = nslabs << IO_TLB_SHIFT;
+	}
 
-	swiotlb_init_io_tlb_pool(pool, page_to_phys(tlb), nslabs, true, 1);
+	slot_order = get_order(array_size(sizeof(*pool->slots), nslabs));
+	pool->slots = (struct io_tlb_slot *)
+		__get_free_pages(gfp, slot_order);
+	if (!pool->slots)
+		goto error_slots;
+
+	swiotlb_init_io_tlb_pool(pool, page_to_phys(tlb), nslabs, true, nareas);
 	return pool;
 
+error_slots:
+	swiotlb_free_tlb(page_address(tlb), tlb_size);
 error_tlb:
 	kfree(pool);
 error:
 	return NULL;
 }
 
+/**
+ * swiotlb_dyn_alloc() - dynamic memory pool allocation worker
+ * @work:	Pointer to dyn_alloc in struct io_tlb_mem.
+ */
+static void swiotlb_dyn_alloc(struct work_struct *work)
+{
+	struct io_tlb_mem *mem =
+		container_of(work, struct io_tlb_mem, dyn_alloc);
+	struct io_tlb_pool *pool;
+
+	pool = swiotlb_alloc_pool(NULL, IO_TLB_MIN_SLABS, default_nslabs,
+				  default_nareas, mem->phys_limit, GFP_KERNEL);
+	if (!pool) {
+		pr_warn_ratelimited("Failed to allocate new pool");
+		return;
+	}
+
+	add_mem_pool(mem, pool);
+
+	/* Pairs with smp_rmb() in swiotlb_find_pool(). */
+	smp_wmb();
+}
+
 /**
  * swiotlb_dyn_free() - RCU callback to free a memory pool
  * @rcu:	RCU head in the corresponding struct io_tlb_pool.
@@ -670,8 +741,10 @@ static struct io_tlb_pool *swiotlb_alloc_pool(struct device *dev,
 static void swiotlb_dyn_free(struct rcu_head *rcu)
 {
 	struct io_tlb_pool *pool = container_of(rcu, struct io_tlb_pool, rcu);
+	size_t slots_size = array_size(sizeof(*pool->slots), pool->nslabs);
 	size_t tlb_size = pool->end - pool->start;
 
+	free_pages((unsigned long)pool->slots, get_order(slots_size));
 	swiotlb_free_tlb(pool->vaddr, tlb_size);
 	kfree(pool);
 }
@@ -689,15 +762,19 @@ static void swiotlb_dyn_free(struct rcu_head *rcu)
 struct io_tlb_pool *swiotlb_find_pool(struct device *dev, phys_addr_t paddr)
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
-	struct io_tlb_pool *pool = &mem->defpool;
-
-	if (paddr >= pool->start && paddr < pool->end)
-		return pool;
+	struct io_tlb_pool *pool;
 
-	/* Pairs with smp_wmb() in swiotlb_find_slots(). */
+	/* Pairs with smp_wmb() in swiotlb_find_slots() and
+	 * swiotlb_dyn_alloc(), which modify the RCU lists.
+	 */
 	smp_rmb();
 
 	rcu_read_lock();
+	list_for_each_entry_rcu(pool, &mem->pools, node) {
+		if (paddr >= pool->start && paddr < pool->end)
+			goto out;
+	}
+
 	list_for_each_entry_rcu(pool, &dev->dma_io_tlb_pools, node) {
 		if (paddr >= pool->start && paddr < pool->end)
 			goto out;
@@ -1046,18 +1123,24 @@ static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
 	u64 phys_limit;
 	int index;
 
-	pool = &mem->defpool;
-	index = swiotlb_pool_find_slots(dev, pool, orig_addr,
-					alloc_size, alloc_align_mask);
-	if (index >= 0)
-		goto found;
-
+	rcu_read_lock();
+	list_for_each_entry_rcu(pool, &mem->pools, node) {
+		index = swiotlb_pool_find_slots(dev, pool, orig_addr,
+						alloc_size, alloc_align_mask);
+		if (index >= 0) {
+			rcu_read_unlock();
+			goto found;
+		}
+	}
+	rcu_read_unlock();
 	if (!mem->can_grow)
 		return -1;
 
+	schedule_work(&mem->dyn_alloc);
+
 	nslabs = nr_slots(alloc_size);
 	phys_limit = min_not_zero(*dev->dma_mask, dev->bus_dma_limit);
-	pool = swiotlb_alloc_pool(dev, nslabs, phys_limit,
+	pool = swiotlb_alloc_pool(dev, nslabs, nslabs, 1, phys_limit,
 				  GFP_NOWAIT | __GFP_NOWARN);
 	if (!pool)
 		return -1;
@@ -1141,7 +1224,19 @@ static unsigned long mem_pool_used(struct io_tlb_pool *pool)
  */
 static unsigned long mem_used(struct io_tlb_mem *mem)
 {
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	struct io_tlb_pool *pool;
+	unsigned long used = 0;
+
+	rcu_read_lock();
+	list_for_each_entry_rcu(pool, &mem->pools, node)
+		used += mem_pool_used(pool);
+	rcu_read_unlock();
+
+	return used;
+#else
 	return mem_pool_used(&mem->defpool);
+#endif
 }
 
 #endif /* CONFIG_DEBUG_FS */
@@ -1563,7 +1658,10 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem,
 					 false, nareas);
 		mem->force_bounce = true;
 		mem->for_alloc = true;
-		mem->nslabs = nslabs;
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+		spin_lock_init(&mem->lock);
+#endif
+		add_mem_pool(mem, pool);
 
 		rmem->priv = mem;
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:09:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:09:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571068.894018 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzo5-0002RT-D5; Thu, 27 Jul 2023 12:09:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571068.894018; Thu, 27 Jul 2023 12:09:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzo5-0002RM-A3; Thu, 27 Jul 2023 12:09:25 +0000
Received: by outflank-mailman (input) for mailman id 571068;
 Thu, 27 Jul 2023 12:09:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C0z/=DN=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qOzo3-00023t-H0
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 12:09:23 +0000
Received: from frasgout11.his.huawei.com (unknown [14.137.139.23])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6c3c8b49-2c76-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 14:09:23 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.228])
 by frasgout11.his.huawei.com (SkyGuard) with ESMTP id 4RBTmR36Jsz9v7gF
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 19:57:59 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.209.69])
 by APP2 (Coremail) with SMTP id GxC2BwBnGkGaXcJkfMYUBQ--.33878S11;
 Thu, 27 Jul 2023 13:08:45 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6c3c8b49-2c76-11ee-b247-6b7b168915f2
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM),
	linux-mm@kvack.org (open list:SLAB ALLOCATOR)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v6 9/9] swiotlb: search the software IO TLB only if the device makes use of it
Date: Thu, 27 Jul 2023 14:05:37 +0200
Message-Id: <992c172baff5deac9aa3bbc76d999785d12fe995.1690459412.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
References: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2BwBnGkGaXcJkfMYUBQ--.33878S11
X-Coremail-Antispam: 1UD129KBjvJXoWxZF15Ww18ZF1fWr1UtFW7XFb_yoWrXFy3pF
	98AFZ8KayqqryxGryxCF18uF1agw4vk3yfurWagrnYkr1DJwnaqF1DKrWav3s5Ar47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UUUU==
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

Skip searching the software IO TLB if a device has never used it, making
sure these devices are not affected by the introduction of multiple IO TLB
memory pools.

Additional memory barrier is required to ensure that the new value of the
flag is visible to other CPUs after mapping a new bounce buffer. For
efficiency, the flag check should be inlined, and then the memory barrier
must be moved to is_swiotlb_buffer(). However, it can replace the existing
barrier in swiotlb_find_pool(), because all callers use is_swiotlb_buffer()
first to verify that the buffer address belongs to the software IO TLB.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/device.h  |  2 ++
 include/linux/swiotlb.h |  7 ++++++-
 kernel/dma/swiotlb.c    | 14 ++++++--------
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/include/linux/device.h b/include/linux/device.h
index 5fd89c9d005c..6fc808d22bfd 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -628,6 +628,7 @@ struct device_physical_location {
  * @dma_io_tlb_mem: Software IO TLB allocator.  Not for driver use.
  * @dma_io_tlb_pools:	List of transient swiotlb memory pools.
  * @dma_io_tlb_lock:	Protects changes to the list of active pools.
+ * @dma_uses_io_tlb: %true if device has used the software IO TLB.
  * @archdata:	For arch-specific additions.
  * @of_node:	Associated device tree node.
  * @fwnode:	Associated device node supplied by platform firmware.
@@ -737,6 +738,7 @@ struct device {
 #ifdef CONFIG_SWIOTLB_DYNAMIC
 	struct list_head dma_io_tlb_pools;
 	spinlock_t dma_io_tlb_lock;
+	bool dma_uses_io_tlb;
 #endif
 	/* arch specific additions */
 	struct dev_archdata	archdata;
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 8371c92a0271..b4536626f8ff 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -172,8 +172,13 @@ static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
 	if (!mem)
 		return false;
 
-	if (IS_ENABLED(CONFIG_SWIOTLB_DYNAMIC))
+	if (IS_ENABLED(CONFIG_SWIOTLB_DYNAMIC)) {
+		/* Pairs with smp_wmb() in swiotlb_find_slots() and
+		 * swiotlb_dyn_alloc(), which modify the RCU lists.
+		 */
+		smp_rmb();
 		return swiotlb_find_pool(dev, paddr);
+	}
 	return paddr >= mem->defpool.start && paddr < mem->defpool.end;
 }
 
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 1560a3e484b9..1fe64573d828 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -730,7 +730,7 @@ static void swiotlb_dyn_alloc(struct work_struct *work)
 
 	add_mem_pool(mem, pool);
 
-	/* Pairs with smp_rmb() in swiotlb_find_pool(). */
+	/* Pairs with smp_rmb() in is_swiotlb_buffer(). */
 	smp_wmb();
 }
 
@@ -764,11 +764,6 @@ struct io_tlb_pool *swiotlb_find_pool(struct device *dev, phys_addr_t paddr)
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
 	struct io_tlb_pool *pool;
 
-	/* Pairs with smp_wmb() in swiotlb_find_slots() and
-	 * swiotlb_dyn_alloc(), which modify the RCU lists.
-	 */
-	smp_rmb();
-
 	rcu_read_lock();
 	list_for_each_entry_rcu(pool, &mem->pools, node) {
 		if (paddr >= pool->start && paddr < pool->end)
@@ -813,6 +808,7 @@ void swiotlb_dev_init(struct device *dev)
 #ifdef CONFIG_SWIOTLB_DYNAMIC
 	INIT_LIST_HEAD(&dev->dma_io_tlb_pools);
 	spin_lock_init(&dev->dma_io_tlb_lock);
+	dev->dma_uses_io_tlb = false;
 #endif
 }
 
@@ -1157,9 +1153,11 @@ static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
 	list_add_rcu(&pool->node, &dev->dma_io_tlb_pools);
 	spin_unlock_irqrestore(&dev->dma_io_tlb_lock, flags);
 
-	/* Pairs with smp_rmb() in swiotlb_find_pool(). */
-	smp_wmb();
 found:
+	dev->dma_uses_io_tlb = true;
+	/* Pairs with smp_rmb() in is_swiotlb_buffer() */
+	smp_wmb();
+
 	*retpool = pool;
 	return index;
 }
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:15:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:15:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571072.894029 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOztp-0004E8-4s; Thu, 27 Jul 2023 12:15:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571072.894029; Thu, 27 Jul 2023 12:15:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOztp-0004E1-2C; Thu, 27 Jul 2023 12:15:21 +0000
Received: by outflank-mailman (input) for mailman id 571072;
 Thu, 27 Jul 2023 12:15:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOztn-0004Dv-TK
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 12:15:20 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on062b.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 401f5007-2c77-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 14:15:18 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB7575.eurprd04.prod.outlook.com (2603:10a6:20b:29c::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 12:15:16 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 12:15:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 401f5007-2c77-11ee-b247-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=PR5t8iZQ9AshKDtFG0b7NPqE170QRgpI9UQ8pz/A1+Y5Cbi9n65h/uzW3Oz/eGBP9R6nL2eaQpNfNL95EIZ4rZunR/0vVAs/TMY6GeS9voUQPaYiwuisgdd/OXLX2xg72+wCTSVl+WUcX6Z+IhcZEF4HWHr9Ql412VtY7zT1YzobpHMEdaA/sGwT9lZp9nnNZvSGS3/c0J4APaC3o1saA9/0kUbTH0YpXL4mY/Of7mk8t5h7n2HUpJxw6VtFk4W2KPaEaHWGNdj3b/+AeNmF5v9hoMWPGL3l4BVTvG4ETUyKZDWTk16BU9EJ3imfJkdQRtJOuAg2PU4cKBqQfE6/wQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7rFGLkvY8Qw30FFpaVhWJtSW9PoM0yeIUsss/wKQnpQ=;
 b=RAgZ0HymH9ZG7upDb0KrEMz2qHOlhKQprrbGPzD7GnsX/r6g1pjaY6XoVdwA9X1hJig1vVnzEh+1Cav5Y9uU7hyXRJYMHimaHtFq0+bYKE/81JbYjyPXuViK0J1HOgeowglFS28abB3jbmNJVc1A+y7RM+eK7SBfToHzcoJE12HTRnN+OHqZRKdcnTH1CF6aDY8e+fyHNyGedvvYHmxepC+MnYhkuOD2z4/b+BrsC8k+zjzs9YhpIOZThObEnGjdw9i5h74OIilTPaVyzzjku85UN2aY4hgvvpd6e84A5OwWUvI5tuJfCrz6Bqz1hbYXW5ldQoTbL+2Zl4l173jtGw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7rFGLkvY8Qw30FFpaVhWJtSW9PoM0yeIUsss/wKQnpQ=;
 b=4CfVfMKhW2xqJpGk4IyEhpukwAi8Del1p7lBJbxXqOxlXduHjawYpXZkj/pcuGH/Exk+PdGX6PCDSvHw7Z8n6EL8X6YNkbhbxX5+Eofawxhnpt2EG3RL51z5H/34TLNSxubffw5PVhv1c1l9Ss+jh36ECiW3NOe+YISAVl/ILJLOw/1Q2t2vFtaLaOlpZRp1s2KJ3f/zgx8Q+mnb3+q2J9XB7VDlQionNk6OpDcHR93o5lDqSFi8C7twSsFwI42hWp9AWc0pLYWpbdP3hmPsYCfsEeAWXQMyQZafDaFIEwHM/CewM+o38OZdPUtm6U4fYKWKNelPNijNtqrEwzztTA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <5ee3c63e-27ab-406a-7307-16061b65f42c@suse.com>
Date: Thu, 27 Jul 2023 14:15:13 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v4 4/4] xen/x86: address violations of MISRA C:2012
 Rule 7.2
Content-Language: en-US
To: Simone Ballarin <simone.ballarin@bugseng.com>
Cc: consulting@bugseng.com, Gianluca Luparini
 <gianluca.luparini@bugseng.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1690368810.git.simone.ballarin@bugseng.com>
 <3790011b9d9235fd0c3fd2016ee25feb37e925f5.1690368810.git.simone.ballarin@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <3790011b9d9235fd0c3fd2016ee25feb37e925f5.1690368810.git.simone.ballarin@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0100.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a9::6) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB7575:EE_
X-MS-Office365-Filtering-Correlation-Id: dfd91c9e-249a-4a3f-9a82-08db8e9b226d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	2sn95Vh114BvEjmDf5SaBbbX0pKWZKWvtFrh/jMqU/GVfBBhZy5wkk8N1ToDb8Twpq2wyrVSROvfSlnRbS4VCIB5YB0bFlIp8Nr/5B5WZJ00PLSFMBBADlY6clhlQ1iG9T0uGAOdxxOeY4Jf50GZdt2ZUIWDo41gCw3eFw22jaCroZrUFZH/cOsG0G21ebGuuHC7ARUgA8L2lkremC6IkNvljavwP7ba4S80+2y+L2q59zodtK68boKZOe/wtxxQaFhPgphkIUAC13lg9i8Pqy3Wco+BnIzaZKPjevtcK1kesc87z1yZNszGTZMMD/L1AreEscNjFipWiT6ixCmmDtMYS3C7zEsx53gy6zwqZ21MVJKwolgGH2iYr7CswN8yynewcGMlp8McwgVeUKkJt9FDM+aU1AS3G+EY9pKAcvsTNQuZjvw9T0f3Xj9t1+zz97zcQB2nNhowH87qTuQcxQbJRJEmb4SboNfnWieH0RCkp+p0MsO1qERry+mcOFwOurYTQxuXNXmpETWeEm6EQOgHletUxkIsHeaegjWv3MXC8W7WhI2OruKQdrI3rHn2bL1V/Ud2CsoZdIVEvzw02Mx0qaeYbKAiqr1R6sq7an17/2kwVrUUyTkiqvHwEMxahwiTOxzf3gYa1EvnFXuYew==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(136003)(376002)(39860400002)(366004)(451199021)(53546011)(31696002)(6506007)(2616005)(66476007)(6916009)(4326008)(66946007)(86362001)(26005)(66556008)(6512007)(186003)(31686004)(36756003)(2906002)(6486002)(478600001)(54906003)(41300700001)(38100700002)(316002)(8676002)(5660300002)(8936002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?U0RzNS9aS2ptaDNNSTNLUGFGNllqTXZpb0gyTDl3L3Jkeld1WG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Q2blNvSVAzLzhjYmt4?=
 =?utf-8?B?Y0NmQnk2aTJJeFdQVkVQVCs2RWs4dXA3ZzN5SUhNSzNNbFNZZ2dOaWpMUURD?=
 =?utf-8?B?MXVzd2pZVnJXeGpVUWVSNTVrRDNkb0tVWm9YbnFPaUw0SThIZjZTbmhXaE9x?=
 =?utf-8?B?WndrVWx4eWRxVVgxVEhyR0wwdEdzWkdmdkNoNk8yemtyaWJHdm1wUENSdEd6?=
 =?utf-8?B?amZacnp4eC9qcktTSDlDaSt3TVcwQzJkQWV3N3c1WWVmdERUMWhvNnlsd1FB?=
 =?utf-8?B?MXoyRDJBUTJ6NzErOXJML0tvNFVKTWdjS1JFLzFuTzdiSG9LQi9RRUVtOEdh?=
 =?utf-8?Q?pl9AZsVFtexgkl/mROhodC5Ni?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: dfd91c9e-249a-4a3f-9a82-08db8e9b226d
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 12:15:15.2934
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: id1+A2UHT4Ip8jGucD2/qds5XBfRQkdG0NgkOxMpVAlHh8pwGdxMqs+HwTLNMxmxcb0/xZCggQFq9TrZnMdcoA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7575

On 26.07.2023 13:03, Simone Ballarin wrote:
> @@ -70,15 +70,15 @@ static const uint8_t sr_mask[8] = {
>  };
>  
>  static const uint8_t gr_mask[9] = {
> -    (uint8_t)~0xf0, /* 0x00 */
> -    (uint8_t)~0xf0, /* 0x01 */
> -    (uint8_t)~0xf0, /* 0x02 */
> -    (uint8_t)~0xe0, /* 0x03 */
> -    (uint8_t)~0xfc, /* 0x04 */
> -    (uint8_t)~0x84, /* 0x05 */
> -    (uint8_t)~0xf0, /* 0x06 */
> -    (uint8_t)~0xf0, /* 0x07 */
> -    (uint8_t)~0x00, /* 0x08 */
> +    (uint8_t)~0xf0,
> +    (uint8_t)~0xf0,
> +    (uint8_t)~0xf0,
> +    (uint8_t)~0xe0,
> +    (uint8_t)~0xfc,
> +    (uint8_t)~0x84,
> +    (uint8_t)~0xf0,
> +    (uint8_t)~0xf0,
> +    (uint8_t)~0x00,
>  };

Hmm, this stray change is _still_ there.

> --- a/xen/arch/x86/include/asm/hvm/trace.h
> +++ b/xen/arch/x86/include/asm/hvm/trace.h
> @@ -58,7 +58,7 @@
>  #define DO_TRC_HVM_VLAPIC           DEFAULT_HVM_MISC
>  
>  
> -#define TRC_PAR_LONG(par) ((par)&0xFFFFFFFF),((par)>>32)
> +#define TRC_PAR_LONG(par) ((uint32_t)par), ((par) >> 32)

You've lost parentheses around "par".

> @@ -93,7 +93,7 @@
>      HVMTRACE_ND(evt, 0, 0)
>  
>  #define HVMTRACE_LONG_1D(evt, d1)                  \
> -                   HVMTRACE_2D(evt ## 64, (d1) & 0xFFFFFFFF, (d1) >> 32)
> +                   HVMTRACE_2D(evt ## 64, (uint32_t)d1, (d1) >> 32)

Same for "d1" here.

Both of these are, btw., indications that you should have dropped Stefano's
R-b.

> --- a/xen/arch/x86/include/asm/msr-index.h
> +++ b/xen/arch/x86/include/asm/msr-index.h
> @@ -30,7 +30,7 @@
>  
>  #define MSR_INTEL_CORE_THREAD_COUNT         0x00000035
>  #define  MSR_CTC_THREAD_MASK                0x0000ffff
> -#define  MSR_CTC_CORE_MASK                  0xffff0000
> +#define  MSR_CTC_CORE_MASK                  0xffff0000U
>  
>  #define MSR_SPEC_CTRL                       0x00000048
>  #define  SPEC_CTRL_IBRS                     (_AC(1, ULL) <<  0)
> @@ -168,7 +168,7 @@
>  #define MSR_UARCH_MISC_CTRL                 0x00001b01
>  #define  UARCH_CTRL_DOITM                   (_AC(1, ULL) <<  0)
>  
> -#define MSR_EFER                            0xc0000080 /* Extended Feature Enable Register */
> +#define MSR_EFER                            _AC(0xc0000080, U)  /* Extended Feature Enable Register */

I understand you use _AC() here because the constant is used in assembly
code. But I don't understand why you use it only here, and not throughout
at least the "modern" portion of the file. I wonder what other x86
maintainers think about this.

As a minor aspect, I also don't really see why you insert a 2nd blank
ahead of the comment.

>  #define  EFER_SCE                           (_AC(1, ULL) <<  0) /* SYSCALL Enable */
>  #define  EFER_LME                           (_AC(1, ULL) <<  8) /* Long Mode Enable */
>  #define  EFER_LMA                           (_AC(1, ULL) << 10) /* Long Mode Active */
> @@ -181,35 +181,35 @@
>      (EFER_SCE | EFER_LME | EFER_LMA | EFER_NXE | EFER_SVME | EFER_FFXSE | \
>       EFER_AIBRSE)
>  
> -#define MSR_STAR                            0xc0000081 /* legacy mode SYSCALL target */
> -#define MSR_LSTAR                           0xc0000082 /* long mode SYSCALL target */
> -#define MSR_CSTAR                           0xc0000083 /* compat mode SYSCALL target */
> -#define MSR_SYSCALL_MASK                    0xc0000084 /* EFLAGS mask for syscall */
> -#define MSR_FS_BASE                         0xc0000100 /* 64bit FS base */
> -#define MSR_GS_BASE                         0xc0000101 /* 64bit GS base */
> -#define MSR_SHADOW_GS_BASE                  0xc0000102 /* SwapGS GS shadow */
> -#define MSR_TSC_AUX                         0xc0000103 /* Auxiliary TSC */
> +#define MSR_STAR                            0xc0000081U /* legacy mode SYSCALL target */
> +#define MSR_LSTAR                           0xc0000082U /* long mode SYSCALL target */
> +#define MSR_CSTAR                           0xc0000083U /* compat mode SYSCALL target */
> +#define MSR_SYSCALL_MASK                    0xc0000084U /* EFLAGS mask for syscall */
> +#define MSR_FS_BASE                         0xc0000100U /* 64bit FS base */
> +#define MSR_GS_BASE                         0xc0000101U /* 64bit GS base */
> +#define MSR_SHADOW_GS_BASE                  0xc0000102U /* SwapGS GS shadow */
> +#define MSR_TSC_AUX                         0xc0000103U /* Auxiliary TSC */
>  
> -#define MSR_K8_SYSCFG                       0xc0010010
> +#define MSR_K8_SYSCFG                       0xc0010010U
>  #define  SYSCFG_MTRR_FIX_DRAM_EN            (_AC(1, ULL) << 18)
>  #define  SYSCFG_MTRR_FIX_DRAM_MOD_EN        (_AC(1, ULL) << 19)
>  #define  SYSCFG_MTRR_VAR_DRAM_EN            (_AC(1, ULL) << 20)
>  #define  SYSCFG_MTRR_TOM2_EN                (_AC(1, ULL) << 21)
>  #define  SYSCFG_TOM2_FORCE_WB               (_AC(1, ULL) << 22)
>  
> -#define MSR_K8_IORR_BASE0                   0xc0010016
> -#define MSR_K8_IORR_MASK0                   0xc0010017
> -#define MSR_K8_IORR_BASE1                   0xc0010018
> -#define MSR_K8_IORR_MASK1                   0xc0010019
> +#define MSR_K8_IORR_BASE0                   0xc0010016U
> +#define MSR_K8_IORR_MASK0                   0xc0010017U
> +#define MSR_K8_IORR_BASE1                   0xc0010018U
> +#define MSR_K8_IORR_MASK1                   0xc0010019U
>  
> -#define MSR_K8_TSEG_BASE                    0xc0010112 /* AMD doc: SMMAddr */
> -#define MSR_K8_TSEG_MASK                    0xc0010113 /* AMD doc: SMMMask */
> +#define MSR_K8_TSEG_BASE                    0xc0010112U /* AMD doc: SMMAddr */
> +#define MSR_K8_TSEG_MASK                    0xc0010113U /* AMD doc: SMMMask */
>  
> -#define MSR_K8_VM_CR                        0xc0010114
> +#define MSR_K8_VM_CR                        0xc0010114U
>  #define  VM_CR_INIT_REDIRECTION             (_AC(1, ULL) <<  1)
>  #define  VM_CR_SVM_DISABLE                  (_AC(1, ULL) <<  4)
>  
> -#define MSR_VIRT_SPEC_CTRL                  0xc001011f /* Layout matches MSR_SPEC_CTRL */
> +#define MSR_VIRT_SPEC_CTRL                  0xc001011fU /* Layout matches MSR_SPEC_CTRL */
>  
>  /*
>   * Legacy MSR constants in need of cleanup.  No new MSRs below this comment.

(As to above remark: This is the separator between "modern" [above]
and "historic" [below].)

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:17:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:17:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571074.894039 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzvl-0004ml-Ii; Thu, 27 Jul 2023 12:17:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571074.894039; Thu, 27 Jul 2023 12:17:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzvl-0004mc-Dy; Thu, 27 Jul 2023 12:17:21 +0000
Received: by outflank-mailman (input) for mailman id 571074;
 Thu, 27 Jul 2023 12:17:20 +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
 <SRS0=C0z/=DN=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qOznF-00079h-Qj
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 12:08:33 +0000
Received: from frasgout11.his.huawei.com (unknown [14.137.139.23])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4d452ed0-2c76-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 14:08:31 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.228])
 by frasgout11.his.huawei.com (SkyGuard) with ESMTP id 4RBTlQ2Zb0z9v7gP
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 19:57:06 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.209.69])
 by APP2 (Coremail) with SMTP id GxC2BwBnGkGaXcJkfMYUBQ--.33878S8;
 Thu, 27 Jul 2023 13:07:52 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4d452ed0-2c76-11ee-8613-37d641c3527e
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM),
	linux-mm@kvack.org (open list:SLAB ALLOCATOR)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v6 6/9] swiotlb: if swiotlb is full, fall back to a transient memory pool
Date: Thu, 27 Jul 2023 14:05:34 +0200
Message-Id: <1e68badec34c5dee652d4b320fefcdd1951cde5d.1690459412.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
References: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2BwBnGkGaXcJkfMYUBQ--.33878S8
X-Coremail-Antispam: 1UD129KBjvAXoW3Cr4UZr48Zr45Jw18Zw17Awb_yoW8CF1rXo
	W7uFn3Ww4fJ34UCF4rGFs7Gr47Za1kKa18AF4fuayYgayjvryYgrW7ta15X3sI9ryIkFWx
	Aw1Sqa4fWF4xArykn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7v73VFW2AGmfu7bjvjm3
	AaLaJ3UjIYCTnIWjp_UUUOl7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20EY4v20xva
	j40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r126s0DM28Irc
	Ia0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l
	84ACjcxK6xIIjxv20xvE14v26r1I6r4UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4UJV
	WxJr1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr1j
	6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7V
	C0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j
	6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x0262
	8vn2kIc2xKxwCY1x0262kKe7AKxVWUtVW8ZwCY1x0264kExVAvwVAq07x20xyl42xK82IY
	c2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s
	026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26rWY6r4UJwCIc40Y0x0EwIxGrwCI
	42IY6xIIjxv20xvE14v26r1I6r4UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UMI
	IF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E
	87Iv6xkF7I0E14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43ZEXa7VUUMKZtUUUUU==
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

Try to allocate a transient memory pool if no suitable slots can be found
and the respective SWIOTLB is allowed to grow. The transient pool is just
enough big for this one bounce buffer. It is inserted into a per-device
list of transient memory pools, and it is freed again when the bounce
buffer is unmapped.

Transient memory pools are kept in an RCU list. A memory barrier is
required after adding a new entry, because any address within a transient
buffer must be immediately recognized as belonging to the SWIOTLB, even if
it is passed to another CPU.

Deletion does not require any synchronization beyond RCU ordering
guarantees. After a buffer is unmapped, its physical addresses may no
longer be passed to the DMA API, so the memory range of the corresponding
stale entry in the RCU list never matches. If the memory range gets
allocated again, then it happens only after a RCU quiescent state.

Since bounce buffers can now be allocated from different pools, add a
parameter to swiotlb_alloc_pool() to let the caller know which memory pool
is used. Add swiotlb_find_pool() to find the memory pool corresponding to
an address. This function is now also used by is_swiotlb_buffer(), because
a simple boundary check is no longer sufficient.

The logic in swiotlb_alloc_tlb() is taken from __dma_direct_alloc_pages(),
simplified and enhanced to use coherent memory pools if needed.

Note that this is not the most efficient way to provide a bounce buffer,
but when a DMA buffer can't be mapped, something may (and will) actually
break. At that point it is better to make an allocation, even if it may be
an expensive operation.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/device.h      |   6 +
 include/linux/dma-mapping.h |   2 +
 include/linux/swiotlb.h     |  29 +++-
 kernel/dma/direct.c         |   2 +-
 kernel/dma/swiotlb.c        | 316 +++++++++++++++++++++++++++++++++++-
 5 files changed, 345 insertions(+), 10 deletions(-)

diff --git a/include/linux/device.h b/include/linux/device.h
index d9754a68ba95..5fd89c9d005c 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -626,6 +626,8 @@ struct device_physical_location {
  * @dma_mem:	Internal for coherent mem override.
  * @cma_area:	Contiguous memory area for dma allocations
  * @dma_io_tlb_mem: Software IO TLB allocator.  Not for driver use.
+ * @dma_io_tlb_pools:	List of transient swiotlb memory pools.
+ * @dma_io_tlb_lock:	Protects changes to the list of active pools.
  * @archdata:	For arch-specific additions.
  * @of_node:	Associated device tree node.
  * @fwnode:	Associated device node supplied by platform firmware.
@@ -731,6 +733,10 @@ struct device {
 #endif
 #ifdef CONFIG_SWIOTLB
 	struct io_tlb_mem *dma_io_tlb_mem;
+#endif
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	struct list_head dma_io_tlb_pools;
+	spinlock_t dma_io_tlb_lock;
 #endif
 	/* arch specific additions */
 	struct dev_archdata	archdata;
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index e13050eb9777..f0ccca16a0ac 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -418,6 +418,8 @@ static inline void dma_sync_sgtable_for_device(struct device *dev,
 #define dma_get_sgtable(d, t, v, h, s) dma_get_sgtable_attrs(d, t, v, h, s, 0)
 #define dma_mmap_coherent(d, v, c, h, s) dma_mmap_attrs(d, v, c, h, s, 0)
 
+bool dma_coherent_ok(struct device *dev, phys_addr_t phys, size_t size);
+
 static inline void *dma_alloc_coherent(struct device *dev, size_t size,
 		dma_addr_t *dma_handle, gfp_t gfp)
 {
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 57be2a0a9fbf..66867d2188ba 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -80,6 +80,9 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t phys,
  * @area_nslabs: Number of slots in each area.
  * @areas:	Array of memory area descriptors.
  * @slots:	Array of slot descriptors.
+ * @node:	Member of the IO TLB memory pool list.
+ * @rcu:	RCU head for swiotlb_dyn_free().
+ * @transient:  %true if transient memory pool.
  */
 struct io_tlb_pool {
 	phys_addr_t start;
@@ -91,6 +94,11 @@ struct io_tlb_pool {
 	unsigned int area_nslabs;
 	struct io_tlb_area *areas;
 	struct io_tlb_slot *slots;
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	struct list_head node;
+	struct rcu_head rcu;
+	bool transient;
+#endif
 };
 
 /**
@@ -122,6 +130,20 @@ struct io_tlb_mem {
 #endif
 };
 
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+
+struct io_tlb_pool *swiotlb_find_pool(struct device *dev, phys_addr_t paddr);
+
+#else
+
+static inline struct io_tlb_pool *swiotlb_find_pool(struct device *dev,
+						    phys_addr_t paddr)
+{
+	return &dev->dma_io_tlb_mem->defpool;
+}
+
+#endif
+
 /**
  * is_swiotlb_buffer() - check if a physical address belongs to a swiotlb
  * @dev:        Device which has mapped the buffer.
@@ -137,7 +159,12 @@ static inline bool is_swiotlb_buffer(struct device *dev, phys_addr_t paddr)
 {
 	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
 
-	return mem && paddr >= mem->defpool.start && paddr < mem->defpool.end;
+	if (!mem)
+		return false;
+
+	if (IS_ENABLED(CONFIG_SWIOTLB_DYNAMIC))
+		return swiotlb_find_pool(dev, paddr);
+	return paddr >= mem->defpool.start && paddr < mem->defpool.end;
 }
 
 static inline bool is_swiotlb_force_bounce(struct device *dev)
diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
index d29cade048db..9596ae1aa0da 100644
--- a/kernel/dma/direct.c
+++ b/kernel/dma/direct.c
@@ -66,7 +66,7 @@ static gfp_t dma_direct_optimal_gfp_mask(struct device *dev, u64 *phys_limit)
 	return 0;
 }
 
-static bool dma_coherent_ok(struct device *dev, phys_addr_t phys, size_t size)
+bool dma_coherent_ok(struct device *dev, phys_addr_t phys, size_t size)
 {
 	dma_addr_t dma_addr = phys_to_dma_direct(dev, phys);
 
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 346857581b75..6e985f65b9f5 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -35,6 +35,7 @@
 #include <linux/memblock.h>
 #include <linux/mm.h>
 #include <linux/pfn.h>
+#include <linux/rculist.h>
 #include <linux/scatterlist.h>
 #include <linux/set_memory.h>
 #include <linux/spinlock.h>
@@ -510,6 +511,211 @@ void __init swiotlb_exit(void)
 	memset(mem, 0, sizeof(*mem));
 }
 
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+
+/**
+ * alloc_dma_pages() - allocate pages to be used for DMA
+ * @gfp:	GFP flags for the allocation.
+ * @bytes:	Size of the buffer.
+ *
+ * Allocate pages from the buddy allocator. If successful, make the allocated
+ * pages decrypted that they can be used for DMA.
+ *
+ * Return: Decrypted pages, or %NULL on failure.
+ */
+static struct page *alloc_dma_pages(gfp_t gfp, size_t bytes)
+{
+	unsigned int order = get_order(bytes);
+	struct page *page;
+	void *vaddr;
+
+	page = alloc_pages(gfp, order);
+	if (!page)
+		return NULL;
+
+	vaddr = page_address(page);
+	if (set_memory_decrypted((unsigned long)vaddr, PFN_UP(bytes)))
+		goto error;
+	return page;
+
+error:
+	__free_pages(page, order);
+	return NULL;
+}
+
+/**
+ * swiotlb_alloc_tlb() - allocate a dynamic IO TLB buffer
+ * @dev:	Device for which a memory pool is allocated.
+ * @bytes:	Size of the buffer.
+ * @phys_limit:	Maximum allowed physical address of the buffer.
+ * @gfp:	GFP flags for the allocation.
+ *
+ * Return: Allocated pages, or %NULL on allocation failure.
+ */
+static struct page *swiotlb_alloc_tlb(struct device *dev, size_t bytes,
+		u64 phys_limit, gfp_t gfp)
+{
+	struct page *page;
+
+	/*
+	 * Allocate from the atomic pools if memory is encrypted and
+	 * the allocation is atomic, because decrypting may block.
+	 */
+	if (!gfpflags_allow_blocking(gfp) && dev && force_dma_unencrypted(dev)) {
+		void *vaddr;
+
+		if (!IS_ENABLED(CONFIG_DMA_COHERENT_POOL))
+			return NULL;
+
+		return dma_alloc_from_pool(dev, bytes, &vaddr, gfp,
+					   dma_coherent_ok);
+	}
+
+	gfp &= ~GFP_ZONEMASK;
+	if (phys_limit <= DMA_BIT_MASK(zone_dma_bits))
+		gfp |= __GFP_DMA;
+	else if (phys_limit <= DMA_BIT_MASK(32))
+		gfp |= __GFP_DMA32;
+
+	while ((page = alloc_dma_pages(gfp, bytes)) &&
+	       page_to_phys(page) + bytes - 1 > phys_limit) {
+		/* allocated, but too high */
+		__free_pages(page, get_order(bytes));
+
+		if (IS_ENABLED(CONFIG_ZONE_DMA32) &&
+		    phys_limit < DMA_BIT_MASK(64) &&
+		    !(gfp & (__GFP_DMA32 | __GFP_DMA)))
+			gfp |= __GFP_DMA32;
+		else if (IS_ENABLED(CONFIG_ZONE_DMA) &&
+			 !(gfp & __GFP_DMA))
+			gfp = (gfp & ~__GFP_DMA32) | __GFP_DMA;
+		else
+			return NULL;
+	}
+
+	return page;
+}
+
+/**
+ * swiotlb_free_tlb() - free a dynamically allocated IO TLB buffer
+ * @vaddr:	Virtual address of the buffer.
+ * @bytes:	Size of the buffer.
+ */
+static void swiotlb_free_tlb(void *vaddr, size_t bytes)
+{
+	if (IS_ENABLED(CONFIG_DMA_COHERENT_POOL) &&
+	    dma_free_from_pool(NULL, vaddr, bytes))
+		return;
+
+	/* Intentional leak if pages cannot be encrypted again. */
+	if (!set_memory_encrypted((unsigned long)vaddr, PFN_UP(bytes)))
+		__free_pages(virt_to_page(vaddr), get_order(bytes));
+}
+
+/**
+ * swiotlb_alloc_pool() - allocate a new IO TLB memory pool
+ * @dev:	Device for which a memory pool is allocated.
+ * @nslabs:	Desired number of slabs.
+ * @phys_limit:	Maximum DMA buffer physical address.
+ * @gfp:	GFP flags for the allocations.
+ *
+ * Allocate and initialize a new IO TLB memory pool.
+ *
+ * Return: New memory pool, or %NULL on allocation failure.
+ */
+static struct io_tlb_pool *swiotlb_alloc_pool(struct device *dev,
+		unsigned int nslabs, u64 phys_limit, gfp_t gfp)
+{
+	struct io_tlb_pool *pool;
+	struct page *tlb;
+	size_t pool_size;
+	size_t tlb_size;
+
+	pool_size = sizeof(*pool) + array_size(sizeof(*pool->areas), 1) +
+		array_size(sizeof(*pool->slots), nslabs);
+	pool = kzalloc(pool_size, gfp);
+	if (!pool)
+		goto error;
+	pool->areas = (void *)pool + sizeof(*pool);
+	pool->slots = (void *)pool->areas + sizeof(*pool->areas);
+
+	tlb_size = nslabs << IO_TLB_SHIFT;
+	tlb = swiotlb_alloc_tlb(dev, tlb_size, phys_limit, gfp);
+	if (!tlb)
+		goto error_tlb;
+
+	swiotlb_init_io_tlb_pool(pool, page_to_phys(tlb), nslabs, true, 1);
+	return pool;
+
+error_tlb:
+	kfree(pool);
+error:
+	return NULL;
+}
+
+/**
+ * swiotlb_dyn_free() - RCU callback to free a memory pool
+ * @rcu:	RCU head in the corresponding struct io_tlb_pool.
+ */
+static void swiotlb_dyn_free(struct rcu_head *rcu)
+{
+	struct io_tlb_pool *pool = container_of(rcu, struct io_tlb_pool, rcu);
+	size_t tlb_size = pool->end - pool->start;
+
+	swiotlb_free_tlb(pool->vaddr, tlb_size);
+	kfree(pool);
+}
+
+/**
+ * swiotlb_find_pool() - find the IO TLB pool for a physical address
+ * @dev:        Device which has mapped the DMA buffer.
+ * @paddr:      Physical address within the DMA buffer.
+ *
+ * Find the IO TLB memory pool descriptor which contains the given physical
+ * address, if any.
+ *
+ * Return: Memory pool which contains @paddr, or %NULL if none.
+ */
+struct io_tlb_pool *swiotlb_find_pool(struct device *dev, phys_addr_t paddr)
+{
+	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
+	struct io_tlb_pool *pool = &mem->defpool;
+
+	if (paddr >= pool->start && paddr < pool->end)
+		return pool;
+
+	/* Pairs with smp_wmb() in swiotlb_find_slots(). */
+	smp_rmb();
+
+	rcu_read_lock();
+	list_for_each_entry_rcu(pool, &dev->dma_io_tlb_pools, node) {
+		if (paddr >= pool->start && paddr < pool->end)
+			goto out;
+	}
+	pool = NULL;
+out:
+	rcu_read_unlock();
+	return pool;
+}
+
+/**
+ * swiotlb_del_pool() - remove an IO TLB pool from a device
+ * @dev:	Owning device.
+ * @pool:	Memory pool to be removed.
+ */
+static void swiotlb_del_pool(struct device *dev, struct io_tlb_pool *pool)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&dev->dma_io_tlb_lock, flags);
+	list_del_rcu(&pool->node);
+	spin_unlock_irqrestore(&dev->dma_io_tlb_lock, flags);
+
+	call_rcu(&pool->rcu, swiotlb_dyn_free);
+}
+
+#endif	/* CONFIG_SWIOTLB_DYNAMIC */
+
 /**
  * swiotlb_dev_init() - initialize swiotlb fields in &struct device
  * @dev:	Device to be initialized.
@@ -517,6 +723,10 @@ void __init swiotlb_exit(void)
 void swiotlb_dev_init(struct device *dev)
 {
 	dev->dma_io_tlb_mem = &io_tlb_default_mem;
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	INIT_LIST_HEAD(&dev->dma_io_tlb_pools);
+	spin_lock_init(&dev->dma_io_tlb_lock);
+#endif
 }
 
 /*
@@ -533,7 +743,7 @@ static unsigned int swiotlb_align_offset(struct device *dev, u64 addr)
 static void swiotlb_bounce(struct device *dev, phys_addr_t tlb_addr, size_t size,
 			   enum dma_data_direction dir)
 {
-	struct io_tlb_pool *mem = &dev->dma_io_tlb_mem->defpool;
+	struct io_tlb_pool *mem = swiotlb_find_pool(dev, tlb_addr);
 	int index = (tlb_addr - mem->start) >> IO_TLB_SHIFT;
 	phys_addr_t orig_addr = mem->slots[index].orig_addr;
 	size_t alloc_size = mem->slots[index].alloc_size;
@@ -799,6 +1009,8 @@ static int swiotlb_pool_find_slots(struct device *dev, struct io_tlb_pool *pool,
 	return -1;
 }
 
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+
 /**
  * swiotlb_find_slots() - search for slots in the whole swiotlb
  * @dev:	Device which maps the buffer.
@@ -806,6 +1018,7 @@ static int swiotlb_pool_find_slots(struct device *dev, struct io_tlb_pool *pool,
  * @alloc_size: Total requested size of the bounce buffer,
  *		including initial alignment padding.
  * @alloc_align_mask:	Required alignment of the allocated buffer.
+ * @retpool:	Used memory pool, updated on return.
  *
  * Search through the whole software IO TLB to find a sequence of slots that
  * match the allocation constraints.
@@ -813,12 +1026,64 @@ static int swiotlb_pool_find_slots(struct device *dev, struct io_tlb_pool *pool,
  * Return: Index of the first allocated slot, or -1 on error.
  */
 static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
-		size_t alloc_size, unsigned int alloc_align_mask)
+		size_t alloc_size, unsigned int alloc_align_mask,
+		struct io_tlb_pool **retpool)
 {
-	return swiotlb_pool_find_slots(dev, &dev->dma_io_tlb_mem->defpool,
+	struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
+	struct io_tlb_pool *pool;
+	unsigned long nslabs;
+	unsigned long flags;
+	u64 phys_limit;
+	int index;
+
+	pool = &mem->defpool;
+	index = swiotlb_pool_find_slots(dev, pool, orig_addr,
+					alloc_size, alloc_align_mask);
+	if (index >= 0)
+		goto found;
+
+	if (!mem->can_grow)
+		return -1;
+
+	nslabs = nr_slots(alloc_size);
+	phys_limit = min_not_zero(*dev->dma_mask, dev->bus_dma_limit);
+	pool = swiotlb_alloc_pool(dev, nslabs, phys_limit,
+				  GFP_NOWAIT | __GFP_NOWARN);
+	if (!pool)
+		return -1;
+
+	index = swiotlb_pool_find_slots(dev, pool, orig_addr,
+					alloc_size, alloc_align_mask);
+	if (index < 0) {
+		swiotlb_dyn_free(&pool->rcu);
+		return -1;
+	}
+
+	pool->transient = true;
+	spin_lock_irqsave(&dev->dma_io_tlb_lock, flags);
+	list_add_rcu(&pool->node, &dev->dma_io_tlb_pools);
+	spin_unlock_irqrestore(&dev->dma_io_tlb_lock, flags);
+
+	/* Pairs with smp_rmb() in swiotlb_find_pool(). */
+	smp_wmb();
+found:
+	*retpool = pool;
+	return index;
+}
+
+#else  /* !CONFIG_SWIOTLB_DYNAMIC */
+
+static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
+		size_t alloc_size, unsigned int alloc_align_mask,
+		struct io_tlb_pool **retpool)
+{
+	*retpool = &dev->dma_io_tlb_mem->defpool;
+	return swiotlb_pool_find_slots(dev, *retpool,
 				       orig_addr, alloc_size, alloc_align_mask);
 }
 
+#endif /* CONFIG_SWIOTLB_DYNAMIC */
+
 #ifdef CONFIG_DEBUG_FS
 
 /**
@@ -899,7 +1164,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
 	}
 
 	index = swiotlb_find_slots(dev, orig_addr,
-				   alloc_size + offset, alloc_align_mask);
+				   alloc_size + offset, alloc_align_mask, &pool);
 	if (index == -1) {
 		if (!(attrs & DMA_ATTR_NO_WARN))
 			dev_warn_ratelimited(dev,
@@ -913,7 +1178,6 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
 	 * This is needed when we sync the memory.  Then we sync the buffer if
 	 * needed.
 	 */
-	pool = &mem->defpool;
 	for (i = 0; i < nr_slots(alloc_size + offset); i++)
 		pool->slots[index + i].orig_addr = slot_addr(orig_addr, i);
 	tlb_addr = slot_addr(pool->start, index) + offset;
@@ -930,7 +1194,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
 
 static void swiotlb_release_slots(struct device *dev, phys_addr_t tlb_addr)
 {
-	struct io_tlb_pool *mem = &dev->dma_io_tlb_mem->defpool;
+	struct io_tlb_pool *mem = swiotlb_find_pool(dev, tlb_addr);
 	unsigned long flags;
 	unsigned int offset = swiotlb_align_offset(dev, tlb_addr);
 	int index = (tlb_addr - offset - mem->start) >> IO_TLB_SHIFT;
@@ -977,6 +1241,41 @@ static void swiotlb_release_slots(struct device *dev, phys_addr_t tlb_addr)
 	dec_used(dev->dma_io_tlb_mem, nslots);
 }
 
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+
+/**
+ * swiotlb_del_transient() - delete a transient memory pool
+ * @dev:	Device which mapped the buffer.
+ * @tlb_addr:	Physical address within a bounce buffer.
+ *
+ * Check whether the address belongs to a transient SWIOTLB memory pool.
+ * If yes, then delete the pool.
+ *
+ * Return: %true if @tlb_addr belonged to a transient pool that was released.
+ */
+static bool swiotlb_del_transient(struct device *dev, phys_addr_t tlb_addr)
+{
+	struct io_tlb_pool *pool;
+
+	pool = swiotlb_find_pool(dev, tlb_addr);
+	if (!pool->transient)
+		return false;
+
+	dec_used(dev->dma_io_tlb_mem, pool->nslabs);
+	swiotlb_del_pool(dev, pool);
+	return true;
+}
+
+#else  /* !CONFIG_SWIOTLB_DYNAMIC */
+
+static inline bool swiotlb_del_transient(struct device *dev,
+					 phys_addr_t tlb_addr)
+{
+	return false;
+}
+
+#endif	/* CONFIG_SWIOTLB_DYNAMIC */
+
 /*
  * tlb_addr is the physical address of the bounce buffer to unmap.
  */
@@ -991,6 +1290,8 @@ void swiotlb_tbl_unmap_single(struct device *dev, phys_addr_t tlb_addr,
 	    (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL))
 		swiotlb_bounce(dev, tlb_addr, mapping_size, DMA_FROM_DEVICE);
 
+	if (swiotlb_del_transient(dev, tlb_addr))
+		return;
 	swiotlb_release_slots(dev, tlb_addr);
 }
 
@@ -1180,11 +1481,10 @@ struct page *swiotlb_alloc(struct device *dev, size_t size)
 	if (!mem)
 		return NULL;
 
-	index = swiotlb_find_slots(dev, 0, size, 0);
+	index = swiotlb_find_slots(dev, 0, size, 0, &pool);
 	if (index == -1)
 		return NULL;
 
-	pool = &mem->defpool;
 	tlb_addr = slot_addr(pool->start, index);
 
 	return pfn_to_page(PFN_DOWN(tlb_addr));
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:17:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:17:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571075.894049 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzvm-00052F-VV; Thu, 27 Jul 2023 12:17:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571075.894049; Thu, 27 Jul 2023 12:17:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzvm-000523-SC; Thu, 27 Jul 2023 12:17:22 +0000
Received: by outflank-mailman (input) for mailman id 571075;
 Thu, 27 Jul 2023 12:17:21 +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
 <SRS0=C0z/=DN=huaweicloud.com=petrtesarik@srs-se1.protection.inumbo.net>)
 id 1qOznW-00079h-Un
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 12:08:50 +0000
Received: from frasgout12.his.huawei.com
 (ecs-14-137-139-154.compute.hwclouds-dns.com [14.137.139.154])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 582bfbf9-2c76-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 14:08:49 +0200 (CEST)
Received: from mail02.huawei.com (unknown [172.18.147.227])
 by frasgout12.his.huawei.com (SkyGuard) with ESMTP id 4RBTjY2Hjzz9yDrs
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 19:55:29 +0800 (CST)
Received: from A2101119013HW2.china.huawei.com (unknown [10.81.209.69])
 by APP2 (Coremail) with SMTP id GxC2BwBnGkGaXcJkfMYUBQ--.33878S9;
 Thu, 27 Jul 2023 13:08:10 +0100 (CET)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 582bfbf9-2c76-11ee-8613-37d641c3527e
From: Petr Tesarik <petrtesarik@huaweicloud.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	xen-devel@lists.xenproject.org (moderated list:XEN HYPERVISOR ARM),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT),
	linux-kernel@vger.kernel.org (open list),
	linux-mips@vger.kernel.org (open list:MIPS),
	iommu@lists.linux.dev (open list:XEN SWIOTLB SUBSYSTEM),
	linux-mm@kvack.org (open list:SLAB ALLOCATOR)
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
	petr@tesarici.cz
Subject: [PATCH v6 7/9] swiotlb: determine potential physical address limit
Date: Thu, 27 Jul 2023 14:05:35 +0200
Message-Id: <db40ccd47440a3f556ee28ae76f4491404530b1f.1690459412.git.petr.tesarik.ext@huawei.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
References: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CM-TRANSID:GxC2BwBnGkGaXcJkfMYUBQ--.33878S9
X-Coremail-Antispam: 1UD129KBjvJXoWxXw4fJr4xAF4rZr4UWr4kWFg_yoW5AF4DpF
	y8Jr4FgFsFqF17ArWxCw1IyFn5Ga10krW29rW5urnxZr17Ww13Wrs7Kr45tryFqF4IgF4S
	9Fyxua4Y9FsFv37anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDU0xBIdaVrnRJUUUQG14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0
	rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYI
	kIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2
	z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F
	4UJwA2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z280aVCY1x0267AKxVWxJr0_
	GcWle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2I
	x0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8
	JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7CjxVA2Y2
	ka0xkIwI1lc7CjxVAaw2AFwI0_Jw0_GFylc7CjxVAKzI0EY4vE52x082I5MxAIw28IcxkI
	7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxV
	Cjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWrXVW8Jr1lIxkGc2Ij64vIr41lIxAI
	cVC0I7IYx2IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJwCI42
	IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280
	aVCY1x0267AKxVW8Jr0_Cr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUwiSLUUUUU=
X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/
X-CFilter-Loop: Reflected

From: Petr Tesarik <petr.tesarik.ext@huawei.com>

The value returned by default_swiotlb_limit() should be constant, because
it is used to decide whether DMA can be used. To allow allocating memory
pools on the fly, use the maximum possible physical address rather than the
highest address used by the default pool.

For swiotlb_init_remap(), this is either an arch-specific limit used by
memblock_alloc_low(), or the highest directly mapped physical address if
the initialization flags include SWIOTLB_ANY. For swiotlb_init_late(), the
highest address is determined by the GFP flags.

Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
 include/linux/swiotlb.h |  2 ++
 kernel/dma/swiotlb.c    | 14 ++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 66867d2188ba..9825fa14abe4 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -109,6 +109,7 @@ struct io_tlb_pool {
  * @force_bounce: %true if swiotlb bouncing is forced
  * @for_alloc:  %true if the pool is used for memory allocation
  * @can_grow:	%true if more pools can be allocated dynamically.
+ * @phys_limit:	Maximum allowed physical address.
  * @total_used:	The total number of slots in the pool that are currently used
  *		across all areas. Used only for calculating used_hiwater in
  *		debugfs.
@@ -123,6 +124,7 @@ struct io_tlb_mem {
 	bool for_alloc;
 #ifdef CONFIG_SWIOTLB_DYNAMIC
 	bool can_grow;
+	u64 phys_limit;
 #endif
 #ifdef CONFIG_DEBUG_FS
 	atomic_long_t total_used;
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 6e985f65b9f5..ca3aa03f37ba 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -334,6 +334,10 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 #ifdef CONFIG_SWIOTLB_DYNAMIC
 	if (!remap)
 		io_tlb_default_mem.can_grow = true;
+	if (flags & SWIOTLB_ANY)
+		io_tlb_default_mem.phys_limit = virt_to_phys(high_memory - 1);
+	else
+		io_tlb_default_mem.phys_limit = ARCH_LOW_ADDRESS_LIMIT;
 #endif
 
 	if (!default_nareas)
@@ -409,6 +413,12 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask,
 #ifdef CONFIG_SWIOTLB_DYNAMIC
 	if (!remap)
 		io_tlb_default_mem.can_grow = true;
+	if (IS_ENABLED(CONFIG_ZONE_DMA) && (gfp_mask & __GFP_DMA))
+		io_tlb_default_mem.phys_limit = DMA_BIT_MASK(zone_dma_bits);
+	else if (IS_ENABLED(CONFIG_ZONE_DMA32) && (gfp_mask & __GFP_DMA32))
+		io_tlb_default_mem.phys_limit = DMA_BIT_MASK(32);
+	else
+		io_tlb_default_mem.phys_limit = virt_to_phys(high_memory - 1);
 #endif
 
 	if (!default_nareas)
@@ -1398,7 +1408,11 @@ phys_addr_t default_swiotlb_base(void)
  */
 phys_addr_t default_swiotlb_limit(void)
 {
+#ifdef CONFIG_SWIOTLB_DYNAMIC
+	return io_tlb_default_mem.phys_limit;
+#else
 	return io_tlb_default_mem.defpool.end - 1;
+#endif
 }
 
 #ifdef CONFIG_DEBUG_FS
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:19:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:19:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571080.894060 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzxw-0005xK-Ef; Thu, 27 Jul 2023 12:19:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571080.894060; Thu, 27 Jul 2023 12:19:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qOzxw-0005xD-9j; Thu, 27 Jul 2023 12:19:36 +0000
Received: by outflank-mailman (input) for mailman id 571080;
 Thu, 27 Jul 2023 12:19:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qOzxu-0005x3-UU
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 12:19:34 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2084.outbound.protection.outlook.com [40.107.7.84])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d86d6be2-2c77-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 14:19:34 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB8PR04MB6972.eurprd04.prod.outlook.com (2603:10a6:10:11c::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Thu, 27 Jul
 2023 12:19:05 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 12:19:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d86d6be2-2c77-11ee-b247-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Kqxa6SLII9UH6AH1Rpm2bzExCy9fiib6GnhZDd8+sFudkPzC3s9vhMSrEZpwwJpulnTSwNXrrIUcrl/hZzPBjc4R69AxUEckHKL/QOYccGJbYRBCYzlzYHp2qKcxfYX8/e4sCkhsqBBkZRYqRAi/FHfZOWoXQshSNGdZ6avXTNw01a83hezg4kGjLm8tTWxMLY6vaOhlSuTZsGrJCgMYbyUVFARqLB5zONJqxx1dTyaKvG0tcz2hJ9NDM8CCDNIe03Mcgo/3YtjVyxrZmI24i6qXr8/fndbSSWSTnmKYoMHsVIrv/To40B2/T5t57uMEVsDNUdLR+nlRaKRvnxKpoQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=py3/I3RJ0McyuR2GdFyoXWdqpNhh7eph6tun7XJltvE=;
 b=G1N2oW73M9/biSglTRgJ8Lne/5NdYIJl0yS3w21d9K2Rw0Mazd3kWANG5WmggTq8u2jkRv3JMODPEgSDnl2dylwqBpDloK0rqu5sUeDicRpIcjXGTB5InrNrNDfxD+kJTG2nR8jAjp2M3lMkNietUJY6PMp+TM1eLnVOOtbZ0iHIm6izOXG1av4YsfUEk9B/LTmutfjUA/P5VxLyvypzcdIZtmIh0LRwtJbYNCz8TapS0hP682a0ezt/UbMlOm7nfTR0+qrkKRVN8A8p093b6grXZja2YF0MMDMhO5Hk8gfxvEtDMTxQ8JgFmiNYRpKmashYLEwW71n5VgQ65PUheA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=py3/I3RJ0McyuR2GdFyoXWdqpNhh7eph6tun7XJltvE=;
 b=HKive4Xbqq9UiUdFNW1oCwUIx46WyfYjUaetDKwEWhCaf5Wesai+mXeWbpJ0Lep9jQblsKV/nqY4raPbCid2YQCoEeJkQoD/Up57oRA4uQPSpWAJ2+0PO6fcFZjRS2zGEP7GDHaCUF47bMhnrCVi6Y5iRCmMySFLgfX+L6CpFIOvjH6SiNUjaAux58uEgBLqGkk2HHfwMfIt+rBXRSAr/ByKNUNfc3XMgQ6DoRnj6JiGlvaHNueBMNbyuWoHv5eTEB1iZcXg34XxAjEMvg79YDZ7xOcae5aQboWMiUUQh8Xj89xQdUFW85X0mSpRVNHwITA2uVV1vgkheQbQKQRvEA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <43c5db82-ce39-bc6d-228d-da2f8d1b147f@suse.com>
Date: Thu, 27 Jul 2023 14:19:02 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 2/4] x86/ioapic: RTE modifications must use
 ioapic_write_entry
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230726125508.78704-1-roger.pau@citrix.com>
 <20230726125508.78704-3-roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230726125508.78704-3-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0050.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4a::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB8PR04MB6972:EE_
X-MS-Office365-Filtering-Correlation-Id: 8c8b38ad-cf28-49ee-2dba-08db8e9bab62
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Pq6MzBC2/juH1pOjSL2LpWrWgtlk44SrV9+m3xynKWMIBcOc2rmPksAKWmG1a4JER23XKvUmTS49V8CiHfJV/QND53wpua9b3CMSRBbDGSctXaZV6GmrzxjcCLgDbVo8y3MtPSrIujIVqDJ/XIJffgRxTMBea753La+FjzXcsZhustnuEPn5Ta0UjLpNk47gKMUcp5Nv/ElfkDr/5tH2VwzecZCHaZGlEgpzOQ6KW0Qd6dlmZTWB9CNh5vylVgYb9e80L1wy7ap9xVocu+blXbbMrSrQH8egojB1NG6AhgHBHDYSCkHMrC8P2pz4W7MQzQm3MmwKzHq7glV1Z2aYxGM/J0Bw37zu0BgKW/Ulc3qmSVd5zul7xfFBB0D6ZidvzK7ui7xpSb/qbUy3jY6E3dLfNLZ4ZYIkoWhAC8BCM15XzBM3ZmHqSEBs9TV9einNQx7XVp3WIFz3nQ0Yd/tH0YP/7/vWobOa4D5gb8zd0IG9WQyKuHBe4k3UzLPF+rECLXzihAfZehNBfVD/Phwk9uJaG66/d4cOfSw528J2+Lw0ZXm1FA8IP3f9BjvK2EiT3AXV79iZQHY7AmcqV3kZUIVMh3s0OPfxN1UnPl3VS/DqVuxBsGNDEtHM5hH+RzTZNcHuNWI1BYBINvDp2bCS9w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(366004)(396003)(346002)(376002)(136003)(451199021)(4326008)(6486002)(478600001)(38100700002)(86362001)(31696002)(6666004)(66556008)(66946007)(66476007)(54906003)(6916009)(316002)(31686004)(6512007)(41300700001)(83380400001)(36756003)(2906002)(2616005)(4744005)(8676002)(8936002)(186003)(6506007)(26005)(53546011)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZzBQa2ZvZUlQbHF0R2xlL3pTS21pcEpveFQ3K283V0JTNzNHSFpYTFBrQ0Ny?=
 =?utf-8?B?VFEzVTVxU21NZmZZWHRXU3BkdmIwTjZXeGdyYk5XeTlxMzZNbmE1OC9LMGts?=
 =?utf-8?B?a0x5ZHd1V29ZMXgwa2JRRXlyS3Q4U1RWTUhWU2J3dTJBbFVmRU83Z1krQUVv?=
 =?utf-8?B?RWU4TlpaU2tMSkpWMFlIZFdlZ2pHWTM3WklHbkFRcnd5aGNiSEFXT3doZ3RD?=
 =?utf-8?B?VWJCMjRGTzVzd0dUYmh0TFpRZ25Pb291WXZYSjBlWDU5UCt5dnYrTGJXcVNj?=
 =?utf-8?B?MkVSbzQzQnNYdTQrR0MzTGRTa2tqTW54eFlXZUVMTzEwOTI0MFVJZll6bUlE?=
 =?utf-8?B?TjlKT2pMOXBKY3VHdG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=
 =?utf-8?Q?EIgIh3g7HdJkQbCDdc23LuZl4?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8c8b38ad-cf28-49ee-2dba-08db8e9bab62
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 12:19:05.1211
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 39eykrHZZN3vGe1yK0E+Qw/JEQG92xdTsFmbW7cxtAohJktPcCqm7WOn5oaNxMLUimNLlFoh9CcRVfeRHidh0Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6972

On 26.07.2023 14:55, Roger Pau Monne wrote:
> Do not allow to write to RTE registers using io_apic_write and instead
> require changes to RTE to be performed using ioapic_write_entry.
> 
> This is in preparation for passing the full contents of the RTE to the
> IOMMU interrupt remapping handlers, so remapping entries for IO-APIC
> RTEs can be updated atomically when possible.
> 
> While immediately this commit might expand the number of MMIO accesses
> in order to update an IO-APIC RTE, further changes will benefit from
> getting the full RTE value passed to the IOMMU handlers, as the logic
> is greatly simplified when the IOMMU handlers can get the complete RTE
> value in one go.
> 
> Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:37:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:37:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571082.894068 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP0Es-0008PE-Qy; Thu, 27 Jul 2023 12:37:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571082.894068; Thu, 27 Jul 2023 12:37:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP0Es-0008P7-Nn; Thu, 27 Jul 2023 12:37:06 +0000
Received: by outflank-mailman (input) for mailman id 571082;
 Thu, 27 Jul 2023 12:37:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qP0Er-0008Ox-Gj; Thu, 27 Jul 2023 12:37:05 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qP0Er-00040G-Cp; Thu, 27 Jul 2023 12:37:05 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qP0Eq-00066S-Qo; Thu, 27 Jul 2023 12:37:04 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qP0Eq-0005u2-Oc; Thu, 27 Jul 2023 12:37:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=PZ7YFAvydma0hwJyuFvsD8XlhJXbMIdJysIoWqDlAXo=; b=7GSOxd/PDg8CuhiDzoiPPi7D5e
	wAYs2mHOiDvCJyzglzfsfEOErIRQdqBUfuv0q0IJnvq9qCfAJnIyRlAn8eGFNdopN158B023V7QCP
	AYuGMEymIiAb3eNZU5qqA+UqGHIomd5M4ihSGg/uuuJl56j5DYxX/jYpb8dEYEZGauvc=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182027-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 182027: regressions - trouble: fail/pass/starved
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-libvirt-vhd:guest-start.2:fail:regression
    xen-unstable:test-amd64-i386-freebsd10-amd64:xen-install:fail:heisenbug
    xen-unstable:test-amd64-i386-freebsd10-i386:xen-install:fail:heisenbug
    xen-unstable:test-amd64-i386-pair:xen-install/dst_host:fail:heisenbug
    xen-unstable:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:hosts-allocate:starved:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:hosts-allocate:starved:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:hosts-allocate:starved:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:hosts-allocate:starved:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:hosts-allocate:starved:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:hosts-allocate:starved:nonblocking
    xen-unstable:test-arm64-arm64-xl:hosts-allocate:starved:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:hosts-allocate:starved:nonblocking
X-Osstest-Versions-This:
    xen=3d2d4ea026df73c37a7df7e216443cbf652ff892
X-Osstest-Versions-That:
    xen=0b1171be87698bc7d14760383c0770aeb6e41dd4
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 27 Jul 2023 12:37:04 +0000

flight 182027 xen-unstable real [real]
flight 182035 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/182027/
http://logs.test-lab.xenproject.org/osstest/logs/182035/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-libvirt-vhd 20 guest-start.2  fail in 182035 REGR. vs. 182012

Tests which are failing intermittently (not blocking):
 test-amd64-i386-freebsd10-amd64  7 xen-install      fail pass in 182035-retest
 test-amd64-i386-freebsd10-i386  7 xen-install       fail pass in 182035-retest
 test-amd64-i386-pair        11 xen-install/dst_host fail pass in 182035-retest
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail pass in 182035-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182012
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 182012
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 182012
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182012
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 182012
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182012
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 182012
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 182012
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 182012
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 182012
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 182012
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182012
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw  3 hosts-allocate               starved  n/a
 test-arm64-arm64-libvirt-xsm  3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl-vhd       3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl-credit2   3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl-credit1   3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl-thunderx  3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl           3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl-xsm       3 hosts-allocate               starved  n/a

version targeted for testing:
 xen                  3d2d4ea026df73c37a7df7e216443cbf652ff892
baseline version:
 xen                  0b1171be87698bc7d14760383c0770aeb6e41dd4

Last test of basis   182012  2023-07-25 19:27:43 Z    1 days
Testing same since   182027  2023-07-26 21:35:59 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Anthony PERARD <anthony.perard@citrix.com>
  Federico Serafini <federico.serafini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Leo Yan <leo.yan@linaro.org>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Roger Pau Monne <roger.pau@citrix.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          starved 
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 starved 
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      starved 
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              fail    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  starved 
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  starved 
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 starved 
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 starved 
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-arm64-arm64-xl-vhd                                      starved 
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 3d2d4ea026df73c37a7df7e216443cbf652ff892
Author: Andrew Cooper <andrew.cooper3@citrix.com>
Date:   Wed Jul 19 13:37:37 2023 +0100

    x86/boot: Update construct_dom0() to take a const char *cmdline
    
    With hvm_copy_to_guest_*() able to use const sources, update construct_dom0()
    and friends to pass a const cmdline pointer.  Nothing in these paths have a
    reason to be modifying the command line passed in.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>

commit 90732a8b4cb554254af473d0e570daf6b8c987a7
Author: Andrew Cooper <andrew.cooper3@citrix.com>
Date:   Wed Jul 19 11:57:46 2023 +0100

    xen/x86: Use const char * for string literals (2)
    
    This hunk was accidentally missing from a previous change.
    
    Fixes: d642c0706678 ("xen/x86: Use const char * for string literals")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>

commit 9895e3374237267697bd505c04810d2d10e42c7b
Author: Andrew Cooper <andrew.cooper3@citrix.com>
Date:   Wed Jul 19 11:30:56 2023 +0100

    x86/hvm: Allow hvm_copy_to_guest_*() to come from const sources
    
    The work to fix MISRA rule 7.4 (using mutable pointers to string literals)
    identifies that string literals do indeed get passed into
    hvm_copy_to_guest_linear() by way of the PVH dom0 command line.
    
    This higlights that the copy_to_* helpers really ought to take a const
    source.  Update the function types to match, and cast away constness in the
    wrappers around __hvm_copy() where HVMCOPY_to_guest is used.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>

commit 9380f06fe82fe1886a8ae468d22b901bd6c4d3d5
Author: Andrew Cooper <andrew.cooper3@citrix.com>
Date:   Tue Jul 25 16:32:35 2023 +0100

    xen: Drop the (almost) unused extern start[]
    
    This global variable is shadowed by plenty local variables, violating MISRA
    rule 5.3.  Some architectures happen to have a symbol by the name of start in
    their head.S's, but it's not a useful symbol to reference from C.
    
    In fact, the single use of the global start[] in RISC-V means to use _start[]
    as the linker symbol at the beginning of the .text section, not the function
    which happens to be in the same location.
    
    Fix RISC-V to use the right symbol for it's calculation, and drop the extern.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

commit 4b2cdbfe766e5666e6754198946df2dc16f6a642
Author: Andrew Cooper <andrew.cooper3@citrix.com>
Date:   Wed May 17 10:13:36 2023 +0100

    x86/cpu-policy: Advertise MSR_ARCH_CAPS to guests by default
    
    With xl/libxl now able to control the policy bits for MSR_ARCH_CAPS, it is
    safe to advertise to guests by default.  In turn, we don't need the special
    case to expose details to dom0.
    
    This advertises MSR_ARCH_CAPS to guests on *all* Intel hardware, even if the
    register content ends up being empty.
    
      - Advertising ARCH_CAPS and not RSBA signals "retpoline is safe here and
        everywhere you might migrate to".  This is important because it avoids the
        guest kernel needing to rely on model checks.
    
      - Alternatively, levelling for safety across the Broadwell/Skylake divide
        requires advertising ARCH_CAPS and RSBA, meaning "retpoline not safe on
        some hardware you might migrate to".
    
    On Cascade Lake and later hardware, guests can now see RDCL_NO (not vulnerable
    to Meltdown) amongst others.  This causes substantial performance
    improvements, as guests are no longer applying software mitigations in cases
    where they don't need to.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>

commit 6d21cedbaa34b3a3856f964189e911112c732b21
Author: Roger Pau Monne <roger.pau@citrix.com>
Date:   Tue Jul 25 15:05:58 2023 +0200

    libxl: add support for parsing MSR features
    
    Introduce support for handling MSR features in
    libxl_cpuid_parse_config().  The MSR policies are added to the
    libxl_cpuid_policy like the CPUID one, which gets passed to
    xc_cpuid_apply_policy().
    
    This allows existing users of libxl to provide MSR related features as
    key=value pairs to libxl_cpuid_parse_config() without requiring the
    usage of a different API.
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>

commit d638fe233cb3a45105319df75df0edfed2fde5a5
Author: Roger Pau Monne <roger.pau@citrix.com>
Date:   Tue Jul 25 15:05:57 2023 +0200

    libxl: use the cpuid feature names from cpufeatureset.h
    
    The current implementation in libxl_cpuid_parse_config() requires
    keeping a list of cpuid feature bits that should be mostly in sync
    with the contents of cpufeatureset.h.
    
    Avoid such duplication by using the automatically generated list of
    cpuid features in INIT_FEATURE_NAMES in order to map feature names to
    featureset bits, and then translate from featureset bits into cpuid
    leaf, subleaf, register tuple.
    
    Note that the full contents of the previous cpuid translation table
    can't be removed.  That's because some feature names allowed by libxl
    are not described in the featuresets, or because naming has diverged
    and the previous nomenclature is preserved for compatibility reasons.
    
    Should result in no functional change observed by callers, albeit some
    new cpuid features will be available as a result of the change.
    
    While there constify cpuid_flags name field.
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

commit e2b1da9b8fda0ed7d3dca7bd15829cfea496973a
Author: Roger Pau Monne <roger.pau@citrix.com>
Date:   Tue Jul 25 15:05:56 2023 +0200

    libxl: split logic to parse user provided CPUID features
    
    Move the CPUID value parsers out of libxl_cpuid_parse_config() into a
    newly created cpuid_add() local helper.  This is in preparation for
    also adding MSR feature parsing support.
    
    No functional change intended.
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

commit 5b80cecb747b2176b9e85f6e7aa7be83416d77e1
Author: Roger Pau Monne <roger.pau@citrix.com>
Date:   Wed Jul 26 09:47:53 2023 +0200

    libxl: introduce MSR data in libxl_cpuid_policy
    
    Add a new array field to libxl_cpuid_policy in order to store the MSR
    policies.
    
    Adding the MSR data in the libxl_cpuid_policy_list type is done so
    that existing users can seamlessly pass MSR features as part of the
    CPUID data, without requiring the introduction of a separate
    domain_build_info field, and a new set of handlers functions.
    
    Note that support for parsing the old JSON format is kept, as that's
    required in order to restore domains or received migrations from
    previous tool versions.  Differentiation between the old and the new
    formats is done based on whether the contents of the 'cpuid' field is
    an array or a map JSON object.
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

commit 4825d19603580949144ac2ac5cb22df75c9da954
Author: Roger Pau Monne <roger.pau@citrix.com>
Date:   Tue Jul 25 15:05:54 2023 +0200

    libxl: change the type of libxl_cpuid_policy_list
    
    Currently libxl_cpuid_policy_list is an opaque type to the users of
    libxl, and internally it's an array of xc_xend_cpuid objects.
    
    Change the type to instead be a structure that contains one array for
    CPUID policies, in preparation for it also holding another array for
    MSR policies.
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

commit ed742cf1b65c822759833027ca5cbb087c506a41
Author: Roger Pau Monne <roger.pau@citrix.com>
Date:   Tue Jul 25 15:05:53 2023 +0200

    libs/guest: introduce support for setting guest MSRs
    
    Like it's done with CPUID, introduce support for passing MSR values to
    xc_cpuid_apply_policy().  The chosen format for expressing MSR policy
    data matches the current one used for CPUID.  Note that existing
    callers of xc_cpuid_apply_policy() can pass NULL as the value for the
    newly introduced 'msr' parameter in order to preserve the same
    functionality, and in fact that's done in libxl on this patch.
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>

commit 1f8a6a99b225d34cf608f47b2938092e310f9e03
Author: Nicola Vetrini <nicola.vetrini@bugseng.com>
Date:   Mon Jul 24 18:19:19 2023 +0200

    docs/misra: document the usage of array range initializers
    
    The usage of a documented GNU extension that allows a range of elements
    in an array to be initalized to the same value using a designated
    initalizer is added to this document, to fully comply with
    MISRA C:2012 Rule 1.1.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

commit 89d7903172fee953b7c112160f67959f6de4731f
Author: Leo Yan <leo.yan@linaro.org>
Date:   Mon Jul 24 16:52:11 2023 +0800

    docs: Correct name for xen-command-line.pandoc
    
    In the commit d661611d08 ("docs/markdown: Switch to using pandoc, and
    fix underscore escaping"), the documentation suffix was changed from
    ".markdown" to ".pandoc"; however, the reference was missed to update.
    
    This patch updates the documentation name to xen-command-line.pandoc.
    
    Fixes: d661611d08 ("docs/markdown: Switch to using pandoc, and fix underscore escaping")
    Signed-off-by: Leo Yan <leo.yan@linaro.org>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

commit 1b631a67ac2a70474cc5e43794551f0536dde2ef
Author: Federico Serafini <federico.serafini@bugseng.com>
Date:   Tue Jul 25 16:43:02 2023 +0200

    xen/cpu: change parameter name in __cpu_up() declaration
    
    Change parameter name from 'cpunum' to 'cpu' to keep consistency with
    the name used in the corresponding definitions thus addressing a
    violation of MISRA C:2012 Rule 8.3: "All declarations of an object or
    function shall use the same names and type qualifiers".
    
    No functional changes.
    
    Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:39:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:39:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571087.894079 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP0Gw-0000bh-BM; Thu, 27 Jul 2023 12:39:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571087.894079; Thu, 27 Jul 2023 12:39:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP0Gw-0000ba-89; Thu, 27 Jul 2023 12:39:14 +0000
Received: by outflank-mailman (input) for mailman id 571087;
 Thu, 27 Jul 2023 12:39:13 +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 <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qP0Gv-0000bM-3p
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 12:39:13 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0616.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::616])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9539809a-2c7a-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 14:39:10 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8687.eurprd04.prod.outlook.com (2603:10a6:102:21e::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.31; Thu, 27 Jul
 2023 12:39:08 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 12:39:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9539809a-2c7a-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=bB7+SeppzjIyGokXlOA386uv8mrBWdRiNQoX00+VZJjMKDb3wi9VR1g/jHfIt7bb0AAA3jfcAiuzSa+2QA+YGoM/gtuEDBI9SF/y/2LAg5a8rq/e3Z6D0m7j8XjfKSF674vtRVZ4zMC74nYNQsH6/VNVFgiu7EXw42YO2jLExIeSzQk/pJmGrvQIkgT4h+RwN4Z+ncWtzuZCAOVsqGymShAVfAVb4iUE3VeBPIVtudpqZPSQm2xf0fT38UdtmBbdycCaMklvWpS0TiTBUNkyhMftoF3j6SGYU1ektjY3W3X57Dq23i8CZ6yLSBE2y+jlOd+EerLGtlMdoymf8AYYgQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=K6mkdkdr4r5BVy0TMe2X1PQgvDzBaPJ1o0ejzkHUdZU=;
 b=n+a6cxz6er5XJsu2fJ28mSTwRktL+eQTkNERq9AKCn/7xLDPJuDrhi29QCqhoz0QMzzE7fbyoL8kqoz4B2wV5sIdY+jpa1YTTwFqxPCDcx0mt/yLJrdyUERyqsxXqxKFKFcM/5Qqw9PgYkapU/pH1Gq6JZ1gg0IenExDKKUqwV2j2PsdwavkGWOdr9mE1S3b0DHEQzxD8hd3bV2dV8xqKoL9NN0mWCVSfnsBBmp7kNFTzIckS5U9mSGM6Df9qXE5oWtvJFJZmMhxg3i7I/4Q8yP06WGbYD0rGqU2wFkWzYDZdVCzo97pF+yJrex5gIGTGCQcD+99ZbKEzQ/Q0prIrw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=K6mkdkdr4r5BVy0TMe2X1PQgvDzBaPJ1o0ejzkHUdZU=;
 b=llegw4A8f9LmUoB04t5V4u5kmRsZ4Jl5gawSUR/oezEfTU3rzsr3GO/tihVGrtLgW28lB6kVZh0Ou1vjcF061paus/Xp7cAyykxUWrtoyKGODCt/h2j8v8y/UmfsCrnQj9SyGu4F1txVEl9Stmu4SvCGtFxUYgqS2kPQjOnlylCCTLFy3+ijy3S6+eMAKo1GkqEoQGFahAvCCiiLkRNA0E4dVlhFPcK8UcO9EXaYW0/3HDfhYrdKzu2v6fTyH7c4opAtYq/53tQ+OugncegxSTwUsIq9RLunwHd0DF4FcjZzUHvCYDq1+p5bLOXhEs5e2jQzdmNjBjGtxho4gTseVA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <4e9681c7-472e-ee6b-38e7-fc7fb28a2b07@suse.com>
Date: Thu, 27 Jul 2023 14:39:06 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 4/4] x86/iommu: pass full IO-APIC RTE for remapping
 table update
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 Kevin Tian <kevin.tian@intel.com>, Paul Durrant <paul@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230726125508.78704-1-roger.pau@citrix.com>
 <20230726125508.78704-5-roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230726125508.78704-5-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0021.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:14::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8687:EE_
X-MS-Office365-Filtering-Correlation-Id: ff0a5b80-08ad-4987-92ee-08db8e9e7879
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	7H5KSAF4rLaCTl+ZmmRYvuAoPzKp2BiHhsAHoUsZEuw1Jf5F3tQxnFJXSa6D2SCP6NWcmop6B58jYaTf8Fv5k0714XvSKS0/nOt2MclFeD4+g9LPLCXMpQYiUF1txqZ+WcMZmyfatrgc5c+k0WBSAzpWgW6f3V+uSzMJeAeh5wHXG7BkcRWXbosI1jZaofzuQ4lQA156CQfn2XY9CwTdj9SPOvfTcmxFCgZnYl+kWM/6+Onk+v52BuCoLPF21yLrEPH31H7RYq9lwdy4lFoS5MIhngERMh1ycyI0yY1EXRVCceAMt2dBPDCfwkef0k86rBpY++SDri2D5H9l5fp76tA4YaSwphky5e4DEnUaT4rn47AYo0iN/crRfV29UiqGpKwtSvZ5uxTTL74tp0nGi1AqGwz2mjM7UqpklQdddHsj0S8tVvIc3Kxc+Jpuu8Q7NdvJ/RZ5SBOJuoeCr++sJyUfsoISi8bEa91Ns1mSkXxS0yixXO0LCct4kRcSeqesusgVhyb79Sms5l5YdixUpPI5vnqPmLNgtGA8bBR0H8CyiJMTV4XeFaP598u8A1JK2io2zb6K4gwUNHYKKOkkoEnIJVS1r8ZQNgIYDpkV6rBSyJy6366HcLjFMdc4xubzSp+K8zsKvFq1PF9ClfNPqA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(396003)(39860400002)(346002)(136003)(366004)(451199021)(53546011)(6506007)(8676002)(31686004)(8936002)(5660300002)(41300700001)(316002)(54906003)(2906002)(478600001)(15650500001)(6486002)(6512007)(186003)(26005)(2616005)(66556008)(6916009)(4326008)(66476007)(66946007)(38100700002)(83380400001)(31696002)(36756003)(86362001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SEt4dHorajVKZjMxeWg3dkhGbTJUMG5BaFFlem5ENVJ4TUZsdWZ6OC92S21O?=
 =?utf-8?B?WVNYNThvZnFkamxFbVFIZGM0ckVjcThQb1RTcUg5VEEyRjU2bi9MK0RlM3dN?=
 =?utf-8?B?cHU0blAza3Zub0lka1hjQnZOQisrbmxEVFd4N2NTb2EwMmRIbjhFY0hCMkxr?=
 =?utf-8?B?WDkrWlhuT2pMZXZzVFFMREVzM3JiMk9x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=?utf-8?B?VTJSYm11UlMwRWlxSGZqYUVMOXdieFZlT3g4cnBKNHZkcjFOQUlzVVBia0d4?=
 =?utf-8?B?NHRMME94bCtPL1JqSXNrejJnVVJKL3UwcTNQZ1F6aUYyZ3lUODJaS2pMa3dk?=
 =?utf-8?B?c3hxM2xiV0crSUFkTk5oSm9XVll0ZW1jb1NMLzhTL1d2bTh4UW9obTAxRnR3?=
 =?utf-8?Q?KCGIPog+e6lKW2trQowWqPj3/?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ff0a5b80-08ad-4987-92ee-08db8e9e7879
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 12:39:08.1298
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: mI6KjuzJVb89sSty/7nTVcRjyjs7aTkflXlL2MFg/Kmna+Eh3Z8tk1ZSON4PGmpd30rWaliJ3PoOQG2Pe0gwLQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8687

On 26.07.2023 14:55, Roger Pau Monne wrote:
> --- a/xen/drivers/passthrough/vtd/extern.h
> +++ b/xen/drivers/passthrough/vtd/extern.h
> @@ -92,7 +92,7 @@ int cf_check intel_iommu_get_reserved_device_memory(
>  unsigned int cf_check io_apic_read_remap_rte(
>      unsigned int apic, unsigned int reg);
>  void cf_check io_apic_write_remap_rte(
> -    unsigned int apic, unsigned int reg, unsigned int value);
> +    unsigned int apic, unsigned int ioapic_pin, uint64_t rte);

Forgot to rename the middle parameter to "pin"?

> @@ -364,48 +363,40 @@ static int ioapic_rte_to_remap_entry(struct vtd_iommu *iommu,
>  
>      new_ire = *iremap_entry;
>  
> -    if ( rte_upper )
> -    {
> -        if ( x2apic_enabled )
> -            new_ire.remap.dst = value;
> -        else
> -            new_ire.remap.dst = (value >> 24) << 8;
> -    }
> +    if ( x2apic_enabled )
> +        new_ire.remap.dst = new_rte.dest.dest32;
>      else
> -    {
> -        *(((u32 *)&new_rte) + 0) = value;
> -        new_ire.remap.fpd = 0;
> -        new_ire.remap.dm = new_rte.dest_mode;
> -        new_ire.remap.tm = new_rte.trigger;
> -        new_ire.remap.dlm = new_rte.delivery_mode;
> -        /* Hardware require RH = 1 for LPR delivery mode */
> -        new_ire.remap.rh = (new_ire.remap.dlm == dest_LowestPrio);
> -        new_ire.remap.avail = 0;
> -        new_ire.remap.res_1 = 0;
> -        new_ire.remap.vector = new_rte.vector;
> -        new_ire.remap.res_2 = 0;
> -
> -        set_ioapic_source_id(IO_APIC_ID(apic), &new_ire);
> -        new_ire.remap.res_3 = 0;
> -        new_ire.remap.res_4 = 0;
> -        new_ire.remap.p = 1;     /* finally, set present bit */
> -
> -        /* now construct new ioapic rte entry */
> -        remap_rte->vector = new_rte.vector;
> -        remap_rte->delivery_mode = 0;    /* has to be 0 for remap format */
> -        remap_rte->index_15 = (index >> 15) & 0x1;
> -        remap_rte->index_0_14 = index & 0x7fff;
> -
> -        remap_rte->delivery_status = new_rte.delivery_status;
> -        remap_rte->polarity = new_rte.polarity;
> -        remap_rte->irr = new_rte.irr;
> -        remap_rte->trigger = new_rte.trigger;
> -        remap_rte->mask = new_rte.mask;
> -        remap_rte->reserved = 0;
> -        remap_rte->format = 1;    /* indicate remap format */
> -    }
> -
> -    update_irte(iommu, iremap_entry, &new_ire, !init);
> +        new_ire.remap.dst = (new_rte.dest.dest32 >> 24) << 8;

I realize this was this way before, but I wonder if we couldn't use
GET_xAPIC_ID() here to reduce the open-coding at least a bit.

> @@ -439,36 +430,45 @@ unsigned int cf_check io_apic_read_remap_rte(
>  }
>  
>  void cf_check io_apic_write_remap_rte(
> -    unsigned int apic, unsigned int reg, unsigned int value)
> +    unsigned int apic, unsigned int pin, uint64_t rte)
>  {
> -    unsigned int pin = (reg - 0x10) / 2;
> +    struct IO_xAPIC_route_entry new_rte = { .raw = rte };
>      struct IO_xAPIC_route_entry old_rte = { };
> -    struct IO_APIC_route_remap_entry *remap_rte;
> -    unsigned int rte_upper = (reg & 1) ? 1 : 0;
>      struct vtd_iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic));
> -    int saved_mask;
> -
> -    old_rte = __ioapic_read_entry(apic, pin, true);
> +    bool masked = true;
> +    int rc;
>  
> -    remap_rte = (struct IO_APIC_route_remap_entry *) &old_rte;
> -
> -    /* mask the interrupt while we change the intremap table */
> -    saved_mask = remap_rte->mask;
> -    remap_rte->mask = 1;
> -    __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
> -    remap_rte->mask = saved_mask;
> -
> -    if ( ioapic_rte_to_remap_entry(iommu, apic, pin,
> -                                   &old_rte, rte_upper, value) )
> +    if ( !cpu_has_cx16 )
>      {
> -        __io_apic_write(apic, reg, value);
> +       /*
> +        * Cannot atomically update the IRTE entry: mask the IO-APIC pin to
> +        * avoid interrupts seeing an inconsistent IRTE entry.
> +        */
> +        old_rte = __ioapic_read_entry(apic, pin, true);
> +        if ( !old_rte.mask )
> +        {
> +            masked = false;
> +            old_rte.mask = 1;
> +            __ioapic_write_entry(apic, pin, true, old_rte);
> +        }
> +    }
>  
> -        /* Recover the original value of 'mask' bit */
> -        if ( rte_upper )
> -            __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
> +    rc = ioapic_rte_to_remap_entry(iommu, apic, pin, &old_rte, new_rte);
> +    if ( rc )
> +    {
> +        if ( !masked )
> +        {
> +            /* Recover the original value of 'mask' bit */
> +            old_rte.mask = 0;
> +            __ioapic_write_entry(apic, pin, true, old_rte);
> +        }
> +        dprintk(XENLOG_ERR VTDPREFIX,
> +                "failed to update IRTE for IO-APIC#%u pin %u: %d\n",
> +                apic, pin, rc);

Afaics you don't alter the error behavior of ioapic_rte_to_remap_entry(),
and in the sole (pre-existing) case of an error a debug log message is
already being issued. Why the addition?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:42:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:42:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571090.894092 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP0K5-00026Y-Rn; Thu, 27 Jul 2023 12:42:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571090.894092; Thu, 27 Jul 2023 12:42:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP0K5-00026R-Oe; Thu, 27 Jul 2023 12:42:29 +0000
Received: by outflank-mailman (input) for mailman id 571090;
 Thu, 27 Jul 2023 12:42:28 +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
 <SRS0=Us1z=DN=citrix.com=prvs=565118259=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qP0K4-00026L-4h
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 12:42:28 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 08cc2772-2c7b-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 14:42:25 +0200 (CEST)
Received: from mail-co1nam11lp2176.outbound.protection.outlook.com (HELO
 NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.176])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 27 Jul 2023 08:42:22 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB5520.namprd03.prod.outlook.com (2603:10b6:a03:282::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 12:42:19 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 12:42:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 08cc2772-2c7b-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690461745;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=tT01BO+6pZ0K95n2d3qfa/Og89jetBzBgBbkoOt+KEY=;
  b=V65QnHGLFl+ykihfVcmW1P6C9LYUGtfmn2S1rG7sKn9N+e6FKtnuG3Gt
   VGXthHkyxF0+lQa7Wnfoky3SlGcLmcMZaX2UefImdBpCQmIppK2NgecjA
   fB+9XTQD9Q/v4hOswVx3aS3o8jYVfntLadLK8kzEMYI27wN5V/ljtr3kR
   A=;
X-IronPort-RemoteIP: 104.47.56.176
X-IronPort-MID: 117515624
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:+gKot6kchDMRalz5mPHExqvo5gxRJ0RdPkR7XQ2eYbSJt1+Wr1Gzt
 xIXDGyFb6yKZjTxco9xbYS29k0AuMfRyIBjS1Np/nw1QiMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5gCGzhH5MbpETU2PByqgKmVrNrbSq
 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/
 f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3
 cElcR9WUyKRu8e34qyXVMU8lsV9I9a+aevzulk4pd3YJdAPZMmaBo7tvJpf1jp2gd1SF/HDY
 cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVkVI3ieezWDbWUoXiqcF9hEGXq
 3iA523kKhobKMae2XyO9XfEaurnxHqkBdtPSufknhJsqFSx9l4PB0EYbECcodKgzXXjRclOF
 GVBr0LCqoB3riRHVOLVYRq8p3KVuw8GbPBZGeY69QKlx7Ld5kCSAW1sZi5MbpkqudE7QRQu1
 0SVhJX5CDp3qrqXRHmBsLCOoluaHiwYLnQLYyMeeiID78P+u4E4jh/JTdFLHba8i5v+HjSY6
 zKAoTU6hr4TpdUWzKj99lfC6w9AvbDMRw8xow7QB2Ss61ogYJb/PtP2r1/G8fxHMYCVCEGbu
 2QJkNSf6+ZICoyRkCuKQ6MGG7TBC+u5DQAwSGVHR/EJnwlBMVb5FWyMyFmS/HtUD/s=
IronPort-HdrOrdr: A9a23:JYNnsq/5Ch1ycsOCKC1uk+DWI+orL9Y04lQ7vn2ZKCY4TiX8ra
 uTdZsguiMc5Ax+ZJhDo7C90di7IE80nKQdieN9AV7IZniEhILHFvAG0aLShxHmBi3i5qp8+M
 5bAsxD4QTLfDpHsfo=
X-Talos-CUID: 9a23:GGzv8mywo9IN2RxYIzfnBgUpJ5kKKUDv3kv1Im2mJXhFGK2UF1CPrfY=
X-Talos-MUID: 9a23:wa0N4gttDRKbGtdTDM2njRNSBttnv6qXE2cNuoxBgJSaLj1PEmLI
X-IronPort-AV: E=Sophos;i="6.01,234,1684814400"; 
   d="scan'208";a="117515624"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BLOsyd404x6sfyyPc/1jB4AAvBV73sRzfIs2P9O7FPC0TK0J3Pgra977OXiU0/4k0WgzvgfsJlXmdkQfunfDo7mKGAKygDg6LfQzzKCQwgsduaNsueG9Bf6wrY0l/3gkHV2sbkC0BwZ7FT3IAlj2sM+B+5OUn2XbGnq4mgaUUQxK5tvQRA7DAUbdiZcWyAtDergEc/LrcFMrQQpWe/bB+QtEsNHvYPobG5gW/b0GtXu+tA0q++KnRV4z6P+397skC0KqVYVaXBa9mKv/3bI1Vn0Uma2y624F2hg1el9Aq1js+7eOlrQznzfICHwf7hm6MPFjEf3W7t9vikduVb8O5w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=SJ3a0uXBdTHpYgXCnmACqT6AUpH6uOJ4f4rF7bN8EbQ=;
 b=YgbmDAuoijM6iZfkU613vxMbhhri25yLLrJK/FMYrGvh5zzh/UKuVwpCyoAcLqY8PC3L4gO13F+XLHpoA1Y98hV7MYeDUIKEykI7B5kJjbIiiJ6btI8Z/2ABQoyM4WO5lcOJYTAaPCBZKu2VY39v99qXR0oGRupBEPzFvHnsnVVinEqhi/Yo2BSJWMGWEecajleQtwX9VXZQDEf0H0rf/SseNhTfN9a4mssgsMQ7Rfdqi7q+2sEOUwl6FEeLNq006I+IM0YipLPdWarVOpHAS5Ss9gzInF+ZRF6K6Vd8uMNCNCMl5tu6Vt0158IeNQ37O+H/SbhgrZpjC587d/7VqA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=SJ3a0uXBdTHpYgXCnmACqT6AUpH6uOJ4f4rF7bN8EbQ=;
 b=kbSejF4+ouQ/nlhlooYm7jsnhhFV5+A578SvUC8rMksz/JzPVTBUWcMqLSsucEscypb1tHN4fhkfRXnRz8XZQWjWgj4qnXa57G8jZ1JaMNm/sYrWhH6kCHBhW9uyFwRJgnvF4a5o/NN1fseQk8z7GPMx2YYMr2iDupjdeDtUNlU=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Thu, 27 Jul 2023 14:42:13 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Message-ID: <ZMJmJTkSFLKZXkKB@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local>
 <87ila7cvy2.fsf@epam.com>
 <ZMDox0WwumxMGnzV@MacBook-Air-de-Roger.local>
 <87y1j2b296.fsf@epam.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <87y1j2b296.fsf@epam.com>
X-ClientProxiedBy: LO4P123CA0638.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:296::18) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5520:EE_
X-MS-Office365-Filtering-Correlation-Id: e24ee93f-0a76-448e-4a20-08db8e9eea6e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Jo7sapzQ6XOJY7XRhDK1c0utei3WbxqcNKeSMtrlU/7qaz0zwZykZxc4OVEVXabhv1/sS7gPRZZ2ir25HqH+O+GG+0M/gqD9pTYDN7PBRrUSS9xfPCy97U6IwCIDEx73MB5mhGB3VGwDXZWdOmozyCLJjRJ3ZERRS0xxudpcQ9RsZoTAmK8Wl6z0aLPTYDY+1roWvoU5/U5yfY1v3qOJeiWAXczwYHFe+wHBbJKMjqPyre4cI5gzIrTAf/X4cxeV4Tvw/2G9NzEBuNgbwJ0KURb5gjuZqbOinxzhTdF0jkcuvJR0xkEWsz8Xxbzy3HuGvVgW5dDh+E7hTVHOwpMN0y6J/AkueIF+zym1NQe+x9DIEOpEfoS3CW9cHnjbRXcLWwXC+FpeK1I3+YFu3eO+jwjGqoQF1+2uX3DVRlWJga4pdb6p+QOccaQhMlCVvVbbSVVGJUpy2h8q2b4Lq78/dMXAUErgKo99PDFw6J5nByX4+egvRMN+y/JRP1xBZmf30FANC03Np0zguqWTZUGRRNMS4v0v4tNChYa3+OowTQJPWZvojjn7rIggMAkV6msZ
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(366004)(136003)(396003)(39860400002)(451199021)(2906002)(83380400001)(6506007)(26005)(186003)(6512007)(6666004)(9686003)(6486002)(478600001)(54906003)(86362001)(66946007)(38100700002)(41300700001)(4326008)(66476007)(66556008)(8676002)(6916009)(316002)(85182001)(8936002)(5660300002)(82960400001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RHk0cjZpbjFaVDQvR2JZUHV5RkxUN2lsYno1VEQ2V0lkdGl6SmdjdDg1dTFt?=
 =?utf-8?B?ZWJ6OUpzZzRzQ295a0k3NFNySzFqOHFBUkhJOGh6S09CZEFqMlk2OERFQk14?=
 =?utf-8?B?VU9GT1AwUnVtd3dOL05tY1dzZDJJa0xyTGpBeG9TT2F1R1A2MTRraTRrZTRY?=
 =?utf-8?B?YzkxMVd3SDkyM3paZlNvUGMvOFd1Q3psRWhUaTQ0bjYzbkczR0ZsZHJXam1R?=
 =?utf-8?B?L2xvVlUvR2VnNklZb1FsWkdDMUpVMVdtSStOYm5qelh5cGZ6UHB6ZWh6Tms2?=
 =?utf-8?B?VTd6V3FXUjJsOVMwbmw2Ykc4YlF6SnhjeWUzZmVLWGluRERGcVBGdW9JOWlV?=
 =?utf-8?B?V1VLQ29JbjVkMkRIVld6dDBDZHdMbFphc3NpZWprQnFua3h1ZzMrTE0rVGFB?=
 =?utf-8?B?UkQ3dFE1aUhqWWxrSkVZZ1lwM1JzSS9yekhISTlIcXcrcE9jOXBKWmM0Nmps?=
 =?utf-8?B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vhQbuZr4BaCRgS/v3Hbyxs/0frOAUY19qo1BrvmQ4ym4LclgaRP06gyNWir6Yjui+SrvOerqaEpATVSNjs1Toi3SGgqUdn7dbHz9hHKVQqIvnckvVVCr4+f9UECJPCi4qqvkuV1SkpI46BvLZeAy56AUnLKew+tjEK0VdN+GB9RzFH32RCFufkc6pYZheYb4aWNlg05PbbLWdBgMbz2Sd55rMRLJW6egci+3jmrH6BVzhzIkxpklI9WmGGBYqqm8t6RWH/t9sHfdxuq+53ZvcZZ3Px3l8H57XBLmqYGUCIS9Qc/LuwbA8/lutQzHH91mOt/xqMQwFl2k+LitzQeYE2hMu1NvQ4xtXZYUMTTJJ8tiLDmsA+PR1vFj/lSuUbr1HoqubCCI7+KOGd/+qkm8S2GjKl5bBaChoMz8de5NeisIyH5nfBbhVoEdTJzoyynMBbrlkORXf1+uy2fvDkYlsyvziR8JnKdj/p5yOe4eU73CJAwrzZNFUJC3wQroy/bXzGMeu3w/2RA1faqiGr6BwoYPDVD1IWK4l/P69uNrLCVTlleV6D7PlNJy0RyYWBJFDTiCS+C3i2X9XbTQR0PVBjn/18SkU3hPK8H/qDEstShVMsDktuWVbHinaVDDZX1dYAvX8fzFjWsFf9ZUMAJ0WnHnJmjS1u284Z6T8t2/fFbDQXiLquU/CHBS1wDBRxJzzpfQpcib7doWBkTSEk/ce/1bSY4ZJHuzPy/Gqc0lPenYz75TSUQnF6IbC/Tjab1DvYREgpwHTg2UMFbwCmQGXR6eAMn+8NeMhvw5Ma37497O1OKQZ0g==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e24ee93f-0a76-448e-4a20-08db8e9eea6e
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 12:42:19.5280
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 6dPyS9XohzHjnJvDr54179eCSuAXPuh2s0XwzFxdJEqa0j5M+IDgpVLySYrUdYNHHAsJT4LoPctCa6BkMQ1Ljg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5520

On Thu, Jul 27, 2023 at 12:56:54AM +0000, Volodymyr Babchuk wrote:
> Hi Roger,
> 
> Roger Pau MonnÃ© <roger.pau@citrix.com> writes:
> 
> > On Wed, Jul 26, 2023 at 01:17:58AM +0000, Volodymyr Babchuk wrote:
> >> 
> >> Hi Roger,
> >> 
> >> Roger Pau MonnÃ© <roger.pau@citrix.com> writes:
> >> 
> >> > On Thu, Jul 20, 2023 at 12:32:31AM +0000, Volodymyr Babchuk wrote:
> >> >> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> >> >> @@ -498,6 +537,7 @@ void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
> >> >>          ASSERT(data_offset < size);
> >> >>      }
> >> >>      spin_unlock(&pdev->vpci->lock);
> >> >> +    unlock_locks(d);
> >> >
> >> > There's one issue here, some handlers will cal pcidevs_lock(), which
> >> > will result in a lock over inversion, as in the previous patch we
> >> > agreed that the locking order was pcidevs_lock first, d->pci_lock
> >> > after.
> >> >
> >> > For example the MSI control_write() handler will call
> >> > vpci_msi_arch_enable() which takes the pcidevs lock.  I think I will
> >> > have to look into using a dedicated lock for MSI related handling, as
> >> > that's the only place where I think we have this pattern of taking the
> >> > pcidevs_lock after the d->pci_lock.
> >> 
> >> I'll mention this in the commit message. Is there something else that I
> >> should do right now?
> >
> > Well, I don't think we want to commit this as-is with a known lock
> > inversion.
> >
> > The functions that require the pcidevs lock are:
> >
> > pt_irq_{create,destroy}_bind()
> > unmap_domain_pirq()
> >
> > AFAICT those functions require the lock in order to assert that the
> > underlying device doesn't go away, as they do also use d->event_lock
> > in order to get exclusive access to the data fields.  Please double
> > check that I'm not mistaken.
> 
> You are right, all three function does not access any of PCI state
> directly. However...
> 
> > If that's accurate you will have to check the call tree that spawns
> > from those functions in order to modify the asserts to check for
> > either the pcidevs or the per-domain pci_list lock being taken.
> 
> ... I checked calls for PT_IRQ_TYPE_MSI case, there is only call that
> bothers me: hvm_pi_update_irte(), which calls IO-MMU code via
> vmx_pi_update_irte():
> 
> amd_iommu_msi_msg_update_ire() or msi_msg_write_remap_rte().

That path is only for VT-d, so strictly speaking you only need to worry
about msi_msg_write_remap_rte().

msi_msg_write_remap_rte() does take the IOMMU intremap lock.

There are also existing callers of iommu_update_ire_from_msi() that
call the functions without the pcidevs locked.  See
hpet_msi_set_affinity() for example.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:44:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:44:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571092.894102 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP0MD-0002fe-81; Thu, 27 Jul 2023 12:44:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571092.894102; Thu, 27 Jul 2023 12:44:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP0MD-0002fX-43; Thu, 27 Jul 2023 12:44:41 +0000
Received: by outflank-mailman (input) for mailman id 571092;
 Thu, 27 Jul 2023 12:44:39 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qP0MB-0002fN-HD; Thu, 27 Jul 2023 12:44:39 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qP0MB-00048n-ER; Thu, 27 Jul 2023 12:44:39 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qP0MB-0006IS-18; Thu, 27 Jul 2023 12:44:39 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qP0MB-0005pU-0f; Thu, 27 Jul 2023 12:44:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=2IdY4sGauMHnz1I94x71E4X5MEIZZ6yHRkQctyEy6XQ=; b=aGufLMk24Nv+DKjyiJY9Uv7KdG
	+GXn8Fnl7s3h7fj9DB+y+TPdhIQHptaEZg47N6hyRYbGQ81EIqirSqRYIn1RYwlWqk1h832TJDNEa
	aOuj5Mbf7WULe54uLMKJfzQ2Wg5XjMm0qztR+OHmuAz4Vh92gOoxCyiP0auTHsdPx/co=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182034-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 182034: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=baa6ea7003868d1a339d06b17fd32d41b851d571
X-Osstest-Versions-That:
    xen=f126d7eeba33a1de04f6d9f6f64855637d4eadb9
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 27 Jul 2023 12:44:39 +0000

flight 182034 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182034/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  baa6ea7003868d1a339d06b17fd32d41b851d571
baseline version:
 xen                  f126d7eeba33a1de04f6d9f6f64855637d4eadb9

Last test of basis   182028  2023-07-26 23:00:27 Z    0 days
Testing same since   182034  2023-07-27 08:02:11 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Juergen Gross <jgross@suse.com>
  Peter Hoyes <Peter.Hoyes@arm.com>
  Rahul Singh <rahul.singh@arm.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>
  Shawn Anastasio <sanastasio@raptorengineering.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   f126d7eeba..baa6ea7003  baa6ea7003868d1a339d06b17fd32d41b851d571 -> smoke


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:49:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:49:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571097.894111 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP0QX-0003NY-Sm; Thu, 27 Jul 2023 12:49:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571097.894111; Thu, 27 Jul 2023 12:49:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP0QX-0003NR-Q4; Thu, 27 Jul 2023 12:49:09 +0000
Received: by outflank-mailman (input) for mailman id 571097;
 Thu, 27 Jul 2023 12:49:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=RfsC=DN=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1qP0QW-0003NI-SP
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 12:49:08 +0000
Received: from sender4-of-o50.zoho.com (sender4-of-o50.zoho.com
 [136.143.188.50]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f86ae24c-2c7b-11ee-b247-6b7b168915f2;
 Thu, 27 Jul 2023 14:49:07 +0200 (CEST)
Received: from [10.10.1.94] (static-72-81-132-2.bltmmd.fios.verizon.net
 [72.81.132.2]) by mx.zohomail.com
 with SMTPS id 1690462139210449.8481161213351;
 Thu, 27 Jul 2023 05:48:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f86ae24c-2c7b-11ee-b247-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; t=1690462142; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=dnoQPrYiHPPLOxwGAcYcofmkUjP3ItGMvhnkMLn7EphKl2yKCz+/OlXWRR1GcBdSAAHftwXZ64PcpknidwP3KF9Zv19p+GJaJHD4GBcDeG/8tfX87ZTOAMTlK7yewseaM9NmibE5sg7SouIvWkwrmKsARr9SZJWB6M5qKuoknVk=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1690462142; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; 
	bh=U4OgksLwKETUt92RReTzYX3lBc8bkN1xCWlJgO8PJcQ=; 
	b=jcu5Q/wIIRa2vl0UHo8hU/SeFnWNopM++77gSsXkpdpxzw3EpII1qYlKKAnTUDnu/BR/U4IBpVdcjfMF8FC/tSr4r3ST4tffVVpHSrp4BAK3v+YB8m7/lRCGv6pahQrIGABHo70K3CGs0V+ALFQksFPdG8DAOO5Z8XFNu7gVTb4=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1690462142;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To;
	bh=U4OgksLwKETUt92RReTzYX3lBc8bkN1xCWlJgO8PJcQ=;
	b=vHb+MbohXwMfVv38iFs2CTzhoLHC8DmaPd+n11OUQlvZdIkkFpZTspD9eEiRlNY9
	eDui1TGYZKBqxwaXPiFPDvlIKQslw5VA3ff/MygdJtEKLGhwh15ZSMe40gs2PRE5vDq
	LIR66yc4LLc+aEkuS9xXQLZw9Rdz/DE8MUqv5M44=
Message-ID: <32a22c57-1333-47b0-c61d-abff8d7df112@apertussolutions.com>
Date: Thu, 27 Jul 2023 08:48:56 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [PATCH 03/10] x86 setup: change bootstrap map to accept new boot
 module structures
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, stefano.stabellini@amd.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Luca Fancellu <luca.fancellu@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Rich Persaud <persaur@gmail.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Christopher Clark <christopher.w.clark@gmail.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
 <20230701071835.41599-4-christopher.w.clark@gmail.com>
 <alpine.DEB.2.22.394.2307081144340.761183@ubuntu-linux-20-04-desktop>
 <CACMJ4GYE6PW1SY35dhs4XkXd9ru25igrvMCrh4pJMWEBNNz0YQ@mail.gmail.com>
 <CACMJ4Gb_ZwKSjP7qzfQj98YQjSpBdFuWzeGQJUNNqst0GdXCOw@mail.gmail.com>
 <4e0a0fc9-0c1b-4725-5692-de67ee68a980@suse.com>
 <2994c9b8-c803-1fd9-20df-0d25d2b66c49@apertussolutions.com>
 <ca85fd2e-45a5-32c3-cb4b-1042be6c6915@suse.com>
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
In-Reply-To: <ca85fd2e-45a5-32c3-cb4b-1042be6c6915@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External



On 7/27/23 07:58, Jan Beulich wrote:
> On 27.07.2023 13:46, Daniel P. Smith wrote:
>>
>>
>> On 7/21/23 02:14, Jan Beulich wrote:
>>> On 21.07.2023 00:12, Christopher Clark wrote:
>>>> On Thu, Jul 13, 2023 at 11:51â€¯PM Christopher Clark <
>>>> christopher.w.clark@gmail.com> wrote:
>>>>
>>>>>
>>>>>
>>>>> On Sat, Jul 8, 2023 at 11:47â€¯AM Stefano Stabellini <sstabellini@kernel.org>
>>>>> wrote:
>>>>>
>>>>>> On Sat, 1 Jul 2023, Christopher Clark wrote:
>>>>>>> To convert the x86 boot logic from multiboot to boot module structures,
>>>>>>> change the bootstrap map function to accept a boot module parameter.
>>>>>>>
>>>>>>> To allow incremental change from multiboot to boot modules across all
>>>>>>> x86 setup logic, provide a temporary inline wrapper that still accepts a
>>>>>>> multiboot module parameter and use it where necessary. The wrapper is
>>>>>>> placed in a new arch/x86 header <asm/boot.h> to avoid putting a static
>>>>>>> inline function into an existing header that has no such functions
>>>>>>> already. This new header will be expanded with additional functions in
>>>>>>> subsequent patches in this series.
>>>>>>>
>>>>>>> No functional change intended.
>>>>>>>
>>>>>>> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
>>>>>>> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
>>>>>>>
>>>>>>
>>>>>> [...]
>>>>>>
>>>>>>> diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
>>>>>>> index b72ae31a66..eb93cc3439 100644
>>>>>>> --- a/xen/include/xen/bootinfo.h
>>>>>>> +++ b/xen/include/xen/bootinfo.h
>>>>>>> @@ -10,6 +10,9 @@
>>>>>>>    #endif
>>>>>>>
>>>>>>>    struct boot_module {
>>>>>>> +    paddr_t start;
>>>>>>> +    size_t size;
>>>>>>
>>>>>> I think size should be paddr_t (instead of size_t) to make sure it is
>>>>>> the right size on both 64-bit and 32-bit architectures that support
>>>>>> 64-bit addresses.
>>>>>>
>>>>>
>>>>> Thanks, that explanation does make sense - ack.
>>>>>
>>>>
>>>> I've come back to reconsider this as it doesn't seem right to me to store a
>>>> non-address value (which this will always be) in a type explicitly defined
>>>> to hold an address: addresses may have architectural alignment requirements
>>>> whereas a size value is just a number of bytes so will not. The point of a
>>>> size_t value is that size_t is defined to be large enough to hold the size
>>>> of any valid object in memory, so I think this was right as-is.
>>>
>>> "Any object in memory" implies virtual addresses (or more generally addresses
>>> which can be used for accessing objects). This isn't the case when considering
>>> physical addresses - there may be far more memory in a system than can be made
>>> accessible all in one go.
>>
>> That is not my understanding of it, but I could be wrong. My
>> understanding based on all the debates I have read online around this
>> topic is that the intent in the spec is that size_t has to be able to
>> hold a value that represents the largest object the CPU can manipulate
>> with general purpose operations. From which I understand to mean as
>> large as the largest register a CPU instruction may use for a size
>> argument to a general purpose instruction. On x86_64, that is a 64bit
>> register, as I don't believe the SSE/AVX registers are counted even
>> though the are used by compiler/libc implementations to optimize some
>> memory operations.
> 
> I can't see how this relates to my earlier remark.

Perhaps I misunderstood what your point was then. I thought you were 
taking the position that size_t could not be used to represent the 
largest object in memory addressable by a single CPU operation.

>>   From what I have seen for Xen, this is currently reflected in the x86
>> code base, as size_t is 32bits for the early 32bit code and 64bits for
>> Xen proper.
>>
>> That aside, another objection I have to the use of paddr_t is that it is
>> type abuse. Types are meant to convey context to the intended use of the
>> variable and enable the ability to enforce proper usage of the variable,
>> otherwise we might as well just use u64/uint64_t and be done. The
>> field's purpose is to convey a size of an object,
> 
> You use "object" here again, when in physical address space (with paging
> enabled) this isn't an appropriate term.

Because that is the language used in the C spec to refer to instances in 
memory,

"Object: region of data storage in the execution environment, the 
contents of which can represent values"

ISO/IEC 9899:1999(E) - 3.14: 
https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf



With the following two interpretations of the spec for size_t to mean 
(any emphasis being mine),


"size_t is an unsigned integer type used to represent the size of any 
**object** (including arrays) in the particular implementation."

Wikipedia - size_t: https://en.wikipedia.org/wiki/C_data_types#stddef.h


"size_t can store the maximum size of a theoretically possible 
**object** of any type (including array)."

CPP Ref - size_t: (https://en.cppreference.com/w/c/types/size_t)


>> and labeling it a type
>> that is intended for physical address objects violates both intents
>> behind declaring a type, it asserts an invalid context and enables
>> violations of type checking.
> 
> It is type abuse to a certain extent, yes, but what do you do? We could
> invent psize_t, but that would (afaics) always match paddr_t. uint64_t
> otoh may be too larger for 32-bit platforms which only know a 32-bit
> wide physical address space.

Why invent a new type? That is the purpose of `size_t`, and it should be 
of the correct size, otherwise Xen's implementation is incorrect (which 
it is not).

dps


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:54:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:54:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571099.894122 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP0Va-0004pD-FW; Thu, 27 Jul 2023 12:54:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571099.894122; Thu, 27 Jul 2023 12:54:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP0Va-0004p6-Bc; Thu, 27 Jul 2023 12:54:22 +0000
Received: by outflank-mailman (input) for mailman id 571099;
 Thu, 27 Jul 2023 12:54:21 +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 <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qP0VZ-0004oz-8b
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 12:54:21 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2061c.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::61c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b327a6b9-2c7c-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 14:54:19 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB9186.eurprd04.prod.outlook.com (2603:10a6:102:232::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 12:54:17 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 12:54:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b327a6b9-2c7c-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=jb26wsM5ZPewlc7jy8IDlpUwpVDQout/CGm/h7TlkrzZlqu6CXC9/1vfF+bwEeonanDPBpUl4WpOn2r0qgVJyXjNKCArQRCpcbJ0Mjp0Wvj5pUaCSN+UwwAi+O3Q+JDw+C/U0iihpHp0A3HdOJgAPHrXgXbvA9VSTd1zzxq7IkhntkY+7kvz8MS1EhUar+wh0DcD/6vlYYhoNj32BQEuiXOOTPxIzAqimcved7QwcbbYIvf9YyXlTDvTD9PpVyEr9mfS0WzBpftQYTmgvnMlXrgxv5u8B0hu65PPbg3TzBRA5N4qGxVE9kgCEo9EulThDjIoMNmunRjre/9Kujceyw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=hZqKODGiIbEg0iNIQxY5CQvG63OHcDBu6UTgRDLULsU=;
 b=c3gNTCi7MX24Xxfz2zlt6ZKRvzYXqLxzH+XCxpqUu9rygGV2HuWx2OI/HWNA/Jg2yR/DLyfD+xG7f8sq2hxE+vvwWaQzX358YuB26HlFCdIIcneBtSyJ0ywuBU2Q69ziOaYeql2qKKxiTZvEK4calfYl9J+ZNQMqHXEcVU430HB1gxr+vUyMjaNwIftm0LOQr2gkkUHoGcM20AcGMAT8AU/MuG9D9vOOlzxvjOggsbD5HzXd82PCDC57SSIlzGj7IEXNUG4kPrytwA5FI6BfU+6OqGk7yEbd8qzCvO7qhB87bkezojXmCibEazQLqaRTULHzbVjQyy/XpFTur5HMEA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=hZqKODGiIbEg0iNIQxY5CQvG63OHcDBu6UTgRDLULsU=;
 b=q+AMHBRTtwBPPQJaH1MyByI6+Yajl7T9v651tNs86/6oA8p7IBdGXRCLKtqlnjLgf8FWpQxjKkMhPuzgi97/WqJSiZue90z7ZQYO7SUugyrLeumf7zn5Fgdi4m5qZPxymbUFKEDbSXcuWoXmmZzxEC7u9/vKyrr85U4b5WLkGcK8FGxj89EqZTzVN2v5cM/PDN4vYgF4C8A/qpNsvxYyfCV3FBjU6hEr1mquhxBdWDpKmR4amdJFH3RPowNBvB830P4dZ6hSIyz+C0XEhm3SjGDECEFL9sRH+sUYd5AKhw82aG+ZIH8H9BXMToe2r0Oc7oppuuRndgwcCOL4sMrEVA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <7ab3c4ae-3903-29de-ba32-d328b426d104@suse.com>
Date: Thu, 27 Jul 2023 14:54:14 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 03/10] x86 setup: change bootstrap map to accept new boot
 module structures
Content-Language: en-US
To: "Daniel P. Smith" <dpsmith@apertussolutions.com>
Cc: xen-devel@lists.xenproject.org, stefano.stabellini@amd.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Luca Fancellu <luca.fancellu@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Rich Persaud <persaur@gmail.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Christopher Clark <christopher.w.clark@gmail.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
 <20230701071835.41599-4-christopher.w.clark@gmail.com>
 <alpine.DEB.2.22.394.2307081144340.761183@ubuntu-linux-20-04-desktop>
 <CACMJ4GYE6PW1SY35dhs4XkXd9ru25igrvMCrh4pJMWEBNNz0YQ@mail.gmail.com>
 <CACMJ4Gb_ZwKSjP7qzfQj98YQjSpBdFuWzeGQJUNNqst0GdXCOw@mail.gmail.com>
 <4e0a0fc9-0c1b-4725-5692-de67ee68a980@suse.com>
 <2994c9b8-c803-1fd9-20df-0d25d2b66c49@apertussolutions.com>
 <ca85fd2e-45a5-32c3-cb4b-1042be6c6915@suse.com>
 <32a22c57-1333-47b0-c61d-abff8d7df112@apertussolutions.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <32a22c57-1333-47b0-c61d-abff8d7df112@apertussolutions.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0103.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a9::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB9186:EE_
X-MS-Office365-Filtering-Correlation-Id: 9bc58950-824e-454b-f4cc-08db8ea09622
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	A0vwkPgBx/nl3D96vHeA7W/H4QOc1+XdOyvkn6LB0gFQ0R0UaC1osoTWSpAsZK+gWR0wo+dGfBw3Plw7ztRsQUf46B5+yX2HQme6hDc2Iujr2vl1fGNlhZXc5M7qVw/BoEBC5WcsdLAiyMPELU/aLZHWMXOPc8uvF81AOGL2SILEUjD0Tq2dv++RAhC9cYSH/BOQ94sHHK7PJ1JedWBCWz6wW0gxeHMYzPPp3df/vX57AvYR5x2JigSyAJZYdxy8UA3z1u/zd7MQVKwVvRpg+gOsFIYtKU05nYtNKEbZf1qk5N0/JI8BSZCQm6Qh7Vd3GmkDa9i9uTx6Vj8zsyhDM/Tlp/2bePOrq2N/rogeH64hg8+ugrpfUWdb/BNKpQzW1QoNfg4f/JRbK5GyLQUqlNZOQ38LcwSmbw1sZOZEcVYLxzOckIuuTbZUbfMieq5kxrmeuYHZkp4qGDaUgZNcxAgJc0oebg0cR57gdD7TkWYPbdKswvhOLvnxPcPUt3FxbBlVPnSPV5inKO+SnAkmt0XWwV7ws/58y42nkLsFf3h7eflVUSYQMmGTrPC9cXtMexPEvV8evwE5SddoS1Wv8xTLPBsptjPmUV+P7b/3/9B0OFgHT0ZfNXdEYGmVkhN9/rees5K5v3+RK8zb0W3QIQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(346002)(396003)(136003)(39860400002)(451199021)(2906002)(66899021)(41300700001)(316002)(7416002)(5660300002)(8936002)(8676002)(36756003)(31696002)(86362001)(966005)(6512007)(53546011)(6506007)(26005)(478600001)(6666004)(6486002)(83380400001)(186003)(2616005)(31686004)(38100700002)(6916009)(4326008)(66476007)(66946007)(66556008)(54906003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dUpWK0hxNnlKVUZNL0xQYjdWMXlRbzVmZkdOSjhNM0hLRUtjcnpCRG5oRjg1?=
 =?utf-8?B?dFBsWUxjRUhPYlNLVHBIZnZ2cG5QNnM2bmZoVU5LYnZzKzBZK3JycEMwQW5x?=
 =?utf-8?B?cHVJSHVjQTZVejlTNkpVSWxBdDJ3QjVWMU0vVFhxem1MUUdRYjJYQ2NQeFJM?=
 =?utf-8?B?SWREZnZXd3VNc1ZlNGVCaVhpTFZnZVUwNFJxV2FkUVJoMXBxMmY5aXNPUk5K?=
 =?utf-8?B?NmJ1a09oNVYvSmxzTjlOMkEvNnlMK2lxc0hKUVVkc1V4Lzg4Z0xnMmRyalQ4?=
 =?utf-8?B?ekNFL3NFaC94TlRWcnp6UGU5NzIwMkhhMXM3NThpL2tIWnhTS3dJTzBqYXFI?=
 =?utf-8?B?TW5XWHRMR1pLVTFhdWhNWmw4emJpYXdhcWdhWTJ1YWJYaXBwWmlSSVFzRVBT?=
 =?utf-8?B?MGVubXZCQUkzOFBYZWdRVldZSy9SanpSYTdCbzlzMUF0dlhLOENQdXpOYzgx?=
 =?utf-8?B?b2lnNElyK0FqbldCVVRCdE5uTU5mak9oaDFvSFRjVW1IZWlWZ2dad2NhL3RP?=
 =?utf-8?B?K01jSFh2TUVrYytjUjNJbTFjRVk2SnFjKzVTS0g5VzFMUzdqbFM4eWZhWmJ1?=
 =?utf-8?B?Nzc2eXdxeTBXdDhDek5HVE15M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JCS0VBZTAzV0xS?=
 =?utf-8?B?aXFNTVJYVzF1NW01aHYzNHlXYU41TlUvRVdZSGplRU9LZkpOcG9OZ3NTZW5J?=
 =?utf-8?B?NEhZdW1KeUE4MXpQUmZSZUNkTkI5bzJQT2o1aHp5QU9vMmNtaUhHMmdNVTlu?=
 =?utf-8?B?bERJajMzZEhNNE51endYakllUGFZbndsb1I3K1NCWkIwWkxqREtGSVZLZnRK?=
 =?utf-8?B?MGdUYnBmOGxrazhEMS9NZ3FLNDU4VDU0QnVSMjhxdTFLZnk3TGNadlY1QXBI?=
 =?utf-8?B?NGtrVEJ1djdCc09RWkZHalVqOTJHb1VlSUlhc2hTYzIyUGIrYjBKYWMxLy8z?=
 =?utf-8?B?b0pkaWt3VkZSY3U3Ylc2bXBKa3I2SERTSzd0V0hlS2ZBMkRJc1BqdS9sWFVu?=
 =?utf-8?B?NDJRMGwxVXRvWkN1KzlSNXRPWGpNNEhoenVxWkNPbDlvOTJsenNtZkJrb0RM?=
 =?utf-8?B?V1RtdDN5NHFmSVBWQlpIVWVxTXB2VzZPcHJZK3NxeWkyZmtHMEJOZGNaTmpk?=
 =?utf-8?B?Sld4elNRcU04V1Z5TUpPT2hNZlptZDNHM3Eyd3ExS241QktGaTdrRUFCcnVM?=
 =?utf-8?B?dncwZlFMRWJ0OFBIcUNLVDZZamd6SDRYNjJUeTdndGdLVlIrT1h5ZVNjUEpa?=
 =?utf-8?Q?MU+1VwrmzHkytSB6PHmt5z1qC?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9bc58950-824e-454b-f4cc-08db8ea09622
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 12:54:16.9052
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 2locTVLxDqn45vxGjLyD7biYxq2Xd7PuqBTqOQzQvxkw1Vs2eiOqVP8t7mDY+xrKBCsWBnZ/W/IdqFE6zTDVFQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9186

On 27.07.2023 14:48, Daniel P. Smith wrote:
> On 7/27/23 07:58, Jan Beulich wrote:
>> On 27.07.2023 13:46, Daniel P. Smith wrote:
>>> On 7/21/23 02:14, Jan Beulich wrote:
>>>> On 21.07.2023 00:12, Christopher Clark wrote:
>>>>> On Thu, Jul 13, 2023 at 11:51â€¯PM Christopher Clark <
>>>>> christopher.w.clark@gmail.com> wrote:
>>>>>> On Sat, Jul 8, 2023 at 11:47â€¯AM Stefano Stabellini <sstabellini@kernel.org>
>>>>>> wrote:
>>>>>>> On Sat, 1 Jul 2023, Christopher Clark wrote:
>>>>>>>> To convert the x86 boot logic from multiboot to boot module structures,
>>>>>>>> change the bootstrap map function to accept a boot module parameter.
>>>>>>>>
>>>>>>>> To allow incremental change from multiboot to boot modules across all
>>>>>>>> x86 setup logic, provide a temporary inline wrapper that still accepts a
>>>>>>>> multiboot module parameter and use it where necessary. The wrapper is
>>>>>>>> placed in a new arch/x86 header <asm/boot.h> to avoid putting a static
>>>>>>>> inline function into an existing header that has no such functions
>>>>>>>> already. This new header will be expanded with additional functions in
>>>>>>>> subsequent patches in this series.
>>>>>>>>
>>>>>>>> No functional change intended.
>>>>>>>>
>>>>>>>> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
>>>>>>>> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
>>>>>>>>
>>>>>>>
>>>>>>> [...]
>>>>>>>
>>>>>>>> diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
>>>>>>>> index b72ae31a66..eb93cc3439 100644
>>>>>>>> --- a/xen/include/xen/bootinfo.h
>>>>>>>> +++ b/xen/include/xen/bootinfo.h
>>>>>>>> @@ -10,6 +10,9 @@
>>>>>>>>    #endif
>>>>>>>>
>>>>>>>>    struct boot_module {
>>>>>>>> +    paddr_t start;
>>>>>>>> +    size_t size;
>>>>>>>
>>>>>>> I think size should be paddr_t (instead of size_t) to make sure it is
>>>>>>> the right size on both 64-bit and 32-bit architectures that support
>>>>>>> 64-bit addresses.
>>>>>>>
>>>>>>
>>>>>> Thanks, that explanation does make sense - ack.
>>>>>>
>>>>>
>>>>> I've come back to reconsider this as it doesn't seem right to me to store a
>>>>> non-address value (which this will always be) in a type explicitly defined
>>>>> to hold an address: addresses may have architectural alignment requirements
>>>>> whereas a size value is just a number of bytes so will not. The point of a
>>>>> size_t value is that size_t is defined to be large enough to hold the size
>>>>> of any valid object in memory, so I think this was right as-is.
>>>>
>>>> "Any object in memory" implies virtual addresses (or more generally addresses
>>>> which can be used for accessing objects). This isn't the case when considering
>>>> physical addresses - there may be far more memory in a system than can be made
>>>> accessible all in one go.
>>>
>>> That is not my understanding of it, but I could be wrong. My
>>> understanding based on all the debates I have read online around this
>>> topic is that the intent in the spec is that size_t has to be able to
>>> hold a value that represents the largest object the CPU can manipulate
>>> with general purpose operations. From which I understand to mean as
>>> large as the largest register a CPU instruction may use for a size
>>> argument to a general purpose instruction. On x86_64, that is a 64bit
>>> register, as I don't believe the SSE/AVX registers are counted even
>>> though the are used by compiler/libc implementations to optimize some
>>> memory operations.
>>
>> I can't see how this relates to my earlier remark.
> 
> Perhaps I misunderstood what your point was then. I thought you were 
> taking the position that size_t could not be used to represent the 
> largest object in memory addressable by a single CPU operation.

No. I was trying to clarify that we're talking about physical addresses
here. Which you still seem to have trouble with, ...

>>>   From what I have seen for Xen, this is currently reflected in the x86
>>> code base, as size_t is 32bits for the early 32bit code and 64bits for
>>> Xen proper.
>>>
>>> That aside, another objection I have to the use of paddr_t is that it is
>>> type abuse. Types are meant to convey context to the intended use of the
>>> variable and enable the ability to enforce proper usage of the variable,
>>> otherwise we might as well just use u64/uint64_t and be done. The
>>> field's purpose is to convey a size of an object,
>>
>> You use "object" here again, when in physical address space (with paging
>> enabled) this isn't an appropriate term.
> 
> Because that is the language used in the C spec to refer to instances in 
> memory,
> 
> "Object: region of data storage in the execution environment, the 
> contents of which can represent values"
> 
> ISO/IEC 9899:1999(E) - 3.14: 
> https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf
> 
> 
> 
> With the following two interpretations of the spec for size_t to mean 
> (any emphasis being mine),
> 
> 
> "size_t is an unsigned integer type used to represent the size of any 
> **object** (including arrays) in the particular implementation."
> 
> Wikipedia - size_t: https://en.wikipedia.org/wiki/C_data_types#stddef.h
> 
> 
> "size_t can store the maximum size of a theoretically possible 
> **object** of any type (including array)."
> 
> CPP Ref - size_t: (https://en.cppreference.com/w/c/types/size_t)

... according to all of this and ...

>>> and labeling it a type
>>> that is intended for physical address objects violates both intents
>>> behind declaring a type, it asserts an invalid context and enables
>>> violations of type checking.
>>
>> It is type abuse to a certain extent, yes, but what do you do? We could
>> invent psize_t, but that would (afaics) always match paddr_t. uint64_t
>> otoh may be too larger for 32-bit platforms which only know a 32-bit
>> wide physical address space.
> 
> Why invent a new type? That is the purpose of `size_t`, and it should be 
> of the correct size, otherwise Xen's implementation is incorrect (which 
> it is not).

... this. What C talks about is what the CPU can address (within a single
address space, i.e. normally virtual addresses). With 32-bit addresses
you can address at most 4G, when the system you're running on may have
much more memory. Yet in an OS or hypervisor you need to deal with this
larger amount of memory, no matter that you can't address all of it in
one go.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 12:56:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 12:56:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571101.894131 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP0Xa-0005On-Qz; Thu, 27 Jul 2023 12:56:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571101.894131; Thu, 27 Jul 2023 12:56:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP0Xa-0005Og-Nq; Thu, 27 Jul 2023 12:56:26 +0000
Received: by outflank-mailman (input) for mailman id 571101;
 Thu, 27 Jul 2023 12:56:24 +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 <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qP0XY-0005OY-S6
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 12:56:24 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on0625.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::625])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fcf22a49-2c7c-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 14:56:23 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8635.eurprd04.prod.outlook.com (2603:10a6:20b:43e::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Thu, 27 Jul
 2023 12:56:20 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 12:56:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fcf22a49-2c7c-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=fgEt9xEKaAo6eCf8PWEnAFRtzgfo/c9K8pl1dSvj4fVVTZzblgWHrEX/aNARZurZ1ZOrejq/aZpEXk2P97Ywd2QLyqTX6n+Tk2ngybQo6poQ2HQwH9zkKFJGDZNqAm46sAoMueGrerHBN9vDh2SG26D6QOrLUkPfdTtGSnj+KTrrqQo0ALateLavrPWtWvFg7KzNqfJ3DKS7ihZqc423U6yehND9s/M6Cevs0/bnELz6mLOU6p//lvUndllQ/wk3TtQ/SQiDCTprQMdfAmuHVt33yO/vxdqXqOq/zx46QyHQMazWxB3s7OPp8dMf2fWgFIjkOfjo7519/PxVa3BnWA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=mqTuOxqdRYjcFhoJ8Ynhuoq/e9E9lNi+vjuzPxL93Os=;
 b=Hw6c0KmtDgmuNixl5Rq6HXXhE6AhZHExAdONH84Nz5Xn5Qkbja3E9frsqxeS7V2BF3pC18g7fG7ecy259m+aq3tZtwzqBFdYZEWz+Z5cU3qz/XqB22eRs3MwmZLASAy45ltaZ4NRNhdaV/9gMUEUz5spmf3z/BY+D5ynsmsq1daDV0dfpbuFKj4pWBnDvuQyRRGBeTneWwF/sczBbvg2GhmEYEhxtvE8hqWhZZaC2ZOPZm3oRh0/UurUaIwmFnHTQg357pBFY7FQrvwnW0EiElY05PCrAiz/OiQO/LiGI4p1GIX+XISRMpd5TVhYZqNGeHW5YWDpk2GNiKW9yZ6wmw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=mqTuOxqdRYjcFhoJ8Ynhuoq/e9E9lNi+vjuzPxL93Os=;
 b=G4kttvHc83KycHlDRscZCp3FqbFhPCxwTGev0mmbz7f4EqGpisB27PPZdg2PNwL3QWEGp+x4RdjJPhLM03qHJ33wq8HN5atJ2zrDwKHA5EzTMMohISx251TIYtlvYd+FwaCq+hh22NgSSWQXK6Ot3eEgTIM6P4cNuhZkwXYhZFfz5eAz52MP2NchKrQfoLC+cDIdC+STKfYQe89ZaRY7Y8ipucUGm2qCr2FSCvQh86YvBq3m+2avQ3P08apPg6njdhupkhPXeC3Z7dBmppfaA3Cnkc/cWAmcYlOZupVlQN2/2mBN2+vasQosx9KSMpr7zko//QEI06lPw0n7KB3XUw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <bef5cab4-023d-468e-bac0-2c71528dca81@suse.com>
Date: Thu, 27 Jul 2023 14:56:18 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local> <87ila7cvy2.fsf@epam.com>
 <ZMDox0WwumxMGnzV@MacBook-Air-de-Roger.local> <87y1j2b296.fsf@epam.com>
 <ZMJmJTkSFLKZXkKB@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZMJmJTkSFLKZXkKB@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0121.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:97::19) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8635:EE_
X-MS-Office365-Filtering-Correlation-Id: 134d3c55-15e9-43a2-d858-08db8ea0dfeb
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	9J8cO7D/GhUQjIceX5EJDkVCoTvxz+ZWiy7G7EUphjQ7newW9h1PpZI6Zs7Q2Rlkkz47zKAF4Pf999lvkLpvW0cDIZnMwfosgRhnwM0RMqGycoodeQqofA2csdYfKwO6D8knXH/WMmKDwW2BxvrZ4jKHIWXBTgw39f8S8qNWYUrFBY9L7eVVuVUoqTNthw/zXOEDnxY1uBSafCN2YnL9BvBBzP8Ow3yqs0zWe8JSXXjmrP/8mNEZE5h2Gt+C7CCStwb1qWEDJlKv3GkOpBTlhzUoiefMl6XFhVZGcY1co6mncwGgT25+idH12/EFE0/h6DZHeSRJKVM3dabsFhX8Dxj7VniAyvtEt89Wd/nP1WE5tAPUrfJXNbwO8B0zZMpvQUishD7ecNKXa8yF0eI192z8ADQ9sTVgfoSkLxxoOdZf619fuX0zB3anq7vYEDrM93VCdt+6eIZTtxKleKTqEo1gdwXMXZAGmMRbiLMjA1RUnupRhWQv+ZRy4BSh4yZa+Kk/xtkKifJj3D57Aviq96RXnhFh0Dz7Z4ljs2haJdYRfH2GJ/QhF+YPTqf6bLbJl21IWWbohKxHCbA1LD+fG3tX/15BZhENX13SahaTgsXYZsk4wAbHQRwdYOPdn/hE/DVNaMBh3Ewkcee0jp1pdw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(39860400002)(136003)(346002)(376002)(451199021)(5660300002)(8676002)(31686004)(41300700001)(8936002)(316002)(2906002)(54906003)(478600001)(186003)(6486002)(6506007)(6512007)(26005)(53546011)(66946007)(2616005)(6916009)(66476007)(66556008)(4326008)(38100700002)(83380400001)(36756003)(558084003)(86362001)(31696002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NlQzd1g2SkV6Y3JLSGxUWWswRm4yT0hhaTRhUnBuMnZLNENkQlFpaW5wMGxU?=
 =?utf-8?B?ckp0aFhQc2JYZHlGY21jaGVlalFBd0g4aUtIMis3R3hYSlRabExLZnJnT2Jk?=
 =?utf-8?B?akI3WGk1RFovS01vcGZFQXJFcTgvSFNNWHRzMTBUTFpDVER5bXo0MEVYeUt5?=
 =?utf-8?B?UERoeFhHSGNGMWFWMGx0OUNRMWVwQWJjK2VrMkx6cmc2WXNUQWg1WjFGLzRk?=
 =?utf-8?B?SG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zdUdrajhuR0NJSVBVYXlBU1kxUzN6Tzhz?=
 =?utf-8?B?bXlrTjdrcUVmU2NGSkdScGdIeTdlRm1NZUZpdXBCWEEzaUpQZFZDUEovY1Vy?=
 =?utf-8?B?U0poTm9qQkRRRFJKZGkrMEV0ZlVIbDkzeHdTcGxLNUM2MFBydEU2cExNWkZW?=
 =?utf-8?Q?WU4Aox05p9W44BedhvsF/4Cwk?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 134d3c55-15e9-43a2-d858-08db8ea0dfeb
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 12:56:20.7375
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: J5RHrk+euxkUpyGXERGOKhwtWWw2MLuz+IsOMdmb12Y2YA9FYvxAWbSdTAXjekrA2s8gh4tM9geUCygRa8AlPQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8635

On 27.07.2023 14:42, Roger Pau MonnÃ© wrote:
> There are also existing callers of iommu_update_ire_from_msi() that
> call the functions without the pcidevs locked.  See
> hpet_msi_set_affinity() for example.

Ftaod first and foremost because there's no pdev in that case.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 13:20:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 13:20:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571105.894142 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP0ug-0000UJ-QJ; Thu, 27 Jul 2023 13:20:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571105.894142; Thu, 27 Jul 2023 13:20:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP0ug-0000UC-ND; Thu, 27 Jul 2023 13:20:18 +0000
Received: by outflank-mailman (input) for mailman id 571105;
 Thu, 27 Jul 2023 13:20:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dT6+=DN=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qP0uf-0000U6-8P
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 13:20:17 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 52e0ef1a-2c80-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 15:20:15 +0200 (CEST)
Received: from [192.168.1.101] (unknown [37.161.207.213])
 by support.bugseng.com (Postfix) with ESMTPSA id 09C9D4EE073F;
 Thu, 27 Jul 2023 15:20:13 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 52e0ef1a-2c80-11ee-b248-6b7b168915f2
Message-ID: <211aa6d4-d219-e429-030c-8f8b2fba815a@bugseng.com>
Date: Thu, 27 Jul 2023 15:20:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH 2/3] xen/arm: irq: address violations of MISRA C: 2012
 Rules 8.2 and 8.3
Content-Language: en-US, it
To: Jan Beulich <jbeulich@suse.com>
Cc: consulting@bugseng.com, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 xen-devel@lists.xenproject.org, Stefano Stabellini <sstabellini@kernel.org>
References: <cover.1690217195.git.federico.serafini@bugseng.com>
 <a62e88a9c29cf7866c251968b5a5b6865aff4a2a.1690217195.git.federico.serafini@bugseng.com>
 <a81326f4-e018-b461-ebec-9ef2ff5dc4df@suse.com>
 <alpine.DEB.2.22.394.2307251226180.3118466@ubuntu-linux-20-04-desktop>
 <31b72cda-2ef0-2f3c-4e83-948d7b763f19@bugseng.com>
 <f479517d-10db-4723-65a2-38c85f72d96e@suse.com>
From: Federico Serafini <federico.serafini@bugseng.com>
Organization: BUGSENG srl
In-Reply-To: <f479517d-10db-4723-65a2-38c85f72d96e@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 27/07/23 13:27, Jan Beulich wrote:
> On 27.07.2023 13:02, Federico Serafini wrote:
>>
>> I have ready a patch for violations of rules 8.2 and 8.3 in
>> xen/include/xen/iommu.h.
>> I am talking about this, in this IRQ thread, because I think the
>> following two options also apply for an eventual v2 patch for the IRQ
>> module, until a decision about rule 8.2 and function pointers is taken:
>>
>> 1) Split patches and submit only the changes *not* involving function
>>      pointers.
>> 2) In the meantime that you make a decision,
>>      I submit patches thus addressing the existing violations.
>>
>> I personally prefer the second one, but please let me know what you
>> think.
> 
> It's not entirely clear to me what 2 means, as I wouldn't expect you
> intend to deal with "violations" which we may decide aren't any in
> out world.
> 
> Jan

In point 2) I would like to act as if the rule 8.2 had been approved 
without any deviation, I think this will lead to a smaller number of 
patches and a smaller amount of text attached to each modified function.
If you are concerned about inconsistency between the resulting commit
messages and your future decision then we can go for option 1).

-- 
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 13:23:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 13:23:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571108.894152 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP0xQ-00013x-7H; Thu, 27 Jul 2023 13:23:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571108.894152; Thu, 27 Jul 2023 13:23:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP0xQ-00013q-4e; Thu, 27 Jul 2023 13:23:08 +0000
Received: by outflank-mailman (input) for mailman id 571108;
 Thu, 27 Jul 2023 13:23:07 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qP0xP-00013b-3E; Thu, 27 Jul 2023 13:23:07 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qP0xP-00055M-08; Thu, 27 Jul 2023 13:23:07 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qP0xO-0007Am-IY; Thu, 27 Jul 2023 13:23:06 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qP0xO-00047i-I3; Thu, 27 Jul 2023 13:23:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=pxngSlTP9WYOIFENJOK0D2Cl+SLynkSgqLlMhrtvQlk=; b=gewFpP6GU0TC6uAIKu1kDcqsMo
	9zhqaeoQirWOyN5tlprDa8ftMYB5t9qVsRHPIIzrwnY8tZEgpVhRhNo8X7Y3TeUhIpLhPAgpLCsbT
	z8hW7uuYEz/FhWSCotFlNVkVrk5c3ZMZOXgjrMgtw/KlytmSIUw+jTGn3d8cyJ4S4LTs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182025-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 182025: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:guest-start/debian.repeat:fail:regression
    linux-linus:test-amd64-amd64-xl-credit2:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=18b44bc5a67275641fb26f2c54ba7eef80ac5950
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 27 Jul 2023 13:23:06 +0000

flight 182025 linux-linus real [real]
flight 182036 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/182025/
http://logs.test-lab.xenproject.org/osstest/logs/182036/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-xl-credit2 22 guest-start/debian.repeat fail in 182036 REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-credit2 20 guest-localmigrate/x10 fail pass in 182036-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt   16 saverestore-support-check fail blocked in 180278
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail blocked in 180278
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check fail blocked in 180278
 test-armhf-armhf-xl-multivcpu  8 xen-boot                     fail like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                18b44bc5a67275641fb26f2c54ba7eef80ac5950
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z  101 days
Failing since        180281  2023-04-17 06:24:36 Z  101 days  190 attempts
Testing same since   182025  2023-07-26 16:01:05 Z    0 days    1 attempts

------------------------------------------------------------
3821 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 642153 lines long.)


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 13:26:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 13:26:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571112.894161 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP10n-0001fE-N0; Thu, 27 Jul 2023 13:26:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571112.894161; Thu, 27 Jul 2023 13:26:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP10n-0001f7-KR; Thu, 27 Jul 2023 13:26:37 +0000
Received: by outflank-mailman (input) for mailman id 571112;
 Thu, 27 Jul 2023 13:26:36 +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
 <SRS0=RfsC=DN=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1qP10m-0001f0-1A
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 13:26:36 +0000
Received: from sender3-of-o57.zoho.com (sender3-of-o57.zoho.com
 [136.143.184.57]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 331b4c96-2c81-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 15:26:33 +0200 (CEST)
Received: from [10.10.1.94] (static-72-81-132-2.bltmmd.fios.verizon.net
 [72.81.132.2]) by mx.zohomail.com
 with SMTPS id 1690464386105636.1042016409584;
 Thu, 27 Jul 2023 06:26:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 331b4c96-2c81-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; t=1690464389; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=MNmHa/q5UMeEjGIls+mP9IERomY6tt6R4ULGLMNEr0YuGMQZmgEbaXr+V26CVNCfz8SfL6YjCVJfC/JIVENQGQMRXcfSqt4oCwRoeYt4c5RyUzynekUO+MPtp0E+GWGIiauQODYHwKdWa2OFMznwc8tAX2SotjP5ZeS1vi7inTY=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1690464389; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; 
	bh=XMBdIHKSpaiE95N3d6r4LbZnkBbvXwtqpQOJK7TScnQ=; 
	b=n1di8RQ0/xTVujtFLJ1aCYUqIBRE0K7vJdoVrI9iTRSHpQI6Xt/+IGkVnLoFOxI2AmyaPXzOeFG2oLTy+NOjKyCQm+BOto8bY7FK/ZMm4xK3qYYhDfvMcrwwgahT21YYwASmK28jtYxY2bqD2MZfpg7pjmaIaVINenFl9tSAsCU=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1690464389;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To;
	bh=XMBdIHKSpaiE95N3d6r4LbZnkBbvXwtqpQOJK7TScnQ=;
	b=Pl5Rmvu1Mmu2c089XzhERFn5oP1qbDXltOgc07QxwooubgBlx9qlCO0daUi/ueNC
	arhcqBXNWhhVb2rlFlbB7qzgVQoVdmJoi+5XKTPjFRS1HzSkeOhTaVuMalXTi5xCd3H
	vW+hpq0VHtofdPXlzYO1B8/HD1ptTrNqoxeq/ypA=
Message-ID: <19bb355f-576c-b8d7-b6da-fa2dd8ff2228@apertussolutions.com>
Date: Thu, 27 Jul 2023 09:26:23 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [PATCH 03/10] x86 setup: change bootstrap map to accept new boot
 module structures
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, stefano.stabellini@amd.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Luca Fancellu <luca.fancellu@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Rich Persaud <persaur@gmail.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Christopher Clark <christopher.w.clark@gmail.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
 <20230701071835.41599-4-christopher.w.clark@gmail.com>
 <alpine.DEB.2.22.394.2307081144340.761183@ubuntu-linux-20-04-desktop>
 <CACMJ4GYE6PW1SY35dhs4XkXd9ru25igrvMCrh4pJMWEBNNz0YQ@mail.gmail.com>
 <CACMJ4Gb_ZwKSjP7qzfQj98YQjSpBdFuWzeGQJUNNqst0GdXCOw@mail.gmail.com>
 <4e0a0fc9-0c1b-4725-5692-de67ee68a980@suse.com>
 <2994c9b8-c803-1fd9-20df-0d25d2b66c49@apertussolutions.com>
 <ca85fd2e-45a5-32c3-cb4b-1042be6c6915@suse.com>
 <32a22c57-1333-47b0-c61d-abff8d7df112@apertussolutions.com>
 <7ab3c4ae-3903-29de-ba32-d328b426d104@suse.com>
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
In-Reply-To: <7ab3c4ae-3903-29de-ba32-d328b426d104@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External



On 7/27/23 08:54, Jan Beulich wrote:
> On 27.07.2023 14:48, Daniel P. Smith wrote:
>> On 7/27/23 07:58, Jan Beulich wrote:
>>> On 27.07.2023 13:46, Daniel P. Smith wrote:
>>>> On 7/21/23 02:14, Jan Beulich wrote:
>>>>> On 21.07.2023 00:12, Christopher Clark wrote:
>>>>>> On Thu, Jul 13, 2023 at 11:51â€¯PM Christopher Clark <
>>>>>> christopher.w.clark@gmail.com> wrote:
>>>>>>> On Sat, Jul 8, 2023 at 11:47â€¯AM Stefano Stabellini <sstabellini@kernel.org>
>>>>>>> wrote:
>>>>>>>> On Sat, 1 Jul 2023, Christopher Clark wrote:
>>>>>>>>> To convert the x86 boot logic from multiboot to boot module structures,
>>>>>>>>> change the bootstrap map function to accept a boot module parameter.
>>>>>>>>>
>>>>>>>>> To allow incremental change from multiboot to boot modules across all
>>>>>>>>> x86 setup logic, provide a temporary inline wrapper that still accepts a
>>>>>>>>> multiboot module parameter and use it where necessary. The wrapper is
>>>>>>>>> placed in a new arch/x86 header <asm/boot.h> to avoid putting a static
>>>>>>>>> inline function into an existing header that has no such functions
>>>>>>>>> already. This new header will be expanded with additional functions in
>>>>>>>>> subsequent patches in this series.
>>>>>>>>>
>>>>>>>>> No functional change intended.
>>>>>>>>>
>>>>>>>>> Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
>>>>>>>>> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
>>>>>>>>>
>>>>>>>>
>>>>>>>> [...]
>>>>>>>>
>>>>>>>>> diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
>>>>>>>>> index b72ae31a66..eb93cc3439 100644
>>>>>>>>> --- a/xen/include/xen/bootinfo.h
>>>>>>>>> +++ b/xen/include/xen/bootinfo.h
>>>>>>>>> @@ -10,6 +10,9 @@
>>>>>>>>>     #endif
>>>>>>>>>
>>>>>>>>>     struct boot_module {
>>>>>>>>> +    paddr_t start;
>>>>>>>>> +    size_t size;
>>>>>>>>
>>>>>>>> I think size should be paddr_t (instead of size_t) to make sure it is
>>>>>>>> the right size on both 64-bit and 32-bit architectures that support
>>>>>>>> 64-bit addresses.
>>>>>>>>
>>>>>>>
>>>>>>> Thanks, that explanation does make sense - ack.
>>>>>>>
>>>>>>
>>>>>> I've come back to reconsider this as it doesn't seem right to me to store a
>>>>>> non-address value (which this will always be) in a type explicitly defined
>>>>>> to hold an address: addresses may have architectural alignment requirements
>>>>>> whereas a size value is just a number of bytes so will not. The point of a
>>>>>> size_t value is that size_t is defined to be large enough to hold the size
>>>>>> of any valid object in memory, so I think this was right as-is.
>>>>>
>>>>> "Any object in memory" implies virtual addresses (or more generally addresses
>>>>> which can be used for accessing objects). This isn't the case when considering
>>>>> physical addresses - there may be far more memory in a system than can be made
>>>>> accessible all in one go.
>>>>
>>>> That is not my understanding of it, but I could be wrong. My
>>>> understanding based on all the debates I have read online around this
>>>> topic is that the intent in the spec is that size_t has to be able to
>>>> hold a value that represents the largest object the CPU can manipulate
>>>> with general purpose operations. From which I understand to mean as
>>>> large as the largest register a CPU instruction may use for a size
>>>> argument to a general purpose instruction. On x86_64, that is a 64bit
>>>> register, as I don't believe the SSE/AVX registers are counted even
>>>> though the are used by compiler/libc implementations to optimize some
>>>> memory operations.
>>>
>>> I can't see how this relates to my earlier remark.
>>
>> Perhaps I misunderstood what your point was then. I thought you were
>> taking the position that size_t could not be used to represent the
>> largest object in memory addressable by a single CPU operation.
> 
> No. I was trying to clarify that we're talking about physical addresses
> here. Which you still seem to have trouble with, ...

No, I perfectly understand what you are saying and am not having 
difficulties with.

>>>>    From what I have seen for Xen, this is currently reflected in the x86
>>>> code base, as size_t is 32bits for the early 32bit code and 64bits for
>>>> Xen proper.
>>>>
>>>> That aside, another objection I have to the use of paddr_t is that it is
>>>> type abuse. Types are meant to convey context to the intended use of the
>>>> variable and enable the ability to enforce proper usage of the variable,
>>>> otherwise we might as well just use u64/uint64_t and be done. The
>>>> field's purpose is to convey a size of an object,
>>>
>>> You use "object" here again, when in physical address space (with paging
>>> enabled) this isn't an appropriate term.
>>
>> Because that is the language used in the C spec to refer to instances in
>> memory,
>>
>> "Object: region of data storage in the execution environment, the
>> contents of which can represent values"
>>
>> ISO/IEC 9899:1999(E) - 3.14:
>> https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf
>>
>>
>>
>> With the following two interpretations of the spec for size_t to mean
>> (any emphasis being mine),
>>
>>
>> "size_t is an unsigned integer type used to represent the size of any
>> **object** (including arrays) in the particular implementation."
>>
>> Wikipedia - size_t: https://en.wikipedia.org/wiki/C_data_types#stddef.h
>>
>>
>> "size_t can store the maximum size of a theoretically possible
>> **object** of any type (including array)."
>>
>> CPP Ref - size_t: (https://en.cppreference.com/w/c/types/size_t)
> 
> ... according to all of this and ...
> 
>>>> and labeling it a type
>>>> that is intended for physical address objects violates both intents
>>>> behind declaring a type, it asserts an invalid context and enables
>>>> violations of type checking.
>>>
>>> It is type abuse to a certain extent, yes, but what do you do? We could
>>> invent psize_t, but that would (afaics) always match paddr_t. uint64_t
>>> otoh may be too larger for 32-bit platforms which only know a 32-bit
>>> wide physical address space.
>>
>> Why invent a new type? That is the purpose of `size_t`, and it should be
>> of the correct size, otherwise Xen's implementation is incorrect (which
>> it is not).
> 
> ... this. What C talks about is what the CPU can address (within a single
> address space, i.e. normally virtual addresses). With 32-bit addresses
> you can address at most 4G, when the system you're running on may have
> much more memory. Yet in an OS or hypervisor you need to deal with this
> larger amount of memory, no matter that you can't address all of it in
> one go.

Nothing I said disagrees with your statement.

Let's bring this back to the actual implementation instead of the 
theoretical. Your position is that Xen's paddr_t is desired because it 
can store larger values than that of size_t. Now if you look in Xen 
proper (main 64bit code on x86), paddr_t is a typedef for a 64bit 
unsigned integer. And if you look at size_t, it is also a typedef to a 
64bit unsigned integer, they are literally a couple of lines apart in 
types.h. Thus they are the same size and can only represent the same 
maximum size. The only area of issue for x86 is during the short bit of 
code that runs in 32bit mode during startup. In this series, we address 
this by using a set of macros in the 32bit code to provide 64bit clean 
definition of the structures. This approach is acceptable because as far 
as I am aware, x86 is the only platform where the hypervisor has to 
transition from one bit size to another, e.g. Arm just starts in 64bit 
mode when on a 64bit device.

At the end of the day, size_t is the same size as paddr_t for the end 
execution environments and I would levy a guess that should x86 suddenly 
find itself having a 128bit mode which would likely drive paddr_t to 
128bits, so would follow size_t.

v/r,
dps


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 13:38:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 13:38:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571118.894183 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP1Bx-0003OR-EQ; Thu, 27 Jul 2023 13:38:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571118.894183; Thu, 27 Jul 2023 13:38:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP1Bx-0003MF-96; Thu, 27 Jul 2023 13:38:09 +0000
Received: by outflank-mailman (input) for mailman id 571118;
 Thu, 27 Jul 2023 13:38:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=SoSB=DN=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qP1Bw-0003FR-DU
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 13:38:08 +0000
Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com
 [2a00:1450:4864:20::233])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d186ba78-2c82-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 15:38:06 +0200 (CEST)
Received: by mail-lj1-x233.google.com with SMTP id
 38308e7fff4ca-2b702319893so14463971fa.3
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 06:38:06 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 l3-20020a2e7003000000b002b6bb68c7eesm341955ljc.110.2023.07.27.06.38.05
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 06:38:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d186ba78-2c82-11ee-b248-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690465086; x=1691069886;
        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=hF332OfgYUsWsVFPe2SUXxFQxaYyas5f3pgB2tdOoks=;
        b=M3E7ON1oYx9yzFNYYQRQ3QRtvsG9vlScgNIvvDSy7uQqWqfbpEkKXpWyx0i31A0idW
         pu2kpqWEKqneb5Ba4fJc/SRwUtVUUo58aFfzQnQmUhpUHpdCMvAClN+IIosGKon0eEx8
         51DNRAAClqqqX1f+I/98BJVch3caRmUAL7oupDqTAWeXtwC2BWTf6FHo1AeIk2ISOHrs
         D2EDMOTaEWiB0QIH3w7D3cp7ja+RHTYbxBQEk9mrBs8nZDBEmhgR1jIu2Drxs5VsTLfv
         ZbiYfR71WJLlJDGb/clcCSj/7wIYnCwdp11TmV97i8nRMtFP1LrgYNyazwXlJxPSoLRw
         Sq0w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690465086; x=1691069886;
        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=hF332OfgYUsWsVFPe2SUXxFQxaYyas5f3pgB2tdOoks=;
        b=ZB3zi6+9rMctVq2Qj94o6/iVgqza7iMqCS1WtvF65PkuaY/IsCsO4Nti5OAuuQtuTK
         XoMLqiO04k/Uon3gklA2boxZd0MvkguMvhvMUoy9gUNdNUlB4doWDsxGJxdzKgj9D3gR
         iGaTPFgDzlgsEqw+VDBwjYu7403ytctqpCCYVp7lNilks2ig6YZPRbTVjuf8VB0jrRoR
         FEG0Jfi8haHltDMT5yGUeofZZBvKmO5K7n+PNDgxw4oyRlc/t07IaCtl4C3vfXgR8RxW
         LAdJhTjGcNOSe+L0qSn5t7hN2JDfehNML5YI5nQxYAPXAJfmNcJrwGS5oQMI+W6AVGFu
         7lLg==
X-Gm-Message-State: ABy/qLYRJBJNmJNiMFZ/0lbitQ45/P4n8s1hQjpS9n2wMk2sGfVX/cpx
	rw3BEwlwDJLSkLulEUaArzgoyl+dmfw=
X-Google-Smtp-Source: APBJJlH5dV410O0BZNE+67gU1nNQR61JRfYESCq1udH+5ycylO7gkoCFfKYKJ+FrNEUoYzB5ZfWiAw==
X-Received: by 2002:a2e:8e89:0:b0:2b9:c996:eaf9 with SMTP id z9-20020a2e8e89000000b002b9c996eaf9mr445588ljk.47.1690465085715;
        Thu, 27 Jul 2023 06:38:05 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>
Subject: [PATCH v5 2/2] xen/riscv: introduce identity mapping
Date: Thu, 27 Jul 2023 16:38:01 +0300
Message-ID: <ab2e719bbe071c3d5c4e3341573c0848dfcee3ee.1690464789.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1690464789.git.oleksii.kurochko@gmail.com>
References: <cover.1690464789.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The way how switch to virtual address was implemented in the
commit e66003e7be ("xen/riscv: introduce setup_initial_pages")
isn't safe enough as:
* enable_mmu() depends on hooking all exceptions
  and pagefault.
* Any exception other than pagefault, or not taking a pagefault
  causes it to malfunction, which means you will fail to boot
  depending on where Xen was loaded into memory.

Instead of the proposed way of switching to virtual addresses was
decided to use identity mapping for area which constains needed code
to switch from identity mapping and after switching to virtual addresses,
identity mapping is removed from page-tables in the following way:
search for top-most page table entry and remove it.

Fixes: e66003e7be ("xen/riscv: introduce setup_initial_pages")
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
Changes in V5:
 - update the algo of identity mapping removing.
 - introduce IDENT_AREA_SIZE.
 - introduce turn_on_mmu() function to enable and switch from 1:1 mapping.
 - fix typo in PGTBL_INITIAL_COUNT define.
 - update the comment above PGTBL_INITIAL_COUNT.
 - update the commit message.
---
Changes in V4:
 - remove definition of ARRAY_SIZE and ROUNDUP as <xen/macors.h> was introduced where these macros are located now.
 - update definition of PGTBL_INITIAL_COUNT
 - update the commit message
 - update the algo of identity mapping removing
---
Changes in V3:
 - remove unrelated to the patch changes ( SPDX tags in config.h ).
 - update definition of PGTBL_INITIAL_COUNT taking into account identity mapping.
 - refactor remove_identity_mapping() function.
 - add explanatory comments in xen.lds.S and mm.c.
 - update commit message.
 - move save/restore of a0/a1 registers to [PATCH v2 2/3] xen/riscv: introduce
   function for physical offset calculation.
---
Changes in V2:
  - update definition of PGTBL_INITIAL_COUNT and the comment above.
  - code style fixes.
  - 1:1 mapping for entire Xen.
  - remove id_addrs array becase entire Xen is mapped.
  - reverse condition for cycle inside remove_identity_mapping().
  - fix page table walk in remove_identity_mapping().
  - update the commit message.
  - add Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
  - save hart_id and dtb_addr before call MMU related C functions.
  - use phys_offset variable instead of doing calcultations to get phys offset
    in head.S file. ( it can be easily done as entire Xen is 1:1 mapped )
  - declare enable_muu() as __init.
---
 xen/arch/riscv/include/asm/config.h |  2 +
 xen/arch/riscv/include/asm/mm.h     |  5 +-
 xen/arch/riscv/mm.c                 | 90 +++++++++++++++--------------
 xen/arch/riscv/riscv64/head.S       | 32 ++++++++++
 xen/arch/riscv/setup.c              | 14 +----
 xen/arch/riscv/xen.lds.S            | 11 ++++
 6 files changed, 99 insertions(+), 55 deletions(-)

diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/asm/config.h
index fa90ae0898..f0544c6a20 100644
--- a/xen/arch/riscv/include/asm/config.h
+++ b/xen/arch/riscv/include/asm/config.h
@@ -95,6 +95,8 @@
 #define RV_STAGE1_MODE SATP_MODE_SV32
 #endif
 
+#define IDENT_AREA_SIZE 64
+
 #endif /* __RISCV_CONFIG_H__ */
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 7b94cbadd7..07c7a0abba 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -13,8 +13,11 @@ extern unsigned char cpu0_boot_stack[];
 void setup_initial_pagetables(void);
 
 void enable_mmu(void);
-void cont_after_mmu_is_enabled(void);
+
+void remove_identity_mapping(void);
 
 unsigned long calc_phys_offset(void);
 
+void turn_on_mmu(unsigned long ra);
+
 #endif /* _ASM_RISCV_MM_H */
diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index 1df39ddf1b..d19fdb7878 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -4,6 +4,7 @@
 #include <xen/compiler.h>
 #include <xen/init.h>
 #include <xen/kernel.h>
+#include <xen/macros.h>
 #include <xen/pfn.h>
 
 #include <asm/early_printk.h>
@@ -35,8 +36,11 @@ static unsigned long __ro_after_init phys_offset;
  *
  * It might be needed one more page table in case when Xen load address
  * isn't 2 MB aligned.
+ *
+ * CONFIG_PAGING_LEVELS page tables are needed for the identity mapping,
+ * except that the root page table is shared with the initial mapping
  */
-#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) + 1)
+#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) * 2 + 1)
 
 pte_t __section(".bss.page_aligned") __aligned(PAGE_SIZE)
 stage1_pgtbl_root[PAGETABLE_ENTRIES];
@@ -75,6 +79,7 @@ static void __init setup_initial_mapping(struct mmu_desc *mmu_desc,
     unsigned int index;
     pte_t *pgtbl;
     unsigned long page_addr;
+    bool is_identity_mapping = map_start == pa_start;
 
     if ( (unsigned long)_start % XEN_PT_LEVEL_SIZE(0) )
     {
@@ -108,16 +113,18 @@ static void __init setup_initial_mapping(struct mmu_desc *mmu_desc,
             {
                 unsigned long paddr = (page_addr - map_start) + pa_start;
                 unsigned int permissions = PTE_LEAF_DEFAULT;
+                unsigned long addr = is_identity_mapping
+                                     ? page_addr : LINK_TO_LOAD(page_addr);
                 pte_t pte_to_be_written;
 
                 index = pt_index(0, page_addr);
 
-                if ( is_kernel_text(LINK_TO_LOAD(page_addr)) ||
-                     is_kernel_inittext(LINK_TO_LOAD(page_addr)) )
-                    permissions =
-                        PTE_EXECUTABLE | PTE_READABLE | PTE_VALID;
+                if ( is_kernel_text(addr) ||
+                     is_kernel_inittext(addr) )
+                        permissions =
+                            PTE_EXECUTABLE | PTE_READABLE | PTE_VALID;
 
-                if ( is_kernel_rodata(LINK_TO_LOAD(page_addr)) )
+                if ( is_kernel_rodata(addr) )
                     permissions = PTE_READABLE | PTE_VALID;
 
                 pte_to_be_written = paddr_to_pte(paddr, permissions);
@@ -211,6 +218,13 @@ void __init setup_initial_pagetables(void)
     unsigned long linker_start  = LOAD_TO_LINK(load_start);
     unsigned long linker_end    = LOAD_TO_LINK(load_end);
 
+    unsigned long ident_start;
+    unsigned long ident_end;
+
+    /*
+     * If the overlapping check will be removed then remove_identity_mapping()
+     * logic should be updated.
+     */
     if ( (linker_start != load_start) &&
          (linker_start <= load_end) && (load_start <= linker_end) )
     {
@@ -232,48 +246,40 @@ void __init setup_initial_pagetables(void)
                           linker_start,
                           linker_end,
                           load_start);
+
+    if ( linker_start == load_start )
+        return;
+
+    ident_start = (unsigned long)turn_on_mmu & XEN_PT_LEVEL_MAP_MASK(0);
+    ident_end = ident_start + PAGE_SIZE;
+
+    setup_initial_mapping(&mmu_desc,
+                          ident_start,
+                          ident_end,
+                          ident_start);
 }
 
-void __init noreturn noinline enable_mmu()
+void __init remove_identity_mapping(void)
 {
-    /*
-     * Calculate a linker time address of the mmu_is_enabled
-     * label and update CSR_STVEC with it.
-     * MMU is configured in a way where linker addresses are mapped
-     * on load addresses so in a case when linker addresses are not equal
-     * to load addresses, after MMU is enabled, it will cause
-     * an exception and jump to linker time addresses.
-     * Otherwise if load addresses are equal to linker addresses the code
-     * after mmu_is_enabled label will be executed without exception.
-     */
-    csr_write(CSR_STVEC, LOAD_TO_LINK((unsigned long)&&mmu_is_enabled));
-
-    /* Ensure page table writes precede loading the SATP */
-    sfence_vma();
+    unsigned int i;
+    pte_t *pgtbl;
+    unsigned int index, xen_index;
+    unsigned long ident_start =
+        LINK_TO_LOAD(turn_on_mmu) & XEN_PT_LEVEL_MAP_MASK(0);
 
-    /* Enable the MMU and load the new pagetable for Xen */
-    csr_write(CSR_SATP,
-              PFN_DOWN((unsigned long)stage1_pgtbl_root) |
-              RV_STAGE1_MODE << SATP_MODE_SHIFT);
+    for ( pgtbl = stage1_pgtbl_root, i = CONFIG_PAGING_LEVELS; i; i-- )
+    {
+        index = pt_index(i - 1, ident_start);
+        xen_index = pt_index(i - 1, XEN_VIRT_START);
 
-    asm volatile ( ".p2align 2" );
- mmu_is_enabled:
-    /*
-     * Stack should be re-inited as:
-     * 1. Right now an address of the stack is relative to load time
-     *    addresses what will cause an issue in case of load start address
-     *    isn't equal to linker start address.
-     * 2. Addresses in stack are all load time relative which can be an
-     *    issue in case when load start address isn't equal to linker
-     *    start address.
-     *
-     * We can't return to the caller because the stack was reseted
-     * and it may have stash some variable on the stack.
-     * Jump to a brand new function as the stack was reseted
-     */
+        if ( index != xen_index )
+        {
+            pgtbl[index].pte = 0;
+            break;
+        }
 
-    switch_stack_and_jump((unsigned long)cpu0_boot_stack + STACK_SIZE,
-                          cont_after_mmu_is_enabled);
+        pgtbl = (pte_t *)LOAD_TO_LINK(pte_to_paddr(pgtbl[index]));
+    }
 }
 
 /*
diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S
index ae194bb099..f4e24fc3df 100644
--- a/xen/arch/riscv/riscv64/head.S
+++ b/xen/arch/riscv/riscv64/head.S
@@ -39,6 +39,23 @@ ENTRY(start)
         jal     calc_phys_offset
         mv      s2, a0
 
+        jal     setup_initial_pagetables
+
+        /* Calculate proper VA after jump from 1:1 mapping */
+        la      t0, .L_primary_switched
+        sub     t0, t0, s2
+
+        mv      a0, t0
+        jal     turn_on_mmu
+
+.L_primary_switched:
+        /*
+         * cpu0_boot_stack address is 1:1 mapping related so it should be
+         * recalculated after jump from 1:1 mapping world as 1:1 mapping
+         * will be removed soon in start_xen().
+         */
+        jal     reset_stack
+
         /* restore hart_id ( bootcpu_id ) and dtb address */
         mv      a0, s0
         mv      a1, s1
@@ -54,3 +71,18 @@ ENTRY(reset_stack)
 
         ret
 
+        .section .text.ident, "ax", %progbits
+
+ENTRY(turn_on_mmu)
+        sfence.vma
+
+        li      t0, RV_STAGE1_MODE
+        li      t1, SATP_MODE_SHIFT
+        sll     t0, t0, t1
+
+        la      t2, stage1_pgtbl_root
+        srl     t2, t2, PAGE_SHIFT
+        or      t2, t2, t0
+        csrw    CSR_SATP, t2
+
+        jr      a0
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index dde8fb898b..6593f601c1 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -13,20 +13,10 @@ unsigned char __initdata cpu0_boot_stack[STACK_SIZE]
 void __init noreturn start_xen(unsigned long bootcpu_id,
                                paddr_t dtb_addr)
 {
-    early_printk("Hello from C env\n");
-
-    setup_initial_pagetables();
-
-    enable_mmu();
-
-    for ( ;; )
-        asm volatile ("wfi");
+    remove_identity_mapping();
 
-    unreachable();
-}
+    early_printk("Hello from C env\n");
 
-void __init noreturn cont_after_mmu_is_enabled(void)
-{
     early_printk("All set up\n");
 
     for ( ;; )
diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S
index 9064852173..3fa7db3bf9 100644
--- a/xen/arch/riscv/xen.lds.S
+++ b/xen/arch/riscv/xen.lds.S
@@ -31,6 +31,11 @@ SECTIONS
         *(.text.*)
 #endif
 
+        . = ALIGN(IDENT_AREA_SIZE);
+        _ident_start = .;
+        *(.text.ident)
+        _ident_end = .;
+
         *(.fixup)
         *(.gnu.warning)
         . = ALIGN(POINTER_ALIGN);
@@ -173,4 +178,10 @@ ASSERT(IS_ALIGNED(__bss_end,        POINTER_ALIGN), "__bss_end is misaligned")
 ASSERT(!SIZEOF(.got),      ".got non-empty")
 ASSERT(!SIZEOF(.got.plt),  ".got.plt non-empty")
 
+/*
+ * Changing the size of Xen binary can require an update of
+ * PGTBL_INITIAL_COUNT.
+ */
 ASSERT(_end - _start <= MB(2), "Xen too large for early-boot assumptions")
+
+ASSERT(_ident_end - _ident_start <= IDENT_AREA_SIZE, "identity region is too big");
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 13:38:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 13:38:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571117.894178 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP1Bx-0003In-7E; Thu, 27 Jul 2023 13:38:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571117.894178; Thu, 27 Jul 2023 13:38:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP1Bx-0003Hd-0O; Thu, 27 Jul 2023 13:38:09 +0000
Received: by outflank-mailman (input) for mailman id 571117;
 Thu, 27 Jul 2023 13:38:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=SoSB=DN=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qP1Bv-0003FR-DE
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 13:38:07 +0000
Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com
 [2a00:1450:4864:20::235])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d112e3db-2c82-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 15:38:06 +0200 (CEST)
Received: by mail-lj1-x235.google.com with SMTP id
 38308e7fff4ca-2b9b9f0387dso14802581fa.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 06:38:06 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 l3-20020a2e7003000000b002b6bb68c7eesm341955ljc.110.2023.07.27.06.38.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 06:38:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d112e3db-2c82-11ee-b248-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690465085; x=1691069885;
        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=VVrY+IwKxbHDcjyK2IpdTfw6/z7cxU09eme1nE/toW4=;
        b=qhiHRzyKb+DM4KVt4S08A6E16pb6Ox+6N+AovsfGeRC6koDzQvy8u31gZzbsI0QdZF
         wq7Zeb1RzrPBHZvdnKJqD+WleAU6SfQFGC/nVOgGGMu0ze4DSqjy+9CoHAhf2EaQTHGB
         awQzsk5U368dHpLj699dc/zwtFxXvQVt5aqdTYfaoOIE4dPhQ2GClj/x2A4wqlIJ1zT4
         ku3HuTuh+tfLf9U4B0rgyH70D+N+mLwCCDMFAYF5omxV5haH0JVLAM4OrixOaeP8Dlzw
         HODEKMVNG7hz37YGaG42hY3934JdOyVmSDNizFK749mRRptHaWXYUeXIm5hKs0mWzobi
         3ndQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690465085; x=1691069885;
        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=VVrY+IwKxbHDcjyK2IpdTfw6/z7cxU09eme1nE/toW4=;
        b=Zt9T/NcePq2r5PIbaVCCQyEAOyqMO0m7rT+JQnPn3SUJ/tLDgIILyoW6P3nE+LgEO9
         JUZ50/id1bUTkiVSf5Dtkn6j4Bp1E0YQM7Yn034z7N7OwZgCtwmXlGedR0+nCky8yYhQ
         HKYghcGVItqOpmhZT88Mf059CYCgk4Eg8Z/z+fIFlGCirO8d/tzjH5gvMTD3yCpKWGtj
         kfGgk7lI1Iwb9Ba1lS9MLT+TZy1vleYY33w2eMDEBnTMwXZAhf2r2OPLs+Wo3ylK+eS4
         GxAyNTOmmQRFcU/hlSSRA6f+q43gIaO9H8pUL8y6/gzBtMeP4bwyyLxF9Lsuh4ACfILD
         +8FA==
X-Gm-Message-State: ABy/qLamFqEdAlR8o2vVdg5UluS1E+dlNGnNmortzZZNzBN4EjkT5gQU
	gn/k9Ov+1DPmS9vBvmTPRP6FQQ4qxiU=
X-Google-Smtp-Source: APBJJlGkVc0AaTUa3EEv91hubQZIzwgfwVIYP+JmrTV3JnqWEFxkbjjFMx3IXch8O8BWq0UTWhkBAQ==
X-Received: by 2002:a2e:9316:0:b0:2b7:764:3caf with SMTP id e22-20020a2e9316000000b002b707643cafmr1768721ljh.10.1690465085098;
        Thu, 27 Jul 2023 06:38:05 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>
Subject: [PATCH v5 1/2] xen/riscv: introduce function for physical offset calculation
Date: Thu, 27 Jul 2023 16:38:00 +0300
Message-ID: <8013798bc397e5afb27d3aa3b263e06f68590b12.1690464789.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1690464789.git.oleksii.kurochko@gmail.com>
References: <cover.1690464789.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The function was introduced to calculate and save physical
offset before MMU is enabled because access to start() is
PC-relative and in case of linker_addr != load_addr it will
result in incorrect value in phys_offset.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V5:
 - update prototype of calc_phys_offset(). now it returns phys_offset.
 - declare phys_offset as static.
 - save returned value of calc_phys_offset to register s2.
---
Changes in V4:
 - update the comment messages in head.S related to save/restore of a0/a1 regs.
---
Changes in V3:
 - save/restore of a0/a1 registers before C first function call.
---
Changes in V2:
  - add __ro_after_init for phys_offset variable.
  - remove double blank lines.
  - add __init for calc_phys_offset().
  - update the commit message.
  - declaring variable phys_off as non static as it will be used in head.S.
---
 xen/arch/riscv/include/asm/mm.h |  2 ++
 xen/arch/riscv/mm.c             | 19 ++++++++++++++++---
 xen/arch/riscv/riscv64/head.S   | 14 ++++++++++++++
 3 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 5e3ac5cde3..7b94cbadd7 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -15,4 +15,6 @@ void setup_initial_pagetables(void);
 void enable_mmu(void);
 void cont_after_mmu_is_enabled(void);
 
+unsigned long calc_phys_offset(void);
+
 #endif /* _ASM_RISCV_MM_H */
diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index fddb3cd0bd..1df39ddf1b 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
+#include <xen/cache.h>
 #include <xen/compiler.h>
 #include <xen/init.h>
 #include <xen/kernel.h>
@@ -19,9 +20,10 @@ struct mmu_desc {
     pte_t *pgtbl_base;
 };
 
-#define PHYS_OFFSET ((unsigned long)_start - XEN_VIRT_START)
-#define LOAD_TO_LINK(addr) ((addr) - PHYS_OFFSET)
-#define LINK_TO_LOAD(addr) ((addr) + PHYS_OFFSET)
+static unsigned long __ro_after_init phys_offset;
+
+#define LOAD_TO_LINK(addr) ((unsigned long)(addr) - phys_offset)
+#define LINK_TO_LOAD(addr) ((unsigned long)(addr) + phys_offset)
 
 /*
  * It is expected that Xen won't be more then 2 MB.
@@ -273,3 +275,14 @@ void __init noreturn noinline enable_mmu()
     switch_stack_and_jump((unsigned long)cpu0_boot_stack + STACK_SIZE,
                           cont_after_mmu_is_enabled);
 }
+
+/*
+ * calc_phys_offset() should be used before MMU is enabled because access to
+ * start() is PC-relative and in case when load_addr != linker_addr phys_offset
+ * will have an incorrect value
+ */
+unsigned long __init calc_phys_offset(void)
+{
+    phys_offset = (unsigned long)start - XEN_VIRT_START;
+    return phys_offset;
+}
diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S
index 2c0304646a..ae194bb099 100644
--- a/xen/arch/riscv/riscv64/head.S
+++ b/xen/arch/riscv/riscv64/head.S
@@ -29,6 +29,20 @@ ENTRY(start)
 
         jal     reset_stack
 
+        /*
+         * save hart_id ( bootcpu_id ) and dtb_base as a0 and a1 register can
+         * be used by C code
+         */
+        mv      s0, a0
+        mv      s1, a1
+
+        jal     calc_phys_offset
+        mv      s2, a0
+
+        /* restore hart_id ( bootcpu_id ) and dtb address */
+        mv      a0, s0
+        mv      a1, s1
+
         tail    start_xen
 
         .section .text, "ax", %progbits
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 13:38:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 13:38:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571116.894172 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP1Bw-0003Fp-Sf; Thu, 27 Jul 2023 13:38:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571116.894172; Thu, 27 Jul 2023 13:38:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP1Bw-0003Fi-PJ; Thu, 27 Jul 2023 13:38:08 +0000
Received: by outflank-mailman (input) for mailman id 571116;
 Thu, 27 Jul 2023 13:38:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=SoSB=DN=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qP1Bv-0003FR-2o
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 13:38:07 +0000
Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com
 [2a00:1450:4864:20::235])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d0b9c76f-2c82-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 15:38:05 +0200 (CEST)
Received: by mail-lj1-x235.google.com with SMTP id
 38308e7fff4ca-2b74310566cso14335671fa.2
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 06:38:05 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 l3-20020a2e7003000000b002b6bb68c7eesm341955ljc.110.2023.07.27.06.38.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 06:38:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d0b9c76f-2c82-11ee-b248-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690465085; x=1691069885;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=BLFQhZ4MoAbWExoRt/lnHk9NUwKJAZKhGplxZIedqks=;
        b=Pz30w7YB/U0NqCbWmQZs4VKFJ0BGGhAKXUIQU7GQCsXuxk785cVcWSLD8B420Exp2F
         PRp8HgbQAtgdy1/nIGwi1qzbZssmkGP25BpKewPYpObtzWY9FWEePaz+71Eh0dLrb9no
         e3jWH01LbZnx+XfPuvFSG5XmrMsZhK/7/gi8F2+b+Qupm3975kmHNHfA1fOKkT2tGrmg
         QMc20rqYrio2IkwcV2p4j2wC3h1t14R9tnIh1ySp8MWrxQq8JZr0Ipd5/QkEQBxE3OCF
         zpqOEBo+6gXTL7g6KLSq0fTgrAC3Ig9jtTnjhUDjeUuCn7C1NS5AepgUVjuRsdkHXKiw
         pryQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690465085; x=1691069885;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=BLFQhZ4MoAbWExoRt/lnHk9NUwKJAZKhGplxZIedqks=;
        b=NzoFKuduDjjre7mCI1DSs9senYiSnEUOYLCOscm8Xggi8f55dVC68VCe1HzUhn8k/t
         wG/Fd4+3ZHyBEfjhpBFRMk0Ve96P0K5bSypTY6hXsnoaKg508ePl7VQZEbZTBVluXPhL
         sSzeBzUcyWMER4wVsC/pz785YN+iXcRJnDKMapwidlvcHILILaT2b2tCY/ZQhCfZVdp3
         S6bVdp25DbZDywhvbwsyppoGd/qazHVCFCCxJXnzc//wS6g1JatIN5Hrbuagm+MFS/1n
         OZiEZZFbTrP36h+xSjHk1KMSYAf0Xec6VBZWV/HUoWdak1IhvaoSQFs3qHKgzO43xcui
         507w==
X-Gm-Message-State: ABy/qLZuI8vjFr7EIZm224aIs5HQcsB1qEidZyg+hsrb6Hz3qV9ea0xe
	X6uKGn5+Qtlr9NMWwPhxuOaXMGNFHLU=
X-Google-Smtp-Source: APBJJlFlz9hmN+9UTBVRefnETh6kvkgFGGKA9VS6a2AS4Pj4gIDuHKB80DyWydOc+dBOKeVips9xDw==
X-Received: by 2002:a2e:8182:0:b0:2b9:54e1:6711 with SMTP id e2-20020a2e8182000000b002b954e16711mr1620128ljg.7.1690465084461;
        Thu, 27 Jul 2023 06:38:04 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>
Subject: [PATCH v5 0/2] xen/riscv: introduce identity mapping
Date: Thu, 27 Jul 2023 16:37:59 +0300
Message-ID: <cover.1690464789.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The patch series introduces things necessary to implement identity mapping:
  1. Make identity mapping for the entire Xen.
  2. Enable MMU.
  3. Jump to the virtual address world
  4. Remove identity mapping.

Also current patch series introduces the calculation of physical offset before
MMU is enabled as access to physical offset will be calculated wrong after
MMU will be enabled because access to phys_off variable is PC-relative and
in the case when linker address != load address, it will cause MMU fault.

The reason for this patch series can be found here:
https://lore.kernel.org/xen-devel/4e336121-fc0c-b007-bf7b-430352563d55@citrix.com/
---
Changes in V5:
	- update the algo of identity mapping removing.
	- introduce IDENT_AREA_SIZE.
	- introduce turn_on_mmu() function to enable and switch from 1:1 mapping.
	- fix typo in PGTBL_INITIAL_COUNT define.
	- update the comment above PGTBL_INITIAL_COUNT.
	- update prototype of calc_phys_offset(). now it returns phys_offset.
	- declare phys_offset as static.
	- save returned value of calc_phys_offset to register s2.
---
Changes in V4:
  - drop patch 	[PATCH v3 1/3] xen/riscv: add SPDX tag to config.h as it was
    merged to staging
  - remove definition of ARRAY_SIZE and ROUNDUP as <xen/macors.h> was introduced where these macros are located now.
	- update definition of PGTBL_INITIAL_COUNT
	- update the commit message for patch 'xen/riscv: introduce identity mapping'
	- update the comments in head.S
  - update the algo of identity mapping removing 
---
Changes in V3:
 - Update the patch series message.
 - The following patches were merged to staging so droped from the patch series:
   * xen/riscv: add .sbss section to .bss
   * xen/riscv: introduce reset_stack() function
   * xen/riscv: move extern of cpu0_boot_stack to header
   * xen/riscv: add SPDX tags
 - move save/restore of a0/a1 registers from patch 4 to patch 2 ( numbers are
   from the previous patch series version )
 - add SPDX tag in config.h
 - update definition of PGTBL_INITIAL_COUNT taking into account identity mapping.
 - refactor remove_identity_mapping() function.
 - add explanatory comments in xen.lds.S and mm.c.
---
Changes in V2:
 - update the patch series message.
 - drop patches from the previous version of the patch series:
   * xen/riscv: add __ASSEMBLY__ guards". ( merged )
   * xen/riscv: make sure that identity mapping isn't bigger then page size
     ( entire Xen is 1:1 mapped so there is no need for the checks from the patch )
 - add .sbss.* and put it befor .bss* .
 - move out reset_stack() to .text section.
 - add '__ro_after_init' for phys_offset variable.
 - add '__init' for calc_phys_offset().
 - declaring variable phys_off as non static as it will be used in head.S.
 - update definition of PGTBL_INITIAL_COUNT and the comment above.
 - code style fixes.
 - remove id_addrs array becase entire Xen is mapped.
 - reverse condition for cycle inside remove_identity_mapping().
 - fix page table walk in remove_identity_mapping().
 - save hart_id and dtb_addr before call MMU related C functions
 - use phys_offset variable instead of doing calcultations to get phys offset
   in head.S file. ( it can be easily done as entire Xen is 1:1 mapped now )
 - declare enable_muu() as __init.
 - Update SPDX tags.
 - Add Review-By/Suggested-By for some patches.
 - code style fixes.

Oleksii Kurochko (2):
  xen/riscv: introduce function for physical offset calculation
  xen/riscv: introduce identity mapping

 xen/arch/riscv/include/asm/config.h |   2 +
 xen/arch/riscv/include/asm/mm.h     |   7 +-
 xen/arch/riscv/mm.c                 | 107 ++++++++++++++++------------
 xen/arch/riscv/riscv64/head.S       |  46 ++++++++++++
 xen/arch/riscv/setup.c              |  14 +---
 xen/arch/riscv/xen.lds.S            |  11 +++
 6 files changed, 130 insertions(+), 57 deletions(-)

-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 13:42:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 13:42:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571123.894202 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP1Fu-0005pZ-3s; Thu, 27 Jul 2023 13:42:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571123.894202; Thu, 27 Jul 2023 13:42:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP1Fu-0005pS-1E; Thu, 27 Jul 2023 13:42:14 +0000
Received: by outflank-mailman (input) for mailman id 571123;
 Thu, 27 Jul 2023 13:42:12 +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
 <SRS0=o85N=DN=citrix.com=prvs=5659ebe79=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qP1Fs-0005pM-9Z
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 13:42:12 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 60af8e6c-2c83-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 15:42:08 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 60af8e6c-2c83-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690465328;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=SU6g1q4ym50O9nheaB8dyangoWY78CHXd0G+bWMcA6k=;
  b=JajCBo4wxDjaB2atZay1pZmN+vpXO22459jVvccHwZTAkYw3jgoMNPiY
   Vz/7pGM70YmK1CoDJPXPGrZIr2eukfNY9QKcRaojKZMmMjzZHK4sJ7LpT
   i77cHnHQJw/wzG4Hp1gZSuecVUYIAkauyc93HEYpCujRZGlv/7vQWSEIy
   U=;
Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 117524933
X-Ironport-Server: esa2.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:DDmc1a3ak4j6az52OfbD5fpxkn2cJEfYwER7XKvMYLTBsI5bp2MBm
 zAeUTuEOfqCY2WmfIx1Ptm+90NQ65fdzNQ3GQdupC1hF35El5HIVI+TRqvS04F+DeWYFR46s
 J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo
 tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5gNkOqgR1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL
 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ
 OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfUU9rx
 LsxEWAxUA2OobLm5euwFuk8r5F2RCXrFNt3VnBIyDjYCbAtQIzZQrWM7thdtNsyrpkQR7CEP
 ZNfMGcxKk2aOHWjOX9OYH46tO6umnn4dSwesF+PrLA7y2PS0BZwwP7mN9+9ltmiHJwKwxzE9
 zmdl4j/KiMwFcbGxRSLy2CPgePSwiTyQrwWSJTto5aGh3XMnzdOWXX6T2CTo/C/hlSvRtF3J
 Ekd+y5opq83nGS7Q9+4UxCmrXqsuh8HR8EWA+A88BuKyKff/0CeHGdsZiFFQMwrsokxXzNC/
 l2Dks7tBDdvmKaIUn/b/bCRxRu7ISUPJHUOTTMFRwACpdLkpekOYgnnF4g5VvTv15usRG+2m
 mrRxMQju1kNpZ4l8pT81GmXvwyxq76ZHits7VnXDkvwu2uVe7WZi5yUBUnztKgRdN3IFQnZ4
 BDoiODFsrlQUMjleDilBbxUQer3v6vt3Cj02wYHInU3y9i6F5dPl6h06So2GkpmO91sldTBM
 B6K4lM5CHO+0RKXgU5Lj2GZUZ5CIVDIT4iNaxwtRoMmjmJNXAGG5jpyQkWbwnrglkMh+YlmZ
 8bDKpfyVylLUvw4pNZTewv7+eV1rszZ7TqNLa0XMjz9iebODJJrYelt3KSyghARs/rf/VS9H
 yd3PMqW0RRPONASkQGOmbP/2WsidCBhbbiv8pw/SwJ2ClY+cI3XI6OLkOxJlk0Mt/g9q9okC
 VnmABICkwOm2iGaQehIA1g6AI7SsV9EhSpTFUQR0ZyAghDPva7HAH8jSqYK
IronPort-HdrOrdr: A9a23:UsuBzqzBzwt/QUu2Q3D2KrPwKL1zdoMgy1knxilNoHtuA6ulfq
 GV7ZAmPHrP4wr5N0tNpTntAsa9qBDnlaKdg7N+AV7KZmCP0gaVxepZjLfK8nnNHDD/6/4Y9Y
 oISdkaNDQoNykYsS8t2njbL+od
X-Talos-CUID: =?us-ascii?q?9a23=3AAqcmq2pph5WINfvJLoj+Ep7mUZALV0ya5U6AH3G?=
 =?us-ascii?q?lBEA5GJjMQgOQqIoxxg=3D=3D?=
X-Talos-MUID: =?us-ascii?q?9a23=3AQt5qyQ5U+lBB3eyVbA6NIQfExoxayYW0UUwjn6w?=
 =?us-ascii?q?UmM6IKHN3Mi2jiGieF9o=3D?=
X-IronPort-AV: E=Sophos;i="6.01,235,1684814400"; 
   d="scan'208";a="117524933"
Date: Thu, 27 Jul 2023 14:42:02 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Jason Andryuk <jandryuk@gmail.com>
CC: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>, Jan Beulich
	<jbeulich@suse.com>
Subject: Re: [PATCH v7 14/15] xenpm: Add set-cpufreq-cppc subcommand
Message-ID: <52e1d50f-4cd5-4933-b741-400d02fe97ce@perard>
References: <20230726170945.34961-1-jandryuk@gmail.com>
 <20230726170945.34961-15-jandryuk@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230726170945.34961-15-jandryuk@gmail.com>

On Wed, Jul 26, 2023 at 01:09:44PM -0400, Jason Andryuk wrote:
> set-cpufreq-cppc allows setting the Hardware P-State (HWP) parameters.
> 
> It can be run on all or just a single cpu.  There are presets of
> balance, powersave & performance.  Those can be further tweaked by
> param:val arguments as explained in the usage description.
> 
> Parameter names are just checked to the first 3 characters to shorten
> typing.
> 
> Some options are hardware dependent, and ranges can be found in
> get-cpufreq-para.
> 
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> Acked-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 13:45:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 13:45:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571125.894211 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP1JI-0006QH-HW; Thu, 27 Jul 2023 13:45:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571125.894211; Thu, 27 Jul 2023 13:45:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP1JI-0006QA-Er; Thu, 27 Jul 2023 13:45:44 +0000
Received: by outflank-mailman (input) for mailman id 571125;
 Thu, 27 Jul 2023 13:45:42 +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
 <SRS0=o85N=DN=citrix.com=prvs=5659ebe79=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qP1JG-0006Q4-OF
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 13:45:42 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id de846668-2c83-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 15:45:40 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: de846668-2c83-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690465539;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=h352hLwI0Tv3nQmo4STYZiYCwMoedDG49b8TEL0h0UA=;
  b=S8PNG7c7xIrEWYpw9ow+5YYMliFTWEuF52xaAkKPmJPOti+vXEJWjXvw
   PMAtIRM3rLIRSNgvOVLpsQ4wf/9Pb3dqFMkT9veSgT9oKqALnA+4slJva
   xik7i/Xcs3khH2NuDXTL/+pD7FjwbaD7Rmxvx/7ut6Tw5YQlQTaIpsNni
   0=;
Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 117525348
X-Ironport-Server: esa2.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:+wqk46yKiHw826Cl8dZ6t+fRxirEfRIJ4+MujC+fZmUNrF6WrkUAz
 GIYDGvUbv6NMTSne4pxYY23oRhSuMKEmtdlSwRtqCAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhP68T5jcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KTBlt
 uESNSxVVyHZrvmw26uwF7R8of12eaEHPKtH0p1h5TTQDPJgSpHfWaTao9Rf2V/chOgXQ6yYP
 ZBAL2MyMlKZOUYn1lQ/UfrSmM+hgGX/dDtJ7kqYv6Mt70DYzRBr0airO93QEjCPbZwMwRvC+
 zmarwwVBDk5M9OF5Bekykj3n6jMtjL4WpIZE+aBo6sCbFq7mTVIVUx+uUGAid69h02lUtRTM
 Xso6zEupqg/8k+sZtTlVhj+q3mB1jYMVtwVH+Ak5QWlzqvP/x3fFmUCViRGatEtqIkxXzNC/
 kCNt8PkA3poqrL9YXWZ+7SPsSKpOQAaKGYDYWkPSg5ty9vsuoYolTrUU81uVqWyi7XdBzDqz
 iuK6isjgrwJpcoK0ayh+hbAmT3EjpHRQxQ8/An/QmOv5QQ/b4mgD7FE8nCCs6wGdtzACADc4
 j5dwZP2AP0y4Y+lxQfOXe8QAOmQ1qysKzvHmFUyQokGzmH4k5K8Rry88A2SNW8wbJdcIm6yM
 BeP0e9CzMQNZSX3NMebd6r0Up13lva4SLwJQ9iONrJzjo5NmBhrFc2ETWqZxCjTnUclisnT0
 r/LIJ/3XR725UmKpQdaptvxMpdxnEjSPUuJGfjGI+2PiNJynkK9R7YfK0epZesk9q6Cqwi92
 48BZpPRmksFD7ylOna/HWsvwbYidyZT6Xfe8pI/SwJ+ClA+RDFJ5wH5n9vNhLCJb4wKz7yVr
 xlRq2dTyUblhG2vFOl5QikLVV8bZr4m9ShTFXV1bT6VN40LPd7HAFE3K8FmItHKNYVLkZZJc
 hXyU57aX64UE22Yp2l1gFuUhNUKSSlHTDmmZ0KNCAXTtbY7L+AV0rcIpjfSyRQ=
IronPort-HdrOrdr: A9a23:YgexKqPNAT8HnsBcTv6jsMiBIKoaSvp037Dk7TEJdfU1SL3hqy
 nKpp4mPHDP+VMssR0b6LK90ey7MBDhHP1OgLX5X43SODUO0VHAROpfBMnZowEIcBeOkdK1u5
 0QFZSWy+edMbG5t6vHCcWDfOrICePozJyV
X-Talos-CUID: 9a23:vHcyS20s0ECxOgV0pBoqJLxfS+tmb3fA0C/pEhWREmByUbbIFE+3wfYx
X-Talos-MUID: 9a23:gTNmMATeXBMc+MI1RXTPgz54GepJ2571EQcOuoQFudmPMndJbmI=
X-IronPort-AV: E=Sophos;i="6.01,235,1684814400"; 
   d="scan'208";a="117525348"
Date: Thu, 27 Jul 2023 14:45:28 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Wei Liu
	<wl@xen.org>, Oleksandr Tyshchenko <olekstysh@gmail.com>, Juergen Gross
	<jgross@suse.com>, Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: [PATCH] libxl: Add missing libxl__virtio_devtype to
 device_type_tbl array
Message-ID: <0bca0a3b-2a74-42c7-96d2-23f6dab7d169@perard>
References: <20230726141459.985463-1-olekstysh@gmail.com>
 <670c22f9-135d-4022-8272-78af3e28c011@perard>
 <5360d7ae-b754-99f9-686f-882bdc33e7eb@epam.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <5360d7ae-b754-99f9-686f-882bdc33e7eb@epam.com>

On Thu, Jul 27, 2023 at 10:38:03AM +0000, Oleksandr Tyshchenko wrote:
> 
> 
> On 27.07.23 12:50, Anthony PERARD wrote:
> 
> Hello Anthony
> 
> > On Wed, Jul 26, 2023 at 05:14:59PM +0300, Oleksandr Tyshchenko wrote:
> >> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> >>
> >> Without it being present it won't be possible to use some
> >> libxl__device_type's callbacks for virtio devices as the common code
> >> can only invoke these callbacks (by dereferencing a pointer) for valid
> >> libxl__device_type's elements when iterating over device_type_tbl[].
> > 
> > Did you notice an issue with it been missing from device_type_tbl[] ?
> > Because to me it looks like all the functions that are using
> > device_type_tbl will just skip over virtio devtype.
> > 
> > domcreate_attach_devices:
> >      skip virtio because ".skip_attach = 1"
> > 
> > libxl__need_xenpv_qemu:
> >      skip virtio because "dm_needed" is NULL
> > 
> > retrieve_domain_configuration_end:
> >      skip because "compare" is "libxl_device_virtio_compare" which is NULL
> > 
> > libxl__update_domain_configuration:
> >      skip because "update_config" is NULL.
> > 
> > So, I think the patch is fine, adding virtio to the device_type_tbl
> > array is good for completeness, but the patch description may be
> > misleading.
> > 
> > Did I miss something?
> 
> No, you didn't.
> 
> Just to be clear, there is no issue within *current* the code base, I am 
> experimenting with using device-model bits, so I implemented 
> libxl__device_virtio_dm_needed() locally and noticed that it didn't get 
> called at all, the reason was in absence of libxl__virtio_devtype in the 
> said array.
> 
> Do you agree with the following addition to the commit description?
> 
> "Please note, there is no issue within current the code base as virtio 
> devices don't use callbacks that depend on libxl__virtio_devtype 
> presence in device_type_tbl[]. The issue will appear as soon as we start
> using these callbacks (for example, dm_needed)."

Yes, that would be fine. With that addition:
Acked-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 13:54:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 13:54:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571127.894222 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP1Rp-0007ue-C0; Thu, 27 Jul 2023 13:54:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571127.894222; Thu, 27 Jul 2023 13:54:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP1Rp-0007uX-8W; Thu, 27 Jul 2023 13:54:33 +0000
Received: by outflank-mailman (input) for mailman id 571127;
 Thu, 27 Jul 2023 13:54:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=3xgU=DN=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qP1Rn-0007uR-L1
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 13:54:31 +0000
Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com
 [2a00:1450:4864:20::52f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1badc0b2-2c85-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 15:54:30 +0200 (CEST)
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-5217ad95029so1225953a12.2
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 06:54:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1badc0b2-2c85-11ee-b248-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690466070; x=1691070870;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=uEPAt50EPWPd1oIQlbGSziqNoWm4lplgVDe3aNcVQK4=;
        b=Ckcrm7ZZn+x5q7Wm1ayO/T/Ya68nwAzf/N5iXtjbvLK5nDvCSA27FgWRKDOAMDwKTi
         IeYdYCAfTX8f0v2FrxeeO7pgydrNakILUAjYuNibcVyt56/HlWrzaC1Adqv+sQtxkeHB
         cr2C7dmV++q2wiR2SRZyrFaHWxyNqaDmGikbvsPvy4ofzE+8dKmmhHzaLDnHWwvmbWVd
         GEtUsMMu9WS9rcdPvFfIBNIkNsP6WLLIZRQuhA3QLDrCKzLBWfaRuOvKEfxxAkV7TKcI
         yImmAIhM03thDyHkPoP3FXpzMtGKLKW1KbjxEvG53805FcgsSilt6lOfU32ECRyWst2p
         WoJQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690466070; x=1691070870;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=uEPAt50EPWPd1oIQlbGSziqNoWm4lplgVDe3aNcVQK4=;
        b=WK0H8AGJDv9otF+DSIl8xknAX+E0CWyaiWPaFlyI4Szilnx+SAbEtUoc3MJm2hoUmH
         AAv3iQ8n1PDGj6ixq9YHtSJIrzjF2pZPbA1x8dJN7cp22mVGnbd2+/kuf3gU0sjD+6tO
         N6dN8qAaBzSJRnui7+QaiKrxYrgAIQafhTMz4vI/CBO5g7DI74n7CeR4CD8RZudZtUvD
         KwEDm21k1atc6Nhf/y+EbGOPEvL/jhAXiUk2PDNdDqRdRYhjxwy36qGgswS9xExC+9pK
         iheMTP4HXvmIhAx821gsyTX98SNNqj6qLua8M2PUHkwOruFVPn0yyLO7RxODJy+jhVw8
         ebCQ==
X-Gm-Message-State: ABy/qLbTjE6UeWv3U7YxQFlqdPyU1X8ouVzfO7N2TRiaF+qLOajTBpwE
	M7QupPDVvbjdhyup7F1stiO78LF4JLQ91XlM008=
X-Google-Smtp-Source: APBJJlESYiEL1J7UbNdm17D8gS15bKoOs652nNHMIdt7qKwduXVWSe4ZW9BzoIY/xI29FGl2oj5DNeScmcmxs2/O2So=
X-Received: by 2002:a05:6402:32c:b0:51d:9db8:8257 with SMTP id
 q12-20020a056402032c00b0051d9db88257mr1633916edw.30.1690466069502; Thu, 27
 Jul 2023 06:54:29 -0700 (PDT)
MIME-Version: 1.0
References: <20230726170945.34961-1-jandryuk@gmail.com> <20230726170945.34961-12-jandryuk@gmail.com>
 <882c0e9f-8e66-4be3-aecf-477d38da9371@perard>
In-Reply-To: <882c0e9f-8e66-4be3-aecf-477d38da9371@perard>
From: Jason Andryuk <jandryuk@gmail.com>
Date: Thu, 27 Jul 2023 09:54:17 -0400
Message-ID: <CAKf6xpvrh1Y7j3pb506pNgQMgsKM0OmdbKqQtrLBXUPdMqZS6w@mail.gmail.com>
Subject: Re: [PATCH v7 11/15] xenpm: Print HWP/CPPC parameters
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>, 
	Jan Beulich <jbeulich@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 27, 2023 at 7:32=E2=80=AFAM Anthony PERARD
<anthony.perard@citrix.com> wrote:
>
> On Wed, Jul 26, 2023 at 01:09:41PM -0400, Jason Andryuk wrote:
> > @@ -772,6 +812,32 @@ static void print_cpufreq_para(int cpuid, struct x=
c_get_cpufreq_para *p_cpufreq)
> >                 p_cpufreq->u.s.scaling_min_freq,
> >                 p_cpufreq->u.s.scaling_cur_freq);
> >      }
> > +    else
> > +    {
>
> I feel like this could be confusing. In this function, we have both:
>     if ( hwp ) { this; } else { that; }
> and
>     if ( !hwp ) { that; } else { this; }
>
> If we could have the condition in the same order, or use the same
> condition for both "true" blocks, that would be nice.

Makes sense.  From your comment on patch 8, I was thinking of
switching to a bool scaling_governor and using that.  But now I think
hwp is better since it's the specific governor - not the default one.
In light of that, I would just re-organize everything to be "if ( hwp
)".

With that, patch 8 is more of a transitive step, and I would leave the
"if ( !hwp )".  Then here in patch 11 the HWP code would be added
first inside "if ( hwp )".  Does that sound good?

> > +        const xc_cppc_para_t *cppc =3D &p_cpufreq->u.cppc_para;
> > +
> > +        printf("cppc variables       :\n");
> > +        printf("  hardware limits    : lowest [%u] lowest nonlinear [%=
u]\n",
> > +               cppc->lowest, cppc->lowest_nonlinear);
>
> All these %u should be %"PRIu32", right? Even if the rest of the
> function is bogus... and even if it's probably be a while before %PRIu32
> is different from %u.

Yes, you are correct.  In patch 8 "xenpm: Change get-cpufreq-para
output for hwp", some existing %u-s are moved and a few more added.
Do you want all of those converted to %PRIu32?

Thanks,
Jason


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 14:19:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 14:19:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571131.894232 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP1py-00028k-BE; Thu, 27 Jul 2023 14:19:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571131.894232; Thu, 27 Jul 2023 14:19:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP1py-00028d-7V; Thu, 27 Jul 2023 14:19:30 +0000
Received: by outflank-mailman (input) for mailman id 571131;
 Thu, 27 Jul 2023 14:19:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Us1z=DN=citrix.com=prvs=565118259=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qP1pw-00028X-SD
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 14:19:29 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 96d6640a-2c88-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 16:19:27 +0200 (CEST)
Received: from mail-bn8nam11lp2168.outbound.protection.outlook.com (HELO
 NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.168])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 27 Jul 2023 10:19:24 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by BN9PR03MB6073.namprd03.prod.outlook.com (2603:10b6:408:136::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 14:19:21 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 14:19:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 96d6640a-2c88-11ee-b248-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690467567;
  h=date:from:to:cc:subject:message-id:references:
   in-reply-to:mime-version;
  bh=9WjXrcRmfMv116yU7xIlm0tWeCzly68594VploG+xww=;
  b=bX1tUKKnC8cokE3BvnUN4yDWPw2zVkJxPLlWMo0fHgUJkwqIlRxLmolO
   VN04BpFmfaAEN8WgW/MU/ZM7yzx2jThdcr2tDx3Olsdo7USNYaDlm40pH
   sE7+ODVr6Hx5VC5QoIuP0viNxs8CeUIJZUh8d18p/RcHibZLBvIVBExO0
   Y=;
X-IronPort-RemoteIP: 104.47.58.168
X-IronPort-MID: 118089751
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:6C0KIKOPXCXAbYnvrR1nlsFynXyQoLVcMsEvi/4bfWQNrUoi3zMOn
 TdLDG+BPaqPYWunfNh1bovk90IAvZ+ByoVmQQto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v
 63yTvGacajYm1eF/k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?=
X-Talos-MUID: 9a23:/EE9HwqcAsOF+iXy6nAezzVBCflK/5v+M1wUk6teo5TVFCVpFijI2Q==
X-IronPort-AV: E=Sophos;i="6.01,235,1684814400"; 
   d="scan'208";a="118089751"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Eoix8PqLt9REgjF+hiKxHQhJn8qHPtswmU6YGetmVjJ7LE2JtK/4qnldrkBMEnAVQafLoW5KTtiVKmOz4srqiJqZchOzy3DiFt+Ny64Cxa5n3HJ/YzkS/pos0r3BLmGeUkYnciIsPjRwxszXD45xGIw+VEF5LhVvKJJ2Hs5MBjgCN34XTu83YqtTjPGlPGxuW9K7KU2CmSi94PgVX99qM4TtghfPESnGuz81Pe8COFCbgcP36kzr9DACqbPffHDGhsoKyr+vU0H2wM/SaWBcnyt1bBlBvWtPsVTEVqIvRhDH1G/zZMF4135Msixb4X3RZKkwGRVHddOsa0kqSul5HA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ZJXkHpHAk1rR5kktsJKiq/Dpntj8OpcKOqnnMgYJ2OU=;
 b=BAuq7Tanrzx6MSGRYbOFmFnFuwbfXNjzjrGMDW0wB+VwZM694d8/FhZ5ncdKjx3rNmIN15WAroCKyk/XfymTx9F4bnpY9WMr9uyXlQ+taV6pS/JK2yTP4EMRHnn+TdpG3hSO0/M9hoYOeUOKm0egacMnJV6Mi/gnlVmJQ44ODA3wm/nD7SZbthLK8rcSh0ec/rHuMLMQ/N9fE0MJ+dYaSqYmAkcE+LCEryN06ObSb0/fQLdf+WIoQL3MDCrVxAinHmFOsYyLZd+o2hcrHLJX88mofjrDevMhydVXrp0zjXL6e39YOm47CDRDWWHqJzEjLK/KuEFe7M9HEUnGO5aXrA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ZJXkHpHAk1rR5kktsJKiq/Dpntj8OpcKOqnnMgYJ2OU=;
 b=gX34IoBlLt3AEQGC3mkpNhPBGXnulYhaH1Z7czExB+8K4a7eFdlDE1qOUMdls8gzHKOVYfK5K4twVH8g4FDglBJquU2uNWysGhwn4YbhU/3PyInshPVdgyHqsgtDih+2m7E/mTypjBXQn7gM7ctRbPb20UVovP3FZV98WDeM0mw=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Thu, 27 Jul 2023 16:19:14 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	Kevin Tian <kevin.tian@intel.com>, Paul Durrant <paul@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 4/4] x86/iommu: pass full IO-APIC RTE for remapping
 table update
Message-ID: <ZMJ84u9_tDBcc5xN@MacBook-Air-de-Roger.local>
References: <20230726125508.78704-1-roger.pau@citrix.com>
 <20230726125508.78704-5-roger.pau@citrix.com>
 <4e9681c7-472e-ee6b-38e7-fc7fb28a2b07@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <4e9681c7-472e-ee6b-38e7-fc7fb28a2b07@suse.com>
X-ClientProxiedBy: LO4P265CA0286.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:38f::13) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|BN9PR03MB6073:EE_
X-MS-Office365-Filtering-Correlation-Id: adf47f6d-9685-4e64-6efe-08db8eac7856
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	PApk3cqul/qcV6CPzkX/EBE7BrBT5V76edLSVbZDx8l48tgyB15ujKXtImo7GC1ZDcYokR9BUdkUOo+xgeRkGylrqs0IAeYc+zehu7BaIg1j1DR0O7gnQcA+zOZkUSWXoTyGyIin5X2KugKcKHAJnAhizc09l+Q39HZGpdf3EYyGFaWxNTqK2y+iwvdEHVYCtoRTIRkZte0RJndfQzlFM2L/GFNKGw1mkrZ/P2i94qUHhXCmOVBXtQV5R8rqwjDUtYjyRVytHCqB3USAdpVkVhAmf5tUHv3qQGBhvSM9r21o1qyIfEh9sJdIBg7wM6jQ3YMOvIpr33/NmtLw0BZ1Vqf2AcS0HxbS1PXhH6OKDP9mVEytr6TTBzHEFSFXjr1/qyW4cH1fU6QTzg/TCLEogwRmYmOHS9KAEwRCbJH/mixWvBA1TA9IYfWu/BrGX81XM23VOWdyW77ZlBWmeTP7qFoDP6O2yFK9EyAv6Yt53wATwNkDsuzLGmByqtUD+W5VeFgJ3yB8c5d/5TOdoORJRVkYZ9utpPSr7xszFvMA6KgFrGSVurV53RV5YrVMXvfa
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(136003)(39860400002)(376002)(366004)(451199021)(9686003)(6666004)(54906003)(6512007)(6486002)(478600001)(66556008)(53546011)(186003)(26005)(6506007)(15650500001)(66476007)(2906002)(4326008)(316002)(5660300002)(8676002)(8936002)(41300700001)(66946007)(82960400001)(6916009)(38100700002)(85182001)(86362001)(83380400001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TVcrWTB0cEpLVmRVdjhVZ2lDS3lQL0tkdVJ3OXA4UHhoWis1MWx4UnVhV014?=
 =?utf-8?B?NzhxSUcxK1YycEtuQVVINllKR3BuQVpyYUJLMkYxbWYxREN5dzlUZ2g5RVFS?=
 =?utf-8?B?dm9nVyttMEtwdG5BVmJFdzFSMSt3UzNVWlZiZFBYdm8wYkVHYW9WU2xSMVJO?=
 =?utf-8?B?NWlpaEN2OUdPZkcxSm5leEQ1VEhYQ1RrSnBHQWc2QW41NEtBSnpuS05uY2Rj?=
 =?utf-8?B?ejZmNGZEQ2VLdHpDQzdqOFJjTVFNU2ZMTWwyMk9EVHZQZnZVY2dFTFlBSVJN?=
 =?utf-8?B?eWZrUXBHVlF1Q2wwY3JkZnZLaWtlV001N1hSUmsxQlZWbDNxakxSSjJqTHNH?=
 =?utf-8?B?NWwwLzFHOGlHUVR3RUxZTGxVa21jWGNJUTA1d1ZLVFhZK3V0cGdnbnlFMTFC?=
 =?utf-8?B?REIzL0xFSEUwb082WXpBcWNrdlMzcmlTUzFieEo4dm5qSExJY3hhNjBkb1lB?=
 =?utf-8?B?bklyQStQdkZwNkZRcEF4QVU0SEpuTGdESE9pS3piL3FUeHJmV0JCS2Iwa05x?=
 =?utf-8?B?RUV1bXZQUXNqRGo3aERsdUNyV3BoNHN5TUtUdUFBZTFlSXBIcm5yNzhnZC9C?=
 =?utf-8?B?bWZHQUptQUxRNHNEYk1SdE1xbmJpTW5NL2xYWENmOS92RHZBU2RueVNBK1F0?=
 =?utf-8?B?TTViQldzejhmR2FjUG5jcXZQdUxhL28veWpiQjdwM2VqcjVDNmFSM29y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wNJYsZttx7jAGIVm3IfUAKCwawb4UDvIygSyJ4dDyLOjR4mhcTXMwcyMXaA7lhmFcmJDMOIHBQbVFPb7YU4jGE4YsoAKXGOEdlZpvQJxkpNaeLZjYZomQ0toUHq+jaAjRqgZ4zSw46l33r226FzJ2h3C8gpLh0GSkVyZ/I8kbTRLEVq7xFnlsHbnXWE7RLkP7QEfdgo5zRSWZdWsfyBHDl5z3hfkFg1TC8K7FGKlWpU636ZW8arjHgnyNkoKp2pz8aAw/5TnQ5DKPVSNxO0zu0M4mmz6wP9UD7qU+RY9C8N0DTb3F648VD/KGF1NI4jquAYeIbH3c/U2z/B2i60Jce9d0UMjOEj5RnK+QlJgF6MCFSIgYG4BuZ4NzcwpWJoozUKEHQO62bSX2OBTyeDO4ekvafrGmgOJf2m8L6VqmugR1dpztBzreUSa6BMJYQzH2BqSUnnyM8DmHViLYqVodX/t+1scjst82o+Y2aW/SF3vBlAQlQJY5SPFj9ZDn8eODiTkp5cc0VkUiuT54fMS9t/tuaPK11dy34qwDhU19VcQd07MjI5i2WkDaB+FMV2JiWrXQ=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: adf47f6d-9685-4e64-6efe-08db8eac7856
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 14:19:21.1556
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: JpEQ/P72HX2gZsLZXAZhp8Yfm+tt5kx+v7EnElx57QQ9qeJQvyx2vBquZ2cVZafkL+Fp3zUYFpPkHEDD7mu04w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR03MB6073

On Thu, Jul 27, 2023 at 02:39:06PM +0200, Jan Beulich wrote:
> On 26.07.2023 14:55, Roger Pau Monne wrote:
> > @@ -439,36 +430,45 @@ unsigned int cf_check io_apic_read_remap_rte(
> >  }
> >  
> >  void cf_check io_apic_write_remap_rte(
> > -    unsigned int apic, unsigned int reg, unsigned int value)
> > +    unsigned int apic, unsigned int pin, uint64_t rte)
> >  {
> > -    unsigned int pin = (reg - 0x10) / 2;
> > +    struct IO_xAPIC_route_entry new_rte = { .raw = rte };
> >      struct IO_xAPIC_route_entry old_rte = { };
> > -    struct IO_APIC_route_remap_entry *remap_rte;
> > -    unsigned int rte_upper = (reg & 1) ? 1 : 0;
> >      struct vtd_iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic));
> > -    int saved_mask;
> > -
> > -    old_rte = __ioapic_read_entry(apic, pin, true);
> > +    bool masked = true;
> > +    int rc;
> >  
> > -    remap_rte = (struct IO_APIC_route_remap_entry *) &old_rte;
> > -
> > -    /* mask the interrupt while we change the intremap table */
> > -    saved_mask = remap_rte->mask;
> > -    remap_rte->mask = 1;
> > -    __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
> > -    remap_rte->mask = saved_mask;
> > -
> > -    if ( ioapic_rte_to_remap_entry(iommu, apic, pin,
> > -                                   &old_rte, rte_upper, value) )
> > +    if ( !cpu_has_cx16 )
> >      {
> > -        __io_apic_write(apic, reg, value);
> > +       /*
> > +        * Cannot atomically update the IRTE entry: mask the IO-APIC pin to
> > +        * avoid interrupts seeing an inconsistent IRTE entry.
> > +        */
> > +        old_rte = __ioapic_read_entry(apic, pin, true);
> > +        if ( !old_rte.mask )
> > +        {
> > +            masked = false;
> > +            old_rte.mask = 1;
> > +            __ioapic_write_entry(apic, pin, true, old_rte);
> > +        }
> > +    }
> >  
> > -        /* Recover the original value of 'mask' bit */
> > -        if ( rte_upper )
> > -            __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
> > +    rc = ioapic_rte_to_remap_entry(iommu, apic, pin, &old_rte, new_rte);
> > +    if ( rc )
> > +    {
> > +        if ( !masked )
> > +        {
> > +            /* Recover the original value of 'mask' bit */
> > +            old_rte.mask = 0;
> > +            __ioapic_write_entry(apic, pin, true, old_rte);
> > +        }
> > +        dprintk(XENLOG_ERR VTDPREFIX,
> > +                "failed to update IRTE for IO-APIC#%u pin %u: %d\n",
> > +                apic, pin, rc);
> 
> Afaics you don't alter the error behavior of ioapic_rte_to_remap_entry(),
> and in the sole (pre-existing) case of an error a debug log message is
> already being issued. Why the addition?

I think I was trying to mimic the behavior of
amd_iommu_ioapic_update_ire(), which does print the errors as opposed
to doing so in update_intremap_entry_from_ioapic().

I've now removed it, and adjusted the code to match the rest of your
comments.  Will post v4 of 4/4 only as a reply to v3, I don't think
there's a need to resend the rest unless you prefer it that way.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 14:28:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 14:28:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571134.894242 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP1yh-0003ic-9d; Thu, 27 Jul 2023 14:28:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571134.894242; Thu, 27 Jul 2023 14:28:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP1yh-0003iV-6Z; Thu, 27 Jul 2023 14:28:31 +0000
Received: by outflank-mailman (input) for mailman id 571134;
 Thu, 27 Jul 2023 14:28:29 +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 <SRS0=8wl5=DN=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qP1yf-0003iP-Py
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 14:28:29 +0000
Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com
 [2a00:1450:4864:20::131])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id da14dbbd-2c89-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 16:28:27 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-4fb960b7c9dso1877212e87.0
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 07:28:27 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: da14dbbd-2c89-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690468107; x=1691072907;
        h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
         :date:message-id:reply-to;
        bh=s9ahMakn0xR+k1w0lDlVVqaf5hQgGYAB74KigutUxbI=;
        b=W+ZT/L/9o5MRISlsC5IbwVJAIUOREjLdvz44100YymjDCz/SEAKK9xCreGeF74ZEw3
         Nys9pu/MqZd5hHjaOIDOSUAmOZLiJSpjDHXQkdaJc1puAcXnL89ZDr3FarLgFr7QD5Nl
         I/jdCpiuWojhdOdVcvlL2TD/mLFNMoNte/7Iw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690468107; x=1691072907;
        h=to:subject:message-id:date:from:mime-version:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=s9ahMakn0xR+k1w0lDlVVqaf5hQgGYAB74KigutUxbI=;
        b=EnJ/rmvaNTGP7JjiStPtk+fSyhh7nhnlaYR+i/hX3zwUbi6cjeZsnpwFBDkStffnrY
         Qddh0qXTy/TNiLFwfjiqgWTVGUiyszCjlea1WUEFVpjn9pwM0PBlAcujTCqbcPXENzPH
         f57erTunijtoXf+HlbEhiMB0gGexfk6vYEj70ahukVFW6e78zep2fHqEbbrMz2QqwrY5
         ZT6YzFfxZTKT7eTi9XTwD5/uMaLFjp/XqkEOrfEd+UeFFeP4HYbPvUKBPvgYu0RoA1hL
         zbep3t7qTZfFG8aPG/6xlg12LkBDIgdT+zQ6LUuG0Hk7wy49pevEq5Z8VJqIBsizIIg1
         QoEA==
X-Gm-Message-State: ABy/qLbhLDRAPedYlEQqrOO3gvq0IOHGj8dTJONZD98+VcTwtm+Gsewa
	zmbOOSm46dzwt6ct4y1JTiFzkZT+hd7HSy5SN02Bs7OmzoVxBNHKNBsBzg/L
X-Google-Smtp-Source: APBJJlErGuhybN8B7FVWJr3J2pEJo6EQU8WgVQNMM6mpeyk4pELcjF0x22Pb8TEJKP84kpHq6Uw9obRnCSNUn+y9KJY=
X-Received: by 2002:ac2:465c:0:b0:4fb:8492:83fb with SMTP id
 s28-20020ac2465c000000b004fb849283fbmr1759692lfo.68.1690468106795; Thu, 27
 Jul 2023 07:28:26 -0700 (PDT)
MIME-Version: 1.0
From: George Dunlap <george.dunlap@cloud.com>
Date: Thu, 27 Jul 2023 15:28:15 +0100
Message-ID: <CA+zSX=ZmedcCdDi1xNjhxW-TCiuswm5+=Gd72hvEQGet5coTrA@mail.gmail.com>
Subject: [ANNOUNCE] Call for agenda items for 3 August Community Call @ 1500 UTC
To: Xen-devel <xen-devel@lists.xenproject.org>, 
	Tamas K Lengyel <tamas.k.lengyel@gmail.com>, "intel-xen@intel.com" <intel-xen@intel.com>, 
	"daniel.kiper@oracle.com" <daniel.kiper@oracle.com>, Roger Pau Monne <roger.pau@citrix.com>, 
	Sergey Dyasli <sergey.dyasli@citrix.com>, 
	Christopher Clark <christopher.w.clark@gmail.com>, Rich Persaud <persaur@gmail.com>, 
	Kevin Pearson <kevin.pearson@ortmanconsulting.com>, Juergen Gross <jgross@suse.com>, 
	Paul Durrant <pdurrant@amazon.com>, "Ji, John" <john.ji@intel.com>, 
	"edgar.iglesias@xilinx.com" <edgar.iglesias@xilinx.com>, 
	"robin.randhawa@arm.com" <robin.randhawa@arm.com>, Artem Mygaiev <Artem_Mygaiev@epam.com>, 
	Matt Spencer <Matt.Spencer@arm.com>, Stewart Hildebrand <Stewart.Hildebrand@amd.com>, 
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>, Jeff Kubascik <Jeff.Kubascik@dornerworks.com>, 
	Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
	Rian Quinn <rianquinn@gmail.com>, "Daniel P. Smith" <dpsmith@apertussolutions.com>, 
	=?UTF-8?B?4oCL4oCL4oCL4oCL4oCL4oCL4oCLRG91ZyBHb2xkc3RlaW4=?= <cardoe@cardoe.com>, 
	George Dunlap <george.dunlap@citrix.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	=?UTF-8?B?4oCL4oCL4oCL4oCL4oCL4oCL4oCLQW1pdCBTaGFo?= <amit@infradead.org>, 
	=?UTF-8?B?4oCL4oCL4oCL4oCL4oCL4oCL4oCLVmFyYWQgR2F1dGFt?= <varadgautam@gmail.com>, 
	Brian Woods <brian.woods@xilinx.com>, Robert Townley <rob.townley@gmail.com>, 
	Bobby Eshleman <bobby.eshleman@gmail.com>, 
	=?UTF-8?B?4oCL4oCL4oCL4oCL4oCL4oCL4oCLQ29yZXkgTWlueWFyZA==?= <cminyard@mvista.com>, 
	Olivier Lambert <olivier.lambert@vates.fr>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	Ash Wilding <ash.j.wilding@gmail.com>, Rahul Singh <Rahul.Singh@arm.com>, 
	=?UTF-8?Q?Piotr_Kr=C3=B3l?= <piotr.krol@3mdeb.com>, 
	Brendan Kerrigan <brendank310@gmail.com>, Thierry Laurion <insurgo@riseup.net>, 
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, Scott Davis <scottwd@gmail.com>, 
	Anthony PERARD <anthony.perard@citrix.com>, Michal Orzel <michal.orzel@amd.com>, 
	Marc Ungeschikts <marc.ungeschikts@vates.fr>, Zhiming Shen <zshen@exotanium.io>, 
	Xenia Ragiadakou <burzalodowa@gmail.com>, 
	=?UTF-8?B?4oCL4oCL4oCL4oCL4oCL4oCL4oCLSGVucnkgV2FuZw==?= <Henry.Wang@arm.com>, 
	Per Bilse <per.bilse@citrix.com>, Samuel Verschelde <stormi-xcp@ylix.fr>, 
	Andrei Semenov <andrei.semenov@vates.fr>, Yann Dirson <yann.dirson@vates.fr>, 
	Bernhard Kaindl <bernhard.kaindl@cloud.com>, 
	=?UTF-8?B?4oCL4oCL4oCL4oCL4oCL4oCL4oCLTHVjYSBGYW5jZWxsdQ==?= <luca.fancellu@arm.com>, 
	=?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>, 
	Vikram Garhwal <vikram.garhwal@amd.com>, Kelly Choi <kelly.choi@cloud.com>
Content-Type: multipart/alternative; boundary="0000000000000291ff060178c72f"

--0000000000000291ff060178c72f
Content-Type: text/plain; charset="UTF-8"

Hi all,

The proposed agenda is in
https://cryptpad.fr/pad/#/2/pad/edit/Rk5kDLwcc7CrqFm6O7xq2Jci/ and you can
edit to add items.  Alternatively, you can reply to this mail directly.

Agenda items appreciated a few days before the call: please put your name
besides items if you edit the document.

Note the following administrative conventions for the call:
* Unless, agreed in the previous meeting otherwise, the call is on the 1st
Thursday of each month at 1600 British Time (either GMT or BST)
* I usually send out a meeting reminder a few days before with a
provisional agenda

* To allow time to switch between meetings, we'll plan on starting the
agenda at 16:05 sharp.  Aim to join by 16:03 if possible to allocate time
to sort out technical difficulties &c

* If you want to be CC'ed please add or remove yourself from the
sign-up-sheet at
https://cryptpad.fr/pad/#/2/pad/edit/D9vGzihPxxAOe6RFPz0sRCf+/

Best Regards
George


== Dial-in Information ==
## Meeting time
16:00 - 17:00 British time
Further International meeting times:
<https://www.timeanddate.com/worldclock/meetingdetails.html?year=2020&month=4&day=2&hour=15&min=0&sec=0&p1=1234&p2=37&p3=224&p4=179>
<https://www.timeanddate.com/worldclock/meetingdetails.html?year=2021&month=04&day=8&hour=15&min=0&sec=0&p1=1234&p2=37&p3=224&p4=179>
https://www.timeanddate.com/worldclock/meetingdetails.html?year=2023&month=8&day=3&hour=15&min=0&sec=0&p1=1234&p2=37&p3=224&p4=179


## Dial in details
Web: https://meet.jit.si/XenProjectCommunityCall

Dial-in info and pin can be found here:

https://meet.jit.si/static/dialInInfo.html?room=XenProjectCommunityCall

--0000000000000291ff060178c72f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><p>Hi all,</p><p>The proposed agenda is in <a href=3D"http=
s://cryptpad.fr/pad/#/2/pad/edit/Rk5kDLwcc7CrqFm6O7xq2Jci/">https://cryptpa=
d.fr/pad/#/2/pad/edit/Rk5kDLwcc7CrqFm6O7xq2Jci/</a>=C2=A0and you can edit t=
o add items.=C2=A0 Alternatively, you can reply to this mail directly.<br><=
/p><p>Agenda items appreciated a few days before the call: please put your =
name besides items if you edit the document.<br></p><p>Note the following a=
dministrative conventions for the call:<br>* Unless, agreed in the previous=
 meeting otherwise, the call is on the 1st Thursday of each month at 1600 B=
ritish Time (either GMT or BST)<br>* I usually send out a meeting reminder =
a few days before with a provisional agenda<br></p><p>* To allow time to sw=
itch between meetings, we&#39;ll plan on starting the agenda at 16:05 sharp=
.=C2=A0 Aim to join by 16:03 if possible to allocate time to sort out techn=
ical difficulties &amp;c</p><p>* If you want to be CC&#39;ed please add or =
remove yourself from the sign-up-sheet at=C2=A0<a href=3D"https://cryptpad.=
fr/pad/#/2/pad/edit/D9vGzihPxxAOe6RFPz0sRCf+/">https://cryptpad.fr/pad/#/2/=
pad/edit/D9vGzihPxxAOe6RFPz0sRCf+/</a><br></p><p>Best Regards<br>George<br>=
</p><p><br></p><p>=3D=3D Dial-in Information =3D=3D<br>## Meeting time<br>1=
6:00 - 17:00 British time<br>Further International meeting times:=C2=A0<a h=
ref=3D"https://www.timeanddate.com/worldclock/meetingdetails.html?year=3D20=
20&amp;month=3D4&amp;day=3D2&amp;hour=3D15&amp;min=3D0&amp;sec=3D0&amp;p1=
=3D1234&amp;p2=3D37&amp;p3=3D224&amp;p4=3D179"></a><a href=3D"https://www.t=
imeanddate.com/worldclock/meetingdetails.html?year=3D2021&amp;month=3D04&am=
p;day=3D8&amp;hour=3D15&amp;min=3D0&amp;sec=3D0&amp;p1=3D1234&amp;p2=3D37&a=
mp;p3=3D224&amp;p4=3D179"></a><a href=3D"https://www.timeanddate.com/worldc=
lock/meetingdetails.html?year=3D2023&amp;month=3D8&amp;day=3D3&amp;hour=3D1=
5&amp;min=3D0&amp;sec=3D0&amp;p1=3D1234&amp;p2=3D37&amp;p3=3D224&amp;p4=3D1=
79">https://www.timeanddate.com/worldclock/meetingdetails.html?year=3D2023&=
amp;month=3D8&amp;day=3D3&amp;hour=3D15&amp;min=3D0&amp;sec=3D0&amp;p1=3D12=
34&amp;p2=3D37&amp;p3=3D224&amp;p4=3D179</a><br></p><p><br>## Dial in detai=
ls<br>Web:=C2=A0<a href=3D"https://meet.jit.si/XenProjectCommunityCall">htt=
ps://meet.jit.si/XenProjectCommunityCall</a><br></p><p>Dial-in info and pin=
 can be found here:<br></p><p><a href=3D"https://meet.jit.si/static/dialInI=
nfo.html?room=3DXenProjectCommunityCall">https://meet.jit.si/static/dialInI=
nfo.html?room=3DXenProjectCommunityCall</a></p></div>

--0000000000000291ff060178c72f--


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 14:28:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 14:28:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571135.894252 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP1ym-0003yp-GL; Thu, 27 Jul 2023 14:28:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571135.894252; Thu, 27 Jul 2023 14:28:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP1ym-0003yg-Dd; Thu, 27 Jul 2023 14:28:36 +0000
Received: by outflank-mailman (input) for mailman id 571135;
 Thu, 27 Jul 2023 14:28:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qP1yl-0003xo-00
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 14:28:35 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20608.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::608])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dd9606bb-2c89-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 16:28:33 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM8PR04MB8051.eurprd04.prod.outlook.com (2603:10a6:20b:241::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Thu, 27 Jul
 2023 14:28:31 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 14:28:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dd9606bb-2c89-11ee-b248-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Kmdhbopsnnit3i6aRBOzxlqqJvKlPtT5Hl/AJlGa3owJv/MFMFnEC9cBNv5qt+ViHOJMJ0aDstEIKMwgfVHqHUgn0nnaAKmlhQYEakW3Aide7fEO/rcgtHNL/yy2VRKlSKFf8G/dV6HqN5VIbODrp2HF8FfYDHS3ARRXVnKSeFTXKntsDm0+uiH5anWdGiTvpNYyOuZq7C3rpb/cMRbOC84IX9BtJYu9Mj6cUm6OXWBUxTQ7v0yWK6mMJKY3ZpGF6l804mm3Q8PCzeEho5U7vaXEQlAZOpDNndJGl7hYqJUquE2RopTT0Aq1cc3HLBmhrn/QNsAQhMzYP27D1WF7QA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=bETeTToQSrnYdAQ4bFkv2rUI5+NqZi9FPzn5otWSeoU=;
 b=MKLlYObazDRR56pjdq938fXbb4fun+uZFTPE7VB5NlvuI2Z3RvjPjFPhfgrnL6MC12tf42zPmOSSTbBFOZN7L9+DLW1cNlhwuI4NxlxaB8Yc34PoeTzNuIT074Rvvl6owZxTCoQCLOjFuymLylayjSdh9I5LJhybpfoIQD9F5OG5uW+XaS3dZSybvT06/5akCukJc/qpdGcdiMaUR0UCRyMlqS4zK5JsxAnBq51wf4lifB8Hpwbt8gGZH0gtULItNsn6ibLj39WRUpctr1PWvdJlVEtZBa+sch6KL16WePs9LwaYJqVoZfVaQ2c6QiVHyeqaCMR0EzmrhkLF1ONHKw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=bETeTToQSrnYdAQ4bFkv2rUI5+NqZi9FPzn5otWSeoU=;
 b=lAmboB4rXHRSAN0IoL1P4II8Sq8cb0VhKAnK1lP2uMUTJGS6CDdl6g/2xzc3dRHv6/20fMalHj0JXdGkvmgaFKJr2N6hIXOjdZDklBHerimICN+tOdwMN8EQKX/w3rsfKH3xdz7eebqt9si+FpvM2CERXuJ06qylFHnc0CQRng5NpjjV4kq9draWY9sf8zlldA/9BPZrG54lqW7dErpLKqSCXbFB/K91MGsEnIpmWh9lgL+tk/zpZFHqoLRDfVaGXPRFgdeLTc/WrsReJesHU6S8/trfuXqWNqlo6uMXTIeP5VKltwFkC0xseMDq2NS4ho/3Rqh3ZME+BTyryImw5Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <9729cae7-fd26-978c-cdf9-e9ae24ddba97@suse.com>
Date: Thu, 27 Jul 2023 16:28:29 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 4/4] x86/iommu: pass full IO-APIC RTE for remapping
 table update
Content-Language: en-US
To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 Kevin Tian <kevin.tian@intel.com>, Paul Durrant <paul@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230726125508.78704-1-roger.pau@citrix.com>
 <20230726125508.78704-5-roger.pau@citrix.com>
 <4e9681c7-472e-ee6b-38e7-fc7fb28a2b07@suse.com>
 <ZMJ84u9_tDBcc5xN@MacBook-Air-de-Roger.local>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ZMJ84u9_tDBcc5xN@MacBook-Air-de-Roger.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0111.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9c::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM8PR04MB8051:EE_
X-MS-Office365-Filtering-Correlation-Id: 619ab14f-8d23-4a05-1631-08db8eadc073
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	T1XfC61j6lbnrKmYuLdP3BN4Qy1tqSeG4S3pvrAiuWe2enipDjHQVdjjJY/0Wco4rktdlndWdUPU/aqladQs3UTLCDjk5mjO8960a+Gz3gZr/JwAKlZF+AhsyP8rQ5v6rX4qNCRoOM0q5KVwyObfxfOl5/1v+xUDIlcrEdpvjwUGw1gQ0ezeJh8URJ3R07DumlFCuiGQl489AzU9MB2nXMqHbZk9B1w5ee8Yp9TbKcSG6PxodA5dMqLDu9JmjrWSrB2QwtkKbUcN0qXfcLtwt6sfLEbHQQxtcQiJJmt8dW1hHwd8hHD2z/9aO/5uPxTRWzBfBv2BaOrkVBFrjuOuSsFu+G85UkDzMSuE6mkY6QEXVWdLlGw/OZI3EXV+sQnRMUPzHNlE08p6Zq5kulNkZqKeiUQAW3gvFllwCR6bMYhDpQ/CQC6YyqFaFfFDvn/KG5uMl0gpNKBOxstDbeGHUA2sYO2k3Vbbxq1svdvZ4jHrmgeOMQ8wNZqzOUxAJq69Rm18KkqhCpxG6G8MRln/qv3j+iYgWvtMz3sd+jPPLZcq15cN+ZRuGnCjhAoW677F+IYyJLXNwyBiseCoKdkh/ksNYKzZ5+sbWFabuhqhgHcT4+YMMLDKP/9ZcYRYLj7A5RTWuGuoY68X4fb7E/dPRw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(136003)(39860400002)(396003)(346002)(451199021)(478600001)(41300700001)(6486002)(38100700002)(54906003)(6512007)(5660300002)(66556008)(2616005)(6916009)(4326008)(8936002)(66476007)(66946007)(8676002)(316002)(186003)(83380400001)(53546011)(26005)(6506007)(86362001)(2906002)(31696002)(15650500001)(36756003)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?alJubUZYaE9jU0lwcTRVUTZqTTg2Zkh6d1B0QUN2eWFhbXFVNGhiRXNXTXA1?=
 =?utf-8?B?Z2VTZ2N6NiszNGorQ0dVNElHTFdLajVXSnorU2hWZmJ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UWhDMzhIRXg2b1hqaFZ3UUlOSlNrMFExZ0JT?=
 =?utf-8?B?dTlySDBGUE9WOEs4WlFiNVhmQzB3N0dIQ09FWGQ2QUxRYmRkZlhJYmEyN1c5?=
 =?utf-8?B?NzArSGZ5YkZ2WHBERFJCcG9kRGZPcS9PakxLM2VGekZ6L3hCb1RNNi9Fd1pm?=
 =?utf-8?B?NVpSVG1VWmMrN1l6TXZGWmJtQXhYZkViSWYyS3B0SWR6WklRMUx3YURacTNh?=
 =?utf-8?B?S0JYOEtBcWVwV3dWYzNBTy9uZk1hMCticzFYK0NpZHhLN3oxalY5ajRWQXBt?=
 =?utf-8?Q?IW2jXSfj9a2qGQUeboNal28Hf?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 619ab14f-8d23-4a05-1631-08db8eadc073
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 14:28:31.3962
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 3GfiAMdZxzrm9rwDXtgbZE8J6uDFF5qFlinIo8gOoPZovSREZ92/shnwXeixko3rO1/9zZ2AquNZj5uWN1UhQw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB8051

On 27.07.2023 16:19, Roger Pau MonnÃ© wrote:
> On Thu, Jul 27, 2023 at 02:39:06PM +0200, Jan Beulich wrote:
>> On 26.07.2023 14:55, Roger Pau Monne wrote:
>>> @@ -439,36 +430,45 @@ unsigned int cf_check io_apic_read_remap_rte(
>>>  }
>>>  
>>>  void cf_check io_apic_write_remap_rte(
>>> -    unsigned int apic, unsigned int reg, unsigned int value)
>>> +    unsigned int apic, unsigned int pin, uint64_t rte)
>>>  {
>>> -    unsigned int pin = (reg - 0x10) / 2;
>>> +    struct IO_xAPIC_route_entry new_rte = { .raw = rte };
>>>      struct IO_xAPIC_route_entry old_rte = { };
>>> -    struct IO_APIC_route_remap_entry *remap_rte;
>>> -    unsigned int rte_upper = (reg & 1) ? 1 : 0;
>>>      struct vtd_iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic));
>>> -    int saved_mask;
>>> -
>>> -    old_rte = __ioapic_read_entry(apic, pin, true);
>>> +    bool masked = true;
>>> +    int rc;
>>>  
>>> -    remap_rte = (struct IO_APIC_route_remap_entry *) &old_rte;
>>> -
>>> -    /* mask the interrupt while we change the intremap table */
>>> -    saved_mask = remap_rte->mask;
>>> -    remap_rte->mask = 1;
>>> -    __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
>>> -    remap_rte->mask = saved_mask;
>>> -
>>> -    if ( ioapic_rte_to_remap_entry(iommu, apic, pin,
>>> -                                   &old_rte, rte_upper, value) )
>>> +    if ( !cpu_has_cx16 )
>>>      {
>>> -        __io_apic_write(apic, reg, value);
>>> +       /*
>>> +        * Cannot atomically update the IRTE entry: mask the IO-APIC pin to
>>> +        * avoid interrupts seeing an inconsistent IRTE entry.
>>> +        */
>>> +        old_rte = __ioapic_read_entry(apic, pin, true);
>>> +        if ( !old_rte.mask )
>>> +        {
>>> +            masked = false;
>>> +            old_rte.mask = 1;
>>> +            __ioapic_write_entry(apic, pin, true, old_rte);
>>> +        }
>>> +    }
>>>  
>>> -        /* Recover the original value of 'mask' bit */
>>> -        if ( rte_upper )
>>> -            __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
>>> +    rc = ioapic_rte_to_remap_entry(iommu, apic, pin, &old_rte, new_rte);
>>> +    if ( rc )
>>> +    {
>>> +        if ( !masked )
>>> +        {
>>> +            /* Recover the original value of 'mask' bit */
>>> +            old_rte.mask = 0;
>>> +            __ioapic_write_entry(apic, pin, true, old_rte);
>>> +        }
>>> +        dprintk(XENLOG_ERR VTDPREFIX,
>>> +                "failed to update IRTE for IO-APIC#%u pin %u: %d\n",
>>> +                apic, pin, rc);
>>
>> Afaics you don't alter the error behavior of ioapic_rte_to_remap_entry(),
>> and in the sole (pre-existing) case of an error a debug log message is
>> already being issued. Why the addition?
> 
> I think I was trying to mimic the behavior of
> amd_iommu_ioapic_update_ire(), which does print the errors as opposed
> to doing so in update_intremap_entry_from_ioapic().
> 
> I've now removed it, and adjusted the code to match the rest of your
> comments.  Will post v4 of 4/4 only as a reply to v3, I don't think
> there's a need to resend the rest unless you prefer it that way.

Just this patch is going to be fine (maybe even as v3.1).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 14:33:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 14:33:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571138.894262 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP23o-0005lY-58; Thu, 27 Jul 2023 14:33:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571138.894262; Thu, 27 Jul 2023 14:33:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP23o-0005lR-1X; Thu, 27 Jul 2023 14:33:48 +0000
Received: by outflank-mailman (input) for mailman id 571138;
 Thu, 27 Jul 2023 14:33:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qP23m-0005l2-T9
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 14:33:46 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2041.outbound.protection.outlook.com [40.107.7.41])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9790a994-2c8a-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 16:33:45 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU2PR04MB9100.eurprd04.prod.outlook.com (2603:10a6:10:2f3::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 14:33:16 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 14:33:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9790a994-2c8a-11ee-b248-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=fA2As1BK5Jiu1bned2TySv5n1Z8aGRfZoCO5L76l418vruHirOPzVv2+yp1S95vbxyw92FzknwQydjhpMIQPoQWSVq1M9Z2e4keCS1CchXG5Eo76Ob/pnQOnMkL7Wq2VZ6c6zxVE+FpThnEL8hJfHUdY8o60RKfoOiiXEQOQF4YVse7QdSzstCg4IzgkHF7FcRNGXFUA4X0m1MEDslzMq9P4M83tvY8fs8ZY9CLEZ9o/MVIqoWdQ7HRwyiknPqdmGtY/2mAeNNW1LshTbUlTVIpO2L5FJaz4QpnCct8ZqtsxfcqWdFoVmDjSewb5wm1Sn2zRlm+VNF1CPvnIs41/qw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=UQ8VFHLzAI05SKWB7ehWmpZpzVH9greL9ap0tjkiyso=;
 b=WDof8tYgRmdu4ESWkl5GI6WYIc8L2J83XLmtvZpMN6EHYF0KX6jeYoV9I3ZN5H8zo//b/28YMORLNhuKSx8uBeYtOaDFEi7YZTD75ifTQb2KZQFHLzJK4c7yrIury2fVbvjaihsAy7emxpWgaHMQBHmsVjZTI08a6gG9p0zi9TxAPhhfPwvvM4M+Ttytofwz069snB3Lay6CSl6hGytcGoy4vXx5qhA6WMl+8fU3+D9NkKM50sObrUsR2Ffjawmee+Olih+nBIArTqTED+2t/k446bSP8N3ZtUonp2G53So0kkWYTZ3E1ZuKmG8vj4zDJzFhjSD2HEvYGypWBCo/cA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=UQ8VFHLzAI05SKWB7ehWmpZpzVH9greL9ap0tjkiyso=;
 b=Kau2eoSM4RsMXYJasaGAtldX8FVLCSb37PC3HJVJhKOe0chN2Tt0Pjj27fVxP5XkdRXqSp72kJtkhqpqc/Hd7EHhBroJ8wPdWbhUn17pYOoBBu0bCpeV/Bx8mielPCZEE8qd2Xj/u5cWRrS3UZqWSS8v9N1mknl9Ei5UbQQn3aT03/lSAvScW2RHYjwGZ5/EzbeGumL4Azma6EJyB086U08XSIrxXw8LAWjA36YlNfoMPNLGvcwhi0vm1u+L56SqQyVZ7f0KIHCIHroJcsNc8zGcLnOMZcnBsIZ/uInUGS1ETDGhlAV4rZM29KAaYMrvaZvtae3Cy7seDhCVrS0Bag==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <f8c151e4-1e0a-1465-0d5e-be55e25df818@suse.com>
Date: Thu, 27 Jul 2023 16:33:14 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] libxl: Add missing libxl__virtio_devtype to
 device_type_tbl array
Content-Language: en-US
To: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
Cc: Wei Liu <wl@xen.org>, Oleksandr Tyshchenko <olekstysh@gmail.com>,
 Anthony PERARD <anthony.perard@citrix.com>, Juergen Gross <jgross@suse.com>,
 Viresh Kumar <viresh.kumar@linaro.org>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20230726141459.985463-1-olekstysh@gmail.com>
 <969aacb8-a608-be01-f0f5-34fb1cc61d62@suse.com>
 <35a1988d-94a5-9f2e-2478-ab08268f02b0@epam.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <35a1988d-94a5-9f2e-2478-ab08268f02b0@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0053.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:48::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU2PR04MB9100:EE_
X-MS-Office365-Filtering-Correlation-Id: 4ac518c5-4dd3-4934-291c-08db8eae6a4d
X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	7CczQI7SZzc0/a/3guHy7dZmjbnh5Bxtvh/RPOCP++1L50jlF3kHTUPS9uNWTVgOXypQpM5Bilji41FFVKvCp+TCxAKzgOAq06msxD6+rLj9cWd+eAFrHPZUlRAjJ42gNLL9pg6k06brtcw113F3fan86G9/LHuo9k2Kj0jiVDE7/4yQ4IABdjfDD2r2J109DN/9kVkIQ+ROojJ9XwvzgHiTb6ihbdV9Erc030jA018AjbOrVgCV03Maoo1G731AvWF9Ho566OTLeEUqCtNJH8wjrzka5qau6W71ezhqL+9YMqfaZqeskFWSFyLG+mKBAgnlP5mDUpFPQghyn95sCQ/HGA13qItPHTPHSyAqSjeyQEc6JXusKeVeMI1Kr4HzWgRkj/vim0bKlnKdT5B5G35P0E0y8HfqTRORZ352B/MPKeHen6kYV3QE4ZpqNFVnlVkg0iOBjE2sBrmKw6j3MLcsM/OZGmP4QJInWU5ylXxIKW76Nn6Pah4IOpMAyCxQ3MBasKZgbo3fNr8wbgtprtgEfEFxZh5ijJSU9ccpff7BwoPqLPtKk9Ado2JC3at6wdvWcRcctD2g8vqIfSjOeNOqHIgNPwsg4bedmH+uHqOvmYi74cwyNwFUiff2QPfD4YWVTdsK1JwarYfvrBsSerwSPPcMxNcRPihHl8ptHj3CG4tzas0ZQ4VmAIqXaboK
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(39860400002)(346002)(396003)(136003)(366004)(451199021)(2906002)(41300700001)(316002)(5660300002)(8936002)(8676002)(36756003)(86362001)(31696002)(6512007)(6506007)(26005)(53546011)(478600001)(6486002)(38100700002)(186003)(31686004)(2616005)(4326008)(6916009)(66476007)(66946007)(66556008)(54906003)(101420200003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?R1k0QzRndWtZUkFSbHY4TW41Mm00U1BWc3VucUtOcTIxUWkwamo5NnQ3eHV4?=
 =?utf-8?B?WDBxVjByeFQ0SEFyY3VoQXBxNS8vR2J4Mmt5VkNDYzAxUE4rU3p1UFd6eUVO?=
 =?utf-8?B?RUNRZElKTHdDclQ5R3lMZ3FTN0NDL1U2ZTRvOVpEMm11bndCaWVrVDh5RmdP?=
 =?utf-8?B?RE5tUllrR3I0L3BBSUROcllpeDR2ckEvUTRUK0FUZmllVVFCeHNKdDdzUTRQ?=
 =?utf-8?B?SDRzcFF2bHp0YnBXZTlxOG5NMmFzNXYvYTBFRjRJSit1ZTJTK3NpUGdpVkR1?=
 =?utf-8?B?VW0wOEx3bDJtMW9DMVZBRk9rb0N2VjVaaFJPMWxvWEh6V0MzdDhObUE1bk9L?=
 =?utf-8?B?Tm1Sb0MwSjRLczRiOUxnNy8xV0hvNUk1Y0w0K3JCT1IrbGNLU3NLTUEvM3hN?=
 =?utf-8?B?RzdDeXFleXVVZFZsa29Rd1JaQlMzNWdDNFRWSFB5enZWRUp6SzRPbTR3MkZr?=
 =?utf-8?B?ajM0MHlSL2VVWFZEemI5eFRGejNlcThtMWpLdW9EZGhjZk4reW5ycmw5Ry9v?=
 =?utf-8?B?UU92dzZ5STNlUlorMVN3R2s1eHVVeTJSMlhURzdFQ0FwZDZQbFJEcmxpNFVD?=
 =?utf-8?B?MUtNZGhZTUxKS3gveVJjcGhvditTZmdlRTFCWDNXWVhLNDBIQnNJeW50O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?B?RWRLak51UW9odzBDakxHRlBZTHZJUUtHTGhjSStBaGtPVGZpb2ZHanRrSnZJ?=
 =?utf-8?B?OWJITWQzajdNMjJqMzhrUDRkQkVMeE9nSHlGOFJiWnQ1ZjFsakZOVk42SXVB?=
 =?utf-8?B?Wm92VjMzOUdsQkw3L0RCRHBIUWJ2ZHRERnFGSFVQSEMydWNNazBYQWR2blFW?=
 =?utf-8?B?d3lUSDcvQnFMbDJLZzhLdVU4VzQ1SUJnbGlTbHNKOFlyd3pzb1kxc1ZRcUFx?=
 =?utf-8?B?NnpCbkJFdDA1UGZKYnFmUnJaUVpSU1RrZDVheDBkVEZDZW0yU0hpM2ozQjZq?=
 =?utf-8?B?dStBWVlGdjZYK0tLSjl1UXNGczFoNzlDMmZDcTVGNENVRkdVSW5oWERCd3B2?=
 =?utf-8?B?TXpJaWUwcnBwUlBiQzFpSmhuSXlhcmxnSk9SVnBZNDdxZjhDc3lDWFBLaitB?=
 =?utf-8?B?Zmx6cE5sZk00Tnc1T1pNV3N2c3hIV2dHN0EzNVMyb3JxS0Nwd0FMOHNHUjZx?=
 =?utf-8?B?QTZRMDJ4SGsxRmYvZ3pKU244OTBESzFDaHhLWEZ0ZHR6cENvQ2YwTlZPcjZN?=
 =?utf-8?B?MGJtYTRNeFdYdDNSQjlURjUwdHZkOUgwNVZMVVhxVlVnMW5nSXpsYlR5QzBP?=
 =?utf-8?Q?8/axD1Q24RzDBkc0kaAwFoP0p?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4ac518c5-4dd3-4934-291c-08db8eae6a4d
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 14:33:16.3639
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: LCPg1aWCvX6r875E+FQTrawN+PTAQlJ2IEzNn4aajqdxcler50cJJzOjIFPeINp0jGaANVYZZKhN8RSZZaaQGg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9100

On 26.07.2023 17:13, Oleksandr Tyshchenko wrote:
> On 26.07.23 17:50, Jan Beulich wrote:
>> On 26.07.2023 16:14, Oleksandr Tyshchenko wrote:
>>> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>>>
>>> Without it being present it won't be possible to use some
>>> libxl__device_type's callbacks for virtio devices as the common code
>>> can only invoke these callbacks (by dereferencing a pointer) for valid
>>> libxl__device_type's elements when iterating over device_type_tbl[].
>>>
>>> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>>> ---
>>>   tools/libs/light/libxl_create.c | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
>>> index 393c535579..c91059d713 100644
>>> --- a/tools/libs/light/libxl_create.c
>>> +++ b/tools/libs/light/libxl_create.c
>>> @@ -1887,6 +1887,7 @@ const libxl__device_type *device_type_tbl[] = {
>>>       &libxl__dtdev_devtype,
>>>       &libxl__vdispl_devtype,
>>>       &libxl__vsnd_devtype,
>>> +    &libxl__virtio_devtype,
>>>       NULL
>>>   };
>>
>>  From description and nature of the change this looks like a Fixes:
>> tag would be warranted.
> 
> Looks like, yes. Thanks.
> 
> I guess, this should point to the commit that introduced 
> libxl__virtio_devtype
> 
> Fixes: 43ba5202e2ee ('libxl: add support for generic virtio device')

In light of Anthony's feedback I'm now thinking that no Fixes: tag
should be here, as is being clarified by the addition to the
description (which I guess can be folded in while committing).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 14:38:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 14:38:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571141.894272 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP28E-0006Ua-Rs; Thu, 27 Jul 2023 14:38:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571141.894272; Thu, 27 Jul 2023 14:38:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP28E-0006UT-OR; Thu, 27 Jul 2023 14:38:22 +0000
Received: by outflank-mailman (input) for mailman id 571141;
 Thu, 27 Jul 2023 14:38:21 +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
 <SRS0=Tn4a=DN=epam.com=prvs=157204e9ea=oleksandr_tyshchenko@srs-se1.protection.inumbo.net>)
 id 1qP28D-0006UN-QA
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 14:38:21 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 39ab9da6-2c8b-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 16:38:19 +0200 (CEST)
Received: from pps.filterd (m0174679.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36RE2p2o019297; Thu, 27 Jul 2023 14:38:09 GMT
Received: from eur05-vi1-obe.outbound.protection.outlook.com
 (mail-vi1eur05lp2176.outbound.protection.outlook.com [104.47.17.176])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3s3p7xsb5r-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 27 Jul 2023 14:38:09 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com (2603:10a6:10:ed::15)
 by AS8PR03MB8927.eurprd03.prod.outlook.com (2603:10a6:20b:5bf::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Thu, 27 Jul
 2023 14:38:06 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::3a00:d290:e446:d887]) by DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::3a00:d290:e446:d887%3]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 14:38:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 39ab9da6-2c8b-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LVvKDOPxwknbMNaU8T25i3Wz/mkDGtVwHXyWFd+A3sXK2DflBgqZpGVzH0SFsbhrCdri/7FwH/K5AQ0reCikiTJuCOJrsdykXDaMuf0bIo83xbfiw+1b8ynMoGKrq8xwIFDNMlnuOcvs86PMmt9x5yQNS4BmVdh96ZINq/P2XiMiEpe89jysDEzgUHs/OsYLtErmBtuP4GMhGi769+l1ezMpHFKMZj+mr6YsqSCtC2590BJgyRJBU52eAWuTL0AdFVyhg/rtYjtjSgFm2ZL2NvOEzWO0NoZNY+E3MZ8JXLp7zjJcQMKCj9+S+4Xors5RShxLP9QGs7ZK64in/SGdDA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=K2xAfSTh3R/kPZWB06sj7/uK5e9SlxZ/UndJMccvw8w=;
 b=ilA7OY6UO+Vmofvzh9xlt/2wWEfITT71fSJQ4kuSizwpxwi93FJ1sM2hRpV6NyABlFzGYd39Xxge4utdsgBAhWF1C+IcVhNW44ZBgi0tyl8OtDSTG0remG5AbGrdJef8zF4bTx5Rke+yLUcpH2knz6LJZV71t83XRg99nOIY1rNv/LaGro6YEwwzPTyyInJ5gezrBNdq1Fj6z8AyXcfSZ6X5sfiRlSASu+Qb3CnCIzbmMRFxWWZjkuPEoGedzcJsczsKH6Q7wXSHEn2F9O7SluP+0zK2bKPvHdq6MGYY9Hk3jdotK95WADYXQfUKxmUMOJ4TIJy/8gDt7bDWSBdBLQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=K2xAfSTh3R/kPZWB06sj7/uK5e9SlxZ/UndJMccvw8w=;
 b=RU4WT8TcJdffOrt0Ltp9F+SkpMwe+f6MqKeBp7CDs/8+tafDYNwlnsofvuU6dLDd+JXBVcLNamYabLxk/HPXe3zzYMQ47cPN/hpJCvVDzqtWqLSiGUoGecE5JgOrpvXMDEqZzCcW3qeDULjAxm4yTz61x2KYHoFckzeqy6NKUamwFSMBRvuxQcxeb51067eIY4V3R4v7qbFR+/OlTn53DEVmXYxxeErPLz72V8WNzrpy7Ji/bbiQrb6bFZLrb3fJvyW9Munmd4UlSz5XrTnbpWhHz9h7u5+dw5QFCv9LMC2k4VKqGtAAf5YOiWu+CfgjUeupRUcDkONVDy+ouFNISw==
From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
To: Anthony PERARD <anthony.perard@citrix.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
        Wei Liu
	<wl@xen.org>, Oleksandr Tyshchenko <olekstysh@gmail.com>,
        Juergen Gross
	<jgross@suse.com>,
        Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: [PATCH] libxl: Add missing libxl__virtio_devtype to
 device_type_tbl array
Thread-Topic: [PATCH] libxl: Add missing libxl__virtio_devtype to
 device_type_tbl array
Thread-Index: AQHZv8uYlQiykVHkhkC1aQss9HQu9q/NX+QAgAANWwCAADReAIAADrOA
Date: Thu, 27 Jul 2023 14:38:05 +0000
Message-ID: <3eefac79-a180-ab4f-060a-9010e0c26c09@epam.com>
References: <20230726141459.985463-1-olekstysh@gmail.com>
 <670c22f9-135d-4022-8272-78af3e28c011@perard>
 <5360d7ae-b754-99f9-686f-882bdc33e7eb@epam.com>
 <0bca0a3b-2a74-42c7-96d2-23f6dab7d169@perard>
In-Reply-To: <0bca0a3b-2a74-42c7-96d2-23f6dab7d169@perard>
Accept-Language: en-US, ru-RU
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DB8PR03MB6108:EE_|AS8PR03MB8927:EE_
x-ms-office365-filtering-correlation-id: d2b9e9d4-5a33-4cbe-a7e2-08db8eaf16ed
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 mzmvZg2D87siUyop0/szklAyYQefzIWupedpyMvcSkOH6RpOSlu7jsdZCq9Y84vcMTXfH2hj408QPRKpA45KuXCKoO2/3R3Vwa7jyeVRVvL8xEFZ4LpylqGeDxRohhV8vn9IXnhQnCpgsbaj7yYdJkRGQJNONm/3jX6kKNXIBLKBPZritbzJMIdSuPO172LTN6gBIzxarnqRMVzu3tUML54KeL6m4z88fVVg16lMn6fxLy+C9mov8EdKME9wYGryPm1mnEojEcu4eoEl9K/0Y7rxUxzCVgqZEycF0f5wFw7y/owp0z1zCyozIsTi6NE5CmOVxnb7+BBsJoJnBa4MMOWpxN0pyixx4ItF1GSZHLEALxbButjnOYyL96jsnV0Dlbcgqyb9n6h+wW1bqo7N1i+ENQ64op1kEyHjua/0nr3oepHJKU7EJyVDZZJsojfQ9dPf0OnGsjPg4DE4WZ+Be8VhFChtqEBk0roCCzY/61+J1VGq9VF5lwTNNvI/fPixbumcQUkathVDbZ9YA00UGQsHuvmS91RG32e25avn4ijvyzVMZMfGWQD657ifoX8hE8pi0en7OGlvuoYNs1FDomfzx6DCLpGNcyiqHr8yoKCi+Hk+kxYmWVbe2848PVCFIFOJ+T6Ode5ol41iT4F1ApaErEJFRWEOu0JgVfHjPv3CQTAX8xcRyt9XyIzwOrR+
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR03MB6108.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(346002)(396003)(136003)(366004)(451199021)(316002)(66556008)(2616005)(83380400001)(66476007)(66946007)(64756008)(66446008)(6916009)(4326008)(54906003)(6486002)(6512007)(478600001)(71200400001)(26005)(91956017)(53546011)(6506007)(186003)(2906002)(76116006)(38100700002)(86362001)(122000001)(38070700005)(31696002)(36756003)(41300700001)(8936002)(8676002)(5660300002)(31686004)(101420200003)(45980500001);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?UU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f-8?B?NnVPeElMV1A4M05SZ2txMlFJYzNxR0xHSVhFWGxvcGg4d3o0SXNJUk9sMWg2?=
 =?utf-8?B?ZHlLVHFvNlo2aTlUY0pFQ1FqZVF0NW5OREE1aDZHREtaSk9KNmQweDJVUW8v?=
 =?utf-8?B?M21mM1AwQ0ZaT2xVb3FWZzh5dXJMQ1h1WDFwOWVIQ1k4Z3RoM0U0dGxFaFhH?=
 =?utf-8?B?aTFzcWN5d0IzNjdBY0VoT2J4T21OcTV4aUJvNlAzQXY1ODBFMktOVzhaUDht?=
 =?utf-8?B?eVRxL0JscjQ3SWxSVWdRZ05NY2pmeG55OUNtZTkyWk9xcFJLN201T1lsRGtr?=
 =?utf-8?B?N1hydHdHcWVEY1RBb09naTV1dXpyNm1wekVSWmVCazJYaFRWc1hEOWI4UWg3?=
 =?utf-8?B?MW5UMndoNmdONDBEQWlMK21KaklwNy9Wc0QrbE9IR2VvK1FTbVFKQzdHVEZy?=
 =?utf-8?Q?3L5NpOUpf2DlRgP9JI+Z/XA=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <026FD11FDA5FBB4FAB55CD2E86A44789@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DB8PR03MB6108.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d2b9e9d4-5a33-4cbe-a7e2-08db8eaf16ed
X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jul 2023 14:38:05.8082
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: FQLRFUWm8B8R/wMZeDEcdC2R54t0FLS6StAN6Le7a3CQpuEBLt/LNS1YEM1jl23P0kn8xb/KSYBupa7XMxALw68CHaDl0l3FS0X9/XEmnvw=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB8927
X-Proofpoint-GUID: Tzk-Ac4eFvDRnVxtbqoI6Q9pZ7I5Lm2A
X-Proofpoint-ORIG-GUID: Tzk-Ac4eFvDRnVxtbqoI6Q9pZ7I5Lm2A
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-27_07,2023-07-26_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0
 mlxlogscore=781 spamscore=0 clxscore=1015 priorityscore=1501 mlxscore=0
 lowpriorityscore=0 adultscore=0 malwarescore=0 impostorscore=0
 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307270131

DQoNCk9uIDI3LjA3LjIzIDE2OjQ1LCBBbnRob255IFBFUkFSRCB3cm90ZToNCg0KDQpIZWxsbyBB
bnRob255DQoNCj4gT24gVGh1LCBKdWwgMjcsIDIwMjMgYXQgMTA6Mzg6MDNBTSArMDAwMCwgT2xl
a3NhbmRyIFR5c2hjaGVua28gd3JvdGU6DQo+Pg0KPj4NCj4+IE9uIDI3LjA3LjIzIDEyOjUwLCBB
bnRob255IFBFUkFSRCB3cm90ZToNCj4+DQo+PiBIZWxsbyBBbnRob255DQo+Pg0KPj4+IE9uIFdl
ZCwgSnVsIDI2LCAyMDIzIGF0IDA1OjE0OjU5UE0gKzAzMDAsIE9sZWtzYW5kciBUeXNoY2hlbmtv
IHdyb3RlOg0KPj4+PiBGcm9tOiBPbGVrc2FuZHIgVHlzaGNoZW5rbyA8b2xla3NhbmRyX3R5c2hj
aGVua29AZXBhbS5jb20+DQo+Pj4+DQo+Pj4+IFdpdGhvdXQgaXQgYmVpbmcgcHJlc2VudCBpdCB3
b24ndCBiZSBwb3NzaW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YWNrcyB0aGF0IGRlcGVuZCBvbiBsaWJ4bF9f
dmlydGlvX2RldnR5cGUNCj4+IHByZXNlbmNlIGluIGRldmljZV90eXBlX3RibFtdLiBUaGUgaXNz
dWUgd2lsbCBhcHBlYXIgYXMgc29vbiBhcyB3ZSBzdGFydA0KPj4gdXNpbmcgdGhlc2UgY2FsbGJh
Y2tzIChmb3IgZXhhbXBsZSwgZG1fbmVlZGVkKS4iDQo+IA0KPiBZZXMsIHRoYXQgd291bGQgYmUg
ZmluZS4gV2l0aCB0aGF0IGFkZGl0aW9uOg0KPiBBY2tlZC1ieTogQW50aG9ueSBQRVJBUkQgPGFu
dGhvbnkucGVyYXJkQGNpdHJpeC5jb20+DQoNCg0KVGhhbmtzIGZvciB0aGUgY2xhcmlmaWNhdGlv
biBhbmQgQS1iLg0KDQo+IA0KPiBUaGFua3MsDQo+IA==


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 14:42:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 14:42:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571143.894282 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2C3-0007vp-Aj; Thu, 27 Jul 2023 14:42:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571143.894282; Thu, 27 Jul 2023 14:42:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2C3-0007vi-83; Thu, 27 Jul 2023 14:42:19 +0000
Received: by outflank-mailman (input) for mailman id 571143;
 Thu, 27 Jul 2023 14:42:18 +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 <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qP2C2-0007vY-5d
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 14:42:18 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on2060f.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::60f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c5ab9e72-2c8b-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 16:42:12 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM8PR04MB7746.eurprd04.prod.outlook.com (2603:10a6:20b:235::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 14:42:10 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 14:42:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c5ab9e72-2c8b-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=l5ATGptCbJQFeoK+E+RJe48m3wwhK3LGCkXPmsLg3DqrPQt29n047ROakSyQ6fDG/dEPrLqgoBLxXoxmoNu7nSaFk7yilw/N9dbwnZJDo6N7VhKZxUWhFuwQIO05ISxzxPwQ/1wCFKopMHQXSB3DObZfylpZohnJT9Belm7+nzUSmRWxunSy69qgbq1KRCg50BQ4lWrEyeFpgBgjYyq8dMUjn7wA/IIvqG8oVkiSVEgboIuY7Yb/63jTVGzhWVzLCHN3rErwYtZ42Sz8pi1qzE1vE1YVVJe54dKZXBHzVzPhb8yepcVVdonZluIzQz2VwEBoNsjnYcw1WMtixZ1oXw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LPoj3KrIj/M8bNceDaw9DeN9H1cWbuIBQAI71tdvnts=;
 b=hY8xZ3YOFvvwpzkSq9mJcfSSKQzwfMc7olBrGiZZegZ+jypGpdfo7pdegZXgccwBPU7dsn17QI2gGx51J2tvfeHmhAHH/dEHTi1LUQ+75gcpCqhvMdooHUja6McJhJw710z++2u2o1d97AHcgDYy1bNAoG9SOCHnUaMul/fGsm2X4tDL6ccTRqc3xLVaSvKxx7na/hugUM4pNRvx8Igz/OioH1T/UqcrsoHiyeQYBOuRQNptztO8OYYVPt7aSEMmevQDaNDyVfbML2uGs9KEAQNpHzypoHol1NRMbT0APODJsJvvlszo/3HtES/rW/VvpzAodOq6boKM4hN63F7EUg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LPoj3KrIj/M8bNceDaw9DeN9H1cWbuIBQAI71tdvnts=;
 b=1l0JWtC+p6cYa8IyLEbYhhjHgyBkt/Op26nQDSHLbV4iRIX+Ia40GR56Ks4c/1v8kj7mn9MPlqzBe3Mf/wa6iZxZ7p6NPaXP4kRZwxs7KfICa2XSDklcawwUcKP6JHf4oKKHoTPDMvQQBiGBeB2O450sPXRdoQBpc21Ou8HU7RUk2aKqTrHtWaX+pEtszzJb5qEWWQaCYHChkkPwcp+d2b8f9jZx5Nk+uuzOlJZArd7q0h1LIjcImGWoVAt5550yA+FXqwbpgPibiFKBqQ5JFfZddkpZ8uWIfE6wHKtG0g7ZArXPSDoSZNx8X5W6E5jyCZu3knmuZnMuLee5wAXYrA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <63979074-42c3-83dd-cf0a-8f0cd0294a5d@suse.com>
Date: Thu, 27 Jul 2023 16:42:07 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 03/10] x86 setup: change bootstrap map to accept new boot
 module structures
Content-Language: en-US
To: "Daniel P. Smith" <dpsmith@apertussolutions.com>
Cc: xen-devel@lists.xenproject.org, stefano.stabellini@amd.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Luca Fancellu <luca.fancellu@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Rich Persaud <persaur@gmail.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Christopher Clark <christopher.w.clark@gmail.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
 <20230701071835.41599-4-christopher.w.clark@gmail.com>
 <alpine.DEB.2.22.394.2307081144340.761183@ubuntu-linux-20-04-desktop>
 <CACMJ4GYE6PW1SY35dhs4XkXd9ru25igrvMCrh4pJMWEBNNz0YQ@mail.gmail.com>
 <CACMJ4Gb_ZwKSjP7qzfQj98YQjSpBdFuWzeGQJUNNqst0GdXCOw@mail.gmail.com>
 <4e0a0fc9-0c1b-4725-5692-de67ee68a980@suse.com>
 <2994c9b8-c803-1fd9-20df-0d25d2b66c49@apertussolutions.com>
 <ca85fd2e-45a5-32c3-cb4b-1042be6c6915@suse.com>
 <32a22c57-1333-47b0-c61d-abff8d7df112@apertussolutions.com>
 <7ab3c4ae-3903-29de-ba32-d328b426d104@suse.com>
 <19bb355f-576c-b8d7-b6da-fa2dd8ff2228@apertussolutions.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <19bb355f-576c-b8d7-b6da-fa2dd8ff2228@apertussolutions.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0207.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ad::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM8PR04MB7746:EE_
X-MS-Office365-Filtering-Correlation-Id: 3687ec1d-701d-48d2-f823-08db8eafa8c8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	6OXDglk/wMwWzk0B08jXAXLMuJZc6yYH5KWjd5m77RyxWT4YoyZY8CLSOFM6gX+AomXqVFhMI8eIp6znt3T7eH/sa92gjQKjG1geEkWws07H9J+cdXzdFLN1XkjW5x2Nk/BlpPoHWfahDMTFv1IeekDnzgpQ7jvE3FH+RG0Cd5cb5J62aHpgYItJkFGrd6hTtlYR/0fhXcsI+xQJf/8bp2ffgfk4zgQZI00/I9nMNmbMFs9rjKjn/txAq+V1Spx8tDxhyeVOoM2Z5czDtdhIBS979GO+r5S+bbtCRWLWZio1yetIOxkbsXfXZtmHmTxxRLmosOAvKspXP1TaJWRXPIBO2l6Bkw+YZk7B73+nrkID2uV3/KtbpmX55WFHrhX+vLnppzi77FsRBm+sm4nNSjrXyTB2tawbM2RFqNw56jMqDw0Y/nUN7Z5LawxC5C4uDkOTk1K7F478y91u3pucDyDK0V/QJzzi/slJS22rT3gTTudm53XGufFyNEtZJ72C17iq251Ant+BBUG6h2ILNEwwuGYNG5OJVARQGWvv4B1kfaQBZtHf8c4n1P2m5FHa45KcSIbx01QBIOnG9+5C8XWokYeoF5tL88s5yV4rukVGu4OF1TqsYCaN1jwBjNBroO1k5/zT/2oF7sea/9gumA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(136003)(366004)(346002)(376002)(451199021)(26005)(53546011)(6506007)(41300700001)(2616005)(316002)(31686004)(186003)(6512007)(6486002)(478600001)(54906003)(6666004)(38100700002)(6916009)(66946007)(66556008)(66476007)(4326008)(8936002)(8676002)(7416002)(31696002)(86362001)(5660300002)(36756003)(2906002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YVVEMUFHV25LcGJEZVYrQkZaQVBtbkVTbGt1RkQxNkt4MURjN1lnQk5qaHVl?=
 =?utf-8?B?MXQzUTQ5bXZCZm1lSVBETU93RDV0R2FwVGcwUlNodFNnVjAzTXcySmhyQjZW?=
 =?utf-8?B?ckhvQkpib2tUb2FON3F1VlgrL0Z5dmFZNnNJSGFSSGlsZ0YreXEzTFNNZXBU?=
 =?utf-8?B?NU1zZW5vVEtaVUhKNm0yOGdURFJyV3lhT09OU1dUTEJ2ei9uMGc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udUdnU0ZTNk1LeFl4M1JWUlk0M0VmT2tNTUdQRHpI?=
 =?utf-8?B?d2lEVkN3Qy9mWk4rNjJSVld1TzMySU5kQkwxa2d2L2ViRmpXYXo5dVNwWjZD?=
 =?utf-8?B?Y2trSC9uRDRleS94akNXb1ZsREtYMW9mVG5CRW9VMmRRSlExOHgzc2lQZDZS?=
 =?utf-8?Q?ZfaPvtKczQoyLPgRhLS18aIAl?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3687ec1d-701d-48d2-f823-08db8eafa8c8
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 14:42:10.6541
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 1BnXAniRYKnV6i374lkjk/7hHWASGi8od9UuxtDVhE9MshhNSnhgsBuuVgJ3rYOZeYEYzSHTl3koKE8IjBsNKg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7746

On 27.07.2023 15:26, Daniel P. Smith wrote:
> Let's bring this back to the actual implementation instead of the 
> theoretical. Your position is that Xen's paddr_t is desired because it 
> can store larger values than that of size_t. Now if you look in Xen 
> proper (main 64bit code on x86), paddr_t is a typedef for a 64bit 
> unsigned integer. And if you look at size_t, it is also a typedef to a 
> 64bit unsigned integer, they are literally a couple of lines apart in 
> types.h. Thus they are the same size and can only represent the same 
> maximum size.

What about 32-bit Arm, or any other 32-bit architecture that we might
see Xen ported to, with wider than 32-bit physical address space?

> The only area of issue for x86 is during the short bit of 
> code that runs in 32bit mode during startup. In this series, we address 
> this by using a set of macros in the 32bit code to provide 64bit clean 
> definition of the structures. This approach is acceptable because as far 
> as I am aware, x86 is the only platform where the hypervisor has to 
> transition from one bit size to another, e.g. Arm just starts in 64bit 
> mode when on a 64bit device.
> 
> At the end of the day, size_t is the same size as paddr_t for the end 
> execution environments and I would levy a guess that should x86 suddenly 
> find itself having a 128bit mode which would likely drive paddr_t to 
> 128bits, so would follow size_t.

Likely. Yet when we still had ix86 (x86-32) support, paddr_t also
wasn't the same as size_t. Even on x86-64 it's possible we'd see
physical address width go beyond 64 bits before virtual address width
would, just like had happened for ix86 (which initially only allowed
for 32-bit physical addresses, until PSE36 arrived).

In your implementation you want to cover the general case, not a subset
of special ones.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 14:43:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 14:43:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571145.894292 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2Cx-0008S8-Jf; Thu, 27 Jul 2023 14:43:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571145.894292; Thu, 27 Jul 2023 14:43:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2Cx-0008S1-GV; Thu, 27 Jul 2023 14:43:15 +0000
Received: by outflank-mailman (input) for mailman id 571145;
 Thu, 27 Jul 2023 14:43:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qP2Cw-0008Rp-1a; Thu, 27 Jul 2023 14:43:14 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qP2Cv-0006pc-Tx; Thu, 27 Jul 2023 14:43:13 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qP2Cv-0002mR-IA; Thu, 27 Jul 2023 14:43:13 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qP2Cv-0008Os-Ho; Thu, 27 Jul 2023 14:43:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=lerqQjad95wyQA2cbvb2c/Aoi2iv31uuckHz+vjE5Ng=; b=uaWn0ojx2LYeNFj6C24/4/GnCW
	KnTMBP3UuyJNBIhWXdPVikTCZmwmtYk8hr7V4TiWTbqyJ0tW7/JeTxUgFC1MqDINlAPL5u+fYQ0kg
	WaMyxVUG5Ddrgo/tkWT5BAcLXwRn94CoT3pI+fWE5iJhkjhmYS3Mizbof7QTbPJ+1SAI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182037-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 182037: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=c7a7f09c1dfa8896ccf94be2d8c7c8b420257fec
X-Osstest-Versions-That:
    ovmf=25a6745fe886e88fe175a50dcab4562c65b7cea3
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 27 Jul 2023 14:43:13 +0000

flight 182037 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182037/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 c7a7f09c1dfa8896ccf94be2d8c7c8b420257fec
baseline version:
 ovmf                 25a6745fe886e88fe175a50dcab4562c65b7cea3

Last test of basis   182018  2023-07-26 01:10:45 Z    1 days
Testing same since   182037  2023-07-27 11:40:46 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Yuanhao Xie <yuanhao.xie@intel.com>
  YuanhaoXie <yuanhao.xie@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   25a6745fe8..c7a7f09c1d  c7a7f09c1dfa8896ccf94be2d8c7c8b420257fec -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 14:43:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 14:43:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571148.894302 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2D9-0000N0-1m; Thu, 27 Jul 2023 14:43:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571148.894302; Thu, 27 Jul 2023 14:43:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2D8-0000Mr-Uz; Thu, 27 Jul 2023 14:43:26 +0000
Received: by outflank-mailman (input) for mailman id 571148;
 Thu, 27 Jul 2023 14:43:25 +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
 <SRS0=Us1z=DN=citrix.com=prvs=565118259=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qP2D7-0000La-9X
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 14:43:25 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id eea6c34a-2c8b-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 16:43:22 +0200 (CEST)
Received: from mail-bn8nam11lp2168.outbound.protection.outlook.com (HELO
 NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.168])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 27 Jul 2023 10:43:19 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB6732.namprd03.prod.outlook.com (2603:10b6:a03:407::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 14:43:17 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 14:43:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eea6c34a-2c8b-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690469002;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=UxXEyPtG9tvTzovrzRr73H3crYyhiUAyuBilWx+06kI=;
  b=dDevvJ26hMoa2xm3I0DMLZZK0D+qu71pPvKP93M7wVyfOJtOBgtSL+Es
   J+x33YGfygBTDS3+erPvimLPIxk1hnUCMQNBpOtRxAln0GYwpTRXqc6+5
   VFIHjOjRDycDiOLm1iUtOKjBGMedEP7/tJ/bNQ8RphWk47hEwW7ZHbaMh
   c=;
X-IronPort-RemoteIP: 104.47.58.168
X-IronPort-MID: 117673282
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-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B97LYOCBghrQEGgI1/qB/9SPIULDH75mvp
 uIC5IObuEZMTJB/KXHCDbTKadF/PCXtKqhgf7Xz3lrCQFmApsQijtENg==
X-Talos-CUID: 9a23:T+7/32579qFqENRYw9ss8BY9OtAeXUPkylj7BUmFMUAxR+zMYArF
X-Talos-MUID: =?us-ascii?q?9a23=3AoV2mbA/aVyE6Ml02jP87LUSQf91Y+76RMU8SqKt?=
 =?us-ascii?q?YltCmFhwtChaB1g3iFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,235,1684814400"; 
   d="scan'208";a="117673282"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KjPsNQ4z8eUPQmt0Vy+hzaoWZh+aZPyjXYR5sj5T0T28L/YhsbLrVAwDCHUKriMHy6TnksrzxBIw5lJyxpp60Lz+95gcHz7lErJ6eGoOCWlSN7FhUkqe5KIoB0/SuWAGmjTSZSwmp2quQ/MVOM1kenoB3KPPYG6pMNRgPlkDYuB+SnAgqc1N5kRKl5jjLIvMBTL/QX4XrdaCoRTrPdbMc5tgncAy+VmZ9myLVK5d8LQjRJ6+P1LLq4AEyDKbeEk2IZQvzIgKSf884mxxk9rbSBL6D3GKjWsXtaz7Bp/oLPuz4Aibex4m7miP/IJ9jxobHX8VDaRFJZXKG48yVpuerg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0IiuM0dR1My260jeFeN7cOOSGXywFDlqK5B+PnGiS+k=;
 b=D1BBv9O1eRw9GKYdpKSr1NWeQmjsn4QqQi9zqgzXsy6c9E/PxSkcqC1GTXx3MgW4zf3v3bPrLuNRRBMpAgPAfCnVWwoYWHeFaoheNTNKCGw/yTDN7O6JKlLxjZ/bucw1lCeFl083uh6BAl3dD5hTBaohsjIZhkB6OoRevxdOXy2tNIOZ9VnUmgBWlejzciX9uIs2c7ZIrQ8L0xIAE/8RMGkdJIlDf6UsVP/tPSNZIlcpVBJpb74Z5C0wUOqAWKsN9aUvm6PWcckxsOpfsRoFsEFu0KxLespIlvXtgKUioClnOGSs+CDm49lkyYfrqrZYKo8DY1X3vEzzgZeF2uVH9Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0IiuM0dR1My260jeFeN7cOOSGXywFDlqK5B+PnGiS+k=;
 b=XK+gx0DZY/aLr+hpEaWKdRnVje0Aa5yopqEP4SZQg3cXIbySD/0jfeJRNNwnybo1KIE7+Cjec98ZhTmW3OhxbujzPYbjGmBnWmKUhNJTxhD7W+rWQo59rLgoBTGOeP7DJewxqqOW1YoObBppVom7TqgOxq5eZBmRh1/Oj8/ScVQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Thu, 27 Jul 2023 16:43:11 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Message-ID: <ZMKCf8RMwFqjpD1S@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local>
 <87ila7cvy2.fsf@epam.com>
 <ZMDox0WwumxMGnzV@MacBook-Air-de-Roger.local>
 <87y1j2b296.fsf@epam.com>
 <ZMJmJTkSFLKZXkKB@MacBook-Air-de-Roger.local>
 <bef5cab4-023d-468e-bac0-2c71528dca81@suse.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <bef5cab4-023d-468e-bac0-2c71528dca81@suse.com>
X-ClientProxiedBy: LO2P265CA0202.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:9e::22) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB6732:EE_
X-MS-Office365-Filtering-Correlation-Id: de3a590b-5873-4437-472e-08db8eafd05b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	jLEaoNGdmFCXqSSIbjotgdi+y1FCTKxtfXsNSYKetrgkJhxFm2BiBqdVASc0knA/ds9zWLpJCYR3gYLFEpqfTSTN+Frpd13DhoST0A+W5E02o+2+YVUEy83gBeKCfw1IALiWTYw8mXNiuM8sznmLjeOzXY/I+VqwF3kUwTaIwUOyOVmTjvv5BTUuE8JI0PkaPYBCAkUbRgEhTUHlXt1gEIyQzxZgvT863fLexSypYDKKqkWxhm5f7RmhhQCyJcN+W0zLx3T9vWOB/ndbrZ7WDguG6RK1ui7ebmCcPZmk1n1FZXKVatrXg42hJCuNqjMX1pOXQyRANkaMfpGGFZThnB4ftSahnZcpVOvVC/8ItMErguDtpJzNFTQkX3ZeC+BA7TN9XAuq7qTQaqSbeuKFgRG6TORdoaR33xkVFpegHICgjMFOQM5mM/sYA+giPZ9ejtRfeJHnXdF03g1xyzf8cqBkhAc0KQa2cgTtn1K0OS79UPpJi1H7LsPq8PztQKPT327em6Y9YiwIl+WBD7AR60+gWmhlqFS7lJ2i6pABK2Fp4wp1B8rqHpbfojIdF9Wy
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(366004)(396003)(376002)(346002)(451199021)(186003)(26005)(6506007)(53546011)(6916009)(83380400001)(4326008)(316002)(66946007)(8676002)(66556008)(66476007)(8936002)(5660300002)(41300700001)(6512007)(6486002)(9686003)(6666004)(2906002)(4744005)(478600001)(54906003)(82960400001)(38100700002)(85182001)(86362001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bFhvUmx5RTdVODlkajV1YWZEcjQvK0d6WWpYOG9vczMzUWpKMjRicmp5cmQ0?=
 =?utf-8?B?VE05MXhhVVF6ZG9WL3pjR0xoS3ltaU52aEtrNnZTZGJnT1ZrM2s5NTB3TkpG?=
 =?utf-8?B?WnEyVkZ2MUR5ak9Zd2VsNnpKOXBxQXRYYmcrVHNybW1GVFZRYzNJblNLVFNt?=
 =?utf-8?B?ODZDSXEvaE42dFpxUFNaRzlRclRSRGR2eDl4Vm1ONkI4QTVveUc1RUM1aTVu?=
 =?utf-8?B?UUN0eTMxU3k2NGNKc2hVVzFnZnBzcE9vekhaK01wQ0Iya1VEaDQ4SGNhNXlK?=
 =?utf-8?B?VUs5eWxqbVdtUjJjc3ExRnVnVEkzR1g3dExvcDVKYXo3aGhoYlcyR1I2S1FI?=
 =?utf-8?B?L2ozY0FWRzh0V0dZeUlqZlR2eGY1eFBmaS9HK0NWa1loZHBXMWJ2OEFpNFg1?=
 =?utf-8?B?c3lyNWF0dnIrT3pwSisx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-Exchange-AntiSpam-ExternalHop-MessageData-0:
	TUbxFFecSV548JLeGap2b8roS2B8SQi2KpBCX8Bwexpui/RIZnQmnRYgC+keq5YvnVW7vmuvf9+/SuWZQVjNtAX88H0Lju45K5Gee1ksbAytDAPRlVNFqqr6M4w1RL/NUwGoIDRRMq0ZNEUdROeTi8FlD/NdZ14cZWB2OM6E8OB+GNSRdlG+gDyjHGS+DQlyaTPI7gU4SuVNws5TueKskcTgVPmEmqKr6YfNB09PYietw5nDsG7kgJ1S7NNU22smrLNeMdW55Jw/5rvu7sSs50onu3EuTRTiki5xuxT0Cz9XLCPd8gMRFSuYxd9K9UN1HjO0SFUNnfaqxYf12oVKDNF3QrMvS06pRcA6KqaP3ZVaC4xwLe1qVPhzrfblsBuY3HMwWDLxLu9U2GZjXoh6uJwnbrMCkvxQYJMz9vUDnw1wUbMarNk/zfdHfTK91K4bdtDz2Wi4GWBFZ6R9WklmPRQ22E+KE1KsaLD/nKrnm1l8ZcGi4RO3CRW5cLsrpf0qlf7rqSVV1RkzLQ/1tMy2r0KD3uKMGMXMLgKNFzPgI2QO6kgSffj/81vIf1Obe/jxn6YXNEobwKdSw0yVbAtEbeCvC1ljV42wDRXR4kaNAz+JIs2oql9VBJoo0f7w8zlwsDmrU+TIyPGHsd1rWZcR286dfKvrK0n56Nwqpx8mtufpUO+9LSuWFl2RLs9P/DM2uhDcdnRHIo9dXkDdxzU4ifY5hnqXrl2IS9jdbctHvqg+iFwkO6rW6bz9lWxofvToHxU/2yB33eD0ww3rd64cYFTAjsQk4ODI7HaFmwUWEraEt+5r+5zlbf8CZ9JDZE+hyB2ur/Q5ZVQrRk0XBPweDA==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: de3a590b-5873-4437-472e-08db8eafd05b
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 14:43:17.0465
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: LtG5jZgA3vBmpSvyNe9xvEMz0R9g+WPnuODMcxjqTuzUvhCutas5vRHu+JIi45TWmtQRNaivrXxv6XroLyOwiQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB6732

On Thu, Jul 27, 2023 at 02:56:18PM +0200, Jan Beulich wrote:
> On 27.07.2023 14:42, Roger Pau MonnÃ© wrote:
> > There are also existing callers of iommu_update_ire_from_msi() that
> > call the functions without the pcidevs locked.  See
> > hpet_msi_set_affinity() for example.
> 
> Ftaod first and foremost because there's no pdev in that case.

Likewise for (mostly?) the rest of the callers, as callers of the
.set_affinity hw_irq_controller hook don't have a PCI device at
hand.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 14:48:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 14:48:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571152.894312 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2Ho-0001L8-L6; Thu, 27 Jul 2023 14:48:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571152.894312; Thu, 27 Jul 2023 14:48:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2Ho-0001L1-IM; Thu, 27 Jul 2023 14:48:16 +0000
Received: by outflank-mailman (input) for mailman id 571152;
 Thu, 27 Jul 2023 14:48:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Tn4a=DN=epam.com=prvs=157204e9ea=oleksandr_tyshchenko@srs-se1.protection.inumbo.net>)
 id 1qP2Hn-0001Kv-GV
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 14:48:15 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9c6f1c52-2c8c-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 16:48:13 +0200 (CEST)
Received: from pps.filterd (m0174682.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36RDOnKN001551; Thu, 27 Jul 2023 14:48:02 GMT
Received: from eur03-dba-obe.outbound.protection.outlook.com
 (mail-dbaeur03lp2177.outbound.protection.outlook.com [104.47.51.177])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3s3seprdny-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 27 Jul 2023 14:48:02 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com (2603:10a6:10:ed::15)
 by PA4PR03MB7343.eurprd03.prod.outlook.com (2603:10a6:102:10d::22) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 14:47:59 +0000
Received: from DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::3a00:d290:e446:d887]) by DB8PR03MB6108.eurprd03.prod.outlook.com
 ([fe80::3a00:d290:e446:d887%3]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 14:47:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9c6f1c52-2c8c-11ee-b248-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=PVEVq4Kuq/lYLZfMli05m/TOZ+N8XkcP3xLFtDXHdnxgUkfH27mlm6ZgnzRSC7iamLBm+YpV1OjS6oyaPSqLGcwG/DeHxoFFOrEyszLULBZ+ch0pAYL/pW5JOnVvg5EqqfIsnu3D1M+g5XiLgQgWJkZ1n4lxmP30n2vx2aHvSoET0DBtAfTsagdiwigiD/bKKzvw+Sj8B3d9yT6STGqzrJkQk4xQWqtRFpndDEZBS1U/ua1ySI7qTRVfOMRYUs8PVxlIuQAnYAZ6gq16+4A1mc2ScpqynOJrREZ86Ux5WSDm/4H73z9Hhawfrhd4zc01SyjZdx5gv3Y6haUELizZGg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=cQXDzWhTz+hKtLvoWOOEmrmFD5eb4dULzLkuLmrNXSQ=;
 b=YhwrNGI1MJrV4g35JMANEYdkexAcf/sx0C5xEpcQUpYJ5HxbhUfUTaP5g9jj5OZuVxx4SLXs8F2ZwykivFwJpDgZOqFIJWDm+XsuSVxbvvsNnQ38DQCFFPH6jwEuq2OglaJPZkopCd39GuaDyTZT1i2z4+CxTdiU0vf4MqQNwB6rY4zckR7TAsKbXklvNkpf7SBEKwsEHcjEmE9yZnVXKLlkh+5UiHZHSRLaSkr/4oJ1G+e6WEYk/rrsHjdcmMjgtqtTjswHQnv8vXF4iroHuu7z1kQh6c9TnpvAVstb/sVXUM5yTlvdNGvn2RD6AsD9UuvH1IOatmlfPGuuwoiEOQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=cQXDzWhTz+hKtLvoWOOEmrmFD5eb4dULzLkuLmrNXSQ=;
 b=HXDYKOLFV7F3f0LbUIfPqI/k7WXw3virTElKXJCYBSlwsooqivlq+pDo6sgAa8PjeiSFPsaVJlqouy9TMe7rA6U4/Cmef7HIOcoGYXjcZXCCQMXvHD4k/yIYNt2AMnYvCR7daDNDMNR21BxnvoYKKWSCQG93eGklVLqNZo8exLvaN1HzuhWRS7IpnM6FNT+ReLQWpQjGNIlduU5MYdCvSPatZBpeCKPe4cxcMM8/Bsxm6bwFgq5QKhqontSm7M2NgKJ4+/KUxYxv4KRI4UH+04C19d+im8KpCBpZWUWjU0Jsipc4mmBGqIqLLyht7m8WYBYSZyduMJUo13FTtDvtgw==
From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Wei Liu <wl@xen.org>, Oleksandr Tyshchenko <olekstysh@gmail.com>,
        Anthony
 PERARD <anthony.perard@citrix.com>,
        Juergen Gross <jgross@suse.com>,
        Viresh
 Kumar <viresh.kumar@linaro.org>,
        "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] libxl: Add missing libxl__virtio_devtype to
 device_type_tbl array
Thread-Topic: [PATCH] libxl: Add missing libxl__virtio_devtype to
 device_type_tbl array
Thread-Index: AQHZv8uYlQiykVHkhkC1aQss9HQu9q/MIX0AgAAGYQCAAYcXAIAABB+A
Date: Thu, 27 Jul 2023 14:47:59 +0000
Message-ID: <1fbb1e15-8e46-53ae-b1e0-5eb16c35b635@epam.com>
References: <20230726141459.985463-1-olekstysh@gmail.com>
 <969aacb8-a608-be01-f0f5-34fb1cc61d62@suse.com>
 <35a1988d-94a5-9f2e-2478-ab08268f02b0@epam.com>
 <f8c151e4-1e0a-1465-0d5e-be55e25df818@suse.com>
In-Reply-To: <f8c151e4-1e0a-1465-0d5e-be55e25df818@suse.com>
Accept-Language: en-US, ru-RU
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DB8PR03MB6108:EE_|PA4PR03MB7343:EE_
x-ms-office365-filtering-correlation-id: d8192417-e86a-4aa4-c6d4-08db8eb078d8
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 gEesf5Ezm90ieO1mRoyKLHHRxNnVIjW3EDssSf75Q5SYaw7fbw7Rw9mcM/kyesd6r8mm1QB4rN8STgGNSi1sFBhZjDvxfAsYe4PCGGJt4abM/iJ6z/cS8EcSsYU8U24yi32o4vjn45mENYDsmEQPn0RAF2OGTR++vxCpswrbfR6Vfxd18ZIllx6ePWFlkqStkkzhFFDZIZ+LpglG/QoyaLVduFd+DLrwYMY4GCOqzqFWrGyG141NOw0JnUlFyc2bCkUm4XofOgKFXW33DfKIi6KlU/pqxovWIv/QY3KL+lIrD06WBECyiwiPbIMRBRmn+cWnNzy7V3B68+wlvWeWHCFKEE3+A8xXPr+BjKRVDe6orJyuTGw7Q9RsFi6JEmavRoaE5Ft2kiEbL+HOn/3IvPH7SUVYS/ZYeDLS8bpi/j6l3Yc3xQJzX3B9fLptaV41Sa6iQbzXkfDccyPKhRZrHPb3XSRHUWNJnx1jJSBn1ON6q36cTkA3+bSmE1g0BzwdKzk15r+f664E/LI+ilvbAUvNORjJhL48HdO8b/4qfMUBOzhAMH9YdR1NpgkRSKjIdQdxCHTCpVRUY+j0R0hgmy2xAIDNxjrsDGZPuM6Tc0k6vevC/Z8tUzES5ufF9Gld0KFmo5L4T3SE1A/zpJtBkEHxgaeFkyfXRYdjHftGlOg+RMwTI4yRUcm+4/7diCPZ
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR03MB6108.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(346002)(396003)(366004)(376002)(451199021)(71200400001)(6486002)(478600001)(83380400001)(53546011)(6506007)(26005)(6512007)(4326008)(6916009)(66446008)(64756008)(38100700002)(122000001)(76116006)(54906003)(66476007)(91956017)(66946007)(66556008)(186003)(31686004)(2616005)(5660300002)(38070700005)(316002)(8936002)(8676002)(41300700001)(2906002)(31696002)(86362001)(36756003)(101420200003)(45980500001);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?ZlVrN1cyTnp5MXRPWjA0VGNKQk1xbEJQdTBnMGRoSmZhSkpPZ1BqRE10OTRT?=
 =?utf-8?B?cFNpUHZ5VmFIYVVRdEY4Z2dPdjE1OEIvZDBveTF4dktKU1VPN1N0dm5WZy9K?=
 =?utf-8?B?NXpITHd6QlBLd1d6ZDJTM1JKSS91UlhrNkplbXZCQ04yd1BGcmVqd1BoZUcr?=
 =?utf-8?B?TmVicThkSkcrdnpTbnpGZ3ppU25NeGZWem9jOEdJd1NxcFNkQWh1TkE5M2Nk?=
 =?utf-8?B?b1c2bXZGYWZxY2lZcGlTQTYxVnV5SVZzU3RiUUtFMjJIUGpjb3RWZDZhQ09a?=
 =?utf-8?B?RmR2dzF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M5TXdXLzhaY2hEYnEyMkpZZlFzZ2dEQUhlZlArdWZWRE1md0EyZGtxdDFu?=
 =?utf-8?B?SFNZZnNCaGJMbjJDclh4M0RuQ1dQSjVEQ3FldjlhVnpkUkx1dEg2aUR4aEhw?=
 =?utf-8?Q?BRNuIIaHoOz3QsnneubuwnU=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <2C7CFA5CF2770D4BB1401386D002B398@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DB8PR03MB6108.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d8192417-e86a-4aa4-c6d4-08db8eb078d8
X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jul 2023 14:47:59.5708
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: Efb2NmqAgTcN2zAFINUjPcICkN7Q9sVS+IFh9eXr+PnkXDD4EUN6zZAFUOGUkQ1mE8adNWZI7lEPynkMZA9tPlOGBnx1poLEU4h9414tN40=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR03MB7343
X-Proofpoint-ORIG-GUID: Mp0UuiVwkq-4u9XLelp-DhrnfRa6vTAt
X-Proofpoint-GUID: Mp0UuiVwkq-4u9XLelp-DhrnfRa6vTAt
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-27_07,2023-07-26_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxscore=0
 mlxlogscore=999 impostorscore=0 phishscore=0 malwarescore=0 spamscore=0
 suspectscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0
 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307270132

DQoNCk9uIDI3LjA3LjIzIDE3OjMzLCBKYW4gQmV1bGljaCB3cm90ZToNCg0KSGVsbG8gSmFuDQoN
Cj4gT24gMjYuMDcuMjAyMyAxNzoxMywgT2xla3NhbmRyIFR5c2hjaGVua28gd3JvdGU6DQo+PiBP
biAyNi4wNy4yMyAxNzo1MCwgSmFuIEJldWxpY2ggd3JvdGU6DQo+Pj4gT24gMjYuMDcuMjAyMyAx
NjoxNCwgT2xla3NhbmRyIFR5c2hjaGVua28gd3JvdGU6DQo+Pj4+IEZyb206IE9sZWtzYW5kciBU
eXNoY2hlbmtvIDxvbGVrc2FuZHJfdHlzaGNoZW5rb0BlcGFtLmNvbT4NCj4+Pj4NCj4+Pj4gV2l0
aG91dCBpdCBiZWluZyBwcmVzZW50IGl0IHdvbid0IGJlIHBvc3NpYmxlIHRvIHVzZSBzb21lDQo+
Pj4+IGxpYnhsX19kZXZpY2VfdHlwZSdzIGNhbGxiYWNrcyBmb3IgdmlydGlvIGRldmljZXMgYXMg
dGhlIGNvbW1vbiBjb2RlDQo+Pj4+IGNhbiBvbmx5IGludm9rZSB0aGVzZSBjYWxsYmFja3MgKGJ5
IGRlcmVmZXJlbmNpbmcgYSBwb2ludGVyKSBmb3IgdmFsaWQNCj4+Pj4gbGlieGxfX2RldmljZV90
eXBlJ3MgZWxlbWVudHMgd2hlbiBpdGVyYXRpbmcgb3ZlciBkZXZpY2VfdHlwZV90YmxbXS4NCj4+
Pj4NCj4+Pj4gU2lnbmVkLW9mZi1ieTogT2xla3NhbmRyIFR5c2hjaGVua28gPG9sZWtzYW5kcl90
eXNoY2hlbmtvQGVwYW0uY29tPg0KPj4+PiAtLS0NCj4+Pj4gICAgdG9vbHMvbGlicy9saWdodC9s
aWJ4bF9jcmVhdGUuYyB8IDEgKw0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w6
IGFkZCBzdXBwb3J0IGZvciBnZW5lcmljIHZpcnRpbyBkZXZpY2UnKQ0KPiANCj4gSW4gbGlnaHQg
b2YgQW50aG9ueSdzIGZlZWRiYWNrIEknbSBub3cgdGhpbmtpbmcgdGhhdCBubyBGaXhlczogdGFn
DQo+IHNob3VsZCBiZSBoZXJlLCBhcyBpcyBiZWluZyBjbGFyaWZpZWQgYnkgdGhlIGFkZGl0aW9u
IHRvIHRoZQ0KPiBkZXNjcmlwdGlvbiANCg0KSSB3YXMgYWJvdXQgdG8gc2VuZCBWMiB3aXRoIHRo
ZSBhZGRpdGlvbiArIEZpeGVzIHRhZyBhbmQgbm90aWNlZCB5b3VyIHJlcGx5Lg0KDQpCYXNpY2Fs
bHksIEkgYWdyZWUgdG8gbm90IGFwcGVuZCBGaXhlcyB0YWcsIHRoZXJlIGlzIG5vdGhpbmcgYnJv
a2VuIA0Kd2l0aGluIGN1cnJlbnQgY29kZSBiYXNlIHJlZ2FyZGluZyB0aGF0LCBhbiBhZGRpdGlv
biBjbGFyaWZpZXMgdGhlIHN0YXRlIA0KYW5kIGRlc2NyaWJlcyB3aGF0L2hvdyBtYXkgYmUgYnJv
a2VuLg0KDQpJIHNob3VsZCBoYXZlIG1lbnRpb25lZCB0aGF0IGZyb20gdGhlIHZlcnkgYmVnaW5u
aW5nLg0KDQoNCih3aGljaCBJIGd1ZXNzIGNhbiBiZSBmb2xkZWQgaW4gd2hpbGUgY29tbWl0dGlu
ZykuDQoNCkl0IHdvdWxkIGJlIHJlYWxseSBnb29kLg0KDQoNCg0KDQo+IA0KPiBKYW4=


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 14:51:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 14:51:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571154.894321 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2KZ-0002kv-2d; Thu, 27 Jul 2023 14:51:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571154.894321; Thu, 27 Jul 2023 14:51:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2KZ-0002ko-01; Thu, 27 Jul 2023 14:51:07 +0000
Received: by outflank-mailman (input) for mailman id 571154;
 Thu, 27 Jul 2023 14:51:05 +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 <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qP2KX-0002kg-Ks
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 14:51:05 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on20615.outbound.protection.outlook.com
 [2a01:111:f400:fe16::615])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 008de444-2c8d-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 16:51:01 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB7830.eurprd04.prod.outlook.com (2603:10a6:20b:2ac::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 14:50:58 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 14:50:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 008de444-2c8d-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Ym8nT4bY6T2Z5dQii/h8MXC2Gns96u5G+oDaZmweXCEXi0DTdwucW/LWc/qhutRzO5/OoRLnHFFhcL1zBqzkcErnglHMrXySaGAN2NzA1dzQRGsF/IBpke6Af1SGm7ycIyjkcEiLincDN0Eh09Oov0ugv58eKCyOcarUS/5QQ0PVXq1sgSmuO102d4lKtcDVanLlJaLy5MGAvQZiT9OIAy/lYwRYzfu5JnCpYEz8+Wwf0G6R5WubO1JPPvKXYif3R8DILiDNuZZDL68ftOFeoxbQRHf/EvOQKt1Int9KdlWAy5cgGxJ2GnBvAxhe7h49Ur85Y6be+h3OJG0oavwlkw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ai63f1VzzCVHjQDWUD/HzjE9IGoLvaWj1ZZrI+kBvFw=;
 b=VE5KMZTemE+TiEkGMiDM8aMse/7SAEj91xmL2pXFAJOPPNp6ee5jH7SdiS1Kmu45+PBi7da0m5We+vb4MMkAjFeCrWA3edzVoxEivOqXexa19E/aKy+UvOnrgYrmhdwLY9FpBWvL+BDdGMYVhcjRJ9uQg7kZWEyVQJy2rNbWxGr7qdOVBEhMorMtO8Ycox2AH2XcqsLLMjd7OF0VKhY63f2rLRpa62kjYGiQn+52fu68zm8dfQh6NuMJXnSIdFXJBG6w0987y+xV+iBPy7pbKcWb3yvwCe/XxFW5GExXfa/4GV9247qhuUEUICVgKsv8V9Rk/2JwmEkG1Ua3yZHbiQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ai63f1VzzCVHjQDWUD/HzjE9IGoLvaWj1ZZrI+kBvFw=;
 b=IrzXhs2WuysGhFWQ4+m4LG44NUKa4WCluzU485/85dEaAAP+TP67j6zbErNqpqzoVU97+ahcoVHK4IxDd3wzNFYo3iamgSvfXJbwoML030oOPMe6annuEdQXucnq1SVGUIwAVtwAYcj1iGWRmZJN1pKdL9Vd4LTu+/oT/wCALcdb1/wYbxCpkXIFxfWTHeqGalxvJwo2x+oIDdpFPRyRJoNEndof5ksUtcwhs0jxngeorWK6tlrUjUXJUnEMkcjb28jOehmvVfgVLp4SDSYVIhHluKJnxPvnHXLh8Q2T5wlYud3PWjYB99Whmo5UeLByr2QIZuPwliFtDDxD/z9mPg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <604b915b-e07e-8985-87f1-300568d0259f@suse.com>
Date: Thu, 27 Jul 2023 16:50:56 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH 1/4] x86: mechanically rename to address MISRA C:2012
 Rule 5.3
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1690449587.git.nicola.vetrini@bugseng.com>
 <614dd6fe03ab82db83eabc430b27435b19096791.1690449587.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <614dd6fe03ab82db83eabc430b27435b19096791.1690449587.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0267.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b5::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB7830:EE_
X-MS-Office365-Filtering-Correlation-Id: 25da8c15-fc30-45a6-5e61-08db8eb0e36e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	/ae9xEZeBeisMSqV/spIm2LVb8+8m4rERwtL6eu9Kem8u7eL0/hiNW7+BjOiY1gE4PrEJykCBjDwt0smtz0Qrfyy9DQtkU2Md+pu8XJdIaUz8GlHK6DIwEtCse8lgnKUEiSEtCICpL85h6ZlKqI9ThmFzbE2iEsqEMBaT+nz8FHqwl7M4Z980uKvZlshaAxFbT4sY7iPmhrSNUi+yZ84QFe8C4ZuWqNpiDhsVTAGZm0aQacB3mblFwDfm+xZGKOfhdwhUoGCop2h61wymJaCGE+VN5NcPw0J4CXBFaMPL5oufV3BvOdSG8LqFlEWLTeRwdvjT1ZOuhRF7NCOuaB+b8pkaDm40jfci6GtLzS4sHg5gFr1ze+/Oc67ihIWuPrBrvVr/JXPCI1IFdihyr9FEds1j0xvV3Jpt8jvlP11xFtzUXHcoCwXwp7EENq8bOp+qWqHWwnM4CANyuzihXr059HDjk76KGhiNURGLf3fPUAFqRWzBEocAVMWQ8/YbEZYcd9E1EcwZCGTazAfe6WcJCf2OiyB71NRlIkQPeArtDW4DjRXgmusqHQKDx0RVlZzphzrH3TMl7yizeRKijfGbnam96qIxh/ouh2ccqbk9OUsXRaUKLAIrN9/lTphB/4U8M8LOIoyYGpgXRaLhf6Lzg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(136003)(39860400002)(346002)(376002)(451199021)(7416002)(41300700001)(316002)(54906003)(66476007)(66946007)(66556008)(6916009)(31686004)(5660300002)(8936002)(4326008)(8676002)(2906002)(86362001)(6486002)(36756003)(6512007)(478600001)(53546011)(31696002)(6506007)(26005)(186003)(38100700002)(2616005)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WnBEcnJKMzRaVVJJd0c0b0xMZ1FYMkd2N1NaSkZEUnZvKytvTVhvUEQ3dnRx?=
 =?utf-8?B?cnp1bG1jbnBkMW1kNjVyM0NVNDBFb1NSc05WTWFHZ3ZWcU1JVVFhY2JTMDI4?=
 =?utf-8?B?YVdIenhmZWxoa28vWjUxUnN2VXY3UmVSNDZTM0xrUXVXbS9GK3BQTlQrb2x1?=
 =?utf-8?B?dnE5YlBHbGVCMExUdi9pMFhNZEw5K3Rpejh6NjlaZTQ0K0xJVk1ieUJPUFcz?=
 =?utf-8?B?UEtKS01qRllqTnNoOFc2RlY0bDkvT3JOaXRPSTNpR0ZGZ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B?dkE4TE55RENNWUlPQ0pZd1hzYy9HcXcwcUhXSmJRMjBVY2hlYnNZZVJFckNa?=
 =?utf-8?B?bVN3UkxqNzdDOFRHR0dOZkhQSWtFaTltTnFSM00zZm0vRUlaWDR6YlhSUG9t?=
 =?utf-8?Q?BTgk6XxuUc8MpC/NdMq2PWjwf?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 25da8c15-fc30-45a6-5e61-08db8eb0e36e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 14:50:58.5593
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: WrtBwX155Xs+sV7wq9FACQ0QB/VW4NYhmNnW60xdiFQhujfMF72xEVzQfJIk56tgT9WPz3RWUZxHwc/RwbF4hw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7830

On 27.07.2023 12:47, Nicola Vetrini wrote:
> Rule 5.3 has the following headline:
> "An identifier declared in an inner scope shall not hide an
> identifier declared in an outer scope"
> 
> The renames done by this patch avoid shadowing from happening.
> They are as follows:
> - s/str/s/ in 'lapic_disable'
> - s/str/level/ in '(apic|mce)_set_verbosity'
> - s/str/state_str/ in 'mwait_idle_probe'
> - s/str/memmap_name/ in 'init_e820'

I'm sorry to say that, but I'm not willing to go and figure out where
that "str" is that there's supposedly a collision with. Please can you
state such right here, ...

> - s/i/j/ in 'mce_action' (the shadowing here is due to macro
>   'x86_mcinfo_lookup' that defines 'i' as a loop counter)

... much like you do in this case?

> - s/desc/descriptor/ in '_hvm_load_entry'
> - s/socket_info/sock_info/ in 'do_write_psr_msrs'

(I didn't look at any of these in any detail, partly because again
I hope for additional context before doing so.)

> - s/debug_stack_lines/dbg_stack_lines/ in 'compat_show_guest_stack'

This wants doing differently: The two functions originally lived in
different source files, so passing the static variable as argument
was preferred over making the variable non-static. When the function
was moved, that aspect was overlooked. The function argument simply
wants dropping.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 14:55:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 14:55:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571157.894332 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2OH-0003P2-LM; Thu, 27 Jul 2023 14:54:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571157.894332; Thu, 27 Jul 2023 14:54:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2OH-0003Ov-Ik; Thu, 27 Jul 2023 14:54:57 +0000
Received: by outflank-mailman (input) for mailman id 571157;
 Thu, 27 Jul 2023 14:54:56 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=o85N=DN=citrix.com=prvs=5659ebe79=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qP2OG-0003Ok-2K
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 14:54:56 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8b002ab0-2c8d-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 16:54:54 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8b002ab0-2c8d-11ee-b248-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690469694;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=Hcg0ovz5HbTHnbqiHpWTiuuU7P9vY7vRW2jCflylASU=;
  b=hCqgHrdCqyEC8IqHiJqyc31L/EufVgkEqZwzUwe0uqr1AVs52ifBHJU4
   pBy1mWm6r8h9/LDhJidc2hz8EOy7IecVvOiV6iKlNx5AUi7bkvxubnA3t
   hk1HpqbDKVrtb0ZJH/RlNsRDQVWR9FrZ5MTaOLiHdj499hwvUVGMBAlhV
   w=;
Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 118094556
X-Ironport-Server: esa1.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:JUBeHKh3WZ3OhCc7BOg/aXxyX161SBAKZh0ujC45NGQN5FlHY01je
 htvXzuAOKuPZjahfotyYInk8xlS657Rn95iTQBo/H0wEXsb9cadCdqndUqhZCn6wu8v7q5Ex
 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv
 cKai8DEMRqu1iUc3lg8sspvkzsx+qyr0N8klgZmP6sT4wWBzyN94K83fsldEV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ZniDhILAFugLhrcKgQeBJ8SUzJ876U
 4PSdkZNDQyNzRHZATBjTVQ3+xO/DBPys6Vuds=
X-Talos-CUID: 9a23:p5u5hm54q+uXk4kVmdsszHQWIuMFfyXh9y2AJX+qIHhXWJrORgrF
X-Talos-MUID: =?us-ascii?q?9a23=3Aa0zItw9y0GFOOHTMbpCmKXKQf59D8qe0U34RqpQ?=
 =?us-ascii?q?DvdvcMxRaEmiNvDviFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,235,1684814400"; 
   d="scan'208";a="118094556"
From: Anthony PERARD <anthony.perard@citrix.com>
To: <xen-devel@lists.xenproject.org>
CC: Anthony PERARD <anthony.perard@citrix.com>, Wei Liu <wl@xen.org>, "Jan
 Beulich" <jbeulich@suse.com>, Julien Grall <julien@xen.org>, "Stefano
 Stabellini" <sstabellini@kernel.org>, George Dunlap
	<george.dunlap@citrix.com>, Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [XEN PATCH v3 0/2] build: reduce number of $(shell) execution on make 4.4
Date: Thu, 27 Jul 2023 15:54:45 +0100
Message-ID: <20230727145447.2701-1-anthony.perard@citrix.com>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

Patch series available in this git branch:
https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git br.build-exported-shell-command-value-v3

v3:
- replace evaluation on first use construct by immediate expansion.

v2:
- new patches removing TARGET_SUBARCH and TARGET_ARCH.
- style change in first patch

With GNU make 4.4, the number of execution of the command present in $(shell )
in exported variables increased greatly. This is probably because as of make
4.4, exported variable are also added to the environment of $(shell )
construct.

>From the annoncement:

    https://lists.gnu.org/archive/html/info-gnu/2022-10/msg00008.html
    > * WARNING: Backward-incompatibility!
    >   Previously makefile variables marked as export were not exported to commands
    >   started by the $(shell ...) function.  Now, all exported variables are
    >   exported to $(shell ...).  If this leads to recursion during expansion, then
    >   for backward-compatibility the value from the original environment is used.
    >   To detect this change search for 'shell-export' in the .FEATURES variable.

Also, there's a new paragraph in the GNU make manual, but it's a warning about
exporting all variable, still it might be relevant to the new observed
behavior:

    https://www.gnu.org/software/make/manual/make.html#Variables_002fRecursion
    > Adding a variableâ€™s value to the environment requires it to be expanded. If
    > expanding a variable has side-effects (such as the info or eval or similar
    > functions) then these side-effects will be seen every time a command is
    > invoked.

The issue was reported on IRC by jandryuk.

So, I've locate a few obvious candidate to fix, maybe there's more $(shell) to
change?

Anthony PERARD (2):
  build: evaluate XEN_BUILD_* and XEN_DOMAIN immediately
  Config.mk: evaluate XEN_COMPILE_ARCH and XEN_OS immediately

 Config.mk    |  8 ++++++--
 xen/Makefile | 16 ++++++++++++----
 2 files changed, 18 insertions(+), 6 deletions(-)

-- 
Anthony PERARD



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 14:55:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 14:55:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571158.894338 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2OH-0003Sh-Vs; Thu, 27 Jul 2023 14:54:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571158.894338; Thu, 27 Jul 2023 14:54:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2OH-0003RY-Px; Thu, 27 Jul 2023 14:54:57 +0000
Received: by outflank-mailman (input) for mailman id 571158;
 Thu, 27 Jul 2023 14:54:56 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=o85N=DN=citrix.com=prvs=5659ebe79=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qP2OG-0003Ok-RC
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 14:54:56 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8ca5998a-2c8d-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 16:54:55 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8ca5998a-2c8d-11ee-b248-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690469696;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=Ohc1iV0GThxiLbuhMafuZPgcgU3YvgSTIZgUQtbNJOA=;
  b=App6GUa/Xmz82snkjg8mykFveGwhLbPMKDmxNfy0zHkztz+m3GMXfuiQ
   V1cZl4WKym9oIZTyw3kho1Num+MEc9IYJ0iQe7thZUc82BsO7BAEjCPze
   en184+FwPOB5mkMg/5ZxVWH98pNZsR8gXVV8+MDm5htzNDeqN91Kdum/E
   Y=;
Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 118094561
X-Ironport-Server: esa1.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: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VviGALQBt3VEYve+FmFm
 zqhH5XiJ+pjvB3WPXCMrN97waEiJnknH5Hmw/G7hcbaSjeK7FoJUqeLqZt4ItwNokigvruQl
 p1LchMCmQWXaLyuAVniV02Pn5u0B8sl9itiYnBxVbtqslB6CbuSAG4kX8NfVdEaGCZLlJaYk
 9Ftlx28P8ly
IronPort-HdrOrdr: A9a23:8WP6+q81h7xXXoAbd6Buk+AcI+orL9Y04lQ7vn2ZKSY5TiX4rb
 HKoB1/73XJYVkqN03I9ervBEDiewK/yXcW2+ks1N6ZNWGLhILBFupfBODZsl7d8kPFl9K01c
 1bAtJD4N+bNykGsS4tijPIb+rJw7O8gd+Vbf+19QYIcenzAZsQlzuQDGygYypLbTgDP7UVPr
 yG6PFKojKxEE5nFfhSVhE+Lo7+T8SgruOeXSI7
X-Talos-CUID: =?us-ascii?q?9a23=3AOMIQR2hDz+1bPVggYHMV/fVcXTJuYl/x1nvpAUW?=
 =?us-ascii?q?EDk1CE+LEZG/JyqJ2up87?=
X-Talos-MUID: 9a23:D9Js9QsNiCJC8wDLz82n1C1zbNg02puVEWsIsJIhv/G6awB9JGLI
X-IronPort-AV: E=Sophos;i="6.01,235,1684814400"; 
   d="scan'208";a="118094561"
From: Anthony PERARD <anthony.perard@citrix.com>
To: <xen-devel@lists.xenproject.org>
CC: Anthony PERARD <anthony.perard@citrix.com>, Jason Andryuk
	<jandryuk@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>, "George
 Dunlap" <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, "Julien
 Grall" <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Wei Liu
	<wl@xen.org>
Subject: [XEN PATCH v3 1/2] build: evaluate XEN_BUILD_* and XEN_DOMAIN immediately
Date: Thu, 27 Jul 2023 15:54:46 +0100
Message-ID: <20230727145447.2701-2-anthony.perard@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20230727145447.2701-1-anthony.perard@citrix.com>
References: <20230727145447.2701-1-anthony.perard@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain

With GNU make 4.4, the number of execution of the command present in
these $(shell ) increased greatly. This is probably because as of make
4.4, exported variable are also added to the environment of $(shell )
construct.

Also, `make -d` shows a lot of these:
    Makefile:15: not recursively expanding XEN_BUILD_DATE to export to shell function
    Makefile:16: not recursively expanding XEN_BUILD_TIME to export to shell function
    Makefile:17: not recursively expanding XEN_BUILD_HOST to export to shell function
    Makefile:14: not recursively expanding XEN_DOMAIN to export to shell function

So to avoid having these command been run more than necessary, we
will replace ?= by an equivalent but with immediate expansion.

Reported-by: Jason Andryuk <jandryuk@gmail.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---

Notes:
    v3:
    - replace evaluation on first use construct by immediate expansion which
      isn't likely to break and is clearer.

 xen/Makefile | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index e8aa663781..c1738dbbde 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -11,10 +11,18 @@ export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
 export XEN_WHOAMI	?= $(USER)
-export XEN_DOMAIN	?= $(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))
-export XEN_BUILD_DATE	?= $(shell LC_ALL=C date)
-export XEN_BUILD_TIME	?= $(shell LC_ALL=C date +%T)
-export XEN_BUILD_HOST	?= $(shell hostname)
+ifeq ($(origin XEN_DOMAIN), undefined)
+export XEN_DOMAIN	:= $(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))
+endif
+ifeq ($(origin XEN_BUILD_DATE), undefined)
+export XEN_BUILD_DATE	:= $(shell LC_ALL=C date)
+endif
+ifeq ($(origin XEN_BUILD_TIME), undefined)
+export XEN_BUILD_TIME	:= $(shell LC_ALL=C date +%T)
+endif
+ifeq ($(origin XEN_BUILD_HOST), undefined)
+export XEN_BUILD_HOST	:= $(shell hostname)
+endif
 
 # Best effort attempt to find a python interpreter, defaulting to Python 3 if
 # available.  Fall back to just `python` if `which` is nowhere to be found.
-- 
Anthony PERARD



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 14:55:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 14:55:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571159.894352 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2OO-0003yc-8J; Thu, 27 Jul 2023 14:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571159.894352; Thu, 27 Jul 2023 14:55:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2OO-0003yV-3u; Thu, 27 Jul 2023 14:55:04 +0000
Received: by outflank-mailman (input) for mailman id 571159;
 Thu, 27 Jul 2023 14:55:02 +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
 <SRS0=o85N=DN=citrix.com=prvs=5659ebe79=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qP2OM-0003ww-LK
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 14:55:02 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8e600259-2c8d-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 16:55:00 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8e600259-2c8d-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690469700;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=u9VUyPNCX/m9UxlOUYomFLQl8PbYRLIgdSRaAegbCOg=;
  b=PeD/0QXGY+YPnkjbCckE1lw1hasHd65KcNu5uqQ0nTvgGbJhCSTNbAUu
   6SqtuTLhkwhf8O1mEnmiRX9DBIHBoVOJErat+7gLaI2M4MY20KF32wmYu
   6PPHLTWCgpY8WjFXeNGCFlypSwVkQb+L4wCKRfReIPKRCS5CU6xHHOGlq
   Y=;
Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 117536776
X-Ironport-Server: esa2.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:FVLePqmvXHapho1kMBNQOvzo5gxFJkRdPkR7XQ2eYbSJt1+Wr1Gzt
 xJKWDvSP/aDamKgLtAgad/j9k9SvJTdztRkSwNsrnhhFiMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5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SL3sqy
 nKpp906faaslYssQ4b6Ky90cW7IE80lqQFkrX5Q43SPjUO0VHAROtfBODZsl7d8kPFh4tgPa
 wJSdkANDWZZ2IXsS6QijPWLz7uquPrzImYwd77i1NRZUVSbadkhj0JeDpy0CdNNXd77V5SLu
 vt2iKDzQDQCEj/Ff7LYkUtbqz4vtjWk5CjSQcebiRXkTWmvHeT8bvnFBrd9QsfVj4n+8ZezU
 H11zbh47mlsbWdwhvRvlWjiKh+qZ/a095eA87JrNYTJi6EsHfPWK1RH4eauSwzoqWUyHtCqq
 i1nz4Qe/5r7m/XfCWOrQDz1xLG2DIjgkWSsmOwsD/YuMnkQzB/NMZbn4JedXLimjAdgO0=
X-Talos-CUID: 9a23:YQulCGGUfY41HZugqmJb+3cbRuEmc0SM5ynPJUGHDmhGaaCaHAo=
X-Talos-MUID: 9a23:ckGnNwqx0NXaDvIFtdoezzxtOf9Q+pWBMRBOoZo6ifDDMRF0Ih7I2Q==
X-IronPort-AV: E=Sophos;i="6.01,235,1684814400"; 
   d="scan'208";a="117536776"
From: Anthony PERARD <anthony.perard@citrix.com>
To: <xen-devel@lists.xenproject.org>
CC: Anthony PERARD <anthony.perard@citrix.com>, Jason Andryuk
	<jandryuk@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>, "George
 Dunlap" <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, "Julien
 Grall" <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Wei Liu
	<wl@xen.org>
Subject: [XEN PATCH v3 2/2] Config.mk: evaluate XEN_COMPILE_ARCH and XEN_OS immediately
Date: Thu, 27 Jul 2023 15:54:47 +0100
Message-ID: <20230727145447.2701-3-anthony.perard@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20230727145447.2701-1-anthony.perard@citrix.com>
References: <20230727145447.2701-1-anthony.perard@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain

With GNU make 4.4, the number of execution of the command present in
these $(shell ) increased greatly. This is probably because as of make
4.4, exported variable are also added to the environment of $(shell )
construct.

So to avoid having these command been run more than necessary, we
will replace ?= by an equivalent but with immediate expansion.

Reported-by: Jason Andryuk <jandryuk@gmail.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---

Notes:
    v3:
    - replace evaluation on first use construct by immediate expansion which
      isn't likely to break and is clearer.

 Config.mk | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index c529b1ba19..dc3afaa47e 100644
--- a/Config.mk
+++ b/Config.mk
@@ -19,13 +19,17 @@ or       = $(if $(strip $(1)),$(1),$(if $(strip $(2)),$(2),$(if $(strip $(3)),$(
 
 -include $(XEN_ROOT)/.config
 
-XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
+ifeq ($(origin XEN_COMPILE_ARCH), undefined)
+XEN_COMPILE_ARCH    := $(shell uname -m | sed -e s/i.86/x86_32/ \
                          -e s/i86pc/x86_32/ -e s/amd64/x86_64/ \
                          -e s/armv7.*/arm32/ -e s/armv8.*/arm64/ \
                          -e s/aarch64/arm64/)
+endif
 
 XEN_TARGET_ARCH     ?= $(XEN_COMPILE_ARCH)
-XEN_OS              ?= $(shell uname -s)
+ifeq ($(origin XEN_OS), undefined)
+XEN_OS              := $(shell uname -s)
+endif
 
 CONFIG_$(XEN_OS) := y
 
-- 
Anthony PERARD



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:00:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:00:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571164.894361 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2Ti-00061q-QE; Thu, 27 Jul 2023 15:00:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571164.894361; Thu, 27 Jul 2023 15:00:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2Ti-00061j-Na; Thu, 27 Jul 2023 15:00:34 +0000
Received: by outflank-mailman (input) for mailman id 571164;
 Thu, 27 Jul 2023 15:00:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=RhFg=DN=citrix.com=prvs=5656f8b89=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qP2Tg-00061d-VE
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:00:32 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5335e8e1-2c8e-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 17:00:30 +0200 (CEST)
Received: from mail-mw2nam12lp2047.outbound.protection.outlook.com (HELO
 NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.47])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 27 Jul 2023 11:00:21 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by MN2PR03MB4973.namprd03.prod.outlook.com (2603:10b6:208:1b2::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Thu, 27 Jul
 2023 15:00:16 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::edfe:6f64:4048:74c5]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::edfe:6f64:4048:74c5%4]) with mapi id 15.20.6609.032; Thu, 27 Jul 2023
 15:00:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5335e8e1-2c8e-11ee-b248-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690470031;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=cX/TwmOH3U2EY3VWjFijlxuXPAN8eGdmB4MT2ynspNg=;
  b=iKFhd/R5WSoysBi8TlS72zWGPKDq+1l0U/+yUeOSoDHaBsgOC43pKPAV
   CIYf2QzIkyq7HPTvxacO7iMybdbrCWVtbvVbob67UBDuG61c1tmxs7vrZ
   xmuGAgLGcgtW4pVhb4LRKP1AhRPbKdFBICIHNxHU+j+GX5U97327BT5uQ
   k=;
X-IronPort-RemoteIP: 104.47.66.47
X-IronPort-MID: 116949815
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:ZwDZi65zJGH2vh1gz5ydTAxRtIPGchMFZxGqfqrLsTDasY5as4F+v
 mpNCm+HaP/bMGqmKIhwYY3kp0kEv8SGmIIyTAZlriEyHi5G8cbLO4+Ufxz6V8+wwm8vb2o8t
 plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraCYnsrLeNdYH9JoQp5nOIkiZJfj9G8Agec0
 fv/uMSaM1K+s9JOGj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QPVoWc+WmDT0/U+DYodqjruOdXTc2QzAm9SiThneS5LT7ChiV2Qp2aUI1/Z4StU
 bEji3k7eGZv/u60x/R0HKWx5lag9f60LJ4db+xo/lQBDXwqxqiIL5sXLCPp1kO0ZmSwVsnis
 TNpB88P8J18RrqDxGInSc=
X-Talos-CUID: 9a23:A2pmoW8CkveaMk7e6pSVvwlOGMAhQm3R9l7zBmqWN29EEf6WSFDFrQ==
X-Talos-MUID: 9a23:L+1/1gRy1zLqIGc/RXTutCM8CfhG4p2tCXwSkLcp5eaACyxZbmI=
X-IronPort-AV: E=Sophos;i="6.01,235,1684814400"; 
   d="scan'208";a="116949815"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JCeUF54if/TqhqKzWTpS/iGrV76Z7xCE7eru0KIe3ZttdYVO4cQuYIVdT0PLobwwNcA1X1RHOSJXUjpiIHHZhV68pXCkDvJ/aSfJsCUHE+Mhe10kD4JBPLFDyf7JXjnR13E5a1ni/ozv6b7gx8HINXesl5fn5ORArHsKCgB/DGXuYVt+iuS4nQ6+TpE5T6CVUVwc2fNa618fSDKdS715jwvlRKHbUht2IXCTzR2QcvBZEpVQWaV2PU0vrZjWfb1WxLRsHolR5ik2pEoIpUxq70uWRL98kfSCRymuyr1XIGBPU5K00fP79FZLCnhJUfFS5NA4+yHOWyWt5Wfh7e2BPA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=aQcYL0+3nv9q3I6i1DSxYcispTEsFXUpuUha5WTQ3Nc=;
 b=VIujeSr4xSkrDTLUzj/UcCHEMrgXLb2xJVAyn+1QPjb991TyTpVo/xOEGNtmbTX1PViuEHJSxWu61+5WkzRPMp+FSVYs+SmRogHgBQ9CbLwqoygMzUF+vn/krmqPi7ja6sPJ/S0inKIk2VgpydXh42ZO7I+okRe7uJvV8iaOLcysaI2LNl1VpmiSA7uGZ3/STGF1QvTXSKsp+nYqR9XUObUc0pxaPXpdPa/lKgLTq3eKdn7h6iStOkQGBz/K6ozVnokln9mXISuX8AO0lt5q/iHDwf/6YC/tiXHIyXoUHvO5Avg5BbyR9bdEM6RLJm18aRA8SoOOnfsvepJ4zyHdtw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=aQcYL0+3nv9q3I6i1DSxYcispTEsFXUpuUha5WTQ3Nc=;
 b=UpWee6kjqCnoHp5JrQBX2gXofEanB9K7D/6C+dLWOVl17obbpUmzGD9MdH6FEWGr/f6xgJ8FZuVxhbFBR3+qQuUv9u03AZsuWYgaomJqPUUSignDI7ZfhRFS/smHFOXEvoGGVYO+/7Nl7dQ+uhuFssDxuUk/c+gR4eueQXEAj2U=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <40b2fb63-463c-2f9c-dc46-572cb0925807@citrix.com>
Date: Thu, 27 Jul 2023 16:00:09 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [XEN PATCH 1/4] x86: mechanically rename to address MISRA C:2012
 Rule 5.3
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>,
 Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1690449587.git.nicola.vetrini@bugseng.com>
 <614dd6fe03ab82db83eabc430b27435b19096791.1690449587.git.nicola.vetrini@bugseng.com>
 <604b915b-e07e-8985-87f1-300568d0259f@suse.com>
In-Reply-To: <604b915b-e07e-8985-87f1-300568d0259f@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LNXP265CA0034.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:5c::22) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|MN2PR03MB4973:EE_
X-MS-Office365-Filtering-Correlation-Id: 30cc83c1-fbf8-41c0-6ad0-08db8eb22fa0
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	yvG5tgvsOyiZPWP0Jy1c7MXt5EdU9rlCD5jpIxPOfPBGiiu0YEWt18suZHywJlrZ3XKIjWdVhFDiMKf2oUYVe8ZUcqS2VwdC3vl7XJDQDgvfchbhGuB/X0TMte18Wv3snqbl8E0R8Ig85wdTsnLxfTqrlxGr1DVhDa/rlH70fqoTOiPRcbq/xYP6W3QXJNUO6DkhsIPjfM0tg8FEgXz4+nHfcoLZDboxgo9TqyxuraiqLoNIVQRanaf5js3TWFUGyWF8HmvGSAni76/8z7jtamAwZRq7UATLKfRqpgsxgobuU/WhzzR3b9EqoqVvL2aboCWqsc74a5v3cOJQ6FNGdGlLfZqkWbv2sWgucrzsAWGTrF8TChfR1jz+kRAHRmO81pN7hnG/tTP4B79QZHqhjh/lFCrtuKMlZSJNFp1rlD0yv0mG4huYZEf20kdLWhpkZzeg1mdYqPPD/FOHSrhkGnSMFQOQiuzG274mAKLqL68YIIKxSnCiOdHcsQhokXbzjRnjjOtllywu3V0HnBxM46kPAK4HEqlJVNIzxKbDNcqIGbQevI2zj3kl1NJ0FuPrC6MwzkoiAy+GmPkg7M1iV5DGwuOcXhZm4eC3diLQpVjf7c0OBf522yHr9MK5BsfF8p+bst13Oee8M2vZl8CHKA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(366004)(376002)(346002)(136003)(396003)(451199021)(316002)(41300700001)(2906002)(5660300002)(8676002)(7416002)(8936002)(36756003)(31696002)(86362001)(6506007)(26005)(53546011)(6512007)(82960400001)(478600001)(6666004)(6486002)(38100700002)(186003)(2616005)(31686004)(66476007)(66946007)(110136005)(4326008)(66556008)(54906003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?b2FWYkJzbzRMZm1ScFV0dFBIclljbndFdEZQVE5XTVJRVXJ4ak1mOVk5TzVX?=
 =?utf-8?B?bDZSTkFYZVdEZk5Ud1pXeC8rZXNCc2ZDWTZmL09zMFFHUnNoQzN4bkl6WURS?=
 =?utf-8?B?SHFFcTZRYzdVWkVmZXkvaGdEemtPN01WdDdTVncyVGFuUW1VRWt5RmxVOUpU?=
 =?utf-8?B?ei9oWHJOMzdQbHBLZmpTVEdqT0MyN1VCSUE0cDVyem9oZ0h1VjdOczZaVzB5?=
 =?utf-8?B?cTRlcnNZZHErYXJOMm5KZENRNElzSElNYnZUU1dKa0RNRzRpeWJoeWJrYW1P?=
 =?utf-8?B?eUl5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vVX8stgjOLgTcvV31E7ev+rluCfH3547Gujv56cozig8rzQXoPcOZ8Ao6UZkmvev+QzBVwWyU/eZQ==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 30cc83c1-fbf8-41c0-6ad0-08db8eb22fa0
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 15:00:15.9819
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: yJotY/apVJ4jCOLcxr5zRx6JTqNz3llY/gw6ZYgGZrWDyFA9ApVBzkYMO5AEOlC2tg4/ZpxVDf8HaGw+V23cNS1Xzu6/rdxD3ZqBwBUkhUo=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR03MB4973

On 27/07/2023 3:50 pm, Jan Beulich wrote:
> On 27.07.2023 12:47, Nicola Vetrini wrote:
>> Rule 5.3 has the following headline:
>> "An identifier declared in an inner scope shall not hide an
>> identifier declared in an outer scope"
>>
>> The renames done by this patch avoid shadowing from happening.
>> They are as follows:
>> - s/str/s/ in 'lapic_disable'
>> - s/str/level/ in '(apic|mce)_set_verbosity'
>> - s/str/state_str/ in 'mwait_idle_probe'
>> - s/str/memmap_name/ in 'init_e820'
> I'm sorry to say that, but I'm not willing to go and figure out where
> that "str" is that there's supposedly a collision with. Please can you
> state such right here, ...
>
>> - s/i/j/ in 'mce_action' (the shadowing here is due to macro
>>   'x86_mcinfo_lookup' that defines 'i' as a loop counter)
> ... much like you do in this case?

In fairness to Nicola, that was given.

> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
> Function 'str' in 'xen/arch/x86/include/asm/desc.h'
> causes the shadowing.

which is the wrapper for the STR instruction.

It's used in a single assertion, and I'd be happy getting rid of it
entirely.Â  Alternatively, it could be renamed to read_tr() (or
read_tr_sel() ?) if we want to keep the assertion.

We're not renaming every other use of 'str' to mean string just for this...

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:05:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:05:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571168.894372 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2Y3-0006gu-Ey; Thu, 27 Jul 2023 15:05:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571168.894372; Thu, 27 Jul 2023 15:05:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2Y3-0006gn-CQ; Thu, 27 Jul 2023 15:05:03 +0000
Received: by outflank-mailman (input) for mailman id 571168;
 Thu, 27 Jul 2023 15:05:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dT6+=DN=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qP2Y2-0006gh-4m
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:05:02 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f52a73a6-2c8e-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 17:05:00 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.161.207.213])
 by support.bugseng.com (Postfix) with ESMTPSA id 528884EE073F;
 Thu, 27 Jul 2023 17:04:59 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f52a73a6-2c8e-11ee-b248-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH] xen: change names and type qualifiers in copy_domain_page() declaration
Date: Thu, 27 Jul 2023 17:04:51 +0200
Message-Id: <49ce75f6f79f6de3a447f9bfb44e288e689dd8f3.1690470179.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Change names and type qualifiers of parameters in copy_domain_page()
declaration to keep consistency with the corresponding definition.
This addresses violations of MISRA C:2012 Rule 8.3: "All declarations
of an object or function shall use the same names and type qualifiers".

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/include/xen/domain_page.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/domain_page.h b/xen/include/xen/domain_page.h
index 149b217b96..c4007eac09 100644
--- a/xen/include/xen/domain_page.h
+++ b/xen/include/xen/domain_page.h
@@ -15,7 +15,7 @@
  * Clear a given page frame, or copy between two of them.
  */
 void clear_domain_page(mfn_t mfn);
-void copy_domain_page(mfn_t dst, const mfn_t src);
+void copy_domain_page(mfn_t dest, mfn_t source);
 
 #ifdef CONFIG_ARCH_MAP_DOMAIN_PAGE
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:05:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:05:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571171.894381 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2Ym-0007BK-ND; Thu, 27 Jul 2023 15:05:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571171.894381; Thu, 27 Jul 2023 15:05:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2Ym-0007BD-KK; Thu, 27 Jul 2023 15:05:48 +0000
Received: by outflank-mailman (input) for mailman id 571171;
 Thu, 27 Jul 2023 15:05:47 +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
 <SRS0=3xgU=DN=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qP2Yl-00077y-En
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:05:47 +0000
Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com
 [2a00:1450:4864:20::52a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0ffe260b-2c8f-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 17:05:45 +0200 (CEST)
Received: by mail-ed1-x52a.google.com with SMTP id
 4fb4d7f45d1cf-5222a38c0a0so1424671a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 08:05:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0ffe260b-2c8f-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690470345; x=1691075145;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=rPQKyiqbZMpiF3LYxGfLwkrBq8XZzon+LVcdzcrHHQ8=;
        b=MwICS+y2/dSiRjJieGbFY7SZQSZ29DSSMeX10It4QsdLHyYV532DH45aHAMK7Rsxw7
         852H+nQnzsgQu7teJ4VZ1L4UZNy3YO+pqveCax4US6fdwwOc0HRLD63TfaB5x96YKjKa
         oD/Nwq1mz8uuoC9ti/3683HjdYLbGuRUpbop85V3uAVRG0i5l8ok1FFIsr5KFiCsAjK4
         ZteV3zUPI6uk7XqobbNJ42YQ6riNryhbHZM4I0PqQ2aRKWtdk3Jhmtx+mxMMDbFOtf+6
         vEkiKLH8b8cQy9WPiLQrSV/KRnefGWFCttJmysAKZ1n4XLR6F0SueZpE0OruxV26IdxM
         uUEQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690470345; x=1691075145;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=rPQKyiqbZMpiF3LYxGfLwkrBq8XZzon+LVcdzcrHHQ8=;
        b=IpLwUZ+X13Y7dmYaoHJ25Rbkl/U2a5g7eMuWbyFqyT1UtHQiqMLkcPks0dK9+VIiGg
         vew8aN5mDYvV9Y19dOOJE79lalWChoLT5r0EGKEBOHNZb8xb3vqt0J4D9mEH/e+L0AkX
         4JTNLOxJYIaM6I9PASJG8Lb7+Oq4ViEyE3G4wG5+sXKlqHv0hwS8W191QIIHO21WjxbP
         LELXNgovYbNRreJ+ZycxGfVfTqjfeDWZoSNRub5pTaWFGLvI8LJr6NJVT0ON5YrYw6mu
         r7gWrcVAxbOQUqdFIMQaFi1j2FUWDFMUHI2aw7bzkspEGBXaSP5Wg3FhYPnh7kfLcM6u
         jbDg==
X-Gm-Message-State: ABy/qLavHU01CyPoxvxQ64B2cz7WzvJpn0P+mXzFo59g618r5ANWZhHJ
	/mL5J0mCNNFmmnp5ufaaauY/uYu43wx8DEzyE0LZ0DdnzJM=
X-Google-Smtp-Source: APBJJlHiihw7fjuihL1aqqtEH3W4W/tZ8DvmnEYlp2PXPnTrQ51GD0IWALfdHkf27a6cnrVE3fn7X3PiuMYxGzmU+2s=
X-Received: by 2002:aa7:db4b:0:b0:522:4f0a:6822 with SMTP id
 n11-20020aa7db4b000000b005224f0a6822mr1951360edt.22.1690470345069; Thu, 27
 Jul 2023 08:05:45 -0700 (PDT)
MIME-Version: 1.0
References: <20230726170945.34961-1-jandryuk@gmail.com> <20230726170945.34961-5-jandryuk@gmail.com>
 <5a6365b0-7809-4287-96fa-be7809d664c8@perard>
In-Reply-To: <5a6365b0-7809-4287-96fa-be7809d664c8@perard>
From: Jason Andryuk <jandryuk@gmail.com>
Date: Thu, 27 Jul 2023 11:05:33 -0400
Message-ID: <CAKf6xpvzKiCkNkWYQyngENmF4+VmT3EgTWubDrQ0OZXgK9-jJg@mail.gmail.com>
Subject: Re: [PATCH v7 04/15] xen/sysctl: Nest cpufreq scaling options
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>, 
	Juergen Gross <jgross@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
	Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 27, 2023 at 6:27=E2=80=AFAM Anthony PERARD
<anthony.perard@citrix.com> wrote:
>
> On Wed, Jul 26, 2023 at 01:09:34PM -0400, Jason Andryuk wrote:
> > Add a union and struct so that most of the scaling variables of struct
> > xen_get_cpufreq_para are within in a binary-compatible layout.  This
> > allows cppc_para to live in the larger union and use uint32_ts - struct
> > xen_cppc_para will be 10 uint32_t's.
> >
> > The new scaling struct is 3 * uint32_t + 16 bytes CPUFREQ_NAME_LEN + 4 =
*
> > uint32_t for xen_ondemand =3D 11 uint32_t.  That means the old size is
> > retained, int32_t turbo_enabled doesn't move and it's binary compatible=
.
> >
> > The out-of-context memcpy() in xc_get_cpufreq_para() now handles the
> > copying of the fields removed there.
> >
> > Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> > Reviewed-by: Jan Beulich <jbeulich@suse.com>
> > ---
> > NOTE: Jan would like a toolside review / ack because:
> >     Nevertheless I continue to be uncertain about all of this: Parts of
> >     the struct can apparently go out of sync with the sysctl struct, bu=
t
> >     other parts have to remain in sync without there being an
> >     appropriate build-time check (checking merely sizes clearly isn't
> >     enough). Therefore I'd really like to have a toolstack side review =
/
> >     ack here as well.
>
> I wish we could just use "struct xen_get_cpufreq_para" instead of
> having to make a copy to replace the XEN_GUEST_HANDLE_*() macro.
>
> Next I guess we could try to have something like the compat layer in xen
> is doing, with plenty of CHECK_FIELD_ and other CHECK_* macro, but that
> would be a lot of work. (xen/include/xen/compat.h and how it's used in
> xen/include/compat/xlat.h)

I can add a set of BUILD_BUG_ON()s checking the offsets of the two
structs' members.  I think that would work and we don't need the
complication of the compat code.  The build of the library just deals
with a single bit-width and needs to be consistent.  The hypervisor
needs to deal with receiving differing pointer sizes and layouts, but
the userspace library just uses whatever it was compiled for.  The
preprocessor expands XEN_GUEST_HANDLE_64(uint32) -> "typedef struct {
uint32_t *p; } __guest_handle_uint32", so it's just going to be a
single pointer in size, which will match between the two.

Does that sound right, or am I missing something?

> Unless you feel like adding more build check, I guess the patch is good
> enough like that:
> Acked-by: Anthony PERARD <anthony.perard@citrix.com>

If I am incorrect about the above... I'll just leave it as-is.

Thanks,
Jason


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:06:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:06:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571173.894391 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2ZR-0007j8-Ve; Thu, 27 Jul 2023 15:06:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571173.894391; Thu, 27 Jul 2023 15:06:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2ZR-0007j1-Si; Thu, 27 Jul 2023 15:06:29 +0000
Received: by outflank-mailman (input) for mailman id 571173;
 Thu, 27 Jul 2023 15:06:28 +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 <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qP2ZQ-0007in-FW
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:06:28 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on060c.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::60c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2815d524-2c8f-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 17:06:26 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU2PR04MB8805.eurprd04.prod.outlook.com (2603:10a6:10:2e0::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 15:06:23 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 15:06:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2815d524-2c8f-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BATfU5EK254/ErXNuuUS8tDCxuhNP2IOfLA/y//g+FT7Lf1kDOBFUfLiLNYl268niSF/UiduA2dfbHK6GI4MIJarWPt/Zkv403IoNw4jndjSROWLZqp+QlL3a98WV71bW4rBLJMo+2qeoEEGGTFr5N/R8sfViyPGKaPAl3xBbsPVWYN0zsgmRxVJOmTfiw17NBX+ylXmBIilVH0f5YId7o/Vb38FcpL5WqFGAsliSVlrTjkJzD0H61NUKeNsNvZqju8Q0svIlqdNMDguSSTZ3y17dWJmFEqdIMDoPxPsN+TMmawobJqXbGsFdTpWYHw719T+4JW6/FgWkjHCTWWo1Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=S190/nkthK0y/DeQv0OlSOhUH6hhPHvCDOj/hWEuRfQ=;
 b=LNJRKS/98y2jpT6GJZvoZ7jvVapu8f4WD+EggN5ZI7XcM9HJOmaDK5at7Df4DWUkWcKfbkU/VIXtEVQP3asm25tticlV3EXk+EWhCKkEYHGwO1nEvhI4JirX6+WZaFXN+KNgXesH4ZQJIMacVH+WXOWqdpyRvMkh/4GPLASlJFbek+KSvrS5wuikooOeoveoOa/UJUu9/OJN1jJ1bVyWlo85Re/pQgTF/7ipOk2RMPXrRxLzytDvcTHJmzHjcTGLh2k+BTM3yvMmQMA8QieepUmU1TiWnhx3e+3H2oYC0zDrh1++/GEbs+tsNSsOSj9BZoqgxXz0ySmfiINfW/4kPw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=S190/nkthK0y/DeQv0OlSOhUH6hhPHvCDOj/hWEuRfQ=;
 b=VnJS6yKcyYkLuJwkdst21LnhZIPlv7vzw2PIJCkXV37eLzGkrb+GlaOLXHpj/ReStu4+C7DTPgTyl0dd6YnVDzmuEKNE8mS4uTbTjFoB1gHXuQH056Zwc5OumvPxUo56mMtNITA4ZAy4WkCRfmpbu1Cv2Jnrp2uBNRPasv8sQA/GuwQUSxVGoDkmYKeo66uwqdg3llUGzHIk9tyq1hlUTnkVNVt62QCz8SY0g2VVNSJyWjtR+7VIwN6HTy4gbMSG0OHVr2PhqM2x3mKlB7CGt2T/6KRZPQwm4zpGzkyfHLHke+Q8A70LJjxDgDRtWXzeHNRBjpKrxpsXd9FyCJF54Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <9db05529-b4ed-89c0-a140-118c0ccf44bb@suse.com>
Date: Thu, 27 Jul 2023 17:06:20 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH 2/4] x86/emulate: move a variable declaration to
 address MISRA C:2012 Rule 5.3
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Paul Durrant <paul@xen.org>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1690449587.git.nicola.vetrini@bugseng.com>
 <bc3a28abf9f00bf67cf5ee64bd89e7d38e321c06.1690449587.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <bc3a28abf9f00bf67cf5ee64bd89e7d38e321c06.1690449587.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0143.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:98::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU2PR04MB8805:EE_
X-MS-Office365-Filtering-Correlation-Id: 3d1cf55c-db6c-41f3-f345-08db8eb30ae0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Jwblc8zSlSxWcI6WcdnBbuksxmfgB1WXd8UC6VH+Vq1meexTpC6uNx40tszRosSrYvXR1oZIs3symbPEAhtFPjgjqVlQys7fpKcpj6N1sIwpTrgeQ9kSMy9SmPAlI2Q/nXIFHvJvxYXqqi4MwxuSxIJt44/xE1DcCTDmMFzvZ9V9J8diMZMaFrv9MCXCNAGd+/CJ/BP8UVltSg4DAr/2tyEuZGs1k5n/gXtxhD145LsF6DLKi+mz8QdEbIO128TWjjbu5hfiDgW9Tj8Zdx2s2/cH6U6vwskdb2+ACqqRnUztzy9EnRo8zLwrqa+dBpnuYj/ivw+5cn1kguHdQlok2K2LH5CmE8V7YZYR7lbrj3tCI8F4P/5jwN27aCESyEhFOyQPzGxcHrUWmPuaKrgO4EwAUNfqXYJlv+u/2Wgicz34wcPBxOBofot/8EJNfHTmi0SA6gFp4iIJr8mpcnfZaEvqA5QyFLDGoc/EfBFL1FKeGSGxGWYaGrN2ZWAP4jHR/IWOewEciSFZsUz33HSzZJW5uOLMkzHlSaim6Nr03z1sKuNCwM0Hg/A++r9ymcgrVUG+9r1BJi+wgKtlA/PZgPPQTZrg0NAWs72d16TTFyWByxaKHrPhrlo8GhUOg+cd08YVXJ7Qw5l7XfxTMhtJmg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(136003)(376002)(366004)(39860400002)(346002)(451199021)(5660300002)(7416002)(6916009)(4326008)(66476007)(66946007)(66556008)(4744005)(316002)(2906002)(478600001)(54906003)(66899021)(8676002)(31686004)(8936002)(41300700001)(6486002)(86362001)(6512007)(31696002)(53546011)(6506007)(26005)(186003)(36756003)(38100700002)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TXBtd21vanRSRTNvREV3S3VEMTh3V29oSDFaS1FPUUFKbGlQcEtTK0lXeVI5?=
 =?utf-8?B?M1g1V1hnSjZoNGQxZCs5c1BINWo4VzNsdTdZeU9MbGFTbDV3MFRGd2kwbWRF?=
 =?utf-8?B?T2YrbG4ySkQ5UjhDeHhkazRoOVE3YW96cWhhRW4rNTdIYXRteHF1TGVnem9r?=
 =?utf-8?B?ckc5Vm9IaEppQXoyV2tRaWEzMkJONSsrSXRXekczS2Rkb1pLRENiVk5Rb1BK?=
 =?utf-8?B?dXZDTzZ6Z3RIazJyQ3c0RHBmcjk5cGlaZ2QvVTc4ZmZpeHc2cEhqZGJDakx3?=
 =?utf-8?B?ejQ1SHJjdFU2bzZmbWRhcndWMlVJalFzTk05NkdIUmczcVBGRERVbXhtdE5J?=
 =?utf-8?B?NHhmYUF0K2tJbEFPRUVQRnJ4MGM4bTdZampxY3JzMkJXWHFwdHQ5MnlTSWY0?=
 =?utf-8?B?V3JiSVhaVGtIWlYrcUV6dTBVUndRYWxhYXV4ZTA2aFB5Rk52dUdXV2pnTE5J?=
 =?utf-8?B?R0JrZ2ZkTEhhVEpDTzA0S3h5elQ0NjFEb01PVXpXRGgzVVh0UGJwd2I5V3Er?=
 =?utf-8?B?dkJHVlhFTU13QW94SDlZUTBmRjQxeW56YmtLb0JXZEdoNXB6ZzBITVNJWFZl?=
 =?utf-8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dkd4VTNMNUIwUitLTnZRWCt2cUhudnhaSG8r?=
 =?utf-8?B?Uk9kU3JEMVQ0R09MN29xQTRZVklPVVcwUjRib2tZSTBhSVRMMDB3TzNEdmpN?=
 =?utf-8?B?bTRjNmZSYXNLd3YrRmFYQXR6d1hwQml1NUgzdVB0VDB0djNhT1hwdTdoWVh0?=
 =?utf-8?B?K0dGVnNLZ044cCtVWHZVVEVJK2YvVSs3cFBIS0d1SkhCa0JKVy9KWlh1Z2p6?=
 =?utf-8?B?OHFxMUJhWU1mTGF2T2gxbGNBRStoYlRhcFU1UjNPdFQyWnpob0FjQWNHeFhu?=
 =?utf-8?B?ekxkbUJCMnlRYTRkcTNjYmtYMTg5aExTczUwbmo5bjZVdEgwQTZVeFAxK2Js?=
 =?utf-8?B?aThISGhmeDN1WmF1NHMxMGQwdWRCTE9TSHJJd0VQMVVQL21UNTJTSWJBVW5s?=
 =?utf-8?B?aGh2aHV3L3llWFVmRk80NDd0S0xGS0RrbEg1QWdoSkFlb3VtOElaVW0xUDNS?=
 =?utf-8?B?K0tGUWtPdVRmeFFEK3hYMnNJV3JWNVAyM3FjUTQ2emtnNzlWL05YWXVXSVNY?=
 =?utf-8?B?SXJ4a0E5eWRqd2VYOWhXM1VzdEk5elpiK0dQOTJqb1RENWt1WVNlNStZOVhG?=
 =?utf-8?B?cEZycTNVbHdRYnVhVW9PN3dpamRLTU0ray9xUFllTWdPbHg5RVlFZ0pQZ3NZ?=
 =?utf-8?Q?/8ENHfkfOqlornBIEW9EheBT8?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3d1cf55c-db6c-41f3-f345-08db8eb30ae0
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 15:06:23.7231
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: RcA5qNye7s59Me8rU3s+AxLh1pJTb+7PvtHVsg1cogi4kFXyvTGwKByLuw0cDqLFyvBUo+ayw3Dp4Q4T2UNGvA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8805

On 27.07.2023 12:48, Nicola Vetrini wrote:
> --- a/xen/arch/x86/hvm/emulate.c
> +++ b/xen/arch/x86/hvm/emulate.c
> @@ -2024,15 +2024,15 @@ static int cf_check hvmemul_rep_stos(
>  
>      switch ( p2mt )
>      {
> -        unsigned long bytes;
>          char *buf;
>  
>      default:
>          /* Allocate temporary buffer. */
>          for ( ; ; )
>          {
> -            bytes = *reps * bytes_per_rep;
> -            buf = xmalloc_bytes(bytes);
> +            unsigned long bytes_tmp;
> +            bytes_tmp = *reps * bytes_per_rep;
> +            buf = xmalloc_bytes(bytes_tmp);
>              if ( buf || *reps <= 1 )
>                  break;
>              *reps >>= 1;

This wants dealing with differently - the outer scope variable is unused
(only written to) afaics. Eliminating it will, aiui, address another
violation at the same time. And then the same in hvmemul_rep_movs(), just
that there the variable itself needs to survive. I guess I'll make a
patch ...

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:11:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:11:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571176.894402 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2dm-0000qQ-Gy; Thu, 27 Jul 2023 15:10:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571176.894402; Thu, 27 Jul 2023 15:10:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2dm-0000qJ-D2; Thu, 27 Jul 2023 15:10:58 +0000
Received: by outflank-mailman (input) for mailman id 571176;
 Thu, 27 Jul 2023 15:10:56 +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
 <SRS0=o85N=DN=citrix.com=prvs=5659ebe79=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qP2dk-0000qD-LR
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:10:56 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c713cf79-2c8f-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 17:10:54 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c713cf79-2c8f-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690470654;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:content-transfer-encoding:in-reply-to;
  bh=2TO7d1dwf1pepJRrNNx2i6Rq9ZFvpuh9m9Y463ovFus=;
  b=T73VcmIPSi9KWdHpel20sxSHy8SQ8uzj5GupgS4kQdOrY5tYWmKC9uwh
   dGVE718y4Ka9eQJdIr0CCbiSbkTrTjEGofXBO0TYcVbi7n5FEGejgN00c
   SLYx1cxaCVLxPGbCPNDpXNeg+jb6DwWBQZ7QnWWGpJijquwR6IX1xmCvd
   0=;
Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 116952080
X-Ironport-Server: esa6.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:4MhwbK7Dn2QKF/vLewtFQAxRtBfHchMFZxGqfqrLsTDasY5as4F+v
 jAbWzzTafaPM2X2etF0b4ixoExX78XUzYRkHldprC1kHi5G8cbLO4+Ufxz6V8+wwm8vb2o8t
 plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraCYnsrLeNdYH9JoQp5nOIkiZJfj9G8Agec0
 fv/uMSaM1K+s9JOGjt8B5mr9lU35ZwehBtC5gZlPa8R4weE/5UoJMl3yZ+ZfiOQrrZ8RoZWd
 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4
 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5m7
 Ow9OS9Kbxa6l8Hr24+XVsZihZQNI5y+VG8fkikIITDxCP8nRdbIQrnQ5M8e1zA17ixMNa+AP
 YxDM2MpNUmeJUQVYT/7C7pn9AusrnD5bz1frkPTvact6nLf5AdwzKLsIJzefdniqcB9xx/G9
 z+cpzShav0cHP+P0QHazHyqvO/GvBiieLsVK7azycc/1TV/wURMUUZLBDNXu8KRiEe4V8hON
 k889S8nrKx0/0uuJvHtUhv9rHOasxo0X9tLD/Z8+AyL0rDT4QuSGi4DVDEpQMMinN87Q3otz
 FDht9HjCCFrsbaVYWmA7brSpjS3UQAcNWIYbDUIZRcE6dLk5oo0i3ryos1LSfDvyIevQHepn
 m7M9XJl71kOsSIV/7yr2EHYxDOqn4jqExUIyhn4UGH1wAwsMeZJeLeUBUjnAedoddjIFgLQ5
 yhcx6By/8hVU8jTyXXlrPElWejwuq3baGC0bUtHRcFJyti7x5K0kWm8ChlaLVwhDMsLcCSBj
 KT76VIIv8870JdHgMZKj2ON5ycCl/KI+SzNDKy8Uza3SsEZmPW71C9vf1WM+GvmjVIhl6oyU
 b/CL5f0VidEU/s2l2LpLwv47VPN7npgrY80bcmlpylLLJLEPCLFIVv7GAXmgh8FAFOs/1yOr
 oc32zqiwBRDSuzuChQ7AqZKRW3m2UMTXMisw+QOL77rH+aTMD15YxMn6e97KtMNcmU8vrugw
 0xRrWcEmQGn2iWbdm1nqBlLMdvSYHq2llpjVQREALpi8yFLjVqHhEvHS6YKQA==
IronPort-HdrOrdr: A9a23:zUytGancZ0vb4RQafMAlj84rfdvpDfIV3DAbv31ZSRFFG/Fw9v
 re5cjzsCWftN9/YgBEpTntAtjjfZqYz+8X3WBzB9aftWvdyQ+VxehZhOOI/9SjIU3DH4VmpM
 BdmsZFebvN5JtB4foSIjPULz/t+ra6GWmT69vj8w==
X-Talos-CUID: 9a23:qV1m6GwLRQjHRT83opiDBgUNCuU0bTrcyk7AABKjNEp1Z7OWGXGfrfY=
X-Talos-MUID: =?us-ascii?q?9a23=3A9bpySg+E5uuMpoq2HNoLatGQf+R4+5/xNk4Lq5U?=
 =?us-ascii?q?PmvLdFRV3BDyWsw3iFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,235,1684814400"; 
   d="scan'208";a="116952080"
Date: Thu, 27 Jul 2023 16:10:47 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Jason Andryuk <jandryuk@gmail.com>
CC: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>, Jan Beulich
	<jbeulich@suse.com>
Subject: Re: [PATCH v7 11/15] xenpm: Print HWP/CPPC parameters
Message-ID: <90b10c84-9ba2-42c0-b34c-ae7d5f8bafbb@perard>
References: <20230726170945.34961-1-jandryuk@gmail.com>
 <20230726170945.34961-12-jandryuk@gmail.com>
 <882c0e9f-8e66-4be3-aecf-477d38da9371@perard>
 <CAKf6xpvrh1Y7j3pb506pNgQMgsKM0OmdbKqQtrLBXUPdMqZS6w@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CAKf6xpvrh1Y7j3pb506pNgQMgsKM0OmdbKqQtrLBXUPdMqZS6w@mail.gmail.com>

On Thu, Jul 27, 2023 at 09:54:17AM -0400, Jason Andryuk wrote:
> On Thu, Jul 27, 2023 at 7:32â€¯AM Anthony PERARD
> <anthony.perard@citrix.com> wrote:
> >
> > On Wed, Jul 26, 2023 at 01:09:41PM -0400, Jason Andryuk wrote:
> > > @@ -772,6 +812,32 @@ static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
> > >                 p_cpufreq->u.s.scaling_min_freq,
> > >                 p_cpufreq->u.s.scaling_cur_freq);
> > >      }
> > > +    else
> > > +    {
> >
> > I feel like this could be confusing. In this function, we have both:
> >     if ( hwp ) { this; } else { that; }
> > and
> >     if ( !hwp ) { that; } else { this; }
> >
> > If we could have the condition in the same order, or use the same
> > condition for both "true" blocks, that would be nice.
> 
> Makes sense.  From your comment on patch 8, I was thinking of
> switching to a bool scaling_governor and using that.  But now I think
> hwp is better since it's the specific governor - not the default one.
> In light of that, I would just re-organize everything to be "if ( hwp
> )".
> 
> With that, patch 8 is more of a transitive step, and I would leave the
> "if ( !hwp )".  Then here in patch 11 the HWP code would be added
> first inside "if ( hwp )".  Does that sound good?

Yes, that sounds fine.

> > > +        const xc_cppc_para_t *cppc = &p_cpufreq->u.cppc_para;
> > > +
> > > +        printf("cppc variables       :\n");
> > > +        printf("  hardware limits    : lowest [%u] lowest nonlinear [%u]\n",
> > > +               cppc->lowest, cppc->lowest_nonlinear);
> >
> > All these %u should be %"PRIu32", right? Even if the rest of the
> > function is bogus... and even if it's probably be a while before %PRIu32
> > is different from %u.
> 
> Yes, you are correct.  In patch 8 "xenpm: Change get-cpufreq-para
> output for hwp", some existing %u-s are moved and a few more added.
> Do you want all of those converted to %PRIu32?

For the newly added %u, yes, that would be nice.

As for the existing one, maybe as a separated patch, if you wish. At the
moment, patch 8 is easy to review with "--ignore-space-change".

Cheers,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:13:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:13:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571178.894412 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2g2-0001PZ-SF; Thu, 27 Jul 2023 15:13:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571178.894412; Thu, 27 Jul 2023 15:13:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2g2-0001PS-PX; Thu, 27 Jul 2023 15:13:18 +0000
Received: by outflank-mailman (input) for mailman id 571178;
 Thu, 27 Jul 2023 15:13:17 +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
 <SRS0=o85N=DN=citrix.com=prvs=5659ebe79=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qP2g1-0001PH-Gn
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:13:17 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1b19a6d9-2c90-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 17:13:15 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1b19a6d9-2c90-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690470795;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=c3cHlorBvItoJwyOnP1VkXqTWaBZGBM+0SxfLv2i4m8=;
  b=Y10r6IGhkSfAD4yVm4Vp30EZZx5vTn3DslP6UjuixQHMm/nvHx24eDwI
   BxvoH/qvMJ70Alsk3P6RjE3b91btsue4SbakdKZIeZ2/6s/OANmkp3dX+
   2+ifY/JWnUXsdyhWOTWk021VfS1Sx4y7D0GcKFF83E1k4IkzhaDnEMmdy
   k=;
Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 116356293
X-Ironport-Server: esa5.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:2WvXxKxJz9bK3nnTuQ96t+cYxirEfRIJ4+MujC+fZmUNrF6WrkUDn
 TZODGrTbPrcajf2c4p3Oo7k9ElTvMfRyoIwG1M4pCAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSI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KoaSvp037BL7TEJdfUxSKalfq
 +V7ZEmPHPP+VQssTQb6LO90cq7IE80l6QFhbX5VI3KNGLbUSmTTL2KhrGSpAEIdReOkNK1Fp
 0NT0G9MrDN5JRB4voSKTPXL+od
X-Talos-CUID: 9a23:3kwe32DnJV1Gkzf6EzJs92ELJucuSF3EwFrxIlWDUEouSrLAHA==
X-Talos-MUID: 9a23:f9yWowiaHrZoADlKjv5pysMpM9tNpK6hKlgxodY+ss2lKSJNfA+wg2Hi
X-IronPort-AV: E=Sophos;i="6.01,235,1684814400"; 
   d="scan'208";a="116356293"
Date: Thu, 27 Jul 2023 16:13:04 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Jason Andryuk <jandryuk@gmail.com>
CC: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>, Jan Beulich
	<jbeulich@suse.com>
Subject: Re: [PATCH v7 08/15] xenpm: Change get-cpufreq-para output for hwp
Message-ID: <bcc13d17-dbf3-41a6-b161-7fcfd5b1a885@perard>
References: <20230726170945.34961-1-jandryuk@gmail.com>
 <20230726170945.34961-9-jandryuk@gmail.com>
 <30360e09-5ae9-4232-a8fe-5b9f9deccf97@perard>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <30360e09-5ae9-4232-a8fe-5b9f9deccf97@perard>

On Thu, Jul 27, 2023 at 12:00:54PM +0100, Anthony PERARD wrote:
> On Wed, Jul 26, 2023 at 01:09:38PM -0400, Jason Andryuk wrote:
> > diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
> > index 1c474c3b59..21c93386de 100644
> > --- a/tools/misc/xenpm.c
> > +++ b/tools/misc/xenpm.c
> > @@ -711,6 +711,7 @@ void start_gather_func(int argc, char *argv[])
> >  /* print out parameters about cpu frequency */
> >  static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
> >  {
> > +    bool hwp = strcmp(p_cpufreq->scaling_driver, XEN_HWP_DRIVER_NAME) == 0;
> >      int i;
> >  
> >      printf("cpu id               : %d\n", cpuid);
> > @@ -720,49 +721,57 @@ static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
> >      printf("scaling_driver       : %s\n", p_cpufreq->scaling_driver);
> >  
> > +    if ( !hwp )
> 
> This test kind of feels wrong. Should we test instead the thing we want
> to print? Maybe declaring another bool, something like "bool
> scaling_governor = !hwp" just below the declaration of "bool hwp"?
> Otherwise, if there's another technology that comes along that isn't
> "hwp" and not something that can be printed with this, there's going to
> be some kind of hidden bug (even if probably easy to spot during
> development).

We agreed in patch 11 that this test would be temporary, and changed in
patch 11, so:

Acked-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:14:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:14:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571181.894422 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2gs-0001zJ-8p; Thu, 27 Jul 2023 15:14:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571181.894422; Thu, 27 Jul 2023 15:14:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2gs-0001zC-5v; Thu, 27 Jul 2023 15:14:10 +0000
Received: by outflank-mailman (input) for mailman id 571181;
 Thu, 27 Jul 2023 15:14:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Q9bz=DN=epam.com=prvs=1572de9637=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qP2gr-0001z2-Bm
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:14:09 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3b053895-2c90-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 17:14:08 +0200 (CEST)
Received: from pps.filterd (m0174683.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 36RCwvr6027962;
 Thu, 27 Jul 2023 15:14:03 GMT
Received: from eur04-vi1-obe.outbound.protection.outlook.com
 (mail-vi1eur04lp2059.outbound.protection.outlook.com [104.47.14.59])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3s3n7k9uqj-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 27 Jul 2023 15:14:03 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by PR3PR03MB6634.eurprd03.prod.outlook.com (2603:10a6:102:7d::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 15:14:00 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 15:14:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3b053895-2c90-11ee-b248-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ae/V+01rN2l4UBH1fLKtTtWlJMk85Ew63NGITrf50vQ9s8Ga73NJ+z1OsbTSfQScHQ/fdXvGvXjcIOMLmebwQ1Tw2TTWWmjS+cu3mGHBZhJMUCdXCEIhErDzUrBEKpzr8Rmc8GzD+CbjWCdqE9Nz25eCnTmMjqIMw5AkGI3QaFodk1CMd8vqfCykowpiPFN98n7Dovek8pFzBB5HfhEEtCaLoLN0VNXNa+ljbufFqELV8Nipos0iip/K0FKBYT+Y6WVIOEWQT9GJD9lgDPLPFGda84cGDVGt2Oi8DRdWP2FG+G2hrPixH1OnHNf2HTqJWxG1t/XF4mD7cGXYsKUpSw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=6NO0ttIsggy03SZODljZs47D0HqdhrvpF55GjVMTIcE=;
 b=H4HuxknyLyCWKOqnuCKQWLde1RJ3u0fsQuEfsIZnOcao3ku03RurQZfBsWjfgdGl33sf2Xjw6sCCRDgpBG71xh5uyu2qKhclVcl1UtwGriLaXnxZPhoWt4ZqFMi3MYcJMtSgta98P0kV02OzfkPcu3IJGFqkxfuhd/fgIOVR+gytfQgrW0hi52M+1e+wE4aDJhnUGM5+SxqjuHJTR7ppemnTVi7OjdcqF1A71PobcW9ZC4+nH+6EhI0J+HPyXLNvR6FWF6sOlFTAx6sso928IoQy7vjLv5L9zG9ekvjIuxKD/50QvnaNh+bw2cgJl9y6aVvhhza0saE963eDRu6OzA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=6NO0ttIsggy03SZODljZs47D0HqdhrvpF55GjVMTIcE=;
 b=LuWgpPU9jaJRvncaMLt5J6v/6ORPcXClUf2u9WCu5dgrS0pxFr2F7QS1oYujW9SjF9LUKv/TWBEzhlGltGmFugUOxoD5ii1bEhU5cMUSwbpTMSFGG+TFawttTbNaAkUWMBLheHUJGoFHIGRFjStNzRh3+j6Z5ed5pqgjZFd6MrqYyksE211Hxv2nL/qJQRJeUomIxQeUX/HmhYGIO4O184kek1ODemuE5A+tj7xDDQws8RM+AMXjiZ0bxurZr6WOzefJ0IxUiu3DjwbHaLqStoLhRMxVNdljliMH1p0zHikm6f1fvH7/hSGvc1UwmvDhXfgCiDIYYRQgx5c1Dbyayg==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: Jan Beulich <jbeulich@suse.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
        Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
        =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Thread-Topic: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Thread-Index: 
 AQHZuqGrLMJPz1ipBEu4urExXp8yi6/CgxUAgAWEoICAA8vwgIAA+VsAgAB5WACAAC7UgIAAEweAgAA5kgA=
Date: Thu, 27 Jul 2023 15:13:59 +0000
Message-ID: <87jzulbd5e.fsf@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local> <87ila7cvy2.fsf@epam.com>
 <ZMDox0WwumxMGnzV@MacBook-Air-de-Roger.local> <87y1j2b296.fsf@epam.com>
 <999aae1d-fb85-6550-9798-64cf88d7faf3@suse.com> <87r0otbq78.fsf@epam.com>
 <2d5c6adf-321d-5bbc-c5b5-4ea3d255bf42@suse.com>
In-Reply-To: <2d5c6adf-321d-5bbc-c5b5-4ea3d255bf42@suse.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: mu4e 1.8.9; emacs 28.2
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|PR3PR03MB6634:EE_
x-ms-office365-filtering-correlation-id: f39e6d63-4588-48c8-7f66-08db8eb41ad6
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 al1u/EDSDcBz8VqfGM0RtPyUe9f9Pm+lREs7UMJkp5hLGnMZ/rkWY6q2O5OGmH4GhINRwxNNJd9uvi3vlb5OQec9CZaCG9btuPEBOI1lsx/5O18xvSSlHDjy8RzsqjpB9E8JoLXpFtIm/mJEZOstl2lI6PcJQntMI5t6z0VneW/zeGUcxN7iA40vMNxF2mC9HBW1xiygdaqGhT8ZgUUsI5lwS6EHNy5vS6dGgkM0TZQIXMvWFcEQFN0FylEIGK1t3EMiKIMZi5/sv23OzK3dsofy/QaEFnmJSpoIWnxuQ0v7RtGLfMigRRoNYktmbM3895umd8eILI1Hr//abmZKbi541KUAp3zb3yUgafwsomlwsevQgL7EK3mEJTXvabSWq0JnjplZ7nrhl8HWjOpEXyfuW4Gjcy78hYmewZal6WmHzSC1fSU93xKCfXh8PaFg53YORHDqReI+Freh7r6c8J8+qW11kxhfSJkjx5bx7YnBiWs03tvnHMelmFs+G/wTRdJsOlmNUxELoBz3xVWwyZKpRYRFVDHIwz0FT1g4paDATlvBHdOnD5jvIlsl1ZJLznA+Isa8zX2zygrU5yjDEJzwxKDVEAR+47M5KPwANTVVfNc6dwav2kXGY6lLF4ei
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(346002)(396003)(39860400002)(366004)(451199021)(6916009)(66476007)(71200400001)(66556008)(66446008)(38070700005)(6486002)(6512007)(66946007)(64756008)(76116006)(4326008)(54906003)(38100700002)(122000001)(91956017)(478600001)(36756003)(2906002)(41300700001)(83380400001)(2616005)(5660300002)(8936002)(8676002)(6506007)(26005)(316002)(55236004)(53546011)(86362001)(186003);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?UnQrdmUydjFwMHM1Z0k3L0lydWl3Y25sRHk1NG5RczlTcnZ2WXpLbkYwRWUz?=
 =?utf-8?B?Y1lDMlF0SzBNOW4vSzJ3Vy9namsya0l1Q3VJakNRaHVhckxNUXVyVFdzaFpC?=
 =?utf-8?B?M0h2eFk2NThvblBGZU9ESTFmaExxSmQ1ZGNPYUo3MUc3Y3hGYTk4WTlRaVZq?=
 =?utf-8?B?N295akt4WE8vOGVIanRMbE5WRXZEaEIzT1g4ZkRsbGhuL0JVNVJlYjJxRTAz?=
 =?utf-8?B?K0VNODFNUVMrQ08rNjJCcGhoYTFTZTRUNUV1c0pCVnJIUVpOZXFoS0ZxcDRJ?=
 =?utf-8?B?bm0ya1ZlMlRTenV4VFVZNEVJdFZ1OEhKa2w2ZGszQUtVdWo4bjRTZ2Jidmwz?=
 =?utf-8?B?c0NYMENaRDNrbkRzYm42eVI5Uk8rbUdUZnMzYzdiNTNabXZxN0tOYkw1TFhN?=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EVOT243ak9BZy9sbGgwbXNu?=
 =?utf-8?B?QlE9PQ==?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <7FD331EF44BAEF4E8ADD7CF09571FFC9@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f39e6d63-4588-48c8-7f66-08db8eb41ad6
X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jul 2023 15:13:59.8421
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: /hiNLC9EA8KUYK+G60e9z+uzgpx7pNjd2t4E+AO8ZxqHvt44QAniYnhQXGkASQnKLXK277AZibykUUoiYgb5cRBpVe/FLuIXG9Z3OD9avLM=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR03MB6634
X-Proofpoint-GUID: kl4Yg0vjUL9j4iHKB_WlamiksQpKdjHI
X-Proofpoint-ORIG-GUID: kl4Yg0vjUL9j4iHKB_WlamiksQpKdjHI
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-27_07,2023-07-26_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 phishscore=0
 mlxscore=0 lowpriorityscore=0 clxscore=1015 suspectscore=0 spamscore=0
 malwarescore=0 impostorscore=0 priorityscore=1501 mlxlogscore=869
 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307270137

DQpKYW4sDQoNCkphbiBCZX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kZXYtPnZwY2ktPmxvY2suIEJ1dCB0byBhZGQvcmVtb3ZlDQpwZGV2
LT52cGNpIGl0c2VsZiB3ZSBuZWVkIHRvIGhvbGQgZC0+cGNpX2xvY2sgaW4gdGhlIHdyaXRlIG1v
ZGUuDQoNCkFzIGZvciBwY2lkZXZzX2xvY2ssIEFGQUlLLCB0aGVyZSBpcyBubyBzdHJpY3RseSB3
cml0dGVuIHJ1bGVzLCB3aGF0IGlzDQpleGFjdGx5IGlzIHByb3RlY3RlZCBieSB0aGlzIGxvY2su
DQoNCi0tIA0KV0JSLCBWb2xvZHlteXI=


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:15:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:15:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571183.894432 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2iZ-0002b7-Ke; Thu, 27 Jul 2023 15:15:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571183.894432; Thu, 27 Jul 2023 15:15:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2iZ-0002b0-Ha; Thu, 27 Jul 2023 15:15:55 +0000
Received: by outflank-mailman (input) for mailman id 571183;
 Thu, 27 Jul 2023 15:15:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8wl5=DN=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qP2iY-0002au-Hd
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:15:54 +0000
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com
 [2a00:1450:4864:20::130])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7a355963-2c90-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 17:15:53 +0200 (CEST)
Received: by mail-lf1-x130.google.com with SMTP id
 2adb3069b0e04-4fe07f0636bso1923763e87.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 08:15:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7a355963-2c90-11ee-b248-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690470953; x=1691075753;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=76hZ0dWC8yqIRQ+XjGC+2YGmrx6Bg16ia8/p1f6PXrY=;
        b=NUnz6bkT4rI+fWiCLYqkqlWVU68ltZqwVu8o/J16VF19aaEc1+DcLC8a5/oiksYoqD
         Q6HaRWNXfT65byTKid6lgZ25erEJnyf7r6zNfDpv5rmoUublAm9phw25Up6Ov6uCRwpu
         PqAiV+JGTPv0MP+ctIcJaWtxaNpqa9Vu1sMa0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690470953; x=1691075753;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=76hZ0dWC8yqIRQ+XjGC+2YGmrx6Bg16ia8/p1f6PXrY=;
        b=gGlPFSkV94ZA9Smhq9UlJqOkzdmLcWL6ENevvmZvnuyQtowHOBiHbYF4IGfL4VXgWe
         cHQcogzHUFOvR6YGAHkci8vf3rviXZqghXsikj+ZgdxCYekXcZmptnoEJKQh7M62s9rb
         EII9Ked7nRDJBaIN1xRRTUeAFzBEcJad7CUE69dbL8m1AtngFZzevEwsoeH/PDLYdcpD
         wKiEkIGwtHg7QwZ0uoxn7uSw4gXfcFsNtxr9sE/As6T4vpi+VYnFLmOL7Yj7S8+PCcFM
         YCxhfhh4XtUxVtfFBJeVoI5K0v5DgFIz+1Iby6WhoqtwbmIIRULIHdQrC1lLAA/BpdoX
         IxgQ==
X-Gm-Message-State: ABy/qLb2L1v7yzXC08viae/Xu3PeOGsebheuA+IiYtBWcLTtC++0uPbG
	319p8HzRgeLMnHpuRPo3wR6E4lmYpqAdCLFAMDeygA==
X-Google-Smtp-Source: APBJJlF6I0xhvzADi2x4QJ86TlGc6kOwxcOf6Qa5jfKGw+2Jc3619ICU79H028gsAKFTBMb2WqAyMhcqE/BpTmgEgdQ=
X-Received: by 2002:a19:6d1d:0:b0:4f8:bfb4:e4c4 with SMTP id
 i29-20020a196d1d000000b004f8bfb4e4c4mr1637238lfc.19.1690470952800; Thu, 27
 Jul 2023 08:15:52 -0700 (PDT)
MIME-Version: 1.0
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
 <20230701071835.41599-4-christopher.w.clark@gmail.com> <alpine.DEB.2.22.394.2307081144340.761183@ubuntu-linux-20-04-desktop>
 <CACMJ4GYE6PW1SY35dhs4XkXd9ru25igrvMCrh4pJMWEBNNz0YQ@mail.gmail.com>
 <CACMJ4Gb_ZwKSjP7qzfQj98YQjSpBdFuWzeGQJUNNqst0GdXCOw@mail.gmail.com>
 <4e0a0fc9-0c1b-4725-5692-de67ee68a980@suse.com> <2994c9b8-c803-1fd9-20df-0d25d2b66c49@apertussolutions.com>
 <ca85fd2e-45a5-32c3-cb4b-1042be6c6915@suse.com> <32a22c57-1333-47b0-c61d-abff8d7df112@apertussolutions.com>
 <7ab3c4ae-3903-29de-ba32-d328b426d104@suse.com> <19bb355f-576c-b8d7-b6da-fa2dd8ff2228@apertussolutions.com>
 <63979074-42c3-83dd-cf0a-8f0cd0294a5d@suse.com>
In-Reply-To: <63979074-42c3-83dd-cf0a-8f0cd0294a5d@suse.com>
From: George Dunlap <george.dunlap@cloud.com>
Date: Thu, 27 Jul 2023 16:15:41 +0100
Message-ID: <CA+zSX=ZFjWWnzx8vt3afywaiJiju1N5hNJqKzVkg956T-t-kwg@mail.gmail.com>
Subject: Re: [PATCH 03/10] x86 setup: change bootstrap map to accept new boot
 module structures
To: Jan Beulich <jbeulich@suse.com>
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>, xen-devel@lists.xenproject.org, 
	stefano.stabellini@amd.com, Andrew Cooper <andrew.cooper3@citrix.com>, 
	George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, 
	Bertrand Marquis <bertrand.marquis@arm.com>, Luca Fancellu <luca.fancellu@arm.com>, 
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Rich Persaud <persaur@gmail.com>, 
	Stefano Stabellini <sstabellini@kernel.org>, Christopher Clark <christopher.w.clark@gmail.com>
Content-Type: multipart/alternative; boundary="000000000000a52bd106017970aa"

--000000000000a52bd106017970aa
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 27, 2023 at 3:42=E2=80=AFPM Jan Beulich <jbeulich@suse.com> wro=
te:

> On 27.07.2023 15:26, Daniel P. Smith wrote:
> > Let's bring this back to the actual implementation instead of the
> > theoretical. Your position is that Xen's paddr_t is desired because it
> > can store larger values than that of size_t. Now if you look in Xen
> > proper (main 64bit code on x86), paddr_t is a typedef for a 64bit
> > unsigned integer. And if you look at size_t, it is also a typedef to a
> > 64bit unsigned integer, they are literally a couple of lines apart in
> > types.h. Thus they are the same size and can only represent the same
> > maximum size.
>
> What about 32-bit Arm, or any other 32-bit architecture that we might
> see Xen ported to, with wider than 32-bit physical address space?
>

To be more concrete here:

Suppose that you had a machine with 32-bit virtual address spaces (i.e.,
going up to 4GiB), and 36-bit physical address spaces (i.e., going up to
64GiB).  And suppose you had a system with 16GiB of physical ram.  And you
wanted to use Hyperlaunch to create VMs using some sort of memory image
that was 5GiB (presumably of some kind of static data, not, say, a kernel
or initramfs).  You wouldn't be able to do it if the "size" parameter of
the boot modules was limited to 4GiB (without some kind of hack where you
string multiple boot modules together).

I guess part of the question is whether we think that's an important use
case; on the whole if you're populating 5GiB of RAM, it seems like it would
be better to have the VM load it itself from disk.

I do see the logic behind wanting to avoid "paddr_t" for a size; I'm sure
Jan that you would nack any patch that used "size_t" as a memory address
(instead of, say, uintptr_t).  In that case, "psize_t" is the obvious
solution.

 -George

--000000000000a52bd106017970aa
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jul 27, 2023 at 3:42=E2=80=AF=
PM Jan Beulich &lt;<a href=3D"mailto:jbeulich@suse.com">jbeulich@suse.com</=
a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0p=
x 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On=
 27.07.2023 15:26, Daniel P. Smith wrote:<br>
&gt; Let&#39;s bring this back to the actual implementation instead of the =
<br>
&gt; theoretical. Your position is that Xen&#39;s paddr_t is desired becaus=
e it <br>
&gt; can store larger values than that of size_t. Now if you look in Xen <b=
r>
&gt; proper (main 64bit code on x86), paddr_t is a typedef for a 64bit <br>
&gt; unsigned integer. And if you look at size_t, it is also a typedef to a=
 <br>
&gt; 64bit unsigned integer, they are literally a couple of lines apart in =
<br>
&gt; types.h. Thus they are the same size and can only represent the same <=
br>
&gt; maximum size.<br>
<br>
What about 32-bit Arm, or any other 32-bit architecture that we might<br>
see Xen ported to, with wider than 32-bit physical address space?<br></bloc=
kquote><div><br></div><div>To be more concrete here:</div><div><br></div><d=
iv>Suppose that you had a machine with 32-bit virtual address spaces (i.e.,=
 going up to 4GiB), and 36-bit physical address spaces (i.e., going up to 6=
4GiB).=C2=A0 And suppose you had a system with 16GiB of physical ram.=C2=A0=
 And you wanted to use Hyperlaunch to create=C2=A0VMs using some sort of me=
mory image that was 5GiB (presumably of some kind of static data, not, say,=
 a kernel or initramfs).=C2=A0 You wouldn&#39;t be able to do it if the &qu=
ot;size&quot; parameter of the boot modules was limited to 4GiB (without so=
me kind of hack where you string multiple boot modules together).</div><div=
><br></div><div>I guess part of the question is whether we think that&#39;s=
 an important use case; on the whole if you&#39;re populating 5GiB of RAM, =
it seems like it would be better to have the VM load it itself from disk.</=
div><div><br></div><div>I do see the logic behind wanting to avoid &quot;pa=
ddr_t&quot; for a size; I&#39;m sure Jan that you would nack any patch that=
 used &quot;size_t&quot; as a memory address (instead of, say, uintptr_t).=
=C2=A0 In that case, &quot;psize_t&quot; is the obvious solution.</div><div=
><br></div><div>=C2=A0-George</div></div></div>

--000000000000a52bd106017970aa--


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:18:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:18:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571185.894442 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2ky-0003E3-0j; Thu, 27 Jul 2023 15:18:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571185.894442; Thu, 27 Jul 2023 15:18:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2kx-0003Dw-U7; Thu, 27 Jul 2023 15:18:23 +0000
Received: by outflank-mailman (input) for mailman id 571185;
 Thu, 27 Jul 2023 15:18:22 +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
 <SRS0=mGGP=DN=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qP2kw-0003Dq-9J
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:18:22 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d19c5a32-2c90-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 17:18:20 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.161.207.213])
 by support.bugseng.com (Postfix) with ESMTPSA id 666C74EE073F;
 Thu, 27 Jul 2023 17:18:18 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d19c5a32-2c90-11ee-8613-37d641c3527e
Message-ID: <86841a3d-2731-5ea4-07ec-f1d4833b4b7f@bugseng.com>
Date: Thu, 27 Jul 2023 17:18:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH 1/4] x86: mechanically rename to address MISRA C:2012
 Rule 5.3
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1690449587.git.nicola.vetrini@bugseng.com>
 <614dd6fe03ab82db83eabc430b27435b19096791.1690449587.git.nicola.vetrini@bugseng.com>
 <604b915b-e07e-8985-87f1-300568d0259f@suse.com>
 <40b2fb63-463c-2f9c-dc46-572cb0925807@citrix.com>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <40b2fb63-463c-2f9c-dc46-572cb0925807@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 27/07/23 17:00, Andrew Cooper wrote:
> On 27/07/2023 3:50 pm, Jan Beulich wrote:
>> On 27.07.2023 12:47, Nicola Vetrini wrote:
>>> Rule 5.3 has the following headline:
>>> "An identifier declared in an inner scope shall not hide an
>>> identifier declared in an outer scope"
>>>
>>> The renames done by this patch avoid shadowing from happening.
>>> They are as follows:
>>> - s/str/s/ in 'lapic_disable'
>>> - s/str/level/ in '(apic|mce)_set_verbosity'
>>> - s/str/state_str/ in 'mwait_idle_probe'
>>> - s/str/memmap_name/ in 'init_e820'
>> I'm sorry to say that, but I'm not willing to go and figure out where
>> that "str" is that there's supposedly a collision with. Please can you
>> state such right here, ...
>>
>>> - s/i/j/ in 'mce_action' (the shadowing here is due to macro
>>>    'x86_mcinfo_lookup' that defines 'i' as a loop counter)
>> ... much like you do in this case?
> 
> In fairness to Nicola, that was given.
> 
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>> ---
>> Function 'str' in 'xen/arch/x86/include/asm/desc.h'
>> causes the shadowing.
> 
> which is the wrapper for the STR instruction.
> 
> It's used in a single assertion, and I'd be happy getting rid of it
> entirely.Â  Alternatively, it could be renamed to read_tr() (or
> read_tr_sel() ?) if we want to keep the assertion.
> 
> We're not renaming every other use of 'str' to mean string just for this...
> 
> ~Andrew

Seems reasonable to remove it, though there aren't that many instances 
of shadowing on 'str'.

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:22:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571188.894452 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2oo-0004f6-FR; Thu, 27 Jul 2023 15:22:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571188.894452; Thu, 27 Jul 2023 15:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2oo-0004ez-Cq; Thu, 27 Jul 2023 15:22:22 +0000
Received: by outflank-mailman (input) for mailman id 571188;
 Thu, 27 Jul 2023 15:22:20 +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
 <SRS0=mGGP=DN=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qP2om-0004et-Ik
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:22:20 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5fc5f483-2c91-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 17:22:18 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.161.207.213])
 by support.bugseng.com (Postfix) with ESMTPSA id F3CD64EE073F;
 Thu, 27 Jul 2023 17:22:16 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5fc5f483-2c91-11ee-8613-37d641c3527e
Message-ID: <baaed0c1-2324-86ab-a6a4-6721dc67243e@bugseng.com>
Date: Thu, 27 Jul 2023 17:22:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH 2/4] x86/emulate: move a variable declaration to
 address MISRA C:2012 Rule 5.3
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Paul Durrant <paul@xen.org>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1690449587.git.nicola.vetrini@bugseng.com>
 <bc3a28abf9f00bf67cf5ee64bd89e7d38e321c06.1690449587.git.nicola.vetrini@bugseng.com>
 <9db05529-b4ed-89c0-a140-118c0ccf44bb@suse.com>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <9db05529-b4ed-89c0-a140-118c0ccf44bb@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 27/07/23 17:06, Jan Beulich wrote:
> On 27.07.2023 12:48, Nicola Vetrini wrote:
>> --- a/xen/arch/x86/hvm/emulate.c
>> +++ b/xen/arch/x86/hvm/emulate.c
>> @@ -2024,15 +2024,15 @@ static int cf_check hvmemul_rep_stos(
>>   
>>       switch ( p2mt )
>>       {
>> -        unsigned long bytes;
>>           char *buf;
>>   
>>       default:
>>           /* Allocate temporary buffer. */
>>           for ( ; ; )
>>           {
>> -            bytes = *reps * bytes_per_rep;
>> -            buf = xmalloc_bytes(bytes);
>> +            unsigned long bytes_tmp;
>> +            bytes_tmp = *reps * bytes_per_rep;
>> +            buf = xmalloc_bytes(bytes_tmp);
>>               if ( buf || *reps <= 1 )
>>                   break;
>>               *reps >>= 1;
> 
> This wants dealing with differently - the outer scope variable is unused
> (only written to) afaics. Eliminating it will, aiui, address another
> violation at the same time. And then the same in hvmemul_rep_movs(), just
> that there the variable itself needs to survive. I guess I'll make a
> patch ...
> 
> Jan

Wouldn't this code at line ~2068 be possibly affected by writing to 
bytes, if the outer variable is used?

/* Adjust address for reverse store. */
if ( df )
   gpa -= bytes - bytes_per_rep;

rc = hvm_copy_to_guest_phys(gpa, buf, bytes, curr);

You're right about the other violation (R2.1)

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:25:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:25:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571192.894462 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2sE-0005KQ-0y; Thu, 27 Jul 2023 15:25:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571192.894462; Thu, 27 Jul 2023 15:25:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2sD-0005KJ-Tu; Thu, 27 Jul 2023 15:25:53 +0000
Received: by outflank-mailman (input) for mailman id 571192;
 Thu, 27 Jul 2023 15:25:51 +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 <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qP2sB-0005KB-SJ
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:25:51 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20631.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::631])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dd0de0ef-2c91-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 17:25:49 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VI1PR04MB7151.eurprd04.prod.outlook.com (2603:10a6:800:129::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 15:25:47 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 15:25:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dd0de0ef-2c91-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=PO1bgjRxfM5V2PY5LNVgOIqRGVIiMLEqJAuoPvb4WQ6xJU0IVxkkoYCn7zLxmemVuiw4MGghFZWkPbKVumnUDCUEVuehV8jCjwq29LbB7ySEKvEj++jr33A9EfNjW/pXPmgzreF1qhsrtLMRIL40MCkAveANOdjRkr+UY/jxM9O03ydWLiPWwS+BEG/iEHod1iIdCfZCFjyoooM2y6I6h5RVVOM/2xOBBQo3bu8jjn0w42+K394JZnGb728TPukH9VHg1Hgef5bX431PbxjROBYQKfaSFGX5G/s52U8Bce0/vCw1rqU1AaWGxOlP5QSJUcFCT79vyLRSwqYdiU0Hgg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=lVCXWdDKp2ChIZDRQduATGvrRSz+7n/XiqcGDuffOUI=;
 b=cydJMy9UQLgyHfuHnW8IU0JlXK/h2cJlQEp2kp+WF4ZHSJ4HeY+SOyOjFPZJWcJZyB3pOJitO9ghH8C9sApG8KoMDki83KtwpB1IXzCNksoTMLR6L8Sf436WVU43Qj+yiNZ59AJ78rOfQ92i8iZgjbnrYak+6C4H4PdiqicS/wKdEM1trPFFuU0vmd/+6Mgr4F9J4d2Es2OtzEbKN/6lzn8wOirGSmR1LKoSwgQaCQaa+75B/mDIgkboLXrN1/qcXliRvRDx32Vdb+nZ0r8YmTY6fneVJYxpAIn4zr2QbuAOH4uPMhEJbI155/3INKOoIEA9VhhwmE3v2EW5Q1CYxg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=lVCXWdDKp2ChIZDRQduATGvrRSz+7n/XiqcGDuffOUI=;
 b=oIfq+L258N0vk1CpDC+eLWcoS4M5bBfKwBKtdYtGliMTX3+GXcG8dyv25eUpobZnbOQlUcEX9O/bhlcKReP2ZxJCJBQIGOckvJfWFgNkL8uP4I4cfgSEGgB0lJmrRMEjsYPB+z2ttShUT2jDXUHqUO5NF+pBUmJRBofujIh4J2ZetOiFT5orpF0cKntTRn6DYAqM887mk7KLxwsRYFEgO2c4zXai2MYKvL/oBbIGqQbQXj6CVtyzdDYacG5FseQX8+gcnbba+8UVyqqTFb/9uNtu5+tL4bJff5/5Fr9vABkqyNpaim9myfW2PFu/ezptga5joToADE/BzRxkvBbXMQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <32e33a0b-d572-ea7f-b1a8-3263711582e5@suse.com>
Date: Thu, 27 Jul 2023 17:25:44 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Paul Durrant <paul@xen.org>, Nicola Vetrini <nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86/HVM: drop dead assignments from hvmemul_rep_{movs,stos}()
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0117.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a8::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VI1PR04MB7151:EE_
X-MS-Office365-Filtering-Correlation-Id: c62d68e6-6138-43ff-ef65-08db8eb5c013
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	xwnjWEiOqxMqzItiz41bOXE9RS0kawcTw+HQ4o4lc1xxUDp5XfsG2mRj5tGDdGBkSrDkvFWIXPKdHSLYvxUgVqyjCaQQC3NL/JlpB8AtcRJSUR13XNOCbtYUZ4OP9Yp4HIWl+23X0/5JIIGfCLLQBPuxkxh/Ye9NjzJEY8VThllN+3oYJh6pQbcDmo70pUZkHYx/6QgVAjk2Jx05a9U2RSx4Qb9hUDiWTh4aWxzs3v0emxhVdS7Xcyp6ODZLbEFGve7TKmnu++FtmWaoKrlzxZ+CM87cxcdl8ja/IQ4qWsi5npkkAApdO9S1UwQCN6Vf9Zh4CN7R/Mp1eMwmE9JtR/fdodyJ+rHBMnGBawZVlQwqNy06utPMQTAoBqnzIQ8adeCHGPtnbNuY2W/YCi6orY0II7ndPRywlfco8Mcey1fvnltw5AUsrUahHswOfh0yoiyNtFY+H70hqXdiWxmw3A0XmRYsjNQ2w1N9SGRiAnR5dha9F8LfwUqP+vn1Sg74hSmbGkRqqf2DJ0XWoXHeERiKKu/K47cUvS89/9AEya4vKVdEgyzIo/PeZ87I4T5JGLLvwzvI9gQNsBzRmoW9RwcX5Xa0SsJLyniPOCYQo3FjTW2woydjZzTcdSBS8F1QVzX7Hb7sH3i8zbsIIOpJxA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(376002)(366004)(346002)(39860400002)(136003)(451199021)(2906002)(83380400001)(6486002)(2616005)(38100700002)(36756003)(186003)(5660300002)(86362001)(31686004)(31696002)(316002)(26005)(6506007)(8936002)(8676002)(41300700001)(6916009)(66476007)(66946007)(478600001)(4326008)(66556008)(6512007)(54906003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VzBOakRiYXJJUjI5NHc2QzFRR3lYcVZBSFRoZjFWNmRRVDdIZzlOVDZmd2VO?=
 =?utf-8?B?eHZTRlpXQmFONFI2aS9wbUIvdmFBZ1RoN0hGWXNzV29hY3F2djd2MHZINFBX?=
 =?utf-8?B?eWtQRjcva0Z1bU5jWHhmR0pDcEFWZUR2MU5vL1RNSm4ycG9aL1c1b3ViKzNt?=
 =?utf-8?B?bW4xeGZDSXNxaVpHRXpMZ2FaeHJTbERQcHRwS1pCRmF4RFVZMnprOUMxSTJz?=
 =?utf-8?B?MExTNk85Y2V6cmU0UkVsUWltVVBhQ1RoQUtvZ1dZQ2U2bkV0cEZpNXZjWk9G?=
 =?utf-8?B?bXkrOWw2bXM3YklTTlZsUFpUT0FxUTdxbkNlUmIwUGhpVENjbFh4NHNwMzY4?=
 =?utf-8?B?TDJRUjRGSVBBaHU0WW9PV3h6V1h4bmQ5MjAvazV1SUgwQVFmL3ptMkNqR2dr?=
 =?utf-8?B?bm5JRDdtdFd3YVVjZ0U4cUhNU1ZyUmhhYlhKaWZGTm1EQWZONXR2UDVuKzhj?=
 =?utf-8?B?ait0ajdSTVo2Y1N0LzJ2aT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MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 15:25:46.6775
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: bZ7KyAGeswB7wYEjgUsNMhvnxohC7af0Q7UtiGBu92LMNk6+LLRuqbSqUAzB93BczakExAGrwiurwMiworNtxw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7151

In the latter case the variable altogether is then unused and hence gets
dropped, eliminating a Misra Rule 5.3 violation. I'm afraid I mistakenly
introduced both assignments in 57a57465daaf ("x86/HVM: use available
linear->phys translations in REP MOVS/STOS handling"), likely as a
result of some re-work on the patch.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -1861,7 +1861,6 @@ static int cf_check hvmemul_rep_movs(
             return rc;
     }
 
-    bytes = PAGE_SIZE - (daddr & ~PAGE_MASK);
     if ( hvio->mmio_access.write_access &&
          (hvio->mmio_gla == (daddr & PAGE_MASK)) &&
          /* See comment above. */
@@ -1988,7 +1987,7 @@ static int cf_check hvmemul_rep_stos(
         container_of(ctxt, struct hvm_emulate_ctxt, ctxt);
     struct vcpu *curr = current;
     struct hvm_vcpu_io *hvio = &curr->arch.hvm.hvm_io;
-    unsigned long addr, bytes;
+    unsigned long addr;
     paddr_t gpa;
     p2m_type_t p2mt;
     bool_t df = !!(ctxt->regs->eflags & X86_EFLAGS_DF);
@@ -1998,7 +1997,6 @@ static int cf_check hvmemul_rep_stos(
     if ( rc != X86EMUL_OKAY )
         return rc;
 
-    bytes = PAGE_SIZE - (addr & ~PAGE_MASK);
     if ( hvio->mmio_access.write_access &&
          (hvio->mmio_gla == (addr & PAGE_MASK)) &&
          /* See respective comment in MOVS processing. */


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:27:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:27:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571194.894472 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2tf-0005vs-Bg; Thu, 27 Jul 2023 15:27:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571194.894472; Thu, 27 Jul 2023 15:27:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2tf-0005vl-8Y; Thu, 27 Jul 2023 15:27:23 +0000
Received: by outflank-mailman (input) for mailman id 571194;
 Thu, 27 Jul 2023 15:27:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=RhFg=DN=citrix.com=prvs=5656f8b89=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qP2te-0005vb-02
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:27:22 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 12e53497-2c92-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 17:27:20 +0200 (CEST)
Received: from mail-dm6nam12lp2174.outbound.protection.outlook.com (HELO
 NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.174])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 27 Jul 2023 11:27:13 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by SA2PR03MB5833.namprd03.prod.outlook.com (2603:10b6:806:114::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 15:27:12 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::edfe:6f64:4048:74c5]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::edfe:6f64:4048:74c5%4]) with mapi id 15.20.6609.032; Thu, 27 Jul 2023
 15:27:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 12e53497-2c92-11ee-b248-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690471640;
  h=message-id:date:subject:to:cc:references:from:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=0DEsu9ew33VMzjUsHwNJnHOtsQNWIctiYtV4TzYL8X4=;
  b=EvSTfcC/ThJi0esc/Cc+4SLH6onN4lExLEtXskOFUbjUaEI+ycgEuSwt
   yN7xJBbYFAQpKn5lmzU47IfsZe0WBzYFMbaLjGLrPY/1PdbnHO3G1ZB6s
   LGKepD+SkrP3WzjwEG60dAPqWOESWbNBy0NWS89cRUkJ0r8Kys6YPiKpR
   U=;
X-IronPort-RemoteIP: 104.47.59.174
X-IronPort-MID: 120294871
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:SNM8+Kk3+xBi7cStbdAnrb7o5gxCJ0RdPkR7XQ2eYbSJt1+Wr1Gzt
 xIbD2HXM6mNM2r2fItwPI60/E9U757Wz4RqQFA+qCFnEyMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5gCGzRH5MbpETU2PByqgKmVrNrbSq
 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/
 f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3
 c4XDykidSCfvs+zzbWEFNJdqu5/F9a+aevzulk4pd3YJdAPZMmZBonvu5pf1jp2gd1SF/HDY
 cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVkV03ieexWDbWUoXiqcF9t0CUv
 G/ZuU/+BQkXLoe3wjuZ6HO8wOTImEsXXapLTuXip6I63wT7Kmo7CyRLTXiCpN2FzW3id+ltB
 Xc20TUnlP1nnKCsZpynN/Gim1aGtBMBX9tbE8Uh9RqAjKHT5m6xFmUCCzJMdtEinMs3XiAxk
 E+EmcvzAj5iu6HTTmiSnp+MpC62ETgYKykFfyBsZQ0E6N7nqcctgw7VT9BiOKSogcb4Hz62y
 DePxBXSnJ0WhM8Pkqm+o1bOhmv2ooCTF1FpoALKQmii8wV1Ipa/YJCl4kTa6vAGK5uFSl6Gv
 z4PnM32AP0yMKxhXRelGI0ldIxFLd7fWNEAqTaDx6Ucygk=
IronPort-HdrOrdr: A9a23:dhsCDqB1tj/LNYrlHelo55DYdb4zR+YMi2TDt3oddfU1SL38qy
 nKpp4mPHDP5wr5NEtPpTniAtjjfZq/z/5ICOAqVN/PYOCPggCVxepZnOjfKlPbehEX9oRmpN
 1dm6oVMqyMMbCt5/yKnDVRELwbsaa6GLjDv5a785/0JzsaE52J6W1Ce2GmO3wzfiZqL7wjGq
 GR48JWzgDQAkj+PqyAdx84t/GonayzqK7b
X-Talos-CUID: =?us-ascii?q?9a23=3AUGem9Wu9/Lugbd4meG39q1qC6IsXfVrE42zgP3a?=
 =?us-ascii?q?VDGtud+OueHO6pJh7xp8=3D?=
X-Talos-MUID: 9a23:tPhXYQQqhUKpf8ciRXTvvWx6F/5tx5jpKxwhqqcogOuvKiVJbmI=
X-IronPort-AV: E=Sophos;i="6.01,235,1684814400"; 
   d="scan'208";a="120294871"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=NLtiVSzbP8sS35xO5Tyv5MXfJnpr4tMAafOtvHfuz7Lciv03NxwPROej6zjY+ZQgwFEx36GQVlGV9QZZx2yhUNWr/uCQrVxILH22D8VrJq2YKjyno5a5FDTH/NHkzQFLvDfhYz+BlLXxJh5kNXlJACzh64472LNb9ZmgOhwHZchWsFMS60gdYnuWzqbo7+TN2dYvpBbDM1Q/4CU+XZWCn7bg12NZSBh5sMbB3f+UDeXxnkZ/6QzahxqWmAYprKTEieSPNPRcw50PN7S6Pj2HHm7DFoqYZ2Cz0TWEK2XCPOe69HYQbwJTDS9E9j5JvdXFFDAcbBXkhIXLjIeH4ue/5w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0DEsu9ew33VMzjUsHwNJnHOtsQNWIctiYtV4TzYL8X4=;
 b=oeMXfXVVK9vJIzKuGhyW/QHiZLjsoPdOj84ZOkNCDXBGDLqhyjXrBFGseiwYHObFFXXzsEAyeYcwMk+kZ4tPG6/db4/5Dgsy1XV/Eqc03+dDNrntBEVnX4ym0gIhsjFfAmkfha3hCqKXfn34Gc7zs2NnAG9TnoMqe/rqCNg3WCEbC8NdpnDO2DSH+x2P59no5a8MzNleJxX6yS0dX4UxV24O+r+ublS5jpVuInOPi7mgJ9fh5EfSW4WQsm3zQq2u1nucC6bAd+Ot2Hq0eHo3JQyXvujqwTegO/YFqBpSl2frFSLXIH94ruy7A/GgSZilHDaYcWemuZFisIxzZ0dS8Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0DEsu9ew33VMzjUsHwNJnHOtsQNWIctiYtV4TzYL8X4=;
 b=g8obaqySkcMia733M8kXP1mvYQvLnQ/BLVJuB9SdsHeH0asFSeXK8d6Opru6uksNibBadkkSeufjCH/m95lALKJQvWDrEtxl3XYw1JfLIU90KfrAxhDz/69T/3p76N7Vc3eyDNV8vXsQwMY+mxqjGZ6EoKkEcNuY0iPrHve34AM=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <8bfa8f7d-b2a7-02ac-5fa0-109aa1e8584c@citrix.com>
Date: Thu, 27 Jul 2023 16:27:06 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH] x86/HVM: drop dead assignments from
 hvmemul_rep_{movs,stos}()
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Paul Durrant <paul@xen.org>, Nicola Vetrini <nicola.vetrini@bugseng.com>
References: <32e33a0b-d572-ea7f-b1a8-3263711582e5@suse.com>
From: Andrew Cooper <andrew.cooper3@citrix.com>
In-Reply-To: <32e33a0b-d572-ea7f-b1a8-3263711582e5@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P265CA0128.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2c6::16) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|SA2PR03MB5833:EE_
X-MS-Office365-Filtering-Correlation-Id: 08cc95e2-2fc9-473f-e45d-08db8eb5f2b8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	twQDJ9Hc8Bm2Sy2uoaEpspCiGEXhF7EbF7xCstj6fIDfQJygBr4gVjUjtyn28pheiplNx5E3HIb5tnUyfwN08OEEi3XYgeJZfZ8NSQr5jxEwIRE6kTpkDQDbSK1+YEJO+pZ7/7G9fyYCOxUmuaFYlAO6XF498Ojmja5JepDYZ04/pP1bUXKeM1Bjyn4yqfY6qpO0vEYpEUPO6rFNlAKC9OgUp1wg3g1wa9r1ogXLJf0jAtiLRerWjirDlYnq8TlfFwEseZozxpECHewuywVQMAYuug5Cdh33hwNJYUx4OTS2A1sJf181zW6pEkva2cGK/yYkZWQAXby6Ya246NZxDeV1LXM+lKuD4403S43Ntg1gPZtCgXuLCdiChnf057lu0dcVx6bLLlBXBSXv9ilgT/3eGLMU39PEXzjlDkl6jBJmUY++QWzyMUuPAKPBrxnnGtB14EWvLjiMEo7eUei4XYmHVenzFNKEOWnCFkuXhicCBaciKj7/HSajz7q6G3yDvRy/76QyE9GlTiH2RgZ/XKhgGsmpeJFPurwv1u+YC+3xfT4TCva5XYcD2KRB6Q2YIv1q0HmYAeYJUZEI4/dpV6rIFSgIe/qygIWp70D5vt5pDoueRaCNHQddDIs0wdzE2SiUPGvaYfL/ba2YVXcIgQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(136003)(346002)(396003)(39860400002)(376002)(451199021)(4744005)(2906002)(26005)(186003)(6506007)(4326008)(38100700002)(86362001)(2616005)(316002)(53546011)(41300700001)(5660300002)(66946007)(66556008)(66476007)(36756003)(8936002)(8676002)(31696002)(82960400001)(6512007)(54906003)(478600001)(6486002)(6666004)(110136005)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WTRpRXRVcTJOV05YZWdBd1pXOExUdFZpQ3ZDK2hMekhhaUljVXVsakEwbmYv?=
 =?utf-8?B?b014RnNNUTEvRTVuZVFnM3hwWWlzcndKMXdKS3diZVJrdU1aRGp3dG9uVHpN?=
 =?utf-8?B?UWt1a1N0bUw1eld5UFRGVHNlREhNd2tBOCtlcHZjd2M3c2VIOFdWS0s3Z2o0?=
 =?utf-8?B?eXRXeVU5cHgrdEJjVFlOTXdGdVVTQjUydFNsUEhJSWtHeG5GdVZ3SkpGbmtC?=
 =?utf-8?B?dlRMWFNBSzlIWXN0SGMrNkM1VkNzOGw4VlZDNVdySGFnMld6eGZqKytPWjhZ?=
 =?utf-8?B?NFRmS1BPWFRMSkNJaHZjVUlORDIzRE5GS2tBaHJwbjhsYzVhaERRSTc4eTV3?=
 =?utf-8?B?VlpHMHFQVk02bVlzbjY0MkFkMklwdWIramxwRDNwTldFa2tjMGZxaFVGdDRw?=
 =?utf-8?B?ZEtjNzQ1MXFQMz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utf-8?B?U3c9PQ==?=
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	51bmfhkuibT2krvsqwBze0HTj3EvnHsWlP8EQ/QQbXec5NvPjfTYMdq1zSYFltx1Cd+J19QaaWHKnRk9LN5qK7Ch0nXhWHcxWVPsM6fpYJ81zKpAlgBuqJgenYUP37XFtCSTv7HkCeKIekcQHvdtSqBz04cbUuru4p4hv7q45wy3CZjShjVOHjEpjao4ICQpChBAAaM4a9kbpE9acWDENW/kDkUPc9KyfsRcXTqlKwEqGto0YT97/hZPiXNkfuwtmPz1qB7a0TyG7EiUDQjySDabo34CsI4WDbscmx3+rfvy1IKGBqVAhbk/1+WQHfJB8H8DA6Uc8H8EL9sDye8R6bIAzcLbIn2kCOnUkMj6OsbB8J0Ki2XKCMjS47t7Et067M6OTQ91ACk666hOy1CDVY3S+NyZ0YwQxzsr1Nyx24YKwfRX9L+YFEEwFSPE5lcnGaXcXFE4YU5jwtIeXk7tQkR7QXdJE0d03PR7ptceMJKuV4FdPpW/W+mEZtvPQJtpDPFTXNw3I7dO+YxOTfJilnjq2ydrnqKmGS/Ark/xtBI/ntMM8a3Bms5nN4codUgdSsqjQnvEoC5WNrTf0glJonqriK72/inBuOdgpRAGWCBgXfOmwnxgUP4KhwFyOAaZXpxz9l88+N8zrFzdxJB4WJqFSw/Y+LUZWBuDgAVdkcEJWZ1ZeeLzRSnF/WCD+xoDgYvVDeWeIoa0g1Ik7pcWtYW1ozk6xX0nc+JzKSpugQl4p2N5/YvzP/I8MlG0i1yBOeCFO6Yvfklqs5uh9ar5zqnt6yZMut8Jbxdtxsnorh7iP6rEuo4vfj58zMi0WPT4tEAqX4BsK7NQsEO0Qg1VbKbzftrbJXq3l+4CNM6FhUA=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 08cc95e2-2fc9-473f-e45d-08db8eb5f2b8
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 15:27:11.8726
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Yl1nIY1t9tQrjbs53ueUU2SacZToTiIWbLhTS5FtABTR1ffrTKhiw5Vh+hgFPeERIUgLWyE6a5y3D72tSGQE1bVOarnF9Sa+oEDnoq03QMU=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR03MB5833

On 27/07/2023 4:25 pm, Jan Beulich wrote:
> In the latter case the variable altogether is then unused and hence gets
> dropped, eliminating a Misra Rule 5.3 violation. I'm afraid I mistakenly
> introduced both assignments in 57a57465daaf ("x86/HVM: use available
> linear->phys translations in REP MOVS/STOS handling"), likely as a
> result of some re-work on the patch.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:31:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:31:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571197.894482 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2xb-0007N1-RF; Thu, 27 Jul 2023 15:31:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571197.894482; Thu, 27 Jul 2023 15:31:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP2xb-0007Mu-Od; Thu, 27 Jul 2023 15:31:27 +0000
Received: by outflank-mailman (input) for mailman id 571197;
 Thu, 27 Jul 2023 15:31:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qP2xb-0007Mo-2x
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:31:27 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2062b.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a5e44fdb-2c92-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 17:31:25 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU2PR04MB9051.eurprd04.prod.outlook.com (2603:10a6:10:2e6::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 15:31:23 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 15:31:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a5e44fdb-2c92-11ee-b248-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hWR8bnuDmMHwQAXEn6wWTpMxqwRxz1UdqkeVX05EFdBhHHkg1ljvwp8DTscZcOykpuE9Jg19pcq97PQVYEGDWY3XOcXKpZwik+h5OUYU7OOKcSgBMvkj+NEGEE4LThpHNEfphISX7eGO++2EfBSlK3tbihCPfmmEoaFUb09pvi/cHzAcxDlz3jenZ0xgk4aCqRaqzyJ1fGxBbx+GUxOWlqo6t6Dlg0J4jDUdpsNSlRA2GvicaC4wbBZ3BjOPso1PdzHNH6k+n+yRmpOfI5qm4emXfsR77YoWjFfgcQH9Xg2V9usH9/6LblMmG8zX9jCpVD2WZlPwwMB7/81nFL/5PQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=M9dleTywZq3fAzH8saLveL7a84hScw/lpvlbTNpB+ec=;
 b=TEoobtxTuXPGBVI7GFcJSODP8qtQrefaFxSSM0D6lnG5witRQLgwrlvf8vGPahuTrp9WNrmSD7ZgmG3fKl3FYEL3qD3LkrWS5FCflSZq1Jrxlnd3w19tDtisqyY63aNSt4DQcpTorjD8rx7Gpa02/rrZvaQkrW+O65f9qmR99xF04nWsTiSA8vcdDwZEMRnv75r9gg3NwHWS3RYnQ3GQBKSMRmQ7UzZotQExRg2WWD6KO5gJVqtXKZzuDHp1d8vMNZSYw3ew7i+G+TpnMAAMZG+rwL7UB+6vSOUo+txspp690Cw/E3n9QMy9TRnyzCE28Q5Li5GZeQ6wCdlQXz79Bw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=M9dleTywZq3fAzH8saLveL7a84hScw/lpvlbTNpB+ec=;
 b=aogAX89AElXd9+vubwv9ljRRP0XGG5jSfqqHkCGZDOiGXcciCmsmKAA+FBMAeY+b6tpTPl3zC3nOixpIFCfKSVRjeosrac0nHuco7IDac9nEeVi6Drj2Itof9PLCWNaCxfqyl6yx1xTJwyR6EHtPUTn7JFNYtStoUoWCzLUqSR9b4nCbfBAdcFfyONlM53GAnlQ/yqN9dUodjFgARyM3Wg/mXm+tmHEiDC+bO/zvnQJWqYw/AwX++izHSVPu1yDsyqpbL+CZAOpZGK7bT++U+cLMzm48PR/Cv+MP8WJ31DjTW7dKlAGecGaQqJqGQo6yWmTqnaBp9EQq5liHC7txjA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ce404df8-eaf4-327b-e858-c5c65c13c5d0@suse.com>
Date: Thu, 27 Jul 2023 17:31:20 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH 2/4] x86/emulate: move a variable declaration to
 address MISRA C:2012 Rule 5.3
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Paul Durrant <paul@xen.org>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1690449587.git.nicola.vetrini@bugseng.com>
 <bc3a28abf9f00bf67cf5ee64bd89e7d38e321c06.1690449587.git.nicola.vetrini@bugseng.com>
 <9db05529-b4ed-89c0-a140-118c0ccf44bb@suse.com>
 <baaed0c1-2324-86ab-a6a4-6721dc67243e@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <baaed0c1-2324-86ab-a6a4-6721dc67243e@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0140.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9e::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU2PR04MB9051:EE_
X-MS-Office365-Filtering-Correlation-Id: 4a7701cc-3b13-4fa0-eae3-08db8eb6888b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	9N/nOHK3OwNxGs0LlUuitgMv8tZMD+PMwUP82nEMszHoTPU1KwwdqFOwcu6+P+QLYBiEcGQe7e7/IldBVGDIhB09T+08/dei20x+jB83SFphHIzM8QMTsjvdcFjlo2gj3dPw+vbyo9z5e4drU3Vz1+nayAJAoNIWPRZLos9DBAj6NMMSLhG8Trh5PJqi9WqirkT1nUZLuB6paMz0TAxZLfCR19SrJI0z5uQey1o1G1S4aN6aCNFG4/0xmfNEH8HqdIEy0lnWypwS/8DwdZjwCUzDkoPI1dio74fLrqFlkrOrW5zu8qJcc7uG+JA5F9NKMkNDRIkjtPo0dHzX+TONYqRbNgC5MwYcQLnl7+Wunpk5/FTPPK/HykdZvd1pfkQe5kLYLoDbPJ7AVjVEo4sqC9RvQhMA5xT4hn49bLx8L+jWPSOwYcWlIHZMtVxUziDr4ohNoRovIF/QQDnVTSBF1PYxxm5mDDZMdoXFsjQ4ZVNo0iyAUo5a5u79HthfT4sizGh7utpsSwEigsYlBJBA1GYirb3CG/37sfsGhKHFxi2XymS1BlAu1+NzeDLyVHuW5HHnFQDokFLhmPz8auAl5mf34p3S/KoH0gmzLIBxwIPe63guWESbTLoXnDqaL4VlPSmtkmmunW+h662v4TGuIw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(376002)(346002)(396003)(39860400002)(451199021)(6486002)(478600001)(53546011)(26005)(6506007)(6512007)(6916009)(4326008)(38100700002)(54906003)(66476007)(66946007)(66556008)(186003)(31686004)(2616005)(5660300002)(7416002)(316002)(8936002)(8676002)(2906002)(41300700001)(66899021)(86362001)(31696002)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?c25Hc1VlTmQ0NGNNVUJKeWMrTGNmSG5ES1pjeGVKbkljRUFqK2RPN1VQRjlz?=
 =?utf-8?B?TjZ0YVpTNWpEMDJpc05NMUE4R2d5VWZVODUwMk1Zdno4WDhLVGthQTZlVWVI?=
 =?utf-8?B?ai80UUZYYnNMUXJxNFQ1NFVNMnU4Q2xIeEREamppTmh6Z0t3eEttV2lKcDc0?=
 =?utf-8?B?citvb2FGd1FOMk1TUmxqakxmZ2lPQllwL1BPRWFXSmppVGdweGhaOGpnMGRl?=
 =?utf-8?B?NHlGaXdsNG1PYkN4WkJLNUlLbGMxdkVXNndONDQwcWpmT1NSOERaNzBvcnFH?=
 =?utf-8?B?REdJNTZnU1BWVmhLcVYxR3l2TXh6UkRWZmxQbGowalpVQXhmNVRWT3pmeTY2?=
 =?utf-8?B?MWV3dEhrOG9XazJVcmZ4MStVUmI3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7sQhmczrx+P8x5T6?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4a7701cc-3b13-4fa0-eae3-08db8eb6888b
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 15:31:23.0642
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: HPoJ9JCmv5nLTP+vxp+ZBNbTwugGxB1l2DJO0FJIft+qv/vSHH/Vj0ZQAQtShppNDRzJ2FAXOjgPiLalNVkgBA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9051

On 27.07.2023 17:22, Nicola Vetrini wrote:
> 
> 
> On 27/07/23 17:06, Jan Beulich wrote:
>> On 27.07.2023 12:48, Nicola Vetrini wrote:
>>> --- a/xen/arch/x86/hvm/emulate.c
>>> +++ b/xen/arch/x86/hvm/emulate.c
>>> @@ -2024,15 +2024,15 @@ static int cf_check hvmemul_rep_stos(
>>>   
>>>       switch ( p2mt )
>>>       {
>>> -        unsigned long bytes;
>>>           char *buf;
>>>   
>>>       default:
>>>           /* Allocate temporary buffer. */
>>>           for ( ; ; )
>>>           {
>>> -            bytes = *reps * bytes_per_rep;
>>> -            buf = xmalloc_bytes(bytes);
>>> +            unsigned long bytes_tmp;
>>> +            bytes_tmp = *reps * bytes_per_rep;
>>> +            buf = xmalloc_bytes(bytes_tmp);
>>>               if ( buf || *reps <= 1 )
>>>                   break;
>>>               *reps >>= 1;
>>
>> This wants dealing with differently - the outer scope variable is unused
>> (only written to) afaics. Eliminating it will, aiui, address another
>> violation at the same time. And then the same in hvmemul_rep_movs(), just
>> that there the variable itself needs to survive. I guess I'll make a
>> patch ...
> 
> Wouldn't this code at line ~2068 be possibly affected by writing to 
> bytes, if the outer variable is used?

Which outer variable? I'm suggesting to drop that (see the patch that
I've sent already).

Jan

> /* Adjust address for reverse store. */
> if ( df )
>    gpa -= bytes - bytes_per_rep;
> 
> rc = hvm_copy_to_guest_phys(gpa, buf, bytes, curr);
> 
> You're right about the other violation (R2.1)
> 



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:34:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:34:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571201.894492 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP30a-00080f-D9; Thu, 27 Jul 2023 15:34:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571201.894492; Thu, 27 Jul 2023 15:34:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP30a-00080Y-AJ; Thu, 27 Jul 2023 15:34:32 +0000
Received: by outflank-mailman (input) for mailman id 571201;
 Thu, 27 Jul 2023 15:34:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qP30Y-00080E-JK
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:34:30 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on060b.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::60b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 13c108b4-2c93-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 17:34:30 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU2PR04MB8629.eurprd04.prod.outlook.com (2603:10a6:10:2dc::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Thu, 27 Jul
 2023 15:34:27 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 15:34:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 13c108b4-2c93-11ee-b248-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ca0HOO+pi0E2NpBixc8vErSV3SUEc8UVjruD2GP3yVXOwl9Ry5UQtAdjZjKzeSwaQaHp+y3xByha/6m7TWInjZX+7M4KgQNUKpYm6P/lVnJG79vmQQ1bpzuuTUuWeK3p0R/U/nn8StJsfznQRgIhN/51/HxDRiUyxZSZthj3z57yy9Z6AVjYTT5gvvmHv71g52KXtsSJO00xP8Jpyx79FjvTXMljTqYy7Cc9xDUPdAJ3DCnDRoUeDYY6oJ41zZInlwJXQJX2Dsr+dF2uRLQZc4FAnzs4MqgjrBV2u7+x873V77371JQSbGlIl9kqv/+7cUaSPnfXkLRJ5TSWjeP8Kg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Z3BUIXDKbZGMdrwCQWh/VnR8gpfhh3HNbYZgfIl6PV8=;
 b=lCty4YEBaROnrmoPlNJBCGQkCSIpOX8GtSkBInHA6CyVgfDasOWcu8L25BQn5SIdJehWdj8EaSgoDt9ywDyi7pwYT1hadkhUhtTjBQo/+20RYJIwz3sDp7uMU8D9T6XgJDntIQl40uCxGPNsDbbck2IGakrDrzrHovcUf65EFiLcreJrBCKCzUTrdNvNKZbYOKmtBdekiqqfEF8sjX7g/DUNzoBjZ+dB1GncbANg4MRQ296PslerZzzXDZvkDdT38Kw1Jns3cyOClWOhr7JorgSFEFyc7USUs/YbJ7CgPMDfGrTxwI+WAqpZySrmzzamg5Dwrya+VeqLVu7cydhqMQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Z3BUIXDKbZGMdrwCQWh/VnR8gpfhh3HNbYZgfIl6PV8=;
 b=eTfMyOuNf1s1pViHKH8anfh+4Up/YUUtBFHAhJJwTcNUVG9R8xQujcjywDH7PVN3eiWNrV2Gw1zf4FG1DdHQYbpAlyI1iraL8ZFrg6km1rYsdSFSVmXXaxs+zaee6V/oc0aJNt96zwGX/Mnm11Ya4pz3j7k+r1BfJpYDc06LU4mhcsTgGzK7qeUQXeoOJQ4kLTsqhRIfrbtwSPMCC/ilN+EFXs3hm5bnL8dXOs6gTeJAslHx3WXy04caSyeSMtI4JhxLBY7LelsjbZJL1BMSpW35Pqu0mRBrrYp5fouOP0xQ9PDW+FPEjHHJ+mYv/VclyzNov2XyskjBRzG/as+/BQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ae83664b-8e8a-acf2-d045-5ed6742b9e93@suse.com>
Date: Thu, 27 Jul 2023 17:34:24 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH 3/4] x86/mm: mechanically rename variable to avoid
 shadowing
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1690449587.git.nicola.vetrini@bugseng.com>
 <62f4a9e7a19b37c970e52f138a6eeb8f7363b7bc.1690449587.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <62f4a9e7a19b37c970e52f138a6eeb8f7363b7bc.1690449587.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0268.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:b5::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU2PR04MB8629:EE_
X-MS-Office365-Filtering-Correlation-Id: e01a5109-e365-4912-b2e0-08db8eb6f656
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	7n2bmmlHwvZIamJ2UbMCJ2MFMQTRlzYmGc69NooL1MR94uQqbiDw7k2XTu6uclga/Ad3XbfS+2+6dxXEybBjGMQiKzG37xERJnNnzXzrKekx5lJpB5xtx3jADOz+i7DimQDl78R50CyS31z+m/w/6hHtSWG0M8UPT9f4HR/AnvikALVfQgAiF8UhCa8su6HxEHj1/nhYPwAbGZsAkjy33uGoz2+oHTanGs90dChn+PNVLypcn8msyG6tNLpAFd9L7iZpvqoAbbK3my1nqA9VAAs+ztooM8RkdDnxOL4GVsFEciHDgjf/WlzETKzOlNRYvkg3eoN3Uq+/f1DZmBUuk/LyR5NgqsnxEeYpquqnG2Kokm4zlYbaos2U4Svd9haNlCB3hm7RTZYy2o3PE2jHCMvCVsb0tSyyuzJqIbeR9R/Z18eueJl+hcSyl94mAonLGQxQ9jwVBhgl/5MvKup72dJvHl+HDcO3Q16wa5jWcX77fZQtKYa5gPDLXEg135kNrpi849pysfb15r5OAwg6/QSHjEz/Wj6mWcyepicYJwWzZCVb02VcaA7cdoc/uvAVrImQKId0cMxKV1MkjJuRMdfQs6QeGwZQYiamZDinCOF1qSRkypagn3x+CDIZoQSbYnlE1ZA/xQCXvZD2m+NujQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(366004)(136003)(396003)(376002)(346002)(451199021)(31686004)(186003)(6666004)(6486002)(6512007)(54906003)(478600001)(86362001)(31696002)(36756003)(26005)(4744005)(41300700001)(6916009)(2906002)(6506007)(2616005)(53546011)(66556008)(66476007)(38100700002)(316002)(5660300002)(8936002)(4326008)(66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YZU1ickxUNEk2YWs0K04vS0djVG51S0grTlBL?=
 =?utf-8?B?bFhHUU9aQXhOMUlueDU1eEVVSndGaVZVV041VktteGJjcUxNTzR2UzZJVTJO?=
 =?utf-8?B?VjZzdG9ienpPbTROREJhUS9Ea0U2TDI3RTZheVlrRSt5a1lidzh2cG01K2dl?=
 =?utf-8?B?VFFiVEJudzY1WGJMck1RamJiMVhKMXh5VlhSaUt4TTloNGFQdFp6L1Z0aGNE?=
 =?utf-8?B?eU5rekc2M2F3WWYyYXdmeTFzNzFuTEp5SVBwRmFxY1ZaRnZzRHBLTDZGd3VM?=
 =?utf-8?B?UEVrRVUzQmxTanNVcjZ1RDBzRjRXVjczNFFKd2k0azhJSzdTNmFNaUh3ZTJz?=
 =?utf-8?B?ZWdKamhFSVF5OWdiOVJ6YWpTdG1NaFc3L1ZBNlQyeTFuL1cySDB2M2xzempU?=
 =?utf-8?B?REl1S1dUSGtRWkNqSWd1R2lrS1VVenBnM2VoNm9PeHVoNVMwWXhweTBqVEo4?=
 =?utf-8?Q?9OdeYXdB1hyAdO2bF71gI8jhJ?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e01a5109-e365-4912-b2e0-08db8eb6f656
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 15:34:27.2915
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: gs+4MgeeGAWI/zminBWB9zGUgIR8qyO9YwBZN7geNGaCnGbTUaNDD0NIPgrTbm77+/lYjNau5woVG1T4XqX1Uw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8629

On 27.07.2023 12:48, Nicola Vetrini wrote:
> The rename s/p2mt/t/ is done to avoid shadowing the same declaration
> in the enclosing scope.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
> Is the semantics of the function altered if the inner declaration
> is removed entirely?

No, that's what should be done. It's an output only for get_gfn().

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:35:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:35:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571203.894502 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP31o-00008O-M8; Thu, 27 Jul 2023 15:35:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571203.894502; Thu, 27 Jul 2023 15:35:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP31o-00008H-JH; Thu, 27 Jul 2023 15:35:48 +0000
Received: by outflank-mailman (input) for mailman id 571203;
 Thu, 27 Jul 2023 15:35:46 +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
 <SRS0=mGGP=DN=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qP31m-00007c-Qu
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:35:46 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4043b878-2c93-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 17:35:44 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.161.207.213])
 by support.bugseng.com (Postfix) with ESMTPSA id 4A7614EE073F;
 Thu, 27 Jul 2023 17:35:43 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4043b878-2c93-11ee-8613-37d641c3527e
Message-ID: <d578b45c-db4f-4176-3f8f-a8380011f668@bugseng.com>
Date: Thu, 27 Jul 2023 17:35:42 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH 2/4] x86/emulate: move a variable declaration to
 address MISRA C:2012 Rule 5.3
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Paul Durrant <paul@xen.org>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1690449587.git.nicola.vetrini@bugseng.com>
 <bc3a28abf9f00bf67cf5ee64bd89e7d38e321c06.1690449587.git.nicola.vetrini@bugseng.com>
 <9db05529-b4ed-89c0-a140-118c0ccf44bb@suse.com>
 <baaed0c1-2324-86ab-a6a4-6721dc67243e@bugseng.com>
 <ce404df8-eaf4-327b-e858-c5c65c13c5d0@suse.com>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <ce404df8-eaf4-327b-e858-c5c65c13c5d0@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 27/07/23 17:31, Jan Beulich wrote:
> On 27.07.2023 17:22, Nicola Vetrini wrote:
>>
>>
>> On 27/07/23 17:06, Jan Beulich wrote:
>>> On 27.07.2023 12:48, Nicola Vetrini wrote:
>>>> --- a/xen/arch/x86/hvm/emulate.c
>>>> +++ b/xen/arch/x86/hvm/emulate.c
>>>> @@ -2024,15 +2024,15 @@ static int cf_check hvmemul_rep_stos(
>>>>    
>>>>        switch ( p2mt )
>>>>        {
>>>> -        unsigned long bytes;
>>>>            char *buf;
>>>>    
>>>>        default:
>>>>            /* Allocate temporary buffer. */
>>>>            for ( ; ; )
>>>>            {
>>>> -            bytes = *reps * bytes_per_rep;
>>>> -            buf = xmalloc_bytes(bytes);
>>>> +            unsigned long bytes_tmp;
>>>> +            bytes_tmp = *reps * bytes_per_rep;
>>>> +            buf = xmalloc_bytes(bytes_tmp);
>>>>                if ( buf || *reps <= 1 )
>>>>                    break;
>>>>                *reps >>= 1;
>>>
>>> This wants dealing with differently - the outer scope variable is unused
>>> (only written to) afaics. Eliminating it will, aiui, address another
>>> violation at the same time. And then the same in hvmemul_rep_movs(), just
>>> that there the variable itself needs to survive. I guess I'll make a
>>> patch ...
>>
>> Wouldn't this code at line ~2068 be possibly affected by writing to
>> bytes, if the outer variable is used?
> 
> Which outer variable? I'm suggesting to drop that (see the patch that
> I've sent already).
> 
> Jan
> 
>> /* Adjust address for reverse store. */
>> if ( df )
>>     gpa -= bytes - bytes_per_rep;
>>
>> rc = hvm_copy_to_guest_phys(gpa, buf, bytes, curr);
>>
>> You're right about the other violation (R2.1)
>>
> 

I see, sorry for the noise.

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:36:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:36:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571204.894512 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP321-0000UM-T9; Thu, 27 Jul 2023 15:36:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571204.894512; Thu, 27 Jul 2023 15:36:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP321-0000UF-QE; Thu, 27 Jul 2023 15:36:01 +0000
Received: by outflank-mailman (input) for mailman id 571204;
 Thu, 27 Jul 2023 15:35:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dT6+=DN=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qP31z-0000S2-Or
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:35:59 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 489092e6-2c93-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 17:35:58 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.161.207.213])
 by support.bugseng.com (Postfix) with ESMTPSA id A05274EE073F;
 Thu, 27 Jul 2023 17:35:57 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 489092e6-2c93-11ee-b248-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Tamas K Lengyel <tamas@tklengyel.com>,
	Alexandru Isaila <aisaila@bitdefender.com>,
	Petre Pircalabu <ppircalabu@bitdefender.com>
Subject: [XEN PATCH] xen: change parameter name in monitor_domctl() declaration
Date: Thu, 27 Jul 2023 17:35:50 +0200
Message-Id: <6a25e9d729e85ba5712fd00f9c0514a459bb7631.1690471420.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Change parameter name in monitor_domctl() declaration for
consistency with the corresponding definition.
This addresses a violation of MISRA C:2012 Rule 8.3: "All declarations
of an object or function shall use the same names and type qualifiers".

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/include/xen/monitor.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/monitor.h b/xen/include/xen/monitor.h
index 6b17a93071..713d54f7c1 100644
--- a/xen/include/xen/monitor.h
+++ b/xen/include/xen/monitor.h
@@ -27,7 +27,7 @@
 struct domain;
 struct xen_domctl_monitor_op;
 
-int monitor_domctl(struct domain *d, struct xen_domctl_monitor_op *op);
+int monitor_domctl(struct domain *d, struct xen_domctl_monitor_op *mop);
 void monitor_guest_request(void);
 
 int monitor_traps(struct vcpu *v, bool sync, vm_event_request_t *req);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:42:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:42:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571210.894522 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP38C-0002Hg-J7; Thu, 27 Jul 2023 15:42:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571210.894522; Thu, 27 Jul 2023 15:42:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP38C-0002HZ-GS; Thu, 27 Jul 2023 15:42:24 +0000
Received: by outflank-mailman (input) for mailman id 571210;
 Thu, 27 Jul 2023 15:42:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qP38B-0002HP-RM
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:42:23 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2051.outbound.protection.outlook.com [40.107.13.51])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2d7b75d0-2c94-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 17:42:22 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DBAPR04MB7336.eurprd04.prod.outlook.com (2603:10a6:10:1a9::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 15:41:53 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 15:41:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2d7b75d0-2c94-11ee-b248-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=HmJCbmUO6k0Rna10gg2mFfP5zTDx7IvRV+m5j1jiEExIV55dm4GopBy4OZ2kDk3gRujChNYvBIvwbuqY7X8K5ERq5Xl/c3qJWn2js6719PV0JyBKLY326JLRqj2739js3wmwvCZIAmUzaGEW2uARaICmCNxLdB4dANtDns1JB/3oPd1ydh+xF6l9+gWft+2e28pYngi3QYg72Z9zDv3bF1RFJpmHapfVczwrh69tBL+T4P0lcrbZV5wGF6a28dKJd+uLXxtOUN4C/nKyY4mlp17/LeOxPjiTbaj7ComeL3B0haK9XyBVIvhiHOPqc+QXsYNF8lp5E94hVuwtKZrLkQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=YKVdVXlAIMVHz+hMlPBYJGjGrc/dnOs6dpQqQ4ePrA4=;
 b=ftjqTRXi/ough7uYp26fiWFEvaoyD+Xfv2V/Mwl9vjyw45ob1m0BiEfwturWubUIWuVb0n9MX+ryZJpo/ITEzB3cT9GwA5gazZz8hAuGieXGjZJ6uE+VMgQb7nbs+J8HEWvHzYW+LKYgd0PzmGKJDnlrNU6SIYGojV0+e4qyavTQJRWmyWLqxNuNx1ttRhxouwiOKIhN2QYK+QUrU8TiVL1B9EsCc5Apfm+eoj5/20vHD9c61eR4Kpcx2Skp/iVrzHELbIDq4wSzfNczRqY6HiPOd2Kcf6Xa52T65Vifu1sDwJFltrevD4N5ZzFj3oatEyS3XIjYpsSaNg7O/nOIqw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=YKVdVXlAIMVHz+hMlPBYJGjGrc/dnOs6dpQqQ4ePrA4=;
 b=e+ajWQtzuU/2GnnRp3MAYUd4/k19ykEmAL7qPu6X8BH6FHLpBXVxqpxb8sm4XGGy5cmEYYC0K1EvBExeyWhMiF/MxVC6xVec471CNiRA7pNZ3PWk1FN3XWEYmPqg9qZdkV3K+Dg32UcJfwgO6olDLwPGW2GX9LPvNzHh5lPmCjlOScNHiV5AamGW99BsvWtW5VlPtG7JdDsIHP9sSnYQzWHXV4+wbIbtRjxvBSln5OXdoliZrceZ0I5eOxSYvUG6YFnGK+a3rxRiOmd/F91sVHtbYy0uz3Jy1gnGQg+q3VO0dhyZ+q9WzzajOgi+t9YGXV2AE/Wf/XwVRd6KLrE0MA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <fdd04423-f38d-1575-62e7-4d452e396c51@suse.com>
Date: Thu, 27 Jul 2023 17:41:48 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH 4/4] x86: avoid shadowing to address MISRA C:2012 Rule
 5.3
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1690449587.git.nicola.vetrini@bugseng.com>
 <10606d7429239b5a2b7dffcb22eeb1ce5e73e991.1690449587.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <10606d7429239b5a2b7dffcb22eeb1ce5e73e991.1690449587.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0244.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:af::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DBAPR04MB7336:EE_
X-MS-Office365-Filtering-Correlation-Id: e1396951-5a1a-4316-57f5-08db8eb7fefb
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	mKlxzYIE/Mi2gCZ/L8S7xhQ/4qMkMKg7SqZyfM/726l6GD1GWZeAEzHw+4qRrhf2kF+qxIa82PIMcmLet81xUQVRBL1DX4LM6HviRiw2SqqSx6ueKP4HZn48lYJ5PJaL3W7DzQjN+T3xsnoWIeV1RPhiD2Nztvv9OLIrrQm/BD5OC4hAMxUZRdhvfwFnOyVcUUmVWoFdleqorolFa0gdF/+Z8BpCMligMOoGBz2Kb0Cj9DQTTJ25TGWlhvUeWbD/fjUWyhEr9bN6R7gaCO4eKqPJ4v1RlnBuL0Cn9Fv9bzZ6r7HbWWV3H7qcL3OfLHYkct0SJKKeb3f87yIrv5ieGpCaWfwQK5W9iUKvSJGWRyvvwAkJOC2Vw8+lOEWmQQW1EiGFhRc6ro1nHYl/6YsE+un0IxuVotR/0jb6dQVX7RV22oxqTetu3m5FLK5r0UcAS2l9dEqJ0aDI8sZr09P6HA4ik/dDKLwdg90OT0PkDDzFQ87Boa5TYU/V3R2s9+6URyNQn1Kyne9Fh5d0LEeEbcuehaOSgWdq/Vz1it7rjMXMwRmNoeEJJJcpdFS10CLXOwoJ1Dz9ljUFiijb0VzwrmHhhRQ6cUd/2AVUWKSY1arLRTNTuMlJ3gb4fye5HZCx6iRpJ03jfWJUu+25TPFY1A==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(39860400002)(376002)(136003)(346002)(396003)(451199021)(31686004)(2906002)(86362001)(6486002)(6666004)(38100700002)(36756003)(7416002)(31696002)(2616005)(5660300002)(186003)(41300700001)(8676002)(8936002)(316002)(26005)(6506007)(53546011)(4326008)(66946007)(6916009)(66556008)(478600001)(66476007)(6512007)(54906003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dEdWSEVqMVU4Vkl6M2Q1a3I2dUV0TVZnczR5RDkwSS9zdXdGbnV6bGFRN1ln?=
 =?utf-8?B?dzRYTlB3NzBVM01GTVFGR2ZEQW95TjNzcnJqKzZzamN4Z1RKZVhETzFORERK?=
 =?utf-8?B?ZlNTenNoT0xTU0FBMi9lSzYzZWxzYXpScTd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o1RklvMjQxallhRGxMK2NXL29XZGJpTkNNM2xLUWlTS1VVUUsz?=
 =?utf-8?B?cmo0NmJyTkdTLzhSdE01QkdpcldCVUNpS1l2aDZxbnZ3L1ZhOUtPL0lBOU9E?=
 =?utf-8?B?Mytqbk1FTnh5TmtwWWRhd21ybCs3Uk1TMGNybm9ta0xTc3FHdjA4bGF5Y1dx?=
 =?utf-8?B?aGJIaFVRZTdjdmQzR014NVJ4ajFJMytMN25wcUEwc2FibDJ5ellNTmpiTm8v?=
 =?utf-8?Q?VsRA9CATYaZw4e0iM0WXQxyGW?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e1396951-5a1a-4316-57f5-08db8eb7fefb
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 15:41:53.1672
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: bPcuQX4IXWktcy128fTpoRXZYqAwGocq/4DqCp4tRUWP/cOvMqabxL+MmMzM9SpvmpDYf9o7pRW9lqFKqk32YQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7336

On 27.07.2023 12:48, Nicola Vetrini wrote:
> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
> @@ -1483,7 +1483,7 @@ x86_emulate(
>      {
>          enum x86_segment seg;
>          struct segment_register cs, sreg;
> -        struct cpuid_leaf cpuid_leaf;
> +        struct cpuid_leaf res;

This is too generic a name for a variable with a scope of several
thousand lines. Perhaps just "leaf"?

> @@ -8408,8 +8408,6 @@ x86_emulate(
>          generate_exception(X86_EXC_MF);
>      if ( stub_exn.info.fields.trapnr == X86_EXC_XM )
>      {
> -        unsigned long cr4;
> -
>          if ( !ops->read_cr || ops->read_cr(4, &cr4, ctxt) != X86EMUL_OKAY )
>              cr4 = X86_CR4_OSXMMEXCPT;
>          generate_exception(cr4 & X86_CR4_OSXMMEXCPT ? X86_EXC_XM : X86_EXC_UD);

This change looks okay to me, but I'd like to strongly encourage
you to split both changes. They're of different nature, and for
the latter it may even be worthwhile pointing out when exactly
this duplication of variables was introduced (it clearly would
better have been avoided).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:55:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:55:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571212.894532 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP3LE-00040P-RU; Thu, 27 Jul 2023 15:55:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571212.894532; Thu, 27 Jul 2023 15:55:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP3LE-00040I-OT; Thu, 27 Jul 2023 15:55:52 +0000
Received: by outflank-mailman (input) for mailman id 571212;
 Thu, 27 Jul 2023 15:55:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qP3LD-00040C-Pq
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:55:51 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2072.outbound.protection.outlook.com [40.107.13.72])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0ee6244b-2c96-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 17:55:50 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAWPR04MB9960.eurprd04.prod.outlook.com (2603:10a6:102:38b::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.23; Thu, 27 Jul
 2023 15:55:20 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 15:55:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0ee6244b-2c96-11ee-b248-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=kk3LtYA9rysrsVAVBBPAv4IJMqAYgeZoz542/8yCl6+C6BFj9steHcsOUKvRp1si9Jr423f4jCvTveeIancgx+B6HiU0EAe7LKHGw09/BMuUbWtj7+8KuK3CBH4/Y2OTOGl479rDhDvwzb6H9X9hT+wvLavW1tKAu8qSaf68cJreTXEw8yPDNU1XGsH0a20M+jsAZosLPESWBGxYtIX+VTqL1q8f9tWwjUJ4KWmOl1/1C22yvkPkHo50w5Hp6zZpmX+3YtxNm40Rz2SHjEirzEvtjrozWlefhsJNd8xsKEwzlvAuNa9jiJAu5tN0AGYEJ32g9AgXZywAh0clNhhNMA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=R/7MrVgGIbRAEhSmu3jEXm62MgMPP2+To0KrpjoMiug=;
 b=Bo6KFkNN380ZlwBivvW1t1gjaBVW/tGYGIR2X4FFjT1LW6sjSdLFfxc6Qpg0U0Nk6DsuCX5fFwIp7mnzGrJLoE67mspjAkVIfrlodX/Sqr0/7H5wFS0vlztuMjstmV5pEB1ZhhzM1hpnS0stVD++Ntp59eogIBb1HIuF/5rolI8X05m5/HTl9TrKFCL8ZBEODzoial5PlZEBOtO85ADJFIy7kmZsaT0BNgVOUSvyKGOWl3xQjxLED+Rk+SZm8lKzynTwvsG7ed5GCgkh1Md9uqePv1DeAFJ2JWH54KEBoRb10tfy1VB7LFpA0OHcfvw4qiVhnuIgeijaROu5FwpwiQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=R/7MrVgGIbRAEhSmu3jEXm62MgMPP2+To0KrpjoMiug=;
 b=ldRjQ1xauudkmxRELjEyWb7CrQM7eSuahjGJFgIP05pMSmMDcfibIGbrBEaadnYSlm71k6PqF2mWxLOE0tkYOWpx+YhIYfFkiwjVN486o19Buu+Nr/KE18WByltCyHNgCUWMMqTKtFMmctCTQeKmxZS32vwXzRzd++dA45/xOYefcYYjnJ4Izp7Qe4yFtVVFKVur1qEdRtfP5l9X0GLAVaZZweJoxCY75dDBZztoxim0Lymetw6ruOQUKJUfe9imRNKZ6wdeNYPDYmJVE37ivwwKokcdxoKRL0DZo7iVsmPLV79jXfeDRTThE4j5Jxwuni0E/ytN/M+llmiNaeihxw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <d81326cb-5bb5-0a27-7669-45ac7b4ad0c7@suse.com>
Date: Thu, 27 Jul 2023 17:55:18 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] xen: change names and type qualifiers in
 copy_domain_page() declaration
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <49ce75f6f79f6de3a447f9bfb44e288e689dd8f3.1690470179.git.federico.serafini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <49ce75f6f79f6de3a447f9bfb44e288e689dd8f3.1690470179.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0012.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1d::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAWPR04MB9960:EE_
X-MS-Office365-Filtering-Correlation-Id: d79a02c6-17ff-4539-a3c0-08db8eb9e188
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	tyS8oA5N8TvBivJtgAtasCDxudgf09Xg9W55MNy0nQeHMAfI95Xz/Yt9mC7YDwBATkBAoXcmsUTG8JCGaD1xG22OnQ+DKJ4jeXWQHGML0iIFy6p9MTdySh3dN0qh/1k8DOEuKKUwV+xlEdct6kX5CzmFv7cDHFA1aeo5EI9Iu4D8fzbQ4AfG8YKRfvQShZ1q2wHU1gxVp1sgZF1gznJWVKkJj1jqCL4HHWTA/H9PxqKuTu68TDOTlz9DFa7VZwO6gMo/Ei2aT/FyHZmBCsT5DnJgCsI80HTOfiVttke4G1beNECQ1nd7oFdzwf4Ju6YgQTvI9iKc33+NsJKQlsGKz6YRLcMQCYPiZst+5sSKGBBIHWcVI8XE0M1CxnfnnGExWhi2vKE/klxI3oQZD4v5ElJ3vQBK2Ih3eTfpqoOyVHqrvhuccllKFsL6Eci+po0/cPCgjj1g46JmHx+pEq/VsNkPHnCe3v74qi9Qef29qoH3OGZW4BNeqZhGvz5qUunbpCONZkPnQrnGipmQEYXCqXd9zUPCUmde6ss/kksgxvuopnU709hkE5lWxcEjSOzJKXZ+aJF03VaviWAWAMFKf63sHmPOWpyvNuoWqwOS0k5z2EOxjNQ2WU/nH1WeEBpdl9vo2vCbjvOEzltKXTR/Jw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(366004)(376002)(136003)(396003)(346002)(451199021)(2616005)(478600001)(186003)(31686004)(6506007)(6512007)(8936002)(41300700001)(26005)(6486002)(8676002)(6916009)(66476007)(4744005)(2906002)(4326008)(53546011)(66556008)(86362001)(316002)(54906003)(38100700002)(36756003)(66946007)(5660300002)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-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BxSThzNjBv?=
 =?utf-8?B?cUdoV1l4OUhTbVRNZVZrUTJMTldEZXk4WlE4Vm01ZzdnQnBRQUpZbWpqaXcw?=
 =?utf-8?B?WHYxRUNQZmNWM1Yxa25XWUJxVGZRUG5vaHVyYlZFcllYTDJSNmNYY3piVENW?=
 =?utf-8?B?b3BIVWw1U2lWSm81blFyNU9aSUdsZ2tNMnA1Wk5COFl6dUFYRm4rTDFDUU1M?=
 =?utf-8?B?T0NLVEJ1MytURDEwTHE2UVA1U25Bd0lBU3ZqQnAxR3VHeHkzNWhQYnNiaVNE?=
 =?utf-8?B?Y0JmOHhGb3NVQVNjQ21rTmVxNHRLY1hDaHB0SXlxN2VlQlVJYjhFYTJOakJq?=
 =?utf-8?B?RFAvZHZhbVZOQ2d0VkdPTE0wbHE0aVM0UzdrN3NtQ1N3UHdTOTlXRlUvTkc3?=
 =?utf-8?B?WWZyY2hJQklJY2NRaUNxOXRTeWxTazZUY3B4anF5MHhhZGhrYUlvNkdKQWpI?=
 =?utf-8?Q?YEQGkX/q6RXb6t0bFukOnJeZ0?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d79a02c6-17ff-4539-a3c0-08db8eb9e188
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 15:55:20.8174
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: /7Ed/g+LOtbWKB/PQtteCCWjxm7hZDNDFFHt/WsQzRVLTdxUqZtjYedNPaE9Z59jwMZbSdRBvHhzyc2rTwG29g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9960

On 27.07.2023 17:04, Federico Serafini wrote:
> Change names and type qualifiers of parameters in copy_domain_page()
> declaration to keep consistency with the corresponding definition.
> This addresses violations of MISRA C:2012 Rule 8.3: "All declarations
> of an object or function shall use the same names and type qualifiers".
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Thu Jul 27 15:58:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 15:58:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571215.894541 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP3Ns-0004iZ-C6; Thu, 27 Jul 2023 15:58:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571215.894541; Thu, 27 Jul 2023 15:58:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP3Ns-0004iS-9S; Thu, 27 Jul 2023 15:58:36 +0000
Received: by outflank-mailman (input) for mailman id 571215;
 Thu, 27 Jul 2023 15:58:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mGGP=DN=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qP3Nq-0004iE-Ez
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 15:58:34 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6fde7791-2c96-11ee-b248-6b7b168915f2;
 Thu, 27 Jul 2023 17:58:33 +0200 (CEST)
Received: from [192.168.1.100] (unknown [37.161.207.213])
 by support.bugseng.com (Postfix) with ESMTPSA id D69854EE073F;
 Thu, 27 Jul 2023 17:58:30 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6fde7791-2c96-11ee-b248-6b7b168915f2
Message-ID: <da8ca9ee-d60b-a765-35ff-944b51f940f7@bugseng.com>
Date: Thu, 27 Jul 2023 17:58:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH 4/4] x86: avoid shadowing to address MISRA C:2012 Rule
 5.3
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1690449587.git.nicola.vetrini@bugseng.com>
 <10606d7429239b5a2b7dffcb22eeb1ce5e73e991.1690449587.git.nicola.vetrini@bugseng.com>
 <fdd04423-f38d-1575-62e7-4d452e396c51@suse.com>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
In-Reply-To: <fdd04423-f38d-1575-62e7-4d452e396c51@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 27/07/23 17:41, Jan Beulich wrote:
> On 27.07.2023 12:48, Nicola Vetrini wrote:
>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>> @@ -1483,7 +1483,7 @@ x86_emulate(
>>       {
>>           enum x86_segment seg;
>>           struct segment_register cs, sreg;
>> -        struct cpuid_leaf cpuid_leaf;
>> +        struct cpuid_leaf res;
> 
> This is too generic a name for a variable with a scope of several
> thousand lines. Perhaps just "leaf"?

It can also be defined inside the switch clause, since it has no other 
purpose than store a result.

> 
>> @@ -8408,8 +8408,6 @@ x86_emulate(
>>           generate_exception(X86_EXC_MF);
>>       if ( stub_exn.info.fields.trapnr == X86_EXC_XM )
>>       {
>> -        unsigned long cr4;
>> -
>>           if ( !ops->read_cr || ops->read_cr(4, &cr4, ctxt) != X86EMUL_OKAY )
>>               cr4 = X86_CR4_OSXMMEXCPT;
>>           generate_exception(cr4 & X86_CR4_OSXMMEXCPT ? X86_EXC_XM : X86_EXC_UD);
> 
> This change looks okay to me, but I'd like to strongly encourage
> you to split both changes. They're of different nature, and for
> the latter it may even be worthwhile pointing out when exactly
> this duplication of variables was introduced (it clearly would
> better have been avoided).
> 

I did it this way because they are the only violations of R5.3 left in 
this file (among those not subject to deviation). By splitting you mean 
two patches in this series or a separate patch just for this change?

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 16:04:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 16:04:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571218.894551 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP3TX-0006jP-01; Thu, 27 Jul 2023 16:04:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571218.894551; Thu, 27 Jul 2023 16:04:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP3TW-0006jI-Tg; Thu, 27 Jul 2023 16:04:26 +0000
Received: by outflank-mailman (input) for mailman id 571218;
 Thu, 27 Jul 2023 16:04:25 +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 <SRS0=m5Ij=DN=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qP3TV-0006jC-Df
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 16:04:25 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2060f.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::60f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4097aa4a-2c97-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 18:04:23 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM8PR04MB7411.eurprd04.prod.outlook.com (2603:10a6:20b:1d8::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 16:04:21 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 16:04:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4097aa4a-2c97-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JdZMsRFUt/xVHmN1kfruXLy+jK9QzAthJTRj2CqegqI2r/3ag/2wtwyWFw4ui9w9gb9P6gTeTr1gkB+yWR3gqAKF9LLdZDeSU1vPB0s5Hwd6gxu1OSkvD0l6ewtblDv9XOVaVbjAIH139CKP3mANKgwhYaLzZYm6/kFGDWbxveKk4jPpoqe6S2HUXa+GqTR8+IW1GGoGGUxzPaQs1AgsjjVd4LvvOuVBQeeeT5JWZBRPvOAvzG75iJ/iINfhvix+apVoKM1zOH9/VtK1ZnDsQ3SndO3I/j8FWeYB36W4ELveNzJIQn0iz51PAIdyRw5erW76qOzxzVQM0RHptHhEMQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=xEF8FQiQ+SO2NIYaQhyQWbriRw5ddlRxpsLEwF3/2wc=;
 b=A1BISJVRzp/4GvSSGqLQelX9fMhySoQLqtxgkeIt7RUAF10gc85J0exow1fxSsrmSQIQXA2COFpioX8obPlro0TyUYrWfr3UTzWcJFZQnSdLvB5wHxqn+os8c5unDeBpAfLMFUhtRwJIQJXEzZgYH6tpkgFmljIv0bLV1Sr6nNRjNUkO9MrJnKDQZl59YpvMFtqAaoMwAz9ZTaNv3gYV/7Yc83Hnca1rAwoFrCH0qiida97YH/3Y5lYWZfMRVfMjzYWq+wtPDG4+0UHvh7dPJI4sfPaZ5YWmJncfo06R+NUNJS3uFxvtRg/WnepmWbvrj5x1vnKcRVv2x8fxA48lAg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=xEF8FQiQ+SO2NIYaQhyQWbriRw5ddlRxpsLEwF3/2wc=;
 b=goNUVHeQXe7wo7YlOPcHL4BQ6b5bS+hai3YPg+STLTy7ZijgeUu1VWv7lrwal4Fwzr2r+YTUgPuUBxr4e74Lhkl8jOcxTsV7piH8zme/CM0tZQmrM447Y836ppH87mw9AalG3v5rMkAJDCgGu0QRszuh09QST6ga0QTSPFpgRhkQUNYQNpLGL+4KzV4VdT3po4p0aDGs04qks35LZYi2huihM29u1tW8oQwMZQwzGq66sSqRJk5DFsIzQljzRaIDkCqEk9DrcVpdpaAF1YmeCMUi8LTXqmqiYNCMYefKGVtUkekI6HkXG3VYq0Uh1q2XjLtwxqjgDxwlW/KLwiPZMQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <634aea51-619d-b86a-2a6d-9c2794f4fd55@suse.com>
Date: Thu, 27 Jul 2023 18:04:19 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH 4/4] x86: avoid shadowing to address MISRA C:2012 Rule
 5.3
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1690449587.git.nicola.vetrini@bugseng.com>
 <10606d7429239b5a2b7dffcb22eeb1ce5e73e991.1690449587.git.nicola.vetrini@bugseng.com>
 <fdd04423-f38d-1575-62e7-4d452e396c51@suse.com>
 <da8ca9ee-d60b-a765-35ff-944b51f940f7@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <da8ca9ee-d60b-a765-35ff-944b51f940f7@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0196.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ad::18) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM8PR04MB7411:EE_
X-MS-Office365-Filtering-Correlation-Id: 9dbe12a8-928e-4849-0e9f-08db8ebb23d1
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Eujl3P9LmwdKlwGhI4BqvVb+1DF8dzzdBEXoBhXPBQM5VJAwAj+aUXFMg+F7mH6hSv6/1nBDmzKa7/gV8TSZK1yGZckVnejIKy/RvqY0rTI1Dsl5wOY0bBtiJy0eMCCDGNXRuFS/U49Uv23QXlAjmh8tDbnHUX54CADE0bE+rZ2m7pH5yt8L7AOaJsr9C5O0PENdYmxLThAW1FOBuC92sP2IOxltcMqkvDKdCROUME2KG/UAWURWN5Eso695EDEx1EWW5r+eP+CVRQS7/cPOWqUJ2HeqeqLtP00LVlCoVs5Pkac7MLR8vXcujJemA+TbbkqGbd2c3FdgEe2fBZzWbhu6gYCnwL4IbLflAjAJ4H4jC0ncnhWHfBANQ6WXAAsb9BLrMByBTdjD/Ee8l4Gut2ZCjadgGpE/sGHUlDmjsaRP22QUQDh6ZeAesOyBHtRtwMCmL6J6mzTHikVBL/frAUylRpZNLK3YWW6QJINO1be3EXFX1r76aX3EbedHLx2DFgJ1i92tzdQ2T9+/XkOTKS8ANhGeE8E4ak9MbvxZqShLv2pkyFg0KIKdY6x/WF/jci7xGEVFDXbxYO8r+xrrocGc1X14AdIsUEj2vxcW7K/DJD5CcyxLQ/2QwQIHwuB1bZ+NbkGTEqC4FRWOEwXMPQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(346002)(136003)(376002)(39860400002)(451199021)(6486002)(54906003)(478600001)(6512007)(26005)(53546011)(186003)(6506007)(2616005)(66556008)(2906002)(66476007)(4326008)(316002)(8676002)(6916009)(8936002)(41300700001)(7416002)(5660300002)(66946007)(38100700002)(86362001)(31696002)(36756003)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cmNxbnc4WTNGUWFXRlR1ZHBTNkR1T1pMTTRkQkhoZ0ZNdmFRNEUxL3Q3VjUr?=
 =?utf-8?B?T1h1Vmp5akIvMmoxTFR5WGY2dTcraGpXRXMwU09Xc21uMmYzUkx1VkZvS3pv?=
 =?utf-8?B?Ni9MS1ZYVDZZeWJTbVFnSjg1cCttTFNSOGR6VkFEYUM1c0FqZmg5K2JXdi80?=
 =?utf-8?B?OFVLdEZQT1ZtVnQ3WUJMajdNR29BQkdkR0kySmhVYU9CbjQwTmJiVzFRekhi?=
 =?utf-8?B?cWJDY3M5Y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f-8?B?THB1VVBzU3h6Tng3cmtPenRobWxmWlRKTnVCZFQ0RnBNNTJOQ2M3UzdZODhY?=
 =?utf-8?B?UzR5cWJiS1hjMmhkbkhTTlFLak5XY2I0MFkzZ2xvVko0amFZVFhnM056clFG?=
 =?utf-8?Q?LhNZPw2i6c/5ca8YAWaz4QJqR?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9dbe12a8-928e-4849-0e9f-08db8ebb23d1
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 16:04:21.5157
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: iAx7ngLoE9e/86YFw9FKxJdEAYhKU0gT0pcpvTgxO4mPhqBI3ZyeqO00HAbpjxKn/mtDINzzhsYNIQu2GfAk4Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7411

On 27.07.2023 17:58, Nicola Vetrini wrote:
> 
> 
> On 27/07/23 17:41, Jan Beulich wrote:
>> On 27.07.2023 12:48, Nicola Vetrini wrote:
>>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>>> @@ -1483,7 +1483,7 @@ x86_emulate(
>>>       {
>>>           enum x86_segment seg;
>>>           struct segment_register cs, sreg;
>>> -        struct cpuid_leaf cpuid_leaf;
>>> +        struct cpuid_leaf res;
>>
>> This is too generic a name for a variable with a scope of several
>> thousand lines. Perhaps just "leaf"?
> 
> It can also be defined inside the switch clause, since it has no other 
> purpose than store a result.

That would be more code churn, though.

>>> @@ -8408,8 +8408,6 @@ x86_emulate(
>>>           generate_exception(X86_EXC_MF);
>>>       if ( stub_exn.info.fields.trapnr == X86_EXC_XM )
>>>       {
>>> -        unsigned long cr4;
>>> -
>>>           if ( !ops->read_cr || ops->read_cr(4, &cr4, ctxt) != X86EMUL_OKAY )
>>>               cr4 = X86_CR4_OSXMMEXCPT;
>>>           generate_exception(cr4 & X86_CR4_OSXMMEXCPT ? X86_EXC_XM : X86_EXC_UD);
>>
>> This change looks okay to me, but I'd like to strongly encourage
>> you to split both changes. They're of different nature, and for
>> the latter it may even be worthwhile pointing out when exactly
>> this duplication of variables was introduced (it clearly would
>> better have been avoided).
>>
> 
> I did it this way because they are the only violations of R5.3 left in 
> this file (among those not subject to deviation). By splitting you mean 
> two patches in this series or a separate patch just for this change?

Separate or within a series doesn't matter. Just preferably not in
the same patch. (And btw, if you split larger patches more, some of
your changes may also go in more quickly. Yet of course this shouldn't
get too fine grained.)

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 16:10:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 16:10:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571222.894562 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP3ZF-0008IB-KN; Thu, 27 Jul 2023 16:10:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571222.894562; Thu, 27 Jul 2023 16:10:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP3ZF-0008I4-H4; Thu, 27 Jul 2023 16:10:21 +0000
Received: by outflank-mailman (input) for mailman id 571222;
 Thu, 27 Jul 2023 16:10:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dT6+=DN=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qP3ZE-0008Hy-PB
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 16:10:20 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 14c99a2c-2c98-11ee-b24a-6b7b168915f2;
 Thu, 27 Jul 2023 18:10:19 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.161.207.213])
 by support.bugseng.com (Postfix) with ESMTPSA id 99D754EE073F;
 Thu, 27 Jul 2023 18:10:17 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 14c99a2c-2c98-11ee-b24a-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH] xen/notifier: address violations of MISRA C:2012 Rule 8.3
Date: Thu, 27 Jul 2023 18:10:10 +0200
Message-Id: <d362ef56c8c31bcca47d71a430879f087d9a9d04.1690474136.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Change parameter names in function declarations to be consistent with
the corresponding definitions. This addesses violations of MISRA C:2012
Rule 8.3: "All declarations of an object or function shall use the same
names and type qualifiers".

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/include/xen/notifier.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/xen/notifier.h b/xen/include/xen/notifier.h
index 3d6017d4f7..51453c1552 100644
--- a/xen/include/xen/notifier.h
+++ b/xen/include/xen/notifier.h
@@ -37,9 +37,9 @@ struct notifier_head {
 
 
 void notifier_chain_register(
-    struct notifier_head *nh, struct notifier_block *nb);
+    struct notifier_head *nh, struct notifier_block *n);
 void notifier_chain_unregister(
-    struct notifier_head *nh, struct notifier_block *nb);
+    struct notifier_head *nh, struct notifier_block *n);
 
 int notifier_call_chain(
     struct notifier_head *nh, unsigned long val, void *v,
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 16:19:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 16:19:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571225.894572 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP3hq-0000au-E6; Thu, 27 Jul 2023 16:19:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571225.894572; Thu, 27 Jul 2023 16:19:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP3hq-0000an-BW; Thu, 27 Jul 2023 16:19:14 +0000
Received: by outflank-mailman (input) for mailman id 571225;
 Thu, 27 Jul 2023 16:19:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qP3hp-0000ad-Lw; Thu, 27 Jul 2023 16:19:13 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qP3hp-0001Kv-I1; Thu, 27 Jul 2023 16:19:13 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qP3hp-0000mn-5t; Thu, 27 Jul 2023 16:19:13 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qP3hp-00015z-5B; Thu, 27 Jul 2023 16:19:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=+PzbRLkNn8yIw2EDO9FP1t4KIXRGADNcc0a++OssfAo=; b=U68usy1bpSxHtg6KQnPsayHwse
	lulDvlNigM+YKlD0QrVx8Clf8FxWeY/tkeSb8uPjXFlBEN4GkG67QJdC9tKO7mWEeia0Nt+ZAG6C+
	F6taRIkYuqM+h1wmBde28hUjELWoPFJ0WkvWScV5z1qxHyTPKQdsbFmf9q2vbs9c7FLQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182043-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 182043: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=0400946d532ec41bc5d0bedd3e9ef036308ce623
X-Osstest-Versions-That:
    xen=baa6ea7003868d1a339d06b17fd32d41b851d571
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 27 Jul 2023 16:19:13 +0000

flight 182043 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182043/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  0400946d532ec41bc5d0bedd3e9ef036308ce623
baseline version:
 xen                  baa6ea7003868d1a339d06b17fd32d41b851d571

Last test of basis   182034  2023-07-27 08:02:11 Z    0 days
Testing same since   182043  2023-07-27 13:00:27 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Shawn Anastasio <sanastasio@raptorengineering.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   baa6ea7003..0400946d53  0400946d532ec41bc5d0bedd3e9ef036308ce623 -> smoke


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 16:45:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 16:45:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571230.894592 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP472-0004MH-Oz; Thu, 27 Jul 2023 16:45:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571230.894592; Thu, 27 Jul 2023 16:45:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP472-0004MA-Lb; Thu, 27 Jul 2023 16:45:16 +0000
Received: by outflank-mailman (input) for mailman id 571230;
 Thu, 27 Jul 2023 16:45:15 +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
 <SRS0=k29T=DN=arm.com=peter.hoyes@srs-se1.protection.inumbo.net>)
 id 1qP471-00047I-6J
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 16:45:15 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTP
 id f4d9edec-2c9c-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 18:45:13 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C2C06FEC;
 Thu, 27 Jul 2023 09:45:55 -0700 (PDT)
Received: from e125920.cambridge.arm.com (unknown [10.1.199.65])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6E62C3F5A1;
 Thu, 27 Jul 2023 09:45:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f4d9edec-2c9c-11ee-8613-37d641c3527e
From: Peter Hoyes <peter.hoyes@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com,
	wei.chen@arm.com,
	luca.fancellu@arm.com,
	Peter Hoyes <Peter.Hoyes@arm.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Hongda Deng <hongda.deng@arm.com>
Subject: [PATCH v6 1/2] tools/console: Add escape argument to configure escape character
Date: Thu, 27 Jul 2023 17:44:48 +0100
Message-Id: <20230727164450.77640-2-peter.hoyes@arm.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230727164450.77640-1-peter.hoyes@arm.com>
References: <20230727164450.77640-1-peter.hoyes@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Peter Hoyes <Peter.Hoyes@arm.com>

Dom0 may be accessed via telnet, meaning the default escape character
(which is the same as telnet's) cannot be directly used to exit the
console. It would be helpful to make the escape character customizable
in such use cases.

Add --escape argument to console tool for this purpose.

Add argument to getopt options, parse and validate the escape character
and pass value to console_loop.

If --escape is not specified, it falls back to the existing behavior
using DEFAULT_ESCAPE_SEQUENCE.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Hongda Deng <hongda.deng@arm.com>
---
Changes in v5:
- Add this changelog

Changes in v4:
- Improve validation of the escape_character optarg

Changes in v3:
- Re-add the Reviewed-By tag accidentally removed in v2

Changes in v2:
- Drop the tags intended only for internal use at Arm

 tools/console/client/main.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 6775006488..d2dcc3ddca 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -42,7 +42,7 @@
 #include <xenstore.h>
 #include "xenctrl.h"
 
-#define ESCAPE_CHARACTER 0x1d
+#define DEFAULT_ESCAPE_CHARACTER 0x1d
 
 static volatile sig_atomic_t received_signal = 0;
 static char lockfile[sizeof (XEN_LOCK_DIR "/xenconsole.") + 8] = { 0 };
@@ -77,6 +77,7 @@ static void usage(const char *program) {
 	       "  -n, --num N      use console number N\n"
 	       "  --type TYPE      console type. must be 'pv', 'serial' or 'vuart'\n"
 	       "  --start-notify-fd N file descriptor used to notify parent\n"
+	       "  --escape E       escape sequence to exit console\n"
 	       , program);
 }
 
@@ -174,7 +175,7 @@ static void restore_term(int fd, struct termios *old)
 }
 
 static int console_loop(int fd, struct xs_handle *xs, char *pty_path,
-		        bool interactive)
+			bool interactive, char escape_character)
 {
 	int ret, xs_fd = xs_fileno(xs), max_fd = -1;
 
@@ -215,7 +216,7 @@ static int console_loop(int fd, struct xs_handle *xs, char *pty_path,
 			char msg[60];
 
 			len = read(STDIN_FILENO, msg, sizeof(msg));
-			if (len == 1 && msg[0] == ESCAPE_CHARACTER) {
+			if (len == 1 && msg[0] == escape_character) {
 				return 0;
 			} 
 
@@ -335,6 +336,7 @@ int main(int argc, char **argv)
 		{ "help",    0, 0, 'h' },
 		{ "start-notify-fd", 1, 0, 's' },
 		{ "interactive", 0, 0, 'i' },
+		{ "escape",  1, 0, 'e' },
 		{ 0 },
 
 	};
@@ -345,6 +347,7 @@ int main(int argc, char **argv)
 	console_type type = CONSOLE_INVAL;
 	bool interactive = 0;
 	const char *console_names = "serial, pv, vuart";
+	char escape_character = DEFAULT_ESCAPE_CHARACTER;
 
 	while((ch = getopt_long(argc, argv, sopt, lopt, &opt_ind)) != -1) {
 		switch(ch) {
@@ -375,6 +378,16 @@ int main(int argc, char **argv)
 		case 'i':
 			interactive = 1;
 			break;
+		case 'e':
+			if (optarg[0] == '^' && optarg[1] && optarg[2] == '\0')
+				escape_character = optarg[1] & 0x1f;
+			else if (optarg[0] && optarg[1] == '\0')
+				escape_character = optarg[0];
+			else {
+				fprintf(stderr, "Invalid escape argument\n");
+				exit(EINVAL);
+			}
+			break;
 		default:
 			fprintf(stderr, "Invalid argument\n");
 			fprintf(stderr, "Try `%s --help' for more information.\n", 
@@ -493,7 +506,7 @@ int main(int argc, char **argv)
 		close(start_notify_fd);
 	}
 
-	console_loop(spty, xs, path, interactive);
+	console_loop(spty, xs, path, interactive, escape_character);
 
 	free(path);
 	free(dom_path);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 16:45:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 16:45:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571231.894602 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP476-0004cz-51; Thu, 27 Jul 2023 16:45:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571231.894602; Thu, 27 Jul 2023 16:45:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP476-0004cj-1O; Thu, 27 Jul 2023 16:45:20 +0000
Received: by outflank-mailman (input) for mailman id 571231;
 Thu, 27 Jul 2023 16:45:18 +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
 <SRS0=k29T=DN=arm.com=peter.hoyes@srs-se1.protection.inumbo.net>)
 id 1qP473-00047I-WD
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 16:45:18 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTP
 id f661a770-2c9c-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 18:45:15 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5B3BBFEC;
 Thu, 27 Jul 2023 09:45:58 -0700 (PDT)
Received: from e125920.cambridge.arm.com (unknown [10.1.199.65])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DB9153F5A1;
 Thu, 27 Jul 2023 09:45:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f661a770-2c9c-11ee-8613-37d641c3527e
From: Peter Hoyes <peter.hoyes@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com,
	wei.chen@arm.com,
	luca.fancellu@arm.com,
	Peter Hoyes <Peter.Hoyes@arm.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v6 2/2] xl: Add escape character argument to xl console
Date: Thu, 27 Jul 2023 17:44:49 +0100
Message-Id: <20230727164450.77640-3-peter.hoyes@arm.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230727164450.77640-1-peter.hoyes@arm.com>
References: <20230727164450.77640-1-peter.hoyes@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Peter Hoyes <Peter.Hoyes@arm.com>

Add -e argument to xl console and pass to new escape_character argument
of libxl_console_exec.

Introduce a new API version to support this new argument and advertise
the new functionality in libxl.h

In libxl_console_exec, there are currently two call sites to execl,
which uses varargs, in order to support optionally passing
'start-notify-fd' to the console client. In order to support passing
the 'escape' argument optionally too, refactor to instead have a single
call site to execv, which has the same behavior but takes an array of
arguments.

If -e is not specified, --escape is not passed to the console client and
the existing value (^]) is used as a default.

Update the xl docs.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
---
Changes in v6:
- Fix the new compatiblity functions to use last presented version
- Fix the arguments of the existing compatibility functions

Changes in v5:
- Add this changelog
- Fix comment style in libxl_console_exec

Changes in v4:
- Document xl console -e argument in xl.1.pod.in
- Add changes for libxl API version compatibility

Changes in v3:
- Re-add the Reviewed-By tag accidentally removed in v2

Changes in v2:
- Drop the tags intended only for internal use at Arm

 docs/man/xl.1.pod.in             |  8 +++++-
 tools/include/libxl.h            | 43 ++++++++++++++++++++++++++++----
 tools/libs/light/libxl_console.c | 30 ++++++++++++++++------
 tools/xl/xl_cmdtable.c           |  3 ++-
 tools/xl/xl_console.c            | 10 +++++---
 tools/xl/xl_vmcontrol.c          |  2 +-
 6 files changed, 77 insertions(+), 19 deletions(-)

diff --git a/docs/man/xl.1.pod.in b/docs/man/xl.1.pod.in
index 101e14241d..9ba22a8fa2 100644
--- a/docs/man/xl.1.pod.in
+++ b/docs/man/xl.1.pod.in
@@ -222,7 +222,8 @@ Attach to the console of a domain specified by I<domain-id>.  If you've set up
 your domains to have a traditional login console this will look much like a
 normal text login screen.
 
-Use the key combination Ctrl+] to detach from the domain console.
+Use the escape character key combination (default Ctrl+]) to detach from the
+domain console.
 
 B<OPTIONS>
 
@@ -239,6 +240,11 @@ emulated serial for HVM guests and PV console for PV guests.
 
 Connect to console number I<NUM>. Console numbers start from 0.
 
+=item I<-e escapechar>
+
+Customize the escape sequence used to detach from the domain console to
+I<escapechar>. If not specified, the value "^]" is used.
+
 =back
 
 =item B<destroy> [I<OPTIONS>] I<domain-id>
diff --git a/tools/include/libxl.h b/tools/include/libxl.h
index cac641a7eb..de29f11bc9 100644
--- a/tools/include/libxl.h
+++ b/tools/include/libxl.h
@@ -81,6 +81,15 @@
  */
 #define LIBXL_HAVE_CONSOLE_NOTIFY_FD 1
 
+/* LIBXL_HAVE_CONSOLE_ESCAPE_CHARACTER
+ *
+ * If this is defined, libxl_console_exec and
+ * libxl_primary_console_exe take an escape_character parameter. That
+ * parameter will be used to modify the escape sequence used to exit the
+ * console.
+ */
+#define LIBXL_HAVE_CONSOLE_ESCAPE_CHARACTER 1
+
 /* LIBXL_HAVE_CONST_COPY_AND_LENGTH_FUNCTIONS
  *
  * If this is defined, the copy functions have constified src parameter and the
@@ -790,7 +799,8 @@ typedef struct libxl__ctx libxl_ctx;
 #if LIBXL_API_VERSION != 0x040200 && LIBXL_API_VERSION != 0x040300 && \
     LIBXL_API_VERSION != 0x040400 && LIBXL_API_VERSION != 0x040500 && \
     LIBXL_API_VERSION != 0x040700 && LIBXL_API_VERSION != 0x040800 && \
-    LIBXL_API_VERSION != 0x041300 && LIBXL_API_VERSION != 0x041400
+    LIBXL_API_VERSION != 0x041300 && LIBXL_API_VERSION != 0x041400 && \
+    LIBXL_API_VERSION != 0x041800
 #error Unknown LIBXL_API_VERSION
 #endif
 #endif
@@ -1958,7 +1968,8 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass);
  * the caller that it has connected to the guest console.
  */
 int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
-                       libxl_console_type type, int notify_fd);
+                       libxl_console_type type, int notify_fd,
+                       char* escape_character);
 /* libxl_primary_console_exec finds the domid and console number
  * corresponding to the primary console of the given vm, then calls
  * libxl_console_exec with the right arguments (domid might be different
@@ -1968,9 +1979,12 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
  * guests using pygrub.
  * If notify_fd is not -1, xenconsole will write 0x00 to it to nofity
  * the caller that it has connected to the guest console.
+ * If escape_character is not NULL, the provided value is used to exit
+ * the guest console.
  */
 int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm,
-                               int notify_fd);
+                               int notify_fd,
+                               char* escape_character);
 
 #if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040800
 
@@ -1978,17 +1992,36 @@ static inline int libxl_console_exec_0x040700(libxl_ctx *ctx,
                                               uint32_t domid, int cons_num,
                                               libxl_console_type type)
 {
-    return libxl_console_exec(ctx, domid, cons_num, type, -1);
+    return libxl_console_exec(ctx, domid, cons_num, type, -1, NULL);
 }
 #define libxl_console_exec libxl_console_exec_0x040700
 
 static inline int libxl_primary_console_exec_0x040700(libxl_ctx *ctx,
                                                       uint32_t domid_vm)
 {
-    return libxl_primary_console_exec(ctx, domid_vm, -1);
+    return libxl_primary_console_exec(ctx, domid_vm, -1, NULL);
 }
 #define libxl_primary_console_exec libxl_primary_console_exec_0x040700
 
+#elif defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x041800
+
+static inline int libxl_console_exec_0x041700(libxl_ctx *ctx, uint32_t domid,
+                                              int cons_num,
+                                              libxl_console_type type,
+                                              int notify_fd)
+{
+    return libxl_console_exec(ctx, domid, cons_num, type, notify_fd, NULL);
+}
+#define libxl_console_exec libxl_console_exec_0x041700
+
+static inline int libxl_primary_console_exec_0x041700(libxl_ctx *ctx,
+                                                      uint32_t domid_vm,
+                                                      int notify_fd)
+{
+    return libxl_primary_console_exec(ctx, domid_vm, notify_fd, NULL);
+}
+#define libxl_primary_console_exec libxl_primary_console_exec_0x041700
+
 #endif
 
 /* libxl_console_get_tty retrieves the specified domain's console tty path
diff --git a/tools/libs/light/libxl_console.c b/tools/libs/light/libxl_console.c
index f497be141b..0b7293fe71 100644
--- a/tools/libs/light/libxl_console.c
+++ b/tools/libs/light/libxl_console.c
@@ -52,7 +52,8 @@ out:
 }
 
 int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
-                       libxl_console_type type, int notify_fd)
+                       libxl_console_type type, int notify_fd,
+                       char* escape_character)
 {
     GC_INIT(ctx);
     char *p = GCSPRINTF("%s/xenconsole", libxl__private_bindir_path());
@@ -75,15 +76,26 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
         goto out;
     }
 
+    char *args[] = {
+        p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
+        NULL, NULL, NULL, NULL, // start-notify-fd, escape
+        NULL, // list terminator - do not use
+    };
+    char **args_extra = args + 6;
+
     if (notify_fd != -1) {
         notify_fd_s = GCSPRINTF("%d", notify_fd);
-        execl(p, p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
-              "--start-notify-fd", notify_fd_s, (void *)NULL);
-    } else {
-        execl(p, p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
-              (void *)NULL);
+        *args_extra++ = "--start-notify-fd";
+        *args_extra++ = notify_fd_s;
     }
 
+    if (escape_character) {
+        *args_extra++ = "--escape";
+        *args_extra++ = escape_character;
+    }
+
+    execv(p, args);
+
 out:
     GC_FREE;
     return ERROR_FAIL;
@@ -156,7 +168,8 @@ out:
     return rc;
 }
 
-int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm, int notify_fd)
+int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm, int notify_fd,
+                               char* escape_character)
 {
     uint32_t domid;
     int cons_num;
@@ -165,7 +178,8 @@ int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm, int notify_fd)
 
     rc = libxl__primary_console_find(ctx, domid_vm, &domid, &cons_num, &type);
     if ( rc ) return rc;
-    return libxl_console_exec(ctx, domid, cons_num, type, notify_fd);
+    return libxl_console_exec(ctx, domid, cons_num, type, notify_fd,
+                              escape_character);
 }
 
 int libxl_primary_console_get_tty(libxl_ctx *ctx, uint32_t domid_vm,
diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
index ccf4d83584..67604e9536 100644
--- a/tools/xl/xl_cmdtable.c
+++ b/tools/xl/xl_cmdtable.c
@@ -141,7 +141,8 @@ const struct cmd_spec cmd_table[] = {
       "Attach to domain's console",
       "[options] <Domain>\n"
       "-t <type>       console type, pv , serial or vuart\n"
-      "-n <number>     console number"
+      "-n <number>     console number\n"
+      "-e <escape>     escape character"
     },
     { "vncviewer",
       &main_vncviewer, 0, 0,
diff --git a/tools/xl/xl_console.c b/tools/xl/xl_console.c
index b27f9e0136..5633c6f6f7 100644
--- a/tools/xl/xl_console.c
+++ b/tools/xl/xl_console.c
@@ -28,8 +28,9 @@ int main_console(int argc, char **argv)
     int opt = 0, num = 0;
     libxl_console_type type = 0;
     const char *console_names = "pv, serial, vuart";
+    char* escape_character = NULL;
 
-    SWITCH_FOREACH_OPT(opt, "n:t:", NULL, "console", 1) {
+    SWITCH_FOREACH_OPT(opt, "n:t:e:", NULL, "console", 1) {
     case 't':
         if (!strcmp(optarg, "pv"))
             type = LIBXL_CONSOLE_TYPE_PV;
@@ -45,13 +46,16 @@ int main_console(int argc, char **argv)
     case 'n':
         num = atoi(optarg);
         break;
+    case 'e':
+        escape_character = optarg;
+        break;
     }
 
     domid = find_domain(argv[optind]);
     if (!type)
-        libxl_primary_console_exec(ctx, domid, -1);
+        libxl_primary_console_exec(ctx, domid, -1, escape_character);
     else
-        libxl_console_exec(ctx, domid, num, type, -1);
+        libxl_console_exec(ctx, domid, num, type, -1, escape_character);
     fprintf(stderr, "Unable to attach console\n");
     return EXIT_FAILURE;
 }
diff --git a/tools/xl/xl_vmcontrol.c b/tools/xl/xl_vmcontrol.c
index 5518c78dc6..03971927e9 100644
--- a/tools/xl/xl_vmcontrol.c
+++ b/tools/xl/xl_vmcontrol.c
@@ -643,7 +643,7 @@ static void autoconnect_console(libxl_ctx *ctx_ignored,
     postfork();
 
     sleep(1);
-    libxl_primary_console_exec(ctx, bldomid, notify_fd);
+    libxl_primary_console_exec(ctx, bldomid, notify_fd, NULL);
     /* Do not return. xl continued in child process */
     perror("xl: unable to exec console client");
     _exit(1);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 16:45:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 16:45:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571229.894582 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP470-00047V-G3; Thu, 27 Jul 2023 16:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571229.894582; Thu, 27 Jul 2023 16:45:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP470-00047O-DK; Thu, 27 Jul 2023 16:45:14 +0000
Received: by outflank-mailman (input) for mailman id 571229;
 Thu, 27 Jul 2023 16:45:13 +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
 <SRS0=k29T=DN=arm.com=peter.hoyes@srs-se1.protection.inumbo.net>)
 id 1qP46z-00047I-CB
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 16:45:13 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTP
 id f2903357-2c9c-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 18:45:09 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D8221D75;
 Thu, 27 Jul 2023 09:45:51 -0700 (PDT)
Received: from e125920.cambridge.arm.com (unknown [10.1.199.65])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 820A33F5A1;
 Thu, 27 Jul 2023 09:45:07 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f2903357-2c9c-11ee-8613-37d641c3527e
From: Peter Hoyes <peter.hoyes@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com,
	wei.chen@arm.com,
	luca.fancellu@arm.com,
	Peter Hoyes <Peter.Hoyes@arm.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v6 0/2] Add escape character argument to Xen console
Date: Thu, 27 Jul 2023 17:44:47 +0100
Message-Id: <20230727164450.77640-1-peter.hoyes@arm.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Peter Hoyes <Peter.Hoyes@arm.com>

Dom0 may be accessed via telnet, meaning the default escape character
(which is the same as telnet's) cannot be directly used to exit the
console. It would be helpful to make the escape character customizable
in such use cases, falling back to the existing value if not set.

Make the necessary changes to the console client, libxl and the xl
console sub-command to support this.

Peter Hoyes (2):
  tools/console: Add escape argument to configure escape character
  xl: Add escape character argument to xl console

 docs/man/xl.1.pod.in             |  8 +++++-
 tools/console/client/main.c      | 21 +++++++++++++---
 tools/include/libxl.h            | 43 ++++++++++++++++++++++++++++----
 tools/libs/light/libxl_console.c | 30 ++++++++++++++++------
 tools/xl/xl_cmdtable.c           |  3 ++-
 tools/xl/xl_console.c            | 10 +++++---
 tools/xl/xl_vmcontrol.c          |  2 +-
 7 files changed, 94 insertions(+), 23 deletions(-)

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 16:45:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 16:45:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571239.894612 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP47T-0005KQ-FJ; Thu, 27 Jul 2023 16:45:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571239.894612; Thu, 27 Jul 2023 16:45:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP47T-0005KJ-BU; Thu, 27 Jul 2023 16:45:43 +0000
Received: by outflank-mailman (input) for mailman id 571239;
 Thu, 27 Jul 2023 16:45:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=SoSB=DN=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1qP47S-0004vW-3L
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 16:45:42 +0000
Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com
 [2a00:1450:4864:20::233])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 05d5d26b-2c9d-11ee-b24a-6b7b168915f2;
 Thu, 27 Jul 2023 18:45:41 +0200 (CEST)
Received: by mail-lj1-x233.google.com with SMTP id
 38308e7fff4ca-2b97f34239cso17259611fa.3
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 09:45:41 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 q24-20020a2e8758000000b002b69febf515sm429800ljj.125.2023.07.27.09.45.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 09:45:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 05d5d26b-2c9d-11ee-b24a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690476341; x=1691081141;
        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=0MkIz6ax8NL2d1PW8QNC5JcfmZ1hJCFw2AFK9nrAP+Q=;
        b=aOCMnskHowYe+xQXN+QFOKtpBKHrhdp0F4PAJ3Gn0p5HFtF/lWtmx4xJLCp9yBST1/
         Sm/sumjgp6b+0lctZ9eC0uBiIT/GmxEYo+6rDJjLJYLVrRYPjDdkbf+MzlIEmfTrB5il
         IkhuASodKTmYN0wY2qtJXndm6ZcxzkdFGRTDZsjb2b1chl54QE4vNPVrY4tliReCsV/O
         y4VV3XWnoSsyH8e4gFJ+ENf/96ZlSfajm5lhzJ69xHbVWvzuyvOmFwPZBQ/6/mvqAuIF
         rjLZERpIXROyJAR/qSNXJ+qzqIQMCaB229y6fdg0mMei4IlUoqETI0pKArszJM4f1Z7c
         cDGQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690476341; x=1691081141;
        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=0MkIz6ax8NL2d1PW8QNC5JcfmZ1hJCFw2AFK9nrAP+Q=;
        b=N5ug7hSVmuGm6Sa44Ig6gAM8Im3wsGzYjXtZXX9FjMTaaOXZwzs2uH9PrHtuBysaSb
         kQfraC4i5x9q2ptHe1leY1Hc/KPmYP11+TsAvZeMAokfPjMrXLTnumqFN4xqGT1ycfEV
         l+XuCfwWZIwB5Ima+P0xx6oKIv/bh/soouvhNq90IhIJd++IzftYGtHyvsTBVlfx740l
         K7MsKOChR8wc5lb+Gz6UU1t7Cce8jVKfk6d8i1VicsnZoTx6h5q1fYaaBXgwn9G5LclS
         iScoQN8dIDf0dNwsp5Df2xJlbOHhEOYEPavbVkYUi2ecEm5oc+YU7OcpiS9K+UnumLsN
         meKw==
X-Gm-Message-State: ABy/qLa1TtcK44VSPfuK8P3EOyidmzDA/vm1xoSsASuztTc6IDZNA8/o
	LBHYFAHUphADxE0ulwCTWfL5yHwSBPo=
X-Google-Smtp-Source: APBJJlHd+2XuTzLRTrR2TWXzINDheyjAbqKpbMRTaztzV6z9rDFfYDzJpW7suvL6/C+YEjjCuBjumw==
X-Received: by 2002:a2e:9b54:0:b0:2b6:e196:68c4 with SMTP id o20-20020a2e9b54000000b002b6e19668c4mr2207348ljj.39.1690476340394;
        Thu, 27 Jul 2023 09:45:40 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v4 1/1] ns16550: add support for polling mode when device tree is used
Date: Thu, 27 Jul 2023 19:45:37 +0300
Message-ID: <6e8f243284b53a9c56e7faf5e0e5ee5e20de9958.1690475512.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1690475512.git.oleksii.kurochko@gmail.com>
References: <cover.1690475512.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

RISC-V doesn't support interrupts for the time being, so it would be nice to
have polling mode.

To force poll mode it was added parsing of new 'poll' property under "com<N>="

If there is no interrupt property in UART node, then polling will be used.
According to 4.2.2 National Semiconductor 16450/16550 Compatible UART
Requirements from The Devicetree Specification v0.4
( https://www.devicetree.org/specifications/ ) the interrupt property is
optional.

Also, it is possible that interrupt '0' can be used for some architectures as
an legal UART interrupt number ( according to dts files in Linux kernel ), so
the check of the return value of platform_get_irq() was updated in case of when
device tree is used for UART initialization.
For example:
https://github.com/torvalds/linux/blob/master/arch/powerpc/boot/dts/ebony.dts#L197

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V4:
 - fix code style for ns16550_irq().
 - partially revert changes in pci_uart_config().
 - add check of "poll" property under "com<N>=" instead of "console=".
 - remove seting of polling mode in parsing of msi in parse_positional().
 - update comment above opt_com1 about Configuration string of serial port.
---
 xen/drivers/char/ns16550.c | 64 +++++++++++++++++++++++++-------------
 1 file changed, 42 insertions(+), 22 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 2aed6ec707..83170fd6b8 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -58,7 +58,11 @@ static struct ns16550 {
     struct timer timer;
     struct timer resume_timer;
     unsigned int timeout_ms;
-    bool_t intr_works;
+    enum {
+        intr_off,
+        intr_on,
+        polling,
+    } intr_works;
     bool_t dw_usr_bsy;
 #ifdef NS16550_PCI
     /* PCI card parameters. */
@@ -112,6 +116,19 @@ struct ns16550_config_param {
 static void enable_exar_enhanced_bits(const struct ns16550 *uart);
 #endif
 
+/*
+ * Configure serial port with a string:
+ *   <baud>[/<base_baud>][,DPS[,<io-base>[,<irq>|msi|poll[,<port-bdf>[,<bridge-bdf>]]]]].
+ * The tail of the string can be omitted if platform defaults are sufficient.
+ * If the baud rate is pre-configured, perhaps by a bootloader, then 'auto'
+ * can be specified in place of a numeric baud rate. Polled mode is specified
+ * by poll property.
+ */
+static char __initdata opt_com1[128] = "";
+static char __initdata opt_com2[128] = "";
+string_param("com1", opt_com1);
+string_param("com2", opt_com2);
+
 static void cf_check ns16550_delayed_resume(void *data);
 
 static u8 ns_read_reg(const struct ns16550 *uart, unsigned int reg)
@@ -181,7 +198,7 @@ static void cf_check ns16550_interrupt(
     struct serial_port *port = dev_id;
     struct ns16550 *uart = port->uart;
 
-    uart->intr_works = 1;
+    uart->intr_works = intr_on;
 
     while ( !(ns_read_reg(uart, UART_IIR) & UART_IIR_NOINT) )
     {
@@ -212,7 +229,7 @@ static void cf_check __ns16550_poll(struct cpu_user_regs *regs)
     struct serial_port *port = this_cpu(poll_port);
     struct ns16550 *uart = port->uart;
 
-    if ( uart->intr_works )
+    if ( uart->intr_works == intr_on )
         return; /* Interrupts work - no more polling */
 
     while ( ns_read_reg(uart, UART_LSR) & UART_LSR_DR )
@@ -305,7 +322,8 @@ static void ns16550_setup_preirq(struct ns16550 *uart)
     unsigned char lcr;
     unsigned int  divisor;
 
-    uart->intr_works = 0;
+    if ( uart->intr_works != polling )
+        uart->intr_works = intr_off;
 
     pci_serial_early_init(uart);
 
@@ -394,7 +412,7 @@ static void __init cf_check ns16550_init_irq(struct serial_port *port)
 
 static void ns16550_setup_postirq(struct ns16550 *uart)
 {
-    if ( uart->irq > 0 )
+    if ( uart->intr_works != polling )
     {
         /* Master interrupt enable; also keep DTR/RTS asserted. */
         ns_write_reg(uart,
@@ -473,6 +491,7 @@ static void __init cf_check ns16550_init_postirq(struct serial_port *port)
                 if ( rc )
                 {
                     uart->irq = 0;
+                    uart->intr_works = polling;
                     if ( msi_desc )
                         msi_free_irq(msi_desc);
                     else
@@ -488,7 +507,7 @@ static void __init cf_check ns16550_init_postirq(struct serial_port *port)
     }
 #endif
 
-    if ( uart->irq > 0 )
+    if ( uart->intr_works != polling )
     {
         uart->irqaction.handler = ns16550_interrupt;
         uart->irqaction.name    = "ns16550";
@@ -595,7 +614,8 @@ static void __init cf_check ns16550_endboot(struct serial_port *port)
 static int __init cf_check ns16550_irq(struct serial_port *port)
 {
     struct ns16550 *uart = port->uart;
-    return ((uart->irq > 0) ? uart->irq : -1);
+
+    return ((uart->intr_works != polling) ? uart->irq : -1);
 }
 
 static void cf_check ns16550_start_tx(struct serial_port *port)
@@ -654,6 +674,9 @@ static void ns16550_init_common(struct ns16550 *uart)
 
     /* Default lsr_mask = UART_LSR_THRE */
     uart->lsr_mask  = UART_LSR_THRE;
+
+    if ( strstr(opt_com1, "poll") || strstr(opt_com2, "poll") )
+        uart->intr_works = polling;
 }
 
 #ifdef CONFIG_X86
@@ -1333,9 +1356,13 @@ pci_uart_config(struct ns16550 *uart, bool_t skip_amt, unsigned int idx)
                     uart->irq = 0;
 #endif
                 if ( !uart->irq )
+                {
+                    uart->intr_works = polling;
+
                     printk(XENLOG_INFO
                            "ns16550: %pp: no legacy IRQ, using poll mode\n",
                            &PCI_SBDF(0, b, d, f));
+                }
 
                 return 0;
             }
@@ -1374,19 +1401,6 @@ static void enable_exar_enhanced_bits(const struct ns16550 *uart)
 
 #endif /* CONFIG_HAS_PCI */
 
-/*
- * Configure serial port with a string:
- *   <baud>[/<base_baud>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]]].
- * The tail of the string can be omitted if platform defaults are sufficient.
- * If the baud rate is pre-configured, perhaps by a bootloader, then 'auto'
- * can be specified in place of a numeric baud rate. Polled mode is specified
- * by requesting irq 0.
- */
-static char __initdata opt_com1[128] = "";
-static char __initdata opt_com2[128] = "";
-string_param("com1", opt_com1);
-string_param("com2", opt_com2);
-
 enum serial_param_type {
     baud,
     clock_hz,
@@ -1555,6 +1569,9 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
         }
         else
 #endif
+        if ( strncmp(conf, "poll", 4) == 0 )
+            uart->intr_works = polling;
+        else
             uart->irq = simple_strtol(conf, &conf, 10);
     }
 
@@ -1791,8 +1808,11 @@ static int __init ns16550_uart_dt_init(struct dt_device_node *dev,
     }
 
     res = platform_get_irq(dev, 0);
-    if ( ! res )
-        return -EINVAL;
+    if ( res < 0 )
+    {
+        printk("there is no interrupt property, polling will be used\n");
+        uart->intr_works = polling;
+    }
     uart->irq = res;
 
     uart->dw_usr_bsy = dt_device_is_compatible(dev, "snps,dw-apb-uart");
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 17:25:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 17:25:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571244.894622 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP4jn-00027m-F6; Thu, 27 Jul 2023 17:25:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571244.894622; Thu, 27 Jul 2023 17:25:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP4jn-00027f-BA; Thu, 27 Jul 2023 17:25:19 +0000
Received: by outflank-mailman (input) for mailman id 571244;
 Thu, 27 Jul 2023 17:25:18 +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
 <SRS0=RfsC=DN=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1qP4jm-00027X-3M
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 17:25:18 +0000
Received: from sender4-of-o50.zoho.com (sender4-of-o50.zoho.com
 [136.143.188.50]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8b9ade8a-2ca2-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 19:25:15 +0200 (CEST)
Received: from [10.10.1.94] (static-72-81-132-2.bltmmd.fios.verizon.net
 [72.81.132.2]) by mx.zohomail.com
 with SMTPS id 1690478702291964.8439954564757;
 Thu, 27 Jul 2023 10:25:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8b9ade8a-2ca2-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; t=1690478704; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=KrOMC3BPld0hHpUdeDVnUhOybZBJ1pNi3uiuLeKPS4cl+x3wj/Vm4/4tqOOjEGGSDstODuveBZ+8YzSXq+mV5UhmI5sOXshuyG0ECg9/tPEtiwEx0NNDLveUie9h7HLjMKhDCdcRi8XJvM4OejPdFPP+CrugsaVtwa/8TH5RmWA=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1690478704; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; 
	bh=TKhkL6fzus3QJYxSCY4OtKCGJ09TJbxESxUFSW6m7dk=; 
	b=KJVaZXO3AZmXsigwumCCmSccWgp1cy8XQXfAxuztD5AX7ml8nNY0aeADIOVTO3Fy0f5ER3uyN9uMdtsTZIC4MUWI/RqkHqeWJuektfrbwVcR35yTVLqpZ2A0nFhPNuCWPYbzo93Y54SteJyLN8VxfXvF7dzkxZuU8akJI98Om2g=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1690478704;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To;
	bh=TKhkL6fzus3QJYxSCY4OtKCGJ09TJbxESxUFSW6m7dk=;
	b=HbPWbvOYvMkHy5s49Q2KT2YgDL6QxQ/ZQjAt/JiOKGq0JvzCHSh1zv8auGKINA79
	5f5uIeYQcanXOGS/V8/bTqX5/oLPgjz9YDQQAC6aPHODHmZN+KyOkbUb1OGju2jZBz0
	U/cqsGLllgwlNM/BnKy/CUNh/wVEa/K85imLfU50=
Message-ID: <94e8ad9f-21e0-6713-84a6-4665a86b2108@apertussolutions.com>
Date: Thu, 27 Jul 2023 13:25:00 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [PATCH RFC] x86/boot: Update construct_dom0() to take a const
 char *cmdline
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Jan Beulich <JBeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>,
 Christopher Clark <christopher@nexfir.com>
References: <20230719131802.4078609-1-andrew.cooper3@citrix.com>
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
In-Reply-To: <20230719131802.4078609-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

On 7/19/23 09:18, Andrew Cooper wrote:
> With hvm_copy_to_guest_*() able to use const sources, update construct_dom0()
> and friends to pass a const cmdline pointer.  Nothing in these paths have a
> reason to be modifying the command line passed in.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
> CC: Wei Liu <wl@xen.org>
> CC: Daniel Smith <dpsmith@apertussolutions.com>
> CC: Christopher Clark <christopher@nexfir.com>
> 
> Slightly RFC.
> 
> I'm confused as to why image is const, but the initrd isn't.
> 
> Also, I suspect this will interfere with the Hyperlauch work, and I'd be happy
> to leave it alone if all of this is being fixed differently anyway.

This is overall a good change and honestly I don't see this having any 
significant impact on HL. And if it does, it would be better to fix HL 
then block this positive change.

> This is necessary to make the -Wwrite-strings bodge compile, but I'm hoping
> that a less-bad solution to the cmdline literals problem would avoid the need
> to propagate const through this callpath.
> ---
>   xen/arch/x86/dom0_build.c             | 2 +-
>   xen/arch/x86/hvm/dom0_build.c         | 4 ++--
>   xen/arch/x86/include/asm/dom0_build.h | 4 ++--
>   xen/arch/x86/include/asm/setup.h      | 2 +-
>   xen/arch/x86/pv/dom0_build.c          | 2 +-
>   5 files changed, 7 insertions(+), 7 deletions(-)
> 

Reviewed-by: Daniel P. Smith <dpsmith@apertussolutions.com>


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 18:36:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 18:36:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571249.894632 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP5qk-0001fQ-JL; Thu, 27 Jul 2023 18:36:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571249.894632; Thu, 27 Jul 2023 18:36:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP5qk-0001fJ-Fw; Thu, 27 Jul 2023 18:36:34 +0000
Received: by outflank-mailman (input) for mailman id 571249;
 Thu, 27 Jul 2023 18:36:33 +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
 <SRS0=oh4O=DN=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qP5qj-0001fD-Bf
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 18:36:33 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7fe023db-2cac-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 20:36:30 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 2AC1961F13;
 Thu, 27 Jul 2023 18:36:28 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CF7CC433C7;
 Thu, 27 Jul 2023 18:36:25 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7fe023db-2cac-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690482987;
	bh=No3djdeVz0NhVjxZu0khsrWk+l+jqgp9s0LgkMVGdXc=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=aScCDkSt8a6sQg5A213lanZCiOa9v5Yb65m+Q4yvS1a06O0YB0vO1BIMGNGT3DQQR
	 g27DdIqjmpztVXWvYhSNnDS+GdNmw/0qgSs/rQ1H8L0IxJ4Rwv3/iyCmb+eZar+KpW
	 D+7AZQhxOaj4NGoZLp7ZwCX5BCuOjDwB9ymsrNNXzkUrs+MaZsjAFy8gMsDyOuIFW8
	 hXIs581dYQm/izYBVrbeKnHy/U2B2cHHbyDwi0n/5gHM9Z/nqKtAvLLU9G0L9yLNyO
	 RrvEqzi/G2cERPMSMEMSJrHChEfXoOCRidqqmUSDj6V3GzxqrpfSw4kUExTgTZNYsf
	 TDU/J1U1kGqWQ==
Date: Thu, 27 Jul 2023 11:36:24 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: George Dunlap <george.dunlap@cloud.com>
cc: Jan Beulich <jbeulich@suse.com>, 
    "Daniel P. Smith" <dpsmith@apertussolutions.com>, 
    xen-devel@lists.xenproject.org, stefano.stabellini@amd.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>, 
    Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, 
    Luca Fancellu <luca.fancellu@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Rich Persaud <persaur@gmail.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Christopher Clark <christopher.w.clark@gmail.com>
Subject: Re: [PATCH 03/10] x86 setup: change bootstrap map to accept new boot
 module structures
In-Reply-To: <CA+zSX=ZFjWWnzx8vt3afywaiJiju1N5hNJqKzVkg956T-t-kwg@mail.gmail.com>
Message-ID: <alpine.DEB.2.22.394.2307271133180.3118466@ubuntu-linux-20-04-desktop>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com> <20230701071835.41599-4-christopher.w.clark@gmail.com> <alpine.DEB.2.22.394.2307081144340.761183@ubuntu-linux-20-04-desktop> <CACMJ4GYE6PW1SY35dhs4XkXd9ru25igrvMCrh4pJMWEBNNz0YQ@mail.gmail.com>
 <CACMJ4Gb_ZwKSjP7qzfQj98YQjSpBdFuWzeGQJUNNqst0GdXCOw@mail.gmail.com> <4e0a0fc9-0c1b-4725-5692-de67ee68a980@suse.com> <2994c9b8-c803-1fd9-20df-0d25d2b66c49@apertussolutions.com> <ca85fd2e-45a5-32c3-cb4b-1042be6c6915@suse.com> <32a22c57-1333-47b0-c61d-abff8d7df112@apertussolutions.com>
 <7ab3c4ae-3903-29de-ba32-d328b426d104@suse.com> <19bb355f-576c-b8d7-b6da-fa2dd8ff2228@apertussolutions.com> <63979074-42c3-83dd-cf0a-8f0cd0294a5d@suse.com> <CA+zSX=ZFjWWnzx8vt3afywaiJiju1N5hNJqKzVkg956T-t-kwg@mail.gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; BOUNDARY="8323329-807081471-1690482850=:3118466"
Content-ID: <alpine.DEB.2.22.394.2307271134250.3118466@ubuntu-linux-20-04-desktop>

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-807081471-1690482850=:3118466
Content-Type: text/plain; CHARSET=UTF-8
Content-Transfer-Encoding: 8BIT
Content-ID: <alpine.DEB.2.22.394.2307271134251.3118466@ubuntu-linux-20-04-desktop>

On Thu, 27 Jul 2023, George Dunlap wrote:
> On Thu, Jul 27, 2023 at 3:42â€¯PM Jan Beulich <jbeulich@suse.com> wrote:
>       On 27.07.2023 15:26, Daniel P. Smith wrote:
>       > Let's bring this back to the actual implementation instead of the
>       > theoretical. Your position is that Xen's paddr_t is desired because it
>       > can store larger values than that of size_t. Now if you look in Xen
>       > proper (main 64bit code on x86), paddr_t is a typedef for a 64bit
>       > unsigned integer. And if you look at size_t, it is also a typedef to a
>       > 64bit unsigned integer, they are literally a couple of lines apart in
>       > types.h. Thus they are the same size and can only represent the same
>       > maximum size.
> 
>       What about 32-bit Arm, or any other 32-bit architecture that we might
>       see Xen ported to, with wider than 32-bit physical address space?
> 
> 
> To be more concrete here:
> 
> Suppose that you had a machine with 32-bit virtual address spaces (i.e., going up to 4GiB), and 36-bit physical address spaces (i.e., going
> up to 64GiB).Â  And suppose you had a system with 16GiB of physical ram.Â  And you wanted to use Hyperlaunch to createÂ VMs using some sort of
> memory image that was 5GiB (presumably of some kind of static data, not, say, a kernel or initramfs).Â  You wouldn't be able to do it if the
> "size" parameter of the boot modules was limited to 4GiB (without some kind of hack where you string multiple boot modules together).

Yes exactly.

I would like this code to be common across ARM and x86. On arm32 size_t
wouldn't work, with size_t as it is defined today. One option is to use
paddr_t on all arches, or at least on arm32. Another option is to change
the definition of size_t on arm32.

My suggestion it to move the existing equivalent dom0less interface
defined here:
xen/arch/arm/include/asm/setup.c:struct bootmodule
to common code and base this work on top of it. struct bootmodule uses
paddr_t for both start and size to solve the arm32 issue today. 
--8323329-807081471-1690482850=:3118466--


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 18:42:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 18:42:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571252.894641 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP5w3-0003Cg-9E; Thu, 27 Jul 2023 18:42:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571252.894641; Thu, 27 Jul 2023 18:42:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP5w3-0003CZ-6O; Thu, 27 Jul 2023 18:42:03 +0000
Received: by outflank-mailman (input) for mailman id 571252;
 Thu, 27 Jul 2023 18:42:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=oh4O=DN=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qP5w1-0003CT-Ps
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 18:42:01 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 455a043a-2cad-11ee-b24a-6b7b168915f2;
 Thu, 27 Jul 2023 20:42:00 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 79B4361E90;
 Thu, 27 Jul 2023 18:41:59 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DB50C433C7;
 Thu, 27 Jul 2023 18:41:58 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 455a043a-2cad-11ee-b24a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690483318;
	bh=juL/Fs+z0WaByJA+d+6gaJXz5Tv4ufqtBBaFNGf9/3Q=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=f5Owtnh8sIYu8KN0lEREURFHaqh1Hwjy67CN3VV4eBQHM2jhW+QqwE7fxe17iM9uV
	 fOdaZcy33ZAo8wPWEXheSQ3PkTzOJ1rc0w7J3ILedBE12AfEhvbiymb09iqJ636F2o
	 +sJlG39Z7cctK7dJJsLeliCf0KChcxOu5MaGCsZkD124r1jttkuZ7BaGGye9WPxFIO
	 klYFDAcNMCO/6cqvWHdmvXPwWQpGcPBlKmw9otscFiFTszqr4OiJzjH/BWMxAM8tME
	 TU1APhgU/127FG9wE96zee0PWpfNnAHFZuvPq1gLYnBTzMetf3vM79DUF0skba79a8
	 tKjPozWI+QAvg==
Date: Thu, 27 Jul 2023 11:41:56 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
    Paul Durrant <paul@xen.org>, Nicola Vetrini <nicola.vetrini@bugseng.com>
Subject: Re: [PATCH] x86/HVM: drop dead assignments from
 hvmemul_rep_{movs,stos}()
In-Reply-To: <32e33a0b-d572-ea7f-b1a8-3263711582e5@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307271141500.3118466@ubuntu-linux-20-04-desktop>
References: <32e33a0b-d572-ea7f-b1a8-3263711582e5@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 27 Jul 2023, Jan Beulich wrote:
> In the latter case the variable altogether is then unused and hence gets
> dropped, eliminating a Misra Rule 5.3 violation. I'm afraid I mistakenly
> introduced both assignments in 57a57465daaf ("x86/HVM: use available
> linear->phys translations in REP MOVS/STOS handling"), likely as a
> result of some re-work on the patch.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> --- a/xen/arch/x86/hvm/emulate.c
> +++ b/xen/arch/x86/hvm/emulate.c
> @@ -1861,7 +1861,6 @@ static int cf_check hvmemul_rep_movs(
>              return rc;
>      }
>  
> -    bytes = PAGE_SIZE - (daddr & ~PAGE_MASK);
>      if ( hvio->mmio_access.write_access &&
>           (hvio->mmio_gla == (daddr & PAGE_MASK)) &&
>           /* See comment above. */
> @@ -1988,7 +1987,7 @@ static int cf_check hvmemul_rep_stos(
>          container_of(ctxt, struct hvm_emulate_ctxt, ctxt);
>      struct vcpu *curr = current;
>      struct hvm_vcpu_io *hvio = &curr->arch.hvm.hvm_io;
> -    unsigned long addr, bytes;
> +    unsigned long addr;
>      paddr_t gpa;
>      p2m_type_t p2mt;
>      bool_t df = !!(ctxt->regs->eflags & X86_EFLAGS_DF);
> @@ -1998,7 +1997,6 @@ static int cf_check hvmemul_rep_stos(
>      if ( rc != X86EMUL_OKAY )
>          return rc;
>  
> -    bytes = PAGE_SIZE - (addr & ~PAGE_MASK);
>      if ( hvio->mmio_access.write_access &&
>           (hvio->mmio_gla == (addr & PAGE_MASK)) &&
>           /* See respective comment in MOVS processing. */
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 19:30:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 19:30:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571254.894653 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP6gW-0008W3-PN; Thu, 27 Jul 2023 19:30:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571254.894653; Thu, 27 Jul 2023 19:30:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP6gW-0008VX-KV; Thu, 27 Jul 2023 19:30:04 +0000
Received: by outflank-mailman (input) for mailman id 571254;
 Thu, 27 Jul 2023 19:30:03 +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
 <SRS0=RfsC=DN=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1qP6gV-0008CE-8M
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 19:30:03 +0000
Received: from sender4-of-o50.zoho.com (sender4-of-o50.zoho.com
 [136.143.188.50]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f8a22209-2cb3-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 21:30:00 +0200 (CEST)
Received: from [10.10.1.94] (static-72-81-132-2.bltmmd.fios.verizon.net
 [72.81.132.2]) by mx.zohomail.com
 with SMTPS id 1690486190691601.0074543301466;
 Thu, 27 Jul 2023 12:29:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f8a22209-2cb3-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; t=1690486192; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=XuMJWACBh6UsdrdnWswEVQvOux13hm1gzccMHHvIEXN8wQ/b7jzcWn0xQFYE/a+71Mw9tQrYtbcI/IRKOeJXvkQPJMK3ICPUkD7rM1NcttG24EZnctor6UbTGDvTCr/WbvSXZjS0FL5Fk8NH1yx1Cap5d6AErC6c391rckU/y5I=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1690486192; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; 
	bh=qsQMZEljq9tNUHzPHrnn+78USOsSeLeBFjHt1wNT62g=; 
	b=JhhBkQca5fQnUy+exCXjP0EUR8FSscZ/T9TI1RoON9U4FVyDgz+daa5HJegC+HWysWi9hGwhCYwOvnA0EqsVALaohs+77QLggdtqOZXG4woAcDcc3ylxJ95/bNqRfi6HJLwXt4zbWPn6Q8p5lI/+wu28mF6VXVAeaIRvsS4y+w8=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1690486192;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To;
	bh=qsQMZEljq9tNUHzPHrnn+78USOsSeLeBFjHt1wNT62g=;
	b=dKeXjW8WsdSozF11+8UwenHjPEvmxPQDGtvk3e5HRM3OP9uRskqT/sfzFDmn7Wkr
	l1toslTJwZ5An+Cs1lDd3ejWpMNGugIzTgzICBFze1jLqJveIxySO8i9IK0qIV0WR7W
	GbRJfmeOnTlBL+zo3DGxj/eCNUyhUl0lwQdoPDd8=
Message-ID: <6133f750-b9a2-635e-31ef-73346d3999f0@apertussolutions.com>
Date: Thu, 27 Jul 2023 15:29:48 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: [PATCH 03/10] x86 setup: change bootstrap map to accept new boot
 module structures
Content-Language: en-US
To: George Dunlap <george.dunlap@cloud.com>, Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, stefano.stabellini@amd.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Luca Fancellu <luca.fancellu@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Rich Persaud <persaur@gmail.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Christopher Clark <christopher.w.clark@gmail.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
 <20230701071835.41599-4-christopher.w.clark@gmail.com>
 <alpine.DEB.2.22.394.2307081144340.761183@ubuntu-linux-20-04-desktop>
 <CACMJ4GYE6PW1SY35dhs4XkXd9ru25igrvMCrh4pJMWEBNNz0YQ@mail.gmail.com>
 <CACMJ4Gb_ZwKSjP7qzfQj98YQjSpBdFuWzeGQJUNNqst0GdXCOw@mail.gmail.com>
 <4e0a0fc9-0c1b-4725-5692-de67ee68a980@suse.com>
 <2994c9b8-c803-1fd9-20df-0d25d2b66c49@apertussolutions.com>
 <ca85fd2e-45a5-32c3-cb4b-1042be6c6915@suse.com>
 <32a22c57-1333-47b0-c61d-abff8d7df112@apertussolutions.com>
 <7ab3c4ae-3903-29de-ba32-d328b426d104@suse.com>
 <19bb355f-576c-b8d7-b6da-fa2dd8ff2228@apertussolutions.com>
 <63979074-42c3-83dd-cf0a-8f0cd0294a5d@suse.com>
 <CA+zSX=ZFjWWnzx8vt3afywaiJiju1N5hNJqKzVkg956T-t-kwg@mail.gmail.com>
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
In-Reply-To: <CA+zSX=ZFjWWnzx8vt3afywaiJiju1N5hNJqKzVkg956T-t-kwg@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External



On 7/27/23 11:15, George Dunlap wrote:
> 
> 
> On Thu, Jul 27, 2023 at 3:42â€¯PM Jan Beulich <jbeulich@suse.com 
> <mailto:jbeulich@suse.com>> wrote:
> 
>     On 27.07.2023 15:26, Daniel P. Smith wrote:
>      > Let's bring this back to the actual implementation instead of the
>      > theoretical. Your position is that Xen's paddr_t is desired
>     because it
>      > can store larger values than that of size_t. Now if you look in Xen
>      > proper (main 64bit code on x86), paddr_t is a typedef for a 64bit
>      > unsigned integer. And if you look at size_t, it is also a typedef
>     to a
>      > 64bit unsigned integer, they are literally a couple of lines
>     apart in
>      > types.h. Thus they are the same size and can only represent the same
>      > maximum size.
> 
>     What about 32-bit Arm, or any other 32-bit architecture that we might
>     see Xen ported to, with wider than 32-bit physical address space?
> 
> 
> To be more concrete here:
> 
> Suppose that you had a machine with 32-bit virtual address spaces (i.e., 
> going up to 4GiB), and 36-bit physical address spaces (i.e., going up to 
> 64GiB).Â  And suppose you had a system with 16GiB of physical ram.Â  And 
> you wanted to use Hyperlaunch to createÂ VMs using some sort of memory 
> image that was 5GiB (presumably of some kind of static data, not, say, a 
> kernel or initramfs).Â  You wouldn't be able to do it if the "size" 
> parameter of the boot modules was limited to 4GiB (without some kind of 
> hack where you string multiple boot modules together).

The reality to your scenario here is that it would never work on x86. 
Regardless of which entry point you come in through, 32bit BIOS entry, 
UEFI, or PVH, all of these expect the boot material to be passed in 
using the MB1 or MB2 protocol. Under those protocols, a module 
definition has a start and end addresses which are u32. While the start 
address could be okay, the end address will be well beyond 4GiB which at 
best would overflow the address, but more likely be rejected by the 
bootloader.

> I guess part of the question is whether we think that's an important use 
> case; on the whole if you're populating 5GiB of RAM, it seems like it 
> would be better to have the VM load it itself from disk.

The point of hyperlaunch is to enable advanced use-cases and domain 
resume on boot is one I think someone might find useful.

> I do see the logic behind wanting to avoid "paddr_t" for a size; I'm 
> sure Jan that you would nack any patch that used "size_t" as a memory 
> address (instead of, say, uintptr_t).Â  In that case, "psize_t" is the 
> obvious solution.

I would be amenable with declaring a psize_t that lived in all the same 
places paddr_t are defined to signal them as a pair, of sorts. I would 
have to see if adding paddr_t and this new psize_t addresses to the 
32bit defs.h would result in making the structures 64bit clean in the 
x86 32bit code. If so, then it would remove the need for a separate 
declaration of the structures there.

v/r,
dps





From xen-devel-bounces@lists.xenproject.org Thu Jul 27 19:36:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 19:36:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571256.894662 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP6mS-000106-DB; Thu, 27 Jul 2023 19:36:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571256.894662; Thu, 27 Jul 2023 19:36:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP6mS-0000zz-9q; Thu, 27 Jul 2023 19:36:12 +0000
Received: by outflank-mailman (input) for mailman id 571256;
 Thu, 27 Jul 2023 19:36:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=oh4O=DN=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qP6mQ-0000zt-Ui
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 19:36:10 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d08b128f-2cb4-11ee-b24a-6b7b168915f2;
 Thu, 27 Jul 2023 21:36:01 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 89AA361F11;
 Thu, 27 Jul 2023 19:35:57 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64BACC433C7;
 Thu, 27 Jul 2023 19:35:55 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d08b128f-2cb4-11ee-b24a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690486557;
	bh=3qvRh7cwqzBHecLGo637MwATyP7GklmeWopJXnjiK8o=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=ng1FJiie7ASG/zHslkVjzVg0NoqZNZdXIm2+e1slASubsNhis6xS78okTiJgyjHUw
	 eK5BclNlym0BWriChl8+aSvvOjTs3ERECZnrkryjNXs1c1rVtQRXFutjFI5gTYxL/N
	 rZx0IrqxCD0sQ9sxKtppopQgbbzebMAIDhRtKERmi87voROrHUUpYQG3uSnZ2pRnoa
	 9E/E11GDlBJr1EpAlfHtFJI85a7fqdIal5ZvI2RyHIQzYGFcCoqbANTREErA+os2Cb
	 LBlBrqSmtv7D+1opgTxI3PANrjtr1TBhOJtoLMuVkOr/fKq6PWpf+K650opyITxbq1
	 YM0MENBOhcQKQ==
Date: Thu, 27 Jul 2023 12:35:54 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    Nicola Vetrini <nicola.vetrini@bugseng.com>, michal.orzel@amd.com, 
    xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, 
    consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>, 
    Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v3] xen/spinlock: mechanically rename parameter name
 'debug'
In-Reply-To: <d099b736-22cf-0502-df37-9ae7b14d048a@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307271233480.3118466@ubuntu-linux-20-04-desktop>
References: <a66f1084686b77b098c5ccf3d0cf5f52980fdf5a.1690317797.git.nicola.vetrini@bugseng.com> <11a3ae18-508b-cf08-2803-bc4aaeec7353@suse.com> <f424fc5b-6266-3d04-b494-0448fa453b75@bugseng.com> <8914bf47-c4ca-4a14-6a92-b5b23ee739a0@suse.com>
 <alpine.DEB.2.22.394.2307261448010.3118466@ubuntu-linux-20-04-desktop> <d099b736-22cf-0502-df37-9ae7b14d048a@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 27 Jul 2023, Jan Beulich wrote:
> On 26.07.2023 23:49, Stefano Stabellini wrote:
> > On Wed, 26 Jul 2023, Jan Beulich wrote:
> >> On 26.07.2023 08:42, Nicola Vetrini wrote:
> >>> On 26/07/23 08:34, Jan Beulich wrote:
> >>>> On 25.07.2023 22:45, Nicola Vetrini wrote:
> >>>>> Rule 5.3 has the following headline:
> >>>>> "An identifier declared in an inner scope shall not hide an
> >>>>> identifier declared in an outer scope"
> >>>>>
> >>>>> To avoid any confusion resulting from the parameter 'debug'
> >>>>> hiding the homonymous function declared at
> >>>>> 'xen/arch/x86/include/asm/processor.h:428'
> >>>>> the rename of parameters s/debug/lkdbg/ is performed.
> >>>>>
> >>>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> >>>>> ---
> >>>>> Changes in v2:
> >>>>> - s/dbg/lkdbg/
> >>>>> Changes in v3:
> >>>>> - Added missing renames for consistency
> >>>>
> >>>> Hmm, you asked whether to send v3, but then you didn't wait for an
> >>>> answer. So to repeat what I said there: I'd prefer if we could first
> >>>> settle whether to rename the conflicting x86 symbol.
> >>>>
> >>>
> >>> Stefano replied asking for a v3 [1] before I had a chance to read your 
> >>> message this morning.
> >>
> >> Right, sorry, I spotted his reply only after seeing the v3.
> > 
> > For what is worth I prefer the current implementation compared to
> > renaming debug()
> 
> I don't. My replacement name suggestions were only "just in case"; I
> don't really like them.

Understood :-)

How would you like to proceed?

1. we commit this patch as is
2. we wait for a third opinion from another maintainer
3. we find a new name for the variable
4. we change debug() instead

?


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 19:39:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 19:39:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571258.894671 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP6pp-0001cM-SU; Thu, 27 Jul 2023 19:39:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571258.894671; Thu, 27 Jul 2023 19:39:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP6pp-0001cF-Pf; Thu, 27 Jul 2023 19:39:41 +0000
Received: by outflank-mailman (input) for mailman id 571258;
 Thu, 27 Jul 2023 19:39:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=oh4O=DN=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qP6po-0001c9-UH
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 19:39:40 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 52ed892b-2cb5-11ee-b24a-6b7b168915f2;
 Thu, 27 Jul 2023 21:39:39 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 608F661F20;
 Thu, 27 Jul 2023 19:39:38 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABE6CC433C7;
 Thu, 27 Jul 2023 19:39:36 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 52ed892b-2cb5-11ee-b24a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690486777;
	bh=iy+jc/gzUnbztxUD55PAq3q//FwUt9n8Sin/+C9konM=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=fvIatD1pUxAAX5LbFyYti4u7+g9enMYQn9k8gsCdTdxobMalSY/AWJ5aNiPQBeDap
	 RAhYr2zanTc+r/hssaB9PTZ+64iS1cAcWWdskkOL+mxtpj0sObNAPL3se7vWhisf6R
	 DvVy4H40v2GbjJ0W7RVxlRSpRfHEFZ/L6w5IP9M19Gct0tZIq3SWs7bBUqTFnCBcAD
	 eIJ96OSybkNHcxuoeqidp5seo/sO1q8CZc+nzBTYYyuwZRQkFN6Ea43Gn+mnE39fcS
	 qPtctkxmxH6dzPRWBlAtiY0lxNjc3uwzFZxFqEh7VKAURxPQ2v4ftt62MXcP+zoEsp
	 rvnB3z73Ci/0A==
Date: Thu, 27 Jul 2023 12:39:35 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: Jan Beulich <jbeulich@suse.com>, consulting@bugseng.com, 
    Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    xen-devel@lists.xenproject.org, 
    Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [XEN PATCH 2/3] xen/arm: irq: address violations of MISRA C:
 2012 Rules 8.2 and 8.3
In-Reply-To: <211aa6d4-d219-e429-030c-8f8b2fba815a@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307271238270.3118466@ubuntu-linux-20-04-desktop>
References: <cover.1690217195.git.federico.serafini@bugseng.com> <a62e88a9c29cf7866c251968b5a5b6865aff4a2a.1690217195.git.federico.serafini@bugseng.com> <a81326f4-e018-b461-ebec-9ef2ff5dc4df@suse.com> <alpine.DEB.2.22.394.2307251226180.3118466@ubuntu-linux-20-04-desktop>
 <31b72cda-2ef0-2f3c-4e83-948d7b763f19@bugseng.com> <f479517d-10db-4723-65a2-38c85f72d96e@suse.com> <211aa6d4-d219-e429-030c-8f8b2fba815a@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 27 Jul 2023, Federico Serafini wrote:
> On 27/07/23 13:27, Jan Beulich wrote:
> > On 27.07.2023 13:02, Federico Serafini wrote:
> > > 
> > > I have ready a patch for violations of rules 8.2 and 8.3 in
> > > xen/include/xen/iommu.h.
> > > I am talking about this, in this IRQ thread, because I think the
> > > following two options also apply for an eventual v2 patch for the IRQ
> > > module, until a decision about rule 8.2 and function pointers is taken:
> > > 
> > > 1) Split patches and submit only the changes *not* involving function
> > >      pointers.
> > > 2) In the meantime that you make a decision,
> > >      I submit patches thus addressing the existing violations.
> > > 
> > > I personally prefer the second one, but please let me know what you
> > > think.
> > 
> > It's not entirely clear to me what 2 means, as I wouldn't expect you
> > intend to deal with "violations" which we may decide aren't any in
> > out world.
> > 
> > Jan
> 
> In point 2) I would like to act as if the rule 8.2 had been approved without
> any deviation, I think this will lead to a smaller number of patches and a
> smaller amount of text attached to each modified function.
> If you are concerned about inconsistency between the resulting commit
> messages and your future decision then we can go for option 1).

Basically I think we need to go with 1), which is also what Jan wrote.

Sorry about that, I know it is not great, we should have settled this
already.


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 19:42:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 19:42:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571260.894682 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP6sG-00031J-A6; Thu, 27 Jul 2023 19:42:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571260.894682; Thu, 27 Jul 2023 19:42:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP6sG-00031A-5L; Thu, 27 Jul 2023 19:42:12 +0000
Received: by outflank-mailman (input) for mailman id 571260;
 Thu, 27 Jul 2023 19:42:11 +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
 <SRS0=oh4O=DN=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qP6sF-000312-1q
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 19:42:11 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ac01c10c-2cb5-11ee-8613-37d641c3527e;
 Thu, 27 Jul 2023 21:42:09 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id A5D8E61EF0;
 Thu, 27 Jul 2023 19:42:07 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6F8CC433C7;
 Thu, 27 Jul 2023 19:42:05 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ac01c10c-2cb5-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690486927;
	bh=9qPDHGoxEaEDr7A4BW04hX62T/INSv0+yTyd5V/hDjI=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=thEAFTw/rWTIN4fgYkPmaU46FW0/J0TMp756+0DHuF+34xQTNb66OI7sjrqEifc7w
	 qfgsm9S/Uw/iWEr/foBWLE/H++uVee0hNnbeprxG+KDehNNIrGot6tXDv+i8bLeh65
	 k7FnQm3lxVOvACzs5isdFdJerPEtEOqenvWDFHnG/DeNUZBDInjM7co+ThXwn/Mpof
	 KluaGtEi3Py7wJnq9s5b3d25JJDOHeIzXsBDENfW+O+AiWY32jm6RB9ppzIKw/VgD1
	 aGlYFOXiajeAXLaOwSEPpG14U3Q++l9d9Th+v/scYB5i4+S9e0bSQcxOOKbk7hS0E3
	 Fy12FxOQP5Fyg==
Date: Thu, 27 Jul 2023 12:42:04 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Wei Liu <wl@xen.org>
Subject: Re: [XEN PATCH] xen/notifier: address violations of MISRA C:2012
 Rule 8.3
In-Reply-To: <d362ef56c8c31bcca47d71a430879f087d9a9d04.1690474136.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307271241580.3118466@ubuntu-linux-20-04-desktop>
References: <d362ef56c8c31bcca47d71a430879f087d9a9d04.1690474136.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 27 Jul 2023, Federico Serafini wrote:
> Change parameter names in function declarations to be consistent with
> the corresponding definitions. This addesses violations of MISRA C:2012
> Rule 8.3: "All declarations of an object or function shall use the same
> names and type qualifiers".
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  xen/include/xen/notifier.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/include/xen/notifier.h b/xen/include/xen/notifier.h
> index 3d6017d4f7..51453c1552 100644
> --- a/xen/include/xen/notifier.h
> +++ b/xen/include/xen/notifier.h
> @@ -37,9 +37,9 @@ struct notifier_head {
>  
>  
>  void notifier_chain_register(
> -    struct notifier_head *nh, struct notifier_block *nb);
> +    struct notifier_head *nh, struct notifier_block *n);
>  void notifier_chain_unregister(
> -    struct notifier_head *nh, struct notifier_block *nb);
> +    struct notifier_head *nh, struct notifier_block *n);
>  
>  int notifier_call_chain(
>      struct notifier_head *nh, unsigned long val, void *v,
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 21:00:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 21:00:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571262.894692 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP85l-0003UD-R9; Thu, 27 Jul 2023 21:00:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571262.894692; Thu, 27 Jul 2023 21:00:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP85l-0003U6-OJ; Thu, 27 Jul 2023 21:00:13 +0000
Received: by outflank-mailman (input) for mailman id 571262;
 Thu, 27 Jul 2023 21:00:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qP85k-0003U0-KT
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 21:00:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP85j-00085a-HU; Thu, 27 Jul 2023 21:00:11 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP85j-0000DO-BV; Thu, 27 Jul 2023 21:00:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=HSDhRqaPsIQySPs6jLqRGkQE44YMxjf86Wusu5y0ios=; b=isM/e/RpKM85ji78FrunxRiajT
	jmwX8nINrGkFaI9uevsdFq4z/kCyisng2vJ7EFyfLLRJIIJ1Nx8MBPB68AV0ocQDlItz5pD0BmdZC
	aegZjasKj666Du8rffhEpcpfIJ0wK/gHsmh2wM+904qZ70PpdVvqJ3kVqINTG67fgPxc=;
Message-ID: <05f067be-f06b-ed1a-844d-15f9e9585500@xen.org>
Date: Thu, 27 Jul 2023 22:00:09 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v3 10/25] tools/xenstore: add hashtable_replace() function
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-11-jgross@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230724110247.10520-11-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 24/07/2023 12:02, Juergen Gross wrote:
> For an effective way to replace a hashtable entry add a new function
> hashtable_replace().
> 
> This is in preparation to replace TDB with a more simple data storage.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
> V3:
> - fix commit message (Julien Grall)
> - move unrelated change to previous patch (Julien Grall)
> - make value parameter const
> ---
>   tools/xenstore/hashtable.c | 19 +++++++++++++++++++
>   tools/xenstore/hashtable.h | 16 ++++++++++++++++
>   2 files changed, 35 insertions(+)
> 
> diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/hashtable.c
> index 0409725060..f85b5a71f1 100644
> --- a/tools/xenstore/hashtable.c
> +++ b/tools/xenstore/hashtable.c
> @@ -205,6 +205,25 @@ void *hashtable_search(const struct hashtable *h, const void *k)
>       return e ? e->v : NULL;
>   }
>   
> +int hashtable_replace(struct hashtable *h, const void *k, const void *v)

With the const dropped for 'v' and ...

> +{
> +    struct entry *e;
> +
> +    e = hashtable_search_entry(h, k);
> +    if (!e)
> +        return ENOENT;
> +
> +    if (h->flags & HASHTABLE_FREE_VALUE)
> +    {
> +        talloc_free(e->v);
> +        talloc_steal(e, v);
> +    }
> +
> +    e->v = (void *)v;

... cast:

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 21:03:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 21:03:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571265.894702 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP88R-00045l-Ep; Thu, 27 Jul 2023 21:02:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571265.894702; Thu, 27 Jul 2023 21:02:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP88R-00045e-At; Thu, 27 Jul 2023 21:02:59 +0000
Received: by outflank-mailman (input) for mailman id 571265;
 Thu, 27 Jul 2023 21:02:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qP88Q-00045Y-Rj
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 21:02:58 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP88Q-00087k-8c; Thu, 27 Jul 2023 21:02:58 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP88Q-0000QL-3r; Thu, 27 Jul 2023 21:02:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=o7uZ+Q2BtEZ55P9bEmiu5QcU7ktieuMi5uLVV8JVEf4=; b=IYJLLM0CyEk7FcIKs77aKILpZQ
	wDRbb4GN5NoRMqQhgHoDTUXgC9/2rahtaeWPgVS3imRsWJf19tnKh9MY2V5t6a0tQgau0lHcgNv0x
	JJBkF45YvISuTxELRNUDbAOWFZjh7qfuSf+JFdRBcXNHhXh5l73RSmjmU1oxfYOvjpqc=;
Message-ID: <d87f1a06-c1ce-d5c6-ce96-5614f12a2344@xen.org>
Date: Thu, 27 Jul 2023 22:02:56 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v3 00/25] tools/xenstore: drop TDB
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230724110247.10520-1-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 24/07/2023 12:02, Juergen Gross wrote:
> Juergen Gross (25):
>    tools/xenstore: explicitly specify create or modify for tdb_store()
>    tools/xenstore: replace key in struct node with data base name
>    tools/xenstore: let transaction_prepend() return the name for access
>    tools/xenstore: rename do_tdb_delete() and change parameter type
>    tools/xenstore: rename do_tdb_write() and change parameter type
>    tools/xenstore: switch get_acc_data() to use name instead of key
>    tools/xenstore: add wrapper for tdb_fetch()

I have committed up to this patch.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 21:07:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 21:07:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571268.894711 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP8D6-0004j4-VS; Thu, 27 Jul 2023 21:07:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571268.894711; Thu, 27 Jul 2023 21:07:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP8D6-0004ix-Sv; Thu, 27 Jul 2023 21:07:48 +0000
Received: by outflank-mailman (input) for mailman id 571268;
 Thu, 27 Jul 2023 21:07:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qP8D5-0004iq-Uo
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 21:07:48 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP8D5-0008CT-9q; Thu, 27 Jul 2023 21:07:47 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP8D5-0000eo-4T; Thu, 27 Jul 2023 21:07:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=LozQi8zVfwTWjcVUbnWNMACxcMcCv3StDITzOZTjumk=; b=QNSI/xpJIZDCKuLIvJxYH9Uvxj
	SpQr8v9iQJ5CKR3XgtxXTioyx8T2hZgh3FPSdCI1c7Rg2vrXgbDRl8iaqxGnrJ3zewyw0murpxjnn
	CeB6GRMoAWiCGVkc/h1Q06AZJVDUDggGgR2garONpuRCoI3d8QlRkyoIC6A7moExpvKk=;
Message-ID: <a1ac318d-ad3f-c533-d29d-0413af3072c2@xen.org>
Date: Thu, 27 Jul 2023 22:07:45 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v3 11/25] tools/xenstore: drop use of tdb
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-12-jgross@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230724110247.10520-12-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 24/07/2023 12:02, Juergen Gross wrote:
> Today all Xenstore nodes are stored in a TDB data base. This data base
> has several disadvantages:
> 
> - It is using a fixed sized hash table, resulting in high memory
>    overhead for small installations with only very few VMs, and a rather
>    large performance hit for systems with lots of VMs due to many
>    collisions.
>    The hash table size today is 7919 entries. This means that e.g. in
>    case of a simple desktop use case with 2 or 3 VMs probably far less
>    than 10% of the entries will be used (assuming roughly 100 nodes per
>    VM). OTOH a setup on a large server with 500 VMs would result in
>    heavy conflicts in the hash list with 5-10 nodes per hash table entry.
> 
> - TDB is using a single large memory area for storing the nodes. It
>    only ever increases this area and will never shrink it afterwards.
>    This will result in more memory usage than necessary after a peak of
>    Xenstore usage.
> 
> - Xenstore is only single-threaded, while TDB is designed to be fit
>    for multi-threaded use cases, resulting in much higher code
>    complexity than needed.
> 
> - Special use cases of Xenstore are not possible to implement with TDB
>    in an effective way, while an implementation of a data base tailored
>    for Xenstore could simplify some handling (e.g. transactions) a lot.
> 
> So drop using TDB and store the nodes directly in memory making them
> easily accessible. Use a hash-based lookup mechanism for fast lookup
> of nodes by their full path.
> 
> For now only replace TDB keeping the current access functions.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 21:21:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 21:21:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571271.894721 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP8QD-00075i-45; Thu, 27 Jul 2023 21:21:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571271.894721; Thu, 27 Jul 2023 21:21:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP8QD-00075b-1V; Thu, 27 Jul 2023 21:21:21 +0000
Received: by outflank-mailman (input) for mailman id 571271;
 Thu, 27 Jul 2023 21:21:19 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qP8QB-00075V-RF
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 21:21:19 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP8QA-00008V-Is; Thu, 27 Jul 2023 21:21:18 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP8QA-0001DV-C2; Thu, 27 Jul 2023 21:21:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:Subject:
	From:References:Cc:To:MIME-Version:Date:Message-ID;
	bh=5zdi4QBqdvXDyrF0kf0+hEysoRrCOprJWOcfuKhuCXk=; b=eu5Yy/qllyJoysOoKQzKepGj43
	zUeM3RvD9nGJaL/wpILJnMaODJrPhToOwWCrGlwcgknodng2/QTKhva+1dNVFtFAwyekFSCbs73xO
	uOmDMluWdhfAQnTCr6LQRJd01dRpvJwPGfnqo5o/lOOboiYO6PKscgxDN7scjpjH0Cfs=;
Message-ID: <de4f8574-c042-e2bb-a3ec-8bcee118a2c0@xen.org>
Date: Thu, 27 Jul 2023 22:21:16 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-15-jgross@suse.com>
From: Julien Grall <julien@xen.org>
Subject: Re: [PATCH v3 14/25] tools/xenstore: change talloc_free() to take a
 const pointer
In-Reply-To: <20230724110247.10520-15-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 24/07/2023 12:02, Juergen Gross wrote:
> With talloc_free() and related functions not taking a ponter to const

typo: s/ponter/pointer/

> it is tedious to use the const attribute for talloc()-ed memory in
> many cases.
> 
> Change the related prototypes to use "const void *" instead of
> "void *".
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
> V3:
> - new patch
> ---
>   tools/xenstore/talloc.c | 8 ++++----
>   tools/xenstore/talloc.h | 4 ++--
>   2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/xenstore/talloc.c b/tools/xenstore/talloc.c
> index 23c3a23b19..4f08dbec59 100644
> --- a/tools/xenstore/talloc.c
> +++ b/tools/xenstore/talloc.c
> @@ -319,7 +319,7 @@ static int talloc_unreference(const void *context, const void *ptr)
>     remove a specific parent context from a pointer. This is a more
>     controlled varient of talloc_free()
>   */
> -int talloc_unlink(const void *context, void *ptr)
> +int talloc_unlink(const void *context, const void *ptr)
>   {
>   	struct talloc_chunk *tc_p, *new_p;
>   	void *new_parent;
> @@ -499,7 +499,7 @@ void *talloc_init(const char *fmt, ...)
>     should probably not be used in new code. It's in here to keep the talloc
>     code consistent across Samba 3 and 4.
>   */
> -static void talloc_free_children(void *ptr)
> +static void talloc_free_children(const void *ptr)
>   {
>   	struct talloc_chunk *tc;
>   
> @@ -539,7 +539,7 @@ static void talloc_free_children(void *ptr)
>      will not be freed if the ref_count is > 1 or the destructor (if
>      any) returns non-zero
>   */
> -int talloc_free(void *ptr)
> +int talloc_free(const void *ptr)
>   {
>   	int saved_errno = errno;
>   	struct talloc_chunk *tc;
> @@ -571,7 +571,7 @@ int talloc_free(void *ptr)
>   			goto err;
>   		}
>   		tc->destructor = (talloc_destructor_t)-1;
> -		if (d(ptr) == -1) {
> +		if (d((void *)ptr) == -1) {

AFAICT, you can't propagate the const because the destructor may need to 
modify the content. I guess this is a necessary evil here but it would 
be good to document it.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 21:33:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 21:33:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571273.894732 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP8cB-0000Ab-6N; Thu, 27 Jul 2023 21:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571273.894732; Thu, 27 Jul 2023 21:33:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP8cB-0000AU-2w; Thu, 27 Jul 2023 21:33:43 +0000
Received: by outflank-mailman (input) for mailman id 571273;
 Thu, 27 Jul 2023 21:33:41 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qP8c9-0000AO-9a
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 21:33:41 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP8c8-0000Ld-4h; Thu, 27 Jul 2023 21:33:40 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP8c7-0001ls-VM; Thu, 27 Jul 2023 21:33:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:Subject:
	From:References:Cc:To:MIME-Version:Date:Message-ID;
	bh=cohKhqqDMS3ElVfBhQaGl3qoieADsThFpabz7Ql1bGQ=; b=ys55/4UIPJvY0TjKZDNFrCA496
	2/9oSXiTrv/JZpYHtOxbQmLvwRSVJ8nMguJXCMfCwk/LFDNsQ+Ju91mq8B1wnxrUeYGC5E70GThYP
	/KLXKmkxHEteeocK59PxwAjKbRibP/DvGESWMnJyP3+6OVFVMP9Bx3Ht1L7vICjDjjCY=;
Message-ID: <85b2d6a2-b9ee-4c8a-3a7a-cb22934af825@xen.org>
Date: Thu, 27 Jul 2023 22:33:38 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-17-jgross@suse.com>
From: Julien Grall <julien@xen.org>
Subject: Re: [PATCH v3 16/25] tools/xenstore: move copying of node data out of
 db_fetch()
In-Reply-To: <20230724110247.10520-17-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 24/07/2023 12:02, Juergen Gross wrote:
> Today the node data is copied in db_fetch() on each data base read in
> order to avoid accidental data base modifications when working on a
> node.
> 
> read_node() is the only caller of db_fetch() which isn't freeing the
> returned data area immediately after using it. The other callers don't
> modify the returned data, so they don't need the data to be copied.
> 
> Move copying of the data into read_node(), resulting in a speedup of
> the other callers due to no memory allocation and no copying being
> needed anymore.
> 
> This allows to let db_fetch() return a pointer to const data.
> 
> As db_fetch() can't return any error other than ENOENT now, error
> handling for the callers can be simplified.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
> V2:
> - new patch
> V3:
> - modify return type of db_fetch() to return a pointer to const
>    (Julien Grall)
> - drop stale comment (Julien Grall)
> - fix transaction handling
> ---
>   tools/xenstore/xenstored_core.c        | 45 +++++++++++---------------
>   tools/xenstore/xenstored_core.h        |  2 +-
>   tools/xenstore/xenstored_transaction.c | 23 +++++++++----
>   3 files changed, 35 insertions(+), 35 deletions(-)
> 
> diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
> index 9f88914149..1f5f118f1c 100644
> --- a/tools/xenstore/xenstored_core.c
> +++ b/tools/xenstore/xenstored_core.c
> @@ -555,10 +555,9 @@ static void initialize_fds(int *p_sock_pollfd_idx, int *ptimeout)
>   	}
>   }
>   
> -struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
> +const struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
>   {
> -	const struct xs_tdb_record_hdr *hdr;
> -	struct xs_tdb_record_hdr *p;
> +	struct xs_tdb_record_hdr *hdr;

Can't 'hdr' stay const?

>   
>   	hdr = hashtable_search(nodes, db_name);
>   	if (!hdr) {

[...]

> @@ -388,14 +385,26 @@ static int finalize_transaction(struct connection *conn,
>   		if (i->ta_node) {
>   			hdr = db_fetch(i->trans_name, &size);
>   			if (hdr) {
> +				/*
> +				 * Delete transaction entry and write it as
> +				 * no-TA entry. As we only hold a reference
> +				 * to the data, increment its ref count, then
> +				 * delete it from the DB. Now we own it and can
> +				 * drop the const attribute for changing the

It is not great, but I understand this is another necessary evil. So I 
am ok with this cast-away const. It is also well documented.

> +				 * generation count.
> +				 */
>   				enum write_node_mode mode;
> +				struct xs_tdb_record_hdr *own;
>   
> -				hdr->generation = ++generation;
> +				talloc_increase_ref_count(hdr);
> +				db_delete(conn, i->trans_name, NULL);
> +
> +				own = (struct xs_tdb_record_hdr *)hdr;
> +				own->generation = ++generation;
>   				mode = (i->generation == NO_GENERATION)
>   				       ? NODE_CREATE : NODE_MODIFY;
> -				*is_corrupt |= db_write(conn, i->node, hdr,
> +				*is_corrupt |= db_write(conn, i->node, own,
>   							size, NULL, mode, true);
> -				db_delete(conn, i->trans_name, NULL);
>   			} else {
>   				*is_corrupt = true;
>   			}

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 21:40:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 21:40:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571275.894741 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP8ij-0001fK-Rl; Thu, 27 Jul 2023 21:40:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571275.894741; Thu, 27 Jul 2023 21:40:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP8ij-0001fD-PE; Thu, 27 Jul 2023 21:40:29 +0000
Received: by outflank-mailman (input) for mailman id 571275;
 Thu, 27 Jul 2023 21:40:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=38O5=DN=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qP8ii-0001f7-Eq
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 21:40:28 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on2061a.outbound.protection.outlook.com
 [2a01:111:f400:fe13::61a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 32343567-2cc6-11ee-b24a-6b7b168915f2;
 Thu, 27 Jul 2023 23:40:26 +0200 (CEST)
Received: from FR0P281CA0220.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:ac::15)
 by VI1PR08MB10146.eurprd08.prod.outlook.com (2603:10a6:800:1cf::11) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 21:40:14 +0000
Received: from VI1EUR03FT022.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:d10:ac:cafe::1) by FR0P281CA0220.outlook.office365.com
 (2603:10a6:d10:ac::15) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.5 via Frontend
 Transport; Thu, 27 Jul 2023 21:40:14 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 VI1EUR03FT022.mail.protection.outlook.com (100.127.144.146) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6631.29 via Frontend Transport; Thu, 27 Jul 2023 21:40:13 +0000
Received: ("Tessian outbound 95df046a2e2c:v145");
 Thu, 27 Jul 2023 21:40:12 +0000
Received: from 4cdbf829b447.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 E7963863-C1F8-42C0-895F-446B5CEBC010.1; 
 Thu, 27 Jul 2023 21:40:05 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4cdbf829b447.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 27 Jul 2023 21:40:05 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by AS4PR08MB8117.eurprd08.prod.outlook.com (2603:10a6:20b:589::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul
 2023 21:40:03 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::4c7d:6a1:e742:3b1a]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::4c7d:6a1:e742:3b1a%4]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023
 21:40:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 32343567-2cc6-11ee-b24a-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=xvcdRNJKFcgA7Gw3ycCy8A24id4pk5gEOPgrY70Uw3Q=;
 b=82jWLUPf1FfIgb2PkaCMEVBVX5eZlE9/aKV4dpXZKvnC97CaVclRQ1TO3Mso5gnh6ca3t/C1nGjv2N7TaTu5hug//nAwutGI4inl5CCTWDWYTc64KuhI/cW2AbgyLshdC83+KCqDPo7F8jnoa1Hdy9wqAvvT5C7BxttMNYeuIvE=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 0499229aeb0a088d
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=iw4J7plKTO726qlcIuOBWUYqprqJ6eDXiFwUYjkLuUKXxPdS94HVs1DgIp8dLL2GChTFzgALSSmkb/Ex44s+3Y+mQR4FNU8CA3r4+LeO2Sr0YYF7EwL7id+VnzHaVQASu28V6T2PmtR4I5gxSz2WwfXm5tB04JYfKwfNqNDsFySxanRi7J1EsKb40zeNNvyzHpgzceIX4Oh9lt7AFK7QrWJXq+ajTjMWxNssRjg4PduqtXyTvmLHthdb0oqMMH3RNt8JJHkvIcm6rtyTtxg8lHTz9cxdJp3qvzsWZTdnHRpGZK7D3iWn7ebD6U875btLeRbkUkO3ebxNGY5PANH1kA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=xvcdRNJKFcgA7Gw3ycCy8A24id4pk5gEOPgrY70Uw3Q=;
 b=QMPPNsLIuSyzE8aoha+63PUi6ZTxJ0lFjlzMDlsPz276QuydCmszc8lVR+Zgw1FYoL2EadVjZiFEzDwJzUS+Vmw8SmWO+PT/ZEqSaCDfte7ycaenWPCKcHq/RS6lIOGejlxDcmh3Tsg077lI1sAft4qACUGfTvDoziM4V+V9yUxGfHyaAL4A9G5cwiE6ozeBJlQWfTyG+dsvlYt1bkkZvfcnDLKfuBqtXfYd/8M8Zz7npS3bqkCPYVj00XKRoQmXMYMUPTVVSTyNuwO7zPkhN/V9d/8hGdvfEEyxS/DJYoUmmj0tzPWhMf0pdJuLQYfA6zGUXVR45iolC4G0W6P6GQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=xvcdRNJKFcgA7Gw3ycCy8A24id4pk5gEOPgrY70Uw3Q=;
 b=82jWLUPf1FfIgb2PkaCMEVBVX5eZlE9/aKV4dpXZKvnC97CaVclRQ1TO3Mso5gnh6ca3t/C1nGjv2N7TaTu5hug//nAwutGI4inl5CCTWDWYTc64KuhI/cW2AbgyLshdC83+KCqDPo7F8jnoa1Hdy9wqAvvT5C7BxttMNYeuIvE=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Federico Serafini <federico.serafini@bugseng.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, "consulting@bugseng.com"
	<consulting@bugseng.com>, Tamas K Lengyel <tamas@tklengyel.com>, Alexandru
 Isaila <aisaila@bitdefender.com>, Petre Pircalabu
	<ppircalabu@bitdefender.com>
Subject: Re: [XEN PATCH] xen: change parameter name in monitor_domctl()
 declaration
Thread-Topic: [XEN PATCH] xen: change parameter name in monitor_domctl()
 declaration
Thread-Index: AQHZwKAdkZBLFcaVa0mNCdGLOUG1rK/OJH6A
Date: Thu, 27 Jul 2023 21:40:02 +0000
Message-ID: <B7758406-B190-46E4-9416-F14E7B4C7986@arm.com>
References:
 <6a25e9d729e85ba5712fd00f9c0514a459bb7631.1690471420.git.federico.serafini@bugseng.com>
In-Reply-To:
 <6a25e9d729e85ba5712fd00f9c0514a459bb7631.1690471420.git.federico.serafini@bugseng.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|AS4PR08MB8117:EE_|VI1EUR03FT022:EE_|VI1PR08MB10146:EE_
X-MS-Office365-Filtering-Correlation-Id: 72b81df2-a04e-4a99-f70d-08db8eea0f52
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 LOpE6aRctB09s6R4f28FnqP9D80u4zKmI61GAv7XIhkGKJoS5pZ6QDL5qvMdsKN5QH4t2OIrfFBkL/6qIgXtAagDsfpeZyOcrytHm/XRIHWIZVOF59WDCGTf3OjGyYcECvVoEQIJFTDul5h8bnoEK5okicwOYuyg1KaktkwxYrgXzQJIgDB4hG3UL+LNBa7hFP/S+jB5EEBRP/mUS9A/0jeP9nsFdI6pI9HFdOkKKxJqGvKYlWUsmG5VS7WG6xjrWJ5PMkkGA0hv04my8YiOG2ty5bBje6HwuKCEE9L3qdSNG8EwaRIXRK+/dpdUFDaQ39qLG5sVaTLI+R2z9QyhPOhJS1GXBTodJE9QtCtGEVuhPoBEy47mu1ugrMun+gVDb7x21WIHXIwDM04pXp2YcUmQlIgADqUIi1DRFG0FKjTCMuWmQrRvHPryougmOADXnP2Ed5APt/A5S+HeqtbPQ5P5hpPIOWStPpJc8IZAkhGkL2EwRl0wX59f6AUeHANvggSnzU81Mv51+El1CjwXkNaHpEgV0kXOlPC/YpQrHiCBhcuxHHiRdhR6Ou0VCkkZQZQpt5sPrSGrzfu7eEihBpSoUSEBTHitHDSMUHiI4Strq2UdCnEoh1ilWIKtXMq8uoUAmJaPKiMTbS2IPZ0Lhg==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(136003)(346002)(376002)(39860400002)(451199021)(86362001)(33656002)(122000001)(36756003)(38070700005)(4744005)(54906003)(2906002)(478600001)(38100700002)(66556008)(2616005)(26005)(186003)(53546011)(71200400001)(6506007)(66946007)(4326008)(5660300002)(6486002)(6512007)(76116006)(91956017)(66476007)(66446008)(41300700001)(8676002)(64756008)(6916009)(8936002)(316002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <0899EF4CF063EC4286304A0CB3044E42@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB8117
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 VI1EUR03FT022.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	737b854b-d4fd-41f2-c5bb-08db8eea0924
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	IZlr2E4Mq6pednZqVvnEViOj4699GTqvWwEqOzd84830QAT5rxNNYqSXdPI/aDw33/nDLVw3yiEBxrQwCYhe/ACTJqvINEsohfo4zK6Qy3tRJU94QyCP2hKc19Bg8mZsoUTRA8V8jocVCYhB18A/HA+U/ETP8j+MWTrsfHIVHfo+lcuAi4KfoCVO1ip5z6U1luqOdS7FOyM9SGkzMK1SGd0oo10RkcCkX/o+8TVaIvKKhafJz4SvcIuh/PiAx5gm11vBO7VOw5s67z00HkqQtez325CXpZ83beWMJD6kzAD1J3C3QuMPehO1d34uAkRG+ZPRUDDvbvJkSSbLO5mYhp/XiJfR73dccpK7iWPMQWiCGvUZSfOAdw9415mYq2OM3cIlcS6n8nG8R3fRgyJvJMVntXYCgPa0+bdfUQUZzNkHGPv8zVjN8J6HS/swX+0xsmFaCjcv91N8ESLDvPMRj1CvWeMJ4MtGvrKe/kB0T2M4AEMxPrgfm9xM/XoaS8jSVwxCI4nltVzYi9kQRhKpFOakI37pRGZ0Rqz/D9I1AbhvTfLVpmIEbNUJJWOyzogUoF+yE4HO05oNgIY9ardo9jq0icmX8ZsSLssuL2LrOXNted+BI089t68Uehi/ovbRVUG+yxuAsWCatBt8gHoq8eX9fKFHF4uIpRiZbs6b1rvRwlFzt/PEsbJ0TeP3E9425NDPSxYao2BCgybBLQ4sL15f4chCf0gom6fvo0x0UUazPjz/1ePydBf92O4oAQ0g
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(39860400002)(136003)(346002)(451199021)(82310400008)(40470700004)(46966006)(36840700001)(107886003)(40460700003)(26005)(336012)(186003)(47076005)(8936002)(53546011)(6506007)(2616005)(70206006)(4326008)(316002)(8676002)(5660300002)(6512007)(6486002)(6862004)(36860700001)(41300700001)(70586007)(40480700001)(4744005)(478600001)(2906002)(54906003)(36756003)(33656002)(81166007)(86362001)(82740400003)(356005);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 21:40:13.2394
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 72b81df2-a04e-4a99-f70d-08db8eea0f52
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	VI1EUR03FT022.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB10146



> On 27 Jul 2023, at 16:35, Federico Serafini <federico.serafini@bugseng.co=
m> wrote:
>=20
> Change parameter name in monitor_domctl() declaration for
> consistency with the corresponding definition.
> This addresses a violation of MISRA C:2012 Rule 8.3: "All declarations
> of an object or function shall use the same names and type qualifiers".
>=20
> No functional changes.
>=20
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>



From xen-devel-bounces@lists.xenproject.org Thu Jul 27 21:53:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 21:53:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571278.894752 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP8vP-0003Mz-0V; Thu, 27 Jul 2023 21:53:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571278.894752; Thu, 27 Jul 2023 21:53:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP8vO-0003Ms-Tq; Thu, 27 Jul 2023 21:53:34 +0000
Received: by outflank-mailman (input) for mailman id 571278;
 Thu, 27 Jul 2023 21:53:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qP8vN-0003Mi-I3
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 21:53:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP8vM-0000or-Bg; Thu, 27 Jul 2023 21:53:32 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP8vM-0002Pr-5o; Thu, 27 Jul 2023 21:53:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:Subject:
	From:References:Cc:To:MIME-Version:Date:Message-ID;
	bh=TISJ2XuhdxJPN9lbAfjWf4Mb9yyp86YpyDdTAW16H7U=; b=Y/2HpGre8g+cFsM6kVEvegTLVg
	Lt8CUi4CvbcIMD23By7w4p5s19EmDaf3LSFo3wZ0+En7FTwrvqUeuUD5UDqXgSpIydgGHIgYd2uLN
	c+Xk/RDV99waAUGjKQrkPo3EKQ3pBBbKWR+X0egFkqPUVsqi4C7NEhaZaiN/ed4w5yvI=;
Message-ID: <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
Date: Thu, 27 Jul 2023 22:53:30 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
From: Julien Grall <julien@xen.org>
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
In-Reply-To: <20230724110247.10520-18-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 24/07/2023 12:02, Juergen Gross wrote:
> Struct xs_tdb_record_hdr is used for nodes stored in the data base.
> When working on a node, struct node is being used, which is including
> the same information as struct xs_tdb_record_hdr, but in a different
> format. Rework struct xs_tdb_record_hdr in order to prepare including
> it in struct node.
> 
> Do the following modifications:
> 
> - move its definition to xenstored_core.h, as the reason to put it into
>    utils.h are no longer existing
> 
> - rename it to struct node_hdr, as the "tdb" in its name has only
>    historical reasons
> 
> - replace the empty permission array at the end with a comment about
>    the layout of data in the data base (concatenation of header,
>    permissions, node contents, and children list)
> 
> - use narrower types for num_perms and datalen, as those are naturally
>    limited to XENSTORE_PAYLOAD_MAX (childlen is different here, as it is
>    in theory basically unlimited)

The assumption is XENSTORE_PAYLOAD_MAX will never change and/or always 
apply for all the connection. I am aware of at least one downstream use 
where this is not the case.

I am happy to use narrower types, but I would at least like some checks 
in Xenstore to ensure the limits are not reached.

> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
> V2:
> - new patch
> ---
>   tools/xenstore/utils.h                 |  9 -------
>   tools/xenstore/xenstored_core.c        | 35 +++++++++++++++-----------
>   tools/xenstore/xenstored_core.h        | 20 ++++++++++++++-
>   tools/xenstore/xenstored_transaction.c |  6 ++---
>   4 files changed, 42 insertions(+), 28 deletions(-)
> 
> diff --git a/tools/xenstore/utils.h b/tools/xenstore/utils.h
> index 028ecb9d7a..405d662ea2 100644
> --- a/tools/xenstore/utils.h
> +++ b/tools/xenstore/utils.h
> @@ -9,15 +9,6 @@
>   
>   #include "xenstore_lib.h"
>   
> -/* Header of the node record in tdb. */
> -struct xs_tdb_record_hdr {
> -	uint64_t generation;
> -	uint32_t num_perms;
> -	uint32_t datalen;
> -	uint32_t childlen;
> -	struct xs_permissions perms[0];
> -};
> -
>   /* Is A == B ? */
>   #define streq(a,b) (strcmp((a),(b)) == 0)
>   
> diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
> index 1f5f118f1c..86b7c9bf36 100644
> --- a/tools/xenstore/xenstored_core.c
> +++ b/tools/xenstore/xenstored_core.c
> @@ -555,9 +555,9 @@ static void initialize_fds(int *p_sock_pollfd_idx, int *ptimeout)
>   	}
>   }
>   
> -const struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
> +const struct node_hdr *db_fetch(const char *db_name, size_t *size)
>   {
> -	struct xs_tdb_record_hdr *hdr;
> +	struct node_hdr *hdr;
>   
>   	hdr = hashtable_search(nodes, db_name);
>   	if (!hdr) {
> @@ -565,7 +565,7 @@ const struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
>   		return NULL;
>   	}
>   
> -	*size = sizeof(*hdr) + hdr->num_perms * sizeof(hdr->perms[0]) +
> +	*size = sizeof(*hdr) + hdr->num_perms * sizeof(struct xs_permissions) +
>   		hdr->datalen + hdr->childlen;
>   
>   	trace_tdb("read %s size %zu\n", db_name, *size + strlen(db_name));
> @@ -573,10 +573,15 @@ const struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size)
>   	return hdr;
>   }
>   
> +static struct xs_permissions *perms_from_node_hdr(const struct node_hdr *hdr)

I don't much like the casting-away the const here. Looking at the code, 
most of the users seems to not modify the value. So how about return 
const here and open-coding or casting-away the const in the caller (with 
a proper explanation)?

> +{
> +	return (struct xs_permissions *)(hdr + 1);
> +}
> +
>   static void get_acc_data(const char *name, struct node_account_data *acc)
>   {
>   	size_t size;
> -	const struct xs_tdb_record_hdr *hdr;
> +	const struct node_hdr *hdr;
>   
>   	if (acc->memory < 0) {
>   		hdr = db_fetch(name, &size);
> @@ -585,7 +590,7 @@ static void get_acc_data(const char *name, struct node_account_data *acc)
>   			acc->memory = 0;
>   		} else {
>   			acc->memory = size;
> -			acc->domid = hdr->perms[0].id;
> +			acc->domid = perms_from_node_hdr(hdr)->id;
>   		}
>   	}
>   }
> @@ -606,7 +611,7 @@ int db_write(struct connection *conn, const char *db_name, const void *data,
>   	     size_t size, struct node_account_data *acc,
>   	     enum write_node_mode mode, bool no_quota_check)
>   {
> -	const struct xs_tdb_record_hdr *hdr = data;
> +	const struct node_hdr *hdr = data;
>   	struct node_account_data old_acc = {};
>   	unsigned int old_domid, new_domid;
>   	size_t name_len = strlen(db_name);
> @@ -620,7 +625,7 @@ int db_write(struct connection *conn, const char *db_name, const void *data,
>   
>   	get_acc_data(db_name, &old_acc);
>   	old_domid = get_acc_domid(conn, db_name, old_acc.domid);
> -	new_domid = get_acc_domid(conn, db_name, hdr->perms[0].id);
> +	new_domid = get_acc_domid(conn, db_name, perms_from_node_hdr(hdr)->id);
>   
>   	/*
>   	 * Don't check for ENOENT, as we want to be able to switch orphaned
> @@ -661,7 +666,7 @@ int db_write(struct connection *conn, const char *db_name, const void *data,
>   
>   	if (acc) {
>   		/* Don't use new_domid, as it might be a transaction node. */
> -		acc->domid = hdr->perms[0].id;
> +		acc->domid = perms_from_node_hdr(hdr)->id;
>   		acc->memory = size;
>   	}
>   
> @@ -699,7 +704,7 @@ struct node *read_node(struct connection *conn, const void *ctx,
>   		       const char *name)
>   {
>   	size_t size;
> -	const struct xs_tdb_record_hdr *hdr;
> +	const struct node_hdr *hdr;
>   	struct node *node;
>   	const char *db_name;
>   	int err;
> @@ -733,12 +738,12 @@ struct node *read_node(struct connection *conn, const void *ctx,
>   	node->perms.num = hdr->num_perms;
>   	node->datalen = hdr->datalen;
>   	node->childlen = hdr->childlen;
> -	node->acc.domid = hdr->perms[0].id;
> +	node->acc.domid = perms_from_node_hdr(hdr)->id;
>   	node->acc.memory = size;
>   
>   	/* Copy node data to new memory area, starting with permissions. */
>   	size -= sizeof(*hdr);
> -	node->perms.p = talloc_memdup(node, hdr->perms, size);
> +	node->perms.p = talloc_memdup(node, perms_from_node_hdr(hdr), size);
>   	if (node->perms.p == NULL) {
>   		errno = ENOMEM;
>   		goto error;
> @@ -785,7 +790,7 @@ int write_node_raw(struct connection *conn, const char *db_name,
>   	void *data;
>   	size_t size;
>   	void *p;
> -	struct xs_tdb_record_hdr *hdr;
> +	struct node_hdr *hdr;
>   
>   	if (domain_adjust_node_perms(node))
>   		return errno;
> @@ -812,9 +817,9 @@ int write_node_raw(struct connection *conn, const char *db_name,
>   	hdr->datalen = node->datalen;
>   	hdr->childlen = node->childlen;
>   
> -	memcpy(hdr->perms, node->perms.p,
> -	       node->perms.num * sizeof(*node->perms.p));
> -	p = hdr->perms + node->perms.num;
> +	p = perms_from_node_hdr(hdr);
> +	memcpy(p, node->perms.p, node->perms.num * sizeof(*node->perms.p));
> +	p += node->perms.num * sizeof(*node->perms.p);
>   	memcpy(p, node->data, node->datalen);
>   	p += node->datalen;
>   	memcpy(p, node->children, node->childlen);
> diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
> index 6d1578ce97..c965709090 100644
> --- a/tools/xenstore/xenstored_core.h
> +++ b/tools/xenstore/xenstored_core.h
> @@ -168,6 +168,24 @@ struct connection
>   };
>   extern struct list_head connections;
>   
> +/*
> + * Header of the node record in the data base.
> + * In the data base the memory of the node is a single memory chunk with the
> + * following format:
> + * struct {
> + *     node_hdr hdr;
> + *     struct xs_permissions perms[hdr.num_perms];
> + *     char data[hdr.datalen];
> + *     char children[hdr.childlen];
> + * };
> + */
> +struct node_hdr {
> +	uint64_t generation;
> +	uint16_t num_perms;

OOI, do you have a use case where a node would be shared with more than 
255 domains?

> +	uint16_t datalen;
> +	uint32_t childlen;
> +};
> +
>   struct node_perms {
>   	unsigned int num;
>   	struct xs_permissions *p;
> @@ -362,7 +380,7 @@ extern xengnttab_handle **xgt_handle;
>   int remember_string(struct hashtable *hash, const char *str);
>   
>   /* Data base access functions. */
> -const struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size);
> +const struct node_hdr *db_fetch(const char *db_name, size_t *size);
>   int db_write(struct connection *conn, const char *db_name, const void *data,
>   	     size_t size, struct node_account_data *acc,
>   	     enum write_node_mode mode, bool no_quota_check);
> diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
> index a90283dcc5..9ca73b9874 100644
> --- a/tools/xenstore/xenstored_transaction.c
> +++ b/tools/xenstore/xenstored_transaction.c
> @@ -357,7 +357,7 @@ static int finalize_transaction(struct connection *conn,
>   {
>   	struct accessed_node *i, *n;
>   	size_t size;
> -	const struct xs_tdb_record_hdr *hdr;
> +	const struct node_hdr *hdr;
>   	uint64_t gen;
>   
>   	list_for_each_entry_safe(i, n, &trans->accessed, list) {
> @@ -394,12 +394,12 @@ static int finalize_transaction(struct connection *conn,
>   				 * generation count.
>   				 */
>   				enum write_node_mode mode;
> -				struct xs_tdb_record_hdr *own;
> +				struct node_hdr *own;
>   
>   				talloc_increase_ref_count(hdr);
>   				db_delete(conn, i->trans_name, NULL);
>   
> -				own = (struct xs_tdb_record_hdr *)hdr;
> +				own = (struct node_hdr *)hdr;
>   				own->generation = ++generation;
>   				mode = (i->generation == NO_GENERATION)
>   				       ? NODE_CREATE : NODE_MODIFY;

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 21:54:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 21:54:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571283.894763 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP8vx-0003sY-G5; Thu, 27 Jul 2023 21:54:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571283.894763; Thu, 27 Jul 2023 21:54:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP8vx-0003sR-BI; Thu, 27 Jul 2023 21:54:09 +0000
Received: by outflank-mailman (input) for mailman id 571283;
 Thu, 27 Jul 2023 21:54:08 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qP8vw-0003sC-Ix; Thu, 27 Jul 2023 21:54:08 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qP8vw-0000rN-HH; Thu, 27 Jul 2023 21:54:08 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qP8vw-0005Jk-4i; Thu, 27 Jul 2023 21:54:08 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qP8vw-00022v-4B; Thu, 27 Jul 2023 21:54:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=hH/EHqxRTcza8TwBYRMc9OLTzwrn4ayG9Io7mzAW/qA=; b=1Zwj33bpjC/4dGTWiqEZyRZUBi
	wllqv/tYxfF7tuLoi9bEOp7iHraG4lwJHrgVLZ1lldgwzTfi+OKVX5Ubn28GVDY3BSVdLl7niw32/
	QdOXMCsXA+N8LGXkQ3Jgc6xfjW4CxVh0KLQaWu/3XLpJBdL3rvxcjqjoHnlKCytMOq8Y=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182030-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 182030: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=8e958c1644185eeaece0a724d9ff8674c4edce38
X-Osstest-Versions-That:
    libvirt=ea4c67f56769b292fdb03dc3e626bde22111c79d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 27 Jul 2023 21:54:08 +0000

flight 182030 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182030/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182021
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 182021
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 182021
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 libvirt              8e958c1644185eeaece0a724d9ff8674c4edce38
baseline version:
 libvirt              ea4c67f56769b292fdb03dc3e626bde22111c79d

Last test of basis   182021  2023-07-26 10:25:25 Z    1 days
Testing same since   182030  2023-07-27 04:18:55 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Fedora Weblate Translation <i18n@lists.fedoraproject.org>
  Jiri Denemark <jdenemar@redhat.com>
  Weblate <noreply@weblate.org>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   ea4c67f567..8e958c1644  8e958c1644185eeaece0a724d9ff8674c4edce38 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 22:00:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 22:00:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571287.894772 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP924-0005UD-4I; Thu, 27 Jul 2023 22:00:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571287.894772; Thu, 27 Jul 2023 22:00:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP924-0005U6-1a; Thu, 27 Jul 2023 22:00:28 +0000
Received: by outflank-mailman (input) for mailman id 571287;
 Thu, 27 Jul 2023 22:00:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qP923-0005Tz-6X
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 22:00:27 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP922-0000zg-KJ; Thu, 27 Jul 2023 22:00:26 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP922-0002p2-DU; Thu, 27 Jul 2023 22:00:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:
	References:Cc:To:From:Subject:MIME-Version:Date:Message-ID;
	bh=lLoYQA7k/qppC6HysORTbwHJqLjG/TNuBxycYE8vzms=; b=NoR2x8nqUOdJMb3/u3MKVhasZ8
	xgyeU/Bc1nWeJzhOClduB7XCyGERaktJCvDqW84BOlhQCM8Ay8c9H8DLG1RD5yeWLygC1tAI/iWca
	0GFvG2Pbhs5gwuagF92hiRyw43ThLm4o8cqM7n33R81iuHTIp/ynOluqLxO+d/Avdx1A=;
Message-ID: <00f7cbe3-9a37-d136-4e96-400ed2518581@xen.org>
Date: Thu, 27 Jul 2023 23:00:24 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v3] xen/arm: Move TEE mediators in a kconfig submenu
From: Julien Grall <julien@xen.org>
To: Bertrand Marquis <bertrand.marquis@arm.com>,
 xen-devel@lists.xenproject.org
Cc: jens.wiklander@linaro.org, Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <5f10382a15ca7b221a052915347e4e59f66b001f.1690297570.git.bertrand.marquis@arm.com>
 <bfa643fe-4b8f-c8bf-2b13-fd699c6816c5@xen.org>
In-Reply-To: <bfa643fe-4b8f-c8bf-2b13-fd699c6816c5@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 25/07/2023 16:45, Julien Grall wrote:
> Hi Bertrand,
> 
> On 25/07/2023 16:42, Bertrand Marquis wrote:
>> Rework TEE mediators to put them under a submenu in Kconfig.
>> The submenu is only visible if UNSUPPORTED is activated as all currently
>> existing mediators are UNSUPPORTED.
>>
>> While there rework a bit the configuration so that OP-TEE and FF-A
>> mediators are selecting the generic TEE interface instead of depending
>> on it.
>> Make the TEE option hidden as it is of no interest for anyone to select
>> it without one of the mediators so having them select it instead should
>> be enough.
>>
>> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
> 
> Reviewed-by: Julien Grall <jgrall@amazon.com>

I have committed it.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 22:03:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 22:03:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571289.894781 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP94q-000631-Gu; Thu, 27 Jul 2023 22:03:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571289.894781; Thu, 27 Jul 2023 22:03:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP94q-00062u-ER; Thu, 27 Jul 2023 22:03:20 +0000
Received: by outflank-mailman (input) for mailman id 571289;
 Thu, 27 Jul 2023 22:03:19 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qP94p-00062o-KX
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 22:03:19 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP94p-00011v-7g; Thu, 27 Jul 2023 22:03:19 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP94p-0002uz-33; Thu, 27 Jul 2023 22:03:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=uj2S3YzBIVY3m1lJsG1LdhTzIvHm6E6tuA+UWGIT75g=; b=X9atb07MkkEc+JN/hJwiiJE9LN
	1en/fXfV0DYLQ5bNlsV38L5u8pS1cEskFqC79IE2Urizr4N2ttEJeUWZWL7m3ytDVXK9K4osZJQTs
	OV15sR3fDCbEZivwIi+2X0f5TrJd/Fqyrz7SL05iLvxVAQLNuEX6q15KJaY9hV0uq+us=;
Message-ID: <a3731224-0984-49b9-d386-8656e1454534@xen.org>
Date: Thu, 27 Jul 2023 23:03:17 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v3] device_tree: address violations of MISRA C:2012
 Rules 8.2 and 8.3
To: Stefano Stabellini <sstabellini@kernel.org>,
 Federico Serafini <federico.serafini@bugseng.com>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com
References: <982ad65413e08e8c10ef035cb8246ba7277ff01b.1690292999.git.federico.serafini@bugseng.com>
 <alpine.DEB.2.22.394.2307251223470.3118466@ubuntu-linux-20-04-desktop>
From: Julien Grall <julien@xen.org>
In-Reply-To: <alpine.DEB.2.22.394.2307251223470.3118466@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 25/07/2023 20:23, Stefano Stabellini wrote:
> On Tue, 25 Jul 2023, Federico Serafini wrote:
>> Give a name to unnamed parameters thus addressing violations of
>> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
>> named parameters").
>> Keep consistency between parameter names and types used in function
>> declarations and the ones used in the corresponding function
>> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
>> ("All declarations of an object or function shall use the same names
>> and type qualifiers").
>>
>> No functional changes.
>>
>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

I have committed the patch.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 22:08:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 22:08:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571291.894792 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP99r-0006fB-4w; Thu, 27 Jul 2023 22:08:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571291.894792; Thu, 27 Jul 2023 22:08:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP99r-0006f4-1L; Thu, 27 Jul 2023 22:08:31 +0000
Received: by outflank-mailman (input) for mailman id 571291;
 Thu, 27 Jul 2023 22:08:29 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qP99p-0006ey-TF
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 22:08:29 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP99p-00016s-Jj; Thu, 27 Jul 2023 22:08:29 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP99p-0003AR-DY; Thu, 27 Jul 2023 22:08:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=Ty1W4hT/Eg2ClQkGebCYdqEBnm1Aluw4dXTjpv0V1Hg=; b=FtOZw/t7P3OG0EHTXQWP0NKVu9
	aD4ykPcUTE/SQE6uikN7zAHqXPlJfue5vZ7wQdjy+45nopNaqHctyKS7zku5kHNtpyzVd/UYG8cTd
	zhVb8oxrZ/rf0EJKpMUtJ24Wsl8l1A2mEzGQNj2QTZNl2lGzHs3tiZ9++oClM5ZTP+AY=;
Message-ID: <258a6383-e6a9-c311-beb5-3284c812c50a@xen.org>
Date: Thu, 27 Jul 2023 23:08:27 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [PATCH v2] xen/arm32: head: Widen the use of the temporary
 mapping
To: Luca Fancellu <Luca.Fancellu@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 Henry Wang <Henry.Wang@arm.com>, Julien Grall <jgrall@amazon.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230724101458.79412-1-julien@xen.org>
 <AD86AD11-2FFC-4276-B0B4-F0E370F22EBC@arm.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <AD86AD11-2FFC-4276-B0B4-F0E370F22EBC@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 24/07/2023 18:15, Luca Fancellu wrote:
> 
> 
>> On 24 Jul 2023, at 11:14, Julien Grall <julien@xen.org> wrote:
>>
>> From: Julien Grall <jgrall@amazon.com>
>>
>> At the moment, the temporary mapping is only used when the virtual
>> runtime region of Xen is clashing with the physical region.
>>
>> In follow-up patches, we will rework how secondary CPU bring-up works
>> and it will be convenient to use the fixmap area for accessing
>> the root page-table (it is per-cpu).
>>
>> Rework the code to use temporary mapping when the Xen physical address
>> is not overlapping with the temporary mapping.
>>
>> This also has the advantage to simplify the logic to identity map
>> Xen.
>>
>> Signed-off-by: Julien Grall <jgrall@amazon.com>
> 
> Hi Julien,
> 
> Seems good to me, Iâ€™ve also tested on qemu and FVP, creating/destroying guests and no issues so far.
> 
> Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
> Tested-by: Luca Fancellu <luca.fancellu@arm.com>

Thanks. I have committed with Henry's tag. But I also realized that I 
forgot to strip the changelog :/.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 22:15:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 22:15:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571293.894803 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP9Gg-000885-SU; Thu, 27 Jul 2023 22:15:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571293.894803; Thu, 27 Jul 2023 22:15:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP9Gg-00087y-Ng; Thu, 27 Jul 2023 22:15:34 +0000
Received: by outflank-mailman (input) for mailman id 571293;
 Thu, 27 Jul 2023 22:15:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qP9Gf-00087s-IZ
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 22:15:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP9Ga-0001F4-Pu; Thu, 27 Jul 2023 22:15:28 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.102])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qP9Ga-0003V4-JK; Thu, 27 Jul 2023 22:15:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=Ac89RsOI6epHm8N86imvKKTEVHhmoqW3rtla8oMxjpw=; b=mxQsbg8bxzoqp2PSBJDSTOZ1Ve
	S+Xh4Sk7GkxtjOnuMQ/GN7RVGJjUOhrJbcjMELEy2rAdqoFTKXjw4yjlVNqo+k2/WgwZyhBrWw8MI
	Il8wrO46aekgxxMYzq2Csmg0lk7ywokTWd9KHwWvQvpvJtuF4dVrP4+trOibX3z84Of8=;
Message-ID: <2ebcadb0-2442-f893-d54c-5e86607cc77d@xen.org>
Date: Thu, 27 Jul 2023 23:15:26 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v3] xen/spinlock: mechanically rename parameter name
 'debug'
To: Stefano Stabellini <sstabellini@kernel.org>,
 Jan Beulich <jbeulich@suse.com>
Cc: Nicola Vetrini <nicola.vetrini@bugseng.com>, michal.orzel@amd.com,
 xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <a66f1084686b77b098c5ccf3d0cf5f52980fdf5a.1690317797.git.nicola.vetrini@bugseng.com>
 <11a3ae18-508b-cf08-2803-bc4aaeec7353@suse.com>
 <f424fc5b-6266-3d04-b494-0448fa453b75@bugseng.com>
 <8914bf47-c4ca-4a14-6a92-b5b23ee739a0@suse.com>
 <alpine.DEB.2.22.394.2307261448010.3118466@ubuntu-linux-20-04-desktop>
 <d099b736-22cf-0502-df37-9ae7b14d048a@suse.com>
 <alpine.DEB.2.22.394.2307271233480.3118466@ubuntu-linux-20-04-desktop>
From: Julien Grall <julien@xen.org>
In-Reply-To: <alpine.DEB.2.22.394.2307271233480.3118466@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 27/07/2023 20:35, Stefano Stabellini wrote:
> On Thu, 27 Jul 2023, Jan Beulich wrote:
>> On 26.07.2023 23:49, Stefano Stabellini wrote:
>>> On Wed, 26 Jul 2023, Jan Beulich wrote:
>>>> On 26.07.2023 08:42, Nicola Vetrini wrote:
>>>>> On 26/07/23 08:34, Jan Beulich wrote:
>>>>>> On 25.07.2023 22:45, Nicola Vetrini wrote:
>>>>>>> Rule 5.3 has the following headline:
>>>>>>> "An identifier declared in an inner scope shall not hide an
>>>>>>> identifier declared in an outer scope"
>>>>>>>
>>>>>>> To avoid any confusion resulting from the parameter 'debug'
>>>>>>> hiding the homonymous function declared at
>>>>>>> 'xen/arch/x86/include/asm/processor.h:428'
>>>>>>> the rename of parameters s/debug/lkdbg/ is performed.
>>>>>>>
>>>>>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>>>>>> ---
>>>>>>> Changes in v2:
>>>>>>> - s/dbg/lkdbg/
>>>>>>> Changes in v3:
>>>>>>> - Added missing renames for consistency
>>>>>>
>>>>>> Hmm, you asked whether to send v3, but then you didn't wait for an
>>>>>> answer. So to repeat what I said there: I'd prefer if we could first
>>>>>> settle whether to rename the conflicting x86 symbol.
>>>>>>
>>>>>
>>>>> Stefano replied asking for a v3 [1] before I had a chance to read your
>>>>> message this morning.
>>>>
>>>> Right, sorry, I spotted his reply only after seeing the v3.
>>>
>>> For what is worth I prefer the current implementation compared to
>>> renaming debug()
>>
>> I don't. My replacement name suggestions were only "just in case"; I
>> don't really like them.
> 
> Understood :-)
> 
> How would you like to proceed?
> 
> 1. we commit this patch as is
> 2. we wait for a third opinion from another maintainer
> 3. we find a new name for the variable
> 4. we change debug() instead
IMO, the name debug() is quite generic and it is not obvious that the 
function is a trap handler. So I think renaming debug() is the right way 
to go.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 22:59:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 22:59:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571296.894812 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP9xS-000476-Ux; Thu, 27 Jul 2023 22:59:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571296.894812; Thu, 27 Jul 2023 22:59:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qP9xS-00046z-S4; Thu, 27 Jul 2023 22:59:46 +0000
Received: by outflank-mailman (input) for mailman id 571296;
 Thu, 27 Jul 2023 22:59:46 +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
 <SRS0=eQLJ=DN=fromorbit.com=david@srs-se1.protection.inumbo.net>)
 id 1qP9xR-00046r-TN
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 22:59:46 +0000
Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com
 [2607:f8b0:4864:20::434])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 453308f8-2cd1-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 00:59:42 +0200 (CEST)
Received: by mail-pf1-x434.google.com with SMTP id
 d2e1a72fcca58-686ba29ccb1so940089b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 15:59:42 -0700 (PDT)
Received: from dread.disaster.area (pa49-186-119-116.pa.vic.optusnet.com.au.
 [49.186.119.116]) by smtp.gmail.com with ESMTPSA id
 p24-20020aa78618000000b0068702b66ab1sm1115813pfn.174.2023.07.27.15.59.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Jul 2023 15:59:40 -0700 (PDT)
Received: from dave by dread.disaster.area with local (Exim 4.96)
 (envelope-from <david@fromorbit.com>) id 1qP9xJ-00BKKZ-1O;
 Fri, 28 Jul 2023 08:59:37 +1000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 453308f8-2cd1-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=fromorbit-com.20221208.gappssmtp.com; s=20221208; t=1690498781; x=1691103581;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date:from:to
         :cc:subject:date:message-id:reply-to;
        bh=8CTrna5t3S7P99W+zrM1I2ApZYIkXTVQedDFVAI6oIw=;
        b=X7pt5OuyEbf8f6R9fnvI9dxfnaaqjP1RGRY8ZMiJ1wEZkopGyRUZXV3N7HE87n67xj
         XeLWxsKHlNX6ErnVJUF/xO5BY5VT61hhmCqWCbxit+6W6UUMx7WmvB86s0q+wgGSoL6W
         koucWxrpBOYNBJME5+HxRa/lXlSreJXWQaoDeJrNnWxYMUw7bNkMz2551ucFVRtsjQZW
         0ldvdZqoq1ohkP2t1Jbzv+uf1kwplqapkGN1TtrTmsgZICGsR0gfv1ElN5pvcVjNfGjj
         OPatiCTf9mYCZ8F6QAcUCONXn7kELLjAWaYShbgFOaFFniHTDeIvjRJJRIf4kK+rSYkZ
         RVyw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690498781; x=1691103581;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=8CTrna5t3S7P99W+zrM1I2ApZYIkXTVQedDFVAI6oIw=;
        b=coWR1+yeEHSfILSU/rx6mCQzj6DY/R0KoRGV0Es+F8CX9lTSfXt3O0Z67izmyieWBB
         HSSlLf3TMUPrs3SdN6BsW6TNN0FtcI2hByjrnkEWrhmpa/iAcsmg1FB0+JFoFzc9ghk1
         EnodBp7jSbxCgQ5H1iKdp3eh+pmyuZsCZROFi70ODb9ANRpoqEasVxQaXxNWh+2QWxr1
         kVytwu3aC1ZS5p4T53w5a48XWKNP6BZQAooAOAxgKeIyCsvArFTDrhwLZWldpak96Vf8
         Y9H5zvvba8S6kfdL798Ii70OAxXwlrba76OQChquFs9PxJT58UIVXr7ojOQdU7dk/KUX
         i5lA==
X-Gm-Message-State: ABy/qLbyYCzmpUHvYeOMptNxvsW0qCKjEeKTgU6RJp9sMoHLl9MwRAoi
	WbELYsrjOjpLg5cXolEa5pwltg==
X-Google-Smtp-Source: APBJJlGFE8oAcAZu2XvzWjC5bjR81v7OIjjTfZ8m+EaEe6Rjpq3cuwvHN3I08mErFwOZJpneP9Ly1g==
X-Received: by 2002:a05:6a00:17a8:b0:64d:42b9:6895 with SMTP id s40-20020a056a0017a800b0064d42b96895mr61072pfg.5.1690498780930;
        Thu, 27 Jul 2023 15:59:40 -0700 (PDT)
Date: Fri, 28 Jul 2023 08:59:37 +1000
From: Dave Chinner <david@fromorbit.com>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, x86@kernel.org, kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org, linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org, linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org, netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com, linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
	Muchun Song <songmuchun@bytedance.com>, akpm@linux-foundation.org,
	tkhai@ya.ru, vbabka@suse.cz, roman.gushchin@linux.dev,
	djwong@kernel.org, brauner@kernel.org, paulmck@kernel.org,
	tytso@mit.edu, steven.price@arm.com, cel@kernel.org,
	senozhatsky@chromium.org, yujie.liu@intel.com,
	gregkh@linuxfoundation.org, muchun.song@linux.dev
Subject: Re: [PATCH v3 28/49] dm zoned: dynamically allocate the
 dm-zoned-meta shrinker
Message-ID: <ZML22YJi5vPBDEDj@dread.disaster.area>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
 <20230727080502.77895-29-zhengqi.arch@bytedance.com>
 <baaf7de4-9a0e-b953-2b6a-46e60c415614@kernel.org>
 <56ee1d92-28ee-81cb-9c41-6ca7ea6556b0@bytedance.com>
 <ba0868b2-9f90-3d81-1c91-8810057fb3ce@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <ba0868b2-9f90-3d81-1c91-8810057fb3ce@kernel.org>

On Thu, Jul 27, 2023 at 07:20:46PM +0900, Damien Le Moal wrote:
> On 7/27/23 17:55, Qi Zheng wrote:
> >>>           goto err;
> >>>       }
> >>>   +    zmd->mblk_shrinker->count_objects = dmz_mblock_shrinker_count;
> >>> +    zmd->mblk_shrinker->scan_objects = dmz_mblock_shrinker_scan;
> >>> +    zmd->mblk_shrinker->seeks = DEFAULT_SEEKS;
> >>> +    zmd->mblk_shrinker->private_data = zmd;
> >>> +
> >>> +    shrinker_register(zmd->mblk_shrinker);
> >>
> >> I fail to see how this new shrinker API is better... Why isn't there a
> >> shrinker_alloc_and_register() function ? That would avoid adding all this code
> >> all over the place as the new API call would be very similar to the current
> >> shrinker_register() call with static allocation.
> > 
> > In some registration scenarios, memory needs to be allocated in advance.
> > So we continue to use the previous prealloc/register_prepared()
> > algorithm. The shrinker_alloc_and_register() is just a helper function
> > that combines the two, and this increases the number of APIs that
> > shrinker exposes to the outside, so I choose not to add this helper.
> 
> And that results in more code in many places instead of less code + a simple
> inline helper in the shrinker header file...

It's not just a "simple helper" - it's a function that has to take 6
or 7 parameters with a return value that must be checked and
handled.

This was done in the first versions of the patch set - the amount of
code in each caller does not go down and, IMO, was much harder to
read and determine "this is obviously correct" that what we have
now.

> So not adding that super simple
> helper is not exactly the best choice in my opinion.

Each to their own - I much prefer the existing style/API over having
to go look up a helper function every time I want to check some
random shrinker has been set up correctly....

-Dave.
-- 
Dave Chinner
david@fromorbit.com


From xen-devel-bounces@lists.xenproject.org Thu Jul 27 23:49:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Jul 2023 23:49:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571299.894822 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPAiw-0001E7-JB; Thu, 27 Jul 2023 23:48:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571299.894822; Thu, 27 Jul 2023 23:48:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPAiw-0001E0-F4; Thu, 27 Jul 2023 23:48:50 +0000
Received: by outflank-mailman (input) for mailman id 571299;
 Thu, 27 Jul 2023 23:48:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=1hVV=DN=kernel.org=dlemoal@srs-se1.protection.inumbo.net>)
 id 1qPAiv-0001Du-Au
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 23:48:49 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1fe8a53f-2cd8-11ee-b24b-6b7b168915f2;
 Fri, 28 Jul 2023 01:48:47 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id CA7BB61F8A;
 Thu, 27 Jul 2023 23:48:44 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E5FDC433C7;
 Thu, 27 Jul 2023 23:48:39 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1fe8a53f-2cd8-11ee-b24b-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690501724;
	bh=Ttxo2VAoV3s10tVDpG1rs4f+uNBtPiAAdsRn7qEPqAI=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=Ak6ozI5MGJ+V/aaPZbipUbe6ZARep0hinqcaIFmiUbGlXqA4l6qqKubv3sXd24Wis
	 E3nRqNpMPjywrGRezhx8kIl9BfOcFGOjuYtEl0wjzGKmd2W/r6L34Y8Q/Asia9+Ai+
	 N65piXMA54Y1i5SwziMjZGbgl+PlpLxLOgApRck3LvpJfpGiaZrCds1yq/RX5+TIOO
	 TcyhaMq04sGg4mmvI/xNg53Zl5ogRkSJoPUjgXBUN2wkW+R/Z24fG4Bcn7szmrfhkb
	 1Y0rUs2KyI/CXZncywoQIP9j5+uNlee3CVuHYo0iSwOTdXpuIWfOUm7reRjWTqpcd1
	 EASuIvTp5UKtQ==
Message-ID: <217f3a7e-7681-0da6-aaa7-252a1451f7ba@kernel.org>
Date: Fri, 28 Jul 2023 08:48:37 +0900
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v3 28/49] dm zoned: dynamically allocate the dm-zoned-meta
 shrinker
To: Dave Chinner <david@fromorbit.com>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>, linux-kernel@vger.kernel.org,
 linux-mm@kvack.org, x86@kernel.org, kvm@vger.kernel.org,
 xen-devel@lists.xenproject.org, linux-erofs@lists.ozlabs.org,
 linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com,
 linux-nfs@vger.kernel.org, linux-mtd@lists.infradead.org,
 rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 Muchun Song <songmuchun@bytedance.com>, akpm@linux-foundation.org,
 tkhai@ya.ru, vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org,
 brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com,
 cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com,
 gregkh@linuxfoundation.org, muchun.song@linux.dev
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
 <20230727080502.77895-29-zhengqi.arch@bytedance.com>
 <baaf7de4-9a0e-b953-2b6a-46e60c415614@kernel.org>
 <56ee1d92-28ee-81cb-9c41-6ca7ea6556b0@bytedance.com>
 <ba0868b2-9f90-3d81-1c91-8810057fb3ce@kernel.org>
 <ZML22YJi5vPBDEDj@dread.disaster.area>
Content-Language: en-US
From: Damien Le Moal <dlemoal@kernel.org>
Organization: Western Digital Research
In-Reply-To: <ZML22YJi5vPBDEDj@dread.disaster.area>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 7/28/23 07:59, Dave Chinner wrote:
> On Thu, Jul 27, 2023 at 07:20:46PM +0900, Damien Le Moal wrote:
>> On 7/27/23 17:55, Qi Zheng wrote:
>>>>> Â Â Â Â Â Â Â Â Â  goto err;
>>>>> Â Â Â Â Â  }
>>>>> Â  +Â Â Â  zmd->mblk_shrinker->count_objects = dmz_mblock_shrinker_count;
>>>>> +Â Â Â  zmd->mblk_shrinker->scan_objects = dmz_mblock_shrinker_scan;
>>>>> +Â Â Â  zmd->mblk_shrinker->seeks = DEFAULT_SEEKS;
>>>>> +Â Â Â  zmd->mblk_shrinker->private_data = zmd;
>>>>> +
>>>>> +Â Â Â  shrinker_register(zmd->mblk_shrinker);
>>>>
>>>> I fail to see how this new shrinker API is better... Why isn't there a
>>>> shrinker_alloc_and_register() function ? That would avoid adding all this code
>>>> all over the place as the new API call would be very similar to the current
>>>> shrinker_register() call with static allocation.
>>>
>>> In some registration scenarios, memory needs to be allocated in advance.
>>> So we continue to use the previous prealloc/register_prepared()
>>> algorithm. The shrinker_alloc_and_register() is just a helper function
>>> that combines the two, and this increases the number of APIs that
>>> shrinker exposes to the outside, so I choose not to add this helper.
>>
>> And that results in more code in many places instead of less code + a simple
>> inline helper in the shrinker header file...
> 
> It's not just a "simple helper" - it's a function that has to take 6
> or 7 parameters with a return value that must be checked and
> handled.
> 
> This was done in the first versions of the patch set - the amount of
> code in each caller does not go down and, IMO, was much harder to
> read and determine "this is obviously correct" that what we have
> now.
> 
>> So not adding that super simple
>> helper is not exactly the best choice in my opinion.
> 
> Each to their own - I much prefer the existing style/API over having
> to go look up a helper function every time I want to check some
> random shrinker has been set up correctly....

OK. All fair points.


-- 
Damien Le Moal
Western Digital Research



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 00:22:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 00:22:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571302.894831 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPBFC-00069Y-PP; Fri, 28 Jul 2023 00:22:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571302.894831; Fri, 28 Jul 2023 00:22:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPBFC-00069R-MR; Fri, 28 Jul 2023 00:22:10 +0000
Received: by outflank-mailman (input) for mailman id 571302;
 Fri, 28 Jul 2023 00:22:08 +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
 <SRS0=uOvc=DO=epam.com=prvs=15732b3b8b=volodymyr_babchuk@srs-se1.protection.inumbo.net>)
 id 1qPBFA-00069L-GM
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 00:22:08 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c68bb304-2cdc-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 02:22:04 +0200 (CEST)
Received: from pps.filterd (m0174676.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 36RHFWSN021292; Fri, 28 Jul 2023 00:22:00 GMT
Received: from eur03-am7-obe.outbound.protection.outlook.com
 (mail-am7eur03lp2233.outbound.protection.outlook.com [104.47.51.233])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3s3mq9ua5q-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Fri, 28 Jul 2023 00:21:59 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com (2603:10a6:803:31::18)
 by AS8PR03MB7987.eurprd03.prod.outlook.com (2603:10a6:20b:42a::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Fri, 28 Jul
 2023 00:21:55 +0000
Received: from VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85]) by VI1PR03MB3710.eurprd03.prod.outlook.com
 ([fe80::68d2:d90f:ac32:7c85%3]) with mapi id 15.20.6631.026; Fri, 28 Jul 2023
 00:21:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c68bb304-2cdc-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=T5h/WE6H6oVcPC5KoAJjrYYvDW1cwHC9dcWdNmARl2NJxqIrsFY0Vjq4ZC5sa5jP+0wXlAWlfHGySmrwBGcPD6dssnw1eumTptp0Svurl5xRCdfRZDHp5hJinxE8PJeGAdFN9eJ51l7paxVj2vxMqPBjfZ0up99zeEij4htaC+F8/GXgc6kJoNO8m2oybzN/KU6h5wyAAWQHF4UixLRlYL3LWTXp1QIZ6MRYorln6HiKfz0HVTRlbsUrhp1NUjfONpGtVfxBEHyWGwzF4G8PcNQVkiIpNDoBPtG2F//PolQvIkjsjSCOqKaJEaTGcsE8xm1BRU31V3AGbYx2zpk+Mw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=o+f4typXSugZLDpj2djbBYPXReNGva54XD63rE6iHb0=;
 b=KHx8/6BsgpxvenwH1JbUASjAl8cPyRbEuo7V1cBiRIqOmgDH7/EQGJMyHgRUNLocAaq3cQhtMqylSyndbzdEb87dPKe8X8DSw5tk+eEHOqC6tQHVngb9y20+2pWPYakOzj61x7heAf0uLSrJeMLySwmNqRiBGWcB32vKwXFJEmL9HN+cO+WlZekMg9f0vgU7/YwpctGnaStnggrINIXdA4KJlddArqpdp/2u/8xDH2M983w67AyzL/GuFtOdHTopGeVU31obtIKpUhbF4ExzWfAmxPEeeYlbSGkNgaC43tF8lXbVHsGgqR8FfRxNSPGlrQsU2SyLRYMsvauxPbIyDg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=o+f4typXSugZLDpj2djbBYPXReNGva54XD63rE6iHb0=;
 b=dwLaEbUaQZKyiiPLonbqFTTySP/IERqOdl94bnPS1sBweww/K9WVoi7PeO9PLAvOrpuP9lQLeI8J36VLaZHVk/xAxK4P0jSEj0XVs6PpQYP093Zy92OFiWwudmbdf3PaffBe1iL7p1uszW5eXRCTUzVN92fs6s2Lmi9CgOycXf2bIJyb8gxhe4vgC9Xw1F9cp1YLRMaqgHWtDbsHNyMc00WnL5nwpf2WUC/G2tMsRuyYCvm4rYd9dew++Scksbw7u7gw5sCyu7AJNSYQV/VsVoczlqGILDzHd02hTo8G6n7KphFpc2ECBdFFyij26MvmjR4oHMpmrsWrYyE9Vtkvtw==
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
        Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
        Jan Beulich
	<jbeulich@suse.com>
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Thread-Topic: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Thread-Index: 
 AQHZuqGrLMJPz1ipBEu4urExXp8yi6/CgxUAgAWEoICAA8vwgIAA+VsAgADNRYCAALGHgA==
Date: Fri, 28 Jul 2023 00:21:54 +0000
Message-ID: <87cz0cc2ce.fsf@epam.com>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local> <87ila7cvy2.fsf@epam.com>
 <ZMDox0WwumxMGnzV@MacBook-Air-de-Roger.local> <87y1j2b296.fsf@epam.com>
 <ZMJmJTkSFLKZXkKB@MacBook-Air-de-Roger.local>
In-Reply-To: <ZMJmJTkSFLKZXkKB@MacBook-Air-de-Roger.local>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: mu4e 1.8.9; emacs 28.2
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: VI1PR03MB3710:EE_|AS8PR03MB7987:EE_
x-ms-office365-filtering-correlation-id: 594e30b5-7640-49b4-b050-08db8f00a5a3
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 
 YtTZqK49qetVUWGRdCfP8vO6WUX7KYjFR9O22EF9n0UQlL/J9IKZXeoeliWGERi+IK1DQwVtGX08Sf4IrWRT1iwBSYUy4qt9hpb2mL93d2Qbrup+q/pq6RWXYxn7e4qVk98FMnhdS8m+A+M3g7voXUuTmpE7A0juMmfPiqH7RJy08CLEiKWDxD8LmtFHVI1FICzCwRSvTXbjrx+QmnzJLFkmjFQVAh6NqNQ9V4QK1neHpKuS/fug1MylxN1S5Uv27/LC9lBjyrkTrL5OfEQpC04yfzCdSq8YVbFvwK01i5k6GgQrvv/ttYORHamfcPoxJ1mvF3+vPaKCtZSnRRDMiwXbNDmv93WRp3PXqwv5AhR4DYwJX0EK27eMjXnWdF29EFMwJWCZMurhoCm3pd4epUwG89M1HZ/mcNvPuN7jO1gW/nio01axd/qrg3yeyVg50jJK/4qgB9gmHWSxRfncQWHIkuRlZ5JdeZqtFc4eVhYiEknzg5lx8OAnC9NT/ajnmADgDTFQLjZHd64a+ZshWTWk5cQuShadehzmhm1aq0s0ihSLnnO4XA6trA0mhI5e+CfeKH609tDORaG+YI8nFEMphpOEIXCzatyGZM5dfyw2f+30DoXFOVQVzNiJar6s
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB3710.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(376002)(39860400002)(136003)(366004)(451199021)(5660300002)(66946007)(38100700002)(478600001)(122000001)(66556008)(2616005)(55236004)(83380400001)(36756003)(66446008)(71200400001)(8936002)(8676002)(6916009)(316002)(6486002)(76116006)(54906003)(41300700001)(91956017)(6512007)(6506007)(4326008)(26005)(64756008)(186003)(66476007)(2906002)(38070700005)(86362001);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?utf-8?B?dkpnblEyNXBQdlpyTlNBVldGQlptRDhoVXNBNC9FNk0vaEtiYzJMa3k2TzND?=
 =?utf-8?B?YWJ4clA2Qk1helRMdVBxKzB1d3RLNWdxQVIxQWtJN3dmQWtRdDRSUytjcm14?=
 =?utf-8?B?KzhiQXQwY0VzeDJBTUpjaXZ6cmdTVGIzSGZDYXRoNHVpSGpVRzZ5VFB2UHNB?=
 =?utf-8?B?aWh1S0M1TDJkaGFuZWgzZjk1OUkvZEVLaWUwa2RWbGpiQXB2ZDR2YW1ZNjQx?=
 =?utf-8?B?enhxVWdyQnJMS1dwWnZkaGttMUZOM3R1K05hZVNYeG8vdm4wRGIzMW5RakNN?=
 =?utf-8?B?WXJOc0VVUTgrYkFOQXBYSXVsbmpqNWdEK1h1K3V4MFpmdVBsNGlhOXIvejZr?=
 =?utf-8?B?YTVSa09GZ0dGYnFwVnFYdlphOXlLN0xuZm9NRGhCODgzeG1WSWYrMVZVTEg5?=
 =?utf-8?B?UTVNQVR5WmdlTUNVN1FUcU5ZQ0wrWTR4ZkM2RWRZQVZvVGtMZDNZdnJhT2xo?=
 =?utf-8?B?b0RvMTZBbmd3WE9TNitBRzBRMjV6NUNRRUs2Y2ozMDh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1Fl?=
 =?utf-8?B?aGJWMmhFQ2p3eXdNRldzZE9iYXBIZW1HcFRsS21UUU1xRWordUpRM2JpYjNh?=
 =?utf-8?B?SVY4NTZjVzduVEdudWhQMm9EbzNwdy9LU0l0bzNrUXh5cktnV3FpbDF1d0JY?=
 =?utf-8?B?STJXL3A3VWJKVklkSnpRa0VYT0dKRldKWkx6a0pHOHhlbGZNakJQUEZaN2xq?=
 =?utf-8?B?VXd3ZTMvVjdDalpmS1UrMjVDa0R6L2ErZ2hYLzMvTFFDR1A3dEd2OWlocHJI?=
 =?utf-8?B?NnJtd3FuSHpsVDljdEF0b1NYZkxSL0tWZmlyWXRGTVV2SllEcWlzeTFkL0FL?=
 =?utf-8?B?SThSVENYN1hScWw2NTFPVW9NU3V2NjRpNmZwRWZaN3Z6ZXVCa0hKd0NETk9i?=
 =?utf-8?B?TXJkU0dvNTFURnI3KzU0UjBDbFJkM1V6MWJOWkQ4QTdTWUlWcDFRM0ZERlJB?=
 =?utf-8?B?Q0QvdzAzVm9nM3BlZzNlZmVlZU5TaS81NEJlZWV0WUttbDVQc015bldES2k0?=
 =?utf-8?B?elBld2VucEpjcGdsVVFweGFhcVRkMHFvY1AvdWQxam5seldWaFE5S3JWM0NL?=
 =?utf-8?B?Y1d0VENIVGZuTmdrbUFxRjZzZEFjMEZ6ekQvL2NxN0pxbTU0QU16NGMwanVV?=
 =?utf-8?B?ckUrUDgxSUJ0eGpSYkRiTGdQZk14Y1RIY21qVGd0MFlRcGtack5XNVpobHRE?=
 =?utf-8?B?aE45a0hEV2FwTGUvNFk4VzRzLzdpY3JkUWtqeEFVT2pWdnRIa1o5bU5jUmJr?=
 =?utf-8?B?MjU3dmpaZk5XSStrUGFrMW1WbENPVUFLdmM2ajJzMytkdm1vUnBPSGJLdW8y?=
 =?utf-8?B?K2c9PQ==?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <D1EBAEAF660ABB41A1A730F343AC6827@eurprd03.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3710.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 594e30b5-7640-49b4-b050-08db8f00a5a3
X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jul 2023 00:21:54.4785
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 0mB9wilj+WFm7+n69Vez+RzZIwwW6K1PS5amama3ERFCQfi8dDF7iNjNQUXubfLMkeSy75JYSN05tu4yL3HvIivy3zwClkY2Dtl1WH1vpgQ=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7987
X-Proofpoint-ORIG-GUID: ACrdNsf0uY5TwhwaIdgVUdaj64rD5at7
X-Proofpoint-GUID: ACrdNsf0uY5TwhwaIdgVUdaj64rD5at7
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26
 definitions=2023-07-27_10,2023-07-26_01,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0
 mlxlogscore=683 phishscore=0 lowpriorityscore=0 priorityscore=1501
 mlxscore=0 suspectscore=0 malwarescore=0 impostorscore=0 spamscore=0
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2306200000 definitions=main-2307280001

DQpIaSBSb2dlciwNCg0KUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+IHdy
aXRlczoNCg0KPiBPbiBUaHUsIEp1bCAyNywgMjAyMyBhdCAxMjo1Njo1NEFNICswMDAwLCBWb2xv
ZHlte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G9jaygpLCBhcyBwZGV2IGZpZWxkcyBh
cmUNCm5vdCBwcm90ZWN0ZWQgYnkgZC0+cGNpX2xvY2suLi4NCg0KLS0gDQpXQlIsIFZvbG9keW15
cg==


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 00:47:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 00:47:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571304.894842 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPBdz-0000Io-IH; Fri, 28 Jul 2023 00:47:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571304.894842; Fri, 28 Jul 2023 00:47:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPBdz-0000Ih-F7; Fri, 28 Jul 2023 00:47:47 +0000
Received: by outflank-mailman (input) for mailman id 571304;
 Fri, 28 Jul 2023 00:47:46 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPBdy-0000IX-68; Fri, 28 Jul 2023 00:47:46 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPBdy-0005Es-56; Fri, 28 Jul 2023 00:47:46 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPBdx-0007Vb-N3; Fri, 28 Jul 2023 00:47:45 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qPBdx-0000K1-Md; Fri, 28 Jul 2023 00:47:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ho7tEyS5Zq/FewcDYZqiMTu+1yq6j+k8OMXPHwB8h5U=; b=ZuM1Wft/+in8ckHfCqXwq8NTxI
	if5kWiCWmiItR1vpODlB2FucnWZOjVPO2ZI6zyHelFWTQecJKYnmZ/qcrQTdIOOf3KzCzlVO+fDBU
	BZCUSjBSxUSwuRI6gBOTm0QbGrnXpKeG+yeiiNsBHaBzpLMnEsZdaHd0mtuDQNOF5KQc=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182049-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 182049: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=3e55f826f4dc0dfd8a67525181c68189243539cc
X-Osstest-Versions-That:
    xen=0400946d532ec41bc5d0bedd3e9ef036308ce623
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 28 Jul 2023 00:47:45 +0000

flight 182049 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182049/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  3e55f826f4dc0dfd8a67525181c68189243539cc
baseline version:
 xen                  0400946d532ec41bc5d0bedd3e9ef036308ce623

Last test of basis   182043  2023-07-27 13:00:27 Z    0 days
Testing same since   182049  2023-07-27 22:04:04 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Juergen Gross <jgross@suse.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   0400946d53..3e55f826f4  3e55f826f4dc0dfd8a67525181c68189243539cc -> smoke


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 01:56:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 01:56:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571309.894852 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPCiJ-0005tz-AG; Fri, 28 Jul 2023 01:56:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571309.894852; Fri, 28 Jul 2023 01:56:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPCiJ-0005ts-5I; Fri, 28 Jul 2023 01:56:19 +0000
Received: by outflank-mailman (input) for mailman id 571309;
 Fri, 28 Jul 2023 01:56:18 +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
 <SRS0=5zQa=DO=intel.com=kevin.tian@srs-se1.protection.inumbo.net>)
 id 1qPCiH-0005tl-No
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 01:56:18 +0000
Received: from mgamail.intel.com (unknown [192.55.52.88])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ec8eed93-2ce9-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 03:56:12 +0200 (CEST)
Received: from orsmga005.jf.intel.com ([10.7.209.41])
 by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 27 Jul 2023 18:56:09 -0700
Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81])
 by orsmga005.jf.intel.com with ESMTP; 27 Jul 2023 18:56:08 -0700
Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by
 fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.27; Thu, 27 Jul 2023 18:56:08 -0700
Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by
 fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.27 via Frontend Transport; Thu, 27 Jul 2023 18:56:08 -0700
Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.172)
 by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.27; Thu, 27 Jul 2023 18:56:08 -0700
Received: from BN9PR11MB5276.namprd11.prod.outlook.com (2603:10b6:408:135::18)
 by DS0PR11MB7411.namprd11.prod.outlook.com (2603:10b6:8:150::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Fri, 28 Jul
 2023 01:56:06 +0000
Received: from BN9PR11MB5276.namprd11.prod.outlook.com
 ([fe80::8b87:d7d:f095:e3f9]) by BN9PR11MB5276.namprd11.prod.outlook.com
 ([fe80::8b87:d7d:f095:e3f9%6]) with mapi id 15.20.6631.026; Fri, 28 Jul 2023
 01:56:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ec8eed93-2ce9-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690509372; x=1722045372;
  h=from:to:cc:subject:date:message-id:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=tHLFkaFfEuzPmItb1hF8WoC77OiTAzumSDkgZHm2CqA=;
  b=kaB9ytT+rKxfvF/kuC6HcxVTwEdOMx3D+d/Z+f36WhSjIooMb7oAPtje
   ALLJxH1IAFqgBMF4e1U8/LrRs2uwN6EXAf57UqQZV1RuvFrteyxK0n6mE
   hWZ3Ui2znBnSJrMcJK/dsZQSKlXodjJqrzlJSJNB7g9WWLhXR12pX4wBu
   7o5umJ2/jaOGE8S59o2RXlG4Qj9JCFZya8+u5Laiom9R9e2Q64FD+Oz2E
   fg3j2HON/ekpNhOFoIp7f7s1wXN8dPd5VzVXv5Pxc6X3ciywd5cG8Hi9l
   q1YgUENsx7yd/KRrrzd03/ENZNZ2fANajqyae/67tIpwzt+nVTGF/UvcN
   w==;
X-IronPort-AV: E=McAfee;i="6600,9927,10784"; a="399420014"
X-IronPort-AV: E=Sophos;i="6.01,236,1684825200"; 
   d="scan'208";a="399420014"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10784"; a="901047371"
X-IronPort-AV: E=Sophos;i="6.01,236,1684825200"; 
   d="scan'208";a="901047371"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=QXGigQLMuG9GzXIX2U0cCgzTXiEfpdFJnS1aWNRgJbntJoltAOo1BtnrcaaMaG+8ZRZ3PZz6FjhB/2G6nFp6Yqt4Bu8sdhKpJ11CHVo2YVLyRNl1NUnDXTuQ34/MwF2mJKHcfL0NhojVeLaQMyKfGAK0ir5DKcMNGwnM8xH5C/PvF2queOKbJzK/oLsC3uUxxoNCVy4zrLOd96JOr0/XtgNtcbuFSmxg6SyWOKVWM4XqmGts8EIeZxxFV3b/+eesAMF7CMave2977jsMXQ5igN+KkwWpn1qasj19h504zIbZ1h9bC37SijYaYTLQYKMci2jvmhC7ZMiIElod4mwsvg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=tHLFkaFfEuzPmItb1hF8WoC77OiTAzumSDkgZHm2CqA=;
 b=B5QSsUhrLVpKkxVWkJmdJl9Aiqwp/qoputzfSWc7Mo9wg/oO90TxnvwmudwCjspct+D5kjpGZsHfkfxrhBqyx0xjC65El15pEoj7VUh+Hb0lPBBEDSLR2sTzEIdNvFVQgrnfHepU2/ZsdpJ1ZCvkUjosdd1OVfVr9gDNkn2VYM19DAP/rhEK2GUeAEIvYP24E5ObnOPP7q3GciXdJMnjZFsazQpi1hpBLh2rAem9Hcl9yCTK3/4Y8smuavVMBKxRpuZ1PbpP1Nr1w8yIM+ct+tjCUoZOWXAwdyT9wqOAMFOThxFvoqbspMOLzfmRcoIZ1Y4foeYRQrWPnaZod6O0ag==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
From: "Tian, Kevin" <kevin.tian@intel.com>
To: =?utf-8?B?UGF1IE1vbm7DqSwgUm9nZXI=?= <roger.pau@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: =?utf-8?B?UGF1IE1vbm7DqSwgUm9nZXI=?= <roger.pau@citrix.com>
Subject: RE: [PATCH v3 3/4] iommu/vtd: rename io_apic_read_remap_rte() local
 variable
Thread-Topic: [PATCH v3 3/4] iommu/vtd: rename io_apic_read_remap_rte() local
 variable
Thread-Index: AQHZv8CNKV9fhB5waEiLQIrydqL0pq/Obb1w
Date: Fri, 28 Jul 2023 01:56:06 +0000
Message-ID: <BN9PR11MB5276EB03801301AF26A3FC408C06A@BN9PR11MB5276.namprd11.prod.outlook.com>
References: <20230726125508.78704-1-roger.pau@citrix.com>
 <20230726125508.78704-4-roger.pau@citrix.com>
In-Reply-To: <20230726125508.78704-4-roger.pau@citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BN9PR11MB5276:EE_|DS0PR11MB7411:EE_
x-ms-office365-filtering-correlation-id: f15d0854-f79c-4d7a-b06b-08db8f0dce54
x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: KDN0pBZplakVjvvX3Eluo6osxYaqDdLEpVgnNoz7oYgHgsklGxQVkVisWZn7PDR9fR0peb/+ptX5EFrur4jYn86ZhOdyK7DDQHZtnKsF4io+jWkvWSOEMoJzd2Q3VAxpKNqJe4crcc0X4Vr9RDGsIEyngh2mCIWQ/mCAeI8PwYJ4RsKR/gBoGhE1bTTsyH8V17Zj/NXMmFEJVvcBMrd2A6a5klIbIFDjJ33B1P/FLyIFLVkEcNtZFwYi+t095Alhl85q7o7uFK21Dung6T0a3rxzByTRpzoon9rcvPJA9SgeM+TSK0fQaaUHsVhfi6QXrD/Ae9eMY63HDlkIPGo8IVd7XNzqA98hjt6XO9TXu3qpONHdb2kN/Z7b8JGHwreKfYUrz7cuyxUXXywjkviZtLIcd5aaaxgYaQHv1ctgWbg+iVKcrPaGoZAogbHLdgyJ4T4ZetavAnozYXabNSZRVIzcRZMX78v4wC4u+W5b0SA7pfDl8koASdewbOp4+gm7ipkgIe5SJAzcohUFHB2DPgSjiQyUZFZSO3+ZZB8FTZSTUIANXLR2bYcrKLtQninBYjkKp5W7f7kMaA7jhQetExgeVMgudzE/YS5ScVNQbHQJ+WHdIlj2izW0AaTS5Lbn
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR11MB5276.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(376002)(346002)(366004)(136003)(451199021)(5660300002)(41300700001)(26005)(9686003)(71200400001)(478600001)(38100700002)(86362001)(4326008)(8936002)(8676002)(316002)(76116006)(66476007)(66446008)(66556008)(66946007)(6506007)(186003)(33656002)(64756008)(122000001)(2906002)(110136005)(7696005)(83380400001)(52536014)(82960400001)(38070700005)(55016003)(4744005);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?utf-8?B?RndicFI1M3NhUTVYdzdla2NkNk54NWduSTBKRkJmbUdPVzZEUStjVTNWUjZx?=
 =?utf-8?B?bERndW1PR1B1Rno3bDhpM1JtbWs1QnozMm1QZUlGNHg3Y0dOc2txZWlKVU9L?=
 =?utf-8?B?N0w1aWJabWp5aTRqVTk5MU12Qkt3V1JxaWlFVW5iYSs0OGJpc3FpR2hFV1Fk?=
 =?utf-8?B?blFPMW1JQ1NQVnhyaHE0RHVNVFZQdzBiWFNaZVVuR1pQRkNzcGE0MkNWRTdn?=
 =?utf-8?B?Sm5CTWJobmdkNWNOTThEOTlxS0F0dDA4THRycWxIMWJ2ZFhNbW1RTTA3cUlo?=
 =?utf-8?B?WG5zRUtGQUZBTXlwYk9hc2JGZ0F2RXVmWm5HZ3pPTnhkQ1RXanNJaytzYnpW?=
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uRGJvSHVXTVJ0QmFFWThUY2VNTjRDbVVYM0dKWGxSMjgz?=
 =?utf-8?Q?ZvLCKw4A7PcA0/z1WxCHfZno3?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5276.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f15d0854-f79c-4d7a-b06b-08db8f0dce54
X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jul 2023 01:56:06.2031
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: JbclT4J70ybDhF8ArrlBdhB/TzqsLk+/umJMY+V4utbcvNUKhIQqRHGVe/BGbMREPqr2XxuV9jCIgkX8eeq4kQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7411
X-OriginatorOrg: intel.com

PiBGcm9tOiBSb2dlciBQYXUgTW9ubmUgPHJvZ2VyLnBhdUBjaXRyaXguY29tPg0KPiBTZW50OiBX
ZWRuZXNkYXksIEp1bHkgMjYsIDIwMjMgODo1NSBQTQ0KPiANCj4gUHJlcGFyYXRvcnkgY2hhbmdl
IHRvIHVuaWZ5IHRoZSBJTy1BUElDIHBpbiB2YXJpYWJsZSBuYW1lIGJldHdlZW4NCj4gaW9fYXBp
Y19yZWFkX3JlbWFwX3J0ZSgpIGFuZCBhbWRfaW9tbXVfaW9hcGljX3VwZGF0ZV9pcmUoKSwgc28g
dGhhdA0KPiB0aGUgbG9jYWwgdmFyaWFibGUgY2FuIGJlIG1hZGUgYSBmdW5jdGlvbiBwYXJhbWV0
ZXIgd2l0aCB0aGUgc2FtZSBuYW1lDQo+IGFjcm9zcyB2ZW5kb3JzLg0KPiANCj4gU2lnbmVkLW9m
Zi1ieTogUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5jb20+DQoNClJldmlld2Vk
LWJ5OiBLZXZpbiBUaWFuIDxrZXZpbi50aWFuQGludGVsLmNvbT4NCg==


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 03:36:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 03:36:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571314.894862 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPEGq-00089g-E3; Fri, 28 Jul 2023 03:36:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571314.894862; Fri, 28 Jul 2023 03:36:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPEGq-00089Z-Ae; Fri, 28 Jul 2023 03:36:04 +0000
Received: by outflank-mailman (input) for mailman id 571314;
 Fri, 28 Jul 2023 03:36:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPEGp-00089P-MX; Fri, 28 Jul 2023 03:36:03 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPEGp-0007rb-JC; Fri, 28 Jul 2023 03:36:03 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPEGp-0007dn-4I; Fri, 28 Jul 2023 03:36:03 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qPEGp-000576-3Q; Fri, 28 Jul 2023 03:36:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ULt2d/+uOkDg1XYDgXkIfVYin5boq8ve7P1JH8g++JU=; b=CTcVy9tB8uwt3+KQGfp9EpfuG6
	dqpFK56zwDE669l29c1K6axg0k7McRsssygbAAIfDO/bZBdFMnucWWkSNOg88m6NxXjNsBEX4cu/H
	XyEfbb5m7LtH7/tYv1dpKmGbmn1WuljuAeLMhV5dqCmIcvmjEOXSKqRTyJT4Dk1HGGCA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182050-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 182050: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=15d327e3d6924aabf991246353068eca07654f0e
X-Osstest-Versions-That:
    xen=3e55f826f4dc0dfd8a67525181c68189243539cc
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 28 Jul 2023 03:36:03 +0000

flight 182050 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182050/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  15d327e3d6924aabf991246353068eca07654f0e
baseline version:
 xen                  3e55f826f4dc0dfd8a67525181c68189243539cc

Last test of basis   182049  2023-07-27 22:04:04 Z    0 days
Testing same since   182050  2023-07-28 01:02:02 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Bertrand Marquis <bertrand.marquis@arm.com>
  Federico Serafini <federico.serafini@bugseng.com>
  Julien Grall <jgrall@amazon.com>
  Luca Fancellu <luca.fancellu@arm.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   3e55f826f4..15d327e3d6  15d327e3d6924aabf991246353068eca07654f0e -> smoke


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 04:22:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 04:22:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571279.894871 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPEzQ-00055z-Sb; Fri, 28 Jul 2023 04:22:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571279.894871; Fri, 28 Jul 2023 04:22:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPEzQ-00055s-Ps; Fri, 28 Jul 2023 04:22:08 +0000
Received: by outflank-mailman (input) for mailman id 571279;
 Thu, 27 Jul 2023 21:53:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Lw2A=DN=flex--justinstitt.bounces.google.com=3XefCZAsKCWQLWUVKPUVKVVIQQING.EQOZGP-FGXGNNKUVU.ZGPRTQLGEV.QTI@srs-se1.protection.inumbo.net>)
 id 1qP8vQ-0003bb-Dm
 for xen-devel@lists.xenproject.org; Thu, 27 Jul 2023 21:53:36 +0000
Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com
 [2607:f8b0:4864:20::b49])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 087fff66-2cc8-11ee-b24b-6b7b168915f2;
 Thu, 27 Jul 2023 23:53:35 +0200 (CEST)
Received: by mail-yb1-xb49.google.com with SMTP id
 3f1490d57ef6-c5fc972760eso1248006276.1
 for <xen-devel@lists.xenproject.org>; Thu, 27 Jul 2023 14:53:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 087fff66-2cc8-11ee-b24b-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20221208; t=1690494814; x=1691099614;
        h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject
         :date:message-id:reply-to;
        bh=+IrV9GMRSdZPt30c7KcILm3qep9zKx/623+6CGNnSZI=;
        b=YRH0RandNbmWOsNbix1juf2j32ITK9Uvj67kgr3R72979X637zKHH8KZguOPLopzPy
         fjkQbcWwTfMo1Hqb4p+zc/kFemN21RJ6rTyJtcMQ/oEKwjHKIFtmzqeJZgnBmRq/79FF
         Q1T9puk7xzNEdjIV/igXmV4UFIlev2+Onajgaupn8iFIWwD+LDMaU7Rqh6Y/qZ8WNZcQ
         EbYgsmXlOOtwiPgFmIy/5TsvUTsSImKFRVPRiBPAtXKPd4wWKkCURJYYWadAtcEjnXsQ
         ZCgI9IcqtCntKz8lcvSlVTtTRikw2cRxyKs3v6SBQpDYBNM+kCas8jJKyEbxblWbQEXw
         lu9A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690494814; x=1691099614;
        h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=+IrV9GMRSdZPt30c7KcILm3qep9zKx/623+6CGNnSZI=;
        b=FFcSujkn3H7nGkY48J+jHwvb9wOcV7uYmCHd2RFKA8C747JONnns6Nd50K2wMiwrQS
         OVP1WP0Ob+Rbh/abO8ekwDyIfjYxVhHbkv42BDiEaQHK3eUj1lP7riNjZFzaT5/ZCcyn
         0papD8EFAYDpik3ChmsAl80fYgkFSx45FoaXToj3alxNPkCbK7DcIggI4zL0ZGuX0Eqi
         A5xNPHKSLeKR576Ofbc+sLuBgPz+YpzTNK0GaitDG0LaT9e/jjE9ys0GQyEcbfDS7ILg
         5VGuZeEuRViaQ4ddj8kRxUz+HoWO4AFtW1hZLmzRJpttDPeQYa5pnMePSg13iXi0HvhT
         3+Gw==
X-Gm-Message-State: ABy/qLZFcL4WoYaPw+lL73kWxghaWLlSCFa5KiN5QfWiv3WD3tYkjnV/
	RKGdsA+1uL4YprOPyJQYWfZZ/orJPiXpX7O8UA==
X-Google-Smtp-Source: APBJJlHXF3DAQ7oQ2+0tdvzkYP1VoY7GsOUMjOE+/Vdzmdw/tfkvYZ+dZ1a3XDRmAV0OnKJAbEafFAFp/DwKM5StMA==
X-Received: from jstitt-linux1.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:23b5])
 (user=justinstitt job=sendgmr) by 2002:a25:ab13:0:b0:cfe:74cf:e61a with SMTP
 id u19-20020a25ab13000000b00cfe74cfe61amr4397ybi.6.1690494813865; Thu, 27 Jul
 2023 14:53:33 -0700 (PDT)
Date: Thu, 27 Jul 2023 21:53:24 +0000
Mime-Version: 1.0
X-B4-Tracking: v=1; b=H4sIAFPnwmQC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE
 vPSU3UzU4B8JSMDI2MDcyNz3eL80rwU3YrUPF1jS4tkS0sj8yTjFAsloPqCotS0zAqwWdGxtbU AfC3LdVsAAAA=
X-Developer-Key: i=justinstitt@google.com; a=ed25519; pk=tC3hNkJQTpNX/gLKxTNQKDmiQl6QjBNCGKJINqAdJsE=
X-Developer-Signature: v=1; a=ed25519-sha256; t=1690494812; l=3106;
 i=justinstitt@google.com; s=20230717; h=from:subject:message-id;
 bh=2DV18A5LAIbHOz8+4mF5Dz/H6ijYF+f0DqJHiw+O6Z8=; b=vopO06Wm0zYSnDpTC9r5I+EsMsCZYRVtZWxLb5Dfivdpz4dFnQc4/MROOoOi/9uBOTysUrbZO
 B8mJVXUSQDcCy59jXa+eGsPlPBt2oonSrkqDfkKPfBHRnmLmfyW1zgm
X-Mailer: b4 0.12.3
Message-ID: <20230727-sound-xen-v1-1-89dd161351f1@google.com>
Subject: [PATCH] ALSA: xen-front: refactor deprecated strncpy
From: Justin Stitt <justinstitt@google.com>
To: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, Jaroslav Kysela <perex@perex.cz>, 
	Takashi Iwai <tiwai@suse.com>
Cc: xen-devel@lists.xenproject.org, alsa-devel@alsa-project.org, 
	linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>, 
	Justin Stitt <justinstitt@google.com>
Content-Type: text/plain; charset="utf-8"

`strncpy` is deprecated for use on NUL-terminated destination strings [1].

A suitable replacement is `strscpy` [2] due to the fact that it
guarantees NUL-termination on its destination buffer argument which is
_not_ always the case for `strncpy`!

It should be noted that, in this case, the destination buffer has a
length strictly greater than the source string. Moreover, the source
string is NUL-terminated (and so is the destination) which means there
was no real bug happening here. Nonetheless, this patch would get us one
step closer to eliminating the `strncpy` API in the kernel, as its use
is too ambiguous. We need to favor less ambiguous replacements such as:
strscpy, strscpy_pad, strtomem and strtomem_pad (amongst others).

Technically, my patch yields subtly different behavior. The original
implementation with `strncpy` would fill the entire destination buffer
with null bytes [3] while `strscpy` will leave the junk, uninitialized
bytes trailing after the _mandatory_ NUL-termination. So, if somehow
`pcm->name` or `card->driver/shortname/longname` require this
NUL-padding behavior then `strscpy_pad` should be used. My
interpretation, though, is that the aforementioned fields are just fine
as NUL-terminated strings. Please correct my assumptions if needed and
I'll send in a v2.

[1]: www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
[2]: manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html
[3]: https://linux.die.net/man/3/strncpy

Link: https://github.com/KSPP/linux/issues/90
Signed-off-by: Justin Stitt <justinstitt@google.com>
---
 sound/xen/xen_snd_front_alsa.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/xen/xen_snd_front_alsa.c b/sound/xen/xen_snd_front_alsa.c
index db917453a473..7a3dfce97c15 100644
--- a/sound/xen/xen_snd_front_alsa.c
+++ b/sound/xen/xen_snd_front_alsa.c
@@ -783,7 +783,7 @@ static int new_pcm_instance(struct xen_snd_front_card_info *card_info,
 	pcm->info_flags = 0;
 	/* we want to handle all PCM operations in non-atomic context */
 	pcm->nonatomic = true;
-	strncpy(pcm->name, "Virtual card PCM", sizeof(pcm->name));
+	strscpy(pcm->name, "Virtual card PCM", sizeof(pcm->name));
 
 	if (instance_cfg->num_streams_pb)
 		snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
@@ -835,9 +835,9 @@ int xen_snd_front_alsa_init(struct xen_snd_front_info *front_info)
 			goto fail;
 	}
 
-	strncpy(card->driver, XENSND_DRIVER_NAME, sizeof(card->driver));
-	strncpy(card->shortname, cfg->name_short, sizeof(card->shortname));
-	strncpy(card->longname, cfg->name_long, sizeof(card->longname));
+	strscpy(card->driver, XENSND_DRIVER_NAME, sizeof(card->driver));
+	strscpy(card->shortname, cfg->name_short, sizeof(card->shortname));
+	strscpy(card->longname, cfg->name_long, sizeof(card->longname));
 
 	ret = snd_card_register(card);
 	if (ret < 0)

---
base-commit: 57012c57536f8814dec92e74197ee96c3498d24e
change-id: 20230727-sound-xen-398c9927b3d8

Best regards,
--
Justin Stitt <justinstitt@google.com>



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 04:47:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 04:47:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571319.894881 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPFNU-0007r7-Pk; Fri, 28 Jul 2023 04:47:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571319.894881; Fri, 28 Jul 2023 04:47:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPFNU-0007r0-NH; Fri, 28 Jul 2023 04:47:00 +0000
Received: by outflank-mailman (input) for mailman id 571319;
 Fri, 28 Jul 2023 04:46:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=DqrS=DO=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qPFNT-0007qu-Q7
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 04:46:59 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c6a4affb-2d01-11ee-b24c-6b7b168915f2;
 Fri, 28 Jul 2023 06:46:56 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36S4kbWF078991
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Fri, 28 Jul 2023 00:46:43 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36S4ka3c078990;
 Thu, 27 Jul 2023 21:46:36 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c6a4affb-2d01-11ee-b24c-6b7b168915f2
Date: Thu, 27 Jul 2023 21:46:36 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: Justin Stitt <justinstitt@google.com>
Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
        Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
        xen-devel@lists.xenproject.org, alsa-devel@alsa-project.org,
        linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] ALSA: xen-front: refactor deprecated strncpy
Message-ID: <ZMNILDgqHEGf8fNF@mattapan.m5p.com>
References: <20230727-sound-xen-v1-1-89dd161351f1@google.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20230727-sound-xen-v1-1-89dd161351f1@google.com>
X-Spam-Status: No, score=0.4 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

On Thu, Jul 27, 2023 at 09:53:24PM +0000, Justin Stitt wrote:
> Technically, my patch yields subtly different behavior. The original
> implementation with `strncpy` would fill the entire destination buffer
> with null bytes [3] while `strscpy` will leave the junk, uninitialized
> bytes trailing after the _mandatory_ NUL-termination. So, if somehow
> `pcm->name` or `card->driver/shortname/longname` require this
> NUL-padding behavior then `strscpy_pad` should be used. My
> interpretation, though, is that the aforementioned fields are just fine
> as NUL-terminated strings. Please correct my assumptions if needed and
> I'll send in a v2.

"uninitialized bytes" => "leak of sensitive information" => "security hole"

One hopes the unitialized bytes don't contain sensitive information, but
that is the start of the chain.  One can hope the VM on the other end is
friendly, but that isn't something to rely on.

I'm not in charge of any of the appropriate subsystems, I just happened
to randomly look at this as message on a mailing list I'm on.  Could be
the maintainers will find this acceptable.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Fri Jul 28 05:01:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 05:01:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571323.894892 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPFbh-000288-1f; Fri, 28 Jul 2023 05:01:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571323.894892; Fri, 28 Jul 2023 05:01:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPFbg-000281-UY; Fri, 28 Jul 2023 05:01:40 +0000
Received: by outflank-mailman (input) for mailman id 571323;
 Fri, 28 Jul 2023 05:01:39 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPFbf-00027o-OD; Fri, 28 Jul 2023 05:01:39 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPFbf-0001vF-Kn; Fri, 28 Jul 2023 05:01:39 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPFbe-0001OS-JD; Fri, 28 Jul 2023 05:01:38 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qPFbe-0006K0-Ij; Fri, 28 Jul 2023 05:01:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=4fZ1sLM+J+nqx9v/n10X7PtealEt58/oU2tryb4LeNg=; b=YR7AtCLVBGoCUAA8cu4E9dPlPl
	WKPBZicepLtVGRRD+r+Bdw/zwf/Bgear7RUtc0c8tSKYSNLHCWVkn5FHKQ0PRQVWRVBBz5rzRmEV0
	A0ViP7shIq6DX0Bgg7XcMJ2ysihKQF0MMDrew01KRpoyoFSuWTod/QLloAtj3+bGWjP8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182029-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 182029: tolerable FAIL - PUSHED
X-Osstest-Failures:
    qemu-mainline:test-amd64-i386-qemuu-rhel6hvm-amd:xen-install:fail:heisenbug
    qemu-mainline:test-amd64-amd64-dom0pvh-xl-intel:guest-start/debian.repeat:fail:heisenbug
    qemu-mainline:test-armhf-armhf-xl-vhd:guest-start:fail:heisenbug
    qemu-mainline:test-amd64-amd64-xl-qcow2:guest-start/debian.repeat:fail:heisenbug
    qemu-mainline:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=ccdd31267678db9d80578b5f80bbe94141609ef4
X-Osstest-Versions-That:
    qemuu=6cb2011fedf8c4e7b66b4a3abd6b42c1bae99ce6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 28 Jul 2023 05:01:38 +0000

flight 182029 qemu-mainline real [real]
flight 182048 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/182029/
http://logs.test-lab.xenproject.org/osstest/logs/182048/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-qemuu-rhel6hvm-amd  7 xen-install   fail pass in 182048-retest
 test-amd64-amd64-dom0pvh-xl-intel 22 guest-start/debian.repeat fail pass in 182048-retest
 test-armhf-armhf-xl-vhd      13 guest-start         fail pass in 182048-retest
 test-amd64-amd64-xl-qcow2 21 guest-start/debian.repeat fail pass in 182048-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-vhd     14 migrate-support-check fail in 182048 never pass
 test-armhf-armhf-xl-vhd 15 saverestore-support-check fail in 182048 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182023
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182023
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 182023
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 182023
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 182023
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182023
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182023
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 182023
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass

version targeted for testing:
 qemuu                ccdd31267678db9d80578b5f80bbe94141609ef4
baseline version:
 qemuu                6cb2011fedf8c4e7b66b4a3abd6b42c1bae99ce6

Last test of basis   182023  2023-07-26 13:00:59 Z    1 days
Testing same since   182029  2023-07-27 03:42:56 Z    1 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Akihiko Odaki <akihiko.odaki@daynix.com>
  canokeys.org (http://canokeys.org) <contact@canokeys.org>
  Daniel P. BerrangÃ© <berrange@redhat.com>
  Fabiano Rosas <farosas@suse.de>
  Hongren (Zenithal) Zheng <i@zenithal.me>
  Hyman Huang(é»„å‹‡) <yong.huang@smartx.com>
  Juan Quintela <quintela@redhat.com>
  Laszlo Ersek <lersek@redhat.com>
  Markus Armbruster <armbru@redhat.com>
  Peter Xu <peterx@redhat.com>
  Richard Henderson <richard.henderson@linaro.org>
  Tejus GK <tejus.gk@nutanix.com>
  Wei Wang <wei.w.wang@intel.com>
  YuanYang Meng <mkfssion@mkfssion.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           fail    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            fail    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    fail    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      fail    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/qemu-xen.git
   6cb2011fed..ccdd312676  ccdd31267678db9d80578b5f80bbe94141609ef4 -> upstream-tested


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 06:04:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 06:04:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571332.894901 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPGa1-00009p-PV; Fri, 28 Jul 2023 06:04:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571332.894901; Fri, 28 Jul 2023 06:04:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPGa1-00009g-Ms; Fri, 28 Jul 2023 06:04:01 +0000
Received: by outflank-mailman (input) for mailman id 571332;
 Fri, 28 Jul 2023 06:04:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=wghk=DO=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qPGa0-00009Z-8s
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 06:04:00 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2060a.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::60a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 898e31fa-2d0c-11ee-b24c-6b7b168915f2;
 Fri, 28 Jul 2023 08:03:59 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS4PR04MB9623.eurprd04.prod.outlook.com (2603:10a6:20b:4cd::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Fri, 28 Jul
 2023 06:03:54 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Fri, 28 Jul 2023
 06:03:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 898e31fa-2d0c-11ee-b24c-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BXR83kIDWg79YjN2+R8sQeBivMlIspA8nX35hc2n/xusXW5j1ZcH122isX7qr116kbbsBDVoTt2qLthcxY13VNExkKyiAlVIHJzH3DBqK+ZXesOyGx4GjcI4mEzoZ5y/Rkg/0PRe4RK4uUTj5ReKTp5ZYE3gFsOhImMfwemcLErNuvuk0FCqc9QnX9aLI9Nmv6L6v7KjTN1Sa8di2mR4Ni4TBu/bPpey5XaY6eI+x/YrGwAIK15+mYNNkI9WOTApDWR6eZQik/47mudeC0YTNMeJtKYHWO2QVLrYTmGd0M7b9pzISqYa0m6duP4jS+KFrxVZYM3jGLUvfHV5UMxGnQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=y30qDAn36TIcQrYPU2uY4PmbPUt5j2OKG/yfJlDDEbc=;
 b=mnwvbdlHXsFi3L7/AvQuFiDDbJLKojzV01ig7onqvFOMqdFhQNYHyp+q95OPTwPjNMcxBBnXxwXuWQ8KNAYt+biitQAcfVefSrPckuAt5oBIRIPWZ6C9dw9jDqyiJt54/RYRkOehU+YdCsY/srBGgnjNdUh87g46a2E4P2s7fxYDchyMasEdVyjPeaRMBboqxIa0TfmbbGz0aXlzTaVpTJW/I1ihORVoLRG1ZiIsmjVZNxQM6uXJ4rVs2Y8Cjvdye1uy0kCOZoz2N4ByY4rc9Fj7BU01H+FXS1BwVh1kDlOr6tlVrTCOV4Pl361IVXLSw7RsLRZpX1Yu/cDJok7jvA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=y30qDAn36TIcQrYPU2uY4PmbPUt5j2OKG/yfJlDDEbc=;
 b=OL7RdEiJPpzP+KDf9JezmeIuXrWrs7BeZuu58KeHxAv9YXvGGtZckmHMjsTpDDTRXXyGvxYWudwDUD3yDgc/CkFC8qfOylpUyTi1dDrkgC82Q0A2czFnNWoO6WsuKBk6E1mlq2UyKdHcSY0aX7fR5rBXhjB5ysnzP2Mm0RnVJiEMvOjMq7nuiXPYBV3q0Zn3YrnBkGmyoDJM2dyl+DKnTHiILJGUfJgy3rXQV46y9Y4K2lJ094r5e6JRPSFZpqxnIZ9Ys0VcMrB1sOb1JD063vFmvBgCx5ajYbIGqB8JppLXHRIq3MxO3Hwgl1s6p84uHjXae30+q2xZzeAKcCe3ow==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <44333683-0946-56fc-69ec-ce6b8dea36b4@suse.com>
Date: Fri, 28 Jul 2023 08:03:51 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH v3] xen/spinlock: mechanically rename parameter name
 'debug'
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Nicola Vetrini <nicola.vetrini@bugseng.com>, michal.orzel@amd.com,
 xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
References: <a66f1084686b77b098c5ccf3d0cf5f52980fdf5a.1690317797.git.nicola.vetrini@bugseng.com>
 <11a3ae18-508b-cf08-2803-bc4aaeec7353@suse.com>
 <f424fc5b-6266-3d04-b494-0448fa453b75@bugseng.com>
 <8914bf47-c4ca-4a14-6a92-b5b23ee739a0@suse.com>
 <alpine.DEB.2.22.394.2307261448010.3118466@ubuntu-linux-20-04-desktop>
 <d099b736-22cf-0502-df37-9ae7b14d048a@suse.com>
 <alpine.DEB.2.22.394.2307271233480.3118466@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307271233480.3118466@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0141.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9e::20) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS4PR04MB9623:EE_
X-MS-Office365-Filtering-Correlation-Id: 8802e833-fbfd-41c1-7f79-08db8f306c41
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	JnLR1wkdFdw5EaqYs2xBADJAheUKqyO78Mr1vk5qp31TLqpMJpuGzgyZnlDhwU7N40iUywjPh1deI22aIHywu49Rd3HFwmJfoTcTv+88oTz0ubj4Kr39jP7DwZOcYx7753oUwiOr9rwvn2txWd8INvLvfi6nx2/W8urDzULZN4jDPNOHaJGVCKqvqMr7IHMkifhREa1LClq7Uo/hUd8+JaS88nKtZtjwhG5LA6doYz0sHpapHkFq/YlX9ayKUDYILZ7YCF0ZvkLXpnEWxGj9+Dk1nOrqyvkQDci95D36+gQnQt2gySPWi0rot2vl0VLCKxvH4k5Pbd99rT+wV4a0amiAF/gTilPA+loiQbgunHpnwq9fXvBxwBUessijgm+OREOYrw3aa+8zp1PZZI0s+txIJ6NUJgtGz4on/MJP4AiDKzsR/RxH6KsFH80bZ/gGeVLTKJpls7cY6ERiQ8pbhD//kMW31rnaphIPxzes93V63gOZin8yK3O6sOGOLwIutr+Gt5ByZG2JJncuKy6hJHSCNYBQNZTxToHcO7/9S9GAgsmBg/nHu5FIYPiwtTGF150c8kouV7RsxfJ6hIMnQwu6ykOrnwKkvprHR/2zJALjE6tWr9WYyn8Ne6e8A0yBPzeDPQUm+6zMbgRi9JPLoQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(39860400002)(136003)(366004)(396003)(451199021)(2906002)(41300700001)(316002)(7416002)(5660300002)(8676002)(8936002)(36756003)(86362001)(31696002)(6512007)(53546011)(26005)(6506007)(478600001)(6486002)(6666004)(83380400001)(6916009)(186003)(31686004)(4326008)(2616005)(38100700002)(66476007)(66556008)(66946007)(54906003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WjRYSEM0QmFmRVBLejNjdWd2QTFPQkVPd2xDd1RySk1ORmpmSjVQai9VRk02?=
 =?utf-8?B?cEVhbEhiejRlc3gyNE5GQz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?=
 =?utf-8?B?VER4SkJXYVYwdHBsWlZjVUpOeUtrV0d2R1pZZjNFRzhBeHJ3VWljd1ZzUnNx?=
 =?utf-8?B?UncwOHJFTUFYWUdRK1Vha3ZXalVOcjA4YW5wbUxtL0hOWkI1dlBkaTFrbzNR?=
 =?utf-8?B?YVY3UTBtNkpwd3RsVE1mUysyQ1ZmYkxHWEZyOGE0ZWZhR3J5ZEFtVHlWY0Zy?=
 =?utf-8?B?ZHVCSlcxcVcxNm5zd1NUVWNFSXFxL1habFZUR2lRdlFqcGFvUkNINkFscEFB?=
 =?utf-8?B?Q0xoWFB4QlB6WXRPR05sMjcwcHUzaHBMOWZSaEp4N1ZKem4wRnQxUXFFd0hT?=
 =?utf-8?Q?Xo5cUPV8ZafdKxz8qHl2tWBz3?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8802e833-fbfd-41c1-7f79-08db8f306c41
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2023 06:03:54.1882
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: id6dtABHzgAI4S2JeF//ts+27FYATvgltpKq87uMNruwsliGQ8H8FEM7iy+P7B6ujpsq6hkt1sPN8h0s7IEz2g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9623

On 27.07.2023 21:35, Stefano Stabellini wrote:
> On Thu, 27 Jul 2023, Jan Beulich wrote:
>> On 26.07.2023 23:49, Stefano Stabellini wrote:
>>> On Wed, 26 Jul 2023, Jan Beulich wrote:
>>>> On 26.07.2023 08:42, Nicola Vetrini wrote:
>>>>> On 26/07/23 08:34, Jan Beulich wrote:
>>>>>> On 25.07.2023 22:45, Nicola Vetrini wrote:
>>>>>>> Rule 5.3 has the following headline:
>>>>>>> "An identifier declared in an inner scope shall not hide an
>>>>>>> identifier declared in an outer scope"
>>>>>>>
>>>>>>> To avoid any confusion resulting from the parameter 'debug'
>>>>>>> hiding the homonymous function declared at
>>>>>>> 'xen/arch/x86/include/asm/processor.h:428'
>>>>>>> the rename of parameters s/debug/lkdbg/ is performed.
>>>>>>>
>>>>>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>>>>>> ---
>>>>>>> Changes in v2:
>>>>>>> - s/dbg/lkdbg/
>>>>>>> Changes in v3:
>>>>>>> - Added missing renames for consistency
>>>>>>
>>>>>> Hmm, you asked whether to send v3, but then you didn't wait for an
>>>>>> answer. So to repeat what I said there: I'd prefer if we could first
>>>>>> settle whether to rename the conflicting x86 symbol.
>>>>>>
>>>>>
>>>>> Stefano replied asking for a v3 [1] before I had a chance to read your 
>>>>> message this morning.
>>>>
>>>> Right, sorry, I spotted his reply only after seeing the v3.
>>>
>>> For what is worth I prefer the current implementation compared to
>>> renaming debug()
>>
>> I don't. My replacement name suggestions were only "just in case"; I
>> don't really like them.
> 
> Understood :-)
> 
> How would you like to proceed?
> 
> 1. we commit this patch as is
> 2. we wait for a third opinion from another maintainer
> 3. we find a new name for the variable
> 4. we change debug() instead

4 is planned already anyway; actually a patch doing that (and quite a
few more things) was posted by Andrew a while back. We "just" need to
settle on the few open items there.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 06:15:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 06:15:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571334.894911 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPGl9-0001iv-QA; Fri, 28 Jul 2023 06:15:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571334.894911; Fri, 28 Jul 2023 06:15:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPGl9-0001io-Na; Fri, 28 Jul 2023 06:15:31 +0000
Received: by outflank-mailman (input) for mailman id 571334;
 Fri, 28 Jul 2023 06:15:30 +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 <SRS0=Gg45=DO=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qPGl8-0001id-BD
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 06:15:30 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2540ec67-2d0e-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 08:15:27 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id DD8AB1F8A4;
 Fri, 28 Jul 2023 06:15:26 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B445D133F7;
 Fri, 28 Jul 2023 06:15:26 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id VGGGKv5cw2TBJwAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 28 Jul 2023 06:15:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2540ec67-2d0e-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690524926; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=bzo/P3g3e3DrIikhZd7xQtkA9oW8qnq9Suvg/AYXn5k=;
	b=gZE8pUdFEosQ9Xy6WXssNTEz5D02adpjdCko15JTupaQASEd/uROc8w0sTCRCQd/qeGyhz
	iSrao5YtDjyfm7k2n4ZiDf3JQkpPm1d0glsTnJmA1PdtsUV+Exy0P7Pr90YmDCs/o8lFgd
	vLFXk0ukcvA1vhIiqLYATR3jD5Ccz6I=
Message-ID: <c4113e90-8660-c645-d59a-15ac3720c230@suse.com>
Date: Fri, 28 Jul 2023 08:15:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v3 14/25] tools/xenstore: change talloc_free() to take a
 const pointer
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-15-jgross@suse.com>
 <de4f8574-c042-e2bb-a3ec-8bcee118a2c0@xen.org>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <de4f8574-c042-e2bb-a3ec-8bcee118a2c0@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------cm3v7Vv1qBPbMEaYA8H6k0KM"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------cm3v7Vv1qBPbMEaYA8H6k0KM
Content-Type: multipart/mixed; boundary="------------0AcT0GQubeuVtKrNldP9J9mQ";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <c4113e90-8660-c645-d59a-15ac3720c230@suse.com>
Subject: Re: [PATCH v3 14/25] tools/xenstore: change talloc_free() to take a
 const pointer
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-15-jgross@suse.com>
 <de4f8574-c042-e2bb-a3ec-8bcee118a2c0@xen.org>
In-Reply-To: <de4f8574-c042-e2bb-a3ec-8bcee118a2c0@xen.org>

--------------0AcT0GQubeuVtKrNldP9J9mQ
Content-Type: multipart/mixed; boundary="------------X8FlmhIIPX9a5eyJGiyGuph6"

--------------X8FlmhIIPX9a5eyJGiyGuph6
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjcuMDcuMjMgMjM6MjEsIEp1bGllbiBHcmFsbCB3cm90ZToNCj4gSGkgSnVlcmdlbiwN
Cj4gDQo+IE9uIDI0LzA3LzIwMjMgMTI6MDIsIEp1ZXJnZW4gR3Jvc3Mgd3JvdGU6DQo+PiBX
aXRoIHRhbGxvY19mcmVlKCkgYW5kIHJlbGF0ZWQgZnVuY3Rpb25zIG5vdCB0YWtpbmcgYSBw
b250ZXIgdG8gY29uc3QNCj4g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B0byBtb2RpZnkgDQo+IHRoZSBjb250ZW50LiBJIGd1
ZXNzIHRoaXMgaXMgYSBuZWNlc3NhcnkgZXZpbCBoZXJlIGJ1dCBpdCB3b3VsZCBiZSBnb29k
IHRvIA0KPiBkb2N1bWVudCBpdC4NCg0KT2theSwgd2lsbCBhZGQgYSBjb21tZW50Lg0KDQoN
Ckp1ZXJnZW4NCg0K
--------------X8FlmhIIPX9a5eyJGiyGuph6
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaS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dgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------X8FlmhIIPX9a5eyJGiyGuph6--

--------------0AcT0GQubeuVtKrNldP9J9mQ--

--------------cm3v7Vv1qBPbMEaYA8H6k0KM
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmTDXP4FAwAAAAAACgkQsN6d1ii/Ey/B
Mwf+Kq/hVD0uzNu8ORYGrftScr7+2vMjc8hFsieA6CLhT9jsw+uweLM/lJJn1e3xD0Qjho1/YS0l
eXrMIrD9oOfYwnbLsHTgZ1G5Vu0akk/3zQUnWqMkkhXyqLxOBZJAaARHZTp4i+YRAb47vdsbbcxc
cYL1Z56MLf3p41oLOSxF0jYIMnNGa4lmCBtHJMQKytkfpnq/OvZ+y50IT5QwFvyEUWUQqoSO/bSD
xS6+5z6AeAfU2I0y3p6ZN7cEac0cmGoQKEBitpWvAC8H8tYI8M3S2O6ElBJjeSFnWrijFwNXbWvz
6SS3DGweiPmSE9xOYTuytLX2GHqJAv8YGtxT1Qol8Q==
=fS1n
-----END PGP SIGNATURE-----

--------------cm3v7Vv1qBPbMEaYA8H6k0KM--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 06:18:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 06:18:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571336.894922 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPGoL-0002KZ-Ar; Fri, 28 Jul 2023 06:18:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571336.894922; Fri, 28 Jul 2023 06:18:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPGoL-0002KS-6T; Fri, 28 Jul 2023 06:18:49 +0000
Received: by outflank-mailman (input) for mailman id 571336;
 Fri, 28 Jul 2023 06:18:47 +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 <SRS0=Gg45=DO=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qPGoJ-0002KM-Lv
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 06:18:47 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9b6009db-2d0e-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 08:18:45 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 3EF4321992;
 Fri, 28 Jul 2023 06:18:45 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 12717133F7;
 Fri, 28 Jul 2023 06:18:45 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id eL4MA8Vdw2QxKQAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 28 Jul 2023 06:18:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9b6009db-2d0e-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690525125; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=dpPwGwD2a1pKkjmVdtQ3ttXRitOiNrk/G3EkHn3WJDE=;
	b=J+s41VDN/hviRGvZkirjvFLa5WssdGfOdGJrI6ZNED0T4KlytyO9hLRTfiQuIQTyJ5WFsR
	D9YJu3/yRSEBLxuCTYNRiq2ApYeRq92eE7NDS9J6DZidF/WjILknE4SgOpAal8f7VAjX/m
	5REt6FZlqMnvouJ4+MdnU7POV31bu/4=
Message-ID: <9376a2aa-9d78-c345-37f7-be54d91dd7f1@suse.com>
Date: Fri, 28 Jul 2023 08:18:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v3 16/25] tools/xenstore: move copying of node data out of
 db_fetch()
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-17-jgross@suse.com>
 <85b2d6a2-b9ee-4c8a-3a7a-cb22934af825@xen.org>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <85b2d6a2-b9ee-4c8a-3a7a-cb22934af825@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------6ZB8ZeXR6iZF0vNM2eLxEQQ5"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------6ZB8ZeXR6iZF0vNM2eLxEQQ5
Content-Type: multipart/mixed; boundary="------------79VZLgIfBvH6n8EVTF8zgWic";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <9376a2aa-9d78-c345-37f7-be54d91dd7f1@suse.com>
Subject: Re: [PATCH v3 16/25] tools/xenstore: move copying of node data out of
 db_fetch()
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-17-jgross@suse.com>
 <85b2d6a2-b9ee-4c8a-3a7a-cb22934af825@xen.org>
In-Reply-To: <85b2d6a2-b9ee-4c8a-3a7a-cb22934af825@xen.org>

--------------79VZLgIfBvH6n8EVTF8zgWic
Content-Type: multipart/mixed; boundary="------------YV7anb0Raym8kDWT8QIByOSA"

--------------YV7anb0Raym8kDWT8QIByOSA
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjcuMDcuMjMgMjM6MzMsIEp1bGllbiBHcmFsbCB3cm90ZToNCj4gSGkgSnVlcmdlbiwN
Cj4gDQo+IE9uIDI0LzA3LzIwMjMgMTI6MDIsIEp1ZXJnZW4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: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5RnNVUJbvoPHZ8SlM4KWm8rG+lIkGurq
qu5gu8q8ZMKdsdGC4bBxdQKDKHEFExLJK/nRPFmAuGlId1E3fe10v5QL+qHI3EIP
tyfE7i9Hz6rVwi7lWKgh7pe0ZvatAudZ+JNIlBKptb64FaiIOAWDCx1SzR9KdWVy
Z2VuIEdyb3NzIDxqZ3Jvc3NAc3VzZS5jb20+wsB5BBMBAgAjBQJTjHCvAhsDBwsJ
CAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQsN6d1ii/Ey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--

--------------6ZB8ZeXR6iZF0vNM2eLxEQQ5
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmTDXcQFAwAAAAAACgkQsN6d1ii/Ey8c
Qwf/VePratuxvxa0jX8cz/iMOKsffAuOW85pgkWIkSc5oAuzH+qb3CZoipBMVJecQjGA51Zv0hbh
g5fUhwCcvLkZs/qUi35xebBbKmX3kRC9iESFagIMZH/LlTj94fqZr1Q38Vr7MhbomdiqhJp00riP
7Z9c/VdTx39RdKnJkVQNChEqpEfPoPA5dtOrOT6SewEYN1mJ+akGbcw7dOPy86hvFFC1bxVGxgT8
jPjmms5iVkqbNi3m0Hx5br+PLaAVqcspToWlUf9Ny4aeC7cL2NFkhAecaznjz4MZM/Gmg5+BemjF
HnPxp7YEORed0gkig4Ey4To4Q5mpogYr6sZoL194YQ==
=30Vp
-----END PGP SIGNATURE-----

--------------6ZB8ZeXR6iZF0vNM2eLxEQQ5--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 06:23:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 06:23:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571339.894931 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPGsf-0003q3-Tf; Fri, 28 Jul 2023 06:23:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571339.894931; Fri, 28 Jul 2023 06:23:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPGsf-0003pw-R3; Fri, 28 Jul 2023 06:23:17 +0000
Received: by outflank-mailman (input) for mailman id 571339;
 Fri, 28 Jul 2023 06:23:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Gg45=DO=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qPGsd-0003pq-Tm
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 06:23:16 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3bc1d176-2d0f-11ee-b24c-6b7b168915f2;
 Fri, 28 Jul 2023 08:23:14 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 6314421992;
 Fri, 28 Jul 2023 06:23:14 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 31CB1133F7;
 Fri, 28 Jul 2023 06:23:14 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id Jd+aCtJew2QUKwAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 28 Jul 2023 06:23:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3bc1d176-2d0f-11ee-b24c-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690525394; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=jcbKsI205A2YzlkGtQv/mn/qjuePGZ69Wtt/1Kotq8s=;
	b=CeNd9GT9NC8ostl+8+dPP3FVt2NYNW0PUGJ8rLOSJv3aBvd2CN835lmO0Q3sE2GLU+LABM
	hNY+xSoaolyQQABcgG3QQRnpIUy5eIFIdOWzvnUZzsfMeoiv11PioTIKnYgVzmwhjlPBXp
	SY9sKwrXYQfbcUl+aQRBWnnJiXkJbVk=
Message-ID: <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
Date: Fri, 28 Jul 2023 08:23:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
From: Juergen Gross <jgross@suse.com>
In-Reply-To: <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------a5BuGHbbpRqjymapPbTn2xlJ"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------a5BuGHbbpRqjymapPbTn2xlJ
Content-Type: multipart/mixed; boundary="------------thS14ZdmTh5FLMEM0uavyrGK";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
In-Reply-To: <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>

--------------thS14ZdmTh5FLMEM0uavyrGK
Content-Type: multipart/mixed; boundary="------------t7Vuzu8LSJ9fcFGdkEFZvrQD"

--------------t7Vuzu8LSJ9fcFGdkEFZvrQD
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjcuMDcuMjMgMjM6NTMsIEp1bGllbiBHcmFsbCB3cm90ZToNCj4gSGkgSnVlcmdlbiwN
Cj4gDQo+IE9uIDI0LzA3LzIwMjMgMTI6MDIsIEp1ZXJnZW4gR3Jvc3Mgd3JvdGU6DQo+PiBT
dHJ1Y3QgeHNfdGRiX3JlY29yZF9oZHIgaXMgdXNlZCBmb3Igbm9kZXMgc3RvcmVkIGluIHRo
ZSBkYXRhIGJhc2UuDQo+PiBXaGVuIHdvcmtpbmcgb24gYSBub2RlLCBzdHJ1Y3Qgbm9kZSBp
cyBiZWluZyB1c2VkLCB3aGljaCBpcyBpbmNsdWRpbmcNCj4+IHRoZSBzYW1lIGluZm9ybWF0
aW9uIGFzIHN0cnVjdCB4c190ZGJfcmVjb3JkX2hkciwgYnV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LcKgwqDC
oMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCBvd24gPSAoc3RydWN0IHhzX3RkYl9yZWNvcmRf
aGRyICopaGRyOw0KPj4gK8KgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCBvd24gPSAo
c3RydWN0IG5vZGVfaGRyICopaGRyOw0KPj4gwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDC
oMKgwqDCoCBvd24tPmdlbmVyYXRpb24gPSArK2dlbmVyYXRpb247DQo+PiDCoMKgwqDCoMKg
wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIG1vZGUgPSAoaS0+Z2VuZXJhdGlvbiA9PSBOT19H
RU5FUkFUSU9OKQ0KPj4gwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDC
oMKgwqDCoMKgID8gTk9ERV9DUkVBVEUgOiBOT0RFX01PRElGWTsNCg0KSnVlcmdlbg0KDQo=

--------------t7Vuzu8LSJ9fcFGdkEFZvrQD
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHN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/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------t7Vuzu8LSJ9fcFGdkEFZvrQD--

--------------thS14ZdmTh5FLMEM0uavyrGK--

--------------a5BuGHbbpRqjymapPbTn2xlJ
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmTDXtEFAwAAAAAACgkQsN6d1ii/Ey+F
+Af/StAuiKkCUDWQJXjHUtesuN4SOSOqKhiG2SLCG0TqvOxiuh5vw3sOrURDngQo1bs7wXeq2Dz1
B2aQC9chs/HpnlmYX3q2kTsqfdpxP1LizFiJVB116YYy/suf5slML5XqyepmR8+gQg6iDf0FscZf
5zOXVncrPjaXodiPPz1hLhp4rcJrBc8jaJ/7BKRF+2HTdrusH4CZdb79wiSDWqjad55GH7BbTU2+
Rztc6x19pAE90Z2odK7meNDmGiSBkKJIEhJl1PDF8NbfVf18OLaxUwhj/PuWSbdTigxyXTGoNT1r
kPh/toGaNHCl2ba8mPHvdd7due+mx3NfoADBmSEaMw==
=pSv3
-----END PGP SIGNATURE-----

--------------a5BuGHbbpRqjymapPbTn2xlJ--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 06:59:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 06:59:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571341.894941 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPHRA-0007Po-Ek; Fri, 28 Jul 2023 06:58:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571341.894941; Fri, 28 Jul 2023 06:58:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPHRA-0007Ph-CC; Fri, 28 Jul 2023 06:58:56 +0000
Received: by outflank-mailman (input) for mailman id 571341;
 Fri, 28 Jul 2023 06:58:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=wghk=DO=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qPHR9-0007Pb-2m
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 06:58:55 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20617.outbound.protection.outlook.com
 [2a01:111:f400:7d00::617])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3691ff47-2d14-11ee-b24c-6b7b168915f2;
 Fri, 28 Jul 2023 08:58:53 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DUZPR04MB9845.eurprd04.prod.outlook.com (2603:10a6:10:4d8::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Fri, 28 Jul
 2023 06:58:51 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Fri, 28 Jul 2023
 06:58:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3691ff47-2d14-11ee-b24c-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=aSJio6c1+Q2dd7OqaQ5ish0K+juZgzGX0TLd4Ww9qFk5Fie1VmF0OTVoBWwW4PRoQQCysgu+hs5SXVfHlbaucjDwtbQrkTmUzn5zM4NxWKzGAh6oBl+rLeMGNCog0IuCmheVqkguZcnZgpFb6LkTIHlY21a4Tyebgdhd5qjoKsk7cFM3gMQ8NW8WjTQq4mvDsXa6Y99EpCwOA1vLHogOE+e6tlIz4LByom/hCFeobQaXazDkk4mPplpF4oAQTTd+F3dy4UdD2ywfozdGgTk45I88PC2KLtn7X/drKUSFRvLQPCrfwnTrI0KRSoPDfuFNQyIaRamRmeYGzl3ZfMo2dQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=N/wqsKL8vQV04Nox++dTtO1K4PL9AMVhbr1bFZyfuhg=;
 b=FyAlWm0fYCm7WEgJGwyEjw955fH137ZZFQTeubzrPVBQMbjP/fXtt91RA/aCbqKGC2eb2+DVIPNqdjM5Jb2REUYLPEQdXSeTOwFgTb8WFPw8IRs1WP8PoMf2jQ64uqoQkFZuGHsW/isBHwv/ILIzdLTL9xvd0ynN6mANJTUfgxxoLVVkeTGB3A3Toty1JieeGkjnrC/u88AY5ryuJ7Gh+XpCR0G9EXoROStEuwVN6oTAje5wGvOYD6qAgnqzg2SGbXbZUXKlFoZKmzNjX5ncszjHFYj6entAbatgxqqTFxbzIUTu226w6PbJgtk2XEQhjBKJIp7AfHTwTaJHQ23bQg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=N/wqsKL8vQV04Nox++dTtO1K4PL9AMVhbr1bFZyfuhg=;
 b=zlXos0ln4BjXf3Peni7sRwJrD/4cDwM9SenfgCxFtw/Tr9dCnYXVXABAgH4h6DQxDL9mxFYoVM3NsU5Zirvp0R5aGJbDxcZ/q1eTLgj7btGC3dXMgTSJhJ4iYm3tVnbGBzAj5Tx3MPyMMA5LVzmIb/RQyf44f/zW9QuIp5Ltl4qCtX3tt+4dw1nEkwvSgSNF/ygMyhZwOw7qvFykVnhtE20VXPhS0lzXD+Mr9A6gttby/5FUDmNqwsxONL7nxDsF1lM/H4AZWqdbwjuHGj3d6MMY+/hkZgicD5PMYGFZGwb/gZQsnepvVsXBLK5nwwqPS3OdrccOfhQfeqiZ/QL08A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <4634a079-5118-4b82-4b7f-7e90cc7f7619@suse.com>
Date: Fri, 28 Jul 2023 08:58:48 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v6 1/2] tools/console: Add escape argument to configure
 escape character
Content-Language: en-US
To: Peter Hoyes <peter.hoyes@arm.com>
Cc: bertrand.marquis@arm.com, wei.chen@arm.com, luca.fancellu@arm.com,
 Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>,
 Hongda Deng <hongda.deng@arm.com>, xen-devel@lists.xenproject.org
References: <20230727164450.77640-1-peter.hoyes@arm.com>
 <20230727164450.77640-2-peter.hoyes@arm.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230727164450.77640-2-peter.hoyes@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0064.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:49::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DUZPR04MB9845:EE_
X-MS-Office365-Filtering-Correlation-Id: 69b14e1e-c3ab-4881-59a3-08db8f38194e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	6nK2WjtqM2T4P3qcWQq1zoJPVp+I+GP4leOC8rnBZcxQDnO9bGirvzMi7VOd3bST1Pg1OnCnXK+MqZH4QUzS8syKJxXJeuE8miv2ImQFhdPuBtTS450oWp+HycDi7aE/V3ll5y7zXuNIPw4qQVQgM7QMuyF8V5kaUHi+141obf9pTjXdC45eN2clwIbYbHlbvAV1Myh8dwOrmGC5mCpuXMocPMCS9ZT5Gv7ySUug7ExQw0i7jX1E0iN5hQ4M5M6tB0E2FW8Ca+bWr/3l1z6lUsGXlkVLlCpeOefWvhY+M7YwHUgi/hZFaZnZLZOtAD+Yvm0fIrthzjGw6HffBpvl4ufEfjTlr5Pn29RywutdK66e7/7ywFHWlQ0+oUBn9MabtH5YWspa69EjljIfZg5B0Fr4GFcztebqRTYF2j0gQM01zvxyPqCswwsZa7L4hmR94XiKLmUS7AopvVLLrB0RuHdYD+e6oIPMvXlUE75fOnKYymAwIIau4n7LWBsQG4MApYNGFPzjBTwq9UiJspNf4Ff80eaqKxOG4GjbGHwt0zmsj2vmt3311vTvyKAsO1Urb6DNj17wvRi7ti6n01s8w23NvEPlCaQGfd/QnDJ6XRp+Uhr8C/vx7aG4M4PAc5yqI/awO+a0VFJieUqHuegwpQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(136003)(346002)(39860400002)(396003)(376002)(451199021)(53546011)(6512007)(26005)(6506007)(478600001)(186003)(6486002)(41300700001)(6666004)(316002)(83380400001)(8936002)(8676002)(6916009)(38100700002)(5660300002)(66946007)(66556008)(66476007)(86362001)(31696002)(4744005)(31686004)(2906002)(4326008)(36756003)(54906003)(2616005)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?b1dQUHNIVmpRZGFwS2tGR0xnMVVWbXEyVUtNM21wWkpBNU4yRU1WcUtrTCtk?=
 =?utf-8?B?c25Xb0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4Y0Ni?=
 =?utf-8?B?YWd0WTFBVG1kRjZnZnBPSmNSTG0vVUpWWmRLZE43QVVHdzJqano5eEVpUkZ0?=
 =?utf-8?B?eGRQaHNIWDZKNXFRRkNqcWg1UHpHdnhTU3VteFRqaDNzNFN1bzBqc21QMVhW?=
 =?utf-8?B?ZzBMRFhJc2VtZkhFZEIxSzRVcGtjN2RLVUFmMm8wdC9OVUpCeXdaWGQvTk1v?=
 =?utf-8?B?L0lZTE0vdVA0L1lxamMwRkZXVU9iSW90OEJ4bTZLWE9kZnhYVGpneUxsSS9a?=
 =?utf-8?B?dzZ1L3paSk1JNVVNMFkvS1EzVHRYeGZDSVg1cVdwZzFrRXV3eDNGbDEyc3ht?=
 =?utf-8?Q?5ACCLYFTZINOrxAxGjccCiwGg?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 69b14e1e-c3ab-4881-59a3-08db8f38194e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2023 06:58:51.0105
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: W/SElUfsi7tE7S8N1lRHB37Cq3zEJufHFk3jauPG5/Rrq2TUCvVfL+Aj/h75U37CczvcsNLxFIysMvG2XZ9/cQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DUZPR04MB9845

On 27.07.2023 18:44, Peter Hoyes wrote:
> From: Peter Hoyes <Peter.Hoyes@arm.com>
> 
> Dom0 may be accessed via telnet, meaning the default escape character
> (which is the same as telnet's) cannot be directly used to exit the
> console. It would be helpful to make the escape character customizable
> in such use cases.
> 
> Add --escape argument to console tool for this purpose.
> 
> Add argument to getopt options, parse and validate the escape character
> and pass value to console_loop.
> 
> If --escape is not specified, it falls back to the existing behavior
> using DEFAULT_ESCAPE_SEQUENCE.
> 
> Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
> Reviewed-by: Hongda Deng <hongda.deng@arm.com>
> ---
> Changes in v5:
> - Add this changelog

Why the v6 re-post, when the v5 patch went in already?

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 07:01:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 07:01:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571344.894952 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPHTv-0000Ua-0D; Fri, 28 Jul 2023 07:01:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571344.894952; Fri, 28 Jul 2023 07:01:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPHTu-0000UT-SU; Fri, 28 Jul 2023 07:01:46 +0000
Received: by outflank-mailman (input) for mailman id 571344;
 Fri, 28 Jul 2023 07:01:46 +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 <SRS0=wghk=DO=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qPHTu-0000UN-3o
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 07:01:46 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2070.outbound.protection.outlook.com [40.107.7.70])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9c4ee010-2d14-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 09:01:44 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU0PR04MB9635.eurprd04.prod.outlook.com (2603:10a6:10:31f::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Fri, 28 Jul
 2023 07:01:12 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Fri, 28 Jul 2023
 07:01:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9c4ee010-2d14-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BGBAOlWOaaFecAJ5hkAuizRWWzcglMNCisf1LjFe1m7huTVtPNKY9rjFpTCgTxr3mONqUiQWGThZWNRVRwruyOaDnAFQbdzrbz1TMYPn0DNWm/GNfs+2/LNuKPSJzkt6Ybpd/6cHIQu+27fno+7uoCTyB94jsqBEWBMYCHjorH4DF9rjm0ta0IYg7zXYeeE739oLY9l5oGFyIUsQ2SQVavhhRigbBiXUXM9zFU7qfLYx8xHul33yBieTyi8rEgtab8uk5XBs5rFwR9UFFF6mSnDERq0NVjcmk4z51RzLXQsVpCocIqsWo47jNy2jaCq5D/QVjv84LD3dVlK0wNMdmg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=PdZMmWLouFU5D07ZWjcSbQFjaJbJQ5zaxOljeopqhG4=;
 b=lPmrJH5AZ16uz1beSeI1XTT3rT0RanQbTBYBXJFPgU/2l+q7hCGUCd+Vx7maIUP8oCHdMNvWqbypm8Qzhr+HbGlUn/fbU6Rdax+3tsZGb0Zawj2kJ13c5WBUNv5KOV0r2fTZdsg+5kNgE9ReStO45KSlSKvap0Ul2iZMUDWLiH7SeacyAqb43CLYAl2oGSrgh8RCMO9Lou6SDYk42O3/vgAJ1BeTkYQH8Nlv2Y6oXYM1+fLbcPjsqKLF8Znjx56X2sFos0OkULsUcSj1eSL1FZIzMCDgUHlZZTAW8VEp7qUspEKpZcYgsmj0f8POpU92OkKBNtjBox2QIvOHoQlR3g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=PdZMmWLouFU5D07ZWjcSbQFjaJbJQ5zaxOljeopqhG4=;
 b=KU1mCa9l6R7JhfO+wO8aHoPv48+r/ibiOBOytGwDGSQp5ZjY93RwyB0w2M8jd8mHnp9RhEPYgXqF4JgZteCsq6rP0WeP+KVXR5DbLthIhcVBVR68o+NOwstx4LXmsPEWpSzV0ROUbfy9pLkOXhdtd8jx/hC37j52sndOfGhTCw59ZBeknxPyOG7lmY9f5ItgQZxPUrQ1tV/mPBaR1Q7lHUDBXrtmGRt+QU/Wyg+4/OdTOg6+n65Y/aDzNfg7y1GBzci6N9URbRyu93d/CKEAd4B8p9iY/DM+lvHjzLXHwacCS9NJpI/PWdL8zIASExBIstwtZlIraeJS+VwrwwT6Qg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <be1bbc0f-3cfc-61d0-ec81-bff00e288377@suse.com>
Date: Fri, 28 Jul 2023 09:01:09 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 03/10] x86 setup: change bootstrap map to accept new boot
 module structures
Content-Language: en-US
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org, stefano.stabellini@amd.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Luca Fancellu <luca.fancellu@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Rich Persaud <persaur@gmail.com>,
 Christopher Clark <christopher.w.clark@gmail.com>,
 George Dunlap <george.dunlap@cloud.com>
References: <20230701071835.41599-1-christopher.w.clark@gmail.com>
 <20230701071835.41599-4-christopher.w.clark@gmail.com>
 <alpine.DEB.2.22.394.2307081144340.761183@ubuntu-linux-20-04-desktop>
 <CACMJ4GYE6PW1SY35dhs4XkXd9ru25igrvMCrh4pJMWEBNNz0YQ@mail.gmail.com>
 <CACMJ4Gb_ZwKSjP7qzfQj98YQjSpBdFuWzeGQJUNNqst0GdXCOw@mail.gmail.com>
 <4e0a0fc9-0c1b-4725-5692-de67ee68a980@suse.com>
 <2994c9b8-c803-1fd9-20df-0d25d2b66c49@apertussolutions.com>
 <ca85fd2e-45a5-32c3-cb4b-1042be6c6915@suse.com>
 <32a22c57-1333-47b0-c61d-abff8d7df112@apertussolutions.com>
 <7ab3c4ae-3903-29de-ba32-d328b426d104@suse.com>
 <19bb355f-576c-b8d7-b6da-fa2dd8ff2228@apertussolutions.com>
 <63979074-42c3-83dd-cf0a-8f0cd0294a5d@suse.com>
 <CA+zSX=ZFjWWnzx8vt3afywaiJiju1N5hNJqKzVkg956T-t-kwg@mail.gmail.com>
 <alpine.DEB.2.22.394.2307271133180.3118466@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307271133180.3118466@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0081.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1f::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU0PR04MB9635:EE_
X-MS-Office365-Filtering-Correlation-Id: cceb61d7-194d-4afb-47f7-08db8f386db2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	8+CiTkFw9BAqhRkOwPgzOr2/jap75DGNnBDttgZuy6eTopRPWBQyHoakltCmUG5K5tgtOatfbxBlGTEFPI4BV1WFQxIcdwqO0OAVscUUFCjRJvXmCEbnt9UJ97px9r1DrDvj9BnY9EDnTp4XNVfbRQXCU2HLIUAk7e3nJc5VmcpLUWTkLaG4ZZWulof6Jz7LGADumm+KqlXoigzKo+ukJpRqkPgNgkZJCMTSAi30kcHpQGjtAfrGIlIMODHyWe+0WP5Bnp+pTPZgGCqoOtFp018Z5qw6J4kM6COd/kHgJC5N3+neZRlHrANTAJzqJiITxbUIvUKNLuG2OLhTuwBOCbkDD0/dL5O38AXmmWMmCPfEIqL6LDMVJrmuOZN7pCOqQ66I/y4/OLQPo9QBNEFITGi1tD8zYpbE0RsrzPEOUDGM1hOK2+9xrAtUJ75zKWJPixVQFntyr6V3SJvNkBxyaFKI135jgHd9gcBSxqkvflgqg9pWTFEGnGsCEmmziSQprCm5P/lBSAn0G7Ou5IV7zgTEm382KYxWYyxX7VAmWbLTcpXJzmKAmc10LYCz8XuNFgnLSwDZdfnR2yxztiXZtXfn4GYZIhQyn0VCD5CB12y9JA68R/GDQ+aJ7GigCr6OPPPqlHdcR/xXKncP3dodxg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(136003)(39860400002)(346002)(376002)(366004)(451199021)(6486002)(7416002)(36756003)(2906002)(478600001)(66946007)(6666004)(66476007)(6916009)(66556008)(4326008)(54906003)(38100700002)(316002)(8676002)(186003)(86362001)(53546011)(6506007)(5660300002)(8936002)(31686004)(2616005)(26005)(41300700001)(6512007)(31696002)(83380400001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VkQxR3pEWW1YaHNvN280L2w5NGh1bzRFZU1yVGJkZ2V4MlBwRi91N3lEZ3Iv?=
 =?utf-8?B?aGlwKzJFZHV1VjhNZ3IxTzVUTXNoSnJydlhEVURXeDFORHEzVExqSGVQUmlK?=
 =?utf-8?B?RnJQbzhUa3h3V2hhM2plTFlPWm9uVCtnWXBxS0RqOXQ0S1BJZ08zdVBVQSs3?=
 =?utf-8?B?ZjduVzJTUUM4WjdwdjVKRFMvelFWeDliZVZZeFVaOUdkM2laZTJMdVRNYm5O?=
 =?utf-8?B?b1EyN01OTXZOSV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
 =?utf-8?B?QkJVRVJzZmY3b01hZVZFT3NaUHMxTmF4YjZudEhNcU1XcXhFODUrMXlJcGtz?=
 =?utf-8?B?cys4ajhaSkI1ZHk4YnBxS1JvekMrcFN2UFpCZzdSV1FZVGlvYlJpK1J1QzR2?=
 =?utf-8?Q?MXcPgsZipkKkB7BSIDJuF0Kez?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: cceb61d7-194d-4afb-47f7-08db8f386db2
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2023 07:01:12.5725
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 9g5swOgRO3yFSPfnwHF/F9kf24wxKjybgm1I9Y7BX737I5L0foHXx/zSldMLbmpv35KAGydiaoe7HWXdHgeraA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9635

On 27.07.2023 20:36, Stefano Stabellini wrote:
> On Thu, 27 Jul 2023, George Dunlap wrote:
>> On Thu, Jul 27, 2023 at 3:42â€¯PM Jan Beulich <jbeulich@suse.com> wrote:
>>       On 27.07.2023 15:26, Daniel P. Smith wrote:
>>       > Let's bring this back to the actual implementation instead of the
>>       > theoretical. Your position is that Xen's paddr_t is desired because it
>>       > can store larger values than that of size_t. Now if you look in Xen
>>       > proper (main 64bit code on x86), paddr_t is a typedef for a 64bit
>>       > unsigned integer. And if you look at size_t, it is also a typedef to a
>>       > 64bit unsigned integer, they are literally a couple of lines apart in
>>       > types.h. Thus they are the same size and can only represent the same
>>       > maximum size.
>>
>>       What about 32-bit Arm, or any other 32-bit architecture that we might
>>       see Xen ported to, with wider than 32-bit physical address space?
>>
>>
>> To be more concrete here:
>>
>> Suppose that you had a machine with 32-bit virtual address spaces (i.e., going up to 4GiB), and 36-bit physical address spaces (i.e., going
>> up to 64GiB).Â  And suppose you had a system with 16GiB of physical ram.Â  And you wanted to use Hyperlaunch to createÂ VMs using some sort of
>> memory image that was 5GiB (presumably of some kind of static data, not, say, a kernel or initramfs).Â  You wouldn't be able to do it if the
>> "size" parameter of the boot modules was limited to 4GiB (without some kind of hack where you string multiple boot modules together).
> 
> Yes exactly.
> 
> I would like this code to be common across ARM and x86. On arm32 size_t
> wouldn't work, with size_t as it is defined today. One option is to use
> paddr_t on all arches, or at least on arm32. Another option is to change
> the definition of size_t on arm32.

How can changing size_t be an option? This is determined by the psABI,
and going out of sync with what the compiler assumes size_t is will
bring you all sorts of trouble.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 07:59:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 07:59:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571350.894988 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPINc-0006qL-VT; Fri, 28 Jul 2023 07:59:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571350.894988; Fri, 28 Jul 2023 07:59:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPINc-0006ot-Sb; Fri, 28 Jul 2023 07:59:20 +0000
Received: by outflank-mailman (input) for mailman id 571350;
 Fri, 28 Jul 2023 07:59:19 +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
 <SRS0=6gb0=DO=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qPINb-0006EL-9V
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 07:59:19 +0000
Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com
 [2a00:1450:4864:20::433])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a61b6bde-2d1c-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 09:59:16 +0200 (CEST)
Received: by mail-wr1-x433.google.com with SMTP id
 ffacd0b85a97d-31771bb4869so1859753f8f.0
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 00:59:16 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([2.223.46.215])
 by smtp.gmail.com with ESMTPSA id
 x2-20020adfdd82000000b0030e56a9ff25sm4089629wrl.31.2023.07.28.00.59.14
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 28 Jul 2023 00:59:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a61b6bde-2d1c-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690531155; x=1691135955;
        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=Z6LGxVoqrbyniZKGQimBNpKjG2ea1pNL9RlwcBoVEA0=;
        b=ZqisHGXjloTP0NJo+9UiMSWXzZrPHs0fUyBrdm+3M0pJU8kPD1Fuu5Z3Pu4ELNuofe
         qR9hDkHuaYzNguYnGATiWrzxeqWN1FUU0t72yN8cIxUj/+0yd0lC0ES1RnPZ1dnBO4yy
         KVBq/GLMcGgM8bGVfQwjl0ZGlASfIL9NuO1ME=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690531155; x=1691135955;
        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=Z6LGxVoqrbyniZKGQimBNpKjG2ea1pNL9RlwcBoVEA0=;
        b=SpOEADcPxk5tE8gVUmBOeuvrnlJRpBvOyeV5QcxxdsyPvWB4tNZCTrMDgk3bJd2PGX
         BrF6zhgl2b4YQwf5tU4WiB9YSzMHvlp2amMqHD8TiMfThQpl+XoFL1FAN7VF1rW0LEBK
         fpdSR870elunJ1WyRvkz67rEHs+WywRFTCR62tAN52vIqX/u6WjCeMMQ5OD5ujKp0L3p
         VRXwP75NGoLaj1X56JrbNzjQgLm+0zMLhr+b4aMHN4YL689c1BGmRjQFYoHXBfh1bT8J
         GsmkANDR+qrnNVrMUqca8JAwZiJWXmsjGcNhGQQFimenv4sPFcr7okrjU2SRjbZT7Ub4
         yVYQ==
X-Gm-Message-State: ABy/qLbcOJmzwaW9frm6f9ZgktHh1bgb17DJfF02nchKxUS6S7c9D3Wn
	/Au954kmxH6R5BT30SPcyn+pCXgELzhpxwYPvdBgBw==
X-Google-Smtp-Source: APBJJlEf1wAZoLY/cYf2pZpXrEVC0OGLC9BXQ/87moiBUOlRFOu3rvFqU/5SQogyDrsr7f6W7RffRA==
X-Received: by 2002:a5d:43c3:0:b0:314:1aed:8f5f with SMTP id v3-20020a5d43c3000000b003141aed8f5fmr1129148wrr.34.1690531155546;
        Fri, 28 Jul 2023 00:59:15 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH v2 1/5] arm/mm: Document the differences between arm32 and arm64 directmaps
Date: Fri, 28 Jul 2023 08:58:59 +0100
Message-Id: <20230728075903.7838-2-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
References: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

arm32 merely covers the XENHEAP, whereas arm64 currently covers anything in
the frame table. These comments highlight why arm32 doesn't need to account for PDX
compression in its __va() implementation while arm64 does.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v2:
  * Removed statement about "containing GiB" (Julien)
---
 xen/arch/arm/include/asm/mm.h | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index 4262165ce2..5b530f0f40 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -280,6 +280,19 @@ static inline paddr_t __virt_to_maddr(vaddr_t va)
 #define virt_to_maddr(va)   __virt_to_maddr((vaddr_t)(va))
 
 #ifdef CONFIG_ARM_32
+/**
+ * Find the virtual address corresponding to a machine address
+ *
+ * Only memory backing the XENHEAP has a corresponding virtual address to
+ * be found. This is so we can save precious virtual space, as it's in
+ * short supply on arm32. This mapping is not subject to PDX compression
+ * because XENHEAP is known to be physically contiguous and can't hence
+ * jump over the PDX hole. This means we can avoid the roundtrips
+ * converting to/from pdx.
+ *
+ * @param ma Machine address
+ * @return Virtual address mapped to `ma`
+ */
 static inline void *maddr_to_virt(paddr_t ma)
 {
     ASSERT(is_xen_heap_mfn(maddr_to_mfn(ma)));
@@ -287,6 +300,19 @@ static inline void *maddr_to_virt(paddr_t ma)
     return (void *)(unsigned long) ma + XENHEAP_VIRT_START;
 }
 #else
+/**
+ * Find the virtual address corresponding to a machine address
+ *
+ * The directmap covers all conventional memory accesible by the
+ * hypervisor. This means it's subject to PDX compression.
+ *
+ * Note there's an extra offset applied (directmap_base_pdx) on top of the
+ * regular PDX compression logic. Its purpose is to skip over the initial
+ * range of non-existing memory, should there be one.
+ *
+ * @param ma Machine address
+ * @return Virtual address mapped to `ma`
+ */
 static inline void *maddr_to_virt(paddr_t ma)
 {
     ASSERT((mfn_to_pdx(maddr_to_mfn(ma)) - directmap_base_pdx) <
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 07:59:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 07:59:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571348.894967 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPINb-0006GR-AW; Fri, 28 Jul 2023 07:59:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571348.894967; Fri, 28 Jul 2023 07:59:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPINb-0006GD-6L; Fri, 28 Jul 2023 07:59:19 +0000
Received: by outflank-mailman (input) for mailman id 571348;
 Fri, 28 Jul 2023 07:59:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=6gb0=DO=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qPINZ-0006Dw-W6
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 07:59:17 +0000
Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com
 [2a00:1450:4864:20::32c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a6a4c6db-2d1c-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 09:59:17 +0200 (CEST)
Received: by mail-wm1-x32c.google.com with SMTP id
 5b1f17b1804b1-3fe078dcc3aso3667735e9.2
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 00:59:17 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([2.223.46.215])
 by smtp.gmail.com with ESMTPSA id
 x2-20020adfdd82000000b0030e56a9ff25sm4089629wrl.31.2023.07.28.00.59.15
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 28 Jul 2023 00:59:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a6a4c6db-2d1c-11ee-b24d-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690531157; x=1691135957;
        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=gt7MNId42NKzPH0LoomOcyWXMl9Ow7M05CuxT4VL3vE=;
        b=ihzhbyOMiOe6/fCo3LmEqaQjxwMArNoiDj9g23OikZX3YEN+jnulWtI+iCqwhRCpVf
         Vdhy+DqWq0Vf9fL72lxJ3krkkuyHZ3SkABo4+/2yhmg+8sQv4qh94aHW+EYq/9IqIboN
         l+FVMc9ipD4SHHa4uhKJ4345dMi74v/8HEm1k=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690531157; x=1691135957;
        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=gt7MNId42NKzPH0LoomOcyWXMl9Ow7M05CuxT4VL3vE=;
        b=KvAWZM0WOda0pAovmZIUs7+lQS8c90iwRN7KP6ajSXNjkdsyr6w56oyhUB9jJmgRn3
         0yCmfrfAR2BRV+SHpb4F4CD6WZBzZ4mUQ+CWThRlg1Wiu9avpceYalhWghreDg5+YlAg
         AEAbDKDBIB1ZR7JBsxC7L3y76hkrPf84y1GAhIej4LYmLoqiih5PkLxTLOtfs+iXBu/Y
         8wYU0skirw0RbEJfbIe9njpnFGU8Ujw+AK5Lp+a60/cfMcPzykEH1x+ENceAObwFpH13
         bQlwFANQQJSP5IP+v8pZ7hI7/NlG6Doqe6wgYUIXfIM+DqjMd+zH5h1FY6H33Brs/CJg
         2rjA==
X-Gm-Message-State: ABy/qLZq5Z9OI6tuSxZgHeWvnLyimV6Iwgbn5FWc4HcofnXjCxG0ibPm
	raiduS1ReRmB/FPx7/qMvJIOheNWQ/ZTj1i9eVn9nQ==
X-Google-Smtp-Source: APBJJlEAvsPA2G6iRDxTSJAWiZjDXyB+jNdecDwz4ksSRdcfd3N5Whf7AuucdMUNf6QHOHK68TUHNA==
X-Received: by 2002:a05:600c:2048:b0:3f9:b30f:a013 with SMTP id p8-20020a05600c204800b003f9b30fa013mr1237444wmg.6.1690531156785;
        Fri, 28 Jul 2023 00:59:16 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Wei Liu <wl@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v2 2/5] mm: Factor out the pdx compression logic in ma/va converters
Date: Fri, 28 Jul 2023 08:59:00 +0100
Message-Id: <20230728075903.7838-3-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
References: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This patch factors out the pdx compression logic hardcoded in both ports
for the maddr<->vaddr conversion functions.

Touches both x86 and arm ports.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v2:
  * Cast variable to u64 before shifting left to avoid overflow (Julien)
---
 xen/arch/arm/include/asm/mm.h          |  3 +--
 xen/arch/x86/include/asm/x86_64/page.h | 28 +++++++++++---------------
 xen/include/xen/pdx.h                  | 25 +++++++++++++++++++++++
 3 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index 5b530f0f40..c0d7f0f181 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -319,8 +319,7 @@ static inline void *maddr_to_virt(paddr_t ma)
            (DIRECTMAP_SIZE >> PAGE_SHIFT));
     return (void *)(XENHEAP_VIRT_START -
                     (directmap_base_pdx << PAGE_SHIFT) +
-                    ((ma & ma_va_bottom_mask) |
-                     ((ma & ma_top_mask) >> pfn_pdx_hole_shift)));
+                    maddr_to_directmapoff(ma));
 }
 #endif
 
diff --git a/xen/arch/x86/include/asm/x86_64/page.h b/xen/arch/x86/include/asm/x86_64/page.h
index 53faa7875b..b589c93e77 100644
--- a/xen/arch/x86/include/asm/x86_64/page.h
+++ b/xen/arch/x86/include/asm/x86_64/page.h
@@ -36,26 +36,22 @@ static inline unsigned long __virt_to_maddr(unsigned long va)
 {
     ASSERT(va < DIRECTMAP_VIRT_END);
     if ( va >= DIRECTMAP_VIRT_START )
-        va -= DIRECTMAP_VIRT_START;
-    else
-    {
-        BUILD_BUG_ON(XEN_VIRT_END - XEN_VIRT_START != GB(1));
-        /* Signed, so ((long)XEN_VIRT_START >> 30) fits in an imm32. */
-        ASSERT(((long)va >> (PAGE_ORDER_1G + PAGE_SHIFT)) ==
-               ((long)XEN_VIRT_START >> (PAGE_ORDER_1G + PAGE_SHIFT)));
-
-        va += xen_phys_start - XEN_VIRT_START;
-    }
-    return (va & ma_va_bottom_mask) |
-           ((va << pfn_pdx_hole_shift) & ma_top_mask);
+        return directmapoff_to_maddr(va - DIRECTMAP_VIRT_START);
+
+    BUILD_BUG_ON(XEN_VIRT_END - XEN_VIRT_START != GB(1));
+    /* Signed, so ((long)XEN_VIRT_START >> 30) fits in an imm32. */
+    ASSERT(((long)va >> (PAGE_ORDER_1G + PAGE_SHIFT)) ==
+           ((long)XEN_VIRT_START >> (PAGE_ORDER_1G + PAGE_SHIFT)));
+
+    return xen_phys_start + va - XEN_VIRT_START;
 }
 
 static inline void *__maddr_to_virt(unsigned long ma)
 {
-    ASSERT(pfn_to_pdx(ma >> PAGE_SHIFT) < (DIRECTMAP_SIZE >> PAGE_SHIFT));
-    return (void *)(DIRECTMAP_VIRT_START +
-                    ((ma & ma_va_bottom_mask) |
-                     ((ma & ma_top_mask) >> pfn_pdx_hole_shift)));
+    /* Offset in the direct map, accounting for pdx compression */
+    size_t va_offset = maddr_to_directmapoff(ma);
+    ASSERT(va_offset < DIRECTMAP_SIZE);
+    return (void *)(DIRECTMAP_VIRT_START + va_offset);
 }
 
 /* read access (should only be used for debug printk's) */
diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h
index de5439a5e5..d96f03d6e6 100644
--- a/xen/include/xen/pdx.h
+++ b/xen/include/xen/pdx.h
@@ -160,6 +160,31 @@ static inline unsigned long pdx_to_pfn(unsigned long pdx)
 #define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
 #define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
 
+/**
+ * Computes the offset into the direct map of an maddr
+ *
+ * @param ma Machine address
+ * @return Offset on the direct map where that
+ *         machine address can be accessed
+ */
+static inline unsigned long maddr_to_directmapoff(uint64_t ma)
+{
+    return ((ma & ma_top_mask) >> pfn_pdx_hole_shift) |
+           (ma & ma_va_bottom_mask);
+}
+
+/**
+ * Computes a machine address given a direct map offset
+ *
+ * @param offset Offset into the direct map
+ * @return Corresponding machine address of that virtual location
+ */
+static inline uint64_t directmapoff_to_maddr(unsigned long offset)
+{
+    return (((uint64_t)offset << pfn_pdx_hole_shift) & ma_top_mask) |
+           (offset & ma_va_bottom_mask);
+}
+
 /**
  * Initializes global variables with information about the compressible
  * range of the current memory regions.
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 07:59:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 07:59:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571352.895012 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPINg-0007V3-Ev; Fri, 28 Jul 2023 07:59:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571352.895012; Fri, 28 Jul 2023 07:59:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPINg-0007Uq-BY; Fri, 28 Jul 2023 07:59:24 +0000
Received: by outflank-mailman (input) for mailman id 571352;
 Fri, 28 Jul 2023 07:59:22 +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
 <SRS0=6gb0=DO=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qPINe-0006EL-BT
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 07:59:22 +0000
Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com
 [2a00:1450:4864:20::42e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a8722443-2d1c-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 09:59:20 +0200 (CEST)
Received: by mail-wr1-x42e.google.com with SMTP id
 ffacd0b85a97d-31783d02093so1314238f8f.0
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 00:59:20 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([2.223.46.215])
 by smtp.gmail.com with ESMTPSA id
 x2-20020adfdd82000000b0030e56a9ff25sm4089629wrl.31.2023.07.28.00.59.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 28 Jul 2023 00:59:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a8722443-2d1c-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690531160; x=1691135960;
        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=pOozgaOFWdrmn1fdpDhbIG2g4lDNcrwwZYe9WA/TRSo=;
        b=RtuhIpsxb/Oe/yK4GIPv0hh4K+ZsNHU5ZAEG6a+KteuXpyUgxfXK0L6C164pmP2PFh
         QZ7Cwhqavw7dn6wky9/OiGbg7gCwiEkpYnnGBKkDGb5YiczfFxmKgjZ4uMs9LHUEkhHL
         NhyfKdTWmuwr0VjsIfLFZdeKxQll5kSOe6l0g=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690531160; x=1691135960;
        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=pOozgaOFWdrmn1fdpDhbIG2g4lDNcrwwZYe9WA/TRSo=;
        b=FgM9lTDLSGawLde9FfS2HqR6vQQIoW4MysKItadLxSNdD1k+YgD6bZnGF+Aq8NbKkr
         GF+gbIjfW6O4+g9ti0TCRs6/NIdbCAZ5HahuDdXh8WRHdWdVidhBS4pu7wgeFx6dN3ux
         ITG8l8ndHCeHlnX/pRV/vOnpm1FAaRloRfjkJ2CG2I/tz/MuOiuMqDGuR07a6NQW/aoW
         ptDrN6BU+AX+rwRyFcQtNeKlbsSY5FH8rzsX3x0OXCAZiexuu9mUciFMlJhMfdT0TqXi
         fRdLh5CQSOiOCM9Lp0SHyBYh0YHCVY5V2rqdsHe+6/TdfgsQKV8JK7stDJbQXBea4yyf
         22YA==
X-Gm-Message-State: ABy/qLbWOSIbkin4SyuOoOg2h0atQFkB5pDqDjI3r3LN+8kHGkuRP/rp
	HdsZ2zuJ1fLrh8NX4ZMAlRBgVTeoANpzfe8+ruzf4Q==
X-Google-Smtp-Source: APBJJlFjzbpEP+31/si4/Vu6TgBDuGDUdgmDAb+LQSJdGqLQ5NObMm08ax7tAk4CWuY5q+eCt42g4Q==
X-Received: by 2002:a05:6000:1cc:b0:314:2d71:1f7a with SMTP id t12-20020a05600001cc00b003142d711f7amr1248369wrx.32.1690531159854;
        Fri, 28 Jul 2023 00:59:19 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Wei Liu <wl@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v2 5/5] pdx: Add CONFIG_HAS_PDX_COMPRESSION as a common Kconfig option
Date: Fri, 28 Jul 2023 08:59:03 +0100
Message-Id: <20230728075903.7838-6-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
References: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds a new compile-time flag to allow disabling pdx compression and
compiles out compression-related code/data. It also shorts the pdx<->pfn
conversion macros and creates stubs for masking fucntions.

While at it, removes the old arch-defined CONFIG_HAS_PDX flag, as it was
not removable in practice.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v2:
  * Merged v1/patch2: Removal of CONFIG_HAS_PDX here (Jan)
---
 xen/arch/arm/Kconfig  |  1 -
 xen/arch/x86/Kconfig  |  1 -
 xen/arch/x86/domain.c | 19 +++++++++++++------
 xen/common/Kconfig    | 13 ++++++++++---
 xen/common/Makefile   |  2 +-
 xen/common/pdx.c      | 15 +++++++++++----
 xen/include/xen/pdx.h | 37 ++++++++++++++++++++++++++++++++++---
 7 files changed, 69 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 439cc94f33..ea1949fbaa 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -14,7 +14,6 @@ config ARM
 	select HAS_ALTERNATIVE
 	select HAS_DEVICE_TREE
 	select HAS_PASSTHROUGH
-	select HAS_PDX
 	select HAS_PMAP
 	select HAS_UBSAN
 	select IOMMU_FORCE_PT_SHARE
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 92f3a627da..30df085d96 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -24,7 +24,6 @@ config X86
 	select HAS_PASSTHROUGH
 	select HAS_PCI
 	select HAS_PCI_MSI
-	select HAS_PDX
 	select HAS_SCHED_GRANULARITY
 	select HAS_UBSAN
 	select HAS_VPCI if HVM
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 5f66c2ae33..ee2830aad7 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -458,7 +458,7 @@ void domain_cpu_policy_changed(struct domain *d)
     }
 }
 
-#ifndef CONFIG_BIGMEM
+#if !defined(CONFIG_BIGMEM) && defined(CONFIG_PDX_COMPRESSION)
 /*
  * The hole may be at or above the 44-bit boundary, so we need to determine
  * the total bit count until reaching 32 significant (not squashed out) bits
@@ -485,13 +485,20 @@ static unsigned int __init noinline _domain_struct_bits(void)
 struct domain *alloc_domain_struct(void)
 {
     struct domain *d;
-#ifdef CONFIG_BIGMEM
-    const unsigned int bits = 0;
-#else
+
     /*
-     * We pack the PDX of the domain structure into a 32-bit field within
-     * the page_info structure. Hence the MEMF_bits() restriction.
+     * Without CONFIG_BIGMEM, we pack the PDX of the domain structure into
+     * a 32-bit field within the page_info structure. Hence the MEMF_bits()
+     * restriction. With PDX compression in place the number of bits must
+     * be calculated at runtime, but it's fixed otherwise.
+     *
+     * On systems with CONFIG_BIGMEM there's no packing, and so there's no
+     * such restriction.
      */
+#if defined(CONFIG_BIGMEM) || !defined(CONFIG_PDX_COMPRESSION)
+    const unsigned int bits = IS_ENABLED(CONFIG_BIGMEM) ? 0 :
+                                                          32 + PAGE_SHIFT;
+#else
     static unsigned int __read_mostly bits;
 
     if ( unlikely(!bits) )
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index dd8d7c3f1c..3a0afd8e83 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -23,6 +23,16 @@ config GRANT_TABLE
 
 	  If unsure, say Y.
 
+config PDX_COMPRESSION
+	bool "PDX (Page inDeX) compression support"
+	default ARM
+	help
+	  PDX compression is a technique that allows the hypervisor to
+	  represent physical addresses in a very space-efficient manner.
+	  This is very helpful reducing memory wastage in systems with
+	  memory banks with base addresses far from each other, but carrier
+	  a performance cost.
+
 config ALTERNATIVE_CALL
 	bool
 
@@ -53,9 +63,6 @@ config HAS_IOPORTS
 config HAS_KEXEC
 	bool
 
-config HAS_PDX
-	bool
-
 config HAS_PMAP
 	bool
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 46049eac35..0020cafb8a 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -29,7 +29,7 @@ obj-y += multicall.o
 obj-y += notifier.o
 obj-$(CONFIG_NUMA) += numa.o
 obj-y += page_alloc.o
-obj-$(CONFIG_HAS_PDX) += pdx.o
+obj-y += pdx.o
 obj-$(CONFIG_PERF_COUNTERS) += perfc.o
 obj-bin-$(CONFIG_HAS_PMAP) += pmap.init.o
 obj-y += preempt.o
diff --git a/xen/common/pdx.c b/xen/common/pdx.c
index d3d38965bd..a3b1ba9fbb 100644
--- a/xen/common/pdx.c
+++ b/xen/common/pdx.c
@@ -31,11 +31,15 @@ unsigned long __read_mostly pdx_group_valid[BITS_TO_LONGS(
 
 bool __mfn_valid(unsigned long mfn)
 {
-    if ( unlikely(evaluate_nospec(mfn >= max_page)) )
+    bool invalid = mfn >= max_page;
+#ifdef CONFIG_PDX_COMPRESSION
+    invalid |= mfn & pfn_hole_mask;
+#endif
+
+    if ( unlikely(evaluate_nospec(invalid)) )
         return false;
-    return likely(!(mfn & pfn_hole_mask)) &&
-           likely(test_bit(pfn_to_pdx(mfn) / PDX_GROUP_COUNT,
-                           pdx_group_valid));
+
+    return test_bit(pfn_to_pdx(mfn) / PDX_GROUP_COUNT, pdx_group_valid);
 }
 
 void set_pdx_range(unsigned long smfn, unsigned long emfn)
@@ -49,6 +53,8 @@ void set_pdx_range(unsigned long smfn, unsigned long emfn)
         __set_bit(idx, pdx_group_valid);
 }
 
+#ifdef CONFIG_PDX_COMPRESSION
+
 /*
  * Diagram to make sense of the following variables. The masks and shifts
  * are done on mfn values in order to convert to/from pdx:
@@ -175,6 +181,7 @@ void __init pfn_pdx_hole_setup(unsigned long mask)
     pfn_top_mask        = ~(pfn_pdx_bottom_mask | pfn_hole_mask);
     ma_top_mask         = pfn_top_mask << PAGE_SHIFT;
 }
+#endif /* CONFIG_PDX_COMPRESSION */
 
 
 /*
diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h
index 5a82b6bde2..dfb475c8dc 100644
--- a/xen/include/xen/pdx.h
+++ b/xen/include/xen/pdx.h
@@ -67,8 +67,6 @@
  * region involved.
  */
 
-#ifdef CONFIG_HAS_PDX
-
 extern unsigned long max_pdx;
 
 #define PDX_GROUP_COUNT ((1 << PDX_GROUP_SHIFT) / \
@@ -100,6 +98,8 @@ bool __mfn_valid(unsigned long mfn);
 #define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
 #define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
 
+#ifdef CONFIG_PDX_COMPRESSION
+
 extern unsigned long pfn_pdx_bottom_mask, ma_va_bottom_mask;
 extern unsigned int pfn_pdx_hole_shift;
 extern unsigned long pfn_hole_mask;
@@ -205,8 +205,39 @@ static inline uint64_t directmapoff_to_maddr(unsigned long offset)
  *             position marks a potentially compressible bit.
  */
 void pfn_pdx_hole_setup(unsigned long mask);
+#else /* CONFIG_PDX_COMPRESSION */
+
+/* Without PDX compression we can skip some computations */
+
+/* pdx<->pfn == identity */
+#define pdx_to_pfn(x) (x)
+#define pfn_to_pdx(x) (x)
+
+/* directmap is indexed by by maddr */
+#define maddr_to_directmapoff(x) (x)
+#define directmapoff_to_maddr(x) (x)
+
+static inline bool pdx_is_region_compressible(unsigned long smfn,
+                                              unsigned long emfn)
+{
+    return true;
+}
+
+static inline uint64_t pdx_init_mask(uint64_t base_addr)
+{
+    return 0;
+}
+
+static inline uint64_t pdx_region_mask(uint64_t base, uint64_t len)
+{
+    return 0;
+}
+
+static inline void pfn_pdx_hole_setup(unsigned long mask)
+{
+}
 
-#endif /* HAS_PDX */
+#endif /* CONFIG_PDX_COMPRESSION */
 #endif /* __XEN_PDX_H__ */
 
 /*
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 07:59:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 07:59:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571349.894982 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPINc-0006iB-Fu; Fri, 28 Jul 2023 07:59:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571349.894982; Fri, 28 Jul 2023 07:59:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPINc-0006i4-DA; Fri, 28 Jul 2023 07:59:20 +0000
Received: by outflank-mailman (input) for mailman id 571349;
 Fri, 28 Jul 2023 07:59:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=6gb0=DO=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qPINa-0006Dw-Q7
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 07:59:18 +0000
Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com
 [2a00:1450:4864:20::232])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a725496d-2d1c-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 09:59:18 +0200 (CEST)
Received: by mail-lj1-x232.google.com with SMTP id
 38308e7fff4ca-2b9b9f0387dso28344991fa.0
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 00:59:18 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([2.223.46.215])
 by smtp.gmail.com with ESMTPSA id
 x2-20020adfdd82000000b0030e56a9ff25sm4089629wrl.31.2023.07.28.00.59.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 28 Jul 2023 00:59:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a725496d-2d1c-11ee-b24d-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690531157; x=1691135957;
        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=ReW9AFHXUwWmGUET4cW6Dn/Jk38PwulLbjZEb+sqj5c=;
        b=NoLmZEJcNafj6b36zzbyv7+fjNo1/f+wlIq+rbDqvoqQR2eRXbRWVDgRO40mAn4Hfa
         xg86awH016D18+eTYIDtF4BZS3xi8qiGCgRl7zv831+6LL8+Qym8Q2O2QWaxnX+gAjJy
         jt8qJhHfyHb6Cqv2/oTAwfqBiZ+BTtadKZ+KM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690531157; x=1691135957;
        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=ReW9AFHXUwWmGUET4cW6Dn/Jk38PwulLbjZEb+sqj5c=;
        b=ImDduFd75uLBoyyxz+rJ7WiK11wkWwaSwcU10CY0GNynXJq+CUhQEPFhVDxujNE8f1
         o4qgZFLANBSWv0NnA3OTpRyLVaEUFlkGHU868aYI/TNddaBM9vhE0dthVytFHRd8iu3b
         P6MBBvJWQ9eKD6gvauIKluIeL/mxUHcxSDHgpq3dwJ276v75w4hH260G0bvb5grpe+1O
         FJllZnZw726jHIf6Oe7fPameTOntSuvaYrWwB02h1nn4qlyPznPusB6qhejKrnnRpS0N
         8Xl/rljHUDWFHYRRC4f+9u/cVoYOflWx3vbCfcmiDvWV0RuewM4t5FjuQsF5imfp/6uR
         cVwQ==
X-Gm-Message-State: ABy/qLap1JrX6RMsIIiwK0TaPsLAeS6DQpYgzJRs2C5zFPvMB8KsNKZN
	/UXLmXnNVT/uYvWAl9vwRjnTUaZagJ1F1AzT3e7A5g==
X-Google-Smtp-Source: APBJJlGL69JYizj8RU8kJ9Wo/8uZ+bmzmVMetwAhxVo7wvpNSIlCNWp52zwJYLLmY19BdSqP5HvIJw==
X-Received: by 2002:a2e:b045:0:b0:2b6:e283:32cb with SMTP id d5-20020a2eb045000000b002b6e28332cbmr1153579ljl.23.1690531157645;
        Fri, 28 Jul 2023 00:59:17 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v2 3/5] mm/pdx: Standardize region validation wrt pdx compression
Date: Fri, 28 Jul 2023 08:59:01 +0100
Message-Id: <20230728075903.7838-4-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
References: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Regions must be occasionally validated for pdx compression validity. That
is, whether any of the machine addresses spanning the region have a bit set
in the pdx "hole" (which is expected to always contain zeroes). There are
a few such tests through the code, and they all check for different things.

This patch replaces all such occurrences with a call to a centralized
function that checks a region for validity.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v2:
  * s/occurences/ocurrences in commit message (Julien)
  * Use pfn_to_paddr()/paddr_to_pfn() (Julien)
  * Use (paddr_t,unsigned long) in pdx_is_region_compressible() (Julien, Jan)
---
 xen/arch/x86/x86_64/mm.c |  7 +++++--
 xen/common/efi/boot.c    | 13 ++++++++++---
 xen/common/pdx.c         | 10 ++++++++--
 xen/include/xen/pdx.h    |  9 +++++++++
 4 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 60db439af3..652e787934 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -1159,6 +1159,9 @@ static int mem_hotadd_check(unsigned long spfn, unsigned long epfn)
 {
     unsigned long s, e, length, sidx, eidx;
 
+    paddr_t mem_base = pfn_to_paddr(spfn);
+    unsigned long mem_npages = epfn - spfn;
+
     if ( (spfn >= epfn) )
         return 0;
 
@@ -1168,7 +1171,7 @@ static int mem_hotadd_check(unsigned long spfn, unsigned long epfn)
     if ( (spfn | epfn) & ((1UL << PAGETABLE_ORDER) - 1) )
         return 0;
 
-    if ( (spfn | epfn) & pfn_hole_mask )
+    if ( !pdx_is_region_compressible(mem_base, mem_npages) )
         return 0;
 
     /* Make sure the new range is not present now */
@@ -1207,7 +1210,7 @@ static int mem_hotadd_check(unsigned long spfn, unsigned long epfn)
 
     length += (e - s) * sizeof(struct page_info);
 
-    if ((length >> PAGE_SHIFT) > (epfn - spfn))
+    if ((length >> PAGE_SHIFT) > mem_npages)
         return 0;
 
     return 1;
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 79a654af69..52a7239389 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -14,6 +14,7 @@
 #include <xen/multiboot.h>
 #include <xen/param.h>
 #include <xen/pci_regs.h>
+#include <xen/pdx.h>
 #include <xen/pfn.h>
 #if EFI_PAGE_SIZE != PAGE_SIZE
 # error Cannot use xen/pfn.h here!
@@ -1645,9 +1646,11 @@ static __init void copy_mapping(unsigned long mfn, unsigned long end,
 
 static bool __init cf_check ram_range_valid(unsigned long smfn, unsigned long emfn)
 {
+    paddr_t ram_base = pfn_to_paddr(smfn);
+    unsigned long ram_npages = emfn - smfn;
     unsigned long sz = pfn_to_pdx(emfn - 1) / PDX_GROUP_COUNT + 1;
 
-    return !(smfn & pfn_hole_mask) &&
+    return pdx_is_region_compressible(ram_base, ram_npages) &&
            find_next_bit(pdx_group_valid, sz,
                          pfn_to_pdx(smfn) / PDX_GROUP_COUNT) < sz;
 }
@@ -1660,6 +1663,8 @@ static bool __init cf_check rt_range_valid(unsigned long smfn, unsigned long emf
 
 void __init efi_init_memory(void)
 {
+    paddr_t mem_base;
+    unsigned long mem_npages;
     unsigned int i;
     l4_pgentry_t *efi_l4t;
     struct rt_extra {
@@ -1732,6 +1737,9 @@ void __init efi_init_memory(void)
         smfn = PFN_DOWN(desc->PhysicalStart);
         emfn = PFN_UP(desc->PhysicalStart + len);
 
+        mem_base = pfn_to_paddr(smfn);
+        mem_npages = emfn - smfn;
+
         if ( desc->Attribute & EFI_MEMORY_WB )
             prot |= _PAGE_WB;
         else if ( desc->Attribute & EFI_MEMORY_WT )
@@ -1759,8 +1767,7 @@ void __init efi_init_memory(void)
             prot |= _PAGE_NX;
 
         if ( pfn_to_pdx(emfn - 1) < (DIRECTMAP_SIZE >> PAGE_SHIFT) &&
-             !(smfn & pfn_hole_mask) &&
-             !((smfn ^ (emfn - 1)) & ~pfn_pdx_bottom_mask) )
+             pdx_is_region_compressible(mem_base, mem_npages))
         {
             if ( (unsigned long)mfn_to_virt(emfn - 1) >= HYPERVISOR_VIRT_END )
                 prot &= ~_PAGE_GLOBAL;
diff --git a/xen/common/pdx.c b/xen/common/pdx.c
index 99d4a90a50..3c88ceeb9c 100644
--- a/xen/common/pdx.c
+++ b/xen/common/pdx.c
@@ -88,7 +88,7 @@ bool __mfn_valid(unsigned long mfn)
 }
 
 /* Sets all bits from the most-significant 1-bit down to the LSB */
-static uint64_t __init fill_mask(uint64_t mask)
+static uint64_t fill_mask(uint64_t mask)
 {
     while (mask & (mask + 1))
         mask |= mask + 1;
@@ -96,6 +96,12 @@ static uint64_t __init fill_mask(uint64_t mask)
     return mask;
 }
 
+bool pdx_is_region_compressible(paddr_t base, unsigned long npages)
+{
+    return !(paddr_to_pfn(base) & pfn_hole_mask) &&
+           !(pdx_region_mask(base, npages * PAGE_SIZE) & ~ma_va_bottom_mask);
+}
+
 /* We don't want to compress the low MAX_ORDER bits of the addresses. */
 uint64_t __init pdx_init_mask(uint64_t base_addr)
 {
@@ -103,7 +109,7 @@ uint64_t __init pdx_init_mask(uint64_t base_addr)
                          (uint64_t)1 << (MAX_ORDER + PAGE_SHIFT)) - 1);
 }
 
-uint64_t __init pdx_region_mask(uint64_t base, uint64_t len)
+uint64_t pdx_region_mask(uint64_t base, uint64_t len)
 {
     /*
      * We say a bit "moves" in a range if there exist 2 addresses in that
diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h
index d96f03d6e6..8c6aec2aea 100644
--- a/xen/include/xen/pdx.h
+++ b/xen/include/xen/pdx.h
@@ -79,6 +79,15 @@ extern unsigned long pfn_top_mask, ma_top_mask;
                          (sizeof(*frame_table) & -sizeof(*frame_table)))
 extern unsigned long pdx_group_valid[];
 
+/**
+ * Validate a region's compatibility with the current compression runtime
+ *
+ * @param base Base address of the region
+ * @param npages Number of PAGE_SIZE-sized pages in the region
+ * @return True iff the region can be used with the current compression
+ */
+bool pdx_is_region_compressible(paddr_t base, unsigned long npages);
+
 /**
  * Calculates a mask covering "moving" bits of all addresses of a region
  *
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 07:59:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 07:59:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571351.895002 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPINe-0007D4-7d; Fri, 28 Jul 2023 07:59:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571351.895002; Fri, 28 Jul 2023 07:59:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPINe-0007Cu-4n; Fri, 28 Jul 2023 07:59:22 +0000
Received: by outflank-mailman (input) for mailman id 571351;
 Fri, 28 Jul 2023 07:59:21 +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
 <SRS0=6gb0=DO=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qPINd-0006EL-03
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 07:59:21 +0000
Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com
 [2a00:1450:4864:20::42d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a7b0df59-2d1c-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 09:59:19 +0200 (CEST)
Received: by mail-wr1-x42d.google.com with SMTP id
 ffacd0b85a97d-3172144c084so1889023f8f.1
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 00:59:19 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([2.223.46.215])
 by smtp.gmail.com with ESMTPSA id
 x2-20020adfdd82000000b0030e56a9ff25sm4089629wrl.31.2023.07.28.00.59.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 28 Jul 2023 00:59:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a7b0df59-2d1c-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690531158; x=1691135958;
        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=DcWQ5zRXoU9dhWUyJ3dp40kLLDXm9GQitAHD/nVjJUI=;
        b=Ks75G9eIjp1DomfZ0l4x05OtEkPTL8zT/5QQwOE+sAJVVokWnoNz7GRNF5cf8j9TvG
         X7JVUY1XARLgnJ8OhmlMZZDlgkMQc08Bv3xfUo1qBFqp0haNCcaUVPqaGPkcjeytpkFh
         mDTpggK5CNr5TCejb3tlTSttIwdFPlTc1tLKE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690531158; x=1691135958;
        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=DcWQ5zRXoU9dhWUyJ3dp40kLLDXm9GQitAHD/nVjJUI=;
        b=dHnKDZJV3hg7b2oxnW5d86mz1ayZ7khuNmyopsHpJEnS+ya4ko9gv2HHANdBohfrYV
         tm1O0FlfBFI2q3b+h2gSRNVkrrZyoC71U7Pbnb1Bg4BxRWQx5wqTrIleCCgxgE0NTUB0
         NclCSZ2XBeMPvI3qzXK7tfscheCrB6n1IjpFkFG09gjKPo652dLkeoEjn4A9XHPHyG56
         wIXFNwzdFvWNfU3aaqyx/OBDsNQCO3BoT56DRn/HLCUCUqgSvhB1bp3sCLWWPxZGZ15F
         YHlnO/k7mpj/kRgSxVxYoLURalfMQv6zxFG/W714xbbhn6n0GBcddTewexgQ+UjLEjiu
         3wOQ==
X-Gm-Message-State: ABy/qLbqf0t5IzpJhgd1ygvroyqOi0XHaNQi0w+pqQ9izogvwuejekY+
	f5uHLhPr9gY0mOmslxo7jVhNhuwgDCFZIEq58xZ9zA==
X-Google-Smtp-Source: APBJJlEySriUpv9Ig2e0yAVPhSQsFI8f3TbcqUN2hcrX6Cfyh406FH7C7doEfRI3AxpifZccvyOxiQ==
X-Received: by 2002:adf:ec86:0:b0:314:3b1f:8ea2 with SMTP id z6-20020adfec86000000b003143b1f8ea2mr1312456wrn.6.1690531158618;
        Fri, 28 Jul 2023 00:59:18 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [PATCH v2 4/5] pdx: Reorder pdx.[ch]
Date: Fri, 28 Jul 2023 08:59:02 +0100
Message-Id: <20230728075903.7838-5-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
References: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The next patch compiles out compression-related chunks, and it's helpful to
have them grouped together beforehand.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v2:
  * Fix rebase error by which some function prototypes were left intact
    when they should've been removed
---
 xen/common/pdx.c      | 58 +++++++++++++++++++++---------------------
 xen/include/xen/pdx.h | 59 ++++++++++++++++++++++---------------------
 2 files changed, 59 insertions(+), 58 deletions(-)

diff --git a/xen/common/pdx.c b/xen/common/pdx.c
index 3c88ceeb9c..d3d38965bd 100644
--- a/xen/common/pdx.c
+++ b/xen/common/pdx.c
@@ -20,6 +20,35 @@
 #include <xen/bitops.h>
 #include <xen/nospec.h>
 
+/**
+ * Maximum (non-inclusive) usable pdx. Must be
+ * modifiable after init due to memory hotplug
+ */
+unsigned long __read_mostly max_pdx;
+
+unsigned long __read_mostly pdx_group_valid[BITS_TO_LONGS(
+    (FRAMETABLE_NR + PDX_GROUP_COUNT - 1) / PDX_GROUP_COUNT)] = { [0] = 1 };
+
+bool __mfn_valid(unsigned long mfn)
+{
+    if ( unlikely(evaluate_nospec(mfn >= max_page)) )
+        return false;
+    return likely(!(mfn & pfn_hole_mask)) &&
+           likely(test_bit(pfn_to_pdx(mfn) / PDX_GROUP_COUNT,
+                           pdx_group_valid));
+}
+
+void set_pdx_range(unsigned long smfn, unsigned long emfn)
+{
+    unsigned long idx, eidx;
+
+    idx = pfn_to_pdx(smfn) / PDX_GROUP_COUNT;
+    eidx = (pfn_to_pdx(emfn - 1) + PDX_GROUP_COUNT) / PDX_GROUP_COUNT;
+
+    for ( ; idx < eidx; ++idx )
+        __set_bit(idx, pdx_group_valid);
+}
+
 /*
  * Diagram to make sense of the following variables. The masks and shifts
  * are done on mfn values in order to convert to/from pdx:
@@ -47,12 +76,6 @@
  * ones.
  */
 
-/**
- * Maximum (non-inclusive) usable pdx. Must be
- * modifiable after init due to memory hotplug
- */
-unsigned long __read_mostly max_pdx;
-
 /** Mask for the lower non-compressible bits of an mfn */
 unsigned long __ro_after_init pfn_pdx_bottom_mask = ~0UL;
 
@@ -75,18 +98,6 @@ unsigned long __ro_after_init pfn_hole_mask = 0;
 /** Number of bits of the "compressible" bit slice of an mfn */
 unsigned int __ro_after_init pfn_pdx_hole_shift = 0;
 
-unsigned long __read_mostly pdx_group_valid[BITS_TO_LONGS(
-    (FRAMETABLE_NR + PDX_GROUP_COUNT - 1) / PDX_GROUP_COUNT)] = { [0] = 1 };
-
-bool __mfn_valid(unsigned long mfn)
-{
-    if ( unlikely(evaluate_nospec(mfn >= max_page)) )
-        return false;
-    return likely(!(mfn & pfn_hole_mask)) &&
-           likely(test_bit(pfn_to_pdx(mfn) / PDX_GROUP_COUNT,
-                           pdx_group_valid));
-}
-
 /* Sets all bits from the most-significant 1-bit down to the LSB */
 static uint64_t fill_mask(uint64_t mask)
 {
@@ -124,17 +135,6 @@ uint64_t pdx_region_mask(uint64_t base, uint64_t len)
     return fill_mask(base ^ (base + len - 1));
 }
 
-void set_pdx_range(unsigned long smfn, unsigned long emfn)
-{
-    unsigned long idx, eidx;
-
-    idx = pfn_to_pdx(smfn) / PDX_GROUP_COUNT;
-    eidx = (pfn_to_pdx(emfn - 1) + PDX_GROUP_COUNT) / PDX_GROUP_COUNT;
-
-    for ( ; idx < eidx; ++idx )
-        __set_bit(idx, pdx_group_valid);
-}
-
 void __init pfn_pdx_hole_setup(unsigned long mask)
 {
     unsigned int i, j, bottom_shift = 0, hole_shift = 0;
diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h
index 8c6aec2aea..5a82b6bde2 100644
--- a/xen/include/xen/pdx.h
+++ b/xen/include/xen/pdx.h
@@ -70,15 +70,41 @@
 #ifdef CONFIG_HAS_PDX
 
 extern unsigned long max_pdx;
-extern unsigned long pfn_pdx_bottom_mask, ma_va_bottom_mask;
-extern unsigned int pfn_pdx_hole_shift;
-extern unsigned long pfn_hole_mask;
-extern unsigned long pfn_top_mask, ma_top_mask;
 
 #define PDX_GROUP_COUNT ((1 << PDX_GROUP_SHIFT) / \
                          (sizeof(*frame_table) & -sizeof(*frame_table)))
 extern unsigned long pdx_group_valid[];
 
+/**
+ * Mark [smfn, emfn) as allocatable in the frame table
+ *
+ * @param smfn Start mfn
+ * @param emfn End mfn
+ */
+void set_pdx_range(unsigned long smfn, unsigned long emfn);
+
+/**
+ * Invoked to determine if an mfn has an associated valid frame table entry
+ *
+ * In order for it to be legal it must pass bounds, grouping and
+ * compression sanity checks.
+ *
+ * @param mfn To-be-checked mfn
+ * @return True iff all checks pass
+ */
+bool __mfn_valid(unsigned long mfn);
+
+#define page_to_pdx(pg)  ((pg) - frame_table)
+#define pdx_to_page(pdx) gcc11_wrap(frame_table + (pdx))
+
+#define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
+#define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
+
+extern unsigned long pfn_pdx_bottom_mask, ma_va_bottom_mask;
+extern unsigned int pfn_pdx_hole_shift;
+extern unsigned long pfn_hole_mask;
+extern unsigned long pfn_top_mask, ma_top_mask;
+
 /**
  * Validate a region's compatibility with the current compression runtime
  *
@@ -120,28 +146,6 @@ uint64_t pdx_region_mask(uint64_t base, uint64_t len);
  */
 uint64_t pdx_init_mask(uint64_t base_addr);
 
-/**
- * Mark [smfn, emfn) as accesible in the frame table
- *
- * @param smfn Start mfn
- * @param emfn End mfn
- */
-void set_pdx_range(unsigned long smfn, unsigned long emfn);
-
-#define page_to_pdx(pg)  ((pg) - frame_table)
-#define pdx_to_page(pdx) gcc11_wrap(frame_table + (pdx))
-
-/**
- * Invoked to determine if an mfn has an associated valid frame table entry
- *
- * In order for it to be legal it must pass bounds, grouping and
- * compression sanity checks.
- *
- * @param mfn To-be-checked mfn
- * @return True iff all checks pass
- */
-bool __mfn_valid(unsigned long mfn);
-
 /**
  * Map pfn to its corresponding pdx
  *
@@ -166,9 +170,6 @@ static inline unsigned long pdx_to_pfn(unsigned long pdx)
            ((pdx << pfn_pdx_hole_shift) & pfn_top_mask);
 }
 
-#define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
-#define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
-
 /**
  * Computes the offset into the direct map of an maddr
  *
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 07:59:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 07:59:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571347.894962 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPINb-0006Ec-2i; Fri, 28 Jul 2023 07:59:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571347.894962; Fri, 28 Jul 2023 07:59:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPINa-0006EV-W7; Fri, 28 Jul 2023 07:59:18 +0000
Received: by outflank-mailman (input) for mailman id 571347;
 Fri, 28 Jul 2023 07:59:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=6gb0=DO=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qPINZ-0006Dw-6z
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 07:59:17 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a58da7a3-2d1c-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 09:59:15 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-4fe1489ced6so3155838e87.0
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 00:59:15 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([2.223.46.215])
 by smtp.gmail.com with ESMTPSA id
 x2-20020adfdd82000000b0030e56a9ff25sm4089629wrl.31.2023.07.28.00.59.13
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 28 Jul 2023 00:59:14 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a58da7a3-2d1c-11ee-b24d-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690531155; x=1691135955;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=rQ8GAGKVTdBJDiMCFf/cQuGt+MTjVyEKYvgM1SWGPZE=;
        b=Nv7FXAUPPBPzRL/8QSIT6HqywGoeaBOOkC9QTiaNNfp+HW0DrCqYwEZt6QSurW5ZLF
         9NAVpRaCi01CdXk5fO1cc7OcZKorRxxhGT18X3h/GkxwkJmSl2gBuq53A7IiYxhvI3sy
         oZWLAN/g4fuDQ4d9+VdvoQotRRn2XPx51gVb0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690531155; x=1691135955;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=rQ8GAGKVTdBJDiMCFf/cQuGt+MTjVyEKYvgM1SWGPZE=;
        b=FFD1gpBwFK3trw9DLYKv2ARlSoeOiMrBHqYd9xhahI/qVDuYWa7ioYuUMrkYiBfBZK
         azakzXbeh9zV/mjUUVFomEMgJiBwAAwtc/B5kpZ8rLkiQf4UKCwaEgGyfowCfzuor4bC
         3nLnq1roq4S04cbfcn04nudpgssARIf9XbIyKYOBhU/FUB1b0dS5Kzmzd7JP17srcXXh
         OwDtwzYt1R4OYN8dqTXlRW6v5V1Tw19fEX/yru6dAcyYuMUIRHVWGvgGMXKDgNCBH5O7
         umeTNDJeN4gwQcCxXpVE/SnBDa01jfrIO0jW3BVcr/3O/ckUhUIYTEdd/Nw+nis1/Ewt
         pw0Q==
X-Gm-Message-State: ABy/qLbGduN67ywbhBeOcMmFlsBvC1ZtG97ciL2CHq1XkIojEEXLvHQu
	E+1nHZYCQ4I6FGjBWDSWXBLD0NCA40I+onoK14EEqQ==
X-Google-Smtp-Source: APBJJlH2Ebt+A2ZEoAjBY0a03tkMgSZlz6iZkafMDp1YMn/rdIVeRT0CDp6QTfDSyFnITDqcY335SA==
X-Received: by 2002:a05:6512:ad3:b0:4f8:7781:9870 with SMTP id n19-20020a0565120ad300b004f877819870mr1377566lfu.60.1690531154790;
        Fri, 28 Jul 2023 00:59:14 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Wei Liu <wl@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v2 0/5] Make PDX compression optional
Date: Fri, 28 Jul 2023 08:58:58 +0100
Message-Id: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Currently there's a CONFIG_HAS_PDX Kconfig option, but it's impossible to
disable it because the whole codebase performs unconditional
compression/decompression operations on addresses. This has the
unfortunate side effect that systems without a need for compression still
have to pay the performance impact of juggling bits on every pfn<->pdx
conversion (this requires reading several global variables). This series
attempts to:

  * Leave the state of pdx and pdx compression documented
  * Factor out compression so it _can_ be removed through Kconfig
  * Make it so compression is disabled on x86 and enabled on both Aarch32
    and Aarch64 by default.

Series summary:

Patch 1 makes a clarification in ARM code to explain some discrepancies
        between the concept of "directmap" in arm32 and arm64 relevant to
        this series (i.e: why this series doesn't touch arm32 in directmap
        accesses).
Patch 2 Moves hard-coded compression-related logic to helper functions
Patch 3 Refactors all instances of regions being validated for pdx
        compression conformance so it's done through a helper
Patch 4 Non-functional reorder in order to simplify the patch 8 diff
Patch 5 Adds new Kconfig option to compile out PDX compression and removes
        the old CONFIG_HAS_PDX, as it was non removable

Already committed:

v1/patch 1 documents the current general understanding of the pdx concept and
           pdx compression in particular
v1/patch 3 Marks the pdx compression globals as ro_after_init

Alejandro Vallejo (5):
  arm/mm: Document the differences between arm32 and arm64 directmaps
  mm: Factor out the pdx compression logic in ma/va converters
  mm/pdx: Standardize region validation wrt pdx compression
  pdx: Reorder pdx.[ch]
  pdx: Add CONFIG_HAS_PDX_COMPRESSION as a common Kconfig option

 xen/arch/arm/Kconfig                   |   1 -
 xen/arch/arm/include/asm/mm.h          |  29 +++++-
 xen/arch/x86/Kconfig                   |   1 -
 xen/arch/x86/domain.c                  |  19 ++--
 xen/arch/x86/include/asm/x86_64/page.h |  28 +++---
 xen/arch/x86/x86_64/mm.c               |   7 +-
 xen/common/Kconfig                     |  13 ++-
 xen/common/Makefile                    |   2 +-
 xen/common/efi/boot.c                  |  13 ++-
 xen/common/pdx.c                       |  75 +++++++++------
 xen/include/xen/pdx.h                  | 126 +++++++++++++++++++------
 11 files changed, 218 insertions(+), 96 deletions(-)

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 08:01:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 08:01:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571364.895022 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPIPz-0002Sb-Cy; Fri, 28 Jul 2023 08:01:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571364.895022; Fri, 28 Jul 2023 08:01:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPIPz-0002SU-9a; Fri, 28 Jul 2023 08:01:47 +0000
Received: by outflank-mailman (input) for mailman id 571364;
 Fri, 28 Jul 2023 08:01:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPIPx-0002SF-OL; Fri, 28 Jul 2023 08:01:45 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPIPx-0006gb-JF; Fri, 28 Jul 2023 08:01:45 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPIPx-0006Mi-1g; Fri, 28 Jul 2023 08:01:45 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qPIPx-0000XQ-1B; Fri, 28 Jul 2023 08:01:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=7gT9WrWynE603wVYRT+n5xzushIbyNc0aYLymSlKt3g=; b=U0rmO8MLKDS9FcY8m3hZVDR1Vh
	XDG8RJEAcxuxqCNdR9Xt5opN5BpjLM9TF8/sdzrZJwU/r4kV51UIBLtiqxuK9k+5MKcQw7Fd6IiZ0
	LPTdfVgxfSknUi0Z37UAxHgeXBUj1EnjYKHbrV1TwU3MgjZQYWE7KuW4zk5HZ1ck8ZuY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182031-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-5.4 test] 182031: regressions - FAIL
X-Osstest-Failures:
    linux-5.4:test-armhf-armhf-xl-credit2:guest-start/debian.repeat:fail:regression
    linux-5.4:test-armhf-armhf-xl-credit2:guest-start:fail:heisenbug
    linux-5.4:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit1:guest-start/debian.repeat:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=887433e4bc9394676d22c038dba33a27405f94e8
X-Osstest-Versions-That:
    linux=27745d94abe1036a3423cb8577b665c01725e321
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 28 Jul 2023 08:01:45 +0000

flight 182031 linux-5.4 real [real]
flight 182052 linux-5.4 real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/182031/
http://logs.test-lab.xenproject.org/osstest/logs/182052/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-armhf-armhf-xl-credit2 18 guest-start/debian.repeat fail in 182052 REGR. vs. 182001

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-credit2  14 guest-start         fail pass in 182052-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-credit2 15 migrate-support-check fail in 182052 never pass
 test-armhf-armhf-xl-credit2 16 saverestore-support-check fail in 182052 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182001
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182001
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 182001
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 182001
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 182001
 test-armhf-armhf-xl-credit1  18 guest-start/debian.repeat    fail  like 182001
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182001
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 182001
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 182001
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 182001
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 182001
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 182001
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182001
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                887433e4bc9394676d22c038dba33a27405f94e8
baseline version:
 linux                27745d94abe1036a3423cb8577b665c01725e321

Last test of basis   182001  2023-07-24 17:45:59 Z    3 days
Testing same since   182031  2023-07-27 07:14:08 Z    1 days    1 attempts

------------------------------------------------------------
312 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 10044 lines long.)


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 08:12:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 08:12:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571372.895044 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPIZv-0004Pb-JM; Fri, 28 Jul 2023 08:12:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571372.895044; Fri, 28 Jul 2023 08:12:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPIZv-0004PU-Go; Fri, 28 Jul 2023 08:12:03 +0000
Received: by outflank-mailman (input) for mailman id 571372;
 Fri, 28 Jul 2023 08:12:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=B1pf=DO=arm.com=luca.fancellu@srs-se1.protection.inumbo.net>)
 id 1qPIZu-0004AY-CM
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 08:12:02 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTP
 id 6cd904e3-2d1e-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 10:11:59 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 14C43D75;
 Fri, 28 Jul 2023 01:12:42 -0700 (PDT)
Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.1])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9DD3F3F67D;
 Fri, 28 Jul 2023 01:11:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6cd904e3-2d1e-11ee-b24d-6b7b168915f2
From: Luca Fancellu <luca.fancellu@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com,
	wei.chen@arm.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [RFC PATCH 1/5] [WIP]misra: add entries to the excluded list
Date: Fri, 28 Jul 2023 09:11:40 +0100
Message-Id: <20230728081144.4124309-2-luca.fancellu@arm.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230728081144.4124309-1-luca.fancellu@arm.com>
References: <20230728081144.4124309-1-luca.fancellu@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add entries to the exclusion list, so that they can be excluded
from the formatter tool.

TBD: add a field on each entry to understand for what tool is the
exclusion

Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
---
 docs/misra/exclude-list.json | 88 ++++++++++++++++++++++++++++++++++++
 1 file changed, 88 insertions(+)

diff --git a/docs/misra/exclude-list.json b/docs/misra/exclude-list.json
index ca1e2dd678ff..c103c69209c9 100644
--- a/docs/misra/exclude-list.json
+++ b/docs/misra/exclude-list.json
@@ -1,6 +1,10 @@
 {
     "version": "1.0",
     "content": [
+        {
+            "rel_path": "arch/arm/arm32/lib/assembler.h",
+            "comment": "Includes mostly assembly macro and it's meant to be included only in assembly code"
+        },
         {
             "rel_path": "arch/arm/arm64/cpufeature.c",
             "comment": "Imported from Linux, ignore for now"
@@ -13,6 +17,26 @@
             "rel_path": "arch/arm/arm64/lib/find_next_bit.c",
             "comment": "Imported from Linux, ignore for now"
         },
+        {
+            "rel_path": "arch/arm/include/asm/arm32/macros.h",
+            "comment": "Includes only assembly macro"
+        },
+        {
+            "rel_path": "arch/arm/include/asm/arm64/macros.h",
+            "comment": "Includes only assembly macro"
+        },
+        {
+            "rel_path": "arch/arm/include/asm/alternative.h",
+            "comment": "Imported from Linux, ignore for now"
+        },
+        {
+            "rel_path": "arch/arm/include/asm/asm_defns.h",
+            "comment": "Includes mostly assembly macro"
+        },
+        {
+            "rel_path": "arch/arm/include/asm/macros.h",
+            "comment": "Includes mostly assembly macro and it's meant to be included only in assembly code"
+        },
         {
             "rel_path": "arch/x86/acpi/boot.c",
             "comment": "Imported from Linux, ignore for now"
@@ -69,6 +93,30 @@
             "rel_path": "arch/x86/cpu/mwait-idle.c",
             "comment": "Imported from Linux, ignore for now"
         },
+        {
+            "rel_path": "arch/x86/include/asm/alternative-asm.h",
+            "comment": "Includes mostly assembly macro and it's meant to be included only in assembly code"
+        },
+        {
+            "rel_path": "arch/x86/include/asm/asm_defns.h",
+            "comment": "Includes mostly assembly macro"
+        },
+        {
+            "rel_path": "arch/x86/include/asm/asm-defns.h",
+            "comment": "Includes mostly assembly macro"
+        },
+        {
+            "rel_path": "arch/x86/include/asm/bug.h",
+            "comment": "Includes mostly assembly macro"
+        },
+        {
+            "rel_path": "arch/x86/include/asm/mpspec.h",
+            "comment": "Imported from Linux, also case ranges are not handled by clang-format, ignore for now"
+        },
+        {
+            "rel_path": "arch/x86/include/asm/spec_ctrl_asm.h",
+            "comment": "Includes mostly assembly macro"
+        },
         {
             "rel_path": "arch/x86/delay.c",
             "comment": "Imported from Linux, ignore for now"
@@ -181,6 +229,42 @@
             "rel_path": "drivers/video/font_*",
             "comment": "Imported from Linux, ignore for now"
         },
+        {
+            "rel_path": "include/efi/*.h",
+            "comment": "Imported from gnu-efi-3.0k"
+        },
+        {
+            "rel_path": "include/public/arch-x86/cpufeatureset.h",
+            "comment": "This file contains some inputs for the gen-cpuid.py script, leave it out"
+        },
+        {
+            "rel_path": "include/public/**/**/*.h",
+            "comment": "Public headers are quite sensitive to format tools"
+        },
+        {
+            "rel_path": "include/public/**/*.h",
+            "comment": "Public headers are quite sensitive to format tools"
+        },
+        {
+            "rel_path": "include/public/*.h",
+            "comment": "Public headers are quite sensitive to format tools"
+        },
+        {
+            "rel_path": "include/xen/cper.h",
+            "comment": "Header does not follow Xen coding style"
+        },
+        {
+            "rel_path": "include/xen/nodemask.h",
+            "comment": "Imported from Linux, also case ranges are not handled by clang-format, ignore for now"
+        },
+        {
+            "rel_path": "include/xen/xen.lds.h",
+            "comment": "This file contains only macros used inside the linker script"
+        },
+        {
+            "rel_path": "include/hypercall-defs.c",
+            "comment": "This file contains only C preprocessing syntax, the other lines are not C and are used to generate the hypercall definition by another script."
+        },
         {
             "rel_path": "lib/list-sort.c",
             "comment": "Imported from Linux, ignore for now"
@@ -193,6 +277,10 @@
             "rel_path": "lib/xxhash*.c",
             "comment": "Imported from Linux, ignore for now"
         },
+        {
+            "rel_path": "tools/*",
+            "comment": "Contains host tools imported from Linux, ignore for now"
+        },
         {
             "rel_path": "xsm/flask/*",
             "comment": "Not in scope initially as it generates many violations and it is not enabled in safety configurations"
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 08:12:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 08:12:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571374.895065 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPIZx-0004tR-85; Fri, 28 Jul 2023 08:12:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571374.895065; Fri, 28 Jul 2023 08:12:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPIZx-0004sQ-2J; Fri, 28 Jul 2023 08:12:05 +0000
Received: by outflank-mailman (input) for mailman id 571374;
 Fri, 28 Jul 2023 08:12:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=B1pf=DO=arm.com=luca.fancellu@srs-se1.protection.inumbo.net>)
 id 1qPIZv-0004AY-8m
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 08:12:03 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTP
 id 6e6e9f40-2d1e-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 10:12:02 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9F8581516;
 Fri, 28 Jul 2023 01:12:44 -0700 (PDT)
Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.1])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 180D23F67D;
 Fri, 28 Jul 2023 01:11:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6e6e9f40-2d1e-11ee-b24d-6b7b168915f2
From: Luca Fancellu <luca.fancellu@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com,
	wei.chen@arm.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [RFC PATCH 3/5] [WIP]xen/scripts: add codestyle.py script
Date: Fri, 28 Jul 2023 09:11:42 +0100
Message-Id: <20230728081144.4124309-4-luca.fancellu@arm.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230728081144.4124309-1-luca.fancellu@arm.com>
References: <20230728081144.4124309-1-luca.fancellu@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This script finds every .c and .h file in the xen hypervisor
codebase, takes the exclusion list from docs/misra, removes the
file excluded from the list and for the remaining files is
calling clang-format on them.

TBD: write it better

Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/scripts/codestyle.py | 261 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 261 insertions(+)
 create mode 100755 xen/scripts/codestyle.py

diff --git a/xen/scripts/codestyle.py b/xen/scripts/codestyle.py
new file mode 100755
index 000000000000..5bba004d814b
--- /dev/null
+++ b/xen/scripts/codestyle.py
@@ -0,0 +1,261 @@
+#!/usr/bin/env python3
+
+import glob
+import os
+import re
+import sys
+from xen_analysis.settings import xen_dir, repo_dir
+from xen_analysis import utils
+from xen_analysis import exclusion_file_list
+from xen_analysis.exclusion_file_list import ExclusionFileListError
+
+# The Xen codestyle states that labels needs to be indented by at least one
+# blank, but clang-format doesn't have an option for that and if it encounters
+# a label indented by blank characters that are less than its indent
+# configuration, it removes the indentation.
+# So this action is meant as post step and checks every label syntax match and
+# it adds one blank before the label
+def action_fix_label_indent(filename, file_lines):
+    label_rgx = re.compile('^[a-zA-Z_][a-zA-Z0-9_]*\s*:.*$')
+
+    for i in range(0, len(file_lines)):
+        if label_rgx.match(file_lines[i]):
+            file_lines[i] = ' ' + file_lines[i]
+
+    return file_lines
+
+
+# clang-format most of the time breaks the content of asm(...) instructions,
+# so with this function, we protect all the asm sections using the special
+# in code comments that tells clang-format to don't touch the block.
+# asm(...) instruction could be also inside macros, so in that case we protect
+# the entire macro that is enclosing the instruction, in the un-protect stage
+# however, we need to do clang-format's job at least on the tab-space conversion
+# and to put the backslash on the right side.
+def action_protect_asm(filename, file_lines, protect):
+    opening_asm = False
+    cf_off_comment = '/* clang-format off */'
+    cf_on_comment = '/* clang-format on */'
+    asm_stx = '(?:asm|__asm__)(?:\s(?:volatile|__volatile__))?'
+
+    if protect:
+        # Look for closing parenthesis with semicolon ');'
+        closing_asm_rgx_rule = '^.*\);.*$'
+        # Look for opening asm syntax
+        opening_asm_rgx_rule = f'^\s*{asm_stx}\s?\(.*$'
+        macro_start_rgx_rule = r'^\s?#\s?define.*\\$'
+        opening_asm_find = r'(asm|__asm__)'
+        opening_asm_replace = cf_off_comment + r'\1'
+        opening_def_find = r'#\s?define'
+        opening_def_replace = f'{cf_off_comment}#define'
+        closing_asm_find    = r'\);'
+        closing_asm_replace = ');' + cf_on_comment
+        closing_def_find    = '\n'
+        closing_def_replace = cf_on_comment + '\n'
+    else:
+        # Look for closing parenthesis with semicolon ');' and with the
+        # special clang-format comment
+        closing_asm_rgx_rule = f'^.*\);.*{re.escape(cf_on_comment)}.*$'
+        # Look for opening asm syntax preceded by the special clang-format
+        # comment, the comment is optional to generalise the algorithm to
+        # un-protect asm outside and inside macros. The case outside is easy
+        # because we will find '/* clang-format off */asm', instead the case
+        # inside is more tricky and we are going to find only 'asm' and then
+        # go backwards until we find '/* clang-format off */#define'
+        opening_asm_rgx_rule = \
+            f'^\s*({re.escape(cf_off_comment)})?{asm_stx}\s?\(.*$'
+        # Look for the define just before the asm invocation, here we look for
+        # '/* clang-format off */#define' or '#define', this is to handle a rare
+        # corner case where an asm invocation is inside a macro, but was not
+        # protected in the 'protect stage', because it was on the same line
+        # of the define and was not ending with backslash but it was exceeding
+        # line width so clang-format formatted anyway.
+        # It's safe because we won't change code that has no clang-format
+        # comments, but at least the tool won't complain
+        macro_start_rgx_rule = \
+            rf'^\s?(?:{re.escape(cf_off_comment)})?#\s?define.*\\$'
+        opening_asm_find = rf'({re.escape(cf_off_comment)}(asm|__asm__))'
+        opening_asm_replace = r'\2'
+        opening_def_find = rf'(?:{re.escape(cf_off_comment)})?#\s?define'
+        opening_def_replace = '#define'
+        closing_asm_find    = rf'\);.*{re.escape(cf_on_comment)}'
+        closing_asm_replace = ');'
+        closing_def_find    = cf_on_comment + '\n'
+        closing_def_replace = '\n'
+
+    opening_asm_rgx = re.compile(opening_asm_rgx_rule)
+    closing_asm_rgx = re.compile(closing_asm_rgx_rule)
+    macro_start_rgx = re.compile(macro_start_rgx_rule)
+
+    i = 0
+    i_max = len(file_lines)
+    macro_begin = -1
+    while i < i_max:
+        # Keep track of the last define we found
+        if macro_start_rgx.match(file_lines[i]):
+            macro_begin = i
+        # Try to find in the current line the asm syntax opening, but don't
+        # touch asm syntax inside macros that usually have the line ended by
+        # a backslash, this is because insert stuff in them will have issues
+        # when later clang-format will format the macro itself
+        if (not opening_asm) and opening_asm_rgx.match(file_lines[i]):
+            line_before = (i > 0) and file_lines[i-1].endswith('\\\n')
+            if file_lines[i].endswith('\\\n') or line_before:
+                # This should never happen, but if it does, it means an
+                # unexpected syntax is found in the file
+                if macro_begin < 0:
+                    raise Exception("Begin of macro not found in {}\n"
+                                    "The asm invocation is on line {}"
+                                    .format(filename, i))
+
+                # asm invocation inside macro, need to protect the entire macro,
+                # macro_begin should point to this define
+                file_lines[macro_begin] = re.sub(opening_def_find,
+                                                 opening_def_replace,
+                                                 file_lines[macro_begin])
+
+                # now go to the end of the macro, it's easy as the first line
+                # without a backslash will be the end
+                for j in range(i, len(file_lines)):
+                    if not file_lines[j].endswith('\\\n'):
+                        file_lines[j] = \
+                            file_lines[j].replace(closing_def_find,
+                                                  closing_def_replace, 1)
+                        # Advance i index, as j is the last line checked
+                        i = j
+                        break
+
+                # In the un-protect stage, we need to do clang-format's job,
+                # so convert tabs to 4 spaces and for macros put the backslash
+                # at the end of the line
+                if not protect:
+                    for j in range(macro_begin, i+1):
+                        # Tab replacement
+                        file_lines[j] = file_lines[j].replace('\t', '    ')
+                        # backslash indentation
+                        line_len = len(file_lines[j])
+                        # 81 counting also the newline character
+                        if file_lines[j].endswith('\\\n') and line_len < 81:
+                            spaces = ' ' * (81 - line_len)
+                            file_lines[j] = \
+                                file_lines[j].replace('\\\n', spaces + '\\\n',
+                                                      1)
+
+                macro_begin = -1
+            else:
+                # asm invocation is not inside a macro, protect the asm syntax
+                opening_asm = True
+                file_lines[i] = re.sub(opening_asm_find, opening_asm_replace,
+                                       file_lines[i])
+
+        # Try to find in the current line the asm closing syntax, only if a
+        # previous line already found an opening asm syntax
+        if opening_asm and closing_asm_rgx.match(file_lines[i]):
+            opening_asm = False
+            file_lines[i] = re.sub(closing_asm_find, closing_asm_replace,
+                                   file_lines[i])
+
+        i += 1
+
+    # This should never happen, but if it does, it means an unexpected syntax
+    # is found in the file
+    if opening_asm:
+        raise Exception("Unbalanced asm parenthesis in {}".format(filename))
+
+    return file_lines
+
+
+# This function runs a set of actions on the passed file name, the actions needs
+# to have a specific interface: action(filename, file_lines), filename will be
+# the name of the file where the script is working, file_lines will be the
+# content of the file expressed as an array of lines in string format.
+# The action function must return this array back to the caller and every
+# possible modifications done on that
+def stage(filename, actions):
+
+    if len(actions) == 0:
+        return
+
+    try:
+        with open(filename, "rt") as infile:
+            file_lines = infile.readlines()
+    except OSError as e:
+        raise Exception("Issue with reading file {}: {}".format(filename, e))
+
+    for task in actions:
+        file_lines = task(filename, file_lines)
+
+    try:
+        with open(filename, "wt") as outfile:
+            outfile.writelines(file_lines)
+    except OSError as e:
+        raise Exception("Issue writing file {}: {}".format(filename, e))
+
+
+def main(argv):
+    # Setup actions for pre-stage and post-stage
+    pre_stage_asm_protect = \
+        lambda file, file_lines: action_protect_asm(file, file_lines, True)
+    post_stage_asm_unprotect = \
+        lambda file, file_lines: action_protect_asm(file, file_lines, False)
+    pre_stage_actions = [pre_stage_asm_protect]
+    post_stage_actions = [post_stage_asm_unprotect, action_fix_label_indent]
+
+    len_args = len(argv)
+    if len_args > 0:
+        c_files = []
+        for i in range(0, len_args):
+            if not argv[i].startswith('/'):
+                # Assume a relative path to Xen
+                abs_path = os.getcwd() + "/" + argv[i]
+                check_path = [abs_path]
+                if '*' in abs_path:
+                    check_path = glob.glob(abs_path)
+                for path in check_path:
+                    if os.path.exists(path):
+                        c_files.append(path)
+                    else:
+                        raise Exception("Malformed path {} solved from {}"
+                                        .format(path, argv[i]))
+    else:
+        # Find all files with .c and .h extension
+        c_files = utils.recursive_find_file(xen_dir, r'.*\.(?:c|h)$')
+
+    try:
+        exclusion_file = \
+                "{}/docs/misra/exclude-list.json".format(repo_dir)
+        exclusion_list = \
+                exclusion_file_list.load_exclusion_file_list(exclusion_file)
+    except ExclusionFileListError as e:
+        print("ERROR: Issue with reading file {}: {}".format(exclusion_file, e))
+        sys.exit(1)
+
+    # Transform the lists of absolute path in the second element of the
+    # exclusion_list into a plain list of absolute path to be exluded
+    excluded_c_files = [j for i in exclusion_list for j in i[1]]
+
+    file_to_format = []
+    for file in c_files:
+        add_to_list = True
+        for excl in excluded_c_files:
+            if excl in file:
+                add_to_list = False
+                break
+        if add_to_list:
+            file_to_format.append(file)
+        elif len_args > 0:
+            print("ERROR: file {} is excluded!".format(file))
+            sys.exit(1)
+
+    for file in file_to_format:
+        try:
+            stage(file, pre_stage_actions)
+            utils.invoke_command("clang-format -i {}".format(file), False,
+                                 Exception, "Error occured invoking: {}\n")
+            stage(file, post_stage_actions)
+        except Exception as e:
+            print("ERROR: {}\n".format(e))
+
+
+if __name__ == "__main__":
+    main(sys.argv[1:])
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 08:12:06 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 08:12:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571373.895050 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPIZv-0004T1-Te; Fri, 28 Jul 2023 08:12:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571373.895050; Fri, 28 Jul 2023 08:12:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPIZv-0004Sq-PJ; Fri, 28 Jul 2023 08:12:03 +0000
Received: by outflank-mailman (input) for mailman id 571373;
 Fri, 28 Jul 2023 08:12:02 +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
 <SRS0=B1pf=DO=arm.com=luca.fancellu@srs-se1.protection.inumbo.net>)
 id 1qPIZu-0004AS-CL
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 08:12:02 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTP
 id 6d49fda0-2d1e-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 10:12:00 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E5AC81515;
 Fri, 28 Jul 2023 01:12:42 -0700 (PDT)
Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.1])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3960D3F67D;
 Fri, 28 Jul 2023 01:11:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6d49fda0-2d1e-11ee-8613-37d641c3527e
From: Luca Fancellu <luca.fancellu@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com,
	wei.chen@arm.com
Subject: [RFC PATCH 2/5] [WIP]cppcheck: rework exclusion_file_list.py code
Date: Fri, 28 Jul 2023 09:11:41 +0100
Message-Id: <20230728081144.4124309-3-luca.fancellu@arm.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230728081144.4124309-1-luca.fancellu@arm.com>
References: <20230728081144.4124309-1-luca.fancellu@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rework the exclusion_file_list.py code to have the function
load_exclusion_file_list() detached from the xen-analysis.py tool,
in a way so that other modules can use the function.
The xen-analysis tool and in particular its module cppcheck_analysis.py
will use a new function cppcheck_exclusion_file_list().

No functional changes are intended.

TBD: Read the field in each entry and act accordingly.

Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/scripts/xen_analysis/cppcheck_analysis.py |  6 ++--
 .../xen_analysis/exclusion_file_list.py       | 31 ++++++++++---------
 2 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/xen/scripts/xen_analysis/cppcheck_analysis.py b/xen/scripts/xen_analysis/cppcheck_analysis.py
index 8dc45e653b79..e54848aa5339 100644
--- a/xen/scripts/xen_analysis/cppcheck_analysis.py
+++ b/xen/scripts/xen_analysis/cppcheck_analysis.py
@@ -2,7 +2,8 @@
 
 import os, re, shutil
 from . import settings, utils, cppcheck_report_utils, exclusion_file_list
-from .exclusion_file_list import ExclusionFileListError
+from .exclusion_file_list import (ExclusionFileListError,
+                                  cppcheck_exclusion_file_list)
 
 class GetMakeVarsPhaseError(Exception):
     pass
@@ -54,8 +55,7 @@ def __generate_suppression_list(out_file):
             try:
                 exclusion_file = \
                     "{}/docs/misra/exclude-list.json".format(settings.repo_dir)
-                exclusion_list = \
-                    exclusion_file_list.load_exclusion_file_list(exclusion_file)
+                exclusion_list = cppcheck_exclusion_file_list(exclusion_file)
             except ExclusionFileListError as e:
                 raise CppcheckDepsPhaseError(
                     "Issue with reading file {}: {}".format(exclusion_file, e)
diff --git a/xen/scripts/xen_analysis/exclusion_file_list.py b/xen/scripts/xen_analysis/exclusion_file_list.py
index 871e480586bb..79ebd34f55ec 100644
--- a/xen/scripts/xen_analysis/exclusion_file_list.py
+++ b/xen/scripts/xen_analysis/exclusion_file_list.py
@@ -7,16 +7,24 @@ class ExclusionFileListError(Exception):
     pass
 
 
-def __cppcheck_path_exclude_syntax(path):
-    # Prepending * to the relative path to match every path where the Xen
-    # codebase could be
-    path = "*" + path
+def cppcheck_exclusion_file_list(input_file):
+    ret = []
+    excl_list = load_exclusion_file_list(input_file)
+
+    for entry in excl_list:
+        # Prepending * to the relative path to match every path where the Xen
+        # codebase could be
+        ret.append("*" + entry[0])
 
-    return path
+    return ret
 
 
-# Reads the exclusion file list and returns a list of relative path to be
-# excluded.
+# Reads the exclusion file list and returns an array containing a set where the
+# first entry is what was listed in the exclusion list file, and the second
+# entry is the absolute path of the first entry.
+# If the first entry contained a wildcard '*', the second entry will have an
+# array of the solved absolute path for that entry.
+# Returns [('path',[path,path,...]), ('path',[path,path,...]), ...]
 def load_exclusion_file_list(input_file):
     ret = []
     try:
@@ -58,13 +66,6 @@ def load_exclusion_file_list(input_file):
                     .format(path, filepath_object)
                 )
 
-        if settings.analysis_tool == "cppcheck":
-            path = __cppcheck_path_exclude_syntax(path)
-        else:
-            raise ExclusionFileListError(
-                "Unimplemented for {}!".format(settings.analysis_tool)
-            )
-
-        ret.append(path)
+        ret.append((path, check_path))
 
     return ret
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 08:12:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 08:12:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571371.895035 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPIZu-0004Ag-Ct; Fri, 28 Jul 2023 08:12:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571371.895035; Fri, 28 Jul 2023 08:12:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPIZu-0004AZ-9y; Fri, 28 Jul 2023 08:12:02 +0000
Received: by outflank-mailman (input) for mailman id 571371;
 Fri, 28 Jul 2023 08:12:01 +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
 <SRS0=B1pf=DO=arm.com=luca.fancellu@srs-se1.protection.inumbo.net>)
 id 1qPIZt-0004AS-5k
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 08:12:01 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTP
 id 6bd0ea61-2d1e-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 10:11:58 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 779CD2F4;
 Fri, 28 Jul 2023 01:12:40 -0700 (PDT)
Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.1])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E3C0D3F67D;
 Fri, 28 Jul 2023 01:11:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6bd0ea61-2d1e-11ee-8613-37d641c3527e
From: Luca Fancellu <luca.fancellu@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com,
	wei.chen@arm.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [RFC PATCH 0/5] clang-format for Xen
Date: Fri, 28 Jul 2023 09:11:39 +0100
Message-Id: <20230728081144.4124309-1-luca.fancellu@arm.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

## Introduction ################################################################

In this serie, I would like to get feedbacks on the output generated by the
configuration of clang-format, unfortunately we can't use only clang-format, but
we need to call it using a wrapper, because we need the information of what
files need to be excluded from the tool.

Another reason is that clang-format has some limitation when formatting asm()
instruction and most of the time it format them in a very ugly way or it breaks
the code for example removing spaces that were there for a reason (I don't think
it's a tool to format asm), so in the wrapper script we protect all asm()
invocation or macros where there are asm() invocation with in-code comments that
stops clang-format to act on that section:

/* clang-format off */section/* clang-format on */

I've read the past threads about the brave people who dared to try to introduce
clang-format for the xen codebase, some of them from 5 years ago, two points
were clear: 1) goto label needs to be indented and 2) do-while loops have the
braket in the same line.
While point 1) was quite a blocker, it seemd to me that point 2) was less
controversial to be changed in the Xen codestyle, so the current wrapper script
handles only the point 1 (which is easy), the point 2 can be more tricky to
handle.

## The clang-format configuration ##############################################

In my clang-format configuration I've taken inspiration from EPAM's work, then
from the configuration in Linux and finally from the clang-format manual, to try
to produce a comprehensive configuration.

Every configuration parameter has on top a comment with the description and
when it was supported, finally I've added also a [not specified] if that
behavior is not clearly specified in the Xen coding style, I've done that so
we could discuss about adding more specification in our CODING_STYLE.
Every comment can be stripped out in the final release of the file, but I think
that now they are useful for the discussion.

The minimum clang-format version for the file is 15, my ubuntu 22.04 comes with
it, we can reason if it's too high, or if we could also use the latest version
maybe shipped inside a docker image.

For every [not specified] behavior, I've tried to guess it from the codebase,
I've seen that also in that case it's not easy as there is (sometimes) low
consistency between modules, so we can discuss on every configurable.

Worth to mention, the public header are all excluded from the format tool,
because formatting them breaks the build on X86, because there are scripts for
auto-generation that don't handle the formatted headers, I didn't investigate
on it, maybe it can be added as technical debt.

So I've tried building arm32, arm64 and x86_64 with the formatted output and
they build, I've used Yocto for that.

## How to try it? ##############################################################

So how to generate everything? Just invoke the codestyle.py script without
parameter and it will format every .c and .h file in the hypervisor codebase.

./xen/scripts/codestyle.py

Optionally you can also pass one or more relative path from the folder you are
invoking the script and it will format only them.

## What I expect from this RFC #################################################

I expect feedback on the output, some agreement on what configuration to use,
and I expect to find possible blocker before working seriously on this serie,
because if there are outstanding blockers on the adoption of the tool and we
can't reach an agreement, I won't spend further time on it.

I understand that the release is coming soon and some people are on holiday in
this period, so worst case I will ping again after the release.

Luca Fancellu (5):
  [WIP]misra: add entries to the excluded list
  [WIP]cppcheck: rework exclusion_file_list.py code
  [WIP]xen/scripts: add codestyle.py script
  x86/HVM: protect mm_type_tbl format from clang-format
  xen: Add clang-format configuration

 docs/misra/exclude-list.json                  |  88 +++
 xen/.clang-format                             | 693 ++++++++++++++++++
 xen/arch/x86/hvm/mtrr.c                       |   2 +
 xen/scripts/codestyle.py                      | 261 +++++++
 xen/scripts/xen_analysis/cppcheck_analysis.py |   6 +-
 .../xen_analysis/exclusion_file_list.py       |  31 +-
 6 files changed, 1063 insertions(+), 18 deletions(-)
 create mode 100644 xen/.clang-format
 create mode 100755 xen/scripts/codestyle.py

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 08:12:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 08:12:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571375.895070 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPIZx-00051t-OV; Fri, 28 Jul 2023 08:12:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571375.895070; Fri, 28 Jul 2023 08:12:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPIZx-00050C-JJ; Fri, 28 Jul 2023 08:12:05 +0000
Received: by outflank-mailman (input) for mailman id 571375;
 Fri, 28 Jul 2023 08:12:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=B1pf=DO=arm.com=luca.fancellu@srs-se1.protection.inumbo.net>)
 id 1qPIZw-0004AY-1R
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 08:12:04 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTP
 id 6f271b89-2d1e-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 10:12:03 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F36AF2F4;
 Fri, 28 Jul 2023 01:12:45 -0700 (PDT)
Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.1])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C4D073F67D;
 Fri, 28 Jul 2023 01:12:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6f271b89-2d1e-11ee-b24d-6b7b168915f2
From: Luca Fancellu <luca.fancellu@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com,
	wei.chen@arm.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [RFC PATCH 4/5] x86/HVM: protect mm_type_tbl format from clang-format
Date: Fri, 28 Jul 2023 09:11:43 +0100
Message-Id: <20230728081144.4124309-5-luca.fancellu@arm.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230728081144.4124309-1-luca.fancellu@arm.com>
References: <20230728081144.4124309-1-luca.fancellu@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The array mm_type_tbl initialization is formatted in a way that
clang-format can't keep, so disable clang-format on that array
initialization.

Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/arch/x86/hvm/mtrr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c
index 29f3fb160776..f32ce3162ae2 100644
--- a/xen/arch/x86/hvm/mtrr.c
+++ b/xen/arch/x86/hvm/mtrr.c
@@ -18,6 +18,7 @@
 /* Get page attribute fields (PAn) from PAT MSR. */
 #define pat_cr_2_paf(pat_cr,n)  ((((uint64_t)pat_cr) >> ((n)<<3)) & 0xff)
 
+/* clang-format off */
 /* Effective mm type lookup table, according to MTRR and PAT. */
 static const uint8_t mm_type_tbl[MTRR_NUM_TYPES][X86_NUM_MT] = {
 #define RS MEMORY_NUM_TYPES
@@ -43,6 +44,7 @@ static const uint8_t mm_type_tbl[MTRR_NUM_TYPES][X86_NUM_MT] = {
 #undef WB
 #undef RS
 };
+/* clang-format on */
 
 /*
  * Reverse lookup table, to find a pat type according to MTRR and effective
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 08:12:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 08:12:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571376.895085 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPIa0-0005VN-WC; Fri, 28 Jul 2023 08:12:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571376.895085; Fri, 28 Jul 2023 08:12:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPIa0-0005VC-Sg; Fri, 28 Jul 2023 08:12:08 +0000
Received: by outflank-mailman (input) for mailman id 571376;
 Fri, 28 Jul 2023 08:12:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=B1pf=DO=arm.com=luca.fancellu@srs-se1.protection.inumbo.net>)
 id 1qPIZy-0004AY-Vw
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 08:12:07 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTP
 id 7041c0f2-2d1e-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 10:12:05 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AEB71D75;
 Fri, 28 Jul 2023 01:12:47 -0700 (PDT)
Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.1])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 261613F67D;
 Fri, 28 Jul 2023 01:12:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7041c0f2-2d1e-11ee-b24d-6b7b168915f2
From: Luca Fancellu <luca.fancellu@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com,
	wei.chen@arm.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [RFC PATCH 5/5] xen: Add clang-format configuration
Date: Fri, 28 Jul 2023 09:11:44 +0100
Message-Id: <20230728081144.4124309-6-luca.fancellu@arm.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230728081144.4124309-1-luca.fancellu@arm.com>
References: <20230728081144.4124309-1-luca.fancellu@arm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Add a clang format configuration for the Xen Hypervisor.

Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/.clang-format | 693 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 693 insertions(+)
 create mode 100644 xen/.clang-format

diff --git a/xen/.clang-format b/xen/.clang-format
new file mode 100644
index 000000000000..ccc85a6b854a
--- /dev/null
+++ b/xen/.clang-format
@@ -0,0 +1,693 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# clang-format configuration file. Intended for clang-format >= 15.
+#
+# For more information, see:
+#
+#   Documentation/process/clang-format.rst
+#   https://clang.llvm.org/docs/ClangFormat.html
+#   https://clang.llvm.org/docs/ClangFormatStyleOptions.html
+#
+---
+
+# [not specified]
+# Align function parameter that goes into a new line, under the open bracket
+# (supported in clang-format 3.8)
+AlignAfterOpenBracket: Align
+
+# [not specified]
+# Align array of struct's elements by column and justify
+# struct test demo[] =
+# {
+#     {56, 23,    "hello"},
+#     {-1, 93463, "world"},
+#     {7,  5,     "!!"   }
+# };
+# (supported in clang-format 13)
+AlignArrayOfStructures: Left
+
+# [not specified]
+# Align consecutive assignments (supported in clang-format 3.8)
+AlignConsecutiveAssignments:
+  Enabled: true
+  AcrossEmptyLines: true
+  AcrossComments: false
+
+# [not specified]
+# Do not align consecutive bit fields (supported in clang-format 11)
+AlignConsecutiveBitFields: None
+
+# [not specified]
+# Do not align values of consecutive declarations
+# (supported in clang-format 3.8)
+AlignConsecutiveDeclarations: None
+
+# [not specified]
+# Align values of consecutive macros (supported in clang-format 9)
+AlignConsecutiveMacros:
+  Enabled: true
+  AcrossEmptyLines: true
+  AcrossComments: true
+
+# [not specified]
+# Align escaped newlines to the right (supported in clang-format 5)
+AlignEscapedNewlines: Right
+
+# [not specified]
+# Aligns operands of a single expression that needs to be split over multiple
+# lines (supported in clang-format 3.5)
+AlignOperands: Align
+
+# Do not align trailing consecutive comments (It helps to make clang-format
+# reproduce the same output when it runs on an already formatted file)
+# (supported in clang-format 3.7)
+AlignTrailingComments: false
+
+# [not specified]
+# Do not put all function call arguments on a new line, try to have at least
+# the first one close to the opening parenthesis (supported in clang-format 9)
+AllowAllArgumentsOnNextLine: false
+
+# [not specified]
+# Do not put all function declaration parameters on a new line, try to have at
+# least the first one close to the opening parenthesis
+# (supported in clang-format 3.3)
+AllowAllParametersOfDeclarationOnNextLine: false
+
+# Bracing condition needs to be respected even if the line is so short that the
+# final block brace can stay on a single line
+# (supported in clang-format 3.5)
+AllowShortBlocksOnASingleLine: Never
+
+# (supported in clang-format 3.6)
+AllowShortCaseLabelsOnASingleLine: false
+
+# (supported in clang-format 3.5)
+AllowShortFunctionsOnASingleLine: None
+
+# (supported in clang-format 3.3)
+AllowShortIfStatementsOnASingleLine: Never
+
+# (supported in clang-format 3.7)
+AllowShortLoopsOnASingleLine: false
+
+# [not specified]
+# Do not add a break after the definition return type
+# (supported in clang-format 3.8)
+AlwaysBreakAfterReturnType: None
+
+# [not specified]
+# There is no need to use a break after an assigment to a multiline string
+# (supported in clang-format 3.4)
+AlwaysBreakBeforeMultilineStrings: false
+
+# (supported in clang-format 3.4)
+AlwaysBreakTemplateDeclarations: false
+
+# Specify Xen's macro attributes (supported in clang-format 12)
+AttributeMacros:
+  - '__init'
+  - '__exit'
+  - '__initdata'
+  - '__initconst'
+  - '__initconstrel'
+  - '__initdata_cf_clobber'
+  - '__initconst_cf_clobber'
+  - '__hwdom_init'
+  - '__hwdom_initdata'
+  - '__maybe_unused'
+  - '__packed'
+  - '__stdcall'
+  - '__vfp_aligned'
+  - '__alt_call_maybe_initdata'
+  - '__cacheline_aligned'
+  - '__ro_after_init'
+  - 'always_inline'
+  - 'noinline'
+  - 'noreturn'
+  - '__weak'
+  - '__inline__'
+  - '__attribute_const__'
+  - '__transparent__'
+  - '__used'
+  - '__must_check'
+  - '__kprobes'
+
+# [not specified]
+# Try always to pack function call arguments on the same line before breaking
+# (supported in clang-format 3.7)
+BinPackArguments: true
+
+# [not specified]
+# Try always to pack function declaration parameters on the same line before
+# breaking (supported in clang-format 3.7)
+BinPackParameters: true
+
+# [not specified]
+# Do not add a spaces on bitfield 'unsigned bf:2;'
+# (supported in clang-format 12)
+BitFieldColonSpacing: None
+
+# Xen's coding style does not follow clang-format already available profiles for
+# breaking before braces, so set it to Custom and specify each case separately
+# (supported in clang-format 3.8)
+BraceWrapping:
+  # Braces ('{' and '}') are usually placed on a line of their own
+  AfterCaseLabel: true
+  AfterFunction: true
+  BeforeElse: true
+  AfterExternBlock: true
+  # except for the opening brace in definitions of enum, struct, and union
+  AfterEnum: false
+  AfterStruct: false
+  AfterUnion: false
+  # This is unlike the Linux coding style and unlike K&R.
+  #
+  # if ( condition )
+  # {
+  #     /* Do stuff. */
+  # }
+  # else
+  # {
+  #     /* Other stuff. */
+  # }
+  #
+  # while ( condition )
+  # {
+  #     /* Do stuff. */
+  # }
+  #
+  # [non-compliant]
+  # do-while is not compliant with CODING_STYLE because clang format doesn't
+  # support different styles for every control statement
+  # do
+  # {
+  #     /* Do stuff. */
+  # } while ( condition );
+  AfterControlStatement: Always
+  BeforeWhile: false
+  IndentBraces: false
+  # [not specified]
+  # Keep empty functions with braces style like this: 'void func() {}' instead
+  # of breaking the braces
+  SplitEmptyFunction: false
+  # Not related to C language, but specified for completeness
+  AfterClass: false
+  AfterNamespace: false
+  AfterObjCDeclaration: false
+  BeforeCatch: false
+  BeforeLambdaBody: false
+  SplitEmptyRecord: true
+  SplitEmptyNamespace: true
+
+# [not specified]
+# Break only after the operator in case of a long expression
+# (supported in clang-format 3.6)
+BreakBeforeBinaryOperators: None
+
+# Xen's coding style does not follow clang-format already available profiles for
+# breaking before braces, so set it to Custom and specify each case separately
+# (supported in clang-format 3.7)
+BreakBeforeBraces: Custom
+
+# [not specified]
+# Break before inline ASM colon if the line length is longer than column limit.
+# (This is a new feature upstreamed by EPAM during its work on clang-format for
+# Xen)
+# (supported in clang-format 16)
+# BreakBeforeInlineASMColon: OnlyMultiline
+
+# [not specified]
+# Ternary operators '?, :' can be put after a line break
+# (supported in clang-format 3.7)
+BreakBeforeTernaryOperators: true
+
+# (supported in clang-format 5)
+BreakConstructorInitializers: BeforeComma
+
+# User visible strings (e.g., printk() messages) should not be split so they can
+# be searched for more easily. (supported in clang-format 3.9)
+BreakStringLiterals: false
+
+# Lines should be less than 80 characters in length
+# (supported in clang-format 3.7)
+ColumnLimit: 80
+
+# (supported in clang-format 3.7)
+CommentPragmas: '^ IWYU pragma:'
+
+# Code within blocks is indented by one extra indent level
+# (supported in clang-format 3.7)
+ContinuationIndentWidth: 4
+
+# Do not derive pointer alignment style from the file
+# (supported in clang-format 3.7)
+DerivePointerAlignment: false
+
+# Taken from:
+# git grep -h -i '^#define [^[:space:]]*for_each[^[:space:]]*(' xen/ \
+# | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$,  - '\1',i" \
+# | LC_ALL=C sort -u
+# A vector of macros that should be interpreted as foreach loops instead of as
+# function calls.
+# (supported in clang-format 3.7)
+ForEachMacros:
+  - 'FOR_EACH_IOREQ_SERVER'
+  - '__list_for_each_rcu'
+  - 'dt_for_each_child_node'
+  - 'dt_for_each_device_node'
+  - 'dt_for_each_property_node'
+  - 'ebitmap_for_each_positive_bit'
+  - 'expr_list_for_each_sym'
+  - 'fdt_for_each_property_offset'
+  - 'fdt_for_each_subnode'
+  - 'for_each_affinity_balance_step'
+  - 'for_each_amd_iommu'
+  - 'for_each_cfg_sme'
+  - 'for_each_cpu'
+  - 'for_each_domain'
+  - 'for_each_domain_in_cpupool'
+  - 'for_each_drhd_unit'
+  - 'for_each_kimage_entry'
+  - 'for_each_node_mask'
+  - 'for_each_online_cpu'
+  - 'for_each_online_node'
+  - 'for_each_pdev'
+  - 'for_each_possible_cpu'
+  - 'for_each_present_cpu'
+  - 'for_each_rmrr_device'
+  - 'for_each_sched_unit'
+  - 'for_each_sched_unit_vcpu'
+  - 'for_each_set_bit'
+  - 'for_each_vcpu'
+  - 'for_each_vp'
+  - 'hlist_for_each'
+  - 'hlist_for_each_entry'
+  - 'hlist_for_each_entry_continue'
+  - 'hlist_for_each_entry_from'
+  - 'hlist_for_each_entry_rcu'
+  - 'hlist_for_each_entry_safe'
+  - 'hlist_for_each_safe'
+  - 'list_for_each'
+  - 'list_for_each_backwards_safe'
+  - 'list_for_each_continue_rcu'
+  - 'list_for_each_entry'
+  - 'list_for_each_entry_continue'
+  - 'list_for_each_entry_from'
+  - 'list_for_each_entry_rcu'
+  - 'list_for_each_entry_reverse'
+  - 'list_for_each_entry_safe'
+  - 'list_for_each_entry_safe_continue'
+  - 'list_for_each_entry_safe_from'
+  - 'list_for_each_entry_safe_reverse'
+  - 'list_for_each_prev'
+  - 'list_for_each_rcu'
+  - 'list_for_each_safe'
+  - 'list_for_each_safe_rcu'
+  - 'page_list_for_each'
+  - 'page_list_for_each_safe'
+  - 'page_list_for_each_safe_reverse'
+
+# A vector of macros that should be interpreted as conditionals instead of as
+# function calls. (supported in clang-format 13)
+#IfMacros:
+#  - ''
+
+# Sort include files by block of includes and not as only one group
+# (supported in clang-format 6)
+IncludeBlocks: Preserve
+
+# [not specified]
+# Regular expressions denoting the different #include categories used for
+# ordering #includes. (supported in clang-format 3.8)
+#IncludeCategories:
+#  - Regex: '.*'
+#    Priority: 1
+
+# When guessing whether a #include is the â€œmainâ€ include (to assign category 0,
+# see above), use this regex of allowed suffixes to the header stem. A partial
+# match is done, so that: - â€œâ€ means â€œarbitrary suffixâ€ - â€œ$â€ means â€œno suffixâ€
+# For example, if configured to â€œ(_test)?$â€, then a header a.h would be seen as
+# the â€œmainâ€ include in both a.cc and a_test.cc.
+# (Do we have a main include in Xen?)
+# (supported in clang-format 3.9)
+#IncludeIsMainRegex: '(Test)?$'
+
+# Non-case labels inside switch() bodies are preferred to be indented the same
+# as the block's case labels (supported in clang-format 11)
+IndentCaseBlocks: false
+
+# [not specified]
+# Do not indent case labels in the switch block (supported in clang-format 3.3)
+IndentCaseLabels: false
+
+# [not specified]
+# Do not indent extern "C" block
+# (supported in clang-format 11)
+IndentExternBlock: NoIndent
+
+# Due to the behavior of GNU diffutils "diff -p", labels should be indented by
+# at least one blank (supported in clang-format 10)
+IndentGotoLabels: true
+
+# [not specified]
+# Do not create indentation for the preprocessor directives
+# (supported in clang-format 6)
+IndentPPDirectives: None
+
+# An indent level consists of four spaces (supported in clang-format 3.7)
+IndentWidth: 4
+
+# [not specified]
+# In case a function definition or declaration needs to be wrapped after the
+# type, do not indent the new line (supported in clang-format 3.7)
+IndentWrappedFunctionNames: false
+
+# Braces should be omitted for blocks with a single statement. e.g.,
+# if ( condition )
+#     single_statement();
+# (supported in clang-format 15)
+InsertBraces: false
+
+# [not specified]
+# Every file needs to end with a new line
+# (supported in clang-format 16)
+# InsertNewlineAtEOF: true
+
+# [not specified]
+# Keep empty lines (up to MaxEmptyLinesToKeep) at end of file
+# (supported in clang-format 17)
+# KeepEmptyLinesAtEOF: true
+
+# [not specified]
+# Do not add a new empty line at the start of the block
+# (supported in clang-format 3.7)
+KeepEmptyLinesAtTheStartOfBlocks: false
+
+# The Xen Hypervisor is written in C language (supported in clang-format 3.5)
+Language: Cpp
+
+# [not specified]
+# Line ending style is '\n' (supported in clang-format 16)
+# LineEnding: LF
+
+# Specify Xen's macro that starts a block of code
+# (supported in clang-format 3.7)
+MacroBlockBegin: '^PLATFORM_START|^DT_DEVICE_START|^ACPI_DEVICE_START'
+
+# Specify Xen's macro that ends a block of code (supported in clang-format 3.7)
+MacroBlockEnd: '^PLATFORM_END|^DT_DEVICE_END|^ACPI_DEVICE_END'
+
+# [not specified]
+# Maximum consecutive empty lines allowed (supported in clang-format 3.7)
+MaxEmptyLinesToKeep: 1
+
+# Parameters to tweak to discourage clang-format to break something
+# (supported in clang-format 5)
+PenaltyBreakAssignment: 10
+# (supported in clang-format 3.7)
+PenaltyBreakBeforeFirstCallParameter: 30
+# (supported in clang-format 3.7)
+PenaltyBreakComment: 10
+# (supported in clang-format 3.7)
+PenaltyBreakFirstLessLess: 0
+# (supported in clang-format 14)
+PenaltyBreakOpenParenthesis: 100
+# (supported in clang-format 3.7)
+PenaltyBreakString: 10
+# (supported in clang-format 3.7)
+PenaltyExcessCharacter: 100
+# (supported in clang-format 12)
+PenaltyIndentedWhitespace: 0
+# (supported in clang-format 3.7)
+PenaltyReturnTypeOnItsOwnLine: 60
+
+# [not specified]
+# Pointer alignment style is on the right 'void *var'
+# (supported in clang-format 3.7)
+PointerAlignment: Right
+
+# [not specified]
+# The number of columns to use for indentation of preprocessor statements
+# When set to -1 (default) IndentWidth is used also for preprocessor statements.
+# (supported in clang-format 13)
+PPIndentWidth: -1
+
+# [not specified]
+# (supported in clang-format 14)
+QualifierAlignment: Custom
+
+# Specify in which order the qualifiers should appear 'static const int *var'
+# (supported in clang-format 14)
+QualifierOrder: ['static', 'inline', 'const', 'volatile', 'type']
+
+# Don't try to reflow comments to respect the column limit (It helps to make
+# clang-format reproduce the same output when it runs on an already formatted
+# file)
+# (supported in clang-format 3.8)
+ReflowComments: false
+
+# [not specified]
+# Specifies the use of empty lines to separate definition blocks, including
+# structs, enums, and functions
+# (supported in clang-format 14)
+SeparateDefinitionBlocks: Always
+
+# [not specified]
+# Sort the include files by name (supported in clang-format 3.8)
+# TODO: enabling this will currently break the compilation, maybe fix?
+SortIncludes: Never
+
+# [not specified]
+# Do not allow a space after a type cast '(type)var'
+# (supported in clang-format 3.5)
+SpaceAfterCStyleCast: false
+
+# [not specified]
+# Do not allow a space after the not operator '!var'
+# (supported in clang-format 9)
+SpaceAfterLogicalNot: false
+
+# Ensure that there is a space after pointer qualifiers, when used with
+# PointerAlignment of value Right it means 'void *const *x = NULL;'
+# (supported in clang-format 12)
+SpaceAroundPointerQualifiers: After
+
+# [not specified]
+# Always have a space after an assign operator or a compound operator, for
+# example '+=' (supported in clang-format 3.7)
+SpaceBeforeAssignmentOperators: true
+
+# [not specified]
+# Do not allow a space between the case argument and the final colon 'case 0:'
+# (supported in clang-format 12)
+SpaceBeforeCaseColon: false
+
+# [not specified]
+# Have a space before the parenthesis of a control statement, do an exception
+# for ForEach and If macros
+SpaceBeforeParens: ControlStatementsExceptForEachMacros
+
+# (supported in clang-format 7)
+SpaceBeforeRangeBasedForLoopColon: true
+
+# [not specified]
+# Do not add a spaces before square brackets 'int a[5];'
+# (supported in clang-format 10)
+SpaceBeforeSquareBrackets: false
+
+# [not specified]
+# Do not add a space inside empty parenthesis '()'
+# (supported in clang-format 3.7)
+SpaceInEmptyParentheses: false
+
+# (supported in clang-format 3.7)
+SpacesBeforeTrailingComments: 1
+
+# Space characters are used to spread out logical statements, such as in the
+# condition of an if or while 'if ( a )' 'while ( i < 5 )'
+# (supported in clang-format 10)
+SpacesInConditionalStatement: true
+
+# (supported in clang-format 3.7)
+SpacesInContainerLiterals: false
+
+# [not specified]
+# Do not add a spaces inside a type cast parenthesis '(int)var'
+# (supported in clang-format 3.7)
+SpacesInCStyleCastParentheses: false
+
+# [not specified]
+# Do not insert spaces in empty block '{}'
+# (supported in clang-format 3.5)
+SpaceInEmptyBlock: false
+
+# Only one space is allowed at the start of a line comment
+# (supported in clang-format 13)
+SpacesInLineCommentPrefix:
+  Minimum: 1
+  Maximum: -1
+
+# [not specified]
+# Do not add a spaces inside parenthesis '(var & var)'
+# (supported in clang-format 3.7)
+SpacesInParentheses: false
+
+# [not specified]
+# Do not add spaces inside square brakets 'int a[5];'
+# (supported in clang-format 3.7)
+SpacesInSquareBrackets: false
+
+# (supported in clang-format 3.7)
+Standard: C++03
+
+# Macros which are ignored in front of a statement, as if they were an
+# attribute. So that they are not parsed as identifier
+# (supported in clang-format 12)
+# StatementAttributeLikeMacros: ['']
+
+# A vector of macros that should be interpreted as complete statements.
+# Typical macros are expressions, and require a semi-colon to be added;
+# sometimes this is not the case, and this allows to make clang-format aware of
+# such cases. (supported in clang-format 8)
+StatementMacros:
+  - 'PROGRESS'
+  - 'PROGRESS_VCPU'
+  - 'bitop'
+  - 'guest_bitop'
+  - 'testop'
+  - 'guest_testop'
+  - 'DEFINE_XEN_GUEST_HANDLE'
+  - '__DEFINE_XEN_GUEST_HANDLE'
+  - '___DEFINE_XEN_GUEST_HANDLE'
+  - 'presmp_initcall'
+  - '__initcall'
+  - '__exitcall'
+
+# An indent level consists of four spaces (supported in clang-format 3.7)
+TabWidth: 4
+
+# A vector of macros that should be interpreted as type declarations instead of
+# as function calls (supported in clang-format 9)
+TypenameMacros:
+  - 'XEN_GUEST_HANDLE'
+  - 'XEN_GUEST_HANDLE_64'
+  - 'XEN_GUEST_HANDLE_PARAM'
+  - 'ELF_HANDLE_DECL'
+
+# Indentation is done using spaces, not tabs (supported in clang-format 3.7)
+UseTab: Never
+
+# A vector of macros which are whitespace-sensitive and should not be touched
+# (supported in clang-format 11)
+WhitespaceSensitiveMacros:
+  - '__stringify'
+
+## Not related to C language ###################################################
+
+# (supported in clang-format 3.3)
+AccessModifierOffset: -4
+
+# (supported in clang-format 9)
+AllowShortLambdasOnASingleLine: None
+
+# (supported in clang-format 16)
+# BreakAfterAttributes: Never
+
+# (supported in clang-format 3.8)
+BreakAfterJavaFieldAnnotations: false
+
+# (supported in clang-format 16)
+# BreakArrays: false
+
+# (supported in clang-format 12)
+BreakBeforeConceptDeclarations: Never
+
+# (supported in clang-format 7)
+BreakInheritanceList: BeforeColon
+
+# (supported in clang-format 5)
+CompactNamespaces: false
+
+# (supported in clang-format 3.7)
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+
+# (supported in clang-format 3.7)
+ConstructorInitializerIndentWidth: 4
+
+# (supported in clang-format 3.4)
+Cpp11BracedListStyle: false
+
+# (supported in clang-format 13)
+EmptyLineAfterAccessModifier: Leave
+
+# (supported in clang-format 12)
+EmptyLineBeforeAccessModifier: Leave
+
+# (supported in clang-format 5)
+FixNamespaceComments: false
+
+# (supported in clang-format 13)
+IndentAccessModifiers: false
+
+# (supported in clang-format 15)
+IndentRequiresClause: false
+
+# (supported in clang-format 11)
+InsertTrailingCommas: None
+
+# (supported in clang-format 3.9)
+JavaScriptQuotes: Leave
+
+# (supported in clang-format 3.9)
+JavaScriptWrapImports: true
+
+# (supported in clang-format 3.7)
+NamespaceIndentation: None
+
+# (supported in clang-format 7)
+ObjCBinPackProtocolList: Auto
+
+# (supported in clang-format 3.7)
+ObjCBlockIndentWidth: 4
+
+# (supported in clang-format 11)
+ObjCBreakBeforeNestedBlockParam: false
+
+# (supported in clang-format 3.7)
+ObjCSpaceAfterProperty: true
+
+# (supported in clang-format 3.7)
+ObjCSpaceBeforeProtocolList: true
+
+# (supported in clang-format 14)
+PackConstructorInitializers: Never
+
+# (supported in clang-format 7)
+PenaltyBreakTemplateDeclaration: 0
+
+# (supported in clang-format 13)
+ReferenceAlignment: Right
+
+# (supported in clang-format 16)
+# RemoveSemicolon: false
+
+# (supported in clang-format 5)
+SortUsingDeclarations: false
+
+# (supported in clang-format 4)
+SpaceAfterTemplateKeyword: true
+
+# (supported in clang-format 7)
+SpaceBeforeCpp11BracedList: false
+
+# (supported in clang-format 7)
+SpaceBeforeCtorInitializerColon: true
+
+# (supported in clang-format 7)
+SpaceBeforeInheritanceColon: true
+
+# (supported in clang-format 3.4)
+SpacesInAngles: false
+
+...
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 08:13:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 08:13:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571390.895095 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPIbP-0007MP-Ax; Fri, 28 Jul 2023 08:13:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571390.895095; Fri, 28 Jul 2023 08:13:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPIbP-0007MI-7z; Fri, 28 Jul 2023 08:13:35 +0000
Received: by outflank-mailman (input) for mailman id 571390;
 Fri, 28 Jul 2023 08:13:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=OGDP=DO=corigine.com=simon.horman@srs-se1.protection.inumbo.net>)
 id 1qPIbN-0007Ji-1N
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 08:13:33 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on20700.outbound.protection.outlook.com
 [2a01:111:f400:7eae::700])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a3427921-2d1e-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 10:13:31 +0200 (CEST)
Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6)
 by SJ0PR13MB5269.namprd13.prod.outlook.com (2603:10b6:a03:3e1::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Fri, 28 Jul
 2023 08:13:25 +0000
Received: from PH0PR13MB4842.namprd13.prod.outlook.com
 ([fe80::fde7:9821:f2d9:101d]) by PH0PR13MB4842.namprd13.prod.outlook.com
 ([fe80::fde7:9821:f2d9:101d%7]) with mapi id 15.20.6631.026; Fri, 28 Jul 2023
 08:13:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a3427921-2d1e-11ee-b24d-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Fu7do9vqFCgFsADyZ82hNoY/UZLzKuhqMcOnUosc7CU1gRARx52ZsmX/k3jQqqfWApVRnBmUWRhAjuU7NmXABoUauEcu+4BsFWL+iQvWctsSSd3J+OEl1nuojXV5LqlwQAV4O6Aa5FX6RS4QMHq9VxdUVQf3CIB3Lf+dyRKu2d6M6EqS2PnnmZOCYOXwHbqBewL1o/bOMaDqYjze38jxmFhs/Iv+br8SfT+8RW8ik5NSR8vaP81ZQYcdY76GopywsKtifA+tCByL5Om2pzeazLJ3uYUIjt8/7ob+IWLXdba180/f4usweAh8S07h9TWD5tHXBCqcmjq5lBKUTlV0hw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yGPNEOQFiqYcBK63/Om9x23uvQtVmgPahFvNarchGnw=;
 b=bxOPErCsni0aI6FEntZiPQijAIZDy0MW/IxPv639d8y+dZggkTNWOyuFAO/9SE+UgdXasAOUI3wVhzoH+CfaRJmbUIFqJoyEp9Ec5EP+Ir4UV9u4lZPJYEk9+IPq0p73BQdCtzT9xPvZQzKBaCZlGR3snCZTKSywAEhwAMI82788Emd6bxTcZGrPNH2SHdPb+Dy204vWYszNsqa4acgNtWNqodXyDEw0y7myqVcOxLuUrUTT8tRFt3FWyIgK8HDGppCS6jE0eN7Yc4E+jmEmxhvNTLrtTDOkbhwL/D9jHujspqJpRHY4R5d2byBVhKMu4+i1d28V1eeoN8H1OIizYg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com;
 dkim=pass header.d=corigine.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yGPNEOQFiqYcBK63/Om9x23uvQtVmgPahFvNarchGnw=;
 b=m3prTWSXX6KZUhayrV91IRjMJI7ZwF62Kyc+RHKQ5wKJ5j5qAOm8WKXmDTLOzJZexS3MUHCg9Gn6vzAl1zOiXhoEipR2XxPt79A2JuBf25BGhqZ1DaFob4yfuccZFIJJgpycnIR7kUl05XAEhKT1pLB12AmPPln4yziKR08YR+A=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=corigine.com;
Date: Fri, 28 Jul 2023 10:13:14 +0200
From: Simon Horman <simon.horman@corigine.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru,
	vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org,
	brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu,
	steven.price@arm.com, cel@kernel.org, senozhatsky@chromium.org,
	yujie.liu@intel.com, gregkh@linuxfoundation.org,
	muchun.song@linux.dev, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, x86@kernel.org, kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org, linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org, linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org, netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com, linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
	Muchun Song <songmuchun@bytedance.com>
Subject: Re: [PATCH v3 04/49] mm: shrinker: remove redundant shrinker_rwsem
 in debugfs operations
Message-ID: <ZMN4mjsF1QEsvW7D@corigine.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
 <20230727080502.77895-5-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20230727080502.77895-5-zhengqi.arch@bytedance.com>
X-ClientProxiedBy: AM0PR02CA0114.eurprd02.prod.outlook.com
 (2603:10a6:20b:28c::11) To PH0PR13MB4842.namprd13.prod.outlook.com
 (2603:10b6:510:78::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|SJ0PR13MB5269:EE_
X-MS-Office365-Filtering-Correlation-Id: 8611e466-4b59-4307-f46d-08db8f4283c5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	pwW465vo9hI5eC/8Ntm80OiPZIBHfs3VML+30ACZ6q1gKIiw07bi63fgQFFRLxhjeMOvYXvKDQCbhdJXvkJtuvlV+CXofrjYF/nUT4dPDX7q3opgHQdml0n1/4JWskU89OGJAciXmkpGNxgq9ry3pQOnhUiBe/rX017qs0avdKvOdhPtlbR+VQVKZn19geR1qa1unKg72RhRR53/MXIMsfQLudax4C3TSjl+Giz2dgx40XXbX34DzfbwIhH5bpBtGAGLaj3zSQAl3qvuVXHTkg909IcoX6oZGllYm2+Eps+5dhGhNgPCU1/7AU4O5pm4wOrjGhtYfZoZ9N02ekDRjKTQ4lquadIeum0uy/WYwMrctBR3EpkOJHSBHPG5+OYlhSGKYRuhxcaOuJyq9NPyXaRtIwoJbm2SQ2E3gbw5UzfYNh4+Zsdlyyf2fqz/nfuTulgnbDZUN06bw3dCKQlgorH/+ohWbaa1SQLbJzCxvKZOx/MJCh1pBm/F2VBIa/so2tKi49EA+ktn349EbCy+bMhrGONwPCzwf2MNJSruQNMUKPHUtE6Ber7adMWlIhvkRQnideoRjxmflS1kiPiAMuBzpM3AyXXbMb1u0RgXupI=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39840400004)(136003)(376002)(346002)(366004)(451199021)(316002)(6486002)(6666004)(6512007)(38100700002)(66946007)(66476007)(66556008)(4326008)(6916009)(478600001)(83380400001)(44832011)(2616005)(36756003)(2906002)(86362001)(41300700001)(6506007)(186003)(7416002)(7406005)(8676002)(8936002)(5660300002);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?EwJcBo/2mvzDAcZlwWvTX9INa/Cd4/lFcnamw+5KB2J69OYpKA3aGp5Wd/XF?=
 =?us-ascii?Q?Vjt1Q6FMtfkPT96kdcb4hxokRaLTkBreJ1T36jkKBbExivpNKSZ6veIvC/M4?=
 =?us-ascii?Q?jrCBhciqYx3+6CIDSXOzrvyFcFGYL2Yoe1VQGDJ7NdDD5l0XwHG+93LniBR0?=
 =?us-ascii?Q?AC3/KSBGGJTCJ06zamH3IV6dDULUlTJhzm/pIZUJ/EWtK7yxw+go6gb+7bsb?=
 =?us-ascii?Q?GNmIfq+OCxbfIvLSus5tHnhiHP5OesDtsNHLDznFWUW/G/Lmo/+J1OFJzmoH?=
 =?us-ascii?Q?RITysfiVBMj55kz7cS+ZPLvGIfm8kdkhOghNhMN3NBBLtXwtGwJo5omwrNVG?=
 =?us-ascii?Q?J1vTaUl7LcWFEq2X1SOaK8K4/6Ia3JWLxWKLRxy3Ww4uBVp7+2i/SZa9mFbj?=
 =?us-ascii?Q?frtZCGrY28gP1W0cOaS0pH73V5HmSCYk5c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kXOaCDs4v/ZPvu2BS?=
 =?us-ascii?Q?yItjrzpQ7Wv/V/T0mShaQr35yWensUSLg8kwArBLTM+1TpeUjQvlRTRa2QEM?=
 =?us-ascii?Q?eBhHGQssV3+tngbS/tmYBR8K+ByZIKYtpZzqEUrHnOGBWuMmBorzNjocuLAI?=
 =?us-ascii?Q?0pmuEP2b4mk3PLcri7AeHoHgZmpbghkq4M/UOwzgrfPl8rOdOFcanX9cAkZ6?=
 =?us-ascii?Q?9QPpEusH9TeQH4ecp7Cjadc8dwuN5sJzzuVBs840pTrx8rCTXZtCWFBrdxH1?=
 =?us-ascii?Q?GQ8aV1bM3szxVEZWi1L9tiLEBSSbrR18uuwppQLJFRySYRV8eMAQc/EPvB84?=
 =?us-ascii?Q?YOmbXUzPIyQOL7toNCW5V83Ij8+QcxN+t1bzFJsRVsd7LA7EUFd9DTAbDPkv?=
 =?us-ascii?Q?1A2tGA=3D=3D?=
X-OriginatorOrg: corigine.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8611e466-4b59-4307-f46d-08db8f4283c5
X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2023 08:13:24.7088
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ZO18g4iU6cCBfbXbdk05XK2h3U98gv1o0RvG8C19b61bZGM6zcodErQeQen1aIioiwU32nm1ls4To/v/MA7i5mi21rgU93wTSzMKCF+aMJ4=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR13MB5269

On Thu, Jul 27, 2023 at 04:04:17PM +0800, Qi Zheng wrote:
> The debugfs_remove_recursive() will wait for debugfs_file_put() to return,
> so the shrinker will not be freed when doing debugfs operations (such as
> shrinker_debugfs_count_show() and shrinker_debugfs_scan_write()), so there
> is no need to hold shrinker_rwsem during debugfs operations.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> Reviewed-by: Muchun Song <songmuchun@bytedance.com>
> ---
>  mm/shrinker_debug.c | 14 --------------
>  1 file changed, 14 deletions(-)
> 
> diff --git a/mm/shrinker_debug.c b/mm/shrinker_debug.c
> index 3ab53fad8876..f1becfd45853 100644
> --- a/mm/shrinker_debug.c
> +++ b/mm/shrinker_debug.c
> @@ -55,11 +55,6 @@ static int shrinker_debugfs_count_show(struct seq_file *m, void *v)
>  	if (!count_per_node)
>  		return -ENOMEM;
>  
> -	ret = down_read_killable(&shrinker_rwsem);
> -	if (ret) {
> -		kfree(count_per_node);
> -		return ret;
> -	}
>  	rcu_read_lock();

Hi Qi Zheng,

As can be seen in the next hunk, this function returns 'ret'.
However, with this change 'ret' is uninitialised unless
signal_pending() returns non-zero in the while loop below.

This is flagged in a clan-16 W=1 build.

 mm/shrinker_debug.c:87:11: warning: variable 'ret' is used uninitialized whenever 'do' loop exits because its condition is false [-Wsometimes-uninitialized]
         } while ((memcg = mem_cgroup_iter(NULL, memcg, NULL)) != NULL);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 mm/shrinker_debug.c:92:9: note: uninitialized use occurs here
         return ret;
                ^~~
 mm/shrinker_debug.c:87:11: note: remove the condition if it is always true
         } while ((memcg = mem_cgroup_iter(NULL, memcg, NULL)) != NULL);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  1
 mm/shrinker_debug.c:77:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
                 if (!memcg_aware) {
                     ^~~~~~~~~~~~
 mm/shrinker_debug.c:92:9: note: uninitialized use occurs here
         return ret;
                ^~~
 mm/shrinker_debug.c:77:3: note: remove the 'if' if its condition is always false
                 if (!memcg_aware) {
                 ^~~~~~~~~~~~~~~~~~~
 mm/shrinker_debug.c:52:9: note: initialize the variable 'ret' to silence this warning
         int ret, nid;
                ^
                 = 0

>  
>  	memcg_aware = shrinker->flags & SHRINKER_MEMCG_AWARE;
> @@ -92,7 +87,6 @@ static int shrinker_debugfs_count_show(struct seq_file *m, void *v)
>  	} while ((memcg = mem_cgroup_iter(NULL, memcg, NULL)) != NULL);
>  
>  	rcu_read_unlock();
> -	up_read(&shrinker_rwsem);
>  
>  	kfree(count_per_node);
>  	return ret;

...


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 08:19:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 08:19:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571393.895105 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPIgy-0008ER-3n; Fri, 28 Jul 2023 08:19:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571393.895105; Fri, 28 Jul 2023 08:19:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPIgy-0008EK-1E; Fri, 28 Jul 2023 08:19:20 +0000
Received: by outflank-mailman (input) for mailman id 571393;
 Fri, 28 Jul 2023 08:19:19 +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
 <SRS0=D0ra=DO=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qPIgx-0008Dt-4u
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 08:19:19 +0000
Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com
 [2607:f8b0:4864:20::434])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 70e485af-2d1f-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 10:19:16 +0200 (CEST)
Received: by mail-pf1-x434.google.com with SMTP id
 d2e1a72fcca58-6748a616e17so437603b3a.1
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 01:19:16 -0700 (PDT)
Received: from [10.70.252.135] ([203.208.167.147])
 by smtp.gmail.com with ESMTPSA id
 j63-20020a638b42000000b005637030d00csm2862658pge.30.2023.07.28.01.19.03
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 28 Jul 2023 01:19:14 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 70e485af-2d1f-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690532355; x=1691137155;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=0Vz5i3f1KwBqEHtOj3kkD+u+idA4hMEDLOXYQ/Zmb7I=;
        b=L2+elQ31DoTndDMbULUpYhAiCoRfDRGWwRsLhePlw7WW3kXFI6RoGNteAO7MNCCxPK
         FYWrT0NCxgniYdOvtk354oC7lAaEYLaI5+6nbBgCsJS7Z9F7PQNW+ZUGwlLgRq4XIWCd
         IlyzJlPUeNX37jF32KJvYLJePzYsZ7ze/fbSuG8EqYw256JXY3KCKzS1wluS9KcnHJgS
         wVJn5VLovDZDoJav6s/8z2Nev3fZMa4BKzS6r7L/dPmXUhh82k37p3M1JnHGLMc145hK
         MLBcl9i8u/Uj6MSDKzSJ+fdKEdHQ4PpsFlNhyTOhfKom9VA3y6JlxMc/+2lHqKKi6hTK
         U83g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690532355; x=1691137155;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=0Vz5i3f1KwBqEHtOj3kkD+u+idA4hMEDLOXYQ/Zmb7I=;
        b=PlHRGQWyWMgEgnBFNs2kxR7frgwyOghwEC8PAXitPjubTXWvqIaOdrETLUut62Rlme
         K9Njo6ae69/ehnWksX4ZpGVYfdQ5NgRjN5vmHWcONENjGfFDaFPr5WhkC/EkoXsHkKM3
         97LnG+sjFLbBEMaznAFzvm7PavjvgFC8VDGdpoI4AhW4fMl4yz8E2jZdSufH7FiUpfqw
         Imsyv6zvlbdlZcUzwVLCZ/xIY+DvqRc/Db8I13AvWk1bLr9xTy4gTxhmpMXoXtaGJgS5
         4xhKJk1VsDibIF00SmjyDWLrU6DfDeugjn2/d7S/HmUZTacFEu/3dMF831T/6iW1SXFh
         BQYw==
X-Gm-Message-State: ABy/qLYjS+OvqbB7xg5dfDCT9dNUqdv4rNUtaSY+4isyAR+xIb5QFf+o
	qIpYPy5Tc40Aaxgj/yteqrGKkg==
X-Google-Smtp-Source: APBJJlFUUUMvBrf6ibd1LKjgOpEN2XEkSNdXdEqaA3c50PeJDSflhjqiMTE27IMY1LDD8QpZTvY8yg==
X-Received: by 2002:a05:6a21:329f:b0:134:76d6:7f7 with SMTP id yt31-20020a056a21329f00b0013476d607f7mr2068612pzb.4.1690532355159;
        Fri, 28 Jul 2023 01:19:15 -0700 (PDT)
Message-ID: <99d0958d-8446-6fe9-a0fb-f562cb04c7c8@bytedance.com>
Date: Fri, 28 Jul 2023 16:19:01 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 04/49] mm: shrinker: remove redundant shrinker_rwsem in
 debugfs operations
Content-Language: en-US
To: Simon Horman <simon.horman@corigine.com>
Cc: akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru,
 vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org,
 brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com,
 cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com,
 gregkh@linuxfoundation.org, muchun.song@linux.dev,
 linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
 Muchun Song <songmuchun@bytedance.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
 <20230727080502.77895-5-zhengqi.arch@bytedance.com>
 <ZMN4mjsF1QEsvW7D@corigine.com>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <ZMN4mjsF1QEsvW7D@corigine.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Simon,

On 2023/7/28 16:13, Simon Horman wrote:
> On Thu, Jul 27, 2023 at 04:04:17PM +0800, Qi Zheng wrote:
>> The debugfs_remove_recursive() will wait for debugfs_file_put() to return,
>> so the shrinker will not be freed when doing debugfs operations (such as
>> shrinker_debugfs_count_show() and shrinker_debugfs_scan_write()), so there
>> is no need to hold shrinker_rwsem during debugfs operations.
>>
>> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
>> Reviewed-by: Muchun Song <songmuchun@bytedance.com>
>> ---
>>   mm/shrinker_debug.c | 14 --------------
>>   1 file changed, 14 deletions(-)
>>
>> diff --git a/mm/shrinker_debug.c b/mm/shrinker_debug.c
>> index 3ab53fad8876..f1becfd45853 100644
>> --- a/mm/shrinker_debug.c
>> +++ b/mm/shrinker_debug.c
>> @@ -55,11 +55,6 @@ static int shrinker_debugfs_count_show(struct seq_file *m, void *v)
>>   	if (!count_per_node)
>>   		return -ENOMEM;
>>   
>> -	ret = down_read_killable(&shrinker_rwsem);
>> -	if (ret) {
>> -		kfree(count_per_node);
>> -		return ret;
>> -	}
>>   	rcu_read_lock();
> 
> Hi Qi Zheng,
> 
> As can be seen in the next hunk, this function returns 'ret'.
> However, with this change 'ret' is uninitialised unless
> signal_pending() returns non-zero in the while loop below.

Thanks for your feedback, the 'ret' should be initialized to 0,
will fix it.

Thanks,
Qi

> 
> This is flagged in a clan-16 W=1 build.
> 
>   mm/shrinker_debug.c:87:11: warning: variable 'ret' is used uninitialized whenever 'do' loop exits because its condition is false [-Wsometimes-uninitialized]
>           } while ((memcg = mem_cgroup_iter(NULL, memcg, NULL)) != NULL);
>                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   mm/shrinker_debug.c:92:9: note: uninitialized use occurs here
>           return ret;
>                  ^~~
>   mm/shrinker_debug.c:87:11: note: remove the condition if it is always true
>           } while ((memcg = mem_cgroup_iter(NULL, memcg, NULL)) != NULL);
>                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>                    1
>   mm/shrinker_debug.c:77:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
>                   if (!memcg_aware) {
>                       ^~~~~~~~~~~~
>   mm/shrinker_debug.c:92:9: note: uninitialized use occurs here
>           return ret;
>                  ^~~
>   mm/shrinker_debug.c:77:3: note: remove the 'if' if its condition is always false
>                   if (!memcg_aware) {
>                   ^~~~~~~~~~~~~~~~~~~
>   mm/shrinker_debug.c:52:9: note: initialize the variable 'ret' to silence this warning
>           int ret, nid;
>                  ^
>                   = 0
> 
>>   
>>   	memcg_aware = shrinker->flags & SHRINKER_MEMCG_AWARE;
>> @@ -92,7 +87,6 @@ static int shrinker_debugfs_count_show(struct seq_file *m, void *v)
>>   	} while ((memcg = mem_cgroup_iter(NULL, memcg, NULL)) != NULL);
>>   
>>   	rcu_read_unlock();
>> -	up_read(&shrinker_rwsem);
>>   
>>   	kfree(count_per_node);
>>   	return ret;
> 
> ...


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 08:59:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 08:59:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571395.895114 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPJK2-0004J8-41; Fri, 28 Jul 2023 08:59:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571395.895114; Fri, 28 Jul 2023 08:59:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPJK2-0004J1-1N; Fri, 28 Jul 2023 08:59:42 +0000
Received: by outflank-mailman (input) for mailman id 571395;
 Fri, 28 Jul 2023 08:59:40 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qPJK0-0004Iv-Ia
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 08:59:40 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPJJy-00081v-CC; Fri, 28 Jul 2023 08:59:38 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPJJy-0006hI-3h; Fri, 28 Jul 2023 08:59:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=KwfFLqj9L7gUIV1iKqjrLTQMHrhjTK6yI7PHSe5pwH0=; b=6O+WJ+IC7/H2FoIp+3Q3zq3/dW
	4T7GtI4sVa/zD2jCSGO4ex15ph2hVcp+DMfOPU7Ke9a6zzCIN/Y22RrRDui7LKHZngON5bRhETkpc
	YCZb7c7V8xeBWwNH7nW80jNsSUwIaVwJzdaLchM/P7a+k4iqD/U0efChaEiUnShqnmNo=;
Message-ID: <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
Date: Fri, 28 Jul 2023 09:59:36 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
Content-Language: en-GB
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Juergen,

On 28/07/2023 07:23, Juergen Gross wrote:
> On 27.07.23 23:53, Julien Grall wrote:
>> Hi Juergen,
>>
>> On 24/07/2023 12:02, Juergen Gross wrote:
>>> Struct xs_tdb_record_hdr is used for nodes stored in the data base.
>>> When working on a node, struct node is being used, which is including
>>> the same information as struct xs_tdb_record_hdr, but in a different
>>> format. Rework struct xs_tdb_record_hdr in order to prepare including
>>> it in struct node.
>>>
>>> Do the following modifications:
>>>
>>> - move its definition to xenstored_core.h, as the reason to put it into
>>> Â Â  utils.h are no longer existing
>>>
>>> - rename it to struct node_hdr, as the "tdb" in its name has only
>>> Â Â  historical reasons
>>>
>>> - replace the empty permission array at the end with a comment about
>>> Â Â  the layout of data in the data base (concatenation of header,
>>> Â Â  permissions, node contents, and children list)
>>>
>>> - use narrower types for num_perms and datalen, as those are naturally
>>> Â Â  limited to XENSTORE_PAYLOAD_MAX (childlen is different here, as it is
>>> Â Â  in theory basically unlimited)
>>
>> The assumption is XENSTORE_PAYLOAD_MAX will never change and/or always 
>> apply for all the connection. I am aware of at least one downstream 
>> use where this is not the case.
>>
>> I am happy to use narrower types, but I would at least like some 
>> checks in Xenstore to ensure the limits are not reached.
> 
> I will add a BUILD_BUG_ON().

Initially I was thinking about a runtime check, but I am also fine with 
a BUILD_BUG_ON() if it is right next to length check in handle_input(). 
So if someone decided to add different payload size depending on the 
domain (such as privileged domain could do more), it would be easier to 
spot what else needs to be changed.

>> OOI, do you have a use case where a node would be shared with more 
>> than 255 domains?
> 
> No, but limiting it wouldn't give any real advantage.

I guess by advantage you mean that the size of the structure would still 
be the same. I thought this was the rationale but I asked just in case 
you had something else in mind. For instance, Xen technically supports 
up to ~32 000 domains. But I think it would be crazy to decide to have 
more than a few tens permissions on a node :).

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 09:05:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 09:05:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571398.895125 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPJPm-0005nL-Qy; Fri, 28 Jul 2023 09:05:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571398.895125; Fri, 28 Jul 2023 09:05:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPJPm-0005nE-N8; Fri, 28 Jul 2023 09:05:38 +0000
Received: by outflank-mailman (input) for mailman id 571398;
 Fri, 28 Jul 2023 09:05:37 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qPJPl-0005n8-MF
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 09:05:37 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPJPl-0008AK-CX; Fri, 28 Jul 2023 09:05:37 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPJPl-00078H-6j; Fri, 28 Jul 2023 09:05:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=0T+6Sm4suejPd4WB7MugA13bV8goCwDaCafWOBMQoWQ=; b=0Z1Qth5jwV5CqHuNnvFfbz3/dm
	PE/SmXPrDQ84GYNGORrvMFVJRBLHeUpwDjFxeHlYCAo4Phh1Mpp79Yjfz7CKSPpTFXx4ZFELAAkJH
	ltxsBoOaJd/18/wNkguy98G7QVjwqK+teOU2clUzIvYtjRPU5QxLuOAqpmKW/MkLxyJY=;
Message-ID: <cf80a7f3-758f-6a49-1353-44303bad0e7f@xen.org>
Date: Fri, 28 Jul 2023 10:05:35 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/5] arm/mm: Document the differences between arm32 and
 arm64 directmaps
Content-Language: en-GB
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
 <20230728075903.7838-2-alejandro.vallejo@cloud.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230728075903.7838-2-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Alex,

On 28/07/2023 08:58, Alejandro Vallejo wrote:
> arm32 merely covers the XENHEAP, whereas arm64 currently covers anything in
> the frame table. These comments highlight why arm32 doesn't need to account for PDX
> compression in its __va() implementation while arm64 does.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>

Reviewed-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 09:07:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 09:07:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571401.895135 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPJRj-0006OB-4n; Fri, 28 Jul 2023 09:07:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571401.895135; Fri, 28 Jul 2023 09:07:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPJRj-0006O2-1s; Fri, 28 Jul 2023 09:07:39 +0000
Received: by outflank-mailman (input) for mailman id 571401;
 Fri, 28 Jul 2023 09:07:37 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qPJRh-0006Nu-4d
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 09:07:37 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPJRg-0008CE-7x; Fri, 28 Jul 2023 09:07:36 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPJRg-0007H9-1h; Fri, 28 Jul 2023 09:07:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=25Ahi/xujDYfHb01cTd/+AObw1hgYcILribsO2S/pxo=; b=J+xkjicjSwnMMZvd0TVdDbIPY3
	Jxd+9i2ZybM6QjjlchaxHLsgbV+w98zI5RyB6C0ieCZDNPPjTMZciBslMtgBd1G993bKWtOLi5/x9
	n1aaIez5q60mtS85geooHwxslt/5YWJjxsP6zOMatUAvpGGEZLMZXc++s2Qu5cAtQwCk=;
Message-ID: <dc3ebea3-64bb-2463-0524-bf7a1c2792b0@xen.org>
Date: Fri, 28 Jul 2023 10:07:34 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/5] mm: Factor out the pdx compression logic in ma/va
 converters
Content-Language: en-GB
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
 <20230728075903.7838-3-alejandro.vallejo@cloud.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230728075903.7838-3-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 28/07/2023 08:59, Alejandro Vallejo wrote:
> This patch factors out the pdx compression logic hardcoded in both ports
> for the maddr<->vaddr conversion functions.
> 
> Touches both x86 and arm ports.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>

Reviewed-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 09:14:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 09:14:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571404.895145 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPJY1-0007pq-QE; Fri, 28 Jul 2023 09:14:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571404.895145; Fri, 28 Jul 2023 09:14:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPJY1-0007pj-NB; Fri, 28 Jul 2023 09:14:09 +0000
Received: by outflank-mailman (input) for mailman id 571404;
 Fri, 28 Jul 2023 09:14:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Gg45=DO=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qPJXz-0007pa-S5
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 09:14:07 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1a34101e-2d27-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 11:14:06 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id E885A1F8AB;
 Fri, 28 Jul 2023 09:14:05 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C3AC3133F7;
 Fri, 28 Jul 2023 09:14:05 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id /4PsLd2Gw2SbAgAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 28 Jul 2023 09:14:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1a34101e-2d27-11ee-b24d-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690535645; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=dynrXdPOybJ8vPvETPaBxnwQPadMvLY3UhbY+3rbcZY=;
	b=OAQ8bicK1bi6+6FSuFVzSzzuHVeTZ2fNcTp4X2IOtvz/IGWE3Sdy0rDWzJcuEmvaLv3SHe
	FsCpV9ici5RpKQWaSbdq0sqgFYYlyk8i484gEVfjZ2UXZLSioj3iOfTiFZq3Erw6ZHIk2x
	d+Wt2tDdapWASMo/u2/svHKq7pt8wBk=
Message-ID: <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
Date: Fri, 28 Jul 2023 11:14:05 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
In-Reply-To: <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------RDf00EGpAcPjS0WvMTA3CrDp"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------RDf00EGpAcPjS0WvMTA3CrDp
Content-Type: multipart/mixed; boundary="------------GuqO5dN1Ye0P1OfZ4LkLc3Pv";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
In-Reply-To: <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>

--------------GuqO5dN1Ye0P1OfZ4LkLc3Pv
Content-Type: multipart/mixed; boundary="------------vU27p10zeRQAOUYSZ9MAvHJo"

--------------vU27p10zeRQAOUYSZ9MAvHJo
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjguMDcuMjMgMTA6NTksIEp1bGllbiBHcmFs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PSSwg
ZG8geW91IGhhdmUgYSB1c2UgY2FzZSB3aGVyZSBhIG5vZGUgd291bGQgYmUgc2hhcmVkIHdp
dGggbW9yZSB0aGFuIDI1NSANCj4+PiBkb21haW5zPw0KPj4NCj4+IE5vLCBidXQgbGltaXRp
bmcgaXQgd291bGRuJ3QgZ2l2ZSBhbnkgcmVhbCBhZHZhbnRhZ2UuDQo+IA0KPiBJIGd1ZXNz
IGJ5IGFkdmFudGFnZSB5b3UgbWVhbiB0aGF0IHRoZSBzaXplIG9mIHRoZSBzdHJ1Y3R1cmUg
d291bGQgc3RpbGwgYmUgdGhlIA0KPiBzYW1lLiBJIHRob3VnaHQgdGhpcyB3YXMgdGhlIHJh
dGlvbmFsZSBidXQgSSBhc2tlZCBqdXN0IGluIGNhc2UgeW91IGhhZCANCj4gc29tZXRoaW5n
IGVsc2UgaW4gbWluZC4gRm9yIGluc3RhbmNlLCBYZW4gdGVjaG5pY2FsbHkgc3VwcG9ydHMg
dXAgdG8gfjMyIDAwMCANCj4gZG9tYWlucy4gQnV0IEkgdGhpbmsgaXQgd291bGQgYmUgY3Jh
enkgdG8gZGVjaWRlIHRvIGhhdmUgbW9yZSB0aGFuIGEgZmV3IHRlbnMgDQo+IHBlcm1pc3Np
b25zIG9uIGEgbm9kZSA6KS4NCg0KWWVzIHRvIGJvdGguIE9UT0ggd2h5IHNob3VsZCB3ZSBk
ZW55IHRvIGFsbG93IHRoYXQgd2l0aG91dCBhbnkgdXJnZW50IG5lZWQgdG8gZG8NCnNvPw0K
DQoNCkp1ZXJnZW4NCg==
--------------vU27p10zeRQAOUYSZ9MAvHJo
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+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QB4iFQLhJCdP1I5aSgM5IVFdn7v5YgEYuJYx37Io
N1EblHI//x/e2AaIHpzK5h88NEawQsaNRpNSrcfbFmAg987ATQRTjHAWAQgAyzH6
AOODMBjgfWE9VeCgsrwH3exNAU32gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------vU27p10zeRQAOUYSZ9MAvHJo--

--------------GuqO5dN1Ye0P1OfZ4LkLc3Pv--

--------------RDf00EGpAcPjS0WvMTA3CrDp
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmTDht0FAwAAAAAACgkQsN6d1ii/Ey8P
2Af9GTDQrvaS+2fZfHnn5zb4IfGYpW7/PlJwb5ftS4md5E8lMmu4XUH6Mq9BdkdPue3wd6hDMc4k
Bby3jHMimtQtnsi/aQYZuiJaDwoNtUfaMPHA8xmpdhz2sahjMgRJ01F4EYvZeq3d4dKe0Hk1euIo
hCXYec0pMrxssxNkTcLEgCojtXZk5ndbQsky41RuIfjvMlEqOYmI2h/Qmyts1VPQpw/Q0aS9C6bS
/aSvSfNmx2jz5+41Qi6VAJaBhTnwTct1Q60j7AZTUzhvAK7hdsd+x6658lw01Ohsg9wNH0+gsHPT
Kcizpn9axy7vKtLxWq5Wxy08LBqzdMeYswC8mIJIfw==
=Ntfe
-----END PGP SIGNATURE-----

--------------RDf00EGpAcPjS0WvMTA3CrDp--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 09:38:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 09:38:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571407.895155 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPJvE-00024q-Oi; Fri, 28 Jul 2023 09:38:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571407.895155; Fri, 28 Jul 2023 09:38:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPJvE-00024j-Lj; Fri, 28 Jul 2023 09:38:08 +0000
Received: by outflank-mailman (input) for mailman id 571407;
 Fri, 28 Jul 2023 09:38:08 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qPJvE-00024d-2n
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 09:38:08 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPJvC-0000Pp-HP; Fri, 28 Jul 2023 09:38:06 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPJvC-00007b-BJ; Fri, 28 Jul 2023 09:38:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=+980A7+N+XFZHXI1jhl4MMS+tRacKtGCEpilRWASUxs=; b=wvhVTU1sVcYoiha+y5A+tKmL+y
	hV6aWqtRXwU+BIfI/MlvvAgSYLymKBj0qbseRpmkuptLPtBrI49beamnuJFyHrbOc+SR4upjcGK2F
	S1143fAVJCs9W6qMPrvFdF8S+tDZnfNjZFkHW0IRjfQZbknWmkORdoG86KdOSwaBgOu4=;
Message-ID: <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
Date: Fri, 28 Jul 2023 10:38:04 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
Content-Language: en-GB
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
 <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Juergen,

On 28/07/2023 10:14, Juergen Gross wrote:
> On 28.07.23 10:59, Julien Grall wrote:
>> Hi Juergen,
>>
>> On 28/07/2023 07:23, Juergen Gross wrote:
>>> On 27.07.23 23:53, Julien Grall wrote:
>>>> Hi Juergen,
>>>>
>>>> On 24/07/2023 12:02, Juergen Gross wrote:
>>>>> Struct xs_tdb_record_hdr is used for nodes stored in the data base.
>>>>> When working on a node, struct node is being used, which is including
>>>>> the same information as struct xs_tdb_record_hdr, but in a different
>>>>> format. Rework struct xs_tdb_record_hdr in order to prepare including
>>>>> it in struct node.
>>>>>
>>>>> Do the following modifications:
>>>>>
>>>>> - move its definition to xenstored_core.h, as the reason to put it 
>>>>> into
>>>>> Â Â  utils.h are no longer existing
>>>>>
>>>>> - rename it to struct node_hdr, as the "tdb" in its name has only
>>>>> Â Â  historical reasons
>>>>>
>>>>> - replace the empty permission array at the end with a comment about
>>>>> Â Â  the layout of data in the data base (concatenation of header,
>>>>> Â Â  permissions, node contents, and children list)
>>>>>
>>>>> - use narrower types for num_perms and datalen, as those are naturally
>>>>> Â Â  limited to XENSTORE_PAYLOAD_MAX (childlen is different here, as 
>>>>> it is
>>>>> Â Â  in theory basically unlimited)
>>>>
>>>> The assumption is XENSTORE_PAYLOAD_MAX will never change and/or 
>>>> always apply for all the connection. I am aware of at least one 
>>>> downstream use where this is not the case.
>>>>
>>>> I am happy to use narrower types, but I would at least like some 
>>>> checks in Xenstore to ensure the limits are not reached.
>>>
>>> I will add a BUILD_BUG_ON().
>>
>> Initially I was thinking about a runtime check, but I am also fine 
>> with a BUILD_BUG_ON() if it is right next to length check in 
>> handle_input(). So if someone decided to add different payload size 
>> depending on the domain (such as privileged domain could do more), it 
>> would be easier to spot what else needs to be changed.
> 
> Is this really the correct placement?

I think so. By adding the BUILD_ON_BUG() right above the length check, 
it would be easier for everyone to know that the datastructure may also 
need to change. This ...

> 
> I've put it into write_node_raw(), as this is where the related datalen 
> member
> is being filled. 

... would be less obvious here and I think it might be miss.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 09:45:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 09:45:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571409.895165 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPK2A-0003aN-ER; Fri, 28 Jul 2023 09:45:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571409.895165; Fri, 28 Jul 2023 09:45:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPK2A-0003aG-Bh; Fri, 28 Jul 2023 09:45:18 +0000
Received: by outflank-mailman (input) for mailman id 571409;
 Fri, 28 Jul 2023 09:45:17 +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 <SRS0=Gg45=DO=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qPK29-0003aA-OG
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 09:45:17 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 73f7eecb-2d2b-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 11:45:15 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 63D7E1F37E;
 Fri, 28 Jul 2023 09:45:14 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3A3BE13276;
 Fri, 28 Jul 2023 09:45:14 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id zdKUDCqOw2TeEgAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 28 Jul 2023 09:45:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 73f7eecb-2d2b-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690537514; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=Uqp8N/7Hbf4okyPjjTbAGLxWbp2gkk8P51kIwaB2kx0=;
	b=DDUu7HAJznwhggZb+XZ6+MGO69r8/12X9kX+TRU8KuCyqtM9mqtRonkE+QXd91Vj6fOHKg
	jdIIOGC+lmXIT/Z2TfyUVRBbbsJcOECwRPAytRgDY0pxc+Q07yZVVnUTT/dF2Zd3D8UhjA
	V/L/DmIF5U8OnJOVUszE3icQftMRi8U=
Message-ID: <68acbf84-218b-f2f7-9526-d9e07f845f6e@suse.com>
Date: Fri, 28 Jul 2023 11:45:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
 <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
 <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
In-Reply-To: <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------17mDiwR607KvbstlMoAZuT9X"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------17mDiwR607KvbstlMoAZuT9X
Content-Type: multipart/mixed; boundary="------------03H3vGqobeBh7DdhUEBzaRcJ";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <68acbf84-218b-f2f7-9526-d9e07f845f6e@suse.com>
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
 <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
 <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
In-Reply-To: <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>

--------------03H3vGqobeBh7DdhUEBzaRcJ
Content-Type: multipart/mixed; boundary="------------ft4v08KA0HEkr58kEkINkl0J"

--------------ft4v08KA0HEkr58kEkINkl0J
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjguMDcuMjMgMTE6MzgsIEp1bGllbiBHcmFsbCB3cm90ZToNCj4gSGkgSnVlcmdlbiwN
Cj4gDQo+IE9uIDI4LzA3LzIwMjMgMTA6MTQsIEp1ZXJnZW4gR3Jvc3Mgd3JvdGU6DQo+PiBP
biAyOC4wNy4yMyAxMDo1OSwgSnVsaWVuIEdyYWxsIHdyb3RlOg0KPj4+IEhpIEp1ZXJnZW4s
DQo+Pj4NCj4+PiB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zIGJlaW5nIGZpbGxlZC4gDQo+
IA0KPiAuLi4gd291bGQgYmUgbGVzcyBvYnZpb3VzIGhlcmUgYW5kIEkgdGhpbmsgaXQgbWln
aHQgYmUgbWlzcy4NCg0KQXNzdW1pbmcgdGhhdCBzb21lb25lIGNoYW5naW5nIFhFTlNUT1JF
X1BBWUxPQURfTUFYIHdvdWxkIGRvIGEgYnVpbGQgYWZ0ZXJ3YXJkcywNCkkgZG9uJ3Qgc2Vl
IGhvdyBzdWNoIGEgZmFpbHVyZSBjb3VsZCBiZSBtaXNzZWQuIEluIGNhc2Ugb2YgYSBydW50
aW1lIGNoZWNrIEkNCmFncmVlIHRoYXQgYSBtb3JlIGNlbnRyYWwgcGxhY2Ugd291bGQgYmUg
cHJlZmVycmVkLg0KDQpJbiB0aGUgZW5kIEkgZG9uJ3QgbWluZCB0aGF0IG11Y2gsIGJ1dA0K
DQoJQlVJTERfQlVHX09OKFhFTlNUT1JFX1BBWUxPQURfTUFYID49DQoJCSAgICAgKHR5cGVv
Zigoc3RydWN0IG5vZGVfaGRyICopTlVMTC0+ZGF0YWxlbikpKC0xKSk7DQoNCmlzIGEgbGl0
dGxlIGJpdCBjbHVtc3kgSU1ITy4NCg0KDQpKdWVyZ2VuDQo=
--------------ft4v08KA0HEkr58kEkINkl0J
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQ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FmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------ft4v08KA0HEkr58kEkINkl0J--

--------------03H3vGqobeBh7DdhUEBzaRcJ--

--------------17mDiwR607KvbstlMoAZuT9X
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmTDjikFAwAAAAAACgkQsN6d1ii/Ey/s
Ogf/aSDSHFSB38cl/stNYg5ngm4QKs44qCaKWwWS5TBO4VeZi/2YHx5RN8W4rX5cvOfHB3oMhNs4
MJC47oT/x1uWhavR/64qaFmFjF38QKPxsQ7y4lzyOejTD9yZj+0zyq690RLu6XuQPji5hAxDry1w
fLYmxUq8JoxXzjX31Kmwr3IsKXp1x0sB7kW5WC692svd/u3x+jqKIIz1WASRFB0GXMNimGU+2Szs
4r90BKpCM7cBqL2/D4WTpUUsOYRzk7IcHYC/oC6eM57xfroc0A95ENzOisp1osY9tQ0mqXM4Ah3I
eHoC3s/9GUQOmVvdiLI8kzbVnBFjMAXP2svaSrNa+Q==
=GmMe
-----END PGP SIGNATURE-----

--------------17mDiwR607KvbstlMoAZuT9X--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 09:58:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 09:58:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571411.895174 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPKEl-0005AG-K2; Fri, 28 Jul 2023 09:58:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571411.895174; Fri, 28 Jul 2023 09:58:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPKEl-0005A9-HB; Fri, 28 Jul 2023 09:58:19 +0000
Received: by outflank-mailman (input) for mailman id 571411;
 Fri, 28 Jul 2023 09:58:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=UUpw=DO=citrix.com=prvs=566eed887=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qPKEk-0005A3-1g
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 09:58:18 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 44b9a934-2d2d-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 11:58:15 +0200 (CEST)
Received: from mail-mw2nam10lp2100.outbound.protection.outlook.com (HELO
 NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.100])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 28 Jul 2023 05:58:10 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by CO6PR03MB6258.namprd03.prod.outlook.com (2603:10b6:303:13f::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Fri, 28 Jul
 2023 09:58:07 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6631.026; Fri, 28 Jul 2023
 09:58:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 44b9a934-2d2d-11ee-b24d-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690538295;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:content-transfer-encoding:mime-version;
  bh=dcnZ2LN3zCS7EKFPsmGQMsR+P9INz7Tc7jfrkUhwE0k=;
  b=UDnlwIx/phmMqzvTpQqztvGQBTXOaq8kAc/N0xeyzaIuWtHufzGVTSsZ
   sukht+DTd7EsYxOyrE8B43u189+VpZccLjIiaizVkDlkZf3IY+xQEJImG
   oI5jcggFMhC3swWntoF1dfLQv2Qsy43yrt0zvpzNnF7xCD+vT0MiISoWW
   o=;
X-IronPort-RemoteIP: 104.47.55.100
X-IronPort-MID: 117047316
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:idobO6ws6MZlGFGiBkR6t+f1xyrEfRIJ4+MujC+fZmUNrF6WrkUBn
 TMbX2/UaP/YMWP3fNAiOYi1oRgCucfWxtVgTAFk+CAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s
 ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult
 Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhP6AT5TcyqlFOZH4hDfDpR5fHatE88t6SH
 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo
 Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KU8Q6
 6IqcjQqVTKCnNOsmbyYR9Vvgst2eaEHPKtH0p1h5RfwKK9+BLX8GeDN79Ie2yosjMdTG/qYf
 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjWVlVQpuFTuGIO9ltiiX8Jak1zev
 mvb12/4HgsbJJqUzj/tHneE37aQxX+kA9tMfFG+3tR1qXeN4zIwNEQfSByxgfWLp0qCUd0Kf
 iT4/QJr98De7neDXtT7GhG1vnOAlhodQMZLVf037hmXzajZ6BrfAXILJhZDYtE7sM49RRQxy
 0SE2djuAFRHr7m9WX+bsLCOoluaOiULLGlEeS4NSyME5cXupMc4iRenZs5qDaqdntDzXzbqz
 Fi3QDMWgrwSiYsOyP+99FWe2za0/MGRFkgy+xndWX+j4kVhfom5aoe06F/dq/FdMIKeSVrHt
 38B8ySD0N0z4Vi2vHTlaI0w8HuBvp5p7BW0bYZTIqQc
IronPort-HdrOrdr: A9a23:oTdGO6uc+lvj4rXkDX83eK777skDRtV00zEX/kB9WHVpm62j9/
 xG885rsiMc5Ax8ZJhDo7290di7IE80nKQdieJ6AV7IZmfbUQWTQ71K3M/JwjX6ASHin9Qtt5
 uJOMBFebnN5CNB/KXHyTj9F9o72tGI/JyVpcq29QYJcT1X
X-Talos-CUID: 9a23:SloUnmxAcWHos5EWAf9FBgU6RN57QCfZ60zyIlSJEz9na7CpSlufrfY=
X-Talos-MUID: 9a23:rNqBkgsGjlBGgoYk382nri5LHtlNvYeSUUkQ1p8mt/upMRB6NGLI
X-IronPort-AV: E=Sophos;i="6.01,237,1684814400"; 
   d="scan'208";a="117047316"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=TLyM6R9JdEOOCrZSNjqB+JnayMabX1eyDs4SnJRZWtUlrgn6BEs92x2nMnq8uDaNbjL60K7gGmGDxs/jKdtKOySiHXDqiV6pKvRYE5Ol4c7OhsBv97YqKnb/oK7aBBpI+a7HbOCPySfIQV3CtlFHC6h2jkA7JVhidSKtbjjc0YOMRBvyzXBnZOXqU4487tbiPK/Yfy0ijJ9ht8ZHrKgeqfpn4uOHxNGM2n+x+mPKNn/k6uwsb4INSHi7CVOb5MdbG6P74ldlgepZWUt8xmHBIqHxTMJ5hUzD8u6dtn4Q/U06w9iM8qh6JqqgsHZKCHGdEA3HT9NF/qano0DlSqqF+w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=JTTeB9/o2lRk6wToEn0bcKaCOHRDiuR968v7zHe4rH0=;
 b=ZW70orpx4sQRXoxXiZGAMBTHL4DxLWZv3EMdc4G5PNu3roOsBZoXF0wgRBNBsVwrdnqrBH6+grcghHLUz13UNLhSU8FlQJUQZ8UmzbmFh2EhEltF+btzpvfCYGZYJBKbbULKpbfl6xHCkEjvWLcK0BD4KSTsQD2O/Do4ekQriPFOSENqyAu84KEqc8EobhJ7WlFTINkDEXASy3tO4dZRAo2VnMnBKqaPX1vU7g8Pdjd8O9+WXyQFfL85Z/7GQIUSz1A9RuC3m4v1Phj7vWINDHPUxPcJGEO97139yREBph3YqgB7J6pQysGJ3AHRBjMOxxApS8Vyq2X7qV3h4nCPVA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=JTTeB9/o2lRk6wToEn0bcKaCOHRDiuR968v7zHe4rH0=;
 b=NAetWdFAnbUeZ/TxLRdV4ipD7NV//Qzb4rDE5gMWMp2kqWTz7hpX2t8Fc3ZcSaP1MXMOLk6AcrXRzTMjuEN//pKcsrXa/g5yl6CUhZFhJUU1ON2xva0hQ++9uYf3TaFSN7tG3bnV+OD8prXUSNg/9nXaqpRM2/w9ggpodct1MeM=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>,
	Kevin Tian <kevin.tian@intel.com>,
	Paul Durrant <paul@xen.org>
Subject: [PATCH v4 4/4] x86/iommu: pass full IO-APIC RTE for remapping table update
Date: Fri, 28 Jul 2023 11:57:16 +0200
Message-ID: <20230728095716.13779-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20230726125508.78704-5-roger.pau@citrix.com>
References: <20230726125508.78704-5-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0018.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2ad::11) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|CO6PR03MB6258:EE_
X-MS-Office365-Filtering-Correlation-Id: 80ddd679-f65e-4c31-9b03-08db8f5123db
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	mlE5PBVcx/8N5r4bYmZKx9C2zuMtiHwrBWNQ82MGNORLhKML9iBq6I13tRKyHutjBIj3oCNbezD0iUgQgJuxd1T2OZX0Ib8VIYdJLMsQMivtZAqY/AEZBOzC2f6uYD4RhQL/YeuJpWc3UNzLMeh4VEpaWrQplT3+X0eetlSTYpAJOBi2cGhCFeHPYln0t96TpqqOQNw79qAVllDo5/ggAqU2uq87EiaMymo4q0V0GpsM1sPPWuwQH+WnJdYQ5duyLDs78Tb5oP5X06NlXo+w9IC+arCC04WGM8CgUFAk0biudRTNM5VmDdFHNQ9SqrLh5N3ruHZLMJ3liIjf8hN5h+mJk4rIrApIlYAChMvPF53WHALv6yKb9nnk5x8fC4j8QzQxsNlJvcwIJoe2S2+7CJbmFgk0AfaR+WPdTC1OyKru3pN/ngZzE53tztkk/VG2XdsVaodLtp88l39IZYKTLNDl2OqGJLsTDG9meq0dtCVbpICfCTRKDTgmAXzUIEO8c6PKDnRod3fDpP4Eu31M4WRG7JmwBR2bJsSchUkY+p9I1KmT01RNX90ZQ1sVM6mM
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(396003)(346002)(136003)(366004)(451199021)(5660300002)(478600001)(54906003)(66946007)(38100700002)(316002)(6506007)(4326008)(66556008)(66476007)(82960400001)(6916009)(26005)(6666004)(186003)(6486002)(1076003)(6512007)(8936002)(8676002)(2906002)(41300700001)(30864003)(2616005)(15650500001)(36756003)(86362001)(83380400001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RTltdVZzKzRYUDBCcDU2T1E3SzZjZGI5Q244MVZVQkxqenRiL3EycHV2WlhW?=
 =?utf-8?B?cnpGQ0ZlMDZncFY1MkVHd1ppT09vKzJtWDk1emdvS21rT05MNVhFVHZYckIz?=
 =?utf-8?B?RFh2aDBKOHVXTlJBRFoxRzFwRWQ4Uk5NTHJMdkQ1dUpmUzhTanZPSEg1Yk5l?=
 =?utf-8?B?NWU1UGNTOGhFcTlFemJ0UFB3TTArRm5COXdlbTZjclk2dFdDdkJ4NEdoMXdW?=
 =?utf-8?B?a3AxeE1rY3V3cDcxSENYQk9XYmtiQU5kMzRnZUlEWC93VG1VTmwzK3NGT2FI?=
 =?utf-8?B?UktCS1ZOUHNtcHVtbWI3aGFRYml2VzN2L0k4c1B3RG1aRFQxckdQdUFjTkdy?=
 =?utf-8?B?eDJ3czREUWFEWVpwZDh6V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ZXJmT3JsRkczTkFK?=
 =?utf-8?Q?vNxBRjioXWxEg3W1CwW57XJCF?=
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	hiQE091rWOu673JpWBVLdgf7kd/2+60xSW4WnJxwEkD11AHnoptmKS6D/zuVeyVeydT20umOECZm1AIa9E5BroZWvHomUW7CJrMVR1dUO7B4+RBGZbjBat1UbWXxrSdjZZzjvRia+ZwiKBqMmaHLkCwTU6wxs/Y4Y4TWMn48m4LB+V/e2U2jt9JHUT78lncf/4DN2ZYsyL6gtgh1EZjdCXs/9BnMUu5f6SZ33NWalL2aQD180i1TIuS60Gx+nqCniOTBzr39O+FYJvo2tYFK+zxxoqWA2qFmVqThICpOj5PY6ClAfE23rlsNskRt72XMYGAjA3d3ZicwJTfegtP7uiSioRiKYRuqis1ZMMXAPa3jf56bYb9kVin2adX2d18Bs5rSPLzRFOvC6yO0coPza6Z7GjmPkJZ9ggUCg1qpDcfwOLyTwjfSS/uaE2tE4OYj8XmnK6jxqS7QOhFFY8CG+ABsG1b0JrGlgKU7a4Bd3eT0k4DmXq59OU9iZWc0QpmvJh0zQeSd6VFuwVu0CXKlAxBOpCR7HpeMsWBweiHZnPdg7huvIl2eQkqVP2SWUczQaoeVusUmrgPKhJlM6A/EoAitcOzgJ8Oa1zywWXWcCLRJEz9P9PDSlDCk1PQPVt0Tf48LcjZjjomieg81XajtD71lk4hzv9l9+HxDZEKj7pbbeE6Qa6o0OZEton3ITy1vX2bRZF87hpiHVIm8CV0ci4gU8t5uaGg0gPCJg6YH5ymx50DloYSZtmAHd84NlUzYom3f1aMisi7bEPdajAZESOtYpOBRbtq3fjQmMo8dBJgavyoG0Yy9FaNbHunL8OTHgu/MjSOXVAp39dksxU3LpI0ZAXiGXFIMDx4u5GA9RQc=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 80ddd679-f65e-4c31-9b03-08db8f5123db
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2023 09:58:06.1439
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 3/TepATXzgZcd/Fm3UIRa6QhyeqvlBrQSw4+sVPGtEvJkQeVnuyk68KE3/X+R72/maT0a4JXAYudup3VOKzK/g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR03MB6258

So that the remapping entry can be updated atomically when possible.

Doing such update atomically will avoid Xen having to mask the IO-APIC
pin prior to performing any interrupt movements (ie: changing the
destination and vector fields), as the interrupt remapping entry is
always consistent.

This also simplifies some of the logic on both VT-d and AMD-Vi
implementations, as having the full RTE available instead of half of
it avoids to possibly read and update the missing other half from
hardware.

While there remove the explicit zeroing of new_ire fields in
ioapic_rte_to_remap_entry() and initialize the variable at definition
so all fields are zeroed.  Note fields could be also initialized with
final values at definition, but I found that likely too much to be
done at this time.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
Changes since v3:
 - Fix prototype parameter name to match definition.
 - Use GET_xAPIC_ID().
 - Remove duplicated error message in io_apic_write_remap_rte().

Changes since v2:
 - Remove unneeded initialization.
 - Use 'rte' as parameter name for update_ire_from_apic()
   implementations.
 - Fix comment style in ioapic_rte_to_remap_entry().
 - Fix requirement for atomic write in update_irte() call from
   ioapic_rte_to_remap_entry().
 - Remove remap_rte from io_apic_write_remap_rte().
---
Note that certain combination of changes to the RTE are impossible to
handle atomically. For example changing the vector and/or destination
fields together with the triggering mode is impossible to be performed
atomically (as the destination and vector is set in the IRTE, but the
triggering mode is set in the RTE).  Xen doesn't attempt to perform
such changes in a single update to the RTE anyway, so it's fine.

Naming the iommu_update_ire_from_apic() parameter RTE is not really
correct, as the format of the passed value expands the destination
field to be 32bits (in order to fit an x2APIC ID).  Passing an
IO_APIC_route_entry struct is not possible due to the circular
dependency that would create between io_apic.h and iommu.h.  It might
be possible to move IO_APIC_route_entry declaration to a different
header, but I haven't looked into it.
---
 xen/arch/x86/include/asm/iommu.h         |   3 +-
 xen/arch/x86/io_apic.c                   |   5 +-
 xen/drivers/passthrough/amd/iommu.h      |   2 +-
 xen/drivers/passthrough/amd/iommu_intr.c | 100 ++---------------
 xen/drivers/passthrough/vtd/extern.h     |   2 +-
 xen/drivers/passthrough/vtd/intremap.c   | 131 +++++++++++------------
 xen/drivers/passthrough/x86/iommu.c      |   4 +-
 xen/include/xen/iommu.h                  |   3 +-
 8 files changed, 82 insertions(+), 168 deletions(-)

diff --git a/xen/arch/x86/include/asm/iommu.h b/xen/arch/x86/include/asm/iommu.h
index 0540cd9faa87..eb720205e25e 100644
--- a/xen/arch/x86/include/asm/iommu.h
+++ b/xen/arch/x86/include/asm/iommu.h
@@ -84,7 +84,8 @@ struct iommu_init_ops {
 
 extern const struct iommu_init_ops *iommu_init_ops;
 
-void iommu_update_ire_from_apic(unsigned int apic, unsigned int reg, unsigned int value);
+void iommu_update_ire_from_apic(unsigned int apic, unsigned int pin,
+                                uint64_t rte);
 unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int reg);
 int iommu_setup_hpet_msi(struct msi_desc *);
 
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 041233b9b706..b3afef8933d7 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -275,10 +275,7 @@ void __ioapic_write_entry(
         __io_apic_write(apic, 0x10 + 2 * pin, eu.w1);
     }
     else
-    {
-        iommu_update_ire_from_apic(apic, 0x11 + 2 * pin, eu.w2);
-        iommu_update_ire_from_apic(apic, 0x10 + 2 * pin, eu.w1);
-    }
+        iommu_update_ire_from_apic(apic, pin, e.raw);
 }
 
 static void ioapic_write_entry(
diff --git a/xen/drivers/passthrough/amd/iommu.h b/xen/drivers/passthrough/amd/iommu.h
index 8bc3c35b1bb1..5429ada58ef5 100644
--- a/xen/drivers/passthrough/amd/iommu.h
+++ b/xen/drivers/passthrough/amd/iommu.h
@@ -300,7 +300,7 @@ int cf_check amd_iommu_free_intremap_table(
 unsigned int amd_iommu_intremap_table_order(
     const void *irt, const struct amd_iommu *iommu);
 void cf_check amd_iommu_ioapic_update_ire(
-    unsigned int apic, unsigned int reg, unsigned int value);
+    unsigned int apic, unsigned int pin, uint64_t rte);
 unsigned int cf_check amd_iommu_read_ioapic_from_ire(
     unsigned int apic, unsigned int reg);
 int cf_check amd_iommu_msi_msg_update_ire(
diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index f32c418a7e49..e83a2a932af8 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -247,11 +247,6 @@ static void update_intremap_entry(const struct amd_iommu *iommu,
     }
 }
 
-static inline int get_rte_index(const struct IO_APIC_route_entry *rte)
-{
-    return rte->vector | (rte->delivery_mode << 8);
-}
-
 static inline void set_rte_index(struct IO_APIC_route_entry *rte, int offset)
 {
     rte->vector = (u8)offset;
@@ -267,7 +262,6 @@ static int update_intremap_entry_from_ioapic(
     int bdf,
     struct amd_iommu *iommu,
     struct IO_APIC_route_entry *rte,
-    bool_t lo_update,
     u16 *index)
 {
     unsigned long flags;
@@ -315,31 +309,6 @@ static int update_intremap_entry_from_ioapic(
         spin_lock(lock);
     }
 
-    if ( fresh )
-        /* nothing */;
-    else if ( !lo_update )
-    {
-        /*
-         * Low half of incoming RTE is already in remapped format,
-         * so need to recover vector and delivery mode from IRTE.
-         */
-        ASSERT(get_rte_index(rte) == offset);
-        if ( iommu->ctrl.ga_en )
-            vector = entry.ptr128->full.vector;
-        else
-            vector = entry.ptr32->flds.vector;
-        /* The IntType fields match for both formats. */
-        delivery_mode = entry.ptr32->flds.int_type;
-    }
-    else if ( x2apic_enabled )
-    {
-        /*
-         * High half of incoming RTE was read from the I/O APIC and hence may
-         * not hold the full destination, so need to recover full destination
-         * from IRTE.
-         */
-        dest = get_full_dest(entry.ptr128);
-    }
     update_intremap_entry(iommu, entry, vector, delivery_mode, dest_mode, dest);
 
     spin_unlock_irqrestore(lock, flags);
@@ -350,14 +319,11 @@ static int update_intremap_entry_from_ioapic(
 }
 
 void cf_check amd_iommu_ioapic_update_ire(
-    unsigned int apic, unsigned int reg, unsigned int value)
+    unsigned int apic, unsigned int pin, uint64_t rte)
 {
-    struct IO_APIC_route_entry old_rte = { };
-    struct IO_APIC_route_entry new_rte = { };
-    unsigned int rte_lo = (reg & 1) ? reg - 1 : reg;
-    unsigned int pin = (reg - 0x10) / 2;
+    struct IO_APIC_route_entry old_rte;
+    struct IO_APIC_route_entry new_rte = { .raw = rte };
     int seg, bdf, rc;
-    bool saved_mask, fresh = false;
     struct amd_iommu *iommu;
     unsigned int idx;
 
@@ -373,58 +339,23 @@ void cf_check amd_iommu_ioapic_update_ire(
     {
         AMD_IOMMU_WARN("failed to find IOMMU for IO-APIC @ %04x:%04x\n",
                        seg, bdf);
-        __io_apic_write(apic, reg, value);
+        __ioapic_write_entry(apic, pin, true, new_rte);
         return;
     }
 
-    /* save io-apic rte lower 32 bits */
-    *((u32 *)&old_rte) =  __io_apic_read(apic, rte_lo);
-    saved_mask = old_rte.mask;
-
-    if ( reg == rte_lo )
-    {
-        *((u32 *)&new_rte) = value;
-        /* read upper 32 bits from io-apic rte */
-        *(((u32 *)&new_rte) + 1) = __io_apic_read(apic, reg + 1);
-    }
-    else
-    {
-        *((u32 *)&new_rte) = *((u32 *)&old_rte);
-        *(((u32 *)&new_rte) + 1) = value;
-    }
-
-    if ( ioapic_sbdf[idx].pin_2_idx[pin] >= INTREMAP_MAX_ENTRIES )
-    {
-        ASSERT(saved_mask);
-
-        /*
-         * There's nowhere except the IRTE to store a full 32-bit destination,
-         * so we may not bypass entry allocation and updating of the low RTE
-         * half in the (usual) case of the high RTE half getting written first.
-         */
-        if ( new_rte.mask && !x2apic_enabled )
-        {
-            __io_apic_write(apic, reg, value);
-            return;
-        }
-
-        fresh = true;
-    }
-
+    old_rte = __ioapic_read_entry(apic, pin, true);
     /* mask the interrupt while we change the intremap table */
-    if ( !saved_mask )
+    if ( !old_rte.mask )
     {
         old_rte.mask = 1;
-        __io_apic_write(apic, rte_lo, *((u32 *)&old_rte));
+        __ioapic_write_entry(apic, pin, true, old_rte);
     }
 
     /* Update interrupt remapping entry */
     rc = update_intremap_entry_from_ioapic(
-             bdf, iommu, &new_rte, reg == rte_lo,
+             bdf, iommu, &new_rte,
              &ioapic_sbdf[idx].pin_2_idx[pin]);
 
-    __io_apic_write(apic, reg, ((u32 *)&new_rte)[reg != rte_lo]);
-
     if ( rc )
     {
         /* Keep the entry masked. */
@@ -433,20 +364,7 @@ void cf_check amd_iommu_ioapic_update_ire(
         return;
     }
 
-    /* For lower bits access, return directly to avoid double writes */
-    if ( reg == rte_lo )
-        return;
-
-    /*
-     * Unmask the interrupt after we have updated the intremap table. Also
-     * write the low half if a fresh entry was allocated for a high half
-     * update in x2APIC mode.
-     */
-    if ( !saved_mask || (x2apic_enabled && fresh) )
-    {
-        old_rte.mask = saved_mask;
-        __io_apic_write(apic, rte_lo, *((u32 *)&old_rte));
-    }
+    __ioapic_write_entry(apic, pin, true, new_rte);
 }
 
 unsigned int cf_check amd_iommu_read_ioapic_from_ire(
diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 39602d1f88f8..d49e40c5ce7d 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -92,7 +92,7 @@ int cf_check intel_iommu_get_reserved_device_memory(
 unsigned int cf_check io_apic_read_remap_rte(
     unsigned int apic, unsigned int reg);
 void cf_check io_apic_write_remap_rte(
-    unsigned int apic, unsigned int reg, unsigned int value);
+    unsigned int apic, unsigned int pin, uint64_t rte);
 
 struct msi_desc;
 struct msi_msg;
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 05df6d5759b1..706abefaccc2 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -328,15 +328,14 @@ static int remap_entry_to_ioapic_rte(
 
 static int ioapic_rte_to_remap_entry(struct vtd_iommu *iommu,
     int apic, unsigned int ioapic_pin, struct IO_xAPIC_route_entry *old_rte,
-    unsigned int rte_upper, unsigned int value)
+    struct IO_xAPIC_route_entry new_rte)
 {
     struct iremap_entry *iremap_entry = NULL, *iremap_entries;
     struct iremap_entry new_ire;
     struct IO_APIC_route_remap_entry *remap_rte;
-    struct IO_xAPIC_route_entry new_rte;
     int index;
     unsigned long flags;
-    bool init = false;
+    bool init = false, masked = old_rte->mask;
 
     remap_rte = (struct IO_APIC_route_remap_entry *) old_rte;
     spin_lock_irqsave(&iommu->intremap.lock, flags);
@@ -364,48 +363,40 @@ static int ioapic_rte_to_remap_entry(struct vtd_iommu *iommu,
 
     new_ire = *iremap_entry;
 
-    if ( rte_upper )
-    {
-        if ( x2apic_enabled )
-            new_ire.remap.dst = value;
-        else
-            new_ire.remap.dst = (value >> 24) << 8;
-    }
+    if ( x2apic_enabled )
+        new_ire.remap.dst = new_rte.dest.dest32;
     else
-    {
-        *(((u32 *)&new_rte) + 0) = value;
-        new_ire.remap.fpd = 0;
-        new_ire.remap.dm = new_rte.dest_mode;
-        new_ire.remap.tm = new_rte.trigger;
-        new_ire.remap.dlm = new_rte.delivery_mode;
-        /* Hardware require RH = 1 for LPR delivery mode */
-        new_ire.remap.rh = (new_ire.remap.dlm == dest_LowestPrio);
-        new_ire.remap.avail = 0;
-        new_ire.remap.res_1 = 0;
-        new_ire.remap.vector = new_rte.vector;
-        new_ire.remap.res_2 = 0;
-
-        set_ioapic_source_id(IO_APIC_ID(apic), &new_ire);
-        new_ire.remap.res_3 = 0;
-        new_ire.remap.res_4 = 0;
-        new_ire.remap.p = 1;     /* finally, set present bit */
-
-        /* now construct new ioapic rte entry */
-        remap_rte->vector = new_rte.vector;
-        remap_rte->delivery_mode = 0;    /* has to be 0 for remap format */
-        remap_rte->index_15 = (index >> 15) & 0x1;
-        remap_rte->index_0_14 = index & 0x7fff;
-
-        remap_rte->delivery_status = new_rte.delivery_status;
-        remap_rte->polarity = new_rte.polarity;
-        remap_rte->irr = new_rte.irr;
-        remap_rte->trigger = new_rte.trigger;
-        remap_rte->mask = new_rte.mask;
-        remap_rte->reserved = 0;
-        remap_rte->format = 1;    /* indicate remap format */
-    }
-
-    update_irte(iommu, iremap_entry, &new_ire, !init);
+        new_ire.remap.dst = GET_xAPIC_ID(new_rte.dest.dest32) << 8;
+
+    new_ire.remap.dm = new_rte.dest_mode;
+    new_ire.remap.tm = new_rte.trigger;
+    new_ire.remap.dlm = new_rte.delivery_mode;
+    /* Hardware require RH = 1 for LPR delivery mode. */
+    new_ire.remap.rh = (new_ire.remap.dlm == dest_LowestPrio);
+    new_ire.remap.vector = new_rte.vector;
+
+    set_ioapic_source_id(IO_APIC_ID(apic), &new_ire);
+    /* Finally, set present bit. */
+    new_ire.remap.p = 1;
+
+    /* Now construct new ioapic rte entry. */
+    remap_rte->vector = new_rte.vector;
+    /* Has to be 0 for remap format. */
+    remap_rte->delivery_mode = 0;
+    remap_rte->index_15 = (index >> 15) & 0x1;
+    remap_rte->index_0_14 = index & 0x7fff;
+
+    remap_rte->delivery_status = new_rte.delivery_status;
+    remap_rte->polarity = new_rte.polarity;
+    remap_rte->irr = new_rte.irr;
+    remap_rte->trigger = new_rte.trigger;
+    remap_rte->mask = new_rte.mask;
+    remap_rte->reserved = 0;
+    /* Indicate remap format. */
+    remap_rte->format = 1;
+
+    /* If cmpxchg16b is not available the caller must mask the IO-APIC pin. */
+    update_irte(iommu, iremap_entry, &new_ire, !init && !masked);
     iommu_sync_cache(iremap_entry, sizeof(*iremap_entry));
     iommu_flush_iec_index(iommu, 0, index);
 
@@ -439,36 +430,42 @@ unsigned int cf_check io_apic_read_remap_rte(
 }
 
 void cf_check io_apic_write_remap_rte(
-    unsigned int apic, unsigned int reg, unsigned int value)
+    unsigned int apic, unsigned int pin, uint64_t rte)
 {
-    unsigned int pin = (reg - 0x10) / 2;
+    struct IO_xAPIC_route_entry new_rte = { .raw = rte };
     struct IO_xAPIC_route_entry old_rte = { };
-    struct IO_APIC_route_remap_entry *remap_rte;
-    unsigned int rte_upper = (reg & 1) ? 1 : 0;
     struct vtd_iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic));
-    int saved_mask;
+    bool masked = true;
+    int rc;
 
-    old_rte = __ioapic_read_entry(apic, pin, true);
-
-    remap_rte = (struct IO_APIC_route_remap_entry *) &old_rte;
-
-    /* mask the interrupt while we change the intremap table */
-    saved_mask = remap_rte->mask;
-    remap_rte->mask = 1;
-    __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
-    remap_rte->mask = saved_mask;
-
-    if ( ioapic_rte_to_remap_entry(iommu, apic, pin,
-                                   &old_rte, rte_upper, value) )
+    if ( !cpu_has_cx16 )
     {
-        __io_apic_write(apic, reg, value);
+       /*
+        * Cannot atomically update the IRTE entry: mask the IO-APIC pin to
+        * avoid interrupts seeing an inconsistent IRTE entry.
+        */
+        old_rte = __ioapic_read_entry(apic, pin, true);
+        if ( !old_rte.mask )
+        {
+            masked = false;
+            old_rte.mask = 1;
+            __ioapic_write_entry(apic, pin, true, old_rte);
+        }
+    }
 
-        /* Recover the original value of 'mask' bit */
-        if ( rte_upper )
-            __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte);
+    rc = ioapic_rte_to_remap_entry(iommu, apic, pin, &old_rte, new_rte);
+    if ( rc )
+    {
+        if ( !masked )
+        {
+            /* Recover the original value of 'mask' bit */
+            old_rte.mask = 0;
+            __ioapic_write_entry(apic, pin, true, old_rte);
+        }
+        return;
     }
-    else
-        __ioapic_write_entry(apic, pin, true, old_rte);
+    /* old_rte will contain the updated IO-APIC RTE on success. */
+    __ioapic_write_entry(apic, pin, true, old_rte);
 }
 
 static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
index be71a4c4641c..d290855959f2 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -158,9 +158,9 @@ int iommu_enable_x2apic(void)
 }
 
 void iommu_update_ire_from_apic(
-    unsigned int apic, unsigned int reg, unsigned int value)
+    unsigned int apic, unsigned int pin, uint64_t rte)
 {
-    iommu_vcall(&iommu_ops, update_ire_from_apic, apic, reg, value);
+    iommu_vcall(&iommu_ops, update_ire_from_apic, apic, pin, rte);
 }
 
 unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int reg)
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 405db59971c5..9335cd074cff 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -278,7 +278,8 @@ struct iommu_ops {
     int (*enable_x2apic)(void);
     void (*disable_x2apic)(void);
 
-    void (*update_ire_from_apic)(unsigned int apic, unsigned int reg, unsigned int value);
+    void (*update_ire_from_apic)(unsigned int apic, unsigned int pin,
+                                 uint64_t rte);
     unsigned int (*read_apic_from_ire)(unsigned int apic, unsigned int reg);
 
     int (*setup_hpet_msi)(struct msi_desc *);
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 10:12:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 10:12:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571414.895185 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPKSe-0007g5-1s; Fri, 28 Jul 2023 10:12:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571414.895185; Fri, 28 Jul 2023 10:12:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPKSd-0007fy-UV; Fri, 28 Jul 2023 10:12:39 +0000
Received: by outflank-mailman (input) for mailman id 571414;
 Fri, 28 Jul 2023 10:12:38 +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 <SRS0=wghk=DO=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qPKSc-0007fs-8u
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 10:12:38 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20601.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::601])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4508dd21-2d2f-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 12:12:34 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8989.eurprd04.prod.outlook.com (2603:10a6:102:20c::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Fri, 28 Jul
 2023 10:12:32 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Fri, 28 Jul 2023
 10:12:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4508dd21-2d2f-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=dDL3dS/rQzLqaWpc78qrN0mwQJWH+22JAna42yn/sCoc+4T6cjDyL5BMwiwxsCESh8AiJp0TQGTZFexy3xzVYPmQk1CLpRwoZA18D+yxIuUO9LpumANz9Z6eW0e6Hal2MmARx7DpmpcN2c4rMMCtNMgXUWDRbrErgL9hTtFedSqoiLSBA6D7+nGhwJVP4JhUH/vdLGXlOsqzM5+tz592th32bJraqMoIRw10IjTvRxFLOBnDET341bu40k9Zf3qbFsEYTz/9bdSeeYc7PdSuLtMDxNr2TyvkrxYBtBwuQL9qo0aUpTY2X8EY8qI8GZvZXj8j/3YyqnPnLZIUUHbcYg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=VjCOdF4UuGGVHSnxKV3WNPd+/ZOTM0K5Y8johWDgWYk=;
 b=d/70oCsC6qoeFRzeoneCHsNRI81l+WHyUg+umwAAQ+4fks2Hl4TabovgWDRXUWYYZjGcCMXYwi4Xd77wbNYhzgPjBAnywt2CFLQqvZ734wjWDOmmB5SHCT/QC/39i3pv2jfI+LoJagVo4zJJ35WR/naCC3tUDjj+D9DfK5kmzZ/GluYfSa1wURSYyfr2DS1dtQC/QAz3D7LjKulIHs8NjxCHgaVVjIqSKPx27+/s5ciOpt2HCytqIAygE3phOXEnjoMbUoMShC17rfBqpt6gWz3wFrRj1so+NQad12fQI1rnswC6iFIUFMNWqoQsw2EGtcJ1Eh3KJeivnm7ItUDaMQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=VjCOdF4UuGGVHSnxKV3WNPd+/ZOTM0K5Y8johWDgWYk=;
 b=4BCYwzB31IOsSI/2pT+z3H6hgJKcKL0fJ11ACLjZjf0mILze23fOtjNIF55gIPntXWj4vx8IpLxAUxUmV3VSllWjzSdPLLykvZb5BbBnDaZ6NHKFv908wbO97XCpqKnYFahFiIO+Zhw8Me5gB637BUydrLsu/9KVPcEXTwNvLxA5WB/hHStlSMy9WxnXMw8td8fpZojjom//l0ZwetXYxZRZIW2MLmhoe2F6/BEkVASkI3EEjlvlckHK2kDYzgoA586rb/ZQCx5SvjB+dWpkku32fmnF/P6cFHhFvyWxcnY8e7l1JH/BnJobNESUxK4qLMcTq4YMpO158oZZF+Wz/g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <27a9861c-7901-d9f4-37c8-f6895aac64de@suse.com>
Date: Fri, 28 Jul 2023 12:12:29 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 0/5] clang-format for Xen
Content-Language: en-US
To: Luca Fancellu <luca.fancellu@arm.com>
Cc: bertrand.marquis@arm.com, wei.chen@arm.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20230728081144.4124309-1-luca.fancellu@arm.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230728081144.4124309-1-luca.fancellu@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0107.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9c::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8989:EE_
X-MS-Office365-Filtering-Correlation-Id: 968e973a-b659-496d-2ad9-08db8f532811
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	bbH2jiHUmS87zpp2pd5wadRJCCkwGQgKY3W0KEs/ODuGaw9J6IaN6I4aEvCCt48oYcdI/fSc1e1pQc8BwIO0BinyrqTNqjO5SoDTUz8vkbufDTuZtdROrmDCbkF1rhHTd6G5J9Zq7S7r2ws8uEBsPuKaiy2uGJA63c/45Uknb9vYLMaRgvcfz0lHNFnghMP8Eee3qzyCn6AnI1gzn0x0gSnw9UheMnT0ASJJt4TJVuCTGKaDKnAPra9UPUEYcUOiTpxUBCKyF2YYgC8buAdb5f3Umdhxl1rKbHYpFUjBjOTlrupZspKJO2QtTvqHNhrqmUSTpA8R6mCMKkB8evJv7retSdB78M3ByxUqZTSvf2Bj8q1Y0nt+sGHURUx6YCiCt+puc/sPoIfEmsjTYeDLsEhH40MEJRkMpxcCYAf4xinOdMzfliXQjHXVZv5biVVXF9HI2tWdIZse+nA6/nvQdgYtlaA4d72KsfpoCUP7AW5LClwJM+FHFNAJcnbG/B0yLZBBjwhXwx785qaCIMJFuiCRAINkRBxX6mHEd1CGWiq3Fbwbdy4YFEoVqBk8S2Dw+dHSWxqDcDtoTO4nKMyZH+yOWvoA4DSnyoWwckApSLWiWwzjfYPz06Rjs+SFVMo1j+6ttoi8oxqfKRvWmSzJpw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(376002)(396003)(136003)(366004)(451199021)(86362001)(41300700001)(2906002)(316002)(7416002)(5660300002)(8936002)(8676002)(36756003)(31696002)(6512007)(6506007)(53546011)(26005)(6486002)(478600001)(6666004)(83380400001)(38100700002)(186003)(31686004)(2616005)(4326008)(6916009)(66476007)(66946007)(54906003)(66556008)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MFdVdUtOeHVwbEVzaUdwdFJvWjU3aEFkZms4YW53VjAyYS9xdXdkUUJZZ2Q0?=
 =?utf-8?B?ZmkvVE5OQkFFQTNWSE9Ba3JUR2tmM3RTRjhlL3VvR09lS1hJRG9RbWtnRTRp?=
 =?utf-8?B?WkpGTVlwSi81eURaeFNjYTdZNUdEMjdTejVsbWl2WkJkd1Jza0lNeDR3Njdx?=
 =?utf-8?B?bklOamU3YU5Va0p3bGR0RUNNa0RCUGYxNUtxVlJUYnhzdXE1RHFrbll5VnMr?=
 =?utf-8?B?dGlXM1owZzZyM1ZsdmtOYlJUakpwK0FCL2Fkb3BlczRXM3k1WTQzY0ZtUW8z?=
 =?utf-8?B?NWZKUXJ6MW1UZHgwY2w0NkZqa3EraTAyRWVGdWhkUXZOWjVUeTJNSkcxU2hi?=
 =?utf-8?B?RGhvSW1ZOFlp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NjF6U2VhUlB4?=
 =?utf-8?Q?Avmv0CoXqzIi3qhWJrCf2bocu?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 968e973a-b659-496d-2ad9-08db8f532811
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2023 10:12:32.1578
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 77bVg1a2U6dmdKToFA5j1c81HYs8CB3WmVXJWalqyDzRjdT2zK+/AQIjA1J5Kqw6qTkG6OiJxx0LbLOQSBP/EQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8989

On 28.07.2023 10:11, Luca Fancellu wrote:
> I've read the past threads about the brave people who dared to try to introduce
> clang-format for the xen codebase, some of them from 5 years ago, two points
> were clear: 1) goto label needs to be indented and 2) do-while loops have the
> braket in the same line.
> While point 1) was quite a blocker, it seemd to me that point 2) was less
> controversial to be changed in the Xen codestyle, so the current wrapper script
> handles only the point 1 (which is easy), the point 2 can be more tricky to
> handle.

I'm afraid I view the do/while part pretty much as a blocker as well.
While placing the opening brace according to our style elsewhere would
be okay-ish (just a little wasteful to have two almost empty lines),
having the closing brace on a separate line is problematic: At least I
consider a block / scope to end at the line where the closing brace is.
So the farther do and while are apart, the more

    do
    {
        ...;
    }
    while ( cond );
    ...;

is going to be misleading. While normally we would write potentially
conflicting constructs this way

    while ( cond )
        ;

the alternative spelling still isn't outright wrong in our style (I
believe):

    while ( cond );

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 10:15:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 10:15:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571416.895195 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPKVH-0008Gl-I0; Fri, 28 Jul 2023 10:15:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571416.895195; Fri, 28 Jul 2023 10:15:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPKVH-0008Ge-EP; Fri, 28 Jul 2023 10:15:23 +0000
Received: by outflank-mailman (input) for mailman id 571416;
 Fri, 28 Jul 2023 10:15:22 +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 <SRS0=wghk=DO=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qPKVG-0008GY-2g
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 10:15:22 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0631.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::631])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a7b99b11-2d2f-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 12:15:20 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB8PR04MB6969.eurprd04.prod.outlook.com (2603:10a6:10:11b::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Fri, 28 Jul
 2023 10:15:18 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Fri, 28 Jul 2023
 10:15:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a7b99b11-2d2f-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=PPPF3O1Ik+/b9xHKA9cQIoxhdUN9eV+Ue78wpJzpM8YMwkFnNBTZXJJjNiYdHEVQLaH2qWAvCYM1KHx51jEs78UaYipIW2/VDY7hFWCULNVflbpF8lOrGRDjNGlvkEbC53o8fpXcwRZUP6tmYdtCIP2b/FqSKcfyKtT5S4ZX8stLyPS5Wf05YslmzinAxDe6SGCxyfHjYOcUTzCFIV+RnoC3QOpHl29lDunMTGNQu/HyhBG+VvVtKp0aXaN9J5PMj9CdqG1EQQ4dc6LfSo7wLCBlbBrkis4oNcUCphA+ZiG/AZv6LeMuTQeTkz8l6N13Fd5A0bqpKtkEHN19yMz9Rw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BexjW4l+IbUnw7a6/ux2k+O8ya8lYbpw2mLoMEDJjn4=;
 b=mukr18NyLDQvOIIXGT0jSy+jo82fgP3kzqxNaBNRncsCL0UwzC3rjS7EftfJfNfRpNFrOMqfWfokjZ22/ybB8Xk61dlQmGs8oYl8uqmtyry4l5fv0cu9AYkLtpUtY2FODYenY4J7k0zKtv7biC3gyLJB4dB3HFedYX0Gi5AqEFv8O14yxrxO6eqNzECVznme10wi9/XAxEzhjBV3Z+YAmRgO0B77WOx3zTgZ0PCRtM1DxsYk0qTZSPqwGH7mMimX5m9bHD9ZzDCI40aY6+ik7A9jOrIAOZOrN2dwnd2PLlBRIHyEl36kxXhH76ueepsokbk6YThvs5+XzLXgFMsIhw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BexjW4l+IbUnw7a6/ux2k+O8ya8lYbpw2mLoMEDJjn4=;
 b=yqtzIHKkYFKPNhOuZ7iUQJBur5DopZ5rYmXlmEs3mAiVqJVWAc/wa+XS5WSyj5fc0DK7IVwmzi5ecBiqHkzzqslcfQxALluh1L+BhtrVhkVb/EIfll1otAOnkjYzpSPEo6qj1Ptmhhm3E+9oCDY59rz7vh9mJJuqrxz9LQ2p8/stQfJfHbvLpBabS5mlKWstLv0Fh8sdstngp8gosiqv/wrtMO+qCLkGV5rfIEMdWaNprXdl2bZawy11N+mHWc5qwetO32wFekh+d4BjXlRmN/q8IjmNAR7MSXMxvs5trX3hTIsSlmuNeyfqy5HUI/3KGTnq8mJ9+USRGKM9k4d16w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <cc3741aa-de41-8269-b8c6-153cc0bd3a6c@suse.com>
Date: Fri, 28 Jul 2023 12:15:15 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v4 4/4] x86/iommu: pass full IO-APIC RTE for remapping
 table update
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 Kevin Tian <kevin.tian@intel.com>, Paul Durrant <paul@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230726125508.78704-5-roger.pau@citrix.com>
 <20230728095716.13779-1-roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230728095716.13779-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0137.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9e::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB8PR04MB6969:EE_
X-MS-Office365-Filtering-Correlation-Id: 12048712-18ab-4cb8-76a4-08db8f538b18
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	AF4FbE1KQzP6oAoKgEXggjNjd2STLs785CSVBvgGePHqi3HDpWXfiFcoewCMKh0zVHXR30yOgiwGJfsGxTIS5Ybi+vcTA3hR+Rnrbc4XCgkDSmmcjzBmxBoJ4wus44w/fcDJMuKJz/yQf8no1IPHUlEmKxsGPoPAf+pY0bKUuYigbcwAC98mPjjC5mqxQT8cIhKz9YFwtWSzZGxtMvp1B1z/yS8xsx0brtbI0yzRVRBSyqx3xKpIsouJDhMJzI8YrUFRYeBY8fQTsgFRdEJOySKh54pq61jzSmEQ35PPNDKEzh4fVy304WbonpI5fvS8NRw4OC7cueWKRvXdcsFlR39TPXB72VW1RGpG0wJhSPwpha+DXkOMZj9UojtQjSyUKOsG9l9bCzLMKIOV4mbccS20Zp3ZngnrCCyd9Te05qTrXmfqStahg3marv9kvxL7RPVn32BFZps/Q1Rtm/vDNu5OKd2QzCozJ7TuA66UneD4zz0oqG54o6WwP5FVvuEPFNf8BCF31eKJRmK1oVJWsCRgTgT+UtogXCT0LIeL2qY8GWXt9GRo31yoxAW+zlHO+RETH8uUcyZqoaalyW6buenPHfYJx3eZAsnKbqxc85ru7q13IoyvZIfWb6ZcbvzDetAf54AW+s091ot8syLAwA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(136003)(376002)(346002)(396003)(39860400002)(451199021)(6486002)(6666004)(478600001)(54906003)(38100700002)(41300700001)(2616005)(66946007)(5660300002)(6916009)(316002)(66476007)(8676002)(66556008)(4326008)(8936002)(186003)(83380400001)(6512007)(26005)(6506007)(53546011)(86362001)(31696002)(4744005)(15650500001)(2906002)(36756003)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SFVPcUJwa2tNQzNEYnBpRXhMeDk1ZmRWMGxMQ1NjVEhjVE5ua1F4ZGcrQklq?=
 =?utf-8?B?SVMzR3dPREdWY0o4MDNWVTRCQ0Q1QU1mN2dFeGo4MDJqb2hubVpZY0s1TWJq?=
 =?utf-8?B?SjBDSlB5ODBHY0N0VUxBTGsxa21DOGpBUjB4citwMlNTMmxBdTJqNnBkYjk2?=
 =?utf-8?B?Wk5rOVNKS2xPRHFhZmdrMUdzbHk1VHVSd1ZRckRtL0gxVGdtTThBNnorOFla?=
 =?utf-8?B?aEY4ekVRNE9LMFJMbndQVG1wdGZITzhJLzViKzNHZG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pPVHhOWE1oUUZCaktoNU5jUm5UVUlmSUdSRFVHOFE5WUF1RksyYTIr?=
 =?utf-8?B?RnNVdEVNeDExWVo1ZEZ3RW13TXFPTXFCcnRIRDZrUVpIZjBteS95MVZyZ3Q4?=
 =?utf-8?Q?gPuSl0TUcCBZv919TQKPABwH2?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 12048712-18ab-4cb8-76a4-08db8f538b18
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2023 10:15:18.2897
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 6imxyRpyM6Q/8EAnKlcS7f0nrEy0qYUm+gDopG/m+Zm+tD8460HgkdECizxJbHj9eqHB+JIemZhGZJcmI1xFyA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6969

On 28.07.2023 11:57, Roger Pau Monne wrote:
> So that the remapping entry can be updated atomically when possible.
> 
> Doing such update atomically will avoid Xen having to mask the IO-APIC
> pin prior to performing any interrupt movements (ie: changing the
> destination and vector fields), as the interrupt remapping entry is
> always consistent.
> 
> This also simplifies some of the logic on both VT-d and AMD-Vi
> implementations, as having the full RTE available instead of half of
> it avoids to possibly read and update the missing other half from
> hardware.
> 
> While there remove the explicit zeroing of new_ire fields in
> ioapic_rte_to_remap_entry() and initialize the variable at definition
> so all fields are zeroed.  Note fields could be also initialized with
> final values at definition, but I found that likely too much to be
> done at this time.
> 
> Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Fri Jul 28 10:34:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 10:34:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571418.895205 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPKo9-0002Ik-5K; Fri, 28 Jul 2023 10:34:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571418.895205; Fri, 28 Jul 2023 10:34:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPKo9-0002Id-1J; Fri, 28 Jul 2023 10:34:53 +0000
Received: by outflank-mailman (input) for mailman id 571418;
 Fri, 28 Jul 2023 10:34:51 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qPKo7-0002IX-Ee
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 10:34:51 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPKo6-0001lU-Jm; Fri, 28 Jul 2023 10:34:50 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPKo6-0002Rd-D6; Fri, 28 Jul 2023 10:34:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=JsJQgzDDCAF2edNK8Xvnra+lKq6/w7gX380A9gtI340=; b=dZRdPoRee7Zu5vTCRhZB39zDrr
	SyJ3xmC60S/x/V1A8qOKbMMKbpgWfkO2xiEhP2veA6TYcj6shQRX7oy7rWSooICP1Rhe70AO26Uhn
	JBt0eK6NBBs8atlOQRRxCZTNlxE0xJsavl98MyDWx4FWlP0U2gcQfqoACjSRhiNcbewQ=;
Message-ID: <8cea1316-db0b-f29d-c467-6fd5c4a6321c@xen.org>
Date: Fri, 28 Jul 2023 11:34:48 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
Content-Language: en-GB
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
 <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
 <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
 <68acbf84-218b-f2f7-9526-d9e07f845f6e@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <68acbf84-218b-f2f7-9526-d9e07f845f6e@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 28/07/2023 10:45, Juergen Gross wrote:
> On 28.07.23 11:38, Julien Grall wrote:
>> Hi Juergen,
>>
>> On 28/07/2023 10:14, Juergen Gross wrote:
>>> On 28.07.23 10:59, Julien Grall wrote:
>>>> Hi Juergen,
>>>>
>>>> On 28/07/2023 07:23, Juergen Gross wrote:
>>>>> On 27.07.23 23:53, Julien Grall wrote:
>>>>>> Hi Juergen,
>>>>>>
>>>>>> On 24/07/2023 12:02, Juergen Gross wrote:
>>>>>>> Struct xs_tdb_record_hdr is used for nodes stored in the data base.
>>>>>>> When working on a node, struct node is being used, which is 
>>>>>>> including
>>>>>>> the same information as struct xs_tdb_record_hdr, but in a different
>>>>>>> format. Rework struct xs_tdb_record_hdr in order to prepare 
>>>>>>> including
>>>>>>> it in struct node.
>>>>>>>
>>>>>>> Do the following modifications:
>>>>>>>
>>>>>>> - move its definition to xenstored_core.h, as the reason to put 
>>>>>>> it into
>>>>>>> Â Â  utils.h are no longer existing
>>>>>>>
>>>>>>> - rename it to struct node_hdr, as the "tdb" in its name has only
>>>>>>> Â Â  historical reasons
>>>>>>>
>>>>>>> - replace the empty permission array at the end with a comment about
>>>>>>> Â Â  the layout of data in the data base (concatenation of header,
>>>>>>> Â Â  permissions, node contents, and children list)
>>>>>>>
>>>>>>> - use narrower types for num_perms and datalen, as those are 
>>>>>>> naturally
>>>>>>> Â Â  limited to XENSTORE_PAYLOAD_MAX (childlen is different here, 
>>>>>>> as it is
>>>>>>> Â Â  in theory basically unlimited)
>>>>>>
>>>>>> The assumption is XENSTORE_PAYLOAD_MAX will never change and/or 
>>>>>> always apply for all the connection. I am aware of at least one 
>>>>>> downstream use where this is not the case.
>>>>>>
>>>>>> I am happy to use narrower types, but I would at least like some 
>>>>>> checks in Xenstore to ensure the limits are not reached.
>>>>>
>>>>> I will add a BUILD_BUG_ON().
>>>>
>>>> Initially I was thinking about a runtime check, but I am also fine 
>>>> with a BUILD_BUG_ON() if it is right next to length check in 
>>>> handle_input(). So if someone decided to add different payload size 
>>>> depending on the domain (such as privileged domain could do more), 
>>>> it would be easier to spot what else needs to be changed.
>>>
>>> Is this really the correct placement?
>>
>> I think so. By adding the BUILD_ON_BUG() right above the length check, 
>> it would be easier for everyone to know that the datastructure may 
>> also need to change. This ...
>>
>>>
>>> I've put it into write_node_raw(), as this is where the related 
>>> datalen member
>>> is being filled. 
>>
>> ... would be less obvious here and I think it might be miss.
> 
> Assuming that someone changing XENSTORE_PAYLOAD_MAX would do a build 
> afterwards,
> I don't see how such a failure could be missed.

Because one may want dom0 to send payload bigger than 
XENSTORE_PAYLOAD_MAX. Something like:

if ( conn->id != 0 && len < XENSTORE_PAYLOAD_MAX )

Such change would not be caught during compilation. AWS has a similar 
check in the downstream tree because the implementation of 
non-cooperative migration is using Xenstore command and we want to be 
able to transfer the state in a single command.

> In case of a runtime 
> check I
> agree that a more central place would be preferred.
> 
> In the end I don't mind that much, but
> 
>  Â Â Â Â BUILD_BUG_ON(XENSTORE_PAYLOAD_MAX >=
>  Â Â Â Â Â Â Â Â Â Â Â Â  (typeof((struct node_hdr *)NULL->datalen))(-1));
> 
> is a little bit clumsy IMHO.

Agree. We could introduce FIELD_SIZEOF() (as Linux did) to hide the 
complexity. The code would then look like:

 >= (8 * FIELD_SIZEOF(struct node_hdr, datalen))

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 10:44:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 10:44:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571420.895214 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPKxf-0003q2-1G; Fri, 28 Jul 2023 10:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571420.895214; Fri, 28 Jul 2023 10:44:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPKxe-0003pv-Ut; Fri, 28 Jul 2023 10:44:42 +0000
Received: by outflank-mailman (input) for mailman id 571420;
 Fri, 28 Jul 2023 10:44:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=WJ5m=DO=citrix.com=prvs=5668a7b85=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qPKxd-0003pn-FJ
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 10:44:41 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bf5f870f-2d33-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 12:44:39 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bf5f870f-2d33-11ee-b24d-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690541078;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=FOwqXk0q5KCGpGCuGeMIFYd2ScB+k4Rw78r6CfvkwFE=;
  b=ek6SppTbwOHT5wgOv9hqlqdrt+hTeDEycnxwK0FyKpErvLUq9eELX26n
   4Zk/ECVKiHqq/AaJznsIszWE+bwEYAnA+IazeMA6PybWoAQb3eYzZz1gi
   TZWzOWyGrjDPiEzm612uUNwA2TD10uZmG3f+Kv/EEUV9PlprnWfrtT5UL
   c=;
Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 118196025
X-Ironport-Server: esa1.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:dDEiRKBy7tgrDBVW/8Ljw5YqxClBgxIJ4kV8jS/XYbTApDlw32MFz
 2FMCGGOM/feN2KjfdxxYdi08kxV68XQmtA2QQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h
 yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs
 t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GxC7gRnDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS
 uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada
 jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIw+ctwAzBh0
 cUhIz02bz2kotKb57iVc7w57igjBJGD0II3v3hhyXfSDOo8QICFSKLPjTNa9G5u3IYUR6+YP
 pdHL2M1N3wsYDUWUrsTIJs4gOevgGi5azBCoUiZjaE2/3LS3Ep6172F3N/9I4XaHJQLxhzFz
 o7A10LoPD42P8bE8xyE2CONouzPoiTbA41HQdVU8dY12QbOlwT/EiY+TVanrOP/ikmvVsl3I
 lYRvCEpqMAa5EGtC9XwQRC8iHqFpQIHHcpdFfUg7wOAwbaS5ByWbkAOQ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208";a="118196025"
Date: Fri, 28 Jul 2023 11:44:27 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Peter Hoyes <peter.hoyes@arm.com>
CC: <xen-devel@lists.xenproject.org>, <bertrand.marquis@arm.com>,
	<wei.chen@arm.com>, <luca.fancellu@arm.com>, Wei Liu <wl@xen.org>, Juergen
 Gross <jgross@suse.com>
Subject: Re: [PATCH v6 2/2] xl: Add escape character argument to xl console
Message-ID: <7e020fcb-b2f1-40fa-a800-cb7e6a13cfa5@perard>
References: <20230727164450.77640-1-peter.hoyes@arm.com>
 <20230727164450.77640-3-peter.hoyes@arm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230727164450.77640-3-peter.hoyes@arm.com>

On Thu, Jul 27, 2023 at 05:44:49PM +0100, Peter Hoyes wrote:
> diff --git a/tools/libs/light/libxl_console.c b/tools/libs/light/libxl_console.c
> index f497be141b..0b7293fe71 100644
> --- a/tools/libs/light/libxl_console.c
> +++ b/tools/libs/light/libxl_console.c
> @@ -75,15 +76,26 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
>          goto out;
>      }
>  
> +    char *args[] = {
> +        p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
> +        NULL, NULL, NULL, NULL, // start-notify-fd, escape
> +        NULL, // list terminator - do not use

So, you are going back and forth between C and C++ comment style, any
reason? The preferred style is '/* comment */' so previous patch was
better in that regards.

With the comment style fixed: Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 10:47:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 10:47:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571423.895225 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPL0E-0004Vr-JT; Fri, 28 Jul 2023 10:47:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571423.895225; Fri, 28 Jul 2023 10:47:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPL0E-0004Vk-Gq; Fri, 28 Jul 2023 10:47:22 +0000
Received: by outflank-mailman (input) for mailman id 571423;
 Fri, 28 Jul 2023 10:47:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Gg45=DO=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qPL0C-0004UR-Nr
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 10:47:20 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 20065a5b-2d34-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 12:47:19 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 1E2C9218F2;
 Fri, 28 Jul 2023 10:47:19 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E75F7133F7;
 Fri, 28 Jul 2023 10:47:18 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 6JwRN7acw2RlMgAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 28 Jul 2023 10:47:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 20065a5b-2d34-11ee-b24d-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690541239; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=HvGKNdCN9YdpM0WRY1MKfqkkqseDt7KZzpXjaUH9VS0=;
	b=t/OCKcqilw3x+EagNwbnPmGZksMZDHqgNyqLBeD6UMvFjcdW3b6YlfbZ6H+pEUtYvDketI
	/QWYjrYqBIjM8DO+RVt6v35nMFVHdavGgxobVhSAZDegvTvH5YRHwPhb0mlVjul21poks7
	2dbwImGLp8WnwBWpRYNY1A2ZbYhTjyY=
Message-ID: <6a376365-a731-2413-16c7-14ede5224eea@suse.com>
Date: Fri, 28 Jul 2023 12:47:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
 <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
 <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
 <68acbf84-218b-f2f7-9526-d9e07f845f6e@suse.com>
 <8cea1316-db0b-f29d-c467-6fd5c4a6321c@xen.org>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
In-Reply-To: <8cea1316-db0b-f29d-c467-6fd5c4a6321c@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------gPRrSh0EAoGlF7A6rZgG4L0K"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------gPRrSh0EAoGlF7A6rZgG4L0K
Content-Type: multipart/mixed; boundary="------------Ks3jMNmnpSsK7GIKtqn513Fu";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <6a376365-a731-2413-16c7-14ede5224eea@suse.com>
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
 <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
 <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
 <68acbf84-218b-f2f7-9526-d9e07f845f6e@suse.com>
 <8cea1316-db0b-f29d-c467-6fd5c4a6321c@xen.org>
In-Reply-To: <8cea1316-db0b-f29d-c467-6fd5c4a6321c@xen.org>

--------------Ks3jMNmnpSsK7GIKtqn513Fu
Content-Type: multipart/mixed; boundary="------------mHUW10edPu05OGZyJFk1hBgT"

--------------mHUW10edPu05OGZyJFk1hBgT
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjguMDcuMjMgMTI6MzQsIEp1bGllbiBHcmFsbCB3cm90ZToNCj4gSGksDQo+IA0KPiBP
biAyOC8wNy8yMDIzIDEwOjQ1LCBKdWVyZ2VuIEdyb3NzIHdyb3RlOg0KPj4gT24gMjguMDcu
MjMgMTE6MzgsIEp1bGllbiBHcmFsbCB3cm90ZToNCj4+PiBIaSBKdWVyZ2VuLA0KPj4+DQo+
Pj4gT24gMjgvMDcvMjAyMyAxMDoxNCwgSnVlcmdlbiBHcm9zcyB3cm90ZToNCj4+Pj4gT24g
MjguMDcuMjMgMTA6NTksIEp1bGllbiBHcmFsbCB3cm90ZToNCj4+Pj4+IEhpIEp1ZXJnZW4s
DQo+Pj4+Pg0KPj4+Pj4gT24gMjgvMDcvMjAyMyAwNzoyMywgSnVlcmdlbiBHcm9zcyB3cm90
ZToNCj4+Pj4+PiBPbiAyNy4wNy4yMyAyMzo1MywgSnVsaWVuIEdyYWxsIHdyb3RlOg0KPj4+
Pj4+PiBIaSBKdWVyZ2VuLA0KPj4+Pj4+Pg0KPj4+Pj4+PiBPbiAyNC8wNy8yMDIzIDEyOjAy
LCBKdWVyZ2VuIEdyb3NzIHdyb3RlOg0KPj4+Pj4+Pj4gU3RydWN0IHhzX3RkYl9yZWNvcmRf
aGRyIGlzIHVzZWQgZm9yIG5vZGVzIHN0b3JlZCBpbiB0aGUgZGF0YSBiYXNlLg0KPj4+Pj4+
Pj4gV2hlbiB3b3JraW5nIG9uIGEgbm9kZSwgc3RydWN0IG5vZGUgaXMgYmVpbmcgdXNlZCwg
d2h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bm9kZV9o
ZHIsIGRhdGFsZW4pKSkpOw0KDQoNCkp1ZXJnZW4NCg==
--------------mHUW10edPu05OGZyJFk1hBgT
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5RnNVUJbvoPHZ8SlM4KWm8rG+lIkGurq
qu5gu8q8ZMKdsdGC4bBxdQKDKHEFExLJK/nRPFmAuGlId1E3fe10v5QL+qHI3EIP
tyfE7i9Hz6rVwi7lWKgh7pe0ZvatAudZ+JNIlBKptb64Fai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ddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------mHUW10edPu05OGZyJFk1hBgT--

--------------Ks3jMNmnpSsK7GIKtqn513Fu--

--------------gPRrSh0EAoGlF7A6rZgG4L0K
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmTDnLYFAwAAAAAACgkQsN6d1ii/Ey91
iwgAjq2IWypUIQ6qd5nUa9SGnnC4ymhGV3jh8YNprdv2eAwLWHx4cFLW6/QQoFb238E6m4kxUYG2
xs4ap56oYhOfrE80pmUzGKFHKrfcgEj8gcr5kmrZOuoUpajj7F1r85Qqx9gZG+AU0dtsbKUQ/vh8
I1E/mfIDi+vA6tGbraT3V1k+2+OZ1V/6x8PA6EnEfMcE/bjdb7MKx4651DzoLBLKJyY4mSHLU7YW
XptzbeotlDbSyhAzDVa9WNL/Hjs+BcGoEHoovu5odr7ou+xQduS7Eegs3yHqIbcccjI0aAfCw9u9
bmRyE+r9sDNBbuuwpyEVC5fGZv+WoN0RFGcmov7cfg==
=+FBd
-----END PGP SIGNATURE-----

--------------gPRrSh0EAoGlF7A6rZgG4L0K--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 10:47:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 10:47:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571425.895235 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPL0f-0004zI-Tg; Fri, 28 Jul 2023 10:47:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571425.895235; Fri, 28 Jul 2023 10:47:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPL0f-0004zB-PL; Fri, 28 Jul 2023 10:47:49 +0000
Received: by outflank-mailman (input) for mailman id 571425;
 Fri, 28 Jul 2023 10:47:49 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPL0f-0004yx-3b; Fri, 28 Jul 2023 10:47:49 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPL0f-0001zq-12; Fri, 28 Jul 2023 10:47:49 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPL0e-0008J5-Ls; Fri, 28 Jul 2023 10:47:48 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qPL0e-00015Q-LE; Fri, 28 Jul 2023 10:47:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=mcVxzKGX2KVZ9aCmz7vW0FVsqBQiEKcYQCIRF7MGsaU=; b=I24dnsd+VF0CkS9jv9vYZPrJe/
	++u9iJ3xDeu2W4J6YnKdJ0E7QYC9K5R+TBLF8ggzptvReA0mXJh8YwiIkNIfZOMHKpE/wP4RFV8oe
	qqQs68uLWKSWxR2uA+P7eYMqsnlNmn3zwZmcTJ9gBzN6wMtHDHnFHeZKZRaR2/cpwnwU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182054-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 182054: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=dbd566ab729d2839c3c0be5c47cdcc06c2c477f0
X-Osstest-Versions-That:
    xen=15d327e3d6924aabf991246353068eca07654f0e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 28 Jul 2023 10:47:48 +0000

flight 182054 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182054/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  dbd566ab729d2839c3c0be5c47cdcc06c2c477f0
baseline version:
 xen                  15d327e3d6924aabf991246353068eca07654f0e

Last test of basis   182050  2023-07-28 01:02:02 Z    0 days
Testing same since   182054  2023-07-28 08:03:30 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Anthony PERARD <anthony.perard@citrix.com>
  Federico Serafini <federico.serafini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   15d327e3d6..dbd566ab72  dbd566ab729d2839c3c0be5c47cdcc06c2c477f0 -> smoke


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 10:51:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 10:51:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571429.895244 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPL3t-0006UZ-BL; Fri, 28 Jul 2023 10:51:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571429.895244; Fri, 28 Jul 2023 10:51:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPL3t-0006US-8b; Fri, 28 Jul 2023 10:51:09 +0000
Received: by outflank-mailman (input) for mailman id 571429;
 Fri, 28 Jul 2023 10:51:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=B1pf=DO=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qPL3s-0006UM-Ak
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 10:51:08 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on061e.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::61e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a6ef0621-2d34-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 12:51:06 +0200 (CEST)
Received: from AS8P189CA0005.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:31f::18)
 by DB9PR08MB7842.eurprd08.prod.outlook.com (2603:10a6:10:39d::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Fri, 28 Jul
 2023 10:51:02 +0000
Received: from AM7EUR03FT048.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:31f:cafe::2c) by AS8P189CA0005.outlook.office365.com
 (2603:10a6:20b:31f::18) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29 via Frontend
 Transport; Fri, 28 Jul 2023 10:51:02 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT048.mail.protection.outlook.com (100.127.140.86) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6631.29 via Frontend Transport; Fri, 28 Jul 2023 10:51:01 +0000
Received: ("Tessian outbound ba2f3d95109c:v145");
 Fri, 28 Jul 2023 10:51:01 +0000
Received: from 9e7da7e5c05a.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 4A2BCC80-1F4E-486B-8D3C-19C2F8990496.1; 
 Fri, 28 Jul 2023 10:50:50 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9e7da7e5c05a.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 28 Jul 2023 10:50:50 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by AS1PR08MB7401.eurprd08.prod.outlook.com (2603:10a6:20b:4c7::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Fri, 28 Jul
 2023 10:50:43 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::4c7d:6a1:e742:3b1a]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::4c7d:6a1:e742:3b1a%4]) with mapi id 15.20.6631.026; Fri, 28 Jul 2023
 10:50:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a6ef0621-2d34-11ee-b24d-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LLvh/399TfxqLw/r1YIcBUvZrJB3hPib2duIufb/5mU=;
 b=jeB1KM5/uzA29allI6KUaibDNq46h7a//JmM0VmiirXjfSiBPG+/C1vyzQKDdtKOocuUBLtgoEYQIeaHi2aJ5o6EwaZePJpb9AwUouNLTMiCKEPT44M/OFDX3jEvavu4mxwBF9xiPu2JCHoNufGgDXVMhaE7aikExMPmjiCo49Q=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 6cb8665b93df29f5
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=QCd656koi/PpHEpyJRTuFQmB1+LgXOYCaS7gkCet8areQe32fLxBg7dN64tdy6V94qzcECCBmo+y+QGieg72Nm5D40e8jeFoec/a7q0RqK1IEW15LLBp1CXD4J47LCZGKz/DcIWH2wY6NmmY0RcERNYhkZo9yxCZKiUFcKaTFyEwhCamp2CvmoFHRVZW4UzmKt6eTU+xA0iEMHGntEaeVslt6V1RGh/NPOoyYB4lmhR6u35n6fohdMBnbkvM+x9V47EsgLIspR7gYmxrIqvOEg7fTQ8vDx2NPSaep8e6Fqm4oDBwpsLhcTA3jScnJie5M92mJfKD5n8EbMxTb1wIFQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LLvh/399TfxqLw/r1YIcBUvZrJB3hPib2duIufb/5mU=;
 b=QOjXsD+pa853ON7c1NfWi2IWDo0r9FEQaOwfXAbtcd+XSSq9Ib7kHtXTbw3LJPfSjnK/q/HHaT3X7H9LXHF4uZf1Oo1Y2kcAQQlYGoqc+R1WmJ/um0/CHKGkaVBvByM3i3qAvO+TwwA06BmAFahHSmEAgUDy078a+HiAgq27lXSt5Jd+wcLrcZYa5geyvmLULXf7Bgh/dxt9EDAkn+JaT09sO4pwynBps6t2+hSacMV4Yo9JpU5YckiB2NxQ+PUfiyGCC74H4+Jc1ZIkPrwP7obnrLG4ArXBoSkbGGhte75n9h6g0JePvVOofOI5eNqEC8AxtCR6wkANlil5LWa24g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LLvh/399TfxqLw/r1YIcBUvZrJB3hPib2duIufb/5mU=;
 b=jeB1KM5/uzA29allI6KUaibDNq46h7a//JmM0VmiirXjfSiBPG+/C1vyzQKDdtKOocuUBLtgoEYQIeaHi2aJ5o6EwaZePJpb9AwUouNLTMiCKEPT44M/OFDX3jEvavu4mxwBF9xiPu2JCHoNufGgDXVMhaE7aikExMPmjiCo49Q=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Bertrand Marquis <Bertrand.Marquis@arm.com>, Wei Chen <Wei.Chen@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap
	<george.dunlap@citrix.com>, Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	=?iso-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [RFC PATCH 0/5] clang-format for Xen
Thread-Topic: [RFC PATCH 0/5] clang-format for Xen
Thread-Index: AQHZwSsi+9CDC2ydc0GfW83JpXFIW6/O9bGAgAAKo4A=
Date: Fri, 28 Jul 2023 10:50:43 +0000
Message-ID: <815F80B1-7D0A-4A1C-B3B5-E1E3D30E327C@arm.com>
References: <20230728081144.4124309-1-luca.fancellu@arm.com>
 <27a9861c-7901-d9f4-37c8-f6895aac64de@suse.com>
In-Reply-To: <27a9861c-7901-d9f4-37c8-f6895aac64de@suse.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|AS1PR08MB7401:EE_|AM7EUR03FT048:EE_|DB9PR08MB7842:EE_
X-MS-Office365-Filtering-Correlation-Id: 791a06db-382e-4e58-0a0e-08db8f5888d3
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 lp3nYAM0KMy0Uvt9JiAGP8fguLm+zNAFpcOLm+5a1KNP2VRaVfSDJYMNWJ5z+53qXOHHYK26YS9Awj3LDaQ3nWNz2Rign5xTxLLGeDlp2saY3hs7EV1GGk3TG/jRytJFvxSMw1WcKUwalGin1NJeNGshmYrk/CWyBLgxGRRVURgNV8+AnMsNKP0uoq2NNbZb1ens69CmigO3QHt5sx45hiUddmSgLuQUe5QGNxCHSw9BGWg791EuZ+p38ZxEdJ/m5dLCyX6ghLXdsXYw6o2QTdW97OHSyXanY3KtWKbjBrl3M0O+MFAS7jSRvyO0uS5NcsYmX4Px3OnLTuMSBuIZKtvmK1jROryNDC689humG1tCjmq8q5ZfCNOa7DHR2kkWjTcT1UOf2jfwTxm24pa2muH7XsGMPHuwaRaDmjuYFc4U1nbmqnSxfdXnI3+EBBcnBpy66Vp+Sds82qIa13JrmJtvYJL0Ia2wXHXakdyszKL/90E+HXlQyrBFAbPgc+ZXddiaUU5IfqOBcI2pr9J3daNnVlZIjqa65LTSXPOtj4H//C11HnXQIKJsXRPNTrjjPNK3XtetGgicVVvB5kjZDnGl3PDrt1GtfPYuHvSKK6DAU2fWTieR1kcnqsQ/vl6tPOsNAqKxXSiSe3FFEFWu+w==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(376002)(39860400002)(346002)(366004)(451199021)(54906003)(6512007)(6486002)(478600001)(186003)(71200400001)(53546011)(2616005)(66556008)(26005)(6506007)(2906002)(66476007)(316002)(64756008)(41300700001)(5660300002)(8676002)(4326008)(8936002)(76116006)(91956017)(66946007)(6916009)(66446008)(122000001)(38100700002)(86362001)(36756003)(38070700005)(33656002)(83380400001)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="iso-8859-1"
Content-ID: <DCF53F37A73E5E49A8BC921C4450B8A8@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR08MB7401
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT048.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	7c58f692-4140-4d35-dc81-08db8f587e04
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	+0pfNmk5+2LVUNXxSowEojAbZ3GxJIMsbWuhKxHMYUa2Z2jzW3WSwtHic+djsNpnaNP54HewR3kGO7Ul4sx01VgcU3svLnGr4Gvl+Dudoxek6j1CZenTvD7z94ZXmXgwGpzT70w/VkvF6cp/9koKbyerK7o3AxzpdHX6JhKdnNZVMFm0iEUUJnhnT56re0g8tCm/Y5Wo2v0CJFxaD2fo/Skpdk1zUQyCN5Z5wHQitI0uQ/7Oy0cE8A+96tsLz5F+srz0LpZRXCU71ftLbLj0y+/GvewL89VHIsB0tgtu/xpNZvgS3CDw7hwckqs2Mh3ey06y+W++Q1Fx4dydcN2quWXyyHWBrClWQPiPzBG6m3NGUxU7rZLxTrVT4UfUNrLYtD54khTE87+tHGejrBg/uo5W5f8BfS5s+1uJg+oTGOV/EQMm04Pv7FaSEatbstSWJp/9axbikltvadvUeigD73oEkcmm3OXIjDMU96wXEi2XZgq3iqCYzd+AgMxwVdeFNbD20ogb8w00KDexFD6zL2+AFuNkIOauiOZTokw9eK6jCvFoUwV9NXS2ITsBXItAaGZ/Qp5Qhrx5HWPVEk0RLSGFWuA2w5pQLaC+eImJbE9bORMp2bNDQSPnLmjXQF48YoBOxxskXOSOmJTloBLKPhlKOIFwI13eULom/+kjyroxvzEdsvDoqkFzWoQS9SMHzKoe42xPEUM5T2lFdW015DQqk81bfqdbUhBig3iqYFzKG3H+FwfojdsC1vd1lEuc
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(376002)(396003)(136003)(82310400008)(451199021)(46966006)(40470700004)(36840700001)(86362001)(41300700001)(2906002)(316002)(5660300002)(8936002)(8676002)(6862004)(33656002)(36756003)(40460700003)(40480700001)(6512007)(6506007)(53546011)(26005)(356005)(82740400003)(6486002)(478600001)(47076005)(83380400001)(36860700001)(186003)(336012)(2616005)(4326008)(81166007)(70206006)(54906003)(70586007);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2023 10:51:01.7858
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 791a06db-382e-4e58-0a0e-08db8f5888d3
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT048.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7842



> On 28 Jul 2023, at 11:12, Jan Beulich <jbeulich@suse.com> wrote:
>=20
> On 28.07.2023 10:11, Luca Fancellu wrote:
>> I've read the past threads about the brave people who dared to try to in=
troduce
>> clang-format for the xen codebase, some of them from 5 years ago, two po=
ints
>> were clear: 1) goto label needs to be indented and 2) do-while loops hav=
e the
>> braket in the same line.
>> While point 1) was quite a blocker, it seemd to me that point 2) was les=
s
>> controversial to be changed in the Xen codestyle, so the current wrapper=
 script
>> handles only the point 1 (which is easy), the point 2 can be more tricky=
 to
>> handle.
>=20
> I'm afraid I view the do/while part pretty much as a blocker as well.
> While placing the opening brace according to our style elsewhere would
> be okay-ish (just a little wasteful to have two almost empty lines),
> having the closing brace on a separate line is problematic: At least I
> consider a block / scope to end at the line where the closing brace is.
> So the farther do and while are apart, the more
>=20
>    do
>    {
>        ...;
>    }
>    while ( cond );
>    ...;
>=20
> is going to be misleading. While normally we would write potentially
> conflicting constructs this way
>=20
>    while ( cond )
>        ;
>=20
> the alternative spelling still isn't outright wrong in our style (I
> believe):
>=20
>    while ( cond );

Hi Jan,

Thank you for your feedback, I could maybe misunderstood your reply, so ple=
ase
tell me if I am wrong, the Xen coding style mandates this style for do-whil=
e loops:

do {
/* Do stuff. */
} while ( condition );

Currently clang-format is able to do only this:

do
{
/* Do stuff. */
} while ( condition );

So the issue is only in the opening brackets, not the closing one. Is it a =
blocker too?

Cheers,
Luca

>=20
> Jan



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 11:19:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 11:19:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571432.895255 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPLVC-0000pi-L8; Fri, 28 Jul 2023 11:19:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571432.895255; Fri, 28 Jul 2023 11:19:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPLVC-0000pb-IF; Fri, 28 Jul 2023 11:19:22 +0000
Received: by outflank-mailman (input) for mailman id 571432;
 Fri, 28 Jul 2023 11:19:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qPLVB-0000pV-7B
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 11:19:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPLV9-0003oc-RJ; Fri, 28 Jul 2023 11:19:19 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPLV9-00047W-Ic; Fri, 28 Jul 2023 11:19:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=CMWRqPe1E1bmdUsEzrcOGNV4qP4PJLyHt13rJGHNjTg=; b=xBZ5+Olq/aU1rzrVcpm0h0x9x+
	f69AiNiFjj9rJ1EEfkPuIeM9FAjAuKCt24LDjFjaTfkSIK4wsk9io9jqlPDoVXec7UonWLjthUO+M
	q9UPeoIBXCv2LGeLuC/Ba78cWOsrUG1aTxQYz/Sn16Y9aKv/6fMVzb7sMNiqvLIwxKj0=;
Message-ID: <b8b8e733-6be0-a4d9-33b7-d93366ec0091@xen.org>
Date: Fri, 28 Jul 2023 12:19:18 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
Content-Language: en-GB
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
 <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
 <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
 <68acbf84-218b-f2f7-9526-d9e07f845f6e@suse.com>
 <8cea1316-db0b-f29d-c467-6fd5c4a6321c@xen.org>
 <6a376365-a731-2413-16c7-14ede5224eea@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <6a376365-a731-2413-16c7-14ede5224eea@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 28/07/2023 11:47, Juergen Gross wrote:
> On 28.07.23 12:34, Julien Grall wrote:
>> Because one may want dom0 to send payload bigger than 
>> XENSTORE_PAYLOAD_MAX. Something like:
>>
>> if ( conn->id != 0 && len < XENSTORE_PAYLOAD_MAX )
>>
>> Such change would not be caught during compilation. AWS has a similar 
>> check in the downstream tree because the implementation of 
>> non-cooperative migration is using Xenstore command and we want to be 
>> able to transfer the state in a single command.
> 
> And how directly is this related to the max data size of node contents?

I think you missed my point. Until this patch, the existing field would 
be able to accomodate very large payload. This doesn't hold anymore.

What I was trying to convey is that anyone looking at relaxing the check 
in handle_input() needs to be able to find "easily" that other part of 
Xenstored are making some assumption based on the maximum length.

> 
> As soon as you are allowing dom0 to write larger nodes, you are risking to
> kill client connections trying to read such a node. So the node size should
> still be limited to XENSTORE_PAYLOAD_MAX.
> 
> IMO another reason to use the placement I've suggested.

I agree that BUILD_BUG_ON() makes sense where you suggest if you think 
about where the runtime check would happen.

It seems like we have two different aims here. Mine is to make sure we 
make it more difficult to introduce a security hole if the lenght check 
is relaxed.

I have made a proposal below that may suit both our aim.

> AWS should even add
> a size check when writing nodes to make sure dom0 doesn't do evil things.

What make you think we don't already have such checked? ;)

Also, I noticed you mention about datalen. What about the number of 
permissions?

> 
>>
>>> In case of a runtime check I
>>> agree that a more central place would be preferred.
>>>
>>> In the end I don't mind that much, but
>>>
>>> Â Â Â Â Â BUILD_BUG_ON(XENSTORE_PAYLOAD_MAX >=
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  (typeof((struct node_hdr *)NULL->datalen))(-1));
>>>
>>> is a little bit clumsy IMHO.
>>
>> Agree. We could introduce FIELD_SIZEOF() (as Linux did) to hide the 
>> complexity. The code would then look like:
>>
>> Â >= (8 * FIELD_SIZEOF(struct node_hdr, datalen))
> 
> Oh, I guess you mean sizeof_field().
> 
> And even with that it would look quite clumsy:
> 
>  Â Â Â Â BUILD_BUG_ON(XENSTORE_PAYLOAD_MAX >=
>  Â Â Â Â Â Â Â Â Â Â Â Â  (1UL << (8 * sizeof_field(struct node_hdr, datalen))));

How about keeping the BUILD_BUG_ON() in write_node_raw() and add the 
following comment on top of handle_input():

Some fields in Xenstored are sized based on the max payload (see various 
BUILD_BUG_ON()). This would need extra runtime check if we ever decide 
to have a dynamic payload size.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 11:36:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 11:36:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571434.895264 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPLlU-0003Ha-W6; Fri, 28 Jul 2023 11:36:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571434.895264; Fri, 28 Jul 2023 11:36:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPLlU-0003HT-TW; Fri, 28 Jul 2023 11:36:12 +0000
Received: by outflank-mailman (input) for mailman id 571434;
 Fri, 28 Jul 2023 11:36:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=wghk=DO=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qPLlU-0003HN-2J
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 11:36:12 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on20612.outbound.protection.outlook.com
 [2a01:111:f400:fe16::612])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f1678e2d-2d3a-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 13:36:08 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB7668.eurprd04.prod.outlook.com (2603:10a6:20b:2dd::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Fri, 28 Jul
 2023 11:36:05 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Fri, 28 Jul 2023
 11:36:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f1678e2d-2d3a-11ee-b24d-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=NjpN5HRaxRAZ09QcjMibceZpKljDkOvSWWO25z8wnndoXBzI6a+2N+V/w0jSV+bWRY7WzjKJzPZqNsQuf5bm5TA9n2KUyLfPMm66bqHs6+LTm6Z32pHzUqCMBhs/ucf2YXhuaW0xEvQGEtCu0fZzjhb7g5RBaRIZDoRCDEicjJrBYhOvnZe52c0Ft5vEIjldOKCloHmEZnEwGl9Ctk74aSAW5WaCtPO1sRrXAS1tMYEMaoW5Ah9X+8tfTKnLqhjegBKpxiwMM6Q3p8Fc08QNpWLVj6mQn48s0R/QeK0jy0HmMmJl6aRyhKOV4jmZVH0PESrKT/Tr8m8A+zXmUS2CLQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ktfLmxlXK57bO+MJWojIhxJvX7c3Pcq7960V1SSpI80=;
 b=ZiOJsUo0MQy9cgq52dZvnw5eOyRuxw5FWrerURdpHSW0fNV/FL3WW3CNiJ2Ad33NnXKUl5xsdL9s0kj/1hOjxGElLcMxvEJRD2QcR191FMsoCwQJvkVnsQAmNEULV+cHD+HLGb9XG9aGNZ47QXP9o9EthCjO3tv+kKAHrjlJwGIa487U4kcVGGv2VIcCHIihcLLG9nekeyoy6FWl6CFTF1MlfkOgn+LXR+d6cN9fcSUGbSPVUTDowKrB78Dd9IrNMyfb1zHrlu8/L0DIUAKyNMP98z8KaxAX4sHOyJGq9r90d/XNtfYr/KaAubUnAqdW1yPuT8HcEJniheDEvoTbcQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ktfLmxlXK57bO+MJWojIhxJvX7c3Pcq7960V1SSpI80=;
 b=B5AWXt5B6eH+bqW51HeK4OgHjlRXf7/Ks2xi3I+tSRZO+6f12Xb9ZbViQrjUcoVHuJtCx4owK8yfA9mL66CzXb8+p57GdLuM7deBCe4/2fFQBpSpEQB4h5NTBT0fpaVNeYpZIxKG2OzWkJYwGUoInD14eIjrYikNZ/V7eMM8cUI2sjMi/ZIcxlqw/IRANRXEx9iDB7r6houPFv46Ztrp9m+BHj9bw3tbQa5PwPjKD2naLBCM3JJoQSjYnlVg+UMDaYMhn3GkjiYrsw+I86V1YDX/HsM46KK/6aHBb5GjjZuCEbLwPx5RMA9s0US5KeuAOSKXNUwkrr9gIjJ6Zw4h/Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <bf7964bd-be34-47f8-ffc7-67e34e779aac@suse.com>
Date: Fri, 28 Jul 2023 13:36:02 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [RFC PATCH 0/5] clang-format for Xen
Content-Language: en-US
To: Luca Fancellu <Luca.Fancellu@arm.com>
Cc: Bertrand Marquis <Bertrand.Marquis@arm.com>, Wei Chen <Wei.Chen@arm.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20230728081144.4124309-1-luca.fancellu@arm.com>
 <27a9861c-7901-d9f4-37c8-f6895aac64de@suse.com>
 <815F80B1-7D0A-4A1C-B3B5-E1E3D30E327C@arm.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <815F80B1-7D0A-4A1C-B3B5-E1E3D30E327C@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0127.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9e::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB7668:EE_
X-MS-Office365-Filtering-Correlation-Id: 22863a82-9eda-4ab5-0823-08db8f5ed405
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	CnjKXL6Ifz+jAhFqQmgfZW3W05YHlLBelzo0g61kRLxlygnUsS+2lwoaWOurCLzZ0pTWNhjXO60UMuh0dqPPf2EZO3wx9ax29qwLOzOVfmGC0IbKj1CyyOoVCfaqIaZKfuN67SSYtOE9qi6yCamu7J1H6ylyn6LS4JM0cONzr31cdTPdgVEhyHtkGnXCVXrWw+nepE3E+lhSytu5i+VpyKdLDmWC/karco6M42AOus08fsVhiTrwKdL4l7c7yNyL/OUOM6x37qojLnzlaRn8bdUqW4M4XIXYYw2JXdf7AOdcxzTty5PwrwDpBST4qNzhdnnfdUD+BS5PCaAAxIWtf0phvIenhFcFp/ssGsCKdHL1KndZ3LKDuuIPetUFijxL0Tm78H+6lPTHM7w9LevNQCnwgVktix/TqbrmF/BcGpE7MP4+dDznTSodvn5Ll+ezNujblr6xhwPiwlLHKr2cmBo4UTlKroirAFYoA2DNz3hqZtfQl5HzWjQSfy14c9ni2oUbyIyDpnK16HBuP7j/BmLn2uMhtV4NZfSnreGu38W7UKDMZPXLltzMl1xPYdDNlGdMSmFg38BU6rRwgUNemZ9x9+rzvCGXyToZB3ap+v0vF5uoSQe9EfByV3MZMp5VjF7wGM1bwO7vtgw8Un9gsA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(136003)(39860400002)(396003)(376002)(346002)(451199021)(83380400001)(31686004)(54906003)(31696002)(478600001)(2616005)(8936002)(8676002)(5660300002)(7416002)(41300700001)(36756003)(2906002)(6506007)(316002)(66946007)(38100700002)(86362001)(66476007)(66556008)(4326008)(6916009)(26005)(186003)(53546011)(6486002)(6666004)(6512007)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NUMvdDJ3RVhKMTNnS0hsZ0N3eW9hRUZ1YVRRbzNvdzMzK1FhZjhTWHRaMEpS?=
 =?utf-8?B?SFhBYnRBblRwaHRucFZzVnJISVA2cHZKVm5wdVcyL3pJZ1ZYMWhJUmdBSmE5?=
 =?utf-8?B?Vktmc2w1OC9Gd21CaXFEMTFJUjdZcVBtVWZ0Y3VkNFN2SDU4b1FnT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UUxbUVQTFVj?=
 =?utf-8?B?UXlUa1FoUGJYRUZ4alBTSi9MYjlhNE9NL0pKVm5rQ0JlYUZ1SXZpVURHRUZZ?=
 =?utf-8?B?M1ZQN0owZUxqTWQ2VkhEUmljUDByY0tWQUtRT3FaeGo3QTJnaWE2TGFXRExn?=
 =?utf-8?B?MWhJMjVWY21lcXhQVUtFL0dyTlU3d2VaRmcyOWV6TmpqZGVnZE9kZEx2OUgy?=
 =?utf-8?Q?K2bFFcUmfmh6coSH2DNOIkd3O?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 22863a82-9eda-4ab5-0823-08db8f5ed405
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2023 11:36:05.1660
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 4D/ypZeF+whuN55GZ3w8/BBkcPUPejellac5r0rdDRBRYavcDkJMzEPUh2aXD16wTckfAelLhN7/Q4gzxBf9Sg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7668

On 28.07.2023 12:50, Luca Fancellu wrote:
> 
> 
>> On 28 Jul 2023, at 11:12, Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 28.07.2023 10:11, Luca Fancellu wrote:
>>> I've read the past threads about the brave people who dared to try to introduce
>>> clang-format for the xen codebase, some of them from 5 years ago, two points
>>> were clear: 1) goto label needs to be indented and 2) do-while loops have the
>>> braket in the same line.
>>> While point 1) was quite a blocker, it seemd to me that point 2) was less
>>> controversial to be changed in the Xen codestyle, so the current wrapper script
>>> handles only the point 1 (which is easy), the point 2 can be more tricky to
>>> handle.
>>
>> I'm afraid I view the do/while part pretty much as a blocker as well.
>> While placing the opening brace according to our style elsewhere would
>> be okay-ish (just a little wasteful to have two almost empty lines),
>> having the closing brace on a separate line is problematic: At least I
>> consider a block / scope to end at the line where the closing brace is.
>> So the farther do and while are apart, the more
>>
>>    do
>>    {
>>        ...;
>>    }
>>    while ( cond );
>>    ...;
>>
>> is going to be misleading. While normally we would write potentially
>> conflicting constructs this way
>>
>>    while ( cond )
>>        ;
>>
>> the alternative spelling still isn't outright wrong in our style (I
>> believe):
>>
>>    while ( cond );
> 
> Hi Jan,
> 
> Thank you for your feedback, I could maybe misunderstood your reply, so please
> tell me if I am wrong, the Xen coding style mandates this style for do-while loops:
> 
> do {
> /* Do stuff. */
> } while ( condition );
> 
> Currently clang-format is able to do only this:
> 
> do
> {
> /* Do stuff. */
> } while ( condition );

Oh, I hadn't understood your description that way.

> So the issue is only in the opening brackets, not the closing one. Is it a blocker too?

No. I don't like the longer form, but I could live with it.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 11:46:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 11:46:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571436.895275 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPLuv-0004o3-Qw; Fri, 28 Jul 2023 11:45:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571436.895275; Fri, 28 Jul 2023 11:45:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPLuv-0004nw-OE; Fri, 28 Jul 2023 11:45:57 +0000
Received: by outflank-mailman (input) for mailman id 571436;
 Fri, 28 Jul 2023 11:45:56 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=6gb0=DO=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qPLuu-0004nq-K1
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 11:45:56 +0000
Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com
 [2a00:1450:4864:20::131])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4fd1960c-2d3c-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 13:45:55 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-4fe0e23a4b1so3478538e87.3
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 04:45:55 -0700 (PDT)
Received: from EMEAENGAAD19049. ([2.223.46.215])
 by smtp.gmail.com with ESMTPSA id
 l17-20020a7bc451000000b003fc17e8a1efsm6700834wmi.45.2023.07.28.04.45.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 28 Jul 2023 04:45:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4fd1960c-2d3c-11ee-b24d-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690544755; x=1691149555;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=fRhkSPt9qHiPgYCQ1t3y4EbA5p/iqPHwLpK8iS+NFhw=;
        b=c904X/u4C3i/J0t8RHh0JGgQQ0rlgrGjXSd7RFQgpArsleRTYCJxcEAplsQ1zjyjsT
         PjKTMY2lw7xU1yp0S2S8gKmn7UjJjac6KWEP+cKs+8ZkTE3CAgNk9idI+2mbMG2qj79M
         fStqgdnNyQnf5ItzcdKvjpzoeOdOO8j6kvazo=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690544755; x=1691149555;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=fRhkSPt9qHiPgYCQ1t3y4EbA5p/iqPHwLpK8iS+NFhw=;
        b=G7c/tLFOwjAaCf1y7vZv4LDJ7aOSJkSNlSnehOKY2D6foWC87ocpDXosZIn7aIoCu4
         8K3IJM47NL1zIQdfz8h4h0aKQzfQev3aOgqD0hprq/5i+8N5z+ObLk8/iRHGpCT4+IDj
         2BKBt0ffC2uUZpVda3i3OZ9/0/0t3Vdtl4TfRl9TcJKiwCHBkzVfyGRUs2CwaGrCSk3h
         z7lcMpXe+34EjXILSy5UoXD529bDmE7a4UNyZve4KAClypNSEkbUiA+Vn0NHxNdrCmD/
         FqeTbUVgDnZgdVYNMvGo5yWDzd+H+voWVTxqnz4kprmxYMj7/kZqrgay+sLgXXh0yyoj
         UD1Q==
X-Gm-Message-State: ABy/qLafflbW0yLr1Og6ShU/fshlKbbyCHXVgiKNKTptpureEgH/T+tQ
	Br2OPx4qVUbeadXJtztOck78hA==
X-Google-Smtp-Source: APBJJlFu5CYyX94g0/93Uwds26/Ul2qwddVw7oSE33NERPqjn76D3S5XW53h1ILrIj65T14QjBiQHQ==
X-Received: by 2002:a05:6512:2034:b0:4fe:e8f:e216 with SMTP id s20-20020a056512203400b004fe0e8fe216mr1376382lfs.39.1690544755077;
        Fri, 28 Jul 2023 04:45:55 -0700 (PDT)
Message-ID: <64c3aa72.7b0a0220.ec31.f864@mx.google.com>
X-Google-Original-Message-ID: <ZMOqaF666Ov3TtnQ@EMEAENGAAD19049.>
Date: Fri, 28 Jul 2023 12:45:44 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v6 1/3] x86/microcode: Ignore microcode loading interface
 for revision = -1
References: <20230724165235.25262-1-alejandro.vallejo@cloud.com>
 <20230724165235.25262-2-alejandro.vallejo@cloud.com>
 <4a31893d-a784-ed33-bd47-5db85b3c02b6@suse.com>
 <64bfc52e.050a0220.14646.cb0d@mx.google.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <64bfc52e.050a0220.14646.cb0d@mx.google.com>

On Tue, Jul 25, 2023 at 01:50:52PM +0100, Alejandro Vallejo wrote:
> On Tue, Jul 25, 2023 at 08:40:31AM +0200, Jan Beulich wrote:
> > > --- a/xen/arch/x86/cpu/microcode/core.c
> > > +++ b/xen/arch/x86/cpu/microcode/core.c
> > > @@ -867,10 +867,23 @@ int __init early_microcode_init(unsigned long *module_map,
> > >          return -ENODEV;
> > >      }
> > >  
> > > -    microcode_grab_module(module_map, mbi);
> > > -
> > >      ucode_ops.collect_cpu_info();
> > >  
> > > +    /*
> > > +     * Some hypervisors deliberately report a microcode revision of -1 to
> > > +     * mean that they will not accept microcode updates. We take the hint
> > > +     * and ignore the microcode interface in that case.
> > > +     */
> > > +    if ( this_cpu(cpu_sig).rev == ~0 )
> > > +    {
> > > +        printk(XENLOG_INFO "Microcode loading disabled due to: %s",
> > 
> [snip]
>
> > As it stands this message
> > will be invisible by default.
> Arguably, that's not necessarily a bad thing. The fact that microcode
> cannot be updated is expected behaviour and it makes little sense to warn
> about it. If only because they should already be aware of it through their
> agreement with their provider.
> 
> The case I can think of where a warning would be sensible is where the
> system has a microcode blob more recent than the currently installed
> revision. This is something the admin may want to be aware of in order to
> pester their provider for updates. In the common case the machine won't
> even need such an update, so sending unconditional warnings per boot seems
> unwarranted.

Actually, the previous message probably ought to be an INFO too. It's an
unconditional warning on old AMD and anything non AMD/Intel for no good
reason.

Alejandro


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 11:50:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 11:50:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571440.895297 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPLzV-0006Si-4x; Fri, 28 Jul 2023 11:50:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571440.895297; Fri, 28 Jul 2023 11:50:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPLzU-0006Rq-VC; Fri, 28 Jul 2023 11:50:40 +0000
Received: by outflank-mailman (input) for mailman id 571440;
 Fri, 28 Jul 2023 11:50:40 +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
 <SRS0=8l51=DO=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qPLzU-0006Fz-A2
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 11:50:40 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f7195ab6-2d3c-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 13:50:38 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.163.4.37])
 by support.bugseng.com (Postfix) with ESMTPSA id AAD204EE073F;
 Fri, 28 Jul 2023 13:50:34 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f7195ab6-2d3c-11ee-8613-37d641c3527e
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Wei Liu <wl@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [XEN PATCH v2 0/2] IRQ: address violations of MISRA C:2012 Rules 8.2 and 8.3
Date: Fri, 28 Jul 2023 13:49:00 +0200
Message-Id: <cover.1690544434.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This patch series addresses violations of rules 8.2 and 8.3 related to the IRQ
module.
No functional changes.

Federico Serafini (2):
  xen/IRQ: address violations of MISRA C: 2012 Rules 8.2 and 8.3
  x86/IRQ: address violations of MISRA C: 2012 Rules 8.2 and 8.3

 xen/arch/arm/irq.c             |  2 +-
 xen/arch/x86/include/asm/irq.h | 30 ++++++++++++-------------
 xen/arch/x86/irq.c             |  4 ++--
 xen/include/xen/irq.h          | 41 +++++++++++++++++-----------------
 xen/include/xen/softirq.h      |  2 +-
 5 files changed, 40 insertions(+), 39 deletions(-)

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 11:50:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 11:50:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571439.895290 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPLzU-0006Mb-Pf; Fri, 28 Jul 2023 11:50:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571439.895290; Fri, 28 Jul 2023 11:50:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPLzU-0006L8-Me; Fri, 28 Jul 2023 11:50:40 +0000
Received: by outflank-mailman (input) for mailman id 571439;
 Fri, 28 Jul 2023 11:50:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8l51=DO=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qPLzT-0006Fq-Oc
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 11:50:39 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f8112332-2d3c-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 13:50:38 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.163.4.37])
 by support.bugseng.com (Postfix) with ESMTPSA id 32FB04EE0742;
 Fri, 28 Jul 2023 13:50:37 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f8112332-2d3c-11ee-b24d-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH v2 2/2] x86/IRQ: address violations of MISRA C: 2012 Rules 8.2 and 8.3
Date: Fri, 28 Jul 2023 13:49:02 +0200
Message-Id: <da6fc50b926e72b497db251ca640c60244db3632.1690544434.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690544434.git.federico.serafini@bugseng.com>
References: <cover.1690544434.git.federico.serafini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Give a name to unnamed parameters thus addressing violations of
MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
named parameters").
Keep consistency between parameter names and types used in function
declarations and the ones used in the corresponding function
definitions, thus addressing violations of MISRA C:2012 Rule 8.3
("All declarations of an object or function shall use the same names
and type qualifiers").

No functional changes

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
Changes in v2:
  - use 'pirq' instead of 'irq';
  - removed changes involving function pointers.
---
 xen/arch/x86/include/asm/irq.h | 30 +++++++++++++++---------------
 xen/arch/x86/irq.c             |  4 ++--
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/include/asm/irq.h b/xen/arch/x86/include/asm/irq.h
index 3f95dd39b7..ad907fc97f 100644
--- a/xen/arch/x86/include/asm/irq.h
+++ b/xen/arch/x86/include/asm/irq.h
@@ -107,12 +107,12 @@ void alloc_direct_apic_vector(
 
 void do_IRQ(struct cpu_user_regs *regs);
 
-void cf_check disable_8259A_irq(struct irq_desc *);
-void cf_check enable_8259A_irq(struct irq_desc *);
+void cf_check disable_8259A_irq(struct irq_desc *desc);
+void cf_check enable_8259A_irq(struct irq_desc *desc);
 int i8259A_irq_pending(unsigned int irq);
 void mask_8259A(void);
 void unmask_8259A(void);
-void init_8259A(int aeoi);
+void init_8259A(int auto_eoi);
 void make_8259A_irq(unsigned int irq);
 bool bogus_8259A_irq(unsigned int irq);
 int i8259A_suspend(void);
@@ -142,15 +142,15 @@ struct arch_pirq {
 #define pirq_dpci(pirq) ((pirq) ? &(pirq)->arch.hvm.dpci : NULL)
 #define dpci_pirq(pd) container_of(pd, struct pirq, arch.hvm.dpci)
 
-int pirq_shared(struct domain *d , int irq);
+int pirq_shared(struct domain *d , int pirq);
 
 int map_domain_pirq(struct domain *d, int pirq, int irq, int type,
                            void *data);
 int unmap_domain_pirq(struct domain *d, int pirq);
 int get_free_pirq(struct domain *d, int type);
-int get_free_pirqs(struct domain *, unsigned int nr);
+int get_free_pirqs(struct domain *d, unsigned int nr);
 void free_domain_pirqs(struct domain *d);
-int map_domain_emuirq_pirq(struct domain *d, int pirq, int irq);
+int map_domain_emuirq_pirq(struct domain *d, int pirq, int emuirq);
 int unmap_domain_pirq_emuirq(struct domain *d, int pirq);
 
 /* Reset irq affinities to match the given CPU mask. */
@@ -168,9 +168,9 @@ int irq_to_vector(int irq);
  */
 int create_irq(nodeid_t node, bool grant_access);
 void destroy_irq(unsigned int irq);
-int assign_irq_vector(int irq, const cpumask_t *);
+int assign_irq_vector(int irq, const cpumask_t *mask);
 
-void cf_check irq_complete_move(struct irq_desc *);
+void cf_check irq_complete_move(struct irq_desc *desc);
 
 extern struct irq_desc *irq_desc;
 
@@ -179,16 +179,16 @@ void unlock_vector_lock(void);
 
 void setup_vector_irq(unsigned int cpu);
 
-void move_native_irq(struct irq_desc *);
-void move_masked_irq(struct irq_desc *);
+void move_native_irq(struct irq_desc *desc);
+void move_masked_irq(struct irq_desc *desc);
 
-int bind_irq_vector(int irq, int vector, const cpumask_t *);
+int bind_irq_vector(int irq, int vector, const cpumask_t *mask);
 
-void cf_check end_nonmaskable_irq(struct irq_desc *, uint8_t vector);
-void irq_set_affinity(struct irq_desc *, const cpumask_t *mask);
+void cf_check end_nonmaskable_irq(struct irq_desc *desc, uint8_t vector);
+void irq_set_affinity(struct irq_desc *desc, const cpumask_t *mask);
 
-int init_domain_irq_mapping(struct domain *);
-void cleanup_domain_irq_mapping(struct domain *);
+int init_domain_irq_mapping(struct domain *d);
+void cleanup_domain_irq_mapping(struct domain *d);
 
 #define domain_pirq_to_irq(d, pirq) pirq_field(d, pirq, arch.irq, 0)
 #define domain_irq_to_pirq(d, irq) ({                           \
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 20150b1c7f..6abfd81621 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -177,7 +177,7 @@ static int __init _bind_irq_vector(struct irq_desc *desc, int vector,
     return 0;
 }
 
-int __init bind_irq_vector(int irq, int vector, const cpumask_t *cpu_mask)
+int __init bind_irq_vector(int irq, int vector, const cpumask_t *mask)
 {
     struct irq_desc *desc = irq_to_desc(irq);
     unsigned long flags;
@@ -187,7 +187,7 @@ int __init bind_irq_vector(int irq, int vector, const cpumask_t *cpu_mask)
 
     spin_lock_irqsave(&desc->lock, flags);
     spin_lock(&vector_lock);
-    ret = _bind_irq_vector(desc, vector, cpu_mask);
+    ret = _bind_irq_vector(desc, vector, mask);
     spin_unlock(&vector_lock);
     spin_unlock_irqrestore(&desc->lock, flags);
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 11:50:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 11:50:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571438.895285 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPLzU-0006GG-De; Fri, 28 Jul 2023 11:50:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571438.895285; Fri, 28 Jul 2023 11:50:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPLzU-0006G5-Al; Fri, 28 Jul 2023 11:50:40 +0000
Received: by outflank-mailman (input) for mailman id 571438;
 Fri, 28 Jul 2023 11:50:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8l51=DO=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qPLzT-0006Fq-2g
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 11:50:39 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f7a6a49d-2d3c-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 13:50:37 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.163.4.37])
 by support.bugseng.com (Postfix) with ESMTPSA id 0BD564EE0741;
 Fri, 28 Jul 2023 13:50:35 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f7a6a49d-2d3c-11ee-b24d-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH v2 1/2] xen/IRQ: address violations of MISRA C: 2012 Rules 8.2 and 8.3
Date: Fri, 28 Jul 2023 13:49:01 +0200
Message-Id: <6a72c66e2bfd83ca92c1fd9c702f6125d27062b1.1690544434.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690544434.git.federico.serafini@bugseng.com>
References: <cover.1690544434.git.federico.serafini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Give a name to unnamed parameters thus addressing violations of
MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
named parameters").
Keep consistency between parameter names and types used in function
declarations and the ones used in the corresponding function
definitions, thus addressing violations of MISRA C:2012 Rule 8.3
("All declarations of an object or function shall use the same names
and type qualifiers").

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
Changes in v2:
  - use 'pirq' instead of 'irq';
  - removed changes involving function pointers.
---
 xen/arch/arm/irq.c        |  2 +-
 xen/include/xen/irq.h     | 41 ++++++++++++++++++++-------------------
 xen/include/xen/softirq.h |  2 +-
 3 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 16e56f8945..054bb281d8 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -58,7 +58,7 @@ hw_irq_controller no_irq_type = {
 static irq_desc_t irq_desc[NR_IRQS];
 static DEFINE_PER_CPU(irq_desc_t[NR_LOCAL_IRQS], local_irq_desc);
 
-irq_desc_t *__irq_to_desc(int irq)
+struct irq_desc *__irq_to_desc(int irq)
 {
     if ( irq < NR_LOCAL_IRQS )
         return &this_cpu(local_irq_desc)[irq];
diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index 300625e56d..9747e818f7 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -110,22 +110,22 @@ typedef struct irq_desc {
 #define irq_to_desc(irq)    (&irq_desc[irq])
 #endif
 
-int init_one_irq_desc(struct irq_desc *);
-int arch_init_one_irq_desc(struct irq_desc *);
+int init_one_irq_desc(struct irq_desc *desc);
+int arch_init_one_irq_desc(struct irq_desc *desc);
 
 #define irq_desc_initialized(desc) ((desc)->handler != NULL)
 
 extern int setup_irq(unsigned int irq, unsigned int irqflags,
-                     struct irqaction *);
+                     struct irqaction *new);
 extern void release_irq(unsigned int irq, const void *dev_id);
 extern int request_irq(unsigned int irq, unsigned int irqflags,
                void (*handler)(int, void *, struct cpu_user_regs *),
-               const char * devname, void *dev_id);
+               const char *devname, void *dev_id);
 
 extern hw_irq_controller no_irq_type;
 void cf_check no_action(int cpl, void *dev_id, struct cpu_user_regs *regs);
-unsigned int cf_check irq_startup_none(struct irq_desc *);
-void cf_check irq_actor_none(struct irq_desc *);
+unsigned int cf_check irq_startup_none(struct irq_desc *desc);
+void cf_check irq_actor_none(struct irq_desc *desc);
 #define irq_shutdown_none irq_actor_none
 #define irq_disable_none irq_actor_none
 #define irq_enable_none irq_actor_none
@@ -146,7 +146,7 @@ struct pirq {
 #define pirq_info(d, p) ((struct pirq *)radix_tree_lookup(&(d)->pirq_tree, p))
 
 /* Use this instead of pirq_info() if the structure may need allocating. */
-extern struct pirq *pirq_get_info(struct domain *, int pirq);
+extern struct pirq *pirq_get_info(struct domain *d, int pirq);
 
 #define pirq_field(d, p, f, def) ({ \
     const struct pirq *__pi = pirq_info(d, p); \
@@ -155,30 +155,31 @@ extern struct pirq *pirq_get_info(struct domain *, int pirq);
 #define pirq_to_evtchn(d, pirq) pirq_field(d, pirq, evtchn, 0)
 #define pirq_masked(d, pirq) pirq_field(d, pirq, masked, 0)
 
-void pirq_cleanup_check(struct pirq *, struct domain *);
+void pirq_cleanup_check(struct pirq *pirq, struct domain *d);
 
 #define pirq_cleanup_check(pirq, d) \
     ((pirq)->evtchn ? pirq_cleanup_check(pirq, d) : (void)0)
 
-extern void pirq_guest_eoi(struct pirq *);
-extern void desc_guest_eoi(struct irq_desc *, struct pirq *);
+extern void pirq_guest_eoi(struct pirq *pirq);
+extern void desc_guest_eoi(struct irq_desc *desc, struct pirq *pirq);
 extern int pirq_guest_unmask(struct domain *d);
-extern int pirq_guest_bind(struct vcpu *, struct pirq *, int will_share);
-extern void pirq_guest_unbind(struct domain *d, struct pirq *);
-extern void pirq_set_affinity(struct domain *d, int irq, const cpumask_t *);
-extern irq_desc_t *domain_spin_lock_irq_desc(
-    struct domain *d, int irq, unsigned long *pflags);
-extern irq_desc_t *pirq_spin_lock_irq_desc(
-    const struct pirq *, unsigned long *pflags);
+extern int pirq_guest_bind(struct vcpu *v, struct pirq *pirq, int will_share);
+extern void pirq_guest_unbind(struct domain *d, struct pirq *pirq);
+extern void pirq_set_affinity(struct domain *d, int pirq,
+                              const cpumask_t *mask);
+extern struct irq_desc *domain_spin_lock_irq_desc(
+    struct domain *d, int pirq, unsigned long *pflags);
+extern struct irq_desc *pirq_spin_lock_irq_desc(
+    const struct pirq *pirq, unsigned long *pflags);
 
-unsigned int set_desc_affinity(struct irq_desc *, const cpumask_t *);
+unsigned int set_desc_affinity(struct irq_desc *desc, const cpumask_t *mask);
 
 #ifndef arch_hwdom_irqs
-unsigned int arch_hwdom_irqs(domid_t);
+unsigned int arch_hwdom_irqs(domid_t domid);
 #endif
 
 #ifndef arch_evtchn_bind_pirq
-void arch_evtchn_bind_pirq(struct domain *, int pirq);
+void arch_evtchn_bind_pirq(struct domain *d, int pirq);
 #endif
 
 #endif /* __XEN_IRQ_H__ */
diff --git a/xen/include/xen/softirq.h b/xen/include/xen/softirq.h
index 1f6c4783da..33d6f2ecd2 100644
--- a/xen/include/xen/softirq.h
+++ b/xen/include/xen/softirq.h
@@ -26,7 +26,7 @@ typedef void (*softirq_handler)(void);
 void do_softirq(void);
 void open_softirq(int nr, softirq_handler handler);
 
-void cpumask_raise_softirq(const cpumask_t *, unsigned int nr);
+void cpumask_raise_softirq(const cpumask_t *mask, unsigned int nr);
 void cpu_raise_softirq(unsigned int cpu, unsigned int nr);
 void raise_softirq(unsigned int nr);
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 11:52:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 11:52:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571448.895315 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPM1V-0007wF-DC; Fri, 28 Jul 2023 11:52:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571448.895315; Fri, 28 Jul 2023 11:52:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPM1V-0007w8-AC; Fri, 28 Jul 2023 11:52:45 +0000
Received: by outflank-mailman (input) for mailman id 571448;
 Fri, 28 Jul 2023 11:52:43 +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
 <SRS0=C9jx=DO=arm.com=peter.hoyes@srs-se1.protection.inumbo.net>)
 id 1qPM1T-0007w0-O8
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 11:52:43 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTP
 id 4115fa61-2d3d-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 13:52:40 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 005492F4;
 Fri, 28 Jul 2023 04:53:23 -0700 (PDT)
Received: from e125920.arm.com (unknown [10.57.89.225])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 415903F6C4;
 Fri, 28 Jul 2023 04:52:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4115fa61-2d3d-11ee-8613-37d641c3527e
From: Peter Hoyes <peter.hoyes@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com,
	wei.chen@arm.com,
	luca.fancellu@arm.com,
	Peter Hoyes <Peter.Hoyes@arm.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v7] xl: Add escape character argument to xl console
Date: Fri, 28 Jul 2023 12:52:21 +0100
Message-Id: <20230728115221.904230-1-peter.hoyes@arm.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Peter Hoyes <Peter.Hoyes@arm.com>

Add -e argument to xl console and pass to new escape_character argument
of libxl_console_exec.

Introduce a new API version to support this new argument and advertise
the new functionality in libxl.h

In libxl_console_exec, there are currently two call sites to execl,
which uses varargs, in order to support optionally passing
'start-notify-fd' to the console client. In order to support passing
the 'escape' argument optionally too, refactor to instead have a single
call site to execv, which has the same behavior but takes an array of
arguments.

If -e is not specified, --escape is not passed to the console client and
the existing value (^]) is used as a default.

Update the xl docs.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
---
Changes in v7:
- Fix comment style in libxl_console_exec again

Changes in v6:
- Fix the new compatiblity functions to use last presented version
- Fix the arguments of the existing compatibility function

Changes in v5:
- Add this changelog
- Fix comment style in libxl_console_exec

Changes in v4:
- Document xl console -e argument in xl.1.pod.in
- Add changes for libxl API version compatibility

Changes in v3:
- Re-add the Reviewed-By tag accidentally removed in v2

Changes in v2:
- Drop the tags intended only for internal use at Arm

 docs/man/xl.1.pod.in             |  8 +++++-
 tools/include/libxl.h            | 43 ++++++++++++++++++++++++++++----
 tools/libs/light/libxl_console.c | 30 ++++++++++++++++------
 tools/xl/xl_cmdtable.c           |  3 ++-
 tools/xl/xl_console.c            | 10 +++++---
 tools/xl/xl_vmcontrol.c          |  2 +-
 6 files changed, 77 insertions(+), 19 deletions(-)

diff --git a/docs/man/xl.1.pod.in b/docs/man/xl.1.pod.in
index 101e14241d..9ba22a8fa2 100644
--- a/docs/man/xl.1.pod.in
+++ b/docs/man/xl.1.pod.in
@@ -222,7 +222,8 @@ Attach to the console of a domain specified by I<domain-id>.  If you've set up
 your domains to have a traditional login console this will look much like a
 normal text login screen.
 
-Use the key combination Ctrl+] to detach from the domain console.
+Use the escape character key combination (default Ctrl+]) to detach from the
+domain console.
 
 B<OPTIONS>
 
@@ -239,6 +240,11 @@ emulated serial for HVM guests and PV console for PV guests.
 
 Connect to console number I<NUM>. Console numbers start from 0.
 
+=item I<-e escapechar>
+
+Customize the escape sequence used to detach from the domain console to
+I<escapechar>. If not specified, the value "^]" is used.
+
 =back
 
 =item B<destroy> [I<OPTIONS>] I<domain-id>
diff --git a/tools/include/libxl.h b/tools/include/libxl.h
index cac641a7eb..de29f11bc9 100644
--- a/tools/include/libxl.h
+++ b/tools/include/libxl.h
@@ -81,6 +81,15 @@
  */
 #define LIBXL_HAVE_CONSOLE_NOTIFY_FD 1
 
+/* LIBXL_HAVE_CONSOLE_ESCAPE_CHARACTER
+ *
+ * If this is defined, libxl_console_exec and
+ * libxl_primary_console_exe take an escape_character parameter. That
+ * parameter will be used to modify the escape sequence used to exit the
+ * console.
+ */
+#define LIBXL_HAVE_CONSOLE_ESCAPE_CHARACTER 1
+
 /* LIBXL_HAVE_CONST_COPY_AND_LENGTH_FUNCTIONS
  *
  * If this is defined, the copy functions have constified src parameter and the
@@ -790,7 +799,8 @@ typedef struct libxl__ctx libxl_ctx;
 #if LIBXL_API_VERSION != 0x040200 && LIBXL_API_VERSION != 0x040300 && \
     LIBXL_API_VERSION != 0x040400 && LIBXL_API_VERSION != 0x040500 && \
     LIBXL_API_VERSION != 0x040700 && LIBXL_API_VERSION != 0x040800 && \
-    LIBXL_API_VERSION != 0x041300 && LIBXL_API_VERSION != 0x041400
+    LIBXL_API_VERSION != 0x041300 && LIBXL_API_VERSION != 0x041400 && \
+    LIBXL_API_VERSION != 0x041800
 #error Unknown LIBXL_API_VERSION
 #endif
 #endif
@@ -1958,7 +1968,8 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass);
  * the caller that it has connected to the guest console.
  */
 int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
-                       libxl_console_type type, int notify_fd);
+                       libxl_console_type type, int notify_fd,
+                       char* escape_character);
 /* libxl_primary_console_exec finds the domid and console number
  * corresponding to the primary console of the given vm, then calls
  * libxl_console_exec with the right arguments (domid might be different
@@ -1968,9 +1979,12 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
  * guests using pygrub.
  * If notify_fd is not -1, xenconsole will write 0x00 to it to nofity
  * the caller that it has connected to the guest console.
+ * If escape_character is not NULL, the provided value is used to exit
+ * the guest console.
  */
 int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm,
-                               int notify_fd);
+                               int notify_fd,
+                               char* escape_character);
 
 #if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040800
 
@@ -1978,17 +1992,36 @@ static inline int libxl_console_exec_0x040700(libxl_ctx *ctx,
                                               uint32_t domid, int cons_num,
                                               libxl_console_type type)
 {
-    return libxl_console_exec(ctx, domid, cons_num, type, -1);
+    return libxl_console_exec(ctx, domid, cons_num, type, -1, NULL);
 }
 #define libxl_console_exec libxl_console_exec_0x040700
 
 static inline int libxl_primary_console_exec_0x040700(libxl_ctx *ctx,
                                                       uint32_t domid_vm)
 {
-    return libxl_primary_console_exec(ctx, domid_vm, -1);
+    return libxl_primary_console_exec(ctx, domid_vm, -1, NULL);
 }
 #define libxl_primary_console_exec libxl_primary_console_exec_0x040700
 
+#elif defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x041800
+
+static inline int libxl_console_exec_0x041700(libxl_ctx *ctx, uint32_t domid,
+                                              int cons_num,
+                                              libxl_console_type type,
+                                              int notify_fd)
+{
+    return libxl_console_exec(ctx, domid, cons_num, type, notify_fd, NULL);
+}
+#define libxl_console_exec libxl_console_exec_0x041700
+
+static inline int libxl_primary_console_exec_0x041700(libxl_ctx *ctx,
+                                                      uint32_t domid_vm,
+                                                      int notify_fd)
+{
+    return libxl_primary_console_exec(ctx, domid_vm, notify_fd, NULL);
+}
+#define libxl_primary_console_exec libxl_primary_console_exec_0x041700
+
 #endif
 
 /* libxl_console_get_tty retrieves the specified domain's console tty path
diff --git a/tools/libs/light/libxl_console.c b/tools/libs/light/libxl_console.c
index f497be141b..cd7412a327 100644
--- a/tools/libs/light/libxl_console.c
+++ b/tools/libs/light/libxl_console.c
@@ -52,7 +52,8 @@ out:
 }
 
 int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
-                       libxl_console_type type, int notify_fd)
+                       libxl_console_type type, int notify_fd,
+                       char* escape_character)
 {
     GC_INIT(ctx);
     char *p = GCSPRINTF("%s/xenconsole", libxl__private_bindir_path());
@@ -75,15 +76,26 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
         goto out;
     }
 
+    char *args[] = {
+        p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
+        NULL, NULL, NULL, NULL, /* start-notify-fd, escape */
+        NULL, /* list terminator - do not use */
+    };
+    char **args_extra = args + 6;
+
     if (notify_fd != -1) {
         notify_fd_s = GCSPRINTF("%d", notify_fd);
-        execl(p, p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
-              "--start-notify-fd", notify_fd_s, (void *)NULL);
-    } else {
-        execl(p, p, domid_s, "--num", cons_num_s, "--type", cons_type_s,
-              (void *)NULL);
+        *args_extra++ = "--start-notify-fd";
+        *args_extra++ = notify_fd_s;
     }
 
+    if (escape_character) {
+        *args_extra++ = "--escape";
+        *args_extra++ = escape_character;
+    }
+
+    execv(p, args);
+
 out:
     GC_FREE;
     return ERROR_FAIL;
@@ -156,7 +168,8 @@ out:
     return rc;
 }
 
-int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm, int notify_fd)
+int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm, int notify_fd,
+                               char* escape_character)
 {
     uint32_t domid;
     int cons_num;
@@ -165,7 +178,8 @@ int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm, int notify_fd)
 
     rc = libxl__primary_console_find(ctx, domid_vm, &domid, &cons_num, &type);
     if ( rc ) return rc;
-    return libxl_console_exec(ctx, domid, cons_num, type, notify_fd);
+    return libxl_console_exec(ctx, domid, cons_num, type, notify_fd,
+                              escape_character);
 }
 
 int libxl_primary_console_get_tty(libxl_ctx *ctx, uint32_t domid_vm,
diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
index ccf4d83584..67604e9536 100644
--- a/tools/xl/xl_cmdtable.c
+++ b/tools/xl/xl_cmdtable.c
@@ -141,7 +141,8 @@ const struct cmd_spec cmd_table[] = {
       "Attach to domain's console",
       "[options] <Domain>\n"
       "-t <type>       console type, pv , serial or vuart\n"
-      "-n <number>     console number"
+      "-n <number>     console number\n"
+      "-e <escape>     escape character"
     },
     { "vncviewer",
       &main_vncviewer, 0, 0,
diff --git a/tools/xl/xl_console.c b/tools/xl/xl_console.c
index b27f9e0136..5633c6f6f7 100644
--- a/tools/xl/xl_console.c
+++ b/tools/xl/xl_console.c
@@ -28,8 +28,9 @@ int main_console(int argc, char **argv)
     int opt = 0, num = 0;
     libxl_console_type type = 0;
     const char *console_names = "pv, serial, vuart";
+    char* escape_character = NULL;
 
-    SWITCH_FOREACH_OPT(opt, "n:t:", NULL, "console", 1) {
+    SWITCH_FOREACH_OPT(opt, "n:t:e:", NULL, "console", 1) {
     case 't':
         if (!strcmp(optarg, "pv"))
             type = LIBXL_CONSOLE_TYPE_PV;
@@ -45,13 +46,16 @@ int main_console(int argc, char **argv)
     case 'n':
         num = atoi(optarg);
         break;
+    case 'e':
+        escape_character = optarg;
+        break;
     }
 
     domid = find_domain(argv[optind]);
     if (!type)
-        libxl_primary_console_exec(ctx, domid, -1);
+        libxl_primary_console_exec(ctx, domid, -1, escape_character);
     else
-        libxl_console_exec(ctx, domid, num, type, -1);
+        libxl_console_exec(ctx, domid, num, type, -1, escape_character);
     fprintf(stderr, "Unable to attach console\n");
     return EXIT_FAILURE;
 }
diff --git a/tools/xl/xl_vmcontrol.c b/tools/xl/xl_vmcontrol.c
index 5518c78dc6..03971927e9 100644
--- a/tools/xl/xl_vmcontrol.c
+++ b/tools/xl/xl_vmcontrol.c
@@ -643,7 +643,7 @@ static void autoconnect_console(libxl_ctx *ctx_ignored,
     postfork();
 
     sleep(1);
-    libxl_primary_console_exec(ctx, bldomid, notify_fd);
+    libxl_primary_console_exec(ctx, bldomid, notify_fd, NULL);
     /* Do not return. xl continued in child process */
     perror("xl: unable to exec console client");
     _exit(1);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 12:07:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 12:07:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571452.895325 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPMFC-0001DW-Nl; Fri, 28 Jul 2023 12:06:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571452.895325; Fri, 28 Jul 2023 12:06:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPMFC-0001DP-K6; Fri, 28 Jul 2023 12:06:54 +0000
Received: by outflank-mailman (input) for mailman id 571452;
 Fri, 28 Jul 2023 12:06:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Gg45=DO=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qPMFB-0001DJ-Eg
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 12:06:53 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3cca7ae8-2d3f-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 14:06:52 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id B6A111F891;
 Fri, 28 Jul 2023 12:06:51 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8FFBA13276;
 Fri, 28 Jul 2023 12:06:51 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id DMezIVuvw2RmXAAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 28 Jul 2023 12:06:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3cca7ae8-2d3f-11ee-b24d-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690546011; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=ftMJfa+moxQlGN6VRaaEBcF7IVwypL/T6yrrALOjroA=;
	b=LGgi+9yxHOiZP/kg7JmJcVmKozETTwKWnlDicM5GqW5DPu64kZBz8loL4lev1VsqwiQaxs
	C0VdradZEtI0cAt/xvorMfDHvlEEdFPdWieM+YGV9cm+qgwBh4CcX0BpY8GOSQHe2ovp4/
	aHB1HrUeIPoAo+lGpqOPzCIv+DEBKgs=
Message-ID: <8a5854d1-2594-ed4f-ace8-e21db4fe4c7b@suse.com>
Date: Fri, 28 Jul 2023 14:06:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
 <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
 <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
 <68acbf84-218b-f2f7-9526-d9e07f845f6e@suse.com>
 <8cea1316-db0b-f29d-c467-6fd5c4a6321c@xen.org>
 <6a376365-a731-2413-16c7-14ede5224eea@suse.com>
 <b8b8e733-6be0-a4d9-33b7-d93366ec0091@xen.org>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
In-Reply-To: <b8b8e733-6be0-a4d9-33b7-d93366ec0091@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------oD1jXEY0AsaaeMfv6kXB9SbF"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------oD1jXEY0AsaaeMfv6kXB9SbF
Content-Type: multipart/mixed; boundary="------------UYzIy6S1CgJNuVRKQTo40j3v";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <8a5854d1-2594-ed4f-ace8-e21db4fe4c7b@suse.com>
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
 <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
 <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
 <68acbf84-218b-f2f7-9526-d9e07f845f6e@suse.com>
 <8cea1316-db0b-f29d-c467-6fd5c4a6321c@xen.org>
 <6a376365-a731-2413-16c7-14ede5224eea@suse.com>
 <b8b8e733-6be0-a4d9-33b7-d93366ec0091@xen.org>
In-Reply-To: <b8b8e733-6be0-a4d9-33b7-d93366ec0091@xen.org>

--------------UYzIy6S1CgJNuVRKQTo40j3v
Content-Type: multipart/mixed; boundary="------------TbcfaCD87pO6dc0jhHIRE0dz"

--------------TbcfaCD87pO6dc0jhHIRE0dz
Content-Type: text/plain; charset=UTF-8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cgdG8gdmlvbGF0ZSBYRU5TVE9SRV9QQVlMT0FEX01BWCBJ
IHdvdWxkDQpzdXJlbHkgTkFDSyBpdC4NCg0KSW4gY2FzZSB3ZSBuZWVkIHBheWxvYWRzIGxh
cmdlciB0aGFuIFhFTlNUT1JFX1BBWUxPQURfTUFYIHdlIHNob3VsZCBzcGxpdCB0aGUNCnJl
bGF0ZWQgb3BlcmF0aW9uIGluIG11bHRpcGxlIHBhcnRzIChzZWUgZS5nLiBYU19ESVJFQ1RP
UllfUEFSVCBvciBYU19DT05UUk9MDQpmb3IgdXBsb2FkaW5nIGEgbmV3IGtlcm5lbCB0byBY
ZW5zdG9yZS1zdHViZG9tIGZvciBsaXZlIHVwZGF0ZSkuIFdoaWNoIGlzLCBCVFcsDQp0aGUg
d2F5IEFXUyBzaG91bGQgaGF2ZSBoYW5kbGVkIHRoZSBtaWdyYXRpb24gcHJvYmxlbSAodHJh
bnNhY3Rpb25zIGNvbWUgdG8gbXkNCm1pbmQgaW4gdGhpcyBjb250ZXh0KS4NCg0KDQpKdWVy
Z2VuDQo=
--------------TbcfaCD87pO6dc0jhHIRE0dz
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qpt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RoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------TbcfaCD87pO6dc0jhHIRE0dz--

--------------UYzIy6S1CgJNuVRKQTo40j3v--

--------------oD1jXEY0AsaaeMfv6kXB9SbF
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmTDr1oFAwAAAAAACgkQsN6d1ii/Ey95
QQf/aEeHBv9Rrbbog/OSiMDw5pLUTcHoDQ5wJpx7e4vV+wwBa+5c9dgYvnZ/itDspDxwJKYFfEj3
CW4HAQrF9fR1Gvx8hJVH9sHdYebAyNpYOyuNbB5VbOO5akUkUFpzwKtr/Gre+soG/ZOK7FMJZiA6
tvEZP69tRcavNqP2DaBg6uQijZrFGBkNT+nDaTswTa01VjjOXPafnN5GW78mhBgR9CfND5PbqboI
OjSni8WY9ihjs0NT+CUHZvPkHzpCnq0LNkWqPiswI1EkBnDJbGUa1ccPtuM+HvqtaGe5ZHpVlECB
LROALQBimuxXo6vk2MPhuf6GnKjTLYBHWujSzIUByA==
=HoMR
-----END PGP SIGNATURE-----

--------------oD1jXEY0AsaaeMfv6kXB9SbF--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 12:14:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 12:14:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571454.895335 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPMMW-0002hJ-Fp; Fri, 28 Jul 2023 12:14:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571454.895335; Fri, 28 Jul 2023 12:14:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPMMW-0002hC-Cz; Fri, 28 Jul 2023 12:14:28 +0000
Received: by outflank-mailman (input) for mailman id 571454;
 Fri, 28 Jul 2023 12:14:27 +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
 <SRS0=RcUX=DO=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qPMMV-0002h6-BM
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 12:14:27 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4adb47e9-2d40-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 14:14:25 +0200 (CEST)
Received: from support.bugseng.com (support.bugseng.com [162.55.131.47])
 by support.bugseng.com (Postfix) with ESMTPA id 98FB14EE073F;
 Fri, 28 Jul 2023 14:14:24 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4adb47e9-2d40-11ee-8613-37d641c3527e
MIME-Version: 1.0
Date: Fri, 28 Jul 2023 14:14:24 +0200
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Julien Grall <julien@xen.org>
Cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org,
 michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com,
 consulting@bugseng.com, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [XEN PATCH] xen/arm: mechanical renaming to address MISRA C:2012
 Rule 5.3
In-Reply-To: <ae4beda6-bb2d-b494-bc06-ce6475bf3624@xen.org>
References: <164303a2b19336a0e5f934a995d2a9c104035fab.1689952914.git.nicola.vetrini@bugseng.com>
 <ae4beda6-bb2d-b494-bc06-ce6475bf3624@xen.org>
User-Agent: Roundcube Webmail/1.4.3
Message-ID: <1313523656e1573a189e73bf4d6a0fc0@bugseng.com>
X-Sender: nicola.vetrini@bugseng.com
Organization: BUGSENG s.r.l.
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit

Hi Julien,

On 21/07/2023 17:54, Julien Grall wrote:
> Hi,
> 
> On 21/07/2023 16:22, Nicola Vetrini wrote:
>> Rule 5.3 has the following headline:
>> "An identifier declared in an inner scope shall not hide an
>> identifier declared in an outer scope"
>> 
>> The function parameters renamed in this patch are hiding a variable 
>> defined
>> in an enclosing scope or a function identifier.
>> 
>> The following renames have been made:
>> - s/guest_mode/guest_mode_on/ to distinguish from function 
>> 'guest_mode'
>> - s/struct module_name/struct module_info to distinguish from the 
>> homonymous
> 
> Typo: Missing '/' after 'module_info'.
> 
>> parameters, since the structure contains more information than just 
>> the name.
>> - s/file_name/file_info in 'xen/arch/arm/efi/efi-boot.h' for 
>> consistency with
> 
> Same here.
> 
>> the previous renaming.
>> 
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> 
> Assuming there is no other comments, I would be Ok to fix it on commit. 
> So:
> 
> Acked-by: Julien Grall <jgrall@amazon.com>
> 
> Cheers,

I don't see any further comments on this. Are you ok with committing it?

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 12:17:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 12:17:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571457.895345 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPMPg-0003Kt-VO; Fri, 28 Jul 2023 12:17:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571457.895345; Fri, 28 Jul 2023 12:17:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPMPg-0003Km-Rt; Fri, 28 Jul 2023 12:17:44 +0000
Received: by outflank-mailman (input) for mailman id 571457;
 Fri, 28 Jul 2023 12:17:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=OGDP=DO=corigine.com=simon.horman@srs-se1.protection.inumbo.net>)
 id 1qPMPf-0003Kg-BG
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 12:17:43 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on20718.outbound.protection.outlook.com
 [2a01:111:f400:7e89::718])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bee3ca0d-2d40-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 14:17:41 +0200 (CEST)
Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6)
 by CO3PR13MB5752.namprd13.prod.outlook.com (2603:10b6:303:164::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Fri, 28 Jul
 2023 12:17:35 +0000
Received: from PH0PR13MB4842.namprd13.prod.outlook.com
 ([fe80::fde7:9821:f2d9:101d]) by PH0PR13MB4842.namprd13.prod.outlook.com
 ([fe80::fde7:9821:f2d9:101d%7]) with mapi id 15.20.6631.026; Fri, 28 Jul 2023
 12:17:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bee3ca0d-2d40-11ee-b24d-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Er101cT5uk/XHBCznY2/k5+cLhGAuB8Sy/3p36aspkiBQKoCWu3HtiJtIrZQYankv+nTRukViGhN3M05D8Z01dAHS3fucSm/+G5DWnHEzUUU3ZdEjS+/dan14HS35xHtm24q1+cp3l1UzgDIm5sbdGINS8oe5/cya2HR8tDeX5JzbozDROgyllffH2aNY3HI8hw2KvpcV8OYhSnuzGpRVzVPMWdVxyXsYBdQSn7VSIvMttxuHezvwa6W0ImL/Nvrq4cvqrOPvIuP4wdE1mErbNkD7+FpDRN7NK2uTgVMFwwmmFDQBe3PR0MhBW3ZyUIG8EKcnHxS1NpID5P66r//CA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Xzzfw+scYK/2YqjGbTNey54nczLq8zQJMyRBqxq/QfQ=;
 b=e9CmfzXHEXu/9hc9x5N4Qmka3ZfXjWLVicc8cx4Ws1NNSoNWSFYoRJHDGBiEgyVcKyagA9/Sc+/lCBnRV7oMLJNtO1SffSMZ8FwLJ4T7BqsvqEaqb6nc66RrATBoXJaSutEYfcAJOHQEzNV3nuhv6VWYRMsXFLDUWoybG/p0iv4eVqikZ3uOUqVg6Qamd6/uPIcTh0wgtpUaXIs9cQZMK0DwEHs+i34XA9b5O1Ma1vBcWIxl48rgymzI0ghEornysoiAev0mBueaPupTegFSwvAWDcgc/B16fkcjzJfns6T2pezqSNMWX0YsSMeSH9mMpwnNaBh4kGlqcgr4zXxdFw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com;
 dkim=pass header.d=corigine.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Xzzfw+scYK/2YqjGbTNey54nczLq8zQJMyRBqxq/QfQ=;
 b=mL9AyN/fBcV+ui4AnBqPDcnT4Rfvs0aXlWohtRd2EWGfLctbaco+RyhPEOVmM1LC7k0xh10ZdY9/lH1R+IIdz5iL2xHceOtIwm2Ywkg8/mr6gB4jbKKymAgCpJfqXDw+3aZmvekIXFVJaMG8QzSh/9Y2+gcThGyNxfHSLP2lNGg=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=corigine.com;
Date: Fri, 28 Jul 2023 14:17:23 +0200
From: Simon Horman <simon.horman@corigine.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru,
	vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org,
	brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu,
	steven.price@arm.com, cel@kernel.org, senozhatsky@chromium.org,
	yujie.liu@intel.com, gregkh@linuxfoundation.org,
	muchun.song@linux.dev, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, x86@kernel.org, kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org, linux-erofs@lists.ozlabs.org,
	linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com,
	linux-nfs@vger.kernel.org, linux-mtd@lists.infradead.org,
	rcu@vger.kernel.org, netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	dm-devel@redhat.com, linux-raid@vger.kernel.org,
	linux-bcache@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v3 05/49] mm: shrinker: add infrastructure for
 dynamically allocating shrinker
Message-ID: <ZMOx0y+wdHEATDho@corigine.com>
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
 <20230727080502.77895-6-zhengqi.arch@bytedance.com>
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20230727080502.77895-6-zhengqi.arch@bytedance.com>
X-ClientProxiedBy: AS4P190CA0065.EURP190.PROD.OUTLOOK.COM
 (2603:10a6:20b:656::10) To PH0PR13MB4842.namprd13.prod.outlook.com
 (2603:10b6:510:78::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|CO3PR13MB5752:EE_
X-MS-Office365-Filtering-Correlation-Id: 7fa1c089-2344-4b06-3624-08db8f649f2e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	j0Mc3eF+DP2LxDOozLRyyeIKECVLGRQIlIrdEFb9GZyo19Z8jeFLDt/bCDbFSf8N0UgLcZ5nANCSfFPp9ph0OUTRm7F2bEGtxXu0ZMmYHB++UDEI/qt4sQIsHpj+LQqg6gGfURY4hT2IDCWGw6Ybqs5E7pgqpJs4J/nInIqn9VFU5CgQ+GK35/ZyTVoe6qWgCri0ck8ovO1iCvPMl6pQY1O5aEK2fI+4PMy9h3gUmAn1qC8GUFYKGFd4nIODUjceb9/B+WqmJi70ci7KBpycck/dYE/oE/fSNvWH87L2EN/RSEwJk4PFsx+XLA/x2ei5z3yj6T2zjDIjyD3Tat8vFp7m6b/5G97rY5DcrR5bpBvN1ryBFxovF049q1oBmHR1y7JP7MnntYWy7a2vGVlaH8cxiuhFvjFImRVlPHL7jFTnBxTs4DERfppx6DRLuWoyS8O4un5AQcw6WdKHT5UELpX36pMqwNA+j9Lbq5wh+3whyO46TZ2AhZlYvDlKlv7kTBixlXGW0fX6p3Xifb3vwnkvHoPd+UmsM9xZCOzMyPnlNSvXgvaF2p9+YayAMBmddGwNQoAsFRS9MKI4K1hSr40LZzFN4IAgjQ9J2S041xn/JxtQtD3rgjJxgmntTaofdMkuJGANvA4JO5mZkvQzhMrAXXqvJEOmaFoTF7J+yac=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(136003)(39840400004)(376002)(396003)(346002)(451199021)(6512007)(478600001)(38100700002)(66946007)(8936002)(5660300002)(8676002)(66476007)(4326008)(6916009)(2616005)(41300700001)(66556008)(316002)(186003)(83380400001)(6666004)(6486002)(6506007)(86362001)(2906002)(7416002)(44832011)(7406005)(36756003)(67856001);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?hPOsWUyNfuPgdO7KGPoxy8ksAiev8ZQ1mx/yK17hREAs80+Bp/61g+ypXcBT?=
 =?us-ascii?Q?HRu9jj6Qg9t07l3KXDplFpMfQmItUDmp/Rl49c3/yUZM8HLSVEUOfoYJFdhK?=
 =?us-ascii?Q?fSIgaNpvoQXryHYMgHOanbyxDsp2IMAM6Iww3QBkSbl730EEjBs5gxcDmCBb?=
 =?us-ascii?Q?QU1V3uoMqgXFhC9JWnnqZp0aSbsHbu4zyZTUWyLGqTYI6pmieGdUW+8LkwcJ?=
 =?us-ascii?Q?T0GkZ4g8qlRo4jk+l6xQ02skBq3BqXWvBLVBQRtkCmtFKTWh610fwMxsVkoM?=
 =?us-ascii?Q?Gnf1thqRe/k1tAWbVMF/a2+G6R558nSRbYsvwdfjoHnDY28X/sYjDBssYr/q?=
 =?us-ascii?Q?Fl6V7TlPdnX6ywkUx5QWinxcmi8lKgaJNWdDfDu8wspT9jG0cJH0gQIv8Cex?=
 =?us-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ii?Q?B+X7yNNw5UizQNg6XjkKzmt3cUpuw7upYP9vz23zka7o2TO4MTsfcRopjPdM?=
 =?us-ascii?Q?Kd2qtjL8Yj5ZTL6bJI+IEDTIgXkj6+W0ErfOvDGVyFIPud8PIhk2Vs9NCwbI?=
 =?us-ascii?Q?jrHvmo7xrbGGkVITjitLJ15ofnoW7jlUEZMtIr45BECVNAskC2eroDIELfbh?=
 =?us-ascii?Q?drKPUw6+OUS8C/sferQ8mAXHxjVFmphteP7aP7p50cbQF/4fiuKXqxV+BS5f?=
 =?us-ascii?Q?HRsARsK+VfL9529UpcyCv5oQHYnC+JR6JGkWgnOGhw9GJX+T6zjmEhXAFSlG?=
 =?us-ascii?Q?sjiaqZOwyEuD14aXMfYytHlpYjb63AL5QMCw/26rpqFaI0q0wW+Monr3okit?=
 =?us-ascii?Q?gXo9kiB3+KBcH9Z/XZprsS/Ue0QmWLJ6Uegfo/4/Hd6o8wkg8oTMbd8yz3WX?=
 =?us-ascii?Q?HVhI7w=3D=3D?=
X-OriginatorOrg: corigine.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7fa1c089-2344-4b06-3624-08db8f649f2e
X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2023 12:17:35.2229
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: iZe55KImseJDEXyvSQcePinFJYyerifPEHQDYs0bVw2T5jNObZA26ORFCKwaaGDVoaLdpiLFCL17f5WTZYMy0/KrkxWVzjRme/VzT17S8OY=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO3PR13MB5752

On Thu, Jul 27, 2023 at 04:04:18PM +0800, Qi Zheng wrote:
> Currently, the shrinker instances can be divided into the following three
> types:
> 
> a) global shrinker instance statically defined in the kernel, such as
>    workingset_shadow_shrinker.
> 
> b) global shrinker instance statically defined in the kernel modules, such
>    as mmu_shrinker in x86.
> 
> c) shrinker instance embedded in other structures.
> 
> For case a, the memory of shrinker instance is never freed. For case b,
> the memory of shrinker instance will be freed after synchronize_rcu() when
> the module is unloaded. For case c, the memory of shrinker instance will
> be freed along with the structure it is embedded in.
> 
> In preparation for implementing lockless slab shrink, we need to
> dynamically allocate those shrinker instances in case c, then the memory
> can be dynamically freed alone by calling kfree_rcu().
> 
> So this commit adds the following new APIs for dynamically allocating
> shrinker, and add a private_data field to struct shrinker to record and
> get the original embedded structure.
> 
> 1. shrinker_alloc()
> 
> Used to allocate shrinker instance itself and related memory, it will
> return a pointer to the shrinker instance on success and NULL on failure.
> 
> 2. shrinker_register()
> 
> Used to register the shrinker instance, which is same as the current
> register_shrinker_prepared().
> 
> 3. shrinker_free()
> 
> Used to unregister (if needed) and free the shrinker instance.
> 
> In order to simplify shrinker-related APIs and make shrinker more
> independent of other kernel mechanisms, subsequent submissions will use
> the above API to convert all shrinkers (including case a and b) to
> dynamically allocated, and then remove all existing APIs.
> 
> This will also have another advantage mentioned by Dave Chinner:
> 
> ```
> The other advantage of this is that it will break all the existing
> out of tree code and third party modules using the old API and will
> no longer work with a kernel using lockless slab shrinkers. They
> need to break (both at the source and binary levels) to stop bad
> things from happening due to using uncoverted shrinkers in the new

nit: uncoverted -> unconverted

> setup.
> ```
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

...

> diff --git a/mm/shrinker_debug.c b/mm/shrinker_debug.c
> index f1becfd45853..506257585408 100644
> --- a/mm/shrinker_debug.c
> +++ b/mm/shrinker_debug.c
> @@ -191,6 +191,20 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
>  	return 0;
>  }
>  
> +int shrinker_debugfs_name_alloc(struct shrinker *shrinker, const char *fmt,
> +				va_list ap)
> +{
> +	shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
> +
> +	return shrinker->name ? 0 : -ENOMEM;
> +}
> +
> +void shrinker_debugfs_name_free(struct shrinker *shrinker)
> +{
> +	kfree_const(shrinker->name);
> +	shrinker->name = NULL;
> +}
> +

These functions have no prototype in this file,
perhaps internal.h should be included?

>  int shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...)
>  {
>  	struct dentry *entry;

...


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 12:37:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 12:37:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571460.895355 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPMiG-0005rI-Kg; Fri, 28 Jul 2023 12:36:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571460.895355; Fri, 28 Jul 2023 12:36:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPMiG-0005rB-HV; Fri, 28 Jul 2023 12:36:56 +0000
Received: by outflank-mailman (input) for mailman id 571460;
 Fri, 28 Jul 2023 12:36:55 +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
 <SRS0=RcUX=DO=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qPMiF-0005r5-15
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 12:36:55 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6dd2e548-2d43-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 14:36:52 +0200 (CEST)
Received: from nico.bugseng.com (unknown [37.163.4.37])
 by support.bugseng.com (Postfix) with ESMTPSA id 3ED204EE073F;
 Fri, 28 Jul 2023 14:36:50 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6dd2e548-2d43-11ee-8613-37d641c3527e
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH v3] xen/sched: mechanical renaming to address MISRA C:2012 Rule 5.3
Date: Fri, 28 Jul 2023 14:35:48 +0200
Message-Id: <12a21bfd59d85c7b8619631edac93d79d7225c60.1690547599.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rule 5.3 has the following headline:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope"

The renaming s/sched_id/scheduler_id/ of the function defined in
'xen/common/sched/core.c' prevents any hiding of that function
by the instances of homonymous function parameters that
are defined in inner scopes.

Similarly, the renames
- s/ops/operations/ for the static variable in 'xen/common/sched/core.c'
- s/do_softirq/needs_softirq/
are introduced for variables, to avoid any conflict with homonymous
parameters or function identifiers.

Moreover, the variable 'loop' defined at 'xen/common/sched/credit2.c:3887'
has been dropped, in favour of the homonymous variable declared in the
outer scope. This in turn requires a modification of the printk call that
involves it.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
Changes in v3:
- removed stray changes to address the remarks
Changes in v2:
- s/softirq/needs_softirq/
- Dropped local variable 'it'
- Renamed the 'ops' static variable instead of function parameters
in the idle scheduler for coherence.

Note: local variable 'j' in xen/common/sched/credit2.c:3812' should
probably be unsigned as well, but I saw while editing the patch
that it's used as a parameter to 'dump_pcpu', which takes an int.
Possibly changing the types of parameters used in these calls is
probably a good target for another patch, as it's not relevant
w.r.t. Rule 5.3.
---
 xen/common/sched/core.c    | 28 ++++++++++++++--------------
 xen/common/sched/credit2.c |  6 +++---
 xen/common/sysctl.c        |  2 +-
 xen/include/xen/sched.h    |  2 +-
 4 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 022f548652..12deefa745 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -91,7 +91,7 @@ extern const struct scheduler *__start_schedulers_array[], *__end_schedulers_arr
 #define NUM_SCHEDULERS (__end_schedulers_array - __start_schedulers_array)
 #define schedulers __start_schedulers_array

-static struct scheduler __read_mostly ops;
+static struct scheduler __read_mostly operations;

 static bool scheduler_active;

@@ -171,7 +171,7 @@ static inline struct scheduler *dom_scheduler(const struct domain *d)
      * is the default scheduler that has been, choosen at boot.
      */
     ASSERT(is_idle_domain(d));
-    return &ops;
+    return &operations;
 }

 static inline struct scheduler *unit_scheduler(const struct sched_unit *unit)
@@ -2040,10 +2040,10 @@ long do_set_timer_op(s_time_t timeout)
     return 0;
 }

-/* sched_id - fetch ID of current scheduler */
-int sched_id(void)
+/* scheduler_id - fetch ID of current scheduler */
+int scheduler_id(void)
 {
-    return ops.sched_id;
+    return operations.sched_id;
 }

 /* Adjust scheduling parameter for a given domain. */
@@ -2579,7 +2579,7 @@ static void cf_check sched_slave(void)
     struct sched_unit    *prev = vprev->sched_unit, *next;
     s_time_t              now;
     spinlock_t           *lock;
-    bool                  do_softirq = false;
+    bool                  needs_softirq = false;
     unsigned int          cpu = smp_processor_id();

     ASSERT_NOT_IN_ATOMIC();
@@ -2604,7 +2604,7 @@ static void cf_check sched_slave(void)
             return;
         }

-        do_softirq = true;
+        needs_softirq = true;
     }

     if ( !prev->rendezvous_in_cnt )
@@ -2614,7 +2614,7 @@ static void cf_check sched_slave(void)
         rcu_read_unlock(&sched_res_rculock);

         /* Check for failed forced context switch. */
-        if ( do_softirq )
+        if ( needs_softirq )
             raise_softirq(SCHEDULE_SOFTIRQ);

         return;
@@ -3016,14 +3016,14 @@ void __init scheduler_init(void)
         BUG_ON(!scheduler);
         printk("Using '%s' (%s)\n", scheduler->name, scheduler->opt_name);
     }
-    ops = *scheduler;
+    operations = *scheduler;

     if ( cpu_schedule_up(0) )
         BUG();
     register_cpu_notifier(&cpu_schedule_nfb);

-    printk("Using scheduler: %s (%s)\n", ops.name, ops.opt_name);
-    if ( sched_init(&ops) )
+    printk("Using scheduler: %s (%s)\n", operations.name, operations.opt_name);
+    if ( sched_init(&operations) )
         panic("scheduler returned error on init\n");

     if ( sched_ratelimit_us &&
@@ -3363,7 +3363,7 @@ int schedule_cpu_rm(unsigned int cpu, struct cpu_rm_data *data)

 struct scheduler *scheduler_get_default(void)
 {
-    return &ops;
+    return &operations;
 }

 struct scheduler *scheduler_alloc(unsigned int sched_id)
@@ -3392,7 +3392,7 @@ struct scheduler *scheduler_alloc(unsigned int sched_id)

 void scheduler_free(struct scheduler *sched)
 {
-    BUG_ON(sched == &ops);
+    BUG_ON(sched == &operations);
     sched_deinit(sched);
     xfree(sched);
 }
@@ -3416,7 +3416,7 @@ void schedule_dump(struct cpupool *c)
     }
     else
     {
-        sched = &ops;
+        sched = &operations;
         cpus = &cpupool_free_cpus;
     }

diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 87a1e31ee9..fc583915df 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -3874,7 +3874,7 @@ csched2_dump(const struct scheduler *ops)

             lock = unit_schedule_lock(unit);

-            printk("\t%3d: ", ++loop);
+            printk("\t%3u: ", ++loop);
             csched2_dump_unit(prv, svc);

             unit_schedule_unlock(lock, unit);
@@ -3884,8 +3884,8 @@ csched2_dump(const struct scheduler *ops)
     list_for_each_entry ( rqd, &prv->rql, rql )
     {
         struct list_head *iter, *runq = &rqd->runq;
-        int loop = 0;

+        loop = 0;
         /* We need the lock to scan the runqueue. */
         spin_lock(&rqd->lock);

@@ -3901,7 +3901,7 @@ csched2_dump(const struct scheduler *ops)

             if ( svc )
             {
-                printk("\t%3d: ", loop++);
+                printk("\t%3u: ", loop++);
                 csched2_dump_unit(prv, svc);
             }
         }
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 0cbfe8bd44..7cabfb0230 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -71,7 +71,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         break;

     case XEN_SYSCTL_sched_id:
-        op->u.sched_id.sched_id = sched_id();
+        op->u.sched_id.sched_id = scheduler_id();
         break;

     case XEN_SYSCTL_getdomaininfolist:
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 854f3e32c0..bfe714d2e2 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -791,7 +791,7 @@ int  sched_init_domain(struct domain *d, unsigned int poolid);
 void sched_destroy_domain(struct domain *d);
 long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *);
 long sched_adjust_global(struct xen_sysctl_scheduler_op *);
-int  sched_id(void);
+int  scheduler_id(void);

 /*
  * sched_get_id_by_name - retrieves a scheduler id given a scheduler name
--
2.34.1


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 12:48:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 12:48:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571463.895365 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPMtV-0007QW-LI; Fri, 28 Jul 2023 12:48:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571463.895365; Fri, 28 Jul 2023 12:48:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPMtV-0007QP-I6; Fri, 28 Jul 2023 12:48:33 +0000
Received: by outflank-mailman (input) for mailman id 571463;
 Fri, 28 Jul 2023 12:48:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qPMtU-0007QJ-9p
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 12:48:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPMtT-0006N9-Ev; Fri, 28 Jul 2023 12:48:31 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPMtT-0008Gb-8K; Fri, 28 Jul 2023 12:48:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=vGsebjW1/nRHbE5Cv7b/6FKUwr3fBfJ++NGoQwReRMc=; b=D6Q+7kD3ZlSm7EUw647ImN/8WU
	982q9Rmb32nZg/9wvj4F6hmaI/o+bq4G6M7OW2aXCe9lv7h5zUWllLPjyaVRambQ6eY1VBDkMBLAG
	dKfA+41six8+UHrMlqhHVYlKq5Ab68oSUwCA+M4I3yFT3VdVPg9ii29PuK7dW7HU6NTI=;
Message-ID: <75dc26f0-0ea7-2097-47b2-1f857e1d7236@xen.org>
Date: Fri, 28 Jul 2023 13:48:29 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
Content-Language: en-GB
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
 <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
 <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
 <68acbf84-218b-f2f7-9526-d9e07f845f6e@suse.com>
 <8cea1316-db0b-f29d-c467-6fd5c4a6321c@xen.org>
 <6a376365-a731-2413-16c7-14ede5224eea@suse.com>
 <b8b8e733-6be0-a4d9-33b7-d93366ec0091@xen.org>
 <8a5854d1-2594-ed4f-ace8-e21db4fe4c7b@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <8a5854d1-2594-ed4f-ace8-e21db4fe4c7b@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 28/07/2023 13:06, Juergen Gross wrote:
> On 28.07.23 13:19, Julien Grall wrote: 
>>>>> In case of a runtime check I
>>>>> agree that a more central place would be preferred.
>>>>>
>>>>> In the end I don't mind that much, but
>>>>>
>>>>> Â Â Â Â Â BUILD_BUG_ON(XENSTORE_PAYLOAD_MAX >=
>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  (typeof((struct node_hdr *)NULL->datalen))(-1));
>>>>>
>>>>> is a little bit clumsy IMHO.
>>>>
>>>> Agree. We could introduce FIELD_SIZEOF() (as Linux did) to hide the 
>>>> complexity. The code would then look like:
>>>>
>>>> Â >= (8 * FIELD_SIZEOF(struct node_hdr, datalen))
>>>
>>> Oh, I guess you mean sizeof_field().
>>>
>>> And even with that it would look quite clumsy:
>>>
>>> Â Â Â Â Â BUILD_BUG_ON(XENSTORE_PAYLOAD_MAX >=
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  (1UL << (8 * sizeof_field(struct node_hdr, datalen))));
>>
>> How about keeping the BUILD_BUG_ON() in write_node_raw() and add the 
>> following comment on top of handle_input():
>>
>> Some fields in Xenstored are sized based on the max payload (see 
>> various BUILD_BUG_ON()). This would need extra runtime check if we 
>> ever decide to have a dynamic payload size.
> 
> I _could_ do that, but where to stop adding such comments?

When someone other than the author is able to understand the code 
without too much effort. More comments never hurts, less will in the 
longer run (see below).

> 
> TBH, I really don't see the point doing that.
> 
> In case a patch came up upstream trying to violate XENSTORE_PAYLOAD_MAX 
> I would
> surely NACK it.
That's assuming you will still be around when this happens :). I am not 
wishing anything bad but the code will likely outlast any of us.

So we need to make easy for a future maintainers/reviewers to know the 
assumptions and implications of changing some of the limits.

> In case we need payloads larger than XENSTORE_PAYLOAD_MAX we should 
> split the
> related operation in multiple parts (see e.g. XS_DIRECTORY_PART or 
> XS_CONTROL
> for uploading a new kernel to Xenstore-stubdom for live update). Which 
> is, BTW,
> the way AWS should have handled the migration problem (transactions come 
> to my
> mind in this context).

I wasn't part of the original design, but I can see why it was done like 
that.

Using multiple commands has also its downside. The first that comes to 
my mind if that you need to keep around the data. But, with your 
proposal, you we wouldn't be able to store it in the database (like for 
transaction update) as datalen can only be 65KB.

So one command as the advantage to simply a lot the logic in Xenstored.

Anyway, this is getting a bit off topic. My only request is to write 
down assumption more explicitly rather than hiding them. A comment on 
top of the check is a nice way to help the developper to avoid making a 
"bad" decision.

I am happy to rewrite the comment so it doesn't lead to think that you 
(as the maintainer) are open to have a more relax length check.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 13:18:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 13:18:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571465.895375 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPNM8-0002Uk-Sq; Fri, 28 Jul 2023 13:18:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571465.895375; Fri, 28 Jul 2023 13:18:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPNM8-0002Ud-Pw; Fri, 28 Jul 2023 13:18:08 +0000
Received: by outflank-mailman (input) for mailman id 571465;
 Fri, 28 Jul 2023 13:18:07 +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 <SRS0=Gg45=DO=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qPNM7-0002UW-Hu
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 13:18:07 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2fcf890c-2d49-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 15:18:05 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id EC5C01F8AF;
 Fri, 28 Jul 2023 13:18:04 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C29E1133F7;
 Fri, 28 Jul 2023 13:18:04 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id iAEHLgzAw2RwBAAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 28 Jul 2023 13:18:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2fcf890c-2d49-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690550284; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:  content-transfer-encoding:content-transfer-encoding;
	bh=w6/qEz7nuZR61tfXugJCI1zoAyn3+vTp7j7ZdW0CUF0=;
	b=Zrb8k/4MLbqbE61aIzBIkf0QXmDe5FlHONb0N7cc2QX6LSVpiA0g6iXSnfUTiEdRpDqsgP
	qGenDFA1Y41Wstyjx+1K8HPKcBxM1k8kdUfFVcV+OM0zq5ET+4vGomwCxGWGTVV3sW8Ivo
	ZnHJUjzqzgagGgWu/w7VTSeLXbUgqmk=
From: Juergen Gross <jgross@suse.com>
To: torvalds@linux-foundation.org
Cc: linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	sstabellini@kernel.org
Subject: [GIT PULL] xen: branch for v6.5-rc4
Date: Fri, 28 Jul 2023 15:18:04 +0200
Message-Id: <20230728131804.10538-1-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Linus,

Please git pull the following tag:

 git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git for-linus-6.5a-rc4-tag

xen: branch for v6.5-rc4

It contains the following patches:

- A fix for a performance problem in QubesOS, adding a way to drain
  the queue of grants experiencing delayed unmaps faster.

- A patch enabling the use of static event channels from user mode,
  which was omitted when introducing supporting static event channels.

- A fix for a problem where Xen related code didn't check properly for
  running in a Xen environment, resulting in a WARN splat.


Thanks.

Juergen

 Documentation/ABI/testing/sysfs-module | 11 ++++++++++
 drivers/xen/events/events_base.c       | 16 +++++---------
 drivers/xen/evtchn.c                   | 35 +++++++++++++++++++++--------
 drivers/xen/grant-table.c              | 40 ++++++++++++++++++++++++----------
 drivers/xen/xenbus/xenbus_probe.c      |  3 +++
 include/uapi/xen/evtchn.h              |  9 ++++++++
 include/xen/events.h                   | 11 +++++++++-
 7 files changed, 93 insertions(+), 32 deletions(-)

Demi Marie Obenour (1):
      xen: speed up grant-table reclaim

Rahul Singh (1):
      xen/evtchn: Introduce new IOCTL to bind static evtchn

Stefano Stabellini (1):
      xenbus: check xen_domain in xenbus_probe_initcall


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 13:24:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 13:24:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571467.895385 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPNSQ-0003we-JM; Fri, 28 Jul 2023 13:24:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571467.895385; Fri, 28 Jul 2023 13:24:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPNSQ-0003wX-FM; Fri, 28 Jul 2023 13:24:38 +0000
Received: by outflank-mailman (input) for mailman id 571467;
 Fri, 28 Jul 2023 13:24:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Gg45=DO=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qPNSP-0003wR-TG
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 13:24:38 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [2001:67c:2178:6::1c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1876a130-2d4a-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 15:24:36 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 4D81B219BB;
 Fri, 28 Jul 2023 13:24:35 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 24374133F7;
 Fri, 28 Jul 2023 13:24:35 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id Iio6B5PBw2TPBwAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 28 Jul 2023 13:24:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1876a130-2d4a-11ee-b24d-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690550675; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=wMzkTIcAbS6CKxpofvrAfdhXppr2iFSWs/hW4SKk7t4=;
	b=SrNmNvMc9etZnDpYYL6Vz4hm5BYV1pKHcqhthVtLLdmLJEUreljzMtUaCNzIWyyL3Dc0n+
	ahFmq7HmGOKdDVzYX1M5dFn2UtEOikVCQFt9NbbV+0nWUB6e4CwTZLC97ldNcluQCAoDcE
	pgbq7v31yiEbfF6MiRap1LRCuYN2kdw=
Message-ID: <4d36876c-e943-06ac-782d-5d94851040e2@suse.com>
Date: Fri, 28 Jul 2023 15:24:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
 <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
 <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
 <68acbf84-218b-f2f7-9526-d9e07f845f6e@suse.com>
 <8cea1316-db0b-f29d-c467-6fd5c4a6321c@xen.org>
 <6a376365-a731-2413-16c7-14ede5224eea@suse.com>
 <b8b8e733-6be0-a4d9-33b7-d93366ec0091@xen.org>
 <8a5854d1-2594-ed4f-ace8-e21db4fe4c7b@suse.com>
 <75dc26f0-0ea7-2097-47b2-1f857e1d7236@xen.org>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
In-Reply-To: <75dc26f0-0ea7-2097-47b2-1f857e1d7236@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------anOO0u0NmGSfsffD3HFpF04W"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------anOO0u0NmGSfsffD3HFpF04W
Content-Type: multipart/mixed; boundary="------------rVtUMORx2Lv502Yu0LyxB0fv";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <4d36876c-e943-06ac-782d-5d94851040e2@suse.com>
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
 <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
 <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
 <68acbf84-218b-f2f7-9526-d9e07f845f6e@suse.com>
 <8cea1316-db0b-f29d-c467-6fd5c4a6321c@xen.org>
 <6a376365-a731-2413-16c7-14ede5224eea@suse.com>
 <b8b8e733-6be0-a4d9-33b7-d93366ec0091@xen.org>
 <8a5854d1-2594-ed4f-ace8-e21db4fe4c7b@suse.com>
 <75dc26f0-0ea7-2097-47b2-1f857e1d7236@xen.org>
In-Reply-To: <75dc26f0-0ea7-2097-47b2-1f857e1d7236@xen.org>

--------------rVtUMORx2Lv502Yu0LyxB0fv
Content-Type: multipart/mixed; boundary="------------HlRjGhF8IfiKPf8rrN9uHM3x"

--------------HlRjGhF8IfiKPf8rrN9uHM3x
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24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BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5RnNVUJbvoPHZ8SlM4KWm8rG+lIkGurq
qu5gu8q8ZMKdsdGC4bBxdQKDKHEFExLJK/nRPFmAuGlId1E3fe10v5QL+qHI3EIP
tyfE7i9Hz6rVwi7lWKgh7pe0ZvatAudZ+JNIlBKptb64FaiIOAWDCx1SzR9KdWVy
Z2VuIEdyb3NzIDxqZ3Jvc3NAc3VzZS5jb20+wsB5BBMBAgAjBQJTjHCvAhsDBwsJ
CAcDAgEGFQgCCQoLBBYCAwECHgECF4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UMORx2Lv502Yu0LyxB0fv--

--------------anOO0u0NmGSfsffD3HFpF04W
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmTDwZIFAwAAAAAACgkQsN6d1ii/Ey93
Cgf/dzsRNjO0jUi5rWsghnqAT9w4DTc4l6xgC3rZlsy7gJoU7S14emMXKdaQMasATe2/g2ghY3tR
rW1S20vq1XoqJN2aMmt8hr1Va2Y4Mzy7R+f1oceyzb9euzANaZIIm4cjJ0C02U+VfAMRkhOgM7ey
FVhF6a7pqAwCUhq931RNIrZqQNkaCRSny2tfOQefNk8HnlAS6F2o8JC37yiFUorX18Ja7k6fp82R
UbMbkN2+zXGqO/JSSBmuTTT1lxMmeHS/C+enlS5JovfPbz58K2razjqCfcutnNphRgUdnV3vN0fq
jNIxp3pVHmdKCDSkaY3TL1zd9t7jL4rBE7wfpFhU9A==
=P/Xf
-----END PGP SIGNATURE-----

--------------anOO0u0NmGSfsffD3HFpF04W--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 13:55:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 13:55:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571470.895395 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPNwL-0007V2-1Y; Fri, 28 Jul 2023 13:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571470.895395; Fri, 28 Jul 2023 13:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPNwK-0007Uv-UG; Fri, 28 Jul 2023 13:55:32 +0000
Received: by outflank-mailman (input) for mailman id 571470;
 Fri, 28 Jul 2023 13:55:31 +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
 <SRS0=UUpw=DO=citrix.com=prvs=566eed887=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qPNwJ-0007Uk-Ao
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 13:55:31 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6698a733-2d4e-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 15:55:26 +0200 (CEST)
Received: from mail-bn1nam02lp2040.outbound.protection.outlook.com (HELO
 NAM02-BN1-obe.outbound.protection.outlook.com) ([104.47.51.40])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 28 Jul 2023 09:55:14 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by SJ0PR03MB5808.namprd03.prod.outlook.com (2603:10b6:a03:2dd::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Fri, 28 Jul
 2023 13:55:10 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6631.026; Fri, 28 Jul 2023
 13:55:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6698a733-2d4e-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690552526;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=lsOhabthQVNtaTIyZQM2dHk3H9wBiLxBJyUk/+vTpAs=;
  b=IdlUTbwRvj0tsAvsvgu1HxGiC/3s2zosz/5UUBj/F1ec7LpBvvYYk5v0
   Lcze3LIWmD3dubPDD8Gz/VFq07by8NSejJV5QyGhULB2CpT3d3hCQDQya
   4pNOgtRz/349UutdqNJ6JhhL9Q8I9jd+by3yW64XslTCx4NXOEz9e6QRR
   Y=;
X-IronPort-RemoteIP: 104.47.51.40
X-IronPort-MID: 117070347
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:Jy/tY6nEh9g1xDPcSDZCl3vo5gxQJ0RdPkR7XQ2eYbSJt1+Wr1Gzt
 xIdC2+BaK3bZWCjc9xyaIu/9U5UvMDRzYNgSVZlrSFkEyMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5g+GzhH5MbpETU2PByqgKmVrNrbSq
 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/
 f0W3XCGpaXFCYWX8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; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CnRwVhyOfeFH9GicmeDa/WRyTrVZEWhMYMQ3Wv/07aHwgjHGDDwpS2RS0o9F2WEQTSsTeghH+simg+HfLt+d4bm125CLAc5qKqJa1UNfs50Z0OOdEfOLWue3qZgFskkb94CU9JS3qNEFmVGDHQL3blKOHiajMjCzIKIyv+Wm+JK2As3FBf3VBPWqdxA0aUzvKfK31qay15Q0S4pry105A1QVJOkgn1CM8bmhw90GVXItnwBVYuRfkh752uRSuArP5Ts6cNeubrUY5syMwJHS5oADEeZt4zxcWAp9JY985WLDahIGMCg2ceIOldtpvUyIoq642Gx/EH6uiVtnE6yjzw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=WTbxb09MAK35wf0lo93bbnMh5YL/QO7+u3Rh8gTfu5U=;
 b=JyD1QyAHpSPTAOoqu5GXIYyYrkO/+X8AY7kzIEifcpxXRbnDKjO7AzUS7efbtBQ7+W5vgG9EBBznvGtWmsqabLmADPksNxcFgnebksgcKCJR+af9NKwcSGKzIb2cek01+zOmma3TXp4yPCl31G13LAqFHfoucMe4gnCiPEs/anzketsl68M2FrwfDZDfeFQtYv0Bj/KAXfA6IFPYWdF1q9HLf3f01J3RC7rp7PE/5aV9i+WGlEZ6QBz7xnc1IjaSFH4NNUYmwZbYGM3GNt7gzqLRb7YK/nyvtSvfmfiSfg4dhSeP34e7PI6ROismGKPf1om2VvXtOopCl/C6Z3FSYA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=WTbxb09MAK35wf0lo93bbnMh5YL/QO7+u3Rh8gTfu5U=;
 b=mc2rfTTjcoSb7iGvuWiWj9VTn9GZPjpBiTjLVJ/jeuL/yuDDZ0/oJclv3LA7JZtzFNfrF2AVc0JqQWAkUHWd8e0X4PXO6zlEDA+V7B2+K+S5wVosNhB+0pPxicIwT5uk8qzR9GhIRXeJRBdJCH0o3Gl7k6hHxs+iRYCCJO5mOa0=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Fri, 28 Jul 2023 15:55:04 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci
 structure
Message-ID: <ZMPIuIiNHlqv_3Xp@MacBook-Air-de-Roger.local>
References: <20230720003205.1828537-1-volodymyr_babchuk@epam.com>
 <20230720003205.1828537-3-volodymyr_babchuk@epam.com>
 <ZLkYdhOPLTmogXGq@MacBook-Air-de-Roger.local>
 <87ila7cvy2.fsf@epam.com>
 <ZMDox0WwumxMGnzV@MacBook-Air-de-Roger.local>
 <87y1j2b296.fsf@epam.com>
 <ZMJmJTkSFLKZXkKB@MacBook-Air-de-Roger.local>
 <87cz0cc2ce.fsf@epam.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <87cz0cc2ce.fsf@epam.com>
X-ClientProxiedBy: LO4P123CA0221.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a6::10) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|SJ0PR03MB5808:EE_
X-MS-Office365-Filtering-Correlation-Id: 06048e53-9dcd-44ac-0e43-08db8f7241c9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	T9/wY5ZTkBsCv7UrLTwLVeOz/PApC06pdcnf6WEQ4yRtYop7zwvGU1dn/J0A2x7ofOwarVwlipNaLuwjqSLARYz5d1gyiBSZApAkybx5bu8wI5nZnja0sdBBC97Z+esaQ7R8HgRfaNf6DaBfWfPcvnE9kqNgkCu4QJhjFHzyB1w0Lse1Roo/vso56GpjcYRgV0sYTExQeCc5W2CrEl4fLpY7yjPrTlVju/B4zFITKJ9x0CdPgbnfq3oZ/CnQwYw4PzvU9QVZcaXi9GSomk1vOy6RTEs9WTCxGjTRrvu0pwDHAb0s6LI2lmWfYdZPEYrkhEVib1SlbkxOTahonL0FFfdtDZFG/LubDCYgANQ59p1WXfPTOaSRUOu4BcVcxCHU3iAmEM2Ms5LBYnyif2CnpDEX9joyiKdmdmE+7KNdqBX/tg5DLdiY6Vlq0Dj2OoWZwj71Mgq5x6v56JcvLKs0ux6uKJgGS3N67tmlRrFgiGFeluP8YvPwcnry1GG43L4Z8pTzl1pc5aWWgpkdHTgmD9yxAiFN0De+RwgX3F7odIOEVFkloSszF43VS1XPvDtc
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(396003)(346002)(366004)(136003)(451199021)(2906002)(316002)(8936002)(8676002)(5660300002)(41300700001)(85182001)(86362001)(6512007)(6486002)(6666004)(54906003)(478600001)(82960400001)(26005)(6506007)(186003)(9686003)(83380400001)(66946007)(38100700002)(66556008)(4326008)(66476007)(6916009);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?elp2ZXdGdnB5eC9hU2pEU0pYb3JJOURZQzVqSCtzS202anBqYzNnTFUyK3d4?=
 =?utf-8?B?SFlvaXhiSDZzc0ZkZFRrQUpPUWhGU1l6YngrZ3IvNml3Um1odXJxTHRnVXEw?=
 =?utf-8?B?MTAyMlJtWTdoZEdlWHJ0bDJqaXgyTk04c1pMa1BYVDZicU14aEhNRHVBMCtt?=
 =?utf-8?B?bUIrU2VLckxESCttUk0rcUhWQkY5bVkzUXMwazc2d25TOVNEd0ZvcE44NXNM?=
 =?utf-8?B?aSt4bGg2dWcwck1sUC9ZbkkydHc3S29lTVdIUlB5NEhwVTR1WVdpUS9uWndU?=
 =?utf-8?B?MFhQMFl2bEJpQmlYUnVCSjU2anJiWEJ0OXBwa1lmdDZ3N2svdGFqVlhnWmdv?=
 =?utf-8?B?TGNVbGFIeWVSQ0s4eWsvMU96TGppLzY3ejFEMlJ5NnR2bWtqLzYzS0N2K0Y0?=
 =?utf-8?B?ck05anVoa0s4bzhxME45UjUwaUc2MTJNNWRjV09CZTNYcGZVRURkYkVBZk03?=
 =?utf-8?B?N3V4cDhJMDBhSHh6T3pLV0dCanFFMlFraEgvRUJEVWwrbFdIT2NhbUdESUh5?=
 =?utf-8?B?dGpQZnJKemxVeTRxSWx3eTVrOWdKYlpZUzJodnM3QkRpVktxek4zKzcvb1RF?=
 =?utf-8?B?MDJhVzBjT3BLcjZnd2dNMzExRDJpbWRlbkRSaDNxOUpGaWVTZExDYVYxejUx?=
 =?utf-8?B?d1VVLzg1TG9QNTdDNmhpZ29SeE1sUSt3REFVM05PR1p6VlBybnRSbTJiQTZL?=
 =?utf-8?B?cUtBNjNFelB1YlNKS1h4SHNKbjNZZ05ZN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hC+aYO+f7asibh0SWBjlAQ3oe4alf6l9MHd2FR+WxOfMSMA7wTvkKEla/WGt+5xienTm3KAVvJ83BiiTyoC0leKHbwU4FHYyNZ00ygAaCiQAspAL55uVMr+ZFsTzdXW/9jxv0xw/eVj03+aokCvcYUZdmEV3S2i26LrTuZS5P1UXlnDGx9mPJBzGVmdebXGZkud1TggEHRlVVCi4OSn36bW2NYbVzeyfDR8P+3jKJznt5bNt83uCS9F/sKsSuHVYt8dlZoIQjvwYFcjuhvxL3L/qszMfV+rvu7XMK0NMNSjL6nbvLcpw6WN2LYVTJdwj20LVt5kW71fmTFVuErv6z+h4gB+CfhQvSOAJQWyje8iiwN62/kx5eCsqzY0oKOkyyHXJZM1TccMTZe3ax9pa1NmJDWJMBE/YPnCuqrKNnfTXdvp4a//FvHNNoSF3kdwb2fC5P/5LAuWN5BaEwF9d+bQAOWiEWumGsNSF8h6P3f457JHbpW+3ozBp8CUtxzWiLWGS+UGOOoj1idbTmjE8fEvw2mhY+YmGadWgUkqXzl+oWELFw==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 06048e53-9dcd-44ac-0e43-08db8f7241c9
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2023 13:55:09.8532
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: sEizpTjNAd/hPi0rSn5zDBZ4DMS78+YIIrmpsubSKcNFXztwYs1PSWQqdip+V9Wa0Tjr6untOJVkGQt2rd8wDQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5808

On Fri, Jul 28, 2023 at 12:21:54AM +0000, Volodymyr Babchuk wrote:
> 
> Hi Roger,
> 
> Roger Pau MonnÃ© <roger.pau@citrix.com> writes:
> 
> > On Thu, Jul 27, 2023 at 12:56:54AM +0000, Volodymyr Babchuk wrote:
> >> Hi Roger,
> >> 
> >> Roger Pau MonnÃ© <roger.pau@citrix.com> writes:
> >> 
> >> > On Wed, Jul 26, 2023 at 01:17:58AM +0000, Volodymyr Babchuk wrote:
> >> >> 
> >> >> Hi Roger,
> >> >> 
> >> >> Roger Pau MonnÃ© <roger.pau@citrix.com> writes:
> >> >> 
> >> >> > On Thu, Jul 20, 2023 at 12:32:31AM +0000, Volodymyr Babchuk wrote:
> >> >> >> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> >> >> >> @@ -498,6 +537,7 @@ void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
> >> >> >>          ASSERT(data_offset < size);
> >> >> >>      }
> >> >> >>      spin_unlock(&pdev->vpci->lock);
> >> >> >> +    unlock_locks(d);
> >> >> >
> >> >> > There's one issue here, some handlers will cal pcidevs_lock(), which
> >> >> > will result in a lock over inversion, as in the previous patch we
> >> >> > agreed that the locking order was pcidevs_lock first, d->pci_lock
> >> >> > after.
> >> >> >
> >> >> > For example the MSI control_write() handler will call
> >> >> > vpci_msi_arch_enable() which takes the pcidevs lock.  I think I will
> >> >> > have to look into using a dedicated lock for MSI related handling, as
> >> >> > that's the only place where I think we have this pattern of taking the
> >> >> > pcidevs_lock after the d->pci_lock.
> >> >> 
> >> >> I'll mention this in the commit message. Is there something else that I
> >> >> should do right now?
> >> >
> >> > Well, I don't think we want to commit this as-is with a known lock
> >> > inversion.
> >> >
> >> > The functions that require the pcidevs lock are:
> >> >
> >> > pt_irq_{create,destroy}_bind()
> >> > unmap_domain_pirq()
> >> >
> >> > AFAICT those functions require the lock in order to assert that the
> >> > underlying device doesn't go away, as they do also use d->event_lock
> >> > in order to get exclusive access to the data fields.  Please double
> >> > check that I'm not mistaken.
> >> 
> >> You are right, all three function does not access any of PCI state
> >> directly. However...
> >> 
> >> > If that's accurate you will have to check the call tree that spawns
> >> > from those functions in order to modify the asserts to check for
> >> > either the pcidevs or the per-domain pci_list lock being taken.
> >> 
> >> ... I checked calls for PT_IRQ_TYPE_MSI case, there is only call that
> >> bothers me: hvm_pi_update_irte(), which calls IO-MMU code via
> >> vmx_pi_update_irte():
> >> 
> >> amd_iommu_msi_msg_update_ire() or msi_msg_write_remap_rte().
> >
> > That path is only for VT-d, so strictly speaking you only need to worry
> > about msi_msg_write_remap_rte().
> >
> > msi_msg_write_remap_rte() does take the IOMMU intremap lock.
> >
> > There are also existing callers of iommu_update_ire_from_msi() that
> > call the functions without the pcidevs locked.  See
> > hpet_msi_set_affinity() for example.
> 
> Thank you for clarifying this.
> 
> I have found another call path which causes troubles:
> __pci_enable_msi[x] is called from pci_enable_msi() via vMSI, via
> physdev_map_irq and also directly from ns16550 driver.

Both vPCI and physdev_map_irq() use the same path: map_domain_pirq()
which gets called with d->event_lock taken in exclusive mode, that
should be enough as a device cannot be assigned to multiple guests.

ns16550_init_postirq() is an init function, which means it won't be
executed after Xen has booted, so I think this is all fine, as
concurrent accesses from ns16550_init_postirq() and map_domain_pirq()
are impossible.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 14:08:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 14:08:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571472.895405 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPO90-0000kg-26; Fri, 28 Jul 2023 14:08:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571472.895405; Fri, 28 Jul 2023 14:08:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPO8z-0000kZ-VV; Fri, 28 Jul 2023 14:08:37 +0000
Received: by outflank-mailman (input) for mailman id 571472;
 Fri, 28 Jul 2023 14:08:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qPO8y-0000kR-7z
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 14:08:36 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPO8w-0008Gn-II; Fri, 28 Jul 2023 14:08:34 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPO8w-0003dP-D4; Fri, 28 Jul 2023 14:08:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=MEpmttx+knm+kGZKPoablProjkNQStd/NcMbONiWQTU=; b=5p8UheWq4yIZm2xzzy/Va7aawL
	SbsoxB+QgHpMaHSFPsRpP1qDhwhRydtKe00V1JT09rUHFhOaf3cz2759xNRsF49+PLRUY7W0K33q5
	3GWu/V/pV3ZecRJq5dOnNOJskMbr01B8CT1h9U++QzGjqUaa8xqy3qGAqe0Pto5z+hOM=;
Message-ID: <ebc61b04-bfc4-592a-df09-7226e32d355b@xen.org>
Date: Fri, 28 Jul 2023 15:08:33 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
Content-Language: en-GB
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
 <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
 <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
 <68acbf84-218b-f2f7-9526-d9e07f845f6e@suse.com>
 <8cea1316-db0b-f29d-c467-6fd5c4a6321c@xen.org>
 <6a376365-a731-2413-16c7-14ede5224eea@suse.com>
 <b8b8e733-6be0-a4d9-33b7-d93366ec0091@xen.org>
 <8a5854d1-2594-ed4f-ace8-e21db4fe4c7b@suse.com>
 <75dc26f0-0ea7-2097-47b2-1f857e1d7236@xen.org>
 <4d36876c-e943-06ac-782d-5d94851040e2@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <4d36876c-e943-06ac-782d-5d94851040e2@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Juergen,

On 28/07/2023 14:24, Juergen Gross wrote:
> On 28.07.23 14:48, Julien Grall wrote:
>> Hi,
>>
>> On 28/07/2023 13:06, Juergen Gross wrote:
>>> On 28.07.23 13:19, Julien Grall wrote:
>>>>>>> In case of a runtime check I
>>>>>>> agree that a more central place would be preferred.
>>>>>>>
>>>>>>> In the end I don't mind that much, but
>>>>>>>
>>>>>>> Â Â Â Â Â BUILD_BUG_ON(XENSTORE_PAYLOAD_MAX >=
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  (typeof((struct node_hdr *)NULL->datalen))(-1));
>>>>>>>
>>>>>>> is a little bit clumsy IMHO.
>>>>>>
>>>>>> Agree. We could introduce FIELD_SIZEOF() (as Linux did) to hide 
>>>>>> the complexity. The code would then look like:
>>>>>>
>>>>>> Â >= (8 * FIELD_SIZEOF(struct node_hdr, datalen))
>>>>>
>>>>> Oh, I guess you mean sizeof_field().
>>>>>
>>>>> And even with that it would look quite clumsy:
>>>>>
>>>>> Â Â Â Â Â BUILD_BUG_ON(XENSTORE_PAYLOAD_MAX >=
>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â  (1UL << (8 * sizeof_field(struct node_hdr, datalen))));
>>>>
>>>> How about keeping the BUILD_BUG_ON() in write_node_raw() and add the 
>>>> following comment on top of handle_input():
>>>>
>>>> Some fields in Xenstored are sized based on the max payload (see 
>>>> various BUILD_BUG_ON()). This would need extra runtime check if we 
>>>> ever decide to have a dynamic payload size.
>>>
>>> I _could_ do that, but where to stop adding such comments?
>>
>> When someone other than the author is able to understand the code 
>> without too much effort. More comments never hurts, less will in the 
>> longer run (see below).
> 
> I agree with that statement in general, but requesting a comment to aid a
> future potential change violating the Xenstore wire protocol is a little 
> bit
> weird.

Well... This is violating the existing protocol, but it is not set in 
stone and I think this is acceptable to update it when there is no 
change for the VMs and for new features (e.g. Live-Update/Live-Migration).

>>>
>>> TBH, I really don't see the point doing that.
>>>
>>> In case a patch came up upstream trying to violate 
>>> XENSTORE_PAYLOAD_MAX I would
>>> surely NACK it.
>> That's assuming you will still be around when this happens :). I am 
>> not wishing anything bad but the code will likely outlast any of us.
> 
> Maybe. But would you really Ack patches adding comments like that in other
> areas?

Potentially yes. We had a similar discussion on Arm when allowing 
paddr_t to be 32-bit.

[...]

>>> In case we need payloads larger than XENSTORE_PAYLOAD_MAX we should 
>>> split the
>>> related operation in multiple parts (see e.g. XS_DIRECTORY_PART or 
>>> XS_CONTROL
>>> for uploading a new kernel to Xenstore-stubdom for live update). 
>>> Which is, BTW,
>>> the way AWS should have handled the migration problem (transactions 
>>> come to my
>>> mind in this context).
>>
>> I wasn't part of the original design, but I can see why it was done 
>> like that.
> 
> I can see why it was done that way, but this doesn't mean I can understand
> why such a design should be supported by adding comments helping to 
> repeat such
> a bad decision.
> 
>> Using multiple commands has also its downside. The first that comes to 
>> my mind if that you need to keep around the data. But, with your 
>> proposal, you we wouldn't be able to store it in the database (like 
>> for transaction update) as datalen can only be 65KB.
> 
> I wasn't aware that a complete transaction needs to be kept in a single 
> data
> base record. :-)

IIUC, you are thinking that the client will restore all the state bits 
by bits. But if you look at the design in 
docs/designs/xenstore-migration.md, this is a blob.

> 
> It would work perfectly fine to allocate the needed memory via talloc() 
> and to
> reference it from a special node being part of the transaction, or to 
> not use
> a node at all (see again the XS_CONTROL example).

I am not convinced the complexity is worth it here. To be honest, I 
think the payload limit should have been relaxed for Live-Update as well 
as you don't gain much to split. That said, this is less a concern 
because you are not time constrained.

[...]

> But maybe that comment was based on wrong assumptions, like the mentioned
> change not violating the protocol. >
>> I am happy to rewrite the comment so it doesn't lead to think that you 
>> (as the maintainer) are open to have a more relax length check.
> 
> Yes, please make a suggestion for a proper comment not suggesting we are 
> fine
> to violate the wire protocol.

Here we go:

"The payload size is not only currently restricted by the protocol but 
also the internal implementation (see various BUILD_BUG_ON())."

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 14:12:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 14:12:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571474.895416 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPOCV-0002Ai-JB; Fri, 28 Jul 2023 14:12:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571474.895416; Fri, 28 Jul 2023 14:12:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPOCV-0002Ab-EJ; Fri, 28 Jul 2023 14:12:15 +0000
Received: by outflank-mailman (input) for mailman id 571474;
 Fri, 28 Jul 2023 14:12:13 +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
 <SRS0=8l51=DO=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qPOCT-0002AV-Kd
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 14:12:13 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id be6e510e-2d50-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 16:12:11 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.163.4.37])
 by support.bugseng.com (Postfix) with ESMTPSA id F26BB4EE073F;
 Fri, 28 Jul 2023 16:12:09 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: be6e510e-2d50-11ee-8613-37d641c3527e
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Paul Durrant <paul@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: [XEN PATCH] IOMMU: address violations of MISRA C:2012 Rules 8.2 and 8.3
Date: Fri, 28 Jul 2023 16:12:02 +0200
Message-Id: <ba140642a267791c619dbbe2ba21f880c7e2b53e.1690551759.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Give a name to unnamed parameters to address violations of
MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
named parameters").
Keep consistency between parameter names and types used in function
declarations and the ones used in the corresponding function
definitions, thus addressing violations of MISRA C:2012 Rule 8.3
("All declarations of an object or function shall use the same names
and type qualifiers").

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/drivers/passthrough/iommu.c | 10 +++++-----
 xen/include/xen/iommu.h         | 30 ++++++++++++++++--------------
 2 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 0e187f6ae3..7bbe3889a2 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -25,10 +25,10 @@
 unsigned int __read_mostly iommu_dev_iotlb_timeout = 1000;
 integer_param("iommu_dev_iotlb_timeout", iommu_dev_iotlb_timeout);
 
-bool_t __initdata iommu_enable = 1;
-bool_t __read_mostly iommu_enabled;
-bool_t __read_mostly force_iommu;
-bool_t __read_mostly iommu_verbose;
+bool __initdata iommu_enable = 1;
+bool __read_mostly iommu_enabled;
+bool __read_mostly force_iommu;
+bool __read_mostly iommu_verbose;
 static bool_t __read_mostly iommu_crash_disable;
 
 #define IOMMU_quarantine_none         0 /* aka false */
@@ -57,7 +57,7 @@ int8_t __hwdom_initdata iommu_hwdom_reserved = -1;
 bool __read_mostly iommu_hap_pt_share = true;
 #endif
 
-bool_t __read_mostly iommu_debug;
+bool __read_mostly iommu_debug;
 
 DEFINE_PER_CPU(bool_t, iommu_dont_flush_iotlb);
 
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 405db59971..8c0818cd01 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -52,7 +52,7 @@ static inline bool_t dfn_eq(dfn_t x, dfn_t y)
 }
 
 #ifdef CONFIG_HAS_PASSTHROUGH
-extern bool_t iommu_enable, iommu_enabled;
+extern bool iommu_enable, iommu_enabled;
 extern bool force_iommu, iommu_verbose;
 /* Boolean except for the specific purposes of drivers/passthrough/iommu.c. */
 extern uint8_t iommu_quarantine;
@@ -108,8 +108,8 @@ static inline void clear_iommu_hap_pt_share(void)
 #endif
 }
 
-extern bool_t iommu_debug;
-extern bool_t amd_iommu_perdev_intremap;
+extern bool iommu_debug;
+extern bool amd_iommu_perdev_intremap;
 
 extern bool iommu_hwdom_strict, iommu_hwdom_passthrough, iommu_hwdom_inclusive;
 extern int8_t iommu_hwdom_reserved;
@@ -165,10 +165,10 @@ enum
  * values indicate partial completion, which is possible only with
  * IOMMUF_preempt passed in.
  */
-long __must_check iommu_map(struct domain *d, dfn_t dfn, mfn_t mfn,
+long __must_check iommu_map(struct domain *d, dfn_t dfn0, mfn_t mfn0,
                             unsigned long page_count, unsigned int flags,
                             unsigned int *flush_flags);
-long __must_check iommu_unmap(struct domain *d, dfn_t dfn,
+long __must_check iommu_unmap(struct domain *d, dfn_t dfn0,
                               unsigned long page_count, unsigned int flags,
                               unsigned int *flush_flags);
 
@@ -197,11 +197,13 @@ bool_t iommu_has_feature(struct domain *d, enum iommu_feature feature);
 
 #ifdef CONFIG_HAS_PCI
 struct pirq;
-int hvm_do_IRQ_dpci(struct domain *, struct pirq *);
-int pt_irq_create_bind(struct domain *, const struct xen_domctl_bind_pt_irq *);
-int pt_irq_destroy_bind(struct domain *, const struct xen_domctl_bind_pt_irq *);
+int hvm_do_IRQ_dpci(struct domain *d, struct pirq *pirq);
+int pt_irq_create_bind(struct domain *d,
+                       const struct xen_domctl_bind_pt_irq *pt_irq_bind);
+int pt_irq_destroy_bind(struct domain *d,
+                        const struct xen_domctl_bind_pt_irq *pt_irq_bind);
 
-struct hvm_irq_dpci *domain_get_irq_dpci(const struct domain *);
+struct hvm_irq_dpci *domain_get_irq_dpci(const struct domain *d);
 void free_hvm_irq_dpci(struct hvm_irq_dpci *dpci);
 
 struct msi_desc;
@@ -229,8 +231,8 @@ int iommu_release_dt_devices(struct domain *d);
  */
 int iommu_add_dt_device(struct dt_device_node *np);
 
-int iommu_do_dt_domctl(struct xen_domctl *, struct domain *,
-                       XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
+int iommu_do_dt_domctl(struct xen_domctl *domctl, struct domain *d,
+                       XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
 
 #endif /* HAS_DEVICE_TREE */
 
@@ -386,12 +388,12 @@ static inline int iommu_do_domctl(struct xen_domctl *domctl, struct domain *d,
 int __must_check iommu_suspend(void);
 void iommu_resume(void);
 void iommu_crash_shutdown(void);
-int iommu_get_reserved_device_memory(iommu_grdm_t *, void *);
+int iommu_get_reserved_device_memory(iommu_grdm_t *func, void *ctxt);
 int iommu_quarantine_dev_init(device_t *dev);
 
 #ifdef CONFIG_HAS_PCI
-int iommu_do_pci_domctl(struct xen_domctl *, struct domain *d,
-                        XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
+int iommu_do_pci_domctl(struct xen_domctl *domctl, struct domain *d,
+                        XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
 #endif
 
 void iommu_dev_iotlb_flush_timeout(struct domain *d, struct pci_dev *pdev);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 14:13:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 14:13:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571478.895425 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPODz-0002lX-2m; Fri, 28 Jul 2023 14:13:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571478.895425; Fri, 28 Jul 2023 14:13:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPODy-0002lQ-UQ; Fri, 28 Jul 2023 14:13:46 +0000
Received: by outflank-mailman (input) for mailman id 571478;
 Fri, 28 Jul 2023 14:13:46 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPODx-0002lG-VT; Fri, 28 Jul 2023 14:13:45 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPODx-0008ME-S3; Fri, 28 Jul 2023 14:13:45 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPODx-0002hE-B5; Fri, 28 Jul 2023 14:13:45 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qPODx-0001J1-8X; Fri, 28 Jul 2023 14:13:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=TDVEdFAcqhqOduCB7pAdCou7iw0oceHMyDN16AVfmZA=; b=Fp9o5s3rD14PdxUPGZxUv7Y+JG
	22dinJ3YsI2ouQD57Wh0Qp2SqfoGM/nq5hjGdPp0Be2RGlVg6XfO7nR/8ej9gXw0NPVQpj2myX9O0
	GY0WG+m20s/Lb7rnUFI9QTgOuPZLdRr32XTrBGPdOABvyAet1isDd0CeowWWgvTr5MmU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182041-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 182041: regressions - FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:regression
    xen-unstable:test-amd64-i386-freebsd10-amd64:xen-install:fail:heisenbug
    xen-unstable:test-amd64-i386-pair:xen-install/dst_host:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=f126d7eeba33a1de04f6d9f6f64855637d4eadb9
X-Osstest-Versions-That:
    xen=0b1171be87698bc7d14760383c0770aeb6e41dd4
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 28 Jul 2023 14:13:45 +0000

flight 182041 xen-unstable real [real]
flight 182057 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/182041/
http://logs.test-lab.xenproject.org/osstest/logs/182057/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail REGR. vs. 182012

Tests which are failing intermittently (not blocking):
 test-amd64-i386-freebsd10-amd64  7 xen-install      fail pass in 182057-retest
 test-amd64-i386-pair        11 xen-install/dst_host fail pass in 182057-retest
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 182057-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182012
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 182012
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 182012
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182012
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 182012
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182012
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 182012
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 182012
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 182012
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 182012
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 182012
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182012
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 xen                  f126d7eeba33a1de04f6d9f6f64855637d4eadb9
baseline version:
 xen                  0b1171be87698bc7d14760383c0770aeb6e41dd4

Last test of basis   182012  2023-07-25 19:27:43 Z    2 days
Failing since        182027  2023-07-26 21:35:59 Z    1 days    2 attempts
Testing same since   182041  2023-07-27 12:41:57 Z    1 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Anthony PERARD <anthony.perard@citrix.com>
  Federico Serafini <federico.serafini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Leo Yan <leo.yan@linaro.org>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Roger Pau Monne <roger.pau@citrix.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>
  Simone Ballarin <simone.ballarin@bugseng.com>
  Stefano Stabellini <sstabellini@kernel.org>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              fail    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 395 lines long.)


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 14:14:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 14:14:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571482.895435 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPOEd-0003Gq-Ae; Fri, 28 Jul 2023 14:14:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571482.895435; Fri, 28 Jul 2023 14:14:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPOEd-0003Gj-7e; Fri, 28 Jul 2023 14:14:27 +0000
Received: by outflank-mailman (input) for mailman id 571482;
 Fri, 28 Jul 2023 14:14:25 +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
 <SRS0=6gb0=DO=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qPOEb-0003GK-1O
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 14:14:25 +0000
Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com
 [2a00:1450:4864:20::42f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0cc76e23-2d51-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 16:14:22 +0200 (CEST)
Received: by mail-wr1-x42f.google.com with SMTP id
 ffacd0b85a97d-31763b2c5a4so2233462f8f.3
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 07:14:22 -0700 (PDT)
Received: from EMEAENGAAD19049. ([2.223.46.215])
 by smtp.gmail.com with ESMTPSA id
 d4-20020adfe884000000b003143cdc5949sm5050822wrm.9.2023.07.28.07.14.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 28 Jul 2023 07:14:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0cc76e23-2d51-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690553662; x=1691158462;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=zveqsV0CdVNO13A22Mf5DVV3cMqTKJ94j6oYQIug6SE=;
        b=kNUHbzl5HIo0Hbo+QbgMSdzFs/08S+/oSkKm3qZMw9hdCJDNy3wautRzq8OfFzuL7W
         WODa1WHWoCjumZf526EPelQNte92c4gjeI4pe3lehZ67tcuvVCPwpeK47nneP8u18XNn
         T4aiCGgRqC2Q9Kz+lHuqudnk6RgdilWtFskrM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690553662; x=1691158462;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=zveqsV0CdVNO13A22Mf5DVV3cMqTKJ94j6oYQIug6SE=;
        b=WgAuAplvfklc1G3d4eqhos7Ghe5EIuxmpXeq3x3kY3GTQ7iDBPyB+TGXmjHsfPylF7
         QPjruzKNeOBmPowxmamwjgZ557cqD5Ad1RpmBGcVSIl6Wu2iOluUqKJIzIAeIwkrL5zU
         ldbGIyi8JVMFCoI7pTk2cggkKW62H/2VJESK2IOpsWV8/HFt3sJjdPbFqTTPpXO92e72
         T/0f0ydNABQqXBSXvoB2788NH6fNQSH52m8pln01GggIsn0TRf/UwTvX2yaqJ/UBiokx
         3l8cKBveVva+OBzhYmnN8PYzkayFd9uFFZ7OXlVejlNSzK7UhmBuGi5H7fFUpUwoU18t
         LfSQ==
X-Gm-Message-State: ABy/qLY/Pog8XicrNDEJIDjC2R50DUR7ACqJ/02rOrw/PTAMYebgJr+p
	bMEahAB2zSEOR3AQ/BzOrVbiRg==
X-Google-Smtp-Source: APBJJlHv99EQuoAQc62kTaJlK7rz1OfiyKKZBEn4F6t5ciBnSeAa9uMn9E8j2CmVr4m44ALTR6bctw==
X-Received: by 2002:a05:6000:103:b0:317:60fc:d3c8 with SMTP id o3-20020a056000010300b0031760fcd3c8mr1998905wrx.71.1690553662059;
        Fri, 28 Jul 2023 07:14:22 -0700 (PDT)
Message-ID: <64c3cd3d.df0a0220.af633.8875@mx.google.com>
X-Google-Original-Message-ID: <ZMPNNHsAjJOUE/Ky@EMEAENGAAD19049.>
Date: Fri, 28 Jul 2023 15:14:12 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Luca Fancellu <luca.fancellu@arm.com>
Cc: xen-devel@lists.xenproject.org, bertrand.marquis@arm.com,
	wei.chen@arm.com, Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Subject: Re: [RFC PATCH 0/5] clang-format for Xen
References: <20230728081144.4124309-1-luca.fancellu@arm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20230728081144.4124309-1-luca.fancellu@arm.com>

On Fri, Jul 28, 2023 at 09:11:39AM +0100, Luca Fancellu wrote:
> ## Introduction ################################################################
> 
> In this serie, I would like to get feedbacks on the output generated by the
> configuration of clang-format, unfortunately we can't use only clang-format, but
> we need to call it using a wrapper, because we need the information of what
> files need to be excluded from the tool.
> 
> Another reason is that clang-format has some limitation when formatting asm()
> instruction and most of the time it format them in a very ugly way or it breaks
> the code for example removing spaces that were there for a reason (I don't think
> it's a tool to format asm), so in the wrapper script we protect all asm()
> invocation or macros where there are asm() invocation with in-code comments that
> stops clang-format to act on that section:
> 
> /* clang-format off */section/* clang-format on */
> 
> I've read the past threads about the brave people who dared to try to introduce
> clang-format for the xen codebase, some of them from 5 years ago, two points
> were clear: 1) goto label needs to be indented and 2) do-while loops have the
> braket in the same line.
> While point 1) was quite a blocker, it seemd to me that point 2) was less
> controversial to be changed in the Xen codestyle, so the current wrapper script
> handles only the point 1 (which is easy), the point 2 can be more tricky to
> handle.
> 
> ## The clang-format configuration ##############################################
> 
> In my clang-format configuration I've taken inspiration from EPAM's work, then
> from the configuration in Linux and finally from the clang-format manual, to try
> to produce a comprehensive configuration.
> 
> Every configuration parameter has on top a comment with the description and
> when it was supported, finally I've added also a [not specified] if that
> behavior is not clearly specified in the Xen coding style, I've done that so
> we could discuss about adding more specification in our CODING_STYLE.
> Every comment can be stripped out in the final release of the file, but I think
> that now they are useful for the discussion.
> 
> The minimum clang-format version for the file is 15, my ubuntu 22.04 comes with
> it, we can reason if it's too high, or if we could also use the latest version
> maybe shipped inside a docker image.
15 sounds ok \methinks. In practice we'll just stick it in GitLab and let
it check commits, so we'll be safe even in the case where every developer
has a slightly different version of the tool. I wouldn't try to make this
(hard) task harder by trying to retrofit it in an older version.

It might be worth stitching a flag in the python script to scream if the
clang-format version doesn't match. Or it may do a mess of the tree.

> 
> For every [not specified] behavior, I've tried to guess it from the codebase,
> I've seen that also in that case it's not easy as there is (sometimes) low
> consistency between modules, so we can discuss on every configurable.
> 
> Worth to mention, the public header are all excluded from the format tool,
> because formatting them breaks the build on X86, because there are scripts for
> auto-generation that don't handle the formatted headers, I didn't investigate
> on it, maybe it can be added as technical debt.
Sounds reasonable to me.

> 
> So I've tried building arm32, arm64 and x86_64 with the formatted output and
> they build, I've used Yocto for that.
> 
> ## How to try it? ##############################################################
> 
> So how to generate everything? Just invoke the codestyle.py script without
> parameter and it will format every .c and .h file in the hypervisor codebase.
> 
> ./xen/scripts/codestyle.py
> 
> Optionally you can also pass one or more relative path from the folder you are
> invoking the script and it will format only them.
Worth mentioning that we need a strategy for checking the consistency as
well. The typical fashion is to invoke clang-format as:

  clang-format -Werrror --dry-run

Seeing that there's an external script we probably want some plan for
checking things in CI as well.

> 
> ## What I expect from this RFC #################################################
> 
> I expect feedback on the output, some agreement on what configuration to use,
> and I expect to find possible blocker before working seriously on this serie,
> because if there are outstanding blockers on the adoption of the tool and we
> can't reach an agreement, I won't spend further time on it.
> 
> I understand that the release is coming soon and some people are on holiday in
> this period, so worst case I will ping again after the release.
> 
> Luca Fancellu (5):
>   [WIP]misra: add entries to the excluded list
>   [WIP]cppcheck: rework exclusion_file_list.py code
>   [WIP]xen/scripts: add codestyle.py script
>   x86/HVM: protect mm_type_tbl format from clang-format
>   xen: Add clang-format configuration
> 
>  docs/misra/exclude-list.json                  |  88 +++
>  xen/.clang-format                             | 693 ++++++++++++++++++
>  xen/arch/x86/hvm/mtrr.c                       |   2 +
>  xen/scripts/codestyle.py                      | 261 +++++++
>  xen/scripts/xen_analysis/cppcheck_analysis.py |   6 +-
>  .../xen_analysis/exclusion_file_list.py       |  31 +-
>  6 files changed, 1063 insertions(+), 18 deletions(-)
>  create mode 100644 xen/.clang-format
>  create mode 100755 xen/scripts/codestyle.py
> 
> -- 
> 2.34.1
> 
> 


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 14:32:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 14:32:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571486.895448 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPOVo-0005uT-Tg; Fri, 28 Jul 2023 14:32:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571486.895448; Fri, 28 Jul 2023 14:32:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPOVo-0005uM-Qr; Fri, 28 Jul 2023 14:32:12 +0000
Received: by outflank-mailman (input) for mailman id 571486;
 Fri, 28 Jul 2023 14:32:12 +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 <SRS0=Gg45=DO=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qPOVo-0005uG-0F
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 14:32:12 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8827952f-2d53-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 16:32:09 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 141B31F8A4;
 Fri, 28 Jul 2023 14:32:08 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D958B13276;
 Fri, 28 Jul 2023 14:32:07 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id z6UgM2fRw2SSKQAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 28 Jul 2023 14:32:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8827952f-2d53-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690554728; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=bvmRvG9UQ6Glg+ejYwcpLDsrsWmKKXP/m6tVM8agjko=;
	b=k1/z24UphHT9SVIupXGK5QRxh3mh9qUl8lVwiupIqajvhX651FHBg6wJOmNkZbysDR2EBX
	jTlnInaiLW2LO5nduFH5xepL7mos/TcS5In5qz6o2+r/IhObYko65I5B/9bjgO2cupZ68C
	y16S50gKRnyttHJ5Z7sG7Yk+DkJwdzo=
Message-ID: <daaf9af4-639e-c6fb-890b-852c0781271c@suse.com>
Date: Fri, 28 Jul 2023 16:32:07 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
 <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
 <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
 <68acbf84-218b-f2f7-9526-d9e07f845f6e@suse.com>
 <8cea1316-db0b-f29d-c467-6fd5c4a6321c@xen.org>
 <6a376365-a731-2413-16c7-14ede5224eea@suse.com>
 <b8b8e733-6be0-a4d9-33b7-d93366ec0091@xen.org>
 <8a5854d1-2594-ed4f-ace8-e21db4fe4c7b@suse.com>
 <75dc26f0-0ea7-2097-47b2-1f857e1d7236@xen.org>
 <4d36876c-e943-06ac-782d-5d94851040e2@suse.com>
 <ebc61b04-bfc4-592a-df09-7226e32d355b@xen.org>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
In-Reply-To: <ebc61b04-bfc4-592a-df09-7226e32d355b@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------vAj0gu0xMo6mCvlIGCgtbafQ"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------vAj0gu0xMo6mCvlIGCgtbafQ
Content-Type: multipart/mixed; boundary="------------DIEBHJyoQsyuPhIMfXIpHhXL";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <daaf9af4-639e-c6fb-890b-852c0781271c@suse.com>
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
 <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
 <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
 <68acbf84-218b-f2f7-9526-d9e07f845f6e@suse.com>
 <8cea1316-db0b-f29d-c467-6fd5c4a6321c@xen.org>
 <6a376365-a731-2413-16c7-14ede5224eea@suse.com>
 <b8b8e733-6be0-a4d9-33b7-d93366ec0091@xen.org>
 <8a5854d1-2594-ed4f-ace8-e21db4fe4c7b@suse.com>
 <75dc26f0-0ea7-2097-47b2-1f857e1d7236@xen.org>
 <4d36876c-e943-06ac-782d-5d94851040e2@suse.com>
 <ebc61b04-bfc4-592a-df09-7226e32d355b@xen.org>
In-Reply-To: <ebc61b04-bfc4-592a-df09-7226e32d355b@xen.org>

--------------DIEBHJyoQsyuPhIMfXIpHhXL
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nQsIG1heWJlIHdpdGggdGhlIGFkZGl0aW9uOg0KIkFu
eSBwb3RlbnRpYWwgY2hhbmdlIG9mIHRoZSBtYXhpbXVtIHBheWxvYWQgc2l6ZSBuZWVkcyB0
byBiZSBuZWdvdGlhdGVkIGJldHdlZW4NCnRoZSBpbnZvbHZlZCBwYXJ0aWVzLiINCg0KDQpK
dWVyZ2VuDQo=
--------------zp1Hs5eeLgGoIdoRaU6EIV0q
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaS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dgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------zp1Hs5eeLgGoIdoRaU6EIV0q--

--------------DIEBHJyoQsyuPhIMfXIpHhXL--

--------------vAj0gu0xMo6mCvlIGCgtbafQ
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmTD0WcFAwAAAAAACgkQsN6d1ii/Ey+Z
iwf/anK4SeWdm0wKXmUu8a0779eqK2pYUbL+c2ZStx5qABH5/03Zz+xYa+4UqUhB8Vgw6apOjiLD
qxT+gS1qbJIMC6mr/QEmBbwmI7mrF6CXGwEZKyP36bIh4FIYVE1tywfcjKNOnbxfdeobbennNJfD
OcnbCIubwyb0e3aSlOZ1/6qui4N1ywqjfilfryQw/xdTVCVK6UUsIUIMhwPRWRO9Lnza2DR8T7FJ
JzlSWSmfgAZWxRQ8PuX2b5cVVkg0CgB/0h2QJf06ibGT+mLKwZc1Y7LTI0AccMJm0Crek4uuBgMh
YKHKduEzyfn2/yh3HT5N4ICkHcWi1FKS9lMcNDdC4Q==
=68Hm
-----END PGP SIGNATURE-----

--------------vAj0gu0xMo6mCvlIGCgtbafQ--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 14:40:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 14:40:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571488.895458 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPOdU-0007Pp-M6; Fri, 28 Jul 2023 14:40:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571488.895458; Fri, 28 Jul 2023 14:40:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPOdU-0007Pi-JR; Fri, 28 Jul 2023 14:40:08 +0000
Received: by outflank-mailman (input) for mailman id 571488;
 Fri, 28 Jul 2023 14:40:07 +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
 <SRS0=6gb0=DO=tibco.com=avallejo@srs-se1.protection.inumbo.net>)
 id 1qPOdT-0007Kq-1A
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 14:40:07 +0000
Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com
 [2a00:1450:4864:20::329])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a38a06db-2d54-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 16:40:04 +0200 (CEST)
Received: by mail-wm1-x329.google.com with SMTP id
 5b1f17b1804b1-3fe110de3b6so3815465e9.1
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 07:40:04 -0700 (PDT)
Received: from EMEAENGAAD19049. ([2.223.46.215])
 by smtp.gmail.com with ESMTPSA id
 r18-20020adfce92000000b0031272fced4dsm4966550wrn.52.2023.07.28.07.40.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 28 Jul 2023 07:40:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a38a06db-2d54-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690555203; x=1691160003;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=WhW4JNpGwKaEVPVIJKMl0AJ7ON5qkgm5mDbRBU1PCKk=;
        b=OmbtEcNE8HWvAkwKVMCCkeXevw7YOY2B7zoIuk9cQjcwnxltHlJ+p1YXTpY9D9Dbdu
         r/CAzbWe23pSGoxoNLtePnVnP2gN82F8QlTlREIKNmJoZv6TiJpGg/onxePN0s+xjAfd
         aHKQGt2mzqwqQ/nUTG+YmZsPEmi2uZGzlp54M=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690555203; x=1691160003;
        h=in-reply-to:content-disposition:mime-version:references:subject:cc
         :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=WhW4JNpGwKaEVPVIJKMl0AJ7ON5qkgm5mDbRBU1PCKk=;
        b=RWw+bj251cPo9fGH2pO7Vz/bqg+LXlnFqoCplw5zC23Mk1PAY//FwbghXieUeljVLi
         WjMjI1WFTcVpNqjY+RTPYeeLmjztNcpngz/4wOE7ynTuPHGrnMzb5DkNpwTJTgIUnmCo
         5LFThOCuB+6LfthgWboQuzyLtgXbMpsrZLgc9mEEyeKgb2zBJ/QvkR33ZXtfGsO0gC6z
         UVpUea+nMbpgOWLKqES3Ud3z0CjD31dqaSeed1XaszeOk0PeBDgtNtVtLbprrCxDAupz
         /LUSVJRukduzf5yspjB1THKHm2U5RdEh9LE0BfPckIOrisgpO3BCYsJFLCz4T7JpkDxi
         64og==
X-Gm-Message-State: ABy/qLZL8Z7eixZiGcC+cwgKtyqVicDa52XzjAFt2njY+TBcMpm9UgVt
	phuo6OdHZPqFqpam9DR5TJDdYg==
X-Google-Smtp-Source: APBJJlH/6tV2m7BDV8nYdhqp3Dw2w7232nIZ10SGtE6bvDS4U/GwNuJWujQnAcvWoGQB3sbv53TDAg==
X-Received: by 2002:a05:600c:1d09:b0:3fa:7c6b:86e with SMTP id l9-20020a05600c1d0900b003fa7c6b086emr4866647wms.12.1690555203573;
        Fri, 28 Jul 2023 07:40:03 -0700 (PDT)
Message-ID: <64c3d343.df0a0220.7ca91.866e@mx.google.com>
X-Google-Original-Message-ID: <ZMPTOb7o9h0tfkg9@EMEAENGAAD19049.>
Date: Fri, 28 Jul 2023 15:39:53 +0100
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Luca Fancellu <luca.fancellu@arm.com>
Cc: xen-devel@lists.xenproject.org, bertrand.marquis@arm.com,
	wei.chen@arm.com, Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
Subject: Re: [RFC PATCH 5/5] xen: Add clang-format configuration
References: <20230728081144.4124309-1-luca.fancellu@arm.com>
 <20230728081144.4124309-6-luca.fancellu@arm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20230728081144.4124309-6-luca.fancellu@arm.com>

Hi,

The exclusion of certain files definitely makes it a lot easier to see
what's going on!

I'll start with a couple that I find incompatible

On Fri, Jul 28, 2023 at 09:11:44AM +0100, Luca Fancellu wrote:
> Add a clang format configuration for the Xen Hypervisor.
> 
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> ---
>  xen/.clang-format | 693 ++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 693 insertions(+)
>  create mode 100644 xen/.clang-format
>
> [snip]

I think this one...
> +# [not specified]
> +# Align consecutive assignments (supported in clang-format 3.8)
> +AlignConsecutiveAssignments:
> +  Enabled: true
> +  AcrossEmptyLines: true
> +  AcrossComments: false
> +

... and this one...
> +# [not specified]
> +# Do not align consecutive bit fields (supported in clang-format 11)
> +AlignConsecutiveBitFields: None
...ought to have the same setting because they both have the same
rationale. Ideally I'd like them both turned off so the context involved in
new patches is kept small, but others' ideas might vary.

Thanks,
Alejandro


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 14:59:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 14:59:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571490.895467 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPOwF-0000dA-8X; Fri, 28 Jul 2023 14:59:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571490.895467; Fri, 28 Jul 2023 14:59:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPOwF-0000d3-61; Fri, 28 Jul 2023 14:59:31 +0000
Received: by outflank-mailman (input) for mailman id 571490;
 Fri, 28 Jul 2023 14:59:29 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qPOwD-0000cx-Go
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 14:59:29 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPOwC-0000zB-0v; Fri, 28 Jul 2023 14:59:28 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPOwB-0005ic-PZ; Fri, 28 Jul 2023 14:59:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=6SUlWDQvVg/Nr067M1+I1QRHYItJKTUOBcBIoN2Mvgg=; b=zjt+7rrZWXD25txd8lGqpPfc7X
	3yNkziNxldil3t6l7pMudWnpymMD5A0fiHozyLTNqcE5PjRGXf89FbwsC1g2DHdfQad2085Wl4tMe
	NGQRauhMRdDUDdLU7Gy0nPME93b+/v0/JXkv99jJuzmzAJr2Y1WaWZyecHL0NhQ5spMg=;
Message-ID: <fa5cdab9-1bfe-7859-0629-3b23dcd6f16b@xen.org>
Date: Fri, 28 Jul 2023 15:59:25 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
Content-Language: en-GB
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
 <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
 <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
 <68acbf84-218b-f2f7-9526-d9e07f845f6e@suse.com>
 <8cea1316-db0b-f29d-c467-6fd5c4a6321c@xen.org>
 <6a376365-a731-2413-16c7-14ede5224eea@suse.com>
 <b8b8e733-6be0-a4d9-33b7-d93366ec0091@xen.org>
 <8a5854d1-2594-ed4f-ace8-e21db4fe4c7b@suse.com>
 <75dc26f0-0ea7-2097-47b2-1f857e1d7236@xen.org>
 <4d36876c-e943-06ac-782d-5d94851040e2@suse.com>
 <ebc61b04-bfc4-592a-df09-7226e32d355b@xen.org>
 <daaf9af4-639e-c6fb-890b-852c0781271c@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <daaf9af4-639e-c6fb-890b-852c0781271c@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 28/07/2023 15:32, Juergen Gross wrote:
> On 28.07.23 16:08, Julien Grall wrote: >>>> Using multiple commands has also its downside. The first that comes
>>>> to my mind if that you need to keep around the data. But, with your 
>>>> proposal, you we wouldn't be able to store it in the database (like 
>>>> for transaction update) as datalen can only be 65KB.
>>>
>>> I wasn't aware that a complete transaction needs to be kept in a 
>>> single data
>>> base record. :-)
>>
>> IIUC, you are thinking that the client will restore all the state bits 
>> by bits. But if you look at the design in 
>> docs/designs/xenstore-migration.md, this is a blob.
> 
> Of course it is.
> 
> I was never assuming that the state would be applied piecemeal, this has to
> happen atomically.

I am confused because I don't see how this related to the discussion. 
Above, you mention a transaction, which I interpreted as the client 
would open a transaction and do a bunch of "write note", "set 
permissions"... And then commit the transaction.

I thought this is what you talked about and this would still be 
atomically. My point with the blob is that the parsing of the state is 
done by Xenstored, not the client.

> 
>>> It would work perfectly fine to allocate the needed memory via 
>>> talloc() and to
>>> reference it from a special node being part of the transaction, or to 
>>> not use
>>> a node at all (see again the XS_CONTROL example).
>>
>> I am not convinced the complexity is worth it here. To be honest, I 
>> think the payload limit should have been relaxed for Live-Update as 
>> well as you don't gain much to split. That said, this is less a 
>> concern because you are not time constrained.
>>
>> [...]
>>
>>> But maybe that comment was based on wrong assumptions, like the 
>>> mentioned
>>> change not violating the protocol. >
>>>> I am happy to rewrite the comment so it doesn't lead to think that 
>>>> you (as the maintainer) are open to have a more relax length check.
>>>
>>> Yes, please make a suggestion for a proper comment not suggesting we 
>>> are fine
>>> to violate the wire protocol.
>>
>> Here we go:
>>
>> "The payload size is not only currently restricted by the protocol but 
>> also the internal implementation (see various BUILD_BUG_ON())."
> 
> Hmm, I'm still feeling uneasy to imply that the payload size might be 
> changed.
> See above reasoning.
> 
> The only way I could imagine this being possible would be a per-ring-page
> attribute with both sides agreeing to the max allowed size (the minimum 
> being
> today's value).
> 
> With that in mind I can hesitantly add the comment, maybe with the 
> addition:
> "Any potential change of the maximum payload size needs to be negotiated 
> between
> the involved parties."

I am ok with that.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 15:00:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 15:00:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571492.895477 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPOx2-0001zj-Ir; Fri, 28 Jul 2023 15:00:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571492.895477; Fri, 28 Jul 2023 15:00:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPOx2-0001zc-GC; Fri, 28 Jul 2023 15:00:20 +0000
Received: by outflank-mailman (input) for mailman id 571492;
 Fri, 28 Jul 2023 15:00:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=UUpw=DO=citrix.com=prvs=566eed887=roger.pau@srs-se1.protection.inumbo.net>)
 id 1qPOx1-0001Ov-Qc
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 15:00:20 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 763b37df-2d57-11ee-b24d-6b7b168915f2;
 Fri, 28 Jul 2023 17:00:18 +0200 (CEST)
Received: from mail-bn8nam11lp2168.outbound.protection.outlook.com (HELO
 NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.168])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 28 Jul 2023 11:00:07 -0400
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21)
 by CH0PR03MB6036.namprd03.prod.outlook.com (2603:10b6:610:bf::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Fri, 28 Jul
 2023 15:00:00 +0000
Received: from SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767]) by SJ0PR03MB6423.namprd03.prod.outlook.com
 ([fe80::2e0e:5665:96a7:5767%3]) with mapi id 15.20.6631.026; Fri, 28 Jul 2023
 15:00:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 763b37df-2d57-11ee-b24d-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690556418;
  h=from:to:cc:subject:date:message-id:
   content-transfer-encoding:mime-version;
  bh=7D19uLmGjZGAO/qNM7axaDAHovChSZ8H5rumbbRz9fo=;
  b=KBgl8uODLdmE0p80BoxXV9OlipMQFznBoerziU+Uk9iz9QxhQLfqOp5x
   6pmoqsdqDHXP+58L+cbSHhYJKBx8Vnxg3q5GIvob7WrCxNUg7D9bcz80Z
   bp+6ZuCTlf4CK/VZbJAD1Z55p2QEcygyyEgwFMv/Bq8wxXhhFjvC3Dwb6
   U=;
X-IronPort-RemoteIP: 104.47.58.168
X-IronPort-MID: 120420115
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:0/eSqqvS7tE/z6mD1JNkBIP1GOfnVJhfMUV32f8akzHdYApBsoF/q
 tZmKWyDafqOZGD8L9F+btu0o0kEsJeGn4NkTgVuqSk0HnxB+JbJXdiXEBz9bniYRiHhoOCLz
 O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQq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YE7CaHAo=
X-Talos-MUID: =?us-ascii?q?9a23=3A5W8NkQ85GX0p7NkcVqrGvWeQf/lo/L6SFEkRq7E?=
 =?us-ascii?q?hpPKCCAJiGAePhzviFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,237,1684814400"; 
   d="scan'208";a="120420115"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=nGElOZK/hRnfPno8nIcALlnofCjuCbNCCR6gv8E99gSg0d0bvGitY9bsEDqtSo+ki+ErB6nPyqqIr1j14HL57a+qHeWWdOk1bZSHt5nE+sqAyY/n44O/lv7CtH56PIRaAWACHRRmwGmh5DAzHoFtLZlgQyK+yhUMFnwifi3hlS1TPohbYseopUvT3KZrtWUujWWzeXjWtE7NlnwvFPoeikmczrPf7CCbKLVLf4hl9WBH3Jp3JM7qeSQxG9lIphb/dbA47jcQPEfeI1Uqd+9IOPgGRaaxXNSc4RAmibPXRX0bm2xIn8/5uMKS7GwFKGliM8xOUruq8XBzB5Rai55ihg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=shzfUpIOvf8C3SbtOW+PVv/ldzrXVQ7bEtwQXyg5sMs=;
 b=FEiDdQUYSRhgirpwJ/RgwoAOW4xJpmAa2SYMNBXnf+5fKfi7xB9hF4SHjwzjZyNiHEXLbXl/OGfWMVeY4t8aYgK0XQRisrlNTHXslCC/htTNXIgiwaA9VFGYklX6qR5uz8M9d4ibm59PCZN3RdwJH0FRncEEJPubOa4ow7MOmWE/xYWilHqBZDK4aOy06qveR4ZmK96jpLOzG5YBCHS4Q4N6lV9z+fS2PQvQSvfre8nTgxUkxeByUQwCffwJ1HiI6j8wstT8ysKkiUgq4cnpkmmyFxY0Sxm4Illw/ECVGZetj5AonxGqpWtSzbQCSqIlQZiZR65y91IxPbpeGSGt0w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=shzfUpIOvf8C3SbtOW+PVv/ldzrXVQ7bEtwQXyg5sMs=;
 b=YvpfEv5MAlnF5h92/DygRmtleQb2p6U7aX/uswmAz8GWGnoNeF3azrpovyAPqpTCzeEZP6KiGRkQRem/XBJixjL7H//6pU/aIDjGYgCGVESgOMn23vDRPxasTMEFSAEn8Igr8KMRtYf6qSw8WrpGm09CqVZok8W8MzrtpkYtnC0=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v3] amd: disable C6 after 1000 days on Zen2
Date: Fri, 28 Jul 2023 16:47:29 +0200
Message-ID: <20230728144729.17446-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.41.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P123CA0016.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:a6::28) To SJ0PR03MB6423.namprd03.prod.outlook.com
 (2603:10b6:a03:38d::21)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|CH0PR03MB6036:EE_
X-MS-Office365-Filtering-Correlation-Id: a0e70a11-9a10-4a4f-6c7c-08db8f7b5086
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	MmiumzUQvJ63zlgdDf+peem/mTkjLxQIC6FlIQ40QmgQ7i9A4eUl9l2tQ9kPd42FmXweh73njlfq0h/ye8eA7OXezX8WuPhOlF5UAleldoqYRcP+UCWC0pEELJP+8+IamdYYWcsaJ4V25qCrkNEKftR++DSCXZwyfeLqeEZKsR2Rob7as81EKCmOTmJ6ZVUo1MP6X9u/Kfyhs0J+kJlS/GAAnyfFICnZRqJxDGy1kETewdipNaeZf9JbPcRzsSxuxTwYTFx9OqIEwchOyMl6ZAt2n117Hp+haeEBn9PAUFG5G1188LxYKMyh2t/UzL6uCq1hGv0fZ32POl4COh3KSubzgtrbG9e/68sbfXNXXqoU/bXiXhnm4tq1uPd6a8bcEQN1bqWxPVyKFihspdE28dwKdo8ib4/aB4MHJTapuE2vDzyADd9snNhZAEfPgmmAygW/ZheOgdIkHctHQRM1ZyCpteSYo4qpM9vO/5XvCJtn8rC7Wt5+Rxl1iywGSC2IrGX4Ke4MEOneF4wh6NZJCe9fvX6OQXiZMdjW4AWJTqaMCTfQE9faDJyQNydqMnlGPdWIareXzAAP9DvGwlPW9/TOH9VsIIoo1dIG/PCxjxj8YQdCBFiHux98YBLAEpbr
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(136003)(396003)(376002)(346002)(39860400002)(451199021)(186003)(54906003)(6512007)(6666004)(6486002)(478600001)(83380400001)(36756003)(86362001)(4326008)(66556008)(2906002)(66476007)(2616005)(6506007)(1076003)(6916009)(26005)(38100700002)(66946007)(82960400001)(8936002)(316002)(41300700001)(8676002)(5660300002)(221023011);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?THJCaUhCcC9aN203YUxzUDR4UDVWNzF3b3JrTUFXMXhzZnFiMTJhOFFGUFN1?=
 =?utf-8?B?bWpmU1FsdFE3MGVmZnlMSkF5dGdlT25UZWp0dnNYbUtvVGxwcE56MG5kWVNp?=
 =?utf-8?B?amZWS1dCUFkzeUowZ0gzNUlzL0FYVDlXb1FmT0pqUEFCWE04RFE5VFFza0Fa?=
 =?utf-8?B?Wlh3NytkaFRLNERKTlNKRTFaNWE4U0ovMDYxbzk1cWxaZmNFSlIwdmZjZCt0?=
 =?utf-8?B?WkJYQWdRMEZWcVh0WVJJUFE0V3kwZzVRdGl6WWE1M3BzaytXYkRVUjhScmZi?=
 =?utf-8?B?bnRZTXMyRmVuT1l6cEhMK1BKRldjZHJIbzNON3R1bVRCbjdpblk1aEsyQTZN?=
 =?utf-8?B?MHJQbWVVNXNBdHVncVlNYzVXdmE2RnNzaGprYVZDQVRUMmNhMlh6Y3dCL044?=
 =?utf-8?B?cWlqUDk2ZE4wVlNGdmlwc3hmMXFqeWVTVUxGT0NMQ2FlSktOTDdQQjJDcFlG?=
 =?utf-8?B?b2xyc1dxV2s2eHRyemhZUURpWS9vR0Y2S0pTbkNaSkEzb2J3NFcxZUdMTGxT?=
 =?utf-8?B?dGluNlVyYVZqOU9xWVJ4NWxRQjV1T2Exc2NrNndNTHhEQ3gwTmtDQThQdURa?=
 =?utf-8?B?dXRvUEw3WGVrNjlla1JOaC9wTXJjeGlFN3krVUhPdmZsMDNoNW9KZXV4Mkx2?=
 =?utf-8?B?NTRGK2VwOEVFdGVxMCtucUhCQ1dKdW1xNlF1WStDM0RHRmJYb09wa0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Rnp9NPcysniPhmCNsmZ1cjuFGOuDNO1D9W/JjUSkGc9awD1cgzjy9D7orsSjFqx0373TWEXr06/j7UQlcWgWspRJfWj8+U0FKmpwY8TMJJQpoMHAqMpnTYP55D7vE8DIP4jbx3AOlg2kJE59UwWf7b0M39wfpwEbH2QSF7tGNVs8Vik5xmH8J40R9hcCeWqIYPlo+irxY6an2rPilaX2r1BJbfMh5DrXQK3X99twFwdttPXJKCx4Od54upJNQKKIEnIshYBUu+4ItBYduE0tBsvqVhhc3wlZDh9LYLSAd+SSNrTqG6E4ysLywIouxJvV94EwFO/GACwZJMfK9eSfaX13dHrACMRNYyiGmv6kW34EQnx/iYQdMAoN0PG3zFWdpKlkMIsuQW1QMsxidr1ysNe+bgUkw0G/bOdU+Q1EH7I3YRJnBOAzfh+R4aApcLEeRz0xqMJUYmMAO6JeWYOq/1kkWJkQxy0LmpTNXHWu6WnrHwUl1JZ3pqOAQIL+8diZWwSflthUizFTb7XNb6oMg4Gf8sdPhTQi4UQX8KsNwTnKyN6+kG32ZTrYxzL91R5u88VgEIzoTh+OKAzDsUmWIOAYoXO03FA+3JXkMJoAB6fOmkEb7AhWdKxU=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a0e70a11-9a10-4a4f-6c7c-08db8f7b5086
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2023 14:59:59.9945
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: S72B1VDTX6gzyUDdK4D6a3QaASDuD0oztAuEAVM2OFffEByn4CpYb1/jVEiRnuMhBIqHTM8hzRL82MhYVsc0Iw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR03MB6036

As specified on Errata 1474:

"A core will fail to exit CC6 after about 1044 days after the last
system reset. The time of failure may vary depending on the spread
spectrum and REFCLK frequency."

Detect when running on AMD Zen2 and setup a timer to prevent entering
C6 after 1000 days of uptime.  Take into account the TSC value at boot
in order to account for any time elapsed before Xen has been booted.
Worst case we end up disabling C6 before strictly necessary, but that
would still be safe, and it's better than not taking the TSC value
into account and hanging.

Disable C6 by updating the MSR listed in the revision guide, this
avoids applying workarounds in the CPU idle drivers, as the processor
won't be allowed to enter C6 by the hardware itself.

Print a message once C6 is disabled in order to let the user know.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
The current Revision Guide for Fam17h model 60-6Fh (Lucienne and
Renoir) hasn't been updated to reflect the MSR workaround, but the PPR
for those models lists the MSR and the bits as having the expected
meaning, so I assume it's safe to apply the same workaround there.

For all accounts this seems to affect all Zen2 models, and hence the
workaround should be the same.  Might also affect Hygon, albeit I
think Hygon is strictly limited to Zen1.

Instead of the while loop around get_cpu_maps() we could re-schedule
the timer to NOW() + 1s, but seems more complex.
---
Changes since v2:
 - Add zen2 prefix to added functions and variables.
 - Check for Fam17h and STIBP for Zen2.
 - Prevent CPU hotplug while engaging in disabling C6.
 - Don't use _safe msr access variants.
 - Define the MSR bits inside of zen2_disable_c6().

Changes since v1:
 - Apply the workaround listed by AMD: toggle some MSR bits.
 - Do not apply the workaround if virtualized.
 - Check for STIBP feature instead of listing specific models.
 - Implement the DAYS macro based on SECONDS.
---
 xen/arch/x86/cpu/amd.c               | 74 ++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/msr-index.h |  2 +
 xen/include/xen/time.h               |  1 +
 3 files changed, 77 insertions(+)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 3ed06f670491..0358a610605c 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1,8 +1,10 @@
+#include <xen/cpu.h>
 #include <xen/init.h>
 #include <xen/bitops.h>
 #include <xen/mm.h>
 #include <xen/param.h>
 #include <xen/smp.h>
+#include <xen/softirq.h>
 #include <xen/pci.h>
 #include <xen/sched.h>
 #include <xen/warning.h>
@@ -52,6 +54,8 @@ bool __read_mostly amd_acpi_c1e_quirk;
 bool __ro_after_init amd_legacy_ssbd;
 bool __initdata amd_virt_spec_ctrl;
 
+static bool __read_mostly zen2_c6_disabled;
+
 static inline int rdmsr_amd_safe(unsigned int msr, unsigned int *lo,
 				 unsigned int *hi)
 {
@@ -972,6 +976,32 @@ void amd_check_zenbleed(void)
 		       val & chickenbit ? "chickenbit" : "microcode");
 }
 
+static void cf_check zen2_disable_c6(void *arg)
+{
+	/* Disable C6 by clearing the CCR{0,1,2}_CC6EN bits. */
+	const uint64_t mask = ~((1ul << 6) | (1ul << 14) | (1ul << 22));
+	uint64_t val;
+
+	if (!zen2_c6_disabled) {
+		printk(XENLOG_WARNING
+    "Disabling C6 after 1000 days apparent uptime due to AMD errata 1474\n");
+		zen2_c6_disabled = true;
+		/*
+		 * Prevent CPU hotplug so that started CPUs will either see
+		 * zen2_c6_disabled set, or will be handled by
+		 * smp_call_function().
+		 */
+		while (!get_cpu_maps())
+			process_pending_softirqs();
+		smp_call_function(zen2_disable_c6, NULL, 0);
+		put_cpu_maps();
+	}
+
+	/* Update the MSR to disable C6, done on all threads. */
+	rdmsrl(MSR_AMD_CSTATE_CFG, val);
+	wrmsrl(MSR_AMD_CSTATE_CFG, val & mask);
+}
+
 static void cf_check init_amd(struct cpuinfo_x86 *c)
 {
 	u32 l, h;
@@ -1240,6 +1270,9 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 
 	amd_check_zenbleed();
 
+	if (zen2_c6_disabled)
+		zen2_disable_c6(NULL);
+
 	check_syscfg_dram_mod_en();
 
 	amd_log_freq(c);
@@ -1249,3 +1282,44 @@ const struct cpu_dev amd_cpu_dev = {
 	.c_early_init	= early_init_amd,
 	.c_init		= init_amd,
 };
+
+static int __init cf_check zen2_c6_errata_check(void)
+{
+	/*
+	 * Errata #1474: A Core May Hang After About 1044 Days
+	 * Set up a timer to disable C6 after 1000 days uptime.
+	 */
+	s_time_t delta;
+
+	/*
+	 * Zen1 vs Zen2 isn't a simple model number comparison, so use STIBP as
+	 * a heuristic to separate the two uarches in Fam17h.
+	 */
+	if (cpu_has_hypervisor || boot_cpu_data.x86 != 0x17 ||
+	    !boot_cpu_has(X86_FEATURE_AMD_STIBP))
+		return 0;
+
+	/*
+	 * Deduct current TSC value, this would be relevant if kexec'ed for
+	 * example.  Might not be accurate, but worst case we end up disabling
+	 * C6 before strictly required, which would still be safe.
+	 *
+	 * NB: all affected models (Zen2) have invariant TSC and TSC adjust
+	 * MSR, so early_time_init() will have already cleared any TSC offset.
+	 */
+	delta = DAYS(1000) - tsc_ticks2ns(rdtsc());
+	if (delta > 0) {
+		static struct timer errata_c6;
+
+		init_timer(&errata_c6, zen2_disable_c6, NULL, 0);
+		set_timer(&errata_c6, NOW() + delta);
+	} else
+		zen2_disable_c6(NULL);
+
+	return 0;
+}
+/*
+ * Must be executed after early_time_init() for tsc_ticks2ns() to have been
+ * calibrated.  That prevents us doing the check in init_amd().
+ */
+presmp_initcall(zen2_c6_errata_check);
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 2382fc8e1181..4d41c171d291 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -211,6 +211,8 @@
 
 #define MSR_VIRT_SPEC_CTRL                  0xc001011f /* Layout matches MSR_SPEC_CTRL */
 
+#define MSR_AMD_CSTATE_CFG                  0xc0010296
+
 /*
  * Legacy MSR constants in need of cleanup.  No new MSRs below this comment.
  */
diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h
index b7427460dd13..9ceaec541f4d 100644
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -53,6 +53,7 @@ struct tm wallclock_time(uint64_t *ns);
 
 #define SYSTEM_TIME_HZ  1000000000ULL
 #define NOW()           ((s_time_t)get_s_time())
+#define DAYS(_d)        SECONDS((_d) * 86400ULL)
 #define SECONDS(_s)     ((s_time_t)((_s)  * 1000000000ULL))
 #define MILLISECS(_ms)  ((s_time_t)((_ms) * 1000000ULL))
 #define MICROSECS(_us)  ((s_time_t)((_us) * 1000ULL))
-- 
2.41.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 15:09:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 15:09:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571495.895488 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPP5P-0002mM-Ho; Fri, 28 Jul 2023 15:08:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571495.895488; Fri, 28 Jul 2023 15:08:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPP5P-0002mF-EP; Fri, 28 Jul 2023 15:08:59 +0000
Received: by outflank-mailman (input) for mailman id 571495;
 Fri, 28 Jul 2023 15:08: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 <SRS0=Gg45=DO=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qPP5O-0002m9-Gp
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 15:08:58 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id abb89e12-2d58-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 17:08:55 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 2BF7E1F37E;
 Fri, 28 Jul 2023 15:08:55 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 04ABF133F7;
 Fri, 28 Jul 2023 15:08:54 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 6GqtOgbaw2TnOwAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 28 Jul 2023 15:08:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: abb89e12-2d58-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690556935; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=fQXJ+7H3ztBkOTtnMqrfgRGhZ3yOeJPKac4KId6bPNU=;
	b=YbgsXVyTxDZr8TrGzW5QFjHSHk0Ewd5x28XMPuf+4LGFjRIOevK/7UU442oc/xaS8hTbrc
	CaNPXoQPh6Fh+CLzTqB4FqwlCxFXrmM8MaLsZ3+sRX3U9hclsaPO33ruLbUGKPyaoG4nX8
	ZFEnw7+m0xLCy9O6qDgkgOy4sZCM/44=
Message-ID: <f10e82f3-5dc4-bdac-90a1-219f11b47253@suse.com>
Date: Fri, 28 Jul 2023 17:08:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
 <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
 <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
 <68acbf84-218b-f2f7-9526-d9e07f845f6e@suse.com>
 <8cea1316-db0b-f29d-c467-6fd5c4a6321c@xen.org>
 <6a376365-a731-2413-16c7-14ede5224eea@suse.com>
 <b8b8e733-6be0-a4d9-33b7-d93366ec0091@xen.org>
 <8a5854d1-2594-ed4f-ace8-e21db4fe4c7b@suse.com>
 <75dc26f0-0ea7-2097-47b2-1f857e1d7236@xen.org>
 <4d36876c-e943-06ac-782d-5d94851040e2@suse.com>
 <ebc61b04-bfc4-592a-df09-7226e32d355b@xen.org>
 <daaf9af4-639e-c6fb-890b-852c0781271c@suse.com>
 <fa5cdab9-1bfe-7859-0629-3b23dcd6f16b@xen.org>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
In-Reply-To: <fa5cdab9-1bfe-7859-0629-3b23dcd6f16b@xen.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------gurAbZKiIMd0IvGrwxDt0025"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------gurAbZKiIMd0IvGrwxDt0025
Content-Type: multipart/mixed; boundary="------------9ARcbEqpTvwRa53GXXnoJ083";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <f10e82f3-5dc4-bdac-90a1-219f11b47253@suse.com>
Subject: Re: [PATCH v3 17/25] tools/xenstore: rework struct xs_tdb_record_hdr
References: <20230724110247.10520-1-jgross@suse.com>
 <20230724110247.10520-18-jgross@suse.com>
 <b2d2a346-12c0-8ea4-38a2-b4748396540f@xen.org>
 <9a6d9c8b-350b-9a3e-4c23-0d7fd312e77a@suse.com>
 <3cce8892-1494-775f-8d75-80e87f0643cf@xen.org>
 <a9d55381-df3a-a343-7c4b-c5d5f6e7695b@suse.com>
 <27ba8831-89cb-9470-0b1c-03ad817e8292@xen.org>
 <68acbf84-218b-f2f7-9526-d9e07f845f6e@suse.com>
 <8cea1316-db0b-f29d-c467-6fd5c4a6321c@xen.org>
 <6a376365-a731-2413-16c7-14ede5224eea@suse.com>
 <b8b8e733-6be0-a4d9-33b7-d93366ec0091@xen.org>
 <8a5854d1-2594-ed4f-ace8-e21db4fe4c7b@suse.com>
 <75dc26f0-0ea7-2097-47b2-1f857e1d7236@xen.org>
 <4d36876c-e943-06ac-782d-5d94851040e2@suse.com>
 <ebc61b04-bfc4-592a-df09-7226e32d355b@xen.org>
 <daaf9af4-639e-c6fb-890b-852c0781271c@suse.com>
 <fa5cdab9-1bfe-7859-0629-3b23dcd6f16b@xen.org>
In-Reply-To: <fa5cdab9-1bfe-7859-0629-3b23dcd6f16b@xen.org>

--------------9ARcbEqpTvwRa53GXXnoJ083
Content-Type: multipart/mixed; boundary="------------kKVMigLl5vBM0aWScZYmmjaM"

--------------kKVMigLl5vBM0aWScZYmmjaM
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjguMDcuMjMgMTY6NTksIEp1bGllbiBHcmFsbCB3cm90ZToNCj4gSGkgSnVlcmdlbiwN
Cj4gDQo+IE9uIDI4LzA3LzIwMjMgMTU6MzIsIEp1ZXJnZW4gR3Jvc3Mgd3JvdGU6DQo+PiBP
biAyOC4wNy4yMyAxNjowOCwgSnVsaWVuIEdyYWxsIHdyb3RlOiA+Pj4+IFVzaW5nIG11bHRp
cGxlIGNvbW1hbmRzIGhhcyBhbHNvIA0KPj4gaXRzIGRvd25zaWRlLiBUaGUgZmlyc3QgdGhh
dCBjb21lcw0KPj4+Pj4gdG8gbXkgbWluZCBpZiB0aGF0IHlvdSBuZWVkIHRvIGtlZXAgYXJv
dW5kIHRoZSBkYXRhLiBCdXQsIHdpdGggeW91ciANCj4+Pj4+IHByb3Bvc2FsLCB5b3Ugd2Ug
d291bGRuJ3QgYmUgYWJsZSB0byBzdG9yZSBpdCBpbiB0aGUgZGF0YWJhc2UgKGxpa2UgZm9y
IA0KPj4+Pj4gdHJhbnNhY3Rpb24gdXBkYXRlKSBhcyBkYXRhbGVuIGNhbiBvbmx5IGJlIDY1
S0IuDQo+Pj4+DQo+Pj4+IEkgd2Fzbid0IGF3YXJlIHRoYXQgYSBjb21wbGV0ZSB0cmFuc2Fj
dGlvbiBuZWVkcyB0byBiZSBrZXB0IGluIGEgc2luZ2xlIGRhdGENCj4+Pj4gYmFzZSByZWNv
cmQuIDotKQ0KPj4+DQo+Pj4gSUlVQywgeW91IGFyZSB0aGlua2luZyB0aGF0IHRoZSBjbGll
bnQgd2lsbCByZXN0b3JlIGFsbCB0aGUgc3RhdGUgYml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dWUpLg0KPj4NCj4+
IFdpdGggdGhhdCBpbiBtaW5kIEkgY2FuIGhlc2l0YW50bHkgYWRkIHRoZSBjb21tZW50LCBt
YXliZSB3aXRoIHRoZSBhZGRpdGlvbjoNCj4+ICJBbnkgcG90ZW50aWFsIGNoYW5nZSBvZiB0
aGUgbWF4aW11bSBwYXlsb2FkIHNpemUgbmVlZHMgdG8gYmUgbmVnb3RpYXRlZCBiZXR3ZWVu
DQo+PiB0aGUgaW52b2x2ZWQgcGFydGllcy4iDQo+IA0KPiBJIGFtIG9rIHdpdGggdGhhdC4N
Cg0KT2theS4NCg0KDQpKdWVyZ2VuDQoNCg==
--------------kKVMigLl5vBM0aWScZYmmjaM
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF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H/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------kKVMigLl5vBM0aWScZYmmjaM--

--------------9ARcbEqpTvwRa53GXXnoJ083--

--------------gurAbZKiIMd0IvGrwxDt0025
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmTD2gYFAwAAAAAACgkQsN6d1ii/Ey+7
rgf+N/zHdjk/XQ5TYjAp9Y/k8KEPl0ieA4LtctfLxgH05Xae0oOZ3GCf875n9qEoaL5OchjBzaAL
cnIkoX6SH7o74wcEyYbTjYdqwYLFVvTI3z1h4QeYBSMwsXzZs58TZ4A5z7+UraRKdVLLiaP/LGBN
GN4KwLO4fEOTDrUFe0Fux9SJNVRNgtVR1VmMbBOsyVKJ70tIbj/eAsyrRwGIITol/Y3FbdE5AHlm
xTHgmkv/dmixJI67Yyx9ZmXXi508tgP3cZnDuUtK03+5RHIssZnTaHc9+i8svkGK/7NMRvTHmlR8
dM9S7JOA9GyaNUxV9osAYUmvkf4v5xEzY8hBfdcq+w==
=VLfP
-----END PGP SIGNATURE-----

--------------gurAbZKiIMd0IvGrwxDt0025--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 16:03:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 16:03:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571499.895498 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPPvg-0001DK-GZ; Fri, 28 Jul 2023 16:03:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571499.895498; Fri, 28 Jul 2023 16:03:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPPvg-0001DD-Dg; Fri, 28 Jul 2023 16:03:00 +0000
Received: by outflank-mailman (input) for mailman id 571499;
 Fri, 28 Jul 2023 16:02:59 +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
 <SRS0=8l51=DO=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qPPvf-0001D7-93
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 16:02:59 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 35b81657-2d60-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 18:02:53 +0200 (CEST)
Received: from Dell.bugseng.com (unknown [37.160.17.225])
 by support.bugseng.com (Postfix) with ESMTPSA id 3FF574EE073F;
 Fri, 28 Jul 2023 18:02:52 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 35b81657-2d60-11ee-8613-37d641c3527e
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH] xen/keyhandler: address violations of MISRA C:2012 Rule 8.3 and drop bool_t
Date: Fri, 28 Jul 2023 18:02:44 +0200
Message-Id: <7cb2183e6e387c04547b57b6f9f95c08bb613019.1690560051.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Change types in function declarations to be consistent with the
corresponding definitions.
This addresses violations of MISRA C:2012 Rule 8.3: "All declarations
of an object or function shall use the same names and type qualifiers".

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/common/keyhandler.c      | 8 ++++----
 xen/include/xen/keyhandler.h | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index 0a551033c4..68d8166968 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -101,8 +101,8 @@ void handle_keypress(unsigned char key, struct cpu_user_regs *regs)
     }
 }
 
-void register_keyhandler(unsigned char key, keyhandler_fn_t fn,
-                         const char *desc, bool_t diagnostic)
+void register_keyhandler(unsigned char key, keyhandler_fn_t *fn,
+                         const char *desc, bool diagnostic)
 {
     BUG_ON(key >= ARRAY_SIZE(key_table)); /* Key in range? */
     ASSERT(!key_table[key].fn);           /* Clobbering something else? */
@@ -113,8 +113,8 @@ void register_keyhandler(unsigned char key, keyhandler_fn_t fn,
     key_table[key].diagnostic = diagnostic;
 }
 
-void register_irq_keyhandler(unsigned char key, irq_keyhandler_fn_t fn,
-                             const char *desc, bool_t diagnostic)
+void register_irq_keyhandler(unsigned char key, irq_keyhandler_fn_t *fn,
+                             const char *desc, bool diagnostic)
 {
     BUG_ON(key >= ARRAY_SIZE(key_table)); /* Key in range? */
     ASSERT(!key_table[key].irq_fn);       /* Clobbering something else? */
diff --git a/xen/include/xen/keyhandler.h b/xen/include/xen/keyhandler.h
index 9c5830a037..5c6598af98 100644
--- a/xen/include/xen/keyhandler.h
+++ b/xen/include/xen/keyhandler.h
@@ -39,11 +39,11 @@ void initialize_keytable(void);
 void register_keyhandler(unsigned char key,
                          keyhandler_fn_t *fn,
                          const char *desc,
-                         bool_t diagnostic);
+                         bool diagnostic);
 void register_irq_keyhandler(unsigned char key,
                              irq_keyhandler_fn_t *fn,
                              const char *desc,
-                             bool_t diagnostic);
+                             bool diagnostic);
 
 /* Inject a keypress into the key-handling subsystem. */
 extern void handle_keypress(unsigned char key, struct cpu_user_regs *regs);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 16:04:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 16:04:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571502.895508 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPPx9-0001jg-Qp; Fri, 28 Jul 2023 16:04:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571502.895508; Fri, 28 Jul 2023 16:04:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPPx9-0001jZ-Nd; Fri, 28 Jul 2023 16:04:31 +0000
Received: by outflank-mailman (input) for mailman id 571502;
 Fri, 28 Jul 2023 16:04:30 +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
 <SRS0=7hHC=DO=citrix.com=prvs=56653927b=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qPPx8-0001jP-FC
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 16:04:30 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6cb75e5f-2d60-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 18:04:27 +0200 (CEST)
Received: from mail-dm6nam12lp2173.outbound.protection.outlook.com (HELO
 NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.173])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 28 Jul 2023 12:04:24 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by CO3PR03MB6725.namprd03.prod.outlook.com (2603:10b6:303:17c::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Fri, 28 Jul
 2023 16:04:22 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::edfe:6f64:4048:74c5]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::edfe:6f64:4048:74c5%4]) with mapi id 15.20.6609.032; Fri, 28 Jul 2023
 16:04:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6cb75e5f-2d60-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690560267;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=QA9B7yALLppg5NcomVigS3+4g4DJBockdgCLtgOhGgo=;
  b=HYikN1zGOgHZO/Xk1IWhT91JWNn8pM+y3XmdqbIqHhznUH0yPkqtD9Po
   VfSTRAonQgt0XiDt6zYIYGEOmSZMKZnSLNT48eoxBpNRRHGOJBi5P6vD8
   a36aZMjBPq0Lb0jEWUM6T8xFzpEhACXaa6dJ/EIpmxyBt4OmmwPpgWmFH
   k=;
X-IronPort-RemoteIP: 104.47.59.173
X-IronPort-MID: 117811248
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:p6IMdK0RPI6VsthcA/bD5VFwkn2cJEfYwER7XKvMYLTBsI5bpzIFx
 mJJCjrQP/aMYGOhet8iPIu3o0tQu5fSy9BnSQdspC1hF35El5HIVI+TRqvS04F+DeWYFR46s
 J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo
 tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5gNkNagS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL
 87fwbew+H/u/htFIrt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WQaWpe0C3pYlpnJ87?=
X-Talos-MUID: =?us-ascii?q?9a23=3AOiUNLg4pK1/v7V9Ps0Jw7yGKxoxrwuOTOWpKnax?=
 =?us-ascii?q?atvuoCndZBxGP3A+OF9o=3D?=
X-IronPort-AV: E=Sophos;i="6.01,237,1684814400"; 
   d="scan'208";a="117811248"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=USdGK2neKmQNe6VeV4qNi5pqhKRUFAv63MnH6TDjcc6XLWgUvMxYO+VOoutmbgyWaiSfyjt1bvNNJtGS77f9aXG52B58OU2EKvHHIteI//TXRlsbb55aJReXGdaDOaMqcuaSxV0EvfyQYQgZrrW+I2L+x6om/JFWEMrHT717dpUgPqyuPClXzrXfyLgDuG26c2BKGB9+NMmNgYR+BplgPOwsjFgRwO6AZ4lScx7zPlBEdSPc4z+fP7Z0AotFtBbUBTregE1yin+zYf3E5IF4OFn5KI9BidJxcLVTIx1Ljq5Iub1ZJruNYLc9/tu60f6Mbuf3VPl+NWzHhacSTWvh8Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=QA9B7yALLppg5NcomVigS3+4g4DJBockdgCLtgOhGgo=;
 b=TIw+4klW7BZ2BaDmzRe/FxEpx5IFAOJ2+84ht0g2RTEGcv8ByiMqyO4PFGirlyvnER69Hv/EFQcmXGjUzLdy+bek/+3cew33jxzRXafx6Y4eHDdMU2/g6EGEfzbY3+C0hpIyqPsEtZ8FW4+hscWJOHixLK9z+HNelVN8BrPdtApg2UGct3tpJK5e949WxLLEbXVT26LUVg+N0K4Iv25JixrF/NuvsayvT9KIt6Cf7cF0eGILLN1FOw+IXoefT5wX1B1KAz7pX6thfjl9GKb/vHUuD8PThmWUi7loNIs1797SdVDV2logQfK3RNC7Mo/0xiK9x5nRhzgJb6niuUTP/A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QA9B7yALLppg5NcomVigS3+4g4DJBockdgCLtgOhGgo=;
 b=dWvTMAPTlh0+Yf4rLWhZNeSeqQS/dD+EHlKnrYLfuy1lld8jc3UcMggam6fwUid1Hz9Zyb/C28jqluGAq87tq9tu0wclmaRBCHxrPtS93op3SBlNOgQhlN8aMFokOVV+Ie20jSZcMM1qNLoLxhh7LYRUpG+QVc3QdORZ5cY5gDQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <1c181873-bb65-46b6-841c-47748662b10a@citrix.com>
Date: Fri, 28 Jul 2023 17:04:15 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [XEN PATCH] xen/keyhandler: address violations of MISRA C:2012
 Rule 8.3 and drop bool_t
Content-Language: en-GB
To: Federico Serafini <federico.serafini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com, George Dunlap <george.dunlap@citrix.com>,
 Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
References: <7cb2183e6e387c04547b57b6f9f95c08bb613019.1690560051.git.federico.serafini@bugseng.com>
In-Reply-To: <7cb2183e6e387c04547b57b6f9f95c08bb613019.1690560051.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO2P265CA0033.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:61::21) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|CO3PR03MB6725:EE_
X-MS-Office365-Filtering-Correlation-Id: 1a04af5a-34b0-41c9-f700-08db8f844e46
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	/NOKkpDOSLMN5m20F7lFnV6GAlDNyGUPvdQSvZcwUwG6p5vF/cSoQd1SQ9MNbc1Pz01DPf8p5kw6CezKwI5lFoksPno8ZLaEFiVRjLibEFfyCQV/RrSuZ5ilabBIxQ5E5P6GUs3S2DdD93vtR3q3Es8ym3I0cyLIkic46TeaOnJ+JvuIwh6PY7nJDoYtNtT7TuwGcGN6oEDYFtL2QGxcpFfznp6Jg83plxCnYvzJMF05/Oig+gaGED9LNTKHQp2gUXWMr7Q195H2RL0Ip+2jjuPnbduzZ6NyT9EHKMXpN/K2zrZ7Z1Yxld8sc3PySOju7fpcs4AVOTVselaVI4QEXcUjRChjVohNJcQuAyzEARzftWgSivDRSbkirvnaN3nxTR4vjfzscNcAFX+PKpIXwWCwKLnSVOvRE/V306JGK4AuJCXnBf+G68L0HCSpOtAxnqupSFDRUcJHgiSg5CCDMWBs7UJFTRC/R9LYY+HnjbvrDHSiXzfgvqohclPq+SI/uGJ8GmSWv8M0r+M3zGUvtoMV+cMq9XhO56Bf9tR7ZZn94zgosnc+JeHNMjDTuf+/jK8AvuSwmmipW3pOYIGK4AVjUMjJQOoTIvGTuOFwJ1fILThj/GcmzqOgJlF72rrfnlMEKRzpVDpHtXTrP76YnQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(366004)(346002)(39860400002)(376002)(451199021)(186003)(31686004)(54906003)(6512007)(6666004)(6486002)(478600001)(36756003)(86362001)(31696002)(4326008)(66556008)(4744005)(2906002)(53546011)(66476007)(2616005)(6506007)(26005)(38100700002)(82960400001)(66946007)(316002)(8936002)(41300700001)(8676002)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RTR2RnBJMGlSVWV2NHlmNW5DNTVqY1RtVnRPeHRZUkJiS1VkdFRnRUxHOFNm?=
 =?utf-8?B?blVlRVFiUnkyRzVIK3dvaUdKb0tJQTA4dnNOUW9GRU5RYWwyblZVdUhoNnZC?=
 =?utf-8?B?VmkrSHd3a25NQjllOUtOcnhxb3VMc2trVkJkNk1Sbm4rUndnRHZLeUtqekVO?=
 =?utf-8?B?YU0yZ3lxN2phNUdJU2ZydE1wMjFYcEgzVjR6aTlQR240VGUzMEFUZlpjT3BL?=
 =?utf-8?B?VS9aTVd2cE0wVHFEeUFnQklOc0xGdS9LUkc2ekxuQmdXdDAwNzdRdlQrLzU0?=
 =?utf-8?B?bnhJVkRBd0k3eVlCRmRYTGQrRHlvZGtuRnA3Q0hBTVJjUmVVZzZnTUJiT3lP?=
 =?utf-8?B?dFM2NlNLY0JEZDlkb083Vkk0TlIzYnkvamZwN2xRSzY3YzliVE16dWI2ZWVN?=
 =?utf-8?B?YVcyVVlzaEkvTi9WZ3JNdExCR3VJRXRkYTljS2xyc1JXNW5IcTA1bURGbnBQ?=
 =?utf-8?B?aXVWVXRjY2JaMDY0TzJIY1RTbml5TjRJWmI4VzlpVS9qVzFaQlZCRjJtY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CEKP3PTIYUMvBmdr68zKebXJEKCzAO0+FZoAE42Mb/38akrG3E9QaNbRiiTBCo/py1HU0T9e/vqpwnNsOQWUfSuXF/MAWR0s7HN1zgqUwNmSphEJ7Z/QnL4DsHqPdmqbmhznyIm5XcNTqzH5hqsS2V3l0riNPJ5/PqmfJ1rwxdYLkx3XXiGGPWu5YVCxwqE7G15fwijVS7fMVhpgkUw0lavQki0298g9PhXzx5K5lYGDKWL10m4IrqZocfwsZwGcqItCZsf/7Zos/FVxJTCEPtQyIwUcXviCe4IMSLvQIXGLcpoEfupt3TXjkyO0II8asqztqn15sAMxwdwPeNi8lwR2NbWOGLeGLwtSUNeVpVvvgC+2nhi2I/k1hS1aC4PEPA/qz9o9mZCOpgZYzuWhKbkG4dIFk91FAxaiPkizYYoILqk6bR7WB3BFhuC0UA4To7kQdRNDImj1b7OWtSG9swGFzz7N8QMpUBpihMbt4KtdwgE6KL3WtEIdldn8aIq3DLJtM6t+85sU8zd0TUVgpOs+1OnLHl4VbFS62w0YtXOVb38+qf+63KkqUIFGKctd2r4wbiugWUhrcfgXXJDOdiRTlgrJ3vXv0V086cQ/l+wVOpt14LGc93zS90ZIiAA6YkFG9gLCF1o5PwMvnvhIoSKN6kMaDVEHbT3OUbPHj/kM0nia6immhm28fq9SstgggkVMFlEXS5H4XL2hqdatrK/YJL56TFSproKf3vZrBoTE1WOZCc0YlDw9EAgk2X4ynnWPR8z8znlAtKYtfRpmFIbyYRtfwNgbQ9PYES0ortgnDL4J+PFFNtaTJMbhuKBpyTsVCR0R5Tf9+lbtyNHuSxLlG1DVRMlxRzMVPE
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1a04af5a-34b0-41c9-f700-08db8f844e46
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2023 16:04:21.9638
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: pC0LoXTL1eW342HLyqcJui0zdquNAkVKC2YBNk7j5lMslQqSuJfdUS3geiWBeEJYGZzan4grOsmZGUwzrJdlxJ/yo5SpRufYP8+liSYWH3E=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO3PR03MB6725

On 28/07/2023 5:02 pm, Federico Serafini wrote:
> Change types in function declarations to be consistent with the
> corresponding definitions.
> This addresses violations of MISRA C:2012 Rule 8.3: "All declarations
> of an object or function shall use the same names and type qualifiers".
>
> No functional changes.
>
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Always glad to see more bool_t disappearing.


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 16:13:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 16:13:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571507.895518 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPQ66-0003NF-Rd; Fri, 28 Jul 2023 16:13:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571507.895518; Fri, 28 Jul 2023 16:13:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPQ66-0003N8-OL; Fri, 28 Jul 2023 16:13:46 +0000
Received: by outflank-mailman (input) for mailman id 571507;
 Fri, 28 Jul 2023 16:13:45 +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
 <SRS0=8l51=DO=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qPQ65-0003N2-1P
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 16:13:45 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b89b0293-2d61-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 18:13:42 +0200 (CEST)
Received: from [172.20.10.2] (unknown [37.160.17.225])
 by support.bugseng.com (Postfix) with ESMTPSA id 9A8664EE073F;
 Fri, 28 Jul 2023 18:13:41 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b89b0293-2d61-11ee-8613-37d641c3527e
Message-ID: <06ea131d-d6d9-33f9-7875-59cfd84a2c2e@bugseng.com>
Date: Fri, 28 Jul 2023 18:13:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [XEN PATCH] xen/keyhandler: address violations of MISRA C:2012
 Rule 8.3 and drop bool_t
To: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com, George Dunlap <george.dunlap@citrix.com>,
 Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
References: <7cb2183e6e387c04547b57b6f9f95c08bb613019.1690560051.git.federico.serafini@bugseng.com>
 <1c181873-bb65-46b6-841c-47748662b10a@citrix.com>
Content-Language: en-US, it
From: Federico Serafini <federico.serafini@bugseng.com>
Organization: BUGSENG srl
In-Reply-To: <1c181873-bb65-46b6-841c-47748662b10a@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hello Andrew,

On 28/07/23 18:04, Andrew Cooper wrote:
> On 28/07/2023 5:02 pm, Federico Serafini wrote:
>> Change types in function declarations to be consistent with the
>> corresponding definitions.
>> This addresses violations of MISRA C:2012 Rule 8.3: "All declarations
>> of an object or function shall use the same names and type qualifiers".
>>
>> No functional changes.
>>
>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> 
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Always glad to see more bool_t disappearing.

in the message body I inverted 'definitions' with 'declarations',
please can you fix it?

Thanks
-- 
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 16:19:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 16:19:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571511.895527 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPQBi-00041q-EE; Fri, 28 Jul 2023 16:19:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571511.895527; Fri, 28 Jul 2023 16:19:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPQBi-00041j-BZ; Fri, 28 Jul 2023 16:19:34 +0000
Received: by outflank-mailman (input) for mailman id 571511;
 Fri, 28 Jul 2023 16:19:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qPQBg-00041d-TU
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 16:19:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPQBg-0003IK-1y; Fri, 28 Jul 2023 16:19:32 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPQBf-0000aH-Sp; Fri, 28 Jul 2023 16:19:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=yI62UMeXyYI4w/gI9iFsSzEHG7jx3Vq3G4MLEprJr/E=; b=szWYs/s41ZrV3JiEFluVeRt8VW
	h3WrDiVGJ2lV69BxsGx+vBj/93ZmU6dtW9j9H1194qH9f427N1traQHzm+mM2fZe9L0YutumDGVZq
	mjTSJEjLfm3zt8lxlLO129DNTruog06wkSoEQGf+CM3AfWgWYGl41ShiJKwfjL/LB4Xk=;
Message-ID: <34818645-459d-d658-1eb4-13444b30c4b8@xen.org>
Date: Fri, 28 Jul 2023 17:19:30 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 3/5] mm/pdx: Standardize region validation wrt pdx
 compression
Content-Language: en-GB
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>,
 George Dunlap <george.dunlap@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
 <20230728075903.7838-4-alejandro.vallejo@cloud.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230728075903.7838-4-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 28/07/2023 08:59, Alejandro Vallejo wrote:
> Regions must be occasionally validated for pdx compression validity. That
> is, whether any of the machine addresses spanning the region have a bit set
> in the pdx "hole" (which is expected to always contain zeroes). There are
> a few such tests through the code, and they all check for different things.
> 
> This patch replaces all such occurrences with a call to a centralized
> function that checks a region for validity.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>

Reviewed-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 16:21:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 16:21:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571513.895538 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPQD6-0005P7-Og; Fri, 28 Jul 2023 16:21:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571513.895538; Fri, 28 Jul 2023 16:21:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPQD6-0005P0-LB; Fri, 28 Jul 2023 16:21:00 +0000
Received: by outflank-mailman (input) for mailman id 571513;
 Fri, 28 Jul 2023 16:20:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qPQD4-0005Os-Jv
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 16:20:58 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPQD3-0003Ja-LU; Fri, 28 Jul 2023 16:20:57 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPQD3-0000aH-GE; Fri, 28 Jul 2023 16:20:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=ae/bgV/eKo7tz3FNpdot9JRTumggbY5VT4ceImjGzA8=; b=1TE9ntuC0J1hJo1cM/0reTmDkW
	dY04Kl5IkJAfOHPYXjaWZKUINKrpTwo3Kglofk12EIJu/Exk+2FdgOhhw5b4HABRLgf5Cm87TmVOI
	vTTuQ3QiopRRB214rwQNVjYI225WJzziTpEhQt+4Sq0QO5zYDIkvn7s3Y0kvkkjGUSpA=;
Message-ID: <9187a9c5-82fc-e53e-b128-f963576c387f@xen.org>
Date: Fri, 28 Jul 2023 17:20:56 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 4/5] pdx: Reorder pdx.[ch]
Content-Language: en-GB
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
References: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
 <20230728075903.7838-5-alejandro.vallejo@cloud.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230728075903.7838-5-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 28/07/2023 08:59, Alejandro Vallejo wrote:
> The next patch compiles out compression-related chunks, and it's helpful to
> have them grouped together beforehand.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 16:27:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 16:27:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571515.895548 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPQJZ-00065E-Dn; Fri, 28 Jul 2023 16:27:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571515.895548; Fri, 28 Jul 2023 16:27:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPQJZ-000657-Aq; Fri, 28 Jul 2023 16:27:41 +0000
Received: by outflank-mailman (input) for mailman id 571515;
 Fri, 28 Jul 2023 16:27:40 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qPQJY-000651-Me
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 16:27:40 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPQJX-0003Pv-Il; Fri, 28 Jul 2023 16:27:39 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.240])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qPQJX-0000ud-Ch; Fri, 28 Jul 2023 16:27:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=egzUNnIhpIGdlpU7kTCEI0Z2WQztzharoJZnhDbdh7E=; b=iWfrAdZINeuEa11aHK1IfQhbsX
	3caKBo7Mc9E2rHrOQ14rNGEYGVbc4snA+LXA/PyzJK4BkJXJFq1A2plNmUTq2PbOfrPIqyN37e2vR
	yr6IMiiUgDj2q9FdCrQoy1f8S6qKHz1xJsDhRlVi99wt5qn44sih6iIXL0a4mL7Ad3zM=;
Message-ID: <5a43061c-3777-c1db-8084-f3b8f911a5c8@xen.org>
Date: Fri, 28 Jul 2023 17:27:37 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 5/5] pdx: Add CONFIG_HAS_PDX_COMPRESSION as a common
 Kconfig option
Content-Language: en-GB
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
 <20230728075903.7838-6-alejandro.vallejo@cloud.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20230728075903.7838-6-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 28/07/2023 08:59, Alejandro Vallejo wrote:
> diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h
> index 5a82b6bde2..dfb475c8dc 100644
> --- a/xen/include/xen/pdx.h
> +++ b/xen/include/xen/pdx.h
> @@ -67,8 +67,6 @@
>    * region involved.
>    */
>   
> -#ifdef CONFIG_HAS_PDX
> -
>   extern unsigned long max_pdx;
>   
>   #define PDX_GROUP_COUNT ((1 << PDX_GROUP_SHIFT) / \
> @@ -100,6 +98,8 @@ bool __mfn_valid(unsigned long mfn);
>   #define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
>   #define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
>   
> +#ifdef CONFIG_PDX_COMPRESSION
> +
>   extern unsigned long pfn_pdx_bottom_mask, ma_va_bottom_mask;
>   extern unsigned int pfn_pdx_hole_shift;
>   extern unsigned long pfn_hole_mask;
> @@ -205,8 +205,39 @@ static inline uint64_t directmapoff_to_maddr(unsigned long offset)
>    *             position marks a potentially compressible bit.
>    */
>   void pfn_pdx_hole_setup(unsigned long mask);
> +#else /* CONFIG_PDX_COMPRESSION */

Looking at other places, we tend to put the reason the #else be 
executed. In this case, it is !CONFIG_PDX_COMPRESSION.

Other than that, the changes looks good to me:

Reviewed-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 16:36:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 16:36:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571518.895558 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPQSI-0007Yg-9C; Fri, 28 Jul 2023 16:36:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571518.895558; Fri, 28 Jul 2023 16:36:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPQSI-0007YZ-5W; Fri, 28 Jul 2023 16:36:42 +0000
Received: by outflank-mailman (input) for mailman id 571518;
 Fri, 28 Jul 2023 16:36:41 +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
 <SRS0=7hHC=DO=citrix.com=prvs=56653927b=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qPQSH-0007YT-8i
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 16:36:41 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id eb9f6277-2d64-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 18:36:38 +0200 (CEST)
Received: from mail-dm6nam10lp2109.outbound.protection.outlook.com (HELO
 NAM10-DM6-obe.outbound.protection.outlook.com) ([104.47.58.109])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 28 Jul 2023 12:36:35 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by PH0PR03MB6366.namprd03.prod.outlook.com (2603:10b6:510:ab::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Fri, 28 Jul
 2023 16:36:29 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::edfe:6f64:4048:74c5]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::edfe:6f64:4048:74c5%4]) with mapi id 15.20.6609.032; Fri, 28 Jul 2023
 16:36:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eb9f6277-2d64-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690562198;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=+4+ME/+CfYSB0RxXMcWR7td4MQyMH7Tl2mMrxfvKXJ8=;
  b=ThaNIKMkoLu1ErZfcg5SYTXUpuWpCtuyMl7N23uMTH0rPblYbZ5FKuE9
   wWoVk4UgA8Gz7AvYT2Ei6D+DoX7rIDC/ZEmwoxolI4Sb3Cqme1q4NLm/x
   /hfL8OYpCowiyRn3l0b/EqUpk9OwTqyOCOn0IfDzzSvf5NrPttakTm23M
   Y=;
X-IronPort-RemoteIP: 104.47.58.109
X-IronPort-MID: 117677145
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:nQ2MManvott6oAeKoW4r+hXo5gwnJ0RdPkR7XQ2eYbSJt1+Wr1Gzt
 xJJCDzSM6qNajOhe90lb97k8U0EupLRy9NrG1FlqHpkESMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaY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/gTP+9A+A2frBCh2F2RVbeC9OxLpKyx
 m5ryXJop+7tu29yFv632vehq4m/+fJ+594HcmRjcpQDCvqhh3AXvUGZ5Sy+Aotpf2p6hIRsP
 SkmWZZA+1Dr0nJe32zo1/W1xL+3C0I43vvoGXo+kfLkIjCXTcnDMgEuo5DaBve7CMbzatB7J
 4=
X-Talos-CUID: 9a23:QgyFoG2Yl/nYy0HxfZfNb7xfAdsVTVbH9y/rDUKfFz1raJuaZ0OV9/Yx
X-Talos-MUID: 9a23:ooXXSAol7cKnK4VFLzcezx1nH8ZOsqqMMXoMoIcFiYq5GhV2JDjI2Q==
X-IronPort-AV: E=Sophos;i="6.01,238,1684814400"; 
   d="scan'208";a="117677145"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ZRrtsSnmkGg8xt6l6LhnH6dBvLxjq/JG0i2zqjzl9CewDhshMmwl3y29PCn+uW9oo3k4B8MLhDFHpeef9JiOS1quuYxqjiBwKqhxXI1J5/dgIB+AMAv7g4hMhG09K/x4rypgZN+CVwGL4483rmWx06+S065abC6w5fv50ndYhAzRFgo+KObkLJljXfOGwteWqlkAgaM/hUAzYl9Yuw1KFyxW2iPKuGdnz2gSdnDAo+JIoqJIkkFsm6UHYaHOhL3t7IMji0Jjh3q8QBeMwZakKhiDblLZOshDEI7+QTFPuyMnt2gBujv1UXGI3aWbvRH8n9wppAaca3cdy4YTG7njpw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=c0zzenPVbxs7TV04LIa7VSnq8RdNL+ZTFwqIy8IIH6k=;
 b=OGwYBc6uifpCN9LnzmIc5NXBpQYkETVBqANetYCKAj/8APZV+9pBqLYyUvbafxfP63nd+cz7tSEEHACKX/kwlAY8JDEX2iEryLp8QoLKgRDiwUS5eYqQ2ZebY63uC3eJKLYHBetG2mzfhGMyHF+IuCEqk9ZknPxq1gSxAhnpMKxc043SNjaVyMHlv4n/dOwL5T33VpXeh1z0Ef8O0oeh6VVFmLKduyxx+cs0Hbqkb1BhkM3uNuzgpRUNleIpdFqz7C7ii9hnLjxlG19moUDqe94zQwwuM8TfOfjMKrlRqd3iw2qay741ooiaAxp8HZnbtJSNJTu9O60E+Z5Z0EtkpQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=c0zzenPVbxs7TV04LIa7VSnq8RdNL+ZTFwqIy8IIH6k=;
 b=bcvutulc2KA6PzrAgT6lhX2PAEHKpkPHPArn1bgL9MT6HHaFUkkTXo9TXOtwsssIklYHCXJDntOF5+u4PedOOZe0NbybAtDoKY7aZ3fnLdmRQoI4dudjOSJ814x+cNORdI+QPmuAGwDiyuzBDrpqUBDME+nahyIhLwMukyrhp7g=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <9f0b7ab4-090f-21ea-2cf8-6ecdc7c02225@citrix.com>
Date: Fri, 28 Jul 2023 17:36:23 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v2 5/5] pdx: Add CONFIG_HAS_PDX_COMPRESSION as a common
 Kconfig option
Content-Language: en-GB
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
 <20230728075903.7838-6-alejandro.vallejo@cloud.com>
In-Reply-To: <20230728075903.7838-6-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0671.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:351::11) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|PH0PR03MB6366:EE_
X-MS-Office365-Filtering-Correlation-Id: 4aac4ad6-c4f0-45ba-4987-08db8f88cb40
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	vPGcBSDfTipP1N7eICjBQ2nqHGTpTd9FNf4d1wDnvKmyV0F42lY8vCBuiQgXuZ8fjLJDxS274wHeWde+Co6hWvwZA5ndAFIrKs3K37kpwHgwoTDcJmW8ZbZmCI6K52QsGCcJIf5nCMyIcn3qtLjiQxkDlS01YZ3wAXh2qFFZ9l43wbB8Fa9UligYQ7opuxGy8ObVqAYrW3w5vrViXUX8EpVFJef3ceCPh0A4+/jq9jIM7PBgLQu2u9HDwGVp37NmFgZUCAf68IBgSueC31ZCz4UvzPyHtV/KDnCx2iwprvRFlwjovjmswJ4VGEGKjmlorUftZ0E4MbbQ8qVD82b7n1DVs5Zoahq5mu4RM9gg9hxTLPbXCjDakFxCjlkYNZ736Wa84syB/Oei4CMnAKYshdiuwx8/0QXWqmahfL5enzbFHDzt/RZqBzz8Yrp6/LtaV6erX37k+AoCbxmvZRuqSStEN0vQWCBqT4dj9DdN2OGHbPbisdvlQS9Qw9T25dKqrg8BDzMtMsMOCap+XH2bI3YtII0brKDJAGaUnpRNOFjP/YekQob2cijIr3wIMZFTJAg7ugSGW4PbphrPs/PomMMPtLMc7L+8VehE0heE/oy1LfJvV0aiCpMraRXqZwM3uPagQFCA0XlOEasBvQAelA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(39860400002)(136003)(346002)(396003)(451199021)(316002)(6506007)(8936002)(53546011)(26005)(41300700001)(8676002)(107886003)(54906003)(110136005)(82960400001)(6512007)(66556008)(478600001)(66476007)(4326008)(66946007)(6666004)(6486002)(36756003)(38100700002)(2616005)(2906002)(86362001)(31686004)(31696002)(186003)(7416002)(5660300002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?OHdRTy9mZ0lJL1FHY2tYQlRoY2VoR0hCVE9DY1RtTDNvSDRrZ3hsblVsMU01?=
 =?utf-8?B?amRNTjVDU3daRUNsbDdXa09vbDZwaUpmdnBMUVJvS2hUMDh4YzJWS05WZzEz?=
 =?utf-8?B?L2RrLzNtRlp1c3FmWmUwa2pORVdUVzhDcStlQlVUYXNRUjM0RE5MT2hodDJO?=
 =?utf-8?B?YmZqbTdVWVNrR3JKeW5CS0lKNUJmTDdJMCtybXVFWG13YTNLTi84aUdsMDhS?=
 =?utf-8?B?SUdOdW5vWEc3WUpGZS96cC9vMFpnOEtJdWsx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xfHQ1knUQZWIjOVIPkYHwxU/xUhTHry8s9uWsXCCDljUo+c7/lkH3d+7WrJzs41fIxVQxj1+FNmqKGVEJbeUK9tNYS6JrirpWITs/DFB/smpwDcZX5NI+JYkSCtnM9fZkcdnTgRKKCxN5EZ9upA=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4aac4ad6-c4f0-45ba-4987-08db8f88cb40
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2023 16:36:29.4097
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 2cCElc81B1XV38+77IQtLU0AN60yUyUv+IZQy3RW4P93bKJauInzqY/aR8FEyX3L0X8tTqGvJ5mYF0KfbjIQE3qckvzzp/I0PScbN/sxMfc=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB6366

On 28/07/2023 8:59 am, Alejandro Vallejo wrote:
> Adds a new compile-time flag to allow disabling pdx compression and
> compiles out compression-related code/data. It also shorts the pdx<->pfn
> conversion macros and creates stubs for masking fucntions.
>
> While at it, removes the old arch-defined CONFIG_HAS_PDX flag, as it was
> not removable in practice.
>
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> ---
> v2:
>   * Merged v1/patch2: Removal of CONFIG_HAS_PDX here (Jan)

This series is now looking fine, except for the Kconfig aspect.

This is not something any user or developer should ever be queried
about.Â  The feedback on the documentation patches alone show that it's
not understood well by the maintainers, even if the principle is accepted.

There is never any reason to have this active on x86.Â  Indeed, Julien's
quick metric shows how much performance we waste by having it enabled.

This patch ought to just rename HAS_PDX to PDX, and keep it selected by
the subset of architectures that still want it.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 16:47:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 16:47:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571521.895571 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPQch-0000ib-9U; Fri, 28 Jul 2023 16:47:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571521.895571; Fri, 28 Jul 2023 16:47:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPQch-0000iU-6D; Fri, 28 Jul 2023 16:47:27 +0000
Received: by outflank-mailman (input) for mailman id 571521;
 Fri, 28 Jul 2023 16:47:25 +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 <SRS0=Q8mr=DO=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qPQcf-0000iO-Lk
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 16:47:25 +0000
Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com
 [2a00:1450:4864:20::22b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6cabac40-2d66-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 18:47:22 +0200 (CEST)
Received: by mail-lj1-x22b.google.com with SMTP id
 38308e7fff4ca-2b9b50be31aso35882551fa.3
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 09:47:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6cabac40-2d66-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690562842; x=1691167642;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=28ZaXS6e5z5psVXFhMUfYo92OIXSN7eSM59WhHstjtA=;
        b=RLKgMv573JgMjDnFi4ZBWO+twwaDAxxf0CZxuAXgsDhFSbltZTSXQHc9883gxcavnu
         SwuDIBjkF2uiuc9+tH/Aw0ppxrKAZvrKobUIUesRluxGE04OgEasVKWt26em8CjJ75oc
         BErCZDLoOJjut2c6e41GtMXR3yMUG5uCaSdiw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690562842; x=1691167642;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=28ZaXS6e5z5psVXFhMUfYo92OIXSN7eSM59WhHstjtA=;
        b=P3yBS1EsOvjN3RzUPZ/GLmrMDR4X4HKM6whKKJxjB03wvWd9kDLiGBT9Df6Ipf7YiB
         Bhdvrof1EV4LaMqfUHGUaiToDsR9gurovbMEwkaVOc+4eC21Emr1TxJ9y4dKGJoVvTVB
         hBrEpBTT9WuZtTopPO3JTUFDRL1cEDt3EgU0LA1ftaMgM2WzHtL3m0ybsUVTqtde1rHL
         RSURXLRffFeW+jzpQOScTq0fclQZxwnSKSVVW7mJQVRPcPtb1KGtQyPq9zyQ7hrSfJze
         jKh4+g4gcQiEiPrM8V25EhlwWO5+3CS8QnjU93vYs87OxydjFEwzeEF7tDyNWTQ7Wuw6
         sReQ==
X-Gm-Message-State: ABy/qLYCH9ggyk5z/zRDnHfkEyby+80YVcekqFEz/rPEpkmawi3O7hQZ
	YDfjgpYoBvDmcOzfNAJCjdeCwPRIgLAHDM8tchG6DQ==
X-Google-Smtp-Source: APBJJlHJ5e//ZpaerwCIFdwVDAzwWgtFRBJ1NM7sehmfmNXyzQSxnEZ5+M1yp+sFhmcc+0kFKo4z382PYeePOtCiwYw=
X-Received: by 2002:a05:651c:156:b0:2b9:c644:415d with SMTP id
 c22-20020a05651c015600b002b9c644415dmr2086034ljd.46.1690562842209; Fri, 28
 Jul 2023 09:47:22 -0700 (PDT)
MIME-Version: 1.0
References: <20230601142742.15489-1-olaf@aepfle.de> <20230601142742.15489-3-olaf@aepfle.de>
In-Reply-To: <20230601142742.15489-3-olaf@aepfle.de>
From: George Dunlap <george.dunlap@cloud.com>
Date: Fri, 28 Jul 2023 17:47:11 +0100
Message-ID: <CA+zSX=bZ5zo9cxWTq9s9QOUGZ-9NMEugewR90z1w8C++sruSVw@mail.gmail.com>
Subject: Re: [PATCH v1 2/7] xentrace: use correct output format for pit and rtc
To: Olaf Hering <olaf@aepfle.de>
Cc: xen-devel@lists.xenproject.org, George Dunlap <george.dunlap@citrix.com>, 
	Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Content-Type: multipart/alternative; boundary="000000000000ae471806018ed56d"

--000000000000ae471806018ed56d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Sorry for the delay here.

Just a couple of notes on the whole series.  First, you didn't CC me on 0/7
or 1/7.  Secondly, patch 7 seems to be corrupted (see e.g., Patchew's
attempt to apply the series [1]).

[1] https://patchew.org/Xen/20230601142742.15489-1-olaf@aepfle.de/

 -George

On Thu, Jun 1, 2023 at 3:28=E2=80=AFPM Olaf Hering <olaf@aepfle.de> wrote:

> The input values were always 32bit.
>
> Fixes 55ee5dea32 ("xentrace: add TRC_HVM_EMUL")
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> ---
>  tools/xentrace/formats | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/xentrace/formats b/tools/xentrace/formats
> index 0fcc327a40..afb5ee0112 100644
> --- a/tools/xentrace/formats
> +++ b/tools/xentrace/formats
> @@ -211,8 +211,8 @@
>  0x00802008  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  do_irq [ irq =3D %(1)d,
> began =3D %(2)dus, ended =3D %(3)dus ]
>
>  0x00084001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  hpet create [ tn =3D %(1=
)d,
> irq =3D %(2)d, delta =3D 0x%(4)08x%(3)08x, period =3D 0x%(6)08x%(5)08x ]
> -0x00084002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  pit create [ delta =3D
> 0x%(1)016x, period =3D 0x%(2)016x ]
> -0x00084003  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  rtc create [ delta =3D
> 0x%(1)016x , period =3D 0x%(2)016x ]
> +0x00084002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  pit create [ delta =3D
> 0x%(1)08x, period =3D 0x%(2)08x ]
> +0x00084003  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  rtc create [ delta =3D
> 0x%(1)08x, period =3D 0x%(2)08x ]
>  0x00084004  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  vlapic create [ delta =
=3D
> 0x%(2)08x%(1)08x , period =3D 0x%(4)08x%(3)08x, irq =3D %(5)d ]
>  0x00084005  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  hpet destroy [ tn =3D %(=
1)d
> ]
>  0x00084006  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  pit destroy  [ ]
>

--000000000000ae471806018ed56d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Sorry for the delay here.<div><br></div><div>Just a couple=
 of notes on the whole series.=C2=A0 First, you didn&#39;t CC me on 0/7 or =
1/7.=C2=A0 Secondly, patch 7 seems to be corrupted (see e.g., Patchew&#39;s=
 attempt to apply the series [1]).</div><div><br></div><div>[1]=C2=A0<a hre=
f=3D"https://patchew.org/Xen/20230601142742.15489-1-olaf@aepfle.de/">https:=
//patchew.org/Xen/20230601142742.15489-1-olaf@aepfle.de/</a></div><div><br>=
</div><div>=C2=A0-George</div></div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr" class=3D"gmail_attr">On Thu, Jun 1, 2023 at 3:28=E2=80=AFPM Olaf H=
ering &lt;<a href=3D"mailto:olaf@aepfle.de" target=3D"_blank">olaf@aepfle.d=
e</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin=
:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"=
>The input values were always 32bit.<br>
<br>
Fixes 55ee5dea32 (&quot;xentrace: add TRC_HVM_EMUL&quot;)<br>
<br>
Signed-off-by: Olaf Hering &lt;<a href=3D"mailto:olaf@aepfle.de" target=3D"=
_blank">olaf@aepfle.de</a>&gt;<br>
---<br>
=C2=A0tools/xentrace/formats | 4 ++--<br>
=C2=A01 file changed, 2 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/tools/xentrace/formats b/tools/xentrace/formats<br>
index 0fcc327a40..afb5ee0112 100644<br>
--- a/tools/xentrace/formats<br>
+++ b/tools/xentrace/formats<br>
@@ -211,8 +211,8 @@<br>
=C2=A00x00802008=C2=A0 CPU%(cpu)d=C2=A0 %(tsc)d (+%(reltsc)8d)=C2=A0 do_irq=
 [ irq =3D %(1)d, began =3D %(2)dus, ended =3D %(3)dus ]<br>
<br>
=C2=A00x00084001=C2=A0 CPU%(cpu)d=C2=A0 %(tsc)d (+%(reltsc)8d)=C2=A0 hpet c=
reate [ tn =3D %(1)d, irq =3D %(2)d, delta =3D 0x%(4)08x%(3)08x, period =3D=
 0x%(6)08x%(5)08x ]<br>
-0x00084002=C2=A0 CPU%(cpu)d=C2=A0 %(tsc)d (+%(reltsc)8d)=C2=A0 pit create =
[ delta =3D 0x%(1)016x, period =3D 0x%(2)016x ]<br>
-0x00084003=C2=A0 CPU%(cpu)d=C2=A0 %(tsc)d (+%(reltsc)8d)=C2=A0 rtc create =
[ delta =3D 0x%(1)016x , period =3D 0x%(2)016x ]<br>
+0x00084002=C2=A0 CPU%(cpu)d=C2=A0 %(tsc)d (+%(reltsc)8d)=C2=A0 pit create =
[ delta =3D 0x%(1)08x, period =3D 0x%(2)08x ]<br>
+0x00084003=C2=A0 CPU%(cpu)d=C2=A0 %(tsc)d (+%(reltsc)8d)=C2=A0 rtc create =
[ delta =3D 0x%(1)08x, period =3D 0x%(2)08x ]<br>
=C2=A00x00084004=C2=A0 CPU%(cpu)d=C2=A0 %(tsc)d (+%(reltsc)8d)=C2=A0 vlapic=
 create [ delta =3D 0x%(2)08x%(1)08x , period =3D 0x%(4)08x%(3)08x, irq =3D=
 %(5)d ]<br>
=C2=A00x00084005=C2=A0 CPU%(cpu)d=C2=A0 %(tsc)d (+%(reltsc)8d)=C2=A0 hpet d=
estroy [ tn =3D %(1)d ]<br>
=C2=A00x00084006=C2=A0 CPU%(cpu)d=C2=A0 %(tsc)d (+%(reltsc)8d)=C2=A0 pit de=
stroy=C2=A0 [ ]<br>
</blockquote></div>

--000000000000ae471806018ed56d--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 16:58:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 16:58:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571525.895581 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPQnI-0002Jh-FY; Fri, 28 Jul 2023 16:58:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571525.895581; Fri, 28 Jul 2023 16:58:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPQnI-0002Ja-CG; Fri, 28 Jul 2023 16:58:24 +0000
Received: by outflank-mailman (input) for mailman id 571525;
 Fri, 28 Jul 2023 16:58:22 +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
 <SRS0=7hHC=DO=citrix.com=prvs=56653927b=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qPQnG-0002JU-A8
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 16:58:22 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f334442a-2d67-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 18:58:19 +0200 (CEST)
Received: from mail-bn8nam12lp2172.outbound.protection.outlook.com (HELO
 NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.172])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 28 Jul 2023 12:58:16 -0400
Received: from BYAPR03MB3623.namprd03.prod.outlook.com (2603:10b6:a02:aa::12)
 by SA1PR03MB7029.namprd03.prod.outlook.com (2603:10b6:806:334::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Fri, 28 Jul
 2023 16:58:12 +0000
Received: from BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::edfe:6f64:4048:74c5]) by BYAPR03MB3623.namprd03.prod.outlook.com
 ([fe80::edfe:6f64:4048:74c5%4]) with mapi id 15.20.6609.032; Fri, 28 Jul 2023
 16:58:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f334442a-2d67-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690563499;
  h=message-id:date:subject:from:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=wpAqQfh3njU2aKSASYfszF0VddhYyQy6a6/XYA4m8tI=;
  b=J1irVYHoDY9eCtCmXWix4Iuu7hfHJWNUKybpyYi5oPq8+4/+q/Jz7taE
   YoZHJoOV6k7yGhLhFPM71nGnOd4nL7OT/5dux3n2umdLg6T33Og7iRnza
   GtFBc81jxf7KCm9bxrxtdUa8vCYmTGx3zeL04IC6VBgm3SF+IvT57KnVW
   c=;
X-IronPort-RemoteIP: 104.47.55.172
X-IronPort-MID: 117816575
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:yuf6v6uliFB5ShHDqVwgCSd6ZOfnVPBfMUV32f8akzHdYApBsoF/q
 tZmKTqEO/uONGL9fdxwOYW18xsPuMfRmtExTAJvrHthQy4W+JbJXdiXEBz9bniYRiHhoOCLz
 O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQqI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U7nibeUy7OTJuQHTR8FPxYHG?=
 =?us-ascii?q?BJntnRLa+cQOdwq9fqp87?=
X-Talos-MUID: =?us-ascii?q?9a23=3Asssz9A1E+IGfr6VFpJpO2QBN8jUjxpSoLVsfuss?=
 =?us-ascii?q?65tSfGDVcAHSetxaHa9py?=
X-IronPort-AV: E=Sophos;i="6.01,238,1684814400"; 
   d="scan'208";a="117816575"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CxWL0zZbynMXFLCVa4WN1eXR6aJM2VLzjIEuL3DFRetwifsXXnDIN4HhYAQxhQ5fcPPKurCy/jzQvSb2abMBVQCTc7CpPOZy30f2f2j3SAa2SDLKR08luv2kXyrWj4RSsJZit/hn55eiebqv/xbZT4kmQlD/yE+MuGfeeVZLSs6SliMM0z6oULw84YUU5omFV4xVCdP4ffYSNQ+A4tHvr5SudenxmNQAb2jUFX2mfkFwbaehmDMtyyQ+IhaQGWFH4oSLx86NrDeOOqLozmNp4KszPDnNkyIuMKqBdQIgr/QuD5Nacac4mxsD7o3RaNzTkHQQ9N98kW6fA8x1gMq6mA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=sG2xeXvda2IyP8areTnFv8MwtRgz9w+sOfGHrPK3V/4=;
 b=CmpSA+LojpMwoiCkz5juAFw66Fo7u/yL4R9Gx6PDBR/kjwkCozOLKV7d3BjXg91H8mfKi16re+nlDzreSbpq5mKNJuZ4t7say66/6ZfqCnMyC2GDiF0Uxh7U7lmH60fQ7C795bP1ctvGV8Ai1rp+6NcyyGzShU9R8nP/b5Sw4iF+nsoCX+dB1QTr6SakZ5x47X8GJyYM/cHZeiyvMheJFB/ojPpbP1CF+GhBSykd7HwjXMettJnGv5biVdlHmvqTIohwAT/QPTm/v24L6tRujVFHkEFtlhJYOa8GZlqngGybjaIp9oApJLhbLLXXQkeHf7GLpGUAfdhw0dhzqZvZYQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=sG2xeXvda2IyP8areTnFv8MwtRgz9w+sOfGHrPK3V/4=;
 b=s71s+WxUl1cMJP8fbNVZ+TLW4O3VjLAy9iDe7eD000aPm8cm90HfO2ZNeDQan+UDX/3IM/Ow/ZcAvJ3LkVI+1DBBUjTHQtvQ6YhhEpUMpwXZv1ZP87ltzKNjmwiio+KBv2cKpQqXu2xnniaxUb4Ir0NAnK8dU7Q2HHrB2AHlXcw=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <3470bc26-3cbc-e0de-53ae-203449493b51@citrix.com>
Date: Fri, 28 Jul 2023 17:58:05 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v2 5/5] pdx: Add CONFIG_HAS_PDX_COMPRESSION as a common
 Kconfig option
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
References: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
 <20230728075903.7838-6-alejandro.vallejo@cloud.com>
 <9f0b7ab4-090f-21ea-2cf8-6ecdc7c02225@citrix.com>
In-Reply-To: <9f0b7ab4-090f-21ea-2cf8-6ecdc7c02225@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0216.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:33a::8) To BYAPR03MB3623.namprd03.prod.outlook.com
 (2603:10b6:a02:aa::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BYAPR03MB3623:EE_|SA1PR03MB7029:EE_
X-MS-Office365-Filtering-Correlation-Id: 9651620b-da3f-4d52-484e-08db8f8bd3d3
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	D3Vs/tfdM3Oy3deVUMnnz2I0nWEqj/SfRhQSqa0lu3WhUMsfEmCvU4B8n505QCvB0HZZ4WCQb4vFt0o+CXrt96eX3VNFSXE9p/IDo5Et6xyn6fRwN5H/CSyoCh+XtH2kdld2FFPCLMH45Buj+jegSPhCLPKMT+19I1I+C37tUzpbqFy6sscgdEzI3msYjEnvHUfyAQD0vNLjvnn3d9JRHnsMsOR++xQLYxv152SA6qyyT5/mqNjfQvwhtWQ5thRvNWu1rBsGyuepKbDfFyMaDuYrzMHGmYhfvfuP3EOQUrJ5y6WiHN8jaraYk2gmL80X80oBFH0wCKwGaeVFeod8zlz/DI8wIXmdxh9/huXOR/lTRhCIhIXwXi7ysbMuIfc/Kg3cj/lq03ohB2Mmv+NPR7zpDmvm0ExSnLhy44WFhoABY2jpoKWt8wC/LIokzqtLg86O/WglC6ZLg8iPQtN9hlXk9EuKT1npRU9N3rxGUmwOoRkpDHMYpEmfa714Ni3zAt5oCdEikOVQ7dJ7EnDp0CV9MtzPVOC37HmHCOJj/A24Ft27WPIZgTRfTU68EKf9LFChfsqOk4idyDe+7/TMNlzz2TltrAO36O0bsDpdVd79N8ObdrrRkiZBTLXkR7Dj3w/0+erg/nWsFfLsAwufXA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB3623.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(346002)(39860400002)(376002)(136003)(451199021)(2906002)(316002)(8676002)(8936002)(5660300002)(86362001)(7416002)(41300700001)(36756003)(31696002)(53546011)(6512007)(6506007)(107886003)(26005)(6486002)(478600001)(82960400001)(6666004)(186003)(31686004)(2616005)(4326008)(38100700002)(66476007)(66946007)(66556008)(110136005)(54906003)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bUNVc2pNcWtkZlRBZWdUR1Mva1BCb2dxc2RjeUR3Q3VxSE93UjkwVGo1Q1p6?=
 =?utf-8?B?a25uaXA4U0tYbFkyd2xGeTM1WERKdFBMNlk5OHRwVnd3VlZBTnZCK1JjRE45?=
 =?utf-8?B?K3hQY21rdFp2cmFnbHY4SFZuZVlRSHg5WC9pMFFFb3NRRFRDWTRrZm9SZzRJ?=
 =?utf-8?B?dXIrcFhqSlNDdS9WbTQyTFNqanl0dGVXcDNnZVdSYjlCOVNyVGRIYWlPVTFN?=
 =?utf-8?B?YTBCQTFmZUg3VVFMaE1OajYwdW8wbEFIdE5lU1ZZMkJBRVE5L3hVdDYvYzBZ?=
 =?utf-8?B?TUIxc0ltcHFCRGZSNmFqTk4ycWVTeWV0Z0RySXBDdjN5aTJhek4wRW85R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UYc19ko8InVrB929JA1OPibFkFfSmltbYklRdu8kq0xpzWiurV7yAh7eGlmIwC2YV4Y=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9651620b-da3f-4d52-484e-08db8f8bd3d3
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3623.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2023 16:58:12.2557
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: NPeEhJHzOxbMfA6xNYq9sbL5SFnsEZFjWN449fkxj1V4pQQwa0CDRStdfyF11w25Rf/BdWNdhX4fLL6JfFwezY/2Gf9wLwRGvPGEYLb4mZU=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB7029

On 28/07/2023 5:36 pm, Andrew Cooper wrote:
> On 28/07/2023 8:59 am, Alejandro Vallejo wrote:
>> Adds a new compile-time flag to allow disabling pdx compression and
>> compiles out compression-related code/data. It also shorts the pdx<->pfn
>> conversion macros and creates stubs for masking fucntions.
>>
>> While at it, removes the old arch-defined CONFIG_HAS_PDX flag, as it was
>> not removable in practice.
>>
>> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
>> ---
>> v2:
>>   * Merged v1/patch2: Removal of CONFIG_HAS_PDX here (Jan)
> This series is now looking fine, except for the Kconfig aspect.
>
> This is not something any user or developer should ever be queried
> about.Â  The feedback on the documentation patches alone show that it's
> not understood well by the maintainers, even if the principle is accepted.
>
> There is never any reason to have this active on x86.Â  Indeed, Julien's
> quick metric shows how much performance we waste by having it enabled.

Further to this, bloat-o-meter says net -30k of code and there are
plenty of fastpaths getting a several cacheline reduction from this.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 17:52:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 17:52:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571527.895590 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPRde-0000U3-BN; Fri, 28 Jul 2023 17:52:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571527.895590; Fri, 28 Jul 2023 17:52:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPRde-0000Tw-8j; Fri, 28 Jul 2023 17:52:30 +0000
Received: by outflank-mailman (input) for mailman id 571527;
 Fri, 28 Jul 2023 17:52:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Z7ET=DO=aepfle.de=olaf@srs-se1.protection.inumbo.net>)
 id 1qPRdd-0000Tk-7c
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 17:52:29 +0000
Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de
 [85.215.255.25]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8357ee8c-2d6f-11ee-b24e-6b7b168915f2;
 Fri, 28 Jul 2023 19:52:26 +0200 (CEST)
Received: from sender by smtp.strato.de (RZmta 49.6.6 AUTH)
 with ESMTPSA id jd2f5az6SHqJGEJ
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits))
 (Client did not present a certificate);
 Fri, 28 Jul 2023 19:52:19 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8357ee8c-2d6f-11ee-b24e-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; t=1690566739; cv=none;
    d=strato.com; s=strato-dkim-0002;
    b=MLhHZEfki9S1wUCUpAIeq0mEEk7XZry3D6dpefpfZRi/gwh9OHXJFCLt/ES9ODSWnx
    fqg6+OIYKp2aWy7wGKk2hyl4raltWi3yWt47jd9vE5O2dLgJb5dpYBCICM2jpTG0eQv+
    r58sfQVxmLT1r37+SWzJJX52AHx8uy2n4zg54sIm52/xVkn/VkOcPJrZzh15+HvUPtcb
    3ATA9xzLN+RFaxboni0nQ1T8XfbGoBzf+L//djqHCc8Xfc6Y3BEnWPcPouyu/4j7e6Po
    tUlbpn7x6fhuEu8tG0lDUwyfFcJoSl+wfkbIwPNJwk5SLx9I35H2seakBhk3eJugOShe
    wHFg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1690566739;
    s=strato-dkim-0002; d=strato.com;
    h=References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Cc:Date:
    From:Subject:Sender;
    bh=dMqsAPOUePXAb3/kfVDyt+5XInlBaF90fkWPaXo0r9c=;
    b=LJlKf9lwgR/YZyxb/YKRv1/5y3U+FG/FmYvm7eaXnlemuENYASdLm9gQMzK/DnbYOQ
    mVbWz2wPb92VmWkXG5aJ2cIGqpz2KwiAzbgWtz5nxUY9gQUS4Ju2bLlC0Ig9GYZmhZad
    FsLvrWn4L+vqj9ut9+UIWD57K7LIPUwjKljFXBAnjJT9TdxRAh7/Tyyk51/KmrUM0mWW
    6gGfwoXi0xySFLc7blHMSoT5Y5w+0DckMHRoaPnieX1GF+RFbtnCHrpIJnYcYYuOlCVm
    dbsQJXvIWSI6XpBr8akIgHHFCk/rd+5e3TfOMsBLzxHmJmtKAMBDJRTOeH4oy2AOxTs1
    LRkA==
ARC-Authentication-Results: i=1; strato.com;
    arc=none;
    dkim=none
X-RZG-CLASS-ID: mo00
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1690566739;
    s=strato-dkim-0002; d=aepfle.de;
    h=References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Cc:Date:
    From:Subject:Sender;
    bh=dMqsAPOUePXAb3/kfVDyt+5XInlBaF90fkWPaXo0r9c=;
    b=g1lOLJUmim9XCsuhe3Oa/rhk3g222Bd+dvOzKgdysolc0aAnPcBtu1l+A8NCGpT/OS
    iHVVd3ApsRSZ253r4HQlntKGogW7wzgtUuQidYeNHVKMmHscYqr0gyUn13PmUopvhCuJ
    iceKBFjyYPt7tKdRIgPihLwCQKd2cUwmg8ayykZNrW90ogx2ZQNeEgETqbBakBEwQxe6
    0hI7iVgzZPL2QX08/h88kDfdcZ03r42Fj8KLjqL5HBVSVPLlry4PtNfTF5T55iJACzXA
    DLqFLdMjvvjMHRAfsRXCnkHO7yzBMfvk6OPnaYeYrfsmZCqqh/vK7PT9GFgj9ntS9Fja
    MG9Q==
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1690566739;
    s=strato-dkim-0003; d=aepfle.de;
    h=References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Cc:Date:
    From:Subject:Sender;
    bh=dMqsAPOUePXAb3/kfVDyt+5XInlBaF90fkWPaXo0r9c=;
    b=AoFSlnqz7lDMqmJBz+eo5QoRHEnmMSNG3+EUKYHydFDdLL7JXkoFA6Aylbn0jtDRT0
    7jPtj5O8eD/TaGAgQCCA==
X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QLpd5ylWvMDX3y/OuD5rXVisR5U0GIOxzsQPrGAhfM0BJebfTWeDWMtcJLtvI+aQ=="
Date: Fri, 28 Jul 2023 19:52:10 +0200
From: Olaf Hering <olaf@aepfle.de>
To: George Dunlap <george.dunlap@cloud.com>
Cc: xen-devel@lists.xenproject.org, George Dunlap
 <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>, Anthony PERARD
 <anthony.perard@citrix.com>
Subject: Re: [PATCH v1 2/7] xentrace: use correct output format for pit and
 rtc
Message-ID: <20230728195210.66faf194.olaf@aepfle.de>
In-Reply-To: <CA+zSX=bZ5zo9cxWTq9s9QOUGZ-9NMEugewR90z1w8C++sruSVw@mail.gmail.com>
References: <20230601142742.15489-1-olaf@aepfle.de>
	<20230601142742.15489-3-olaf@aepfle.de>
	<CA+zSX=bZ5zo9cxWTq9s9QOUGZ-9NMEugewR90z1w8C++sruSVw@mail.gmail.com>
X-Mailer: Claws Mail 20230724T063118.58ae3d58 hat ein Softwareproblem, kann man nichts machen.
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="Sig_/ZuTyVo4HpPE6Ufnyd1xNIdU";
 protocol="application/pgp-signature"; micalg=pgp-sha256
Content-Transfer-Encoding: 7bit

--Sig_/ZuTyVo4HpPE6Ufnyd1xNIdU
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Fri, 28 Jul 2023 17:47:11 +0100 George Dunlap <george.dunlap@cloud.com>:

> Just a couple of notes on the whole series.  First, you didn't CC me on 0=
/7
> or 1/7.  Secondly, patch 7 seems to be corrupted (see e.g., Patchew's
> attempt to apply the series [1]).

The cover letter can not be easily fixed, this is a bug in git send-email.
It should be able to collect all recipients and put them in the cover lette=
r.
I think I already pointed that out a while ago on git-devel...

I think #1 can be fixed by adjusting the MAINTAINERS file.
Not sure why #7 fails to apply.

I will rebase and resend next week.


Olaf

--Sig_/ZuTyVo4HpPE6Ufnyd1xNIdU
Content-Type: application/pgp-signature
Content-Description: Digitale Signatur von OpenPGP

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE97o7Um30LT3B+5b/86SN7mm1DoAFAmTEAEoACgkQ86SN7mm1
DoBU3w/6AlXjPiyuMYOYm/PNbSiC3/8p8cfHP6UfnFzTLEhCKmny1jDL80ib/nIS
v4lLFR0EpfTJi6rmPFMjpfxSIpoi7sty3uMHHS4NtryjjV39QcrUPchGencGBmbj
sz6KqzCs4JC2lWQHiahx9vVZaR3C50SGSQOjPvXAFm+HN1/+pE37hkq+RuwgVbwP
dmnPCNomvjri/vrM21CF+dxdskpeucovy3Mbgs8qkLbJncL29oVYrJQMxjMDcoAZ
O4rzr2U2J3KIM3SbzQQVbdZIaYRC5wlEVCiI5LQD+HQXe3dDmILMzxjYwc7v6Ni8
plyqZoUefIt/P084/DQiyIcqKJ/8d4wNnMoI3/mzyYFRe9Sx8jfhjm7V7P9aH6lT
sndySqlT9JQU6b7C2ivPtyFkspjjE6Zg5f8OJg/18X92LSprgfRkiDyqj2st6PzW
lRlceoDTxtHTHrTTUHEuRIsdio4Vwn5eEj8uP6MyXJY3ezoCwOInaD1jU4O417IE
lrXrFFsFBpPRsW9g885+UPMqiXh5VEit5nI8kPQzPogWrteLdh8NGmEIfIiCQjV7
Wqbn2p6teDKMhZlSgBH2HfIOPe4QEdZsg2zL3ZiJStFUE7fj0Q/jka4BA2GX7Ztj
1BM+Y/lTve9u3Nrr9fv88cBAEEkT8DL7J/jBcBtdWAA0fZP5utE=
=jKFG
-----END PGP SIGNATURE-----

--Sig_/ZuTyVo4HpPE6Ufnyd1xNIdU--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 18:17:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 18:17:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571530.895600 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPS20-0003CC-A3; Fri, 28 Jul 2023 18:17:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571530.895600; Fri, 28 Jul 2023 18:17:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPS20-0003C5-7I; Fri, 28 Jul 2023 18:17:40 +0000
Received: by outflank-mailman (input) for mailman id 571530;
 Fri, 28 Jul 2023 18:17:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7hHC=DO=citrix.com=prvs=56653927b=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qPS1y-0003Bz-LO
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 18:17:38 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 066e8dd2-2d73-11ee-b24e-6b7b168915f2;
 Fri, 28 Jul 2023 20:17:36 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 066e8dd2-2d73-11ee-b24e-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690568256;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=53Becd7zOjdCL49sQjmjL6weiFSnrO2dmg85Si+Y4qw=;
  b=MJMBpc6hkVtpIXdQBsdD0C1TvdmGfCiAOCAXSTuXXSgapZxeP9PtBqnJ
   zKLGqMZUzujLwo46b0C+Hy6UpwklyFlUQJgENMQwfk5qoXzdUFZCGR5wy
   cm+Qx0hlDQ2p0rnSm8jOJU5JkKVfgc5Ff4oWb8+0E44n1UZjCiP0THYEy
   I=;
Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 117824141
X-Ironport-Server: esa3.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:O+pExqIrBwwCgHh4FE+R0ZUlxSXFcZb7ZxGr2PjKsXjdYENSgzIEm
 GUdX26EaPqKZmqkL9AlYNiy9hkAsJbWndRlSAplqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t
 ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws
 Jb5rta31GWNglaYCUpKrfrawP9TlK6q4mhA4QZuPaojUGL2zBH5MrpOfcldEFOgKmVkNrbSb
 /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/
 jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5NPUQW0
 9hIdwsIRT+OoPu24J+xFuZF05FLwMnDZOvzu1llxDDdS/0nXYrCU+PB4towMDUY354UW6yEP
 oxANGQpNU6bC/FMEg5/5JYWteGknHTgNRZfr0qYv/Ef6GnP1g1hlrPqNbI5f/TTHJoFxBrB+
 juuE2LRLRYkb4G+62u+qHOKguvGui/5XIIbLejtnhJtqALKnTFCYPEMbnOrrP/8hkOgVtZ3L
 00P5jFovaU07FasTNT2Q1u/unHsljw2VsdUEuY6wBqQ0aeS6AGcbkAbShZRZdpgs9U5LQHGz
 XfQwYmvX2Y29uTIFzTErOz8QS6O1TY9F1MnPQkgHVQ+5vLMraYqjjLiRIpsOfvg5jHqIg0c0
 wxmvQBn2eRL0JBVifvrlbzUq2ny/8aUF2bZ8i2SBzv4tV0hOeZJcqTysTDmAeB8wJF1p7Vrl
 FwNgICg4e8HFvlhfwTdEbxWTNlFCxtoWQAwYGKD/LF7rVxBA1b5IehtDMhWfS+FyPosdz7ze
 1P0sghM/pJVN3bCRfYpMtrtW550nfa7T4uNuhXogjxmOMUZmOivpXEGWKJt9zq1zBhEfV8XZ
 /93jvpA/V5FUP86nVJats8W0KMxxzBW+I8gbcmT8vhT6pLHPCT9Ye5cYDOzghURsPvsTPP9r
 4wOaKNnCnx3DIXDX8Ug2ddCdglTfSBrX8CeRg4+XrfrHzeK0VoJU5f5qY7NsaQ890iJvo8kJ
 k2AZ3I=
IronPort-HdrOrdr: A9a23:ykANl6PXskYv3MBcTs+jsMiBIKoaSvp037BL7TEXdfUxSKalfq
 +V8sjzuSWatN9zYgBDpTnjAtjlfZq0z/ccjbX5W43SPzUO0FHCEGgI1+rfKlPbexEWptQx6U
 8jG5IObeHNMQ==
X-Talos-CUID: =?us-ascii?q?9a23=3A7J2oeGh4qv8Mbc3u9DEgK6UCCTJuSEH4lFH0cxC?=
 =?us-ascii?q?DDE1GRZqMSX+98v9rup87?=
X-Talos-MUID: =?us-ascii?q?9a23=3Aif5QSAwKBV+g0u8K4ig+alAKoxaaqIupNhtQsLd?=
 =?us-ascii?q?XgJOFEyh0MhCRjjC3S7Zyfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,238,1684814400"; 
   d="scan'208";a="117824141"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
	<JBeulich@suse.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>
Subject: [PATCH] x86/amd: Fix DE_CFG truncation in amd_check_zenbleed()
Date: Fri, 28 Jul 2023 19:17:30 +0100
Message-ID: <20230728181730.3065977-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

This line:

	val &= ~chickenbit;

ends up truncating val to 32 bits, and turning off various errata workarounds
in Zen2 systems.

Fixes: f91c5ea97067 ("x86/amd: Mitigations for Zenbleed")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>

The choice is between int or uint64_t.  This is one case where the insistence
on using unsigned int as a default data type is genuinely unsafe.
---
 xen/arch/x86/cpu/amd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 3ed06f670491..089038bf62c5 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -909,8 +909,9 @@ void __init detect_zen2_null_seg_behaviour(void)
 void amd_check_zenbleed(void)
 {
 	const struct cpu_signature *sig = &this_cpu(cpu_sig);
-	unsigned int good_rev, chickenbit = (1 << 9);
+	unsigned int good_rev;
 	uint64_t val, old_val;
+	int chickenbit = (1 << 9);
 
 	/*
 	 * If we're virtualised, we can't do family/model checks safely, and
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 18:27:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 18:27:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571533.895611 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPSBn-0004lu-7Z; Fri, 28 Jul 2023 18:27:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571533.895611; Fri, 28 Jul 2023 18:27:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPSBn-0004ln-42; Fri, 28 Jul 2023 18:27:47 +0000
Received: by outflank-mailman (input) for mailman id 571533;
 Fri, 28 Jul 2023 18:27:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPSBl-0004ld-5c; Fri, 28 Jul 2023 18:27:45 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPSBk-00066b-Q6; Fri, 28 Jul 2023 18:27:44 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPSBk-0000r0-D1; Fri, 28 Jul 2023 18:27:44 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qPSBk-0001Qq-CV; Fri, 28 Jul 2023 18:27:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=3QLOk8AGYB44xXA3lwMHQBeYBaYRxm2CLLO0WgBK3q0=; b=pIsAebSV6dHKPKV7d0hA0a11qK
	LVCD+fIJ4PbKAr4vYISuBtuBdQxgIXIrEwuK2cTvsE61SFw1zUm0miMhhr8tKMbeSf5icYS//Sv71
	gEw6+JhaLGZdEyM/KAIOYN94uc55WRqZQrh3+UY4xIokHnaErzSV6xVEKiy7JYGK2ukQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182051-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 182051: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=e33054b72ccde26aec4775aa6d477fc8527c9a4a
X-Osstest-Versions-That:
    libvirt=8e958c1644185eeaece0a724d9ff8674c4edce38
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 28 Jul 2023 18:27:44 +0000

flight 182051 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182051/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182030
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 182030
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 182030
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 libvirt              e33054b72ccde26aec4775aa6d477fc8527c9a4a
baseline version:
 libvirt              8e958c1644185eeaece0a724d9ff8674c4edce38

Last test of basis   182030  2023-07-27 04:18:55 Z    1 days
Testing same since   182051  2023-07-28 04:22:09 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrea Bolognani <abologna@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   8e958c1644..e33054b72c  e33054b72ccde26aec4775aa6d477fc8527c9a4a -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 18:38:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 18:38:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571538.895621 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPSLw-0006QZ-Aw; Fri, 28 Jul 2023 18:38:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571538.895621; Fri, 28 Jul 2023 18:38:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPSLw-0006QS-7n; Fri, 28 Jul 2023 18:38:16 +0000
Received: by outflank-mailman (input) for mailman id 571538;
 Fri, 28 Jul 2023 18:38:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=G4km=DO=chromium.org=keescook@srs-se1.protection.inumbo.net>)
 id 1qPSLu-0006QM-6W
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 18:38:14 +0000
Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com
 [2607:f8b0:4864:20::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e80da097-2d75-11ee-b24e-6b7b168915f2;
 Fri, 28 Jul 2023 20:38:13 +0200 (CEST)
Received: by mail-pl1-x62f.google.com with SMTP id
 d9443c01a7336-1bbf8cb694aso354045ad.3
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 11:38:13 -0700 (PDT)
Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net.
 [198.0.35.241]) by smtp.gmail.com with ESMTPSA id
 ix13-20020a170902f80d00b001b9d7c8f44dsm3907903plb.182.2023.07.28.11.38.10
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 28 Jul 2023 11:38:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e80da097-2d75-11ee-b24e-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=chromium.org; s=google; t=1690569491; x=1691174291;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=33rFVY7OX9UkeWBGFwT8EclqMxrl4R8dedNz9bKvxDQ=;
        b=By+5JMuD4M/lflc4z2fRv1vZzoxOUZYjHnQN4K1rkcJbvqH88LjT5IBYClmIAOanaS
         VYATJHuG9lgKZPivIIP6bJwMkVB6vPz1kXw2NHGNdapwyCGyNqIiIuT7eX6J88XUW0UB
         umgkL6WUPWkNC1tS98P9ChR7CE4/J/0ksMXiQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690569491; x=1691174291;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=33rFVY7OX9UkeWBGFwT8EclqMxrl4R8dedNz9bKvxDQ=;
        b=Mq9OqnU0WsXVl+wr4ZfvHD0vtyq1pY0ibYkAAOjpnrHHOE7i0826vmo2aXNRCNV+mh
         rPqeWv/dzuUHoHrtlIzGrkW9Z1NF+AGYSJvc0UY6aCLn8XJWv65KcC0TQ0IqxPf5SmKH
         F+UYrV0UxGHhvOxy3qs4dOJG9FBuI1p0bYTotsMcyi7bMYDvtcfJokHFb2ce+1bcd2dj
         Isx/w0/IdsHkwvOWJ6HtRLcH69dvL+wR5bMYmiDPtpkckjh5RQHrc2zdPcpTSskES+aI
         DO7aqOZmkpvNej9IBZXcoaXIUft4eOZF0sWM7tHf0R9oy7wzxQmCSjtQuf5FFzFnX36p
         LWcQ==
X-Gm-Message-State: ABy/qLayuwtJwNJCp6ChjR6WbfxgMGjgcb/7pcvZEWE25UPXjqlFHVFM
	cVO/Uj3kMF4sh3L9k/Ouo1uYug==
X-Google-Smtp-Source: APBJJlGs+KiAjovc4Ff5bXdv+1247KNp4pAQW/e6jaoOH3v88JUN99m0BT5bc653vOVDiJeYTmDZgA==
X-Received: by 2002:a17:903:248:b0:1b9:cf52:2bcf with SMTP id j8-20020a170903024800b001b9cf522bcfmr2621118plh.0.1690569491651;
        Fri, 28 Jul 2023 11:38:11 -0700 (PDT)
Date: Fri, 28 Jul 2023 11:38:09 -0700
From: Kees Cook <keescook@chromium.org>
To: Elliott Mitchell <ehem+xen@m5p.com>
Cc: Justin Stitt <justinstitt@google.com>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	xen-devel@lists.xenproject.org, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: xen-front: refactor deprecated strncpy
Message-ID: <202307281133.16D4305@keescook>
References: <20230727-sound-xen-v1-1-89dd161351f1@google.com>
 <ZMNILDgqHEGf8fNF@mattapan.m5p.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <ZMNILDgqHEGf8fNF@mattapan.m5p.com>

On Thu, Jul 27, 2023 at 09:46:36PM -0700, Elliott Mitchell wrote:
> On Thu, Jul 27, 2023 at 09:53:24PM +0000, Justin Stitt wrote:
> > Technically, my patch yields subtly different behavior. The original
> > implementation with `strncpy` would fill the entire destination buffer
> > with null bytes [3] while `strscpy` will leave the junk, uninitialized
> > bytes trailing after the _mandatory_ NUL-termination. So, if somehow
> > `pcm->name` or `card->driver/shortname/longname` require this
> > NUL-padding behavior then `strscpy_pad` should be used. My
> > interpretation, though, is that the aforementioned fields are just fine
> > as NUL-terminated strings. Please correct my assumptions if needed and
> > I'll send in a v2.
> 
> "uninitialized bytes" => "leak of sensitive information" => "security hole"

For xen_snd_front_alsa_init(), "card" is already zero-initialized in
snd_card_new().

For new_pcm_instance(), "pcm" is already zero-initialized in
_snd_pcm_new().

So things look good to me!

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 18:39:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 18:39:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571541.895631 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPSN9-0006xH-K4; Fri, 28 Jul 2023 18:39:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571541.895631; Fri, 28 Jul 2023 18:39:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPSN9-0006xA-Gv; Fri, 28 Jul 2023 18:39:31 +0000
Received: by outflank-mailman (input) for mailman id 571541;
 Fri, 28 Jul 2023 18:39:30 +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
 <SRS0=I+Wj=DO=kernel.org=pr-tracker-bot@srs-se1.protection.inumbo.net>)
 id 1qPSN8-0006x0-9C
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 18:39:30 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1492bd32-2d76-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 20:39:28 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 148DD621DC;
 Fri, 28 Jul 2023 18:39:26 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPS id 7CCE6C433CB;
 Fri, 28 Jul 2023 18:39:25 +0000 (UTC)
Received: from aws-us-west-2-korg-oddjob-1.ci.codeaurora.org
 (localhost.localdomain [127.0.0.1])
 by aws-us-west-2-korg-oddjob-1.ci.codeaurora.org (Postfix) with ESMTP id
 693D8C4166F; Fri, 28 Jul 2023 18:39:25 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1492bd32-2d76-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690569565;
	bh=MvEhmaMP0NQYXaR+ON9JAVE/AlmQzWiuNidmwMzSgiQ=;
	h=Subject:From:In-Reply-To:References:Date:To:Cc:From;
	b=D5JhO8NvVg/pM9rZrXqTCxYGIZNXztY3Kwy7yycSFalWSG0jwKMQf4GfZsrMMG/c9
	 P4zLI61WWjJy8LF/ZbwCTNq6RoNWPkVX5do5W9Gsd+8fngc/7xk59ezSlBLneZd8Dr
	 Q7B0EPMwYbKvnzEOmPWro9ylU1e8Ikd0Q1t3/SjDp6TBKBeKoAkvLTgobTOVtkAvnh
	 wxeT4mtX5ICbXiolDyo9O3K2jlMHCW86oYdCN4vr2WCb1/YVcm/5vC3gYQSv8ichYW
	 IMK7pHVqxN+qEFzDxpvAtGfxMsrqtUt3sEGkn2DOXf3natWeOmswQASuubwiLgXYb0
	 J+LuiG3mt5AHw==
Subject: Re: [GIT PULL] xen: branch for v6.5-rc4
From: pr-tracker-bot@kernel.org
In-Reply-To: <20230728131804.10538-1-jgross@suse.com>
References: <20230728131804.10538-1-jgross@suse.com>
X-PR-Tracked-List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
X-PR-Tracked-Message-Id: <20230728131804.10538-1-jgross@suse.com>
X-PR-Tracked-Remote: git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git for-linus-6.5a-rc4-tag
X-PR-Tracked-Commit-Id: c04e9894846c663f3278a414f34416e6e45bbe68
X-PR-Merge-Tree: torvalds/linux.git
X-PR-Merge-Refname: refs/heads/master
X-PR-Merge-Commit-Id: 81eef8909d171bdca6af37028a11a24e011ed312
Message-Id: <169056956542.21363.18012666636626712275.pr-tracker-bot@kernel.org>
Date: Fri, 28 Jul 2023 18:39:25 +0000
To: Juergen Gross <jgross@suse.com>
Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, sstabellini@kernel.org

The pull request you sent on Fri, 28 Jul 2023 15:18:04 +0200:

> git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git for-linus-6.5a-rc4-tag

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/81eef8909d171bdca6af37028a11a24e011ed312

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 19:37:05 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 19:37:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571543.895641 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPTGf-0004zd-I8; Fri, 28 Jul 2023 19:36:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571543.895641; Fri, 28 Jul 2023 19:36:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPTGf-0004zW-FP; Fri, 28 Jul 2023 19:36:53 +0000
Received: by outflank-mailman (input) for mailman id 571543;
 Fri, 28 Jul 2023 19:36:52 +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
 <SRS0=wBqy=DO=gmail.com=jandryuk@srs-se1.protection.inumbo.net>)
 id 1qPTGd-0004zQ-Vz
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 19:36:52 +0000
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
 [2a00:1450:4864:20::535])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1803193c-2d7e-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 21:36:48 +0200 (CEST)
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-52229f084beso3460581a12.2
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 12:36:48 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1803193c-2d7e-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690573008; x=1691177808;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=aeKpeXqg16TMqrSTrUuvy9GLYPI7wPEenQQCLcLj5aQ=;
        b=pBRmZ1BgqPvjmdwqVYFirWCABRVLJQVd6lsSlk0/z+pkM++SWywXPuahMf3BdP31vP
         aDqHmAdvgznih39SSYXW0ekY3KOQArXdiTjp+s+p7hQdOP2SU2yRUP4O2g4wTm32BW+q
         ya9f2uQ6Ox4hPO3FU5D+qcnB9IBVTC30RqMOiS84qMBv4DlysPDBlyQJOs04/l2RUVPE
         7yWzOZxvEa5NfvOaoVm6i6B6vcSV8dT2jqh0CpNthWwB9/PHcRo9he9X22Ni/XeNruaW
         fwTJpirRq5K6yYXkoHbJ3eAj1jU4Y8vkekVUxGHneCmvC2qxAePGtLjFLZzOmI+S+a4N
         kBTA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690573008; x=1691177808;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=aeKpeXqg16TMqrSTrUuvy9GLYPI7wPEenQQCLcLj5aQ=;
        b=GZu/vNMYry2KBa6iE54eLFrksSz48uB4tl2b9afBn9qAoLgFzrK3+FUt6U9vbYMl3R
         R1SXfoAIGcr33GCkdXo4iJqBAHeR2dn3wZcUaxx/cmUbQsgcPxFkB+bHEYwrcXuOo2hx
         SbAGvFTy4CvuT3buEjoyRqjCFpd9HQPDG9bryLYxC65ExrBNHbzSdgdGftnhUXsK0H/t
         artXL7rPZ9tvgfJQm30WVy09TtACSWtOxVs0gDB4m8HgjJ4mUbDm8pNh+c/ixmd+xUSk
         TJUSDeHyV4Gld47/5IZbWp+o/37p2Bbh0XDVr2Wp2Esurd24yADDszS5tDt9VnuDoBR9
         qsrw==
X-Gm-Message-State: ABy/qLao0ZEepImIIGpP5hdao2M7lVAua2T7qQpKvHH41mcTr6u2M64B
	AKVc6dkXizNpfdnAzQ6IGGCDHW/scK/8ckix574=
X-Google-Smtp-Source: APBJJlE3xImprInJP5h7TM/E8bj/5lUZ/M1sjGW6RmFmp0QppZxbgucIyaRALCikRxBJE25TYOuSB5h6wlJ7ozIyuKA=
X-Received: by 2002:a05:6402:10c1:b0:522:200f:cc50 with SMTP id
 p1-20020a05640210c100b00522200fcc50mr3121302edu.19.1690573008120; Fri, 28 Jul
 2023 12:36:48 -0700 (PDT)
MIME-Version: 1.0
References: <20230727145447.2701-1-anthony.perard@citrix.com>
In-Reply-To: <20230727145447.2701-1-anthony.perard@citrix.com>
From: Jason Andryuk <jandryuk@gmail.com>
Date: Fri, 28 Jul 2023 15:36:36 -0400
Message-ID: <CAKf6xpvLO284aRJ8BcAzFfjRbPEkcJX4DX=QPFAMu5pQf9UguQ@mail.gmail.com>
Subject: Re: [XEN PATCH v3 0/2] build: reduce number of $(shell) execution on
 make 4.4
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>, 
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, 
	Stefano Stabellini <sstabellini@kernel.org>, George Dunlap <george.dunlap@citrix.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 27, 2023 at 10:55=E2=80=AFAM Anthony PERARD
<anthony.perard@citrix.com> wrote:
> Anthony PERARD (2):
>   build: evaluate XEN_BUILD_* and XEN_DOMAIN immediately
>   Config.mk: evaluate XEN_COMPILE_ARCH and XEN_OS immediately

For the series:
Tested-by: Jason Andryuk <jandryuk@gmail.com>

Thanks,
Jason


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 19:43:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 19:43:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571545.895650 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPTNE-0006Tm-80; Fri, 28 Jul 2023 19:43:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571545.895650; Fri, 28 Jul 2023 19:43:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPTNE-0006Tf-5L; Fri, 28 Jul 2023 19:43:40 +0000
Received: by outflank-mailman (input) for mailman id 571545;
 Fri, 28 Jul 2023 19:43:38 +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
 <SRS0=7hHC=DO=citrix.com=prvs=56653927b=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qPTNC-0006TZ-Dp
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 19:43:38 +0000
Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com
 [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 093ba57b-2d7f-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 21:43:35 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 093ba57b-2d7f-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690573415;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=3ddjg+XfGc/QaOKsJe4sn1glZqZfHIByHulKf8yGLgQ=;
  b=fEszIOXj8J6YC3RVFU39yDJTj68jpiUMe94hs7v7xiHrwOMp/LOdZxol
   rawv/kWmXGr0ZUX6EvFS1c8+Ns+5WqTTdRQNr3QFlfpbZLQvcBB2RTcJG
   sbmDsAYTvgarRj5pyej6wpFkrbjwvEQ2fqVU1xxxE2J3MLHJcXFmWDzcu
   A=;
Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 118251366
X-Ironport-Server: esa1.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:02IUGaAgOSdnRhVW/xLjw5YqxClBgxIJ4kV8jS/XYbTApDsg1WcOz
 GEbC2DVaaqLZmahftp2bN6woBgFuMOAnYU3QQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h
 yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs
 t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GxC7gRkDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS
 uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada
 jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA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I6B81kudkA8sH6CGL0hAZfHHu9rI0Lr+eHc9dmcawTjLtyqs9Ln5VzOF3hISOgk/vIsKwC
 z+ignk4afmlPm+xnbnpgjuxqUTosLl1txAQOqTjcQPQw+c7DqAVcBaQrifuzJwmsGDgWxa6O
 XkklMbJsFu7HGURG2vvhf3/AHl3F8VmgTf4G7du2Lnvcv6AA03ENBAg4UxSGqi13Yd
X-Talos-CUID: 9a23:yhVhVW+hDNFKEA21+j6Vv1c6RO4FLkPf92WOEXe4VmRqEIaRaFDFrQ==
X-Talos-MUID: 9a23:+KBe/AuMhThoeKmOTc2n3TFEFJ1Jub6XT0Etm5ArpJK1aW83JGLI
X-IronPort-AV: E=Sophos;i="6.01,238,1684814400"; 
   d="scan'208";a="118251366"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
	<JBeulich@suse.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>, Roberto Bagnara
	<roberto.bagnara@bugseng.com>, Nicola Vetrini <nicola.vetrini@bugseng.com>
Subject: [PATCH 1/3] x86/traps: Move do_general_protection() earlier
Date: Fri, 28 Jul 2023 20:43:18 +0100
Message-ID: <20230728194320.3082120-2-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20230728194320.3082120-1-andrew.cooper3@citrix.com>
References: <20230728194320.3082120-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

... in order to clean up the declarations without needing to forward declare
it for handle_gdt_ldt_mapping_fault()

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Roberto Bagnara <roberto.bagnara@bugseng.com>
CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/x86/traps.c | 157 +++++++++++++++++++++----------------------
 1 file changed, 78 insertions(+), 79 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 4229bda159ce..e05e8964482e 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1224,6 +1224,84 @@ void do_int3(struct cpu_user_regs *regs)
     pv_inject_hw_exception(X86_EXC_BP, X86_EVENT_NO_EC);
 }
 
+void do_general_protection(struct cpu_user_regs *regs)
+{
+#ifdef CONFIG_PV
+    struct vcpu *v = current;
+#endif
+
+    if ( regs->error_code & X86_XEC_EXT )
+        goto hardware_gp;
+
+    if ( !guest_mode(regs) )
+        goto gp_in_kernel;
+
+#ifdef CONFIG_PV
+    /*
+     * Cunning trick to allow arbitrary "INT n" handling.
+     *
+     * We set DPL == 0 on all vectors in the IDT. This prevents any INT <n>
+     * instruction from trapping to the appropriate vector, when that might not
+     * be expected by Xen or the guest OS. For example, that entry might be for
+     * a fault handler (unlike traps, faults don't increment EIP), or might
+     * expect an error code on the stack (which a software trap never
+     * provides), or might be a hardware interrupt handler that doesn't like
+     * being called spuriously.
+     *
+     * Instead, a GPF occurs with the faulting IDT vector in the error code.
+     * Bit 1 is set to indicate that an IDT entry caused the fault. Bit 0 is
+     * clear (which got already checked above) to indicate that it's a software
+     * fault, not a hardware one.
+     *
+     * NOTE: Vectors 3 and 4 are dealt with from their own handler. This is
+     * okay because they can only be triggered by an explicit DPL-checked
+     * instruction. The DPL specified by the guest OS for these vectors is NOT
+     * CHECKED!!
+     */
+    if ( regs->error_code & X86_XEC_IDT )
+    {
+        /* This fault must be due to <INT n> instruction. */
+        uint8_t vector = regs->error_code >> 3;
+        const struct trap_info *ti = &v->arch.pv.trap_ctxt[vector];
+
+        if ( permit_softint(TI_GET_DPL(ti), v, regs) )
+        {
+            regs->rip += 2;
+            pv_inject_sw_interrupt(vector);
+            return;
+        }
+    }
+    else if ( is_pv_32bit_vcpu(v) && regs->error_code )
+    {
+        pv_emulate_gate_op(regs);
+        return;
+    }
+
+    /* Emulate some simple privileged and I/O instructions. */
+    if ( (regs->error_code == 0) &&
+         pv_emulate_privileged_op(regs) )
+    {
+        trace_trap_one_addr(TRC_PV_EMULATE_PRIVOP, regs->rip);
+        return;
+    }
+
+    /* Pass on GPF as is. */
+    pv_inject_hw_exception(X86_EXC_GP, regs->error_code);
+    return;
+#endif
+
+ gp_in_kernel:
+    if ( likely(extable_fixup(regs, true)) )
+        return;
+
+ hardware_gp:
+    if ( debugger_trap_fatal(X86_EXC_GP, regs) )
+        return;
+
+    show_execution_state(regs);
+    panic("GENERAL PROTECTION FAULT\n[error_code=%04x]\n", regs->error_code);
+}
+
 #ifdef CONFIG_PV
 static int handle_ldt_mapping_fault(unsigned int offset,
                                     struct cpu_user_regs *regs)
@@ -1589,85 +1667,6 @@ void __init do_early_page_fault(struct cpu_user_regs *regs)
     }
 }
 
-void do_general_protection(struct cpu_user_regs *regs)
-{
-#ifdef CONFIG_PV
-    struct vcpu *v = current;
-#endif
-
-    if ( regs->error_code & X86_XEC_EXT )
-        goto hardware_gp;
-
-    if ( !guest_mode(regs) )
-        goto gp_in_kernel;
-
-#ifdef CONFIG_PV
-    /*
-     * Cunning trick to allow arbitrary "INT n" handling.
-     *
-     * We set DPL == 0 on all vectors in the IDT. This prevents any INT <n>
-     * instruction from trapping to the appropriate vector, when that might not
-     * be expected by Xen or the guest OS. For example, that entry might be for
-     * a fault handler (unlike traps, faults don't increment EIP), or might
-     * expect an error code on the stack (which a software trap never
-     * provides), or might be a hardware interrupt handler that doesn't like
-     * being called spuriously.
-     *
-     * Instead, a GPF occurs with the faulting IDT vector in the error code.
-     * Bit 1 is set to indicate that an IDT entry caused the fault. Bit 0 is
-     * clear (which got already checked above) to indicate that it's a software
-     * fault, not a hardware one.
-     *
-     * NOTE: Vectors 3 and 4 are dealt with from their own handler. This is
-     * okay because they can only be triggered by an explicit DPL-checked
-     * instruction. The DPL specified by the guest OS for these vectors is NOT
-     * CHECKED!!
-     */
-    if ( regs->error_code & X86_XEC_IDT )
-    {
-        /* This fault must be due to <INT n> instruction. */
-        uint8_t vector = regs->error_code >> 3;
-        const struct trap_info *ti = &v->arch.pv.trap_ctxt[vector];
-
-        if ( permit_softint(TI_GET_DPL(ti), v, regs) )
-        {
-            regs->rip += 2;
-            pv_inject_sw_interrupt(vector);
-            return;
-        }
-    }
-    else if ( is_pv_32bit_vcpu(v) && regs->error_code )
-    {
-        pv_emulate_gate_op(regs);
-        return;
-    }
-
-    /* Emulate some simple privileged and I/O instructions. */
-    if ( (regs->error_code == 0) &&
-         pv_emulate_privileged_op(regs) )
-    {
-        trace_trap_one_addr(TRC_PV_EMULATE_PRIVOP, regs->rip);
-        return;
-    }
-
-    /* Pass on GPF as is. */
-    pv_inject_hw_exception(X86_EXC_GP, regs->error_code);
-    return;
-#endif
-
- gp_in_kernel:
-
-    if ( likely(extable_fixup(regs, true)) )
-        return;
-
- hardware_gp:
-    if ( debugger_trap_fatal(X86_EXC_GP, regs) )
-        return;
-
-    show_execution_state(regs);
-    panic("GENERAL PROTECTION FAULT\n[error_code=%04x]\n", regs->error_code);
-}
-
 static bool pci_serr_cont;
 
 static bool pci_serr_nmicont(void)
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 19:43:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 19:43:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571546.895661 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPTNG-0006j4-Fc; Fri, 28 Jul 2023 19:43:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571546.895661; Fri, 28 Jul 2023 19:43:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPTNG-0006ix-CD; Fri, 28 Jul 2023 19:43:42 +0000
Received: by outflank-mailman (input) for mailman id 571546;
 Fri, 28 Jul 2023 19:43:40 +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
 <SRS0=7hHC=DO=citrix.com=prvs=56653927b=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qPTNE-0006TZ-TT
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 19:43:40 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0b78cc21-2d7f-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 21:43:38 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0b78cc21-2d7f-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690573418;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=tZcgh/DHPBXNznXBSKcXivjDaURLFpq+0WucV2wxgHw=;
  b=Jwf288bTHr2v4a5xvXoknrSYBlSNm4G4UJa28WiG/+IFL6lOKOA9ANNU
   mI62KjwnyUimAJhSMt4+HrWz6XrNiFrqn20WHxRXCb1UQTy2Asq/WlwJv
   RGW+d0W4eAG72VJNTFUKNzCkcZLx6xAra8qb/8R5TuPnlMIYObILtW940
   8=;
Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 120449228
X-Ironport-Server: esa4.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:Gq6d3qoxSpy6cjpwmqgXlu5WjDpeBmIjZRIvgKrLsJaIsI4StFCzt
 garIBmFOvaLY2uje9h2atyxphgAuJGBz9NjHFBvqygyRSkb8JuZCYyVIHmrMnLJJKUvbq7FA
 +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev
 NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weBzSlNVvrzGInqR5fGatgMdgKFb
 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo
 OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay
 RAXABxKUEG/mb3x+omqE+Rll+IHE/LBJZxK7xmMzRmBZRonaZXKQqGM7t5ExjYgwMtJGJ4yZ
 eJAN2ApNk6ZJUQSZBFOUslWcOSA3xETdxVxrl6PqLVxyG/U1AFri5DmMcbPe8zMTsJQ9qqdj
 jucpzilU0tAZLRzzxKe13al176fph/3d74QBKWBpqZmmlSqkzl75Bo+CgLg/KjRZlSFc8JSL
 QkY9zQjqYA29Ve3VZ/tUhugunmGsxUAHd1KHIUSyiuA167V6AaxHXUfQ3hKb9lOnNAybSwn0
 BmOhdyBLSZourCPVXXb/L6bqzqoMAAfMGAZaCkLCwAC5rHLpoA4iRbGCMhuDLS0iN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7Zyfw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,238,1684814400"; 
   d="scan'208";a="120449228"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
	<JBeulich@suse.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>, Roberto Bagnara
	<roberto.bagnara@bugseng.com>, Nicola Vetrini <nicola.vetrini@bugseng.com>
Subject: [PATCH 0/3] x86: Some MISRA Rule 5.3 fixes
Date: Fri, 28 Jul 2023 20:43:17 +0100
Message-ID: <20230728194320.3082120-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

'debug' and 'str' account for an awefully large number of shadowed variable
violations.

Andrew Cooper (3):
  x86/traps: Move do_general_protection() earlier
  x86/entry: Rename the exception entrypoints
  x86: Delete str()

 xen/arch/x86/hvm/svm/svm.c           |   2 -
 xen/arch/x86/include/asm/desc.h      |   9 --
 xen/arch/x86/include/asm/processor.h |  34 +---
 xen/arch/x86/pv/traps.c              |   2 +
 xen/arch/x86/traps.c                 | 227 ++++++++++++++-------------
 xen/arch/x86/x86_64/entry.S          |  36 ++---
 6 files changed, 142 insertions(+), 168 deletions(-)


base-commit: dbd566ab729d2839c3c0be5c47cdcc06c2c477f0
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 19:43:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 19:43:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571547.895670 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPTNI-0006zU-NS; Fri, 28 Jul 2023 19:43:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571547.895670; Fri, 28 Jul 2023 19:43:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPTNI-0006zK-Kd; Fri, 28 Jul 2023 19:43:44 +0000
Received: by outflank-mailman (input) for mailman id 571547;
 Fri, 28 Jul 2023 19:43:43 +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
 <SRS0=7hHC=DO=citrix.com=prvs=56653927b=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qPTNH-0006TZ-CQ
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 19:43:43 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0db341aa-2d7f-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 21:43:41 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0db341aa-2d7f-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690573420;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=PCPSAJXecSZYJzFdy0upyDxRBRjL68nWU3VefGt0Ksk=;
  b=KIqMEqyhDegLwZ/WDQqY/id0hbSHTGddqHXw8e/28t49h9qVGS+q1bwR
   A7WqmsNj6ywqGTWl+LRX3Te1cXOz4JU+MYtvA21K1+yVC1tEetAswflrj
   RGZWXvNwai9pun4oXLIPXmk5CauoC31fJF8DVuh6aqGsGoRYtlFjd/MPm
   c=;
Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 120449229
X-Ironport-Server: esa4.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:4rhga6h44AFtwaPkDoIoGG39X161WxAKZh0ujC45NGQN5FlHY01je
 htvCDyOOfbfYTTzfIggbIngpkJS78DSndIwGwM/+XsxQSgb9cadCdqndUqhZCn6wu8v7q5Ex
 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv
 cKai8DEMRqu1iUc3lg8sspvkzsx+qyr0N8klgZmP6sT4wWOzyN94K83fsldEVOpGuG4IcbiL
 wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ
 OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+
 tQ0bw5cUg7cwNiN0eu2Q/hKovsYBtD0adZ3VnFIlVk1DN4jSJHHBa7L+cVZzHE7gcUm8fT2P
 pRDL2A1NVKZPkMJYw1MYH49tL7Aan3XWjtUsl+K44Ew5HDe1ldZ27nxKtvFPNeNQK25m27B/
 DqaozWjWEBy2Nq35zja0lKMnff1zSrgVLxCGOTg5M9hqQjGroAUIEJPDgbqyRWjsWauVtQaJ
 0EK9y4Gqakp6FftXtT7Rwe/onOPolgbQdU4O88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M6IsJNUOM8GmPZHW?=
 =?us-ascii?q?DGD9kQayzbWCr0rp7xp8=3D?=
X-Talos-MUID: 9a23:5QMuzwoukRLaBHqOdVsezx9ga+dIw7+2MhAEipk468XdbT5BMB7I2Q==
X-IronPort-AV: E=Sophos;i="6.01,238,1684814400"; 
   d="scan'208";a="120449229"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
	<JBeulich@suse.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>, Roberto Bagnara
	<roberto.bagnara@bugseng.com>, Nicola Vetrini <nicola.vetrini@bugseng.com>
Subject: [PATCH 2/3] x86/entry: Rename the exception entrypoints
Date: Fri, 28 Jul 2023 20:43:19 +0100
Message-ID: <20230728194320.3082120-3-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20230728194320.3082120-1-andrew.cooper3@citrix.com>
References: <20230728194320.3082120-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

This makes the names match the architectural short names that we use
elsewhere.  This avoids 'debug' in particular from being a global symbol
shadowed by many local parameter names.

Remove the DECLARE_TRAP_HANDLER{,_CONST}() infrastructure.  Only NMI/#MC are
referenced externally (and NMI will cease to be soon, as part of adding FRED
support).  Move the entrypoint declarations into the respective traps.c where
they're used, rather than keeping them visible across ~all of Xen.

Drop the long-stale comment at the top of init_idt_traps().  It's mostly
discussing a 32bit Xen, and bogus otherwise as it's impossible to use trap
gates correctly for these purposes.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Roberto Bagnara <roberto.bagnara@bugseng.com>
CC: Nicola Vetrini <nicola.vetrini@bugseng.com>

This is half of a previous patch, cut down to just the rename and header file
cleanup.
---
 xen/arch/x86/include/asm/processor.h | 34 +-------------
 xen/arch/x86/pv/traps.c              |  2 +
 xen/arch/x86/traps.c                 | 70 +++++++++++++++++-----------
 xen/arch/x86/x86_64/entry.S          | 36 +++++++-------
 4 files changed, 64 insertions(+), 78 deletions(-)

diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/asm/processor.h
index c0529cc3d984..0989748be6d5 100644
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -417,38 +417,8 @@ extern void mtrr_bp_init(void);
 
 void mcheck_init(struct cpuinfo_x86 *c, bool_t bsp);
 
-#define DECLARE_TRAP_HANDLER(_name)                    \
-    void _name(void);                                  \
-    void do_ ## _name(struct cpu_user_regs *regs)
-#define DECLARE_TRAP_HANDLER_CONST(_name)              \
-    void _name(void);                                  \
-    void do_ ## _name(const struct cpu_user_regs *regs)
-
-DECLARE_TRAP_HANDLER(divide_error);
-DECLARE_TRAP_HANDLER(debug);
-DECLARE_TRAP_HANDLER_CONST(nmi);
-DECLARE_TRAP_HANDLER(int3);
-DECLARE_TRAP_HANDLER(overflow);
-DECLARE_TRAP_HANDLER(bounds);
-DECLARE_TRAP_HANDLER(invalid_op);
-DECLARE_TRAP_HANDLER(device_not_available);
-DECLARE_TRAP_HANDLER(double_fault);
-DECLARE_TRAP_HANDLER(invalid_TSS);
-DECLARE_TRAP_HANDLER(segment_not_present);
-DECLARE_TRAP_HANDLER(stack_segment);
-DECLARE_TRAP_HANDLER(general_protection);
-DECLARE_TRAP_HANDLER(page_fault);
-DECLARE_TRAP_HANDLER(early_page_fault);
-DECLARE_TRAP_HANDLER(coprocessor_error);
-DECLARE_TRAP_HANDLER(simd_coprocessor_error);
-DECLARE_TRAP_HANDLER_CONST(machine_check);
-DECLARE_TRAP_HANDLER(alignment_check);
-DECLARE_TRAP_HANDLER(entry_CP);
-
-DECLARE_TRAP_HANDLER(entry_int82);
-
-#undef DECLARE_TRAP_HANDLER_CONST
-#undef DECLARE_TRAP_HANDLER
+void do_nmi(const struct cpu_user_regs *regs);
+void do_machine_check(const struct cpu_user_regs *regs);
 
 void trap_nop(void);
 
diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c
index 17ca4d1d5142..74f333da7e1c 100644
--- a/xen/arch/x86/pv/traps.c
+++ b/xen/arch/x86/pv/traps.c
@@ -132,6 +132,8 @@ static void cf_check nmi_softirq(void)
     *v_ptr = NULL;
 }
 
+void nocall entry_int82(void);
+
 void __init pv_trap_init(void)
 {
 #ifdef CONFIG_PV32
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index e05e8964482e..8470561cbc27 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2107,35 +2107,49 @@ void percpu_traps_init(void)
         wrmsrl(MSR_IA32_DEBUGCTLMSR, IA32_DEBUGCTLMSR_LBR);
 }
 
+/* Exception entries */
+void nocall entry_DE(void);
+void nocall entry_DB(void);
+void nocall entry_NMI(void);
+void nocall entry_BP(void);
+void nocall entry_OF(void);
+void nocall entry_BR(void);
+void nocall entry_UD(void);
+void nocall entry_NM(void);
+void nocall entry_DF(void);
+void nocall entry_TS(void);
+void nocall entry_NP(void);
+void nocall entry_SS(void);
+void nocall entry_GP(void);
+void nocall early_page_fault(void);
+void nocall entry_PF(void);
+void nocall entry_MF(void);
+void nocall entry_AC(void);
+void nocall entry_MC(void);
+void nocall entry_XM(void);
+void nocall entry_CP(void);
+
 void __init init_idt_traps(void)
 {
-    /*
-     * Note that interrupt gates are always used, rather than trap gates. We
-     * must have interrupts disabled until DS/ES/FS/GS are saved because the
-     * first activation must have the "bad" value(s) for these registers and
-     * we may lose them if another activation is installed before they are
-     * saved. The page-fault handler also needs interrupts disabled until %cr2
-     * has been read and saved on the stack.
-     */
-    set_intr_gate(X86_EXC_DE,  divide_error);
-    set_intr_gate(X86_EXC_DB,  debug);
-    set_intr_gate(X86_EXC_NMI, nmi);
-    set_swint_gate(X86_EXC_BP, int3);     /* usable from all privileges */
-    set_swint_gate(X86_EXC_OF, overflow); /* usable from all privileges */
-    set_intr_gate(X86_EXC_BR,  bounds);
-    set_intr_gate(X86_EXC_UD,  invalid_op);
-    set_intr_gate(X86_EXC_NM,  device_not_available);
-    set_intr_gate(X86_EXC_DF,  double_fault);
-    set_intr_gate(X86_EXC_TS,  invalid_TSS);
-    set_intr_gate(X86_EXC_NP,  segment_not_present);
-    set_intr_gate(X86_EXC_SS,  stack_segment);
-    set_intr_gate(X86_EXC_GP,  general_protection);
-    set_intr_gate(X86_EXC_PF,  early_page_fault);
-    set_intr_gate(X86_EXC_MF,  coprocessor_error);
-    set_intr_gate(X86_EXC_AC,  alignment_check);
-    set_intr_gate(X86_EXC_MC,  machine_check);
-    set_intr_gate(X86_EXC_XM,  simd_coprocessor_error);
-    set_intr_gate(X86_EXC_CP,  entry_CP);
+    set_intr_gate (X86_EXC_DE,  entry_DE);
+    set_intr_gate (X86_EXC_DB,  entry_DB);
+    set_intr_gate (X86_EXC_NMI, entry_NMI);
+    set_swint_gate(X86_EXC_BP,  entry_BP);
+    set_swint_gate(X86_EXC_OF,  entry_OF);
+    set_intr_gate (X86_EXC_BR,  entry_BR);
+    set_intr_gate (X86_EXC_UD,  entry_UD);
+    set_intr_gate (X86_EXC_NM,  entry_NM);
+    set_intr_gate (X86_EXC_DF,  entry_DF);
+    set_intr_gate (X86_EXC_TS,  entry_TS);
+    set_intr_gate (X86_EXC_NP,  entry_NP);
+    set_intr_gate (X86_EXC_SS,  entry_SS);
+    set_intr_gate (X86_EXC_GP,  entry_GP);
+    set_intr_gate (X86_EXC_PF,  early_page_fault);
+    set_intr_gate (X86_EXC_MF,  entry_MF);
+    set_intr_gate (X86_EXC_AC,  entry_AC);
+    set_intr_gate (X86_EXC_MC,  entry_MC);
+    set_intr_gate (X86_EXC_XM,  entry_XM);
+    set_intr_gate (X86_EXC_CP,  entry_CP);
 
     /* Specify dedicated interrupt stacks for NMI, #DF, and #MC. */
     enable_each_ist(idt_table);
@@ -2154,7 +2168,7 @@ void __init trap_init(void)
     unsigned int vector;
 
     /* Replace early pagefault with real pagefault handler. */
-    set_intr_gate(X86_EXC_PF, &page_fault);
+    set_intr_gate(X86_EXC_PF, entry_PF);
 
     pv_trap_init();
 
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index bca1500e2b45..81dd2c74b876 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -708,7 +708,7 @@ ENTRY(common_interrupt)
         mov   %bl, STACK_CPUINFO_FIELD(use_pv_cr3)(%r14)
         jmp ret_from_intr
 
-ENTRY(page_fault)
+ENTRY(entry_PF)
         ENDBR64
         movl  $X86_EXC_PF, 4(%rsp)
 /* No special register assumptions. */
@@ -881,81 +881,81 @@ FATAL_exception_with_ints_disabled:
         movq  %rsp,%rdi
         tailcall fatal_trap
 
-ENTRY(divide_error)
+ENTRY(entry_DE)
         ENDBR64
         pushq $0
         movl  $X86_EXC_DE, 4(%rsp)
         jmp   handle_exception
 
-ENTRY(coprocessor_error)
+ENTRY(entry_MF)
         ENDBR64
         pushq $0
         movl  $X86_EXC_MF, 4(%rsp)
         jmp   handle_exception
 
-ENTRY(simd_coprocessor_error)
+ENTRY(entry_XM)
         ENDBR64
         pushq $0
         movl  $X86_EXC_XM, 4(%rsp)
         jmp   handle_exception
 
-ENTRY(device_not_available)
+ENTRY(entry_NM)
         ENDBR64
         pushq $0
         movl  $X86_EXC_NM, 4(%rsp)
         jmp   handle_exception
 
-ENTRY(debug)
+ENTRY(entry_DB)
         ENDBR64
         pushq $0
         movl  $X86_EXC_DB, 4(%rsp)
         jmp   handle_ist_exception
 
-ENTRY(int3)
+ENTRY(entry_BP)
         ENDBR64
         pushq $0
         movl  $X86_EXC_BP, 4(%rsp)
         jmp   handle_exception
 
-ENTRY(overflow)
+ENTRY(entry_OF)
         ENDBR64
         pushq $0
         movl  $X86_EXC_OF, 4(%rsp)
         jmp   handle_exception
 
-ENTRY(bounds)
+ENTRY(entry_BR)
         ENDBR64
         pushq $0
         movl  $X86_EXC_BR, 4(%rsp)
         jmp   handle_exception
 
-ENTRY(invalid_op)
+ENTRY(entry_UD)
         ENDBR64
         pushq $0
         movl  $X86_EXC_UD, 4(%rsp)
         jmp   handle_exception
 
-ENTRY(invalid_TSS)
+ENTRY(entry_TS)
         ENDBR64
         movl  $X86_EXC_TS, 4(%rsp)
         jmp   handle_exception
 
-ENTRY(segment_not_present)
+ENTRY(entry_NP)
         ENDBR64
         movl  $X86_EXC_NP, 4(%rsp)
         jmp   handle_exception
 
-ENTRY(stack_segment)
+ENTRY(entry_SS)
         ENDBR64
         movl  $X86_EXC_SS, 4(%rsp)
         jmp   handle_exception
 
-ENTRY(general_protection)
+ENTRY(entry_GP)
         ENDBR64
         movl  $X86_EXC_GP, 4(%rsp)
         jmp   handle_exception
 
-ENTRY(alignment_check)
+ENTRY(entry_AC)
         ENDBR64
         movl  $X86_EXC_AC, 4(%rsp)
         jmp   handle_exception
@@ -965,7 +965,7 @@ ENTRY(entry_CP)
         movl  $X86_EXC_CP, 4(%rsp)
         jmp   handle_exception
 
-ENTRY(double_fault)
+ENTRY(entry_DF)
         ENDBR64
         movl  $X86_EXC_DF, 4(%rsp)
         /* Set AC to reduce chance of further SMAP faults */
@@ -989,7 +989,7 @@ ENTRY(double_fault)
         movq  %rsp,%rdi
         tailcall do_double_fault
 
-ENTRY(nmi)
+ENTRY(entry_NMI)
         ENDBR64
         pushq $0
         movl  $X86_EXC_NMI, 4(%rsp)
@@ -1117,7 +1117,7 @@ handle_ist_exception:
         jmp   restore_all_xen
 #endif
 
-ENTRY(machine_check)
+ENTRY(entry_MC)
         ENDBR64
         pushq $0
         movl  $X86_EXC_MC, 4(%rsp)
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 19:43:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 19:43:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571548.895681 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPTNK-0007GI-4l; Fri, 28 Jul 2023 19:43:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571548.895681; Fri, 28 Jul 2023 19:43:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPTNK-0007G9-1e; Fri, 28 Jul 2023 19:43:46 +0000
Received: by outflank-mailman (input) for mailman id 571548;
 Fri, 28 Jul 2023 19:43:44 +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
 <SRS0=7hHC=DO=citrix.com=prvs=56653927b=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qPTNI-0006TZ-Cl
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 19:43:44 +0000
Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com
 [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0dc94b98-2d7f-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 21:43:42 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0dc94b98-2d7f-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690573422;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=0+2lTwwT3HcKALQtma3kCln3dcC2BQCBedr5bOWhoy0=;
  b=Qp85OzMB8/PzKT5ZnBaOmH352n6MF8EKSpjJNxYMQRokFUnymhHwk0J2
   umvRiPAeekGrEfV1DZ/k+8eqZUG2o+QV35fkKGQvf12l2yfVFFFF/X6WB
   Mb0g0iNW90ZYnMZ9UNWX8kbYzSRPDFQzeMyTPIpp08p+Jl+5r6YAc2VM+
   g=;
Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 120449230
X-Ironport-Server: esa4.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:s5516agEfkzsM1wTmoZzsMNaX161WxAKZh0ujC45NGQN5FlHY01je
 htvCD+OOPrcMWqmf4txbYW2p00EvZWBz9AyHVA5+H1nECsb9cadCdqndUqhZCn6wu8v7q5Ex
 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv
 cKai8DEMRqu1iUc3lg8sspvkzsx+qyr0N8klgZmP6sT4wWOzyN94K83fsldEVOpGuG4IcbiL
 wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ
 OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+
 tQ0bw5cUg7cwNiN0eu2Q/hKovsYBtD0adZ3VnFIl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ln5VzOF3hISOgk/vIsKwC
 z+ignk4afmlPm+xnbnpgjuxqUTosLl1txAQOqTjcQPQw+c7DqAVcBaQrifuzJwmsGDgWxa6O
 XkklMbJsFu7HGURG2vvhf3/AHl3F8VmgTf4G7du2Lnvcv6AA03ENBAg4UxSGqi13Yd
X-Talos-CUID: 9a23:FcDg9mFYGACROWeBqmJLs3BFJt56NUfm3S7dKl6eLVlSYqSKHAo=
X-Talos-MUID: 9a23:aKC4AQiKat/hYVMdvL+E38MpH99yuaCEEWY2kZgWgMWjaRB+MjTDtWHi
X-IronPort-AV: E=Sophos;i="6.01,238,1684814400"; 
   d="scan'208";a="120449230"
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
	<JBeulich@suse.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>, Roberto Bagnara
	<roberto.bagnara@bugseng.com>, Nicola Vetrini <nicola.vetrini@bugseng.com>
Subject: [PATCH 3/3] x86: Delete str()
Date: Fri, 28 Jul 2023 20:43:20 +0100
Message-ID: <20230728194320.3082120-4-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20230728194320.3082120-1-andrew.cooper3@citrix.com>
References: <20230728194320.3082120-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

This is used in an assertion only, which is somewhat dubious to begin with and
won't surivive the x86-S work (where TR will become be a NUL selector).

Delete it now.  This avoids many cases where as a global symbol, it shadows
local string variables.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Roberto Bagnara <roberto.bagnara@bugseng.com>
CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/x86/hvm/svm/svm.c      | 2 --
 xen/arch/x86/include/asm/desc.h | 9 ---------
 2 files changed, 11 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 56cb2f61bb75..4d29ad3bc36a 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1614,8 +1614,6 @@ static int _svm_cpu_up(bool bsp)
     /* Initialize OSVW bits to be used by guests */
     svm_host_osvw_init();
 
-    /* Minimal checking that enough CPU setup was done by now. */
-    ASSERT(str() == TSS_SELECTOR);
     svm_vmsave_pa(per_cpu(host_vmcb, cpu));
 
     return 0;
diff --git a/xen/arch/x86/include/asm/desc.h b/xen/arch/x86/include/asm/desc.h
index 225a864c483e..a1e0807d97ed 100644
--- a/xen/arch/x86/include/asm/desc.h
+++ b/xen/arch/x86/include/asm/desc.h
@@ -238,15 +238,6 @@ static inline void ltr(unsigned int sel)
     __asm__ __volatile__ ( "ltr %w0" :: "rm" (sel) : "memory" );
 }
 
-static inline unsigned int str(void)
-{
-    unsigned int sel;
-
-    __asm__ ( "str %0" : "=r" (sel) );
-
-    return sel;
-}
-
 #endif /* !__ASSEMBLY__ */
 
 #endif /* __ARCH_DESC_H */
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 20:01:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 20:01:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571555.895691 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPTeB-0002L0-Ja; Fri, 28 Jul 2023 20:01:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571555.895691; Fri, 28 Jul 2023 20:01:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPTeB-0002Kt-Fh; Fri, 28 Jul 2023 20:01:11 +0000
Received: by outflank-mailman (input) for mailman id 571555;
 Fri, 28 Jul 2023 20:01:10 +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 <SRS0=Q8mr=DO=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qPTe9-0002Kn-V6
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 20:01:09 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7c88a9f4-2d81-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 22:01:05 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-4fbb281eec6so4315502e87.1
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 13:01:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7c88a9f4-2d81-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690574465; x=1691179265;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=tb+rhFtTeLpWvf8HEvBKSOaO11rK+YCXEiFP+5yw8fY=;
        b=UTNkohqKIdxdeWWjwMgIqL01pI/sJzUr3NIf+9RmeFmSKPV0mHoJnxSLMxB4xfurmt
         LyIbH6t/ozmJnVEfYopgOREWqf7IbpoOvX1qnRmtM+r6oSwYeHhX+Rhg+E6P+XZIRPRV
         9/Q0wC8NmdWb5lldNNM6kZIMh1/k6ATVwarbU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690574465; x=1691179265;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=tb+rhFtTeLpWvf8HEvBKSOaO11rK+YCXEiFP+5yw8fY=;
        b=lDHAuQUJwR7X5Tr0BOwMz2Ue6SrvfOU5fcykyzda2/skf50zKRw1e4k1JhGmAVVQ8H
         Lo6UI07wtaLfOVirhcXDcIF/X8P2MzuWpAEF+GzcgWPNYpV+cyNMy3oGNl/AGDC9YV1m
         CGpMvPYKITUaghIVEy9XuhSofraCBBk4zRG8sHtXSb+7YPRW8yMeK6MSgdHcUTi3l5bE
         KfNVWZxuTbWc22s/N7Q9dI8CoF3lKHpRc9jywDRNZRTP7NMs5SbJbcegIIYs3dqE6vyp
         Xa0acfwiw3oxA7JHPuKVWThh/WNVZeNTCmjSwVwOzOg5Lv88JZ6IeBQKNNCA61jZEJ3G
         YFfQ==
X-Gm-Message-State: ABy/qLaMf/XgPZQL8ypq2xu8oKTNG/n+77IlBnnSpEdl3JEdcFmd7er0
	PvobJRZAQLfqlO0qN7+jptMlyDK8yBbnDtoaD8hZuw==
X-Google-Smtp-Source: APBJJlH3A23Koaokb/+28imStinCtcJJQGS0+r19jaDn3IDUwl5xKYIXQTasFJ/sWewQecq9EOAbVAjxUt7NVqgTgcw=
X-Received: by 2002:a05:6512:210c:b0:4fb:89ad:6651 with SMTP id
 q12-20020a056512210c00b004fb89ad6651mr2368141lfr.28.1690574465297; Fri, 28
 Jul 2023 13:01:05 -0700 (PDT)
MIME-Version: 1.0
References: <20230601142742.15489-1-olaf@aepfle.de> <20230601142742.15489-3-olaf@aepfle.de>
 <CA+zSX=bZ5zo9cxWTq9s9QOUGZ-9NMEugewR90z1w8C++sruSVw@mail.gmail.com> <20230728195210.66faf194.olaf@aepfle.de>
In-Reply-To: <20230728195210.66faf194.olaf@aepfle.de>
From: George Dunlap <george.dunlap@cloud.com>
Date: Fri, 28 Jul 2023 21:00:54 +0100
Message-ID: <CA+zSX=Yz7yJRCDm6yyOzFbhuSbkt0h9fZCiLbS9r6KjAh3g-ZQ@mail.gmail.com>
Subject: Re: [PATCH v1 2/7] xentrace: use correct output format for pit and rtc
To: Olaf Hering <olaf@aepfle.de>
Cc: xen-devel@lists.xenproject.org, George Dunlap <george.dunlap@citrix.com>, 
	Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Content-Type: multipart/alternative; boundary="0000000000007886db0601918a93"

--0000000000007886db0601918a93
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, Jul 28, 2023 at 6:52=E2=80=AFPM Olaf Hering <olaf@aepfle.de> wrote:

> Fri, 28 Jul 2023 17:47:11 +0100 George Dunlap <george.dunlap@cloud.com>:
>
> > Just a couple of notes on the whole series.  First, you didn't CC me on
> 0/7
> > or 1/7.  Secondly, patch 7 seems to be corrupted (see e.g., Patchew's
> > attempt to apply the series [1]).
>
> The cover letter can not be easily fixed, this is a bug in git send-email=
.
> It should be able to collect all recipients and put them in the cover
> letter.
> I think I already pointed that out a while ago on git-devel...
>
> I think #1 can be fixed by adjusting the MAINTAINERS file.
> Not sure why #7 fails to apply.
>

Running `git am --show-current-patch` reveals a tail that looks like this:

```
+    [EXIT_REASON_NOTIFY]=3D3D"NOTIFY",
 };
=3D20
```

This may again be a known issue with `git am` and base64-encoded files: I
think `mailsplit` knows how to deal with these sorts of line breaks; and
`git am` also knows how to decode base64; but it does them in the wrong
order, so base64-encoded mails don't get handled properly.  I reported it
to them several years ago [1], and nothing happened.

 -George

[1]
https://lore.kernel.org/git/c44c3958-b0eb-22bd-bc35-04982706162f@citrix.com=
/

--0000000000007886db0601918a93
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jul 28, 2023 at 6:52=E2=80=AF=
PM Olaf Hering &lt;<a href=3D"mailto:olaf@aepfle.de" target=3D"_blank">olaf=
@aepfle.de</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">Fri, 28 Jul 2023 17:47:11 +0100 George Dunlap &lt;<a href=3D"mai=
lto:george.dunlap@cloud.com" target=3D"_blank">george.dunlap@cloud.com</a>&=
gt;:<br>
<br>
&gt; Just a couple of notes on the whole series.=C2=A0 First, you didn&#39;=
t CC me on 0/7<br>
&gt; or 1/7.=C2=A0 Secondly, patch 7 seems to be corrupted (see e.g., Patch=
ew&#39;s<br>
&gt; attempt to apply the series [1]).<br>
<br>
The cover letter can not be easily fixed, this is a bug in git send-email.<=
br>
It should be able to collect all recipients and put them in the cover lette=
r.<br>
I think I already pointed that out a while ago on git-devel...<br>
<br>
I think #1 can be fixed by adjusting the MAINTAINERS file.<br>
Not sure why #7 fails to apply.<br></blockquote><div><br></div><div>Running=
=C2=A0`git am --show-current-patch` reveals a tail that looks like this:</d=
iv><div><br></div><div>```</div><div>+ =C2=A0 =C2=A0[EXIT_REASON_NOTIFY]=3D=
3D&quot;NOTIFY&quot;,<br>=C2=A0};<br>=3D20<br></div><div>```</div><div><br>=
</div><div>This may again be a known issue with `git am` and base64-encoded=
 files: I think `mailsplit` knows how to deal with these sorts of line brea=
ks; and `git am` also knows how to decode base64; but it does them in the w=
rong order, so base64-encoded mails don&#39;t get handled properly.=C2=A0 I=
 reported it to them several years ago [1], and nothing happened.</div><div=
><br></div><div>=C2=A0-George</div><div><br></div><div>[1]=C2=A0<a href=3D"=
https://lore.kernel.org/git/c44c3958-b0eb-22bd-bc35-04982706162f@citrix.com=
/">https://lore.kernel.org/git/c44c3958-b0eb-22bd-bc35-04982706162f@citrix.=
com/</a></div><div>=C2=A0</div></div></div>

--0000000000007886db0601918a93--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 20:07:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 20:07:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571557.895700 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPTk2-0002x6-73; Fri, 28 Jul 2023 20:07:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571557.895700; Fri, 28 Jul 2023 20:07:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPTk2-0002wx-3j; Fri, 28 Jul 2023 20:07:14 +0000
Received: by outflank-mailman (input) for mailman id 571557;
 Fri, 28 Jul 2023 20:07:12 +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 <SRS0=0rLm=DO=gmail.com=dunlapg@srs-se1.protection.inumbo.net>)
 id 1qPTk0-0002wr-Me
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 20:07:12 +0000
Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com
 [2a00:1450:4864:20::332])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5579f8b1-2d82-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 22:07:10 +0200 (CEST)
Received: by mail-wm1-x332.google.com with SMTP id
 5b1f17b1804b1-3fbab0d0b88so25713155e9.0
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 13:07:09 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5579f8b1-2d82-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=umich.edu; s=google-2016-06-03; t=1690574829; x=1691179629;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=c8kBW59IIrbLMgwPiVreMk5VUmZXeMXnwXr5avrfQTw=;
        b=IiWNBkM6vEFPcPhh73VtL6nRJlL5auk4PsNvgGu5N0q8LxIVNno3Ga8RGF3GbB1nvw
         Zduu8ob/gg0lVtTeqocZqxwF+7pAPsSQ8NM1zUTkJJ7T06FrhPJwV7cCpymVav0iHo41
         CfIoE6U1TIOwFty0o5+VIywXCI+TFR9pySfGwqn9EY77s6DCkEWvvY54ZIsSTPq3S9Wl
         fPEJI8rCcAh9cXqFfQ8xT8f3CwSytxjqUxsF1RRpGZaaQITouJppXWyy/gzbfHAozlHJ
         QouaoTKl+z1Jky0MDJTFMSSSvBJEk2iYTB1HGKJyqkpD4IINjT5sChGVb7k10oAoEsyk
         52sw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690574829; x=1691179629;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=c8kBW59IIrbLMgwPiVreMk5VUmZXeMXnwXr5avrfQTw=;
        b=ON860sqnlnn4Ez9sHP7kKDpa80lLUONFtlaJnwqyavjDiLQD4MhTO3oOv4uov6e3m9
         4kIOI3UvywlaBYoc8GoNaQxJrZnu2/vPciat9P4jy+w4GB7tsvuLZS5Rtm2deo/0ZBTk
         DPyccnpXEVL0nQ964pDyr//ulZzZxTKpupDx0SwjB0wU91uWj7LMoCdRGU3/OJ3iSi7q
         bzShq007OUZhFiwetF7Er/eenBNJXwDk/lbEv5dgbkmn8AOY3Iy5RMYPPwpWWUw3es8C
         m4NkmExppWdC4P2BThjs5bGtbqtkLTXRshCikSqd4MKLbPiy065f84Nx552zKpwsPbuV
         IP/w==
X-Gm-Message-State: ABy/qLbA6XrHh4Z/snCwMVm19br4nw6HvlgvifncjsdhLY8JXWsAdpBh
	HPK0eteAzfhFfABPob1+p4Hq4RRR0UrrFXqKzqA7wtdv
X-Google-Smtp-Source: APBJJlGbfEczlGplmMMyeNCLUD3nRqClyRJhc6Wg83RLs/1zxkNtijHO2vt3XTG5NvOC0DHLHj+W+FwjWwfZ7GEa4aM=
X-Received: by 2002:a5d:4cc3:0:b0:317:52ba:81f2 with SMTP id
 c3-20020a5d4cc3000000b0031752ba81f2mr4681717wrt.16.1690574829219; Fri, 28 Jul
 2023 13:07:09 -0700 (PDT)
MIME-Version: 1.0
References: <20230601142742.15489-1-olaf@aepfle.de> <20230601142742.15489-2-olaf@aepfle.de>
In-Reply-To: <20230601142742.15489-2-olaf@aepfle.de>
From: George Dunlap <dunlapg@umich.edu>
Date: Fri, 28 Jul 2023 21:06:58 +0100
Message-ID: <CAFLBxZZJzLNNGVtGYjB+aYuwtSc+ucOzTk7eAn1z-TpxMsJ2Vg@mail.gmail.com>
Subject: Re: [PATCH v1 1/7] xentrace: remove unimplemented option from man page
To: Olaf Hering <olaf@aepfle.de>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>, 
	Anthony PERARD <anthony.perard@citrix.com>
Content-Type: multipart/alternative; boundary="00000000000029741a060191a008"

--00000000000029741a060191a008
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jun 1, 2023 at 3:28=E2=80=AFPM Olaf Hering <olaf@aepfle.de> wrote:

> The documented option --usage worked because every unknown option
> showed the help.
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
>

Reviewed-by: George Dunlap <george.dunlap@cloud.com>

--00000000000029741a060191a008
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jun 1, 2023 at 3:28=E2=80=AFP=
M Olaf Hering &lt;<a href=3D"mailto:olaf@aepfle.de">olaf@aepfle.de</a>&gt; =
wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The docum=
ented option --usage worked because every unknown option<br>
showed the help.<br>
<br>
Signed-off-by: Olaf Hering &lt;<a href=3D"mailto:olaf@aepfle.de" target=3D"=
_blank">olaf@aepfle.de</a>&gt;<br></blockquote><div><br></div><div>Reviewed=
-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@cloud.com">george.du=
nlap@cloud.com</a>&gt;</div><div>=C2=A0</div></div></div>

--00000000000029741a060191a008--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 20:11:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 20:11:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571560.895711 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPToF-0004Rd-Pi; Fri, 28 Jul 2023 20:11:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571560.895711; Fri, 28 Jul 2023 20:11:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPToF-0004RW-MU; Fri, 28 Jul 2023 20:11:35 +0000
Received: by outflank-mailman (input) for mailman id 571560;
 Fri, 28 Jul 2023 20:11:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPToE-0004RM-UW; Fri, 28 Jul 2023 20:11:34 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPToE-0008Vr-Si; Fri, 28 Jul 2023 20:11:34 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPToE-0004x6-FT; Fri, 28 Jul 2023 20:11:34 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qPToE-0003us-F6; Fri, 28 Jul 2023 20:11:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=1ASLqAr1JS4edEGkkj7C7JWSSckAfQLzmyDuQIEc2Lk=; b=DDAyEZKb43EVDWRemCIAT5jUT9
	iteODrv0g+27yIBZmU3q1bReNLAoNsj7QrKVRn23JqUCTKzuuNxAEHVQLOMX8+srbzYU4+2LTmxcu
	agBxzpydt+ZMVIZxEV2n/b5Wtcx9cP3OIcVMqHpXIKp22F/1wbCFzZb3Xbfe+HanE/XU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182045-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 182045: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-rtds:guest-localmigrate/x10:fail:allowable
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=0a8db05b571ad5b8d5c8774a004c0424260a90bd
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 28 Jul 2023 20:11:34 +0000

flight 182045 linux-linus real [real]
flight 182061 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/182045/
http://logs.test-lab.xenproject.org/osstest/logs/182061/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-pvhv2-intel 20 guest-localmigrate/x10 fail pass in 182061-retest

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds     20 guest-localmigrate/x10   fail REGR. vs. 180278

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt   16 saverestore-support-check fail blocked in 180278
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check fail blocked in 180278
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail blocked in 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                0a8db05b571ad5b8d5c8774a004c0424260a90bd
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z  103 days
Failing since        180281  2023-04-17 06:24:36 Z  102 days  191 attempts
Testing same since   182045  2023-07-27 13:27:00 Z    1 days    1 attempts

------------------------------------------------------------
3825 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 642583 lines long.)


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 20:17:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 20:17:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571565.895721 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPTuC-0005Af-JN; Fri, 28 Jul 2023 20:17:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571565.895721; Fri, 28 Jul 2023 20:17:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPTuC-0005AY-GA; Fri, 28 Jul 2023 20:17:44 +0000
Received: by outflank-mailman (input) for mailman id 571565;
 Fri, 28 Jul 2023 20:17:43 +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 <SRS0=Q8mr=DO=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qPTuB-0005AS-6I
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 20:17:43 +0000
Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com
 [2a00:1450:4864:20::22a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cd9e8538-2d83-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 22:17:41 +0200 (CEST)
Received: by mail-lj1-x22a.google.com with SMTP id
 38308e7fff4ca-2b933bbd3eeso38955721fa.1
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 13:17:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cd9e8538-2d83-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690575460; x=1691180260;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=U3QWLF2AUSklfD2C+7y6eRcnqsAug7EPzzxUNoEFpqI=;
        b=PhW1kJG7lLu+vPkjk1yflCppCWJWK+PGIVdbaCT4ZmrJayi2CMLk0wZejdr5JnprlT
         S2ah0LTrqZDJM5r75gcZvhUCwlIONc8Kw4zBQOKBfTTWNE0z3U640m20M3OILPsQf6ND
         YiSlgD+G1UKFxsNji8/L167b7K3nXymsXLYX8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690575460; x=1691180260;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=U3QWLF2AUSklfD2C+7y6eRcnqsAug7EPzzxUNoEFpqI=;
        b=Pf3SOyRcOIm93qrkJ5VXU0DlPBfp9gafOnY9zzG4F2W2tLJr0BHkQ5WutfbE+gxwkH
         pmZqyBPZBlObt1Jn4IyuAZjnVFgcqAv8DWVn4TWHz/UiTffXU+pZFrPx1O8JZlw0XxO+
         Tfd5FDU2idsPbvKEzHCUWArYYs/0UYjt2+kMHxfjWqF6Nur3WhwaakD+kVl9hZl0d0qr
         v7QnM0ejc8d5+E3VyzkPeUkI9dBrNuVyQt6Pf54vDxK9tFgjE/NeGMNF74/0IgOBEW7o
         S9fFZotMfkVKLhczbUqL/ElzhvweohQ2t0y6SP0T69/vyaHIh7iMYWPGreZNPfUv49l/
         +YNQ==
X-Gm-Message-State: ABy/qLYLpS4NZhmZGagF5539RjY9Z2wFId8fIJxjmLg900ZuLN/2VHJa
	NCOuijyL2E6OK/jpaOw+/zpAsCrwqamGjwEN5BEk5Q==
X-Google-Smtp-Source: APBJJlFBIf2oHPb9V31JFysbR8cveQUnRh7o6x4lzpcqtFY0fMNndd2F8uyACsmFRUr0JPTv9/bk6JO3cRFvZrJnQtw=
X-Received: by 2002:a2e:9044:0:b0:2b9:575e:5298 with SMTP id
 n4-20020a2e9044000000b002b9575e5298mr3032786ljg.13.1690575460397; Fri, 28 Jul
 2023 13:17:40 -0700 (PDT)
MIME-Version: 1.0
References: <20230601142742.15489-1-olaf@aepfle.de> <20230601142742.15489-3-olaf@aepfle.de>
In-Reply-To: <20230601142742.15489-3-olaf@aepfle.de>
From: George Dunlap <george.dunlap@cloud.com>
Date: Fri, 28 Jul 2023 21:17:29 +0100
Message-ID: <CA+zSX=b2ArcQ2RxAKF=auhQ2=nMHOYn4Rtsw50cFe9Jv13Q=RQ@mail.gmail.com>
Subject: Re: [PATCH v1 2/7] xentrace: use correct output format for pit and rtc
To: Olaf Hering <olaf@aepfle.de>
Cc: xen-devel@lists.xenproject.org, George Dunlap <george.dunlap@citrix.com>, 
	Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Content-Type: multipart/alternative; boundary="000000000000c884da060191c51d"

--000000000000c884da060191c51d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jun 1, 2023 at 3:28=E2=80=AFPM Olaf Hering <olaf@aepfle.de> wrote:

> The input values were always 32bit.
>
> Fixes 55ee5dea32 ("xentrace: add TRC_HVM_EMUL")
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> ---
>  tools/xentrace/formats | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/xentrace/formats b/tools/xentrace/formats
> index 0fcc327a40..afb5ee0112 100644
> --- a/tools/xentrace/formats
> +++ b/tools/xentrace/formats
> @@ -211,8 +211,8 @@
>  0x00802008  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  do_irq [ irq =3D %(1)d,
> began =3D %(2)dus, ended =3D %(3)dus ]
>
>  0x00084001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  hpet create [ tn =3D %(1=
)d,
> irq =3D %(2)d, delta =3D 0x%(4)08x%(3)08x, period =3D 0x%(6)08x%(5)08x ]
> -0x00084002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  pit create [ delta =3D
> 0x%(1)016x, period =3D 0x%(2)016x ]
> -0x00084003  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  rtc create [ delta =3D
> 0x%(1)016x , period =3D 0x%(2)016x ]
> +0x00084002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  pit create [ delta =3D
> 0x%(1)08x, period =3D 0x%(2)08x ]
> +0x00084003  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  rtc create [ delta =3D
> 0x%(1)08x, period =3D 0x%(2)08x ]
>

Looks good.  While we're here, any reason not to s/create/start/; to match
up with the trace definition?

Either way:

Reviewed-by: George Dunlap <george.dunlap@cloud.com>

--000000000000c884da060191c51d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jun 1, 2023 at 3:28=E2=80=AFP=
M Olaf Hering &lt;<a href=3D"mailto:olaf@aepfle.de">olaf@aepfle.de</a>&gt; =
wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The input=
 values were always 32bit.<br>
<br>
Fixes 55ee5dea32 (&quot;xentrace: add TRC_HVM_EMUL&quot;)<br>
<br>
Signed-off-by: Olaf Hering &lt;<a href=3D"mailto:olaf@aepfle.de" target=3D"=
_blank">olaf@aepfle.de</a>&gt;<br>
---<br>
=C2=A0tools/xentrace/formats | 4 ++--<br>
=C2=A01 file changed, 2 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/tools/xentrace/formats b/tools/xentrace/formats<br>
index 0fcc327a40..afb5ee0112 100644<br>
--- a/tools/xentrace/formats<br>
+++ b/tools/xentrace/formats<br>
@@ -211,8 +211,8 @@<br>
=C2=A00x00802008=C2=A0 CPU%(cpu)d=C2=A0 %(tsc)d (+%(reltsc)8d)=C2=A0 do_irq=
 [ irq =3D %(1)d, began =3D %(2)dus, ended =3D %(3)dus ]<br>
<br>
=C2=A00x00084001=C2=A0 CPU%(cpu)d=C2=A0 %(tsc)d (+%(reltsc)8d)=C2=A0 hpet c=
reate [ tn =3D %(1)d, irq =3D %(2)d, delta =3D 0x%(4)08x%(3)08x, period =3D=
 0x%(6)08x%(5)08x ]<br>
-0x00084002=C2=A0 CPU%(cpu)d=C2=A0 %(tsc)d (+%(reltsc)8d)=C2=A0 pit create =
[ delta =3D 0x%(1)016x, period =3D 0x%(2)016x ]<br>
-0x00084003=C2=A0 CPU%(cpu)d=C2=A0 %(tsc)d (+%(reltsc)8d)=C2=A0 rtc create =
[ delta =3D 0x%(1)016x , period =3D 0x%(2)016x ]<br>
+0x00084002=C2=A0 CPU%(cpu)d=C2=A0 %(tsc)d (+%(reltsc)8d)=C2=A0 pit create =
[ delta =3D 0x%(1)08x, period =3D 0x%(2)08x ]<br>
+0x00084003=C2=A0 CPU%(cpu)d=C2=A0 %(tsc)d (+%(reltsc)8d)=C2=A0 rtc create =
[ delta =3D 0x%(1)08x, period =3D 0x%(2)08x ]<br></blockquote><div><br></di=
v><div>Looks good.=C2=A0 While we&#39;re here, any reason not to s/create/s=
tart/; to match up with the trace definition?</div><div><br></div><div>Eith=
er way:</div><div><br></div><div>Reviewed-by: George Dunlap &lt;<a href=3D"=
mailto:george.dunlap@cloud.com">george.dunlap@cloud.com</a>&gt;</div></div>=
</div>

--000000000000c884da060191c51d--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 20:22:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 20:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571567.895730 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPTyn-0006bH-3h; Fri, 28 Jul 2023 20:22:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571567.895730; Fri, 28 Jul 2023 20:22:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPTyn-0006bA-1E; Fri, 28 Jul 2023 20:22:29 +0000
Received: by outflank-mailman (input) for mailman id 571567;
 Fri, 28 Jul 2023 20:22:27 +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 <SRS0=Q8mr=DO=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qPTyl-0006b4-KV
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 20:22:27 +0000
Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com
 [2a00:1450:4864:20::229])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7726f676-2d84-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 22:22:25 +0200 (CEST)
Received: by mail-lj1-x229.google.com with SMTP id
 38308e7fff4ca-2b9bb097c1bso38648141fa.0
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 13:22:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7726f676-2d84-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690575745; x=1691180545;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=ohChoAcr8sjYWanMZ4eXeXwjFlk1LbuuQAkSOGNm7vA=;
        b=KpTT6vCHY6ugQdMFGv0kgSkb+G1lJ7OBYHfsdeoS0fNoItAD6E5XBcpXL1BO/3dCmt
         qvZBopoQaqMAylIwUPyZ76VoCijNSRT7Bgns02ch23gYzYx//g3cYS2YKuKYV5/GN/u/
         iN+cMjKGX95JTd5vVcIqb9j3QVCxe5pXrBSkY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690575745; x=1691180545;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=ohChoAcr8sjYWanMZ4eXeXwjFlk1LbuuQAkSOGNm7vA=;
        b=cIDgFgs5O6TBa3Lynm2WVy0xcbSjqXWlppd3sHQK8h83Dnee7gL3unvtj1r5W5hX5z
         Je5k1XiaE/DdKiiYZAV3+ce3kIPoJ/wd5o83om7Smxp40Oq1dPCBGiGQNf3ps/h6FOky
         BeOulQP9vZpF4BVgopxb8XuCL+a/SIe1b1/ByNQq7LppvLtqD+n0117AiUWN9iUDrpMT
         SnC8XUbg2cft1NBk5wZ0yqTJd7Vw3PQTEb3OQqn8fg1wIhMn5LDdpGKsy484R5F/rWk4
         5NcrgJQNK/zUHOZRxRFRZXWgPOmMYs4B4o8CKGNOEQur7QpB/esdl0RxeB4TiCXSvx4p
         BYrg==
X-Gm-Message-State: ABy/qLanp4ZokT+JUilVvGPe584ohNgQ5yt6Bo8w/BFuBWUTSWnB6Y/a
	WLjPV4hZQWi6kf0JbruGSN2odkYdgS35CAzd8+q2Gg==
X-Google-Smtp-Source: APBJJlE9HQUgPyeV8VjTMbiHOUs4aGNlvbO1anpzfJh6J+vjKbaEdbHwh91mbGMkPZEgEZl3uo7C7+F+B2ZIMSVitGY=
X-Received: by 2002:a2e:8912:0:b0:2b6:c16a:db06 with SMTP id
 d18-20020a2e8912000000b002b6c16adb06mr2792379lji.39.1690575744780; Fri, 28
 Jul 2023 13:22:24 -0700 (PDT)
MIME-Version: 1.0
References: <20230601142742.15489-1-olaf@aepfle.de> <20230601142742.15489-4-olaf@aepfle.de>
In-Reply-To: <20230601142742.15489-4-olaf@aepfle.de>
From: George Dunlap <george.dunlap@cloud.com>
Date: Fri, 28 Jul 2023 21:22:13 +0100
Message-ID: <CA+zSX=biggzVDhA5++3TEzdjuxvUmpD2T6wpnQFSY271zOTBVQ@mail.gmail.com>
Subject: Re: [PATCH v1 3/7] xenalyze: sync with vmx.h, use EXIT_REASON_PENDING_VIRT_INTR
To: Olaf Hering <olaf@aepfle.de>
Cc: xen-devel@lists.xenproject.org, George Dunlap <george.dunlap@citrix.com>, 
	Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Content-Type: multipart/alternative; boundary="000000000000bbe111060191d65d"

--000000000000bbe111060191d65d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jun 1, 2023 at 3:28=E2=80=AFPM Olaf Hering <olaf@aepfle.de> wrote:

> Signed-off-by: Olaf Hering <olaf@aepfle.de>
>

Reviewed-by: George Dunlap <george.dunlap@cloud.com>

One can't help wondering if it would be better to arrange somehow not to
have these definitions duplicated.

--000000000000bbe111060191d65d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jun 1, 2023 at 3:28=E2=80=AFP=
M Olaf Hering &lt;<a href=3D"mailto:olaf@aepfle.de">olaf@aepfle.de</a>&gt; =
wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Signed-of=
f-by: Olaf Hering &lt;<a href=3D"mailto:olaf@aepfle.de" target=3D"_blank">o=
laf@aepfle.de</a>&gt;<br></blockquote><div><br></div><div>Reviewed-by: Geor=
ge Dunlap &lt;<a href=3D"mailto:george.dunlap@cloud.com">george.dunlap@clou=
d.com</a>&gt;</div><div><br></div><div>One can&#39;t help wondering if it w=
ould be better to arrange somehow not to have these definitions duplicated.=
</div></div></div>

--000000000000bbe111060191d65d--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 20:25:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 20:25:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571569.895741 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPU1s-0007CM-Ik; Fri, 28 Jul 2023 20:25:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571569.895741; Fri, 28 Jul 2023 20:25:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPU1s-0007CF-FX; Fri, 28 Jul 2023 20:25:40 +0000
Received: by outflank-mailman (input) for mailman id 571569;
 Fri, 28 Jul 2023 20:25:39 +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 <SRS0=Q8mr=DO=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qPU1r-0007C9-DE
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 20:25:39 +0000
Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com
 [2a00:1450:4864:20::233])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e9aaeb9e-2d84-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 22:25:37 +0200 (CEST)
Received: by mail-lj1-x233.google.com with SMTP id
 38308e7fff4ca-2b9ba3d6157so37786031fa.3
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 13:25:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e9aaeb9e-2d84-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690575937; x=1691180737;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=sjcxNDU48TbSBGONzyRDPQKzT3nlElPmfCA1SEfUiuI=;
        b=Lx1+s+AJd+zR8IU5XW7Fx6m+kJnfbDEGB5V+mH7nJeo7Tf6+G+/5A0fEzf58T/xOFS
         2IqX6CzwnPWZnDlPDDCY+Yev+n9zz85bCgsmEuS58dVXgB/RP8EH5etWJLVHBkRDI7s5
         MfiOaY+sCUVVlhCdBxu2Jw1graMcmlpf20wak=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690575937; x=1691180737;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=sjcxNDU48TbSBGONzyRDPQKzT3nlElPmfCA1SEfUiuI=;
        b=duuhDyO3MKdxoJL6dDWxaLqSqWtCL2dU49QGMDYI9LabSbTeg/Pt6ZOIIHnFnukEVV
         k55OBhF5y33gtDcfin5934zu3qm4s/8Sz5jqYRcH8urtQ3RGo1UOZA9U6YJoPzUnCIXM
         Q5NtegwPxypD0Irv0idUMRDo3UPP+veXKsNDFKz1m0PUdKY0lKEU+YmSd2wldLE8zsip
         y2UG3sOb4N5MrqSOBCTtKQZXnjsAq1EsbgSDN4n4IKni/SkeJ9G8ZHULYAnPklFUklDy
         npKpO+ZTHSV+qymMrRyuc51t/wx8ksC9T527p1esNDBypM6IuoYI03sWcqJx2Y3l/KnG
         3Gzw==
X-Gm-Message-State: ABy/qLbew/aLi9EkZIOa3gizlLDSeFvhfEi7WNj2uLxbnvLCSuLrU0yk
	vxOctvM/tpIvN2SMkZwLeeqtgWN/Q3c+7u3qEaRZXA==
X-Google-Smtp-Source: APBJJlElmPJ1tiKKlu6UBKwBvyYvMPwMLZwQfGsKFG/2uusfdNVMcyWVhCWS93KbeO7Aq4oIZ7f2fLY1180lTvsL9E8=
X-Received: by 2002:a2e:9050:0:b0:2b1:ed29:7c47 with SMTP id
 n16-20020a2e9050000000b002b1ed297c47mr2653179ljg.8.1690575936953; Fri, 28 Jul
 2023 13:25:36 -0700 (PDT)
MIME-Version: 1.0
References: <20230601142742.15489-1-olaf@aepfle.de> <20230601142742.15489-7-olaf@aepfle.de>
In-Reply-To: <20230601142742.15489-7-olaf@aepfle.de>
From: George Dunlap <george.dunlap@cloud.com>
Date: Fri, 28 Jul 2023 21:25:26 +0100
Message-ID: <CA+zSX=ak5RdN7x7Q_NA7wvdAELkqUhrFpvJBidK+yi4omyKDdQ@mail.gmail.com>
Subject: Re: [PATCH v1 6/7] xenalyze: sync with vmx.h, use EXIT_REASON_MCE_DURING_VMENTRY
To: Olaf Hering <olaf@aepfle.de>
Cc: xen-devel@lists.xenproject.org, George Dunlap <george.dunlap@citrix.com>, 
	Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Content-Type: multipart/alternative; boundary="000000000000303465060191e2b3"

--000000000000303465060191e2b3
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jun 1, 2023 at 3:28=E2=80=AFPM Olaf Hering <olaf@aepfle.de> wrote:

> Signed-off-by: Olaf Hering <olaf@aepfle.de>
>

Patches 4-7:

Reviewed-by: George Dunlap <george.dunlap@cloud.com>

--000000000000303465060191e2b3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jun 1, 2023 at 3:28=E2=80=AFP=
M Olaf Hering &lt;<a href=3D"mailto:olaf@aepfle.de">olaf@aepfle.de</a>&gt; =
wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Signed-of=
f-by: Olaf Hering &lt;<a href=3D"mailto:olaf@aepfle.de" target=3D"_blank">o=
laf@aepfle.de</a>&gt;<br></blockquote><div><br></div><div>Patches 4-7:</div=
><div><br></div><div>Reviewed-by: George Dunlap &lt;<a href=3D"mailto:georg=
e.dunlap@cloud.com">george.dunlap@cloud.com</a>&gt;</div></div></div>

--000000000000303465060191e2b3--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 20:36:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 20:36:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571571.895750 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPUC3-0000JM-Gc; Fri, 28 Jul 2023 20:36:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571571.895750; Fri, 28 Jul 2023 20:36:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPUC3-0000JF-E0; Fri, 28 Jul 2023 20:36:11 +0000
Received: by outflank-mailman (input) for mailman id 571571;
 Fri, 28 Jul 2023 20:36:09 +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 <SRS0=Q8mr=DO=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qPUC1-0000J9-FM
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 20:36:09 +0000
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com
 [2a00:1450:4864:20::132])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 604d7465-2d86-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 22:36:06 +0200 (CEST)
Received: by mail-lf1-x132.google.com with SMTP id
 2adb3069b0e04-4fe1c285690so3097197e87.3
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 13:36:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 604d7465-2d86-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690576565; x=1691181365;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=R1CEhNBkkK7TxjpswD5hbvZQWlFVU5MVakie2pjKRyY=;
        b=TAImuOEUlWnRwo3L7rNBlhHu9n4UEQgbNYFnpXu6RhKh7XUApqub7/hY0FoT3ib4q4
         ja45KNdLjI4gvtpjL6wqzneln2gdPsufmjCQGhBQQ0SVRHb71bQyudSXpOWUdBtab2fT
         Fo2mWYrFRX6pt7FXRWFsdswtmLrrNs1T17Uck=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690576565; x=1691181365;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=R1CEhNBkkK7TxjpswD5hbvZQWlFVU5MVakie2pjKRyY=;
        b=OS8AZg39asCK1lH4hQFOV5Dxl/VwOvw2jSAgwLUeyJTtNuJOQjHOfGhzL26yCoGGxn
         7OGKUJJtD6eKSByb/1RL+yb9ovekDNrhWwdIFRnJVjzFAkfwVatycyh1+qWNQs+/3uKi
         KiRTUkzXArrBnd7LLP+2+YMmi0sEj2XFBIfMs20F0DlzFAxyNHTzlhR6HFG2NYAhjmqR
         cBi6eaUe39ioG0HBsIJLSeOasSh3PCkkC1ZkVHNyIkWuhDrY6CXWc/NSulaEAffhw7DC
         6d08dtWGvZbL/V99n+bW6apDjjMe316ux6Mr1I3qxswpunviomJBrPj2wIJj9BmOqs3e
         f5Yg==
X-Gm-Message-State: ABy/qLbTSkEXScjRmDd0fkOlhZyFgVdJGzxjY+gOa/Azue5oTKKqNoZA
	QgJ8Qjhcb2MyD+yZWjWh3GEyWehJ+j5FRiUqlSPcmAcVEAzrboo9aoQ=
X-Google-Smtp-Source: APBJJlHwsAWCuXUJiImE7SjyUMbHPDh3kTk8Lgo/6eDH5i2qfyqnDcHts5Y9cTMTPslEh4KlZm1XHprzseYzZqbNaNY=
X-Received: by 2002:a05:6512:52e:b0:4fb:8c52:611 with SMTP id
 o14-20020a056512052e00b004fb8c520611mr2633369lfc.38.1690576565386; Fri, 28
 Jul 2023 13:36:05 -0700 (PDT)
MIME-Version: 1.0
References: <20230601142742.15489-1-olaf@aepfle.de> <20230601142742.15489-8-olaf@aepfle.de>
In-Reply-To: <20230601142742.15489-8-olaf@aepfle.de>
From: George Dunlap <george.dunlap@cloud.com>
Date: Fri, 28 Jul 2023 21:35:54 +0100
Message-ID: <CA+zSX=ZW+-un+sUCEDA3RKd4vHzCvCjJxmqZPuXNf0UHFDq2BA@mail.gmail.com>
Subject: Re: [PATCH v1 7/7] xenalyze: handle more potential exit reason values
 from vmx.h
To: Olaf Hering <olaf@aepfle.de>
Cc: xen-devel@lists.xenproject.org, George Dunlap <george.dunlap@citrix.com>, 
	Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Content-Type: multipart/alternative; boundary="000000000000a5540806019207b3"

--000000000000a5540806019207b3
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jun 1, 2023 at 3:28=E2=80=AFPM Olaf Hering <olaf@aepfle.de> wrote:

> Copy and use more constants from vmx.h, to turn numbers into strings.
> Adjust the REASON_MAX value accordingly.
> Remove the size constraint from string array, the compiler will grow it
> as needed.
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
>

Thanks for doing this.

Everything looks good (including adding the missing strings), except for
the removal of the fixed array size.  Call me paranoid, but if we define it
as REASON_MAX length, then there will never be any way that a value less
than REASON_MAX causes a segfault (and if we assign a value higher than
REASON_MAX, the compiler will complain); whereas if we make it variable, we
leave open the possibility that someone won't update REASON_MAX properly,
resulting in either segfaults (if REASON_MAX is too high) or missing
strings (if REASON_MAX is too low).

 -George

--000000000000a5540806019207b3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jun 1, 2023 at 3:28=E2=80=AFP=
M Olaf Hering &lt;<a href=3D"mailto:olaf@aepfle.de">olaf@aepfle.de</a>&gt; =
wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Copy and =
use more constants from vmx.h, to turn numbers into strings.<br>
Adjust the REASON_MAX value accordingly.<br>
Remove the size constraint from string array, the compiler will grow it<br>
as needed.<br>
<br>
Signed-off-by: Olaf Hering &lt;<a href=3D"mailto:olaf@aepfle.de" target=3D"=
_blank">olaf@aepfle.de</a>&gt;<br></blockquote><div><br></div><div>Thanks=
=C2=A0for doing=C2=A0this.</div><div><br></div><div>Everything looks good (=
including adding the missing strings), except for the removal of the fixed =
array size.=C2=A0 Call me paranoid, but if we define it as REASON_MAX lengt=
h, then there will never be any way that a value less than REASON_MAX cause=
s a segfault (and if we assign a value higher than REASON_MAX, the compiler=
 will complain); whereas if we make it variable, we leave open the possibil=
ity that someone won&#39;t update REASON_MAX properly, resulting in either =
segfaults (if REASON_MAX is too high) or missing strings (if REASON_MAX is =
too low).</div><div><br></div><div>=C2=A0-George</div><div>=C2=A0</div></di=
v></div>

--000000000000a5540806019207b3--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 20:40:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 20:40:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571573.895760 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPUG5-0001mm-09; Fri, 28 Jul 2023 20:40:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571573.895760; Fri, 28 Jul 2023 20:40:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPUG4-0001mf-Tv; Fri, 28 Jul 2023 20:40:20 +0000
Received: by outflank-mailman (input) for mailman id 571573;
 Fri, 28 Jul 2023 20:40:19 +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 <SRS0=Q8mr=DO=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qPUG3-0001mZ-Mx
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 20:40:19 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f59b1373-2d86-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 22:40:16 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-4fe07f0636bso4407359e87.1
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 13:40:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f59b1373-2d86-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690576816; x=1691181616;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=pCGCTqjvNfijuEdCDapoDKUJntymKMHLXX3/sqNqZps=;
        b=NL0UfX1+Dtcxp+L9/tsTqrf5MeiZUFGZSPqGNDLus2xv7CrS8GJr+D77woY9tsgrPe
         4hkWWY82Ogxl8ALgmyqZ70r0J8YGv9gE0EN6nqZy4HtXpqhXM11feBtJhwy6E8Pgphj3
         KxzyQPbHcPyen7WDqhhfyOI+L0asxVEWS+Sng=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690576816; x=1691181616;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=pCGCTqjvNfijuEdCDapoDKUJntymKMHLXX3/sqNqZps=;
        b=AjCbZaeK6/STUOT/GIU542anpXuveIIV8Bj8T0qTjGlY7AAiyNk4gpTNjbSqt/dFfN
         HMo0+fuc+3RyLID7pHt1LrEWCR6CMi70NPD2bKF8C2T7CwIFD1coA88l0ZPGap02c6/T
         Hp/WJXD64gW6iA+Yf5PNrMrvFTIwcV4O+Kh08DkX1saaHD6/icHq83zMNVisC7WyR6/N
         Qsl33leG8bXxNd9csQ0JL3X1S1rdp2cO700tGrrD4tRdymcAkV3xhj8signoPKM2D0IK
         sLzJNtDpBnXZ1jg1mA6dDebQ7BO9M9zDrl12iTP95MiPHyNACBJdPRUl0F4cul4Yj7kQ
         7w2w==
X-Gm-Message-State: ABy/qLZx2I426waKXYtIUXrzSMSjij2jv/cgZksGfGtRwrlkDac67UVD
	WyVSA1Hko8s1zL1ra2OIhqr+3qZypSyBvPsgLN/dTA==
X-Google-Smtp-Source: APBJJlEAXzj8rTp/9CYQeFhJJLoPjA1NztAipwcD+XPg2iCN1rCPJmN1aZ2v00YuWRg45+EzmXFK+0hN4sastbP8Q4s=
X-Received: by 2002:a19:4f5c:0:b0:4fe:c6c:ac95 with SMTP id
 a28-20020a194f5c000000b004fe0c6cac95mr2214716lfk.35.1690576816095; Fri, 28
 Jul 2023 13:40:16 -0700 (PDT)
MIME-Version: 1.0
References: <20230601142742.15489-1-olaf@aepfle.de> <20230601142742.15489-7-olaf@aepfle.de>
 <CA+zSX=ak5RdN7x7Q_NA7wvdAELkqUhrFpvJBidK+yi4omyKDdQ@mail.gmail.com>
In-Reply-To: <CA+zSX=ak5RdN7x7Q_NA7wvdAELkqUhrFpvJBidK+yi4omyKDdQ@mail.gmail.com>
From: George Dunlap <george.dunlap@cloud.com>
Date: Fri, 28 Jul 2023 21:40:05 +0100
Message-ID: <CA+zSX=aPCk3MUWA_hm-hpRH7QV+7KxLx0LPTitJJjY0TE0QCXg@mail.gmail.com>
Subject: Re: [PATCH v1 6/7] xenalyze: sync with vmx.h, use EXIT_REASON_MCE_DURING_VMENTRY
To: Olaf Hering <olaf@aepfle.de>
Cc: xen-devel@lists.xenproject.org, George Dunlap <george.dunlap@citrix.com>, 
	Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Content-Type: multipart/alternative; boundary="00000000000096e0d20601921695"

--00000000000096e0d20601921695
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, Jul 28, 2023 at 9:25=E2=80=AFPM George Dunlap <george.dunlap@cloud.=
com>
wrote:

>
>
> On Thu, Jun 1, 2023 at 3:28=E2=80=AFPM Olaf Hering <olaf@aepfle.de> wrote=
:
>
>> Signed-off-by: Olaf Hering <olaf@aepfle.de>
>>
>
> Patches 4-7:
>
> Reviewed-by: George Dunlap <george.dunlap@cloud.com>
>

Sorry, this should have said patches 4-6.

At any rate, I've pushed patches 1-6 now.  Thanks again for the cleanup.

  -George

--00000000000096e0d20601921695
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jul 28, 2023 at 9:25=E2=80=AF=
PM George Dunlap &lt;<a href=3D"mailto:george.dunlap@cloud.com">george.dunl=
ap@cloud.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddin=
g-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"g=
mail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jun 1, 2023 at 3:=
28=E2=80=AFPM Olaf Hering &lt;<a href=3D"mailto:olaf@aepfle.de" target=3D"_=
blank">olaf@aepfle.de</a>&gt; wrote:<br></div><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20=
4);padding-left:1ex">Signed-off-by: Olaf Hering &lt;<a href=3D"mailto:olaf@=
aepfle.de" target=3D"_blank">olaf@aepfle.de</a>&gt;<br></blockquote><div><b=
r></div><div>Patches 4-7:</div><div><br></div><div>Reviewed-by: George Dunl=
ap &lt;<a href=3D"mailto:george.dunlap@cloud.com" target=3D"_blank">george.=
dunlap@cloud.com</a>&gt;</div></div></div></blockquote><div><br></div><div>=
Sorry, this should have said patches 4-6.</div><div><br></div><div>At any r=
ate, I&#39;ve pushed patches 1-6 now.=C2=A0 Thanks again for the cleanup.</=
div><div><br></div><div>=C2=A0 -George</div><div>=C2=A0</div></div></div>

--00000000000096e0d20601921695--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 20:51:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 20:51:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571575.895771 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPUQa-0003Lb-TB; Fri, 28 Jul 2023 20:51:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571575.895771; Fri, 28 Jul 2023 20:51:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPUQa-0003LU-Pu; Fri, 28 Jul 2023 20:51:12 +0000
Received: by outflank-mailman (input) for mailman id 571575;
 Fri, 28 Jul 2023 20:51:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Q8mr=DO=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qPUQa-0003LO-8o
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 20:51:12 +0000
Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com
 [2a00:1450:4864:20::232])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7b838f16-2d88-11ee-b24e-6b7b168915f2;
 Fri, 28 Jul 2023 22:51:10 +0200 (CEST)
Received: by mail-lj1-x232.google.com with SMTP id
 38308e7fff4ca-2b9c0391749so38951111fa.0
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 13:51:10 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7b838f16-2d88-11ee-b24e-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690577470; x=1691182270;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=Hjzv16CujdZxMwJqHoLWNQZbH6rQET1fq4GvgNmvvB0=;
        b=eQcUWptGppoldAhFFTAePPBuGtqwfnN59K2CBomJFBD4KFvNklgYxkhWohchziyx3M
         hSg10PHrtBDvMBnF6LfkELxjyzjSCLjlmpP2HZGjMMVmY79Q6Xpdeb10k3rSyteiCqqu
         CY0YePAKq/GYg71LPMUjAZgwi2o359cQV3Fo0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690577470; x=1691182270;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=Hjzv16CujdZxMwJqHoLWNQZbH6rQET1fq4GvgNmvvB0=;
        b=UCafj3tYff8AeXjFHzMe2WsO1r2BQAFvujP//tcbC/PeVl1kOs/TjxK3sVj5GmCxCt
         X+aCOUW+rns75Acuvxy75vJEhhK1i8BSQUExaDBU12DClWbPqntXp+M8Ichzsk1zuzeU
         NT7LWRISxc9Le/qm4juNTVrCy9TQZ3bVPa+wxF3scaElQxQBLj3PuR4XoqLCrKnBNAbX
         4l4KeDmo6x/t+F8j9iQQ4Vl5tayGV0d3RTDZmQVhQSZ2PlkH4vukXL7LeCpELJP8GCJk
         MxbwLdoVBREPb35Y33Cr0f6XJP0I7GabADZOzcMPV0BpGkEKWcQzyLXDyDn6DyuwjrbB
         Rq6g==
X-Gm-Message-State: ABy/qLarZ1E3HkKH7Pj3r6IuMSvnfdZ0kBvGw3imuaQJ2vpCVExCJkQz
	WmMWOCVFeND9fkKpOnJeJ1I56wmXIXmw2App8Z8hcg==
X-Google-Smtp-Source: APBJJlFjvby3HyCToDaPC1SN4r5oGT0DdR6JnpsXuxEuwrsfn5CfhiPTlq0NA2IVoj6FDOuP5lSlPC0T1YmalvJu9/A=
X-Received: by 2002:a2e:80d2:0:b0:2b9:5791:88cc with SMTP id
 r18-20020a2e80d2000000b002b9579188ccmr2221183ljg.37.1690577470216; Fri, 28
 Jul 2023 13:51:10 -0700 (PDT)
MIME-Version: 1.0
References: <20230601081331.436-1-olaf@aepfle.de>
In-Reply-To: <20230601081331.436-1-olaf@aepfle.de>
From: George Dunlap <george.dunlap@cloud.com>
Date: Fri, 28 Jul 2023 21:50:59 +0100
Message-ID: <CA+zSX=bPSda90nk5WMbxfKsqnDwsogUqwR4ZDsKh0BQDUZxrOw@mail.gmail.com>
Subject: Re: [PATCH v1] xenalyze: remove unused defines
To: Olaf Hering <olaf@aepfle.de>
Cc: xen-devel@lists.xenproject.org, George Dunlap <george.dunlap@citrix.com>, 
	Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Content-Type: multipart/alternative; boundary="00000000000093ef8f0601923d8a"

--00000000000093ef8f0601923d8a
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jun 1, 2023 at 9:13=E2=80=AFAM Olaf Hering <olaf@aepfle.de> wrote:

> These defines are not used by xenalyze.
> NR_CPUS will not match what was used for building Xen itself.
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
>

Reviewed-by: George Dunlap <george.dunlap@cloud.com>

--00000000000093ef8f0601923d8a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jun 1, 2023 at 9:13=E2=80=AFA=
M Olaf Hering &lt;<a href=3D"mailto:olaf@aepfle.de">olaf@aepfle.de</a>&gt; =
wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">These def=
ines are not used by xenalyze.<br>
NR_CPUS will not match what was used for building Xen itself.<br>
<br>
Signed-off-by: Olaf Hering &lt;<a href=3D"mailto:olaf@aepfle.de" target=3D"=
_blank">olaf@aepfle.de</a>&gt;<br></blockquote><div><br></div><div>Reviewed=
-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@cloud.com">george.du=
nlap@cloud.com</a>&gt;</div></div></div>

--00000000000093ef8f0601923d8a--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 20:53:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 20:53:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571579.895781 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPUSh-0003xZ-CO; Fri, 28 Jul 2023 20:53:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571579.895781; Fri, 28 Jul 2023 20:53:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPUSh-0003xS-8s; Fri, 28 Jul 2023 20:53:23 +0000
Received: by outflank-mailman (input) for mailman id 571579;
 Fri, 28 Jul 2023 20:53:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Q8mr=DO=tibco.com=gdunlap@srs-se1.protection.inumbo.net>)
 id 1qPUSg-0003xK-CA
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 20:53:22 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c97e5b83-2d88-11ee-b24e-6b7b168915f2;
 Fri, 28 Jul 2023 22:53:21 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-4fbf09a9139so4364253e87.2
 for <xen-devel@lists.xenproject.org>; Fri, 28 Jul 2023 13:53:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c97e5b83-2d88-11ee-b24e-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1690577601; x=1691182401;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=wMiw203K4J1QqbZR+FNDuty6xspMnbX3FwOLTg82wGA=;
        b=h5vHC/+8lHP1RoI/jqV9bsErZSl9ocnpgGEbknaIQjJb4sCy1T9UPLjz9276ZXZ6Pn
         JGR2NB0xb4UbsDRYv+jWITA3cs5YuNGzc90KOSVo1JfxpG7NivrJvL3GL5h+qGyRF2U7
         kg8hJ+GV9h4P+fb1UJb4IBtlOla/ZjcCrf6LQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690577601; x=1691182401;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=wMiw203K4J1QqbZR+FNDuty6xspMnbX3FwOLTg82wGA=;
        b=XnVyEXy2lRU9jMBczHfw9FcvCK3odDk4T6MF1MKGtbJNCqYdD2QChWwXe0OFDvYXoi
         C+K/7MYBeSPPuW9LcZ0UfZE0GY6Fd2awMJD65C1AK+/q+iDZz3ABDO94a3ofCDrB9AnP
         NK8FbdCFYi+XyuMiB4LViekcxibk3wWXsmcQJOj7Vga3zRWw/TlN6+dqXtXFBtTxqjal
         g7IAL60mayi9snKnkQxwHBGm8qgT7qt98HXfN/n5XPM4+por7ZGIaSr6KV6AN8aN7ZOj
         H5uFRvrmKQbvN19Rdq2VqIdPHXESdUzZy6nxEqEzLhkYBK6ng+1XMwsIKidWU86h3RB1
         GliA==
X-Gm-Message-State: ABy/qLZjhFD+bnn5Mgu7a1bwTmPBqVB3LWY+rffe4AYXeFS2qpcZcxZg
	C2L8BI+eGqmluzb/azS8L1LJhl0R8JDeuVFjiKUaDFIstq87mOLfJDs=
X-Google-Smtp-Source: APBJJlGQg1YwmJcRLDOuMx7U4NuJQhXCse9SAZPGaR4K3+Bjndl8v3teM1r7RhKLpdVvi2SrweZeMJQ8BJgfGYbfxiM=
X-Received: by 2002:a19:670d:0:b0:4f9:5a61:194f with SMTP id
 b13-20020a19670d000000b004f95a61194fmr2670970lfc.11.1690577601132; Fri, 28
 Jul 2023 13:53:21 -0700 (PDT)
MIME-Version: 1.0
References: <20230526123810.23210-1-olaf@aepfle.de>
In-Reply-To: <20230526123810.23210-1-olaf@aepfle.de>
From: George Dunlap <george.dunlap@cloud.com>
Date: Fri, 28 Jul 2023 21:53:10 +0100
Message-ID: <CA+zSX=ZphEOw0_1pZKRUPJ7aeNMAeMGTiM8rSprt9vX=NLT1Hg@mail.gmail.com>
Subject: Re: [PATCH v1] xentrace: adjust exit code for --help option
To: Olaf Hering <olaf@aepfle.de>
Cc: xen-devel@lists.xenproject.org, George Dunlap <george.dunlap@citrix.com>, 
	Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Content-Type: multipart/alternative; boundary="0000000000006192e4060192457c"

--0000000000006192e4060192457c
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, May 26, 2023 at 1:38=E2=80=AFPM Olaf Hering <olaf@aepfle.de> wrote:

> Invoking the --help option of any tool should not return with an error,
> if that tool does have a documented and implemented help option.
>
> Adjust the usage() function to exit with either error or success.
> Handle the existing entry in the option table to call usage accordingly.
>
> Adjust the getopt value for help. The char '?' is returned for unknown
> options. Returning 'h' instead of '?' allows to handle --help.
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
>

Reviewed-by: George Dunlap <george.dunlap@cloud.com>

--0000000000006192e4060192457c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Fri, May 26, 2023 at 1:38=E2=80=AF=
PM Olaf Hering &lt;<a href=3D"mailto:olaf@aepfle.de">olaf@aepfle.de</a>&gt;=
 wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Invoking=
 the --help option of any tool should not return with an error,<br>
if that tool does have a documented and implemented help option.<br>
<br>
Adjust the usage() function to exit with either error or success.<br>
Handle the existing entry in the option table to call usage accordingly.<br=
>
<br>
Adjust the getopt value for help. The char &#39;?&#39; is returned for unkn=
own<br>
options. Returning &#39;h&#39; instead of &#39;?&#39; allows to handle --he=
lp.<br>
<br>
Signed-off-by: Olaf Hering &lt;<a href=3D"mailto:olaf@aepfle.de" target=3D"=
_blank">olaf@aepfle.de</a>&gt;<br></blockquote><div><br></div><div>Reviewed=
-by: George Dunlap &lt;<a href=3D"mailto:george.dunlap@cloud.com">george.du=
nlap@cloud.com</a>&gt;</div></div></div>

--0000000000006192e4060192457c--


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 21:35:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 21:35:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571583.895791 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPV7R-0000As-FN; Fri, 28 Jul 2023 21:35:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571583.895791; Fri, 28 Jul 2023 21:35:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPV7R-0000Ah-Bx; Fri, 28 Jul 2023 21:35:29 +0000
Received: by outflank-mailman (input) for mailman id 571583;
 Fri, 28 Jul 2023 21:35:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/sdN=DO=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qPV7P-0000AP-La
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 21:35:27 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a8ecc533-2d8e-11ee-b24e-6b7b168915f2;
 Fri, 28 Jul 2023 23:35:25 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 451578285A16;
 Fri, 28 Jul 2023 16:35:23 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id 1IXn4TXR781m; Fri, 28 Jul 2023 16:35:22 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 4D00B8285971;
 Fri, 28 Jul 2023 16:35:22 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id gpVtHqu_UGrC; Fri, 28 Jul 2023 16:35:22 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 8D6DB82857ED;
 Fri, 28 Jul 2023 16:35:21 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a8ecc533-2d8e-11ee-b24e-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 4D00B8285971
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1690580122; bh=Hx8teiLermSp0bRLJTmHCMUqtTdFnE+mNXf9t8xuON0=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=jNkIxO0hCOdN7L7LNCWbIwT2YF/lzFC/VtC2UFQ3OOhjDp1aHKL0cK31mBXmt3qLJ
	 w0rIoUAzNPEvwXZqwQiAbXjRSJ3xPNd3HFRxvTRRdjDXT8RIfSj8raBbzUiCwKT1gt
	 lbSzM7ltKTJG9eUZv+inATbFI8kLLXFdBtxXQR+0=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [PATCH 0/5] xen/ppc: Add PowerNV bare metal support
Date: Fri, 28 Jul 2023 16:35:05 -0500
Message-Id: <cover.1690579561.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Hello all,

This series adds support for booting and using the serial console on
bare metal PowerNV/OpenPOWER systems. Up until now, Xen could only be
booted on the QEMU pseries model, which was initially targetted for ease
of development, but which differs significantly from the bare metal
systems where this port is likely to be the most useful.

In addition to adding support for the PowerNV boot protocol and firmware
interface, changes required to get libfdt from xen/libfdt building are
included. This is required to obtain the firmware entrypoint address on
PowerNV.

Thanks,
Shawn

Shawn Anastasio (5):
  xen/lib: Move simple_strtoul from common/vsprintf.c to lib
  xen/ppc: Switch to medium PIC code model
  xen/ppc: Add OPAL API definition header file
  xen/ppc: Parse device tree for OPAL node on PowerNV
  xen/ppc: Implement early serial console on PowerNV

 xen/arch/ppc/Kconfig                 |    1 +
 xen/arch/ppc/Makefile                |    1 +
 xen/arch/ppc/arch.mk                 |    6 +-
 xen/arch/ppc/include/asm/asm-defns.h |   19 +
 xen/arch/ppc/include/asm/boot.h      |   16 +-
 xen/arch/ppc/include/asm/bug.h       |   18 +
 xen/arch/ppc/include/asm/cache.h     |    6 +
 xen/arch/ppc/include/asm/config.h    |    2 +-
 xen/arch/ppc/include/asm/opal-api.h  | 1190 ++++++++++++++++++++++++++
 xen/arch/ppc/include/asm/processor.h |   13 +-
 xen/arch/ppc/include/asm/string.h    |    6 +
 xen/arch/ppc/include/asm/system.h    |    6 +
 xen/arch/ppc/opal.c                  |   73 ++
 xen/arch/ppc/ppc64/Makefile          |    1 +
 xen/arch/ppc/ppc64/asm-offsets.c     |    4 +
 xen/arch/ppc/ppc64/head.S            |   13 +-
 xen/arch/ppc/ppc64/opal-calls.S      |   82 ++
 xen/arch/ppc/setup.c                 |    9 +-
 xen/arch/ppc/xen.lds.S               |   44 +-
 xen/common/vsprintf.c                |   37 -
 xen/lib/Makefile                     |    1 +
 xen/lib/simple_strtoul.c             |   40 +
 22 files changed, 1511 insertions(+), 77 deletions(-)
 create mode 100644 xen/arch/ppc/include/asm/bug.h
 create mode 100644 xen/arch/ppc/include/asm/cache.h
 create mode 100644 xen/arch/ppc/include/asm/opal-api.h
 create mode 100644 xen/arch/ppc/include/asm/string.h
 create mode 100644 xen/arch/ppc/include/asm/system.h
 create mode 100644 xen/arch/ppc/opal.c
 create mode 100644 xen/arch/ppc/ppc64/opal-calls.S
 create mode 100644 xen/lib/simple_strtoul.c

--
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 21:35:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 21:35:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571588.895841 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPV7V-0001Q4-5t; Fri, 28 Jul 2023 21:35:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571588.895841; Fri, 28 Jul 2023 21:35:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPV7V-0001PO-1q; Fri, 28 Jul 2023 21:35:33 +0000
Received: by outflank-mailman (input) for mailman id 571588;
 Fri, 28 Jul 2023 21:35:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/sdN=DO=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qPV7T-0000AP-Bz
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 21:35:31 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ab042682-2d8e-11ee-b24e-6b7b168915f2;
 Fri, 28 Jul 2023 23:35:27 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id BD4458285ABC;
 Fri, 28 Jul 2023 16:35:26 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id ohbyD1mUgrwQ; Fri, 28 Jul 2023 16:35:23 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id D53F982857ED;
 Fri, 28 Jul 2023 16:35:23 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id eu1qzK_w2Vk1; Fri, 28 Jul 2023 16:35:23 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 639248285971;
 Fri, 28 Jul 2023 16:35:23 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ab042682-2d8e-11ee-b24e-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com D53F982857ED
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1690580123; bh=75v2AW7hBSIIil5lKjiXI+lRiPJZVYa2muWvb4j1loM=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=NAz7vydEDa/1nswjD9jrW+lm1cTvu75nnbEwgF/W170jkDkdjZgRKh4+24stvDrtM
	 weYDq/DKheKyt6r5aXUTUvzhpxDxlFppu2I2JTbs21ENJDHP47/BiYkffqRjdgcloT
	 y7VCXPi6R5ToUO1fnz4Z2Y/kkDeTA8sOl9dzU7hQ=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH 3/5] xen/ppc: Add OPAL API definition header file
Date: Fri, 28 Jul 2023 16:35:08 -0500
Message-Id: <7feead05db9baa310feaddd24415774582e88344.1690579561.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1690579561.git.sanastasio@raptorengineering.com>
References: <cover.1690579561.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

OPAL (OpenPower Abstraction Layer) is the interface exposed by firmware
on PowerNV (bare metal) systems. Import Linux's header definining the
API and related information.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/ppc/include/asm/opal-api.h | 1190 +++++++++++++++++++++++++++
 1 file changed, 1190 insertions(+)
 create mode 100644 xen/arch/ppc/include/asm/opal-api.h

diff --git a/xen/arch/ppc/include/asm/opal-api.h b/xen/arch/ppc/include/a=
sm/opal-api.h
new file mode 100644
index 0000000000..75100eda83
--- /dev/null
+++ b/xen/arch/ppc/include/asm/opal-api.h
@@ -0,0 +1,1190 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * OPAL API definitions.
+ *
+ * Copyright 2011-2015 IBM Corp.
+ */
+
+#ifndef __OPAL_API_H
+#define __OPAL_API_H
+
+/****** OPAL APIs ******/
+
+/* Return codes */
+#define OPAL_SUCCESS		0
+#define OPAL_PARAMETER		-1
+#define OPAL_BUSY		-2
+#define OPAL_PARTIAL		-3
+#define OPAL_CONSTRAINED	-4
+#define OPAL_CLOSED		-5
+#define OPAL_HARDWARE		-6
+#define OPAL_UNSUPPORTED	-7
+#define OPAL_PERMISSION		-8
+#define OPAL_NO_MEM		-9
+#define OPAL_RESOURCE		-10
+#define OPAL_INTERNAL_ERROR	-11
+#define OPAL_BUSY_EVENT		-12
+#define OPAL_HARDWARE_FROZEN	-13
+#define OPAL_WRONG_STATE	-14
+#define OPAL_ASYNC_COMPLETION	-15
+#define OPAL_EMPTY		-16
+#define OPAL_I2C_TIMEOUT	-17
+#define OPAL_I2C_INVALID_CMD	-18
+#define OPAL_I2C_LBUS_PARITY	-19
+#define OPAL_I2C_BKEND_OVERRUN	-20
+#define OPAL_I2C_BKEND_ACCESS	-21
+#define OPAL_I2C_ARBT_LOST	-22
+#define OPAL_I2C_NACK_RCVD	-23
+#define OPAL_I2C_STOP_ERR	-24
+#define OPAL_XIVE_PROVISIONING	-31
+#define OPAL_XIVE_FREE_ACTIVE	-32
+#define OPAL_TIMEOUT		-33
+
+/* API Tokens (in r0) */
+#define OPAL_INVALID_CALL		       -1
+#define OPAL_TEST				0
+#define OPAL_CONSOLE_WRITE			1
+#define OPAL_CONSOLE_READ			2
+#define OPAL_RTC_READ				3
+#define OPAL_RTC_WRITE				4
+#define OPAL_CEC_POWER_DOWN			5
+#define OPAL_CEC_REBOOT				6
+#define OPAL_READ_NVRAM				7
+#define OPAL_WRITE_NVRAM			8
+#define OPAL_HANDLE_INTERRUPT			9
+#define OPAL_POLL_EVENTS			10
+#define OPAL_PCI_SET_HUB_TCE_MEMORY		11
+#define OPAL_PCI_SET_PHB_TCE_MEMORY		12
+#define OPAL_PCI_CONFIG_READ_BYTE		13
+#define OPAL_PCI_CONFIG_READ_HALF_WORD  	14
+#define OPAL_PCI_CONFIG_READ_WORD		15
+#define OPAL_PCI_CONFIG_WRITE_BYTE		16
+#define OPAL_PCI_CONFIG_WRITE_HALF_WORD		17
+#define OPAL_PCI_CONFIG_WRITE_WORD		18
+#define OPAL_SET_XIVE				19
+#define OPAL_GET_XIVE				20
+#define OPAL_GET_COMPLETION_TOKEN_STATUS	21 /* obsolete */
+#define OPAL_REGISTER_OPAL_EXCEPTION_HANDLER	22
+#define OPAL_PCI_EEH_FREEZE_STATUS		23
+#define OPAL_PCI_SHPC				24
+#define OPAL_CONSOLE_WRITE_BUFFER_SPACE		25
+#define OPAL_PCI_EEH_FREEZE_CLEAR		26
+#define OPAL_PCI_PHB_MMIO_ENABLE		27
+#define OPAL_PCI_SET_PHB_MEM_WINDOW		28
+#define OPAL_PCI_MAP_PE_MMIO_WINDOW		29
+#define OPAL_PCI_SET_PHB_TABLE_MEMORY		30
+#define OPAL_PCI_SET_PE				31
+#define OPAL_PCI_SET_PELTV			32
+#define OPAL_PCI_SET_MVE			33
+#define OPAL_PCI_SET_MVE_ENABLE			34
+#define OPAL_PCI_GET_XIVE_REISSUE		35
+#define OPAL_PCI_SET_XIVE_REISSUE		36
+#define OPAL_PCI_SET_XIVE_PE			37
+#define OPAL_GET_XIVE_SOURCE			38
+#define OPAL_GET_MSI_32				39
+#define OPAL_GET_MSI_64				40
+#define OPAL_START_CPU				41
+#define OPAL_QUERY_CPU_STATUS			42
+#define OPAL_WRITE_OPPANEL			43 /* unimplemented */
+#define OPAL_PCI_MAP_PE_DMA_WINDOW		44
+#define OPAL_PCI_MAP_PE_DMA_WINDOW_REAL		45
+#define OPAL_PCI_RESET				49
+#define OPAL_PCI_GET_HUB_DIAG_DATA		50
+#define OPAL_PCI_GET_PHB_DIAG_DATA		51
+#define OPAL_PCI_FENCE_PHB			52
+#define OPAL_PCI_REINIT				53
+#define OPAL_PCI_MASK_PE_ERROR			54
+#define OPAL_SET_SLOT_LED_STATUS		55
+#define OPAL_GET_EPOW_STATUS			56
+#define OPAL_SET_SYSTEM_ATTENTION_LED		57
+#define OPAL_RESERVED1				58
+#define OPAL_RESERVED2				59
+#define OPAL_PCI_NEXT_ERROR			60
+#define OPAL_PCI_EEH_FREEZE_STATUS2		61
+#define OPAL_PCI_POLL				62
+#define OPAL_PCI_MSI_EOI			63
+#define OPAL_PCI_GET_PHB_DIAG_DATA2		64
+#define OPAL_XSCOM_READ				65
+#define OPAL_XSCOM_WRITE			66
+#define OPAL_LPC_READ				67
+#define OPAL_LPC_WRITE				68
+#define OPAL_RETURN_CPU				69
+#define OPAL_REINIT_CPUS			70
+#define OPAL_ELOG_READ				71
+#define OPAL_ELOG_WRITE				72
+#define OPAL_ELOG_ACK				73
+#define OPAL_ELOG_RESEND			74
+#define OPAL_ELOG_SIZE				75
+#define OPAL_FLASH_VALIDATE			76
+#define OPAL_FLASH_MANAGE			77
+#define OPAL_FLASH_UPDATE			78
+#define OPAL_RESYNC_TIMEBASE			79
+#define OPAL_CHECK_TOKEN			80
+#define OPAL_DUMP_INIT				81
+#define OPAL_DUMP_INFO				82
+#define OPAL_DUMP_READ				83
+#define OPAL_DUMP_ACK				84
+#define OPAL_GET_MSG				85
+#define OPAL_CHECK_ASYNC_COMPLETION		86
+#define OPAL_SYNC_HOST_REBOOT			87
+#define OPAL_SENSOR_READ			88
+#define OPAL_GET_PARAM				89
+#define OPAL_SET_PARAM				90
+#define OPAL_DUMP_RESEND			91
+#define OPAL_ELOG_SEND				92	/* Deprecated */
+#define OPAL_PCI_SET_PHB_CAPI_MODE		93
+#define OPAL_DUMP_INFO2				94
+#define OPAL_WRITE_OPPANEL_ASYNC		95
+#define OPAL_PCI_ERR_INJECT			96
+#define OPAL_PCI_EEH_FREEZE_SET			97
+#define OPAL_HANDLE_HMI				98
+#define OPAL_CONFIG_CPU_IDLE_STATE		99
+#define OPAL_SLW_SET_REG			100
+#define OPAL_REGISTER_DUMP_REGION		101
+#define OPAL_UNREGISTER_DUMP_REGION		102
+#define OPAL_WRITE_TPO				103
+#define OPAL_READ_TPO				104
+#define OPAL_GET_DPO_STATUS			105
+#define OPAL_OLD_I2C_REQUEST			106	/* Deprecated */
+#define OPAL_IPMI_SEND				107
+#define OPAL_IPMI_RECV				108
+#define OPAL_I2C_REQUEST			109
+#define OPAL_FLASH_READ				110
+#define OPAL_FLASH_WRITE			111
+#define OPAL_FLASH_ERASE			112
+#define OPAL_PRD_MSG				113
+#define OPAL_LEDS_GET_INDICATOR			114
+#define OPAL_LEDS_SET_INDICATOR			115
+#define OPAL_CEC_REBOOT2			116
+#define OPAL_CONSOLE_FLUSH			117
+#define OPAL_GET_DEVICE_TREE			118
+#define OPAL_PCI_GET_PRESENCE_STATE		119
+#define OPAL_PCI_GET_POWER_STATE		120
+#define OPAL_PCI_SET_POWER_STATE		121
+#define OPAL_INT_GET_XIRR			122
+#define	OPAL_INT_SET_CPPR			123
+#define OPAL_INT_EOI				124
+#define OPAL_INT_SET_MFRR			125
+#define OPAL_PCI_TCE_KILL			126
+#define OPAL_NMMU_SET_PTCR			127
+#define OPAL_XIVE_RESET				128
+#define OPAL_XIVE_GET_IRQ_INFO			129
+#define OPAL_XIVE_GET_IRQ_CONFIG		130
+#define OPAL_XIVE_SET_IRQ_CONFIG		131
+#define OPAL_XIVE_GET_QUEUE_INFO		132
+#define OPAL_XIVE_SET_QUEUE_INFO		133
+#define OPAL_XIVE_DONATE_PAGE			134
+#define OPAL_XIVE_ALLOCATE_VP_BLOCK		135
+#define OPAL_XIVE_FREE_VP_BLOCK			136
+#define OPAL_XIVE_GET_VP_INFO			137
+#define OPAL_XIVE_SET_VP_INFO			138
+#define OPAL_XIVE_ALLOCATE_IRQ			139
+#define OPAL_XIVE_FREE_IRQ			140
+#define OPAL_XIVE_SYNC				141
+#define OPAL_XIVE_DUMP				142
+#define OPAL_XIVE_GET_QUEUE_STATE		143
+#define OPAL_XIVE_SET_QUEUE_STATE		144
+#define OPAL_SIGNAL_SYSTEM_RESET		145
+#define OPAL_NPU_INIT_CONTEXT			146
+#define OPAL_NPU_DESTROY_CONTEXT		147
+#define OPAL_NPU_MAP_LPAR			148
+#define OPAL_IMC_COUNTERS_INIT			149
+#define OPAL_IMC_COUNTERS_START			150
+#define OPAL_IMC_COUNTERS_STOP			151
+#define OPAL_GET_POWERCAP			152
+#define OPAL_SET_POWERCAP			153
+#define OPAL_GET_POWER_SHIFT_RATIO		154
+#define OPAL_SET_POWER_SHIFT_RATIO		155
+#define OPAL_SENSOR_GROUP_CLEAR			156
+#define OPAL_PCI_SET_P2P			157
+#define OPAL_QUIESCE				158
+#define OPAL_NPU_SPA_SETUP			159
+#define OPAL_NPU_SPA_CLEAR_CACHE		160
+#define OPAL_NPU_TL_SET				161
+#define OPAL_SENSOR_READ_U64			162
+#define OPAL_SENSOR_GROUP_ENABLE		163
+#define OPAL_PCI_GET_PBCQ_TUNNEL_BAR		164
+#define OPAL_PCI_SET_PBCQ_TUNNEL_BAR		165
+#define OPAL_HANDLE_HMI2			166
+#define	OPAL_NX_COPROC_INIT			167
+#define OPAL_XIVE_GET_VP_STATE			170
+#define OPAL_MPIPL_UPDATE			173
+#define OPAL_MPIPL_REGISTER_TAG			174
+#define OPAL_MPIPL_QUERY_TAG			175
+#define OPAL_SECVAR_GET				176
+#define OPAL_SECVAR_GET_NEXT			177
+#define OPAL_SECVAR_ENQUEUE_UPDATE		178
+#define OPAL_LAST				178
+
+#define QUIESCE_HOLD			1 /* Spin all calls at entry */
+#define QUIESCE_REJECT			2 /* Fail all calls with OPAL_BUSY */
+#define QUIESCE_LOCK_BREAK		3 /* Set to ignore locks. */
+#define QUIESCE_RESUME			4 /* Un-quiesce */
+#define QUIESCE_RESUME_FAST_REBOOT	5 /* Un-quiesce, fast reboot */
+
+/* Device tree flags */
+
+/*
+ * Flags set in power-mgmt nodes in device tree describing
+ * idle states that are supported in the platform.
+ */
+
+#define OPAL_PM_TIMEBASE_STOP		0x00000002
+#define OPAL_PM_LOSE_HYP_CONTEXT	0x00002000
+#define OPAL_PM_LOSE_FULL_CONTEXT	0x00004000
+#define OPAL_PM_NAP_ENABLED		0x00010000
+#define OPAL_PM_SLEEP_ENABLED		0x00020000
+#define OPAL_PM_WINKLE_ENABLED		0x00040000
+#define OPAL_PM_SLEEP_ENABLED_ER1	0x00080000 /* with workaround */
+#define OPAL_PM_STOP_INST_FAST		0x00100000
+#define OPAL_PM_STOP_INST_DEEP		0x00200000
+
+/*
+ * OPAL_CONFIG_CPU_IDLE_STATE parameters
+ */
+#define OPAL_CONFIG_IDLE_FASTSLEEP	1
+#define OPAL_CONFIG_IDLE_UNDO		0
+#define OPAL_CONFIG_IDLE_APPLY		1
+
+#ifndef __ASSEMBLY__
+
+#include <xen/types.h>
+
+/* Other enums */
+enum OpalFreezeState {
+	OPAL_EEH_STOPPED_NOT_FROZEN =3D 0,
+	OPAL_EEH_STOPPED_MMIO_FREEZE =3D 1,
+	OPAL_EEH_STOPPED_DMA_FREEZE =3D 2,
+	OPAL_EEH_STOPPED_MMIO_DMA_FREEZE =3D 3,
+	OPAL_EEH_STOPPED_RESET =3D 4,
+	OPAL_EEH_STOPPED_TEMP_UNAVAIL =3D 5,
+	OPAL_EEH_STOPPED_PERM_UNAVAIL =3D 6
+};
+
+enum OpalEehFreezeActionToken {
+	OPAL_EEH_ACTION_CLEAR_FREEZE_MMIO =3D 1,
+	OPAL_EEH_ACTION_CLEAR_FREEZE_DMA =3D 2,
+	OPAL_EEH_ACTION_CLEAR_FREEZE_ALL =3D 3,
+
+	OPAL_EEH_ACTION_SET_FREEZE_MMIO =3D 1,
+	OPAL_EEH_ACTION_SET_FREEZE_DMA  =3D 2,
+	OPAL_EEH_ACTION_SET_FREEZE_ALL  =3D 3
+};
+
+enum OpalPciStatusToken {
+	OPAL_EEH_NO_ERROR	=3D 0,
+	OPAL_EEH_IOC_ERROR	=3D 1,
+	OPAL_EEH_PHB_ERROR	=3D 2,
+	OPAL_EEH_PE_ERROR	=3D 3,
+	OPAL_EEH_PE_MMIO_ERROR	=3D 4,
+	OPAL_EEH_PE_DMA_ERROR	=3D 5
+};
+
+enum OpalPciErrorSeverity {
+	OPAL_EEH_SEV_NO_ERROR	=3D 0,
+	OPAL_EEH_SEV_IOC_DEAD	=3D 1,
+	OPAL_EEH_SEV_PHB_DEAD	=3D 2,
+	OPAL_EEH_SEV_PHB_FENCED	=3D 3,
+	OPAL_EEH_SEV_PE_ER	=3D 4,
+	OPAL_EEH_SEV_INF	=3D 5
+};
+
+enum OpalErrinjectType {
+	OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR	=3D 0,
+	OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR64	=3D 1,
+};
+
+enum OpalErrinjectFunc {
+	/* IOA bus specific errors */
+	OPAL_ERR_INJECT_FUNC_IOA_LD_MEM_ADDR	=3D 0,
+	OPAL_ERR_INJECT_FUNC_IOA_LD_MEM_DATA	=3D 1,
+	OPAL_ERR_INJECT_FUNC_IOA_LD_IO_ADDR	=3D 2,
+	OPAL_ERR_INJECT_FUNC_IOA_LD_IO_DATA	=3D 3,
+	OPAL_ERR_INJECT_FUNC_IOA_LD_CFG_ADDR	=3D 4,
+	OPAL_ERR_INJECT_FUNC_IOA_LD_CFG_DATA	=3D 5,
+	OPAL_ERR_INJECT_FUNC_IOA_ST_MEM_ADDR	=3D 6,
+	OPAL_ERR_INJECT_FUNC_IOA_ST_MEM_DATA	=3D 7,
+	OPAL_ERR_INJECT_FUNC_IOA_ST_IO_ADDR	=3D 8,
+	OPAL_ERR_INJECT_FUNC_IOA_ST_IO_DATA	=3D 9,
+	OPAL_ERR_INJECT_FUNC_IOA_ST_CFG_ADDR	=3D 10,
+	OPAL_ERR_INJECT_FUNC_IOA_ST_CFG_DATA	=3D 11,
+	OPAL_ERR_INJECT_FUNC_IOA_DMA_RD_ADDR	=3D 12,
+	OPAL_ERR_INJECT_FUNC_IOA_DMA_RD_DATA	=3D 13,
+	OPAL_ERR_INJECT_FUNC_IOA_DMA_RD_MASTER	=3D 14,
+	OPAL_ERR_INJECT_FUNC_IOA_DMA_RD_TARGET	=3D 15,
+	OPAL_ERR_INJECT_FUNC_IOA_DMA_WR_ADDR	=3D 16,
+	OPAL_ERR_INJECT_FUNC_IOA_DMA_WR_DATA	=3D 17,
+	OPAL_ERR_INJECT_FUNC_IOA_DMA_WR_MASTER	=3D 18,
+	OPAL_ERR_INJECT_FUNC_IOA_DMA_WR_TARGET	=3D 19,
+};
+
+enum OpalMmioWindowType {
+	OPAL_M32_WINDOW_TYPE =3D 1,
+	OPAL_M64_WINDOW_TYPE =3D 2,
+	OPAL_IO_WINDOW_TYPE  =3D 3
+};
+
+enum OpalExceptionHandler {
+	OPAL_MACHINE_CHECK_HANDLER	    =3D 1,
+	OPAL_HYPERVISOR_MAINTENANCE_HANDLER =3D 2,
+	OPAL_SOFTPATCH_HANDLER		    =3D 3
+};
+
+enum OpalPendingState {
+	OPAL_EVENT_OPAL_INTERNAL   =3D 0x1,
+	OPAL_EVENT_NVRAM	   =3D 0x2,
+	OPAL_EVENT_RTC		   =3D 0x4,
+	OPAL_EVENT_CONSOLE_OUTPUT  =3D 0x8,
+	OPAL_EVENT_CONSOLE_INPUT   =3D 0x10,
+	OPAL_EVENT_ERROR_LOG_AVAIL =3D 0x20,
+	OPAL_EVENT_ERROR_LOG	   =3D 0x40,
+	OPAL_EVENT_EPOW		   =3D 0x80,
+	OPAL_EVENT_LED_STATUS	   =3D 0x100,
+	OPAL_EVENT_PCI_ERROR	   =3D 0x200,
+	OPAL_EVENT_DUMP_AVAIL	   =3D 0x400,
+	OPAL_EVENT_MSG_PENDING	   =3D 0x800,
+};
+
+enum OpalThreadStatus {
+	OPAL_THREAD_INACTIVE =3D 0x0,
+	OPAL_THREAD_STARTED =3D 0x1,
+	OPAL_THREAD_UNAVAILABLE =3D 0x2 /* opal-v3 */
+};
+
+enum OpalPciBusCompare {
+	OpalPciBusAny	=3D 0,	/* Any bus number match */
+	OpalPciBus3Bits	=3D 2,	/* Match top 3 bits of bus number */
+	OpalPciBus4Bits	=3D 3,	/* Match top 4 bits of bus number */
+	OpalPciBus5Bits	=3D 4,	/* Match top 5 bits of bus number */
+	OpalPciBus6Bits	=3D 5,	/* Match top 6 bits of bus number */
+	OpalPciBus7Bits	=3D 6,	/* Match top 7 bits of bus number */
+	OpalPciBusAll	=3D 7,	/* Match bus number exactly */
+};
+
+enum OpalDeviceCompare {
+	OPAL_IGNORE_RID_DEVICE_NUMBER =3D 0,
+	OPAL_COMPARE_RID_DEVICE_NUMBER =3D 1
+};
+
+enum OpalFuncCompare {
+	OPAL_IGNORE_RID_FUNCTION_NUMBER =3D 0,
+	OPAL_COMPARE_RID_FUNCTION_NUMBER =3D 1
+};
+
+enum OpalPeAction {
+	OPAL_UNMAP_PE =3D 0,
+	OPAL_MAP_PE =3D 1
+};
+
+enum OpalPeltvAction {
+	OPAL_REMOVE_PE_FROM_DOMAIN =3D 0,
+	OPAL_ADD_PE_TO_DOMAIN =3D 1
+};
+
+enum OpalMveEnableAction {
+	OPAL_DISABLE_MVE =3D 0,
+	OPAL_ENABLE_MVE =3D 1
+};
+
+enum OpalM64Action {
+	OPAL_DISABLE_M64 =3D 0,
+	OPAL_ENABLE_M64_SPLIT =3D 1,
+	OPAL_ENABLE_M64_NON_SPLIT =3D 2
+};
+
+enum OpalPciResetScope {
+	OPAL_RESET_PHB_COMPLETE		=3D 1,
+	OPAL_RESET_PCI_LINK		=3D 2,
+	OPAL_RESET_PHB_ERROR		=3D 3,
+	OPAL_RESET_PCI_HOT		=3D 4,
+	OPAL_RESET_PCI_FUNDAMENTAL	=3D 5,
+	OPAL_RESET_PCI_IODA_TABLE	=3D 6
+};
+
+enum OpalPciReinitScope {
+	/*
+	 * Note: we chose values that do not overlap
+	 * OpalPciResetScope as OPAL v2 used the same
+	 * enum for both
+	 */
+	OPAL_REINIT_PCI_DEV =3D 1000
+};
+
+enum OpalPciResetState {
+	OPAL_DEASSERT_RESET =3D 0,
+	OPAL_ASSERT_RESET   =3D 1
+};
+
+enum OpalPciSlotPresence {
+	OPAL_PCI_SLOT_EMPTY	=3D 0,
+	OPAL_PCI_SLOT_PRESENT	=3D 1
+};
+
+enum OpalPciSlotPower {
+	OPAL_PCI_SLOT_POWER_OFF	=3D 0,
+	OPAL_PCI_SLOT_POWER_ON	=3D 1,
+	OPAL_PCI_SLOT_OFFLINE	=3D 2,
+	OPAL_PCI_SLOT_ONLINE	=3D 3
+};
+
+enum OpalSlotLedType {
+	OPAL_SLOT_LED_TYPE_ID =3D 0,	/* IDENTIFY LED */
+	OPAL_SLOT_LED_TYPE_FAULT =3D 1,	/* FAULT LED */
+	OPAL_SLOT_LED_TYPE_ATTN =3D 2,	/* System Attention LED */
+	OPAL_SLOT_LED_TYPE_MAX =3D 3
+};
+
+enum OpalSlotLedState {
+	OPAL_SLOT_LED_STATE_OFF =3D 0,	/* LED is OFF */
+	OPAL_SLOT_LED_STATE_ON =3D 1	/* LED is ON */
+};
+
+/*
+ * Address cycle types for LPC accesses. These also correspond
+ * to the content of the first cell of the "reg" property for
+ * device nodes on the LPC bus
+ */
+enum OpalLPCAddressType {
+	OPAL_LPC_MEM	=3D 0,
+	OPAL_LPC_IO	=3D 1,
+	OPAL_LPC_FW	=3D 2,
+};
+
+enum opal_msg_type {
+	OPAL_MSG_ASYNC_COMP	=3D 0,	/* params[0] =3D token, params[1] =3D rc,
+					 * additional params function-specific
+					 */
+	OPAL_MSG_MEM_ERR	=3D 1,
+	OPAL_MSG_EPOW		=3D 2,
+	OPAL_MSG_SHUTDOWN	=3D 3,	/* params[0] =3D 1 reboot, 0 shutdown */
+	OPAL_MSG_HMI_EVT	=3D 4,
+	OPAL_MSG_DPO		=3D 5,
+	OPAL_MSG_PRD		=3D 6,
+	OPAL_MSG_OCC		=3D 7,
+	OPAL_MSG_PRD2		=3D 8,
+	OPAL_MSG_TYPE_MAX,
+};
+
+struct opal_msg {
+	__be32 msg_type;
+	__be32 reserved;
+	__be64 params[8];
+};
+
+/* System parameter permission */
+enum OpalSysparamPerm {
+	OPAL_SYSPARAM_READ  =3D 0x1,
+	OPAL_SYSPARAM_WRITE =3D 0x2,
+	OPAL_SYSPARAM_RW    =3D (OPAL_SYSPARAM_READ | OPAL_SYSPARAM_WRITE),
+};
+
+enum {
+	OPAL_IPMI_MSG_FORMAT_VERSION_1 =3D 1,
+};
+
+struct opal_ipmi_msg {
+	uint8_t version;
+	uint8_t netfn;
+	uint8_t cmd;
+	uint8_t data[];
+};
+
+/* FSP memory errors handling */
+enum OpalMemErr_Version {
+	OpalMemErr_V1 =3D 1,
+};
+
+enum OpalMemErrType {
+	OPAL_MEM_ERR_TYPE_RESILIENCE	=3D 0,
+	OPAL_MEM_ERR_TYPE_DYN_DALLOC,
+};
+
+/* Memory Reilience error type */
+enum OpalMemErr_ResilErrType {
+	OPAL_MEM_RESILIENCE_CE		=3D 0,
+	OPAL_MEM_RESILIENCE_UE,
+	OPAL_MEM_RESILIENCE_UE_SCRUB,
+};
+
+/* Dynamic Memory Deallocation type */
+enum OpalMemErr_DynErrType {
+	OPAL_MEM_DYNAMIC_DEALLOC	=3D 0,
+};
+
+struct OpalMemoryErrorData {
+	enum OpalMemErr_Version	version:8;	/* 0x00 */
+	enum OpalMemErrType	type:8;		/* 0x01 */
+	__be16			flags;		/* 0x02 */
+	uint8_t			reserved_1[4];	/* 0x04 */
+
+	union {
+		/* Memory Resilience corrected/uncorrected error info */
+		struct {
+			enum OpalMemErr_ResilErrType	resil_err_type:8;
+			uint8_t				reserved_1[7];
+			__be64				physical_address_start;
+			__be64				physical_address_end;
+		} resilience;
+		/* Dynamic memory deallocation error info */
+		struct {
+			enum OpalMemErr_DynErrType	dyn_err_type:8;
+			uint8_t				reserved_1[7];
+			__be64				physical_address_start;
+			__be64				physical_address_end;
+		} dyn_dealloc;
+	} u;
+};
+
+/* HMI interrupt event */
+enum OpalHMI_Version {
+	OpalHMIEvt_V1 =3D 1,
+	OpalHMIEvt_V2 =3D 2,
+};
+
+enum OpalHMI_Severity {
+	OpalHMI_SEV_NO_ERROR =3D 0,
+	OpalHMI_SEV_WARNING =3D 1,
+	OpalHMI_SEV_ERROR_SYNC =3D 2,
+	OpalHMI_SEV_FATAL =3D 3,
+};
+
+enum OpalHMI_Disposition {
+	OpalHMI_DISPOSITION_RECOVERED =3D 0,
+	OpalHMI_DISPOSITION_NOT_RECOVERED =3D 1,
+};
+
+enum OpalHMI_ErrType {
+	OpalHMI_ERROR_MALFUNC_ALERT	=3D 0,
+	OpalHMI_ERROR_PROC_RECOV_DONE,
+	OpalHMI_ERROR_PROC_RECOV_DONE_AGAIN,
+	OpalHMI_ERROR_PROC_RECOV_MASKED,
+	OpalHMI_ERROR_TFAC,
+	OpalHMI_ERROR_TFMR_PARITY,
+	OpalHMI_ERROR_HA_OVERFLOW_WARN,
+	OpalHMI_ERROR_XSCOM_FAIL,
+	OpalHMI_ERROR_XSCOM_DONE,
+	OpalHMI_ERROR_SCOM_FIR,
+	OpalHMI_ERROR_DEBUG_TRIG_FIR,
+	OpalHMI_ERROR_HYP_RESOURCE,
+	OpalHMI_ERROR_CAPP_RECOVERY,
+};
+
+enum OpalHMI_XstopType {
+	CHECKSTOP_TYPE_UNKNOWN	=3D	0,
+	CHECKSTOP_TYPE_CORE	=3D	1,
+	CHECKSTOP_TYPE_NX	=3D	2,
+	CHECKSTOP_TYPE_NPU	=3D	3
+};
+
+enum OpalHMI_CoreXstopReason {
+	CORE_CHECKSTOP_IFU_REGFILE		=3D 0x00000001,
+	CORE_CHECKSTOP_IFU_LOGIC		=3D 0x00000002,
+	CORE_CHECKSTOP_PC_DURING_RECOV		=3D 0x00000004,
+	CORE_CHECKSTOP_ISU_REGFILE		=3D 0x00000008,
+	CORE_CHECKSTOP_ISU_LOGIC		=3D 0x00000010,
+	CORE_CHECKSTOP_FXU_LOGIC		=3D 0x00000020,
+	CORE_CHECKSTOP_VSU_LOGIC		=3D 0x00000040,
+	CORE_CHECKSTOP_PC_RECOV_IN_MAINT_MODE	=3D 0x00000080,
+	CORE_CHECKSTOP_LSU_REGFILE		=3D 0x00000100,
+	CORE_CHECKSTOP_PC_FWD_PROGRESS		=3D 0x00000200,
+	CORE_CHECKSTOP_LSU_LOGIC		=3D 0x00000400,
+	CORE_CHECKSTOP_PC_LOGIC			=3D 0x00000800,
+	CORE_CHECKSTOP_PC_HYP_RESOURCE		=3D 0x00001000,
+	CORE_CHECKSTOP_PC_HANG_RECOV_FAILED	=3D 0x00002000,
+	CORE_CHECKSTOP_PC_AMBI_HANG_DETECTED	=3D 0x00004000,
+	CORE_CHECKSTOP_PC_DEBUG_TRIG_ERR_INJ	=3D 0x00008000,
+	CORE_CHECKSTOP_PC_SPRD_HYP_ERR_INJ	=3D 0x00010000,
+};
+
+enum OpalHMI_NestAccelXstopReason {
+	NX_CHECKSTOP_SHM_INVAL_STATE_ERR	=3D 0x00000001,
+	NX_CHECKSTOP_DMA_INVAL_STATE_ERR_1	=3D 0x00000002,
+	NX_CHECKSTOP_DMA_INVAL_STATE_ERR_2	=3D 0x00000004,
+	NX_CHECKSTOP_DMA_CH0_INVAL_STATE_ERR	=3D 0x00000008,
+	NX_CHECKSTOP_DMA_CH1_INVAL_STATE_ERR	=3D 0x00000010,
+	NX_CHECKSTOP_DMA_CH2_INVAL_STATE_ERR	=3D 0x00000020,
+	NX_CHECKSTOP_DMA_CH3_INVAL_STATE_ERR	=3D 0x00000040,
+	NX_CHECKSTOP_DMA_CH4_INVAL_STATE_ERR	=3D 0x00000080,
+	NX_CHECKSTOP_DMA_CH5_INVAL_STATE_ERR	=3D 0x00000100,
+	NX_CHECKSTOP_DMA_CH6_INVAL_STATE_ERR	=3D 0x00000200,
+	NX_CHECKSTOP_DMA_CH7_INVAL_STATE_ERR	=3D 0x00000400,
+	NX_CHECKSTOP_DMA_CRB_UE			=3D 0x00000800,
+	NX_CHECKSTOP_DMA_CRB_SUE		=3D 0x00001000,
+	NX_CHECKSTOP_PBI_ISN_UE			=3D 0x00002000,
+};
+
+struct OpalHMIEvent {
+	uint8_t		version;	/* 0x00 */
+	uint8_t		severity;	/* 0x01 */
+	uint8_t		type;		/* 0x02 */
+	uint8_t		disposition;	/* 0x03 */
+	uint8_t		reserved_1[4];	/* 0x04 */
+
+	__be64		hmer;
+	/* TFMR register. Valid only for TFAC and TFMR_PARITY error type. */
+	__be64		tfmr;
+
+	/* version 2 and later */
+	union {
+		/*
+		 * checkstop info (Core/NX).
+		 * Valid for OpalHMI_ERROR_MALFUNC_ALERT.
+		 */
+		struct {
+			uint8_t	xstop_type;	/* enum OpalHMI_XstopType */
+			uint8_t reserved_1[3];
+			__be32  xstop_reason;
+			union {
+				__be32 pir;	/* for CHECKSTOP_TYPE_CORE */
+				__be32 chip_id;	/* for CHECKSTOP_TYPE_NX */
+			} u;
+		} xstop_error;
+	} u;
+};
+
+/* OPAL_HANDLE_HMI2 out_flags */
+enum {
+	OPAL_HMI_FLAGS_TB_RESYNC	=3D (1ull << 0), /* Timebase has been resynced=
 */
+	OPAL_HMI_FLAGS_DEC_LOST		=3D (1ull << 1), /* DEC lost, needs to be repr=
ogrammed */
+	OPAL_HMI_FLAGS_HDEC_LOST	=3D (1ull << 2), /* HDEC lost, needs to be rep=
rogrammed */
+	OPAL_HMI_FLAGS_TOD_TB_FAIL	=3D (1ull << 3), /* TOD/TB recovery failed. =
*/
+	OPAL_HMI_FLAGS_NEW_EVENT	=3D (1ull << 63), /* An event has been created=
 */
+};
+
+enum {
+	OPAL_P7IOC_DIAG_TYPE_NONE	=3D 0,
+	OPAL_P7IOC_DIAG_TYPE_RGC	=3D 1,
+	OPAL_P7IOC_DIAG_TYPE_BI		=3D 2,
+	OPAL_P7IOC_DIAG_TYPE_CI		=3D 3,
+	OPAL_P7IOC_DIAG_TYPE_MISC	=3D 4,
+	OPAL_P7IOC_DIAG_TYPE_I2C	=3D 5,
+	OPAL_P7IOC_DIAG_TYPE_LAST	=3D 6
+};
+
+struct OpalIoP7IOCErrorData {
+	__be16 type;
+
+	/* GEM */
+	__be64 gemXfir;
+	__be64 gemRfir;
+	__be64 gemRirqfir;
+	__be64 gemMask;
+	__be64 gemRwof;
+
+	/* LEM */
+	__be64 lemFir;
+	__be64 lemErrMask;
+	__be64 lemAction0;
+	__be64 lemAction1;
+	__be64 lemWof;
+
+	union {
+		struct OpalIoP7IOCRgcErrorData {
+			__be64 rgcStatus;	/* 3E1C10 */
+			__be64 rgcLdcp;		/* 3E1C18 */
+		}rgc;
+		struct OpalIoP7IOCBiErrorData {
+			__be64 biLdcp0;		/* 3C0100, 3C0118 */
+			__be64 biLdcp1;		/* 3C0108, 3C0120 */
+			__be64 biLdcp2;		/* 3C0110, 3C0128 */
+			__be64 biFenceStatus;	/* 3C0130, 3C0130 */
+
+			uint8_t biDownbound;	/* BI Downbound or Upbound */
+		}bi;
+		struct OpalIoP7IOCCiErrorData {
+			__be64 ciPortStatus;	/* 3Dn008 */
+			__be64 ciPortLdcp;	/* 3Dn010 */
+
+			uint8_t ciPort;		/* Index of CI port: 0/1 */
+		}ci;
+	};
+};
+
+/**
+ * This structure defines the overlay which will be used to store PHB er=
ror
+ * data upon request.
+ */
+enum {
+	OPAL_PHB_ERROR_DATA_VERSION_1 =3D 1,
+};
+
+enum {
+	OPAL_PHB_ERROR_DATA_TYPE_P7IOC =3D 1,
+	OPAL_PHB_ERROR_DATA_TYPE_PHB3 =3D 2,
+	OPAL_PHB_ERROR_DATA_TYPE_PHB4 =3D 3
+};
+
+enum {
+	OPAL_P7IOC_NUM_PEST_REGS =3D 128,
+	OPAL_PHB3_NUM_PEST_REGS =3D 256,
+	OPAL_PHB4_NUM_PEST_REGS =3D 512
+};
+
+struct OpalIoPhbErrorCommon {
+	__be32 version;
+	__be32 ioType;
+	__be32 len;
+};
+
+struct OpalIoP7IOCPhbErrorData {
+	struct OpalIoPhbErrorCommon common;
+
+	__be32 brdgCtl;
+
+	// P7IOC utl regs
+	__be32 portStatusReg;
+	__be32 rootCmplxStatus;
+	__be32 busAgentStatus;
+
+	// P7IOC cfg regs
+	__be32 deviceStatus;
+	__be32 slotStatus;
+	__be32 linkStatus;
+	__be32 devCmdStatus;
+	__be32 devSecStatus;
+
+	// cfg AER regs
+	__be32 rootErrorStatus;
+	__be32 uncorrErrorStatus;
+	__be32 corrErrorStatus;
+	__be32 tlpHdr1;
+	__be32 tlpHdr2;
+	__be32 tlpHdr3;
+	__be32 tlpHdr4;
+	__be32 sourceId;
+
+	__be32 rsv3;
+
+	// Record data about the call to allocate a buffer.
+	__be64 errorClass;
+	__be64 correlator;
+
+	//P7IOC MMIO Error Regs
+	__be64 p7iocPlssr;                // n120
+	__be64 p7iocCsr;                  // n110
+	__be64 lemFir;                    // nC00
+	__be64 lemErrorMask;              // nC18
+	__be64 lemWOF;                    // nC40
+	__be64 phbErrorStatus;            // nC80
+	__be64 phbFirstErrorStatus;       // nC88
+	__be64 phbErrorLog0;              // nCC0
+	__be64 phbErrorLog1;              // nCC8
+	__be64 mmioErrorStatus;           // nD00
+	__be64 mmioFirstErrorStatus;      // nD08
+	__be64 mmioErrorLog0;             // nD40
+	__be64 mmioErrorLog1;             // nD48
+	__be64 dma0ErrorStatus;           // nD80
+	__be64 dma0FirstErrorStatus;      // nD88
+	__be64 dma0ErrorLog0;             // nDC0
+	__be64 dma0ErrorLog1;             // nDC8
+	__be64 dma1ErrorStatus;           // nE00
+	__be64 dma1FirstErrorStatus;      // nE08
+	__be64 dma1ErrorLog0;             // nE40
+	__be64 dma1ErrorLog1;             // nE48
+	__be64 pestA[OPAL_P7IOC_NUM_PEST_REGS];
+	__be64 pestB[OPAL_P7IOC_NUM_PEST_REGS];
+};
+
+struct OpalIoPhb3ErrorData {
+	struct OpalIoPhbErrorCommon common;
+
+	__be32 brdgCtl;
+
+	/* PHB3 UTL regs */
+	__be32 portStatusReg;
+	__be32 rootCmplxStatus;
+	__be32 busAgentStatus;
+
+	/* PHB3 cfg regs */
+	__be32 deviceStatus;
+	__be32 slotStatus;
+	__be32 linkStatus;
+	__be32 devCmdStatus;
+	__be32 devSecStatus;
+
+	/* cfg AER regs */
+	__be32 rootErrorStatus;
+	__be32 uncorrErrorStatus;
+	__be32 corrErrorStatus;
+	__be32 tlpHdr1;
+	__be32 tlpHdr2;
+	__be32 tlpHdr3;
+	__be32 tlpHdr4;
+	__be32 sourceId;
+
+	__be32 rsv3;
+
+	/* Record data about the call to allocate a buffer */
+	__be64 errorClass;
+	__be64 correlator;
+
+	/* PHB3 MMIO Error Regs */
+	__be64 nFir;			/* 000 */
+	__be64 nFirMask;		/* 003 */
+	__be64 nFirWOF;		/* 008 */
+	__be64 phbPlssr;		/* 120 */
+	__be64 phbCsr;		/* 110 */
+	__be64 lemFir;		/* C00 */
+	__be64 lemErrorMask;		/* C18 */
+	__be64 lemWOF;		/* C40 */
+	__be64 phbErrorStatus;	/* C80 */
+	__be64 phbFirstErrorStatus;	/* C88 */
+	__be64 phbErrorLog0;		/* CC0 */
+	__be64 phbErrorLog1;		/* CC8 */
+	__be64 mmioErrorStatus;	/* D00 */
+	__be64 mmioFirstErrorStatus;	/* D08 */
+	__be64 mmioErrorLog0;		/* D40 */
+	__be64 mmioErrorLog1;		/* D48 */
+	__be64 dma0ErrorStatus;	/* D80 */
+	__be64 dma0FirstErrorStatus;	/* D88 */
+	__be64 dma0ErrorLog0;		/* DC0 */
+	__be64 dma0ErrorLog1;		/* DC8 */
+	__be64 dma1ErrorStatus;	/* E00 */
+	__be64 dma1FirstErrorStatus;	/* E08 */
+	__be64 dma1ErrorLog0;		/* E40 */
+	__be64 dma1ErrorLog1;		/* E48 */
+	__be64 pestA[OPAL_PHB3_NUM_PEST_REGS];
+	__be64 pestB[OPAL_PHB3_NUM_PEST_REGS];
+};
+
+struct OpalIoPhb4ErrorData {
+	struct OpalIoPhbErrorCommon common;
+
+	__be32 brdgCtl;
+
+	/* PHB4 cfg regs */
+	__be32 deviceStatus;
+	__be32 slotStatus;
+	__be32 linkStatus;
+	__be32 devCmdStatus;
+	__be32 devSecStatus;
+
+	/* cfg AER regs */
+	__be32 rootErrorStatus;
+	__be32 uncorrErrorStatus;
+	__be32 corrErrorStatus;
+	__be32 tlpHdr1;
+	__be32 tlpHdr2;
+	__be32 tlpHdr3;
+	__be32 tlpHdr4;
+	__be32 sourceId;
+
+	/* PHB4 ETU Error Regs */
+	__be64 nFir;				/* 000 */
+	__be64 nFirMask;			/* 003 */
+	__be64 nFirWOF;				/* 008 */
+	__be64 phbPlssr;			/* 120 */
+	__be64 phbCsr;				/* 110 */
+	__be64 lemFir;				/* C00 */
+	__be64 lemErrorMask;			/* C18 */
+	__be64 lemWOF;				/* C40 */
+	__be64 phbErrorStatus;			/* C80 */
+	__be64 phbFirstErrorStatus;		/* C88 */
+	__be64 phbErrorLog0;			/* CC0 */
+	__be64 phbErrorLog1;			/* CC8 */
+	__be64 phbTxeErrorStatus;		/* D00 */
+	__be64 phbTxeFirstErrorStatus;		/* D08 */
+	__be64 phbTxeErrorLog0;			/* D40 */
+	__be64 phbTxeErrorLog1;			/* D48 */
+	__be64 phbRxeArbErrorStatus;		/* D80 */
+	__be64 phbRxeArbFirstErrorStatus;	/* D88 */
+	__be64 phbRxeArbErrorLog0;		/* DC0 */
+	__be64 phbRxeArbErrorLog1;		/* DC8 */
+	__be64 phbRxeMrgErrorStatus;		/* E00 */
+	__be64 phbRxeMrgFirstErrorStatus;	/* E08 */
+	__be64 phbRxeMrgErrorLog0;		/* E40 */
+	__be64 phbRxeMrgErrorLog1;		/* E48 */
+	__be64 phbRxeTceErrorStatus;		/* E80 */
+	__be64 phbRxeTceFirstErrorStatus;	/* E88 */
+	__be64 phbRxeTceErrorLog0;		/* EC0 */
+	__be64 phbRxeTceErrorLog1;		/* EC8 */
+
+	/* PHB4 REGB Error Regs */
+	__be64 phbPblErrorStatus;		/* 1900 */
+	__be64 phbPblFirstErrorStatus;		/* 1908 */
+	__be64 phbPblErrorLog0;			/* 1940 */
+	__be64 phbPblErrorLog1;			/* 1948 */
+	__be64 phbPcieDlpErrorLog1;		/* 1AA0 */
+	__be64 phbPcieDlpErrorLog2;		/* 1AA8 */
+	__be64 phbPcieDlpErrorStatus;		/* 1AB0 */
+	__be64 phbRegbErrorStatus;		/* 1C00 */
+	__be64 phbRegbFirstErrorStatus;		/* 1C08 */
+	__be64 phbRegbErrorLog0;		/* 1C40 */
+	__be64 phbRegbErrorLog1;		/* 1C48 */
+
+	__be64 pestA[OPAL_PHB4_NUM_PEST_REGS];
+	__be64 pestB[OPAL_PHB4_NUM_PEST_REGS];
+};
+
+enum {
+	OPAL_REINIT_CPUS_HILE_BE	=3D (1 << 0),
+	OPAL_REINIT_CPUS_HILE_LE	=3D (1 << 1),
+
+	/* These two define the base MMU mode of the host on P9
+	 *
+	 * On P9 Nimbus DD2.0 and Cumlus (and later), KVM can still
+	 * create hash guests in "radix" mode with care (full core
+	 * switch only).
+	 */
+	OPAL_REINIT_CPUS_MMU_HASH	=3D (1 << 2),
+	OPAL_REINIT_CPUS_MMU_RADIX	=3D (1 << 3),
+
+	OPAL_REINIT_CPUS_TM_SUSPEND_DISABLED =3D (1 << 4),
+};
+
+typedef struct oppanel_line {
+	__be64 line;
+	__be64 line_len;
+} oppanel_line_t;
+
+enum opal_prd_msg_type {
+	OPAL_PRD_MSG_TYPE_INIT =3D 0,	/* HBRT --> OPAL */
+	OPAL_PRD_MSG_TYPE_FINI,		/* HBRT/kernel --> OPAL */
+	OPAL_PRD_MSG_TYPE_ATTN,		/* HBRT <-- OPAL */
+	OPAL_PRD_MSG_TYPE_ATTN_ACK,	/* HBRT --> OPAL */
+	OPAL_PRD_MSG_TYPE_OCC_ERROR,	/* HBRT <-- OPAL */
+	OPAL_PRD_MSG_TYPE_OCC_RESET,	/* HBRT <-- OPAL */
+};
+
+struct opal_prd_msg_header {
+	uint8_t		type;
+	uint8_t		pad[1];
+	__be16		size;
+};
+
+struct opal_prd_msg;
+
+#define OCC_RESET                       0
+#define OCC_LOAD                        1
+#define OCC_THROTTLE                    2
+#define OCC_MAX_THROTTLE_STATUS         5
+
+struct opal_occ_msg {
+	__be64 type;
+	__be64 chip;
+	__be64 throttle_status;
+};
+
+/*
+ * SG entries
+ *
+ * WARNING: The current implementation requires each entry
+ * to represent a block that is 4k aligned *and* each block
+ * size except the last one in the list to be as well.
+ */
+struct opal_sg_entry {
+	__be64 data;
+	__be64 length;
+};
+
+/*
+ * Candidate image SG list.
+ *
+ * length =3D VER | length
+ */
+struct opal_sg_list {
+	__be64 length;
+	__be64 next;
+	struct opal_sg_entry entry[];
+};
+
+/*
+ * Dump region ID range usable by the OS
+ */
+#define OPAL_DUMP_REGION_HOST_START		0x80
+#define OPAL_DUMP_REGION_LOG_BUF		0x80
+#define OPAL_DUMP_REGION_HOST_END		0xFF
+
+/* CAPI modes for PHB */
+enum {
+	OPAL_PHB_CAPI_MODE_PCIE		=3D 0,
+	OPAL_PHB_CAPI_MODE_CAPI		=3D 1,
+	OPAL_PHB_CAPI_MODE_SNOOP_OFF    =3D 2,
+	OPAL_PHB_CAPI_MODE_SNOOP_ON	=3D 3,
+	OPAL_PHB_CAPI_MODE_DMA		=3D 4,
+	OPAL_PHB_CAPI_MODE_DMA_TVT1	=3D 5,
+};
+
+/* OPAL I2C request */
+struct opal_i2c_request {
+	uint8_t	type;
+#define OPAL_I2C_RAW_READ	0
+#define OPAL_I2C_RAW_WRITE	1
+#define OPAL_I2C_SM_READ	2
+#define OPAL_I2C_SM_WRITE	3
+	uint8_t flags;
+#define OPAL_I2C_ADDR_10	0x01	/* Not supported yet */
+	uint8_t	subaddr_sz;		/* Max 4 */
+	uint8_t reserved;
+	__be16 addr;			/* 7 or 10 bit address */
+	__be16 reserved2;
+	__be32 subaddr;		/* Sub-address if any */
+	__be32 size;			/* Data size */
+	__be64 buffer_ra;		/* Buffer real address */
+};
+
+/*
+ * EPOW status sharing (OPAL and the host)
+ *
+ * The host will pass on OPAL, a buffer of length OPAL_SYSEPOW_MAX
+ * with individual elements being 16 bits wide to fetch the system
+ * wide EPOW status. Each element in the buffer will contain the
+ * EPOW status in it's bit representation for a particular EPOW sub
+ * class as defined here. So multiple detailed EPOW status bits
+ * specific for any sub class can be represented in a single buffer
+ * element as it's bit representation.
+ */
+
+/* System EPOW type */
+enum OpalSysEpow {
+	OPAL_SYSEPOW_POWER	=3D 0,	/* Power EPOW */
+	OPAL_SYSEPOW_TEMP	=3D 1,	/* Temperature EPOW */
+	OPAL_SYSEPOW_COOLING	=3D 2,	/* Cooling EPOW */
+	OPAL_SYSEPOW_MAX	=3D 3,	/* Max EPOW categories */
+};
+
+/* Power EPOW */
+enum OpalSysPower {
+	OPAL_SYSPOWER_UPS	=3D 0x0001, /* System on UPS power */
+	OPAL_SYSPOWER_CHNG	=3D 0x0002, /* System power config change */
+	OPAL_SYSPOWER_FAIL	=3D 0x0004, /* System impending power failure */
+	OPAL_SYSPOWER_INCL	=3D 0x0008, /* System incomplete power */
+};
+
+/* Temperature EPOW */
+enum OpalSysTemp {
+	OPAL_SYSTEMP_AMB	=3D 0x0001, /* System over ambient temperature */
+	OPAL_SYSTEMP_INT	=3D 0x0002, /* System over internal temperature */
+	OPAL_SYSTEMP_HMD	=3D 0x0004, /* System over ambient humidity */
+};
+
+/* Cooling EPOW */
+enum OpalSysCooling {
+	OPAL_SYSCOOL_INSF	=3D 0x0001, /* System insufficient cooling */
+};
+
+/* Argument to OPAL_CEC_REBOOT2() */
+enum {
+	OPAL_REBOOT_NORMAL		=3D 0,
+	OPAL_REBOOT_PLATFORM_ERROR	=3D 1,
+	OPAL_REBOOT_FULL_IPL		=3D 2,
+	OPAL_REBOOT_MPIPL		=3D 3,
+	OPAL_REBOOT_FAST		=3D 4,
+};
+
+/* Argument to OPAL_PCI_TCE_KILL */
+enum {
+	OPAL_PCI_TCE_KILL_PAGES,
+	OPAL_PCI_TCE_KILL_PE,
+	OPAL_PCI_TCE_KILL_ALL,
+};
+
+/* The xive operation mode indicates the active "API" and
+ * corresponds to the "mode" parameter of the opal_xive_reset()
+ * call
+ */
+enum {
+	OPAL_XIVE_MODE_EMU	=3D 0,
+	OPAL_XIVE_MODE_EXPL	=3D 1,
+};
+
+/* Flags for OPAL_XIVE_GET_IRQ_INFO */
+enum {
+	OPAL_XIVE_IRQ_TRIGGER_PAGE	=3D 0x00000001,
+	OPAL_XIVE_IRQ_STORE_EOI		=3D 0x00000002,
+	OPAL_XIVE_IRQ_LSI		=3D 0x00000004,
+	OPAL_XIVE_IRQ_SHIFT_BUG		=3D 0x00000008, /* P9 DD1.0 workaround */
+	OPAL_XIVE_IRQ_MASK_VIA_FW	=3D 0x00000010, /* P9 DD1.0 workaround */
+	OPAL_XIVE_IRQ_EOI_VIA_FW	=3D 0x00000020, /* P9 DD1.0 workaround */
+	OPAL_XIVE_IRQ_STORE_EOI2	=3D 0x00000040,
+};
+
+/* Flags for OPAL_XIVE_GET/SET_QUEUE_INFO */
+enum {
+	OPAL_XIVE_EQ_ENABLED		=3D 0x00000001,
+	OPAL_XIVE_EQ_ALWAYS_NOTIFY	=3D 0x00000002,
+	OPAL_XIVE_EQ_ESCALATE		=3D 0x00000004,
+};
+
+/* Flags for OPAL_XIVE_GET/SET_VP_INFO */
+enum {
+	OPAL_XIVE_VP_ENABLED		=3D 0x00000001,
+	OPAL_XIVE_VP_SINGLE_ESCALATION	=3D 0x00000002,
+};
+
+/* "Any chip" replacement for chip ID for allocation functions */
+enum {
+	OPAL_XIVE_ANY_CHIP		=3D 0xffffffff,
+};
+
+/* Xive sync options */
+enum {
+	/* This bits are cumulative, arg is a girq */
+	XIVE_SYNC_EAS			=3D 0x00000001, /* Sync irq source */
+	XIVE_SYNC_QUEUE			=3D 0x00000002, /* Sync irq target */
+};
+
+/* Dump options */
+enum {
+	XIVE_DUMP_TM_HYP	=3D 0,
+	XIVE_DUMP_TM_POOL	=3D 1,
+	XIVE_DUMP_TM_OS		=3D 2,
+	XIVE_DUMP_TM_USER	=3D 3,
+	XIVE_DUMP_VP		=3D 4,
+	XIVE_DUMP_EMU_STATE	=3D 5,
+};
+
+/* "type" argument options for OPAL_IMC_COUNTERS_* calls */
+enum {
+	OPAL_IMC_COUNTERS_NEST =3D 1,
+	OPAL_IMC_COUNTERS_CORE =3D 2,
+	OPAL_IMC_COUNTERS_TRACE =3D 3,
+};
+
+
+/* PCI p2p descriptor */
+#define OPAL_PCI_P2P_ENABLE		0x1
+#define OPAL_PCI_P2P_LOAD		0x2
+#define OPAL_PCI_P2P_STORE		0x4
+
+/* MPIPL update operations */
+enum opal_mpipl_ops {
+	OPAL_MPIPL_ADD_RANGE			=3D 0,
+	OPAL_MPIPL_REMOVE_RANGE			=3D 1,
+	OPAL_MPIPL_REMOVE_ALL			=3D 2,
+	OPAL_MPIPL_FREE_PRESERVED_MEMORY	=3D 3,
+};
+
+/* Tag will point to various metadata area. Kernel will
+ * use tag to get metadata value.
+ */
+enum opal_mpipl_tags {
+	OPAL_MPIPL_TAG_CPU	=3D 0,
+	OPAL_MPIPL_TAG_OPAL	=3D 1,
+	OPAL_MPIPL_TAG_KERNEL	=3D 2,
+	OPAL_MPIPL_TAG_BOOT_MEM	=3D 3,
+};
+
+/* Preserved memory details */
+struct opal_mpipl_region {
+	__be64	src;
+	__be64	dest;
+	__be64	size;
+};
+
+/* Structure version */
+#define OPAL_MPIPL_VERSION		0x01
+
+struct opal_mpipl_fadump {
+	u8	version;
+	u8	reserved[7];
+	__be32	crashing_pir;	/* OPAL crashing CPU PIR */
+	__be32	cpu_data_version;
+	__be32	cpu_data_size;
+	__be32	region_cnt;
+	struct	opal_mpipl_region region[];
+} __packed;
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* __OPAL_API_H */
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 21:35:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 21:35:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571585.895804 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPV7S-0000MR-2y; Fri, 28 Jul 2023 21:35:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571585.895804; Fri, 28 Jul 2023 21:35:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPV7R-0000L5-UA; Fri, 28 Jul 2023 21:35:29 +0000
Received: by outflank-mailman (input) for mailman id 571585;
 Fri, 28 Jul 2023 21:35:28 +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
 <SRS0=/sdN=DO=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qPV7Q-0000AZ-N0
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 21:35:28 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a9f4dafd-2d8e-11ee-8613-37d641c3527e;
 Fri, 28 Jul 2023 23:35:26 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 4F1188285971;
 Fri, 28 Jul 2023 16:35:25 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id Cqo4JByJ009P; Fri, 28 Jul 2023 16:35:24 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 4BA508285ABC;
 Fri, 28 Jul 2023 16:35:24 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id PytXXoT69_jJ; Fri, 28 Jul 2023 16:35:24 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id D6654828593C;
 Fri, 28 Jul 2023 16:35:23 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a9f4dafd-2d8e-11ee-8613-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 4BA508285ABC
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1690580124; bh=UWQTPyF4UWlpKIe0TYSOcn8onLmEFvDdX4LeU0YnQqo=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=DwBMFLKBvGWbth6zu4E+8Y1+TV1O/OpDkuavFqc6YnZwrfGAqvEGSPAFrdP5o/66L
	 SGYg5Cy08tN1ItgEP2DCFKkwD6i7B7wtzBgRLV9+6HtcgIZ+N2DIMnm5xTjpGXlSqE
	 zIAZ6AYr4r/EPSDaro2646XFSinvGMvW7rtVjaXI=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH 4/5] xen/ppc: Parse device tree for OPAL node on PowerNV
Date: Fri, 28 Jul 2023 16:35:09 -0500
Message-Id: <fc4011f42ea017ec9ae12c4f1a0c1a09b7bbcfc8.1690579561.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1690579561.git.sanastasio@raptorengineering.com>
References: <cover.1690579561.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Communication with firmware boot services on PowerNV requires parsing
the fdt blob passed by the bootloader in order to obtain the firmware
entrypoint. Use Xen's libfdt to do this and store the information
required for firmware calls, to be implemented in a future patch.

The full xen/common build doesn't yet work, but libfdt and its xen/lib
dependency can be made to build by defining a few stub headers.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/ppc/Kconfig                 |  1 +
 xen/arch/ppc/Makefile                |  1 +
 xen/arch/ppc/arch.mk                 |  4 +--
 xen/arch/ppc/include/asm/boot.h      | 16 +++++++++-
 xen/arch/ppc/include/asm/bug.h       | 18 +++++++++++
 xen/arch/ppc/include/asm/cache.h     |  6 ++++
 xen/arch/ppc/include/asm/processor.h | 13 +++++++-
 xen/arch/ppc/include/asm/string.h    |  6 ++++
 xen/arch/ppc/include/asm/system.h    |  6 ++++
 xen/arch/ppc/opal.c                  | 48 ++++++++++++++++++++++++++++
 xen/arch/ppc/setup.c                 |  9 ++++--
 11 files changed, 122 insertions(+), 6 deletions(-)
 create mode 100644 xen/arch/ppc/include/asm/bug.h
 create mode 100644 xen/arch/ppc/include/asm/cache.h
 create mode 100644 xen/arch/ppc/include/asm/string.h
 create mode 100644 xen/arch/ppc/include/asm/system.h
 create mode 100644 xen/arch/ppc/opal.c

diff --git a/xen/arch/ppc/Kconfig b/xen/arch/ppc/Kconfig
index a2ade2ecf4..b32dce39b8 100644
--- a/xen/arch/ppc/Kconfig
+++ b/xen/arch/ppc/Kconfig
@@ -1,5 +1,6 @@
 config PPC
 	def_bool y
+	select HAS_DEVICE_TREE
=20
 config PPC64
 	def_bool y
diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index 098a4dd0a9..0c0a7884a1 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -2,6 +2,7 @@ obj-$(CONFIG_PPC64) +=3D ppc64/
=20
 obj-y +=3D boot-of.init.o
 obj-$(CONFIG_EARLY_PRINTK) +=3D early_printk.init.o
+obj-y +=3D opal.o
 obj-y +=3D setup.o
=20
 $(TARGET): $(TARGET)-syms
diff --git a/xen/arch/ppc/arch.mk b/xen/arch/ppc/arch.mk
index 0183b9ac6a..9f66f7a57b 100644
--- a/xen/arch/ppc/arch.mk
+++ b/xen/arch/ppc/arch.mk
@@ -10,5 +10,5 @@ CFLAGS +=3D -mstrict-align -mcmodel=3Dmedium -mabi=3Del=
fv2 -fPIC -mno-altivec -mno-vsx
 LDFLAGS +=3D -m elf64lppc
=20
 # TODO: Drop override when more of the build is working
-override ALL_OBJS-y =3D arch/$(SRCARCH)/built_in.o
-override ALL_LIBS-y =3D
+override ALL_OBJS-y =3D arch/$(SRCARCH)/built_in.o common/libfdt/built_i=
n.o lib/built_in.o
+override ALL_LIBS-y =3D lib/lib.a
diff --git a/xen/arch/ppc/include/asm/boot.h b/xen/arch/ppc/include/asm/b=
oot.h
index 9b8a7c43c2..296539cd9e 100644
--- a/xen/arch/ppc/include/asm/boot.h
+++ b/xen/arch/ppc/include/asm/boot.h
@@ -4,7 +4,10 @@
=20
 #include <xen/types.h>
=20
-/* a collection of interfaces used during boot. */
+/*
+ * OpenFirmware boot interfaces
+ */
+
 enum {
     OF_FAILURE =3D -1,
     OF_SUCCESS =3D 0,
@@ -20,4 +23,15 @@ struct of_service {
 int enter_of(struct of_service *args, unsigned long entry);
 void boot_of_init(unsigned long vec);
=20
+/*
+ * OPAL boot interfaces
+ */
+
+struct opal {
+    uint64_t base;
+    uint64_t entry;
+};
+
+void boot_opal_init(const void *fdt);
+
 #endif /* _ASM_PPC_BOOT_H */
diff --git a/xen/arch/ppc/include/asm/bug.h b/xen/arch/ppc/include/asm/bu=
g.h
new file mode 100644
index 0000000000..e5e874b31c
--- /dev/null
+++ b/xen/arch/ppc/include/asm/bug.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef _ASM_PPC_BUG_H
+#define _ASM_PPC_BUG_H
+
+#include <xen/stringify.h>
+
+/*
+ * Power ISA guarantees that an instruction consisting of all zeroes is
+ * illegal.
+ */
+#define BUG_OPCODE  0x00000000
+
+#define BUG_INSTR ".long " __stringify(BUG_OPCODE)
+
+#define BUG_FN_REG r0
+
+#endif /* _ASM_PPC_BUG_H */
diff --git a/xen/arch/ppc/include/asm/cache.h b/xen/arch/ppc/include/asm/=
cache.h
new file mode 100644
index 0000000000..8a0a6b7b17
--- /dev/null
+++ b/xen/arch/ppc/include/asm/cache.h
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef _ASM_PPC_CACHE_H
+#define _ASM_PPC_CACHE_H
+
+#endif /* _ASM_PPC_CACHE_H */
diff --git a/xen/arch/ppc/include/asm/processor.h b/xen/arch/ppc/include/=
asm/processor.h
index 838d279508..2300640787 100644
--- a/xen/arch/ppc/include/asm/processor.h
+++ b/xen/arch/ppc/include/asm/processor.h
@@ -133,6 +133,17 @@ struct cpu_user_regs
     uint32_t entry_vector;
 };
=20
-#endif
+/*
+ * panic() isn't available at the moment so an infinite loop will be
+ * used temporarily.
+ * TODO: change it to panic()
+ */
+static inline void noreturn die(void)
+{
+    for ( ; ; )
+        HMT_very_low();
+}
+
+#endif /* __ASSEMBLY__ */
=20
 #endif /* _ASM_PPC_PROCESSOR_H */
diff --git a/xen/arch/ppc/include/asm/string.h b/xen/arch/ppc/include/asm=
/string.h
new file mode 100644
index 0000000000..7a420e05e4
--- /dev/null
+++ b/xen/arch/ppc/include/asm/string.h
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef _ASM_PPC_STRING_H
+#define _ASM_PPC_STRING_H
+
+#endif /* _ASM_PPC_STRING_H */
diff --git a/xen/arch/ppc/include/asm/system.h b/xen/arch/ppc/include/asm=
/system.h
new file mode 100644
index 0000000000..94091df644
--- /dev/null
+++ b/xen/arch/ppc/include/asm/system.h
@@ -0,0 +1,6 @@
+#ifndef _ASM_SYSTEM_H_
+#define _ASM_SYSTEM_H_
+
+#define smp_wmb() __asm__ __volatile__ ( "lwsync" : : : "memory" )
+
+#endif /* _ASM_SYSTEM_H */
diff --git a/xen/arch/ppc/opal.c b/xen/arch/ppc/opal.c
new file mode 100644
index 0000000000..251de8ac23
--- /dev/null
+++ b/xen/arch/ppc/opal.c
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#include <asm/boot.h>
+#include <asm/early_printk.h>
+#include <asm/opal-api.h>
+#include <asm/processor.h>
+#include <xen/types.h>
+#include <xen/libfdt/libfdt.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+
+/* Global OPAL struct containing entrypoint and base */
+struct opal opal;
+
+void __init boot_opal_init(const void *fdt)
+{
+    int opal_node;
+    const __be64 *opal_base;
+    const __be64 *opal_entry;
+
+    if ( fdt_check_header(fdt) < 0 )
+    {
+        /*
+         * NOTE: This won't actually print since the early serial
+         * console isn't set up yet.
+         */
+        early_printk("Booted without valid FDT pointer in r3!\n");
+        die();
+    }
+
+    opal_node =3D fdt_path_offset(fdt, "/ibm,opal");
+    if ( opal_node < 0 )
+    {
+        early_printk("Unable to find ibm,opal node!\n");
+        die();
+    }
+
+    opal_base =3D fdt_getprop(fdt, opal_node, "opal-base-address", NULL)=
;
+    opal_entry =3D fdt_getprop(fdt, opal_node, "opal-entry-address", NUL=
L);
+    if ( !opal_base || !opal_entry )
+    {
+        early_printk("Failed to get opal-base-address/opal-entry-address=
 "
+                     "property from DT!\n");
+        die();
+    }
+
+    opal.base =3D be64_to_cpu(*opal_base);
+    opal.entry =3D be64_to_cpu(*opal_entry);
+}
diff --git a/xen/arch/ppc/setup.c b/xen/arch/ppc/setup.c
index 7c623a49f5..bacd6d1acd 100644
--- a/xen/arch/ppc/setup.c
+++ b/xen/arch/ppc/setup.c
@@ -18,8 +18,13 @@ void __init noreturn start_xen(unsigned long r3, unsig=
ned long r4,
     }
     else
     {
-        /* kexec boot: Unimplemented */
-        __builtin_trap();
+        /*
+         * kexec boot protocol
+         *
+         * TODO: This currently assumes an OPAL/PowerNV system, but it's=
 also
+         * possible to be kexec'd on an OF system.
+         */
+        boot_opal_init((void *) r3);
     }
=20
     early_printk("Hello, ppc64le!\n");
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 21:35:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 21:35:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571586.895809 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPV7S-0000So-BI; Fri, 28 Jul 2023 21:35:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571586.895809; Fri, 28 Jul 2023 21:35:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPV7S-0000Pg-5n; Fri, 28 Jul 2023 21:35:30 +0000
Received: by outflank-mailman (input) for mailman id 571586;
 Fri, 28 Jul 2023 21:35:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/sdN=DO=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qPV7R-0000AP-BK
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 21:35:29 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a981ccaa-2d8e-11ee-b24e-6b7b168915f2;
 Fri, 28 Jul 2023 23:35:25 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 81044828593C;
 Fri, 28 Jul 2023 16:35:24 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id x3crH2diNbXC; Fri, 28 Jul 2023 16:35:23 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 681D48285A1C;
 Fri, 28 Jul 2023 16:35:23 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id yCZB8A9Ji6D5; Fri, 28 Jul 2023 16:35:23 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 03AE48285A0C;
 Fri, 28 Jul 2023 16:35:22 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a981ccaa-2d8e-11ee-b24e-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 681D48285A1C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1690580123; bh=iy/+njCDBp1CPxQSFrzbYX66+AgWOpgNKVw+Hth7ytI=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=tgrb7W9Z92Hj+omoJ89HB4m/M51CoknaIMJspE4bRQ6nGu8uIkVaD2k5oFMg6ZDSI
	 SILb5yoTpqSXYh0hJh2LJYI4YHm8wx7oqjt2IFf2hT4NutXq8QRXRLh2eZoaIQNreq
	 S5EL30w686ACPBm6Nm9as498fZ44ude7CXhcKQFE=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH 2/5] xen/ppc: Switch to medium PIC code model
Date: Fri, 28 Jul 2023 16:35:07 -0500
Message-Id: <335ce2a18f8cce679dd8b30d11560989131b4337.1690579561.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1690579561.git.sanastasio@raptorengineering.com>
References: <cover.1690579561.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Switch Xen to the medium PIC code model on Power. Among other things,
this allows us to be load address agnostic and will open the door to
booting on bare metal PowerNV systems that don't use OpenFirmware.

Also update XEN_VIRT_START to 0xc000000000000000, which is equivalent to
address 0x0 when the MMU is off. This prevents Open Firmware from
loading Xen at an offset from its base load address, so the DECL_SECTION
hack in xen.lds.S is no longer required.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/ppc/arch.mk                 |  2 +-
 xen/arch/ppc/include/asm/asm-defns.h |  7 +++++
 xen/arch/ppc/include/asm/config.h    |  2 +-
 xen/arch/ppc/ppc64/head.S            | 13 +++++---
 xen/arch/ppc/xen.lds.S               | 44 ++++++++++------------------
 5 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/xen/arch/ppc/arch.mk b/xen/arch/ppc/arch.mk
index 7eec22c283..0183b9ac6a 100644
--- a/xen/arch/ppc/arch.mk
+++ b/xen/arch/ppc/arch.mk
@@ -5,7 +5,7 @@ ppc-march-$(CONFIG_POWER_ISA_2_07B) :=3D power8
 ppc-march-$(CONFIG_POWER_ISA_3_00) :=3D power9
=20
 CFLAGS +=3D -m64 -mlittle-endian -mcpu=3D$(ppc-march-y)
-CFLAGS +=3D -mstrict-align -mcmodel=3Dlarge -mabi=3Delfv2 -mno-altivec -=
mno-vsx
+CFLAGS +=3D -mstrict-align -mcmodel=3Dmedium -mabi=3Delfv2 -fPIC -mno-al=
tivec -mno-vsx -msoft-float
=20
 LDFLAGS +=3D -m elf64lppc
=20
diff --git a/xen/arch/ppc/include/asm/asm-defns.h b/xen/arch/ppc/include/=
asm/asm-defns.h
index 35b1c89d4e..5821f9024d 100644
--- a/xen/arch/ppc/include/asm/asm-defns.h
+++ b/xen/arch/ppc/include/asm/asm-defns.h
@@ -16,6 +16,13 @@
     lis reg, (val) @h;                                                  =
     \
     ori reg, reg, (val) @l;                                             =
     \
=20
+/*
+ * Load the address of a symbol from the TOC into the specified GPR.
+ */
+#define LOAD_REG_ADDR(reg,name)                                         =
     \
+    addis reg,%r2,name@toc@ha;                                          =
     \
+    addi  reg,reg,name@toc@l
+
 /*
  * Depending on how we were booted, the CPU could be running in either
  * Little Endian or Big Endian mode. The following trampoline from Linux
diff --git a/xen/arch/ppc/include/asm/config.h b/xen/arch/ppc/include/asm=
/config.h
index cb27d2781e..d060f0dca7 100644
--- a/xen/arch/ppc/include/asm/config.h
+++ b/xen/arch/ppc/include/asm/config.h
@@ -39,7 +39,7 @@
     name:
 #endif
=20
-#define XEN_VIRT_START _AT(UL, 0x400000)
+#define XEN_VIRT_START _AT(UL, 0xc000000000000000)
=20
 #define SMP_CACHE_BYTES (1 << 6)
=20
diff --git a/xen/arch/ppc/ppc64/head.S b/xen/arch/ppc/ppc64/head.S
index 02ff520458..5ac2dad2ee 100644
--- a/xen/arch/ppc/ppc64/head.S
+++ b/xen/arch/ppc/ppc64/head.S
@@ -1,9 +1,11 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
=20
 #include <asm/asm-defns.h>
+#include <asm/asm-offsets.h>
=20
     .section .text.header, "ax", %progbits
=20
+
 ENTRY(start)
     /*
      * NOTE: argument registers (r3-r9) must be preserved until the C en=
trypoint
@@ -11,16 +13,19 @@ ENTRY(start)
     FIXUP_ENDIAN
=20
     /* set up the TOC pointer */
-    LOAD_IMM32(%r2, .TOC.)
+    bcl	    20, 31, .+4
+1:  mflr    %r12
+    addis   %r2, %r12, .TOC.-1b@ha
+    addi    %r2, %r2, .TOC.-1b@l
=20
     /* set up the initial stack */
-    LOAD_IMM32(%r1, cpu0_boot_stack)
+    LOAD_REG_ADDR(%r1, cpu0_boot_stack)
     li      %r11, 0
     stdu    %r11, -STACK_FRAME_OVERHEAD(%r1)
=20
     /* clear .bss */
-    LOAD_IMM32(%r14, __bss_start)
-    LOAD_IMM32(%r15, __bss_end)
+    LOAD_REG_ADDR(%r14, __bss_start)
+    LOAD_REG_ADDR(%r15, __bss_end)
 1:
     std     %r11, 0(%r14)
     addi    %r14, %r14, 8
diff --git a/xen/arch/ppc/xen.lds.S b/xen/arch/ppc/xen.lds.S
index c628cc0e5c..2fa81d5a83 100644
--- a/xen/arch/ppc/xen.lds.S
+++ b/xen/arch/ppc/xen.lds.S
@@ -15,25 +15,12 @@ PHDRS
 #endif
 }
=20
-/**
- * OpenFirmware's base load address is 0x400000 (XEN_VIRT_START).
- * By defining sections this way, we can keep our virtual address base a=
t 0x400000
- * while keeping the physical base at 0x0.
- *
- * Otherwise, OpenFirmware incorrectly loads .text at 0x400000 + 0x40000=
0 =3D 0x800000.
- * Taken from x86/xen.lds.S
- */
-#ifdef CONFIG_LD_IS_GNU
-# define DECL_SECTION(x) x : AT(ADDR(#x) - XEN_VIRT_START)
-#else
-# define DECL_SECTION(x) x : AT(ADDR(x) - XEN_VIRT_START)
-#endif
-
 SECTIONS
 {
     . =3D XEN_VIRT_START;
+    _start =3D .;
=20
-    DECL_SECTION(.text) {
+    .text : {
         _stext =3D .;            /* Text section */
         *(.text.header)
=20
@@ -52,7 +39,7 @@ SECTIONS
     } :text
=20
     . =3D ALIGN(PAGE_SIZE);
-    DECL_SECTION(.rodata) {
+    .rodata : {
         _srodata =3D .;          /* Read-only data */
         *(.rodata)
         *(.rodata.*)
@@ -67,7 +54,7 @@ SECTIONS
=20
     #if defined(BUILD_ID)
     . =3D ALIGN(4);
-    DECL_SECTION(.note.gnu.build-id) {
+    .note.gnu.build-id : {
         __note_gnu_build_id_start =3D .;
         *(.note.gnu.build-id)
         __note_gnu_build_id_end =3D .;
@@ -76,19 +63,19 @@ SECTIONS
     _erodata =3D .;                /* End of read-only data */
=20
     . =3D ALIGN(PAGE_SIZE);
-    DECL_SECTION(.data.ro_after_init) {
+    .data.ro_after_init : {
         __ro_after_init_start =3D .;
         *(.data.ro_after_init)
         . =3D ALIGN(PAGE_SIZE);
         __ro_after_init_end =3D .;
-    } : text
+    } :text
=20
-    DECL_SECTION(.data.read_mostly) {
+    .data.read_mostly : {
         *(.data.read_mostly)
     } :text
=20
     . =3D ALIGN(PAGE_SIZE);
-    DECL_SECTION(.data) {                    /* Data */
+    .data : {                    /* Data */
         *(.data.page_aligned)
         . =3D ALIGN(8);
         __start_schedulers_array =3D .;
@@ -103,7 +90,7 @@ SECTIONS
=20
     . =3D ALIGN(PAGE_SIZE);             /* Init code and data */
     __init_begin =3D .;
-    DECL_SECTION(.init.text) {
+    .init.text : {
         _sinittext =3D .;
         *(.init.text)
         _einittext =3D .;
@@ -111,7 +98,7 @@ SECTIONS
     } :text
=20
     . =3D ALIGN(PAGE_SIZE);
-    DECL_SECTION(.init.data) {
+    .init.data : {
         *(.init.rodata)
         *(.init.rodata.*)
=20
@@ -140,18 +127,18 @@ SECTIONS
         __ctors_end =3D .;
     } :text
=20
-    DECL_SECTION(.got) {
-        *(.got)
+    .got : {
+        *(.got .toc)
     } :text
=20
-    DECL_SECTION(.got.plt) {
+    .got.plt : {
         *(.got.plt)
     } :text
=20
     . =3D ALIGN(POINTER_ALIGN);
     __init_end =3D .;
=20
-    DECL_SECTION(.bss) {                     /* BSS */
+    .bss : {                     /* BSS */
         __bss_start =3D .;
         *(.bss.stack_aligned)
         *(.bss.page_aligned)
@@ -167,10 +154,11 @@ SECTIONS
         . =3D ALIGN(POINTER_ALIGN);
         __bss_end =3D .;
     } :text
+
     _end =3D . ;
=20
     /* Section for the device tree blob (if any). */
-    DECL_SECTION(.dtb) { *(.dtb) } :text
+    .dtb : { *(.dtb) } :text
=20
     DWARF2_DEBUG_SECTIONS
=20
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 21:35:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 21:35:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571584.895795 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPV7R-0000CX-Mh; Fri, 28 Jul 2023 21:35:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571584.895795; Fri, 28 Jul 2023 21:35:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPV7R-0000Bj-If; Fri, 28 Jul 2023 21:35:29 +0000
Received: by outflank-mailman (input) for mailman id 571584;
 Fri, 28 Jul 2023 21:35:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/sdN=DO=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qPV7Q-0000AP-BJ
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 21:35:28 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a91792f7-2d8e-11ee-b24e-6b7b168915f2;
 Fri, 28 Jul 2023 23:35:25 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id C54E78285A0C;
 Fri, 28 Jul 2023 16:35:23 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id PiDgYb4MfAKt; Fri, 28 Jul 2023 16:35:23 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 2C74C82857ED;
 Fri, 28 Jul 2023 16:35:23 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id qHUFi2L4_-67; Fri, 28 Jul 2023 16:35:22 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 404E7828593C;
 Fri, 28 Jul 2023 16:35:22 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a91792f7-2d8e-11ee-b24e-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 2C74C82857ED
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1690580123; bh=tuP2jrokv0sMa1vT3Hyg7ytA6VKcWnBgPVQWJzONpGw=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=TPxe1qe+X60Tzu3UrQNcl25Qyep/aUdzAXvJsnctGlpHyhiwDGu5HLorUS2o2rRCG
	 ypkYj4mzzgYLywna4Hft/KeTxTpjQ4mEUu5el7pkbGRhemJPj5S66ZEMMETkxSIARD
	 ukxByK9uQBXiwmMN8hgMI3DmXX9VC/9MWcZbk/9M=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [PATCH 1/5] xen/lib: Move simple_strtoul from common/vsprintf.c to lib
Date: Fri, 28 Jul 2023 16:35:06 -0500
Message-Id: <294e48747a0f9aee0be4fd178fcab029fa317528.1690579561.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1690579561.git.sanastasio@raptorengineering.com>
References: <cover.1690579561.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Move the simple_strtoul routine which is used throughout the codebase
from vsprintf.c to its own file in xen/lib.

This allows libfdt to be built on ppc64 even though xen/common doesn't
build yet.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/common/vsprintf.c    | 37 -------------------------------------
 xen/lib/Makefile         |  1 +
 xen/lib/simple_strtoul.c | 40 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 41 insertions(+), 37 deletions(-)
 create mode 100644 xen/lib/simple_strtoul.c

diff --git a/xen/common/vsprintf.c b/xen/common/vsprintf.c
index b278961cc3..86330d8082 100644
--- a/xen/common/vsprintf.c
+++ b/xen/common/vsprintf.c
@@ -24,43 +24,6 @@
 #include <asm/div64.h>
 #include <asm/page.h>
=20
-/**
- * simple_strtoul - convert a string to an unsigned long
- * @cp: The start of the string
- * @endp: A pointer to the end of the parsed string will be placed here
- * @base: The number base to use
- */
-unsigned long simple_strtoul(
-    const char *cp, const char **endp, unsigned int base)
-{
-    unsigned long result =3D 0,value;
-
-    if (!base) {
-        base =3D 10;
-        if (*cp =3D=3D '0') {
-            base =3D 8;
-            cp++;
-            if ((toupper(*cp) =3D=3D 'X') && isxdigit(cp[1])) {
-                cp++;
-                base =3D 16;
-            }
-        }
-    } else if (base =3D=3D 16) {
-        if (cp[0] =3D=3D '0' && toupper(cp[1]) =3D=3D 'X')
-            cp +=3D 2;
-    }
-    while (isxdigit(*cp) &&
-           (value =3D isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < ba=
se) {
-        result =3D result*base + value;
-        cp++;
-    }
-    if (endp)
-        *endp =3D cp;
-    return result;
-}
-
-EXPORT_SYMBOL(simple_strtoul);
-
 /**
  * simple_strtol - convert a string to a signed long
  * @cp: The start of the string
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index b311ea739c..bce76f9742 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -13,6 +13,7 @@ lib-y +=3D memset.o
 lib-y +=3D muldiv64.o
 lib-y +=3D parse-size.o
 lib-y +=3D rbtree.o
+lib-y +=3D simple_strtoul.o
 lib-y +=3D sort.o
 lib-y +=3D strcasecmp.o
 lib-y +=3D strchr.o
diff --git a/xen/lib/simple_strtoul.c b/xen/lib/simple_strtoul.c
new file mode 100644
index 0000000000..e43760ad1d
--- /dev/null
+++ b/xen/lib/simple_strtoul.c
@@ -0,0 +1,40 @@
+/*
+ *  Copyright (C) 1991, 1992  Linus Torvalds
+ */
+
+#include <xen/ctype.h>
+
+/**
+ * simple_strtoul - convert a string to an unsigned long
+ * @cp: The start of the string
+ * @endp: A pointer to the end of the parsed string will be placed here
+ * @base: The number base to use
+ */
+unsigned long simple_strtoul(
+    const char *cp, const char **endp, unsigned int base)
+{
+    unsigned long result =3D 0,value;
+
+    if (!base) {
+        base =3D 10;
+        if (*cp =3D=3D '0') {
+            base =3D 8;
+            cp++;
+            if ((toupper(*cp) =3D=3D 'X') && isxdigit(cp[1])) {
+                cp++;
+                base =3D 16;
+            }
+        }
+    } else if (base =3D=3D 16) {
+        if (cp[0] =3D=3D '0' && toupper(cp[1]) =3D=3D 'X')
+            cp +=3D 2;
+    }
+    while (isxdigit(*cp) &&
+           (value =3D isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < ba=
se) {
+        result =3D result*base + value;
+        cp++;
+    }
+    if (endp)
+        *endp =3D cp;
+    return result;
+}
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 21:35:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 21:35:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571587.895831 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPV7T-00019O-TT; Fri, 28 Jul 2023 21:35:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571587.895831; Fri, 28 Jul 2023 21:35:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPV7T-00018m-Pf; Fri, 28 Jul 2023 21:35:31 +0000
Received: by outflank-mailman (input) for mailman id 571587;
 Fri, 28 Jul 2023 21:35:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/sdN=DO=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qPV7S-0000AP-Bg
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 21:35:30 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id aa5d83e6-2d8e-11ee-b24e-6b7b168915f2;
 Fri, 28 Jul 2023 23:35:26 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id F377B8285A1C;
 Fri, 28 Jul 2023 16:35:25 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id GDDfpVohiqQY; Fri, 28 Jul 2023 16:35:24 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id A01D68285ADB;
 Fri, 28 Jul 2023 16:35:24 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id eGySXH391otJ; Fri, 28 Jul 2023 16:35:24 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 3CFE38285971;
 Fri, 28 Jul 2023 16:35:24 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aa5d83e6-2d8e-11ee-b24e-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com A01D68285ADB
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1690580124; bh=/0xgh18tz/M/0PIJGPY+ubTer6Xpds74jbFrO8bxeDQ=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=Ba7gXbYXJdmVttyfn12UOpol9opencM65RcEsvdlOUv0DjnVKjwVx4QgCAFDE4d8t
	 fTCYHDFRNaCyaSXWKnW0NtHD0Mfdbp3jezwxI8Fjh90W6HeKnhdf0FA5QOb9zr5JQr
	 2UHsBVIU+lN0fsRcbxofsTy8mJfQpHw0ZvHYZ/RM=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH 5/5] xen/ppc: Implement early serial console on PowerNV
Date: Fri, 28 Jul 2023 16:35:10 -0500
Message-Id: <3023ad320b42fa3787bb71a9cf83b34965668fe9.1690579561.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1690579561.git.sanastasio@raptorengineering.com>
References: <cover.1690579561.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Implement the OPAL firmware calls required to write to the serial
console on PowerNV systems. Unlike pseries/Open Firmware, the OPAL
firmware interface can be used past early boot and as such the relevant
functions are not marked as __init.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/ppc/include/asm/asm-defns.h | 12 ++++
 xen/arch/ppc/opal.c                  | 27 ++++++++-
 xen/arch/ppc/ppc64/Makefile          |  1 +
 xen/arch/ppc/ppc64/asm-offsets.c     |  4 ++
 xen/arch/ppc/ppc64/opal-calls.S      | 82 ++++++++++++++++++++++++++++
 5 files changed, 125 insertions(+), 1 deletion(-)
 create mode 100644 xen/arch/ppc/ppc64/opal-calls.S

diff --git a/xen/arch/ppc/include/asm/asm-defns.h b/xen/arch/ppc/include/=
asm/asm-defns.h
index 5821f9024d..54d578ea3b 100644
--- a/xen/arch/ppc/include/asm/asm-defns.h
+++ b/xen/arch/ppc/include/asm/asm-defns.h
@@ -23,6 +23,18 @@
     addis reg,%r2,name@toc@ha;                                          =
     \
     addi  reg,reg,name@toc@l
=20
+/*
+ * Declare a global assembly function with a proper TOC setup prologue
+ */
+#define _GLOBAL_TOC(name)                                               =
    \
+    .balign 4;                                                          =
    \
+    .type name,@function;                                               =
    \
+    .globl name;                                                        =
    \
+name:                                                                   =
    \
+0:  addis %r2,%r12,(.TOC.-0b)@ha;                                       =
    \
+    addi %r2,%r2,(.TOC.-0b)@l;                                          =
    \
+    .localentry name,.-name
+
 /*
  * Depending on how we were booted, the CPU could be running in either
  * Little Endian or Big Endian mode. The following trampoline from Linux
diff --git a/xen/arch/ppc/opal.c b/xen/arch/ppc/opal.c
index 251de8ac23..cc75ccfcbe 100644
--- a/xen/arch/ppc/opal.c
+++ b/xen/arch/ppc/opal.c
@@ -8,9 +8,28 @@
 #include <xen/init.h>
 #include <xen/lib.h>
=20
-/* Global OPAL struct containing entrypoint and base */
+/* Global OPAL struct containing entrypoint and base used by opal-calls.=
S */
 struct opal opal;
=20
+int64_t opal_console_write(int64_t term_number, uint64_t *length,
+                           uint8_t *buffer);
+int64_t opal_console_flush(int64_t term_number);
+int64_t opal_reinit_cpus(uint64_t flags);
+
+static void opal_putchar(char c)
+{
+    uint64_t len;
+    if (c =3D=3D '\n')
+    {
+        char buf =3D '\r';
+        len =3D cpu_to_be64(1);
+        opal_console_write(0, &len, (uint8_t *) &buf);
+    }
+    len =3D cpu_to_be64(1);
+    opal_console_write(0, &len, (uint8_t *) &c);
+    opal_console_flush(0);
+}
+
 void __init boot_opal_init(const void *fdt)
 {
     int opal_node;
@@ -45,4 +64,10 @@ void __init boot_opal_init(const void *fdt)
=20
     opal.base =3D be64_to_cpu(*opal_base);
     opal.entry =3D be64_to_cpu(*opal_entry);
+
+    early_printk_init(opal_putchar);
+
+    /* Ask OPAL to set HID0 for Little Endian interrupts + Radix TLB sup=
port */
+    opal_reinit_cpus(OPAL_REINIT_CPUS_HILE_LE | OPAL_REINIT_CPUS_MMU_RAD=
IX
+                     | OPAL_REINIT_CPUS_MMU_HASH);
 }
diff --git a/xen/arch/ppc/ppc64/Makefile b/xen/arch/ppc/ppc64/Makefile
index f4956daaa9..b9a91dc15f 100644
--- a/xen/arch/ppc/ppc64/Makefile
+++ b/xen/arch/ppc/ppc64/Makefile
@@ -1,2 +1,3 @@
 obj-y +=3D head.o
 obj-y +=3D of-call.o
+obj-y +=3D opal-calls.o
diff --git a/xen/arch/ppc/ppc64/asm-offsets.c b/xen/arch/ppc/ppc64/asm-of=
fsets.c
index e1129cb0f4..c15c1bf136 100644
--- a/xen/arch/ppc/ppc64/asm-offsets.c
+++ b/xen/arch/ppc/ppc64/asm-offsets.c
@@ -6,6 +6,7 @@
=20
 #include <xen/macros.h>
 #include <asm/processor.h>
+#include <asm/boot.h>
=20
 #define DEFINE(_sym, _val)                                              =
    \
     asm volatile ( "\n.ascii\"=3D=3D>#define " #_sym " %0 /* " #_val " *=
/<=3D=3D\"" \
@@ -46,6 +47,9 @@ void __dummy__(void)
     OFFSET(UREGS_cr, struct cpu_user_regs, cr);
     OFFSET(UREGS_fpscr, struct cpu_user_regs, fpscr);
     DEFINE(UREGS_sizeof, sizeof(struct cpu_user_regs));
+
+    OFFSET(OPAL_base, struct opal, base);
+    OFFSET(OPAL_entry, struct opal, entry);
 }
=20
 /*
diff --git a/xen/arch/ppc/ppc64/opal-calls.S b/xen/arch/ppc/ppc64/opal-ca=
lls.S
new file mode 100644
index 0000000000..f754308725
--- /dev/null
+++ b/xen/arch/ppc/ppc64/opal-calls.S
@@ -0,0 +1,82 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Adapted from Linux's arch/powerpc/boot/opal-calls.S
+ *
+ * Copyright (c) 2016 IBM Corporation.
+ * Copyright Raptor Engineering, LLC
+ */
+
+#include <asm/asm-defns.h>
+#include <asm/asm-offsets.h>
+#include <asm/opal-api.h>
+#include <asm/msr.h>
+
+    .text
+
+#define OPAL_CALL(name, token)  \
+    .globl name;                \
+name:                           \
+    li      %r0, token;         \
+    b       opal_call;
+
+ _GLOBAL_TOC(opal_call)
+    /* Back up LR, CR, r2 in caller's stack frame */
+    mflr    %r11
+    mfcr    %r12
+    std     %r2, 24(%r1)
+    std     %r11, 16(%r1)
+    stw     %r12, 8(%r1)
+
+    /* Use r14 (non-volatile) to store the virtual address of opal_retur=
n_mmu */
+    std     %r14, -8(%r1)
+    stdu    %r1, -48(%r1)
+    LOAD_REG_ADDR(%r14, opal_return_mmu)
+
+    /*
+     * Setup new MSR without LE or MMU. Original MSR will be preserved a=
cross
+     * opal call in r13
+     */
+    mfmsr   %r13
+    li      %r11, MSR_LE | MSR_IR | MSR_DR
+    andc    %r12, %r13, %r11
+    mthsrr1 %r12
+
+    LOAD_REG_ADDR(%r11, opal_return_real)
+    mtlr     %r11
+
+    /* Load the opal call entry point and base */
+    LOAD_REG_ADDR(%r11, opal)
+    ld      %r12, OPAL_entry(%r11)
+    ld      %r2, OPAL_base(%r11)
+    mthsrr0 %r12
+    hrfid
+
+opal_return_real:
+    /*
+     * OPAL will always return to us in Big Endian mode. Since we are go=
ing
+     * to restore the old MSR with the correct endianness and MMU status=
 set, we
+     * can avoid an unnecessary FIXUP_ENDIAN trampoline by just encoding=
 the
+     * required Big Endian instructions to restore the old MSR direclty.
+     */
+    .long 0xa64bbb7d /* mthsrr1 %r13 (Old MSR) */
+    .long 0xa64bda7d /* mthsrr0 %r14 (Virtual address of opal_return_mmu=
) */
+    .long 0x2402004c /* hrfid */
+
+opal_return_mmu:
+    /*
+     * We're back in the correct endianness and MMU mode, restore regist=
ers
+     * and return
+     */
+    addi    %r1, %r1, 48
+    ld      %r14, -8(%r1)
+    lwz     %r11, 8(%r1)
+    ld      %r12, 16(%r1)
+    ld      %r2, 24(%r1)
+    mtcr    %r11
+    mtlr    %r12
+
+    blr
+
+OPAL_CALL(opal_console_write, OPAL_CONSOLE_WRITE)
+OPAL_CALL(opal_console_flush, OPAL_CONSOLE_FLUSH)
+OPAL_CALL(opal_reinit_cpus, OPAL_REINIT_CPUS)
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 22:22:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 22:22:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571601.895881 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPVqO-0000tG-8h; Fri, 28 Jul 2023 22:21:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571601.895881; Fri, 28 Jul 2023 22:21:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPVqO-0000t7-4n; Fri, 28 Jul 2023 22:21:56 +0000
Received: by outflank-mailman (input) for mailman id 571601;
 Fri, 28 Jul 2023 22:21:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/sdN=DO=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qPVqM-0000Dy-Ct
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 22:21:54 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2652ce81-2d95-11ee-b24e-6b7b168915f2;
 Sat, 29 Jul 2023 00:21:51 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id E6A70828570D;
 Fri, 28 Jul 2023 17:21:50 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id E-vd7Hw6KhbD; Fri, 28 Jul 2023 17:21:48 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 1487B8285525;
 Fri, 28 Jul 2023 17:21:48 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id q8tlhlFcKxoB; Fri, 28 Jul 2023 17:21:47 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 94DF78285AD1;
 Fri, 28 Jul 2023 17:21:47 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2652ce81-2d95-11ee-b24e-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 1487B8285525
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1690582908; bh=tblYjoXnq7ZT9b3g2OKbJbQloHW+8XXyaNAjgBKcVGQ=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=Bun41G+HdONo/8BdZSSJgV/HgIg3UHHXVFV7SFg+Zqw518qEjBGiCV+grydmXo/5/
	 5AKwhOgKHFernqTvF/5tCqfe7q9jpuIoKse02inDv0QAMji6rZI8k1p+hP26sxqRm5
	 UWmD3dkY88G83+h45HKWnqYMGfF03lD5gfMSg9ZM=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH 3/3] xen/ppc: Implement initial Radix MMU support
Date: Fri, 28 Jul 2023 17:21:30 -0500
Message-Id: <ed166c38bbcf82ad58a14353a880d1e208cb2ff1.1690582001.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1690582001.git.sanastasio@raptorengineering.com>
References: <cover.1690582001.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Add code to construct early identity-mapped page tables as well as the
required process and partition tables to enable the MMU.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/ppc/Makefile                |   2 +
 xen/arch/ppc/include/asm/bitops.h    |  11 ++
 xen/arch/ppc/include/asm/mm.h        |  19 ++
 xen/arch/ppc/include/asm/page-bits.h |   3 +-
 xen/arch/ppc/include/asm/page.h      | 178 ++++++++++++++++++
 xen/arch/ppc/include/asm/processor.h |  31 ++++
 xen/arch/ppc/include/asm/regs.h      | 138 ++++++++++++++
 xen/arch/ppc/include/asm/types.h     |   1 +
 xen/arch/ppc/mm-radix.c              | 268 +++++++++++++++++++++++++++
 xen/arch/ppc/opal.c                  |   2 +
 xen/arch/ppc/ppc64/head.S            |  15 ++
 xen/arch/ppc/setup.c                 |   4 +
 xen/arch/ppc/tlb-radix.c             |  95 ++++++++++
 13 files changed, 766 insertions(+), 1 deletion(-)
 create mode 100644 xen/arch/ppc/include/asm/bitops.h
 create mode 100644 xen/arch/ppc/include/asm/mm.h
 create mode 100644 xen/arch/ppc/include/asm/page.h
 create mode 100644 xen/arch/ppc/include/asm/regs.h
 create mode 100644 xen/arch/ppc/mm-radix.c
 create mode 100644 xen/arch/ppc/tlb-radix.c

diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index 0c0a7884a1..a059ac4c0a 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -2,8 +2,10 @@ obj-$(CONFIG_PPC64) +=3D ppc64/
=20
 obj-y +=3D boot-of.init.o
 obj-$(CONFIG_EARLY_PRINTK) +=3D early_printk.init.o
+obj-y +=3D mm-radix.o
 obj-y +=3D opal.o
 obj-y +=3D setup.o
+obj-y +=3D tlb-radix.o
=20
 $(TARGET): $(TARGET)-syms
 	cp -f $< $@
diff --git a/xen/arch/ppc/include/asm/bitops.h b/xen/arch/ppc/include/asm=
/bitops.h
new file mode 100644
index 0000000000..a7cd8ec7c5
--- /dev/null
+++ b/xen/arch/ppc/include/asm/bitops.h
@@ -0,0 +1,11 @@
+#ifndef _ASM_PPC_BITOPS_H
+#define _ASM_PPC_BITOPS_H
+
+#include <xen/compiler.h>
+
+/* PPC bit number conversion */
+#define PPC_BITLSHIFT(be)	(BITS_PER_LONG - 1 - (be))
+#define PPC_BIT(bit)		(1UL << PPC_BITLSHIFT(bit))
+#define PPC_BITMASK(bs, be)	((PPC_BIT(bs) - PPC_BIT(be)) | PPC_BIT(bs))
+
+#endif /* _ASM_PPC_BITOPS_H */
diff --git a/xen/arch/ppc/include/asm/mm.h b/xen/arch/ppc/include/asm/mm.=
h
new file mode 100644
index 0000000000..36e44a4356
--- /dev/null
+++ b/xen/arch/ppc/include/asm/mm.h
@@ -0,0 +1,19 @@
+#ifndef _ASM_PPC_MM_H
+#define _ASM_PPC_MM_H
+
+#include <asm/config.h>
+#include <asm/page-bits.h>
+
+#define pfn_to_paddr(pfn) ((paddr_t)(pfn) << PAGE_SHIFT)
+#define paddr_to_pfn(pa)  ((unsigned long)((pa) >> PAGE_SHIFT))
+
+#define virt_to_maddr(va) ((paddr_t)((vaddr_t)(va) & PADDR_MASK))
+#define maddr_to_virt(pa) ((void *)((paddr_t)(pa) | XEN_VIRT_START)
+
+/* Convert between Xen-heap virtual addresses and machine addresses. */
+#define __pa(x)             (virt_to_maddr(x))
+#define __va(x)             (maddr_to_virt(x))
+
+void setup_initial_pagetables(void);
+
+#endif /* _ASM_PPC_MM_H */
diff --git a/xen/arch/ppc/include/asm/page-bits.h b/xen/arch/ppc/include/=
asm/page-bits.h
index 4c01bf9716..0286177520 100644
--- a/xen/arch/ppc/include/asm/page-bits.h
+++ b/xen/arch/ppc/include/asm/page-bits.h
@@ -2,6 +2,7 @@
 #define __PPC_PAGE_BITS_H__
=20
 #define PAGE_SHIFT              16 /* 64 KiB Pages */
-#define PADDR_BITS              48
+#define PADDR_BITS              53
+#define VADDR_BITS              52
=20
 #endif /* __PPC_PAGE_BITS_H__ */
diff --git a/xen/arch/ppc/include/asm/page.h b/xen/arch/ppc/include/asm/p=
age.h
new file mode 100644
index 0000000000..e58b0a7354
--- /dev/null
+++ b/xen/arch/ppc/include/asm/page.h
@@ -0,0 +1,178 @@
+#ifndef _ASM_PPC_PAGE_H
+#define _ASM_PPC_PAGE_H
+
+#include <xen/types.h>
+
+#include <asm/bitops.h>
+#include <asm/byteorder.h>
+
+#define PDE_VALID     PPC_BIT(0)
+#define PDE_NLB_MASK  0xfffffffffffffUL
+#define PDE_NLB_SHIFT 5UL
+#define PDE_NLS_MASK  0x1f
+
+#define PTE_VALID     PPC_BIT(0)
+#define PTE_LEAF      PPC_BIT(1)
+#define PTE_REFERENCE PPC_BIT(55)
+#define PTE_CHANGE    PPC_BIT(56)
+
+/* PTE Attributes */
+#define PTE_ATT_SAO            PPC_BIT(59) /* Strong Access Ordering */
+#define PTE_ATT_NON_IDEMPOTENT PPC_BIT(58)
+#define PTE_ATT_TOLERANT       (PPC_BIT(58) | PPC_BIT(59))
+
+/* PTE Encoded Access Authority*/
+#define PTE_EAA_PRIVILEGED PPC_BIT(60)
+#define PTE_EAA_READ       PPC_BIT(61)
+#define PTE_EAA_WRITE      PPC_BIT(62)
+#define PTE_EAA_EXECUTE    PPC_BIT(63)
+
+/* Field shifts/masks */
+#define PTE_RPN_MASK  0x1fffffffffffUL
+#define PTE_RPN_SHIFT 12UL
+#define PTE_ATT_MASK  0x3UL
+#define PTE_ATT_SHIFT 4UL
+#define PTE_EAA_MASK  0xfUL
+
+#define PTE_XEN_BASE (PTE_VALID | PTE_EAA_PRIVILEGED | PTE_REFERENCE)
+#define PTE_XEN_RW   (PTE_XEN_BASE | PTE_EAA_READ | PTE_EAA_WRITE | PTE_=
CHANGE)
+#define PTE_XEN_RO   (PTE_XEN_BASE | PTE_EAA_READ)
+#define PTE_XEN_RX   (PTE_XEN_BASE | PTE_EAA_READ | PTE_EAA_EXECUTE)
+
+/*
+ * Radix Tree layout for 64KB pages:
+ *
+ * [ L1 (ROOT) PAGE DIRECTORY (8192 * sizeof(pde_t)) ]
+ *                     |
+ *                     |
+ *                     v
+ *    [ L2 PAGE DIRECTORY (512 * sizeof(pde_t)) ]
+ *                     |
+ *                     |
+ *                     v
+ *    [ L3 PAGE DIRECTORY (512 * sizeof(pde_t)) ]
+ *                     |
+ *                     |
+ *                     v
+ *      [ L4 PAGE TABLE (32 * sizeof(pte_t)) ]
+ *                     |
+ *                     |
+ *                     v
+ *            [ PAGE TABLE ENTRY ]
+ */
+
+#define XEN_PT_ENTRIES_LOG2_LVL_1 13 /* 2**13 entries, maps 2**13 * 512G=
B =3D 4PB */
+#define XEN_PT_ENTRIES_LOG2_LVL_2 9  /* 2**9  entries, maps 2**9  * 1GB =
=3D 512GB */
+#define XEN_PT_ENTRIES_LOG2_LVL_3 9  /* 2**9  entries, maps 2**9  * 1GB =
=3D 512GB */
+#define XEN_PT_ENTRIES_LOG2_LVL_4 5  /* 2**5  entries, maps 2**5  * 64K =
=3D 2MB */
+
+#define XEN_PT_SHIFT_LVL_1    (XEN_PT_SHIFT_LVL_2 + XEN_PT_ENTRIES_LOG2_=
LVL_2)
+#define XEN_PT_SHIFT_LVL_2    (XEN_PT_SHIFT_LVL_3 + XEN_PT_ENTRIES_LOG2_=
LVL_3)
+#define XEN_PT_SHIFT_LVL_3    (XEN_PT_SHIFT_LVL_4 + XEN_PT_ENTRIES_LOG2_=
LVL_4)
+#define XEN_PT_SHIFT_LVL_4    PAGE_SHIFT
+
+#define XEN_PT_ENTRIES_LOG2_LVL(lvl) (XEN_PT_ENTRIES_LOG2_LVL_##lvl)
+#define XEN_PT_SHIFT_LVL(lvl)        (XEN_PT_SHIFT_LVL_##lvl)
+#define XEN_PT_ENTRIES_LVL(lvl)      (1UL << XEN_PT_ENTRIES_LOG2_LVL(lvl=
))
+#define XEN_PT_MASK_LVL(lvl)         (XEN_PT_ENTRIES_LVL(lvl) - 1)
+#define XEN_PT_INDEX_LVL(lvl, va)    ((va >> XEN_PT_SHIFT_LVL(lvl)) & XE=
N_PT_MASK_LVL(lvl))
+
+/*
+ * Calculate the index of the provided virtual address in the provided
+ * page table struct
+ */
+#define pt_index(pt, va) _Generic((pt), \
+    struct lvl1_pd * : XEN_PT_INDEX_LVL(1, (va)), \
+    struct lvl2_pd * : XEN_PT_INDEX_LVL(2, (va)), \
+    struct lvl3_pd * : XEN_PT_INDEX_LVL(3, (va)), \
+    struct lvl4_pt * : XEN_PT_INDEX_LVL(4, (va)))
+
+#define pt_entry(pt, va) (&((pt)->entries[pt_index((pt), (va))]))
+
+typedef struct
+{
+    __be64 pde;
+} pde_t;
+
+typedef struct
+{
+    __be64 pte;
+} pte_t;
+
+struct lvl1_pd
+{
+    pde_t entries[1U << XEN_PT_ENTRIES_LOG2_LVL_1];
+};
+
+struct lvl2_pd
+{
+    pde_t entries[1U << XEN_PT_ENTRIES_LOG2_LVL_2];
+};
+
+struct lvl3_pd
+{
+    pde_t entries[1U << XEN_PT_ENTRIES_LOG2_LVL_3];
+};
+
+struct lvl4_pt
+{
+    pte_t entries[1U << XEN_PT_ENTRIES_LOG2_LVL_4];
+};
+
+static inline pte_t paddr_to_pte(paddr_t paddr, unsigned long flags)
+{
+    return (pte_t){ .pte =3D cpu_to_be64(paddr | flags | PTE_LEAF) };
+}
+
+static inline pde_t paddr_to_pde(paddr_t paddr, unsigned long flags, uns=
igned long nls)
+{
+    return (pde_t){ .pde =3D cpu_to_be64(paddr | flags | nls) };
+}
+
+static inline paddr_t pte_to_paddr(pte_t pte)
+{
+    return be64_to_cpu(pte.pte) & (PTE_RPN_MASK << PTE_RPN_SHIFT);
+}
+
+static inline paddr_t pde_to_paddr(pde_t pde)
+{
+    return be64_to_cpu(pde.pde) & (PDE_NLB_MASK << PDE_NLB_SHIFT);
+}
+
+static inline bool pte_is_valid(pte_t pte)
+{
+    return pte.pte & be64_to_cpu(PTE_VALID);
+}
+
+static inline bool pde_is_valid(pde_t pde)
+{
+    return pde.pde & be64_to_cpu(PDE_VALID);
+}
+
+/*
+ * ISA 3.0 partition and process table entry format
+ */
+struct patb_entry {
+	__be64 patb0;
+	__be64 patb1;
+};
+#define PATB0_HR PPC_BIT(0) /* host uses radix */
+#define PATB1_GR PPC_BIT(0) /* guest uses radix; must match HR */
+
+struct prtb_entry {
+	__be64 prtb0;
+	__be64 reserved;
+};
+
+/*
+ * We support 52 bits, hence:
+ * bits 52 - 31 =3D 21, 0b10101
+ * RTS encoding details
+ * bits 0 - 3 of rts -> bits 6 - 8 unsigned long
+ * bits 4 - 5 of rts -> bits 62 - 63 of unsigned long
+ */
+#define RTS_FIELD ((0x2UL << 61) | (0x5UL << 5))
+
+void tlbie_all(void);
+
+#endif /* _ASM_PPC_PAGE_H */
diff --git a/xen/arch/ppc/include/asm/processor.h b/xen/arch/ppc/include/=
asm/processor.h
index 2300640787..417288738c 100644
--- a/xen/arch/ppc/include/asm/processor.h
+++ b/xen/arch/ppc/include/asm/processor.h
@@ -133,6 +133,37 @@ struct cpu_user_regs
     uint32_t entry_vector;
 };
=20
+static __inline__ void sync(void)
+{
+    asm volatile ( "sync" );
+}
+
+static __inline__ void isync(void)
+{
+    asm volatile ( "isync" );
+}
+
+static inline unsigned long mfmsr(void)
+{
+    unsigned long msr;
+    asm volatile ( "mfmsr %0" : "=3D&r"(msr) );
+    return msr;
+}
+
+static inline void mtmsrd(unsigned long msr)
+{
+    asm volatile ( "mtmsrd %0" : : "r"(msr) );
+}
+
+#define mtspr(reg, val) asm volatile ( "mtspr %0,%1" : : "K"(reg), "r"(v=
al) )
+
+#define mfspr(reg)                                                      =
       \
+    ({                                                                  =
       \
+        unsigned long val;                                              =
       \
+        asm volatile ( "mfspr %0,%1" : "=3Dr"(val) : "K"(reg) );        =
         \
+        val;                                                            =
       \
+    })
+
 /*
  * panic() isn't available at the moment so an infinite loop will be
  * used temporarily.
diff --git a/xen/arch/ppc/include/asm/regs.h b/xen/arch/ppc/include/asm/r=
egs.h
new file mode 100644
index 0000000000..d5f47a6ff1
--- /dev/null
+++ b/xen/arch/ppc/include/asm/regs.h
@@ -0,0 +1,138 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, =
USA.
+ *
+ * Copyright IBM Corp. 2005, 2007
+ *
+ * Authors: Jimi Xenidis <jimix@watson.ibm.com>
+ *          Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
+ */
+
+#ifndef _ASM_REG_DEFS_H_
+#define _ASM_REG_DEFS_H_
+
+/* Special Purpose Registers */
+#define SPRN_VRSAVE 256
+#define SPRN_DSISR  18
+#define SPRN_DAR    19
+#define SPRN_DEC    22
+#define SPRN_SRR0   26
+#define SPRN_SRR1   27
+#define SPRN_TBRL   268
+#define SPRN_TBRU   269
+#define SPRN_SPRG0  272
+#define SPRN_SPRG1  273
+#define SPRN_SPRG2  274
+#define SPRN_SPRG3  275
+#define SPRN_TBWL   284
+#define SPRN_TBWU   285
+
+#define SPRN_HSPRG0 304
+#define SPRN_HSPRG1 305
+#define SPRN_HDEC   310
+#define SPRN_HIOR   311
+#define SPRN_RMOR   312
+#define SPRN_HRMOR  313
+#define SPRN_HSRR0  314
+#define SPRN_HSRR1  315
+#define SPRN_LPIDR  319
+
+#define SPRN_PTCR	0x1D0	/* Partition table control Register */
+#define SPRN_PID	0x030	/* Process ID */
+
+/* Performance monitor spr encodings */
+#define SPRN_MMCRA  786
+#define   MMCRA_SAMPHV    _AC(0x10000000, UL) /* state of MSR HV when SI=
AR set */
+#define   MMCRA_SAMPPR    _AC(0x08000000, UL) /* state of MSR PR when SI=
AR set */
+#define   MMCRA_SAMPLE_ENABLE _AC(0x00000001, UL) /* enable sampling */
+#define NUM_PMCS 8
+#define SPRN_PMC1   787
+#define SPRN_PMC2   788
+#define SPRN_PMC3   789
+#define SPRN_PMC4   790
+#define SPRN_PMC5   791
+#define SPRN_PMC6   792
+#define SPRN_PMC7   793
+#define SPRN_PMC8   794
+#define SPRN_MMCR0  795
+#define   MMCR0_FC      _AC(0x80000000, UL) /* freeze counters */
+#define   MMCR0_FCS     _AC(0x40000000, UL) /* freeze in supervisor stat=
e */
+#define   MMCR0_FCP     _AC(0x20000000, UL) /* freeze in problem state *=
/
+#define   MMCR0_FCM1    _AC(0x10000000, UL) /* freeze counters while MSR=
 mark =3D 1 */
+#define   MMCR0_FCM0    _AC(0x08000000, UL) /* freeze counters while MSR=
 mark =3D 0 */
+#define   MMCR0_PMAE    _AC(0x04000000, UL) /* performance monitor alert=
 enabled */
+#define   MMCR0_PMAO    _AC(0x00000080, UL) /* performance monitor alert=
 occurred */
+#define   MMCR0_FCH     _AC(0x00000001, UL) /* freeze conditions in hype=
rvisor */
+#define SPRN_SIAR   796
+#define SPRN_SDAR   797
+#define SPRN_MMCR1  798
+
+/* As defined for PU G4 */
+#define SPRN_HID0   1008
+#define SPRN_HID1   1009
+#define SPRN_HID4   1012
+
+#define SPRN_DABR   1013
+#define SPRN_HID5   1014
+#define SPRN_DABRX  1015
+#define SPRN_HID6   1017
+#define SPRN_HID7   1018
+#define SPRN_HID8   1019
+#define SPRN_PIR    1023
+
+#define SPRN_LPCR	0x13E	/* LPAR Control Register */
+#define   LPCR_VPM0		_AC(0x8000000000000000, UL)
+#define   LPCR_VPM1		_AC(0x4000000000000000, UL)
+#define   LPCR_ISL		_AC(0x2000000000000000, UL)
+#define   LPCR_VC_SH		61
+#define   LPCR_DPFD_SH		52
+#define   LPCR_DPFD		(_AC(7, UL) << LPCR_DPFD_SH)
+#define   LPCR_VRMASD_SH	47
+#define   LPCR_VRMASD		(_AC(0x1f, UL) << LPCR_VRMASD_SH)
+#define   LPCR_VRMA_L		_AC(0x0008000000000000, UL)
+#define   LPCR_VRMA_LP0		_AC(0x0001000000000000, UL)
+#define   LPCR_VRMA_LP1		_AC(0x0000800000000000, UL)
+#define   LPCR_RMLS		0x1C000000	/* Implementation dependent RMO limit se=
l */
+#define   LPCR_RMLS_SH		26
+#define   LPCR_HAIL		_AC(0x0000000004000000, UL)   /* HV AIL (ISAv3.1) *=
/
+#define   LPCR_ILE		_AC(0x0000000002000000, UL)   /* !HV irqs set MSR:LE=
 */
+#define   LPCR_AIL		_AC(0x0000000001800000, UL)	/* Alternate interrupt l=
ocation */
+#define   LPCR_AIL_0		_AC(0x0000000000000000, UL)	/* MMU off exception o=
ffset 0x0 */
+#define   LPCR_AIL_3		_AC(0x0000000001800000, UL)   /* MMU on exception =
offset 0xc00...4xxx */
+#define   LPCR_ONL		_AC(0x0000000000040000, UL)	/* online - PURR/SPURR c=
ount */
+#define   LPCR_LD		_AC(0x0000000000020000, UL)	/* large decremeter */
+#define   LPCR_PECE		_AC(0x000000000001f000, UL)	/* powersave exit cause=
 enable */
+#define     LPCR_PECEDP	_AC(0x0000000000010000, UL)	/* directed priv dbe=
lls cause exit */
+#define     LPCR_PECEDH	_AC(0x0000000000008000, UL)	/* directed hyp dbel=
ls cause exit */
+#define     LPCR_PECE0		_AC(0x0000000000004000, UL)	/* ext. exceptions c=
an cause exit */
+#define     LPCR_PECE1		_AC(0x0000000000002000, UL)	/* decrementer can c=
ause exit */
+#define     LPCR_PECE2		_AC(0x0000000000001000, UL)	/* machine check etc=
 can cause exit */
+#define     LPCR_PECE_HVEE	_AC(0x0000400000000000, UL)	/* P9 Wakeup on H=
V interrupts */
+#define   LPCR_MER		_AC(0x0000000000000800, UL)	/* Mediated External Exc=
eption */
+#define   LPCR_MER_SH		11
+#define	  LPCR_GTSE		_AC(0x0000000000000400, UL)  	/* Guest Translation =
Shootdown Enable */
+#define   LPCR_TC		_AC(0x0000000000000200, UL)	/* Translation control */
+#define   LPCR_HEIC		_AC(0x0000000000000010, UL)   /* Hypervisor Externa=
l Interrupt Control */
+#define   LPCR_LPES		0x0000000c
+#define   LPCR_LPES0		_AC(0x0000000000000008, UL)      /* LPAR Env selec=
tor 0 */
+#define   LPCR_LPES1		_AC(0x0000000000000004, UL)      /* LPAR Env selec=
tor 1 */
+#define   LPCR_LPES_SH		2
+#define   LPCR_RMI		_AC(0x0000000000000002, UL)      /* real mode is cac=
he inhibit */
+#define   LPCR_HVICE		_AC(0x0000000000000002, UL)      /* P9: HV interru=
pt enable */
+#define   LPCR_HDICE		_AC(0x0000000000000001, UL)      /* Hyp Decr enabl=
e (HV,PR,EE) */
+#define   LPCR_UPRT		_AC(0x0000000000400000, UL)      /* Use Process Tab=
le (ISA 3) */
+#define   LPCR_HR		_AC(0x0000000000100000, UL)
+
+#endif /* _ASM_REG_DEFS_H_ */
diff --git a/xen/arch/ppc/include/asm/types.h b/xen/arch/ppc/include/asm/=
types.h
index cee08e111a..325a2a27c3 100644
--- a/xen/arch/ppc/include/asm/types.h
+++ b/xen/arch/ppc/include/asm/types.h
@@ -15,6 +15,7 @@ typedef unsigned int u32;
 typedef signed long s64;
 typedef unsigned long u64;
 typedef unsigned long paddr_t;
+typedef unsigned long vaddr_t;
 #define INVALID_PADDR (~0UL)
 #define PRIpaddr "016lx"
=20
diff --git a/xen/arch/ppc/mm-radix.c b/xen/arch/ppc/mm-radix.c
new file mode 100644
index 0000000000..071e71b73e
--- /dev/null
+++ b/xen/arch/ppc/mm-radix.c
@@ -0,0 +1,268 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#include <xen/init.h>
+#include <xen/kernel.h>
+#include <xen/types.h>
+#include <xen/lib.h>
+
+#include <asm/bitops.h>
+#include <asm/byteorder.h>
+#include <asm/early_printk.h>
+#include <asm/mm.h>
+#include <asm/page.h>
+#include <asm/processor.h>
+#include <asm/regs.h>
+#include <asm/msr.h>
+
+void enable_mmu(void);
+
+#define INITIAL_LVL1_PD_COUNT      1
+#define INITIAL_LVL2_LVL3_PD_COUNT 2
+#define INITIAL_LVL4_PT_COUNT      256
+
+static size_t initial_lvl1_pd_pool_used;
+static struct lvl1_pd __aligned(sizeof(struct lvl1_pd))
+initial_lvl1_pd_pool[INITIAL_LVL1_PD_COUNT];
+
+static size_t initial_lvl2_lvl3_pd_pool_used;
+static struct lvl2_pd __aligned(sizeof(struct lvl2_pd))
+initial_lvl2_lvl3_pd_pool[INITIAL_LVL2_LVL3_PD_COUNT];
+
+static size_t initial_lvl4_pt_pool_used;
+static struct lvl4_pt __aligned(sizeof(struct lvl4_pt))
+initial_lvl4_pt_pool[INITIAL_LVL4_PT_COUNT];
+
+/* Only reserve minimum Partition and Process tables  */
+#define PATB_SIZE_LOG2 16 /* Only supported partition table size on POWE=
R9 */
+#define PATB_SIZE      (1UL << PATB_SIZE_LOG2)
+#define PRTB_SIZE_LOG2 12
+#define PRTB_SIZE      (1UL << PRTB_SIZE_LOG2)
+
+static struct patb_entry
+    __aligned(PATB_SIZE) initial_patb[PATB_SIZE / sizeof(struct patb_ent=
ry)];
+
+static struct prtb_entry
+    __aligned(PRTB_SIZE) initial_prtb[PRTB_SIZE / sizeof(struct prtb_ent=
ry)];
+
+_Static_assert(sizeof(initial_patb) =3D=3D PATB_SIZE);
+
+static __init struct lvl1_pd *lvl1_pd_pool_alloc(void)
+{
+    if ( initial_lvl1_pd_pool_used >=3D INITIAL_LVL1_PD_COUNT )
+    {
+        early_printk("Ran out of space for LVL1 PD!\n");
+        die();
+    }
+
+    return &initial_lvl1_pd_pool[initial_lvl1_pd_pool_used++];
+}
+
+static __init struct lvl2_pd *lvl2_pd_pool_alloc(void)
+{
+    if ( initial_lvl2_lvl3_pd_pool_used >=3D INITIAL_LVL2_LVL3_PD_COUNT =
)
+    {
+        early_printk("Ran out of space for LVL2/3 PD!\n");
+        die();
+    }
+
+    return &initial_lvl2_lvl3_pd_pool[initial_lvl2_lvl3_pd_pool_used++];
+}
+
+static __init struct lvl3_pd *lvl3_pd_pool_alloc(void)
+{
+    BUILD_BUG_ON(sizeof(struct lvl3_pd) !=3D sizeof(struct lvl2_pd));
+
+    return (struct lvl3_pd *) lvl2_pd_pool_alloc();
+}
+
+static __init struct lvl4_pt *lvl4_pt_pool_alloc(void)
+{
+    if ( initial_lvl4_pt_pool_used >=3D INITIAL_LVL4_PT_COUNT )
+    {
+        early_printk("Ran out of space for LVL4 PT!\n");
+        die();
+    }
+
+    return &initial_lvl4_pt_pool[initial_lvl4_pt_pool_used++];
+}
+
+#ifndef NDEBUG
+/* TODO: Remove once we get common/ building */
+static char *__init itoa64_hex(uint64_t val, char *out_buf, size_t buf_l=
en)
+{
+    uint64_t cur;
+    size_t i =3D buf_len - 1;
+
+    /* Null terminate buffer */
+    out_buf[i] =3D '\0';
+
+    /* Add digits in reverse */
+    cur =3D val;
+    while ( cur && i > 0 )
+    {
+        out_buf[--i] =3D "0123456789ABCDEF"[cur % 16];
+        cur /=3D 16;
+    }
+
+    /* Pad to 16 digits */
+    while ( i > 0 )
+        out_buf[--i] =3D '0';
+
+    return out_buf + i;
+}
+#endif
+
+static void __init radix_dprint(uint64_t addr, const char *msg)
+{
+#ifndef NDEBUG
+    char buf[sizeof("DEADBEEFCAFEBABA")];
+    char *addr_s =3D itoa64_hex(addr, buf, sizeof(buf));
+
+    early_printk("(0x");
+    early_printk(addr_s);
+    early_printk(") ");
+    early_printk(msg);
+#endif
+}
+
+static void __init setup_initial_mapping(struct lvl1_pd *lvl1,
+                                         vaddr_t map_start,
+                                         vaddr_t map_end,
+                                         paddr_t phys_base)
+{
+    uint64_t page_addr;
+
+    if ( map_start & ~PAGE_MASK )
+    {
+        early_printk("Xen _start be aligned to 64k (PAGE_SIZE) boundary\=
n");
+        die();
+    }
+
+    if ( (uint64_t) phys_base & ~PAGE_MASK )
+    {
+        early_printk("Xen should be loaded at 64k (PAGE_SIZE) boundary\n=
");
+        die();
+    }
+
+    for ( page_addr =3D map_start; page_addr < map_end; page_addr +=3D P=
AGE_SIZE )
+    {
+        struct lvl2_pd *lvl2;
+        struct lvl3_pd *lvl3;
+        struct lvl4_pt *lvl4;
+        pde_t *pde;
+        pte_t *pte;
+
+        /* Allocate LVL 2 PD if necessary */
+        pde =3D pt_entry(lvl1, page_addr);
+        if ( !pde_is_valid(*pde) )
+        {
+            lvl2 =3D lvl2_pd_pool_alloc();
+            *pde =3D paddr_to_pde(__pa(lvl2), PDE_VALID, XEN_PT_ENTRIES_=
LOG2_LVL_2);
+        }
+        else
+            lvl2 =3D (struct lvl2_pd *) pde_to_paddr(*pde);
+
+        /* Allocate LVL 3 PD if necessary */
+        pde =3D pt_entry(lvl2, page_addr);
+        if ( !pde_is_valid(*pde) )
+        {
+            lvl3 =3D lvl3_pd_pool_alloc();
+            *pde =3D paddr_to_pde(__pa(lvl3), PDE_VALID, XEN_PT_ENTRIES_=
LOG2_LVL_3);
+        }
+        else
+            lvl3 =3D (struct lvl3_pd *) pde_to_paddr(*pde);
+
+        /* Allocate LVL 4 PT if necessary */
+        pde =3D pt_entry(lvl3, page_addr);
+        if ( !pde_is_valid(*pde) )
+        {
+            lvl4 =3D lvl4_pt_pool_alloc();
+            *pde =3D paddr_to_pde(__pa(lvl4), PDE_VALID, XEN_PT_ENTRIES_=
LOG2_LVL_4);
+        }
+        else
+            lvl4 =3D (struct lvl4_pt *) pde_to_paddr(*pde);
+
+        /* Finally, create PTE in LVL 4 PT */
+        pte =3D pt_entry(lvl4, page_addr);
+        if ( !pte_is_valid(*pte) )
+        {
+            unsigned long paddr =3D (page_addr - map_start) + phys_base;
+            unsigned long flags;
+            radix_dprint(paddr, "being mapped to ");
+            radix_dprint(page_addr, "!\n");
+            if ( is_kernel_text(page_addr) || is_kernel_inittext(page_ad=
dr) )
+            {
+                radix_dprint(page_addr, "being marked as TEXT (RX)\n");
+                flags =3D PTE_XEN_RX;
+            }
+            else if ( is_kernel_rodata(page_addr) )
+            {
+                radix_dprint(page_addr, "being marked as RODATA (RO)\n")=
;
+                flags =3D PTE_XEN_RO;
+            }
+            else
+            {
+                radix_dprint(page_addr, "being marked as DEFAULT (RW)\n"=
);
+                flags =3D PTE_XEN_RW;
+            }
+
+            *pte =3D paddr_to_pte(paddr, flags);
+            radix_dprint(paddr_to_pte(paddr, flags).pte,
+                             "is result of PTE map!\n");
+        }
+        else
+        {
+            early_printk("BUG: Tried to create PTE for already-mapped pa=
ge!");
+            die();
+        }
+    }
+}
+
+static void setup_partition_table(struct patb_entry *patb, struct lvl1_p=
d *root)
+{
+    unsigned long ptcr;
+
+    /* Configure entry for LPID 0 to enable Radix and point to root PD *=
/
+    uint64_t patb0 =3D RTS_FIELD | __pa(root) | XEN_PT_ENTRIES_LOG2_LVL_=
1 | PATB0_HR;
+    uint64_t patb1 =3D __pa(initial_prtb) | (PRTB_SIZE_LOG2 - 12) | PATB=
1_GR;
+    patb[0].patb0 =3D cpu_to_be64(patb0);
+    patb[0].patb1 =3D cpu_to_be64(patb1);
+
+    ptcr =3D __pa(initial_patb) | (PATB_SIZE_LOG2 - 12);
+    mtspr(SPRN_PTCR, ptcr);
+}
+
+static void setup_process_table(struct prtb_entry *prtb, struct lvl1_pd =
*root)
+{
+    /* Configure entry for PID 0 to point to root PD */
+    uint64_t prtb0 =3D RTS_FIELD | __pa(root) | XEN_PT_ENTRIES_LOG2_LVL_=
1;
+    initial_prtb[0].prtb0 =3D cpu_to_be64(prtb0);
+}
+
+void __init setup_initial_pagetables(void)
+{
+    struct lvl1_pd *root =3D lvl1_pd_pool_alloc();
+    unsigned long lpcr;
+
+    setup_initial_mapping(root,
+                         (vaddr_t) _start,
+                         (vaddr_t) _end,
+                          __pa(_start));
+
+    /* Enable Radix mode in LPCR */
+    lpcr =3D mfspr(SPRN_LPCR);
+    mtspr(SPRN_LPCR, lpcr | LPCR_UPRT | LPCR_HR);
+    early_printk("Enabled radix in LPCR\n");
+
+    /* Set up initial process table */
+    setup_process_table(initial_prtb, root);
+
+    /* Set up initial partition table */
+    setup_partition_table(initial_patb, root);
+
+    /* Flush TLB */
+    tlbie_all();
+    early_printk("Flushed TLB\n");
+
+    /* Turn on the MMU */
+    enable_mmu();
+}
diff --git a/xen/arch/ppc/opal.c b/xen/arch/ppc/opal.c
index cc75ccfcbe..727f8726fa 100644
--- a/xen/arch/ppc/opal.c
+++ b/xen/arch/ppc/opal.c
@@ -1,8 +1,10 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
+#include "xen/compiler.h"
 #include <asm/boot.h>
 #include <asm/early_printk.h>
 #include <asm/opal-api.h>
 #include <asm/processor.h>
+#include <asm/mm.h>
 #include <xen/types.h>
 #include <xen/libfdt/libfdt.h>
 #include <xen/init.h>
diff --git a/xen/arch/ppc/ppc64/head.S b/xen/arch/ppc/ppc64/head.S
index beff8257fa..5ae85ae123 100644
--- a/xen/arch/ppc/ppc64/head.S
+++ b/xen/arch/ppc/ppc64/head.S
@@ -2,6 +2,7 @@
=20
 #include <asm/asm-defns.h>
 #include <asm/asm-offsets.h>
+#include <asm/msr.h>
=20
     .section .text.header, "ax", %progbits
=20
@@ -67,3 +68,17 @@ ENTRY(start)
=20
     .size start, . - start
     .type start, %function
+
+ENTRY(enable_mmu)
+    mflr %r3
+    mfmsr %r4
+
+    /* enable instruction and data relocation (MMU) */
+    ori %r4, %r4, (MSR_IR | MSR_DR)
+
+    mtsrr0 %r3 /* return to caller after MMU enable */
+    mtsrr1 %r4
+    rfid
+
+    .size enable_mmu, . - enable_mmu
+    .type enable_mmu, %function
diff --git a/xen/arch/ppc/setup.c b/xen/arch/ppc/setup.c
index bacd6d1acd..466993987b 100644
--- a/xen/arch/ppc/setup.c
+++ b/xen/arch/ppc/setup.c
@@ -7,6 +7,8 @@
 /* Xen stack for bringing up the first CPU. */
 unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __aligned(STACK_SIZ=
E);
=20
+void __init setup_initial_pagetables(void);
+
 void __init noreturn start_xen(unsigned long r3, unsigned long r4,
                                unsigned long r5, unsigned long r6,
                                unsigned long r7)
@@ -27,6 +29,8 @@ void __init noreturn start_xen(unsigned long r3, unsign=
ed long r4,
         boot_opal_init((void *) r3);
     }
=20
+    setup_initial_pagetables();
+
     early_printk("Hello, ppc64le!\n");
=20
     for ( ; ; )
diff --git a/xen/arch/ppc/tlb-radix.c b/xen/arch/ppc/tlb-radix.c
new file mode 100644
index 0000000000..69934076a7
--- /dev/null
+++ b/xen/arch/ppc/tlb-radix.c
@@ -0,0 +1,95 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Based on arch/powerpc/mm/book3s64/radix_tlb.c from Linux with the fol=
lowing
+ * copyright notice:
+ *
+ * Copyright 2015-2016, Aneesh Kumar K.V, IBM Corporation.
+ */
+#include <xen/stringify.h>
+
+#include <asm/bitops.h>
+#include <asm/msr.h>
+#include <asm/processor.h>
+
+/* TLB flush actions. Used as argument to tlbiel_flush() */
+enum
+{
+    TLB_INVAL_SCOPE_LPID,   /* invalidate TLBs for current LPID */
+    TLB_INVAL_SCOPE_GLOBAL, /* invalidate all TLBs */
+};
+
+#define POWER9_TLB_SETS_RADIX 128 /* # sets in POWER9 TLB Radix mode */
+
+#define RIC_FLUSH_TLB 0
+#define RIC_FLUSH_PWC 1
+#define RIC_FLUSH_ALL 2
+
+static void tlbiel_radix_set_isa300(unsigned int set, unsigned int is,
+                                    unsigned int pid, unsigned int ric,
+                                    unsigned int prs)
+{
+    unsigned long rb;
+    unsigned long rs;
+
+    rb =3D (set << PPC_BITLSHIFT(51)) | (is << PPC_BITLSHIFT(53));
+    rs =3D ((unsigned long) pid << PPC_BITLSHIFT(31));
+
+    asm volatile ( "tlbiel %0, %1, %2, %3, 1" :
+                  : "r"(rb), "r"(rs), "i"(ric), "i"(prs) : "memory" );
+}
+
+static void tlbiel_all_isa300(unsigned int num_sets, unsigned int is)
+{
+    unsigned int set;
+
+    asm volatile ( "ptesync" : : : "memory" );
+
+    /*
+     * Flush the first set of the TLB, and the entire Page Walk Cache
+     * and partition table entries. Then flush the remaining sets of the
+     * TLB.
+     */
+
+    if ( mfmsr() & MSR_HV )
+    {
+        /* MSR[HV] should flush partition scope translations first. */
+        tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 0);
+
+        for ( set =3D 1; set < num_sets; set++ )
+            tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, 0);
+    }
+
+    /* Flush process scoped entries. */
+    tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 1);
+
+    for ( set =3D 1; set < num_sets; set++ )
+        tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, 1);
+
+    asm volatile ( "ptesync" : : : "memory" );
+}
+
+void radix__tlbiel_all(unsigned int action)
+{
+    unsigned int is;
+
+    switch ( action )
+    {
+    case TLB_INVAL_SCOPE_GLOBAL:
+        is =3D 3;
+        break;
+    case TLB_INVAL_SCOPE_LPID:
+        is =3D 2;
+        break;
+    default:
+        die();
+    }
+
+    tlbiel_all_isa300(POWER9_TLB_SETS_RADIX, is);
+
+    asm volatile ( "slbia 7; isync" : : : "memory" );
+}
+
+void tlbie_all(void)
+{
+    radix__tlbiel_all(TLB_INVAL_SCOPE_GLOBAL);
+}
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 22:22:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 22:22:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571599.895857 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPVqL-0000DQ-S4; Fri, 28 Jul 2023 22:21:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571599.895857; Fri, 28 Jul 2023 22:21:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPVqL-0000D2-Mz; Fri, 28 Jul 2023 22:21:53 +0000
Received: by outflank-mailman (input) for mailman id 571599;
 Fri, 28 Jul 2023 22:21:52 +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
 <SRS0=/sdN=DO=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qPVqK-00009S-Q0
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 22:21:52 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 24bb9dd8-2d95-11ee-8613-37d641c3527e;
 Sat, 29 Jul 2023 00:21:49 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id E62AC8285801;
 Fri, 28 Jul 2023 17:21:47 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id 0TIUy0w6wXFa; Fri, 28 Jul 2023 17:21:47 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id CB73982857FC;
 Fri, 28 Jul 2023 17:21:46 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id DxTibyg5g8Zf; Fri, 28 Jul 2023 17:21:46 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 2EB1A82855B2;
 Fri, 28 Jul 2023 17:21:46 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 24bb9dd8-2d95-11ee-8613-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com CB73982857FC
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1690582906; bh=ITU52a7eCce67pnP3+1OZPWd+zxsKw/PGEUJYAvmX8U=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=XkDHHPQ+uEERQuUtmyhXgHCa2ifr0r3ARPU6B2dZ5eZDZrE9xC3kBsZkY6y90byoY
	 3hJfkjT4pk8w751U5j0rFYfrvxXDU/uYr4pdWHwvjgsXlIUB8R4AgNpMElXZ2qnwcL
	 iVBZWgE5KKsOj8wPabkmjQ5fUGNhKdppHg4q4+TY=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH 0/3] xen/ppc: Add early Radix MMU support
Date: Fri, 28 Jul 2023 17:21:27 -0500
Message-Id: <cover.1690582001.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Hello all,

This series adds support for bringing up the Radix MMU with basic
identity-mapped page tables.

In order to simplify the memory layout, the series changes XEN_VIRT
_START to 0xC000_0000_0000_0000, which has a couple of convenient
properties. When the MMU is off, the top 4 address bits are ignored by
the hardware, so this is equivalent to physical address 0.  When the MMU
is enabled, the top 4 address bits are used to select the memory
quadrant, and 0xC corresponds to quadrant 3 which is used for kernel
memory. Thus, by linking the kernel here and ensuring its physical load
address is 0x0, we are able to run at the correct address both before
and after the MMU is enabled.

Additionally, as the Radix MMU was only added in ISA 3.0 (POWER9), this
series also drops support for POWER8 for now, to avoid having a
non-working build configuration in-tree.

Thanks,
Shawn

Shawn Anastasio (3):
  xen/ppc: Bump minimum target ISA to 3.0 (POWER9)
  xen/ppc: Relocate kernel to physical address 0 on boot
  xen/ppc: Implement initial Radix MMU support

 xen/arch/ppc/Kconfig                 |   7 +-
 xen/arch/ppc/Makefile                |   2 +
 xen/arch/ppc/arch.mk                 |   1 -
 xen/arch/ppc/include/asm/bitops.h    |  11 ++
 xen/arch/ppc/include/asm/mm.h        |  19 ++
 xen/arch/ppc/include/asm/page-bits.h |   3 +-
 xen/arch/ppc/include/asm/page.h      | 178 ++++++++++++++++++
 xen/arch/ppc/include/asm/processor.h |  31 ++++
 xen/arch/ppc/include/asm/regs.h      | 138 ++++++++++++++
 xen/arch/ppc/include/asm/types.h     |   1 +
 xen/arch/ppc/mm-radix.c              | 268 +++++++++++++++++++++++++++
 xen/arch/ppc/opal.c                  |   2 +
 xen/arch/ppc/ppc64/head.S            |  42 +++++
 xen/arch/ppc/setup.c                 |   4 +
 xen/arch/ppc/tlb-radix.c             |  95 ++++++++++
 15 files changed, 794 insertions(+), 8 deletions(-)
 create mode 100644 xen/arch/ppc/include/asm/bitops.h
 create mode 100644 xen/arch/ppc/include/asm/mm.h
 create mode 100644 xen/arch/ppc/include/asm/page.h
 create mode 100644 xen/arch/ppc/include/asm/regs.h
 create mode 100644 xen/arch/ppc/mm-radix.c
 create mode 100644 xen/arch/ppc/tlb-radix.c

--
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 22:22:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 22:22:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571598.895850 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPVqL-00009w-In; Fri, 28 Jul 2023 22:21:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571598.895850; Fri, 28 Jul 2023 22:21:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPVqL-00009m-GD; Fri, 28 Jul 2023 22:21:53 +0000
Received: by outflank-mailman (input) for mailman id 571598;
 Fri, 28 Jul 2023 22:21:52 +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
 <SRS0=/sdN=DO=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qPVqK-00009S-J3
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 22:21:52 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 24e42c48-2d95-11ee-8613-37d641c3527e;
 Sat, 29 Jul 2023 00:21:49 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 67B198284F92;
 Fri, 28 Jul 2023 17:21:48 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id Vj5rpm8VOVmy; Fri, 28 Jul 2023 17:21:47 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 4B64382855B2;
 Fri, 28 Jul 2023 17:21:47 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id wXQNupUkuCKH; Fri, 28 Jul 2023 17:21:47 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id BD0EE828570D;
 Fri, 28 Jul 2023 17:21:46 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 24e42c48-2d95-11ee-8613-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 4B64382855B2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1690582907; bh=Tj98bYaTHUhk/36wxSvMA59uktHE3bprxIVbR60jf48=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=mFJ/9UU6nAYsCElsXMi/2mEIMgYg7izCQYrPb/2bfigKtP6hqtapZmDTmYXGW0KUg
	 Z2tpu9dWDipHyTwx30NaX+yrUHr+AeImV7pLF/xDKt6y2KrDbc3Ajx62fwjZBy93+h
	 IdF+u4ocnBuH/fP542S/bwaKlkDxkpS+zEFyca5U=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH 1/3] xen/ppc: Bump minimum target ISA to 3.0 (POWER9)
Date: Fri, 28 Jul 2023 17:21:28 -0500
Message-Id: <5504577c842e99ed16b0d3b88cac62bf61667e9c.1690582001.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1690582001.git.sanastasio@raptorengineering.com>
References: <cover.1690582001.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

In preparation for implementing ISA3+ Radix MMU support, drop ISA 2.07B
from the supported ISA list to avoid having a non-working
configuration in tree. It can be re-added at a later point when Hash
MMU support is added.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/ppc/Kconfig | 7 +------
 xen/arch/ppc/arch.mk | 1 -
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/xen/arch/ppc/Kconfig b/xen/arch/ppc/Kconfig
index b32dce39b8..ab116ffb2a 100644
--- a/xen/arch/ppc/Kconfig
+++ b/xen/arch/ppc/Kconfig
@@ -20,15 +20,10 @@ menu "ISA Selection"
=20
 choice
 	prompt "Base ISA"
-	default POWER_ISA_2_07B
+	default POWER_ISA_3_00
 	help
 	  This selects the base ISA version that Xen will target.
=20
-config POWER_ISA_2_07B
-	bool "Power ISA 2.07B (POWER8)"
-	help
-	  Target version 2.07B of the Power ISA (POWER8) or later
-
 config POWER_ISA_3_00
 	bool "Power ISA 3.00 (POWER9)"
 	help
diff --git a/xen/arch/ppc/arch.mk b/xen/arch/ppc/arch.mk
index 9f66f7a57b..f48ead6580 100644
--- a/xen/arch/ppc/arch.mk
+++ b/xen/arch/ppc/arch.mk
@@ -1,7 +1,6 @@
 ########################################
 # Power-specific definitions
=20
-ppc-march-$(CONFIG_POWER_ISA_2_07B) :=3D power8
 ppc-march-$(CONFIG_POWER_ISA_3_00) :=3D power9
=20
 CFLAGS +=3D -m64 -mlittle-endian -mcpu=3D$(ppc-march-y)
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 22:22:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 22:22:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571600.895870 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPVqN-0000eB-1M; Fri, 28 Jul 2023 22:21:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571600.895870; Fri, 28 Jul 2023 22:21:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPVqM-0000e4-Ub; Fri, 28 Jul 2023 22:21:54 +0000
Received: by outflank-mailman (input) for mailman id 571600;
 Fri, 28 Jul 2023 22:21:53 +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
 <SRS0=/sdN=DO=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qPVqL-00009S-9O
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 22:21:53 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 25069253-2d95-11ee-8613-37d641c3527e;
 Sat, 29 Jul 2023 00:21:49 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id B9ED582855B2;
 Fri, 28 Jul 2023 17:21:48 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id Msq2y8vS1EcQ; Fri, 28 Jul 2023 17:21:47 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 8B65D828570D;
 Fri, 28 Jul 2023 17:21:47 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id z44vgiV4To4s; Fri, 28 Jul 2023 17:21:47 -0500 (CDT)
Received: from raptor-ewks-026.lan (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 296608285801;
 Fri, 28 Jul 2023 17:21:47 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 25069253-2d95-11ee-8613-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 8B65D828570D
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1690582907; bh=+5ECp6wS9uRRFp9pqDwISksI9/iWLpR0QNbzLSOMVw8=;
	h=From:To:Date:Message-Id:MIME-Version;
	b=u/ZahkOXtdgsAlImPreLCuy0ejyJZinB+xlc2XNxQVa/M9KxfQYc9S1zIA+R93pzD
	 BDCbdR7yniTTH4WSjCT/hji8mLpkl4wvXLIAMkL1mFyezWevcqb5M19zNBB+6wZRI7
	 n9w4M5b3PPu4YDtFGE/PGbGZFKCdZC8d+AM52xLU=
X-Virus-Scanned: amavisd-new at rptsys.com
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH 2/3] xen/ppc: Relocate kernel to physical address 0 on boot
Date: Fri, 28 Jul 2023 17:21:29 -0500
Message-Id: <0802fad2743526da4fe49f0225e14161464f192e.1690582001.git.sanastasio@raptorengineering.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <cover.1690582001.git.sanastasio@raptorengineering.com>
References: <cover.1690582001.git.sanastasio@raptorengineering.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Introduce a small assembly loop in `start` to copy the kernel to
physical address 0 before continuing. This ensures that the physical
address lines up with XEN_VIRT_START (0xc000000000000000) and allows us
to identity map the kernel when the MMU is set up in the next patch.

We are also able to start execution at XEN_VIRT_START after the copy
since hardware will ignore the top 4 address bits when operating in Real
Mode (MMU off).

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/ppc/ppc64/head.S | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/xen/arch/ppc/ppc64/head.S b/xen/arch/ppc/ppc64/head.S
index 5ac2dad2ee..beff8257fa 100644
--- a/xen/arch/ppc/ppc64/head.S
+++ b/xen/arch/ppc/ppc64/head.S
@@ -18,6 +18,33 @@ ENTRY(start)
     addis   %r2, %r12, .TOC.-1b@ha
     addi    %r2, %r2, .TOC.-1b@l
=20
+    /*
+     * Copy Xen to physical address zero and jump to XEN_VIRT_START
+     * (0xc000000000000000). This works because the hardware will ignore=
 the top
+     * four address bits when the MMU is off.
+     */
+    LOAD_REG_ADDR(%r1, start)
+    LOAD_IMM64(%r12, XEN_VIRT_START)
+
+    /* If we're at the correct address, skip copy */
+    cmpld   %r1, %r12
+    beq     .L_correct_address
+
+    /* Copy bytes until _end */
+    LOAD_REG_ADDR(%r11, _end)
+    addi    %r1, %r1, -8
+    li      %r13, -8
+.L_copy_xen:
+    ldu     %r10, 8(%r1)
+    stdu    %r10, 8(%r13)
+    cmpld   %r1, %r11
+    blt     .L_copy_xen
+
+    /* Jump to XEN_VIRT_START */
+    mtctr   %r12
+    bctr
+.L_correct_address:
+
     /* set up the initial stack */
     LOAD_REG_ADDR(%r1, cpu0_boot_stack)
     li      %r11, 0
--=20
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Jul 28 23:08:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 23:08:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571607.895891 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPWZI-0006bq-Qb; Fri, 28 Jul 2023 23:08:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571607.895891; Fri, 28 Jul 2023 23:08:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPWZI-0006bj-O4; Fri, 28 Jul 2023 23:08:20 +0000
Received: by outflank-mailman (input) for mailman id 571607;
 Fri, 28 Jul 2023 23:08:20 +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
 <SRS0=Jbsw=DO=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qPWZI-0006bd-0D
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 23:08:20 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a239f704-2d9b-11ee-8613-37d641c3527e;
 Sat, 29 Jul 2023 01:08:17 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 93BCC62196;
 Fri, 28 Jul 2023 23:08:15 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AADCC433C8;
 Fri, 28 Jul 2023 23:08:13 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a239f704-2d9b-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690585695;
	bh=+pJJSoEay1f5TrZkP8X2Y7qCVMHae+jGGS10/4sO0js=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=LBcoqvAryi4xa5/pE51Cuh/ps1oCx/qdF0gS8SS1n8HdC9VQIUwFWXasBDolpojZt
	 FWmkH1icex0JCeP6CoTzsFvbk08CXTsMprgDlIw1+X4XZQOvqGwv5TrZg7bt4C7+XP
	 7OgoHTgxGLKPeqRE/UcecWhELyyzI7F60+6BMPV5Ws09SP3xQYfS2+vMnmqF6TcpJe
	 SRCgnndBn761CCEp/DIo/22W9Updh8T4bpz8STxjx6UDz2m4TZN3uHVcUxCAar2VIH
	 eqyiHq5YQLxtXULcqRo7t+UXOFjBY05M25XDE/FP0Gr23ngP5xg/GdTAwCyFMx3NXw
	 k8vveHXhF4zgQ==
Date: Fri, 28 Jul 2023 16:08:12 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
    Bertrand Marquis <bertrand.marquis@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Wei Liu <wl@xen.org>
Subject: Re: [XEN PATCH v2 1/2] xen/IRQ: address violations of MISRA C: 2012
 Rules 8.2 and 8.3
In-Reply-To: <6a72c66e2bfd83ca92c1fd9c702f6125d27062b1.1690544434.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307281608070.3118466@ubuntu-linux-20-04-desktop>
References: <cover.1690544434.git.federico.serafini@bugseng.com> <6a72c66e2bfd83ca92c1fd9c702f6125d27062b1.1690544434.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 28 Jul 2023, Federico Serafini wrote:
> Give a name to unnamed parameters thus addressing violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names and types used in function
> declarations and the ones used in the corresponding function
> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
> ("All declarations of an object or function shall use the same names
> and type qualifiers").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes in v2:
>   - use 'pirq' instead of 'irq';
>   - removed changes involving function pointers.
> ---
>  xen/arch/arm/irq.c        |  2 +-
>  xen/include/xen/irq.h     | 41 ++++++++++++++++++++-------------------
>  xen/include/xen/softirq.h |  2 +-
>  3 files changed, 23 insertions(+), 22 deletions(-)
> 
> diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
> index 16e56f8945..054bb281d8 100644
> --- a/xen/arch/arm/irq.c
> +++ b/xen/arch/arm/irq.c
> @@ -58,7 +58,7 @@ hw_irq_controller no_irq_type = {
>  static irq_desc_t irq_desc[NR_IRQS];
>  static DEFINE_PER_CPU(irq_desc_t[NR_LOCAL_IRQS], local_irq_desc);
>  
> -irq_desc_t *__irq_to_desc(int irq)
> +struct irq_desc *__irq_to_desc(int irq)
>  {
>      if ( irq < NR_LOCAL_IRQS )
>          return &this_cpu(local_irq_desc)[irq];
> diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
> index 300625e56d..9747e818f7 100644
> --- a/xen/include/xen/irq.h
> +++ b/xen/include/xen/irq.h
> @@ -110,22 +110,22 @@ typedef struct irq_desc {
>  #define irq_to_desc(irq)    (&irq_desc[irq])
>  #endif
>  
> -int init_one_irq_desc(struct irq_desc *);
> -int arch_init_one_irq_desc(struct irq_desc *);
> +int init_one_irq_desc(struct irq_desc *desc);
> +int arch_init_one_irq_desc(struct irq_desc *desc);
>  
>  #define irq_desc_initialized(desc) ((desc)->handler != NULL)
>  
>  extern int setup_irq(unsigned int irq, unsigned int irqflags,
> -                     struct irqaction *);
> +                     struct irqaction *new);
>  extern void release_irq(unsigned int irq, const void *dev_id);
>  extern int request_irq(unsigned int irq, unsigned int irqflags,
>                 void (*handler)(int, void *, struct cpu_user_regs *),
> -               const char * devname, void *dev_id);
> +               const char *devname, void *dev_id);
>  
>  extern hw_irq_controller no_irq_type;
>  void cf_check no_action(int cpl, void *dev_id, struct cpu_user_regs *regs);
> -unsigned int cf_check irq_startup_none(struct irq_desc *);
> -void cf_check irq_actor_none(struct irq_desc *);
> +unsigned int cf_check irq_startup_none(struct irq_desc *desc);
> +void cf_check irq_actor_none(struct irq_desc *desc);
>  #define irq_shutdown_none irq_actor_none
>  #define irq_disable_none irq_actor_none
>  #define irq_enable_none irq_actor_none
> @@ -146,7 +146,7 @@ struct pirq {
>  #define pirq_info(d, p) ((struct pirq *)radix_tree_lookup(&(d)->pirq_tree, p))
>  
>  /* Use this instead of pirq_info() if the structure may need allocating. */
> -extern struct pirq *pirq_get_info(struct domain *, int pirq);
> +extern struct pirq *pirq_get_info(struct domain *d, int pirq);
>  
>  #define pirq_field(d, p, f, def) ({ \
>      const struct pirq *__pi = pirq_info(d, p); \
> @@ -155,30 +155,31 @@ extern struct pirq *pirq_get_info(struct domain *, int pirq);
>  #define pirq_to_evtchn(d, pirq) pirq_field(d, pirq, evtchn, 0)
>  #define pirq_masked(d, pirq) pirq_field(d, pirq, masked, 0)
>  
> -void pirq_cleanup_check(struct pirq *, struct domain *);
> +void pirq_cleanup_check(struct pirq *pirq, struct domain *d);
>  
>  #define pirq_cleanup_check(pirq, d) \
>      ((pirq)->evtchn ? pirq_cleanup_check(pirq, d) : (void)0)
>  
> -extern void pirq_guest_eoi(struct pirq *);
> -extern void desc_guest_eoi(struct irq_desc *, struct pirq *);
> +extern void pirq_guest_eoi(struct pirq *pirq);
> +extern void desc_guest_eoi(struct irq_desc *desc, struct pirq *pirq);
>  extern int pirq_guest_unmask(struct domain *d);
> -extern int pirq_guest_bind(struct vcpu *, struct pirq *, int will_share);
> -extern void pirq_guest_unbind(struct domain *d, struct pirq *);
> -extern void pirq_set_affinity(struct domain *d, int irq, const cpumask_t *);
> -extern irq_desc_t *domain_spin_lock_irq_desc(
> -    struct domain *d, int irq, unsigned long *pflags);
> -extern irq_desc_t *pirq_spin_lock_irq_desc(
> -    const struct pirq *, unsigned long *pflags);
> +extern int pirq_guest_bind(struct vcpu *v, struct pirq *pirq, int will_share);
> +extern void pirq_guest_unbind(struct domain *d, struct pirq *pirq);
> +extern void pirq_set_affinity(struct domain *d, int pirq,
> +                              const cpumask_t *mask);
> +extern struct irq_desc *domain_spin_lock_irq_desc(
> +    struct domain *d, int pirq, unsigned long *pflags);
> +extern struct irq_desc *pirq_spin_lock_irq_desc(
> +    const struct pirq *pirq, unsigned long *pflags);
>  
> -unsigned int set_desc_affinity(struct irq_desc *, const cpumask_t *);
> +unsigned int set_desc_affinity(struct irq_desc *desc, const cpumask_t *mask);
>  
>  #ifndef arch_hwdom_irqs
> -unsigned int arch_hwdom_irqs(domid_t);
> +unsigned int arch_hwdom_irqs(domid_t domid);
>  #endif
>  
>  #ifndef arch_evtchn_bind_pirq
> -void arch_evtchn_bind_pirq(struct domain *, int pirq);
> +void arch_evtchn_bind_pirq(struct domain *d, int pirq);
>  #endif
>  
>  #endif /* __XEN_IRQ_H__ */
> diff --git a/xen/include/xen/softirq.h b/xen/include/xen/softirq.h
> index 1f6c4783da..33d6f2ecd2 100644
> --- a/xen/include/xen/softirq.h
> +++ b/xen/include/xen/softirq.h
> @@ -26,7 +26,7 @@ typedef void (*softirq_handler)(void);
>  void do_softirq(void);
>  void open_softirq(int nr, softirq_handler handler);
>  
> -void cpumask_raise_softirq(const cpumask_t *, unsigned int nr);
> +void cpumask_raise_softirq(const cpumask_t *mask, unsigned int nr);
>  void cpu_raise_softirq(unsigned int cpu, unsigned int nr);
>  void raise_softirq(unsigned int nr);
>  
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 23:13:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 23:13:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571609.895901 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPWdz-00081w-E1; Fri, 28 Jul 2023 23:13:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571609.895901; Fri, 28 Jul 2023 23:13:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPWdz-00081p-9x; Fri, 28 Jul 2023 23:13:11 +0000
Received: by outflank-mailman (input) for mailman id 571609;
 Fri, 28 Jul 2023 23:13:10 +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
 <SRS0=Jbsw=DO=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qPWdy-00081j-87
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 23:13:10 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4f9eb993-2d9c-11ee-8613-37d641c3527e;
 Sat, 29 Jul 2023 01:13:07 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 7AE2962201;
 Fri, 28 Jul 2023 23:13:06 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB2E3C433C8;
 Fri, 28 Jul 2023 23:13:04 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4f9eb993-2d9c-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690585985;
	bh=MGEgEeES9uVyGsG2fL5MOJ1TWGra4DkMJWJNqGc+lE0=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=KyC90UNHe4narjH+3zv3bbcVogAgU2vj1Fnlu+1yr2DhaisPaZ42WOji9Q3VcroKS
	 ZBR1e6SGLwRChiz4VjaBPta5dHo6Hv5H1ZK4lVI1hX6KTkKS5YQY2FJkcTWxuGaL/m
	 CKKPRKOzQHl6qxEmRUMOFeNBE4hmG7fofbuuLizw3taNsxkOlWp/jEWeG/Amq09xYl
	 1yUNXNxWWPNaaPHxqjmcTOnFBJJdLQGQVsjzkXNfOISlMRBWUm+mwWFvpbRMss7nBK
	 EDlRCm3gCf0b3+Sd37rVl19TOUZpVEzOEon+JRioP/QDsB3/uVIYNd+32IKLZszWt6
	 O79rYzHHkElyw==
Date: Fri, 28 Jul 2023 16:13:03 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>
Subject: Re: [XEN PATCH v2 2/2] x86/IRQ: address violations of MISRA C: 2012
 Rules 8.2 and 8.3
In-Reply-To: <da6fc50b926e72b497db251ca640c60244db3632.1690544434.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307281611360.3118466@ubuntu-linux-20-04-desktop>
References: <cover.1690544434.git.federico.serafini@bugseng.com> <da6fc50b926e72b497db251ca640c60244db3632.1690544434.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 28 Jul 2023, Federico Serafini wrote:
> Give a name to unnamed parameters thus addressing violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names and types used in function
> declarations and the ones used in the corresponding function
> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
> ("All declarations of an object or function shall use the same names
> and type qualifiers").
> 
> No functional changes
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>


Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Also one comment below



> ---
> Changes in v2:
>   - use 'pirq' instead of 'irq';
>   - removed changes involving function pointers.
> ---
>  xen/arch/x86/include/asm/irq.h | 30 +++++++++++++++---------------
>  xen/arch/x86/irq.c             |  4 ++--
>  2 files changed, 17 insertions(+), 17 deletions(-)
> 
> diff --git a/xen/arch/x86/include/asm/irq.h b/xen/arch/x86/include/asm/irq.h
> index 3f95dd39b7..ad907fc97f 100644
> --- a/xen/arch/x86/include/asm/irq.h
> +++ b/xen/arch/x86/include/asm/irq.h
> @@ -107,12 +107,12 @@ void alloc_direct_apic_vector(
>  
>  void do_IRQ(struct cpu_user_regs *regs);
>  
> -void cf_check disable_8259A_irq(struct irq_desc *);
> -void cf_check enable_8259A_irq(struct irq_desc *);
> +void cf_check disable_8259A_irq(struct irq_desc *desc);
> +void cf_check enable_8259A_irq(struct irq_desc *desc);
>  int i8259A_irq_pending(unsigned int irq);
>  void mask_8259A(void);
>  void unmask_8259A(void);
> -void init_8259A(int aeoi);
> +void init_8259A(int auto_eoi);
>  void make_8259A_irq(unsigned int irq);
>  bool bogus_8259A_irq(unsigned int irq);
>  int i8259A_suspend(void);
> @@ -142,15 +142,15 @@ struct arch_pirq {
>  #define pirq_dpci(pirq) ((pirq) ? &(pirq)->arch.hvm.dpci : NULL)
>  #define dpci_pirq(pd) container_of(pd, struct pirq, arch.hvm.dpci)
>  
> -int pirq_shared(struct domain *d , int irq);
> +int pirq_shared(struct domain *d , int pirq);
>  
>  int map_domain_pirq(struct domain *d, int pirq, int irq, int type,
>                             void *data);
>  int unmap_domain_pirq(struct domain *d, int pirq);
>  int get_free_pirq(struct domain *d, int type);
> -int get_free_pirqs(struct domain *, unsigned int nr);
> +int get_free_pirqs(struct domain *d, unsigned int nr);
>  void free_domain_pirqs(struct domain *d);
> -int map_domain_emuirq_pirq(struct domain *d, int pirq, int irq);
> +int map_domain_emuirq_pirq(struct domain *d, int pirq, int emuirq);
>  int unmap_domain_pirq_emuirq(struct domain *d, int pirq);
>  
>  /* Reset irq affinities to match the given CPU mask. */
> @@ -168,9 +168,9 @@ int irq_to_vector(int irq);
>   */
>  int create_irq(nodeid_t node, bool grant_access);
>  void destroy_irq(unsigned int irq);
> -int assign_irq_vector(int irq, const cpumask_t *);
> +int assign_irq_vector(int irq, const cpumask_t *mask);
>  
> -void cf_check irq_complete_move(struct irq_desc *);
> +void cf_check irq_complete_move(struct irq_desc *desc);
>  
>  extern struct irq_desc *irq_desc;
>  
> @@ -179,16 +179,16 @@ void unlock_vector_lock(void);
>  
>  void setup_vector_irq(unsigned int cpu);
>  
> -void move_native_irq(struct irq_desc *);
> -void move_masked_irq(struct irq_desc *);
> +void move_native_irq(struct irq_desc *desc);
> +void move_masked_irq(struct irq_desc *desc);
>  
> -int bind_irq_vector(int irq, int vector, const cpumask_t *);
> +int bind_irq_vector(int irq, int vector, const cpumask_t *mask);
>  
> -void cf_check end_nonmaskable_irq(struct irq_desc *, uint8_t vector);
> -void irq_set_affinity(struct irq_desc *, const cpumask_t *mask);
> +void cf_check end_nonmaskable_irq(struct irq_desc *desc, uint8_t vector);
> +void irq_set_affinity(struct irq_desc *desc, const cpumask_t *mask);

I am OK with this but please remember to also fix
xen/arch/arm/irq.c:irq_set_affinity which still uses "cpu_mask"


> -int init_domain_irq_mapping(struct domain *);
> -void cleanup_domain_irq_mapping(struct domain *);
> +int init_domain_irq_mapping(struct domain *d);
> +void cleanup_domain_irq_mapping(struct domain *d);
>  
>  #define domain_pirq_to_irq(d, pirq) pirq_field(d, pirq, arch.irq, 0)
>  #define domain_irq_to_pirq(d, irq) ({                           \
> diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
> index 20150b1c7f..6abfd81621 100644
> --- a/xen/arch/x86/irq.c
> +++ b/xen/arch/x86/irq.c
> @@ -177,7 +177,7 @@ static int __init _bind_irq_vector(struct irq_desc *desc, int vector,
>      return 0;
>  }
>  
> -int __init bind_irq_vector(int irq, int vector, const cpumask_t *cpu_mask)
> +int __init bind_irq_vector(int irq, int vector, const cpumask_t *mask)
>  {
>      struct irq_desc *desc = irq_to_desc(irq);
>      unsigned long flags;
> @@ -187,7 +187,7 @@ int __init bind_irq_vector(int irq, int vector, const cpumask_t *cpu_mask)
>  
>      spin_lock_irqsave(&desc->lock, flags);
>      spin_lock(&vector_lock);
> -    ret = _bind_irq_vector(desc, vector, cpu_mask);
> +    ret = _bind_irq_vector(desc, vector, mask);
>      spin_unlock(&vector_lock);
>      spin_unlock_irqrestore(&desc->lock, flags);
>  
> -- 
> 2.34.1
> 
> 


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 23:21:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 23:21:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571611.895911 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPWmE-00018U-5i; Fri, 28 Jul 2023 23:21:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571611.895911; Fri, 28 Jul 2023 23:21:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPWmE-00018N-2z; Fri, 28 Jul 2023 23:21:42 +0000
Received: by outflank-mailman (input) for mailman id 571611;
 Fri, 28 Jul 2023 23:21:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Jbsw=DO=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qPWmC-00018H-Oj
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 23:21:40 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 804100c6-2d9d-11ee-b24e-6b7b168915f2;
 Sat, 29 Jul 2023 01:21:38 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 7847E62211;
 Fri, 28 Jul 2023 23:21:37 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CE00C433C8;
 Fri, 28 Jul 2023 23:21:35 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 804100c6-2d9d-11ee-b24e-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690586496;
	bh=Mr5RfcB7qP5uFw9ESrP1TOOJBtOlGkEUG8RmF01Aqug=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=nZkElFFZADeLEWqBH0HCWCk1owlLZxHLneMSydXnMfLR/IwGtNFgs71lmEVyFQpRC
	 CWI5eJLHMbJtWJ5C/m5EmybWGAt+mI1D3HHvqVUJSfXBN+FJ/9JXbx85e/DVnqUJEr
	 GH47oCvHzmL/hDAVYx/fA2D5l81ex/Qn27ikic6DymEt6C1vg1Ojp8blAOEpOv9FL4
	 fIpljOFMOSGtNBBzMctAuMOHAwKXFV8tiIl2s9HllD1WaNCvNh6YIPvoRyj8GYvoK1
	 AQxwtVt8F9qFUWxm2M+qpP23qT50MBfO/XdVMLF4jioT/wObObymnVDO/wR8UxiKhn
	 jSdNicDyY5iHQ==
Date: Fri, 28 Jul 2023 16:21:34 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org, 
    michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, 
    consulting@bugseng.com, George Dunlap <george.dunlap@citrix.com>, 
    Dario Faggioli <dfaggioli@suse.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>
Subject: Re: [XEN PATCH v3] xen/sched: mechanical renaming to address MISRA
 C:2012 Rule 5.3
In-Reply-To: <12a21bfd59d85c7b8619631edac93d79d7225c60.1690547599.git.nicola.vetrini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307281621260.3118466@ubuntu-linux-20-04-desktop>
References: <12a21bfd59d85c7b8619631edac93d79d7225c60.1690547599.git.nicola.vetrini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 28 Jul 2023, Nicola Vetrini wrote:
> Rule 5.3 has the following headline:
> "An identifier declared in an inner scope shall not hide an
> identifier declared in an outer scope"
> 
> The renaming s/sched_id/scheduler_id/ of the function defined in
> 'xen/common/sched/core.c' prevents any hiding of that function
> by the instances of homonymous function parameters that
> are defined in inner scopes.
> 
> Similarly, the renames
> - s/ops/operations/ for the static variable in 'xen/common/sched/core.c'
> - s/do_softirq/needs_softirq/
> are introduced for variables, to avoid any conflict with homonymous
> parameters or function identifiers.
> 
> Moreover, the variable 'loop' defined at 'xen/common/sched/credit2.c:3887'
> has been dropped, in favour of the homonymous variable declared in the
> outer scope. This in turn requires a modification of the printk call that
> involves it.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes in v3:
> - removed stray changes to address the remarks
> Changes in v2:
> - s/softirq/needs_softirq/
> - Dropped local variable 'it'
> - Renamed the 'ops' static variable instead of function parameters
> in the idle scheduler for coherence.
> 
> Note: local variable 'j' in xen/common/sched/credit2.c:3812' should
> probably be unsigned as well, but I saw while editing the patch
> that it's used as a parameter to 'dump_pcpu', which takes an int.
> Possibly changing the types of parameters used in these calls is
> probably a good target for another patch, as it's not relevant
> w.r.t. Rule 5.3.
> ---
>  xen/common/sched/core.c    | 28 ++++++++++++++--------------
>  xen/common/sched/credit2.c |  6 +++---
>  xen/common/sysctl.c        |  2 +-
>  xen/include/xen/sched.h    |  2 +-
>  4 files changed, 19 insertions(+), 19 deletions(-)
> 
> diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
> index 022f548652..12deefa745 100644
> --- a/xen/common/sched/core.c
> +++ b/xen/common/sched/core.c
> @@ -91,7 +91,7 @@ extern const struct scheduler *__start_schedulers_array[], *__end_schedulers_arr
>  #define NUM_SCHEDULERS (__end_schedulers_array - __start_schedulers_array)
>  #define schedulers __start_schedulers_array
> 
> -static struct scheduler __read_mostly ops;
> +static struct scheduler __read_mostly operations;
> 
>  static bool scheduler_active;
> 
> @@ -171,7 +171,7 @@ static inline struct scheduler *dom_scheduler(const struct domain *d)
>       * is the default scheduler that has been, choosen at boot.
>       */
>      ASSERT(is_idle_domain(d));
> -    return &ops;
> +    return &operations;
>  }
> 
>  static inline struct scheduler *unit_scheduler(const struct sched_unit *unit)
> @@ -2040,10 +2040,10 @@ long do_set_timer_op(s_time_t timeout)
>      return 0;
>  }
> 
> -/* sched_id - fetch ID of current scheduler */
> -int sched_id(void)
> +/* scheduler_id - fetch ID of current scheduler */
> +int scheduler_id(void)
>  {
> -    return ops.sched_id;
> +    return operations.sched_id;
>  }
> 
>  /* Adjust scheduling parameter for a given domain. */
> @@ -2579,7 +2579,7 @@ static void cf_check sched_slave(void)
>      struct sched_unit    *prev = vprev->sched_unit, *next;
>      s_time_t              now;
>      spinlock_t           *lock;
> -    bool                  do_softirq = false;
> +    bool                  needs_softirq = false;
>      unsigned int          cpu = smp_processor_id();
> 
>      ASSERT_NOT_IN_ATOMIC();
> @@ -2604,7 +2604,7 @@ static void cf_check sched_slave(void)
>              return;
>          }
> 
> -        do_softirq = true;
> +        needs_softirq = true;
>      }
> 
>      if ( !prev->rendezvous_in_cnt )
> @@ -2614,7 +2614,7 @@ static void cf_check sched_slave(void)
>          rcu_read_unlock(&sched_res_rculock);
> 
>          /* Check for failed forced context switch. */
> -        if ( do_softirq )
> +        if ( needs_softirq )
>              raise_softirq(SCHEDULE_SOFTIRQ);
> 
>          return;
> @@ -3016,14 +3016,14 @@ void __init scheduler_init(void)
>          BUG_ON(!scheduler);
>          printk("Using '%s' (%s)\n", scheduler->name, scheduler->opt_name);
>      }
> -    ops = *scheduler;
> +    operations = *scheduler;
> 
>      if ( cpu_schedule_up(0) )
>          BUG();
>      register_cpu_notifier(&cpu_schedule_nfb);
> 
> -    printk("Using scheduler: %s (%s)\n", ops.name, ops.opt_name);
> -    if ( sched_init(&ops) )
> +    printk("Using scheduler: %s (%s)\n", operations.name, operations.opt_name);
> +    if ( sched_init(&operations) )
>          panic("scheduler returned error on init\n");
> 
>      if ( sched_ratelimit_us &&
> @@ -3363,7 +3363,7 @@ int schedule_cpu_rm(unsigned int cpu, struct cpu_rm_data *data)
> 
>  struct scheduler *scheduler_get_default(void)
>  {
> -    return &ops;
> +    return &operations;
>  }
> 
>  struct scheduler *scheduler_alloc(unsigned int sched_id)
> @@ -3392,7 +3392,7 @@ struct scheduler *scheduler_alloc(unsigned int sched_id)
> 
>  void scheduler_free(struct scheduler *sched)
>  {
> -    BUG_ON(sched == &ops);
> +    BUG_ON(sched == &operations);
>      sched_deinit(sched);
>      xfree(sched);
>  }
> @@ -3416,7 +3416,7 @@ void schedule_dump(struct cpupool *c)
>      }
>      else
>      {
> -        sched = &ops;
> +        sched = &operations;
>          cpus = &cpupool_free_cpus;
>      }
> 
> diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
> index 87a1e31ee9..fc583915df 100644
> --- a/xen/common/sched/credit2.c
> +++ b/xen/common/sched/credit2.c
> @@ -3874,7 +3874,7 @@ csched2_dump(const struct scheduler *ops)
> 
>              lock = unit_schedule_lock(unit);
> 
> -            printk("\t%3d: ", ++loop);
> +            printk("\t%3u: ", ++loop);
>              csched2_dump_unit(prv, svc);
> 
>              unit_schedule_unlock(lock, unit);
> @@ -3884,8 +3884,8 @@ csched2_dump(const struct scheduler *ops)
>      list_for_each_entry ( rqd, &prv->rql, rql )
>      {
>          struct list_head *iter, *runq = &rqd->runq;
> -        int loop = 0;
> 
> +        loop = 0;
>          /* We need the lock to scan the runqueue. */
>          spin_lock(&rqd->lock);
> 
> @@ -3901,7 +3901,7 @@ csched2_dump(const struct scheduler *ops)
> 
>              if ( svc )
>              {
> -                printk("\t%3d: ", loop++);
> +                printk("\t%3u: ", loop++);
>                  csched2_dump_unit(prv, svc);
>              }
>          }
> diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
> index 0cbfe8bd44..7cabfb0230 100644
> --- a/xen/common/sysctl.c
> +++ b/xen/common/sysctl.c
> @@ -71,7 +71,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
>          break;
> 
>      case XEN_SYSCTL_sched_id:
> -        op->u.sched_id.sched_id = sched_id();
> +        op->u.sched_id.sched_id = scheduler_id();
>          break;
> 
>      case XEN_SYSCTL_getdomaininfolist:
> diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
> index 854f3e32c0..bfe714d2e2 100644
> --- a/xen/include/xen/sched.h
> +++ b/xen/include/xen/sched.h
> @@ -791,7 +791,7 @@ int  sched_init_domain(struct domain *d, unsigned int poolid);
>  void sched_destroy_domain(struct domain *d);
>  long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *);
>  long sched_adjust_global(struct xen_sysctl_scheduler_op *);
> -int  sched_id(void);
> +int  scheduler_id(void);
> 
>  /*
>   * sched_get_id_by_name - retrieves a scheduler id given a scheduler name
> --
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Fri Jul 28 23:29:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 28 Jul 2023 23:29:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571613.895921 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPWtp-0001pN-Te; Fri, 28 Jul 2023 23:29:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571613.895921; Fri, 28 Jul 2023 23:29:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPWtp-0001pG-QO; Fri, 28 Jul 2023 23:29:33 +0000
Received: by outflank-mailman (input) for mailman id 571613;
 Fri, 28 Jul 2023 23:29:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Jbsw=DO=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qPWto-0001pA-5T
 for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 23:29:32 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 980ff52c-2d9e-11ee-b24e-6b7b168915f2;
 Sat, 29 Jul 2023 01:29:28 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 0C9B7621D4;
 Fri, 28 Jul 2023 23:29:27 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2564EC433C8;
 Fri, 28 Jul 2023 23:29:25 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 980ff52c-2d9e-11ee-b24e-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690586966;
	bh=0gksY2KY/LxlFXG/ONfHd8XHylf6WlReqpJAZ55LZj0=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=n8aXqn0vmRIZ5GRKj+AjKTP6jgUHc0VmnUy5PBdh8CbAsc3zkM2eHaDRpjatUV/Dc
	 Kgg8C2JCjK32zrOGGFu0M4ihWyX6jq+sKOFPFlWZ0wWDosVDCjVPwiRP1lLUK6zNUK
	 bQRRhucnyFuYxSIprCrdCtM9bdIRMMWFJ5Fm2BflFmaHFDwN730bTli8K7xxs5swxB
	 IMAb/9iYFC/Tr9nCq7T3fE5viutOmbmum9tv5b22M/Q7xz6hg9W0ZCvCgOWJtkbEOX
	 /UkcJ/4qn4W4L5rVYUcx0tbOJxfsZKRuLMXhAWTM1xpOre28dfbxwUqynFrxoecSGH
	 03bt+BD7ayu+Q==
Date: Fri, 28 Jul 2023 16:29:23 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Jan Beulich <jbeulich@suse.com>, Paul Durrant <paul@xen.org>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Xenia Ragiadakou <xenia.ragiadakou@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: Re: [XEN PATCH] IOMMU: address violations of MISRA C:2012 Rules 8.2
 and 8.3
In-Reply-To: <ba140642a267791c619dbbe2ba21f880c7e2b53e.1690551759.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307281626290.3118466@ubuntu-linux-20-04-desktop>
References: <ba140642a267791c619dbbe2ba21f880c7e2b53e.1690551759.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 28 Jul 2023, Federico Serafini wrote:
> Give a name to unnamed parameters to address violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names and types used in function
> declarations and the ones used in the corresponding function
> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
> ("All declarations of an object or function shall use the same names
> and type qualifiers").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  xen/drivers/passthrough/iommu.c | 10 +++++-----
>  xen/include/xen/iommu.h         | 30 ++++++++++++++++--------------
>  2 files changed, 21 insertions(+), 19 deletions(-)
> 
> diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
> index 0e187f6ae3..7bbe3889a2 100644
> --- a/xen/drivers/passthrough/iommu.c
> +++ b/xen/drivers/passthrough/iommu.c
> @@ -25,10 +25,10 @@
>  unsigned int __read_mostly iommu_dev_iotlb_timeout = 1000;
>  integer_param("iommu_dev_iotlb_timeout", iommu_dev_iotlb_timeout);
>  
> -bool_t __initdata iommu_enable = 1;
> -bool_t __read_mostly iommu_enabled;
> -bool_t __read_mostly force_iommu;
> -bool_t __read_mostly iommu_verbose;
> +bool __initdata iommu_enable = 1;
> +bool __read_mostly iommu_enabled;
> +bool __read_mostly force_iommu;
> +bool __read_mostly iommu_verbose;
>  static bool_t __read_mostly iommu_crash_disable;
>  
>  #define IOMMU_quarantine_none         0 /* aka false */
> @@ -57,7 +57,7 @@ int8_t __hwdom_initdata iommu_hwdom_reserved = -1;
>  bool __read_mostly iommu_hap_pt_share = true;
>  #endif
>  
> -bool_t __read_mostly iommu_debug;
> +bool __read_mostly iommu_debug;
>  
>  DEFINE_PER_CPU(bool_t, iommu_dont_flush_iotlb);
>  
> diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
> index 405db59971..8c0818cd01 100644
> --- a/xen/include/xen/iommu.h
> +++ b/xen/include/xen/iommu.h
> @@ -52,7 +52,7 @@ static inline bool_t dfn_eq(dfn_t x, dfn_t y)
>  }
>  
>  #ifdef CONFIG_HAS_PASSTHROUGH
> -extern bool_t iommu_enable, iommu_enabled;
> +extern bool iommu_enable, iommu_enabled;
>  extern bool force_iommu, iommu_verbose;
>  /* Boolean except for the specific purposes of drivers/passthrough/iommu.c. */
>  extern uint8_t iommu_quarantine;
> @@ -108,8 +108,8 @@ static inline void clear_iommu_hap_pt_share(void)
>  #endif
>  }
>  
> -extern bool_t iommu_debug;
> -extern bool_t amd_iommu_perdev_intremap;
> +extern bool iommu_debug;
> +extern bool amd_iommu_perdev_intremap;
>  
>  extern bool iommu_hwdom_strict, iommu_hwdom_passthrough, iommu_hwdom_inclusive;
>  extern int8_t iommu_hwdom_reserved;
> @@ -165,10 +165,10 @@ enum
>   * values indicate partial completion, which is possible only with
>   * IOMMUF_preempt passed in.
>   */
> -long __must_check iommu_map(struct domain *d, dfn_t dfn, mfn_t mfn,
> +long __must_check iommu_map(struct domain *d, dfn_t dfn0, mfn_t mfn0,
>                              unsigned long page_count, unsigned int flags,
>                              unsigned int *flush_flags);
> -long __must_check iommu_unmap(struct domain *d, dfn_t dfn,
> +long __must_check iommu_unmap(struct domain *d, dfn_t dfn0,
>                                unsigned long page_count, unsigned int flags,
>                                unsigned int *flush_flags);
>  
> @@ -197,11 +197,13 @@ bool_t iommu_has_feature(struct domain *d, enum iommu_feature feature);
>  
>  #ifdef CONFIG_HAS_PCI
>  struct pirq;
> -int hvm_do_IRQ_dpci(struct domain *, struct pirq *);
> -int pt_irq_create_bind(struct domain *, const struct xen_domctl_bind_pt_irq *);
> -int pt_irq_destroy_bind(struct domain *, const struct xen_domctl_bind_pt_irq *);
> +int hvm_do_IRQ_dpci(struct domain *d, struct pirq *pirq);
> +int pt_irq_create_bind(struct domain *d,
> +                       const struct xen_domctl_bind_pt_irq *pt_irq_bind);
> +int pt_irq_destroy_bind(struct domain *d,
> +                        const struct xen_domctl_bind_pt_irq *pt_irq_bind);
>  
> -struct hvm_irq_dpci *domain_get_irq_dpci(const struct domain *);
> +struct hvm_irq_dpci *domain_get_irq_dpci(const struct domain *d);
>  void free_hvm_irq_dpci(struct hvm_irq_dpci *dpci);
>  
>  struct msi_desc;
> @@ -229,8 +231,8 @@ int iommu_release_dt_devices(struct domain *d);
>   */
>  int iommu_add_dt_device(struct dt_device_node *np);
>  
> -int iommu_do_dt_domctl(struct xen_domctl *, struct domain *,
> -                       XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
> +int iommu_do_dt_domctl(struct xen_domctl *domctl, struct domain *d,
> +                       XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
>  
>  #endif /* HAS_DEVICE_TREE */
>  
> @@ -386,12 +388,12 @@ static inline int iommu_do_domctl(struct xen_domctl *domctl, struct domain *d,
>  int __must_check iommu_suspend(void);
>  void iommu_resume(void);
>  void iommu_crash_shutdown(void);
> -int iommu_get_reserved_device_memory(iommu_grdm_t *, void *);
> +int iommu_get_reserved_device_memory(iommu_grdm_t *func, void *ctxt);
>  int iommu_quarantine_dev_init(device_t *dev);
>  
>  #ifdef CONFIG_HAS_PCI
> -int iommu_do_pci_domctl(struct xen_domctl *, struct domain *d,
> -                        XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
> +int iommu_do_pci_domctl(struct xen_domctl *domctl, struct domain *d,
> +                        XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
>  #endif
>  
>  void iommu_dev_iotlb_flush_timeout(struct domain *d, struct pci_dev *pdev);
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Sat Jul 29 00:31:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 29 Jul 2023 00:31:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571618.895930 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPXrR-0001XF-7a; Sat, 29 Jul 2023 00:31:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571618.895930; Sat, 29 Jul 2023 00:31:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPXrR-0001X8-3v; Sat, 29 Jul 2023 00:31:09 +0000
Received: by outflank-mailman (input) for mailman id 571618;
 Sat, 29 Jul 2023 00:31:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=t5hJ=DP=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qPXrP-0001X2-JK
 for xen-devel@lists.xenproject.org; Sat, 29 Jul 2023 00:31:07 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 31dd45b3-2da7-11ee-b24e-6b7b168915f2;
 Sat, 29 Jul 2023 02:31:02 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id A71C76221A;
 Sat, 29 Jul 2023 00:31:00 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5099CC433C8;
 Sat, 29 Jul 2023 00:30:58 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 31dd45b3-2da7-11ee-b24e-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690590660;
	bh=E65BfXo+NNAEtLxoSRkSV8FUnlYv+Yl7ETAAF04F64g=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=TRonLo+J/H4YTqO6OXlw/pokXvjSoeOCY2CFlxX8qORHlBKv2n8DvzC4iB3693m7Y
	 lUEnkEtkWfXUD7om2/QmplveX+v5MX2dDHsRvtvi5Yn64pzxU4YiYfUMjYNNa9+iVE
	 wk6olq0kbiH9OdJVTT3YtLLdvTaNwebDIQ6XkY7/WGDMnhGhaHlNj7kT/6P6a35OPN
	 CgehopcuTBNMmba6m3Ja8V2pF0Plipm2QzbCpz5FvroSZQYuRnQ6+nYoqZz24xI6Oz
	 hoddNFBzkELFAkXOrt8KTJMZRPanT4wmZung665xx6VbiPj9x0AtmFLNFBFGRHrngI
	 uEQaWDdqX1ZWA==
Date: Fri, 28 Jul 2023 17:30:57 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Luca Fancellu <luca.fancellu@arm.com>
cc: xen-devel@lists.xenproject.org, bertrand.marquis@arm.com, wei.chen@arm.com, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Wei Liu <wl@xen.org>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Subject: Re: [RFC PATCH 0/5] clang-format for Xen
In-Reply-To: <20230728081144.4124309-1-luca.fancellu@arm.com>
Message-ID: <alpine.DEB.2.22.394.2307281716100.3118466@ubuntu-linux-20-04-desktop>
References: <20230728081144.4124309-1-luca.fancellu@arm.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 28 Jul 2023, Luca Fancellu wrote:
> ## Introduction ################################################################
> 
> In this serie, I would like to get feedbacks on the output generated by the
> configuration of clang-format, unfortunately we can't use only clang-format, but
> we need to call it using a wrapper, because we need the information of what
> files need to be excluded from the tool.
> 
> Another reason is that clang-format has some limitation when formatting asm()
> instruction and most of the time it format them in a very ugly way or it breaks
> the code for example removing spaces that were there for a reason (I don't think
> it's a tool to format asm), so in the wrapper script we protect all asm()
> invocation or macros where there are asm() invocation with in-code comments that
> stops clang-format to act on that section:
> 
> /* clang-format off */section/* clang-format on */
> 
> I've read the past threads about the brave people who dared to try to introduce
> clang-format for the xen codebase, some of them from 5 years ago, two points
> were clear: 1) goto label needs to be indented and 2) do-while loops have the
> braket in the same line.
> While point 1) was quite a blocker, it seemd to me that point 2) was less
> controversial to be changed in the Xen codestyle, so the current wrapper script
> handles only the point 1 (which is easy), the point 2 can be more tricky to
> handle.

Are these the only 2 points to discuss?

I think as a next step it would be worth listing all the code style
decision points we need to make as a group and then go over them during
one of the next calls.


> ## The clang-format configuration ##############################################
> 
> In my clang-format configuration I've taken inspiration from EPAM's work, then
> from the configuration in Linux and finally from the clang-format manual, to try
> to produce a comprehensive configuration.
> 
> Every configuration parameter has on top a comment with the description and
> when it was supported, finally I've added also a [not specified] if that
> behavior is not clearly specified in the Xen coding style, I've done that so
> we could discuss about adding more specification in our CODING_STYLE.
> Every comment can be stripped out in the final release of the file, but I think
> that now they are useful for the discussion.
> 
> The minimum clang-format version for the file is 15, my ubuntu 22.04 comes with
> it, we can reason if it's too high, or if we could also use the latest version
> maybe shipped inside a docker image.
> 
> For every [not specified] behavior, I've tried to guess it from the codebase,
> I've seen that also in that case it's not easy as there is (sometimes) low
> consistency between modules, so we can discuss on every configurable.
> 
> Worth to mention, the public header are all excluded from the format tool,
> because formatting them breaks the build on X86, because there are scripts for
> auto-generation that don't handle the formatted headers, I didn't investigate
> on it, maybe it can be added as technical debt.
> 
> So I've tried building arm32, arm64 and x86_64 with the formatted output and
> they build, I've used Yocto for that.
> 
> ## How to try it? ##############################################################
> 
> So how to generate everything? Just invoke the codestyle.py script without
> parameter and it will format every .c and .h file in the hypervisor codebase.
> 
> ./xen/scripts/codestyle.py
> 
> Optionally you can also pass one or more relative path from the folder you are
> invoking the script and it will format only them.

Thanks for the amazing work Luca. I did as described above and generate
a 9MB diff patch :-)

I scrolled through it and most of it makes sense but a few things look
weird. Copy/pasting them here individually not to add a 9MB diff in
attachment.

> diff --git a/xen/arch/arm/acpi/boot.c b/xen/arch/arm/acpi/boot.c
> index db5085e15d..398dea92e6 100644
> --- a/xen/arch/arm/acpi/boot.c
> +++ b/xen/arch/arm/acpi/boot.c
> @@ -52,7 +52,7 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
>  {
>      int i;
>      int rc;
> -    u64 mpidr = processor->arm_mpidr & MPIDR_HWID_MASK;
> +    u64 mpidr    = processor->arm_mpidr & MPIDR_HWID_MASK;
>      bool enabled = processor->flags & ACPI_MADT_ENABLED;
>  
>      if ( mpidr == MPIDR_INVALID )

Do we need the = alignment?


It is causing other weird looking changes:

>    rsdp = (struct acpi_table_rsdp *)base_ptr;
>     /* Replace xsdt_physical_address */
>     rsdp->xsdt_physical_address = tbl_add[TBL_XSDT].start;
>-    checksum = acpi_tb_checksum(ACPI_CAST_PTR(u8, rsdp), table_size);
>+    checksum       = acpi_tb_checksum(ACPI_CAST_PTR(u8, rsdp), table_size);
>     rsdp->checksum = rsdp->checksum - checksum;
 
[...]

>  #ifdef CONFIG_MULTIBOOT
> -int __init xsm_multiboot_policy_init(
> -    unsigned long *module_map, const multiboot_info_t *mbi,
> -    void **policy_buffer, size_t *policy_size)
> +int __init xsm_multiboot_policy_init(unsigned long *module_map,
> +                                     const multiboot_info_t *mbi,
> +                                     void **policy_buffer, size_t *policy_size)
>  {
>      int i;
>      module_t *mod = (module_t *)__va(mbi->mods_addr);
> -    int rc = 0;
> +    int rc        = 0;
>      u32 *_policy_start;
>      unsigned long _policy_len;
 
Can we take the = alignment out? Without it, most other things look
good, at least at first glance.

Also this looks a bit unnecessary, but not a blocker for me:

> @@ -908,8 +895,7 @@ static int __init efi_check_dt_boot(const EFI_LOADED_IMAGE *loaded_image)
>  }
>  
>  static void __init efi_arch_cpu(void)
> -{   
> -}       
> +{}
>      

I think we should:
- identify "weird" changes like the above
- discuss them as a group, like we do with MISRA, and decide how to
  address them
- once everyone is happy with the new format, come up with a plan on how
  to merge a 9MB patch


From xen-devel-bounces@lists.xenproject.org Sat Jul 29 01:00:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 29 Jul 2023 01:00:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571621.895944 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPYJg-0003i6-ES; Sat, 29 Jul 2023 01:00:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571621.895944; Sat, 29 Jul 2023 01:00:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPYJg-0003hK-AS; Sat, 29 Jul 2023 01:00:20 +0000
Received: by outflank-mailman (input) for mailman id 571621;
 Sat, 29 Jul 2023 01:00:19 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPYJf-0003Ae-2M; Sat, 29 Jul 2023 01:00:19 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPYJf-0005Ok-0j; Sat, 29 Jul 2023 01:00:19 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPYJe-00021o-EU; Sat, 29 Jul 2023 01:00:18 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qPYJe-0003he-Ds; Sat, 29 Jul 2023 01:00:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=jxEwM732yWXBmZdHSWn17jxIrCuMeKqV9bNPRT1/+Cw=; b=qjSjrTlyVuJ4QIl/gxJMj0B9Y9
	raICkb7cmyiQGahQGR4chevgxvAskP9K+TiUmL/wv9Uqd8knXW3lCZtPWK1957mW77JdXtROLHcDY
	A+DF+7nGlK8/UWkVFjq2bIpGeYYYn02XIun2gyt5/mBW5NFuoil0E6TEGITtMS+G8rYs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182055-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-5.4 test] 182055: regressions - FAIL
X-Osstest-Failures:
    linux-5.4:build-arm64-xsm:xen-build:fail:regression
    linux-5.4:test-armhf-armhf-xl-credit2:guest-start:fail:heisenbug
    linux-5.4:test-armhf-armhf-xl-arndale:guest-start/debian.repeat:fail:heisenbug
    linux-5.4:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    linux-5.4:test-arm64-arm64-libvirt-xsm:build-check(1):blocked:nonblocking
    linux-5.4:test-arm64-arm64-xl-xsm:build-check(1):blocked:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit1:guest-start/debian.repeat:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=887433e4bc9394676d22c038dba33a27405f94e8
X-Osstest-Versions-That:
    linux=27745d94abe1036a3423cb8577b665c01725e321
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 29 Jul 2023 01:00:18 +0000

flight 182055 linux-5.4 real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182055/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-arm64-xsm               6 xen-build                fail REGR. vs. 182001

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-credit2  14 guest-start      fail in 182031 pass in 182055
 test-armhf-armhf-xl-arndale  18 guest-start/debian.repeat  fail pass in 182031
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat  fail pass in 182031

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-libvirt-xsm  1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-xsm       1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-credit1 18 guest-start/debian.repeat fail in 182031 like 182001
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check fail in 182031 never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check fail in 182031 never pass
 test-arm64-arm64-xl-xsm     15 migrate-support-check fail in 182031 never pass
 test-arm64-arm64-xl-xsm 16 saverestore-support-check fail in 182031 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182001
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182001
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 182001
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 182001
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 182001
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182001
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 182001
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 182001
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 182001
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 182001
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 182001
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182001
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                887433e4bc9394676d22c038dba33a27405f94e8
baseline version:
 linux                27745d94abe1036a3423cb8577b665c01725e321

Last test of basis   182001  2023-07-24 17:45:59 Z    4 days
Testing same since   182031  2023-07-27 07:14:08 Z    1 days    2 attempts

------------------------------------------------------------
312 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              fail    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 blocked 
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      blocked 
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 10044 lines long.)


From xen-devel-bounces@lists.xenproject.org Sat Jul 29 01:04:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 29 Jul 2023 01:04:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571625.895953 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPYNp-0003yt-0E; Sat, 29 Jul 2023 01:04:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571625.895953; Sat, 29 Jul 2023 01:04:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPYNo-0003ym-Tp; Sat, 29 Jul 2023 01:04:36 +0000
Received: by outflank-mailman (input) for mailman id 571625;
 Sat, 29 Jul 2023 01:04:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPYNo-0003yc-24; Sat, 29 Jul 2023 01:04:36 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPYNo-0005ZR-0h; Sat, 29 Jul 2023 01:04:36 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPYNn-0002BH-Km; Sat, 29 Jul 2023 01:04:35 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qPYNn-0004dm-KD; Sat, 29 Jul 2023 01:04:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=0PZdcP4kTjC+QrSOBeU3R9euqmySrV1rp6jyvhl4WmI=; b=NMuFYbkDwONAitBGec6yIkC3Ei
	nLvtd91+stti/5l5b2/M/HIw8OK1FdSZhXCSM31sLidSbGJYdS3DS6ef9pshBHb3knv3he5c17far
	+cXO+S8ZCWXbMXcubvbEvvkrNatqfDnIZB0zr5fXLFeZlb0Hjf6F2c6zRcATrT/5Kifg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182063-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 182063: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=a40c3aa126ac5956ef2de266dc52d048e26ae576
X-Osstest-Versions-That:
    xen=dbd566ab729d2839c3c0be5c47cdcc06c2c477f0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 29 Jul 2023 01:04:35 +0000

flight 182063 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182063/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  a40c3aa126ac5956ef2de266dc52d048e26ae576
baseline version:
 xen                  dbd566ab729d2839c3c0be5c47cdcc06c2c477f0

Last test of basis   182054  2023-07-28 08:03:30 Z    0 days
Testing same since   182063  2023-07-28 21:01:57 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Olaf Hering <olaf@aepfle.de>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   dbd566ab72..a40c3aa126  a40c3aa126ac5956ef2de266dc52d048e26ae576 -> smoke


From xen-devel-bounces@lists.xenproject.org Sat Jul 29 02:30:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 29 Jul 2023 02:30:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571630.895964 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPZic-0005Zt-0T; Sat, 29 Jul 2023 02:30:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571630.895964; Sat, 29 Jul 2023 02:30:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPZib-0005Zm-SE; Sat, 29 Jul 2023 02:30:09 +0000
Received: by outflank-mailman (input) for mailman id 571630;
 Sat, 29 Jul 2023 02:30:08 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPZia-0005Zc-1O; Sat, 29 Jul 2023 02:30:08 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPZiZ-0007xS-V1; Sat, 29 Jul 2023 02:30:08 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPZiZ-0006dF-Hu; Sat, 29 Jul 2023 02:30:07 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qPZiZ-00043p-Cz; Sat, 29 Jul 2023 02:30:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Qpakuun0qHJS7Dg3P3+hmqtagZ9REXu0bDIq8xlYuk4=; b=xW/DlNUf2rl1h6rLLl7k1cWfHI
	XJ9YxujMD4mHh486rR0bQzbYEv/mWDQem7TglGwDXARwwOMqRS+IXyeIHD+i7D5SvIpRC+ZcOdEEj
	DdRHLpyfYpmi7IrRqCjJ47iAh/QtV57PZyQkKJEoRbq0/u64aAV/gpAJ0KGjLA1IS4+U=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182058-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 182058: regressions - trouble: broken/fail/pass
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:<job status>:broken:regression
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:host-install(5):broken:regression
    qemu-mainline:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:regression
    qemu-mainline:test-amd64-i386-xl-qemuu-win7-amd64:windows-install:fail:regression
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-vhd:guest-start:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qcow2:guest-start/debian.repeat:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=f33c74576425fac2cbb0725229895fe096df4261
X-Osstest-Versions-That:
    qemuu=ccdd31267678db9d80578b5f80bbe94141609ef4
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 29 Jul 2023 02:30:07 +0000

flight 182058 qemu-mainline real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182058/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm    <job status>      broken
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 5 host-install(5) broken REGR. vs. 182029
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail REGR. vs. 182029
 test-amd64-i386-xl-qemuu-win7-amd64 12 windows-install   fail REGR. vs. 182029

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182029
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182029
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 182029
 test-armhf-armhf-xl-vhd      13 guest-start                  fail  like 182029
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 182029
 test-amd64-amd64-xl-qcow2    21 guest-start/debian.repeat    fail  like 182029
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 182029
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182029
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182029
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass

version targeted for testing:
 qemuu                f33c74576425fac2cbb0725229895fe096df4261
baseline version:
 qemuu                ccdd31267678db9d80578b5f80bbe94141609ef4

Last test of basis   182029  2023-07-27 03:42:56 Z    1 days
Testing same since   182058  2023-07-28 13:08:59 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Hanna Czenczek <hreitz@redhat.com>
  Richard Henderson <richard.henderson@linaro.org>
  Sam Li <faithilikerun@gmail.com>
  Stefan Hajnoczi <stefanha@redhat.com>
  Stefano Garzarella <sgarzare@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           broken  
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    fail    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      fail    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm broken
broken-step test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm host-install(5)

Not pushing.

------------------------------------------------------------
commit f33c74576425fac2cbb0725229895fe096df4261
Merge: ccdd312676 1c38fe69e2
Author: Richard Henderson <richard.henderson@linaro.org>
Date:   Thu Jul 27 17:41:55 2023 -0700

    Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging
    
    Pull request
    
    Please include these bug fixes in QEMU 8.1. Thanks!
    
    # -----BEGIN PGP SIGNATURE-----
    #
    # iQEzBAABCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmTCzPUACgkQnKSrs4Gr
    # c8g1DAf/fPUQ4zRsCn079pHIyK9TFo4COm23p4kiusxj8otfjt8LH1Zsc9pGWC2+
    # bl2RlnPID8JlyJFDRN7b/RCEhj45a83GtCmhDDmqVgy1eO5vwOKm2XyyWeD+pq/U
    # Hf2QLPLZZ7tCD8Njpty+gB3Ux4zqthKGXSg8FpJ3w0tl4me2efLvjMa6jHMwtnHT
    # aAbyQ3WMpT9w4XHLqRQDHzBqrTSY4od3nl9SrM/DQ2klLIcz8ECTEZVBY9B3pq6m
    # QvAg24tfb0QvS14YnZv/PMCfOaVuE87M9G4f93pCynnMxMYze+XczL0sGhIAS9wp
    # 03NgGlhGumOix6r2kHjlG6p3xywV8A==
    # =jMf8
    # -----END PGP SIGNATURE-----
    # gpg: Signature made Thu 27 Jul 2023 01:00:53 PM PDT
    # gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
    # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
    # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
    
    * tag 'block-pull-request' of https://gitlab.com/stefanha/qemu:
      block/blkio: use blkio_set_int("fd") to check fd support
      block/blkio: fall back on using `path` when `fd` setting fails
      block/blkio: retry blkio_connect() if it fails using `fd`
      block/blkio: move blkio_connect() in the drivers functions
      block: Fix pad_request's request restriction
      block/file-posix: fix g_file_get_contents return path
      block/blkio: do not use open flags in qemu_open()
      block/blkio: enable the completion eventfd
    
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

commit 1c38fe69e2b8a05c1762b122292fa7e3662f06fd
Author: Stefano Garzarella <sgarzare@redhat.com>
Date:   Thu Jul 27 18:10:20 2023 +0200

    block/blkio: use blkio_set_int("fd") to check fd support
    
    Setting the `fd` property fails with virtio-blk-* libblkio drivers
    that do not support fd passing since
    https://gitlab.com/libblkio/libblkio/-/merge_requests/208.
    
    Getting the `fd` property, on the other hand, always succeeds for
    virtio-blk-* libblkio drivers even when they don't support fd passing.
    
    This patch switches to setting the `fd` property because it is a
    better mechanism for probing fd passing support than getting the `fd`
    property.
    
    Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
    Message-id: 20230727161020.84213-5-sgarzare@redhat.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

commit 723bea27b127969931fa26bc0de79372a3d9e148
Author: Stefano Garzarella <sgarzare@redhat.com>
Date:   Thu Jul 27 18:10:19 2023 +0200

    block/blkio: fall back on using `path` when `fd` setting fails
    
    qemu_open() fails if called with an unix domain socket in this way:
        -blockdev node-name=drive0,driver=virtio-blk-vhost-user,path=vhost-user-blk.sock,cache.direct=on: Could not open 'vhost-user-blk.sock': No such device or address
    
    Since virtio-blk-vhost-user does not support fd passing, let`s always fall back
    on using `path` if we fail the fd passing.
    
    Fixes: cad2ccc395 ("block/blkio: use qemu_open() to support fd passing for virtio-blk")
    Reported-by: Qing Wang <qinwang@redhat.com>
    Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
    Message-id: 20230727161020.84213-4-sgarzare@redhat.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

commit 809c319f8a089fbc49223dc29e1cc2b978beeada
Author: Stefano Garzarella <sgarzare@redhat.com>
Date:   Thu Jul 27 18:10:18 2023 +0200

    block/blkio: retry blkio_connect() if it fails using `fd`
    
    libblkio 1.3.0 added support of "fd" property for virtio-blk-vhost-vdpa
    driver. In QEMU, starting from commit cad2ccc395 ("block/blkio: use
    qemu_open() to support fd passing for virtio-blk") we are using
    `blkio_get_int(..., "fd")` to check if the "fd" property is supported
    for all the virtio-blk-* driver.
    
    Unfortunately that property is also available for those driver that do
    not support it, such as virtio-blk-vhost-user.
    
    So, `blkio_get_int()` is not enough to check whether the driver supports
    the `fd` property or not. This is because the virito-blk common libblkio
    driver only checks whether or not `fd` is set during `blkio_connect()`
    and fails with -EINVAL for those transports that do not support it
    (all except vhost-vdpa for now).
    
    So let's handle the `blkio_connect()` failure, retrying it using `path`
    directly.
    
    Fixes: cad2ccc395 ("block/blkio: use qemu_open() to support fd passing for virtio-blk")
    Suggested-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
    Message-id: 20230727161020.84213-3-sgarzare@redhat.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

commit 69785d66ae1ec43f77fc65109a21721992bead9f
Author: Stefano Garzarella <sgarzare@redhat.com>
Date:   Thu Jul 27 18:10:17 2023 +0200

    block/blkio: move blkio_connect() in the drivers functions
    
    This is in preparation for the next patch, where for virtio-blk
    drivers we need to handle the failure of blkio_connect().
    
    Let's also rename the *_open() functions to *_connect() to make
    the code reflect the changes applied.
    
    Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
    Message-id: 20230727161020.84213-2-sgarzare@redhat.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

commit ef256751e970bff435d40a8348dd51d81e67e52e
Author: Hanna Czenczek <hreitz@redhat.com>
Date:   Fri Jul 14 10:59:38 2023 +0200

    block: Fix pad_request's request restriction
    
    bdrv_pad_request() relies on requests' lengths not to exceed SIZE_MAX,
    which bdrv_check_qiov_request() does not guarantee.
    
    bdrv_check_request32() however will guarantee this, and both of
    bdrv_pad_request()'s callers (bdrv_co_preadv_part() and
    bdrv_co_pwritev_part()) already run it before calling
    bdrv_pad_request().  Therefore, bdrv_pad_request() can safely call
    bdrv_check_request32() without expecting error, too.
    
    In effect, this patch will not change guest-visible behavior.  It is a
    clean-up to tighten a condition to match what is guaranteed by our
    callers, and which exists purely to show clearly why the subsequent
    assertion (`assert(*bytes <= SIZE_MAX)`) is always true.
    
    Note there is a difference between the interfaces of
    bdrv_check_qiov_request() and bdrv_check_request32(): The former takes
    an errp, the latter does not, so we can no longer just pass
    &error_abort.  Instead, we need to check the returned value.  While we
    do expect success (because the callers have already run this function),
    an assert(ret == 0) is not much simpler than just to return an error if
    it occurs, so let us handle errors by returning them up the stack now.
    
    Reported-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
    Message-id: 20230714085938.202730-1-hreitz@redhat.com
    Fixes: 18743311b829cafc1737a5f20bc3248d5f91ee2a
           ("block: Collapse padded I/O vecs exceeding IOV_MAX")
    Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

commit 29a242e165610df9b158bdb8d6b84e83d8733fc4
Author: Sam Li <faithilikerun@gmail.com>
Date:   Thu Jul 27 19:58:44 2023 +0800

    block/file-posix: fix g_file_get_contents return path
    
    The g_file_get_contents() function returns a g_boolean. If it fails, the
    returned value will be 0 instead of -1. Solve the issue by skipping
    assigning ret value.
    
    This issue was found by Matthew Rosato using virtio-blk-{pci,ccw} backed
    by an NVMe partition e.g. /dev/nvme0n1p1 on s390x.
    
    Signed-off-by: Sam Li <faithilikerun@gmail.com>
    Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: Daniel P. BerrangÃ© <berrange@redhat.com>
    Message-id: 20230727115844.8480-1-faithilikerun@gmail.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

commit a5942c177b7bcc1357e496b7d68668befcfc2bb9
Author: Stefano Garzarella <sgarzare@redhat.com>
Date:   Wed Jul 26 09:48:07 2023 +0200

    block/blkio: do not use open flags in qemu_open()
    
    qemu_open() in blkio_virtio_blk_common_open() is used to open the
    character device (e.g. /dev/vhost-vdpa-0 or /dev/vfio/vfio) or in
    the future eventually the unix socket.
    
    In all these cases we cannot open the path in read-only mode,
    when the `read-only` option of blockdev is on, because the exchange
    of IOCTL commands for example will fail.
    
    In order to open the device read-only, we have to use the `read-only`
    property of the libblkio driver as we already do in blkio_file_open().
    
    Fixes: cad2ccc395 ("block/blkio: use qemu_open() to support fd passing for virtio-blk")
    Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2225439
    Reported-by: Qing Wang <qinwang@redhat.com>
    Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
    Reviewed-by: Daniel P. BerrangÃ© <berrange@redhat.com>
    Message-id: 20230726074807.14041-1-sgarzare@redhat.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

commit 9359c459889fce1804c4e1b2a2ff8f182b4a9ae8
Author: Stefano Garzarella <sgarzare@redhat.com>
Date:   Tue Jul 25 12:37:44 2023 +0200

    block/blkio: enable the completion eventfd
    
    Until libblkio 1.3.0, virtio-blk drivers had completion eventfd
    notifications enabled from the start, but from the next releases
    this is no longer the case, so we have to explicitly enable them.
    
    In fact, the libblkio documentation says they could be disabled,
    so we should always enable them at the start if we want to be
    sure to get completion eventfd notifications:
    
        By default, the driver might not generate completion events for
        requests so it is necessary to explicitly enable the completion
        file descriptor before use:
    
        void blkioq_set_completion_fd_enabled(struct blkioq *q, bool enable);
    
    I discovered this while trying a development version of libblkio:
    the guest kernel hangs during boot, while probing the device.
    
    Fixes: fd66dbd424f5 ("blkio: add libblkio block driver")
    Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
    Message-id: 20230725103744.77343-1-sgarzare@redhat.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


From xen-devel-bounces@lists.xenproject.org Sat Jul 29 05:09:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 29 Jul 2023 05:09:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571635.895974 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPcD1-0006So-0f; Sat, 29 Jul 2023 05:09:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571635.895974; Sat, 29 Jul 2023 05:09:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPcD0-0006Sh-St; Sat, 29 Jul 2023 05:09:42 +0000
Received: by outflank-mailman (input) for mailman id 571635;
 Sat, 29 Jul 2023 05:09:41 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPcCz-0006SX-1Q; Sat, 29 Jul 2023 05:09:41 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPcCy-0004kf-UN; Sat, 29 Jul 2023 05:09:40 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPcCy-0007jI-Io; Sat, 29 Jul 2023 05:09:40 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qPcCy-0000Nj-IK; Sat, 29 Jul 2023 05:09:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=iVc0xJ23t5anFAb7N+4R5v9LLx90IF9GMgY2AMFDIL8=; b=WKzviUkAynkk+x0oTtyIGQbBOf
	kyrY0yAMSSThRr6bWGYOpNoXN95uBMP2vkJwQh4ecagg5IpK8I5sKlRLE6V0FS280Oi6xl/Hi8rGp
	6RvVE6hyYe2D7nBDViQM2nikBxLBrEovS/d+ZHQHmcJoPP33eEFrATcFtopq9PGcfPOU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182066-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 182066: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=fff3c99f84589a876fcd8467ea99f2c8d9ff8d21
X-Osstest-Versions-That:
    xen=a40c3aa126ac5956ef2de266dc52d048e26ae576
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 29 Jul 2023 05:09:40 +0000

flight 182066 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182066/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  fff3c99f84589a876fcd8467ea99f2c8d9ff8d21
baseline version:
 xen                  a40c3aa126ac5956ef2de266dc52d048e26ae576

Last test of basis   182063  2023-07-28 21:01:57 Z    0 days
Testing same since   182066  2023-07-29 02:00:29 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Federico Serafini <federico.serafini@bugseng.com>
  Julien Grall <jgrall@amazon.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Olaf Hering <olaf@aepfle.de>
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   a40c3aa126..fff3c99f84  fff3c99f84589a876fcd8467ea99f2c8d9ff8d21 -> smoke


From xen-devel-bounces@lists.xenproject.org Sat Jul 29 07:20:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 29 Jul 2023 07:20:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571649.895993 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPeFg-0004QM-Ds; Sat, 29 Jul 2023 07:20:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571649.895993; Sat, 29 Jul 2023 07:20:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPeFg-0004QF-AS; Sat, 29 Jul 2023 07:20:36 +0000
Received: by outflank-mailman (input) for mailman id 571649;
 Sat, 29 Jul 2023 07:20:35 +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
 <SRS0=iOEa=DP=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qPeFf-0004Q9-Ej
 for xen-devel@lists.xenproject.org; Sat, 29 Jul 2023 07:20:35 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2060d.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::60d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 65acf673-2de0-11ee-8613-37d641c3527e;
 Sat, 29 Jul 2023 09:20:31 +0200 (CEST)
Received: from AS4P191CA0008.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:5d5::19)
 by DB5PR08MB9997.eurprd08.prod.outlook.com (2603:10a6:10:4a2::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Sat, 29 Jul
 2023 07:20:26 +0000
Received: from AM7EUR03FT053.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:5d5:cafe::38) by AS4P191CA0008.outlook.office365.com
 (2603:10a6:20b:5d5::19) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29 via Frontend
 Transport; Sat, 29 Jul 2023 07:20:26 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM7EUR03FT053.mail.protection.outlook.com (100.127.140.202) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6631.29 via Frontend Transport; Sat, 29 Jul 2023 07:20:25 +0000
Received: ("Tessian outbound f1e964b3a9be:v145");
 Sat, 29 Jul 2023 07:20:25 +0000
Received: from 0692f4d17dec.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 4B14785D-0D2F-4C19-806F-1E4E12787D31.1; 
 Sat, 29 Jul 2023 07:19:12 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0692f4d17dec.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Sat, 29 Jul 2023 07:19:12 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by DBBPR08MB5996.eurprd08.prod.outlook.com (2603:10a6:10:201::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Sat, 29 Jul
 2023 07:19:09 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::4c7d:6a1:e742:3b1a]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::4c7d:6a1:e742:3b1a%4]) with mapi id 15.20.6631.026; Sat, 29 Jul 2023
 07:19:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 65acf673-2de0-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=AmocA8nxFIKUDHH9u0C1YwEW2P8RPX6bl8AbK62wCI4=;
 b=VgZQL7SNgzUVTclXTdR7ut3QtXsCOWVFLiZODQ0wwKVRbNqEI2S7YAeuljBUx5faoDbszZvsvzETzR//+joFKUCE/VDj2hReyTvF7MniynK4/Z1127tZwIpAoLVEY6kP2C+M4Ml9NguICPFImBmZIx95yYEoaHeRm0L2wQlKCB8=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 2cf2075a04edad71
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LI9DYK5wTy//a7JIQ/vVfE9TUob8Tj33luBiSRoNc06bzaX2BMaPOt8CnO90qOUEAGfFzNIScP0iqBfax654XQSiR1ax5omUgjItg7lQX9oXk+r7bPAqNsk79/NAzxqPWtHoJi7ucyNFpvIejUNO0tNEsZcu7GCeu/k+1hsbcostYiBnIH+VUptjqllrwFnbu+AzgXoEf+MmJvZFOAOkjro3XG570YVqTANn/PesuE9VczGC4werBB4IWloy4p3KaaX3Y71PwiNBv2tfX4DLrReurxvubdW712dZokoHqrumH0HWnvzQZoryOLft60+HZ/+7e0RhOGu9IjKXxd7x8w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=AmocA8nxFIKUDHH9u0C1YwEW2P8RPX6bl8AbK62wCI4=;
 b=TEyA49npT1tJAJccVxAyU3KqdEJuQT8qPbXz18gUGo8PQOcoXo2oi/XyzSXYtIN2m6INgmAiJebbYpTtynDzgt4EufVOKsDAF6sWVF9eipAwe3yDOYTMTQRmMaP11yK/8+PVPPZKr4iLHpFTeFrfHKLd9JVv2W0VC7aPAo/E0bqB7RANTNMF5OGRCSopGygfWUS8hhxcdnd7AILIhiVbDbzsjUG7QBsPE9/mVnNgLyoFjbnWc8oeBNrTLaW5RJy7tWjHicjg0cfjb4RI9EvuZPzSRk2AqQnAh5cn8VbOQ4kT3QIZ7LbN7M1mRiB5KaLySoGuilwxTzHldaZBbydOkw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=AmocA8nxFIKUDHH9u0C1YwEW2P8RPX6bl8AbK62wCI4=;
 b=VgZQL7SNgzUVTclXTdR7ut3QtXsCOWVFLiZODQ0wwKVRbNqEI2S7YAeuljBUx5faoDbszZvsvzETzR//+joFKUCE/VDj2hReyTvF7MniynK4/Z1127tZwIpAoLVEY6kP2C+M4Ml9NguICPFImBmZIx95yYEoaHeRm0L2wQlKCB8=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Stefano Stabellini <sstabellini@kernel.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, Wei Chen <Wei.Chen@arm.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, George Dunlap <george.dunlap@citrix.com>, Jan
 Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, Wei Liu
	<wl@xen.org>, =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
Subject: Re: [RFC PATCH 0/5] clang-format for Xen
Thread-Topic: [RFC PATCH 0/5] clang-format for Xen
Thread-Index: AQHZwSsi+9CDC2ydc0GfW83JpXFIW6/P5YuAgABx/QA=
Date: Sat, 29 Jul 2023 07:19:08 +0000
Message-ID: <F35FF142-6F0B-4140-A9A9-52840E9E55A9@arm.com>
References: <20230728081144.4124309-1-luca.fancellu@arm.com>
 <alpine.DEB.2.22.394.2307281716100.3118466@ubuntu-linux-20-04-desktop>
In-Reply-To:
 <alpine.DEB.2.22.394.2307281716100.3118466@ubuntu-linux-20-04-desktop>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|DBBPR08MB5996:EE_|AM7EUR03FT053:EE_|DB5PR08MB9997:EE_
X-MS-Office365-Filtering-Correlation-Id: 856448fd-d9ae-4b81-1aec-08db90044782
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 Sf/YVNikqC+ZfVSh4XalASoJwCLax+yhZIUmutDBiihT2uKYa4+2sxLCID+o/6/z9UfpimvI+NJtRYmwZB7gJdbwquQ91C53u24P9XxwWlP1oxCYuwdt6UybiYq+m3icJ1D8RQ9Ah1Amszr51daShYDnHLoQP0t4DLWnWZeL+5Zj5KId5nU4n+o/JmczeIEbSOr+dvj1aokfyRGluObDG/7PhMqce4eRh6KYhZGDKomUVFko998v5P2HsuOa35bxOd4KiVitWFcMDwhdGs4DIFbnzLjxD3LX/JA2jVWFRhgE8B3dbhrZIQgv6YbF437UAHn57eeGD46DKSrbKhQNyVveVCxKyB+mQwXJJ3NpyZb5V5iTIcLSdnkV4uboUsTgPPRj6Q4JB2bbSV3PxMxKebTL6hR1ByfSg8Xt3sBxqQhaIgpLbtx4JIttucov9Enx14wRZuErETlNtW/M3TJFIG8pusU34p3/40G1iDuzYcpbhWOVdi3TVAtAaZU4B85Bpi8D+MDDitQ5wPiXuDgMHUeq7KUtrb7kP30aU2kp5uEcLMr4Q8cn/OKFzr1EV2LOtVJ9VcSkbLGcak0UZu9iC5N2piWXAc2JRwP8EJU9Z1IoDD8BkQIwV2n4xknZ2obzV3eVR4ONfp3HLYInzjZmYg==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(376002)(39860400002)(396003)(366004)(451199021)(186003)(54906003)(6486002)(6512007)(478600001)(6916009)(83380400001)(38070700005)(86362001)(33656002)(36756003)(4326008)(66446008)(2906002)(71200400001)(6506007)(66476007)(53546011)(2616005)(26005)(316002)(64756008)(66946007)(38100700002)(66556008)(122000001)(76116006)(91956017)(41300700001)(8936002)(8676002)(5660300002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <5FC7D8EE56C2154FBD9B30EE46D7CC23@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB5996
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM7EUR03FT053.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	6c61c0d1-ac7f-4922-a875-08db900419cd
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	zeiF+PxUA3bIhdZ56URRLwwwje4FXt+rS39ZutTvwHKq2kKx3zYeVFJ+PK5vKRkl8CdUCR2YOzZLr4oxHmlftfYn/RF1ddT1+5lV+6bEscRQlayXGN/UL/9zmw3R6rGKO+FgZ2Xu5sOpat3ILXMttMqLcsTL2cs8lmqw5uA6gWM0EcyYyruKP39E78DU0LwlHymGeYAeIlJntqNZLFviB/y1lrEPBLpwxfb83Ur/InNl+t23wW8bAd8ttHYZ8ZDe3vtftgNRyv7V6jZh5+9dYcCuZkR3CbmN+qz6V5xcBJ6GohtjzuDqih06KhP5r9G4Vr7dJvOViwhdJhose+S2HAz6qtXuK6bpBt7DtFUkkbMMGrfLe090EgGmHx4g1iNPxB4KZ21jyebvCm9318zgh/73fwzCYT9GwpKKrjpRm9tuhk1dKPB1LsrcMHCKlfFtwc1RdsXVDZUZSkmeucgysHk1ERniijDdA8j4ve73F6nYufM0krgIDnL0b+z+ZeKEgeCHDzVeAwGSDlJRs+d+r97Wg9pIptgFLvPnOUQu6nBYZ+7QAPDUZgGXu6pMBXsMN940vMALAv+PxWO0JChGtqDhiWUB3mnD7fImhKhgUJH6qMkIR5z1APlP5V6JqfBNzp1FTmuWQHZ+n5Ln5pMsj/jAIX7BojtC1tDfvmvMIYWr3qY39RuSEmP7TTzpZeMA+v999wHrF/4LWmzOaWap/WRwW74vAW13r7QMBCCTswY=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39850400004)(376002)(346002)(396003)(136003)(82310400008)(451199021)(36840700001)(40470700004)(46966006)(2906002)(41300700001)(316002)(86362001)(40460700003)(8676002)(6862004)(8936002)(33656002)(36756003)(40480700001)(5660300002)(336012)(356005)(81166007)(186003)(2616005)(54906003)(53546011)(82740400003)(478600001)(6486002)(107886003)(6506007)(6512007)(26005)(47076005)(36860700001)(70586007)(70206006)(4326008)(83380400001);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2023 07:20:25.6253
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 856448fd-d9ae-4b81-1aec-08db90044782
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM7EUR03FT053.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR08MB9997

DQoNCj4gT24gMjkgSnVsIDIwMjMsIGF0IDAxOjMwLCBTdGVmYW5vIFN0YWJlbGxpbmkgPHNzdGFi
ZWxsaW5pQGtlcm5lbC5vcmc+IHdyb3RlOg0KPiANCj4gT24gRnJpLCAyOCBKdWwgMjAyMywgTHVj
YSBGYW5jZWxsdSB3cm90ZToNCj4+ICMjIEludHJvZHVjdGlvbiAjIyMjIyMjIyMjIyMjIyMjIyMj
IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjDQo+PiANCj4+IElu
IHRoaXMgc2VyaWUsIEkgd291bGQgbGlrZSB0byBnZXQgZmVlZGJhY2tzIG9uIHRoZSBvdXRwdXQg
Z2VuZXJhdGVkIGJ5IHRoZQ0KPj4gY29uZmlndXJhdGlvbiBvZiBjbGFuZy1mb3JtYXQsIHVuZm9y
dHVuYXRlbHkgd2UgY2FuJ3QgdXNlIG9ubHkgY2xhbmctZm9ybWF0LCBidXQNCj4+IHdlIG5lZWQg
dG8gY2FsbCBpdCB1c2luZyBhIHdyYXBwZXIsIGJlY2F1c2Ugd2Ugbm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LSBvbmNlIGV2
ZXJ5b25lIGlzIGhhcHB5IHdpdGggdGhlIG5ldyBmb3JtYXQsIGNvbWUgdXAgd2l0aCBhIHBsYW4g
b24gaG93DQo+ICB0byBtZXJnZSBhIDlNQiBwYXRjaA0KDQpZZXMsIGNsZWFybHkgd2Ugd2lsbCBo
YXZlIHRoZSByZWxlYXNlIHNvb24sIHNvIHVudGlsIHRoYXQsIEkgY2FuIGNvbGxlY3QgYWxsIHRo
ZSBmZWVkYmFja3MgYW5kDQpvcmdhbmlzZSB0aGVtIHNvIHRoYXQgYWZ0ZXIgdGhlIHJlbGVhc2Us
IHdoZW4gcGVvcGxlIGhhdmUgbW9yZSB0aW1lLCB3ZSBjYW4gZGlzY3VzcyBldmVyeQ0KcG9pbnQg
YW5kIGlkZW50aWZ5IHByaW9yaXRpZXMgYW5kIG91dHN0YW5kaW5nIGlzc3Vlcy4NCg0KDQpDaGVl
cnMsDQpMdWNhDQoNCg0KDQoNCg==


From xen-devel-bounces@lists.xenproject.org Sat Jul 29 08:38:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 29 Jul 2023 08:38:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571672.896004 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPfTB-0004Ry-FV; Sat, 29 Jul 2023 08:38:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571672.896004; Sat, 29 Jul 2023 08:38:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPfTB-0004Rr-AJ; Sat, 29 Jul 2023 08:38:37 +0000
Received: by outflank-mailman (input) for mailman id 571672;
 Sat, 29 Jul 2023 08:38:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPfTA-0004Rh-7W; Sat, 29 Jul 2023 08:38:36 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPfTA-0001Wl-3Z; Sat, 29 Jul 2023 08:38:36 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPfT9-0008WG-HR; Sat, 29 Jul 2023 08:38:35 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qPfT9-0006NS-Gf; Sat, 29 Jul 2023 08:38:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=UmR2On7btkrQR/Ohy48jg2ryIaBVv6eE5X1VwGJIyic=; b=xSeL2jnIEajWzCadeRwv+DhxwC
	WPB3N/NfC2wu4EblNqOX68MO4hQSp6j3Td48X1HNPWCj9jx7U85HntbdUNCDdVnZ7w9gqfdY3fNGv
	mYJnTMHtqtgtmqb7eBrkGzumXsL7ffq9o2YnCEnBsm/XlcbntDR8xzoSTDKSdBQ13Vl0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182060-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 182060: regressions - FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-pair:xen-install/dst_host:fail:regression
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=dbd566ab729d2839c3c0be5c47cdcc06c2c477f0
X-Osstest-Versions-That:
    xen=0b1171be87698bc7d14760383c0770aeb6e41dd4
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 29 Jul 2023 08:38:35 +0000

flight 182060 xen-unstable real [real]
flight 182070 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/182060/
http://logs.test-lab.xenproject.org/osstest/logs/182070/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-i386-pair         11 xen-install/dst_host     fail REGR. vs. 182012

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182012
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 182012
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 182012
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182012
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 182012
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182012
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 182012
 test-armhf-armhf-xl-vhd      13 guest-start                  fail  like 182012
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 182012
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 182012
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 182012
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 182012
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182012
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 xen                  dbd566ab729d2839c3c0be5c47cdcc06c2c477f0
baseline version:
 xen                  0b1171be87698bc7d14760383c0770aeb6e41dd4

Last test of basis   182012  2023-07-25 19:27:43 Z    3 days
Failing since        182027  2023-07-26 21:35:59 Z    2 days    3 attempts
Testing same since   182060  2023-07-28 14:24:54 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Anthony PERARD <anthony.perard@citrix.com>
  Bertrand Marquis <bertrand.marquis@arm.com>
  Federico Serafini <federico.serafini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Juergen Gross <jgross@suse.com>
  Julien Grall <jgrall@amazon.com>
  Leo Yan <leo.yan@linaro.org>
  Luca Fancellu <luca.fancellu@arm.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
  Peter Hoyes <Peter.Hoyes@arm.com>
  Rahul Singh <rahul.singh@arm.com>
  Roger Pau Monne <roger.pau@citrix.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>
  Shawn Anastasio <sanastasio@raptorengineering.com>
  Simone Ballarin <simone.ballarin@bugseng.com>
  Stefano Stabellini <sstabellini@kernel.org>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      fail    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 846 lines long.)


From xen-devel-bounces@lists.xenproject.org Sat Jul 29 08:48:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 29 Jul 2023 08:48:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571684.896012 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPfcT-00063n-Bs; Sat, 29 Jul 2023 08:48:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571684.896012; Sat, 29 Jul 2023 08:48:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPfcT-00063g-9D; Sat, 29 Jul 2023 08:48:13 +0000
Received: by outflank-mailman (input) for mailman id 571684;
 Sat, 29 Jul 2023 08:48:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C7MR=DP=bytedance.com=zhengqi.arch@srs-se1.protection.inumbo.net>)
 id 1qPfcR-00063F-GB
 for xen-devel@lists.xenproject.org; Sat, 29 Jul 2023 08:48:11 +0000
Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com
 [2607:f8b0:4864:20::436])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a452fac3-2dec-11ee-b24f-6b7b168915f2;
 Sat, 29 Jul 2023 10:48:09 +0200 (CEST)
Received: by mail-pf1-x436.google.com with SMTP id
 d2e1a72fcca58-682ae5d4184so685358b3a.1
 for <xen-devel@lists.xenproject.org>; Sat, 29 Jul 2023 01:48:09 -0700 (PDT)
Received: from ?IPV6:fdbd:ff1:ce00:1c25:884:3ed:e1db:b610?
 ([240e:694:e21:b::2]) by smtp.gmail.com with ESMTPSA id
 s1-20020a62e701000000b00687087d8bc3sm2935245pfh.141.2023.07.29.01.47.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 29 Jul 2023 01:48:07 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a452fac3-2dec-11ee-b24f-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bytedance.com; s=google; t=1690620488; x=1691225288;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=AbdgPGpGzwv3Ba9ss/qbC8w4dcIJ6EfJ8tT9+ztVBsQ=;
        b=DZFLwwmJndUW6zfnORbYzoucbeb9saaQKrl/QBur5VgS6P58gRgdpp8MYduMN550+T
         ThpBMQd+wqwbcBoSGmvKI7V9Ma4LCpYLWFunl5NiegFEHJNTQE3HPx1j7Fgc5gNqx8Iq
         YHUiWta6/cfbGMyg9gyEl8Eynz728/mHaw1lMQy+t/GfUp9Wqb7L9kJmHKg93SZhln4L
         nQEOOjCm3XtItdkVREm8m6+qA283u73jSwvq4ou9Fha1ZKE4dHZmspSiYw7ywEJDGstN
         q98qzRnKmdM4q9DzoCiLAmxpMakkQvrAM25zQsh718wYNXYSnABRZn4Jdwg4vno9Osq9
         PVdQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690620488; x=1691225288;
        h=content-transfer-encoding:in-reply-to:from:references:cc:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=AbdgPGpGzwv3Ba9ss/qbC8w4dcIJ6EfJ8tT9+ztVBsQ=;
        b=QW8gLIczRqlEaOxnzLIfuQchp6d5F39Rl/zwhmd0Cljr02h2rJYCHnxRtiVXneTrVi
         PBzCpznk5dXo9aA1Mq1X2S5KpDUpNk6+KXgkdEG/YiFhRwEk8q1rIC+jSTJWZpvug7tc
         bOHBJRhT5v+/SoaMqrbiBLnwd9X8ZILCaWAxRL9+mVILOHZIyCHfPM1OUrJaIaOScDr7
         axLPqWiwJxauiwG68njoWJxlqMshpmVYCheb+bBieMcXh4RzL6KvXWFRw5R+tHX/YP6H
         jkE+9BDcMr6bf6XONLhxExlY/o25CtzGWER3sVDStewcj5GW2b5RvGp72a36/z5Q6/Nm
         t2hA==
X-Gm-Message-State: ABy/qLZUGm4c6Y3P1sGB0V6NQCj3QKNo+sI0l9fK2/ip2310+J9KRKIk
	qq/8RMrgutZm4m4+7F2QAAeixQ==
X-Google-Smtp-Source: APBJJlGU4WvDtIE3roPXfr2RIP3jnPqKjXBKgd99me7vK4BYh3P3V9BBkMbm8JQkpcQK7ib8McexOg==
X-Received: by 2002:a05:6a00:32c8:b0:67f:7403:1fe8 with SMTP id cl8-20020a056a0032c800b0067f74031fe8mr1763906pfb.3.1690620488142;
        Sat, 29 Jul 2023 01:48:08 -0700 (PDT)
Message-ID: <5e50711c-a616-f95f-d6d2-c69627ac3cf0@bytedance.com>
Date: Sat, 29 Jul 2023 16:47:57 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Subject: Re: [PATCH v3 05/49] mm: shrinker: add infrastructure for dynamically
 allocating shrinker
Content-Language: en-US
To: Simon Horman <simon.horman@corigine.com>
Cc: akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru,
 vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org,
 brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com,
 cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com,
 gregkh@linuxfoundation.org, muchun.song@linux.dev,
 linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net,
 cluster-devel@redhat.com, linux-nfs@vger.kernel.org,
 linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org,
 dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 dm-devel@redhat.com, linux-raid@vger.kernel.org,
 linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org,
 linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
 linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org
References: <20230727080502.77895-1-zhengqi.arch@bytedance.com>
 <20230727080502.77895-6-zhengqi.arch@bytedance.com>
 <ZMOx0y+wdHEATDho@corigine.com>
From: Qi Zheng <zhengqi.arch@bytedance.com>
In-Reply-To: <ZMOx0y+wdHEATDho@corigine.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Simon,

On 2023/7/28 20:17, Simon Horman wrote:
> On Thu, Jul 27, 2023 at 04:04:18PM +0800, Qi Zheng wrote:
>> Currently, the shrinker instances can be divided into the following three
>> types:
>>
>> a) global shrinker instance statically defined in the kernel, such as
>>     workingset_shadow_shrinker.
>>
>> b) global shrinker instance statically defined in the kernel modules, such
>>     as mmu_shrinker in x86.
>>
>> c) shrinker instance embedded in other structures.
>>
>> For case a, the memory of shrinker instance is never freed. For case b,
>> the memory of shrinker instance will be freed after synchronize_rcu() when
>> the module is unloaded. For case c, the memory of shrinker instance will
>> be freed along with the structure it is embedded in.
>>
>> In preparation for implementing lockless slab shrink, we need to
>> dynamically allocate those shrinker instances in case c, then the memory
>> can be dynamically freed alone by calling kfree_rcu().
>>
>> So this commit adds the following new APIs for dynamically allocating
>> shrinker, and add a private_data field to struct shrinker to record and
>> get the original embedded structure.
>>
>> 1. shrinker_alloc()
>>
>> Used to allocate shrinker instance itself and related memory, it will
>> return a pointer to the shrinker instance on success and NULL on failure.
>>
>> 2. shrinker_register()
>>
>> Used to register the shrinker instance, which is same as the current
>> register_shrinker_prepared().
>>
>> 3. shrinker_free()
>>
>> Used to unregister (if needed) and free the shrinker instance.
>>
>> In order to simplify shrinker-related APIs and make shrinker more
>> independent of other kernel mechanisms, subsequent submissions will use
>> the above API to convert all shrinkers (including case a and b) to
>> dynamically allocated, and then remove all existing APIs.
>>
>> This will also have another advantage mentioned by Dave Chinner:
>>
>> ```
>> The other advantage of this is that it will break all the existing
>> out of tree code and third party modules using the old API and will
>> no longer work with a kernel using lockless slab shrinkers. They
>> need to break (both at the source and binary levels) to stop bad
>> things from happening due to using uncoverted shrinkers in the new
> 
> nit: uncoverted -> unconverted

Thanks. Will fix.

> 
>> setup.
>> ```
>>
>> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> 
> ...
> 
>> diff --git a/mm/shrinker_debug.c b/mm/shrinker_debug.c
>> index f1becfd45853..506257585408 100644
>> --- a/mm/shrinker_debug.c
>> +++ b/mm/shrinker_debug.c
>> @@ -191,6 +191,20 @@ int shrinker_debugfs_add(struct shrinker *shrinker)
>>   	return 0;
>>   }
>>   
>> +int shrinker_debugfs_name_alloc(struct shrinker *shrinker, const char *fmt,
>> +				va_list ap)
>> +{
>> +	shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
>> +
>> +	return shrinker->name ? 0 : -ENOMEM;
>> +}
>> +
>> +void shrinker_debugfs_name_free(struct shrinker *shrinker)
>> +{
>> +	kfree_const(shrinker->name);
>> +	shrinker->name = NULL;
>> +}
>> +
> 
> These functions have no prototype in this file,
> perhaps internal.h should be included?

The compiler can find these implementations, so I don't think there
is a need to include internal.h here?

Thanks,
Qi

> 
>>   int shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...)
>>   {
>>   	struct dentry *entry;
> 
> ...


From xen-devel-bounces@lists.xenproject.org Sat Jul 29 12:01:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 29 Jul 2023 12:01:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.571880.896032 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPicm-00025l-40; Sat, 29 Jul 2023 12:00:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 571880.896032; Sat, 29 Jul 2023 12:00:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPicm-00025e-0I; Sat, 29 Jul 2023 12:00:44 +0000
Received: by outflank-mailman (input) for mailman id 571880;
 Sat, 29 Jul 2023 12:00:43 +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 <SRS0=62PG=DP=suse.de=tiwai@srs-se1.protection.inumbo.net>)
 id 1qPick-000232-Vi
 for xen-devel@lists.xenproject.org; Sat, 29 Jul 2023 12:00:43 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 89283d55-2e07-11ee-8613-37d641c3527e;
 Sat, 29 Jul 2023 14:00:41 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 2AEE8216DA;
 Sat, 29 Jul 2023 12:00:39 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E735713596;
 Sat, 29 Jul 2023 12:00:38 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id qrlrN2b/xGThewAAMHmgww
 (envelope-from <tiwai@suse.de>); Sat, 29 Jul 2023 12:00:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 89283d55-2e07-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1690632039; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=Og/4urZItaDoPrqR068TFRdUJk+qNCxhcstZwekFiAg=;
	b=QYGnugli6rutLEo+kJ+ZftYb7EXCKpsSPU7RmEy/7nYr2hO+uHW9UP8K0IDGIbj2FnSb25
	oGBEqfRtvvIThGze/OFnXY7qL4CUtEBk5QpiL0NfwIuWB5X+xLxiFpNqfJ0DE4uLgF1thh
	7iJMdZRc5S4EwaCE9xhNVpG9Xbu8Zeo=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1690632039;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=Og/4urZItaDoPrqR068TFRdUJk+qNCxhcstZwekFiAg=;
	b=QJaimAam/uW1kKz6sI4J6IlBDWgUMY0aTmoM+wWSHaXT6n593FEcE16ddZnk5QcAP+Q8Nb
	aHA46TInyhT2i2Ag==
Date: Sat, 29 Jul 2023 14:00:38 +0200
Message-ID: <87mszfc4gp.wl-tiwai@suse.de>
From: Takashi Iwai <tiwai@suse.de>
To: Justin Stitt <justinstitt@google.com>
Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	xen-devel@lists.xenproject.org,
	alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org,
	Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] ALSA: xen-front: refactor deprecated strncpy
In-Reply-To: <20230727-sound-xen-v1-1-89dd161351f1@google.com>
References: <20230727-sound-xen-v1-1-89dd161351f1@google.com>
User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: text/plain; charset=US-ASCII

On Thu, 27 Jul 2023 23:53:24 +0200,
Justin Stitt wrote:
> 
> `strncpy` is deprecated for use on NUL-terminated destination strings [1].
> 
> A suitable replacement is `strscpy` [2] due to the fact that it
> guarantees NUL-termination on its destination buffer argument which is
> _not_ always the case for `strncpy`!
> 
> It should be noted that, in this case, the destination buffer has a
> length strictly greater than the source string. Moreover, the source
> string is NUL-terminated (and so is the destination) which means there
> was no real bug happening here. Nonetheless, this patch would get us one
> step closer to eliminating the `strncpy` API in the kernel, as its use
> is too ambiguous. We need to favor less ambiguous replacements such as:
> strscpy, strscpy_pad, strtomem and strtomem_pad (amongst others).
> 
> Technically, my patch yields subtly different behavior. The original
> implementation with `strncpy` would fill the entire destination buffer
> with null bytes [3] while `strscpy` will leave the junk, uninitialized
> bytes trailing after the _mandatory_ NUL-termination. So, if somehow
> `pcm->name` or `card->driver/shortname/longname` require this
> NUL-padding behavior then `strscpy_pad` should be used. My
> interpretation, though, is that the aforementioned fields are just fine
> as NUL-terminated strings. Please correct my assumptions if needed and
> I'll send in a v2.
> 
> [1]: www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
> [2]: manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html
> [3]: https://linux.die.net/man/3/strncpy
> 
> Link: https://github.com/KSPP/linux/issues/90
> Signed-off-by: Justin Stitt <justinstitt@google.com>

Applied now.  Thanks.


Takashi


From xen-devel-bounces@lists.xenproject.org Sat Jul 29 15:08:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 29 Jul 2023 15:08:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572046.896078 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPlY0-0006Cl-TW; Sat, 29 Jul 2023 15:08:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572046.896078; Sat, 29 Jul 2023 15:08:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPlY0-0006Ce-Qa; Sat, 29 Jul 2023 15:08:00 +0000
Received: by outflank-mailman (input) for mailman id 572046;
 Sat, 29 Jul 2023 15:07:59 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPlXz-0006CU-Sd; Sat, 29 Jul 2023 15:07:59 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPlXz-0001Q9-Oz; Sat, 29 Jul 2023 15:07:59 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPlXz-0000Wl-Dh; Sat, 29 Jul 2023 15:07:59 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qPlXz-00008z-D9; Sat, 29 Jul 2023 15:07:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=5zCOCAovJvxrd4pIkw1rEGHARDR3Yywq//3x/7R00ZI=; b=BJkHM6mqf+9CpAJMclB/DfgxnA
	Mj2BUVP3smehThWDXEZ76h/EO7MQ+A+aM0FbDJCzd1O/0xwib/qI4hKKOM3SIiqjlGmpjJAJSsXgs
	IXdIEANCYNPC1lEc80hYiTZh9fWFq1YpCOEW1PY2uuj+TDiH6dQJbSsq0rrLS8bTzGyY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182062-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 182062: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-arm64-arm64-xl-credit1:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=f837f0a3c94882a29e38ff211a36c1c8a0f07804
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 29 Jul 2023 15:07:59 +0000

flight 182062 linux-linus real [real]
flight 182074 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/182062/
http://logs.test-lab.xenproject.org/osstest/logs/182074/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-freebsd11-amd64 19 guest-localmigrate/x10 fail pass in 182074-retest
 test-arm64-arm64-xl-credit1 18 guest-start/debian.repeat fail pass in 182074-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt   16 saverestore-support-check fail blocked in 180278
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check fail blocked in 180278
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail blocked in 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                f837f0a3c94882a29e38ff211a36c1c8a0f07804
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z  103 days
Failing since        180281  2023-04-17 06:24:36 Z  103 days  192 attempts
Testing same since   182062  2023-07-28 20:16:32 Z    0 days    1 attempts

------------------------------------------------------------
3850 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  fail    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 647289 lines long.)


From xen-devel-bounces@lists.xenproject.org Sat Jul 29 17:10:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 29 Jul 2023 17:10:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572076.896088 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPnSd-0004Dm-Jn; Sat, 29 Jul 2023 17:10:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572076.896088; Sat, 29 Jul 2023 17:10:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPnSd-0004Df-H4; Sat, 29 Jul 2023 17:10:35 +0000
Received: by outflank-mailman (input) for mailman id 572076;
 Sat, 29 Jul 2023 17:10:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPnSc-0004DT-9H; Sat, 29 Jul 2023 17:10:34 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPnSc-0005It-56; Sat, 29 Jul 2023 17:10:34 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPnSb-0006GF-Ia; Sat, 29 Jul 2023 17:10:33 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qPnSb-0003Q2-Ht; Sat, 29 Jul 2023 17:10:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=13p/KHf55Mi1cDnCMjglb0bhYxMT/ug7pgaUMyuanp0=; b=n5v+BLIP22DPo6249xuUmJoqZW
	OLl4COieksAhae8qBZGjy/6Jxs3TNLFHqoVYoRSbk130Nxm0UdC4Z0iZvAN0nHdtMO+lEelU1W34M
	7ZqDRmwgGQACdNH+lqddfXq98QweWLeySq8VUuYddXW6qmD86pIkRjpktJ0cdM7t7PLc=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182065-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-5.4 test] 182065: regressions - FAIL
X-Osstest-Failures:
    linux-5.4:build-arm64-xsm:xen-build:fail:regression
    linux-5.4:test-armhf-armhf-xl-credit2:guest-start:fail:heisenbug
    linux-5.4:test-armhf-armhf-xl-arndale:guest-start/debian.repeat:fail:heisenbug
    linux-5.4:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    linux-5.4:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:xen-install:fail:heisenbug
    linux-5.4:test-armhf-armhf-xl-credit1:guest-start:fail:heisenbug
    linux-5.4:test-armhf-armhf-xl:guest-start/debian.repeat:fail:heisenbug
    linux-5.4:test-arm64-arm64-libvirt-raw:guest-start.2:fail:heisenbug
    linux-5.4:test-amd64-i386-xl-vhd:guest-start/debian.repeat:fail:heisenbug
    linux-5.4:test-arm64-arm64-xl-xsm:build-check(1):blocked:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-xsm:build-check(1):blocked:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit1:guest-start/debian.repeat:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=887433e4bc9394676d22c038dba33a27405f94e8
X-Osstest-Versions-That:
    linux=27745d94abe1036a3423cb8577b665c01725e321
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 29 Jul 2023 17:10:33 +0000

flight 182065 linux-5.4 real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182065/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-arm64-xsm               6 xen-build      fail in 182055 REGR. vs. 182001

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-credit2  14 guest-start      fail in 182031 pass in 182065
 test-armhf-armhf-xl-arndale 18 guest-start/debian.repeat fail in 182055 pass in 182065
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat  fail pass in 182031
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 7 xen-install fail pass in 182055
 test-armhf-armhf-xl-credit1  14 guest-start                fail pass in 182055
 test-armhf-armhf-xl          18 guest-start/debian.repeat  fail pass in 182055
 test-arm64-arm64-libvirt-raw 18 guest-start.2              fail pass in 182055
 test-amd64-i386-xl-vhd       21 guest-start/debian.repeat  fail pass in 182055

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-xl-xsm       1 build-check(1)           blocked in 182055 n/a
 test-arm64-arm64-libvirt-xsm  1 build-check(1)           blocked in 182055 n/a
 test-armhf-armhf-xl-credit1 18 guest-start/debian.repeat fail in 182031 like 182001
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail in 182055 never pass
 test-armhf-armhf-xl-credit1 15 migrate-support-check fail in 182055 never pass
 test-armhf-armhf-xl-credit1 16 saverestore-support-check fail in 182055 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182001
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182001
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 182001
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 182001
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 182001
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182001
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 182001
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 182001
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 182001
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 182001
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 182001
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182001
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                887433e4bc9394676d22c038dba33a27405f94e8
baseline version:
 linux                27745d94abe1036a3423cb8577b665c01725e321

Last test of basis   182001  2023-07-24 17:45:59 Z    4 days
Testing same since   182031  2023-07-27 07:14:08 Z    2 days    3 attempts

------------------------------------------------------------
312 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            fail    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 10044 lines long.)


From xen-devel-bounces@lists.xenproject.org Sat Jul 29 22:29:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 29 Jul 2023 22:29:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572121.896098 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPsR1-0003b7-WE; Sat, 29 Jul 2023 22:29:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572121.896098; Sat, 29 Jul 2023 22:29:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPsR1-0003b0-T1; Sat, 29 Jul 2023 22:29:15 +0000
Received: by outflank-mailman (input) for mailman id 572121;
 Sat, 29 Jul 2023 22:29:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPsR1-0003aq-3H; Sat, 29 Jul 2023 22:29:15 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPsR0-0006j3-Ub; Sat, 29 Jul 2023 22:29:14 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPsR0-0004NI-FC; Sat, 29 Jul 2023 22:29:14 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qPsR0-0003rr-Ek; Sat, 29 Jul 2023 22:29:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=tZgR5wNDcoytD2nXhy4D7CsHSVNm/UYD0WrU57HiYSw=; b=gYw+Bo3Mt15UZV2LHiYL9xCpEe
	0qknQ09PJaV8qfs/EbGuOgzhWez5bVW/BsoggfofGovDxKmrqojPyZxiweEVPM5Ii2I2SIJbjzCf9
	cxEFRoi2n5fRiLvUX2wtqmOk1VN9x13Qf8WS5IkFelRnZrw8Z1L5VbrcuDrrAjN6z7Fg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182068-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 182068: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=010cfec9690d68e26ba4e3747c5c636d3d1f39f0
X-Osstest-Versions-That:
    libvirt=e33054b72ccde26aec4775aa6d477fc8527c9a4a
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 29 Jul 2023 22:29:14 +0000

flight 182068 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182068/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182051
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 182051
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 182051
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 libvirt              010cfec9690d68e26ba4e3747c5c636d3d1f39f0
baseline version:
 libvirt              e33054b72ccde26aec4775aa6d477fc8527c9a4a

Last test of basis   182051  2023-07-28 04:22:09 Z    1 days
Testing same since   182068  2023-07-29 04:18:56 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Pavel Borecki <pavel.borecki@gmail.com>
  Yuri Chornoivan <yurchor@ukr.net>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   e33054b72c..010cfec969  010cfec9690d68e26ba4e3747c5c636d3d1f39f0 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sat Jul 29 22:53:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 29 Jul 2023 22:53:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572131.896109 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPsnx-00070Q-Q6; Sat, 29 Jul 2023 22:52:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572131.896109; Sat, 29 Jul 2023 22:52:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPsnx-00070J-NB; Sat, 29 Jul 2023 22:52:57 +0000
Received: by outflank-mailman (input) for mailman id 572131;
 Sat, 29 Jul 2023 22:52:57 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPsnw-000709-VZ; Sat, 29 Jul 2023 22:52:56 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPsnw-0007Ey-RY; Sat, 29 Jul 2023 22:52:56 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPsnw-0004xu-Fc; Sat, 29 Jul 2023 22:52:56 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qPsnw-0000eQ-Em; Sat, 29 Jul 2023 22:52:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=fqxJsrgunZkaqJfVgzcZMWn0ZbV3zcauEinR93MMiqg=; b=FJNoBSGKbpLzuXoOCRrRbntdBi
	J9YdTKdQA+5a9XeiB/jvswmx/Ks55V+VrCMzyp46M0Sk1wkZGC6C+Ss/Hn0oauLe876/Hn9lZ21xt
	G3TOn7tyHxbHG26LZtTmgcYwH4Bkg1KLW+mISmJeXkaOQEJfVx+ko1cZAxByQEZx/d1k=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182067-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 182067: tolerable FAIL - PUSHED
X-Osstest-Failures:
    qemu-mainline:test-armhf-armhf-libvirt-raw:guest-start/debian.repeat:fail:heisenbug
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=ccb86f079a9e4d94918086a9df18c1844347aff8
X-Osstest-Versions-That:
    qemuu=ccdd31267678db9d80578b5f80bbe94141609ef4
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 29 Jul 2023 22:52:56 +0000

flight 182067 qemu-mainline real [real]
flight 182077 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/182067/
http://logs.test-lab.xenproject.org/osstest/logs/182077/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-libvirt-raw 17 guest-start/debian.repeat fail pass in 182077-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182029
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182029
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 182029
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 182029
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 182029
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182029
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182029
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 182029
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass

version targeted for testing:
 qemuu                ccb86f079a9e4d94918086a9df18c1844347aff8
baseline version:
 qemuu                ccdd31267678db9d80578b5f80bbe94141609ef4

Last test of basis   182029  2023-07-27 03:42:56 Z    2 days
Failing since        182058  2023-07-28 13:08:59 Z    1 days    2 attempts
Testing same since   182067  2023-07-29 02:34:52 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Denis V. Lunev <den@openvz.org>
  Eric Blake <eblake@redhat.com>
  Hanna Czenczek <hreitz@redhat.com>
  Richard Henderson <richard.henderson@linaro.org>
  Sam Li <faithilikerun@gmail.com>
  Stefan Hajnoczi <stefanha@redhat.com>
  Stefano Garzarella <sgarzare@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 fail    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/qemu-xen.git
   ccdd312676..ccb86f079a  ccb86f079a9e4d94918086a9df18c1844347aff8 -> upstream-tested


From xen-devel-bounces@lists.xenproject.org Sun Jul 30 06:16:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 30 Jul 2023 06:16:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572290.896248 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPziW-0005xi-FB; Sun, 30 Jul 2023 06:15:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572290.896248; Sun, 30 Jul 2023 06:15:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qPziW-0005xb-BB; Sun, 30 Jul 2023 06:15:48 +0000
Received: by outflank-mailman (input) for mailman id 572290;
 Sun, 30 Jul 2023 06:15:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPziV-0005xM-8f; Sun, 30 Jul 2023 06:15:47 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPziV-0003mm-6S; Sun, 30 Jul 2023 06:15:47 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qPziU-0007HW-Ou; Sun, 30 Jul 2023 06:15:46 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qPziU-0006hk-NG; Sun, 30 Jul 2023 06:15:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=XSLoBxygy314/hSkNcxsiyQXdXEs0dDrNqViwnyWi1w=; b=fPVAYyvxjcn2FpDl+p5bcq3xjQ
	YdsxSkbazU1eIr8QNZHcAzPYtwzJ9lPQNtQxAwgAwc5LfqhB8xJ8bkhESZRlssin9XtGotcOAMK0n
	hrnFZA4yqNnNCHqBjqNuoaYIM+zykHrFSEDwCNb7EF06ORsO9OUitBD2yJdsde7el0/4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182072-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 182072: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-pair:xen-install/src_host:fail:heisenbug
    xen-unstable:test-amd64-i386-xl-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=fff3c99f84589a876fcd8467ea99f2c8d9ff8d21
X-Osstest-Versions-That:
    xen=0b1171be87698bc7d14760383c0770aeb6e41dd4
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 30 Jul 2023 06:15:46 +0000

flight 182072 xen-unstable real [real]
flight 182078 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/182072/
http://logs.test-lab.xenproject.org/osstest/logs/182078/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-pair        10 xen-install/src_host fail pass in 182078-retest
 test-amd64-i386-xl-vhd 21 guest-start/debian.repeat fail pass in 182078-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182012
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 182012
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 182012
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182012
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 182012
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182012
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 182012
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 182012
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 182012
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 182012
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 182012
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182012
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 xen                  fff3c99f84589a876fcd8467ea99f2c8d9ff8d21
baseline version:
 xen                  0b1171be87698bc7d14760383c0770aeb6e41dd4

Last test of basis   182012  2023-07-25 19:27:43 Z    4 days
Failing since        182027  2023-07-26 21:35:59 Z    3 days    4 attempts
Testing same since   182072  2023-07-29 08:44:24 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Anthony PERARD <anthony.perard@citrix.com>
  Bertrand Marquis <bertrand.marquis@arm.com>
  Federico Serafini <federico.serafini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Juergen Gross <jgross@suse.com>
  Julien Grall <jgrall@amazon.com>
  Leo Yan <leo.yan@linaro.org>
  Luca Fancellu <luca.fancellu@arm.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Olaf Hering <olaf@aepfle.de>
  Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
  Peter Hoyes <Peter.Hoyes@arm.com>
  Rahul Singh <rahul.singh@arm.com>
  Roger Pau Monne <roger.pau@citrix.com>
  Roger Pau MonnÃ© <roger.pau@citrix.com>
  Shawn Anastasio <sanastasio@raptorengineering.com>
  Simone Ballarin <simone.ballarin@bugseng.com>
  Stefano Stabellini <sstabellini@kernel.org>
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         fail    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   0b1171be87..fff3c99f84  fff3c99f84589a876fcd8467ea99f2c8d9ff8d21 -> master


From xen-devel-bounces@lists.xenproject.org Sun Jul 30 11:03:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 30 Jul 2023 11:03:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572403.896357 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQ4CN-0002nA-Q4; Sun, 30 Jul 2023 11:02:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572403.896357; Sun, 30 Jul 2023 11:02:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQ4CN-0002n3-N2; Sun, 30 Jul 2023 11:02:55 +0000
Received: by outflank-mailman (input) for mailman id 572403;
 Sun, 30 Jul 2023 11:02:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQ4CM-0002mt-HE; Sun, 30 Jul 2023 11:02:54 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQ4CM-00026z-Dw; Sun, 30 Jul 2023 11:02:54 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQ4CL-0004Yq-TY; Sun, 30 Jul 2023 11:02:54 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qQ4CL-0008KR-Sz; Sun, 30 Jul 2023 11:02:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=qVjdGYleK91SegMb6DWneG0YjOLoK2AgVp2nUXZ1Puk=; b=2PiwGVwqSDjXGwRQvKOCPGoL4/
	qNS98sHJbx9orQNXw2YC5N7F4gLr05PZh16zhisvC75DZ+tN52Qmdw4Ow8nRK0jfMz1rw704Rf29n
	GCdlaq+S9C8CzjGpxNfYBakFsWVIUohtTLDq/7lURPQTeeUZo7v0DkD3f0kiRfmi1EPQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182075-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 182075: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-amd64-amd64-freebsd11-amd64:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=ffabf7c731765da3dbfaffa4ed58b51ae9c2e650
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 30 Jul 2023 11:02:53 +0000

flight 182075 linux-linus real [real]
flight 182080 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/182075/
http://logs.test-lab.xenproject.org/osstest/logs/182080/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-freebsd11-amd64 19 guest-localmigrate/x10 fail pass in 182080-retest
 test-amd64-amd64-xl-qemuu-ovmf-amd64 18 guest-localmigrate/x10 fail pass in 182080-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt   16 saverestore-support-check fail blocked in 180278
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check fail blocked in 180278
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail blocked in 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                ffabf7c731765da3dbfaffa4ed58b51ae9c2e650
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z  104 days
Failing since        180281  2023-04-17 06:24:36 Z  104 days  193 attempts
Testing same since   182075  2023-07-29 15:13:03 Z    0 days    1 attempts

------------------------------------------------------------
3855 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             fail    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 648558 lines long.)


From xen-devel-bounces@lists.xenproject.org Sun Jul 30 13:55:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 30 Jul 2023 13:55:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572444.896368 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQ6sm-00036E-Pc; Sun, 30 Jul 2023 13:54:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572444.896368; Sun, 30 Jul 2023 13:54:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQ6sm-000367-Ms; Sun, 30 Jul 2023 13:54:52 +0000
Received: by outflank-mailman (input) for mailman id 572444;
 Sun, 30 Jul 2023 13:54:51 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQ6sl-00035x-74; Sun, 30 Jul 2023 13:54:51 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQ6sl-0005jl-3a; Sun, 30 Jul 2023 13:54:51 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQ6sk-00037I-M7; Sun, 30 Jul 2023 13:54:50 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qQ6sk-0004Mv-Li; Sun, 30 Jul 2023 13:54:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Sqid4R7p42OLz0RiAmMoPK4mpArQCuYWNvw7dg50mII=; b=I4T3ZPQV003UKAcf1Fx7ZYszT7
	i2zLuKZV3gsHQMYlA+MF7K5BDDM24RSutaISPxJ54eO9aBTtDR40G6mlO0qB88ORZ2wi1U32dSZ2q
	+AWnziwqT9FRiiQiecksSY/WUttmBw+KLeuGkX6KdcocL4JZtfW28YzT72PpXNXZTMD8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182076-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-5.4 test] 182076: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-5.4:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:xen-install:fail:heisenbug
    linux-5.4:test-armhf-armhf-xl-credit1:guest-start:fail:heisenbug
    linux-5.4:test-armhf-armhf-xl:guest-start/debian.repeat:fail:heisenbug
    linux-5.4:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    linux-5.4:test-arm64-arm64-libvirt-raw:guest-start.2:fail:heisenbug
    linux-5.4:test-amd64-i386-xl-vhd:guest-start/debian.repeat:fail:heisenbug
    linux-5.4:test-amd64-amd64-dom0pvh-xl-amd:guest-start/debian.repeat:fail:heisenbug
    linux-5.4:test-armhf-armhf-xl-rtds:guest-start/debian.repeat:fail:heisenbug
    linux-5.4:test-armhf-armhf-xl-multivcpu:guest-start/debian.repeat:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit1:guest-start/debian.repeat:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-5.4:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-5.4:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-5.4:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    linux-5.4:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=887433e4bc9394676d22c038dba33a27405f94e8
X-Osstest-Versions-That:
    linux=27745d94abe1036a3423cb8577b665c01725e321
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 30 Jul 2023 13:54:50 +0000

flight 182076 linux-5.4 real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182076/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 7 xen-install fail in 182065 pass in 182076
 test-armhf-armhf-xl-credit1  14 guest-start      fail in 182065 pass in 182076
 test-armhf-armhf-xl 18 guest-start/debian.repeat fail in 182065 pass in 182076
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail in 182065 pass in 182076
 test-arm64-arm64-libvirt-raw 18 guest-start.2    fail in 182065 pass in 182076
 test-amd64-i386-xl-vhd 21 guest-start/debian.repeat fail in 182065 pass in 182076
 test-amd64-amd64-dom0pvh-xl-amd 22 guest-start/debian.repeat fail pass in 182065
 test-armhf-armhf-xl-rtds     18 guest-start/debian.repeat  fail pass in 182065

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-multivcpu 18 guest-start/debian.repeat fail blocked in 182001
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182001
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182001
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 182001
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 182001
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 182001
 test-armhf-armhf-xl-credit1  18 guest-start/debian.repeat    fail  like 182001
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182001
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 182001
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 182001
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 182001
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 182001
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 182001
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182001
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                887433e4bc9394676d22c038dba33a27405f94e8
baseline version:
 linux                27745d94abe1036a3423cb8577b665c01725e321

Last test of basis   182001  2023-07-24 17:45:59 Z    5 days
Testing same since   182031  2023-07-27 07:14:08 Z    3 days    4 attempts

------------------------------------------------------------
312 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              fail    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   27745d94abe1..887433e4bc93  887433e4bc9394676d22c038dba33a27405f94e8 -> tested/linux-5.4


From xen-devel-bounces@lists.xenproject.org Sun Jul 30 18:18:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 30 Jul 2023 18:18:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572519.896378 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQAzD-00044R-VR; Sun, 30 Jul 2023 18:17:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572519.896378; Sun, 30 Jul 2023 18:17:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQAzD-00044K-Rr; Sun, 30 Jul 2023 18:17:47 +0000
Received: by outflank-mailman (input) for mailman id 572519;
 Sun, 30 Jul 2023 18:17:46 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQAzC-00044A-NY; Sun, 30 Jul 2023 18:17:46 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQAzC-0003qm-Ja; Sun, 30 Jul 2023 18:17:46 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQAzC-00017M-2a; Sun, 30 Jul 2023 18:17:46 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qQAzC-0001bL-2C; Sun, 30 Jul 2023 18:17:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=rCSnJw01U/XiElkDpBCmWRvCplDwVJamsq3uM0HXiWY=; b=0YsVqUabUi3WHldNLR7cs7xrSv
	RRznqHQMALZ9KD4+4GaNzapwQH9vtvmXLtGkXCah5YDQrK/qYWdeD232OLnP4gRQeWLi70k4DG92O
	TD7bc239lufXFU2wycQJBJ/cCY2Y3fxRvsEEGFQqR6YxIGAZZswPnBxMiTifQ77V0l/Y=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182079-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 182079: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-i386-pair:xen-install/src_host:fail:heisenbug
    xen-unstable:test-amd64-i386-xl-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-amd64-amd64-dom0pvh-xl-amd:guest-start:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=fff3c99f84589a876fcd8467ea99f2c8d9ff8d21
X-Osstest-Versions-That:
    xen=fff3c99f84589a876fcd8467ea99f2c8d9ff8d21
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 30 Jul 2023 18:17:46 +0000

flight 182079 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182079/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-i386-pair     10 xen-install/src_host fail in 182072 pass in 182079
 test-amd64-i386-xl-vhd 21 guest-start/debian.repeat fail in 182072 pass in 182079
 test-amd64-amd64-dom0pvh-xl-amd 14 guest-start             fail pass in 182072

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182072
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 182072
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 182072
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182072
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check   fail like 182072
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182072
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 182072
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 182072
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 182072
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 182072
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 182072
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182072
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 xen                  fff3c99f84589a876fcd8467ea99f2c8d9ff8d21
baseline version:
 xen                  fff3c99f84589a876fcd8467ea99f2c8d9ff8d21

Last test of basis   182079  2023-07-30 06:18:02 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           pass    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              fail    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 00:36:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 00:36:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572568.896388 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQGts-00089T-Re; Mon, 31 Jul 2023 00:36:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572568.896388; Mon, 31 Jul 2023 00:36:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQGts-00089M-O4; Mon, 31 Jul 2023 00:36:40 +0000
Received: by outflank-mailman (input) for mailman id 572568;
 Mon, 31 Jul 2023 00:36:38 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQGtq-00089A-Om; Mon, 31 Jul 2023 00:36:38 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQGtq-0004Mc-LG; Mon, 31 Jul 2023 00:36:38 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQGtq-0001li-36; Mon, 31 Jul 2023 00:36:38 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qQGtq-0001Uh-2W; Mon, 31 Jul 2023 00:36:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=3nFOglttzKHnOpt7DGw/PVHWOI5Ho5vytKBGujh5l5g=; b=e30uOOlJaUj5ZqvcVoKBng658D
	GTFqGnsYVgrggxMMhGLSY6/ro7pXiuYbC0ViRGz2w12+FdctOCEdITnhbHqTxc2YVYhVBRzLlleAq
	yUnIoEdF0krJG0YJFjRUZsNLqg2B3Nx8ArN3tDkM0jZFPgyFPFnntH8G56Hnj1o4aMDI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182081-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 182081: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:guest-saverestore.2:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:xen-boot:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-amd64:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-ovmf-amd64:guest-stop:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-credit1:guest-start.2:fail:heisenbug
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=d31e3792919e5c97d572c8a27a5a7c1eb9de5aca
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 31 Jul 2023 00:36:38 +0000

flight 182081 linux-linus real [real]
flight 182082 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/182081/
http://logs.test-lab.xenproject.org/osstest/logs/182082/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 17 guest-saverestore.2 fail in 182082 REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-ws16-amd64  8 xen-boot    fail pass in 182082-retest
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 18 guest-localmigrate/x10 fail pass in 182082-retest
 test-amd64-amd64-xl-qemuu-ovmf-amd64 19 guest-stop  fail pass in 182082-retest
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 182082-retest
 test-amd64-amd64-xl-credit1  23 guest-start.2       fail pass in 182082-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt   16 saverestore-support-check fail blocked in 180278
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check fail blocked in 180278
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail blocked in 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop  fail in 182082 like 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                d31e3792919e5c97d572c8a27a5a7c1eb9de5aca
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z  105 days
Failing since        180281  2023-04-17 06:24:36 Z  104 days  194 attempts
Testing same since   182081  2023-07-30 11:05:53 Z    0 days    1 attempts

------------------------------------------------------------
3859 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         fail    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 649059 lines long.)


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 04:00:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 04:00:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572586.896398 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQK4o-0006Tp-Ma; Mon, 31 Jul 2023 04:00:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572586.896398; Mon, 31 Jul 2023 04:00:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQK4o-0006Th-GO; Mon, 31 Jul 2023 04:00:10 +0000
Received: by outflank-mailman (input) for mailman id 572586;
 Mon, 31 Jul 2023 04:00:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C1oe=DR=invisiblethingslab.com=marmarek@srs-se1.protection.inumbo.net>)
 id 1qQK4m-0006Tb-G6
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 04:00:08 +0000
Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com
 [66.111.4.28]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ba8210af-2f56-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 06:00:05 +0200 (CEST)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.nyi.internal (Postfix) with ESMTP id 74AD85C012B;
 Mon, 31 Jul 2023 00:00:03 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute5.internal (MEProxy); Mon, 31 Jul 2023 00:00:03 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 31 Jul 2023 00:00:01 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ba8210af-2f56-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:sender:subject:subject:to:to; s=fm3; t=
	1690776003; x=1690862403; bh=AZS5zvDBx1m6sc3l9ZNlaTXmu5ZmgDfI515
	g8g/0Vqw=; b=ErUBizsGXRYxeIoQKJEe+d5rq3FFAAqlX/iz+n68EQUFlEHt9RI
	GQDY8UDwFFIpRuBsmGF3rYURBckHrk78huSdVCgbQZIDUxogExRUSkSyWYqklv9Z
	g0+nqj7eMMKQpPF6F865/czlwYGrOKgBKqxsw7OyCAOt8Gu0wZgZPbZ0JQA0867C
	4SXlB4xMpJkkDEq1XilLHD4CRAhvVC0SsxCRKDg5P+7KOwdmhCHlFFKtESNG1xog
	4Tb8v5UdLuMQ97rF5KHtVkhm7BKEbmWYCWtDZ0Kl/Rxt1Yjd29HHPJFDo3UY6NX/
	WW8i0WeW4kcylFaK3isAIpUUJaONVZkEGkw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1690776003; x=1690862403; bh=AZS5zvDBx1m6s
	c3l9ZNlaTXmu5ZmgDfI515g8g/0Vqw=; b=ZBzBbObK2xiOfUig/vQe4pnI+2z10
	G8eff4a/tPCPgibN2E8DQXGHiBiAz3LEQ9Obku+dw66GP0bveBx3tmZXT0+vxccO
	GvTcEbDoxHM6i+KWt1raLYLgV4PQTJ2SzYdVfMLaduSGuZWCJeAanYzwT3JOr09C
	6QDuBt5KrkeOc985SbpEPq9xi26ouxai+d0IzX9cJhfK91RgqkB5aCudhDDezcco
	kfGh7hKy12PWOnT8cuUEw+KYC/706wuloMOhLxhcz8Z3BSJ4PWj8bgk0VV8Wrw1B
	H0H5akFyyD/SEiYaBpX1W5chZ2A6sRlLxZ4nnv6Fe/Iy4O69osM30T1Ug==
X-ME-Sender: <xms:wjHHZKdFdnVjCes-Eau9CrMgYwL23G58gw9pBSSw-VH82y7vQMvaKw>
    <xme:wjHHZEPO2ZUE94sdWCn6sjlLvx-CTmJoLaHdZhBQThfUPO1yZES2di-4i-DoTJ2zz
    BfbGqEC2F1kxg>
X-ME-Received: <xmr:wjHHZLhcMbTK3nLzJaWl0i7QPXN7gx8FYAQ2jXebc9xt8gMrF8amqgNdvA2EwO0VY1002vdIeIkHPv49mJf4Sov7xefAbYJwnBM>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrjedvgdejjecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpeffhffvvefukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpeforghrvghk
    ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh
    hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeefgefg
    kedvfffhvdejgffggfeliedtteefieefieegtdegvdeileekueeujeeukeenucffohhmrg
    hinhepgigvnhhprhhojhgvtghtrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfr
    rghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslhgvthhhih
    hnghhslhgrsgdrtghomh
X-ME-Proxy: <xmx:wjHHZH821WCySF7_3EEkxkPdMYxvKB6NJtoWgJZGFg22qyLlhrQX9g>
    <xmx:wjHHZGsSFmUbRmkFMJlvFWhHV_j4oDxn0uFAcc3h0HlxRTNFTxe_EQ>
    <xmx:wjHHZOGVfCTVYdjQ0tvufth5cTj9cH7cEkBJgYxfoh1na3xrg32hkg>
    <xmx:wzHHZKJ2U2MMpgIQiTxGvXKGOu1tavADkQN-gzsDBusSNUu6H4Pf8A>
Feedback-ID: i1568416f:Fastmail
Date: Mon, 31 Jul 2023 05:59:55 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Elliott Mitchell <ehem+xen@m5p.com>
Cc: xen-devel@lists.xenproject.org, iwj@xenproject.org, wl@xen.org,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: Re: Python in Domain Configurations
Message-ID: <ZMcxvdSbpQdWg5/r@mail-itl>
References: <ZKiN80e08QIojRSL@mattapan.m5p.com>
 <ZL7e6IcJWK38IHU7@mattapan.m5p.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="zFt09wcN0ytVQeDj"
Content-Disposition: inline
In-Reply-To: <ZL7e6IcJWK38IHU7@mattapan.m5p.com>


--zFt09wcN0ytVQeDj
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Mon, 31 Jul 2023 05:59:55 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Elliott Mitchell <ehem+xen@m5p.com>
Cc: xen-devel@lists.xenproject.org, iwj@xenproject.org, wl@xen.org,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: Re: Python in Domain Configurations

On Mon, Jul 24, 2023 at 01:28:24PM -0700, Elliott Mitchell wrote:
> On Fri, Jul 07, 2023 at 03:13:07PM -0700, Elliott Mitchell wrote:
> >=20
> > The only context I could find was 54fbaf446b and
> > https://wiki.xenproject.org/wiki/PythonInXlConfig which don't explain
> > the reasoning.
> >=20
> > Would the maintainers be amenable to revisiting the decision to remove
> > support for full Python in domain configuration files?
>=20
> Any chance of this getting a response?
>=20
> On examination it appears domain configuration files are a proper subset
> of Python.  The interface to the parser is a bit interesting, but it
> looks fairly simple to replace the parser with libpython.
>=20
> My goal is to create an init script for some automatically started
> domains.  Issue is there can be ordering concerns with domain start/stop,
> and this seems best handled by adding an extra setting to the
> configuration files.  If full Python syntax is available, I can use that
> for this extra data.

Hi,

I don't know full history here, but from my point of view, having a
full-fledged script as a config file is undesirable for several reasons:
 - it's easy to have unintended side effects of just loading a config
   file
 - loading config file can no longer be assumed to be "cheap"
 - dynamic config file means you can no long rely on file timestamp/hash
   to check if anything changed (I don't think it's an issue for the
   current xl/libxl, but could be for some higher level tools)
 - leads to issues with various sandboxes - for example SELinux policy
   allowing scripted config file would be excessively permissive

So, IMHO reducing config file from a full python (like it used to be in
xend times) into a static file with well defined syntax was an
improvement. Lets not go backward.

As for your original problem, IIUC you would like to add some data that
would _not_ be interpreted by libxl, right? For that you can use
comments with some specific marker for your script. This approach used
to work well for SysV init script, and in fact for a very similar use case
(ordering and dependencies, among other things).

--=20
Best Regards,
Marek Marczykowski-G=C3=B3recki
Invisible Things Lab

--zFt09wcN0ytVQeDj
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmTHMb0ACgkQ24/THMrX
1yx3Cwf+IeB+WcegglsE7fTFEj3iMmfDmNFwefWndPsgCXw3N9DXTAqSmICvByNl
no5U/H6ah+HD/FfypYThUICez3q9crKxp8Leil0XH/mle/AJ1CC02TViLA+xdp94
Z9oDXyFcakZ+NyJRBg5KkWQc02AmoSXZwq1l8Q/2phIWTMnxU+NMobrKFXetFovH
Wv9/rk2YGRU6tpYVkPBFeABuhYDulqPk+GjIr4sXBo3nzhRa7Lqj7q/nbjL51kfE
LKQ7sNQc/nLW3Ubq1RQbgT8iOYsdXJZhBxB287prmbPpyrKqlz8CxUNh8gvhwFmw
H/ORS8I7xMs0WzRHkvN/n/fNcKn5Mw==
=opZ5
-----END PGP SIGNATURE-----

--zFt09wcN0ytVQeDj--


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 04:26:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 04:26:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572590.896408 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQKUI-0000a8-Lo; Mon, 31 Jul 2023 04:26:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572590.896408; Mon, 31 Jul 2023 04:26:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQKUI-0000a1-HU; Mon, 31 Jul 2023 04:26:30 +0000
Received: by outflank-mailman (input) for mailman id 572590;
 Mon, 31 Jul 2023 04:26:29 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQKUH-0000Zr-4p; Mon, 31 Jul 2023 04:26:29 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQKUH-00048D-1v; Mon, 31 Jul 2023 04:26:29 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQKUG-0002lt-Gu; Mon, 31 Jul 2023 04:26:28 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qQKUG-0006wQ-G3; Mon, 31 Jul 2023 04:26:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=jQQVouC3ZsyxTuUoyKJ9ZGm7HJvmt+2Lf77uKHJlZK0=; b=b+8zN4iRbIzHI+ylr/Gfb+sswz
	EYYfA702sis1UzHxhcFB7WQtB8M9EubhdjsXM2XFt/unxEtmIOyrBQPA1WcQkBVikHPSK2WO4kRXE
	K0XvmhdS42Y4GxHIDBz63qlaraJCDQB908HMGk2xvFLIFDPCTrs1Ci3Fkxvzh998W6yQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182084-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 182084: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=70f3e62dc73d28962b833373246ef25c865c575e
X-Osstest-Versions-That:
    ovmf=c7a7f09c1dfa8896ccf94be2d8c7c8b420257fec
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 31 Jul 2023 04:26:28 +0000

flight 182084 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182084/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 70f3e62dc73d28962b833373246ef25c865c575e
baseline version:
 ovmf                 c7a7f09c1dfa8896ccf94be2d8c7c8b420257fec

Last test of basis   182037  2023-07-27 11:40:46 Z    3 days
Testing same since   182084  2023-07-31 01:44:53 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Corvin KÃ¶hne <corvink@FreeBSD.org>
  Peter Grehan <grehan@freebsd.org>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   c7a7f09c1d..70f3e62dc7  70f3e62dc73d28962b833373246ef25c865c575e -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 04:40:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 04:40:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572581.896418 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQKhV-0002yV-Ry; Mon, 31 Jul 2023 04:40:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572581.896418; Mon, 31 Jul 2023 04:40:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQKhV-0002yO-O6; Mon, 31 Jul 2023 04:40:09 +0000
Received: by outflank-mailman (input) for mailman id 572581;
 Mon, 31 Jul 2023 03:00:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=EPXn=DR=linux.alibaba.com=yang.lee@srs-se1.protection.inumbo.net>)
 id 1qQJ9K-0000dy-LB
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 03:00:46 +0000
Received: from out30-119.freemail.mail.aliyun.com
 (out30-119.freemail.mail.aliyun.com [115.124.30.119])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6f10b9f4-2f4e-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 05:00:43 +0200 (CEST)
Received: from localhost(mailfrom:yang.lee@linux.alibaba.com
 fp:SMTPD_---0VoXHf6M_1690772438) by smtp.aliyun-inc.com;
 Mon, 31 Jul 2023 11:00:39 +0800
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6f10b9f4-2f4e-11ee-b254-6b7b168915f2
X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R311e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0VoXHf6M_1690772438;
From: Yang Li <yang.lee@linux.alibaba.com>
To: jgross@suse.com,
	sstabellini@kernel.org,
	oleksandr_tyshchenko@epam.com
Cc: xen-devel@lists.xenproject.org,
	linux-kernel@vger.kernel.org,
	Yang Li <yang.lee@linux.alibaba.com>,
	Abaci Robot <abaci@linux.alibaba.com>
Subject: [PATCH -next] xen: Fix one kernel-doc comment
Date: Mon, 31 Jul 2023 11:00:37 +0800
Message-Id: <20230731030037.123946-1-yang.lee@linux.alibaba.com>
X-Mailer: git-send-email 2.20.1.7.g153144c
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use colon to separate parameter name from their specific meaning.
silence the warning:

drivers/xen/grant-table.c:1051: warning: Function parameter or member 'nr_pages' not described in 'gnttab_free_pages'

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6030
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/xen/grant-table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index f13c3b76ad1e..35659bf70746 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -1044,7 +1044,7 @@ EXPORT_SYMBOL_GPL(gnttab_pages_clear_private);
 
 /**
  * gnttab_free_pages - free pages allocated by gnttab_alloc_pages()
- * @nr_pages; number of pages to free
+ * @nr_pages: number of pages to free
  * @pages: the pages
  */
 void gnttab_free_pages(int nr_pages, struct page **pages)
-- 
2.20.1.7.g153144c



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:03:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:03:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572627.896473 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvk-0001la-10; Mon, 31 Jul 2023 07:03:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572627.896473; Mon, 31 Jul 2023 07:02:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvj-0001j8-QB; Mon, 31 Jul 2023 07:02:59 +0000
Received: by outflank-mailman (input) for mailman id 572627;
 Mon, 31 Jul 2023 07:02:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMut-0000hs-AV
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:07 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 28444133-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:05 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:01:55 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:01:56 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 28444133-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786925; x=1722322925;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=+857ZiZ3kYB9kvyULHXUrCarfExj5Gil+GQ461ib92M=;
  b=NE4em+KwgK+XoH/U7xVPtrVo6rpE0Dy4VRKTigLSgq2pLWRSRYyeqyT3
   zk9R/n0uB1yqFlMwabpgzPknIwroSMZGdFeDA9P4INOL8lZO5uj4+qg2f
   uQ/q13Nh8u59aehP0x2GChul1f6nXuab2LXKaekVEnDfUUDvH0mJu0f5d
   ASibBM4CfGnxm+gbGWJnjDnaUsNuPOpwEn/sFWJtYmoPslM9l6j6HiXTF
   opnY/E8H8M2V1fd8NhPA6NqaSybSK9paXNHhujmFdTHmlW4D82ybYB/+5
   tUQCzMUtQCMjk6gvtq/d9eg1cI5o+9RYcg4N9LdnCIjRevhybKUFqivzN
   Q==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371648779"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371648779"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543364"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 06/36] x86/objtool: Teach objtool about ERETU and ERETS
Date: Sun, 30 Jul 2023 23:32:47 -0700
Message-Id: <20230731063317.3720-7-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

Update the objtool decoder to know about the ERETU and ERETS
instructions (type INSN_CONTEXT_SWITCH).

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---
 tools/objtool/arch/x86/decode.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c
index 2e1caabecb18..a486485cff20 100644
--- a/tools/objtool/arch/x86/decode.c
+++ b/tools/objtool/arch/x86/decode.c
@@ -509,11 +509,20 @@ int arch_decode_instruction(struct objtool_file *file, const struct section *sec
 
 		if (op2 == 0x01) {
 
-			if (modrm == 0xca)
-				insn->type = INSN_CLAC;
-			else if (modrm == 0xcb)
-				insn->type = INSN_STAC;
-
+			switch (insn_last_prefix_id(&ins)) {
+			case INAT_PFX_REPE:
+			case INAT_PFX_REPNE:
+				if (modrm == 0xca)
+					/* eretu/erets */
+					insn->type = INSN_CONTEXT_SWITCH;
+				break;
+			default:
+				if (modrm == 0xca)
+					insn->type = INSN_CLAC;
+				else if (modrm == 0xcb)
+					insn->type = INSN_STAC;
+				break;
+			}
 		} else if (op2 >= 0x80 && op2 <= 0x8f) {
 
 			insn->type = INSN_JUMP_CONDITIONAL;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:03:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:03:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572619.896433 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvi-0000ux-37; Mon, 31 Jul 2023 07:02:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572619.896433; Mon, 31 Jul 2023 07:02:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvh-0000uJ-U2; Mon, 31 Jul 2023 07:02:57 +0000
Received: by outflank-mailman (input) for mailman id 572619;
 Mon, 31 Jul 2023 07:02:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMup-0000hs-TD
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:03 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 268026c1-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:03 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:01:50 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:01:51 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 268026c1-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786923; x=1722322923;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=6FF6EgUyznIqvHXwn5+F1gytlgvayKLTt5Pzm0+v43k=;
  b=VIEYLllxZhrrDtJZRSCRijifgJdBrLeSCYIB3/RUjrBU/Si5crQJPia1
   xAqxuoSl5XwxQUxMPTdCHIdfb8wH+tnnH5AuCRrhMSfcn/mh1Fo8363DJ
   yqsYzcpTd09vyEywm+XjUYlwhcfz1TRe9dWDUmU7nR55TkDybCBlDsvfc
   53TQDScVkfWcvwU7nL+g4+5O8p+/rQuVYKqN107w/pbDvN4Suo2dXp95L
   YWnf7PaaqxcNZ3AHmTuICHlbOD7ruLzQlgVdd5MqQ5UHMHbVRuWpHTOi4
   bbcX3c8a9xQXJ8mmABBVGeg3mhxmHAC/26bWHMCxhcsMx3IhsQvNxxmr5
   g==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371648596"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371648596"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543335"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 01/36] Documentation/x86/64: Add documentation for FRED
Date: Sun, 30 Jul 2023 23:32:42 -0700
Message-Id: <20230731063317.3720-2-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Briefly introduce FRED, its advantages compared to IDT, and its
Linux enabling.

Signed-off-by: Xin Li <xin3.li@intel.com>
---
 Documentation/arch/x86/x86_64/fred.rst  | 102 ++++++++++++++++++++++++
 Documentation/arch/x86/x86_64/index.rst |   1 +
 2 files changed, 103 insertions(+)
 create mode 100644 Documentation/arch/x86/x86_64/fred.rst

diff --git a/Documentation/arch/x86/x86_64/fred.rst b/Documentation/arch/x86/x86_64/fred.rst
new file mode 100644
index 000000000000..27c980e882ba
--- /dev/null
+++ b/Documentation/arch/x86/x86_64/fred.rst
@@ -0,0 +1,102 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+=========================================
+Flexible Return and Event Delivery (FRED)
+=========================================
+
+Overview
+========
+
+The FRED architecture defines simple new transitions that change
+privilege level (ring transitions). The FRED architecture was
+designed with the following goals:
+
+1) Improve overall performance and response time by replacing event
+   delivery through the interrupt descriptor table (IDT event
+   delivery) and event return by the IRET instruction with lower
+   latency transitions.
+
+2) Improve software robustness by ensuring that event delivery
+   establishes the full supervisor context and that event return
+   establishes the full user context.
+
+The new transitions defined by the FRED architecture are FRED event
+delivery and, for returning from events, two FRED return instructions.
+FRED event delivery can effect a transition from ring 3 to ring 0, but
+it is used also to deliver events incident to ring 0. One FRED
+instruction (ERETU) effects a return from ring 0 to ring 3, while the
+other (ERETS) returns while remaining in ring 0. Collectively, FRED
+event delivery and the FRED return instructions are FRED transitions.
+
+In addition to these transitions, the FRED architecture defines a new
+instruction (LKGS) for managing the state of the GS segment register.
+The LKGS instruction can be used by 64-bit operating systems that do
+not use the new FRED transitions.
+
+Software based event dispatching
+================================
+
+FRED operates differently from IDT in terms of event handling. Instead
+of directly dispatching an event to its handler based on the event
+vector, FRED requires the software to dispatch an event to its handler
+based on both the event's type and vector. Therefore, an event
+dispatch framework must be implemented to facilitate the
+event-to-handler dispatch process. The FRED event dispatch framework
+assumes control once an event is delivered, starting from two FRED
+entry points, after which several event dispatch tables are introduced
+to facilitate the dispatching.
+
+The first level dispatching is event type based, and two tables need
+to be defined, one for ring 3 event dispatching, and the other
+for ring 0.
+
+The second level dispatching is event vector based, and
+several tables need to be defined, e.g., an exception handler table
+for exception dispatching.
+
+Full supervisor/user context
+============================
+
+FRED event delivery atomically save and restore full supervisor/user
+context upon event delivery and return. Thus it avoids the problem of
+transient states due to %cr2 and/or %dr6, thus it is no longer needed
+to handle all the ugly corner cases caused by half baked CPU states.
+
+FRED allows explicit unblock of NMI with new event return instructions
+ERETS/ERETU, avoiding the mess caused by IRET which unconditionally
+unblocks NMI, when an exception happens during NMI handling.
+
+FRED always restores the full value of %rsp, thus ESPFIX is no longer
+needed when FRED is enabled.
+
+LKGS
+====
+
+LKGS behaves like the MOV to GS instruction except that it loads the
+base address into the IA32_KERNEL_GS_BASE MSR instead of the GS
+segmentâ€™s descriptor cache, which is exactly what Linux kernel does
+to load user level GS base. With LKGS, it ends up with avoiding
+mucking with kernel GS.
+
+Because FRED event delivery from ring 3 swaps the value of the GS base
+address and that of the IA32_KERNEL_GS_BASE MSR, and ERETU swaps the
+value of the GS base address and that of the IA32_KERNEL_GS_BASE MSR,
+plus the introduction of LKGS instruction, the SWAPGS instruction is
+no longer needed when FRED is enabled, thus is disallowed (#UD).
+
+Stack levels
+============
+
+4 stack levels 0~3 are introduced to replace the un-reentrant IST for
+handling events. Each stack level could be configured to use a
+dedicated stack.
+
+The current stack level could be unchanged or go higher upon FRED
+event delivery. If unchanged, the CPU keeps using the current event
+stack. If higher, the CPU switches to a new stack specified by the
+stack MSR of the new stack level.
+
+Only execution of a FRED return instruction ERETU or ERETS could lower
+the current stack level, causing the CPU to switch back to the stack
+it was on before a previous event delivery.
+satck.
diff --git a/Documentation/arch/x86/x86_64/index.rst b/Documentation/arch/x86/x86_64/index.rst
index a56070fc8e77..ad15e9bd623f 100644
--- a/Documentation/arch/x86/x86_64/index.rst
+++ b/Documentation/arch/x86/x86_64/index.rst
@@ -15,3 +15,4 @@ x86_64 Support
    cpu-hotplug-spec
    machinecheck
    fsgs
+   fred
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:03:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:03:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572630.896481 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvk-0001y0-IY; Mon, 31 Jul 2023 07:03:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572630.896481; Mon, 31 Jul 2023 07:03:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvk-0001uF-9Y; Mon, 31 Jul 2023 07:03:00 +0000
Received: by outflank-mailman (input) for mailman id 572630;
 Mon, 31 Jul 2023 07:02:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMuu-0000hs-Am
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:08 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2868a8ba-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:05 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:01:56 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:01:57 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2868a8ba-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786926; x=1722322926;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=ks9fQ3QR6UqRMocjQpLz+yk1iYvQPVTbiFl2BDd8yPg=;
  b=FJ6c1HRtn6LGcysL1uA2OSv4/K/7VnmXSE4ZnZBZEB0V525Psxg8LIv4
   HOpM0/sVyOWNFp/HyGernH33Igw9EAl/Q2pfGd0MxnSI94zfhoRUoYwp8
   hOgFT9uL9oRdAj1es5CPJ2G8OSpn+hdeis4R2kPAkuPnDpMEfGWCJolfl
   9lZGt1aCgWf5le/dHhWxQHlFcByLDuL4Gm7fk/u8NJxL3vJag3ZUMljFJ
   /Kvn1OxuVWCQ7+hvGGplMMzqwsDHSOeTx239IuWfskJp1MTvhyedufhRI
   BVzKxQEt6YDroTIG/Hy4n1cFSbxd91MSzl8hMdt1VAyvZmVkOZBv/Os3C
   Q==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371648818"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371648818"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543368"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 07/36] x86/cpu: Add X86_CR4_FRED macro
Date: Sun, 30 Jul 2023 23:32:48 -0700
Message-Id: <20230731063317.3720-8-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

Add X86_CR4_FRED macro for the FRED bit in %cr4. This bit should be a
pinned bit, not to be changed after initialization.

CR4 macros are defined in arch/x86/include/uapi/asm/processor-flags.h,
which is uapi, and thus cannot depend on CONFIG_X86_64.

Using _BITUL() causes build errors on 32 bits, and there is no
guarantee that user space applications (e.g. something like Qemu)
might not want to use this declaration even when building for i386 or
x32.

However, %cr4 is a machine word (unsigned long), so to avoid build
warnings on 32 bits, explicitly cast the value to unsigned long,
truncating upper 32 bits.

The other alternative would be to use CONFIG_X86_64 around the
definition of cr4_pinned_mask. It is probably not desirable to make
cr4_pinned_mask non-const.

Another option, which may be preferable, to be honest: explicitly
enumerate the CR4 bits which *may* be changed (a whitelist), instead
of the ones that may not. That would be a separate, pre-FRED, patch,
and would automatically resolve this problem as a side effect.

The following flags probably should have been in this set all along,
as they are all controls affecting the kernel runtime environment as
opposed to user space:

X86_CR4_DE, X86_CR4_PAE, X86_CR4_PSE, X86_CR4_MCE, X86_CR4_PGE,
X86_CR4_OSFXSR, X86_CR4_OSXMMEXCPT, X86_CR4_LA57, X86_CR4_PCIDE,
X86_CR4_LAM_SUP

Possibly X86_CR4_VMXE as well, which seems harmless even if KVM is
not loaded; X86_CR4_PKE can be fixed as long as the PKE configuration
registers are at least initialized to disabled.

It is relatively simple to do an audit of which flags are allowed to
be modified at runtime and whitelist only those. There is no reason
why we should allow bits in CR4 to be toggled by default.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/include/uapi/asm/processor-flags.h | 2 ++
 arch/x86/kernel/cpu/common.c                | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/uapi/asm/processor-flags.h b/arch/x86/include/uapi/asm/processor-flags.h
index d898432947ff..ce08c2ca70b5 100644
--- a/arch/x86/include/uapi/asm/processor-flags.h
+++ b/arch/x86/include/uapi/asm/processor-flags.h
@@ -138,6 +138,8 @@
 #define X86_CR4_CET		_BITUL(X86_CR4_CET_BIT)
 #define X86_CR4_LAM_SUP_BIT	28 /* LAM for supervisor pointers */
 #define X86_CR4_LAM_SUP		_BITUL(X86_CR4_LAM_SUP_BIT)
+#define X86_CR4_FRED_BIT	32 /* enable FRED kernel entry */
+#define X86_CR4_FRED		_BITULL(X86_CR4_FRED_BIT)
 
 /*
  * x86-64 Task Priority Register, CR8
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 0ba1067f4e5f..331b06d19f7f 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -402,8 +402,9 @@ static __always_inline void setup_umip(struct cpuinfo_x86 *c)
 
 /* These bits should not change their value after CPU init is finished. */
 static const unsigned long cr4_pinned_mask =
-	X86_CR4_SMEP | X86_CR4_SMAP | X86_CR4_UMIP |
-	X86_CR4_FSGSBASE | X86_CR4_CET;
+	(unsigned long)
+	(X86_CR4_SMEP | X86_CR4_SMAP | X86_CR4_UMIP |
+	 X86_CR4_FSGSBASE | X86_CR4_CET | X86_CR4_FRED);
 static DEFINE_STATIC_KEY_FALSE_RO(cr_pinning);
 static unsigned long cr4_pinned_bits __ro_after_init;
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:03:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:03:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572644.896536 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvo-0003P2-G3; Mon, 31 Jul 2023 07:03:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572644.896536; Mon, 31 Jul 2023 07:03:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvo-0003IH-2G; Mon, 31 Jul 2023 07:03:04 +0000
Received: by outflank-mailman (input) for mailman id 572644;
 Mon, 31 Jul 2023 07:02:20 +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 <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMv6-0000iu-Ib
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:20 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2eb7d1d2-2f70-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 09:02:18 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:02:08 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:02:09 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2eb7d1d2-2f70-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786938; x=1722322938;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=61pP2ZrTnfM4AWC4LzTY02SWj0Yo4OSnGRh0vm8RTJ0=;
  b=bOJAVNs2S7SCJpU6++/oFJVb1FBl6pDQiqdi5vlCl3ZncdK2luXYLxcf
   rqA6j4qjngp8pyLSgG8nfVRs5XUWroS1U5oqUbhvzxAhyYOFkvZqum7gO
   vdjwlSmNdaQgdBm6lhdtXkMIe6Ln9SMQDOmBpTOGMw2PRdfZc8sDpK8Kr
   gJEdPtUfp7jgF2Fpx0v2xnkmEdkallW2RqERScrjNJguYLQv84QfeddVe
   SYYNiMNnDh44WaOU1AldQAdZ/F8NSDsWmxAHDGkq4FvOzuGPwroBfjfGn
   5G2g4A0d63Ee9vrPNL4l9jtCV1tCgu+t/KQAa32uPB5sSdh9Eyy6tqcX5
   w==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371649209"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371649209"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543449"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 18/36] x86/fred: Add a page fault entry stub for FRED
Date: Sun, 30 Jul 2023 23:32:59 -0700
Message-Id: <20230731063317.3720-19-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

Add a page fault entry stub for FRED.

On a FRED system, the faulting address (CR2) is passed on the stack,
to avoid the problem of transient state. Thus we get the page fault
address from the stack instead of CR2.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/include/asm/fred.h |  2 ++
 arch/x86/mm/fault.c         | 18 ++++++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/fred.h b/arch/x86/include/asm/fred.h
index b45c1bea5b7f..fb8e7b4f2d38 100644
--- a/arch/x86/include/asm/fred.h
+++ b/arch/x86/include/asm/fred.h
@@ -112,6 +112,8 @@ static __always_inline unsigned long fred_event_data(struct pt_regs *regs)
 
 typedef DECLARE_FRED_HANDLER((*fred_handler));
 
+DECLARE_FRED_HANDLER(fred_exc_page_fault);
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* CONFIG_X86_FRED */
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index e8711b2cafaf..dd3df092d0f2 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -34,6 +34,7 @@
 #include <asm/kvm_para.h>		/* kvm_handle_async_pf		*/
 #include <asm/vdso.h>			/* fixup_vdso_exception()	*/
 #include <asm/irq_stack.h>
+#include <asm/fred.h>
 
 #define CREATE_TRACE_POINTS
 #include <asm/trace/exceptions.h>
@@ -1495,9 +1496,10 @@ handle_page_fault(struct pt_regs *regs, unsigned long error_code,
 	}
 }
 
-DEFINE_IDTENTRY_RAW_ERRORCODE(exc_page_fault)
+static __always_inline void page_fault_common(struct pt_regs *regs,
+					      unsigned int error_code,
+					      unsigned long address)
 {
-	unsigned long address = read_cr2();
 	irqentry_state_t state;
 
 	prefetchw(&current->mm->mmap_lock);
@@ -1544,3 +1546,15 @@ DEFINE_IDTENTRY_RAW_ERRORCODE(exc_page_fault)
 
 	irqentry_exit(regs, state);
 }
+
+DEFINE_IDTENTRY_RAW_ERRORCODE(exc_page_fault)
+{
+	page_fault_common(regs, error_code, read_cr2());
+}
+
+#ifdef CONFIG_X86_FRED
+DEFINE_FRED_HANDLER(fred_exc_page_fault)
+{
+	page_fault_common(regs, regs->orig_ax, fred_event_data(regs));
+}
+#endif
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:03:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:03:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572648.896556 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvq-0003ok-FB; Mon, 31 Jul 2023 07:03:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572648.896556; Mon, 31 Jul 2023 07:03:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvp-0003k7-O6; Mon, 31 Jul 2023 07:03:05 +0000
Received: by outflank-mailman (input) for mailman id 572648;
 Mon, 31 Jul 2023 07:02:24 +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 <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMvA-0000iu-Ty
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:24 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 329a4bd2-2f70-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 09:02:23 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:02:12 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:02:13 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 329a4bd2-2f70-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786943; x=1722322943;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=QeZUtDgMAPwFIrdo9TmaG72+ignP6GGIZpxe8B2aw6k=;
  b=QuUXo2nb07kF44TG969mFLg28G1/4KTubgFPBSjRLmyJ7vTIp0rSbvsl
   XFiPuxZL4Q/geYa/I2UaJyiFx5mi1CR6naRlvLyukNEd7yXU0y9EYd8Cl
   Oi3q4c2uSu/JN2B2omLZpu6wAUNAPdtDaaiCezqfsyKCxbQSUCBYTa4n5
   6X1Ap+fFj/Guudf6c1cBPJxM1/J+ERuuRmXv8XeCbLsCh1l+2LVfOCd0W
   o5l/t++z+yxhYff7dPHV2rKgXM+Z4fIFXSW90NT+lyzrer4ZH1i1sGg4p
   6aIoeD+57B02bhHgANDn/jGHEkowA0Z9wHBpos2uXM/jDWEdN/9jF+Hro
   Q==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371649347"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371649347"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543474"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 22/36] x86/fred: Add a double fault entry stub for FRED
Date: Sun, 30 Jul 2023 23:33:03 -0700
Message-Id: <20230731063317.3720-23-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The IDT event delivery of a double fault pushes an error code into the
orig_ax member of the pt_regs structure, and the error code is passed
as the second argument of its C-handler exc_double_fault(), although
the pt_regs structure is already passed as the first argument.

The existing IDT double fault asm entry code does the following

  movq ORIG_RAX(%rsp), %rsi	/* get error code into 2nd argument*/
  movq $-1, ORIG_RAX(%rsp)	/* no syscall to restart */

to set the orig_ax member to -1 just before calling the C-handler.

X86_TRAP_TS, X86_TRAP_NP, X86_TRAP_SS, X86_TRAP_GP, X86_TRAP_AC and
X86_TRAP_CP are all handled in the same way because the IDT event
delivery pushes an error code into their stack frame for them.

The commit d99015b1abbad ("x86: move entry_64.S register saving out of
the macros") introduced the changes to set orig_ax to -1, but I can't
see why. Our tests with FRED seem fine if orig_ax is left unchanged
instead of set to -1. It's probably cleaner and simpler to remove the
second argument from exc_double_fault() while leave orig_ax unchanged
to pass the error code inside the first argument, at least on native
x86_64. That would be a separate, pre-FRED, patch.

For now just add a double fault entry stub for FRED, which simply
calls the existing exc_double_fault().

Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/include/asm/fred.h | 1 +
 arch/x86/kernel/traps.c     | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/arch/x86/include/asm/fred.h b/arch/x86/include/asm/fred.h
index f559dd9dc4f2..bd701ac87528 100644
--- a/arch/x86/include/asm/fred.h
+++ b/arch/x86/include/asm/fred.h
@@ -116,6 +116,7 @@ DECLARE_FRED_HANDLER(fred_exc_nmi);
 DECLARE_FRED_HANDLER(fred_exc_debug);
 DECLARE_FRED_HANDLER(fred_exc_page_fault);
 DECLARE_FRED_HANDLER(fred_exc_machine_check);
+DECLARE_FRED_HANDLER(fred_exc_double_fault);
 
 #endif /* __ASSEMBLY__ */
 
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index b10464966a81..49dd92458eb0 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -555,6 +555,13 @@ DEFINE_IDTENTRY_DF(exc_double_fault)
 	instrumentation_end();
 }
 
+#ifdef CONFIG_X86_FRED
+DEFINE_FRED_HANDLER(fred_exc_double_fault)
+{
+	exc_double_fault(regs, regs->orig_ax);
+}
+#endif
+
 DEFINE_IDTENTRY(exc_bounds)
 {
 	if (notify_die(DIE_TRAP, "bounds", regs, 0,
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:03:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:03:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572645.896548 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvp-0003Zz-FE; Mon, 31 Jul 2023 07:03:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572645.896548; Mon, 31 Jul 2023 07:03:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvo-0003Wx-QS; Mon, 31 Jul 2023 07:03:04 +0000
Received: by outflank-mailman (input) for mailman id 572645;
 Mon, 31 Jul 2023 07:02:22 +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 <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMv8-0000iu-Ce
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:22 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 311d8aa6-2f70-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 09:02:20 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:02:10 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:02:11 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 311d8aa6-2f70-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786940; x=1722322940;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=CDXH8O7ex78Bl5bAFBaH8EJ8EpWaGJ2TaZytElzEDrs=;
  b=WVV+s6dLELKa6tA35e8yr4O7g8OwcxgwUPDLHTX1Vcwg2G0WjzKlGQSQ
   EgbY4MKcP5wP2SxcX3Bb2dC0Gk91KI4bGDwjkU30f4PRLQXn7Xyh0aIUq
   XBbB7plUjId8Wwy/YNr1l91edqDM4NWkYTiLCpsdqrS63ZQHI/Zye/BZv
   rp4EZmqPsdDzCI0p+RpXOWKXL/bMjfRdrqqioAEoDWvUA5JuPNSvUDkgN
   to6rmUCOxav5i8GBIkDCHYTYxfTLXcK5pHAld8ngriwQhDZ2lL0+XlExq
   c/GO+yJVNFWl9CRmeFsNUooHQeqttN61Hp+y1kXx8pIvsbrJmeF3fPhR1
   w==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371649276"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371649276"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543462"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 20/36] x86/fred: Add a NMI entry stub for FRED
Date: Sun, 30 Jul 2023 23:33:01 -0700
Message-Id: <20230731063317.3720-21-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

On a FRED system, NMIs nest both with themselves and faults, transient
information is saved into the stack frame, and NMI unblocking only
happens when the stack frame indicates that so should happen.

Thus, the NMI entry stub for FRED is really quite small...

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/include/asm/fred.h |  1 +
 arch/x86/kernel/nmi.c       | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/arch/x86/include/asm/fred.h b/arch/x86/include/asm/fred.h
index ad7b79130b1e..2a7c47dfd733 100644
--- a/arch/x86/include/asm/fred.h
+++ b/arch/x86/include/asm/fred.h
@@ -112,6 +112,7 @@ static __always_inline unsigned long fred_event_data(struct pt_regs *regs)
 
 typedef DECLARE_FRED_HANDLER((*fred_handler));
 
+DECLARE_FRED_HANDLER(fred_exc_nmi);
 DECLARE_FRED_HANDLER(fred_exc_debug);
 DECLARE_FRED_HANDLER(fred_exc_page_fault);
 
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
index a0c551846b35..f803e2bcd024 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
@@ -34,6 +34,7 @@
 #include <asm/cache.h>
 #include <asm/nospec-branch.h>
 #include <asm/sev.h>
+#include <asm/fred.h>
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/nmi.h>
@@ -643,6 +644,24 @@ void nmi_backtrace_stall_check(const struct cpumask *btp)
 
 #endif
 
+#ifdef CONFIG_X86_FRED
+DEFINE_FRED_HANDLER(fred_exc_nmi)
+{
+	/*
+	 * With FRED, CR2 and DR6 are pushed atomically on faults,
+	 * so we don't have to worry about saving and restoring them.
+	 * Breakpoint faults nest, so assume it is OK to leave DR7
+	 * enabled.
+	 */
+	irqentry_state_t irq_state = irqentry_nmi_enter(regs);
+
+	inc_irq_stat(__nmi_count);
+	default_do_nmi(regs);
+
+	irqentry_nmi_exit(regs, irq_state);
+}
+#endif
+
 void stop_nmi(void)
 {
 	ignore_nmis++;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:03:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:03:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572622.896449 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvi-0001AC-TK; Mon, 31 Jul 2023 07:02:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572622.896449; Mon, 31 Jul 2023 07:02:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvi-00018L-K5; Mon, 31 Jul 2023 07:02:58 +0000
Received: by outflank-mailman (input) for mailman id 572622;
 Mon, 31 Jul 2023 07:02:05 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMur-0000hs-A7
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:05 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 27813696-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:04 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:01:53 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:01:54 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 27813696-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786924; x=1722322924;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=tXI/C++YYSo9nyQMGnRVNwF3YsuprVE9KCho8shF7bg=;
  b=oKkBY9juQMSzrILzvSiqxxPqUVuXAfq646vitouqi/Nthv0nu1GJqIsz
   PL/NR53vA7ASniMtqUlBAoUWKMpwb7qDeG1eEBpkcRIC1vZv5sNTV5YKR
   hc0Zoq6OpgRUNYmBgg4S81pcJojfpiT7M/5anj3rOzO8o3/4we8BIXY4S
   cUDCVFWaTvRX0QMndSE8EiPmAc1IAa3RTnK6m5pr/6A4YgRrIqPnaCzaM
   xnJUJ3udwk1Rb3mJrhY3Ny/ZRwe8nTMyMqxyuGg8BJTgkQNgryAlYz083
   HfU5nsWHMXRxHSG/KbpV/WlXjAyqT7k507s/6KmkybzD7mQymSjs+TgTF
   w==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371648703"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371648703"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543352"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 04/36] x86/cpufeatures: Add the cpu feature bit for FRED
Date: Sun, 30 Jul 2023 23:32:45 -0700
Message-Id: <20230731063317.3720-5-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

Add the CPU feature bit for FRED.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/include/asm/cpufeatures.h       | 1 +
 tools/arch/x86/include/asm/cpufeatures.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
index cb8ca46213be..fd3ddd5c0283 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -317,6 +317,7 @@
 #define X86_FEATURE_FZRM		(12*32+10) /* "" Fast zero-length REP MOVSB */
 #define X86_FEATURE_FSRS		(12*32+11) /* "" Fast short REP STOSB */
 #define X86_FEATURE_FSRC		(12*32+12) /* "" Fast short REP {CMPSB,SCASB} */
+#define X86_FEATURE_FRED		(12*32+17) /* Flexible Return and Event Delivery */
 #define X86_FEATURE_LKGS		(12*32+18) /* "" Load "kernel" (userspace) GS */
 #define X86_FEATURE_AMX_FP16		(12*32+21) /* "" AMX fp16 Support */
 #define X86_FEATURE_AVX_IFMA            (12*32+23) /* "" Support for VPMADD52[H,L]UQ */
diff --git a/tools/arch/x86/include/asm/cpufeatures.h b/tools/arch/x86/include/asm/cpufeatures.h
index cb8ca46213be..fd3ddd5c0283 100644
--- a/tools/arch/x86/include/asm/cpufeatures.h
+++ b/tools/arch/x86/include/asm/cpufeatures.h
@@ -317,6 +317,7 @@
 #define X86_FEATURE_FZRM		(12*32+10) /* "" Fast zero-length REP MOVSB */
 #define X86_FEATURE_FSRS		(12*32+11) /* "" Fast short REP STOSB */
 #define X86_FEATURE_FSRC		(12*32+12) /* "" Fast short REP {CMPSB,SCASB} */
+#define X86_FEATURE_FRED		(12*32+17) /* Flexible Return and Event Delivery */
 #define X86_FEATURE_LKGS		(12*32+18) /* "" Load "kernel" (userspace) GS */
 #define X86_FEATURE_AMX_FP16		(12*32+21) /* "" AMX fp16 Support */
 #define X86_FEATURE_AVX_IFMA            (12*32+23) /* "" Support for VPMADD52[H,L]UQ */
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:03:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:03:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572625.896458 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvj-0001Np-9X; Mon, 31 Jul 2023 07:02:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572625.896458; Mon, 31 Jul 2023 07:02:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvj-0001Mc-1G; Mon, 31 Jul 2023 07:02:59 +0000
Received: by outflank-mailman (input) for mailman id 572625;
 Mon, 31 Jul 2023 07:02:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMus-0000hs-AE
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:06 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 27a5d377-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:04 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:01:54 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:01:55 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 27a5d377-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786924; x=1722322924;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=F/SemwGNBG6weEZopYj3iIwsf6sy0XGLv5PanieJeUc=;
  b=Vw2WEwXXcICQqdNT2ae4LolsYzfchslshNDfrPHKeIwSBeIM0fghfq4G
   sz2FutcpKHx2VUJIEkKWyHQgQ8yGI4vrNPHlVpjPQxECJqKTFL7F03coX
   hZ9fQeKzySNZD6hrTb6WbYLpkcw8b1FwPvq/2NnyLwjd4eN4X+xOe+HLD
   Ep4p6hZ+R2A/XGkhFndH+Ipk/I5NDo+iMtKnuPEt1wVK/UzKX/kDfvJ+h
   cOyOgLfA3QC/IGE9YntxaH8p6yIGRINi4R/gYkvOS5BeIMXjWwZJzTarG
   LTMa7sZflz/xd/VHes9y97uXLpXLSUurLOMpWVxhKj0cmp4RN3OU3neok
   A==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371648742"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371648742"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543358"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 05/36] x86/opcode: Add ERETU, ERETS instructions to x86-opcode-map
Date: Sun, 30 Jul 2023 23:32:46 -0700
Message-Id: <20230731063317.3720-6-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

Add instruction opcodes used by FRED ERETU/ERETS to x86-opcode-map.

Opcode numbers are per FRED spec v5.0.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/lib/x86-opcode-map.txt       | 2 +-
 tools/arch/x86/lib/x86-opcode-map.txt | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/lib/x86-opcode-map.txt b/arch/x86/lib/x86-opcode-map.txt
index 5168ee0360b2..7a269e269dc0 100644
--- a/arch/x86/lib/x86-opcode-map.txt
+++ b/arch/x86/lib/x86-opcode-map.txt
@@ -1052,7 +1052,7 @@ EndTable
 
 GrpTable: Grp7
 0: SGDT Ms | VMCALL (001),(11B) | VMLAUNCH (010),(11B) | VMRESUME (011),(11B) | VMXOFF (100),(11B) | PCONFIG (101),(11B) | ENCLV (000),(11B)
-1: SIDT Ms | MONITOR (000),(11B) | MWAIT (001),(11B) | CLAC (010),(11B) | STAC (011),(11B) | ENCLS (111),(11B)
+1: SIDT Ms | MONITOR (000),(11B) | MWAIT (001),(11B) | CLAC (010),(11B) | STAC (011),(11B) | ENCLS (111),(11B) | ERETU (F3),(010),(11B) | ERETS (F2),(010),(11B)
 2: LGDT Ms | XGETBV (000),(11B) | XSETBV (001),(11B) | VMFUNC (100),(11B) | XEND (101)(11B) | XTEST (110)(11B) | ENCLU (111),(11B)
 3: LIDT Ms
 4: SMSW Mw/Rv
diff --git a/tools/arch/x86/lib/x86-opcode-map.txt b/tools/arch/x86/lib/x86-opcode-map.txt
index 5168ee0360b2..7a269e269dc0 100644
--- a/tools/arch/x86/lib/x86-opcode-map.txt
+++ b/tools/arch/x86/lib/x86-opcode-map.txt
@@ -1052,7 +1052,7 @@ EndTable
 
 GrpTable: Grp7
 0: SGDT Ms | VMCALL (001),(11B) | VMLAUNCH (010),(11B) | VMRESUME (011),(11B) | VMXOFF (100),(11B) | PCONFIG (101),(11B) | ENCLV (000),(11B)
-1: SIDT Ms | MONITOR (000),(11B) | MWAIT (001),(11B) | CLAC (010),(11B) | STAC (011),(11B) | ENCLS (111),(11B)
+1: SIDT Ms | MONITOR (000),(11B) | MWAIT (001),(11B) | CLAC (010),(11B) | STAC (011),(11B) | ENCLS (111),(11B) | ERETU (F3),(010),(11B) | ERETS (F2),(010),(11B)
 2: LGDT Ms | XGETBV (000),(11B) | XSETBV (001),(11B) | VMFUNC (100),(11B) | XEND (101)(11B) | XTEST (110)(11B) | ENCLU (111),(11B)
 3: LIDT Ms
 4: SMSW Mw/Rv
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:03:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:03:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572642.896531 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvn-00038w-SI; Mon, 31 Jul 2023 07:03:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572642.896531; Mon, 31 Jul 2023 07:03:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvn-00035v-EC; Mon, 31 Jul 2023 07:03:03 +0000
Received: by outflank-mailman (input) for mailman id 572642;
 Mon, 31 Jul 2023 07:02:19 +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 <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMv5-0000iu-AB
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:19 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2e037e01-2f70-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 09:02:16 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:02:06 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:02:06 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2e037e01-2f70-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786936; x=1722322936;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=R/F68dINSJ894CWgsWAeNvE3sYeHzSDBLZY+Pavzuys=;
  b=MwYQYeWgkLy9687TOqWh8rDzU3V+asMVksYj58l1VRT64u+L3rOFHST1
   YJLWsx8mqUSfXSkn2g6H4rwR7iepQyIP2Jvl5IPzppSSba1Ynt9Y0HzfB
   K2t+M8Uw7jz5PSZ57z+1dlFWb2PlTSfh9P29Aac0WUKbNt89yWnlw6xu4
   5seqrDkzXkeHBXh+hAxCMt6gwkpyWl1M6eIke/rjBU8GTYciVfzOe7jTV
   n6sgDbEOyvmHvFGz6GxScaGgdK81/Z5CcGsz/o4V9STQ0dT7nbVvhjWoe
   TNXmRB1YPmx4icSt6BhN6U4Y4PF5og8nhPTJ4is+9hym1NbjssvyaGMLv
   g==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371649141"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371649141"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543437"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 16/36] x86/fred: Allow single-step trap and NMI when starting a new task
Date: Sun, 30 Jul 2023 23:32:57 -0700
Message-Id: <20230731063317.3720-17-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

Entering a new task is logically speaking a return from a system call
(exec, fork, clone, etc.). As such, if ptrace enables single stepping
a single step exception should be allowed to trigger immediately upon
entering user space. This is not optional.

NMI should *never* be disabled in user space. As such, this is an
optional, opportunistic way to catch errors.

Allow single-step trap and NMI when starting a new task, thus once
the new task enters user space, single-step trap and NMI are both
enabled immediately.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---

Changes since v8:
* Use high-order 48 bits above the lowest 16 bit SS only when FRED
  is enabled (Thomas Gleixner).
---
 arch/x86/kernel/process_64.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 6d5fed29f552..0b47871a6141 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -56,6 +56,7 @@
 #include <asm/resctrl.h>
 #include <asm/unistd.h>
 #include <asm/fsgsbase.h>
+#include <asm/fred.h>
 #ifdef CONFIG_IA32_EMULATION
 /* Not included via unistd.h */
 #include <asm/unistd_32_ia32.h>
@@ -507,8 +508,18 @@ void x86_gsbase_write_task(struct task_struct *task, unsigned long gsbase)
 static void
 start_thread_common(struct pt_regs *regs, unsigned long new_ip,
 		    unsigned long new_sp,
-		    unsigned int _cs, unsigned int _ss, unsigned int _ds)
+		    u16 _cs, u16 _ss, u16 _ds)
 {
+	/*
+	 * Paranoia: High-order 48 bits above the lowest 16 bit SS are
+	 * discarded by the legacy IRET instruction on all Intel, AMD,
+	 * and Cyrix/Centaur/VIA CPUs, thus can be set unconditionally,
+	 * even when FRED is not enabled. But we choose the safer side
+	 * to use these bits only when FRED is enabled.
+	 */
+	const unsigned long ssx_flags = cpu_feature_enabled(X86_FEATURE_FRED) ?
+		(FRED_SSX_SOFTWARE_INITIATED | FRED_SSX_NMI) : 0;
+
 	WARN_ON_ONCE(regs != current_pt_regs());
 
 	if (static_cpu_has(X86_BUG_NULL_SEG)) {
@@ -522,11 +533,11 @@ start_thread_common(struct pt_regs *regs, unsigned long new_ip,
 	loadsegment(ds, _ds);
 	load_gs_index(0);
 
-	regs->ip		= new_ip;
-	regs->sp		= new_sp;
-	regs->cs		= _cs;
-	regs->ss		= _ss;
-	regs->flags		= X86_EFLAGS_IF;
+	regs->ip	= new_ip;
+	regs->sp	= new_sp;
+	regs->csx	= _cs;
+	regs->ssx	= _ss | ssx_flags;
+	regs->flags	= X86_EFLAGS_IF | X86_EFLAGS_FIXED;
 }
 
 void
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:03:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:03:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572633.896493 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvl-00026a-4s; Mon, 31 Jul 2023 07:03:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572633.896493; Mon, 31 Jul 2023 07:03:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvk-00024I-N6; Mon, 31 Jul 2023 07:03:00 +0000
Received: by outflank-mailman (input) for mailman id 572633;
 Mon, 31 Jul 2023 07:02:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMuv-0000hs-Ay
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:09 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 291bf6f6-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:07 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:01:57 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:01:58 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 291bf6f6-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786927; x=1722322927;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=4BQfFZvfF2FO6NJuqP2rESZLyKeNKRqaVIW2rUp/ej0=;
  b=kQpulawwBO7pmbaIlUO6srLYMVpieyPAEGWIZCetAkkvqK94yymDqiyS
   24ZqUg7CE0eQxzvMIGCAh8SInLVl7fLM1n6oZ90G0KAal9DWM1L5Zs3fI
   I9OY4WLls6wZgruWd8tXHuUJIhqD8nSV+UvKMhS6DX76ZVnaXktsxJqwx
   sdiHOvtSmMN3m2xnpeKicvKgVrjuCpor6u2GtY+yaLyd7skncCNKc7YzW
   Fd+BUVYTxVz9lhzzFn2R7C7DNlJ5TJLode8xs/u89hf3X231xB71nlNGH
   GZU/EnT5ywaYiF/eFD5iVVlJhR/kmntXZvRki8RXllyMsnIOYusF2zitc
   w==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371648852"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371648852"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543375"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 08/36] x86/cpu: Add MSR numbers for FRED configuration
Date: Sun, 30 Jul 2023 23:32:49 -0700
Message-Id: <20230731063317.3720-9-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

Add MSR numbers for the FRED configuration registers.

Originally-by: Megha Dey <megha.dey@intel.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/include/asm/msr-index.h       | 13 ++++++++++++-
 tools/arch/x86/include/asm/msr-index.h | 13 ++++++++++++-
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index a00a53e15ab7..111fb76f6dbe 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -36,8 +36,19 @@
 #define EFER_FFXSR		(1<<_EFER_FFXSR)
 #define EFER_AUTOIBRS		(1<<_EFER_AUTOIBRS)
 
-/* Intel MSRs. Some also available on other CPUs */
+/* FRED MSRs */
+#define MSR_IA32_FRED_RSP0	0x1cc /* Level 0 stack pointer */
+#define MSR_IA32_FRED_RSP1	0x1cd /* Level 1 stack pointer */
+#define MSR_IA32_FRED_RSP2	0x1ce /* Level 2 stack pointer */
+#define MSR_IA32_FRED_RSP3	0x1cf /* Level 3 stack pointer */
+#define MSR_IA32_FRED_STKLVLS	0x1d0 /* Exception stack levels */
+#define MSR_IA32_FRED_SSP0	MSR_IA32_PL0_SSP /* Level 0 shadow stack pointer */
+#define MSR_IA32_FRED_SSP1	0x1d1 /* Level 1 shadow stack pointer */
+#define MSR_IA32_FRED_SSP2	0x1d2 /* Level 2 shadow stack pointer */
+#define MSR_IA32_FRED_SSP3	0x1d3 /* Level 3 shadow stack pointer */
+#define MSR_IA32_FRED_CONFIG	0x1d4 /* Entrypoint and interrupt stack level */
 
+/* Intel MSRs. Some also available on other CPUs */
 #define MSR_TEST_CTRL				0x00000033
 #define MSR_TEST_CTRL_SPLIT_LOCK_DETECT_BIT	29
 #define MSR_TEST_CTRL_SPLIT_LOCK_DETECT		BIT(MSR_TEST_CTRL_SPLIT_LOCK_DETECT_BIT)
diff --git a/tools/arch/x86/include/asm/msr-index.h b/tools/arch/x86/include/asm/msr-index.h
index 3aedae61af4f..565cade0785a 100644
--- a/tools/arch/x86/include/asm/msr-index.h
+++ b/tools/arch/x86/include/asm/msr-index.h
@@ -36,8 +36,19 @@
 #define EFER_FFXSR		(1<<_EFER_FFXSR)
 #define EFER_AUTOIBRS		(1<<_EFER_AUTOIBRS)
 
-/* Intel MSRs. Some also available on other CPUs */
+/* FRED MSRs */
+#define MSR_IA32_FRED_RSP0	0x1cc /* Level 0 stack pointer */
+#define MSR_IA32_FRED_RSP1	0x1cd /* Level 1 stack pointer */
+#define MSR_IA32_FRED_RSP2	0x1ce /* Level 2 stack pointer */
+#define MSR_IA32_FRED_RSP3	0x1cf /* Level 3 stack pointer */
+#define MSR_IA32_FRED_STKLVLS	0x1d0 /* Exception stack levels */
+#define MSR_IA32_FRED_SSP0	MSR_IA32_PL0_SSP /* Level 0 shadow stack pointer */
+#define MSR_IA32_FRED_SSP1	0x1d1 /* Level 1 shadow stack pointer */
+#define MSR_IA32_FRED_SSP2	0x1d2 /* Level 2 shadow stack pointer */
+#define MSR_IA32_FRED_SSP3	0x1d3 /* Level 3 shadow stack pointer */
+#define MSR_IA32_FRED_CONFIG	0x1d4 /* Entrypoint and interrupt stack level */
 
+/* Intel MSRs. Some also available on other CPUs */
 #define MSR_TEST_CTRL				0x00000033
 #define MSR_TEST_CTRL_SPLIT_LOCK_DETECT_BIT	29
 #define MSR_TEST_CTRL_SPLIT_LOCK_DETECT		BIT(MSR_TEST_CTRL_SPLIT_LOCK_DETECT_BIT)
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:03:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:03:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572620.896440 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvi-00011Q-G2; Mon, 31 Jul 2023 07:02:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572620.896440; Mon, 31 Jul 2023 07:02:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvi-00010k-8r; Mon, 31 Jul 2023 07:02:58 +0000
Received: by outflank-mailman (input) for mailman id 572620;
 Mon, 31 Jul 2023 07:02:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMuq-0000hs-9n
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:04 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 25ea018a-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:03 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:01:52 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:01:53 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 25ea018a-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786923; x=1722322923;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=ok7xj4KwdkLOXDJ1J3mT1oirCcERqdhXdoxphTKdFWY=;
  b=h22EGWLMyombHvE/E3NPf3fPvGDNcjsCizffViaDgtVxy0rRXN6YS6Uz
   WxctpgXshZ6JRh3N3ubDIYv5Ckf3ngtxIwIpVtVD16fZadFGMgKCJaCv8
   yTlqoSLYFY0IG0XAwUUdfcqiXVva3oqTpEoXeF5JTcpbKCnYWSsnORkGS
   oCgm1m4UQLU99d8Wvl2Nn1+YmmS/WFxTPBNEyhzxiTuZMWN+wTt9UGm8v
   KcqOGT2nBhlsjWk1aLI5Gse1Y9dH0HS4Ty/hp+PrxIcVMgTbWq3nHhM2t
   KrojR+BF1pZkNGTlc0GYiKTSeXtjF8mpYRjcjCu41Y2yqrYdhayEbfyp6
   w==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371648667"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371648667"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543348"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 03/36] x86/fred: Disable FRED support if CONFIG_X86_FRED is disabled
Date: Sun, 30 Jul 2023 23:32:44 -0700
Message-Id: <20230731063317.3720-4-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

Add CONFIG_X86_FRED to <asm/disabled-features.h> to make
cpu_feature_enabled() work correctly with FRED.

Originally-by: Megha Dey <megha.dey@intel.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/include/asm/disabled-features.h       | 8 +++++++-
 tools/arch/x86/include/asm/disabled-features.h | 8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/disabled-features.h b/arch/x86/include/asm/disabled-features.h
index fafe9be7a6f4..85fd67c67ce1 100644
--- a/arch/x86/include/asm/disabled-features.h
+++ b/arch/x86/include/asm/disabled-features.h
@@ -105,6 +105,12 @@
 # define DISABLE_TDX_GUEST	(1 << (X86_FEATURE_TDX_GUEST & 31))
 #endif
 
+#ifdef CONFIG_X86_FRED
+# define DISABLE_FRED 0
+#else
+# define DISABLE_FRED (1 << (X86_FEATURE_FRED & 31))
+#endif
+
 /*
  * Make sure to add features to the correct mask
  */
@@ -122,7 +128,7 @@
 #define DISABLED_MASK11	(DISABLE_RETPOLINE|DISABLE_RETHUNK|DISABLE_UNRET| \
 			 DISABLE_CALL_DEPTH_TRACKING)
 #define DISABLED_MASK12	(DISABLE_LAM)
-#define DISABLED_MASK13	0
+#define DISABLED_MASK13	(DISABLE_FRED)
 #define DISABLED_MASK14	0
 #define DISABLED_MASK15	0
 #define DISABLED_MASK16	(DISABLE_PKU|DISABLE_OSPKE|DISABLE_LA57|DISABLE_UMIP| \
diff --git a/tools/arch/x86/include/asm/disabled-features.h b/tools/arch/x86/include/asm/disabled-features.h
index fafe9be7a6f4..85fd67c67ce1 100644
--- a/tools/arch/x86/include/asm/disabled-features.h
+++ b/tools/arch/x86/include/asm/disabled-features.h
@@ -105,6 +105,12 @@
 # define DISABLE_TDX_GUEST	(1 << (X86_FEATURE_TDX_GUEST & 31))
 #endif
 
+#ifdef CONFIG_X86_FRED
+# define DISABLE_FRED 0
+#else
+# define DISABLE_FRED (1 << (X86_FEATURE_FRED & 31))
+#endif
+
 /*
  * Make sure to add features to the correct mask
  */
@@ -122,7 +128,7 @@
 #define DISABLED_MASK11	(DISABLE_RETPOLINE|DISABLE_RETHUNK|DISABLE_UNRET| \
 			 DISABLE_CALL_DEPTH_TRACKING)
 #define DISABLED_MASK12	(DISABLE_LAM)
-#define DISABLED_MASK13	0
+#define DISABLED_MASK13	(DISABLE_FRED)
 #define DISABLED_MASK14	0
 #define DISABLED_MASK15	0
 #define DISABLED_MASK16	(DISABLE_PKU|DISABLE_OSPKE|DISABLE_LA57|DISABLE_UMIP| \
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:03:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:03:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572635.896503 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvl-0002Nb-PV; Mon, 31 Jul 2023 07:03:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572635.896503; Mon, 31 Jul 2023 07:03:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvl-0002Lz-Bb; Mon, 31 Jul 2023 07:03:01 +0000
Received: by outflank-mailman (input) for mailman id 572635;
 Mon, 31 Jul 2023 07:02:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMuw-0000hs-Az
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:10 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 29d8aa5a-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:08 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:01:58 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:01:59 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 29d8aa5a-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786928; x=1722322928;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=f1KjXTBSCMC/3m47AKFmo72XHXtCtx2wNvJSmQVR8WU=;
  b=MCe+CkaaOiasJb1YHhBc5MD3+mkULEaIwSc2b0nqLgHl35bWnYPW2MVd
   oLYZ6P/TBL3/VszdfJUxVACbdrS3T4M2UzhLoLBsGIdyNEGUdk8ps5WjS
   WCcAgU3YaN6JtJ33av8BNHvuhuqF9BdMyXDM26cZ02VHRg2NqGR2pTMIm
   A/f5cqYgTkG9iuVaUgK6SMp/0NoxXfloPca512UwrjnQfc4x01HbjpL6a
   YK9/BeBDAc1qazAfrfj9igsTMvyl4MD1893H9wakRgLsA9nbWGiuOZryw
   zo8KVPzZHuLfdnWnzErn4XQGTGktLRyFFyzIfvJftOQS4ufqt+4TpWpmm
   A==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371648889"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371648889"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543380"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 09/36] x86/fred: Make unions for the cs and ss fields in struct pt_regs
Date: Sun, 30 Jul 2023 23:32:50 -0700
Message-Id: <20230731063317.3720-10-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

Make the cs and ss fields in struct pt_regs unions between the actual
selector and the unsigned long stack slot. FRED uses this space to
store additional flags.

The printk changes are simply due to the cs and ss fields changed to
unsigned short from unsigned long.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---

Changes since v8:
* Reflect stack frame definition changes from FRED spec 3.0 to 5.0.
* Use __packed instead of __attribute__((__packed__)) (Borislav Petkov).
* Put all comments above the members, like the rest of the file does
  (Borislav Petkov).

Changes since v3:
* Rename csl/ssl of the pt_regs structure to csx/ssx (x for extended)
  (Andrew Cooper).
---
 arch/x86/entry/vsyscall/vsyscall_64.c |  2 +-
 arch/x86/include/asm/ptrace.h         | 57 +++++++++++++++++++++++++--
 arch/x86/kernel/process_64.c          |  2 +-
 3 files changed, 56 insertions(+), 5 deletions(-)

diff --git a/arch/x86/entry/vsyscall/vsyscall_64.c b/arch/x86/entry/vsyscall/vsyscall_64.c
index e0ca8120aea8..a3c0df11d0e6 100644
--- a/arch/x86/entry/vsyscall/vsyscall_64.c
+++ b/arch/x86/entry/vsyscall/vsyscall_64.c
@@ -76,7 +76,7 @@ static void warn_bad_vsyscall(const char *level, struct pt_regs *regs,
 	if (!show_unhandled_signals)
 		return;
 
-	printk_ratelimited("%s%s[%d] %s ip:%lx cs:%lx sp:%lx ax:%lx si:%lx di:%lx\n",
+	printk_ratelimited("%s%s[%d] %s ip:%lx cs:%x sp:%lx ax:%lx si:%lx di:%lx\n",
 			   level, current->comm, task_pid_nr(current),
 			   message, regs->ip, regs->cs,
 			   regs->sp, regs->ax, regs->si, regs->di);
diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
index f4db78b09c8f..f1690beffd15 100644
--- a/arch/x86/include/asm/ptrace.h
+++ b/arch/x86/include/asm/ptrace.h
@@ -80,15 +80,66 @@ struct pt_regs {
 /*
  * On syscall entry, this is syscall#. On CPU exception, this is error code.
  * On hw interrupt, it's IRQ number:
+ *
+ * A FRED stack frame starts here:
+ *   1) It _always_ includes an error code;
+ *   2) The return frame for eretu/erets starts here.
  */
 	unsigned long orig_ax;
 /* Return frame for iretq */
 	unsigned long ip;
-	unsigned long cs;
+	union {
+/* CS extended: CS + any fields above it */
+		unsigned long csx;
+		struct {
+/* CS selector proper */
+			unsigned short cs;
+/* The stack level (SL) at the time the event occurred */
+			unsigned int sl		: 2;
+/* Set to indicate that indirect branch tracker in WAIT_FOR_ENDBRANCH state */
+			unsigned int wfe	: 1;
+			unsigned int __csx_resv1: 13;
+			unsigned int __csx_resv2: 32;
+		} __packed;
+	};
 	unsigned long flags;
 	unsigned long sp;
-	unsigned long ss;
-/* top of stack page */
+	union {
+/* SS extended: SS + any fields above it */
+		unsigned long ssx;
+		struct {
+/* SS selector proper */
+			unsigned short ss;
+/* Set to indicate that interrupt blocking by STI was in effect */
+			unsigned int sti	: 1;
+/* For SYSCALL, SYSENTER, or INT n (for any value of n) */
+			unsigned int sys	: 1;
+			unsigned int nmi	: 1;
+			unsigned int __ssx_resv1: 13;
+/* Event information fields, ignored by the FRED return instructions */
+			unsigned int vector	: 8;
+			unsigned int __ssx_resv2: 8;
+			unsigned int type	: 4;
+			unsigned int __ssx_resv3: 4;
+/* Set to indicate that the event was incident to enclave execution */
+			unsigned int enc	: 1;
+/* Set to indicate that the logical processor had been in 64-bit mode */
+			unsigned int l		: 1;
+/*
+ * Set to indicate the event is a nested exception encountered during FRED
+ * event delivery of another event. This bit is not set if the event is
+ * double fault (#DF).
+ */
+			unsigned int nst	: 1;
+			unsigned int __ssx_resv4: 1;
+/* The length of the instruction causing the event */
+			unsigned int instr_len	: 4;
+		} __packed;
+	};
+/*
+ * Top of stack page on IDT systems, while FRED systems have extra fields
+ * defined above, see <asm/fred.h>.
+ */
 };
 
 #endif /* !__i386__ */
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 3d181c16a2f6..265ab8fcb146 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -117,7 +117,7 @@ void __show_regs(struct pt_regs *regs, enum show_regs_mode mode,
 
 	printk("%sFS:  %016lx(%04x) GS:%016lx(%04x) knlGS:%016lx\n",
 	       log_lvl, fs, fsindex, gs, gsindex, shadowgs);
-	printk("%sCS:  %04lx DS: %04x ES: %04x CR0: %016lx\n",
+	printk("%sCS:  %04x DS: %04x ES: %04x CR0: %016lx\n",
 		log_lvl, regs->cs, ds, es, cr0);
 	printk("%sCR2: %016lx CR3: %016lx CR4: %016lx\n",
 		log_lvl, cr2, cr3, cr4);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:03:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:03:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572626.896465 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvj-0001Yx-JG; Mon, 31 Jul 2023 07:02:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572626.896465; Mon, 31 Jul 2023 07:02:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvj-0001Xs-EJ; Mon, 31 Jul 2023 07:02:59 +0000
Received: by outflank-mailman (input) for mailman id 572626;
 Mon, 31 Jul 2023 07:02:07 +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 <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMut-0000iu-99
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:07 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2523ab9f-2f70-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 09:02:03 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:01:51 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:01:52 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2523ab9f-2f70-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786923; x=1722322923;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=7IEqijDovSKiraXkZB5AveXiayuWDixrga5p5CTJEmM=;
  b=i9EXzr/ww56BPCr/DQJVGab5LZ8bJp/Wn0m1gguF5F8X0hhE8eX5w9BS
   dCZuuTcVLbGZyhkrTbJuSEVlRzJYNBHYvixzs/X8cuwJUDutpLVXdh2a3
   EWHikuA8PSeUNMQI7EoeaQx3/Mu3JYysITLxkITyTq3p0DP9+LL/1Ehga
   quqSTjn+N0eA9seVz/d4f4UZ54P6uSsLcPj1tqAxUK6DUTDAIMkluZ8wp
   eohEwjDXtpRfHc0+eC4GXDzp/4WB/m5HHsH7B2vLHT6tM/q8+0kLhZPb7
   t5shmpULDq3JF9f5+RDou3AHAsRkVSIAnNUvD3QxmBa18jBSuaCDIo8UL
   Q==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371648631"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371648631"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543342"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 02/36] x86/fred: Add Kconfig option for FRED (CONFIG_X86_FRED)
Date: Sun, 30 Jul 2023 23:32:43 -0700
Message-Id: <20230731063317.3720-3-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

Add the configuration option CONFIG_X86_FRED to enable FRED.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/Kconfig | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 7422db409770..700d94cb8330 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -494,6 +494,15 @@ config X86_CPU_RESCTRL
 
 	  Say N if unsure.
 
+config X86_FRED
+	bool "Flexible Return and Event Delivery"
+	depends on X86_64
+	help
+	  When enabled, try to use Flexible Return and Event Delivery
+	  instead of the legacy SYSCALL/SYSENTER/IDT architecture for
+	  ring transitions and exception/interrupt handling if the
+	  system supports.
+
 if X86_32
 config X86_BIGSMP
 	bool "Support for big SMP systems with more than 8 CPUs"
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:03:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:03:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572639.896523 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvn-0002tK-95; Mon, 31 Jul 2023 07:03:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572639.896523; Mon, 31 Jul 2023 07:03:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvm-0002pL-MC; Mon, 31 Jul 2023 07:03:02 +0000
Received: by outflank-mailman (input) for mailman id 572639;
 Mon, 31 Jul 2023 07:02:12 +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 <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMuy-0000iu-7L
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:12 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 29eee602-2f70-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 09:02:09 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:01:59 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:02:00 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 29eee602-2f70-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786929; x=1722322929;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=2rbYs2KdLMV2D8jndr60eRf402MI8mOow/QviwqPNSc=;
  b=nNlM8I/yp9KSLBodDD1PTyH9qE+LuGseHi6TLUO0EgSF7ynBulOQ980z
   hKyqnJOhlN35rV1tXbsW8zTuytbj+ZOqA64PKx5mYlSNILWMpyTEGQ5QZ
   9DYGqo/2tYMZg92aRAFtHRts8WL7TpOJSVA7OYvVLHnUfpEyhelxgEDod
   240C+kS0XixnCNdBBFO0NjU7Jgk1F8cwf46SlpIZ61638nkZYu8CZYbs6
   XXXIhvH9KFGak2xriDXAKnLCZVuesckWMPH4DzcTXvZBx8iEatGq3nFJp
   O6bZE9l7BLBkzROFJrTNyRA4IuONWmcufhg9HJnbfNP+fx4n+2YJXvTz7
   g==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371648926"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371648926"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543389"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 10/36] x86/fred: Add a new header file for FRED definitions
Date: Sun, 30 Jul 2023 23:32:51 -0700
Message-Id: <20230731063317.3720-11-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

Add a header file for FRED prototypes and definitions.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---

Changes since v6:
* Replace pt_regs csx flags prefix FRED_CSL_ with FRED_CSX_.
---
 arch/x86/include/asm/fred.h | 104 ++++++++++++++++++++++++++++++++++++
 1 file changed, 104 insertions(+)
 create mode 100644 arch/x86/include/asm/fred.h

diff --git a/arch/x86/include/asm/fred.h b/arch/x86/include/asm/fred.h
new file mode 100644
index 000000000000..d76e681a806f
--- /dev/null
+++ b/arch/x86/include/asm/fred.h
@@ -0,0 +1,104 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Macros for Flexible Return and Event Delivery (FRED)
+ */
+
+#ifndef ASM_X86_FRED_H
+#define ASM_X86_FRED_H
+
+#include <linux/const.h>
+#include <asm/asm.h>
+
+/*
+ * FRED return instructions
+ *
+ * Replace with "ERETS"/"ERETU" once binutils support FRED return instructions.
+ * The binutils version supporting FRED instructions is still TBD, and will
+ * update once we have it.
+ */
+#define ERETS			_ASM_BYTES(0xf2,0x0f,0x01,0xca)
+#define ERETU			_ASM_BYTES(0xf3,0x0f,0x01,0xca)
+
+/*
+ * RSP is aligned to a 64-byte boundary before used to push a new stack frame
+ */
+#define FRED_STACK_FRAME_RSP_MASK	_AT(unsigned long, (~0x3f))
+
+/*
+ * Event stack level macro for the FRED_STKLVLS MSR.
+ * Usage example: FRED_STKLVL(X86_TRAP_DF, 3)
+ * Multiple values can be ORd together.
+ */
+#define FRED_STKLVL(v,l)	(_AT(unsigned long, l) << (2*(v)))
+
+/* FRED_CONFIG MSR */
+#define FRED_CONFIG_CSL_MASK		0x3
+/*
+ * Used for the return address for call emulation during code patching,
+ * and measured in 64-byte cache lines.
+ */
+#define FRED_CONFIG_REDZONE_AMOUNT	1
+#define FRED_CONFIG_REDZONE		(_AT(unsigned long, FRED_CONFIG_REDZONE_AMOUNT) << 6)
+#define FRED_CONFIG_INT_STKLVL(l)	(_AT(unsigned long, l) << 9)
+#define FRED_CONFIG_ENTRYPOINT(p)	_AT(unsigned long, (p))
+
+/*
+ * FRED event type and vector bit width and counts.
+ *
+ * There is space in the stack frame making it possible to extend event type
+ * and vector fields in the future.
+ */
+#define FRED_EVENT_TYPE_BITS		3
+#define FRED_EVENT_TYPE_COUNT		_BITUL(FRED_EVENT_TYPE_BITS)
+#define FRED_EVENT_VECTOR_BITS		8
+#define FRED_EVENT_VECTOR_COUNT		_BITUL(FRED_EVENT_VECTOR_BITS)
+
+/* FRED EVENT_TYPE_OTHER vector numbers */
+#define FRED_SYSCALL			1
+#define FRED_SYSENTER			2
+#define FRED_NUM_OTHER_VECTORS		3
+
+/* Flags above the SS selector (regs->ssx) */
+#define FRED_SSX_INTERRUPT_SHADOW_BIT	16
+#define FRED_SSX_INTERRUPT_SHADOW	_BITUL(FRED_SSX_INTERRUPT_SHADOW_BIT)
+#define FRED_SSX_SOFTWARE_INITIATED_BIT	17
+#define FRED_SSX_SOFTWARE_INITIATED	_BITUL(FRED_SSX_SOFTWARE_INITIATED_BIT)
+#define FRED_SSX_NMI_BIT		18
+#define FRED_SSX_NMI			_BITUL(FRED_SSX_NMI_BIT)
+#define FRED_SSX_64_BIT_MODE_BIT	57
+#define FRED_SSX_64_BIT_MODE		_BITUL(FRED_SSX_64_BIT_MODE_BIT)
+
+#ifdef CONFIG_X86_FRED
+
+#ifndef __ASSEMBLY__
+
+#include <linux/kernel.h>
+#include <asm/ptrace.h>
+
+struct fred_info {
+	/* Event data: CR2, DR6, ... */
+	unsigned long edata;
+	unsigned long resv;
+};
+
+/* Full format of the FRED stack frame */
+struct fred_frame {
+	struct pt_regs   regs;
+	struct fred_info info;
+};
+
+static __always_inline struct fred_info *fred_info(struct pt_regs *regs)
+{
+	return &container_of(regs, struct fred_frame, regs)->info;
+}
+
+static __always_inline unsigned long fred_event_data(struct pt_regs *regs)
+{
+	return fred_info(regs)->edata;
+}
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* CONFIG_X86_FRED */
+
+#endif /* ASM_X86_FRED_H */
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:03:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:03:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572618.896427 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvh-0000rQ-Om; Mon, 31 Jul 2023 07:02:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572618.896427; Mon, 31 Jul 2023 07:02:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvh-0000rJ-Lz; Mon, 31 Jul 2023 07:02:57 +0000
Received: by outflank-mailman (input) for mailman id 572618;
 Mon, 31 Jul 2023 07:02:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMuo-0000hs-Jw
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:03 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2339fae7-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:01:59 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:01:50 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:01:50 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2339fae7-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786920; x=1722322920;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=2x+aDBKIgjBRpBNelsbYxqc0kMz8OS2Y/LweincpM90=;
  b=H1Il0QxFKmEVukGfGJlGVt+DAH8i3zSlyPJwxcakrHstDxuvynKJMpu5
   HWWtIxAuk+blTaA1RoGOB+UhkPpz/7WzFir4KcqKyvbk3QJw/Ijk7RrUa
   WlXdze1qwWMo3zokNBMEq+ZCMtTEIJ38itIdH3dSUsSHucLumjuJ5ErMR
   mi2WiUSlHVRIgPnCUSyk4C14fBLFQ8Pgc7gfNBQz8B/NpLN/mkqaVLhc2
   M4MUKstUwSQf0kThezJY9gAqgE6+U+K5OjoVc1K1S9gKwW2a/PJ34/MBW
   7d42/fkHgkyD0nyUdhl5L70Jy1SVjL45zv6rRQ+Y7hL2gn769DahB11fR
   g==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371648555"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371648555"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543329"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 00/36] x86: enable FRED for x86-64
Date: Sun, 30 Jul 2023 23:32:41 -0700
Message-Id: <20230731063317.3720-1-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This patch set enables the Intel flexible return and event delivery
(FRED) architecture for x86-64.

The FRED architecture defines simple new transitions that change
privilege level (ring transitions). The FRED architecture was
designed with the following goals:

1) Improve overall performance and response time by replacing event
   delivery through the interrupt descriptor table (IDT event
   delivery) and event return by the IRET instruction with lower
   latency transitions.

2) Improve software robustness by ensuring that event delivery
   establishes the full supervisor context and that event return
   establishes the full user context.

The new transitions defined by the FRED architecture are FRED event
delivery and, for returning from events, two FRED return instructions.
FRED event delivery can effect a transition from ring 3 to ring 0, but
it is used also to deliver events incident to ring 0. One FRED
instruction (ERETU) effects a return from ring 0 to ring 3, while the
other (ERETS) returns while remaining in ring 0. Collectively, FRED
event delivery and the FRED return instructions are FRED transitions.

Search for the latest FRED spec in most search engines with this search pattern:

  site:intel.com FRED (flexible return and event delivery) specification

As of now there is no publicly avaiable CPU supporting FRED, thus the Intel
SimicsÂ® Simulator is used as software development and testing vehicles. And
it can be downloaded from:
  https://www.intel.com/content/www/us/en/developer/articles/tool/simics-simulator.html

To enable FRED, the Simics package 8112 QSP-CPU needs to be installed with CPU
model configured as:
	$cpu_comp_class = "x86-experimental-fred"


Changes since v8:
* Move the FRED initialization patch after all required changes are in
  place (Thomas Gleixner).
* Don't do syscall early out in fred_entry_from_user() before there are
  proper performance numbers and justifications (Thomas Gleixner).
* Add the control exception handler to the FRED exception handler table
  (Thomas Gleixner).
* Introduce a macro sysvec_install() to derive the asm handler name from
  a C handler, which simplifies the code and avoids an ugly typecast
  (Thomas Gleixner).
* Remove junk code that assumes no local APIC on x86_64 (Thomas Gleixner).
* Put IDTENTRY changes in a separate patch (Thomas Gleixner).
* Use high-order 48 bits above the lowest 16 bit SS only when FRED is
  enabled (Thomas Gleixner).
* Explain why writing directly to the IA32_KERNEL_GS_BASE MSR is
  doing the right thing (Thomas Gleixner).
* Reword some patch descriptions (Thomas Gleixner).
* Add a new macro VMX_DO_FRED_EVENT_IRQOFF for FRED instead of
  refactoring VMX_DO_EVENT_IRQOFF (Sean Christopherson).
* Do NOT use a trampoline, just LEA+PUSH the return RIP, PUSH the error
  code, and jump to the FRED kernel entry point for NMI or call
  external_interrupt() for IRQs (Sean Christopherson).
* Call external_interrupt() only when FRED is enabled, and convert the
  non-FRED handling to external_interrupt() after FRED lands (Sean
  Christopherson).
* Use __packed instead of __attribute__((__packed__)) (Borislav Petkov).
* Put all comments above the members, like the rest of the file does
  (Borislav Petkov).
* Reflect the FRED spec 5.0 change that ERETS and ERETU add 8 to %rsp
  before popping the return context from the stack.
* Reflect stack frame definition changes from FRED spec 3.0 to 5.0.
* Add ENDBR to the FRED_ENTER asm macro after kernel IBT is added to
  FRED base line in FRED spec 5.0.
* Add a document which briefly introduces FRED features.
* Remove 2 patches, "allow FRED systems to use interrupt vectors
  0x10-0x1f" and "allow dynamic stack frame size", from this patch set,
  as they are "optimizations" only.
* Send 2 patches, "header file for event types" and "do not modify the
  DPL bits for a null selector", as pre-FRED patches.

Changes since v7:
* Always call external_interrupt() for VMX IRQ handling on x86_64, thus avoid
  re-entering the noinstr code.
* Create a FRED stack frame when FRED is compiled-in but not enabled, which
  uses some extra stack space but simplifies the code.
* Add a log message when FRED is enabled.

Changes since v6:
* Add a comment to explain why it is safe to write to a previous FRED stack
  frame. (Lai Jiangshan).
* Export fred_entrypoint_kernel(), required when kvm-intel built as a module.
* Reserve a REDZONE for CALL emulation and Align RSP to a 64-byte boundary
  before pushing a new FRED stack frame.
* Replace pt_regs csx flags prefix FRED_CSL_ with FRED_CSX_.

Changes since v5:
* Initialize system_interrupt_handlers with dispatch_table_spurious_interrupt()
  instead of NULL to get rid of a branch (Peter Zijlstra).
* Disallow #DB inside #MCE for robustness sake (Peter Zijlstra).
* Add a comment for FRED stack level settings (Lai Jiangshan).
* Move the NMI bit from an invalid stack frame, which caused ERETU to fault,
  to the fault handler's stack frame, thus to unblock NMI ASAP if NMI is blocked
  (Lai Jiangshan).
* Refactor VMX_DO_EVENT_IRQOFF to handle IRQ/NMI in IRQ/NMI induced VM exits
  when FRED is enabled (Sean Christopherson).

Changes since v4:
* Do NOT use the term "injection", which in the KVM context means to
  reinject an event into the guest (Sean Christopherson).
* Add the explanation of why to execute "int $2" to invoke the NMI handler
  in NMI caused VM exits (Sean Christopherson).
* Use cs/ss instead of csx/ssx when initializing the pt_regs structure
  for calling external_interrupt(), otherwise it breaks i386 build.

Changes since v3:
* Call external_interrupt() to handle IRQ in IRQ caused VM exits.
* Execute "int $2" to handle NMI in NMI caused VM exits.
* Rename csl/ssl of the pt_regs structure to csx/ssx (x for extended)
  (Andrew Cooper).

Changes since v2:
* Improve comments for changes in arch/x86/include/asm/idtentry.h.

Changes since v1:
* call irqentry_nmi_{enter,exit}() in both IDT and FRED debug fault kernel
  handler (Peter Zijlstra).
* Initialize a FRED exception handler to fred_bad_event() instead of NULL
  if no FRED handler defined for an exception vector (Peter Zijlstra).
* Push calling irqentry_{enter,exit}() and instrumentation_{begin,end}()
  down into individual FRED exception handlers, instead of in the dispatch
  framework (Peter Zijlstra).

H. Peter Anvin (Intel) (22):
  x86/fred: Add Kconfig option for FRED (CONFIG_X86_FRED)
  x86/fred: Disable FRED support if CONFIG_X86_FRED is disabled
  x86/cpufeatures: Add the cpu feature bit for FRED
  x86/opcode: Add ERETU, ERETS instructions to x86-opcode-map
  x86/objtool: Teach objtool about ERETU and ERETS
  x86/cpu: Add X86_CR4_FRED macro
  x86/cpu: Add MSR numbers for FRED configuration
  x86/fred: Make unions for the cs and ss fields in struct pt_regs
  x86/fred: Add a new header file for FRED definitions
  x86/fred: Reserve space for the FRED stack frame
  x86/fred: Update MSR_IA32_FRED_RSP0 during task switch
  x86/fred: Let ret_from_fork_asm() jmp to fred_exit_user when FRED is
    enabled
  x86/fred: Disallow the swapgs instruction when FRED is enabled
  x86/fred: No ESPFIX needed when FRED is enabled
  x86/fred: Allow single-step trap and NMI when starting a new task
  x86/fred: Add a page fault entry stub for FRED
  x86/fred: Add a debug fault entry stub for FRED
  x86/fred: Add a NMI entry stub for FRED
  x86/traps: Add a system interrupt handler table for system interrupt
    dispatch
  x86/traps: Add external_interrupt() to dispatch external interrupts
  x86/fred: FRED entry/exit and dispatch code
  x86/fred: FRED initialization code

Xin Li (14):
  Documentation/x86/64: Add documentation for FRED
  x86/fred: Define a common function type fred_handler
  x86/fred: Add a machine check entry stub for FRED
  x86/fred: Add a double fault entry stub for FRED
  x86/entry: Remove idtentry_sysvec from entry_{32,64}.S
  x86/idtentry: Incorporate definitions/declarations of the FRED
    external interrupt handler type
  x86/traps: Add sysvec_install() to install a system interrupt handler
  x86/idtentry: Incorporate declaration/definition of the FRED exception
    handler type
  x86/fred: Fixup fault on ERETU by jumping to fred_entrypoint_user
  x86/traps: Export external_interrupt() for handling IRQ in IRQ induced
    VM exits
  x86/fred: Export fred_entrypoint_kernel() for handling NMI in NMI
    induced VM exits
  KVM: VMX: Add VMX_DO_FRED_EVENT_IRQOFF for IRQ/NMI handling
  x86/syscall: Split IDT syscall setup code into idt_syscall_init()
  x86/fred: Disable FRED by default in its early stage

 .../admin-guide/kernel-parameters.txt         |   4 +
 Documentation/arch/x86/x86_64/fred.rst        | 102 ++++++++
 Documentation/arch/x86/x86_64/index.rst       |   1 +
 arch/x86/Kconfig                              |   9 +
 arch/x86/entry/Makefile                       |   5 +-
 arch/x86/entry/entry_32.S                     |   4 -
 arch/x86/entry/entry_64.S                     |  14 +-
 arch/x86/entry/entry_64_fred.S                |  58 +++++
 arch/x86/entry/entry_fred.c                   | 220 ++++++++++++++++++
 arch/x86/entry/vsyscall/vsyscall_64.c         |   2 +-
 arch/x86/include/asm/asm-prototypes.h         |   1 +
 arch/x86/include/asm/cpufeatures.h            |   1 +
 arch/x86/include/asm/disabled-features.h      |   8 +-
 arch/x86/include/asm/extable_fixup_types.h    |   4 +-
 arch/x86/include/asm/fred.h                   | 157 +++++++++++++
 arch/x86/include/asm/idtentry.h               | 115 ++++++++-
 arch/x86/include/asm/msr-index.h              |  13 +-
 arch/x86/include/asm/ptrace.h                 |  57 ++++-
 arch/x86/include/asm/switch_to.h              |  11 +-
 arch/x86/include/asm/thread_info.h            |  12 +-
 arch/x86/include/asm/traps.h                  |  23 ++
 arch/x86/include/uapi/asm/processor-flags.h   |   2 +
 arch/x86/kernel/Makefile                      |   1 +
 arch/x86/kernel/cpu/acrn.c                    |   5 +-
 arch/x86/kernel/cpu/common.c                  |  47 +++-
 arch/x86/kernel/cpu/mce/core.c                |  15 ++
 arch/x86/kernel/cpu/mshyperv.c                |  16 +-
 arch/x86/kernel/espfix_64.c                   |   8 +
 arch/x86/kernel/fred.c                        |  67 ++++++
 arch/x86/kernel/irqinit.c                     |   7 +-
 arch/x86/kernel/kvm.c                         |   2 +-
 arch/x86/kernel/nmi.c                         |  19 ++
 arch/x86/kernel/process_64.c                  |  31 ++-
 arch/x86/kernel/traps.c                       | 153 ++++++++++--
 arch/x86/kvm/vmx/vmenter.S                    |  88 +++++++
 arch/x86/kvm/vmx/vmx.c                        |  19 +-
 arch/x86/lib/x86-opcode-map.txt               |   2 +-
 arch/x86/mm/extable.c                         |  79 +++++++
 arch/x86/mm/fault.c                           |  18 +-
 drivers/xen/events/events_base.c              |   3 +-
 tools/arch/x86/include/asm/cpufeatures.h      |   1 +
 .../arch/x86/include/asm/disabled-features.h  |   8 +-
 tools/arch/x86/include/asm/msr-index.h        |  13 +-
 tools/arch/x86/lib/x86-opcode-map.txt         |   2 +-
 tools/objtool/arch/x86/decode.c               |  19 +-
 45 files changed, 1348 insertions(+), 98 deletions(-)
 create mode 100644 Documentation/arch/x86/x86_64/fred.rst
 create mode 100644 arch/x86/entry/entry_64_fred.S
 create mode 100644 arch/x86/entry/entry_fred.c
 create mode 100644 arch/x86/include/asm/fred.h
 create mode 100644 arch/x86/kernel/fred.c

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:03:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:03:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572637.896510 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvm-0002cp-93; Mon, 31 Jul 2023 07:03:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572637.896510; Mon, 31 Jul 2023 07:03:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMvl-0002YF-UF; Mon, 31 Jul 2023 07:03:01 +0000
Received: by outflank-mailman (input) for mailman id 572637;
 Mon, 31 Jul 2023 07:02:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMux-0000hs-CP
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:11 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2afbb0b8-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:10 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:02:00 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:02:01 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2afbb0b8-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786930; x=1722322930;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=+L7aUhS6u+4qwVp6754zs3SWJDqRpOJYTCoF5qb+V6E=;
  b=C2LlptRgf80TYtAaeaPIpABVxzr5TAgewX+U1unGU8T5NKX/+1644dhs
   fn6dbVXheY6oqox93+0kNCbpmNovSeGEQIdGiQBdnHPVL4dw1jw9AqGPc
   9oYW328fY7rug1nKN98c1bTrRfEneycXoepj/atJBeQ7PxQI/mfq+UEt9
   2sxnEVaxby74WzSoLy8aUJzRJpqJFx4oefCLR8yGa7BAFGCw3eAZNp6EB
   ENIWDwsvgB18avNpECDpByXQzYmK33pzFEPdhc9dnFJCNwnvWflsmRQbH
   8vyA3iXU1FOxDJmZm6bXzeG75C7qQdm/MakkKDR1Y8WA9w8rypIeIZ2w1
   A==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371648960"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371648960"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543395"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 11/36] x86/fred: Reserve space for the FRED stack frame
Date: Sun, 30 Jul 2023 23:32:52 -0700
Message-Id: <20230731063317.3720-12-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

When using FRED, reserve space at the top of the stack frame, just
like i386 does.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/include/asm/thread_info.h | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index d63b02940747..089cab875cba 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -31,7 +31,9 @@
  * In vm86 mode, the hardware frame is much longer still, so add 16
  * bytes to make room for the real-mode segments.
  *
- * x86_64 has a fixed-length stack frame.
+ * x86-64 has a fixed-length stack frame, but it depends on whether
+ * or not FRED is enabled. Future versions of FRED might make this
+ * dynamic, but for now it is always 2 words longer.
  */
 #ifdef CONFIG_X86_32
 # ifdef CONFIG_VM86
@@ -39,8 +41,12 @@
 # else
 #  define TOP_OF_KERNEL_STACK_PADDING 8
 # endif
-#else
-# define TOP_OF_KERNEL_STACK_PADDING 0
+#else /* x86-64 */
+# ifdef CONFIG_X86_FRED
+#  define TOP_OF_KERNEL_STACK_PADDING (2*8)
+# else
+#  define TOP_OF_KERNEL_STACK_PADDING 0
+# endif
 #endif
 
 /*
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:07:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:07:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572668.896588 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMzz-0001IY-PY; Mon, 31 Jul 2023 07:07:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572668.896588; Mon, 31 Jul 2023 07:07:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQMzz-0001IO-Mj; Mon, 31 Jul 2023 07:07:23 +0000
Received: by outflank-mailman (input) for mailman id 572668;
 Mon, 31 Jul 2023 07:07:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMvC-0000hs-73
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:26 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 328b9101-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:24 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:02:14 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:02:15 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 328b9101-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786945; x=1722322945;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=noUm+C4jbhw0mC8rdAqNdlrDhDQPWQ7nu1SRrIUqW1s=;
  b=cBv/7OHjJKFU7Kq/CB/VGVnpddxCZrl58ThbdfSUwjy8BkeYHbkNBQeQ
   IvGhos/4bPdQUeozBL+LNbY+XoP9xOFaNTwy4MMJGWCCE0SPrBULwCIxv
   2dxcWPD1Lb5iGqZQLIMG8ZzdXq9e2/FFbe/2jrEOunwLPyCeCo66ayNTf
   oBhYKfd63FdMhPYa08ekxJvMTy5GP1zc/URH0CCvn+NLlh01F3gMxdNek
   /FyZt617kb/nsTLT6ZKXfug57l/7vdHaauofaYRo6sVEp0sDuIIzLQnmA
   Xn420pky9NLBkchyjPLcOl8HMLpJYlMljl4BeXgP01na7vigUdyUYIRv7
   Q==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371649420"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371649420"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543485"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 24/36] x86/idtentry: Incorporate definitions/declarations of the FRED external interrupt handler type
Date: Sun, 30 Jul 2023 23:33:05 -0700
Message-Id: <20230731063317.3720-25-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

FRED operates differently from IDT in terms of interrupt handling.
Instead of directly dispatching an interrupt to its handler based
on the interrupt vector, FRED requires the software to dispatch
an event to its handler based on both the event's type and vector.
Therefore, an event dispatch framework must be implemented to
facilitate the event-to-handler dispatch process.

The FRED event dispatch framework assumes control once an event is
delivered, starting from two FRED entry points, after which several
event dispatch tables are introduced to facilitate the dispatching.
The first level dispatching is event type based, and two tables need
to be defined, one for ring 3 event dispatching, and the other for
ring 0. The second level dispatching is event vector based, and
several tables need to be defined, e.g., an exception handler table
for exception dispatching.

Handlers in these tables are typically noinstr. However for external
interrupt dispatching, irqentry_{enter,exit}() and
instrumentation_{begin,end}() can be extracted from respective interrupt
handler to the dispatch framework. As a result, FRED external interrupt
handlers don't need to be noinstr.

Incorporate definitions/declarations of FRED external interrupt handler
types into the IDT entry macros.

It is probably better to rename idtentry as event_entry.

Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---

Changes since v8:
* Put IDTENTRY changes in a separate patch (Thomas Gleixner).
---
 arch/x86/include/asm/idtentry.h | 91 +++++++++++++++++++++++++++++----
 1 file changed, 82 insertions(+), 9 deletions(-)

diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h
index 6817c0f8e323..e67d111bf932 100644
--- a/arch/x86/include/asm/idtentry.h
+++ b/arch/x86/include/asm/idtentry.h
@@ -167,17 +167,22 @@ __visible noinstr void func(struct pt_regs *regs, unsigned long error_code)
 
 /**
  * DECLARE_IDTENTRY_IRQ - Declare functions for device interrupt IDT entry
- *			  points (common/spurious)
+ *			  points (common/spurious) and their corresponding
+ *			  software based dispatch handlers in the non-noinstr
+ *			  text section
  * @vector:	Vector number (ignored for C)
  * @func:	Function name of the entry point
  *
- * Maps to DECLARE_IDTENTRY_ERRORCODE()
+ * Maps to DECLARE_IDTENTRY_ERRORCODE(), plus a dispatch function prototype
  */
 #define DECLARE_IDTENTRY_IRQ(vector, func)				\
-	DECLARE_IDTENTRY_ERRORCODE(vector, func)
+	DECLARE_IDTENTRY_ERRORCODE(vector, func);			\
+	void dispatch_##func(struct pt_regs *regs, unsigned long error_code)
 
 /**
  * DEFINE_IDTENTRY_IRQ - Emit code for device interrupt IDT entry points
+ *			 and their corresponding software based dispatch
+ *			 handlers in the non-noinstr text section
  * @func:	Function name of the entry point
  *
  * The vector number is pushed by the low level entry stub and handed
@@ -187,6 +192,11 @@ __visible noinstr void func(struct pt_regs *regs, unsigned long error_code)
  * irq_enter/exit_rcu() are invoked before the function body and the
  * KVM L1D flush request is set. Stack switching to the interrupt stack
  * has to be done in the function body if necessary.
+ *
+ * dispatch_func() is a software based dispatch handler in the non-noinstr
+ * text section, assuming the irqentry_{enter,exit}() and
+ * instrumentation_{begin,end}() helpers are invoked in the external
+ * interrupt dispatch framework before and after dispatch_func().
  */
 #define DEFINE_IDTENTRY_IRQ(func)					\
 static void __##func(struct pt_regs *regs, u32 vector);			\
@@ -204,31 +214,68 @@ __visible noinstr void func(struct pt_regs *regs,			\
 	irqentry_exit(regs, state);					\
 }									\
 									\
+__visible void dispatch_##func(struct pt_regs *regs,			\
+			       unsigned long error_code)		\
+{									\
+	u32 vector = (u32)(u8)error_code;				\
+									\
+	kvm_set_cpu_l1tf_flush_l1d();					\
+	run_irq_on_irqstack_cond(__##func, regs, vector);		\
+}									\
+									\
 static noinline void __##func(struct pt_regs *regs, u32 vector)
 
+/*
+ * Define a function type system_interrupt_handler as the element type of
+ * the table system_interrupt_handlers.
+ *
+ * System interrupt handlers don't take any interrupt vector number, or
+ * any interrupt error code as arguments, as a system interrupt handler
+ * is defined to handle a specific interrupt vector, and no error code
+ * is defined for external interrupts. It takes only one argument of type
+ * struct pt_regs *.
+ */
+#define DECLARE_SYSTEM_INTERRUPT_HANDLER(f) \
+	void f (struct pt_regs *regs)
+#define DEFINE_SYSTEM_INTERRUPT_HANDLER(f) \
+	__visible DECLARE_SYSTEM_INTERRUPT_HANDLER(f)
+typedef DECLARE_SYSTEM_INTERRUPT_HANDLER((*system_interrupt_handler));
+
 /**
  * DECLARE_IDTENTRY_SYSVEC - Declare functions for system vector entry points
+ *			     and their corresponding software based dispatch
+ *			     handlers in the non-noinstr text section
  * @vector:	Vector number (ignored for C)
  * @func:	Function name of the entry point
  *
- * Declares three functions:
+ * Declares four functions:
  * - The ASM entry point: asm_##func
  * - The XEN PV trap entry point: xen_##func (maybe unused)
  * - The C handler called from the ASM entry point
+ * - The C handler used in the system interrupt handler table
  *
- * Maps to DECLARE_IDTENTRY().
+ * Maps to DECLARE_IDTENTRY(), plus a dispatch table function prototype
  */
 #define DECLARE_IDTENTRY_SYSVEC(vector, func)				\
-	DECLARE_IDTENTRY(vector, func)
+	DECLARE_IDTENTRY(vector, func);					\
+	DECLARE_SYSTEM_INTERRUPT_HANDLER(dispatch_table_##func)
 
 /**
  * DEFINE_IDTENTRY_SYSVEC - Emit code for system vector IDT entry points
+ *			    and their corresponding software based dispatch
+ *			    handlers in the non-noinstr text section
  * @func:	Function name of the entry point
  *
  * irqentry_enter/exit() and irq_enter/exit_rcu() are invoked before the
  * function body. KVM L1D flush request is set.
  *
- * Runs the function on the interrupt stack if the entry hit kernel mode
+ * Runs the function on the interrupt stack if the entry hit kernel mode.
+ *
+ * dispatch_table_func() is used to fill the system interrupt handler table
+ * for system interrupts dispatching, assuming the irqentry_{enter,exit}()
+ * and instrumentation_{begin,end}() helpers are invoked in the external
+ * interrupt dispatch framework before and after dispatch_table_func(),
+ * thus in the non-noinstr text section.
  */
 #define DEFINE_IDTENTRY_SYSVEC(func)					\
 static void __##func(struct pt_regs *regs);				\
@@ -244,11 +291,19 @@ __visible noinstr void func(struct pt_regs *regs)			\
 	irqentry_exit(regs, state);					\
 }									\
 									\
+DEFINE_SYSTEM_INTERRUPT_HANDLER(dispatch_table_##func)			\
+{									\
+	kvm_set_cpu_l1tf_flush_l1d();					\
+	run_sysvec_on_irqstack_cond(__##func, regs);			\
+}									\
+									\
 static noinline void __##func(struct pt_regs *regs)
 
 /**
  * DEFINE_IDTENTRY_SYSVEC_SIMPLE - Emit code for simple system vector IDT
- *				   entry points
+ *				   entry points and their corresponding
+ *				   software based dispatch handlers in
+ *				   the non-noinstr text section
  * @func:	Function name of the entry point
  *
  * Runs the function on the interrupted stack. No switch to IRQ stack and
@@ -256,6 +311,12 @@ static noinline void __##func(struct pt_regs *regs)
  *
  * Only use for 'empty' vectors like reschedule IPI and KVM posted
  * interrupt vectors.
+ *
+ * dispatch_table_func() is used to fill the system interrupt handler table
+ * for system interrupts dispatching, assuming the irqentry_{enter,exit}()
+ * and instrumentation_{begin,end}() helpers are invoked in the external
+ * interrupt dispatch framework before and after dispatch_table_func(),
+ * thus in the non-noinstr text section.
  */
 #define DEFINE_IDTENTRY_SYSVEC_SIMPLE(func)				\
 static __always_inline void __##func(struct pt_regs *regs);		\
@@ -273,6 +334,14 @@ __visible noinstr void func(struct pt_regs *regs)			\
 	irqentry_exit(regs, state);					\
 }									\
 									\
+DEFINE_SYSTEM_INTERRUPT_HANDLER(dispatch_table_##func)			\
+{									\
+	__irq_enter_raw();						\
+	kvm_set_cpu_l1tf_flush_l1d();					\
+	__##func (regs);						\
+	__irq_exit_raw();						\
+}									\
+									\
 static __always_inline void __##func(struct pt_regs *regs)
 
 /**
@@ -647,7 +716,11 @@ DECLARE_IDTENTRY_SYSVEC(X86_PLATFORM_IPI_VECTOR,	sysvec_x86_platform_ipi);
 #endif
 
 #ifdef CONFIG_SMP
-DECLARE_IDTENTRY(RESCHEDULE_VECTOR,			sysvec_reschedule_ipi);
+/*
+ * Use DECLARE_IDTENTRY_SYSVEC instead of DECLARE_IDTENTRY to add a
+ * software based dispatch handler declaration for RESCHEDULE_VECTOR.
+ */
+DECLARE_IDTENTRY_SYSVEC(RESCHEDULE_VECTOR,		sysvec_reschedule_ipi);
 DECLARE_IDTENTRY_SYSVEC(REBOOT_VECTOR,			sysvec_reboot);
 DECLARE_IDTENTRY_SYSVEC(CALL_FUNCTION_SINGLE_VECTOR,	sysvec_call_function_single);
 DECLARE_IDTENTRY_SYSVEC(CALL_FUNCTION_VECTOR,		sysvec_call_function);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:07:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:07:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572669.896598 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN05-0001dI-2f; Mon, 31 Jul 2023 07:07:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572669.896598; Mon, 31 Jul 2023 07:07:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN04-0001d9-VR; Mon, 31 Jul 2023 07:07:28 +0000
Received: by outflank-mailman (input) for mailman id 572669;
 Mon, 31 Jul 2023 07:07:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMuz-0000hs-OQ
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:13 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2c88b50d-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:13 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:02:02 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:02:03 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2c88b50d-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786933; x=1722322933;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=90z+Db4H8sAaozlh1y54siqgX9Yc5fCU6uoHEAi25BE=;
  b=Yt432rnxpy8TOR61lGbmb13wtz5C9VNcbYjMNN9MXsbb/U4fNVf3QCsi
   3KaDEoXj3zgIM0xzlh7WTm4+rYRL3ABlIAWPVPKlezAX7Xh6kIhX3xl1q
   /0RxOwB79gTfIw1tIXP6kRl/13IYQroixMOoRG9mHUSAk+opTEeKJ1GNh
   km8EiPhEgL7MVuPN1DecItTNSg91A/ItXzr5AZF98cDjO91KXx4q4Vho8
   oGSNiBfxk+7lzjvXB4EaOiwOhXFBkrHEVOcIP/t+ywTR5SKB+jpOL47JS
   IBEHMUuPXyooDoE2POYMs96mKt/jA2t6MaFi9aUuUi9JGEwoE//PzvKSj
   g==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371649032"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371649032"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543416"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 13/36] x86/fred: Let ret_from_fork_asm() jmp to fred_exit_user when FRED is enabled
Date: Sun, 30 Jul 2023 23:32:54 -0700
Message-Id: <20230731063317.3720-14-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

Let ret_from_fork_asm() jmp to fred_exit_user when FRED is enabled,
otherwise the existing IDT code is chosen.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/entry/entry_64.S | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index 43606de22511..8069151176f2 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -309,7 +309,13 @@ SYM_CODE_START(ret_from_fork_asm)
 	 * and unwind should work normally.
 	 */
 	UNWIND_HINT_REGS
+
+#ifdef CONFIG_X86_FRED
+	ALTERNATIVE "jmp swapgs_restore_regs_and_return_to_usermode", \
+		    "jmp fred_exit_user", X86_FEATURE_FRED
+#else
 	jmp	swapgs_restore_regs_and_return_to_usermode
+#endif
 SYM_CODE_END(ret_from_fork_asm)
 .popsection
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:07:30 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:07:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572670.896609 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN06-0001uH-F3; Mon, 31 Jul 2023 07:07:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572670.896609; Mon, 31 Jul 2023 07:07:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN06-0001u4-8g; Mon, 31 Jul 2023 07:07:30 +0000
Received: by outflank-mailman (input) for mailman id 572670;
 Mon, 31 Jul 2023 07:07:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMv2-0000hs-Io
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:16 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2e47e567-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:15 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:02:04 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:02:05 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2e47e567-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786935; x=1722322935;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=YTgEgmA3f1uzY8PacyZ6XmpZcGIgDW5/dB0vDrivilc=;
  b=fnppCNQlR8OFiIsXmxCPcLsvBqp/aiHqB5+XNK4UjDRsFJdcVecVBV8S
   lJ4wW293gtb5RnIyZa4CjPTRxmu9XN0M3djYCvrU9d3nKRcd2GJAYrgiA
   K5OyaPyG0TrymSos449pgtkV7r9WMLtRMkGD6zeURTLpb90DA7YhdNoTx
   SJThy+Bi3L/XhuAB0FHbYZLUz9NGt+ME7Podi/bNSW6nxXPn5y+EIeYR6
   OVLgqBA3axyFB1N8NdYEsVxWqme5wfR2MzbDNTRnCjfP2Ht2oK4jgLdcI
   Dmz/Z5B+z3dV785uJc4h1GPXLXtRC0RIA0GdDHPJfns1w3z9jW4UEJ7bQ
   g==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371649101"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371649101"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543430"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 15/36] x86/fred: No ESPFIX needed when FRED is enabled
Date: Sun, 30 Jul 2023 23:32:56 -0700
Message-Id: <20230731063317.3720-16-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

Because FRED always restores the full value of %rsp, ESPFIX is
no longer needed when it's enabled.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/kernel/espfix_64.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/x86/kernel/espfix_64.c b/arch/x86/kernel/espfix_64.c
index 16f9814c9be0..48d133a54f45 100644
--- a/arch/x86/kernel/espfix_64.c
+++ b/arch/x86/kernel/espfix_64.c
@@ -106,6 +106,10 @@ void __init init_espfix_bsp(void)
 	pgd_t *pgd;
 	p4d_t *p4d;
 
+	/* FRED systems don't need ESPFIX */
+	if (cpu_feature_enabled(X86_FEATURE_FRED))
+		return;
+
 	/* Install the espfix pud into the kernel page directory */
 	pgd = &init_top_pgt[pgd_index(ESPFIX_BASE_ADDR)];
 	p4d = p4d_alloc(&init_mm, pgd, ESPFIX_BASE_ADDR);
@@ -129,6 +133,10 @@ void init_espfix_ap(int cpu)
 	void *stack_page;
 	pteval_t ptemask;
 
+	/* FRED systems don't need ESPFIX */
+	if (cpu_feature_enabled(X86_FEATURE_FRED))
+		return;
+
 	/* We only have to do this once... */
 	if (likely(per_cpu(espfix_stack, cpu)))
 		return;		/* Already initialized */
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:07:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:07:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572671.896618 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN0A-0002I5-ND; Mon, 31 Jul 2023 07:07:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572671.896618; Mon, 31 Jul 2023 07:07:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN0A-0002Hq-Ii; Mon, 31 Jul 2023 07:07:34 +0000
Received: by outflank-mailman (input) for mailman id 572671;
 Mon, 31 Jul 2023 07:07:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMv6-0000hs-64
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:20 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 30586d41-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:19 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:02:09 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:02:10 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 30586d41-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786939; x=1722322939;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=j/3qauZAla4FAGFWojUuQZ7eYbLWgN4OkDYWsZA4A8I=;
  b=fBYEix+iwf/3ks31bPkno+9oUw2nPkL31g10qYWhN0qfCldiDvgLl451
   Rt42jXwen5cY4BaN6SfcY7SVNmupdBjSfNRkocTHDwyXf1f7nnnRVEFV0
   l+vHSPjDM0U9zhvRR/AXuV+CuN/vp2WmrzpJ/cKH8WBA7r6cmH6uBoqOz
   jLkO4kPr0ZEJN+3KoUmQXw+PCQdmM8r7prRHzQ8uNoyVr8a+ZkpRDEO7i
   zRNZewh00SZjtBNKg7vvB29yiFZpqHMUOKQc4dAhgw7XWdg+Q+vHBlDj1
   L1NOqtnOl1hWhYz00fiPzCQv6AwSaxiKOoH1m5+rXkmA0RNfdShIkd1FJ
   g==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371649241"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371649241"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543456"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 19/36] x86/fred: Add a debug fault entry stub for FRED
Date: Sun, 30 Jul 2023 23:33:00 -0700
Message-Id: <20230731063317.3720-20-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

Add a debug fault entry stub for FRED.

On a FRED system, the debug trap status information (DR6) is passed
on the stack, to avoid the problem of transient state. Furthermore,
FRED transitions avoid a lot of ugly corner cases the handling of which
can, and should be, skipped.

The FRED debug trap status information saved on the stack differs from DR6
in both stickiness and polarity; it is exactly what debug_read_clear_dr6()
returns, and exc_debug_user()/exc_debug_kernel() expect.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---

Changes since v1:
* call irqentry_nmi_{enter,exit}() in both IDT and FRED debug fault kernel
  handler (Peter Zijlstra).
---
 arch/x86/include/asm/fred.h |  1 +
 arch/x86/kernel/traps.c     | 56 +++++++++++++++++++++++++++----------
 2 files changed, 42 insertions(+), 15 deletions(-)

diff --git a/arch/x86/include/asm/fred.h b/arch/x86/include/asm/fred.h
index fb8e7b4f2d38..ad7b79130b1e 100644
--- a/arch/x86/include/asm/fred.h
+++ b/arch/x86/include/asm/fred.h
@@ -112,6 +112,7 @@ static __always_inline unsigned long fred_event_data(struct pt_regs *regs)
 
 typedef DECLARE_FRED_HANDLER((*fred_handler));
 
+DECLARE_FRED_HANDLER(fred_exc_debug);
 DECLARE_FRED_HANDLER(fred_exc_page_fault);
 
 #endif /* __ASSEMBLY__ */
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 4a817d20ce3b..b10464966a81 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -47,6 +47,7 @@
 #include <asm/debugreg.h>
 #include <asm/realmode.h>
 #include <asm/text-patching.h>
+#include <asm/fred.h>
 #include <asm/ftrace.h>
 #include <asm/traps.h>
 #include <asm/desc.h>
@@ -1021,21 +1022,9 @@ static bool notify_debug(struct pt_regs *regs, unsigned long *dr6)
 	return false;
 }
 
-static __always_inline void exc_debug_kernel(struct pt_regs *regs,
-					     unsigned long dr6)
+static __always_inline void debug_kernel_common(struct pt_regs *regs,
+						unsigned long dr6)
 {
-	/*
-	 * Disable breakpoints during exception handling; recursive exceptions
-	 * are exceedingly 'fun'.
-	 *
-	 * Since this function is NOKPROBE, and that also applies to
-	 * HW_BREAKPOINT_X, we can't hit a breakpoint before this (XXX except a
-	 * HW_BREAKPOINT_W on our stack)
-	 *
-	 * Entry text is excluded for HW_BP_X and cpu_entry_area, which
-	 * includes the entry stack is excluded for everything.
-	 */
-	unsigned long dr7 = local_db_save();
 	irqentry_state_t irq_state = irqentry_nmi_enter(regs);
 	instrumentation_begin();
 
@@ -1063,7 +1052,8 @@ static __always_inline void exc_debug_kernel(struct pt_regs *regs,
 	 * Catch SYSENTER with TF set and clear DR_STEP. If this hit a
 	 * watchpoint at the same time then that will still be handled.
 	 */
-	if ((dr6 & DR_STEP) && is_sysenter_singlestep(regs))
+	if (!cpu_feature_enabled(X86_FEATURE_FRED) &&
+	    (dr6 & DR_STEP) && is_sysenter_singlestep(regs))
 		dr6 &= ~DR_STEP;
 
 	/*
@@ -1091,7 +1081,25 @@ static __always_inline void exc_debug_kernel(struct pt_regs *regs,
 out:
 	instrumentation_end();
 	irqentry_nmi_exit(regs, irq_state);
+}
 
+static __always_inline void exc_debug_kernel(struct pt_regs *regs,
+					     unsigned long dr6)
+{
+	/*
+	 * Disable breakpoints during exception handling; recursive exceptions
+	 * are exceedingly 'fun'.
+	 *
+	 * Since this function is NOKPROBE, and that also applies to
+	 * HW_BREAKPOINT_X, we can't hit a breakpoint before this (XXX except a
+	 * HW_BREAKPOINT_W on our stack)
+	 *
+	 * Entry text is excluded for HW_BP_X and cpu_entry_area, which
+	 * includes the entry stack is excluded for everything.
+	 */
+	unsigned long dr7 = local_db_save();
+
+	debug_kernel_common(regs, dr6);
 	local_db_restore(dr7);
 }
 
@@ -1180,6 +1188,24 @@ DEFINE_IDTENTRY_DEBUG_USER(exc_debug)
 {
 	exc_debug_user(regs, debug_read_clear_dr6());
 }
+
+# ifdef CONFIG_X86_FRED
+DEFINE_FRED_HANDLER(fred_exc_debug)
+{
+	/*
+	 * The FRED debug information saved onto stack differs from
+	 * DR6 in both stickiness and polarity; it is exactly what
+	 * debug_read_clear_dr6() returns.
+	 */
+	unsigned long dr6 = fred_event_data(regs);
+
+	if (user_mode(regs))
+		exc_debug_user(regs, dr6);
+	else
+		debug_kernel_common(regs, dr6);
+}
+# endif /* CONFIG_X86_FRED */
+
 #else
 /* 32 bit does not have separate entry points. */
 DEFINE_IDTENTRY_RAW(exc_debug)
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:07:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:07:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572672.896623 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN0B-0002Lf-4H; Mon, 31 Jul 2023 07:07:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572672.896623; Mon, 31 Jul 2023 07:07:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN0A-0002Ke-T6; Mon, 31 Jul 2023 07:07:34 +0000
Received: by outflank-mailman (input) for mailman id 572672;
 Mon, 31 Jul 2023 07:07:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMvD-0000hs-FS
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:27 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 34c29131-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:26 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:02:15 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:02:16 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 34c29131-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786946; x=1722322946;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=X4MZTo9+yUn1bPdeMYVQLWvNe1DyIq6KwUj9R7l5YRg=;
  b=N5Si3Ws1VMbXxHI8QgjvDAHm4N2jojeHgT97Lr0u2scFwWbCKU5mLzeq
   oZuefwZ6NzXukcm8AkWX/AfrhtgdlyTgIqQUGPS0kSkH+6teyttLdrqz+
   wwhNhlcQuSgPXM4Ve/92j1QElbfHc1pN9GrI1hwnzpZOnlFREBmSsi3cA
   304cqtRWWGZgbJoz774RqtrZqPxpu9bgzI7z4C4SNLU3eFKFcdLkGXJiA
   YdbRL2ntJVk8SIW18LwKz7n36PwRXMqP6X7ftnKOfJo3QJpcKDSz+j0Q0
   ZMFkuajhB9VFENUcTNUEtvvG0FNPj4Ga8IN1iTzA2nda1h95kYNYVnmeX
   A==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371649455"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371649455"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543489"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 25/36] x86/traps: Add a system interrupt handler table for system interrupt dispatch
Date: Sun, 30 Jul 2023 23:33:06 -0700
Message-Id: <20230731063317.3720-26-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

On x86, external interrupts can be categorized into two groups:
  1) System interrupts
  2) External device interrupts

All external device interrupts are directed to the common_interrupt(),
which, in turn, dispatches these external device interrupts using a
per-CPU external device interrupt dispatch table vector_irq.

To handle system interrupts, a system interrupt handler table needs to
be introduced. This table enables the direct dispatching of a system
interrupt to its corresponding handler. As a result, a software-based
dispatch function will be implemented as:

  void external_interrupt(struct pt_regs *regs)
  {
    u8 vector = regs->vector;
    if (is_system_interrupt(vector))
      system_interrupt_handlers[vector_to_sysvec(vector)](regs);
    else /* external device interrupt */
      common_interrupt(regs);
  }

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Co-developed-by: Xin Li <xin3.li@intel.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---

Changes since v8:
* Remove junk code that assumes no local APIC on x86_64 (Thomas Gleixner).

Changes since v5:
* Initialize system_interrupt_handlers with dispatch_table_spurious_interrupt()
  instead of NULL to get rid of any NULL check (Peter Zijlstra).
---
 arch/x86/kernel/traps.c | 50 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 49dd92458eb0..e430a8c47931 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -1488,6 +1488,56 @@ DEFINE_IDTENTRY_SW(iret_error)
 }
 #endif
 
+#ifdef CONFIG_X86_64
+
+static void dispatch_table_spurious_interrupt(struct pt_regs *regs)
+{
+	dispatch_spurious_interrupt(regs, regs->vector);
+}
+
+#define SYSV(x,y) [(x) - FIRST_SYSTEM_VECTOR] = y
+
+static system_interrupt_handler system_interrupt_handlers[NR_SYSTEM_VECTORS] = {
+	[0 ... NR_SYSTEM_VECTORS-1]		= dispatch_table_spurious_interrupt,
+#ifdef CONFIG_SMP
+	SYSV(RESCHEDULE_VECTOR,			dispatch_table_sysvec_reschedule_ipi),
+	SYSV(CALL_FUNCTION_VECTOR,		dispatch_table_sysvec_call_function),
+	SYSV(CALL_FUNCTION_SINGLE_VECTOR,	dispatch_table_sysvec_call_function_single),
+	SYSV(REBOOT_VECTOR,			dispatch_table_sysvec_reboot),
+#endif
+
+#ifdef CONFIG_X86_THERMAL_VECTOR
+	SYSV(THERMAL_APIC_VECTOR,		dispatch_table_sysvec_thermal),
+#endif
+
+#ifdef CONFIG_X86_MCE_THRESHOLD
+	SYSV(THRESHOLD_APIC_VECTOR,		dispatch_table_sysvec_threshold),
+#endif
+
+#ifdef CONFIG_X86_MCE_AMD
+	SYSV(DEFERRED_ERROR_VECTOR,		dispatch_table_sysvec_deferred_error),
+#endif
+
+#ifdef CONFIG_X86_LOCAL_APIC
+	SYSV(LOCAL_TIMER_VECTOR,		dispatch_table_sysvec_apic_timer_interrupt),
+	SYSV(X86_PLATFORM_IPI_VECTOR,		dispatch_table_sysvec_x86_platform_ipi),
+# ifdef CONFIG_HAVE_KVM
+	SYSV(POSTED_INTR_VECTOR,		dispatch_table_sysvec_kvm_posted_intr_ipi),
+	SYSV(POSTED_INTR_WAKEUP_VECTOR,		dispatch_table_sysvec_kvm_posted_intr_wakeup_ipi),
+	SYSV(POSTED_INTR_NESTED_VECTOR,		dispatch_table_sysvec_kvm_posted_intr_nested_ipi),
+# endif
+# ifdef CONFIG_IRQ_WORK
+	SYSV(IRQ_WORK_VECTOR,			dispatch_table_sysvec_irq_work),
+# endif
+	SYSV(SPURIOUS_APIC_VECTOR,		dispatch_table_sysvec_spurious_apic_interrupt),
+	SYSV(ERROR_APIC_VECTOR,			dispatch_table_sysvec_error_interrupt),
+#endif
+};
+
+#undef SYSV
+
+#endif /* CONFIG_X86_64 */
+
 void __init trap_init(void)
 {
 	/* Init cpu_entry_area before IST entries are set up */
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:07:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:07:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572673.896630 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN0B-0002U2-Jo; Mon, 31 Jul 2023 07:07:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572673.896630; Mon, 31 Jul 2023 07:07:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN0B-0002RS-9T; Mon, 31 Jul 2023 07:07:35 +0000
Received: by outflank-mailman (input) for mailman id 572673;
 Mon, 31 Jul 2023 07:07:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMuy-0000hs-EH
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:12 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2ab1fe57-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:11 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:02:01 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:02:02 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2ab1fe57-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786931; x=1722322931;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=lZsnH9xZ+sSI0HJfWdXFi2jVveN7fME2POBe5mQbKKE=;
  b=i9tOlYs85Zi+Qcjn3PjuN1ImJWxeLfXI7hh6rY7Bx8dGDdpzPuY/UBYp
   BiGf97DmswARirXPyVxkIRnbQKAzLP+sG1lsQYIgOx/2ZX4EqPlP/bexN
   P8IhVHDCz4URZlPZLmDJ1hA1bwRgjQYPAW4hzyQsaSLMDh59E8b54GJ7l
   2ym7Okwlby8XYQHvlRub1XVfKfGQfVV7nJCS8OX2kmOkC+5TudiK/sjj/
   7RGLGd07rEjmYyoY0dDVzMuVUAADuaeuohPuD4GCyrYDmrX0Ugm7uHYIN
   UJeLWlVOqZTPT17x+g4SVsjcXrRVa+O1s83G3ixErexV9paJSuUCNYIAP
   A==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371648996"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371648996"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543400"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 12/36] x86/fred: Update MSR_IA32_FRED_RSP0 during task switch
Date: Sun, 30 Jul 2023 23:32:53 -0700
Message-Id: <20230731063317.3720-13-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

MSR_IA32_FRED_RSP0 is used during ring 3 event delivery, and needs to
be updated to point to the top of next task stack during task switch.

Update MSR_IA32_FRED_RSP0 with WRMSR instruction for now, and will use
WRMSRNS/WRMSRLIST for performance once it gets upstreamed.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/include/asm/switch_to.h | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/switch_to.h b/arch/x86/include/asm/switch_to.h
index f42dbf17f52b..6c911fd400b2 100644
--- a/arch/x86/include/asm/switch_to.h
+++ b/arch/x86/include/asm/switch_to.h
@@ -70,9 +70,16 @@ static inline void update_task_stack(struct task_struct *task)
 #ifdef CONFIG_X86_32
 	this_cpu_write(cpu_tss_rw.x86_tss.sp1, task->thread.sp0);
 #else
-	/* Xen PV enters the kernel on the thread stack. */
-	if (cpu_feature_enabled(X86_FEATURE_XENPV))
+	if (cpu_feature_enabled(X86_FEATURE_FRED)) {
+		/*
+		 * Will use WRMSRNS/WRMSRLIST for performance once it's upstreamed.
+		 */
+		wrmsrl(MSR_IA32_FRED_RSP0,
+		       (unsigned long)task_stack_page(task) + THREAD_SIZE);
+	} else if (cpu_feature_enabled(X86_FEATURE_XENPV)) {
+		/* Xen PV enters the kernel on the thread stack. */
 		load_sp0(task_top_of_stack(task));
+	}
 #endif
 }
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:07:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:07:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572675.896648 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN0G-0003KL-32; Mon, 31 Jul 2023 07:07:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572675.896648; Mon, 31 Jul 2023 07:07:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN0F-0003KA-UK; Mon, 31 Jul 2023 07:07:39 +0000
Received: by outflank-mailman (input) for mailman id 572675;
 Mon, 31 Jul 2023 07:07:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMvA-0000hs-Rf
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:24 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3338abd2-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:24 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:02:13 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:02:14 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3338abd2-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786944; x=1722322944;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=e41GdB5DEWVT44n/+24ZLrn6jlcg49oHxwygKL8Pbqk=;
  b=Y0eez2dKjzOOW7ugu3A5WYuDtc3xvMVTZA3U9PRRJCt3FRXotNnPQYLC
   0ZUFU6RRNFJTK7x7fk0rBTaESMgs4X13cXlNvSYLNAylAyTxaYiFjQCL+
   BJaWAfpGn9XW/jWUj4IXN8/pP9vcvHiL5FCHSwjD0+ixvpQeC9DniUrza
   kiKRaGKltAQuwHm/iHpbIwm7l+tN7dn6IKPNppXJFTbIgyf1g86QJCsSo
   gEjsST2o0afaduX94B5xvn/mJPREY5EL7ouAKTYWn/8uzoPaHGcVivUze
   tBs/qQs3TQyl2vZgk+oAKWzBu57s27SseJI5wogKrKfvM2ZsC+ab0LhcF
   g==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371649386"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371649386"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543481"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 23/36] x86/entry: Remove idtentry_sysvec from entry_{32,64}.S
Date: Sun, 30 Jul 2023 23:33:04 -0700
Message-Id: <20230731063317.3720-24-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

idtentry_sysvec is really just DECLARE_IDTENTRY defined in
<asm/idtentry.h>, no need to define it separately.

Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/entry/entry_32.S       | 4 ----
 arch/x86/entry/entry_64.S       | 8 --------
 arch/x86/include/asm/idtentry.h | 2 +-
 3 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
index 6e6af42e044a..e0f22ad8ff7e 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -649,10 +649,6 @@ SYM_CODE_START_LOCAL(asm_\cfunc)
 SYM_CODE_END(asm_\cfunc)
 .endm
 
-.macro idtentry_sysvec vector cfunc
-	idtentry \vector asm_\cfunc \cfunc has_error_code=0
-.endm
-
 /*
  * Include the defines which emit the idt entries which are shared
  * shared between 32 and 64 bit and emit the __irqentry_text_* markers
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index 8069151176f2..44f14b990597 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -438,14 +438,6 @@ SYM_CODE_END(\asmsym)
 	idtentry \vector asm_\cfunc \cfunc has_error_code=1
 .endm
 
-/*
- * System vectors which invoke their handlers directly and are not
- * going through the regular common device interrupt handling code.
- */
-.macro idtentry_sysvec vector cfunc
-	idtentry \vector asm_\cfunc \cfunc has_error_code=0
-.endm
-
 /**
  * idtentry_mce_db - Macro to generate entry stubs for #MC and #DB
  * @vector:		Vector number
diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h
index cd5c10a74071..6817c0f8e323 100644
--- a/arch/x86/include/asm/idtentry.h
+++ b/arch/x86/include/asm/idtentry.h
@@ -447,7 +447,7 @@ __visible noinstr void func(struct pt_regs *regs,			\
 
 /* System vector entries */
 #define DECLARE_IDTENTRY_SYSVEC(vector, func)				\
-	idtentry_sysvec vector func
+	DECLARE_IDTENTRY(vector, func)
 
 #ifdef CONFIG_X86_64
 # define DECLARE_IDTENTRY_MCE(vector, func)				\
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:07:50 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:07:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572680.896658 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN0Q-0004W1-E1; Mon, 31 Jul 2023 07:07:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572680.896658; Mon, 31 Jul 2023 07:07:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN0Q-0004Vt-B3; Mon, 31 Jul 2023 07:07:50 +0000
Received: by outflank-mailman (input) for mailman id 572680;
 Mon, 31 Jul 2023 07:07:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMv1-0000hs-B2
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:15 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2d8364a7-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:14 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:02:03 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:02:04 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2d8364a7-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786934; x=1722322934;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=sycVsd87zmfA3yJCdcgOgrxd4mm6nSq5VT1UdIRGngQ=;
  b=ezfaFIjsoAjRlZeP5ypMnjJEjXCe45dxgAgZ0oIizMTfTKHPYroBeVKW
   sZIp4OrCMHILpMcY1s4UUd0LHsqps1y8Ruif7U86H85g7aVePo0PE3qeO
   YoKqGWTcb1ddawS/IUe53j4AS1g17zeu56qKDiYyl32HkERak2BINu4Ro
   viylJPuG9lzsNkG37OcVSOJCcsIeJogVJ8iMNCvHWXLVubIxSZBlRBoQX
   5DUF/hwKJXeCLPPMgNOqMbY5XmNOpiALvRrcSCKtgpYiGBNijU5OYU44M
   7BOCa1MB7BXbmoi7I8lFb1QeVX1vkokNe2y3yNB6MiZZ3ibJfeWm1AUll
   Q==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371649065"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371649065"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543425"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 14/36] x86/fred: Disallow the swapgs instruction when FRED is enabled
Date: Sun, 30 Jul 2023 23:32:55 -0700
Message-Id: <20230731063317.3720-15-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

The FRED architecture establishes the full supervisor/user through:
1) FRED event delivery from ring 3 swaps the value of the GS base
   address and that of the IA32_KERNEL_GS_BASE MSR.
2) ERETU swaps the value of the GS base address and that of the
   IA32_KERNEL_GS_BASE MSR.
3) LKGS is already upstreamed and automatically enabled with FRED to
   load the GS base address directly into the IA32_KERNEL_GS_BASE MSR
   instead of the GS segmentâ€™s descriptor cache.

As a result, there is no need to SWAPGS away from the kernel GS base,
i.e., the swapgs instruction is no longer needed when FRED is enabled,
thus is disallowed. Otherwise it causes #UD.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---

Changes since v8:
* Explain why writing directly to the IA32_KERNEL_GS_BASE MSR is
  doing the right thing (Thomas Gleixner).
---
 arch/x86/kernel/process_64.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 265ab8fcb146..6d5fed29f552 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -166,7 +166,8 @@ static noinstr unsigned long __rdgsbase_inactive(void)
 
 	lockdep_assert_irqs_disabled();
 
-	if (!cpu_feature_enabled(X86_FEATURE_XENPV)) {
+	if (!cpu_feature_enabled(X86_FEATURE_FRED) &&
+	    !cpu_feature_enabled(X86_FEATURE_XENPV)) {
 		native_swapgs();
 		gsbase = rdgsbase();
 		native_swapgs();
@@ -191,7 +192,8 @@ static noinstr void __wrgsbase_inactive(unsigned long gsbase)
 {
 	lockdep_assert_irqs_disabled();
 
-	if (!cpu_feature_enabled(X86_FEATURE_XENPV)) {
+	if (!cpu_feature_enabled(X86_FEATURE_FRED) &&
+	    !cpu_feature_enabled(X86_FEATURE_XENPV)) {
 		native_swapgs();
 		wrgsbase(gsbase);
 		native_swapgs();
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:07:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:07:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572686.896668 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN0U-00056k-UI; Mon, 31 Jul 2023 07:07:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572686.896668; Mon, 31 Jul 2023 07:07:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN0U-00056T-R9; Mon, 31 Jul 2023 07:07:54 +0000
Received: by outflank-mailman (input) for mailman id 572686;
 Mon, 31 Jul 2023 07:07:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMv9-0000hs-J1
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:23 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 31a357b3-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:22 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:02:11 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:02:12 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 31a357b3-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786942; x=1722322942;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=dQPbDjEqQWsCazdenr4wm1/cp/YJX7zOnAx3X5niG4Q=;
  b=BiyLKgnzmGgaii2j2tnzTHQ7wjZGhw/aOhWEE86YWroNQNDOe9I3EKQp
   W6Zq15e0ReQZcRPjRslHBSSA8nygh8NmfV25/jwoCcHiKW5RNmYN167y4
   WkhXDHLbbihGnhxi7X4NiwGVQ4V75FIDEXyMjZWIzNIgz0ojV+Gf1wETe
   k8AhdJNy6HR3fjUJ2HegcPvgrx1yKzUxEPMnZWCaAe9FCAq012OyzBYVQ
   zt2dwBsws6HNwWbdVU4XyEwU+hVqNrbYzlKAli2bQEvPRoM0Zi7MLrZwU
   F0a+JyPEULRvlU+Un+xU7kpRWAgmuzh9Lnit2mssOYww13RuVYhFLnond
   Q==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371649311"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371649311"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543470"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 21/36] x86/fred: Add a machine check entry stub for FRED
Date: Sun, 30 Jul 2023 23:33:02 -0700
Message-Id: <20230731063317.3720-22-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add a machine check entry stub for FRED.

Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---

Changes since v5:
* Disallow #DB inside #MCE for robustness sake (Peter Zijlstra).
---
 arch/x86/include/asm/fred.h    |  1 +
 arch/x86/kernel/cpu/mce/core.c | 15 +++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/arch/x86/include/asm/fred.h b/arch/x86/include/asm/fred.h
index 2a7c47dfd733..f559dd9dc4f2 100644
--- a/arch/x86/include/asm/fred.h
+++ b/arch/x86/include/asm/fred.h
@@ -115,6 +115,7 @@ typedef DECLARE_FRED_HANDLER((*fred_handler));
 DECLARE_FRED_HANDLER(fred_exc_nmi);
 DECLARE_FRED_HANDLER(fred_exc_debug);
 DECLARE_FRED_HANDLER(fred_exc_page_fault);
+DECLARE_FRED_HANDLER(fred_exc_machine_check);
 
 #endif /* __ASSEMBLY__ */
 
diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index b8ad5a5b4026..98456e20f155 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -52,6 +52,7 @@
 #include <asm/mce.h>
 #include <asm/msr.h>
 #include <asm/reboot.h>
+#include <asm/fred.h>
 
 #include "internal.h"
 
@@ -2118,6 +2119,20 @@ DEFINE_IDTENTRY_MCE_USER(exc_machine_check)
 	exc_machine_check_user(regs);
 	local_db_restore(dr7);
 }
+
+#ifdef CONFIG_X86_FRED
+DEFINE_FRED_HANDLER(fred_exc_machine_check)
+{
+	unsigned long dr7;
+
+	dr7 = local_db_save();
+	if (user_mode(regs))
+		exc_machine_check_user(regs);
+	else
+		exc_machine_check_kernel(regs);
+	local_db_restore(dr7);
+}
+#endif
 #else
 /* 32bit unified entry point */
 DEFINE_IDTENTRY_RAW(exc_machine_check)
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:07:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:07:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572687.896678 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN0X-0005UY-7J; Mon, 31 Jul 2023 07:07:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572687.896678; Mon, 31 Jul 2023 07:07:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN0X-0005UG-3e; Mon, 31 Jul 2023 07:07:57 +0000
Received: by outflank-mailman (input) for mailman id 572687;
 Mon, 31 Jul 2023 07:07:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQMv4-0000hs-Db
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:02:18 +0000
Received: from mgamail.intel.com (unknown [134.134.136.24])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2f4ac32f-2f70-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:02:17 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:02:07 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2023 00:02:07 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2f4ac32f-2f70-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690786937; x=1722322937;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=1h9fTPNcW28O8bu/nclSFH4GxPR5CW0Rl9/PbASKNuY=;
  b=iF6eXrfrOnoSm19j9AZjAPSyHUnFeiB/czSt48vp9UlmImF8ID+G6TsU
   dUP2nUs2eatyVRuhInmPTuTgY6UOVwNHm0OjW+kDV4/esPNOdfdhqwFjj
   lTtL1SpIuYVoVctsagsOgFvVDCd4gWUMGmzGHOVEtbspB91eIcw2ciVTm
   Xlzj9dJfpkOmeeRPEGHDaGM52MbcBOse+aAq+I2b0wt3Kl98tv0FjeONp
   vU/3fv+if1piUIVPljaQovfVv91vroviHnEaHVQsprvmF0KdiOBGC8QfZ
   HokLzzTU4tHznCSDXCOiqTs4pGD7Tcqeog6lFsgOokAhRoJUhVs9vPMjz
   A==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="371649175"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="371649175"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; 
   d="scan'208";a="871543443"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 17/36] x86/fred: Define a common function type fred_handler
Date: Sun, 30 Jul 2023 23:32:58 -0700
Message-Id: <20230731063317.3720-18-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

FRED event delivery establishes a full supervisor context by saving
the essential information about an event to a FRED stack frame, e.g.,
the faulting linear address of a #PF is saved as event data of a FRED
stack frame. Thus a struct pt_regs has all the needed data to handle
an event and it's the only input argument of a FRED event handler.

Define fred_handler, a common function type used in the FRED event
dispatch framework, which makes it easier to find the entry points
(via grep), allows the prototype to change if necessary without
requiring changing changes everywhere, and makes sure that all the
entry points have the proper decorations (currently noinstr, but
could change in the future.)

Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/include/asm/fred.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/x86/include/asm/fred.h b/arch/x86/include/asm/fred.h
index d76e681a806f..b45c1bea5b7f 100644
--- a/arch/x86/include/asm/fred.h
+++ b/arch/x86/include/asm/fred.h
@@ -68,6 +68,19 @@
 #define FRED_SSX_64_BIT_MODE_BIT	57
 #define FRED_SSX_64_BIT_MODE		_BITUL(FRED_SSX_64_BIT_MODE_BIT)
 
+/*
+ * FRED event delivery establishes a full supervisor context by
+ * saving the essential information about an event to a FRED
+ * stack frame, e.g., the faulting linear address of a #PF is
+ * saved as event data of a FRED #PF stack frame. Thus a struct
+ * pt_regs has all the needed data to handle an event and it's
+ * the only input argument of a FRED event handler.
+ *
+ * FRED handlers need to be placed in the noinstr text section.
+ */
+#define DECLARE_FRED_HANDLER(f) void f (struct pt_regs *regs)
+#define DEFINE_FRED_HANDLER(f) noinstr DECLARE_FRED_HANDLER(f)
+
 #ifdef CONFIG_X86_FRED
 
 #ifndef __ASSEMBLY__
@@ -97,6 +110,8 @@ static __always_inline unsigned long fred_event_data(struct pt_regs *regs)
 	return fred_info(regs)->edata;
 }
 
+typedef DECLARE_FRED_HANDLER((*fred_handler));
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* CONFIG_X86_FRED */
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:09:11 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:09:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572693.896687 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN1e-0006tP-Gu; Mon, 31 Jul 2023 07:09:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572693.896687; Mon, 31 Jul 2023 07:09:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN1e-0006tI-E0; Mon, 31 Jul 2023 07:09:06 +0000
Received: by outflank-mailman (input) for mailman id 572693;
 Mon, 31 Jul 2023 07:09:05 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQN1d-0006t8-01
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:09:05 +0000
Received: from mgamail.intel.com (unknown [192.55.52.136])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1f916e0a-2f71-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:09:03 +0200 (CEST)
Received: from orsmga004.jf.intel.com ([10.7.209.38])
 by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:08:58 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by orsmga004.jf.intel.com with ESMTP; 31 Jul 2023 00:08:56 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1f916e0a-2f71-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690787343; x=1722323343;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=0Vsn6bDzpRkXYLGAG2NP2KMCccOE1uQI/p8GcVukrL0=;
  b=BsNJME0sFaaDGCxaCoyqKL2b/N7F/ktpYpBNO/adW0ujcyKUc+Mt6z3R
   A7lJ67624thc4aN0LDXNzJJp40zG5+U0owVg/+SrIU42b0Q9N6rveoW7g
   0YbEDuEw/EAHa5k27FCPzBIeWKI0+Nk/XJeRmdM84azCLgdxwymQBP5S5
   23w4pTvMwG0069HRJ3rHUpsuK8HiJUKntjRXi5wqeFlzIiMalvpxUHy8O
   y3sqpGwUTDWmnAcK1RpKLv6AfaPeomkK2NVSivREK+1ilQGJ9h36TaC6+
   HaUEUuo1qnAMcaBPIHH7aSLQ8G2IX/Pn2fREI9eKZcfrqj47tTJjKrR5F
   w==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="348538895"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="348538895"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="851922998"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="851922998"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 26/36] x86/traps: Add sysvec_install() to install a system interrupt handler
Date: Sun, 30 Jul 2023 23:40:25 -0700
Message-Id: <20230731064025.3819-1-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add sysvec_install() to install a system interrupt handler into both
the IDT and system_interrupt_handlers. The latter is used to dispatch
system interrupts to their respective handlers when FRED is enabled.

Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---

Changes since v8:
* Introduce a macro sysvec_install() to derive the asm handler name from
  a C handler, which simplifies the code and avoids an ugly typecast
  (Thomas Gleixner).
---
 arch/x86/include/asm/traps.h     | 19 +++++++++++++++++++
 arch/x86/kernel/cpu/acrn.c       |  5 +++--
 arch/x86/kernel/cpu/mshyperv.c   | 16 ++++++++--------
 arch/x86/kernel/kvm.c            |  2 +-
 arch/x86/kernel/traps.c          |  6 ++++++
 drivers/xen/events/events_base.c |  3 ++-
 6 files changed, 39 insertions(+), 12 deletions(-)

diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h
index 47ecfff2c83d..cba3e4dfc329 100644
--- a/arch/x86/include/asm/traps.h
+++ b/arch/x86/include/asm/traps.h
@@ -47,4 +47,23 @@ void __noreturn handle_stack_overflow(struct pt_regs *regs,
 				      struct stack_info *info);
 #endif
 
+#ifdef CONFIG_X86_64
+inline void set_sysvec_handler(unsigned int i, system_interrupt_handler func);
+
+static inline void sysvec_setup_fred(unsigned int vector, system_interrupt_handler func)
+{
+	BUG_ON(vector < FIRST_SYSTEM_VECTOR);
+	set_sysvec_handler(vector - FIRST_SYSTEM_VECTOR, func);
+}
+#else
+static inline void sysvec_setup_fred(unsigned int vector, system_interrupt_handler func)
+{
+}
+#endif
+
+#define sysvec_install(vector, func) {					\
+	sysvec_setup_fred(vector, func);				\
+	alloc_intr_gate(vector, asm_##func);				\
+}
+
 #endif /* _ASM_X86_TRAPS_H */
diff --git a/arch/x86/kernel/cpu/acrn.c b/arch/x86/kernel/cpu/acrn.c
index 485441b7f030..a879b4b87740 100644
--- a/arch/x86/kernel/cpu/acrn.c
+++ b/arch/x86/kernel/cpu/acrn.c
@@ -18,6 +18,7 @@
 #include <asm/hypervisor.h>
 #include <asm/idtentry.h>
 #include <asm/irq_regs.h>
+#include <asm/traps.h>
 
 static u32 __init acrn_detect(void)
 {
@@ -26,8 +27,8 @@ static u32 __init acrn_detect(void)
 
 static void __init acrn_init_platform(void)
 {
-	/* Setup the IDT for ACRN hypervisor callback */
-	alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, asm_sysvec_acrn_hv_callback);
+	/* Install system interrupt handler for ACRN hypervisor callback */
+	sysvec_install(HYPERVISOR_CALLBACK_VECTOR, sysvec_acrn_hv_callback);
 
 	x86_platform.calibrate_tsc = acrn_get_tsc_khz;
 	x86_platform.calibrate_cpu = acrn_get_tsc_khz;
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index c7969e806c64..134830a7f575 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -28,6 +28,7 @@
 #include <asm/i8259.h>
 #include <asm/apic.h>
 #include <asm/timer.h>
+#include <asm/traps.h>
 #include <asm/reboot.h>
 #include <asm/nmi.h>
 #include <clocksource/hyperv_timer.h>
@@ -480,19 +481,18 @@ static void __init ms_hyperv_init_platform(void)
 	 */
 	x86_platform.apic_post_init = hyperv_init;
 	hyperv_setup_mmu_ops();
-	/* Setup the IDT for hypervisor callback */
-	alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, asm_sysvec_hyperv_callback);
 
-	/* Setup the IDT for reenlightenment notifications */
+	/* Install system interrupt handler for hypervisor callback */
+	sysvec_install(HYPERVISOR_CALLBACK_VECTOR, sysvec_hyperv_callback);
+
+	/* Install system interrupt handler for reenlightenment notifications */
 	if (ms_hyperv.features & HV_ACCESS_REENLIGHTENMENT) {
-		alloc_intr_gate(HYPERV_REENLIGHTENMENT_VECTOR,
-				asm_sysvec_hyperv_reenlightenment);
+		sysvec_install(HYPERV_REENLIGHTENMENT_VECTOR, sysvec_hyperv_reenlightenment);
 	}
 
-	/* Setup the IDT for stimer0 */
+	/* Install system interrupt handler for stimer0 */
 	if (ms_hyperv.misc_features & HV_STIMER_DIRECT_MODE_AVAILABLE) {
-		alloc_intr_gate(HYPERV_STIMER0_VECTOR,
-				asm_sysvec_hyperv_stimer0);
+		sysvec_install(HYPERV_STIMER0_VECTOR, sysvec_hyperv_stimer0);
 	}
 
 # ifdef CONFIG_SMP
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 1cceac5984da..12c799412c5d 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -829,7 +829,7 @@ static void __init kvm_guest_init(void)
 
 	if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF_INT) && kvmapf) {
 		static_branch_enable(&kvm_async_pf_enabled);
-		alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, asm_sysvec_kvm_asyncpf_interrupt);
+		sysvec_install(HYPERVISOR_CALLBACK_VECTOR, sysvec_kvm_asyncpf_interrupt);
 	}
 
 #ifdef CONFIG_SMP
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index e430a8c47931..9040c7f01c93 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -1536,6 +1536,12 @@ static system_interrupt_handler system_interrupt_handlers[NR_SYSTEM_VECTORS] = {
 
 #undef SYSV
 
+void set_sysvec_handler(unsigned int i, system_interrupt_handler func)
+{
+	BUG_ON(i >= NR_SYSTEM_VECTORS);
+	system_interrupt_handlers[i] = func;
+}
+
 #endif /* CONFIG_X86_64 */
 
 void __init trap_init(void)
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index c7715f8bd452..16d51338e1f8 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -45,6 +45,7 @@
 #include <asm/irq.h>
 #include <asm/io_apic.h>
 #include <asm/i8259.h>
+#include <asm/traps.h>
 #include <asm/xen/cpuid.h>
 #include <asm/xen/pci.h>
 #endif
@@ -2249,7 +2250,7 @@ static __init void xen_alloc_callback_vector(void)
 		return;
 
 	pr_info("Xen HVM callback vector for event delivery is enabled\n");
-	alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, asm_sysvec_xen_hvm_callback);
+	sysvec_install(HYPERVISOR_CALLBACK_VECTOR, sysvec_xen_hvm_callback);
 }
 #else
 void xen_setup_callback_vector(void) {}
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:09:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:09:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572695.896698 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN25-0007OZ-PY; Mon, 31 Jul 2023 07:09:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572695.896698; Mon, 31 Jul 2023 07:09:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN25-0007OS-Lr; Mon, 31 Jul 2023 07:09:33 +0000
Received: by outflank-mailman (input) for mailman id 572695;
 Mon, 31 Jul 2023 07:09:32 +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 <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQN24-0007Jb-MT
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:09:32 +0000
Received: from mgamail.intel.com (unknown [134.134.136.31])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 30c11702-2f71-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 09:09:30 +0200 (CEST)
Received: from fmsmga007.fm.intel.com ([10.253.24.52])
 by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:09:28 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga007.fm.intel.com with ESMTP; 31 Jul 2023 00:09:26 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 30c11702-2f71-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690787370; x=1722323370;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=BTa7pFRtc5hN79memTk6tlfkpBhDUr274mj/lMgq9SQ=;
  b=SOdZLtsArNee0KojNjfASZ8mryET4mY7cWnWKv0ndIjD3H1TUNTa6LOb
   IOJ9q43TfOvIyoA+eDgrQnghPWU+3+PaD9tLDvtPj3Y6IAHSR5fy2VW/Z
   9FTZUi8RBqrzzh/QRsa8mDthiihjiwW67p/x5w2QubLY4dvDb4Hk+4tSw
   6lnYgHKsgCDN9dvpNCnAjBk+ol52q0q+hBoF2b4MmGisRO0MESJKsoVRS
   Qqb9V3OP3wG9LWoDIthLp1UBe2mjEl8tPyvdK89ZkLP6a8m08VQao97YI
   WL7XbAtTYAEp7dcc8wXmN3qGX7RWU+Qt+8wh78t77KJ3TMK74v2dl1f8o
   g==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="432749857"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="432749857"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="731491567"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="731491567"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 27/36] x86/traps: Add external_interrupt() to dispatch external interrupts
Date: Sun, 30 Jul 2023 23:40:55 -0700
Message-Id: <20230731064055.3842-1-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

external_interrupt() dispatches all external interrupts: it checks if an
external interrupt is a system interrupt, if yes it dipatches it through
the system_interrupt_handlers table, otherwise to
dispatch_common_interrupt().

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Co-developed-by: Xin Li <xin3.li@intel.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---

Changes since v8:
* Reword the patch description, which was confusing (Thomas Gleixner).

Changes since v5:
* Initialize system_interrupt_handlers with dispatch_table_spurious_interrupt()
  instead of NULL to get rid of a branch (Peter Zijlstra).
---
 arch/x86/include/asm/traps.h |  2 ++
 arch/x86/kernel/traps.c      | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h
index cba3e4dfc329..48daa78ee88c 100644
--- a/arch/x86/include/asm/traps.h
+++ b/arch/x86/include/asm/traps.h
@@ -66,4 +66,6 @@ static inline void sysvec_setup_fred(unsigned int vector, system_interrupt_handl
 	alloc_intr_gate(vector, asm_##func);				\
 }
 
+int external_interrupt(struct pt_regs *regs);
+
 #endif /* _ASM_X86_TRAPS_H */
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 9040c7f01c93..90fdfcccee7a 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -1542,6 +1542,24 @@ void set_sysvec_handler(unsigned int i, system_interrupt_handler func)
 	system_interrupt_handlers[i] = func;
 }
 
+int external_interrupt(struct pt_regs *regs)
+{
+	unsigned int vector = regs->vector;
+	unsigned int sysvec = vector - FIRST_SYSTEM_VECTOR;
+
+	if (unlikely(vector < FIRST_EXTERNAL_VECTOR)) {
+		pr_err("invalid external interrupt vector %d\n", vector);
+		return -EINVAL;
+	}
+
+	if (sysvec < NR_SYSTEM_VECTORS)
+		system_interrupt_handlers[sysvec](regs);
+	else
+		dispatch_common_interrupt(regs, vector);
+
+	return 0;
+}
+
 #endif /* CONFIG_X86_64 */
 
 void __init trap_init(void)
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:09:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:09:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572696.896708 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN2D-0007i1-4x; Mon, 31 Jul 2023 07:09:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572696.896708; Mon, 31 Jul 2023 07:09:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN2D-0007hu-2B; Mon, 31 Jul 2023 07:09:41 +0000
Received: by outflank-mailman (input) for mailman id 572696;
 Mon, 31 Jul 2023 07:09:40 +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 <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQN2C-0007Jb-5x
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:09:40 +0000
Received: from mgamail.intel.com (unknown [134.134.136.31])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 36089a85-2f71-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 09:09:38 +0200 (CEST)
Received: from fmsmga007.fm.intel.com ([10.253.24.52])
 by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:09:37 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga007.fm.intel.com with ESMTP; 31 Jul 2023 00:09:35 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 36089a85-2f71-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690787378; x=1722323378;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=Aa5CvA7MmnPHyksJQgqEteFVOvaio1lA17Ke5qS+vL0=;
  b=N72tAZR+vkIV66rxfC9UqMmtaL6m9M6WWG9cpgkn/2EnLP7fOXS6EI/+
   itBGSuzlRjj2Tntnj3Jj20DPWn5otb4PlvUC0+kjqk3N9yOlWlihgpUuQ
   rN70j89iZZd244rAWJr+rJEaqZweDhY+oNxMNf0KUtg6c74Fs+lwn+wfG
   l0rUN3Itl5EeRsZFfG0pQzX/kZhO6R8ZNSOOuaRnOiIkCGPo0/fz0Z0Uc
   TLaqf5/DrJoVK/pp2SIaH9P0rNxklprCke2v4xAVMmv+z7RJ7h0a6MwA2
   Abm8yiX8OmufieFNaW4zymVAAPPkHZbV3iOA+c33XrQMg3LHWRSk+Xx0a
   A==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="432749913"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="432749913"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="731491679"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="731491679"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 28/36] x86/idtentry: Incorporate declaration/definition of the FRED exception handler type
Date: Sun, 30 Jul 2023 23:41:05 -0700
Message-Id: <20230731064105.3857-1-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The existing IDT exception C-handlers of X86_TRAP_TS, X86_TRAP_NP,
X86_TRAP_SS, X86_TRAP_GP, X86_TRAP_AC and X86_TRAP_CP take an error
code as the second argument, thus their FRED version handlers simply
call the corresponding existing IDT handlers with orig_ax from the
pt_regs structure as the second argument.

Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/include/asm/idtentry.h | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h
index e67d111bf932..3b743c3fbe91 100644
--- a/arch/x86/include/asm/idtentry.h
+++ b/arch/x86/include/asm/idtentry.h
@@ -11,6 +11,7 @@
 #include <linux/entry-common.h>
 #include <linux/hardirq.h>
 
+#include <asm/fred.h>
 #include <asm/irq_stack.h>
 
 /**
@@ -67,13 +68,16 @@ static __always_inline void __##func(struct pt_regs *regs)
 
 /**
  * DECLARE_IDTENTRY_ERRORCODE - Declare functions for simple IDT entry points
+ *				and their corresponding software based
+ *				dispatch handler
  *				Error code pushed by hardware
  * @vector:	Vector number (ignored for C)
  * @func:	Function name of the entry point
  *
- * Declares three functions:
+ * Declares four functions:
  * - The ASM entry point: asm_##func
  * - The XEN PV trap entry point: xen_##func (maybe unused)
+ * - The C handler called from the FRED event dispatch framework
  * - The C handler called from the ASM entry point
  *
  * Same as DECLARE_IDTENTRY, but has an extra error_code argument for the
@@ -82,14 +86,19 @@ static __always_inline void __##func(struct pt_regs *regs)
 #define DECLARE_IDTENTRY_ERRORCODE(vector, func)			\
 	asmlinkage void asm_##func(void);				\
 	asmlinkage void xen_asm_##func(void);				\
+	__visible DECLARE_FRED_HANDLER(fred_##func);			\
 	__visible void func(struct pt_regs *regs, unsigned long error_code)
 
 /**
  * DEFINE_IDTENTRY_ERRORCODE - Emit code for simple IDT entry points
+ *			       and their corresponding software based
+ *			       dispatch handler
  *			       Error code pushed by hardware
  * @func:	Function name of the entry point
  *
- * Same as DEFINE_IDTENTRY, but has an extra error_code argument
+ * Same as DEFINE_IDTENTRY, but has an extra error_code argument. The
+ * fred_func() simply calls func() with passing orig_ax as its second
+ * argument.
  */
 #define DEFINE_IDTENTRY_ERRORCODE(func)					\
 static __always_inline void __##func(struct pt_regs *regs,		\
@@ -106,6 +115,11 @@ __visible noinstr void func(struct pt_regs *regs,			\
 	irqentry_exit(regs, state);					\
 }									\
 									\
+__visible DEFINE_FRED_HANDLER(fred_##func)				\
+{									\
+	func(regs, regs->orig_ax);					\
+}									\
+									\
 static __always_inline void __##func(struct pt_regs *regs,		\
 				     unsigned long error_code)
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:09:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:09:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572714.896718 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN2U-0008RS-Hk; Mon, 31 Jul 2023 07:09:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572714.896718; Mon, 31 Jul 2023 07:09:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN2U-0008RF-BQ; Mon, 31 Jul 2023 07:09:58 +0000
Received: by outflank-mailman (input) for mailman id 572714;
 Mon, 31 Jul 2023 07:09:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQN2T-00082R-CK
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:09:57 +0000
Received: from mgamail.intel.com (unknown [134.134.136.31])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3ecdeaa3-2f71-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:09:55 +0200 (CEST)
Received: from fmsmga007.fm.intel.com ([10.253.24.52])
 by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:09:51 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga007.fm.intel.com with ESMTP; 31 Jul 2023 00:09:50 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3ecdeaa3-2f71-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690787395; x=1722323395;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=mV4jSKbY2d+wZLYFM+7NRxftfBvXd0NC2fevZMSM55Q=;
  b=W200gWJ4pt7LKm0spvo08LTC5XATmx/bBX0W8wEOPj12iuaIwKBu+OpC
   Kd9sczIJUMTwSw57ar0yt61MG8PDjfhFiDJuqU+baDVwXTCZS+b5H5aEL
   MuBmjDZ8kqJgqAzKpyKKKErziQ3xT+6ZIgQmCFHWwShSPEtskaWfh/wLN
   646ro9M+QC4OMRW4I0XiOSbuEYzCgCyBdu5ni9GLrLi3mJqRgUTnA1H7J
   zb0NXtr+5G6J6KAaBYUUjRMEXZca154Q2dGBDzCrgSGOj9JSE/0jSbR/Z
   4rroK3sv/LzGuhWfGgs/ClidSI8gIv7Bs1PgRGPcBSVwVgJs1LiZS3A9n
   w==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="432749996"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="432749996"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="731491787"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="731491787"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 29/36] x86/fred: FRED entry/exit and dispatch code
Date: Sun, 30 Jul 2023 23:41:19 -0700
Message-Id: <20230731064119.3870-1-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

The code to actually handle kernel and event entry/exit using
FRED. It is split up into two files thus:

- entry_64_fred.S contains the actual entrypoints and exit code, and
  saves and restores registers.
- entry_fred.c contains the two-level event dispatch code for FRED.
  The first-level dispatch is on the event type, and the second-level
  is on the event vector.

Originally-by: Megha Dey <megha.dey@intel.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Co-developed-by: Xin Li <xin3.li@intel.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---

Changes since v8:
* Don't do syscall early out in fred_entry_from_user() before there are
  proper performance numbers and justifications (Thomas Gleixner).
* Add the control exception handler to the FRED exception handler table
  (Thomas Gleixner).
* Add ENDBR to the FRED_ENTER asm macro.
* Reflect the FRED spec 5.0 change that ERETS and ERETU add 8 to %rsp
  before popping the return context from the stack.

Changes since v1:
* Initialize a FRED exception handler to fred_bad_event() instead of NULL
  if no FRED handler defined for an exception vector (Peter Zijlstra).
* Push calling irqentry_{enter,exit}() and instrumentation_{begin,end}()
  down into individual FRED exception handlers, instead of in the dispatch
  framework (Peter Zijlstra).
---
 arch/x86/entry/Makefile               |   5 +-
 arch/x86/entry/entry_64_fred.S        |  53 +++++++
 arch/x86/entry/entry_fred.c           | 220 ++++++++++++++++++++++++++
 arch/x86/include/asm/asm-prototypes.h |   1 +
 arch/x86/include/asm/fred.h           |   4 +
 arch/x86/include/asm/idtentry.h       |   4 +
 6 files changed, 286 insertions(+), 1 deletion(-)
 create mode 100644 arch/x86/entry/entry_64_fred.S
 create mode 100644 arch/x86/entry/entry_fred.c

diff --git a/arch/x86/entry/Makefile b/arch/x86/entry/Makefile
index ca2fe186994b..c93e7f5c2a06 100644
--- a/arch/x86/entry/Makefile
+++ b/arch/x86/entry/Makefile
@@ -18,6 +18,9 @@ obj-y				+= vdso/
 obj-y				+= vsyscall/
 
 obj-$(CONFIG_PREEMPTION)	+= thunk_$(BITS).o
+CFLAGS_entry_fred.o		+= -fno-stack-protector
+CFLAGS_REMOVE_entry_fred.o	+= -pg $(CC_FLAGS_FTRACE)
+obj-$(CONFIG_X86_FRED)		+= entry_64_fred.o entry_fred.o
+
 obj-$(CONFIG_IA32_EMULATION)	+= entry_64_compat.o syscall_32.o
 obj-$(CONFIG_X86_X32_ABI)	+= syscall_x32.o
-
diff --git a/arch/x86/entry/entry_64_fred.S b/arch/x86/entry/entry_64_fred.S
new file mode 100644
index 000000000000..4ae12d557db3
--- /dev/null
+++ b/arch/x86/entry/entry_64_fred.S
@@ -0,0 +1,53 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * The actual FRED entry points.
+ */
+
+#include <asm/fred.h>
+
+#include "calling.h"
+
+	.code64
+	.section ".noinstr.text", "ax"
+
+.macro FRED_ENTER
+	UNWIND_HINT_END_OF_STACK
+	ENDBR
+	PUSH_AND_CLEAR_REGS
+	movq	%rsp, %rdi	/* %rdi -> pt_regs */
+.endm
+
+.macro FRED_EXIT
+	UNWIND_HINT_REGS
+	POP_REGS
+.endm
+
+/*
+ * The new RIP value that FRED event delivery establishes is
+ * IA32_FRED_CONFIG & ~FFFH for events that occur in ring 3.
+ * Thus the FRED ring 3 entry point must be 4K page aligned.
+ */
+	.align 4096
+
+SYM_CODE_START_NOALIGN(fred_entrypoint_user)
+	FRED_ENTER
+	call	fred_entry_from_user
+SYM_INNER_LABEL(fred_exit_user, SYM_L_GLOBAL)
+	FRED_EXIT
+	ERETU
+SYM_CODE_END(fred_entrypoint_user)
+
+.fill fred_entrypoint_kernel - ., 1, 0xcc
+
+/*
+ * The new RIP value that FRED event delivery establishes is
+ * (IA32_FRED_CONFIG & ~FFFH) + 256 for events that occur in
+ * ring 0, i.e., fred_entrypoint_user + 256.
+ */
+	.org fred_entrypoint_user+256
+SYM_CODE_START_NOALIGN(fred_entrypoint_kernel)
+	FRED_ENTER
+	call	fred_entry_from_kernel
+	FRED_EXIT
+	ERETS
+SYM_CODE_END(fred_entrypoint_kernel)
diff --git a/arch/x86/entry/entry_fred.c b/arch/x86/entry/entry_fred.c
new file mode 100644
index 000000000000..1688e7e09370
--- /dev/null
+++ b/arch/x86/entry/entry_fred.c
@@ -0,0 +1,220 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * This contains the dispatch functions called from the entry point
+ * assembly.
+ */
+
+#include <linux/kernel.h>
+#include <linux/kdebug.h>
+#include <linux/nospec.h>
+
+#include <asm/fred.h>
+#include <asm/idtentry.h>
+#include <asm/syscall.h>
+#include <asm/trapnr.h>
+#include <asm/traps.h>
+#include <asm/kdebug.h>
+
+static DEFINE_FRED_HANDLER(fred_bad_event)
+{
+	irqentry_state_t irq_state = irqentry_nmi_enter(regs);
+
+	instrumentation_begin();
+
+	/* Panic on events from a high stack level */
+	if (regs->sl > 0) {
+		pr_emerg("PANIC: invalid or fatal FRED event; event type %u "
+			 "vector %u error 0x%lx aux 0x%lx at %04x:%016lx\n",
+			 regs->type, regs->vector, regs->orig_ax,
+			 fred_event_data(regs), regs->cs, regs->ip);
+		die("invalid or fatal FRED event", regs, regs->orig_ax);
+		panic("invalid or fatal FRED event");
+	} else {
+		unsigned long flags = oops_begin();
+		int sig = SIGKILL;
+
+		pr_alert("BUG: invalid or fatal FRED event; event type %u "
+			 "vector %u error 0x%lx aux 0x%lx at %04x:%016lx\n",
+			 regs->type, regs->vector, regs->orig_ax,
+			 fred_event_data(regs), regs->cs, regs->ip);
+
+		if (__die("Invalid or fatal FRED event", regs, regs->orig_ax))
+			sig = 0;
+
+		oops_end(flags, regs, sig);
+	}
+
+	instrumentation_end();
+	irqentry_nmi_exit(regs, irq_state);
+}
+
+static DEFINE_FRED_HANDLER(fred_exception)
+{
+	/*
+	 * Exceptions that cannot happen on FRED h/w are set to fred_bad_event().
+	 */
+	static const fred_handler exception_handlers[NUM_EXCEPTION_VECTORS] = {
+		[0 ... NUM_EXCEPTION_VECTORS-1] = fred_bad_event,
+
+		[X86_TRAP_DE]		= exc_divide_error,
+		[X86_TRAP_DB]		= fred_exc_debug,
+		[X86_TRAP_BP]		= exc_int3,
+		[X86_TRAP_OF]		= exc_overflow,
+		[X86_TRAP_BR]		= exc_bounds,
+		[X86_TRAP_UD]		= exc_invalid_op,
+		[X86_TRAP_NM]		= exc_device_not_available,
+		[X86_TRAP_DF]		= fred_exc_double_fault,
+		[X86_TRAP_TS]		= fred_exc_invalid_tss,
+		[X86_TRAP_NP]		= fred_exc_segment_not_present,
+		[X86_TRAP_SS]		= fred_exc_stack_segment,
+		[X86_TRAP_GP]		= fred_exc_general_protection,
+		[X86_TRAP_PF]		= fred_exc_page_fault,
+		[X86_TRAP_MF]		= exc_coprocessor_error,
+		[X86_TRAP_AC]		= fred_exc_alignment_check,
+		[X86_TRAP_MC]		= fred_exc_machine_check,
+		[X86_TRAP_XF]		= exc_simd_coprocessor_error,
+		[X86_TRAP_CP]		= fred_exc_control_protection,
+	};
+
+	exception_handlers[regs->vector](regs);
+}
+
+static __always_inline void fred_emulate_trap(struct pt_regs *regs)
+{
+	regs->orig_ax = 0;
+	fred_exception(regs);
+}
+
+static __always_inline void fred_emulate_fault(struct pt_regs *regs)
+{
+	regs->ip -= regs->instr_len;
+	fred_emulate_trap(regs);
+}
+
+static DEFINE_FRED_HANDLER(fred_sw_interrupt_user)
+{
+	/*
+	 * In compat mode INT $0x80 (32bit system call) is
+	 * performance-critical. Handle it first.
+	 */
+	if (IS_ENABLED(CONFIG_IA32_EMULATION) &&
+	    likely(regs->vector == IA32_SYSCALL_VECTOR)) {
+		regs->orig_ax = regs->ax;
+		regs->ax = -ENOSYS;
+		return do_int80_syscall_32(regs);
+	}
+
+	/*
+	 * Some software exceptions can also be triggered as
+	 * int instructions, for historical reasons.
+	 */
+	switch (regs->vector) {
+	case X86_TRAP_BP:
+	case X86_TRAP_OF:
+		fred_emulate_trap(regs);
+		break;
+	default:
+		regs->vector = X86_TRAP_GP;
+		fred_emulate_fault(regs);
+		break;
+	}
+}
+
+static DEFINE_FRED_HANDLER(fred_other_default)
+{
+	regs->vector = X86_TRAP_UD;
+	fred_emulate_fault(regs);
+}
+
+static DEFINE_FRED_HANDLER(fred_syscall)
+{
+	regs->orig_ax = regs->ax;
+	regs->ax = -ENOSYS;
+	do_syscall_64(regs, regs->orig_ax);
+}
+
+#if IS_ENABLED(CONFIG_IA32_EMULATION)
+/*
+ * Emulate SYSENTER if applicable. This is not the preferred system
+ * call in 32-bit mode under FRED, rather int $0x80 is preferred and
+ * exported in the vdso.
+ */
+static DEFINE_FRED_HANDLER(fred_sysenter)
+{
+	regs->orig_ax = regs->ax;
+	regs->ax = -ENOSYS;
+	do_fast_syscall_32(regs);
+}
+#else
+#define fred_sysenter fred_other_default
+#endif
+
+static DEFINE_FRED_HANDLER(fred_other)
+{
+	static const fred_handler user_other_handlers[FRED_NUM_OTHER_VECTORS] =
+	{
+		/*
+		 * Vector 0 of the other event type is not used
+		 * per FRED spec 5.0.
+		 */
+		[0]		= fred_other_default,
+		[FRED_SYSCALL]	= fred_syscall,
+		[FRED_SYSENTER]	= fred_sysenter
+	};
+
+	user_other_handlers[regs->vector](regs);
+}
+
+static DEFINE_FRED_HANDLER(fred_hw_interrupt)
+{
+	irqentry_state_t state = irqentry_enter(regs);
+
+	instrumentation_begin();
+	external_interrupt(regs);
+	instrumentation_end();
+	irqentry_exit(regs, state);
+}
+
+__visible noinstr void fred_entry_from_user(struct pt_regs *regs)
+{
+	static const fred_handler user_handlers[FRED_EVENT_TYPE_COUNT] =
+	{
+		[EVENT_TYPE_HWINT]	= fred_hw_interrupt,
+		[EVENT_TYPE_RESERVED]	= fred_bad_event,
+		[EVENT_TYPE_NMI]	= fred_exc_nmi,
+		[EVENT_TYPE_SWINT]	= fred_sw_interrupt_user,
+		[EVENT_TYPE_HWFAULT]	= fred_exception,
+		[EVENT_TYPE_SWFAULT]	= fred_exception,
+		[EVENT_TYPE_PRIVSW]	= fred_exception,
+		[EVENT_TYPE_OTHER]	= fred_other
+	};
+
+	/*
+	 * FRED employs a two-level event dispatch mechanism, with the
+	 * first-level on the type of an event and the second-level on
+	 * its vector. Here is the first-level dispatch for ring 3 events.
+	 */
+	user_handlers[regs->type](regs);
+}
+
+__visible noinstr void fred_entry_from_kernel(struct pt_regs *regs)
+{
+	static const fred_handler kernel_handlers[FRED_EVENT_TYPE_COUNT] =
+	{
+		[EVENT_TYPE_HWINT]	= fred_hw_interrupt,
+		[EVENT_TYPE_RESERVED]	= fred_bad_event,
+		[EVENT_TYPE_NMI]	= fred_exc_nmi,
+		[EVENT_TYPE_SWINT]	= fred_bad_event,
+		[EVENT_TYPE_HWFAULT]	= fred_exception,
+		[EVENT_TYPE_SWFAULT]	= fred_exception,
+		[EVENT_TYPE_PRIVSW]	= fred_exception,
+		[EVENT_TYPE_OTHER]	= fred_bad_event
+	};
+
+	/*
+	 * FRED employs a two-level event dispatch mechanism, with the
+	 * first-level on the type of an event and the second-level on
+	 * its vector. Here is the first-level dispatch for ring 0 events.
+	 */
+	kernel_handlers[regs->type](regs);
+}
diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h
index b1a98fa38828..36505b991f88 100644
--- a/arch/x86/include/asm/asm-prototypes.h
+++ b/arch/x86/include/asm/asm-prototypes.h
@@ -13,6 +13,7 @@
 #include <asm/preempt.h>
 #include <asm/asm.h>
 #include <asm/gsseg.h>
+#include <asm/fred.h>
 
 #ifndef CONFIG_X86_CMPXCHG64
 extern void cmpxchg8b_emu(void);
diff --git a/arch/x86/include/asm/fred.h b/arch/x86/include/asm/fred.h
index bd701ac87528..3c91f0eae62e 100644
--- a/arch/x86/include/asm/fred.h
+++ b/arch/x86/include/asm/fred.h
@@ -118,6 +118,10 @@ DECLARE_FRED_HANDLER(fred_exc_page_fault);
 DECLARE_FRED_HANDLER(fred_exc_machine_check);
 DECLARE_FRED_HANDLER(fred_exc_double_fault);
 
+/* The actual assembly entry point for ring 3 and 0 */
+extern asmlinkage __visible void fred_entrypoint_user(void);
+extern asmlinkage __visible void fred_entrypoint_kernel(void);
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* CONFIG_X86_FRED */
diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h
index 3b743c3fbe91..0df3a3cc7e0f 100644
--- a/arch/x86/include/asm/idtentry.h
+++ b/arch/x86/include/asm/idtentry.h
@@ -661,6 +661,8 @@ DECLARE_IDTENTRY_RAW(X86_TRAP_MC,	exc_machine_check);
 #ifdef CONFIG_XEN_PV
 DECLARE_IDTENTRY_RAW(X86_TRAP_MC,	xenpv_exc_machine_check);
 #endif
+#else
+#define fred_exc_machine_check		fred_bad_event
 #endif
 
 /* NMI */
@@ -699,6 +701,8 @@ DECLARE_IDTENTRY_RAW_ERRORCODE(X86_TRAP_DF,	xenpv_exc_double_fault);
 /* #CP */
 #ifdef CONFIG_X86_KERNEL_IBT
 DECLARE_IDTENTRY_ERRORCODE(X86_TRAP_CP,	exc_control_protection);
+#else
+#define fred_exc_control_protection	fred_bad_event
 #endif
 
 /* #VC */
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:10:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:10:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572718.896729 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN2p-0001RK-Q5; Mon, 31 Jul 2023 07:10:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572718.896729; Mon, 31 Jul 2023 07:10:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN2p-0001RD-Lt; Mon, 31 Jul 2023 07:10:19 +0000
Received: by outflank-mailman (input) for mailman id 572718;
 Mon, 31 Jul 2023 07:10:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQN2o-00082R-Hx
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:10:18 +0000
Received: from mgamail.intel.com (unknown [134.134.136.31])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4c9907c8-2f71-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:10:17 +0200 (CEST)
Received: from fmsmga004.fm.intel.com ([10.253.24.48])
 by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:10:12 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga004.fm.intel.com with ESMTP; 31 Jul 2023 00:10:05 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4c9907c8-2f71-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690787417; x=1722323417;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=U03M3kZ8BDHSBlTSXJIlVDmlKpE5VAGPdolj0bAVLvI=;
  b=ZogUhnN4h8L/w8eAICP2yYxG60qsKSDIj/dqkrWWbQp2KuZQYlKF+aAa
   VbJ1FDWPLVclskuN9MsvUAvNjytSV8aSmoKU6J/gx2l2YPaEWtzxfRhw6
   oQA9f+7dbxU2H/r2os1rPGOYkdChv2uACaR9Ic/rpQTDPljyhcWGqB2Hl
   wuQX6t3SQjbZeZ4YLGuZ/6y+7qsvmXsuCV5e5IUI8QxrphwVhITFy8WYY
   tXQymVj72vgnnuXa4Xp9ELspRuJ6OG7YorFE43wWZJK+QV1jRL8gNNZOX
   ZuPECAULtkWo1Kknof1jjTQeWX/wvB4T6x0j3hVB95wmc1wfhWsoQ2aDn
   Q==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="432750069"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="432750069"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="798157778"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="798157778"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 30/36] x86/fred: Fixup fault on ERETU by jumping to fred_entrypoint_user
Date: Sun, 30 Jul 2023 23:41:27 -0700
Message-Id: <20230731064133.3881-1-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

If the stack frame contains an invalid user context (e.g. due to invalid SS,
a non-canonical RIP, etc.) the ERETU instruction will trap (#SS or #GP).

>From a Linux point of view, this really should be considered a user space
failure, so use the standard fault fixup mechanism to intercept the fault,
fix up the exception frame, and redirect execution to fred_entrypoint_user.
The end result is that it appears just as if the hardware had taken the
exception immediately after completing the transition to user space.

Suggested-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---

Changes since v8:
* Reflect the FRED spec 5.0 change that ERETS and ERETU add 8 to %rsp
  before popping the return context from the stack.

Changes since v6:
* Add a comment to explain why it is safe to write to the previous FRED stack
  frame. (Lai Jiangshan).

Changes since v5:
* Move the NMI bit from an invalid stack frame, which caused ERETU to fault,
  to the fault handler's stack frame, thus to unblock NMI ASAP if NMI is blocked
  (Lai Jiangshan).
---
 arch/x86/entry/entry_64_fred.S             |  5 +-
 arch/x86/include/asm/extable_fixup_types.h |  4 +-
 arch/x86/mm/extable.c                      | 79 ++++++++++++++++++++++
 3 files changed, 86 insertions(+), 2 deletions(-)

diff --git a/arch/x86/entry/entry_64_fred.S b/arch/x86/entry/entry_64_fred.S
index 4ae12d557db3..d24bf7f10ac8 100644
--- a/arch/x86/entry/entry_64_fred.S
+++ b/arch/x86/entry/entry_64_fred.S
@@ -3,6 +3,7 @@
  * The actual FRED entry points.
  */
 
+#include <asm/asm.h>
 #include <asm/fred.h>
 
 #include "calling.h"
@@ -34,7 +35,9 @@ SYM_CODE_START_NOALIGN(fred_entrypoint_user)
 	call	fred_entry_from_user
 SYM_INNER_LABEL(fred_exit_user, SYM_L_GLOBAL)
 	FRED_EXIT
-	ERETU
+1:	ERETU
+
+	_ASM_EXTABLE_TYPE(1b, fred_entrypoint_user, EX_TYPE_ERETU)
 SYM_CODE_END(fred_entrypoint_user)
 
 .fill fred_entrypoint_kernel - ., 1, 0xcc
diff --git a/arch/x86/include/asm/extable_fixup_types.h b/arch/x86/include/asm/extable_fixup_types.h
index 991e31cfde94..1585c798a02f 100644
--- a/arch/x86/include/asm/extable_fixup_types.h
+++ b/arch/x86/include/asm/extable_fixup_types.h
@@ -64,6 +64,8 @@
 #define	EX_TYPE_UCOPY_LEN4		(EX_TYPE_UCOPY_LEN | EX_DATA_IMM(4))
 #define	EX_TYPE_UCOPY_LEN8		(EX_TYPE_UCOPY_LEN | EX_DATA_IMM(8))
 
-#define EX_TYPE_ZEROPAD			20 /* longword load with zeropad on fault */
+#define	EX_TYPE_ZEROPAD			20 /* longword load with zeropad on fault */
+
+#define	EX_TYPE_ERETU			21
 
 #endif
diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c
index 271dcb2deabc..0874f29e85ef 100644
--- a/arch/x86/mm/extable.c
+++ b/arch/x86/mm/extable.c
@@ -6,6 +6,7 @@
 #include <xen/xen.h>
 
 #include <asm/fpu/api.h>
+#include <asm/fred.h>
 #include <asm/sev.h>
 #include <asm/traps.h>
 #include <asm/kdebug.h>
@@ -223,6 +224,80 @@ static bool ex_handler_ucopy_len(const struct exception_table_entry *fixup,
 	return ex_handler_uaccess(fixup, regs, trapnr, fault_address);
 }
 
+#ifdef CONFIG_X86_FRED
+static bool ex_handler_eretu(const struct exception_table_entry *fixup,
+			     struct pt_regs *regs, unsigned long error_code)
+{
+	struct pt_regs *uregs = (struct pt_regs *)
+		(regs->sp - offsetof(struct pt_regs, orig_ax));
+	unsigned short ss = uregs->ss;
+	unsigned short cs = uregs->cs;
+
+	/*
+	 * Move the NMI bit from the invalid stack frame, which caused ERETU
+	 * to fault, to the fault handler's stack frame, thus to unblock NMI
+	 * with the fault handler's ERETS instruction ASAP if NMI is blocked.
+	 */
+	regs->nmi = uregs->nmi;
+
+	/*
+	 * Sync event information to uregs, i.e., the ERETU return frame, but
+	 * is it safe to write to the ERETU return frame which is just above
+	 * current event stack frame?
+	 *
+	 * The RSP used by FRED to push a stack frame is not the value in %rsp,
+	 * it is calculated from %rsp with the following 2 steps:
+	 * 1) RSP = %rsp - (IA32_FRED_CONFIG & 0x1c0)	// Reserve N*64 bytes
+	 * 2) RSP = RSP & ~0x3f		// Align to a 64-byte cache line
+	 * when an event delivery doesn't trigger a stack level change.
+	 *
+	 * Here is an example with N*64 (N=1) bytes reserved:
+	 *
+	 *  64-byte cache line ==>  ______________
+	 *                         |___Reserved___|
+	 *                         |__Event_data__|
+	 *                         |_____SS_______|
+	 *                         |_____RSP______|
+	 *                         |_____FLAGS____|
+	 *                         |_____CS_______|
+	 *                         |_____IP_______|
+	 *  64-byte cache line ==> |__Error_code__| <== ERETU return frame
+	 *                         |______________|
+	 *                         |______________|
+	 *                         |______________|
+	 *                         |______________|
+	 *                         |______________|
+	 *                         |______________|
+	 *                         |______________|
+	 *  64-byte cache line ==> |______________| <== RSP after step 1) and 2)
+	 *                         |___Reserved___|
+	 *                         |__Event_data__|
+	 *                         |_____SS_______|
+	 *                         |_____RSP______|
+	 *                         |_____FLAGS____|
+	 *                         |_____CS_______|
+	 *                         |_____IP_______|
+	 *  64-byte cache line ==> |__Error_code__| <== ERETS return frame
+	 *
+	 * Thus a new FRED stack frame will always be pushed below a previous
+	 * FRED stack frame ((N*64) bytes may be reserved between), and it is
+	 * safe to write to a previous FRED stack frame as they never overlap.
+	 */
+	fred_info(uregs)->edata = fred_event_data(regs);
+	uregs->ssx = regs->ssx;
+	uregs->ss = ss;
+	/* The NMI bit was moved away above */
+	uregs->nmi = 0;
+	uregs->csx = regs->csx;
+	uregs->sl = 0;
+	uregs->wfe = 0;
+	uregs->cs = cs;
+	uregs->orig_ax = error_code;
+
+	return ex_handler_default(fixup, regs);
+}
+#endif
+
 int ex_get_fixup_type(unsigned long ip)
 {
 	const struct exception_table_entry *e = search_exception_tables(ip);
@@ -300,6 +375,10 @@ int fixup_exception(struct pt_regs *regs, int trapnr, unsigned long error_code,
 		return ex_handler_ucopy_len(e, regs, trapnr, fault_addr, reg, imm);
 	case EX_TYPE_ZEROPAD:
 		return ex_handler_zeropad(e, regs, fault_addr);
+#ifdef CONFIG_X86_FRED
+	case EX_TYPE_ERETU:
+		return ex_handler_eretu(e, regs, error_code);
+#endif
 	}
 	BUG();
 }
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:10:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:10:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572719.896738 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN2r-0001is-5I; Mon, 31 Jul 2023 07:10:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572719.896738; Mon, 31 Jul 2023 07:10:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN2r-0001ij-1R; Mon, 31 Jul 2023 07:10:21 +0000
Received: by outflank-mailman (input) for mailman id 572719;
 Mon, 31 Jul 2023 07:10:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQN2p-00082R-IE
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:10:19 +0000
Received: from mgamail.intel.com (unknown [134.134.136.31])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4d45415c-2f71-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:10:18 +0200 (CEST)
Received: from fmsmga004.fm.intel.com ([10.253.24.48])
 by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:10:12 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga004.fm.intel.com with ESMTP; 31 Jul 2023 00:10:07 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4d45415c-2f71-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690787418; x=1722323418;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=QJo+FdezOu/7r5CtwRnG6EayDGJs/agjxSi0oClRDik=;
  b=LfoXMB8r+hnUS/QoVdG9KsBj24ApZYT41lva79JWYPpJFqsbH3//e7Ri
   ct1Q3BCelxp8i786I4ILda5ygS5ta3um0Nm5P0MxcgPZymcnmBffnMOR6
   al9dE5Epiv4qK8CYURR2OcnTZStzSxLzGjx5Jl0JlMI4/MgTXPwHaQm84
   JtifLBFPjG4JhVawC1ikNAng46K5g6/Uiu8Eq8mRa/JejWJHo1gY2sFLa
   4f43jcoluu03A58dTNcjWyMGMqI8h0f6GO+SgTmC/M/mX6+X6oqbARyvc
   5Rhbr8zaFDQmjl/p30frqFvSsg3EvoSDB5RuQwQ9rXksOsugaLWvly4Wd
   Q==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="432750104"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="432750104"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="798157781"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="798157781"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 31/36] x86/traps: Export external_interrupt() for handling IRQ in IRQ induced VM exits
Date: Sun, 30 Jul 2023 23:41:28 -0700
Message-Id: <20230731064133.3881-2-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731064133.3881-1-xin3.li@intel.com>
References: <20230731064133.3881-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Export external_interrupt() for handling IRQ in IRQ induced VM exits.

Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/kernel/traps.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 90fdfcccee7a..6143ad56008e 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -1560,6 +1560,11 @@ int external_interrupt(struct pt_regs *regs)
 	return 0;
 }
 
+#if IS_ENABLED(CONFIG_KVM_INTEL)
+/* For KVM VMX to handle IRQs in IRQ induced VM exits. */
+EXPORT_SYMBOL_GPL(external_interrupt);
+#endif
+
 #endif /* CONFIG_X86_64 */
 
 void __init trap_init(void)
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:10:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:10:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572721.896742 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN2r-0001md-ED; Mon, 31 Jul 2023 07:10:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572721.896742; Mon, 31 Jul 2023 07:10:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN2r-0001m1-Ak; Mon, 31 Jul 2023 07:10:21 +0000
Received: by outflank-mailman (input) for mailman id 572721;
 Mon, 31 Jul 2023 07:10:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQN2q-00082R-IZ
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:10:20 +0000
Received: from mgamail.intel.com (unknown [134.134.136.31])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4e515373-2f71-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:10:19 +0200 (CEST)
Received: from fmsmga004.fm.intel.com ([10.253.24.48])
 by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:10:13 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga004.fm.intel.com with ESMTP; 31 Jul 2023 00:10:08 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4e515373-2f71-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690787419; x=1722323419;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=0k0T0+NBS4NOJOU0xtkOh6eqcDmcObEt/EaW35o1kMc=;
  b=Io8VBjx4WPxeWsjjo+kHfTr+wPWIlw3Q0lpAZKWfjAzjCC1jwLLo0nsI
   bkcNvkkIylTPfrIMt5pUqj5wvCvawIand3leLFzgAGLcuvWlX7ztHgPOa
   5ScVo972rYpEfM7CObpaRlrQ5hZ8de944QfWVbYLyVRurs/AZ4RWz+kEM
   KITeHy0FO69OdvLZ24cOtAnhaT3h/K367tyfBWYJFTVHL7qpx30qCx+dp
   q1AUS6/30+nKkZ8osjlWF3zU2cxF5xhjronlGqLj7/z1PmmLKYzG3H8jc
   uqG7R/Uzi4kzXoGRb1W0BpsqRs2duQSQwJo1Dc6w0kDS/j3q/2TxAj+4G
   g==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="432750139"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="432750139"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="798157785"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="798157785"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 32/36] x86/fred: Export fred_entrypoint_kernel() for handling NMI in NMI induced VM exits
Date: Sun, 30 Jul 2023 23:41:29 -0700
Message-Id: <20230731064133.3881-3-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731064133.3881-1-xin3.li@intel.com>
References: <20230731064133.3881-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Export fred_entrypoint_kernel() for handling NMI in NMI induced VM exits.

Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/entry/entry_64_fred.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/entry/entry_64_fred.S b/arch/x86/entry/entry_64_fred.S
index d24bf7f10ac8..12063267d2ac 100644
--- a/arch/x86/entry/entry_64_fred.S
+++ b/arch/x86/entry/entry_64_fred.S
@@ -4,6 +4,7 @@
  */
 
 #include <asm/asm.h>
+#include <asm/export.h>
 #include <asm/fred.h>
 
 #include "calling.h"
@@ -54,3 +55,4 @@ SYM_CODE_START_NOALIGN(fred_entrypoint_kernel)
 	FRED_EXIT
 	ERETS
 SYM_CODE_END(fred_entrypoint_kernel)
+EXPORT_SYMBOL(fred_entrypoint_kernel)
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:10:22 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:10:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572722.896756 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN2s-0002Cs-OD; Mon, 31 Jul 2023 07:10:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572722.896756; Mon, 31 Jul 2023 07:10:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN2s-0002Bg-KK; Mon, 31 Jul 2023 07:10:22 +0000
Received: by outflank-mailman (input) for mailman id 572722;
 Mon, 31 Jul 2023 07:10:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQN2r-00082R-Iq
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:10:21 +0000
Received: from mgamail.intel.com (unknown [134.134.136.31])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4eaa67a3-2f71-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:10:19 +0200 (CEST)
Received: from fmsmga004.fm.intel.com ([10.253.24.48])
 by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:10:13 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga004.fm.intel.com with ESMTP; 31 Jul 2023 00:10:09 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4eaa67a3-2f71-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690787419; x=1722323419;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=g76n0qqOm69A/O2uudI0FugS1H+Frufn6xIPQbl7rb0=;
  b=JPuhIYzpH6H4s8kKu+qdo5s+M8ul37eCfJR12xhkmS9nDdVbErviuSQQ
   ufhtYITzWOoe69Uq2C2/YMU9vB98LxTH58uh3NstKWLeuRAHIETVuxzx7
   /Bcu2+yr62Nz0EfkMPk1wPc6prXoMbHppVFAwj6Y5SinpLet0Lp33+1nZ
   MDvbNJaqHZHP1aG+VD2Tf4xNhOb6B9YovbSF1EchmZh2DA0qyyQsbBKHz
   oEHqPZdWemKNJHmlmn9ixabfXjqaU0XOiFWspIPc2q228A0N1UtQRHAtm
   vym0SlCESOwR7LAv+ojFW020NpytWa1o1imI+xhY5prQZhx1gnnDJhBzb
   g==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="432750181"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="432750181"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="798157799"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="798157799"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 34/36] x86/syscall: Split IDT syscall setup code into idt_syscall_init()
Date: Sun, 30 Jul 2023 23:41:31 -0700
Message-Id: <20230731064133.3881-5-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731064133.3881-1-xin3.li@intel.com>
References: <20230731064133.3881-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Split IDT syscall setup code into idt_syscall_init() to make it
cleaner to add FRED syscall setup code.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---
 arch/x86/kernel/cpu/common.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 331b06d19f7f..bb03dacc5fb8 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -2027,10 +2027,8 @@ static void wrmsrl_cstar(unsigned long val)
 		wrmsrl(MSR_CSTAR, val);
 }
 
-/* May not be marked __init: used by software suspend */
-void syscall_init(void)
+static inline void idt_syscall_init(void)
 {
-	wrmsr(MSR_STAR, 0, (__USER32_CS << 16) | __KERNEL_CS);
 	wrmsrl(MSR_LSTAR, (unsigned long)entry_SYSCALL_64);
 
 #ifdef CONFIG_IA32_EMULATION
@@ -2064,6 +2062,15 @@ void syscall_init(void)
 	       X86_EFLAGS_AC|X86_EFLAGS_ID);
 }
 
+/* May not be marked __init: used by software suspend */
+void syscall_init(void)
+{
+	/* The default user and kernel segments */
+	wrmsr(MSR_STAR, 0, (__USER32_CS << 16) | __KERNEL_CS);
+
+	idt_syscall_init();
+}
+
 #else	/* CONFIG_X86_64 */
 
 #ifdef CONFIG_STACKPROTECTOR
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:10:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:10:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572723.896768 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN2u-0002Wx-5e; Mon, 31 Jul 2023 07:10:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572723.896768; Mon, 31 Jul 2023 07:10:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN2u-0002W6-0c; Mon, 31 Jul 2023 07:10:24 +0000
Received: by outflank-mailman (input) for mailman id 572723;
 Mon, 31 Jul 2023 07:10:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQN2s-00082R-Is
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:10:22 +0000
Received: from mgamail.intel.com (unknown [134.134.136.31])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4e1eb71b-2f71-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:10:20 +0200 (CEST)
Received: from fmsmga004.fm.intel.com ([10.253.24.48])
 by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:10:13 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga004.fm.intel.com with ESMTP; 31 Jul 2023 00:10:09 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4e1eb71b-2f71-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690787420; x=1722323420;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=nRz3qqnddKXYmfF22m/o97+CO0o46xEgUK6odjAvUmY=;
  b=aHSiz+tu5rimEGmJNwK1yDTcD8u1Vaal46D3lmli46lf5T/d8Lw0F4C+
   qETYOVhJLPF/na5vsBFoADpUf6iP+j2O5j4DAg26LRBPEn9MnU97v9A7T
   Cg41EdbEm3EJ9JgL/Fu+LjCaDqx32+cxxYm1/MnOQzwg3fstTiiAHgDvS
   G3SLPBDvKmKsSaLauPPVyxunHSkHBtXq6riZDVzXChTZsyeRYsyL8eB0c
   17dxGI7VUdY32TolGEty1erbdnjnJt+sR/pNrodtiDE9EIh2AkO6kiqhS
   ga+AP4Zn0qtj+skHz2vh3Dnko1+Z/BIBSalGQlF4MC/99FYYbGmKGlgTS
   Q==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="432750173"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="432750173"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="798157787"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="798157787"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 33/36] KVM: VMX: Add VMX_DO_FRED_EVENT_IRQOFF for IRQ/NMI handling
Date: Sun, 30 Jul 2023 23:41:30 -0700
Message-Id: <20230731064133.3881-4-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731064133.3881-1-xin3.li@intel.com>
References: <20230731064133.3881-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Compared to an IDT stack frame, a FRED stack frame has extra 16 bytes of
information pushed at the regular stack top and 8 bytes of error code _always_
pushed at the regular stack bottom, add VMX_DO_FRED_EVENT_IRQOFF to generate
FRED stack frames with event type and vector properly set. Thus, IRQ/NMI can
be handled with the existing approach when FRED is enabled.

For IRQ handling, general purpose registers are pushed to the stack to form
a pt_regs structure, which is then used to call external_interrupt(). As a
result, IRQ handling no longer re-enters the noinstr code.

Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---

Changes since v8:
* Add a new macro VMX_DO_FRED_EVENT_IRQOFF for FRED instead of refactoring
  VMX_DO_EVENT_IRQOFF (Sean Christopherson).
* Do NOT use a trampoline, just LEA+PUSH the return RIP, PUSH the error code,
  and jump to the FRED kernel entry point for NMI or call external_interrupt()
  for IRQs (Sean Christopherson).
* Call external_interrupt() only when FRED is enabled, and convert the non-FRED
  handling to external_interrupt() after FRED lands (Sean Christopherson).
---
 arch/x86/kvm/vmx/vmenter.S | 88 ++++++++++++++++++++++++++++++++++++++
 arch/x86/kvm/vmx/vmx.c     | 19 ++++++--
 2 files changed, 104 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kvm/vmx/vmenter.S b/arch/x86/kvm/vmx/vmenter.S
index 07e927d4d099..5ee6a57b59a5 100644
--- a/arch/x86/kvm/vmx/vmenter.S
+++ b/arch/x86/kvm/vmx/vmenter.S
@@ -2,12 +2,14 @@
 #include <linux/linkage.h>
 #include <asm/asm.h>
 #include <asm/bitsperlong.h>
+#include <asm/fred.h>
 #include <asm/kvm_vcpu_regs.h>
 #include <asm/nospec-branch.h>
 #include <asm/percpu.h>
 #include <asm/segment.h>
 #include "kvm-asm-offsets.h"
 #include "run_flags.h"
+#include "../../entry/calling.h"
 
 #define WORD_SIZE (BITS_PER_LONG / 8)
 
@@ -31,6 +33,80 @@
 #define VCPU_R15	__VCPU_REGS_R15 * WORD_SIZE
 #endif
 
+#ifdef CONFIG_X86_FRED
+.macro VMX_DO_FRED_EVENT_IRQOFF branch_insn branch_target nmi=0
+	/*
+	 * Unconditionally create a stack frame, getting the correct RSP on the
+	 * stack (for x86-64) would take two instructions anyways, and RBP can
+	 * be used to restore RSP to make objtool happy (see below).
+	 */
+	push %_ASM_BP
+	mov %_ASM_SP, %_ASM_BP
+
+	/*
+	 * Don't check the FRED stack level, the call stack leading to this
+	 * helper is effectively constant and shallow (relatively speaking).
+	 *
+	 * Emulate the FRED-defined redzone and stack alignment.
+	 */
+	sub $(FRED_CONFIG_REDZONE_AMOUNT << 6), %rsp
+	and $FRED_STACK_FRAME_RSP_MASK, %rsp
+
+	/*
+	 * A FRED stack frame has extra 16 bytes of information pushed at the
+	 * regular stack top compared to an IDT stack frame.
+	 */
+	push $0		/* Reserved by FRED, must be 0 */
+	push $0		/* FRED event data, 0 for NMI and external interrupts */
+
+	shl $32, %rdi				/* FRED event type and vector */
+	.if \nmi
+	bts $FRED_SSX_NMI_BIT, %rdi		/* Set the NMI bit */
+	.endif
+	bts $FRED_SSX_64_BIT_MODE_BIT, %rdi	/* Set the 64-bit mode */
+	or $__KERNEL_DS, %rdi
+	push %rdi
+	push %rbp
+	pushf
+	mov $__KERNEL_CS, %rax
+	push %rax
+
+	/*
+	 * Unlike the IDT event delivery, FRED _always_ pushes an error code
+	 * after pushing the return RIP, thus the CALL instruction CANNOT be
+	 * used here to push the return RIP, otherwise there is no chance to
+	 * push an error code before invoking the IRQ/NMI handler.
+	 *
+	 * Use LEA to get the return RIP and push it, then push an error code.
+	 */
+	lea 1f(%rip), %rax
+	push %rax
+	push $0		/* FRED error code, 0 for NMI and external interrupts */
+
+	.if \nmi == 0
+	PUSH_REGS
+	mov %rsp, %rdi
+	.endif
+
+	\branch_insn \branch_target
+
+	.if \nmi == 0
+	POP_REGS
+	.endif
+
+1:
+	/*
+	 * "Restore" RSP from RBP, even though IRET has already unwound RSP to
+	 * the correct value.  objtool doesn't know the callee will IRET and,
+	 * without the explicit restore, thinks the stack is getting walloped.
+	 * Using an unwind hint is problematic due to x86-64's dynamic alignment.
+	 */
+	mov %_ASM_BP, %_ASM_SP
+	pop %_ASM_BP
+	RET
+.endm
+#endif
+
 .macro VMX_DO_EVENT_IRQOFF call_insn call_target
 	/*
 	 * Unconditionally create a stack frame, getting the correct RSP on the
@@ -299,6 +375,12 @@ SYM_INNER_LABEL_ALIGN(vmx_vmexit, SYM_L_GLOBAL)
 
 SYM_FUNC_END(__vmx_vcpu_run)
 
+#ifdef CONFIG_X86_FRED
+SYM_FUNC_START(vmx_do_fred_nmi_irqoff)
+	VMX_DO_FRED_EVENT_IRQOFF jmp fred_entrypoint_kernel nmi=1
+SYM_FUNC_END(vmx_do_fred_nmi_irqoff)
+#endif
+
 SYM_FUNC_START(vmx_do_nmi_irqoff)
 	VMX_DO_EVENT_IRQOFF call asm_exc_nmi_kvm_vmx
 SYM_FUNC_END(vmx_do_nmi_irqoff)
@@ -357,6 +439,12 @@ SYM_FUNC_START(vmread_error_trampoline)
 SYM_FUNC_END(vmread_error_trampoline)
 #endif
 
+#ifdef CONFIG_X86_FRED
+SYM_FUNC_START(vmx_do_fred_interrupt_irqoff)
+	VMX_DO_FRED_EVENT_IRQOFF call external_interrupt
+SYM_FUNC_END(vmx_do_fred_interrupt_irqoff)
+#endif
+
 SYM_FUNC_START(vmx_do_interrupt_irqoff)
 	VMX_DO_EVENT_IRQOFF CALL_NOSPEC _ASM_ARG1
 SYM_FUNC_END(vmx_do_interrupt_irqoff)
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 0ecf4be2c6af..4e90c69a92bf 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -6890,6 +6890,14 @@ static void vmx_apicv_post_state_restore(struct kvm_vcpu *vcpu)
 	memset(vmx->pi_desc.pir, 0, sizeof(vmx->pi_desc.pir));
 }
 
+#ifdef CONFIG_X86_FRED
+void vmx_do_fred_interrupt_irqoff(unsigned int vector);
+void vmx_do_fred_nmi_irqoff(unsigned int vector);
+#else
+#define vmx_do_fred_interrupt_irqoff(x) BUG()
+#define vmx_do_fred_nmi_irqoff(x) BUG()
+#endif
+
 void vmx_do_interrupt_irqoff(unsigned long entry);
 void vmx_do_nmi_irqoff(void);
 
@@ -6932,14 +6940,16 @@ static void handle_external_interrupt_irqoff(struct kvm_vcpu *vcpu)
 {
 	u32 intr_info = vmx_get_intr_info(vcpu);
 	unsigned int vector = intr_info & INTR_INFO_VECTOR_MASK;
-	gate_desc *desc = (gate_desc *)host_idt_base + vector;
 
 	if (KVM_BUG(!is_external_intr(intr_info), vcpu->kvm,
 	    "unexpected VM-Exit interrupt info: 0x%x", intr_info))
 		return;
 
 	kvm_before_interrupt(vcpu, KVM_HANDLING_IRQ);
-	vmx_do_interrupt_irqoff(gate_offset(desc));
+	if (cpu_feature_enabled(X86_FEATURE_FRED))
+		vmx_do_fred_interrupt_irqoff(vector);	/* Event type is 0 */
+	else
+		vmx_do_interrupt_irqoff(gate_offset((gate_desc *)host_idt_base + vector));
 	kvm_after_interrupt(vcpu);
 
 	vcpu->arch.at_instruction_boundary = true;
@@ -7225,7 +7235,10 @@ static noinstr void vmx_vcpu_enter_exit(struct kvm_vcpu *vcpu,
 	if ((u16)vmx->exit_reason.basic == EXIT_REASON_EXCEPTION_NMI &&
 	    is_nmi(vmx_get_intr_info(vcpu))) {
 		kvm_before_interrupt(vcpu, KVM_HANDLING_NMI);
-		vmx_do_nmi_irqoff();
+		if (cpu_feature_enabled(X86_FEATURE_FRED))
+			vmx_do_fred_nmi_irqoff((EVENT_TYPE_NMI << 16) | NMI_VECTOR);
+		else
+			vmx_do_nmi_irqoff();
 		kvm_after_interrupt(vcpu);
 	}
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:10:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:10:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572724.896778 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN2v-0002q7-J8; Mon, 31 Jul 2023 07:10:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572724.896778; Mon, 31 Jul 2023 07:10:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQN2v-0002pE-F0; Mon, 31 Jul 2023 07:10:25 +0000
Received: by outflank-mailman (input) for mailman id 572724;
 Mon, 31 Jul 2023 07:10:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQN2t-00082R-JC
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:10:23 +0000
Received: from mgamail.intel.com (unknown [134.134.136.31])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 500f42bb-2f71-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:10:21 +0200 (CEST)
Received: from fmsmga004.fm.intel.com ([10.253.24.48])
 by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:10:15 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga004.fm.intel.com with ESMTP; 31 Jul 2023 00:10:12 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 500f42bb-2f71-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690787421; x=1722323421;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=lojZodI3hwQLsEtOWQ3jf2ThLdccjOvBbgNRJld8Dhw=;
  b=ZzLkz79Au34ynrRObUsVKyDmMMQjod6aaelwkcPN27vMnNiWqHAAY5gt
   UdQCsK3o+b8h2ZUPo/IxXqvI/9dtEiV5ZDEK72tasBst8fWX7V3yk9OdL
   MG1qQ0HXgdc08iO9baTsfwJF8A5Ib5CIrgUE85EbLSYO2Va1UdoHu8Zct
   KH6TES6QufDbR2/6kG9i4Lb9C2MFEnY6tx2hoh1V1/rv6WnYsNOZwpyye
   6nJeP0zTQHjD9ut2sX9pv7tr34/pUN5gwsY17Jp4pblCk52zQ9cH5XVqc
   xQJk79qRr1KXcROC+dcoZMmnvKiz5PDp8ZewueYrI3w1voaA6jUuAzgRJ
   Q==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="432750259"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="432750259"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="798157807"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="798157807"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 35/36] x86/fred: FRED initialization code
Date: Sun, 30 Jul 2023 23:41:32 -0700
Message-Id: <20230731064133.3881-6-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731064133.3881-1-xin3.li@intel.com>
References: <20230731064133.3881-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "H. Peter Anvin (Intel)" <hpa@zytor.com>

The code to initialize FRED when it's available and _not_ disabled.

cpu_init_fred_exceptions() is the core function to initialize FRED,
which
  1. Sets up FRED entrypoints for events happening in ring 0 and 3.
  2. Sets up a default stack for event handling.
  3. Sets up dedicated event stacks for DB/NMI/MC/DF, equivalent to
     the IDT IST stacks.
  4. Forces 32-bit system calls to use "int $0x80" only.
  5. Enables FRED and invalidtes IDT.

When the FRED is used, cpu_init_exception_handling() initializes FRED
through calling cpu_init_fred_exceptions(), otherwise it sets up TSS
IST and loads IDT.

As FRED uses the ring 3 FRED entrypoint for SYSCALL and SYSENTER,
it skips setting up SYSCALL/SYSENTER related MSRs, e.g., MSR_LSTAR.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Co-developed-by: Xin Li <xin3.li@intel.com>
Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---

Changes since v8:
* Move this patch after all required changes are in place (Thomas
  Gleixner).

Changes since v5:
* Add a comment for FRED stack level settings (Lai Jiangshan).
* Define #DB/NMI/#MC/#DF stack levels using macros.
---
 arch/x86/include/asm/fred.h  | 28 ++++++++++++++++
 arch/x86/include/asm/traps.h |  4 ++-
 arch/x86/kernel/Makefile     |  1 +
 arch/x86/kernel/cpu/common.c | 28 +++++++++++++---
 arch/x86/kernel/fred.c       | 64 ++++++++++++++++++++++++++++++++++++
 arch/x86/kernel/irqinit.c    |  7 +++-
 arch/x86/kernel/traps.c      | 11 ++++++-
 7 files changed, 135 insertions(+), 8 deletions(-)
 create mode 100644 arch/x86/kernel/fred.c

diff --git a/arch/x86/include/asm/fred.h b/arch/x86/include/asm/fred.h
index 3c91f0eae62e..6031138b778c 100644
--- a/arch/x86/include/asm/fred.h
+++ b/arch/x86/include/asm/fred.h
@@ -68,6 +68,19 @@
 #define FRED_SSX_64_BIT_MODE_BIT	57
 #define FRED_SSX_64_BIT_MODE		_BITUL(FRED_SSX_64_BIT_MODE_BIT)
 
+/* #DB in the kernel would imply the use of a kernel debugger. */
+#define FRED_DB_STACK_LEVEL		1
+#define FRED_NMI_STACK_LEVEL		2
+#define FRED_MC_STACK_LEVEL		2
+/*
+ * #DF is the highest level because a #DF means "something went wrong
+ * *while delivering an exception*." The number of cases for which that
+ * can happen with FRED is drastically reduced and basically amounts to
+ * "the stack you pointed me to is broken." Thus, always change stacks
+ * on #DF, which means it should be at the highest level.
+ */
+#define FRED_DF_STACK_LEVEL		3
+
 /*
  * FRED event delivery establishes a full supervisor context by
  * saving the essential information about an event to a FRED
@@ -122,8 +135,23 @@ DECLARE_FRED_HANDLER(fred_exc_double_fault);
 extern asmlinkage __visible void fred_entrypoint_user(void);
 extern asmlinkage __visible void fred_entrypoint_kernel(void);
 
+void cpu_init_fred_exceptions(void);
+void fred_setup_apic(void);
+
 #endif /* __ASSEMBLY__ */
 
+#else
+#ifndef __ASSEMBLY__
+static inline void cpu_init_fred_exceptions(void)
+{
+	BUG();
+}
+
+static inline void fred_setup_apic(void)
+{
+	BUG();
+}
+#endif
 #endif /* CONFIG_X86_FRED */
 
 #endif /* ASM_X86_FRED_H */
diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h
index 48daa78ee88c..da7e8ab1d66d 100644
--- a/arch/x86/include/asm/traps.h
+++ b/arch/x86/include/asm/traps.h
@@ -49,6 +49,7 @@ void __noreturn handle_stack_overflow(struct pt_regs *regs,
 
 #ifdef CONFIG_X86_64
 inline void set_sysvec_handler(unsigned int i, system_interrupt_handler func);
+bool is_sysvec_used(unsigned int i);
 
 static inline void sysvec_setup_fred(unsigned int vector, system_interrupt_handler func)
 {
@@ -63,7 +64,8 @@ static inline void sysvec_setup_fred(unsigned int vector, system_interrupt_handl
 
 #define sysvec_install(vector, func) {					\
 	sysvec_setup_fred(vector, func);				\
-	alloc_intr_gate(vector, asm_##func);				\
+	if (!cpu_feature_enabled(X86_FEATURE_FRED))			\
+		alloc_intr_gate(vector, asm_##func);			\
 }
 
 int external_interrupt(struct pt_regs *regs);
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 4070a01c11b7..46d8daa11c17 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -48,6 +48,7 @@ obj-y			+= platform-quirks.o
 obj-y			+= process_$(BITS).o signal.o signal_$(BITS).o
 obj-y			+= traps.o idt.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
 obj-y			+= time.o ioport.o dumpstack.o nmi.o
+obj-$(CONFIG_X86_FRED)	+= fred.o
 obj-$(CONFIG_MODIFY_LDT_SYSCALL)	+= ldt.o
 obj-y			+= setup.o x86_init.o i8259.o irqinit.o
 obj-$(CONFIG_JUMP_LABEL)	+= jump_label.o
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index bb03dacc5fb8..b34a8a138755 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -62,6 +62,7 @@
 #include <asm/microcode_intel.h>
 #include <asm/intel-family.h>
 #include <asm/cpu_device_id.h>
+#include <asm/fred.h>
 #include <asm/uv/uv.h>
 #include <asm/set_memory.h>
 #include <asm/traps.h>
@@ -2062,13 +2063,24 @@ static inline void idt_syscall_init(void)
 	       X86_EFLAGS_AC|X86_EFLAGS_ID);
 }
 
+static inline void fred_syscall_init(void)
+{
+	/* Both sysexit and sysret cause #UD when FRED is enabled */
+	wrmsrl_safe(MSR_IA32_SYSENTER_CS, (u64)GDT_ENTRY_INVALID_SEG);
+	wrmsrl_safe(MSR_IA32_SYSENTER_ESP, 0ULL);
+	wrmsrl_safe(MSR_IA32_SYSENTER_EIP, 0ULL);
+}
+
 /* May not be marked __init: used by software suspend */
 void syscall_init(void)
 {
 	/* The default user and kernel segments */
 	wrmsr(MSR_STAR, 0, (__USER32_CS << 16) | __KERNEL_CS);
 
-	idt_syscall_init();
+	if (cpu_feature_enabled(X86_FEATURE_FRED))
+		fred_syscall_init();
+	else
+		idt_syscall_init();
 }
 
 #else	/* CONFIG_X86_64 */
@@ -2184,8 +2196,6 @@ void cpu_init_exception_handling(void)
 	/* paranoid_entry() gets the CPU number from the GDT */
 	setup_getcpu(cpu);
 
-	/* IST vectors need TSS to be set up. */
-	tss_setup_ist(tss);
 	tss_setup_io_bitmap(tss);
 	set_tss_desc(cpu, &get_cpu_entry_area(cpu)->tss.x86_tss);
 
@@ -2194,8 +2204,16 @@ void cpu_init_exception_handling(void)
 	/* GHCB needs to be setup to handle #VC. */
 	setup_ghcb();
 
-	/* Finally load the IDT */
-	load_current_idt();
+	if (cpu_feature_enabled(X86_FEATURE_FRED)) {
+		/* Set up FRED exception handling */
+		cpu_init_fred_exceptions();
+	} else {
+		/* IST vectors need TSS to be set up. */
+		tss_setup_ist(tss);
+
+		/* Finally load the IDT */
+		load_current_idt();
+	}
 }
 
 /*
diff --git a/arch/x86/kernel/fred.c b/arch/x86/kernel/fred.c
new file mode 100644
index 000000000000..7fdf79c964a8
--- /dev/null
+++ b/arch/x86/kernel/fred.c
@@ -0,0 +1,64 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#include <linux/kernel.h>
+
+#include <asm/desc.h>
+#include <asm/fred.h>
+#include <asm/tlbflush.h>
+#include <asm/traps.h>
+
+void cpu_init_fred_exceptions(void)
+{
+	wrmsrl(MSR_IA32_FRED_CONFIG,
+	       /* Reserve for CALL emulation */
+	       FRED_CONFIG_REDZONE |
+	       FRED_CONFIG_INT_STKLVL(0) |
+	       FRED_CONFIG_ENTRYPOINT(fred_entrypoint_user));
+
+	/*
+	 * The purpose of separate stacks for NMI, #DB and #MC *in the kernel*
+	 * (remember that user space faults are always taken on stack level 0)
+	 * is to avoid overflowing the kernel stack.
+	 */
+	wrmsrl(MSR_IA32_FRED_STKLVLS,
+	       FRED_STKLVL(X86_TRAP_DB,  FRED_DB_STACK_LEVEL) |
+	       FRED_STKLVL(X86_TRAP_NMI, FRED_NMI_STACK_LEVEL) |
+	       FRED_STKLVL(X86_TRAP_MC,  FRED_MC_STACK_LEVEL) |
+	       FRED_STKLVL(X86_TRAP_DF,  FRED_DF_STACK_LEVEL));
+
+	/* The FRED equivalents to IST stacks... */
+	wrmsrl(MSR_IA32_FRED_RSP1, __this_cpu_ist_top_va(DB));
+	wrmsrl(MSR_IA32_FRED_RSP2, __this_cpu_ist_top_va(NMI));
+	wrmsrl(MSR_IA32_FRED_RSP3, __this_cpu_ist_top_va(DF));
+
+	/* Not used with FRED */
+	wrmsrl(MSR_LSTAR, 0ULL);
+	wrmsrl(MSR_CSTAR, 0ULL);
+	wrmsrl_safe(MSR_IA32_SYSENTER_CS,  (u64)GDT_ENTRY_INVALID_SEG);
+	wrmsrl_safe(MSR_IA32_SYSENTER_ESP, 0ULL);
+	wrmsrl_safe(MSR_IA32_SYSENTER_EIP, 0ULL);
+
+	/* Enable FRED */
+	cr4_set_bits(X86_CR4_FRED);
+	/* Any further IDT use is a bug */
+	idt_invalidate();
+
+	/* Use int $0x80 for 32-bit system calls in FRED mode */
+	setup_clear_cpu_cap(X86_FEATURE_SYSENTER32);
+	setup_clear_cpu_cap(X86_FEATURE_SYSCALL32);
+}
+
+/*
+ * Initialize system vectors from a FRED perspective, so
+ * lapic_assign_system_vectors() can do its job.
+ */
+void __init fred_setup_apic(void)
+{
+	int i;
+
+	for (i = 0; i < FIRST_EXTERNAL_VECTOR; i++)
+		set_bit(i, system_vectors);
+
+	for (i = 0; i < NR_SYSTEM_VECTORS; i++)
+		if (is_sysvec_used(i))
+			set_bit(i + FIRST_SYSTEM_VECTOR, system_vectors);
+}
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c
index c683666876f1..2a510f72dd11 100644
--- a/arch/x86/kernel/irqinit.c
+++ b/arch/x86/kernel/irqinit.c
@@ -28,6 +28,7 @@
 #include <asm/setup.h>
 #include <asm/i8259.h>
 #include <asm/traps.h>
+#include <asm/fred.h>
 #include <asm/prom.h>
 
 /*
@@ -96,7 +97,11 @@ void __init native_init_IRQ(void)
 	/* Execute any quirks before the call gates are initialised: */
 	x86_init.irqs.pre_vector_init();
 
-	idt_setup_apic_and_irq_gates();
+	if (cpu_feature_enabled(X86_FEATURE_FRED))
+		fred_setup_apic();
+	else
+		idt_setup_apic_and_irq_gates();
+
 	lapic_assign_system_vectors();
 
 	if (!acpi_ioapic && !of_ioapic && nr_legacy_irqs()) {
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 6143ad56008e..21eeba7b188f 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -1542,6 +1542,12 @@ void set_sysvec_handler(unsigned int i, system_interrupt_handler func)
 	system_interrupt_handlers[i] = func;
 }
 
+bool is_sysvec_used(unsigned int i)
+{
+	BUG_ON(i >= NR_SYSTEM_VECTORS);
+	return system_interrupt_handlers[i] != dispatch_table_spurious_interrupt;
+}
+
 int external_interrupt(struct pt_regs *regs)
 {
 	unsigned int vector = regs->vector;
@@ -1577,7 +1583,10 @@ void __init trap_init(void)
 
 	/* Initialize TSS before setting up traps so ISTs work */
 	cpu_init_exception_handling();
+
 	/* Setup traps as cpu_init() might #GP */
-	idt_setup_traps();
+	if (!cpu_feature_enabled(X86_FEATURE_FRED))
+		idt_setup_traps();
+
 	cpu_init();
 }
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:18:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:18:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572758.896788 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQNAO-0005YS-Da; Mon, 31 Jul 2023 07:18:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572758.896788; Mon, 31 Jul 2023 07:18:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQNAO-0005YJ-Ac; Mon, 31 Jul 2023 07:18:08 +0000
Received: by outflank-mailman (input) for mailman id 572758;
 Mon, 31 Jul 2023 07:18:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQN2u-00082R-Uc
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:10:24 +0000
Received: from mgamail.intel.com (unknown [134.134.136.31])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 515b0ea7-2f71-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:10:24 +0200 (CEST)
Received: from fmsmga004.fm.intel.com ([10.253.24.48])
 by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 00:10:15 -0700
Received: from unknown (HELO fred..) ([172.25.112.68])
 by fmsmga004.fm.intel.com with ESMTP; 31 Jul 2023 00:10:14 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 515b0ea7-2f71-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690787424; x=1722323424;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=gEY4ZGGaaQpe3vscglEO/Z/ZNgQa2ejE/Ek77q9vAj0=;
  b=UnFfQfnNJscnWT6RKTRE2tctXo5xUHWP0H+pc6ZuyywJjgV+/VrFyVuU
   3ljOHSVdPG8Zax0j1k2o93t75U31HpW1VlAxqCC759PaAjAElCjZTiRmr
   j77KUko2fnya6nkxyv/PcRWroNtlUUJPIhcIOnoXcAE71Y+VV8Hx6MoXu
   nDim3MZ0Nz08nVaEsXagIGCqhMWf8Aczs1949SE/gN6KJeuBRiBM6IUZr
   S3mQ/PdYh55/4mJc1TyxDWM5syVn6jCUh273vHVrPI9w+JzQHV2pFkEwT
   x0qBU5TnInRLUp25I0Ch4V1XCzwwgelIqRj7LL0n1WVegv1d03VclrMSh
   g==;
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="432750287"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="432750287"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="798157816"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="798157816"
From: Xin Li <xin3.li@intel.com>
To: linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org,
	linux-hyperv@vger.kernel.org,
	kvm@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Tony Luck <tony.luck@intel.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kim Phillips <kim.phillips@amd.com>,
	Xin Li <xin3.li@intel.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	"Liam R . Howlett" <Liam.Howlett@Oracle.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Jim Mattson <jmattson@google.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Daniel Sneddon <daniel.sneddon@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Brian Gerst <brgerst@gmail.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Ze Gao <zegao2021@gmail.com>,
	Fei Li <fei1.li@intel.com>,
	Conghui <conghui.chen@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	Jane Malalane <jane.malalane@citrix.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Subject: [PATCH v9 36/36] x86/fred: Disable FRED by default in its early stage
Date: Sun, 30 Jul 2023 23:41:33 -0700
Message-Id: <20230731064133.3881-7-xin3.li@intel.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731064133.3881-1-xin3.li@intel.com>
References: <20230731064133.3881-1-xin3.li@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Disable FRED by default in its early stage.

To enable FRED, a new kernel command line option "fred" needs to be added.

Tested-by: Shan Kang <shan.kang@intel.com>
Signed-off-by: Xin Li <xin3.li@intel.com>
---

Changes since v7:
* Add a log message when FRED is enabled.
---
 Documentation/admin-guide/kernel-parameters.txt | 4 ++++
 arch/x86/kernel/cpu/common.c                    | 3 +++
 arch/x86/kernel/fred.c                          | 3 +++
 3 files changed, 10 insertions(+)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index a1457995fd41..cb12decfcdc0 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1513,6 +1513,10 @@
 			Warning: use of this parameter will taint the kernel
 			and may cause unknown problems.
 
+	fred
+			Forcefully enable flexible return and event delivery,
+			which is otherwise disabled by default.
+
 	ftrace=[tracer]
 			[FTRACE] will set and start the specified tracer
 			as early as possible in order to facilitate early
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index b34a8a138755..38cf4f64a56e 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1451,6 +1451,9 @@ static void __init cpu_parse_early_param(void)
 	char *argptr = arg, *opt;
 	int arglen, taint = 0;
 
+	if (!cmdline_find_option_bool(boot_command_line, "fred"))
+		setup_clear_cpu_cap(X86_FEATURE_FRED);
+
 #ifdef CONFIG_X86_32
 	if (cmdline_find_option_bool(boot_command_line, "no387"))
 #ifdef CONFIG_MATH_EMULATION
diff --git a/arch/x86/kernel/fred.c b/arch/x86/kernel/fred.c
index 7fdf79c964a8..a4a726ea9fc2 100644
--- a/arch/x86/kernel/fred.c
+++ b/arch/x86/kernel/fred.c
@@ -8,6 +8,9 @@
 
 void cpu_init_fred_exceptions(void)
 {
+	/* When FRED is enabled by default, this log message may not needed */
+	pr_info("Initialize FRED on CPU%d\n", smp_processor_id());
+
 	wrmsrl(MSR_IA32_FRED_CONFIG,
 	       /* Reserve for CALL emulation */
 	       FRED_CONFIG_REDZONE |
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:34:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:34:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572769.896814 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQNQE-0008Q1-Av; Mon, 31 Jul 2023 07:34:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572769.896814; Mon, 31 Jul 2023 07:34:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQNQE-0008PI-64; Mon, 31 Jul 2023 07:34:30 +0000
Received: by outflank-mailman (input) for mailman id 572769;
 Mon, 31 Jul 2023 07:34:28 +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
 <SRS0=wefb=DR=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qQNQC-0008M2-O0
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:34:28 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id acffca73-2f74-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 09:34:26 +0200 (CEST)
Received: from nico.bugseng.com (unknown [147.123.100.131])
 by support.bugseng.com (Postfix) with ESMTPSA id 7FEE24EE0740;
 Mon, 31 Jul 2023 09:34:24 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: acffca73-2f74-11ee-8613-37d641c3527e
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH v2 1/4] x86: mechanically rename to address MISRA C:2012 Rule 5.3
Date: Mon, 31 Jul 2023 09:33:38 +0200
Message-Id: <b169d1c682254e682e6ed34f33481a768209ce9b.1690788513.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690788513.git.nicola.vetrini@bugseng.com>
References: <cover.1690788513.git.nicola.vetrini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rule 5.3 has the following headline:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope"

The renames done by this patch avoid shadowing from happening.
They are as follows:
- s/i/j/ in 'mce_action' (the shadowing here is due to macro
  'x86_mcinfo_lookup' that defines 'i' as a loop counter)
- s/desc/descriptor/ in '_hvm_load_entry'
- s/socket_info/sock_info/ in 'do_write_psr_msrs'

The parameter 'cpu_khz' that causes a violation in 'pit_init'
is unused, and hence can be removed.

Parameter 'debug_stack_lines' in 'compat_show_guest_stack' is removed,
since the shadowed static variable has the same purpose.

The declaration of 'init_e820' is renamed to be consistent with its
definition.

No functional changes.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
Changes in v2:
- removed renames for 'str' parameters
- removed parameter 'debug_stack_lines' from
  'compat_show_guest_stack'
---
 xen/arch/x86/cpu/mcheck/mce.c       | 8 ++++----
 xen/arch/x86/domain.c               | 2 +-
 xen/arch/x86/emul-i8254.c           | 2 +-
 xen/arch/x86/include/asm/e820.h     | 2 +-
 xen/arch/x86/include/asm/hvm/save.h | 8 ++++----
 xen/arch/x86/include/asm/hvm/vpt.h  | 2 +-
 xen/arch/x86/psr.c                  | 4 ++--
 xen/arch/x86/traps.c                | 5 ++---
 8 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index c2173cfc78..2dbed604b1 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1746,7 +1746,7 @@ static enum mce_result mce_action(const struct cpu_user_regs *regs,
     struct mcinfo_common *mic = NULL;
     struct mca_binfo binfo;
     const struct mca_error_handler *handlers = mce_dhandlers;
-    unsigned int i, handler_num = mce_dhandler_num;
+    unsigned int j, handler_num = mce_dhandler_num;

     /* When in mce context, regs is valid */
     if ( regs )
@@ -1780,11 +1780,11 @@ static enum mce_result mce_action(const struct cpu_user_regs *regs,
         binfo.mib = (struct mcinfo_bank *)mic;
         binfo.bank = binfo.mib->mc_bank;
         bank_result = MCER_NOERROR;
-        for ( i = 0; i < handler_num; i++ )
+        for ( j = 0; j < handler_num; j++ )
         {
-            if ( handlers[i].owned_error(binfo.mib->mc_status) )
+            if ( handlers[j].owned_error(binfo.mib->mc_status) )
             {
-                handlers[i].recovery_handler(&binfo, &bank_result, regs);
+                handlers[j].recovery_handler(&binfo, &bank_result, regs);
                 if ( worst_result < bank_result )
                     worst_result = bank_result;
                 break;
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 5f66c2ae33..fe86a7f853 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -858,7 +858,7 @@ int arch_domain_create(struct domain *d,
     }

     /* PV/PVH guests get an emulated PIT too for video BIOSes to use. */
-    pit_init(d, cpu_khz);
+    pit_init(d);

     /*
      * If the FPU does not save FCS/FDS then we can always
diff --git a/xen/arch/x86/emul-i8254.c b/xen/arch/x86/emul-i8254.c
index a81232fc55..41ec4a1ef1 100644
--- a/xen/arch/x86/emul-i8254.c
+++ b/xen/arch/x86/emul-i8254.c
@@ -495,7 +495,7 @@ void pit_reset(struct domain *d)
     spin_unlock(&pit->lock);
 }

-void pit_init(struct domain *d, unsigned long cpu_khz)
+void pit_init(struct domain *d)
 {
     PITState *pit = domain_vpit(d);

diff --git a/xen/arch/x86/include/asm/e820.h b/xen/arch/x86/include/asm/e820.h
index 92f5efa4f5..213d5b5dd2 100644
--- a/xen/arch/x86/include/asm/e820.h
+++ b/xen/arch/x86/include/asm/e820.h
@@ -31,7 +31,7 @@ extern int e820_change_range_type(
     uint32_t orig_type, uint32_t new_type);
 extern int e820_add_range(
     struct e820map *, uint64_t s, uint64_t e, uint32_t type);
-extern unsigned long init_e820(const char *, struct e820map *);
+extern unsigned long init_e820(const char *str, struct e820map *raw);
 extern void print_e820_memory_map(const struct e820entry *map,
     unsigned int entries);
 extern struct e820map e820;
diff --git a/xen/arch/x86/include/asm/hvm/save.h b/xen/arch/x86/include/asm/hvm/save.h
index 535cf68ed2..4d0a062b2c 100644
--- a/xen/arch/x86/include/asm/hvm/save.h
+++ b/xen/arch/x86/include/asm/hvm/save.h
@@ -49,21 +49,21 @@ void _hvm_read_entry(struct hvm_domain_context *h,
  */
 #define _hvm_load_entry(_x, _h, _dst, _strict) ({                       \
     int r;                                                              \
-    struct hvm_save_descriptor *desc                                    \
+    struct hvm_save_descriptor *descriptor                              \
         = (struct hvm_save_descriptor *)&(_h)->data[(_h)->cur];         \
     if ( (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x),                 \
                HVM_SAVE_LENGTH(_x), (_strict))) == 0 )                  \
     {                                                                   \
         _hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH(_x));             \
         if ( HVM_SAVE_HAS_COMPAT(_x) &&                                 \
-             desc->length != HVM_SAVE_LENGTH(_x) )                      \
-            r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length);          \
+             descriptor->length != HVM_SAVE_LENGTH(_x) )                \
+            r = HVM_SAVE_FIX_COMPAT(_x, (_dst), descriptor->length);    \
     }                                                                   \
     else if (HVM_SAVE_HAS_COMPAT(_x)                                    \
              && (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x),          \
                        HVM_SAVE_LENGTH_COMPAT(_x), (_strict))) == 0 ) { \
         _hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH_COMPAT(_x));      \
-        r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length);              \
+        r = HVM_SAVE_FIX_COMPAT(_x, (_dst), descriptor->length);        \
     }                                                                   \
     r; })

diff --git a/xen/arch/x86/include/asm/hvm/vpt.h b/xen/arch/x86/include/asm/hvm/vpt.h
index 2af76ca8dc..feb0bf43f1 100644
--- a/xen/arch/x86/include/asm/hvm/vpt.h
+++ b/xen/arch/x86/include/asm/hvm/vpt.h
@@ -179,7 +179,7 @@ void destroy_periodic_time(struct periodic_time *pt);
 int pv_pit_handler(int port, int data, int write);
 void pit_reset(struct domain *d);

-void pit_init(struct domain *d, unsigned long cpu_khz);
+void pit_init(struct domain *d);
 void pit_stop_channel0_irq(PITState * pit);
 void pit_deinit(struct domain *d);
 void rtc_init(struct domain *d);
diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index a1e0af27c5..90bcb25e60 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -1252,7 +1252,7 @@ static void cf_check do_write_psr_msrs(void *data)
 {
     const struct cos_write_info *info = data;
     unsigned int i, index, cos = info->cos;
-    const struct psr_socket_info *socket_info =
+    const struct psr_socket_info *sock_info =
         get_socket_info(cpu_to_socket(smp_processor_id()));

     /*
@@ -1261,7 +1261,7 @@ static void cf_check do_write_psr_msrs(void *data)
      */
     for ( index = i = 0; i < ARRAY_SIZE(feat_props); i++ )
     {
-        struct feat_node *feat = socket_info->features[i];
+        struct feat_node *feat = sock_info->features[i];
         const struct feat_props *props = feat_props[i];
         unsigned int cos_num, j;

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 4229bda159..f11239fd0f 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -195,8 +195,7 @@ void show_code(const struct cpu_user_regs *regs)
 }

 static void compat_show_guest_stack(struct vcpu *v,
-                                    const struct cpu_user_regs *regs,
-                                    int debug_stack_lines)
+                                    const struct cpu_user_regs *regs)
 {
     unsigned int i, *stack, addr, mask = STACK_SIZE;
     void *stack_page = NULL;
@@ -273,7 +272,7 @@ static void show_guest_stack(struct vcpu *v, const struct cpu_user_regs *regs)

     if ( is_pv_32bit_vcpu(v) )
     {
-        compat_show_guest_stack(v, regs, debug_stack_lines);
+        compat_show_guest_stack(v, regs);
         return;
     }

--
2.34.1


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:34:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:34:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572768.896807 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQNQE-0008MY-1P; Mon, 31 Jul 2023 07:34:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572768.896807; Mon, 31 Jul 2023 07:34:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQNQD-0008MP-UP; Mon, 31 Jul 2023 07:34:29 +0000
Received: by outflank-mailman (input) for mailman id 572768;
 Mon, 31 Jul 2023 07:34:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=wefb=DR=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qQNQC-000873-Cq
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:34:28 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id adfdc37f-2f74-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:34:27 +0200 (CEST)
Received: from nico.bugseng.com (unknown [147.123.100.131])
 by support.bugseng.com (Postfix) with ESMTPSA id 221384EE0741;
 Mon, 31 Jul 2023 09:34:26 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: adfdc37f-2f74-11ee-b254-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH v2 2/4] x86/mm: remove variable to avoid shadowing
Date: Mon, 31 Jul 2023 09:33:39 +0200
Message-Id: <734fa59e3f1ee384a5481fb9952f79c8751f04cc.1690788513.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690788513.git.nicola.vetrini@bugseng.com>
References: <cover.1690788513.git.nicola.vetrini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The local variable 'p2mt' shadows a declaration of the same variable
in the enclosing scope, but removing the inner declaration
does not alter the semantics ('p2mt' is an output for the get_gfn
call later on) and this resolves a violation of
MISRA C:2012 Rule 5.3.

Both variables were last introduced by commit
d4f699a0df6cea907c1de5c277500b98c0729685.

No functional changes.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
Change in v2:
- removed the innermost p2mt instead of renaming it.
---
 xen/arch/x86/mm/p2m.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 714358f953..f6df35767a 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2439,8 +2439,6 @@ int xenmem_add_to_physmap_one(

     case XENMAPSPACE_gmfn:
     {
-        p2m_type_t p2mt;
-
         gfn = idx;
         mfn = get_gfn_unshare(d, gfn, &p2mt);
         /* If the page is still shared, exit early */
--
2.34.1


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:34:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:34:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572767.896798 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQNQA-00087G-Pd; Mon, 31 Jul 2023 07:34:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572767.896798; Mon, 31 Jul 2023 07:34:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQNQA-000879-Mc; Mon, 31 Jul 2023 07:34:26 +0000
Received: by outflank-mailman (input) for mailman id 572767;
 Mon, 31 Jul 2023 07:34:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=wefb=DR=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qQNQA-000873-7k
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:34:26 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ac2cf0d3-2f74-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:34:25 +0200 (CEST)
Received: from nico.bugseng.com (unknown [147.123.100.131])
 by support.bugseng.com (Postfix) with ESMTPSA id 05FDD4EE0737;
 Mon, 31 Jul 2023 09:34:22 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ac2cf0d3-2f74-11ee-b254-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	George Dunlap <george.dunlap@citrix.com>
Subject: [XEN PATCH v2 0/4] x86: address MISRA C:2012 Rule 5.3
Date: Mon, 31 Jul 2023 09:33:37 +0200
Message-Id: <cover.1690788513.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This series aims to address some violations of MISRA C:2012 Rule 5.3:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope".

To resolve such violations two strategies have been applied:

1. rename several function parameters or local variables;
2. remove a local variable declaration in an inner scope, if
   using the outer variable does not change the semantics of the function.

Nicola Vetrini (4):
  x86: mechanically rename to address MISRA C:2012 Rule 5.3
  x86/mm: remove variable to avoid shadowing
  x86emul: avoid shadowing to address MISRA C:2012 Rule 5.3
  x86emul: remove local variable to address MISRA C:2012 Rule 5.3

 xen/arch/x86/cpu/mcheck/mce.c          |  8 ++++----
 xen/arch/x86/domain.c                  |  2 +-
 xen/arch/x86/emul-i8254.c              |  2 +-
 xen/arch/x86/include/asm/e820.h        |  2 +-
 xen/arch/x86/include/asm/hvm/save.h    |  8 ++++----
 xen/arch/x86/include/asm/hvm/vpt.h     |  2 +-
 xen/arch/x86/mm/p2m.c                  |  2 --
 xen/arch/x86/psr.c                     |  4 ++--
 xen/arch/x86/traps.c                   |  5 ++---
 xen/arch/x86/x86_emulate/x86_emulate.c | 14 ++++++--------
 10 files changed, 22 insertions(+), 27 deletions(-)

--
2.34.1


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:34:32 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:34:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572770.896828 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQNQG-0000SI-Oi; Mon, 31 Jul 2023 07:34:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572770.896828; Mon, 31 Jul 2023 07:34:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQNQG-0000S6-Kc; Mon, 31 Jul 2023 07:34:32 +0000
Received: by outflank-mailman (input) for mailman id 572770;
 Mon, 31 Jul 2023 07:34:30 +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
 <SRS0=wefb=DR=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qQNQE-0008M2-SS
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:34:30 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id aee74a22-2f74-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 09:34:29 +0200 (CEST)
Received: from nico.bugseng.com (unknown [147.123.100.131])
 by support.bugseng.com (Postfix) with ESMTPSA id C3C774EE0742;
 Mon, 31 Jul 2023 09:34:27 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aee74a22-2f74-11ee-8613-37d641c3527e
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH v2 3/4] x86emul: avoid shadowing to address MISRA C:2012 Rule 5.3
Date: Mon, 31 Jul 2023 09:33:40 +0200
Message-Id: <951f634fe058ce56791f3e67f011a2218db6626d.1690788513.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690788513.git.nicola.vetrini@bugseng.com>
References: <cover.1690788513.git.nicola.vetrini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rule 5.3 has the following headline:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope"

The declaration of local variable 'cpuid_leaf' causes
shadowing with the homonymous function to happen, therefore
the variable is renamed to avoid this.

No functional changes.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
Changes in v2:
- s/res/leaf/ to have a less generic name.
- Split the patch in half (see patch 4/4).
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 2de1be7996..f811c1c76b 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1483,7 +1483,7 @@ x86_emulate(
     {
         enum x86_segment seg;
         struct segment_register cs, sreg;
-        struct cpuid_leaf cpuid_leaf;
+        struct cpuid_leaf leaf;
         uint64_t msr_val;
         unsigned int i, n;
         unsigned long dummy;
@@ -5024,13 +5024,13 @@ x86_emulate(
         generate_exception_if((msr_val & MSR_MISC_FEATURES_CPUID_FAULTING),
                               X86_EXC_GP, 0); /* Faulting active? (Inc. CPL test) */

-        rc = ops->cpuid(_regs.eax, _regs.ecx, &cpuid_leaf, ctxt);
+        rc = ops->cpuid(_regs.eax, _regs.ecx, &leaf, ctxt);
         if ( rc != X86EMUL_OKAY )
             goto done;
-        _regs.r(ax) = cpuid_leaf.a;
-        _regs.r(bx) = cpuid_leaf.b;
-        _regs.r(cx) = cpuid_leaf.c;
-        _regs.r(dx) = cpuid_leaf.d;
+        _regs.r(ax) = leaf.a;
+        _regs.r(bx) = leaf.b;
+        _regs.r(cx) = leaf.c;
+        _regs.r(dx) = leaf.d;
         break;

     case X86EMUL_OPC(0x0f, 0xa3): bt: /* bt */
--
2.34.1


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 07:34:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 07:34:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572771.896832 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQNQH-0000Uv-31; Mon, 31 Jul 2023 07:34:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572771.896832; Mon, 31 Jul 2023 07:34:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQNQG-0000Tz-TT; Mon, 31 Jul 2023 07:34:32 +0000
Received: by outflank-mailman (input) for mailman id 572771;
 Mon, 31 Jul 2023 07:34:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=wefb=DR=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qQNQF-000873-I9
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 07:34:31 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id aff1dfba-2f74-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 09:34:31 +0200 (CEST)
Received: from nico.bugseng.com (unknown [147.123.100.131])
 by support.bugseng.com (Postfix) with ESMTPSA id 68ED14EE0743;
 Mon, 31 Jul 2023 09:34:29 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aff1dfba-2f74-11ee-b254-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH v2 4/4] x86emul: remove local variable to address MISRA C:2012 Rule 5.3
Date: Mon, 31 Jul 2023 09:33:41 +0200
Message-Id: <d9ab52ae16d3c9a780403906db52b42f24c1e60a.1690788513.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690788513.git.nicola.vetrini@bugseng.com>
References: <cover.1690788513.git.nicola.vetrini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The local variable removed by this commit shadowed another declared in
an outer scope and thus violates Rule 5.3. It was introduced as part of
a refactoring by commit abf5fb62f73d0dbeabc6a8cd6dbb55174b36c8d1.

No functional changes.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index f811c1c76b..60bd2f8d8e 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -8408,8 +8408,6 @@ x86_emulate(
         generate_exception(X86_EXC_MF);
     if ( stub_exn.info.fields.trapnr == X86_EXC_XM )
     {
-        unsigned long cr4;
-
         if ( !ops->read_cr || ops->read_cr(4, &cr4, ctxt) != X86EMUL_OKAY )
             cr4 = X86_CR4_OSXMMEXCPT;
         generate_exception(cr4 & X86_CR4_OSXMMEXCPT ? X86_EXC_XM : X86_EXC_UD);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 08:00:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 08:00:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572808.896848 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQNp5-0005zf-Ef; Mon, 31 Jul 2023 08:00:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572808.896848; Mon, 31 Jul 2023 08:00:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQNp5-0005zY-BI; Mon, 31 Jul 2023 08:00:11 +0000
Received: by outflank-mailman (input) for mailman id 572808;
 Mon, 31 Jul 2023 08:00:10 +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 <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQNp4-0005zS-1f
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 08:00:10 +0000
Received: from EUR01-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur01on0603.outbound.protection.outlook.com
 [2a01:111:f400:fe1f::603])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 43b07385-2f78-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 10:00:07 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM0PR04MB7123.eurprd04.prod.outlook.com (2603:10a6:208:197::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Mon, 31 Jul
 2023 08:00:04 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 08:00:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 43b07385-2f78-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=OM/mdpD/o91ilQ9EkZnHfiUVyY4R67hMIeJVjRxxYdcAPHEbsj6MkgglmEbbeA+5lW05SrQfrsLIziJtsMo1JCKDFKlfld+t+XQZRmga2qqNxYqngLjrvnFQaV2g6CirfX/g+kt1DtFxqoOAgxgqg/YePQi/iI7VmmsZUpIBnvWgRV1f4tF1TPhYDs6mXpBsNPyLydCZhGJFl3+2tlcM1qH7T3fpyqTPIT8QsL4YA6QaQGjRN8Bpf2bfHwDr10MLZu3AKs3Mjzp6dzQwPF+n8EC6oJcf5Z3mgdz9UW5QEwuxiGx3Woe8uR4IzyM7RpBoyK1nzT/cUge2XTBNyAf0Pw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=NTt3AA/EIOl1aXs66bZ5rhIuWTyLgTYN36E8OiDGz54=;
 b=iAJzW/6Yr6W75n2IcB14FtUMXl0WxZInbVjwCREoBBNMy7tPamdDDeCRDLEtKxpdKNTQ6sGPzpwlNguVzLMTlykKE0ZaNXJdEsae36ZaHUYK38p2Tj05qQCzFYzXBhnRXce5B3PuyjT8Knk4TBxY7QlRjRwQvQY0OdQDf+HNkhlRq/L7G64B2Hm5Xot4VFBG25Esbpp5q5jk11EwLDiCQ0hzcGeN874wSHPDx+bQFNdtEpdaSEvMKFztsOe0xwI5F03viRJMwg387LgQNhWBNi41IbfTTo8WwKffc0cvMiJBFjnyWtIImyL4SCvz0itv+mVNzexfeRUbktp2nsn/yw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=NTt3AA/EIOl1aXs66bZ5rhIuWTyLgTYN36E8OiDGz54=;
 b=rBj9tt5zwapaJzqrXftEGe/ZetvwPJgTr/Xei7cU0zv0tEbHpQUR2tPFDLKYOJMdFucsNnOFyYjmL3QoNp4yUpxmo7ihjkenvBgVTLKWlPqjXARBfRcyK+Z4Ht5NJSHuugYR/xGemMZo4zxP+Ra8W8YYN7HDp3L6EwYKY3szsTu0SSB4aHNuNOQ6UX+MM1ote8AZhEL0birhsWPdHW/y3rGSLXGcN1itNBh5qmjJmQrmBvexiT3ZULioHS95BpVef1O5Y79Okg2mtnUde3Xi+RwwlHnKkO7a95tiUI9pUgK6A+CvWhoAs4CggPV7v9Nl9XKGO/bxcgC4uEv6W25wyw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <06a3f79e-4345-7a4b-be57-728a8b01befd@suse.com>
Date: Mon, 31 Jul 2023 10:00:04 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [PATCH v2 5/5] pdx: Add CONFIG_HAS_PDX_COMPRESSION as a common
 Kconfig option
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
 <20230728075903.7838-6-alejandro.vallejo@cloud.com>
 <9f0b7ab4-090f-21ea-2cf8-6ecdc7c02225@citrix.com>
 <3470bc26-3cbc-e0de-53ae-203449493b51@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <3470bc26-3cbc-e0de-53ae-203449493b51@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0216.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ac::20) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM0PR04MB7123:EE_
X-MS-Office365-Filtering-Correlation-Id: ca773c2d-fdbc-4842-06a8-08db919c2630
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	M70XhP0DkatWteUQkyGHhefttzoZ534bRZCyyf2X43MNPSIYM/fnPV+tJbSAqUOCfBFBjZxiSLXSAXvXKEROW9FGXcF9xkDDW2guBKJ+tddoEPcuuVRMQmUrJysUU05TNwpcBkC5SxZMycJYtn87ptwjqkvcfjWMgQfx3yh0T1VTsNwMne87e76q+6KFsDDlkrj4xzjq5niswEFnYPJggiB4u57/X7fCVvS/zIqsp8/JFCvAn5s+qBCkj4qNuoom2jz7XZH1D952kIscVGv2oAntDSuIoEI3wJ/wWcm9g2iQpa3uUy562O5YpvCgx8Lf6/8OsKaJAf94ZX3ZIfvv4cAF9VuP+UbWGRWEktrwFCtKxI7D7TiimBxcWbJjqB0/iwdLWY6AAoka1LDnv+jqx/ArTIwIgJazpeGCvoEtLfOe2yC5MAQb2Ff7jgqpjxV0aryXgTgE/LYyrfokh5pKpccGmKbxFl/aTeH9PFGVgBWYa9BzKqslMTUfDJmO5WfpktLV7irCDxq/Q8DzMnRG5XlTNqQVJz9BwBF8UYPjdST8CwxpQ15Frop5R6f3pdSg1/DJXqV+bikCNy/YmnJAiPTR+mp8fQgbfyMTpCAthmW+iuxoN+h+pzr4Se/lm56HATpmPxCfqcU370Eaxoxdhw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(136003)(39860400002)(366004)(376002)(346002)(451199021)(31696002)(36756003)(86362001)(31686004)(2906002)(54906003)(478600001)(38100700002)(26005)(2616005)(53546011)(186003)(6916009)(6506007)(8936002)(7416002)(66556008)(5660300002)(6512007)(6486002)(8676002)(41300700001)(316002)(66946007)(66476007)(4326008)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QytLbEdQVWUvU3poM3pOUzV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utf-8?B?MWVRbDJvdWsxTUU2ZFlJYnhzKzdubHU4N2VmRFBQSk8rMTh5ckNrWWJlT0Vs?=
 =?utf-8?B?Z1ZNY29XakxGTHhpNXVCRFZmR0pTOEVwUG1nZDlpQXdBaXJab210RlRuU3BZ?=
 =?utf-8?B?T21yUndKWHA4OW1mdlpHMjlLSlFHL0NyUk1GM3J5REE5RlRvNDVlVUlVUU0z?=
 =?utf-8?B?eWNSeVVkbTN4emxuWmJRSkhBbHVYODJVNU1Hb2NseXV5aW90YkZHV1dIdnI3?=
 =?utf-8?B?ck9zSmtLRFFMQ0I4K1poQ3BNL01oVlBWRVJMeTNRa3NOL1ZTQ2lXYUJ5aXVx?=
 =?utf-8?B?WGNuUWFJdzZ6TjU1RGMxVk11UG5YR1BId0Mwc25INmZPajhXcDRkNjlhZEhI?=
 =?utf-8?Q?D2/Wd+72J7YF5aDlCi0xSEMVF?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ca773c2d-fdbc-4842-06a8-08db919c2630
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 08:00:04.6512
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: an/1GhBSMSHXTGTh/ATQ/R2UyqnKKsXiXRNUvkne+mD+ddE/89ULjlKbSpgptoUvotnmsD+mvtvTbUaj4HwzvQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7123

On 28.07.2023 18:58, Andrew Cooper wrote:
> On 28/07/2023 5:36 pm, Andrew Cooper wrote:
>> On 28/07/2023 8:59 am, Alejandro Vallejo wrote:
>>> Adds a new compile-time flag to allow disabling pdx compression and
>>> compiles out compression-related code/data. It also shorts the pdx<->pfn
>>> conversion macros and creates stubs for masking fucntions.
>>>
>>> While at it, removes the old arch-defined CONFIG_HAS_PDX flag, as it was
>>> not removable in practice.
>>>
>>> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
>>> ---
>>> v2:
>>>   * Merged v1/patch2: Removal of CONFIG_HAS_PDX here (Jan)
>> This series is now looking fine, except for the Kconfig aspect.
>>
>> This is not something any user or developer should ever be queried
>> about.Â  The feedback on the documentation patches alone show that it's
>> not understood well by the maintainers, even if the principle is accepted.
>>
>> There is never any reason to have this active on x86.

We can of course continue to disagree here. At least with EXPERT=y
selecting this option ought to remain possible for x86. Whether or
not the original systems this scheme was developed for ever went
public, such systems did (do) exist, and hence running Xen sensibly
on them (without losing all memory except that on node 0) ought to
be possible.

>Â  Indeed, Julien's
>> quick metric shows how much performance we waste by having it enabled.
> 
> Further to this, bloat-o-meter says net -30k of code and there are
> plenty of fastpaths getting a several cacheline reduction from this.

A similar reduction was achieved by the BMI2-alt-patching series I
had put together, yet you weren't willing to come to consensus on
it.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 08:25:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 08:25:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572816.896858 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQODi-0000CE-Bt; Mon, 31 Jul 2023 08:25:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572816.896858; Mon, 31 Jul 2023 08:25:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQODi-0000C7-9G; Mon, 31 Jul 2023 08:25:38 +0000
Received: by outflank-mailman (input) for mailman id 572816;
 Mon, 31 Jul 2023 08:25:37 +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 <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQODh-0000C1-Ny
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 08:25:37 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20618.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::618])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d293518f-2f7b-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 10:25:35 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB9402.eurprd04.prod.outlook.com (2603:10a6:10:36a::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 08:25:33 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 08:25:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d293518f-2f7b-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Jjj7K7MbQ4nnz5EQZIaa+U93o4kXLOiiCxLoAhmRO4jMf2OB25YlfAaioY3DlNk16RigKseVArghPrrw2inlCIDkE2UYYu6upTBHGdwLnznQ36ced28yhJR63KeZIEGzMgxXfFcsLY5/s7zgoDPTfIpXqJfU6WtG0mK6AdOv4/p59ZTNZjeNmy2qSsXaN6L5xDxQgkHKGqX1V65GMi++gMwjmOXD1wa5y0SOPPUYs+Q99iYfcBSn647OEuvti/e6NQBTWrxExqH8I4qsLb/8u2ION1oet+w8+/yJLV9k4m3/uifFCn3dG+OLt1GhU6CEnlVcNYJ9xBsi9UncxHAjew==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=j1IOJs6dM+ln2n+eWgja0/unZdHwdc6WKQG2w9VYQzc=;
 b=V92kkcnAttZxe2gLYPGBxuUaQ9kDeOeihFY2vWvf/dU+kn7pBMWmX3Eg1l18MuwXoOMrEmpuy7P7vocWR7iThNdQLj6bb1VZkkFS+dbh87v7oWOHigUKmQr4dCyVQXWOQMG9ti3VN5KxEtidVOFl6wrHOERrstA+mWPl0DgktjWENIgJbV+T38osDV2vfnfEYCzP7C8I2B7naaQPjwE4hKa5dy66McYXngGsbhzvPEWl6376ucGsaMKbo4nF8grDeylfCl/GhHSWCT9XTFtXKaUErCL36PftkRb9H2D8YEMtoTmR6ls+lnYrDTniUpe820NVOmc9xJDG/CVQSw6WJQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=j1IOJs6dM+ln2n+eWgja0/unZdHwdc6WKQG2w9VYQzc=;
 b=LptbSVTf81ZldtCbbJe1dqnPUIqhNo7g8cFXCGA/fmcdqV3icwob0WnUJA0L04eg+2bMpqIKwa1JmU0kwEV7sfgOKeYwTmEA3ivwmvMrtNPSu6YDzEXr6m0sZvZT/s6BYGd7avaQX2qecrQGHmqHX0TwCPyviisi7tKKGbiuKr3RybUpCe4QlT5R1bHT77Is23TxEG0hEGeoHXEqSwjMEgU01qZX7e+XvuUXnlC9qrxzsJpwHdGNtquzsp13SS6DPDoYFUM5+f7HB1YLCUhW3FOv/x+CuSIYpa8FXN8841lwsEaphzERso8Nq41lm8ItSXjpEmXnqHTSvJxXiz2jEw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <88fc0c4d-de8c-73ae-93ea-5df60a30493d@suse.com>
Date: Mon, 31 Jul 2023 10:25:32 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [PATCH 3/3] x86: Delete str()
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Roberto Bagnara <roberto.bagnara@bugseng.com>,
 Nicola Vetrini <nicola.vetrini@bugseng.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230728194320.3082120-1-andrew.cooper3@citrix.com>
 <20230728194320.3082120-4-andrew.cooper3@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230728194320.3082120-4-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0012.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:15::17) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB9402:EE_
X-MS-Office365-Filtering-Correlation-Id: 51eaba6c-bc7b-4530-b515-08db919fb554
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	etPWOv9ppDm8S2O3744ym+yyDi6u0/9V685ZUs58rjB30hWa6ZHSrP5OAd/SyqDAyQlgkomcaAO0mcInQ/fxf9uGi2j1ajNXF6qZ2w0IQQVnvvxC+AyeyxEa7ORhugKb5Ah4eJpt1JBDuZOBMkdgRembs3SMq7ltjE4xEEarRpcvSaDA7QGk7qB72Vs8+YEzZJfrvQWhtR4VxTG3c1AN6DRy5xvNIo1KqojKZCQa3+lGiJwbFgHKsfVcbyEtRjXqDsU18YgD5EoAIFIsw4I+ZtB35AIpBRUAKyHVoIt2Y+VjnhvYG/wiprOwCsBmv4SxrypTC4yUuNXtfawZs4w6KYWC5HROvR6TBRTciViwMSsNLX6VnM8dl9oNS8m0Y+jGHAy4AwDEqnexDIUT4/rtNHO44515J/196dOxZtDINMxRXV02fjhlRGAygTEvpZ87SBqGgjfPO4WGzCwW2y5iImBHJRPmr1OHlDrTSq82eCwMyOjxkq1uOxd2VlfVB33I+YsJZUmHkQczJXC2tqtgYoRUrJVl3Z6szHtGFrW+7Kf3IafDGXEal1oOTEGKENSHZise3GE/cYNVAFPwxsMjOYua3e28WFYpQ8212hLOgIUxP26A9hZqsqn3j+L1xTNwb/GoBcdqR39OK7RjXSEs8g==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(136003)(396003)(366004)(39860400002)(346002)(451199021)(66476007)(86362001)(31696002)(41300700001)(31686004)(8936002)(8676002)(316002)(5660300002)(6916009)(4326008)(66946007)(66556008)(54906003)(478600001)(2906002)(38100700002)(36756003)(6512007)(6486002)(6506007)(26005)(83380400001)(186003)(53546011)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VS9hcVcvdXlJVVMwU1FXZUVDZ0tZMmcvSjBYalJqTjMyRjFVbmxzTWJBWjZy?=
 =?utf-8?B?alBUN3ZIQjdVZGUvYjI4RGNLVFhkQXViRFBGS3Fwb1NvVlMzUEMrWkFGM2w0?=
 =?utf-8?B?ZU1PN2hSZCtYcnBCNmhlWDVBdnRqcjEzbzFhbUVkMGhHZ0t4a2VjOWRkT1dB?=
 =?utf-8?B?WEpZbkFRVTE3ZjMyeGF1ZHlBR0prT2pqZGlEMXkwc3grYnR5Sys2cEJKY3JL?=
 =?utf-8?B?M0JkenU2Mmtsa280d3ZnSWppS00zZW5zY2F3N3Vudkd0YWhnWVpTWS9pKzRl?=
 =?utf-8?B?RHRLZ0tnVTJZdmZqWnF5VlU1RTlZaS8zK29idjNWM3FHbVR3U2lwR1VoSmcw?=
 =?utf-8?B?VXpPenNTTHVWWGs2S2N6SDVtVnpuOERiQTFNa0ZYOU1FbHhiSkNvejNTQklE?=
 =?utf-8?B?VXg3T3UyZUUwVkI5VFFzTktnNGYzbjVvWWFObkFnam96NG9QNWg5RWhXaGpx?=
 =?utf-8?B?N2NObHp0UFhyRWprTEgwVk42TFhWQVExeHl4YmR6bGNJTzExd3RiYVRmckJO?=
 =?utf-8?B?NEwrcmZYRmkrR2FuV0VnQ1A2K1JUTitjV2I4OHh1SUc3VHJsclc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=
 =?utf-8?B?dHVsRFlZVzdTU2pua1JqMDNOd2EyeWJrOXlkMUxWcjcwMGxaUDhLSHN0VEZx?=
 =?utf-8?B?VHJscm1zWnFCaXQ4YmI0Q0FKQW9tNHU1NnI2ZW9FT2NxQVo0b2lYZSswSHR3?=
 =?utf-8?B?TE9yc2ZRUW9zelRLQkZreWE5dlBGRll3MVZTUVpxbzdiYVBzL1BUOExZRG9H?=
 =?utf-8?B?WnFhWFE3ejh2bmNkMnVGd2Q0b0ZJc0dNRTM1SWo2ZHRqYW94TXR1V0svajB2?=
 =?utf-8?B?TzIzVm05SXpnVEZEdityclZhZkZYa25xczNGWXNwUEhMdHYrUUdSMDV2YU5F?=
 =?utf-8?B?ODVrVEFIb1ZNTnBmaThZWXhvdkE1bElsK1E0akNTTGh0cktVb29Yd2FsQ3d4?=
 =?utf-8?B?Y08wMiszWnU1RGs5QzBDODFlc1JxdDRWOGI0U2RkNkpFTHdCOStNRlZYZXov?=
 =?utf-8?B?T1ZObm1YOUIwU3FkdmVRbkk4a2FTR09NUHNmVWdjYXRsd1BaaERVclk5RnNK?=
 =?utf-8?B?ajVWcWY5aGVwaGRFZGg1MlpnanZ1ZGRBZlJtaVp4UlpXcUQ1djBFTm9pKy9p?=
 =?utf-8?B?OHJ5eFkzVDN3UlpXem5yaEh4ZytKaFFUcDhyWWVUZ3hzUGR2MURMQ2dONzVL?=
 =?utf-8?B?MGZkSmRZRzZVcmQ0aVlYbkc4Q3RSbHE5NWxLbWJvQnN6SkpSdlM2eCsxN1Vr?=
 =?utf-8?Q?tZWbqCObEbMi0BLYJdRCXPuNK?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 51eaba6c-bc7b-4530-b515-08db919fb554
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 08:25:33.2367
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: JvwlTg/jr/vr/misIxCV0uNATA9w7IofDj+ZR4V2HGwyyDdFSL2h9sOEwjYUi56Z3vqIYTy2Vk6ajWiRc9GdBw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9402

On 28.07.2023 21:43, Andrew Cooper wrote:
> This is used in an assertion only, which is somewhat dubious to begin with and
> won't surivive the x86-S work (where TR will become be a NUL selector).

I'm kind of okay with the removal, but I can't read anything like the
above out of the doc. Can you point me at where this is said?

Jan

> Delete it now.  This avoids many cases where as a global symbol, it shadows
> local string variables.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
> CC: Wei Liu <wl@xen.org>
> CC: Roberto Bagnara <roberto.bagnara@bugseng.com>
> CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
>  xen/arch/x86/hvm/svm/svm.c      | 2 --
>  xen/arch/x86/include/asm/desc.h | 9 ---------
>  2 files changed, 11 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
> index 56cb2f61bb75..4d29ad3bc36a 100644
> --- a/xen/arch/x86/hvm/svm/svm.c
> +++ b/xen/arch/x86/hvm/svm/svm.c
> @@ -1614,8 +1614,6 @@ static int _svm_cpu_up(bool bsp)
>      /* Initialize OSVW bits to be used by guests */
>      svm_host_osvw_init();
>  
> -    /* Minimal checking that enough CPU setup was done by now. */
> -    ASSERT(str() == TSS_SELECTOR);
>      svm_vmsave_pa(per_cpu(host_vmcb, cpu));
>  
>      return 0;
> diff --git a/xen/arch/x86/include/asm/desc.h b/xen/arch/x86/include/asm/desc.h
> index 225a864c483e..a1e0807d97ed 100644
> --- a/xen/arch/x86/include/asm/desc.h
> +++ b/xen/arch/x86/include/asm/desc.h
> @@ -238,15 +238,6 @@ static inline void ltr(unsigned int sel)
>      __asm__ __volatile__ ( "ltr %w0" :: "rm" (sel) : "memory" );
>  }
>  
> -static inline unsigned int str(void)
> -{
> -    unsigned int sel;
> -
> -    __asm__ ( "str %0" : "=r" (sel) );
> -
> -    return sel;
> -}
> -
>  #endif /* !__ASSEMBLY__ */
>  
>  #endif /* __ARCH_DESC_H */



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 08:35:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 08:35:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572821.896867 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQONc-0001mm-Dd; Mon, 31 Jul 2023 08:35:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572821.896867; Mon, 31 Jul 2023 08:35:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQONc-0001mf-Ax; Mon, 31 Jul 2023 08:35:52 +0000
Received: by outflank-mailman (input) for mailman id 572821;
 Mon, 31 Jul 2023 08:35:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Lm7y=DR=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qQONa-0001mZ-Ek
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 08:35:50 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3fe794b5-2f7d-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 10:35:48 +0200 (CEST)
Received: from Dell.bugseng.com.homenet.telecomitalia.it
 (host-79-23-62-117.retail.telecomitalia.it [79.23.62.117])
 by support.bugseng.com (Postfix) with ESMTPSA id BA5C64EE0737;
 Mon, 31 Jul 2023 10:35:47 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3fe794b5-2f7d-11ee-b254-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH] EFI: address violations of MISRA C:2012 Rules 8.2 and 8.3
Date: Mon, 31 Jul 2023 10:35:19 +0200
Message-Id: <83d4091852797044209272dab750f13f7d30d35c.1690792406.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Give a name to unnamed parameters to address violations of
MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
named parameters").
Keep consistency between parameter names and types used in function
declarations and the ones used in the corresponding function
definitions, thus addressing violations of MISRA C:2012 Rule 8.3
("All declarations of an object or function shall use the same names
and type qualifiers").

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/common/efi/efi.h  | 2 +-
 xen/include/xen/efi.h | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/common/efi/efi.h b/xen/common/efi/efi.h
index c9aa65d506..c02fbb7b69 100644
--- a/xen/common/efi/efi.h
+++ b/xen/common/efi/efi.h
@@ -49,5 +49,5 @@ const CHAR16 *wmemchr(const CHAR16 *s, CHAR16 c, UINTN n);
 void *ebmalloc(size_t size);
 void free_ebmalloc_unused_mem(void);
 
-const void *pe_find_section(const void *image_base, const size_t image_size,
+const void *pe_find_section(const void *image, const UINTN image_size,
                             const CHAR16 *section_name, UINTN *size_out);
diff --git a/xen/include/xen/efi.h b/xen/include/xen/efi.h
index 94a7e547f9..942d2e9491 100644
--- a/xen/include/xen/efi.h
+++ b/xen/include/xen/efi.h
@@ -39,11 +39,11 @@ unsigned long efi_get_time(void);
 void efi_halt_system(void);
 void efi_reset_system(bool warm);
 #ifndef COMPAT
-int efi_get_info(uint32_t idx, union xenpf_efi_info *);
-int efi_runtime_call(struct xenpf_efi_runtime_call *);
+int efi_get_info(uint32_t idx, union xenpf_efi_info *info);
+int efi_runtime_call(struct xenpf_efi_runtime_call *op);
 #endif
-int efi_compat_get_info(uint32_t idx, union compat_pf_efi_info *);
-int efi_compat_runtime_call(struct compat_pf_efi_runtime_call *);
+int efi_compat_get_info(uint32_t idx, union compat_pf_efi_info *info);
+int efi_compat_runtime_call(struct compat_pf_efi_runtime_call *op);
 
 #endif /* !__ASSEMBLY__ */
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 08:57:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 08:57:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572827.896877 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQOiT-0004Ev-W1; Mon, 31 Jul 2023 08:57:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572827.896877; Mon, 31 Jul 2023 08:57:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQOiT-0004Eo-TU; Mon, 31 Jul 2023 08:57:25 +0000
Received: by outflank-mailman (input) for mailman id 572827;
 Mon, 31 Jul 2023 08:57:23 +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 <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQOiR-0004Eh-QU
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 08:57:23 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20605.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::605])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 42b1367d-2f80-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 10:57:21 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB8864.eurprd04.prod.outlook.com (2603:10a6:102:20f::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 08:57:19 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 08:57:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 42b1367d-2f80-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=B9yjmfyW0ix2UI+gu3v/GCTUwzBpYPfFzWx/yFw+Tu0gQLi7dLrg/FgP/Quvjv0HUPMZUdVwzWQtc9u89cOU5F8ePc/KIG2gHWzRaBViR0/GlRC/WD2M8h8/ziKyJ/MayqcaaD4Ku8Y/2+GuY9+Xyl5k52f9WLQOe6EQ4NqgF13Qz+ucdHlH+L9Z6m6uGe8hseIA7i9620KOFcZUIM/uRoN1CHuU2kooyFNYrx9HzGAhktSqCVwFlATXZdKIhuN4l6zkZFCoekVPWoVGEnPDW6Q8oLWFbLFBhHi+UtmoPE4qQa5ZVbUyGg+DvFYsYW3gItlby4L2StWw4aqGaeUgDA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=IUqt4FGHi8o7OqgUC/GQ8HY+e25ZWNrtn4yjx++Hlp4=;
 b=EAph44z6XK61/HScTL7ZbVdg+b57U8hul9TdATDCW0bjICqYJMw8wUT6e9VQwTVRRP/DaNeMTdExYA5F9UJ0QErz93nda/qcfS9glLVh6JUJuZ87zDc0GAoHJw9GrQw+81JmvAcS97gkbjA3Gsls2MgLgR2EFguL8KIZ/fzYhtNeZVMrYOmcTexXusaBJlddO/RSc07nPSp5sLeQA/LjHHDKpANt13Dgtpjo5hiyNeMx0Y4GG89hC/0mrLnUDOmHrhMEbv1PMZOwxvxd1Fi9tx7ubNTiMxQHbToOlPrQd8Ns519VJTfhX0CY2JAtGUjgF3GoW9qzzS30fWst6bdXnw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IUqt4FGHi8o7OqgUC/GQ8HY+e25ZWNrtn4yjx++Hlp4=;
 b=wPY+tFbk+ib1r5HrDjHLxN8PFfSc4IWRznMQbFucsijb53GGOgZAfyLZP439Jz+vDg9DDGj0dLibdKFm1wLsmcYqoLlpemx/4xbet+PPcW2xa3K1bf9zqKGklOc9pxni3aHJ4XCWNzM0W6k/OPBY2fjoMAvvZYPsdlH8W0ix6iMFY5HG3If6vM2eVmGn8fidQk0mEgClk/yrjKD1mNRDltvQXkPJmsNnMhA6X2gVnz6IUsdGRswSl/MRpoct5L+pFe+lRKh1vd5KmstmpTNqq4fvJUNkJT56NdBHRy+2FtHjv3+MLTvoPg1m0GJkvtXIljI8q5XYyoAKSlO2x71L1g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <da29c270-0ba2-6ba2-fa6c-844daa65d07e@suse.com>
Date: Mon, 31 Jul 2023 10:57:19 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [PATCH 2/3] x86/entry: Rename the exception entrypoints
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Roberto Bagnara <roberto.bagnara@bugseng.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Nicola Vetrini <nicola.vetrini@bugseng.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230728194320.3082120-1-andrew.cooper3@citrix.com>
 <20230728194320.3082120-3-andrew.cooper3@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230728194320.3082120-3-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0067.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:49::21) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB8864:EE_
X-MS-Office365-Filtering-Correlation-Id: 0857fd87-ac54-41cf-3013-08db91a425b1
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	C7ehq6LbCc+y4qM8LhJ5gEMHLt2m/8VbGo8LR9KuA3DUqDiCIF+BsdiWe0Zs9d6IC3K1u8sd2L0cK9QN56fKwfA3BABadrolXvruasXMNdJMHZp4y8SMJA3yVo9AKUB4sLD8EuPGjJ904T5KYX+htlLS36bQaIFh/pjPj7mG04lvNMPcrNaLT7j0y5fe4LchAh5mSPQgUst2wC8zLK1z/8Mn5JVbxewBPDA2jG46TInVpX25b+96WdCb+E6MCNfpRZARC4laW3DdgMGDOw/SuMcrUfbt8RyvO2jV9L4EDfyvS8jpbxFbr2F94n5G7NAzU6UFgIdDrscxwRksoahyyMdDhy5eLBQ93D4wJYeuNsNrVjSzFQZlvs1ZXuiXlIbR+nzPTAVnM12o8Osr6A62QFFZMx9OXkXFQswdzNiop7ZeqTH1WSJjMHdUdqBxyRUOFomW0Jdkln2b6GBS3/IA8r2KbeLILirPu/5EVb5PcHsMxYLQS1Dv4Ra3GaEHdKG4QTBbNcguyG/+bCf/hO78enXJMU5qQ6T7qfw5k4MuvJQcgGQYOlQ3/IV4xDGwG4ehcyO+FaSp8pB6pyqqWeMsuYan6FfBSKQyeGFDAHts/51voN9gH1amv7T5bYgi4b4Y3fqYRP3AQgtqab+jEnLreA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(376002)(366004)(346002)(39860400002)(396003)(451199021)(38100700002)(31696002)(86362001)(36756003)(6512007)(478600001)(6486002)(2616005)(53546011)(186003)(26005)(6506007)(8676002)(8936002)(5660300002)(4326008)(66946007)(66556008)(66476007)(2906002)(54906003)(31686004)(110136005)(41300700001)(316002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aTJneW9FYndhOTBmSW9ZT3RNNGo0ZnM2bEdGRlFieDZ3ZFNOK2NEZlZFT1Uw?=
 =?utf-8?B?dGNjbStFQ2cxdXUwNnVJUCsrL2d2eGdrbjlLeTNxWlJESW5tTmxrMXdsaG02?=
 =?utf-8?B?eVRObjJsczA0YVFnT1lZeENwWkMrOVRzVnMxM2lTaEptWmMxMWQ1Y25IQmxm?=
 =?utf-8?B?V3hPTTNoanlGU3NsT25WV0lJUklvZUh2WnNBR2YyL0NEM3h2dlVPc1FiVGZo?=
 =?utf-8?B?NC8xOWxsU2g0MTFsbTBJTnNtcVR3SitLaVVNL2piVVJOQndYRmdBSGxldW1R?=
 =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jJuTVJP?=
 =?utf-8?B?aG96VDlRdW5ldnNDZ0xmL2xRYml3MDQ4Q0sxTUVDcHMrRWJacEt4cHVCN2l1?=
 =?utf-8?Q?KOSEEJB5cUGcDtepexGg+KXQ+?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0857fd87-ac54-41cf-3013-08db91a425b1
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 08:57:19.7608
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: /vMfPUxcb1p40UzpvAoeLtFNLeapoBCWHBWTMOy4uiv5BdPKGAY+2ZxVQ1pxOYC1poYBkh9pPD52UP0AYUWSOg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8864

On 28.07.2023 21:43, Andrew Cooper wrote:
> This makes the names match the architectural short names that we use
> elsewhere.  This avoids 'debug' in particular from being a global symbol
> shadowed by many local parameter names.
> 
> Remove the DECLARE_TRAP_HANDLER{,_CONST}() infrastructure.  Only NMI/#MC are
> referenced externally (and NMI will cease to be soon, as part of adding FRED
> support).  Move the entrypoint declarations into the respective traps.c where
> they're used, rather than keeping them visible across ~all of Xen.

Coming back to my Misra concern here: There's no way we can avoid violating
rule 8.7 (and maybe also 8.6) when it comes to symbols defined in assembly
code. Rule 8.5 otoh is a little more relaxed than I recalled when commenting
on the earlier version of the patch, but it still talks of exclusively
"header files". Roberto, could you please clarify whether putting such
declarations in .c files is indeed not a violation of 8.5?

In any event I see you've added "nocall" - I guess that's an easy
identification for (some of) the symbols defined in assembly code, and
hence needing special casing in scans.

> Drop the long-stale comment at the top of init_idt_traps().  It's mostly
> discussing a 32bit Xen, and bogus otherwise as it's impossible to use trap
> gates correctly for these purposes.

I don't think I follow the "impossible", but I'm also not going to make my
(eventual) ack dependent upon you further adjusting this part of the
description.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 09:02:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 09:02:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572832.896887 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQOnX-0005iV-LT; Mon, 31 Jul 2023 09:02:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572832.896887; Mon, 31 Jul 2023 09:02:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQOnX-0005iO-Iw; Mon, 31 Jul 2023 09:02:39 +0000
Received: by outflank-mailman (input) for mailman id 572832;
 Mon, 31 Jul 2023 09:02:38 +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 <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQOnW-0005i4-QP
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 09:02:38 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 (mail-am7eur03on2062c.outbound.protection.outlook.com
 [2a01:111:f400:7eaf::62c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fe679efd-2f80-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 11:02:37 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM8PR04MB7283.eurprd04.prod.outlook.com (2603:10a6:20b:1c7::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 09:02:34 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 09:02:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fe679efd-2f80-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ZUlt8Y76Y0NXkniCzEW5TbX6IVs0tqoaeEUL3hk6zmxUhAMUvk5rXgdBT+lIRL5kZvjC++mzTnleFhZ8KNFnExThi/DmeNQCqEK6rI6OJWXn5Z4GK16h4Bp3OqqvfWSxEV1uASz8O13Y8PSOmg8jOOJpT9soxirCLBYm33KzA8CuggZ4MzMLy28iRHFh91A7nS+CbddEvTMwJimIoqO+CPhaJDBMNdqltphZ8YMg20Kmrh3ix4XFhya6Q6G1DSkKHBUGNqqaCTIv54T/MSwyE8frDPepI1Ib248+vRR8lYioN3itMkfoJ7GW5VQlezeuIKOlhICCzptiJ/1TI+Sjmg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=vPcyrBG36cU2uUO4yJSjElzVjCLqsd0hqdFY+PKFFtA=;
 b=GpKhWLnaAyoYf0y4QsU+7FAEElJXxelU9wPv+GVecz9YhiEByaNELFR/R7gNqsJpo9PV+UgQJh/hZNC8TAthPSZted+RscNwL8yffG27NavC51S3u1qSNb7s24TtT518HjcQyOH0smImb+GLcm41ieHk7fvgRaIqZ9sKIPcxifIASZ/sT1wq/+aIvaphLbBnaKflxSKzslOFemXjhZuSB8riEXRnGSFN6iu1vWxKzSR9izd4CleZkMezHXRDjW3Ez9gOW2uKSFtyc4sc+JudPKcedgcJTSLc0v9V0s2F4ji9ladczpsBBfKZ4SdpAYbDl3iWpfd3X6kam5a1DERprQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=vPcyrBG36cU2uUO4yJSjElzVjCLqsd0hqdFY+PKFFtA=;
 b=iqoGJ6sz8eX2gL1as60v1PRdS1zY01dGOs7GEPUPJsgsP6OrqiXkRhBsxKXwRKjkRMwpzDYL/s+L52hrzn5qLQu6rhva0LWLx1JtWpocasEYJfO/wQbtfLADuPiX6yJ0exPx1LmFDkt/mCWqJ199/fTZNP+hd1AWiZ+1AmASNqT9Z+xccqf+r/7fu78tr99nBf+F4Dh14kJHOcP1+ct8wqBVms/28sxu/bjfELdIvE1OceT3oxvLJdzrUjJUTjjCM9NiuzLGBM6+1qQDUdgmrbgZbNZsPBYXrPTU/6LhQtHRy3r+mA26F+7nx9Y0WqxD2qKADATEs/guVbcos8Xy7w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <de599aa6-f266-8720-71eb-a5425f9d098c@suse.com>
Date: Mon, 31 Jul 2023 11:02:33 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [PATCH] x86/amd: Fix DE_CFG truncation in amd_check_zenbleed()
Content-Language: en-US
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
References: <20230728181730.3065977-1-andrew.cooper3@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230728181730.3065977-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0184.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ab::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM8PR04MB7283:EE_
X-MS-Office365-Filtering-Correlation-Id: e450a7fb-12aa-4c9a-79b9-08db91a4e0b4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	5K9M8dQors1pZFO1DvI1moI2UTSvooZ8mvMob1jzK8MjAxcj6NL7KaP6DabdKKO5vlSw8NBUY2dYio28ekzHsKIJwfJ8GvQfiCefsbPLxiWXU2GN+vJx8IbYSbORPXt9l4H3oXPTUDvE5JorUcbTxg47/Gixk9L2cXHKYKPvujZJVV45Lm65cauMO2LHp33cKjxeyjT9fZVzPmqWJMxa3UpJq2RkzHZquVw9XZWds7N3Paq6OCC8gVaiS4UNH7VsWh6QG+DuK0pyEoPeSUd9xMJqt+7n4EIRlvcm3oVyOHzmfWsZYzy1pvpEy0zqBfWmm6D1QO4Yj/rkmEbJyq8faVNysLYZPas2cBPHIlefmpJeF4ivuIyU5pc7YfAFGdXVw/8N/CWbzp1y8pDJXn0eCSo2O869pMSg+tA6lINze2+EJpq5maOZkCZybefZc4jQGlCrEVEbVvCKSfswECPkBhduW24lNLgGHzFAjdx6Vj8Nz4bEWkHzTSL3u/7SwKWMzFx8UvUKTCTwR2eWipSyzWGxw4qJkMFMDKocCpixXg4l6vemYSDw7UM9vMk+fkrko1Et6Jm03Rs+G+p0LKZCG43SpYLTa0SoG4VXuaqOdHB4pK12HuCNyQU8agpp63Bjnh2d1Hr+ePhdQZ8c8OL8xg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(136003)(396003)(366004)(346002)(39860400002)(451199021)(6512007)(6486002)(186003)(2616005)(36756003)(86362001)(31696002)(38100700002)(26005)(6506007)(53546011)(5660300002)(41300700001)(8936002)(8676002)(31686004)(6916009)(66946007)(66556008)(66476007)(2906002)(4744005)(316002)(478600001)(54906003)(4326008)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MkhkYnF6R0dzZkRFVHk1alozWUk1MTNIS3JGMyt6aVRKZlhic2F6aDNEeXNj?=
 =?utf-8?B?YkR1NGhqQUs3MVNTenZKK2JwbzZxU3puT054T3Jpc3ZTNG9za3h5c1l6Rmdz?=
 =?utf-8?B?bjFnLzJBMkFlbFhRT2VkSUdQZDB4YlZSRzR1TWZiTUl3YVBHNlpBc2Q4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V3ZHWndVbE9KNG1zRFhTMkxu?=
 =?utf-8?B?Qk9ERFBid3ZLK2FzMW85K0gvM1haeGd2a2xDQ0p2NnIvb3FRekZBWUN3VDVX?=
 =?utf-8?B?SGt4RUEra3JTTjcrblhERzc3S2o5YlRtNHR2R3JPRkhhWnhmN0ZVc0dMVVRO?=
 =?utf-8?B?S2FhWlRjMm13RGJHMXdrNVhZZTN1WXpZZnhFYkFKRkxlN3dITVJ4cHdGOUlC?=
 =?utf-8?Q?AbODQaB7aXiudXZkmb2brHtTs?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e450a7fb-12aa-4c9a-79b9-08db91a4e0b4
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 09:02:33.8123
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Y/IELz5bd0ju0Inf5ny+0ulzTCdCCNSH/5lH58LRs18cIAfLQdRlRkKHvi+CLrPmFl2OFKSwNo3j64Paeb9bvg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7283

On 28.07.2023 20:17, Andrew Cooper wrote:
> This line:
> 
> 	val &= ~chickenbit;
> 
> ends up truncating val to 32 bits, and turning off various errata workarounds
> in Zen2 systems.
> 
> Fixes: f91c5ea97067 ("x86/amd: Mitigations for Zenbleed")
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
> CC: Wei Liu <wl@xen.org>
> 
> The choice is between int or uint64_t.  This is one case where the insistence
> on using unsigned int as a default data type is genuinely unsafe.

It is not. The (unsigned) type should have been wide enough. From a Misra
perspective I'm pretty sure we would be better off using uint64_t. But in
the interest of getting this in without a lot of discussion I'll leave the
decision up to you; either way
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 09:09:24 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 09:09:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572836.896897 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQOty-0006LS-BN; Mon, 31 Jul 2023 09:09:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572836.896897; Mon, 31 Jul 2023 09:09:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQOty-0006LL-8a; Mon, 31 Jul 2023 09:09:18 +0000
Received: by outflank-mailman (input) for mailman id 572836;
 Mon, 31 Jul 2023 09:09:16 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qQOtw-0006LD-SR
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 09:09:16 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qQOtv-0002yA-Po; Mon, 31 Jul 2023 09:09:15 +0000
Received: from [15.248.2.156] (helo=[10.24.67.16])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qQOtv-0005hR-IV; Mon, 31 Jul 2023 09:09:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=yMiKw+xlfyEiBPBEwLWML2GLViBDeDdcnId/YqR5qBQ=; b=uTCjwaz/chKhPdkIpzoU4RJYGP
	9vu+XgY6f5r0zxRnMQR3jaQNcQ69FT/IXBvZrGyCh8w5p4qTN8y2woEV0mwKoK6a9EL6R/w87ZuS4
	qMhRhUQ6tSdawiXM4NKkwDgtpvhBQiuSsamxkLl69mfaFY/pGJ7ZO7ibknaq5KBiV2/g=;
Message-ID: <b7fc2f24-a01c-c4bd-6e65-599694645cae@xen.org>
Date: Mon, 31 Jul 2023 10:09:13 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 5/5] pdx: Add CONFIG_HAS_PDX_COMPRESSION as a common
 Kconfig option
Content-Language: en-GB
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 George Dunlap <george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
 <20230728075903.7838-6-alejandro.vallejo@cloud.com>
 <9f0b7ab4-090f-21ea-2cf8-6ecdc7c02225@citrix.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <9f0b7ab4-090f-21ea-2cf8-6ecdc7c02225@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 28/07/2023 17:36, Andrew Cooper wrote:
> On 28/07/2023 8:59 am, Alejandro Vallejo wrote:
>> Adds a new compile-time flag to allow disabling pdx compression and
>> compiles out compression-related code/data. It also shorts the pdx<->pfn
>> conversion macros and creates stubs for masking fucntions.
>>
>> While at it, removes the old arch-defined CONFIG_HAS_PDX flag, as it was
>> not removable in practice.
>>
>> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
>> ---
>> v2:
>>    * Merged v1/patch2: Removal of CONFIG_HAS_PDX here (Jan)
> 
> This series is now looking fine, except for the Kconfig aspect.
> 
> This is not something any user or developer should ever be queried
> about.Â  The feedback on the documentation patches alone show that it's
> not understood well by the maintainers, even if the principle is accepted.
> 
> There is never any reason to have this active on x86. 

I can't really speak for x86. However, for Arm, I think it could be 
useful in the case there is a system where the frametable size doesn't 
change with CONFIG_PDX=n and/or the integrator is happy to waste a bit 
more memory to gain performance.

Also, to reply to Jan's, I don't think this is a sort of option that 
should be gated by expert (againt at least on Arm). Xen ought to work 
fine with and without PDX enabled. From my understanding, the only 
differences are the amount of memory wasted vs performance gain.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 09:16:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 09:16:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572839.896908 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQP0R-0007oK-0N; Mon, 31 Jul 2023 09:15:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572839.896908; Mon, 31 Jul 2023 09:15:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQP0Q-0007oD-Sx; Mon, 31 Jul 2023 09:15:58 +0000
Received: by outflank-mailman (input) for mailman id 572839;
 Mon, 31 Jul 2023 09:15:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=wefb=DR=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qQP0P-0007o7-7a
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 09:15:57 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dafcc733-2f82-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 11:15:56 +0200 (CEST)
Received: from support.bugseng.com (support.bugseng.com [162.55.131.47])
 by support.bugseng.com (Postfix) with ESMTPA id C8F7B4EE0737;
 Mon, 31 Jul 2023 11:15:55 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dafcc733-2f82-11ee-b254-6b7b168915f2
MIME-Version: 1.0
Date: Mon, 31 Jul 2023 11:15:55 +0200
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, Jan Beulich
 <JBeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>, Roberto Bagnara
 <roberto.bagnara@bugseng.com>
Subject: Re: [PATCH 2/3] x86/entry: Rename the exception entrypoints
In-Reply-To: <20230728194320.3082120-3-andrew.cooper3@citrix.com>
References: <20230728194320.3082120-1-andrew.cooper3@citrix.com>
 <20230728194320.3082120-3-andrew.cooper3@citrix.com>
User-Agent: Roundcube Webmail/1.4.3
Message-ID: <49c6e1314578682cb1ddc6d7733b7c9b@bugseng.com>
X-Sender: nicola.vetrini@bugseng.com
Organization: BUGSENG s.r.l.
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Content-Transfer-Encoding: 8bit

On 28/07/2023 21:43, Andrew Cooper wrote:
> This makes the names match the architectural short names that we use
> elsewhere.  This avoids 'debug' in particular from being a global 
> symbol
> shadowed by many local parameter names.
> 
> Remove the DECLARE_TRAP_HANDLER{,_CONST}() infrastructure.  Only 
> NMI/#MC are
> referenced externally (and NMI will cease to be soon, as part of adding 
> FRED
> support).  Move the entrypoint declarations into the respective traps.c 
> where
> they're used, rather than keeping them visible across ~all of Xen.
> 
> Drop the long-stale comment at the top of init_idt_traps().  It's 
> mostly
> discussing a 32bit Xen, and bogus otherwise as it's impossible to use 
> trap
> gates correctly for these purposes.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
> CC: Wei Liu <wl@xen.org>
> CC: Roberto Bagnara <roberto.bagnara@bugseng.com>
> CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
> 
> This is half of a previous patch, cut down to just the rename and 
> header file
> cleanup.
> ---
>  xen/arch/x86/include/asm/processor.h | 34 +-------------
>  xen/arch/x86/pv/traps.c              |  2 +
>  xen/arch/x86/traps.c                 | 70 +++++++++++++++++-----------
>  xen/arch/x86/x86_64/entry.S          | 36 +++++++-------
>  4 files changed, 64 insertions(+), 78 deletions(-)
> 
With respect to Rule 5.3:
Tested-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 09:17:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 09:17:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572843.896917 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQP1x-0008Q1-Br; Mon, 31 Jul 2023 09:17:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572843.896917; Mon, 31 Jul 2023 09:17:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQP1x-0008Pu-9K; Mon, 31 Jul 2023 09:17:33 +0000
Received: by outflank-mailman (input) for mailman id 572843;
 Mon, 31 Jul 2023 09:17:32 +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
 <SRS0=wefb=DR=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qQP1w-0008Po-10
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 09:17:32 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1309a1b3-2f83-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 11:17:30 +0200 (CEST)
Received: from support.bugseng.com (support.bugseng.com [162.55.131.47])
 by support.bugseng.com (Postfix) with ESMTPA id E727D4EE0737;
 Mon, 31 Jul 2023 11:17:29 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1309a1b3-2f83-11ee-8613-37d641c3527e
MIME-Version: 1.0
Date: Mon, 31 Jul 2023 11:17:29 +0200
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, Jan Beulich
 <JBeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>, Roberto Bagnara
 <roberto.bagnara@bugseng.com>
Subject: Re: [PATCH 3/3] x86: Delete str()
In-Reply-To: <20230728194320.3082120-4-andrew.cooper3@citrix.com>
References: <20230728194320.3082120-1-andrew.cooper3@citrix.com>
 <20230728194320.3082120-4-andrew.cooper3@citrix.com>
User-Agent: Roundcube Webmail/1.4.3
Message-ID: <1c9656f333d5a5110122b8f08d264ea4@bugseng.com>
X-Sender: nicola.vetrini@bugseng.com
Organization: BUGSENG s.r.l.
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Content-Transfer-Encoding: 8bit

On 28/07/2023 21:43, Andrew Cooper wrote:
> This is used in an assertion only, which is somewhat dubious to begin 
> with and
> won't surivive the x86-S work (where TR will become be a NUL selector).
> 
> Delete it now.  This avoids many cases where as a global symbol, it 
> shadows
> local string variables.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
> CC: Wei Liu <wl@xen.org>
> CC: Roberto Bagnara <roberto.bagnara@bugseng.com>
> CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
>  xen/arch/x86/hvm/svm/svm.c      | 2 --
>  xen/arch/x86/include/asm/desc.h | 9 ---------
>  2 files changed, 11 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
> index 56cb2f61bb75..4d29ad3bc36a 100644
> --- a/xen/arch/x86/hvm/svm/svm.c
> +++ b/xen/arch/x86/hvm/svm/svm.c
> @@ -1614,8 +1614,6 @@ static int _svm_cpu_up(bool bsp)
>      /* Initialize OSVW bits to be used by guests */
>      svm_host_osvw_init();
> 
> -    /* Minimal checking that enough CPU setup was done by now. */
> -    ASSERT(str() == TSS_SELECTOR);
>      svm_vmsave_pa(per_cpu(host_vmcb, cpu));
> 
>      return 0;
> diff --git a/xen/arch/x86/include/asm/desc.h 
> b/xen/arch/x86/include/asm/desc.h
> index 225a864c483e..a1e0807d97ed 100644
> --- a/xen/arch/x86/include/asm/desc.h
> +++ b/xen/arch/x86/include/asm/desc.h
> @@ -238,15 +238,6 @@ static inline void ltr(unsigned int sel)
>      __asm__ __volatile__ ( "ltr %w0" :: "rm" (sel) : "memory" );
>  }
> 
> -static inline unsigned int str(void)
> -{
> -    unsigned int sel;
> -
> -    __asm__ ( "str %0" : "=r" (sel) );
> -
> -    return sel;
> -}
> -
>  #endif /* !__ASSEMBLY__ */
> 
>  #endif /* __ARCH_DESC_H */

With respect to shadowing (Rule 5.3)
Tested-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 09:43:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 09:43:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572862.896928 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQPR7-0003Lv-DV; Mon, 31 Jul 2023 09:43:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572862.896928; Mon, 31 Jul 2023 09:43:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQPR7-0003Lo-AZ; Mon, 31 Jul 2023 09:43:33 +0000
Received: by outflank-mailman (input) for mailman id 572862;
 Mon, 31 Jul 2023 09:43:32 +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
 <SRS0=eYfp=DR=kernel.org=mhiramat@srs-se1.protection.inumbo.net>)
 id 1qQPR6-0003Li-Rq
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 09:43:32 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b47720a9-2f86-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 11:43:30 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id C3DCB60FDE;
 Mon, 31 Jul 2023 09:43:28 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF064C433C8;
 Mon, 31 Jul 2023 09:43:11 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b47720a9-2f86-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690796608;
	bh=lbshF7OnIf+ShzXg9sWYCNJD7v4GqiDpC1WTlweUVIw=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
	b=jA6auAhOhFj5SZDRCEf2dZqVFRoPfsG08UJgYypsJjaXcRuJIvWWXIhRSIIpK9Shp
	 ozxGEb8OrB52TVM8mvm6ELO8Bjvc6MZms4+pZNp8MBiqt7lnp5HCLoP4RNq0RueNAE
	 YX4r/uBUyO5sdRou/PP4ipFPMyYT0OrMBm/sRc9Ve5fThd2+57fTvl7t9ZhmEPp3Lh
	 4WOZyZUfl3Fb2BviKBayRNiLZWEo8DDunJYoijrZCjHyF/UqD/cxDXnG8Rux4UZNCu
	 c7Iw4n7RRvscYp7z4hzCMxtPFNgpvghtt00/1Tcd/0d63wKan/msaki0A7NIwthB9K
	 +Se4fZCsj8nSQ==
Date: Mon, 31 Jul 2023 18:43:09 +0900
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Xin Li <xin3.li@intel.com>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
 linux-edac@vger.kernel.org, linux-hyperv@vger.kernel.org,
 kvm@vger.kernel.org, xen-devel@lists.xenproject.org, Jonathan Corbet
 <corbet@lwn.net>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar
 <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
 <dave.hansen@linux.intel.com>, x86@kernel.org, "H . Peter Anvin"
 <hpa@zytor.com>, Andy Lutomirski <luto@kernel.org>, Oleg Nesterov
 <oleg@redhat.com>, Tony Luck <tony.luck@intel.com>, "K . Y . Srinivasan"
 <kys@microsoft.com>, Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu
 <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>, Paolo Bonzini
 <pbonzini@redhat.com>, Wanpeng Li <wanpengli@tencent.com>, Vitaly Kuznetsov
 <vkuznets@redhat.com>, Sean Christopherson <seanjc@google.com>, Peter
 Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, Stefano
 Stabellini <sstabellini@kernel.org>, Oleksandr Tyshchenko
 <oleksandr_tyshchenko@epam.com>, Josh Poimboeuf <jpoimboe@kernel.org>,
 "Paul E . McKenney" <paulmck@kernel.org>, Catalin Marinas
 <catalin.marinas@arm.com>, Randy Dunlap <rdunlap@infradead.org>, Steven
 Rostedt <rostedt@goodmis.org>, Kim Phillips <kim.phillips@amd.com>,
 Hyeonggon Yoo <42.hyeyoo@gmail.com>, "Liam R . Howlett"
 <Liam.Howlett@Oracle.com>, Sebastian Reichel
 <sebastian.reichel@collabora.com>, "Kirill A . Shutemov"
 <kirill.shutemov@linux.intel.com>, Suren Baghdasaryan <surenb@google.com>,
 Pawan Gupta <pawan.kumar.gupta@linux.intel.com>, Jiaxi Chen
 <jiaxi.chen@linux.intel.com>, Babu Moger <babu.moger@amd.com>, Jim Mattson
 <jmattson@google.com>, Sandipan Das <sandipan.das@amd.com>, Lai Jiangshan
 <jiangshanlai@gmail.com>, Hans de Goede <hdegoede@redhat.com>, Reinette
 Chatre <reinette.chatre@intel.com>, Daniel Sneddon
 <daniel.sneddon@linux.intel.com>, Breno Leitao <leitao@debian.org>, Nikunj
 A Dadhania <nikunj@amd.com>, Brian Gerst <brgerst@gmail.com>, Sami Tolvanen
 <samitolvanen@google.com>, Alexander Potapenko <glider@google.com>, Andrew
 Morton <akpm@linux-foundation.org>, Arnd Bergmann <arnd@arndb.de>,
 "Eric W . Biederman" <ebiederm@xmission.com>, Kees Cook
 <keescook@chromium.org>, Masami Hiramatsu <mhiramat@kernel.org>, Masahiro
 Yamada <masahiroy@kernel.org>, Ze Gao <zegao2021@gmail.com>, Fei Li
 <fei1.li@intel.com>, Conghui <conghui.chen@intel.com>, Ashok Raj
 <ashok.raj@intel.com>, "Jason A . Donenfeld" <Jason@zx2c4.com>, Mark
 Rutland <mark.rutland@arm.com>, Jacob Pan <jacob.jun.pan@linux.intel.com>,
 Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, Jane Malalane
 <jane.malalane@citrix.com>, David Woodhouse <dwmw@amazon.co.uk>, Boris
 Ostrovsky <boris.ostrovsky@oracle.com>, Arnaldo Carvalho de Melo
 <acme@redhat.com>, Yantengsi <siyanteng@loongson.cn>, Christophe Leroy
 <christophe.leroy@csgroup.eu>, Sathvika Vasireddy <sv@linux.ibm.com>
Subject: Re: [PATCH v9 05/36] x86/opcode: Add ERETU, ERETS instructions to
 x86-opcode-map
Message-Id: <20230731184309.9888dfd44fa1a5fd69c779cd@kernel.org>
In-Reply-To: <20230731063317.3720-6-xin3.li@intel.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
	<20230731063317.3720-6-xin3.li@intel.com>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Sun, 30 Jul 2023 23:32:46 -0700
Xin Li <xin3.li@intel.com> wrote:

> From: "H. Peter Anvin (Intel)" <hpa@zytor.com>
> 
> Add instruction opcodes used by FRED ERETU/ERETS to x86-opcode-map.
> 
> Opcode numbers are per FRED spec v5.0.
> 
> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
> Tested-by: Shan Kang <shan.kang@intel.com>
> Signed-off-by: Xin Li <xin3.li@intel.com>

This looks good to me. (ERETS has the opcode F2 0F 01 CA, ERETU
has the opcode F3 0F 01 CA)

Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Thank you,

> ---
>  arch/x86/lib/x86-opcode-map.txt       | 2 +-
>  tools/arch/x86/lib/x86-opcode-map.txt | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/lib/x86-opcode-map.txt b/arch/x86/lib/x86-opcode-map.txt
> index 5168ee0360b2..7a269e269dc0 100644
> --- a/arch/x86/lib/x86-opcode-map.txt
> +++ b/arch/x86/lib/x86-opcode-map.txt
> @@ -1052,7 +1052,7 @@ EndTable
>  
>  GrpTable: Grp7
>  0: SGDT Ms | VMCALL (001),(11B) | VMLAUNCH (010),(11B) | VMRESUME (011),(11B) | VMXOFF (100),(11B) | PCONFIG (101),(11B) | ENCLV (000),(11B)
> -1: SIDT Ms | MONITOR (000),(11B) | MWAIT (001),(11B) | CLAC (010),(11B) | STAC (011),(11B) | ENCLS (111),(11B)
> +1: SIDT Ms | MONITOR (000),(11B) | MWAIT (001),(11B) | CLAC (010),(11B) | STAC (011),(11B) | ENCLS (111),(11B) | ERETU (F3),(010),(11B) | ERETS (F2),(010),(11B)
>  2: LGDT Ms | XGETBV (000),(11B) | XSETBV (001),(11B) | VMFUNC (100),(11B) | XEND (101)(11B) | XTEST (110)(11B) | ENCLU (111),(11B)
>  3: LIDT Ms
>  4: SMSW Mw/Rv
> diff --git a/tools/arch/x86/lib/x86-opcode-map.txt b/tools/arch/x86/lib/x86-opcode-map.txt
> index 5168ee0360b2..7a269e269dc0 100644
> --- a/tools/arch/x86/lib/x86-opcode-map.txt
> +++ b/tools/arch/x86/lib/x86-opcode-map.txt
> @@ -1052,7 +1052,7 @@ EndTable
>  
>  GrpTable: Grp7
>  0: SGDT Ms | VMCALL (001),(11B) | VMLAUNCH (010),(11B) | VMRESUME (011),(11B) | VMXOFF (100),(11B) | PCONFIG (101),(11B) | ENCLV (000),(11B)
> -1: SIDT Ms | MONITOR (000),(11B) | MWAIT (001),(11B) | CLAC (010),(11B) | STAC (011),(11B) | ENCLS (111),(11B)
> +1: SIDT Ms | MONITOR (000),(11B) | MWAIT (001),(11B) | CLAC (010),(11B) | STAC (011),(11B) | ENCLS (111),(11B) | ERETU (F3),(010),(11B) | ERETS (F2),(010),(11B)
>  2: LGDT Ms | XGETBV (000),(11B) | XSETBV (001),(11B) | VMFUNC (100),(11B) | XEND (101)(11B) | XTEST (110)(11B) | ENCLU (111),(11B)
>  3: LIDT Ms
>  4: SMSW Mw/Rv
> -- 
> 2.34.1
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 09:45:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 09:45:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572864.896938 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQPSl-0003tg-O5; Mon, 31 Jul 2023 09:45:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572864.896938; Mon, 31 Jul 2023 09:45:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQPSl-0003tZ-LQ; Mon, 31 Jul 2023 09:45:15 +0000
Received: by outflank-mailman (input) for mailman id 572864;
 Mon, 31 Jul 2023 09:45:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=GapS=DR=citrix.com=prvs=569ba324e=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qQPSk-0003tT-NO
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 09:45:14 +0000
Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com
 [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f042085d-2f86-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 11:45:12 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f042085d-2f86-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690796712;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:content-transfer-encoding:in-reply-to;
  bh=5JDwv0ENuZfBG/YaonkgjG5m7XmXFUJcjYnOjiFHnZg=;
  b=DtsJGmjxUWYgWRLVK38NZYTN6KsxsVz273FiXghjub/MK1oAOzTFKrRI
   9t504dNU7T5t60Rk5wQYPJVWjD2ZbNeT9fzg5gpPuHqiy4yBWDgnCeFNv
   xUSbENy97kJrBZMIHIkfdpe27AMzMzq5DckWG3ob8r2vGaGZ6KuVHyyE/
   A=;
Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 117255370
X-Ironport-Server: esa6.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-Data: A9a23:uzRCQa5ZZ7vZptXz+XF8fAxRtOLHchMFZxGqfqrLsTDasY5as4F+v
 mQdWmiGbqqKa2GhKdglatm0oElX78PTyYVnG1Fo/Hw9Hi5G8cbLO4+Ufxz6V8+wwm8vb2o8t
 plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraCYnsrLeNdYH9JoQp5nOIkiZJfj9G8Agec0
 fv/uMSaM1K+s9JOGjt8B5mr9lU35ZwehBtC5gZlPa8Q5QeH/5UoJMl3yZ+ZfiOQrrZ8RoZWd
 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4
 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5m/
 +06M3c2TB64ibiq8PW7ctRWmcUzFZy+VG8fkikIITDxCP8nRdbIQrnQ5M8e1zA17ixMNa+AP
 YxDM2MpNUmeJUQVYT/7C7pn9AusrnD5bz1frkPTvact6nLf5AdwzKLsIJzefdniqcB9xx/H/
 D+bpDuhav0cHIywimXdoliKvMTChi/VY44bGLanyPE/1TV/wURMUUZLBDNXu8KRiEe4V8hON
 k889S8nrKx0/0uuJvHtUhv9rHOasxo0X9tLD/Z8+AyL0rDT4QuSGi4DVDEpQMMinN87Q3otz
 FDht9HmHzt0q5WOVGmQsLyTqFuaOyIYMGsDbi8sVhYe7p/op4RbphDSStduFoalg9uzHiv/q
 xiRtzQ3jbgXic8N1o248ErBjjbqoYLGJiY8/gjNV3ipxh94boWiIYev7DDmAe1oddjDCAPb5
 T5dxpbYtbpVZX2QqMCTaO8cPqru3NSLCzOGnW4oH6EczSus60f2KOi8/wpCyFdV3tcsIGG4O
 BCI6F4Kvfe/L1PxM/YpPtvZ59ACiPG5SI+7Dq28gs9mOMAZSeORwM15iad8NUjJmVNkr6wwM
 IzznS2EXSdDUvQPINZbqo4gPV4XKsMWnzm7qWjTlUjP7FZnTCf9pU05GFWPdPsly6iPvR/Y9
 d1SX+PTlUQHD7GkOnWLqdZPRbzvEZTcLcmnw/G7i8bZelY2cI3fI6G5LUwdl3xNwP0Oy7agE
 oCVUU5E0lvv7UAr2i3TAk2PnIjHBM4lxVpiZHxEALpd8yR7CWpZxPtFJsRfkHhO3LAL8MOYu
 NFeIZrcX6weEmSWk9nfBLGkxLFfmN2QrVrmF0KYjPIXJvaMmyShFgfYQzbS
IronPort-HdrOrdr: A9a23:a4e0ta7GnQECW44FJQPXwAzXdLJyesId70hD6qkQc3Fom62j5q
 WTdZEgvyMc5wx/ZJhNo7690cq7MBHhHPxOgbX5VI3KNGXbUQOTR72KhrGSoAEIdReeygZcv5
 0QCZSXCrfLfCVHZRCR2njFLz4iquP3j5xBnY3lvhNQpZkBUdAZ0+9+YDzrdXFedU19KrcSMo
 GT3cZDryrIQwVtUizqbkN1OdQqvrfw5evbXSI=
X-Talos-CUID: 9a23:F/GFZGDhgqU7R0r6EyN21lVTIeIrSXOH0EeXI3eFM3loWITAHA==
X-Talos-MUID: 9a23:uYqiDQmFMuxg+M/UGSR2dnoyG4Q3u/SELnomnI4KlfKIPCB7JAmS2WE=
X-IronPort-AV: E=Sophos;i="6.01,244,1684814400"; 
   d="scan'208";a="117255370"
Date: Mon, 31 Jul 2023 10:44:59 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Jason Andryuk <jandryuk@gmail.com>
CC: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>, Juergen Gross
	<jgross@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap
	<george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v7 04/15] xen/sysctl: Nest cpufreq scaling options
Message-ID: <0026cde5-2f2a-4572-b7c5-ec4b82272a8a@perard>
References: <20230726170945.34961-1-jandryuk@gmail.com>
 <20230726170945.34961-5-jandryuk@gmail.com>
 <5a6365b0-7809-4287-96fa-be7809d664c8@perard>
 <CAKf6xpvzKiCkNkWYQyngENmF4+VmT3EgTWubDrQ0OZXgK9-jJg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CAKf6xpvzKiCkNkWYQyngENmF4+VmT3EgTWubDrQ0OZXgK9-jJg@mail.gmail.com>

On Thu, Jul 27, 2023 at 11:05:33AM -0400, Jason Andryuk wrote:
> On Thu, Jul 27, 2023 at 6:27â€¯AM Anthony PERARD
> <anthony.perard@citrix.com> wrote:
> >
> > On Wed, Jul 26, 2023 at 01:09:34PM -0400, Jason Andryuk wrote:
> > > Add a union and struct so that most of the scaling variables of struct
> > > xen_get_cpufreq_para are within in a binary-compatible layout.  This
> > > allows cppc_para to live in the larger union and use uint32_ts - struct
> > > xen_cppc_para will be 10 uint32_t's.
> > >
> > > The new scaling struct is 3 * uint32_t + 16 bytes CPUFREQ_NAME_LEN + 4 *
> > > uint32_t for xen_ondemand = 11 uint32_t.  That means the old size is
> > > retained, int32_t turbo_enabled doesn't move and it's binary compatible.
> > >
> > > The out-of-context memcpy() in xc_get_cpufreq_para() now handles the
> > > copying of the fields removed there.
> > >
> > > Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> > > Reviewed-by: Jan Beulich <jbeulich@suse.com>
> > > ---
> > > NOTE: Jan would like a toolside review / ack because:
> > >     Nevertheless I continue to be uncertain about all of this: Parts of
> > >     the struct can apparently go out of sync with the sysctl struct, but
> > >     other parts have to remain in sync without there being an
> > >     appropriate build-time check (checking merely sizes clearly isn't
> > >     enough). Therefore I'd really like to have a toolstack side review /
> > >     ack here as well.
> >
> > I wish we could just use "struct xen_get_cpufreq_para" instead of
> > having to make a copy to replace the XEN_GUEST_HANDLE_*() macro.
> >
> > Next I guess we could try to have something like the compat layer in xen
> > is doing, with plenty of CHECK_FIELD_ and other CHECK_* macro, but that
> > would be a lot of work. (xen/include/xen/compat.h and how it's used in
> > xen/include/compat/xlat.h)
> 
> I can add a set of BUILD_BUG_ON()s checking the offsets of the two
> structs' members.

Yes, that would be fine.

> I think that would work and we don't need the
> complication of the compat code.  The build of the library just deals
> with a single bit-width and needs to be consistent.  The hypervisor
> needs to deal with receiving differing pointer sizes and layouts, but
> the userspace library just uses whatever it was compiled for.  The
> preprocessor expands XEN_GUEST_HANDLE_64(uint32) -> "typedef struct {
> uint32_t *p; } __guest_handle_uint32", so it's just going to be a
> single pointer in size, which will match between the two.
> 
> Does that sound right, or am I missing something?

That sounds about right.

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 10:08:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 10:08:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572870.896948 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQPos-0006Ud-D0; Mon, 31 Jul 2023 10:08:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572870.896948; Mon, 31 Jul 2023 10:08:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQPos-0006UW-AG; Mon, 31 Jul 2023 10:08:06 +0000
Received: by outflank-mailman (input) for mailman id 572870;
 Mon, 31 Jul 2023 10:08:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQPor-0006UM-85; Mon, 31 Jul 2023 10:08:05 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQPor-0004L0-6E; Mon, 31 Jul 2023 10:08:05 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQPoq-0001j4-T0; Mon, 31 Jul 2023 10:08:04 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qQPoq-00019a-SR; Mon, 31 Jul 2023 10:08:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=KYJqaxEPVwSeTQqLor5CZuBmCccN1nBihy3h43OA6sU=; b=CvHmQK/qoEKAHGEL7HmdapzgZ9
	+yfefYIRPD5gOlWaRnbI2MG6TDalOXZWAs55Vq1kwdgJmBsqpMh41EIN23ilWnNBCJ5L4KBxJk69d
	BKLPigzrpqA0nP2sPGtKx7qLYj3VLS8DpoacKEURy6HqPKgW5xLm0FpqAOnPzGuKwyPU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182083-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 182083: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-libvirt-raw:guest-start:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:guest-start:fail:regression
    linux-linus:test-amd64-amd64-xl-credit1:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=5d0c230f1de8c7515b6567d9afba1f196fb4e2f4
X-Osstest-Versions-That:
    linux=6c538e1adbfc696ac4747fb10d63e704344f763d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 31 Jul 2023 10:08:04 +0000

flight 182083 linux-linus real [real]
flight 182086 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/182083/
http://logs.test-lab.xenproject.org/osstest/logs/182086/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-libvirt-raw 13 guest-start              fail REGR. vs. 180278
 test-arm64-arm64-xl-vhd      13 guest-start              fail REGR. vs. 180278

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-credit1 20 guest-localmigrate/x10 fail pass in 182086-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt   16 saverestore-support-check fail blocked in 180278
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check fail blocked in 180278
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail blocked in 180278
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 180278
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 180278
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                5d0c230f1de8c7515b6567d9afba1f196fb4e2f4
baseline version:
 linux                6c538e1adbfc696ac4747fb10d63e704344f763d

Last test of basis   180278  2023-04-16 19:41:46 Z  105 days
Failing since        180281  2023-04-17 06:24:36 Z  105 days  195 attempts
Testing same since   182083  2023-07-31 00:41:50 Z    0 days    1 attempts

------------------------------------------------------------
3874 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-freebsd11-amd64                             pass    
 test-amd64-amd64-freebsd12-amd64                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-armhf-armhf-libvirt-qcow2                               pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      fail    
 test-armhf-armhf-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 651356 lines long.)


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 10:33:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 10:33:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572878.896958 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQDP-0001S8-FH; Mon, 31 Jul 2023 10:33:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572878.896958; Mon, 31 Jul 2023 10:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQDP-0001S1-Ch; Mon, 31 Jul 2023 10:33:27 +0000
Received: by outflank-mailman (input) for mailman id 572878;
 Mon, 31 Jul 2023 10:33:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+d4S=DR=invisiblethingslab.com=simon@srs-se1.protection.inumbo.net>)
 id 1qQQDN-0001Rv-Pu
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 10:33:26 +0000
Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com
 [66.111.4.29]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ab6e9b9f-2f8d-11ee-b254-6b7b168915f2;
 Mon, 31 Jul 2023 12:33:23 +0200 (CEST)
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailout.nyi.internal (Postfix) with ESMTP id 79AA95C013A;
 Mon, 31 Jul 2023 06:33:20 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute6.internal (MEProxy); Mon, 31 Jul 2023 06:33:20 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 31 Jul 2023 06:33:18 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ab6e9b9f-2f8d-11ee-b254-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-transfer-encoding
	:content-type:date:date:from:from:in-reply-to:message-id
	:mime-version:reply-to:sender:subject:subject:to:to; s=fm3; t=
	1690799600; x=1690886000; bh=gbZ43CfdF993NYpYySwQkSalc5T7JSkZ6hd
	i7rJBdL8=; b=onaTmr8w6gRMgtzg0ShO/oYjFgAo2zSgdPX20qtJrZW3lSSzCQi
	q2YKnlf7PVDMTYp7qOrMfwttKSOTwhIYWMQ2UOT4iaU+o62sPLO0WIqJY6pjEzIu
	iGBguKokk+5WbrG1ETaVtguk/RVo0lZqklzZ5AaSh6qTOYrwbtbIt7Z6Ko0kwh/g
	YO9rpzcWfg9OJ7MS8vSU24Lu9SexKGel8JHna5FziqQ39xcZTpgJlzl2KLY7azBI
	VHz0YzmhC3mPfj/Os9ZBBI0M8JKHjtDuBUqXkmWU08OIW2G5HsQg/e6FAjoGr6n1
	RFDZgcDeRAI1oOsfaU3e33mZs2dEf+zQNHw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-transfer-encoding
	:content-type:date:date:feedback-id:feedback-id:from:from
	:in-reply-to:message-id:mime-version:reply-to:sender:subject
	:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
	:x-sasl-enc; s=fm3; t=1690799600; x=1690886000; bh=gbZ43CfdF993N
	YpYySwQkSalc5T7JSkZ6hdi7rJBdL8=; b=3SBiZjD4+BSwUf4OsqiCdkYKtNoy8
	vGRQWhGZE52JdCVfi3XBypWPXvPXkTVw8ZxH41jwbiuNYAH5Tb0QkUNPkmR79iT4
	bPG6ScCdjSvHbd/lE9fDtf4hIGi9IgrRdfjZorMYBI6TebOmtxn+2eh/MZKhfs2D
	Y1pSQO5cX76frQ3Y96dIVTb4ubDLAftyQFFK6M73NBqsbMXT8ndhUu6vhuxkWGSB
	glqCtocQ73NfTC9jE+Z1wJ8IxN3SNr1InzJQcywX8AbKSM0G5/1/Q8V9MpPiJ0ew
	uEuvGuTeAzepd8UPaXUNbZ3kMqXqAyWjb1RycgU+IeV3T0aED+53avQqw==
X-ME-Sender: <xms:8I3HZAPPwe0f6Y-Y_yewYqrr-Wl4YQKQRZ7oS7Ff99SOyrSCS9jZsQ>
    <xme:8I3HZG_yOxRvA3emdq1bMAYTHXHAsifePdfHcjL-27fYV3DrbN2trNQcke8g7a34A
    cmzekkIDDncegk>
X-ME-Received: <xmr:8I3HZHRLCjH7ANAM7r4Ckc_AyNx4ykw3TFpmIjgkhENZGB2XwHfYDjPgB8jy>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrjeeggddtiecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuihhmohhnucfi
    rghishgvrhcuoehsihhmohhnsehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh
    eqnecuggftrfgrthhtvghrnhepueevheegtdefgeefuddvfeduueduffffffejveeugeef
    udefiedugedugeevudfgnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhush
    htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsihhmohhnsehinhhv
    ihhsihgslhgvthhhihhnghhslhgrsgdrtghomh
X-ME-Proxy: <xmx:8I3HZIvE_4yFjp_CHsIIfDsXqWlBWll0-U3ndD0grs_QuH2wvA0l6Q>
    <xmx:8I3HZIdV48l2PkadtEIjQAAsXm5jxFT11nOHv9hDdLICRnbkz7Fntw>
    <xmx:8I3HZM1Q_Z_Vo3IFodbE2tx1P-6OulUU2-tx5RQV4gUnIoJrduLaNQ>
    <xmx:8I3HZH4gqXkSU7hR_nUJH_y7wY-ut6PIKdL7NaDqbcAAXjlFUTYBag>
Feedback-ID: idc5945a3:Fastmail
From: Simon Gaiser <simon@invisiblethingslab.com>
To: xen-devel@lists.xenproject.org
Cc: Simon Gaiser <simon@invisiblethingslab.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [XEN PATCH v2] x86/hpet: Disable legacy replacement mode after IRQ test
Date: Mon, 31 Jul 2023 12:32:12 +0200
Message-Id: <a112f0fbbb333fc29a35d0a81853d59409a33fde.1690798460.git.simon@invisiblethingslab.com>
X-Mailer: git-send-email 2.40.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As far as I understand the HPET legacy mode is not required after the
timer IRQ test. For previous discussion see [1] and [2]. Keeping it
enabled prevents reaching deeper C-states on some systems and thereby
also S0ix residency. So disable it after the timer IRQ test worked. Note
that this code path is only reached when opt_hpet_legacy_replacement < 0,
so explicit user choice is still honored.

Link: https://lore.kernel.org/xen-devel/cb408368-077d-edb5-b4ad-f80086db48c1@invisiblethingslab.com/ # [1]
Link: https://lore.kernel.org/xen-devel/20230718122603.2002-1-simon@invisiblethingslab.com/ # [2]
Signed-off-by: Simon Gaiser <simon@invisiblethingslab.com>
---

Changes in v2:

 - Always disable legacy mode after test, not only when ARAT is
   available. See [3] for reasoning.

[3]: https://lore.kernel.org/xen-devel/ac77ecba-6804-1d16-60dc-f184e5d31dcb@invisiblethingslab.com/

---
 xen/arch/x86/io_apic.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 041233b9b7..b4b4cd5939 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1967,6 +1967,8 @@ static void __init check_timer(void)
 
             if ( timer_irq_works() )
             {
+                printk(XENLOG_INFO "IRQ test with HPET Legacy Replacement Mode worked. Disabling it again.\n");
+                hpet_disable_legacy_replacement_mode();
                 local_irq_restore(flags);
                 return;
             }
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 10:37:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 10:37:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572883.896967 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQHA-00023y-Uq; Mon, 31 Jul 2023 10:37:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572883.896967; Mon, 31 Jul 2023 10:37:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQHA-00023r-SG; Mon, 31 Jul 2023 10:37:20 +0000
Received: by outflank-mailman (input) for mailman id 572883;
 Mon, 31 Jul 2023 10:37:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQQH9-00023A-LH
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 10:37:19 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20622.outbound.protection.outlook.com
 [2a01:111:f400:7d00::622])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 38e497cd-2f8e-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 12:37:18 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PR3PR04MB7243.eurprd04.prod.outlook.com (2603:10a6:102:8c::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 10:37:16 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 10:37:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 38e497cd-2f8e-11ee-b255-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=oO1w7LW19R2Z7lPSZ6ntbvR69i1X8VfsvfZf/CNDq7Eo+/eNP3073ccvR2ffGCXGgxo7p73vQYtKfzRvOHUHJJTwGs6d8zrIwzrgSFdemqfj2crqYvvp9Gi/U1M+wgyE0whUICRVIZFdJdHQJbT9fEQP7zZCQIc3hsbKltHCAP4+KwaDTFPWwhSO2KBndKdK1fWJxBBlfPTL4MQiDP2T49pYhjE94LZkpE0GueAcRRRD+JixV0m3wtbmPZ1+P3pOXuUF2kZywoIR1Cdc3Jj802PA0Cbg4tkXKBBbbvPmInEa80m8l9tRul+2ou4i/QKcXNtWPe65ECFjO8aKwlDpog==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MJpp6qr5ls6DFsVwk71i7NZrucn024HOf3H9y8hTnqs=;
 b=NvJwzo4ARtSvR55hLLiryMkvDvmH0W6ykUW/G5UbhLHgxa/pv0y9qHK/BN6HlsUK8i4OoaIpy/Mn7USMkK/zvVHuA9T4GZPKlU24oI2ya4AyGffs/JinJywXApnT/QW+jUQwtNV5p+9dF4wo3wyu2W94G+OuyEFUV5wZ7T3JX1LMSZ1/LjJvLubdaGwEBQa6t+oXX8AS2BQympS0+WtflOeGfqtMlU3K8ytU0PQOcH5cxkBsz1irJiCSNlka3zPTutZ0X1HSnNl4jzL1GBGCtaVCA3mysTMBg5IJzTvKaCVypgnyujiBH0oAZfL6glmy4VkCD83RvivazLgUA/jcIg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MJpp6qr5ls6DFsVwk71i7NZrucn024HOf3H9y8hTnqs=;
 b=fmy0UvvIXdhXLZBYhz9WOZtnQ4zlyfZUM7XcQzYcSMKcvTCj87t0PVn7Ow8DeoBVCmmEE+h3UBlA8JYhO99eEvP4C3GN4K9zGIrwT6CvOTazYIPzVB7kr3dmn1XbYG6wkKEGRAEWdS1We6+BkPfPihbrkOmeMAjvicF+Ghi9BEbdlFYvk/GqM2dT5Y0Qu1SVqlOfOxjUrn08nOP46rDBECPXBSYDzNPmb05aWU1rYePy/bgXEdk8rHUEflWf6bhWzw8D33gkMYGKUiZ6WGmpVOYTitGiXX8ZYqEsYteGHxehUSdLeA8rQn70GZn62W34Yh2aHEdAPAuA6+7KYPJkAg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <894c5f35-c41c-e27a-a11a-aa777ba7329e@suse.com>
Date: Mon, 31 Jul 2023 12:37:15 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [PATCH v3] amd: disable C6 after 1000 days on Zen2
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20230728144729.17446-1-roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230728144729.17446-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR2P281CA0180.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9f::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PR3PR04MB7243:EE_
X-MS-Office365-Filtering-Correlation-Id: a4a402f9-291f-4bfc-f9a5-08db91b21ba9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	nMrGaa8XOeF0PnaT4BS2Lz5jMIYVP3NQmsl9PgVMkmd9C9GU10EC3QWC7nAhBXkXRezuDe+gaJ5hactn5lMRlG9jZgIYfFLBED7SUtlxP/GEAoXLeB4cP022vlcHWtAFIUok/ikQ3ZwLioj4X+fhZUws0L8rJEP8HDLZNL7qbUpIz5eoMaavzRhrwTtp7jtUaqUYPN8cOn5ZaISAFG3zvq4D7kflOKGLUmOOaw3YXvztMnSmAdj4iaQIS2UdrbXqxrRQpyjqb+rn0KqnZ0iqTO0qbr/PndX7T5o0diUSyX4eARmaudGhFPBLe3e5g2706lLger+aFwpXrNR6Dg1IEHj3IlpOfNFSZKrLSrE/5iBFpc9PI4En2Qlxt3luRcb0yQyJ1XPFY6OY2sO4O14GJnsXv7BwCXkSH4H5NzdjKYbeAp4QqXhtX4haEI3Y+44o6jCfm2pBLI1iB4FGak0DwKggqOD2TMg2/5hGwcGcEURE45L3r00IHxumCn3peseLVSDJdRpHKxUtx7k5j8oRrI7BFOgklMjrPV53eN9j1qBeVVPZ2vxeaPADG3Kry8Rw16BRF1roxzvZI2pFIJrM74djnJHXpr3YXJ4OMvhtoBgSOHwip0i7rbYYAnfnKrFfeAl47BFaJvSJteETZUC3J1n5NX086MvhwLpSvvK3nYE=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(396003)(136003)(39860400002)(346002)(366004)(451199021)(86362001)(66476007)(31696002)(41300700001)(8936002)(31686004)(8676002)(316002)(6916009)(5660300002)(4326008)(66946007)(66556008)(54906003)(478600001)(2906002)(38100700002)(36756003)(6512007)(6486002)(6506007)(26005)(83380400001)(186003)(53546011)(2616005)(221023011)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QSs4TWtENFdNalorSTBzeDhsVlpOM0djT3YxY201RlZMZkoyUkthcm5US0x2?=
 =?utf-8?B?K0lCcHRFZUdzNnlXVzJuL1JmRmFWTmsvUkwvL05hTTVEbXhpRXZaai9jMFpp?=
 =?utf-8?B?OFFlMlNxUGtOMlJrN1R1U0Y3c1NQV05PNXhydHZhVFQ4ZEU5RmpBeldtMWhv?=
 =?utf-8?B?MXdEenA1K29ubTQ0azRsM1l3M3hwNVBWN3kvbFlTSmw2MGRkbjRPdU92T2pN?=
 =?utf-8?B?akFQWVRwUGtnS1pnNVpCTk1vcTNtcEgzeGJKVG9QWDRNRE1VaEJFSmM1VUVk?=
 =?utf-8?B?OWlWNTdid25JQVJ6M0d2bFdtSnJwSVRLNkdEMmxJc3RuME5xNUNFSFh5ZGJW?=
 =?utf-8?B?aXh6OVRpRXBnK25QeHN0TU5tdjZ0VEtpQ3ZONnJUdlh2alFvTENKalo2RDRD?=
 =?utf-8?B?VTdZOFExYmJRTDhsRzNEQlRlU1NCQXVmRWhs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-4bfc-f9a5-08db91b21ba9
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 10:37:15.8777
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: pJVA3erkbDbwSZetjQRorWLTilxJ8Y1tx544H6KZbzfP/HLvdifagSYLtnKG/3MR52B3FoYIRXp6XkQk4q6V7g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7243

On 28.07.2023 16:47, Roger Pau Monne wrote:
> As specified on Errata 1474:
> 
> "A core will fail to exit CC6 after about 1044 days after the last
> system reset. The time of failure may vary depending on the spread
> spectrum and REFCLK frequency."
> 
> Detect when running on AMD Zen2 and setup a timer to prevent entering
> C6 after 1000 days of uptime.  Take into account the TSC value at boot
> in order to account for any time elapsed before Xen has been booted.
> Worst case we end up disabling C6 before strictly necessary, but that
> would still be safe, and it's better than not taking the TSC value
> into account and hanging.
> 
> Disable C6 by updating the MSR listed in the revision guide, this
> avoids applying workarounds in the CPU idle drivers, as the processor
> won't be allowed to enter C6 by the hardware itself.
> 
> Print a message once C6 is disabled in order to let the user know.
> 
> Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
with two remarks:

> @@ -1249,3 +1282,44 @@ const struct cpu_dev amd_cpu_dev = {
>  	.c_early_init	= early_init_amd,
>  	.c_init		= init_amd,
>  };
> +
> +static int __init cf_check zen2_c6_errata_check(void)
> +{
> +	/*
> +	 * Errata #1474: A Core May Hang After About 1044 Days
> +	 * Set up a timer to disable C6 after 1000 days uptime.
> +	 */
> +	s_time_t delta;
> +
> +	/*
> +	 * Zen1 vs Zen2 isn't a simple model number comparison, so use STIBP as
> +	 * a heuristic to separate the two uarches in Fam17h.
> +	 */
> +	if (cpu_has_hypervisor || boot_cpu_data.x86 != 0x17 ||
> +	    !boot_cpu_has(X86_FEATURE_AMD_STIBP))
> +		return 0;
> +
> +	/*
> +	 * Deduct current TSC value, this would be relevant if kexec'ed for
> +	 * example.  Might not be accurate, but worst case we end up disabling
> +	 * C6 before strictly required, which would still be safe.

I'm not really convinced of this being the worst case. TSC can be
written, and hence it could also have been altered in a way making
things look as if system wasn't running for a long time when really
it has been. But I'm okay to leave that special case aside right
now.

> +	 * NB: all affected models (Zen2) have invariant TSC and TSC adjust
> +	 * MSR, so early_time_init() will have already cleared any TSC offset.
> +	 */
> +	delta = DAYS(1000) - tsc_ticks2ns(rdtsc());
> +	if (delta > 0) {
> +		static struct timer errata_c6;
> +
> +		init_timer(&errata_c6, zen2_disable_c6, NULL, 0);
> +		set_timer(&errata_c6, NOW() + delta);
> +	} else
> +		zen2_disable_c6(NULL);

Strictly speaking you don't need the if/else here, since timers set
in the past will simply have their handlers executed right away (and
if that wasn't the case, there would be a race here).

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 10:42:20 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 10:42:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572887.896977 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQLv-0003UI-IE; Mon, 31 Jul 2023 10:42:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572887.896977; Mon, 31 Jul 2023 10:42:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQLv-0003UB-FJ; Mon, 31 Jul 2023 10:42:15 +0000
Received: by outflank-mailman (input) for mailman id 572887;
 Mon, 31 Jul 2023 10:42:13 +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 <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQQLt-0003U5-SH
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 10:42:13 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0610.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::610])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e799d2e9-2f8e-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 12:42:11 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by GVXPR04MB9778.eurprd04.prod.outlook.com (2603:10a6:150:110::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul
 2023 10:42:07 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 10:42:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e799d2e9-2f8e-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=SIq9WTz9eY5Sz54fEDUs2ww9xjijbyzFeJprGO7+ctZIAFcKNO/JX/17cFuHh+LsDAAf3dSwDjQsF3DXv8DAPSYQz5K77pL0+sAdjITjofiXFzqQ7vYKrJlVEyestcbqER6B9fKPzHtdUPUNIJ4S6vUJZjoxsNbk0Pkz1aNN5n4GjeV3NPseaWs9qtqvhJP5JJStt2Cfd/bjJcA3qtwmLxwgJDodjU6gAu065V6U+PLpChfzQLdfZPnMNRwmYyZ2fBauZWjNxIWkYVYh6bXicSfMsX+ktxU5TSFYdahnTMiBTz4nJ6vfcTjg9V8XWjgNkthQ05hxnCwmImNTpPpCRQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=bxcWbuG6pYAfIrM2OIbIli2RThg4K/IU7PnaTQ/lKKM=;
 b=fVxZG9gOyjJEUJdBwR2xCyTpfSB8t77zDDLXlhWolg0eKMPkMhJtUZvNZPFjHy3BN1vumLb78aaPZyg/BB9kTVj31GFBBUAAhts15wYy538T+FQmHvqPaRhFMh26JUeJpuB8HkRoc4PtfpM14QivmdTIXefoZrf9v10bUT2Rp04uLloFsIYh5uyZcRISQqgYI6Zt1V5Az2gbYKxF3UynaGfpcOaigYM9Ti9fQwVzVAlYGSKp/seIDzJGfo6nFUYFlvq3QOVi+56uq6TFZilw8RzCS9L0iq24KkiCXPG0hZI+1LXAKKDu+PZS6aeiIdJ3WvCuVsXXSD/XlXAanR9wyQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=bxcWbuG6pYAfIrM2OIbIli2RThg4K/IU7PnaTQ/lKKM=;
 b=OQ8P6eKXwaKIx3tCV0fhYBhvJ/9mJVUUjiTwbrUauERCLPqgMAeNlJ9d7IYffzl9MXtz1zGPscDBQyAsS7DpfLbgzT+btQCA/DGCJnlUdRXD+65kebIm0sitrmy+fOTTiGKN2uA5YskpCUfLZOBYLEpZZEHZf+ZUCtu7/ovrh3FOSaxdY9omujZz4S/tInk6uhq0IkWXbcFSslnOdl1GySkDrsAL7wmmQifJSszyo4MQOjzpPe972YQWWdslgeq7S2O/++PMRVei+AfxIJe7/0xQVySWWKkbNHvMg7tiHWAOhscidI441mglloRTpN98AUjJ1vLiUyaWNXVU0BPoGg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <abbc82b3-dbc2-7463-43e0-414b2b294e78@suse.com>
Date: Mon, 31 Jul 2023 12:42:06 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [XEN PATCH] IOMMU: address violations of MISRA C:2012 Rules 8.2
 and 8.3
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
 Paul Durrant <paul@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Michal Orzel <michal.orzel@amd.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <ba140642a267791c619dbbe2ba21f880c7e2b53e.1690551759.git.federico.serafini@bugseng.com>
 <alpine.DEB.2.22.394.2307281626290.3118466@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307281626290.3118466@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0110.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a3::7) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|GVXPR04MB9778:EE_
X-MS-Office365-Filtering-Correlation-Id: e213a0f5-e8e0-4ee5-bf71-08db91b2c957
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	WGtI+vBrL/n/mlMCNKgnddboQx7T9ZJay46BIgGWpM5zPnP9tTQmOUDrBSLV2M4rP1CtTiWgFZ3kBWniwb+WGTMNrAVlQpclOTu68cLO9S2ZKdkVYbf/Z7ORrEgGzi2cdBnrqJYIiO7N09fy8B8+KOfBQjQ2XT8C+O6zSrzg7bQIx/+DGKPxQxVjsTXJxISEugYu12AO7W3YRBVVByvY1X2rcV3B5+pHDzamSfnr8B7kZG327uPtdtYTDwWyofl0QU/+f4CJa+lAKRHVJBl7JswkeoWqpAY4mC8wl/0tLz5cPANVfWQiyKZotgctSEje+2EuqbIw6KopdxTXvw0DWUP8yNH/kcWk4NAUsN4E6pOcKcBwix6Q/ca9AsYQKmBJiOPgMHt0ZzRjQ6QInurRk8/rnZec6piVoLBQxypgQSMffcYaSvYmlog6CFiricXZ1NnYYH7TBaloX4Tbwxa8utRWz+nXDJMC3UChnrBdnoTMlW2hGcXk6qt+KDQtFCIBHFtqdplmr9O26DbAwoAFfRUkSNKgRUPjhX2JpMYJb3ASc+I3Rd099NIlXfgXuUtpJt6QIJ5GhvCc0LeQ3hP1OrMbkSPsY3Iwqa5kv1xWMhnSdYI2zg1hlqd14QpBU9V644A9pg9CYvQ+Nga2MWilYg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(39860400002)(136003)(376002)(346002)(451199021)(5660300002)(6916009)(66476007)(66556008)(66946007)(2906002)(4326008)(316002)(31686004)(54906003)(41300700001)(2616005)(6486002)(8936002)(6506007)(8676002)(26005)(53546011)(186003)(478600001)(38100700002)(36756003)(6512007)(31696002)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NDQ3cEJWcWFRMTJPN251eXVqTHBNU0t1OHorekl5QTQ2b2puTmhZM2M2cFdo?=
 =?utf-8?B?b2c4cnBuZnF1d280YlBKSXpibitPRU1hNGVrWHVuWGNHbllrN0pmUnQxTzNk?=
 =?utf-8?B?N1laQjhvUVViR1JhM3p1THhlWmovVG84aWFud1E5YnFNZTFTaWRBeDFYVm9M?=
 =?utf-8?B?dHNZdytaNzVTazZOSzk4YlR5c2ozR21yYXlNWkpmZTA3d0l0L2QvR2cxWFJX?=
 =?utf-8?B?enZiUkhVYW1yMkZOMVVxL1h4aVNybnE5OGdKWTdjU1N3NVh4cUkvb0RMQU1l?=
 =?utf-8?B?U3FJWkh6OU5xcXVqNVRydmF0S0tUK1YvLzZqaVMzNnpla3ZMQWMxV3ZybnNG?=
 =?utf-8?B?MzlMNVRLTUZuaFk4TGtPNDk5dElncUFZa08rNXZSbWdiTDNueXZWeWxnVk9w?=
 =?utf-8?B?aXFZeUdheTVPN2lCMmZNZXBkVkZZZXhCZW9Cbk16ZEIxS0g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2c957
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 10:42:07.2586
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: afSNO103Cva91ATkbbLPHMKvf4fECDK/Fbmka130MsDnvYgdX6udheOi2jJJGp7gQQf7+SXvhNt+jdng7WW9qg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9778

On 29.07.2023 01:29, Stefano Stabellini wrote:
> On Fri, 28 Jul 2023, Federico Serafini wrote:
>> Give a name to unnamed parameters to address violations of
>> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
>> named parameters").
>> Keep consistency between parameter names and types used in function
>> declarations and the ones used in the corresponding function
>> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
>> ("All declarations of an object or function shall use the same names
>> and type qualifiers").
>>
>> No functional changes.
>>
>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Acked-by: Jan Beulich <jbeulich@suse.com>

>> --- a/xen/drivers/passthrough/iommu.c
>> +++ b/xen/drivers/passthrough/iommu.c
>> @@ -25,10 +25,10 @@
>>  unsigned int __read_mostly iommu_dev_iotlb_timeout = 1000;
>>  integer_param("iommu_dev_iotlb_timeout", iommu_dev_iotlb_timeout);
>>  
>> -bool_t __initdata iommu_enable = 1;
>> -bool_t __read_mostly iommu_enabled;
>> -bool_t __read_mostly force_iommu;
>> -bool_t __read_mostly iommu_verbose;
>> +bool __initdata iommu_enable = 1;
>> +bool __read_mostly iommu_enabled;
>> +bool __read_mostly force_iommu;
>> +bool __read_mostly iommu_verbose;
>>  static bool_t __read_mostly iommu_crash_disable;
>>  
>>  #define IOMMU_quarantine_none         0 /* aka false */
>> @@ -57,7 +57,7 @@ int8_t __hwdom_initdata iommu_hwdom_reserved = -1;
>>  bool __read_mostly iommu_hap_pt_share = true;
>>  #endif
>>  
>> -bool_t __read_mostly iommu_debug;
>> +bool __read_mostly iommu_debug;

Lots of data objects are fiddled with here, so I guess the description
would better not talk of only functions. I guess adjusting for that
could be done while committing ...

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 10:43:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 10:43:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572891.896988 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQNA-000450-VM; Mon, 31 Jul 2023 10:43:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572891.896988; Mon, 31 Jul 2023 10:43:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQNA-00044t-SZ; Mon, 31 Jul 2023 10:43:32 +0000
Received: by outflank-mailman (input) for mailman id 572891;
 Mon, 31 Jul 2023 10:43:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQQNA-000446-8p
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 10:43:32 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20620.outbound.protection.outlook.com
 [2a01:111:f400:7d00::620])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 173b2516-2f8f-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 12:43:31 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU2PR04MB8758.eurprd04.prod.outlook.com (2603:10a6:10:2e1::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 10:43:28 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 10:43:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 173b2516-2f8f-11ee-b255-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=FzcQgBB7fjQhcquR5Pn8eyOnpSwSbzKc9baOMyFMD7rPGWF0WLzRksFJ4AzJwmbWtbtWcxGI58oy08hnueeDp73ukZQBRwo0QdJ0pXxuCjV33s9YsAl+mBCGwJuUivapnF7nQ5r8OFs6eecd/GEc0AShMsM4OBwineI/eiqFOoY+wrH8GRuusv+4BryRBRliSM/7Q59CaqcYQSBwOeIGsC7h33jr6UBHeoHDYUD7lCIl4cilh+4Gm/GCuCsCqySStoge0J8pLXSrNEMBesz2FXFr10JU4fe29AAxJT4QC7hpUNPTm+H889QeQzScDV3KaH4cZ/p8w05Q9ZZ0pw6Z4w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=hIq5/QpSKmiKYh8iwioBUkNa7kq8jFvz7oASsacbaeg=;
 b=it8G3/+7M6yKyFp1U/geLxFP8kLgIGzKzTKmdJuT2g4p5ASAIfCseoaVKl2eWGhPtLEnLvgtevWwoyeW/bWYRBY7z9V64zlvSvlzLC0Da43xapmtlyNLLvjNC3E14Gio8Ur9WYPYCHqC2/Q864QvwSpLfuHQbBnS8niJwGyTh1hRHrPGt7zhCUkPPEbPN/eJhj8V88vUqu7tHvdfcd2OM+gXW2tj31zX7dXn0fbNQGYt+5gReXWorzlTaHTES+SPkdpcSU7r+4inWagEA+tEXkajICW9jlJGUyswjjhQf4necXhDE1xuCHNJ7VSMW/RcvFm5RctpgNOWScO8dHbDHQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=hIq5/QpSKmiKYh8iwioBUkNa7kq8jFvz7oASsacbaeg=;
 b=YYNWkVAc1AMZa4P7z7UShwFvkJz3lXbEwcx2OP9yjPgs5exIuOCjxmWXU7FRTyLhxdQ61bv8LnwisVzQCz5KLvEHmEsWiWg7/wGOLQEGLhE8tAtRPOiWO09s05AJ2/sndjRC3bUxLJWFoBOXLbWSR5rf86yJz/pslIMisXlm9IDCZYFYrJcDRK1b/29fiOA9qAgDyePAb+CTcP2cg0ZwxfjV6C0P0COTvrNsxWB3qSq12ktjL7Xwlb5W6WoXPD+zZT/MVsl5skVfqRnVqPf2r15qDmkQFQ116Yk2HjL4PZjWGpRQozA5lpQH4GnNignbsPn+YOmrUMHK3EKc3rTV3g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <51611f7a-3090-fa3d-3111-49bc9cd14ff5@suse.com>
Date: Mon, 31 Jul 2023 12:43:28 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [XEN PATCH] EFI: address violations of MISRA C:2012 Rules 8.2 and
 8.3
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <83d4091852797044209272dab750f13f7d30d35c.1690792406.git.federico.serafini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <83d4091852797044209272dab750f13f7d30d35c.1690792406.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0113.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a8::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU2PR04MB8758:EE_
X-MS-Office365-Filtering-Correlation-Id: c66223a4-1be1-410f-669b-08db91b2f9e9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	iTLb+IIHgBdy9XopOMi+hzgtroZ/+1Fwzwx4JQjcT9Tlq5ljyVzdgbQ1fS5cCj90Taw2JAMLD58J5fczR/9imSvetq2+0NQsOLCJXhYQ8XYmFQ2DA8rIEVdwBKT+7N6FbZoPdArwi72J4i+vXl6qB10MjwgNAjua765mt6VFPrTOo2fd9526GGUBrqDLjX3f3y/aarAC+kURjj0i6Yt2KRzfcl3xEyBvKAJU9Zylmyu3q52MI5Imz07X8CYMjasOt51Td9HJLYYIZCWrgXbOllwBUYO6L+fSvB114PhjyTiQsHJ1taIGFMw2lxy6Drl1QT6fPTwZnyrYt3jZYiDYBYbKhwP9Tr8dG8LK7n9cXNyULSWmzzJWGpVrnBLyJr8XcidsOWvzToU23DVXi8oYdc044sACCB8CpXYAOqpkSqsALZRnefzlaCJQDfp0bvivV9jqh/bWMzIMuBVXJPORpYVtkEE6zo9GbYh4uY2/otrUY/vkXhX1jycX3iNGhgitNISwuq8EdowBRhXP/Bgv7T1uD0e+0ao5JIQpYYeH0w9eVoH/xjFbjo8qlLSwiF8EgBJ/Vcr2f2iVTWfLlpMJBqsMHhxfX6wP5WWnl2iZgMR+CRs8ED5+isY98fjOa/39XkGs52Au94afR/PqZGUwvg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(39850400004)(396003)(136003)(346002)(366004)(451199021)(66476007)(86362001)(31696002)(41300700001)(31686004)(8676002)(8936002)(316002)(6916009)(5660300002)(4326008)(66946007)(66556008)(54906003)(478600001)(4744005)(2906002)(38100700002)(36756003)(6512007)(6486002)(6506007)(26005)(186003)(53546011)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0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VTRZdUEvRVZZQy85NHFXb3N1?=
 =?utf-8?B?OUhGTnBEU3B5ekE0QmJZaW1uTlQ0MGZTRTl6YUVqWE4yQVU1dzdXUGJudXds?=
 =?utf-8?B?SmQvb2t5d0NpbU5SalFGK3M2cGJNMjFNZTY5MzVDZUxmMzBvWTVCUHc0eGN3?=
 =?utf-8?B?MlliVW1FOW1jV3FhaHB0Sk5QYXVyaG9razBjQjFHc0JibksvNjRacGdUNjBv?=
 =?utf-8?B?V1UyTEFEM0xQOU5iR1lFMXcwblB6UkNRakhWUHV0elJkVzYvTy9zSjBTaU5j?=
 =?utf-8?B?dUhvR0pEc1VqN1h4alRjVXBkMlNoRHU2emFHNFMwVW1sckd2VWhLMk5aVTFF?=
 =?utf-8?B?NGw0ZVlpZXo3WWJCa2dLMUhSWEMrQ1RNNXVmaTY0U1F5aVAvOXU3ZCs4MEdQ?=
 =?utf-8?Q?Dq1rUj5zbQ/hTdAKbINUz0Dt3?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c66223a4-1be1-410f-669b-08db91b2f9e9
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 10:43:28.7395
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: GL7b9pLi0EUmQydj6mdq4ltdXSXxhGbEJ1d+gtrfJvTyl0+949b4NBlRKi3aEYFmCPBe7/NLGvrlrl+644hzBA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8758

On 31.07.2023 10:35, Federico Serafini wrote:
> Give a name to unnamed parameters to address violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names and types used in function
> declarations and the ones used in the corresponding function
> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
> ("All declarations of an object or function shall use the same names
> and type qualifiers").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Mon Jul 31 10:46:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 10:46:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572895.896998 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQPU-0004he-CJ; Mon, 31 Jul 2023 10:45:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572895.896998; Mon, 31 Jul 2023 10:45:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQPU-0004hX-8c; Mon, 31 Jul 2023 10:45:56 +0000
Received: by outflank-mailman (input) for mailman id 572895;
 Mon, 31 Jul 2023 10:45:55 +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 <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQQPT-0004hR-8Y
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 10:45:55 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on20626.outbound.protection.outlook.com
 [2a01:111:f400:fe12::626])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6bae7ac6-2f8f-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 12:45:53 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM7PR04MB6823.eurprd04.prod.outlook.com (2603:10a6:20b:102::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 10:45:50 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 10:45:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6bae7ac6-2f8f-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=FzOrG5JCy77eKVXHL2cE8dMo7MHcCyfvMoUCLmxRuT5Ovymwmw8m3QnwtBqwEh6GKjjZnYDc1PBC0kMAFPZe1dZXJlB4Gw5UdU01qM8/U4baRUqtFaQT2QLwW/0Xx0lnqxqLcsU0BcxhJwlFDr31koEUg1KpoiHRWohv7PwNsGtWT7/9elkdp7E+2jDTR6o7tz+5/MGEAMtFMWIGQ7ksx5WU6of89xIlQ/1X/hWz7n6EHqqock8mTCApw43UbAHb7+5KxOz05Kq6vP8RVhSSSDKddb/7bbdxxcoz7Aiikc0zz22WwKevki5l4QY7t7YfiOsKhrCF6o1gw1OmNytcPw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=bUXmaj4TufZiMN8t0xt/rNzlBFVfzQe8B+tPimEyiMs=;
 b=icxeoNMoPCc/osReuDQiya+S66gK2UcuhA77iscVm1iv2ukbjiTu1qvUc6eg/Ge7DRp75CZX2PaEHEPTzH4y+R2QdWlEojCnVkMa+GlWnGxiO97iphLC0iOhsh+oxX4nARDmF7NHYwqBjQu5E3SsxmMYPOZM7KpUy13obCBILYw98a4wGXpKbH+zRLczelrqkSDa2nSY+9smoag1ggr3JrcoVgxT1csqDDQjTatQIxHYDFjpOMwGShe0buZY3df6YicOEQD0CEdNedztyvSVMG2CM5K5OQedPThdHWlVdObGTAbktLaU6lS4uRyhZycWVvyVab7OL1oN460tEylmzA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=bUXmaj4TufZiMN8t0xt/rNzlBFVfzQe8B+tPimEyiMs=;
 b=ZEYwLdYg8Z2Nf/EPxqngZ62dMpJzjrJ4iLXWoyJN6Qd+Xp7qrXLrGTlT6FqHEsAy4Cl2PQ9QnjctWofq/h5HEgEIEmZDOutR86R4LwyD5MHVVxp4LWIYSC0QwgZzjg0ACPoTa5HN1USxXQNMbFnjoBPV4iDvLbitabBV69/KCKcPV91avo0puyxVBvDjlTlMNEgbyas3bbB007tNeDWxtmOwHnwARF3rWbChE9BkkZMKGFbfZqZ9zYfzucyEJoU7OM+Erd8oJEESIndkDpdMP9atB7i2q+ExS51H5GTrMmG+leX1mmWa3sz8JcrqEfxlrsdxPMeI02CZYGzTyKfrAA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <2505a2d1-1606-9199-5115-6dd6623b1b9d@suse.com>
Date: Mon, 31 Jul 2023 12:45:49 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [XEN PATCH v2 2/2] x86/IRQ: address violations of MISRA C: 2012
 Rules 8.2 and 8.3
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>
References: <cover.1690544434.git.federico.serafini@bugseng.com>
 <da6fc50b926e72b497db251ca640c60244db3632.1690544434.git.federico.serafini@bugseng.com>
 <alpine.DEB.2.22.394.2307281611360.3118466@ubuntu-linux-20-04-desktop>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <alpine.DEB.2.22.394.2307281611360.3118466@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0212.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ac::11) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM7PR04MB6823:EE_
X-MS-Office365-Filtering-Correlation-Id: 9563fb8c-14a7-4ac7-bbb8-08db91b34e6e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	aixuqNpeD3aN26a4Un/74wph+Xaze7phapMN0RGVj493dfwjHMkKlNIEApmwwggSVmihNgJ+rgdpIW9DdeYrCG+6QRHS55gFvx4QgdWJmDIoC5Tn9C+dhXeEo0P+e8DjFjmjMeYfhWkOx4wDOd2WXvrUD/UQmqXnUbH+BZ8MX6l2+vYtVV2JXMTVWu6EtAGmWhUHydDepXWIHAXeuTgJFEsAwcrarLycvVa3hE3T5EudpNQhoFq/slkAzw4DkiGvlqxIl5EoIeXfan/EOxvSeY7J2p+2qTyBHF0mnnHylETJRDSiV4c9Z2Ihgh56Mz+Qd9DElT2LhJvou7Xi4aMqj1JCk9KP/XV4UTZ/gsUaDs1GptqAW6wMXoY83QA/Nec9viSsZfQpnxDBtt/S50yGcnWWQumJExc3xdv6AEG2J1usvprpVR8olcjqZn8Ei6IdmSGXExCWwa+qwDqKSyMyxo8TTJpGjBjbF64LkvYbqC7+HlLAHwSMnzZilEjlt1x/38Eu6bKOmaGi6vyPyPmgYB0tJUztqI87KMCPz/iF9VpH/lffKk5mf1MpDS5pKsQOYdnOFEu7Y9QG3t8Da6ElbFvMJuqhiUeaghsGqkdImzkCH6a+IzoAD6yR2gDMZZE6rWm9zUsYholELsuBmvt7OA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(39850400004)(396003)(136003)(346002)(366004)(451199021)(66476007)(86362001)(31696002)(41300700001)(31686004)(8676002)(8936002)(316002)(6916009)(5660300002)(4326008)(66946007)(66556008)(54906003)(478600001)(4744005)(2906002)(38100700002)(36756003)(6512007)(6486002)(6506007)(26005)(186003)(53546011)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-M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-8?B?WFhBZk1DMmFla09UWjIwNXRCdGxxcS9vUHptV2lDZHpNSERGZFlHbjdCb0ZE?=
 =?utf-8?B?QW9TZ1pLczBsOG1CN2tqWk5OdnNEZlVlYmRlenZpWnJ0WHp0WXJqVlE0cHY4?=
 =?utf-8?B?cHpuRUlpcmJicjZiU0tBNTI4N1dlTkN1aHQvWnVxSnJ6ek1nQjBCZjE3ZmY1?=
 =?utf-8?B?cHNMQW8vQnVseG5jd1N2TStTTXIyOWZvcVR5SlZERVhwZXF2VXQ1YmhvWmxI?=
 =?utf-8?B?OER0dHRKM2NnU3VQTUZUemVMZk9TZEpDQ3VXVWRidDdzVnVXMnpzYUUrd0JU?=
 =?utf-8?B?NmF4RWdacGJ3VU5nRVBsS0cwM2VSYW9VWUFrWm42MTlYdnFWcC91YzRRTEE5?=
 =?utf-8?B?RTEyV3FKa0JIQThnR0Fwb2YxOVpXUWRwdkVRM3lxMmtZZnhXb0xTMWFNcEJ2?=
 =?utf-8?Q?Xkm0O9gtM7m9rBAmR22qADBIm?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9563fb8c-14a7-4ac7-bbb8-08db91b34e6e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 10:45:50.5558
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: GgWP9YpixUJkyFQHEt+m/Bp0dg9zrk2IIcUDQ1Cc9nACAgEiOfALy0tfKoeDZltb165juntOkr13AdhrqljjkQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6823

On 29.07.2023 01:13, Stefano Stabellini wrote:
> On Fri, 28 Jul 2023, Federico Serafini wrote:
>> Give a name to unnamed parameters thus addressing violations of
>> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
>> named parameters").
>> Keep consistency between parameter names and types used in function
>> declarations and the ones used in the corresponding function
>> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
>> ("All declarations of an object or function shall use the same names
>> and type qualifiers").
>>
>> No functional changes
>>
>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> 
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Mon Jul 31 10:49:44 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 10:49:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572901.897008 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQT3-0005Hr-R4; Mon, 31 Jul 2023 10:49:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572901.897008; Mon, 31 Jul 2023 10:49:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQT3-0005Hk-O0; Mon, 31 Jul 2023 10:49:37 +0000
Received: by outflank-mailman (input) for mailman id 572901;
 Mon, 31 Jul 2023 10:49:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQQT2-0005HZ-Iq
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 10:49:36 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on2060c.outbound.protection.outlook.com
 [2a01:111:f400:fe12::60c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f07209f1-2f8f-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 12:49:36 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB7695.eurprd04.prod.outlook.com (2603:10a6:102:e3::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul
 2023 10:49:33 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 10:49:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f07209f1-2f8f-11ee-b255-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=cl6BAjux2KMwvVqM+QUQg1KnSdtEcKcvh7wa20NH3b7DksHxUFxXiAWrMl/dsbMY9Yj/R0UG1N2yP8DhgwijRHRK2zETIjgs6uElKVBXJrBoIC5dsFzLAubc0c7JmgcMw4vHoVwFDZ60rhT6rn88uL/IgE+TtVhKKlDzBUOscddf2q1I1A9xqCvRRGrq8jwwfRq3ZlaP/AbUBKb7I7WorJzWQRtm4I4Q35fgiTanW6WWXqClqA0Us1ewwt5GzbdvSl6BKHQsdD3ZTJO1MJUB/mTVeZjQw+pBQVOFGoD0mIyqvySnqSwlAPBi7Fu3EHsOfk2pBUqQFATpawzzRs4pHQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=lUk93vsUukG1wnuqMAPjhSR8qVbloAaxMzKJwZ+rd2U=;
 b=oKQUiZtOvl9u1rhCqInfCVGy8XuB3gfOUP5NXe3Y1jf50RGzBBNIeHxKBRH+c8ENpp5cEg+WIakFeRKSBTWNZMgM+Ds24F2LzhBCxG+79LTCu6BzVRIcAWRh9eAYQxlWliZV5Y8OUL91YHIZt/q5g3RJF68uj4hrDZnqIf+D0QE7IVnCDxi0IZVApZK9T+apCthprteai/kd4EyMpJqP1PVyZl7PDofbWxQLQnuckJEq2J9oRtsbmAKoeAbFZB/g1fLC5dwQXPq5ErJZTzpQ93q/B70k1Txk0uZPlmmLjgETXJAQCImEA+M9UC7IKs5Dmm1qZ0hQJ3249PCkRfUvFA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=lUk93vsUukG1wnuqMAPjhSR8qVbloAaxMzKJwZ+rd2U=;
 b=eA3l5ZzUr+eh6kymgTtGNnG3P7kjbnigWr/w3cJ6tWdgRiA+X/SFKxRWrwYbJQPmvPaOIHcPRedVDsZZO8BvpWnjH6KFwzp8lbRUXcqMIEFtT3V2UxFaVUqiqp0Mhx4GqDHAlry9yMYFt4gw//yO9FuBVsqMDSdnbNITXejnSZJVyHKN9gNxINVrLKdgiREDc3wVqFtP7Df8k6brTLY6R/cjSYeVqz7AsxNAmpyzpAN2VUpYPm6vZaPCb619V0E8fseqq27N5/y61zq/wMKLSSYiTQ2YSsfaA1d+kyNWgn+lgnZXxB5vvSwiCJGgmDpLEaMprFYWEQiOT7RjuhLSvQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <2f21f71d-ccf5-aa01-cd4a-3f738842e64c@suse.com>
Date: Mon, 31 Jul 2023 12:49:32 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [XEN PATCH v3 1/2] build: evaluate XEN_BUILD_* and XEN_DOMAIN
 immediately
Content-Language: en-US
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: Jason Andryuk <jandryuk@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230727145447.2701-1-anthony.perard@citrix.com>
 <20230727145447.2701-2-anthony.perard@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230727145447.2701-2-anthony.perard@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0046.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:92::20) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB7695:EE_
X-MS-Office365-Filtering-Correlation-Id: 1e2fd5b5-1884-43d0-336b-08db91b3d33e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	cN5XzQWVBSBlTXm5iA+fMonFcY1S4uqvq+v3XhsWT77AB5aOLi4x9oewdebfxIB6lQFVpw7pVHn8KdJYwWWGIsSkm7tnP0LAHZhx2JddwAIJOqpR3fgcOUTj1y+kDbzRR4WR/H2m7MUxPvgCtPpDjZdPNRCiecVEcPZ/5/HCWQUN/ydwa9/11yQww8FnLG/YAi/v/eKRU0ZH8F1eMV14Q0GQWqiD5JzY692GoBqRvzq4wa3RYzZKwCQ+Taqt8XJCSYAb3shu82v3x0OwFvzKyRoEaKTXnVgJ7ZMnxiiNN2kKV+smiK9xsqaeNMTTF9DvCQLsj1tBpPvX+2Hsial5H/ZVAVLwG19Q0GI3gFAvGTMHaw/QgrqzcYeHcAPkTsPRpCd383dpbrA9mvrX3sWNoEpKa8RY9z7ZGva9TleXvD8qzJ2Cu0H2p4SnUQUHGhoMkfJqtqJ36seAJGgBcHxRhfNen4NQXeKQlHKf7SIblHZO/jgAi6GJT3ewn+wQw89SotDZmbRe4C/sS3xsb6sRFmr1LUKf6w+x4QEpgySDFSfuqJIpaEEUYPzImT/rDbV3kWhLACZeV/CQgkgUguoX8xkVcaqGMD/iZU5ivt5T4svnz/TNA7mwWBcpSkzEG85NKFFcJJSnPQh8U7rnUKOjh+Abfvm6jLXX4xU6BYUwqJc=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(396003)(366004)(136003)(39860400002)(451199021)(31686004)(2616005)(5660300002)(4744005)(38100700002)(36756003)(2906002)(26005)(478600001)(316002)(8676002)(186003)(6506007)(53546011)(8936002)(6512007)(41300700001)(6486002)(86362001)(31696002)(4326008)(6916009)(66476007)(66946007)(54906003)(66556008)(14773001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?amdYRjY4TS9VdHNpc3BIbFQ5WUVLcjB0c29PQnpteWN6VzdXU05MYkJDTUQ2?=
 =?utf-8?B?ekJSR3RJTXhQMVUwVWZxSkxKZmxVdUFnbXlnM0dDMXlSbjRHY25zMlo1N3d6?=
 =?utf-8?B?czA4cFI5UlgyVkFzbDZRZkFJNVZDMGJXM3VIQzV0aXR6U0xPL3JLL3AvN3N5?=
 =?utf-8?B?MFhVZUd2VmJDbURKYUhxSFMyaU5wS3ZHeStDeGlTK2pDWjhCamlWQ2xkSVVy?=
 =?utf-8?B?aG0vcm5GdFNsZWdaL0ljOVl0c3ZvTEQ4cU1YVkVqVTJDNmZKeS85VXAyajNw?=
 =?utf-8?B?cU5FNk5XOXVuUUJSRnlIL3RrQjIxeTJqYWlCcUErcEIyQU11M3ROcG9CVWZF?=
 =?utf-8?B?dGVQRDIxRzBvZ3hWNHBDazNHTTVmS0laaU9NSEJuQWdsMjc1L0F0U2FZVWVj?=
 =?utf-8?B?UkZaN2ovZ0xORUtSNDBQa291NWVsSENDTFFGZm04aEcrd0JpdGxER1JXZTJ2?=
 =?utf-8?B?T1ZvSDMrRFM4djlrWlM3V3BGYmJ2YjJ0WVZKQ1NyMnYyMm80QVRJMy9Eblo1?=
 =?utf-8?B?TXNYTGNvSEJHZWZBeWEwbUNReWd5YXVUbWxTMFF3UWIwdU5vU1hTSFU2L29K?=
 =?utf-8?B?WVpDNmZiK05qQXdGdEtWTWk0ZkJVbnIvZ3lYRWs1R2lnVXk3Rmo4SVEwd0pq?=
 =?utf-8?B?UVV6R3orV2prN2daQnJWenZueXRaN01jcmRWcXV5WUsyY2RNc2tUcUkxMy9S?=
 =?utf-8?B?aDJ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HMGhnYUpzdEl3dVlrQW1DK2doeHoyV2toa0Fj?=
 =?utf-8?B?T3BhR20ybXdZVWthYWE4NFNqZUdMdG10NnZoNDZCK1MvdEJXaTJPbmlkNFho?=
 =?utf-8?B?ODF6MVcrSXViTXlBOUEzR3lTT3BUL0d0Rmdnb1RXOHcxQTN3a0hWamlRUyt0?=
 =?utf-8?B?U29sUEczUEVCdHNDbFJhWmk2VXJNamJTR1RyUnBMTGxycTdGNGZVNk9KOXBy?=
 =?utf-8?B?NldPRDAyUmptTjMvdkRIdVFHTHBMWkQyQm1GZHNQM3BpVU1EWmV0NVdRa1N3?=
 =?utf-8?B?VWN2d1F0VlhTUnc0MTFZSE81czRmcmdJeGhnbzZmK25nU1NHQStRRkgyWVRw?=
 =?utf-8?B?MEdrOGE5a2pKYVpYb0tRelM1SWk1b1BRU3gveExTTTZaMkdVbHhETzlqd0dk?=
 =?utf-8?B?VVQzM1B2WXhDTmszMzhUUzMvbTY3aGh1clV2VWdDSmZzL2pBUEdsTTcrNjhO?=
 =?utf-8?B?M1grUHRSZ3FhcUYyUm82ODRUTmNjWGU4TGN2dDU4V2pDcGVaRzl2cjR3anFT?=
 =?utf-8?Q?51F46Xd2l9oAVEQV0wpIsXfbb?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1e2fd5b5-1884-43d0-336b-08db91b3d33e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 10:49:33.4025
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: B00CiRxngvwfh0E3GpYQvVXYw/54W3DgrRRZPlp/zHXj/iVOMWm26N4lGGvegeisALgvuQc8NjD8yTvuQfieUg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7695

On 27.07.2023 16:54, Anthony PERARD wrote:
> With GNU make 4.4, the number of execution of the command present in
> these $(shell ) increased greatly. This is probably because as of make
> 4.4, exported variable are also added to the environment of $(shell )
> construct.
> 
> Also, `make -d` shows a lot of these:
>     Makefile:15: not recursively expanding XEN_BUILD_DATE to export to shell function
>     Makefile:16: not recursively expanding XEN_BUILD_TIME to export to shell function
>     Makefile:17: not recursively expanding XEN_BUILD_HOST to export to shell function
>     Makefile:14: not recursively expanding XEN_DOMAIN to export to shell function
> 
> So to avoid having these command been run more than necessary, we
> will replace ?= by an equivalent but with immediate expansion.
> 
> Reported-by: Jason Andryuk <jandryuk@gmail.com>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Mon Jul 31 10:50:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 10:50:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572905.897018 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQU4-0006i7-8K; Mon, 31 Jul 2023 10:50:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572905.897018; Mon, 31 Jul 2023 10:50:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQU4-0006i0-4o; Mon, 31 Jul 2023 10:50:40 +0000
Received: by outflank-mailman (input) for mailman id 572905;
 Mon, 31 Jul 2023 10:50:38 +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 <SRS0=erlH=DR=suse.cz=jack@srs-se1.protection.inumbo.net>)
 id 1qQQU2-0006hg-Id
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 10:50:38 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1490f4ef-2f90-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 12:50:36 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id ED50E22197;
 Mon, 31 Jul 2023 10:50:34 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D6932133F7;
 Mon, 31 Jul 2023 10:50:34 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id ovhUNPqRx2R2ZgAAMHmgww
 (envelope-from <jack@suse.cz>); Mon, 31 Jul 2023 10:50:34 +0000
Received: by quack3.suse.cz (Postfix, from userid 1000)
 id 457F5A0767; Mon, 31 Jul 2023 12:50:34 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1490f4ef-2f90-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa;
	t=1690800635; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=PJDu3H9G0xjlLFp1Wxvq9yQHkB2Q9jBIbPsGkP5jLhY=;
	b=LfsIvVgX25rf01P6sVcmZRL3nPMT3sPJRPMrpOspwMqpMg9mmQx6AkDi/eF6WU32a2Vp6x
	/7YLD1OJK0u+bqfGa4P87gaOpA6/QZlHA1eZkenSQs1V9CjuRPICqxTQ9KdHYFZ84hOqsV
	4L46K3Rf4+bEtg2brIa/aboXrQrqviE=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;
	s=susede2_ed25519; t=1690800635;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=PJDu3H9G0xjlLFp1Wxvq9yQHkB2Q9jBIbPsGkP5jLhY=;
	b=X5g/KyOpcE2CiMGegP9N6Ypxz5sWUyAuayNnMILk5q3XabEg0BuGZ7c8jHqKycooaqKD7s
	Ajq9KEorZZBfWcDQ==
Date: Mon, 31 Jul 2023 12:50:34 +0200
From: Jan Kara <jack@suse.cz>
To: Haris Iqbal <haris.iqbal@ionos.com>
Cc: Christoph Hellwig <hch@infradead.org>, Jan Kara <jack@suse.cz>,
	linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Jens Axboe <axboe@kernel.dk>, Alasdair Kergon <agk@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anna Schumaker <anna@kernel.org>, Chao Yu <chao@kernel.org>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Dave Kleikamp <shaggy@kernel.org>, David Sterba <dsterba@suse.com>,
	dm-devel@redhat.com, drbd-dev@lists.linbit.com,
	Gao Xiang <xiang@kernel.org>, Jack Wang <jinpu.wang@ionos.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	Joern Engel <joern@lazybastard.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	linux-bcache@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org,
	linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org,
	linux-nilfs@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-pm@vger.kernel.org, linux-raid@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-xfs@vger.kernel.org, Mike Snitzer <snitzer@kernel.org>,
	Minchan Kim <minchan@kernel.org>, ocfs2-devel@oss.oracle.com,
	reiserfs-devel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Song Liu <song@kernel.org>, Sven Schnelle <svens@linux.ibm.com>,
	target-devel@vger.kernel.org, Ted Tso <tytso@mit.edu>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions
Message-ID: <20230731105034.43skhi5ubze563c3@quack3>
References: <20230629165206.383-1-jack@suse.cz>
 <20230704122224.16257-1-jack@suse.cz>
 <ZKbgAG5OoHVyUKOG@infradead.org>
 <CAJpMwyiUcw+mH0sZa8f8UJsaSZ7NSE65s2gZDEia+pASyP_gJQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CAJpMwyiUcw+mH0sZa8f8UJsaSZ7NSE65s2gZDEia+pASyP_gJQ@mail.gmail.com>

On Wed 12-07-23 18:06:35, Haris Iqbal wrote:
> On Thu, Jul 6, 2023 at 5:38â€¯PM Christoph Hellwig <hch@infradead.org> wrote:
> >
> > On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote:
> > > Create struct bdev_handle that contains all parameters that need to be
> > > passed to blkdev_put() and provide blkdev_get_handle_* functions that
> > > return this structure instead of plain bdev pointer. This will
> > > eventually allow us to pass one more argument to blkdev_put() without
> > > too much hassle.
> >
> > Can we use the opportunity to come up with better names?  blkdev_get_*
> > was always a rather horrible naming convention for something that
> > ends up calling into ->open.
> >
> > What about:
> >
> > struct bdev_handle *bdev_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
> >                 const struct blk_holder_ops *hops);
> > struct bdev_handle *bdev_open_by_path(dev_t dev, blk_mode_t mode,
> >                 void *holder, const struct blk_holder_ops *hops);
> > void bdev_release(struct bdev_handle *handle);
> 
> +1 to this.
> Also, if we are removing "handle" from the function, should the name
> of the structure it returns also change? Would something like bdev_ctx
> be better?

I think the bdev_handle name is fine for the struct. After all it is
equivalent of an open handle for the block device so IMHO bdev_handle
captures that better than bdev_ctx.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 10:50:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 10:50:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572906.897028 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQU6-0006xu-FK; Mon, 31 Jul 2023 10:50:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572906.897028; Mon, 31 Jul 2023 10:50:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQU6-0006xi-Bq; Mon, 31 Jul 2023 10:50:42 +0000
Received: by outflank-mailman (input) for mailman id 572906;
 Mon, 31 Jul 2023 10:50:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQQU4-0005HZ-Kp
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 10:50:40 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on2062f.outbound.protection.outlook.com
 [2a01:111:f400:fe12::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 169d9b93-2f90-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 12:50:40 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB7695.eurprd04.prod.outlook.com (2603:10a6:102:e3::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul
 2023 10:50:38 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 10:50:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 169d9b93-2f90-11ee-b255-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=FYOpml+k5iwTh8gAvJsBsODirSS3Fziz2CSusGhRqp8FJvkZM89mHl68PoDjvMWwHV5mLVipt3mgz9JgtNDc6TDNqqZiaDOBVyOaoODtz4/d0FfhIja66dhhl6/vTGoVcJ8TMF1Lxj5lpw6vSx7xpI0NAb08iwb0YqRIzNX9DCi9IMBxOXZN4e0BK3JL3b/y2AJQLeX9eC3a8FB6OWZEf3RaG9D32yDJix7Om7CcWg+BKrpcvYVH/vmWPfa3GB/9p8ripc88fR4ZStVHE6p+CeHBX+7O3d5Iv93Ml+Mc+WOXqNGsVo7aXu0vWT920bo90rPTuWaz06g2J/dREti+sA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=2m0vc8Do0ZZBQ+Lw+lGAAEdyMmUOKX1UmXo6O310PfM=;
 b=oBPZseVPNPeo+2OPcrvBQqA7uUIe+v5k/F1jWg5X9pbjPbcDxiVyCP81gGIUizGP+CD1ZxyzUp7NGY1s/OP7i+rSSrEg6vRM6vgpzZtHOo5ybCLSCK0d6/pTtyvMlCE9XZpwMuI/5+EkOnij1MVPjFOXm51Z58PcUsCxGpaYnVvWTCh2U/XuJwoMZX6S8Et1qGUiQRq/eWHMz9Q9enIXGb/fzTrLOMoPwhIbvz3V3h+Zo/vBQtY00XkSWgf/o6MQ8Kwl648V0jy2VPaZyfLb9+mkPT0m/qY2Be8SOKcEWtCfobr1gCvNZYjvwa2nShHjSomulIR0eUgls3eCKEZ3Wg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=2m0vc8Do0ZZBQ+Lw+lGAAEdyMmUOKX1UmXo6O310PfM=;
 b=GsInKP0Jfmx+XR7TE/LHshb7mZFMpX3Bd9e4t928YECJoSu1d/AyQRO6EZ9moZCrvXBp/RyhKTxjo80+uWyBwtl4DoqD5zPIvf1+l8FiRoFQ37nMLawDCPZToyRD+QhI/sLkH0cO+1VuqOnzLBgfmEfriFZ9eWGfZCF0xz+qoWqVokRTN0+msHA1KAeUMvNP4wdY4rChbi9VwKJB72LNAur2RrJEEoi5F8WOAobad0Hx8EnJQKaOqvQU5XG+GXsOEP6wNpkFpmH3YRqruvcXa8wHEpZD5kb6r2nYhTsJAmzWiEUpLTzlLBacebHPCstp2/PulUJSysMG1YlMQ7bc7A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <c91310a2-105e-f908-31c3-b39f61d9053c@suse.com>
Date: Mon, 31 Jul 2023 12:50:38 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [XEN PATCH v3 2/2] Config.mk: evaluate XEN_COMPILE_ARCH and
 XEN_OS immediately
Content-Language: en-US
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: Jason Andryuk <jandryuk@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230727145447.2701-1-anthony.perard@citrix.com>
 <20230727145447.2701-3-anthony.perard@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230727145447.2701-3-anthony.perard@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0046.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:92::20) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB7695:EE_
X-MS-Office365-Filtering-Correlation-Id: 48d95757-6781-4661-7443-08db91b3fa12
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	YtOExRaeTvD8DVEP8KP2gawT1+KFd2yCwFIzKfGYDFeoAc0G3/K6CShMo8Y6xb7H3ZLm1TqOn7YlCQWWo/bG+BEaFXR5lEu0dFpC9bp5usAgEVpxi7t/MGT6s+7PNRstAVC7lPoq+L/Dlj+9WxQXaj2eDZlheDoES2/e3s2DcRmOLrkdwVPwlR6FEwQpW1U4XxOFrAJFrI6M/NvCbxNX91I+yv2w9tlVS8WSEZC8D8y3lndnz0VTZpqEpntqhWEpC1cG95DqfAIkmQje3gnzLs8qvoD0VchjNWvgb+kcnTucOwiymiUCRWDHh2ydy5+JSPMvo0NMlNKdCe8gaaocSnSRTUHUefKgXbzdugBE3UwfD2rQYQebnZpoGMeeipgwO7CxRl6fLbndY0rhh369cgFice9qC5qtTFc2rx7UUuJm7uFD2mjjcKDFnbGXF5Qr89dfROq9fmW5dOD6pN2dsSXu/ATFTe3DivVwarQnx0CH3pL7x/qcd5SM9iLGUwQSRIZet58/Nruu13+0EUF4dfO+VGpJ4djH+SpFmv/RLHKJrjI3FyclZxB4NNS2LcsiJUXixLtB8XrEytjBZozQISowposJGox8qXBnETkYAaOucBf323+6iek7fvnUluCRKmA41C8lZRfS/t0bPv8MECbfzxIGDAg5+MK2p/CM7qc=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(396003)(366004)(136003)(39860400002)(451199021)(31686004)(2616005)(5660300002)(4744005)(38100700002)(36756003)(2906002)(26005)(478600001)(316002)(8676002)(186003)(6506007)(53546011)(8936002)(6512007)(41300700001)(6486002)(86362001)(31696002)(4326008)(6916009)(66476007)(66946007)(54906003)(66556008)(14773001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eHJLZUw3K2lBcEZpWnF3UExoVVVvL3V5U3pLL25PckxQcnRZdmw2TzJmYVhD?=
 =?utf-8?B?SnJTMjBzQU0xZW9ldkJHRkxQY1JFWXB2OU9vbnFDNlZGUytmcENFLzJ0WTNJ?=
 =?utf-8?B?ZSszaWt5WVNIb1RxRnZwWjVpQUVUQ0FIV3Y2bmsybEJOWHhaUDEzRHg0Q1Vx?=
 =?utf-8?B?K2IwUjFOYUp0VTIwUGhyT1VvYmgraVZBbC9WYk1Gd2QyTFl6YW0zelFqTkRr?=
 =?utf-8?B?K2pmZGsybURwTkViRk51MUsrVjc5RGFpL3o5TWhzREErcWZiYXFjblBFa3lw?=
 =?utf-8?B?dUx5bkpZcmtYVythYS9ON29jSzEzUXIwR1NDb3VyMExNSGpPYXpwe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ThhTDM3RVBFRjJ4cW1RMTFtTkEyVWFpMEJUeW45WlM4R1pH?=
 =?utf-8?Q?4lmq6wNnE8aAP5eJBszFf3Iza?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 48d95757-6781-4661-7443-08db91b3fa12
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 10:50:38.5364
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: IHKxQT/F7oFgHPtD8xM7QIGkdwMEPu7NhhlQFv0cXSE9CErEbhUuprbFmCm5xR6esS7pJ7iujia+PU8PCBl4ww==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7695

On 27.07.2023 16:54, Anthony PERARD wrote:
> With GNU make 4.4, the number of execution of the command present in
> these $(shell ) increased greatly. This is probably because as of make
> 4.4, exported variable are also added to the environment of $(shell )
> construct.
> 
> So to avoid having these command been run more than necessary, we
> will replace ?= by an equivalent but with immediate expansion.
> 
> Reported-by: Jason Andryuk <jandryuk@gmail.com>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Mon Jul 31 11:14:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 11:14:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572917.897038 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQqv-0001Q5-AN; Mon, 31 Jul 2023 11:14:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572917.897038; Mon, 31 Jul 2023 11:14:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQqv-0001Py-7m; Mon, 31 Jul 2023 11:14:17 +0000
Received: by outflank-mailman (input) for mailman id 572917;
 Mon, 31 Jul 2023 11:14:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Mhrd=DR=bombadil.srs.infradead.org=BATV+ff51347a1c0b75c11ce8+7281+infradead.org+hch@srs-se1.protection.inumbo.net>)
 id 1qQQqt-0001Ps-Ch
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 11:14:16 +0000
Received: from bombadil.infradead.org (bombadil.infradead.org
 [2607:7c80:54:3::133])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 60f42010-2f93-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 13:14:13 +0200 (CEST)
Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat
 Linux)) id 1qQQpx-00FIz8-1F; Mon, 31 Jul 2023 11:13:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 60f42010-2f93-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version
	:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=0eXexdRtzvf9o3AbbzOynMU9Oogrhvp6ybx0nEPZW1E=; b=vK1v9C4DYLEBKbiWf/PpEfbUOr
	ea0tKbtUfw+UjBx/HoPf26wPnlNR3k7A4MsVaVkdar3OIBATfQ3zHFcbH8P9ZuG4qU9LC9N5j1WXI
	1jFOwZPN5LFjM5C6XYSxyg6PIhoZ/4h6jEiKtDOt40sVd4EspDmE/0Bc3dDQT8tEqCoRhRKLz9maX
	raBlJVeHQO4UUZTV20wa+PJqkvDnQQ8hd7GU+O68QfUa/DM2K0gl+HVXCe6+FZ5xjes5Du5sz8UQy
	x/J/fQpupjKK/pfw7RVGPayWpw0xq+T79S7uS7ZMWJxaSbk7Su09Zyo3FaLXxQsJmvK1X6hzoRb5N
	/XYneCLA==;
Date: Mon, 31 Jul 2023 04:13:17 -0700
From: Christoph Hellwig <hch@infradead.org>
To: Jan Kara <jack@suse.cz>
Cc: Haris Iqbal <haris.iqbal@ionos.com>,
	Christoph Hellwig <hch@infradead.org>, linux-block@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Alasdair Kergon <agk@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anna Schumaker <anna@kernel.org>, Chao Yu <chao@kernel.org>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Dave Kleikamp <shaggy@kernel.org>, David Sterba <dsterba@suse.com>,
	dm-devel@redhat.com, drbd-dev@lists.linbit.com,
	Gao Xiang <xiang@kernel.org>, Jack Wang <jinpu.wang@ionos.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	Joern Engel <joern@lazybastard.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	linux-bcache@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org,
	linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org,
	linux-nilfs@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-pm@vger.kernel.org, linux-raid@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-xfs@vger.kernel.org, Mike Snitzer <snitzer@kernel.org>,
	Minchan Kim <minchan@kernel.org>, ocfs2-devel@oss.oracle.com,
	reiserfs-devel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Song Liu <song@kernel.org>, Sven Schnelle <svens@linux.ibm.com>,
	target-devel@vger.kernel.org, Ted Tso <tytso@mit.edu>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions
Message-ID: <ZMeXTUUyrOnaxGNG@infradead.org>
References: <20230629165206.383-1-jack@suse.cz>
 <20230704122224.16257-1-jack@suse.cz>
 <ZKbgAG5OoHVyUKOG@infradead.org>
 <CAJpMwyiUcw+mH0sZa8f8UJsaSZ7NSE65s2gZDEia+pASyP_gJQ@mail.gmail.com>
 <20230731105034.43skhi5ubze563c3@quack3>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20230731105034.43skhi5ubze563c3@quack3>
X-SRS-Rewrite: SMTP reverse-path rewritten from <hch@infradead.org> by bombadil.infradead.org. See http://www.infradead.org/rpr.html

On Mon, Jul 31, 2023 at 12:50:34PM +0200, Jan Kara wrote:
> I think the bdev_handle name is fine for the struct. After all it is
> equivalent of an open handle for the block device so IMHO bdev_handle
> captures that better than bdev_ctx.

Agreed.


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 11:16:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 11:16:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572919.897047 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQsZ-0001yA-L6; Mon, 31 Jul 2023 11:15:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572919.897047; Mon, 31 Jul 2023 11:15:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQsZ-0001y3-IH; Mon, 31 Jul 2023 11:15:59 +0000
Received: by outflank-mailman (input) for mailman id 572919;
 Mon, 31 Jul 2023 11:15:58 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQQsY-0001xt-2X
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 11:15:58 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2061c.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::61c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9e9dcd81-2f93-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 13:15:56 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS1PR04MB9336.eurprd04.prod.outlook.com (2603:10a6:20b:4dc::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 11:15:54 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 11:15:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9e9dcd81-2f93-11ee-b255-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=F1N1lOn2c1YkqRKSziklm8UxLFfGhkW9X5NUeoRM6Uu/erUOHge0YFc+rSpuZKJqQnjGGiNkVbUVpLGWXzLm+uxBoEBkApYAGomQybCPklgj88P/x+1CNSXBobFWl/BXffi/5X4DSNSPTuZGdhDwRHU7CtLvIdqV2gLfLLb6tMi5D0DOIWKRB0oW+fRW6Lw9RG5Z6HxhV6P4PoxHhDIVHbQx4HaZTWRaR/OrL3DSdI5YQbjWZC2rWuxUJxiCD/i8JU4IfaUi69GW8NiOHDD2hdsBo+8EvHNpXmGNb2WWFKLB1D3KYgds+UjCDfIAA5GBJEVQ4p25cDd2dxYAQpyFJQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=uW3wYiVE6b/d+k8szt4QcKxk2XNHcpGVcLcMiq8XMyo=;
 b=ZKTWy15k64Irs+QRNKGq45yueqv1JL458XAhmjLXnsmypATGG3n6ex5dp38PueTwkbpfBlsXZd3JaniZVhy0lMTH0J4RUiT41MVZk6IRJ16cfM9LzmgoaofRwdnX5IPdI4QWEkQeZzY0f/dRaWzvmImaaZPqPVWgO9rEWzV7oo6aNrfFHQb333sZJs3elwploCHsKojaWoKumxWcpw5bT1VIzoGzG7Uidm1PPDHZ2fSJNUZUcm/PmgKDUmXVpx28gu3GB+lwL8yJWSFGsrHvSOJpY75pEEsB0FhduuVVc9+6+dY4vOYT/vJ24mKehwPW9qjmaypB23gzuIMbjCO3xg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=uW3wYiVE6b/d+k8szt4QcKxk2XNHcpGVcLcMiq8XMyo=;
 b=hHPngB7EiLB/k+jKuOigT0Omp/C0R381X7+HcQH8x71mLWKkXeSgr78BS8NzlhA9m9ydGrSFCJaXnFxRtbvvIEq5X1hOcEddhRWTAHh01E/9I9e62RIFSqtcBoHbw889MuQuMD9Mro6tJnlKT9O9kzuzfCIQOngMfvDRFQT7eIByWgESqopl7EYmgOuxwqFE84oyu6ZheKoruN9Qo+hcM97U9S93Sw0VonFFNdoVSSHfqVyzF7WFCXbei0Tb8WS+f2PqHLkxruMq9pGNOjTMYbN2CBbU6L2oSf+ahFmuXBvZga+FFy/fe3AppwGvZVxyE1IWZJNh8Ht9BrSu8Hnz7g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <bdd5376b-477f-71e1-94db-71a2e4cb716e@suse.com>
Date: Mon, 31 Jul 2023 13:15:52 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [XEN PATCH v2 1/4] x86: mechanically rename to address MISRA
 C:2012 Rule 5.3
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1690788513.git.nicola.vetrini@bugseng.com>
 <b169d1c682254e682e6ed34f33481a768209ce9b.1690788513.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <b169d1c682254e682e6ed34f33481a768209ce9b.1690788513.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0015.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:1d::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS1PR04MB9336:EE_
X-MS-Office365-Filtering-Correlation-Id: 2dc45f73-cce5-43ac-4212-08db91b7813c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	6rrKZhaZ86q5weJxglIDaTC/qxdCKtz3YdYg4UT+AR7czTRFmnS+h2NuHNjG7VUYcfXpRiqGevwdrCTBMC28fJx+L+bGB0S5ejH2oU567tHzj36rQ4cvfr079tBtzio2eq80uUTDuOHvzAPBJ2pVYst//yTpil4z+kXqE7DwAj0ZlNrPh6YeyWz5zaY2MXXBHbsGJgQz711wVpfhQ0RqHJxr53WGkdocSrfDLc4af44SIGLOsKD+W0hBEhsnweNepv0qPStktWzTQxsbcOq9RniMJbzUTfkz8ZXEOfIjafIHsWkKmGaQtEkAOF8FMXTuuv/U+/TUb8a7ov5YKuXOgGXEqwVSc3Tbwl8bu8q9dCygfRAPVxlo4KjuxYS0HVm8ULTGw6cYOcJSspK5jTYGrAZU06v1xWqSJLQT8XBPZA7i3C3UW30Fdz4k0qkW5nvReX7wCNpPuNUaNZ/sPHe2yoSp1YwKTUln3f10oLrmTmOiCMH5Q1zNiFpZQaAFDdNK7GslE7ubt9NVM2Ls5vcT5Becpa36yTLB8s2joFBN0OFhOcOKgA17Bd3OfT0o0BV1/YKlOpPHz+I9wJ6mmvzw5ighR99OVnMzIDrK7Bg6ZlFJgium0cvzWvePaqQ5Fs6trCsIZxX3zxhj1H5OUo92fg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(39860400002)(346002)(376002)(396003)(451199021)(6512007)(6486002)(36756003)(53546011)(2616005)(26005)(6506007)(83380400001)(186003)(66946007)(66556008)(7416002)(54906003)(31696002)(86362001)(66476007)(316002)(4326008)(5660300002)(6916009)(8676002)(8936002)(31686004)(41300700001)(38100700002)(2906002)(478600001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TWhLeFF6WW5lN1F6MVk0eUMxdEdLNDlad2xMZ2ZLc1kxYTdhclovS3IrZFp0?=
 =?utf-8?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
 =?utf-8?B?SEZxbWRvOTRLRGR1TlYrZUlHU2owbXNiTEYvS0dmNXlLRko0MEZDc3BPdjBm?=
 =?utf-8?B?d1I0V3V6dGhMeTc3N20zdlFhM3RmWEhqSHpNMWJPbTVVdmhZbUdpaVdUbVJC?=
 =?utf-8?B?U0dEV0ZKL3ZVUWt0YzFBbEUvRGppdUF3ZC9GSVRobyt5M28rcnNiOTBKV3k1?=
 =?utf-8?B?RkYyVFZXeHdlOGhDTVBOZzZHcnNjeW1SZzNBVmdjM3hBOGtOY2R1bmdYMUdX?=
 =?utf-8?B?cFdtenRzQ09MUG9QcEtYVkMvclpMM2dUdzIzVThPU0gvRTVkUlJUQ25EbVIz?=
 =?utf-8?Q?KPG5hsbeA71fTjKyimn9a6yEy?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2dc45f73-cce5-43ac-4212-08db91b7813c
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 11:15:53.7623
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: /bHO1hrZdOODkyJjUzH4+76KJ7hDqqAeTrXa4nMy7Oor5S8hwD3X6/D2PEA4nuExn7VCWNO/iTUX05wyuDXENA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9336

On 31.07.2023 09:33, Nicola Vetrini wrote:
> Rule 5.3 has the following headline:
> "An identifier declared in an inner scope shall not hide an
> identifier declared in an outer scope"
> 
> The renames done by this patch avoid shadowing from happening.
> They are as follows:
> - s/i/j/ in 'mce_action' (the shadowing here is due to macro
>   'x86_mcinfo_lookup' that defines 'i' as a loop counter)

Then that macro needs adjustment. Especially considering it's in a
public header: It's full of name space violations.

> --- a/xen/arch/x86/include/asm/hvm/save.h
> +++ b/xen/arch/x86/include/asm/hvm/save.h
> @@ -49,21 +49,21 @@ void _hvm_read_entry(struct hvm_domain_context *h,
>   */
>  #define _hvm_load_entry(_x, _h, _dst, _strict) ({                       \
>      int r;                                                              \
> -    struct hvm_save_descriptor *desc                                    \
> +    struct hvm_save_descriptor *descriptor                              \
>          = (struct hvm_save_descriptor *)&(_h)->data[(_h)->cur];         \
>      if ( (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x),                 \
>                 HVM_SAVE_LENGTH(_x), (_strict))) == 0 )                  \
>      {                                                                   \
>          _hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH(_x));             \
>          if ( HVM_SAVE_HAS_COMPAT(_x) &&                                 \
> -             desc->length != HVM_SAVE_LENGTH(_x) )                      \
> -            r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length);          \
> +             descriptor->length != HVM_SAVE_LENGTH(_x) )                \
> +            r = HVM_SAVE_FIX_COMPAT(_x, (_dst), descriptor->length);    \
>      }                                                                   \
>      else if (HVM_SAVE_HAS_COMPAT(_x)                                    \
>               && (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x),          \
>                         HVM_SAVE_LENGTH_COMPAT(_x), (_strict))) == 0 ) { \
>          _hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH_COMPAT(_x));      \
> -        r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length);              \
> +        r = HVM_SAVE_FIX_COMPAT(_x, (_dst), descriptor->length);        \
>      }                                                                   \
>      r; })

The macro-local variable gets too long for my taste, to be honest,
and it being improperly named anyway suggests it simply wants a
trailing underscore added. And then, since for a variable named "r"
the risk of shadowing is equally high, that one wants to gain a
trailing underscore as well imo. (And while at it, I personally
would also drop the leading underscores from the macro parameter
names. Furthermore I think it would be nice if at on the lines
touched anyway indentation was also corrected. Overall maybe best
if I submit a patch.)

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 11:22:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 11:22:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572928.897058 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQyJ-0003Vb-FW; Mon, 31 Jul 2023 11:21:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572928.897058; Mon, 31 Jul 2023 11:21:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQQyJ-0003VU-CK; Mon, 31 Jul 2023 11:21:55 +0000
Received: by outflank-mailman (input) for mailman id 572928;
 Mon, 31 Jul 2023 11:21:53 +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 <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQQyH-0003VJ-UV
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 11:21:53 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2060c.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::60c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 729f632b-2f94-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 13:21:52 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB7541.eurprd04.prod.outlook.com (2603:10a6:20b:29a::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul
 2023 11:21:49 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 11:21:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 729f632b-2f94-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ePI16BBlHbrvmcsVPXHsnMGDhW9Z3G3WQgVpLeeSAge2kNqvHMaSbJ31k0uCxFAU8YXySLnOGvaP7VWm0y0Oc6jRtY4U6xmxVpn5NSBRlpCRrumbZCqpMmtakmdPKa8/6al5vkMsdQHgOBCZR+I7H3QqjBRfiLlgQkm/uJNcDu1eUs1CIr4wzQDqzlNA4NAim7+bRqaN5BTrjvBj8E4owoiEMnfEeQE1enV3hFp/TGqxKMZByxZPW2IVSGMz6bTT0JDlYHXJ3D+sQq1q8uJ21PK2FGPDjgHWE25p4C5MImf7zvXO2pB321g8MwDzKcsWEp6ftPsEhZhWrl2/B3O/rw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=h51W8AFPnEmtnFCwCyouES4Oqa3SJaYrWkAAk2V3AGQ=;
 b=VLnGSAGvhAi+GZpGO7bmOoxJ4C/qddLWbHeeNMs5LVVVx5ATRkEd6VqEsiqFgmKmrwGxkCUzfsmZftk8CFHyRBofXttr7+oJRZQV4ogXbSHYaXsLaYLrLMXKDH0XH/QBfX5cuTciblisqgP1Et+3STdTMlVl2WGCENs8tAfSxvOYgwCshmB8qwuedXoRavrBRVx8A6F4qCc2ZZBCV6phsw5NGm4LjKqxMV+KZe6rKJhxoRwbE9xNwd8IbxdhvYhVFNZhPy9T/m5J1i7jgRwoATRttE5+b7+t0wZZTnt3IsEvV8OQBcvZMkrm0acN9inQcp6q39lomQX0LEI5Dconig==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=h51W8AFPnEmtnFCwCyouES4Oqa3SJaYrWkAAk2V3AGQ=;
 b=n1fghCtg0IfUDFujtbcrXFs+xmNzaof67i/pILVBuwEkSa53x9RmW0ycPNBc+5/TgOFodQPgA2FL03zpaFYVUXHdpT8gqdcp/c8ksBcQq2hCpU9YpPXLNf4UrMXwY+2uivbgIb38zbvfazD/57zEod5hh9ercCbEajxsdJzLRFFy32iRo7+BtEL9fiV0bw2n29L+qadIDnM/DELzy3V64gYWKtf+HdF1YyYjKWhK6cRNGXq9XxRbslbPqhhuveKlGQOOntLKKlpQED2QZPvysSeU/g8Gf/HHP6/PVIR4TncZHfhyVVadGE4FfdaIGuC/NCwhj8MC29e67C/vnSL0yw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <d7b55bb0-328f-b99b-71b8-708ad40b3d64@suse.com>
Date: Mon, 31 Jul 2023 13:21:49 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [XEN PATCH v2 1/4] x86: mechanically rename to address MISRA
 C:2012 Rule 5.3
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1690788513.git.nicola.vetrini@bugseng.com>
 <b169d1c682254e682e6ed34f33481a768209ce9b.1690788513.git.nicola.vetrini@bugseng.com>
 <bdd5376b-477f-71e1-94db-71a2e4cb716e@suse.com>
In-Reply-To: <bdd5376b-477f-71e1-94db-71a2e4cb716e@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0216.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ac::20) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB7541:EE_
X-MS-Office365-Filtering-Correlation-Id: 5add7aaa-0f18-42c6-12cc-08db91b85553
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	9eCDhktHE3trISt/9kygLq7JKfoYO9Bd1Q1KHVcanaks9RE/RI32IbF5QY4LF+Gc0OuZcu3Jg6dqeGVoI8CZPcpFJTOcD8vjJ1q/wY0LJxGjAyLaNDgPJ1o4NSUPdiCqdixMKGMXrCqyijmz5tV8NZzfOw0JhSvWz8nNe+UIcLUcvoli4xBukXFXI/vBIRuQ4KKWlo8138OAy5j+OKaaVVlURVAy1NZoMvNFq3gkySdT74+N7MpLJ/QredmoVWq6kiile2P4mMRn6lnj56pZbu5spgZd+oBmXGXZaqV9yFthcK5jn342C6aAMt31d/7YrNDLm1Nm65rIk/V6UPLlGH9+sBQ3HZ79qu0Zwm/HcJGVLmAsc5vKD15IReYzMGyZNWQ3Tb+LGkYo9WznrjkBCDlQ1HeoYfrozQKi2ldMCqlGaBeksg88T8SKcAkecNvqJIVtkXR5vUI7F0/ZNinYmCQRXFmzIcN7dDpG14zQRgltM/VgRkFIwNzYn+gaC6TNtO0PlfsSDjmmaMWuRLNjjMsTrDKtql/Z87syDb8dRC//SeGzpgAi0CuJV5BpXjznfdf83idlQ1n/4diCsABu0OjDzTq8yrIHYuVc9fPIVtSIol2S2lE8Ioo0/HpuLsN9wGZ5iX8qYQKc3faSXCNAzg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(39860400002)(346002)(376002)(396003)(451199021)(6512007)(6486002)(36756003)(53546011)(2616005)(26005)(6506007)(83380400001)(186003)(66946007)(66556008)(7416002)(54906003)(31696002)(86362001)(66476007)(316002)(4326008)(5660300002)(6916009)(8676002)(8936002)(31686004)(41300700001)(38100700002)(2906002)(478600001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZHc4SFRqeXZZL0g1RjhrdWI5K1REakZydDRKT2grNi9hWWh4bGFkeGdGMFMw?=
 =?utf-8?B?TzRXd0NOVmJjSFp1R3FmZjZ2cV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WlT?=
 =?utf-8?B?NjU2ZEhpQVlDelNuM2tJSC91d2tLRjgrMzVtaDFPb0xBWmdlYkhtZmVEQ0tC?=
 =?utf-8?B?d2F4Z2pZMURLVmU5SHdqaERLRFBma0FTQUNLN1FxWktPa0djUm0wdGpkNVIy?=
 =?utf-8?B?VFR2eGJWVkNhQzMrZ3RUc3VuZXF3OHZHRldQQ0NCampyUi90NkFSdTNyZktt?=
 =?utf-8?B?c2dNS0xneFEzWTNzK204Rms0TEdxSW9hdnU1NDBBck5vU3N2STU5NmRLYlYv?=
 =?utf-8?B?cnB3U0ZCamFwOG82K0RuMStpekhaaEMyR1d3Z2NvTFBxdi9DZmNWY2dTUjd0?=
 =?utf-8?Q?rzK3maBO3+Fy95r8e0cXaiH38?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5add7aaa-0f18-42c6-12cc-08db91b85553
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 11:21:49.5903
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: /KIU8T4C+4YI6QjhY7bP96u3PJBk+DYMym8G8O1GIt0GcVmNCqscnZVtUcu0hMPLmByYucbTJsmUgjj6r1rCdw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7541

On 31.07.2023 13:15, Jan Beulich wrote:
> On 31.07.2023 09:33, Nicola Vetrini wrote:
>> --- a/xen/arch/x86/include/asm/hvm/save.h
>> +++ b/xen/arch/x86/include/asm/hvm/save.h
>> @@ -49,21 +49,21 @@ void _hvm_read_entry(struct hvm_domain_context *h,
>>   */
>>  #define _hvm_load_entry(_x, _h, _dst, _strict) ({                       \
>>      int r;                                                              \
>> -    struct hvm_save_descriptor *desc                                    \
>> +    struct hvm_save_descriptor *descriptor                              \
>>          = (struct hvm_save_descriptor *)&(_h)->data[(_h)->cur];         \
>>      if ( (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x),                 \
>>                 HVM_SAVE_LENGTH(_x), (_strict))) == 0 )                  \
>>      {                                                                   \
>>          _hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH(_x));             \
>>          if ( HVM_SAVE_HAS_COMPAT(_x) &&                                 \
>> -             desc->length != HVM_SAVE_LENGTH(_x) )                      \
>> -            r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length);          \
>> +             descriptor->length != HVM_SAVE_LENGTH(_x) )                \
>> +            r = HVM_SAVE_FIX_COMPAT(_x, (_dst), descriptor->length);    \
>>      }                                                                   \
>>      else if (HVM_SAVE_HAS_COMPAT(_x)                                    \
>>               && (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x),          \
>>                         HVM_SAVE_LENGTH_COMPAT(_x), (_strict))) == 0 ) { \
>>          _hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH_COMPAT(_x));      \
>> -        r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length);              \
>> +        r = HVM_SAVE_FIX_COMPAT(_x, (_dst), descriptor->length);        \
>>      }                                                                   \
>>      r; })
> 
> The macro-local variable gets too long for my taste, to be honest,
> and it being improperly named anyway suggests it simply wants a
> trailing underscore added. And then, since for a variable named "r"
> the risk of shadowing is equally high, that one wants to gain a
> trailing underscore as well imo. (And while at it, I personally
> would also drop the leading underscores from the macro parameter
> names. Furthermore I think it would be nice if at on the lines
> touched anyway indentation was also corrected. Overall maybe best
> if I submit a patch.)

In that replacement patch I would like to mention what "desc" this
collides with, but your description didn't say so and I'm afraid I
also haven't been able to spot it (grep-ing for "desc", even with
a couple of extra restrictions, still yields way too many hits).

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 11:47:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 11:47:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572934.897068 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRMj-000617-C7; Mon, 31 Jul 2023 11:47:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572934.897068; Mon, 31 Jul 2023 11:47:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRMj-000610-8Z; Mon, 31 Jul 2023 11:47:09 +0000
Received: by outflank-mailman (input) for mailman id 572934;
 Mon, 31 Jul 2023 11:47:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQRMh-00060u-Tv
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 11:47:08 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on2060c.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::60c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f9382701-2f97-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 13:47:06 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB9271.eurprd04.prod.outlook.com (2603:10a6:102:2a6::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul
 2023 11:47:05 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 11:47:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f9382701-2f97-11ee-b255-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=OnXr39GAjj3kmTLgBEWasQVxmb+J3Mru2nc/vbyA+xHNsO2SgM7n9XQA1cqMXteYNkVrHuWY4RXpxGHJuJJGkNh0qZmVRc/a0Mxi9EWUHnHJsSUFSSEz2mt/DVDHMPK5hqXdp1NNAs09rxcRh9MgTey5fACzPSR5r1xhNn3ga3tTT1dQkdYJC4XpKASpt5VbXdqpeI0LSqn3OSg9xbkrPgqbGWk8TfztE99RgJ7xCtPeDEMDBgppccLrDeDWLHNMl4nMfEB2EkLICDTnZSlZLB/AXnndYRRe+S0qvTAsforSGVm0BRHW+h+x/yueE3a45HgH7RWLt8HrgJdjKMBcpg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=imALnMsTSg632PBB97Srx8D9nMUjfHLOjZQI9qW3tuI=;
 b=KtLTpo92Uw8sgG9Y+dx8xTuwzAeix9WdbQUsXFZDA9k7qzAtcmmZxfvFNQDXysJfhKG6pgl0TQlJh7osvsloS83XHvcGQimz2z6iKu7FeYe5/DlT8v8wUyHONne+vnFnaubfgGdHmSGr/5FICaZzvuWp/pdvJHdqJcQqvBp0/NnS2KzS1DHQ3Vb+A8a0ErMiOZpBxNbW8TH++LR+Me6aD9P3H/JYGwLztSDPjbyJB/aZFTz6lkcydHHHDpSp7Hic8QLhKRsI1JnHx/vtkVfDSv7wQH2BT+GYiUROK9IV4qZuld9B32JsRAw0qMDmuxikgIQs5Y/GgSO31z7liaOjzg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=imALnMsTSg632PBB97Srx8D9nMUjfHLOjZQI9qW3tuI=;
 b=hnqmMO/noznN3JH3OExu7zgRmnABGlYXysLIoHQT7b9cvZk+Mrs11opLyoIKFhCvlnsplBski7RnGOYjtmP3NsV+8snbmsvOaaEtwyl+WsxJxidMI8Dy86+Ox5TKGDthyeHyKo5EXVOkFRoGar1DdbQU2nHRlLG1UhNpLkia90GylWloE+yPR5VDrt77IhlXd3CNmZxWjZnYS0yG0iaDJCHZG0HEirMXprRaiNwp9pPPw2dyA84pdNtxoexHJu2Zm3OMStRSXtl/o30lhWruEPKUe2h30WHp+UB+j/twKcJZkpMR3nLj2VTd4tYmj/ek76cLrowUCOt7IicL66khBg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <b518e00e-fbf3-e5b5-6678-0ad5f40bbe29@suse.com>
Date: Mon, 31 Jul 2023 13:47:03 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [XEN PATCH v2 2/4] x86/mm: remove variable to avoid shadowing
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1690788513.git.nicola.vetrini@bugseng.com>
 <734fa59e3f1ee384a5481fb9952f79c8751f04cc.1690788513.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <734fa59e3f1ee384a5481fb9952f79c8751f04cc.1690788513.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0150.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:96::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB9271:EE_
X-MS-Office365-Filtering-Correlation-Id: e0bf1a92-34e7-47aa-0f24-08db91bbdc84
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	lFH6ybyA50nqiVmBjjgyR3HC0evkO2HrDBEXQ/bnWCS79PhyNLNg86SQkA4Dq+rVDlgfxJ0O+DLEijwFIvkN1mk4kqtu5j6Onv1wH4lmFSPnvMqnuTMmziOjl44RPzCoNzg11P1YWJofAHu9prbThnUzy/oyNcA0j3MqXeffmq1x8Oxg7sfsjum+ryyxwYjCJEc+VUWLU74pphuEP3ZPGEhEF/zAcHNemyjC4YVPWG6sL1T4uK8CVE6jzIfyhF6xca3em2zSNNjrThKdgSLifJXIZtkF4vcR2980G5uS+Mr3URWjczrnRoN2rWBV23TLyDFt+nnV9JsnIMOFXy/apHD3BoqUdNi3GQdIOuoypSKUhNIem0Abi3rHNSYtaYhUnBS9rEX9uZ3vC1gDVqBzZDb/AEsIHAB8XDlVlewSJsp20xIocmCA/dAghmeV8XmzyqmF7nUDIlccp3wS30ARuxAh7BHQVGj4hW3BuF6lv7JjF7ZfsW3KtpyuhoNLjq90BbOfpjIsf02L4lLuA50xXWncMj4YGpr8gRX6R1FOxwsTce+v7XIevpy2+F811dareZYRA+IVeLQHwOUWT/5FbIiZ/lT+iYxPtBGBXYiMA3lKCi2lYZY8LcLSwZKfiZElXutxdIQJbk0xzf0Z5mnccg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(396003)(136003)(39860400002)(366004)(376002)(451199021)(38100700002)(36756003)(86362001)(31696002)(6512007)(478600001)(2616005)(6486002)(53546011)(186003)(26005)(6506007)(8936002)(8676002)(7416002)(5660300002)(4326008)(6916009)(66556008)(66476007)(2906002)(66946007)(31686004)(54906003)(41300700001)(4744005)(316002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Ukg2cW1oUEdMbm9QNW1qdkNGc2taMGRodjhvN0o1K1VuN0w0cUhPdmsxMWdy?=
 =?utf-8?B?TTJnQVVIbjhhYnd2WExKNVhlb1BEbVd0end3OWV2cUhhbkY5dSsyem55SHBF?=
 =?utf-8?B?K3pjOHlpVEM0ST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luWnpK?=
 =?utf-8?B?dVdDYkpjT1prRHZpMWJQRVBQZk1RdUYzSkc1eTUrd29ENGp1alZBc0hYeU1N?=
 =?utf-8?B?ZjJRaGh0dGNZdkJ5SUxLb09COUtvS1pzaU4va3YrclQ5QVN6RW9CTXIvR0pq?=
 =?utf-8?B?Wk4xMHViQ0lGMzM3d3c3b3E2YklTeGNyOFNqMnBJNll0bHZWN0o3TE9RQjhl?=
 =?utf-8?B?c3Z0azE1ZmZ5cjVRYy8zRTEvZTVRaWtXbHN1dWNRVGMvZm4vcXgrTkhPR3dH?=
 =?utf-8?Q?k3j6UQ3Yg8sayZspfE41XtsHg?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e0bf1a92-34e7-47aa-0f24-08db91bbdc84
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 11:47:04.8966
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: VdXZKiIsvCcFIHq2r2QbZWB1lZAK4yRzQYw9kO+HqAeS2e3e1Ho5RN82X3FqFxIwu6TIgPcRbOiVl06fGaDy5g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9271

On 31.07.2023 09:33, Nicola Vetrini wrote:
> The local variable 'p2mt' shadows a declaration of the same variable
> in the enclosing scope, but removing the inner declaration
> does not alter the semantics ('p2mt' is an output for the get_gfn
> call later on) and this resolves a violation of
> MISRA C:2012 Rule 5.3.
> 
> Both variables were last introduced by commit
> d4f699a0df6cea907c1de5c277500b98c0729685.

No, that commit moved the function (without correcting the issue,
perhaps because of not noticing it, but perhaps also intentionally).

> No functional changes.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

With the misleading part of the description either dropped (which
I'd be okay doing while committing) or made meaningful:
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 11:48:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 11:48:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572936.897078 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRNh-0006Wi-Kr; Mon, 31 Jul 2023 11:48:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572936.897078; Mon, 31 Jul 2023 11:48:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRNh-0006Wb-HM; Mon, 31 Jul 2023 11:48:09 +0000
Received: by outflank-mailman (input) for mailman id 572936;
 Mon, 31 Jul 2023 11:48:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQRNg-0006WQ-8n
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 11:48:08 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on20612.outbound.protection.outlook.com
 [2a01:111:f400:fe16::612])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1d778d54-2f98-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 13:48:07 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU2PR04MB9177.eurprd04.prod.outlook.com (2603:10a6:10:2f4::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 11:48:05 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 11:48:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1d778d54-2f98-11ee-b255-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=mQcqg+ufGJBkpsXsoO/lIUJqsWBZcwSYVB56SiKEOiEQkPEV7f4jbe65/g3stjYl5E6RmSr5b/0z1ZOx7VUiN9H7dgwfelP75ymmDA+uKq1diihIQjpOiSqeKlmEQ8DrFvQkBTW3JWl4/rfuYa+4d9sb3BDBY9jJ4Uv7Ba0kYMUqxgCk0GBv5rdaE7v9CbiUOcSs2Dxja/00yS0SA28cV+dOTcGh6QG7OVGRsOelcxCagPGpzlnyj8ayeOdbezgi6G7hXMNkJCUVIVKLrx/w+c5B8MDdK8WUOg8zpKebMjpcXGMMddLyGlqHKtrAT1gP3GQ2N6jouTiY5XGALaPOhA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/e68tzN+r6d6d+ew1BHV68AgQEJX+eBQh5BTQkiEv1o=;
 b=EPkKavUwiIHMrUvPWyyjLBEzOWVjSBo8chG4iTcNUXZxQf6GYPUBTUQSB5oYcRKA02+4HDl4xm8/Uhw6WN3IKb66d/34EpQ2SKbrkbBeiBjWiwdHbBJTd1jCmgd1c+IrR0AJDFKW+3JcWm4DEMeBKYBtL/4VkFKdPiJJ5iQIwgGFpJG5zk8aLbnYt3Cu+zIGO/JELguKhcTKQVlYE93noQaNcGadWrNILfgfVJPbC3GiR/x5Ug6Mc3Wlb/VXJV1vcp5cGlu0AzTxibQkbtUZz6+Mu7wWF0vDsecCDuzHtCp1DUlpB8Wnb3dKCeTJXmMYqNnXAMebIDx09w3i9EyWig==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/e68tzN+r6d6d+ew1BHV68AgQEJX+eBQh5BTQkiEv1o=;
 b=Z4poNHQDmUwzHuvFReMaLxdYgicz52FF07LRNo2/hRRsbTl5UkR7jrDqKc5nlFZYsue413uYuo3bnwIAY85Sv0i4D4mTbKZNhN/vxLOA++g6EZaRCcuRAXocs3BuiwfL7jf3NBbwI2nlmDrr18qcX5JdX2VUKxhhnhJw6TxQDmU1LJUW6oeDdUn2uANaHiU4xDIy/LctLQGYnKwftHZSxtCcrbCb0QT/VA4O8Hi1vWAT5SjR5s7zRq13IdeNcF0nTU4d8j2q8gdxrOFLEAdPz39UT343tZv0IRU05+iyq18nke8jakaS97E9JTnVT0PTJF+YrZFMveEmOzh6MPtGzg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ed29a170-e6bf-e3ef-9aa8-5b1f29061f1a@suse.com>
Date: Mon, 31 Jul 2023 13:48:04 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [XEN PATCH v2 3/4] x86emul: avoid shadowing to address MISRA
 C:2012 Rule 5.3
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1690788513.git.nicola.vetrini@bugseng.com>
 <951f634fe058ce56791f3e67f011a2218db6626d.1690788513.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <951f634fe058ce56791f3e67f011a2218db6626d.1690788513.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0038.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:48::21) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU2PR04MB9177:EE_
X-MS-Office365-Filtering-Correlation-Id: 1dfd1b32-5e13-4467-0e83-08db91bc0048
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	R4sHBSbczWYP4ji3k25RRJcE2p6spWaHmuHnKKrEo2dOtUVh9IzulVOTH+St0Y1aum3BJ4J+4immJSDjb6rOsllSM8KKU8/QPKC+Cxc+cRplrGerfUbDGyJb2oscLPSFopG7t0RiqhQ5nhtcZ1iLGbf+1xYzmM6ZnjxY080A0TBqaa2QNXOcsfIThqIh2IrqJVImQJ9ZrOwHAYm8t5TKA5rI31nxruX1r9nK1IFVwxaM2/3OF0vo/zum3VL4vBAd4FVtVYVawKbjs5ApgDDcTYDjtbLU2StxVX39HCXVbktIDjx+WztqM85n1jVxVFo2yac0ekEt7ZS5ghRbEC5TWexf24C6g7VjKxfg50wT8kDXcY4gBMXjdNsvyQMeadovz1h5z0l1SD0BkIRdWinbLoOLGHeOK1AxfQrI5xYS3bz6Br6wFVCzlAwoiENDfrHYDzIRTmengyA5nWMaIb0AVwOqKcE2sKtyCrMTqsQSUj/gR1NR/wAyyP/Wv9uRPhPNU2243Ar40PYuIilhFmlgZkdeSp19ZyG7sPHYf9ZDeiQmGkf+iaw8O6aR/t+cvg83ArbKsOdLIZksyZfYXetWsJ6uTq8SZOqQNv51t26T+tg89ei++4/is7kiO+Vkf4bJwVhJF7lbsfpKGSaAdl9rLw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(39850400004)(346002)(376002)(396003)(451199021)(6512007)(6486002)(36756003)(53546011)(2616005)(26005)(6506007)(186003)(66946007)(66556008)(7416002)(54906003)(31696002)(86362001)(66476007)(316002)(4326008)(5660300002)(6916009)(8676002)(8936002)(31686004)(41300700001)(38100700002)(2906002)(478600001)(4744005)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0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UWU4rcURqQ0FYdlVVQzAxeCtvVjJLeGZM?=
 =?utf-8?B?TUhCdzFWRHhRUklQU2ZML0lYWnJFbndGM0xKWnZoZGtXallkVzF0aXludmR6?=
 =?utf-8?B?YXpWTUk4Y3JoZWtzTFpKZTIycXl2S2xNbjRXTUZXQ1l2Q1FoNWdaNkFxbkFD?=
 =?utf-8?B?VFZranZGSlNUNytJK2FrcmNuTnpIVkR5UG5FTm1FVVZZODVEelFYS3JVZlhq?=
 =?utf-8?B?aGlQTTdIVTEvZHg2VEJoM3Z3bEhRM2EySHFkVlR3eXk0Ry9XVTVicnpEVGdj?=
 =?utf-8?B?dmpGbEJzaVJHV0NmWTFQSmFvaldySWZ2WHdoRXpsR0RVN0ZiNmVkQWhiZzdO?=
 =?utf-8?B?TVQxY051czNEdUlrQzdBUXpGRDd0RmRaVFpNL2lRN3JLRGM2NFFNMVdRN0N2?=
 =?utf-8?Q?Q2GKOzR7xronzvWdWPwmG2v4q?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1dfd1b32-5e13-4467-0e83-08db91bc0048
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 11:48:04.9051
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: TpqHcATaEWL58qfTqC1BDVQ/6PoOgEnAee0yKHnMGDdxyaPF1kSD9OVqHb4O2g1Jm6g6O82g9flUBfRkcZ5RKw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9177

On 31.07.2023 09:33, Nicola Vetrini wrote:
> Rule 5.3 has the following headline:
> "An identifier declared in an inner scope shall not hide an
> identifier declared in an outer scope"
> 
> The declaration of local variable 'cpuid_leaf' causes
> shadowing with the homonymous function to happen, therefore
> the variable is renamed to avoid this.
> 
> No functional changes.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Mon Jul 31 11:53:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 11:53:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572942.897088 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRTG-000850-Bp; Mon, 31 Jul 2023 11:53:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572942.897088; Mon, 31 Jul 2023 11:53:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRTG-00084t-8Y; Mon, 31 Jul 2023 11:53:54 +0000
Received: by outflank-mailman (input) for mailman id 572942;
 Mon, 31 Jul 2023 11:53:53 +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 <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQRTF-00084n-LA
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 11:53:53 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20609.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::609])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id eaa9bea8-2f98-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 13:53:51 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU2PR04MB8966.eurprd04.prod.outlook.com (2603:10a6:10:2e1::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 11:53:49 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 11:53:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eaa9bea8-2f98-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=abETt4sPeMiXB0FiNM+436NMHjwDBdbX1UKhyr2w7YMwj+UwJrK9C2qUVu8Vwm+aNrpUIu4OACu/Fthh/nSWKrYj96KJCh2g5fo5seVCUzb2XKVP0rvYOKu/WV0EuxAdbff+Gj5+Ub72tTUpdxseErL1ejVjwJMYXNZAPkGK6HxgiGKsxpmeeBE1H/CymxG5PCF4D8D4GTclQK2KZyXS64uEm+Eu/dbfkmD6himv4r57XgN3Peqc67JbgFQBZvAb86mfWLPR5AD4HJ9CwEuRCPasRVepddQPfsu5cB8J0Gylmc1F4yuEYHsKH8w9z0GlmoiEQpUWK46iTKzhKLd4QQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=imOmaTds8fMDWiVdJoDNGj1OHQOgFq6px+l/HTwbCKo=;
 b=CS+rB8CCDDhknn9uuvxZrf3Yt0TYvQ7WnI10aAjTpIQcEneNSnHyd3tyAiDpB9oMXHKTeQE5dq8hRScPvXjkUlMSvZRnJRQeR2McAes8tq8RlhQa2DBhJXHDDZ6hwye+04nFT4p3UaDJlPGRCkKrR7hXO7LbPOYf/RBFjhiAjcWsb3S2OUQ8dMUx+KuA4VH5NsM+VffY9EIh2ztzTt7Hzn2ISWNbVUIDfW5tv3i4E5AB0PsxM9L1FEGoowC9E+E+NlhkUlxBULJrWebbze5z9w5JnYS52+geUiv+08uiOyFas1QJBh+7d/hUc4fjiJKxqUBKLfBn3vdXPhYyfQqA3w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=imOmaTds8fMDWiVdJoDNGj1OHQOgFq6px+l/HTwbCKo=;
 b=lXx3RxIJYWu8nF7S3vxkv2Id70kPeMYlsf/ty8q7akgsPKO7w8e4ZVeGPJqjzoeI7908NDAzD0NBBuDY6M8X01t9luCfGDlSeW7iJ3IOnqgp981nv0chKFjXFIr/9UrOts/2yhMBDdyeO1sNZiI0mPpDT0RqGmIF73a9U7gIfmRRnguU0U+74ie08fmrLcR16JyyoS1NoJ5OG0fEJCCDs+UAMZvm0R9wZ1Dy+7SH8barHA2Bg+0RNSyyJT4dQ26v+oHb9Er7VzoDUiZtSZqjth3cEW++JHBMx8/fazXcuUX/9szSI/VgkTuNmIXtu6Z1M1IVWvuPO+Ss7akkru23Sg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ebd46128-a8c6-4aae-4efa-85ce889d0f72@suse.com>
Date: Mon, 31 Jul 2023 13:53:49 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [XEN PATCH v2 4/4] x86emul: remove local variable to address
 MISRA C:2012 Rule 5.3
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1690788513.git.nicola.vetrini@bugseng.com>
 <d9ab52ae16d3c9a780403906db52b42f24c1e60a.1690788513.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <d9ab52ae16d3c9a780403906db52b42f24c1e60a.1690788513.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0010.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:15::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU2PR04MB8966:EE_
X-MS-Office365-Filtering-Correlation-Id: 6230c135-6b0a-46a9-3734-08db91bccdbb
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	ePQc/ZBZC2AtXoI+1V2oBVe8py5SLpzD3eIIpnv7WP+m2efwI1Nxb6Iq/CMQZolz1/Si908Gy39qGZ26JE2m91LSvd5T5h5L9kEbizs9Tnxq5391x5SesIc8XlQdRz2BGBRKzdYITs5RIk4fQ2vZeq9Vui4VlEmlB2e59vpyA6k9PkKgYYiUwTP8CoWuR/cq50MKlIIm+RvzgJtl/cnxHFqbnOJcWhCr8mIeOZ6zrxI/cDOA1z0SlDhbzlnrhoWE5YgPzBmXKhuiSTIExEvQEl4c01/jE2I5lUSTzUwzoIOMPvHVQKn1kN8vLNklllVZscU8Ri1rrzjwvzC8EOrdgcyhV5BWjDr6bRWPzK7tLkxLr6SamMndSWJvGX/9UBaACQkQfQbBVh95XwcraZecRkll46P7elRllNuU42hX/bDN6femwScrizAmhhcnP54JMdZ9IrerLyDtfYQEQ6ylbpWippZXOzOTmrGu2Y81YQ3zuxI9cpYtLBWyUfP8VTqjO2cDWcxvgnpxQ21Yihm1VrxQZB7ySGAvr/LNlgdfRR+8dHBykkqPDRmaSEP7AYfMQ/w/uh+HuPg/iOeWKzC6PiU7nEweGbq0UMWaJA0V+XO/S2z9M1Q5uf4cx0m5EK+umFHOpD13KN2lNd0J5p09Hg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(39850400004)(346002)(376002)(396003)(451199021)(6512007)(6486002)(36756003)(53546011)(2616005)(26005)(6506007)(186003)(66946007)(66556008)(7416002)(54906003)(31696002)(86362001)(66476007)(316002)(4326008)(5660300002)(6916009)(8676002)(8936002)(31686004)(41300700001)(38100700002)(2906002)(478600001)(4744005)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-M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em02cExjZkNsSzJnOCtmM2JvR20rNXRjVm5qV1dSenBhWWQ0UHl3NmxReG5U?=
 =?utf-8?B?UVJtTG93ZE1ta0RNMFRMcVBCZmlXOUN1OURUWmhGcGJTZWlRREJyNEZyVFNv?=
 =?utf-8?B?U3JHbjE5ZWpoc0lJRmJIUXhQSURiS2pGUGIwTWtybVhGV29BZEhWMDJaV3NU?=
 =?utf-8?B?b1hyVGpnMXhDajZrQytMei8zaytua2FjYThzMnBVKzNLSUVndUNpc24wOXZW?=
 =?utf-8?B?QkJDZklBbjBKcERqWTNDeE1KZElLUnBpV0taSUhFcWp6MW93ZUhzcGllZWc3?=
 =?utf-8?B?SlRxa2NrbzZUK3Y2cnVvYVRCaG1MVFhPOXJxdHI5WXZBQnJaaDdTak9BOUNv?=
 =?utf-8?B?ZjVYM1hEendtdmhtbXlDQnYyaWo2QncvY0h1eERkLzJaTmlHQXlNTmZ1Vzhn?=
 =?utf-8?Q?1zP2XzJGJCfzvCepvjNqZuHKw?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6230c135-6b0a-46a9-3734-08db91bccdbb
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 11:53:49.6103
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: LInktQhGXfsgcIrL6HzZmwQE3Y35t8OTi9VaLOxmUR/PQTN9hJTD7sYXVjc/LMBy6HxjWK8KJOfBiMpc3L5a1g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8966

On 31.07.2023 09:33, Nicola Vetrini wrote:
> The local variable removed by this commit shadowed another declared in
> an outer scope and thus violates Rule 5.3. It was introduced as part of
> a refactoring by commit abf5fb62f73d0dbeabc6a8cd6dbb55174b36c8d1.
> 
> No functional changes.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

Albeit, just to mention it, the description could have done with making
clear why the removal is actually correct (nothing like this can be
inferred from pointing at the variable's introduction). But well ...

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 11:57:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 11:57:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572945.897097 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRWe-0000FC-Pz; Mon, 31 Jul 2023 11:57:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572945.897097; Mon, 31 Jul 2023 11:57:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRWe-0000F5-NR; Mon, 31 Jul 2023 11:57:24 +0000
Received: by outflank-mailman (input) for mailman id 572945;
 Mon, 31 Jul 2023 11:57:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=wM77=DR=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1qQRWd-0000Ez-QQ
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 11:57:23 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 688826ad-2f99-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 13:57:22 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 327C51F385;
 Mon, 31 Jul 2023 11:57:22 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 025281322C;
 Mon, 31 Jul 2023 11:57:21 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id tTmVOqGhx2ThCgAAMHmgww
 (envelope-from <jgross@suse.com>); Mon, 31 Jul 2023 11:57:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 688826ad-2f99-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1690804642; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=MKIqS+DTbkcVKo22Hg+95cZLxs+C/nZoBiviUVxjNYA=;
	b=gZtREKCD2PV6bcf3t6PnoIj2A7l851pW7jrnpMqao8ucqC2IuF5vSY22CMftIO7gsZwJeI
	AYdalE8qsWhoD3n/M8ipl9ilXFtqZ7ytU5du+zJ5hNM4i872zueq1jzxvCJqCArhkxX0Js
	eAFG5Qpt3xdND599aspXXQwRBELg1Mg=
Message-ID: <cb9828c7-6901-2157-fce4-20f25a5a47c7@suse.com>
Date: Mon, 31 Jul 2023 13:57:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.12.0
Content-Language: en-US
To: Simon Gaiser <simon@invisiblethingslab.com>,
 Thomas Gleixner <tglx@linutronix.de>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <20230313134102.3157-1-simon@invisiblethingslab.com>
 <81ca146e-986c-b934-3567-2e1267a31ad7@invisiblethingslab.com>
From: Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH] xen/events: Add wakeup support to xen-pirq
In-Reply-To: <81ca146e-986c-b934-3567-2e1267a31ad7@invisiblethingslab.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------vdEt5806AaAAMfjzKlwwXqSJ"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------vdEt5806AaAAMfjzKlwwXqSJ
Content-Type: multipart/mixed; boundary="------------hnhQy3Gx0sVG2isGs0t0CJIj";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Simon Gaiser <simon@invisiblethingslab.com>,
 Thomas Gleixner <tglx@linutronix.de>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Stefano Stabellini <sstabellini@kernel.org>
Message-ID: <cb9828c7-6901-2157-fce4-20f25a5a47c7@suse.com>
Subject: Re: [PATCH] xen/events: Add wakeup support to xen-pirq
References: <20230313134102.3157-1-simon@invisiblethingslab.com>
 <81ca146e-986c-b934-3567-2e1267a31ad7@invisiblethingslab.com>
In-Reply-To: <81ca146e-986c-b934-3567-2e1267a31ad7@invisiblethingslab.com>

--------------hnhQy3Gx0sVG2isGs0t0CJIj
Content-Type: multipart/mixed; boundary="------------5UanDc0ouIVA0LprL4AZTBoC"

--------------5UanDc0ouIVA0LprL4AZTBoC
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjQuMDcuMjMgMTI6MjksIFNpbW9uIEdhaXNlciB3cm90ZToNCj4gU2ltb24gR2Fpc2Vy
Og0KPj4gVGhpcyBhbGxvd3MgZW50ZXJpbmcgYW5kIGV4aXRpbmcgczJpZGxlLiBBY3R1YWwg
UzBpeCByZXNpZGVuY3kgaXMNCj4+IGFub3RoZXIgdG9waWMgWzFdLg0KPj4NCj4+IFdpdGhv
dXQgdGhpcyB0aGUgQUNQSSBjb2RlIGN1cnJlbnRseSBpZ25vcmVzIHRoZSBlcnJvciBlbmFi
bGVfaXJxX3dha2UoKQ0KPj4gcmV0dXJucyB3aGVuIGJlaW5nIHVzZWQgb24gYSB4ZW4tcGly
cSBhbmQgdGhlIHN5c3RlbSBnb2VzIHRvIGlkbGUgZm9yDQo+PiBldmVyIHNpbmNlIHRoZSB3
YWtldXAgSVJRIGRvZXNuJ3QgZ2V0cyBlbmFibGVkLiBXaXRoIFsyXSB0aGUgZXJyb3IgaXMN
Cj4+IGhhbmRsZWQgYW5kIHRoZSBzeXN0ZW0gcmVmdXNlcyB0byBnbyB0byBzMmlkbGUuDQo+
Pg0KPj4gTGluazogaHR0cHM6Ly9sb3JlLmtlcm5lbC5vcmcveGVuLWRldmVsLzkwNTFlNDg0
LWIxMjgtNzE1YS05MjUzLTQ4YWY4ZTQ3YmI5ZEBpbnZpc2libGV0aGluZ3NsYWIuY29tLyAj
I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mZmluaXR5CT0gc2V0X2FmZmluaXR5X2lycSwNCj4+
ICAgDQo+PiAgIAkuaXJxX3JldHJpZ2dlcgkJPSByZXRyaWdnZXJfZHluaXJxLA0KPj4gKw0K
Pj4gKwkuZmxhZ3MgICAgICAgICAgICAgICAgICA9IElSUUNISVBfU0tJUF9TRVRfV0FLRSB8
DQo+PiArCQkJCSAgSVJRQ0hJUF9FTkFCTEVfV0FLRVVQX09OX1NVU1BFTkQgfA0KPj4gKwkJ
CQkgIElSUUNISVBfTUFTS19PTl9TVVNQRU5ELA0KPj4gICB9Ow0KPj4gICANCj4+ICAgc3Rh
dGljIHN0cnVjdCBpcnFfY2hpcCB4ZW5fcGVyY3B1X2NoaXAgX19yZWFkX21vc3RseSA9IHsN
Cj4gcGluZw0KDQpTb3JyeSBmb3Igbm90IGFuc3dlcmluZyBlYXJsaWVyLg0KDQpJJ20gbm90
IHN1cmUgYWJvdXQgdGhvc2UgZmxhZ3MgZWl0aGVyLiBVbmZvcnR1bmF0ZWx5IEkgaGF2ZW4n
dCBmb3VuZCBhbnkNCmRvY3VtZW50YXRpb24gb3IgY29tbWVudHMgZGVzY3JpYmluZyB0aGVp
ciBkZXRhaWxlZCBzZW1hbnRpY3MgaW4gYSB3YXkNCmVuYWJsaW5nIG1lIHRvIGRvIGEgdGhv
cm91Z2ggcmV2aWV3Lg0KDQpUaG9tYXMsIGFyZSB5b3Ugc2VlaW5nIGFueSBwcm9ibGVtcyB3
aXRoIHNwZWNpZnlpbmcgdGhvc2UgZmxhZ3M/DQoNCg0KSnVlcmdlbg0K
--------------5UanDc0ouIVA0LprL4AZTBoC
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV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gQB4iFQLhJCdP1I5aSgM5IVFdn7v5YgEYuJYx37Io
N1EblHI//x/e2AaIHpzK5h88NEawQsaNRpNSrcfbFmAg987ATQRTjHAWAQgAyzH6
AOODMBjgfWE9VeCgsrwH3exNAU32gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R38=3D
=3D2wuH
-----END PGP PUBLIC KEY BLOCK-----

--------------5UanDc0ouIVA0LprL4AZTBoC--

--------------hnhQy3Gx0sVG2isGs0t0CJIj--

--------------vdEt5806AaAAMfjzKlwwXqSJ
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmTHoaEFAwAAAAAACgkQsN6d1ii/Ey9T
mQf+MxoQhQG3qK8+lXVFo8Dcylx11qtwUjvNxY6uDyIz+AqtUwwar76liyoGY3V/Cp6FPFAUGVYx
4G6N0t7FJ9u1RlQIr2jfeLudxFhdu4LWjWrLgntfvN8E019UZF+YCPEaBppibfKQKLl3AkBRQvZl
4N6BeEfoFSunzCJyE25vTfUD10wbenfQI4yVGoPrkwzrz6hd+iTbuGDryMXnqRX2mddjpgnPZnmg
9RQCC99XkMi5a1NB8l3F6xQN86hT6V7uFvgm5PtVdEfsjivakoMzz+iQzyRNk7VAzR8HBzFZzjwm
5NNoPdJCQeVNrL+KJpz2eh2Mfb19EwJVbpzwhjyf5Q==
=kJ4I
-----END PGP SIGNATURE-----

--------------vdEt5806AaAAMfjzKlwwXqSJ--


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:03:46 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:03:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572949.897108 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRci-0001m4-IP; Mon, 31 Jul 2023 12:03:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572949.897108; Mon, 31 Jul 2023 12:03:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRci-0001lx-FK; Mon, 31 Jul 2023 12:03:40 +0000
Received: by outflank-mailman (input) for mailman id 572949;
 Mon, 31 Jul 2023 12:03:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Lm7y=DR=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qQRch-0001lr-I4
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:03:39 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 48587fe0-2f9a-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 14:03:38 +0200 (CEST)
Received: from Dell.bugseng.com.homenet.telecomitalia.it
 (host-79-23-62-117.retail.telecomitalia.it [79.23.62.117])
 by support.bugseng.com (Postfix) with ESMTPSA id 49CB24EE0737;
 Mon, 31 Jul 2023 14:03:37 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 48587fe0-2f9a-11ee-b255-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH] xen/sched: address violations of MISRA C:2012 Rules 8.2 and 8.3
Date: Mon, 31 Jul 2023 14:03:25 +0200
Message-Id: <072d163857101f4cdaf61b6336b2d8f2e65d7360.1690800014.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Give a name to unnamed parameters to address violations of
MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
named parameters").
Keep consistency between parameter names and types used in function
declarations and the ones used in the corresponding function
definitions, thus addressing violations of MISRA C:2012 Rule 8.3
("All declarations of an object or function shall use the same names
and type qualifiers").

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/common/sched/compat.c  |  2 +-
 xen/common/sched/credit2.c |  3 ++-
 xen/common/sched/private.h |  2 +-
 xen/include/xen/sched.h    | 10 +++++-----
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/xen/common/sched/compat.c b/xen/common/sched/compat.c
index 040b4caca2..a596e3a226 100644
--- a/xen/common/sched/compat.c
+++ b/xen/common/sched/compat.c
@@ -39,7 +39,7 @@ static int compat_poll(struct compat_sched_poll *compat)
 
 #include "core.c"
 
-int compat_set_timer_op(u32 lo, s32 hi)
+int compat_set_timer_op(uint32_t lo, int32_t hi)
 {
     return do_set_timer_op(((s64)hi << 32) | lo);
 }
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 87a1e31ee9..7e23fabebb 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -1480,7 +1480,8 @@ static inline void runq_remove(struct csched2_unit *svc)
     list_del_init(&svc->runq_elem);
 }
 
-void burn_credits(struct csched2_runqueue_data *rqd, struct csched2_unit *, s_time_t);
+void burn_credits(struct csched2_runqueue_data *rqd, struct csched2_unit *svc,
+                  s_time_t now);
 
 static inline void
 tickle_cpu(unsigned int cpu, struct csched2_runqueue_data *rqd)
diff --git a/xen/common/sched/private.h b/xen/common/sched/private.h
index 0527a8c70d..c516976c37 100644
--- a/xen/common/sched/private.h
+++ b/xen/common/sched/private.h
@@ -629,7 +629,7 @@ int cpu_disable_scheduler(unsigned int cpu);
 int schedule_cpu_add(unsigned int cpu, struct cpupool *c);
 struct cpu_rm_data *alloc_cpu_rm_data(unsigned int cpu, bool aff_alloc);
 void free_cpu_rm_data(struct cpu_rm_data *mem, unsigned int cpu);
-int schedule_cpu_rm(unsigned int cpu, struct cpu_rm_data *mem);
+int schedule_cpu_rm(unsigned int cpu, struct cpu_rm_data *data);
 int sched_move_domain(struct domain *d, struct cpupool *c);
 void sched_migrate_timers(unsigned int cpu);
 struct cpupool *cpupool_get_by_id(unsigned int poolid);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 854f3e32c0..5be61bb252 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -789,8 +789,8 @@ int  sched_init_vcpu(struct vcpu *v);
 void sched_destroy_vcpu(struct vcpu *v);
 int  sched_init_domain(struct domain *d, unsigned int poolid);
 void sched_destroy_domain(struct domain *d);
-long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *);
-long sched_adjust_global(struct xen_sysctl_scheduler_op *);
+long sched_adjust(struct domain *d, struct xen_domctl_scheduler_op *op);
+long sched_adjust_global(struct xen_sysctl_scheduler_op *op);
 int  sched_id(void);
 
 /*
@@ -831,11 +831,11 @@ void context_switch(
 
 /*
  * As described above, context_switch() must call this function when the
- * local CPU is no longer running in @prev's context, and @prev's context is
+ * local CPU is no longer running in @vprev's context, and @vprev's context is
  * saved to memory. Alternatively, if implementing lazy context switching,
- * ensure that invoking sync_vcpu_execstate() will switch and commit @prev.
+ * ensure that invoking sync_vcpu_execstate() will switch and commit @vprev.
  */
-void sched_context_switched(struct vcpu *prev, struct vcpu *vnext);
+void sched_context_switched(struct vcpu *vprev, struct vcpu *vnext);
 
 /* Called by the scheduler to continue running the current VCPU. */
 void continue_running(
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:11:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:11:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572954.897117 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRkW-0003Fm-AC; Mon, 31 Jul 2023 12:11:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572954.897117; Mon, 31 Jul 2023 12:11:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRkW-0003Ff-7a; Mon, 31 Jul 2023 12:11:44 +0000
Received: by outflank-mailman (input) for mailman id 572954;
 Mon, 31 Jul 2023 12:11:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQRkU-0003FV-Ej; Mon, 31 Jul 2023 12:11:42 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQRkU-00070Y-7b; Mon, 31 Jul 2023 12:11:42 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQRkT-0007e0-Nn; Mon, 31 Jul 2023 12:11:41 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qQRkT-0006sq-Ko; Mon, 31 Jul 2023 12:11:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=GTzP0IQdUpgogduLxvIoBkl9bk8z8+9Cb+GKmCiTdt8=; b=6pHlvSGF/3Y9CzlYZnujkJZ2LX
	Y8OqOu8IS+BA56f9G9LODfqP9Dfd1valPc3ZDxRHqsmNDvfPA4AZtFDjmHKRBUnCFoSb8GRV2NUJv
	MdylWrlo4nS63CUlclHbnNzJ+IUdzExfHezq3Y6quQUP3DDAxr3CmbU66t5A1bLl7wmM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182085-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 182085: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-dom0pvh-xl-amd:guest-start:fail:heisenbug
    xen-unstable:test-amd64-i386-qemut-rhel6hvm-amd:xen-install:fail:heisenbug
    xen-unstable:test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm:xen-install:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt-qcow2:guest-start:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qcow2:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:windows-install:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-xl-pvshim:guest-start:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-i386-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-raw:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=fff3c99f84589a876fcd8467ea99f2c8d9ff8d21
X-Osstest-Versions-That:
    xen=fff3c99f84589a876fcd8467ea99f2c8d9ff8d21
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 31 Jul 2023 12:11:41 +0000

flight 182085 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182085/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-dom0pvh-xl-amd 14 guest-start   fail in 182079 pass in 182085
 test-amd64-i386-qemut-rhel6hvm-amd  7 xen-install          fail pass in 182079
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm 7 xen-install fail pass in 182079
 test-armhf-armhf-libvirt-qcow2 13 guest-start              fail pass in 182079
 test-amd64-amd64-xl-qcow2    21 guest-start/debian.repeat  fail pass in 182079
 test-amd64-amd64-xl-qemuu-win7-amd64 12 windows-install    fail pass in 182079

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-qcow2 15 saverestore-support-check fail in 182079 like 182072
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop  fail in 182079 like 182072
 test-armhf-armhf-libvirt-qcow2 14 migrate-support-check fail in 182079 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182079
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 182079
 test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop             fail like 182079
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182079
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182079
 test-amd64-i386-xl-qemut-ws16-amd64 19 guest-stop             fail like 182079
 test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop             fail like 182079
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 182079
 test-armhf-armhf-libvirt-raw 15 saverestore-support-check    fail  like 182079
 test-amd64-i386-xl-qemuu-ws16-amd64 19 guest-stop             fail like 182079
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-i386-xl-pvshim    14 guest-start                  fail   never pass
 test-amd64-i386-libvirt-xsm  15 migrate-support-check        fail   never pass
 test-amd64-i386-libvirt      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-i386-libvirt-raw  14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-vhd      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-raw 14 migrate-support-check        fail   never pass

version targeted for testing:
 xen                  fff3c99f84589a876fcd8467ea99f2c8d9ff8d21
baseline version:
 xen                  fff3c99f84589a876fcd8467ea99f2c8d9ff8d21

Last test of basis   182085  2023-07-31 01:52:13 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-i386-xl                                           pass    
 test-amd64-coresched-i386-xl                                 pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-i386-libvirt-qemuu-debianhvm-amd64-xsm            pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-i386-xl-qemut-stubdom-debianhvm-amd64-xsm         fail    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemut-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-i386-xl-qemuu-debianhvm-i386-xsm                  pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-i386-libvirt-xsm                                  pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-i386-xl-xsm                                       pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-i386-qemut-rhel6hvm-amd                           fail    
 test-amd64-i386-qemuu-rhel6hvm-amd                           pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemut-debianhvm-amd64                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64                     pass    
 test-amd64-i386-freebsd10-amd64                              pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-i386-xl-qemut-win7-amd64                          fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-i386-xl-qemuu-win7-amd64                          fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-i386-xl-qemut-ws16-amd64                          fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-amd64-i386-xl-qemuu-ws16-amd64                          fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-i386-examine-bios                                 pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict         pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-i386-examine                                      pass    
 test-amd64-i386-freebsd10-i386                               pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-i386-qemut-rhel6hvm-intel                         pass    
 test-amd64-i386-qemuu-rhel6hvm-intel                         pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-i386-libvirt                                      pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-i386-livepatch                                    pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-i386-migrupgrade                                  pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-i386-pair                                         pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-i386-libvirt-pair                                 pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-i386-xl-pvshim                                    fail    
 test-amd64-amd64-pygrub                                      pass    
 test-armhf-armhf-libvirt-qcow2                               fail    
 test-amd64-amd64-xl-qcow2                                    fail    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-armhf-armhf-libvirt-raw                                 pass    
 test-amd64-i386-libvirt-raw                                  pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-i386-xl-qemuu-debianhvm-amd64-shadow              pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-amd64-i386-xl-shadow                                    pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-i386-examine-uefi                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-arm64-arm64-xl-vhd                                      pass    
 test-armhf-armhf-xl-vhd                                      pass    
 test-amd64-i386-xl-vhd                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:15:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:15:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572960.897128 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoP-0003rN-T5; Mon, 31 Jul 2023 12:15:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572960.897128; Mon, 31 Jul 2023 12:15:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoP-0003rD-O0; Mon, 31 Jul 2023 12:15:45 +0000
Received: by outflank-mailman (input) for mailman id 572960;
 Mon, 31 Jul 2023 12:15:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VuP2=DR=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qQRoN-0003r0-NM
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:15:43 +0000
Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com
 [2a00:1450:4864:20::12f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f79b89dc-2f9b-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 14:15:41 +0200 (CEST)
Received: by mail-lf1-x12f.google.com with SMTP id
 2adb3069b0e04-4fe3b86cec1so795803e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 05:15:41 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac2430a000000b004fbb1bc1ae0sm2028077lfh.163.2023.07.31.05.15.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 05:15:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f79b89dc-2f9b-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690805741; x=1691410541;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=Sofim43fiClmTkvykAPI1lYXDzYxAeLBu1kfoTW77BQ=;
        b=XDK31rNov5YxdjA8GswOCWAHl90VZfrp/JsbiYxM75jAFIoL7AFlLoZev63lvlytbe
         3cgeTsyBQL6WMHtGk7d+cRE/hHg0V2zYhC7lHOyZPeOMdhQAS2XEKvhec77xMYhTHa/K
         UsgG9hZglwwURrCGVf6FpUVv0hZXk99AugKcY9joluPuF6jETpBEPYCf+DqA164x+ZUJ
         eRcVn0xvo2jrxenC5j541CcbZFqxKluZ/l0utvsEZEhIHb8mVxGnGwqHL3/9sljbQ4SK
         2RbNg3DxIh31BxMj8hSg0O2PeTDk3L/rAf63OmF9VISwI4uufDVB/lz2fAnrfJ3otdA2
         HPvQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690805741; x=1691410541;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=Sofim43fiClmTkvykAPI1lYXDzYxAeLBu1kfoTW77BQ=;
        b=ckaKeLaWHt/cjLw1ZnMfPPCONzRzgkuyz2DipOR8cccf+HeOGSOFY5QLN+B31U8Bob
         q7kg8Yhg3ZYeeXw3wcwv/lRAv65no/9k6/wzZuVS8Cnj9Hgzx2Wn/IxNnxwbNCWosccn
         T2QY3yItrfdHRq+hlfVCQI2Qiv4bEwvusaaTCEui3+mT9AkqoO96oyE22iPGqW+zGBTE
         5gcHXhYRzG4LElg+Lc3DBwF8unR9+3eSUxdSJ9P91Gw7sdWHuomG4dsJi2IdU3l3IpGC
         sVoVdDHJN4bOry556sEYKZrjHc/c7VESYyTK+r0LOPW3tuIsxfAJOXWfyC+mLuoRNzHK
         OejA==
X-Gm-Message-State: ABy/qLZ0Yf+afltXhim3wwmaQWOqXFL9fVZGZ7DVUYwS4U1a3/22UJ4h
	f4ZVk414dj6fJNfQmA9Hs7s8x5R2f3wKXf07RcA=
X-Google-Smtp-Source: APBJJlFWi/A7xf0+Dj+bIE4/NR6DUObaD+vi8h4iPq1FsPQ+yOKvISrFeJuvOZMg+5m5EARmYUdYaw==
X-Received: by 2002:ac2:4652:0:b0:4fd:d9dd:7a1a with SMTP id s18-20020ac24652000000b004fdd9dd7a1amr5493238lfo.31.1690805740547;
        Mon, 31 Jul 2023 05:15:40 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Bertrand.Marquis@arm.com,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Henry Wang <Henry.Wang@arm.com>,
	Community Manager <community.manager@xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [XEN PATCH v11 00/14] Xen FF-A mediator
Date: Mon, 31 Jul 2023 14:15:22 +0200
Message-Id: <20230731121536.934239-1-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Hi,

[Parts of the patchset has been merged already, see the changelog below
for details.]

This patch set adds an FF-A [1] mediator to the TEE mediator framework
already present in Xen. The FF-A mediator implements the subset of the
FF-A 1.1 specification needed to communicate with OP-TEE using FF-A as
transport mechanism instead of SMC/HVC as with the TEE mediator. It allows
a similar design in OP-TEE as with the TEE mediator where OP-TEE presents
one virtual partition of itself to each guest in Xen.

The FF-A mediator is generic in the sense it has nothing OP-TEE specific
except that only the subset needed for OP-TEE is implemented so far. The
hooks needed to inform OP-TEE that a guest is created or destroyed are part
of the FF-A specification.

It should be possible to extend the FF-A mediator to implement a larger
portion of the FF-A 1.1 specification without breaking with the way OP-TEE
is communicated with here. So it should be possible to support any TEE or
Secure Partition using FF-A as transport with this mediator.

The patches are also available at https://github.com/jenswi-linaro/xen
branch "xen_ffa_v11".

With help from Bertrand I've integrated this in a test setup with OP-TEE.
Please check prerequisites at
https://optee.readthedocs.io/en/latest/building/prerequisites.html

My setup is duplicated using:
repo init -u https://github.com/jenswi-linaro/manifest.git -m qemu_v8.xml \
        -b qemu_xen_ffa
repo sync -j8
cd build
make -j8 toolchains
make -j8 all
make run-only

Test in dom0 with for instance:
xtest 1004

at the prompt.

To start up a domu and connect to it do:
cd /mnt/host/build/qemu_v8/xen
xl create guest_ffa.cfg
xl console domu

Then test as usual with "xtest 1004".

The setup uses the branch "ffa" from https://github.com/jenswi-linaro/xen.
That's currently the same as the "xen_ffa_v11" branch, but the "ffa" branch
may change later as I update for a new version of the patch set.

[1] https://developer.arm.com/documentation/den0077/latest

Thanks,
Jens

v10->v11:
- Rebased on staging and dropping the following patches that already have
  been merged:
  - xen: Introduce arch_domain_teardown()
  - xen/arm: add TEE teardown to arch_domain_teardown()
  - xen/arm: smccc: add support for SMCCCv1.2 extended input/output registers
  - xen/arm: tee: add a primitive FF-A mediator
  - xen/arm: ffa: add remaining SMC function IDs
  - xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET
  - xen/arm: ffa: add defines for framework direct request/response messages
  - xen/arm: ffa: enforce dependency on 4k pages
  - xen/arm: ffa: add support for FFA_ID_GET
- Dropping "xen/arm: ffa: support sharing large memory ranges" since it's
  quite complicated and FF-A still works for OP-TEE
- Changelog in each of the patches

v9->v10:
Changelog in the the patches for two changed patches:
- "xen: Introduce arch_domain_teardown()"
- "xen/arm: add TEE teardown to arch_domain_teardown()"

v8->v9:
* Patch "xen/arm: ffa: add remaining SMC function IDs"
  - mention the documentation number used
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
* Patch "xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET"
  - Adding a reference to the documentation
  - Renaming FFA_PART_PROP_IS_MASK to FFA_PART_PROP_IS_TYPE_MASK
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
* Patch "xen/arm: ffa: add defines for framework direct request/response messages"
  - add a reference to the documentation
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
* Patch "docs: add Arm FF-A mediator"
  - Updating the wording as requested.
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
  - Fixing a few typos and adding a reference to the code for a list of
    limitations
* Patch "xen/arm: ffa: list current limitations"
  - Fixing a couple of typos
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
  - Removing an invalid limitation of FFA_RXTX_MAP_*
* Patch "xen/arm: ffa: add defines for sharing memory"
  - Fixing a few typos
  - Adding a reference to the documentation
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
  - Updating FFA_MAX_SHM_PAGE_COUNT to have a safe margin to
    TEEC_CONFIG_SHAREDMEM_MAX_SIZE
* Patch "xen/arm: ffa: add direct request support"
  - Fixing a coding style issue
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
  - Updating the TODO comment about features.
* Patch "xen/arm: ffa: send guest events to Secure Partitions"
  - Adding a TODO comment and a limit on the loop in ffa_direct_req_send_vm()
* Patch "xen/arm: ffa: support mapping guest RX/TX buffers"
  - Change FFA_MAX_RXTX_PAGE_COUNT to 1 with a TODO for a larger value
  - Replace !p2m_is_ram(t) test with t != p2m_ram_rw
  - Rename the introduced field tx_is_free to tx_is_free
* Patch "xen/arm: ffa: support sharing memory"
  - Fixing read_atomic() issue in get_shm_pages()
  - Fixing style issue in free_ffa_shm_mem()
  - Replace !p2m_is_ram(t) test with t != p2m_ram_rw in get_shm_pages()
* Patch "tools: add Arm FF-A mediator"
  - Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com>
  - Adding Acked-by: Anthony PERARD <anthony.perard@citrix.com>
  - Moving the patch to just before the docs patch.
* Adding Reviewed-by: Henry Wang <Henry.Wang@arm.com to:
  - "xen/arm: ffa: enforce dependency on 4k pages"
  - "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h"
  - "xen/arm: ffa: add ABI structs for sharing memory"
* Adding "xen: Introduce arch_domain_teardown()" by Andrew Cooper
* Adding "xen/arm: add TEE teardown to arch_domain_teardown()" 
  based on a patch from Andrew Cooper

v7->v8:
* Adding "xen/arm: ffa: list current limitations" as requested
* Adding tags to "xen/arm: smccc: add support for SMCCCv1.2 extended
  input/output registers"
* Patch "xen/arm: tee: add a primitive FF-A mediator":
  - Changing license for ffa.h and ffa.c to GPL-2.0-only
  - Avoiding IS_ENABLED() in the constant FFA_NR_FUNCS
  - Accepting version 1.1 SPMC only to keep things simple
  - Removes 32bit and only supports 64bit to keep things simple
* Patch "tools: add Arm FF-A mediator"
  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
  - Adding LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE_FFA for the "ffa" value 
    in arch_arm.tee
* Patch "docs: add Arm FF-A mediator"
  - Fixing a spell error
  - Moving the patch last in the series
* Patch "xen/arm: ffa: add remaining SMC function IDs"
  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
  - Renaming the define FFA_MSG_RUN to FFA_RUN to match the specification
* Patch "xen/arm: ffa: add flags for FFA_PARTITION_INFO_GET"
  - Updating the comment describing the flags for FFA_PARTITION_INFO_GET
* Patch "xen/arm: ffa: add defines for framework direct request/response
  messages"
  - Updating the comment describing the flags for MSG_SEND_DIRECT_REQ/RESP
* Patch "xen/arm: ffa: enforce dependency on 4k pages"
  - Updating title of patch
  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
* Patch "xen/arm: ffa: add support for FFA_ID_GET"
  - In ffa_domain_init(), check that domain_id isn't greater than
    UINT16_MAX to avoid a future potential integer overflow in get_vm_id()
* Patch "xen/arm: ffa: add direct request support"
  - Move preemption (interrupted) parts to a separate patch "xen/arm: ffa:
    support preemption of SP during direct request"
  - Remove loop in handle_msg_send_direct_req() to return eventual
    errors back to the VM instead of the SP.
* Patch "xen/arm: ffa: map SPMC rx/tx buffers"
  - Adding a FFA_RXTX_PAGE_COUNT define instead of using 1 directly
* New patch "xen/arm: ffa: support preemption of SP during direct request"
* Patch "xen/arm: ffa: send guest events to Secure Partitions"
  - Replacing unsigned int with uint16_t for subscr_vm_created_count and
    subscr_vm_destroyed_count plus the needed range check to see that
    they don't overflow.
* Patch "xen/arm: ffa: support mapping guest RX/TX buffers"
  - Limit the number of pages in VM RX/TX buffers to 32 using a new
    FFA_MAX_RXTX_PAGE_COUNT define.
* Patch "xen/arm: ffa: support guest FFA_PARTITION_INFO_GET"
  - Renaming tx_is_mine to rx_is_free as requested
  - Simplified the FFA_PARTITION_INFO_GET_COUNT_FLAG check in
    handle_partition_info_get()
  - Adding a comment on ownership of the RX buffer
  - Adding the patch "xen/arm: ffa: improve lock granularity" to address
    parts of the locking concerns.
* Patch "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h"
  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
* Patch "xen/arm: ffa: add defines for sharing memory"
  - Fixing reference for FFA_NORMAL_MEM_REG_ATTR and FFA_MEM_ACC_RW
  - Updating descirption for FFA_MAX_SHM_PAGE_COUNT
* Patch "xen/arm: ffa: add ABI structs for sharing memory"
  - Changing name of the "global_handle" memeber in struct
    ffa_mem_transaction_* to "handle".
* Patch "xen/arm: ffa: support sharing memory"
  - Use FFA_MEM_SHARE_64 only since we changed to only suporting ARM_64.
  - Rename struct ffa_mem_transaction_x to struct ffa_mem_transaction_int
    as requested.
  - Adding a check that shm->page_count isn't 0 before calling share_shm()
  - Masking return value from FFA_MEM_FRAG_RX to avoid an implic cast to
    the int32_t returned by ffa_mem_share().
* Patch "xen/arm: ffa: add support to reclaim shared memory"
  - Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
* Patch "xen/arm: ffa: support sharing large memory ranges"
  - Adding commetns for struct ffa_ctx
  - Cleaning up and removing the fragmentation state if handle_mem_frag_tx()
    detects an error.
* Adding "xen/arm: ffa: improve lock granularity" to address some of the
  locking concerns.

v6->v7:
* Split some of the larger patches into smaller patches for easier review.
  For instance, the v6 patch "xen/arm: add a primitive FF-A mediator" has
  been replaced with:
  - "xen/arm: add a primitive FF-A mediator"
  - "tools: add Arm FF-A mediator"
  - "docs: add Arm FF-A mediator"
  - "xen/arm: ffa: add remaining SMC function IDs"
* Some small fixes in the error path for handle_mem_share()
* Switched to SPDX for license in new files.
* Fixed comment style issues in
  "xen/arm: smccc: add support for SMCCCv1.2 extended input/output registers"
* Made FFA support UNSUPPORTED in "xen/arm: add a primitive FF-A mediator"
* Replaced ffa_get_call_count() with FFA_NR_FUNCS
* Update the FFA_MAX_SHM_PAGE_COUNT with a formula instead of a value.
* Replaced XEN_ARM_FLAGS_FFA with XEN_DOMCTL_CONFIG_TEE_FFA to minimize impact
  on struct xen_arch_domainconfig. This works because the FF-A mediator and
  the OP-TEE mediator will not be used at the same time in by a guest.
* Replaced "ffa" boolean in the guest config with a new "ffa" value to the
  enumeration "tee_type".
* Integrated the FF-A mediator in the TEE mediator framework instead of
  being its own.
* Rebased on staging as of 2023-02-16

v5->v6:
* Updated "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h"
  commit message and moved the patch right before the patch which needs it.
  Applied Michal Orzel's R-B tag.
* Renamed the guest configuration option "ffa_enabled" to "ffa" and
  updated the description.
* More tools update in "xen/arm: add a primitive FF-A mediator" with the "ffa"
  option, including golang and ocaml.
* Update ffa_domain_init() to return an error if communication with
  the SPMC can't be established.
* Factored out a ffa_domain_destroy() from ffa_relinquish_resources().
* Added ffa_get_call_count() to give an accurate number of FF-A function,
  updated in each patch as new FF-A functions are added.
* Added a flags field in struct xen_arch_domainconfig that replaces the
  ffa_enabled field.
* Made check_mandatory_feature() __init
* Replaced a few printk() calls with gprintk() where needed.
* Rebased on staging as of 2022-09-14

V4->v5:
* Added "xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h"
* Added documentation for the "ffa_enabled" guest config flag
* Changed to GPL license for xen/arch/arm/ffa.c
* Added __read_mostly and const where applicable
* Added more describing comments in the code
* Moved list of shared memory object ("ffa_mem_list") into the guest context
  as they are guest specific
* Simplified a few of the simple wrapper functions for SMC to SPMC
* Added a BUILD_BUG_ON(PAGE_SIZE != FFA_PAGE_SIZE) since the mediator
  currently depends on the page size to be same as FFA_PAGE_SIZE (4k).
* Added max number of shared memory object per guest and max number of
  size of each shared memory object
* Added helper macros to calculate offsets of different FF-A data structures
  in the communication buffer instead of relying on pointer arithmetic
* Addressed style issues and other comments
* Broke the commit "xen/arm: add FF-A mediator" into multiple parts, trying
  to add a few features at a time as requested
* Added a missing call to rxtx_unmap() in ffa_relinquish_resources()
* Assignment of "ffa_enabled" is kept as is until I have something definitive
  on the type etc.
* Tested with CONFIG_DEBUG=y

v3->v4:
* Missed v3 and sent a v4 instead by mistake.

v2->v3:
* Generates offsets into struct arm_smccc_1_2_regs with asm-offsets.c in
  order to avoid hard coded offsets in the assembly function
  arm_smccc_1_2_smc()
* Adds an entry in SUPPORT.md on the FF-A status
* Adds a configuration variable "ffa_enabled" to tell if FF-A should be
  enabled for a particular domu guest
* Moves the ffa_frag_list for fragmented memory share requests into
  struct ffa_ctx instead to keep it per guest in order to avoid mixups
  and simplify locking
* Adds a spinlock to struct ffa_ctx for per guest locking
* Addressing style issues and suggestions
* Uses FFA_FEATURES to check that all the needed features are available
  before initializing the mediator
* Rebased on staging as of 2022-06-20

v1->v2:
* Rebased on staging to resolve some merge conflicts as requested

Jens Wiklander (14):
  xen/arm: ffa: add direct request support
  xen/arm: ffa: map SPMC rx/tx buffers
  xen/arm: ffa: send guest events to Secure Partitions
  xen/arm: ffa: support mapping guest RX/TX buffers
  xen/arm: ffa: support guest FFA_PARTITION_INFO_GET
  xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h
  xen/arm: ffa: add defines for sharing memory
  xen/arm: ffa: add ABI structs for sharing memory
  xen/arm: ffa: support sharing memory
  xen/arm: ffa: add support to reclaim shared memory
  xen/arm: ffa: improve lock granularity
  xen/arm: ffa: list current limitations
  tools: add Arm FF-A mediator
  docs: add Arm FF-A mediator

 CHANGELOG.md                     |    3 +-
 SUPPORT.md                       |    9 +
 docs/man/xl.cfg.5.pod.in         |   15 +
 tools/include/libxl.h            |    5 +
 tools/libs/light/libxl_arm.c     |    3 +
 tools/libs/light/libxl_types.idl |    3 +-
 xen/arch/arm/include/asm/regs.h  |   12 +
 xen/arch/arm/tee/ffa.c           | 1411 ++++++++++++++++++++++++++++++
 xen/arch/arm/tee/optee.c         |   11 -
 9 files changed, 1459 insertions(+), 13 deletions(-)

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:15:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:15:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572962.897139 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoQ-00042t-GD; Mon, 31 Jul 2023 12:15:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572962.897139; Mon, 31 Jul 2023 12:15:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoQ-00041L-BS; Mon, 31 Jul 2023 12:15:46 +0000
Received: by outflank-mailman (input) for mailman id 572962;
 Mon, 31 Jul 2023 12:15:45 +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
 <SRS0=VuP2=DR=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qQRoP-0003r6-Mc
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:15:45 +0000
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com
 [2a00:1450:4864:20::134])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f90d4d6c-2f9b-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 14:15:44 +0200 (CEST)
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-4fe0eb0ca75so7035137e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 05:15:44 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac2430a000000b004fbb1bc1ae0sm2028077lfh.163.2023.07.31.05.15.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 05:15:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f90d4d6c-2f9b-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690805743; x=1691410543;
        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=IuPpDETKsd9EJlCiQj7fwJqFCPyxOJBlZOFnIaGXlq0=;
        b=iOTLKtvQETxTMalLcdecJT/sHdrrm5WB3/2sAZHm1rFIfG3n9EU4BTAhUbvsxZDs0t
         gPmZBjx/gwuRdAQIcIYmsgsgHt17Va1D2yzo2ILTG2UgC+iuyh/pvVkv6WJdDvYMyO8J
         P5FzTDyuSrRe5GLTEdfrwVcgdA1Y+mQV8bhRnuX/BWm5Z1F5xhxbQ3sngy6qx2/zZ5PM
         tCXbVOxC7N49qal9hJIXT4I1UoietrdrU6AzGjw0WbRJbMFQ09ZVM++yFiYWtxizQxMQ
         /cwIjb6CEY+87tKasTbAvDrsz4JO/TesBEIHUXppSepUxW5PZrg2dCyK4LRFMGujQdxl
         7FYw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690805743; x=1691410543;
        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=IuPpDETKsd9EJlCiQj7fwJqFCPyxOJBlZOFnIaGXlq0=;
        b=Eluw1HOH88/eHc+/L93iR3NCQpMfTsCkyGVKtEJEYcHEU/9psUxG+o3z/Gd1d3hGyV
         PHlJh08uTyAazOHwOq41Z57NEUIK5W5KhMkjJ53xknDBiPF1JVN3NERyX/TMDK8exXmI
         6fCDB8QSx8tmcl2D+BywgmzAGTxm/Dv1iJx5y/NOwZFPkiTK135vBbnwNFXinsaUmuRH
         1BepTKgM5WsFYj6kBRpwFXBC5Y8YDjCvUK/PGLft+M9IhmM0LuFABJoDU+DoXrvryrP9
         CpnLtJGU8NkIon/6YzZUf3YKNGIR8r/8Q4bkIgajatup8QZIE0tGm2Qmuu9FjnEmtx88
         0Mqw==
X-Gm-Message-State: ABy/qLayML9A2IhnkveqcYxR+wmxZfwCcJZC6VDapf6LKMRFT0yPBf7b
	2vurS/FwFa8fKi/eWfEz6Ev7fJQCgN9SyBYKzu8=
X-Google-Smtp-Source: APBJJlFGXJpsvWNFf2xF1DleAbjD+fJafx2vX2SmChqHWEBQGXJ9Ducp6skAwEtEmdTsL2U78f490Q==
X-Received: by 2002:a19:ca44:0:b0:4fe:193c:de74 with SMTP id h4-20020a19ca44000000b004fe193cde74mr4900973lfj.18.1690805743019;
        Mon, 31 Jul 2023 05:15:43 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Bertrand.Marquis@arm.com,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v11 02/14] xen/arm: ffa: map SPMC rx/tx buffers
Date: Mon, 31 Jul 2023 14:15:24 +0200
Message-Id: <20230731121536.934239-3-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731121536.934239-1-jens.wiklander@linaro.org>
References: <20230731121536.934239-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

When initializing the FF-A mediator map the RX and TX buffers shared with
the SPMC.

These buffer are later used to to transmit data that cannot be passed in
registers only.

Adds a check that the SP supports the needed FF-A features
FFA_RXTX_MAP_64 and FFA_RXTX_UNMAP.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
v10->v11
- Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/tee/ffa.c | 50 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 49 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 961a8c052f59..072198a1326d 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -12,6 +12,7 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
+#include <xen/mm.h>
 #include <xen/sched.h>
 #include <xen/sizes.h>
 #include <xen/types.h>
@@ -67,6 +68,12 @@
  */
 #define FFA_PAGE_SIZE                   SZ_4K
 
+/*
+ * The number of pages used for each of the RX and TX buffers shared with
+ * the SPMC.
+ */
+#define FFA_RXTX_PAGE_COUNT             1
+
 /*
  * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
  * BIT(31): Framework or partition message
@@ -161,6 +168,13 @@ struct ffa_ctx {
 /* Negotiated FF-A version to use with the SPMC */
 static uint32_t __ro_after_init ffa_version;
 
+/*
+ * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
+ * number of pages used in each of these buffers.
+ */
+static void *ffa_rx __read_mostly;
+static void *ffa_tx __read_mostly;
+
 static bool ffa_get_version(uint32_t *vers)
 {
     const struct arm_smccc_1_2_regs arg = {
@@ -231,6 +245,12 @@ static bool check_mandatory_feature(uint32_t id)
     return !ret;
 }
 
+static int32_t ffa_rxtx_map(paddr_t tx_addr, paddr_t rx_addr,
+                            uint32_t page_count)
+{
+    return ffa_simple_call(FFA_RXTX_MAP_64, tx_addr, rx_addr, page_count, 0);
+}
+
 static uint16_t get_vm_id(const struct domain *d)
 {
     /* +1 since 0 is reserved for the hypervisor in FF-A */
@@ -394,6 +414,7 @@ static int ffa_relinquish_resources(struct domain *d)
 static bool ffa_probe(void)
 {
     uint32_t vers;
+    int e;
     unsigned int major_vers;
     unsigned int minor_vers;
 
@@ -441,12 +462,39 @@ static bool ffa_probe(void)
      * TODO: Rework the code to allow domain to use a subset of the
      * features supported.
      */
-    if ( !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
+    if (
+         !check_mandatory_feature(FFA_RXTX_MAP_64) ||
+         !check_mandatory_feature(FFA_RXTX_UNMAP) ||
+         !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
+        return false;
+
+    ffa_rx = alloc_xenheap_pages(get_order_from_pages(FFA_RXTX_PAGE_COUNT), 0);
+    if ( !ffa_rx )
         return false;
 
+    ffa_tx = alloc_xenheap_pages(get_order_from_pages(FFA_RXTX_PAGE_COUNT), 0);
+    if ( !ffa_tx )
+        goto err_free_ffa_rx;
+
+    e = ffa_rxtx_map(__pa(ffa_tx), __pa(ffa_rx), FFA_RXTX_PAGE_COUNT);
+    if ( e )
+    {
+        printk(XENLOG_ERR "ffa: Failed to map rxtx: error %d\n", e);
+        goto err_free_ffa_tx;
+    }
     ffa_version = vers;
 
     return true;
+
+err_free_ffa_tx:
+    free_xenheap_pages(ffa_tx, 0);
+    ffa_tx = NULL;
+err_free_ffa_rx:
+    free_xenheap_pages(ffa_rx, 0);
+    ffa_rx = NULL;
+    ffa_version = 0;
+
+    return false;
 }
 
 static const struct tee_mediator_ops ffa_ops =
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:15:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:15:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572961.897133 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoQ-0003tZ-37; Mon, 31 Jul 2023 12:15:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572961.897133; Mon, 31 Jul 2023 12:15:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoP-0003sx-VL; Mon, 31 Jul 2023 12:15:45 +0000
Received: by outflank-mailman (input) for mailman id 572961;
 Mon, 31 Jul 2023 12:15:44 +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
 <SRS0=VuP2=DR=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qQRoO-0003r6-J2
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:15:44 +0000
Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com
 [2a00:1450:4864:20::131])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f839bb05-2f9b-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 14:15:42 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-4fe28e4671dso2692760e87.0
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 05:15:42 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac2430a000000b004fbb1bc1ae0sm2028077lfh.163.2023.07.31.05.15.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 05:15:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f839bb05-2f9b-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690805742; x=1691410542;
        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=pJQzvJ0OqzEXs06pXN7HU741HPJ2/SrxAbSMgLekP8w=;
        b=GCHLTJtQ8oGnt0c+OFuGjHgpp6yn/bwRxTpv540FME/hbSXJx+s/z4UA1mqWSEBgHK
         YYXvaMM4ZjePOwnC1AwJkj8uHX2HoM9oAob3YNmwBgTr7ZdYOJ/F8rUYwC6WMAF1TRRe
         vhO3P9UC9eua38l6BciYJ8fP1dCVhrRsm+39868+quIWG6AByGt+kd2RnXlNOkWTnlE+
         rdzm6VR9t54RoC2plCAhkjJO6uO372Zmp5louEoZ5p7YoZqCelYpQQ1iPTdOCDz29vB6
         eBXgUEMDgbZI1uHVUaR2JWKzzWZIOjBhnQUDEJx+zghTsCSnuJvfvnbdb5plR1quoge7
         yTig==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690805742; x=1691410542;
        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=pJQzvJ0OqzEXs06pXN7HU741HPJ2/SrxAbSMgLekP8w=;
        b=Rc5yLAdY2zqHtj26ubo0ws6MXaBArqnZL1roUX+zdfKd91NDcg3fd/ZN21Rz9zastx
         FjYRQnxbVThYJgMIr0IvKFAGIlT44Nz0lh6ciYIqlSqcFGhYbYQXCLjo6zagld6G0u0p
         CWfEkzG0nFdo8L3BrAZm3+7a+VaMt/bo4VoV7nvMzXU4w39sDk3OHw8HtceFAOGlHkI/
         wrvxRgVZPzCBQWZShJtWLn1UE11hjOmzkMqgdY/21z7mIfIKQTcnBeUtObVNDSpRliDV
         CbikFh8QF/TFD23VStfQAmWmNofos8TAdki1UmVqYtEvb3+tSPHfNudkq5UvfZ+3b6js
         NbFA==
X-Gm-Message-State: ABy/qLaOmbGnGmdQcynWJppSqWfY2XkA7uSPafhYfu358HA3rUH0nppr
	WRj1daH92IHZuXw0nbRqQEM+Aj9HQKq/toc26aM=
X-Google-Smtp-Source: APBJJlFSC/mFSDFmW8bgNee1xzB0UFNA1ks6ln4nHrhOatVk1GOT3ytH+NRVitDpX7lMJcd0nQCnyQ==
X-Received: by 2002:a05:6512:1591:b0:4fb:97e8:bc1c with SMTP id bp17-20020a056512159100b004fb97e8bc1cmr7158804lfb.54.1690805741921;
        Mon, 31 Jul 2023 05:15:41 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Bertrand.Marquis@arm.com,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v11 01/14] xen/arm: ffa: add direct request support
Date: Mon, 31 Jul 2023 14:15:23 +0200
Message-Id: <20230731121536.934239-2-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731121536.934239-1-jens.wiklander@linaro.org>
References: <20230731121536.934239-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support for sending a FF-A direct request. Checks that the SP also
supports handling a 32-bit direct request. 64-bit direct requests are
not used by the mediator itself so there is not need to check for that.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
v10->v11
- In handle_msg_send_direct_req(), replaced the "arg" with "resp" at the
  default: label in the switch statement.
---
 xen/arch/arm/tee/ffa.c | 113 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 113 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index e157ed20ad8b..961a8c052f59 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -181,6 +181,56 @@ static bool ffa_get_version(uint32_t *vers)
     return true;
 }
 
+static int32_t get_ffa_ret_code(const struct arm_smccc_1_2_regs *resp)
+{
+    switch ( resp->a0 )
+    {
+    case FFA_ERROR:
+        if ( resp->a2 )
+            return resp->a2;
+        else
+            return FFA_RET_NOT_SUPPORTED;
+    case FFA_SUCCESS_32:
+    case FFA_SUCCESS_64:
+        return FFA_RET_OK;
+    default:
+        return FFA_RET_NOT_SUPPORTED;
+    }
+}
+
+static int32_t ffa_simple_call(uint32_t fid, register_t a1, register_t a2,
+                               register_t a3, register_t a4)
+{
+    const struct arm_smccc_1_2_regs arg = {
+        .a0 = fid,
+        .a1 = a1,
+        .a2 = a2,
+        .a3 = a3,
+        .a4 = a4,
+    };
+    struct arm_smccc_1_2_regs resp;
+
+    arm_smccc_1_2_smc(&arg, &resp);
+
+    return get_ffa_ret_code(&resp);
+}
+
+static int32_t ffa_features(uint32_t id)
+{
+    return ffa_simple_call(FFA_FEATURES, id, 0, 0, 0);
+}
+
+static bool check_mandatory_feature(uint32_t id)
+{
+    int32_t ret = ffa_features(id);
+
+    if ( ret )
+        printk(XENLOG_ERR "ffa: mandatory feature id %#x missing: error %d\n",
+               id, ret);
+
+    return !ret;
+}
+
 static uint16_t get_vm_id(const struct domain *d)
 {
     /* +1 since 0 is reserved for the hypervisor in FF-A */
@@ -222,6 +272,57 @@ static void handle_version(struct cpu_user_regs *regs)
     set_regs(regs, vers, 0, 0, 0, 0, 0, 0, 0);
 }
 
+static void handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
+{
+    struct arm_smccc_1_2_regs arg = { .a0 = fid, };
+    struct arm_smccc_1_2_regs resp = { };
+    struct domain *d = current->domain;
+    uint32_t src_dst;
+    uint64_t mask;
+
+    if ( smccc_is_conv_64(fid) )
+        mask = GENMASK_ULL(63, 0);
+    else
+        mask = GENMASK_ULL(31, 0);
+
+    src_dst = get_user_reg(regs, 1);
+    if ( (src_dst >> 16) != get_vm_id(d) )
+    {
+        resp.a0 = FFA_ERROR;
+        resp.a2 = FFA_RET_INVALID_PARAMETERS;
+        goto out;
+    }
+
+    arg.a1 = src_dst;
+    arg.a2 = get_user_reg(regs, 2) & mask;
+    arg.a3 = get_user_reg(regs, 3) & mask;
+    arg.a4 = get_user_reg(regs, 4) & mask;
+    arg.a5 = get_user_reg(regs, 5) & mask;
+    arg.a6 = get_user_reg(regs, 6) & mask;
+    arg.a7 = get_user_reg(regs, 7) & mask;
+
+    arm_smccc_1_2_smc(&arg, &resp);
+    switch ( resp.a0 )
+    {
+    case FFA_ERROR:
+    case FFA_SUCCESS_32:
+    case FFA_SUCCESS_64:
+    case FFA_MSG_SEND_DIRECT_RESP_32:
+    case FFA_MSG_SEND_DIRECT_RESP_64:
+        break;
+    default:
+        /* Bad fid, report back to the caller. */
+        memset(&resp, 0, sizeof(resp));
+        resp.a0 = FFA_ERROR;
+        resp.a1 = src_dst;
+        resp.a2 = FFA_RET_ABORTED;
+    }
+
+out:
+    set_regs(regs, resp.a0, resp.a1 & mask, resp.a2 & mask, resp.a3 & mask,
+             resp.a4 & mask, resp.a5 & mask, resp.a6 & mask, resp.a7 & mask);
+}
+
 static bool ffa_handle_call(struct cpu_user_regs *regs)
 {
     uint32_t fid = get_user_reg(regs, 0);
@@ -239,6 +340,10 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     case FFA_ID_GET:
         set_regs_success(regs, get_vm_id(d), 0);
         return true;
+    case FFA_MSG_SEND_DIRECT_REQ_32:
+    case FFA_MSG_SEND_DIRECT_REQ_64:
+        handle_msg_send_direct_req(regs, fid);
+        return true;
 
     default:
         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
@@ -331,6 +436,14 @@ static bool ffa_probe(void)
     printk(XENLOG_INFO "ARM FF-A Firmware version %u.%u\n",
            major_vers, minor_vers);
 
+    /*
+     * At the moment domains must support the same features used by Xen.
+     * TODO: Rework the code to allow domain to use a subset of the
+     * features supported.
+     */
+    if ( !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
+        return false;
+
     ffa_version = vers;
 
     return true;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:15:47 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:15:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572963.897158 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoR-0004aN-OU; Mon, 31 Jul 2023 12:15:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572963.897158; Mon, 31 Jul 2023 12:15:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoR-0004Zo-LK; Mon, 31 Jul 2023 12:15:47 +0000
Received: by outflank-mailman (input) for mailman id 572963;
 Mon, 31 Jul 2023 12:15:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VuP2=DR=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qQRoQ-0003r0-3A
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:15:46 +0000
Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com
 [2a00:1450:4864:20::133])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f9d27e97-2f9b-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 14:15:45 +0200 (CEST)
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-4fe3c7f16bbso618996e87.0
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 05:15:45 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac2430a000000b004fbb1bc1ae0sm2028077lfh.163.2023.07.31.05.15.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 05:15:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f9d27e97-2f9b-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690805744; x=1691410544;
        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=rFiw8jg7BUWz3gVWuBmPXLW/ZlH0wqkGB//S/ukxL+E=;
        b=Qmwm9M97izBmwm1GD6NJ6Bhvhd+288hCfhcwIHcm55wS3ig67kJAaYkRGeB7KYqGIF
         pvlN9gR1TpKDjSpNwApHqe6KaNTRVI0UVb/UigDUqVs9zvYECJxtQRxEax9Bm6RHqkTE
         oTfuY28Fjm8w4NcVNyxrurfa5493FahG+kGJEUeoPlmrmlv1El4LPD2+80zHxvKMpJJu
         OgojCGL6dsIqAG+Oh1cNqaTSAWChsOesplW5X4cQmZKe4qqnc5ZhJQGC3NlsbouX1zbc
         FTBe5XrhQytGeT43SNt2F5zn/P0z2t9nOda0IqRBmXPSfaazINWLs5BWTFbj/HvFOQFM
         Uq1g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690805744; x=1691410544;
        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=rFiw8jg7BUWz3gVWuBmPXLW/ZlH0wqkGB//S/ukxL+E=;
        b=b90xTgULTXE7pHqXHbYnwvyEFr6xGvI3mVEgh1y0CP3XEzcJPH/X8Olckp19xpooWk
         HjRTA6C1rqfuSBgSNYhFGmFJ+ySF8om0qdee7hOY1EpS0UH2F84c3WHGSbN99cT4tpt0
         wLpeaz0kaTY9zWzhfGM2ddHHViF2l4EA0psgf46QLNL/TZwaYqcfGupjX1a6D2VpNPRx
         sPkVYmJtdQDDdk6frZpYuv/03nMCSgkL19UN/ZNw1iMgC97PkBL7nAK1+EvAAUr/ZGLz
         vbCDdm+OFRfYTZk2ktB3lkRUZL1Dmux0lOdFwEmwLlQ2pYKPgoTHTlzwrIpi1kJxTAKJ
         jd5A==
X-Gm-Message-State: ABy/qLbMFfYyBg9q6l4eZzYq5yOKMyCfiVD2hUOaBCn7xMuHTw25dSPe
	uWLed3DTK82feIqaE8xDxNxrTUfaNymF2QRXJnk=
X-Google-Smtp-Source: APBJJlEzvi+DSzU4DDcyxiL5ilCoLcuqx0IiNp6RDvbEy4U+ssR82e1McUCSHJzxgnYrqgDPH6Pp+Q==
X-Received: by 2002:a05:6512:39c5:b0:4fb:89f2:278e with SMTP id k5-20020a05651239c500b004fb89f2278emr6049815lfu.68.1690805744438;
        Mon, 31 Jul 2023 05:15:44 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Bertrand.Marquis@arm.com,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v11 03/14] xen/arm: ffa: send guest events to Secure Partitions
Date: Mon, 31 Jul 2023 14:15:25 +0200
Message-Id: <20230731121536.934239-4-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731121536.934239-1-jens.wiklander@linaro.org>
References: <20230731121536.934239-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The FF-A specification defines framework messages sent as direct
requests when certain events occurs. For instance when a VM (guest) is
created or destroyed. Only SPs which have subscribed to these events
will receive them. An SP can subscribe to these messages in its
partition properties.

Adds a check that the SP supports the needed FF-A features
FFA_PARTITION_INFO_GET and FFA_RX_RELEASE.

The partition properties of each SP is retrieved with
FFA_PARTITION_INFO_GET which returns the information in our RX buffer.
Using FFA_PARTITION_INFO_GET changes the owner of the RX buffer to the
caller (us), so once we're done with the buffer it must be released
using FFA_RX_RELEASE before another call can be made.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
v10->v11:
- Addressing comments and fixing a few style issues
- Fixing how is_in_subscr_list() is used, it's supposed to take an
  sp_id, not a vm_id.
---
 xen/arch/arm/tee/ffa.c | 234 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 233 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 072198a1326d..5af3e5eedc88 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -160,14 +160,33 @@
 #define FFA_MSG_SEND                    0x8400006EU
 #define FFA_MSG_POLL                    0x8400006AU
 
+/* Partition information descriptor */
+struct ffa_partition_info_1_1 {
+    uint16_t id;
+    uint16_t execution_context;
+    uint32_t partition_properties;
+    uint8_t uuid[16];
+};
+
 struct ffa_ctx {
     /* FF-A version used by the guest */
     uint32_t guest_vers;
+    /*
+     * Number of SPs that we have sent a VM created signal to, used in
+     * ffa_domain_teardown() to know which SPs need to be signalled.
+     */
+    uint16_t create_signal_count;
 };
 
 /* Negotiated FF-A version to use with the SPMC */
 static uint32_t __ro_after_init ffa_version;
 
+/* SPs subscribing to VM_CREATE and VM_DESTROYED events */
+static uint16_t *subscr_vm_created __read_mostly;
+static uint16_t subscr_vm_created_count __read_mostly;
+static uint16_t *subscr_vm_destroyed __read_mostly;
+static uint16_t subscr_vm_destroyed_count __read_mostly;
+
 /*
  * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
  * number of pages used in each of these buffers.
@@ -251,6 +270,87 @@ static int32_t ffa_rxtx_map(paddr_t tx_addr, paddr_t rx_addr,
     return ffa_simple_call(FFA_RXTX_MAP_64, tx_addr, rx_addr, page_count, 0);
 }
 
+static int32_t ffa_partition_info_get(uint32_t w1, uint32_t w2, uint32_t w3,
+                                      uint32_t w4, uint32_t w5,
+                                      uint32_t *count)
+{
+    const struct arm_smccc_1_2_regs arg = {
+        .a0 = FFA_PARTITION_INFO_GET,
+        .a1 = w1,
+        .a2 = w2,
+        .a3 = w3,
+        .a4 = w4,
+        .a5 = w5,
+    };
+    struct arm_smccc_1_2_regs resp;
+    uint32_t ret;
+
+    arm_smccc_1_2_smc(&arg, &resp);
+
+    ret = get_ffa_ret_code(&resp);
+    if ( !ret )
+        *count = resp.a2;
+
+    return ret;
+}
+
+static int32_t ffa_rx_release(void)
+{
+    return ffa_simple_call(FFA_RX_RELEASE, 0, 0, 0, 0);
+}
+
+static int32_t ffa_direct_req_send_vm(uint16_t sp_id, uint16_t vm_id,
+                                      uint8_t msg)
+{
+    uint32_t exp_resp = FFA_MSG_FLAG_FRAMEWORK;
+    unsigned int retry_count = 0;
+    int32_t res;
+
+    if ( msg == FFA_MSG_SEND_VM_CREATED )
+        exp_resp |= FFA_MSG_RESP_VM_CREATED;
+    else if ( msg == FFA_MSG_SEND_VM_DESTROYED )
+        exp_resp |= FFA_MSG_RESP_VM_DESTROYED;
+    else
+        return FFA_RET_INVALID_PARAMETERS;
+
+    do {
+        const struct arm_smccc_1_2_regs arg = {
+            .a0 = FFA_MSG_SEND_DIRECT_REQ_32,
+            .a1 = sp_id,
+            .a2 = FFA_MSG_FLAG_FRAMEWORK | msg,
+            .a5 = vm_id,
+        };
+        struct arm_smccc_1_2_regs resp;
+
+        arm_smccc_1_2_smc(&arg, &resp);
+        if ( resp.a0 != FFA_MSG_SEND_DIRECT_RESP_32 || resp.a2 != exp_resp )
+        {
+            /*
+             * This is an invalid response, likely due to some error in the
+             * implementation of the ABI.
+             */
+            return FFA_RET_INVALID_PARAMETERS;
+        }
+        res = resp.a3;
+        if ( ++retry_count > 10 )
+        {
+            /*
+             * TODO
+             * FFA_RET_INTERRUPTED means that the SPMC has a pending
+             * non-secure interrupt, we need a way of delivering that
+             * non-secure interrupt.
+             * FFA_RET_RETRY is the SP telling us that it's temporarily
+             * blocked from handling the direct request, we need a generic
+             * way to deal with this.
+             * For now in both cases, give up after a few retries.
+             */
+            return res;
+        }
+    } while ( res == FFA_RET_INTERRUPTED || res == FFA_RET_RETRY );
+
+    return res;
+}
+
 static uint16_t get_vm_id(const struct domain *d)
 {
     /* +1 since 0 is reserved for the hypervisor in FF-A */
@@ -374,6 +474,8 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
 static int ffa_domain_init(struct domain *d)
 {
     struct ffa_ctx *ctx;
+    unsigned int n;
+    int32_t res;
 
     if ( !ffa_version )
         return -ENODEV;
@@ -390,17 +492,68 @@ static int ffa_domain_init(struct domain *d)
 
     d->arch.tee = ctx;
 
+    for ( n = 0; n < subscr_vm_created_count; n++ )
+    {
+        res = ffa_direct_req_send_vm(subscr_vm_created[n], get_vm_id(d),
+                                     FFA_MSG_SEND_VM_CREATED);
+        if ( res )
+        {
+            printk(XENLOG_ERR "ffa: Failed to report creation of vm_id %u to  %u: res %d\n",
+                   get_vm_id(d), subscr_vm_created[n], res);
+            ctx->create_signal_count = n;
+            return -EIO;
+        }
+    }
+    ctx->create_signal_count = subscr_vm_created_count;
+
     return 0;
 }
 
+static bool is_in_subscr_list(const uint16_t *subscr, uint16_t start,
+                              uint16_t end, uint16_t sp_id)
+{
+    unsigned int n;
+
+    for ( n = start; n < end; n++ )
+    {
+        if ( subscr[n] == sp_id )
+            return true;
+    }
+
+    return false;
+}
+
 /* This function is supposed to undo what ffa_domain_init() has done */
 static int ffa_domain_teardown(struct domain *d)
 {
     struct ffa_ctx *ctx = d->arch.tee;
+    unsigned int n;
+    int32_t res;
 
     if ( !ctx )
         return 0;
 
+
+    for ( n = 0; n < subscr_vm_destroyed_count; n++ )
+    {
+        /*
+         * Skip SPs subscribed to the VM created event that never was
+         * notified of the VM creation due to an error during
+         * ffa_domain_init().
+         */
+        if ( is_in_subscr_list(subscr_vm_created, ctx->create_signal_count,
+                               subscr_vm_created_count,
+                               subscr_vm_destroyed[n]) )
+            continue;
+
+        res = ffa_direct_req_send_vm(subscr_vm_destroyed[n], get_vm_id(d),
+                                     FFA_MSG_SEND_VM_DESTROYED);
+
+        if ( res )
+            printk(XENLOG_ERR "ffa: Failed to report destruction of vm_id %u to  %u: res %d\n",
+                   get_vm_id(d), subscr_vm_destroyed[n], res);
+    }
+
     XFREE(d->arch.tee);
 
     return 0;
@@ -411,6 +564,81 @@ static int ffa_relinquish_resources(struct domain *d)
     return 0;
 }
 
+static void uninit_subscribers(void)
+{
+        subscr_vm_created_count = 0;
+        subscr_vm_destroyed_count = 0;
+        XFREE(subscr_vm_created);
+        XFREE(subscr_vm_destroyed);
+}
+
+static bool init_subscribers(struct ffa_partition_info_1_1 *fpi, uint16_t count)
+{
+    uint16_t n;
+    uint16_t c_pos;
+    uint16_t d_pos;
+
+    subscr_vm_created_count = 0;
+    subscr_vm_destroyed_count = 0;
+    for ( n = 0; n < count; n++ )
+    {
+        if ( fpi[n].partition_properties & FFA_PART_PROP_NOTIF_CREATED )
+            subscr_vm_created_count++;
+        if ( fpi[n].partition_properties & FFA_PART_PROP_NOTIF_DESTROYED )
+            subscr_vm_destroyed_count++;
+    }
+
+    if ( subscr_vm_created_count )
+        subscr_vm_created = xzalloc_array(uint16_t, subscr_vm_created_count);
+    if ( subscr_vm_destroyed_count )
+        subscr_vm_destroyed = xzalloc_array(uint16_t,
+                                            subscr_vm_destroyed_count);
+    if ( (subscr_vm_created_count && !subscr_vm_created) ||
+         (subscr_vm_destroyed_count && !subscr_vm_destroyed) )
+    {
+        printk(XENLOG_ERR "ffa: Failed to allocate subscription lists\n");
+        uninit_subscribers();
+        return false;
+    }
+
+    for ( c_pos = 0, d_pos = 0, n = 0; n < count; n++ )
+    {
+        if ( fpi[n].partition_properties & FFA_PART_PROP_NOTIF_CREATED )
+            subscr_vm_created[c_pos++] = fpi[n].id;
+        if ( fpi[n].partition_properties & FFA_PART_PROP_NOTIF_DESTROYED )
+            subscr_vm_destroyed[d_pos++] = fpi[n].id;
+    }
+
+    return true;
+}
+
+static bool init_sps(void)
+{
+    bool ret = false;
+    uint32_t count;
+    int e;
+
+    e = ffa_partition_info_get(0, 0, 0, 0, 0, &count);
+    if ( e )
+    {
+        printk(XENLOG_ERR "ffa: Failed to get list of SPs: %d\n", e);
+        goto out;
+    }
+
+    if ( count >= UINT16_MAX )
+    {
+        printk(XENLOG_ERR "ffa: Impossible number of SPs: %u\n", count);
+        goto out;
+    }
+
+    ret = init_subscribers(ffa_rx, count);
+
+out:
+    ffa_rx_release();
+
+    return ret;
+}
+
 static bool ffa_probe(void)
 {
     uint32_t vers;
@@ -462,7 +690,8 @@ static bool ffa_probe(void)
      * TODO: Rework the code to allow domain to use a subset of the
      * features supported.
      */
-    if (
+    if ( !check_mandatory_feature(FFA_PARTITION_INFO_GET) ||
+         !check_mandatory_feature(FFA_RX_RELEASE) ||
          !check_mandatory_feature(FFA_RXTX_MAP_64) ||
          !check_mandatory_feature(FFA_RXTX_UNMAP) ||
          !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
@@ -484,6 +713,9 @@ static bool ffa_probe(void)
     }
     ffa_version = vers;
 
+    if ( !init_sps() )
+        goto err_free_ffa_tx;
+
     return true;
 
 err_free_ffa_tx:
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:15:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:15:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572964.897165 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoS-0004lZ-EG; Mon, 31 Jul 2023 12:15:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572964.897165; Mon, 31 Jul 2023 12:15:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoS-0004kt-9S; Mon, 31 Jul 2023 12:15:48 +0000
Received: by outflank-mailman (input) for mailman id 572964;
 Mon, 31 Jul 2023 12:15:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VuP2=DR=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qQRoR-0003r0-Jb
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:15:47 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fac2235b-2f9b-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 14:15:46 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-4f4b2bc1565so6929750e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 05:15:46 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac2430a000000b004fbb1bc1ae0sm2028077lfh.163.2023.07.31.05.15.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 05:15:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fac2235b-2f9b-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690805746; x=1691410546;
        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=wLAbTbD8REc4gEPXiOhZft6RS/Ams+Y0BUWbmBkKJ7M=;
        b=fnS8900MhsUzDHFIdPTo0VDqH6gyfxILEzrnfE7raqj0J8sxPLOgnXdm9Ly4f5oJG6
         kRbVDiJmxnETDJEWVdZCzy6Qrp3NpW4fw5hb76V75gpnityqLfWvf+K0+W5YU9qPg5eo
         7cI9r2WnWMsFsIH5ZMS9m5ddwMpNKIR7S/ksdkhKBWmsB9FiRxMZH0oj0o+SlaGUKLv3
         oNlyvaxCnvqZ4kztqaYpCX3T5NzjXjWGBlYBGD4HWjiYMvDzOG/fsMLF4ZH3HlkRzNe+
         XddORfZrJeHBGl1KhYH5kYImRWMWW6ElH7FoMzyA7FvgKtjekU3DU3e2B+QuHkrAJN3P
         CB7g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690805746; x=1691410546;
        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=wLAbTbD8REc4gEPXiOhZft6RS/Ams+Y0BUWbmBkKJ7M=;
        b=aiDZUDE5BVNh+DRXfIGuJ2Kuo6MZ9Q64gkAfjDg58+YaVzs4773XPxd+wXVlikiaOZ
         UY261cnMphEyLsunIY6MmHm2JdSCpfy9ZLKiHRO14eMhu4HzCRohqL9X6dqu4C89ehty
         zzHB5RUkrxnNxfYxG6ltqJNmba2FxB0kYoys4wcRgNJbyKVUyxnLFgF3lPuAapV3lPzO
         FMkm7VVzVw/9kWla87/Q57HHYHewbNGLjJuHbe2hDNalT3/3zPU6E4PfVvPF2wQhtnS0
         WzDr5YAAsnwFEiVn0bYvA7pdApD3mFI6PVbKkMp6dzxDBt9tJ7PjxbKvEyK4V+sQ9ypV
         EnZA==
X-Gm-Message-State: ABy/qLZGuXcENqFketbT5sfOjWmerIvN9kzvdnd9Y3rhJhs+ZxHZy1Wf
	JnOSdLzZP9f4w6CQdlema4dXNEgV6hiXG6CDDzk=
X-Google-Smtp-Source: APBJJlGsytHD8uI0JreHbyjyk9r34ALyu+st1rnZRjElyXSmYAMHntSDhxHYpVPlROJC/u4uvNkmpw==
X-Received: by 2002:a05:6512:1c3:b0:4f4:d071:be48 with SMTP id f3-20020a05651201c300b004f4d071be48mr5424879lfp.14.1690805745979;
        Mon, 31 Jul 2023 05:15:45 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Bertrand.Marquis@arm.com,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v11 04/14] xen/arm: ffa: support mapping guest RX/TX buffers
Date: Mon, 31 Jul 2023 14:15:26 +0200
Message-Id: <20230731121536.934239-5-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731121536.934239-1-jens.wiklander@linaro.org>
References: <20230731121536.934239-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support in the mediator to map and unmap the RX and TX buffers
provided by the guest using the two FF-A functions FFA_RXTX_MAP and
FFA_RXTX_UNMAP.

These buffer are later used to transmit data that cannot be passed in
registers only.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
v10->v11
- Fixing a typo in a comment and adding a couple of newlines as requested
---
 xen/arch/arm/tee/ffa.c | 140 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 140 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 5af3e5eedc88..6c76c9885774 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -74,6 +74,12 @@
  */
 #define FFA_RXTX_PAGE_COUNT             1
 
+/*
+ * Limit the number of pages RX/TX buffers guests can map.
+ * TODO support a larger number.
+ */
+#define FFA_MAX_RXTX_PAGE_COUNT         1
+
 /*
  * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
  * BIT(31): Framework or partition message
@@ -169,6 +175,12 @@ struct ffa_partition_info_1_1 {
 };
 
 struct ffa_ctx {
+    void *rx;
+    const void *tx;
+    struct page_info *rx_pg;
+    struct page_info *tx_pg;
+    /* Number of 4kB pages in each of rx/rx_pg and tx/tx_pg */
+    unsigned int page_count;
     /* FF-A version used by the guest */
     uint32_t guest_vers;
     /*
@@ -176,6 +188,7 @@ struct ffa_ctx {
      * ffa_domain_teardown() to know which SPs need to be signalled.
      */
     uint16_t create_signal_count;
+    bool rx_is_free;
 };
 
 /* Negotiated FF-A version to use with the SPMC */
@@ -371,6 +384,11 @@ static void set_regs(struct cpu_user_regs *regs, register_t v0, register_t v1,
         set_user_reg(regs, 7, v7);
 }
 
+static void set_regs_error(struct cpu_user_regs *regs, uint32_t error_code)
+{
+    set_regs(regs, FFA_ERROR, 0, error_code, 0, 0, 0, 0, 0);
+}
+
 static void set_regs_success(struct cpu_user_regs *regs, uint32_t w2,
                              uint32_t w3)
 {
@@ -392,6 +410,108 @@ static void handle_version(struct cpu_user_regs *regs)
     set_regs(regs, vers, 0, 0, 0, 0, 0, 0, 0);
 }
 
+static uint32_t handle_rxtx_map(uint32_t fid, register_t tx_addr,
+                                register_t rx_addr, uint32_t page_count)
+{
+    uint32_t ret = FFA_RET_INVALID_PARAMETERS;
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+    struct page_info *tx_pg;
+    struct page_info *rx_pg;
+    p2m_type_t t;
+    void *rx;
+    void *tx;
+
+    if ( !smccc_is_conv_64(fid) )
+    {
+        /*
+         * Calls using the 32-bit calling convention must ignore the upper
+         * 32 bits in the argument registers.
+         */
+        tx_addr &= UINT32_MAX;
+        rx_addr &= UINT32_MAX;
+    }
+
+    if ( page_count > FFA_MAX_RXTX_PAGE_COUNT )
+    {
+        printk(XENLOG_ERR "ffa: RXTX_MAP: error: %u pages requested (limit %u)\n",
+               page_count, FFA_MAX_RXTX_PAGE_COUNT);
+        return FFA_RET_NOT_SUPPORTED;
+    }
+
+    /* Already mapped */
+    if ( ctx->rx )
+        return FFA_RET_DENIED;
+
+    tx_pg = get_page_from_gfn(d, gfn_x(gaddr_to_gfn(tx_addr)), &t, P2M_ALLOC);
+    if ( !tx_pg )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    /* Only normal RW RAM for now */
+    if ( t != p2m_ram_rw )
+        goto err_put_tx_pg;
+
+    rx_pg = get_page_from_gfn(d, gfn_x(gaddr_to_gfn(rx_addr)), &t, P2M_ALLOC);
+    if ( !tx_pg )
+        goto err_put_tx_pg;
+
+    /* Only normal RW RAM for now */
+    if ( t != p2m_ram_rw )
+        goto err_put_rx_pg;
+
+    tx = __map_domain_page_global(tx_pg);
+    if ( !tx )
+        goto err_put_rx_pg;
+
+    rx = __map_domain_page_global(rx_pg);
+    if ( !rx )
+        goto err_unmap_tx;
+
+    ctx->rx = rx;
+    ctx->tx = tx;
+    ctx->rx_pg = rx_pg;
+    ctx->tx_pg = tx_pg;
+    ctx->page_count = page_count;
+    ctx->rx_is_free = true;
+    return FFA_RET_OK;
+
+err_unmap_tx:
+    unmap_domain_page_global(tx);
+err_put_rx_pg:
+    put_page(rx_pg);
+err_put_tx_pg:
+    put_page(tx_pg);
+
+    return ret;
+}
+
+static void rxtx_unmap(struct ffa_ctx *ctx)
+{
+    unmap_domain_page_global(ctx->rx);
+    unmap_domain_page_global(ctx->tx);
+    put_page(ctx->rx_pg);
+    put_page(ctx->tx_pg);
+    ctx->rx = NULL;
+    ctx->tx = NULL;
+    ctx->rx_pg = NULL;
+    ctx->tx_pg = NULL;
+    ctx->page_count = 0;
+    ctx->rx_is_free = false;
+}
+
+static uint32_t handle_rxtx_unmap(void)
+{
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+
+    if ( !ctx->rx )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    rxtx_unmap(ctx);
+
+    return FFA_RET_OK;
+}
+
 static void handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
 {
     struct arm_smccc_1_2_regs arg = { .a0 = fid, };
@@ -448,6 +568,7 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     uint32_t fid = get_user_reg(regs, 0);
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
+    int e;
 
     if ( !ctx )
         return false;
@@ -460,6 +581,22 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     case FFA_ID_GET:
         set_regs_success(regs, get_vm_id(d), 0);
         return true;
+    case FFA_RXTX_MAP_32:
+    case FFA_RXTX_MAP_64:
+        e = handle_rxtx_map(fid, get_user_reg(regs, 1), get_user_reg(regs, 2),
+                            get_user_reg(regs, 3));
+        if ( e )
+            set_regs_error(regs, e);
+        else
+            set_regs_success(regs, 0, 0);
+        return true;
+    case FFA_RXTX_UNMAP:
+        e = handle_rxtx_unmap();
+        if ( e )
+            set_regs_error(regs, e);
+        else
+            set_regs_success(regs, 0, 0);
+        return true;
     case FFA_MSG_SEND_DIRECT_REQ_32:
     case FFA_MSG_SEND_DIRECT_REQ_64:
         handle_msg_send_direct_req(regs, fid);
@@ -554,6 +691,9 @@ static int ffa_domain_teardown(struct domain *d)
                    get_vm_id(d), subscr_vm_destroyed[n], res);
     }
 
+    if ( ctx->rx )
+        rxtx_unmap(ctx);
+
     XFREE(d->arch.tee);
 
     return 0;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:15:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:15:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572965.897178 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoT-00058Z-RM; Mon, 31 Jul 2023 12:15:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572965.897178; Mon, 31 Jul 2023 12:15:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoT-00058H-M1; Mon, 31 Jul 2023 12:15:49 +0000
Received: by outflank-mailman (input) for mailman id 572965;
 Mon, 31 Jul 2023 12:15:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VuP2=DR=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qQRoS-0003r0-Ks
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:15:48 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fb6e64f8-2f9b-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 14:15:48 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-4fe21e7f3d1so4304543e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 05:15:48 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac2430a000000b004fbb1bc1ae0sm2028077lfh.163.2023.07.31.05.15.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 05:15:46 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fb6e64f8-2f9b-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690805747; x=1691410547;
        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=4AB6A9Fj9vf3tU/KMptcs+JouX3pEtTOo9oFrsEL35s=;
        b=fX1IMNzMLXqAynWPqbnUkV1Rt3C0luOm0RJJStG+L08FeEH7bcQ7VOdpdPjO/M8gkX
         HUF4119LckHAnbQYfjrACz6Qjgc8cWA6q8T9iA0Lb0SOnyybqdUbAl2bkl1WL8CWQCxX
         FBzbQ2BWG+Q2QYjCyfzkjLSjLG4lMcBbyaRQmi+ylNNtod6tZ8P+MhWZ51ysuB3ZfMyv
         QIRJIgvgn5jGRK95vvWs75DfBFCaWS3ps1pCthDQt/QPQ/p49+urIx4bmHOPugnjqjg5
         UZWhJF3cFnmK779Hs5Ju8m1qVSSVymY2/TLrNeGmufkrJZ5q+0LcdFj5HFeGqFC0FCTL
         HJJQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690805747; x=1691410547;
        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=4AB6A9Fj9vf3tU/KMptcs+JouX3pEtTOo9oFrsEL35s=;
        b=h2vyGbeDMI1wua4TH4p4heNz9h6JW6cOpB4X7dT/qb9Pq8kHuVqMJ7jFyVzi8D/nlV
         uYn27HHBKPjF/0XXudPd6MPhUumoXmkoHzp6zLbntUQn2yfDgvYq5OgdEf8gwRklOXZi
         vbt7AoiYXaF/HqAT2+rdiPg8OMMRpWCL4kUdibLNJGKSNeoIKd+p3fVtc0dE+YsiEzKS
         yPjyKXPXEGM48ktGEQvpKMiVzupJMOYj/VUODzhy6ZEqB4hbPzFxWpaS6gWEc35Z7f84
         DvDqyk94k6keT/Lbi77PP4NYV4uHSU0d+NROD87Sy6gm5xWvAl+XPibGGo1kYJSqjirm
         9e4w==
X-Gm-Message-State: ABy/qLb+rS41GPf46ipIta6KOy9gyDS2GcGtC72a69q6I26OJangPtka
	gjDq0EaK1Glb7eiPRmQEcl3gdxcdu4LaILRP3gk=
X-Google-Smtp-Source: APBJJlHxge4QcUxtlZBi8niviTT+SjTx4A6GMi/eZePSKE3dub2Em06W0e4BqLkfd925t/I0dhh7Yw==
X-Received: by 2002:a19:4f52:0:b0:4fd:d9dd:7a22 with SMTP id a18-20020a194f52000000b004fdd9dd7a22mr5256715lfk.26.1690805747264;
        Mon, 31 Jul 2023 05:15:47 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Bertrand.Marquis@arm.com,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v11 05/14] xen/arm: ffa: support guest FFA_PARTITION_INFO_GET
Date: Mon, 31 Jul 2023 14:15:27 +0200
Message-Id: <20230731121536.934239-6-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731121536.934239-1-jens.wiklander@linaro.org>
References: <20230731121536.934239-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support in the mediator to handle FFA_PARTITION_INFO_GET requests
from a guest. The requests are forwarded to the SPMC and the response is
translated according to the FF-A version in use by the guest.

Using FFA_PARTITION_INFO_GET changes the owner of the RX buffer to the
caller (the guest in this case), so once it is done with the buffer it
must be released using FFA_RX_RELEASE before another call can be made.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
v10->v11
- Fixing a typo in a comment and adding another comment as requested
---
 xen/arch/arm/tee/ffa.c | 134 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 134 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 6c76c9885774..6c889bf97002 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -166,7 +166,18 @@
 #define FFA_MSG_SEND                    0x8400006EU
 #define FFA_MSG_POLL                    0x8400006AU
 
+/*
+ * Structs below ending with _1_0 are defined in FF-A-1.0-REL and
+ * structs ending with _1_1 are defined in FF-A-1.1-REL0.
+ */
+
 /* Partition information descriptor */
+struct ffa_partition_info_1_0 {
+    uint16_t id;
+    uint16_t execution_context;
+    uint32_t partition_properties;
+};
+
 struct ffa_partition_info_1_1 {
     uint16_t id;
     uint16_t execution_context;
@@ -189,6 +200,7 @@ struct ffa_ctx {
      */
     uint16_t create_signal_count;
     bool rx_is_free;
+    spinlock_t lock;
 };
 
 /* Negotiated FF-A version to use with the SPMC */
@@ -203,9 +215,15 @@ static uint16_t subscr_vm_destroyed_count __read_mostly;
 /*
  * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
  * number of pages used in each of these buffers.
+ *
+ * The RX buffer is protected from concurrent usage with ffa_rx_buffer_lock.
+ * Note that the SPMC is also tracking the ownership of our RX buffer so
+ * for calls which uses our RX buffer to deliver a result we must call
+ * ffa_rx_release() to let the SPMC know that we're done with the buffer.
  */
 static void *ffa_rx __read_mostly;
 static void *ffa_tx __read_mostly;
+static DEFINE_SPINLOCK(ffa_rx_buffer_lock);
 
 static bool ffa_get_version(uint32_t *vers)
 {
@@ -512,6 +530,103 @@ static uint32_t handle_rxtx_unmap(void)
     return FFA_RET_OK;
 }
 
+static int32_t handle_partition_info_get(uint32_t w1, uint32_t w2, uint32_t w3,
+                                         uint32_t w4, uint32_t w5,
+                                         uint32_t *count)
+{
+    int32_t ret = FFA_RET_DENIED;
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+
+    /*
+     * FF-A v1.0 has w5 MBZ while v1.1 allows
+     * FFA_PARTITION_INFO_GET_COUNT_FLAG to be non-zero.
+     *
+     * FFA_PARTITION_INFO_GET_COUNT is only using registers and not the
+     * rxtx buffer so do the partition_info_get directly.
+     */
+    if ( w5 == FFA_PARTITION_INFO_GET_COUNT_FLAG &&
+         ctx->guest_vers == FFA_VERSION_1_1 )
+        return ffa_partition_info_get(w1, w2, w3, w4, w5, count);
+    if ( w5 )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    if ( !ffa_rx )
+        return FFA_RET_DENIED;
+
+    spin_lock(&ctx->lock);
+    if ( !ctx->page_count || !ctx->rx_is_free )
+        goto out;
+    spin_lock(&ffa_rx_buffer_lock);
+    ret = ffa_partition_info_get(w1, w2, w3, w4, w5, count);
+    if ( ret )
+        goto out_rx_buf_unlock;
+    /*
+     * ffa_partition_info_get() succeeded so we now own the RX buffer we
+     * share with the SPMC. We must give it back using ffa_rx_release()
+     * once we've copied the content.
+     */
+
+    if ( ctx->guest_vers == FFA_VERSION_1_0 )
+    {
+        size_t n;
+        struct ffa_partition_info_1_1 *src = ffa_rx;
+        struct ffa_partition_info_1_0 *dst = ctx->rx;
+
+        if ( ctx->page_count * FFA_PAGE_SIZE < *count * sizeof(*dst) )
+        {
+            ret = FFA_RET_NO_MEMORY;
+            goto out_rx_release;
+        }
+
+        for ( n = 0; n < *count; n++ )
+        {
+            dst[n].id = src[n].id;
+            dst[n].execution_context = src[n].execution_context;
+            dst[n].partition_properties = src[n].partition_properties;
+        }
+    }
+    else
+    {
+        size_t sz = *count * sizeof(struct ffa_partition_info_1_1);
+
+        if ( ctx->page_count * FFA_PAGE_SIZE < sz )
+        {
+            ret = FFA_RET_NO_MEMORY;
+            goto out_rx_release;
+        }
+
+
+        memcpy(ctx->rx, ffa_rx, sz);
+    }
+    ctx->rx_is_free = false;
+out_rx_release:
+    ffa_rx_release();
+out_rx_buf_unlock:
+    spin_unlock(&ffa_rx_buffer_lock);
+out:
+    spin_unlock(&ctx->lock);
+
+    return ret;
+}
+
+static int32_t handle_rx_release(void)
+{
+    int32_t ret = FFA_RET_DENIED;
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+
+    spin_lock(&ctx->lock);
+    if ( !ctx->page_count || ctx->rx_is_free )
+        goto out;
+    ret = FFA_RET_OK;
+    ctx->rx_is_free = true;
+out:
+    spin_unlock(&ctx->lock);
+
+    return ret;
+}
+
 static void handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
 {
     struct arm_smccc_1_2_regs arg = { .a0 = fid, };
@@ -568,6 +683,7 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     uint32_t fid = get_user_reg(regs, 0);
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
+    uint32_t count;
     int e;
 
     if ( !ctx )
@@ -597,6 +713,24 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
         else
             set_regs_success(regs, 0, 0);
         return true;
+    case FFA_PARTITION_INFO_GET:
+        e = handle_partition_info_get(get_user_reg(regs, 1),
+                                      get_user_reg(regs, 2),
+                                      get_user_reg(regs, 3),
+                                      get_user_reg(regs, 4),
+                                      get_user_reg(regs, 5), &count);
+        if ( e )
+            set_regs_error(regs, e);
+        else
+            set_regs_success(regs, count, 0);
+        return true;
+    case FFA_RX_RELEASE:
+        e = handle_rx_release();
+        if ( e )
+            set_regs_error(regs, e);
+        else
+            set_regs_success(regs, 0, 0);
+        return true;
     case FFA_MSG_SEND_DIRECT_REQ_32:
     case FFA_MSG_SEND_DIRECT_REQ_64:
         handle_msg_send_direct_req(regs, fid);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:15:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:15:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572966.897188 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoV-0005RQ-6m; Mon, 31 Jul 2023 12:15:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572966.897188; Mon, 31 Jul 2023 12:15:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoV-0005Qc-1C; Mon, 31 Jul 2023 12:15:51 +0000
Received: by outflank-mailman (input) for mailman id 572966;
 Mon, 31 Jul 2023 12:15:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VuP2=DR=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qQRoT-0003r0-JJ
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:15:49 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fc10b9dd-2f9b-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 14:15:49 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-4fe21e7f3d1so4304579e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 05:15:49 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac2430a000000b004fbb1bc1ae0sm2028077lfh.163.2023.07.31.05.15.47
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 05:15:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fc10b9dd-2f9b-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690805748; x=1691410548;
        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=/VXgpYeEzG0m5+ymIEw5RAHkfT6uMITIdBZHbBu8of4=;
        b=ylKMKE+tWA3sQFzkBLH9O/Gvaxr6PeIWBWD5xkoUS5sVPn2oqRMwmZbVjaoBgpm3Mf
         aWk1g3xQVkh5vhQi7WD4zLYhnD17heG1mfAEZlLMv46YNO1x61gV/dU0fNwQ8+GVhKd/
         86G7CKl/GGfUSBGIWAa7TGUE3c2FTedoEdiiVPA7F6lXdKDVU2T/yWHs5+nS1ofWeRwE
         vVU0HG5HzVp5vtQHT1aqfCx4YfiIH9YHnxGtqQJXm6Xzt2bQ0ZULCVja/2Z9j69Wv210
         RksnXvGmHaoNZq3fZXlGsBfmeXX1LgOdjwbTz4nnbR2rVio3Z4b5I3k2BkfMyAxpY6gs
         q41w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690805748; x=1691410548;
        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=/VXgpYeEzG0m5+ymIEw5RAHkfT6uMITIdBZHbBu8of4=;
        b=L7cvuoVpNPHqk+WaONjUMG6HRQEKJdXVvqQ6nPO7B4sARXAejH8l/cC0L9UcPw7WTB
         +IZ2JaIHQ3Xris5dsOKrOtRaj1qro+RNBgUx58mJxmSDXsOi5KMBBmztCpsOS8eXH/W/
         LLPkY7cjEy6dIG9tdafejHmcoLla3NQP+zBd/7zbvg83TRgOAQVJ2qYsIvPNa03z1XUw
         mAWTaWNMgFK2hDsuNcgXJSC1rv3OocALGYCiiTsrO1qJRp7wGlI5L7xjVDM1GVfidrEi
         38qX9OSyZLa4i37SL9MBC2zRqA+3v0H9PYeT4U8ZGqqZ9371LsIJm5YHrMFZrmoEl0gi
         NDoA==
X-Gm-Message-State: ABy/qLY2Bhz+ORlz3hcYbJ3YDOf2sV0uCSEC58IvMqmkyPJ7B8t5dxAD
	fIpB8nD6rWSXxQlbNQesKYBtwj85/SEppmISc3A=
X-Google-Smtp-Source: APBJJlHKfP93ROT2ikVBjmRWxK5rgzAl/WYL5PB49C+k4cV0Wxy88iM+jAhYzdMKjMdGYA/zrFaoWg==
X-Received: by 2002:a05:6512:3290:b0:4fb:8939:d95c with SMTP id p16-20020a056512329000b004fb8939d95cmr5346679lfe.30.1690805748405;
        Mon, 31 Jul 2023 05:15:48 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Bertrand.Marquis@arm.com,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v11 06/14] xen/arm: move regpair_to_uint64() and uint64_to_regpair() to regs.h
Date: Mon, 31 Jul 2023 14:15:28 +0200
Message-Id: <20230731121536.934239-7-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731121536.934239-1-jens.wiklander@linaro.org>
References: <20230731121536.934239-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Moves the two helper functions regpair_to_uint64() and
uint64_to_regpair() from xen/arch/arm/tee/optee.c to the common arm
specific regs.h. This enables reuse of these functions in the FF-A
mediator in a subsequent patch.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
v10->v11
- No changes
---
 xen/arch/arm/include/asm/regs.h | 12 ++++++++++++
 xen/arch/arm/tee/optee.c        | 11 -----------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/include/asm/regs.h b/xen/arch/arm/include/asm/regs.h
index ef34b38aa171..8a0db9541507 100644
--- a/xen/arch/arm/include/asm/regs.h
+++ b/xen/arch/arm/include/asm/regs.h
@@ -60,6 +60,18 @@ static inline bool guest_mode(const struct cpu_user_regs *r)
 register_t get_user_reg(struct cpu_user_regs *regs, int reg);
 void set_user_reg(struct cpu_user_regs *regs, int reg, register_t value);
 
+static inline uint64_t regpair_to_uint64(register_t reg0, register_t reg1)
+{
+    return ((uint64_t)reg0 << 32) | (uint32_t)reg1;
+}
+
+static inline void uint64_to_regpair(register_t *reg0, register_t *reg1,
+                                     uint64_t val)
+{
+    *reg0 = val >> 32;
+    *reg1 = (uint32_t)val;
+}
+
 #endif
 
 #endif /* __ARM_REGS_H__ */
diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
index c91bd7d5ac25..5151bd90ed02 100644
--- a/xen/arch/arm/tee/optee.c
+++ b/xen/arch/arm/tee/optee.c
@@ -273,17 +273,6 @@ static int optee_domain_teardown(struct domain *d)
     return 0;
 }
 
-static uint64_t regpair_to_uint64(register_t reg0, register_t reg1)
-{
-    return ((uint64_t)reg0 << 32) | (uint32_t)reg1;
-}
-
-static void uint64_to_regpair(register_t *reg0, register_t *reg1, uint64_t val)
-{
-    *reg0 = val >> 32;
-    *reg1 = (uint32_t)val;
-}
-
 static struct page_info *get_domain_ram_page(gfn_t gfn)
 {
     struct page_info *page;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:15:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:15:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572967.897199 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoW-0005jr-IX; Mon, 31 Jul 2023 12:15:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572967.897199; Mon, 31 Jul 2023 12:15:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoW-0005jB-CK; Mon, 31 Jul 2023 12:15:52 +0000
Received: by outflank-mailman (input) for mailman id 572967;
 Mon, 31 Jul 2023 12:15:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VuP2=DR=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qQRoU-0003r0-Ky
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:15:50 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fcb18808-2f9b-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 14:15:50 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-4fe0e23a4b1so6932085e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 05:15:50 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac2430a000000b004fbb1bc1ae0sm2028077lfh.163.2023.07.31.05.15.48
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 05:15:48 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fcb18808-2f9b-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690805749; x=1691410549;
        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=91TK2fSJgBDrNg5Gf6mzXvMddHme3pib23sjpSHTPK4=;
        b=V0wqe86VBSiXbh/GxV5ECzB54GWICIbLdhcdwtWNfjxZUXNhQAjKv/BYMd1hC5ge88
         Y0IKkcze6XObSz/dtCHZub2KelLY7HPE5TG18ghaKmcvbaqEVGcDU5jQSj6lhpz4q9NI
         tkSklqRtW5i1fh14CtdMGpcTCVXHDlwfM4FPy3CloQ+DPAWJpgyRoiL1g+7zmA9oFzC0
         s3iZP3//GiqlNicxqqjbicdxtF7Ob2eX8gTm1Km5Vf6bReQIqLP+6hDFMbeAjMdzw9Vw
         c/IocJ11mO4+IiAme2ZsyBZaEnIbR/Uxop5x9eRmN/LaJBOL3TA569JAylXAPtQUoUMj
         iyrA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690805749; x=1691410549;
        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=91TK2fSJgBDrNg5Gf6mzXvMddHme3pib23sjpSHTPK4=;
        b=jRoSlp2jlwIGRGNty940REE80Z19tJjomSkHmgG4wEVE6y2uWGgo5e0h9WvLSGCrJj
         bxE7EdCk/mC9WapU1U0LduuJ210bQY5GSL8BzSnCjB3QcavM1d3e1xmkYHyFkCkvNFtI
         74a7pQLHTM7/PztTDtUBVFG39NFh65bQmypt3SMKo80B/8z77hfjvVZ1CvqERyON6GDf
         SrNHQZUa85LKOZO48rYEtwbeuIe9wIpi/N4BsgHx5vyVLHpCg5sbBbx+oXzNpMsS2oxA
         lcpWrsSzos6b+cCEKTeVNYJUJh3BapnV5v+JiQR/bG9Oy1RzYix7q6QrFF/shvRC14bx
         w3Uw==
X-Gm-Message-State: ABy/qLaAs0aE9hI74AUCuTPruTxIIyqzPuxCcIFZQoyiaAgdYEyOANq7
	CmytWVNnKep4iJbkKkr4O2Ytpo3Nr39XxJyJc5I=
X-Google-Smtp-Source: APBJJlGhQLfstVSoA8t0Yv+/XhY3VvcHDySUWZUqNz0i+YUUzC8MSTmVNfhlJqYKZQ8wLlurghV9Iw==
X-Received: by 2002:a05:6512:718:b0:4f6:1779:b1c1 with SMTP id b24-20020a056512071800b004f61779b1c1mr5142914lfs.48.1690805749482;
        Mon, 31 Jul 2023 05:15:49 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Bertrand.Marquis@arm.com,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v11 07/14] xen/arm: ffa: add defines for sharing memory
Date: Mon, 31 Jul 2023 14:15:29 +0200
Message-Id: <20230731121536.934239-8-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731121536.934239-1-jens.wiklander@linaro.org>
References: <20230731121536.934239-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

According to DEN0077A version 1.1 REL0
- Section 10.9.2 Memory region handle, page 167
- Table 10.18 at page 175
- Table 10.15 at page 168
- Section 10.11.4 Flags usage, page 184-187
add defines needed for sharing using the function FFA_MEM_SHARE and
friends.

Also add limits for how many shared buffers that a guest can have at
once and how large a shared buffer can be at most.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
v10->v11
- Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/tee/ffa.c | 58 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 6c889bf97002..e0d1746f3bfd 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -5,6 +5,14 @@
  * Arm Firmware Framework for ARMv8-A (FF-A) mediator
  *
  * Copyright (C) 2023  Linaro Limited
+ *
+ * References:
+ * FF-A-1.0-REL: FF-A specification version 1.0 available at
+ *               https://developer.arm.com/documentation/den0077/a
+ * FF-A-1.1-REL0: FF-A specification version 1.1 available at
+ *                https://developer.arm.com/documentation/den0077/e
+ * TEEC-1.0C: TEE Client API Specification version 1.0c available at
+ *            https://globalplatform.org/specs-library/tee-client-api-specification/
  */
 
 #include <xen/bitops.h>
@@ -80,6 +88,56 @@
  */
 #define FFA_MAX_RXTX_PAGE_COUNT         1
 
+/*
+ * Limit for shared buffer size. Please note that this define limits
+ * number of pages.
+ *
+ * FF-A doesn't have any direct requirements on GlobalPlatform or vice
+ * versa, but an implementation can very well use FF-A in order to provide
+ * a GlobalPlatform interface on top.
+ *
+ * Global Platform specification for TEE requires that any TEE
+ * implementation should allow to share buffers with size of at least
+ * 512KB, defined in TEEC-1.0C page 24, Table 4-1,
+ * TEEC_CONFIG_SHAREDMEM_MAX_SIZE.
+ * Due to overhead which can be hard to predict exactly, double this number
+ * to give a safe margin.
+ */
+#define FFA_MAX_SHM_PAGE_COUNT          (2 * SZ_512K / FFA_PAGE_SIZE)
+
+/*
+ * Limits the number of shared buffers that guest can have at once. This
+ * is to prevent case, when guests trick XEN into exhausting its own
+ * memory by allocating many small buffers. This value has been chosen
+ * arbitrarily.
+ */
+#define FFA_MAX_SHM_COUNT               32
+
+/* FF-A-1.1-REL0 section 10.9.2 Memory region handle, page 167 */
+#define FFA_HANDLE_HYP_FLAG             BIT(63, ULL)
+#define FFA_HANDLE_INVALID              0xffffffffffffffffULL
+
+/*
+ * Memory attributes: Normal memory, Write-Back cacheable, Inner shareable
+ * Defined in FF-A-1.1-REL0 Table 10.18 at page 175.
+ */
+#define FFA_NORMAL_MEM_REG_ATTR         0x2fU
+/*
+ * Memory access permissions: Read-write
+ * Defined in FF-A-1.1-REL0 Table 10.15 at page 168.
+ */
+#define FFA_MEM_ACC_RW                  0x2U
+
+/* FF-A-1.1-REL0 section 10.11.4 Flags usage, page 184-187 */
+/* Clear memory before mapping in receiver */
+#define FFA_MEMORY_REGION_FLAG_CLEAR            BIT(0, U)
+/* Relayer may time slice this operation */
+#define FFA_MEMORY_REGION_FLAG_TIME_SLICE       BIT(1, U)
+/* Clear memory after receiver relinquishes it */
+#define FFA_MEMORY_REGION_FLAG_CLEAR_RELINQUISH BIT(2, U)
+/* Share memory transaction */
+#define FFA_MEMORY_REGION_TRANSACTION_TYPE_SHARE (1U << 3)
+
 /*
  * Flags and field values used for the MSG_SEND_DIRECT_REQ/RESP:
  * BIT(31): Framework or partition message
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:15:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:15:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572968.897203 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoX-0005sv-4e; Mon, 31 Jul 2023 12:15:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572968.897203; Mon, 31 Jul 2023 12:15:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoX-0005rU-0a; Mon, 31 Jul 2023 12:15:53 +0000
Received: by outflank-mailman (input) for mailman id 572968;
 Mon, 31 Jul 2023 12:15:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VuP2=DR=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qQRoV-0003r0-PJ
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:15:51 +0000
Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com
 [2a00:1450:4864:20::131])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fd64c346-2f9b-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 14:15:51 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-4fe07f0636bso7121423e87.1
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 05:15:51 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac2430a000000b004fbb1bc1ae0sm2028077lfh.163.2023.07.31.05.15.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 05:15:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fd64c346-2f9b-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690805750; x=1691410550;
        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=Ra6bzn7NO+Bj2QIqg1KOF4qCATzBH3WWnRdNuT2ZsJk=;
        b=jsPWksmQaVnXCdmZ0VKCJytk2yXrXjtkIS1Jqd9Ht5F4lFa8BVhrdSeLd1XqrLdUnF
         WX2RFQ5f+uaAvQDO09ANKhhIHoibC7td8iPebZC3Z+5pvxeGPyI0gd1fgBWLXGR/vv9Z
         5RrkMuQunnMjxgRQc7AqDywMxl5pwwlSLselyQHWuA1PCEVuPr/ZhDvNDZMuAMCLgGil
         0v3rE1fSY+rx3rzz79QNUJsklmNXZREgpjFxAX5/THhr9Sp7bVGDyYmi10n5DDBJpkDw
         3ltUpR6NcEl6iloXWhbHf0j3u1pPDFlfaJC0cMUk1mqZODNPd/sFHJjgAkB5spaGVlFR
         ZBnQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690805750; x=1691410550;
        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=Ra6bzn7NO+Bj2QIqg1KOF4qCATzBH3WWnRdNuT2ZsJk=;
        b=Lwys28J2PwQjOlfWO1cUjlU8NB7X2o4A2+Ws8KqBcPD7nVAmuOierja4cvFnGOJ6AZ
         ix1o6/1JQzZmpYom0XPzWQ1l8UwuXB9frIA+AOYcsCT17I04CgD+fo+D9AEVJaMhidzl
         rpHp8IES9+n301tPdiSvMcpvvohejoIheOKjA2PPaz4K9SVE4Apfnm6Kldj/JADvmVvR
         G56R9mrs51gPWUaIFnULf29HPT/PBx59KCWPOzBV6tBUgipAgZK6mnsc7NnAfmbklPNm
         dFYYgDe7DONZ1g3nHfhNQnYY6Z2rcpJtwrzS2Va+2K9beIuPDQFdwma5KkQ+vzSOzirN
         csHQ==
X-Gm-Message-State: ABy/qLbCimhsYE1yIrTjNWSddfePcISFHTy4mMKvpbE2DEh47pfErF0W
	sdQuT5u/EVcOmMDFHQvpVD7DgDlNJfG3lRgg12Q=
X-Google-Smtp-Source: APBJJlG56YNcj8dVMPrIORRIRMloOKThCd3L3exybXwsNk8fmMggAuHfiku9rUraKur4MeQpSuK1lA==
X-Received: by 2002:a19:7401:0:b0:4f9:69af:9857 with SMTP id v1-20020a197401000000b004f969af9857mr4090577lfe.51.1690805750658;
        Mon, 31 Jul 2023 05:15:50 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Bertrand.Marquis@arm.com,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v11 08/14] xen/arm: ffa: add ABI structs for sharing memory
Date: Mon, 31 Jul 2023 14:15:30 +0200
Message-Id: <20230731121536.934239-9-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731121536.934239-1-jens.wiklander@linaro.org>
References: <20230731121536.934239-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds the ABI structs used by function FFA_MEM_SHARE and friends for
sharing memory.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
v10->v11
- No changes
---
 xen/arch/arm/tee/ffa.c | 69 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index e0d1746f3bfd..9927fdf78af5 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -243,6 +243,75 @@ struct ffa_partition_info_1_1 {
     uint8_t uuid[16];
 };
 
+/* Constituent memory region descriptor */
+struct ffa_address_range {
+    uint64_t address;
+    uint32_t page_count;
+    uint32_t reserved;
+};
+
+/* Composite memory region descriptor */
+struct ffa_mem_region {
+    uint32_t total_page_count;
+    uint32_t address_range_count;
+    uint64_t reserved;
+    struct ffa_address_range address_range_array[];
+};
+
+/* Memory access permissions descriptor */
+struct ffa_mem_access_perm {
+    uint16_t endpoint_id;
+    uint8_t perm;
+    uint8_t flags;
+};
+
+/* Endpoint memory access descriptor */
+struct ffa_mem_access {
+    struct ffa_mem_access_perm access_perm;
+    uint32_t region_offs;
+    uint64_t reserved;
+};
+
+/* Lend, donate or share memory transaction descriptor */
+struct ffa_mem_transaction_1_0 {
+    uint16_t sender_id;
+    uint8_t mem_reg_attr;
+    uint8_t reserved0;
+    uint32_t flags;
+    uint64_t handle;
+    uint64_t tag;
+    uint32_t reserved1;
+    uint32_t mem_access_count;
+    struct ffa_mem_access mem_access_array[];
+};
+
+struct ffa_mem_transaction_1_1 {
+    uint16_t sender_id;
+    uint16_t mem_reg_attr;
+    uint32_t flags;
+    uint64_t handle;
+    uint64_t tag;
+    uint32_t mem_access_size;
+    uint32_t mem_access_count;
+    uint32_t mem_access_offs;
+    uint8_t reserved[12];
+};
+
+/* Endpoint RX/TX descriptor */
+struct ffa_endpoint_rxtx_descriptor_1_0 {
+    uint16_t sender_id;
+    uint16_t reserved;
+    uint32_t rx_range_count;
+    uint32_t tx_range_count;
+};
+
+struct ffa_endpoint_rxtx_descriptor_1_1 {
+    uint16_t sender_id;
+    uint16_t reserved;
+    uint32_t rx_region_offs;
+    uint32_t tx_region_offs;
+};
+
 struct ffa_ctx {
     void *rx;
     const void *tx;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:15:55 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:15:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572969.897218 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoZ-0006Pq-LI; Mon, 31 Jul 2023 12:15:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572969.897218; Mon, 31 Jul 2023 12:15:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoZ-0006PJ-GF; Mon, 31 Jul 2023 12:15:55 +0000
Received: by outflank-mailman (input) for mailman id 572969;
 Mon, 31 Jul 2023 12:15:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VuP2=DR=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qQRoX-0003r0-IM
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:15:53 +0000
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com
 [2a00:1450:4864:20::130])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fe2a3de0-2f9b-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 14:15:52 +0200 (CEST)
Received: by mail-lf1-x130.google.com with SMTP id
 2adb3069b0e04-4fe3b86cec1so796177e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 05:15:52 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac2430a000000b004fbb1bc1ae0sm2028077lfh.163.2023.07.31.05.15.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 05:15:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fe2a3de0-2f9b-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690805752; x=1691410552;
        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=sOD/fTW4qR3MvnkEx+WBHt8FnCjpvsBZaFI+mewckws=;
        b=r9L0kw2Uh45MiFpmt6ntDguYPitlL6+6FglkdTG0yVMv8wmGb2I5zbV5K2ZOtg+Dst
         JlWyjo8v9XyBkBBVt5j8cIxLBpZuex/SSxUAs0sIQH2NVbc7jUQm2EHa1YVPyY4ZB1Fg
         UX45A3DRVTC+c7JncuiFLeoQld8/glpX9AcMfT7DJgs3b4RJ2Xw8DuzpzCwULQ7QrI7Q
         NP2VitBXKqfIsDvZVGyeHFoZc8kOvsaKd658/20yGnHhBFQEfMmhBOYg8X7cMqcG9yaz
         v6/wJMZommqs86F1pkGtN2job5cMYdvOGKsA7fo04IMG3FRphHLnmO/HgXc6aacq4kuy
         dx0w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690805752; x=1691410552;
        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=sOD/fTW4qR3MvnkEx+WBHt8FnCjpvsBZaFI+mewckws=;
        b=axOrKJmjuKZ1nKS+uMBqXirSnUXoFrrRAXV3dei3v/77RBgoIzacrREqgLFWkm1cNw
         OoNLldZpapzfPGirBRE43FLQUr5gjabSnDH+FyEjUfJ9Ya1SP7ePmm5cYgfDreyI8FQU
         Q7O40JElSZkyVQ6bt0jVLl4L/bg/+F6DlBOgzA43NW4UCOlrP4dSJsniMCQA6PTChkJh
         clr8vTOGtr1uyPost5uS+j2p2yZRmBija7VuKco32j+UpV+yGachj8afQZRu3h8q2pv8
         8NzWmWy2osTp1G4lVQJSZ9PKElAz4b8RsFkDR3XWydEnSlZezUTnHV5nV/3Jij15B5o8
         WmXA==
X-Gm-Message-State: ABy/qLYYBGr5D+Itvu0tCo9kppLhXyYNHlk9lh9EDE4aXJR7HYXHqlXl
	CWJ3U6mfs61YzOkTw+aN8j1N/W4j2GvDO6kkQU8=
X-Google-Smtp-Source: APBJJlGBfdFlJGG6imObY22ExZ5FWXAcbu98zQ2+8T/z82liu1HGaOD6Dodya2U3hAm9S+mIOgdzUQ==
X-Received: by 2002:a05:6512:3b13:b0:4fe:c53:1824 with SMTP id f19-20020a0565123b1300b004fe0c531824mr7430714lfv.40.1690805751906;
        Mon, 31 Jul 2023 05:15:51 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Bertrand.Marquis@arm.com,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v11 09/14] xen/arm: ffa: support sharing memory
Date: Mon, 31 Jul 2023 14:15:31 +0200
Message-Id: <20230731121536.934239-10-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731121536.934239-1-jens.wiklander@linaro.org>
References: <20230731121536.934239-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support for a guest to share memory with an SP using FFA_MEM_SHARE.
Only memory regions small enough to be shared with a single call to
FFA_MEM_SHARE are supported.

With this commit we have a FF-A version 1.1 [1] mediator able to
communicate with a Secure Partition in secure world using shared memory.
The secure world must use FF-A version 1.1, but the guest is free to use
version 1.0 or version 1.1.

Adds a check that the SP supports the needed FF-A features
FFA_MEM_SHARE_64 or FFA_MEM_SHARE_32.

[1] https://developer.arm.com/documentation/den0077/latest
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
v10->v11
- Adding Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/tee/ffa.c | 486 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 486 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 9927fdf78af5..74e3ef50091e 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -297,6 +297,38 @@ struct ffa_mem_transaction_1_1 {
     uint8_t reserved[12];
 };
 
+/* Calculate offset of struct ffa_mem_access from start of buffer */
+#define MEM_ACCESS_OFFSET(access_idx) \
+    ( sizeof(struct ffa_mem_transaction_1_1) + \
+      ( access_idx ) * sizeof(struct ffa_mem_access) )
+
+/* Calculate offset of struct ffa_mem_region from start of buffer */
+#define REGION_OFFSET(access_count, region_idx) \
+    ( MEM_ACCESS_OFFSET(access_count) + \
+      ( region_idx ) * sizeof(struct ffa_mem_region) )
+
+/* Calculate offset of struct ffa_address_range from start of buffer */
+#define ADDR_RANGE_OFFSET(access_count, region_count, range_idx) \
+    ( REGION_OFFSET(access_count, region_count) + \
+      ( range_idx ) * sizeof(struct ffa_address_range) )
+
+/*
+ * The parts needed from struct ffa_mem_transaction_1_0 or struct
+ * ffa_mem_transaction_1_1, used to provide an abstraction of difference in
+ * data structures between version 1.0 and 1.1. This is just an internal
+ * interface and can be changed without changing any ABI.
+ */
+struct ffa_mem_transaction_int {
+    uint16_t sender_id;
+    uint8_t mem_reg_attr;
+    uint8_t flags;
+    uint8_t mem_access_size;
+    uint8_t mem_access_count;
+    uint16_t mem_access_offs;
+    uint64_t handle;
+    uint64_t tag;
+};
+
 /* Endpoint RX/TX descriptor */
 struct ffa_endpoint_rxtx_descriptor_1_0 {
     uint16_t sender_id;
@@ -327,9 +359,22 @@ struct ffa_ctx {
      */
     uint16_t create_signal_count;
     bool rx_is_free;
+    /* Used shared memory objects, struct ffa_shm_mem */
+    struct list_head shm_list;
+    /* Number of allocated shared memory object */
+    unsigned int shm_count;
     spinlock_t lock;
 };
 
+struct ffa_shm_mem {
+    struct list_head list;
+    uint16_t sender_id;
+    uint16_t ep_id;     /* endpoint, the one lending */
+    uint64_t handle;    /* FFA_HANDLE_INVALID if not set yet */
+    unsigned int page_count;
+    struct page_info *pages[];
+};
+
 /* Negotiated FF-A version to use with the SPMC */
 static uint32_t __ro_after_init ffa_version;
 
@@ -351,6 +396,7 @@ static uint16_t subscr_vm_destroyed_count __read_mostly;
 static void *ffa_rx __read_mostly;
 static void *ffa_tx __read_mostly;
 static DEFINE_SPINLOCK(ffa_rx_buffer_lock);
+static DEFINE_SPINLOCK(ffa_tx_buffer_lock);
 
 static bool ffa_get_version(uint32_t *vers)
 {
@@ -457,6 +503,41 @@ static int32_t ffa_rx_release(void)
     return ffa_simple_call(FFA_RX_RELEASE, 0, 0, 0, 0);
 }
 
+static int32_t ffa_mem_share(uint32_t tot_len, uint32_t frag_len,
+                             register_t addr, uint32_t pg_count,
+                             uint64_t *handle)
+{
+    struct arm_smccc_1_2_regs arg = {
+        .a0 = FFA_MEM_SHARE_64,
+        .a1 = tot_len,
+        .a2 = frag_len,
+        .a3 = addr,
+        .a4 = pg_count,
+    };
+    struct arm_smccc_1_2_regs resp;
+
+    arm_smccc_1_2_smc(&arg, &resp);
+
+    switch ( resp.a0 )
+    {
+    case FFA_ERROR:
+        if ( resp.a2 )
+            return resp.a2;
+        else
+            return FFA_RET_NOT_SUPPORTED;
+    case FFA_SUCCESS_32:
+        *handle = regpair_to_uint64(resp.a3, resp.a2);
+        return FFA_RET_OK;
+    case FFA_MEM_FRAG_RX:
+        *handle = regpair_to_uint64(resp.a2, resp.a1);
+        if ( resp.a3 > INT32_MAX ) /* Impossible value */
+            return FFA_RET_ABORTED;
+        return resp.a3 & INT32_MAX;
+    default:
+        return FFA_RET_NOT_SUPPORTED;
+    }
+}
+
 static int32_t ffa_direct_req_send_vm(uint16_t sp_id, uint16_t vm_id,
                                       uint8_t msg)
 {
@@ -805,6 +886,403 @@ out:
              resp.a4 & mask, resp.a5 & mask, resp.a6 & mask, resp.a7 & mask);
 }
 
+/*
+ * Gets all page and assigns them to the supplied shared memory object. If
+ * this function fails then the caller is still expected to call
+ * put_shm_pages() as a cleanup.
+ */
+static int get_shm_pages(struct domain *d, struct ffa_shm_mem *shm,
+                         const struct ffa_address_range *range,
+                         uint32_t range_count, unsigned int start_page_idx,
+                         unsigned int *last_page_idx)
+{
+    unsigned int pg_idx = start_page_idx;
+    gfn_t gfn;
+    unsigned int n;
+    unsigned int m;
+    p2m_type_t t;
+    uint64_t addr;
+    uint64_t page_count;
+
+    for ( n = 0; n < range_count; n++ )
+    {
+        page_count = read_atomic(&range[n].page_count);
+        addr = read_atomic(&range[n].address);
+        for ( m = 0; m < page_count; m++ )
+        {
+            if ( pg_idx >= shm->page_count )
+                return FFA_RET_INVALID_PARAMETERS;
+
+            gfn = gaddr_to_gfn(addr + m * FFA_PAGE_SIZE);
+            shm->pages[pg_idx] = get_page_from_gfn(d, gfn_x(gfn), &t,
+						   P2M_ALLOC);
+            if ( !shm->pages[pg_idx] )
+                return FFA_RET_DENIED;
+            /* Only normal RW RAM for now */
+            if ( t != p2m_ram_rw )
+                return FFA_RET_DENIED;
+            pg_idx++;
+        }
+    }
+
+    *last_page_idx = pg_idx;
+
+    return FFA_RET_OK;
+}
+
+static void put_shm_pages(struct ffa_shm_mem *shm)
+{
+    unsigned int n;
+
+    for ( n = 0; n < shm->page_count && shm->pages[n]; n++ )
+    {
+        put_page(shm->pages[n]);
+        shm->pages[n] = NULL;
+    }
+}
+
+static struct ffa_shm_mem *alloc_ffa_shm_mem(struct ffa_ctx *ctx,
+                                             unsigned int page_count)
+{
+    struct ffa_shm_mem *shm;
+
+    if ( page_count >= FFA_MAX_SHM_PAGE_COUNT ||
+         ctx->shm_count >= FFA_MAX_SHM_COUNT )
+        return NULL;
+
+    shm = xzalloc_flex_struct(struct ffa_shm_mem, pages, page_count);
+    if ( shm )
+    {
+        ctx->shm_count++;
+        shm->page_count = page_count;
+    }
+
+    return shm;
+}
+
+static void free_ffa_shm_mem(struct ffa_ctx *ctx, struct ffa_shm_mem *shm)
+{
+    if ( !shm )
+        return;
+
+    ASSERT(ctx->shm_count > 0);
+    ctx->shm_count--;
+    put_shm_pages(shm);
+    xfree(shm);
+}
+
+static void init_range(struct ffa_address_range *addr_range,
+                       paddr_t pa)
+{
+    memset(addr_range, 0, sizeof(*addr_range));
+    addr_range->address = pa;
+    addr_range->page_count = 1;
+}
+
+/*
+ * This function uses the ffa_tx buffer to transmit the memory transaction
+ * descriptor. The function depends ffa_tx_buffer_lock to be used to guard
+ * the buffer from concurrent use.
+ */
+static int share_shm(struct ffa_shm_mem *shm)
+{
+    const uint32_t max_frag_len = FFA_RXTX_PAGE_COUNT * FFA_PAGE_SIZE;
+    struct ffa_mem_access *mem_access_array;
+    struct ffa_mem_transaction_1_1 *descr;
+    struct ffa_address_range *addr_range;
+    struct ffa_mem_region *region_descr;
+    const unsigned int region_count = 1;
+    void *buf = ffa_tx;
+    uint32_t frag_len;
+    uint32_t tot_len;
+    paddr_t last_pa;
+    unsigned int n;
+    paddr_t pa;
+
+    ASSERT(spin_is_locked(&ffa_tx_buffer_lock));
+    ASSERT(shm->page_count);
+
+    descr = buf;
+    memset(descr, 0, sizeof(*descr));
+    descr->sender_id = shm->sender_id;
+    descr->handle = shm->handle;
+    descr->mem_reg_attr = FFA_NORMAL_MEM_REG_ATTR;
+    descr->mem_access_count = 1;
+    descr->mem_access_size = sizeof(*mem_access_array);
+    descr->mem_access_offs = MEM_ACCESS_OFFSET(0);
+
+    mem_access_array = buf + descr->mem_access_offs;
+    memset(mem_access_array, 0, sizeof(*mem_access_array));
+    mem_access_array[0].access_perm.endpoint_id = shm->ep_id;
+    mem_access_array[0].access_perm.perm = FFA_MEM_ACC_RW;
+    mem_access_array[0].region_offs = REGION_OFFSET(descr->mem_access_count, 0);
+
+    region_descr = buf + mem_access_array[0].region_offs;
+    memset(region_descr, 0, sizeof(*region_descr));
+    region_descr->total_page_count = shm->page_count;
+
+    region_descr->address_range_count = 1;
+    last_pa = page_to_maddr(shm->pages[0]);
+    for ( n = 1; n < shm->page_count; last_pa = pa, n++ )
+    {
+        pa = page_to_maddr(shm->pages[n]);
+        if ( last_pa + FFA_PAGE_SIZE == pa )
+            continue;
+        region_descr->address_range_count++;
+    }
+
+    tot_len = ADDR_RANGE_OFFSET(descr->mem_access_count, region_count,
+                                region_descr->address_range_count);
+    if ( tot_len > max_frag_len )
+        return FFA_RET_NOT_SUPPORTED;
+
+    addr_range = region_descr->address_range_array;
+    frag_len = ADDR_RANGE_OFFSET(descr->mem_access_count, region_count, 1);
+    last_pa = page_to_maddr(shm->pages[0]);
+    init_range(addr_range, last_pa);
+    for ( n = 1; n < shm->page_count; last_pa = pa, n++ )
+    {
+        pa = page_to_maddr(shm->pages[n]);
+        if ( last_pa + FFA_PAGE_SIZE == pa )
+        {
+            addr_range->page_count++;
+            continue;
+        }
+
+        frag_len += sizeof(*addr_range);
+        addr_range++;
+        init_range(addr_range, pa);
+    }
+
+    return ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
+}
+
+static int read_mem_transaction(uint32_t ffa_vers, const void *buf, size_t blen,
+                                struct ffa_mem_transaction_int *trans)
+{
+    uint16_t mem_reg_attr;
+    uint32_t flags;
+    uint32_t count;
+    uint32_t offs;
+    uint32_t size;
+
+    if ( ffa_vers >= FFA_VERSION_1_1 )
+    {
+        const struct ffa_mem_transaction_1_1 *descr;
+
+        if ( blen < sizeof(*descr) )
+            return FFA_RET_INVALID_PARAMETERS;
+
+        descr = buf;
+        trans->sender_id = descr->sender_id;
+        mem_reg_attr = descr->mem_reg_attr;
+        flags = descr->flags;
+        trans->handle = descr->handle;
+        trans->tag = descr->tag;
+
+        count = descr->mem_access_count;
+        size = descr->mem_access_size;
+        offs = descr->mem_access_offs;
+    }
+    else
+    {
+        const struct ffa_mem_transaction_1_0 *descr;
+
+        if ( blen < sizeof(*descr) )
+            return FFA_RET_INVALID_PARAMETERS;
+
+        descr = buf;
+        trans->sender_id = descr->sender_id;
+        mem_reg_attr = descr->mem_reg_attr;
+        flags = descr->flags;
+        trans->handle = descr->handle;
+        trans->tag = descr->tag;
+
+        count = descr->mem_access_count;
+        size = sizeof(struct ffa_mem_access);
+        offs = offsetof(struct ffa_mem_transaction_1_0, mem_access_array);
+    }
+    /*
+     * Make sure that "descr" which is shared with the guest isn't accessed
+     * again after this point.
+     */
+    barrier();
+
+    /*
+     * We're doing a rough check to see that no information is lost when
+     * tranfering the values into a struct ffa_mem_transaction_int below.
+     * The fields in struct ffa_mem_transaction_int are wide enough to hold
+     * any valid value so being out of range means that something is wrong.
+     */
+    if ( mem_reg_attr > UINT8_MAX || flags > UINT8_MAX || size > UINT8_MAX ||
+        count > UINT8_MAX || offs > UINT16_MAX )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    /* Check that the endpoint memory access descriptor array fits */
+    if ( size * count + offs > blen )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    trans->mem_reg_attr = mem_reg_attr;
+    trans->flags = flags;
+    trans->mem_access_size = size;
+    trans->mem_access_count = count;
+    trans->mem_access_offs = offs;
+
+    return 0;
+}
+
+static void handle_mem_share(struct cpu_user_regs *regs)
+{
+    uint32_t tot_len = get_user_reg(regs, 1);
+    uint32_t frag_len = get_user_reg(regs, 2);
+    uint64_t addr = get_user_reg(regs, 3);
+    uint32_t page_count = get_user_reg(regs, 4);
+    const struct ffa_mem_region *region_descr;
+    const struct ffa_mem_access *mem_access;
+    struct ffa_mem_transaction_int trans;
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+    struct ffa_shm_mem *shm = NULL;
+    unsigned int last_page_idx = 0;
+    register_t handle_hi = 0;
+    register_t handle_lo = 0;
+    int ret = FFA_RET_DENIED;
+    uint32_t range_count;
+    uint32_t region_offs;
+
+    /*
+     * We're only accepting memory transaction descriptors via the rx/tx
+     * buffer.
+     */
+    if ( addr )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out_set_ret;
+    }
+
+    /* Check that fragment length doesn't exceed total length */
+    if ( frag_len > tot_len )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out_set_ret;
+    }
+
+    /* We currently only support a single fragment */
+    if ( frag_len != tot_len )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out_set_ret;
+    }
+
+    spin_lock(&ctx->lock);
+
+    if ( frag_len > ctx->page_count * FFA_PAGE_SIZE )
+        goto out_unlock;
+
+    ret = read_mem_transaction(ctx->guest_vers, ctx->tx, frag_len, &trans);
+    if ( ret )
+        goto out_unlock;
+
+    if ( trans.mem_reg_attr != FFA_NORMAL_MEM_REG_ATTR )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out_unlock;
+    }
+
+    /* Only supports sharing it with one SP for now */
+    if ( trans.mem_access_count != 1 )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out_unlock;
+    }
+
+    if ( trans.sender_id != get_vm_id(d) )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out_unlock;
+    }
+
+    /* Check that it fits in the supplied data */
+    if ( trans.mem_access_offs + trans.mem_access_size > frag_len )
+        goto out_unlock;
+
+    mem_access = ctx->tx + trans.mem_access_offs;
+    if ( read_atomic(&mem_access->access_perm.perm) != FFA_MEM_ACC_RW )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out_unlock;
+    }
+
+    region_offs = read_atomic(&mem_access->region_offs);
+    if ( sizeof(*region_descr) + region_offs > frag_len )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out_unlock;
+    }
+
+    region_descr = ctx->tx + region_offs;
+    range_count = read_atomic(&region_descr->address_range_count);
+    page_count = read_atomic(&region_descr->total_page_count);
+
+    if ( !page_count )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out_unlock;
+    }
+
+    shm = alloc_ffa_shm_mem(ctx, page_count);
+    if ( !shm )
+    {
+        ret = FFA_RET_NO_MEMORY;
+        goto out_unlock;
+    }
+    shm->sender_id = trans.sender_id;
+    shm->ep_id = read_atomic(&mem_access->access_perm.endpoint_id);
+
+    /*
+     * Check that the Composite memory region descriptor fits.
+     */
+    if ( sizeof(*region_descr) + region_offs +
+         range_count * sizeof(struct ffa_address_range) > frag_len )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out;
+    }
+
+    ret = get_shm_pages(d, shm, region_descr->address_range_array, range_count,
+                        0, &last_page_idx);
+    if ( ret )
+        goto out;
+    if ( last_page_idx != shm->page_count )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out;
+    }
+
+    /* Note that share_shm() uses our tx buffer */
+    spin_lock(&ffa_tx_buffer_lock);
+    ret = share_shm(shm);
+    spin_unlock(&ffa_tx_buffer_lock);
+    if ( ret )
+        goto out;
+
+    list_add_tail(&shm->list, &ctx->shm_list);
+
+    uint64_to_regpair(&handle_hi, &handle_lo, shm->handle);
+
+out:
+    if ( ret )
+        free_ffa_shm_mem(ctx, shm);
+out_unlock:
+    spin_unlock(&ctx->lock);
+
+out_set_ret:
+    if ( ret == 0)
+            set_regs_success(regs, handle_lo, handle_hi);
+    else
+            set_regs_error(regs, ret);
+}
+
 static bool ffa_handle_call(struct cpu_user_regs *regs)
 {
     uint32_t fid = get_user_reg(regs, 0);
@@ -862,6 +1340,10 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     case FFA_MSG_SEND_DIRECT_REQ_64:
         handle_msg_send_direct_req(regs, fid);
         return true;
+    case FFA_MEM_SHARE_32:
+    case FFA_MEM_SHARE_64:
+        handle_mem_share(regs);
+        return true;
 
     default:
         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
@@ -904,6 +1386,8 @@ static int ffa_domain_init(struct domain *d)
     }
     ctx->create_signal_count = subscr_vm_created_count;
 
+    INIT_LIST_HEAD(&ctx->shm_list);
+
     return 0;
 }
 
@@ -1094,7 +1578,9 @@ static bool ffa_probe(void)
     if ( !check_mandatory_feature(FFA_PARTITION_INFO_GET) ||
          !check_mandatory_feature(FFA_RX_RELEASE) ||
          !check_mandatory_feature(FFA_RXTX_MAP_64) ||
+         !check_mandatory_feature(FFA_MEM_SHARE_64) ||
          !check_mandatory_feature(FFA_RXTX_UNMAP) ||
+         !check_mandatory_feature(FFA_MEM_SHARE_32) ||
          !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
         return false;
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:15:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:15:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572970.897222 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoa-0006T7-62; Mon, 31 Jul 2023 12:15:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572970.897222; Mon, 31 Jul 2023 12:15:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoZ-0006Rz-TX; Mon, 31 Jul 2023 12:15:55 +0000
Received: by outflank-mailman (input) for mailman id 572970;
 Mon, 31 Jul 2023 12:15:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VuP2=DR=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qQRoY-0003r0-AW
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:15:54 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fee65c95-2f9b-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 14:15:53 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-4f954d7309fso5499468e87.1
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 05:15:53 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac2430a000000b004fbb1bc1ae0sm2028077lfh.163.2023.07.31.05.15.52
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 05:15:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fee65c95-2f9b-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690805753; x=1691410553;
        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=g4vSjtYXla7KgcWjbel3A+vRKKWcV7JLHovFCdSLbtg=;
        b=Z8pYQvEZVC1Z3Epa1PSdfPQ4kTcwio3hoQ/rKCmzlfp7teuipYKhOMcq6E95EaOZ9A
         JsHKlMfjqzThJb4Rg+J/LISRj2R2QLaCC5AvznHwr4svMOSdgF8DiUlVbcHeA9qH4tj9
         GjSIsTN5yTygaafkhb9AMeqwjeWJgsXK6V8nB9Nq9Om5riuFkPDSBBgxzUMcF5wWnp/O
         bpKba0kJm6D7v0dJ2r1eoPHJ3sSTkJQ3i/wDKtN/O60yZVeWKLMlG8cTrFXddW9bt4DA
         ho3gCeUBzL5Kl4R8TrIATVLQXIg0DHeWzBVACgGknXRXL5K30aYwo537mW3LlzEMOt/v
         YGnQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690805753; x=1691410553;
        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=g4vSjtYXla7KgcWjbel3A+vRKKWcV7JLHovFCdSLbtg=;
        b=hUQXmD30s1MJSnc08B1+d0RSFoTe4JAj4Ly3nxZnwN2P+W5d/EupWaTrT5PiitNA4h
         NelKZ3v5Il/RfVnocPxL9ygkovK3vUr+XDhSVz+IRXa8m3nGbklWPYLumgBNyS9nr+KE
         r4MUNoDXUJkIfGjW6SuvLhMfll3vRVhAF1xkmw7X9loPbvjOT+vP/7a2AlssR/k4q7Z1
         cSsJNvADOqSRn5sCdwA7HY1HdoRzypcJCjmqyc8CDkiEkr1PmV4vjKB5DuD24oaRPI70
         385mxgGnlofqiP992l1wXeTEnONfU1c+DfwVX9MQrKy5gFulR9ihv+Iptf1twm9uhZ96
         +FOg==
X-Gm-Message-State: ABy/qLZbJGvemw07vEGyT99y8nfINM3zmmt2wDC9J1XEP1UpoPjMS1K4
	lK60BG3lvuyLSXLphpS0jm36MZgnWjlIw/spgyo=
X-Google-Smtp-Source: APBJJlGcyr+7aeiaGR8us8V2/Q5tdSMajkMdzYPMDVuV4rkMvRbZjxFRnnARAAPA2I0ZLR5B7Mr3/g==
X-Received: by 2002:ac2:58e8:0:b0:4fb:fb4e:7580 with SMTP id v8-20020ac258e8000000b004fbfb4e7580mr2872942lfo.8.1690805753285;
        Mon, 31 Jul 2023 05:15:53 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Bertrand.Marquis@arm.com,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v11 10/14] xen/arm: ffa: add support to reclaim shared memory
Date: Mon, 31 Jul 2023 14:15:32 +0200
Message-Id: <20230731121536.934239-11-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731121536.934239-1-jens.wiklander@linaro.org>
References: <20230731121536.934239-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds support to reclaim memory previously shared with FFA_MEM_SHARE.

A memory region that doesn't need to be shared any longer can be
reclaimed with FFA_MEM_RECLAIM once the SP doesn't use it any longer.
This is checked by the SPMC and not in control of the mediator.

Adds a check that the SP supports the needed FF-A feature
FFA_MEM_RECLAIM.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
v10->v11
- No changes
---
 xen/arch/arm/tee/ffa.c | 53 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 74e3ef50091e..75700938c444 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -538,6 +538,12 @@ static int32_t ffa_mem_share(uint32_t tot_len, uint32_t frag_len,
     }
 }
 
+static int32_t ffa_mem_reclaim(uint32_t handle_lo, uint32_t handle_hi,
+                               uint32_t flags)
+{
+    return ffa_simple_call(FFA_MEM_RECLAIM, handle_lo, handle_hi, flags, 0);
+}
+
 static int32_t ffa_direct_req_send_vm(uint16_t sp_id, uint16_t vm_id,
                                       uint8_t msg)
 {
@@ -1283,6 +1289,43 @@ out_set_ret:
             set_regs_error(regs, ret);
 }
 
+static int handle_mem_reclaim(uint64_t handle, uint32_t flags)
+{
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+    struct ffa_shm_mem *shm;
+    register_t handle_hi;
+    register_t handle_lo;
+    int ret;
+
+    spin_lock(&ctx->lock);
+    list_for_each_entry(shm, &ctx->shm_list, list)
+    {
+        if ( shm->handle == handle )
+            goto found_it;
+    }
+    shm = NULL;
+    ret = FFA_RET_INVALID_PARAMETERS;
+    goto out;
+found_it:
+
+    uint64_to_regpair(&handle_hi, &handle_lo, handle);
+    ret = ffa_mem_reclaim(handle_lo, handle_hi, flags);
+    if ( ret )
+    {
+        shm = NULL;
+        goto out;
+    }
+
+    list_del(&shm->list);
+
+out:
+    free_ffa_shm_mem(ctx, shm);
+    spin_unlock(&ctx->lock);
+
+    return ret;
+}
+
 static bool ffa_handle_call(struct cpu_user_regs *regs)
 {
     uint32_t fid = get_user_reg(regs, 0);
@@ -1344,6 +1387,15 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     case FFA_MEM_SHARE_64:
         handle_mem_share(regs);
         return true;
+    case FFA_MEM_RECLAIM:
+        e = handle_mem_reclaim(regpair_to_uint64(get_user_reg(regs, 2),
+                                                 get_user_reg(regs, 1)),
+                               get_user_reg(regs, 3));
+        if ( e )
+            set_regs_error(regs, e);
+        else
+            set_regs_success(regs, 0, 0);
+        return true;
 
     default:
         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
@@ -1581,6 +1633,7 @@ static bool ffa_probe(void)
          !check_mandatory_feature(FFA_MEM_SHARE_64) ||
          !check_mandatory_feature(FFA_RXTX_UNMAP) ||
          !check_mandatory_feature(FFA_MEM_SHARE_32) ||
+         !check_mandatory_feature(FFA_MEM_RECLAIM) ||
          !check_mandatory_feature(FFA_MSG_SEND_DIRECT_REQ_32) )
         return false;
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:15:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:15:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572971.897233 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRoc-0006v8-8K; Mon, 31 Jul 2023 12:15:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572971.897233; Mon, 31 Jul 2023 12:15:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRob-0006tS-Ri; Mon, 31 Jul 2023 12:15:57 +0000
Received: by outflank-mailman (input) for mailman id 572971;
 Mon, 31 Jul 2023 12:15:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VuP2=DR=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qQRoZ-0003r0-IZ
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:15:55 +0000
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com
 [2a00:1450:4864:20::132])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ff9b8268-2f9b-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 14:15:55 +0200 (CEST)
Received: by mail-lf1-x132.google.com with SMTP id
 2adb3069b0e04-4fe2de785e7so2218098e87.1
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 05:15:55 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac2430a000000b004fbb1bc1ae0sm2028077lfh.163.2023.07.31.05.15.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 05:15:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ff9b8268-2f9b-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690805754; x=1691410554;
        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=O7Tv43Fw+2yJGd68qd39ntIRSoYO8/W65g1z0p43Q1c=;
        b=HNicUyZ/f8BHG2++n3STRpiLZeJeB53CC2UwqdczD1LpkV0s2EiCtcoDBgtmPGMkvW
         uH04JN45w/JPf7V3Hawlvkc2eUFKpqQt7VzsiZ33l/81iFiGYwGpm/5xiSmuajeIUenx
         sfVTO5tdePuKXLGN10UCv6e4Y8nj2WWm6YxirRWeUguy1UAHwgm6nsgWYcXAVLbRPZAC
         AHCkAafAIaV0baK9XDSWLqISFh75kdRxdbuwtfffT076r2DY9Q/PmgEMru5TOh/0FqDp
         9F3GXcWyqspv9N3FeJuOuxMhH8NWN7xzM0LoggswRWdaXf+mqHjIz44SExIUiW0aujqi
         EH+A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690805754; x=1691410554;
        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=O7Tv43Fw+2yJGd68qd39ntIRSoYO8/W65g1z0p43Q1c=;
        b=S4Uwp12kH7KPhLx1EiXVIXiJREpzaf8WCQ4knZlf4T1/anTwoDp3h5RpxAk8UAu+ZS
         vZmyThqV26/totY2TMqQW8YTZvagIkp/Ut24gLEi1Y+BDr/iIkqLJmV1ZfesRxzc5GEh
         kyd2r2mDpRrVTJgUCgPDqAA02fcVfx0D6XDy5rANmX3aJ8SFHL70j+uJx5Aw1Q+nRbwg
         cw0Hc0FTY67V5td8OB3JXTxj1pU/V4yBI9vV19ZH/mM2Ds7u32dZU8vRc02jiIeWItnb
         v7Ie+Dl3FqGe5MpOvWP9M8eQHLJykLs4lfNMd1Xehzle7DdBmehmIir8PzR2rH+tazuY
         MFbQ==
X-Gm-Message-State: ABy/qLaT2Stk63+tsverqTrWCDU75opiaPbuhSUVV0Ott+UVxem+OD4b
	rOTELJVPZtby/J6c3DZ5Ql0YPioo0z24UsS1EGc=
X-Google-Smtp-Source: APBJJlHt6A4biBbVLpbbAllO8aE4h4H2Kr0DxMGPdsBcldHgd9k70UTdq+YFs/UC2fXBZOo735pfog==
X-Received: by 2002:a05:6512:2106:b0:4f5:a181:97b8 with SMTP id q6-20020a056512210600b004f5a18197b8mr4652307lfr.25.1690805754348;
        Mon, 31 Jul 2023 05:15:54 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Bertrand.Marquis@arm.com,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH v11 11/14] xen/arm: ffa: improve lock granularity
Date: Mon, 31 Jul 2023 14:15:33 +0200
Message-Id: <20230731121536.934239-12-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731121536.934239-1-jens.wiklander@linaro.org>
References: <20230731121536.934239-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The single lock in struct ffa_ctx is complemented with rx_lock and tx_lock.

The old lock is used for small critical sections, like increasing
shm_count or adding another shm to shm_list.

rx_lock and tx_lock are only acquired using spin_trylock() which for
well-behaving guests should always succeed. Guests using the RX and TX
buffers are expected to serialize accesses before doing the FF-A
request.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
v10->v11
- No changes except resolving conflicts since "xen/arm: ffa: support
  sharing large memory ranges" was dropped.
---
 xen/arch/arm/tee/ffa.c | 107 +++++++++++++++++++++++++++++------------
 1 file changed, 77 insertions(+), 30 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 75700938c444..eb4a58fec470 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -363,6 +363,13 @@ struct ffa_ctx {
     struct list_head shm_list;
     /* Number of allocated shared memory object */
     unsigned int shm_count;
+    /*
+     * tx_lock is used to serialize access to tx
+     * rx_lock is used to serialize access to rx
+     * lock is used for the rest in this struct
+     */
+    spinlock_t tx_lock;
+    spinlock_t rx_lock;
     spinlock_t lock;
 };
 
@@ -768,7 +775,9 @@ static int32_t handle_partition_info_get(uint32_t w1, uint32_t w2, uint32_t w3,
     if ( !ffa_rx )
         return FFA_RET_DENIED;
 
-    spin_lock(&ctx->lock);
+    if ( !spin_trylock(&ctx->rx_lock) )
+        return FFA_RET_BUSY;
+
     if ( !ctx->page_count || !ctx->rx_is_free )
         goto out;
     spin_lock(&ffa_rx_buffer_lock);
@@ -819,7 +828,7 @@ out_rx_release:
 out_rx_buf_unlock:
     spin_unlock(&ffa_rx_buffer_lock);
 out:
-    spin_unlock(&ctx->lock);
+    spin_unlock(&ctx->rx_lock);
 
     return ret;
 }
@@ -830,13 +839,15 @@ static int32_t handle_rx_release(void)
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
 
-    spin_lock(&ctx->lock);
+    if ( !spin_trylock(&ctx->rx_lock) )
+        return FFA_RET_BUSY;
+
     if ( !ctx->page_count || ctx->rx_is_free )
         goto out;
     ret = FFA_RET_OK;
     ctx->rx_is_free = true;
 out:
-    spin_unlock(&ctx->lock);
+    spin_unlock(&ctx->rx_lock);
 
     return ret;
 }
@@ -947,21 +958,43 @@ static void put_shm_pages(struct ffa_shm_mem *shm)
     }
 }
 
+static bool inc_ctx_shm_count(struct ffa_ctx *ctx)
+{
+    bool ret = true;
+
+    spin_lock(&ctx->lock);
+    if (ctx->shm_count >= FFA_MAX_SHM_COUNT)
+        ret = false;
+    else
+        ctx->shm_count++;
+    spin_unlock(&ctx->lock);
+
+    return ret;
+}
+
+static void dec_ctx_shm_count(struct ffa_ctx *ctx)
+{
+    spin_lock(&ctx->lock);
+    ASSERT(ctx->shm_count > 0);
+    ctx->shm_count--;
+    spin_unlock(&ctx->lock);
+}
+
 static struct ffa_shm_mem *alloc_ffa_shm_mem(struct ffa_ctx *ctx,
                                              unsigned int page_count)
 {
     struct ffa_shm_mem *shm;
 
-    if ( page_count >= FFA_MAX_SHM_PAGE_COUNT ||
-         ctx->shm_count >= FFA_MAX_SHM_COUNT )
+    if ( page_count >= FFA_MAX_SHM_PAGE_COUNT )
+        return NULL;
+    if ( !inc_ctx_shm_count(ctx) )
         return NULL;
 
     shm = xzalloc_flex_struct(struct ffa_shm_mem, pages, page_count);
     if ( shm )
-    {
-        ctx->shm_count++;
         shm->page_count = page_count;
-    }
+    else
+        dec_ctx_shm_count(ctx);
 
     return shm;
 }
@@ -971,8 +1004,7 @@ static void free_ffa_shm_mem(struct ffa_ctx *ctx, struct ffa_shm_mem *shm)
     if ( !shm )
         return;
 
-    ASSERT(ctx->shm_count > 0);
-    ctx->shm_count--;
+    dec_ctx_shm_count(ctx);
     put_shm_pages(shm);
     xfree(shm);
 }
@@ -1180,7 +1212,11 @@ static void handle_mem_share(struct cpu_user_regs *regs)
         goto out_set_ret;
     }
 
-    spin_lock(&ctx->lock);
+    if ( !spin_trylock(&ctx->tx_lock) )
+    {
+        ret = FFA_RET_BUSY;
+        goto out_set_ret;
+    }
 
     if ( frag_len > ctx->page_count * FFA_PAGE_SIZE )
         goto out_unlock;
@@ -1272,7 +1308,9 @@ static void handle_mem_share(struct cpu_user_regs *regs)
     if ( ret )
         goto out;
 
+    spin_lock(&ctx->lock);
     list_add_tail(&shm->list, &ctx->shm_list);
+    spin_unlock(&ctx->lock);
 
     uint64_to_regpair(&handle_hi, &handle_lo, shm->handle);
 
@@ -1280,7 +1318,7 @@ out:
     if ( ret )
         free_ffa_shm_mem(ctx, shm);
 out_unlock:
-    spin_unlock(&ctx->lock);
+    spin_unlock(&ctx->tx_lock);
 
 out_set_ret:
     if ( ret == 0)
@@ -1289,6 +1327,18 @@ out_set_ret:
             set_regs_error(regs, ret);
 }
 
+/* Must only be called with ctx->lock held */
+static struct ffa_shm_mem *find_shm_mem(struct ffa_ctx *ctx, uint64_t handle)
+{
+    struct ffa_shm_mem *shm;
+
+    list_for_each_entry(shm, &ctx->shm_list, list)
+        if ( shm->handle == handle )
+            return shm;
+
+    return NULL;
+}
+
 static int handle_mem_reclaim(uint64_t handle, uint32_t flags)
 {
     struct domain *d = current->domain;
@@ -1299,29 +1349,26 @@ static int handle_mem_reclaim(uint64_t handle, uint32_t flags)
     int ret;
 
     spin_lock(&ctx->lock);
-    list_for_each_entry(shm, &ctx->shm_list, list)
-    {
-        if ( shm->handle == handle )
-            goto found_it;
-    }
-    shm = NULL;
-    ret = FFA_RET_INVALID_PARAMETERS;
-    goto out;
-found_it:
+    shm = find_shm_mem(ctx, handle);
+    if ( shm )
+        list_del(&shm->list);
+    spin_unlock(&ctx->lock);
+    if ( !shm )
+        return FFA_RET_INVALID_PARAMETERS;
 
     uint64_to_regpair(&handle_hi, &handle_lo, handle);
     ret = ffa_mem_reclaim(handle_lo, handle_hi, flags);
+
     if ( ret )
     {
-        shm = NULL;
-        goto out;
+        spin_lock(&ctx->lock);
+        list_add_tail(&shm->list, &ctx->shm_list);
+        spin_unlock(&ctx->lock);
+    }
+    else
+    {
+        free_ffa_shm_mem(ctx, shm);
     }
-
-    list_del(&shm->list);
-
-out:
-    free_ffa_shm_mem(ctx, shm);
-    spin_unlock(&ctx->lock);
 
     return ret;
 }
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:16:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:16:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572972.897244 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRod-0007Id-V6; Mon, 31 Jul 2023 12:15:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572972.897244; Mon, 31 Jul 2023 12:15:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRod-0007Gp-CA; Mon, 31 Jul 2023 12:15:59 +0000
Received: by outflank-mailman (input) for mailman id 572972;
 Mon, 31 Jul 2023 12:15: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
 <SRS0=VuP2=DR=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qQRob-0003r6-TN
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:15:57 +0000
Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com
 [2a00:1450:4864:20::12f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 00673a30-2f9c-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 14:15:56 +0200 (CEST)
Received: by mail-lf1-x12f.google.com with SMTP id
 2adb3069b0e04-4fe3c7f16bbso619289e87.0
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 05:15:56 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac2430a000000b004fbb1bc1ae0sm2028077lfh.163.2023.07.31.05.15.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 05:15:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 00673a30-2f9c-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690805755; x=1691410555;
        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=UKqs7nnqnAqZUU+7Ywvxf/RqUSRtJt12JR8UMGzNweA=;
        b=ols1N8y4SdzG4xgNYq24Bjwkmi274DQHDrIhNrjG1U+kWelPknIJwF/LRU++vdHMQc
         Mf3jRxWxi8+zWEyak04fmZSAKClZkrHLj+F+cqR4FZX7U3+wXw/+zOX4GAL+A56uElFD
         T0i44b11AsVDGIVZz4UrtaZeAxZdi3ppfHAKpD3QTCw7rlQsv/unOTUo2hB3SwE9xLvK
         3NtyOa+zzvyzkpjIrw74flofN2Io+gRAEpHQ520WAXXU7PCrrpAAWQoKluD325Gt92iD
         KzxVmzVFoPHY9MCU150TrN5CBsCyxbM5sVBjKUAwKL3cwTiofCm2JVd7s1vGswqEj2uv
         vXYw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690805755; x=1691410555;
        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=UKqs7nnqnAqZUU+7Ywvxf/RqUSRtJt12JR8UMGzNweA=;
        b=K71iDFUvGeOWgEt5FVAQZY+6fYr+O7lH28rYyLVzPDQaesRF7YCYLpuNb/fXW5nqNW
         V+qq2ErzokynwDPGigZucP/a0puJxnnu17X8V4lKUmRv3CXgbotpa3OWmMgf4nyT8E3N
         VRIMkSMjsLRqU3sixgM/ZL5tihsYrACCBjiT8wAqmo/Kdmqx2PMhwInfdHf2lcrdqTcY
         umUQHu3FKW5v/pxflfzr7RIenvZrAswc0l1B5ucIK0EdKv4aH5r3P6jBePWrI+dv48/t
         tm3MwxfDlR6pEL5KdK18rG30BRibBSIdWpLmXJbRfRKEn/NvJ/y0Da7jo1aiZfL2VKZi
         DaMw==
X-Gm-Message-State: ABy/qLZiOk6qFnVLhWTt3Vu6hrSH+oLRzuooc8pXHxRiDe3g4bjuKNDN
	ZvOKgut7OEo5gg6cVee8lJevR9wwbVIr477s3yQ=
X-Google-Smtp-Source: APBJJlFQ8wjatPqFLCOvaNWX8BW9Midq9eZVdN6JmRM/NJRvRDq/8s8JyDoMNFvfobeeWdiIjm7BGw==
X-Received: by 2002:a05:6512:3da0:b0:4f4:c6ab:f119 with SMTP id k32-20020a0565123da000b004f4c6abf119mr6902072lfv.64.1690805755586;
        Mon, 31 Jul 2023 05:15:55 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Bertrand.Marquis@arm.com,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v11 12/14] xen/arm: ffa: list current limitations
Date: Mon, 31 Jul 2023 14:15:34 +0200
Message-Id: <20230731121536.934239-13-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731121536.934239-1-jens.wiklander@linaro.org>
References: <20230731121536.934239-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds comments with a list of unsupported FF-A interfaces and limitations
in the implemented FF-A interfaces.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
v10->v11
- No changes
---
 xen/arch/arm/tee/ffa.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index eb4a58fec470..cfbabec81dd2 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -13,6 +13,37 @@
  *                https://developer.arm.com/documentation/den0077/e
  * TEEC-1.0C: TEE Client API Specification version 1.0c available at
  *            https://globalplatform.org/specs-library/tee-client-api-specification/
+ *
+ * Notes on the the current implementation.
+ *
+ * Unsupported FF-A interfaces:
+ * o FFA_MSG_POLL and FFA_MSG_SEND - deprecated in FF-A-1.1-REL0
+ * o FFA_MEM_RETRIEVE_* - Used when sharing memory from an SP to a VM
+ * o FFA_MEM_DONATE_* and FFA_MEM_LEND_* - Used when tranferring ownership
+ *   or access of a memory region
+ * o FFA_MSG_SEND2 and FFA_MSG_WAIT - Used for indirect messaging
+ * o FFA_MSG_YIELD
+ * o FFA_INTERRUPT - Used to report preemption
+ * o FFA_RUN
+ *
+ * Limitations in the implemented FF-A interfaces:
+ * o FFA_RXTX_MAP_*:
+ *   - Maps only one 4k page as RX and TX buffers
+ *   - Doesn't support forwarding this call on behalf of an endpoint
+ * o FFA_MEM_SHARE_*: only supports sharing
+ *   - from a VM to an SP
+ *   - with one borrower
+ *   - with the memory transaction descriptor in the RX/TX buffer
+ *   - normal memory
+ *   - at most 512 kB large memory regions
+ *   - at most 32 shared memory regions per guest
+ * o FFA_MSG_SEND_DIRECT_REQ:
+ *   - only supported from a VM to an SP
+ *
+ * There are some large locked sections with ffa_tx_buffer_lock and
+ * ffa_rx_buffer_lock. Especially the ffa_tx_buffer_lock spinlock used
+ * around share_shm() is a very large locked section which can let one VM
+ * affect another VM.
  */
 
 #include <xen/bitops.h>
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:16:02 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:16:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572973.897254 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRog-0007zt-3U; Mon, 31 Jul 2023 12:16:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572973.897254; Mon, 31 Jul 2023 12:16:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRof-0007yg-R5; Mon, 31 Jul 2023 12:16:01 +0000
Received: by outflank-mailman (input) for mailman id 572973;
 Mon, 31 Jul 2023 12:15:59 +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
 <SRS0=VuP2=DR=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qQRod-0003r6-IG
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:15:59 +0000
Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com
 [2a00:1450:4864:20::12e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0151d164-2f9c-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 14:15:58 +0200 (CEST)
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-4fe1c285690so5939120e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 05:15:57 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac2430a000000b004fbb1bc1ae0sm2028077lfh.163.2023.07.31.05.15.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 05:15:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0151d164-2f9c-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690805757; x=1691410557;
        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=F6DPe1jvY7rersaps1H4x8200JLUC6kxOQle79BMJ3w=;
        b=YbLBt51bWU+HuvJn0TGGLBvRUUFEFj5hJsHmr2IEOTqZQgX7SG0kfH8Iw81tSDTIEz
         r00BSXSJYyrW4ADR6kcRlxZjKRvqQvK0JXKt+8YfBu0RaByt/FVzj4SrTPNZWXlhoVmc
         JlGd8kzNh/W4NRAZI1vhfDoDfq4k4RnZEJUt4aMDeGaDKqdCRdMBx652qXuYCy83wMrO
         Lyk/vmkgbInZnr4MKRN+8aPFBIxRAJv9+3edSuRAWyqBWpwR7ZMg7ZfFmwrpPMCJByLx
         WALNsJ555CFMF6Zr/teDX3t+Sy3r0wqt6xgy69+of5NUhQ3rqZ0IV23cZc7YVSZBS3ya
         mS8A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690805757; x=1691410557;
        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=F6DPe1jvY7rersaps1H4x8200JLUC6kxOQle79BMJ3w=;
        b=dItDanE+P6xbdcC6YqFIOF0rNKV2fSpUach6GjR8fGq0eYCDsF0PwQfPVp/CV6NxXP
         xPqUdJKwOUzy1vAKY+dnYC1whYzzYT7QqP+A/QO/d81By/j9MW/kYhJP/d1R/gj3w+se
         kdKQaub2sEuJVTJOajLwljBSbcfn7uJbjQAyvZmeuLAbX42Ah2yXRlbsSq3Eg2XFptOy
         Zxh83YSBtS3BfFwHDr7rQGawmCTLG0OOHPCsNb4yjkl5Yi+/uy7GrHLgPUcuHOb/5/9N
         9Bukmd4iThjh6jDGfIUBCyH/sihuP8ASmw9cXYmgTdlqwnpw76yEkkQDE2NaafSIYK0f
         5ucA==
X-Gm-Message-State: ABy/qLbDAU4WMtmjwwFeWlL+afEwbYNMTNFIg2KSG5daVPQCSgZSw4AL
	q/ijnTJi2vhR751n2jV9+chXIwCTaxhcW6+xCso=
X-Google-Smtp-Source: APBJJlFKmXITZt0r4z+c/dlQvrr59iXjr59ZLc8lpfQIsDNZB7RFSH42uxv9CLuKatYEqcpZcBvRFA==
X-Received: by 2002:a05:6512:3e7:b0:4fe:79c:7269 with SMTP id n7-20020a05651203e700b004fe079c7269mr5159360lfq.67.1690805756910;
        Mon, 31 Jul 2023 05:15:56 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Bertrand.Marquis@arm.com,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Henry Wang <Henry.Wang@arm.com>
Subject: [XEN PATCH v11 13/14] tools: add Arm FF-A mediator
Date: Mon, 31 Jul 2023 14:15:35 +0200
Message-Id: <20230731121536.934239-14-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731121536.934239-1-jens.wiklander@linaro.org>
References: <20230731121536.934239-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Adds a new "ffa" value to the Enumeration "tee_type" to indicate if a
guest is trusted to use FF-A.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
v10->v11
- No changes
---
 tools/include/libxl.h            | 5 +++++
 tools/libs/light/libxl_arm.c     | 3 +++
 tools/libs/light/libxl_types.idl | 3 ++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/tools/include/libxl.h b/tools/include/libxl.h
index f3975ecc021f..bcf290de2446 100644
--- a/tools/include/libxl.h
+++ b/tools/include/libxl.h
@@ -283,6 +283,11 @@
  */
 #define LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE 1
 
+/*
+ * arch_arm.tee field in libxl_domain_build_info has ffa value.
+ */
+#define LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE_FFA 1
+
 /*
  * libxl_domain_build_info has the arch_arm.sve_vl field.
  */
diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
index f98e1affa294..15391917748c 100644
--- a/tools/libs/light/libxl_arm.c
+++ b/tools/libs/light/libxl_arm.c
@@ -207,6 +207,9 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
     case LIBXL_TEE_TYPE_OPTEE:
         config->arch.tee_type = XEN_DOMCTL_CONFIG_TEE_OPTEE;
         break;
+    case LIBXL_TEE_TYPE_FFA:
+        config->arch.tee_type = XEN_DOMCTL_CONFIG_TEE_FFA;
+        break;
     default:
         LOG(ERROR, "Unknown TEE type %d",
             d_config->b_info.tee);
diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
index b524d1578bd1..3bd66291afd4 100644
--- a/tools/libs/light/libxl_types.idl
+++ b/tools/libs/light/libxl_types.idl
@@ -520,7 +520,8 @@ libxl_gic_version = Enumeration("gic_version", [
 
 libxl_tee_type = Enumeration("tee_type", [
     (0, "none"),
-    (1, "optee")
+    (1, "optee"),
+    (2, "ffa"),
     ], init_val = "LIBXL_TEE_TYPE_NONE")
 
 libxl_sve_type = Enumeration("sve_type", [
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:16:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:16:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.572974.897259 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRog-00087y-V4; Mon, 31 Jul 2023 12:16:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 572974.897259; Mon, 31 Jul 2023 12:16:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQRog-00086U-Hr; Mon, 31 Jul 2023 12:16:02 +0000
Received: by outflank-mailman (input) for mailman id 572974;
 Mon, 31 Jul 2023 12:16:00 +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
 <SRS0=VuP2=DR=linaro.org=jens.wiklander@srs-se1.protection.inumbo.net>)
 id 1qQRoe-0003r6-JW
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:16:00 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 01f72e92-2f9c-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 14:15:59 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-4fe10f0f4d1so7287058e87.0
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 05:15:59 -0700 (PDT)
Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se.
 [46.59.78.111]) by smtp.gmail.com with ESMTPSA id
 l10-20020ac2430a000000b004fbb1bc1ae0sm2028077lfh.163.2023.07.31.05.15.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 05:15:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 01f72e92-2f9c-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1690805758; x=1691410558;
        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=gBs/FDkfYRgoPZr2GGaB11R97tPaKWbGqww2/VGZEhE=;
        b=mv6YspaDGeTi1WqN/SF31Z9c0+2y2PjHwqOv8iuM7N/eeNiBiSCC32vrqtXwnz7KUe
         z789FZY9VMV9eG/mcjtCNNHdeOp68HifeHRV5FRxCjuf/sV7Ly01q0OhT4qQC5Yjd2m+
         61wDbDACiqCaj8henceKNoRzaUV/7pGEBqTycamtITwEQuoLh4tupRelkonSXxhYb/3g
         NHlCBN+1RZg9Hx1+B7hOgUUIPYR3xy7n1wjbFiRVkpReyOTsIt0JdK0/dqFeywps6pV4
         hX0muTBmlrXCl4lpm4dO4wyhjqX4axiB5LB5w5VKH08wDRlupW5Rt2tan5tIdWaTCZDl
         hdSw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690805758; x=1691410558;
        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=gBs/FDkfYRgoPZr2GGaB11R97tPaKWbGqww2/VGZEhE=;
        b=PDDBG9nY2P+UiXDbsV7Ec2jGkw4qKX/mVNoppthWroX0sNCOiIrszQcfErx9N3CXuy
         76Cw7zgsIu2ije9bl1Es0Cpz99K4Y3G7Km9RVp++5l5ZAfPu0rD+hH06vRshNxL9ZjKX
         hBM2OehhIOV66WW1B9e1m/Gwe6ZL+IISJk29wPuFjbqdL9T36c3K+hGzOvcqBNIHOB9G
         kfuKS15v+rPMmhjwrGAscqyAR4rl8tla4JJ0Xv2oxcbGRrTSh2zJHcNOhYvI+G4W9v0g
         XXt/H8cZTiGZo+Eyz4iLJQ4WXZyKTTyXGmAGy71ygFGKP4mg0syWZPL6oOUvKkLivdhd
         kN1w==
X-Gm-Message-State: ABy/qLYpHpXGXgx3+Q+VJx5cbQ8RuECrWqXk7C0kbGpSfcy/ngO6b1h7
	W+7i3+ryVw/twsN/dRzN1OJ7UPOuulLsvfGEFIM=
X-Google-Smtp-Source: APBJJlFHWP4N4SZZJsNudSOwkqOQW2CE9qoDGOLMrNEzkNM/i1gHC1PN5lQuy06JIsqlbb9MmrCm9w==
X-Received: by 2002:a05:6512:3086:b0:4fe:629:9265 with SMTP id z6-20020a056512308600b004fe06299265mr7181260lfd.20.1690805758289;
        Mon, 31 Jul 2023 05:15:58 -0700 (PDT)
From: Jens Wiklander <jens.wiklander@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Bertrand.Marquis@arm.com,
	Marc Bonnici <marc.bonnici@arm.com>,
	Achin Gupta <achin.gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Henry Wang <Henry.Wang@arm.com>,
	Community Manager <community.manager@xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [XEN PATCH v11 14/14] docs: add Arm FF-A mediator
Date: Mon, 31 Jul 2023 14:15:36 +0200
Message-Id: <20230731121536.934239-15-jens.wiklander@linaro.org>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20230731121536.934239-1-jens.wiklander@linaro.org>
References: <20230731121536.934239-1-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Describes a FF-A version 1.1 [1] mediator to communicate with a Secure
Partition in secure world.

[1] https://developer.arm.com/documentation/den0077/latest
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
---
v10->v11
- Add a CHANGELOG.md entry as requested
---
 CHANGELOG.md             |  3 ++-
 SUPPORT.md               |  9 +++++++++
 docs/man/xl.cfg.5.pod.in | 15 +++++++++++++++
 3 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7d7e0590f8c6..f24c8c4b8011 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -24,7 +24,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - xl/libxl can customize SMBIOS strings for HVM guests.
  - Add support for AVX512-FP16 on x86.
  - On Arm, Xen supports guests running SVE/SVE2 instructions. (Tech Preview)
-
+ - On Arm, add suport for Firmware Framework for Arm A-profile (FF-A) Mediator
+   (Tech Preview)
 
 ## [4.17.0](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.17.0) - 2022-12-12
 
diff --git a/SUPPORT.md b/SUPPORT.md
index 35a6249e03b2..fe512762cee7 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -840,6 +840,15 @@ that covers the DMA of the device to be passed through.
 
 No support for QEMU backends in a 16K or 64K domain.
 
+### ARM: Firmware Framework for Arm A-profile (FF-A) Mediator
+
+    Status, Arm64: Tech Preview
+
+There are still some code paths where a vCPU may hog a pCPU longer than
+necessary. The FF-A mediator is not yet implemented for Arm32. Part of the
+FF-A specification is not supported, see the top comment in
+xen/arch/arm/tee/ffa.c for limitations.
+
 ### ARM: Guest Device Tree support
 
     Status: Supported
diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index a2bccd5b48a1..ec4864958e0e 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -1656,6 +1656,21 @@ in OP-TEE.
 
 This feature is a B<technology preview>.
 
+=item B<ffa>
+
+B<Arm only.> Allow a guest to communicate via FF-A with Secure Partitions
+(SP), default false.
+
+Currently only a small subset of the FF-A specification is supported. Just
+enough to communicate with OP-TEE. In general only direct messaging and
+sharing memory with one SP. More advanced use cases where memory might be
+shared or donated to multiple SPs are not supported.
+
+See L<https://developer.arm.com/documentation/den0077/latest> for more
+information about FF-A.
+
+This feature is a B<technology preview>.
+
 =back
 
 =back
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:44:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:44:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573014.897278 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQSGA-0006i0-30; Mon, 31 Jul 2023 12:44:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573014.897278; Mon, 31 Jul 2023 12:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQSGA-0006ht-06; Mon, 31 Jul 2023 12:44:26 +0000
Received: by outflank-mailman (input) for mailman id 573014;
 Mon, 31 Jul 2023 12:44:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=IyhG=DR=citrix.com=prvs=569984122=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qQSG8-0006hn-LO
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:44:24 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f867b180-2f9f-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 14:44:22 +0200 (CEST)
Received: from mail-mw2nam12lp2044.outbound.protection.outlook.com (HELO
 NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.44])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 31 Jul 2023 08:44:15 -0400
Received: from BN7PR03MB3618.namprd03.prod.outlook.com (2603:10b6:406:c3::27)
 by CO1PR03MB5842.namprd03.prod.outlook.com (2603:10b6:303:91::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.39; Mon, 31 Jul
 2023 12:44:13 +0000
Received: from BN7PR03MB3618.namprd03.prod.outlook.com
 ([fe80::8f94:c73a:ffb7:d5e2]) by BN7PR03MB3618.namprd03.prod.outlook.com
 ([fe80::8f94:c73a:ffb7:d5e2%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 12:44:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f867b180-2f9f-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690807462;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=emVDaaBqIiaQjKRu3X1nnwThapZcw7c8p021hUKDC84=;
  b=JNN9whZmaDgw4X9ozsuhrEjPhjvV+bHEx9RrFutWcbpk2dVTnStPyQpm
   4P7ZMRd/8jvkoY0fCaqEnIiBPT39ujpaJ2mrkHEZGtkgEEjpjH2JdTKKq
   zL8nH/KbkoecB68KA/tYUEtJi4AoJLMwBPJctTHnQXvPbMcyITudZYJAL
   Q=;
X-IronPort-RemoteIP: 104.47.66.44
X-IronPort-MID: 117999542
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:3pp8saPxYnJZa6TvrR2IlsFynXyQoLVcMsEvi/4bfWQNrUp31WAFy
 mQXCD/UbPiLYmXwKNhwbtyyphwOucOHm9I3GQto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v
 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/
 Nj/uKUzAnf8s9JPGjxSs/vrRC9H5qyo42tH5QVmPJingXeF/5UrJMNHTU2OByOQrrl8RoaSW
 +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ
 HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0rcwMH9Mx
 d0IEitXc0DSjsK40JKZSuY506zPLOGzVG8ekldJ6GiDSNMZG9XESaiM4sJE1jAtgMwIBezZe
 8cSdTtoalLHfgFLPVAUTpk5mY9EhFGmK2Ee9A3T+/RxvzS7IA9ZidABNPL8fNCQSNoTtUGfv
 m/cpEzyAw0ANczZwj2Amp6prraWwnKqCd9OTtVU8NZ6w0ed9lQjGCEfVGGGhfSk03SSBtxAf
 hl8Fi0G6PJaGFaQZtv3UgC8oXWElgUBQNcWGOo/gCmSzoLE7gDfAXILJhZRZdpjuMIoSDgC0
 l6Sg8ivFTFpqKeSS3+W6vGTtzzaBMQOBWoLZCtBSBRf5dDm+ds3lkiXEoolF7OphNroHz222
 yqNsCU1m7QUi4gMyrm/+lfExTmro/AlUzII2+keZUr9hisRWWJvT9b0gbQHxZ6s9Lqkc2Q=
IronPort-HdrOrdr: A9a23:/+At7KHIyK+uOCB1pLqF7JLXdLJyesId70hD6qkvc3Fom52j/f
 xGws5x6fatskdrZJkh8erwW5VoMkmsj6KdgLNhdotKOTOLhILGFvAE0WKP+Vzd8mjFh5ZgPM
 RbAuJD4b/LfD5HZK/BiWHWferIguP3iZxA7t2urUuFODsaD52ImD0JbzpzfHcXeCB2Qb4CUL
 aM7MtOoDStPVwRc8SAH3EAG8TTutHRk5riQBgeQzoq8hOHgz+E4KPzV0Hw5GZTbxp/hZMZtU
 TVmQ3w4auu99m91x/nzmfWq7hGhdf7zdNHJcqUzuwYMC/lhAqEbJloH5eCoDc2iuey70tCqq
 iAnz4Qe+BIr1/BdGC8phXgnyP61iw11nPkwViExVP+vM3QXlsBeoR8rLMcViGcx1srvdl63q
 4O9XmerYBrARTJmzm4z8TUVittilG/rRMZ4K8uZj1kIMsjgY1q3M4iFXBuYdI99eXBmcQa+d
 xVfYLhDTBtABSnhj7izy9SKZeXLwkO91+9MzQ/U4quondrdTlCvjQl7d1akXEa+J0nTZ5Yo+
 zCL6RzjblLCtQbdKRnGY46ML2K40H2MGbx2VipUCPaPbBCP2iIp4/84b0z6u3vcJsUzIEqkJ
 CEVF9Dr2Y9d0/nFMXLhfRwg1jwaXT4WS6oxtBV5pB/tLG5TL33MTebQFRrl8e7uf0QDsDSRv
 72MpNLBP3oK3foBO9yrkTDcogXLWNbXNweu949VV7LqsXXKpfyvuiea/rXLKqFK0dQZoo+OA
 pwYNHeHrQx0qnwYA6HvPH4YQKdRmXvuZRtDaPd4+8fjIAQK4wkiHlntWiE
X-Talos-CUID: 9a23:xb8xe2NH5jS9Ju5DCW5W6kwkO9AfaSfAnCbZA0GoKURpR+jA
X-Talos-MUID: 9a23:GYhdwQaww6PseOBTp3z2igFaBNdU6qWUNWQAjMw8l5SKKnkl
X-IronPort-AV: E=Sophos;i="6.01,244,1684814400"; 
   d="scan'208";a="117999542"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=FdWa7fvBnA+Uypoccfsc6BlmPmSCYH43i1gKvP434zvPxzVcp8fPEEDoB/uRvGQK4FnFk5ARApjKDs1yvlK9oh+rQJwfAaPYUq+ZVvsMcO4UatWf9T/nLeXOt/ndtJzOp+hCwvPmk/ek0o1FuGCxib6rE1wVJuKeGrTHFbROXISkoUInlBQaDH/K8RkJ1D1gh77TlMqbB82ZA7h3otZw0NEvLQcSuqIBHGDKct85vukAszQz/ZeqcnRTRaFQI9VJ1vCYcJUrjiCHiuJIC70l3Kr7CNhL2i7yhlO/l3Bjf3yQoxYMl9vfB7FNQ6y3hBp6uuazdRO0xlx3P/6Pg6a3rQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=r3mYORBVnl9GVHjSnNYRrpVzPeNQcXTJFnKSyKmMH80=;
 b=EaDFa7Hh2A+gYP0wTCaZuGtiSo6wK6LLG+Taq6iID797FnCB6KievWJ2hAYwiIPYgty2EYhUlKXWO1s25EVYlzNFdSiWQn3xazRLY5ZdGp34D8CLc+TGgBp5Ywqmavw9x6k7DhSbTDAKyrd5CHaJeuiiMNCPR7oLsi5briKBHr0E/3GYQOmIsdaqtNiTWnzX4OalwMw1vUfto3iqoNvMziqirYyU7prNyw8IoP7cZmGR96jXsrTi2cIM3CcMAdkH7tVD7ySpRsks5p/znv9iP48BgC/GDpvLO/j0pfUcHzqRX35wVXRQ/E30oqJT52JCmaB6V3AKlb9sS0mWssqnHg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=r3mYORBVnl9GVHjSnNYRrpVzPeNQcXTJFnKSyKmMH80=;
 b=H1S9SFcyk58mjY4sG7jI6ypJ25ztiTlBJyQJdXLOZ1LK9cHSBAE4Y8++KcgnAwsZR3pzW0QW3nTW/9AH+jvcJdNwLyrngwP792NUoAMt8yWIee5D/BDv8NplDJApYB1L9gziS/4mJDcHsiY5EmjeKlYANfX2pplzMskxaxxZm54=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <564767f3-73b4-57c2-0ae9-fb606180bb78@citrix.com>
Date: Mon, 31 Jul 2023 13:44:08 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH] x86/amd: Fix DE_CFG truncation in amd_check_zenbleed()
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
References: <20230728181730.3065977-1-andrew.cooper3@citrix.com>
 <de599aa6-f266-8720-71eb-a5425f9d098c@suse.com>
In-Reply-To: <de599aa6-f266-8720-71eb-a5425f9d098c@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0135.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2c4::10) To BN7PR03MB3618.namprd03.prod.outlook.com
 (2603:10b6:406:c3::27)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN7PR03MB3618:EE_|CO1PR03MB5842:EE_
X-MS-Office365-Filtering-Correlation-Id: 6bc7c0ab-3cb8-4669-360e-08db91c3d7df
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	tXlNhvbB5ARPC6Ran3kC5LyC28FgYK5kqcX7RkOl5XRPu/7/Zr/0V9cCp3Kqzz3MFeOF1IqG5foHDmZT18i/2mbF1ABGNN0agLG5/l9baNgrBhiKH2fjMn5zDDA6T69qxr/vBjPTKcvxsD8YI+b3T1ErpHhdpJBjFO0T71KBKifoKKG8OeMuAoHlKiEGp0uAxMIFQoxa9lCqgGtL+HuioN7OsxtqVe6Zg5ABnans2j9GDwM9xN7TzyXmr5JmYkg02g589AGHjKvDKNGK6olZvkKMwx49JbCVXQ/3/cJtICw1eUyz/BFbJHJUftxWAOdG1Zc7/g8Qdgjz5g3BI/F31fEJ+KmAsJBK9UXu0f5sD0S+56KJWNa0rqtgJZuCdLZlNZEVleam2bLZMvg7lHDqcT4cnmgCei+61icZU7GUNN2odHpEbhprquqQXBb4x9TOR/Af6RIHB4Lt0PWFmRi3JsM42/arxAQdFKdZLD2fJSilgamz0MvgS+7ete4m2TkV+MUjlRcS9dj4I+cdonH+/JpwyFYCxcj8jQW+Ao+CxQ3V8HIVSWtjlESo+VU+UUw5hToPnncW7Y5d4LNIzgLAuhMMId4f5xjrJJIAlEF606LTCtMglHsJX7z5JvhFbrG3pC832O+WbU44La1vzpuyVg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN7PR03MB3618.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(346002)(39860400002)(366004)(136003)(451199021)(31696002)(66476007)(86362001)(31686004)(8676002)(8936002)(316002)(6916009)(4326008)(5660300002)(41300700001)(66946007)(66556008)(54906003)(82960400001)(38100700002)(478600001)(2906002)(6666004)(36756003)(6512007)(6486002)(6506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zScOyye0Vsyl0oS8OrOAF6EBKQQcRrDEtD1/dikLPwc5HEJ30YjN86Rsd+W5lTIljdoE343aELqd2Xlm/st9W5kxeEF54Dqe/Zq4aiD9B/wdyrKhMfLjVksz66VZJMdgIin1HUEiraJLi6v4goAo6PNWAZA2gnqilJqhhgOuj6GQm5nNmHNGLB7Mk29X7/HuHlhHixM0CDKDacP9djj+4RMI2rBL0ju/7+qEyUd8b6zW43kPtLZYn22B9Kr5wbRoMHugnyq4llPwqrwF7Ug9w8NRON/bOSr/o8B5Ez7Nml2Gz1UaJJ9YRJ0Xszz48g4ChUQfkNd0LNlNJlhKO9YoXsEcAoNwVwpss7UY3G+aaW+8uJJumbwHiVHu4wDLmRUURU+O3mcCicnb6iRWYZjzUJgi5fva+RPvBtviDB6dZr6G6Wj4TQvGHQJdsz4IEgvRUgYlfrdXOy5kqZskl99gnFmDg4Cn+B18ulLAsJmhrqJQg85e86p9I4n3uXz3gHkrI/xt2BfBm8RQdWligG+tQ==
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6bc7c0ab-3cb8-4669-360e-08db91c3d7df
X-MS-Exchange-CrossTenant-AuthSource: BN7PR03MB3618.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 12:44:13.1908
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: sEhA4nw41f/UZWVYOzy+G/1cTLpq9N6aRLrR66M5GaozFRib/drc90RDxkFeRW5plvHXsrhMOlZB88c5zmIx/x5CH99VT1Oi++1MBFc6BME=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR03MB5842

On 31/07/2023 10:02 am, Jan Beulich wrote:
> On 28.07.2023 20:17, Andrew Cooper wrote:
>> This line:
>>
>> 	val &= ~chickenbit;
>>
>> ends up truncating val to 32 bits, and turning off various errata workarounds
>> in Zen2 systems.
>>
>> Fixes: f91c5ea97067 ("x86/amd: Mitigations for Zenbleed")
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Jan Beulich <JBeulich@suse.com>
>> CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
>> CC: Wei Liu <wl@xen.org>
>>
>> The choice is between int or uint64_t.  This is one case where the insistence
>> on using unsigned int as a default data type is genuinely unsafe.
> It is not. The (unsigned) type should have been wide enough. From a Misra
> perspective I'm pretty sure we would be better off using uint64_t. But in
> the interest of getting this in without a lot of discussion I'll leave the
> decision up to you; either way
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Roger asked for uint64_t too so I'll go with that.Â  Thanks.

~Andrew


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:46:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:46:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573017.897288 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQSHp-0007Kn-Ia; Mon, 31 Jul 2023 12:46:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573017.897288; Mon, 31 Jul 2023 12:46:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQSHp-0007Kg-FX; Mon, 31 Jul 2023 12:46:09 +0000
Received: by outflank-mailman (input) for mailman id 573017;
 Mon, 31 Jul 2023 12:46:08 +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
 <SRS0=GapS=DR=citrix.com=prvs=569ba324e=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qQSHo-0007Ka-RL
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:46:08 +0000
Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com
 [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 362ebaac-2fa0-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 14:46:06 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 362ebaac-2fa0-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690807566;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=ZDsx+7dK7eVNKtG9oC04HPXrXQEWrqokjiUX1FdE9H8=;
  b=iEaiu0RFFvZENM9FYPUFS1vfcYIY8dmYP/it635K1UB6iKTkzBimvMD8
   HbP830zpielmXqYNU+t1i/CmkuQ+qpj4kN344SkfiQDS2x7b4X7FupGas
   iSLsYycJrhrNt32RX7axtLrwl6capgJUVgEJaa0FYUqeHX8mhWFOmvlbo
   o=;
Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 117862139
X-Ironport-Server: esa2.hc3370-68.iphmx.com
X-Remote-I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aUdvxxlPCKsoW4WrIDa72wB28uVZ1TC7EEOxVWLdigw1Q0U9lnOk22
 4wFXydy408DONASmwGOmWLpEXgELGIgGbf9oNFNe+iIL2JOQT9wU6CNm+t9J9Q9w8y5c9skG
 VnkCydlJKfX3yWbeW1mlFg9AF8QYXqPhS1iZnF9VbpZ83MifZyu/M8im2gfJNEaGBhY5acsF
 ZEtIpzQasmjvxybo1zxm7Gh9t09HPlq7CrSVxeYjM8XJMI8HVKUpo+/L2MCNkAmV0KKiCf3m
 JX4viuzfHbJb14K4Br+AB53826MgA==
IronPort-HdrOrdr: A9a23:lzWVQa8Gh1Y2l6PDP5huk+AcI+orL9Y04lQ7vn2ZKSY5TiX4rb
 HKoB1/73XJYVkqN03I9ervBEDiewK/yXcW2+ks1N6ZNWGLhILBFupfBODZsl7d8kPFl9K01c
 1bAtJD4N+bNykGsS4tijPIb+rJw7O8gd+Vbf+19QYIcenzAZsQlzuQDGygYypLbTgDP7UVPr
 yG6PFKojKxEE5nFfhSVhE+Lo7+T8SgruOeXSI7
X-Talos-CUID: =?us-ascii?q?9a23=3At8ePGmtCUM5gdCmcT9HKuV7Y6IslKUP44G/pE3S?=
 =?us-ascii?q?TLkVFZ+yWCmeXwP1rxp8=3D?=
X-Talos-MUID: 9a23:9C/AdASlzPY0DHZSRXS0nA5kOZxM6p+MN08qyMoW/O68GChZbmI=
X-IronPort-AV: E=Sophos;i="6.01,244,1684814400"; 
   d="scan'208";a="117862139"
Date: Mon, 31 Jul 2023 13:45:59 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: <xen-devel@lists.xenproject.org>, <Bertrand.Marquis@arm.com>, Marc Bonnici
	<marc.bonnici@arm.com>, Achin Gupta <achin.gupta@arm.com>, Wei Liu
	<wl@xen.org>, Juergen Gross <jgross@suse.com>, Henry Wang
	<Henry.Wang@arm.com>
Subject: Re: [XEN PATCH v11 13/14] tools: add Arm FF-A mediator
Message-ID: <1f570857-fad2-46d4-b2d6-992d424e53f3@perard>
References: <20230731121536.934239-1-jens.wiklander@linaro.org>
 <20230731121536.934239-14-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230731121536.934239-14-jens.wiklander@linaro.org>

On Mon, Jul 31, 2023 at 02:15:35PM +0200, Jens Wiklander wrote:
> Adds a new "ffa" value to the Enumeration "tee_type" to indicate if a
> guest is trusted to use FF-A.
> 
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
> Reviewed-by: Henry Wang <Henry.Wang@arm.com>

Acked-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 12:50:18 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 12:50:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573021.897298 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQSLg-0000MF-1x; Mon, 31 Jul 2023 12:50:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573021.897298; Mon, 31 Jul 2023 12:50:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQSLf-0000M8-Ve; Mon, 31 Jul 2023 12:50:07 +0000
Received: by outflank-mailman (input) for mailman id 573021;
 Mon, 31 Jul 2023 12:50:06 +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
 <SRS0=GapS=DR=citrix.com=prvs=569ba324e=anthony.perard@srs-se1.protection.inumbo.net>)
 id 1qQSLe-0000Gd-Tz
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 12:50:06 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c3da3fa5-2fa0-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 14:50:04 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c3da3fa5-2fa0-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690807804;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=Unbn19XrOpybsJgn0zNxrn8PEN9ry2yGxsmuxT8Tn1Q=;
  b=HQWTqblhBdx3TEu+NdOEFHrhhc6gc+UyKzZb4O+1jfgkvkDFRDuPiCD5
   ZvP0rUVBdY9SLnXSP3MAQ85RizJ+Tgh8xpMghrSFnEz4oFFb+bvkYB1d6
   6ZOJIMRGXh6ejcxUb4fhfgTFcC7pjQDLcLAnuS1/Wa0T4KoTOIJ0riZfi
   E=;
Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
X-SBRS: 4.0
X-MesageID: 116676850
X-Ironport-Server: esa5.hc3370-68.iphmx.com
X-Remote-IP: 162.221.156.123
X-Policy: $RELAYED
IronPort-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8/aavZke1YooHPw7bBgwm159osDk54
 v4GaZrSlE4ODbanCsXE2dVNdA5XdBDXEbiz8pUKLbDbf2KKDUl7U5fsLaUdl5uJdki/vsPB5
 TmDV0BR0zITblWXeFzROhiPhF4CNKuTTE7X3gR2Zz5EI1B5Pe6SAF43LvPbh4UP+u151uJTR
 PIYYciGCfknYm2ZqmxCMcOl8NA6LEjDaeey082NOWlXQnKdb1aRpo+MkvXHqkHi8RZbReNh+
 ub9h2s3sLIIRhh4Dda+VR5c5wrZgJTpo8orBxGgCoAKKC3RHH1Cd3SZYgkff5tddn0uB1Kyi
 26rPPvvjbKR/9VrrYWZ3vHsQkXAO7IWI3e21lLztd6eXRQ2NEL6qWOceI5kpQzgaV4=
IronPort-HdrOrdr: A9a23:9JXgRq5NUlDSZvmk/APXwPLXdLJyesId70hD6qkmc20zTiX+rb
 HMoB1773/JYVkqM03I9errBEDiexLhHPxOjrX5Zo3SODUO0VHARL2Ki7GO/9SKIUPDH4BmuZ
 uJ3MJFebvN5fQRt7eZ3OEYeexQpeW6zA==
X-Talos-CUID: =?us-ascii?q?9a23=3ARNBcWGh26HdRXkxwu3Qhi1lMFDJuY1TRlEXcO16?=
 =?us-ascii?q?CMntyZKGkS2aw055mnJ87?=
X-Talos-MUID: 9a23:7hdolAoYTyeQIC3wDvwezytaOcs447myNFgmsIhcq5WFLhUoCQ7I2Q==
X-IronPort-AV: E=Sophos;i="6.01,244,1684814400"; 
   d="scan'208";a="116676850"
Date: Mon, 31 Jul 2023 13:49:47 +0100
From: Anthony PERARD <anthony.perard@citrix.com>
To: Jens Wiklander <jens.wiklander@linaro.org>
CC: <xen-devel@lists.xenproject.org>, <Bertrand.Marquis@arm.com>, Marc Bonnici
	<marc.bonnici@arm.com>, Achin Gupta <achin.gupta@arm.com>, Henry Wang
	<Henry.Wang@arm.com>, Community Manager <community.manager@xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap
	<george.dunlap@citrix.com>, Jan Beulich <jbeulich@suse.com>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Wei Liu
	<wl@xen.org>
Subject: Re: [XEN PATCH v11 14/14] docs: add Arm FF-A mediator
Message-ID: <00c663c9-4604-4162-bae0-ab229ee450fb@perard>
References: <20230731121536.934239-1-jens.wiklander@linaro.org>
 <20230731121536.934239-15-jens.wiklander@linaro.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230731121536.934239-15-jens.wiklander@linaro.org>

On Mon, Jul 31, 2023 at 02:15:36PM +0200, Jens Wiklander wrote:
> Describes a FF-A version 1.1 [1] mediator to communicate with a Secure
> Partition in secure world.
> 
> [1] https://developer.arm.com/documentation/den0077/latest
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> Reviewed-by: Henry Wang <Henry.Wang@arm.com>

Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 13:02:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 13:02:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573027.897318 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQSY6-0002AW-CQ; Mon, 31 Jul 2023 13:02:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573027.897318; Mon, 31 Jul 2023 13:02:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQSY6-0002AP-9e; Mon, 31 Jul 2023 13:02:58 +0000
Received: by outflank-mailman (input) for mailman id 573027;
 Mon, 31 Jul 2023 13:02:57 +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
 <SRS0=Lm7y=DR=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qQSY4-0002A2-Vr
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 13:02:56 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8ff88595-2fa2-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 15:02:54 +0200 (CEST)
Received: from Dell.homenet.telecomitalia.it
 (host-79-23-62-117.retail.telecomitalia.it [79.23.62.117])
 by support.bugseng.com (Postfix) with ESMTPSA id 7460F4EE073F;
 Mon, 31 Jul 2023 15:02:53 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8ff88595-2fa2-11ee-8613-37d641c3527e
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH v3] xen/IRQ: address violations of MISRA C: 2012 Rules 8.2 and 8.3
Date: Mon, 31 Jul 2023 15:02:45 +0200
Message-Id: <c07d2a38fa296e42f9d089553f9c6b1d916dbbe3.1690807908.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Give a name to unnamed parameters thus addressing violations of
MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
named parameters").
Keep consistency between parameter names and types used in function
declarations and the ones used in the corresponding function
definitions, thus addressing violations of MISRA C:2012 Rule 8.3
("All declarations of an object or function shall use the same names
and type qualifiers").

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
Changes in v3:
  - uniformed parameter names between arm and x86 for irq_set_affinity().
---
Changes in v2:
  - use 'pirq' instead of 'irq';
  - removed changes involving function pointers.
---
 xen/arch/arm/include/asm/irq.h |  2 +-
 xen/arch/arm/irq.c             |  6 ++---
 xen/include/xen/irq.h          | 41 +++++++++++++++++-----------------
 xen/include/xen/softirq.h      |  2 +-
 4 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/xen/arch/arm/include/asm/irq.h b/xen/arch/arm/include/asm/irq.h
index 105b33b37d..c8044b0371 100644
--- a/xen/arch/arm/include/asm/irq.h
+++ b/xen/arch/arm/include/asm/irq.h
@@ -91,7 +91,7 @@ int platform_get_irq(const struct dt_device_node *device, int index);
 
 int platform_get_irq_byname(const struct dt_device_node *np, const char *name);
 
-void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask);
+void irq_set_affinity(struct irq_desc *desc, const cpumask_t *mask);
 
 /*
  * Use this helper in places that need to know whether the IRQ type is
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 16e56f8945..09648db17a 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -58,7 +58,7 @@ hw_irq_controller no_irq_type = {
 static irq_desc_t irq_desc[NR_IRQS];
 static DEFINE_PER_CPU(irq_desc_t[NR_LOCAL_IRQS], local_irq_desc);
 
-irq_desc_t *__irq_to_desc(int irq)
+struct irq_desc *__irq_to_desc(int irq)
 {
     if ( irq < NR_LOCAL_IRQS )
         return &this_cpu(local_irq_desc)[irq];
@@ -175,10 +175,10 @@ static inline struct domain *irq_get_domain(struct irq_desc *desc)
     return irq_get_guest_info(desc)->d;
 }
 
-void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask)
+void irq_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
 {
     if ( desc != NULL )
-        desc->handler->set_affinity(desc, cpu_mask);
+        desc->handler->set_affinity(desc, mask);
 }
 
 int request_irq(unsigned int irq, unsigned int irqflags,
diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index 300625e56d..9747e818f7 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -110,22 +110,22 @@ typedef struct irq_desc {
 #define irq_to_desc(irq)    (&irq_desc[irq])
 #endif
 
-int init_one_irq_desc(struct irq_desc *);
-int arch_init_one_irq_desc(struct irq_desc *);
+int init_one_irq_desc(struct irq_desc *desc);
+int arch_init_one_irq_desc(struct irq_desc *desc);
 
 #define irq_desc_initialized(desc) ((desc)->handler != NULL)
 
 extern int setup_irq(unsigned int irq, unsigned int irqflags,
-                     struct irqaction *);
+                     struct irqaction *new);
 extern void release_irq(unsigned int irq, const void *dev_id);
 extern int request_irq(unsigned int irq, unsigned int irqflags,
                void (*handler)(int, void *, struct cpu_user_regs *),
-               const char * devname, void *dev_id);
+               const char *devname, void *dev_id);
 
 extern hw_irq_controller no_irq_type;
 void cf_check no_action(int cpl, void *dev_id, struct cpu_user_regs *regs);
-unsigned int cf_check irq_startup_none(struct irq_desc *);
-void cf_check irq_actor_none(struct irq_desc *);
+unsigned int cf_check irq_startup_none(struct irq_desc *desc);
+void cf_check irq_actor_none(struct irq_desc *desc);
 #define irq_shutdown_none irq_actor_none
 #define irq_disable_none irq_actor_none
 #define irq_enable_none irq_actor_none
@@ -146,7 +146,7 @@ struct pirq {
 #define pirq_info(d, p) ((struct pirq *)radix_tree_lookup(&(d)->pirq_tree, p))
 
 /* Use this instead of pirq_info() if the structure may need allocating. */
-extern struct pirq *pirq_get_info(struct domain *, int pirq);
+extern struct pirq *pirq_get_info(struct domain *d, int pirq);
 
 #define pirq_field(d, p, f, def) ({ \
     const struct pirq *__pi = pirq_info(d, p); \
@@ -155,30 +155,31 @@ extern struct pirq *pirq_get_info(struct domain *, int pirq);
 #define pirq_to_evtchn(d, pirq) pirq_field(d, pirq, evtchn, 0)
 #define pirq_masked(d, pirq) pirq_field(d, pirq, masked, 0)
 
-void pirq_cleanup_check(struct pirq *, struct domain *);
+void pirq_cleanup_check(struct pirq *pirq, struct domain *d);
 
 #define pirq_cleanup_check(pirq, d) \
     ((pirq)->evtchn ? pirq_cleanup_check(pirq, d) : (void)0)
 
-extern void pirq_guest_eoi(struct pirq *);
-extern void desc_guest_eoi(struct irq_desc *, struct pirq *);
+extern void pirq_guest_eoi(struct pirq *pirq);
+extern void desc_guest_eoi(struct irq_desc *desc, struct pirq *pirq);
 extern int pirq_guest_unmask(struct domain *d);
-extern int pirq_guest_bind(struct vcpu *, struct pirq *, int will_share);
-extern void pirq_guest_unbind(struct domain *d, struct pirq *);
-extern void pirq_set_affinity(struct domain *d, int irq, const cpumask_t *);
-extern irq_desc_t *domain_spin_lock_irq_desc(
-    struct domain *d, int irq, unsigned long *pflags);
-extern irq_desc_t *pirq_spin_lock_irq_desc(
-    const struct pirq *, unsigned long *pflags);
+extern int pirq_guest_bind(struct vcpu *v, struct pirq *pirq, int will_share);
+extern void pirq_guest_unbind(struct domain *d, struct pirq *pirq);
+extern void pirq_set_affinity(struct domain *d, int pirq,
+                              const cpumask_t *mask);
+extern struct irq_desc *domain_spin_lock_irq_desc(
+    struct domain *d, int pirq, unsigned long *pflags);
+extern struct irq_desc *pirq_spin_lock_irq_desc(
+    const struct pirq *pirq, unsigned long *pflags);
 
-unsigned int set_desc_affinity(struct irq_desc *, const cpumask_t *);
+unsigned int set_desc_affinity(struct irq_desc *desc, const cpumask_t *mask);
 
 #ifndef arch_hwdom_irqs
-unsigned int arch_hwdom_irqs(domid_t);
+unsigned int arch_hwdom_irqs(domid_t domid);
 #endif
 
 #ifndef arch_evtchn_bind_pirq
-void arch_evtchn_bind_pirq(struct domain *, int pirq);
+void arch_evtchn_bind_pirq(struct domain *d, int pirq);
 #endif
 
 #endif /* __XEN_IRQ_H__ */
diff --git a/xen/include/xen/softirq.h b/xen/include/xen/softirq.h
index 1f6c4783da..33d6f2ecd2 100644
--- a/xen/include/xen/softirq.h
+++ b/xen/include/xen/softirq.h
@@ -26,7 +26,7 @@ typedef void (*softirq_handler)(void);
 void do_softirq(void);
 void open_softirq(int nr, softirq_handler handler);
 
-void cpumask_raise_softirq(const cpumask_t *, unsigned int nr);
+void cpumask_raise_softirq(const cpumask_t *mask, unsigned int nr);
 void cpu_raise_softirq(unsigned int cpu, unsigned int nr);
 void raise_softirq(unsigned int nr);
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 13:02:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 13:02:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573026.897308 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQSXx-0001te-5F; Mon, 31 Jul 2023 13:02:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573026.897308; Mon, 31 Jul 2023 13:02:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQSXx-0001tX-23; Mon, 31 Jul 2023 13:02:49 +0000
Received: by outflank-mailman (input) for mailman id 573026;
 Mon, 31 Jul 2023 13:02:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=wefb=DR=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qQSXv-0001tQ-Vx
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 13:02:47 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8b03a7cb-2fa2-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 15:02:46 +0200 (CEST)
Received: from support.bugseng.com (support.bugseng.com [162.55.131.47])
 by support.bugseng.com (Postfix) with ESMTPA id 71EA34EE0737;
 Mon, 31 Jul 2023 15:02:45 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8b03a7cb-2fa2-11ee-b255-6b7b168915f2
MIME-Version: 1.0
Date: Mon, 31 Jul 2023 15:02:45 +0200
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com, Andrew Cooper
 <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v2 1/4] x86: mechanically rename to address MISRA
 C:2012 Rule 5.3
In-Reply-To: <d7b55bb0-328f-b99b-71b8-708ad40b3d64@suse.com>
References: <cover.1690788513.git.nicola.vetrini@bugseng.com>
 <b169d1c682254e682e6ed34f33481a768209ce9b.1690788513.git.nicola.vetrini@bugseng.com>
 <bdd5376b-477f-71e1-94db-71a2e4cb716e@suse.com>
 <d7b55bb0-328f-b99b-71b8-708ad40b3d64@suse.com>
User-Agent: Roundcube Webmail/1.4.3
Message-ID: <587b95a61d9ca41fa7544a79ed337226@bugseng.com>
X-Sender: nicola.vetrini@bugseng.com
Organization: BUGSENG s.r.l.
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit

On 31/07/2023 13:21, Jan Beulich wrote:
> On 31.07.2023 13:15, Jan Beulich wrote:
>> On 31.07.2023 09:33, Nicola Vetrini wrote:
>>> --- a/xen/arch/x86/include/asm/hvm/save.h
>>> +++ b/xen/arch/x86/include/asm/hvm/save.h
>>> @@ -49,21 +49,21 @@ void _hvm_read_entry(struct hvm_domain_context 
>>> *h,
>>>   */
>>>  #define _hvm_load_entry(_x, _h, _dst, _strict) ({                    
>>>    \
>>>      int r;                                                           
>>>    \
>>> -    struct hvm_save_descriptor *desc                                 
>>>    \
>>> +    struct hvm_save_descriptor *descriptor                           
>>>    \
>>>          = (struct hvm_save_descriptor *)&(_h)->data[(_h)->cur];      
>>>    \
>>>      if ( (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x),              
>>>    \
>>>                 HVM_SAVE_LENGTH(_x), (_strict))) == 0 )               
>>>    \
>>>      {                                                                
>>>    \
>>>          _hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH(_x));          
>>>    \
>>>          if ( HVM_SAVE_HAS_COMPAT(_x) &&                              
>>>    \
>>> -             desc->length != HVM_SAVE_LENGTH(_x) )                   
>>>    \
>>> -            r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length);       
>>>    \
>>> +             descriptor->length != HVM_SAVE_LENGTH(_x) )             
>>>    \
>>> +            r = HVM_SAVE_FIX_COMPAT(_x, (_dst), descriptor->length); 
>>>    \
>>>      }                                                                
>>>    \
>>>      else if (HVM_SAVE_HAS_COMPAT(_x)                                 
>>>    \
>>>               && (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x),       
>>>    \
>>>                         HVM_SAVE_LENGTH_COMPAT(_x), (_strict))) == 0 
>>> ) { \
>>>          _hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH_COMPAT(_x));   
>>>    \
>>> -        r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length);           
>>>    \
>>> +        r = HVM_SAVE_FIX_COMPAT(_x, (_dst), descriptor->length);     
>>>    \
>>>      }                                                                
>>>    \
>>>      r; })
>> 
>> The macro-local variable gets too long for my taste, to be honest,
>> and it being improperly named anyway suggests it simply wants a
>> trailing underscore added. And then, since for a variable named "r"
>> the risk of shadowing is equally high, that one wants to gain a
>> trailing underscore as well imo. (And while at it, I personally
>> would also drop the leading underscores from the macro parameter
>> names. Furthermore I think it would be nice if at on the lines
>> touched anyway indentation was also corrected. Overall maybe best
>> if I submit a patch.)
> 
> In that replacement patch I would like to mention what "desc" this
> collides with, but your description didn't say so and I'm afraid I
> also haven't been able to spot it (grep-ing for "desc", even with
> a couple of extra restrictions, still yields way too many hits).
> 
> Jan

It's the local variable in 'xen/arch/x86/hvm/save.c:281', but since the 
macro
is used elsewhere quite a few times, doing a suitable rename inside it
(that does not shadow anything) prevents other users from possibly 
shadowing it
in the future. Your points are all agreeable in my opinion. Since your 
concerns
with this macro are also about issues other than MISRA violations, I 
agree that
this patch should be dropped.

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 13:12:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 13:12:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573038.897328 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQSh7-0003wF-9l; Mon, 31 Jul 2023 13:12:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573038.897328; Mon, 31 Jul 2023 13:12:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQSh7-0003w8-5m; Mon, 31 Jul 2023 13:12:17 +0000
Received: by outflank-mailman (input) for mailman id 573038;
 Mon, 31 Jul 2023 13:12:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQSh6-0003w2-Lp
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 13:12:16 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0609.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::609])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id de55646d-2fa3-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 15:12:15 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB8185.eurprd04.prod.outlook.com (2603:10a6:10:240::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 13:12:13 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 13:12:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: de55646d-2fa3-11ee-b255-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=TmpSrtYK8BfQf9FEKnRwwguH3xFiwmz0vECVO0wuTyG2+blWBDeL2cz/pdyg3b2I6KXUAsS817rsHcFBhEO00ibz0ogaarYcS6LnroawSO/mq90/ZiyyuKqti/VwNVuQYO5C08znhqnahWSaIudI7aLW4YyVxa9p+Db0BqN6/wBuj+QR79yfk9jlYOrHNAdOPu4DEnCpQKLsjPDmWtbqwvsuxHxqtl+rMKch2hWe1y7BtrXRw1ukeK1mR78fJG+iWC+d9aDldEslQyuOqP1vFwwVKw8UcfvlVFvX5xoCME3kKWpbyWo/W/oO7A7hppGqJiM4rJ14w1KIxSQgm2cHsQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BHzbX8IHjWokso4ux/ZPfO0r/jQa2hAbX6xf6fr9I7k=;
 b=KjI4vSoGjDc4rQhVaovehRlQzym6Un0b5O4zpQEjMPv9r0hXYUJxXegPuNnGMrApOZwogwqnOEeKlSOXfPXvh+6K36p9szvEPzwBVIQvkyOVXzIxxuwYJX1D5eK39JXPCkxywwvYUmJTkUihS+Dz1XpqVlwLOGM1lh0o1y0ux4Vh2vPySWxLxd1FMhTDTWR9l2rs5VXLuiH7SmplCg3lWkXeVopKA7+UVX5nGzoBDIWQbGhLkuQjh5BmJcKotLF7yVtAmQlp6w+9oy0vQSccF2VSULtMC8zwobKV4CNw6d/kowkixRZCnKtBcP+2YcH1u2fvBb8ikPP7eBA5Bf9zfw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BHzbX8IHjWokso4ux/ZPfO0r/jQa2hAbX6xf6fr9I7k=;
 b=kMV+1d0KncwRpwkfBA9Gfioet4Ru6AlO7Mumhnrc5lGtCUtaTRmcfVFWv2NQBnUpTY9kb2Lzs8NC9gCpSsae7/cqC5zTc9WereVwNK9s4I8aTl0htWmlEMtq7+jMUHec3tOgoppcbeegI+bVVFOlWLHufKG1rmiAcEODu2AbD0QQ2hWKTYSjrP6AvHiUO5XBsBa9bupNVJc2Z3odoAm/xZqjueTjNIoVS/Zr4ysDXPeWoetSSB7gGx9f/kLYbuq7dUnyvJ5jIlIhLp135wEhUmyqGfH1Sx5ykQdrPHVj5d3Wgo0p6LpWTa3P2eQkimNbKU+x24j7oxzZ9pi7yZ7x+w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <c0a38938-b08f-b523-f681-74ba17c28dda@suse.com>
Date: Mon, 31 Jul 2023 15:12:12 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [XEN PATCH v3] xen/IRQ: address violations of MISRA C: 2012 Rules
 8.2 and 8.3
Content-Language: en-US
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <c07d2a38fa296e42f9d089553f9c6b1d916dbbe3.1690807908.git.federico.serafini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <c07d2a38fa296e42f9d089553f9c6b1d916dbbe3.1690807908.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0067.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4b::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB8185:EE_
X-MS-Office365-Filtering-Correlation-Id: 1128b2bd-facf-447c-9fe8-08db91c7c15e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	LBK9ldmlJwlEK+D1xmU649dUSJuzofCq9MeWPqXPMASu2PsPQrD9Fqd0xIeQKmWI5hAu5XVnj0+W0swhc16Icla0fbxsR0Eo6yasvIwYSxbYenFM+rmtTUwK/x1gbd/od1KwL8rIZFU+yhAz0GBz+6UWXR0BCo1vYB0HE3sd3japn8Qvq1ZqXnBGyd3ZnWjKioiQsSe16fdm5nxN8mDMKVn+/3629Qokf/WXruEl79bmK3C5OhDsEh8oa4FWhH/2QVsMFbgNsqfJAXEvJ/EzemBZjJLrTaz3r1IIB7DkQ/a9oFrDjXbHOK64NeJ44HxW9g9DX/CyZWVNTk0B4zZnjyRzcLBCTgPaFV46Oono4TXAYxiXeXzfH/iqAkrxLUevltDg8gOzVgNHhFPSrSxIXZLVTGaYDYw5b7/vUHRkR7Bu79vo+Af8tDMastGwDU+90ElN9nSyGG2CWw010r2fditrDNGBmn0N5LCRliqld+iYmgB8QidxiRQ8WckrCdZA/nrLHQKVBx/L6iupler1sbFyYf1prF9I9gumowAIW2uIM2aHintfqJGtQWrpPV6YD4WaqAtE3wTr7YhhnTmAeZ7oKhkkiR4wicAiCmV26kDxcAoElJuAzFzgkFcJz66de3c85abcrsEOkmcinjrSmA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(39860400002)(346002)(376002)(396003)(451199021)(6512007)(6486002)(36756003)(53546011)(2616005)(26005)(6506007)(186003)(66946007)(66556008)(7416002)(54906003)(31696002)(86362001)(66476007)(316002)(4326008)(5660300002)(6916009)(8676002)(8936002)(31686004)(41300700001)(38100700002)(2906002)(478600001)(4744005)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aWY4NjhQeEQ5eTNLeDRTaWlXWW0zUHk2TFJSMWhscktXaThRMUR0SWRSRXFS?=
 =?utf-8?B?Y1VNN2hXNWltQmRWYjJQQUk0U3NjRlMyWnpHdGw0ZDJPTjdYZUxKUlFUNEJQ?=
 =?utf-8?B?WjZua2ozQ3VsSXRaWTZjUjY1bUFiVzF1RURMUmV0dE1OdGJsTTh2QUVGSk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b210NHZnaEZxU1JBQ3l6ZVQ4?=
 =?utf-8?B?bkgxWHBZbWpFeUZXTUlCUVMwUlNVRXJTUkJTQ0MzR1hMSDEycGVrYVQwT1hM?=
 =?utf-8?B?T3pGancrbHFDQUNENlRZTW1Pck5CSDZpRExzZlFNWU9DZ20vOXpQZjZJRDBI?=
 =?utf-8?B?QmlKS2loRDNDVmFCY2h6V0hjQUFMa0hNd1JTci93a1VTclNNQUxlTTVMT0FI?=
 =?utf-8?Q?USDG4VCzcMtpDeOGs+BwJdA9w?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1128b2bd-facf-447c-9fe8-08db91c7c15e
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 13:12:13.3380
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: GcRwPU2uZmB9e9fgf3Z1k7EN0P9tIGC9V/wWXvROwwtyTNGYaMONqm7ti9pSPZbd/KiVlYaUVLy5Bn80GYUaow==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8185

On 31.07.2023 15:02, Federico Serafini wrote:
> Give a name to unnamed parameters thus addressing violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names and types used in function
> declarations and the ones used in the corresponding function
> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
> ("All declarations of an object or function shall use the same names
> and type qualifiers").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> ---
> Changes in v3:
>   - uniformed parameter names between arm and x86 for irq_set_affinity().

I'm sorry, your v3 submission crossed with me committing v2. Please
submit an incremental change instead.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 13:18:21 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 13:18:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573043.897338 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQSmt-0004gP-WD; Mon, 31 Jul 2023 13:18:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573043.897338; Mon, 31 Jul 2023 13:18:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQSmt-0004gI-TW; Mon, 31 Jul 2023 13:18:15 +0000
Received: by outflank-mailman (input) for mailman id 573043;
 Mon, 31 Jul 2023 13:18:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=IyhG=DR=citrix.com=prvs=569984122=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qQSmt-0004gC-4V
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 13:18:15 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b348a9b9-2fa4-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 15:18:13 +0200 (CEST)
Received: from mail-bn7nam10lp2100.outbound.protection.outlook.com (HELO
 NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.100])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 31 Jul 2023 09:18:11 -0400
Received: from BN7PR03MB3618.namprd03.prod.outlook.com (2603:10b6:406:c3::27)
 by SJ0PR03MB6501.namprd03.prod.outlook.com (2603:10b6:a03:386::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.44; Mon, 31 Jul
 2023 13:18:08 +0000
Received: from BN7PR03MB3618.namprd03.prod.outlook.com
 ([fe80::8f94:c73a:ffb7:d5e2]) by BN7PR03MB3618.namprd03.prod.outlook.com
 ([fe80::8f94:c73a:ffb7:d5e2%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 13:18:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b348a9b9-2fa4-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690809493;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=3Eh9JS1SrBDY5uy3QTv7zdeTIWuWQXr6sd44AVYXwRA=;
  b=C0tWvO0Cc0ZyMwCiX7PGMjHya5y6+Ps73jvjUn47FVuKS/969kCMQOMn
   rAHi2ZMyoe9lV8KyfO1HreoZtWALGNes4IjpzlWWz3zdty7/eLMAt1JgE
   URpxyKPYw9QIDwagwMHULXlAjX5V57j8gsIWeEhiTdrQdM5b14C4qdGmd
   k=;
X-IronPort-RemoteIP: 104.47.70.100
X-IronPort-MID: 116680187
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:/STvSakqM7CICODrLlFA4Jbo5gxlJ0RdPkR7XQ2eYbSJt1+Wr1Gzt
 xIWCjjVMquDMDCnct0nO4vn9kpU6sCGzdBkHFFqrCw2RSMWpZLJC+rCIxarNUt+DCFhoGFPt
 JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq
 LvartbWfVSowFaYCEpNg064gE0p5K2aVA8w5ARkPqgU5waGzhH5MbpETU2PByqgKmVrNrbSq
 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/
 f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3
 aEmBQofVhaevdyrmZuAau5wr54TLsa+aevzulk4pd3YJdAPZMmbBo/suppf1jp2gd1SF/HDY
 cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVk1Q3ieC1WDbWUoXiqcF9t0CUv
 G/ZuU/+BQkXLoe3wjuZ6HO8wOTImEsXXapLTePmpqYz0AL7Kmo7FkNKckWQoMCDhWWXXOxwb
 HcavXYNov1nnKCsZpynN/Gim1aGtBMBX9tbE8Uh9RqAjKHT5m6xFmUCCzJMdtEinMs3XiAxk
 E+EmcvzAj5iu6HTTmiSnp+LqRuiNC5TKnUNDQceSgEI+cXk5os6gRTGVN9LGrO6ldDzFnf7x
 DXihC4/jLIXhIgV2rmh/FbGqzixqYPESAFz7QLSNl9J9St8bY+hIoautl7S6K8YKJ7DFwHZ+
 n8Zh8KZ8eYCS4mXkzCAS/kMG7fv4OuZNDrbghhkGJxJGymRxkNPtLt4uFlWTHqF+O5eEdM1S
 Cc/YT9s2aI=
IronPort-HdrOrdr: A9a23:hf5rz68VEdT67md6J85uk+AEI+orL9Y04lQ7vn2ZKCYlCfBw8v
 rEoB1173HJYVoqNU3I2urwXJVoOEm8yXct2+ks1NSZLWvbUQmTXflfBOLZqlWLJ8SZzJ856U
 4KScdD4bPLYWSSwvyKhzVQvuxQpuWv4eSDv8+b5XFoVARrY6Zr40NCDBqBGEEefngkOXN8Lu
 vk2vZ6
X-Talos-CUID: =?us-ascii?q?9a23=3A8q5xWmqzULGEIaKQ2dCOeMzmUZ0bX0fP9HHNGXG?=
 =?us-ascii?q?lUE9SaLqJYAWg+qwxxg=3D=3D?=
X-Talos-MUID: 9a23:XE8McQZsSXGFtOBTqWGwoy9JNf5S7I+HD34i1q4I/JWnOnkl
X-IronPort-AV: E=Sophos;i="6.01,244,1684814400"; 
   d="scan'208";a="116680187"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=lLC7TPCgdY1d+ZLk9M1XvV4S4ti4MOYjcubZVfjPAc1NFLik4wtq9c1zV9vTZnon0bLtZHsMBlcr4dGLp+mwxgw1hP4a1L1yGNqdoRlNA/gGhQ0eg2jbSeqNCXTfNZnsLvzGjg4BM+i9ak2qSvoxciisRQmDfj4+t3+lp9h3HfiJPWD1b1JNKDOX4Bi8gj5JIbptbZvNvn6YeG2vrUCyW+peIMl8k+T+4sdqGBJ92tSqnbPpiRjNZNtCiZnCp9IsXFUugSZKkU1E8D/UCxFfMdxYG9P3/ZacmgpiDo8QM7vosjeDMAaub//BReXDe7K2vFtfuNsz3pCydOWmPzc1/w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3Eh9JS1SrBDY5uy3QTv7zdeTIWuWQXr6sd44AVYXwRA=;
 b=OuhTzx91k7/oSVTXy/O4aCJ4SwyPGl2FdDSJ2CKe67acl0hK7zM6yTK1cstQoioJ848QVCJraXr9hLLdhRcXJ22YmRIycptWCZldJ7cFg0Ksb1KQV9SEONFo8awM0HN3K5KV7XOZOWYBBIY0jS6fG5vhK16+vWhHhnnvYxqRTftra89JPzZvHnC6oW86zTyHiAfdYzJJjqawNL/Q5kPkCfcd6b+WEO/bIoTdcXGMGWSGeYRuege1Bdx+tkUptcrhp24Azbi3RBAqF16Fw9ipddN1ocOMm2M8OryGfdAdSpKB5NFzgWVZEC3O4oM4Pph5vViA0QOQQb66wMy6t3AA0Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3Eh9JS1SrBDY5uy3QTv7zdeTIWuWQXr6sd44AVYXwRA=;
 b=DCcK4h1crglgicxQXvwl09Hi4MZF2f4NQGbuIhG1fgOcu1ZO0yBZcQOQ3lZEQSzDOUlSxc569plGqiVZagmCUTuWEFpNaFC6d2SEr1LnYEcWMKzrXzdECAdBbJgHX1b6EP7y1D8JqiaN8iiJaf7D7LPrtjYQYswl1/JxuvjjERg=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <dd9a7702-0c62-7308-e58d-197114a76eee@citrix.com>
Date: Mon, 31 Jul 2023 14:18:03 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH] x86: avoid Misra Rule 19.1 violations
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Roberto Bagnara <roberto.bagnara@bugseng.com>,
 Nicola Vetrini <nicola.vetrini@bugseng.com>
References: <dd24472e-757b-a398-8ece-4e353a28ed1b@suse.com>
In-Reply-To: <dd24472e-757b-a398-8ece-4e353a28ed1b@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0652.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:296::13) To BN7PR03MB3618.namprd03.prod.outlook.com
 (2603:10b6:406:c3::27)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN7PR03MB3618:EE_|SJ0PR03MB6501:EE_
X-MS-Office365-Filtering-Correlation-Id: 20a2e2c9-d1f6-425f-3529-08db91c894fc
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	p0NLc7xgDoVImESwHTgzN9tBofKHF2vq5fy+hHC1laJ0NL79y9YwVa1kCYWxmjbingy3qerEBd1HCYEEEG9HOTwmcKri7+0jtrrgYd4R+tDsGaZ4a5R7VH6toSKVUUmOyuY9iIewP5S2iSsJqDzpcs7VoGlrTG4YERhfYuMNFcxRz/I+p/aSko0fYhfy+kMXgFENThKjSgdfX/DlGz3xBAAcU9bpCOfAlK3yVbXN0yDKlsMA4yoyVbljMFS0lWKL9z4VMG/+ntMfsYOQSM6+8az50IvDT8kzq5wpU4PrxEJBU2OQJL0FSiV0uL86jCylFCw75edTj10rw3igo7KlGHMCeHiJvr30e2/XWnj8ACiLDnOp4a3P3doUuIffPvHixqN3u/xDSKesXQCyp5ciLmzZkuc9xkhrWnTGiZF61eyyFk4KDdbpmfXZVlPOkGipZ8hOrMoia12VRla0dea9Onx5YwjobsQT85873dcKnFm4MEZrTLeS6dYx5F2lzE62L44x6NaQ8kuNyIz82gbs//qC/QYGLt7ZnDVfeSIAMNvk+6eEeKs46154gVdDwpJJqm2EO3Dp9lUGf8QvLIw3kCgug4tSR7ujRUNaqpnS8UVBlIsaygblpA7lgQ+TVPuhLk0Hvy9oWqNYTWw3qgJpEw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN7PR03MB3618.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(376002)(366004)(396003)(39860400002)(451199021)(6506007)(53546011)(26005)(2906002)(186003)(4744005)(6512007)(2616005)(83380400001)(316002)(66556008)(66476007)(66946007)(4326008)(8676002)(5660300002)(8936002)(6666004)(6486002)(478600001)(54906003)(110136005)(31696002)(86362001)(41300700001)(38100700002)(82960400001)(36756003)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dDlkYm1kZ1RudFpMeTUrNFE0YU92WHJTZEVhaHN0ZkJkcUgwb09veUQrTGUr?=
 =?utf-8?B?c3VqOGJBVmN5eHdTRlZoSUZWMTJ4OVByVkRTdU1OcHR2VU1ndmZ6TUhhV3BL?=
 =?utf-8?B?azEwT3dLR1ZGcDE4cmlVZjBVeEtDcW5GWHVCMWxWb282WmludDltZnB6My9h?=
 =?utf-8?B?NElQdGM1L1JPeEd3QmtwOFBTL1NCNnpSN3l5RFdZQnlQemhQQWFQTEp4Kzd6?=
 =?utf-8?B?RndZMlZaMzJqaFlzT0wrNDViWnJNelcxQlRObGxhenhZYXE4WVdHdzMrN0xv?=
 =?utf-8?B?SUxrck9EYzZqbUpRbEEzZ1pFSU9hUXpsUD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aj0reFDPbVrwjBNooJd4eA4=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 20a2e2c9-d1f6-425f-3529-08db91c894fc
X-MS-Exchange-CrossTenant-AuthSource: BN7PR03MB3618.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 13:18:08.5557
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: G0yNXVFxbQeEz1SLgoS3PMCIgsyjXg9rJfNXXUWOsoianQBbeV7nOcd1LQyaE3tQZZjwhoqMd290WLt6vXiqVbmbpA62Hfrow7bLYjEDVLw=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB6501

On 17/07/2023 3:13 pm, Jan Beulich wrote:
> Not exactly overlapping accesses to objects on the left and right hand
> sides of an assignment are generally UB, and hence disallowed by Misra.
> While in the specific cases we're talking about here no actual UB can
> result as long as the compiler doesn't act actively "maliciously", let's
> still switch to using casts combined with exactly overlapping accesses.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 13:24:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 13:24:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573048.897348 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQSt4-00067k-NW; Mon, 31 Jul 2023 13:24:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573048.897348; Mon, 31 Jul 2023 13:24:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQSt4-00067d-KM; Mon, 31 Jul 2023 13:24:38 +0000
Received: by outflank-mailman (input) for mailman id 573048;
 Mon, 31 Jul 2023 13:24:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQSt3-00067X-CX
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 13:24:37 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on062b.outbound.protection.outlook.com
 [2a01:111:f400:fe02::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 97e168fd-2fa5-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 15:24:36 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS8PR04MB7701.eurprd04.prod.outlook.com (2603:10a6:20b:293::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 13:24:34 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 13:24:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 97e168fd-2fa5-11ee-b255-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CEUP7LRDcmsbTHJF+3C6ah+dTJi5hdN+uURkQWvjJUt4ryTvmpkUP8x9je8nn4SzepY6LPH0t7URySpE6ECV7I4ihR4FxmGmfBJqVh/BGsGcb483AQlC2mfK5iurqEVCnadTUmSIs2sShq5SJAccEBwOI67Awhq30fmBzGDetf7WyyESt/FsSTWpq3voL07neIghH4koMXbiml0cyeqoxEVgEplv95OCRDQMDZ/titvBAPL5Gw4srnQVaNc5rDSwING90SnCr1ouYG42q937uPJOQ75m7LHGvW3Z7NAhzyr/KiJT4v/7fbqv0EFFc4IGpULao1mpWnxIKypf48gnTQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=WjaJPRAsG8ZVfoOjQO1GFUeIsGVylpeuNhe5+y0nvhw=;
 b=lQXad6/i/S+veN8bgss4O5Wrxv9uysPI/A22Ts9sbenV1QhUvu0qpsFtTcFKQvMm3kGh5hUUzMVEO0+ra59i7b8QdpW7glvVSvrCocyg6lti0ERKvsgBBPFt61gPmPi/z96zBKNgZ+gB+13ROYntRknEtFBsuMtGQ5f5vVkaby/lbrvWbgdcegHe4a2hpW4OQ5J1h8XKOUYQXatEc2a2Gc1fhH2hi36LGu9FgrpUx9gtlyfz663rQWbssSe4BU07W+U2+WcCwVTNl5c+4ncgq8S//YHABTBe28QT+7QO6UMqD70nxt6K+Ab/FHBJopoYvhDOcDN0nBPt9GXNU2UWfw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=WjaJPRAsG8ZVfoOjQO1GFUeIsGVylpeuNhe5+y0nvhw=;
 b=BYAoOgfeGfQgI8V/f4jP5FVhEqy5eoc5+aW4qjsSXogJcKU18HQdSSMrh5PPHfAjiyT1wns591sBx3vRWHA+Z+I/S93LfYHoZ1KzK7oZDUq0s8YbkoomBX1WfD9Xt20n4yjzvItyeJ7mkKXNvXZ0gqow8j6EBvuljL1ppGkbrDpueos2ZcqsOD/T/wtXirsI4f6lPSB5JwMJVQ5u4AaQDDyOTmtR6BG0Lbvh3xE9BbXL7UFGvNeDCV1I+s9aHEQUajpzn0K5hpRKBcBxpfCAbdRpudYntXXDbgg+oHjShNqpRBSSPfHHx8nc5UJ7LxE/h5utmXVYoTMe56LoZ0516Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <98596d8e-6c11-715a-7842-910806abda77@suse.com>
Date: Mon, 31 Jul 2023 15:24:31 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [PATCH v4 1/1] ns16550: add support for polling mode when device
 tree is used
Content-Language: en-US
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <cover.1690475512.git.oleksii.kurochko@gmail.com>
 <6e8f243284b53a9c56e7faf5e0e5ee5e20de9958.1690475512.git.oleksii.kurochko@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <6e8f243284b53a9c56e7faf5e0e5ee5e20de9958.1690475512.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0113.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a8::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS8PR04MB7701:EE_
X-MS-Office365-Filtering-Correlation-Id: 1fba9421-3581-4193-5f8f-08db91c97b12
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	d2M3++t9bUqwSnCWTvdng+59qTxhG1OTYEOm4P4hW3NW0ip4/zVl8UDHUwjXDDaHTKwGzK0ShdcchNvH662Yq2FuNaqXI4b9boMhvI4tBhUukGd1zOungqxyk8+VUH5lRNInk+S2Ms0aJpNuS3CrwL8PLWGCtsiZGFd1LXN+aYJjTPH3ddxHerqpDM8Me9fiogPlg+SQJVesTLno0+kYFxexP6lzK4zWNZYIE+cAq6sVMyJmoDiiAreUf8cQXI0EH4hkczT2Ndyp9qjChJWRBfkCcYWn79PvDGEVYxdzFe2LT91u27T8MQan3plMFQXdRzKsCu0oWLx7kKfwZ9JCgMM55ILIXptBXOHeGknrWQZ2e8S8URw4972imzNCQhr0XZ25O2RhaeXwGectRxxRKFV9Sdd9rdYsX+TPONAY8Ya6MmVTVUZmZYRkas9/3UTxDDReyK9WWn3P/3WCD/WaMYnBrxKA6pIA89MjskhyBLXkR5YrKkHRbwmEc5ZzwNYxje5GZvbDJ/YgMzB8wNk1+ZILDxz6MJDGUT40vSjRYmrk5h1CpB/R5uMh5qfHOjR6dHrGsq97lF0tdlVMl0HYrE5X/N2tc3kf6RMi5+dWNh52Dz4gM9HsWnROz3hBvZ4ZCA/CFbOYSiU4713W8IW7LQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(136003)(366004)(376002)(396003)(346002)(451199021)(6512007)(6486002)(36756003)(53546011)(2616005)(26005)(6506007)(83380400001)(186003)(66946007)(66556008)(41300700001)(54906003)(31696002)(86362001)(66476007)(316002)(4326008)(5660300002)(6916009)(8676002)(8936002)(31686004)(38100700002)(2906002)(6666004)(478600001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?b3VxR3c3VGxsWkpHSE5qTlY3NVNUVHRNdy9nSFRNd0hzU09Xb0VCd0dXNjBw?=
 =?utf-8?B?dmNRNTFMVkNESEkrclhuRnNhSGxkaC9zWGJ5cU1qekdtRTJCUDZvRkpwR1JZ?=
 =?utf-8?B?djBSYVh3N3NPcUlERXkvUXNVR2xOQVFpNkFvTTdEQ0x3ZnV0ZitSeENLOVJW?=
 =?utf-8?B?MHdHUi90ZmFXUE0xOVhTQXpwZHV0NmJUeXVicE5oUW9zYUFUVDlMYzBOVlQv?=
 =?utf-8?B?TW5GV2NKWTBucTVTcFJORjRnOC9udTRxcXpHVXhrOXYrV0E0VVoxN1NvVW1I?=
 =?utf-8?B?Uy8wcVdMZnJ4eTQrbDRwZ2JIV3VPOXc0eHlXb1VtWGN1dWdFQ3RJS0s5Q2x3?=
 =?utf-8?B?UkYvWnZrcDh3QmgzS1cybVdjTmo0NlBNNTBXcTNxenNXQ1hOdk1QeHFaYTdQ?=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suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1fba9421-3581-4193-5f8f-08db91c97b12
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 13:24:34.4062
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: vbCT/JrkxGAane7YfeVpnowRZkZ+axx8+hRYC1kXpYDI+O9mtRfx1lf7gIxZGUpDAHF31q9n54ZpegLy/LUBoQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7701

On 27.07.2023 18:45, Oleksii Kurochko wrote:
> @@ -654,6 +674,9 @@ static void ns16550_init_common(struct ns16550 *uart)
>  
>      /* Default lsr_mask = UART_LSR_THRE */
>      uart->lsr_mask  = UART_LSR_THRE;
> +
> +    if ( strstr(opt_com1, "poll") || strstr(opt_com2, "poll") )
> +        uart->intr_works = polling;
>  }

A non-__init function may not reference __initdata objects. But strstr()
is too lax anyway, and you also shouldn't check the wrong port's options.
You want to recognize "poll" _only_ where all other command line options
are processed.

Also may I remind you that extending command line options requires their
doc to also be updated?

> @@ -1333,9 +1356,13 @@ pci_uart_config(struct ns16550 *uart, bool_t skip_amt, unsigned int idx)
>                      uart->irq = 0;
>  #endif
>                  if ( !uart->irq )
> +                {
> +                    uart->intr_works = polling;
> +
>                      printk(XENLOG_INFO
>                             "ns16550: %pp: no legacy IRQ, using poll mode\n",
>                             &PCI_SBDF(0, b, d, f));
> +                }

I'm okay to leave it at this for now, since this way at least nothing
regresses that was working before. I'm not convinced this is all
correct, but that's a largely separate (and pre-existing) issue then.

> @@ -1791,8 +1808,11 @@ static int __init ns16550_uart_dt_init(struct dt_device_node *dev,
>      }
>  
>      res = platform_get_irq(dev, 0);
> -    if ( ! res )
> -        return -EINVAL;
> +    if ( res < 0 )
> +    {
> +        printk("there is no interrupt property, polling will be used\n");
> +        uart->intr_works = polling;
> +    }
>      uart->irq = res;

Shouldn't you avoid writing uart->irq when res is negative?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 13:31:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 13:31:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573052.897357 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQSzl-0007bv-E3; Mon, 31 Jul 2023 13:31:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573052.897357; Mon, 31 Jul 2023 13:31:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQSzl-0007bo-Az; Mon, 31 Jul 2023 13:31:33 +0000
Received: by outflank-mailman (input) for mailman id 573052;
 Mon, 31 Jul 2023 13:31:32 +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 <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQSzk-0007bi-5Z
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 13:31:32 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20613.outbound.protection.outlook.com
 [2a01:111:f400:7e1b::613])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8e8756d5-2fa6-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 15:31:30 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS4PR04MB9411.eurprd04.prod.outlook.com (2603:10a6:20b:4ea::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 13:31:27 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 13:31:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8e8756d5-2fa6-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=DlKISsqCRkQKaKteTv1iFa120j0W1FH7XsHA2zMQGU7udPUeDkfFvutmi9TCQj0e6pTcZd09jEYPVgEu0jxgN9XFcx2iNeRqL/FvpNQ6/r861sraw6L4XC9H493ij3GOWlrZDZkUfhHPwODLsytDmORN7VxS2gwFULRXcHwLojUFg8bSpXJh5Y7Z93xWeIqtXp502zx69mFUGa8b2n5gWAgmZqq/buMBIwh43qiciPq/D7GKvM88zoBcRly6QTGni2gcZHK96CIU/fvJboGy7EMSwPlEgRUrWwygnaqF3YT9Q38GCRAXztSfjEFSDtE0KDx1fb1uUTPhT1922pQiDg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=8u6Ro9TH7gEX09Hl6hvYAKoJ1p86WOM8kiqVVm11DA4=;
 b=l2tZu7xfavIVHAbxnJUWSWwbnCnrd30KKfOIx4MwCLBiBmpBYePZYeoVblNEGlywVjgc6naZriZTxp8u/5GeTTY+a2WRX4Gm+gcMfy8vhuzkWcLcM1+dIZxW/KmrSTfq0rXRpWpwLuFmiZfMjLtwcbNJGBpz6TBs3RVB04CoJknXHpq5xNqmHEWc2lahSKtPKDZiHXRIQ/0NSQIElcDzHcheyztWWPeX76TMFX/THvcQuBXq7Vt/7BG+dFcLjFlvNvXw1rO7ZiI6RjpL8zm+3gZ9E2rsJSSeZV+x5JdZ6k9ZyL2kPHk4F40n18rzJe8mSNC80qI2meJued8GX+zKYA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=8u6Ro9TH7gEX09Hl6hvYAKoJ1p86WOM8kiqVVm11DA4=;
 b=Ghy78BknTA2npD8vj7Go7+HCzo6dfb8ZmH5Flq8h7KW4wK4H+4j47T81jZ5k+LGyOJt+Rt+WyLBLtkz7ilwAXCVCLJL35cyq+OPTclJ7U0CiNuMpyWnQHw8rFOAVb7+ZWwF/IuycVQUS/IxLWJUd2nErf5pylf1XvjsPatv5qOSVHgAWFCkUJrSL4G+/xEtRMeFzHWcxIzNzV+eb/adioVkcZCJI8eQC2Xu4rNy77o/88MHA4zngtfjfP95VYHdmfwLgoyY3xsjOJgwuMfvmUg7zWGVlKVJ9oM6F7iogHyM3O4pUNNdMH0xjRP0w3g/e/DL2lHQ6NC+WbpJEACHzbQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <e9035197-b329-af2e-65ed-af31cd0375c2@suse.com>
Date: Mon, 31 Jul 2023 15:31:26 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Nicola Vetrini <nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86/HVM: tidy _hvm_load_entry() for style
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0128.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:94::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS4PR04MB9411:EE_
X-MS-Office365-Filtering-Correlation-Id: 1b44274f-c63e-473c-499d-08db91ca713b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	sVWOjyNUtOqfNVZBXPIgTFmXpCfchYFn0KjcS++DbVniD1HEavfS3akBRcfeBNSVyRf2UfZhXhyJrTBDJY01wJMDfoMHVVIdGmgX1uzKc39PdvxkfvvQCpRV296/DLnZ0SVPqo5dl4O/2T0/VqI4rki1t6UzS9WFU1Wb1Gxn4Svm8iYrquHHXOCBTmjL2PkDndLjrdL1k6+Va7r+Gj9P11P9H/oAEYmA1GhaB+QwIZgZidqj0mR6Kg2n0qhQtaKi7a5e64cdNPxJWVOYIhLOagUHo5WSDuNYNTlRXUp95fuzCBgs0Xckm1seC1H5/8FewBe+dtbIhVrKJH+pMBzGJlBMTH0EuCpcNjI6yc140xNo/sc3TMvrq0kBEyfB4gsHYg0ojvwqG1t9DRy4pI/nfOELt+G+pXikCNQ/xkewlZkbnyXwKkxpF+B3tsBU+vrBhpYsi4hp4So/w5AxbLWST6cMIA/a7lDC4hYxZfCdz8cxO0Vr1F2lNvz7sGiAKi06bmB1pSqqBM/CgFAofXmTdxhGFg+qc20g6q0YANlISX4+5h4z55XfuqVzru8IMYFx3REIQOf3hO1nS58PmVp+WGbPP8nA0LGcz6JmvhG5n7C2NEW9UzDNbh+a6OEXhqqk8izQwZdQ7ZRc7QcIe8lu5w==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(136003)(366004)(376002)(396003)(346002)(451199021)(6512007)(6486002)(36756003)(2616005)(26005)(6506007)(186003)(66946007)(66556008)(41300700001)(54906003)(31696002)(86362001)(66476007)(316002)(4326008)(5660300002)(6916009)(8676002)(8936002)(31686004)(38100700002)(2906002)(478600001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SzJjZndmT0FsTy9RclcwM1BMWC9aZmI3cHFvWFFLb0JaTjZ2SndLNjU4OWxz?=
 =?utf-8?B?bURxYzAxalQvRHk3a1hwN0lGTWJSTUZWVWZaT0I2enp1OTQ0M21OVVBxMU8z?=
 =?utf-8?B?MlBiWk94WWNSMUtjZVJlc2Z4bmxWR3RrT0EybUl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B?bXJvU0YyRDltejFNYWhhTmM2cnJvdzNmRmp5SUtRYTlLOVBMcWxNZUdIeisv?=
 =?utf-8?B?OERVYVNVc3QwdzIrWmsrbEd6Zmt3WWd4cDZuQXc1NlRxblBPQ3ZuUVVERXhC?=
 =?utf-8?B?S3RhTm9IZ25qNkwwOUJBck5udkoxaGJHVXlOb3h1RitocWpZcFBQaEJEbXho?=
 =?utf-8?B?MjA2TE9FSGtTdGZUNHh2eXFsTDRSTnEreFpHK3BxejhheEpvNitrRjVDK1Ex?=
 =?utf-8?Q?DG8Vkj7ZSSbqwPCFJaWWZVNn9?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1b44274f-c63e-473c-499d-08db91ca713b
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 13:31:27.3372
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: oPlbzqF61y/CAkEzTsWzZR8IEaDevcuaiN6LVQIA0JaI7hGnb/coRWA0pq58hk2UcvH2oblk5h/mOOU+Yq3c7w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9411

The primary goal is to eliminate the Misra-non-compliance of "desc"
shadowing at least the local variable in hvm_load(). Suffix both local
variables with underscores, while also
- dropping leading underscores from parameter names (applying this also
  to the two wrapper macros),
- correcting indentation,
- correcting brace placement,
- dropping unnecessary parentheses around parameter uses when those are
  passed on as plain arguments.

No functional change intended.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/include/asm/hvm/save.h
+++ b/xen/arch/x86/include/asm/hvm/save.h
@@ -47,30 +47,32 @@ void _hvm_read_entry(struct hvm_domain_c
  * Unmarshalling: check, then copy. Evaluates to zero on success. This load
  * function requires the save entry to be the same size as the dest structure.
  */
-#define _hvm_load_entry(_x, _h, _dst, _strict) ({                       \
-    int r;                                                              \
-    struct hvm_save_descriptor *desc                                    \
-        = (struct hvm_save_descriptor *)&(_h)->data[(_h)->cur];         \
-    if ( (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x),                 \
-               HVM_SAVE_LENGTH(_x), (_strict))) == 0 )                  \
+#define _hvm_load_entry(x, h, dst, strict) ({                           \
+    int r_;                                                             \
+    struct hvm_save_descriptor *desc_                                   \
+        = (struct hvm_save_descriptor *)&(h)->data[(h)->cur];           \
+    if ( (r_ = _hvm_check_entry(h, HVM_SAVE_CODE(x),                    \
+                                HVM_SAVE_LENGTH(x), strict)) == 0 )     \
     {                                                                   \
-        _hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH(_x));             \
-        if ( HVM_SAVE_HAS_COMPAT(_x) &&                                 \
-             desc->length != HVM_SAVE_LENGTH(_x) )                      \
-            r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length);          \
+        _hvm_read_entry(h, dst, HVM_SAVE_LENGTH(x));                    \
+        if ( HVM_SAVE_HAS_COMPAT(x) &&                                  \
+             desc_->length != HVM_SAVE_LENGTH(x) )                      \
+            r_ = HVM_SAVE_FIX_COMPAT(x, dst, desc_->length);            \
     }                                                                   \
-    else if (HVM_SAVE_HAS_COMPAT(_x)                                    \
-             && (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x),          \
-                       HVM_SAVE_LENGTH_COMPAT(_x), (_strict))) == 0 ) { \
-        _hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH_COMPAT(_x));      \
-        r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length);              \
+    else if (HVM_SAVE_HAS_COMPAT(x)                                     \
+             && (r_ = _hvm_check_entry(h, HVM_SAVE_CODE(x),             \
+                                       HVM_SAVE_LENGTH_COMPAT(x),       \
+                                       strict)) == 0 )                  \
+    {                                                                   \
+        _hvm_read_entry(h, dst, HVM_SAVE_LENGTH_COMPAT(x));             \
+        r_ = HVM_SAVE_FIX_COMPAT(x, dst, desc_->length);                \
     }                                                                   \
-    r; })
+    r_; })
 
-#define hvm_load_entry(_x, _h, _dst)            \
-    _hvm_load_entry(_x, _h, _dst, 1)
-#define hvm_load_entry_zeroextend(_x, _h, _dst) \
-    _hvm_load_entry(_x, _h, _dst, 0)
+#define hvm_load_entry(x, h, dst)            \
+    _hvm_load_entry(x, h, dst, true)
+#define hvm_load_entry_zeroextend(x, h, dst) \
+    _hvm_load_entry(x, h, dst, false)
 
 /* Unmarshalling: what is the instance ID of the next entry? */
 static inline unsigned int hvm_load_instance(const struct hvm_domain_context *h)


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 13:35:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 13:35:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573057.897368 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQT3k-0008Hz-3c; Mon, 31 Jul 2023 13:35:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573057.897368; Mon, 31 Jul 2023 13:35:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQT3k-0008Hs-0N; Mon, 31 Jul 2023 13:35:40 +0000
Received: by outflank-mailman (input) for mailman id 573057;
 Mon, 31 Jul 2023 13:35:39 +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
 <SRS0=wefb=DR=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qQT3j-0008Hl-7r
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 13:35:39 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 22070c65-2fa7-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 15:35:37 +0200 (CEST)
Received: from nico.bugseng.com (unknown [147.123.100.131])
 by support.bugseng.com (Postfix) with ESMTPSA id B980C4EE0737;
 Mon, 31 Jul 2023 15:35:34 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 22070c65-2fa7-11ee-8613-37d641c3527e
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Paul Durrant <paul@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Wei Liu <wl@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: [XEN PATCH 0/4] xen: address MISRA C:2012 Rule 5.3
Date: Mon, 31 Jul 2023 15:34:58 +0200
Message-Id: <cover.1690810346.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rule 5.3 has the following headline:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope".

The following two strategies are adopted to deal with som violations
of this rule:
- renaming of local variables, functions or parameters;
- removal of unnecessary parameters from function definitions.

No functional changes.

Nicola Vetrini (4):
  xen/pci: rename local variable to address MISRA C:2012 Rule 5.3
  amd/iommu: rename functions to address MISRA C:2012 Rule 5.3
  xen: rename variables and parameters to address MISRA C:2012 Rule 5.3
  arm/efi: address MISRA C:2012 Rule 5.3

 xen/arch/arm/efi/efi-boot.h               | 29 +++++++++---------
 xen/common/compat/memory.c                |  6 ++--
 xen/common/numa.c                         | 36 +++++++++++------------
 xen/drivers/char/ehci-dbgp.c              |  4 +--
 xen/drivers/char/ns16550.c                |  4 +--
 xen/drivers/passthrough/amd/iommu_guest.c | 14 ++++-----
 xen/drivers/passthrough/pci.c             | 12 ++++----
 7 files changed, 53 insertions(+), 52 deletions(-)

--
2.34.1


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 13:35:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 13:35:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573058.897377 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQT3l-00005Q-AI; Mon, 31 Jul 2023 13:35:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573058.897377; Mon, 31 Jul 2023 13:35:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQT3l-000058-7a; Mon, 31 Jul 2023 13:35:41 +0000
Received: by outflank-mailman (input) for mailman id 573058;
 Mon, 31 Jul 2023 13:35:40 +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
 <SRS0=wefb=DR=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qQT3k-0008Hl-2y
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 13:35:40 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 22baf4b5-2fa7-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 15:35:38 +0200 (CEST)
Received: from nico.bugseng.com (unknown [147.123.100.131])
 by support.bugseng.com (Postfix) with ESMTPSA id 288E84EE0740;
 Mon, 31 Jul 2023 15:35:37 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 22baf4b5-2fa7-11ee-8613-37d641c3527e
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Paul Durrant <paul@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [XEN PATCH 1/4] xen/pci: rename local variable to address MISRA C:2012 Rule 5.3
Date: Mon, 31 Jul 2023 15:34:59 +0200
Message-Id: <c9c6dd21ec6e88895ebc15ee6fe96090168afb51.1690810346.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690810346.git.nicola.vetrini@bugseng.com>
References: <cover.1690810346.git.nicola.vetrini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The rename s/pdev_type/pci_dev_type/ is done to avoid shadowing
the homonymous function declaration.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/drivers/passthrough/pci.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 95846e84f2..1dc519d1b6 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -650,12 +650,12 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
     struct pci_seg *pseg;
     struct pci_dev *pdev;
     unsigned int slot = PCI_SLOT(devfn), func = PCI_FUNC(devfn);
-    const char *pdev_type;
+    const char *pci_dev_type;
     int ret;
     bool pf_is_extfn = false;
 
     if ( !info )
-        pdev_type = "device";
+        pci_dev_type = "device";
     else if ( info->is_virtfn )
     {
         pcidevs_lock();
@@ -668,12 +668,12 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
         if ( !pdev )
             pci_add_device(seg, info->physfn.bus, info->physfn.devfn,
                            NULL, node);
-        pdev_type = "virtual function";
+        pci_dev_type = "virtual function";
     }
     else if ( info->is_extfn )
-        pdev_type = "extended function";
+        pci_dev_type = "extended function";
     else
-        pdev_type = "device";
+        pci_dev_type = "device";
 
     ret = xsm_resource_plug_pci(XSM_PRIV, (seg << 16) | (bus << 8) | devfn);
     if ( ret )
@@ -780,7 +780,7 @@ out:
     pcidevs_unlock();
     if ( !ret )
     {
-        printk(XENLOG_DEBUG "PCI add %s %pp\n", pdev_type,  &pdev->sbdf);
+        printk(XENLOG_DEBUG "PCI add %s %pp\n", pci_dev_type,  &pdev->sbdf);
         while ( pdev->phantom_stride )
         {
             func += pdev->phantom_stride;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 13:35:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 13:35:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573059.897388 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQT3m-0000MJ-HE; Mon, 31 Jul 2023 13:35:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573059.897388; Mon, 31 Jul 2023 13:35:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQT3m-0000MA-E9; Mon, 31 Jul 2023 13:35:42 +0000
Received: by outflank-mailman (input) for mailman id 573059;
 Mon, 31 Jul 2023 13:35:41 +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
 <SRS0=wefb=DR=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qQT3l-0008Hl-9w
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 13:35:41 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 23708b65-2fa7-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 15:35:39 +0200 (CEST)
Received: from nico.bugseng.com (unknown [147.123.100.131])
 by support.bugseng.com (Postfix) with ESMTPSA id 6C4024EE0741;
 Mon, 31 Jul 2023 15:35:38 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 23708b65-2fa7-11ee-8613-37d641c3527e
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [XEN PATCH 2/4] amd/iommu: rename functions to address MISRA C:2012 Rule 5.3
Date: Mon, 31 Jul 2023 15:35:00 +0200
Message-Id: <838e606bfe8b83578970ce73a1ac7d71ccefcd2b.1690810346.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690810346.git.nicola.vetrini@bugseng.com>
References: <cover.1690810346.git.nicola.vetrini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The functions 'machine_bfd' and 'guest_bfd' have gained the
prefix 'get_' to avoid the mutual shadowing with the homonymous
parameters in these functions.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/drivers/passthrough/amd/iommu_guest.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_guest.c b/xen/drivers/passthrough/amd/iommu_guest.c
index 80a331f546..47a912126a 100644
--- a/xen/drivers/passthrough/amd/iommu_guest.c
+++ b/xen/drivers/passthrough/amd/iommu_guest.c
@@ -38,12 +38,12 @@
         (reg)->hi = (val) >> 32; \
     } while (0)
 
-static unsigned int machine_bdf(struct domain *d, uint16_t guest_bdf)
+static unsigned int get_machine_bdf(struct domain *d, uint16_t guest_bdf)
 {
     return guest_bdf;
 }
 
-static uint16_t guest_bdf(struct domain *d, uint16_t machine_bdf)
+static uint16_t get_guest_bdf(struct domain *d, uint16_t machine_bdf)
 {
     return machine_bdf;
 }
@@ -195,7 +195,7 @@ void guest_iommu_add_ppr_log(struct domain *d, u32 entry[])
     log = map_domain_page(_mfn(mfn)) + (tail & ~PAGE_MASK);
 
     /* Convert physical device id back into virtual device id */
-    gdev_id = guest_bdf(d, iommu_get_devid_from_cmd(entry[0]));
+    gdev_id = get_guest_bdf(d, iommu_get_devid_from_cmd(entry[0]));
     iommu_set_devid_to_cmd(&entry[0], gdev_id);
 
     memcpy(log, entry, sizeof(ppr_entry_t));
@@ -245,7 +245,7 @@ void guest_iommu_add_event_log(struct domain *d, u32 entry[])
     log = map_domain_page(_mfn(mfn)) + (tail & ~PAGE_MASK);
 
     /* re-write physical device id into virtual device id */
-    dev_id = guest_bdf(d, iommu_get_devid_from_cmd(entry[0]));
+    dev_id = get_guest_bdf(d, iommu_get_devid_from_cmd(entry[0]));
     iommu_set_devid_to_cmd(&entry[0], dev_id);
     memcpy(log, entry, sizeof(event_entry_t));
 
@@ -268,7 +268,7 @@ static int do_complete_ppr_request(struct domain *d, cmd_entry_t *cmd)
     uint16_t dev_id;
     struct amd_iommu *iommu;
 
-    dev_id = machine_bdf(d, iommu_get_devid_from_cmd(cmd->data[0]));
+    dev_id = get_machine_bdf(d, iommu_get_devid_from_cmd(cmd->data[0]));
     iommu = find_iommu_for_device(0, dev_id);
 
     if ( !iommu )
@@ -320,7 +320,7 @@ static int do_invalidate_iotlb_pages(struct domain *d, cmd_entry_t *cmd)
     struct amd_iommu *iommu;
     uint16_t dev_id;
 
-    dev_id = machine_bdf(d, iommu_get_devid_from_cmd(cmd->data[0]));
+    dev_id = get_machine_bdf(d, iommu_get_devid_from_cmd(cmd->data[0]));
 
     iommu = find_iommu_for_device(0, dev_id);
     if ( !iommu )
@@ -396,7 +396,7 @@ static int do_invalidate_dte(struct domain *d, cmd_entry_t *cmd)
 
     g_iommu = domain_iommu(d);
     gbdf = iommu_get_devid_from_cmd(cmd->data[0]);
-    mbdf = machine_bdf(d, gbdf);
+    mbdf = get_machine_bdf(d, gbdf);
 
     /* Guest can only update DTEs for its passthru devices */
     if ( mbdf == 0 || gbdf == 0 )
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 13:35:43 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 13:35:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573060.897398 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQT3n-0000cW-Oe; Mon, 31 Jul 2023 13:35:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573060.897398; Mon, 31 Jul 2023 13:35:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQT3n-0000cP-L3; Mon, 31 Jul 2023 13:35:43 +0000
Received: by outflank-mailman (input) for mailman id 573060;
 Mon, 31 Jul 2023 13:35:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=wefb=DR=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qQT3l-0000Co-VQ
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 13:35:41 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 240bf8d7-2fa7-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 15:35:40 +0200 (CEST)
Received: from nico.bugseng.com (unknown [147.123.100.131])
 by support.bugseng.com (Postfix) with ESMTPSA id AFD544EE0742;
 Mon, 31 Jul 2023 15:35:39 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 240bf8d7-2fa7-11ee-b255-6b7b168915f2
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Wei Liu <wl@xen.org>
Subject: [XEN PATCH 3/4] xen: rename variables and parameters to address MISRA C:2012 Rule 5.3
Date: Mon, 31 Jul 2023 15:35:01 +0200
Message-Id: <8aebc67a150cb4116affdd6da755a8e82c827ffa.1690810346.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690810346.git.nicola.vetrini@bugseng.com>
References: <cover.1690810346.git.nicola.vetrini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rule 5.3 has the following headline:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope"

Local variables have been suitably renamed to address some violations
of this rule:
- s/cmp/c/ because it shadows the union declared at line 87.
- s/nodes/numa_nodes/ shadows the static variable declared at line 18.
- s/ctrl/controller/ because the homonymous function parameter is later
  read.
- s/baud/baud_rate/ to avoid shadowing the enum constant defined
  at line 1391.

No functional change.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/common/compat/memory.c   |  6 +++---
 xen/common/numa.c            | 36 ++++++++++++++++++------------------
 xen/drivers/char/ehci-dbgp.c |  4 ++--
 xen/drivers/char/ns16550.c   |  4 ++--
 4 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index 8ca63ceda6..3cf0a37d00 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -321,12 +321,12 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
 
         case XENMEM_remove_from_physmap:
         {
-            struct compat_remove_from_physmap cmp;
+            struct compat_remove_from_physmap c;
 
-            if ( copy_from_guest(&cmp, compat, 1) )
+            if ( copy_from_guest(&c, compat, 1) )
                 return -EFAULT;
 
-            XLAT_remove_from_physmap(nat.xrfp, &cmp);
+            XLAT_remove_from_physmap(nat.xrfp, &c);
 
             break;
         }
diff --git a/xen/common/numa.c b/xen/common/numa.c
index fc1f7f665b..301f2cf374 100644
--- a/xen/common/numa.c
+++ b/xen/common/numa.c
@@ -382,7 +382,7 @@ static bool __init numa_process_nodes(paddr_t start, paddr_t end)
  * 0 if memnodmap[] too small (or shift too small)
  * -1 if node overlap or lost ram (shift too big)
  */
-static int __init populate_memnodemap(const struct node *nodes,
+static int __init populate_memnodemap(const struct node *numa_nodes,
                                       unsigned int numnodes, unsigned int shift,
                                       const nodeid_t *nodeids)
 {
@@ -393,8 +393,8 @@ static int __init populate_memnodemap(const struct node *nodes,
 
     for ( i = 0; i < numnodes; i++ )
     {
-        unsigned long spdx = paddr_to_pdx(nodes[i].start);
-        unsigned long epdx = paddr_to_pdx(nodes[i].end - 1);
+        unsigned long spdx = paddr_to_pdx(numa_nodes[i].start);
+        unsigned long epdx = paddr_to_pdx(numa_nodes[i].end - 1);
 
         if ( spdx > epdx )
             continue;
@@ -440,7 +440,7 @@ static int __init allocate_cachealigned_memnodemap(void)
  * The LSB of all start addresses in the node map is the value of the
  * maximum possible shift.
  */
-static unsigned int __init extract_lsb_from_nodes(const struct node *nodes,
+static unsigned int __init extract_lsb_from_nodes(const struct node *numa_nodes,
                                                   nodeid_t numnodes,
                                                   const nodeid_t *nodeids)
 {
@@ -449,8 +449,8 @@ static unsigned int __init extract_lsb_from_nodes(const struct node *nodes,
 
     for ( i = 0; i < numnodes; i++ )
     {
-        unsigned long spdx = paddr_to_pdx(nodes[i].start);
-        unsigned long epdx = paddr_to_pdx(nodes[i].end - 1) + 1;
+        unsigned long spdx = paddr_to_pdx(numa_nodes[i].start);
+        unsigned long epdx = paddr_to_pdx(numa_nodes[i].end - 1) + 1;
 
         if ( spdx >= epdx )
             continue;
@@ -475,10 +475,10 @@ static unsigned int __init extract_lsb_from_nodes(const struct node *nodes,
     return i;
 }
 
-int __init compute_hash_shift(const struct node *nodes,
+int __init compute_hash_shift(const struct node *numa_nodes,
                               unsigned int numnodes, const nodeid_t *nodeids)
 {
-    unsigned int shift = extract_lsb_from_nodes(nodes, numnodes, nodeids);
+    unsigned int shift = extract_lsb_from_nodes(numa_nodes, numnodes, nodeids);
 
     if ( memnodemapsize <= ARRAY_SIZE(_memnodemap) )
         memnodemap = _memnodemap;
@@ -487,7 +487,7 @@ int __init compute_hash_shift(const struct node *nodes,
 
     printk(KERN_DEBUG "NUMA: Using %u for the hash shift\n", shift);
 
-    if ( populate_memnodemap(nodes, numnodes, shift, nodeids) != 1 )
+    if ( populate_memnodemap(numa_nodes, numnodes, shift, nodeids) != 1 )
     {
         printk(KERN_INFO "Your memory is not aligned you need to "
                "rebuild your hypervisor with a bigger NODEMAPSIZE "
@@ -541,7 +541,7 @@ static int __init numa_emulation(unsigned long start_pfn,
 {
     int ret;
     unsigned int i;
-    struct node nodes[MAX_NUMNODES];
+    struct node numa_nodes[MAX_NUMNODES];
     uint64_t sz = pfn_to_paddr(end_pfn - start_pfn) / numa_fake;
 
     /* Kludge needed for the hash function */
@@ -556,22 +556,22 @@ static int __init numa_emulation(unsigned long start_pfn,
         sz = x;
     }
 
-    memset(&nodes, 0, sizeof(nodes));
+    memset(&numa_nodes, 0, sizeof(numa_nodes));
     for ( i = 0; i < numa_fake; i++ )
     {
-        nodes[i].start = pfn_to_paddr(start_pfn) + i * sz;
+        numa_nodes[i].start = pfn_to_paddr(start_pfn) + i * sz;
 
         if ( i == numa_fake - 1 )
-            sz = pfn_to_paddr(end_pfn) - nodes[i].start;
+            sz = pfn_to_paddr(end_pfn) - numa_nodes[i].start;
 
-        nodes[i].end = nodes[i].start + sz;
+        numa_nodes[i].end = numa_nodes[i].start + sz;
         printk(KERN_INFO "Faking node %u at %"PRIx64"-%"PRIx64" (%"PRIu64"MB)\n",
-               i, nodes[i].start, nodes[i].end,
-               (nodes[i].end - nodes[i].start) >> 20);
+               i, numa_nodes[i].start, numa_nodes[i].end,
+               (numa_nodes[i].end - numa_nodes[i].start) >> 20);
         node_set_online(i);
     }
 
-    ret = compute_hash_shift(nodes, numa_fake, NULL);
+    ret = compute_hash_shift(numa_nodes, numa_fake, NULL);
     if ( ret < 0 )
     {
         printk(KERN_ERR "No NUMA hash function found. Emulation disabled.\n");
@@ -580,7 +580,7 @@ static int __init numa_emulation(unsigned long start_pfn,
     memnode_shift = ret;
 
     for_each_online_node ( i )
-        setup_node_bootmem(i, nodes[i].start, nodes[i].end);
+        setup_node_bootmem(i, numa_nodes[i].start, numa_nodes[i].end);
 
     numa_init_array();
 
diff --git a/xen/drivers/char/ehci-dbgp.c b/xen/drivers/char/ehci-dbgp.c
index 4d8d765122..22650663dc 100644
--- a/xen/drivers/char/ehci-dbgp.c
+++ b/xen/drivers/char/ehci-dbgp.c
@@ -424,9 +424,9 @@ static void dbgp_issue_command(struct ehci_dbgp *dbgp, u32 ctrl,
          * checks to see if ACPI or some other initialization also
          * reset the EHCI debug port.
          */
-        u32 ctrl = readl(&dbgp->ehci_debug->control);
+        u32 controller = readl(&dbgp->ehci_debug->control);
 
-        if ( ctrl & DBGP_ENABLED )
+        if ( controller & DBGP_ENABLED )
         {
             cmd |= CMD_RUN;
             writel(cmd, &dbgp->ehci_regs->command);
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 212a9c49ae..61c7a19c4d 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1473,7 +1473,7 @@ static enum __init serial_param_type get_token(char *token, char **value)
 
 static bool __init parse_positional(struct ns16550 *uart, char **str)
 {
-    int baud;
+    int baud_rate;
     const char *conf;
     char *name_val_pos;
 
@@ -1504,7 +1504,7 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
         uart->baud = BAUD_AUTO;
         conf += 4;
     }
-    else if ( (baud = simple_strtoul(conf, &conf, 10)) != 0 )
+    else if ( (baud_rate = simple_strtoul(conf, &conf, 10)) != 0 )
         uart->baud = baud;
 
     if ( *conf == '/' )
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 13:35:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 13:35:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573061.897408 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQT3p-0000t7-1c; Mon, 31 Jul 2023 13:35:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573061.897408; Mon, 31 Jul 2023 13:35:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQT3o-0000su-T7; Mon, 31 Jul 2023 13:35:44 +0000
Received: by outflank-mailman (input) for mailman id 573061;
 Mon, 31 Jul 2023 13:35:43 +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
 <SRS0=wefb=DR=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qQT3n-0008Hl-C2
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 13:35:43 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 247e0a1a-2fa7-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 15:35:41 +0200 (CEST)
Received: from nico.bugseng.com (unknown [147.123.100.131])
 by support.bugseng.com (Postfix) with ESMTPSA id 9E1844EE0743;
 Mon, 31 Jul 2023 15:35:40 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 247e0a1a-2fa7-11ee-8613-37d641c3527e
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	michal.orzel@amd.com,
	xenia.ragiadakou@amd.com,
	ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: [XEN PATCH 4/4] arm/efi: address MISRA C:2012 Rule 5.3
Date: Mon, 31 Jul 2023 15:35:02 +0200
Message-Id: <c153e4fbe19510ba1244024e7a4b8897c86afd3a.1690810346.git.nicola.vetrini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1690810346.git.nicola.vetrini@bugseng.com>
References: <cover.1690810346.git.nicola.vetrini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Rule 5.3 has the following headline:
"An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope"

The parameter 'fdt' in static function within this file is removed,
as they served no purpose and shadowed the homonymous variable.

For the same reason the local variable in 'lookup_fdt_config_table'
is dropped and the function is now consequently static void.

No functional changes.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/arm/efi/efi-boot.h | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index 6126a71400..ec328885a3 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -52,7 +52,7 @@ static struct file __initdata dtbfile;
 static void __initdata *fdt;
 static void __initdata *memmap;
 
-static int __init setup_chosen_node(void *fdt, int *addr_cells, int *size_cells)
+static int __init setup_chosen_node(int *addr_cells, int *size_cells)
 {
     int node;
     const struct fdt_property *prop;
@@ -114,7 +114,7 @@ static int __init setup_chosen_node(void *fdt, int *addr_cells, int *size_cells)
  * Set a single 'reg' property taking into account the
  * configured addr and size cell sizes.
  */
-static int __init fdt_set_reg(void *fdt, int node, int addr_cells,
+static int __init fdt_set_reg(int node, int addr_cells,
                               int size_cells, uint64_t addr, uint64_t len)
 {
     __be32 val[4]; /* At most 2 64 bit values to be stored */
@@ -138,13 +138,16 @@ static int __init fdt_set_reg(void *fdt, int node, int addr_cells,
     return(fdt_setprop(fdt, node, "reg", val, sizeof(*cellp) * (cellp - val)));
 }
 
-static void __init *lookup_fdt_config_table(EFI_SYSTEM_TABLE *sys_table)
+/*
+ * Set the variable 'fdt' if a matching guid is found.
+ */
+static void __init lookup_fdt_config_table(EFI_SYSTEM_TABLE *sys_table)
 {
     static const EFI_GUID __initconst fdt_guid = DEVICE_TREE_GUID;
     EFI_CONFIGURATION_TABLE *tables;
-    void *fdt = NULL;
     int i;
 
+    fdt = NULL;
     tables = sys_table->ConfigurationTable;
     for ( i = 0; i < sys_table->NumberOfTableEntries; i++ )
     {
@@ -154,7 +157,6 @@ static void __init *lookup_fdt_config_table(EFI_SYSTEM_TABLE *sys_table)
             break;
         }
     }
-    return fdt;
 }
 
 static bool __init meminfo_add_bank(struct meminfo *mem,
@@ -228,7 +230,6 @@ static EFI_STATUS __init efi_process_memory_map_bootinfo(EFI_MEMORY_DESCRIPTOR *
  * and memory map information.
  */
 EFI_STATUS __init fdt_add_uefi_nodes(EFI_SYSTEM_TABLE *sys_table,
-                                            void *fdt,
                                             EFI_MEMORY_DESCRIPTOR *memory_map,
                                             UINTN map_size,
                                             UINTN desc_size,
@@ -383,7 +384,7 @@ static void __init efi_arch_process_memory_map(EFI_SYSTEM_TABLE *SystemTable,
     if ( EFI_ERROR(status) )
         blexit(L"EFI memory map processing failed");
 
-    status = fdt_add_uefi_nodes(SystemTable, fdt, map, map_size, desc_size,
+    status = fdt_add_uefi_nodes(SystemTable, map, map_size, desc_size,
                                 desc_ver);
     if ( EFI_ERROR(status) )
         PrintErrMesg(L"Updating FDT failed", status);
@@ -542,7 +543,7 @@ static void __init efi_arch_handle_module(const struct file *file,
 
     if ( file == &dtbfile )
         return;
-    chosen = setup_chosen_node(fdt, &addr_len, &size_len);
+    chosen = setup_chosen_node(&addr_len, &size_len);
     if ( chosen < 0 )
         blexit(L"Unable to setup chosen node");
 
@@ -557,7 +558,7 @@ static void __init efi_arch_handle_module(const struct file *file,
         if ( fdt_setprop(fdt, node, "compatible", ramdisk_compat,
                          sizeof(ramdisk_compat)) < 0 )
             blexit(L"Unable to set compatible property.");
-        if ( fdt_set_reg(fdt, node, addr_len, size_len, ramdisk.addr,
+        if ( fdt_set_reg(node, addr_len, size_len, ramdisk.addr,
                     ramdisk.size) < 0 )
             blexit(L"Unable to set reg property.");
     }
@@ -572,7 +573,7 @@ static void __init efi_arch_handle_module(const struct file *file,
         if ( fdt_setprop(fdt, node, "compatible", xsm_compat,
                          sizeof(xsm_compat)) < 0 )
             blexit(L"Unable to set compatible property.");
-        if ( fdt_set_reg(fdt, node, addr_len, size_len, xsm.addr,
+        if ( fdt_set_reg(node, addr_len, size_len, xsm.addr,
                     xsm.size) < 0 )
             blexit(L"Unable to set reg property.");
     }
@@ -589,7 +590,7 @@ static void __init efi_arch_handle_module(const struct file *file,
             blexit(L"Unable to set compatible property.");
         if ( options && fdt_setprop_string(fdt, node, "bootargs", options) < 0 )
             blexit(L"Unable to set bootargs property.");
-        if ( fdt_set_reg(fdt, node, addr_len, size_len, kernel.addr,
+        if ( fdt_set_reg(node, addr_len, size_len, kernel.addr,
                          kernel.size) < 0 )
             blexit(L"Unable to set reg property.");
     }
@@ -757,7 +758,7 @@ static int __init handle_module_node(const EFI_LOADED_IMAGE *loaded_image,
         return ERROR_RENAME_MODULE_NAME;
     }
 
-    if ( fdt_set_reg(fdt, module_node_offset, reg_addr_cells, reg_size_cells,
+    if ( fdt_set_reg(module_node_offset, reg_addr_cells, reg_size_cells,
                      file->addr, file->size) < 0 )
     {
         PrintMessage(L"Unable to set module reg property.");
@@ -862,7 +863,7 @@ static int __init efi_check_dt_boot(const EFI_LOADED_IMAGE *loaded_image)
     EFI_FILE_HANDLE dir_handle = NULL;
 
     /* Check for the chosen node in the current DTB */
-    chosen = setup_chosen_node(fdt, &addr_len, &size_len);
+    chosen = setup_chosen_node(&addr_len, &size_len);
     if ( chosen < 0 )
     {
         PrintMessage(L"Unable to setup chosen node");
@@ -951,7 +952,7 @@ static bool __init efi_arch_use_config_file(EFI_SYSTEM_TABLE *SystemTable)
      * node to decide whether to skip the UEFI Xen configuration file or not.
      */
 
-    fdt = lookup_fdt_config_table(SystemTable);
+    lookup_fdt_config_table(SystemTable);
     dtbfile.ptr = fdt;
     dtbfile.need_to_free = false; /* Config table memory can't be freed. */
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 13:45:40 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 13:45:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573078.897418 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQTDL-0003bq-5X; Mon, 31 Jul 2023 13:45:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573078.897418; Mon, 31 Jul 2023 13:45:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQTDL-0003bj-1y; Mon, 31 Jul 2023 13:45:35 +0000
Received: by outflank-mailman (input) for mailman id 573078;
 Mon, 31 Jul 2023 13:45:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=IyhG=DR=citrix.com=prvs=569984122=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qQTDK-0003bd-4T
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 13:45:34 +0000
Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com
 [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8379be3f-2fa8-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 15:45:31 +0200 (CEST)
Received: from mail-dm6nam11lp2171.outbound.protection.outlook.com (HELO
 NAM11-DM6-obe.outbound.protection.outlook.com) ([104.47.57.171])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 31 Jul 2023 09:45:06 -0400
Received: from BN7PR03MB3618.namprd03.prod.outlook.com (2603:10b6:406:c3::27)
 by PH0PR03MB6939.namprd03.prod.outlook.com (2603:10b6:510:16d::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul
 2023 13:45:03 +0000
Received: from BN7PR03MB3618.namprd03.prod.outlook.com
 ([fe80::8f94:c73a:ffb7:d5e2]) by BN7PR03MB3618.namprd03.prod.outlook.com
 ([fe80::8f94:c73a:ffb7:d5e2%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 13:45:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8379be3f-2fa8-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690811131;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=R2/p3morXLi5OMERD87Xiw1CiGbYNz0MxzK+LmrO2Fg=;
  b=Zx6GY2aDR9+IHALBz28GxKBTsPihvfvPr6l5JNrBJqC7OQCem0AcGvql
   ZOA1xm4SxciP8Gea1wGvD7O1DxmfixuEKM81kQRB3PFyAnyvQ7cZWoxTp
   pzcvqtcEnoSGvDJ8EvbmPW33Q3UHEuOH6satXGKqgw4N859LkRK8tXzuy
   w=;
X-IronPort-RemoteIP: 104.47.57.171
X-IronPort-MID: 116682672
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:hfmt46BwmQjkqxVW/+jiw5YqxClBgxIJ4kV8jS/XYbTApDsl0jQOz
 msaWW2EO/yIYWH9eIslPNy18BhU6sTVztNlQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h
 yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs
 t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GxD5wRnDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS
 uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada
 jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIw5swmBzpc0
 OcjFwsBbjvb2v+uxoihRbw57igjBJGD0II3nFhFlGicIdN4BJfJTuPN+MNS2yo2ioZWB/HCa
 sEFaD1pKhPdfxlIPVRRA5U79AuqriCnL3sE9xTI+uxuvDG7IA9ZidABNPL8fNCQSNoTtUGfv
 m/cpEzyAw0ANczZwj2Amp6prraWw32rAtxNTtVU8NZ1hnu2zWkuDCYJWGW8oNunlBSbf/9Qf
 hl8Fi0G6PJaGFaQZtv3UgC8oXWElgUBQNcWGOo/gCmdx6yR7wuHC2wsSj9adMdgpMIwXSYt1
 FKCg5XuHzMHmKKRYWKQ8PGTtzzaES4UJmgGbGkaQBcf4t/iiIsugQnCSNklG6mw5uAZAhn1y
 jGO6SQ72bMaiJdS073hpA+exTWxupLOUwg5oB3NWX6o5R94Y4jjYJG07V/c7rBLK4PxokS9g
 UXoUvO2tIgmZaxhXgTUKAnRNNlFP8q4DQA=
IronPort-HdrOrdr: A9a23:fFlSXKinTSXBkYxamkL6Lau0oXBQXtQji2hC6mlwRA09TyX4ra
 yTdZEgviMc5wx/ZJhNo7690cu7IU80hKQV3WB5B97LNmTbUQCTXeJfBOXZsljdMhy72ulB1b
 pxN4hSYeeAaWSSVPyKgjWFLw==
X-Talos-CUID: 9a23:USK6927G80V5+gBZ6dss6GRFHJs3V2bm80zcI2TgVHtxToePRgrF
X-Talos-MUID: =?us-ascii?q?9a23=3AyEHrGQ/jP2EzLSl6Pk3cakWQf9huxYGlDX0Jqoo?=
 =?us-ascii?q?Lhc6FFzJuYRK5oTviFw=3D=3D?=
X-IronPort-AV: E=Sophos;i="6.01,244,1684814400"; 
   d="scan'208";a="116682672"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=l5y7SvaBVxzrisDMsSN3HHkmB63BjWhFSDazRYoQAZIhnUWIq1hh5WKu7ZtV71oT27z/AGrGS+gigGm6/+gMt8Q4l+ICjKmmPUzJ4vBGtixwjdD/MtddiFO6UZHze/Q00RfsGVknLvyYULCEJuTDsogF+PtDIg4pu/cd7Dm/K03ONt4WpSOg0ASP7Nb/xZ2hFcaIuYL3r7/iEnOMNffyiT6+zelQSHg2WdO4u/pQXMcf4uE8BTnv1ZsNPqRbJL/yeIbXO7+kxjxSTxuEzIkJwJKNIOD1XFUFH/gf6NLfS5gWF2Rxwk9Z+IL46zUbGg01y/u4Q+u//ddM1iXhGJE/Wg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=2V8uDiiJjUf8iU0IlQh22JLq6X9j3X/svHUk6kdvPDI=;
 b=LkBFG/aD49ho759DRgtCiDK5Dm4CIN2LnTVbsJwccymJwVzCKpIzClbvKQNiQFLOrR7Bbfz6NyG6gNzRfnFG3VeFuutLsYUj9viqCWXjwAIFD39J5uDAinT8VAGgYliYNBP47SUpxBu+whN9mz9B8tfwQCfF3HyNTJB4kW0/wIC2JO10EHF58g7RpoHN7z2mpmrAx6Wckg/rFG7ArwU5Le90bNYDWMzbxhtvkQvXe7Zoolz4LN+wQNtvCu75pc7l0YGOoAzWF0mbTm9W6HvAh8vd2XeOHfwVt9GlmXEPG95HU32kL9CxI/dpboyY2W3OA0WinW9JTCLTpABjLoQY3w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=2V8uDiiJjUf8iU0IlQh22JLq6X9j3X/svHUk6kdvPDI=;
 b=CYrFwXJ02297zk/Xr41M21beVFa6IFi+5VBO0UHPrGP2whMT8vPNkZTmo7aKqDLuWzl0jwbHbOB97D9zRQ3ffZ7UhCNpPORyepMtHohXkjg/l8jUrkEFX4SUeewxKjGGh+MMu6kVx/a7EV1hcm3IhOFbxXHCK51rHTE5vfJnCxs=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <12030ba7-2ac5-072c-baf0-a3bbe71f8c28@citrix.com>
Date: Mon, 31 Jul 2023 14:44:48 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH] x86/HVM: tidy _hvm_load_entry() for style
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, Nicola Vetrini <nicola.vetrini@bugseng.com>
References: <e9035197-b329-af2e-65ed-af31cd0375c2@suse.com>
In-Reply-To: <e9035197-b329-af2e-65ed-af31cd0375c2@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0095.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2bc::19) To BN7PR03MB3618.namprd03.prod.outlook.com
 (2603:10b6:406:c3::27)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN7PR03MB3618:EE_|PH0PR03MB6939:EE_
X-MS-Office365-Filtering-Correlation-Id: f55bea33-85cb-435b-b3b2-08db91cc57bc
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	9B0s+c2no2P32y58ZR2lxE1ukFL2ZnJ6p3ANMQPwMxv1oj3AHgaVieYizYNsDW6E1/bVC/VuxRMTkGTMfcDdHLTc244qaJoETRSe+NEDXste6W1weEIWlXbZFeajyAXFlYt7jmaH0FrqyzPkqPpzHgIh/sGTJZS8J1QXQAeLRpsjPA21ox6n/zKPuN93Z/Pt/G2MN0sJUicRfh/1p62WGpAoPOMNDBsBLUjH8itHAoNlaF8iqB2iG1ImZYIiMdgcxcMRg/LBIa1wDUjIMyZG0ga/slZzWZrD8QbeA0l6XK0r7uMbthhrppFfx6zt+02FjPeHSJzddGqebheDQnyM9b1fvGhPILwGgvXFwiUrBl39jf1tXjxftxzMPTYO9FaAjxshEzRzOJMHq7fDSOS4G1zV+7ka2iwkuFlhZcCzFLEDXUmkvv/vH5lNx+OZTrebyFfxToO7F435rFP3lDYiGGruAoekp8PFUD6fuQqErn8bz2f1kBQN3FlIfZPJM8/Ick54Im5GXkvuVCOyoEWDU0KCgXa/5HGhb3CepzdZoc5SSTj2/+X51BuKm0WE9+mt+iFt1yVQ4x/FLD/TVTCD1BxoW6hXhe86OKQzkyVYfbGclRKPYYBDNq9CC0jWSWonczgckqwhejOtNag+IYWnnA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN7PR03MB3618.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(366004)(376002)(346002)(39860400002)(396003)(451199021)(5660300002)(2906002)(66476007)(66556008)(66946007)(4326008)(316002)(31686004)(110136005)(54906003)(41300700001)(2616005)(6486002)(6666004)(8936002)(6506007)(26005)(8676002)(53546011)(186003)(478600001)(82960400001)(38100700002)(36756003)(6512007)(31696002)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eTcvVldGM2pReTl5OEV6TDZmU0NRcGgvZlNJdkpJdHE5TmxLbmF2R2RUb3R4?=
 =?utf-8?B?RzArMWFBYzc4SHQ5emR2S2p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NHZ8C+XWAsr2RcBuNU5UjKzKNXUZsuXQw3EdgKFTMRxqAPOHrmZbsLFzV8Bz0VoNY2/6AE6sCUQTZdiY6U6TtLD/WuM5YMWiyt0MbJ81XJgq5x7A8P5zDuobXeQ6n33ixQK/PS8kFyJPuQwOQMmAsIunfp4ehKzeyENiFa8347Mw+CUgxMASxlgy0eH0IfqonR6tG6knllHD3dDNLhzFPYFEWvSX5lFiNf5US2yCCL/nhTFohd8RzbkUIuDPdYqBCXucAl3ah6eqg2LH9vwFc0uPCePMCVfaEsWqFCiIfoB7kKiG7mBpk3gGeRkJc=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f55bea33-85cb-435b-b3b2-08db91cc57bc
X-MS-Exchange-CrossTenant-AuthSource: BN7PR03MB3618.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 13:45:03.6560
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 6+rF2WBFnPOdrytY6rawcc+XxNCcMGXQEDExE9HfrqkOr+Jcjb2iRxPUuPxA8Zmz+XBpe7J/kUete9t8qysDKLBWgm03ImhA4efAu0XuEL8=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB6939

On 31/07/2023 2:31 pm, Jan Beulich wrote:
> The primary goal is to eliminate the Misra-non-compliance of "desc"
> shadowing at least the local variable in hvm_load(). Suffix both local
> variables with underscores, while also
> - dropping leading underscores from parameter names (applying this also
>   to the two wrapper macros),
> - correcting indentation,
> - correcting brace placement,
> - dropping unnecessary parentheses around parameter uses when those are
>   passed on as plain arguments.
>
> No functional change intended.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/arch/x86/include/asm/hvm/save.h
> +++ b/xen/arch/x86/include/asm/hvm/save.h
> @@ -47,30 +47,32 @@ void _hvm_read_entry(struct hvm_domain_c
>   * Unmarshalling: check, then copy. Evaluates to zero on success. This load
>   * function requires the save entry to be the same size as the dest structure.
>   */
> -#define _hvm_load_entry(_x, _h, _dst, _strict) ({                       \
> -    int r;                                                              \
> -    struct hvm_save_descriptor *desc                                    \
> -        = (struct hvm_save_descriptor *)&(_h)->data[(_h)->cur];         \
> -    if ( (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x),                 \
> -               HVM_SAVE_LENGTH(_x), (_strict))) == 0 )                  \
> +#define _hvm_load_entry(x, h, dst, strict) ({                           \
> +    int r_;                                                             \
> +    struct hvm_save_descriptor *desc_                                   \
> +        = (struct hvm_save_descriptor *)&(h)->data[(h)->cur];           \
> +    if ( (r_ = _hvm_check_entry(h, HVM_SAVE_CODE(x),                    \
> +                                HVM_SAVE_LENGTH(x), strict)) == 0 )     \
>      {                                                                   \
> -        _hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH(_x));             \
> -        if ( HVM_SAVE_HAS_COMPAT(_x) &&                                 \
> -             desc->length != HVM_SAVE_LENGTH(_x) )                      \
> -            r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length);          \
> +        _hvm_read_entry(h, dst, HVM_SAVE_LENGTH(x));                    \
> +        if ( HVM_SAVE_HAS_COMPAT(x) &&                                  \
> +             desc_->length != HVM_SAVE_LENGTH(x) )                      \
> +            r_ = HVM_SAVE_FIX_COMPAT(x, dst, desc_->length);            \
>      }                                                                   \
> -    else if (HVM_SAVE_HAS_COMPAT(_x)                                    \
> -             && (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x),          \
> -                       HVM_SAVE_LENGTH_COMPAT(_x), (_strict))) == 0 ) { \
> -        _hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH_COMPAT(_x));      \
> -        r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length);              \
> +    else if (HVM_SAVE_HAS_COMPAT(x)                                     \
> +             && (r_ = _hvm_check_entry(h, HVM_SAVE_CODE(x),             \

&& on prev line, and an extra space before HVM_SAVE_HAS_COMPAT()

With that, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

This code re-enforces my firm belief that this has no business living in
the hypervisor at all.Â  All of this can live in userspace, with a
slightly improved hypercall interface.

~Andrew


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 13:57:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 13:57:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573082.897428 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQTO5-00057g-5Q; Mon, 31 Jul 2023 13:56:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573082.897428; Mon, 31 Jul 2023 13:56:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQTO5-00057Z-1X; Mon, 31 Jul 2023 13:56:41 +0000
Received: by outflank-mailman (input) for mailman id 573082;
 Mon, 31 Jul 2023 13:56:40 +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 <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQTO4-00057R-2u
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 13:56:40 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on0618.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::618])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 11150e37-2faa-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 15:56:37 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB7549.eurprd04.prod.outlook.com (2603:10a6:102:e0::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Mon, 31 Jul
 2023 13:56:35 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 13:56:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 11150e37-2faa-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=mpTCySQ2wtQO+jVRCJr4NKdlBfFjKztK8dc5mhb2ZglL2b/salFjSHcQ9as3IZFsBIMGqyTRwWeQ590EzHrOOX6xA9QqZiOrBdtewo4IzqEP1C0RGxnv8SNTy6FbJcGXEoGjKJpUmn6OiQxWMbeNotEUY/TnFZ3Q2jmGQpOumgwPqH/7h2PI1FNb3HBanT+bt7rF6EkbM5Mcm40YmVT+xoGB0Q1E1zmMqsNFa5qo8xssg7RalE3Ki4GbCQ2LFLhgMzZYKgVaiD3ieg3RH4Y4AXTgGMyht56BxJTyH+uqMnwcIeQXGnWh1NNMOoWevo6YOPfFcES6MZf1uG+/my58KQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=b2InilYaptwCoVS5K1nDOd3A8y9sVLBW++/dx+G+cKg=;
 b=UL1zlYszSQ+CN7HU8QLGkvVIzvMOpK+9fBcX6PCTZdK7zLxC9MgoH3hKrecsrWQzc4uPgM+Q+1F3icFt3ZAP9N/j61CO6ghfIIet0UVW0uyWaoCsUXTo2DWEFbxIaV3rs8Jis84iQ+qWCOB0oUAgjkYyLRVICxY6AL60VrXKGnnV3AvgCEB+6VZs/bBGSudcZ393a2SyfUm8sfqskzWtUr5kY2Cp2bfp/UIV8qsbHsGh+LEVO8RvAn1paVrw0NozoBRDlGnYJEIp1K8gOJv7w15oRc30ot0hS02nR22NC+XviPmEke8KesuJuPcS+XUyjRs28mH+CJ3KmkGJO4iT1w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=b2InilYaptwCoVS5K1nDOd3A8y9sVLBW++/dx+G+cKg=;
 b=Vn1jl8j3zdmMCivxUQeWhjnYEyaFhB80Vxr8WhVccKIkhxyc1c+tPJpzPIzD/QzxfEl2s6dftVIYbqPxJy+zkPD1zZBZ49lOj4UwMUVblt6htenGcgyCcLKZIDxcKpFJqqlUW1wde+pE5Dg+MrmJ4K8UytkNKarwyqHVv9quOrTANBtwXbCjbDD1nTQeYSru525S4/IKDvEANpTmGZGgF9v+z5LKK44kWjE2oXONpqi8G/ctaEzr2NThDYq0lskkzWpMhAuolVIn9qYcP0e52hvFeURw42r1nXv8MyPqBx48nTW8LS7cerP2VOPz+cDoVpGypPwT64f0/nB0yLCndQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <df17e20c-1d11-bc01-eb07-c0234752b079@suse.com>
Date: Mon, 31 Jul 2023 15:56:34 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [PATCH v7 06/15] cpufreq: Add Hardware P-State (HWP) driver
Content-Language: en-US
To: Jason Andryuk <jandryuk@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20230726170945.34961-1-jandryuk@gmail.com>
 <20230726170945.34961-7-jandryuk@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230726170945.34961-7-jandryuk@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0112.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9d::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB7549:EE_
X-MS-Office365-Filtering-Correlation-Id: c5c5ad1c-6211-4112-5a85-08db91cdf421
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	epQNjL3WRTqdGKGbXl55ak0y1wRaZFZwhTj93KIsQQDrVw4IHYpgL8B3Rfv4E/ZI+Kh0gTLbwPr66vocnHbtn2PmyQpFFyUsoXInPHcF34D5G/+dOFszmT+Fhg4MSGOVHuTEaQz9jR5c7qdMYEb24JcGn0FQz76cDHkkv+CGOXUyMY0fFDal9rYcSfGOEY+vufP7myAySPAmNFgQk25Q/HFch0xCInxDd1IwHVKhe3cfgstO9bxu55sWi10d6JkAT4ejFcEn9SZTyMfEqpYdMKNWqgzhgpXPcO/iK/PpPCEBrcyqkpl0iUE39rY5lfs/gS3lKOEcnaCraEX/XzKz/FegtuW2A7qFPJw1k4aH3cLbMQw6wsudIFYKoDwDHysNYQfNkQeQEJPmYOsmS6hqIFHJID5QIS/36FR/AqAiwMY5MSyRY+9ilFJeneM7LufF8dCh5KWOYRM9Xl86zx09BVX5fhnn6eobgBSGAEZdK7co67cpayz8Nf60MxfvxGYA016jrYxbbVgctqAAfGLkUDB3i55j0B/ce/wllKFGfRtx/QpEu8CHYiq5L+QYTus9rts64Tm/UcRH1o9AJRERDJY3K81GrD73ht3QG4rnc0yXh7U2SSkQGos5GraQFfF07t1zYGclxr+WaOnfJP70pQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(136003)(376002)(396003)(39860400002)(366004)(451199021)(316002)(31686004)(4326008)(8676002)(8936002)(5660300002)(41300700001)(2906002)(6916009)(54906003)(66476007)(6486002)(66556008)(66946007)(53546011)(6506007)(186003)(26005)(478600001)(86362001)(36756003)(31696002)(83380400001)(6512007)(2616005)(38100700002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dWJSNWY3U0hOSmNlaF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FoWXFx?=
 =?utf-8?B?bjBwYlNOaXZKdGZiejM2OVAvVHE3SzBOaGw4eFptblRSNVlzZGdraXJLK0dx?=
 =?utf-8?B?elg2MitxaUFBS2tsUXBmQmMrMzR4UDhhUnh0b1dkR1Bqak9tWWZoY3VQVDZP?=
 =?utf-8?B?NzhGZDg2RE0xNmF5MkNzOGFIWlc3MFRmQkJmU2pFc09pNVU3ZFJaaXJtcDc0?=
 =?utf-8?B?WmduV1FzSmdGbG0raW9lOElFa1IvWU1lM3RZaXdpSWNDN0Q1cUZKNDZnVjhS?=
 =?utf-8?B?WkpJKzVTelY3Rk16WUlBbGRBaEVTWkRFSkZIVWlKNE9XbVNMWm5OWUV6L29Q?=
 =?utf-8?B?NnlxN1BIZ0lkLzE2RlNhQWw4VlE5QmhRNHM5TEJNdEFjMFJ4YzlIdHBpV1lY?=
 =?utf-8?Q?Wf7d4OtQvzednwhDF1BouAy9k?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c5c5ad1c-6211-4112-5a85-08db91cdf421
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 13:56:35.4658
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 7JM6F+jZIIk06p3A6cq+ah10c3oYaoZbpsdXVDK6jiL0FeC02n0hZYcm/TS2OHcDrUdnRcePrNicSNNXcb6V0A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7549

On 26.07.2023 19:09, Jason Andryuk wrote:
> From the Intel SDM: "Hardware-Controlled Performance States (HWP), which
> autonomously selects performance states while utilizing OS supplied
> performance guidance hints."
> 
> Enable HWP to run in autonomous mode by poking the correct MSRs.  HWP is
> disabled by default, and cpufreq=hwp enables it.
> 
> cpufreq= parsing is expanded to allow cpufreq=hwp;xen.  This allows
> trying HWP and falling back to xen if not available.  Only hwp and xen
> are supported for this fallback feature.  hdc is a sub-option under hwp
> (i.e.  cpufreq=hwp,hdc=0) as is verbose.
> 
> There is no interface to configure - xen_sysctl_pm_op/xenpm will
> be extended to configure in subsequent patches.  It will run with the
> default values, which should be the default 0x80 (out of 0x0-0xff)
> energy/performance preference.
> 
> Unscientific powertop measurement of an mostly idle, customized OpenXT
> install:
> A 10th gen 6-core laptop showed battery discharge drop from ~9.x to
> ~7.x watts.
> A 8th gen 4-core laptop dropped from ~10 to ~9
> 
> Power usage depends on many factors, especially display brightness, but
> this does show a power saving in balanced mode when CPU utilization is
> low.
> 
> HWP isn't compatible with an external governor - it doesn't take
> explicit frequency requests.  Therefore a minimal internal governor,
> hwp, is also added as a placeholder.
> 
> While adding to the xen-command-line.pandoc entry, un-nest verbose from
> minfreq.  They are independent.
> 
> With cpufreq=hwp,verbose, HWP prints processor capabilities that are not
> used by the code, like HW_FEEDBACK.  This is done because otherwise
> there isn't a convenient way to query the information.
> 
> Xen doesn't use the HWP interrupt, so it is disabled like in the Linux
> pstate driver.
> 
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

> +static int cf_check hwp_cpufreq_cpu_init(struct cpufreq_policy *policy)
> +{
> +    static union hwp_request initial_req;
> +    unsigned int cpu = policy->cpu;
> +    struct hwp_drv_data *data;
> +    static bool first_run = true;

This would probably better be __read_mostly. Iirc there were some small
adjustments requested elsewhere, so I guess I'll wait for v8 before
checking to see how much of this series is ready to go in.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 13:58:13 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 13:58:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573084.897437 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQTPY-0005e6-Dm; Mon, 31 Jul 2023 13:58:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573084.897437; Mon, 31 Jul 2023 13:58:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQTPY-0005dz-BG; Mon, 31 Jul 2023 13:58:12 +0000
Received: by outflank-mailman (input) for mailman id 573084;
 Mon, 31 Jul 2023 13:58:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Lm7y=DR=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1qQTPX-0005dn-Dn
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 13:58:11 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4872aef3-2faa-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 15:58:10 +0200 (CEST)
Received: from Dell.homenet.telecomitalia.it
 (host-79-23-62-117.retail.telecomitalia.it [79.23.62.117])
 by support.bugseng.com (Postfix) with ESMTPSA id 752DB4EE0737;
 Mon, 31 Jul 2023 15:58:09 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4872aef3-2faa-11ee-b255-6b7b168915f2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [XEN PATCH] xen/arm/IRQ: uniform irq_set_affinity() with x86 version
Date: Mon, 31 Jul 2023 15:58:02 +0200
Message-Id: <018fb3a81eb6669346694f2669333ba4d67ab5c4.1690811728.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Change parameter name of irq_set_affinity() to uniform the function
prototype with the one used by x86.

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/arch/arm/include/asm/irq.h | 2 +-
 xen/arch/arm/irq.c             | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/include/asm/irq.h b/xen/arch/arm/include/asm/irq.h
index 105b33b37d..c8044b0371 100644
--- a/xen/arch/arm/include/asm/irq.h
+++ b/xen/arch/arm/include/asm/irq.h
@@ -91,7 +91,7 @@ int platform_get_irq(const struct dt_device_node *device, int index);
 
 int platform_get_irq_byname(const struct dt_device_node *np, const char *name);
 
-void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask);
+void irq_set_affinity(struct irq_desc *desc, const cpumask_t *mask);
 
 /*
  * Use this helper in places that need to know whether the IRQ type is
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 054bb281d8..09648db17a 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -175,10 +175,10 @@ static inline struct domain *irq_get_domain(struct irq_desc *desc)
     return irq_get_guest_info(desc)->d;
 }
 
-void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask)
+void irq_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
 {
     if ( desc != NULL )
-        desc->handler->set_affinity(desc, cpu_mask);
+        desc->handler->set_affinity(desc, mask);
 }
 
 int request_irq(unsigned int irq, unsigned int irqflags,
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 14:02:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 14:02:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573091.897448 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQTTI-0007Fz-2I; Mon, 31 Jul 2023 14:02:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573091.897448; Mon, 31 Jul 2023 14:02:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQTTH-0007Fs-Uu; Mon, 31 Jul 2023 14:02:03 +0000
Received: by outflank-mailman (input) for mailman id 573091;
 Mon, 31 Jul 2023 14:02:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qQTTG-0007Fm-LV
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 14:02:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qQTTF-0001JV-KR; Mon, 31 Jul 2023 14:02:01 +0000
Received: from 54-240-197-227.amazon.com ([54.240.197.227]
 helo=[192.168.23.92]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qQTTF-0001Yl-Dr; Mon, 31 Jul 2023 14:02:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=AaRZq78J1LGlxBz2JCYYPuqbN93fPOMLas1+HWp6Cq4=; b=l6zlASC53G+QFdPxEx64UR2+Pj
	gEPSPgawLCTELuJ3r49GS6g6y66OMz+uq/N4RKZ0VLZdFs6a5YJIdAnR81OVJ9F6xONSVUuQp+SKf
	2syTHEbNYFS/yXW8M7Qsvo9+2UnmnSsjn/G0Fs+UNNst3xvJ9gyEVkN6NUxRF8KExTtA=;
Message-ID: <8165e7b1-4eef-7b13-32f3-05ff38837100@xen.org>
Date: Mon, 31 Jul 2023 15:01:58 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH 4/4] arm/efi: address MISRA C:2012 Rule 5.3
Content-Language: en-GB
To: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>
References: <cover.1690810346.git.nicola.vetrini@bugseng.com>
 <c153e4fbe19510ba1244024e7a4b8897c86afd3a.1690810346.git.nicola.vetrini@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <c153e4fbe19510ba1244024e7a4b8897c86afd3a.1690810346.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 31/07/2023 14:35, Nicola Vetrini wrote:
> Rule 5.3 has the following headline:
> "An identifier declared in an inner scope shall not hide an
> identifier declared in an outer scope"
> 
> The parameter 'fdt' in static function within this file is removed,
> as they served no purpose and shadowed the homonymous variable.

I am not convinced this is a good idea to keep 'fdt' as static variable 
around because the name is too generic. Also in the future we may be 
able to remove the global static variable.

This means that most of this patch will be reverted.

So as I wrote on Matrix, I would rather prefer if the global variable is 
renamed to 'fdt_efi'.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 14:07:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 14:07:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573094.897458 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQTYp-0007sD-Mi; Mon, 31 Jul 2023 14:07:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573094.897458; Mon, 31 Jul 2023 14:07:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQTYp-0007s6-Ij; Mon, 31 Jul 2023 14:07:47 +0000
Received: by outflank-mailman (input) for mailman id 573094;
 Mon, 31 Jul 2023 14:07:46 +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 <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQTYo-0007s0-An
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 14:07:46 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20604.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::604])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9e5a44d9-2fab-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 16:07:44 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB9594.eurprd04.prod.outlook.com (2603:10a6:102:23c::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul
 2023 14:07:41 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 14:07:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9e5a44d9-2fab-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=LMk9JIzN8HwYkL6uQzk/ob2OV1bVkjvFxIoBBD5JCAKgnB8TvwCrMYIrDx1zvWlikunp1dHQnzWKYZ5fJAt7tgE0Kix+6+zmxYNLp0A+nIt16tB04d0JNIeuxWH4HvNjaE1vGiWulrMMVdw97DMt5Y5+Gz41TNpjxii7S8w1l1PtHSp/SJraaR5KX0XfW4wZi/1Lk8OpvgrbmSpJ9UyUZ6wm4+jq/yTNaNlpO4tbE4Wex2XaIH0dAHMH2Z807kwvJaQpzonydT60N+jAnKd7NTmGjcNoO6hR3qRnAr2n2acMy5WfbfGmBL1lHaULNS3/vBn2nA9YS0uy+AzBNncMlg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ZPLiK1XbXOnQUoytDgEAYxMT80OH8WkR05LKs9yzXXw=;
 b=OXJYMFL1p2smJoRIpYxPjp721ljja2mUIwpuGQB5xYF36Nv1J3lyIakK4vsNAOj3pytOsDrhA+WmqlBSOC/msm2EAbr57YIhL+F8M3hQfXZwfzyXum+dlLiOS1PQGibhPUSWt0paye+nGh0Rf8TbL/fpYgiEE+JGxAythT7qIaaOudGaSpYu7rjOF3akRw3NHIQLT0jEW5+XMWgOvggP5vasc/p44nt+fFuQzdpTAqZcK036J0RnE4qZRR6P91/r9tbydrgdoKqblftSQ7NShEHiOCrgrTxU/MNetqsK5mOmWHRLpBhQbPOt5j+sgzuImjtWw3BqXxRHSvMkR/0ZeQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ZPLiK1XbXOnQUoytDgEAYxMT80OH8WkR05LKs9yzXXw=;
 b=klWLJMTaZ4BDyR7cpz8+C4A9XbfY/N+IZLl2mPAaugGPVVO44CkdQjMLSdZnCn7rguI2xfTtKoHBqsagzBH6N1mR5Fsq9+P2gkeJy7wi9eIr+dX2vFqmGeILsZ9AebLqQNVnCiGsWDJDWAAyS8vxe6THXmyVy7J3a14YRisajDmuRYv5B77RRo5HAW/EeCRA5bBi15Ol1T68Io7HekD69V2ccbxzwQbG7hOlJJqSntOLvKdaSXjnykQCNh5Ug6pfYBkadmwUD2wHjK0S0mb+GMlckluq+5q3TvbAJ/wTSuekGVM3aq+Kp4ed1P6DHQSZ5+2+yQKEclUXWH0Yon5ZOQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <911eba8e-a92b-896c-e5dc-e54dcd570664@suse.com>
Date: Mon, 31 Jul 2023 16:07:41 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [PATCH v5 2/2] xen/riscv: introduce identity mapping
Content-Language: en-US
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1690464789.git.oleksii.kurochko@gmail.com>
 <ab2e719bbe071c3d5c4e3341573c0848dfcee3ee.1690464789.git.oleksii.kurochko@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <ab2e719bbe071c3d5c4e3341573c0848dfcee3ee.1690464789.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0188.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ab::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB9594:EE_
X-MS-Office365-Filtering-Correlation-Id: 407022a4-c050-46a1-74b0-08db91cf8144
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	sRTCJ4RwNzxXxiFkvg+7+AGixByA4GdgLE1BjE8sxClWTykv/Ip2l1PNs/ZCxmdAWWaZq0b57Y2jzS6iGqOJQ3iwZa4z8UGb21w5Fea6v3m8e0pxhoXT1prLPpcQOhQgGOSLY2s9NXVK+1x860Ynk0WbRcAHI9+Ul8JO7JQv6UuDrob9byy0Q3QLYzSdUw4tdOIEW7ghLHqVl3qJhIL7koBcsWoc18orF0oap/Fqf/qjUdZdfoAN2yHuW5M/mJ5UrLzDT0kI0BsEsaTmq5SBlvFgfE8VEYZCcCQye4FVnqnyWMK42F8oh33YL3Ix4UPPPH2vPxO4aaYMOEOSbQ7EGX/WRG4mjT2blFwrw+gQYiw0iP2owBJcfZ4iGaOUD2SFR9FAAEjS2lA7+0WwCHuh7n+urujHn5Kr7J7V0uSEA+un72xqTtd972zIYEaVxcgVTlSsukUVrL06CrEfRIHwGe/uChNtoj487fCaBQdDRJHB5YDB5wYzXd7cz5w4tMs/tIRIOZimKNG9rZwQqu/0gPQcEKIXZJiWeGyL1JAvxj1Y9qEeOstP0QeIAmFkiXwsZcKJl0t9BrJNP2MboKuXXEVY5aeX5s5Dgg0+0EFAUN5/fI0ofvtJsQ/qucgd0tKbut+iUW0QKgZMNz9Ssw23cA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(39860400002)(346002)(366004)(136003)(376002)(451199021)(38100700002)(31696002)(86362001)(36756003)(6512007)(478600001)(6486002)(2616005)(53546011)(186003)(26005)(8676002)(8936002)(6506007)(5660300002)(4326008)(2906002)(66476007)(66946007)(66556008)(6916009)(54906003)(41300700001)(31686004)(316002)(4744005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?R2I0cnp5WjQ0NFp6ekFmamdBcWRpSzZFWnZHRWNvdUNWWFJGM2ZHMWMyZm83?=
 =?utf-8?B?UXYrS0FZaTZRTnh4OVFDUVdBck12ZWIrUlpaZHhZOXNkcWJGaDR1VmgrVDA0?=
 =?utf-8?B?SkgxeEs5YUtOY0RUd1lVYzZrdHFtV2wxUjA1MEVNZGxrMm9TRkR5QStUYzRa?=
 =?utf-8?B?OWFQcXZIU0tMYTdRMFR1dGVNT2lXU3R2eG44V3pGYlpLb1NrKytaZW1yTXdl?=
 =?utf-8?B?MWtrZFNTZzJPNzU0ODQ4eThCQmdaMnJyS3djOThpNVZZTk5jb0VzVGE3anVr?=
 =?utf-8?B?QzVOS05DRlRKdTJwcDB4Ym1zaUh2c2MvQmdiNnE1RkExWjhHSm5jNWhlTjh5?=
 =?utf-8?B?WlRDNjhCTGtNeFFEc2pjRzFxMzlxMm4yeWdGRWljV1JWMmdGeFhvN3YxeVFk?=
 =?utf-8?B?NEhtK3FYdFJ2RjIvUjBCNm1xVENqK0ZOTUVCZTlPb0NuSnh4TjZGRi9nbjQ0?=
 =?utf-8?B?YWJuYmZZM2gwQmgzQUluWDRQU0hRWXVqc0F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utf-8?B?Y29tdi9WK0ZKRXRIVWJPbENudDJpVU9kUTBJbjdCN0UwemQ0Z0J4VnpxcWVR?=
 =?utf-8?B?dUtNbDdoUmlEYVVkQzNtN0FFSjZiTzFjTllPT0tEa1c0RWV6V3hET1NkYlhH?=
 =?utf-8?B?UFB0NVNUNTU4OUJPcHQrZnpUeG13SXY2MURuVHRHOUNwUlp5Rkh0UHR5Rnoy?=
 =?utf-8?B?Z0tub21jU0JSaDVtY0M5dHRLanJGODFmT08rUjBhdG84dVd5Y0I5K2lTS0x4?=
 =?utf-8?B?ZXZmbzdJaDRUek5ZdG9MRVV6dlBLSEgrTWFsNU5XTVVhTzBoSVNxMys0Mnpl?=
 =?utf-8?B?bDIxQzlENE56UTZ2WkM2TEVjZTRNRTh5WnJGNjB4SU8xY3hsUzNnTmhtV2hQ?=
 =?utf-8?B?YU84alZ4VHhsdlJHamFaeURJVkxUSHJJV1plajlnNmEvUjRkSXpzTytLZE9s?=
 =?utf-8?B?VVpDSWtrRy9oTldGeUxZL0w3Q1dBbTNsemV5anJQS091OWpJRlZpYWtqRlU4?=
 =?utf-8?B?dm5RWEtHYml3SjBlemk1Tko3bmdyd0ZtelRNT3ZPd1hzamRWbSsvSmkvTmdE?=
 =?utf-8?B?bmszT0JLZXRiUWp3S1dCSFRmM0RvMldJSHpRbWpac0htVGdzb3hzVzJjeStn?=
 =?utf-8?B?QThGaHJCMTBVdWM0S0I4emxDeUcrRXkydFgrVy9KdEJnWjlBOFh6MlhiOGZw?=
 =?utf-8?B?Ym5jQVdSM0pZdyszREhmZ281N2NFL3lqdE15cndzODNGaTA5WE1pN05Pdnha?=
 =?utf-8?Q?pqiMaUHy4/D8aFv+90TDijZQd?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 407022a4-c050-46a1-74b0-08db91cf8144
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 14:07:41.7066
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: cv2qrMPe48mEpyC8/7QGJaMZgPIFPf15jUaUmiMdEVvXwdW0xtbILPrhpZhrIArp/SiJ9a70tk2MHOHxcktHWQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9594

On 27.07.2023 15:38, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/riscv64/head.S
> +++ b/xen/arch/riscv/riscv64/head.S
> @@ -39,6 +39,23 @@ ENTRY(start)
>          jal     calc_phys_offset
>          mv      s2, a0
>  
> +        jal     setup_initial_pagetables
> +
> +        /* Calculate proper VA after jump from 1:1 mapping */
> +        la      t0, .L_primary_switched
> +        sub     t0, t0, s2
> +
> +        mv      a0, t0
> +        jal     turn_on_mmu

Any reason you don't do the calculation right in a0?

> @@ -54,3 +71,18 @@ ENTRY(reset_stack)
>  
>          ret
>  
> +        .section .text.ident, "ax", %progbits
> +
> +ENTRY(turn_on_mmu)
> +        sfence.vma
> +
> +        li      t0, RV_STAGE1_MODE
> +        li      t1, SATP_MODE_SHIFT
> +        sll     t0, t0, t1

Can't the last two be folded to

        slli     t0, t0, SATP_MODE_SHIFT

(I don't recall what li's valid value range is, so I'm not sure if

        li      t0, RV_STAGE1_MODE << SATP_MODE_SHIFT

would be an option.)

Everything else looks good to me now, but will of course want a
maintainer looking over.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 14:11:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 14:11:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573099.897467 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQTcZ-0000rj-4m; Mon, 31 Jul 2023 14:11:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573099.897467; Mon, 31 Jul 2023 14:11:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQTcZ-0000rc-25; Mon, 31 Jul 2023 14:11:39 +0000
Received: by outflank-mailman (input) for mailman id 573099;
 Mon, 31 Jul 2023 14:11:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQTcX-0000rW-Vy
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 14:11:37 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20609.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::609])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2945db10-2fac-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 16:11:37 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PA4PR04MB9488.eurprd04.prod.outlook.com (2603:10a6:102:2af::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul
 2023 14:11:35 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 14:11:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2945db10-2fac-11ee-b255-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Hej9dmuLPp71GMTVEInNFFpijvd4dGoyTsfks5mbj18HEo1vIfkYLFtcw6HY51Er176ow7GridTL9O8KeMMi0kXCuRtApaRuIQy+Ihi39VsGl8PGMvb5U25ZkeGVtvdWFkOmTtl3v9PqzzGv7lTaE5xcFMPrc5maakYwHF3/efqkx3BpoS+S82DVLWg/+1kSxT4e2tcokFl4POo6etvNOGxqvvFjU4U3jTrLMW9/V0H/92/Q29sGw+xCDgZbCCjnBzQL1hooOrfvuCrNwSYP/ITeRPtR4v5VFJ/NfYlU26fJq/mQ5Jg45kZhoy4YIXjTQYUxqcp1f8xSnbnXlRFRWA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=RNA3P3Y2g7sHUu5TisRCN8jMhK4/h6k+Ws8eNzjDEnM=;
 b=Xyn4mJmEcY3dAfRdTJHE+IWagedAtt5idEMbjUWTzuHolzEQf7MyXtNDQDDPoqylaOI6Lk6QaZ1nBeMOuOjs+l7hguCp3EWrhJ2Jre5EA5efNNDoA+Es17Rp6g5rtzDCAIUSo9ydzDVOFgI8l88HKxVICErrRoiHJgDTfTnbqLTIG+Z9wRR8qxk7R6aY3npzY3HvMjLmerHHI+/ZO7fkoU8tqmt1WgVqDfT93NJLpPe3PZoGunV4KUCqjLNxPRAsVl+h8jaZaDcKMAbmmyRRMhAnaWH0eUEwQ2lPBjOnSAzu29L0Mzd/lvn38dXrh+g2ISEi8Dmiw4f6ss8EeeQYcg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RNA3P3Y2g7sHUu5TisRCN8jMhK4/h6k+Ws8eNzjDEnM=;
 b=fhYAnqoN6sCD2MVtuvDY+6enT7r+7hTrJ8tnHnj7mW5hZE3iOdwNRCY7MThNWKiEc6r1nn1/Zer9NU+eyJKj6cOpt6GsTBRCYkwYNa40V2sXaKTD9S9t/gczZ70o/vK4Skwk6+wxvQ9vUaBQw2BJNwK7dhL7j/cliTB7eCZY+VOI5ib9JFhp/UxvbzZzDdFMUa6GRw6lkcL2tkt0Og5sSLyAmvoEblpFgV5A71pHE5dLkShU5Lj/XgoJH0Diu2J8JCrWULNt/wdkcSyZ1sh+c2FqGcSpCDQr2g0p2hHPOllc5U5JhbK6nrIGP1aqBvgY8i4MiPb6kKjEO4Bc2FVVVQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <8757d4b8-7765-e50f-73d2-34c7c34acaa5@suse.com>
Date: Mon, 31 Jul 2023 16:11:34 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [XEN PATCH v2] x86/hpet: Disable legacy replacement mode after
 IRQ test
Content-Language: en-US
To: Simon Gaiser <simon@invisiblethingslab.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
References: <a112f0fbbb333fc29a35d0a81853d59409a33fde.1690798460.git.simon@invisiblethingslab.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <a112f0fbbb333fc29a35d0a81853d59409a33fde.1690798460.git.simon@invisiblethingslab.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0088.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9b::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PA4PR04MB9488:EE_
X-MS-Office365-Filtering-Correlation-Id: 5c4dca34-dd27-477a-8312-08db91d00c85
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	UI+g2/RGIA2fh2GWT91bu3GH9N9DEQP87FuPGCampIU21wGUmGR8FK4l4+MFv0/E+BGdkrZxiuaTBfMF0YEnBsOtkzEz5zBRdCX5Lqyr+tur/jTaJKa5vjKebXyY8I1TQzH7LsQR9ypIG0LRKnQHiXoqqFq9itNAvcbYWYUSZJgZQMa8GmwOzOI571qMlW8MxhYoU+5SGSF+rkvISJ2Y3JBAoSwnyxT5UQi9tpcWYqOnfRFeXxk754/5XyCIfFwBOA8g4bEnoTPbha1vtfGzrtrWXdjGM4YjFg5C1fiJKR6DaA7j7UHMT2lAwoTe1hQrQk1/WGPBYoViNHOwzFqt8kSggnsUyAKnDcOWG2jPv2gFjw4Gt6rG5/ozTIdczFVUicUS3rpBbsVvN1R+xczyEPm9VGty+VPu8LvUZnjKKs1+fyriAukkWsgaoSe7GuAivt8DvTQCDiPc41PINhM0xr9VpwBFOgF++3ioqVto9a3znQA96hmrWLm6JTSQ0R2uGWAq1JVAsHJJER/xqK6Sz/OwN0FFqEkg9XUWWe1fiaqhuQRSHHjHGKZLMTTAD5iJLO6obnyxSkfQ4i/baUVpUFtV6g7DPLj6/buyZDA4dLzpDXnA5GZylx6zW32Yp9BDzrVMdOq6otK46aYZHCHWtg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(136003)(346002)(376002)(39860400002)(396003)(451199021)(38100700002)(36756003)(86362001)(31696002)(6512007)(478600001)(2616005)(6486002)(53546011)(186003)(26005)(6506007)(8936002)(8676002)(31686004)(5660300002)(4326008)(6916009)(66556008)(66946007)(66476007)(2906002)(54906003)(41300700001)(4744005)(316002)(83380400001)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MVlPc1pIUFpzT1RoVERaUlg5Q2ZpZUg1SXhhelpHSVlvUWxIKzNyTWsxdmJR?=
 =?utf-8?B?L1VENUpSb0R4MGRJeU4rUDJRR0I3eU9NbkM4NnY1ZGdma1lITWo1dkNEcita?=
 =?utf-8?B?UWdXYUlTV2xuMGE0TnU1N090OHFBblNnTWp6MzA1bHZnUEU4c2o4d3FPM3Rl?=
 =?utf-8?B?NWRZaGJ4S01LYmlzZm8yVC9rRmNEd2hOWlQxVW84UW5aL0owMHJjUy8xSVNQ?=
 =?utf-8?B?L3QzYk1yTUNMWjYydUZzNVQ0UkgyWV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cGZYOFhPQjg4d2tyZEhWd2hSQ2NXNzFJWDl5b2F3VnlJTUp3NlJFcE8ycG9Q?=
 =?utf-8?B?aFg0ZUdjaXdNSWdTMk9LVVNLbXUvcTFBa1ZHSWY4WUZHOVVPRUFzczVuMkZq?=
 =?utf-8?Q?fu9DWhef05wBPf7D2Ig2hWiJX?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5c4dca34-dd27-477a-8312-08db91d00c85
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 14:11:35.3471
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: nwxEsuq9gPV4THZ5+1h+0Koex9v0fjMto27JulxV6h1xvFU1BIysLJO0dPP5foBSNl/W/yGDeZKZF8T58A+7qA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9488

On 31.07.2023 12:32, Simon Gaiser wrote:
> --- a/xen/arch/x86/io_apic.c
> +++ b/xen/arch/x86/io_apic.c
> @@ -1967,6 +1967,8 @@ static void __init check_timer(void)
>  
>              if ( timer_irq_works() )
>              {
> +                printk(XENLOG_INFO "IRQ test with HPET Legacy Replacement Mode worked. Disabling it again.\n");
> +                hpet_disable_legacy_replacement_mode();
>                  local_irq_restore(flags);
>                  return;
>              }

I'm not sure of the value of the log message. Furthermore, considering
plans to make XENLOG_INFO visible by default in release builds, when
not purely a debugging message. I'm curious what other x86 maintainers
think ...

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 14:16:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 14:16:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573103.897478 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQThA-0001TB-MG; Mon, 31 Jul 2023 14:16:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573103.897478; Mon, 31 Jul 2023 14:16:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQThA-0001T4-JV; Mon, 31 Jul 2023 14:16:24 +0000
Received: by outflank-mailman (input) for mailman id 573103;
 Mon, 31 Jul 2023 14:16:23 +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 <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQTh9-0001Sy-FC
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 14:16:23 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on2060e.outbound.protection.outlook.com
 [2a01:111:f400:fe1a::60e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d19de2fd-2fac-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 16:16:19 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8859.eurprd04.prod.outlook.com (2603:10a6:20b:40a::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 14:16:17 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 14:16:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d19de2fd-2fac-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=fNF1YZxS0VYvdN0ByNpcQ6NHufpW08bo+J0BlsQkXqtw/gAOkmti9gTs13uoVUjGLdKPX8nElpB08/SGo3bijXS1/WctK2oBMa2Nwt2IZBTsgZXdXXCZxQhfpnITcmvBg4xjkneN9BFCqGfJC07oJY9cqmH6R7VDupGsLqQdOcCrtDJGFbtkDLXGYRzTqQbVUg+jWNIiho/xtSJw8YenhZxZDKTbUSRMHEdrWwdk8NUdox/CAzZZgPQZk4yu/N/6rC/oJdBPOw38OxEc5nqugfeXuzovO91WlIFi+6FtzYbrn0fKZ4Wr/7thWVhMnd/fIZ6HGiu0qI2zV/bGyaV77g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=l2nqBMasysDSGbivjSfZQvRhH6HyTeLAFSMh/oEQi1M=;
 b=V98+lINXIMEgpYGRkwCphfhbuonohW/3EOPF+hzoFxEFrXF83JRfIClZUFmk9H2dMtjkz31fmBMvV851CpONh3QSFKbZqLVv0nTq5eh8Atq4DxWFAYnAPhwwF/5YTsj03CqGFH3HcSLhl9DT38IgqWq2B51wZxz82dGLy0eRFtT5oqGCwDqIrGK9o2Kqr/mhePnK2lH+ja13O9r5EMjokA67sU9ledULnF+M+RCM5lmhFgBYk/h87CnytEGD4xvb+OsjprdHFA8H3gTc+gm2Bd4UZt1I9xlIoob62IhjzxCTnWA5EGPrZDo2xP5cMqEGdo88NbHLr2X1IWUccunJAA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=l2nqBMasysDSGbivjSfZQvRhH6HyTeLAFSMh/oEQi1M=;
 b=riPJ1tQfxGNoef5dkGF33UW9yh/7v3tf7YxlxPn2Sh9A9yvA6gVIumGn2V59Db4h7OOulPY3a6kFUlha9SgmP2xC4RobG291NvQNVf+E1B6r5/MZf51DwdD0GbrYbuoD4KKyT1XOc12AcJVpXQ9/1oKbQELuy+pYQB0rS8kYyO2zYTP0R1OKyiCNcM4V1ux087EDQHINO9cHAGfjT0r0HCuJ6MoqecJIgZAGaCQr23aAhD91cZtFUqWpE6z2bX4CFd0MpKzc3jOskfDiBMopfPX0NnVQWEkIAS5wFRy7khDACGdq1vKIR4NsL3KrN9T2az2eMkT/TBYGhZJ1yDnm1g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <dce3d16f-7bc5-a22d-3872-36d3a617c120@suse.com>
Date: Mon, 31 Jul 2023 16:16:16 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [XEN PATCH 1/4] xen/pci: rename local variable to address MISRA
 C:2012 Rule 5.3
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Paul Durrant <paul@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?=
 <roger.pau@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1690810346.git.nicola.vetrini@bugseng.com>
 <c9c6dd21ec6e88895ebc15ee6fe96090168afb51.1690810346.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <c9c6dd21ec6e88895ebc15ee6fe96090168afb51.1690810346.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0126.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:94::16) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8859:EE_
X-MS-Office365-Filtering-Correlation-Id: 52670da6-4ed2-4bb3-8460-08db91d0b455
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	nBr2DTlWzYKLlU77I6tku8KKrWYPDSLceLNaJEoNkvd9ui0Ft5960d/iI3BVWoxV/xi8Y5HjUD2pjEeorTZPSibQfuHrxZDJIIRKqh6er8PymK87H5k8nWewulTqAeXzJdvrZmquvOhkH55M/txGJSJrFfCW1p6YAYdtzjXKTtGgP5ZJa/TAoPPaXAbSss/lGtVMJggeH+M+Wp0XtFH1FHt+DqWvx8mbVb/8a33DjhaVvRNygKV/PBHuWd+JOFFu65t2t7WTtsyRRJch8reXOd6O6jE8BuRFz6RHHHO3sep/542p+DdamxZM6sjeg+vcB7LHcL6moB34v1wnaqfUqJUU5tsI8oMdEnG2lPPBiF+IdZYELcXns1/18ehKROEOw7I1tsY6a66pyOwjPlHYQ/G4+Z6ERFVf2Z8iMbx0QToqrN9ik6oRObSJssv2SzGVdOSL6ZZiE4p71g2b6BVDls1KJDzUHUpLM9Vr9u93WYPRMUERBRSSqd4TBJ0JBPv2li0V6VQ4zGYxgSDT0oEJwjW07nP9JiaApvN4HdMGp2JHAb732H45pARY7poRX5+piwuO+5aoI9Mm8GsQ2SSumHfQTqvBAa9pycapnwx3zzzd6JNuNq3r2S8h14JsM31fdOcskJOxIl7r1EEhQMh8Vw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(396003)(346002)(136003)(39860400002)(366004)(451199021)(6512007)(6486002)(186003)(36756003)(2616005)(31696002)(86362001)(38100700002)(26005)(6506007)(53546011)(5660300002)(41300700001)(8936002)(8676002)(31686004)(6916009)(66946007)(66556008)(66476007)(2906002)(4744005)(316002)(478600001)(54906003)(4326008)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aE92UUdhRmMvN283SWNUblJscndGK3FGNDdkekdsZllBenBhR1M4K0NwWDNR?=
 =?utf-8?B?ek1SVmZVcG5NeE54c2ZVUzM3alo4TENJc0ZDb3p6RU5KcUtNM0FobVhIellm?=
 =?utf-8?B?MCtOZDh3dmhyTkdUSHphdTkxU3NLazdIZS84U1VUZlF0VUNrSlZlUVR5VGVY?=
 =?utf-8?B?RUJjRE84Nlk3WW83YTBKVHJud3h5bWU2YzFDdjlySE5kT01lYTJmMi81RU53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VWazZ5ek1IelVqdndB?=
 =?utf-8?B?UjNmR3VtR0pjU1ZPL3dzZGFQTTBtUThoK0cvNkhla0x6VHVRTDJET3NrL1Yv?=
 =?utf-8?B?SzdCZDROeWxsNEpMeFMydHp2bFRWM21DQ3lVZElYWE40Sm43b3hMTExYaW1G?=
 =?utf-8?Q?3+/4xEMoYGhG2SSQOEavDL0im?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 52670da6-4ed2-4bb3-8460-08db91d0b455
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 14:16:16.8773
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 3N1hBhAsuHeMmYD0s9Jg5VpSKJoqwuWAbLjyXfXqpwB6gy9VSravXe8YtVlnKzcHIsyfDmVntwg+dzIDaXXgCg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8859

On 31.07.2023 15:34, Nicola Vetrini wrote:
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -650,12 +650,12 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>      struct pci_seg *pseg;
>      struct pci_dev *pdev;
>      unsigned int slot = PCI_SLOT(devfn), func = PCI_FUNC(devfn);
> -    const char *pdev_type;
> +    const char *pci_dev_type;

I've always been wondering what purpose the pdev_ prefix served here.
There's no other "type" variable in the function, so why make the name
longer? (I'm okay to adjust on commit, provided you agree.)

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 14:19:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 14:19:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573108.897487 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQTkG-00026y-6f; Mon, 31 Jul 2023 14:19:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573108.897487; Mon, 31 Jul 2023 14:19:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQTkG-00026r-45; Mon, 31 Jul 2023 14:19:36 +0000
Received: by outflank-mailman (input) for mailman id 573108;
 Mon, 31 Jul 2023 14:19:34 +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 <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQTkE-00026l-HM
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 14:19:34 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2045.outbound.protection.outlook.com [40.107.7.45])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4408e7f4-2fad-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 16:19:31 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM9PR04MB8305.eurprd04.prod.outlook.com (2603:10a6:20b:3ee::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 14:19:02 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 14:19:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4408e7f4-2fad-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=WGNeovl3uSjWjjEaKUTD1227NR/KjA/Z6KNqLXIsZFA+MS0O831NUlCn6+dBVJwF/9teCsfHIfJq0fTjZ/gFJ2DjhlNhg2vbFD0dvE9MW/PcUnS8fHyae8UDCM79P1uwlqxcMgT0kugPBdIiAa7i7lujQsQZQ8MuM+5b7LliAfcpgYiUgAP8+VeyfQ5SLUjzwlxOPxbkGZFdQjOf1eRflVPiNb4SgsrDZte9PBHSoUZF3lc7x79Ti7Bhg9bWGskBRZP5qtCF3E8F9qSIWrUpN0wu39VHIbR5i0RRdlFuCsNI5beR11GzPtLxegbfDTqNvS9miDSGKzFXyHUUj15cPA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=CUdFl4vZxDrPjsHTzYciQBMWxfrMsPxGSPY01MXXnlk=;
 b=g2AWUa5QBRCiqQDhW4rhRA9KO35TA2KhProm/on/c2Lm0R5SFlhaiMsNMdHe2+B/bJvNjZtlBIdvZe15ykeqX8LIn3rOQDaL55m4EnPxn3gZYb1upU/Y3GqIBBjBgRLQ8VIC7nkY8/oxL0Zp6SE2GAeQQ4e5KKd0Vd4+aqusjXEJHYbFO5fwR+fY3Doe12DgGvCu/Dd5HasEnR0q2edI3UPk1sJQiPW7T0ybx1D+aQ9Jypeg2IW6Pmz7mY/H805oiKYNBFVQ8COY7LL7lx8JuueHMUhOfWSWU8ATztJdPkylTn/YILQtcyV/ZV5KOPonrdvbICGCgAU68PWfTjYDqA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=CUdFl4vZxDrPjsHTzYciQBMWxfrMsPxGSPY01MXXnlk=;
 b=dmpkl4ofLxW1IXF1PQF4OlsKCtJU37bjm3wc/qBx3YlCOuhyu4uPAIxA40yX6ElusZ2BCyuwiqYuB38QQXY/yPzBPTj2x/AiZYZp/Lgw//1e/+Vj1Rzld/KiEdtFJQxyfiWM/2QyCfqZH2oIb2FoI3mYBlmYRLAosaWZIYsTBGnhNFrXkT2zTyy6uaPgu+2AWesxYDvzF0w6t5Ml9neJihFHrOG7INfhcHmvhefIAFLrVHchq1kdf3/IFyKb4Qlxq97PnKSFBR8sSNuGPPMN5kzzhiU3FVbeTy4l8m/3/EMc3fNp8Cd4AyK8vET8WVWzQhgXv+8N6FdZPezcOaw6sg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <340c96a7-02d7-7434-4de3-8d1b12213167@suse.com>
Date: Mon, 31 Jul 2023 16:19:00 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [XEN PATCH 2/4] amd/iommu: rename functions to address MISRA
 C:2012 Rule 5.3
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1690810346.git.nicola.vetrini@bugseng.com>
 <838e606bfe8b83578970ce73a1ac7d71ccefcd2b.1690810346.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <838e606bfe8b83578970ce73a1ac7d71ccefcd2b.1690810346.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0185.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:ab::10) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8305:EE_
X-MS-Office365-Filtering-Correlation-Id: 73c209aa-6b73-4eef-b737-08db91d116cd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	7RReNyBEdp2w4b9PzvGOcESk1rJksgVZ+PRgiCtJSUxAomQWjPrSO8sVsiVCfcAv4caQpZwHpbgkGvTJwOdPkD1dYPkKHVRAXPyfWRuuowRIKg0ul+4T4pVMJNb33XUC49H+RxTqK9HczQbKgmYyff1zRniY/BDDY4N4DbyOtwNfHz5gpekXYzl/2+GwH8qPsBgAL/Jz+92l5nbtVZCe12byfA2iZ4rYnItfY2UP8SLLOvlM0+M0WN4gcsLu2n7JKLkui7UEEYwfPctu85DmTklvauyClj44O2y30jj/izsUnXehljk6BEzoBbMU01UApDCgQhMH340jQQ63BDLdrB4IFk52YxtIRXnZ5/wkuKKH02ojmk9ue0Pr3iIMMkY2x6ltb4OEfp8OTYyP+MeCUUuCxlElo8JK/z3jSJ188Dw1yW6CmMsYFRjvXreeHKNM/X9VuVE3Kwx22TNKtKybMPxHyDI/kNOY4nBMSfKbPXaRTJcw8dGaXYGV+f/6dNIG61VlPHkvWsyZPuf4C1TPSYnh8VE7qMNd5VO/q86VHndAv4kCSZ2PtChgEVlS68m8mxDbeJcaPddRUqpqhKFl+ik6bmnPsFKJqDf+L0EZea3MP86zavzsoN/ohdmF0UWjqOTo5FAI/ccY466o2iWGGQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(39860400002)(136003)(396003)(346002)(376002)(451199021)(6512007)(6486002)(36756003)(53546011)(2616005)(26005)(6506007)(186003)(66946007)(66556008)(41300700001)(31696002)(66476007)(86362001)(316002)(4326008)(5660300002)(6916009)(8676002)(8936002)(31686004)(2906002)(478600001)(38100700002)(4744005)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?OUFmRm90YkNTQ1M0bjFwdVBmWEllbUlFc1R0YjVDL0toc0puVFZTTTFSZ2Q2?=
 =?utf-8?B?KzJXQitLRTBvTG9jd2xoRXFmWlJiU1lHRzhidlF2N3RzS2ViQlduNC9DU0kw?=
 =?utf-8?B?Z09NNEJVRmJKdithWVp6UVRYTVNoWS9oTk4wTlFKd3Y3bWJFM25nQngyRWFD?=
 =?utf-8?B?cmtQWEpiT1pYMk04MThCYVBRaGJCQTR5QWZpRTdGNXdDeG5scGFOUi9OazBD?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Nzhvamp3YXEwZVppS2NOUFdDcElwcDhCMzhu?=
 =?utf-8?B?MjFVaXBzV0J6YzNZa0NLWS9Pai9MRE55ck5OUUh2ZXBRYWk3N1I5ZkNlM2tv?=
 =?utf-8?B?QWM1ZG5aWW5neUhKeEZHb0pUdDV6dzlNNlJicXFnZWgySUZTNHMxdzVub3BN?=
 =?utf-8?Q?/6TudVHqbh7rZ/oB0AtUkTMKL?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 73c209aa-6b73-4eef-b737-08db91d116cd
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 14:19:02.1146
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Y5kUSp/nMhSVcV0bkK2Elw4UJza3CRk44fB71/v5y/44jeWmA+KEQ42UsA+pmvzgYwzsfvSI3XoHSeQQSv44Sw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8305

On 31.07.2023 15:35, Nicola Vetrini wrote:
> The functions 'machine_bfd' and 'guest_bfd' have gained the
> prefix 'get_' to avoid the mutual shadowing with the homonymous
> parameters in these functions.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

Of course there are several other oddities, but in the end the entire file
in a single big one, I'm afraid.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 14:34:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 14:34:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573114.897497 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQTyW-0004VD-Do; Mon, 31 Jul 2023 14:34:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573114.897497; Mon, 31 Jul 2023 14:34:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQTyW-0004V6-Aw; Mon, 31 Jul 2023 14:34:20 +0000
Received: by outflank-mailman (input) for mailman id 573114;
 Mon, 31 Jul 2023 14:34:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQTyU-0004Uy-FL
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 14:34:18 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on0612.outbound.protection.outlook.com
 [2a01:111:f400:fe02::612])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 53d3c969-2faf-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 16:34:17 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS1PR04MB9261.eurprd04.prod.outlook.com (2603:10a6:20b:4c7::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 14:34:13 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 14:34:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 53d3c969-2faf-11ee-b255-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ZZh/1ZnLEehFziwE9fmKVNRBhx6IUzM4IYL3V55Rm5VQsK1GxwfQRDLu1TcqZ4rweddcgXDsPK/oguvzuRJKq9G8h43ly3I3+fv1IxCYDUOMqPEs6MaYwWRiaFzz0o2RFkTNYJoYOGgpBQKQ9RS14OGG755Xv2YwEwKdXyHrOqynEBl8XPD/6qWO9owVEf8T2iTr25Ts8UJhGf3vGwm/Zr628izcuYWHQxDRtH2Qvv7ZClDSBrlsPRR5Yk6QuQbw/d0pdvRWcWFglMM9FlsIh1FU0iekqLPpcTQsWY/GJcghid4q/YWgPpNmbFy8K1e+87jPDBUg6xEpnSMNg38Myg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3FX8rbhAcyUryLoKijikT17wPy7qOP35SQufsVcD/gc=;
 b=Qd2qQje2JQdfvc5m3ajUwqceByWCKLpyJsFW/RLxEQdufcBUvOzuVs36Asqxp78CoFeW8zcZUce9UbUbVkR1HTZX/f6BhXx4CzzAE82qayTDeQQp0o4kW0CtXCm6p5v2c9IgGjTwm8ZmCnWKEkXYb+RAD1qG/K9gvLqgZgh9GDFKW5cS/DVhUgbnreLkZouHikc94oBjDTj8N5kK+HoSTWrBN1xsPPxC9OZGlC+E6FYb5NUazaxsz2QjANhlo4cAOCFzyd8YZ4UYmDDOwwwMoIrnMTPk1RQyVxQpG/lOi395y6h9FVBodbWlbGhqx6QhvylY7bl9XzfXEtPoW9bQ6A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3FX8rbhAcyUryLoKijikT17wPy7qOP35SQufsVcD/gc=;
 b=NwUd7K4JBUyQ4UOlyEqvuPEoM7iEYLHGR19gulpJGtaTRewE8grz+xGV4rNFqWk7LUGaf0ui0FUNHpL8y7PFLgiDtcr7+gegapp2GPDbYyoCbV+4FbklF6BH4slRFyXGhG2xQq7RgZsFJT6+z+/oSYXPUBPJahp10py3+iYwuY7Ss33IqjhGGX96nofzCFLl1Z1zrgu3XLSj7DYmkkBbEME6Y8S5A842BnKD6GPjo/QNQ4XBmCZJ/mCuu3IjxwDtx7o6vgUbT1aKi2T5QtPTVsopiDuGL5ZsIjdrxz+srRhi1d8H6Sm5yFT8e/p06B1irUBI3NlfDnkwoRt3YIWnqQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <f12b9c37-b7d0-ce03-024d-709a7fda7f26@suse.com>
Date: Mon, 31 Jul 2023 16:34:12 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [XEN PATCH 3/4] xen: rename variables and parameters to address
 MISRA C:2012 Rule 5.3
Content-Language: en-US
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Wei Liu <wl@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1690810346.git.nicola.vetrini@bugseng.com>
 <8aebc67a150cb4116affdd6da755a8e82c827ffa.1690810346.git.nicola.vetrini@bugseng.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <8aebc67a150cb4116affdd6da755a8e82c827ffa.1690810346.git.nicola.vetrini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR3P281CA0141.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:95::14) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS1PR04MB9261:EE_
X-MS-Office365-Filtering-Correlation-Id: 196adfc7-bc25-4ea3-fb6f-08db91d33610
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	dpnYPN1fyYoOYal+HA/mJW/AHrJmzZTvjZokkKxTeKqiFvXws37ArgQR6gDU/rwACTyB+NyVKn3Tlxjd8H2SUcxWbTvUhGO+PzfGEkLrshM8hVYMtFsR3FPsZUDv3KVnAxEwzPWwuUYgXw8mzyQefQ3jVljoxYlvfEYmCeQJeI87UKNPX7gJ4zF/gQU0p9sDfE40vbyxVPsWc30eo1c+TEnjT+rIQR//IlWZNdRTH4ZUAYwWMx1EbJoX+O2crWCcwx9C6FoprHKa8zp0az65a+E2xyCTpKkqh+FjxrKd2I+18oZVVbZmiNGrVyS1joICoYwkVTFQws957rnmsDEhJt74o1Ix7lyLOYUbiwJWkqMVOo6Ukr24xI+qExrTKOewNaBiVE1NTl2cOHlz2qHBcD9CAAASlebTn5Ve4pfJRgXdNFsYFPpEwF5lfFkfoTRbrsRYMAPPZR0WjTlMt8lZkBlvy0+O4JtgLB8WXzaVOUeKFFkK6VB9EnA4nFWcDySr75NU4c4H5vPXQ9Stw+LJ/awJ9r3W/9lzjqpL9RUtImvpzvvL4O/gkL8GOswuFvkbfS1C2G2Hv8y2BDabRNe20RIXJbYd+4SoUBYuws+PklXkStyezJuYveqAvcf7C57pQNuxEhHN/lDQVE8Um7Hykg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(396003)(346002)(136003)(39860400002)(366004)(451199021)(6512007)(6486002)(186003)(36756003)(83380400001)(2616005)(66574015)(31696002)(86362001)(38100700002)(26005)(6506007)(53546011)(5660300002)(41300700001)(8936002)(8676002)(31686004)(6916009)(66946007)(66556008)(66476007)(2906002)(316002)(7416002)(478600001)(54906003)(4326008)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NC9TM0tBdXZrRDB2aGFKZUNKOHJqbTgvS1FhUmhkbmRqaGFLc2VhNVNNdXlB?=
 =?utf-8?B?aDUwWXBIdnNHZFBIanF0V1VMYWRUd0crQ3VFOWV3WHJuakpZNSt2ZDV1dURG?=
 =?utf-8?B?TlpjQWh5RTRnd1FTOURCZC9GWWNOZzJuNzhkRVU0RENOQnJOREpOMkFnWHgw?=
 =?utf-8?B?OE9mKzhtQ2g1MjVmUTB6UHJyckh3NlRGYTMyTGs2S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RWJYR0ZZeXFxYXVLNHByTUE1VTZ5ME5w?=
 =?utf-8?B?UTEyMVVtWTN6S2pjZytqanZHVDZjb2ZTZ0w1bGExTGZTUVo0RjJOZzRTU1Rt?=
 =?utf-8?B?Zm13ZHI5dGlFVFVsRWJ3NytzOUNwMVBsNDJnWmQzSmdDNENIOGNpWFhmU2h2?=
 =?utf-8?Q?JHjtMa1MBTDAU8flgzlbci+a6?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 196adfc7-bc25-4ea3-fb6f-08db91d33610
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 14:34:13.5587
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: tyol60DNLLvixHUujPSVXvg9wsg5CJFF9Z70G2+C3XawCpml+CfCIIOTc9HMCeh53wNthiMWpA5NKw9R2ZoObQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9261

On 31.07.2023 15:35, Nicola Vetrini wrote:
> Rule 5.3 has the following headline:
> "An identifier declared in an inner scope shall not hide an
> identifier declared in an outer scope"
> 
> Local variables have been suitably renamed to address some violations
> of this rule:
> - s/cmp/c/ because it shadows the union declared at line 87.
> - s/nodes/numa_nodes/ shadows the static variable declared at line 18.
> - s/ctrl/controller/ because the homonymous function parameter is later
>   read.
> - s/baud/baud_rate/ to avoid shadowing the enum constant defined
>   at line 1391.
> 
> No functional change.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
>  xen/common/compat/memory.c   |  6 +++---
>  xen/common/numa.c            | 36 ++++++++++++++++++------------------
>  xen/drivers/char/ehci-dbgp.c |  4 ++--
>  xen/drivers/char/ns16550.c   |  4 ++--
>  4 files changed, 25 insertions(+), 25 deletions(-)

This is an odd mix of files touched in a single patch. How about splitting
into two, one for common/ and one for drivers/?

> --- a/xen/common/compat/memory.c
> +++ b/xen/common/compat/memory.c
> @@ -321,12 +321,12 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
>  
>          case XENMEM_remove_from_physmap:
>          {
> -            struct compat_remove_from_physmap cmp;
> +            struct compat_remove_from_physmap c;

The intention of the outer scope cmp is to avoid such inner scope
ones then consuming extra stack space. This wants making part of the
union there.

> --- a/xen/common/numa.c
> +++ b/xen/common/numa.c
> @@ -382,7 +382,7 @@ static bool __init numa_process_nodes(paddr_t start, paddr_t end)
>   * 0 if memnodmap[] too small (or shift too small)
>   * -1 if node overlap or lost ram (shift too big)
>   */
> -static int __init populate_memnodemap(const struct node *nodes,
> +static int __init populate_memnodemap(const struct node *numa_nodes,
>                                        unsigned int numnodes, unsigned int shift,
>                                        const nodeid_t *nodeids)
>  {
> @@ -393,8 +393,8 @@ static int __init populate_memnodemap(const struct node *nodes,
>  
>      for ( i = 0; i < numnodes; i++ )
>      {
> -        unsigned long spdx = paddr_to_pdx(nodes[i].start);
> -        unsigned long epdx = paddr_to_pdx(nodes[i].end - 1);
> +        unsigned long spdx = paddr_to_pdx(numa_nodes[i].start);
> +        unsigned long epdx = paddr_to_pdx(numa_nodes[i].end - 1);
>  
>          if ( spdx > epdx )
>              continue;
> @@ -440,7 +440,7 @@ static int __init allocate_cachealigned_memnodemap(void)
>   * The LSB of all start addresses in the node map is the value of the
>   * maximum possible shift.
>   */
> -static unsigned int __init extract_lsb_from_nodes(const struct node *nodes,
> +static unsigned int __init extract_lsb_from_nodes(const struct node *numa_nodes,
>                                                    nodeid_t numnodes,
>                                                    const nodeid_t *nodeids)
>  {
> @@ -449,8 +449,8 @@ static unsigned int __init extract_lsb_from_nodes(const struct node *nodes,
>  
>      for ( i = 0; i < numnodes; i++ )
>      {
> -        unsigned long spdx = paddr_to_pdx(nodes[i].start);
> -        unsigned long epdx = paddr_to_pdx(nodes[i].end - 1) + 1;
> +        unsigned long spdx = paddr_to_pdx(numa_nodes[i].start);
> +        unsigned long epdx = paddr_to_pdx(numa_nodes[i].end - 1) + 1;
>  
>          if ( spdx >= epdx )
>              continue;
> @@ -475,10 +475,10 @@ static unsigned int __init extract_lsb_from_nodes(const struct node *nodes,
>      return i;
>  }
>  
> -int __init compute_hash_shift(const struct node *nodes,
> +int __init compute_hash_shift(const struct node *numa_nodes,
>                                unsigned int numnodes, const nodeid_t *nodeids)
>  {
> -    unsigned int shift = extract_lsb_from_nodes(nodes, numnodes, nodeids);
> +    unsigned int shift = extract_lsb_from_nodes(numa_nodes, numnodes, nodeids);
>  
>      if ( memnodemapsize <= ARRAY_SIZE(_memnodemap) )
>          memnodemap = _memnodemap;
> @@ -487,7 +487,7 @@ int __init compute_hash_shift(const struct node *nodes,
>  
>      printk(KERN_DEBUG "NUMA: Using %u for the hash shift\n", shift);
>  
> -    if ( populate_memnodemap(nodes, numnodes, shift, nodeids) != 1 )
> +    if ( populate_memnodemap(numa_nodes, numnodes, shift, nodeids) != 1 )
>      {
>          printk(KERN_INFO "Your memory is not aligned you need to "
>                 "rebuild your hypervisor with a bigger NODEMAPSIZE "
> @@ -541,7 +541,7 @@ static int __init numa_emulation(unsigned long start_pfn,
>  {
>      int ret;
>      unsigned int i;
> -    struct node nodes[MAX_NUMNODES];
> +    struct node numa_nodes[MAX_NUMNODES];
>      uint64_t sz = pfn_to_paddr(end_pfn - start_pfn) / numa_fake;
>  
>      /* Kludge needed for the hash function */
> @@ -556,22 +556,22 @@ static int __init numa_emulation(unsigned long start_pfn,
>          sz = x;
>      }
>  
> -    memset(&nodes, 0, sizeof(nodes));
> +    memset(&numa_nodes, 0, sizeof(numa_nodes));
>      for ( i = 0; i < numa_fake; i++ )
>      {
> -        nodes[i].start = pfn_to_paddr(start_pfn) + i * sz;
> +        numa_nodes[i].start = pfn_to_paddr(start_pfn) + i * sz;
>  
>          if ( i == numa_fake - 1 )
> -            sz = pfn_to_paddr(end_pfn) - nodes[i].start;
> +            sz = pfn_to_paddr(end_pfn) - numa_nodes[i].start;
>  
> -        nodes[i].end = nodes[i].start + sz;
> +        numa_nodes[i].end = numa_nodes[i].start + sz;
>          printk(KERN_INFO "Faking node %u at %"PRIx64"-%"PRIx64" (%"PRIu64"MB)\n",
> -               i, nodes[i].start, nodes[i].end,
> -               (nodes[i].end - nodes[i].start) >> 20);
> +               i, numa_nodes[i].start, numa_nodes[i].end,
> +               (numa_nodes[i].end - numa_nodes[i].start) >> 20);
>          node_set_online(i);
>      }
>  
> -    ret = compute_hash_shift(nodes, numa_fake, NULL);
> +    ret = compute_hash_shift(numa_nodes, numa_fake, NULL);
>      if ( ret < 0 )
>      {
>          printk(KERN_ERR "No NUMA hash function found. Emulation disabled.\n");
> @@ -580,7 +580,7 @@ static int __init numa_emulation(unsigned long start_pfn,
>      memnode_shift = ret;
>  
>      for_each_online_node ( i )
> -        setup_node_bootmem(i, nodes[i].start, nodes[i].end);
> +        setup_node_bootmem(i, numa_nodes[i].start, numa_nodes[i].end);
>  
>      numa_init_array();
>  

I think renaming the file-scope variable this way would be more logical
and less risky (the way you do it it's easy to miss one place without
the build breaking).

> --- a/xen/drivers/char/ehci-dbgp.c
> +++ b/xen/drivers/char/ehci-dbgp.c
> @@ -424,9 +424,9 @@ static void dbgp_issue_command(struct ehci_dbgp *dbgp, u32 ctrl,
>           * checks to see if ACPI or some other initialization also
>           * reset the EHCI debug port.
>           */
> -        u32 ctrl = readl(&dbgp->ehci_debug->control);
> +        u32 controller = readl(&dbgp->ehci_debug->control);

Why "controller" when the field read is named "control"? Perhaps
easiest would be to drop the variablÃ¶e altogether: It's used exactly
once, ...

> -        if ( ctrl & DBGP_ENABLED )
> +        if ( controller & DBGP_ENABLED )

... here.

> --- a/xen/drivers/char/ns16550.c
> +++ b/xen/drivers/char/ns16550.c
> @@ -1473,7 +1473,7 @@ static enum __init serial_param_type get_token(char *token, char **value)
>  
>  static bool __init parse_positional(struct ns16550 *uart, char **str)
>  {
> -    int baud;
> +    int baud_rate;
>      const char *conf;
>      char *name_val_pos;
>  
> @@ -1504,7 +1504,7 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
>          uart->baud = BAUD_AUTO;
>          conf += 4;
>      }
> -    else if ( (baud = simple_strtoul(conf, &conf, 10)) != 0 )
> +    else if ( (baud_rate = simple_strtoul(conf, &conf, 10)) != 0 )
>          uart->baud = baud;

So along the lines of the earlier remark on common/numa.c: Here you're
actively introducing a bug, by not also renaming the further use of the
variable. Please reconsider the name change.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 14:41:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 14:41:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573117.897507 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQU5r-00060x-50; Mon, 31 Jul 2023 14:41:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573117.897507; Mon, 31 Jul 2023 14:41:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQU5r-00060q-2Q; Mon, 31 Jul 2023 14:41:55 +0000
Received: by outflank-mailman (input) for mailman id 573117;
 Mon, 31 Jul 2023 14:41:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1qQU5q-00060k-55
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 14:41:54 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qQU5p-00028Y-6k; Mon, 31 Jul 2023 14:41:53 +0000
Received: from 54-240-197-227.amazon.com ([54.240.197.227]
 helo=[192.168.23.92]) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1qQU5o-0003EZ-W8; Mon, 31 Jul 2023 14:41:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=lna8YsVuLUxyqSQZgnoloZa/ZR80uey4Xv3wHeLWMio=; b=PgeWr7WK2N+VZ4jtKIHwr5teTN
	L8NE8zRX5vc6gE9H4vEwdssNdOw2ffxlVASj8ZnYYpjPintq2W/qE7n9vCra/VOnZLDMWX3W5zeFf
	526/YXqQnmoCmtOOdktSt2PSQgnCXpU0UndAwwXyjzw3cpdDGXpiX0FqroQaktKpSrPQ=;
Message-ID: <e7ccf9f2-e903-70f6-9975-897f890cb808@xen.org>
Date: Mon, 31 Jul 2023 15:41:50 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH] xen/arm: mechanical renaming to address MISRA C:2012
 Rule 5.3
Content-Language: en-GB
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org,
 michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com,
 consulting@bugseng.com, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <164303a2b19336a0e5f934a995d2a9c104035fab.1689952914.git.nicola.vetrini@bugseng.com>
 <ae4beda6-bb2d-b494-bc06-ce6475bf3624@xen.org>
 <1313523656e1573a189e73bf4d6a0fc0@bugseng.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <1313523656e1573a189e73bf4d6a0fc0@bugseng.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 28/07/2023 13:14, Nicola Vetrini wrote:
> On 21/07/2023 17:54, Julien Grall wrote:
>> Hi,
>>
>> On 21/07/2023 16:22, Nicola Vetrini wrote:
>>> Rule 5.3 has the following headline:
>>> "An identifier declared in an inner scope shall not hide an
>>> identifier declared in an outer scope"
>>>
>>> The function parameters renamed in this patch are hiding a variable 
>>> defined
>>> in an enclosing scope or a function identifier.
>>>
>>> The following renames have been made:
>>> - s/guest_mode/guest_mode_on/ to distinguish from function 'guest_mode'
>>> - s/struct module_name/struct module_info to distinguish from the 
>>> homonymous
>>
>> Typo: Missing '/' after 'module_info'.
>>
>>> parameters, since the structure contains more information than just 
>>> the name.
>>> - s/file_name/file_info in 'xen/arch/arm/efi/efi-boot.h' for 
>>> consistency with
>>
>> Same here.
>>
>>> the previous renaming.
>>>
>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>
>> Assuming there is no other comments, I would be Ok to fix it on 
>> commit. So:
>>
>> Acked-by: Julien Grall <jgrall@amazon.com>
>>
>> Cheers,
> 
> I don't see any further comments on this. Are you ok with committing it?

Yes. This was committed by Stefano on Friday evening.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 14:48:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 14:48:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573121.897518 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQUBn-0006hm-UP; Mon, 31 Jul 2023 14:48:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573121.897518; Mon, 31 Jul 2023 14:48:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQUBn-0006hf-QL; Mon, 31 Jul 2023 14:48:03 +0000
Received: by outflank-mailman (input) for mailman id 573121;
 Mon, 31 Jul 2023 14:48:02 +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
 <SRS0=wefb=DR=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1qQUBm-0006hX-Rs
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 14:48:02 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3ebd030c-2fb1-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 16:48:00 +0200 (CEST)
Received: from support.bugseng.com (support.bugseng.com [162.55.131.47])
 by support.bugseng.com (Postfix) with ESMTPA id 14CAC4EE0737;
 Mon, 31 Jul 2023 16:48:00 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3ebd030c-2fb1-11ee-8613-37d641c3527e
MIME-Version: 1.0
Date: Mon, 31 Jul 2023 16:48:00 +0200
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com,
 ayan.kumar.halder@amd.com, consulting@bugseng.com, Paul Durrant
 <paul@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH 1/4] xen/pci: rename local variable to address MISRA
 C:2012 Rule 5.3
In-Reply-To: <dce3d16f-7bc5-a22d-3872-36d3a617c120@suse.com>
References: <cover.1690810346.git.nicola.vetrini@bugseng.com>
 <c9c6dd21ec6e88895ebc15ee6fe96090168afb51.1690810346.git.nicola.vetrini@bugseng.com>
 <dce3d16f-7bc5-a22d-3872-36d3a617c120@suse.com>
User-Agent: Roundcube Webmail/1.4.3
Message-ID: <a2c9bc7d87e8c1fe78571d74e10e35d2@bugseng.com>
X-Sender: nicola.vetrini@bugseng.com
Organization: BUGSENG s.r.l.
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit

On 31/07/2023 16:16, Jan Beulich wrote:
> On 31.07.2023 15:34, Nicola Vetrini wrote:
>> --- a/xen/drivers/passthrough/pci.c
>> +++ b/xen/drivers/passthrough/pci.c
>> @@ -650,12 +650,12 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>>      struct pci_seg *pseg;
>>      struct pci_dev *pdev;
>>      unsigned int slot = PCI_SLOT(devfn), func = PCI_FUNC(devfn);
>> -    const char *pdev_type;
>> +    const char *pci_dev_type;
> 
> I've always been wondering what purpose the pdev_ prefix served here.
> There's no other "type" variable in the function, so why make the name
> longer? (I'm okay to adjust on commit, provided you agree.)
> 
> Jan

No objections.

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 14:58:53 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 14:58:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573126.897528 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQUM3-0008Dv-Sp; Mon, 31 Jul 2023 14:58:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573126.897528; Mon, 31 Jul 2023 14:58:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQUM3-0008Do-QC; Mon, 31 Jul 2023 14:58:39 +0000
Received: by outflank-mailman (input) for mailman id 573126;
 Mon, 31 Jul 2023 14:58:38 +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 <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQUM2-0008Di-PV
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 14:58:38 +0000
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on0615.outbound.protection.outlook.com
 [2a01:111:f400:fe02::615])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b989dce3-2fb2-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 16:58:36 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB8092.eurprd04.prod.outlook.com (2603:10a6:10:24f::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 14:58:33 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 14:58:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b989dce3-2fb2-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=l4vl2/nMmZrGRHkhrAnJkYa/ZDlJrDRvMMmMBj4mLbQUi4w76PMIPu8Ul0lEVrehDC982Pp32wQENaYWiIHObLziEQ/HsiePKNat0Hg13rTahRnjkvHuM5VLnNI9Q8p5xW1TSIy0UvGNK359dWqme2cfJ+WkgfDCBd4SouXTvXquRMDvwS3qBcbv51KSB1fhmKZUunDs20ZHlFPqNFWt5oAZ2nFEx4FXbBwed4VB/VP74/dfLL9mhYbYSyGKyWpMsbNszUVOtKFcML1e12MnUqI7E89T7adKPI1QzwzwtRHSgizbOMsl4FKmMQtf/uT++8OmNPMGr4eT2aNE6Zmy9g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=j+xJOf9KS9yuvl/kYOs2gcwuyOTVvFRgFKOHAyhEVxk=;
 b=G9/bqO1Elt4PIyMc2RjSFsyqEh4JN0Ec08Uu2juDxPnJuOPKl++igtdvkZlqaegIB2KcTnCaspCdhjwNfhvpGl7oYegK/DaQvCGoC3KOhrlt04QkJvnbeXZ+rcQTccXEUHTtFBWRTd1RKPcAobGAUfQg8DL+i7z7aghGw+1XPuO2Xx7P8zQqQ5qX1sLNJ3XniiMDLVnB91vXLwR6agYzEfw9Ie6kkWtz8vN5W/giWFK8d21LdLgC6EpNEwUBl4ZLZSKezxKmLwIbMt/r3142CYgcqNe3+XYFqMMYcyBSFu7SK5VJBo6XvkpjfF0oU+jwr+IDNC2B3PupSixo51cgLA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=j+xJOf9KS9yuvl/kYOs2gcwuyOTVvFRgFKOHAyhEVxk=;
 b=wHVTIAkWUVFxDlhXKA3ihwX9L7sh2bTXZ9tSJWiPxHSOhy9x53xB3Bq1xiWc1eaBMXGHeiekIP5pQ3ELtjGGNQA7sgFObL8SYNMBFDEhJllFR8jYSJ1eMAuSxPuyc0LIKO4eGEr1pxCOciqlWnhJJ9p/+dPp207zoE2JXH4FFPWTtQ/1KbyzFX9MOhaN0SjcJSsrU5QN1hYuvw1jGJKM+BBIFFlMp2F/xNlZWEwqlNcvHdMyyqYSTAe7Rrz3OWljNn9pkslDZ3Iw0yN0flKWmH/7fylu8Fpk+rY3UgP7v4H+1K0NMV58IbCr+bWZp8kURA2wTatZlW0wXAJW1Isl1g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <876c7fa3-6759-ce5a-9e6d-9737eb4eb9ad@suse.com>
Date: Mon, 31 Jul 2023 16:58:32 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [RFC PATCH 1/5] [WIP]misra: add entries to the excluded list
Content-Language: en-US
To: Luca Fancellu <luca.fancellu@arm.com>
Cc: bertrand.marquis@arm.com, wei.chen@arm.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <20230728081144.4124309-1-luca.fancellu@arm.com>
 <20230728081144.4124309-2-luca.fancellu@arm.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230728081144.4124309-2-luca.fancellu@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0124.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:97::13) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB8092:EE_
X-MS-Office365-Filtering-Correlation-Id: b0e5e6be-329b-4a9f-89c7-08db91d69c20
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Ldw24/sbe6t/81Yw0/8gxM6T/L2LeTI8LhuZIsUd94R3nFZfoeNb+X/xcrt7Hmetn6i0UwKBUzHw7HCNUo0oTTPcjDqycZDlmGUsyrrZ6AuOF37TDv/g4yBNPOR25/0R7Uu5mgQ7iOlCcCksip1NkaXFJ25dS3MnNxaPiJ/1eeMXel+mc1XagqgdHQ/IwrTGttV2t0N7RpEcL4Xg0dfBWq10l2FQFFQ94DLfib1yz/+137udoVGYTjloZ/fyCuWl7oa2nv3b9fHcH/QdQmy4DO5SjEos/jpqDAI+dZEu6ZUTJfnTPvwESvQrOX/cIsih5phQXEMsuAQV5377oTWaBhN12IC92MrvHf2texdxqHhqgBqjQ5DUAruAmlKQudqntmK6UH0WdfYoxchR8uTSjmkHypUCXrBFaEoXxYajxZWLeRQ3NCR1DsURunCNZprfJNlfEqdA4qPEwLRg3oIXhdpBCDFwkAk0OPiqlHnhdmAWzxazXWqs3sEWEglSUVchWlffwq7pQczs5/bWWtff9w+fUoQLEJZ/V6MaiJ7+poCC9t6kEaIiclsxZSG58oTWOXJ69KUtk7RxvHdciLSGYzjCVCKCGmaYNjRCNs+lCmDLWwYSt5EcvqU6Cvyv5eONqCAralO89KX02qDSa0YYjQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(396003)(136003)(39860400002)(346002)(451199021)(5660300002)(2616005)(53546011)(8936002)(6506007)(8676002)(186003)(26005)(316002)(478600001)(4326008)(66946007)(66476007)(6916009)(66556008)(54906003)(6486002)(6512007)(41300700001)(86362001)(31696002)(36756003)(2906002)(38100700002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UjJiKzFPNj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
 =?utf-8?B?ekltQVBGU21laG93eXpJV210VGtjcmpMdWxYY1l1TlZIVWlBVFc5Y2lLUWw0?=
 =?utf-8?B?NkNhTHpNWXA4WTNpaXZ2akducnc4T2xUaTVocGh2NllwaUlXVzlOQklBUTFM?=
 =?utf-8?B?Ymxid3hsOFhOSkhlUVN5UldsRTZGRlVDZjlkaVVpWmJXazRHQTlqYURHS25v?=
 =?utf-8?B?UHlJTkd5d3lIWXZGeThHd3NjV3k4VnE4RnRqQkhvdjVFS1RlamNmSjBHMDhD?=
 =?utf-8?B?bG5WajRIRTdhUThtdkpERWtnVkNNUkVKMHpQbVFIdXBoVGlsUUxWUFJvZVpw?=
 =?utf-8?B?M3JocGs3THZteGo2eEw3SUhzUTYrWlhNRkhKTzI2aVlIakJaM0x4M0cxZ2JW?=
 =?utf-8?Q?aJlcN/ySrG8gc/CYJ8v8Wfj0b?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b0e5e6be-329b-4a9f-89c7-08db91d69c20
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 14:58:33.2660
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: kZOhXYGByxHHqWVJIEAfwSDeXlZp8KDlYeiDAg3W18VLelk0rpNLk/5mcWFDePZig42g//aD50ZPCI/xFLw+ig==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8092

On 28.07.2023 10:11, Luca Fancellu wrote:
> Add entries to the exclusion list, so that they can be excluded
> from the formatter tool.
> 
> TBD: add a field on each entry to understand for what tool is the
> exclusion
> 
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> ---
>  docs/misra/exclude-list.json | 88 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 88 insertions(+)
> 
> diff --git a/docs/misra/exclude-list.json b/docs/misra/exclude-list.json
> index ca1e2dd678ff..c103c69209c9 100644
> --- a/docs/misra/exclude-list.json
> +++ b/docs/misra/exclude-list.json
> @@ -1,6 +1,10 @@
>  {
>      "version": "1.0",
>      "content": [
> +        {
> +            "rel_path": "arch/arm/arm32/lib/assembler.h",
> +            "comment": "Includes mostly assembly macro and it's meant to be included only in assembly code"
> +        },
>          {
>              "rel_path": "arch/arm/arm64/cpufeature.c",
>              "comment": "Imported from Linux, ignore for now"
> @@ -13,6 +17,26 @@
>              "rel_path": "arch/arm/arm64/lib/find_next_bit.c",
>              "comment": "Imported from Linux, ignore for now"
>          },
> +        {
> +            "rel_path": "arch/arm/include/asm/arm32/macros.h",
> +            "comment": "Includes only assembly macro"
> +        },
> +        {
> +            "rel_path": "arch/arm/include/asm/arm64/macros.h",
> +            "comment": "Includes only assembly macro"
> +        },
> +        {
> +            "rel_path": "arch/arm/include/asm/alternative.h",
> +            "comment": "Imported from Linux, ignore for now"
> +        },
> +        {
> +            "rel_path": "arch/arm/include/asm/asm_defns.h",
> +            "comment": "Includes mostly assembly macro"
> +        },
> +        {
> +            "rel_path": "arch/arm/include/asm/macros.h",
> +            "comment": "Includes mostly assembly macro and it's meant to be included only in assembly code"
> +        },
>          {
>              "rel_path": "arch/x86/acpi/boot.c",
>              "comment": "Imported from Linux, ignore for now"
> @@ -69,6 +93,30 @@
>              "rel_path": "arch/x86/cpu/mwait-idle.c",
>              "comment": "Imported from Linux, ignore for now"
>          },
> +        {
> +            "rel_path": "arch/x86/include/asm/alternative-asm.h",
> +            "comment": "Includes mostly assembly macro and it's meant to be included only in assembly code"
> +        },
> +        {
> +            "rel_path": "arch/x86/include/asm/asm_defns.h",
> +            "comment": "Includes mostly assembly macro"
> +        },
> +        {
> +            "rel_path": "arch/x86/include/asm/asm-defns.h",
> +            "comment": "Includes mostly assembly macro"
> +        },
> +        {
> +            "rel_path": "arch/x86/include/asm/bug.h",
> +            "comment": "Includes mostly assembly macro"
> +        },

Mind me asking why assembly macros wouldn't want maintaining in proper
style?

> +        {
> +            "rel_path": "arch/x86/include/asm/mpspec.h",
> +            "comment": "Imported from Linux, also case ranges are not handled by clang-format, ignore for now"
> +        },
> +        {
> +            "rel_path": "arch/x86/include/asm/spec_ctrl_asm.h",
> +            "comment": "Includes mostly assembly macro"
> +        },
>          {
>              "rel_path": "arch/x86/delay.c",
>              "comment": "Imported from Linux, ignore for now"
> @@ -181,6 +229,42 @@
>              "rel_path": "drivers/video/font_*",
>              "comment": "Imported from Linux, ignore for now"
>          },
> +        {
> +            "rel_path": "include/efi/*.h",
> +            "comment": "Imported from gnu-efi-3.0k"
> +        },
> +        {
> +            "rel_path": "include/public/arch-x86/cpufeatureset.h",
> +            "comment": "This file contains some inputs for the gen-cpuid.py script, leave it out"
> +        },
> +        {
> +            "rel_path": "include/public/**/**/*.h",
> +            "comment": "Public headers are quite sensitive to format tools"
> +        },
> +        {
> +            "rel_path": "include/public/**/*.h",
> +            "comment": "Public headers are quite sensitive to format tools"
> +        },

The common meaning of ** that I know is "any level directories", but
since you use **/**/ above that can't be it here. Could you clarify
what the difference of */ and **/ is here (or maybe in JSON in general)?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 15:13:19 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 15:13:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573132.897538 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQUaA-0002D5-4H; Mon, 31 Jul 2023 15:13:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573132.897538; Mon, 31 Jul 2023 15:13:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQUaA-0002Cy-1R; Mon, 31 Jul 2023 15:13:14 +0000
Received: by outflank-mailman (input) for mailman id 573132;
 Mon, 31 Jul 2023 15:13:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=S3vB=DR=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qQUa7-0002Cs-TG
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 15:13:12 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur04on2088.outbound.protection.outlook.com [40.107.7.88])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c1def3e7-2fb4-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 17:13:09 +0200 (CEST)
Received: from DUZPR01CA0318.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4ba::7) by AS8PR08MB6405.eurprd08.prod.outlook.com
 (2603:10a6:20b:332::12) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 15:12:39 +0000
Received: from DBAEUR03FT033.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:4ba:cafe::b9) by DUZPR01CA0318.outlook.office365.com
 (2603:10a6:10:4ba::7) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42 via Frontend
 Transport; Mon, 31 Jul 2023 15:12:39 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT033.mail.protection.outlook.com (100.127.142.251) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6631.42 via Frontend Transport; Mon, 31 Jul 2023 15:12:38 +0000
Received: ("Tessian outbound e1fdbe8a48d3:v145");
 Mon, 31 Jul 2023 15:12:38 +0000
Received: from 40ee7dd352df.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 21C1571E-2451-4539-A0FC-50B99ECAA134.1; 
 Mon, 31 Jul 2023 15:11:59 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 40ee7dd352df.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Mon, 31 Jul 2023 15:11:59 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by PAXPR08MB6559.eurprd08.prod.outlook.com (2603:10a6:102:df::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul
 2023 15:11:56 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::4c7d:6a1:e742:3b1a]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::4c7d:6a1:e742:3b1a%4]) with mapi id 15.20.6631.043; Mon, 31 Jul 2023
 15:11:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c1def3e7-2fb4-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RyxGJmuhSR0pSU7rr9xzMVldaOtVAHUzhStjevrfrLY=;
 b=J02Vujdo1Acwj9lJruyjCWEqkeMa//pftFIqnhLDt4BHOTaLgVCuEw5GHCCYr+ock6QAl2tNXpbjhmU5Wn37Oip06sN167nv6BowFaBVwzIvbO39BmOAqlF6+p6Dmh8ZtDZNi/2Hp5eGkz7qcm5a3anqV4GhecJaRRs/kZFzs+E=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 85baaee5ce819909
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=X1PislAWDjzMlxNbbrsbFZDqB1G+nDnE89IyA0sWVlO0gAekhQhdJj/c08KV6zlOZD+K3A+l7z602eYKHNyGi+puroCllxrnc1YqNeR/3LTyUXt/fRQTaqI48krFN7vq3Y/5Q64087jIo3Lz/As9/ubHgFX74cwPt55PDpF6uc3BW0RRNCdzzUPzUJ4CpBgX74V8UTdp67OcB2C0sr6IvoE3VAoB6rPJLMQQ0DddqEX17y3DUDHlRLPw/DXFTG/YrNumxiA6qjur48NsFmIb8W7DgB+XI+X+1i3Fgxp6mOARtDcF0jXmZBcGBla91+JV4e0iwGG+g+Pety6035DERg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=RyxGJmuhSR0pSU7rr9xzMVldaOtVAHUzhStjevrfrLY=;
 b=aKQMKoGUNbuCxf6smlnIjlMWghTzYoIiBu86wSYrikkAqMX1RpwLR1qd9DDonSxPlhraVUkCYvSfnJKrGejohuTd4Vwy6RjfLKNWC2GSSISltp9HW/SOI1q1SV7F7n2r0X9jsbPQI0RRiYOLA7u/Ow4rZZ9X04hyiW6D35R/gvgy5t23tVpU9ky2n2DVXF/74F6oopwXbslNWWvAfSEj6kIYokiRgxZViayBwgNkrE0EwVnJ53W3AiiomX2i1H0ya242kXCjwMkvix8pptJfmPva91iLMuNk/nOKIEdQZT6h4Q2dlWClHKXktG6E8ZJUX/Mj8T0Qiar5JD1cbC7whw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RyxGJmuhSR0pSU7rr9xzMVldaOtVAHUzhStjevrfrLY=;
 b=J02Vujdo1Acwj9lJruyjCWEqkeMa//pftFIqnhLDt4BHOTaLgVCuEw5GHCCYr+ock6QAl2tNXpbjhmU5Wn37Oip06sN167nv6BowFaBVwzIvbO39BmOAqlF6+p6Dmh8ZtDZNi/2Hp5eGkz7qcm5a3anqV4GhecJaRRs/kZFzs+E=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Bertrand Marquis <Bertrand.Marquis@arm.com>, Wei Chen <Wei.Chen@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap
	<george.dunlap@citrix.com>, Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [RFC PATCH 1/5] [WIP]misra: add entries to the excluded list
Thread-Topic: [RFC PATCH 1/5] [WIP]misra: add entries to the excluded list
Thread-Index: AQHZwSs9042EQJWI+kCE6wP5BUPzKq/T/JsAgAADsAA=
Date: Mon, 31 Jul 2023 15:11:56 +0000
Message-ID: <2C6F7309-B7EA-4FAA-8C72-E95D253F79FC@arm.com>
References: <20230728081144.4124309-1-luca.fancellu@arm.com>
 <20230728081144.4124309-2-luca.fancellu@arm.com>
 <876c7fa3-6759-ce5a-9e6d-9737eb4eb9ad@suse.com>
In-Reply-To: <876c7fa3-6759-ce5a-9e6d-9737eb4eb9ad@suse.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|PAXPR08MB6559:EE_|DBAEUR03FT033:EE_|AS8PR08MB6405:EE_
X-MS-Office365-Filtering-Correlation-Id: 9918ad81-d08f-4e47-6f2a-08db91d89438
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 XWydXPoF1yvlIvXbQOvrlKJrTVh4nTI36ZhmU0GrAuBOVuKVb7rJ1wwtELuF+qQThr9YkiFT3jH7Veca6cjpJlDp7iumHnML9SbfdVwAY/qzUFTwQxKBdon0YbZcrAgSmVlqhd27yk+1Se7+w8M0lCweQTSj3c+1qt9lsf5mayBtMnUNbFQ3lmNFCqpIHN8vPak2Sz9+tJBw85cFCJWmj+/f4Jcwc8HJCdR/AwRZwq9/c/mC08Nq1Pn6XmlGyP6MJYRXHY8descYHMg58j/9UqvH0BLuQ3j5SPW572EGUqd02UCAc14UFguobukcjRp3+GthpNASjFIv0GQFaNpp86ow84acPancjR2b/OXi/8MMOpaHb34KM7DZjwMm+6foozBhpSW9l4wSlAqJ0bByY4g1+xoY7QVpTvBvpSFE/+QDWNdvedubQiZTy3E4l8+0l6YJxN9HwOoJyYyEfSQN20ff93pKlh0pHA2Qsqkkjpo7gAhwFEi9KdvT+TcHfxceOg6oOuUsvllAVSTpnp1qiTM5I2hwB0G4r/sAoRX1u28HfEhJgoBVTc8bO72VSIiO0aBptAtDYJKPQdd5eKVKsYPiNS9bnq4SCFgbbirbk3o9iMT5tzjAZ2GFiSBElvm28vSybjN9xvz1VijqkGp6lA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(136003)(396003)(346002)(376002)(451199021)(6512007)(6486002)(36756003)(2616005)(26005)(6506007)(186003)(33656002)(76116006)(91956017)(66946007)(66556008)(54906003)(41300700001)(122000001)(38070700005)(66476007)(86362001)(316002)(4326008)(5660300002)(66446008)(64756008)(6916009)(8676002)(8936002)(2906002)(71200400001)(478600001)(38100700002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <D51229572973324A924B19E78CBEC6D4@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6559
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT033.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	c388af4b-ce0f-47b9-6253-08db91d87acb
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Jj0BSvteKf7+3PvoIG3xYNwx2tZZlXmeA6azDIqhslo9LBtmYGGQigxc7QeIGJibiGDleNe4xOQ8/WBjHF48n8al2mdKNcU1fw+2eWEbKKJnoRUTXOGHHwSegKWJMB0LdoSK1shARllhf9NdeZD0rC4YqWYJG04bvVWynOKq0yHidzfP1TnPXkDlaE0hOBusYOvsiNpWllu5dnXgTkMRSmGalcnkPhbZ8ykgMiGMT48N+fjxaBIDZ3RJCvgmAPNDnGsx4OrwbufiyFn3JW4ECkUf0rtqweXKUQnWHkVoIlCvjnlTIM/Gco0Rbfm77gKoljb6PfsVsKEv0/FA/ve/XHn637I49mu29A/DR+sX0XFOF0loqyNeNnUHWCxSNWr2XnRlFE26pDAiL+5tHkojpC1goNqjEBjhRCl6BpJ0CQyUAP2AOkbTLi65Yn0EKVVoLYO2mC7c3QzA+I3Xg4C9uN0nd3uZCSLH20DkT7Dg3hewFtX5yMHj0d+4dzzl33xqCPUA0I4OlowHHMvHwGqJROtlToIuC23swl4cukELCGlas/74PO3W7QO71vA47YmZ4SbX64PqNcs/btEhsy7sTXKtPVsjuvYaVl1JwuUlOrz36D1a37H25cyPaWmJlqaCBcCHseBdL72RQwkIwLTkA7BDauVhZsG2OKrQGcHIikR6uLK1h55MQb6MrKrpbeGHK9kBe9nAwmjTfO0O2/0ToEQNUlda13o9Is8+3TBJUorw7t35e6G+HKGYDYY4oeza
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(346002)(136003)(39860400002)(82310400008)(451199021)(36840700001)(46966006)(40470700004)(40460700003)(6512007)(6486002)(36860700001)(33656002)(336012)(186003)(36756003)(47076005)(2616005)(86362001)(81166007)(356005)(82740400003)(26005)(6506007)(40480700001)(5660300002)(41300700001)(6862004)(8936002)(8676002)(70206006)(70586007)(2906002)(316002)(478600001)(54906003)(4326008);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 15:12:38.8278
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 9918ad81-d08f-4e47-6f2a-08db91d89438
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT033.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6405

SGkgSmFuLA0KDQo+PiArICAgICAgICB7DQo+PiArICAgICAgICAgICAgInJlbF9wYXRoIjogImFy
Y2gveDg2L2luY2x1ZGUvYXNtL2J1Zy5oIiwNCj4+ICsgICAgICAgICAgICAiY29tbWVudCI6ICJJ
bmNsdWRlcyBtb3N0bHkgYXNzZW1ibHkgbWFjcm8iDQo+PiArICAgICAgICB9LA0KPiANCj4gTWlu
ZCBtZSBhc2tpbmcgd2h5IGFzc2VtYmx5IG1hY3JvcyB3b3VsZG4ndCB3YW50IG1haW50YWluaW5n
IGluIHByb3Blcg0KPiBzdHlsZT8NCg0KRnJvbSB3aGF0IEkga25vdyAoZXhwZXJ0cyBvbiBDRiBj
b3JyZWN0IG1lIG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ZXJzLA0KTHVj
YQ0KDQo+IA0KPiBKYW4NCg0K


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 15:15:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 15:15:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573135.897547 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQUcG-0002ps-KR; Mon, 31 Jul 2023 15:15:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573135.897547; Mon, 31 Jul 2023 15:15:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQUcG-0002pl-Hf; Mon, 31 Jul 2023 15:15:24 +0000
Received: by outflank-mailman (input) for mailman id 573135;
 Mon, 31 Jul 2023 15:15:24 +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 <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQUcG-0002pf-0y
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 15:15:24 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on2061c.outbound.protection.outlook.com
 [2a01:111:f400:fe13::61c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 10fe4fb4-2fb5-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 17:15:21 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AM0PR04MB7185.eurprd04.prod.outlook.com (2603:10a6:208:19d::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 15:15:19 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 15:15:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 10fe4fb4-2fb5-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=TRnfRIfi8Yv1LpQq4RsB3++hNbmfu+0apVW5cydhEpW89LNFy8EILuXVpDM7CPb49tMVDXX359lrZkaTEwkN5CfI01MeYdfWgUYy2RsLGz3fqcXXwEPU3y4PE1Npe0LGr/euSe9sEQhRpbCG9q0wMyKxytuVLUzc3Imjo5N9AlGAYIFz97GtuTuMZaurcWRZrK5CLEycAvyAnX6Sm1vE02Smpqr5QXnNyeLTjsvw5aeWiTtZJYrs3ydLTjo/Ig/Bv/wpoQ03J9GD1OpEslGUJyl6XLDFlym0N3q18fZUpwAdSyMlV5mij3t6FyliAacGsxFpehdL+K2xl2i/w5ryUg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7WWRE1l7TrgEFtXxBf/7xoEUBU43Vy6Z4xGD/r5ngYg=;
 b=nF3fdYpLgtJohbI2L3bNOZdDyoZUp/gyFeaic8I8UgCbeL0tMAb0ud5nPOp5hweuJlqrrImFxYVdklC3b6qWSJbVPl70rsAjFaAeCkpcpKoeSQkcVju8ZN3OABD6yMAiBRN1jkaMBr47+WlP6y0NzI3od9SVxkwcGwjYF/j+S+BqT9ts5hY/2/YzTSY9bnq/u3d0+z30sV00m5qGcJy/Gi9p7fGZdhDEe0R8lF+miONyFN4lF/QZ5esdgng6WofSidMjiyVZthYn/skR91xbdPy5261g4Obj4joucCH4wKbMfepaG+O1315ackyIZmrPp83diCqNhJIA74h2Bf7NeA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7WWRE1l7TrgEFtXxBf/7xoEUBU43Vy6Z4xGD/r5ngYg=;
 b=whyZdiAMH8LypzviFPlRMwNO5Ljzs2q94VMKCsCHS8rDuRAcxUm92ByIisJL44UHu0RM0vt4Mp3vAPvrFNXisAVqTWXlJEujtGnxtOs110yFkF5190kTg7mDonC9Mg2vZkxFkCku3SMxkJ8Kd+6oGB0yAFAbj+HwNZCTNC79OmirqP04Z+lIpyJvLkWhgeyE8l64src6seZC2Eymc1kIh8DB8fv/k19HPk94wbJArqHVOobEBG6bGtMm1jL+Mm6gDFrYSTk0fI2QJSX4ToE2y0mg50OMOuMk9JoZsLBT65Fzlt2Yh4ZB8C/hbFxWqGHsx6tHCNXj0aFB/LWWHFnqXQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <db533ea3-8b1f-fb36-a0b8-d196f3a84f33@suse.com>
Date: Mon, 31 Jul 2023 17:15:19 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [PATCH v2 2/5] mm: Factor out the pdx compression logic in ma/va
 converters
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
 <20230728075903.7838-3-alejandro.vallejo@cloud.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230728075903.7838-3-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0209.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a5::8) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM0PR04MB7185:EE_
X-MS-Office365-Filtering-Correlation-Id: 8cc6927a-f771-4d08-7978-08db91d8f403
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	zsHYkH+1tQ11WxMTKMnfFwYiiEhiwa1Qsh7BYFrCONtYeeqw0Sb0edzQIe9dUN/7+Oz27bllWHTFkM8I5m5QdjDM6Djqz7jv0FDaLm1AeOMvsnAmMGUYFxmWhDWWv9PV36e1wCwuQvNIc7he/0tw3H0is7etveeiJSI1UYYw9vX+yJ6zQUU82bt20nZV24x5D04SHB56Xp6+RvDPy/p/yRxvml9zO9kXugn5bHI5Uoo9n5ErKPeuVlNRKkua2+51TzkggUVYpINan6MUgUNPS2Vm3S7ZbH4gzo2cJf6JXi4bvqYR6wnMrqiy+AskzELhRkfI8ALjeIbarkUIA4CHBlrUwpswsziFKGHm+XuzFGVNvw2+d56KXHva5I9v7msUlfRznvRQ12cuwDLi+cIbIeSv9Pa1jl4au0vxv4u0pscBPHBJ6sdDIAW7rB8cJwoLv9k893hn/KQ8MvKrswSpVZK4+ivBxTFQGsMh1dP6mBtsiR0sE4v+SqP3EixZUY/gfc09Fca3NIMLO3/HzZmARtATv2LWl7pu9z2+tYrBRqiY6Lr2dR0BMTZywYNM8cwQfL1HvPNh4o+Wp5Jz6dgdzmK54rQekUa904gwmSQ2vsoF6Vg4U/W0idWjsFueIaDNw7Qi+NO2GzhWsqte/eavcw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(376002)(366004)(39860400002)(346002)(136003)(451199021)(6512007)(6486002)(186003)(36756003)(83380400001)(2616005)(31696002)(86362001)(38100700002)(26005)(6506007)(53546011)(5660300002)(41300700001)(8936002)(8676002)(31686004)(6916009)(66946007)(66556008)(66476007)(2906002)(316002)(7416002)(4326008)(478600001)(54906003)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VVBhM2JDN1BLUGVUUjNaS0lQWkJpd0hCZVBuMlFQcVFvLzdQaE15R0Zja2lC?=
 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TUGhXengxQTJyTGRSZzRMbEFa?=
 =?utf-8?B?UGthV3p4cldzZUZTUVF6SUhRUUFZbG90QzRVc2NubnRhSENvenN3ZDNUMTVX?=
 =?utf-8?B?eHZpS3lEczRnVVNoYjhITElQeGVRaTVnK1BSbU5jZFd5SlNnOHdyQmJCb1Nk?=
 =?utf-8?B?Y2RXM0NQVGxicGlPWTZMSmc0OVhrTkxCQnpna2NhZTdtNHExQ0FXWkIvQlFR?=
 =?utf-8?B?WUh2RmVsWS84NWVYN2F2SDNraWw2SEpDV2xwVFQ1aklLL2JXL3ltWElUQTVp?=
 =?utf-8?B?MzQ0QVdkeVJKN0xZbnJzeEoycGFlSWQ5VUVWK0VTbzlMSkxZSUNpSmkvY2FG?=
 =?utf-8?Q?78HshyqNQhNx7ltMgAa9Jt+ji?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8cc6927a-f771-4d08-7978-08db91d8f403
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 15:15:19.7202
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: JCXgoialkppnNhc29T6F+kxoyxTLHYzQLOo+UyzUrSxwKFZIPbBeYFU41pq+NE6aCcJ7PFO+wCkzw6UmELpkdw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7185

On 28.07.2023 09:59, Alejandro Vallejo wrote:
> --- a/xen/include/xen/pdx.h
> +++ b/xen/include/xen/pdx.h
> @@ -160,6 +160,31 @@ static inline unsigned long pdx_to_pfn(unsigned long pdx)
>  #define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
>  #define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
>  
> +/**
> + * Computes the offset into the direct map of an maddr
> + *
> + * @param ma Machine address
> + * @return Offset on the direct map where that
> + *         machine address can be accessed
> + */
> +static inline unsigned long maddr_to_directmapoff(uint64_t ma)

Was there prior agreement to use uint64_t here and ...

> +{
> +    return ((ma & ma_top_mask) >> pfn_pdx_hole_shift) |
> +           (ma & ma_va_bottom_mask);
> +}
> +
> +/**
> + * Computes a machine address given a direct map offset
> + *
> + * @param offset Offset into the direct map
> + * @return Corresponding machine address of that virtual location
> + */
> +static inline uint64_t directmapoff_to_maddr(unsigned long offset)

... here, not paddr_t?

Also you use unsigned long for the offset here, but size_t for
maddr_to_directmapoff()'s return value in __maddr_to_virt().
Would be nice if this was consistent within the patch.

Especially since the names of the helper functions are longish,
I'm afraid I'm not fully convinced of the transformation. But I'm
also not meaning to stand in the way, if everyone else wants to
move in that direction.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 15:20:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 15:20:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573140.897558 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQUhA-0004I3-79; Mon, 31 Jul 2023 15:20:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573140.897558; Mon, 31 Jul 2023 15:20:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQUhA-0004Hw-4S; Mon, 31 Jul 2023 15:20:28 +0000
Received: by outflank-mailman (input) for mailman id 573140;
 Mon, 31 Jul 2023 15:20:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQUh8-0004Hl-I9
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 15:20:26 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on060f.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::60f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c59dfb5e-2fb5-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 17:20:25 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DB9PR04MB8330.eurprd04.prod.outlook.com (2603:10a6:10:241::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 15:20:22 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 15:20:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c59dfb5e-2fb5-11ee-b255-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Ths20cYQQygn15LBRACcgM3fE0Adz6lOt++g9hWbiXHvxst5gkOP3Q4Dn5qhcIC8bBcNoyB8O93Lyt5wG4sBvswLh2dusfPdLq3/rdHN/TxHZoii4e58/7gxeTd8mFyHQyELuWU8X5Ca5M2G/Smi87IwFvBz5024m0wcqE6xF0smHxele+ksRZWNyUXYyVeJYaL1UD1PivL8gCzh+2E/pxLCD1tbQIsVWrH+w6E+YoGsFSshboJDc/rICpHTSuqLLhRUqZBrpLzYy1XwMzXyqhpTr1bv3zc4Ztf+UCmjdZHnlB5CcOX/xAwJsFV/dOBmFPd0FZqdtRuEi1EsanWL0g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=6YEX4x3csvhwU9a1JvGEy2rXbRl8myJVdp7sXTKYJxs=;
 b=RVv9SwYD98jZkLvlV5tLsvK0vB4XGBLzvJlduKWYvS1bn1bKLaylUyC9kbA4ppLecbx0XBefhFsI/0gE+Ufjafo5bL6o47kTfzqf6AtOWSDOlIlmCiGznBdgViSaeC0IDa1fpNESQobGAEgerrliLakltXEZh5vwdxCa35CX4lit6X/xTe3B1nU63oMKceI7WMNKe8BIoWxsfejOgy4cj8nS8RnCwsanXfk93Pqy/SS0Toka2zAIlck4shEh4XmBfOF+MJm8p7tfujkr2ttSkSEEKXbysr5JzFd6U0XEMTfF262sVCoLZysiacOG7E/NPrPj16Mt9Wvo8QY8ca7EAw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=6YEX4x3csvhwU9a1JvGEy2rXbRl8myJVdp7sXTKYJxs=;
 b=A8vr5K1Gc80i/+DJqK1c3TCMDmyATsL6BIet/osE+b/ukSrcfiX+USu8a3+vwVFSDlKJcsbe3gLF228P8aM0e+9r8JaPghRuK9ZGNx5OHO8HN9TEa8JZLCFNxgBMv8lvNvvrX3w6VGgBXruvQ2XVpLya9mIBJy5Y4WAaNiU53FuSXddDnuEXZLkIerHSFN3KLbqPERCnX+29Oy5DQH7RxZXFbvZq+tUerK59MWmt8bATkR3cFxtNEmi2Dz5YHlRqvqeV/xVjc6cqbiK8MATUcqDtTzfIdAGDvSYGV8B2+9Xm0G6I9wZWbC8te/4xGZOnQ3C65RUmNGywSjKW7ZNNxQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <6356ab5d-1ecd-da3c-4738-fb33ee2b187b@suse.com>
Date: Mon, 31 Jul 2023 17:20:21 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [RFC PATCH 1/5] [WIP]misra: add entries to the excluded list
Content-Language: en-US
To: Luca Fancellu <Luca.Fancellu@arm.com>
Cc: Bertrand Marquis <Bertrand.Marquis@arm.com>, Wei Chen <Wei.Chen@arm.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20230728081144.4124309-1-luca.fancellu@arm.com>
 <20230728081144.4124309-2-luca.fancellu@arm.com>
 <876c7fa3-6759-ce5a-9e6d-9737eb4eb9ad@suse.com>
 <2C6F7309-B7EA-4FAA-8C72-E95D253F79FC@arm.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <2C6F7309-B7EA-4FAA-8C72-E95D253F79FC@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: FR0P281CA0096.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a9::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB8330:EE_
X-MS-Office365-Filtering-Correlation-Id: aeda75dd-dd56-4dce-7ab2-08db91d9a852
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	m43mb4rr4FoJ0DMABtessu8S90dVVdt9YlpPvgHnF79OxXNcr7RN/hMOTyhaqcY1J8mipF7UvU1x/OYLwZ+MsFh98ZWHQSDXSMiRUx9RK8WCYITMEw7XuKYY05KuHT3Ry6c5MNd/Re9uUPjcf4K9+I3aHAF/XK9l1mSRHlyrDswQbWesO5dtfxd9W9b6fxVxzRid82AgttAmf8LgN5oS+9ibnRaInyjgIOf02OGOiTGJdm0ONlq7uLT1TjssuPbqbODYC5yMI5+jsyC40sVPjm0n7cWTSAWgo+Ld4HZhDuUfPAg817dxcxRE9pFYT+bT1FYrg6zeKqijXnqVhkXl4+heTL/WaCNO9jQuxl+87LxrJeRCUh/UyRLhZGN5XHxNU97GTQp30faE3pqZJfVgUccT8b+mDk5WXQvHbQb9mxUgsU79LMKgjRzRvqi+7LA4CvfCB/R9NM8Ib0tcXr1LbrXo5qXb3FNjfxnH/hdlq0E1C2tzKVmI63iaq2Tt/UYJat2j+/IAce4Wgfr1VdQ259amgP4U7zU5mh2Af7IVSu0OvWhDGTfGTl6D03uVfD7AyoM0Ommnp1DGMmFD7Oxe9eVMGCClaTF/5ndhW+ZiG6VLr/bqanzaHL5wh6ay+NHQzE/4Hw6qZCBDYnDwuPsTvA==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(396003)(366004)(136003)(39860400002)(451199021)(86362001)(66476007)(31696002)(41300700001)(8936002)(31686004)(8676002)(316002)(6916009)(5660300002)(4326008)(66946007)(66556008)(54906003)(478600001)(2906002)(38100700002)(36756003)(6512007)(6486002)(186003)(26005)(6506007)(53546011)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Yk16V0NNdS8zMEdjbkVSaUk2dnBLdnk2UTFHRVQxL3dwUmFQLzRpeU9rekc1?=
 =?utf-8?B?Q2lDQ1Z1M1RrL3RZNzh1NjBwTkRHMTBuR2FzRG4wVkE3eW11S0VKUzJrakdx?=
 =?utf-8?B?ZmFTQmlZQkx3Y09oZ1MyT3krT29UYlVtMkllVCtZTmYvRHl1b081MjhrOVEy?=
 =?utf-8?B?QjR5NGFZbTNkMjhod2xhZWJuSUwxdjkrK2NwTEp2OFBSNVdZZmh3a3Z0RTl3?=
 =?utf-8?B?am1PM0RNVVNmaGRaRW9RcTR1N1EveVJhclNjbW5laTQ4V0VzR3l2ZWYxWmwv?=
 =?utf-8?B?cG9RK0pNb3drL1lWYWxvcnRUOGZrcHdTeEJsNUJmMkowL2J3OExCVG9PS2dp?=
 =?utf-8?B?WEYrY1lBdGszNnFlNTFCVVpKNVpLMVhLdmdoYkladGJuWUJFUjdTNjJ1Q3dC?=
 =?utf-8?B?VEpyVjUyVmVRSFlpa2hWTWRBZENZcFBuQzVxR01ndFh0MzV5ZUNlZktmMjh1?=
 =?utf-8?B?NE9TVzVzSnArZElVN2pOYklZWno0L3YzOEpWM0x2T0ZadFd5VlNK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I3U09YN1gzcGR1RVZkR3JkQk1xSHo5QmZqalVpVUU0V0J3MVl2T2ox?=
 =?utf-8?B?Y2hFUnNray9jNTczN1pIZkxXUUM5bGhmQzdzdFl1QVY0cHBCemNWOU83Q2ta?=
 =?utf-8?B?MHA1TVVma3J5a1MyWHh5TFRJeEkwRXBHSjhBUVNCZngyUUVRRElwZlJLcTls?=
 =?utf-8?B?c05lVHgvS25FaDBlSEFpU2pVOWVWYmJPa0ZiZVVpd2VpK1BYZzl2ZEphMVFT?=
 =?utf-8?B?WTBsZ2QxOUxid2dWcU9zNTFRSkhGNVhpOWI3QkNrcm95SmlIdnU4dGVpOSti?=
 =?utf-8?B?UkhycHVZZWhwcGFTTDI5MFJNeWd2OVljQ2xyL3RHUmZ1YThHd1hRcnBBekM3?=
 =?utf-8?B?RGVaVFZmbVFxQ1UwclN1NXFBTGpEZmt0SVc2dnhLVVNjNnVzSXBmT0NoU1JJ?=
 =?utf-8?B?eFdjSHJaZFpzYU8wNTFpMzFsWUlLS3d5bGcxS2dHYW9CRk5aQmh4RVZBMXJw?=
 =?utf-8?B?L0JyOHZTVHFDMmhoNHBtaG1ZV1RqRDJVc1l2b09lZGlrZHdIdlMxRWprVTha?=
 =?utf-8?B?czdUanhtK0FabnF5bUhoa2s4M2IvdkhLWktzTXpNUWd6MmV2amxMWko3MDFG?=
 =?utf-8?B?R1B3QUdzZk9DVWtOV1lPcnYyNllJcmIyZFpmZTFsODFWcmduWC9ENmJKZ1By?=
 =?utf-8?B?MXlRQzNCTnM1eWtmbHdtcEUrekJJbU1HZmViYkMwamVkVW0weGxrbEg2WTRW?=
 =?utf-8?Q?DJxrk2vHb6pev7Kun1dEy5Y80?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: aeda75dd-dd56-4dce-7ab2-08db91d9a852
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 15:20:22.2355
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: +pRG+fNb5sl+5KB1EKBQolSlm1KVQMMYTegmC925ab/ljvLf6lwD4FrMPzFi3R0ybbg4XXYwzJ3lYt7GZcF3vA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8330

On 31.07.2023 17:11, Luca Fancellu wrote:
>>> +        {
>>> +            "rel_path": "arch/x86/include/asm/bug.h",
>>> +            "comment": "Includes mostly assembly macro"
>>> +        },
>>
>> Mind me asking why assembly macros wouldn't want maintaining in proper
>> style?
> 
> From what I know (experts on CF correct me if I am wrong) clang-format is meant to format only some languages
> (C/C++/...) and assembly is not one of them, so what is happening is that most of the time clang-format breaks
> it, in fact we are formatting only .c and .h, but since we have some headers with assembly macros, Iâ€™ve seen some issues
> that ranges from really ugly formatting to build break.
> 
> One thing we could do, is to export the headers that contain only assembly stuffs in dedicate headers (<header>_asm.h ?)
> so that we could easily use a name regex to exclude "*_asm.hâ€ from clang-format? And also these headers could #error if
> included when __ASSEMBLY__ is not defined?

In principle this may be a route to go (naming aside), but first of all
I wonder what "assembler macros" are to you: We use both C macros and
true assembler macros in assembly code. The former I would hope formatting
tools don't have an issue with.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 15:27:36 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 15:27:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573145.897567 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQUnz-0004xJ-UM; Mon, 31 Jul 2023 15:27:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573145.897567; Mon, 31 Jul 2023 15:27:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQUnz-0004xC-Q3; Mon, 31 Jul 2023 15:27:31 +0000
Received: by outflank-mailman (input) for mailman id 573145;
 Mon, 31 Jul 2023 15:27:30 +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 <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQUny-0004ww-Jv
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 15:27:30 +0000
Received: from EUR02-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur02on20609.outbound.protection.outlook.com
 [2a01:111:f400:fe16::609])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c0b4505e-2fb6-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 17:27:26 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS5PR04MB9770.eurprd04.prod.outlook.com (2603:10a6:20b:654::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 15:27:23 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 15:27:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c0b4505e-2fb6-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Tr4lcPlTy5eouLrGoZzpkqukohLFkeRw+I5LaUgrtnZjQc81Y0tyyNuXercD5KwCHp8DvTWHpmRnSi48BXF4rHhcciAuoHkkstHvnBfqLnXAvtHmVF0ngAju+1LIaxwgAbdRXsWPbFVhBvZCBiGGVY7vFnl4fNCYfN4QL/lpNy6UgRU1qcKoNWjMykEqSks7P6xVZl+T8dVRo7G8T0zSFR9KwTan1GHlayBDogbJAlH96C8LF794PEqj4cmmR0xfUY3adJOVx5w75gBrHHsjc9ul2rKqGgGlp8MXu5t5rSQEcY1k9KNOF8ya4+pXtsqkTfH+jxYg2ZvsmXk7h/meMQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=XgyXJifNPbPXkToFim0/Zhr51r9tThsgLGbrHxY09Hc=;
 b=crcqQbOViEXO7N4Z03m9DtpzSqjWc7y25DqenJ5E9W9p3AvOAr3yYzX1i0ueqYIYzkhSp0G6/QlV/tS4x77KiUXLxhTFPekYG2RiwaXP7rHUmFTJzndJh2XhrQSdvaYGMxJF2VDxpAo5YwQCHu/kl8W4qPj8rQBpBGllDg2eBUMHSKZAWQbAqaJV5g6Mtdm2V6aK3np35HHSNqAHVaCocF39wvbZZL0rFpRhPC8Nw/RYx0QXamfs9CJOQpnNm3+UQOVcUGwaoWs/mBcNE622nAJ9Nr7vhP0jmmgU/lvHKs4/PUQ4CPl8LLAkwyra/JEUBPOmVTn7UZnh1MRfEMvUUg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XgyXJifNPbPXkToFim0/Zhr51r9tThsgLGbrHxY09Hc=;
 b=jm5yaldA/bPLT7E7p+QSL1f/mUB1Wk2xVt0HfyrxhcrVTeTlGrPlYMUaZ6XYzBtm5o0/0ixBJGw9+h0165KzpYWC7qfsf5FHUTghpSxchXvTtfrGBoqemDAShVT+1Yjp3Wh0U9eA7CD2Ux3Et/udL5iPbI/5hWp7SOOLLt6lJFfy65uCqMa8lHopPJJ1jM/dsismmG53/+isMdrtkH0Hl9ifLcVzIaSXwoOrrsUDg1k70Sbi/0ndpzELmDmT2/jfPnSEwaiaGl0GToTnKnTUlOKY4adBwVc/gc4M0z61SUeSX3pQZDrqcrD0PpE1N2BINNFsy01ZkcP7fWsSo9oUPw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <ca38d130-ba56-33b2-3134-3b8d4d0dc4fe@suse.com>
Date: Mon, 31 Jul 2023 17:27:22 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [PATCH v2 3/5] mm/pdx: Standardize region validation wrt pdx
 compression
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
 <20230728075903.7838-4-alejandro.vallejo@cloud.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230728075903.7838-4-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0015.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:a::25) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS5PR04MB9770:EE_
X-MS-Office365-Filtering-Correlation-Id: 67e81ce1-d30c-40f1-b2c0-08db91daa376
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	zU7jhrQXSLOlQYdcEaEzrnFYRWnLfAbUT4Ghhnf1ClDTEntx90TC60C+Zcee2EfBJlxXWRIm4vuIboKw2FrdzNYQTwyiHW791jnMyec5iVVy3Fwz5fuii/UhfydsS8JjG2cubJ+iZPOXBVCNCebpz1Ns7QCI5iG3cZR59j5ExI36M3vYCN6+1CyrL4wARZoP19Vu0hPBQt+lzICudD/TtpDNDs2T9J7C9/Tz1iZu6B1NEhgms3RjO4D5fCAXnUSINpYheGrRqd7SlIXzgh96zXdzDS1b+RWO89q1UBfCWcSd3ov72iGXkhp+oWdo9rYPEEdhMeHYF251B/2trM5J5LN/awg/MXWcr8bOxSBlkEUx2SBYPbeYDVAXa0Wvzq13wEzFuobcJAB27T8X9MiICK2PgpfoVHTXxWUhG6/vrTiPoYFzIZ2p1DxNKrbQVsc/Hwxs7E0J4DlE3+hFCJ+4++1RQ89wB2FZ9/jI7YMrVvPQG/vs768luSd97gsh4/+oDbUv/mv3DupGK9JURMuirgspqJ5Mgzkg2bFMjjUAlkg3rGYOI1pWgjjk3lp9uWb9RPM7cFlrjT5yGbHnorlI1+n8CQMeLwnWT1Ar3//w+zqEmx53WHns7f8xuh9BAxiTYfZyHXFbV7lVbSrl1nYgHQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(366004)(136003)(39850400004)(396003)(376002)(451199021)(41300700001)(5660300002)(6916009)(66946007)(31686004)(8936002)(8676002)(54906003)(4326008)(478600001)(316002)(66556008)(66476007)(2906002)(6486002)(6512007)(38100700002)(53546011)(6506007)(26005)(186003)(36756003)(2616005)(86362001)(31696002)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bmc4SU01a2UwZHJNNXYvVjVpSy9KSXIxS2F5TmVpaG9pZzNqRlh1QXZxaUpK?=
 =?utf-8?B?OEdOd0tpRXpNNkIxdHBkZFlud2IrQ055YS9PR2c1ZkdUalBWdlRIZ0FEZTg1?=
 =?utf-8?B?SXR2ZUI1L3NObnk0OEE3VTZRUmp4dUtDN3VsNmFlUFZzT1pjUUgwSWxoWmFU?=
 =?utf-8?B?d3VkOEp6Nzd6bTRldE1Eb0lVT1crNzVLRE84RzdBeVlCOExMT0F3Q2lWTDJT?=
 =?utf-8?B?ZUkvQmxESEREUUZwanFiNGU3U1Rjc0h4Tk1Ob3o3aEZDTWlOd2daWHdnUzZL?=
 =?utf-8?B?TFJnRXEvclg4S1JsMmU2NnB6V2xBSFFCN3pKMFdjblFuV2JBUU83WGNV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9xNnV3N2plNDhBbU82Ny9kN01JdW5udXFM?=
 =?utf-8?Q?4HWTKomMNviJegsHBCgm9lSRF?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 67e81ce1-d30c-40f1-b2c0-08db91daa376
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 15:27:23.6121
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: HUuqS+fuxiiV1hfQMW9gRtKpqvwwBG0CbKveY21RB8BxaM0H6VhvjIHAGvrMldCR2y60b3Y8eT7zJgR1bsJFmQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB9770

On 28.07.2023 09:59, Alejandro Vallejo wrote:
> --- a/xen/arch/x86/x86_64/mm.c
> +++ b/xen/arch/x86/x86_64/mm.c
> @@ -1159,6 +1159,9 @@ static int mem_hotadd_check(unsigned long spfn, unsigned long epfn)
>  {
>      unsigned long s, e, length, sidx, eidx;
>  
> +    paddr_t mem_base = pfn_to_paddr(spfn);
> +    unsigned long mem_npages = epfn - spfn;
> +
>      if ( (spfn >= epfn) )
>          return 0;

While occasionally groups of declarations indeed want separating, the
rule of thumb is that the first blank line after declarations separates
them from statements. I don't see reason here to diverge from this.

> @@ -1660,6 +1663,8 @@ static bool __init cf_check rt_range_valid(unsigned long smfn, unsigned long emf
>  
>  void __init efi_init_memory(void)
>  {
> +    paddr_t mem_base;
> +    unsigned long mem_npages;

Why in the outermost scope when ...

> @@ -1732,6 +1737,9 @@ void __init efi_init_memory(void)
>          smfn = PFN_DOWN(desc->PhysicalStart);
>          emfn = PFN_UP(desc->PhysicalStart + len);
>  
> +        mem_base = pfn_to_paddr(smfn);
> +        mem_npages = emfn - smfn;
> +
>          if ( desc->Attribute & EFI_MEMORY_WB )
>              prot |= _PAGE_WB;
>          else if ( desc->Attribute & EFI_MEMORY_WT )
> @@ -1759,8 +1767,7 @@ void __init efi_init_memory(void)
>              prot |= _PAGE_NX;
>  
>          if ( pfn_to_pdx(emfn - 1) < (DIRECTMAP_SIZE >> PAGE_SHIFT) &&
> -             !(smfn & pfn_hole_mask) &&
> -             !((smfn ^ (emfn - 1)) & ~pfn_pdx_bottom_mask) )
> +             pdx_is_region_compressible(mem_base, mem_npages))
>          {
>              if ( (unsigned long)mfn_to_virt(emfn - 1) >= HYPERVISOR_VIRT_END )
>                  prot &= ~_PAGE_GLOBAL;

... you use the variables only in an inner one?

> --- a/xen/common/pdx.c
> +++ b/xen/common/pdx.c
> @@ -88,7 +88,7 @@ bool __mfn_valid(unsigned long mfn)
>  }
>  
>  /* Sets all bits from the most-significant 1-bit down to the LSB */
> -static uint64_t __init fill_mask(uint64_t mask)
> +static uint64_t fill_mask(uint64_t mask)
>  {
>      while (mask & (mask + 1))
>          mask |= mask + 1;

I see why you want __init dropped here, but the function wasn't written
for "common use" and hence may want improving first when intended for
more frequent (post-init) use as well. Then again I wonder why original
checking all got away without using this function ...

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 15:34:09 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 15:34:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573149.897578 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQUuK-0006Rp-NA; Mon, 31 Jul 2023 15:34:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573149.897578; Mon, 31 Jul 2023 15:34:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQUuK-0006Ri-JY; Mon, 31 Jul 2023 15:34:04 +0000
Received: by outflank-mailman (input) for mailman id 573149;
 Mon, 31 Jul 2023 15:34:02 +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 <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQUuI-0006Rc-Py
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 15:34:02 +0000
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-db3eur04on0612.outbound.protection.outlook.com
 [2a01:111:f400:fe0c::612])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id abc36738-2fb7-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 17:34:00 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by AS4PR04MB9291.eurprd04.prod.outlook.com (2603:10a6:20b:4e6::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul
 2023 15:33:58 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 15:33:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: abc36738-2fb7-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=WiE+qymxkQrGrz9L4LOA4x8/bQ/qE1Y01gxFoQfy+FTo0+lXwTdZ2bpyOMY4ccooOl9mmRUCyeJUPDyUdvfunrWHkgC6Tw98iVDmw9g5hx0f7BPiIN6ifGbci7FH1qgXSjd1txwDrjT2CTBctwP+7W0OjtHo9HFeZfJGGs+i0Xxn0dqDbxrAVs3nrHm9HeZ3ImmZTRFbgDk6H6j92GZCMSGo8r9we/MFB7vMfIdWlEGa/dtzx6HQUWGe7oea/pMWCckhJUc2oStgkbl3VgRZRnzZ31rOb4g0TJaZ92ITdbYcCgUo3b/tPLVAw2TvlmbaRfxBE6vCtAckp9uNmL7aIA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=QGuU2cA0djyl0WJPXqQcpX+FVfV9zrHacjGgiEzsKaQ=;
 b=c63Nvg0HNNA/BbhOepaSDrc8X6ZD1EY0qi3GKwtQBiY1Tm7EBohcFcIMc/zF+htYFDmMQGzJKldsPmwMy+itJ3IGuMk2QnFRhUw1Ffm9gENNWXlce8xd72FyVAv525f0d4GheCkeXuFYYmUZ7XFQwbd5r7uRmSk0Zm0r1kjMHnaxxZn/UORCCHmcvBibWJrHt45Yn5kmlRDYMkRFMdeXIQf3MeU57UbKBZ6ds/yd5ofCVW0ZozwHVmJgQ2uYm7mMrl4DUcqPsdnnVAOA7cZwQ0hAUcX7gaDp8O1LjFzn/pPBa+443PO/707aWj2PdJ7G7rtoHfNrCEskXBiA6KnW/Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QGuU2cA0djyl0WJPXqQcpX+FVfV9zrHacjGgiEzsKaQ=;
 b=RvPY702wJ1adXkdcnwW0dIzTd25Wc/dlKOvhTUCZbgtMpqOAY7R7CQWj3lasqiV7CDtErNUSEcgJHNgZSztS0zcnIYGraqHas+thhbnirthbNfqZcYRO/95USlLziNmWVt+nEpidH0/UDhoKu/8joHfFzruirNdq75p0jkoSr8wSKPu81aodqYfqhG5pT59fP9p9vcqTe0RKyVRDhJ15oqnEBLyCAFdSdRQ2+eOP4V3aHbJq60Suvoa4W7o9r7qu0+TkHUCAv2hLEURm4n6ZVT97BFsgcAi7f7ZaHwkUTfxb+941RuKadyJ7KFFMDphKweNLjnTH6fOnmYr0L3PFWA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <64540ae0-7954-38e7-42a1-2c4ff41bbf62@suse.com>
Date: Mon, 31 Jul 2023 17:33:56 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [PATCH v2 5/5] pdx: Add CONFIG_HAS_PDX_COMPRESSION as a common
 Kconfig option
Content-Language: en-US
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
 <20230728075903.7838-6-alejandro.vallejo@cloud.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <20230728075903.7838-6-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0160.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:99::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AS4PR04MB9291:EE_
X-MS-Office365-Filtering-Correlation-Id: a28a6de5-9700-426a-decc-08db91db8e77
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	oyeokBMQd7y/JcwSz6pbjYC6wVEhrU43O30FqPMSzfH+HRxznr+fbzgeSpBWQfaZVmMaX0GcImQ5DsZq7wMC4tMOiDeTk0HTvEFxL7PmxfDL1r4x9fQfFhMJOEPytGqo92TgWr01rPV3iVSqjlXPgMyO8TC2TxXw31cdKlHm5GdrqpCN4buoCFXzRJHsrbq/inQW2+HrSMv8QDvUcaXyrPT6nNQ+quXdVz7dLakYqBvuzHKXXJx9HPtRSEK74mAdbqJjiLROoQOcPgfJ43G3r9vmOs/6opNwXF2KvfM8DNDHUk8J5w0yYV8U2P1HdlxTB+J/AONyg0sesL/Lj+CyPM38jJOB68rvt1ApLXP3todb7zNhe0YoeJETAMbfHWbRhmhkMxii6P0+7cSUcVgmkSzrT/vv6rkaNqOS3k8cgKrd7w1IJqCcB8WN5bmyhg+lLqmUIeVB1GTyg/qXtD41Suvi87pvt8VR2hRDBJ59Vq5XKqF3tLqSjwV2P1MWIXq+ApCLbl6nQXE6F+pyjyDvcZojsI9aEP6kRx1v7fpk9CHYgfS+jM0kQHExnRVEAXKsnYyLu+fM8hGdG96QMqn+tWG8QHpzreqIQSX4QAO19BGUmDvNJ7uLDcVHCc/hmpUDAlny5UBf98T918mttZaMuQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(39860400002)(136003)(396003)(376002)(366004)(451199021)(31686004)(2616005)(5660300002)(38100700002)(36756003)(2906002)(31696002)(83380400001)(7416002)(316002)(26005)(478600001)(8676002)(6506007)(53546011)(8936002)(186003)(6512007)(41300700001)(6486002)(86362001)(66946007)(66476007)(6916009)(66556008)(54906003)(4326008)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WDZlNmMzNlpINDY2K2lZYzdrZ2l2Q1M5SlM2dFB6Q29XZ1BTWlBUcDluTEcx?=
 =?utf-8?B?dk93dnlKcXFLNTNlRzkrRDk4UGZOc1lxVklvUi8vN2FPeTdIdFAwdFBWZ081?=
 =?utf-8?B?dmFWY3FCaDFjSno4U2cyUzlCVzNUanV6Z3FiUzhsRTZCSEIzRGZYazdTTUor?=
 =?utf-8?B?K05ZU2lIWFdUZk1lc1RQa1hNbXJqWU9ETHl1bW9aVVF6a0dIK1l4eWttM1BD?=
 =?utf-8?B?VFV5ajd0N3lzNFZJN253YXpoLzFXK0ttNEdSdVZMVGNqckdhNUlocTd5QzR2?=
 =?utf-8?B?MUhUdTlBYUxhYVlHemxyTFhtcnVvODZCOElDS3htV3psVzFvTEhpTE9Jek1t?=
 =?utf-8?B?cnc5eGxa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TVNhbDNuMlRhY3Y0?=
 =?utf-8?Q?+z1yIWqh5y1k+1WAP0W+XXBNv?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a28a6de5-9700-426a-decc-08db91db8e77
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 15:33:57.8432
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: WuzF7JXDxhv4p0OyYYKm6BVs0LjaqUwv4p6cV2TOe0vzmCvJN0GFGF+QUoN31qhVArzVZRYkvaz8sB4tZK41bQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9291

On 28.07.2023 09:59, Alejandro Vallejo wrote:
> --- a/xen/common/pdx.c
> +++ b/xen/common/pdx.c
> @@ -31,11 +31,15 @@ unsigned long __read_mostly pdx_group_valid[BITS_TO_LONGS(
>  
>  bool __mfn_valid(unsigned long mfn)
>  {
> -    if ( unlikely(evaluate_nospec(mfn >= max_page)) )
> +    bool invalid = mfn >= max_page;
> +#ifdef CONFIG_PDX_COMPRESSION
> +    invalid |= mfn & pfn_hole_mask;
> +#endif

Nit: Declaration(s) and statement(s) separated by a blank line please.

> @@ -49,6 +53,8 @@ void set_pdx_range(unsigned long smfn, unsigned long emfn)
>          __set_bit(idx, pdx_group_valid);
>  }
>  
> +#ifdef CONFIG_PDX_COMPRESSION
> +
>  /*
>   * Diagram to make sense of the following variables. The masks and shifts
>   * are done on mfn values in order to convert to/from pdx:

Nit: With a blank line after #ifdef, 

> @@ -175,6 +181,7 @@ void __init pfn_pdx_hole_setup(unsigned long mask)
>      pfn_top_mask        = ~(pfn_pdx_bottom_mask | pfn_hole_mask);
>      ma_top_mask         = pfn_top_mask << PAGE_SHIFT;
>  }
> +#endif /* CONFIG_PDX_COMPRESSION */
>  
>  
>  /*

... we would typically also have one before #endif. In the case here
you could even leverage that there are already (wrongly) two consecutive
blank lines.

> @@ -100,6 +98,8 @@ bool __mfn_valid(unsigned long mfn);
>  #define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
>  #define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
>  
> +#ifdef CONFIG_PDX_COMPRESSION
> +
>  extern unsigned long pfn_pdx_bottom_mask, ma_va_bottom_mask;
>  extern unsigned int pfn_pdx_hole_shift;
>  extern unsigned long pfn_hole_mask;
> @@ -205,8 +205,39 @@ static inline uint64_t directmapoff_to_maddr(unsigned long offset)
>   *             position marks a potentially compressible bit.
>   */
>  void pfn_pdx_hole_setup(unsigned long mask);
> +#else /* CONFIG_PDX_COMPRESSION */
> +
> +/* Without PDX compression we can skip some computations */

Same here for the #else then.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 15:47:12 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 15:47:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573154.897587 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQV6k-0007zf-QC; Mon, 31 Jul 2023 15:46:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573154.897587; Mon, 31 Jul 2023 15:46:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQV6k-0007zY-N7; Mon, 31 Jul 2023 15:46:54 +0000
Received: by outflank-mailman (input) for mailman id 573154;
 Mon, 31 Jul 2023 15:46:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQV6j-0007zS-OF
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 15:46:53 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20621.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::621])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 77da0377-2fb9-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 17:46:52 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VI1PR04MB6813.eurprd04.prod.outlook.com (2603:10a6:803:13c::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul
 2023 15:46:49 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 15:46:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 77da0377-2fb9-11ee-b255-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=db82hSSl1UDEeKTjexjnaVIrIEDHd5gQR+5hhXRK+KPt3ZSF8wZ/oHNGDOP2rEJQpB/TfqoUtzltMGl1hE8QbJG9Jz9QG0AqUhsxV6YQ4au3LhrDWhESFUQ0LUIEhgsxttrAonZ+ritW/7Zq+j1KoKEPCA1feuNhjuRUKt8Ch+vbX0dptTQ42Lz2bX8yCjQ8KaBNR2NMyF50/q/xp4UtQwknqhep3YrpkM77sHvRzlEg/hdUDAr6Go8jctpWmOXNRKV74N6WeonTIbWSBms3HDy6LLZIQn14AtWSKjM2MdKkIRjMOsNyzBwudSdrkCMsADnz1rfLZ4nFhjQdkn1R8Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Nvnn/wqgCCgGq4bR//xeCgvLzQHooa7aIMr8XWnl0DM=;
 b=KRJIgoxaQ8O1TPIJOutUhW3EdgabYhBLXEipKvfmMxeBDMWxRTIDc9jYYYcRssNA+/Z1dCQd2hDaGmQ/IEdWYGAcqnS6lfl/tPX5XKg7z93dNREhVUE6CkCEKkSvfaHdzmkoh+Q6AWmY0LqiknjIz1jo+wJ77CgHXio7PtfAzMv+b7u1/VsZYDlaKWV9WFAjtgz9BdkHyEuWK3INybVErSE9FolORbDQH6VHloWiEsBb4A6A++jYFKdMiGTYwTjQ8kSJegvJRF3sZBj3SWOGfi8zPqzJl+7YojT1SC45r1W689Vs5TeDzC/hepUXbI9LEsae3TXkefZ96ZYwhMzJ5g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Nvnn/wqgCCgGq4bR//xeCgvLzQHooa7aIMr8XWnl0DM=;
 b=X2CT3IuOJ1HPWnPjiIKl20ktJCYjZxIdDVmq6xjev+vD4Z+En4S6MMtF/3BSMqPyavQ0UQ6FzwI1qF1fp7OaJDlov306W+G9x5dRZUCMARZHCdYuUn82w7Ds59P74TDKNHIVXxud654SYBAHp28ai4goqyPS/guF5um8gnsFdDIxutEw8mKc53Y3Yewx0G1kmwCIVUf0nEtgSV7BWJw3TxcCcf9imXDTraQ6pzSAefUqDlL/BlZFNEvbdtFEx2B1w92lyMP/exLDjqdtiaN072sXTIK369mAaNyp7N3mW2JAzxJf6y0E9Br2hN1JsW9xUBAkOINrfVe915lazODJkg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <3b6b0984-89fb-268e-970a-0c7eb19a4863@suse.com>
Date: Mon, 31 Jul 2023 17:46:48 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [PATCH 2/3] xen/ppc: Relocate kernel to physical address 0 on
 boot
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1690582001.git.sanastasio@raptorengineering.com>
 <0802fad2743526da4fe49f0225e14161464f192e.1690582001.git.sanastasio@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <0802fad2743526da4fe49f0225e14161464f192e.1690582001.git.sanastasio@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0061.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4b::9) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VI1PR04MB6813:EE_
X-MS-Office365-Filtering-Correlation-Id: bd806d23-780b-4de4-6416-08db91dd5a4a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	FawtxtySCmpKsD+9M59fdZ6tuqixLzapZQgufimGKX1m9697uRmFrE2Bo0pp7IRn8qf6yENXkbRggoqORaaqFQKtdUrVJKC/mv9ilOTqFvdGJnZyy8HuSChRcr3St91XEWPlP823eigSjp8y4rBhoIi8M7+zjeapr6gBexg/dCzN6oz3Jo2tqryMnm6YXwUlJZHSRNO6/LW3ve8R2gD/iAsDhjb4lYI492/LdkW/LZ+06VZ4NZlj7fK0KA5jlMJu/aAStBDc3PYFjwJD+H0atjg52CgWwDFojVhebVa/B+7esddpV4oTPfs9ER97npWftj36aImLzPjF1B4duQ0mD0nuML8rpk2UuoT6Aj6w+gLNztSG3AVSkkIxYfoQ59hZTxUmOEyfOoZC1GjrtSpY0rtePHVLrnIE5ZZMEmA6C3W4HN0nfqFZrlsb0M8dd9nWizYBcS6o8jIWOte/40XzCfCG+x4eRGqZh2SluA8bvcxjGWxYUQrz+yYcqpuppTEEQD2biWfVK1yovuCFIoYrWPxQvcYXfV20SU0hyNkkuv16AP40HqS5olke8xzUUB6Oi0pQW2s+QcbtU4y3xcPH6OAjSt1si09WxpmWrrUzJKNJq+fMBMd/vGSItXHqphr7wAr9nsnKoenq+G237bHTaQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(396003)(136003)(39860400002)(366004)(451199021)(66476007)(86362001)(31696002)(8676002)(31686004)(8936002)(316002)(4326008)(5660300002)(6916009)(54906003)(41300700001)(66556008)(66946007)(38100700002)(478600001)(2906002)(36756003)(6512007)(6486002)(6506007)(26005)(186003)(53546011)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QmpyUG1zZ2pZK1hGL3YrYmF0UkN1ZHBoQ2VCOFVzNStpdElWSG1nMnNJQkRv?=
 =?utf-8?B?MWdYWXpCY2lHZmc2MFhwQXY5MWtTMFIyR0h1ZXNEalhzZ1ZPQklrQXdwRDhF?=
 =?utf-8?B?cW1rbVZuOVYyaEhDckxuQXpCZGtJYkoyZ2xzbk9oT2ozZWk5WE84Z25wdXAw?=
 =?utf-8?B?MS9nY0hpTUY3Q1hBOUxUdFRWdU1VYVlUb2hKemxmWi9XWnpxSk91NWROK3ZJ?=
 =?utf-8?B?QTFuRUprRHZtRXdHOExZZUJWRVd1bS9OWlFiQ3Z2SGwreFJ0L09CVjNlT2Jh?=
 =?utf-8?B?T0U3cENZUmd3eFUrNzZ4MDlQcjA5N2QxZC96Zkx3VUhoVDVSeDZsMEVvWUNK?=
 =?utf-8?B?aXlmTTdTaWt2TDRzZ1oyN0tSLy92aXZ1UnRZVndOOTN6dG1KeTBYZGlBSDVy?=
 =?utf-8?B?SVJmN1JONzFXSWF5c0hBZThZVzhKZG9Dazl3dEFpQmFZZXBHdHI5MG0rWG14?=
 =?utf-8?B?L3FCVWJIWWZTMWlNUGtaaXdJVForOUtHM3hIRnAxciswY1hZMHNuNUwycks2?=
 =?utf-8?B?VHdBMTdQL1pPVHhjVC9FYzRmTTFna1NJT3I0ZEpjUGxMbkVlSGkrWXJHTkMv?=
 =?utf-8?B?MzVmMVI5SklZMGtZcG9aUER5dEVuQVd1V05jKzFmN1o5UmhBNXRid1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qYldnb2drWUxwQ1JBY0NFek5BMDlSV0xqajh4cityY0FRTGh4bENuNmpL?=
 =?utf-8?B?L3JvUHI1UTh1ZjUxM0J1UWdaTUJiLzI1bGk5UVpPZjlLREgzSlQvTHpNWG5j?=
 =?utf-8?B?VjI4eWd3MmI1bEt0b0kxZHdITXhZZmljTHJiemFQbmVrSXZUdW4xcENsUWFT?=
 =?utf-8?B?SUl6eVFQZ1hLa204MUtPUEx5YTRIdzZpWk83OE81UU9CR0J0YmZPVW9teC9v?=
 =?utf-8?B?V2J4MlgydDFKRHVkZFRxTnh3akwxcWVaTXVOcTFEN0hSaGs0WHd6VXlnVXYx?=
 =?utf-8?B?ZDUzV05TUmpab1A5bTIxbVNxcHF1eXQzdHlnV0hLbG9lWmFnSnFZR2pWWTcr?=
 =?utf-8?B?MDBQeFRMbGVKNWRYUUtvVHBGTHB0aEdNRWZreUhGaXNKTURiM29IQkJ4VTZp?=
 =?utf-8?B?dWNNeE0zdE5xZjBsdU1xZ1ZtK29aQXZENXVyNTRhOGxXdThrL2dlWE1wOU5K?=
 =?utf-8?B?RTg4d3hWMXZIOGdMdE1uaU9SaldVVUc2cDE3S2IvV21rV2dvT2p0cWdJUWZB?=
 =?utf-8?B?cnZYeHUzQ0pwLzVWeUc4bXJWczZzczhXV0lSd0pGRXdycmROdGtVck13Qjg2?=
 =?utf-8?Q?bs58ecnTRhF8AZCOGkYnadPkC?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bd806d23-780b-4de4-6416-08db91dd5a4a
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 15:46:49.3003
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 1PIfKdLTV94C2qCUL1p73FGlB6FFBHPelLgfsbILj4rskswbbXU7GKd2QdxpcHrgN8ROXH9Ix8VB0s6qx3N8Vg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6813

On 29.07.2023 00:21, Shawn Anastasio wrote:
> Introduce a small assembly loop in `start` to copy the kernel to
> physical address 0 before continuing. This ensures that the physical
> address lines up with XEN_VIRT_START (0xc000000000000000) and allows us
> to identity map the kernel when the MMU is set up in the next patch.

So PPC guarantees there's always a reasonable amount of memory at 0,
and that's available for use?

> --- a/xen/arch/ppc/ppc64/head.S
> +++ b/xen/arch/ppc/ppc64/head.S
> @@ -18,6 +18,33 @@ ENTRY(start)
>      addis   %r2, %r12, .TOC.-1b@ha
>      addi    %r2, %r2, .TOC.-1b@l
>  
> +    /*
> +     * Copy Xen to physical address zero and jump to XEN_VIRT_START
> +     * (0xc000000000000000). This works because the hardware will ignore the top
> +     * four address bits when the MMU is off.
> +     */
> +    LOAD_REG_ADDR(%r1, start)

I think you really mean _start here (which is missing from the linker
script), not start. See also Andrew's recent related RISC-V change.

> +    LOAD_IMM64(%r12, XEN_VIRT_START)
> +
> +    /* If we're at the correct address, skip copy */
> +    cmpld   %r1, %r12
> +    beq     .L_correct_address

Can this ever be the case, especially with the MMU-off behavior you
describe in the comment above? Wouldn't you need to ignore the top
four bits in the comparison?

> +    /* Copy bytes until _end */
> +    LOAD_REG_ADDR(%r11, _end)
> +    addi    %r1, %r1, -8
> +    li      %r13, -8
> +.L_copy_xen:
> +    ldu     %r10, 8(%r1)
> +    stdu    %r10, 8(%r13)
> +    cmpld   %r1, %r11
> +    blt     .L_copy_xen
> +
> +    /* Jump to XEN_VIRT_START */
> +    mtctr   %r12
> +    bctr
> +.L_correct_address:

Can the two regions potentially overlap? Looking at the ELF header
it's not clear to me what guarantees there are that this can't
happen.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 15:47:28 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 15:47:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573156.897598 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQV7I-0008UI-3F; Mon, 31 Jul 2023 15:47:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573156.897598; Mon, 31 Jul 2023 15:47:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQV7H-0008U9-WB; Mon, 31 Jul 2023 15:47:27 +0000
Received: by outflank-mailman (input) for mailman id 573156;
 Mon, 31 Jul 2023 15:47:27 +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 <SRS0=L1gI=DR=suse.de=tiwai@srs-se1.protection.inumbo.net>)
 id 1qQV7H-0008Pq-4T
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 15:47:27 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8aecb584-2fb9-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 17:47:25 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id B35B21F385;
 Mon, 31 Jul 2023 15:47:23 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 555E51322C;
 Mon, 31 Jul 2023 15:47:23 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id aoTYE4vXx2Q3fwAAMHmgww
 (envelope-from <tiwai@suse.de>); Mon, 31 Jul 2023 15:47:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8aecb584-2fb9-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1690818443; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:  content-transfer-encoding:content-transfer-encoding;
	bh=t3IBo6+Xh2NmTnvBSm+b5LtxORuubw5R26/pUdx5lvQ=;
	b=rhCV7DQXwa+unzKT3opzFC6boo5uZYaa4z9NwGfSq4Io7QBHD2ni5op4Z1RNLHOiDDEa2k
	+KCCws2BT0O1mIOTeJytKqi6Lxmp3k4vkcz4+h9PPq8cwb+RTErNbVqgfUD1hnldMRn4u/
	Znq7cvbGgSupFudpbC7mCtTWfLq4Oic=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1690818443;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:  content-transfer-encoding:content-transfer-encoding;
	bh=t3IBo6+Xh2NmTnvBSm+b5LtxORuubw5R26/pUdx5lvQ=;
	b=1hce7oJgp7vNPcAZisDxdfNeDXcXTojPVPAnbeD684LHbINwF/3jcXav44ynQXxRXqVRWa
	K9EYUuceH80eoDCg==
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Cc: Takashi Iwai <tiwai@suse.de>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Andrey Utkin <andrey_utkin@fastmail.com>,
	Anton Sviridenko <anton@corp.bluecherry.net>,
	Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>,
	Banajit Goswami <bgoswami@quicinc.com>,
	Bluecherry Maintainers <maintainers@bluecherrydvr.com>,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	Ismael Luceno <ismael@iodev.co.uk>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Mark Brown <broonie@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Olivier Moysan <olivier.moysan@foss.st.com>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	linux-media@vger.kernel.org,
	xen-devel@lists.xenproject.org
Subject: [PATCH 00/24] ALSA: Generic PCM copy ops using sockptr_t
Date: Mon, 31 Jul 2023 17:46:54 +0200
Message-Id: <20230731154718.31048-1-tiwai@suse.de>
X-Mailer: git-send-email 2.35.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Hi,

this is a patch set to clean up the PCM copy ops using sockptr_t as a
"universal" pointer, inspired by the recent patch from Andy
Shevchenko:
  https://lore.kernel.org/r/20230721100146.67293-1-andriy.shevchenko@linux.intel.com

Even though it sounds a bit weird, sockptr_t is a generic type that is
used already in wide ranges, and it can fit our purpose, too.  With
sockptr_t, the former split of copy_user and copy_kernel PCM ops can
be unified again gracefully.

The patch set introduces the new PCM ops, converting users, and drops
the old PCM ops.  Most of conversions are straightforward, simply
replacing copy_*_user() with copy_*_sockptr() variants.

Note that the conversion in ASoC will fix a potential problem of ASoC
PCM that has been for long time.  Since ASoC component takes care of
only copy_user, the conversion form/to kernel space might have been
missing.  With this patch set, both cases are handled with sockptr_t
by a single callback.

The patches are lightly tested (with a faked PCM copy implementation
on HD-audio), while most of patches are only compile-tested.


Takashi

===

Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Andrey Utkin <andrey_utkin@fastmail.com>
Cc: Anton Sviridenko <anton@corp.bluecherry.net>
Cc: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Cc: Banajit Goswami <bgoswami@quicinc.com>
Cc: Bluecherry Maintainers <maintainers@bluecherrydvr.com>
Cc: Claudiu Beznea <claudiu.beznea@microchip.com>
Cc: Ismael Luceno <ismael@iodev.co.uk>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Mark Brown <broonie@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: Olivier Moysan <olivier.moysan@foss.st.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: linux-media@vger.kernel.org
Cc: xen-devel@lists.xenproject.org

===

Takashi Iwai (24):
  ALSA: pcm: Add copy ops with universal sockptr_t
  ALSA: core: Add memory copy helpers between sockptr and iomem
  ALSA: dummy: Convert to generic PCM copy ops
  ALSA: gus: Convert to generic PCM copy ops
  ALSA: emu8000: Convert to generic PCM copy ops
  ALSA: es1938: Convert to generic PCM copy ops
  ALSA: korg1212: Convert to generic PCM copy ops
  ALSA: nm256: Convert to generic PCM copy ops
  ALSA: rme32: Convert to generic PCM copy ops
  ALSA: rme96: Convert to generic PCM copy ops
  ALSA: hdsp: Convert to generic PCM copy ops
  ALSA: rme9652: Convert to generic PCM copy ops
  ALSA: sh: Convert to generic PCM copy ops
  ALSA: xen: Convert to generic PCM copy ops
  ALSA: pcmtest: Update comment about PCM copy ops
  media: solo6x10: Convert to generic PCM copy ops
  ASoC: component: Add generic PCM copy ops
  ASoC: mediatek: Convert to generic PCM copy ops
  ASoC: qcom: Convert to generic PCM copy ops
  ASoC: dmaengine: Convert to generic PCM copy ops
  ASoC: dmaengine: Use sockptr_t for process callback, too
  ALSA: doc: Update description for the new PCM copy ops
  ASoC: pcm: Drop obsoleted PCM copy_user ops
  ALSA: pcm: Drop obsoleted PCM copy_user and copy_kernel ops

 .../kernel-api/writing-an-alsa-driver.rst     | 59 +++++---------
 drivers/media/pci/solo6x10/solo6x10-g723.c    | 41 ++--------
 include/sound/dmaengine_pcm.h                 |  2 +-
 include/sound/pcm.h                           | 12 +--
 include/sound/soc-component.h                 | 14 ++--
 sound/core/memory.c                           | 39 +++++++++
 sound/core/pcm_lib.c                          | 81 +++++++++----------
 sound/core/pcm_native.c                       |  2 +-
 sound/drivers/dummy.c                         | 12 +--
 sound/drivers/pcmtest.c                       |  2 +-
 sound/isa/gus/gus_pcm.c                       | 23 +-----
 sound/isa/sb/emu8000_pcm.c                    | 79 +++++-------------
 sound/pci/es1938.c                            | 31 ++-----
 sound/pci/korg1212/korg1212.c                 | 46 +++--------
 sound/pci/nm256/nm256.c                       | 42 ++--------
 sound/pci/rme32.c                             | 50 +++---------
 sound/pci/rme96.c                             | 48 +++--------
 sound/pci/rme9652/hdsp.c                      | 42 ++--------
 sound/pci/rme9652/rme9652.c                   | 46 ++---------
 sound/sh/sh_dac_audio.c                       | 25 +-----
 sound/soc/atmel/mchp-pdmc.c                   |  2 +-
 sound/soc/mediatek/common/mtk-btcvsd.c        | 22 ++---
 sound/soc/qcom/lpass-platform.c               | 12 +--
 sound/soc/soc-component.c                     | 10 +--
 sound/soc/soc-generic-dmaengine-pcm.c         | 18 ++---
 sound/soc/soc-pcm.c                           |  4 +-
 sound/soc/stm/stm32_sai_sub.c                 |  2 +-
 sound/xen/xen_snd_front_alsa.c                | 55 +++----------
 28 files changed, 251 insertions(+), 570 deletions(-)

-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 15:47:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 15:47:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573157.897608 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQV7J-0000JR-E9; Mon, 31 Jul 2023 15:47:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573157.897608; Mon, 31 Jul 2023 15:47:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQV7J-0000JG-Ay; Mon, 31 Jul 2023 15:47:29 +0000
Received: by outflank-mailman (input) for mailman id 573157;
 Mon, 31 Jul 2023 15:47:28 +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 <SRS0=L1gI=DR=suse.de=tiwai@srs-se1.protection.inumbo.net>)
 id 1qQV7I-0008Pq-4U
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 15:47:28 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8bf3fc3d-2fb9-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 17:47:26 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id AD507221DE;
 Mon, 31 Jul 2023 15:47:25 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 88FAE138EE;
 Mon, 31 Jul 2023 15:47:25 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id YCiEII3Xx2Q3fwAAMHmgww
 (envelope-from <tiwai@suse.de>); Mon, 31 Jul 2023 15:47:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8bf3fc3d-2fb9-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1690818445; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=/+cNMH/c7X3cgYEw5Tdzz7tWVvID4+Xiyk2ZoC5lYxg=;
	b=fccN7u32PlaSWJriOwbPt1P4A5c1Kh2w+WAqJKPtYEtUq3WoFm/guT3qYY60/+otcGesHe
	x+LFWDXZG1rc4PO2Y7N4fVLRAESnISo/Z4VxA8opElQAFBPov9mUjv5BIV7wrOe0176Dib
	fTzOIvStkKTPtnptn89KLIrEnvCsacg=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1690818445;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=/+cNMH/c7X3cgYEw5Tdzz7tWVvID4+Xiyk2ZoC5lYxg=;
	b=6ni0u4og24SJ1i3i9dNtkAm9Loqmw5FXfET4pSwH+POGs93MNJHPvitlAo1o5ieI6U9KRt
	qD/JXWtpZfILuVDQ==
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Cc: Takashi Iwai <tiwai@suse.de>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	xen-devel@lists.xenproject.org
Subject: [PATCH 14/24] ALSA: xen: Convert to generic PCM copy ops
Date: Mon, 31 Jul 2023 17:47:08 +0200
Message-Id: <20230731154718.31048-15-tiwai@suse.de>
X-Mailer: git-send-email 2.35.3
In-Reply-To: <20230731154718.31048-1-tiwai@suse.de>
References: <20230731154718.31048-1-tiwai@suse.de>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This patch converts the xen frontend driver code to use the new
unified PCM copy callback.  It's a straightforward conversion from
*_user() to *_sockptr() variants.

Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/xen/xen_snd_front_alsa.c | 55 +++++++---------------------------
 1 file changed, 10 insertions(+), 45 deletions(-)

diff --git a/sound/xen/xen_snd_front_alsa.c b/sound/xen/xen_snd_front_alsa.c
index 7a3dfce97c15..a7e2cba3ff4e 100644
--- a/sound/xen/xen_snd_front_alsa.c
+++ b/sound/xen/xen_snd_front_alsa.c
@@ -602,38 +602,24 @@ static snd_pcm_uframes_t alsa_pointer(struct snd_pcm_substream *substream)
 	return (snd_pcm_uframes_t)atomic_read(&stream->hw_ptr);
 }
 
-static int alsa_pb_copy_user(struct snd_pcm_substream *substream,
-			     int channel, unsigned long pos, void __user *src,
-			     unsigned long count)
+static int alsa_pb_copy(struct snd_pcm_substream *substream,
+			int channel, unsigned long pos, sockptr_t src,
+			unsigned long count)
 {
 	struct xen_snd_front_pcm_stream_info *stream = stream_get(substream);
 
 	if (unlikely(pos + count > stream->buffer_sz))
 		return -EINVAL;
 
-	if (copy_from_user(stream->buffer + pos, src, count))
+	if (copy_from_sockptr(stream->buffer + pos, src, count))
 		return -EFAULT;
 
 	return xen_snd_front_stream_write(&stream->evt_pair->req, pos, count);
 }
 
-static int alsa_pb_copy_kernel(struct snd_pcm_substream *substream,
-			       int channel, unsigned long pos, void *src,
-			       unsigned long count)
-{
-	struct xen_snd_front_pcm_stream_info *stream = stream_get(substream);
-
-	if (unlikely(pos + count > stream->buffer_sz))
-		return -EINVAL;
-
-	memcpy(stream->buffer + pos, src, count);
-
-	return xen_snd_front_stream_write(&stream->evt_pair->req, pos, count);
-}
-
-static int alsa_cap_copy_user(struct snd_pcm_substream *substream,
-			      int channel, unsigned long pos, void __user *dst,
-			      unsigned long count)
+static int alsa_cap_copy(struct snd_pcm_substream *substream,
+			 int channel, unsigned long pos, sockptr_t dst,
+			 unsigned long count)
 {
 	struct xen_snd_front_pcm_stream_info *stream = stream_get(substream);
 	int ret;
@@ -645,29 +631,10 @@ static int alsa_cap_copy_user(struct snd_pcm_substream *substream,
 	if (ret < 0)
 		return ret;
 
-	return copy_to_user(dst, stream->buffer + pos, count) ?
+	return copy_to_sockptr(dst, stream->buffer + pos, count) ?
 		-EFAULT : 0;
 }
 
-static int alsa_cap_copy_kernel(struct snd_pcm_substream *substream,
-				int channel, unsigned long pos, void *dst,
-				unsigned long count)
-{
-	struct xen_snd_front_pcm_stream_info *stream = stream_get(substream);
-	int ret;
-
-	if (unlikely(pos + count > stream->buffer_sz))
-		return -EINVAL;
-
-	ret = xen_snd_front_stream_read(&stream->evt_pair->req, pos, count);
-	if (ret < 0)
-		return ret;
-
-	memcpy(dst, stream->buffer + pos, count);
-
-	return 0;
-}
-
 static int alsa_pb_fill_silence(struct snd_pcm_substream *substream,
 				int channel, unsigned long pos,
 				unsigned long count)
@@ -697,8 +664,7 @@ static const struct snd_pcm_ops snd_drv_alsa_playback_ops = {
 	.prepare	= alsa_prepare,
 	.trigger	= alsa_trigger,
 	.pointer	= alsa_pointer,
-	.copy_user	= alsa_pb_copy_user,
-	.copy_kernel	= alsa_pb_copy_kernel,
+	.copy		= alsa_pb_copy,
 	.fill_silence	= alsa_pb_fill_silence,
 };
 
@@ -710,8 +676,7 @@ static const struct snd_pcm_ops snd_drv_alsa_capture_ops = {
 	.prepare	= alsa_prepare,
 	.trigger	= alsa_trigger,
 	.pointer	= alsa_pointer,
-	.copy_user	= alsa_cap_copy_user,
-	.copy_kernel	= alsa_cap_copy_kernel,
+	.copy		= alsa_cap_copy,
 };
 
 static int new_pcm_instance(struct xen_snd_front_card_info *card_info,
-- 
2.35.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 15:52:33 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 15:52:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573167.897617 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQVC8-00029u-Vz; Mon, 31 Jul 2023 15:52:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573167.897617; Mon, 31 Jul 2023 15:52:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQVC8-00029n-TR; Mon, 31 Jul 2023 15:52:28 +0000
Received: by outflank-mailman (input) for mailman id 573167;
 Mon, 31 Jul 2023 15:52:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQVC6-00029f-VJ
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 15:52:26 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20616.outbound.protection.outlook.com
 [2a01:111:f400:7d00::616])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3eabe4fb-2fba-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 17:52:26 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by PAXPR04MB9230.eurprd04.prod.outlook.com (2603:10a6:102:2bc::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul
 2023 15:52:23 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 15:52:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3eabe4fb-2fba-11ee-b255-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Rcp9yYCmCf1UiIT17DSASF0+HRg60JJD4dBbQSnoYhpIHoiHtv4pzmRDmlLhK3NFT6CB1gPAzDrwJzJYpP8GXqFpNsTwIh9XhyfV7kD9W657n6x3q+SQ10Q1I7v9PwU4eRzfMWJKHVG/5xtObN+36jpNsFpr/u47gytbV7ghvCKK/OIGXlN9HeSTP+aYpJMMQE/MiFtdc89472GwQeUKoJHC82cTYfB/uyusUtFs9CtHtR2QqyJ9b6bACSeDD3aK2sR3OFCFRVE6/TjogsrkGEOnmYfUsTx4MRO0A2mfvbu98vqw9wrVLS0MMWKVFWuLn3CGxK+qvCYypqsb9Wx9Fg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=qmOpGfNTF1DcuS34iEkNYtxo6gugpGeU7QrqlugyK1U=;
 b=UbTEKPZnt51qO3lBmpRZfxxNWxB7XBzG1nj8ViFj2BvntvUBGi9v7Url5vqrpXDFCS1E6g3k/iWTsefi9jkeugco8fAsy5hE4qwT3jDxM7fWjDqX5z5YbWK1Q5CUfcoE8UL/WtyXcXg8CbpCvNhoKmbVNnCYm6Zv8ZhiBwCordGWwKc/C54amhkWrfwf0jZUepaVRgY/I0fz7vJiRtzrDlV1Lm+FJzXPJ7FjqMFTYA8zP/NB57vC6hwW4WGgN/iFg/BY+N179PhUqWwaSu8YJabBg+8cEfGLLLtDVEi1mzAXmywqSntWDeH4n6JHsrHiA+c/jvrmh3XN57dBgCNjog==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=qmOpGfNTF1DcuS34iEkNYtxo6gugpGeU7QrqlugyK1U=;
 b=0Fzgif8EUf5ihtf4u0d3jvfqHOCrjgpWXDNwO+4rdhsgH5Bmc2+TviVzLRapgXAuBBbiZdaJK3lPzI/Bm1Z3efx0T1XX02gN8OKF4WS/CgDu1UQurhEzONU7avWaI11CbcvLsmCWefJY57VQEnky7orU8wgvXhoqS1wNWG4UFzjvzGO9IZ8gOLA5bZV66dIrKhcWuNidI/SxuNKrtD+dexLI9EUcHZbABO4hv5iPOWK2NBCu0ctChmpBACax+COIJLXmk9hgEqKYVH9E66JERmky/+HxDnBF5uDYf/oiecVbsgC1J2iRFYitjG2ljD7oE2+Zt4e/7S1riOM+p3f8dw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <d280f52a-0d88-77f7-12d7-b952bd1a102f@suse.com>
Date: Mon, 31 Jul 2023 17:52:23 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [PATCH 1/5] xen/lib: Move simple_strtoul from common/vsprintf.c
 to lib
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <cover.1690579561.git.sanastasio@raptorengineering.com>
 <294e48747a0f9aee0be4fd178fcab029fa317528.1690579561.git.sanastasio@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <294e48747a0f9aee0be4fd178fcab029fa317528.1690579561.git.sanastasio@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR0P281CA0134.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:97::18) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PAXPR04MB9230:EE_
X-MS-Office365-Filtering-Correlation-Id: 2d064243-257e-4dde-dec6-08db91de2195
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	LJI50pNmzZ767BxwhUvtqnt3F23c6hAOh7iqN/xICH4+IJZtaWG+6jx7ogwfu/2BHudQm0c3pnRAcg1ZF72E766p8wYCFBW6jq+cvv8+gpZNRDEAlUuUAYIgxefX7Dh7nBgwz+3E/ainzBAK0/6zNQ6NsLQI0KipdnhMb8oB8jtyp9ddlQIU1AFAUivsivTF0APeVWvCBaSut2qPEw4eOH6ZongeR3eimeeP9ZJ1innN98aHPOBIMJktvOHEV25P2bPNUcZQQN/Y1R6naGHdxca1neHSWtPHkutrpNDNrAW7WHEiPnmFB7L5GIScPEFNOj+ZGB3Wtpmk7yEPhVx7gXOgjhq5RZ5Kacl2Z08Yjk+6/aYeiQeMJ0HxOP8I1yNQjVBHYW3pVL4/pBtljMWdvSEwT7Af2iBFxSMOB9rz9DNrUH1MRHy6sFDyuuO2kzFmEzEgdLi7A1np/5JIwHoAFJ1MD5QEGw5N0GBW0O0P8JxWCQ5BIBtgY+gGIObtT32uV7TGafjF74h+biL2vhMNRj7FHF5+TDU4RLpZi/UCMsWZIUDCTIDwl1QlaaJmBMaaxFJWIjKLXJGcB0IG15dCBOq+dwUq1Sa5DGVRg+I6H1d8UO2kcVI4Ms9QPCNBY3TbtVCTY3dOIvP5vs1hrGxv2Q==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(346002)(396003)(136003)(39860400002)(366004)(451199021)(66476007)(86362001)(31696002)(8676002)(31686004)(8936002)(316002)(4326008)(5660300002)(6916009)(54906003)(41300700001)(66556008)(66946007)(38100700002)(478600001)(2906002)(36756003)(6512007)(6486002)(6506007)(26005)(83380400001)(186003)(53546011)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QjVGOWxHWVJpSmVBdGp0UlNaUWZtc2xkL2pmOUFJRnNsWmpNajFlWi9POEVi?=
 =?utf-8?B?N01jMkVoTXg1ZHpPM3ZLdXVSSHkvaStqOStyc281ekNXTnl3YlVGWVpnQ3Yv?=
 =?utf-8?B?VTZLOFZ3d2M1Wi9iL0NraEowWnN0ZjhJSG8xUFFDaHlWTGMvQ0JtM0FIaU90?=
 =?utf-8?B?Nko2bUw1WENiK2lQelpCTjRNbFhvN0p6bDNwUDFqMWhTcWh0d09rOUxva3A2?=
 =?utf-8?B?MXNRQXpEcHRxeW9SZnpjR0FhVEZiSXNaZ0R2MzVLMW04bTRyeEYxKzFMQ2Qx?=
 =?utf-8?B?ZmY0VEQ0THpaNkNvNVU0bm1ndEw0NzdmSjF3YUNzNWV3bVVQRm0yOWpuQ3BV?=
 =?utf-8?B?cWRVUnFEVUROVTZDd2hMbVoyVjNsOFNQcHhpWWZzSCtSMU95UkFGVGFhc29s?=
 =?utf-8?B?V2pTaDhIZGRZS09lelBWam9xdnpYN0dWdkE4UnljWFViSCtTek1aTUM1d3JG?=
 =?utf-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DFUYXVESll0NnZzY1ArY29MdTBpc21wb3g5cWpDN01M?=
 =?utf-8?B?dHlaanFYZThhbEVrRjNSZWxoRzVMNEw1RkdHazdKWTNkSVNMb0NWK0JUWjhB?=
 =?utf-8?B?Slp2TmFSRVFaeDJOS0JyRkNyLzA5VzBkK3lmclNGa2R5TXJuWmphTGswbFk5?=
 =?utf-8?B?RGhKWDlVZGZzQzNORWx6MkN4U3VUZ1ArQWxRUkpmZElrMkwzY3FTRE04Y3V0?=
 =?utf-8?B?SUh0RS9lcFBmT1VJUEpLLzhBQVlBVEltU0hpdE8zb1RBczhQdGhIODNraDVT?=
 =?utf-8?B?TExQVUExa1dOd0hlaFpLY2l5Zy8zN1BtbWJsMEdCRWFFTGdYQitrTDl4R0JP?=
 =?utf-8?B?MXlRVUZUTWo0eklhQWtzYlRtNkY3NG1maDRTblk3MDZJWk9vVFVidUtWcm5K?=
 =?utf-8?B?dXdtNXNNNDJhUkMycE5Lb3N4c3h1TmUrQ1RHYTJJT1gydDRtc2RTUVhEV3pM?=
 =?utf-8?B?OGY2M1ppOWJzMFVHYmtqSFZpT3dmbkhJQytoZ205SlJ1RkdLK2N5bURneXRt?=
 =?utf-8?B?T0RiU044d051eGRCRzJrS2JJVWpCVG5tVEhnbFlUVWN2dDNMem1MRnZvaXlQ?=
 =?utf-8?B?bnpqTVptNzdqVHBpOWQ3RitXZmZEZHFCUGNQbnlQTDE0RzlWdll0b3NwOVc5?=
 =?utf-8?B?Ylp1SDh5dzRKYXN2dStoOThlT3h4L2JQUzdOM0FxbnA1WnkxdGM0aThzakVX?=
 =?utf-8?B?R3JGamJZVWpUOU5CK0R2MjJtYzZnYThzK3dGZ0NFK01ndjZ5Q1ZYNmIvYTQx?=
 =?utf-8?Q?J+L86VUAnDDv+G8SErerwxhP+?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2d064243-257e-4dde-dec6-08db91de2195
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 15:52:23.6497
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: FcFqdcWBgppJFJOxJV5Pt3Oz1p3uiciCa1U41ds5IRH83QNKliDSnmmFcv3iglOKog0g8CBgJGc/j3bd8yVpnQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9230

On 28.07.2023 23:35, Shawn Anastasio wrote:
> Move the simple_strtoul routine which is used throughout the codebase
> from vsprintf.c to its own file in xen/lib.
> 
> This allows libfdt to be built on ppc64 even though xen/common doesn't
> build yet.
> 
> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
> ---
>  xen/common/vsprintf.c    | 37 -------------------------------------
>  xen/lib/Makefile         |  1 +
>  xen/lib/simple_strtoul.c | 40 ++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 41 insertions(+), 37 deletions(-)
>  create mode 100644 xen/lib/simple_strtoul.c

What about its siblings? It'll be irritating to find one here and the
other there.

Also please no underscores in (new) filenames unless there's a reason
for this. In the case here, though, I question the need for "simple"
in the file name in the first place.

> --- /dev/null
> +++ b/xen/lib/simple_strtoul.c
> @@ -0,0 +1,40 @@
> +/*
> + *  Copyright (C) 1991, 1992  Linus Torvalds
> + */
> +
> +#include <xen/ctype.h>
> +
> +/**
> + * simple_strtoul - convert a string to an unsigned long
> + * @cp: The start of the string
> + * @endp: A pointer to the end of the parsed string will be placed here
> + * @base: The number base to use
> + */
> +unsigned long simple_strtoul(
> +    const char *cp, const char **endp, unsigned int base)
> +{
> +    unsigned long result = 0,value;
> +
> +    if (!base) {
> +        base = 10;
> +        if (*cp == '0') {
> +            base = 8;
> +            cp++;
> +            if ((toupper(*cp) == 'X') && isxdigit(cp[1])) {
> +                cp++;
> +                base = 16;
> +            }
> +        }
> +    } else if (base == 16) {
> +        if (cp[0] == '0' && toupper(cp[1]) == 'X')
> +            cp += 2;
> +    }
> +    while (isxdigit(*cp) &&
> +           (value = isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < base) {
> +        result = result*base + value;
> +        cp++;
> +    }
> +    if (endp)
> +        *endp = cp;
> +    return result;
> +}

While moving, I think it would be nice if this stopped using neither
Xen nor Linux style. I'm not going to insist, but doing such style
adjustments right here would be quite nice.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 15:58:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 15:58:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573171.897628 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQVIE-0002mi-Ko; Mon, 31 Jul 2023 15:58:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573171.897628; Mon, 31 Jul 2023 15:58:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQVIE-0002mb-Hi; Mon, 31 Jul 2023 15:58:46 +0000
Received: by outflank-mailman (input) for mailman id 573171;
 Mon, 31 Jul 2023 15:58:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQVIC-0002mV-Ke
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 15:58:44 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on2061a.outbound.protection.outlook.com
 [2a01:111:f400:fe12::61a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1f6aebb4-2fbb-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 17:58:43 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU2PR04MB8679.eurprd04.prod.outlook.com (2603:10a6:10:2de::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.39; Mon, 31 Jul
 2023 15:58:40 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 15:58:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1f6aebb4-2fbb-11ee-b255-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=KKNBCVaDZBXTq8EhSQKJzu07gGoxif4PnsKVg3e0xED1MfIroZNjPcgmN2p/5wEn+BKu14e5gVa/pykClnIFV5FHypaAPBFp+bzljw9yZn+7eZZr2p8Y0LdC8fHrCA6eXRiKOCxmIFRyMg0/3Xt1Ycndr+PRjqyizS1YQbRQnWi/offR0DTjviUOCsByiwCw8w1DwVCY3C6kCPLNrLsxU55n5/wQ/72UWqxGbvkQsSIMlFBkSVl1TUMOKbK2LBC6k6zV+yAR178qnmeNVS3X3YV3sZehRxbV25VWsCrj7SrD123RpSA1YWfXoErdI6G94PLIVmMHHTwSOO8I5J0InA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BCz0ZMv0rjcF8ceu2MJXy/aHsqYv5b8g9VU76qBIgaI=;
 b=A4qZ0AtPAnRTK5OBw/Th3M7YEuiwUKHYJeWWtAOXQqoqF8rd6zwz3+xYJJ7CcGTeNmaLfto9WzGUTYM9jsSBRtSaltSRpA8hT7XjRQRusbyiX2u3TTbAXa99rKOvaS0Gk9etBSA96ZRdl+4k5wXoL7wk7/4i4zFzddJWj0KkYFfAj2F5jspHajoPLTbVU0fhC/gLXl0yWMA5TuBrb6pGhLx06OzbWghpRcXrh1JGxqZ/tKni6/4JBtDJ6WQq73jxwL4xNecLS7uLPrgZmjuyS1zB6+n4ALilSMBJnijei/J6+l4kx6kQp/NqBVyB8+eDxnWxRnqL8YylMuH/D5ePYg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BCz0ZMv0rjcF8ceu2MJXy/aHsqYv5b8g9VU76qBIgaI=;
 b=kOIjc8YBBOjH3JO+SyC82jnRMZ6LeNzYp/B+8TPF2bcTbBj4K9F821sTUxk7IzUrt5F6T/qd/AcN7sEDnrteEHRxkXPmPXkQaNng2IkhN7Zdw6Ynpf38miEu3W1OnQkNBzb4uufX6ghgz5fDysnROYkBW0C4kHMK9QMAHxMCngv0SUu3Jwb3gfIiS6vIYEQnnK9LKWkk7wiqdjm8cwJQ1V5EVMSr+07gKC+rgsLGcOZ0IljPFadeafJVOiylp8+0G4PII+49JgRJhwZ3Ue2wj6SLUW/aUdJgPD9oKB/Zsa1inkbCSRK1YPagKK5Bs5Bt2vWMEmQSDLpQnuazEVLulA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <904d9448-1fd8-bcd7-2cbd-c9e5752dec66@suse.com>
Date: Mon, 31 Jul 2023 17:58:40 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [PATCH 2/5] xen/ppc: Switch to medium PIC code model
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1690579561.git.sanastasio@raptorengineering.com>
 <335ce2a18f8cce679dd8b30d11560989131b4337.1690579561.git.sanastasio@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <335ce2a18f8cce679dd8b30d11560989131b4337.1690579561.git.sanastasio@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR2P281CA0137.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:9e::12) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU2PR04MB8679:EE_
X-MS-Office365-Filtering-Correlation-Id: e1024a82-074a-434e-f10a-08db91df021a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	Xs5QNDYYiVNSIUju+Qnl/xc5TOvKNw9dUl4tRqCljvcHfU35ry6N0muj3iNL7nnfygc2n9A+Ovhj2G//4m1UC+7+5Q/IJgK8LvQRv0hFCVZTVaRdTS9Yso/D5nW04sCi4HkiiXb2Af5D5T8qg1YkcwL2ReIAd1LEAc9syGxhXqRTti7KVA2VXik97Egn34j77PBsogRrbAAv8ocDNvTFbqyXwCCqIa49REbJKkw+xmNl0SuDrLhOYvB1kNr5ZzkdR84GEnkWErcZaGuVT51THIvaVwNzB/6JQ5sJ4a5EiIM+KoMzlyn7EeTi7Sf8LvbqZ88uanWWXFzpwVFBWROR3VCufFTGuBI23C6FCmMMAGL6zObK9FLGuS4FM0oPKq8xUBNQ/ujYp5G8QgzsUasmVtAptwsyP7df6+xiYq+SmG8RCAn/CDBwQiurosKMIQY0C/RdDZOGOnxlTH4u19WOkpBK08P2p+qbCB0zzFs+65h/CY0Y+l9gJGKAXihJAtN8mVqeozKVNZy/+XQSiTEyyJm401hwbckjfesaEDe+icyVlnhLvbzKsCaQxd8BvhhQwSmibdDVtkEgcej/bZ/F1TlLlJgWvOF6powYhZ6MAQNCe0pqJio5/MtmZOMtKBOutV5+qzVtXSq5VmVh9QL5wg==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(396003)(136003)(39860400002)(346002)(451199021)(6512007)(6486002)(186003)(36756003)(2616005)(31696002)(86362001)(38100700002)(6506007)(26005)(53546011)(5660300002)(8936002)(4326008)(41300700001)(8676002)(31686004)(6916009)(66946007)(4744005)(2906002)(316002)(478600001)(54906003)(66556008)(66476007)(43740500002)(45980500001);DIR:OUT;SFP:1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f-8?B?WTk5UXdwOFY0TTRESThVTWRSZWVuZWRGR0l6cUhIeUNFbWEzWi9obzZhWEF3?=
 =?utf-8?B?WW1zUldCQ1JueEFhNXpIeVNXWGhyQmw5cGN1WDlNbmdXQjRZYjdzMUVEd0Jz?=
 =?utf-8?B?L1ZkK0g5SklSWUk5b1d6dStEWXYxNmlkREhZeDNVQXRoanNGT1hYd2o4MWtm?=
 =?utf-8?B?dUEvQUQwUGJQMFBtWFFuTmZhcFJ6MVVrVzlEakhId0g5ZmtSNUJqMjc0Nml6?=
 =?utf-8?B?d1QxWjVKcmJNRWNYOG5JY01Ya2NIZ2pBbThvcG5VSy9hQjBVcWxlN1lVVUMr?=
 =?utf-8?B?VGwyeGFDS1RWU2tyUWtpTmdyL2Fna3dkc3FiQ2Noby94WWU5cVYwcVg2b1FC?=
 =?utf-8?B?dXI5eEd6eFFKRXFkbG95ODBvZmliTGNMM243amRKM3NoSGdPOFpJTXIyWEx2?=
 =?utf-8?Q?+zcT9FjQPVuc/qdlZBiEExRAr?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e1024a82-074a-434e-f10a-08db91df021a
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 15:58:40.3636
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: /6/FnYvK9twbhiMI6c/OGQ/MwOrQvJ0bTKKUszaUB7gDdNW4ALU5DmglM2Gkmd2DwPr1U2XkNvr5LcR1w1/lyA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8679

On 28.07.2023 23:35, Shawn Anastasio wrote:
> --- a/xen/arch/ppc/ppc64/head.S
> +++ b/xen/arch/ppc/ppc64/head.S
> @@ -1,9 +1,11 @@
>  /* SPDX-License-Identifier: GPL-2.0-or-later */
>  
>  #include <asm/asm-defns.h>
> +#include <asm/asm-offsets.h>
>  
>      .section .text.header, "ax", %progbits
>  
> +
>  ENTRY(start)

Nit: Stray change?

> @@ -11,16 +13,19 @@ ENTRY(start)
>      FIXUP_ENDIAN
>  
>      /* set up the TOC pointer */
> -    LOAD_IMM32(%r2, .TOC.)
> +    bcl	    20, 31, .+4

Could you use a label name instead of .+4? Aiui you really mean

> +1:  mflr    %r12

... "1f" there?

Jan

> +    addis   %r2, %r12, .TOC.-1b@ha
> +    addi    %r2, %r2, .TOC.-1b@l
>  
>      /* set up the initial stack */
> -    LOAD_IMM32(%r1, cpu0_boot_stack)
> +    LOAD_REG_ADDR(%r1, cpu0_boot_stack)
>      li      %r11, 0
>      stdu    %r11, -STACK_FRAME_OVERHEAD(%r1)
>  
>      /* clear .bss */
> -    LOAD_IMM32(%r14, __bss_start)
> -    LOAD_IMM32(%r15, __bss_end)
> +    LOAD_REG_ADDR(%r14, __bss_start)
> +    LOAD_REG_ADDR(%r15, __bss_end)
>  1:
>      std     %r11, 0(%r14)
>      addi    %r14, %r14, 8



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 16:00:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 16:00:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573174.897637 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQVJO-0003Jg-U8; Mon, 31 Jul 2023 15:59:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573174.897637; Mon, 31 Jul 2023 15:59:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQVJO-0003JZ-Ql; Mon, 31 Jul 2023 15:59:58 +0000
Received: by outflank-mailman (input) for mailman id 573174;
 Mon, 31 Jul 2023 15:59: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 <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQVJO-0003H9-7k
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 15:59:58 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20611.outbound.protection.outlook.com
 [2a01:111:f400:7d00::611])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4b56455f-2fbb-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 17:59:56 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by DU2PR04MB8679.eurprd04.prod.outlook.com (2603:10a6:10:2de::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.39; Mon, 31 Jul
 2023 15:59:54 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 15:59:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4b56455f-2fbb-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=C/phix4jvlbYuObw78wHrZBSVLIixVTBoSfAAxfBDUB2CaumHVy4tFIMX1vEqdUT1i8o0rQtzbSWJ7A8eSfa8GzZOMUFlim2P08gBkhYELky58KTdH1dFUEzDR7E/YDsdZL6d3uJ9tm5Bc/tJ7KukC1XVeTPtqbi9ciGUi6hEmz2VrM8oKNzJgzH5ULLGBH1RWzfjxUPZ5I2AUBuwfKBa3MHGyqA37j5IyZIfg9+5d5IYy2Dc31p78aM89g0ZnyIKpAp3x+a7K22vzJr4VodiD1DhWxpG3+0mIn/gXaWXuRCYLT6YIxRDOjylVGDZiYCk7N68US9tQY+wg5h/zTQDw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MQm+nDN0b/7fW2wRESzG+Qv9WCFLSoOodgcl2Ucvfvk=;
 b=Qb97KVaWnG1lj3wBUag0eYpiFmCP2sNzGVyYwuWakXvVgdOWUx9YlWQFEgQ71kqaMmXveYnCghiN7j3yXMRCq23dVtrlWBDpe5URWQMEqF3w8bTMXTtNUn7JlKaSzUO757LEL6W3cy8CG+XTfLkgKi6J0hVqvbO890WKCpXJlV/TEoSiEdwS/CrfH55Fjpj7mJ3m8zuAdUbJUNqpw4jQGti9op2NZxtWkEB4T/lsxLdljplK0FLflPdY3DB37uiTbrBqoA8XMeckbNj6897WNUm8s4CRW6Gx1v/xDccKeWtFzOFo1eIZgHsUbTe0gFzf3ly8Z0l7M4Z0NoDAkqr3PQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MQm+nDN0b/7fW2wRESzG+Qv9WCFLSoOodgcl2Ucvfvk=;
 b=H8uaMyZSSD2v7ccJltSSxOTA0o106huinhm+WJm16JC3h17jUcjajU8ae7nN8UodaPmGvYdy4kLP7fqwUe+KRozbqVwE5tb5GF0h4L72z7zTAWMfYZK7sYJTolY7u3+ZtOFq5dL5tuskJJwF+FVLTdRQvFqpwnxy8Rvxx8SeNZpTCDSkDhAknQoZiDqfC0uLjbvup1P/fOfeacf/tPt8UOQYBJ+UlssgXiRld1LoRXvaI2kNNLSKl9NYEw/UV/3ryuqEnx8FHS2ZGc49fNPrjfU9FFbJeR5cjrpM5R4Re6wi8DEDDUVeHfpSKnyzHQFII7PH/6nH+xVP2OtgQclz7w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <7206fb11-a34e-4c47-3f15-83f5410db37a@suse.com>
Date: Mon, 31 Jul 2023 17:59:54 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [PATCH 3/5] xen/ppc: Add OPAL API definition header file
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1690579561.git.sanastasio@raptorengineering.com>
 <7feead05db9baa310feaddd24415774582e88344.1690579561.git.sanastasio@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <7feead05db9baa310feaddd24415774582e88344.1690579561.git.sanastasio@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FRYP281CA0007.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::17)
 To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DU2PR04MB8679:EE_
X-MS-Office365-Filtering-Correlation-Id: 7d7ed068-1119-4c1a-3c7e-08db91df2e4c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	rtHTG69dSlea8FEU6dGaJfUJ81UFhJtXj3P56dfSykHh0upWZ0H82EEX+Cu9zPm0TxVFMjIYrcTii5hgL8j/W6gg0/0BKMoZ4m9r18h8XUw7HgYzvNrBQ4fs/4a4J4LnjMh3Aj2axq+5jMJTZ29s7nU5D9VbRTmka1qfhVEfg6/9flogYIxGS/JOa1sBotoF0c0zp07kqhN+8ZeeOjsP2gEViFn5tNB9B0Cx+c7TJ0v9Hf9WPVPbw1JLlqSp+Q+9pVJZaYEQQDnJ+HuW+0ESGSNsZrMlFrqLuyPD3e19h/oMV0UcgYwqwOgmhR2UAtS7YkaKp8l+/YNpQOFciPqpFpZP9DVsX3/hsbgzQEwwnMMnvxY6MwaaerSXnMVlMZyxaKe8f19v/Pfk3gCphU2anUecFcSLOyjtfrVSynUvJOBkcUuZkt6f7N4q/cAUxlVRGeMUp3OuGBTNea5agPsl29ywjA50P1S+yG5CQnQkrVqpBAn2FKBfV6dCX2mdk8oMoS/JKlaejwIgjOyDahG32AxK51aQiAU8TQ2/LVbMyj8nbdwdnCQI1l8SPxVHZB9SXfOiCaOSbAzk81DiTySSXqWUFANXfQC27iL8DU9NZThi/t5dHZXQb5EawY8BZ6iQONwmnlcsy5//9PRdQVhMWw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(396003)(136003)(39860400002)(346002)(451199021)(6512007)(6486002)(186003)(36756003)(2616005)(31696002)(86362001)(38100700002)(6506007)(26005)(53546011)(5660300002)(8936002)(4326008)(41300700001)(8676002)(31686004)(6916009)(66946007)(4744005)(2906002)(316002)(478600001)(54906003)(66556008)(66476007)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MnZVVjk3MGxqa3RZUEY4cG5NNHFvYW8xVWt4REsvTGFGc2h4RDdiTFZIenJC?=
 =?utf-8?B?SW53NENpWnJ0UjZESXlHNmp4ZUdGaDlOaGE4N0xibDl5OGRwVWN3TmNJdmdO?=
 =?utf-8?B?YXkzZGtBM2M3WkNYbUp2d0dMNWp5ZXJGc0djNkFnc2V3SU44U0ZXVDdoeVJS?=
 =?utf-8?B?YXpuK0FOVzh0bmt6elViS1NxS3dzOXJ5ZmtpN2lhN21LRkNpR1FUbVE4ZjRD?=
 =?utf-8?B?eDZwT0V1eHc0Zjk5RVdnQyt0NWoxZUNXWlM0VEtJNS8yRW0vQkJoWmRYUTVu?=
 =?utf-8?B?aDJCN2JDVlZGalhWME80WWFIV3VISlk3a2tyYzlLRVJoOXJwak1hNUdnQ2E0?=
 =?utf-8?B?cXlldVZ3MndEYnVETkZIeWNJRnpVblhPeTVkYnFuVXBVY1BGNjlHSVdtLzRE?=
 =?utf-8?B?OFRaemZST3FJOS9rR2V5cnZpTWF0RE4veTJlbGRYcWhQT2RGZG1CalEvU3ZC?=
 =?utf-8?B?K21sZUV6SnhhcXhiRjZhYjdaS0VSejdKT0syQWhwQktNVHVrMEZ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0JtMXdTaVRRSjNCZ3NOSVV2emtpdGlaSExnUXBuOFhCeHNadUJY?=
 =?utf-8?B?TVdlTGRvVHhaT3N1UDh2djU4eDJOSUNxUGxWWXZSM291bjc5ZkVzTXp1SmxI?=
 =?utf-8?B?U3BhOFQvTGxkVmRUYkNqTEUzYW5sQUc5QVhQUkd3ZmpKU0JYM1NKMVRycEh2?=
 =?utf-8?B?THB6NjhoNzRiTUk4bmNZNE5ubDBGMEkxTG8yM0NHbGlRVjVHY3RwdXNESDhT?=
 =?utf-8?B?NDZvb3hkd2tMWElYWVRhMVZsSGJFa1BhN2RGK2F2ZzBoV2tpSEpsMk5zUEZR?=
 =?utf-8?B?cWJBY09HeTlvSWJxRVpQVnZFbjJnYWdtZjNtVEVhcDF1cEQzMi80eVhjU2Rk?=
 =?utf-8?B?aDh5K1YvK1UxdGhhNU5RdkNMdEVFUHBKbWlweG05ejQzeHpXdGdzbVkyRlNj?=
 =?utf-8?B?WnhlNzZ1ZWQra0dseVVmaGlGUkdUYkRYdUZURy9NVy8xVGNPUGNZTHg0Njl2?=
 =?utf-8?B?RXpSZC9xNGdTNUwyWXplSWs3ejFGeXZ6b080eFJuSlJCcVBzVkJtQkVRcHFU?=
 =?utf-8?B?bHUzN0xLL3F0T1p5Vm04UG56OWFXQlBnbGRrRENGbmNpRVlvQldncTljbU9j?=
 =?utf-8?B?cEhiQkI3amZvUWgxVHFWMmNScFRNb1k5em1HSUhXZmk4OXFpUjdoelhva2Nx?=
 =?utf-8?B?djlYY24rQnV5cll3Yjk3QTEvK0s4dWpjL1ZleWZCVXBiMzJIeHFta1NvbFhW?=
 =?utf-8?Q?/HETwXFgrQ7LQSnx3kJFuVFlw?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7d7ed068-1119-4c1a-3c7e-08db91df2e4c
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 15:59:54.5336
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Oxyrnqj2aFVBeGmDkJZvtPk/tskCwyYOp5dgP/l+c3ecDoQJzIi7B4GAB1Zkz/+8meT5D62aofvyi5qWegcSiQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8679

On 28.07.2023 23:35, Shawn Anastasio wrote:
> OPAL (OpenPower Abstraction Layer) is the interface exposed by firmware
> on PowerNV (bare metal) systems. Import Linux's header definining the
> API and related information.

To help future updating, mentioning version (or commit) at which this
snapshot was taken would be helpful.

Jan



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 16:04:23 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 16:04:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573180.897647 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQVNa-0005NG-Hi; Mon, 31 Jul 2023 16:04:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573180.897647; Mon, 31 Jul 2023 16:04:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQVNa-0005N9-F3; Mon, 31 Jul 2023 16:04:18 +0000
Received: by outflank-mailman (input) for mailman id 573180;
 Mon, 31 Jul 2023 16:04:17 +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 <SRS0=RfZW=DR=lst.de=hch@srs-se1.protection.inumbo.net>)
 id 1qQVNZ-0005N1-M5
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 16:04:17 +0000
Received: from verein.lst.de (verein.lst.de [213.95.11.211])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e4c8ed86-2fbb-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 18:04:15 +0200 (CEST)
Received: by verein.lst.de (Postfix, from userid 2407)
 id E2B1868B05; Mon, 31 Jul 2023 18:04:09 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e4c8ed86-2fbb-11ee-8613-37d641c3527e
Date: Mon, 31 Jul 2023 18:04:09 +0200
From: Christoph Hellwig <hch@lst.de>
To: Petr Tesarik <petrtesarik@huaweicloud.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Lameter <cl@linux.com>, Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Petr Tesarik <petr.tesarik.ext@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>, James Seo <james@equiv.tech>,
	James Clark <james.clark@arm.com>,
	Kees Cook <keescook@chromium.org>,
	"moderated list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>,
	"moderated list:ARM PORT" <linux-arm-kernel@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:MIPS" <linux-mips@vger.kernel.org>,
	"open list:XEN SWIOTLB SUBSYSTEM" <iommu@lists.linux.dev>,
	"open list:SLAB ALLOCATOR" <linux-mm@kvack.org>,
	Roberto Sassu <roberto.sassu@huaweicloud.com>, petr@tesarici.cz
Subject: Re: [PATCH v6 0/9] Allow dynamic allocation of software IO TLB
 bounce buffers
Message-ID: <20230731160409.GA8991@lst.de>
References: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
User-Agent: Mutt/1.5.17 (2007-11-01)

I was just going to apply this, but patch 1 seems to have a non-trivial
conflict with the is_swiotlb_active removal in pci-dma.c.  Can you resend
against the current dma-mapping for-next tree?


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 16:06:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 16:06:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573184.897658 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQVPh-0005xB-Tr; Mon, 31 Jul 2023 16:06:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573184.897658; Mon, 31 Jul 2023 16:06:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQVPh-0005x4-QZ; Mon, 31 Jul 2023 16:06:29 +0000
Received: by outflank-mailman (input) for mailman id 573184;
 Mon, 31 Jul 2023 16:06:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bN9S=DR=suse.com=JBeulich@srs-se1.protection.inumbo.net>)
 id 1qQVPg-0005wy-CG
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 16:06:28 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur04on062a.outbound.protection.outlook.com
 [2a01:111:f400:fe0e::62a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 33e2ca7a-2fbc-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 18:06:27 +0200 (CEST)
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23)
 by VE1PR04MB7406.eurprd04.prod.outlook.com (2603:10a6:800:1ae::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul
 2023 16:06:24 +0000
Received: from DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com
 ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 16:06:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 33e2ca7a-2fbc-11ee-b255-6b7b168915f2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=H8gfWPujQaoUpxdOO/WEFOgsyxcMxI55o97FR2yuqdpsxFk8Qmzj82joiGYWYjGxDnM4J/Cw0unEW1N+upjOPy8Nqwyg/BM8t/5Jii/tP2ItTWTsJf+92BZz+Wwt+fG78E808YOjBAC8vzCUDHr72LozChs9XpVnN+QVnTHbR4NyQdGM8bTOtCA+ch/EUG3syPvKkr2txw9atehRioGydNmQ/OWRQU+lCEqvdxyY9fARrUh1xe+zDs1WtmggXtZOVZNBJwEx12zvLq77uqXfuIebSTzO/VHEIe9AQMQIHoHS0/nn6abG7L9t+AwABHJUJlu92rpfaHbEELMYgcgOOQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Fxh9v0mrgYFbUK0ELO2Ly+8AEbu5ococKNTQ8RN7v18=;
 b=Ob4sJkHlK/3pB4CDi24UcoN6Lmd5F6h0I3wCd/PEZXq5gVpKEbZktkjMJGiz/B9fZTzgRTcsATSSoXQlTlN5DukfynHTlJ/3RuIfjCTvdSEjxZaP7qzp99fYRCs+scpiYGID9RszfLX7wCBRbEjTm1HwiQfENW4+T6NXB6jPfQLcIz2U+bHif1GZfGYpa7ZfxQhp3zq8n4HzCmGEoGK72qJKz102sb+MWPMHQTi7cM6Tv6shHqEm39Z4DAK/FdYPGWYnjyuEIyHtIjhRHqcC8xYgtPFHGCgjXDnkCiJ5rwE+adn0gIWqgOAArrkKVIIOU8PkxStln/4PtqN6V/nuxQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com;
 dkim=pass header.d=suse.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Fxh9v0mrgYFbUK0ELO2Ly+8AEbu5ococKNTQ8RN7v18=;
 b=yLj3Lxxh0TD0XEfYUpOChJF+g2vqys+S/vllgyKZvYUXxlEC+xc+62YS9UjFnoiTAGYyWRRFS3Rr24QDFSzIXHXc6XzNomjeUCMC5V7l84HtWPfJnMlvRFsUF2bChGDDKYPm8yb+Zi3s9TVJ8MQbHscnmMip3GN02hHuc3IRoLCNEbWrUW8DJ4rJscUNlgWCEqBbNC8qsnVmaB/mKEPu9dtUyd3D5xg7tJCX3oEYYB1mVxCB84zqWaIEUgpMhWjkq9RhpNjxP+0GnOEtDKQ4P7fcz5HDYsDI5ubxE9BHBwO4iZQiwRtwAoDTht/apCiLAmV1zmJnPmFvQj+PPg2r+w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=suse.com;
Message-ID: <bc5d6856-03b3-038c-8d9d-fb06309e766f@suse.com>
Date: Mon, 31 Jul 2023 18:06:24 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.1
Subject: Re: [PATCH 4/5] xen/ppc: Parse device tree for OPAL node on PowerNV
Content-Language: en-US
To: Shawn Anastasio <sanastasio@raptorengineering.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1690579561.git.sanastasio@raptorengineering.com>
 <fc4011f42ea017ec9ae12c4f1a0c1a09b7bbcfc8.1690579561.git.sanastasio@raptorengineering.com>
From: Jan Beulich <jbeulich@suse.com>
In-Reply-To: <fc4011f42ea017ec9ae12c4f1a0c1a09b7bbcfc8.1690579561.git.sanastasio@raptorengineering.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0144.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:95::15) To DU2PR04MB8790.eurprd04.prod.outlook.com
 (2603:10a6:10:2e1::23)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VE1PR04MB7406:EE_
X-MS-Office365-Filtering-Correlation-Id: b55e09e2-9c5f-4f80-f2b7-08db91e016d0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	MJqpERB6oN/d17hm4smhEHef6lTTP68DJ3lC1dLV9E6dIPtU3RsC633ehX1vINyvziVkb19r+AdUDonNtw5B/VYeMUr5psTXv+DDN3MbRiAztO7pKcxhEoMbWgPIJL5XE43sHkaB8WfRDgbW/BmHf9TDDdZfvIFRUfIHgOuUzJ0JyehMhyUZ6bhOmwtB+jyALSWu62vhal2WWqA48VX6gmqyi7WRqk31MIfm2uuvCO3VfMIWfDoK/M/fSGTi3SJ4eq6Ss9cz6FOD0WF8xD3h4LmUsZQAyWkjrLCfm8U9pCpihlBmNdSchQZtK7a717iAEodorzmGoYREt+CAMJXWFsYe7Ruy/z8v0uwxkW9IY1mjfYWaZttIMNh0XUjsOwRiJ92wTh8WTWxYzmiotvCL31551U72ndk9tHoUfKet/v7RdOCymwuG+mt4R4Wu/utdVQZxIRyu4P63lWxR3pqXfQX3oGjf8bPCJkhQ3LzE/mPdBfOXjfOyJ9y9dHuFkObk9PoqhNW5a8+1hjpzLd9Lak1YRsOFXroI503gj3umdhu1rkYbQikSgs98VA4b47C2Ewf6SaVyK2KnPp29ZanrZIYLiJQHTloUPU/XzsF/uKxA+IQwBGjWlbg/i77H1kbxXCNaDRGSQdXFlLwnhzRgFw==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(396003)(376002)(346002)(39860400002)(451199021)(5660300002)(2616005)(53546011)(8936002)(186003)(8676002)(6506007)(316002)(26005)(478600001)(4326008)(66946007)(66476007)(6916009)(54906003)(66556008)(6486002)(6512007)(41300700001)(86362001)(4744005)(31696002)(36756003)(2906002)(38100700002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eUU0emdZK2xwQWpGelhYWVJMQzhNc2w1bXNGd0w2M1dib3RubCt2ejhpYUVs?=
 =?utf-8?B?dmZkODkwMUVQeTY5WG5LczhITXBJVWMvNWlyYWUwdCtMZFB6MW9ZUEt0NnEv?=
 =?utf-8?B?T29SNkg5Y2tLNjR6MUV2YzhiaVgrVjYwaGVHVlpoZFNVeVpSblZGRTJyUmFx?=
 =?utf-8?B?KzdRSXdvRFJJaTRIM1ExcWVrb1YxZ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U9SL2xiTDNHOG5ra24reFNmMHVoMU9MSWlTTFdJYlhtcmxKN1QrWWho?=
 =?utf-8?B?SXdxMXV4OVg3aEpPWHBVZE5na0ZweVdxUjM5Tnh3UGhOZGZkQ0h5ZUo3T1BS?=
 =?utf-8?B?S01XS0YyOHlCd2FxcmlhYy9zQTZjSVZ6cmd5OSt5SWphOTVjbDFWL0JDbitL?=
 =?utf-8?Q?qPUfriMgyZj4FyT+FI9bgV+4a?=
X-OriginatorOrg: suse.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b55e09e2-9c5f-4f80-f2b7-08db91e016d0
X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 16:06:24.5922
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: RRTEduPa13W77N8Zbnn2996lJLs281I8SmkOZPi26WxXevpJfczMQ+a/0k+r2PUPHC4aZf9dTqcLqBuNtsrhhg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7406

On 28.07.2023 23:35, Shawn Anastasio wrote:
> --- a/xen/arch/ppc/arch.mk
> +++ b/xen/arch/ppc/arch.mk
> @@ -10,5 +10,5 @@ CFLAGS += -mstrict-align -mcmodel=medium -mabi=elfv2 -fPIC -mno-altivec -mno-vsx
>  LDFLAGS += -m elf64lppc
>  
>  # TODO: Drop override when more of the build is working
> -override ALL_OBJS-y = arch/$(SRCARCH)/built_in.o
> -override ALL_LIBS-y =
> +override ALL_OBJS-y = arch/$(SRCARCH)/built_in.o common/libfdt/built_in.o lib/built_in.o
> +override ALL_LIBS-y = lib/lib.a

Can't you drop the ALL_LIBS-y override right here?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 16:07:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 16:07:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573186.897668 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQVQC-0006QR-4l; Mon, 31 Jul 2023 16:07:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573186.897668; Mon, 31 Jul 2023 16:07:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQVQC-0006QI-1w; Mon, 31 Jul 2023 16:07:00 +0000
Received: by outflank-mailman (input) for mailman id 573186;
 Mon, 31 Jul 2023 16:06:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=S3vB=DR=arm.com=Luca.Fancellu@srs-se1.protection.inumbo.net>)
 id 1qQVQB-0005wy-3N
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 16:06:59 +0000
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-he1eur01on2052.outbound.protection.outlook.com [40.107.13.52])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 461a479e-2fbc-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 18:06:57 +0200 (CEST)
Received: from DU2P251CA0009.EURP251.PROD.OUTLOOK.COM (2603:10a6:10:230::22)
 by AM7PR08MB5496.eurprd08.prod.outlook.com (2603:10a6:20b:de::20) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul
 2023 16:06:27 +0000
Received: from DBAEUR03FT045.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:230:cafe::ab) by DU2P251CA0009.outlook.office365.com
 (2603:10a6:10:230::22) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43 via Frontend
 Transport; Mon, 31 Jul 2023 16:06:27 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DBAEUR03FT045.mail.protection.outlook.com (100.127.142.142) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.6631.43 via Frontend Transport; Mon, 31 Jul 2023 16:06:27 +0000
Received: ("Tessian outbound f1e964b3a9be:v145");
 Mon, 31 Jul 2023 16:06:26 +0000
Received: from 2ffec257ab8c.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 4D3ED97A-F1B6-4CE4-99A2-350D8C08602B.1; 
 Mon, 31 Jul 2023 16:05:52 +0000
Received: from EUR04-HE1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2ffec257ab8c.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Mon, 31 Jul 2023 16:05:52 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com (2603:10a6:20b:8f::22)
 by PAWPR08MB10282.eurprd08.prod.outlook.com (2603:10a6:102:35c::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul
 2023 16:05:50 +0000
Received: from AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::4c7d:6a1:e742:3b1a]) by AM6PR08MB3749.eurprd08.prod.outlook.com
 ([fe80::4c7d:6a1:e742:3b1a%4]) with mapi id 15.20.6631.043; Mon, 31 Jul 2023
 16:05:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 461a479e-2fbc-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MhiZfmuZN2Uh2vTgT7CdSDeJOhrDDBKo2iB2Z/zXyiY=;
 b=NOzQKgMcJXAQQ3v4Q1QlJWFr8niG6TBBQ8zkfaZcf5KG1mkle7N7LrW6zlDTZ66TSqm2B+ADw3XWvEHjXOtwA09tRPMOen/yYQm0p5e9s1SvhG/hiCQtAhoAj1FkHEpQ7TBjPNi/wt5tZ7ivNCumdpcy1LPBFlBGgqmReACr3XU=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: ff119f0e35063ceb
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=WlRZPhJV2vLue+pD+JSEsrHYxAMXab4oWlAw1n9SJiLNcEkX+ryPDgG0kcqxLBlMDMYd1+jsbAeKLJ4iauUTsYq5KCXYHI8u9dtOtEKGYID2fa104IaoCuDwzWUT2eW5Z3dJPnszH4w6SbaEMqPMJhxVunm30nvfA/cNAaSg4qReKK0n2s0GYfTEXRp9cSBp7OqvkLqz5ZroBK0w7faOyXRP0foctVHpBdeYli6wqUcq/Sq3976LCSRaFY35s6J90nf5w4vvPS7hsS5gkt6cVUKJnkV2ONPNajFw7Z1A2HrKdszEpCz/eVTs2B8wW9+SjqIKyYUi/lDvC46q1R0mRg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MhiZfmuZN2Uh2vTgT7CdSDeJOhrDDBKo2iB2Z/zXyiY=;
 b=Ie2H8FVg+jcuDVZ4qrkxGwId9c8UqVkUg+EXvOJ5PeaZJdFJTLKIBdMmcZVwMdTGyVM8JqC6vuLuHp3rBoTPp1MiRMgHSk5aNW9fdSq9cH6SYkczwyKJpao4ucCY+yjkQrQ+SIwBC8GOkHPVPQ3RacH4bfk5Z2QMJIuSo1LaU3v0CRDuVpMVLUYuUYP7lbK2U7GImur/31qHE2VDthofhunDqTRVkt4hxujugOE0YHIR4DLgoT6fNfewo90SS4coZ9emZan1zeInWmSu7NSUQsRjtxFBihltHu0xs5aIp8LCF9sd7zzk2fZALb9a4XaGXhgfQGLePscYD95QtYkatw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com;
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MhiZfmuZN2Uh2vTgT7CdSDeJOhrDDBKo2iB2Z/zXyiY=;
 b=NOzQKgMcJXAQQ3v4Q1QlJWFr8niG6TBBQ8zkfaZcf5KG1mkle7N7LrW6zlDTZ66TSqm2B+ADw3XWvEHjXOtwA09tRPMOen/yYQm0p5e9s1SvhG/hiCQtAhoAj1FkHEpQ7TBjPNi/wt5tZ7ivNCumdpcy1LPBFlBGgqmReACr3XU=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Bertrand Marquis <Bertrand.Marquis@arm.com>, Wei Chen <Wei.Chen@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, George Dunlap
	<george.dunlap@citrix.com>, Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [RFC PATCH 1/5] [WIP]misra: add entries to the excluded list
Thread-Topic: [RFC PATCH 1/5] [WIP]misra: add entries to the excluded list
Thread-Index: AQHZwSs9042EQJWI+kCE6wP5BUPzKq/T/JsAgAADsACAAAJogIAADKcA
Date: Mon, 31 Jul 2023 16:05:49 +0000
Message-ID: <17788E9C-3F21-4817-A28B-1822AFE42E01@arm.com>
References: <20230728081144.4124309-1-luca.fancellu@arm.com>
 <20230728081144.4124309-2-luca.fancellu@arm.com>
 <876c7fa3-6759-ce5a-9e6d-9737eb4eb9ad@suse.com>
 <2C6F7309-B7EA-4FAA-8C72-E95D253F79FC@arm.com>
 <6356ab5d-1ecd-da3c-4738-fb33ee2b187b@suse.com>
In-Reply-To: <6356ab5d-1ecd-da3c-4738-fb33ee2b187b@suse.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3731.600.7)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM6PR08MB3749:EE_|PAWPR08MB10282:EE_|DBAEUR03FT045:EE_|AM7PR08MB5496:EE_
X-MS-Office365-Filtering-Correlation-Id: d27b31e8-cae3-457c-64c8-08db91e0187b
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original:
 WZDGqt7gAxQeaNORCYphBwSVm1T2yxckzMEkti7AsyZyKFXrgeTpmIYrLk6WTM4nPKBryJz5kuZVrDI56pqF6+zChIb9qKqAt/yPLHx+arO/N5U++x8R4hviHTAYbj2u4dJZ5JaMBiacZWrBHLVc4Bj5sE/b9rKPV19Dx823K+ovo6+qUL0fcJz4Te8CS2057DfY8OCfmacjsAVF3LM8bgbj4nQn+7aG1/Ii94byhdvabyePHnyofCFBu4eTBtCRixl6GvFwTZQMrIyyZ7EklN+r/SBg9X56jdjY5j1oJA7F/Zj1F1JZYFMpJUTjdSY7VDsWJFBkWctxGAeIEOrnzgryiE6ZnlNCGAYiwp4trNBLpEsQ4XPnctBD2oq6XnNrv19CCdXABzhGjB7nDWn39KkCHTJNLpGWO9UIREi/JDKtLzR/ENmNU33BWdclamx5Dkyd+zaIjFthw6/X1FAioxbw/jT/vtFv1ZTf+t0bGMGsGvsxhS0B0NkPbK3qmeeRetTk106qDYdJhJjaYwkKHjtrGjmEz0HbX4WDaxgBqdDM79Py5bV028BPJpoyC1fqT8FqzKQcxTVLK2OmsanhGpgLxIc4NmrdRULa0G9e7Brgb4D8987R2FeNu42GWYutCUD3wZiodL9Eb+LB4llP4w==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3749.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(396003)(346002)(376002)(136003)(451199021)(6512007)(6486002)(36756003)(53546011)(2616005)(26005)(6506007)(186003)(33656002)(76116006)(91956017)(66946007)(66556008)(54906003)(41300700001)(122000001)(38070700005)(66476007)(86362001)(316002)(4326008)(5660300002)(66446008)(6916009)(64756008)(8676002)(8936002)(2906002)(71200400001)(478600001)(38100700002)(45980500001);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <60879C7B86E37D45B9C60665FE0E23EE@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB10282
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DBAEUR03FT045.eop-EUR03.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	c043e38a-14bd-4379-154a-08db91e00229
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	PMArc8zVb3W92H1aL3hwH0iX6gQEJlXm6rlvTPxBV7qMA7JlGUNEQliXHEBea8x6D4aoPxLLlUAAPfwkDCSBoURGjAByYUiR8XEhGOHgxFBwLdb2h84BDhZHzMYj+KsTAud3d/+DZGTWFKwjJEhkJKggAW8S8p3ngvbSytCX2JpLmeoy7RNIFs2Ebde9s4LICsoWwWof4UpwYmBi+B4/Gv+nH4s/SwUeTPtcDW9B7Y8AMVfBKMSFTmuUfMlb96XdduQLdhs0hliNgbGodccFGf6S0n5E7I27+CLeiL22CJJuzF9xq0KeJnU2j95MikfUFv56vFw6YSrJmZ/8CGmrmp5ZR1uxSlZJ83SL7BJISkj1kfQGBTd8vR29KFDYCF2EZlX+KpUEtioTrYnC5FTRBp2r3anKn/FBKU1gT0YtBSo121lQfxvgwhU+1AT8OW8jVOBPwC+xZgT9NZ+Y33PFCOMFTPrReYh97L7jUIMEhx7kxT1x6xI9Lzplhy5bum7swOVywEEupvkQ9h0QCw3qMsbrznkV5QToA7Z8eWbhUtvWXmPyDavXI7vzgmorbA+U4GwXLDnKyWJQMTD6PiervsZjv5J1JW2LBsinkd1zxfP0qZrDyWOphHEheJ6ySRhtROc87E+Nu370G4Zna6gaBLcSd/ESiJNXw3TtpTukyHYbgphDAHdCYckvfKINTLbP3L1nrBTnSqTk/ZH3jAAJLzv0ZeUlMGH0pp7CQyElPJA4fvX9CL8t84b316V+o7pR
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(376002)(346002)(82310400008)(451199021)(40470700004)(46966006)(36840700001)(478600001)(356005)(81166007)(82740400003)(40480700001)(86362001)(36756003)(33656002)(6512007)(40460700003)(6486002)(2616005)(53546011)(336012)(186003)(26005)(8676002)(8936002)(6506007)(6862004)(5660300002)(70586007)(4326008)(2906002)(70206006)(54906003)(41300700001)(316002)(36860700001)(47076005);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 16:06:27.2342
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d27b31e8-cae3-457c-64c8-08db91e0187b
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DBAEUR03FT045.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-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Rva2VuIC5tYWNyby8uZW5k
bS8uaWYvWy4uLl0gYW5kIHNvIGl0IGZvcm1hdHMgdGhlbQ0KaW4gd2VpcmQgd2F5cw0KDQo+IA0K
PiBKYW4NCg0K


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 16:37:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 16:37:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573197.897677 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQVtC-0001WM-Ez; Mon, 31 Jul 2023 16:36:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573197.897677; Mon, 31 Jul 2023 16:36:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQVtC-0001WF-Bx; Mon, 31 Jul 2023 16:36:58 +0000
Received: by outflank-mailman (input) for mailman id 573197;
 Mon, 31 Jul 2023 16:36:57 +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 <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQVtA-0001W9-Fa
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 16:36:56 +0000
Received: from mgamail.intel.com (unknown [192.55.52.136])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 72d481cb-2fc0-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 18:36:52 +0200 (CEST)
Received: from fmsmga005.fm.intel.com ([10.253.24.32])
 by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 09:36:48 -0700
Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81])
 by fmsmga005.fm.intel.com with ESMTP; 31 Jul 2023 09:36:48 -0700
Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by
 fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.27; Mon, 31 Jul 2023 09:36:47 -0700
Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by
 fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.27 via Frontend Transport; Mon, 31 Jul 2023 09:36:47 -0700
Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.43) by
 edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.27; Mon, 31 Jul 2023 09:36:47 -0700
Received: from SA1PR11MB6734.namprd11.prod.outlook.com (2603:10b6:806:25d::22)
 by SA0PR11MB4766.namprd11.prod.outlook.com (2603:10b6:806:92::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul
 2023 16:36:45 +0000
Received: from SA1PR11MB6734.namprd11.prod.outlook.com
 ([fe80::50e4:2cb8:4529:af04]) by SA1PR11MB6734.namprd11.prod.outlook.com
 ([fe80::50e4:2cb8:4529:af04%7]) with mapi id 15.20.6631.043; Mon, 31 Jul 2023
 16:36:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 72d481cb-2fc0-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690821412; x=1722357412;
  h=from:to:cc:subject:date:message-id:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=49RgyO4aXFLQmhq6aGUugMt8PqBLQ2mg1p/4/wrpoK0=;
  b=KZMftuuXTL4rlRGCOUvtLP0hMkfU+BuPjQcMEkTxVwDSAdPxJOsDf4qT
   5Jr6w7/G7eTv2/1l+OMzgbH/hi2BhYmuWhKHLMDdGfFA2jxYY7xGb6za6
   +H9iCTy3CESJzV+TOse94gJhgd0NbKTQTO6Qq9Alqn58/EqMMcJNGxzcg
   aoKwBHbclu0WRY5QO0iDBGGPpXTtvkej5k6hXSBuLto6WgQ0HRKkZ5bEJ
   CLWUFd7PiUuRe2jCW9ijtvE+4EWr9EBubDQdzss8Xzmn5Dscez23/a0gf
   f/y/FpLkCANhwohLaXEAll8c4pqmNkNuLYM1+fyBV/4ZJ7BhjjWgb2u6Q
   A==;
X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="348664989"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="348664989"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="1059052767"
X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; 
   d="scan'208";a="1059052767"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=WWRC9EXycQCHI1JwtNptAUhovI9AGMTKtc0WufcHZ0HU+Kd3v1W2M7LfVyTiGrBMMoz34TiOG7TFoybw1iHfp1TzzzSRDog3vJTzmS6nDU4vRJ3w+BIpXkESBekcp1guDdi4/pPnZ2OXPr2CUbM24AArTFBRrGnLqR4xQ4n7BwmDBXPMuDmrHDO6JDUkQhLBeOekBJw1ivyVwCvogkNdOm5kNjdCeBNXnX7GADCbgy1S82O4jtjIVNIVE3RaW8u4zJzsVy7dnSmDpgqVeh4ghfQMvHEbkbeZp1j1OmNdiIi9r2Xh+CbNf3VaJvHpd220/+TzzU8hfu60Bs76jxzYlw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=hZM3IZCj9KuMzD5OWVeNhHThYuQ7QseQN4yi6Sx4pnc=;
 b=NvFx83XXc30MW/mCM132CM1zAOiNqtGcjnP1IkOpXdTw+4zsKHlGcBSov4/SjFFTuCPUNtWZjDxJ6CK4aDuCmuDWp9WynRUJdG4WIQCvYKw1x1MlWb4nXZIb0jYDWQTC+TJMY8swiJisxD4pUK9cUs3F8vlag5VnnvzwZHLHmGfHHeroNncOkTnBTzhYWHpaMNnv133dJczG1+SqUaEVhYKAPFo6UJV0c8gOZKv6SencstvZg9KlJhYD5cb+itbLLjZ8nO0F5k0+ycPdS+RS+HTmIe6BDajx64QyDwS5UAPwXZss0SSIcRxYUUI6zAvBSoYWeAqY6suP7gI4doEWRA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
From: "Li, Xin3" <xin3.li@intel.com>
To: Masami Hiramatsu <mhiramat@kernel.org>
CC: "linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>, Jonathan Corbet <corbet@lwn.net>, "Thomas
 Gleixner" <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, "Borislav
 Petkov" <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
	"x86@kernel.org" <x86@kernel.org>, "H . Peter Anvin" <hpa@zytor.com>,
	"Lutomirski, Andy" <luto@kernel.org>, Oleg Nesterov <oleg@redhat.com>, "Luck,
 Tony" <tony.luck@intel.com>, "K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, "Cui,
 Dexuan" <decui@microsoft.com>, Paolo Bonzini <pbonzini@redhat.com>, "Wanpeng
 Li" <wanpengli@tencent.com>, Vitaly Kuznetsov <vkuznets@redhat.com>,
	"Christopherson,, Sean" <seanjc@google.com>, Peter Zijlstra
	<peterz@infradead.org>, "Gross, Jurgen" <jgross@suse.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Oleksandr Tyshchenko
	<oleksandr_tyshchenko@epam.com>, Josh Poimboeuf <jpoimboe@kernel.org>, "Paul
 E . McKenney" <paulmck@kernel.org>, Catalin Marinas
	<catalin.marinas@arm.com>, Randy Dunlap <rdunlap@infradead.org>, "Steven
 Rostedt" <rostedt@goodmis.org>, Kim Phillips <kim.phillips@amd.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>, "Liam R . Howlett"
	<Liam.Howlett@Oracle.com>, Sebastian Reichel
	<sebastian.reichel@collabora.com>, "Kirill A . Shutemov"
	<kirill.shutemov@linux.intel.com>, Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>, Jiaxi Chen
	<jiaxi.chen@linux.intel.com>, Babu Moger <babu.moger@amd.com>, Jim Mattson
	<jmattson@google.com>, Sandipan Das <sandipan.das@amd.com>, Lai Jiangshan
	<jiangshanlai@gmail.com>, Hans de Goede <hdegoede@redhat.com>, "Chatre,
 Reinette" <reinette.chatre@intel.com>, Daniel Sneddon
	<daniel.sneddon@linux.intel.com>, Breno Leitao <leitao@debian.org>, "Nikunj A
 Dadhania" <nikunj@amd.com>, Brian Gerst <brgerst@gmail.com>, Sami Tolvanen
	<samitolvanen@google.com>, Alexander Potapenko <glider@google.com>, "Andrew
 Morton" <akpm@linux-foundation.org>, Arnd Bergmann <arnd@arndb.de>, "Eric W .
 Biederman" <ebiederm@xmission.com>, Kees Cook <keescook@chromium.org>,
	Masahiro Yamada <masahiroy@kernel.org>, Ze Gao <zegao2021@gmail.com>, "Li,
 Fei1" <fei1.li@intel.com>, Conghui <conghui.chen@intel.com>, "Raj, Ashok"
	<ashok.raj@intel.com>, "Jason A . Donenfeld" <Jason@zx2c4.com>, Mark Rutland
	<mark.rutland@arm.com>, Jacob Pan <jacob.jun.pan@linux.intel.com>, "Jiapeng
 Chong" <jiapeng.chong@linux.alibaba.com>, Jane Malalane
	<jane.malalane@citrix.com>, "Woodhouse, David" <dwmw@amazon.co.uk>,
	"Ostrovsky, Boris" <boris.ostrovsky@oracle.com>, Arnaldo Carvalho de Melo
	<acme@redhat.com>, Yantengsi <siyanteng@loongson.cn>, Christophe Leroy
	<christophe.leroy@csgroup.eu>, Sathvika Vasireddy <sv@linux.ibm.com>
Subject: RE: [PATCH v9 05/36] x86/opcode: Add ERETU, ERETS instructions to
 x86-opcode-map
Thread-Topic: [PATCH v9 05/36] x86/opcode: Add ERETU, ERETS instructions to
 x86-opcode-map
Thread-Index: AQHZw3zoe8WDZngsCk2Vpcje4URgCq/Tn9qAgABzJoA=
Date: Mon, 31 Jul 2023 16:36:44 +0000
Message-ID: <SA1PR11MB67348E503BDAA548E84D5BA1A805A@SA1PR11MB6734.namprd11.prod.outlook.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
	<20230731063317.3720-6-xin3.li@intel.com>
 <20230731184309.9888dfd44fa1a5fd69c779cd@kernel.org>
In-Reply-To: <20230731184309.9888dfd44fa1a5fd69c779cd@kernel.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA1PR11MB6734:EE_|SA0PR11MB4766:EE_
x-ms-office365-filtering-correlation-id: 9e043996-a3d9-43fb-3271-08db91e45399
x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: qgTFPD0vvh/pbLUzfCEsk1qklqAy5mmnjClGG+j6+RZYPOdQ6vUr+v1QvUNsYId3nEC9G+v8iQ6f6z/bzVOu7mHtbmnIMmB6vBI1mjAArv3fX22N5clBlt+0RS+FjYXhSZUqkRLSMg5xklhFXBdEe4PfwXA10EG2rtgR7ee3Lo9h7Esut9uowIA4gadE+LQs0C0n5kWwwsZiGoTS+spwUIpYsmC7xtF821zf/iDFEnVNsxMllvpw1c0gCSQklMW+bDFedxYM4d56yl6oEgg1AP+IwdoUZm7vUc+3HadIxKXr03pokbBuam6dPR0Fg030gIhO+GCoBc3ymbe0kZQ4FOBefhUuxwn+BEGQF9KQSFYKs5Ccq9AEBmASymHbB1TAEtWVh7mjVYhTrBvuE6sql1mnc95pWD9Jjegvp7nBvrT/JAagDOv3Se/zvxCh1Gid1+lCwhesyBD2j0EOZO6HGnN8h5pR7UEQFVsTPo/TGMryw0v6P3XEMvVTV0rEybgGeJzjT8RFZlU1txdlIyEDDJ3h02EREXYXHqwSob5u8zINwhoGv75Z6mGtRYlAApQLFJ9cxV3uQ5lVe3TzwR2Pfcm6J5jBpRKMEfO/HvI5uNVt9U2ccB3bK13G3eveiKf1
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR11MB6734.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(376002)(39860400002)(136003)(396003)(451199021)(52536014)(76116006)(2906002)(66476007)(66946007)(64756008)(66446008)(66556008)(6916009)(4326008)(7416002)(7406005)(7366002)(5660300002)(4744005)(54906003)(41300700001)(316002)(7696005)(71200400001)(8936002)(6506007)(26005)(8676002)(186003)(82960400001)(122000001)(478600001)(38100700002)(33656002)(38070700005)(9686003)(55016003)(86362001);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Jg6NUDMD0WiuAZY7n6ciD1OJk4KhYlkc6r78IR5Wz/DgIHaGvaNLAt/7FULz?=
 =?us-ascii?Q?KJcc6w5H6Aicghx0005zjkkPhgFUIw0CSgxK7gjZx42z06HX5flgwpgjHa/i?=
 =?us-ascii?Q?08LjhDmmnrnIbEzqAvESI4GeKVLbNl4YJclqyWVRfxZu08eiVXMCf8JD855P?=
 =?us-ascii?Q?ju2v5wbuGhzefwD+O3aBrcWvRPn0oO0rD0les4YPLFGXEg46Kfu9LwtWOUIy?=
 =?us-ascii?Q?3V7fjTzIiXMJlKXKwMwv5NsKzrbe5YwAgp3ttZ8PJvtyD/3woq0bBSq6petC?=
 =?us-ascii?Q?PrmbXlAQjicmN7B0ZV8XxXbqj0T65qlLsDvXAS7/TZzJOsmKfAOdYdwla9ty?=
 =?us-ascii?Q?VPmZwmp17XTjYONkiuXY1favscSTzwD7Fxr5JRgkpaAprswf7V9tjZ1On9K2?=
 =?us-ascii?Q?L3JDbPrJNg/KR9a30KFuMIdci15V+AcGYkZemxZzvKVj5bPuH+IZ2/O20JVO?=
 =?us-ascii?Q?dG5DS1+vo/oK0Vrm4lPkY1ZLhQbH9jLXfrVKomoY2yDZ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=
 =?us-ascii?Q?M86JLgf9pGPaARPJvbTalHKT9glkWd3z5YSPONrsDyAbkA+YDlcI0CEpqf7j?=
 =?us-ascii?Q?lD1kwOyfOxL2tUNsHcxSnE1bTHgs/AzdW5TsNWtIAd2zxfFthjmcaIZ+2Roo?=
 =?us-ascii?Q?zR2S2A60RIezp7v9mRUJn4r9woSfMKL9nmM/fneHfZtRg/kiQ+JZoxPm+UvV?=
 =?us-ascii?Q?xzmC7DBqYan8Ws+ocnU=3D?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA1PR11MB6734.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9e043996-a3d9-43fb-3271-08db91e45399
X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jul 2023 16:36:44.4107
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: eACxot9jVLCzFTNdkJoROJ/GJ+sWbF1GUMo0C1rvQmcEmybjwGoVg/Fb1sRrv5XYnoliRwnENsFGv/RWXLrJ7g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR11MB4766
X-OriginatorOrg: intel.com

> > Add instruction opcodes used by FRED ERETU/ERETS to x86-opcode-map.
> >
> > Opcode numbers are per FRED spec v5.0.
> >
> > Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
> > Tested-by: Shan Kang <shan.kang@intel.com>
> > Signed-off-by: Xin Li <xin3.li@intel.com>
>=20
> This looks good to me. (ERETS has the opcode F2 0F 01 CA, ERETU has the o=
pcode
> F3 0F 01 CA)
>=20
> Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>=20
> Thank you,

Thanks! Will add your RB.
  Xin



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 16:40:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 16:40:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573201.897688 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQVww-00030S-1V; Mon, 31 Jul 2023 16:40:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573201.897688; Mon, 31 Jul 2023 16:40:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQVwv-00030L-Uj; Mon, 31 Jul 2023 16:40:49 +0000
Received: by outflank-mailman (input) for mailman id 573201;
 Mon, 31 Jul 2023 16:40:48 +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
 <SRS0=tYd5=DR=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1qQVwu-00030F-8s
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 16:40:48 +0000
Received: from NAM02-DM3-obe.outbound.protection.outlook.com
 (mail-dm3nam02on20617.outbound.protection.outlook.com
 [2a01:111:f400:7e83::617])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fd65303b-2fc0-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 18:40:44 +0200 (CEST)
Received: from BL1PR12MB5849.namprd12.prod.outlook.com (2603:10b6:208:384::18)
 by SJ0PR12MB6990.namprd12.prod.outlook.com (2603:10b6:a03:449::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.44; Mon, 31 Jul
 2023 16:40:36 +0000
Received: from BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::c838:299:8697:dd70]) by BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::c838:299:8697:dd70%5]) with mapi id 15.20.6631.042; Mon, 31 Jul 2023
 16:40:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fd65303b-2fc0-11ee-8613-37d641c3527e
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ddc1PrQQogptENRH4Q8kH4mQ+2elOz1xUlqSsSQSqXj1CfBjhlo56fgptksEr8f4kaseQ8WYv6DtjIaVGhDUIctcB2jcjr89TPHGEJDWpP/IwkIU3Dh6qcH2X57pvbKsaU9OVWxY1joDUdxy++5MnXVXMHJxu0BhnNV7QpJPiCiRsG86dR5qwsuixhfadcaYEaj2jYHxeW0zHZTh1Z/lppVa6yOY31/ZbDKfWopfhCQiyJbjEp02LazpAbjmge4ulyg4R+pW0x5JrrRNAYSxSqkQOw45R0G0c7jfIjTnVJPaZJ6GLclV452FWYHnStVvIfNFCfmzzzFdqqY04AQGGA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Q/yxLb+YjUjUduRUdkccGt9OVdcr18U30TbKMyGB1AQ=;
 b=jAKLbtq1xTzY+ntiSakAV/xn5X3aQO3RfxTZzJtS7KCCEoKeoc17AwxqTFwGFY0pGVEyJcGZ2m2HZaTVvmMEtityqK1lI8DNFX3lbQpQ07WYHdkSuj3pE+A7/QX4rj0ddNRjGx7ZsFm8FmCZMGWoIK6pZoMkLX6F9J1pkc+ik8vA11EBjmWkiI3on2ZhnWhcVivkr8tgCi8e8g32zSQ0xlky9AAHpgIJhnzIpsLRp5VUcREx1uF5fpOzIzUuLLGpXxjjlAdArc3VhEJpSXfxsO/RObxIulof9EaXwgj4Ejet6VrpX103XuoBxLxqOHlKphQ3ey6eAdsDiQc5uImp8Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Q/yxLb+YjUjUduRUdkccGt9OVdcr18U30TbKMyGB1AQ=;
 b=tE7etQYc4pxJhXMNGsXLJtTCGIhqQ9WMYfdPD+fwAfumzPQ/R0CktszYlrbSDmxZ9NnHU+bPkMrMUKIUp7Rau4bRuMTG3w/88dNNhgKIynV2u0+ICHYufynOaKKxS/GyIFVsPQtAUDkiMWfGebALGLbTOHvDkZc1d3oIDLQpo4I=
From: "Chen, Jiqian" <Jiqian.Chen@amd.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>, Jan Beulich
	<jbeulich@suse.com>
CC: "Huang, Ray" <Ray.Huang@amd.com>, Anthony PERARD
	<anthony.perard@citrix.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>, "Deucher, Alexander"
	<Alexander.Deucher@amd.com>, "Koenig, Christian" <Christian.Koenig@amd.com>,
	"Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>, Xenia Ragiadakou
	<burzalodowa@gmail.com>, "Huang, Honglei1" <Honglei1.Huang@amd.com>, "Zhang,
 Julia" <Julia.Zhang@amd.com>, "Chen, Jiqian" <Jiqian.Chen@amd.com>
Subject: Re: [RFC XEN PATCH 6/6] tools/libs/light: pci: translate irq to gsi
Thread-Topic: [RFC XEN PATCH 6/6] tools/libs/light: pci: translate irq to gsi
Thread-Index:
 AQHZVLgPekbKDe0PdE+qOexdbJYd7678Dv4AgACIawCAAIklgIAACP2AgAAEZYCAAOQ4gIAAnH0AgAAT6QCAAIzzgIAAGeoAgAASqACA1am6gA==
Date: Mon, 31 Jul 2023 16:40:35 +0000
Message-ID:
 <BL1PR12MB5849773109F9A9C6AE4D824EE705A@BL1PR12MB5849.namprd12.prod.outlook.com>
References: <20230312075455.450187-7-ray.huang@amd.com>
 <ZBHz7PpUbKM69Xxe@Air-de-Roger>
 <alpine.DEB.2.22.394.2303151729590.3462@ubuntu-linux-20-04-desktop>
 <e8843d7a-eecc-373c-a6b3-6a893bc0eb2a@suse.com>
 <ZBLg8WB8HCoZvwz5@Air-de-Roger>
 <df607690-0bfb-94a3-fac6-5e20f183dc20@suse.com>
 <alpine.DEB.2.22.394.2303161611220.3359@ubuntu-linux-20-04-desktop>
 <4edb59db-d2b8-122a-fc10-59001857bee0@suse.com>
 <ZBQ4DKJ8ZAroyPIQ@Air-de-Roger>
 <alpine.DEB.2.22.394.2303171115320.3359@ubuntu-linux-20-04-desktop>
 <ZBTEBkaI8q/mrJmv@Air-de-Roger>
 <alpine.DEB.2.22.394.2303171346410.3359@ubuntu-linux-20-04-desktop>
In-Reply-To:
 <alpine.DEB.2.22.394.2303171346410.3359@ubuntu-linux-20-04-desktop>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-imapappendstamp: BL1PR12MB5173.namprd12.prod.outlook.com
 (15.20.6631.013)
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BL1PR12MB5849:EE_|SJ0PR12MB6990:EE_
x-ms-office365-filtering-correlation-id: 73b92030-0488-41b7-19a8-08db91e4dd85
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info:
 hPIi6UGPf1GxkjXWhVM4Ju+NKe3PcSPyQyFWaNwqxvff9WArkPpxpNc06sBIpM8kgRhU5lqR5jjHfnd3duYOylbCG6Q3aMlk6I0MXAInFjhKmZ04peJg0UJYVcF8/WWIeyLhISmcrFNfeTR8wJ0CFASX/m8/1v7UcWChV2Xdn04zSrq7eCjPtWOaDybY51CwXDGK/GxCkQn0vht4gcS2z+EJZKhEXbyYW2aNwRSjzwvQyDxERYk/usfFhenIbL0RCfiXqPxwmzG2LlOTihmjgGoaa9MaPASoEZVnWadsvv8KDjVgBGRA5MZn9nZqaYn2eY4BYZgnvW9yS6Q6NRnVP0nBRTFgStH25QU3XOay8X5NPt+EMCpnGfmNZwJ8EsWpyXw5xdelzlRGtHkC9QgKWJ+bjYIdjUk4Ni9ph3w/RNCjoQ2zF9zfiJo61/5rNFyNnSiist2WQBz3LDcTlmJTDLYu0ZvnqTgPlu7Tcu4cgri1lXE73LZFz3p7ET/aP88ZctVJu4P0MEQL8S8IpSBdpEt5ZqUec+xFhhcPrnH8Gi+zyxiIQY8a4KnhuRSNm9RwfkGVgbWk8ALIuJnI6CdjghHHZw/SoF2A3+D6uJFlQscuRlWTuJiS2BgyECVQNbez
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(376002)(39860400002)(366004)(136003)(451199021)(41300700001)(66946007)(5660300002)(64756008)(76116006)(4326008)(66556008)(52536014)(66476007)(66446008)(38070700005)(54906003)(110136005)(30864003)(38100700002)(2906002)(33656002)(478600001)(8676002)(8936002)(316002)(122000001)(71200400001)(9686003)(26005)(7696005)(6506007)(53546011)(186003)(83380400001)(55016003)(559001)(579004);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?a0MxTk9wMjZtSEpTa0w1anFyczhuL1pCVm5tcTBBclI3bGZZRlgwZTRpcitN?=
 =?utf-8?B?WW9neTdkM2lSNTFtbjlnbzVqYnJRYmF4cGxBWE1NVklyZ09PWXNxOGR5bUhB?=
 =?utf-8?B?U3plMFdXUTRmYU5kREpSYXBlL0xONktvZWNhaFY5SkFtaXFTUEJxcXc5WE9p?=
 =?utf-8?B?YlRGOW0rK2ZCbVFaaVdsN2VzZkdvSVdFMXliQU40YSszVzd0YVR3dCtzTHl3?=
 =?utf-8?B?SkIwNHNrY01QMTZEdDZialBJM29FS3BESVEzcW8xenNKbGhMbTBDNjF5MzVY?=
 =?utf-8?B?UU5KSmNvVno0SlExK0NucmVKblJPQzNNcnp0Wm5VaUpEWVB0b0ZlaERpZDhj?=
 =?utf-8?B?U0xyMEx2L0lvL283a3FlVG5Eak50Snk3OVBBQW9taUgyOUJ0NmdXTHpJMEVu?=
 =?utf-8?B?bUI4elQvMTRiSisvdlZZcEowVExRcVllK3hqYkdoVW55bmFhdFRXMkNvWG5s?=
 =?utf-8?B?UnQwbGkyNFpwckpYMVZrZjV4b3ZjNVpZaXUzU1AvRnF1VWlzanBpdHpQK1Z6?=
 =?utf-8?B?TEFubVFVMEQyUHQxZ2l1UDBodzRkSnlsekxkNVBQelF6T1BYZERCMElMU1Ay?=
 =?utf-8?B?a0piVjJsbDZ4eURZWm1jaVNqaVRjZEJQQ2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R2FxWUtiSk5p?=
 =?utf-8?B?N2lBbjNTK1d5QjVuWWZxUGcyTjY4T2pqSWJ1ZndVbnVPUEhnUEdRSWJFVE9W?=
 =?utf-8?B?NlhWNjFoNEZ2cFBnTjRmUjNjTXl6Ynk0NTBzZHNCR1dod2JuUUpBRU9BRzY4?=
 =?utf-8?B?TFJyWUFNbmZONUNJSDB5OUpFYzcyZElGZ2RYUFhIVDErZ3p5WWlFdjJmM3Rx?=
 =?utf-8?B?cVdvVkdIWFpIZ2w1d2JBMlZFeXJhZFU4VElBK3lqZHRMNXB6a0ovOHdaeXI5?=
 =?utf-8?B?V2duTE0ydHNxOVR0MGZZcERDaUtJRjlEY1RTSmpTY1Rock9uQ3IvakhJOHdC?=
 =?utf-8?B?ZEFoWTRuN2pEQzk5bVVGaCswZmt0b0M1bXJYVjZSSFZhY2xJYStNNGE5aGlW?=
 =?utf-8?B?cVpaRy9zalN3UVZzWlZKN25XRmpadHMxOE5CUmVRekNRMkRIdUZYTmVWNjhx?=
 =?utf-8?B?U3NyR2Y1OUpNK1VJSUZ3NkQ1YWR0eUFuQkM2d1pSR2Z4MTlMR1lJNXpJVVVW?=
 =?utf-8?B?SmhPUzI5c3BtNlBNb3FWTXVJYlJpSitWVEV2YjhqZTIxaWdSeFpxbkRyNlFZ?=
 =?utf-8?B?QVBENWNpdmJhUDYzYWtpZU4rSUM3WnlUWVUvdklNOGw0bHkrLzUxTW9vK1pX?=
 =?utf-8?Q?08n8=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <6EB85DF91A1A2A4FAE365F758CC935EB@amdcloud.onmicrosoft.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5849.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 73b92030-0488-41b7-19a8-08db91e4dd85
X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jul 2023 16:40:35.7904
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: rUe3S+SNDMFiU801pgVBJGUteIApOQDT/hOg+JTW2bZodg+jZhpoqsHPjYFBc4uUZZz4GxBKnrGJ3Ot1kPX0vg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6990

SGksDQoNCk9uIDIwMjMvMy8xOCAwNDo1NSwgU3RlZmFubyBTdGFiZWxsaW5pIHdyb3RlOg0KPiBP
biBGcmksIDE3IE1hciAyMDIzLCBSb2dlciBQYXUgTW9ubsOpIHdyb3RlOg0KPj4gT24gRnJpLCBN
YXIgMTcsIDIwMjMgYXQgMTE6MTU6MzdBTSAtMDcwMCwgU3RlZmFubyBTdGFiZWxsaW5pIHdyb3Rl
Og0KPj4+IE9uIEZyaSwgMTcgTWFyIDIwMjMsIFJvZ2VyIFBhdSBNb25uw6kgd3JvdGU6DQo+Pj4+
IE9uIEZyaSwgTWFyIDE3LCAyMDIzIGF0IDA5OjM5OjUyQU0gKzAxMDAsIEphbiBCZXVsaWNoIHdy
b3RlOg0KPj4+Pj4gT24gMTcuMDMuMjAyMyAwMDoxOSwgU3RlZmFubyBTdGFiZWxsaW5pIHdyb3Rl
Og0KPj4+Pj4+IE9uIFRodSwgMTYgTWFyIDIwMjMsIEphbiBCZXVsaWNoIHdyb3RlOg0KPj4+Pj4+
PiBTbyB5ZXMsIGl0IHRoZW4gYWxsIGJvaWxzIGRvd24gdG8gdGhhdCBMaW51eC0NCj4+Pj4+Pj4g
aW50ZXJuYWwgcXVlc3Rpb24uDQo+Pj4+Pj4NCj4+Pj4+PiBFeGNlbGxlbnQgcXVlc3Rpb24gYnV0
IHdlJ2xsIGhhdmUgdG8gd2FpdCBmb3IgUmF5IGFzIGhlIGlzIH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@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 16:47:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573205.897697 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQW3W-0003gz-Tj; Mon, 31 Jul 2023 16:47:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573205.897697; Mon, 31 Jul 2023 16:47:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQW3W-0003gs-Qy; Mon, 31 Jul 2023 16:47:38 +0000
Received: by outflank-mailman (input) for mailman id 573205;
 Mon, 31 Jul 2023 16:47:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=z1vb=DR=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1qQW3V-0003gm-7w
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 16:47:37 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f24da96b-2fc1-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 18:47:35 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 36VGlC1P096718
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Mon, 31 Jul 2023 12:47:17 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.16.1/8.15.2/Submit) id 36VGlB0k096717;
 Mon, 31 Jul 2023 09:47:11 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f24da96b-2fc1-11ee-b255-6b7b168915f2
Date: Mon, 31 Jul 2023 09:47:11 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: Marek =?iso-8859-1?Q?Marczykowski-G=F3recki?= <marmarek@invisiblethingslab.com>
Cc: xen-devel@lists.xenproject.org, iwj@xenproject.org, wl@xen.org,
        Anthony PERARD <anthony.perard@citrix.com>,
        Juergen Gross <jgross@suse.com>
Subject: Re: Python in Domain Configurations
Message-ID: <ZMflj1F5qDydEgbd@mattapan.m5p.com>
References: <ZKiN80e08QIojRSL@mattapan.m5p.com>
 <ZL7e6IcJWK38IHU7@mattapan.m5p.com>
 <ZMcxvdSbpQdWg5/r@mail-itl>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <ZMcxvdSbpQdWg5/r@mail-itl>
X-Spam-Status: No, score=0.4 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com

On Mon, Jul 31, 2023 at 05:59:55AM +0200, Marek Marczykowski-Górecki wrote:
> On Mon, Jul 24, 2023 at 01:28:24PM -0700, Elliott Mitchell wrote:
> > On Fri, Jul 07, 2023 at 03:13:07PM -0700, Elliott Mitchell wrote:
> > > 
> > > The only context I could find was 54fbaf446b and
> > > https://wiki.xenproject.org/wiki/PythonInXlConfig which don't explain
> > > the reasoning.
> > > 
> > > Would the maintainers be amenable to revisiting the decision to remove
> > > support for full Python in domain configuration files?
> > 
> > Any chance of this getting a response?
> > 
> > On examination it appears domain configuration files are a proper subset
> > of Python.  The interface to the parser is a bit interesting, but it
> > looks fairly simple to replace the parser with libpython.
> > 
> > My goal is to create an init script for some automatically started
> > domains.  Issue is there can be ordering concerns with domain start/stop,
> > and this seems best handled by adding an extra setting to the
> > configuration files.  If full Python syntax is available, I can use that
> > for this extra data.

> I don't know full history here, but from my point of view, having a
> full-fledged script as a config file is undesirable for several reasons:
>  - it's easy to have unintended side effects of just loading a config
>    file
>  - loading config file can no longer be assumed to be "cheap"
>  - dynamic config file means you can no long rely on file timestamp/hash
>    to check if anything changed (I don't think it's an issue for the
>    current xl/libxl, but could be for some higher level tools)
>  - leads to issues with various sandboxes - for example SELinux policy
>    allowing scripted config file would be excessively permissive
> 
> So, IMHO reducing config file from a full python (like it used to be in
> xend times) into a static file with well defined syntax was an
> improvement. Lets not go backward.

I wouldn't really call the existing format "well defined".  While there
are patterns which are followed, some of those have rather a lot of
wiggle room.

I'm still looking, but I suspect libpython can be told to only accept
trivial operations (assignments to variables) and reject anything which
includes a jump or conditional.


> As for your original problem, IIUC you would like to add some data that
> would _not_ be interpreted by libxl, right? For that you can use
> comments with some specific marker for your script. This approach used
> to work well for SysV init script, and in fact for a very similar use case
> (ordering and dependencies, among other things).

That is /not/ the issue.  `xl` simply ignores any variables which it
doesn't interpret (this is in fact a Bad Thing).  I need to know what the
limits to the syntax are.

Notice how many init scripts do `. /etc/default/<somefile>` to load
configuration?  I'm thinking it would be very handy to use a similar
technique to load domain.cfg files, with Python being the interpreter.


I also think some portions of the domain.cfg format might work better
with full Python syntax.  For example might it be handier to allow:

disk = [
	{
		'vdev': 'xvda',
		'format': 'raw',
		'access': 'rw',
		'target': '/dev/disk/by-path/foo-bar-baz',
	},
]


It looks pretty feasible to replace the low-level parser with libpython.
Now to examining the "ast" module and finding out whether a file can be
loaded while rejecting conditionals.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:01:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:01:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573211.897721 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWGL-0006Fo-NP; Mon, 31 Jul 2023 17:00:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573211.897721; Mon, 31 Jul 2023 17:00:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWGL-0006Eu-G3; Mon, 31 Jul 2023 17:00:53 +0000
Received: by outflank-mailman (input) for mailman id 573211;
 Mon, 31 Jul 2023 17:00:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=hQw6=DR=xenbits.xen.org=andrewcoop@srs-se1.protection.inumbo.net>)
 id 1qQWGJ-00065P-TG
 for xen-devel@lists.xen.org; Mon, 31 Jul 2023 17:00:52 +0000
Received: from mail.xenproject.org (mail.xenproject.org [104.130.215.37])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c9733ee0-2fc3-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 19:00:47 +0200 (CEST)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1qQWG3-0005vO-U3; Mon, 31 Jul 2023 17:00:35 +0000
Received: from andrewcoop by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1qQWG3-0005s9-Ra; Mon, 31 Jul 2023 17:00:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c9733ee0-2fc3-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:CC:From:To:MIME-Version:
	Content-Transfer-Encoding:Content-Type;
	bh=lUWaPx255xgy/Wk7+s6PWswBPC1EbIoBEW6g8Jveb5c=; b=gyU/QaVmZAbH/53SqCq0/iRHaX
	/Zx6EICQKuxcZqJ2L26VrYR47Le54MUEXkm+2NZ+CjwK6klpW9sQW3cRgBF5Mvoa0A3xNNZmtc0Cw
	qQkPuVnJhSJzc44IS9zV6jbIN8IUAosvgiJqlBf681rRqIS0AZWZEWf0nFC936ld7nh0=;
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.509 (Entity 5.509)
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
 xen-users@lists.xen.org, oss-security@lists.openwall.com
From: Xen.org security team <security@xen.org>
CC: Xen.org security team <security-team-members@xen.org>
Subject: Xen Security Advisory 433 v3 (CVE-2023-20593) - x86/AMD: Zenbleed
Message-Id: <E1qQWG3-0005s9-Ra@xenbits.xenproject.org>
Date: Mon, 31 Jul 2023 17:00:35 +0000

--=separator
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

            Xen Security Advisory CVE-2023-20593 / XSA-433
                               version 3

                          x86/AMD: Zenbleed

UPDATES IN VERSION 3
====================

The patch provided with earlier versions was buggy.  It unintentionally
disable more bits than expected in the control register.  The contents of this
register is not generally known, so the effects on the system are unknown.

A patch correcting this error has been committed and backported to all stable
trees which got the XSA-433 fix originally.  Additionally, it is attached to
this advisory as xsa433-bugfix.patch, and applicable to all branches in this
form.

ISSUE DESCRIPTION
=================

Researchers at Google have discovered Zenbleed, a hardware bug causing
corruption of the vector registers.

When a VZEROUPPER instruction is discarded as part of a bad transient
execution path, its effect on internal tracking are not unwound
correctly.  This manifests as the wrong micro-architectural state
becoming architectural, and corrupting the vector registers.

Note: While this malfunction is related to speculative execution, this
      is not a speculative sidechannel vulnerability.

The corruption is not random.  It happens to be stale values from the
physical vector register file, a structure competitively shared between
sibling threads.  Therefore, an attacker can directly access data from
the sibling thread, or from a more privileged context.

For more details, see:
  https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7008.html
  https://github.com/google/security-research/security/advisories/GHSA-v6wh-rxpg-cmm8

IMPACT
======

With very low probability, corruption of the vector registers can occur.
This data corruption causes mis-calculations in subsequent logic.

An attacker can exploit this bug to read data from different contexts on
the same core.  Examples of such data includes key material, cypher and
plaintext from the AES-NI instructions, or the contents of REP-MOVS
instructions, commonly used to implement memcpy().

VULNERABLE SYSTEMS
==================

Systems running all versions of Xen are affected.

This bug is specific to the AMD Zen2 microarchitecture.  AMD do not
believe that other microarchitectures are affected.

MITIGATION
==========

This issue can be mitigated by disabling AVX, either by booting Xen with
`cpuid=no-avx` on the command line, or by specifying `cpuid="host:avx=0"` in
the vm.cfg file of all untrusted VMs.  However, this will come with a
significant impact on the system and is not recommended for anyone able to
deploy the microcode or patch described below.

RESOLUTION
==========

AMD are producing microcode updates to address the bug.  Consult your
dom0 OS vendor.  This microcode is effective when late-loaded, which can
be performed on a live system without reboot.

In cases where microcode is not available, the appropriate attached
patch updates Xen to use a control register to avoid the issue.

Note that patches for released versions are generally prepared to
apply to the stable branches, and may not apply cleanly to the most
recent release tarball.  Downstreams are encouraged to update to the
tip of the stable branch before applying these patches.

xsa433.patch           xen-unstable
xsa433-4.17.patch      Xen 4.17.x
xsa433-4.16.patch      Xen 4.16.x
xsa433-4.15.patch      Xen 4.15.x
xsa433-4.14.patch      Xen 4.14.x

xsa433-bugfix.patch    xen-unstable - Xen 4.14.x

$ sha256sum xsa433*
a9331733b63e3e566f1436a48e9bd9e8b86eb48da6a8ced72ff4affb7859e027  xsa433.patch
6f1db2a2078b0152631f819f8ddee21720dabe185ec49dc9806d4a9d3478adfd  xsa433-4.14.patch
ca3a92605195307ae9b6ff87240beb52a097c125a760c919d7b9a0aff6e557c0  xsa433-4.15.patch
e5e94b3de68842a1c8d222802fb204d64acd118e3293c8e909dfaf3ada23d912  xsa433-4.16.patch
41d12104869b7e8307cd93af1af12b4fd75a669aeff15d31b234dc72981ae407  xsa433-4.17.patch
b197e45aef1f47b6aebc005f876e3f593c2f32b9e5164a195f487cea6e174f75  xsa433-bugfix.patch
$

NOTE CONCERNING TIMELINE
========================

This issue is subject to coordinated disclosure on August 8th.  The
discoverer chose to publish details ahead of this timeline.
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmTH6HQMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZlIoH/jv0CJKyFgiaOLp4DFeLfzKLHJDbLKywj0bv4Q3V
wgrWVYwzVbpPwvuArS1dOujgEosTiUggKbzDPEpHa5reVKeeLwCBFxMrU+KYRf9h
6eglOJfiW73xxyggnvQLyh3tEGY0sQF0+OFQMsN5twiXsZS0pxLPomq0slun1VkV
8ZDl4FKjmEmAurE7fOtVdvzwZ6tKVLNaGYIm4wUwNZ0Cd4qo1GHIHsvUT9ZPFc82
jwMjCwk7Ca0Iv1GMyXESwOyR/0tLm07nT9isdkXcVFNgg8JL4f2CxGK9Vt97POEw
w9KVo3SoBf+/vY4Fk4HGSXieEofzVBDjO5NkPhESEC+3oMw=
=Z3fJ
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa433.patch"
Content-Disposition: attachment; filename="xsa433.patch"
Content-Transfer-Encoding: base64

RnJvbTogQW5kcmV3IENvb3BlciA8YW5kcmV3LmNvb3BlcjNAY2l0cml4LmNv
bT4KU3ViamVjdDogeDg2L2FtZDogTWl0aWdhdGlvbnMgZm9yIFplbmJsZWVk
CgpaZW5ibGVlZCBpcyBhIG1hbGZ1bmN0aW9uIG9uIEFNRCBaZW4yIHVhcmNo
IHBhcnRzIHdoaWNoIHJlc3VsdHMgaW4gY29ycnVwdGlvbgpvZiB0aGUgdmVj
dG9yIHJlZ2lzdGVycy4gIEFuIGF0dGFja2VyIGNhbiB0cmlnZ2VyIHRoaXMg
YnVnIGRlbGliZXJhdGVseSBpbgpvcmRlciB0byBhY2Nlc3Mgc3RhbGUgZGF0
YSBpbiB0aGUgcGh5c2ljYWwgdmVjdG9yIHJlZ2lzdGVyIGZpbGUuICBUaGlz
IGNhbgppbmNsdWRlIGRhdGEgZnJvbSBzaWJsaW5nIHRocmVhZHMsIG9yIGEg
aGlnaGVyLXByaXZpbGVnZSBjb250ZXh0LgoKTWljcm9jb2RlIGlzIHRoZSBw
cmVmZXJyZWQgbWl0aWdhdGlvbiBidXQgaW4gdGhlIGNhc2UgdGhhdCdzIG5v
dCBhdmFpbGFibGUgdXNlCnR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QuYwpAQCAtMjYyLDYg
KzI2Miw4IEBAIHN0YXRpYyBpbnQgY2ZfY2hlY2sgYXBwbHlfbWljcm9jb2Rl
KGNvbnN0IHN0cnVjdCBtaWNyb2NvZGVfcGF0Y2ggKnBhdGNoKQogICAgICAg
ICAgICAibWljcm9jb2RlOiBDUFUldSB1cGRhdGVkIGZyb20gcmV2aXNpb24g
JSN4IHRvICUjeCwgZGF0ZSA9ICUwNHgtJTAyeC0lMDJ4XG4iLAogICAgICAg
ICAgICBjcHUsIG9sZF9yZXYsIHJldiwgcGF0Y2gtPnllYXIsIHBhdGNoLT5t
b250aCwgcGF0Y2gtPmRheSk7CiAKKyAgICBhbWRfY2hlY2tfemVuYmxlZWQo
KTsKKwogICAgIHJldHVybiAwOwogfQogCmRpZmYgLS1naXQgYS94ZW4vYXJj
aC94ODYvaW5jbHVkZS9hc20vcHJvY2Vzc29yLmggYi94ZW4vYXJjaC94ODYv
aW5jbHVkZS9hc20vcHJvY2Vzc29yLmgKaW5kZXggM2IzY2Y1MTgxNGY4Li5j
MDUyOWNjM2Q5ODQgMTAwNjQ0Ci0tLSBhL3hlbi9hcmNoL3g4Ni9pbmNsdWRl
L2FzbS9wcm9jZXNzb3IuaAorKysgYi94ZW4vYXJjaC94ODYvaW5jbHVkZS9h
c20vcHJvY2Vzc29yLmgKQEAgLTU0Nyw2ICs1NDcsOCBAQCBlbnVtIGFwX2Jv
b3RfbWV0aG9kIHsKIH07CiBleHRlcm4gZW51bSBhcF9ib290X21ldGhvZCBh
cF9ib290X21ldGhvZDsKIAordm9pZCBhbWRfY2hlY2tfemVuYmxlZWQodm9p
ZCk7CisKICNlbmRpZiAvKiAhX19BU1NFTUJMWV9fICovCiAKICNlbmRpZiAv
KiBfX0FTTV9YODZfUFJPQ0VTU09SX0ggKi8KCg==

--=separator
Content-Type: application/octet-stream; name="xsa433-4.14.patch"
Content-Disposition: attachment; filename="xsa433-4.14.patch"
Content-Transfer-Encoding: base64

RnJvbTogQW5kcmV3I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ni9wcm9jZXNzb3IuaAppbmRleCAzZmY3Y2M1ODA3ZTcuLjcx
YjQ1NGQ5ODRhYyAxMDA2NDQKLS0tIGEveGVuL2luY2x1ZGUvYXNtLXg4Ni9w
cm9jZXNzb3IuaAorKysgYi94ZW4vaW5jbHVkZS9hc20teDg2L3Byb2Nlc3Nv
ci5oCkBAIC02MzUsNiArNjM1LDggQEAgdm9pZCB0c3hfaW5pdCh2b2lkKTsK
IHZvaWQgdXBkYXRlX21jdV9vcHRfY3RybCh2b2lkKTsKIHZvaWQgc2V0X2lu
X21jdV9vcHRfY3RybCh1aW50MzJfdCBtYXNrLCB1aW50MzJfdCB2YWwpOwog
Cit2b2lkIGFtZF9jaGVja196ZW5ibGVlZCh2b2lkKTsKKwogI2VuZGlmIC8q
ICFfX0FTU0VNQkxZX18gKi8KIAogI2VuZGlmIC8qIF9fQVNNX1g4Nl9QUk9D
RVNTT1JfSCAqLwoK

--=separator
Content-Type: application/octet-stream; name="xsa433-4.15.patch"
Content-Disposition: attachment; filename="xsa433-4.15.patch"
Content-Transfer-Encoding: base64

RnJvbTogQW5kcmV3IENvb3BlciA8YW5kcmV3LmNvb3BlcjNAY2l0cml4LmNv
bT4KU3ViamVjdDogeDg2L2FtZDogTWl0aWdhdGlvbnMgZm9yIFplbmJsZWVk
CgpaZW5ibGVlZCBpcyBhIG1hbGZ1bmN0aW9uIG9uIEFNRCBaZW4yIHVhcmNo
IHBhcnRzIHdoaWNoIHJlc3VsdHMgaW4gY29ycnVwdGlvbgpvZiB0aGUgdmVj
dG9yIHJlZ2lzdGVycy4gIEFuIGF0dGFja2VyIGNhbiB0cmlnZ2VyIHRoaXMg
YnVnIGRlbGliZXJhdGVseSBpbgpvcmRlciB0byBhY2Nlc3Mgc3RhbGUgZGF0
YSBpbiB0aGUgcGh5c2ljYWwgdmVjdG9yIHJlZ2lzdGVyIGZpbGUuICBUaGlz
IGNhbgppbmNsdWRlIGRhdGEgZnJvbSBzaWJsaW5nIHRocmVhZHMs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94ZW4vaW5jbHVkZS9hc20teDg2L3Byb2Nlc3Nvci5oIGIv
eGVuL2luY2x1ZGUvYXNtLXg4Ni9wcm9jZXNzb3IuaAppbmRleCAzZDhhYWNk
M2FhYjIuLjk2NjIxZWMzOWY4YiAxMDA2NDQKLS0tIGEveGVuL2luY2x1ZGUv
YXNtLXg4Ni9wcm9jZXNzb3IuaAorKysgYi94ZW4vaW5jbHVkZS9hc20teDg2
L3Byb2Nlc3Nvci5oCkBAIC02MzksNiArNjM5LDggQEAgZW51bSBhcF9ib290
X21ldGhvZCB7CiB9OwogZXh0ZXJuIGVudW0gYXBfYm9vdF9tZXRob2QgYXBf
Ym9vdF9tZXRob2Q7CiAKK3ZvaWQgYW1kX2NoZWNrX3plbmJsZWVkKHZvaWQp
OworCiAjZW5kaWYgLyogIV9fQVNTRU1CTFlfXyAqLwogCiAjZW5kaWYgLyog
X19BU01fWDg2X1BST0NFU1NPUl9IICovCgo=

--=separator
Content-Type: application/octet-stream; name="xsa433-4.17.patch"
Content-Disposition: attachment; filename="xsa433-4.17.patch"
Content-Transfer-Encoding: base64

RnJvbTogQW5kcmV3IENvb3BlciA8YW5kcmV3LmNvb3BlcjNAY2l0cml4LmNv
bT4KU3ViamVjdDogeDg2L2FtZDogTWl0aWdhdGlvbnMgZm9yIFplbmJsZWVk
CgpaZW5ibGVlZCBpcyBhIG1hbGZ1bmN0aW9uIG9uIEFNRCBaZW4yIHVhcmNo
IHBhcnRzIHdoaWNoIHJlc3VsdHMgaW4gY29ycnVwdGlvbgpvZiB0aGUgdmVj
dG9yIHJlZ2lzdGVycy4gIEFuIGF0dGFja2VyIGNhbiB0cmlnZ2VyIHRoaXMg
YnVnIGRlbGliZXJhdGVseSBpbgpvcmRlciB0byBhY2Nlc3Mgc3RhbGUgZGF0
YSBpbiB0aGUgcGh5c2ljYWwgdmVjdG9yIHJlZ2lzdGVyIGZpbGUuICBUaGlz
IGNhbgppbmNsdWRlIGRhdGEgZnJvbSBzaWJsaW5nIHR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ovCiAKICNlbmRpZiAv
KiBfX0FTTV9YODZfUFJPQ0VTU09SX0ggKi8KCg==

--=separator
Content-Type: application/octet-stream; name="xsa433-bugfix.patch"
Content-Disposition: attachment; filename="xsa433-bugfix.patch"
Content-Transfer-Encoding: base64

RnJvbTogQW5kcmV3IENvb3BlciA8YW5kcmV3LmNvb3BlcjNAY2l0cml4LmNv
bT4KU3ViamVjdDogeDg2L2FtZDogRml4IERFX0NGRyB0cnVuY2F0aW9uIGlu
IGFtZF9jaGVja196ZW5ibGVlZCgpCgpUaGlzIGxpbmU6CgoJdmFsICY9IH5j
aGlja2VuYml0OwoKZW5kcyB1cCB0cnVuY2F0aW5nIHZhbCB0byAzMiBiaXRz
LCBhbmQgdHVybmluZyBvZmYgdmFyaW91cyBlcnJhdGEgd29ya2Fyb3VuZHMK
aW4gWmVuMiBzeXN0ZW1zLgoKRml4ZXM6IGY5MWM1ZWE5NzA2NyAoIng4Ni9h
bWQ6IE1pdGlnYXRpb25zIGZvciBaZW5ibGVlZCIpClNpZ25lZC1vZmYtYnk6
IEFuZHJldyBDb29wZXIgPGFuZHJldy5jb29wZXIzQGNpdHJpeC5jb20+ClJl
dmlld2VkLWJ5OiBKYW4gQmV1bGljaCA8amJldWxpY2hAc3VzZS5jb20+Cgpk
aWZmIC0tZ2l0IGEveGVuL2FyY2gveDg2L2NwdS9hbWQuYyBiL3hlbi9hcmNo
L3g4Ni9jcHUvYW1kLmMKaW5kZXggM2VkMDZmNjcwNDkxLi5kZjI2ODFiN2M0
NTUgMTAwNjQ0Ci0tLSBhL3hlbi9hcmNoL3g4Ni9jcHUvYW1kLmMKKysrIGIv
eGVuL2FyY2gveDg2L2NwdS9hbWQuYwpAQCAtOTA5LDggKzkwOSw4IEBAIHZv
aWQgX19pbml0IGRldGVjdF96ZW4yX251bGxfc2VnX2JlaGF2aW91cih2b2lk
KQogdm9pZCBhbWRfY2hlY2tfemVuYmxlZWQodm9pZCkKIHsKIAljb25zdCBz
dHJ1Y3QgY3B1X3NpZ25hdHVyZSAqc2lnID0gJnRoaXNfY3B1KGNwdV9zaWcp
OwotCXVuc2lnbmVkIGludCBnb29kX3JldiwgY2hpY2tlbmJpdCA9ICgxIDw8
IDkpOwotCXVpbnQ2NF90IHZhbCwgb2xkX3ZhbDsKKwl1bnNpZ25lZCBpbnQg
Z29vZF9yZXY7CisJdWludDY0X3QgdmFsLCBvbGRfdmFsLCBjaGlja2VuYml0
ID0gKDEgPDwgOSk7CiAKIAkvKgogCSAqIElmIHdlJ3JlIHZpcnR1YWxpc2Vk
LCB3ZSBjYW4ndCBkbyBmYW1pbHkvbW9kZWwgY2hlY2tzIHNhZmVseSwgYW5k
Cg==

--=separator--


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:03:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:03:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573243.897772 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJ8-0000SH-9X; Mon, 31 Jul 2023 17:03:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573243.897772; Mon, 31 Jul 2023 17:03:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJ8-0000S6-6J; Mon, 31 Jul 2023 17:03:46 +0000
Received: by outflank-mailman (input) for mailman id 573243;
 Mon, 31 Jul 2023 17:03:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJ6-0000C0-M4
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:03:44 +0000
Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com
 [2607:f8b0:4864:20::229])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 33c9461c-2fc4-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 19:03:43 +0200 (CEST)
Received: by mail-oi1-x229.google.com with SMTP id
 5614622812f47-3a3df1ee4a3so2725200b6e.3
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:03:43 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.03.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:03:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 33c9461c-2fc4-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823022; x=1691427822;
        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=Z39OytypuZQhWkFCV+z6u8l5O5ZgTP/vsQXKA5JsO6g=;
        b=U7jETlvh8mqc3055+tBC6M+9Gy8R7REEMm1ZwKGc87m0rGDIJvgZcQ22vsmsinFtgt
         YTQlnuPzwi5zjdD+hLDWvxB/bmYZ8keXNmrVzrv6YRz6eCv0CI9nx19KksxH7KprzagR
         irj90f/wH/tTIxD8sQn1Ka9sOZ4dPOYQtK8h3N0b0riSaIJ2B+2YXCtlZtVEkrPg3Bbm
         Ojw5AwhfC3mD3DUjG5dFAv5YKIY2ngXsFAsSD6uydkdJ8uV+q2q9uUnnFZIrFIqfANGz
         oTPiE5dBvTDG/Pv3tzLP875t1DoqUqRhJ+2aPTfRbOK8xixubum5W0ZiIgU8cUKgztEJ
         6Kvw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823022; x=1691427822;
        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=Z39OytypuZQhWkFCV+z6u8l5O5ZgTP/vsQXKA5JsO6g=;
        b=M08wsSiA7S08haqwwjHugfPNS2TFfOfk5YHGsgLlrtpxM8y2kqj9v9DmUGnJtbQaqH
         tn+5c2Kk9BNyBXls9kBoZOGAcBJWyfOihpLONiXolzgM2n+2bvw7NdEPcji43cob3CDa
         3IHtCTaWwyps4wcbCoIf8fth1cyOphviU2qRi59z0PvpyDFDQv4U1JVffqOD1epchgIq
         3FVcCqDaSwHxrMLvN7aOY6cYcSJzamYH5V0v+kQWlJSO8tsT8wAZhGVsHrkKiDqTXiqM
         57kEyC003kZJQwweV5ddPY3ijdw0u7pIMPIgrN0Ho5+8g1sqGsKx9dVMVdV9qbB8vPxs
         gsvQ==
X-Gm-Message-State: ABy/qLauHg3qyVIDtbeb08/UsTEKkdisHB75U0hw7XuX6eB4mcyASUns
	RDZWhSK39Kk+k3G8ihFu/YA=
X-Google-Smtp-Source: APBJJlHO94ah80UzwDXxBX9kkXsVAL3mPuWGcSVwu/SHGxcgeWhtI+EazxMnc09xov2z5IkvLaxhhA==
X-Received: by 2002:a05:6808:13c1:b0:3a3:7612:28cd with SMTP id d1-20020a05680813c100b003a3761228cdmr11096736oiw.28.1690823021788;
        Mon, 31 Jul 2023 10:03:41 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 02/31] pgtable: Create struct ptdesc
Date: Mon, 31 Jul 2023 10:03:03 -0700
Message-Id: <20230731170332.69404-3-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Currently, page table information is stored within struct page. As part
of simplifying struct page, create struct ptdesc for page table
information.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/pgtable.h | 71 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
index 5f36c055794b..1f92514d54b0 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
@@ -993,6 +993,77 @@ static inline void ptep_modify_prot_commit(struct vm_area_struct *vma,
 #endif /* __HAVE_ARCH_PTEP_MODIFY_PROT_TRANSACTION */
 #endif /* CONFIG_MMU */
 
+
+/**
+ * struct ptdesc -    Memory descriptor for page tables.
+ * @__page_flags:     Same as page flags. Unused for page tables.
+ * @pt_rcu_head:      For freeing page table pages.
+ * @pt_list:          List of used page tables. Used for s390 and x86.
+ * @_pt_pad_1:        Padding that aliases with page's compound head.
+ * @pmd_huge_pte:     Protected by ptdesc->ptl, used for THPs.
+ * @__page_mapping:   Aliases with page->mapping. Unused for page tables.
+ * @pt_mm:            Used for x86 pgds.
+ * @pt_frag_refcount: For fragmented page table tracking. Powerpc and s390 only.
+ * @_pt_pad_2:        Padding to ensure proper alignment.
+ * @ptl:              Lock for the page table.
+ * @__page_type:      Same as page->page_type. Unused for page tables.
+ * @_refcount:        Same as page refcount. Used for s390 page tables.
+ * @pt_memcg_data:    Memcg data. Tracked for page tables here.
+ *
+ * This struct overlays struct page for now. Do not modify without a good
+ * understanding of the issues.
+ */
+struct ptdesc {
+	unsigned long __page_flags;
+
+	union {
+		struct rcu_head pt_rcu_head;
+		struct list_head pt_list;
+		struct {
+			unsigned long _pt_pad_1;
+			pgtable_t pmd_huge_pte;
+		};
+	};
+	unsigned long __page_mapping;
+
+	union {
+		struct mm_struct *pt_mm;
+		atomic_t pt_frag_refcount;
+	};
+
+	union {
+		unsigned long _pt_pad_2;
+#if ALLOC_SPLIT_PTLOCKS
+		spinlock_t *ptl;
+#else
+		spinlock_t ptl;
+#endif
+	};
+	unsigned int __page_type;
+	atomic_t _refcount;
+#ifdef CONFIG_MEMCG
+	unsigned long pt_memcg_data;
+#endif
+};
+
+#define TABLE_MATCH(pg, pt)						\
+	static_assert(offsetof(struct page, pg) == offsetof(struct ptdesc, pt))
+TABLE_MATCH(flags, __page_flags);
+TABLE_MATCH(compound_head, pt_list);
+TABLE_MATCH(compound_head, _pt_pad_1);
+TABLE_MATCH(pmd_huge_pte, pmd_huge_pte);
+TABLE_MATCH(mapping, __page_mapping);
+TABLE_MATCH(pt_mm, pt_mm);
+TABLE_MATCH(ptl, ptl);
+TABLE_MATCH(rcu_head, pt_rcu_head);
+TABLE_MATCH(page_type, __page_type);
+TABLE_MATCH(_refcount, _refcount);
+#ifdef CONFIG_MEMCG
+TABLE_MATCH(memcg_data, pt_memcg_data);
+#endif
+#undef TABLE_MATCH
+static_assert(sizeof(struct ptdesc) <= sizeof(struct page));
+
 /*
  * No-op macros that just return the current protection value. Defined here
  * because these macros can be used even if CONFIG_MMU is not defined.
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:03:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:03:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573245.897782 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJ9-0000iE-Hf; Mon, 31 Jul 2023 17:03:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573245.897782; Mon, 31 Jul 2023 17:03:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJ9-0000i7-DS; Mon, 31 Jul 2023 17:03:47 +0000
Received: by outflank-mailman (input) for mailman id 573245;
 Mon, 31 Jul 2023 17:03:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJ7-0000C0-To
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:03:45 +0000
Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com
 [2607:f8b0:4864:20::230])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3500f735-2fc4-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 19:03:45 +0200 (CEST)
Received: by mail-oi1-x230.google.com with SMTP id
 5614622812f47-3a412653352so3268561b6e.0
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:03:45 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.03.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:03:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3500f735-2fc4-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823024; x=1691427824;
        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=VFdcrIV5fIYEpRddOkWey4lp7uyipkLol3FVSysO4BI=;
        b=qbkWgPPid91ZIqftmFBBmjJpzv1I3nAFAPBn0iBZaDKWe1uvfhJ+1U6gJ1dsLe9k8G
         l7DrOCf7gRM2soqiMO44q+s7bgylkU1tiwFZ3vQhRvXR3+IrbpHWwADlXg073Kn29aGv
         6jR4zaER3rVUUYb82D2jgMMbIjrJfkA8xcbPoOTkfTIUXCyNCW6341Yv7mTjWmt8YXjX
         DVSekNPLiQ7ZuAQU0alRNEN5s2nYABPtXl7psWq2PhJX4A2iw0iBhsPbgh2IFaJwQPd6
         Ps6PTryX22bfzx7R3yw/niv4PjS3JpDK+9o8KFnsL0mYZ8+z5MK8XDbxFsJbw1tC6wxV
         bU+A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823024; x=1691427824;
        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=VFdcrIV5fIYEpRddOkWey4lp7uyipkLol3FVSysO4BI=;
        b=C/Q6hHV8YbbqISg0veF5XQXQRWX5kctCQy3wYPaURIc+/ctozD77/9sztBvVIEU8yE
         iXIUOYfknpaE3UK3urJSOj/rHX4nNPWsFk5IPvbkPcGIm2aNBcGvIR1cXxpUFUk3hxek
         uTb9HZmnbZpilYdhkDHjHdCyckzjFUDKHmw3ZHFw3gHZ9VnFnJdJJH3rP7CKYJwO9o88
         Uwlinjdg8L0G8QvFvz5imAtNWe7P9s5Tz+PQ7Vk/ThKNw7r9AXng3NnpVBQtLZaU14/K
         d0nUpqThbkY1A8nljDPIN+0uj3Qbd9ErVI2H6T3EeO3TNRzSz1CW6hxhUTXyhXMHheQ0
         3+nw==
X-Gm-Message-State: ABy/qLZyP+qJmhD0NdASLfe+SnUMQWvF4AECfINWPinMZPNkccvgHNyp
	hg5Y4GR/O8myA0c/t/WZiII=
X-Google-Smtp-Source: APBJJlEPdsci4ZilX3NjM/t6a027bxaAHpHiS1b7Xz7FAoJRqjVPugqaYGEb4Qj9r/gbUH4WVN8xpQ==
X-Received: by 2002:a54:4d8b:0:b0:3a6:f876:148d with SMTP id y11-20020a544d8b000000b003a6f876148dmr9790509oix.8.1690823023801;
        Mon, 31 Jul 2023 10:03:43 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>
Subject: [PATCH mm-unstable v8 03/31] mm: add utility functions for ptdesc
Date: Mon, 31 Jul 2023 10:03:04 -0700
Message-Id: <20230731170332.69404-4-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Introduce utility functions setting the foundation for ptdescs. These
will also assist in the splitting out of ptdesc from struct page.

Functions that focus on the descriptor are prefixed with ptdesc_* while
functions that focus on the pagetable are prefixed with pagetable_*.

pagetable_alloc() is defined to allocate new ptdesc pages as compound
pages. This is to standardize ptdescs by allowing for one allocation
and one free function, in contrast to 2 allocation and 2 free functions.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
---
 include/asm-generic/tlb.h | 11 +++++++
 include/linux/mm.h        | 61 +++++++++++++++++++++++++++++++++++++++
 include/linux/pgtable.h   | 12 ++++++++
 3 files changed, 84 insertions(+)

diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index bc32a2284c56..129a3a759976 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -480,6 +480,17 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
 	return tlb_remove_page_size(tlb, page, PAGE_SIZE);
 }
 
+static inline void tlb_remove_ptdesc(struct mmu_gather *tlb, void *pt)
+{
+	tlb_remove_table(tlb, pt);
+}
+
+/* Like tlb_remove_ptdesc, but for page-like page directories. */
+static inline void tlb_remove_page_ptdesc(struct mmu_gather *tlb, struct ptdesc *pt)
+{
+	tlb_remove_page(tlb, ptdesc_page(pt));
+}
+
 static inline void tlb_change_page_size(struct mmu_gather *tlb,
 						     unsigned int page_size)
 {
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 2ba73f09ae4a..3fda0ad41cf2 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2787,6 +2787,57 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a
 }
 #endif /* CONFIG_MMU */
 
+static inline struct ptdesc *virt_to_ptdesc(const void *x)
+{
+	return page_ptdesc(virt_to_page(x));
+}
+
+static inline void *ptdesc_to_virt(const struct ptdesc *pt)
+{
+	return page_to_virt(ptdesc_page(pt));
+}
+
+static inline void *ptdesc_address(const struct ptdesc *pt)
+{
+	return folio_address(ptdesc_folio(pt));
+}
+
+static inline bool pagetable_is_reserved(struct ptdesc *pt)
+{
+	return folio_test_reserved(ptdesc_folio(pt));
+}
+
+/**
+ * pagetable_alloc - Allocate pagetables
+ * @gfp:    GFP flags
+ * @order:  desired pagetable order
+ *
+ * pagetable_alloc allocates memory for page tables as well as a page table
+ * descriptor to describe that memory.
+ *
+ * Return: The ptdesc describing the allocated page tables.
+ */
+static inline struct ptdesc *pagetable_alloc(gfp_t gfp, unsigned int order)
+{
+	struct page *page = alloc_pages(gfp | __GFP_COMP, order);
+
+	return page_ptdesc(page);
+}
+
+/**
+ * pagetable_free - Free pagetables
+ * @pt:	The page table descriptor
+ *
+ * pagetable_free frees the memory of all page tables described by a page
+ * table descriptor and the memory for the descriptor itself.
+ */
+static inline void pagetable_free(struct ptdesc *pt)
+{
+	struct page *page = ptdesc_page(pt);
+
+	__free_pages(page, compound_order(page));
+}
+
 #if USE_SPLIT_PTE_PTLOCKS
 #if ALLOC_SPLIT_PTLOCKS
 void __init ptlock_cache_init(void);
@@ -2913,6 +2964,11 @@ static inline struct page *pmd_pgtable_page(pmd_t *pmd)
 	return virt_to_page((void *)((unsigned long) pmd & mask));
 }
 
+static inline struct ptdesc *pmd_ptdesc(pmd_t *pmd)
+{
+	return page_ptdesc(pmd_pgtable_page(pmd));
+}
+
 static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd)
 {
 	return ptlock_ptr(pmd_pgtable_page(pmd));
@@ -3025,6 +3081,11 @@ static inline void mark_page_reserved(struct page *page)
 	adjust_managed_page_count(page, -1);
 }
 
+static inline void free_reserved_ptdesc(struct ptdesc *pt)
+{
+	free_reserved_page(ptdesc_page(pt));
+}
+
 /*
  * Default method to free all the __init memory into the buddy system.
  * The freed pages will be poisoned with pattern "poison" if it's within
diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
index 1f92514d54b0..250fdeba68f3 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
@@ -1064,6 +1064,18 @@ TABLE_MATCH(memcg_data, pt_memcg_data);
 #undef TABLE_MATCH
 static_assert(sizeof(struct ptdesc) <= sizeof(struct page));
 
+#define ptdesc_page(pt)			(_Generic((pt),			\
+	const struct ptdesc *:		(const struct page *)(pt),	\
+	struct ptdesc *:		(struct page *)(pt)))
+
+#define ptdesc_folio(pt)		(_Generic((pt),			\
+	const struct ptdesc *:		(const struct folio *)(pt),	\
+	struct ptdesc *:		(struct folio *)(pt)))
+
+#define page_ptdesc(p)			(_Generic((p),			\
+	const struct page *:		(const struct ptdesc *)(p),	\
+	struct page *:			(struct ptdesc *)(p)))
+
 /*
  * No-op macros that just return the current protection value. Defined here
  * because these macros can be used even if CONFIG_MMU is not defined.
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:03:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:03:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573241.897753 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJ4-0008OS-SO; Mon, 31 Jul 2023 17:03:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573241.897753; Mon, 31 Jul 2023 17:03:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJ4-0008OH-MW; Mon, 31 Jul 2023 17:03:42 +0000
Received: by outflank-mailman (input) for mailman id 573241;
 Mon, 31 Jul 2023 17:03:41 +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
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJ3-0008Np-JC
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:03:41 +0000
Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com
 [2607:f8b0:4864:20::b2e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3168206f-2fc4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:03:39 +0200 (CEST)
Received: by mail-yb1-xb2e.google.com with SMTP id
 3f1490d57ef6-d167393b95aso8381213276.0
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:03:39 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.03.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:03:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3168206f-2fc4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823018; x=1691427818;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=ryTLkHDnIGhrwoqJrwF4w+CKAk7Or3iQY3ycYEnzI1s=;
        b=FItEz4g6fK8MUe9in0y5zvq54vvv6vRus4MvaXB5z0kFF5Wd4GxyLG45TIMFtswPBZ
         o5hWJRASIfXbLHcyuajDu2shNzEC3fqz1lq+2UGzWjNRBxNrOGPJc7+FeZHb270T76uP
         DVP8E3UCWoa73Cj1cemt4q3bHNezkBDrcXpoGHgWYyrjCA03wHK6cuEEIp3IlP9F3vH7
         B0WVEfhX/KMZdz2qP55P02W/l5cO6EeJ2/dVRRpuTUrHoGO/LbskVtPeDS55S32mzgKs
         4t8PJ/VzqvancbDUNXdKozgYa+ZBjOr6Csg18HLyiAYJhBTxnGsnAH6C4GyD3p+69e1s
         v6hw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823018; x=1691427818;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=ryTLkHDnIGhrwoqJrwF4w+CKAk7Or3iQY3ycYEnzI1s=;
        b=Z6oOrtxFmk3t+LaTpkV9z9ZkGvtgdt9lf2hrPbDQZfGXoV912M6UwHYCVFQna47iui
         74a43DfSLfR6q0pNqS4G4qzozDkal8qZNT62U4jgFqXm5H+7QtJHLyRBje8Kgme1Ts97
         uIyHxqK7MnjVVuT1gsO8eAdIWk8mnL5HhOde76qMHJnoRnFX+jx2tbb8bbiyvEH/f2A7
         mgWTKHG3MFDmoPi7WzuCYtcFUY6LRwM/55tVZT/GgSt2Dfi0thS5pVl4DZAK58mmSN2h
         A9qQv65kiOEzb8PEvBaMhuRnp342Dq5ZkvWdtjB0VTkIl5GEXtWx7DLlumFxVLerxFqG
         VWdQ==
X-Gm-Message-State: ABy/qLYLRRkGk5azL6EyBcjYN2Vp7fv8QTjG7rvvTZ3hhUq0qXeu59KI
	+AwTPljO9fye8Aj4OhxcfgoQAARK7vftEw==
X-Google-Smtp-Source: APBJJlF+dh42RzdYn0EXh+W1YGBDbhVTCkZUXnYcADIxILBW8gkVGvh5Vx2rhlYPGGopBifzCd0Ntg==
X-Received: by 2002:a25:d1d0:0:b0:d1c:5a9a:48d2 with SMTP id i199-20020a25d1d0000000b00d1c5a9a48d2mr11161535ybg.19.1690823017725;
        Mon, 31 Jul 2023 10:03:37 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Huacai Chen <chenhuacai@kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Dinh Nguyen <dinguyen@kernel.org>,
	Jonas Bonn <jonas@southpole.se>,
	David Hildenbrand <david@redhat.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	"David S. Miller" <davem@davemloft.net>,
	Richard Weinberger <richard@nod.at>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Christophe Leroy <christophe.leroy@csgroup.eu>
Subject: [PATCH mm-unstable v8 00/31] Split ptdesc from struct page
Date: Mon, 31 Jul 2023 10:03:01 -0700
Message-Id: <20230731170332.69404-1-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The MM subsystem is trying to shrink struct page. This patchset
introduces a memory descriptor for page table tracking - struct ptdesc.

This patchset introduces ptdesc, splits ptdesc from struct page, and
converts many callers of page table constructor/destructors to use ptdescs.

Ptdesc is a foundation to further standardize page tables, and eventually
allow for dynamic allocation of page tables independent of struct page.
However, the use of pages for page table tracking is quite deeply
ingrained and varied across archictectures, so there is still a lot of
work to be done before that can happen.

This is rebased on mm-unstable.

v8:
  Fix some compiler issues

v7:
  Drop s390 gmap ptdesc conversions - gmap is unecessary complication
    that can be dealt with later
  Be more thorough with ptdesc struct sanity checks and comments
  Rebase onto mm-unstable

Vishal Moola (Oracle) (31):
  mm: Add PAGE_TYPE_OP folio functions
  pgtable: Create struct ptdesc
  mm: add utility functions for ptdesc
  mm: Convert pmd_pgtable_page() callers to use pmd_ptdesc()
  mm: Convert ptlock_alloc() to use ptdescs
  mm: Convert ptlock_ptr() to use ptdescs
  mm: Convert pmd_ptlock_init() to use ptdescs
  mm: Convert ptlock_init() to use ptdescs
  mm: Convert pmd_ptlock_free() to use ptdescs
  mm: Convert ptlock_free() to use ptdescs
  mm: Create ptdesc equivalents for pgtable_{pte,pmd}_page_{ctor,dtor}
  powerpc: Convert various functions to use ptdescs
  x86: Convert various functions to use ptdescs
  s390: Convert various pgalloc functions to use ptdescs
  mm: Remove page table members from struct page
  pgalloc: Convert various functions to use ptdescs
  arm: Convert various functions to use ptdescs
  arm64: Convert various functions to use ptdescs
  csky: Convert __pte_free_tlb() to use ptdescs
  hexagon: Convert __pte_free_tlb() to use ptdescs
  loongarch: Convert various functions to use ptdescs
  m68k: Convert various functions to use ptdescs
  mips: Convert various functions to use ptdescs
  nios2: Convert __pte_free_tlb() to use ptdescs
  openrisc: Convert __pte_free_tlb() to use ptdescs
  riscv: Convert alloc_{pmd, pte}_late() to use ptdescs
  sh: Convert pte_free_tlb() to use ptdescs
  sparc64: Convert various functions to use ptdescs
  sparc: Convert pgtable_pte_page_{ctor, dtor}() to ptdesc equivalents
  um: Convert {pmd, pte}_free_tlb() to use ptdescs
  mm: Remove pgtable_{pmd, pte}_page_{ctor, dtor}() wrappers

 Documentation/mm/split_page_table_lock.rst    |  12 +-
 .../zh_CN/mm/split_page_table_lock.rst        |  14 +-
 arch/arm/include/asm/tlb.h                    |  12 +-
 arch/arm/mm/mmu.c                             |   7 +-
 arch/arm64/include/asm/tlb.h                  |  14 +-
 arch/arm64/mm/mmu.c                           |   7 +-
 arch/csky/include/asm/pgalloc.h               |   4 +-
 arch/hexagon/include/asm/pgalloc.h            |   8 +-
 arch/loongarch/include/asm/pgalloc.h          |  27 ++--
 arch/loongarch/mm/pgtable.c                   |   7 +-
 arch/m68k/include/asm/mcf_pgalloc.h           |  47 +++---
 arch/m68k/include/asm/sun3_pgalloc.h          |   8 +-
 arch/m68k/mm/motorola.c                       |   4 +-
 arch/mips/include/asm/pgalloc.h               |  32 ++--
 arch/mips/mm/pgtable.c                        |   8 +-
 arch/nios2/include/asm/pgalloc.h              |   8 +-
 arch/openrisc/include/asm/pgalloc.h           |   8 +-
 arch/powerpc/mm/book3s64/mmu_context.c        |  10 +-
 arch/powerpc/mm/book3s64/pgtable.c            |  32 ++--
 arch/powerpc/mm/pgtable-frag.c                |  58 +++----
 arch/riscv/include/asm/pgalloc.h              |   8 +-
 arch/riscv/mm/init.c                          |  16 +-
 arch/s390/include/asm/pgalloc.h               |   4 +-
 arch/s390/include/asm/tlb.h                   |   4 +-
 arch/s390/mm/pgalloc.c                        | 128 +++++++--------
 arch/sh/include/asm/pgalloc.h                 |   9 +-
 arch/sparc/mm/init_64.c                       |  17 +-
 arch/sparc/mm/srmmu.c                         |   5 +-
 arch/um/include/asm/pgalloc.h                 |  18 +--
 arch/x86/mm/pgtable.c                         |  47 +++---
 arch/x86/xen/mmu_pv.c                         |   2 +-
 include/asm-generic/pgalloc.h                 |  88 +++++-----
 include/asm-generic/tlb.h                     |  11 ++
 include/linux/mm.h                            | 151 +++++++++++++-----
 include/linux/mm_types.h                      |  18 ---
 include/linux/page-flags.h                    |  30 +++-
 include/linux/pgtable.h                       |  80 ++++++++++
 mm/memory.c                                   |   8 +-
 38 files changed, 586 insertions(+), 385 deletions(-)

-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:03:48 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:03:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573242.897762 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJ6-0000C8-16; Mon, 31 Jul 2023 17:03:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573242.897762; Mon, 31 Jul 2023 17:03:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJ5-0000C1-Uf; Mon, 31 Jul 2023 17:03:43 +0000
Received: by outflank-mailman (input) for mailman id 573242;
 Mon, 31 Jul 2023 17:03:42 +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
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJ4-0008Np-Lc
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:03:42 +0000
Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com
 [2607:f8b0:4864:20::b2c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3286406b-2fc4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:03:41 +0200 (CEST)
Received: by mail-yb1-xb2c.google.com with SMTP id
 3f1490d57ef6-cfcebc33d04so4865123276.2
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:03:40 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.03.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:03:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3286406b-2fc4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823020; x=1691427820;
        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=DXYENedStYVsFXpaqy8X3+wmlabVR1q8JHyD5+dxFj0=;
        b=R8qXZOyVQEehD2hSCsZpjQT5/Xf4F/brzByoll1mkB6kHNfXhJ+RcuKFwjYgA2X3Sk
         +7iApdQo4Cg5rRr+JdIoFqDPegtGDiAGRb35thEkDI1bUQUjq4aw+LSTgzrTpSIcmWfL
         bJsnhuf8GiZRZhIc6fFdHQySZ/IskewEUKqkNZ8aYCG1nKX4deKA2DfN9abSC9BVfmNb
         sjmF+khX55fBUw2Vqk+TxqOS6BA3VaGbAlziGVokfw/bjXQRn/YvIXdekpuhXXQ/VglV
         zbi9hIBXyZbJADitdtmejGR4UrX429LImbE9yX5FhLBTl4AmxfHwzr7gnLpRW2zU3ngh
         Rejg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823020; x=1691427820;
        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=DXYENedStYVsFXpaqy8X3+wmlabVR1q8JHyD5+dxFj0=;
        b=WHo67/QwhbKAPLhpNjiepdhL/hRohhn+xNAEKb8n+/3S1yrittZW353wfu23Cu59MK
         95FI/sxwCCl9rLFU4LRgvFd2UWis9WK1zPFlxXhV5iNaC6m4NEkFNZ8Mbpo0QbpR79Mp
         eMYH+o8lv/yAnm7mzG75NkigeWIILMsSQyr/I/WbpWQVZDRYzUSoFOca33aAh4YomY38
         YpcQzgz/SrJiq0gXoh6V7Unc/ijzmg6soxGHLBRtXEElIVaFdjLG8ZcktLd2qNY8F7O4
         gnC/4EgnjG44+CBK8q1bg4eo7BhOFiXXYRQtUkuGwutoYzTAjyEhKeuQxH/5LkPWjxvx
         nJpQ==
X-Gm-Message-State: ABy/qLYLANUimFuLlKoGMlSx2uerJpw5JA1wczxaBThVYmnwIYFQgNE5
	XAhOnTlAhU+z9wYYRqG4MOlOE/8jJv8tQQ==
X-Google-Smtp-Source: APBJJlG+a23ZkNAOXVkZypjt9XfAMSGYibV34A8tZ1fqqbfsROXiDspwRbZtJgVYmae4gyEjzVzU0Q==
X-Received: by 2002:a05:6902:18d6:b0:c15:c55d:c26e with SMTP id ck22-20020a05690218d600b00c15c55dc26emr12586459ybb.54.1690823019726;
        Mon, 31 Jul 2023 10:03:39 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 01/31] mm: Add PAGE_TYPE_OP folio functions
Date: Mon, 31 Jul 2023 10:03:02 -0700
Message-Id: <20230731170332.69404-2-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

No folio equivalents for page type operations have been defined, so
define them for later folio conversions.

Also changes the Page##uname macros to take in const struct page* since
we only read the memory here.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/page-flags.h | 30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 92a2063a0a23..9218028caf33 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -908,6 +908,8 @@ static inline bool is_page_hwpoison(struct page *page)
 
 #define PageType(page, flag)						\
 	((page->page_type & (PAGE_TYPE_BASE | flag)) == PAGE_TYPE_BASE)
+#define folio_test_type(folio, flag)					\
+	((folio->page.page_type & (PAGE_TYPE_BASE | flag)) == PAGE_TYPE_BASE)
 
 static inline int page_type_has_type(unsigned int page_type)
 {
@@ -919,27 +921,41 @@ static inline int page_has_type(struct page *page)
 	return page_type_has_type(page->page_type);
 }
 
-#define PAGE_TYPE_OPS(uname, lname)					\
-static __always_inline int Page##uname(struct page *page)		\
+#define PAGE_TYPE_OPS(uname, lname, fname)				\
+static __always_inline int Page##uname(const struct page *page)		\
 {									\
 	return PageType(page, PG_##lname);				\
 }									\
+static __always_inline int folio_test_##fname(const struct folio *folio)\
+{									\
+	return folio_test_type(folio, PG_##lname);			\
+}									\
 static __always_inline void __SetPage##uname(struct page *page)		\
 {									\
 	VM_BUG_ON_PAGE(!PageType(page, 0), page);			\
 	page->page_type &= ~PG_##lname;					\
 }									\
+static __always_inline void __folio_set_##fname(struct folio *folio)	\
+{									\
+	VM_BUG_ON_FOLIO(!folio_test_type(folio, 0), folio);		\
+	folio->page.page_type &= ~PG_##lname;				\
+}									\
 static __always_inline void __ClearPage##uname(struct page *page)	\
 {									\
 	VM_BUG_ON_PAGE(!Page##uname(page), page);			\
 	page->page_type |= PG_##lname;					\
-}
+}									\
+static __always_inline void __folio_clear_##fname(struct folio *folio)	\
+{									\
+	VM_BUG_ON_FOLIO(!folio_test_##fname(folio), folio);		\
+	folio->page.page_type |= PG_##lname;				\
+}									\
 
 /*
  * PageBuddy() indicates that the page is free and in the buddy system
  * (see mm/page_alloc.c).
  */
-PAGE_TYPE_OPS(Buddy, buddy)
+PAGE_TYPE_OPS(Buddy, buddy, buddy)
 
 /*
  * PageOffline() indicates that the page is logically offline although the
@@ -963,7 +979,7 @@ PAGE_TYPE_OPS(Buddy, buddy)
  * pages should check PageOffline() and synchronize with such drivers using
  * page_offline_freeze()/page_offline_thaw().
  */
-PAGE_TYPE_OPS(Offline, offline)
+PAGE_TYPE_OPS(Offline, offline, offline)
 
 extern void page_offline_freeze(void);
 extern void page_offline_thaw(void);
@@ -973,12 +989,12 @@ extern void page_offline_end(void);
 /*
  * Marks pages in use as page tables.
  */
-PAGE_TYPE_OPS(Table, table)
+PAGE_TYPE_OPS(Table, table, pgtable)
 
 /*
  * Marks guardpages used with debug_pagealloc.
  */
-PAGE_TYPE_OPS(Guard, guard)
+PAGE_TYPE_OPS(Guard, guard, guard)
 
 extern bool is_free_buddy_page(struct page *page);
 
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:03:49 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:03:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573246.897793 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJB-000104-3n; Mon, 31 Jul 2023 17:03:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573246.897793; Mon, 31 Jul 2023 17:03:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJA-0000zp-Uq; Mon, 31 Jul 2023 17:03:48 +0000
Received: by outflank-mailman (input) for mailman id 573246;
 Mon, 31 Jul 2023 17:03:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJ9-0000C0-KZ
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:03:47 +0000
Received: from mail-il1-x134.google.com (mail-il1-x134.google.com
 [2607:f8b0:4864:20::134])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3630ad8b-2fc4-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 19:03:47 +0200 (CEST)
Received: by mail-il1-x134.google.com with SMTP id
 e9e14a558f8ab-348dfefd1a4so25370755ab.1
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:03:47 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.03.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:03:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3630ad8b-2fc4-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823026; x=1691427826;
        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=IUMUqbW/uAIHfn0G4toP3JCuPKsaNgXF+JjYaBSaBaw=;
        b=LO7IgtMfV7D/5pieeNhzhX7jbefImFR1TuQgjSMNALZjO7jWhqLJ0NYlGohhp9vNEp
         P7qjRmM9tu3EiZV8IpnwyOsR5oR0G2xN8+6lkb99Xp3Pq2LKGQ1pnDBT3xTub9FDUFeD
         NiuludkMelWGqpPq5Si9scPBohunGQ7wjCbjn1MG6IHkoKqu0G6KIfhUmk1zbCODarzf
         JF+LluYmZmW6+nXXKHPD8kZWEQzzXdWA4gTgt31gpJPirIvHnT+QXlpNT9xuTR/Ob7I2
         6KYVvpK8cyw965ouTwB0qJzxRQ+l2kkvuwks4w7hfsZgPcLfFUXNyqFPQAdsNQn7UH4p
         LAXA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823026; x=1691427826;
        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=IUMUqbW/uAIHfn0G4toP3JCuPKsaNgXF+JjYaBSaBaw=;
        b=kcxfZSpmzpywcc33oScL4YfTfXzLAzFGGJbUwsLAnb2SwRY3z/827T5NJCXKewbK+N
         aJ7hpP36yO64Ph8d9LLv/SE7mq7eWjwJPvokfun/JFXGy3bvpl++IXeK4zANp6kQj7hv
         HJmWNNSYOhjM+2wMpw62IvpQVUgKfXbr3E0z5NemMrx0HItyZlGJFhvgLj9U4Rbif7BQ
         brQYHjexNm8bsNZyhxD7QSZT2CXZxAHSbSpWct9cCpGpwSrf0JXOkIeAhAjqr3+5GJds
         YATbzsxpmZqpYVgndbVghJH6InC9jNxZ3CvgjQ6i6C+eb2SG/+KbLZ2Ib3d5vzBSZli6
         8+PA==
X-Gm-Message-State: ABy/qLYdjiqu7GX10EjqmN47zZEy2fhCb0JjqAuvmqLSlV2Dn6rtxwPy
	rl6A7Zg+OLtyqoxZl/SDtd0=
X-Google-Smtp-Source: APBJJlEWqZXE1sICWadhT2wO43hXTa2FHUgzTzYXN3XbSpmzVLjVyMFNIil8bQaSo4X4bLn1gewpKQ==
X-Received: by 2002:a05:6e02:924:b0:349:2498:ed90 with SMTP id o4-20020a056e02092400b003492498ed90mr1956382ilt.30.1690823025849;
        Mon, 31 Jul 2023 10:03:45 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 04/31] mm: Convert pmd_pgtable_page() callers to use pmd_ptdesc()
Date: Mon, 31 Jul 2023 10:03:05 -0700
Message-Id: <20230731170332.69404-5-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Converts internal pmd_pgtable_page() callers to use pmd_ptdesc(). This
removes some direct accesses to struct page, working towards splitting
out struct ptdesc from struct page.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/mm.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 3fda0ad41cf2..bf552a106e4a 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2971,7 +2971,7 @@ static inline struct ptdesc *pmd_ptdesc(pmd_t *pmd)
 
 static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd)
 {
-	return ptlock_ptr(pmd_pgtable_page(pmd));
+	return ptlock_ptr(ptdesc_page(pmd_ptdesc(pmd)));
 }
 
 static inline bool pmd_ptlock_init(struct page *page)
@@ -2990,7 +2990,7 @@ static inline void pmd_ptlock_free(struct page *page)
 	ptlock_free(page);
 }
 
-#define pmd_huge_pte(mm, pmd) (pmd_pgtable_page(pmd)->pmd_huge_pte)
+#define pmd_huge_pte(mm, pmd) (pmd_ptdesc(pmd)->pmd_huge_pte)
 
 #else
 
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:03:51 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:03:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573247.897802 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJD-0001JE-AL; Mon, 31 Jul 2023 17:03:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573247.897802; Mon, 31 Jul 2023 17:03:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJD-0001Ix-6q; Mon, 31 Jul 2023 17:03:51 +0000
Received: by outflank-mailman (input) for mailman id 573247;
 Mon, 31 Jul 2023 17:03:50 +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
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJC-0008Np-KH
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:03:50 +0000
Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com
 [2607:f8b0:4864:20::b32])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3745d37b-2fc4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:03:48 +0200 (CEST)
Received: by mail-yb1-xb32.google.com with SMTP id
 3f1490d57ef6-d35e565071aso479681276.2
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:03:48 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.03.45
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:03:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3745d37b-2fc4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823028; x=1691427828;
        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=hLtCJBysrabsGyMeKlbK2lKTjEzHhmjaMpElw0hOQuQ=;
        b=XxfUVCtc+QbMuKLsIQZYFotQjD1uPn39bJPNzHnLSpRxaT3fJeSLcUYSJwnJQ3Db/g
         leWI/21K6KvWZhIzEH7DHukGj5D7XdCtwzeO763ZUH4LeT7PuPE1GzPcQcYVnv/vf13j
         n79Pu8SKl7LjDKW1vidx9U3g5HX3hsbCLIInKKKoydsrph/bfVYnRh1jLyq8obFjpp4I
         8/fNfhvrK0O+QQmUluanQgTc5DFDNrxKYjhdFJW8WfDVLkfAQZABhu93QV+IfN33Z8yL
         iOGQEq8tdk7NtoCkxwkrl9w2lNi5iRHnhmaZ+oTac0bEezCH6FvgLddmkBsJ59So10Oj
         RPOg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823028; x=1691427828;
        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=hLtCJBysrabsGyMeKlbK2lKTjEzHhmjaMpElw0hOQuQ=;
        b=hEVS5xdm3B9B8jN9aTztGwQ5Z4jGukOr7t4mA3iQRtOwkb0/UyoI+eyyJtuQWVdRSb
         s4bNu4fc99B46fFqwJRHT4s8htEWZch8Qc9d6kdg55nEOMTzGHf1GqCEaJB1W4CFhHRn
         xteW8FJrX7I3nj6PlUmYp1ZSoyVoV/eUuxeR+BUP6WMikqnYqazguWm17aYqBY2DXtiK
         7G8EKCiL8rgt6/H3JE5feDIi4Oo2oMVJKm0DjkdOTi1Tkt4KFyr5lwLyZylhdnp2u/Xz
         WxXhT7ckROG+TUn+I4dmSnXvcdWUZSe/KcI+if/GTM2MxyPC15bqacwjfVvvRoZu007q
         paqg==
X-Gm-Message-State: ABy/qLYYXej8wi14omGsVVEON1G9djloXEmy3drDigb2fWgRNASRVnX6
	BKoS8PouhRQlSB5OlJcIqCo=
X-Google-Smtp-Source: APBJJlGaLQRI5Q0HqdaC/SmgbvgNuoyQchTQtq0hJYQ2S7wch31RC4bpLlQZjYY1DDyT4+2cD/rUkg==
X-Received: by 2002:a25:9bc8:0:b0:c91:cc0e:1aef with SMTP id w8-20020a259bc8000000b00c91cc0e1aefmr8613166ybo.58.1690823027825;
        Mon, 31 Jul 2023 10:03:47 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 05/31] mm: Convert ptlock_alloc() to use ptdescs
Date: Mon, 31 Jul 2023 10:03:06 -0700
Message-Id: <20230731170332.69404-6-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This removes some direct accesses to struct page, working towards
splitting out struct ptdesc from struct page.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/mm.h | 6 +++---
 mm/memory.c        | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index bf552a106e4a..b3fce0bfe201 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2841,7 +2841,7 @@ static inline void pagetable_free(struct ptdesc *pt)
 #if USE_SPLIT_PTE_PTLOCKS
 #if ALLOC_SPLIT_PTLOCKS
 void __init ptlock_cache_init(void);
-extern bool ptlock_alloc(struct page *page);
+bool ptlock_alloc(struct ptdesc *ptdesc);
 extern void ptlock_free(struct page *page);
 
 static inline spinlock_t *ptlock_ptr(struct page *page)
@@ -2853,7 +2853,7 @@ static inline void ptlock_cache_init(void)
 {
 }
 
-static inline bool ptlock_alloc(struct page *page)
+static inline bool ptlock_alloc(struct ptdesc *ptdesc)
 {
 	return true;
 }
@@ -2883,7 +2883,7 @@ static inline bool ptlock_init(struct page *page)
 	 * slab code uses page->slab_cache, which share storage with page->ptl.
 	 */
 	VM_BUG_ON_PAGE(*(unsigned long *)&page->ptl, page);
-	if (!ptlock_alloc(page))
+	if (!ptlock_alloc(page_ptdesc(page)))
 		return false;
 	spin_lock_init(ptlock_ptr(page));
 	return true;
diff --git a/mm/memory.c b/mm/memory.c
index 2130bad76eb1..4fee273595e2 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -6231,14 +6231,14 @@ void __init ptlock_cache_init(void)
 			SLAB_PANIC, NULL);
 }
 
-bool ptlock_alloc(struct page *page)
+bool ptlock_alloc(struct ptdesc *ptdesc)
 {
 	spinlock_t *ptl;
 
 	ptl = kmem_cache_alloc(page_ptl_cachep, GFP_KERNEL);
 	if (!ptl)
 		return false;
-	page->ptl = ptl;
+	ptdesc->ptl = ptl;
 	return true;
 }
 
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:03:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:03:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573248.897812 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJG-0001fU-JR; Mon, 31 Jul 2023 17:03:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573248.897812; Mon, 31 Jul 2023 17:03:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJG-0001fF-Fi; Mon, 31 Jul 2023 17:03:54 +0000
Received: by outflank-mailman (input) for mailman id 573248;
 Mon, 31 Jul 2023 17:03:52 +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
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJE-0008Np-Nw
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:03:52 +0000
Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com
 [2607:f8b0:4864:20::b2e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 38943d5d-2fc4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:03:51 +0200 (CEST)
Received: by mail-yb1-xb2e.google.com with SMTP id
 3f1490d57ef6-d35a9d7a5bdso498167276.0
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:03:51 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.03.47
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:03:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 38943d5d-2fc4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823030; x=1691427830;
        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=uNVCmnQN0ufsotHop6mLPsVoSXSsgvYy2QMaIqEOqi4=;
        b=HGhOeQ1TmAKeV2HnCN1WTfuLUUGtIM4rPFVA9FLFfXc9y1teMeCMXYfLrn52VreEZa
         +8fuD8Eo9GHKIiGXji1nVJr6hJp1UgozAoPycNtpjPeWKRtcHWia112SYBPlfjErevM1
         f1KBsm+b9biDP/8hsnmQLIxx1WqbIsap7/B5vxAAg5UayZGm1/xCMe4ANNoVXkXqO5f9
         zYPLJX2R/yJdpXd33yeHG335BLgfWD5asDdFJsvc7qa94OZvu247hqr11p/tySJkF1N3
         XZqqjnjnJwS4MTyfAeLK5z9Se8l+uTUdMKVbakuD0ppwzC8LFvwdJ3Q2bHVnQ+Hr6zUD
         fqZg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823030; x=1691427830;
        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=uNVCmnQN0ufsotHop6mLPsVoSXSsgvYy2QMaIqEOqi4=;
        b=UxXY3ySpG9wtbaf1zNUePtrMqYoJt/xeH2kB67+/qajo8P91vFxsY2h9v4Is55S55C
         YiEABUYSC6V7QX/GJRbO9aXxBw01VKC3wdHCaR4o0l6oXrQm59BoBPx3JD9ifdBRG4sb
         hsVwmrXKeIbpyP1iIwL9r2OdMmy58x5qZLXOslaFbSFO4xKKXYUtFwAKNUc4HGUIHY36
         Xy2Oa/Zr2TQeJcdPsDPxIX4TjdpJNKdtuZ8d1ObxI/Kv+4q2yC3Q/nRq9W+DmVJjqzuH
         MFjueV1HmDZpMxJt6kTd4ItLuLB/Zi2thycj1FPcsjQh7VW23cIcoouJV1MHJrc9fMy0
         mVbg==
X-Gm-Message-State: ABy/qLZvZ9wGzBgPI8kW94wCsdKP4l2LjIYCpylq19/k7i0sqiHTJhNS
	gXQiFetSbq2q98lOTVtvT8A=
X-Google-Smtp-Source: APBJJlEF5eMDgJhVfaLglGwfP9JkFsRVPWZwav0NLe508KhOsIkmqr6LHjKMWH59Isg1gKZnQYYAJw==
X-Received: by 2002:a25:ae5c:0:b0:c73:9f38:2b3a with SMTP id g28-20020a25ae5c000000b00c739f382b3amr9095220ybe.48.1690823029862;
        Mon, 31 Jul 2023 10:03:49 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 06/31] mm: Convert ptlock_ptr() to use ptdescs
Date: Mon, 31 Jul 2023 10:03:07 -0700
Message-Id: <20230731170332.69404-7-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This removes some direct accesses to struct page, working towards
splitting out struct ptdesc from struct page.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/x86/xen/mmu_pv.c |  2 +-
 include/linux/mm.h    | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c
index e0a975165de7..8796ec310483 100644
--- a/arch/x86/xen/mmu_pv.c
+++ b/arch/x86/xen/mmu_pv.c
@@ -667,7 +667,7 @@ static spinlock_t *xen_pte_lock(struct page *page, struct mm_struct *mm)
 	spinlock_t *ptl = NULL;
 
 #if USE_SPLIT_PTE_PTLOCKS
-	ptl = ptlock_ptr(page);
+	ptl = ptlock_ptr(page_ptdesc(page));
 	spin_lock_nest_lock(ptl, &mm->page_table_lock);
 #endif
 
diff --git a/include/linux/mm.h b/include/linux/mm.h
index b3fce0bfe201..c155f82dd2cc 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2844,9 +2844,9 @@ void __init ptlock_cache_init(void);
 bool ptlock_alloc(struct ptdesc *ptdesc);
 extern void ptlock_free(struct page *page);
 
-static inline spinlock_t *ptlock_ptr(struct page *page)
+static inline spinlock_t *ptlock_ptr(struct ptdesc *ptdesc)
 {
-	return page->ptl;
+	return ptdesc->ptl;
 }
 #else /* ALLOC_SPLIT_PTLOCKS */
 static inline void ptlock_cache_init(void)
@@ -2862,15 +2862,15 @@ static inline void ptlock_free(struct page *page)
 {
 }
 
-static inline spinlock_t *ptlock_ptr(struct page *page)
+static inline spinlock_t *ptlock_ptr(struct ptdesc *ptdesc)
 {
-	return &page->ptl;
+	return &ptdesc->ptl;
 }
 #endif /* ALLOC_SPLIT_PTLOCKS */
 
 static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
 {
-	return ptlock_ptr(pmd_page(*pmd));
+	return ptlock_ptr(page_ptdesc(pmd_page(*pmd)));
 }
 
 static inline bool ptlock_init(struct page *page)
@@ -2885,7 +2885,7 @@ static inline bool ptlock_init(struct page *page)
 	VM_BUG_ON_PAGE(*(unsigned long *)&page->ptl, page);
 	if (!ptlock_alloc(page_ptdesc(page)))
 		return false;
-	spin_lock_init(ptlock_ptr(page));
+	spin_lock_init(ptlock_ptr(page_ptdesc(page)));
 	return true;
 }
 
@@ -2971,7 +2971,7 @@ static inline struct ptdesc *pmd_ptdesc(pmd_t *pmd)
 
 static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd)
 {
-	return ptlock_ptr(ptdesc_page(pmd_ptdesc(pmd)));
+	return ptlock_ptr(pmd_ptdesc(pmd));
 }
 
 static inline bool pmd_ptlock_init(struct page *page)
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:03:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:03:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573249.897822 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJJ-00020c-0S; Mon, 31 Jul 2023 17:03:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573249.897822; Mon, 31 Jul 2023 17:03:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJI-00020K-Q8; Mon, 31 Jul 2023 17:03:56 +0000
Received: by outflank-mailman (input) for mailman id 573249;
 Mon, 31 Jul 2023 17:03:54 +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
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJG-0008Np-M0
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:03:54 +0000
Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com
 [2607:f8b0:4864:20::b29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 39b452a4-2fc4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:03:53 +0200 (CEST)
Received: by mail-yb1-xb29.google.com with SMTP id
 3f1490d57ef6-d0b597e7ac1so5043183276.1
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:03:53 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.03.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:03:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 39b452a4-2fc4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823032; x=1691427832;
        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=d0E0BACLvXh2vpBt6imfUOZqEuzu1odD4oW+AaIJCus=;
        b=YUReldkgnetLqvGL1NS71WdWnAzNWWYQnltnVm2rTkEUcOO9WrPWjz/VupfwLsV4R5
         O5U+HAQBX2TEiL7rUmM64hTiM4qIIq6sg/drG9M/BGuBJ33Wydz1s/G+0U+eMZJumoRB
         f1161HPnuyBRb78dTfpgaCSHu9Qo0gegUmxh0kC4FT9lRFkm1YwjVBx9HbpfTIAYT8q1
         zvd8Be582ZnNdhPs3i3IT6jC/uh09at7IMfH8Z/47sZBuFG6ajCrrTeAaD1eGKL98sQ4
         Picd2DUZ0mNQhUFLQyvKhXnHde4rCRB/z+5yBj02B6B5K38q9rbIBp+H/OlzOyaGOHuW
         1Lvg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823032; x=1691427832;
        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=d0E0BACLvXh2vpBt6imfUOZqEuzu1odD4oW+AaIJCus=;
        b=ZKZu1BimGRfOFSN8yDljczrZ3PJINvjlXBoGecfyGtUDi8c+gV9cIP0+FiE7Y8Z4t9
         pxwlv3eHIEYMRkkS2GPjzzPvwNt4WaQNheIXHLFHGvgi7XBW4DeiMD8tkqXpPcWGdJON
         UnjE1zfp9N2WuTpzW+ATFqA7jn+Q8oz4CjhEk88IhPcF7WJHqTBR5jwVlmBGvC+KY4HD
         dnxkrmC2JSc7BzE70tK/rIPQASSjM+A/rWa63W9U/WY3L+brX4FhXCwYVsz3SHrN7QLs
         V79RpEPaRzhsgZaHBnqWIydzuF7UBoCt4QjicOFnCCEcF7J5BsVkvqrAuqB7JhyozCcN
         bJDQ==
X-Gm-Message-State: ABy/qLaIWfSUOLtFQ5alAvqL1aaZW6NWgQ538iGbvXnot0qtWrC+FlLt
	ubcaFowcJvaOYqz8LZu6zGY=
X-Google-Smtp-Source: APBJJlHh2ZxIPqvNCWcG3uzKtYIqmu+SYBCgcUqQThaKL5dLb97zd0arq7kj2mXQ9GbTc2zqN8ZRqQ==
X-Received: by 2002:a25:84:0:b0:c67:5adb:36fc with SMTP id 126-20020a250084000000b00c675adb36fcmr11678833yba.38.1690823031787;
        Mon, 31 Jul 2023 10:03:51 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 07/31] mm: Convert pmd_ptlock_init() to use ptdescs
Date: Mon, 31 Jul 2023 10:03:08 -0700
Message-Id: <20230731170332.69404-8-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This removes some direct accesses to struct page, working towards
splitting out struct ptdesc from struct page.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/mm.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index c155f82dd2cc..52ef09c100a2 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2974,12 +2974,12 @@ static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd)
 	return ptlock_ptr(pmd_ptdesc(pmd));
 }
 
-static inline bool pmd_ptlock_init(struct page *page)
+static inline bool pmd_ptlock_init(struct ptdesc *ptdesc)
 {
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
-	page->pmd_huge_pte = NULL;
+	ptdesc->pmd_huge_pte = NULL;
 #endif
-	return ptlock_init(page);
+	return ptlock_init(ptdesc_page(ptdesc));
 }
 
 static inline void pmd_ptlock_free(struct page *page)
@@ -2999,7 +2999,7 @@ static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd)
 	return &mm->page_table_lock;
 }
 
-static inline bool pmd_ptlock_init(struct page *page) { return true; }
+static inline bool pmd_ptlock_init(struct ptdesc *ptdesc) { return true; }
 static inline void pmd_ptlock_free(struct page *page) {}
 
 #define pmd_huge_pte(mm, pmd) ((mm)->pmd_huge_pte)
@@ -3015,7 +3015,7 @@ static inline spinlock_t *pmd_lock(struct mm_struct *mm, pmd_t *pmd)
 
 static inline bool pgtable_pmd_page_ctor(struct page *page)
 {
-	if (!pmd_ptlock_init(page))
+	if (!pmd_ptlock_init(page_ptdesc(page)))
 		return false;
 	__SetPageTable(page);
 	inc_lruvec_page_state(page, NR_PAGETABLE);
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:03:57 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:03:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573250.897826 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJJ-00025M-Fe; Mon, 31 Jul 2023 17:03:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573250.897826; Mon, 31 Jul 2023 17:03:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJJ-00023k-81; Mon, 31 Jul 2023 17:03:57 +0000
Received: by outflank-mailman (input) for mailman id 573250;
 Mon, 31 Jul 2023 17:03:56 +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
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJI-0008Np-O8
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:03:56 +0000
Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com
 [2607:f8b0:4864:20::b35])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3aedcbda-2fc4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:03:55 +0200 (CEST)
Received: by mail-yb1-xb35.google.com with SMTP id
 3f1490d57ef6-bff89873d34so3787006276.2
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:03:55 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.03.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:03:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3aedcbda-2fc4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823034; x=1691427834;
        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=iy/rMhqpUcv/05FOZn+4srvOxwPFLEA5us+pK4Rb6lw=;
        b=V/96hykns8XVM5vLmRXG/u4xSypUgGiGwrOyC+rZQj+rcZ/GpgCOArv+BLqwnK6ndI
         s6FLSAxMDlFyUBDNQE2VhRek5g328y+/ccd+AsCeEjwXU0hVeTp7lQbn+jR0/Talq7yP
         X53eA6P253fr2h0Co5LkgUqrydVRI6I/ApD8z89cYAQIEmQbjgDCE+0t6nBNrgVReKu1
         hKceHGETSaBcw+wqVyp5iupRKeJkqfupmvumPfxkbIwnP/D5j0bL4ZMnmoLVvjw3thur
         HGuYrC1zSSdz4NYzQoV0QVVrCZG7E5Ll8cUs/PSqUH3UyhbWaZjmYOzvlOZrxF4wqCJv
         qIEg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823034; x=1691427834;
        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=iy/rMhqpUcv/05FOZn+4srvOxwPFLEA5us+pK4Rb6lw=;
        b=RDSlCyyQbuUtUK4/53UgdMvIscu+BDdikFA0IRFtdumVOpT+Xrhx+tAs4d1sgteiVp
         79Z+xLS2dMRL1Z862SXYiafldMJdSWs+EpUcEM/R6kPUak5PhNN/H8Su25wOvSMOvPhB
         PgofpEkurQfMK9XaSmn/tIph+TTG8eOxw8nWh5KihrS6OMc7qgz/VKrMHcFtmLlhMQW9
         38ieiQYefFcbB3SaFniuBYHmHmR3urithhJ1uNaSjF9Y3tKLfskjnU4hRkdWQsKIuxDl
         GFbt06q70WUw6oUgrtyXY1mFUxvj5U4SuP5drnaZFeF3IBIkLOpj2dT+8WQSQzXeurpv
         gRcA==
X-Gm-Message-State: ABy/qLauqFfTHS7nhJDzOukAplftyTuqlPIv1ECramVqBlTfquZ8Kgzy
	9TENioBy+m1yRgtnrskE9Go=
X-Google-Smtp-Source: APBJJlFl3cMRdcyGTSqylTcgbFymQPUIeV+vjMCwSs3kC0GtKDKYI1e8i0USnYA5QForqJcTrXzM0w==
X-Received: by 2002:a25:908d:0:b0:c67:5aea:97ba with SMTP id t13-20020a25908d000000b00c675aea97bamr7117064ybl.50.1690823033777;
        Mon, 31 Jul 2023 10:03:53 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 08/31] mm: Convert ptlock_init() to use ptdescs
Date: Mon, 31 Jul 2023 10:03:09 -0700
Message-Id: <20230731170332.69404-9-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This removes some direct accesses to struct page, working towards
splitting out struct ptdesc from struct page.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/mm.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 52ef09c100a2..675972d3f7e4 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2873,7 +2873,7 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
 	return ptlock_ptr(page_ptdesc(pmd_page(*pmd)));
 }
 
-static inline bool ptlock_init(struct page *page)
+static inline bool ptlock_init(struct ptdesc *ptdesc)
 {
 	/*
 	 * prep_new_page() initialize page->private (and therefore page->ptl)
@@ -2882,10 +2882,10 @@ static inline bool ptlock_init(struct page *page)
 	 * It can happen if arch try to use slab for page table allocation:
 	 * slab code uses page->slab_cache, which share storage with page->ptl.
 	 */
-	VM_BUG_ON_PAGE(*(unsigned long *)&page->ptl, page);
-	if (!ptlock_alloc(page_ptdesc(page)))
+	VM_BUG_ON_PAGE(*(unsigned long *)&ptdesc->ptl, ptdesc_page(ptdesc));
+	if (!ptlock_alloc(ptdesc))
 		return false;
-	spin_lock_init(ptlock_ptr(page_ptdesc(page)));
+	spin_lock_init(ptlock_ptr(ptdesc));
 	return true;
 }
 
@@ -2898,13 +2898,13 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
 	return &mm->page_table_lock;
 }
 static inline void ptlock_cache_init(void) {}
-static inline bool ptlock_init(struct page *page) { return true; }
+static inline bool ptlock_init(struct ptdesc *ptdesc) { return true; }
 static inline void ptlock_free(struct page *page) {}
 #endif /* USE_SPLIT_PTE_PTLOCKS */
 
 static inline bool pgtable_pte_page_ctor(struct page *page)
 {
-	if (!ptlock_init(page))
+	if (!ptlock_init(page_ptdesc(page)))
 		return false;
 	__SetPageTable(page);
 	inc_lruvec_page_state(page, NR_PAGETABLE);
@@ -2979,7 +2979,7 @@ static inline bool pmd_ptlock_init(struct ptdesc *ptdesc)
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
 	ptdesc->pmd_huge_pte = NULL;
 #endif
-	return ptlock_init(ptdesc_page(ptdesc));
+	return ptlock_init(ptdesc);
 }
 
 static inline void pmd_ptlock_free(struct page *page)
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:04:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:04:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573251.897842 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJM-0002ii-42; Mon, 31 Jul 2023 17:04:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573251.897842; Mon, 31 Jul 2023 17:04:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJL-0002iM-Vb; Mon, 31 Jul 2023 17:03:59 +0000
Received: by outflank-mailman (input) for mailman id 573251;
 Mon, 31 Jul 2023 17:03: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
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJK-0008Np-J1
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:03:58 +0000
Received: from mail-il1-x135.google.com (mail-il1-x135.google.com
 [2607:f8b0:4864:20::135])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3c0013e8-2fc4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:03:56 +0200 (CEST)
Received: by mail-il1-x135.google.com with SMTP id
 e9e14a558f8ab-3491516c4aeso4949435ab.1
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:03:56 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.03.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:03:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3c0013e8-2fc4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823036; x=1691427836;
        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=iZ7ozcISUSGoixC5UzzNE5tJz0+L18C1Imj6XmV/DYM=;
        b=YpVyYPxPRtPTKHT9+tyvzqfvzCuhkFnhsMCX6nJF7RWviYaDE6pxTcvqFICRytHQ3F
         mk3OEWmycmo6ouKKcTZJZ/J9GI0O0U+IOIhkq6cf5NcWzs3F3Ep7I9wPm/bnxo3IbGbP
         5A5D1El9yg833uJSmp138hZ30DYMCVkIUWUYXAVHfkbTx4hT6PxevukL8QnCpSiv14Rw
         Ab1JsXOoVAvxWjOf0Fsk8pxufrrxg62ZUs/sWVYn8yXcxdG4Ij3aN3bFcjr1GQQkDcpq
         XCDoC5WGNDUaZUPNMTX8kXKJ799hVc0z6s0hq6YfOkQjqMhJ1aFCFD+uKI8XA047G16z
         xszQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823036; x=1691427836;
        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=iZ7ozcISUSGoixC5UzzNE5tJz0+L18C1Imj6XmV/DYM=;
        b=V68o7YjGjwIYiWKiDDxh9cvgYpS26U6YaSrASsKtZEYx2JnwoK/plrCJ5lsVXXwN4M
         rF2+gssXpAXpqVktwuJmv8wYYpUs0KlzlrkbFI/s69tsHnj29gsjru44aYnbIql4RJLj
         /Dn2IBczhCoKUi4gJUkmcubenxtrMhCeUdoRx/HA0hHKkEBWXzvMKGlNKEFz4JlOmvMh
         gmMWEm7BWdp7uN9gjVLI+84YYTfJtcn2coyWSvRDesjvT0fAJtP0eNoa9rSedbrR5+HR
         tGc7tg0WQa2T5rzqGFH/p7haxKbY2CEbX/ilu94KzOWQoQGH0gO8qkSQ/NAJefWanLhg
         cKUA==
X-Gm-Message-State: ABy/qLbpwMVU+ABE8E7KsoBsZIojx06vKQlINxNmXjDA5Ng59elK3WSK
	7qAUMXRXCzndP+6YPA00i5I=
X-Google-Smtp-Source: APBJJlHoVkOsri9H/NdsUsto2q+Ey0kzzV9aD886+MBagBeourqVjWpbCtZ0aJitRhXpadhn4PaeZQ==
X-Received: by 2002:a05:6e02:1c26:b0:348:b910:313d with SMTP id m6-20020a056e021c2600b00348b910313dmr9675086ilh.14.1690823035707;
        Mon, 31 Jul 2023 10:03:55 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 09/31] mm: Convert pmd_ptlock_free() to use ptdescs
Date: Mon, 31 Jul 2023 10:03:10 -0700
Message-Id: <20230731170332.69404-10-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This removes some direct accesses to struct page, working towards
splitting out struct ptdesc from struct page.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/mm.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 675972d3f7e4..774fe83c0c16 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2982,12 +2982,12 @@ static inline bool pmd_ptlock_init(struct ptdesc *ptdesc)
 	return ptlock_init(ptdesc);
 }
 
-static inline void pmd_ptlock_free(struct page *page)
+static inline void pmd_ptlock_free(struct ptdesc *ptdesc)
 {
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
-	VM_BUG_ON_PAGE(page->pmd_huge_pte, page);
+	VM_BUG_ON_PAGE(ptdesc->pmd_huge_pte, ptdesc_page(ptdesc));
 #endif
-	ptlock_free(page);
+	ptlock_free(ptdesc_page(ptdesc));
 }
 
 #define pmd_huge_pte(mm, pmd) (pmd_ptdesc(pmd)->pmd_huge_pte)
@@ -3000,7 +3000,7 @@ static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd)
 }
 
 static inline bool pmd_ptlock_init(struct ptdesc *ptdesc) { return true; }
-static inline void pmd_ptlock_free(struct page *page) {}
+static inline void pmd_ptlock_free(struct ptdesc *ptdesc) {}
 
 #define pmd_huge_pte(mm, pmd) ((mm)->pmd_huge_pte)
 
@@ -3024,7 +3024,7 @@ static inline bool pgtable_pmd_page_ctor(struct page *page)
 
 static inline void pgtable_pmd_page_dtor(struct page *page)
 {
-	pmd_ptlock_free(page);
+	pmd_ptlock_free(page_ptdesc(page));
 	__ClearPageTable(page);
 	dec_lruvec_page_state(page, NR_PAGETABLE);
 }
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:04:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:04:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573252.897847 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJM-0002nl-OY; Mon, 31 Jul 2023 17:04:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573252.897847; Mon, 31 Jul 2023 17:04:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJM-0002mk-Dp; Mon, 31 Jul 2023 17:04:00 +0000
Received: by outflank-mailman (input) for mailman id 573252;
 Mon, 31 Jul 2023 17:03:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJL-0000C0-F7
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:03:59 +0000
Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com
 [2607:f8b0:4864:20::b2b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3d4726d8-2fc4-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 19:03:58 +0200 (CEST)
Received: by mail-yb1-xb2b.google.com with SMTP id
 3f1490d57ef6-d0b597e7ac1so5043261276.1
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:03:58 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.03.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:03:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3d4726d8-2fc4-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823038; x=1691427838;
        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=7EZnRhm4Fj3KaK4sFjI+P1mIVDNOtVXSgVauozi7/LE=;
        b=TvM6DExj/MTq0Jm70GY7llkizJv0Xrt3jOhv1061u2jelnUc+8n8NrIEW+BAV0minS
         1tyB2hh96LoZso6xWTQsTKE9iOzQkPYOcn2oO7CJPClzabUQT8JEbqLe1hGOluEbesF4
         LKkTfn07m+I0Vuueep3IFUQUJltM6JJHBDBn8n653IK02ME5fuHReejoNwtCex5xQyzn
         Y1wOj8DVfr6r9eQ6TYR15inSR6hHDxry08oKRDaKIhjxxmp2hbT5OuHr1D1+R6xelNHE
         JPdzrcJvaKmiiybVsDU25/RyZDaqIgMV6uxOUr6sp0q3qR3F0X4P6bOEInakDYMw/wf5
         mu/w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823038; x=1691427838;
        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=7EZnRhm4Fj3KaK4sFjI+P1mIVDNOtVXSgVauozi7/LE=;
        b=DnajlA1l/0sqI9CJP+euXKtSaT2yEKWWnnsJbqZZMr18rB88IHQd1Ts9jx6jGVfxsB
         UuMVGiIt4etnd+KqmUKwidKsAvrz1NErO5qUbsCqsmLyTV284OxXAm8rwBci5uibg2DI
         OZRwTLTK0rGqbeK//YyHCIuZQDS01AU9LozQoqVhiStYuF0cxolBChAsbWYliT+eCqI3
         eITHpUl2gefReY81C3Zurx4xTLg4snbgje2FNwGl1rHiK1BMcrv1R2aFKhYrJy1oPEwB
         g/FDSk308fd3amKe72ANe1wcIGay3V5S+Gcle+wTekJgQkc9c7jkjELThlHzADTgw8lk
         zZXA==
X-Gm-Message-State: ABy/qLbDcprlUV1LVHfpTinIcVEJwsvyZykEgUwmTlwCk+4Mqz1QMjCa
	7lnSIgmvSruTqZX8hAQ36YM=
X-Google-Smtp-Source: APBJJlH90WRLRIm5YDV2YMBRfelNi7WH7+bbsrmY7NpvynPWnsTYJfLOq9UWydp0DqF9z3jWR7ijAw==
X-Received: by 2002:a25:e08b:0:b0:d18:e435:bdc0 with SMTP id x133-20020a25e08b000000b00d18e435bdc0mr11858543ybg.57.1690823037763;
        Mon, 31 Jul 2023 10:03:57 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 10/31] mm: Convert ptlock_free() to use ptdescs
Date: Mon, 31 Jul 2023 10:03:11 -0700
Message-Id: <20230731170332.69404-11-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This removes some direct accesses to struct page, working towards
splitting out struct ptdesc from struct page.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/mm.h | 10 +++++-----
 mm/memory.c        |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 774fe83c0c16..ffddae95af78 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2842,7 +2842,7 @@ static inline void pagetable_free(struct ptdesc *pt)
 #if ALLOC_SPLIT_PTLOCKS
 void __init ptlock_cache_init(void);
 bool ptlock_alloc(struct ptdesc *ptdesc);
-extern void ptlock_free(struct page *page);
+void ptlock_free(struct ptdesc *ptdesc);
 
 static inline spinlock_t *ptlock_ptr(struct ptdesc *ptdesc)
 {
@@ -2858,7 +2858,7 @@ static inline bool ptlock_alloc(struct ptdesc *ptdesc)
 	return true;
 }
 
-static inline void ptlock_free(struct page *page)
+static inline void ptlock_free(struct ptdesc *ptdesc)
 {
 }
 
@@ -2899,7 +2899,7 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
 }
 static inline void ptlock_cache_init(void) {}
 static inline bool ptlock_init(struct ptdesc *ptdesc) { return true; }
-static inline void ptlock_free(struct page *page) {}
+static inline void ptlock_free(struct ptdesc *ptdesc) {}
 #endif /* USE_SPLIT_PTE_PTLOCKS */
 
 static inline bool pgtable_pte_page_ctor(struct page *page)
@@ -2913,7 +2913,7 @@ static inline bool pgtable_pte_page_ctor(struct page *page)
 
 static inline void pgtable_pte_page_dtor(struct page *page)
 {
-	ptlock_free(page);
+	ptlock_free(page_ptdesc(page));
 	__ClearPageTable(page);
 	dec_lruvec_page_state(page, NR_PAGETABLE);
 }
@@ -2987,7 +2987,7 @@ static inline void pmd_ptlock_free(struct ptdesc *ptdesc)
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
 	VM_BUG_ON_PAGE(ptdesc->pmd_huge_pte, ptdesc_page(ptdesc));
 #endif
-	ptlock_free(ptdesc_page(ptdesc));
+	ptlock_free(ptdesc);
 }
 
 #define pmd_huge_pte(mm, pmd) (pmd_ptdesc(pmd)->pmd_huge_pte)
diff --git a/mm/memory.c b/mm/memory.c
index 4fee273595e2..e5e370cdac23 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -6242,8 +6242,8 @@ bool ptlock_alloc(struct ptdesc *ptdesc)
 	return true;
 }
 
-void ptlock_free(struct page *page)
+void ptlock_free(struct ptdesc *ptdesc)
 {
-	kmem_cache_free(page_ptl_cachep, page->ptl);
+	kmem_cache_free(page_ptl_cachep, ptdesc->ptl);
 }
 #endif
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:04:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:04:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573255.897862 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJQ-0003ct-3z; Mon, 31 Jul 2023 17:04:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573255.897862; Mon, 31 Jul 2023 17:04:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJP-0003bc-UA; Mon, 31 Jul 2023 17:04:03 +0000
Received: by outflank-mailman (input) for mailman id 573255;
 Mon, 31 Jul 2023 17:04:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJO-0000C0-Rx
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:02 +0000
Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com
 [2607:f8b0:4864:20::112e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3e8b2538-2fc4-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 19:04:01 +0200 (CEST)
Received: by mail-yw1-x112e.google.com with SMTP id
 00721157ae682-5860c7fc2fcso17243107b3.2
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:01 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.03.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:03:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3e8b2538-2fc4-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823040; x=1691427840;
        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=GM8s3dDlKIn9bcZ3Rv1fAyQJ11tvy15JiujAITQGQIU=;
        b=WsnCjEuFun6IuHpPh6Ck/rBg4AZLbVHEs2jk+7TEc5kPbUlyDbLU82vMQ8hYNiUbEV
         KmukkQXHlnalx2MRwxX9OA1ED5qQ+cRzMsv/rlYCU41nnUNJeib6/uXFu8sMt236/2Ud
         yhZAMNcebKfkSv6mc59ZybiKh0RsfAPQpPnm2pft2DHqmzXA9/C0fNB/u3wlBocoiSJC
         LtpkvTvVemtPOevOsyRiBPGxBKIgXaumZpQx0YFqajcNPkaTnpsizZKv1A3XIPWZnK5y
         p/CzUaAjAQ1JZb9e9DygJrxewNU/aZAjuX8qYUs6cV2yG2QRoeh00nb4O3A983HwtiRJ
         fbTg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823040; x=1691427840;
        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=GM8s3dDlKIn9bcZ3Rv1fAyQJ11tvy15JiujAITQGQIU=;
        b=RtDmsjOVDmhYZTPoWrf7PX3ETJldj4iG+t7WNnCVf+HEtD/P1CsYWqOa+tgaZjd4kX
         ew8iE9yWVvY0SbJYQsv6MoawJPfHeJ0QphD4tuPmiLiXS8wYUbLq19eHWR862plqTmfS
         OMZYu0vRRQvVwb3uN+iA9FtA1VRsGne9nRTtX8EGwAk6aXATgFMC/PN3raAGwOAJp8Jn
         4ybGXuefKRkvP27ucC5w0mztXb5jjocsLvqA++sMj48cUJq5kbw0z/VIbEBeRTKWW+wK
         vfxgbV/g9wYtAICz8/lw8axIjbOiaI0ItKV/AOVzpt60hJbcN+ocr4xe1lRI44ML2Mt2
         MCbQ==
X-Gm-Message-State: ABy/qLbfs+4QVbT5C7SfJ3HyGAig5Td7cm5TNh8VbYE1KW4ZtBJHLY2q
	w1paVfYFK+Rc2nZYLZg0abg=
X-Google-Smtp-Source: APBJJlHch/jSJCdVVtDWb1WClZ5gGKwbX6GY1zRRfwmE6xAtgRg67mCRvfprsxzmmxwehzomhr3VNg==
X-Received: by 2002:a25:c7d1:0:b0:d08:20f1:f7cd with SMTP id w200-20020a25c7d1000000b00d0820f1f7cdmr8274869ybe.16.1690823039767;
        Mon, 31 Jul 2023 10:03:59 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 11/31] mm: Create ptdesc equivalents for pgtable_{pte,pmd}_page_{ctor,dtor}
Date: Mon, 31 Jul 2023 10:03:12 -0700
Message-Id: <20230731170332.69404-12-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Create pagetable_pte_ctor(), pagetable_pmd_ctor(), pagetable_pte_dtor(),
and pagetable_pmd_dtor() and make the original pgtable
constructor/destructors wrappers.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/mm.h | 56 ++++++++++++++++++++++++++++++++++------------
 1 file changed, 42 insertions(+), 14 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index ffddae95af78..bd3d99d81984 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2902,20 +2902,34 @@ static inline bool ptlock_init(struct ptdesc *ptdesc) { return true; }
 static inline void ptlock_free(struct ptdesc *ptdesc) {}
 #endif /* USE_SPLIT_PTE_PTLOCKS */
 
-static inline bool pgtable_pte_page_ctor(struct page *page)
+static inline bool pagetable_pte_ctor(struct ptdesc *ptdesc)
 {
-	if (!ptlock_init(page_ptdesc(page)))
+	struct folio *folio = ptdesc_folio(ptdesc);
+
+	if (!ptlock_init(ptdesc))
 		return false;
-	__SetPageTable(page);
-	inc_lruvec_page_state(page, NR_PAGETABLE);
+	__folio_set_pgtable(folio);
+	lruvec_stat_add_folio(folio, NR_PAGETABLE);
 	return true;
 }
 
+static inline bool pgtable_pte_page_ctor(struct page *page)
+{
+	return pagetable_pte_ctor(page_ptdesc(page));
+}
+
+static inline void pagetable_pte_dtor(struct ptdesc *ptdesc)
+{
+	struct folio *folio = ptdesc_folio(ptdesc);
+
+	ptlock_free(ptdesc);
+	__folio_clear_pgtable(folio);
+	lruvec_stat_sub_folio(folio, NR_PAGETABLE);
+}
+
 static inline void pgtable_pte_page_dtor(struct page *page)
 {
-	ptlock_free(page_ptdesc(page));
-	__ClearPageTable(page);
-	dec_lruvec_page_state(page, NR_PAGETABLE);
+	pagetable_pte_dtor(page_ptdesc(page));
 }
 
 pte_t *__pte_offset_map(pmd_t *pmd, unsigned long addr, pmd_t *pmdvalp);
@@ -3013,20 +3027,34 @@ static inline spinlock_t *pmd_lock(struct mm_struct *mm, pmd_t *pmd)
 	return ptl;
 }
 
-static inline bool pgtable_pmd_page_ctor(struct page *page)
+static inline bool pagetable_pmd_ctor(struct ptdesc *ptdesc)
 {
-	if (!pmd_ptlock_init(page_ptdesc(page)))
+	struct folio *folio = ptdesc_folio(ptdesc);
+
+	if (!pmd_ptlock_init(ptdesc))
 		return false;
-	__SetPageTable(page);
-	inc_lruvec_page_state(page, NR_PAGETABLE);
+	__folio_set_pgtable(folio);
+	lruvec_stat_add_folio(folio, NR_PAGETABLE);
 	return true;
 }
 
+static inline bool pgtable_pmd_page_ctor(struct page *page)
+{
+	return pagetable_pmd_ctor(page_ptdesc(page));
+}
+
+static inline void pagetable_pmd_dtor(struct ptdesc *ptdesc)
+{
+	struct folio *folio = ptdesc_folio(ptdesc);
+
+	pmd_ptlock_free(ptdesc);
+	__folio_clear_pgtable(folio);
+	lruvec_stat_sub_folio(folio, NR_PAGETABLE);
+}
+
 static inline void pgtable_pmd_page_dtor(struct page *page)
 {
-	pmd_ptlock_free(page_ptdesc(page));
-	__ClearPageTable(page);
-	dec_lruvec_page_state(page, NR_PAGETABLE);
+	pagetable_pmd_dtor(page_ptdesc(page));
 }
 
 /*
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:04:07 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:04:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573258.897872 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJT-0004Nh-H2; Mon, 31 Jul 2023 17:04:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573258.897872; Mon, 31 Jul 2023 17:04:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJT-0004MU-AR; Mon, 31 Jul 2023 17:04:07 +0000
Received: by outflank-mailman (input) for mailman id 573258;
 Mon, 31 Jul 2023 17:04:05 +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
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJR-0008Np-3M
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:05 +0000
Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com
 [2607:f8b0:4864:20::230])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3fa51fde-2fc4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:04:03 +0200 (CEST)
Received: by mail-oi1-x230.google.com with SMTP id
 5614622812f47-3a3efebcc24so3601212b6e.1
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:03 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.03.59
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3fa51fde-2fc4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823042; x=1691427842;
        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=9sW6ZvuXfbFTHYep83+z5KceXKUDE808r1Cv8/pw/I4=;
        b=b+RH2hQLs0PrVwmTtZEtfUeHXjshu4ts0OsC/tTRMBNL2mI6FVIeJ+HO2sJc9CHbAN
         CYuYEUlC05IcPjkCqLxNke2EK1ijZ05jv63DReY0r2tPeNGvUBJekr+gcoNL1dz8PJ26
         /cA4AkNpz6v8HN3tbVp4xFy5RCmhWYIIra7v2cEeHbXn3sfQnBhgAc2yuX2m6lE/+9mA
         9y/jmAUWLmB4o1mWve3z/4oUJYIlqq3nVkrOrqW86WuABmDsL4jvWbVffSny/K6W7B5Z
         rXA6KtaxPm6aezMEUN+nLjZwW5J7C1GsPuTnmHV2MzYNOQ2wNdnkfwDaXHstMJLOGYKi
         Q3BA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823042; x=1691427842;
        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=9sW6ZvuXfbFTHYep83+z5KceXKUDE808r1Cv8/pw/I4=;
        b=EyXjQU5Q4HMknx+0JFVE9SPrxd7a5p0p4vNXcJ180OgDcUbDKlC/34FlN1JGo0UDRt
         GN/ifDF462nVvzY0Dy/IcUZ2nBFrA7D2rO/+PBLQ1hXNowB7GwfHD2zDKkE56A/8lDtJ
         TKlUtvD0cA2kD4u1QSpo2S86BqUEwG5dwhVqpmFK/agSDBxusA0Yarv0GjfJ/yIzwG9R
         Pul3Bw1Xsnd3K04fOl86jGsMkaTSYl/kSrnpWxuKfEN+jfN3IoLquyQxPZZJQ35lwNCU
         OQicoaaXBANJfsLi95ea6GXW2jkg/iu+bwrF3nw6Tgw9yBZTzoVS2bafHjkKPWo4Ae5+
         Ifkw==
X-Gm-Message-State: ABy/qLYsoU97gq6Ch3guA28ZWvF1UHg/TF0P2z3tvGjqeoAU0DTdZa49
	inkyXVgq8LmQjLGo0RNyDhg=
X-Google-Smtp-Source: APBJJlEBdh+xsvh+Bo5hWO3RkW2wDNeEPqSCLaQ2ijqegBPt3AxvxjSwU8QAdn957rZPqKKKWtbDqg==
X-Received: by 2002:a05:6808:b26:b0:3a3:aedd:6b21 with SMTP id t6-20020a0568080b2600b003a3aedd6b21mr10745132oij.39.1690823041847;
        Mon, 31 Jul 2023 10:04:01 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 12/31] powerpc: Convert various functions to use ptdescs
Date: Mon, 31 Jul 2023 10:03:13 -0700
Message-Id: <20230731170332.69404-13-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In order to split struct ptdesc from struct page, convert various
functions to use ptdescs.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/powerpc/mm/book3s64/mmu_context.c | 10 ++---
 arch/powerpc/mm/book3s64/pgtable.c     | 32 +++++++-------
 arch/powerpc/mm/pgtable-frag.c         | 58 +++++++++++++-------------
 3 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/arch/powerpc/mm/book3s64/mmu_context.c b/arch/powerpc/mm/book3s64/mmu_context.c
index c766e4c26e42..1715b07c630c 100644
--- a/arch/powerpc/mm/book3s64/mmu_context.c
+++ b/arch/powerpc/mm/book3s64/mmu_context.c
@@ -246,15 +246,15 @@ static void destroy_contexts(mm_context_t *ctx)
 static void pmd_frag_destroy(void *pmd_frag)
 {
 	int count;
-	struct page *page;
+	struct ptdesc *ptdesc;
 
-	page = virt_to_page(pmd_frag);
+	ptdesc = virt_to_ptdesc(pmd_frag);
 	/* drop all the pending references */
 	count = ((unsigned long)pmd_frag & ~PAGE_MASK) >> PMD_FRAG_SIZE_SHIFT;
 	/* We allow PTE_FRAG_NR fragments from a PTE page */
-	if (atomic_sub_and_test(PMD_FRAG_NR - count, &page->pt_frag_refcount)) {
-		pgtable_pmd_page_dtor(page);
-		__free_page(page);
+	if (atomic_sub_and_test(PMD_FRAG_NR - count, &ptdesc->pt_frag_refcount)) {
+		pagetable_pmd_dtor(ptdesc);
+		pagetable_free(ptdesc);
 	}
 }
 
diff --git a/arch/powerpc/mm/book3s64/pgtable.c b/arch/powerpc/mm/book3s64/pgtable.c
index 85c84e89e3ea..1212deeabe15 100644
--- a/arch/powerpc/mm/book3s64/pgtable.c
+++ b/arch/powerpc/mm/book3s64/pgtable.c
@@ -306,22 +306,22 @@ static pmd_t *get_pmd_from_cache(struct mm_struct *mm)
 static pmd_t *__alloc_for_pmdcache(struct mm_struct *mm)
 {
 	void *ret = NULL;
-	struct page *page;
+	struct ptdesc *ptdesc;
 	gfp_t gfp = GFP_KERNEL_ACCOUNT | __GFP_ZERO;
 
 	if (mm == &init_mm)
 		gfp &= ~__GFP_ACCOUNT;
-	page = alloc_page(gfp);
-	if (!page)
+	ptdesc = pagetable_alloc(gfp, 0);
+	if (!ptdesc)
 		return NULL;
-	if (!pgtable_pmd_page_ctor(page)) {
-		__free_pages(page, 0);
+	if (!pagetable_pmd_ctor(ptdesc)) {
+		pagetable_free(ptdesc);
 		return NULL;
 	}
 
-	atomic_set(&page->pt_frag_refcount, 1);
+	atomic_set(&ptdesc->pt_frag_refcount, 1);
 
-	ret = page_address(page);
+	ret = ptdesc_address(ptdesc);
 	/*
 	 * if we support only one fragment just return the
 	 * allocated page.
@@ -331,12 +331,12 @@ static pmd_t *__alloc_for_pmdcache(struct mm_struct *mm)
 
 	spin_lock(&mm->page_table_lock);
 	/*
-	 * If we find pgtable_page set, we return
+	 * If we find ptdesc_page set, we return
 	 * the allocated page with single fragment
 	 * count.
 	 */
 	if (likely(!mm->context.pmd_frag)) {
-		atomic_set(&page->pt_frag_refcount, PMD_FRAG_NR);
+		atomic_set(&ptdesc->pt_frag_refcount, PMD_FRAG_NR);
 		mm->context.pmd_frag = ret + PMD_FRAG_SIZE;
 	}
 	spin_unlock(&mm->page_table_lock);
@@ -357,15 +357,15 @@ pmd_t *pmd_fragment_alloc(struct mm_struct *mm, unsigned long vmaddr)
 
 void pmd_fragment_free(unsigned long *pmd)
 {
-	struct page *page = virt_to_page(pmd);
+	struct ptdesc *ptdesc = virt_to_ptdesc(pmd);
 
-	if (PageReserved(page))
-		return free_reserved_page(page);
+	if (pagetable_is_reserved(ptdesc))
+		return free_reserved_ptdesc(ptdesc);
 
-	BUG_ON(atomic_read(&page->pt_frag_refcount) <= 0);
-	if (atomic_dec_and_test(&page->pt_frag_refcount)) {
-		pgtable_pmd_page_dtor(page);
-		__free_page(page);
+	BUG_ON(atomic_read(&ptdesc->pt_frag_refcount) <= 0);
+	if (atomic_dec_and_test(&ptdesc->pt_frag_refcount)) {
+		pagetable_pmd_dtor(ptdesc);
+		pagetable_free(ptdesc);
 	}
 }
 
diff --git a/arch/powerpc/mm/pgtable-frag.c b/arch/powerpc/mm/pgtable-frag.c
index 0c6b68130025..8c31802f97e8 100644
--- a/arch/powerpc/mm/pgtable-frag.c
+++ b/arch/powerpc/mm/pgtable-frag.c
@@ -18,15 +18,15 @@
 void pte_frag_destroy(void *pte_frag)
 {
 	int count;
-	struct page *page;
+	struct ptdesc *ptdesc;
 
-	page = virt_to_page(pte_frag);
+	ptdesc = virt_to_ptdesc(pte_frag);
 	/* drop all the pending references */
 	count = ((unsigned long)pte_frag & ~PAGE_MASK) >> PTE_FRAG_SIZE_SHIFT;
 	/* We allow PTE_FRAG_NR fragments from a PTE page */
-	if (atomic_sub_and_test(PTE_FRAG_NR - count, &page->pt_frag_refcount)) {
-		pgtable_pte_page_dtor(page);
-		__free_page(page);
+	if (atomic_sub_and_test(PTE_FRAG_NR - count, &ptdesc->pt_frag_refcount)) {
+		pagetable_pte_dtor(ptdesc);
+		pagetable_free(ptdesc);
 	}
 }
 
@@ -55,25 +55,25 @@ static pte_t *get_pte_from_cache(struct mm_struct *mm)
 static pte_t *__alloc_for_ptecache(struct mm_struct *mm, int kernel)
 {
 	void *ret = NULL;
-	struct page *page;
+	struct ptdesc *ptdesc;
 
 	if (!kernel) {
-		page = alloc_page(PGALLOC_GFP | __GFP_ACCOUNT);
-		if (!page)
+		ptdesc = pagetable_alloc(PGALLOC_GFP | __GFP_ACCOUNT, 0);
+		if (!ptdesc)
 			return NULL;
-		if (!pgtable_pte_page_ctor(page)) {
-			__free_page(page);
+		if (!pagetable_pte_ctor(ptdesc)) {
+			pagetable_free(ptdesc);
 			return NULL;
 		}
 	} else {
-		page = alloc_page(PGALLOC_GFP);
-		if (!page)
+		ptdesc = pagetable_alloc(PGALLOC_GFP, 0);
+		if (!ptdesc)
 			return NULL;
 	}
 
-	atomic_set(&page->pt_frag_refcount, 1);
+	atomic_set(&ptdesc->pt_frag_refcount, 1);
 
-	ret = page_address(page);
+	ret = ptdesc_address(ptdesc);
 	/*
 	 * if we support only one fragment just return the
 	 * allocated page.
@@ -82,12 +82,12 @@ static pte_t *__alloc_for_ptecache(struct mm_struct *mm, int kernel)
 		return ret;
 	spin_lock(&mm->page_table_lock);
 	/*
-	 * If we find pgtable_page set, we return
+	 * If we find ptdesc_page set, we return
 	 * the allocated page with single fragment
 	 * count.
 	 */
 	if (likely(!pte_frag_get(&mm->context))) {
-		atomic_set(&page->pt_frag_refcount, PTE_FRAG_NR);
+		atomic_set(&ptdesc->pt_frag_refcount, PTE_FRAG_NR);
 		pte_frag_set(&mm->context, ret + PTE_FRAG_SIZE);
 	}
 	spin_unlock(&mm->page_table_lock);
@@ -108,28 +108,28 @@ pte_t *pte_fragment_alloc(struct mm_struct *mm, int kernel)
 
 static void pte_free_now(struct rcu_head *head)
 {
-	struct page *page;
+	struct ptdesc *ptdesc;
 
-	page = container_of(head, struct page, rcu_head);
-	pgtable_pte_page_dtor(page);
-	__free_page(page);
+	ptdesc = container_of(head, struct ptdesc, pt_rcu_head);
+	pagetable_pte_dtor(ptdesc);
+	pagetable_free(ptdesc);
 }
 
 void pte_fragment_free(unsigned long *table, int kernel)
 {
-	struct page *page = virt_to_page(table);
+	struct ptdesc *ptdesc = virt_to_ptdesc(table);
 
-	if (PageReserved(page))
-		return free_reserved_page(page);
+	if (pagetable_is_reserved(ptdesc))
+		return free_reserved_ptdesc(ptdesc);
 
-	BUG_ON(atomic_read(&page->pt_frag_refcount) <= 0);
-	if (atomic_dec_and_test(&page->pt_frag_refcount)) {
+	BUG_ON(atomic_read(&ptdesc->pt_frag_refcount) <= 0);
+	if (atomic_dec_and_test(&ptdesc->pt_frag_refcount)) {
 		if (kernel)
-			__free_page(page);
-		else if (TestClearPageActive(page))
-			call_rcu(&page->rcu_head, pte_free_now);
+			pagetable_free(ptdesc);
+		else if (folio_test_clear_active(ptdesc_folio(ptdesc)))
+			call_rcu(&ptdesc->pt_rcu_head, pte_free_now);
 		else
-			pte_free_now(&page->rcu_head);
+			pte_free_now(&ptdesc->pt_rcu_head);
 	}
 }
 
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:04:08 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:04:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573260.897876 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJT-0004Rs-Tp; Mon, 31 Jul 2023 17:04:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573260.897876; Mon, 31 Jul 2023 17:04:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWJT-0004Qh-Ot; Mon, 31 Jul 2023 17:04:07 +0000
Received: by outflank-mailman (input) for mailman id 573260;
 Mon, 31 Jul 2023 17:04:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJS-0000C0-1w
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:06 +0000
Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com
 [2607:f8b0:4864:20::22e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 40ee71a2-2fc4-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 19:04:05 +0200 (CEST)
Received: by mail-oi1-x22e.google.com with SMTP id
 5614622812f47-3a3e1152c23so3458362b6e.2
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:05 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.01
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 40ee71a2-2fc4-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823044; x=1691427844;
        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=sltDOqqNfHEtvz8jLXUjW/r74sJCuRKUMVTEbSHBWCo=;
        b=DDv4TKtr1SQu5KqZfb+k47cCUnTqa2hu0PGvOIZKT6p5w+WOigqgjt3pTCKyoVLOur
         PNxnRZ3jA0/RzPila/zrL9Ut0S2D7/dzdlixHctnRTEPuULJtPpCXt2sv6EdNGvihlcs
         y+VItng76gppkBpBjqibZpmruGV1NMM5yu9a5rLJnoNJwEeQ9JDH3AVeubSs7+9WGxCh
         BgihnLJKz5piH3g7XsbkueQJcQA3Z7Rp93aL/N3tU8RHXtjRG0jvHhNa9PLCdjFnI5G2
         GSA2pxYIUUVv4+PcoooKpTBzs2tJHyDwSGkSOMs2tb/nCpuvSVvt1GOnIBWnaMdpcLVw
         tIUg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823044; x=1691427844;
        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=sltDOqqNfHEtvz8jLXUjW/r74sJCuRKUMVTEbSHBWCo=;
        b=NqhudgoyMu96ae8v09vAqxNLyhpbOIBOTVSaZrawrlJuTwt4PRoOLXLvCwFlCGcWDC
         Lx953BdBcgBl+Ut1sh6S1QTME/gRti7hNXGEL51lunKwkvj9Aj6VDkTkLkuEh6zhB5kB
         DIdFRCuN0OuLcF/coqgiCjCGRaEMoIkutPflpnRX9rXFB2cFteLJQHqalHa9cFUsUCyf
         +vhDTmMYwQxq9cSmVcBzQZjQVo8VzZUzpAMRgsNpymjyl4g8FzgMXU8DI67IxKLDZ/ZC
         OrwAu2synWmFhm/aCaSbn2Ng1IymmEZo0Ds0ZOlVUasMQegRxJRqj8bc0nq4y3Ikz8Dx
         KlzA==
X-Gm-Message-State: ABy/qLZBG2oTNCyhKXCWe7mS1LX02z758EtGUUtqE0YerghL5TBsRZD/
	8RkuK47VYfDKXhMHbLpudxU=
X-Google-Smtp-Source: APBJJlHmCcTDPCXO6u+09Bgv6vKTB5JCy6bic+/Xn7A3kI+4k4FzOgutNRH/lGvVTDd+56ojK0po+g==
X-Received: by 2002:a05:6808:d4a:b0:3a3:e593:5ac1 with SMTP id w10-20020a0568080d4a00b003a3e5935ac1mr13154690oik.21.1690823043912;
        Mon, 31 Jul 2023 10:04:03 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Dave Hansen <dave.hansen@linux.intel.com>
Subject: [PATCH mm-unstable v8 13/31] x86: Convert various functions to use ptdescs
Date: Mon, 31 Jul 2023 10:03:14 -0700
Message-Id: <20230731170332.69404-14-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In order to split struct ptdesc from struct page, convert various
functions to use ptdescs.

Some of the functions use the *get*page*() helper functions. Convert
these to use pagetable_alloc() and ptdesc_address() instead to help
standardize page tables further.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
---
 arch/x86/mm/pgtable.c | 47 ++++++++++++++++++++++++++-----------------
 1 file changed, 28 insertions(+), 19 deletions(-)

diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 15a8009a4480..d3a93e8766ee 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -52,7 +52,7 @@ early_param("userpte", setup_userpte);
 
 void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte)
 {
-	pgtable_pte_page_dtor(pte);
+	pagetable_pte_dtor(page_ptdesc(pte));
 	paravirt_release_pte(page_to_pfn(pte));
 	paravirt_tlb_remove_table(tlb, pte);
 }
@@ -60,7 +60,7 @@ void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte)
 #if CONFIG_PGTABLE_LEVELS > 2
 void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
 {
-	struct page *page = virt_to_page(pmd);
+	struct ptdesc *ptdesc = virt_to_ptdesc(pmd);
 	paravirt_release_pmd(__pa(pmd) >> PAGE_SHIFT);
 	/*
 	 * NOTE! For PAE, any changes to the top page-directory-pointer-table
@@ -69,8 +69,8 @@ void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
 #ifdef CONFIG_X86_PAE
 	tlb->need_flush_all = 1;
 #endif
-	pgtable_pmd_page_dtor(page);
-	paravirt_tlb_remove_table(tlb, page);
+	pagetable_pmd_dtor(ptdesc);
+	paravirt_tlb_remove_table(tlb, ptdesc_page(ptdesc));
 }
 
 #if CONFIG_PGTABLE_LEVELS > 3
@@ -92,16 +92,16 @@ void ___p4d_free_tlb(struct mmu_gather *tlb, p4d_t *p4d)
 
 static inline void pgd_list_add(pgd_t *pgd)
 {
-	struct page *page = virt_to_page(pgd);
+	struct ptdesc *ptdesc = virt_to_ptdesc(pgd);
 
-	list_add(&page->lru, &pgd_list);
+	list_add(&ptdesc->pt_list, &pgd_list);
 }
 
 static inline void pgd_list_del(pgd_t *pgd)
 {
-	struct page *page = virt_to_page(pgd);
+	struct ptdesc *ptdesc = virt_to_ptdesc(pgd);
 
-	list_del(&page->lru);
+	list_del(&ptdesc->pt_list);
 }
 
 #define UNSHARED_PTRS_PER_PGD				\
@@ -112,12 +112,12 @@ static inline void pgd_list_del(pgd_t *pgd)
 
 static void pgd_set_mm(pgd_t *pgd, struct mm_struct *mm)
 {
-	virt_to_page(pgd)->pt_mm = mm;
+	virt_to_ptdesc(pgd)->pt_mm = mm;
 }
 
 struct mm_struct *pgd_page_get_mm(struct page *page)
 {
-	return page->pt_mm;
+	return page_ptdesc(page)->pt_mm;
 }
 
 static void pgd_ctor(struct mm_struct *mm, pgd_t *pgd)
@@ -213,11 +213,14 @@ void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd)
 static void free_pmds(struct mm_struct *mm, pmd_t *pmds[], int count)
 {
 	int i;
+	struct ptdesc *ptdesc;
 
 	for (i = 0; i < count; i++)
 		if (pmds[i]) {
-			pgtable_pmd_page_dtor(virt_to_page(pmds[i]));
-			free_page((unsigned long)pmds[i]);
+			ptdesc = virt_to_ptdesc(pmds[i]);
+
+			pagetable_pmd_dtor(ptdesc);
+			pagetable_free(ptdesc);
 			mm_dec_nr_pmds(mm);
 		}
 }
@@ -230,18 +233,24 @@ static int preallocate_pmds(struct mm_struct *mm, pmd_t *pmds[], int count)
 
 	if (mm == &init_mm)
 		gfp &= ~__GFP_ACCOUNT;
+	gfp &= ~__GFP_HIGHMEM;
 
 	for (i = 0; i < count; i++) {
-		pmd_t *pmd = (pmd_t *)__get_free_page(gfp);
-		if (!pmd)
+		pmd_t *pmd = NULL;
+		struct ptdesc *ptdesc = pagetable_alloc(gfp, 0);
+
+		if (!ptdesc)
 			failed = true;
-		if (pmd && !pgtable_pmd_page_ctor(virt_to_page(pmd))) {
-			free_page((unsigned long)pmd);
-			pmd = NULL;
+		if (ptdesc && !pagetable_pmd_ctor(ptdesc)) {
+			pagetable_free(ptdesc);
+			ptdesc = NULL;
 			failed = true;
 		}
-		if (pmd)
+		if (ptdesc) {
 			mm_inc_nr_pmds(mm);
+			pmd = ptdesc_address(ptdesc);
+		}
+
 		pmds[i] = pmd;
 	}
 
@@ -830,7 +839,7 @@ int pud_free_pmd_page(pud_t *pud, unsigned long addr)
 
 	free_page((unsigned long)pmd_sv);
 
-	pgtable_pmd_page_dtor(virt_to_page(pmd));
+	pagetable_pmd_dtor(virt_to_ptdesc(pmd));
 	free_page((unsigned long)pmd);
 
 	return 1;
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:07:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:07:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573299.897909 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWMo-0008NE-K5; Mon, 31 Jul 2023 17:07:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573299.897909; Mon, 31 Jul 2023 17:07:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWMo-0008Ka-BM; Mon, 31 Jul 2023 17:07:34 +0000
Received: by outflank-mailman (input) for mailman id 573299;
 Mon, 31 Jul 2023 17:07:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJr-0000C0-1N
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:31 +0000
Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com
 [2607:f8b0:4864:20::b2b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4fa32f65-2fc4-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 19:04:29 +0200 (CEST)
Received: by mail-yb1-xb2b.google.com with SMTP id
 3f1490d57ef6-bcb6dbc477eso3787473276.1
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:29 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.26
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4fa32f65-2fc4-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823068; x=1691427868;
        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=0AnRv7d38hHUVaoAGins0CaWMMRgzo0GwUb20Y9YoSw=;
        b=NCurFfzESiDx9LJv2ZuGZQRVSVONypfRSwp3UCPEimaJ0icLYx3MO5YhqaCkZBIR4Z
         l/oM16YnfTb6kc+h35gY+zFIGDLtxKkoqGrDMVFkoTTTXsh+xxxFI4aLUNlB4KO70CwF
         WRXyA1UJf7HH1gQrjYriX6iIExSZBg+JSpTH9iwwtWaRApzq4XeZb8/+i18fB7X+SbC5
         QNboB3mts09Ey/BGMzFFSqcMjH751GJumhdsMsGsSdMw+HfAwMqxwq/99BYNjLDy4Uwv
         T3I5GqlbCblT84V09f9Mmwx3a1PPDI4Kl+kA59SDykK80t9C+rJKaVJTL/sIPY4ok+Qa
         Stkw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823068; x=1691427868;
        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=0AnRv7d38hHUVaoAGins0CaWMMRgzo0GwUb20Y9YoSw=;
        b=Yp9iU1OSYyAzZFcACWi3Y+DTgw8Eq2Ul4pRgeZjAJIBP/jk5+YYCee28CFsnzvewuN
         SjqkUWNl9EdbXNE9UHB2DGkQNYl4Lu3FYTXwIF4XW7RIXqfWEKMkr7t552Gm0Vj9GTCO
         TgL55FEJ+7kPYgqCyBeblK7YbrZBCsPkEMWTwpVmFSncNVhfdtW2Q3qMVyp2pBc1iICV
         U0UiraKOM+GHg85QBPob+OGvAxycTJuP2ejiDDSMEQTUmT1xsnrAgqc06sbF3WMO0DKT
         sxsEQULHnErBxBaz48VWVkPey/sJM1W+NY+HOlP/MpBobnnyFFZlxex0nSNKQSdvI1gW
         cFlw==
X-Gm-Message-State: ABy/qLaN8LfaffTJgD9CW7RdVTPKo6Pk0VL/CulOm2V46bygZq5hdUvu
	XHZ2EP89Hsox42OJ8/tWXS4=
X-Google-Smtp-Source: APBJJlH2OMZz7Ho/ZKKTbee+QNJ7Mj2bTW6BCb3XUatLH/MvStrEwd2dCkY4APrPVNcSGvWAfXuhUw==
X-Received: by 2002:a25:acd2:0:b0:c6d:f875:520e with SMTP id x18-20020a25acd2000000b00c6df875520emr7715849ybd.49.1690823068568;
        Mon, 31 Jul 2023 10:04:28 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Jonas Bonn <jonas@southpole.se>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 25/31] openrisc: Convert __pte_free_tlb() to use ptdescs
Date: Mon, 31 Jul 2023 10:03:26 -0700
Message-Id: <20230731170332.69404-26-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/openrisc/include/asm/pgalloc.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/openrisc/include/asm/pgalloc.h b/arch/openrisc/include/asm/pgalloc.h
index b7b2b8d16fad..c6a73772a546 100644
--- a/arch/openrisc/include/asm/pgalloc.h
+++ b/arch/openrisc/include/asm/pgalloc.h
@@ -66,10 +66,10 @@ extern inline pgd_t *pgd_alloc(struct mm_struct *mm)
 
 extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm);
 
-#define __pte_free_tlb(tlb, pte, addr)	\
-do {					\
-	pgtable_pte_page_dtor(pte);	\
-	tlb_remove_page((tlb), (pte));	\
+#define __pte_free_tlb(tlb, pte, addr)				\
+do {								\
+	pagetable_pte_dtor(page_ptdesc(pte));			\
+	tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte)));	\
 } while (0)
 
 #endif
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:07:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:07:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573296.897897 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWMo-0008Ca-1F; Mon, 31 Jul 2023 17:07:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573296.897897; Mon, 31 Jul 2023 17:07:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWMn-0008CD-RY; Mon, 31 Jul 2023 17:07:33 +0000
Received: by outflank-mailman (input) for mailman id 573296;
 Mon, 31 Jul 2023 17:07:32 +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
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJu-0008Np-7Z
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:34 +0000
Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com
 [2607:f8b0:4864:20::229])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 50da7723-2fc4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:04:32 +0200 (CEST)
Received: by mail-oi1-x229.google.com with SMTP id
 5614622812f47-3a5ad44dc5aso3574242b6e.3
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:32 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.28
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 50da7723-2fc4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823070; x=1691427870;
        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=3wtNkjiFE1rjq7ZRDFNmpMqdu/3EA/QyC8BNR6xlaRk=;
        b=jDHhLXZJRXD/xeYPjUKANAGx7mWI4rG2vR3tiNn5nmibHzSYtMioLibanq9BMakzzx
         Dc40uVduQvHfbEsvbNTufmD3fXRl+TcWbOzDp0kgO7QuCTykCE1j+HK6n3jb1sqe57XF
         7xsPytJhE4yGGkRfFmDQz1HzLuGW2ZTo/1EAyxe33p/FghCyp57Hsm7Uzya8S5xLQJaT
         ueIYolohxESLEyhmxK2PHze+l/eyVpSLM0kum/QRULVrKh/GfSQvLlze6Gzlo9GlB5fo
         iazuqOSyOZnJfKQ3WX+zpbxyRMiNA23MCvyV70vvY+gHhKrbl8nHkjOrciNugWyCFGqp
         7t9g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823070; x=1691427870;
        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=3wtNkjiFE1rjq7ZRDFNmpMqdu/3EA/QyC8BNR6xlaRk=;
        b=UpBb0lrN7Nn29mssuF9/U0XK8QvfODLnSuBGwdDf7ny21PF61o44IOPfvJMfK51tN2
         zmqx5z0deQNRY1qC9O1xfTirEx3aOH873ApQacLsEbgGqnyrVq73obAq2U14svd0Dsg/
         sgMqCbfAsJ4tYETjdhA+7fL0eW71IYUXTbo93z2H6Ze8xfTqSBTHW9ytOkK5BCIR+W5g
         EGcU8GazZNlpX31iUcifko9ksNIrOuB3o8Pc2ZWKu/hTqg3PDQGyFGxA9Z4ibYrJ5iaI
         XJyEhnI6bv7viW/3uHSFN3OYKYlqgjfOMalMYp9qlmLvfQhtY+ZHUwCGy9M9CdJLgCit
         Pf/A==
X-Gm-Message-State: ABy/qLYRAC6D7KXLTmLaBrDkQtAQU4+O2qapch7Fc8r5spOGRais6Dxd
	gIV6Rf/0yo5Lt/Yv47By9TA=
X-Google-Smtp-Source: APBJJlGObInRwlJ0AwNAJnouNbrDrDtHWtXxAKPp84WJFWn9NE838Pa2gI3Dgeu+TYrNO6dbsPWj8A==
X-Received: by 2002:aca:2b03:0:b0:3a7:1443:f4e4 with SMTP id i3-20020aca2b03000000b003a71443f4e4mr5616696oik.44.1690823070647;
        Mon, 31 Jul 2023 10:04:30 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@rivosinc.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 26/31] riscv: Convert alloc_{pmd, pte}_late() to use ptdescs
Date: Mon, 31 Jul 2023 10:03:27 -0700
Message-Id: <20230731170332.69404-27-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

Some of the functions use the *get*page*() helper functions. Convert
these to use pagetable_alloc() and ptdesc_address() instead to help
standardize page tables further.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/riscv/include/asm/pgalloc.h |  8 ++++----
 arch/riscv/mm/init.c             | 16 ++++++----------
 2 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/arch/riscv/include/asm/pgalloc.h b/arch/riscv/include/asm/pgalloc.h
index 59dc12b5b7e8..d169a4f41a2e 100644
--- a/arch/riscv/include/asm/pgalloc.h
+++ b/arch/riscv/include/asm/pgalloc.h
@@ -153,10 +153,10 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 
 #endif /* __PAGETABLE_PMD_FOLDED */
 
-#define __pte_free_tlb(tlb, pte, buf)   \
-do {                                    \
-	pgtable_pte_page_dtor(pte);     \
-	tlb_remove_page((tlb), pte);    \
+#define __pte_free_tlb(tlb, pte, buf)			\
+do {							\
+	pagetable_pte_dtor(page_ptdesc(pte));		\
+	tlb_remove_page_ptdesc((tlb), page_ptdesc(pte));\
 } while (0)
 #endif /* CONFIG_MMU */
 
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 9ce504737d18..430a3d05a841 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -353,12 +353,10 @@ static inline phys_addr_t __init alloc_pte_fixmap(uintptr_t va)
 
 static phys_addr_t __init alloc_pte_late(uintptr_t va)
 {
-	unsigned long vaddr;
-
-	vaddr = __get_free_page(GFP_KERNEL);
-	BUG_ON(!vaddr || !pgtable_pte_page_ctor(virt_to_page((void *)vaddr)));
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL & ~__GFP_HIGHMEM, 0);
 
-	return __pa(vaddr);
+	BUG_ON(!ptdesc || !pagetable_pte_ctor(ptdesc));
+	return __pa((pte_t *)ptdesc_address(ptdesc));
 }
 
 static void __init create_pte_mapping(pte_t *ptep,
@@ -436,12 +434,10 @@ static phys_addr_t __init alloc_pmd_fixmap(uintptr_t va)
 
 static phys_addr_t __init alloc_pmd_late(uintptr_t va)
 {
-	unsigned long vaddr;
-
-	vaddr = __get_free_page(GFP_KERNEL);
-	BUG_ON(!vaddr || !pgtable_pmd_page_ctor(virt_to_page((void *)vaddr)));
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL & ~__GFP_HIGHMEM, 0);
 
-	return __pa(vaddr);
+	BUG_ON(!ptdesc || !pagetable_pmd_ctor(ptdesc));
+	return __pa((pmd_t *)ptdesc_address(ptdesc));
 }
 
 static void __init create_pmd_mapping(pmd_t *pmdp,
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:07:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:07:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573288.897892 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWMn-0008AE-Mi; Mon, 31 Jul 2023 17:07:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573288.897892; Mon, 31 Jul 2023 17:07:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWMn-0008A7-KA; Mon, 31 Jul 2023 17:07:33 +0000
Received: by outflank-mailman (input) for mailman id 573288;
 Mon, 31 Jul 2023 17:07:31 +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
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJh-0008Np-12
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:21 +0000
Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com
 [2607:f8b0:4864:20::b35])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 497bac55-2fc4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:04:19 +0200 (CEST)
Received: by mail-yb1-xb35.google.com with SMTP id
 3f1490d57ef6-d3522283441so604497276.0
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:19 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 497bac55-2fc4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823058; x=1691427858;
        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=aUnc1suNAj/KzreaB6s7vAsOWiJZx3FNBLzDbQjj/SU=;
        b=LZWvv3P5ObD312NoT3HCx6hT2mcipY2zu8mSMdCIx/PBIBw4fnj2ZRkQKvrh+bnMcb
         cAhsWuRoUJhfVjNPelqZekFAhbwYfyzvXSZQKgwb66CUaJSig1RixymjgB6EpjMZeG9i
         TPX/SETFM0d6TUT+vW8F9GlkDQXYjB62fk/7jUTcwacjm8I/TfM4mDRrCt1nWg7/91vP
         laynl0EMAor5eoXfG6EYJS8WyMBq5PEy+tqv6UFYxDYMRASimm9gjZvXzBE5l6AVAiGx
         CLfIZvVLYDlmtO9VH/rc+XPRyyAblWv0VbvnMMW+5OEC9ZkYXTzgntXD+ElukV+Op4w9
         X05g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823058; x=1691427858;
        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=aUnc1suNAj/KzreaB6s7vAsOWiJZx3FNBLzDbQjj/SU=;
        b=CWeCW5w+vKdXj3Odt6xYFH6K42vBMgsjZGIImGPYhS/ipLx89Nd0CY2hPuOtn2WI5p
         eia88g42HRTdevy4vQamn1qr76hDX1V5W68t8cdJ4G3PB6T8KXTBluCx4+P42IsKwlud
         8lAkpUtJjLj/EpRlFfuho0i8qQsIPJfrVerqjbn6m3v/ZIojJfLiiZnAs7Z9I+ZjZ5wV
         h1xVm7CRokWXKJ94vTKp/UzW/equBB7sC/aLGNiNxwrgrx+BWpwqWcfc+N8upDfCSZ4p
         BCoZZcKV2Qy5faKss/HBbPIrrWfM3OAs1lEGN4XOeH5cCir33a1vy63VkggoxnkO+ukM
         jKYw==
X-Gm-Message-State: ABy/qLZwfxfDzoKw4P2P3bAs5fLk0LIzdMMsZjs6mgkyAp56ue4gea+l
	xnZtjV+COjPuJTw8+r5hDLc=
X-Google-Smtp-Source: APBJJlHweyU7H3TneHig7w5n/DLDjL/9e2cIxm5cNvwqW36o28cnjEbZQWmE0nZHXnpgzHbA2ayWvQ==
X-Received: by 2002:a25:acd2:0:b0:c6d:f875:520e with SMTP id x18-20020a25acd2000000b00c6df875520emr7715191ybd.49.1690823058269;
        Mon, 31 Jul 2023 10:04:18 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 20/31] hexagon: Convert __pte_free_tlb() to use ptdescs
Date: Mon, 31 Jul 2023 10:03:21 -0700
Message-Id: <20230731170332.69404-21-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/hexagon/include/asm/pgalloc.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/hexagon/include/asm/pgalloc.h b/arch/hexagon/include/asm/pgalloc.h
index f0c47e6a7427..55988625e6fb 100644
--- a/arch/hexagon/include/asm/pgalloc.h
+++ b/arch/hexagon/include/asm/pgalloc.h
@@ -87,10 +87,10 @@ static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
 		max_kernel_seg = pmdindex;
 }
 
-#define __pte_free_tlb(tlb, pte, addr)		\
-do {						\
-	pgtable_pte_page_dtor((pte));		\
-	tlb_remove_page((tlb), (pte));		\
+#define __pte_free_tlb(tlb, pte, addr)				\
+do {								\
+	pagetable_pte_dtor((page_ptdesc(pte)));			\
+	tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte)));	\
 } while (0)
 
 #endif
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:07:35 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:07:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573298.897903 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWMo-0008H0-7x; Mon, 31 Jul 2023 17:07:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573298.897903; Mon, 31 Jul 2023 17:07:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWMo-0008F6-2K; Mon, 31 Jul 2023 17:07:34 +0000
Received: by outflank-mailman (input) for mailman id 573298;
 Mon, 31 Jul 2023 17:07:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJV-0000C0-Pf
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:09 +0000
Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com
 [2607:f8b0:4864:20::b35])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 436d25c3-2fc4-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 19:04:09 +0200 (CEST)
Received: by mail-yb1-xb35.google.com with SMTP id
 3f1490d57ef6-c5ffb6cda23so4928539276.0
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:09 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:07 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 436d25c3-2fc4-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823048; x=1691427848;
        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=hoPDwBR7UkDBRqaPTC6ObTEe9OrRslO4Jma44jkeaBI=;
        b=OAbNNQBEQXMPsZxDdWqbwpvcbcC9brAkDdGEYZZSxmgS9fU/KaG8Vdw1eojjPxifHR
         dAgpTgfKnNikXik7mZu8QxravKkUxiIYGVER2PrkOqRriotSLF3T4LElpBmapph98PeJ
         CgANJas/sYwEcas//U7Qxkrb0B57mEkHjJFVkSuOLhuhDwIKccn09v9YrEs6kDdqLy4T
         Ieqhh+PAHMUzo7yeR/3qM+URoXymEQxqZDFSNR+LNsEWiMnR0aGkUyMFjyNfNubh1n44
         qou+GBpn9D5SWlHqMqT15mOyIOurWshKH34ovdJcmzrKIbB8XOImOByAI5BjQB0TmzE9
         Sl9g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823048; x=1691427848;
        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=hoPDwBR7UkDBRqaPTC6ObTEe9OrRslO4Jma44jkeaBI=;
        b=Bg3KXyhgVoVkH2J9yDBQaayr7yxCzAexB+J+gkGyg7SqBdHAURDQvFUnSxVBsKYrof
         2dLDIam00+j1CKbfKE6j9sUHpFL59GOaX4AusVHkZk1TpGSu7bhvSbd880KGWciVO08k
         oLGEQY4EztQ++Fu/nFvmBnnWBG8AdEClZPmHTzj0R8OHUynmOmd+Hr7+KkZmQ5iFGFnW
         T1k+hQ9GppN4zAQdkr+0fMOTHbU52PGX5m4Wsku+uD74dnWUXO/B4VS2DkWkwQvk+B/H
         cso1nt0iy5Hu3tly6QzBCz1svQDHK0bV6Vq6fmhSY6BHqu6ZYCZsGATqIYPDjqMrQ6Av
         6Jng==
X-Gm-Message-State: ABy/qLZ+c5pQ8i0nF9Y7XL66RJKUlFh+bMfqc1sKkJQ269QM3oTaIg+j
	9Q2Fd3GBVkXWjoNO4DVnR3A=
X-Google-Smtp-Source: APBJJlFKcIKM/utvbiiE7uhCLg+4EyOcJ7OdfVdmr1i+MWfEQcViSbVO+c8ELmOI+htD8mvz1eRjLA==
X-Received: by 2002:a25:f626:0:b0:d10:d237:b03d with SMTP id t38-20020a25f626000000b00d10d237b03dmr9909607ybd.53.1690823048043;
        Mon, 31 Jul 2023 10:04:08 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 15/31] mm: Remove page table members from struct page
Date: Mon, 31 Jul 2023 10:03:16 -0700
Message-Id: <20230731170332.69404-16-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The page table members are now split out into their own ptdesc struct.
Remove them from struct page.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 include/linux/mm_types.h | 18 ------------------
 include/linux/pgtable.h  |  3 ---
 2 files changed, 21 deletions(-)

diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index da538ff68953..aae6af098031 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -141,24 +141,6 @@ struct page {
 		struct {	/* Tail pages of compound page */
 			unsigned long compound_head;	/* Bit zero is set */
 		};
-		struct {	/* Page table pages */
-			unsigned long _pt_pad_1;	/* compound_head */
-			pgtable_t pmd_huge_pte; /* protected by page->ptl */
-			/*
-			 * A PTE page table page might be freed by use of
-			 * rcu_head: which overlays those two fields above.
-			 */
-			unsigned long _pt_pad_2;	/* mapping */
-			union {
-				struct mm_struct *pt_mm; /* x86 pgds only */
-				atomic_t pt_frag_refcount; /* powerpc */
-			};
-#if ALLOC_SPLIT_PTLOCKS
-			spinlock_t *ptl;
-#else
-			spinlock_t ptl;
-#endif
-		};
 		struct {	/* ZONE_DEVICE pages */
 			/** @pgmap: Points to the hosting device page map. */
 			struct dev_pagemap *pgmap;
diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
index 250fdeba68f3..1a984c300d45 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
@@ -1051,10 +1051,7 @@ struct ptdesc {
 TABLE_MATCH(flags, __page_flags);
 TABLE_MATCH(compound_head, pt_list);
 TABLE_MATCH(compound_head, _pt_pad_1);
-TABLE_MATCH(pmd_huge_pte, pmd_huge_pte);
 TABLE_MATCH(mapping, __page_mapping);
-TABLE_MATCH(pt_mm, pt_mm);
-TABLE_MATCH(ptl, ptl);
 TABLE_MATCH(rcu_head, pt_rcu_head);
 TABLE_MATCH(page_type, __page_type);
 TABLE_MATCH(_refcount, _refcount);
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:07:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:07:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573303.897932 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWMr-0000lM-0D; Mon, 31 Jul 2023 17:07:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573303.897932; Mon, 31 Jul 2023 17:07:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWMq-0000lF-Ra; Mon, 31 Jul 2023 17:07:36 +0000
Received: by outflank-mailman (input) for mailman id 573303;
 Mon, 31 Jul 2023 17:07:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJu-0000C0-IS
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:34 +0000
Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com
 [2607:f8b0:4864:20::22c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 521f84c3-2fc4-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 19:04:34 +0200 (CEST)
Received: by mail-oi1-x22c.google.com with SMTP id
 5614622812f47-3a426e70575so2742921b6e.0
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:34 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:32 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 521f84c3-2fc4-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823073; x=1691427873;
        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=NG13BwzmmAIpXpcduEwvRHFbS3iQhU18W2JpKLteVDY=;
        b=J5UHMtA0qoYiWw4Ld5R0BKI4Tc5AGDSmTkXJ2I6fYmBwlIVDq2NZ9TijiKx7n7oR9S
         O2+0XndgcZyKpOow8lUaucDbgGPax/K8O+lCXFcyUW1OtbVxoGLUMUxT+xXe1Nbotguq
         wXQV4F4SfOD9dJwiO/iz9SNiN+CqscWBWqXkI0FM0EZ9ZzfP3bhZCq1/PYVKZkiSL88/
         WlbyA+YZDFKl4pgL1EI3/3iabhB8k7YUgWRxCXqfKPLtTRNQuaY8gnPQjbT+Yt9xzJqB
         tpRwv/UorbhC7cKUIm0hPbznR4XxDKlGiKxb+h0cWPY+2avNMZiADFAVxe8ptEu65tNh
         rVOA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823073; x=1691427873;
        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=NG13BwzmmAIpXpcduEwvRHFbS3iQhU18W2JpKLteVDY=;
        b=Nb/0EJOz91t4Vvvx6fbt2mrSmjw5kQsjPy4/xWSL7ywxfCpH4hVXhxOOdK/7LvPLy0
         bHW6hZpBDbGHq+jKyL02coH64Lghx2RWDPGU5vfPExo3VwoSFtQal4/nWtsgZHWZY665
         FYpKG4/fOUVMtulDoSuKEe4QMC5I1/850XlC3R0qGTuRG10/myQUpyd6wvmYF+gk/kob
         WBCiccYbpXa8Hom5R2gx1Mze0tym5OEQzCVRgtf3yM5Gwahx35kZmAcLfGeGlhbKz9X/
         iG1VS6YhDf9On0wz9oR2a6oLP79vT9k50Qry5HOnps3ssw5LdcF32jDQ85nL3IKGXR9b
         kG8g==
X-Gm-Message-State: ABy/qLbPhkw9y7dPtdUDVKOWjRO+ZPjqu4/00AFlLe7Glqcyzs6FRFIm
	tlswh456SS8Sxuh/qt58TLA=
X-Google-Smtp-Source: APBJJlFtSPsXmTmbaE2JVTTuMieuMfoOw8pkpK4ugTgdmGfxbA+pL1HJ6fgn2J808MNJLpsNTjXtIQ==
X-Received: by 2002:a05:6808:655:b0:396:4bbc:9a36 with SMTP id z21-20020a056808065500b003964bbc9a36mr8685999oih.19.1690823072749;
        Mon, 31 Jul 2023 10:04:32 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 27/31] sh: Convert pte_free_tlb() to use ptdescs
Date: Mon, 31 Jul 2023 10:03:28 -0700
Message-Id: <20230731170332.69404-28-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents. Also cleans up some spacing issues.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/sh/include/asm/pgalloc.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/sh/include/asm/pgalloc.h b/arch/sh/include/asm/pgalloc.h
index a9e98233c4d4..5d8577ab1591 100644
--- a/arch/sh/include/asm/pgalloc.h
+++ b/arch/sh/include/asm/pgalloc.h
@@ -2,6 +2,7 @@
 #ifndef __ASM_SH_PGALLOC_H
 #define __ASM_SH_PGALLOC_H
 
+#include <linux/mm.h>
 #include <asm/page.h>
 
 #define __HAVE_ARCH_PMD_ALLOC_ONE
@@ -31,10 +32,10 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
 	set_pmd(pmd, __pmd((unsigned long)page_address(pte)));
 }
 
-#define __pte_free_tlb(tlb,pte,addr)			\
-do {							\
-	pgtable_pte_page_dtor(pte);			\
-	tlb_remove_page((tlb), (pte));			\
+#define __pte_free_tlb(tlb, pte, addr)				\
+do {								\
+	pagetable_pte_dtor(page_ptdesc(pte));			\
+	tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte)));	\
 } while (0)
 
 #endif /* __ASM_SH_PGALLOC_H */
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:07:37 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:07:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573304.897937 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWMr-0000oi-GV; Mon, 31 Jul 2023 17:07:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573304.897937; Mon, 31 Jul 2023 17:07:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWMr-0000nQ-6o; Mon, 31 Jul 2023 17:07:37 +0000
Received: by outflank-mailman (input) for mailman id 573304;
 Mon, 31 Jul 2023 17:07:35 +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
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJd-0008Np-1u
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:17 +0000
Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com
 [2607:f8b0:4864:20::b2c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4708122c-2fc4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:04:15 +0200 (CEST)
Received: by mail-yb1-xb2c.google.com with SMTP id
 3f1490d57ef6-d29a5f7dc74so3268155276.3
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:15 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4708122c-2fc4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823054; x=1691427854;
        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=1W6z1I6yvWrQZbHmgHYBEGZZDstSbvELOPET/EcKlKw=;
        b=DoLYDaRBa41Zdh1yGELvr4mktDPzCr5wZMtfaOFQzQ5hTcfRkcfNo2gxzOD+0/ykOM
         euBOcnH4+UQlm104MdM8Mcd6Wd+0oXQ7r2d8C7k16OxK93xpXJQ9cxidNEnw+09+Tsgn
         4MiJbaZ4azooZbJym/w2spQi4ZLNoUGyQvzF+yt3P/maH4DT1bEGYtqh5RJ+6A+RSiNZ
         F4VZO0F3scHf9jVdMvyffz9Y4Un+dZzmqLUFBUExZqr5BTOKTZ3vKrNuYiRkZjRgx8qM
         A0v2BAwmzAgXUoHV1OBdUh/BQxSYjg1Y5Vc+ifw6djIqa1GbEqCTgLRTuyk3SSeDHWhN
         ZcIA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823054; x=1691427854;
        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=1W6z1I6yvWrQZbHmgHYBEGZZDstSbvELOPET/EcKlKw=;
        b=QOoLRrO4kNjbucoAbySdE62uGp8pYr1JdptiJSU3pQEGwV1L+IRTPX9n8BQpnX3lBI
         B5P/UTBq920j5UrAy3fpdgbAdOBiMGTDzwPCwBnUuSciJ5wddpVqrqBt3kF3aUEIO1KJ
         FI/hZKLwOT0KAHgoGRKXHudY2vNEK5S+PEy9LOnOmXhTnUbptRvcSfMgLnD2NgU4ZX/b
         X3DVtrfbFZHfVM9XelSzatk5FiWVAOuvqlZ7BHnCqUD5kMSfIT/3m3YHBwJGtVJ6wLwJ
         /gCmKnCHIQrW0NRxjwEbes0e2eFRF56kEX4T48ACVnfe317J+VyrpDIxtYEieif5br6w
         LkBw==
X-Gm-Message-State: ABy/qLYBxqRqYC8UQxEIJpG6+n6PNxHN0WRFoh1zhAiRb7xXekneM4Yq
	UCgVnqpBDqyiZ4I7gp3SV24=
X-Google-Smtp-Source: APBJJlEdpRjJyqAaQhaJuPKqzpefz2AFbwFC7sVhDBH7lQjGs0g9KoyKRkFSzeflgvIaUwqu4lunqA==
X-Received: by 2002:a25:b08d:0:b0:d11:2a52:3f35 with SMTP id f13-20020a25b08d000000b00d112a523f35mr11488364ybj.20.1690823054136;
        Mon, 31 Jul 2023 10:04:14 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>
Subject: [PATCH mm-unstable v8 18/31] arm64: Convert various functions to use ptdescs
Date: Mon, 31 Jul 2023 10:03:19 -0700
Message-Id: <20230731170332.69404-19-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
---
 arch/arm64/include/asm/tlb.h | 14 ++++++++------
 arch/arm64/mm/mmu.c          |  7 ++++---
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/include/asm/tlb.h b/arch/arm64/include/asm/tlb.h
index c995d1f4594f..2c29239d05c3 100644
--- a/arch/arm64/include/asm/tlb.h
+++ b/arch/arm64/include/asm/tlb.h
@@ -75,18 +75,20 @@ static inline void tlb_flush(struct mmu_gather *tlb)
 static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
 				  unsigned long addr)
 {
-	pgtable_pte_page_dtor(pte);
-	tlb_remove_table(tlb, pte);
+	struct ptdesc *ptdesc = page_ptdesc(pte);
+
+	pagetable_pte_dtor(ptdesc);
+	tlb_remove_ptdesc(tlb, ptdesc);
 }
 
 #if CONFIG_PGTABLE_LEVELS > 2
 static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp,
 				  unsigned long addr)
 {
-	struct page *page = virt_to_page(pmdp);
+	struct ptdesc *ptdesc = virt_to_ptdesc(pmdp);
 
-	pgtable_pmd_page_dtor(page);
-	tlb_remove_table(tlb, page);
+	pagetable_pmd_dtor(ptdesc);
+	tlb_remove_ptdesc(tlb, ptdesc);
 }
 #endif
 
@@ -94,7 +96,7 @@ static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp,
 static inline void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pudp,
 				  unsigned long addr)
 {
-	tlb_remove_table(tlb, virt_to_page(pudp));
+	tlb_remove_ptdesc(tlb, virt_to_ptdesc(pudp));
 }
 #endif
 
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index 95d360805f8a..47781bec6171 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -426,6 +426,7 @@ static phys_addr_t __pgd_pgtable_alloc(int shift)
 static phys_addr_t pgd_pgtable_alloc(int shift)
 {
 	phys_addr_t pa = __pgd_pgtable_alloc(shift);
+	struct ptdesc *ptdesc = page_ptdesc(phys_to_page(pa));
 
 	/*
 	 * Call proper page table ctor in case later we need to
@@ -433,12 +434,12 @@ static phys_addr_t pgd_pgtable_alloc(int shift)
 	 * this pre-allocated page table.
 	 *
 	 * We don't select ARCH_ENABLE_SPLIT_PMD_PTLOCK if pmd is
-	 * folded, and if so pgtable_pmd_page_ctor() becomes nop.
+	 * folded, and if so pagetable_pte_ctor() becomes nop.
 	 */
 	if (shift == PAGE_SHIFT)
-		BUG_ON(!pgtable_pte_page_ctor(phys_to_page(pa)));
+		BUG_ON(!pagetable_pte_ctor(ptdesc));
 	else if (shift == PMD_SHIFT)
-		BUG_ON(!pgtable_pmd_page_ctor(phys_to_page(pa)));
+		BUG_ON(!pagetable_pmd_ctor(ptdesc));
 
 	return pa;
 }
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:07:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:07:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573305.897942 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWMs-0000td-3L; Mon, 31 Jul 2023 17:07:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573305.897942; Mon, 31 Jul 2023 17:07:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWMr-0000rf-Jp; Mon, 31 Jul 2023 17:07:37 +0000
Received: by outflank-mailman (input) for mailman id 573305;
 Mon, 31 Jul 2023 17:07:35 +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
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJn-0008Np-AL
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:27 +0000
Received: from mail-il1-x135.google.com (mail-il1-x135.google.com
 [2607:f8b0:4864:20::135])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4d1ad5a8-2fc4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:04:25 +0200 (CEST)
Received: by mail-il1-x135.google.com with SMTP id
 e9e14a558f8ab-34928e9f24bso2450125ab.0
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:25 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4d1ad5a8-2fc4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823064; x=1691427864;
        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=Z2eVDlXL8alglJUGVXcc8JA7ix0brgT+4DYqdXjkOuM=;
        b=UQMFQ0r4Q5WPDgBqHxt98e/7rMdzo/EpmwOe+r7kVkn3hiopHSDbWlcbl5oUHK5iIf
         MEr4ea890R+sJP/eAUogbkn4iWG+9UMyn5afkOFV0PrV0pq/LpKVZxDpJGv509y94xGw
         hLI4HOjNYVUd1nDexzxomwE2YqUnNF1NoyuArVYtjoOeqdYPeQHR5JxR2RSbP4U9P+Tn
         EAeRXMlzA2BnCRlADTS23mT/QfJ1wsL2dS3bX8pvVfdD0qkUAvCOMkcifg576YKQRwd3
         ZfJGkC7UmIJC4v8PHFpL2Jz1mt7kK3WgxCHNDNZXpdMKgiKnSf1XJCiXOu4fHHWiZceQ
         1gJg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823064; x=1691427864;
        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=Z2eVDlXL8alglJUGVXcc8JA7ix0brgT+4DYqdXjkOuM=;
        b=NWqL+fSSYAkKxSj7xU6bJF8YMZ9yEbRBB/vB09F2niJgubdOvG2ecl+Gm7Y04FAnCq
         vrI50m9kFStFgTiHnNyqxhyLlZ7RueZ8YoiE8EhOhJ1nyE2g6zArbe+rvhCQe/jywV/n
         Qshp/uazsTRMKSh/Z2sWxaAU4DWXNz7LcQFHqdaGhwu4sP677L/tU0ombow7nO0W4Wn4
         7ZXsUq2Lvm9fvB5GJKmT8lHK0mWSVUYGTncU3AMFlfA8NXr8JF7GXEYewq32Z7YSUBAu
         +bUJzNB4cOHSl0+0qq8nDC9LLNCD6Kk4mY4Qq1aAHHQ+mrnaLQlBO1DW6LagD9J852gp
         QsjQ==
X-Gm-Message-State: ABy/qLZanBp3uyPQbpi3TelEMZhxOCkTl4VnqTYUj9+bQpADQlaJTsb6
	GAUWMihiUnSHOcGW1+TvVlj+kIpnxsR2lQ==
X-Google-Smtp-Source: APBJJlEWWd7SGavQpR/ZisDPXe2n2lSwd0LXy0L6znKYOT3kkqP+7NMXZkXm3S5oeNu3Zj7rrKqKrw==
X-Received: by 2002:a05:6e02:170d:b0:346:24c2:4f87 with SMTP id u13-20020a056e02170d00b0034624c24f87mr10569413ill.32.1690823064428;
        Mon, 31 Jul 2023 10:04:24 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 23/31] mips: Convert various functions to use ptdescs
Date: Mon, 31 Jul 2023 10:03:24 -0700
Message-Id: <20230731170332.69404-24-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

Some of the functions use the *get*page*() helper functions. Convert
these to use pagetable_alloc() and ptdesc_address() instead to help
standardize page tables further.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/mips/include/asm/pgalloc.h | 32 ++++++++++++++++++--------------
 arch/mips/mm/pgtable.c          |  8 +++++---
 2 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/arch/mips/include/asm/pgalloc.h b/arch/mips/include/asm/pgalloc.h
index f72e737dda21..40e40a7eb94a 100644
--- a/arch/mips/include/asm/pgalloc.h
+++ b/arch/mips/include/asm/pgalloc.h
@@ -51,13 +51,13 @@ extern pgd_t *pgd_alloc(struct mm_struct *mm);
 
 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 {
-	free_pages((unsigned long)pgd, PGD_TABLE_ORDER);
+	pagetable_free(virt_to_ptdesc(pgd));
 }
 
-#define __pte_free_tlb(tlb,pte,address)			\
-do {							\
-	pgtable_pte_page_dtor(pte);			\
-	tlb_remove_page((tlb), pte);			\
+#define __pte_free_tlb(tlb, pte, address)			\
+do {								\
+	pagetable_pte_dtor(page_ptdesc(pte));			\
+	tlb_remove_page_ptdesc((tlb), page_ptdesc(pte));	\
 } while (0)
 
 #ifndef __PAGETABLE_PMD_FOLDED
@@ -65,18 +65,18 @@ do {							\
 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 {
 	pmd_t *pmd;
-	struct page *pg;
+	struct ptdesc *ptdesc;
 
-	pg = alloc_pages(GFP_KERNEL_ACCOUNT, PMD_TABLE_ORDER);
-	if (!pg)
+	ptdesc = pagetable_alloc(GFP_KERNEL_ACCOUNT, PMD_TABLE_ORDER);
+	if (!ptdesc)
 		return NULL;
 
-	if (!pgtable_pmd_page_ctor(pg)) {
-		__free_pages(pg, PMD_TABLE_ORDER);
+	if (!pagetable_pmd_ctor(ptdesc)) {
+		pagetable_free(ptdesc);
 		return NULL;
 	}
 
-	pmd = (pmd_t *)page_address(pg);
+	pmd = ptdesc_address(ptdesc);
 	pmd_init(pmd);
 	return pmd;
 }
@@ -90,10 +90,14 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long address)
 {
 	pud_t *pud;
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL & ~__GFP_HIGHMEM,
+			PUD_TABLE_ORDER);
 
-	pud = (pud_t *) __get_free_pages(GFP_KERNEL, PUD_TABLE_ORDER);
-	if (pud)
-		pud_init(pud);
+	if (!ptdesc)
+		return NULL;
+	pud = ptdesc_address(ptdesc);
+
+	pud_init(pud);
 	return pud;
 }
 
diff --git a/arch/mips/mm/pgtable.c b/arch/mips/mm/pgtable.c
index b13314be5d0e..1506e458040d 100644
--- a/arch/mips/mm/pgtable.c
+++ b/arch/mips/mm/pgtable.c
@@ -10,10 +10,12 @@
 
 pgd_t *pgd_alloc(struct mm_struct *mm)
 {
-	pgd_t *ret, *init;
+	pgd_t *init, *ret = NULL;
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL & ~__GFP_HIGHMEM,
+			PGD_TABLE_ORDER);
 
-	ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_TABLE_ORDER);
-	if (ret) {
+	if (ptdesc) {
+		ret = ptdesc_address(ptdesc);
 		init = pgd_offset(&init_mm, 0UL);
 		pgd_init(ret);
 		memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:07:38 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:07:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573307.897949 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWMs-0000zG-JT; Mon, 31 Jul 2023 17:07:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573307.897949; Mon, 31 Jul 2023 17:07:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWMs-0000xy-4i; Mon, 31 Jul 2023 17:07:38 +0000
Received: by outflank-mailman (input) for mailman id 573307;
 Mon, 31 Jul 2023 17:07:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJz-0000C0-Hj
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:39 +0000
Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com
 [2607:f8b0:4864:20::b2d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 552ed8eb-2fc4-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 19:04:39 +0200 (CEST)
Received: by mail-yb1-xb2d.google.com with SMTP id
 3f1490d57ef6-d0e009433c4so5098407276.2
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:39 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.35
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 552ed8eb-2fc4-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823078; x=1691427878;
        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=ES9RfFz84BcV9KH4Nk3AfkjPOEvVVRdPbPMSiTejLcw=;
        b=bucd5YCHLhUvx7sCV87tgBpS/yvMqV1hEBgLcIdtkbm6tehUvQ4b8S8cGlWi7/sHjP
         BwMI7RjEZDCFEoZqNSu1BeMgh4cbrdk5jNpPQbDjyiWAygQ6GF4RuUGGOqf6kg0VdfDp
         NpGCzdPUkKHCC4r7KLVhXjv8laMIW1vLz9Hl1FxyK0cd8KUbq0iEAg4q7XF5QTVPGxVT
         zofHi8CwcgETUVRV13Pib0COy9kOuveisGg57GrFHsyYwDdtVuj+zN7pcxA+niXzYe26
         MUnkSw5QHmNGRsesWl9frKtr+MQAPLnxo4yz7glnwyiVSVRMIHwbjCv+Zju9S3AQsrM+
         fRtw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823078; x=1691427878;
        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=ES9RfFz84BcV9KH4Nk3AfkjPOEvVVRdPbPMSiTejLcw=;
        b=GS24I2AzVD4HZ5iHlgAmfDFUlim7mlCFxdZGr4ZArtAH/A6biK3/kNc8rr2zcA+eTd
         yEw7nrdG+MPHZQInPvbhpDIRnkSTfDo2ASysxaOmrybhqkSpZfaGb0034zvU3dZNkAYx
         t7S9hffhb0xk3lkBjj7CZMzoUubxIvQXH3DUn6RE3kxPNTFm40PgpluuEpNZxXiCrKm5
         tlJvKspok8lWBFL3yB+ydkCykFQyATCA7TjrM2b1ysW2ekVBA2dEXzr294PLNpZktty1
         +WGyct5flsGRmzjnXc3xjzoH+cpTR13MCWH/f9hDsF+fJAR6zJKuuTEcqGOviSImuBKF
         gbpA==
X-Gm-Message-State: ABy/qLbCEju9hcVFxXwmeBSOiCtzisoIxAJyhjUpzYr1D9Xf13ofL0R4
	Gbc1cHrkR0kDy0hAXffWmIg=
X-Google-Smtp-Source: APBJJlH4kzdzBzRUIaE/50pCy+wwrgbHVj7GhIP0EpKNGW/07mJrSi1SmuvJmvqLlmEJ9bXKX+N7ow==
X-Received: by 2002:a25:2496:0:b0:d0d:f5f3:d2bf with SMTP id k144-20020a252496000000b00d0df5f3d2bfmr9661709ybk.48.1690823077914;
        Mon, 31 Jul 2023 10:04:37 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 29/31] sparc: Convert pgtable_pte_page_{ctor, dtor}() to ptdesc equivalents
Date: Mon, 31 Jul 2023 10:03:30 -0700
Message-Id: <20230731170332.69404-30-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Part of the conversions to replace pgtable pte constructor/destructors with
ptdesc equivalents.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/sparc/mm/srmmu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index 13f027afc875..8393faa3e596 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -355,7 +355,8 @@ pgtable_t pte_alloc_one(struct mm_struct *mm)
 		return NULL;
 	page = pfn_to_page(__nocache_pa((unsigned long)ptep) >> PAGE_SHIFT);
 	spin_lock(&mm->page_table_lock);
-	if (page_ref_inc_return(page) == 2 && !pgtable_pte_page_ctor(page)) {
+	if (page_ref_inc_return(page) == 2 &&
+			!pagetable_pte_ctor(page_ptdesc(page))) {
 		page_ref_dec(page);
 		ptep = NULL;
 	}
@@ -371,7 +372,7 @@ void pte_free(struct mm_struct *mm, pgtable_t ptep)
 	page = pfn_to_page(__nocache_pa((unsigned long)ptep) >> PAGE_SHIFT);
 	spin_lock(&mm->page_table_lock);
 	if (page_ref_dec_return(page) == 1)
-		pgtable_pte_page_dtor(page);
+		pagetable_pte_dtor(page_ptdesc(page));
 	spin_unlock(&mm->page_table_lock);
 
 	srmmu_free_nocache(ptep, SRMMU_PTE_TABLE_SIZE);
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:07:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:07:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573308.897957 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWMt-0001B7-Aj; Mon, 31 Jul 2023 17:07:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573308.897957; Mon, 31 Jul 2023 17:07:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWMs-00018e-Q2; Mon, 31 Jul 2023 17:07:38 +0000
Received: by outflank-mailman (input) for mailman id 573308;
 Mon, 31 Jul 2023 17:07:37 +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
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJj-0008Np-7h
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:23 +0000
Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com
 [2607:f8b0:4864:20::b2b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4aac6420-2fc4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:04:21 +0200 (CEST)
Received: by mail-yb1-xb2b.google.com with SMTP id
 3f1490d57ef6-c5f98fc4237so3738653276.2
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:21 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4aac6420-2fc4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823060; x=1691427860;
        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=pBiyp2dfMpzV+NvCt1JbKOh6Ic1GEYp83948mVxRzoc=;
        b=bii0DnnL/zq4pLY7CpjLkMUsgbLkz7gqSGnWBeRCF11X6Ylp3mxYpagQ6993yGA9Tx
         PF2vUUOBG1y7FhGTNnDukjcT3Ipcja9oZIa3sMMxsfLyDTg+j7yc1He0o+q5msktzAqV
         tEhBEj/xq9sJsN95JWUc99ii1gkRP0c7o8rLJ8hSDdwHbsvR56f/IGjyS7Fnu0VAbC0Y
         XK+6J47RwKDDMwgKfIV3AfvnkXmT3IYpyeit/2cro7NXb8YvdXt0tmBkJB7s17jHD/xl
         ll9rO8u6pHah5lpvOsTcALDpgmctRONG81Iwdo4hzXBejIQu1syTEFsJtqvGtUVw0grb
         t9GQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823060; x=1691427860;
        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=pBiyp2dfMpzV+NvCt1JbKOh6Ic1GEYp83948mVxRzoc=;
        b=gIRExlZT4J/ZQa4HrMgcbC62cxIMrAlpDnf102Egv6A59qoqAEHyvw+ufNMqr/yvgq
         iPWwNOz29UxWh10vTRTyST00LsK6YOm6ExmZdIjHZhJg8SG+nLum2NN7r52YkmlVVn7w
         VEmlueJaMEfC/Ie4jqwtdkXFj6eHaIEXIdHr5JJo477SEZeS210WXPpjLSrTz6APFPUd
         C/rjHrydfzi6dHWeS01HA/8QnR7vStoN3Yti8MOJi7DjU5F8CDvyPPcENKBQCvgFXcKE
         koJpp+9umc0jjHNnIaZRmPTI8T3UNBUyC4A+GT42qIwFMQu9D5q/j6Qcj680V9sOPR0n
         hcvg==
X-Gm-Message-State: ABy/qLanI/+zYMWb+098ZHEMZNpM0hl5tukvw6aEW+3oliHEy7gcw0gm
	I2cwQI0mvIR5oS7C814O0y4=
X-Google-Smtp-Source: APBJJlFeS2ogl3m5ezZAcTbxwtfQRoXWWYsAvuudazx+JhR2l/mtz06faRF9RklP+vg5BWBteq8aEQ==
X-Received: by 2002:a25:d18e:0:b0:d07:d88b:4843 with SMTP id i136-20020a25d18e000000b00d07d88b4843mr7628126ybg.20.1690823060256;
        Mon, 31 Jul 2023 10:04:20 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Huacai Chen <chenhuacai@kernel.org>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 21/31] loongarch: Convert various functions to use ptdescs
Date: Mon, 31 Jul 2023 10:03:22 -0700
Message-Id: <20230731170332.69404-22-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

Some of the functions use the *get*page*() helper functions. Convert
these to use pagetable_alloc() and ptdesc_address() instead to help
standardize page tables further.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/loongarch/include/asm/pgalloc.h | 27 +++++++++++++++------------
 arch/loongarch/mm/pgtable.c          |  7 ++++---
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/arch/loongarch/include/asm/pgalloc.h b/arch/loongarch/include/asm/pgalloc.h
index af1d1e4a6965..23f5b1107246 100644
--- a/arch/loongarch/include/asm/pgalloc.h
+++ b/arch/loongarch/include/asm/pgalloc.h
@@ -45,9 +45,9 @@ extern void pagetable_init(void);
 extern pgd_t *pgd_alloc(struct mm_struct *mm);
 
 #define __pte_free_tlb(tlb, pte, address)			\
-do {							\
-	pgtable_pte_page_dtor(pte);			\
-	tlb_remove_page((tlb), pte);			\
+do {								\
+	pagetable_pte_dtor(page_ptdesc(pte));			\
+	tlb_remove_page_ptdesc((tlb), page_ptdesc(pte));	\
 } while (0)
 
 #ifndef __PAGETABLE_PMD_FOLDED
@@ -55,18 +55,18 @@ do {							\
 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 {
 	pmd_t *pmd;
-	struct page *pg;
+	struct ptdesc *ptdesc;
 
-	pg = alloc_page(GFP_KERNEL_ACCOUNT);
-	if (!pg)
+	ptdesc = pagetable_alloc(GFP_KERNEL_ACCOUNT, 0);
+	if (!ptdesc)
 		return NULL;
 
-	if (!pgtable_pmd_page_ctor(pg)) {
-		__free_page(pg);
+	if (!pagetable_pmd_ctor(ptdesc)) {
+		pagetable_free(ptdesc);
 		return NULL;
 	}
 
-	pmd = (pmd_t *)page_address(pg);
+	pmd = ptdesc_address(ptdesc);
 	pmd_init(pmd);
 	return pmd;
 }
@@ -80,10 +80,13 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long address)
 {
 	pud_t *pud;
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL & ~__GFP_HIGHMEM, 0);
 
-	pud = (pud_t *) __get_free_page(GFP_KERNEL);
-	if (pud)
-		pud_init(pud);
+	if (!ptdesc)
+		return NULL;
+	pud = ptdesc_address(ptdesc);
+
+	pud_init(pud);
 	return pud;
 }
 
diff --git a/arch/loongarch/mm/pgtable.c b/arch/loongarch/mm/pgtable.c
index 36a6dc0148ae..5bd102b51f7c 100644
--- a/arch/loongarch/mm/pgtable.c
+++ b/arch/loongarch/mm/pgtable.c
@@ -11,10 +11,11 @@
 
 pgd_t *pgd_alloc(struct mm_struct *mm)
 {
-	pgd_t *ret, *init;
+	pgd_t *init, *ret = NULL;
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL & ~__GFP_HIGHMEM, 0);
 
-	ret = (pgd_t *) __get_free_page(GFP_KERNEL);
-	if (ret) {
+	if (ptdesc) {
+		ret = (pgd_t *)ptdesc_address(ptdesc);
 		init = pgd_offset(&init_mm, 0UL);
 		pgd_init(ret);
 		memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:07:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:07:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573315.897982 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWN5-0003FM-QZ; Mon, 31 Jul 2023 17:07:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573315.897982; Mon, 31 Jul 2023 17:07:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWN5-0003Ec-JA; Mon, 31 Jul 2023 17:07:51 +0000
Received: by outflank-mailman (input) for mailman id 573315;
 Mon, 31 Jul 2023 17:07:50 +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
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJx-0008Np-Su
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:37 +0000
Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com
 [2607:f8b0:4864:20::b2f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 537eee81-2fc4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:04:36 +0200 (CEST)
Received: by mail-yb1-xb2f.google.com with SMTP id
 3f1490d57ef6-d167393b95aso8382768276.0
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:36 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:34 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 537eee81-2fc4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823075; x=1691427875;
        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=K9EaWELDe99nUon5K3Z+iJo2yPeaFSzyCnD+eyoagSI=;
        b=NsFqLoWt3v/Ei4hrw5AsnvwdpZbLVDKyj7Tbvrs08XADPJ7gaOSxsw7sciWyK4ium/
         IicTt5pAnx/uEvhHlkhBbrdEgtE6/Y30DbetyPtuylWlm9M94rgMfdNkMfsGqtqBt9r5
         2L6Wjhryz46RjM7Eb4DDBBbwHfcSN7h5N/Jso4kYni+cF2Cm7JoIdTfshA0rAirRtgJq
         t1r00+5UN5MvK3JKDaigYuLE4bDBuDPbT6+YGl+hj7DsF2cKQbydBN3rr041uGf1vOTw
         rMTuYysQGj/R6E2nTgdgPgBnp/CeSE0cUWUK6rVcO8oVilzfT/uwMzlyU+7MnJSFTrKk
         qPDw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823075; x=1691427875;
        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=K9EaWELDe99nUon5K3Z+iJo2yPeaFSzyCnD+eyoagSI=;
        b=fS5NomHnDhS0PcrKV1CVkFYeNf4MqXAH2IHB71GgNS/MN08x2LOTgOA7uAyk16REro
         xoNrHIiGNXjNyfme5zoYVM4qunA7SKtAHt4+7xbwN99JfRfr+0zyv4tBqAu3cFQzXU1a
         EB1+dbs31eoscGF4r+hGsTd/vMEs5Ogr5kjN8ySOU6uqUnpJF/748mpuq72UlVlFg37g
         +edXoy6dSwIgl2w96604OEbP5hQGB3Oe1o/pZYgQIo5BU0cp6S8JGCnAGMUODLbqV4qW
         6GLCEJgRH6pNBQvT4EoLhdQ34HlRjTMl948qynOjCz3z/J/wy5FCKo3odgh1s0zRZLA/
         ewCw==
X-Gm-Message-State: ABy/qLaUkftqqpNK4FCe4UkUsp7939a40SdWjJjVgGS44ImyM2PJ3k2h
	1GCtqjhtpzjbLiGax3nYqwg=
X-Google-Smtp-Source: APBJJlGLJI7wOi/cAC+4887p5NxC1O6Jx9Z8tS0dkQscAqT6FlNcjE8alBIW2Z/pk8K3FJGLN+6VNQ==
X-Received: by 2002:a25:ac99:0:b0:d35:ee7e:349 with SMTP id x25-20020a25ac99000000b00d35ee7e0349mr1328711ybi.1.1690823074854;
        Mon, 31 Jul 2023 10:04:34 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 28/31] sparc64: Convert various functions to use ptdescs
Date: Mon, 31 Jul 2023 10:03:29 -0700
Message-Id: <20230731170332.69404-29-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/sparc/mm/init_64.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index 0d7fd793924c..9a63a3e08e40 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -2893,14 +2893,15 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
 
 pgtable_t pte_alloc_one(struct mm_struct *mm)
 {
-	struct page *page = alloc_page(GFP_KERNEL | __GFP_ZERO);
-	if (!page)
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL | __GFP_ZERO, 0);
+
+	if (!ptdesc)
 		return NULL;
-	if (!pgtable_pte_page_ctor(page)) {
-		__free_page(page);
+	if (!pagetable_pte_ctor(ptdesc)) {
+		pagetable_free(ptdesc);
 		return NULL;
 	}
-	return (pte_t *) page_address(page);
+	return ptdesc_address(ptdesc);
 }
 
 void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
@@ -2910,10 +2911,10 @@ void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
 
 static void __pte_free(pgtable_t pte)
 {
-	struct page *page = virt_to_page(pte);
+	struct ptdesc *ptdesc = virt_to_ptdesc(pte);
 
-	pgtable_pte_page_dtor(page);
-	__free_page(page);
+	pagetable_pte_dtor(ptdesc);
+	pagetable_free(ptdesc);
 }
 
 void pte_free(struct mm_struct *mm, pgtable_t pte)
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:07:52 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:07:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573320.897987 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWN6-0003Hz-7L; Mon, 31 Jul 2023 17:07:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573320.897987; Mon, 31 Jul 2023 17:07:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWN5-0003Go-TU; Mon, 31 Jul 2023 17:07:51 +0000
Received: by outflank-mailman (input) for mailman id 573320;
 Mon, 31 Jul 2023 17:07:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJo-0000C0-BL
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:28 +0000
Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com
 [2607:f8b0:4864:20::b33])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4e6019b4-2fc4-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 19:04:27 +0200 (CEST)
Received: by mail-yb1-xb33.google.com with SMTP id
 3f1490d57ef6-d16639e16e6so3788726276.3
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:27 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4e6019b4-2fc4-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823066; x=1691427866;
        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=DOzSOLTncjJXn0AvJQqE6PD7zrtBe8MIuyz5zw7TzDY=;
        b=f6adceAKsPvui0l7VSUiRnWj+VnC8V29gRyKPW/KXba4L11duKnXDkkl9h+DOUEe82
         /+uFEmkPUA7pfwVfanOSjRVPX3wfPLVY3FZPvGi3VyyqlsToEnHzzIylic2yHwlsDcH3
         W3JP9R5mJExPbkEH69AGyH0gizw4AowCqMoujs5LGqqMzZnJK/dPFOzk0elvmdxwimx1
         zHO/RBskNqXdsMC9zN3IXGN1/Qatnc3KRzwrgmn/b1CAPxkc6smcQgcPCS+F4TUkpdDt
         7sG/wG+FEbTCZLXxJ46EURhFx988hfZQfl6N1HhCumdsXb4Bqj21mhmFktRwf8yfQcyF
         sVPg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823066; x=1691427866;
        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=DOzSOLTncjJXn0AvJQqE6PD7zrtBe8MIuyz5zw7TzDY=;
        b=XRuMWbP4d99OYfo5ZzjXAXeMo1Qc+kTamUOL6YYJ+B1v8kRv/zP5n5EZ/9P8/Hk3NT
         8Qv78NGc4zgQrqJ0aqvzNv/RDw2XcCwZf0VtZZ50yom5N0MMI5hxRLItX8nJSXDIdCDy
         +AfY12nnQRL1YY+VRxilfQmgkFh5DLX3GJ1fFjjlQKf2teTwpSuXEd2pXnYygbj2Pnqr
         SNNUqUDRvubtcdcfGcy/98HbjcOrbryTEuRndonR2Ofrs72emGs69LCqfpo5WbRehL61
         5J3OeOb1zo3w1v2xtg9FPouZsrnaD1HfOJACZyoJgHKee3jNSUqKCUfxoAPc5wlWeY0P
         3mtQ==
X-Gm-Message-State: ABy/qLbVoghxRQ/7buBJTLDIka5myKkdSC+DV1dApWntSSD4UKFm1EWx
	O6W8UjsSVv86gcfs0o57v1Y=
X-Google-Smtp-Source: APBJJlE4T05ogdyrjIbBXTs0RpkDVTPnYG3Ig2UA6lH+KuSSQ9n98n0kBdmmWfFoFgc9s9NgVox+UA==
X-Received: by 2002:a25:ada4:0:b0:d0a:8973:b1c with SMTP id z36-20020a25ada4000000b00d0a89730b1cmr247583ybi.12.1690823066447;
        Mon, 31 Jul 2023 10:04:26 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>,
	Dinh Nguyen <dinguyen@kernel.org>
Subject: [PATCH mm-unstable v8 24/31] nios2: Convert __pte_free_tlb() to use ptdescs
Date: Mon, 31 Jul 2023 10:03:25 -0700
Message-Id: <20230731170332.69404-25-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
Acked-by: Dinh Nguyen <dinguyen@kernel.org>
---
 arch/nios2/include/asm/pgalloc.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/nios2/include/asm/pgalloc.h b/arch/nios2/include/asm/pgalloc.h
index ecd1657bb2ce..ce6bb8e74271 100644
--- a/arch/nios2/include/asm/pgalloc.h
+++ b/arch/nios2/include/asm/pgalloc.h
@@ -28,10 +28,10 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
 
 extern pgd_t *pgd_alloc(struct mm_struct *mm);
 
-#define __pte_free_tlb(tlb, pte, addr)				\
-	do {							\
-		pgtable_pte_page_dtor(pte);			\
-		tlb_remove_page((tlb), (pte));			\
+#define __pte_free_tlb(tlb, pte, addr)					\
+	do {								\
+		pagetable_pte_dtor(page_ptdesc(pte));			\
+		tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte)));	\
 	} while (0)
 
 #endif /* _ASM_NIOS2_PGALLOC_H */
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:07:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:07:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573328.898001 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWN8-00049A-I4; Mon, 31 Jul 2023 17:07:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573328.898001; Mon, 31 Jul 2023 17:07:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWN8-00047e-DO; Mon, 31 Jul 2023 17:07:54 +0000
Received: by outflank-mailman (input) for mailman id 573328;
 Mon, 31 Jul 2023 17:07:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJk-0000C0-5B
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:24 +0000
Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com
 [2607:f8b0:4864:20::b2c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4bd67abf-2fc4-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 19:04:23 +0200 (CEST)
Received: by mail-yb1-xb2c.google.com with SMTP id
 3f1490d57ef6-d1c988afebfso5035553276.2
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:23 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4bd67abf-2fc4-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823062; x=1691427862;
        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=PAg5qbCpsu4QeXC2CiYcNVSx9jEaugPagVbNncebk84=;
        b=SHsXJcCphZA5Q35Cm4n8w8dfqoRXj5UgYy95JNrPo0e5bckV50c6jH6lc7xhgkpfP3
         LRpLcUVAnaJQDC2fy0cxRx/Sn5zDPk8HnSNMQ1nYTCeGYSjmp0NxEGU8+6AK0ydnCrXo
         B7huJXPBvLhjK9+NPSK/tK4mNxy6xmRWTGSAELwAb2C+WQkmM4czVeiClgF6xCu0dSVp
         valgcEUnr6tm5e6DmJ0wAnOlYJfOWUIH/75eKq+AUDCd7EFCR4LkmTx5JiojrlAh0iKl
         eJnCwnRGsblWEjcAQ70JqqSW1FXw0LcJDzZAr4AakE8Utv/Am0i5qwYjY31XRJqcgYKL
         0oHg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823062; x=1691427862;
        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=PAg5qbCpsu4QeXC2CiYcNVSx9jEaugPagVbNncebk84=;
        b=TTZN5PXXXmiG73MM2FXtkqgQjndb8zwtD+E1JqsktyogcAodmzEw/Lr1PlRi9DM5Xs
         XyJuCmxsEQaLs/qWMMGDeV9t3RoHbHYE832GaeIogGj2eXJgeCmE5tD0bJwvCua7DyMk
         RQ4xlgVKcxu6OsVwmYVBBGxMUiIpX9dzCYc9dZDl3G4yhD6+VRtCJekCawJXpx+wPxcK
         lm6BRutWUKe5lhvSxAqNCwd0ZVWK5/w/InQDL9BCIaQ3b1bJDm2bN+rFMzIIQpdTmbTL
         p9O/nGMLY/4R4aPlLz1d0ff6qGi1AP5StYXhigT1YwwHArKSCP9VwP5rIcZSzgH8DQt9
         7J9g==
X-Gm-Message-State: ABy/qLYnouSkmfMtYz/J/EdoTOr/wrckjysCnw2AxZCgPz7BLeCHfmrP
	SdoA6pnMkbAapUHLoSAmqxM=
X-Google-Smtp-Source: APBJJlEK1MlTqpIOoxn7Ar4pWAsbFPg2CXwhdETyczjwWIQSRY3cc8fD4iPGtAg+uKqG+zuVrd170A==
X-Received: by 2002:a25:ad4f:0:b0:d13:80a0:b428 with SMTP id l15-20020a25ad4f000000b00d1380a0b428mr10830361ybe.3.1690823062269;
        Mon, 31 Jul 2023 10:04:22 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH mm-unstable v8 22/31] m68k: Convert various functions to use ptdescs
Date: Mon, 31 Jul 2023 10:03:23 -0700
Message-Id: <20230731170332.69404-23-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

Some of the functions use the *get*page*() helper functions. Convert
these to use pagetable_alloc() and ptdesc_address() instead to help
standardize page tables further.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/include/asm/mcf_pgalloc.h  | 47 ++++++++++++++--------------
 arch/m68k/include/asm/sun3_pgalloc.h |  8 ++---
 arch/m68k/mm/motorola.c              |  4 +--
 3 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/arch/m68k/include/asm/mcf_pgalloc.h b/arch/m68k/include/asm/mcf_pgalloc.h
index 5c2c0a864524..302c5bf67179 100644
--- a/arch/m68k/include/asm/mcf_pgalloc.h
+++ b/arch/m68k/include/asm/mcf_pgalloc.h
@@ -5,22 +5,22 @@
 #include <asm/tlb.h>
 #include <asm/tlbflush.h>
 
-extern inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
+static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
 {
-	free_page((unsigned long) pte);
+	pagetable_free(virt_to_ptdesc(pte));
 }
 
 extern const char bad_pmd_string[];
 
-extern inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
+static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
 {
-	unsigned long page = __get_free_page(GFP_DMA);
+	struct ptdesc *ptdesc = pagetable_alloc((GFP_DMA | __GFP_ZERO) &
+			~__GFP_HIGHMEM, 0);
 
-	if (!page)
+	if (!ptdesc)
 		return NULL;
 
-	memset((void *)page, 0, PAGE_SIZE);
-	return (pte_t *) (page);
+	return ptdesc_address(ptdesc);
 }
 
 extern inline pmd_t *pmd_alloc_kernel(pgd_t *pgd, unsigned long address)
@@ -35,36 +35,34 @@ extern inline pmd_t *pmd_alloc_kernel(pgd_t *pgd, unsigned long address)
 static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pgtable,
 				  unsigned long address)
 {
-	struct page *page = virt_to_page(pgtable);
+	struct ptdesc *ptdesc = virt_to_ptdesc(pgtable);
 
-	pgtable_pte_page_dtor(page);
-	__free_page(page);
+	pagetable_pte_dtor(ptdesc);
+	pagetable_free(ptdesc);
 }
 
 static inline pgtable_t pte_alloc_one(struct mm_struct *mm)
 {
-	struct page *page = alloc_pages(GFP_DMA, 0);
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_DMA | __GFP_ZERO, 0);
 	pte_t *pte;
 
-	if (!page)
+	if (!ptdesc)
 		return NULL;
-	if (!pgtable_pte_page_ctor(page)) {
-		__free_page(page);
+	if (!pagetable_pte_ctor(ptdesc)) {
+		pagetable_free(ptdesc);
 		return NULL;
 	}
 
-	pte = page_address(page);
-	clear_page(pte);
-
+	pte = ptdesc_address(ptdesc);
 	return pte;
 }
 
 static inline void pte_free(struct mm_struct *mm, pgtable_t pgtable)
 {
-	struct page *page = virt_to_page(pgtable);
+	struct ptdesc *ptdesc = virt_to_ptdesc(pgtable);
 
-	pgtable_pte_page_dtor(page);
-	__free_page(page);
+	pagetable_pte_dtor(ptdesc);
+	pagetable_free(ptdesc);
 }
 
 /*
@@ -75,16 +73,19 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pgtable)
 
 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 {
-	free_page((unsigned long) pgd);
+	pagetable_free(virt_to_ptdesc(pgd));
 }
 
 static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 {
 	pgd_t *new_pgd;
+	struct ptdesc *ptdesc = pagetable_alloc((GFP_DMA | __GFP_NOWARN) &
+			~__GFP_HIGHMEM, 0);
 
-	new_pgd = (pgd_t *)__get_free_page(GFP_DMA | __GFP_NOWARN);
-	if (!new_pgd)
+	if (!ptdesc)
 		return NULL;
+	new_pgd = ptdesc_address(ptdesc);
+
 	memcpy(new_pgd, swapper_pg_dir, PTRS_PER_PGD * sizeof(pgd_t));
 	memset(new_pgd, 0, PAGE_OFFSET >> PGDIR_SHIFT);
 	return new_pgd;
diff --git a/arch/m68k/include/asm/sun3_pgalloc.h b/arch/m68k/include/asm/sun3_pgalloc.h
index 198036aff519..ff48573db2c0 100644
--- a/arch/m68k/include/asm/sun3_pgalloc.h
+++ b/arch/m68k/include/asm/sun3_pgalloc.h
@@ -17,10 +17,10 @@
 
 extern const char bad_pmd_string[];
 
-#define __pte_free_tlb(tlb,pte,addr)			\
-do {							\
-	pgtable_pte_page_dtor(pte);			\
-	tlb_remove_page((tlb), pte);			\
+#define __pte_free_tlb(tlb, pte, addr)				\
+do {								\
+	pagetable_pte_dtor(page_ptdesc(pte));			\
+	tlb_remove_page_ptdesc((tlb), page_ptdesc(pte));	\
 } while (0)
 
 static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index c75984e2d86b..594575a0780c 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -161,7 +161,7 @@ void *get_pointer_table(int type)
 			 * m68k doesn't have SPLIT_PTE_PTLOCKS for not having
 			 * SMP.
 			 */
-			pgtable_pte_page_ctor(virt_to_page(page));
+			pagetable_pte_ctor(virt_to_ptdesc(page));
 		}
 
 		mmu_page_ctor(page);
@@ -201,7 +201,7 @@ int free_pointer_table(void *table, int type)
 		list_del(dp);
 		mmu_page_dtor((void *)page);
 		if (type == TABLE_PTE)
-			pgtable_pte_page_dtor(virt_to_page((void *)page));
+			pagetable_pte_dtor(virt_to_ptdesc((void *)page));
 		free_page (page);
 		return 1;
 	} else if (ptable_list[type].next != dp) {
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:07:56 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:07:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573335.898011 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWNA-0004W4-0L; Mon, 31 Jul 2023 17:07:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573335.898011; Mon, 31 Jul 2023 17:07:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWN9-0004VC-Rl; Mon, 31 Jul 2023 17:07:55 +0000
Received: by outflank-mailman (input) for mailman id 573335;
 Mon, 31 Jul 2023 17:07:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJY-0000C0-QT
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:12 +0000
Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com
 [2607:f8b0:4864:20::232])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 448c5f8f-2fc4-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 19:04:11 +0200 (CEST)
Received: by mail-oi1-x232.google.com with SMTP id
 5614622812f47-3a6f3ef3155so2457034b6e.1
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:11 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.08
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:09 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 448c5f8f-2fc4-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823050; x=1691427850;
        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=bBkB4loM/Mt006iaxsYk7j8UnaAx8a9/NTd5FkPootg=;
        b=LaN2Z5cA1g3QHkmu1yTAPuZ+gTgDQXRJQVZ3q2bju3+OXPPdz1JjIqLJAjDfCBEgH9
         7Ttgf9+xGINvOvqPbjkBBA+kiz1r/307hJB3HQPBTO+grLv6cLtOMVUiOQ3YqTtB3VhG
         DR1MJfbiJ1WEF5YzFYY4ZtTmPxDuFx+JwcfSUJ/HGuVXlEGvoPiVmTgBFyMwXloIHduF
         XN+NqGvI2ErntPxzKW8shpaaIArfirugcPlVxrvDp/YXtjJboT3jqZnutkk3sNOVqTbe
         4MBegStktcVwlYOqkBrub1drFP/tUKuFSEW2ULzr9NM6cvzKis6pkazSEIpoiDyQTv+z
         2r9Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823050; x=1691427850;
        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=bBkB4loM/Mt006iaxsYk7j8UnaAx8a9/NTd5FkPootg=;
        b=FpyOZ3PxOJ7S92KSYYFbHVUgeDDA9duXkqEYw35uHCT6lpeD79aN99dlRONY/VJFE0
         DZ0d0xnLQ2MEIf2H+kmpB+ySK+k1Cwi4GkxfSKJmlXCt2kqnb21kXxy7MFnDjeARoebr
         uDTyeq3Fvtgj7pVFrHHnJbL4+GyjtKTrm8AOSy6peoUtpYJGXjzbHDrte26TQMVjl9r7
         ihj8P5DHQOoW0s0X1ZZ496wJUG6bv7+zlUAKdZiQpfS/G1kTBOKpq4XrBJ+yxyD4r7GA
         rHb5T0cDmiFnBQaEzYG0o+7nnyFzOM6TA0SrW1i7aZ+Hv6KoMCqAAMwQTO1SZI36QOlT
         P5SQ==
X-Gm-Message-State: ABy/qLbzrPFnhPvZ2rhHdmYz58XU3/htz9ZNXb4Yvmdsx/t0X+3ZG3JO
	m6RhtZlwZvsvY5DrYN3DBZ60TCipE6Vt+g==
X-Google-Smtp-Source: APBJJlGId6OsNROK0Rrfftpz1UcSUo2PPmBi9KGG5ymdHpGiVY5jldwYwkHVkIkpJVs885EQKvaPug==
X-Received: by 2002:a05:6808:2a7a:b0:3a3:ffb7:a28 with SMTP id fu26-20020a0568082a7a00b003a3ffb70a28mr10979580oib.45.1690823050042;
        Mon, 31 Jul 2023 10:04:10 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>
Subject: [PATCH mm-unstable v8 16/31] pgalloc: Convert various functions to use ptdescs
Date: Mon, 31 Jul 2023 10:03:17 -0700
Message-Id: <20230731170332.69404-17-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

Some of the functions use the *get*page*() helper functions. Convert
these to use pagetable_alloc() and ptdesc_address() instead to help
standardize page tables further.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
---
 include/asm-generic/pgalloc.h | 88 +++++++++++++++++++++--------------
 1 file changed, 52 insertions(+), 36 deletions(-)

diff --git a/include/asm-generic/pgalloc.h b/include/asm-generic/pgalloc.h
index a7cf825befae..c75d4a753849 100644
--- a/include/asm-generic/pgalloc.h
+++ b/include/asm-generic/pgalloc.h
@@ -8,7 +8,7 @@
 #define GFP_PGTABLE_USER	(GFP_PGTABLE_KERNEL | __GFP_ACCOUNT)
 
 /**
- * __pte_alloc_one_kernel - allocate a page for PTE-level kernel page table
+ * __pte_alloc_one_kernel - allocate memory for a PTE-level kernel page table
  * @mm: the mm_struct of the current context
  *
  * This function is intended for architectures that need
@@ -18,12 +18,17 @@
  */
 static inline pte_t *__pte_alloc_one_kernel(struct mm_struct *mm)
 {
-	return (pte_t *)__get_free_page(GFP_PGTABLE_KERNEL);
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_PGTABLE_KERNEL &
+			~__GFP_HIGHMEM, 0);
+
+	if (!ptdesc)
+		return NULL;
+	return ptdesc_address(ptdesc);
 }
 
 #ifndef __HAVE_ARCH_PTE_ALLOC_ONE_KERNEL
 /**
- * pte_alloc_one_kernel - allocate a page for PTE-level kernel page table
+ * pte_alloc_one_kernel - allocate memory for a PTE-level kernel page table
  * @mm: the mm_struct of the current context
  *
  * Return: pointer to the allocated memory or %NULL on error
@@ -35,40 +40,40 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
 #endif
 
 /**
- * pte_free_kernel - free PTE-level kernel page table page
+ * pte_free_kernel - free PTE-level kernel page table memory
  * @mm: the mm_struct of the current context
  * @pte: pointer to the memory containing the page table
  */
 static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
 {
-	free_page((unsigned long)pte);
+	pagetable_free(virt_to_ptdesc(pte));
 }
 
 /**
- * __pte_alloc_one - allocate a page for PTE-level user page table
+ * __pte_alloc_one - allocate memory for a PTE-level user page table
  * @mm: the mm_struct of the current context
  * @gfp: GFP flags to use for the allocation
  *
- * Allocates a page and runs the pgtable_pte_page_ctor().
+ * Allocate memory for a page table and ptdesc and runs pagetable_pte_ctor().
  *
  * This function is intended for architectures that need
  * anything beyond simple page allocation or must have custom GFP flags.
  *
- * Return: `struct page` initialized as page table or %NULL on error
+ * Return: `struct page` referencing the ptdesc or %NULL on error
  */
 static inline pgtable_t __pte_alloc_one(struct mm_struct *mm, gfp_t gfp)
 {
-	struct page *pte;
+	struct ptdesc *ptdesc;
 
-	pte = alloc_page(gfp);
-	if (!pte)
+	ptdesc = pagetable_alloc(gfp, 0);
+	if (!ptdesc)
 		return NULL;
-	if (!pgtable_pte_page_ctor(pte)) {
-		__free_page(pte);
+	if (!pagetable_pte_ctor(ptdesc)) {
+		pagetable_free(ptdesc);
 		return NULL;
 	}
 
-	return pte;
+	return ptdesc_page(ptdesc);
 }
 
 #ifndef __HAVE_ARCH_PTE_ALLOC_ONE
@@ -76,9 +81,9 @@ static inline pgtable_t __pte_alloc_one(struct mm_struct *mm, gfp_t gfp)
  * pte_alloc_one - allocate a page for PTE-level user page table
  * @mm: the mm_struct of the current context
  *
- * Allocates a page and runs the pgtable_pte_page_ctor().
+ * Allocate memory for a page table and ptdesc and runs pagetable_pte_ctor().
  *
- * Return: `struct page` initialized as page table or %NULL on error
+ * Return: `struct page` referencing the ptdesc or %NULL on error
  */
 static inline pgtable_t pte_alloc_one(struct mm_struct *mm)
 {
@@ -92,14 +97,16 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm)
  */
 
 /**
- * pte_free - free PTE-level user page table page
+ * pte_free - free PTE-level user page table memory
  * @mm: the mm_struct of the current context
- * @pte_page: the `struct page` representing the page table
+ * @pte_page: the `struct page` referencing the ptdesc
  */
 static inline void pte_free(struct mm_struct *mm, struct page *pte_page)
 {
-	pgtable_pte_page_dtor(pte_page);
-	__free_page(pte_page);
+	struct ptdesc *ptdesc = page_ptdesc(pte_page);
+
+	pagetable_pte_dtor(ptdesc);
+	pagetable_free(ptdesc);
 }
 
 
@@ -107,10 +114,11 @@ static inline void pte_free(struct mm_struct *mm, struct page *pte_page)
 
 #ifndef __HAVE_ARCH_PMD_ALLOC_ONE
 /**
- * pmd_alloc_one - allocate a page for PMD-level page table
+ * pmd_alloc_one - allocate memory for a PMD-level page table
  * @mm: the mm_struct of the current context
  *
- * Allocates a page and runs the pgtable_pmd_page_ctor().
+ * Allocate memory for a page table and ptdesc and runs pagetable_pmd_ctor().
+ *
  * Allocations use %GFP_PGTABLE_USER in user context and
  * %GFP_PGTABLE_KERNEL in kernel context.
  *
@@ -118,28 +126,30 @@ static inline void pte_free(struct mm_struct *mm, struct page *pte_page)
  */
 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
 {
-	struct page *page;
+	struct ptdesc *ptdesc;
 	gfp_t gfp = GFP_PGTABLE_USER;
 
 	if (mm == &init_mm)
 		gfp = GFP_PGTABLE_KERNEL;
-	page = alloc_page(gfp);
-	if (!page)
+	ptdesc = pagetable_alloc(gfp, 0);
+	if (!ptdesc)
 		return NULL;
-	if (!pgtable_pmd_page_ctor(page)) {
-		__free_page(page);
+	if (!pagetable_pmd_ctor(ptdesc)) {
+		pagetable_free(ptdesc);
 		return NULL;
 	}
-	return (pmd_t *)page_address(page);
+	return ptdesc_address(ptdesc);
 }
 #endif
 
 #ifndef __HAVE_ARCH_PMD_FREE
 static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
 {
+	struct ptdesc *ptdesc = virt_to_ptdesc(pmd);
+
 	BUG_ON((unsigned long)pmd & (PAGE_SIZE-1));
-	pgtable_pmd_page_dtor(virt_to_page(pmd));
-	free_page((unsigned long)pmd);
+	pagetable_pmd_dtor(ptdesc);
+	pagetable_free(ptdesc);
 }
 #endif
 
@@ -150,19 +160,25 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
 static inline pud_t *__pud_alloc_one(struct mm_struct *mm, unsigned long addr)
 {
 	gfp_t gfp = GFP_PGTABLE_USER;
+	struct ptdesc *ptdesc;
 
 	if (mm == &init_mm)
 		gfp = GFP_PGTABLE_KERNEL;
-	return (pud_t *)get_zeroed_page(gfp);
+	gfp &= ~__GFP_HIGHMEM;
+
+	ptdesc = pagetable_alloc(gfp, 0);
+	if (!ptdesc)
+		return NULL;
+	return ptdesc_address(ptdesc);
 }
 
 #ifndef __HAVE_ARCH_PUD_ALLOC_ONE
 /**
- * pud_alloc_one - allocate a page for PUD-level page table
+ * pud_alloc_one - allocate memory for a PUD-level page table
  * @mm: the mm_struct of the current context
  *
- * Allocates a page using %GFP_PGTABLE_USER for user context and
- * %GFP_PGTABLE_KERNEL for kernel context.
+ * Allocate memory for a page table using %GFP_PGTABLE_USER for user context
+ * and %GFP_PGTABLE_KERNEL for kernel context.
  *
  * Return: pointer to the allocated memory or %NULL on error
  */
@@ -175,7 +191,7 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
 static inline void __pud_free(struct mm_struct *mm, pud_t *pud)
 {
 	BUG_ON((unsigned long)pud & (PAGE_SIZE-1));
-	free_page((unsigned long)pud);
+	pagetable_free(virt_to_ptdesc(pud));
 }
 
 #ifndef __HAVE_ARCH_PUD_FREE
@@ -190,7 +206,7 @@ static inline void pud_free(struct mm_struct *mm, pud_t *pud)
 #ifndef __HAVE_ARCH_PGD_FREE
 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 {
-	free_page((unsigned long)pgd);
+	pagetable_free(virt_to_ptdesc(pgd));
 }
 #endif
 
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:07:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:07:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573346.898021 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWNB-0004wX-Th; Mon, 31 Jul 2023 17:07:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573346.898021; Mon, 31 Jul 2023 17:07:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWNB-0004w8-Jr; Mon, 31 Jul 2023 17:07:57 +0000
Received: by outflank-mailman (input) for mailman id 573346;
 Mon, 31 Jul 2023 17:07:56 +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
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJV-0008Np-Vj
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:10 +0000
Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com
 [2607:f8b0:4864:20::b2c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 423e36f7-2fc4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:04:07 +0200 (CEST)
Received: by mail-yb1-xb2c.google.com with SMTP id
 3f1490d57ef6-bff89873d34so3787200276.2
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:07 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 423e36f7-2fc4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823046; x=1691427846;
        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=HTuFXf3k0XF+iUx9+PEFpsWUTVtSma2QbqtalFKJ0Mg=;
        b=cx5NSYXGw/nEODo1q8IuZLwgSdQlsWmCz9Uda9Dyi8oRHSANf17EUEN0NghPTleOQ3
         qRF48K8p624S98UE+sqFLMwi4qHPy4Rlsyaop6e6rdx3sJ34ygM/kCGiofbfTtRy/uWK
         pDN6oLN/cg8l3NaqiO7dnhksZdUYELR/ROOwzhaxflR5OfGnWor4R48XoGgh+uCnCZdF
         PKieR+/k4xNk2dNGBUN9dU3cy+OrLP5ZMuAIPRNDi4sUHgPh9wIPf3TDs2wmKF/PZAwQ
         nES3iQYw3eBJbEzMwTf0ELg/p8LacwujaaTD+K4WXJHDMBVzHT5fmzh1wilIxvkms+eF
         wbtQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823046; x=1691427846;
        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=HTuFXf3k0XF+iUx9+PEFpsWUTVtSma2QbqtalFKJ0Mg=;
        b=MRGysZet2PnaJoCBD8f5ownlQLVeg6s5tjVaLTqMEiUC8+s6gzY1ftVEktElWMxGYD
         jZs2vweLxgvXy6UkyN13+qXy9MPuVr97cQIxW1X2sAWn/gwCOphgtprTK4ocrzx1iL72
         O0hqZz6gR7Ytx7fi2RlqfYOig5FRkFa86b4mwdAd0DShEdcVOb/XoaLsCLsIBGTEq07H
         yQhtFpRpJXKXQAUYIiwpTGU2BUgQcN0xnNHG7bo0PgAWnMTfIaNwSr3yPWOTFmI0Y/je
         ymKFt/bSrBbDOMLYtTe2TTaSrDYfpgRwI0B+F8nvk5Ef8AV99lAPm2q43tpcCkskXuhr
         suFA==
X-Gm-Message-State: ABy/qLaqi6V5qLNVmuJlzQN4U/sbzLqEJgHzr4EP3ha8WKse90WAUyz3
	D941bWrX9F5UjdofYCZuJII=
X-Google-Smtp-Source: APBJJlE0pJgGb9r0Cjp+ishPbTK2US/P9OxpClMj5kb5Y2tgK3QjOUshu26VL3O5SZ94YA54YpnZpA==
X-Received: by 2002:a25:8385:0:b0:d17:240c:2b40 with SMTP id t5-20020a258385000000b00d17240c2b40mr6897784ybk.63.1690823045978;
        Mon, 31 Jul 2023 10:04:05 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	David Hildenbrand <david@redhat.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 14/31] s390: Convert various pgalloc functions to use ptdescs
Date: Mon, 31 Jul 2023 10:03:15 -0700
Message-Id: <20230731170332.69404-15-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

Some of the functions use the *get*page*() helper functions. Convert
these to use pagetable_alloc() and ptdesc_address() instead to help
standardize page tables further.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/s390/include/asm/pgalloc.h |   4 +-
 arch/s390/include/asm/tlb.h     |   4 +-
 arch/s390/mm/pgalloc.c          | 128 ++++++++++++++++----------------
 3 files changed, 69 insertions(+), 67 deletions(-)

diff --git a/arch/s390/include/asm/pgalloc.h b/arch/s390/include/asm/pgalloc.h
index 89a9d5ef94f8..376b4b23bdaa 100644
--- a/arch/s390/include/asm/pgalloc.h
+++ b/arch/s390/include/asm/pgalloc.h
@@ -86,7 +86,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
 	if (!table)
 		return NULL;
 	crst_table_init(table, _SEGMENT_ENTRY_EMPTY);
-	if (!pgtable_pmd_page_ctor(virt_to_page(table))) {
+	if (!pagetable_pmd_ctor(virt_to_ptdesc(table))) {
 		crst_table_free(mm, table);
 		return NULL;
 	}
@@ -97,7 +97,7 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
 {
 	if (mm_pmd_folded(mm))
 		return;
-	pgtable_pmd_page_dtor(virt_to_page(pmd));
+	pagetable_pmd_dtor(virt_to_ptdesc(pmd));
 	crst_table_free(mm, (unsigned long *) pmd);
 }
 
diff --git a/arch/s390/include/asm/tlb.h b/arch/s390/include/asm/tlb.h
index b91f4a9b044c..383b1f91442c 100644
--- a/arch/s390/include/asm/tlb.h
+++ b/arch/s390/include/asm/tlb.h
@@ -89,12 +89,12 @@ static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd,
 {
 	if (mm_pmd_folded(tlb->mm))
 		return;
-	pgtable_pmd_page_dtor(virt_to_page(pmd));
+	pagetable_pmd_dtor(virt_to_ptdesc(pmd));
 	__tlb_adjust_range(tlb, address, PAGE_SIZE);
 	tlb->mm->context.flush_mm = 1;
 	tlb->freed_tables = 1;
 	tlb->cleared_puds = 1;
-	tlb_remove_table(tlb, pmd);
+	tlb_remove_ptdesc(tlb, pmd);
 }
 
 /*
diff --git a/arch/s390/mm/pgalloc.c b/arch/s390/mm/pgalloc.c
index d7374add7820..07fc660a24aa 100644
--- a/arch/s390/mm/pgalloc.c
+++ b/arch/s390/mm/pgalloc.c
@@ -43,17 +43,17 @@ __initcall(page_table_register_sysctl);
 
 unsigned long *crst_table_alloc(struct mm_struct *mm)
 {
-	struct page *page = alloc_pages(GFP_KERNEL, CRST_ALLOC_ORDER);
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL, CRST_ALLOC_ORDER);
 
-	if (!page)
+	if (!ptdesc)
 		return NULL;
-	arch_set_page_dat(page, CRST_ALLOC_ORDER);
-	return (unsigned long *) page_to_virt(page);
+	arch_set_page_dat(ptdesc_page(ptdesc), CRST_ALLOC_ORDER);
+	return (unsigned long *) ptdesc_to_virt(ptdesc);
 }
 
 void crst_table_free(struct mm_struct *mm, unsigned long *table)
 {
-	free_pages((unsigned long)table, CRST_ALLOC_ORDER);
+	pagetable_free(virt_to_ptdesc(table));
 }
 
 static void __crst_table_upgrade(void *arg)
@@ -140,21 +140,21 @@ static inline unsigned int atomic_xor_bits(atomic_t *v, unsigned int bits)
 
 struct page *page_table_alloc_pgste(struct mm_struct *mm)
 {
-	struct page *page;
+	struct ptdesc *ptdesc;
 	u64 *table;
 
-	page = alloc_page(GFP_KERNEL);
-	if (page) {
-		table = (u64 *)page_to_virt(page);
+	ptdesc = pagetable_alloc(GFP_KERNEL, 0);
+	if (ptdesc) {
+		table = (u64 *)ptdesc_to_virt(ptdesc);
 		memset64(table, _PAGE_INVALID, PTRS_PER_PTE);
 		memset64(table + PTRS_PER_PTE, 0, PTRS_PER_PTE);
 	}
-	return page;
+	return ptdesc_page(ptdesc);
 }
 
 void page_table_free_pgste(struct page *page)
 {
-	__free_page(page);
+	pagetable_free(page_ptdesc(page));
 }
 
 #endif /* CONFIG_PGSTE */
@@ -242,7 +242,7 @@ void page_table_free_pgste(struct page *page)
 unsigned long *page_table_alloc(struct mm_struct *mm)
 {
 	unsigned long *table;
-	struct page *page;
+	struct ptdesc *ptdesc;
 	unsigned int mask, bit;
 
 	/* Try to get a fragment of a 4K page as a 2K page table */
@@ -250,9 +250,9 @@ unsigned long *page_table_alloc(struct mm_struct *mm)
 		table = NULL;
 		spin_lock_bh(&mm->context.lock);
 		if (!list_empty(&mm->context.pgtable_list)) {
-			page = list_first_entry(&mm->context.pgtable_list,
-						struct page, lru);
-			mask = atomic_read(&page->_refcount) >> 24;
+			ptdesc = list_first_entry(&mm->context.pgtable_list,
+						struct ptdesc, pt_list);
+			mask = atomic_read(&ptdesc->_refcount) >> 24;
 			/*
 			 * The pending removal bits must also be checked.
 			 * Failure to do so might lead to an impossible
@@ -264,13 +264,13 @@ unsigned long *page_table_alloc(struct mm_struct *mm)
 			 */
 			mask = (mask | (mask >> 4)) & 0x03U;
 			if (mask != 0x03U) {
-				table = (unsigned long *) page_to_virt(page);
+				table = (unsigned long *) ptdesc_to_virt(ptdesc);
 				bit = mask & 1;		/* =1 -> second 2K */
 				if (bit)
 					table += PTRS_PER_PTE;
-				atomic_xor_bits(&page->_refcount,
+				atomic_xor_bits(&ptdesc->_refcount,
 							0x01U << (bit + 24));
-				list_del_init(&page->lru);
+				list_del_init(&ptdesc->pt_list);
 			}
 		}
 		spin_unlock_bh(&mm->context.lock);
@@ -278,28 +278,28 @@ unsigned long *page_table_alloc(struct mm_struct *mm)
 			return table;
 	}
 	/* Allocate a fresh page */
-	page = alloc_page(GFP_KERNEL);
-	if (!page)
+	ptdesc = pagetable_alloc(GFP_KERNEL, 0);
+	if (!ptdesc)
 		return NULL;
-	if (!pgtable_pte_page_ctor(page)) {
-		__free_page(page);
+	if (!pagetable_pte_ctor(ptdesc)) {
+		pagetable_free(ptdesc);
 		return NULL;
 	}
-	arch_set_page_dat(page, 0);
+	arch_set_page_dat(ptdesc_page(ptdesc), 0);
 	/* Initialize page table */
-	table = (unsigned long *) page_to_virt(page);
+	table = (unsigned long *) ptdesc_to_virt(ptdesc);
 	if (mm_alloc_pgste(mm)) {
 		/* Return 4K page table with PGSTEs */
-		INIT_LIST_HEAD(&page->lru);
-		atomic_xor_bits(&page->_refcount, 0x03U << 24);
+		INIT_LIST_HEAD(&ptdesc->pt_list);
+		atomic_xor_bits(&ptdesc->_refcount, 0x03U << 24);
 		memset64((u64 *)table, _PAGE_INVALID, PTRS_PER_PTE);
 		memset64((u64 *)table + PTRS_PER_PTE, 0, PTRS_PER_PTE);
 	} else {
 		/* Return the first 2K fragment of the page */
-		atomic_xor_bits(&page->_refcount, 0x01U << 24);
+		atomic_xor_bits(&ptdesc->_refcount, 0x01U << 24);
 		memset64((u64 *)table, _PAGE_INVALID, 2 * PTRS_PER_PTE);
 		spin_lock_bh(&mm->context.lock);
-		list_add(&page->lru, &mm->context.pgtable_list);
+		list_add(&ptdesc->pt_list, &mm->context.pgtable_list);
 		spin_unlock_bh(&mm->context.lock);
 	}
 	return table;
@@ -322,19 +322,18 @@ static void page_table_release_check(struct page *page, void *table,
 
 static void pte_free_now(struct rcu_head *head)
 {
-	struct page *page;
+	struct ptdesc *ptdesc;
 
-	page = container_of(head, struct page, rcu_head);
-	pgtable_pte_page_dtor(page);
-	__free_page(page);
+	ptdesc = container_of(head, struct ptdesc, pt_rcu_head);
+	pagetable_pte_dtor(ptdesc);
+	pagetable_free(ptdesc);
 }
 
 void page_table_free(struct mm_struct *mm, unsigned long *table)
 {
 	unsigned int mask, bit, half;
-	struct page *page;
+	struct ptdesc *ptdesc = virt_to_ptdesc(table);
 
-	page = virt_to_page(table);
 	if (!mm_alloc_pgste(mm)) {
 		/* Free 2K page table fragment of a 4K page */
 		bit = ((unsigned long) table & ~PAGE_MASK)/(PTRS_PER_PTE*sizeof(pte_t));
@@ -344,51 +343,50 @@ void page_table_free(struct mm_struct *mm, unsigned long *table)
 		 * will happen outside of the critical section from this
 		 * function or from __tlb_remove_table()
 		 */
-		mask = atomic_xor_bits(&page->_refcount, 0x11U << (bit + 24));
+		mask = atomic_xor_bits(&ptdesc->_refcount, 0x11U << (bit + 24));
 		mask >>= 24;
-		if ((mask & 0x03U) && !PageActive(page)) {
+		if ((mask & 0x03U) && !folio_test_active(ptdesc_folio(ptdesc))) {
 			/*
 			 * Other half is allocated, and neither half has had
 			 * its free deferred: add page to head of list, to make
 			 * this freed half available for immediate reuse.
 			 */
-			list_add(&page->lru, &mm->context.pgtable_list);
+			list_add(&ptdesc->pt_list, &mm->context.pgtable_list);
 		} else {
 			/* If page is on list, now remove it. */
-			list_del_init(&page->lru);
+			list_del_init(&ptdesc->pt_list);
 		}
 		spin_unlock_bh(&mm->context.lock);
-		mask = atomic_xor_bits(&page->_refcount, 0x10U << (bit + 24));
+		mask = atomic_xor_bits(&ptdesc->_refcount, 0x10U << (bit + 24));
 		mask >>= 24;
 		if (mask != 0x00U)
 			return;
 		half = 0x01U << bit;
 	} else {
 		half = 0x03U;
-		mask = atomic_xor_bits(&page->_refcount, 0x03U << 24);
+		mask = atomic_xor_bits(&ptdesc->_refcount, 0x03U << 24);
 		mask >>= 24;
 	}
 
-	page_table_release_check(page, table, half, mask);
-	if (TestClearPageActive(page))
-		call_rcu(&page->rcu_head, pte_free_now);
+	page_table_release_check(ptdesc_page(ptdesc), table, half, mask);
+	if (folio_test_clear_active(ptdesc_folio(ptdesc)))
+		call_rcu(&ptdesc->pt_rcu_head, pte_free_now);
 	else
-		pte_free_now(&page->rcu_head);
+		pte_free_now(&ptdesc->pt_rcu_head);
 }
 
 void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table,
 			 unsigned long vmaddr)
 {
 	struct mm_struct *mm;
-	struct page *page;
 	unsigned int bit, mask;
+	struct ptdesc *ptdesc = virt_to_ptdesc(table);
 
 	mm = tlb->mm;
-	page = virt_to_page(table);
 	if (mm_alloc_pgste(mm)) {
 		gmap_unlink(mm, table, vmaddr);
 		table = (unsigned long *) ((unsigned long)table | 0x03U);
-		tlb_remove_table(tlb, table);
+		tlb_remove_ptdesc(tlb, table);
 		return;
 	}
 	bit = ((unsigned long) table & ~PAGE_MASK) / (PTRS_PER_PTE*sizeof(pte_t));
@@ -398,19 +396,19 @@ void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table,
 	 * outside of the critical section from __tlb_remove_table() or from
 	 * page_table_free()
 	 */
-	mask = atomic_xor_bits(&page->_refcount, 0x11U << (bit + 24));
+	mask = atomic_xor_bits(&ptdesc->_refcount, 0x11U << (bit + 24));
 	mask >>= 24;
-	if ((mask & 0x03U) && !PageActive(page)) {
+	if ((mask & 0x03U) && !folio_test_active(ptdesc_folio(ptdesc))) {
 		/*
 		 * Other half is allocated, and neither half has had
 		 * its free deferred: add page to end of list, to make
 		 * this freed half available for reuse once its pending
 		 * bit has been cleared by __tlb_remove_table().
 		 */
-		list_add_tail(&page->lru, &mm->context.pgtable_list);
+		list_add_tail(&ptdesc->pt_list, &mm->context.pgtable_list);
 	} else {
 		/* If page is on list, now remove it. */
-		list_del_init(&page->lru);
+		list_del_init(&ptdesc->pt_list);
 	}
 	spin_unlock_bh(&mm->context.lock);
 	table = (unsigned long *) ((unsigned long) table | (0x01U << bit));
@@ -421,30 +419,30 @@ void __tlb_remove_table(void *_table)
 {
 	unsigned int mask = (unsigned long) _table & 0x03U, half = mask;
 	void *table = (void *)((unsigned long) _table ^ mask);
-	struct page *page = virt_to_page(table);
+	struct ptdesc *ptdesc = virt_to_ptdesc(table);
 
 	switch (half) {
 	case 0x00U:	/* pmd, pud, or p4d */
-		free_pages((unsigned long)table, CRST_ALLOC_ORDER);
+		pagetable_free(ptdesc);
 		return;
 	case 0x01U:	/* lower 2K of a 4K page table */
 	case 0x02U:	/* higher 2K of a 4K page table */
-		mask = atomic_xor_bits(&page->_refcount, mask << (4 + 24));
+		mask = atomic_xor_bits(&ptdesc->_refcount, mask << (4 + 24));
 		mask >>= 24;
 		if (mask != 0x00U)
 			return;
 		break;
 	case 0x03U:	/* 4K page table with pgstes */
-		mask = atomic_xor_bits(&page->_refcount, 0x03U << 24);
+		mask = atomic_xor_bits(&ptdesc->_refcount, 0x03U << 24);
 		mask >>= 24;
 		break;
 	}
 
-	page_table_release_check(page, table, half, mask);
-	if (TestClearPageActive(page))
-		call_rcu(&page->rcu_head, pte_free_now);
+	page_table_release_check(ptdesc_page(ptdesc), table, half, mask);
+	if (folio_test_clear_active(ptdesc_folio(ptdesc)))
+		call_rcu(&ptdesc->pt_rcu_head, pte_free_now);
 	else
-		pte_free_now(&page->rcu_head);
+		pte_free_now(&ptdesc->pt_rcu_head);
 }
 
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
@@ -488,16 +486,20 @@ static void base_pgt_free(unsigned long *table)
 static unsigned long *base_crst_alloc(unsigned long val)
 {
 	unsigned long *table;
+	struct ptdesc *ptdesc;
 
-	table =	(unsigned long *)__get_free_pages(GFP_KERNEL, CRST_ALLOC_ORDER);
-	if (table)
-		crst_table_init(table, val);
+	ptdesc = pagetable_alloc(GFP_KERNEL & ~__GFP_HIGHMEM, CRST_ALLOC_ORDER);
+	if (!ptdesc)
+		return NULL;
+	table = ptdesc_address(ptdesc);
+
+	crst_table_init(table, val);
 	return table;
 }
 
 static void base_crst_free(unsigned long *table)
 {
-	free_pages((unsigned long)table, CRST_ALLOC_ORDER);
+	pagetable_free(virt_to_ptdesc(table));
 }
 
 #define BASE_ADDR_END_FUNC(NAME, SIZE)					\
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:07:59 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:07:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573347.898030 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWND-0005Ic-AN; Mon, 31 Jul 2023 17:07:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573347.898030; Mon, 31 Jul 2023 17:07:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWND-0005Hu-3x; Mon, 31 Jul 2023 17:07:59 +0000
Received: by outflank-mailman (input) for mailman id 573347;
 Mon, 31 Jul 2023 17:07:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJe-0000C0-Cm
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:18 +0000
Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com
 [2607:f8b0:4864:20::b2e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 483d52aa-2fc4-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 19:04:17 +0200 (CEST)
Received: by mail-yb1-xb2e.google.com with SMTP id
 3f1490d57ef6-c5f98fc4237so3738600276.2
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:17 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.14
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 483d52aa-2fc4-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823056; x=1691427856;
        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=/CuYJ7liBLmFxtlpmCAIL/qtog0vkZLk1dVk72P32nA=;
        b=VD/5YQf9dWYT3s+XLCXcwwiIVAHAp/pIe7AMdOvpExYmK5HjPOWTZu09sLOfQMxAfC
         OXuPdz7Tj/gRexFEV/+v0Lea9a4mnAUKnOzN7P73JNN0+oqdEeWVHp/XrVyDKMN3Sqzq
         XyvfOK4vNNg4SIqEO+DbR5HnEigDlCQMi9XWjP33h/pZyUUMJf9cJEbHTYSdJe7xIVgq
         5L6GenpajpPmM3TvCUDFhBdcux4f7GetW1kVA2GoYO0OMNWSzyNz+zkHnzCWEOnqLDpJ
         MBPlFqECJSKW8b/LiB8vJt+wWDGPekjS3XxHyTLS29uaM77UixmV7cvi9KvK+lFaz9YU
         pXeg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823056; x=1691427856;
        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=/CuYJ7liBLmFxtlpmCAIL/qtog0vkZLk1dVk72P32nA=;
        b=Wgl1jqb9x9iW8xXRPXpezWtMIUSopsg4nEQMCrhRgyXmvCqpl1Gfuy0I49entY0aS1
         1HPgfimbyW01IXP8KfdESVcnUe+Vxo3Ht+TtzDEzADonM2lrQd2U4SSbrBNyn6gF2BC9
         MPd8ZDyvvFifZ2dJ+1mS9uIsu7/5/YztDtDdLfejZP7yQKnQX81pXzwgHmfZiQMYOFa0
         nbQjsCwmeXPz62lsL8rpZsUEZG1zs5TfmNNuW6zJ13sDa4P1cv1b7HokruDfyUS69fvP
         QsRilG1r/JcgwDztPg/RutBIgSQEcUCt9hfA4mRWfP0/Ct596SjrodHmp2QKvRrvBg2u
         g1og==
X-Gm-Message-State: ABy/qLboi0fX0HIN3E3/JTA5iZ6/17brK79+GhfwTpxNozEE8UxDY+BL
	PSQwVzvSwByQ5qwKQFuVabw=
X-Google-Smtp-Source: APBJJlFHDXc0WViYFSb3R2hW52w3IhQItZ8A+xKJNI719Lf54J20Rc3nckyX4WKCIAYzzN+QzoVnBw==
X-Received: by 2002:a25:734c:0:b0:d11:61da:3a58 with SMTP id o73-20020a25734c000000b00d1161da3a58mr7589775ybc.54.1690823056172;
        Mon, 31 Jul 2023 10:04:16 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Guo Ren <guoren@kernel.org>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 19/31] csky: Convert __pte_free_tlb() to use ptdescs
Date: Mon, 31 Jul 2023 10:03:20 -0700
Message-Id: <20230731170332.69404-20-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Guo Ren <guoren@kernel.org>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/csky/include/asm/pgalloc.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/csky/include/asm/pgalloc.h b/arch/csky/include/asm/pgalloc.h
index 7d57e5da0914..9c84c9012e53 100644
--- a/arch/csky/include/asm/pgalloc.h
+++ b/arch/csky/include/asm/pgalloc.h
@@ -63,8 +63,8 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 
 #define __pte_free_tlb(tlb, pte, address)		\
 do {							\
-	pgtable_pte_page_dtor(pte);			\
-	tlb_remove_page(tlb, pte);			\
+	pagetable_pte_dtor(page_ptdesc(pte));		\
+	tlb_remove_page_ptdesc(tlb, page_ptdesc(pte));	\
 } while (0)
 
 extern void pagetable_init(void);
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:08:00 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:08:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573354.898035 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWNE-0005Ou-43; Mon, 31 Jul 2023 17:08:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573354.898035; Mon, 31 Jul 2023 17:07:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWND-0005NH-Lg; Mon, 31 Jul 2023 17:07:59 +0000
Received: by outflank-mailman (input) for mailman id 573354;
 Mon, 31 Jul 2023 17:07: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
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWK4-0008Np-Ul
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:44 +0000
Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com
 [2607:f8b0:4864:20::b2e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5796ca12-2fc4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:04:43 +0200 (CEST)
Received: by mail-yb1-xb2e.google.com with SMTP id
 3f1490d57ef6-d05a63946e0so4860578276.1
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:43 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5796ca12-2fc4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823082; x=1691427882;
        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=ge3Da1dLlbVImV5jdD/HZRx7aISFPvIvfEGvqleo2SA=;
        b=ioOMbbu3JES3j1Jj+JW3855XW3Ov65AQm8O9lv95JxDcPPS6IwntjHfsaaLCwjHL5b
         OuA4j3AMcOeG2v6VKrbkSXabyBKoN8KuyYIoDCC1YD5I/RC4KqKt3ITSQwKezbQCp/8J
         AR8EjEBjRuz0BKnlQIU6Pu2fINdNhuBPDReykf5gMLB8b4rp/cimT4edf9bEDyME9O7d
         VFOstOotn1+dDzfuistQZkRoPkOh7Uzd/ZqgsVXJ0Zgg3bR5ReggCo1obemCJNhIS+t9
         Ue+OH0jfGRqmyKjIxlmOMTrVnVAvQzQZxHF6PwZledF5BBiAWirHuHl+9jo5QzXuxUnf
         6Gng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823082; x=1691427882;
        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=ge3Da1dLlbVImV5jdD/HZRx7aISFPvIvfEGvqleo2SA=;
        b=VFa1A77KiddJpPRG7H5abvMMr+Mrvi9XxMCJa8l4GZ96QOVX5M2Vu8u3L2AJMD2lNl
         PiQpK5E1d1cOEJ7OVobyFd7cEDmGyN3Ao+9Qd5m+zL+O6qbbH7QEadqbFTdKN+r3ztdF
         9aOiwyPgC6IfyzcznA0bhQZGjrAHI+IjEVopu/ON5dXTdH38x/TpZmcxSPoY+NTtJ1r3
         ynZv2Kn8tWcIXwvTHCAvfxefuUYkokxQjb4aTSawZFHugIqRJdpMjuffyyXMXyxa+muY
         JXgCFDKTxGprTqKdY3XgZ1PSA/5j35D2rERqG8kogizu1G5dz0P6dA8Zx/f6f0SwiijQ
         dAcA==
X-Gm-Message-State: ABy/qLaPUpjELVXCxIAijlA9cEzfEMC8n4unUrEU53UUtDMAmOc2VZnp
	J64d054njkCskIbuyF9dzZM=
X-Google-Smtp-Source: APBJJlF0vgCAeh2GJq7nS2h9EAm5JTHFkJPU6wpVfPXTMfmv7gc4qDUX7Q6WDvp5wiH1WM3Qyv6c4g==
X-Received: by 2002:a25:d68d:0:b0:d0f:ea4b:1dff with SMTP id n135-20020a25d68d000000b00d0fea4b1dffmr10302787ybg.8.1690823081905;
        Mon, 31 Jul 2023 10:04:41 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 31/31] mm: Remove pgtable_{pmd, pte}_page_{ctor, dtor}() wrappers
Date: Mon, 31 Jul 2023 10:03:32 -0700
Message-Id: <20230731170332.69404-32-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

These functions are no longer necessary. Remove them and cleanup
Documentation referencing them.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 Documentation/mm/split_page_table_lock.rst    | 12 +++++------
 .../zh_CN/mm/split_page_table_lock.rst        | 14 ++++++-------
 include/linux/mm.h                            | 20 -------------------
 3 files changed, 13 insertions(+), 33 deletions(-)

diff --git a/Documentation/mm/split_page_table_lock.rst b/Documentation/mm/split_page_table_lock.rst
index a834fad9de12..e4f6972eb6c0 100644
--- a/Documentation/mm/split_page_table_lock.rst
+++ b/Documentation/mm/split_page_table_lock.rst
@@ -58,7 +58,7 @@ Support of split page table lock by an architecture
 ===================================================
 
 There's no need in special enabling of PTE split page table lock: everything
-required is done by pgtable_pte_page_ctor() and pgtable_pte_page_dtor(), which
+required is done by pagetable_pte_ctor() and pagetable_pte_dtor(), which
 must be called on PTE table allocation / freeing.
 
 Make sure the architecture doesn't use slab allocator for page table
@@ -68,8 +68,8 @@ This field shares storage with page->ptl.
 PMD split lock only makes sense if you have more than two page table
 levels.
 
-PMD split lock enabling requires pgtable_pmd_page_ctor() call on PMD table
-allocation and pgtable_pmd_page_dtor() on freeing.
+PMD split lock enabling requires pagetable_pmd_ctor() call on PMD table
+allocation and pagetable_pmd_dtor() on freeing.
 
 Allocation usually happens in pmd_alloc_one(), freeing in pmd_free() and
 pmd_free_tlb(), but make sure you cover all PMD table allocation / freeing
@@ -77,7 +77,7 @@ paths: i.e X86_PAE preallocate few PMDs on pgd_alloc().
 
 With everything in place you can set CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK.
 
-NOTE: pgtable_pte_page_ctor() and pgtable_pmd_page_ctor() can fail -- it must
+NOTE: pagetable_pte_ctor() and pagetable_pmd_ctor() can fail -- it must
 be handled properly.
 
 page->ptl
@@ -97,7 +97,7 @@ trick:
    split lock with enabled DEBUG_SPINLOCK or DEBUG_LOCK_ALLOC, but costs
    one more cache line for indirect access;
 
-The spinlock_t allocated in pgtable_pte_page_ctor() for PTE table and in
-pgtable_pmd_page_ctor() for PMD table.
+The spinlock_t allocated in pagetable_pte_ctor() for PTE table and in
+pagetable_pmd_ctor() for PMD table.
 
 Please, never access page->ptl directly -- use appropriate helper.
diff --git a/Documentation/translations/zh_CN/mm/split_page_table_lock.rst b/Documentation/translations/zh_CN/mm/split_page_table_lock.rst
index 4fb7aa666037..a2c288670a24 100644
--- a/Documentation/translations/zh_CN/mm/split_page_table_lock.rst
+++ b/Documentation/translations/zh_CN/mm/split_page_table_lock.rst
@@ -56,16 +56,16 @@ Hugetlbç‰¹å®šçš„è¾…åŠ©å‡½æ•°:
 æž¶æž„å¯¹åˆ†é¡µè¡¨é”çš„æ”¯æŒ
 ====================
 
-æ²¡æœ‰å¿…è¦ç‰¹åˆ«å¯ç”¨PTEåˆ†é¡µè¡¨é”ï¼šæ‰€æœ‰éœ€è¦çš„ä¸œè¥¿éƒ½ç”±pgtable_pte_page_ctor()
-å’Œpgtable_pte_page_dtor()å®Œæˆï¼Œå®ƒä»¬å¿…é¡»åœ¨PTEè¡¨åˆ†é…/é‡Šæ”¾æ—¶è¢«è°ƒç”¨ã€‚
+æ²¡æœ‰å¿…è¦ç‰¹åˆ«å¯ç”¨PTEåˆ†é¡µè¡¨é”ï¼šæ‰€æœ‰éœ€è¦çš„ä¸œè¥¿éƒ½ç”±pagetable_pte_ctor()
+å’Œpagetable_pte_dtor()å®Œæˆï¼Œå®ƒä»¬å¿…é¡»åœ¨PTEè¡¨åˆ†é…/é‡Šæ”¾æ—¶è¢«è°ƒç”¨ã€‚
 
 ç¡®ä¿æž¶æž„ä¸ä½¿ç”¨slabåˆ†é…å™¨æ¥åˆ†é…é¡µè¡¨ï¼šslabä½¿ç”¨page->slab_cacheæ¥åˆ†é…å…¶é¡µ
 é¢ã€‚è¿™ä¸ªåŒºåŸŸä¸Žpage->ptlå…±äº«å­˜å‚¨ã€‚
 
 PMDåˆ†é¡µé”åªæœ‰åœ¨ä½ æœ‰ä¸¤ä¸ªä»¥ä¸Šçš„é¡µè¡¨çº§åˆ«æ—¶æ‰æœ‰æ„ä¹‰ã€‚
 
-å¯ç”¨PMDåˆ†é¡µé”éœ€è¦åœ¨PMDè¡¨åˆ†é…æ—¶è°ƒç”¨pgtable_pmd_page_ctor()ï¼Œåœ¨é‡Šæ”¾æ—¶è°ƒ
-ç”¨pgtable_pmd_page_dtor()ã€‚
+å¯ç”¨PMDåˆ†é¡µé”éœ€è¦åœ¨PMDè¡¨åˆ†é…æ—¶è°ƒç”¨pagetable_pmd_ctor()ï¼Œåœ¨é‡Šæ”¾æ—¶è°ƒ
+ç”¨pagetable_pmd_dtor()ã€‚
 
 åˆ†é…é€šå¸¸å‘ç”Ÿåœ¨pmd_alloc_one()ä¸­ï¼Œé‡Šæ”¾å‘ç”Ÿåœ¨pmd_free()å’Œpmd_free_tlb()
 ä¸­ï¼Œä½†è¦ç¡®ä¿è¦†ç›–æ‰€æœ‰çš„PMDè¡¨åˆ†é…/é‡Šæ”¾è·¯å¾„ï¼šå³X86_PAEåœ¨pgd_alloc()ä¸­é¢„å…ˆ
@@ -73,7 +73,7 @@ PMDåˆ†é¡µé”åªæœ‰åœ¨ä½ æœ‰ä¸¤ä¸ªä»¥ä¸Šçš„é¡µè¡¨çº§åˆ«æ—¶æ‰æœ‰æ„ä¹‰ã€‚
 
 ä¸€åˆ‡å°±ç»ªåŽï¼Œä½ å¯ä»¥è®¾ç½®CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCKã€‚
 
-æ³¨æ„ï¼špgtable_pte_page_ctor()å’Œpgtable_pmd_page_ctor()å¯èƒ½å¤±è´¥--å¿…
+æ³¨æ„ï¼špagetable_pte_ctor()å’Œpagetable_pmd_ctor()å¯èƒ½å¤±è´¥--å¿…
 é¡»æ­£ç¡®å¤„ç†ã€‚
 
 page->ptl
@@ -90,7 +90,7 @@ page->ptlç”¨äºŽè®¿é—®åˆ†å‰²é¡µè¡¨é”ï¼Œå…¶ä¸­'page'æ˜¯åŒ…å«è¯¥è¡¨çš„é¡µé¢struc
    çš„æŒ‡é’ˆå¹¶åŠ¨æ€åˆ†é…å®ƒã€‚è¿™å…è®¸åœ¨å¯ç”¨DEBUG_SPINLOCKæˆ–DEBUG_LOCK_ALLOCçš„
    æƒ…å†µä¸‹ä½¿ç”¨åˆ†é¡µé”ï¼Œä½†ç”±äºŽé—´æŽ¥è®¿é—®è€Œå¤šèŠ±äº†ä¸€ä¸ªç¼“å­˜è¡Œã€‚
 
-PTEè¡¨çš„spinlock_tåˆ†é…åœ¨pgtable_pte_page_ctor()ä¸­ï¼ŒPMDè¡¨çš„spinlock_t
-åˆ†é…åœ¨pgtable_pmd_page_ctor()ä¸­ã€‚
+PTEè¡¨çš„spinlock_tåˆ†é…åœ¨pagetable_pte_ctor()ä¸­ï¼ŒPMDè¡¨çš„spinlock_t
+åˆ†é…åœ¨pagetable_pmd_ctor()ä¸­ã€‚
 
 è¯·ä¸è¦ç›´æŽ¥è®¿é—®page->ptl - -ä½¿ç”¨é€‚å½“çš„è¾…åŠ©å‡½æ•°ã€‚
diff --git a/include/linux/mm.h b/include/linux/mm.h
index bd3d99d81984..e4e34ecbc2ea 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2913,11 +2913,6 @@ static inline bool pagetable_pte_ctor(struct ptdesc *ptdesc)
 	return true;
 }
 
-static inline bool pgtable_pte_page_ctor(struct page *page)
-{
-	return pagetable_pte_ctor(page_ptdesc(page));
-}
-
 static inline void pagetable_pte_dtor(struct ptdesc *ptdesc)
 {
 	struct folio *folio = ptdesc_folio(ptdesc);
@@ -2927,11 +2922,6 @@ static inline void pagetable_pte_dtor(struct ptdesc *ptdesc)
 	lruvec_stat_sub_folio(folio, NR_PAGETABLE);
 }
 
-static inline void pgtable_pte_page_dtor(struct page *page)
-{
-	pagetable_pte_dtor(page_ptdesc(page));
-}
-
 pte_t *__pte_offset_map(pmd_t *pmd, unsigned long addr, pmd_t *pmdvalp);
 static inline pte_t *pte_offset_map(pmd_t *pmd, unsigned long addr)
 {
@@ -3038,11 +3028,6 @@ static inline bool pagetable_pmd_ctor(struct ptdesc *ptdesc)
 	return true;
 }
 
-static inline bool pgtable_pmd_page_ctor(struct page *page)
-{
-	return pagetable_pmd_ctor(page_ptdesc(page));
-}
-
 static inline void pagetable_pmd_dtor(struct ptdesc *ptdesc)
 {
 	struct folio *folio = ptdesc_folio(ptdesc);
@@ -3052,11 +3037,6 @@ static inline void pagetable_pmd_dtor(struct ptdesc *ptdesc)
 	lruvec_stat_sub_folio(folio, NR_PAGETABLE);
 }
 
-static inline void pgtable_pmd_page_dtor(struct page *page)
-{
-	pagetable_pmd_dtor(page_ptdesc(page));
-}
-
 /*
  * No scalability reason to split PUD locks yet, but follow the same pattern
  * as the PMD locks to make it easier if we decide to.  The VM should not be
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:08:01 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:08:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573355.898043 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWNF-0005WU-0u; Mon, 31 Jul 2023 17:08:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573355.898043; Mon, 31 Jul 2023 17:08:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWNE-0005TI-74; Mon, 31 Jul 2023 17:08:00 +0000
Received: by outflank-mailman (input) for mailman id 573355;
 Mon, 31 Jul 2023 17:07: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
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWK2-0008Np-Jp
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:42 +0000
Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com
 [2607:f8b0:4864:20::b32])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 56597512-2fc4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:04:41 +0200 (CEST)
Received: by mail-yb1-xb32.google.com with SMTP id
 3f1490d57ef6-ccc462deca6so4899886276.0
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:41 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 56597512-2fc4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823080; x=1691427880;
        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=JRfRtQSkmDpdaHgWU+x8J8rVDSFtmuGYMRjnXDV0vQY=;
        b=fypnJ8EOp6389G/yrEsdiBw8+ODFJB18UGVsK1WnMmuuyVJGZEMRFzagFIz/t/iUP/
         2hQUC88xrJTr5zC02f819WJdC4SisRLoHgth8vaUsDxgglJhi6MHYK2vk4aVYQFhtjHu
         EJ82jl2MiLVTmBE59Pwb2ZF5o5qt31wsfoof30f3jCxfq5PoYDaunPmGz2hyM4ah/4KD
         ydzqEb1pNZ1YIAh6SsOFxKI8oa6yw/2SpcLuoX5OxyBAJ0szyfenY4ClRYrgeaYLOg5P
         lgJjKay9Zm3G6SxJT2EV+hC0IYmKARvYedORBaKi0opdpa/X1F5LwQzjJG/maSgO9ToG
         3U/Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823080; x=1691427880;
        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=JRfRtQSkmDpdaHgWU+x8J8rVDSFtmuGYMRjnXDV0vQY=;
        b=VQucrlP7Q4RRp6OsPmArwI47v6xyOXEk61z1hU+Nn9f+Kru3tkhlwAqUaMREpNL6Bt
         EB+1UnUbz/RsM8dIw0I+gGpSJ1Wx7yhua1j/bac2g1wF6QFO6/FFHXzNwj5Q1r5xogn0
         uhiNa7Gxyg/tQtaCzSuZYGEmd9bYCKDdfNUvhRkF1OtAynKlvSKIAHLrfd4FPQBYALgQ
         WrpTJyjry9ghVPuixVX/6guQFObUDsNxTHukohlVMEGrTkqhYRB3J4Xlg9R4rlj9IXNv
         X8jtVncoKtzBqwvjoGapshMXJ2gkBfIFiw7xbFmuh4thnkZoOnHppOoRBf4iWfk6TaVt
         I4ag==
X-Gm-Message-State: ABy/qLbqzTVu6yom4Ng4d/MlhqXeWS8iJC++2JLTVrRwNGqcS44maZ0k
	FZ/qbDReAWos/CtgV2K0n/0=
X-Google-Smtp-Source: APBJJlEdwhqcmTMrEtHQGs0fafmxeVWw9ywX+xXLwsxfbs/EAm9tmHsbV10DQDaT24PRZb9zbh9R9w==
X-Received: by 2002:a25:aca8:0:b0:d0b:2ff2:ff8 with SMTP id x40-20020a25aca8000000b00d0b2ff20ff8mr11589261ybi.21.1690823079964;
        Mon, 31 Jul 2023 10:04:39 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 30/31] um: Convert {pmd, pte}_free_tlb() to use ptdescs
Date: Mon, 31 Jul 2023 10:03:31 -0700
Message-Id: <20230731170332.69404-31-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents. Also cleans up some spacing issues.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/um/include/asm/pgalloc.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/um/include/asm/pgalloc.h b/arch/um/include/asm/pgalloc.h
index 8ec7cd46dd96..de5e31c64793 100644
--- a/arch/um/include/asm/pgalloc.h
+++ b/arch/um/include/asm/pgalloc.h
@@ -25,19 +25,19 @@
  */
 extern pgd_t *pgd_alloc(struct mm_struct *);
 
-#define __pte_free_tlb(tlb,pte, address)		\
-do {							\
-	pgtable_pte_page_dtor(pte);			\
-	tlb_remove_page((tlb),(pte));			\
+#define __pte_free_tlb(tlb, pte, address)			\
+do {								\
+	pagetable_pte_dtor(page_ptdesc(pte));			\
+	tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte)));	\
 } while (0)
 
 #ifdef CONFIG_3_LEVEL_PGTABLES
 
-#define __pmd_free_tlb(tlb, pmd, address)		\
-do {							\
-	pgtable_pmd_page_dtor(virt_to_page(pmd));	\
-	tlb_remove_page((tlb),virt_to_page(pmd));	\
-} while (0)						\
+#define __pmd_free_tlb(tlb, pmd, address)			\
+do {								\
+	pagetable_pmd_dtor(virt_to_ptdesc(pmd));			\
+	tlb_remove_page_ptdesc((tlb), virt_to_ptdesc(pmd));	\
+} while (0)
 
 #endif
 
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:08:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:08:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573360.898062 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWNI-0006aH-CX; Mon, 31 Jul 2023 17:08:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573360.898062; Mon, 31 Jul 2023 17:08:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWNI-0006Zw-7p; Mon, 31 Jul 2023 17:08:04 +0000
Received: by outflank-mailman (input) for mailman id 573360;
 Mon, 31 Jul 2023 17:08:02 +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
 <SRS0=d7tO=DR=gmail.com=vishal.moola@srs-se1.protection.inumbo.net>)
 id 1qQWJc-0008Np-0A
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:04:16 +0000
Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com
 [2607:f8b0:4864:20::b34])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 45cc9ed1-2fc4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:04:13 +0200 (CEST)
Received: by mail-yb1-xb34.google.com with SMTP id
 3f1490d57ef6-d0728058651so4980564276.1
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 10:04:13 -0700 (PDT)
Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16])
 by smtp.googlemail.com with ESMTPSA id
 x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.10
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Jul 2023 10:04:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 45cc9ed1-2fc4-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20221208; t=1690823052; x=1691427852;
        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=jHkn+4hWn6cNWfQmftBQOtWQYQb9iJJIYcRZZNmu6iY=;
        b=S9WpMAU4z7s2Ag9JtWlTuDFooWQlFyPv89tIlGGSbz0E38KMeV4JUqyRKP7B2mlsst
         3/F+7yoyQbv3i3KcMwuVSsZv9i7LAi+BdMh8bqQ1OIkDFwNfq0t6pWYwMasYC2CpjBTn
         bovNcdPK8kmT56us8VfFMktVF9KG2tmTn5UTLjX+ZXj2DR3oFDYqVFA7hvTFAXfeR6X5
         Q0VEEuNVDIcDX6dTwPvkDuk+ca9lyAO0oa7PZRgQNSWYVbj0QEi1SCUj2cu+UiTNTCrz
         l0MpQh+abPw7+Fj+nKTUpgwidBjEPvlqq0Mg8+dCJJ46uHZsBMSboAizdy+gmVRglE/z
         7Cpg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690823052; x=1691427852;
        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=jHkn+4hWn6cNWfQmftBQOtWQYQb9iJJIYcRZZNmu6iY=;
        b=UO1A6cPpBGd12ODN+8rKh1ZOYowVCV/hCiimpGCVa3i4/uM9yYj5eXfHYmy98Fx4J7
         XK3YJVXnAbq4Z8NaooES4oFPG97FU0TLKmwSZ3L8UatB6V2dFZKqseaHwnWO4jGNh9HK
         AqjRSRhlWvXUC025xm0UQ4ZK47uqm2L6+voRiYgSlzKRmO1hjbhaqH70J1Ggx/Q/Z1/k
         iau4FlY8eOsqfe/6IJKAZE+hz4qXJkQjZZ5hi0XIVKFDKi5+ScuEKtBtsgjOkTJxQXmB
         W1QIYqW869UuEIMRtA9HQjFlBSx3dssMetKoGyjyZ/L6k4t0iJ+GolGq1b8GVeUAqlh3
         BSkA==
X-Gm-Message-State: ABy/qLa1KpyJRr7R8yWoVdP+wc2Wnv+Sh/mDtgWfXvZaSxLhyOPplRhv
	aF4KmfJEsb2x79V0fbtTxp0=
X-Google-Smtp-Source: APBJJlF45VM+96NADPgQk/bfcoyXe13svaytrCoN6xBKbPq7ENGGS7BXy6U+VNxQQfsm+MAmj6JoEQ==
X-Received: by 2002:a25:b296:0:b0:d35:cfa3:cbde with SMTP id k22-20020a25b296000000b00d35cfa3cbdemr1080223ybj.38.1690823052039;
        Mon, 31 Jul 2023 10:04:12 -0700 (PDT)
From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-csky@vger.kernel.org,
	linux-hexagon@vger.kernel.org,
	loongarch@lists.linux.dev,
	linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-um@lists.infradead.org,
	xen-devel@lists.xenproject.org,
	kvm@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Mike Rapoport <rppt@kernel.org>
Subject: [PATCH mm-unstable v8 17/31] arm: Convert various functions to use ptdescs
Date: Mon, 31 Jul 2023 10:03:18 -0700
Message-Id: <20230731170332.69404-18-vishal.moola@gmail.com>
X-Mailer: git-send-email 2.40.1
In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com>
References: <20230731170332.69404-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As part of the conversions to replace pgtable constructor/destructors with
ptdesc equivalents, convert various page table functions to use ptdescs.

late_alloc() also uses the __get_free_pages() helper function. Convert
this to use pagetable_alloc() and ptdesc_address() instead to help
standardize page tables further.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
 arch/arm/include/asm/tlb.h | 12 +++++++-----
 arch/arm/mm/mmu.c          |  7 ++++---
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h
index b8cbe03ad260..f40d06ad5d2a 100644
--- a/arch/arm/include/asm/tlb.h
+++ b/arch/arm/include/asm/tlb.h
@@ -39,7 +39,9 @@ static inline void __tlb_remove_table(void *_table)
 static inline void
 __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, unsigned long addr)
 {
-	pgtable_pte_page_dtor(pte);
+	struct ptdesc *ptdesc = page_ptdesc(pte);
+
+	pagetable_pte_dtor(ptdesc);
 
 #ifndef CONFIG_ARM_LPAE
 	/*
@@ -50,17 +52,17 @@ __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, unsigned long addr)
 	__tlb_adjust_range(tlb, addr - PAGE_SIZE, 2 * PAGE_SIZE);
 #endif
 
-	tlb_remove_table(tlb, pte);
+	tlb_remove_ptdesc(tlb, ptdesc);
 }
 
 static inline void
 __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp, unsigned long addr)
 {
 #ifdef CONFIG_ARM_LPAE
-	struct page *page = virt_to_page(pmdp);
+	struct ptdesc *ptdesc = virt_to_ptdesc(pmdp);
 
-	pgtable_pmd_page_dtor(page);
-	tlb_remove_table(tlb, page);
+	pagetable_pmd_dtor(ptdesc);
+	tlb_remove_ptdesc(tlb, ptdesc);
 #endif
 }
 
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 13fc4bb5f792..fdeaee30d167 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -737,11 +737,12 @@ static void __init *early_alloc(unsigned long sz)
 
 static void *__init late_alloc(unsigned long sz)
 {
-	void *ptr = (void *)__get_free_pages(GFP_PGTABLE_KERNEL, get_order(sz));
+	void *ptdesc = pagetable_alloc(GFP_PGTABLE_KERNEL & ~__GFP_HIGHMEM,
+			get_order(sz));
 
-	if (!ptr || !pgtable_pte_page_ctor(virt_to_page(ptr)))
+	if (!ptdesc || !pagetable_pte_ctor(ptdesc))
 		BUG();
-	return ptr;
+	return ptdesc_to_virt(ptdesc);
 }
 
 static pte_t * __init arm_pte_alloc(pmd_t *pmd, unsigned long addr,
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:09:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:09:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573371.898072 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWP4-0001OU-Rp; Mon, 31 Jul 2023 17:09:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573371.898072; Mon, 31 Jul 2023 17:09:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWP4-0001OM-O8; Mon, 31 Jul 2023 17:09:54 +0000
Received: by outflank-mailman (input) for mailman id 573371;
 Mon, 31 Jul 2023 17:09:53 +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
 <SRS0=7hZk=DR=chiark.greenend.org.uk=ijackson@srs-se1.protection.inumbo.net>)
 id 1qQWP2-0001NR-KV
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:09:53 +0000
Received: from chiark.greenend.org.uk (v6.chiark.greenend.org.uk
 [2001:ba8:1e3::]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0caf9753-2fc5-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:09:48 +0200 (CEST)
Received: by chiark.greenend.org.uk (Debian Exim 4.94.2 #2) with local
 (return-path ijackson@chiark.greenend.org.uk)
 id 1qQWOr-0002ds-L1; Mon, 31 Jul 2023 18:09:41 +0100
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0caf9753-2fc5-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=chiark.greenend.org.uk; s=k.chiark; h=DKIM-Signature-Warning:References:
	In-Reply-To:Subject:Cc:To:Date:Message-ID:Content-Transfer-Encoding:
	Content-Type:MIME-Version:From:Sender:Reply-To:Content-ID:Content-Description
	:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
	List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:
	List-Archive; bh=kq3C9qdHinQVZt4g5pbFr5nLdggSuLiE7Cy5h/e80Zg=; b=nVIcsoN2NZw4
	t4niyQw0UBtVPY+ovRrpXqXj7lLH5sP2WdBDMupYBXLq7dowyyxhYsD//uhlw5Q/HSAdEM/uLYapU
	qmyAxubtVzqdsAO7Y8OT3ywsDXb/+fDJXa+MUDVuW+rwkyKkvgd85mluwnjcCPHX6EPwX2Xq21AZJ
	6tkjxd2SBjylDBYnVL9eHRt/rNzHdI8o8OI2zrDkRhWlzPPNnUPiqHKcfFjnKhwDo/b0tjcv+cPBs
	F3R+E8kOTEDMPjj5PnsO8yMSuPNiGPGnmQhNVDe6Zvc9+DsfC/IAlIbKna4LdFC5IUUjYy8Eud68W
	HaI+2GByL816gphy5JOVuQ==;
From: Ian Jackson <ijackson@chiark.greenend.org.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Message-ID: <25799.60117.528120.26189@chiark.greenend.org.uk>
Date: Mon, 31 Jul 2023 18:09:41 +0100
To: Elliott Mitchell <ehem+xen@m5p.com>
Cc: Marek =?iso-8859-1?Q?Marczykowski-G=F3recki?= <marmarek@invisiblethingslab.com>,
    xen-devel@lists.xenproject.org,
    wl@xen.org,
    Anthony PERARD <anthony.perard@citrix.com>,
    Juergen Gross <jgross@suse.com>
Subject: Re: Python in Domain Configurations
In-Reply-To: <ZMflj1F5qDydEgbd@mattapan.m5p.com>
References: <ZKiN80e08QIojRSL@mattapan.m5p.com>
	<ZL7e6IcJWK38IHU7@mattapan.m5p.com>
	<ZMcxvdSbpQdWg5/r@mail-itl>
	<ZMflj1F5qDydEgbd@mattapan.m5p.com>
X-Mailer: VM 8.2.0b under 27.1 (x86_64-pc-linux-gnu)
DKIM-Signature-Warning: NOTE REGARDING DKIM KEY COMPROMISE https://www.chiark.greenend.org.uk/dkim-rotate/README.txt https://www.chiark.greenend.org.uk/dkim-rotate/af/afac8f396f88c5d9f7a728135905de4e.pem

Elliott Mitchell writes ("Re: Python in Domain Configurations"):
> On Mon, Jul 31, 2023 at 05:59:55AM +0200, Marek Marczykowski-G=F3reck=
i wrote:
> > So, IMHO reducing config file from a full python (like it used to b=
e in
> > xend times) into a static file with well defined syntax was an
> > improvement. Lets not go backward.

I'm no longer working on this codebase, but since I've been CC'd:

I was one of the people who replaced the Python-based config parsing
with the current arrangements.  We didn't just do this because we were
replacing xend (whose use of Python as implementation language made it
appear convenient to just read and execute the configs as Python
code).

We did it for the reasons Marek gives.  It's true that the existing
format is not as well specified as it could be.  It was intended as a
plausible subset of Python literal syntax.  We chose that syntax to
preserve compatibility with the vast majority of existing config files
and to provide something familiar.  (And it seems we did achieve those
goals.)

The disk configuration syntax is particularly warty, but we inherited
much of that from the Python version.

If we had a free choice today, I might advocate for TOML.  But I don't
see any value in changing the concrete syntax now.

> > As for your original problem, IIUC you would like to add some data =
that
> > would _not_ be interpreted by libxl, right? For that you can use
> > comments with some specific marker for your script. This approach u=
sed
> > to work well for SysV init script, and in fact for a very similar u=
se case
> > (ordering and dependencies, among other things).
>=20
> That is /not/ the issue.  `xl` simply ignores any variables which it
> doesn't interpret (this is in fact a Bad Thing).

I forget, but isn't there some kind of scheme for warning about
unrecognised configuration options ?

>  I need to know what the limits to the syntax are.

I agree that it's not great that the syntax is not 100% documented.
The parser is in
  tools/libs/util/libxlu_cfg_y.y
  tools/libs/util/libxlu_cfg_l.l
I'm sure patches to improve the docs would be welcome.

Note that it is still a *subset* of Python, so if you wish to use a
Python interpreter to parse it in your own tooling, you're very
welcome to do so.

> Notice how many init scripts do `. /etc/default/<somefile>` to load
> configuration?  I'm thinking it would be very handy to use a similar
> technique to load domain.cfg files, with Python being the interpreter=
.

I don't think this is a good idea.  Both because I don't think the
functionality available in a Python interpreter should be available in
the libxl configuration, and because Python is a large and complex
dependency which we don't want to pull in here.

> I also think some portions of the domain.cfg format might work better=

> with full Python syntax.  For example might it be handier to allow:
>=20
> disk =3D [
> =09{
> =09=09'vdev': 'xvda',
> =09=09'format': 'raw',
> =09=09'access': 'rw',
> =09=09'target': '/dev/disk/by-path/foo-bar-baz',
> =09},
> ]

I agree that something like this would be nice.  I don't think it
should be done by importing Python.  These two files - the main part
of the existing parser - is only 183 loc including comments.
Extending it (and the support code in libxlu_cfg.c) to do dictionaries
as well as lists doesn't seem like it would make it too much bigger.

Thanks,
Ian.

--=20
Ian Jackson <ijackson@chiark.greenend.org.uk>   These opinions are my o=
wn. =20

Pronouns: they/he.  If I emailed you from @fyvzl.net or @evade.org.uk,
that is a private address which bypasses my fierce spamfilter.


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:21:16 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:21:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573411.898082 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWZy-000456-T0; Mon, 31 Jul 2023 17:21:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573411.898082; Mon, 31 Jul 2023 17:21:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWZy-00044z-QP; Mon, 31 Jul 2023 17:21:10 +0000
Received: by outflank-mailman (input) for mailman id 573411;
 Mon, 31 Jul 2023 17:21:09 +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
 <SRS0=SXid=DR=kernel.org=broonie@srs-se1.protection.inumbo.net>)
 id 1qQWZx-00044t-HO
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:21:09 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9f9ee3ec-2fc6-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 19:21:03 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 6234E6124B;
 Mon, 31 Jul 2023 17:21:01 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57DD2C433C8;
 Mon, 31 Jul 2023 17:20:57 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9f9ee3ec-2fc6-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690824060;
	bh=mftMsYiz9ZJ4o2udCBL/LK6NqmaRzMvUrLtaxc6+ExM=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=SIuH/vWC0Z//bAHS2Y+ReRPL+XB6AshDM0VvyslpumMHkUh8btF1eBGmB+FVDNt2W
	 qm0tF94AwLtjbT/FtCTVDhM46eCHLOAXbsZYUTJtv7LyR/HrEWEphMZnZ7qKlGxkS0
	 1olJzc+vrxjV93iG+bTpCewIXkEnpr3fmc7cUV+zDrgq77F7ANAF1s+FHa8JxRJTQf
	 CrczT9BjPicytrwXkddCggE8BewLAKcejC+rpo1OwtcrZN13PtffSpA6r7b7VrYut0
	 PUhb+fLowx3LEBj6zKV+E8RhBYkBXxXGSeGYfN2RjgUK1+3pzQnmilsKv3Ax/zlPWN
	 1igMAnbI+UiIw==
Date: Mon, 31 Jul 2023 18:20:54 +0100
From: Mark Brown <broonie@kernel.org>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Andrey Utkin <andrey_utkin@fastmail.com>,
	Anton Sviridenko <anton@corp.bluecherry.net>,
	Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>,
	Banajit Goswami <bgoswami@quicinc.com>,
	Bluecherry Maintainers <maintainers@bluecherrydvr.com>,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	Ismael Luceno <ismael@iodev.co.uk>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Olivier Moysan <olivier.moysan@foss.st.com>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	linux-media@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH 00/24] ALSA: Generic PCM copy ops using sockptr_t
Message-ID: <b906d60b-ece4-45b5-8167-2046c8dc00f4@sirena.org.uk>
References: <20230731154718.31048-1-tiwai@suse.de>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="qMccpUQ9T4oLw/AQ"
Content-Disposition: inline
In-Reply-To: <20230731154718.31048-1-tiwai@suse.de>
X-Cookie: Single tasking: Just Say No.


--qMccpUQ9T4oLw/AQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Mon, Jul 31, 2023 at 05:46:54PM +0200, Takashi Iwai wrote:

> this is a patch set to clean up the PCM copy ops using sockptr_t as a
> "universal" pointer, inspired by the recent patch from Andy
> Shevchenko:
>   https://lore.kernel.org/r/20230721100146.67293-1-andriy.shevchenko@linux.intel.com

> Even though it sounds a bit weird, sockptr_t is a generic type that is
> used already in wide ranges, and it can fit our purpose, too.  With
> sockptr_t, the former split of copy_user and copy_kernel PCM ops can
> be unified again gracefully.

It really feels like we ought to rename, or add an alias for, the type
if we're going to start using it more widely - it's not helping to make
the code clearer.

--qMccpUQ9T4oLw/AQ
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmTH7XUACgkQJNaLcl1U
h9DwvAf+MAtXkGii5+gytkR+D3QTsuA6sY3aBk9dt1dWPILYWbXmsLkkIbGCtvq+
KIRLogTAKw9JbmzspD9GP/aj49lZi+dMH3wj9bfNKb9tJ1kfu5sSa8Bmr73fU/gy
tSYcApUWSN+uSIqVD6z7zDJj+BOa0gIUUQNbJxaPxp8YfsNTZAgCtB6forR7hI3h
OrPzmZkmMgkVjA1N/rHbWeubemc68OgSpUdUO1JF8wrGySsBmwXr/5VoVbBex+cK
Xg1f+g849RnopbiTFg1H7lfkp6wk1nQPWbtdq7y0Ws2HUkNqHS3Kmm4oVamjvlwP
ZmnL1wekh8FNsZS/jWPCv7xMdle/MQ==
=2oaj
-----END PGP SIGNATURE-----

--qMccpUQ9T4oLw/AQ--


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 17:38:42 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 17:38:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573425.898092 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWqp-0005rj-Ba; Mon, 31 Jul 2023 17:38:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573425.898092; Mon, 31 Jul 2023 17:38:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQWqp-0005rc-8L; Mon, 31 Jul 2023 17:38:35 +0000
Received: by outflank-mailman (input) for mailman id 573425;
 Mon, 31 Jul 2023 17:38:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=IyhG=DR=citrix.com=prvs=569984122=Andrew.Cooper3@srs-se1.protection.inumbo.net>)
 id 1qQWqn-0005rS-NG
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 17:38:33 +0000
Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com
 [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 10306be0-2fc9-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 19:38:31 +0200 (CEST)
Received: from mail-bn7nam10lp2108.outbound.protection.outlook.com (HELO
 NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.108])
 by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256;
 31 Jul 2023 13:38:28 -0400
Received: from BN7PR03MB3618.namprd03.prod.outlook.com (2603:10b6:406:c3::27)
 by DM4PR03MB6911.namprd03.prod.outlook.com (2603:10b6:8:46::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Mon, 31 Jul
 2023 17:38:25 +0000
Received: from BN7PR03MB3618.namprd03.prod.outlook.com
 ([fe80::8f94:c73a:ffb7:d5e2]) by BN7PR03MB3618.namprd03.prod.outlook.com
 ([fe80::8f94:c73a:ffb7:d5e2%5]) with mapi id 15.20.6631.026; Mon, 31 Jul 2023
 17:38:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 10306be0-2fc9-11ee-b255-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1690825111;
  h=message-id:date:from:subject:to:cc:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=ehQgxGV0ALqij7tdngrosoSIfEyfIJP/HsmnoQ0LRVI=;
  b=FrzluYdPDmBNXPdex/RMj6R/0fUMdsrKl2geujQnDGWyKbxAyRKtN1EP
   OP+gpZQ05mvtz1P8bD/CY5DPflto1gYmMJ9ecEoHlZw7WSMuzQd+47mZp
   Pj8G67p46B9Vxw0s7TE9bv5frS+jBuCXaRoiDNK/KtDkmqIBrHUX03HE8
   Y=;
X-IronPort-RemoteIP: 104.47.70.108
X-IronPort-MID: 118037613
X-IronPort-Reputation: None
X-IronPort-Listener: OutboundMail
X-IronPort-SenderGroup: RELAY_O365
X-IronPort-MailFlowPolicy: $RELAYED
IronPort-Data: A9a23:md+x36Cl7H8XkhVW/4/iw5YqxClBgxIJ4kV8jS/XYbTApD8l1GdWm
 2AYDGmDMqvYZ2H3LtxybI/j9B8PuJKDm9ZlQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h
 yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs
 t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GxD5wRkDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS
 uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada
 jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIwq9gnAkhT7
 achMg8oMw2Nir3t/5znc7w57igjBJGD0II3nFhFlGmcJ9B5BJfJTuPN+MNS2yo2ioZWB/HCa
 sEFaD1pKhPdfxlIPVRRA5U79AuqriCnL3sE9xTK/exuuzi7IA9ZidABNPL8fNCQSNoTtUGfv
 m/cpEzyAw0ANczZwj2Amp6prraWzXugB9xLT9VU8NZWg1qxy2MdLiY3SEuG/cuY0BHgXvJAf
 hl8Fi0G6PJaGFaQZtv3UgC8oXWElgUBQNcWGOo/gCmW0bbd6QudAmkCTxZCZcYguctwQiYlv
 neLgtfoCDpHoLCTD3WH+d+8pz6oJTIcK2NEYCYeVBYE+PHquoR1hRXKJv5dF6qygszwCCvH6
 TmApygjhJ0elccOka68+DjvnDaEtpXPCAkv6W3/V2ao7Ap/aJSiIZKh7VzW7/FoJ4KeU1XHt
 38B8+CO4eZLAZyTmSilROQWAKrv9/uDKCfbg1NkA98m7TvFxpK4VYVZ4TU7LkE2NM8BIGfte
 BWK4VMX44JPNny3a6Mxe5i2F8kh0annE5LiS+zQad1NJJN2cWdr4R1TWKJZ5Ei1+GBErE31E
 c7znRqEZZrCNZla8Q==
IronPort-HdrOrdr: A9a23:EhCcAqNMFKy/x8BcTjGjsMiBIKoaSvp037BK7S1MoH1uA6ilfq
 WV9sjzuiWatN98Yh8dcLO7Scy9qBHnhP1ICOAqVN/PYOCBggqVxelZhrcKqAeQeREWmNQ86U
 4aSdkYNDXxZ2IK8foT4mODYqkdKA/sytHXuQ/cpU0dPD2Dc8tbnmFE4p7wKDwNeOFBb6BJba
 a01458iBeLX28YVci/DmltZZm/mzWa/KiWGSLvHnQcmXKzsQ8=
X-Talos-CUID: =?us-ascii?q?9a23=3APeNT/WqiM8H/CEVgvkCHCKrmUZEbIn700W+LGlW?=
 =?us-ascii?q?HLDt0RrDKEmC+pJoxxg=3D=3D?=
X-Talos-MUID: 9a23:dCnwkAUQKOJeB9rq/APvgxNvO8lO2IWzGH1Ro7Rc5JeBFTMlbg==
X-IronPort-AV: E=Sophos;i="6.01,245,1684814400"; 
   d="scan'208";a="118037613"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=dhPyrkijPIEgonrtQ16kFQIrP8nSHKbDqwnwjlc9Fq9hNraHEe7a0LjYZxMDhXyQE36ZqpIVTjiQapYqEIyOmFCm4LVzbB91lVRT+MlKfoFCwjDjPma7lQFyXabZf0QGsxd3NIu0R2JG7ewAJqyadYfXpU7A/P69R4P8kz4A9UTxQ0okt7aRgFCr/fxshdzKq7HUH6s3YxrM7OTDVucVC/jj79UXXN1mmo6qCBBmaQ09+cAHmqZhakyK+SbcHtwyBENGD8ejibvprjvplTx90nUTu7izoPB/NinJcX3+myd2WKwuYUWtDixPosvyOjXVwhu+sCBhkEI/4+GpnzP37g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=qlWRApsgK5aUZKm+MHscNWsrbzHPHZHaInQ7SZkBRL4=;
 b=M2g+sBoch6FrGaxEVVEh8uUDZtliRAUi+De8NhteUoEPFIcYvrQweHut5HyduvL/EH7CE5n6K3f3X/dnkVIima64etDN5es7YSOiTnPTjmrB53dsZ49hD1GuaMa5URHdhDNaWaZJpq2Egi7/Ayw59gOgd4MAsJL77n1EU6XTfvszOoo/uNeWUeHM3Uwg7AVj5f7flkoFCX08vK+SI0W2JX4fHm5RliFnrNKF++de2ykzLR2XjgwIy9TprP5xXKyiT88xwv9XwaBcHnen1RsMVp9XBfgdloTAS7j1isdo59Y70BC/LXQz+Y78ehG0KoM4Rbs1QnJEt0lJEtftgm5jSw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=qlWRApsgK5aUZKm+MHscNWsrbzHPHZHaInQ7SZkBRL4=;
 b=E97lLLaVXw9shtMkOm/aXeoz1lY7MIi28kyzj4yzhY94b+/FMfWpWuHhwo8H/PXoEwBFD6cFbjajTrh7Mp142w7+YImdD19Hnlb/ZJvnuY47hWSAXIxmEysb3vom8/M5thfcYsFYkcidhPIoUmgL1RhDdz6zDIHUV7I/CPsoykc=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <67b5c363-a653-3f5c-ea3a-f52bfac3dc49@citrix.com>
Date: Mon, 31 Jul 2023 18:38:19 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v2 5/5] pdx: Add CONFIG_HAS_PDX_COMPRESSION as a common
 Kconfig option
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20230728075903.7838-1-alejandro.vallejo@cloud.com>
 <20230728075903.7838-6-alejandro.vallejo@cloud.com>
 <9f0b7ab4-090f-21ea-2cf8-6ecdc7c02225@citrix.com>
 <3470bc26-3cbc-e0de-53ae-203449493b51@citrix.com>
 <06a3f79e-4345-7a4b-be57-728a8b01befd@suse.com>
In-Reply-To: <06a3f79e-4345-7a4b-be57-728a8b01befd@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO3P123CA0026.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:388::6) To BN7PR03MB3618.namprd03.prod.outlook.com
 (2603:10b6:406:c3::27)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN7PR03MB3618:EE_|DM4PR03MB6911:EE_
X-MS-Office365-Filtering-Correlation-Id: 80cbceb3-3109-471f-f222-08db91ecf11c
X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
	SuokF5vfv0sRV9qyp5U6siNz7neG735Q/1bPTaK0liUd8mFKBxm0UrCIC+V6QiZ7+04IS/Y4Iou8ZOuVn2fAgTLdABofjub6NuEL0VGOjMNNNWwEs9g5VisOoiVc7natB6tCIpFHTWtCqWjA+2pAW+EfJLbWAh6ezfkv+hBRaLlhxbHHiY1CsCJ7mGwt+CSAwwFOJCHk7UpJCOiD41RAi1D5g7I9meRBKIgMN34CkP1LGEoTXACd1ljJUPwINW33+tzVdQgkND/5j5SJJ0D7l2OCwCjjGl+gJO4HMFNYJ8OJifn7FO5LK/aBcjbnuq0duax5irlrVYjUlsQb0XF/meTwq89W/+YkCodp1i9RiEC1doTIRNAtlV1qzY9khtyF2APZnHbrtFdB9waCaDiIiXXevebB/Swak3gk60hEbwPMiQYsB+RCyyNF2TwmXoOPc3Q1Vuj/U8FoA0YCz73Ti6S0I5DrXM6HMFfqUkY5LZ2q8Mk2qNKeAgUF7no2sI/xRwJH4ZPixZNLThZDaZlmtwWWq/DGt5MXge9qffdE/KNDbgFwmp/kUKfbJMWkEi3xldVjtSjAopOStRcdY29U4/AAZNOaCalqj9njpX6gzZVbX+Szgl0Tn6f0j9X3QrMIyTfrvALjEz+i5Kw1Ie5tgQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN7PR03MB3618.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(346002)(376002)(39860400002)(366004)(451199021)(8936002)(8676002)(26005)(54906003)(31686004)(41300700001)(82960400001)(316002)(6916009)(4326008)(6512007)(66899021)(5660300002)(186003)(6506007)(6666004)(478600001)(66556008)(66946007)(6486002)(66476007)(7416002)(53546011)(31696002)(86362001)(2616005)(36756003)(83380400001)(2906002)(38100700002)(43740500002)(45980500001);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eUl2R2w3VjRWb2JNcG5KdlUzbVl1M3JoSmFYUGVodGdPWmNjc0dJVmlrcFBw?=
 =?utf-8?B?TGl2L0hDa3JQZitkaTQ1dkJyYm44SGxoUUxrVW9FSTZjK21oZ3FaTUF3aDlh?=
 =?utf-8?B?cTNKMWVxVjlWOWppeUlkcEJyOFhjaWVPTk1KOTVucmhmSW50bmhWSFJ3a1Zt?=
 =?utf-8?B?M1FiaTVja01rd08yVmRHQlJKVzI0bDZQb1czM3lLSm50elN2UDdDdnV5K01m?=
 =?utf-8?B?ZGRYbEY0VGx6K1luUGtzN091NEYwZUxQcGNTc0wyWWx5eWpMQ285bFZ3MHlR?=
 =?utf-8?B?VldNVVJCeXRDQkF1UTNIRTBsWWI5ekpacllISlYzTU85YXVPQkZxVGRLWmV2?=
 =?utf-8?B?Y0krY2M5QmtDd1VjeXROWjZoUm1CdE81Tm9kTlVQdlFYQU9Tei80eHFDVS9Q?=
 =?utf-8?B?VFdjUTc4dFhWRFBHOFV0QXo2UzZKUlV0RWQxRTJIQWIxSFJES2g0Qi9PWUpY?=
 =?utf-8?B?UjNEcmlldisraXdRTEt5Q09pSGp4aDFHbTdhMVNTaWlTL1pFaXoyVFdwMGRa?=
 =?utf-8?B?anRwNEtBK2p2Vys1eUpUU3JOazdzd2tkWlAzS0VqWkY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R5SrFkLOem/rKwiqO5XIEqrCEvhVuPMC9Z6xA0H1d/Navp+P8sVHW9oKKpikYaNR+FLQsdHVlxKRY4Mtr/GzcAuvTKdE9mxn8O2IuLCp+S7Cno/wvHUE0aFyNAtmZUV4AaIsigDfiDDKOXd9BibrQy5KfBNwTB/oZ07xV6lNs03oPwS7COtXDRFCpJC7dOOroX2ZXuUtNRkIPUM9XCoZKJ82cureddV+5IafVUbtdWr8XNQCkjfVn7DlOw6nsidOfmf+JUXy+C1pyMpbXxbS1KgjOSOVh8PsOOZiitDP4L1NxquWYGz4dciEw8zQnickmbhAUNdqxUd1WjQlKd/ZrvZq2kZzVXimQU2C5PfNt5KINcUjacfu7S0G/RpKcHH+5INtPcHwD7OQDsBY7QhsT8QJOg5riyFFyI54WCx7ePCGEIC5wIhSA2nJ3A8k12PF8wmqfIszX5PwMqPovd3sakxekxLN9YwMey3WNAJNTzJ3T3914XimrHmKrtcgdQUsUfLgwyGEGaR2bosIqdtvA976kqyun1vsHQCZyhroPQHfQB8kj82qtEpN/j/R2ADX60nFmfui5UPCiQSgEm6BWwD7YKf3ty2seJjDxELm9WcgFPBB48Cx8Lw4RUXvW8hrZ99tTLNvhasm8+scl8sOTvkBuFo28OLiXV9SxM7OAxdPy0/OfoPJG4pLPFt8XZek2Yol6LE101QkJbb93zDJbjd6LqOcs3Nu4ezo+DLRzYBoQaZzVeZjJj717IvhyCFWcvl2/mFr2+UINimVNhxkyQKQGh5g6xz5/mI75AT6Ieh5zzwriuOsTPHYstUpIltCVaXnw7KnDyXQH+YVwzbdlGubM83wTd78Z5Hg+c=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 80cbceb3-3109-471f-f222-08db91ecf11c
X-MS-Exchange-CrossTenant-AuthSource: BN7PR03MB3618.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 17:38:24.9257
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: P8erYUoR3k6emS1URFQJONRCqqEYdMSqMscawwAxRXgPqE0bCwH4wD/ZevPZveKpz+8hBP29o4W8pC+p0AIW//SKo1zb2e+DKrpv9SBSNUw=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR03MB6911

On 31/07/2023 9:00 am, Jan Beulich wrote:
> On 28.07.2023 18:58, Andrew Cooper wrote:
>> On 28/07/2023 5:36 pm, Andrew Cooper wrote:
>>> On 28/07/2023 8:59 am, Alejandro Vallejo wrote:
>>>> Adds a new compile-time flag to allow disabling pdx compression and
>>>> compiles out compression-related code/data. It also shorts the pdx<->pfn
>>>> conversion macros and creates stubs for masking fucntions.
>>>>
>>>> While at it, removes the old arch-defined CONFIG_HAS_PDX flag, as it was
>>>> not removable in practice.
>>>>
>>>> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
>>>> ---
>>>> v2:
>>>>   * Merged v1/patch2: Removal of CONFIG_HAS_PDX here (Jan)
>>> This series is now looking fine, except for the Kconfig aspect.
>>>
>>> This is not something any user or developer should ever be queried
>>> about.Â  The feedback on the documentation patches alone show that it's
>>> not understood well by the maintainers, even if the principle is accepted.
>>>
>>> There is never any reason to have this active on x86.
> We can of course continue to disagree here. At least with EXPERT=y
> selecting this option ought to remain possible for x86. Whether or
> not the original systems this scheme was developed for ever went
> public, such systems did (do) exist, and hence running Xen sensibly
> on them (without losing all memory except that on node 0) ought to
> be possible.

There's one system which never made its way into production,
support-for-which in the no-op case is causing a 10% perf hit in at
least one metric, 17% in another.

... and your seriously arguing that we should continue to take this perf
hit?

It is very likely that said machine(s) aren't even powered on these
days, and even if it is on, the vendor can take the overhead of turning
PDX compression on until such time as they make a production system.

Furthermore, it is unrealistic to think that such a machine will ever
make its way into production.Â  Linux has never PDX compression, and
by-and-large if it doesn't run Linux, you can't sell it in the first place.


It is utterly unreasonable to be carrying this overhead in the first
place.Â  PDX compression *should not* have been committed on-by-default
in the first place.Â  (Yes, I know there was no Kconfig back then, and
the review process was non-existent, but someone really should have said
no).

It is equally unreasonable to offer people (under Expert or not) an
ability to shoot themselves in the foot like this.


If in the very unlikely case that such a system does come into
existence, we can consider re-enabling PDX compression (and by that, I
mean doing it in a less invasive way in the common case), but there's
very little chance this will ever be a path we need to take.

>> Â  Indeed, Julien's
>>> quick metric shows how much performance we waste by having it enabled.
>> Further to this, bloat-o-meter says net -30k of code and there are
>> plenty of fastpaths getting a several cacheline reduction from this.
> A similar reduction was achieved

Really?Â  You think that replacing the innermost shift and masking with
an alternative that has a shorter instruction sequence gets you the same
net reduction in code?

I do not find that claim credible.

>  by the BMI2-alt-patching series I
> had put together, yet you weren't willing to come to consensus on
> it.

You have AMD machines, and your patch was alleged to be a performance
improvement.Â  So the fact you didn't spot the problems with PEXT/PDEP on
all AMD hardware prior to Fam19h suggests there was insufficient testing
for an alleged performance improvement.

The patch you posted:

1) Added extra complexity via alternatives, and
2) Reduced performance on AMD systems prior to Fam19h.

in an area of code which useless on all shipping x86 systems.

You literally micro-anti-optimised a no-op path to a more expensive (on
one vendor at least) no-op path, claiming it to be a performance
improvement.

There is no possible way any form of your patch can ever beat
Alejandro's work of just compiling-out the useless logic wholesale.

~Andrew


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 19:03:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 19:03:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573430.898101 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQYAn-0006mJ-Ld; Mon, 31 Jul 2023 19:03:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573430.898101; Mon, 31 Jul 2023 19:03:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQYAn-0006mC-IB; Mon, 31 Jul 2023 19:03:17 +0000
Received: by outflank-mailman (input) for mailman id 573430;
 Mon, 31 Jul 2023 19:03:15 +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
 <SRS0=vA1f=DR=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qQYAl-0006m6-Cw
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 19:03:15 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e466c3c3-2fd4-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 21:03:12 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 156E38285674;
 Mon, 31 Jul 2023 14:03:10 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id WwOdXd17X-2G; Mon, 31 Jul 2023 14:03:09 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 3B551828586F;
 Mon, 31 Jul 2023 14:03:09 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id zvVTwQCAZmCe; Mon, 31 Jul 2023 14:03:09 -0500 (CDT)
Received: from [10.11.0.2] (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 90E898285674;
 Mon, 31 Jul 2023 14:03:08 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e466c3c3-2fd4-11ee-8613-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 3B551828586F
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1690830189; bh=/CQVmrD4JE6izqQUxsfc/Mxv8uX2MMxHIxKzBlZwqcw=;
	h=Message-ID:Date:MIME-Version:To:From;
	b=Q6RFPis9BqzRakKTwMbfHr5zRdOS5E1lsSS+NLtceI4rxM8jr/mwW1j3VraEcLxdT
	 rT1Ys3Bh4iqEEWQqAJMSO5U5l7wVvGpbCgeZQnR52gLFVFL8uEUuHjXmCY4nlg/BTH
	 6QV+2niS1qJo6jllDe2vVFEchSbCLyLrT/mBQrvc=
X-Virus-Scanned: amavisd-new at rptsys.com
Message-ID: <0127f163-a96b-447b-5a1d-da048f293ea2@raptorengineering.com>
Date: Mon, 31 Jul 2023 14:03:07 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 1/5] xen/lib: Move simple_strtoul from common/vsprintf.c
 to lib
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 George Dunlap <george.dunlap@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
 xen-devel@lists.xenproject.org
References: <cover.1690579561.git.sanastasio@raptorengineering.com>
 <294e48747a0f9aee0be4fd178fcab029fa317528.1690579561.git.sanastasio@raptorengineering.com>
 <d280f52a-0d88-77f7-12d7-b952bd1a102f@suse.com>
From: Shawn Anastasio <sanastasio@raptorengineering.com>
In-Reply-To: <d280f52a-0d88-77f7-12d7-b952bd1a102f@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 7/31/23 10:52 AM, Jan Beulich wrote:
> On 28.07.2023 23:35, Shawn Anastasio wrote:
>> Move the simple_strtoul routine which is used throughout the codebase
>> from vsprintf.c to its own file in xen/lib.
>>
>> This allows libfdt to be built on ppc64 even though xen/common doesn't
>> build yet.
>>
>> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
>> ---
>>  xen/common/vsprintf.c    | 37 -------------------------------------
>>  xen/lib/Makefile         |  1 +
>>  xen/lib/simple_strtoul.c | 40 ++++++++++++++++++++++++++++++++++++++++
>>  3 files changed, 41 insertions(+), 37 deletions(-)
>>  create mode 100644 xen/lib/simple_strtoul.c
> 
> What about its siblings? It'll be irritating to find one here and the
> other there.

I was debating whether to do this or not and ultimately decided to only
make the minimum changes that were required right now. I can go ahead
and make the change for its siblings as well.

> Also please no underscores in (new) filenames unless there's a reason
> for this. In the case here, though, I question the need for "simple"
> in the file name in the first place.

>From a look at the other files in xen/lib there seemed to be a
convention of naming files after the exact function they implement.
Would you rather I rename it to just strtoul.c? Or simple-strotoul.c?

>> --- /dev/null
>> +++ b/xen/lib/simple_strtoul.c
>> @@ -0,0 +1,40 @@
>> +/*
>> + *  Copyright (C) 1991, 1992  Linus Torvalds
>> + */
>> +
>> +#include <xen/ctype.h>
>> +
>> +/**
>> + * simple_strtoul - convert a string to an unsigned long
>> + * @cp: The start of the string
>> + * @endp: A pointer to the end of the parsed string will be placed here
>> + * @base: The number base to use
>> + */
>> +unsigned long simple_strtoul(
>> +    const char *cp, const char **endp, unsigned int base)
>> +{
>> +    unsigned long result = 0,value;
>> +
>> +    if (!base) {
>> +        base = 10;
>> +        if (*cp == '0') {
>> +            base = 8;
>> +            cp++;
>> +            if ((toupper(*cp) == 'X') && isxdigit(cp[1])) {
>> +                cp++;
>> +                base = 16;
>> +            }
>> +        }
>> +    } else if (base == 16) {
>> +        if (cp[0] == '0' && toupper(cp[1]) == 'X')
>> +            cp += 2;
>> +    }
>> +    while (isxdigit(*cp) &&
>> +           (value = isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < base) {
>> +        result = result*base + value;
>> +        cp++;
>> +    }
>> +    if (endp)
>> +        *endp = cp;
>> +    return result;
>> +}
> 
> While moving, I think it would be nice if this stopped using neither
> Xen nor Linux style. I'm not going to insist, but doing such style
> adjustments right here would be quite nice.

Especially if I'm going to be moving its siblings, I'd rather just copy
the functions verbatim for this patch, if that's acceptable.

> Jan

Thanks,
Shawn


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 19:09:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 19:09:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573433.898112 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQYGz-0007Pa-Ay; Mon, 31 Jul 2023 19:09:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573433.898112; Mon, 31 Jul 2023 19:09:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQYGz-0007PT-7o; Mon, 31 Jul 2023 19:09:41 +0000
Received: by outflank-mailman (input) for mailman id 573433;
 Mon, 31 Jul 2023 19:09:40 +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
 <SRS0=vA1f=DR=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qQYGy-0007PN-AN
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 19:09:40 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cb101030-2fd5-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 21:09:38 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 35019828466F;
 Mon, 31 Jul 2023 14:09:37 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id OI3OpBJRwfgm; Mon, 31 Jul 2023 14:09:36 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 7FC8F82856A7;
 Mon, 31 Jul 2023 14:09:36 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id JCNX9DX1iVkh; Mon, 31 Jul 2023 14:09:36 -0500 (CDT)
Received: from [10.11.0.2] (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id DC7DB828466F;
 Mon, 31 Jul 2023 14:09:35 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cb101030-2fd5-11ee-8613-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 7FC8F82856A7
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1690830576; bh=l3c4PEXYXAr77cJvx/HHykWWQQQQIberQUNciGhsd+0=;
	h=Message-ID:Date:MIME-Version:To:From;
	b=HBWM4vE/mBEh9o1/55ZJwVpiQGjXNDyk4OlMJJdKQ+9eG+txo2z+U/OYMj45XJymq
	 7c7KETSvK10VkZHofzNcflThrU2L9eNrupHU1QB4HpY0o05Smf9XCFWymtaIvTkJ0D
	 UILw5/12c+57utTKuYV/5UybyeSE8bMnUxQTjK4c=
X-Virus-Scanned: amavisd-new at rptsys.com
Message-ID: <a329ee02-0ae3-c8a4-5f82-5ea58d865321@raptorengineering.com>
Date: Mon, 31 Jul 2023 14:09:35 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 2/5] xen/ppc: Switch to medium PIC code model
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1690579561.git.sanastasio@raptorengineering.com>
 <335ce2a18f8cce679dd8b30d11560989131b4337.1690579561.git.sanastasio@raptorengineering.com>
 <904d9448-1fd8-bcd7-2cbd-c9e5752dec66@suse.com>
From: Shawn Anastasio <sanastasio@raptorengineering.com>
In-Reply-To: <904d9448-1fd8-bcd7-2cbd-c9e5752dec66@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 7/31/23 10:58 AM, Jan Beulich wrote:
> On 28.07.2023 23:35, Shawn Anastasio wrote:
>> --- a/xen/arch/ppc/ppc64/head.S
>> +++ b/xen/arch/ppc/ppc64/head.S
>> @@ -1,9 +1,11 @@
>>  /* SPDX-License-Identifier: GPL-2.0-or-later */
>>  
>>  #include <asm/asm-defns.h>
>> +#include <asm/asm-offsets.h>
>>  
>>      .section .text.header, "ax", %progbits
>>  
>> +
>>  ENTRY(start)
> 
> Nit: Stray change?
> 
>> @@ -11,16 +13,19 @@ ENTRY(start)
>>      FIXUP_ENDIAN
>>  
>>      /* set up the TOC pointer */
>> -    LOAD_IMM32(%r2, .TOC.)
>> +    bcl	    20, 31, .+4
> 
> Could you use a label name instead of .+4? Aiui you really mean
> 
>> +1:  mflr    %r12
> 
> ... "1f" there?

Yes, good point. I'll point out that this form of the `bcl` instruction
is specifically defined in the ISA specification as the recommended
way to obtain the address of the next instruction, and hardware
implementations presumably optimize it. Using a label instead of +4
would of course be fine as long as the label immediately follows the
bcl, but if the label was elsewhere then the optimization that the ISA
allows for this specific instruction might not be hit. Just something
that should be kept in mind in case this code is ever refactored.

I'll change it to 1f in v2.

> 
> Jan

Thanks,
Shawn


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 19:10:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 19:10:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573435.898122 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQYHp-0000Lj-KI; Mon, 31 Jul 2023 19:10:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573435.898122; Mon, 31 Jul 2023 19:10:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQYHp-0000Lc-H3; Mon, 31 Jul 2023 19:10:33 +0000
Received: by outflank-mailman (input) for mailman id 573435;
 Mon, 31 Jul 2023 19:10:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=vA1f=DR=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qQYHo-0000LT-Jo
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 19:10:32 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ea194a2f-2fd5-11ee-b255-6b7b168915f2;
 Mon, 31 Jul 2023 21:10:30 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 8113E828466F;
 Mon, 31 Jul 2023 14:10:29 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id Ll8us8oKiyNv; Mon, 31 Jul 2023 14:10:28 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id BAE1582856A7;
 Mon, 31 Jul 2023 14:10:28 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id zDsMDfKnZ33e; Mon, 31 Jul 2023 14:10:28 -0500 (CDT)
Received: from [10.11.0.2] (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id 2F562828466F;
 Mon, 31 Jul 2023 14:10:28 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ea194a2f-2fd5-11ee-b255-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com BAE1582856A7
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1690830628; bh=m0zcKQFiB+S7bs/VBJ4VmiE/Y9E4MMVfcn49xchWozY=;
	h=Message-ID:Date:MIME-Version:To:From;
	b=GsyRgg8bOmmmVeKvIuUqL7WyUD5CbdkwFYZ61R/uU70GN3gcrjFRJg769kLWRXk2I
	 3Gg8CuBDKnrceyGgf+7/Qq731iswbXjN3FxLLrE+j6ICVJeW82HEvdMWTjiOHOKlgC
	 oHTa1q92qO6+oR90CfetmP349Om2k+3iapEkL938=
X-Virus-Scanned: amavisd-new at rptsys.com
Message-ID: <123b9273-c2c8-9fad-786e-e02821c3839e@raptorengineering.com>
Date: Mon, 31 Jul 2023 14:10:27 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 3/5] xen/ppc: Add OPAL API definition header file
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1690579561.git.sanastasio@raptorengineering.com>
 <7feead05db9baa310feaddd24415774582e88344.1690579561.git.sanastasio@raptorengineering.com>
 <7206fb11-a34e-4c47-3f15-83f5410db37a@suse.com>
From: Shawn Anastasio <sanastasio@raptorengineering.com>
In-Reply-To: <7206fb11-a34e-4c47-3f15-83f5410db37a@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 7/31/23 10:59 AM, Jan Beulich wrote:
> On 28.07.2023 23:35, Shawn Anastasio wrote:
>> OPAL (OpenPower Abstraction Layer) is the interface exposed by firmware
>> on PowerNV (bare metal) systems. Import Linux's header definining the
>> API and related information.
> 
> To help future updating, mentioning version (or commit) at which this
> snapshot was taken would be helpful.

Sounds reasonable. I'll reference the Linux commit that this was pulled
from in the commit message.

> Jan

Thanks,
Shawn


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 19:24:10 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 19:24:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573439.898131 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQYUu-0001uv-O3; Mon, 31 Jul 2023 19:24:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573439.898131; Mon, 31 Jul 2023 19:24:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQYUu-0001uo-LH; Mon, 31 Jul 2023 19:24:04 +0000
Received: by outflank-mailman (input) for mailman id 573439;
 Mon, 31 Jul 2023 19:24:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQYUt-0001ue-7X; Mon, 31 Jul 2023 19:24:03 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQYUt-00015D-4Z; Mon, 31 Jul 2023 19:24:03 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQYUs-0006VA-Q1; Mon, 31 Jul 2023 19:24:02 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qQYUs-0001yW-Ow; Mon, 31 Jul 2023 19:24:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=O0+IldCfGlBHhAinqCtewLQaARquRYJQ4yMgpkb2fJA=; b=iQheRAurQQFzwblVEZE2btcd9L
	qHGj5WrGJ4bS28HduqTyuO5+HGSqviOh6D75kOG291kpCCQtQ5IkUqEpCjn29y7+io4cBHV8djE/o
	4Jfm3r8u/GuNna2iwPgHLxdBnGwvraGeGSH0R2VTPUgawOZIWKDiVyc23zuKPkmiUNR4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182091-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 182091: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=c0dd53b8cbd1e47e9c89873a9265a7170bdc6b4c
X-Osstest-Versions-That:
    xen=fff3c99f84589a876fcd8467ea99f2c8d9ff8d21
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 31 Jul 2023 19:24:02 +0000

flight 182091 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182091/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  c0dd53b8cbd1e47e9c89873a9265a7170bdc6b4c
baseline version:
 xen                  fff3c99f84589a876fcd8467ea99f2c8d9ff8d21

Last test of basis   182066  2023-07-29 02:00:29 Z    2 days
Testing same since   182091  2023-07-31 13:00:28 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   fff3c99f84..c0dd53b8cb  c0dd53b8cbd1e47e9c89873a9265a7170bdc6b4c -> smoke


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 19:30:39 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 19:30:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573444.898141 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQYbC-0003Ov-Dy; Mon, 31 Jul 2023 19:30:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573444.898141; Mon, 31 Jul 2023 19:30:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQYbC-0003Oo-BV; Mon, 31 Jul 2023 19:30:34 +0000
Received: by outflank-mailman (input) for mailman id 573444;
 Mon, 31 Jul 2023 19:30:33 +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 <SRS0=L1gI=DR=suse.de=tiwai@srs-se1.protection.inumbo.net>)
 id 1qQYbB-0003Oi-EO
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 19:30:33 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b5f88d00-2fd8-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 21:30:31 +0200 (CEST)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 62B401F8B9;
 Mon, 31 Jul 2023 19:30:30 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id F4174133F7;
 Mon, 31 Jul 2023 19:30:29 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 4dSvOtULyGTxYAAAMHmgww
 (envelope-from <tiwai@suse.de>); Mon, 31 Jul 2023 19:30:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b5f88d00-2fd8-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1690831830; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=u7USeY0/jtJxkYj9/QN1XyAb2M3n3eeaiC5yDhmFdY8=;
	b=wfOQ7CjFJqQePEa7OdDroF7echFEOEHR/6vLvlCgaHsMGc5p3jgEArAk5dc0jkq2W2SGSy
	GfcClBPxAOQ6E6Gw1fQREbSQEwYnUAY2Evc0hsf6IqB3iyr3y0XmXAGuhNYxL7mMHBbSJS
	2BCLtuk3fcVYke+aItcBz9RgRJ2HhEM=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1690831830;
	h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=u7USeY0/jtJxkYj9/QN1XyAb2M3n3eeaiC5yDhmFdY8=;
	b=Qd4OrjEGeQ8Yv2c20NXO+uRfjaHL2ARq+fEgYKcKp+AaD4GHakZdhSu2htPkHeqG/+cw+Y
	6ecdtJBy3k+qWYAA==
Date: Mon, 31 Jul 2023 21:30:29 +0200
Message-ID: <87h6pjj2ui.wl-tiwai@suse.de>
From: Takashi Iwai <tiwai@suse.de>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Andrey Utkin <andrey_utkin@fastmail.com>,
	Anton Sviridenko <anton@corp.bluecherry.net>,
	Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>,
	Banajit Goswami <bgoswami@quicinc.com>,
	Bluecherry Maintainers <maintainers@bluecherrydvr.com>,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	Ismael Luceno <ismael@iodev.co.uk>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Olivier Moysan <olivier.moysan@foss.st.com>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	linux-media@vger.kernel.org,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 00/24] ALSA: Generic PCM copy ops using sockptr_t
In-Reply-To: <b906d60b-ece4-45b5-8167-2046c8dc00f4@sirena.org.uk>
References: <20230731154718.31048-1-tiwai@suse.de>
	<b906d60b-ece4-45b5-8167-2046c8dc00f4@sirena.org.uk>
User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: text/plain; charset=US-ASCII

On Mon, 31 Jul 2023 19:20:54 +0200,
Mark Brown wrote:
> 
> On Mon, Jul 31, 2023 at 05:46:54PM +0200, Takashi Iwai wrote:
> 
> > this is a patch set to clean up the PCM copy ops using sockptr_t as a
> > "universal" pointer, inspired by the recent patch from Andy
> > Shevchenko:
> >   https://lore.kernel.org/r/20230721100146.67293-1-andriy.shevchenko@linux.intel.com
> 
> > Even though it sounds a bit weird, sockptr_t is a generic type that is
> > used already in wide ranges, and it can fit our purpose, too.  With
> > sockptr_t, the former split of copy_user and copy_kernel PCM ops can
> > be unified again gracefully.
> 
> It really feels like we ought to rename, or add an alias for, the type
> if we're going to start using it more widely - it's not helping to make
> the code clearer.

That was my very first impression, too, but I changed my mind after
seeing the already used code.  An alias might work, either typedef or
define genptr_t or such as sockptr_t.  But we'll need to copy the
bunch of helper functions, too...


Takashi


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 19:40:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 19:40:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573448.898152 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQYkr-0004vb-D3; Mon, 31 Jul 2023 19:40:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573448.898152; Mon, 31 Jul 2023 19:40:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQYkr-0004vU-8l; Mon, 31 Jul 2023 19:40:33 +0000
Received: by outflank-mailman (input) for mailman id 573448;
 Mon, 31 Jul 2023 19:40:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=SXid=DR=kernel.org=broonie@srs-se1.protection.inumbo.net>)
 id 1qQYkp-0004vO-Nc
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 19:40:31 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1a7ad81e-2fda-11ee-b256-6b7b168915f2;
 Mon, 31 Jul 2023 21:40:29 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 21202612A4;
 Mon, 31 Jul 2023 19:40:28 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B911C433C8;
 Mon, 31 Jul 2023 19:40:23 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1a7ad81e-2fda-11ee-b256-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690832427;
	bh=cECi6X2ci0DniQ5oeatUmvY4BynKLN24yIpTW2oqPUI=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=Pu9Dt3cSyPkYegGJ9c3RcGLOHMiyjYlxy/c+dwSkik3hsSr6ii0UfV6pPXMzZSw29
	 fNPgqyOvrwfliVIKt5AJGy9mdsQbq2/YtSbIgqQrylUNJRxumy+84RfsQmE4Dw5kIF
	 jE0dvSuBEn8+vMUiwPMxmECNCKPjy6HouNQ0BIEvdwkJur+8uYFtYjgVvSnIKWzQdM
	 DDHosgDyhiqhIGv4zx2nbjuiMqJIOMvgMg3B1WrnybC49P4DpFjq9Uo8HNWIZo+caz
	 wxxRfmO6DVmxgkHaE5PiQMgBuzVfh8Ofd2/8j1UG5oO7efcMiHxz3k5Js6tEMzyyfc
	 PmqH1QqxTbzQg==
Date: Mon, 31 Jul 2023 20:40:20 +0100
From: Mark Brown <broonie@kernel.org>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Andrey Utkin <andrey_utkin@fastmail.com>,
	Anton Sviridenko <anton@corp.bluecherry.net>,
	Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>,
	Banajit Goswami <bgoswami@quicinc.com>,
	Bluecherry Maintainers <maintainers@bluecherrydvr.com>,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	Ismael Luceno <ismael@iodev.co.uk>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Olivier Moysan <olivier.moysan@foss.st.com>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	linux-media@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH 00/24] ALSA: Generic PCM copy ops using sockptr_t
Message-ID: <a02cf5c3-1fac-4ec6-9d9c-f8e8d0c067e0@sirena.org.uk>
References: <20230731154718.31048-1-tiwai@suse.de>
 <b906d60b-ece4-45b5-8167-2046c8dc00f4@sirena.org.uk>
 <87h6pjj2ui.wl-tiwai@suse.de>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="MD/Kb6s/g3sL17i7"
Content-Disposition: inline
In-Reply-To: <87h6pjj2ui.wl-tiwai@suse.de>
X-Cookie: Single tasking: Just Say No.


--MD/Kb6s/g3sL17i7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Mon, Jul 31, 2023 at 09:30:29PM +0200, Takashi Iwai wrote:
> Mark Brown wrote:

> > It really feels like we ought to rename, or add an alias for, the type
> > if we're going to start using it more widely - it's not helping to make
> > the code clearer.

> That was my very first impression, too, but I changed my mind after
> seeing the already used code.  An alias might work, either typedef or
> define genptr_t or such as sockptr_t.  But we'll need to copy the
> bunch of helper functions, too...

I would predict that if the type becomes more widely used that'll happen
eventually and the longer it's left the more work it'll be.

--MD/Kb6s/g3sL17i7
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmTIDiMACgkQJNaLcl1U
h9AUpgf+MRJ3Ppt4G8lH1I84wnMH5JXZKHV/vI1aV9xjjvXIKtZE/+CSYf6550C7
PPTHfzwnBYOTWVgfWpHzHkq4xz7gabS1iz+uA8zxlWUAANI55/958s9gfaUZuSaT
Iepv46KwktU7+VbRzRMDAmgONLI5mwne+8NxLW50eigUKQI9f+oP9W8xpmdP2d22
oGEIbn/BHmGWoQ6RPfY3HT2g3FVmr8i63MfkUTWDuJJ28/NrYttI78uMnxTIQ6sD
iGPaAtosS7XVd0iLf5CX4pxb+YoTNLQvC1dUX7PJ6bqZ5d140yXESPgyw3Lp8Q8l
WoEQ/BSZ7E+q6JpVPksvRB7XC1vkAA==
=VfqI
-----END PGP SIGNATURE-----

--MD/Kb6s/g3sL17i7--


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 19:46:31 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 19:46:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573453.898162 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQYqY-0005b4-4m; Mon, 31 Jul 2023 19:46:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573453.898162; Mon, 31 Jul 2023 19:46:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQYqY-0005ax-1F; Mon, 31 Jul 2023 19:46:26 +0000
Received: by outflank-mailman (input) for mailman id 573453;
 Mon, 31 Jul 2023 19:46:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=B7w7=DR=tesarici.cz=petr@srs-se1.protection.inumbo.net>)
 id 1qQYqW-0005ar-2p
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 19:46:24 +0000
Received: from bee.tesarici.cz (bee.tesarici.cz [77.93.223.253])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ed102b59-2fda-11ee-b256-6b7b168915f2;
 Mon, 31 Jul 2023 21:46:22 +0200 (CEST)
Received: from meshulam.tesarici.cz
 (dynamic-2a00-1028-83b8-1e7a-b985-910f-39e1-703f.ipv6.o2.cz
 [IPv6:2a00:1028:83b8:1e7a:b985:910f:39e1:703f])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest
 SHA256) (No client certificate requested)
 by bee.tesarici.cz (Postfix) with ESMTPSA id EAA8B178227;
 Mon, 31 Jul 2023 21:46:18 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ed102b59-2fda-11ee-b256-6b7b168915f2
Authentication-Results: mail.tesarici.cz; dmarc=fail (p=none dis=none) header.from=tesarici.cz
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tesarici.cz; s=mail;
	t=1690832779; bh=KWGiVMKtI706Wwo+DM5RpfJ8QcAflbLeZoJQleXTj7w=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
	b=DCbut2Q1V/o96bevVJ5VH0tsE8RBOG34SkaIN2hyTrDSOvmqWteKWg9WSSEmkSDR/
	 7zEcP3LPJCP0C30n9bKPAcmiiYpu7Srh/GV83YQ3KdTEhs0WmTtBNg9apNXr3D4vM9
	 l+cuuubqpoexTeGXas2IjL8jUpRGjQ4lIgZ7qtkkxPLv/dtnfOM4sW9s/NJ/VXCJbW
	 bPmzFIP6+7hKJ/ThN/ccfBtqYIIyBpGyv67t5YdZ3SQFvyi67polQGKVblNs06g0Hr
	 I86Dg302FpL39M5+5q5pMGvrRpcg2f/33XsKuUuAZUtFISY1nQ6bvC7px1r0e4AGzy
	 6AOiYmUbWlVNw==
Date: Mon, 31 Jul 2023 21:46:18 +0200
From: Petr =?UTF-8?B?VGVzYcWZw61r?= <petr@tesarici.cz>
To: Christoph Hellwig <hch@lst.de>
Cc: Petr Tesarik <petrtesarik@huaweicloud.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Russell King <linux@armlinux.org.uk>, Thomas
 Bogendoerfer <tsbogend@alpha.franken.de>, Thomas Gleixner
 <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov
 <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "maintainer:X86
 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@kernel.org>, "H. Peter Anvin"
 <hpa@zytor.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Rafael
 J. Wysocki" <rafael@kernel.org>, Juergen Gross <jgross@suse.com>, Oleksandr
 Tyshchenko <oleksandr_tyshchenko@epam.com>, Marek Szyprowski
 <m.szyprowski@samsung.com>, Robin Murphy <robin.murphy@arm.com>, Christoph
 Lameter <cl@linux.com>, Pekka Enberg <penberg@kernel.org>, David Rientjes
 <rientjes@google.com>, Joonsoo Kim <iamjoonsoo.kim@lge.com>, Andrew Morton
 <akpm@linux-foundation.org>, Vlastimil Babka <vbabka@suse.cz>, Roman
 Gushchin <roman.gushchin@linux.dev>, Hyeonggon Yoo <42.hyeyoo@gmail.com>,
 Petr Tesarik <petr.tesarik.ext@huawei.com>, Jonathan Corbet
 <corbet@lwn.net>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Hans
 de Goede <hdegoede@redhat.com>, James Seo <james@equiv.tech>, James Clark
 <james.clark@arm.com>, Kees Cook <keescook@chromium.org>, "moderated
 list:XEN HYPERVISOR ARM" <xen-devel@lists.xenproject.org>, "moderated
 list:ARM PORT" <linux-arm-kernel@lists.infradead.org>, open list
 <linux-kernel@vger.kernel.org>, "open list:MIPS"
 <linux-mips@vger.kernel.org>, "open list:XEN SWIOTLB SUBSYSTEM"
 <iommu@lists.linux.dev>, "open list:SLAB ALLOCATOR" <linux-mm@kvack.org>,
 Roberto Sassu <roberto.sassu@huaweicloud.com>
Subject: Re: [PATCH v6 0/9] Allow dynamic allocation of software IO TLB
 bounce buffers
Message-ID: <20230731214618.6e7cde05@meshulam.tesarici.cz>
In-Reply-To: <20230731160409.GA8991@lst.de>
References: <cover.1690459412.git.petr.tesarik.ext@huawei.com>
	<20230731160409.GA8991@lst.de>
X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

V Mon, 31 Jul 2023 18:04:09 +0200
Christoph Hellwig <hch@lst.de> naps=C3=A1no:

> I was just going to apply this, but patch 1 seems to have a non-trivial
> conflict with the is_swiotlb_active removal in pci-dma.c.  Can you resend
> against the current dma-mapping for-next tree?

Sure thing, will re-send tomorrow morning.

Petr T


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 21:13:03 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 21:13:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573457.898171 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQaC5-0006bY-1u; Mon, 31 Jul 2023 21:12:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573457.898171; Mon, 31 Jul 2023 21:12:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQaC4-0006bR-VJ; Mon, 31 Jul 2023 21:12:44 +0000
Received: by outflank-mailman (input) for mailman id 573457;
 Mon, 31 Jul 2023 21:12:43 +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
 <SRS0=Bj4f=DR=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qQaC2-0006bL-V4
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 21:12:43 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fa71bd8a-2fe6-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 23:12:39 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id C9DFB612A4;
 Mon, 31 Jul 2023 21:12:37 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DFFEC433C7;
 Mon, 31 Jul 2023 21:12:36 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fa71bd8a-2fe6-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690837957;
	bh=WajtNFYzP1iusjY0NiPQ4mUezQSAlj+MmvDIw9KtFDs=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=EG4qjLzEgy1ejUcTY1Wg51LebxduVaNUihLApM2X+9y87jXvrXm19AGybwVtgtImF
	 EohIscr2C2k29YqW8jBs4hSNUEK9xi7hDcsQ9WFSFDQjpZ+jahr2Fque5C2i4jNHq9
	 lFYjlBHU4L979eV2IwAEYBw/o8jpapJf/Tlw1YlwyKtXD3yJCiUr/sPCBr0yNWiB5t
	 IQinEGjTlDNCyBb6QXWnLqYyzcZGDcEWkOctH1elfVXsbkBRxG23H7aLgcxjVd5Lkw
	 TZZl66mLCHj5gS/sRw2UcUiyRUqyePrN+tfgBLZ8TYXJAzT2eyvyE0B5NObos60i3l
	 FRpsj6QQjdAsQ==
Date: Mon, 31 Jul 2023 14:12:35 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Nicola Vetrini <nicola.vetrini@bugseng.com>
Subject: Re: [PATCH] x86/HVM: tidy _hvm_load_entry() for style
In-Reply-To: <e9035197-b329-af2e-65ed-af31cd0375c2@suse.com>
Message-ID: <alpine.DEB.2.22.394.2307311412290.3118466@ubuntu-linux-20-04-desktop>
References: <e9035197-b329-af2e-65ed-af31cd0375c2@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 31 Jul 2023, Jan Beulich wrote:
> The primary goal is to eliminate the Misra-non-compliance of "desc"
> shadowing at least the local variable in hvm_load(). Suffix both local
> variables with underscores, while also
> - dropping leading underscores from parameter names (applying this also
>   to the two wrapper macros),
> - correcting indentation,
> - correcting brace placement,
> - dropping unnecessary parentheses around parameter uses when those are
>   passed on as plain arguments.

you might want (or not want) to mention the s/1/true/ and s/0/false/


> No functional change intended.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> --- a/xen/arch/x86/include/asm/hvm/save.h
> +++ b/xen/arch/x86/include/asm/hvm/save.h
> @@ -47,30 +47,32 @@ void _hvm_read_entry(struct hvm_domain_c
>   * Unmarshalling: check, then copy. Evaluates to zero on success. This load
>   * function requires the save entry to be the same size as the dest structure.
>   */
> -#define _hvm_load_entry(_x, _h, _dst, _strict) ({                       \
> -    int r;                                                              \
> -    struct hvm_save_descriptor *desc                                    \
> -        = (struct hvm_save_descriptor *)&(_h)->data[(_h)->cur];         \
> -    if ( (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x),                 \
> -               HVM_SAVE_LENGTH(_x), (_strict))) == 0 )                  \
> +#define _hvm_load_entry(x, h, dst, strict) ({                           \
> +    int r_;                                                             \
> +    struct hvm_save_descriptor *desc_                                   \
> +        = (struct hvm_save_descriptor *)&(h)->data[(h)->cur];           \
> +    if ( (r_ = _hvm_check_entry(h, HVM_SAVE_CODE(x),                    \
> +                                HVM_SAVE_LENGTH(x), strict)) == 0 )     \
>      {                                                                   \
> -        _hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH(_x));             \
> -        if ( HVM_SAVE_HAS_COMPAT(_x) &&                                 \
> -             desc->length != HVM_SAVE_LENGTH(_x) )                      \
> -            r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length);          \
> +        _hvm_read_entry(h, dst, HVM_SAVE_LENGTH(x));                    \
> +        if ( HVM_SAVE_HAS_COMPAT(x) &&                                  \
> +             desc_->length != HVM_SAVE_LENGTH(x) )                      \
> +            r_ = HVM_SAVE_FIX_COMPAT(x, dst, desc_->length);            \
>      }                                                                   \
> -    else if (HVM_SAVE_HAS_COMPAT(_x)                                    \
> -             && (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x),          \
> -                       HVM_SAVE_LENGTH_COMPAT(_x), (_strict))) == 0 ) { \
> -        _hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH_COMPAT(_x));      \
> -        r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length);              \
> +    else if (HVM_SAVE_HAS_COMPAT(x)                                     \
> +             && (r_ = _hvm_check_entry(h, HVM_SAVE_CODE(x),             \
> +                                       HVM_SAVE_LENGTH_COMPAT(x),       \
> +                                       strict)) == 0 )                  \
> +    {                                                                   \
> +        _hvm_read_entry(h, dst, HVM_SAVE_LENGTH_COMPAT(x));             \
> +        r_ = HVM_SAVE_FIX_COMPAT(x, dst, desc_->length);                \
>      }                                                                   \
> -    r; })
> +    r_; })
>  
> -#define hvm_load_entry(_x, _h, _dst)            \
> -    _hvm_load_entry(_x, _h, _dst, 1)
> -#define hvm_load_entry_zeroextend(_x, _h, _dst) \
> -    _hvm_load_entry(_x, _h, _dst, 0)
> +#define hvm_load_entry(x, h, dst)            \
> +    _hvm_load_entry(x, h, dst, true)
> +#define hvm_load_entry_zeroextend(x, h, dst) \
> +    _hvm_load_entry(x, h, dst, false)
>  
>  /* Unmarshalling: what is the instance ID of the next entry? */
>  static inline unsigned int hvm_load_instance(const struct hvm_domain_context *h)
> 


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 21:25:17 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 21:25:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573461.898181 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQaO5-0008Bc-4n; Mon, 31 Jul 2023 21:25:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573461.898181; Mon, 31 Jul 2023 21:25:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQaO5-0008BV-23; Mon, 31 Jul 2023 21:25:09 +0000
Received: by outflank-mailman (input) for mailman id 573461;
 Mon, 31 Jul 2023 21:25:08 +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
 <SRS0=Bj4f=DR=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qQaO4-0008BN-0H
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 21:25:08 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b6f68ada-2fe8-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 23:25:05 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id B580E612D6;
 Mon, 31 Jul 2023 21:25:03 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3A85C433C8;
 Mon, 31 Jul 2023 21:25:01 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b6f68ada-2fe8-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690838703;
	bh=KGnD3msMReyKTOzstEIixPQuRNy4ermLgrzW6q8P4l0=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=ceebZu9nTju61/iSF0cZVsAPBjecr8RIa/DpqLUvDsnwgTsX9AJEC3t0saPF/jZ9n
	 nvMuzgKqzwzgQoLMbrpM+G+mzSY+6z0Q8CIuNViMVvTUQGu681ss8e5sxe3UtTnJcH
	 pLWe2JapeVLJxIG1pb84nY6WhGqhYUg9WVT6iBCwm3nZSAwe7Ya7csic94D3Yh8vLT
	 fY1ICCvmf9Djg/49+mEBz5TvlPLBVafQqrsOFIFU+QEQIZGor8Un9JMFeDmYmCpWQp
	 HdS/l5qeQjtTZ73YRH/UZGAdqX/p8BBUThnQcpz6MhRPQy0CuI7YWLyOFj9MpmDxrN
	 L0t7fTlv2IndQ==
Date: Mon, 31 Jul 2023 14:24:57 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    George Dunlap <george.dunlap@citrix.com>, 
    Dario Faggioli <dfaggioli@suse.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Wei Liu <wl@xen.org>
Subject: Re: [XEN PATCH] xen/sched: address violations of MISRA C:2012 Rules
 8.2 and 8.3
In-Reply-To: <072d163857101f4cdaf61b6336b2d8f2e65d7360.1690800014.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307311424490.1972086@ubuntu-linux-20-04-desktop>
References: <072d163857101f4cdaf61b6336b2d8f2e65d7360.1690800014.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 31 Jul 2023, Federico Serafini wrote:
> Give a name to unnamed parameters to address violations of
> MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
> named parameters").
> Keep consistency between parameter names and types used in function
> declarations and the ones used in the corresponding function
> definitions, thus addressing violations of MISRA C:2012 Rule 8.3
> ("All declarations of an object or function shall use the same names
> and type qualifiers").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  xen/common/sched/compat.c  |  2 +-
>  xen/common/sched/credit2.c |  3 ++-
>  xen/common/sched/private.h |  2 +-
>  xen/include/xen/sched.h    | 10 +++++-----
>  4 files changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/xen/common/sched/compat.c b/xen/common/sched/compat.c
> index 040b4caca2..a596e3a226 100644
> --- a/xen/common/sched/compat.c
> +++ b/xen/common/sched/compat.c
> @@ -39,7 +39,7 @@ static int compat_poll(struct compat_sched_poll *compat)
>  
>  #include "core.c"
>  
> -int compat_set_timer_op(u32 lo, s32 hi)
> +int compat_set_timer_op(uint32_t lo, int32_t hi)
>  {
>      return do_set_timer_op(((s64)hi << 32) | lo);
>  }
> diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
> index 87a1e31ee9..7e23fabebb 100644
> --- a/xen/common/sched/credit2.c
> +++ b/xen/common/sched/credit2.c
> @@ -1480,7 +1480,8 @@ static inline void runq_remove(struct csched2_unit *svc)
>      list_del_init(&svc->runq_elem);
>  }
>  
> -void burn_credits(struct csched2_runqueue_data *rqd, struct csched2_unit *, s_time_t);
> +void burn_credits(struct csched2_runqueue_data *rqd, struct csched2_unit *svc,
> +                  s_time_t now);
>  
>  static inline void
>  tickle_cpu(unsigned int cpu, struct csched2_runqueue_data *rqd)
> diff --git a/xen/common/sched/private.h b/xen/common/sched/private.h
> index 0527a8c70d..c516976c37 100644
> --- a/xen/common/sched/private.h
> +++ b/xen/common/sched/private.h
> @@ -629,7 +629,7 @@ int cpu_disable_scheduler(unsigned int cpu);
>  int schedule_cpu_add(unsigned int cpu, struct cpupool *c);
>  struct cpu_rm_data *alloc_cpu_rm_data(unsigned int cpu, bool aff_alloc);
>  void free_cpu_rm_data(struct cpu_rm_data *mem, unsigned int cpu);
> -int schedule_cpu_rm(unsigned int cpu, struct cpu_rm_data *mem);
> +int schedule_cpu_rm(unsigned int cpu, struct cpu_rm_data *data);
>  int sched_move_domain(struct domain *d, struct cpupool *c);
>  void sched_migrate_timers(unsigned int cpu);
>  struct cpupool *cpupool_get_by_id(unsigned int poolid);
> diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
> index 854f3e32c0..5be61bb252 100644
> --- a/xen/include/xen/sched.h
> +++ b/xen/include/xen/sched.h
> @@ -789,8 +789,8 @@ int  sched_init_vcpu(struct vcpu *v);
>  void sched_destroy_vcpu(struct vcpu *v);
>  int  sched_init_domain(struct domain *d, unsigned int poolid);
>  void sched_destroy_domain(struct domain *d);
> -long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *);
> -long sched_adjust_global(struct xen_sysctl_scheduler_op *);
> +long sched_adjust(struct domain *d, struct xen_domctl_scheduler_op *op);
> +long sched_adjust_global(struct xen_sysctl_scheduler_op *op);
>  int  sched_id(void);
>  
>  /*
> @@ -831,11 +831,11 @@ void context_switch(
>  
>  /*
>   * As described above, context_switch() must call this function when the
> - * local CPU is no longer running in @prev's context, and @prev's context is
> + * local CPU is no longer running in @vprev's context, and @vprev's context is
>   * saved to memory. Alternatively, if implementing lazy context switching,
> - * ensure that invoking sync_vcpu_execstate() will switch and commit @prev.
> + * ensure that invoking sync_vcpu_execstate() will switch and commit @vprev.
>   */
> -void sched_context_switched(struct vcpu *prev, struct vcpu *vnext);
> +void sched_context_switched(struct vcpu *vprev, struct vcpu *vnext);
>  
>  /* Called by the scheduler to continue running the current VCPU. */
>  void continue_running(
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 21:27:27 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 21:27:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573464.898192 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQaQI-0000Kb-GW; Mon, 31 Jul 2023 21:27:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573464.898192; Mon, 31 Jul 2023 21:27:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQaQI-0000KU-DP; Mon, 31 Jul 2023 21:27:26 +0000
Received: by outflank-mailman (input) for mailman id 573464;
 Mon, 31 Jul 2023 21:27:25 +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
 <SRS0=Bj4f=DR=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qQaQH-0000KO-4m
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 21:27:25 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0930b119-2fe9-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 23:27:23 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id E8C64612DB;
 Mon, 31 Jul 2023 21:27:21 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A497C433C8;
 Mon, 31 Jul 2023 21:27:20 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0930b119-2fe9-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690838841;
	bh=dvNYDOGc8vyZ0Oar2BdKpXZ4dxl8hg0QkZpHXyAQRvg=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=XbVy2MwL7rVm6HlFZ7cKtCCgJjvKRb/pHMNzx7HD9YQ/tXZURtnlDglUyjgjpuOYB
	 K9OIgYLlj/KFuaR+MlnN0LcJymxp81W58PiRiRjRhIEB2V/qnBseOFz6tk3UjzTBxE
	 fMJIBh5dO8ZrIW1hzJUGJJdy00ejcV6Nnu7Dn+BiMrQCED55gxq6IP6RGsKKrgl4WZ
	 9UoH3tROsiqyegWp0VkH1qrv4DjnJk8SfJHVdokV9RqEf3BVy0WceDLkCJoXQAH5EW
	 hlOhFSVZwjL8xCMAg1kZ/lmvM3CElACxvYvccnTuoxGSSRdrSj2YRI872EIqp4uyEE
	 7rJwgRsGkyXtQ==
Date: Mon, 31 Jul 2023 14:27:19 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
    Bertrand Marquis <bertrand.marquis@arm.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [XEN PATCH] xen/arm/IRQ: uniform irq_set_affinity() with x86
 version
In-Reply-To: <018fb3a81eb6669346694f2669333ba4d67ab5c4.1690811728.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307311427120.1972086@ubuntu-linux-20-04-desktop>
References: <018fb3a81eb6669346694f2669333ba4d67ab5c4.1690811728.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 31 Jul 2023, Federico Serafini wrote:
> Change parameter name of irq_set_affinity() to uniform the function
> prototype with the one used by x86.
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  xen/arch/arm/include/asm/irq.h | 2 +-
>  xen/arch/arm/irq.c             | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/arm/include/asm/irq.h b/xen/arch/arm/include/asm/irq.h
> index 105b33b37d..c8044b0371 100644
> --- a/xen/arch/arm/include/asm/irq.h
> +++ b/xen/arch/arm/include/asm/irq.h
> @@ -91,7 +91,7 @@ int platform_get_irq(const struct dt_device_node *device, int index);
>  
>  int platform_get_irq_byname(const struct dt_device_node *np, const char *name);
>  
> -void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask);
> +void irq_set_affinity(struct irq_desc *desc, const cpumask_t *mask);
>  
>  /*
>   * Use this helper in places that need to know whether the IRQ type is
> diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
> index 054bb281d8..09648db17a 100644
> --- a/xen/arch/arm/irq.c
> +++ b/xen/arch/arm/irq.c
> @@ -175,10 +175,10 @@ static inline struct domain *irq_get_domain(struct irq_desc *desc)
>      return irq_get_guest_info(desc)->d;
>  }
>  
> -void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask)
> +void irq_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
>  {
>      if ( desc != NULL )
> -        desc->handler->set_affinity(desc, cpu_mask);
> +        desc->handler->set_affinity(desc, mask);
>  }
>  
>  int request_irq(unsigned int irq, unsigned int irqflags,
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 21:30:34 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 21:30:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573469.898202 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQaTE-0001lA-Sk; Mon, 31 Jul 2023 21:30:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573469.898202; Mon, 31 Jul 2023 21:30:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQaTE-0001l3-Pz; Mon, 31 Jul 2023 21:30:28 +0000
Received: by outflank-mailman (input) for mailman id 573469;
 Mon, 31 Jul 2023 21:30:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Bj4f=DR=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qQaTD-0001ku-93
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 21:30:27 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 76174728-2fe9-11ee-b257-6b7b168915f2;
 Mon, 31 Jul 2023 23:30:25 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 8583861306;
 Mon, 31 Jul 2023 21:30:24 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B74CC433C8;
 Mon, 31 Jul 2023 21:30:22 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 76174728-2fe9-11ee-b257-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690839023;
	bh=LxxxS7CRd/+UGGccMda26GXk/tECTmVLpk8MpWNB/6s=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=dNYPB+XIBwv3bSy7vN7IJdS4yEjrXVEFkfbHt79xL+U1X4geURBcCu+Gj5CoJPa7f
	 s1UjD8vNOKQp1huYlwmy+Ix19GBsflmCUARY04TS3j9GrFZUYyaqwur6KnaC7ZS0iR
	 hQZ/SOv9M/SHxj3RhIBSUKQFutRj6+EeyUNAxnxq/D1c6Cb/ZlEQB2grUe72EU6wiC
	 /SGqre21Fu0PeLe0IeXIkdk9jVPOd4kR7cOaumsy6if31fSZ6xKyrQRYxv2fsA5nF0
	 9eXG8RfyGC7ADUdlp4Nyw2RLwYEmAAFzXiXUvEjDKHuvFVWoSESxyxUXQvC7tR4Iz8
	 5etoC5T3UFowA==
Date: Mon, 31 Jul 2023 14:30:21 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
cc: Jan Beulich <jbeulich@suse.com>, sstabellini@kernel.org, 
    michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, 
    consulting@bugseng.com, Paul Durrant <paul@xen.org>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH 1/4] xen/pci: rename local variable to address MISRA
 C:2012 Rule 5.3
In-Reply-To: <a2c9bc7d87e8c1fe78571d74e10e35d2@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307311429150.1972086@ubuntu-linux-20-04-desktop>
References: <cover.1690810346.git.nicola.vetrini@bugseng.com> <c9c6dd21ec6e88895ebc15ee6fe96090168afb51.1690810346.git.nicola.vetrini@bugseng.com> <dce3d16f-7bc5-a22d-3872-36d3a617c120@suse.com> <a2c9bc7d87e8c1fe78571d74e10e35d2@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 31 Jul 2023, Nicola Vetrini wrote:
> On 31/07/2023 16:16, Jan Beulich wrote:
> > On 31.07.2023 15:34, Nicola Vetrini wrote:
> > > --- a/xen/drivers/passthrough/pci.c
> > > +++ b/xen/drivers/passthrough/pci.c
> > > @@ -650,12 +650,12 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
> > >      struct pci_seg *pseg;
> > >      struct pci_dev *pdev;
> > >      unsigned int slot = PCI_SLOT(devfn), func = PCI_FUNC(devfn);
> > > -    const char *pdev_type;
> > > +    const char *pci_dev_type;
> > 
> > I've always been wondering what purpose the pdev_ prefix served here.
> > There's no other "type" variable in the function, so why make the name
> > longer? (I'm okay to adjust on commit, provided you agree.)
> > 
> > Jan
> 
> No objections.

I reviewed the patch and it is correct:

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


Jan, feel free to pick any name you prefer on commit, e.g. "type".



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 21:32:58 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 21:32:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573472.898212 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQaVc-0002KO-9X; Mon, 31 Jul 2023 21:32:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573472.898212; Mon, 31 Jul 2023 21:32:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQaVc-0002KH-5d; Mon, 31 Jul 2023 21:32:56 +0000
Received: by outflank-mailman (input) for mailman id 573472;
 Mon, 31 Jul 2023 21:32:54 +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
 <SRS0=Bj4f=DR=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qQaVa-0002Jp-B1
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 21:32:54 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cd31d80b-2fe9-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 23:32:52 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id D0D9A612E3;
 Mon, 31 Jul 2023 21:32:50 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B944C433C8;
 Mon, 31 Jul 2023 21:32:49 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cd31d80b-2fe9-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690839170;
	bh=4AdnHWhpzW/J2+cWooP/pa9QAJYZ0ls95xp+KRrm26U=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=O6hywSnDZp838bucUWKjvxFgt+uD9wKzRah0ykNMi6V5OBtH2SGCPWuY/mhtuTngr
	 VTIQDb5TSYdsFvdXreo0zR3s5RJJS/JMF0DwEX5s3VLZGSPRGwu/Ol5BAwNAd3xabC
	 3B8hbvNUj60hVxcPf52X0Meiwdj8KcVjaKzpH//MefCZ59w/0uJ4MVNnQJ5l8vUrJl
	 Gq2XbosPVrGnQ3M38QZKVQstnWraDf4DzaMckglGMmhVMBVAnh3eD9D3n9wSdlgfe5
	 KHLZrTumcFSwh7iT/rIw2GkmylfrtNBmkiX+kFhakbCtOMpBR689nhkBYliPDLTVW5
	 kRcgEf5XIBwFA==
Date: Mon, 31 Jul 2023 14:32:47 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org, 
    michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, 
    consulting@bugseng.com, Jan Beulich <jbeulich@suse.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [XEN PATCH 2/4] amd/iommu: rename functions to address MISRA
 C:2012 Rule 5.3
In-Reply-To: <838e606bfe8b83578970ce73a1ac7d71ccefcd2b.1690810346.git.nicola.vetrini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2307311432410.1972086@ubuntu-linux-20-04-desktop>
References: <cover.1690810346.git.nicola.vetrini@bugseng.com> <838e606bfe8b83578970ce73a1ac7d71ccefcd2b.1690810346.git.nicola.vetrini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 31 Jul 2023, Nicola Vetrini wrote:
> The functions 'machine_bfd' and 'guest_bfd' have gained the
> prefix 'get_' to avoid the mutual shadowing with the homonymous
> parameters in these functions.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  xen/drivers/passthrough/amd/iommu_guest.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/xen/drivers/passthrough/amd/iommu_guest.c b/xen/drivers/passthrough/amd/iommu_guest.c
> index 80a331f546..47a912126a 100644
> --- a/xen/drivers/passthrough/amd/iommu_guest.c
> +++ b/xen/drivers/passthrough/amd/iommu_guest.c
> @@ -38,12 +38,12 @@
>          (reg)->hi = (val) >> 32; \
>      } while (0)
>  
> -static unsigned int machine_bdf(struct domain *d, uint16_t guest_bdf)
> +static unsigned int get_machine_bdf(struct domain *d, uint16_t guest_bdf)
>  {
>      return guest_bdf;
>  }
>  
> -static uint16_t guest_bdf(struct domain *d, uint16_t machine_bdf)
> +static uint16_t get_guest_bdf(struct domain *d, uint16_t machine_bdf)
>  {
>      return machine_bdf;
>  }
> @@ -195,7 +195,7 @@ void guest_iommu_add_ppr_log(struct domain *d, u32 entry[])
>      log = map_domain_page(_mfn(mfn)) + (tail & ~PAGE_MASK);
>  
>      /* Convert physical device id back into virtual device id */
> -    gdev_id = guest_bdf(d, iommu_get_devid_from_cmd(entry[0]));
> +    gdev_id = get_guest_bdf(d, iommu_get_devid_from_cmd(entry[0]));
>      iommu_set_devid_to_cmd(&entry[0], gdev_id);
>  
>      memcpy(log, entry, sizeof(ppr_entry_t));
> @@ -245,7 +245,7 @@ void guest_iommu_add_event_log(struct domain *d, u32 entry[])
>      log = map_domain_page(_mfn(mfn)) + (tail & ~PAGE_MASK);
>  
>      /* re-write physical device id into virtual device id */
> -    dev_id = guest_bdf(d, iommu_get_devid_from_cmd(entry[0]));
> +    dev_id = get_guest_bdf(d, iommu_get_devid_from_cmd(entry[0]));
>      iommu_set_devid_to_cmd(&entry[0], dev_id);
>      memcpy(log, entry, sizeof(event_entry_t));
>  
> @@ -268,7 +268,7 @@ static int do_complete_ppr_request(struct domain *d, cmd_entry_t *cmd)
>      uint16_t dev_id;
>      struct amd_iommu *iommu;
>  
> -    dev_id = machine_bdf(d, iommu_get_devid_from_cmd(cmd->data[0]));
> +    dev_id = get_machine_bdf(d, iommu_get_devid_from_cmd(cmd->data[0]));
>      iommu = find_iommu_for_device(0, dev_id);
>  
>      if ( !iommu )
> @@ -320,7 +320,7 @@ static int do_invalidate_iotlb_pages(struct domain *d, cmd_entry_t *cmd)
>      struct amd_iommu *iommu;
>      uint16_t dev_id;
>  
> -    dev_id = machine_bdf(d, iommu_get_devid_from_cmd(cmd->data[0]));
> +    dev_id = get_machine_bdf(d, iommu_get_devid_from_cmd(cmd->data[0]));
>  
>      iommu = find_iommu_for_device(0, dev_id);
>      if ( !iommu )
> @@ -396,7 +396,7 @@ static int do_invalidate_dte(struct domain *d, cmd_entry_t *cmd)
>  
>      g_iommu = domain_iommu(d);
>      gbdf = iommu_get_devid_from_cmd(cmd->data[0]);
> -    mbdf = machine_bdf(d, gbdf);
> +    mbdf = get_machine_bdf(d, gbdf);
>  
>      /* Guest can only update DTEs for its passthru devices */
>      if ( mbdf == 0 || gbdf == 0 )
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 21:40:41 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 21:40:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573478.898222 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQad0-0003tP-6R; Mon, 31 Jul 2023 21:40:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573478.898222; Mon, 31 Jul 2023 21:40:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQad0-0003tI-3F; Mon, 31 Jul 2023 21:40:34 +0000
Received: by outflank-mailman (input) for mailman id 573478;
 Mon, 31 Jul 2023 21:40:33 +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
 <SRS0=Bj4f=DR=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1qQacy-0003tC-Ui
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 21:40:32 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id de41a2d4-2fea-11ee-8613-37d641c3527e;
 Mon, 31 Jul 2023 23:40:30 +0200 (CEST)
Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by dfw.source.kernel.org (Postfix) with ESMTPS id 9EF0F612F2;
 Mon, 31 Jul 2023 21:40:28 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 304A4C43397;
 Mon, 31 Jul 2023 21:40:26 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: de41a2d4-2fea-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1690839628;
	bh=NzcH+3rbR7RnqSjaZbiwiH9jnASItRJntnVLzzHqLFE=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=PRtNzdfm25+M/dyU/2MUp4D18C47cMcTKJbehsFU285JCW8EZ9Tg6zcRX5s/CV3dc
	 YF4k1MirCH7jq7LW3YG0ru9TZggUOCndY1l/3afFVfBbSZgIEIk4piXpAtlev4rw39
	 E9xa6gWcq8Ejanv/m0T66HL1gZpJULI4aIJc268d8D+8+Da9Nrqhcm8TWw0wF/KIss
	 +sR4taC7axorEi5tZyhIDtiuvHz2zNr8mpX8H985wsHNBZW3sOnobEBvLxtXAiMM7x
	 dLcyJSdudpXvV8iOzyt2stPZldr36scDWt5CQ8BAtDQC2l25uCa5QsAL+QDvkhnaTA
	 37xgt5Vp3ocaA==
Date: Mon, 31 Jul 2023 14:40:24 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: george.dunlap@citrix.com, dfaggioli@suse.com, george.dunlap@cloud.com
cc: Nicola Vetrini <nicola.vetrini@bugseng.com>, 
    xen-devel@lists.xenproject.org, michal.orzel@amd.com, 
    xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, 
    consulting@bugseng.com, George Dunlap <george.dunlap@citrix.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>, 
    sstabellini@kernel.org
Subject: Re: ack needed [XEN PATCH v3] xen/sched: mechanical renaming to
 address MISRA C:2012 Rule 5.3
In-Reply-To: <alpine.DEB.2.22.394.2307281621260.3118466@ubuntu-linux-20-04-desktop>
Message-ID: <alpine.DEB.2.22.394.2307311439320.1972086@ubuntu-linux-20-04-desktop>
References: <12a21bfd59d85c7b8619631edac93d79d7225c60.1690547599.git.nicola.vetrini@bugseng.com> <alpine.DEB.2.22.394.2307281621260.3118466@ubuntu-linux-20-04-desktop>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

George, Dario,

Please ack


On Fri, 28 Jul 2023, Stefano Stabellini wrote:
> On Fri, 28 Jul 2023, Nicola Vetrini wrote:
> > Rule 5.3 has the following headline:
> > "An identifier declared in an inner scope shall not hide an
> > identifier declared in an outer scope"
> > 
> > The renaming s/sched_id/scheduler_id/ of the function defined in
> > 'xen/common/sched/core.c' prevents any hiding of that function
> > by the instances of homonymous function parameters that
> > are defined in inner scopes.
> > 
> > Similarly, the renames
> > - s/ops/operations/ for the static variable in 'xen/common/sched/core.c'
> > - s/do_softirq/needs_softirq/
> > are introduced for variables, to avoid any conflict with homonymous
> > parameters or function identifiers.
> > 
> > Moreover, the variable 'loop' defined at 'xen/common/sched/credit2.c:3887'
> > has been dropped, in favour of the homonymous variable declared in the
> > outer scope. This in turn requires a modification of the printk call that
> > involves it.
> > 
> > Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> 
> 
> > ---
> > Changes in v3:
> > - removed stray changes to address the remarks
> > Changes in v2:
> > - s/softirq/needs_softirq/
> > - Dropped local variable 'it'
> > - Renamed the 'ops' static variable instead of function parameters
> > in the idle scheduler for coherence.
> > 
> > Note: local variable 'j' in xen/common/sched/credit2.c:3812' should
> > probably be unsigned as well, but I saw while editing the patch
> > that it's used as a parameter to 'dump_pcpu', which takes an int.
> > Possibly changing the types of parameters used in these calls is
> > probably a good target for another patch, as it's not relevant
> > w.r.t. Rule 5.3.
> > ---
> >  xen/common/sched/core.c    | 28 ++++++++++++++--------------
> >  xen/common/sched/credit2.c |  6 +++---
> >  xen/common/sysctl.c        |  2 +-
> >  xen/include/xen/sched.h    |  2 +-
> >  4 files changed, 19 insertions(+), 19 deletions(-)
> > 
> > diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
> > index 022f548652..12deefa745 100644
> > --- a/xen/common/sched/core.c
> > +++ b/xen/common/sched/core.c
> > @@ -91,7 +91,7 @@ extern const struct scheduler *__start_schedulers_array[], *__end_schedulers_arr
> >  #define NUM_SCHEDULERS (__end_schedulers_array - __start_schedulers_array)
> >  #define schedulers __start_schedulers_array
> > 
> > -static struct scheduler __read_mostly ops;
> > +static struct scheduler __read_mostly operations;
> > 
> >  static bool scheduler_active;
> > 
> > @@ -171,7 +171,7 @@ static inline struct scheduler *dom_scheduler(const struct domain *d)
> >       * is the default scheduler that has been, choosen at boot.
> >       */
> >      ASSERT(is_idle_domain(d));
> > -    return &ops;
> > +    return &operations;
> >  }
> > 
> >  static inline struct scheduler *unit_scheduler(const struct sched_unit *unit)
> > @@ -2040,10 +2040,10 @@ long do_set_timer_op(s_time_t timeout)
> >      return 0;
> >  }
> > 
> > -/* sched_id - fetch ID of current scheduler */
> > -int sched_id(void)
> > +/* scheduler_id - fetch ID of current scheduler */
> > +int scheduler_id(void)
> >  {
> > -    return ops.sched_id;
> > +    return operations.sched_id;
> >  }
> > 
> >  /* Adjust scheduling parameter for a given domain. */
> > @@ -2579,7 +2579,7 @@ static void cf_check sched_slave(void)
> >      struct sched_unit    *prev = vprev->sched_unit, *next;
> >      s_time_t              now;
> >      spinlock_t           *lock;
> > -    bool                  do_softirq = false;
> > +    bool                  needs_softirq = false;
> >      unsigned int          cpu = smp_processor_id();
> > 
> >      ASSERT_NOT_IN_ATOMIC();
> > @@ -2604,7 +2604,7 @@ static void cf_check sched_slave(void)
> >              return;
> >          }
> > 
> > -        do_softirq = true;
> > +        needs_softirq = true;
> >      }
> > 
> >      if ( !prev->rendezvous_in_cnt )
> > @@ -2614,7 +2614,7 @@ static void cf_check sched_slave(void)
> >          rcu_read_unlock(&sched_res_rculock);
> > 
> >          /* Check for failed forced context switch. */
> > -        if ( do_softirq )
> > +        if ( needs_softirq )
> >              raise_softirq(SCHEDULE_SOFTIRQ);
> > 
> >          return;
> > @@ -3016,14 +3016,14 @@ void __init scheduler_init(void)
> >          BUG_ON(!scheduler);
> >          printk("Using '%s' (%s)\n", scheduler->name, scheduler->opt_name);
> >      }
> > -    ops = *scheduler;
> > +    operations = *scheduler;
> > 
> >      if ( cpu_schedule_up(0) )
> >          BUG();
> >      register_cpu_notifier(&cpu_schedule_nfb);
> > 
> > -    printk("Using scheduler: %s (%s)\n", ops.name, ops.opt_name);
> > -    if ( sched_init(&ops) )
> > +    printk("Using scheduler: %s (%s)\n", operations.name, operations.opt_name);
> > +    if ( sched_init(&operations) )
> >          panic("scheduler returned error on init\n");
> > 
> >      if ( sched_ratelimit_us &&
> > @@ -3363,7 +3363,7 @@ int schedule_cpu_rm(unsigned int cpu, struct cpu_rm_data *data)
> > 
> >  struct scheduler *scheduler_get_default(void)
> >  {
> > -    return &ops;
> > +    return &operations;
> >  }
> > 
> >  struct scheduler *scheduler_alloc(unsigned int sched_id)
> > @@ -3392,7 +3392,7 @@ struct scheduler *scheduler_alloc(unsigned int sched_id)
> > 
> >  void scheduler_free(struct scheduler *sched)
> >  {
> > -    BUG_ON(sched == &ops);
> > +    BUG_ON(sched == &operations);
> >      sched_deinit(sched);
> >      xfree(sched);
> >  }
> > @@ -3416,7 +3416,7 @@ void schedule_dump(struct cpupool *c)
> >      }
> >      else
> >      {
> > -        sched = &ops;
> > +        sched = &operations;
> >          cpus = &cpupool_free_cpus;
> >      }
> > 
> > diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
> > index 87a1e31ee9..fc583915df 100644
> > --- a/xen/common/sched/credit2.c
> > +++ b/xen/common/sched/credit2.c
> > @@ -3874,7 +3874,7 @@ csched2_dump(const struct scheduler *ops)
> > 
> >              lock = unit_schedule_lock(unit);
> > 
> > -            printk("\t%3d: ", ++loop);
> > +            printk("\t%3u: ", ++loop);
> >              csched2_dump_unit(prv, svc);
> > 
> >              unit_schedule_unlock(lock, unit);
> > @@ -3884,8 +3884,8 @@ csched2_dump(const struct scheduler *ops)
> >      list_for_each_entry ( rqd, &prv->rql, rql )
> >      {
> >          struct list_head *iter, *runq = &rqd->runq;
> > -        int loop = 0;
> > 
> > +        loop = 0;
> >          /* We need the lock to scan the runqueue. */
> >          spin_lock(&rqd->lock);
> > 
> > @@ -3901,7 +3901,7 @@ csched2_dump(const struct scheduler *ops)
> > 
> >              if ( svc )
> >              {
> > -                printk("\t%3d: ", loop++);
> > +                printk("\t%3u: ", loop++);
> >                  csched2_dump_unit(prv, svc);
> >              }
> >          }
> > diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
> > index 0cbfe8bd44..7cabfb0230 100644
> > --- a/xen/common/sysctl.c
> > +++ b/xen/common/sysctl.c
> > @@ -71,7 +71,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
> >          break;
> > 
> >      case XEN_SYSCTL_sched_id:
> > -        op->u.sched_id.sched_id = sched_id();
> > +        op->u.sched_id.sched_id = scheduler_id();
> >          break;
> > 
> >      case XEN_SYSCTL_getdomaininfolist:
> > diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
> > index 854f3e32c0..bfe714d2e2 100644
> > --- a/xen/include/xen/sched.h
> > +++ b/xen/include/xen/sched.h
> > @@ -791,7 +791,7 @@ int  sched_init_domain(struct domain *d, unsigned int poolid);
> >  void sched_destroy_domain(struct domain *d);
> >  long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *);
> >  long sched_adjust_global(struct xen_sysctl_scheduler_op *);
> > -int  sched_id(void);
> > +int  scheduler_id(void);
> > 
> >  /*
> >   * sched_get_id_by_name - retrieves a scheduler id given a scheduler name
> > --
> > 2.34.1
> > 
> 


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 21:47:15 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 21:47:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573484.898232 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQajO-0004XF-SZ; Mon, 31 Jul 2023 21:47:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573484.898232; Mon, 31 Jul 2023 21:47:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQajO-0004X8-OC; Mon, 31 Jul 2023 21:47:10 +0000
Received: by outflank-mailman (input) for mailman id 573484;
 Mon, 31 Jul 2023 21:47:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8Zpc=DR=zytor.com=hpa@srs-se1.protection.inumbo.net>)
 id 1qQajN-0004X1-Ot
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 21:47:09 +0000
Received: from mail.zytor.com (unknown [2607:7c80:54:3::138])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id caa8674c-2feb-11ee-b257-6b7b168915f2;
 Mon, 31 Jul 2023 23:47:07 +0200 (CEST)
Received: from [192.168.105.249] ([75.104.94.137]) (authenticated bits=0)
 by mail.zytor.com (8.17.1/8.17.1) with ESMTPSA id 36VLiSLD3093143
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO);
 Mon, 31 Jul 2023 14:44:34 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: caa8674c-2feb-11ee-b257-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 36VLiSLD3093143
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com;
	s=2023071101; t=1690839952;
	bh=Hg2XSL3316ANoXYXjd63x+cCNIVtiqBW14cv6sKLqfM=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=OJyzPW65vrM8sDH6eNGy+5kWbcB7PMYBpzWhQpIWkaAZClwYLyiR8q3r0h24DHa+i
	 plc1tYwGV1X0jnVZoHyMcH21g4d3T5nrZNciwkD9pXyPp9eyd7deKj5//687qepUUN
	 GajcQAPfiwt5T7KF3w3EDPjhuU+UOb+SXF0Ey3xPLdCdh2vlXfVnIDfD1LR2iQn1Q3
	 +p5bLyY/BkC4u9rExXSQvakREpl4pn+K6rV/GzfnNnDvo8xR1x7/0XAWYi0JZGxsUi
	 6sYcbHmh6hzcml78uw2uhAQKsHCzb+/6sFfciH7vXjmIcsvNRtd0H0JUkcPZnEheRh
	 J+lI/W952JXBg==
Message-ID: <4ccbf0e9-716d-dfe0-537c-210e5455418c@zytor.com>
Date: Mon, 31 Jul 2023 14:44:20 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v9 29/36] x86/fred: FRED entry/exit and dispatch code
Content-Language: en-US
To: Xin Li <xin3.li@intel.com>, linux-doc@vger.kernel.org,
        linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org,
        linux-hyperv@vger.kernel.org, kvm@vger.kernel.org,
        xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>, Thomas Gleixner <tglx@linutronix.de>,
        Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
        Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
        Andy Lutomirski <luto@kernel.org>, Oleg Nesterov <oleg@redhat.com>,
        Tony Luck <tony.luck@intel.com>,
        "K . Y . Srinivasan" <kys@microsoft.com>,
        Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>,
        Dexuan Cui <decui@microsoft.com>, Paolo Bonzini <pbonzini@redhat.com>,
        Wanpeng Li <wanpengli@tencent.com>,
        Vitaly Kuznetsov <vkuznets@redhat.com>,
        Sean Christopherson <seanjc@google.com>,
        Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
        Josh Poimboeuf <jpoimboe@kernel.org>,
        "Paul E . McKenney"
 <paulmck@kernel.org>,
        Catalin Marinas <catalin.marinas@arm.com>,
        Randy Dunlap <rdunlap@infradead.org>,
        Steven Rostedt <rostedt@goodmis.org>,
        Kim Phillips <kim.phillips@amd.com>,
        Hyeonggon Yoo <42.hyeyoo@gmail.com>,
        "Liam R . Howlett" <Liam.Howlett@Oracle.com>,
        Sebastian Reichel <sebastian.reichel@collabora.com>,
        "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
        Suren Baghdasaryan <surenb@google.com>,
        Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
        Jiaxi Chen <jiaxi.chen@linux.intel.com>,
        Babu Moger <babu.moger@amd.com>, Jim Mattson <jmattson@google.com>,
        Sandipan Das <sandipan.das@amd.com>,
        Lai Jiangshan <jiangshanlai@gmail.com>,
        Hans de Goede <hdegoede@redhat.com>,
        Reinette Chatre <reinette.chatre@intel.com>,
        Daniel Sneddon <daniel.sneddon@linux.intel.com>,
        Breno Leitao <leitao@debian.org>, Nikunj A Dadhania <nikunj@amd.com>,
        Brian Gerst <brgerst@gmail.com>,
        Sami Tolvanen <samitolvanen@google.com>,
        Alexander Potapenko <glider@google.com>,
        Andrew Morton <akpm@linux-foundation.org>,
        Arnd Bergmann <arnd@arndb.de>,
        "Eric W . Biederman" <ebiederm@xmission.com>,
        Kees Cook <keescook@chromium.org>,
        Masami Hiramatsu <mhiramat@kernel.org>,
        Masahiro Yamada <masahiroy@kernel.org>, Ze Gao <zegao2021@gmail.com>,
        Fei Li <fei1.li@intel.com>, Conghui <conghui.chen@intel.com>,
        Ashok Raj <ashok.raj@intel.com>,
        "Jason A . Donenfeld" <Jason@zx2c4.com>,
        Mark Rutland <mark.rutland@arm.com>,
        Jacob Pan <jacob.jun.pan@linux.intel.com>,
        Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
        Jane Malalane <jane.malalane@citrix.com>,
        David Woodhouse
 <dwmw@amazon.co.uk>,
        Boris Ostrovsky <boris.ostrovsky@oracle.com>,
        Arnaldo Carvalho de Melo <acme@redhat.com>,
        Yantengsi
 <siyanteng@loongson.cn>,
        Christophe Leroy <christophe.leroy@csgroup.eu>,
        Sathvika Vasireddy <sv@linux.ibm.com>
References: <20230731064119.3870-1-xin3.li@intel.com>
From: "H. Peter Anvin" <hpa@zytor.com>
In-Reply-To: <20230731064119.3870-1-xin3.li@intel.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 7/30/23 23:41, Xin Li wrote:
> +
> +static DEFINE_FRED_HANDLER(fred_sw_interrupt_user)
> +{
> +	/*
> +	 * In compat mode INT $0x80 (32bit system call) is
> +	 * performance-critical. Handle it first.
> +	 */
> +	if (IS_ENABLED(CONFIG_IA32_EMULATION) &&
> +	    likely(regs->vector == IA32_SYSCALL_VECTOR)) {
> +		regs->orig_ax = regs->ax;
> +		regs->ax = -ENOSYS;
> +		return do_int80_syscall_32(regs);
> +	}

We can presumably drop the early out here as well...

> +
> +	/*
> +	 * Some software exceptions can also be triggered as
> +	 * int instructions, for historical reasons.
> +	 */
> +	switch (regs->vector) {
> +	case X86_TRAP_BP:
> +	case X86_TRAP_OF:
> +		fred_emulate_trap(regs);
> +		break;
> +	default:
> +		regs->vector = X86_TRAP_GP;
> +		fred_emulate_fault(regs);
> +		break;
> +	}
> +}
> +



From xen-devel-bounces@lists.xenproject.org Mon Jul 31 22:11:04 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 22:11:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573490.898241 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQb6Q-0007zc-Pv; Mon, 31 Jul 2023 22:10:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573490.898241; Mon, 31 Jul 2023 22:10:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQb6Q-0007zV-NN; Mon, 31 Jul 2023 22:10:58 +0000
Received: by outflank-mailman (input) for mailman id 573490;
 Mon, 31 Jul 2023 22:10:57 +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 <SRS0=8Zpc=DR=zytor.com=hpa@srs-se1.protection.inumbo.net>)
 id 1qQb6P-0007zP-S9
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 22:10:57 +0000
Received: from mail.zytor.com (unknown [2607:7c80:54:3::138])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1d47b5ca-2fef-11ee-8613-37d641c3527e;
 Tue, 01 Aug 2023 00:10:55 +0200 (CEST)
Received: from [192.168.105.249] ([75.104.94.137]) (authenticated bits=0)
 by mail.zytor.com (8.17.1/8.17.1) with ESMTPSA id 36VM7txf3103048
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO);
 Mon, 31 Jul 2023 15:08:00 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1d47b5ca-2fef-11ee-8613-37d641c3527e
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 36VM7txf3103048
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com;
	s=2023071101; t=1690841375;
	bh=X+M4w9IgqyGhFftvL0ts+Txt2pH1wocbrviAaT7WSp0=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=XFcw8mHtRsl4TcZ5Z+9TuwZ7pfjvdNqSpwDLDpFsAfd/pRi+FbwrTEcqslERWxffC
	 cgFKch7rqXk7xeaKLgEYkT1cKGAy6lNFxl6xQJ0fbNDJ7sv9zpYGWXBRa8N2lEo5DR
	 G/GCfDVd/qzoFF9SUxuA7hRU/ROGNY4q6TBtRqRfJXYuVJskDXCrkKAQal43XsJ7PX
	 PlycbEss3tGY6NKNX7yE7ihX3QPEQjBg9VfjApas+qZFkVyB7AoO2WWrlZ+j8SXiEq
	 CQq7y33RknpAiyzIOPtVrS0p+SqzFZP4pjxOjHk1xtmUQ70RjsXjOD9F2NjeIVYHD8
	 KsFoANCn7EDLw==
Message-ID: <da169e64-9dad-18a8-611b-57ff74006285@zytor.com>
Date: Mon, 31 Jul 2023 15:07:47 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH v9 29/36] x86/fred: FRED entry/exit and dispatch code
Content-Language: en-US
To: Xin Li <xin3.li@intel.com>, linux-doc@vger.kernel.org,
        linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org,
        linux-hyperv@vger.kernel.org, kvm@vger.kernel.org,
        xen-devel@lists.xenproject.org
Cc: Jonathan Corbet <corbet@lwn.net>, Thomas Gleixner <tglx@linutronix.de>,
        Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
        Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
        Andy Lutomirski <luto@kernel.org>, Oleg Nesterov <oleg@redhat.com>,
        Tony Luck <tony.luck@intel.com>,
        "K . Y . Srinivasan" <kys@microsoft.com>,
        Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>,
        Dexuan Cui <decui@microsoft.com>, Paolo Bonzini <pbonzini@redhat.com>,
        Wanpeng Li <wanpengli@tencent.com>,
        Vitaly Kuznetsov <vkuznets@redhat.com>,
        Sean Christopherson <seanjc@google.com>,
        Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
        Josh Poimboeuf <jpoimboe@kernel.org>,
        "Paul E . McKenney"
 <paulmck@kernel.org>,
        Catalin Marinas <catalin.marinas@arm.com>,
        Randy Dunlap <rdunlap@infradead.org>,
        Steven Rostedt <rostedt@goodmis.org>,
        Kim Phillips <kim.phillips@amd.com>,
        Hyeonggon Yoo <42.hyeyoo@gmail.com>,
        "Liam R . Howlett" <Liam.Howlett@Oracle.com>,
        Sebastian Reichel <sebastian.reichel@collabora.com>,
        "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
        Suren Baghdasaryan <surenb@google.com>,
        Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
        Jiaxi Chen <jiaxi.chen@linux.intel.com>,
        Babu Moger <babu.moger@amd.com>, Jim Mattson <jmattson@google.com>,
        Sandipan Das <sandipan.das@amd.com>,
        Lai Jiangshan <jiangshanlai@gmail.com>,
        Hans de Goede <hdegoede@redhat.com>,
        Reinette Chatre <reinette.chatre@intel.com>,
        Daniel Sneddon <daniel.sneddon@linux.intel.com>,
        Breno Leitao <leitao@debian.org>, Nikunj A Dadhania <nikunj@amd.com>,
        Brian Gerst <brgerst@gmail.com>,
        Sami Tolvanen <samitolvanen@google.com>,
        Alexander Potapenko <glider@google.com>,
        Andrew Morton <akpm@linux-foundation.org>,
        Arnd Bergmann <arnd@arndb.de>,
        "Eric W . Biederman" <ebiederm@xmission.com>,
        Kees Cook <keescook@chromium.org>,
        Masami Hiramatsu <mhiramat@kernel.org>,
        Masahiro Yamada <masahiroy@kernel.org>, Ze Gao <zegao2021@gmail.com>,
        Fei Li <fei1.li@intel.com>, Conghui <conghui.chen@intel.com>,
        Ashok Raj <ashok.raj@intel.com>,
        "Jason A . Donenfeld" <Jason@zx2c4.com>,
        Mark Rutland <mark.rutland@arm.com>,
        Jacob Pan <jacob.jun.pan@linux.intel.com>,
        Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
        Jane Malalane <jane.malalane@citrix.com>,
        David Woodhouse
 <dwmw@amazon.co.uk>,
        Boris Ostrovsky <boris.ostrovsky@oracle.com>,
        Arnaldo Carvalho de Melo <acme@redhat.com>,
        Yantengsi
 <siyanteng@loongson.cn>,
        Christophe Leroy <christophe.leroy@csgroup.eu>,
        Sathvika Vasireddy <sv@linux.ibm.com>
References: <20230731064119.3870-1-xin3.li@intel.com>
From: "H. Peter Anvin" <hpa@zytor.com>
In-Reply-To: <20230731064119.3870-1-xin3.li@intel.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 7/30/23 23:41, Xin Li wrote:
> +static DEFINE_FRED_HANDLER(fred_other_default)
> +{
> +	regs->vector = X86_TRAP_UD;
> +	fred_emulate_fault(regs);
> +}
> +
> +static DEFINE_FRED_HANDLER(fred_syscall)
> +{
> +	regs->orig_ax = regs->ax;
> +	regs->ax = -ENOSYS;
> +	do_syscall_64(regs, regs->orig_ax);
> +}
> +
> +#if IS_ENABLED(CONFIG_IA32_EMULATION)
> +/*
> + * Emulate SYSENTER if applicable. This is not the preferred system
> + * call in 32-bit mode under FRED, rather int $0x80 is preferred and
> + * exported in the vdso.
> + */
> +static DEFINE_FRED_HANDLER(fred_sysenter)
> +{
> +	regs->orig_ax = regs->ax;
> +	regs->ax = -ENOSYS;
> +	do_fast_syscall_32(regs);
> +}
> +#else
> +#define fred_sysenter fred_other_default
> +#endif
> +
> +static DEFINE_FRED_HANDLER(fred_other)
> +{
> +	static const fred_handler user_other_handlers[FRED_NUM_OTHER_VECTORS] =
> +	{
> +		/*
> +		 * Vector 0 of the other event type is not used
> +		 * per FRED spec 5.0.
> +		 */
> +		[0]		= fred_other_default,
> +		[FRED_SYSCALL]	= fred_syscall,
> +		[FRED_SYSENTER]	= fred_sysenter
> +	};
> +
> +	user_other_handlers[regs->vector](regs);
> +}

OK, this is wrong.

Dispatching like fred_syscall() is only valid for syscall64, which means 
you have to check regs->l is set in addition to the correct regs->vector 
to determine validity.

Similarly, sysenter is only valid if regs->l is clear.

The best way is probably to drop the dispatch table here and just do an 
if ... else if ... else statement; gcc is smart enough that it will 
combine the vector test and the L bit test into a single mask and 
compare. This also allows stubs to be inlined.

However, emulating #UD on events other than wrong mode of SYSCALL and 
SYSENTER may be a bad idea. It would probably be better to invoke 
fred_bad_event() in that case.

Something like this:

+static DEFINE_FRED_HANDLER(fred_other_default)
+{
+	regs->vector = X86_TRAP_UD;
+	fred_emulate_fault(regs);
+}

1) rename this to fred_emulate_ud (since that is what it actually does.)

... then ...

	/* The compiler can fold these into a single test */

	if (likely(regs->vector == FRED_SYSCALL && regs->l)) {
		fred_syscall64(regs);
	} else if (likely(regs->vector == FRED_SYSENTER && !regs->l)) {
		fred_sysenter32(regs);
	} else if (regs->vector == FRED_SYSCALL ||
		   regs->vector == FRED_SYSENTER) {
		/* Invalid SYSCALL or SYSENTER instruction */
		fred_emulate_ud(regs);
	} else {
		/* Unknown event */
		fred_bad_event(regs);
	}

... or the SYSCALL64 and SYSENTER32 can be inlined with the appropriate 
comment (gcc will do so regardless.)

	-hpa



	-hpa


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 22:11:29 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 22:11:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573492.898252 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQb6v-0008S5-3E; Mon, 31 Jul 2023 22:11:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573492.898252; Mon, 31 Jul 2023 22:11:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQb6u-0008Ry-VN; Mon, 31 Jul 2023 22:11:28 +0000
Received: by outflank-mailman (input) for mailman id 573492;
 Mon, 31 Jul 2023 22:11:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQb6t-0008Rg-Cq; Mon, 31 Jul 2023 22:11:27 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQb6t-00053o-8I; Mon, 31 Jul 2023 22:11:27 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1qQb6t-0001Qs-08; Mon, 31 Jul 2023 22:11:27 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1qQb6s-00070K-Tk; Mon, 31 Jul 2023 22:11:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=IUeqVcFK/1x4cuhFbkujLNvD576UAqXWGwHbzjaHTKo=; b=bmK5PUS7LlIv6je/KOY3BZGGFu
	VMMnhgDWHANW0HS7+aa1CwL/XF6CUt+Myw1yktymUTaUhW8PTFps7X4F1jElZWla3ghW2cgYlW40x
	pHl20qUpLDMXyAx6fetG0GQv8lRO6OiuW1Wy86Cvum3pEgH7C1u8Mv5JWmUrChkTmzp0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-182090-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 182090: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=677f2c6f1509da21258e02957b869b71b008fc61
X-Osstest-Versions-That:
    ovmf=70f3e62dc73d28962b833373246ef25c865c575e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 31 Jul 2023 22:11:26 +0000

flight 182090 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/182090/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 677f2c6f1509da21258e02957b869b71b008fc61
baseline version:
 ovmf                 70f3e62dc73d28962b833373246ef25c865c575e

Last test of basis   182084  2023-07-31 01:44:53 Z    0 days
Testing same since   182090  2023-07-31 12:44:11 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Ard Biesheuvel <ardb@kernel.org>
  Ard Biesheuvel <ardb@kernel.org> # Debian clang version 14.0.6
  Sunil V L <sunilvl@ventanamicro.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-i386-xl-qemuu-ovmf-amd64                          pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   70f3e62dc7..677f2c6f15  677f2c6f1509da21258e02957b869b71b008fc61 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 22:29:25 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 22:29:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573502.898262 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQbO2-0001qt-MZ; Mon, 31 Jul 2023 22:29:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573502.898262; Mon, 31 Jul 2023 22:29:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQbO2-0001qm-Ix; Mon, 31 Jul 2023 22:29:10 +0000
Received: by outflank-mailman (input) for mailman id 573502;
 Mon, 31 Jul 2023 22:29:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=SN+h=DR=flex--seanjc.bounces.google.com=3sTXIZAYKCWoaMIVRKOWWOTM.KWUfMV-LMdMTTQaba.fMVXZWRMKb.WZO@srs-se1.protection.inumbo.net>)
 id 1qQbO0-0001qd-Ra
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 22:29:08 +0000
Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com
 [2607:f8b0:4864:20::1149])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a9021a38-2ff1-11ee-b257-6b7b168915f2;
 Tue, 01 Aug 2023 00:29:07 +0200 (CEST)
Received: by mail-yw1-x1149.google.com with SMTP id
 00721157ae682-585fb08172bso31623387b3.2
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 15:29:07 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a9021a38-2ff1-11ee-b257-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20221208; t=1690842546; x=1691447346;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:from:to:cc:subject:date:message-id:reply-to;
        bh=1Q8GvYD+4dtlsTwSTiHUPQzTJlHbTbzrpGF3h1vVBww=;
        b=wjwMM2KWT8HU0SHDHdNRxn0t00ajJ3rnXd0KHF3IvjHCM9C9HEucQqbNqO3DdnlESa
         nz4NidPHfLZdlM97AQO2l5R9cvi5qOsP8Ijvq8FdyQ975MNIp/vKfJQp4Fn/KRaq6Jwk
         4kloVUH4EDmpWV0M/Jbjnxx6ZpxxBUBTWBZfCkK7wrUfN/3hE3YtfIlsy05XGvIcQMBR
         YwOaTVtyj5jc9ti6xzcRvjvMofBrcZ2GDu27qgywzvVHzJ4o32YZtNXzHqvcANqA6/YW
         sTLo8o8faSsSn6oqDWZE2/b1jMu9Jj3r8qqQ2mBwBCqkSpgBEgjiP8UrfNG7IjOkrlZB
         RMgg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690842546; x=1691447346;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=1Q8GvYD+4dtlsTwSTiHUPQzTJlHbTbzrpGF3h1vVBww=;
        b=ZhDk+Fu1mif4EqxdEyXdpuJCwV+FTdO/B5N1D8EtbMWFfv4M4xpX88T4D+f9J8q06l
         7DpXK6a4SmDO00t49Ljwfyyk//0t+aN1ADUlmhZP/N4SVk3mLOiv+73B3UU+8i7HSNuF
         3ygl5uclI4TtfBxqmLP0C5DkaoEjTrKUMHfKgwlSiF7Jnt2pQoIhkr520N6mS06A/+6V
         R86ca9dT3GrQE6XuQgXVEtW60KelH2Ncfmkvgyip4vXG+Tk7EkllEMtgaxiuFD1LfIfZ
         ja3cwz/99Uvr0XE//sbzMzXKk48t6xyB2iOK5u7r/RUK/VnwBK1HgcR1v0FAztvAPTIK
         NS2w==
X-Gm-Message-State: ABy/qLZJuuVlhjQzZIIWwJDAPOm7vTmDwOlULNLD+QYAkRg9WgW4Ietn
	vgcP/HWsI71GWFyPDZeRpqhOSs0PlHA=
X-Google-Smtp-Source: APBJJlGgIomNHDqU6KhEMJb1Ck8ilBU2ctVZYZehyK88j/kbenJFHvBGJ75gfwK64a/yrr50dO0Jiu4+k6c=
X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37])
 (user=seanjc job=sendgmr) by 2002:a81:b109:0:b0:56d:502:9eb0 with SMTP id
 p9-20020a81b109000000b0056d05029eb0mr90305ywh.6.1690842545957; Mon, 31 Jul
 2023 15:29:05 -0700 (PDT)
Date: Mon, 31 Jul 2023 15:29:04 -0700
In-Reply-To: <20230731063317.3720-1-xin3.li@intel.com>
Mime-Version: 1.0
References: <20230731063317.3720-1-xin3.li@intel.com>
Message-ID: <ZMg1sD7IamB0INVs@google.com>
Subject: Re: [PATCH v9 00/36] x86: enable FRED for x86-64
From: Sean Christopherson <seanjc@google.com>
To: Xin Li <xin3.li@intel.com>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	linux-edac@vger.kernel.org, linux-hyperv@vger.kernel.org, kvm@vger.kernel.org, 
	xen-devel@lists.xenproject.org, Jonathan Corbet <corbet@lwn.net>, 
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	"H . Peter Anvin" <hpa@zytor.com>, Andy Lutomirski <luto@kernel.org>, Oleg Nesterov <oleg@redhat.com>, 
	Tony Luck <tony.luck@intel.com>, "K . Y . Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Paolo Bonzini <pbonzini@redhat.com>, 
	Wanpeng Li <wanpengli@tencent.com>, Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Stefano Stabellini <sstabellini@kernel.org>, 
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, Josh Poimboeuf <jpoimboe@kernel.org>, 
	"Paul E . McKenney" <paulmck@kernel.org>, Catalin Marinas <catalin.marinas@arm.com>, 
	Randy Dunlap <rdunlap@infradead.org>, Steven Rostedt <rostedt@goodmis.org>, 
	Kim Phillips <kim.phillips@amd.com>, Hyeonggon Yoo <42.hyeyoo@gmail.com>, 
	"Liam R . Howlett" <Liam.Howlett@oracle.com>, 
	Sebastian Reichel <sebastian.reichel@collabora.com>, 
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>, Suren Baghdasaryan <surenb@google.com>, 
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>, Jiaxi Chen <jiaxi.chen@linux.intel.com>, 
	Babu Moger <babu.moger@amd.com>, Jim Mattson <jmattson@google.com>, 
	Sandipan Das <sandipan.das@amd.com>, Lai Jiangshan <jiangshanlai@gmail.com>, 
	Hans de Goede <hdegoede@redhat.com>, Reinette Chatre <reinette.chatre@intel.com>, 
	Daniel Sneddon <daniel.sneddon@linux.intel.com>, Breno Leitao <leitao@debian.org>, 
	Nikunj A Dadhania <nikunj@amd.com>, Brian Gerst <brgerst@gmail.com>, 
	Sami Tolvanen <samitolvanen@google.com>, Alexander Potapenko <glider@google.com>, 
	Andrew Morton <akpm@linux-foundation.org>, Arnd Bergmann <arnd@arndb.de>, 
	"Eric W . Biederman" <ebiederm@xmission.com>, Kees Cook <keescook@chromium.org>, 
	Masami Hiramatsu <mhiramat@kernel.org>, Masahiro Yamada <masahiroy@kernel.org>, Ze Gao <zegao2021@gmail.com>, 
	Fei Li <fei1.li@intel.com>, Conghui <conghui.chen@intel.com>, 
	Ashok Raj <ashok.raj@intel.com>, "Jason A . Donenfeld" <Jason@zx2c4.com>, 
	Mark Rutland <mark.rutland@arm.com>, Jacob Pan <jacob.jun.pan@linux.intel.com>, 
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, Jane Malalane <jane.malalane@citrix.com>, 
	David Woodhouse <dwmw@amazon.co.uk>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, 
	Arnaldo Carvalho de Melo <acme@redhat.com>, Yantengsi <siyanteng@loongson.cn>, 
	Christophe Leroy <christophe.leroy@csgroup.eu>, Sathvika Vasireddy <sv@linux.ibm.com>
Content-Type: text/plain; charset="us-ascii"

On Sun, Jul 30, 2023, Xin Li wrote:
> This patch set enables the Intel flexible return and event delivery
> (FRED) architecture for x86-64.

...

> -- 
> 2.34.1

What is this based on?	FYI, you're using a version of git that will (mostly)
automatically generate the based, e.g. I do 

  git format-patch --base=HEAD~$nr ...

in my scripts, where $nr is the number of patches I am sending.  My specific
approaches requires HEAD-$nr to be a publicly visible object/commit, but that
should be the case the vast majority of the time anyways.


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 23:11:26 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 23:11:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573507.898271 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQc2o-0007Fp-QU; Mon, 31 Jul 2023 23:11:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573507.898271; Mon, 31 Jul 2023 23:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQc2o-0007Fi-Nj; Mon, 31 Jul 2023 23:11:18 +0000
Received: by outflank-mailman (input) for mailman id 573507;
 Mon, 31 Jul 2023 23:11:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQc2m-0007Fc-Ux
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 23:11:17 +0000
Received: from mgamail.intel.com (unknown [192.55.52.88])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8981a30f-2ff7-11ee-b257-6b7b168915f2;
 Tue, 01 Aug 2023 01:11:13 +0200 (CEST)
Received: from fmsmga006.fm.intel.com ([10.253.24.20])
 by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 16:11:08 -0700
Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83])
 by fmsmga006.fm.intel.com with ESMTP; 31 Jul 2023 16:11:08 -0700
Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by
 fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.27; Mon, 31 Jul 2023 16:11:08 -0700
Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by
 fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.27; Mon, 31 Jul 2023 16:11:07 -0700
Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by
 fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.27 via Frontend Transport; Mon, 31 Jul 2023 16:11:07 -0700
Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.172)
 by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.27; Mon, 31 Jul 2023 16:11:07 -0700
Received: from SA1PR11MB6734.namprd11.prod.outlook.com (2603:10b6:806:25d::22)
 by BN9PR11MB5306.namprd11.prod.outlook.com (2603:10b6:408:137::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 23:10:57 +0000
Received: from SA1PR11MB6734.namprd11.prod.outlook.com
 ([fe80::50e4:2cb8:4529:af04]) by SA1PR11MB6734.namprd11.prod.outlook.com
 ([fe80::50e4:2cb8:4529:af04%7]) with mapi id 15.20.6631.043; Mon, 31 Jul 2023
 23:10:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8981a30f-2ff7-11ee-b257-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690845073; x=1722381073;
  h=from:to:cc:subject:date:message-id:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=ZD/+ZpxHfodW+ZLWEjcr6u2s3ce4eeJ3Z1p5oYJp9/4=;
  b=K90rminFnJf3HE1S7U5i3SrEC68FjcGdPEyh9DxWsM5ChUDzry9dfxDr
   c6hkC8U8iWNgXcPQUkskIx8YPrzokkg7ReJrrWpDm/K8sJgK3VCOAz3Zu
   tZCp05BvScqFt0vtoQy4xl/SYXGJrdlW0lWaJdXzBgOxX94wgRgzTDmSb
   iAes1Yw1NY8FHLe+xOSRECoSzhzq+en5DmX6lWa7q/botx+9rfaQaHHrM
   lPKFlBqe5GVrO4fr+QM5XghQ5m6ANKNGnbS4cf6KuCn8C6TYTwpf0wpP+
   MPa1Vns2gwAYhYjrYFsP6IFtZFFgr7Vv+Outh7UtV6e461EWCx/vDnH5Z
   Q==;
X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="400097830"
X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; 
   d="scan'208";a="400097830"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="975064042"
X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; 
   d="scan'208";a="975064042"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=g0+ouxh+TaCRX3F9I8a5aSp3Y8TKCjTiGPrlPYkgU6Mz1+NPPX83lyY77XNwQu5gNI+X115I2WJ2Vd/rH7lzzYRkmi2BkB+IdioqW40+UIakrLPbJ6oih4yh9gihwbXZGKBbxe4JVJGgO2LLBtOeMWPmPLUKwNAQw09O2JC7R69cZd8EMCflBkaVN7GWcsEhFnQJQDBX2SAiUIpzVPwGGJG6sRX9Ix9UgN0Dz+b6/41037sybWndXU09XlWTkBYsMJi3rhmqyguVrHKFSg7kS4vM9kKEi7FaWICm+fGQSgX4AL3vLvktUq7gaLgMZADtV74Uj3YwMBoQ+S4ReNgjrg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=x4/+v80E+BngUl9SBpMgtl8flbme6Gw0FAkBelGbhAo=;
 b=S3N1K6gYnbp6X9059kaK739RfS1UPQK2gxubiB5u7upu5bEKyxD/WgetcaDlDiYtpwoX9Du2J+UhPIinwDZkfExV2axpXPVEhf+RXYJa7+YbyzG59Wa13dv554U3NcO7RM4fuMTgdAa2Nml7K3/2bJVP3bvVRonrjzPU/lNTm3C8gTkuDrgV1AAsXpYrEG7wudzZFjxB6WioPp9z0I0vFx/fH8Zf6GP5Fy0x9mucxja/i9kVfO5sn8O52gG+24dfV4ZPe3aw/K0ynZi2Ksk/kB6sBhB22mLq82nH2A/1F5buA5dftq5XRsdyl0JK9ALCURQNrm+7cMVPGv7Ot1XA8Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
From: "Li, Xin3" <xin3.li@intel.com>
To: "Christopherson,, Sean" <seanjc@google.com>
CC: "linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>, Jonathan Corbet <corbet@lwn.net>, "Thomas
 Gleixner" <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, "Borislav
 Petkov" <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
	"x86@kernel.org" <x86@kernel.org>, "H . Peter Anvin" <hpa@zytor.com>,
	"Lutomirski, Andy" <luto@kernel.org>, Oleg Nesterov <oleg@redhat.com>, "Luck,
 Tony" <tony.luck@intel.com>, "K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, "Cui,
 Dexuan" <decui@microsoft.com>, Paolo Bonzini <pbonzini@redhat.com>, "Wanpeng
 Li" <wanpengli@tencent.com>, Vitaly Kuznetsov <vkuznets@redhat.com>, "Peter
 Zijlstra" <peterz@infradead.org>, "Gross, Jurgen" <jgross@suse.com>, "Stefano
 Stabellini" <sstabellini@kernel.org>, Oleksandr Tyshchenko
	<oleksandr_tyshchenko@epam.com>, Josh Poimboeuf <jpoimboe@kernel.org>, "Paul
 E . McKenney" <paulmck@kernel.org>, Catalin Marinas
	<catalin.marinas@arm.com>, Randy Dunlap <rdunlap@infradead.org>, "Steven
 Rostedt" <rostedt@goodmis.org>, Kim Phillips <kim.phillips@amd.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>, "Liam R . Howlett"
	<Liam.Howlett@oracle.com>, Sebastian Reichel
	<sebastian.reichel@collabora.com>, "Kirill A . Shutemov"
	<kirill.shutemov@linux.intel.com>, Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>, Jiaxi Chen
	<jiaxi.chen@linux.intel.com>, Babu Moger <babu.moger@amd.com>, Jim Mattson
	<jmattson@google.com>, Sandipan Das <sandipan.das@amd.com>, Lai Jiangshan
	<jiangshanlai@gmail.com>, Hans de Goede <hdegoede@redhat.com>, "Chatre,
 Reinette" <reinette.chatre@intel.com>, Daniel Sneddon
	<daniel.sneddon@linux.intel.com>, Breno Leitao <leitao@debian.org>, "Nikunj A
 Dadhania" <nikunj@amd.com>, Brian Gerst <brgerst@gmail.com>, Sami Tolvanen
	<samitolvanen@google.com>, Alexander Potapenko <glider@google.com>, "Andrew
 Morton" <akpm@linux-foundation.org>, Arnd Bergmann <arnd@arndb.de>, "Eric W .
 Biederman" <ebiederm@xmission.com>, Kees Cook <keescook@chromium.org>,
	"Masami Hiramatsu" <mhiramat@kernel.org>, Masahiro Yamada
	<masahiroy@kernel.org>, "Ze Gao" <zegao2021@gmail.com>, "Li, Fei1"
	<fei1.li@intel.com>, Conghui <conghui.chen@intel.com>, "Raj, Ashok"
	<ashok.raj@intel.com>, "Jason A . Donenfeld" <Jason@zx2c4.com>, Mark Rutland
	<mark.rutland@arm.com>, Jacob Pan <jacob.jun.pan@linux.intel.com>, Jiapeng
 Chong <jiapeng.chong@linux.alibaba.com>, Jane Malalane
	<jane.malalane@citrix.com>, "Woodhouse, David" <dwmw@amazon.co.uk>,
	"Ostrovsky, Boris" <boris.ostrovsky@oracle.com>, Arnaldo Carvalho de Melo
	<acme@redhat.com>, Yantengsi <siyanteng@loongson.cn>, Christophe Leroy
	<christophe.leroy@csgroup.eu>, Sathvika Vasireddy <sv@linux.ibm.com>
Subject: RE: [PATCH v9 00/36] x86: enable FRED for x86-64
Thread-Topic: [PATCH v9 00/36] x86: enable FRED for x86-64
Thread-Index: AQHZw3zlhMSIUq8NQ0C4pAXZBOhbuq/UddgAgAAIhXA=
Date: Mon, 31 Jul 2023 23:10:56 +0000
Message-ID: <SA1PR11MB6734A02EEFD83969F1965A8FA805A@SA1PR11MB6734.namprd11.prod.outlook.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
 <ZMg1sD7IamB0INVs@google.com>
In-Reply-To: <ZMg1sD7IamB0INVs@google.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA1PR11MB6734:EE_|BN9PR11MB5306:EE_
x-ms-office365-filtering-correlation-id: 6ca7deae-ff98-4b92-cd6f-08db921b6525
x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: jWedD0ovvdzTRGlP0Hqaceh32J+cvlb1Hywq8xtjzB1D/OmXZ5BrQ0G8xe5fJcWMj7bx7DbvzbyPZRAaejZcyKMXYkAGdL2gOFmChywnY4t5Xiuqib/D+3obpN5baVe5fkr/i9HOCnuVXPIprJAYe7Kj2HmQehEXKgRm4qzB00JTuLN2Ac9GZApld+Jt63UAl2TE2vbW9yk1cg/JJQdnGFYMuPVmrhSrryeqGgspwawTh9OSAuP7yLWMpvjXaPbPayCinbBjG1CutfM+j1vMQAh7tuPhWzAQ0b+79pK6QoFWl5Ub/VUJ4fGO4AxYlaoDpp4q6b+osqmC3kgjfzVxsQBe6b1XymIjb+SEN9/E8Jm2zNGLzH43LDW/kbpV3MWG/zMpJhZqocxLOYthGsfXdg+0VHMGgrBu7JSiz19ttiCEowEgxCmC+lD8utMlddleWn2Bo3zG+q83bnEmBQa8mziSLYuWUlmRCdldzOSFHYfeI9UaAp825ddNKCyEkqAS61n8ogcLzF+edOd1RK3wssrsr7K/kN+akva/+34c77nbest3wp/qsR/fm0VtTcw/r7yBZrOxxVaaqCQrfxU0LrgcRnEG4VODAM5rFMBo5s8M5LmmsrwiyU9qqYdDKwV6
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR11MB6734.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(136003)(376002)(39860400002)(366004)(346002)(451199021)(38100700002)(86362001)(66476007)(8676002)(8936002)(64756008)(5660300002)(316002)(4326008)(66446008)(6916009)(7406005)(54906003)(7366002)(7416002)(122000001)(33656002)(76116006)(52536014)(66556008)(66946007)(82960400001)(38070700005)(41300700001)(478600001)(2906002)(71200400001)(9686003)(7696005)(6506007)(26005)(83380400001)(186003)(55016003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?O7GfaB6zW2tbF5rOwxySLTd3lQk0aE5LrrF3TO3yhcM7keeR8Udm5Y5IxXw3?=
 =?us-ascii?Q?me5cbjkFPMqzvipO2NaP6AoYxcYdVVy+h1ReWcoL9CnfAFuAzW8cKcLPZR4r?=
 =?us-ascii?Q?+2aXU+lxPJsL5z13p0f11bdA+CdXFxyc4Gd24+A9WPruf1WFYxuNkSi5cl+E?=
 =?us-ascii?Q?G2SYAWs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xvd6UYM6w55lMKyjyXQUu3ibfaS1ZKVu71DwBi4E8?=
 =?us-ascii?Q?+75SsEx13B8TQBA/DQzzEvhB/7/TpsVLlkh0mfRx5wknSX0cm6GzpYsAnVy9?=
 =?us-ascii?Q?ggKVddVjKMzG8bxpwBBnbHn3zAdHFkKasx9vSVrgjcSAKb5IABZHw3RmjvbH?=
 =?us-ascii?Q?/+D6YARyB4N0rIAIoE4u4x9PA9ivjO6tjmSINkQwSJWHMhBIxC6MjNf2zFcv?=
 =?us-ascii?Q?rA6sYngfQAglqM2T5tHSUp87aXztn/yoaGa0UDhZBNxWWVVcRXFG12uPZPl+?=
 =?us-ascii?Q?W0IEVttRu6pDPO9JbqMJ7K7LJnqB7esIohRBlyaT2KK6mnzR48GZMuVMxnQ8?=
 =?us-ascii?Q?jYyJlogJJNlMuR77L2lzWwBPeTvvM3h8duRUQkau1Y83QPFkCLGdoONqxndo?=
 =?us-ascii?Q?Tws1YL3fnAIaNXy7Y0Ay8WUoqBdJoifGm/8OjyQ8ic8d19J25C1FVPUgglna?=
 =?us-ascii?Q?upeR2N7DOnRCCRcBVVef1NlbmdvKFiyIdTEc5xxz9hnONiN0OggfI0LcLD88?=
 =?us-ascii?Q?43CQKOdLnjQNC303csI=3D?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA1PR11MB6734.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6ca7deae-ff98-4b92-cd6f-08db921b6525
X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jul 2023 23:10:56.1366
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: oyKmPWTD20Zsn+PCspph++rs7dNDf8h6M1zc7Qd27AcYGGmyYr+9Il1qixVJcqPMNoyE79Jic2KJub2uMXAulQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR11MB5306
X-OriginatorOrg: intel.com

> > This patch set enables the Intel flexible return and event delivery
> > (FRED) architecture for x86-64.
>=20
> ...
>=20
> > --
> > 2.34.1
>=20
> What is this based on?

The tip tree master branch.

> FYI, you're using a version of git that will (mostly)
> automatically generate the based, e.g. I do
>=20
>   git format-patch --base=3DHEAD~$nr ...
>=20
> in my scripts, where $nr is the number of patches I am sending.  My speci=
fic
> approaches requires HEAD-$nr to be a publicly visible object/commit, but =
that
> should be the case the vast majority of the time anyways.

Are you talking about that you only got a subset of this patch set?

HPA told me he only got patches 0-25/36.

And I got several undeliverable email notifications, saying
"
The following message to <tglx@linutronix.de> was undeliverable.
The reason for the problem:
5.x.1 - Maximum number of delivery attempts exceeded. [Default] 450-'4.7.25=
 Client host rejected: cannot find your hostname, [134.134.136.31]'
"

I guess there were some problems with the Intel mail system last night,
probably I should resend this patch set later.


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 23:17:45 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 23:17:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573511.898282 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQc8x-0007se-HC; Mon, 31 Jul 2023 23:17:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573511.898282; Mon, 31 Jul 2023 23:17:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQc8x-0007sX-CV; Mon, 31 Jul 2023 23:17:39 +0000
Received: by outflank-mailman (input) for mailman id 573511;
 Mon, 31 Jul 2023 23:17:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=PAQm=DR=flex--seanjc.bounces.google.com=3EEHIZAYKCd8TFBOKDHPPHMF.DPNYFO-EFWFMMJTUT.YFOQSPKFDU.PSH@srs-se1.protection.inumbo.net>)
 id 1qQc8w-0007sR-EG
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 23:17:38 +0000
Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com
 [2607:f8b0:4864:20::b4a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6fa9fcfd-2ff8-11ee-b257-6b7b168915f2;
 Tue, 01 Aug 2023 01:17:37 +0200 (CEST)
Received: by mail-yb1-xb4a.google.com with SMTP id
 3f1490d57ef6-d1c693a29a0so5968323276.1
 for <xen-devel@lists.xenproject.org>; Mon, 31 Jul 2023 16:17:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6fa9fcfd-2ff8-11ee-b257-6b7b168915f2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20221208; t=1690845456; x=1691450256;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:from:to:cc:subject:date:message-id:reply-to;
        bh=A2YbEGxqz9SscBGtet0Gs0ciHUjPL61/tRobVSn5JSc=;
        b=Aspi3sVz1s4NKlFaJjQOa2DQlODn/JsCKt4eqnvhQolwNg6rVTEqjLQs26sN5J6ZNe
         3e/etHAaEqvAoxl+oSQQP1bHfmA59RbK7Nu0azx4K+EVcSxVntDfjH8buFsuy2V7KlEw
         5RZ7h2m65ZZHDqRcD6/spD/JjZaCVH323kw1HLp8C4YPZbjDkNb49TqTz+Z2vaOWATUw
         n/OnsLadTVEbeeCCi9f1Xp8cRMaUuSd29J6gHrEWBjtkXdfJ7q9euJ/ihFEIWOoOKssN
         /B9i1WTYQfm0A5NhSpMZHAiVkGnI47YF/h8cE5B0h4DZfCGtUwSF1W1GjS47WDQ5r/1d
         NbPw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20221208; t=1690845456; x=1691450256;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=A2YbEGxqz9SscBGtet0Gs0ciHUjPL61/tRobVSn5JSc=;
        b=GJTGHDJ2YPW8hv2HNXjvPG4FV42KFZhG6DUkgahg+2PkwlsA0AJEa7zUuJpr4+ZyYG
         F6XfIWOTFmm0Szpgk2st7kOxTgytSYXzgTOFhhOO4QHWAnYzwO6yfsHljARB2u3DITs2
         SaJ9VwWuNZQSyGvV/kdiTVvEaXbLpsXn/hDpnSKre/PdaGAremHojmhEnMxjE52I6pYc
         6/JOt58OKX1R3pQTTn9iS2Tt97yXX+oxrXnGVa9F0IYCJ5w+qaLG8qVn4uCFxwuCHVrn
         wcyjK+BCx96bbjrGdo50XgbjlhjtR3e8UriM9smhThs5hYhzTFnucacLHiYp2SK1folK
         3HRA==
X-Gm-Message-State: ABy/qLa2bqWH05mtJWjF9AzPZPWVNQw8fJ4ezKBxuiGv6jzG31eaHZm8
	LODQYY4VxexPRy92GnWdU9Oz7ZkbgdA=
X-Google-Smtp-Source: APBJJlETEe4EZ6/j95cQ4sv3ryYhK33RfUu+RWsNUCsL/BaRynxJ5PFVR6kJ5MkvzQvyz83entZG77hN4jM=
X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37])
 (user=seanjc job=sendgmr) by 2002:a25:69c7:0:b0:d07:f1ed:521a with SMTP id
 e190-20020a2569c7000000b00d07f1ed521amr63258ybc.4.1690845456129; Mon, 31 Jul
 2023 16:17:36 -0700 (PDT)
Date: Mon, 31 Jul 2023 16:17:34 -0700
In-Reply-To: <SA1PR11MB6734A02EEFD83969F1965A8FA805A@SA1PR11MB6734.namprd11.prod.outlook.com>
Mime-Version: 1.0
References: <20230731063317.3720-1-xin3.li@intel.com> <ZMg1sD7IamB0INVs@google.com>
 <SA1PR11MB6734A02EEFD83969F1965A8FA805A@SA1PR11MB6734.namprd11.prod.outlook.com>
Message-ID: <ZMhBDoTxqghvF7G7@google.com>
Subject: Re: [PATCH v9 00/36] x86: enable FRED for x86-64
From: Sean Christopherson <seanjc@google.com>
To: Xin3 Li <xin3.li@intel.com>
Cc: "linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>, 
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, 
	"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>, 
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>, "kvm@vger.kernel.org" <kvm@vger.kernel.org>, 
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Jonathan Corbet <corbet@lwn.net>, 
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, "x86@kernel.org" <x86@kernel.org>, 
	"H . Peter Anvin" <hpa@zytor.com>, Andy Lutomirski <luto@kernel.org>, Oleg Nesterov <oleg@redhat.com>, 
	Tony Luck <tony.luck@intel.com>, "K . Y . Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Paolo Bonzini <pbonzini@redhat.com>, 
	Wanpeng Li <wanpengli@tencent.com>, Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Peter Zijlstra <peterz@infradead.org>, Jurgen Gross <jgross@suse.com>, 
	Stefano Stabellini <sstabellini@kernel.org>, 
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, Josh Poimboeuf <jpoimboe@kernel.org>, 
	"Paul E . McKenney" <paulmck@kernel.org>, Catalin Marinas <catalin.marinas@arm.com>, 
	Randy Dunlap <rdunlap@infradead.org>, Steven Rostedt <rostedt@goodmis.org>, 
	Kim Phillips <kim.phillips@amd.com>, Hyeonggon Yoo <42.hyeyoo@gmail.com>, 
	"Liam R . Howlett" <Liam.Howlett@oracle.com>, 
	Sebastian Reichel <sebastian.reichel@collabora.com>, 
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>, Suren Baghdasaryan <surenb@google.com>, 
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>, Jiaxi Chen <jiaxi.chen@linux.intel.com>, 
	Babu Moger <babu.moger@amd.com>, Jim Mattson <jmattson@google.com>, 
	Sandipan Das <sandipan.das@amd.com>, Lai Jiangshan <jiangshanlai@gmail.com>, 
	Hans de Goede <hdegoede@redhat.com>, Reinette Chatre <reinette.chatre@intel.com>, 
	Daniel Sneddon <daniel.sneddon@linux.intel.com>, Breno Leitao <leitao@debian.org>, 
	Nikunj A Dadhania <nikunj@amd.com>, Brian Gerst <brgerst@gmail.com>, 
	Sami Tolvanen <samitolvanen@google.com>, Alexander Potapenko <glider@google.com>, 
	Andrew Morton <akpm@linux-foundation.org>, Arnd Bergmann <arnd@arndb.de>, 
	"Eric W . Biederman" <ebiederm@xmission.com>, Kees Cook <keescook@chromium.org>, 
	Masami Hiramatsu <mhiramat@kernel.org>, Masahiro Yamada <masahiroy@kernel.org>, Ze Gao <zegao2021@gmail.com>, 
	Fei1 Li <fei1.li@intel.com>, Conghui <conghui.chen@intel.com>, 
	Ashok Raj <ashok.raj@intel.com>, "Jason A . Donenfeld" <Jason@zx2c4.com>, 
	Mark Rutland <mark.rutland@arm.com>, Jacob Pan <jacob.jun.pan@linux.intel.com>, 
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, Jane Malalane <jane.malalane@citrix.com>, 
	David Woodhouse <dwmw@amazon.co.uk>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, 
	Arnaldo Carvalho de Melo <acme@redhat.com>, Yantengsi <siyanteng@loongson.cn>, 
	Christophe Leroy <christophe.leroy@csgroup.eu>, Sathvika Vasireddy <sv@linux.ibm.com>
Content-Type: text/plain; charset="us-ascii"

On Mon, Jul 31, 2023, Xin3 Li wrote:
> > > This patch set enables the Intel flexible return and event delivery
> > > (FRED) architecture for x86-64.
> > 
> > ...
> > 
> > > --
> > > 2.34.1
> > 
> > What is this based on?
> 
> The tip tree master branch.
> 
> > FYI, you're using a version of git that will (mostly)
> > automatically generate the based, e.g. I do
> > 
> >   git format-patch --base=HEAD~$nr ...
> > 
> > in my scripts, where $nr is the number of patches I am sending.  My specific
> > approaches requires HEAD-$nr to be a publicly visible object/commit, but that
> > should be the case the vast majority of the time anyways.
> 
> Are you talking about that you only got a subset of this patch set?

No, I'm saying I don't want to waste a bunch of time tracking down exactly which
commit a 36 patch series is based on.  E.g. I just refreshed tip/master and still
get:

Applying: x86/idtentry: Incorporate definitions/declarations of the FRED external interrupt handler type
error: sha1 information is lacking or useless (arch/x86/include/asm/idtentry.h).
error: could not build fake ancestor
Patch failed at 0024 x86/idtentry: Incorporate definitions/declarations of the FRED external interrupt handler type
hint: Use 'git am --show-current-patch=diff' to see the failed patch

> HPA told me he only got patches 0-25/36.
> 
> And I got several undeliverable email notifications, saying
> "
> The following message to <tglx@linutronix.de> was undeliverable.
> The reason for the problem:
> 5.x.1 - Maximum number of delivery attempts exceeded. [Default] 450-'4.7.25 Client host rejected: cannot find your hostname, [134.134.136.31]'
> "
> 
> I guess there were some problems with the Intel mail system last night,
> probably I should resend this patch set later.

Yes, lore also appears to be missing patches.  I grabbed the mbox off of KVM's
patchwork instance.


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 23:38:14 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 23:38:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573518.898291 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQcSd-00022t-5i; Mon, 31 Jul 2023 23:37:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573518.898291; Mon, 31 Jul 2023 23:37:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQcSd-00022m-2a; Mon, 31 Jul 2023 23:37:59 +0000
Received: by outflank-mailman (input) for mailman id 573518;
 Mon, 31 Jul 2023 23:37:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=vA1f=DR=raptorengineering.com=sanastasio@srs-se1.protection.inumbo.net>)
 id 1qQcSb-00022g-Mc
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 23:37:57 +0000
Received: from raptorengineering.com (mail.raptorengineering.com
 [23.155.224.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 45e79538-2ffb-11ee-b257-6b7b168915f2;
 Tue, 01 Aug 2023 01:37:55 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 39A3682846BB;
 Mon, 31 Jul 2023 18:37:54 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id VUFWwWELxJZ0; Mon, 31 Jul 2023 18:37:53 -0500 (CDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.rptsys.com (Postfix) with ESMTP id 4F45082850DA;
 Mon, 31 Jul 2023 18:37:53 -0500 (CDT)
Received: from mail.rptsys.com ([127.0.0.1])
 by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id 4W3dQPQPirl4; Mon, 31 Jul 2023 18:37:53 -0500 (CDT)
Received: from [10.11.0.2] (5.edge.rptsys.com [23.155.224.38])
 by mail.rptsys.com (Postfix) with ESMTPSA id D8EE582846BB;
 Mon, 31 Jul 2023 18:37:52 -0500 (CDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 45e79538-2ffb-11ee-b257-6b7b168915f2
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 4F45082850DA
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD;
	t=1690846673; bh=SFbRSRktHw+6jWGitffOKn3udjPo8wO6h1ujQG9tglE=;
	h=Message-ID:Date:MIME-Version:To:From;
	b=iiLsatslWnt+tcFRNeoBMH6FbqnlYF4HYSu8TPI7Nfpi1blrAYm3nlTalSvIsGCI2
	 Fy/nCIydkuu+TPvrC1ta3aCYMw7oOJPbBP0ZhzEZH7PY1CX57+6Qz5sSCDVAGAzudb
	 qh39Tz0E8L7VgaATkI+MNxiKv+zOYqnd8iHAqvIM=
X-Virus-Scanned: amavisd-new at rptsys.com
Message-ID: <428aa0e8-70bb-efb5-2b5a-54229b77c5a3@raptorengineering.com>
Date: Mon, 31 Jul 2023 18:37:52 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Subject: Re: [PATCH 2/3] xen/ppc: Relocate kernel to physical address 0 on
 boot
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1690582001.git.sanastasio@raptorengineering.com>
 <0802fad2743526da4fe49f0225e14161464f192e.1690582001.git.sanastasio@raptorengineering.com>
 <3b6b0984-89fb-268e-970a-0c7eb19a4863@suse.com>
From: Shawn Anastasio <sanastasio@raptorengineering.com>
In-Reply-To: <3b6b0984-89fb-268e-970a-0c7eb19a4863@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 7/31/23 10:46 AM, Jan Beulich wrote:
> On 29.07.2023 00:21, Shawn Anastasio wrote:
>> Introduce a small assembly loop in `start` to copy the kernel to
>> physical address 0 before continuing. This ensures that the physical
>> address lines up with XEN_VIRT_START (0xc000000000000000) and allows us
>> to identity map the kernel when the MMU is set up in the next patch.
> 
> So PPC guarantees there's always a reasonable amount of memory at 0,
> and that's available for use?

Both Linux and FreeBSD rely on this being the case, so it's essentially
a de facto standard, though I'm not aware of any specification that
guarantees it.

>> --- a/xen/arch/ppc/ppc64/head.S
>> +++ b/xen/arch/ppc/ppc64/head.S
>> @@ -18,6 +18,33 @@ ENTRY(start)
>>      addis   %r2, %r12, .TOC.-1b@ha
>>      addi    %r2, %r2, .TOC.-1b@l
>>  
>> +    /*
>> +     * Copy Xen to physical address zero and jump to XEN_VIRT_START
>> +     * (0xc000000000000000). This works because the hardware will ignore the top
>> +     * four address bits when the MMU is off.
>> +     */
>> +    LOAD_REG_ADDR(%r1, start)
> 
> I think you really mean _start here (which is missing from the linker
> script),

The PIC patch series fixes the missing _start definition in the linker
script. In the cover letter of v2 I'll add a clear note that this series
is based on that one.

> not start. See also Andrew's recent related RISC-V change.

Good point. In practice this worked because the `start` function was the
first thing in the first section of the linker script, but of course
using _start here is more correct.

> 
>> +    LOAD_IMM64(%r12, XEN_VIRT_START)
>> +
>> +    /* If we're at the correct address, skip copy */
>> +    cmpld   %r1, %r12
>> +    beq     .L_correct_address
> 
> Can this ever be the case, especially with the MMU-off behavior you
> describe in the comment above? Wouldn't you need to ignore the top
> four bits in the comparison?

It will always be the case after the code jumps to XEN_VIRT_START after
the copy takes place. I could have it jump past the copy loop entirely,
but then I'd need to duplicate the TOC setup.

>> +    /* Copy bytes until _end */
>> +    LOAD_REG_ADDR(%r11, _end)
>> +    addi    %r1, %r1, -8
>> +    li      %r13, -8
>> +.L_copy_xen:
>> +    ldu     %r10, 8(%r1)
>> +    stdu    %r10, 8(%r13)
>> +    cmpld   %r1, %r11
>> +    blt     .L_copy_xen
>> +
>> +    /* Jump to XEN_VIRT_START */
>> +    mtctr   %r12
>> +    bctr
>> +.L_correct_address:
> 
> Can the two regions potentially overlap? Looking at the ELF header
> it's not clear to me what guarantees there are that this can't
> happen.

As I understand it, any bootloader that placed the kernel at a low
enough address for this to be an issue wouldn't be able to boot Linux or
FreeBSD, so in practice it's a safe bet that this won't be the case.

> Jan

Thanks,
Shawn


From xen-devel-bounces@lists.xenproject.org Mon Jul 31 23:56:54 2023
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Jul 2023 23:56:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.573522.898301 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQckn-0004V3-Bp; Mon, 31 Jul 2023 23:56:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 573522.898301; Mon, 31 Jul 2023 23:56:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1qQckn-0004Uw-97; Mon, 31 Jul 2023 23:56:45 +0000
Received: by outflank-mailman (input) for mailman id 573522;
 Mon, 31 Jul 2023 23:56:44 +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 <SRS0=8T0J=DR=intel.com=xin3.li@srs-se1.protection.inumbo.net>)
 id 1qQckm-0004Uq-2Q
 for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 23:56:44 +0000
Received: from mgamail.intel.com (unknown [134.134.136.100])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e2bd7f67-2ffd-11ee-8613-37d641c3527e;
 Tue, 01 Aug 2023 01:56:39 +0200 (CEST)
Received: from orsmga007.jf.intel.com ([10.7.209.58])
 by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 31 Jul 2023 16:56:35 -0700
Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81])
 by orsmga007.jf.intel.com with ESMTP; 31 Jul 2023 16:56:27 -0700
Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by
 fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.27; Mon, 31 Jul 2023 16:56:17 -0700
Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by
 fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.27 via Frontend Transport; Mon, 31 Jul 2023 16:56:17 -0700
Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by
 edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.27; Mon, 31 Jul 2023 16:56:17 -0700
Received: from SA1PR11MB6734.namprd11.prod.outlook.com (2603:10b6:806:25d::22)
 by SA3PR11MB7583.namprd11.prod.outlook.com (2603:10b6:806:306::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul
 2023 23:56:14 +0000
Received: from SA1PR11MB6734.namprd11.prod.outlook.com
 ([fe80::50e4:2cb8:4529:af04]) by SA1PR11MB6734.namprd11.prod.outlook.com
 ([fe80::50e4:2cb8:4529:af04%7]) with mapi id 15.20.6631.043; Mon, 31 Jul 2023
 23:56:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e2bd7f67-2ffd-11ee-8613-37d641c3527e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1690847799; x=1722383799;
  h=from:to:cc:subject:date:message-id:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=31WsicpcNNvek3YnklVyRXD0MklKRmtFMmVSh76vOCo=;
  b=fqY8jg9z7QivK41x5uEI/rbSSnuOZW+3wsVg4n72JYrw4LxDXmJSlTJe
   QIa78OJv6BrM6wacUl/JgZ/pc+eA86sOj6ncdY+8kASSy+2o+6HynjUYW
   kDunwo0J6NIAsfm7FAYq3/5VDgqHW69YJDtwvRp49CM1/MeIhOOiCM89i
   pa7wFnrsThyJ6Ofvhp+EY4l1KlxO12c5qyYTKFVPjzBJ55mcTE6Pvn6jT
   XECFQshrm+Ff42q/3pRQrmrLQIgz+sUxcHI1eTz+ai/x5P2E3KuWWizfa
   WMXxjUTeHhmh4b4nECsO/01MEFIMC1AcWKLoMZujNnOCbjmRx+/Xr6GxE
   w==;
X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="435473911"
X-IronPort-AV: E=Sophos;i="6.01,246,1684825200"; 
   d="scan'208";a="435473911"
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="722277434"
X-IronPort-AV: E=Sophos;i="6.01,246,1684825200"; 
   d="scan'208";a="722277434"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=MDFRp2hkuZuuO3RCWo7jyJTUenxPWv8RPHFGZuhn+b6xVqERTq9m4rmdw/Wl+Oq8FLiouU83Kbnb9oHDTJfJuhGHKJPfXgdcCdIOKqhS+CJ3He6jvmjbolXSRCWAamB6/OBKBhKzkrLWRvIHAOEmxyOtR9TzvOrJD9X0PBjClAH02GQEqNodu85QaCVaTDz5CEEPL0Oi3sYaNeYZR8yYy/3kP1GF19eBe/Si1q0GZdxyK0Ay0zFG1BFUk9Zz1+UuBEoeYUII+6hdcIp2l9W40dEXgbUagDNeLIju4m5EqMK8E7wdmoeFs4ma54EXGbfIeTmKY2OtHcdq3NKkA15iyw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/0sj4w5hcV1tPo+r2Dgugjcpxzo+B8dri5u2a20JY7Q=;
 b=H8dADxF6A94Jzr6wBvPn+ckhXmR5BnSEtJHY4nwiGR4DiApcyXUV9T1a5XK8JWRBK1p6/IkI2RxZU7xRrk5VOt/3plcimXXMOdqCyF4+iLxvL0pcE/MNn7rZ/WzaSiQmCAUWiN/QG1d5J4tMqNB0OFqBcd1oR/kFvLl3qV8a+n1VkSbEZtbipbTNh5pVax1isc4ng4bQSbuFNbaiLFJbKRjQ+k+/Yp2JTY27N17GVbbbZWsJ9O66RzL/CoYvqMJGZdDFKPJ/5mbP4PN1NtL1JT4lxmnCc+6GJJs2aOkke6QJxKsEjW6tjbPAB+GzUv9vYpKrBSRQivxnL7mmS/Dclw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
From: "Li, Xin3" <xin3.li@intel.com>
To: "Christopherson,, Sean" <seanjc@google.com>
CC: "linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>, Jonathan Corbet <corbet@lwn.net>, "Thomas
 Gleixner" <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, "Borislav
 Petkov" <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
	"x86@kernel.org" <x86@kernel.org>, "H . Peter Anvin" <hpa@zytor.com>,
	"Lutomirski, Andy" <luto@kernel.org>, Oleg Nesterov <oleg@redhat.com>, "Luck,
 Tony" <tony.luck@intel.com>, "K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, "Cui,
 Dexuan" <decui@microsoft.com>, Paolo Bonzini <pbonzini@redhat.com>, "Wanpeng
 Li" <wanpengli@tencent.com>, Vitaly Kuznetsov <vkuznets@redhat.com>, "Peter
 Zijlstra" <peterz@infradead.org>, "Gross, Jurgen" <jgross@suse.com>, "Stefano
 Stabellini" <sstabellini@kernel.org>, Oleksandr Tyshchenko
	<oleksandr_tyshchenko@epam.com>, Josh Poimboeuf <jpoimboe@kernel.org>, "Paul
 E . McKenney" <paulmck@kernel.org>, Catalin Marinas
	<catalin.marinas@arm.com>, Randy Dunlap <rdunlap@infradead.org>, "Steven
 Rostedt" <rostedt@goodmis.org>, Kim Phillips <kim.phillips@amd.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>, "Liam R . Howlett"
	<Liam.Howlett@oracle.com>, Sebastian Reichel
	<sebastian.reichel@collabora.com>, "Kirill A . Shutemov"
	<kirill.shutemov@linux.intel.com>, Suren Baghdasaryan <surenb@google.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>, Jiaxi Chen
	<jiaxi.chen@linux.intel.com>, Babu Moger <babu.moger@amd.com>, Jim Mattson
	<jmattson@google.com>, Sandipan Das <sandipan.das@amd.com>, Lai Jiangshan
	<jiangshanlai@gmail.com>, Hans de Goede <hdegoede@redhat.com>, "Chatre,
 Reinette" <reinette.chatre@intel.com>, Daniel Sneddon
	<daniel.sneddon@linux.intel.com>, Breno Leitao <leitao@debian.org>, "Nikunj A
 Dadhania" <nikunj@amd.com>, Brian Gerst <brgerst@gmail.com>, Sami Tolvanen
	<samitolvanen@google.com>, Alexander Potapenko <glider@google.com>, "Andrew
 Morton" <akpm@linux-foundation.org>, Arnd Bergmann <arnd@arndb.de>, "Eric W .
 Biederman" <ebiederm@xmission.com>, Kees Cook <keescook@chromium.org>, Masami
 Hiramatsu <mhiramat@kernel.org>, Masahiro Yamada <masahiroy@kernel.org>, Ze
 Gao <zegao2021@gmail.com>, "Li, Fei1" <fei1.li@intel.com>, Conghui
	<conghui.chen@intel.com>, "Raj, Ashok" <ashok.raj@intel.com>, "Jason A .
 Donenfeld" <Jason@zx2c4.com>, Mark Rutland <mark.rutland@arm.com>, Jacob Pan
	<jacob.jun.pan@linux.intel.com>, "Jiapeng Chong"
	<jiapeng.chong@linux.alibaba.com>, Jane Malalane <jane.malalane@citrix.com>,
	"Woodhouse, David" <dwmw@amazon.co.uk>, "Ostrovsky, Boris"
	<boris.ostrovsky@oracle.com>, Arnaldo Carvalho de Melo <acme@redhat.com>,
	Yantengsi <siyanteng@loongson.cn>, Christophe Leroy
	<christophe.leroy@csgroup.eu>, Sathvika Vasireddy <sv@linux.ibm.com>
Subject: RE: [PATCH v9 00/36] x86: enable FRED for x86-64
Thread-Topic: [PATCH v9 00/36] x86: enable FRED for x86-64
Thread-Index: AQHZw3zlhMSIUq8NQ0C4pAXZBOhbuq/UddgAgAAIhXCAAAUIAIAABoLg
Date: Mon, 31 Jul 2023 23:56:14 +0000
Message-ID: <SA1PR11MB6734CE532807D528CEF5063FA805A@SA1PR11MB6734.namprd11.prod.outlook.com>
References: <20230731063317.3720-1-xin3.li@intel.com>
 <ZMg1sD7IamB0INVs@google.com>
 <SA1PR11MB6734A02EEFD83969F1965A8FA805A@SA1PR11MB6734.namprd11.prod.outlook.com>
 <ZMhBDoTxqghvF7G7@google.com>
In-Reply-To: <ZMhBDoTxqghvF7G7@google.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA1PR11MB6734:EE_|SA3PR11MB7583:EE_
x-ms-office365-filtering-correlation-id: b79b50ba-925e-4885-c69c-08db9221b955
x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: fnpJ/4aIfIIMglKmffoocn8XcRv9dO8Mfjs0lsw2pL/abvEayvslP0KJxhorLH7Jpd2cVUPS+0MVNS+hm7tTYBQMe7FUiX2bp1hs83+cJXECGVGVwkSaY0DwKjC3icxE145kzBDw+IQA0Ut1QDz2Wi2htjUrTJghkhoG95Z893qBFAZDro6ZS4YVome9RnzhHXLZHPj2r2ggqClw8oDnlnqKQtRSBUWF3Yl6o+yHtviBxiOq7qOABkOAavAF3IGKlsIVUwnnmBzcBlT9F7JaAzF1F6QOU9km0nPGgcLcUbE4fgtru297gRmLWUGHgvaArcFIYH68IKJxnSpg6cJMLRxfOp8YH+XXom/LzqxVuUJAqIxheSbx+V1zxzyM99qwj6SaCpgIhR6SXfbYUOQpPTjAWGbSN5M8etMTEbBHoJ2WeHkSxVkn01TO0qFgzyKh1CqQgMFe5ksYWUGKB/Ra2WK1xEX+vYINFww/PfNrqs24mJLMhD+lwlUEx6j4zBLwhcEhYnWomWcpommuIYbs5oSSvxgbNYluZPrOvpCezij8FbV+y5mi15BLVur9a/vnx9D/G4R0RZdnZDaG9NgzNg711Pg34smVqQhM6R5r3ipZ8HUxkYDSBxqWeyAI2Hcarq4h9HCd58g51CUMEtNIkw==
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR11MB6734.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(366004)(39860400002)(376002)(136003)(396003)(451199021)(966005)(9686003)(7696005)(55016003)(6506007)(26005)(83380400001)(186003)(76116006)(33656002)(66946007)(52536014)(66556008)(7366002)(7416002)(7406005)(54906003)(122000001)(82960400001)(38070700005)(41300700001)(38100700002)(86362001)(66476007)(316002)(5660300002)(66446008)(6916009)(4326008)(8676002)(8936002)(64756008)(2906002)(71200400001)(478600001);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BGABAhTOr07x+mi6BWqWI7N9oQ/i+ya4IatXebIQVoCDKA3XbuHdie6RaLV9?=
 =?us-ascii?Q?Ikoy/kWqjVY/WIDSaupbIZi8CfQa1/oGF0XbpERbDMna6Dkmkng/CPdigWij?=
 =?us-ascii?Q?dpupTNlY+OLKzUW051H3mmyFHTAVM/PW/ruBKisScon4efLCWJ2OmMDcZ/bQ?=
 =?us-ascii?Q?72W+nm6v7buZbFBLEr89s88S3+SVhprIW5wQdZvCHHc3YoK3hymJ7KhCfyvY?=
 =?us-ascii?Q?5NoL8IYAUQZooP8t45JRXDECNWwU0JlmNx4lAX2eVo7fX0DhJpzNd3kxaVa+?=
 =?us-ascii?Q?dcxpuIDMOrEOgWVdqrnkSJAtHR6omT7TvcHqNzAxbD0qD+iFwujLO5l+XkI0?=
 =?us-ascii?Q?Sog9x/LbA0sIBRpDTiLrc8JYsbIAIUxkFaJ92Kj1/o/P3w41RWp9qB+JpWoh?=
 =?us-ascii?Q?gfDMlLFepChCQZuEoDbA1X/CoBkpwJLckXIvlVichqiHYvfLDKqI2lBkocLr?=
 =?us-ascii?Q?ZXVg+FT9rPx3ROaan336pMVnbin5YX1bDFt+q2h8HqJds3qdf3UPD9TSO8cG?=
 =?us-ascii?Q?4cwC24cET+PcSuRIFBZcKB4if5YBA9C8v5+psPPGCktN+uyg8AKMNh4HovRI?=
 =?us-ascii?Q?9Wj4hp3kpopeD9FMbVWCN9SEB3mEFPcCjOj1bnhIW6Ueu9oUFOYdQRuN8e8q?=
 =?us-ascii?Q?5iHE+ksTlH3KL1LNIFRy6a8bM1Po/4ZBgYN/aT+AviB4yBfT/aG+k5+4Uasp?=
 =?us-ascii?Q?Sp2NADp5gfjj8iY/A5//+HdqaYL/5dr6HlDBUtkS7c/7YnRWWkv5ULZIuSVY?=
 =?us-ascii?Q?ITCRdAyh67SJen0Ljo1Topj7DPxjbZgpYnf70UWtWWaUtC3+ciEpx5WJtHYi?=
 =?us-ascii?Q?0FqffeUPQNaBv0yUTfxFMA5ZV2q/diZ0uB6g171qhkktAmTkygITEIJ6xAj1?=
 =?us-ascii?Q?37cfZGUAzFs35JUzqIeaAwCFtQ2jnxm262v55jI/laf4LtizP+ZjY1Aou/Ak?=
 =?us-ascii?Q?dQ91ygm36oyfbIU/sRe8DSxHubw7lwpaTtI8Kl05IepfZXFAVd/LGkPT5HGo?=
 =?us-ascii?Q?DataDSddskzLc7/LQwz/wLJZkn5uGzoVVvQkhTi9JcICqXWNEnR3LP2ZP4DM?=
 =?us-ascii?Q?sG7iyJjedQmpKJUd2RqdMfO25r86g/ed4KeaGzNDEn71Y6xBDQUiZOoqBLtt?=
 =?us-ascii?Q?8YOPgvRQPUgItmEp8aDM10t6BWN52aH6HuiYbaEFS3JAouSrmYFyHK98IkGi?=
 =?us-ascii?Q?31Msk0T0bq2mLPoBZsWkAUmBTVg6NQsdwP/QB20n06hqAobIunQ6htOvR+rZ?=
 =?us-ascii?Q?5dzaUTISOPj8SkeWsiizXm5ddXja0DhbvYg6ITWiSkbXMq3VSh7OTHlFfctM?=
 =?us-ascii?Q?UIw8dedHl4F3hdQtz0SGoZmOtpChNF1DZbEeDAIfrpS/4zdJG2ISyfQki7g+?=
 =?us-ascii?Q?REObukGNLDF0fpxkbpq7oKo8baQbTt2e2r3PepVhs1uBNrdCmVYCdWiNJDvV?=
 =?us-ascii?Q?L1cPQ4GGUt2SD4usHINHj8mMIo5uusNYc392Z9uSIU4TGh5RZg4TY10vMmq5?=
 =?us-ascii?Q?SUx8kt+wdZLf0y6RLDnI48Z44R0tQzemsNlmzDcDhWkPZuebnlfwlwuj8+NW?=
 =?us-ascii?Q?G+wcifckvjaxlyOoIL8=3D?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA1PR11MB6734.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b79b50ba-925e-4885-c69c-08db9221b955
X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jul 2023 23:56:14.3777
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: j3v5tDRivwDnUkWJYMiphu+ldGU605WuA8UsJ4/IMsqwAzemGYciZrWfvE5R9DuPs3yWPuCg22FPPULjCVqAUw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR11MB7583
X-OriginatorOrg: intel.com

> > Are you talking about that you only got a subset of this patch set?
>=20
> No, I'm saying I don't want to waste a bunch of time tracking down exactl=
y which
> commit a 36 patch series is based on.  E.g. I just refreshed tip/master a=
nd still
> get:
>=20
> Applying: x86/idtentry: Incorporate definitions/declarations of the FRED =
external
> interrupt handler type
> error: sha1 information is lacking or useless (arch/x86/include/asm/idten=
try.h).
> error: could not build fake ancestor
> Patch failed at 0024 x86/idtentry: Incorporate definitions/declarations o=
f the FRED
> external interrupt handler type
> hint: Use 'git am --show-current-patch=3Ddiff' to see the failed patch

That is due to the following patch set (originally from tglx) is not
merged yet:

https://lore.kernel.org/lkml/20230621171248.6805-1-xin3.li@intel.com/

Sigh, I should have mentioned it in the cover letter.

As mentioned in the cover letter, 2 patches are sent out separately
as pre-FRED patches:
https://lore.kernel.org/lkml/20230706051443.2054-1-xin3.li@intel.com/
https://lore.kernel.org/lkml/20230706052231.2183-1-xin3.li@intel.com/

Sorry it's a bit complicated.

Got to mention, just in case you want to try out FRED, the current
public Intel Simics emulator has not updated to support FRED 5.0 yet
(it only supports FRED 3.0). The plan is late Q3, or early Q4.


